From bc59f2d963e2dc9b6dd9215521802d26529ccb55 Mon Sep 17 00:00:00 2001 From: support Date: Thu, 2 Feb 2023 09:48:44 +0000 Subject: [PATCH] Built motion from commit f25620e4.|2.6.30 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- .../chatWebsite/helpers/wildcard-expressions.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/mailInteractionHasTag/index.js | 2 +- .../mailInteractionHasTag.controller.js | 2 +- .../mailInteractionHasTag/mailInteractionHasTag.js | 2 +- .../mailInteractionHasTag.model.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/misc.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1209 files changed, 1209 insertions(+), 1209 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b7a017c..b744a27 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-02-02T09:08:11.555Z", + "time": "2023-02-02T09:39:28.183Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f55c105..ddf2410 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-02-02T09:08:11.555Z", + "time": "2023-02-02T09:39:28.183Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index c1e79c0..837a877 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 _0xe86b=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','action','STRING','integration','jscripty','urlForward'];(function(_0x420fab,_0x362358){var _0xe66988=function(_0x3c2a6f){while(--_0x3c2a6f){_0x420fab['push'](_0x420fab['shift']());}};_0xe66988(++_0x362358);}(_0xe86b,0x173));var _0xbe86=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe86b[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xbe86('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe86('0x1')],'get':function(_0x1b02a6){return this['getDataValue'](_0xbe86('0x2'));}},'action':{'type':Sequelize[_0xbe86('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbe86('0x4'),'motionbar',_0xbe86('0x5'),_0xbe86('0x6'),_0xbe86('0x7'),_0xbe86('0x8'),_0xbe86('0x9')]],'msg':_0xbe86('0xa')}},'comment':_0xbe86('0xa')},'data1':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comment':_0xbe86('0xb')},'data2':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comment':_0xbe86('0xc')},'data4':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comments':_0xbe86('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xbe86('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0xbe86('0xf')},'data7':{'type':Sequelize[_0xbe86('0x10')],'comments':_0xbe86('0x11')}}; \ No newline at end of file +var _0xf65a=['motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x4a48e5,_0x36daf4){var _0x1921b8=function(_0x205ac5){while(--_0x205ac5){_0x4a48e5['push'](_0x4a48e5['shift']());}};_0x1921b8(++_0x36daf4);}(_0xf65a,0x19b));var _0xaf65=function(_0x4a30f7,_0x1ff5f6){_0x4a30f7=_0x4a30f7-0x0;var _0x2b6a7b=_0xf65a[_0x4a30f7];return _0x2b6a7b;};'use strict';var Sequelize=require(_0xaf65('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf65('0x1')],'get':function(_0x5db5fb){return this[_0xaf65('0x2')](_0xaf65('0x3'));}},'action':{'type':Sequelize[_0xaf65('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xaf65('0x5'),_0xaf65('0x6'),_0xaf65('0x7'),'jscripty',_0xaf65('0x8'),_0xaf65('0x9'),_0xaf65('0xa'),_0xaf65('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xaf65('0xc')},'data1':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comment':_0xaf65('0xd')},'data2':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comment':_0xaf65('0xe')},'data3':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comment':_0xaf65('0xf')},'data4':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comments':_0xaf65('0x10')},'data6':{'type':Sequelize[_0xaf65('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xaf65('0x11')],'comments':_0xaf65('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 78e717e..82ceeb0 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 _0x4eb9=['sendStatus','status','end','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','body','find','params','catch','Action','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x4eb9,0x1a1));var _0x94eb=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x4eb9[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94eb('0x0'));var zipdir=require(_0x94eb('0x1'));var jsonpatch=require(_0x94eb('0x2'));var rp=require('request-promise');var moment=require(_0x94eb('0x3'));var BPromise=require(_0x94eb('0x4'));var Mustache=require(_0x94eb('0x5'));var util=require(_0x94eb('0x6'));var path=require(_0x94eb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94eb('0x8'));var fs=require('fs');var fs_extra=require(_0x94eb('0x9'));var _=require(_0x94eb('0xa'));var squel=require(_0x94eb('0xb'));var crypto=require(_0x94eb('0xc'));var jsforce=require(_0x94eb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x94eb('0xe'));var Papa=require(_0x94eb('0xf'));var Redis=require(_0x94eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x94eb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x94eb('0x12'));var logger=require(_0x94eb('0x13'))(_0x94eb('0x14'));var utils=require('../../config/utils');var config=require(_0x94eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x94eb('0x16'))['db'];function respondWithStatusCode(_0x1eb73a,_0x28726e){_0x28726e=_0x28726e||0xcc;return function(_0x545eb4){if(_0x545eb4){return _0x1eb73a[_0x94eb('0x17')](_0x28726e);}return _0x1eb73a[_0x94eb('0x18')](_0x28726e)[_0x94eb('0x19')]();};}function respondWithResult(_0x3c631a,_0x16d1bd){_0x16d1bd=_0x16d1bd||0xc8;return function(_0x3187eb){if(_0x3187eb){return _0x3c631a['status'](_0x16d1bd)['json'](_0x3187eb);}};}function respondWithFilteredResult(_0x5f4770,_0x45a7d8){return function(_0x3be9c3){if(_0x3be9c3){var _0xed2058=typeof _0x45a7d8[_0x94eb('0x1a')]==='undefined'&&typeof _0x45a7d8[_0x94eb('0x1b')]==='undefined';var _0x1704ed=_0x3be9c3[_0x94eb('0x1c')];var _0x3a508d=_0xed2058?0x0:_0x45a7d8[_0x94eb('0x1a')];var _0x1f4d62=_0xed2058?_0x3be9c3['count']:_0x45a7d8[_0x94eb('0x1a')]+_0x45a7d8['limit'];var _0x142d7d;if(_0x1f4d62>=_0x1704ed){_0x1f4d62=_0x1704ed;_0x142d7d=0xc8;}else{_0x142d7d=0xce;}_0x5f4770[_0x94eb('0x18')](_0x142d7d);return _0x5f4770[_0x94eb('0x1d')](_0x94eb('0x1e'),_0x3a508d+'-'+_0x1f4d62+'/'+_0x1704ed)['json'](_0x3be9c3);}return null;};}function patchUpdates(_0xaed0ae){return function(_0x4abb08){try{jsonpatch[_0x94eb('0x1f')](_0x4abb08,_0xaed0ae,!![]);}catch(_0xffb6ff){return BPromise['reject'](_0xffb6ff);}return _0x4abb08[_0x94eb('0x20')]();};}function saveUpdates(_0x5c6ffc,_0x1e968f){return function(_0x4517dc){if(_0x4517dc){return _0x4517dc[_0x94eb('0x21')](_0x5c6ffc)[_0x94eb('0x22')](function(_0x596328){return _0x596328;});}return null;};}function removeEntity(_0x27839b,_0x1e45d9){return function(_0x5862a){if(_0x5862a){return _0x5862a[_0x94eb('0x23')]()['then'](function(){_0x27839b[_0x94eb('0x18')](0xcc)[_0x94eb('0x19')]();});}};}function handleEntityNotFound(_0x175d4d,_0x27388e){return function(_0x2b4c4d){if(!_0x2b4c4d){_0x175d4d[_0x94eb('0x17')](0x194);}return _0x2b4c4d;};}function handleError(_0x1aef78,_0x471ca6){_0x471ca6=_0x471ca6||0x1f4;return function(_0xdf5a4){logger[_0x94eb('0x24')](_0xdf5a4['stack']);if(_0xdf5a4[_0x94eb('0x25')]){delete _0xdf5a4[_0x94eb('0x25')];}_0x1aef78[_0x94eb('0x18')](_0x471ca6)[_0x94eb('0x26')](_0xdf5a4);};}exports[_0x94eb('0x21')]=function(_0x526db5,_0x48f0a5){if(_0x526db5[_0x94eb('0x27')]['id']){delete _0x526db5[_0x94eb('0x27')]['id'];}return db['Action'][_0x94eb('0x28')]({'where':{'id':_0x526db5[_0x94eb('0x29')]['id']}})[_0x94eb('0x22')](handleEntityNotFound(_0x48f0a5,null))[_0x94eb('0x22')](saveUpdates(_0x526db5[_0x94eb('0x27')],null))['then'](respondWithResult(_0x48f0a5,null))[_0x94eb('0x2a')](handleError(_0x48f0a5,null));};exports[_0x94eb('0x23')]=function(_0x310579,_0x5d35b9){return db[_0x94eb('0x2b')][_0x94eb('0x28')]({'where':{'id':_0x310579[_0x94eb('0x29')]['id']}})[_0x94eb('0x22')](handleEntityNotFound(_0x5d35b9,null))[_0x94eb('0x22')](removeEntity(_0x5d35b9,null))[_0x94eb('0x2a')](handleError(_0x5d35b9,null));}; \ No newline at end of file +var _0x0dc2=['catch','rimraf','zip-dir','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','body','Action','find','params'];(function(_0x1cc294,_0x5d677d){var _0x9af5f=function(_0x55a876){while(--_0x55a876){_0x1cc294['push'](_0x1cc294['shift']());}};_0x9af5f(++_0x5d677d);}(_0x0dc2,0x151));var _0x20dc=function(_0x3c3910,_0x478282){_0x3c3910=_0x3c3910-0x0;var _0x5d34de=_0x0dc2[_0x3c3910];return _0x5d34de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20dc('0x0'));var zipdir=require(_0x20dc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x20dc('0x2'));var BPromise=require(_0x20dc('0x3'));var Mustache=require('mustache');var util=require(_0x20dc('0x4'));var path=require(_0x20dc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20dc('0x6'));var fs=require('fs');var fs_extra=require(_0x20dc('0x7'));var _=require(_0x20dc('0x8'));var squel=require('squel');var crypto=require(_0x20dc('0x9'));var jsforce=require(_0x20dc('0xa'));var deskjs=require(_0x20dc('0xb'));var toCsv=require(_0x20dc('0xc'));var querystring=require(_0x20dc('0xd'));var Papa=require(_0x20dc('0xe'));var Redis=require(_0x20dc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x20dc('0x10'));var as=require(_0x20dc('0x11'));var hardwareService=require(_0x20dc('0x12'));var logger=require(_0x20dc('0x13'))(_0x20dc('0x14'));var utils=require(_0x20dc('0x15'));var config=require(_0x20dc('0x16'));var licenseUtil=require(_0x20dc('0x17'));var db=require(_0x20dc('0x18'))['db'];function respondWithStatusCode(_0x31d909,_0x1b88fb){_0x1b88fb=_0x1b88fb||0xcc;return function(_0x273051){if(_0x273051){return _0x31d909[_0x20dc('0x19')](_0x1b88fb);}return _0x31d909['status'](_0x1b88fb)['end']();};}function respondWithResult(_0x5e9f1a,_0xc4054e){_0xc4054e=_0xc4054e||0xc8;return function(_0x5ccbc0){if(_0x5ccbc0){return _0x5e9f1a[_0x20dc('0x1a')](_0xc4054e)[_0x20dc('0x1b')](_0x5ccbc0);}};}function respondWithFilteredResult(_0xfba911,_0x38a6ee){return function(_0x6fb4ed){if(_0x6fb4ed){var _0x4624a2=typeof _0x38a6ee[_0x20dc('0x1c')]===_0x20dc('0x1d')&&typeof _0x38a6ee[_0x20dc('0x1e')]==='undefined';var _0x565f98=_0x6fb4ed['count'];var _0x3b2948=_0x4624a2?0x0:_0x38a6ee['offset'];var _0x28223b=_0x4624a2?_0x6fb4ed[_0x20dc('0x1f')]:_0x38a6ee[_0x20dc('0x1c')]+_0x38a6ee[_0x20dc('0x1e')];var _0x2493de;if(_0x28223b>=_0x565f98){_0x28223b=_0x565f98;_0x2493de=0xc8;}else{_0x2493de=0xce;}_0xfba911[_0x20dc('0x1a')](_0x2493de);return _0xfba911[_0x20dc('0x20')](_0x20dc('0x21'),_0x3b2948+'-'+_0x28223b+'/'+_0x565f98)[_0x20dc('0x1b')](_0x6fb4ed);}return null;};}function patchUpdates(_0x52a408){return function(_0x124e21){try{jsonpatch[_0x20dc('0x22')](_0x124e21,_0x52a408,!![]);}catch(_0x33839f){return BPromise['reject'](_0x33839f);}return _0x124e21['save']();};}function saveUpdates(_0x53d3b1,_0x3ce9f1){return function(_0x1479bf){if(_0x1479bf){return _0x1479bf[_0x20dc('0x23')](_0x53d3b1)[_0x20dc('0x24')](function(_0x5be23f){return _0x5be23f;});}return null;};}function removeEntity(_0x24c7c0,_0xb2efc6){return function(_0x373452){if(_0x373452){return _0x373452[_0x20dc('0x25')]()[_0x20dc('0x24')](function(){_0x24c7c0['status'](0xcc)[_0x20dc('0x26')]();});}};}function handleEntityNotFound(_0x224037,_0x44cdf4){return function(_0x56bbf2){if(!_0x56bbf2){_0x224037[_0x20dc('0x19')](0x194);}return _0x56bbf2;};}function handleError(_0x363262,_0x57b172){_0x57b172=_0x57b172||0x1f4;return function(_0x47bace){logger[_0x20dc('0x27')](_0x47bace[_0x20dc('0x28')]);if(_0x47bace[_0x20dc('0x29')]){delete _0x47bace[_0x20dc('0x29')];}_0x363262[_0x20dc('0x1a')](_0x57b172)[_0x20dc('0x2a')](_0x47bace);};}exports['update']=function(_0x268818,_0x43b703){if(_0x268818[_0x20dc('0x2b')]['id']){delete _0x268818[_0x20dc('0x2b')]['id'];}return db[_0x20dc('0x2c')][_0x20dc('0x2d')]({'where':{'id':_0x268818[_0x20dc('0x2e')]['id']}})[_0x20dc('0x24')](handleEntityNotFound(_0x43b703,null))[_0x20dc('0x24')](saveUpdates(_0x268818['body'],null))['then'](respondWithResult(_0x43b703,null))['catch'](handleError(_0x43b703,null));};exports[_0x20dc('0x25')]=function(_0x7e87c,_0x4f8756){return db[_0x20dc('0x2c')][_0x20dc('0x2d')]({'where':{'id':_0x7e87c[_0x20dc('0x2e')]['id']}})['then'](handleEntityNotFound(_0x4f8756,null))[_0x20dc('0x24')](removeEntity(_0x4f8756,null))[_0x20dc('0x2f')](handleError(_0x4f8756,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index f011f13..2f6901f 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 _0x482b=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x1118ad,_0x3db984){var _0x590d28=function(_0x1dfffd){while(--_0x1dfffd){_0x1118ad['push'](_0x1118ad['shift']());}};_0x590d28(++_0x3db984);}(_0x482b,0x12a));var _0xb482=function(_0x451f99,_0x36ead2){_0x451f99=_0x451f99-0x0;var _0x8a8ae7=_0x482b[_0x451f99];return _0x8a8ae7;};'use strict';var _=require(_0xb482('0x0'));var util=require(_0xb482('0x1'));var logger=require(_0xb482('0x2'))('api');var moment=require(_0xb482('0x3'));var BPromise=require('bluebird');var rp=require(_0xb482('0x4'));var fs=require('fs');var path=require(_0xb482('0x5'));var rimraf=require(_0xb482('0x6'));var config=require(_0xb482('0x7'));var attributes=require('./action.attributes');module[_0xb482('0x8')]=function(_0x3a6412,_0x254284){return _0x3a6412[_0xb482('0x9')](_0xb482('0xa'),attributes,{'tableName':_0xb482('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08e8=['./action.attributes','exports','Action','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x08e8,0xc9));var _0x808e=function(_0x5c82b9,_0x16999c){_0x5c82b9=_0x5c82b9-0x0;var _0x4a0829=_0x08e8[_0x5c82b9];return _0x4a0829;};'use strict';var _=require('lodash');var util=require(_0x808e('0x0'));var logger=require('../../config/logger')(_0x808e('0x1'));var moment=require(_0x808e('0x2'));var BPromise=require(_0x808e('0x3'));var rp=require(_0x808e('0x4'));var fs=require('fs');var path=require(_0x808e('0x5'));var rimraf=require(_0x808e('0x6'));var config=require(_0x808e('0x7'));var attributes=require(_0x808e('0x8'));module[_0x808e('0x9')]=function(_0xb4cdbe,_0x5c4278){return _0xb4cdbe['define'](_0x808e('0xa'),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 44e980a..f0efddd 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x65331c,_0x176927){var _0x401e4c=function(_0x191f01){while(--_0x191f01){_0x65331c['push'](_0x65331c['shift']());}};_0x401e4c(++_0x176927);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x7fbe[_0xaf29da];return _0x295c51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ 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(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0xf494,0x1c6));var _0x4f49=function(_0x1843f1,_0x175a27){_0x1843f1=_0x1843f1-0x0;var _0x341bb3=_0xf494[_0x1843f1];return _0x341bb3;};'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 7aa62f5..ee1c2ec 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 _0x1d55=['put','/:id','isAuthenticated','update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x2ed55c,_0x146490){var _0x52122b=function(_0x1dc8fd){while(--_0x1dc8fd){_0x2ed55c['push'](_0x2ed55c['shift']());}};_0x52122b(++_0x146490);}(_0x1d55,0x11f));var _0x51d5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1d55[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51d5('0x0'));var timeout=require('connect-timeout');var express=require(_0x51d5('0x1'));var router=express['Router']();var fs_extra=require(_0x51d5('0x2'));var auth=require(_0x51d5('0x3'));var interaction=require(_0x51d5('0x4'));var config=require(_0x51d5('0x5'));var controller=require(_0x51d5('0x6'));router[_0x51d5('0x7')](_0x51d5('0x8'),auth[_0x51d5('0x9')](),controller[_0x51d5('0xa')]);router[_0x51d5('0xb')](_0x51d5('0x8'),auth[_0x51d5('0x9')](),controller[_0x51d5('0xc')]);module[_0x51d5('0xd')]=router; \ No newline at end of file +var _0x5cb5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','destroy','exports','multer','path','express'];(function(_0xef6c0d,_0x698c54){var _0x568b1c=function(_0x23b136){while(--_0x23b136){_0xef6c0d['push'](_0xef6c0d['shift']());}};_0x568b1c(++_0x698c54);}(_0x5cb5,0x1cb));var _0x55cb=function(_0x166c52,_0x208d0f){_0x166c52=_0x166c52-0x0;var _0x2c526d=_0x5cb5[_0x166c52];return _0x2c526d;};'use strict';var multer=require(_0x55cb('0x0'));var util=require('util');var path=require(_0x55cb('0x1'));var timeout=require('connect-timeout');var express=require(_0x55cb('0x2'));var router=express[_0x55cb('0x3')]();var fs_extra=require(_0x55cb('0x4'));var auth=require(_0x55cb('0x5'));var interaction=require(_0x55cb('0x6'));var config=require(_0x55cb('0x7'));var controller=require(_0x55cb('0x8'));router[_0x55cb('0x9')](_0x55cb('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x55cb('0xa'),auth[_0x55cb('0xb')](),controller[_0x55cb('0xc')]);module[_0x55cb('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 458a5d4..0a30b96 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x535250,_0x1127f7){var _0x16ffe8=function(_0x3062dc){while(--_0x3062dc){_0x535250['push'](_0x535250['shift']());}};_0x16ffe8(++_0x1127f7);}(_0x425d,0x1e0));var _0xd425=function(_0xb70791,_0x1d91d6){_0xb70791=_0xb70791-0x0;var _0x48f939=_0x425d[_0xb70791];return _0x48f939;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x6d1c65,_0x22df6e){var _0x1e96b4=function(_0xc1aac4){while(--_0xc1aac4){_0x6d1c65['push'](_0x6d1c65['shift']());}};_0x1e96b4(++_0x22df6e);}(_0x5fab,0x177));var _0xb5fa=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x5fab[_0x4f35f4];return _0x2e9a70;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index bb8e198..2c674ab 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 _0x52fb=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','type','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','SEC_TO_TIME(%s)','ROUND(%s)','metric','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','ValidationErrorItem','Limited\x20Query:'];(function(_0x22e09f,_0x5f1211){var _0x3c96cb=function(_0x28dcf0){while(--_0x28dcf0){_0x22e09f['push'](_0x22e09f['shift']());}};_0x3c96cb(++_0x5f1211);}(_0x52fb,0xa8));var _0xb52f=function(_0x2a5bb0,_0x32b8fd){_0x2a5bb0=_0x2a5bb0-0x0;var _0x103464=_0x52fb[_0x2a5bb0];return _0x103464;};'use strict';var emlformat=require(_0xb52f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb52f('0x1'));var jsonpatch=require(_0xb52f('0x2'));var rp=require(_0xb52f('0x3'));var moment=require('moment');var BPromise=require(_0xb52f('0x4'));var Mustache=require(_0xb52f('0x5'));var util=require('util');var path=require(_0xb52f('0x6'));var sox=require('sox');var csv=require(_0xb52f('0x7'));var ejs=require(_0xb52f('0x8'));var fs=require('fs');var fs_extra=require(_0xb52f('0x9'));var _=require('lodash');var squel=require(_0xb52f('0xa'));var crypto=require('crypto');var jsforce=require(_0xb52f('0xb'));var deskjs=require(_0xb52f('0xc'));var toCsv=require(_0xb52f('0x7'));var querystring=require(_0xb52f('0xd'));var Papa=require(_0xb52f('0xe'));var Redis=require(_0xb52f('0xf'));var authService=require(_0xb52f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb52f('0x11'));var hardwareService=require(_0xb52f('0x12'));var logger=require(_0xb52f('0x13'))(_0xb52f('0x14'));var utils=require(_0xb52f('0x15'));var config=require(_0xb52f('0x16'));var licenseUtil=require(_0xb52f('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb52f('0x18'))['dbH'];function respondWithStatusCode(_0x10d473,_0x3ac766){_0x3ac766=_0x3ac766||0xcc;return function(_0x14def7){if(_0x14def7){return _0x10d473[_0xb52f('0x19')](_0x3ac766);}return _0x10d473[_0xb52f('0x1a')](_0x3ac766)[_0xb52f('0x1b')]();};}function respondWithResult(_0x1059ab,_0x29f95a){_0x29f95a=_0x29f95a||0xc8;return function(_0x490676){if(_0x490676){return _0x1059ab['status'](_0x29f95a)[_0xb52f('0x1c')](_0x490676);}};}function respondWithFilteredResult(_0x32e6ca,_0x593ab0){return function(_0x410f79){if(_0x410f79){var _0x3c211c=typeof _0x593ab0[_0xb52f('0x1d')]===_0xb52f('0x1e')&&typeof _0x593ab0[_0xb52f('0x1f')]===_0xb52f('0x1e');var _0x5b2417=_0x410f79[_0xb52f('0x20')];var _0x5c9cb6=_0x3c211c?0x0:_0x593ab0[_0xb52f('0x1d')];var _0x41454d=_0x3c211c?_0x410f79['count']:_0x593ab0[_0xb52f('0x1d')]+_0x593ab0['limit'];var _0x2dd0c6;if(_0x41454d>=_0x5b2417){_0x41454d=_0x5b2417;_0x2dd0c6=0xc8;}else{_0x2dd0c6=0xce;}_0x32e6ca[_0xb52f('0x1a')](_0x2dd0c6);return _0x32e6ca[_0xb52f('0x21')](_0xb52f('0x22'),_0x5c9cb6+'-'+_0x41454d+'/'+_0x5b2417)[_0xb52f('0x1c')](_0x410f79);}return null;};}function patchUpdates(_0x341536){return function(_0xeaca37){try{jsonpatch[_0xb52f('0x23')](_0xeaca37,_0x341536,!![]);}catch(_0x4fccc4){return BPromise[_0xb52f('0x24')](_0x4fccc4);}return _0xeaca37[_0xb52f('0x25')]();};}function saveUpdates(_0x314919,_0x4ea31b){return function(_0x3fa3f5){if(_0x3fa3f5){return _0x3fa3f5[_0xb52f('0x26')](_0x314919)[_0xb52f('0x27')](function(_0x3d8b06){return _0x3d8b06;});}return null;};}function removeEntity(_0x36341a,_0x788d3e){return function(_0x56c318){if(_0x56c318){return _0x56c318[_0xb52f('0x28')]()[_0xb52f('0x27')](function(){var _0xadd653=_0x56c318[_0xb52f('0x29')]({'plain':!![]});var _0xbf0dd2=_0xb52f('0x2a');return db[_0xb52f('0x2b')][_0xb52f('0x28')]({'where':{'type':_0xbf0dd2,'resourceId':_0xadd653['id']}})['then'](function(){return _0x56c318;});})[_0xb52f('0x27')](function(){_0x36341a['status'](0xcc)[_0xb52f('0x1b')]();});}};}function handleEntityNotFound(_0x48e06b,_0x27596c){return function(_0x32e9e6){if(!_0x32e9e6){_0x48e06b[_0xb52f('0x19')](0x194);}return _0x32e9e6;};}function handleError(_0x5d0072,_0x3ffc97){_0x3ffc97=_0x3ffc97||0x1f4;return function(_0x5bf407){logger[_0xb52f('0x2c')](_0x5bf407['stack']);if(_0x5bf407[_0xb52f('0x2d')]){delete _0x5bf407[_0xb52f('0x2d')];}_0x5d0072[_0xb52f('0x1a')](_0x3ffc97)[_0xb52f('0x2e')](_0x5bf407);};}exports[_0xb52f('0x2f')]=function(_0x1f87aa,_0x23caf9){var _0x533354={},_0x4c7ce5={},_0x55c6a1={'count':0x0,'rows':[]};var _0x86f6a6=_['map'](db[_0xb52f('0x30')][_0xb52f('0x31')],function(_0x1f3261){return{'name':_0x1f3261[_0xb52f('0x32')],'type':_0x1f3261['type'][_0xb52f('0x33')]};});_0x4c7ce5[_0xb52f('0x34')]=_[_0xb52f('0x35')](_0x86f6a6,_0xb52f('0x2d'));_0x4c7ce5[_0xb52f('0x36')]=_[_0xb52f('0x37')](_0x1f87aa[_0xb52f('0x36')]);_0x4c7ce5[_0xb52f('0x38')]=_['intersection'](_0x4c7ce5[_0xb52f('0x34')],_0x4c7ce5[_0xb52f('0x36')]);_0x533354['attributes']=_[_0xb52f('0x39')](_0x4c7ce5[_0xb52f('0x34')],qs['fields'](_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x3a')]));_0x533354['attributes']=_0x533354[_0xb52f('0x3b')][_0xb52f('0x3c')]?_0x533354['attributes']:_0x4c7ce5[_0xb52f('0x34')];if(!_0x1f87aa[_0xb52f('0x36')]['hasOwnProperty']('nolimit')){_0x533354[_0xb52f('0x1f')]=qs[_0xb52f('0x1f')](_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x1f')]);_0x533354[_0xb52f('0x1d')]=qs['offset'](_0x1f87aa['query']['offset']);}_0x533354[_0xb52f('0x3d')]=qs[_0xb52f('0x3e')](_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x3e')]);_0x533354[_0xb52f('0x3f')]=qs[_0xb52f('0x38')](_[_0xb52f('0x40')](_0x1f87aa['query'],_0x4c7ce5[_0xb52f('0x38')]),_0x86f6a6);if(_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x41')]){_0x533354[_0xb52f('0x3f')]=_['merge'](_0x533354['where'],{'$or':_[_0xb52f('0x35')](_0x86f6a6,function(_0x558d14){if(_0x558d14[_0xb52f('0x42')]!=='VIRTUAL'){var _0x58fed3={};_0x58fed3[_0x558d14[_0xb52f('0x2d')]]={'$like':'%'+_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x41')]+'%'};return _0x58fed3;}})});}_0x533354=_[_0xb52f('0x43')]({},_0x533354,_0x1f87aa[_0xb52f('0x44')]);var _0xafa15d={'where':_0x533354['where']};return db[_0xb52f('0x30')]['count'](_0xafa15d)[_0xb52f('0x27')](function(_0x5a8ce2){_0x55c6a1[_0xb52f('0x20')]=_0x5a8ce2;if(_0x1f87aa[_0xb52f('0x36')]['includeAll']){_0x533354[_0xb52f('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xb52f('0x46')](_0x533354);})[_0xb52f('0x27')](function(_0x180873){_0x55c6a1[_0xb52f('0x47')]=_0x180873;return _0x55c6a1;})['then'](respondWithFilteredResult(_0x23caf9,_0x533354))[_0xb52f('0x48')](handleError(_0x23caf9,null));};exports[_0xb52f('0x49')]=function(_0x9d4bfe,_0x531fbc){var _0x444933={'raw':![],'where':{'id':_0x9d4bfe[_0xb52f('0x4a')]['id']}},_0xda8ba5={};_0xda8ba5[_0xb52f('0x34')]=_[_0xb52f('0x37')](db[_0xb52f('0x30')][_0xb52f('0x31')]);_0xda8ba5[_0xb52f('0x36')]=_[_0xb52f('0x37')](_0x9d4bfe['query']);_0xda8ba5[_0xb52f('0x38')]=_[_0xb52f('0x39')](_0xda8ba5[_0xb52f('0x34')],_0xda8ba5[_0xb52f('0x36')]);_0x444933[_0xb52f('0x3b')]=_[_0xb52f('0x39')](_0xda8ba5[_0xb52f('0x34')],qs[_0xb52f('0x3a')](_0x9d4bfe[_0xb52f('0x36')][_0xb52f('0x3a')]));_0x444933['attributes']=_0x444933[_0xb52f('0x3b')][_0xb52f('0x3c')]?_0x444933[_0xb52f('0x3b')]:_0xda8ba5[_0xb52f('0x34')];if(_0x9d4bfe[_0xb52f('0x36')][_0xb52f('0x4b')]){_0x444933[_0xb52f('0x45')]=[{'all':!![]}];}_0x444933=_[_0xb52f('0x43')]({},_0x444933,_0x9d4bfe[_0xb52f('0x44')]);return db[_0xb52f('0x30')][_0xb52f('0x4c')](_0x444933)['then'](handleEntityNotFound(_0x531fbc,null))[_0xb52f('0x27')](respondWithResult(_0x531fbc,null))['catch'](handleError(_0x531fbc,null));};exports[_0xb52f('0x4d')]=function(_0xe8416d,_0x4b9318){return db[_0xb52f('0x30')][_0xb52f('0x4d')](_0xe8416d[_0xb52f('0x4e')],{})['then'](function(_0x2f1ffc){var _0x2953a1=_0xe8416d['user'][_0xb52f('0x29')]({'plain':!![]});if(!_0x2953a1)throw new Error(_0xb52f('0x4f'));if(_0x2953a1[_0xb52f('0x50')]==='user'){var _0x3dc54f=_0x2f1ffc['get']({'plain':!![]});var _0x2ce0f4=_0xb52f('0x51');return db['UserProfileSection'][_0xb52f('0x4c')]({'where':{'name':_0x2ce0f4,'userProfileId':_0x2953a1[_0xb52f('0x52')]},'raw':!![]})['then'](function(_0x36999c){if(_0x36999c&&_0x36999c['autoAssociation']===0x0){return db[_0xb52f('0x2b')][_0xb52f('0x4d')]({'name':_0x3dc54f['name'],'resourceId':_0x3dc54f['id'],'type':'CustomReports','sectionId':_0x36999c['id']},{})[_0xb52f('0x27')](function(){return _0x2f1ffc;});}else{return _0x2f1ffc;}})['catch'](function(_0x365a03){logger[_0xb52f('0x2c')](_0xb52f('0x53'),_0x365a03);throw _0x365a03;});}return _0x2f1ffc;})[_0xb52f('0x27')](respondWithResult(_0x4b9318,0xc9))[_0xb52f('0x48')](handleError(_0x4b9318,null));};exports['update']=function(_0x1a52f2,_0x4907e3){if(_0x1a52f2[_0xb52f('0x4e')]['id']){delete _0x1a52f2[_0xb52f('0x4e')]['id'];}return db[_0xb52f('0x30')][_0xb52f('0x4c')]({'where':{'id':_0x1a52f2[_0xb52f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4907e3,null))[_0xb52f('0x27')](saveUpdates(_0x1a52f2['body'],null))[_0xb52f('0x27')](respondWithResult(_0x4907e3,null))[_0xb52f('0x48')](handleError(_0x4907e3,null));};exports[_0xb52f('0x28')]=function(_0x8f9691,_0x16b8c2){return db[_0xb52f('0x30')]['find']({'where':{'id':_0x8f9691[_0xb52f('0x4a')]['id']}})[_0xb52f('0x27')](handleEntityNotFound(_0x16b8c2,null))['then'](removeEntity(_0x16b8c2,null))[_0xb52f('0x48')](handleError(_0x16b8c2,null));};exports[_0xb52f('0x54')]=function(_0x4871ba,_0x3aed6b){var _0x11fd6d=0xa;var _0x2b3abc=[_0xb52f('0x55'),_0xb52f('0x56'),_0xb52f('0x57'),_0xb52f('0x58')];var _0x3df563={'SUM':'SUM(%s)','COUNT':_0xb52f('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xb52f('0x5a'),'AVG':_0xb52f('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb52f('0x5c'),'GROUP_CONCAT DESC':_0xb52f('0x5d')};var _0x72d2e5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb52f('0x5e'),'HOUR':_0xb52f('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb52f('0x60')};var _0x3d6bc3=function(_0x37569d){return!_[_0xb52f('0x61')]([_0xb52f('0x62'),_0xb52f('0x63'),_0xb52f('0x64'),_0xb52f('0x65')],_0x37569d);};var _0x372fca=function(_0x32bb70){if(!_0x32bb70||!_0x32bb70[_0xb52f('0x66')][_0xb52f('0x3c')]){return'';}for(var _0x244dac='(',_0x24c5b5=0x0;_0x24c5b5<_0x32bb70[_0xb52f('0x66')]['length'];_0x24c5b5+=0x1){_0x24c5b5>0x0&&(_0x244dac+='\x20'+_0x32bb70[_0xb52f('0x67')]+'\x20');_0x244dac+=_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x68')]?_0x372fca(_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x68')]):_0x32bb70[_0xb52f('0x66')][_0x24c5b5]['field']+'\x20'+_0x32bb70['rules'][_0x24c5b5][_0xb52f('0x69')]+(_0x3d6bc3(_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x69')])?'\x20'+_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x6a')]:'');}return _0x244dac+')';};var _0x5ef886={'where':{'id':_0x4871ba[_0xb52f('0x4a')]['id']}},_0x6a5c4c,_0x4ec04b,_0x4e909c,_0x306521,_0x54c971;_0x5ef886=_[_0xb52f('0x43')]({},_0x5ef886,_0x4871ba['options']);return db[_0xb52f('0x30')]['find'](_0x5ef886)[_0xb52f('0x27')](function(_0x1aaa3e){if(_0x1aaa3e){_0x6a5c4c=_0x1aaa3e;return _0x1aaa3e[_0xb52f('0x6b')]();}return null;})[_0xb52f('0x27')](function(_0x528a5b){if(_0x528a5b){if(!_0x528a5b[_0xb52f('0x3c')]){throw new db[(_0xb52f('0x6c'))]['ValidationErrorItem'](_0xb52f('0x6d'),0x193);}_0x4ec04b=_0x528a5b;return db[_0xb52f('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xb52f('0x27')](function(_0x3a725c){if(_0x3a725c){_0x4e909c=_[_0xb52f('0x6f')](_0x3a725c,'id');var _0x5f0d0f;var _0x351524=squel[_0xb52f('0x70')]();_0x351524[_0xb52f('0x71')](_0x6a5c4c[_0xb52f('0x72')]);for(var _0x4fdb60=0x0;_0x4fdb60<_0x4ec04b['length'];_0x4fdb60+=0x1){_0x5f0d0f=_0x4ec04b[_0x4fdb60][_0xb52f('0x73')]?_0x4e909c[_0x4ec04b[_0x4fdb60]['MetricId']]['metric']:_0x4ec04b[_0x4fdb60]['field'];_0x5f0d0f=_0x4ec04b[_0x4fdb60][_0xb52f('0x74')]?_[_0xb52f('0x75')](_0x3df563[_0x4ec04b[_0x4fdb60][_0xb52f('0x74')]],'%s',_0x5f0d0f):_0x5f0d0f;_0x5f0d0f=_0x4ec04b[_0x4fdb60][_0xb52f('0x76')]?_['replace'](_0x72d2e5[_0x4ec04b[_0x4fdb60][_0xb52f('0x76')]],'%s',_0x5f0d0f):_0x5f0d0f;if(_0x4ec04b[_0x4fdb60][_0xb52f('0x77')]){_0x351524[_0xb52f('0x68')](_0x5f0d0f);}_0x4ec04b[_0x4fdb60][_0xb52f('0x78')]&&_0x351524[_0xb52f('0x3d')](_0x5f0d0f,_0x4ec04b[_0x4fdb60][_0xb52f('0x78')]===_0xb52f('0x79')?![]:!![]);_0x351524[_0xb52f('0x7a')](_0x5f0d0f,_0x4ec04b[_0x4fdb60][_0xb52f('0x7b')]||_0x5f0d0f);}if(_0x6a5c4c[_0xb52f('0x7c')]){_0x6a5c4c[_0xb52f('0x7c')]=JSON[_0xb52f('0x7d')](_0x6a5c4c[_0xb52f('0x7c')]);for(var _0x417bc1=0x0;_0x417bc1<_0x6a5c4c[_0xb52f('0x7c')][_0xb52f('0x3c')];_0x417bc1+=0x1){if(_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x42')]&&_[_0xb52f('0x61')](_0x2b3abc,_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1][_0xb52f('0x42')])&&_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x7e')]&&_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1]['foreignTable']&&_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x7f')]){_0x351524[_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1][_0xb52f('0x42')]](_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1][_0xb52f('0x80')],null,util[_0xb52f('0x76')](_0xb52f('0x81'),_0x6a5c4c[_0xb52f('0x72')],_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x7e')],_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x80')],_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1]['foreignKey']));}}}if(_0x6a5c4c['conditions']){_0x6a5c4c[_0xb52f('0x82')]=JSON[_0xb52f('0x7d')](_0x6a5c4c[_0xb52f('0x82')]);_0x351524[_0xb52f('0x3f')](_0x372fca(_0x6a5c4c['conditions'][_0xb52f('0x68')]));}_0x54c971=_0x351524[_0xb52f('0x83')]();_0x351524[_0xb52f('0x1f')](_0x11fd6d);_0x351524['offset'](0x0);logger[_0xb52f('0x84')]('Limited\x20Query:',_0x351524[_0xb52f('0x85')]());return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0x351524[_0xb52f('0x85')](),{'type':dbH[_0xb52f('0x86')][_0xb52f('0x87')][_0xb52f('0x88')]});}})['then'](respondWithResult(_0x3aed6b,null))['catch'](handleError(_0x3aed6b,null));};function runReport(_0x18f5d9,_0x2c2f76,_0x36bb4a){var _0x29f5ba=_0x2c2f76[_0xb52f('0x2d')];var _0x3718f2=0xa;var _0x5d9a42=['join',_0xb52f('0x56'),_0xb52f('0x57'),'cross_join'];var _0x45060c={'SUM':_0xb52f('0x89'),'COUNT':_0xb52f('0x59'),'COUNT DISTINCT':_0xb52f('0x8a'),'MAX':_0xb52f('0x8b'),'MIN':'MIN(%s)','AVG':_0xb52f('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb52f('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb60b8c={'SEC_TO_TIME':_0xb52f('0x8c'),'DATE':_0xb52f('0x5e'),'HOUR':_0xb52f('0x5f'),'ROUND':_0xb52f('0x8d'),'UNIX_TIMESTAMP':_0xb52f('0x60')};var _0x586c68=function(_0x1475e1){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb52f('0x64'),_0xb52f('0x65')],_0x1475e1);};var _0x2450a6=function(_0x132adf){if(!_0x132adf||!_0x132adf[_0xb52f('0x66')]['length']){return'';}for(var _0x1a83d2='(',_0x542930=0x0;_0x542930<_0x132adf[_0xb52f('0x66')][_0xb52f('0x3c')];_0x542930+=0x1){_0x542930>0x0&&(_0x1a83d2+='\x20'+_0x132adf['operator']+'\x20');_0x1a83d2+=_0x132adf[_0xb52f('0x66')][_0x542930]['group']?_0x2450a6(_0x132adf[_0xb52f('0x66')][_0x542930][_0xb52f('0x68')]):_0x132adf['rules'][_0x542930][_0xb52f('0x7a')]+'\x20'+_0x132adf[_0xb52f('0x66')][_0x542930][_0xb52f('0x69')]+(_0x586c68(_0x132adf[_0xb52f('0x66')][_0x542930][_0xb52f('0x69')])?'\x20'+_0x132adf[_0xb52f('0x66')][_0x542930]['value']:'');}return _0x1a83d2+')';};var _0x250866={'where':{'id':_0x18f5d9['id']}},_0x500d0a,_0x318d76,_0x45b1e3,_0xf3015e,_0xee78e2;_0x250866=_['merge']({},_0x250866,_0x36bb4a);return db['AnalyticCustomReport'][_0xb52f('0x4c')](_0x250866)[_0xb52f('0x27')](function(_0x181998){if(_0x181998){_0x500d0a=_0x181998;return _0x181998[_0xb52f('0x6b')]();}return null;})[_0xb52f('0x27')](function(_0x49233d){if(_0x49233d){if(!_0x49233d[_0xb52f('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xb52f('0x6d'),0x193);}_0x318d76=_0x49233d;return db[_0xb52f('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xb52f('0x27')](function(_0x3d89b7){if(_0x3d89b7){_0x45b1e3=_[_0xb52f('0x6f')](_0x3d89b7,'id');var _0x520163;var _0x4c0f08=squel['select']();_0x4c0f08[_0xb52f('0x71')](_0x500d0a[_0xb52f('0x72')]);for(var _0x2cb195=0x0;_0x2cb195<_0x318d76[_0xb52f('0x3c')];_0x2cb195+=0x1){_0x520163=_0x318d76[_0x2cb195][_0xb52f('0x73')]?_0x45b1e3[_0x318d76[_0x2cb195][_0xb52f('0x73')]][_0xb52f('0x8e')]:_0x318d76[_0x2cb195]['field'];_0x520163=_0x318d76[_0x2cb195][_0xb52f('0x74')]?_['replace'](_0x45060c[_0x318d76[_0x2cb195][_0xb52f('0x74')]],'%s',_0x520163):_0x520163;_0x520163=_0x318d76[_0x2cb195][_0xb52f('0x76')]?_[_0xb52f('0x75')](_0xb60b8c[_0x318d76[_0x2cb195]['format']],'%s',_0x520163):_0x520163;if(_0x318d76[_0x2cb195]['groupBy']){_0x4c0f08[_0xb52f('0x68')](_0x520163);}_0x318d76[_0x2cb195][_0xb52f('0x78')]&&_0x4c0f08[_0xb52f('0x3d')](_0x520163,_0x318d76[_0x2cb195]['orderBy']===_0xb52f('0x79')?![]:!![]);_0x4c0f08[_0xb52f('0x7a')](_0x520163,_0x318d76[_0x2cb195]['alias']||_0x520163);}if(_0x500d0a[_0xb52f('0x7c')]){_0x500d0a[_0xb52f('0x7c')]=JSON[_0xb52f('0x7d')](_0x500d0a[_0xb52f('0x7c')]);for(var _0x30b034=0x0;_0x30b034<_0x500d0a[_0xb52f('0x7c')][_0xb52f('0x3c')];_0x30b034+=0x1){if(_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x42')]&&_[_0xb52f('0x61')](_0x5d9a42,_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x42')])&&_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x7e')]&&_0x500d0a['joins'][_0x30b034][_0xb52f('0x80')]&&_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x7f')]){_0x4c0f08[_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x42')]](_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x80')],null,util[_0xb52f('0x76')](_0xb52f('0x81'),_0x500d0a['table'],_0x500d0a[_0xb52f('0x7c')][_0x30b034]['parentKey'],_0x500d0a[_0xb52f('0x7c')][_0x30b034]['foreignTable'],_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x7f')]));}}}if(_0x500d0a[_0xb52f('0x82')]){_0x500d0a['conditions']=JSON[_0xb52f('0x7d')](_0x500d0a['conditions']);_0x4c0f08[_0xb52f('0x3f')](_0x2450a6(_0x500d0a[_0xb52f('0x82')][_0xb52f('0x68')]));}_0xee78e2=_0x4c0f08[_0xb52f('0x83')]();_0x4c0f08[_0xb52f('0x1f')](_0x3718f2);_0x4c0f08[_0xb52f('0x1d')](0x0);return;}})[_0xb52f('0x27')](function(){if(_0x2c2f76[_0xb52f('0x8f')]==='web'){return null;}var _0x3b122f=_['merge'](_0x2c2f76,{'name':_0x2c2f76[_0xb52f('0x90')]||_0x2c2f76['name']||_0x500d0a['name'],'basename':_0x29f5ba,'savename':util[_0xb52f('0x76')](_0xb52f('0x91'),_0x2c2f76[_0xb52f('0x2d')]||_0x500d0a[_0xb52f('0x2d')],require(_0xb52f('0x92'))[_0xb52f('0x93')](0x4),_0x2c2f76[_0xb52f('0x8f')]||_0xb52f('0x94')),'reportId':_0x500d0a['id'],'reportType':_0xb52f('0x95')});return db[_0xb52f('0x96')][_0xb52f('0x4d')](_0x3b122f,{'raw':!![]});})[_0xb52f('0x27')](function(_0x469f0d){if(_0x500d0a['table']===_0xb52f('0x97')){_0xee78e2['where'](_0x500d0a[_0xb52f('0x72')]+_0xb52f('0x98'),_0x2c2f76[_0xb52f('0x99')],_0x2c2f76[_0xb52f('0x9a')]);}else{_0xee78e2[_0xb52f('0x3f')](_0x500d0a['table']+_0xb52f('0x9b'),_0x2c2f76['startDate'],_0x2c2f76[_0xb52f('0x9a')]);}if(_0x469f0d){logger[_0xb52f('0x9c')](_0xb52f('0x9d'),_0xee78e2[_0xb52f('0x85')]());require(_0xb52f('0x9e'))['fork'](path['join'](__dirname,'../../components/export/',_0x469f0d[_0xb52f('0x8f')]),[_0x469f0d['id'],_0xee78e2[_0xb52f('0x85')](),path[_0xb52f('0x55')](__dirname,_0xb52f('0x9f'),_0x469f0d[_0xb52f('0xa0')]),_0x29f5ba]);return _0x469f0d;}else{var _0x223e5c=squel[_0xb52f('0x70')]();_0x223e5c[_0xb52f('0x71')]('('+_0xee78e2[_0xb52f('0x85')]()+')',_0xb52f('0xa1'));_0x223e5c['field'](_0xb52f('0xa2'),'count');_0xee78e2[_0xb52f('0x1f')](_0x2c2f76[_0xb52f('0x1f')]||_0x3718f2);_0xee78e2['offset'](_0x2c2f76[_0xb52f('0x1d')]||0x0);return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0x223e5c[_0xb52f('0x85')](),{'type':dbH[_0xb52f('0x86')][_0xb52f('0x87')][_0xb52f('0x88')]})['then'](function(_0x5a89de){if(!_0x5a89de[_0xb52f('0x3c')]){_0xf3015e=0x0;}else{_0xf3015e=_0x5a89de[0x0][_0xb52f('0x20')]||0x0;}return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0xee78e2[_0xb52f('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xb52f('0x88')]});})[_0xb52f('0x27')](function(_0x4330bc){return{'rows':_0x4330bc||[],'count':_0xf3015e};});}});}exports[_0xb52f('0xa3')]=function(_0x1256df,_0x1c72ba){return runReport(_0x1256df['params'],_0x1256df[_0xb52f('0x36')],_0x1256df[_0xb52f('0x44')])[_0xb52f('0x27')](respondWithResult(_0x1c72ba,null))[_0xb52f('0x48')](handleError(_0x1c72ba,null));};exports[_0xb52f('0xa4')]=runReport;exports[_0xb52f('0x36')]=function(_0xe631b3,_0x342e06){var _0x129146=0xa;var _0x2f9f2c=[_0xb52f('0x55'),_0xb52f('0x56'),_0xb52f('0x57'),_0xb52f('0x58')];var _0xc159e2={'SUM':_0xb52f('0x89'),'COUNT':_0xb52f('0x59'),'COUNT DISTINCT':_0xb52f('0x8a'),'MAX':_0xb52f('0x8b'),'MIN':_0xb52f('0x5a'),'AVG':_0xb52f('0x5b'),'GROUP_CONCAT':_0xb52f('0xa5'),'GROUP_CONCAT ASC':_0xb52f('0x5c'),'GROUP_CONCAT DESC':_0xb52f('0x5d')};var _0x53313c={'SEC_TO_TIME':_0xb52f('0x8c'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb52f('0x60')};var _0x521b58=function(_0x407c22){return!_[_0xb52f('0x61')]([_0xb52f('0x62'),'IS\x20NOT\x20NULL',_0xb52f('0x64'),_0xb52f('0x65')],_0x407c22);};var _0x34e416=function(_0x2fa0f5){if(!_0x2fa0f5||!_0x2fa0f5[_0xb52f('0x66')][_0xb52f('0x3c')]){return'';}for(var _0x5058c4='(',_0x2933e7=0x0;_0x2933e7<_0x2fa0f5['rules']['length'];_0x2933e7+=0x1){_0x2933e7>0x0&&(_0x5058c4+='\x20'+_0x2fa0f5[_0xb52f('0x67')]+'\x20');_0x5058c4+=_0x2fa0f5[_0xb52f('0x66')][_0x2933e7]['group']?_0x34e416(_0x2fa0f5[_0xb52f('0x66')][_0x2933e7][_0xb52f('0x68')]):_0x2fa0f5['rules'][_0x2933e7][_0xb52f('0x7a')]+'\x20'+_0x2fa0f5[_0xb52f('0x66')][_0x2933e7][_0xb52f('0x69')]+(_0x521b58(_0x2fa0f5[_0xb52f('0x66')][_0x2933e7][_0xb52f('0x69')])?'\x20'+_0x2fa0f5['rules'][_0x2933e7][_0xb52f('0x6a')]:'');}return _0x5058c4+')';};var _0x3b61ea={'where':{'id':_0xe631b3[_0xb52f('0x4a')]['id']}},_0x1c1d13,_0x39600d,_0x2b7f56,_0x56897,_0x5930b9;_0x3b61ea=_[_0xb52f('0x43')]({},_0x3b61ea,_0xe631b3[_0xb52f('0x44')]);return db['AnalyticCustomReport'][_0xb52f('0x4c')](_0x3b61ea)[_0xb52f('0x27')](function(_0x480f4e){if(_0x480f4e){_0x1c1d13=_0x480f4e;return _0x480f4e[_0xb52f('0x6b')]();}return null;})['then'](function(_0x21b2e2){if(_0x21b2e2){if(!_0x21b2e2['length']){throw new db[(_0xb52f('0x6c'))][(_0xb52f('0xa6'))](_0xb52f('0x6d'),0x193);}_0x39600d=_0x21b2e2;return db[_0xb52f('0x6e')][_0xb52f('0x46')]({'raw':!![]});}return null;})[_0xb52f('0x27')](function(_0x25cd29){if(_0x25cd29){_0x2b7f56=_[_0xb52f('0x6f')](_0x25cd29,'id');var _0x520bda;var _0x1db6cf=squel['select']();_0x1db6cf['from'](_0x1c1d13['table']);for(var _0x3f533e=0x0;_0x3f533e<_0x39600d['length'];_0x3f533e+=0x1){_0x520bda=_0x39600d[_0x3f533e]['MetricId']?_0x2b7f56[_0x39600d[_0x3f533e][_0xb52f('0x73')]][_0xb52f('0x8e')]:_0x39600d[_0x3f533e]['field'];_0x520bda=_0x39600d[_0x3f533e]['function']?_[_0xb52f('0x75')](_0xc159e2[_0x39600d[_0x3f533e][_0xb52f('0x74')]],'%s',_0x520bda):_0x520bda;_0x520bda=_0x39600d[_0x3f533e]['format']?_[_0xb52f('0x75')](_0x53313c[_0x39600d[_0x3f533e][_0xb52f('0x76')]],'%s',_0x520bda):_0x520bda;if(_0x39600d[_0x3f533e][_0xb52f('0x77')]){_0x1db6cf[_0xb52f('0x68')](_0x520bda);}_0x39600d[_0x3f533e]['orderBy']&&_0x1db6cf[_0xb52f('0x3d')](_0x520bda,_0x39600d[_0x3f533e][_0xb52f('0x78')]===_0xb52f('0x79')?![]:!![]);_0x1db6cf[_0xb52f('0x7a')](_0x520bda,_0x39600d[_0x3f533e]['alias']||_0x520bda);}if(_0x1c1d13[_0xb52f('0x7c')]){_0x1c1d13[_0xb52f('0x7c')]=JSON[_0xb52f('0x7d')](_0x1c1d13['joins']);for(var _0x286a8c=0x0;_0x286a8c<_0x1c1d13[_0xb52f('0x7c')]['length'];_0x286a8c+=0x1){if(_0x1c1d13['joins'][_0x286a8c][_0xb52f('0x42')]&&_[_0xb52f('0x61')](_0x2f9f2c,_0x1c1d13['joins'][_0x286a8c][_0xb52f('0x42')])&&_0x1c1d13['joins'][_0x286a8c]['parentKey']&&_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x80')]&&_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x7f')]){_0x1db6cf[_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x42')]](_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x80')],null,util[_0xb52f('0x76')](_0xb52f('0x81'),_0x1c1d13[_0xb52f('0x72')],_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x7e')],_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x80')],_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x7f')]));}}}if(_0x1c1d13[_0xb52f('0x82')]){_0x1c1d13[_0xb52f('0x82')]=JSON[_0xb52f('0x7d')](_0x1c1d13['conditions']);_0x1db6cf[_0xb52f('0x3f')](_0x34e416(_0x1c1d13[_0xb52f('0x82')]['group']));}_0x5930b9=_0x1db6cf[_0xb52f('0x83')]();_0x1db6cf[_0xb52f('0x1f')](_0x129146);_0x1db6cf[_0xb52f('0x1d')](0x0);logger[_0xb52f('0x84')](_0xb52f('0xa7'),_0x1db6cf[_0xb52f('0x85')]());return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0x1db6cf[_0xb52f('0x85')](),{'type':dbH[_0xb52f('0x86')][_0xb52f('0x87')][_0xb52f('0x88')]});}})[_0xb52f('0x27')](function(){return{'sql':_0x5930b9['toString']()};})[_0xb52f('0x27')](respondWithResult(_0x342e06,null))['catch'](handleError(_0x342e06,null));}; \ No newline at end of file +var _0xfb0e=['startDate','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','SEC_TO_TIME(%s)','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','type','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','MetricId','function','replace','format','groupBy','orderBy','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','AnalyticMetric','select','from','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','create','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb0e,0x1e8));var _0xefb0=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0xfb0e[_0x49a57c];return _0x4e0316;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefb0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefb0('0x1'));var rp=require(_0xefb0('0x2'));var moment=require(_0xefb0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xefb0('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xefb0('0x5'));var ejs=require(_0xefb0('0x6'));var fs=require('fs');var fs_extra=require(_0xefb0('0x7'));var _=require(_0xefb0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xefb0('0x5'));var querystring=require(_0xefb0('0x9'));var Papa=require(_0xefb0('0xa'));var Redis=require(_0xefb0('0xb'));var authService=require(_0xefb0('0xc'));var qs=require(_0xefb0('0xd'));var as=require(_0xefb0('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefb0('0xf'))(_0xefb0('0x10'));var utils=require(_0xefb0('0x11'));var config=require(_0xefb0('0x12'));var licenseUtil=require(_0xefb0('0x13'));var db=require(_0xefb0('0x14'))['db'];var dbH=require('../../mysqldb')[_0xefb0('0x15')];function respondWithStatusCode(_0x672f33,_0xc8f08){_0xc8f08=_0xc8f08||0xcc;return function(_0x30a511){if(_0x30a511){return _0x672f33['sendStatus'](_0xc8f08);}return _0x672f33[_0xefb0('0x16')](_0xc8f08)[_0xefb0('0x17')]();};}function respondWithResult(_0x6e0ba1,_0x2ec684){_0x2ec684=_0x2ec684||0xc8;return function(_0x4d9f93){if(_0x4d9f93){return _0x6e0ba1[_0xefb0('0x16')](_0x2ec684)[_0xefb0('0x18')](_0x4d9f93);}};}function respondWithFilteredResult(_0x13d939,_0x440abb){return function(_0x14eba8){if(_0x14eba8){var _0x43cfc1=typeof _0x440abb[_0xefb0('0x19')]==='undefined'&&typeof _0x440abb['limit']===_0xefb0('0x1a');var _0x4d40a7=_0x14eba8[_0xefb0('0x1b')];var _0x8655d=_0x43cfc1?0x0:_0x440abb[_0xefb0('0x19')];var _0x270c80=_0x43cfc1?_0x14eba8[_0xefb0('0x1b')]:_0x440abb[_0xefb0('0x19')]+_0x440abb[_0xefb0('0x1c')];var _0x114910;if(_0x270c80>=_0x4d40a7){_0x270c80=_0x4d40a7;_0x114910=0xc8;}else{_0x114910=0xce;}_0x13d939['status'](_0x114910);return _0x13d939['set'](_0xefb0('0x1d'),_0x8655d+'-'+_0x270c80+'/'+_0x4d40a7)[_0xefb0('0x18')](_0x14eba8);}return null;};}function patchUpdates(_0x3f843c){return function(_0x49d5df){try{jsonpatch[_0xefb0('0x1e')](_0x49d5df,_0x3f843c,!![]);}catch(_0x1750d1){return BPromise[_0xefb0('0x1f')](_0x1750d1);}return _0x49d5df[_0xefb0('0x20')]();};}function saveUpdates(_0x258754,_0x5aaae7){return function(_0x2145a8){if(_0x2145a8){return _0x2145a8[_0xefb0('0x21')](_0x258754)[_0xefb0('0x22')](function(_0x3ab5e1){return _0x3ab5e1;});}return null;};}function removeEntity(_0xa4960d,_0x146e71){return function(_0x1ec043){if(_0x1ec043){return _0x1ec043[_0xefb0('0x23')]()['then'](function(){var _0x3c460c=_0x1ec043[_0xefb0('0x24')]({'plain':!![]});var _0x3f291a=_0xefb0('0x25');return db[_0xefb0('0x26')][_0xefb0('0x23')]({'where':{'type':_0x3f291a,'resourceId':_0x3c460c['id']}})[_0xefb0('0x22')](function(){return _0x1ec043;});})[_0xefb0('0x22')](function(){_0xa4960d['status'](0xcc)[_0xefb0('0x17')]();});}};}function handleEntityNotFound(_0x174723,_0xa68bda){return function(_0x56a601){if(!_0x56a601){_0x174723[_0xefb0('0x27')](0x194);}return _0x56a601;};}function handleError(_0x5187cc,_0x539d05){_0x539d05=_0x539d05||0x1f4;return function(_0x5435f6){logger[_0xefb0('0x28')](_0x5435f6[_0xefb0('0x29')]);if(_0x5435f6['name']){delete _0x5435f6[_0xefb0('0x2a')];}_0x5187cc[_0xefb0('0x16')](_0x539d05)['send'](_0x5435f6);};}exports[_0xefb0('0x2b')]=function(_0x3debda,_0x7e3e50){var _0x518afe={},_0x4e887c={},_0x34ab6b={'count':0x0,'rows':[]};var _0x4b1ea1=_[_0xefb0('0x2c')](db[_0xefb0('0x2d')][_0xefb0('0x2e')],function(_0x1a1b93){return{'name':_0x1a1b93['fieldName'],'type':_0x1a1b93[_0xefb0('0x2f')]['key']};});_0x4e887c['model']=_[_0xefb0('0x2c')](_0x4b1ea1,_0xefb0('0x2a'));_0x4e887c['query']=_[_0xefb0('0x30')](_0x3debda['query']);_0x4e887c[_0xefb0('0x31')]=_[_0xefb0('0x32')](_0x4e887c[_0xefb0('0x33')],_0x4e887c['query']);_0x518afe[_0xefb0('0x34')]=_[_0xefb0('0x32')](_0x4e887c[_0xefb0('0x33')],qs['fields'](_0x3debda[_0xefb0('0x35')][_0xefb0('0x36')]));_0x518afe['attributes']=_0x518afe['attributes'][_0xefb0('0x37')]?_0x518afe[_0xefb0('0x34')]:_0x4e887c[_0xefb0('0x33')];if(!_0x3debda[_0xefb0('0x35')][_0xefb0('0x38')](_0xefb0('0x39'))){_0x518afe['limit']=qs['limit'](_0x3debda[_0xefb0('0x35')]['limit']);_0x518afe[_0xefb0('0x19')]=qs[_0xefb0('0x19')](_0x3debda[_0xefb0('0x35')]['offset']);}_0x518afe[_0xefb0('0x3a')]=qs[_0xefb0('0x3b')](_0x3debda[_0xefb0('0x35')][_0xefb0('0x3b')]);_0x518afe[_0xefb0('0x3c')]=qs[_0xefb0('0x31')](_['pick'](_0x3debda['query'],_0x4e887c[_0xefb0('0x31')]),_0x4b1ea1);if(_0x3debda[_0xefb0('0x35')][_0xefb0('0x3d')]){_0x518afe[_0xefb0('0x3c')]=_[_0xefb0('0x3e')](_0x518afe[_0xefb0('0x3c')],{'$or':_[_0xefb0('0x2c')](_0x4b1ea1,function(_0x5159c4){if(_0x5159c4[_0xefb0('0x2f')]!==_0xefb0('0x3f')){var _0x45daff={};_0x45daff[_0x5159c4[_0xefb0('0x2a')]]={'$like':'%'+_0x3debda['query']['filter']+'%'};return _0x45daff;}})});}_0x518afe=_[_0xefb0('0x3e')]({},_0x518afe,_0x3debda['options']);var _0x2fec1b={'where':_0x518afe['where']};return db['AnalyticCustomReport']['count'](_0x2fec1b)[_0xefb0('0x22')](function(_0x33f45d){_0x34ab6b[_0xefb0('0x1b')]=_0x33f45d;if(_0x3debda['query']['includeAll']){_0x518afe['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xefb0('0x40')](_0x518afe);})[_0xefb0('0x22')](function(_0x1490ca){_0x34ab6b['rows']=_0x1490ca;return _0x34ab6b;})[_0xefb0('0x22')](respondWithFilteredResult(_0x7e3e50,_0x518afe))[_0xefb0('0x41')](handleError(_0x7e3e50,null));};exports[_0xefb0('0x42')]=function(_0x275d5a,_0xd1fa96){var _0x59cdcd={'raw':![],'where':{'id':_0x275d5a[_0xefb0('0x43')]['id']}},_0x4c0c53={};_0x4c0c53[_0xefb0('0x33')]=_[_0xefb0('0x30')](db['AnalyticCustomReport'][_0xefb0('0x2e')]);_0x4c0c53['query']=_[_0xefb0('0x30')](_0x275d5a[_0xefb0('0x35')]);_0x4c0c53[_0xefb0('0x31')]=_['intersection'](_0x4c0c53[_0xefb0('0x33')],_0x4c0c53[_0xefb0('0x35')]);_0x59cdcd[_0xefb0('0x34')]=_[_0xefb0('0x32')](_0x4c0c53[_0xefb0('0x33')],qs['fields'](_0x275d5a[_0xefb0('0x35')][_0xefb0('0x36')]));_0x59cdcd['attributes']=_0x59cdcd[_0xefb0('0x34')][_0xefb0('0x37')]?_0x59cdcd[_0xefb0('0x34')]:_0x4c0c53[_0xefb0('0x33')];if(_0x275d5a[_0xefb0('0x35')][_0xefb0('0x44')]){_0x59cdcd[_0xefb0('0x45')]=[{'all':!![]}];}_0x59cdcd=_[_0xefb0('0x3e')]({},_0x59cdcd,_0x275d5a[_0xefb0('0x46')]);return db['AnalyticCustomReport'][_0xefb0('0x47')](_0x59cdcd)['then'](handleEntityNotFound(_0xd1fa96,null))[_0xefb0('0x22')](respondWithResult(_0xd1fa96,null))[_0xefb0('0x41')](handleError(_0xd1fa96,null));};exports['create']=function(_0x495183,_0x80e43a){return db['AnalyticCustomReport']['create'](_0x495183[_0xefb0('0x48')],{})[_0xefb0('0x22')](function(_0x146607){var _0x15b5f7=_0x495183[_0xefb0('0x49')][_0xefb0('0x24')]({'plain':!![]});if(!_0x15b5f7)throw new Error(_0xefb0('0x4a'));if(_0x15b5f7[_0xefb0('0x4b')]==='user'){var _0x2e0df3=_0x146607['get']({'plain':!![]});var _0x3a0558=_0xefb0('0x4c');return db[_0xefb0('0x4d')][_0xefb0('0x47')]({'where':{'name':_0x3a0558,'userProfileId':_0x15b5f7[_0xefb0('0x4e')]},'raw':!![]})[_0xefb0('0x22')](function(_0x795892){if(_0x795892&&_0x795892['autoAssociation']===0x0){return db[_0xefb0('0x26')]['create']({'name':_0x2e0df3[_0xefb0('0x2a')],'resourceId':_0x2e0df3['id'],'type':_0xefb0('0x25'),'sectionId':_0x795892['id']},{})[_0xefb0('0x22')](function(){return _0x146607;});}else{return _0x146607;}})[_0xefb0('0x41')](function(_0x4e968f){logger[_0xefb0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e968f);throw _0x4e968f;});}return _0x146607;})['then'](respondWithResult(_0x80e43a,0xc9))[_0xefb0('0x41')](handleError(_0x80e43a,null));};exports[_0xefb0('0x21')]=function(_0x23ec09,_0x4013dd){if(_0x23ec09[_0xefb0('0x48')]['id']){delete _0x23ec09[_0xefb0('0x48')]['id'];}return db[_0xefb0('0x2d')][_0xefb0('0x47')]({'where':{'id':_0x23ec09[_0xefb0('0x43')]['id']}})[_0xefb0('0x22')](handleEntityNotFound(_0x4013dd,null))[_0xefb0('0x22')](saveUpdates(_0x23ec09['body'],null))[_0xefb0('0x22')](respondWithResult(_0x4013dd,null))[_0xefb0('0x41')](handleError(_0x4013dd,null));};exports[_0xefb0('0x23')]=function(_0x299c73,_0x9f3019){return db[_0xefb0('0x2d')][_0xefb0('0x47')]({'where':{'id':_0x299c73['params']['id']}})[_0xefb0('0x22')](handleEntityNotFound(_0x9f3019,null))['then'](removeEntity(_0x9f3019,null))[_0xefb0('0x41')](handleError(_0x9f3019,null));};exports['preview']=function(_0xbea280,_0x59eb72){var _0x40f485=0xa;var _0x299195=[_0xefb0('0x4f'),_0xefb0('0x50'),_0xefb0('0x51'),_0xefb0('0x52')];var _0x5832a8={'SUM':_0xefb0('0x53'),'COUNT':_0xefb0('0x54'),'COUNT DISTINCT':_0xefb0('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xefb0('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xefb0('0x57')};var _0x4d1c66={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xefb0('0x58'),'ROUND':_0xefb0('0x59'),'UNIX_TIMESTAMP':_0xefb0('0x5a')};var _0x359a2d=function(_0x393a5e){return!_[_0xefb0('0x5b')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xefb0('0x5c')],_0x393a5e);};var _0x15188d=function(_0x431c73){if(!_0x431c73||!_0x431c73[_0xefb0('0x5d')][_0xefb0('0x37')]){return'';}for(var _0x56ab3c='(',_0x1e66f9=0x0;_0x1e66f9<_0x431c73[_0xefb0('0x5d')][_0xefb0('0x37')];_0x1e66f9+=0x1){_0x1e66f9>0x0&&(_0x56ab3c+='\x20'+_0x431c73[_0xefb0('0x5e')]+'\x20');_0x56ab3c+=_0x431c73[_0xefb0('0x5d')][_0x1e66f9][_0xefb0('0x5f')]?_0x15188d(_0x431c73['rules'][_0x1e66f9][_0xefb0('0x5f')]):_0x431c73['rules'][_0x1e66f9][_0xefb0('0x60')]+'\x20'+_0x431c73[_0xefb0('0x5d')][_0x1e66f9]['condition']+(_0x359a2d(_0x431c73[_0xefb0('0x5d')][_0x1e66f9][_0xefb0('0x61')])?'\x20'+_0x431c73[_0xefb0('0x5d')][_0x1e66f9][_0xefb0('0x62')]:'');}return _0x56ab3c+')';};var _0x10ec95={'where':{'id':_0xbea280[_0xefb0('0x43')]['id']}},_0x461a47,_0x255fb4,_0x3c7f92,_0x1d95a4,_0x459534;_0x10ec95=_[_0xefb0('0x3e')]({},_0x10ec95,_0xbea280[_0xefb0('0x46')]);return db[_0xefb0('0x2d')][_0xefb0('0x47')](_0x10ec95)['then'](function(_0x121970){if(_0x121970){_0x461a47=_0x121970;return _0x121970[_0xefb0('0x63')]();}return null;})[_0xefb0('0x22')](function(_0x190c5c){if(_0x190c5c){if(!_0x190c5c[_0xefb0('0x37')]){throw new db[(_0xefb0('0x64'))][(_0xefb0('0x65'))](_0xefb0('0x66'),0x193);}_0x255fb4=_0x190c5c;return db['AnalyticMetric'][_0xefb0('0x40')]({'raw':!![]});}return null;})['then'](function(_0xfac1b6){if(_0xfac1b6){_0x3c7f92=_[_0xefb0('0x67')](_0xfac1b6,'id');var _0x39b117;var _0x3b44f0=squel['select']();_0x3b44f0['from'](_0x461a47['table']);for(var _0x50000e=0x0;_0x50000e<_0x255fb4[_0xefb0('0x37')];_0x50000e+=0x1){_0x39b117=_0x255fb4[_0x50000e][_0xefb0('0x68')]?_0x3c7f92[_0x255fb4[_0x50000e]['MetricId']]['metric']:_0x255fb4[_0x50000e][_0xefb0('0x60')];_0x39b117=_0x255fb4[_0x50000e][_0xefb0('0x69')]?_[_0xefb0('0x6a')](_0x5832a8[_0x255fb4[_0x50000e][_0xefb0('0x69')]],'%s',_0x39b117):_0x39b117;_0x39b117=_0x255fb4[_0x50000e][_0xefb0('0x6b')]?_[_0xefb0('0x6a')](_0x4d1c66[_0x255fb4[_0x50000e]['format']],'%s',_0x39b117):_0x39b117;if(_0x255fb4[_0x50000e][_0xefb0('0x6c')]){_0x3b44f0[_0xefb0('0x5f')](_0x39b117);}_0x255fb4[_0x50000e][_0xefb0('0x6d')]&&_0x3b44f0[_0xefb0('0x3a')](_0x39b117,_0x255fb4[_0x50000e]['orderBy']==='DESC'?![]:!![]);_0x3b44f0[_0xefb0('0x60')](_0x39b117,_0x255fb4[_0x50000e]['alias']||_0x39b117);}if(_0x461a47[_0xefb0('0x6e')]){_0x461a47[_0xefb0('0x6e')]=JSON[_0xefb0('0x6f')](_0x461a47[_0xefb0('0x6e')]);for(var _0x583a25=0x0;_0x583a25<_0x461a47[_0xefb0('0x6e')][_0xefb0('0x37')];_0x583a25+=0x1){if(_0x461a47[_0xefb0('0x6e')][_0x583a25]['type']&&_[_0xefb0('0x5b')](_0x299195,_0x461a47['joins'][_0x583a25][_0xefb0('0x2f')])&&_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x70')]&&_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x71')]&&_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x72')]){_0x3b44f0[_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x2f')]](_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x71')],null,util[_0xefb0('0x6b')]('%s.%s\x20=\x20%s.%s',_0x461a47[_0xefb0('0x73')],_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x70')],_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x71')],_0x461a47[_0xefb0('0x6e')][_0x583a25]['foreignKey']));}}}if(_0x461a47[_0xefb0('0x74')]){_0x461a47[_0xefb0('0x74')]=JSON[_0xefb0('0x6f')](_0x461a47[_0xefb0('0x74')]);_0x3b44f0[_0xefb0('0x3c')](_0x15188d(_0x461a47[_0xefb0('0x74')][_0xefb0('0x5f')]));}_0x459534=_0x3b44f0[_0xefb0('0x75')]();_0x3b44f0[_0xefb0('0x1c')](_0x40f485);_0x3b44f0[_0xefb0('0x19')](0x0);logger[_0xefb0('0x76')](_0xefb0('0x77'),_0x3b44f0[_0xefb0('0x78')]());return dbH[_0xefb0('0x79')][_0xefb0('0x35')](_0x3b44f0[_0xefb0('0x78')](),{'type':dbH['sequelize'][_0xefb0('0x7a')][_0xefb0('0x7b')]});}})[_0xefb0('0x22')](respondWithResult(_0x59eb72,null))[_0xefb0('0x41')](handleError(_0x59eb72,null));};function runReport(_0x5a4894,_0x202eda,_0x59b9ac){var _0x3b36a9=_0x202eda['name'];var _0xd04d61=0xa;var _0x4025b9=[_0xefb0('0x4f'),_0xefb0('0x50'),'right_join','cross_join'];var _0x1045d3={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xefb0('0x55'),'MAX':_0xefb0('0x7c'),'MIN':_0xefb0('0x7d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xefb0('0x7e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5c9191={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xefb0('0x7f'),'HOUR':_0xefb0('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xefb0('0x5a')};var _0xd93750=function(_0x3c9441){return!_['includes']([_0xefb0('0x80'),_0xefb0('0x81'),_0xefb0('0x82'),_0xefb0('0x5c')],_0x3c9441);};var _0x20f385=function(_0x36c5fb){if(!_0x36c5fb||!_0x36c5fb[_0xefb0('0x5d')][_0xefb0('0x37')]){return'';}for(var _0x543d3f='(',_0xcd3911=0x0;_0xcd3911<_0x36c5fb['rules'][_0xefb0('0x37')];_0xcd3911+=0x1){_0xcd3911>0x0&&(_0x543d3f+='\x20'+_0x36c5fb[_0xefb0('0x5e')]+'\x20');_0x543d3f+=_0x36c5fb[_0xefb0('0x5d')][_0xcd3911][_0xefb0('0x5f')]?_0x20f385(_0x36c5fb[_0xefb0('0x5d')][_0xcd3911][_0xefb0('0x5f')]):_0x36c5fb['rules'][_0xcd3911][_0xefb0('0x60')]+'\x20'+_0x36c5fb[_0xefb0('0x5d')][_0xcd3911][_0xefb0('0x61')]+(_0xd93750(_0x36c5fb['rules'][_0xcd3911][_0xefb0('0x61')])?'\x20'+_0x36c5fb['rules'][_0xcd3911][_0xefb0('0x62')]:'');}return _0x543d3f+')';};var _0x4c9fca={'where':{'id':_0x5a4894['id']}},_0xef57a0,_0x3869be,_0x10c13c,_0x5b9334,_0x502f18;_0x4c9fca=_[_0xefb0('0x3e')]({},_0x4c9fca,_0x59b9ac);return db[_0xefb0('0x2d')]['find'](_0x4c9fca)['then'](function(_0x37c211){if(_0x37c211){_0xef57a0=_0x37c211;return _0x37c211['getFields']();}return null;})[_0xefb0('0x22')](function(_0x40de47){if(_0x40de47){if(!_0x40de47['length']){throw new db[(_0xefb0('0x64'))][(_0xefb0('0x65'))](_0xefb0('0x66'),0x193);}_0x3869be=_0x40de47;return db[_0xefb0('0x83')][_0xefb0('0x40')]({'raw':!![]});}return null;})[_0xefb0('0x22')](function(_0x30d973){if(_0x30d973){_0x10c13c=_['keyBy'](_0x30d973,'id');var _0x25a3d0;var _0xaf967a=squel[_0xefb0('0x84')]();_0xaf967a[_0xefb0('0x85')](_0xef57a0['table']);for(var _0x5375b0=0x0;_0x5375b0<_0x3869be[_0xefb0('0x37')];_0x5375b0+=0x1){_0x25a3d0=_0x3869be[_0x5375b0][_0xefb0('0x68')]?_0x10c13c[_0x3869be[_0x5375b0][_0xefb0('0x68')]]['metric']:_0x3869be[_0x5375b0][_0xefb0('0x60')];_0x25a3d0=_0x3869be[_0x5375b0][_0xefb0('0x69')]?_[_0xefb0('0x6a')](_0x1045d3[_0x3869be[_0x5375b0][_0xefb0('0x69')]],'%s',_0x25a3d0):_0x25a3d0;_0x25a3d0=_0x3869be[_0x5375b0][_0xefb0('0x6b')]?_['replace'](_0x5c9191[_0x3869be[_0x5375b0][_0xefb0('0x6b')]],'%s',_0x25a3d0):_0x25a3d0;if(_0x3869be[_0x5375b0][_0xefb0('0x6c')]){_0xaf967a[_0xefb0('0x5f')](_0x25a3d0);}_0x3869be[_0x5375b0][_0xefb0('0x6d')]&&_0xaf967a[_0xefb0('0x3a')](_0x25a3d0,_0x3869be[_0x5375b0]['orderBy']===_0xefb0('0x86')?![]:!![]);_0xaf967a[_0xefb0('0x60')](_0x25a3d0,_0x3869be[_0x5375b0][_0xefb0('0x87')]||_0x25a3d0);}if(_0xef57a0[_0xefb0('0x6e')]){_0xef57a0[_0xefb0('0x6e')]=JSON['parse'](_0xef57a0[_0xefb0('0x6e')]);for(var _0x576eb7=0x0;_0x576eb7<_0xef57a0['joins'][_0xefb0('0x37')];_0x576eb7+=0x1){if(_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x2f')]&&_[_0xefb0('0x5b')](_0x4025b9,_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x2f')])&&_0xef57a0['joins'][_0x576eb7][_0xefb0('0x70')]&&_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x71')]&&_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x72')]){_0xaf967a[_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x2f')]](_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x71')],null,util[_0xefb0('0x6b')]('%s.%s\x20=\x20%s.%s',_0xef57a0[_0xefb0('0x73')],_0xef57a0[_0xefb0('0x6e')][_0x576eb7]['parentKey'],_0xef57a0[_0xefb0('0x6e')][_0x576eb7]['foreignTable'],_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x72')]));}}}if(_0xef57a0[_0xefb0('0x74')]){_0xef57a0[_0xefb0('0x74')]=JSON[_0xefb0('0x6f')](_0xef57a0['conditions']);_0xaf967a[_0xefb0('0x3c')](_0x20f385(_0xef57a0['conditions'][_0xefb0('0x5f')]));}_0x502f18=_0xaf967a[_0xefb0('0x75')]();_0xaf967a[_0xefb0('0x1c')](_0xd04d61);_0xaf967a[_0xefb0('0x19')](0x0);return;}})[_0xefb0('0x22')](function(){if(_0x202eda[_0xefb0('0x88')]===_0xefb0('0x89')){return null;}var _0x1c8166=_[_0xefb0('0x3e')](_0x202eda,{'name':_0x202eda[_0xefb0('0x8a')]||_0x202eda['name']||_0xef57a0[_0xefb0('0x2a')],'basename':_0x3b36a9,'savename':util[_0xefb0('0x6b')](_0xefb0('0x8b'),_0x202eda[_0xefb0('0x2a')]||_0xef57a0[_0xefb0('0x2a')],require(_0xefb0('0x8c'))[_0xefb0('0x8d')](0x4),_0x202eda['output']||'csv'),'reportId':_0xef57a0['id'],'reportType':'custom'});return db[_0xefb0('0x8e')][_0xefb0('0x8f')](_0x1c8166,{'raw':!![]});})[_0xefb0('0x22')](function(_0x59e730){if(_0xef57a0['table']===_0xefb0('0x90')){_0x502f18[_0xefb0('0x3c')](_0xef57a0[_0xefb0('0x73')]+_0xefb0('0x91'),_0x202eda['startDate'],_0x202eda[_0xefb0('0x92')]);}else{_0x502f18[_0xefb0('0x3c')](_0xef57a0[_0xefb0('0x73')]+_0xefb0('0x93'),_0x202eda[_0xefb0('0x94')],_0x202eda[_0xefb0('0x92')]);}if(_0x59e730){logger['info']('Run\x20Query:',_0x502f18[_0xefb0('0x78')]());require(_0xefb0('0x95'))[_0xefb0('0x96')](path['join'](__dirname,_0xefb0('0x97'),_0x59e730[_0xefb0('0x88')]),[_0x59e730['id'],_0x502f18[_0xefb0('0x78')](),path[_0xefb0('0x4f')](__dirname,_0xefb0('0x98'),_0x59e730[_0xefb0('0x99')]),_0x3b36a9]);return _0x59e730;}else{var _0x55ddc2=squel[_0xefb0('0x84')]();_0x55ddc2[_0xefb0('0x85')]('('+_0x502f18[_0xefb0('0x78')]()+')',_0xefb0('0x9a'));_0x55ddc2[_0xefb0('0x60')](_0xefb0('0x9b'),_0xefb0('0x1b'));_0x502f18[_0xefb0('0x1c')](_0x202eda[_0xefb0('0x1c')]||_0xd04d61);_0x502f18[_0xefb0('0x19')](_0x202eda['offset']||0x0);return dbH[_0xefb0('0x79')][_0xefb0('0x35')](_0x55ddc2[_0xefb0('0x78')](),{'type':dbH[_0xefb0('0x79')]['QueryTypes'][_0xefb0('0x7b')]})[_0xefb0('0x22')](function(_0x5a1092){if(!_0x5a1092['length']){_0x5b9334=0x0;}else{_0x5b9334=_0x5a1092[0x0][_0xefb0('0x1b')]||0x0;}return dbH[_0xefb0('0x79')][_0xefb0('0x35')](_0x502f18[_0xefb0('0x78')](),{'type':dbH[_0xefb0('0x79')][_0xefb0('0x7a')][_0xefb0('0x7b')]});})[_0xefb0('0x22')](function(_0x307842){return{'rows':_0x307842||[],'count':_0x5b9334};});}});}exports[_0xefb0('0x9c')]=function(_0x1b5a83,_0x2ae20d){return runReport(_0x1b5a83['params'],_0x1b5a83[_0xefb0('0x35')],_0x1b5a83[_0xefb0('0x46')])['then'](respondWithResult(_0x2ae20d,null))[_0xefb0('0x41')](handleError(_0x2ae20d,null));};exports[_0xefb0('0x9d')]=runReport;exports[_0xefb0('0x35')]=function(_0x312e8a,_0x29be49){var _0xdb6827=0xa;var _0x5cea4f=[_0xefb0('0x4f'),_0xefb0('0x50'),_0xefb0('0x51'),_0xefb0('0x52')];var _0x159654={'SUM':'SUM(%s)','COUNT':_0xefb0('0x54'),'COUNT DISTINCT':_0xefb0('0x55'),'MAX':_0xefb0('0x7c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xefb0('0x57')};var _0x542f86={'SEC_TO_TIME':_0xefb0('0x9e'),'DATE':'DATE(%s)','HOUR':_0xefb0('0x58'),'ROUND':_0xefb0('0x59'),'UNIX_TIMESTAMP':_0xefb0('0x5a')};var _0x577de8=function(_0xd8d5fd){return!_[_0xefb0('0x5b')]([_0xefb0('0x80'),_0xefb0('0x81'),'IS\x20EMPTY',_0xefb0('0x5c')],_0xd8d5fd);};var _0x1f4f0c=function(_0x555020){if(!_0x555020||!_0x555020[_0xefb0('0x5d')][_0xefb0('0x37')]){return'';}for(var _0x5243e7='(',_0x5001f7=0x0;_0x5001f7<_0x555020[_0xefb0('0x5d')][_0xefb0('0x37')];_0x5001f7+=0x1){_0x5001f7>0x0&&(_0x5243e7+='\x20'+_0x555020[_0xefb0('0x5e')]+'\x20');_0x5243e7+=_0x555020['rules'][_0x5001f7][_0xefb0('0x5f')]?_0x1f4f0c(_0x555020[_0xefb0('0x5d')][_0x5001f7]['group']):_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x60')]+'\x20'+_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x61')]+(_0x577de8(_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x61')])?'\x20'+_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x62')]:'');}return _0x5243e7+')';};var _0x229d1c={'where':{'id':_0x312e8a['params']['id']}},_0x390547,_0x2b4243,_0x50511f,_0x3c6f4f,_0x37e49c;_0x229d1c=_[_0xefb0('0x3e')]({},_0x229d1c,_0x312e8a[_0xefb0('0x46')]);return db[_0xefb0('0x2d')][_0xefb0('0x47')](_0x229d1c)['then'](function(_0x4488b1){if(_0x4488b1){_0x390547=_0x4488b1;return _0x4488b1[_0xefb0('0x63')]();}return null;})[_0xefb0('0x22')](function(_0x5176f4){if(_0x5176f4){if(!_0x5176f4[_0xefb0('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xefb0('0x66'),0x193);}_0x2b4243=_0x5176f4;return db[_0xefb0('0x83')]['findAll']({'raw':!![]});}return null;})[_0xefb0('0x22')](function(_0x55f485){if(_0x55f485){_0x50511f=_[_0xefb0('0x67')](_0x55f485,'id');var _0x5365db;var _0x203582=squel[_0xefb0('0x84')]();_0x203582[_0xefb0('0x85')](_0x390547['table']);for(var _0x19403d=0x0;_0x19403d<_0x2b4243[_0xefb0('0x37')];_0x19403d+=0x1){_0x5365db=_0x2b4243[_0x19403d][_0xefb0('0x68')]?_0x50511f[_0x2b4243[_0x19403d]['MetricId']]['metric']:_0x2b4243[_0x19403d]['field'];_0x5365db=_0x2b4243[_0x19403d][_0xefb0('0x69')]?_['replace'](_0x159654[_0x2b4243[_0x19403d]['function']],'%s',_0x5365db):_0x5365db;_0x5365db=_0x2b4243[_0x19403d][_0xefb0('0x6b')]?_['replace'](_0x542f86[_0x2b4243[_0x19403d][_0xefb0('0x6b')]],'%s',_0x5365db):_0x5365db;if(_0x2b4243[_0x19403d][_0xefb0('0x6c')]){_0x203582[_0xefb0('0x5f')](_0x5365db);}_0x2b4243[_0x19403d]['orderBy']&&_0x203582['order'](_0x5365db,_0x2b4243[_0x19403d][_0xefb0('0x6d')]===_0xefb0('0x86')?![]:!![]);_0x203582[_0xefb0('0x60')](_0x5365db,_0x2b4243[_0x19403d][_0xefb0('0x87')]||_0x5365db);}if(_0x390547[_0xefb0('0x6e')]){_0x390547[_0xefb0('0x6e')]=JSON[_0xefb0('0x6f')](_0x390547[_0xefb0('0x6e')]);for(var _0x4582ab=0x0;_0x4582ab<_0x390547['joins'][_0xefb0('0x37')];_0x4582ab+=0x1){if(_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x2f')]&&_['includes'](_0x5cea4f,_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x2f')])&&_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x70')]&&_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x71')]&&_0x390547['joins'][_0x4582ab][_0xefb0('0x72')]){_0x203582[_0x390547['joins'][_0x4582ab]['type']](_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x71')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x390547['table'],_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x70')],_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x71')],_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x72')]));}}}if(_0x390547[_0xefb0('0x74')]){_0x390547['conditions']=JSON[_0xefb0('0x6f')](_0x390547['conditions']);_0x203582[_0xefb0('0x3c')](_0x1f4f0c(_0x390547['conditions']['group']));}_0x37e49c=_0x203582[_0xefb0('0x75')]();_0x203582[_0xefb0('0x1c')](_0xdb6827);_0x203582['offset'](0x0);logger['debug'](_0xefb0('0x77'),_0x203582['toString']());return dbH['sequelize']['query'](_0x203582['toString'](),{'type':dbH[_0xefb0('0x79')][_0xefb0('0x7a')][_0xefb0('0x7b')]});}})[_0xefb0('0x22')](function(){return{'sql':_0x37e49c[_0xefb0('0x78')]()};})[_0xefb0('0x22')](respondWithResult(_0x29be49,null))['catch'](handleError(_0x29be49,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index b46e76b..fbe24cc 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 _0x69dc=['analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport'];(function(_0x505d44,_0x5d1152){var _0x461166=function(_0xb0848d){while(--_0xb0848d){_0x505d44['push'](_0x505d44['shift']());}};_0x461166(++_0x5d1152);}(_0x69dc,0x1bd));var _0xc69d=function(_0x2cab80,_0x4f59d8){_0x2cab80=_0x2cab80-0x0;var _0x411205=_0x69dc[_0x2cab80];return _0x411205;};'use strict';var _=require(_0xc69d('0x0'));var util=require(_0xc69d('0x1'));var logger=require(_0xc69d('0x2'))(_0xc69d('0x3'));var moment=require('moment');var BPromise=require(_0xc69d('0x4'));var rp=require(_0xc69d('0x5'));var fs=require('fs');var path=require(_0xc69d('0x6'));var rimraf=require(_0xc69d('0x7'));var config=require(_0xc69d('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xc69d('0x9')]=function(_0x167137,_0x4f1544){return _0x167137['define'](_0xc69d('0xa'),attributes,{'tableName':_0xc69d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa092=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x33e172,_0x2b4d45){var _0x31427f=function(_0x353e2a){while(--_0x353e2a){_0x33e172['push'](_0x33e172['shift']());}};_0x31427f(++_0x2b4d45);}(_0xa092,0x1cc));var _0x2a09=function(_0x3c5cc7,_0x447374){_0x3c5cc7=_0x3c5cc7-0x0;var _0x2aef2a=_0xa092[_0x3c5cc7];return _0x2aef2a;};'use strict';var _=require(_0x2a09('0x0'));var util=require(_0x2a09('0x1'));var logger=require(_0x2a09('0x2'))(_0x2a09('0x3'));var moment=require(_0x2a09('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a09('0x5'));var fs=require('fs');var path=require(_0x2a09('0x6'));var rimraf=require(_0x2a09('0x7'));var config=require(_0x2a09('0x8'));var attributes=require(_0x2a09('0x9'));module[_0x2a09('0xa')]=function(_0x352692,_0x562c35){return _0x352692[_0x2a09('0xb')](_0x2a09('0xc'),attributes,{'tableName':_0x2a09('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index dc664fb..c97d613 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 _0xca80=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x406fbb,_0x1093e5){var _0x8e921d=function(_0x410517){while(--_0x410517){_0x406fbb['push'](_0x406fbb['shift']());}};_0x8e921d(++_0x1093e5);}(_0xca80,0xdb));var _0x0ca8=function(_0x5f133a,_0x258967){_0x5f133a=_0x5f133a-0x0;var _0x548f1f=_0xca80[_0x5f133a];return _0x548f1f;};'use strict';var _=require('lodash');var util=require(_0x0ca8('0x0'));var moment=require(_0x0ca8('0x1'));var BPromise=require(_0x0ca8('0x2'));var rs=require(_0x0ca8('0x3'));var fs=require('fs');var Redis=require(_0x0ca8('0x4'));var db=require(_0x0ca8('0x5'))['db'];var utils=require(_0x0ca8('0x6'));var logger=require(_0x0ca8('0x7'))(_0x0ca8('0x8'));var config=require('../../config/environment');var jayson=require(_0x0ca8('0x9'));var client=jayson[_0x0ca8('0xa')][_0x0ca8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x428d6b,_0x3bfdb4,_0x2e6237){return new BPromise(function(_0x1fd1e2,_0xef60bd){return client['request'](_0x428d6b,_0x2e6237)[_0x0ca8('0xc')](function(_0xb1a7d9){logger[_0x0ca8('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3bfdb4,_0x0ca8('0xe'));logger[_0x0ca8('0xf')](_0x0ca8('0x10'),_0x3bfdb4,_0x0ca8('0xe'),JSON[_0x0ca8('0x11')](_0xb1a7d9));if(_0xb1a7d9['error']){if(_0xb1a7d9[_0x0ca8('0x12')][_0x0ca8('0x13')]===0x1f4){logger['error'](_0x0ca8('0x14'),_0x3bfdb4,_0xb1a7d9['error']['message']);return _0xef60bd(_0xb1a7d9['error']['message']);}logger[_0x0ca8('0x12')](_0x0ca8('0x14'),_0x3bfdb4,_0xb1a7d9[_0x0ca8('0x12')]['message']);return _0x1fd1e2(_0xb1a7d9[_0x0ca8('0x12')][_0x0ca8('0x15')]);}else{logger[_0x0ca8('0xd')](_0x0ca8('0x14'),_0x3bfdb4,_0x0ca8('0xe'));_0x1fd1e2(_0xb1a7d9[_0x0ca8('0x16')][_0x0ca8('0x15')]);}})[_0x0ca8('0x17')](function(_0x3e8c11){logger[_0x0ca8('0x12')](_0x0ca8('0x14'),_0x3bfdb4,_0x3e8c11);_0xef60bd(_0x3e8c11);});});} \ No newline at end of file +var _0x0047=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x10ddc5,_0x384456){var _0x3de8fa=function(_0x3be021){while(--_0x3be021){_0x10ddc5['push'](_0x10ddc5['shift']());}};_0x3de8fa(++_0x384456);}(_0x0047,0x111));var _0x7004=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x0047[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var moment=require('moment');var BPromise=require(_0x7004('0x2'));var rs=require(_0x7004('0x3'));var fs=require('fs');var Redis=require(_0x7004('0x4'));var db=require(_0x7004('0x5'))['db'];var utils=require(_0x7004('0x6'));var logger=require('../../config/logger')(_0x7004('0x7'));var config=require(_0x7004('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7004('0x9')][_0x7004('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3aa2d9,_0x14377a,_0x4a0731){return new BPromise(function(_0x227bc6,_0x5f41cd){return client['request'](_0x3aa2d9,_0x4a0731)[_0x7004('0xb')](function(_0x4b004a){logger['info'](_0x7004('0xc'),_0x14377a,_0x7004('0xd'));logger[_0x7004('0xe')](_0x7004('0xf'),_0x14377a,_0x7004('0xd'),JSON[_0x7004('0x10')](_0x4b004a));if(_0x4b004a[_0x7004('0x11')]){if(_0x4b004a[_0x7004('0x11')]['code']===0x1f4){logger[_0x7004('0x11')](_0x7004('0xc'),_0x14377a,_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);return _0x5f41cd(_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);}logger[_0x7004('0x11')](_0x7004('0xc'),_0x14377a,_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);return _0x227bc6(_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);}else{logger[_0x7004('0x13')](_0x7004('0xc'),_0x14377a,_0x7004('0xd'));_0x227bc6(_0x4b004a[_0x7004('0x14')][_0x7004('0x12')]);}})[_0x7004('0x15')](function(_0x2d55fd){logger[_0x7004('0x11')](_0x7004('0xc'),_0x14377a,_0x2d55fd);_0x5f41cd(_0x2d55fd);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 6b221b5..82f6394 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 _0x1518=['preview','/:id/run','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','/:id','show','get','/:id/preview'];(function(_0x39abd1,_0x48aea7){var _0x4b1b6e=function(_0x2e96b2){while(--_0x2e96b2){_0x39abd1['push'](_0x39abd1['shift']());}};_0x4b1b6e(++_0x48aea7);}(_0x1518,0xef));var _0x8151=function(_0x576fd3,_0x19bfbc){_0x576fd3=_0x576fd3-0x0;var _0x3331cb=_0x1518[_0x576fd3];return _0x3331cb;};'use strict';var multer=require(_0x8151('0x0'));var util=require(_0x8151('0x1'));var path=require(_0x8151('0x2'));var timeout=require(_0x8151('0x3'));var express=require('express');var router=express[_0x8151('0x4')]();var fs_extra=require(_0x8151('0x5'));var auth=require(_0x8151('0x6'));var interaction=require(_0x8151('0x7'));var config=require('../../config/environment');var controller=require(_0x8151('0x8'));router['get']('/',auth[_0x8151('0x9')](),controller['index']);router['get'](_0x8151('0xa'),auth[_0x8151('0x9')](),controller[_0x8151('0xb')]);router[_0x8151('0xc')](_0x8151('0xd'),auth[_0x8151('0x9')](),controller[_0x8151('0xe')]);router['get'](_0x8151('0xf'),auth[_0x8151('0x9')](),controller['run']);router['get']('/:id/query',auth[_0x8151('0x9')](),controller[_0x8151('0x10')]);router[_0x8151('0x11')]('/',auth[_0x8151('0x9')](),controller['create']);router[_0x8151('0x12')](_0x8151('0xa'),auth[_0x8151('0x9')](),controller[_0x8151('0x13')]);router[_0x8151('0x14')](_0x8151('0xa'),auth[_0x8151('0x9')](),controller[_0x8151('0x15')]);module[_0x8151('0x16')]=router; \ No newline at end of file +var _0x5b52=['../../config/environment','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c3e1c,_0x2130a5){var _0x4e34eb=function(_0x7274c1){while(--_0x7274c1){_0x2c3e1c['push'](_0x2c3e1c['shift']());}};_0x4e34eb(++_0x2130a5);}(_0x5b52,0xa2));var _0x25b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5b52[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x25b5('0x0'));var path=require(_0x25b5('0x1'));var timeout=require('connect-timeout');var express=require(_0x25b5('0x2'));var router=express['Router']();var fs_extra=require(_0x25b5('0x3'));var auth=require(_0x25b5('0x4'));var interaction=require(_0x25b5('0x5'));var config=require(_0x25b5('0x6'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x25b5('0x7')](),controller[_0x25b5('0x8')]);router[_0x25b5('0x9')](_0x25b5('0xa'),auth[_0x25b5('0x7')](),controller['show']);router['get'](_0x25b5('0xb'),auth[_0x25b5('0x7')](),controller[_0x25b5('0xc')]);router[_0x25b5('0x9')](_0x25b5('0xd'),auth[_0x25b5('0x7')](),controller['run']);router[_0x25b5('0x9')](_0x25b5('0xe'),auth[_0x25b5('0x7')](),controller[_0x25b5('0xf')]);router[_0x25b5('0x10')]('/',auth[_0x25b5('0x7')](),controller['create']);router[_0x25b5('0x11')]('/:id',auth[_0x25b5('0x7')](),controller[_0x25b5('0x12')]);router['delete'](_0x25b5('0xa'),auth[_0x25b5('0x7')](),controller[_0x25b5('0x13')]);module[_0x25b5('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 8879923..c2af0be 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x14d584,_0x17c262){var _0x52bb57=function(_0x35ed62){while(--_0x35ed62){_0x14d584['push'](_0x14d584['shift']());}};_0x52bb57(++_0x17c262);}(_0xeda8,0x104));var _0x8eda=function(_0x1cf899,_0x3c818b){_0x1cf899=_0x1cf899-0x0;var _0x5f730f=_0xeda8[_0x1cf899];return _0x5f730f;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf858e,_0x51b0f1){_0xf858e=_0xf858e-0x0;var _0x5344d8=_0xfdbd[_0xf858e];return _0x5344d8;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 144d0bc..e45108b 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 _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','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','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','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','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x326f,0xd1));var _0xf326=function(_0xdc8987,_0x5ec847){_0xdc8987=_0xdc8987-0x0;var _0xb6891c=_0x326f[_0xdc8987];return _0xb6891c;};'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'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));}; \ No newline at end of file +var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x43cba0,_0x5073a0){var _0x31fd30=function(_0x1fae64){while(--_0x1fae64){_0x43cba0['push'](_0x43cba0['shift']());}};_0x31fd30(++_0x5073a0);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'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 _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a054827..8b65c75 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 _0xeefb=['../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','../../config/logger','api','moment','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xeefb,0x16c));var _0xbeef=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xeefb[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xbeef('0x0'));var util=require('util');var logger=require(_0xbeef('0x1'))(_0xbeef('0x2'));var moment=require(_0xbeef('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbeef('0x4'));var rimraf=require('rimraf');var config=require(_0xbeef('0x5'));var attributes=require(_0xbeef('0x6'));module[_0xbeef('0x7')]=function(_0x54cd1e,_0x3ac063){return _0x54cd1e['define']('AnalyticDefaultReport',attributes,{'tableName':_0xbeef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83f0=['bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x5ea242,_0x29cee7){var _0x5709ae=function(_0xc3df16){while(--_0xc3df16){_0x5ea242['push'](_0x5ea242['shift']());}};_0x5709ae(++_0x29cee7);}(_0x83f0,0xfa));var _0x083f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x83f0[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var logger=require(_0x083f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x083f('0x3'));var rp=require(_0x083f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x083f('0x5'));var attributes=require(_0x083f('0x6'));module[_0x083f('0x7')]=function(_0x4a71c9,_0x1089ae){return _0x4a71c9[_0x083f('0x8')](_0x083f('0x9'),attributes,{'tableName':_0x083f('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 3f500f6..0c63150 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 _0x8cb0=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8cb0,0xa4));var _0x08cb=function(_0x5a8d4a,_0x4b352d){_0x5a8d4a=_0x5a8d4a-0x0;var _0x4163c7=_0x8cb0[_0x5a8d4a];return _0x4163c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x08cb('0x0'));var BPromise=require(_0x08cb('0x1'));var rs=require(_0x08cb('0x2'));var fs=require('fs');var Redis=require(_0x08cb('0x3'));var db=require(_0x08cb('0x4'))['db'];var utils=require(_0x08cb('0x5'));var logger=require(_0x08cb('0x6'))(_0x08cb('0x7'));var config=require(_0x08cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x08cb('0x9')][_0x08cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bee7,_0x401c6d,_0x6cbfad){return new BPromise(function(_0x247c5a,_0x1e08ab){return client[_0x08cb('0xb')](_0x25bee7,_0x6cbfad)[_0x08cb('0xc')](function(_0x3c2035){logger[_0x08cb('0xd')](_0x08cb('0xe'),_0x401c6d,_0x08cb('0xf'));logger['debug'](_0x08cb('0x10'),_0x401c6d,_0x08cb('0xf'),JSON[_0x08cb('0x11')](_0x3c2035));if(_0x3c2035['error']){if(_0x3c2035['error'][_0x08cb('0x12')]===0x1f4){logger[_0x08cb('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x401c6d,_0x3c2035['error'][_0x08cb('0x14')]);return _0x1e08ab(_0x3c2035[_0x08cb('0x13')]['message']);}logger[_0x08cb('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x401c6d,_0x3c2035[_0x08cb('0x13')][_0x08cb('0x14')]);return _0x247c5a(_0x3c2035[_0x08cb('0x13')][_0x08cb('0x14')]);}else{logger['info'](_0x08cb('0xe'),_0x401c6d,_0x08cb('0xf'));_0x247c5a(_0x3c2035[_0x08cb('0x15')][_0x08cb('0x14')]);}})[_0x08cb('0x16')](function(_0x21b562){logger[_0x08cb('0x13')](_0x08cb('0xe'),_0x401c6d,_0x21b562);_0x1e08ab(_0x21b562);});});} \ No newline at end of file +var _0x35cf=['util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash'];(function(_0x47317f,_0x24ec5a){var _0x8a8794=function(_0x1a48ad){while(--_0x1a48ad){_0x47317f['push'](_0x47317f['shift']());}};_0x8a8794(++_0x24ec5a);}(_0x35cf,0x155));var _0xf35c=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x35cf[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var moment=require(_0xf35c('0x2'));var BPromise=require(_0xf35c('0x3'));var rs=require(_0xf35c('0x4'));var fs=require('fs');var Redis=require(_0xf35c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf35c('0x6'));var config=require('../../config/environment');var jayson=require(_0xf35c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bd436,_0x5c9ec6,_0xcaf151){return new BPromise(function(_0x40d1e7,_0x31b590){return client[_0xf35c('0x8')](_0x4bd436,_0xcaf151)[_0xf35c('0x9')](function(_0xa17514){logger[_0xf35c('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5c9ec6,_0xf35c('0xb'));logger[_0xf35c('0xc')](_0xf35c('0xd'),_0x5c9ec6,_0xf35c('0xb'),JSON['stringify'](_0xa17514));if(_0xa17514[_0xf35c('0xe')]){if(_0xa17514[_0xf35c('0xe')]['code']===0x1f4){logger[_0xf35c('0xe')](_0xf35c('0xf'),_0x5c9ec6,_0xa17514[_0xf35c('0xe')][_0xf35c('0x10')]);return _0x31b590(_0xa17514[_0xf35c('0xe')][_0xf35c('0x10')]);}logger[_0xf35c('0xe')](_0xf35c('0xf'),_0x5c9ec6,_0xa17514[_0xf35c('0xe')][_0xf35c('0x10')]);return _0x40d1e7(_0xa17514[_0xf35c('0xe')]['message']);}else{logger['info'](_0xf35c('0xf'),_0x5c9ec6,_0xf35c('0xb'));_0x40d1e7(_0xa17514[_0xf35c('0x11')][_0xf35c('0x10')]);}})['catch'](function(_0x48785f){logger[_0xf35c('0xe')](_0xf35c('0xf'),_0x5c9ec6,_0x48785f);_0x31b590(_0x48785f);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a196dde..0f40650 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 _0xdefa=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xdefa,0xce));var _0xadef=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdefa[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xadef('0x0'));var util=require(_0xadef('0x1'));var path=require(_0xadef('0x2'));var timeout=require('connect-timeout');var express=require(_0xadef('0x3'));var router=express[_0xadef('0x4')]();var fs_extra=require(_0xadef('0x5'));var auth=require(_0xadef('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xadef('0x7'));router[_0xadef('0x8')]('/',auth[_0xadef('0x9')](),controller[_0xadef('0xa')]);router[_0xadef('0x8')](_0xadef('0xb'),auth[_0xadef('0x9')](),controller[_0xadef('0xc')]);router['get'](_0xadef('0xd'),auth[_0xadef('0x9')](),controller[_0xadef('0xe')]);router[_0xadef('0x8')](_0xadef('0xf'),auth[_0xadef('0x9')](),controller[_0xadef('0x10')]);router['get'](_0xadef('0x11'),auth[_0xadef('0x9')](),controller[_0xadef('0x12')]);router[_0xadef('0x13')]('/',auth[_0xadef('0x9')](),controller['create']);router['put'](_0xadef('0xb'),auth[_0xadef('0x9')](),controller[_0xadef('0x14')]);router[_0xadef('0x15')]('/:id',auth[_0xadef('0x9')](),controller[_0xadef('0x16')]);module[_0xadef('0x17')]=router; \ No newline at end of file +var _0x2678=['update','delete','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2678,0x1bb));var _0x8267=function(_0x3743c6,_0x27d62c){_0x3743c6=_0x3743c6-0x0;var _0xafb07b=_0x2678[_0x3743c6];return _0xafb07b;};'use strict';var multer=require('multer');var util=require(_0x8267('0x0'));var path=require(_0x8267('0x1'));var timeout=require(_0x8267('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8267('0x3'));var interaction=require(_0x8267('0x4'));var config=require(_0x8267('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x8267('0x6')]('/',auth[_0x8267('0x7')](),controller[_0x8267('0x8')]);router[_0x8267('0x6')](_0x8267('0x9'),auth[_0x8267('0x7')](),controller[_0x8267('0xa')]);router[_0x8267('0x6')]('/:id/preview',auth[_0x8267('0x7')](),controller[_0x8267('0xb')]);router['get'](_0x8267('0xc'),auth[_0x8267('0x7')](),controller[_0x8267('0xd')]);router[_0x8267('0x6')](_0x8267('0xe'),auth['isAuthenticated'](),controller[_0x8267('0xf')]);router[_0x8267('0x10')]('/',auth[_0x8267('0x7')](),controller[_0x8267('0x11')]);router[_0x8267('0x12')](_0x8267('0x9'),auth[_0x8267('0x7')](),controller[_0x8267('0x13')]);router[_0x8267('0x14')](_0x8267('0x9'),auth[_0x8267('0x7')](),controller['destroy']);module[_0x8267('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 1ea8e49..cb66c3f 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 _0xaa3a=['xlsx','csv','DATE','ENUM','manual','scheduled','INTEGER','sequelize','exports','STRING','pdf'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xaa3a,0xe3));var _0xaaa3=function(_0x2b6c01,_0x4a1d39){_0x2b6c01=_0x2b6c01-0x0;var _0x4c051e=_0xaa3a[_0x2b6c01];return _0x4c051e;};'use strict';var Sequelize=require(_0xaaa3('0x0'));var moment=require('moment');module[_0xaaa3('0x1')]={'name':{'type':Sequelize[_0xaaa3('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xaaa3('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xaaa3('0x3'),_0xaaa3('0x4')),'allowNull':![],'defaultValue':_0xaaa3('0x5')},'savename':{'type':Sequelize[_0xaaa3('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xaaa3('0x6')]},'status':{'type':Sequelize[_0xaaa3('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xaaa3('0x7')](_0xaaa3('0x8'),_0xaaa3('0x9')),'allowNull':![],'defaultValue':_0xaaa3('0x8')},'reportId':{'type':Sequelize[_0xaaa3('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xaaa3('0x2')]}}; \ No newline at end of file +var _0xa012=['xlsx','DATE','STRING','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','ENUM','csv','pdf'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0xa012,0x164));var _0x2a01=function(_0x847809,_0x51e79e){_0x847809=_0x847809-0x0;var _0x598c3f=_0xa012[_0x847809];return _0x598c3f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2a01('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2a01('0x1')](_0x2a01('0x2'),_0x2a01('0x3'),_0x2a01('0x4')),'allowNull':![],'defaultValue':_0x2a01('0x2')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x2a01('0x5')]},'endDate':{'type':Sequelize[_0x2a01('0x5')]},'status':{'type':Sequelize[_0x2a01('0x6')],'defaultValue':_0x2a01('0x7')},'type':{'type':Sequelize[_0x2a01('0x1')](_0x2a01('0x8'),_0x2a01('0x9')),'allowNull':![],'defaultValue':_0x2a01('0x8')},'reportId':{'type':Sequelize[_0x2a01('0xa')](0xb)[_0x2a01('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 683cec6..b1583d1 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 _0xbadb=['merge','options','AnalyticExtractedReport','include','findAll','rows','catch','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL'];(function(_0x261caf,_0x28a159){var _0x54d8d0=function(_0x3534b2){while(--_0x3534b2){_0x261caf['push'](_0x261caf['shift']());}};_0x54d8d0(++_0x28a159);}(_0xbadb,0x7a));var _0xbbad=function(_0x159d72,_0x2f17b5){_0x159d72=_0x159d72-0x0;var _0x499d86=_0xbadb[_0x159d72];return _0x499d86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbbad('0x0'));var jsonpatch=require(_0xbbad('0x1'));var rp=require('request-promise');var moment=require(_0xbbad('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbbad('0x3'));var util=require(_0xbbad('0x4'));var path=require(_0xbbad('0x5'));var sox=require(_0xbbad('0x6'));var csv=require(_0xbbad('0x7'));var ejs=require(_0xbbad('0x8'));var fs=require('fs');var fs_extra=require(_0xbbad('0x9'));var _=require('lodash');var squel=require(_0xbbad('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbbad('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbbad('0xc'));var Papa=require(_0xbbad('0xd'));var Redis=require(_0xbbad('0xe'));var authService=require(_0xbbad('0xf'));var qs=require(_0xbbad('0x10'));var as=require(_0xbbad('0x11'));var hardwareService=require(_0xbbad('0x12'));var logger=require('../../config/logger')(_0xbbad('0x13'));var utils=require('../../config/utils');var config=require(_0xbbad('0x14'));var licenseUtil=require(_0xbbad('0x15'));var db=require(_0xbbad('0x16'))['db'];function respondWithStatusCode(_0x1ac846,_0x2a65ed){_0x2a65ed=_0x2a65ed||0xcc;return function(_0x180821){if(_0x180821){return _0x1ac846[_0xbbad('0x17')](_0x2a65ed);}return _0x1ac846['status'](_0x2a65ed)['end']();};}function respondWithResult(_0x4ce1a2,_0x3efc20){_0x3efc20=_0x3efc20||0xc8;return function(_0x465f30){if(_0x465f30){return _0x4ce1a2['status'](_0x3efc20)['json'](_0x465f30);}};}function respondWithFilteredResult(_0xe920d5,_0x1f7759){return function(_0x1536fa){if(_0x1536fa){var _0x5a099d=typeof _0x1f7759[_0xbbad('0x18')]===_0xbbad('0x19')&&typeof _0x1f7759[_0xbbad('0x1a')]===_0xbbad('0x19');var _0x51fd3c=_0x1536fa[_0xbbad('0x1b')];var _0x35ee0b=_0x5a099d?0x0:_0x1f7759[_0xbbad('0x18')];var _0x1a6f94=_0x5a099d?_0x1536fa[_0xbbad('0x1b')]:_0x1f7759[_0xbbad('0x18')]+_0x1f7759['limit'];var _0x30978c;if(_0x1a6f94>=_0x51fd3c){_0x1a6f94=_0x51fd3c;_0x30978c=0xc8;}else{_0x30978c=0xce;}_0xe920d5[_0xbbad('0x1c')](_0x30978c);return _0xe920d5['set'](_0xbbad('0x1d'),_0x35ee0b+'-'+_0x1a6f94+'/'+_0x51fd3c)[_0xbbad('0x1e')](_0x1536fa);}return null;};}function patchUpdates(_0x30ccd6){return function(_0x14d4a0){try{jsonpatch[_0xbbad('0x1f')](_0x14d4a0,_0x30ccd6,!![]);}catch(_0x37bfcf){return BPromise[_0xbbad('0x20')](_0x37bfcf);}return _0x14d4a0[_0xbbad('0x21')]();};}function saveUpdates(_0x2c436f,_0x13adbb){return function(_0x4056c7){if(_0x4056c7){return _0x4056c7[_0xbbad('0x22')](_0x2c436f)[_0xbbad('0x23')](function(_0x30576f){return _0x30576f;});}return null;};}function removeEntity(_0x3a8bbc,_0x29eb21){return function(_0x40716f){if(_0x40716f){return _0x40716f['destroy']()[_0xbbad('0x23')](function(){var _0x1a3717=_0x40716f[_0xbbad('0x24')]({'plain':!![]});var _0x5cd3f9=_0xbbad('0x25');return db[_0xbbad('0x26')]['destroy']({'where':{'type':_0x5cd3f9,'resourceId':_0x1a3717['id']}})[_0xbbad('0x23')](function(){return _0x40716f;});})[_0xbbad('0x23')](function(){_0x3a8bbc[_0xbbad('0x1c')](0xcc)[_0xbbad('0x27')]();});}};}function handleEntityNotFound(_0x431aba,_0x1e6e6b){return function(_0x1958e4){if(!_0x1958e4){_0x431aba[_0xbbad('0x17')](0x194);}return _0x1958e4;};}function handleError(_0xf4ad71,_0xd7a501){_0xd7a501=_0xd7a501||0x1f4;return function(_0x132def){logger[_0xbbad('0x28')](_0x132def[_0xbbad('0x29')]);if(_0x132def[_0xbbad('0x2a')]){delete _0x132def[_0xbbad('0x2a')];}_0xf4ad71[_0xbbad('0x1c')](_0xd7a501)['send'](_0x132def);};}exports[_0xbbad('0x2b')]=function(_0x27db72,_0x37d187){var _0x11cbe7={},_0x1597a0={},_0x541c9f={'count':0x0,'rows':[]};var _0x2c2956=_[_0xbbad('0x2c')](db['AnalyticExtractedReport'][_0xbbad('0x2d')],function(_0x48fb00){return{'name':_0x48fb00[_0xbbad('0x2e')],'type':_0x48fb00['type'][_0xbbad('0x2f')]};});_0x1597a0['model']=_[_0xbbad('0x2c')](_0x2c2956,'name');_0x1597a0[_0xbbad('0x30')]=_['keys'](_0x27db72[_0xbbad('0x30')]);_0x1597a0[_0xbbad('0x31')]=_[_0xbbad('0x32')](_0x1597a0[_0xbbad('0x33')],_0x1597a0[_0xbbad('0x30')]);_0x11cbe7[_0xbbad('0x34')]=_['intersection'](_0x1597a0[_0xbbad('0x33')],qs['fields'](_0x27db72['query'][_0xbbad('0x35')]));_0x11cbe7[_0xbbad('0x34')]=_0x11cbe7['attributes'][_0xbbad('0x36')]?_0x11cbe7[_0xbbad('0x34')]:_0x1597a0['model'];if(!_0x27db72[_0xbbad('0x30')][_0xbbad('0x37')]('nolimit')){_0x11cbe7[_0xbbad('0x1a')]=qs['limit'](_0x27db72[_0xbbad('0x30')][_0xbbad('0x1a')]);_0x11cbe7[_0xbbad('0x18')]=qs[_0xbbad('0x18')](_0x27db72['query']['offset']);}_0x11cbe7[_0xbbad('0x38')]=qs[_0xbbad('0x39')](_0x27db72[_0xbbad('0x30')][_0xbbad('0x39')]);_0x11cbe7[_0xbbad('0x3a')]=qs['filters'](_['pick'](_0x27db72[_0xbbad('0x30')],_0x1597a0['filters']),_0x2c2956);if(_0x27db72[_0xbbad('0x30')][_0xbbad('0x3b')]){_0x11cbe7[_0xbbad('0x3a')]=_['merge'](_0x11cbe7['where'],{'$or':_['map'](_0x2c2956,function(_0x46de10){if(_0x46de10[_0xbbad('0x3c')]!==_0xbbad('0x3d')){var _0x120d39={};_0x120d39[_0x46de10[_0xbbad('0x2a')]]={'$like':'%'+_0x27db72[_0xbbad('0x30')][_0xbbad('0x3b')]+'%'};return _0x120d39;}})});}_0x11cbe7=_[_0xbbad('0x3e')]({},_0x11cbe7,_0x27db72[_0xbbad('0x3f')]);var _0x3c6670={'where':_0x11cbe7['where']};return db[_0xbbad('0x40')]['count'](_0x3c6670)[_0xbbad('0x23')](function(_0x2964aa){_0x541c9f[_0xbbad('0x1b')]=_0x2964aa;if(_0x27db72[_0xbbad('0x30')]['includeAll']){_0x11cbe7[_0xbbad('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xbbad('0x42')](_0x11cbe7);})[_0xbbad('0x23')](function(_0x521619){_0x541c9f[_0xbbad('0x43')]=_0x521619;return _0x541c9f;})[_0xbbad('0x23')](respondWithFilteredResult(_0x37d187,_0x11cbe7))[_0xbbad('0x44')](handleError(_0x37d187,null));};exports['show']=function(_0x54a8c4,_0x1a6249){var _0x185bf9={'raw':!![],'where':{'id':_0x54a8c4['params']['id']}},_0x5dfb72={};_0x5dfb72[_0xbbad('0x33')]=_[_0xbbad('0x45')](db[_0xbbad('0x40')][_0xbbad('0x2d')]);_0x5dfb72[_0xbbad('0x30')]=_['keys'](_0x54a8c4['query']);_0x5dfb72['filters']=_[_0xbbad('0x32')](_0x5dfb72[_0xbbad('0x33')],_0x5dfb72['query']);_0x185bf9[_0xbbad('0x34')]=_['intersection'](_0x5dfb72[_0xbbad('0x33')],qs[_0xbbad('0x35')](_0x54a8c4[_0xbbad('0x30')][_0xbbad('0x35')]));_0x185bf9[_0xbbad('0x34')]=_0x185bf9[_0xbbad('0x34')][_0xbbad('0x36')]?_0x185bf9[_0xbbad('0x34')]:_0x5dfb72[_0xbbad('0x33')];if(_0x54a8c4[_0xbbad('0x30')]['includeAll']){_0x185bf9[_0xbbad('0x41')]=[{'all':!![]}];}_0x185bf9=_[_0xbbad('0x3e')]({},_0x185bf9,_0x54a8c4[_0xbbad('0x3f')]);return db['AnalyticExtractedReport'][_0xbbad('0x46')](_0x185bf9)[_0xbbad('0x23')](handleEntityNotFound(_0x1a6249,null))['then'](respondWithResult(_0x1a6249,null))['catch'](handleError(_0x1a6249,null));};exports[_0xbbad('0x47')]=function(_0x2da1dc,_0x5252bc){return db[_0xbbad('0x40')]['create'](_0x2da1dc[_0xbbad('0x48')],{})[_0xbbad('0x23')](function(_0x36bf25){var _0xf7c0a1=_0x2da1dc[_0xbbad('0x49')][_0xbbad('0x24')]({'plain':!![]});if(!_0xf7c0a1)throw new Error(_0xbbad('0x4a'));if(_0xf7c0a1[_0xbbad('0x4b')]===_0xbbad('0x49')){var _0x110301=_0x36bf25[_0xbbad('0x24')]({'plain':!![]});var _0x59f015='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x59f015,'userProfileId':_0xf7c0a1[_0xbbad('0x4c')]},'raw':!![]})[_0xbbad('0x23')](function(_0x7ec275){if(_0x7ec275&&_0x7ec275[_0xbbad('0x4d')]===0x0){return db[_0xbbad('0x26')][_0xbbad('0x47')]({'name':_0x110301[_0xbbad('0x2a')],'resourceId':_0x110301['id'],'type':_0x7ec275[_0xbbad('0x2a')],'sectionId':_0x7ec275['id']},{})[_0xbbad('0x23')](function(){return _0x36bf25;});}else{return _0x36bf25;}})[_0xbbad('0x44')](function(_0x37d151){logger[_0xbbad('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37d151);throw _0x37d151;});}return _0x36bf25;})[_0xbbad('0x23')](respondWithResult(_0x5252bc,0xc9))[_0xbbad('0x44')](handleError(_0x5252bc,null));};exports[_0xbbad('0x22')]=function(_0x308542,_0x39c7f9){if(_0x308542[_0xbbad('0x48')]['id']){delete _0x308542[_0xbbad('0x48')]['id'];}return db[_0xbbad('0x40')]['find']({'where':{'id':_0x308542[_0xbbad('0x4e')]['id']}})['then'](handleEntityNotFound(_0x39c7f9,null))[_0xbbad('0x23')](saveUpdates(_0x308542['body'],null))[_0xbbad('0x23')](respondWithResult(_0x39c7f9,null))[_0xbbad('0x44')](handleError(_0x39c7f9,null));};exports['destroy']=function(_0x540922,_0x55825a){return db[_0xbbad('0x40')]['find']({'where':{'id':_0x540922[_0xbbad('0x4e')]['id']}})[_0xbbad('0x23')](handleEntityNotFound(_0x55825a,null))[_0xbbad('0x23')](removeEntity(_0x55825a,null))[_0xbbad('0x44')](handleError(_0x55825a,null));};exports[_0xbbad('0x4f')]=function(_0x43c667,_0x280340,_0x293123){return db[_0xbbad('0x40')][_0xbbad('0x46')]({'where':{'id':_0x43c667[_0xbbad('0x4e')]['id']},'attributes':[_0xbbad('0x2a'),_0xbbad('0x50'),_0xbbad('0x51'),_0xbbad('0x52')],'raw':!![]})[_0xbbad('0x23')](handleEntityNotFound(_0x280340,null))[_0xbbad('0x23')](function(_0x5c8b28){if(_0x5c8b28){if(!fs[_0xbbad('0x53')](path[_0xbbad('0x54')](config[_0xbbad('0x55')],_0xbbad('0x56'),_0x5c8b28[_0xbbad('0x51')]))){throw new db['Sequelize'][(_0xbbad('0x57'))](_0xbbad('0x58'));}if(_0x43c667[_0xbbad('0x30')][_0xbbad('0x59')]){return _0x280340['sendStatus'](0xc8);}return _0x280340[_0xbbad('0x4f')](path['join'](config[_0xbbad('0x55')],_0xbbad('0x56'),_0x5c8b28[_0xbbad('0x51')]),util[_0xbbad('0x5a')](_0xbbad('0x5b'),_0x5c8b28[_0xbbad('0x50')]||_0x5c8b28[_0xbbad('0x2a')],_0x5c8b28[_0xbbad('0x52')]['toLowerCase']()));}})[_0xbbad('0x44')](handleError(_0x280340,null));}; \ No newline at end of file +var _0x7bcd=['sort','where','pick','filters','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','root','server/files/reports','savename','Sequelize','ValidationError','exists','join','format','%s.%s','toLowerCase','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','name','send','AnalyticExtractedReport','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit'];(function(_0x26307f,_0x28a0a4){var _0x50e950=function(_0x557639){while(--_0x557639){_0x26307f['push'](_0x26307f['shift']());}};_0x50e950(++_0x28a0a4);}(_0x7bcd,0xd8));var _0xd7bc=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x7bcd[_0x3b76f7];return _0x43984e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd7bc('0x1'));var rp=require('request-promise');var moment=require(_0xd7bc('0x2'));var BPromise=require(_0xd7bc('0x3'));var Mustache=require('mustache');var util=require(_0xd7bc('0x4'));var path=require(_0xd7bc('0x5'));var sox=require(_0xd7bc('0x6'));var csv=require(_0xd7bc('0x7'));var ejs=require(_0xd7bc('0x8'));var fs=require('fs');var fs_extra=require(_0xd7bc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd7bc('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd7bc('0xb'));var authService=require(_0xd7bc('0xc'));var qs=require(_0xd7bc('0xd'));var as=require(_0xd7bc('0xe'));var hardwareService=require(_0xd7bc('0xf'));var logger=require(_0xd7bc('0x10'))(_0xd7bc('0x11'));var utils=require(_0xd7bc('0x12'));var config=require(_0xd7bc('0x13'));var licenseUtil=require(_0xd7bc('0x14'));var db=require(_0xd7bc('0x15'))['db'];function respondWithStatusCode(_0x65209,_0x255b22){_0x255b22=_0x255b22||0xcc;return function(_0x361a71){if(_0x361a71){return _0x65209['sendStatus'](_0x255b22);}return _0x65209['status'](_0x255b22)['end']();};}function respondWithResult(_0x369653,_0x393ee6){_0x393ee6=_0x393ee6||0xc8;return function(_0x71434a){if(_0x71434a){return _0x369653[_0xd7bc('0x16')](_0x393ee6)[_0xd7bc('0x17')](_0x71434a);}};}function respondWithFilteredResult(_0x3503ee,_0x12438d){return function(_0x27fa86){if(_0x27fa86){var _0x430f70=typeof _0x12438d[_0xd7bc('0x18')]===_0xd7bc('0x19')&&typeof _0x12438d[_0xd7bc('0x1a')]==='undefined';var _0x8de1cc=_0x27fa86['count'];var _0x28f2ca=_0x430f70?0x0:_0x12438d[_0xd7bc('0x18')];var _0x239b72=_0x430f70?_0x27fa86[_0xd7bc('0x1b')]:_0x12438d[_0xd7bc('0x18')]+_0x12438d[_0xd7bc('0x1a')];var _0x4c7b7a;if(_0x239b72>=_0x8de1cc){_0x239b72=_0x8de1cc;_0x4c7b7a=0xc8;}else{_0x4c7b7a=0xce;}_0x3503ee[_0xd7bc('0x16')](_0x4c7b7a);return _0x3503ee[_0xd7bc('0x1c')]('Content-Range',_0x28f2ca+'-'+_0x239b72+'/'+_0x8de1cc)[_0xd7bc('0x17')](_0x27fa86);}return null;};}function patchUpdates(_0x3c624a){return function(_0x262278){try{jsonpatch[_0xd7bc('0x1d')](_0x262278,_0x3c624a,!![]);}catch(_0x436985){return BPromise[_0xd7bc('0x1e')](_0x436985);}return _0x262278[_0xd7bc('0x1f')]();};}function saveUpdates(_0x5cffed,_0x4f5942){return function(_0x3a0d2d){if(_0x3a0d2d){return _0x3a0d2d[_0xd7bc('0x20')](_0x5cffed)[_0xd7bc('0x21')](function(_0x3ff5e0){return _0x3ff5e0;});}return null;};}function removeEntity(_0x26858c,_0x4440eb){return function(_0x2bc508){if(_0x2bc508){return _0x2bc508[_0xd7bc('0x22')]()[_0xd7bc('0x21')](function(){var _0x5ae931=_0x2bc508[_0xd7bc('0x23')]({'plain':!![]});var _0x44fa03=_0xd7bc('0x24');return db[_0xd7bc('0x25')]['destroy']({'where':{'type':_0x44fa03,'resourceId':_0x5ae931['id']}})[_0xd7bc('0x21')](function(){return _0x2bc508;});})[_0xd7bc('0x21')](function(){_0x26858c[_0xd7bc('0x16')](0xcc)[_0xd7bc('0x26')]();});}};}function handleEntityNotFound(_0x1909d6,_0x2585f7){return function(_0x2394fb){if(!_0x2394fb){_0x1909d6[_0xd7bc('0x27')](0x194);}return _0x2394fb;};}function handleError(_0x3d5440,_0x421795){_0x421795=_0x421795||0x1f4;return function(_0x5db73a){logger[_0xd7bc('0x28')](_0x5db73a['stack']);if(_0x5db73a[_0xd7bc('0x29')]){delete _0x5db73a['name'];}_0x3d5440[_0xd7bc('0x16')](_0x421795)[_0xd7bc('0x2a')](_0x5db73a);};}exports['index']=function(_0x4ad6f1,_0x3bed7c){var _0xe85fd={},_0x50d50f={},_0x5702a6={'count':0x0,'rows':[]};var _0x28a07f=_['map'](db[_0xd7bc('0x2b')][_0xd7bc('0x2c')],function(_0x7eab7){return{'name':_0x7eab7[_0xd7bc('0x2d')],'type':_0x7eab7['type']['key']};});_0x50d50f[_0xd7bc('0x2e')]=_['map'](_0x28a07f,_0xd7bc('0x29'));_0x50d50f[_0xd7bc('0x2f')]=_[_0xd7bc('0x30')](_0x4ad6f1['query']);_0x50d50f['filters']=_[_0xd7bc('0x31')](_0x50d50f['model'],_0x50d50f[_0xd7bc('0x2f')]);_0xe85fd[_0xd7bc('0x32')]=_[_0xd7bc('0x31')](_0x50d50f[_0xd7bc('0x2e')],qs[_0xd7bc('0x33')](_0x4ad6f1['query']['fields']));_0xe85fd['attributes']=_0xe85fd[_0xd7bc('0x32')][_0xd7bc('0x34')]?_0xe85fd[_0xd7bc('0x32')]:_0x50d50f[_0xd7bc('0x2e')];if(!_0x4ad6f1[_0xd7bc('0x2f')]['hasOwnProperty'](_0xd7bc('0x35'))){_0xe85fd[_0xd7bc('0x1a')]=qs[_0xd7bc('0x1a')](_0x4ad6f1['query'][_0xd7bc('0x1a')]);_0xe85fd[_0xd7bc('0x18')]=qs[_0xd7bc('0x18')](_0x4ad6f1['query'][_0xd7bc('0x18')]);}_0xe85fd['order']=qs['sort'](_0x4ad6f1[_0xd7bc('0x2f')][_0xd7bc('0x36')]);_0xe85fd[_0xd7bc('0x37')]=qs['filters'](_[_0xd7bc('0x38')](_0x4ad6f1[_0xd7bc('0x2f')],_0x50d50f[_0xd7bc('0x39')]),_0x28a07f);if(_0x4ad6f1['query'][_0xd7bc('0x3a')]){_0xe85fd[_0xd7bc('0x37')]=_[_0xd7bc('0x3b')](_0xe85fd[_0xd7bc('0x37')],{'$or':_[_0xd7bc('0x3c')](_0x28a07f,function(_0x414a50){if(_0x414a50['type']!==_0xd7bc('0x3d')){var _0x5819c4={};_0x5819c4[_0x414a50['name']]={'$like':'%'+_0x4ad6f1[_0xd7bc('0x2f')][_0xd7bc('0x3a')]+'%'};return _0x5819c4;}})});}_0xe85fd=_[_0xd7bc('0x3b')]({},_0xe85fd,_0x4ad6f1['options']);var _0x2ea762={'where':_0xe85fd[_0xd7bc('0x37')]};return db[_0xd7bc('0x2b')][_0xd7bc('0x1b')](_0x2ea762)[_0xd7bc('0x21')](function(_0x3d5bfb){_0x5702a6['count']=_0x3d5bfb;if(_0x4ad6f1[_0xd7bc('0x2f')][_0xd7bc('0x3e')]){_0xe85fd[_0xd7bc('0x3f')]=[{'all':!![]}];}return db[_0xd7bc('0x2b')][_0xd7bc('0x40')](_0xe85fd);})['then'](function(_0x324873){_0x5702a6[_0xd7bc('0x41')]=_0x324873;return _0x5702a6;})[_0xd7bc('0x21')](respondWithFilteredResult(_0x3bed7c,_0xe85fd))[_0xd7bc('0x42')](handleError(_0x3bed7c,null));};exports[_0xd7bc('0x43')]=function(_0x47570b,_0x1914fb){var _0x1dce8c={'raw':!![],'where':{'id':_0x47570b[_0xd7bc('0x44')]['id']}},_0x462eb2={};_0x462eb2[_0xd7bc('0x2e')]=_[_0xd7bc('0x30')](db['AnalyticExtractedReport'][_0xd7bc('0x2c')]);_0x462eb2[_0xd7bc('0x2f')]=_[_0xd7bc('0x30')](_0x47570b['query']);_0x462eb2[_0xd7bc('0x39')]=_['intersection'](_0x462eb2['model'],_0x462eb2[_0xd7bc('0x2f')]);_0x1dce8c[_0xd7bc('0x32')]=_[_0xd7bc('0x31')](_0x462eb2[_0xd7bc('0x2e')],qs[_0xd7bc('0x33')](_0x47570b['query'][_0xd7bc('0x33')]));_0x1dce8c[_0xd7bc('0x32')]=_0x1dce8c[_0xd7bc('0x32')][_0xd7bc('0x34')]?_0x1dce8c[_0xd7bc('0x32')]:_0x462eb2[_0xd7bc('0x2e')];if(_0x47570b['query'][_0xd7bc('0x3e')]){_0x1dce8c[_0xd7bc('0x3f')]=[{'all':!![]}];}_0x1dce8c=_[_0xd7bc('0x3b')]({},_0x1dce8c,_0x47570b[_0xd7bc('0x45')]);return db[_0xd7bc('0x2b')][_0xd7bc('0x46')](_0x1dce8c)[_0xd7bc('0x21')](handleEntityNotFound(_0x1914fb,null))[_0xd7bc('0x21')](respondWithResult(_0x1914fb,null))[_0xd7bc('0x42')](handleError(_0x1914fb,null));};exports['create']=function(_0x4b44a6,_0x3d6160){return db[_0xd7bc('0x2b')][_0xd7bc('0x47')](_0x4b44a6[_0xd7bc('0x48')],{})[_0xd7bc('0x21')](function(_0x58167a){var _0x5e06a1=_0x4b44a6['user'][_0xd7bc('0x23')]({'plain':!![]});if(!_0x5e06a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e06a1['role']===_0xd7bc('0x49')){var _0x5c5c82=_0x58167a[_0xd7bc('0x23')]({'plain':!![]});var _0x204e3a=_0xd7bc('0x24');return db[_0xd7bc('0x4a')][_0xd7bc('0x46')]({'where':{'name':_0x204e3a,'userProfileId':_0x5e06a1['userProfileId']},'raw':!![]})['then'](function(_0x4145fd){if(_0x4145fd&&_0x4145fd[_0xd7bc('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c5c82['name'],'resourceId':_0x5c5c82['id'],'type':_0x4145fd[_0xd7bc('0x29')],'sectionId':_0x4145fd['id']},{})[_0xd7bc('0x21')](function(){return _0x58167a;});}else{return _0x58167a;}})['catch'](function(_0x48fd4a){logger[_0xd7bc('0x28')](_0xd7bc('0x4c'),_0x48fd4a);throw _0x48fd4a;});}return _0x58167a;})[_0xd7bc('0x21')](respondWithResult(_0x3d6160,0xc9))[_0xd7bc('0x42')](handleError(_0x3d6160,null));};exports[_0xd7bc('0x20')]=function(_0x1740e2,_0x4a1931){if(_0x1740e2['body']['id']){delete _0x1740e2[_0xd7bc('0x48')]['id'];}return db['AnalyticExtractedReport'][_0xd7bc('0x46')]({'where':{'id':_0x1740e2[_0xd7bc('0x44')]['id']}})[_0xd7bc('0x21')](handleEntityNotFound(_0x4a1931,null))[_0xd7bc('0x21')](saveUpdates(_0x1740e2[_0xd7bc('0x48')],null))[_0xd7bc('0x21')](respondWithResult(_0x4a1931,null))[_0xd7bc('0x42')](handleError(_0x4a1931,null));};exports[_0xd7bc('0x22')]=function(_0x5f07a4,_0x30b921){return db[_0xd7bc('0x2b')][_0xd7bc('0x46')]({'where':{'id':_0x5f07a4['params']['id']}})[_0xd7bc('0x21')](handleEntityNotFound(_0x30b921,null))[_0xd7bc('0x21')](removeEntity(_0x30b921,null))[_0xd7bc('0x42')](handleError(_0x30b921,null));};exports[_0xd7bc('0x4d')]=function(_0xb5c89e,_0x52afae,_0x373bb5){return db[_0xd7bc('0x2b')][_0xd7bc('0x46')]({'where':{'id':_0xb5c89e[_0xd7bc('0x44')]['id']},'attributes':[_0xd7bc('0x29'),_0xd7bc('0x4e'),'savename',_0xd7bc('0x4f')],'raw':!![]})[_0xd7bc('0x21')](handleEntityNotFound(_0x52afae,null))[_0xd7bc('0x21')](function(_0x59f4e4){if(_0x59f4e4){if(!fs['existsSync'](path['join'](config[_0xd7bc('0x50')],_0xd7bc('0x51'),_0x59f4e4[_0xd7bc('0x52')]))){throw new db[(_0xd7bc('0x53'))][(_0xd7bc('0x54'))]('Report\x20not\x20found\x20or\x20empty');}if(_0xb5c89e['query'][_0xd7bc('0x55')]){return _0x52afae[_0xd7bc('0x27')](0xc8);}return _0x52afae['download'](path[_0xd7bc('0x56')](config['root'],_0xd7bc('0x51'),_0x59f4e4[_0xd7bc('0x52')]),util[_0xd7bc('0x57')](_0xd7bc('0x58'),_0x59f4e4['basename']||_0x59f4e4[_0xd7bc('0x29')],_0x59f4e4['output'][_0xd7bc('0x59')]()));}})[_0xd7bc('0x42')](handleError(_0x52afae,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 4ecedc0..44a70e1 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 _0xc04d=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1315cb,_0x14ed5f){var _0x30f6df=function(_0x16d9fa){while(--_0x16d9fa){_0x1315cb['push'](_0x1315cb['shift']());}};_0x30f6df(++_0x14ed5f);}(_0xc04d,0x1d1));var _0xdc04=function(_0x4a4d88,_0x2be95a){_0x4a4d88=_0x4a4d88-0x0;var _0x479329=_0xc04d[_0x4a4d88];return _0x479329;};'use strict';var _=require(_0xdc04('0x0'));var util=require('util');var logger=require(_0xdc04('0x1'))(_0xdc04('0x2'));var moment=require('moment');var BPromise=require(_0xdc04('0x3'));var rp=require(_0xdc04('0x4'));var fs=require('fs');var path=require(_0xdc04('0x5'));var rimraf=require(_0xdc04('0x6'));var config=require(_0xdc04('0x7'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x6401b8,_0x3cd840){return _0x6401b8[_0xdc04('0x8')](_0xdc04('0x9'),attributes,{'tableName':_0xdc04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e89=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x489646,_0x2fed71){var _0x45de80=function(_0x15b10e){while(--_0x15b10e){_0x489646['push'](_0x489646['shift']());}};_0x45de80(++_0x2fed71);}(_0x5e89,0xc8));var _0x95e8=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5e89[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x95e8('0x0'));var util=require(_0x95e8('0x1'));var logger=require(_0x95e8('0x2'))(_0x95e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x95e8('0x4'));var fs=require('fs');var path=require(_0x95e8('0x5'));var rimraf=require(_0x95e8('0x6'));var config=require('../../config/environment');var attributes=require(_0x95e8('0x7'));module['exports']=function(_0x577578,_0x1930a6){return _0x577578[_0x95e8('0x8')](_0x95e8('0x9'),attributes,{'tableName':'analytics_extracted_reports','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 76637e7..cda3074 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 _0xbfba=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug'];(function(_0x82e71a,_0x2f5f68){var _0x34a5d4=function(_0x5eaec6){while(--_0x5eaec6){_0x82e71a['push'](_0x82e71a['shift']());}};_0x34a5d4(++_0x2f5f68);}(_0xbfba,0x1ac));var _0xabfb=function(_0x5ee08e,_0x19127){_0x5ee08e=_0x5ee08e-0x0;var _0x12ce20=_0xbfba[_0x5ee08e];return _0x12ce20;};'use strict';var _=require(_0xabfb('0x0'));var util=require(_0xabfb('0x1'));var moment=require(_0xabfb('0x2'));var BPromise=require(_0xabfb('0x3'));var rs=require(_0xabfb('0x4'));var fs=require('fs');var Redis=require(_0xabfb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xabfb('0x6'));var logger=require('../../config/logger')(_0xabfb('0x7'));var config=require(_0xabfb('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aed1e,_0x1f992a,_0x3af781){return new BPromise(function(_0x1d5320,_0x3e2904){return client[_0xabfb('0x9')](_0x5aed1e,_0x3af781)['then'](function(_0x42d549){logger[_0xabfb('0xa')](_0xabfb('0xb'),_0x1f992a,'request\x20sent');logger[_0xabfb('0xc')](_0xabfb('0xd'),_0x1f992a,_0xabfb('0xe'),JSON[_0xabfb('0xf')](_0x42d549));if(_0x42d549['error']){if(_0x42d549[_0xabfb('0x10')][_0xabfb('0x11')]===0x1f4){logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);return _0x3e2904(_0x42d549[_0xabfb('0x10')]['message']);}logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549['error'][_0xabfb('0x12')]);return _0x1d5320(_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);}else{logger['info'](_0xabfb('0xb'),_0x1f992a,_0xabfb('0xe'));_0x1d5320(_0x42d549[_0xabfb('0x13')][_0xabfb('0x12')]);}})[_0xabfb('0x14')](function(_0x327708){logger[_0xabfb('0x10')](_0xabfb('0xb'),_0x1f992a,_0x327708);_0x3e2904(_0x327708);});});} \ No newline at end of file +var _0xf969=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0xf969,0x1ca));var _0x9f96=function(_0x4defd4,_0x368412){_0x4defd4=_0x4defd4-0x0;var _0x1cbe41=_0xf969[_0x4defd4];return _0x1cbe41;};'use strict';var _=require(_0x9f96('0x0'));var util=require('util');var moment=require(_0x9f96('0x1'));var BPromise=require(_0x9f96('0x2'));var rs=require(_0x9f96('0x3'));var fs=require('fs');var Redis=require(_0x9f96('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f96('0x5'));var logger=require(_0x9f96('0x6'))('rpc');var config=require(_0x9f96('0x7'));var jayson=require(_0x9f96('0x8'));var client=jayson['client'][_0x9f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8b6f,_0x107a92,_0x4a410b){return new BPromise(function(_0x35ea7a,_0x377c6e){return client[_0x9f96('0xa')](_0x1d8b6f,_0x4a410b)[_0x9f96('0xb')](function(_0x5f5ce){logger[_0x9f96('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x107a92,_0x9f96('0xd'));logger[_0x9f96('0xe')](_0x9f96('0xf'),_0x107a92,_0x9f96('0xd'),JSON[_0x9f96('0x10')](_0x5f5ce));if(_0x5f5ce[_0x9f96('0x11')]){if(_0x5f5ce[_0x9f96('0x11')][_0x9f96('0x12')]===0x1f4){logger[_0x9f96('0x11')](_0x9f96('0x13'),_0x107a92,_0x5f5ce['error']['message']);return _0x377c6e(_0x5f5ce[_0x9f96('0x11')][_0x9f96('0x14')]);}logger[_0x9f96('0x11')](_0x9f96('0x13'),_0x107a92,_0x5f5ce[_0x9f96('0x11')]['message']);return _0x35ea7a(_0x5f5ce[_0x9f96('0x11')]['message']);}else{logger[_0x9f96('0xc')](_0x9f96('0x13'),_0x107a92,_0x9f96('0xd'));_0x35ea7a(_0x5f5ce[_0x9f96('0x15')]['message']);}})[_0x9f96('0x16')](function(_0x2b34f0){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x107a92,_0x2b34f0);_0x377c6e(_0x2b34f0);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index a209ec7..e2b4317 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 _0x14f2=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create'];(function(_0xa38a2f,_0x3c15a8){var _0x5cf5b3=function(_0x2064ca){while(--_0x2064ca){_0xa38a2f['push'](_0xa38a2f['shift']());}};_0x5cf5b3(++_0x3c15a8);}(_0x14f2,0x130));var _0x214f=function(_0x53e6ca,_0x579281){_0x53e6ca=_0x53e6ca-0x0;var _0x53bb15=_0x14f2[_0x53e6ca];return _0x53bb15;};'use strict';var multer=require('multer');var util=require(_0x214f('0x0'));var path=require(_0x214f('0x1'));var timeout=require(_0x214f('0x2'));var express=require(_0x214f('0x3'));var router=express[_0x214f('0x4')]();var fs_extra=require(_0x214f('0x5'));var auth=require(_0x214f('0x6'));var interaction=require(_0x214f('0x7'));var config=require('../../config/environment');var controller=require(_0x214f('0x8'));router[_0x214f('0x9')]('/',auth[_0x214f('0xa')](),controller[_0x214f('0xb')]);router['get'](_0x214f('0xc'),auth[_0x214f('0xa')](),controller[_0x214f('0xd')]);router['get'](_0x214f('0xe'),auth[_0x214f('0xa')](),controller[_0x214f('0xf')]);router[_0x214f('0x10')]('/',auth[_0x214f('0xa')](),controller[_0x214f('0x11')]);router[_0x214f('0x12')](_0x214f('0xc'),auth[_0x214f('0xa')](),controller[_0x214f('0x13')]);router[_0x214f('0x14')]('/:id',auth[_0x214f('0xa')](),controller[_0x214f('0x15')]);module[_0x214f('0x16')]=router; \ No newline at end of file +var _0xbf06=['download','post','create','put','update','delete','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','show','/:id/download','isAuthenticated'];(function(_0x4e0cc9,_0x1149ef){var _0x1925ee=function(_0x2173cb){while(--_0x2173cb){_0x4e0cc9['push'](_0x4e0cc9['shift']());}};_0x1925ee(++_0x1149ef);}(_0xbf06,0x9f));var _0x6bf0=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xbf06[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x6bf0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6bf0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6bf0('0x2'));var auth=require(_0x6bf0('0x3'));var interaction=require(_0x6bf0('0x4'));var config=require(_0x6bf0('0x5'));var controller=require(_0x6bf0('0x6'));router[_0x6bf0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6bf0('0x8'),auth['isAuthenticated'](),controller[_0x6bf0('0x9')]);router[_0x6bf0('0x7')](_0x6bf0('0xa'),auth[_0x6bf0('0xb')](),controller[_0x6bf0('0xc')]);router[_0x6bf0('0xd')]('/',auth[_0x6bf0('0xb')](),controller[_0x6bf0('0xe')]);router[_0x6bf0('0xf')](_0x6bf0('0x8'),auth['isAuthenticated'](),controller[_0x6bf0('0x10')]);router[_0x6bf0('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6bf0('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 2f7e9ff..19d1458 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 _0x8b5c=['STRING','BOOLEAN','exports','TEXT'];(function(_0x3f7b63,_0x570f89){var _0x42f648=function(_0x50b5d1){while(--_0x50b5d1){_0x3f7b63['push'](_0x3f7b63['shift']());}};_0x42f648(++_0x570f89);}(_0x8b5c,0xde));var _0xc8b5=function(_0x5347c8,_0x55f10b){_0x5347c8=_0x5347c8-0x0;var _0x5440c2=_0x8b5c[_0x5347c8];return _0x5440c2;};'use strict';var Sequelize=require('sequelize');module[_0xc8b5('0x0')]={'field':{'type':Sequelize[_0xc8b5('0x1')]},'alias':{'type':Sequelize[_0xc8b5('0x2')]},'function':{'type':Sequelize[_0xc8b5('0x2')]},'format':{'type':Sequelize[_0xc8b5('0x2')]},'groupBy':{'type':Sequelize[_0xc8b5('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc8b5('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xafbd=['STRING','BOOLEAN','exports'];(function(_0x589743,_0x604ac1){var _0x41ac38=function(_0x539303){while(--_0x539303){_0x589743['push'](_0x589743['shift']());}};_0x41ac38(++_0x604ac1);}(_0xafbd,0x9e));var _0xdafb=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xafbd[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require('sequelize');module[_0xdafb('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdafb('0x1')]},'function':{'type':Sequelize[_0xdafb('0x1')]},'format':{'type':Sequelize[_0xdafb('0x1')]},'groupBy':{'type':Sequelize[_0xdafb('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdafb('0x1')]},'custom':{'type':Sequelize[_0xdafb('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 2b9032c..8a44fc1 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 _0xd433=['include','find','create','body','bulkCreate','params','addFields','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','count','includeAll','findAll','catch','AnalyticFieldReport'];(function(_0x56058a,_0x1bf6bb){var _0x43eb1b=function(_0x571532){while(--_0x571532){_0x56058a['push'](_0x56058a['shift']());}};_0x43eb1b(++_0x1bf6bb);}(_0xd433,0xf7));var _0x3d43=function(_0x18978a,_0x230acf){_0x18978a=_0x18978a-0x0;var _0x3dc130=_0xd433[_0x18978a];return _0x3dc130;};'use strict';var emlformat=require(_0x3d43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d43('0x1'));var jsonpatch=require(_0x3d43('0x2'));var rp=require(_0x3d43('0x3'));var moment=require(_0x3d43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d43('0x5'));var util=require(_0x3d43('0x6'));var path=require(_0x3d43('0x7'));var sox=require(_0x3d43('0x8'));var csv=require(_0x3d43('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d43('0xa'));var squel=require('squel');var crypto=require(_0x3d43('0xb'));var jsforce=require(_0x3d43('0xc'));var deskjs=require(_0x3d43('0xd'));var toCsv=require(_0x3d43('0x9'));var querystring=require(_0x3d43('0xe'));var Papa=require(_0x3d43('0xf'));var Redis=require(_0x3d43('0x10'));var authService=require(_0x3d43('0x11'));var qs=require(_0x3d43('0x12'));var as=require(_0x3d43('0x13'));var hardwareService=require(_0x3d43('0x14'));var logger=require(_0x3d43('0x15'))('api');var utils=require(_0x3d43('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3d43('0x17'))['db'];function respondWithStatusCode(_0x56510f,_0x49bf5b){_0x49bf5b=_0x49bf5b||0xcc;return function(_0x257a66){if(_0x257a66){return _0x56510f['sendStatus'](_0x49bf5b);}return _0x56510f[_0x3d43('0x18')](_0x49bf5b)[_0x3d43('0x19')]();};}function respondWithResult(_0x1665fc,_0x33f05f){_0x33f05f=_0x33f05f||0xc8;return function(_0x2e774d){if(_0x2e774d){return _0x1665fc[_0x3d43('0x18')](_0x33f05f)[_0x3d43('0x1a')](_0x2e774d);}};}function respondWithFilteredResult(_0x440094,_0x114663){return function(_0x2921c2){if(_0x2921c2){var _0x517d0a=typeof _0x114663[_0x3d43('0x1b')]==='undefined'&&typeof _0x114663[_0x3d43('0x1c')]===_0x3d43('0x1d');var _0x17d349=_0x2921c2['count'];var _0x4fd3ac=_0x517d0a?0x0:_0x114663[_0x3d43('0x1b')];var _0x1bddb7=_0x517d0a?_0x2921c2['count']:_0x114663[_0x3d43('0x1b')]+_0x114663[_0x3d43('0x1c')];var _0x15d6f9;if(_0x1bddb7>=_0x17d349){_0x1bddb7=_0x17d349;_0x15d6f9=0xc8;}else{_0x15d6f9=0xce;}_0x440094[_0x3d43('0x18')](_0x15d6f9);return _0x440094[_0x3d43('0x1e')]('Content-Range',_0x4fd3ac+'-'+_0x1bddb7+'/'+_0x17d349)[_0x3d43('0x1a')](_0x2921c2);}return null;};}function patchUpdates(_0x261b23){return function(_0x2622a6){try{jsonpatch[_0x3d43('0x1f')](_0x2622a6,_0x261b23,!![]);}catch(_0x24004e){return BPromise[_0x3d43('0x20')](_0x24004e);}return _0x2622a6[_0x3d43('0x21')]();};}function saveUpdates(_0x50c27b,_0x5af74d){return function(_0x28f8f8){if(_0x28f8f8){return _0x28f8f8[_0x3d43('0x22')](_0x50c27b)[_0x3d43('0x23')](function(_0x4767e9){return _0x4767e9;});}return null;};}function removeEntity(_0x5b5a7c,_0x485419){return function(_0x2f15d7){if(_0x2f15d7){return _0x2f15d7[_0x3d43('0x24')]()[_0x3d43('0x23')](function(){_0x5b5a7c['status'](0xcc)[_0x3d43('0x19')]();});}};}function handleEntityNotFound(_0x4c79a9,_0x1d5be7){return function(_0x438399){if(!_0x438399){_0x4c79a9[_0x3d43('0x25')](0x194);}return _0x438399;};}function handleError(_0x1084ad,_0x7d672){_0x7d672=_0x7d672||0x1f4;return function(_0x5a8f77){logger[_0x3d43('0x26')](_0x5a8f77[_0x3d43('0x27')]);if(_0x5a8f77[_0x3d43('0x28')]){delete _0x5a8f77[_0x3d43('0x28')];}_0x1084ad['status'](_0x7d672)[_0x3d43('0x29')](_0x5a8f77);};}exports[_0x3d43('0x2a')]=function(_0x44bea7,_0x43e223){var _0xde0f62={},_0x47852b={},_0x9fb5ff={'count':0x0,'rows':[]};var _0x5e11ea=_[_0x3d43('0x2b')](db['AnalyticFieldReport'][_0x3d43('0x2c')],function(_0x55be06){return{'name':_0x55be06[_0x3d43('0x2d')],'type':_0x55be06['type'][_0x3d43('0x2e')]};});_0x47852b[_0x3d43('0x2f')]=_[_0x3d43('0x2b')](_0x5e11ea,_0x3d43('0x28'));_0x47852b['query']=_[_0x3d43('0x30')](_0x44bea7[_0x3d43('0x31')]);_0x47852b['filters']=_['intersection'](_0x47852b['model'],_0x47852b['query']);_0xde0f62['attributes']=_[_0x3d43('0x32')](_0x47852b[_0x3d43('0x2f')],qs[_0x3d43('0x33')](_0x44bea7[_0x3d43('0x31')]['fields']));_0xde0f62['attributes']=_0xde0f62[_0x3d43('0x34')][_0x3d43('0x35')]?_0xde0f62[_0x3d43('0x34')]:_0x47852b[_0x3d43('0x2f')];if(!_0x44bea7[_0x3d43('0x31')][_0x3d43('0x36')](_0x3d43('0x37'))){_0xde0f62[_0x3d43('0x1c')]=qs[_0x3d43('0x1c')](_0x44bea7['query'][_0x3d43('0x1c')]);_0xde0f62[_0x3d43('0x1b')]=qs['offset'](_0x44bea7['query'][_0x3d43('0x1b')]);}_0xde0f62[_0x3d43('0x38')]=qs[_0x3d43('0x39')](_0x44bea7[_0x3d43('0x31')][_0x3d43('0x39')]);_0xde0f62[_0x3d43('0x3a')]=qs[_0x3d43('0x3b')](_[_0x3d43('0x3c')](_0x44bea7['query'],_0x47852b[_0x3d43('0x3b')]),_0x5e11ea);if(_0x44bea7[_0x3d43('0x31')][_0x3d43('0x3d')]){_0xde0f62['where']=_['merge'](_0xde0f62['where'],{'$or':_[_0x3d43('0x2b')](_0x5e11ea,function(_0x5f4774){if(_0x5f4774[_0x3d43('0x3e')]!==_0x3d43('0x3f')){var _0x10783d={};_0x10783d[_0x5f4774[_0x3d43('0x28')]]={'$like':'%'+_0x44bea7[_0x3d43('0x31')]['filter']+'%'};return _0x10783d;}})});}_0xde0f62=_['merge']({},_0xde0f62,_0x44bea7['options']);var _0x9ed10b={'where':_0xde0f62[_0x3d43('0x3a')]};return db['AnalyticFieldReport'][_0x3d43('0x40')](_0x9ed10b)[_0x3d43('0x23')](function(_0x40b2b1){_0x9fb5ff['count']=_0x40b2b1;if(_0x44bea7[_0x3d43('0x31')][_0x3d43('0x41')]){_0xde0f62['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3d43('0x42')](_0xde0f62);})['then'](function(_0x29018b){_0x9fb5ff['rows']=_0x29018b;return _0x9fb5ff;})[_0x3d43('0x23')](respondWithFilteredResult(_0x43e223,_0xde0f62))[_0x3d43('0x43')](handleError(_0x43e223,null));};exports['show']=function(_0x1c602a,_0x1a675f){var _0x241b07={'raw':![],'where':{'id':_0x1c602a['params']['id']}},_0x13906b={};_0x13906b['model']=_['keys'](db[_0x3d43('0x44')][_0x3d43('0x2c')]);_0x13906b['query']=_[_0x3d43('0x30')](_0x1c602a[_0x3d43('0x31')]);_0x13906b['filters']=_[_0x3d43('0x32')](_0x13906b[_0x3d43('0x2f')],_0x13906b[_0x3d43('0x31')]);_0x241b07[_0x3d43('0x34')]=_['intersection'](_0x13906b[_0x3d43('0x2f')],qs[_0x3d43('0x33')](_0x1c602a['query'][_0x3d43('0x33')]));_0x241b07[_0x3d43('0x34')]=_0x241b07[_0x3d43('0x34')][_0x3d43('0x35')]?_0x241b07[_0x3d43('0x34')]:_0x13906b['model'];if(_0x1c602a[_0x3d43('0x31')]['includeAll']){_0x241b07[_0x3d43('0x45')]=[{'all':!![]}];}_0x241b07=_['merge']({},_0x241b07,_0x1c602a['options']);return db['AnalyticFieldReport'][_0x3d43('0x46')](_0x241b07)[_0x3d43('0x23')](handleEntityNotFound(_0x1a675f,null))[_0x3d43('0x23')](respondWithResult(_0x1a675f,null))['catch'](handleError(_0x1a675f,null));};exports[_0x3d43('0x47')]=function(_0x2f8ea1,_0x71fd2){return db[_0x3d43('0x44')][_0x3d43('0x47')](_0x2f8ea1[_0x3d43('0x48')],{})[_0x3d43('0x23')](respondWithResult(_0x71fd2,0xc9))[_0x3d43('0x43')](handleError(_0x71fd2,null));};exports[_0x3d43('0x49')]=function(_0x5a98b4,_0x2a3258){return db['AnalyticFieldReport'][_0x3d43('0x49')](_0x5a98b4[_0x3d43('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2a3258,0xc9))[_0x3d43('0x43')](handleError(_0x2a3258,null));};exports[_0x3d43('0x22')]=function(_0x20fb5f,_0x111f98){if(_0x20fb5f['body']['id']){delete _0x20fb5f[_0x3d43('0x48')]['id'];}return db[_0x3d43('0x44')][_0x3d43('0x46')]({'where':{'id':_0x20fb5f[_0x3d43('0x4a')]['id']}})[_0x3d43('0x23')](handleEntityNotFound(_0x111f98,null))['then'](saveUpdates(_0x20fb5f[_0x3d43('0x48')],null))[_0x3d43('0x23')](respondWithResult(_0x111f98,null))[_0x3d43('0x43')](handleError(_0x111f98,null));};exports[_0x3d43('0x24')]=function(_0x563448,_0x1765bc){return db[_0x3d43('0x44')][_0x3d43('0x46')]({'where':{'id':_0x563448['params']['id']}})[_0x3d43('0x23')](handleEntityNotFound(_0x1765bc,null))['then'](removeEntity(_0x1765bc,null))[_0x3d43('0x43')](handleError(_0x1765bc,null));};exports['bulkDestroy']=function(_0x76da55,_0x450b51){return db['AnalyticFieldReport'][_0x3d43('0x24')]({'where':{'id':_0x76da55['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3d43('0x23')](respondWithResult(_0x450b51,0xcc))[_0x3d43('0x43')](handleError(_0x450b51,null));};exports[_0x3d43('0x4b')]=function(_0x2a5886,_0x37ccde,_0x5e19f7){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x2a5886[_0x3d43('0x4a')]['id']}})[_0x3d43('0x23')](handleEntityNotFound(_0x37ccde,null))[_0x3d43('0x23')](function(_0x50d032){if(_0x50d032){return db[_0x3d43('0x4c')][_0x3d43('0x4d')](function(_0x2980ed){return db[_0x3d43('0x44')]['destroy']({'where':{'CustomReportId':_0x2a5886[_0x3d43('0x4a')]['id']},'transaction':_0x2980ed})[_0x3d43('0x23')](function(_0x35ca0c){var _0x1debcd=_[_0x3d43('0x2b')](_0x2a5886['body'],function(_0x5390ba){delete _0x5390ba['id'];_0x5390ba[_0x3d43('0x4e')]=_0x2a5886[_0x3d43('0x4a')]['id'];return _0x5390ba;});return db[_0x3d43('0x44')][_0x3d43('0x49')](_0x1debcd,{'transaction':_0x2980ed});});})[_0x3d43('0x23')](function(){return db[_0x3d43('0x44')]['findAll']({'where':{'CustomReportId':_0x2a5886[_0x3d43('0x4a')]['id']}});});}})[_0x3d43('0x23')](respondWithResult(_0x37ccde,null))['catch'](handleError(_0x37ccde,null));}; \ No newline at end of file +var _0xf2a1=['includeAll','body','bulkCreate','find','ids','AnalyticCustomReport','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes'];(function(_0x12a782,_0x3ce187){var _0x57b567=function(_0x5959e8){while(--_0x5959e8){_0x12a782['push'](_0x12a782['shift']());}};_0x57b567(++_0x3ce187);}(_0xf2a1,0x1dd));var _0x1f2a=function(_0x5c71bf,_0x501bfd){_0x5c71bf=_0x5c71bf-0x0;var _0x19b316=_0xf2a1[_0x5c71bf];return _0x19b316;};'use strict';var emlformat=require(_0x1f2a('0x0'));var rimraf=require(_0x1f2a('0x1'));var zipdir=require(_0x1f2a('0x2'));var jsonpatch=require(_0x1f2a('0x3'));var rp=require(_0x1f2a('0x4'));var moment=require(_0x1f2a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1f2a('0x6'));var util=require(_0x1f2a('0x7'));var path=require('path');var sox=require(_0x1f2a('0x8'));var csv=require(_0x1f2a('0x9'));var ejs=require(_0x1f2a('0xa'));var fs=require('fs');var fs_extra=require(_0x1f2a('0xb'));var _=require(_0x1f2a('0xc'));var squel=require(_0x1f2a('0xd'));var crypto=require(_0x1f2a('0xe'));var jsforce=require(_0x1f2a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f2a('0x10'));var Papa=require(_0x1f2a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f2a('0x12'));var as=require(_0x1f2a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f2a('0x14'))(_0x1f2a('0x15'));var utils=require('../../config/utils');var config=require(_0x1f2a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f2a('0x17'))['db'];function respondWithStatusCode(_0x2f6055,_0xd39ef8){_0xd39ef8=_0xd39ef8||0xcc;return function(_0x3eb8ee){if(_0x3eb8ee){return _0x2f6055[_0x1f2a('0x18')](_0xd39ef8);}return _0x2f6055[_0x1f2a('0x19')](_0xd39ef8)[_0x1f2a('0x1a')]();};}function respondWithResult(_0x15d716,_0x233e21){_0x233e21=_0x233e21||0xc8;return function(_0x3f7956){if(_0x3f7956){return _0x15d716['status'](_0x233e21)['json'](_0x3f7956);}};}function respondWithFilteredResult(_0x1fab8a,_0x408fbf){return function(_0x18b7ff){if(_0x18b7ff){var _0x3dcbc9=typeof _0x408fbf[_0x1f2a('0x1b')]===_0x1f2a('0x1c')&&typeof _0x408fbf[_0x1f2a('0x1d')]===_0x1f2a('0x1c');var _0x44ada5=_0x18b7ff[_0x1f2a('0x1e')];var _0x4a548f=_0x3dcbc9?0x0:_0x408fbf[_0x1f2a('0x1b')];var _0x4d6953=_0x3dcbc9?_0x18b7ff[_0x1f2a('0x1e')]:_0x408fbf[_0x1f2a('0x1b')]+_0x408fbf[_0x1f2a('0x1d')];var _0x523398;if(_0x4d6953>=_0x44ada5){_0x4d6953=_0x44ada5;_0x523398=0xc8;}else{_0x523398=0xce;}_0x1fab8a[_0x1f2a('0x19')](_0x523398);return _0x1fab8a[_0x1f2a('0x1f')](_0x1f2a('0x20'),_0x4a548f+'-'+_0x4d6953+'/'+_0x44ada5)['json'](_0x18b7ff);}return null;};}function patchUpdates(_0x466107){return function(_0x387399){try{jsonpatch[_0x1f2a('0x21')](_0x387399,_0x466107,!![]);}catch(_0x5b88ce){return BPromise[_0x1f2a('0x22')](_0x5b88ce);}return _0x387399['save']();};}function saveUpdates(_0x9a02ab,_0x55288c){return function(_0x886a74){if(_0x886a74){return _0x886a74[_0x1f2a('0x23')](_0x9a02ab)[_0x1f2a('0x24')](function(_0x1aebce){return _0x1aebce;});}return null;};}function removeEntity(_0x3a63a3,_0x340c5b){return function(_0x6489f0){if(_0x6489f0){return _0x6489f0[_0x1f2a('0x25')]()[_0x1f2a('0x24')](function(){_0x3a63a3['status'](0xcc)[_0x1f2a('0x1a')]();});}};}function handleEntityNotFound(_0x562724,_0x4aad69){return function(_0x129778){if(!_0x129778){_0x562724[_0x1f2a('0x18')](0x194);}return _0x129778;};}function handleError(_0x42c038,_0x1ed45f){_0x1ed45f=_0x1ed45f||0x1f4;return function(_0x38f8fb){logger[_0x1f2a('0x26')](_0x38f8fb[_0x1f2a('0x27')]);if(_0x38f8fb[_0x1f2a('0x28')]){delete _0x38f8fb[_0x1f2a('0x28')];}_0x42c038[_0x1f2a('0x19')](_0x1ed45f)[_0x1f2a('0x29')](_0x38f8fb);};}exports['index']=function(_0x1511f1,_0x528bb7){var _0x1af31f={},_0xcf4d27={},_0x28948d={'count':0x0,'rows':[]};var _0xf5a696=_[_0x1f2a('0x2a')](db[_0x1f2a('0x2b')]['rawAttributes'],function(_0x2eba74){return{'name':_0x2eba74[_0x1f2a('0x2c')],'type':_0x2eba74['type'][_0x1f2a('0x2d')]};});_0xcf4d27[_0x1f2a('0x2e')]=_[_0x1f2a('0x2a')](_0xf5a696,'name');_0xcf4d27[_0x1f2a('0x2f')]=_[_0x1f2a('0x30')](_0x1511f1[_0x1f2a('0x2f')]);_0xcf4d27[_0x1f2a('0x31')]=_[_0x1f2a('0x32')](_0xcf4d27[_0x1f2a('0x2e')],_0xcf4d27[_0x1f2a('0x2f')]);_0x1af31f[_0x1f2a('0x33')]=_['intersection'](_0xcf4d27[_0x1f2a('0x2e')],qs[_0x1f2a('0x34')](_0x1511f1[_0x1f2a('0x2f')]['fields']));_0x1af31f[_0x1f2a('0x33')]=_0x1af31f[_0x1f2a('0x33')][_0x1f2a('0x35')]?_0x1af31f[_0x1f2a('0x33')]:_0xcf4d27['model'];if(!_0x1511f1['query'][_0x1f2a('0x36')](_0x1f2a('0x37'))){_0x1af31f[_0x1f2a('0x1d')]=qs[_0x1f2a('0x1d')](_0x1511f1[_0x1f2a('0x2f')][_0x1f2a('0x1d')]);_0x1af31f[_0x1f2a('0x1b')]=qs[_0x1f2a('0x1b')](_0x1511f1[_0x1f2a('0x2f')][_0x1f2a('0x1b')]);}_0x1af31f[_0x1f2a('0x38')]=qs[_0x1f2a('0x39')](_0x1511f1[_0x1f2a('0x2f')]['sort']);_0x1af31f[_0x1f2a('0x3a')]=qs[_0x1f2a('0x31')](_['pick'](_0x1511f1[_0x1f2a('0x2f')],_0xcf4d27['filters']),_0xf5a696);if(_0x1511f1[_0x1f2a('0x2f')][_0x1f2a('0x3b')]){_0x1af31f[_0x1f2a('0x3a')]=_[_0x1f2a('0x3c')](_0x1af31f[_0x1f2a('0x3a')],{'$or':_['map'](_0xf5a696,function(_0x97f9b2){if(_0x97f9b2['type']!==_0x1f2a('0x3d')){var _0x1e0c74={};_0x1e0c74[_0x97f9b2['name']]={'$like':'%'+_0x1511f1[_0x1f2a('0x2f')]['filter']+'%'};return _0x1e0c74;}})});}_0x1af31f=_[_0x1f2a('0x3c')]({},_0x1af31f,_0x1511f1[_0x1f2a('0x3e')]);var _0x51b0a7={'where':_0x1af31f['where']};return db[_0x1f2a('0x2b')][_0x1f2a('0x1e')](_0x51b0a7)[_0x1f2a('0x24')](function(_0x4ec1aa){_0x28948d[_0x1f2a('0x1e')]=_0x4ec1aa;if(_0x1511f1[_0x1f2a('0x2f')]['includeAll']){_0x1af31f[_0x1f2a('0x3f')]=[{'all':!![]}];}return db[_0x1f2a('0x2b')]['findAll'](_0x1af31f);})[_0x1f2a('0x24')](function(_0x37133b){_0x28948d[_0x1f2a('0x40')]=_0x37133b;return _0x28948d;})[_0x1f2a('0x24')](respondWithFilteredResult(_0x528bb7,_0x1af31f))[_0x1f2a('0x41')](handleError(_0x528bb7,null));};exports[_0x1f2a('0x42')]=function(_0x466fc2,_0x3b4234){var _0x481e1a={'raw':![],'where':{'id':_0x466fc2[_0x1f2a('0x43')]['id']}},_0x2d2704={};_0x2d2704['model']=_[_0x1f2a('0x30')](db[_0x1f2a('0x2b')][_0x1f2a('0x44')]);_0x2d2704['query']=_[_0x1f2a('0x30')](_0x466fc2[_0x1f2a('0x2f')]);_0x2d2704[_0x1f2a('0x31')]=_[_0x1f2a('0x32')](_0x2d2704[_0x1f2a('0x2e')],_0x2d2704['query']);_0x481e1a[_0x1f2a('0x33')]=_['intersection'](_0x2d2704[_0x1f2a('0x2e')],qs[_0x1f2a('0x34')](_0x466fc2[_0x1f2a('0x2f')][_0x1f2a('0x34')]));_0x481e1a[_0x1f2a('0x33')]=_0x481e1a[_0x1f2a('0x33')]['length']?_0x481e1a[_0x1f2a('0x33')]:_0x2d2704[_0x1f2a('0x2e')];if(_0x466fc2[_0x1f2a('0x2f')][_0x1f2a('0x45')]){_0x481e1a[_0x1f2a('0x3f')]=[{'all':!![]}];}_0x481e1a=_[_0x1f2a('0x3c')]({},_0x481e1a,_0x466fc2[_0x1f2a('0x3e')]);return db[_0x1f2a('0x2b')]['find'](_0x481e1a)[_0x1f2a('0x24')](handleEntityNotFound(_0x3b4234,null))[_0x1f2a('0x24')](respondWithResult(_0x3b4234,null))[_0x1f2a('0x41')](handleError(_0x3b4234,null));};exports['create']=function(_0x2e26bd,_0x2679e9){return db['AnalyticFieldReport']['create'](_0x2e26bd[_0x1f2a('0x46')],{})['then'](respondWithResult(_0x2679e9,0xc9))[_0x1f2a('0x41')](handleError(_0x2679e9,null));};exports[_0x1f2a('0x47')]=function(_0x2b5c42,_0x53bff5){return db['AnalyticFieldReport'][_0x1f2a('0x47')](_0x2b5c42[_0x1f2a('0x46')],{'raw':![],'individualHooks':!![]})[_0x1f2a('0x24')](respondWithResult(_0x53bff5,0xc9))[_0x1f2a('0x41')](handleError(_0x53bff5,null));};exports['update']=function(_0x17dfdb,_0x4c9ae9){if(_0x17dfdb['body']['id']){delete _0x17dfdb[_0x1f2a('0x46')]['id'];}return db[_0x1f2a('0x2b')][_0x1f2a('0x48')]({'where':{'id':_0x17dfdb['params']['id']}})['then'](handleEntityNotFound(_0x4c9ae9,null))[_0x1f2a('0x24')](saveUpdates(_0x17dfdb[_0x1f2a('0x46')],null))['then'](respondWithResult(_0x4c9ae9,null))[_0x1f2a('0x41')](handleError(_0x4c9ae9,null));};exports[_0x1f2a('0x25')]=function(_0x357664,_0x59508c){return db[_0x1f2a('0x2b')]['find']({'where':{'id':_0x357664[_0x1f2a('0x43')]['id']}})[_0x1f2a('0x24')](handleEntityNotFound(_0x59508c,null))['then'](removeEntity(_0x59508c,null))[_0x1f2a('0x41')](handleError(_0x59508c,null));};exports['bulkDestroy']=function(_0x125fb8,_0x3d8ea2){return db[_0x1f2a('0x2b')][_0x1f2a('0x25')]({'where':{'id':_0x125fb8[_0x1f2a('0x2f')][_0x1f2a('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x1f2a('0x24')](respondWithResult(_0x3d8ea2,0xcc))[_0x1f2a('0x41')](handleError(_0x3d8ea2,null));};exports['addFields']=function(_0x114806,_0x24cd2a,_0x5c0654){return db[_0x1f2a('0x4a')]['findOne']({'where':{'id':_0x114806[_0x1f2a('0x43')]['id']}})[_0x1f2a('0x24')](handleEntityNotFound(_0x24cd2a,null))[_0x1f2a('0x24')](function(_0x1178e1){if(_0x1178e1){return db['sequelize'][_0x1f2a('0x4b')](function(_0x58f84a){return db[_0x1f2a('0x2b')]['destroy']({'where':{'CustomReportId':_0x114806[_0x1f2a('0x43')]['id']},'transaction':_0x58f84a})[_0x1f2a('0x24')](function(_0x40c193){var _0x2258e7=_['map'](_0x114806['body'],function(_0x198226){delete _0x198226['id'];_0x198226[_0x1f2a('0x4c')]=_0x114806[_0x1f2a('0x43')]['id'];return _0x198226;});return db[_0x1f2a('0x2b')][_0x1f2a('0x47')](_0x2258e7,{'transaction':_0x58f84a});});})['then'](function(){return db['AnalyticFieldReport'][_0x1f2a('0x4d')]({'where':{'CustomReportId':_0x114806['params']['id']}});});}})['then'](respondWithResult(_0x24cd2a,null))['catch'](handleError(_0x24cd2a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 6636a33..3a03305 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 _0xaaaa=['lodash','util','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x5ba4e7,_0x5a23e1){var _0x506678=function(_0x5e5de2){while(--_0x5e5de2){_0x5ba4e7['push'](_0x5ba4e7['shift']());}};_0x506678(++_0x5a23e1);}(_0xaaaa,0x9a));var _0xaaaa=function(_0x2827b5,_0x1f963c){_0x2827b5=_0x2827b5-0x0;var _0x5560d5=_0xaaaa[_0x2827b5];return _0x5560d5;};'use strict';var _=require(_0xaaaa('0x0'));var util=require(_0xaaaa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaaaa('0x2'));var BPromise=require('bluebird');var rp=require(_0xaaaa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaaaa('0x4'));var config=require(_0xaaaa('0x5'));var attributes=require(_0xaaaa('0x6'));module[_0xaaaa('0x7')]=function(_0x20e43a,_0x45eb90){return _0x20e43a[_0xaaaa('0x8')](_0xaaaa('0x9'),attributes,{'tableName':_0xaaaa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x337b=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x337b,0x1d2));var _0xb337=function(_0x5eee8b,_0x53af12){_0x5eee8b=_0x5eee8b-0x0;var _0x1cc3d1=_0x337b[_0x5eee8b];return _0x1cc3d1;};'use strict';var _=require(_0xb337('0x0'));var util=require(_0xb337('0x1'));var logger=require(_0xb337('0x2'))('api');var moment=require(_0xb337('0x3'));var BPromise=require(_0xb337('0x4'));var rp=require(_0xb337('0x5'));var fs=require('fs');var path=require(_0xb337('0x6'));var rimraf=require(_0xb337('0x7'));var config=require(_0xb337('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xb337('0x9')]=function(_0xed119a,_0x29025d){return _0xed119a[_0xb337('0xa')](_0xb337('0xb'),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 0050554..21c2d10 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 _0x37af=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1b4057,_0x58212a){var _0x1d749a=function(_0x1fa30b){while(--_0x1fa30b){_0x1b4057['push'](_0x1b4057['shift']());}};_0x1d749a(++_0x58212a);}(_0x37af,0x10d));var _0xf37a=function(_0x58aa57,_0x32d905){_0x58aa57=_0x58aa57-0x0;var _0x2f134e=_0x37af[_0x58aa57];return _0x2f134e;};'use strict';var _=require('lodash');var util=require(_0xf37a('0x0'));var moment=require(_0xf37a('0x1'));var BPromise=require(_0xf37a('0x2'));var rs=require(_0xf37a('0x3'));var fs=require('fs');var Redis=require(_0xf37a('0x4'));var db=require(_0xf37a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf37a('0x6'));var config=require(_0xf37a('0x7'));var jayson=require(_0xf37a('0x8'));var client=jayson[_0xf37a('0x9')][_0xf37a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1da835,_0x576698,_0x15e8dc){return new BPromise(function(_0x16f7b1,_0x2f8e85){return client[_0xf37a('0xb')](_0x1da835,_0x15e8dc)[_0xf37a('0xc')](function(_0x1db587){logger[_0xf37a('0xd')](_0xf37a('0xe'),_0x576698,_0xf37a('0xf'));logger[_0xf37a('0x10')](_0xf37a('0x11'),_0x576698,_0xf37a('0xf'),JSON[_0xf37a('0x12')](_0x1db587));if(_0x1db587[_0xf37a('0x13')]){if(_0x1db587['error'][_0xf37a('0x14')]===0x1f4){logger[_0xf37a('0x13')](_0xf37a('0xe'),_0x576698,_0x1db587[_0xf37a('0x13')][_0xf37a('0x15')]);return _0x2f8e85(_0x1db587[_0xf37a('0x13')][_0xf37a('0x15')]);}logger[_0xf37a('0x13')](_0xf37a('0xe'),_0x576698,_0x1db587[_0xf37a('0x13')][_0xf37a('0x15')]);return _0x16f7b1(_0x1db587['error'][_0xf37a('0x15')]);}else{logger['info'](_0xf37a('0xe'),_0x576698,'request\x20sent');_0x16f7b1(_0x1db587['result'][_0xf37a('0x15')]);}})[_0xf37a('0x16')](function(_0x5d58df){logger[_0xf37a('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x576698,_0x5d58df);_0x2f8e85(_0x5d58df);});});} \ No newline at end of file +var _0xc2e2=['code','message','info','result','catch','util','moment','ioredis','rpc','../../config/environment','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e6c5a,_0x5eabdf){var _0x1c5215=function(_0xfdb779){while(--_0xfdb779){_0x3e6c5a['push'](_0x3e6c5a['shift']());}};_0x1c5215(++_0x5eabdf);}(_0xc2e2,0x194));var _0x2c2e=function(_0x4922ea,_0x2b16c6){_0x4922ea=_0x4922ea-0x0;var _0x5785f9=_0xc2e2[_0x4922ea];return _0x5785f9;};'use strict';var _=require('lodash');var util=require(_0x2c2e('0x0'));var moment=require(_0x2c2e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c2e('0x3'));var config=require(_0x2c2e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2c2e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55e1f4,_0x140348,_0x15ec0f){return new BPromise(function(_0x1b7982,_0x17d7ef){return client[_0x2c2e('0x6')](_0x55e1f4,_0x15ec0f)[_0x2c2e('0x7')](function(_0x129ed6){logger['info'](_0x2c2e('0x8'),_0x140348,_0x2c2e('0x9'));logger[_0x2c2e('0xa')](_0x2c2e('0xb'),_0x140348,_0x2c2e('0x9'),JSON[_0x2c2e('0xc')](_0x129ed6));if(_0x129ed6[_0x2c2e('0xd')]){if(_0x129ed6[_0x2c2e('0xd')][_0x2c2e('0xe')]===0x1f4){logger['error'](_0x2c2e('0x8'),_0x140348,_0x129ed6[_0x2c2e('0xd')]['message']);return _0x17d7ef(_0x129ed6['error']['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x140348,_0x129ed6[_0x2c2e('0xd')][_0x2c2e('0xf')]);return _0x1b7982(_0x129ed6[_0x2c2e('0xd')][_0x2c2e('0xf')]);}else{logger[_0x2c2e('0x10')](_0x2c2e('0x8'),_0x140348,_0x2c2e('0x9'));_0x1b7982(_0x129ed6[_0x2c2e('0x11')][_0x2c2e('0xf')]);}})[_0x2c2e('0x12')](function(_0x2f4ecf){logger[_0x2c2e('0xd')](_0x2c2e('0x8'),_0x140348,_0x2f4ecf);_0x17d7ef(_0x2f4ecf);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 9e243b5..9f89d2d 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(_0x36d20c,_0x3bafd5){var _0x2140af=function(_0x9c8bb7){while(--_0x9c8bb7){_0x36d20c['push'](_0x36d20c['shift']());}};_0x2140af(++_0x3bafd5);}(_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['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(_0x33ae55,_0x14989b){var _0x182a50=function(_0x131e60){while(--_0x131e60){_0x33ae55['push'](_0x33ae55['shift']());}};_0x182a50(++_0x14989b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 54aa2e4..cb12019 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 _0x980c=['TEXT','sequelize','exports','STRING','name'];(function(_0x397dcc,_0x51100c){var _0x2cd154=function(_0x3b14){while(--_0x3b14){_0x397dcc['push'](_0x397dcc['shift']());}};_0x2cd154(++_0x51100c);}(_0x980c,0x100));var _0xc980=function(_0x1e7157,_0x2659ba){_0x1e7157=_0x1e7157-0x0;var _0x595593=_0x980c[_0x1e7157];return _0x595593;};'use strict';var Sequelize=require(_0xc980('0x0'));module[_0xc980('0x1')]={'name':{'type':Sequelize[_0xc980('0x2')],'allowNull':![],'unique':_0xc980('0x3')},'table':{'type':Sequelize[_0xc980('0x2')]},'metric':{'type':Sequelize[_0xc980('0x4')]},'description':{'type':Sequelize[_0xc980('0x2')]}}; \ No newline at end of file +var _0x9e0d=['name','TEXT','sequelize','exports','STRING'];(function(_0x4c02dd,_0x4f427e){var _0x42a36d=function(_0x593bcc){while(--_0x593bcc){_0x4c02dd['push'](_0x4c02dd['shift']());}};_0x42a36d(++_0x4f427e);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x492b13,_0x4c39fa){_0x492b13=_0x492b13-0x0;var _0x3f6508=_0x9e0d[_0x492b13];return _0x3f6508;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'name':{'type':Sequelize[_0xd9e0('0x2')],'allowNull':![],'unique':_0xd9e0('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd9e0('0x4')]},'description':{'type':Sequelize[_0xd9e0('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index d6b2f3d..fec7b02 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x292f0d,_0x528c4c){var _0x2412f9=function(_0x722ed0){while(--_0x722ed0){_0x292f0d['push'](_0x292f0d['shift']());}};_0x2412f9(++_0x528c4c);}(_0x55ca,0x126));var _0xa55c=function(_0x55e28f,_0x20cedb){_0x55e28f=_0x55e28f-0x0;var _0xee48e9=_0x55ca[_0x55e28f];return _0xee48e9;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file +var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x1132a5,_0x22a6a2){var _0x53b53e=function(_0x1a582f){while(--_0x1a582f){_0x1132a5['push'](_0x1132a5['shift']());}};_0x53b53e(++_0x22a6a2);}(_0xa41a,0x6b));var _0xaa41=function(_0x514879,_0x548f62){_0x514879=_0x514879-0x0;var _0x4e0e68=_0xa41a[_0x514879];return _0x4e0e68;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 3b9a957..bb01eac 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 _0xa7be=['analytics_metrics','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0xa7be,0xfd));var _0xea7b=function(_0x7bd69d,_0x4839ac){_0x7bd69d=_0x7bd69d-0x0;var _0x41b6ac=_0xa7be[_0x7bd69d];return _0x41b6ac;};'use strict';var _=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var logger=require(_0xea7b('0x2'))(_0xea7b('0x3'));var moment=require(_0xea7b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea7b('0x5'));var rimraf=require(_0xea7b('0x6'));var config=require(_0xea7b('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xea7b('0x8')]=function(_0x1bf6cb,_0x3078c9){return _0x1bf6cb[_0xea7b('0x9')](_0xea7b('0xa'),attributes,{'tableName':_0xea7b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1f6=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','exports'];(function(_0x4afd2c,_0x5d6800){var _0x33074e=function(_0x1045d0){while(--_0x1045d0){_0x4afd2c['push'](_0x4afd2c['shift']());}};_0x33074e(++_0x5d6800);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0xa1f6[_0x4c2f17];return _0x20919e;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var logger=require(_0x6a1f('0x2'))(_0x6a1f('0x3'));var moment=require(_0x6a1f('0x4'));var BPromise=require(_0x6a1f('0x5'));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('./analyticMetric.attributes');module[_0x6a1f('0x6')]=function(_0x426ae1,_0xa1c928){return _0x426ae1[_0x6a1f('0x7')](_0x6a1f('0x8'),attributes,{'tableName':_0x6a1f('0x9'),'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 ea004a2..d0f32b0 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 _0x916a=['message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s'];(function(_0xdfa8a6,_0x2b5761){var _0x19e515=function(_0xa24538){while(--_0xa24538){_0xdfa8a6['push'](_0xdfa8a6['shift']());}};_0x19e515(++_0x2b5761);}(_0x916a,0x1a5));var _0xa916=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0x916a[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0xa916('0x0'));var util=require(_0xa916('0x1'));var moment=require(_0xa916('0x2'));var BPromise=require('bluebird');var rs=require(_0xa916('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa916('0x4'))['db'];var utils=require(_0xa916('0x5'));var logger=require(_0xa916('0x6'))(_0xa916('0x7'));var config=require(_0xa916('0x8'));var jayson=require(_0xa916('0x9'));var client=jayson[_0xa916('0xa')][_0xa916('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x374e00,_0x1dc6e6,_0x3997a7){return new BPromise(function(_0x54791a,_0x96dfa9){return client[_0xa916('0xc')](_0x374e00,_0x3997a7)[_0xa916('0xd')](function(_0x2d04f0){logger[_0xa916('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x1dc6e6,'request\x20sent');logger[_0xa916('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1dc6e6,_0xa916('0x10'),JSON[_0xa916('0x11')](_0x2d04f0));if(_0x2d04f0[_0xa916('0x12')]){if(_0x2d04f0[_0xa916('0x12')]['code']===0x1f4){logger[_0xa916('0x12')](_0xa916('0x13'),_0x1dc6e6,_0x2d04f0['error'][_0xa916('0x14')]);return _0x96dfa9(_0x2d04f0[_0xa916('0x12')][_0xa916('0x14')]);}logger['error'](_0xa916('0x13'),_0x1dc6e6,_0x2d04f0['error'][_0xa916('0x14')]);return _0x54791a(_0x2d04f0['error'][_0xa916('0x14')]);}else{logger[_0xa916('0xe')](_0xa916('0x13'),_0x1dc6e6,_0xa916('0x10'));_0x54791a(_0x2d04f0['result'][_0xa916('0x14')]);}})['catch'](function(_0x531003){logger[_0xa916('0x12')](_0xa916('0x13'),_0x1dc6e6,_0x531003);_0x96dfa9(_0x531003);});});} \ No newline at end of file +var _0xdbc9=['then','info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2ac368,_0x53a579){var _0x22e9f7=function(_0x517d19){while(--_0x517d19){_0x2ac368['push'](_0x2ac368['shift']());}};_0x22e9f7(++_0x53a579);}(_0xdbc9,0x1d6));var _0x9dbc=function(_0x33b1ff,_0x383ab4){_0x33b1ff=_0x33b1ff-0x0;var _0x5d6e19=_0xdbc9[_0x33b1ff];return _0x5d6e19;};'use strict';var _=require(_0x9dbc('0x0'));var util=require(_0x9dbc('0x1'));var moment=require(_0x9dbc('0x2'));var BPromise=require(_0x9dbc('0x3'));var rs=require(_0x9dbc('0x4'));var fs=require('fs');var Redis=require(_0x9dbc('0x5'));var db=require(_0x9dbc('0x6'))['db'];var utils=require(_0x9dbc('0x7'));var logger=require(_0x9dbc('0x8'))('rpc');var config=require(_0x9dbc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9dbc('0xa')][_0x9dbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5a4b,_0x1463c2,_0xbbe283){return new BPromise(function(_0x5e27fe,_0x25aabb){return client[_0x9dbc('0xc')](_0x1d5a4b,_0xbbe283)[_0x9dbc('0xd')](function(_0x3c1dde){logger[_0x9dbc('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x1463c2,_0x9dbc('0xf'));logger[_0x9dbc('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1463c2,_0x9dbc('0xf'),JSON[_0x9dbc('0x11')](_0x3c1dde));if(_0x3c1dde['error']){if(_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x13')]===0x1f4){logger[_0x9dbc('0x12')](_0x9dbc('0x14'),_0x1463c2,_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);return _0x25aabb(_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);}logger[_0x9dbc('0x12')](_0x9dbc('0x14'),_0x1463c2,_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);return _0x5e27fe(_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);}else{logger[_0x9dbc('0xe')](_0x9dbc('0x14'),_0x1463c2,_0x9dbc('0xf'));_0x5e27fe(_0x3c1dde['result'][_0x9dbc('0x15')]);}})[_0x9dbc('0x16')](function(_0xd8851e){logger[_0x9dbc('0x12')](_0x9dbc('0x14'),_0x1463c2,_0xd8851e);_0x25aabb(_0xd8851e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index f95d034..d61a48a 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 _0x0619=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1a9e8f,_0x22831f){var _0x1cd6ee=function(_0x28eb2c){while(--_0x28eb2c){_0x1a9e8f['push'](_0x1a9e8f['shift']());}};_0x1cd6ee(++_0x22831f);}(_0x0619,0x90));var _0x9061=function(_0x2c2439,_0x2462bc){_0x2c2439=_0x2c2439-0x0;var _0xa81182=_0x0619[_0x2c2439];return _0xa81182;};'use strict';var multer=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var path=require(_0x9061('0x2'));var timeout=require(_0x9061('0x3'));var express=require('express');var router=express[_0x9061('0x4')]();var fs_extra=require(_0x9061('0x5'));var auth=require(_0x9061('0x6'));var interaction=require(_0x9061('0x7'));var config=require(_0x9061('0x8'));var controller=require(_0x9061('0x9'));router[_0x9061('0xa')]('/',auth[_0x9061('0xb')](),controller[_0x9061('0xc')]);router[_0x9061('0xa')](_0x9061('0xd'),auth['isAuthenticated'](),controller[_0x9061('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9061('0xf')]);router[_0x9061('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9061('0x11')]);router[_0x9061('0x12')](_0x9061('0xd'),auth[_0x9061('0xb')](),controller[_0x9061('0x13')]);module[_0x9061('0x14')]=router; \ No newline at end of file +var _0x2159=['update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','/:id'];(function(_0x45158b,_0x27eae9){var _0x21cf31=function(_0x57798b){while(--_0x57798b){_0x45158b['push'](_0x45158b['shift']());}};_0x21cf31(++_0x27eae9);}(_0x2159,0x17f));var _0x9215=function(_0x51f67c,_0x1977ec){_0x51f67c=_0x51f67c-0x0;var _0x3888c5=_0x2159[_0x51f67c];return _0x3888c5;};'use strict';var multer=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var path=require(_0x9215('0x2'));var timeout=require(_0x9215('0x3'));var express=require('express');var router=express[_0x9215('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9215('0x5'));var interaction=require(_0x9215('0x6'));var config=require(_0x9215('0x7'));var controller=require(_0x9215('0x8'));router[_0x9215('0x9')]('/',auth[_0x9215('0xa')](),controller[_0x9215('0xb')]);router[_0x9215('0x9')]('/:id',auth[_0x9215('0xa')](),controller[_0x9215('0xc')]);router[_0x9215('0xd')]('/',auth[_0x9215('0xa')](),controller[_0x9215('0xe')]);router['put'](_0x9215('0xf'),auth[_0x9215('0xa')](),controller[_0x9215('0x10')]);router[_0x9215('0x11')]('/:id',auth[_0x9215('0xa')](),controller[_0x9215('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index b3f5d67..d9e882c 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 _0x9464=['exports','TEXT','sequelize'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9464,0x10d));var _0x4946=function(_0x1c7137,_0x4c7c26){_0x1c7137=_0x1c7137-0x0;var _0xeb4432=_0x9464[_0x1c7137];return _0xeb4432;};'use strict';var Sequelize=require(_0x4946('0x0'));module[_0x4946('0x1')]={'tree':{'type':Sequelize[_0x4946('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1fc5=['exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1fc5,0x98));var _0x51fc=function(_0x5585f9,_0x492ef7){_0x5585f9=_0x5585f9-0x0;var _0x25cd7b=_0x1fc5[_0x5585f9];return _0x25cd7b;};'use strict';var Sequelize=require('sequelize');module[_0x51fc('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 68a4b72..4f952fc 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 _0x03c5=['update','destroy','then','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x03c5,0x190));var _0x503c=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x03c5[_0x14e27a];return _0x288688;};'use strict';var emlformat=require(_0x503c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x503c('0x1'));var rp=require(_0x503c('0x2'));var moment=require(_0x503c('0x3'));var BPromise=require(_0x503c('0x4'));var Mustache=require(_0x503c('0x5'));var util=require('util');var path=require(_0x503c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x503c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x503c('0x8'));var squel=require(_0x503c('0x9'));var crypto=require('crypto');var jsforce=require(_0x503c('0xa'));var deskjs=require(_0x503c('0xb'));var toCsv=require(_0x503c('0xc'));var querystring=require(_0x503c('0xd'));var Papa=require(_0x503c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x503c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x503c('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x503c('0x11'));var db=require(_0x503c('0x12'))['db'];function respondWithStatusCode(_0x17a5e8,_0x40b6d1){_0x40b6d1=_0x40b6d1||0xcc;return function(_0x2be185){if(_0x2be185){return _0x17a5e8[_0x503c('0x13')](_0x40b6d1);}return _0x17a5e8['status'](_0x40b6d1)[_0x503c('0x14')]();};}function respondWithResult(_0x29ab2b,_0x5b237d){_0x5b237d=_0x5b237d||0xc8;return function(_0x2f229e){if(_0x2f229e){return _0x29ab2b['status'](_0x5b237d)[_0x503c('0x15')](_0x2f229e);}};}function respondWithFilteredResult(_0x37d75d,_0x1da073){return function(_0x3bbae8){if(_0x3bbae8){var _0x290fc3=typeof _0x1da073[_0x503c('0x16')]==='undefined'&&typeof _0x1da073['limit']===_0x503c('0x17');var _0x701666=_0x3bbae8[_0x503c('0x18')];var _0x56ae58=_0x290fc3?0x0:_0x1da073[_0x503c('0x16')];var _0x2eaf12=_0x290fc3?_0x3bbae8['count']:_0x1da073[_0x503c('0x16')]+_0x1da073[_0x503c('0x19')];var _0xebff17;if(_0x2eaf12>=_0x701666){_0x2eaf12=_0x701666;_0xebff17=0xc8;}else{_0xebff17=0xce;}_0x37d75d[_0x503c('0x1a')](_0xebff17);return _0x37d75d[_0x503c('0x1b')](_0x503c('0x1c'),_0x56ae58+'-'+_0x2eaf12+'/'+_0x701666)[_0x503c('0x15')](_0x3bbae8);}return null;};}function patchUpdates(_0x4abbcf){return function(_0x41c166){try{jsonpatch[_0x503c('0x1d')](_0x41c166,_0x4abbcf,!![]);}catch(_0x540c18){return BPromise[_0x503c('0x1e')](_0x540c18);}return _0x41c166[_0x503c('0x1f')]();};}function saveUpdates(_0x124356,_0x436442){return function(_0x515e9c){if(_0x515e9c){return _0x515e9c[_0x503c('0x20')](_0x124356)['then'](function(_0x1b97ab){return _0x1b97ab;});}return null;};}function removeEntity(_0x20d618,_0x82562e){return function(_0x4f4f02){if(_0x4f4f02){return _0x4f4f02[_0x503c('0x21')]()[_0x503c('0x22')](function(){_0x20d618['status'](0xcc)[_0x503c('0x14')]();});}};}function handleEntityNotFound(_0x132e9e,_0x4355dc){return function(_0x207d3f){if(!_0x207d3f){_0x132e9e[_0x503c('0x13')](0x194);}return _0x207d3f;};}function handleError(_0x4f7bcb,_0x1aa099){_0x1aa099=_0x1aa099||0x1f4;return function(_0x59ecdd){logger['error'](_0x59ecdd[_0x503c('0x23')]);if(_0x59ecdd[_0x503c('0x24')]){delete _0x59ecdd['name'];}_0x4f7bcb[_0x503c('0x1a')](_0x1aa099)[_0x503c('0x25')](_0x59ecdd);};}exports[_0x503c('0x26')]=function(_0x5c8066,_0x6b7d42){var _0x35fe88={},_0x25b15c={},_0x4b75bd={'count':0x0,'rows':[]};var _0x1d84e9=_[_0x503c('0x27')](db[_0x503c('0x28')][_0x503c('0x29')],function(_0x27c0a7){return{'name':_0x27c0a7['fieldName'],'type':_0x27c0a7[_0x503c('0x2a')][_0x503c('0x2b')]};});_0x25b15c[_0x503c('0x2c')]=_[_0x503c('0x27')](_0x1d84e9,_0x503c('0x24'));_0x25b15c['query']=_['keys'](_0x5c8066[_0x503c('0x2d')]);_0x25b15c[_0x503c('0x2e')]=_[_0x503c('0x2f')](_0x25b15c[_0x503c('0x2c')],_0x25b15c['query']);_0x35fe88[_0x503c('0x30')]=_[_0x503c('0x2f')](_0x25b15c[_0x503c('0x2c')],qs[_0x503c('0x31')](_0x5c8066[_0x503c('0x2d')]['fields']));_0x35fe88[_0x503c('0x30')]=_0x35fe88[_0x503c('0x30')][_0x503c('0x32')]?_0x35fe88[_0x503c('0x30')]:_0x25b15c[_0x503c('0x2c')];if(!_0x5c8066[_0x503c('0x2d')][_0x503c('0x33')](_0x503c('0x34'))){_0x35fe88[_0x503c('0x19')]=qs[_0x503c('0x19')](_0x5c8066[_0x503c('0x2d')]['limit']);_0x35fe88[_0x503c('0x16')]=qs[_0x503c('0x16')](_0x5c8066[_0x503c('0x2d')][_0x503c('0x16')]);}_0x35fe88[_0x503c('0x35')]=qs[_0x503c('0x36')](_0x5c8066[_0x503c('0x2d')][_0x503c('0x36')]);_0x35fe88[_0x503c('0x37')]=qs['filters'](_[_0x503c('0x38')](_0x5c8066['query'],_0x25b15c[_0x503c('0x2e')]),_0x1d84e9);if(_0x5c8066[_0x503c('0x2d')][_0x503c('0x39')]){_0x35fe88[_0x503c('0x37')]=_[_0x503c('0x3a')](_0x35fe88['where'],{'$or':_['map'](_0x1d84e9,function(_0x59b690){if(_0x59b690['type']!==_0x503c('0x3b')){var _0x3949b0={};_0x3949b0[_0x59b690[_0x503c('0x24')]]={'$like':'%'+_0x5c8066['query'][_0x503c('0x39')]+'%'};return _0x3949b0;}})});}_0x35fe88=_[_0x503c('0x3a')]({},_0x35fe88,_0x5c8066[_0x503c('0x3c')]);var _0x1fadd0={'where':_0x35fe88['where']};return db[_0x503c('0x28')]['count'](_0x1fadd0)[_0x503c('0x22')](function(_0x21c9ab){_0x4b75bd[_0x503c('0x18')]=_0x21c9ab;if(_0x5c8066[_0x503c('0x2d')][_0x503c('0x3d')]){_0x35fe88[_0x503c('0x3e')]=[{'all':!![]}];}return db[_0x503c('0x28')][_0x503c('0x3f')](_0x35fe88);})['then'](function(_0x2178cc){_0x4b75bd[_0x503c('0x40')]=_0x2178cc;return _0x4b75bd;})[_0x503c('0x22')](respondWithFilteredResult(_0x6b7d42,_0x35fe88))[_0x503c('0x41')](handleError(_0x6b7d42,null));};exports[_0x503c('0x42')]=function(_0xbcbb22,_0x171231){var _0x35a569={'raw':!![],'where':{'id':_0xbcbb22['params']['id']}},_0x235a46={};_0x235a46['model']=_[_0x503c('0x43')](db['AnalyticTreeReport']['rawAttributes']);_0x235a46[_0x503c('0x2d')]=_[_0x503c('0x43')](_0xbcbb22[_0x503c('0x2d')]);_0x235a46[_0x503c('0x2e')]=_[_0x503c('0x2f')](_0x235a46[_0x503c('0x2c')],_0x235a46[_0x503c('0x2d')]);_0x35a569['attributes']=_[_0x503c('0x2f')](_0x235a46[_0x503c('0x2c')],qs[_0x503c('0x31')](_0xbcbb22['query'][_0x503c('0x31')]));_0x35a569[_0x503c('0x30')]=_0x35a569['attributes'][_0x503c('0x32')]?_0x35a569[_0x503c('0x30')]:_0x235a46[_0x503c('0x2c')];if(_0xbcbb22[_0x503c('0x2d')]['includeAll']){_0x35a569[_0x503c('0x3e')]=[{'all':!![]}];}_0x35a569=_[_0x503c('0x3a')]({},_0x35a569,_0xbcbb22['options']);return db['AnalyticTreeReport'][_0x503c('0x44')](_0x35a569)[_0x503c('0x22')](handleEntityNotFound(_0x171231,null))[_0x503c('0x22')](respondWithResult(_0x171231,null))[_0x503c('0x41')](handleError(_0x171231,null));};exports[_0x503c('0x45')]=function(_0x1a8f46,_0x5b8918){return db[_0x503c('0x28')][_0x503c('0x45')](_0x1a8f46[_0x503c('0x46')],{})[_0x503c('0x22')](respondWithResult(_0x5b8918,0xc9))['catch'](handleError(_0x5b8918,null));};exports['update']=function(_0x36bee6,_0x1af4c3){if(_0x36bee6[_0x503c('0x46')]['id']){delete _0x36bee6[_0x503c('0x46')]['id'];}return db[_0x503c('0x28')][_0x503c('0x44')]({'where':{'id':_0x36bee6[_0x503c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1af4c3,null))[_0x503c('0x22')](saveUpdates(_0x36bee6[_0x503c('0x46')],null))[_0x503c('0x22')](respondWithResult(_0x1af4c3,null))[_0x503c('0x41')](handleError(_0x1af4c3,null));};exports['destroy']=function(_0xff8bc2,_0x3aa8ce){return db[_0x503c('0x28')][_0x503c('0x44')]({'where':{'id':_0xff8bc2[_0x503c('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa8ce,null))['then'](removeEntity(_0x3aa8ce,null))['catch'](handleError(_0x3aa8ce,null));}; \ No newline at end of file +var _0xdc36=['length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','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','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','AnalyticTreeReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x31ef43,_0x401a87){var _0x3f9960=function(_0x12b57e){while(--_0x12b57e){_0x31ef43['push'](_0x31ef43['shift']());}};_0x3f9960(++_0x401a87);}(_0xdc36,0xee));var _0x6dc3=function(_0x434392,_0x548f1d){_0x434392=_0x434392-0x0;var _0x113261=_0xdc36[_0x434392];return _0x113261;};'use strict';var emlformat=require(_0x6dc3('0x0'));var rimraf=require(_0x6dc3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc3('0x2'));var rp=require(_0x6dc3('0x3'));var moment=require('moment');var BPromise=require(_0x6dc3('0x4'));var Mustache=require(_0x6dc3('0x5'));var util=require('util');var path=require(_0x6dc3('0x6'));var sox=require(_0x6dc3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6dc3('0x8'));var squel=require(_0x6dc3('0x9'));var crypto=require(_0x6dc3('0xa'));var jsforce=require(_0x6dc3('0xb'));var deskjs=require(_0x6dc3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6dc3('0xd'));var Redis=require(_0x6dc3('0xe'));var authService=require(_0x6dc3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6dc3('0x10'));var hardwareService=require(_0x6dc3('0x11'));var logger=require(_0x6dc3('0x12'))(_0x6dc3('0x13'));var utils=require(_0x6dc3('0x14'));var config=require(_0x6dc3('0x15'));var licenseUtil=require(_0x6dc3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x498ee5,_0x5d124e){_0x5d124e=_0x5d124e||0xcc;return function(_0xcfb607){if(_0xcfb607){return _0x498ee5['sendStatus'](_0x5d124e);}return _0x498ee5['status'](_0x5d124e)['end']();};}function respondWithResult(_0x5804ca,_0x364a1c){_0x364a1c=_0x364a1c||0xc8;return function(_0x52deca){if(_0x52deca){return _0x5804ca[_0x6dc3('0x17')](_0x364a1c)[_0x6dc3('0x18')](_0x52deca);}};}function respondWithFilteredResult(_0x16dafe,_0x3a63f6){return function(_0x457621){if(_0x457621){var _0x584654=typeof _0x3a63f6[_0x6dc3('0x19')]===_0x6dc3('0x1a')&&typeof _0x3a63f6['limit']===_0x6dc3('0x1a');var _0x8f7b1f=_0x457621[_0x6dc3('0x1b')];var _0x68a4de=_0x584654?0x0:_0x3a63f6[_0x6dc3('0x19')];var _0xca02ec=_0x584654?_0x457621[_0x6dc3('0x1b')]:_0x3a63f6[_0x6dc3('0x19')]+_0x3a63f6[_0x6dc3('0x1c')];var _0xe148f7;if(_0xca02ec>=_0x8f7b1f){_0xca02ec=_0x8f7b1f;_0xe148f7=0xc8;}else{_0xe148f7=0xce;}_0x16dafe[_0x6dc3('0x17')](_0xe148f7);return _0x16dafe[_0x6dc3('0x1d')](_0x6dc3('0x1e'),_0x68a4de+'-'+_0xca02ec+'/'+_0x8f7b1f)[_0x6dc3('0x18')](_0x457621);}return null;};}function patchUpdates(_0x5c628){return function(_0x213cdf){try{jsonpatch['apply'](_0x213cdf,_0x5c628,!![]);}catch(_0x55469b){return BPromise[_0x6dc3('0x1f')](_0x55469b);}return _0x213cdf[_0x6dc3('0x20')]();};}function saveUpdates(_0x1631ce,_0x3658a7){return function(_0x504d70){if(_0x504d70){return _0x504d70[_0x6dc3('0x21')](_0x1631ce)[_0x6dc3('0x22')](function(_0x4efc4a){return _0x4efc4a;});}return null;};}function removeEntity(_0x33f682,_0x8f2512){return function(_0x452e17){if(_0x452e17){return _0x452e17[_0x6dc3('0x23')]()['then'](function(){_0x33f682[_0x6dc3('0x17')](0xcc)[_0x6dc3('0x24')]();});}};}function handleEntityNotFound(_0x4a2a0a,_0x3a118a){return function(_0x28cedc){if(!_0x28cedc){_0x4a2a0a[_0x6dc3('0x25')](0x194);}return _0x28cedc;};}function handleError(_0x21eaed,_0x549407){_0x549407=_0x549407||0x1f4;return function(_0x235be2){logger[_0x6dc3('0x26')](_0x235be2[_0x6dc3('0x27')]);if(_0x235be2[_0x6dc3('0x28')]){delete _0x235be2[_0x6dc3('0x28')];}_0x21eaed['status'](_0x549407)['send'](_0x235be2);};}exports[_0x6dc3('0x29')]=function(_0x1409d7,_0x76dcc8){var _0x5a4b3e={},_0x10950f={},_0x3f54af={'count':0x0,'rows':[]};var _0x6c481f=_[_0x6dc3('0x2a')](db[_0x6dc3('0x2b')]['rawAttributes'],function(_0x39a42b){return{'name':_0x39a42b[_0x6dc3('0x2c')],'type':_0x39a42b[_0x6dc3('0x2d')][_0x6dc3('0x2e')]};});_0x10950f['model']=_[_0x6dc3('0x2a')](_0x6c481f,_0x6dc3('0x28'));_0x10950f[_0x6dc3('0x2f')]=_[_0x6dc3('0x30')](_0x1409d7['query']);_0x10950f[_0x6dc3('0x31')]=_[_0x6dc3('0x32')](_0x10950f[_0x6dc3('0x33')],_0x10950f[_0x6dc3('0x2f')]);_0x5a4b3e['attributes']=_[_0x6dc3('0x32')](_0x10950f[_0x6dc3('0x33')],qs['fields'](_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x34')]));_0x5a4b3e[_0x6dc3('0x35')]=_0x5a4b3e[_0x6dc3('0x35')][_0x6dc3('0x36')]?_0x5a4b3e[_0x6dc3('0x35')]:_0x10950f[_0x6dc3('0x33')];if(!_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x37')]('nolimit')){_0x5a4b3e['limit']=qs[_0x6dc3('0x1c')](_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x1c')]);_0x5a4b3e['offset']=qs['offset'](_0x1409d7[_0x6dc3('0x2f')]['offset']);}_0x5a4b3e[_0x6dc3('0x38')]=qs[_0x6dc3('0x39')](_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x39')]);_0x5a4b3e['where']=qs[_0x6dc3('0x31')](_[_0x6dc3('0x3a')](_0x1409d7[_0x6dc3('0x2f')],_0x10950f[_0x6dc3('0x31')]),_0x6c481f);if(_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x3b')]){_0x5a4b3e[_0x6dc3('0x3c')]=_[_0x6dc3('0x3d')](_0x5a4b3e[_0x6dc3('0x3c')],{'$or':_[_0x6dc3('0x2a')](_0x6c481f,function(_0x6b6d78){if(_0x6b6d78[_0x6dc3('0x2d')]!==_0x6dc3('0x3e')){var _0x2fb97f={};_0x2fb97f[_0x6b6d78['name']]={'$like':'%'+_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x3b')]+'%'};return _0x2fb97f;}})});}_0x5a4b3e=_[_0x6dc3('0x3d')]({},_0x5a4b3e,_0x1409d7[_0x6dc3('0x3f')]);var _0x463c4f={'where':_0x5a4b3e[_0x6dc3('0x3c')]};return db[_0x6dc3('0x2b')][_0x6dc3('0x1b')](_0x463c4f)[_0x6dc3('0x22')](function(_0x2ab6ec){_0x3f54af['count']=_0x2ab6ec;if(_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x40')]){_0x5a4b3e[_0x6dc3('0x41')]=[{'all':!![]}];}return db[_0x6dc3('0x2b')]['findAll'](_0x5a4b3e);})[_0x6dc3('0x22')](function(_0x423ec4){_0x3f54af[_0x6dc3('0x42')]=_0x423ec4;return _0x3f54af;})[_0x6dc3('0x22')](respondWithFilteredResult(_0x76dcc8,_0x5a4b3e))[_0x6dc3('0x43')](handleError(_0x76dcc8,null));};exports[_0x6dc3('0x44')]=function(_0x2c159d,_0x52c0d8){var _0x5718ab={'raw':!![],'where':{'id':_0x2c159d['params']['id']}},_0x5b23a8={};_0x5b23a8[_0x6dc3('0x33')]=_['keys'](db[_0x6dc3('0x2b')][_0x6dc3('0x45')]);_0x5b23a8[_0x6dc3('0x2f')]=_[_0x6dc3('0x30')](_0x2c159d[_0x6dc3('0x2f')]);_0x5b23a8[_0x6dc3('0x31')]=_[_0x6dc3('0x32')](_0x5b23a8[_0x6dc3('0x33')],_0x5b23a8[_0x6dc3('0x2f')]);_0x5718ab[_0x6dc3('0x35')]=_['intersection'](_0x5b23a8[_0x6dc3('0x33')],qs[_0x6dc3('0x34')](_0x2c159d['query']['fields']));_0x5718ab[_0x6dc3('0x35')]=_0x5718ab[_0x6dc3('0x35')]['length']?_0x5718ab[_0x6dc3('0x35')]:_0x5b23a8[_0x6dc3('0x33')];if(_0x2c159d[_0x6dc3('0x2f')][_0x6dc3('0x40')]){_0x5718ab['include']=[{'all':!![]}];}_0x5718ab=_[_0x6dc3('0x3d')]({},_0x5718ab,_0x2c159d[_0x6dc3('0x3f')]);return db['AnalyticTreeReport'][_0x6dc3('0x46')](_0x5718ab)[_0x6dc3('0x22')](handleEntityNotFound(_0x52c0d8,null))[_0x6dc3('0x22')](respondWithResult(_0x52c0d8,null))['catch'](handleError(_0x52c0d8,null));};exports[_0x6dc3('0x47')]=function(_0x3f130d,_0x315644){return db[_0x6dc3('0x2b')][_0x6dc3('0x47')](_0x3f130d[_0x6dc3('0x48')],{})[_0x6dc3('0x22')](respondWithResult(_0x315644,0xc9))[_0x6dc3('0x43')](handleError(_0x315644,null));};exports['update']=function(_0x31ec0c,_0x366ba0){if(_0x31ec0c[_0x6dc3('0x48')]['id']){delete _0x31ec0c['body']['id'];}return db[_0x6dc3('0x2b')][_0x6dc3('0x46')]({'where':{'id':_0x31ec0c['params']['id']}})[_0x6dc3('0x22')](handleEntityNotFound(_0x366ba0,null))['then'](saveUpdates(_0x31ec0c[_0x6dc3('0x48')],null))['then'](respondWithResult(_0x366ba0,null))[_0x6dc3('0x43')](handleError(_0x366ba0,null));};exports['destroy']=function(_0x2f6ebc,_0x455ed9){return db[_0x6dc3('0x2b')]['find']({'where':{'id':_0x2f6ebc['params']['id']}})['then'](handleEntityNotFound(_0x455ed9,null))['then'](removeEntity(_0x455ed9,null))['catch'](handleError(_0x455ed9,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 287a8fc..ada6103 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 _0x05c4=['moment','bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash','util','api'];(function(_0x285cf1,_0x47e330){var _0x2fea93=function(_0x4129d6){while(--_0x4129d6){_0x285cf1['push'](_0x285cf1['shift']());}};_0x2fea93(++_0x47e330);}(_0x05c4,0x1bf));var _0x405c=function(_0x3c7434,_0x3a1789){_0x3c7434=_0x3c7434-0x0;var _0x327695=_0x05c4[_0x3c7434];return _0x327695;};'use strict';var _=require(_0x405c('0x0'));var util=require(_0x405c('0x1'));var logger=require('../../config/logger')(_0x405c('0x2'));var moment=require(_0x405c('0x3'));var BPromise=require(_0x405c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x405c('0x5'));var config=require(_0x405c('0x6'));var attributes=require(_0x405c('0x7'));module[_0x405c('0x8')]=function(_0x482657,_0xf10793){return _0x482657['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8de8=['moment','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','lodash','util','../../config/logger','api'];(function(_0x396b94,_0x151de5){var _0xec6fa2=function(_0x454c26){while(--_0x454c26){_0x396b94['push'](_0x396b94['shift']());}};_0xec6fa2(++_0x151de5);}(_0x8de8,0xb0));var _0x88de=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8de8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x88de('0x0'));var util=require(_0x88de('0x1'));var logger=require(_0x88de('0x2'))(_0x88de('0x3'));var moment=require(_0x88de('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x88de('0x5'));var config=require('../../config/environment');var attributes=require(_0x88de('0x6'));module['exports']=function(_0x317b9c,_0x344973){return _0x317b9c[_0x88de('0x7')](_0x88de('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index e6ec3d3..96f051d 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1ed052,_0xa3a348){var _0xcbd823=function(_0xee8588){while(--_0xee8588){_0x1ed052['push'](_0x1ed052['shift']());}};_0xcbd823(++_0xa3a348);}(_0xdb28,0x106));var _0x8db2=function(_0x16ac32,_0x48b274){_0x16ac32=_0x16ac32-0x0;var _0x1ad273=_0xdb28[_0x16ac32];return _0x1ad273;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0xadb5,0xad));var _0x5adb=function(_0x2ca2bd,_0x53bb08){_0x2ca2bd=_0x2ca2bd-0x0;var _0x275f99=_0xadb5[_0x2ca2bd];return _0x275f99;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 4275bf3..c4802fe 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 _0xfacc=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfacc,0x1b0));var _0xcfac=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xfacc[_0x3b5049];return _0x12454e;};'use strict';var multer=require(_0xcfac('0x0'));var util=require(_0xcfac('0x1'));var path=require(_0xcfac('0x2'));var timeout=require(_0xcfac('0x3'));var express=require(_0xcfac('0x4'));var router=express['Router']();var fs_extra=require(_0xcfac('0x5'));var auth=require(_0xcfac('0x6'));var interaction=require(_0xcfac('0x7'));var config=require(_0xcfac('0x8'));var controller=require('./analyticTreeReport.controller');router[_0xcfac('0x9')]('/',auth[_0xcfac('0xa')](),controller['index']);router[_0xcfac('0x9')]('/:id',auth[_0xcfac('0xa')](),controller[_0xcfac('0xb')]);router['post']('/',auth[_0xcfac('0xa')](),controller[_0xcfac('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcfac('0xd')]);router['delete']('/:id',auth[_0xcfac('0xa')](),controller[_0xcfac('0xe')]);module[_0xcfac('0xf')]=router; \ No newline at end of file +var _0x32e5=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x3c40f4,_0x500b8a){var _0x1209d=function(_0x46b429){while(--_0x46b429){_0x3c40f4['push'](_0x3c40f4['shift']());}};_0x1209d(++_0x500b8a);}(_0x32e5,0x10c));var _0x532e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x32e5[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x532e('0x0'));var util=require(_0x532e('0x1'));var path=require(_0x532e('0x2'));var timeout=require(_0x532e('0x3'));var express=require(_0x532e('0x4'));var router=express[_0x532e('0x5')]();var fs_extra=require(_0x532e('0x6'));var auth=require(_0x532e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x532e('0x8'));var controller=require(_0x532e('0x9'));router[_0x532e('0xa')]('/',auth[_0x532e('0xb')](),controller[_0x532e('0xc')]);router[_0x532e('0xa')]('/:id',auth[_0x532e('0xb')](),controller[_0x532e('0xd')]);router[_0x532e('0xe')]('/',auth['isAuthenticated'](),controller[_0x532e('0xf')]);router[_0x532e('0x10')]('/:id',auth[_0x532e('0xb')](),controller[_0x532e('0x11')]);router[_0x532e('0x12')](_0x532e('0x13'),auth[_0x532e('0xb')](),controller[_0x532e('0x14')]);module[_0x532e('0x15')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e9032bf..aa64926 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 _0xcee0=['STRING','sequelize','exports'];(function(_0x166f54,_0x467e5c){var _0x41fc2b=function(_0x2481e3){while(--_0x2481e3){_0x166f54['push'](_0x166f54['shift']());}};_0x41fc2b(++_0x467e5c);}(_0xcee0,0x1e1));var _0x0cee=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0xcee0[_0x548200];return _0x1a6d74;};'use strict';var Sequelize=require(_0x0cee('0x0'));module[_0x0cee('0x1')]={'name':{'type':Sequelize[_0x0cee('0x2')]},'basename':{'type':Sequelize[_0x0cee('0x2')]},'type':{'type':Sequelize[_0x0cee('0x2')]}}; \ No newline at end of file +var _0x9f75=['sequelize','STRING'];(function(_0x227b09,_0x2ea7ae){var _0x5f3571=function(_0x5916ae){while(--_0x5916ae){_0x227b09['push'](_0x227b09['shift']());}};_0x5f3571(++_0x2ea7ae);}(_0x9f75,0x15a));var _0x59f7=function(_0x2047a0,_0x18bde3){_0x2047a0=_0x2047a0-0x0;var _0x3c4bc1=_0x9f75[_0x2047a0];return _0x3c4bc1;};'use strict';var Sequelize=require(_0x59f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x59f7('0x1')]},'basename':{'type':Sequelize[_0x59f7('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 4b4c023..6903f5a 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 _0xc4ad=['../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','Attachment','rawAttributes','type','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','clone','get','omit','createdAt','updatedAt','body','create','destroy','originalname','file','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4ad,0x199));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdc4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc4a('0x1'));var jsonpatch=require(_0xdc4a('0x2'));var rp=require(_0xdc4a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdc4a('0x4'));var util=require('util');var path=require(_0xdc4a('0x5'));var sox=require('sox');var csv=require(_0xdc4a('0x6'));var ejs=require(_0xdc4a('0x7'));var fs=require('fs');var fs_extra=require(_0xdc4a('0x8'));var _=require(_0xdc4a('0x9'));var squel=require(_0xdc4a('0xa'));var crypto=require(_0xdc4a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdc4a('0xc'));var toCsv=require(_0xdc4a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdc4a('0xd'));var qs=require(_0xdc4a('0xe'));var as=require(_0xdc4a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc4a('0x10'))('api');var utils=require(_0xdc4a('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xdc4a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5712a2,_0x21a86f){_0x21a86f=_0x21a86f||0xcc;return function(_0x3c339c){if(_0x3c339c){return _0x5712a2[_0xdc4a('0x13')](_0x21a86f);}return _0x5712a2[_0xdc4a('0x14')](_0x21a86f)[_0xdc4a('0x15')]();};}function respondWithResult(_0x96b871,_0x4fc2b5){_0x4fc2b5=_0x4fc2b5||0xc8;return function(_0x41f8bf){if(_0x41f8bf){return _0x96b871[_0xdc4a('0x14')](_0x4fc2b5)[_0xdc4a('0x16')](_0x41f8bf);}};}function respondWithFilteredResult(_0x1e6685,_0x44d043){return function(_0x1981e3){if(_0x1981e3){var _0x24b290=typeof _0x44d043[_0xdc4a('0x17')]===_0xdc4a('0x18')&&typeof _0x44d043['limit']==='undefined';var _0x2dba72=_0x1981e3[_0xdc4a('0x19')];var _0x4ab303=_0x24b290?0x0:_0x44d043[_0xdc4a('0x17')];var _0xc7797a=_0x24b290?_0x1981e3['count']:_0x44d043['offset']+_0x44d043[_0xdc4a('0x1a')];var _0x39394c;if(_0xc7797a>=_0x2dba72){_0xc7797a=_0x2dba72;_0x39394c=0xc8;}else{_0x39394c=0xce;}_0x1e6685['status'](_0x39394c);return _0x1e6685[_0xdc4a('0x1b')](_0xdc4a('0x1c'),_0x4ab303+'-'+_0xc7797a+'/'+_0x2dba72)[_0xdc4a('0x16')](_0x1981e3);}return null;};}function patchUpdates(_0x461046){return function(_0x576bd6){try{jsonpatch[_0xdc4a('0x1d')](_0x576bd6,_0x461046,!![]);}catch(_0x3b9dea){return BPromise['reject'](_0x3b9dea);}return _0x576bd6[_0xdc4a('0x1e')]();};}function saveUpdates(_0x513daf,_0x3b0eb9){return function(_0x1d1ce0){if(_0x1d1ce0){return _0x1d1ce0[_0xdc4a('0x1f')](_0x513daf)[_0xdc4a('0x20')](function(_0x2884b8){return _0x2884b8;});}return null;};}function removeEntity(_0x566941,_0x11db05){return function(_0x5cf1cf){if(_0x5cf1cf){return _0x5cf1cf['destroy']()[_0xdc4a('0x20')](function(){_0x566941['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x587800,_0x1a8033){return function(_0x387c8a){if(!_0x387c8a){_0x587800[_0xdc4a('0x13')](0x194);}return _0x387c8a;};}function handleError(_0x4cf1cc,_0x3f89ab){_0x3f89ab=_0x3f89ab||0x1f4;return function(_0x52eaaa){logger[_0xdc4a('0x21')](_0x52eaaa[_0xdc4a('0x22')]);if(_0x52eaaa[_0xdc4a('0x23')]){delete _0x52eaaa[_0xdc4a('0x23')];}_0x4cf1cc[_0xdc4a('0x14')](_0x3f89ab)[_0xdc4a('0x24')](_0x52eaaa);};}exports[_0xdc4a('0x25')]=function(_0x4551be,_0x4ed91a){var _0xa2bc={},_0x5ad3a7={},_0x51dc1e={'count':0x0,'rows':[]};var _0x15d586=_[_0xdc4a('0x26')](db[_0xdc4a('0x27')][_0xdc4a('0x28')],function(_0x42540a){return{'name':_0x42540a['fieldName'],'type':_0x42540a[_0xdc4a('0x29')]['key']};});_0x5ad3a7[_0xdc4a('0x2a')]=_[_0xdc4a('0x26')](_0x15d586,'name');_0x5ad3a7[_0xdc4a('0x2b')]=_['keys'](_0x4551be[_0xdc4a('0x2b')]);_0x5ad3a7[_0xdc4a('0x2c')]=_['intersection'](_0x5ad3a7[_0xdc4a('0x2a')],_0x5ad3a7[_0xdc4a('0x2b')]);_0xa2bc[_0xdc4a('0x2d')]=_['intersection'](_0x5ad3a7['model'],qs[_0xdc4a('0x2e')](_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x2e')]));_0xa2bc[_0xdc4a('0x2d')]=_0xa2bc[_0xdc4a('0x2d')][_0xdc4a('0x2f')]?_0xa2bc[_0xdc4a('0x2d')]:_0x5ad3a7[_0xdc4a('0x2a')];if(!_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x30')]('nolimit')){_0xa2bc[_0xdc4a('0x1a')]=qs[_0xdc4a('0x1a')](_0x4551be[_0xdc4a('0x2b')]['limit']);_0xa2bc[_0xdc4a('0x17')]=qs[_0xdc4a('0x17')](_0x4551be['query'][_0xdc4a('0x17')]);}_0xa2bc['order']=qs['sort'](_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x31')]);_0xa2bc[_0xdc4a('0x32')]=qs[_0xdc4a('0x2c')](_[_0xdc4a('0x33')](_0x4551be[_0xdc4a('0x2b')],_0x5ad3a7[_0xdc4a('0x2c')]),_0x15d586);if(_0x4551be[_0xdc4a('0x2b')]['filter']){_0xa2bc[_0xdc4a('0x32')]=_[_0xdc4a('0x34')](_0xa2bc[_0xdc4a('0x32')],{'$or':_[_0xdc4a('0x26')](_0x15d586,function(_0x16e225){if(_0x16e225[_0xdc4a('0x29')]!==_0xdc4a('0x35')){var _0x5c3a9={};_0x5c3a9[_0x16e225[_0xdc4a('0x23')]]={'$like':'%'+_0x4551be['query'][_0xdc4a('0x36')]+'%'};return _0x5c3a9;}})});}_0xa2bc=_['merge']({},_0xa2bc,_0x4551be[_0xdc4a('0x37')]);var _0x593a24={'where':_0xa2bc[_0xdc4a('0x32')]};return db['Attachment'][_0xdc4a('0x19')](_0x593a24)[_0xdc4a('0x20')](function(_0x16d86a){_0x51dc1e[_0xdc4a('0x19')]=_0x16d86a;if(_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x38')]){_0xa2bc[_0xdc4a('0x39')]=[{'all':!![]}];}return db[_0xdc4a('0x27')][_0xdc4a('0x3a')](_0xa2bc);})['then'](function(_0x1ef02c){_0x51dc1e[_0xdc4a('0x3b')]=_0x1ef02c;return _0x51dc1e;})[_0xdc4a('0x20')](respondWithFilteredResult(_0x4ed91a,_0xa2bc))[_0xdc4a('0x3c')](handleError(_0x4ed91a,null));};exports[_0xdc4a('0x3d')]=function(_0x1a52f7,_0x453c58){var _0x169bfe={'raw':!![],'where':{'id':_0x1a52f7[_0xdc4a('0x3e')]['id']}},_0x5c54c5={};_0x5c54c5['model']=_[_0xdc4a('0x3f')](db[_0xdc4a('0x27')][_0xdc4a('0x28')]);_0x5c54c5['query']=_[_0xdc4a('0x3f')](_0x1a52f7['query']);_0x5c54c5[_0xdc4a('0x2c')]=_[_0xdc4a('0x40')](_0x5c54c5[_0xdc4a('0x2a')],_0x5c54c5[_0xdc4a('0x2b')]);_0x169bfe[_0xdc4a('0x2d')]=_[_0xdc4a('0x40')](_0x5c54c5[_0xdc4a('0x2a')],qs[_0xdc4a('0x2e')](_0x1a52f7[_0xdc4a('0x2b')][_0xdc4a('0x2e')]));_0x169bfe[_0xdc4a('0x2d')]=_0x169bfe[_0xdc4a('0x2d')]['length']?_0x169bfe[_0xdc4a('0x2d')]:_0x5c54c5['model'];if(_0x1a52f7['query'][_0xdc4a('0x38')]){_0x169bfe['include']=[{'all':!![]}];}_0x169bfe=_[_0xdc4a('0x34')]({},_0x169bfe,_0x1a52f7[_0xdc4a('0x37')]);return db[_0xdc4a('0x27')][_0xdc4a('0x41')](_0x169bfe)[_0xdc4a('0x20')](handleEntityNotFound(_0x453c58,null))[_0xdc4a('0x20')](respondWithResult(_0x453c58,null))[_0xdc4a('0x3c')](handleError(_0x453c58,null));};exports[_0xdc4a('0x42')]=function(_0x31e725,_0x54fac0){var _0x1f07cb={'where':{'id':_0x31e725['params']['id']}},_0x2cbb74={};_0x2cbb74[_0xdc4a('0x2a')]=_[_0xdc4a('0x3f')](db[_0xdc4a('0x27')]['rawAttributes']);_0x1f07cb[_0xdc4a('0x2d')]=_[_0xdc4a('0x40')](_0x2cbb74[_0xdc4a('0x2a')],qs[_0xdc4a('0x2e')](_0x31e725[_0xdc4a('0x2b')][_0xdc4a('0x2e')]));_0x1f07cb[_0xdc4a('0x2d')]=_0x1f07cb[_0xdc4a('0x2d')][_0xdc4a('0x2f')]?_0x1f07cb[_0xdc4a('0x2d')]:_0x2cbb74[_0xdc4a('0x2a')];if(_0x31e725[_0xdc4a('0x2b')]['includeAll']){_0x1f07cb[_0xdc4a('0x39')]=[{'all':!![]}];}_0x1f07cb=_[_0xdc4a('0x34')]({},_0x1f07cb,_0x31e725[_0xdc4a('0x37')]);return db['Attachment']['find'](_0x1f07cb)[_0xdc4a('0x20')](handleEntityNotFound(_0x54fac0,null))[_0xdc4a('0x20')](function(_0x1a1b35){if(_0x1a1b35){var _0x5d11a9=_0x1a1b35[_0xdc4a('0x43')]({'plain':!![]});_0x5d11a9=qs[_0xdc4a('0x44')](_0x5d11a9,['id',_0xdc4a('0x45'),_0xdc4a('0x46')]);_0x31e725[_0xdc4a('0x47')]=_['omit'](_0x31e725[_0xdc4a('0x47')],['id',_0xdc4a('0x45'),_0xdc4a('0x46')]);return db[_0xdc4a('0x27')][_0xdc4a('0x48')](_[_0xdc4a('0x34')](_0x5d11a9,_0x31e725[_0xdc4a('0x47')]),{'include':_0x31e725[_0xdc4a('0x2b')][_0xdc4a('0x38')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x54fac0,0xc9))[_0xdc4a('0x3c')](handleError(_0x54fac0,null));};exports[_0xdc4a('0x1f')]=function(_0x557d12,_0xa9a24b){if(_0x557d12['body']['id']){delete _0x557d12[_0xdc4a('0x47')]['id'];}return db[_0xdc4a('0x27')][_0xdc4a('0x41')]({'where':{'id':_0x557d12['params']['id']}})['then'](handleEntityNotFound(_0xa9a24b,null))[_0xdc4a('0x20')](saveUpdates(_0x557d12['body'],null))[_0xdc4a('0x20')](respondWithResult(_0xa9a24b,null))['catch'](handleError(_0xa9a24b,null));};exports[_0xdc4a('0x49')]=function(_0x1e3368,_0x3323b3){return db[_0xdc4a('0x27')][_0xdc4a('0x41')]({'where':{'id':_0x1e3368['params']['id']}})[_0xdc4a('0x20')](handleEntityNotFound(_0x3323b3,null))[_0xdc4a('0x20')](removeEntity(_0x3323b3,null))['catch'](handleError(_0x3323b3,null));};exports[_0xdc4a('0x48')]=function(_0x111e1f,_0x3fe274,_0x46c29e){_0x111e1f['body'][_0xdc4a('0x23')]=_0x111e1f['file'][_0xdc4a('0x4a')];_0x111e1f[_0xdc4a('0x47')]['basename']=_0x111e1f[_0xdc4a('0x4b')][_0xdc4a('0x4c')];_0x111e1f['body'][_0xdc4a('0x29')]=_0x111e1f['file'][_0xdc4a('0x4d')];return db[_0xdc4a('0x27')][_0xdc4a('0x48')](_0x111e1f[_0xdc4a('0x47')])[_0xdc4a('0x20')](respondWithResult(_0x3fe274,0xc9))[_0xdc4a('0x3c')](handleError(_0x3fe274,null));};exports['download']=function(_0x19047d,_0xc72d68,_0x40b5ca){return db[_0xdc4a('0x27')][_0xdc4a('0x4e')]({'where':{'id':_0x19047d[_0xdc4a('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xc72d68,null))[_0xdc4a('0x20')](function(_0x2a0a53){if(_0x2a0a53){var _0x50d01a=_0x2a0a53[_0xdc4a('0x4f')]!==null;var _0x4dc2ad=path[_0xdc4a('0x50')](config[_0xdc4a('0x51')],_0xdc4a('0x52'));if(_0x50d01a){_0x4dc2ad=path[_0xdc4a('0x50')](_0x4dc2ad,_0xdc4a('0x53'));}var _0x450ac4=path[_0xdc4a('0x50')](_0x4dc2ad,_0x2a0a53[_0xdc4a('0x54')]);return _0xc72d68['download'](_0x450ac4);}})[_0xdc4a('0x3c')](handleError(_0xc72d68,null));}; \ No newline at end of file +var _0xcd09=['server/files/attachments/','join','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','api','../../config/utils','../../config/environment','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','sendStatus','stack','name','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','clone','get','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','findOne','root'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0xcd09,0x146));var _0x9cd0=function(_0x4b9806,_0x1517c0){_0x4b9806=_0x4b9806-0x0;var _0x12f4d4=_0xcd09[_0x4b9806];return _0x12f4d4;};'use strict';var emlformat=require(_0x9cd0('0x0'));var rimraf=require(_0x9cd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9cd0('0x2'));var moment=require('moment');var BPromise=require(_0x9cd0('0x3'));var Mustache=require('mustache');var util=require(_0x9cd0('0x4'));var path=require(_0x9cd0('0x5'));var sox=require(_0x9cd0('0x6'));var csv=require(_0x9cd0('0x7'));var ejs=require(_0x9cd0('0x8'));var fs=require('fs');var fs_extra=require(_0x9cd0('0x9'));var _=require(_0x9cd0('0xa'));var squel=require(_0x9cd0('0xb'));var crypto=require(_0x9cd0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9cd0('0xd'));var Redis=require(_0x9cd0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9cd0('0xf'));var utils=require(_0x9cd0('0x10'));var config=require(_0x9cd0('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50125e,_0x5ba17e){_0x5ba17e=_0x5ba17e||0xcc;return function(_0x32f2a6){if(_0x32f2a6){return _0x50125e['sendStatus'](_0x5ba17e);}return _0x50125e[_0x9cd0('0x12')](_0x5ba17e)['end']();};}function respondWithResult(_0x4d3e52,_0x49af7f){_0x49af7f=_0x49af7f||0xc8;return function(_0x3f46f8){if(_0x3f46f8){return _0x4d3e52['status'](_0x49af7f)[_0x9cd0('0x13')](_0x3f46f8);}};}function respondWithFilteredResult(_0x3087bf,_0x10e357){return function(_0x1b9dba){if(_0x1b9dba){var _0x56eb29=typeof _0x10e357['offset']===_0x9cd0('0x14')&&typeof _0x10e357[_0x9cd0('0x15')]===_0x9cd0('0x14');var _0x1c27a0=_0x1b9dba[_0x9cd0('0x16')];var _0x46f1eb=_0x56eb29?0x0:_0x10e357[_0x9cd0('0x17')];var _0xcd9223=_0x56eb29?_0x1b9dba[_0x9cd0('0x16')]:_0x10e357[_0x9cd0('0x17')]+_0x10e357[_0x9cd0('0x15')];var _0x42bd72;if(_0xcd9223>=_0x1c27a0){_0xcd9223=_0x1c27a0;_0x42bd72=0xc8;}else{_0x42bd72=0xce;}_0x3087bf[_0x9cd0('0x12')](_0x42bd72);return _0x3087bf[_0x9cd0('0x18')](_0x9cd0('0x19'),_0x46f1eb+'-'+_0xcd9223+'/'+_0x1c27a0)[_0x9cd0('0x13')](_0x1b9dba);}return null;};}function patchUpdates(_0x102a21){return function(_0x5041bd){try{jsonpatch[_0x9cd0('0x1a')](_0x5041bd,_0x102a21,!![]);}catch(_0x1b3f36){return BPromise['reject'](_0x1b3f36);}return _0x5041bd[_0x9cd0('0x1b')]();};}function saveUpdates(_0x1ef0a2,_0x129660){return function(_0x418a3a){if(_0x418a3a){return _0x418a3a['update'](_0x1ef0a2)[_0x9cd0('0x1c')](function(_0x4c62a7){return _0x4c62a7;});}return null;};}function removeEntity(_0x5c39b7,_0x44b83c){return function(_0x52697a){if(_0x52697a){return _0x52697a[_0x9cd0('0x1d')]()[_0x9cd0('0x1c')](function(){_0x5c39b7[_0x9cd0('0x12')](0xcc)[_0x9cd0('0x1e')]();});}};}function handleEntityNotFound(_0x51dee5,_0x3e3cc9){return function(_0x4cb856){if(!_0x4cb856){_0x51dee5[_0x9cd0('0x1f')](0x194);}return _0x4cb856;};}function handleError(_0x5cfd36,_0x11b0fe){_0x11b0fe=_0x11b0fe||0x1f4;return function(_0x50e319){logger['error'](_0x50e319[_0x9cd0('0x20')]);if(_0x50e319[_0x9cd0('0x21')]){delete _0x50e319['name'];}_0x5cfd36[_0x9cd0('0x12')](_0x11b0fe)['send'](_0x50e319);};}exports[_0x9cd0('0x22')]=function(_0x2c7d17,_0x583597){var _0x3216de={},_0x1c4591={},_0x537b51={'count':0x0,'rows':[]};var _0x59dec4=_['map'](db[_0x9cd0('0x23')][_0x9cd0('0x24')],function(_0x499d03){return{'name':_0x499d03[_0x9cd0('0x25')],'type':_0x499d03[_0x9cd0('0x26')]['key']};});_0x1c4591[_0x9cd0('0x27')]=_[_0x9cd0('0x28')](_0x59dec4,_0x9cd0('0x21'));_0x1c4591[_0x9cd0('0x29')]=_[_0x9cd0('0x2a')](_0x2c7d17['query']);_0x1c4591[_0x9cd0('0x2b')]=_[_0x9cd0('0x2c')](_0x1c4591[_0x9cd0('0x27')],_0x1c4591[_0x9cd0('0x29')]);_0x3216de[_0x9cd0('0x2d')]=_[_0x9cd0('0x2c')](_0x1c4591[_0x9cd0('0x27')],qs[_0x9cd0('0x2e')](_0x2c7d17[_0x9cd0('0x29')]['fields']));_0x3216de['attributes']=_0x3216de['attributes'][_0x9cd0('0x2f')]?_0x3216de[_0x9cd0('0x2d')]:_0x1c4591['model'];if(!_0x2c7d17['query'][_0x9cd0('0x30')](_0x9cd0('0x31'))){_0x3216de[_0x9cd0('0x15')]=qs['limit'](_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x15')]);_0x3216de[_0x9cd0('0x17')]=qs[_0x9cd0('0x17')](_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x17')]);}_0x3216de[_0x9cd0('0x32')]=qs[_0x9cd0('0x33')](_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x33')]);_0x3216de[_0x9cd0('0x34')]=qs['filters'](_[_0x9cd0('0x35')](_0x2c7d17[_0x9cd0('0x29')],_0x1c4591['filters']),_0x59dec4);if(_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x36')]){_0x3216de[_0x9cd0('0x34')]=_['merge'](_0x3216de[_0x9cd0('0x34')],{'$or':_[_0x9cd0('0x28')](_0x59dec4,function(_0x3f1bf3){if(_0x3f1bf3[_0x9cd0('0x26')]!=='VIRTUAL'){var _0x4b6ec={};_0x4b6ec[_0x3f1bf3[_0x9cd0('0x21')]]={'$like':'%'+_0x2c7d17[_0x9cd0('0x29')]['filter']+'%'};return _0x4b6ec;}})});}_0x3216de=_[_0x9cd0('0x37')]({},_0x3216de,_0x2c7d17[_0x9cd0('0x38')]);var _0x41749f={'where':_0x3216de[_0x9cd0('0x34')]};return db['Attachment'][_0x9cd0('0x16')](_0x41749f)[_0x9cd0('0x1c')](function(_0x3ad458){_0x537b51['count']=_0x3ad458;if(_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x39')]){_0x3216de[_0x9cd0('0x3a')]=[{'all':!![]}];}return db[_0x9cd0('0x23')][_0x9cd0('0x3b')](_0x3216de);})[_0x9cd0('0x1c')](function(_0x45b468){_0x537b51[_0x9cd0('0x3c')]=_0x45b468;return _0x537b51;})[_0x9cd0('0x1c')](respondWithFilteredResult(_0x583597,_0x3216de))[_0x9cd0('0x3d')](handleError(_0x583597,null));};exports['show']=function(_0x438cc7,_0x9a7855){var _0x4ab421={'raw':!![],'where':{'id':_0x438cc7[_0x9cd0('0x3e')]['id']}},_0x589c69={};_0x589c69[_0x9cd0('0x27')]=_[_0x9cd0('0x2a')](db[_0x9cd0('0x23')][_0x9cd0('0x24')]);_0x589c69['query']=_[_0x9cd0('0x2a')](_0x438cc7['query']);_0x589c69[_0x9cd0('0x2b')]=_[_0x9cd0('0x2c')](_0x589c69[_0x9cd0('0x27')],_0x589c69[_0x9cd0('0x29')]);_0x4ab421[_0x9cd0('0x2d')]=_[_0x9cd0('0x2c')](_0x589c69[_0x9cd0('0x27')],qs[_0x9cd0('0x2e')](_0x438cc7[_0x9cd0('0x29')]['fields']));_0x4ab421[_0x9cd0('0x2d')]=_0x4ab421['attributes'][_0x9cd0('0x2f')]?_0x4ab421[_0x9cd0('0x2d')]:_0x589c69[_0x9cd0('0x27')];if(_0x438cc7[_0x9cd0('0x29')][_0x9cd0('0x39')]){_0x4ab421[_0x9cd0('0x3a')]=[{'all':!![]}];}_0x4ab421=_[_0x9cd0('0x37')]({},_0x4ab421,_0x438cc7[_0x9cd0('0x38')]);return db['Attachment'][_0x9cd0('0x3f')](_0x4ab421)[_0x9cd0('0x1c')](handleEntityNotFound(_0x9a7855,null))[_0x9cd0('0x1c')](respondWithResult(_0x9a7855,null))[_0x9cd0('0x3d')](handleError(_0x9a7855,null));};exports[_0x9cd0('0x40')]=function(_0xf724c5,_0x3268d4){var _0x8531e6={'where':{'id':_0xf724c5['params']['id']}},_0x241b69={};_0x241b69[_0x9cd0('0x27')]=_[_0x9cd0('0x2a')](db['Attachment']['rawAttributes']);_0x8531e6[_0x9cd0('0x2d')]=_[_0x9cd0('0x2c')](_0x241b69[_0x9cd0('0x27')],qs[_0x9cd0('0x2e')](_0xf724c5[_0x9cd0('0x29')][_0x9cd0('0x2e')]));_0x8531e6[_0x9cd0('0x2d')]=_0x8531e6[_0x9cd0('0x2d')][_0x9cd0('0x2f')]?_0x8531e6[_0x9cd0('0x2d')]:_0x241b69[_0x9cd0('0x27')];if(_0xf724c5[_0x9cd0('0x29')]['includeAll']){_0x8531e6[_0x9cd0('0x3a')]=[{'all':!![]}];}_0x8531e6=_[_0x9cd0('0x37')]({},_0x8531e6,_0xf724c5['options']);return db[_0x9cd0('0x23')]['find'](_0x8531e6)[_0x9cd0('0x1c')](handleEntityNotFound(_0x3268d4,null))[_0x9cd0('0x1c')](function(_0x2e0cc4){if(_0x2e0cc4){var _0x246c85=_0x2e0cc4[_0x9cd0('0x41')]({'plain':!![]});_0x246c85=qs[_0x9cd0('0x42')](_0x246c85,['id',_0x9cd0('0x43'),_0x9cd0('0x44')]);_0xf724c5[_0x9cd0('0x45')]=_[_0x9cd0('0x42')](_0xf724c5[_0x9cd0('0x45')],['id',_0x9cd0('0x43'),_0x9cd0('0x44')]);return db['Attachment']['create'](_['merge'](_0x246c85,_0xf724c5[_0x9cd0('0x45')]),{'include':_0xf724c5[_0x9cd0('0x29')][_0x9cd0('0x39')]?[{'all':!![]}]:undefined});}})[_0x9cd0('0x1c')](respondWithResult(_0x3268d4,0xc9))['catch'](handleError(_0x3268d4,null));};exports[_0x9cd0('0x46')]=function(_0x965d9f,_0x4ff14f){if(_0x965d9f['body']['id']){delete _0x965d9f[_0x9cd0('0x45')]['id'];}return db[_0x9cd0('0x23')][_0x9cd0('0x3f')]({'where':{'id':_0x965d9f[_0x9cd0('0x3e')]['id']}})[_0x9cd0('0x1c')](handleEntityNotFound(_0x4ff14f,null))[_0x9cd0('0x1c')](saveUpdates(_0x965d9f[_0x9cd0('0x45')],null))[_0x9cd0('0x1c')](respondWithResult(_0x4ff14f,null))[_0x9cd0('0x3d')](handleError(_0x4ff14f,null));};exports['destroy']=function(_0x35fe31,_0x5c0a6f){return db[_0x9cd0('0x23')][_0x9cd0('0x3f')]({'where':{'id':_0x35fe31[_0x9cd0('0x3e')]['id']}})[_0x9cd0('0x1c')](handleEntityNotFound(_0x5c0a6f,null))['then'](removeEntity(_0x5c0a6f,null))[_0x9cd0('0x3d')](handleError(_0x5c0a6f,null));};exports[_0x9cd0('0x47')]=function(_0x414eb4,_0x5daa2f,_0x83af03){_0x414eb4[_0x9cd0('0x45')][_0x9cd0('0x21')]=_0x414eb4[_0x9cd0('0x48')][_0x9cd0('0x49')];_0x414eb4[_0x9cd0('0x45')][_0x9cd0('0x4a')]=_0x414eb4['file'][_0x9cd0('0x4b')];_0x414eb4['body'][_0x9cd0('0x26')]=_0x414eb4[_0x9cd0('0x48')][_0x9cd0('0x4c')];return db[_0x9cd0('0x23')][_0x9cd0('0x47')](_0x414eb4[_0x9cd0('0x45')])[_0x9cd0('0x1c')](respondWithResult(_0x5daa2f,0xc9))['catch'](handleError(_0x5daa2f,null));};exports['download']=function(_0x2f09d6,_0x10c9c2,_0x5d9832){return db['Attachment'][_0x9cd0('0x4d')]({'where':{'id':_0x2f09d6[_0x9cd0('0x3e')]['id']},'raw':!![]})[_0x9cd0('0x1c')](handleEntityNotFound(_0x10c9c2,null))[_0x9cd0('0x1c')](function(_0x3bd1d1){if(_0x3bd1d1){var _0x15a351=_0x3bd1d1['ChatOfflineMessageId']!==null;var _0x50e1dc=path['join'](config[_0x9cd0('0x4e')],_0x9cd0('0x4f'));if(_0x15a351){_0x50e1dc=path['join'](_0x50e1dc,'offline-chat/');}var _0xe33c6a=path[_0x9cd0('0x50')](_0x50e1dc,_0x3bd1d1[_0x9cd0('0x4a')]);return _0x10c9c2['download'](_0xe33c6a);}})[_0x9cd0('0x3d')](handleError(_0x10c9c2,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 204f77c..8182b62 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 _0xb0ec=['./attachment.attributes','exports','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3441e9,_0x269c8a){var _0x7f9ada=function(_0x4e62fd){while(--_0x4e62fd){_0x3441e9['push'](_0x3441e9['shift']());}};_0x7f9ada(++_0x269c8a);}(_0xb0ec,0x1f2));var _0xcb0e=function(_0x449c1f,_0x535bdb){_0x449c1f=_0x449c1f-0x0;var _0x1167e1=_0xb0ec[_0x449c1f];return _0x1167e1;};'use strict';var _=require(_0xcb0e('0x0'));var util=require(_0xcb0e('0x1'));var logger=require(_0xcb0e('0x2'))('api');var moment=require(_0xcb0e('0x3'));var BPromise=require(_0xcb0e('0x4'));var rp=require(_0xcb0e('0x5'));var fs=require('fs');var path=require(_0xcb0e('0x6'));var rimraf=require('rimraf');var config=require(_0xcb0e('0x7'));var attributes=require(_0xcb0e('0x8'));module[_0xcb0e('0x9')]=function(_0x42ec6d,_0x419391){return _0x42ec6d['define']('Attachment',attributes,{'tableName':_0xcb0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2e2=['bluebird','path','rimraf','../../config/environment','exports','define','attachments','util','../../config/logger','api','moment'];(function(_0x4547d5,_0x91d898){var _0x81ad1f=function(_0x593655){while(--_0x593655){_0x4547d5['push'](_0x4547d5['shift']());}};_0x81ad1f(++_0x91d898);}(_0xe2e2,0x10f));var _0x2e2e=function(_0x3b6413,_0x46403a){_0x3b6413=_0x3b6413-0x0;var _0x3da71a=_0xe2e2[_0x3b6413];return _0x3da71a;};'use strict';var _=require('lodash');var util=require(_0x2e2e('0x0'));var logger=require(_0x2e2e('0x1'))(_0x2e2e('0x2'));var moment=require(_0x2e2e('0x3'));var BPromise=require(_0x2e2e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e2e('0x5'));var rimraf=require(_0x2e2e('0x6'));var config=require(_0x2e2e('0x7'));var attributes=require('./attachment.attributes');module[_0x2e2e('0x8')]=function(_0x2ada93,_0x5e25ed){return _0x2ada93[_0x2e2e('0x9')]('Attachment',attributes,{'tableName':_0x2e2e('0xa'),'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 afa15f5..fedac5c 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 _0x131e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','Attachment,\x20%s,\x20%s','catch','Attachment','create','options','raw','CreateAttachment','bluebird','randomstring'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x131e,0x1ec));var _0xe131=function(_0x5ab086,_0x416037){_0x5ab086=_0x5ab086-0x0;var _0x44d263=_0x131e[_0x5ab086];return _0x44d263;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe131('0x0'));var rs=require(_0xe131('0x1'));var fs=require('fs');var Redis=require(_0xe131('0x2'));var db=require(_0xe131('0x3'))['db'];var utils=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('rpc');var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')][_0xe131('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1002a6,_0x48a90e,_0x5c4eb5){return new BPromise(function(_0x562617,_0x4bf386){return client[_0xe131('0xa')](_0x1002a6,_0x5c4eb5)[_0xe131('0xb')](function(_0x530ecb){logger[_0xe131('0xc')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0xe131('0xd'));logger[_0xe131('0xe')](_0xe131('0xf'),_0x48a90e,_0xe131('0xd'),JSON[_0xe131('0x10')](_0x530ecb));if(_0x530ecb[_0xe131('0x11')]){if(_0x530ecb[_0xe131('0x11')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x48a90e,_0x530ecb['error'][_0xe131('0x12')]);return _0x4bf386(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}logger[_0xe131('0x11')](_0xe131('0x13'),_0x48a90e,_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);return _0x562617(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x48a90e,'request\x20sent');_0x562617(_0x530ecb['result']['message']);}})[_0xe131('0x14')](function(_0x32091b){logger[_0xe131('0x11')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0x32091b);_0x4bf386(_0x32091b);});});}exports['CreateAttachment']=function(_0x400f6b){var _0x2e2bf8=this;return new Promise(function(_0x3bbca8,_0x1a1e03){return db[_0xe131('0x15')][_0xe131('0x16')](_0x400f6b['body'],{'raw':_0x400f6b[_0xe131('0x17')]?_0x400f6b[_0xe131('0x17')][_0xe131('0x18')]===undefined?!![]:![]:!![]})[_0xe131('0xb')](function(_0x2d6c6b){logger['info']('CreateAttachment',_0x400f6b);logger[_0xe131('0xe')](_0xe131('0x19'),_0x400f6b,JSON['stringify'](_0x2d6c6b));_0x3bbca8(_0x2d6c6b);})[_0xe131('0x14')](function(_0x55b0c5){logger['error'](_0xe131('0x19'),_0x55b0c5[_0xe131('0x12')],_0x400f6b);_0x1a1e03(_0x2e2bf8[_0xe131('0x11')](0x1f4,_0x55b0c5[_0xe131('0x12')]));});});}; \ No newline at end of file +var _0x3a25=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3c29bd,_0x3b2dd){var _0x451ecd=function(_0x2b6033){while(--_0x2b6033){_0x3c29bd['push'](_0x3c29bd['shift']());}};_0x451ecd(++_0x3b2dd);}(_0x3a25,0x15d));var _0x53a2=function(_0x23fc84,_0x2faf64){_0x23fc84=_0x23fc84-0x0;var _0x81fb8=_0x3a25[_0x23fc84];return _0x81fb8;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var moment=require(_0x53a2('0x2'));var BPromise=require(_0x53a2('0x3'));var rs=require(_0x53a2('0x4'));var fs=require('fs');var Redis=require(_0x53a2('0x5'));var db=require(_0x53a2('0x6'))['db'];var utils=require(_0x53a2('0x7'));var logger=require(_0x53a2('0x8'))(_0x53a2('0x9'));var config=require(_0x53a2('0xa'));var jayson=require(_0x53a2('0xb'));var client=jayson[_0x53a2('0xc')][_0x53a2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409fff,_0x4d53b8,_0x3ee956){return new BPromise(function(_0x5dc70e,_0x17aa09){return client[_0x53a2('0xe')](_0x409fff,_0x3ee956)[_0x53a2('0xf')](function(_0x42bf42){logger[_0x53a2('0x10')](_0x53a2('0x11'),_0x4d53b8,_0x53a2('0x12'));logger[_0x53a2('0x13')](_0x53a2('0x14'),_0x4d53b8,_0x53a2('0x12'),JSON['stringify'](_0x42bf42));if(_0x42bf42['error']){if(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x16')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x17aa09(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x5dc70e(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}else{logger[_0x53a2('0x10')]('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x53a2('0x12'));_0x5dc70e(_0x42bf42[_0x53a2('0x18')][_0x53a2('0x17')]);}})[_0x53a2('0x19')](function(_0x34c7de){logger['error']('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x34c7de);_0x17aa09(_0x34c7de);});});}exports[_0x53a2('0x1a')]=function(_0x446b71){var _0x443c6e=this;return new Promise(function(_0x104fb6,_0x1d23f2){return db[_0x53a2('0x1b')]['create'](_0x446b71['body'],{'raw':_0x446b71[_0x53a2('0x1c')]?_0x446b71[_0x53a2('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x53a2('0xf')](function(_0x3fb15b){logger[_0x53a2('0x10')](_0x53a2('0x1a'),_0x446b71);logger['debug'](_0x53a2('0x1a'),_0x446b71,JSON[_0x53a2('0x1d')](_0x3fb15b));_0x104fb6(_0x3fb15b);})[_0x53a2('0x19')](function(_0x2cda68){logger[_0x53a2('0x15')](_0x53a2('0x1a'),_0x2cda68[_0x53a2('0x17')],_0x446b71);_0x1d23f2(_0x443c6e[_0x53a2('0x15')](0x1f4,_0x2cda68['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 945284f..b2ba38f 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f109c,_0xd9952e){_0x1f109c=_0x1f109c-0x0;var _0x3984e8=_0x0b0e[_0x1f109c];return _0x3984e8;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 1bd57a3..fc07271 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 _0xea1e=['minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','name','add'];(function(_0x179b61,_0x25ea0a){var _0x267877=function(_0x52973f){while(--_0x52973f){_0x179b61['push'](_0x179b61['shift']());}};_0x267877(++_0x25ea0a);}(_0xea1e,0x1e2));var _0xeea1=function(_0x19f424,_0x2cfb24){_0x19f424=_0x19f424-0x0;var _0x36977b=_0xea1e[_0x19f424];return _0x36977b;};'use strict';var passport=require(_0xeea1('0x0'));var LocalStrategy=require(_0xeea1('0x1'))['Strategy'];var moment=require(_0xeea1('0x2'));var ActiveDirectory=require(_0xeea1('0x3'));var BPromise=require(_0xeea1('0x4'));var util=require(_0xeea1('0x5'));var db=require(_0xeea1('0x6'))['db'];var authService=require(_0xeea1('0x7'));var utils=require(_0xeea1('0x8'));var config=require(_0xeea1('0x9'));var logger=require(_0xeea1('0xa'))(_0xeea1('0xb'));function isActiveDirectoryConfigured(_0x1b1047){var _0x36e1f0=![];if(typeof _0x1b1047[_0xeea1('0xc')]!==_0xeea1('0xd')){_0x36e1f0=_0x1b1047[_0xeea1('0xc')]['baseDN']&&_0x1b1047[_0xeea1('0xc')][_0xeea1('0xe')]&&_0x1b1047[_0xeea1('0xc')][_0xeea1('0xf')];}return _0x36e1f0;}function adAuthenticate(_0x238700,_0x406090,_0x5b0278){return new BPromise(function(_0x342b3f,_0x5875a5){try{var _0x48860c=new ActiveDirectory(_0x238700);_0x48860c[_0xeea1('0x10')](_0x406090,_0x5b0278,function(_0x3cee1b,_0x7414d9){if(_0x3cee1b){logger[_0xeea1('0x11')](_0xeea1('0x12'),_0x406090,util['inspect'](_0x3cee1b,{'showHidden':![],'depth':null}));_0x5875a5(_0xeea1('0x13'));}else if(!_0x7414d9){logger[_0xeea1('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x406090);_0x5875a5(_0xeea1('0x13'));}else{_0x342b3f(_0x7414d9);}});}catch(_0x1e4560){_0x5875a5(_0x1e4560);}});}function ActiveDirectoryAuthenticate(_0x2345ff,_0x326d3b,_0xf27be2,_0x1d0ccc){var _0x249f9f,_0x48ecdd;if(!isActiveDirectoryConfigured(config)){logger[_0xeea1('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x326d3b);return _0x1d0ccc(null,![],{'message':_0xeea1('0x13')});}return db[_0xeea1('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xeea1('0x15'),_0xeea1('0x16')],'raw':!![]})[_0xeea1('0x17')](function(_0x48b9c7){_0x249f9f=_0x48b9c7;if(!_0x249f9f[_0xeea1('0x15')]){logger['error'](_0xeea1('0x18'),_0x326d3b);throw new Error(_0xeea1('0x13'));}return _0x2345ff[_0xeea1('0x19')]({'attributes':['id','name',_0xeea1('0x1a'),_0xeea1('0x1b'),_0xeea1('0x1c'),_0xeea1('0x1d'),_0xeea1('0x1e'),_0xeea1('0x1f'),_0xeea1('0x20')],'where':{'name':_0x326d3b,'role':{'$or':[_0xeea1('0x21'),_0xeea1('0x22'),_0xeea1('0x23')]},'adSsoEnabled':!![]}});})[_0xeea1('0x17')](function(_0x534b71){if(!_0x534b71||_0x534b71&&_0x534b71[_0xeea1('0x24')]!==_0x326d3b){throw new Error(_0xeea1('0x13'));}_0x48ecdd=_0x534b71;var _0x4d50cb=_0x48ecdd['name']+'@'+config[_0xeea1('0xc')][_0xeea1('0xf')];return adAuthenticate(config[_0xeea1('0xc')],_0x4d50cb,_0xf27be2);})[_0xeea1('0x17')](function(_0x1604ff){if(_0x48ecdd[_0xeea1('0x1d')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x249f9f[_0xeea1('0x16')]>0x0){if(_0x48ecdd[_0xeea1('0x1e')]){if(moment(_0x48ecdd[_0xeea1('0x1f')])[_0xeea1('0x25')](_0x249f9f[_0xeea1('0x16')],_0xeea1('0x26'))>moment()){throw new Error(_0xeea1('0x13'));}return utils[_0xeea1('0x27')](_0x48ecdd,0x0,![],null)[_0xeea1('0x17')](function(){return utils['getLicense'](_0x48ecdd);})[_0xeea1('0x17')](function(){return _0x1d0ccc(null,_0x48ecdd);});}else{return utils['getLicense'](_0x48ecdd)['then'](function(){return _0x1d0ccc(null,_0x48ecdd);});}}else{return utils[_0xeea1('0x28')](_0x48ecdd)[_0xeea1('0x17')](function(){return _0x1d0ccc(null,_0x48ecdd);});}})[_0xeea1('0x29')](function(_0x45b8ff){return _0x1d0ccc(null,![],_0x45b8ff);});}function handleError(_0x44c26b,_0x4170b8,_0x3c1de8){return _0x44c26b[_0xeea1('0x2a')](_0x4170b8||0x1f4)[_0xeea1('0x2b')]({'message':_0x3c1de8?_0x3c1de8[_0xeea1('0x2c')]||_0x3c1de8:''});}exports[_0xeea1('0x2d')]=function(_0x4554a7,_0x44f98e,_0x20607d){passport[_0xeea1('0x10')](_0xeea1('0x2e'),function(_0xca38f2,_0x4cb210,_0x4a7d88){var _0xaae880=_0xca38f2||_0x4a7d88;if(_0xaae880){return handleError(_0x44f98e,0x191,_0xaae880);}if(!_0x4cb210){return handleError(_0x44f98e,0x194,{'message':_0xeea1('0x2f')});}else{var _0x1bbaed={'payload':{'id':_0x4cb210['id'],'role':_0x4cb210[_0xeea1('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xeea1('0x30')](_0x1bbaed)[_0xeea1('0x17')](function(_0x7a899e){_0x44f98e[_0xeea1('0x31')]({'id':_0x4cb210['id'],'token':_0x7a899e,'statusCall':'','isAlreadyLogged':_0x4cb210[_0xeea1('0x20')]});});}})(_0x4554a7,_0x44f98e,_0x20607d);};passport[_0xeea1('0x32')](_0xeea1('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x4c8449,_0x205b2e,_0x436e3d){return ActiveDirectoryAuthenticate(db[_0xeea1('0x33')],_0x4c8449,_0x205b2e,_0x436e3d);})); \ No newline at end of file +var _0x229e=['activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','blockDuration','then','adSsoEnabled','password','role','blocked','blockedAt','admin','agent','name','disabled','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','moment'];(function(_0x2dc954,_0xd124a){var _0x4dd96a=function(_0x3084f2){while(--_0x3084f2){_0x2dc954['push'](_0x2dc954['shift']());}};_0x4dd96a(++_0xd124a);}(_0x229e,0x12f));var _0xe229=function(_0x46b96d,_0x261e67){_0x46b96d=_0x46b96d-0x0;var _0x1a60e2=_0x229e[_0x46b96d];return _0x1a60e2;};'use strict';var passport=require(_0xe229('0x0'));var LocalStrategy=require(_0xe229('0x1'))['Strategy'];var moment=require(_0xe229('0x2'));var ActiveDirectory=require(_0xe229('0x3'));var BPromise=require(_0xe229('0x4'));var util=require(_0xe229('0x5'));var db=require(_0xe229('0x6'))['db'];var authService=require(_0xe229('0x7'));var utils=require(_0xe229('0x8'));var config=require(_0xe229('0x9'));var logger=require(_0xe229('0xa'))(_0xe229('0xb'));function isActiveDirectoryConfigured(_0x1d55e0){var _0x109044=![];if(typeof _0x1d55e0[_0xe229('0xc')]!==_0xe229('0xd')){_0x109044=_0x1d55e0[_0xe229('0xc')][_0xe229('0xe')]&&_0x1d55e0['activedirectory'][_0xe229('0xf')]&&_0x1d55e0['activedirectory'][_0xe229('0x10')];}return _0x109044;}function adAuthenticate(_0x3efa43,_0xa8197c,_0x52980e){return new BPromise(function(_0xb577b9,_0x331a41){try{var _0x1b8ae5=new ActiveDirectory(_0x3efa43);_0x1b8ae5['authenticate'](_0xa8197c,_0x52980e,function(_0x69c952,_0x499a7d){if(_0x69c952){logger[_0xe229('0x11')](_0xe229('0x12'),_0xa8197c,util[_0xe229('0x13')](_0x69c952,{'showHidden':![],'depth':null}));_0x331a41('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x499a7d){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xa8197c);_0x331a41('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xb577b9(_0x499a7d);}});}catch(_0xd0c4ef){_0x331a41(_0xd0c4ef);}});}function ActiveDirectoryAuthenticate(_0x462808,_0x54b4e4,_0x239a29,_0x2d2102){var _0x24eb1b,_0x3f8d1e;if(!isActiveDirectoryConfigured(config)){logger[_0xe229('0x11')](_0xe229('0x14'),_0x54b4e4);return _0x2d2102(null,![],{'message':_0xe229('0x15')});}return db[_0xe229('0x16')][_0xe229('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xe229('0x18')],'raw':!![]})[_0xe229('0x19')](function(_0x58f7c5){_0x24eb1b=_0x58f7c5;if(!_0x24eb1b[_0xe229('0x1a')]){logger[_0xe229('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x54b4e4);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x462808[_0xe229('0x17')]({'attributes':['id','name',_0xe229('0x1b'),'salt',_0xe229('0x1c'),'disabled',_0xe229('0x1d'),_0xe229('0x1e'),'online'],'where':{'name':_0x54b4e4,'role':{'$or':[_0xe229('0x1f'),'user',_0xe229('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x2bc8b3){if(!_0x2bc8b3||_0x2bc8b3&&_0x2bc8b3[_0xe229('0x21')]!==_0x54b4e4){throw new Error(_0xe229('0x15'));}_0x3f8d1e=_0x2bc8b3;var _0x14c927=_0x3f8d1e[_0xe229('0x21')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xe229('0xc')],_0x14c927,_0x239a29);})[_0xe229('0x19')](function(_0x466c05){if(_0x3f8d1e[_0xe229('0x22')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x24eb1b['blockDuration']>0x0){if(_0x3f8d1e[_0xe229('0x1d')]){if(moment(_0x3f8d1e[_0xe229('0x1e')])[_0xe229('0x23')](_0x24eb1b[_0xe229('0x18')],_0xe229('0x24'))>moment()){throw new Error(_0xe229('0x15'));}return utils[_0xe229('0x25')](_0x3f8d1e,0x0,![],null)['then'](function(){return utils[_0xe229('0x26')](_0x3f8d1e);})[_0xe229('0x19')](function(){return _0x2d2102(null,_0x3f8d1e);});}else{return utils['getLicense'](_0x3f8d1e)[_0xe229('0x19')](function(){return _0x2d2102(null,_0x3f8d1e);});}}else{return utils[_0xe229('0x26')](_0x3f8d1e)[_0xe229('0x19')](function(){return _0x2d2102(null,_0x3f8d1e);});}})[_0xe229('0x27')](function(_0x5a8d5b){return _0x2d2102(null,![],_0x5a8d5b);});}function handleError(_0x44be0e,_0x2aedef,_0x2a429a){return _0x44be0e[_0xe229('0x28')](_0x2aedef||0x1f4)[_0xe229('0x29')]({'message':_0x2a429a?_0x2a429a[_0xe229('0x2a')]||_0x2a429a:''});}exports[_0xe229('0x2b')]=function(_0x2a5977,_0x3d532c,_0xe2c571){passport[_0xe229('0x2c')](_0xe229('0x2d'),function(_0x315fd8,_0x4eeb5b,_0x516ec2){var _0x2734a0=_0x315fd8||_0x516ec2;if(_0x2734a0){return handleError(_0x3d532c,0x191,_0x2734a0);}if(!_0x4eeb5b){return handleError(_0x3d532c,0x194,{'message':_0xe229('0x2e')});}else{var _0x4a48eb={'payload':{'id':_0x4eeb5b['id'],'role':_0x4eeb5b['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4a48eb)[_0xe229('0x19')](function(_0x582589){_0x3d532c[_0xe229('0x2f')]({'id':_0x4eeb5b['id'],'token':_0x582589,'statusCall':'','isAlreadyLogged':_0x4eeb5b[_0xe229('0x30')]});});}})(_0x2a5977,_0x3d532c,_0xe2c571);};passport[_0xe229('0x31')](_0xe229('0x2d'),new LocalStrategy({'usernameField':_0xe229('0x21'),'passwordField':_0xe229('0x1b')},function(_0x570b0c,_0x589078,_0x1465fc){return ActiveDirectoryAuthenticate(db[_0xe229('0x32')],_0x570b0c,_0x589078,_0x1465fc);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index ece38da..11bd273 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 _0xb0e1=['Router','./authActiveDirectory.controller','login','express'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0xb0e1,0x1bf));var _0x1b0e=function(_0x22e482,_0x84f6fa){_0x22e482=_0x22e482-0x0;var _0x422831=_0xb0e1[_0x22e482];return _0x422831;};'use strict';var express=require(_0x1b0e('0x0'));var router=express[_0x1b0e('0x1')]();var controller=require(_0x1b0e('0x2'));router['post']('/',controller[_0x1b0e('0x3')]);module['exports']=router; \ No newline at end of file +var _0x9b0a=['./authActiveDirectory.controller','post','exports'];(function(_0x4e59ea,_0x3a9ec7){var _0x59e499=function(_0x212203){while(--_0x212203){_0x4e59ea['push'](_0x4e59ea['shift']());}};_0x59e499(++_0x3a9ec7);}(_0x9b0a,0x19e));var _0xa9b0=function(_0x1a7fa7,_0x231925){_0x1a7fa7=_0x1a7fa7-0x0;var _0x4051de=_0x9b0a[_0x1a7fa7];return _0x4051de;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa9b0('0x0'));router[_0xa9b0('0x1')]('/',controller['login']);module[_0xa9b0('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ba1dd2e..6526e5c 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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x123c18,_0x19fcbf){_0x123c18=_0x123c18-0x0;var _0x245224=_0x7a54[_0x123c18];return _0x245224;};'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(_0x58f8d3,_0x4cfe56){var _0x32c52b=function(_0x5203d8){while(--_0x5203d8){_0x58f8d3['push'](_0x58f8d3['shift']());}};_0x32c52b(++_0x4cfe56);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 7183a7e..9090024 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 _0x5146=['../user/user.controller.js','../../components/auth/service','get','setTokenCookie','express','passport','Router'];(function(_0x5a3b69,_0xe3f11e){var _0x3bf016=function(_0x270344){while(--_0x270344){_0x5a3b69['push'](_0x5a3b69['shift']());}};_0x3bf016(++_0xe3f11e);}(_0x5146,0xc8));var _0x6514=function(_0x25fa85,_0x41e865){_0x25fa85=_0x25fa85-0x0;var _0x2fbfc4=_0x5146[_0x25fa85];return _0x2fbfc4;};'use strict';var express=require(_0x6514('0x0'));var passport=require(_0x6514('0x1'));var router=express[_0x6514('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x6514('0x3'));var authService=require(_0x6514('0x4'));router[_0x6514('0x5')]('/',controller['login']);router['get']('/callback',controller['callback'],authService['isMiddleware'],userController['login'],authService[_0x6514('0x6')]);module['exports']=router; \ No newline at end of file +var _0x786b=['passport','Router','../user/user.controller.js','../../components/auth/service','get','login','setTokenCookie','exports','express'];(function(_0x2608f2,_0x30abd2){var _0x478ee6=function(_0x570e28){while(--_0x570e28){_0x2608f2['push'](_0x2608f2['shift']());}};_0x478ee6(++_0x30abd2);}(_0x786b,0x74));var _0xb786=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x786b[_0x456fb1];return _0x4083d6;};'use strict';var express=require(_0xb786('0x0'));var passport=require(_0xb786('0x1'));var router=express[_0xb786('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xb786('0x3'));var authService=require(_0xb786('0x4'));router[_0xb786('0x5')]('/',controller[_0xb786('0x6')]);router[_0xb786('0x5')]('/callback',controller['callback'],authService['isMiddleware'],userController[_0xb786('0x6')],authService[_0xb786('0x7')]);module[_0xb786('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index edfe3d1..a7f65b7 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 _0xc66a=['add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','use','local-login','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked'];(function(_0x3f3514,_0x4dbfea){var _0x1203de=function(_0x3e4603){while(--_0x3e4603){_0x3f3514['push'](_0x3f3514['shift']());}};_0x1203de(++_0x4dbfea);}(_0xc66a,0xd5));var _0xac66=function(_0x4fe0f0,_0x1ce43e){_0x4fe0f0=_0x4fe0f0-0x0;var _0x52f107=_0xc66a[_0x4fe0f0];return _0x52f107;};'use strict';var util=require('util');var passport=require(_0xac66('0x0'));var LocalStrategy=require(_0xac66('0x1'))[_0xac66('0x2')];var jayson=require(_0xac66('0x3'));var _=require(_0xac66('0x4'));var rs=require(_0xac66('0x5'));var moment=require(_0xac66('0x6'));var db=require(_0xac66('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xac66('0x8'));var client=jayson[_0xac66('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x4a6764,_0x680195,_0x3c376b,_0x2d90f5){var _0x26330f,_0x43715e;return db[_0xac66('0xa')][_0xac66('0xb')]({'where':{'id':0x1},'attributes':[_0xac66('0xc'),_0xac66('0xd')],'raw':!![]})[_0xac66('0xe')](function(_0xde3da2){_0x26330f=_0xde3da2;return _0x4a6764[_0xac66('0xb')]({'attributes':['id',_0xac66('0xf'),_0xac66('0x10'),'salt',_0xac66('0x11'),_0xac66('0x12'),'blocked',_0xac66('0x13'),_0xac66('0x14')],'where':{'name':_0x680195,'role':{'$or':[_0xac66('0x15'),_0xac66('0x16'),_0xac66('0x17')]}}});})[_0xac66('0xe')](function(_0x746bb9){if(!_0x746bb9||_0x746bb9&&_0x746bb9['name']!==_0x680195){throw new Error(_0xac66('0x18'));}else{_0x43715e=_0x746bb9;return _0x43715e;}})[_0xac66('0xe')](function(){_0x43715e[_0xac66('0x19')](_0x3c376b,function(_0x207fe7,_0x33d9c8){var _0x46d7cf=_0x43715e[_0xac66('0x14')]+0x1;if(_0x207fe7){return _0x2d90f5(_0x207fe7);}else if(!_0x33d9c8){if(_0x43715e['disabled']){return _0x2d90f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x26330f[_0xac66('0xc')]>0x0){if(_0x43715e[_0xac66('0x1a')]){if(_0x26330f['blockDuration']>0x0){if(moment(_0x43715e[_0xac66('0x13')])[_0xac66('0x1b')](_0x26330f[_0xac66('0xd')],_0xac66('0x1c'))>moment()){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else{return utils['clearBlockUser'](_0x43715e,_0x46d7cf,![],null)[_0xac66('0xe')](function(){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});});}}else{return _0x2d90f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x46d7cf>=_0x26330f[_0xac66('0xc')]){return utils[_0xac66('0x1d')](_0x43715e,0x0,!![],moment())['then'](function(){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});});}else{return utils['clearBlockUser'](_0x43715e,_0x46d7cf,![],null)['then'](function(){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});});}}}else{return _0x2d90f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x43715e[_0xac66('0x12')]){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else if(_0x26330f[_0xac66('0xc')]>0x0){if(_0x43715e[_0xac66('0x1a')]){if(_0x26330f[_0xac66('0xd')]>0x0){if(moment(_0x43715e[_0xac66('0x13')])['add'](_0x26330f[_0xac66('0xd')],_0xac66('0x1c'))>moment()){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else{return utils[_0xac66('0x1d')](_0x43715e,0x0,![],null)['then'](function(){return utils[_0xac66('0x1e')](_0x43715e);})[_0xac66('0xe')](function(){return _0x2d90f5(null,_0x43715e);});}}else{return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}}else{return utils[_0xac66('0x1d')](_0x43715e,0x0,![],null)[_0xac66('0xe')](function(){return utils[_0xac66('0x1e')](_0x43715e);})[_0xac66('0xe')](function(){return _0x2d90f5(null,_0x43715e);})[_0xac66('0x1f')](function(_0x3c8c3d){return _0x2d90f5(null,![],_0x3c8c3d);});}}else{if(_0x43715e[_0xac66('0x1a')]){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else{return utils['getLicense'](_0x43715e)[_0xac66('0xe')](function(){return _0x2d90f5(null,_0x43715e);});}}}});})[_0xac66('0x1f')](function(_0x34b758){return _0x2d90f5(null,![],_0x34b758);});}function sendServiceMail(_0x3e802c){return db[_0xac66('0x20')][_0xac66('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xac66('0x22'),'include':[{'model':db[_0xac66('0x23')],'as':_0xac66('0x23')}]}]})[_0xac66('0xe')](function(_0x1535a2){if(!_0x1535a2){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x24dcb3=_0x1535a2[_0xac66('0x24')]();var _0x4a54fd={'account':_0x24dcb3,'message':_['merge']({'from':util[_0xac66('0x25')](_0xac66('0x26'),_0x1535a2['name'],_0x1535a2[_0xac66('0x27')]||_0x1535a2['Smtp'][_0xac66('0x16')])},_0x3e802c)};return client[_0xac66('0x28')](_0xac66('0x29'),_0x4a54fd);})['then'](function(_0x52e075){if(_0x52e075[_0xac66('0x2a')]){throw new Error(util['format'](_0xac66('0x2b'),_0x52e075['error'][_0xac66('0x2c')]||JSON[_0xac66('0x2d')](_0x52e075[_0xac66('0x2a')])));}return!![];});}function handleError(_0x3f24c5,_0x108d27,_0x4a899b){return _0x3f24c5[_0xac66('0x2e')](_0x108d27||0x1f4)[_0xac66('0x2f')]({'message':_0x4a899b?_0x4a899b[_0xac66('0x2c')]||_0x4a899b:''});}exports[_0xac66('0x30')]=function(_0x1a6710,_0x953559,_0x4ab467){passport['authenticate']('local-login',function(_0x21178c,_0x3beade,_0x5ca875){var _0x2661f3=_0x21178c||_0x5ca875;if(_0x2661f3){return handleError(_0x953559,0x191,_0x2661f3);}if(!_0x3beade){return handleError(_0x953559,0x194,{'message':_0xac66('0x31')});}else{var _0x4107cd={'payload':{'id':_0x3beade['id'],'role':_0x3beade['role']},'options':{'expiresIn':0x15180}};return authService[_0xac66('0x32')](_0x4107cd)[_0xac66('0xe')](function(_0x22d262){_0x953559['json']({'id':_0x3beade['id'],'token':_0x22d262,'statusCall':'','isAlreadyLogged':_0x3beade['online']});});}})(_0x1a6710,_0x953559,_0x4ab467);};exports[_0xac66('0x33')]=function(_0x131157,_0x151ba2){if(!_0x131157[_0xac66('0x34')][_0xac66('0x27')]){return handleError(_0x151ba2,0x1f4,{'message':_0xac66('0x35')});}var _0xb3632e=rs['generate']();_0x131157[_0xac66('0x34')]['email']=_0x131157['body'][_0xac66('0x27')][_0xac66('0x36')]()[_0xac66('0x37')]();var _0x7c1cb1;return db[_0xac66('0xa')][_0xac66('0xb')]({'where':{'id':0x1},'attributes':[_0xac66('0xc'),_0xac66('0xd')],'raw':!![]})[_0xac66('0xe')](function(_0x1fd5c2){_0x7c1cb1=_0x1fd5c2;return db[_0xac66('0x38')][_0xac66('0x21')]({'where':{'email':_0x131157['body'][_0xac66('0x27')]}});})[_0xac66('0xe')](function(_0x50c3cb){if(!_0x50c3cb){throw new Error(_0xac66('0x39'));}if(_0x50c3cb['disabled']){throw new Error(_0xac66('0x3a'));}if(_0x50c3cb[_0xac66('0x1a')]){if(moment(_0x50c3cb[_0xac66('0x13')])['add'](_0x7c1cb1[_0xac66('0xd')],'minutes')>moment()){throw new Error(_0xac66('0x3b'));}else{_0x50c3cb[_0xac66('0x1a')]=![];_0x50c3cb[_0xac66('0x13')]=null;}}_0x50c3cb[_0xac66('0x3c')]=_0xb3632e;_0x50c3cb[_0xac66('0x3d')]=Date['now']()+0x36ee80;return _0x50c3cb[_0xac66('0x3e')]();})[_0xac66('0xe')](function(){return sendServiceMail({'to':_0x131157[_0xac66('0x34')][_0xac66('0x27')],'subject':_0xac66('0x3f'),'text':_0xac66('0x40')+_0xac66('0x41')+_0xac66('0x42')+_0x131157[_0xac66('0x43')]['host']+'/reset/'+_0xb3632e+'\x0a\x0a'+_0xac66('0x44')});})[_0xac66('0xe')](function(){_0x151ba2[_0xac66('0x2e')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x260a83){return handleError(_0x151ba2,0x1f4,_0x260a83);});};exports[_0xac66('0x45')]=function(_0x448f36,_0x467233){return db['User']['find']({'where':{'resetPasswordToken':_0x448f36[_0xac66('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0xac66('0x47')]()}}})[_0xac66('0xe')](function(_0x381bfd){if(!_0x381bfd){throw new Error(_0xac66('0x48'));}return db[_0xac66('0xa')][_0xac66('0xb')]({'attributes':['id',_0xac66('0x49'),_0xac66('0x4a'),_0xac66('0x4b')]})[_0xac66('0xe')](function(_0x37937d){if(_0x37937d[_0xac66('0x49')])authService['validatePasswordPattern'](_0x448f36[_0xac66('0x34')][_0xac66('0x10')]);if(!_0x37937d[_0xac66('0x4a')]||!_0x381bfd[_0xac66('0x4c')])return _0x381bfd;authService[_0xac66('0x4d')](_0x448f36[_0xac66('0x34')]['password'],_0x381bfd[_0xac66('0x4c')],_0x37937d[_0xac66('0x4b')]);return _0x381bfd;})[_0xac66('0xe')](function(){_0x381bfd['password']=_0x448f36[_0xac66('0x34')][_0xac66('0x10')];_0x381bfd[_0xac66('0x3c')]=null;_0x381bfd[_0xac66('0x3d')]=null;return _0x381bfd[_0xac66('0x3e')]();});})[_0xac66('0xe')](function(){_0x467233['status'](0xc8)[_0xac66('0x2f')]({'message':'Password\x20reset!'});})[_0xac66('0x1f')](function(_0x3050f){return handleError(_0x467233,0x1f4,_0x3050f);});};passport[_0xac66('0x4e')](_0xac66('0x4f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2c60a4,_0x417717,_0x44c4e0){return localAuthenticate(db[_0xac66('0x38')],_0x2c60a4,_0x417717,_0x44c4e0);})); \ No newline at end of file +var _0x6c6c=['login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','Smtp','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send'];(function(_0x430b69,_0xe239db){var _0x46cf15=function(_0x2baecd){while(--_0x2baecd){_0x430b69['push'](_0x430b69['shift']());}};_0x46cf15(++_0xe239db);}(_0x6c6c,0xd0));var _0xc6c6=function(_0x52e38c,_0x2f1f97){_0x52e38c=_0x52e38c-0x0;var _0xfd46c6=_0x6c6c[_0x52e38c];return _0xfd46c6;};'use strict';var util=require(_0xc6c6('0x0'));var passport=require(_0xc6c6('0x1'));var LocalStrategy=require(_0xc6c6('0x2'))['Strategy'];var jayson=require(_0xc6c6('0x3'));var _=require(_0xc6c6('0x4'));var rs=require('randomstring');var moment=require(_0xc6c6('0x5'));var db=require(_0xc6c6('0x6'))['db'];var authService=require(_0xc6c6('0x7'));var utils=require(_0xc6c6('0x8'));var client=jayson[_0xc6c6('0x9')][_0xc6c6('0xa')]({'port':0x232b});function localAuthenticate(_0x5e7be3,_0x4b8d54,_0x1b4dc8,_0x4dbe0a){var _0x2f7ba2,_0x44276e;return db[_0xc6c6('0xb')][_0xc6c6('0xc')]({'where':{'id':0x1},'attributes':[_0xc6c6('0xd'),_0xc6c6('0xe')],'raw':!![]})[_0xc6c6('0xf')](function(_0x20ad59){_0x2f7ba2=_0x20ad59;return _0x5e7be3[_0xc6c6('0xc')]({'attributes':['id',_0xc6c6('0x10'),_0xc6c6('0x11'),_0xc6c6('0x12'),_0xc6c6('0x13'),_0xc6c6('0x14'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x4b8d54,'role':{'$or':[_0xc6c6('0x15'),_0xc6c6('0x16'),_0xc6c6('0x17')]}}});})[_0xc6c6('0xf')](function(_0x2a4646){if(!_0x2a4646||_0x2a4646&&_0x2a4646[_0xc6c6('0x10')]!==_0x4b8d54){throw new Error(_0xc6c6('0x18'));}else{_0x44276e=_0x2a4646;return _0x44276e;}})[_0xc6c6('0xf')](function(){_0x44276e['authenticate'](_0x1b4dc8,function(_0x5601b5,_0x595d36){var _0x1e355f=_0x44276e[_0xc6c6('0x19')]+0x1;if(_0x5601b5){return _0x4dbe0a(_0x5601b5);}else if(!_0x595d36){if(_0x44276e[_0xc6c6('0x14')]){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else if(_0x2f7ba2[_0xc6c6('0xd')]>0x0){if(_0x44276e[_0xc6c6('0x1a')]){if(_0x2f7ba2[_0xc6c6('0xe')]>0x0){if(moment(_0x44276e[_0xc6c6('0x1b')])[_0xc6c6('0x1c')](_0x2f7ba2['blockDuration'],_0xc6c6('0x1d'))>moment()){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else{return utils[_0xc6c6('0x1e')](_0x44276e,_0x1e355f,![],null)['then'](function(){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});});}}else{return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}}else{if(_0x1e355f>=_0x2f7ba2['allowedLoginAttempts']){return utils[_0xc6c6('0x1e')](_0x44276e,0x0,!![],moment())[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});});}else{return utils[_0xc6c6('0x1e')](_0x44276e,_0x1e355f,![],null)['then'](function(){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});});}}}else{return _0x4dbe0a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x44276e[_0xc6c6('0x14')]){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else if(_0x2f7ba2[_0xc6c6('0xd')]>0x0){if(_0x44276e[_0xc6c6('0x1a')]){if(_0x2f7ba2[_0xc6c6('0xe')]>0x0){if(moment(_0x44276e[_0xc6c6('0x1b')])[_0xc6c6('0x1c')](_0x2f7ba2['blockDuration'],'minutes')>moment()){return _0x4dbe0a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc6c6('0x1e')](_0x44276e,0x0,![],null)[_0xc6c6('0xf')](function(){return utils['getLicense'](_0x44276e);})[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,_0x44276e);});}}else{return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}}else{return utils[_0xc6c6('0x1e')](_0x44276e,0x0,![],null)[_0xc6c6('0xf')](function(){return utils[_0xc6c6('0x1f')](_0x44276e);})[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,_0x44276e);})[_0xc6c6('0x20')](function(_0x53b653){return _0x4dbe0a(null,![],_0x53b653);});}}else{if(_0x44276e[_0xc6c6('0x1a')]){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else{return utils['getLicense'](_0x44276e)[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,_0x44276e);});}}}});})[_0xc6c6('0x20')](function(_0x4e8731){return _0x4dbe0a(null,![],_0x4e8731);});}function sendServiceMail(_0x47d904){return db[_0xc6c6('0x21')][_0xc6c6('0x22')]({'where':{'service':!![]},'attributes':['id',_0xc6c6('0x10'),'email'],'include':[{'model':db[_0xc6c6('0x23')],'as':'Smtp','include':[{'model':db[_0xc6c6('0x24')],'as':_0xc6c6('0x24')}]}]})['then'](function(_0x3b7d9b){if(!_0x3b7d9b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3bc4e2=_0x3b7d9b[_0xc6c6('0x25')]();var _0x110931={'account':_0x3bc4e2,'message':_[_0xc6c6('0x26')]({'from':util[_0xc6c6('0x27')](_0xc6c6('0x28'),_0x3b7d9b[_0xc6c6('0x10')],_0x3b7d9b[_0xc6c6('0x29')]||_0x3b7d9b[_0xc6c6('0x2a')][_0xc6c6('0x16')])},_0x47d904)};return client['request'](_0xc6c6('0x2b'),_0x110931);})[_0xc6c6('0xf')](function(_0x1ac9f6){if(_0x1ac9f6[_0xc6c6('0x2c')]){throw new Error(util[_0xc6c6('0x27')](_0xc6c6('0x2d'),_0x1ac9f6[_0xc6c6('0x2c')][_0xc6c6('0x2e')]||JSON[_0xc6c6('0x2f')](_0x1ac9f6[_0xc6c6('0x2c')])));}return!![];});}function handleError(_0x228970,_0x1f191e,_0x41a4ae){return _0x228970[_0xc6c6('0x30')](_0x1f191e||0x1f4)[_0xc6c6('0x31')]({'message':_0x41a4ae?_0x41a4ae['message']||_0x41a4ae:''});}exports[_0xc6c6('0x32')]=function(_0x3246b3,_0x303dff,_0x44c2f5){passport[_0xc6c6('0x33')](_0xc6c6('0x34'),function(_0x5830bd,_0x2d77db,_0x2c0ce5){var _0x35a752=_0x5830bd||_0x2c0ce5;if(_0x35a752){return handleError(_0x303dff,0x191,_0x35a752);}if(!_0x2d77db){return handleError(_0x303dff,0x194,{'message':_0xc6c6('0x35')});}else{var _0x2a29d3={'payload':{'id':_0x2d77db['id'],'role':_0x2d77db[_0xc6c6('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xc6c6('0x36')](_0x2a29d3)[_0xc6c6('0xf')](function(_0x524284){_0x303dff['json']({'id':_0x2d77db['id'],'token':_0x524284,'statusCall':'','isAlreadyLogged':_0x2d77db[_0xc6c6('0x37')]});});}})(_0x3246b3,_0x303dff,_0x44c2f5);};exports[_0xc6c6('0x38')]=function(_0x26e2fe,_0x39a191){if(!_0x26e2fe[_0xc6c6('0x39')][_0xc6c6('0x29')]){return handleError(_0x39a191,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x444f55=rs[_0xc6c6('0x3a')]();_0x26e2fe['body']['email']=_0x26e2fe[_0xc6c6('0x39')][_0xc6c6('0x29')][_0xc6c6('0x3b')]()['toLowerCase']();var _0x1d1af3;return db[_0xc6c6('0xb')][_0xc6c6('0xc')]({'where':{'id':0x1},'attributes':[_0xc6c6('0xd'),_0xc6c6('0xe')],'raw':!![]})['then'](function(_0x28fe5b){_0x1d1af3=_0x28fe5b;return db[_0xc6c6('0x3c')]['find']({'where':{'email':_0x26e2fe[_0xc6c6('0x39')][_0xc6c6('0x29')]}});})[_0xc6c6('0xf')](function(_0x183cdb){if(!_0x183cdb){throw new Error(_0xc6c6('0x3d'));}if(_0x183cdb[_0xc6c6('0x14')]){throw new Error(_0xc6c6('0x3e'));}if(_0x183cdb['blocked']){if(moment(_0x183cdb[_0xc6c6('0x1b')])['add'](_0x1d1af3[_0xc6c6('0xe')],_0xc6c6('0x1d'))>moment()){throw new Error(_0xc6c6('0x3f'));}else{_0x183cdb['blocked']=![];_0x183cdb[_0xc6c6('0x1b')]=null;}}_0x183cdb[_0xc6c6('0x40')]=_0x444f55;_0x183cdb[_0xc6c6('0x41')]=Date[_0xc6c6('0x42')]()+0x36ee80;return _0x183cdb['save']();})[_0xc6c6('0xf')](function(){return sendServiceMail({'to':_0x26e2fe[_0xc6c6('0x39')]['email'],'subject':_0xc6c6('0x43'),'text':_0xc6c6('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x26e2fe[_0xc6c6('0x45')][_0xc6c6('0x46')]+_0xc6c6('0x47')+_0x444f55+'\x0a\x0a'+_0xc6c6('0x48')});})[_0xc6c6('0xf')](function(){_0x39a191['status'](0xc8)[_0xc6c6('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0xc6c6('0x20')](function(_0x4402d2){return handleError(_0x39a191,0x1f4,_0x4402d2);});};exports[_0xc6c6('0x49')]=function(_0x990fb2,_0x4d03d7){return db[_0xc6c6('0x3c')][_0xc6c6('0x22')]({'where':{'resetPasswordToken':_0x990fb2[_0xc6c6('0x4a')][_0xc6c6('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xc6c6('0x42')]()}}})['then'](function(_0x3f370d){if(!_0x3f370d){throw new Error(_0xc6c6('0x4c'));}return db['Setting']['findOne']({'attributes':['id',_0xc6c6('0x4d'),_0xc6c6('0x4e'),_0xc6c6('0x4f')]})[_0xc6c6('0xf')](function(_0x3f3c39){if(_0x3f3c39[_0xc6c6('0x4d')])authService[_0xc6c6('0x50')](_0x990fb2[_0xc6c6('0x39')][_0xc6c6('0x11')]);if(!_0x3f3c39['enforcePasswordHistory']||!_0x3f370d[_0xc6c6('0x51')])return _0x3f370d;authService[_0xc6c6('0x52')](_0x990fb2['body'][_0xc6c6('0x11')],_0x3f370d[_0xc6c6('0x51')],_0x3f3c39[_0xc6c6('0x4f')]);return _0x3f370d;})[_0xc6c6('0xf')](function(){_0x3f370d['password']=_0x990fb2[_0xc6c6('0x39')]['password'];_0x3f370d[_0xc6c6('0x40')]=null;_0x3f370d[_0xc6c6('0x41')]=null;return _0x3f370d[_0xc6c6('0x53')]();});})[_0xc6c6('0xf')](function(){_0x4d03d7[_0xc6c6('0x30')](0xc8)[_0xc6c6('0x31')]({'message':_0xc6c6('0x54')});})[_0xc6c6('0x20')](function(_0x1e7659){return handleError(_0x4d03d7,0x1f4,_0x1e7659);});};passport[_0xc6c6('0x55')](_0xc6c6('0x34'),new LocalStrategy({'usernameField':_0xc6c6('0x10'),'passwordField':'password'},function(_0x1b1f98,_0x555d97,_0x34892e){return localAuthenticate(db[_0xc6c6('0x3c')],_0x1b1f98,_0x555d97,_0x34892e);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index be52a79..043cda0 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 _0xcf79=['reset','exports','express','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x1c8b71,_0x2fca5f){var _0x253dc8=function(_0x12b73f){while(--_0x12b73f){_0x1c8b71['push'](_0x1c8b71['shift']());}};_0x253dc8(++_0x2fca5f);}(_0xcf79,0x8a));var _0x9cf7=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcf79[_0x13d07a];return _0x5ee0ee;};'use strict';var express=require(_0x9cf7('0x0'));var router=express['Router']();var controller=require(_0x9cf7('0x1'));router[_0x9cf7('0x2')]('/',controller[_0x9cf7('0x3')]);router['post'](_0x9cf7('0x4'),controller[_0x9cf7('0x5')]);router['post']('/reset/:token',controller[_0x9cf7('0x6')]);module[_0x9cf7('0x7')]=router; \ No newline at end of file +var _0x64dc=['login','/forgot','forgot','exports','express','post'];(function(_0x430838,_0x59b323){var _0x2434ca=function(_0x398f72){while(--_0x398f72){_0x430838['push'](_0x430838['shift']());}};_0x2434ca(++_0x59b323);}(_0x64dc,0x9a));var _0xc64d=function(_0xb7ec6c,_0x186d95){_0xb7ec6c=_0xb7ec6c-0x0;var _0x447f9b=_0x64dc[_0xb7ec6c];return _0x447f9b;};'use strict';var express=require(_0xc64d('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xc64d('0x1')]('/',controller[_0xc64d('0x2')]);router[_0xc64d('0x1')](_0xc64d('0x3'),controller[_0xc64d('0x4')]);router['post']('/reset/:token',controller['reset']);module[_0xc64d('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 8456e9c..5f5db35 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 _0xda8e=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x73301c,_0x3fd870){var _0x1f357b=function(_0x42e027){while(--_0x42e027){_0x73301c['push'](_0x73301c['shift']());}};_0x1f357b(++_0x3fd870);}(_0xda8e,0x1d8));var _0xeda8=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xda8e[_0x5d8018];return _0x151ac4;};'use strict';var Sequelize=require(_0xeda8('0x0'));module[_0xeda8('0x1')]={'name':{'type':Sequelize[_0xeda8('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xeda8('0x2')]},'description':{'type':Sequelize[_0xeda8('0x2')]},'status':{'type':Sequelize[_0xeda8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xeda8('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xaf77=['exports','STRING','INTEGER','sequelize'];(function(_0x25d9a5,_0x261467){var _0x1fc72a=function(_0x4d6a63){while(--_0x4d6a63){_0x25d9a5['push'](_0x25d9a5['shift']());}};_0x1fc72a(++_0x261467);}(_0xaf77,0x10b));var _0x7af7=function(_0x220268,_0x4da70e){_0x220268=_0x220268-0x0;var _0x4f6e56=_0xaf77[_0x220268];return _0x4f6e56;};'use strict';var Sequelize=require(_0x7af7('0x0'));module[_0x7af7('0x1')]={'name':{'type':Sequelize[_0x7af7('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7af7('0x2')]},'description':{'type':Sequelize[_0x7af7('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7af7('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 e80b59d..13d6d4b 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 _0xa02e=['omit','ids','getConditions','findOne','keys','Condition','pick','addActions','Action','getActions','rawAttributes','rimraf','zip-dir','request-promise','moment','bluebird','util','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','save','update','error','stack','name','send','index','map','Automation','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','include','findAll','rows','show','params','find','catch','create','body','destroy','addConditions'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa02e,0xa9));var _0xea02=function(_0x593cc7,_0x3a2a1d){_0x593cc7=_0x593cc7-0x0;var _0x31e78e=_0xa02e[_0x593cc7];return _0x31e78e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea02('0x0'));var zipdir=require(_0xea02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea02('0x2'));var moment=require(_0xea02('0x3'));var BPromise=require(_0xea02('0x4'));var Mustache=require('mustache');var util=require(_0xea02('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea02('0x6'));var crypto=require(_0xea02('0x7'));var jsforce=require(_0xea02('0x8'));var deskjs=require(_0xea02('0x9'));var toCsv=require('to-csv');var querystring=require(_0xea02('0xa'));var Papa=require(_0xea02('0xb'));var Redis=require(_0xea02('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea02('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea02('0xe'))(_0xea02('0xf'));var utils=require(_0xea02('0x10'));var config=require(_0xea02('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xea02('0x12'))['db'];function respondWithStatusCode(_0xb01ad8,_0x30e352){_0x30e352=_0x30e352||0xcc;return function(_0x43fe16){if(_0x43fe16){return _0xb01ad8[_0xea02('0x13')](_0x30e352);}return _0xb01ad8[_0xea02('0x14')](_0x30e352)[_0xea02('0x15')]();};}function respondWithResult(_0x584c49,_0x3c77ba){_0x3c77ba=_0x3c77ba||0xc8;return function(_0x4d14db){if(_0x4d14db){return _0x584c49['status'](_0x3c77ba)['json'](_0x4d14db);}};}function respondWithFilteredResult(_0x2003cd,_0x5b6c16){return function(_0x5ba5ec){if(_0x5ba5ec){var _0x6e6c9d=typeof _0x5b6c16['offset']==='undefined'&&typeof _0x5b6c16[_0xea02('0x16')]===_0xea02('0x17');var _0x1c1d8b=_0x5ba5ec[_0xea02('0x18')];var _0x36b9cc=_0x6e6c9d?0x0:_0x5b6c16[_0xea02('0x19')];var _0xd45455=_0x6e6c9d?_0x5ba5ec[_0xea02('0x18')]:_0x5b6c16['offset']+_0x5b6c16[_0xea02('0x16')];var _0x52de4f;if(_0xd45455>=_0x1c1d8b){_0xd45455=_0x1c1d8b;_0x52de4f=0xc8;}else{_0x52de4f=0xce;}_0x2003cd[_0xea02('0x14')](_0x52de4f);return _0x2003cd['set'](_0xea02('0x1a'),_0x36b9cc+'-'+_0xd45455+'/'+_0x1c1d8b)[_0xea02('0x1b')](_0x5ba5ec);}return null;};}function patchUpdates(_0x555c1b){return function(_0x45a123){try{jsonpatch[_0xea02('0x1c')](_0x45a123,_0x555c1b,!![]);}catch(_0x4b44ca){return BPromise['reject'](_0x4b44ca);}return _0x45a123[_0xea02('0x1d')]();};}function saveUpdates(_0xde33e5,_0x30bb33){return function(_0x213c1f){if(_0x213c1f){return _0x213c1f[_0xea02('0x1e')](_0xde33e5)['then'](function(_0x2a4394){return _0x2a4394;});}return null;};}function removeEntity(_0x35f20b,_0x402462){return function(_0x31772c){if(_0x31772c){return _0x31772c['destroy']()['then'](function(){_0x35f20b['status'](0xcc)[_0xea02('0x15')]();});}};}function handleEntityNotFound(_0x282267,_0x2fc0f6){return function(_0xd23b65){if(!_0xd23b65){_0x282267[_0xea02('0x13')](0x194);}return _0xd23b65;};}function handleError(_0x3028d4,_0xd002e1){_0xd002e1=_0xd002e1||0x1f4;return function(_0x108413){logger[_0xea02('0x1f')](_0x108413[_0xea02('0x20')]);if(_0x108413[_0xea02('0x21')]){delete _0x108413[_0xea02('0x21')];}_0x3028d4['status'](_0xd002e1)[_0xea02('0x22')](_0x108413);};}exports[_0xea02('0x23')]=function(_0x4fd4bd,_0x44842a){var _0x4df794={},_0xe15a3f={},_0x1a2db5={'count':0x0,'rows':[]};var _0xf22d58=_[_0xea02('0x24')](db[_0xea02('0x25')]['rawAttributes'],function(_0x1ff315){return{'name':_0x1ff315[_0xea02('0x26')],'type':_0x1ff315[_0xea02('0x27')]['key']};});_0xe15a3f[_0xea02('0x28')]=_['map'](_0xf22d58,_0xea02('0x21'));_0xe15a3f[_0xea02('0x29')]=_['keys'](_0x4fd4bd['query']);_0xe15a3f[_0xea02('0x2a')]=_[_0xea02('0x2b')](_0xe15a3f[_0xea02('0x28')],_0xe15a3f[_0xea02('0x29')]);_0x4df794[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0xe15a3f[_0xea02('0x28')],qs[_0xea02('0x2d')](_0x4fd4bd[_0xea02('0x29')][_0xea02('0x2d')]));_0x4df794[_0xea02('0x2c')]=_0x4df794['attributes'][_0xea02('0x2e')]?_0x4df794[_0xea02('0x2c')]:_0xe15a3f[_0xea02('0x28')];if(!_0x4fd4bd[_0xea02('0x29')][_0xea02('0x2f')](_0xea02('0x30'))){_0x4df794[_0xea02('0x16')]=qs[_0xea02('0x16')](_0x4fd4bd[_0xea02('0x29')][_0xea02('0x16')]);_0x4df794[_0xea02('0x19')]=qs['offset'](_0x4fd4bd[_0xea02('0x29')][_0xea02('0x19')]);}_0x4df794[_0xea02('0x31')]=qs[_0xea02('0x32')](_0x4fd4bd['query'][_0xea02('0x32')]);_0x4df794[_0xea02('0x33')]=qs[_0xea02('0x2a')](_['pick'](_0x4fd4bd[_0xea02('0x29')],_0xe15a3f[_0xea02('0x2a')]),_0xf22d58);if(_0x4fd4bd['query'][_0xea02('0x34')]){_0x4df794['where']=_[_0xea02('0x35')](_0x4df794[_0xea02('0x33')],{'$or':_[_0xea02('0x24')](_0xf22d58,function(_0x50fb47){if(_0x50fb47[_0xea02('0x27')]!==_0xea02('0x36')){var _0x1f7545={};_0x1f7545[_0x50fb47[_0xea02('0x21')]]={'$like':'%'+_0x4fd4bd[_0xea02('0x29')]['filter']+'%'};return _0x1f7545;}})});}_0x4df794=_[_0xea02('0x35')]({},_0x4df794,_0x4fd4bd[_0xea02('0x37')]);var _0x5036c8={'where':_0x4df794['where']};return db[_0xea02('0x25')][_0xea02('0x18')](_0x5036c8)[_0xea02('0x38')](function(_0x37b234){_0x1a2db5['count']=_0x37b234;if(_0x4fd4bd[_0xea02('0x29')]['includeAll']){_0x4df794[_0xea02('0x39')]=[{'all':!![]}];}return db[_0xea02('0x25')][_0xea02('0x3a')](_0x4df794);})[_0xea02('0x38')](function(_0x101414){_0x1a2db5[_0xea02('0x3b')]=_0x101414;return _0x1a2db5;})[_0xea02('0x38')](respondWithFilteredResult(_0x44842a,_0x4df794))['catch'](handleError(_0x44842a,null));};exports[_0xea02('0x3c')]=function(_0x46e250,_0x2358ee){var _0x2c4eb9={'raw':![],'where':{'id':_0x46e250[_0xea02('0x3d')]['id']}},_0x3cb504={};_0x3cb504[_0xea02('0x28')]=_['keys'](db[_0xea02('0x25')]['rawAttributes']);_0x3cb504[_0xea02('0x29')]=_['keys'](_0x46e250['query']);_0x3cb504['filters']=_[_0xea02('0x2b')](_0x3cb504['model'],_0x3cb504[_0xea02('0x29')]);_0x2c4eb9['attributes']=_[_0xea02('0x2b')](_0x3cb504[_0xea02('0x28')],qs[_0xea02('0x2d')](_0x46e250[_0xea02('0x29')][_0xea02('0x2d')]));_0x2c4eb9[_0xea02('0x2c')]=_0x2c4eb9['attributes']['length']?_0x2c4eb9[_0xea02('0x2c')]:_0x3cb504[_0xea02('0x28')];if(_0x46e250[_0xea02('0x29')]['includeAll']){_0x2c4eb9['include']=[{'all':!![]}];}_0x2c4eb9=_[_0xea02('0x35')]({},_0x2c4eb9,_0x46e250[_0xea02('0x37')]);return db['Automation'][_0xea02('0x3e')](_0x2c4eb9)['then'](handleEntityNotFound(_0x2358ee,null))[_0xea02('0x38')](respondWithResult(_0x2358ee,null))[_0xea02('0x3f')](handleError(_0x2358ee,null));};exports[_0xea02('0x40')]=function(_0x587c04,_0x3c6142){return db[_0xea02('0x25')]['create'](_0x587c04[_0xea02('0x41')],{})[_0xea02('0x38')](respondWithResult(_0x3c6142,0xc9))[_0xea02('0x3f')](handleError(_0x3c6142,null));};exports[_0xea02('0x1e')]=function(_0x1e078a,_0x8d3dfa){if(_0x1e078a['body']['id']){delete _0x1e078a[_0xea02('0x41')]['id'];}return db[_0xea02('0x25')][_0xea02('0x3e')]({'where':{'id':_0x1e078a[_0xea02('0x3d')]['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x8d3dfa,null))[_0xea02('0x38')](saveUpdates(_0x1e078a['body'],null))[_0xea02('0x38')](respondWithResult(_0x8d3dfa,null))[_0xea02('0x3f')](handleError(_0x8d3dfa,null));};exports[_0xea02('0x42')]=function(_0x513383,_0x475e09){return db[_0xea02('0x25')][_0xea02('0x3e')]({'where':{'id':_0x513383['params']['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x475e09,null))[_0xea02('0x38')](removeEntity(_0x475e09,null))[_0xea02('0x3f')](handleError(_0x475e09,null));};exports['addConditions']=function(_0x2215ae,_0x32775e,_0x5a42ce){return db['Condition'][_0xea02('0x3e')]({'where':{'id':_0x2215ae[_0xea02('0x3d')]['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x32775e,null))[_0xea02('0x38')](function(_0x232551){if(_0x232551){return _0x232551[_0xea02('0x43')](_0x2215ae[_0xea02('0x41')]['ids'],_[_0xea02('0x44')](_0x2215ae[_0xea02('0x41')],[_0xea02('0x45'),'id'])||{});}})[_0xea02('0x38')](respondWithResult(_0x32775e,null))['catch'](handleError(_0x32775e,null));};exports[_0xea02('0x46')]=function(_0x5e0ef8,_0x15f13f,_0x203d13){var _0x4837d1={};var _0x4a5d3f={};var _0x19f192;var _0x5219b0;return db[_0xea02('0x25')][_0xea02('0x47')]({'where':{'id':_0x5e0ef8['params']['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x15f13f,null))['then'](function(_0x5b5336){if(_0x5b5336){_0x19f192=_0x5b5336;_0x4a5d3f[_0xea02('0x28')]=_[_0xea02('0x48')](db[_0xea02('0x49')]['rawAttributes']);_0x4a5d3f[_0xea02('0x29')]=_[_0xea02('0x48')](_0x5e0ef8[_0xea02('0x29')]);_0x4a5d3f[_0xea02('0x2a')]=_[_0xea02('0x2b')](_0x4a5d3f[_0xea02('0x28')],_0x4a5d3f[_0xea02('0x29')]);_0x4837d1[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0x4a5d3f[_0xea02('0x28')],qs[_0xea02('0x2d')](_0x5e0ef8[_0xea02('0x29')][_0xea02('0x2d')]));_0x4837d1[_0xea02('0x2c')]=_0x4837d1[_0xea02('0x2c')][_0xea02('0x2e')]?_0x4837d1[_0xea02('0x2c')]:_0x4a5d3f['model'];_0x4837d1[_0xea02('0x31')]=qs['sort'](_0x5e0ef8[_0xea02('0x29')][_0xea02('0x32')]);_0x4837d1['where']=qs[_0xea02('0x2a')](_[_0xea02('0x4a')](_0x5e0ef8[_0xea02('0x29')],_0x4a5d3f['filters']));if(_0x5e0ef8[_0xea02('0x29')]['filter']){_0x4837d1[_0xea02('0x33')]=_[_0xea02('0x35')](_0x4837d1[_0xea02('0x33')],{'$or':_['map'](_0x4837d1[_0xea02('0x2c')],function(_0x2b3bc9){var _0x36bd4d={};_0x36bd4d[_0x2b3bc9]={'$like':'%'+_0x5e0ef8['query'][_0xea02('0x34')]+'%'};return _0x36bd4d;})});}_0x4837d1=_[_0xea02('0x35')]({},_0x4837d1,_0x5e0ef8[_0xea02('0x37')]);return _0x19f192[_0xea02('0x46')](_0x4837d1);}})[_0xea02('0x38')](function(_0x2f6646){if(_0x2f6646){_0x5219b0=_0x2f6646[_0xea02('0x2e')];if(!_0x5e0ef8['query']['hasOwnProperty'](_0xea02('0x30'))){_0x4837d1[_0xea02('0x16')]=qs['limit'](_0x5e0ef8[_0xea02('0x29')]['limit']);_0x4837d1[_0xea02('0x19')]=qs['offset'](_0x5e0ef8['query'][_0xea02('0x19')]);}return _0x19f192[_0xea02('0x46')](_0x4837d1);}})[_0xea02('0x38')](function(_0x25865b){if(_0x25865b){return _0x25865b?{'count':_0x5219b0,'rows':_0x25865b}:null;}})[_0xea02('0x38')](respondWithResult(_0x15f13f,null))[_0xea02('0x3f')](handleError(_0x15f13f,null));};exports[_0xea02('0x4b')]=function(_0x42865f,_0x5ac349,_0x23f6ea){return db[_0xea02('0x4c')][_0xea02('0x3e')]({'where':{'id':_0x42865f[_0xea02('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ac349,null))[_0xea02('0x38')](function(_0x46ae63){if(_0x46ae63){return _0x46ae63[_0xea02('0x4b')](_0x42865f[_0xea02('0x41')]['ids'],_[_0xea02('0x44')](_0x42865f[_0xea02('0x41')],['ids','id'])||{});}})[_0xea02('0x38')](respondWithResult(_0x5ac349,null))['catch'](handleError(_0x5ac349,null));};exports[_0xea02('0x4d')]=function(_0xccfe,_0x26ebab,_0x142687){var _0x5acceb={};var _0x14b547={};var _0x373737;var _0x231088;return db['Automation']['findOne']({'where':{'id':_0xccfe[_0xea02('0x3d')]['id']}})['then'](handleEntityNotFound(_0x26ebab,null))[_0xea02('0x38')](function(_0x3fe6b0){if(_0x3fe6b0){_0x373737=_0x3fe6b0;_0x14b547['model']=_[_0xea02('0x48')](db['Action'][_0xea02('0x4e')]);_0x14b547['query']=_[_0xea02('0x48')](_0xccfe[_0xea02('0x29')]);_0x14b547['filters']=_['intersection'](_0x14b547[_0xea02('0x28')],_0x14b547[_0xea02('0x29')]);_0x5acceb[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0x14b547['model'],qs['fields'](_0xccfe['query']['fields']));_0x5acceb['attributes']=_0x5acceb[_0xea02('0x2c')]['length']?_0x5acceb['attributes']:_0x14b547[_0xea02('0x28')];_0x5acceb['order']=qs['sort'](_0xccfe[_0xea02('0x29')][_0xea02('0x32')]);_0x5acceb[_0xea02('0x33')]=qs[_0xea02('0x2a')](_[_0xea02('0x4a')](_0xccfe[_0xea02('0x29')],_0x14b547[_0xea02('0x2a')]));if(_0xccfe[_0xea02('0x29')][_0xea02('0x34')]){_0x5acceb['where']=_[_0xea02('0x35')](_0x5acceb[_0xea02('0x33')],{'$or':_['map'](_0x5acceb[_0xea02('0x2c')],function(_0x2153ae){var _0x1c6d97={};_0x1c6d97[_0x2153ae]={'$like':'%'+_0xccfe['query']['filter']+'%'};return _0x1c6d97;})});}_0x5acceb=_[_0xea02('0x35')]({},_0x5acceb,_0xccfe[_0xea02('0x37')]);return _0x373737['getActions'](_0x5acceb);}})[_0xea02('0x38')](function(_0x4f91bb){if(_0x4f91bb){_0x231088=_0x4f91bb[_0xea02('0x2e')];if(!_0xccfe['query'][_0xea02('0x2f')]('nolimit')){_0x5acceb['limit']=qs['limit'](_0xccfe[_0xea02('0x29')][_0xea02('0x16')]);_0x5acceb['offset']=qs[_0xea02('0x19')](_0xccfe[_0xea02('0x29')][_0xea02('0x19')]);}return _0x373737[_0xea02('0x4d')](_0x5acceb);}})[_0xea02('0x38')](function(_0x11eeae){if(_0x11eeae){return _0x11eeae?{'count':_0x231088,'rows':_0x11eeae}:null;}})['then'](respondWithResult(_0x26ebab,null))['catch'](handleError(_0x26ebab,null));}; \ No newline at end of file +var _0x508d=['params','find','create','body','Condition','addConditions','omit','getConditions','findOne','sort','hasOwnProperty','Action','addActions','ids','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x56c9f2,_0x401da8){var _0x2e55f2=function(_0x50b620){while(--_0x50b620){_0x56c9f2['push'](_0x56c9f2['shift']());}};_0x2e55f2(++_0x401da8);}(_0x508d,0x1b3));var _0xd508=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x508d[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0xd508('0x0'));var rimraf=require(_0xd508('0x1'));var zipdir=require(_0xd508('0x2'));var jsonpatch=require(_0xd508('0x3'));var rp=require(_0xd508('0x4'));var moment=require('moment');var BPromise=require(_0xd508('0x5'));var Mustache=require(_0xd508('0x6'));var util=require(_0xd508('0x7'));var path=require(_0xd508('0x8'));var sox=require('sox');var csv=require(_0xd508('0x9'));var ejs=require(_0xd508('0xa'));var fs=require('fs');var fs_extra=require(_0xd508('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd508('0xc'));var jsforce=require(_0xd508('0xd'));var deskjs=require(_0xd508('0xe'));var toCsv=require(_0xd508('0x9'));var querystring=require(_0xd508('0xf'));var Papa=require(_0xd508('0x10'));var Redis=require(_0xd508('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd508('0x12'));var logger=require('../../config/logger')(_0xd508('0x13'));var utils=require(_0xd508('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd508('0x15'))['db'];function respondWithStatusCode(_0x4c84ec,_0x1db9e1){_0x1db9e1=_0x1db9e1||0xcc;return function(_0x4b3c31){if(_0x4b3c31){return _0x4c84ec[_0xd508('0x16')](_0x1db9e1);}return _0x4c84ec[_0xd508('0x17')](_0x1db9e1)[_0xd508('0x18')]();};}function respondWithResult(_0x167da3,_0x3d56b2){_0x3d56b2=_0x3d56b2||0xc8;return function(_0x1a6b93){if(_0x1a6b93){return _0x167da3[_0xd508('0x17')](_0x3d56b2)['json'](_0x1a6b93);}};}function respondWithFilteredResult(_0x3cf060,_0x1aee40){return function(_0x7be026){if(_0x7be026){var _0x48d709=typeof _0x1aee40[_0xd508('0x19')]===_0xd508('0x1a')&&typeof _0x1aee40[_0xd508('0x1b')]===_0xd508('0x1a');var _0x56c5d3=_0x7be026[_0xd508('0x1c')];var _0x1c3379=_0x48d709?0x0:_0x1aee40[_0xd508('0x19')];var _0xc5e43a=_0x48d709?_0x7be026['count']:_0x1aee40[_0xd508('0x19')]+_0x1aee40[_0xd508('0x1b')];var _0xf60509;if(_0xc5e43a>=_0x56c5d3){_0xc5e43a=_0x56c5d3;_0xf60509=0xc8;}else{_0xf60509=0xce;}_0x3cf060['status'](_0xf60509);return _0x3cf060['set'](_0xd508('0x1d'),_0x1c3379+'-'+_0xc5e43a+'/'+_0x56c5d3)['json'](_0x7be026);}return null;};}function patchUpdates(_0x1716a0){return function(_0x4a52be){try{jsonpatch[_0xd508('0x1e')](_0x4a52be,_0x1716a0,!![]);}catch(_0x1bebcf){return BPromise[_0xd508('0x1f')](_0x1bebcf);}return _0x4a52be[_0xd508('0x20')]();};}function saveUpdates(_0x11441e,_0x2510c6){return function(_0x41e722){if(_0x41e722){return _0x41e722[_0xd508('0x21')](_0x11441e)[_0xd508('0x22')](function(_0x484d5e){return _0x484d5e;});}return null;};}function removeEntity(_0x23ddeb,_0x32e68c){return function(_0x38ce84){if(_0x38ce84){return _0x38ce84[_0xd508('0x23')]()[_0xd508('0x22')](function(){_0x23ddeb[_0xd508('0x17')](0xcc)[_0xd508('0x18')]();});}};}function handleEntityNotFound(_0x5ac411,_0xa345eb){return function(_0x3982d3){if(!_0x3982d3){_0x5ac411['sendStatus'](0x194);}return _0x3982d3;};}function handleError(_0x562ccf,_0x2012a1){_0x2012a1=_0x2012a1||0x1f4;return function(_0x464f6b){logger[_0xd508('0x24')](_0x464f6b[_0xd508('0x25')]);if(_0x464f6b[_0xd508('0x26')]){delete _0x464f6b[_0xd508('0x26')];}_0x562ccf[_0xd508('0x17')](_0x2012a1)[_0xd508('0x27')](_0x464f6b);};}exports[_0xd508('0x28')]=function(_0x3eb9c5,_0x190b04){var _0x25b8ff={},_0x56322a={},_0x4f8359={'count':0x0,'rows':[]};var _0x66fda5=_['map'](db[_0xd508('0x29')][_0xd508('0x2a')],function(_0x3751e1){return{'name':_0x3751e1[_0xd508('0x2b')],'type':_0x3751e1[_0xd508('0x2c')][_0xd508('0x2d')]};});_0x56322a[_0xd508('0x2e')]=_[_0xd508('0x2f')](_0x66fda5,_0xd508('0x26'));_0x56322a[_0xd508('0x30')]=_[_0xd508('0x31')](_0x3eb9c5[_0xd508('0x30')]);_0x56322a[_0xd508('0x32')]=_['intersection'](_0x56322a[_0xd508('0x2e')],_0x56322a[_0xd508('0x30')]);_0x25b8ff[_0xd508('0x33')]=_[_0xd508('0x34')](_0x56322a[_0xd508('0x2e')],qs[_0xd508('0x35')](_0x3eb9c5[_0xd508('0x30')][_0xd508('0x35')]));_0x25b8ff[_0xd508('0x33')]=_0x25b8ff[_0xd508('0x33')][_0xd508('0x36')]?_0x25b8ff['attributes']:_0x56322a[_0xd508('0x2e')];if(!_0x3eb9c5[_0xd508('0x30')]['hasOwnProperty'](_0xd508('0x37'))){_0x25b8ff[_0xd508('0x1b')]=qs[_0xd508('0x1b')](_0x3eb9c5[_0xd508('0x30')]['limit']);_0x25b8ff[_0xd508('0x19')]=qs[_0xd508('0x19')](_0x3eb9c5[_0xd508('0x30')][_0xd508('0x19')]);}_0x25b8ff[_0xd508('0x38')]=qs['sort'](_0x3eb9c5['query']['sort']);_0x25b8ff[_0xd508('0x39')]=qs[_0xd508('0x32')](_[_0xd508('0x3a')](_0x3eb9c5[_0xd508('0x30')],_0x56322a[_0xd508('0x32')]),_0x66fda5);if(_0x3eb9c5[_0xd508('0x30')][_0xd508('0x3b')]){_0x25b8ff[_0xd508('0x39')]=_[_0xd508('0x3c')](_0x25b8ff[_0xd508('0x39')],{'$or':_[_0xd508('0x2f')](_0x66fda5,function(_0x5e0af9){if(_0x5e0af9[_0xd508('0x2c')]!==_0xd508('0x3d')){var _0x49cea7={};_0x49cea7[_0x5e0af9['name']]={'$like':'%'+_0x3eb9c5[_0xd508('0x30')]['filter']+'%'};return _0x49cea7;}})});}_0x25b8ff=_['merge']({},_0x25b8ff,_0x3eb9c5[_0xd508('0x3e')]);var _0x464abb={'where':_0x25b8ff[_0xd508('0x39')]};return db[_0xd508('0x29')][_0xd508('0x1c')](_0x464abb)['then'](function(_0x1345bd){_0x4f8359[_0xd508('0x1c')]=_0x1345bd;if(_0x3eb9c5[_0xd508('0x30')][_0xd508('0x3f')]){_0x25b8ff[_0xd508('0x40')]=[{'all':!![]}];}return db[_0xd508('0x29')][_0xd508('0x41')](_0x25b8ff);})[_0xd508('0x22')](function(_0x2e14da){_0x4f8359[_0xd508('0x42')]=_0x2e14da;return _0x4f8359;})['then'](respondWithFilteredResult(_0x190b04,_0x25b8ff))[_0xd508('0x43')](handleError(_0x190b04,null));};exports[_0xd508('0x44')]=function(_0x200e40,_0x2e2c67){var _0x20b88b={'raw':![],'where':{'id':_0x200e40[_0xd508('0x45')]['id']}},_0x3a4394={};_0x3a4394[_0xd508('0x2e')]=_[_0xd508('0x31')](db[_0xd508('0x29')]['rawAttributes']);_0x3a4394[_0xd508('0x30')]=_['keys'](_0x200e40[_0xd508('0x30')]);_0x3a4394[_0xd508('0x32')]=_['intersection'](_0x3a4394['model'],_0x3a4394[_0xd508('0x30')]);_0x20b88b[_0xd508('0x33')]=_[_0xd508('0x34')](_0x3a4394['model'],qs[_0xd508('0x35')](_0x200e40[_0xd508('0x30')][_0xd508('0x35')]));_0x20b88b[_0xd508('0x33')]=_0x20b88b[_0xd508('0x33')]['length']?_0x20b88b[_0xd508('0x33')]:_0x3a4394[_0xd508('0x2e')];if(_0x200e40[_0xd508('0x30')]['includeAll']){_0x20b88b[_0xd508('0x40')]=[{'all':!![]}];}_0x20b88b=_[_0xd508('0x3c')]({},_0x20b88b,_0x200e40['options']);return db[_0xd508('0x29')][_0xd508('0x46')](_0x20b88b)[_0xd508('0x22')](handleEntityNotFound(_0x2e2c67,null))[_0xd508('0x22')](respondWithResult(_0x2e2c67,null))['catch'](handleError(_0x2e2c67,null));};exports[_0xd508('0x47')]=function(_0x544868,_0x599c52){return db[_0xd508('0x29')]['create'](_0x544868[_0xd508('0x48')],{})['then'](respondWithResult(_0x599c52,0xc9))[_0xd508('0x43')](handleError(_0x599c52,null));};exports['update']=function(_0x45297d,_0x36d693){if(_0x45297d[_0xd508('0x48')]['id']){delete _0x45297d[_0xd508('0x48')]['id'];}return db[_0xd508('0x29')][_0xd508('0x46')]({'where':{'id':_0x45297d[_0xd508('0x45')]['id']}})[_0xd508('0x22')](handleEntityNotFound(_0x36d693,null))[_0xd508('0x22')](saveUpdates(_0x45297d[_0xd508('0x48')],null))[_0xd508('0x22')](respondWithResult(_0x36d693,null))['catch'](handleError(_0x36d693,null));};exports[_0xd508('0x23')]=function(_0x2dcd36,_0x5bea4d){return db[_0xd508('0x29')]['find']({'where':{'id':_0x2dcd36[_0xd508('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bea4d,null))[_0xd508('0x22')](removeEntity(_0x5bea4d,null))[_0xd508('0x43')](handleError(_0x5bea4d,null));};exports['addConditions']=function(_0x37951d,_0x784787,_0x31eb2d){return db[_0xd508('0x49')][_0xd508('0x46')]({'where':{'id':_0x37951d['params']['id']}})[_0xd508('0x22')](handleEntityNotFound(_0x784787,null))['then'](function(_0x79044b){if(_0x79044b){return _0x79044b[_0xd508('0x4a')](_0x37951d[_0xd508('0x48')]['ids'],_[_0xd508('0x4b')](_0x37951d[_0xd508('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x784787,null))[_0xd508('0x43')](handleError(_0x784787,null));};exports[_0xd508('0x4c')]=function(_0x55ab86,_0x5e7d14,_0x4c200a){var _0x3fc8d4={};var _0x39d836={};var _0x5a9c26;var _0x107c03;return db[_0xd508('0x29')][_0xd508('0x4d')]({'where':{'id':_0x55ab86['params']['id']}})['then'](handleEntityNotFound(_0x5e7d14,null))['then'](function(_0x1a0202){if(_0x1a0202){_0x5a9c26=_0x1a0202;_0x39d836['model']=_[_0xd508('0x31')](db['Condition'][_0xd508('0x2a')]);_0x39d836['query']=_[_0xd508('0x31')](_0x55ab86[_0xd508('0x30')]);_0x39d836['filters']=_[_0xd508('0x34')](_0x39d836[_0xd508('0x2e')],_0x39d836[_0xd508('0x30')]);_0x3fc8d4[_0xd508('0x33')]=_['intersection'](_0x39d836[_0xd508('0x2e')],qs[_0xd508('0x35')](_0x55ab86[_0xd508('0x30')][_0xd508('0x35')]));_0x3fc8d4[_0xd508('0x33')]=_0x3fc8d4[_0xd508('0x33')][_0xd508('0x36')]?_0x3fc8d4[_0xd508('0x33')]:_0x39d836[_0xd508('0x2e')];_0x3fc8d4[_0xd508('0x38')]=qs[_0xd508('0x4e')](_0x55ab86[_0xd508('0x30')][_0xd508('0x4e')]);_0x3fc8d4[_0xd508('0x39')]=qs[_0xd508('0x32')](_[_0xd508('0x3a')](_0x55ab86[_0xd508('0x30')],_0x39d836[_0xd508('0x32')]));if(_0x55ab86['query'][_0xd508('0x3b')]){_0x3fc8d4[_0xd508('0x39')]=_[_0xd508('0x3c')](_0x3fc8d4[_0xd508('0x39')],{'$or':_[_0xd508('0x2f')](_0x3fc8d4[_0xd508('0x33')],function(_0x43aa9c){var _0x2d0d0e={};_0x2d0d0e[_0x43aa9c]={'$like':'%'+_0x55ab86[_0xd508('0x30')][_0xd508('0x3b')]+'%'};return _0x2d0d0e;})});}_0x3fc8d4=_[_0xd508('0x3c')]({},_0x3fc8d4,_0x55ab86[_0xd508('0x3e')]);return _0x5a9c26[_0xd508('0x4c')](_0x3fc8d4);}})[_0xd508('0x22')](function(_0x5bc5ba){if(_0x5bc5ba){_0x107c03=_0x5bc5ba[_0xd508('0x36')];if(!_0x55ab86['query'][_0xd508('0x4f')]('nolimit')){_0x3fc8d4[_0xd508('0x1b')]=qs[_0xd508('0x1b')](_0x55ab86[_0xd508('0x30')][_0xd508('0x1b')]);_0x3fc8d4['offset']=qs['offset'](_0x55ab86[_0xd508('0x30')][_0xd508('0x19')]);}return _0x5a9c26[_0xd508('0x4c')](_0x3fc8d4);}})['then'](function(_0x5d1b06){if(_0x5d1b06){return _0x5d1b06?{'count':_0x107c03,'rows':_0x5d1b06}:null;}})[_0xd508('0x22')](respondWithResult(_0x5e7d14,null))[_0xd508('0x43')](handleError(_0x5e7d14,null));};exports['addActions']=function(_0x4b878d,_0x180bd1,_0x5377f3){return db[_0xd508('0x50')]['find']({'where':{'id':_0x4b878d[_0xd508('0x45')]['id']}})['then'](handleEntityNotFound(_0x180bd1,null))[_0xd508('0x22')](function(_0x529e59){if(_0x529e59){return _0x529e59[_0xd508('0x51')](_0x4b878d[_0xd508('0x48')][_0xd508('0x52')],_[_0xd508('0x4b')](_0x4b878d[_0xd508('0x48')],['ids','id'])||{});}})[_0xd508('0x22')](respondWithResult(_0x180bd1,null))[_0xd508('0x43')](handleError(_0x180bd1,null));};exports[_0xd508('0x53')]=function(_0x31f48e,_0x82ea2,_0x29c328){var _0x19cbcb={};var _0x29fbb6={};var _0x1e8ac4;var _0x5747c6;return db[_0xd508('0x29')][_0xd508('0x4d')]({'where':{'id':_0x31f48e[_0xd508('0x45')]['id']}})['then'](handleEntityNotFound(_0x82ea2,null))[_0xd508('0x22')](function(_0x5ab84b){if(_0x5ab84b){_0x1e8ac4=_0x5ab84b;_0x29fbb6[_0xd508('0x2e')]=_[_0xd508('0x31')](db['Action'][_0xd508('0x2a')]);_0x29fbb6[_0xd508('0x30')]=_[_0xd508('0x31')](_0x31f48e[_0xd508('0x30')]);_0x29fbb6[_0xd508('0x32')]=_[_0xd508('0x34')](_0x29fbb6['model'],_0x29fbb6[_0xd508('0x30')]);_0x19cbcb[_0xd508('0x33')]=_['intersection'](_0x29fbb6[_0xd508('0x2e')],qs['fields'](_0x31f48e['query'][_0xd508('0x35')]));_0x19cbcb[_0xd508('0x33')]=_0x19cbcb[_0xd508('0x33')][_0xd508('0x36')]?_0x19cbcb['attributes']:_0x29fbb6[_0xd508('0x2e')];_0x19cbcb['order']=qs[_0xd508('0x4e')](_0x31f48e['query'][_0xd508('0x4e')]);_0x19cbcb[_0xd508('0x39')]=qs['filters'](_['pick'](_0x31f48e[_0xd508('0x30')],_0x29fbb6['filters']));if(_0x31f48e['query'][_0xd508('0x3b')]){_0x19cbcb[_0xd508('0x39')]=_['merge'](_0x19cbcb[_0xd508('0x39')],{'$or':_['map'](_0x19cbcb[_0xd508('0x33')],function(_0xe08e6e){var _0x2b0221={};_0x2b0221[_0xe08e6e]={'$like':'%'+_0x31f48e[_0xd508('0x30')][_0xd508('0x3b')]+'%'};return _0x2b0221;})});}_0x19cbcb=_[_0xd508('0x3c')]({},_0x19cbcb,_0x31f48e[_0xd508('0x3e')]);return _0x1e8ac4[_0xd508('0x53')](_0x19cbcb);}})[_0xd508('0x22')](function(_0x979091){if(_0x979091){_0x5747c6=_0x979091[_0xd508('0x36')];if(!_0x31f48e[_0xd508('0x30')][_0xd508('0x4f')](_0xd508('0x37'))){_0x19cbcb['limit']=qs['limit'](_0x31f48e[_0xd508('0x30')][_0xd508('0x1b')]);_0x19cbcb[_0xd508('0x19')]=qs[_0xd508('0x19')](_0x31f48e['query'][_0xd508('0x19')]);}return _0x1e8ac4[_0xd508('0x53')](_0x19cbcb);}})[_0xd508('0x22')](function(_0x14f36c){if(_0x14f36c){return _0x14f36c?{'count':_0x5747c6,'rows':_0x14f36c}:null;}})[_0xd508('0x22')](respondWithResult(_0x82ea2,null))[_0xd508('0x43')](handleError(_0x82ea2,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 36c7c46..7c8a85a 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 _0xb57b=['tools_automations','lodash','util','../../config/logger','api','moment','request-promise','path','./automation.attributes','exports','define','Automation'];(function(_0x49d703,_0x347cc){var _0x5ec762=function(_0x8067a3){while(--_0x8067a3){_0x49d703['push'](_0x49d703['shift']());}};_0x5ec762(++_0x347cc);}(_0xb57b,0x1b1));var _0xbb57=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb57b[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xbb57('0x0'));var util=require(_0xbb57('0x1'));var logger=require(_0xbb57('0x2'))(_0xbb57('0x3'));var moment=require(_0xbb57('0x4'));var BPromise=require('bluebird');var rp=require(_0xbb57('0x5'));var fs=require('fs');var path=require(_0xbb57('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbb57('0x7'));module[_0xbb57('0x8')]=function(_0x560ad5,_0x2ad427){return _0x560ad5[_0xbb57('0x9')](_0xbb57('0xa'),attributes,{'tableName':_0xbb57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1b9=['bluebird','request-promise','../../config/environment','./automation.attributes','define','Automation','tools_automations','../../config/logger','api'];(function(_0x2e855c,_0x1812f2){var _0x1e0860=function(_0x586bec){while(--_0x586bec){_0x2e855c['push'](_0x2e855c['shift']());}};_0x1e0860(++_0x1812f2);}(_0xc1b9,0x178));var _0x9c1b=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xc1b9[_0x3b3f4f];return _0x174dbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9c1b('0x0'))(_0x9c1b('0x1'));var moment=require('moment');var BPromise=require(_0x9c1b('0x2'));var rp=require(_0x9c1b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9c1b('0x4'));var attributes=require(_0x9c1b('0x5'));module['exports']=function(_0x4935b4,_0x342117){return _0x4935b4[_0x9c1b('0x6')](_0x9c1b('0x7'),attributes,{'tableName':_0x9c1b('0x8'),'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 2ebf00d..5ee4027 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 _0x02a7=['Automation,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x02a7,0x1a6));var _0x702a=function(_0x121905,_0x4b2c02){_0x121905=_0x121905-0x0;var _0x582f44=_0x02a7[_0x121905];return _0x582f44;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('Automation,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('Automation,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});} \ No newline at end of file +var _0x1516=['../../config/environment','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1516,0xb0));var _0x6151=function(_0x2163f5,_0x4ec207){_0x2163f5=_0x2163f5-0x0;var _0x4bf4c2=_0x1516[_0x2163f5];return _0x4bf4c2;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x319164,_0x3fa962,_0x46e22f){return new BPromise(function(_0x43513c,_0x44cc85){return client[_0x6151('0xb')](_0x319164,_0x46e22f)[_0x6151('0xc')](function(_0x5c5b55){logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));logger[_0x6151('0xf')](_0x6151('0x10'),_0x3fa962,_0x6151('0xe'),JSON[_0x6151('0x11')](_0x5c5b55));if(_0x5c5b55[_0x6151('0x12')]){if(_0x5c5b55[_0x6151('0x12')][_0x6151('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x44cc85(_0x5c5b55[_0x6151('0x12')]['message']);}logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x43513c(_0x5c5b55['error'][_0x6151('0x14')]);}else{logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));_0x43513c(_0x5c5b55[_0x6151('0x15')][_0x6151('0x14')]);}})[_0x6151('0x16')](function(_0x12524a){logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x12524a);_0x44cc85(_0x12524a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 9280ee8..915afd1 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 _0x2e35=['put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x2e35,0x101));var _0x52e3=function(_0x4d9f21,_0x2419f7){_0x4d9f21=_0x4d9f21-0x0;var _0x570d53=_0x2e35[_0x4d9f21];return _0x570d53;};'use strict';var multer=require(_0x52e3('0x0'));var util=require('util');var path=require(_0x52e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x52e3('0x2'));var router=express[_0x52e3('0x3')]();var fs_extra=require(_0x52e3('0x4'));var auth=require(_0x52e3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x52e3('0x6'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x52e3('0x7')]);router[_0x52e3('0x8')](_0x52e3('0x9'),auth[_0x52e3('0xa')](),controller[_0x52e3('0xb')]);router[_0x52e3('0x8')](_0x52e3('0xc'),auth[_0x52e3('0xa')](),controller['getConditions']);router[_0x52e3('0x8')](_0x52e3('0xd'),auth[_0x52e3('0xa')](),controller[_0x52e3('0xe')]);router[_0x52e3('0xf')]('/',auth[_0x52e3('0xa')](),controller[_0x52e3('0x10')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0x52e3('0x11')]);router[_0x52e3('0xf')](_0x52e3('0xd'),auth['isAuthenticated'](),controller[_0x52e3('0x12')]);router[_0x52e3('0x13')]('/:id',auth[_0x52e3('0xa')](),controller[_0x52e3('0x14')]);router['delete'](_0x52e3('0x9'),auth[_0x52e3('0xa')](),controller[_0x52e3('0x15')]);module[_0x52e3('0x16')]=router; \ No newline at end of file +var _0xb734=['connect-timeout','express','Router','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','delete','destroy','exports','multer','util','path'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0xb734,0xe3));var _0x4b73=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0xb734[_0x297c55];return _0x120389;};'use strict';var multer=require(_0x4b73('0x0'));var util=require(_0x4b73('0x1'));var path=require(_0x4b73('0x2'));var timeout=require(_0x4b73('0x3'));var express=require(_0x4b73('0x4'));var router=express[_0x4b73('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4b73('0x6'));var controller=require(_0x4b73('0x7'));router[_0x4b73('0x8')]('/',auth[_0x4b73('0x9')](),controller[_0x4b73('0xa')]);router[_0x4b73('0x8')](_0x4b73('0xb'),auth['isAuthenticated'](),controller[_0x4b73('0xc')]);router[_0x4b73('0x8')]('/:id/conditions',auth[_0x4b73('0x9')](),controller['getConditions']);router[_0x4b73('0x8')](_0x4b73('0xd'),auth['isAuthenticated'](),controller[_0x4b73('0xe')]);router[_0x4b73('0xf')]('/',auth[_0x4b73('0x9')](),controller[_0x4b73('0x10')]);router[_0x4b73('0xf')](_0x4b73('0x11'),auth[_0x4b73('0x9')](),controller[_0x4b73('0x12')]);router[_0x4b73('0xf')](_0x4b73('0xd'),auth[_0x4b73('0x9')](),controller[_0x4b73('0x13')]);router['put'](_0x4b73('0xb'),auth[_0x4b73('0x9')](),controller['update']);router[_0x4b73('0x14')](_0x4b73('0xb'),auth['isAuthenticated'](),controller[_0x4b73('0x15')]);module[_0x4b73('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 203d2c9..df2a63c 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 _0x80a2=['ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','sequelize','exports','STRING'];(function(_0x2d03f7,_0x453538){var _0x5e2e61=function(_0x5e78f7){while(--_0x5e78f7){_0x2d03f7['push'](_0x2d03f7['shift']());}};_0x5e2e61(++_0x453538);}(_0x80a2,0xf9));var _0x280a=function(_0x2d6684,_0x86ef71){_0x2d6684=_0x2d6684-0x0;var _0x2bb5e2=_0x80a2[_0x2d6684];return _0x2bb5e2;};'use strict';var Sequelize=require(_0x280a('0x0'));module[_0x280a('0x1')]={'name':{'type':Sequelize[_0x280a('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x280a('0x3')](_0x280a('0x4')),'allowNull':![],'defaultValue':_0x280a('0x4')},'description':{'type':Sequelize[_0x280a('0x2')]},'active':{'type':Sequelize[_0x280a('0x5')],'defaultValue':0x0,'comment':_0x280a('0x6')},'limitCalls':{'type':Sequelize[_0x280a('0x7')](0x4)[_0x280a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x280a('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x280a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x280a('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'comment':_0x280a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('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[_0x280a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x280a('0x3')](_0x280a('0xf'),_0x280a('0x10'),'onlyIfOpen'),'defaultValue':_0x280a('0xf')},'dialAMDActive':{'type':Sequelize[_0x280a('0x5')],'defaultValue':0x0,'comment':_0x280a('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x280a('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x280a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x280a('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x280a('0x7')](0x9)[_0x280a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x280a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x280a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x280a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x280a('0x7')](0x9)[_0x280a('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x280a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x280a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x280a('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x280a('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x280a('0x3')](_0x280a('0x19'),_0x280a('0x1a')),'defaultValue':_0x280a('0x19')},'dialPrefix':{'type':Sequelize[_0x280a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x280a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x280a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x23')}}; \ No newline at end of file +var _0x787c=['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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x26559a,_0x3f9fe6){var _0x3c7d9e=function(_0x158106){while(--_0x158106){_0x26559a['push'](_0x26559a['shift']());}};_0x3c7d9e(++_0x3f9fe6);}(_0x787c,0x172));var _0xc787=function(_0x21045d,_0x2720a4){_0x21045d=_0x21045d-0x0;var _0x128bd9=_0x787c[_0x21045d];return _0x128bd9;};'use strict';var Sequelize=require(_0xc787('0x0'));module['exports']={'name':{'type':Sequelize[_0xc787('0x1')],'unique':_0xc787('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc787('0x3')](_0xc787('0x4')),'allowNull':![],'defaultValue':_0xc787('0x4')},'description':{'type':Sequelize[_0xc787('0x1')]},'active':{'type':Sequelize[_0xc787('0x5')],'defaultValue':0x0,'comment':_0xc787('0x6')},'limitCalls':{'type':Sequelize[_0xc787('0x7')](0x4)[_0xc787('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc787('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc787('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc787('0xe')},'dialTimezone':{'type':Sequelize[_0xc787('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc787('0x1')],'defaultValue':_0xc787('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc787('0x10'),_0xc787('0x11'),_0xc787('0x12')),'defaultValue':_0xc787('0x10')},'dialAMDActive':{'type':Sequelize[_0xc787('0x5')],'defaultValue':0x0,'comment':_0xc787('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc787('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc787('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc787('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc787('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc787('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc787('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc787('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc787('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc787('0x3')](_0xc787('0x1b'),_0xc787('0x1c')),'defaultValue':_0xc787('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc787('0x1d')},'dialCutDigit':{'type':Sequelize[_0xc787('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc787('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4b17269..8f9254b 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 _0x409b=['insert','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','select','phone\x20IS\x20NOT\x20NULL','into','cm_hopper_additional_phones','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','order','CampaignId','findAll','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always'];(function(_0x54b026,_0x17f28d){var _0x14fe1d=function(_0x2a340b){while(--_0x2a340b){_0x54b026['push'](_0x54b026['shift']());}};_0x14fe1d(++_0x17f28d);}(_0x409b,0x14a));var _0xb409=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x409b[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0xb409('0x0'));var rimraf=require(_0xb409('0x1'));var zipdir=require(_0xb409('0x2'));var jsonpatch=require(_0xb409('0x3'));var rp=require(_0xb409('0x4'));var moment=require(_0xb409('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb409('0x6'));var util=require(_0xb409('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb409('0x8'));var fs=require('fs');var fs_extra=require(_0xb409('0x9'));var _=require(_0xb409('0xa'));var squel=require(_0xb409('0xb'));var crypto=require(_0xb409('0xc'));var jsforce=require(_0xb409('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb409('0xe'));var querystring=require(_0xb409('0xf'));var Papa=require(_0xb409('0x10'));var Redis=require('ioredis');var authService=require(_0xb409('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb409('0x12'));var hardwareService=require(_0xb409('0x13'));var logger=require(_0xb409('0x14'))('api');var utils=require(_0xb409('0x15'));var config=require(_0xb409('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb409('0x17'))['db'];function respondWithStatusCode(_0x21fa25,_0x23bd15){_0x23bd15=_0x23bd15||0xcc;return function(_0x6b563c){if(_0x6b563c){return _0x21fa25[_0xb409('0x18')](_0x23bd15);}return _0x21fa25[_0xb409('0x19')](_0x23bd15)['end']();};}function respondWithResult(_0x1e6895,_0x75b07e){_0x75b07e=_0x75b07e||0xc8;return function(_0x128035){if(_0x128035){return _0x1e6895[_0xb409('0x19')](_0x75b07e)[_0xb409('0x1a')](_0x128035);}};}function respondWithFilteredResult(_0x4f596b,_0xd19d17){return function(_0x58bb54){if(_0x58bb54){var _0x32c205=typeof _0xd19d17[_0xb409('0x1b')]===_0xb409('0x1c')&&typeof _0xd19d17[_0xb409('0x1d')]===_0xb409('0x1c');var _0x3975d0=_0x58bb54[_0xb409('0x1e')];var _0x12b1de=_0x32c205?0x0:_0xd19d17[_0xb409('0x1b')];var _0xf4a437=_0x32c205?_0x58bb54[_0xb409('0x1e')]:_0xd19d17[_0xb409('0x1b')]+_0xd19d17[_0xb409('0x1d')];var _0x1dd011;if(_0xf4a437>=_0x3975d0){_0xf4a437=_0x3975d0;_0x1dd011=0xc8;}else{_0x1dd011=0xce;}_0x4f596b[_0xb409('0x19')](_0x1dd011);return _0x4f596b['set']('Content-Range',_0x12b1de+'-'+_0xf4a437+'/'+_0x3975d0)[_0xb409('0x1a')](_0x58bb54);}return null;};}function patchUpdates(_0x24af7d){return function(_0x22d9ed){try{jsonpatch['apply'](_0x22d9ed,_0x24af7d,!![]);}catch(_0x4df44e){return BPromise['reject'](_0x4df44e);}return _0x22d9ed['save']();};}function saveUpdates(_0x443563,_0x437d9f){return function(_0x406324){if(_0x406324){return _0x406324[_0xb409('0x1f')](_0x443563)[_0xb409('0x20')](function(_0x17a506){return _0x17a506;});}return null;};}function removeEntity(_0x3b629f,_0x12789d){return function(_0x45979e){if(_0x45979e){return _0x45979e[_0xb409('0x21')]()[_0xb409('0x20')](function(){var _0x22c2ac=_0x45979e['get']({'plain':!![]});var _0x306511=_0xb409('0x22');return db[_0xb409('0x23')]['destroy']({'where':{'type':_0x306511,'resourceId':_0x22c2ac['id']}})['then'](function(){return _0x45979e;});})[_0xb409('0x20')](function(){_0x3b629f[_0xb409('0x19')](0xcc)[_0xb409('0x24')]();});}};}function handleEntityNotFound(_0x45c1b1,_0x169929){return function(_0x365233){if(!_0x365233){_0x45c1b1[_0xb409('0x18')](0x194);}return _0x365233;};}function handleError(_0x3439ce,_0x51000f){_0x51000f=_0x51000f||0x1f4;return function(_0x5343b8){logger[_0xb409('0x25')](_0x5343b8[_0xb409('0x26')]);if(_0x5343b8[_0xb409('0x27')]){delete _0x5343b8['name'];}_0x3439ce[_0xb409('0x19')](_0x51000f)[_0xb409('0x28')](_0x5343b8);};}exports[_0xb409('0x29')]=function(_0x78e448,_0x3b403a){var _0x454ff8={},_0x104469={},_0x3a60e3={'count':0x0,'rows':[]};var _0x1c3f9a=_[_0xb409('0x2a')](db[_0xb409('0x2b')]['rawAttributes'],function(_0x350b92){return{'name':_0x350b92['fieldName'],'type':_0x350b92[_0xb409('0x2c')][_0xb409('0x2d')]};});_0x104469[_0xb409('0x2e')]=_[_0xb409('0x2a')](_0x1c3f9a,_0xb409('0x27'));_0x104469['query']=_[_0xb409('0x2f')](_0x78e448[_0xb409('0x30')]);_0x104469[_0xb409('0x31')]=_[_0xb409('0x32')](_0x104469[_0xb409('0x2e')],_0x104469[_0xb409('0x30')]);_0x454ff8[_0xb409('0x33')]=_[_0xb409('0x32')](_0x104469['model'],qs['fields'](_0x78e448[_0xb409('0x30')][_0xb409('0x34')]));_0x454ff8['attributes']=_0x454ff8[_0xb409('0x33')][_0xb409('0x35')]?_0x454ff8[_0xb409('0x33')]:_0x104469[_0xb409('0x2e')];if(!_0x78e448[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x454ff8[_0xb409('0x1d')]=qs['limit'](_0x78e448[_0xb409('0x30')]['limit']);_0x454ff8[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x78e448[_0xb409('0x30')][_0xb409('0x1b')]);}_0x454ff8['order']=qs[_0xb409('0x38')](_0x78e448[_0xb409('0x30')][_0xb409('0x38')]);_0x454ff8[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x78e448[_0xb409('0x30')],_0x104469[_0xb409('0x31')]),_0x1c3f9a);if(_0x78e448[_0xb409('0x30')]['filter']){_0x454ff8[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x454ff8[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x1c3f9a,function(_0x134ced){if(_0x134ced[_0xb409('0x2c')]!==_0xb409('0x3c')){var _0x506f4e={};_0x506f4e[_0x134ced[_0xb409('0x27')]]={'$like':'%'+_0x78e448[_0xb409('0x30')][_0xb409('0x3d')]+'%'};return _0x506f4e;}})});}_0x454ff8=_[_0xb409('0x3b')]({},_0x454ff8,_0x78e448[_0xb409('0x3e')]);var _0x558dbc={'where':_0x454ff8[_0xb409('0x39')]};return db[_0xb409('0x2b')]['count'](_0x558dbc)['then'](function(_0x33d3a6){_0x3a60e3[_0xb409('0x1e')]=_0x33d3a6;if(_0x78e448[_0xb409('0x30')][_0xb409('0x3f')]){_0x454ff8[_0xb409('0x40')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x454ff8);})[_0xb409('0x20')](function(_0x17e804){_0x3a60e3['rows']=_0x17e804;return _0x3a60e3;})[_0xb409('0x20')](respondWithFilteredResult(_0x3b403a,_0x454ff8))[_0xb409('0x41')](handleError(_0x3b403a,null));};exports[_0xb409('0x42')]=function(_0x1fb07d,_0x92a4ed){var _0x17476e={'raw':![],'where':{'id':_0x1fb07d[_0xb409('0x43')]['id']}},_0xb2cf52={};_0xb2cf52['model']=_[_0xb409('0x2f')](db[_0xb409('0x2b')][_0xb409('0x44')]);_0xb2cf52[_0xb409('0x30')]=_['keys'](_0x1fb07d[_0xb409('0x30')]);_0xb2cf52[_0xb409('0x31')]=_[_0xb409('0x32')](_0xb2cf52[_0xb409('0x2e')],_0xb2cf52[_0xb409('0x30')]);_0x17476e[_0xb409('0x33')]=_['intersection'](_0xb2cf52[_0xb409('0x2e')],qs['fields'](_0x1fb07d[_0xb409('0x30')][_0xb409('0x34')]));_0x17476e[_0xb409('0x33')]=_0x17476e['attributes'][_0xb409('0x35')]?_0x17476e[_0xb409('0x33')]:_0xb2cf52['model'];if(_0x1fb07d[_0xb409('0x30')]['includeAll']){_0x17476e[_0xb409('0x40')]=[{'all':!![]}];}_0x17476e=_[_0xb409('0x3b')]({},_0x17476e,_0x1fb07d[_0xb409('0x3e')]);return db[_0xb409('0x2b')][_0xb409('0x45')](_0x17476e)[_0xb409('0x20')](handleEntityNotFound(_0x92a4ed,null))['then'](respondWithResult(_0x92a4ed,null))['catch'](handleError(_0x92a4ed,null));};exports[_0xb409('0x46')]=function(_0x7f59a6,_0x541c95){return db[_0xb409('0x2b')]['create'](_0x7f59a6['body'],{})[_0xb409('0x20')](function(_0xbefbd9){var _0x217d34=_0x7f59a6[_0xb409('0x47')]['get']({'plain':!![]});if(!_0x217d34)throw new Error(_0xb409('0x48'));if(_0x217d34[_0xb409('0x49')]===_0xb409('0x47')){var _0x6c49=_0xbefbd9[_0xb409('0x4a')]({'plain':!![]});var _0x3dd13b=_0xb409('0x22');return db[_0xb409('0x4b')][_0xb409('0x45')]({'where':{'name':_0x3dd13b,'userProfileId':_0x217d34[_0xb409('0x4c')]},'raw':!![]})['then'](function(_0x3940d5){if(_0x3940d5&&_0x3940d5[_0xb409('0x4d')]===0x0){return db[_0xb409('0x23')][_0xb409('0x46')]({'name':_0x6c49['name'],'resourceId':_0x6c49['id'],'type':_0x3940d5['name'],'sectionId':_0x3940d5['id']},{})[_0xb409('0x20')](function(){return _0xbefbd9;});}else{return _0xbefbd9;}})[_0xb409('0x41')](function(_0x56036d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56036d);throw _0x56036d;});}return _0xbefbd9;})['then'](respondWithResult(_0x541c95,0xc9))['catch'](handleError(_0x541c95,null));};exports[_0xb409('0x4e')]=function(_0x148176,_0x5bea07){var _0x404278={'where':{'id':_0x148176[_0xb409('0x43')]['id']}},_0x22d537={};_0x22d537['model']=_[_0xb409('0x2f')](db[_0xb409('0x2b')][_0xb409('0x44')]);_0x404278[_0xb409('0x33')]=_[_0xb409('0x32')](_0x22d537['model'],qs[_0xb409('0x34')](_0x148176[_0xb409('0x30')][_0xb409('0x34')]));_0x404278[_0xb409('0x33')]=_0x404278['attributes'][_0xb409('0x35')]?_0x404278[_0xb409('0x33')]:_0x22d537[_0xb409('0x2e')];if(_0x148176[_0xb409('0x30')][_0xb409('0x3f')]){_0x404278[_0xb409('0x40')]=[{'all':!![]}];}_0x404278=_['merge']({},_0x404278,_0x148176['options']);return db['Campaign'][_0xb409('0x45')](_0x404278)[_0xb409('0x20')](handleEntityNotFound(_0x5bea07,null))[_0xb409('0x20')](function(_0x39712b){if(_0x39712b){var _0x265f7c=_0x39712b[_0xb409('0x4a')]({'plain':!![]});_0x265f7c=qs[_0xb409('0x4f')](_0x265f7c,['id',_0xb409('0x50'),_0xb409('0x51')]);_0x148176['body']=_[_0xb409('0x4f')](_0x148176[_0xb409('0x52')],['id',_0xb409('0x50'),'updatedAt']);return db[_0xb409('0x2b')][_0xb409('0x46')](_[_0xb409('0x3b')](_0x265f7c,_0x148176[_0xb409('0x52')]),{'include':_0x148176[_0xb409('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0xb409('0x20')](function(_0x5cf9ec){var _0x514542=_0x148176[_0xb409('0x47')]['get']({'plain':!![]});if(!_0x514542)throw new Error(_0xb409('0x48'));if(_0x514542[_0xb409('0x49')]===_0xb409('0x47')){var _0x2ca6b3=_0x5cf9ec[_0xb409('0x4a')]({'plain':!![]});var _0x416ff6=_0xb409('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x416ff6,'userProfileId':_0x514542[_0xb409('0x4c')]},'raw':!![]})['then'](function(_0x56fdde){if(_0x56fdde&&_0x56fdde['autoAssociation']===0x0){return db[_0xb409('0x23')][_0xb409('0x46')]({'name':_0x2ca6b3[_0xb409('0x27')],'resourceId':_0x2ca6b3['id'],'type':_0x56fdde[_0xb409('0x27')],'sectionId':_0x56fdde['id']},{})['then'](function(){return _0x5cf9ec;});}else{return _0x5cf9ec;}})[_0xb409('0x41')](function(_0x2a21a2){logger[_0xb409('0x25')](_0xb409('0x53'),_0x2a21a2);throw _0x2a21a2;});}return _0x5cf9ec;});}})['then'](respondWithResult(_0x5bea07,0xc9))['catch'](handleError(_0x5bea07,null));};exports[_0xb409('0x1f')]=function(_0x354bfb,_0x4fe681){if(_0x354bfb[_0xb409('0x52')]['id']){delete _0x354bfb[_0xb409('0x52')]['id'];}return db[_0xb409('0x2b')]['find']({'where':{'id':_0x354bfb['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x4fe681,null))[_0xb409('0x20')](saveUpdates(_0x354bfb[_0xb409('0x52')],null))['then'](respondWithResult(_0x4fe681,null))['catch'](handleError(_0x4fe681,null));};exports[_0xb409('0x21')]=function(_0x3cdebb,_0x246a15){return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x3cdebb['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x246a15,null))[_0xb409('0x20')](removeEntity(_0x246a15,null))[_0xb409('0x41')](handleError(_0x246a15,null));};exports[_0xb409('0x54')]=function(_0x5f056e,_0x39cb6c,_0x30d3e3){var _0x2a00fb={'raw':!![],'where':{}};var _0x1c3e1f={};var _0x4532ab={'count':0x0,'rows':[]};return db['Campaign'][_0xb409('0x55')]({'where':{'id':_0x5f056e['params']['id']}})['then'](handleEntityNotFound(_0x39cb6c,null))[_0xb409('0x20')](function(_0x6c0ca4){if(_0x6c0ca4){_0x1c3e1f[_0xb409('0x2e')]=_['keys'](db[_0xb409('0x56')]['rawAttributes']);_0x1c3e1f[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x5f056e[_0xb409('0x30')]);_0x1c3e1f[_0xb409('0x31')]=_[_0xb409('0x32')](_0x1c3e1f[_0xb409('0x2e')],_0x1c3e1f[_0xb409('0x30')]);_0x2a00fb[_0xb409('0x33')]=_[_0xb409('0x32')](_0x1c3e1f[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x5f056e['query'][_0xb409('0x34')]));_0x2a00fb[_0xb409('0x33')]=_0x2a00fb[_0xb409('0x33')]['length']?_0x2a00fb['attributes']:_0x1c3e1f[_0xb409('0x2e')];if(!_0x5f056e[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x2a00fb[_0xb409('0x1d')]=qs[_0xb409('0x1d')](_0x5f056e[_0xb409('0x30')][_0xb409('0x1d')]);_0x2a00fb[_0xb409('0x1b')]=qs['offset'](_0x5f056e['query']['offset']);}_0x2a00fb[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x5f056e[_0xb409('0x30')][_0xb409('0x38')]);_0x2a00fb[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x5f056e[_0xb409('0x30')],_0x1c3e1f[_0xb409('0x31')]));_0x2a00fb[_0xb409('0x39')][_0xb409('0x58')]=_0x6c0ca4['id'];if(_0x5f056e[_0xb409('0x30')][_0xb409('0x3d')]){_0x2a00fb[_0xb409('0x39')]=_['merge'](_0x2a00fb[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x2a00fb[_0xb409('0x33')],function(_0x233444){var _0x3334a6={};_0x3334a6[_0x233444]={'$like':'%'+_0x5f056e[_0xb409('0x30')]['filter']+'%'};return _0x3334a6;})});}_0x2a00fb=_['merge']({},_0x2a00fb,_0x5f056e[_0xb409('0x3e')]);return db[_0xb409('0x56')]['count']({'where':_0x2a00fb[_0xb409('0x39')]})[_0xb409('0x20')](function(_0x2884f4){_0x4532ab[_0xb409('0x1e')]=_0x2884f4;if(_0x5f056e[_0xb409('0x30')][_0xb409('0x3f')]){_0x2a00fb[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x56')][_0xb409('0x59')](_0x2a00fb);})[_0xb409('0x20')](function(_0x2ddad3){_0x4532ab[_0xb409('0x5a')]=_0x2ddad3;return _0x4532ab;});}})['then'](respondWithFilteredResult(_0x39cb6c,_0x2a00fb))[_0xb409('0x41')](handleError(_0x39cb6c,null));};exports['getHopperHistories']=function(_0x56cbad,_0x273a8b,_0x1fe092){var _0xb84e5a={'raw':!![],'where':{}};var _0x337dd2={};var _0x5e2ecd={'count':0x0,'rows':[]};return db['Campaign'][_0xb409('0x55')]({'where':{'id':_0x56cbad[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x273a8b,null))[_0xb409('0x20')](function(_0x3d5dfa){if(_0x3d5dfa){_0x337dd2[_0xb409('0x2e')]=_['keys'](db[_0xb409('0x5b')][_0xb409('0x44')]);_0x337dd2[_0xb409('0x30')]=_['keys'](_0x56cbad[_0xb409('0x30')]);_0x337dd2[_0xb409('0x31')]=_[_0xb409('0x32')](_0x337dd2[_0xb409('0x2e')],_0x337dd2[_0xb409('0x30')]);_0xb84e5a[_0xb409('0x33')]=_[_0xb409('0x32')](_0x337dd2[_0xb409('0x2e')],qs['fields'](_0x56cbad['query'][_0xb409('0x34')]));_0xb84e5a[_0xb409('0x33')]=_0xb84e5a[_0xb409('0x33')][_0xb409('0x35')]?_0xb84e5a[_0xb409('0x33')]:_0x337dd2[_0xb409('0x2e')];if(!_0x56cbad[_0xb409('0x30')][_0xb409('0x36')]('nolimit')){_0xb84e5a['limit']=qs[_0xb409('0x1d')](_0x56cbad['query'][_0xb409('0x1d')]);_0xb84e5a['offset']=qs[_0xb409('0x1b')](_0x56cbad[_0xb409('0x30')][_0xb409('0x1b')]);}_0xb84e5a[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x56cbad[_0xb409('0x30')][_0xb409('0x38')]);_0xb84e5a['where']=qs['filters'](_['pick'](_0x56cbad[_0xb409('0x30')],_0x337dd2[_0xb409('0x31')]));_0xb84e5a[_0xb409('0x39')]['CampaignId']=_0x3d5dfa['id'];if(_0x56cbad[_0xb409('0x30')][_0xb409('0x3d')]){_0xb84e5a[_0xb409('0x39')]=_[_0xb409('0x3b')](_0xb84e5a[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0xb84e5a[_0xb409('0x33')],function(_0x412d31){var _0x1ea7e4={};_0x1ea7e4[_0x412d31]={'$like':'%'+_0x56cbad[_0xb409('0x30')][_0xb409('0x3d')]+'%'};return _0x1ea7e4;})});}_0xb84e5a=_[_0xb409('0x3b')]({},_0xb84e5a,_0x56cbad[_0xb409('0x3e')]);return db['CmHopperHistory'][_0xb409('0x1e')]({'where':_0xb84e5a[_0xb409('0x39')]})[_0xb409('0x20')](function(_0x4059e2){_0x5e2ecd['count']=_0x4059e2;if(_0x56cbad['query'][_0xb409('0x3f')]){_0xb84e5a[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x5b')][_0xb409('0x59')](_0xb84e5a);})[_0xb409('0x20')](function(_0x74febb){_0x5e2ecd['rows']=_0x74febb;return _0x5e2ecd;});}})[_0xb409('0x20')](respondWithFilteredResult(_0x273a8b,_0xb84e5a))[_0xb409('0x41')](handleError(_0x273a8b,null));};exports[_0xb409('0x5c')]=function(_0x431adc,_0x1adaeb,_0x36d847){var _0x97b9a0={'raw':!![],'where':{}};var _0x498f68={};var _0x28caf4={'count':0x0,'rows':[]};return db[_0xb409('0x2b')]['findOne']({'where':{'id':_0x431adc['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x1adaeb,null))['then'](function(_0x144e28){if(_0x144e28){_0x498f68[_0xb409('0x2e')]=_['keys'](db['CmHopperFinal'][_0xb409('0x44')]);_0x498f68[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x431adc[_0xb409('0x30')]);_0x498f68[_0xb409('0x31')]=_['intersection'](_0x498f68[_0xb409('0x2e')],_0x498f68[_0xb409('0x30')]);_0x97b9a0[_0xb409('0x33')]=_[_0xb409('0x32')](_0x498f68[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x431adc[_0xb409('0x30')][_0xb409('0x34')]));_0x97b9a0[_0xb409('0x33')]=_0x97b9a0[_0xb409('0x33')][_0xb409('0x35')]?_0x97b9a0['attributes']:_0x498f68[_0xb409('0x2e')];if(!_0x431adc['query'][_0xb409('0x36')](_0xb409('0x37'))){_0x97b9a0[_0xb409('0x1d')]=qs['limit'](_0x431adc[_0xb409('0x30')][_0xb409('0x1d')]);_0x97b9a0[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x431adc[_0xb409('0x30')][_0xb409('0x1b')]);}_0x97b9a0[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x431adc[_0xb409('0x30')][_0xb409('0x38')]);_0x97b9a0['where']=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x431adc[_0xb409('0x30')],_0x498f68['filters']));_0x97b9a0[_0xb409('0x39')]['CampaignId']=_0x144e28['id'];if(_0x431adc[_0xb409('0x30')][_0xb409('0x3d')]){_0x97b9a0[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x97b9a0[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x97b9a0[_0xb409('0x33')],function(_0x17e286){var _0x311720={};_0x311720[_0x17e286]={'$like':'%'+_0x431adc[_0xb409('0x30')]['filter']+'%'};return _0x311720;})});}_0x97b9a0=_['merge']({},_0x97b9a0,_0x431adc['options']);return db[_0xb409('0x5d')][_0xb409('0x1e')]({'where':_0x97b9a0['where']})[_0xb409('0x20')](function(_0x2d48c9){_0x28caf4['count']=_0x2d48c9;if(_0x431adc[_0xb409('0x30')][_0xb409('0x3f')]){_0x97b9a0[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x5d')][_0xb409('0x59')](_0x97b9a0);})['then'](function(_0x1e604e){_0x28caf4[_0xb409('0x5a')]=_0x1e604e;return _0x28caf4;});}})[_0xb409('0x20')](respondWithFilteredResult(_0x1adaeb,_0x97b9a0))['catch'](handleError(_0x1adaeb,null));};exports[_0xb409('0x5e')]=function(_0x5a12a8,_0x15a145,_0x3a6a4a){var _0x282ca6={'raw':!![],'where':{}};var _0x5f2791={};var _0x521179={'count':0x0,'rows':[]};return db[_0xb409('0x2b')][_0xb409('0x55')]({'where':{'id':_0x5a12a8[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x15a145,null))[_0xb409('0x20')](function(_0x4d76f2){if(_0x4d76f2){_0x5f2791[_0xb409('0x2e')]=_[_0xb409('0x2f')](db[_0xb409('0x5f')][_0xb409('0x44')]);_0x5f2791[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x5a12a8['query']);_0x5f2791[_0xb409('0x31')]=_[_0xb409('0x32')](_0x5f2791['model'],_0x5f2791[_0xb409('0x30')]);_0x282ca6[_0xb409('0x33')]=_[_0xb409('0x32')](_0x5f2791[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x5a12a8[_0xb409('0x30')][_0xb409('0x34')]));_0x282ca6['attributes']=_0x282ca6[_0xb409('0x33')][_0xb409('0x35')]?_0x282ca6[_0xb409('0x33')]:_0x5f2791['model'];if(!_0x5a12a8[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x282ca6['limit']=qs[_0xb409('0x1d')](_0x5a12a8[_0xb409('0x30')]['limit']);_0x282ca6[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x5a12a8[_0xb409('0x30')][_0xb409('0x1b')]);}_0x282ca6[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x5a12a8[_0xb409('0x30')][_0xb409('0x38')]);_0x282ca6['where']=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x5a12a8['query'],_0x5f2791['filters']));_0x282ca6[_0xb409('0x39')][_0xb409('0x58')]=_0x4d76f2['id'];if(_0x5a12a8[_0xb409('0x30')][_0xb409('0x3d')]){_0x282ca6[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x282ca6[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x282ca6[_0xb409('0x33')],function(_0x1c644a){var _0x3ca917={};_0x3ca917[_0x1c644a]={'$like':'%'+_0x5a12a8['query'][_0xb409('0x3d')]+'%'};return _0x3ca917;})});}_0x282ca6=_['merge']({},_0x282ca6,_0x5a12a8[_0xb409('0x3e')]);return db['CmHopperBlack'][_0xb409('0x1e')]({'where':_0x282ca6[_0xb409('0x39')]})[_0xb409('0x20')](function(_0x3a6fa9){_0x521179[_0xb409('0x1e')]=_0x3a6fa9;if(_0x5a12a8[_0xb409('0x30')][_0xb409('0x3f')]){_0x282ca6[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x5f')][_0xb409('0x59')](_0x282ca6);})[_0xb409('0x20')](function(_0x5c0903){_0x521179[_0xb409('0x5a')]=_0x5c0903;return _0x521179;});}})['then'](respondWithFilteredResult(_0x15a145,_0x282ca6))[_0xb409('0x41')](handleError(_0x15a145,null));};exports['getLists']=function(_0x43fa2b,_0x58319e,_0x25ffc2){var _0xac6978={};var _0x3e59a5={};var _0x1caa62;var _0x2ccd97;return db[_0xb409('0x2b')]['findOne']({'where':{'id':_0x43fa2b[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x58319e,null))['then'](function(_0x1af501){if(_0x1af501){_0x1caa62=_0x1af501;_0x3e59a5[_0xb409('0x2e')]=_[_0xb409('0x2f')](db[_0xb409('0x60')]['rawAttributes']);_0x3e59a5[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x43fa2b[_0xb409('0x30')]);_0x3e59a5[_0xb409('0x31')]=_[_0xb409('0x32')](_0x3e59a5['model'],_0x3e59a5[_0xb409('0x30')]);_0xac6978[_0xb409('0x33')]=_[_0xb409('0x32')](_0x3e59a5['model'],qs[_0xb409('0x34')](_0x43fa2b['query'][_0xb409('0x34')]));_0xac6978[_0xb409('0x33')]=_0xac6978[_0xb409('0x33')]['length']?_0xac6978[_0xb409('0x33')]:_0x3e59a5[_0xb409('0x2e')];_0xac6978[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x43fa2b[_0xb409('0x30')][_0xb409('0x38')]);_0xac6978[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x43fa2b[_0xb409('0x30')],_0x3e59a5['filters']));if(_0x43fa2b[_0xb409('0x30')]['filter']){_0xac6978['where']=_['merge'](_0xac6978['where'],{'$or':_[_0xb409('0x2a')](_0xac6978[_0xb409('0x33')],function(_0x22bdd9){var _0x15515f={};_0x15515f[_0x22bdd9]={'$like':'%'+_0x43fa2b['query'][_0xb409('0x3d')]+'%'};return _0x15515f;})});}_0xac6978=_['merge']({},_0xac6978,_0x43fa2b[_0xb409('0x3e')]);return _0x1caa62[_0xb409('0x61')](_0xac6978);}})[_0xb409('0x20')](function(_0x5d2123){if(_0x5d2123){_0x2ccd97=_0x5d2123[_0xb409('0x35')];if(!_0x43fa2b['query'][_0xb409('0x36')](_0xb409('0x37'))){_0xac6978['limit']=qs['limit'](_0x43fa2b[_0xb409('0x30')][_0xb409('0x1d')]);_0xac6978['offset']=qs['offset'](_0x43fa2b[_0xb409('0x30')]['offset']);}return _0x1caa62[_0xb409('0x61')](_0xac6978);}})[_0xb409('0x20')](function(_0x2dfeb0){if(_0x2dfeb0){return _0x2dfeb0?{'count':_0x2ccd97,'rows':_0x2dfeb0}:null;}})[_0xb409('0x20')](respondWithResult(_0x58319e,null))['catch'](handleError(_0x58319e,null));};exports[_0xb409('0x62')]=function(_0x3b4733,_0xe2750,_0x1708f7){var _0x40b4d5,_0x565de1;var _0x1e9853=[];var _0x2e7cd3=moment()[_0xb409('0x63')](_0xb409('0x64'));return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x3b4733[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0xe2750,null))[_0xb409('0x20')](function(_0x1134f9){if(_0x1134f9){_0x565de1=_0x1134f9;return _0x1134f9[_0xb409('0x62')](_0x3b4733['body'][_0xb409('0x65')],_['omit'](_0x3b4733[_0xb409('0x52')],['ids','id'])||{});}return null;})[_0xb409('0x66')](function(_0x1db146){var _0x14091b;var _0x39cdaf;_0x40b4d5=_0x1db146||[];var _0x4a260b=[];if(_0x1db146){for(var _0xd8720f=0x0;_0xd8720f<_0x1db146[_0xb409('0x35')];_0xd8720f+=0x1){var _0x1d8d1d=_0x1db146[_0xd8720f][_0xb409('0x4a')]({'plain':!![]});_0x565de1[_0xb409('0x67')]=_0x3b4733['body']['dialCheckDuplicateType']?_0x3b4733[_0xb409('0x52')][_0xb409('0x67')]:_0x565de1[_0xb409('0x67')];switch(_0x565de1['dialCheckDuplicateType']){case _0xb409('0x68'):_0x14091b=squel[_0xb409('0x69')]()['into'](_0xb409('0x6a'))[_0xb409('0x6b')]([_0xb409('0x6c'),'scheduledAt',_0xb409('0x6d'),_0xb409('0x6e'),_0xb409('0x58'),_0xb409('0x50'),'updatedAt'],squel['select']()[_0xb409('0x6f')]('phone','phone')[_0xb409('0x6f')](_0xb409('0x70'),'scheduledAt')[_0xb409('0x6f')]('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')](),'ListId')[_0xb409('0x6f')](_0x3b4733['params']['id'][_0xb409('0x72')](),_0xb409('0x58'))['field']('\x27'+_0x2e7cd3+'\x27',_0xb409('0x50'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x51'))[_0xb409('0x73')](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))[_0xb409('0x39')](_0xb409('0x76'),_0x1d8d1d[_0xb409('0x71')]['toString']())[_0xb409('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0xb409('0x39')](_0xb409('0x77'),squel['select']()[_0xb409('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0xb409('0x73')](_0xb409('0x78'))[_0xb409('0x39')](_0xb409('0x79'),_0x3b4733['params']['id'][_0xb409('0x72')]()))[_0xb409('0x39')](_0xb409('0x77'),squel['select']()[_0xb409('0x6f')](_0xb409('0x7a'))[_0xb409('0x73')](_0xb409('0x6a'))['where']('CampaignId\x20=\x20?',_0x3b4733[_0xb409('0x43')]['id']['toString']())))['toString']();break;case _0xb409('0x7b'):_0x14091b=squel[_0xb409('0x69')]()['into'](_0xb409('0x6a'))[_0xb409('0x6b')]([_0xb409('0x6c'),_0xb409('0x7c'),_0xb409('0x6d'),'ListId','CampaignId',_0xb409('0x50'),_0xb409('0x51')],squel[_0xb409('0x7d')]()[_0xb409('0x6f')](_0xb409('0x6c'),'phone')['field'](_0xb409('0x70'),_0xb409('0x7c'))['field']('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')](),_0xb409('0x6e'))[_0xb409('0x6f')](_0x3b4733[_0xb409('0x43')]['id'][_0xb409('0x72')](),'CampaignId')[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x50'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x51'))[_0xb409('0x73')](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))['where'](_0xb409('0x76'),_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0xb409('0x39')](_0xb409('0x77'),squel[_0xb409('0x7d')]()[_0xb409('0x6f')](_0xb409('0x7a'))[_0xb409('0x73')]('cm_hopper')[_0xb409('0x39')](_0xb409('0x79'),_0x3b4733[_0xb409('0x43')]['id'][_0xb409('0x72')]())))[_0xb409('0x72')]();break;default:_0x14091b=squel[_0xb409('0x69')]()['into']('cm_hopper')[_0xb409('0x6b')]([_0xb409('0x6c'),'scheduledAt',_0xb409('0x6d'),_0xb409('0x6e'),_0xb409('0x58'),_0xb409('0x50'),_0xb409('0x51')],squel[_0xb409('0x7d')]()[_0xb409('0x6f')]('phone',_0xb409('0x6c'))[_0xb409('0x6f')]('NOW()',_0xb409('0x7c'))[_0xb409('0x6f')]('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x1d8d1d['CmListId'][_0xb409('0x72')](),'ListId')[_0xb409('0x6f')](_0x3b4733['params']['id'][_0xb409('0x72')](),_0xb409('0x58'))['field']('\x27'+_0x2e7cd3+'\x27','createdAt')[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27','updatedAt')[_0xb409('0x73')](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))[_0xb409('0x39')](_0xb409('0x76'),_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')](_0xb409('0x7e')))[_0xb409('0x72')]();}_0x39cdaf=squel[_0xb409('0x69')]()[_0xb409('0x7f')](_0xb409('0x80'))['fromQuery'](['cmHopperId',_0xb409('0x7c'),_0xb409('0x6c'),_0xb409('0x81'),_0xb409('0x50'),_0xb409('0x51')],squel['select']()[_0xb409('0x6f')](_0xb409('0x82'),'id')[_0xb409('0x6f')](_0xb409('0x70'),_0xb409('0x7c'))[_0xb409('0x6f')]('ci.item',_0xb409('0x6c'))['field'](_0xb409('0x83'),_0xb409('0x81'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x50'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x51'))[_0xb409('0x73')](_0xb409('0x84'),'ci')[_0xb409('0x85')](_0xb409('0x6a'),'h',_0xb409('0x86'))[_0xb409('0x39')](_0xb409('0x87'),_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')]('h.CampaignId=?',_0x3b4733[_0xb409('0x43')]['id'][_0xb409('0x72')]())[_0xb409('0x39')](_0xb409('0x88'),_0x2e7cd3))[_0xb409('0x72')]();_0x4a260b[_0xb409('0x89')](db['sequelize'][_0xb409('0x30')](_0x14091b));_0x1e9853[_0xb409('0x89')](db[_0xb409('0x8a')][_0xb409('0x30')](_0x39cdaf));}return BPromise[_0xb409('0x8b')](_0x4a260b);}})[_0xb409('0x20')](function(){return BPromise['all'](_0x1e9853);})[_0xb409('0x20')](function(){return _0x40b4d5;})[_0xb409('0x20')](respondWithResult(_0xe2750,null))[_0xb409('0x41')](handleError(_0xe2750,null));};exports[_0xb409('0x8c')]=function(_0x11072f,_0x32cd33,_0x651a8){return db[_0xb409('0x2b')]['find']({'where':{'id':_0x11072f['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x32cd33,null))[_0xb409('0x20')](function(_0x5e830f){if(_0x5e830f){return _0x5e830f[_0xb409('0x8c')](_0x11072f[_0xb409('0x30')][_0xb409('0x65')]);}})[_0xb409('0x20')](function(_0x2fdd4e){if(_0x2fdd4e){return db[_0xb409('0x56')][_0xb409('0x21')]({'where':{'ListId':_0x11072f[_0xb409('0x30')][_0xb409('0x65')],'CampaignId':_0x11072f['params']['id']}})['then'](function(){return _0x2fdd4e;});}})[_0xb409('0x20')](respondWithStatusCode(_0x32cd33,null))[_0xb409('0x41')](handleError(_0x32cd33,null));};exports[_0xb409('0x8d')]=function(_0x3180bd,_0x54072e,_0x28e216){var _0x5ec19a={};var _0x21ab44={};var _0xcb8555;var _0x2c200f;return db['Campaign'][_0xb409('0x55')]({'where':{'id':_0x3180bd['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x54072e,null))[_0xb409('0x20')](function(_0x2095fa){if(_0x2095fa){_0xcb8555=_0x2095fa;_0x21ab44[_0xb409('0x2e')]=_['keys'](db[_0xb409('0x60')]['rawAttributes']);_0x21ab44[_0xb409('0x30')]=_['keys'](_0x3180bd[_0xb409('0x30')]);_0x21ab44[_0xb409('0x31')]=_[_0xb409('0x32')](_0x21ab44['model'],_0x21ab44[_0xb409('0x30')]);_0x5ec19a[_0xb409('0x33')]=_[_0xb409('0x32')](_0x21ab44[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x3180bd[_0xb409('0x30')][_0xb409('0x34')]));_0x5ec19a['attributes']=_0x5ec19a[_0xb409('0x33')][_0xb409('0x35')]?_0x5ec19a[_0xb409('0x33')]:_0x21ab44[_0xb409('0x2e')];_0x5ec19a['order']=qs[_0xb409('0x38')](_0x3180bd['query'][_0xb409('0x38')]);_0x5ec19a[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x3180bd[_0xb409('0x30')],_0x21ab44[_0xb409('0x31')]));if(_0x3180bd['query'][_0xb409('0x3d')]){_0x5ec19a[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x5ec19a['where'],{'$or':_[_0xb409('0x2a')](_0x5ec19a['attributes'],function(_0xa0a2a4){var _0x555469={};_0x555469[_0xa0a2a4]={'$like':'%'+_0x3180bd[_0xb409('0x30')][_0xb409('0x3d')]+'%'};return _0x555469;})});}_0x5ec19a=_['merge']({},_0x5ec19a,_0x3180bd[_0xb409('0x3e')]);return _0xcb8555[_0xb409('0x8d')](_0x5ec19a);}})[_0xb409('0x20')](function(_0xd3b971){if(_0xd3b971){_0x2c200f=_0xd3b971[_0xb409('0x35')];if(!_0x3180bd[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x5ec19a[_0xb409('0x1d')]=qs[_0xb409('0x1d')](_0x3180bd[_0xb409('0x30')][_0xb409('0x1d')]);_0x5ec19a[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x3180bd['query'][_0xb409('0x1b')]);}return _0xcb8555[_0xb409('0x8d')](_0x5ec19a);}})[_0xb409('0x20')](function(_0x5ad330){if(_0x5ad330){return _0x5ad330?{'count':_0x2c200f,'rows':_0x5ad330}:null;}})[_0xb409('0x20')](respondWithResult(_0x54072e,null))[_0xb409('0x41')](handleError(_0x54072e,null));};exports[_0xb409('0x8e')]=function(_0x1e5d61,_0x453bb5,_0x21cd01){var _0x3da1b3,_0x92e188;var _0x5e4676=[];var _0x5c157b=moment()['format'](_0xb409('0x64'));return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x1e5d61[_0xb409('0x43')]['id']}})['then'](handleEntityNotFound(_0x453bb5,null))[_0xb409('0x20')](function(_0x95c689){if(_0x95c689){_0x92e188=_0x95c689;return _0x95c689['addBlackLists'](_0x1e5d61[_0xb409('0x52')][_0xb409('0x65')],_[_0xb409('0x4f')](_0x1e5d61['body'],[_0xb409('0x65'),'id'])||{});}return null;})[_0xb409('0x66')](function(_0x201883){var _0x3e9611;var _0x13f4e4;_0x3da1b3=_0x201883||[];var _0x1b15d8=[];if(_0x201883){for(var _0x261e25=0x0;_0x261e25<_0x201883['length'];_0x261e25+=0x1){var _0x5d6a8a=_0x201883[_0x261e25][_0xb409('0x4a')]({'plain':!![]});_0x3e9611=squel[_0xb409('0x69')]()['into'](_0xb409('0x8f'))['fromQuery']([_0xb409('0x6c'),_0xb409('0x6d'),'ListId',_0xb409('0x58'),'createdAt',_0xb409('0x51')],squel[_0xb409('0x7d')]()[_0xb409('0x6f')]('phone',_0xb409('0x6c'))[_0xb409('0x6f')]('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x5d6a8a['CmListId']['toString'](),_0xb409('0x6e'))[_0xb409('0x6f')](_0x1e5d61[_0xb409('0x43')]['id']['toString'](),_0xb409('0x58'))[_0xb409('0x6f')](_0xb409('0x70'),'createdAt')[_0xb409('0x6f')](_0xb409('0x70'),_0xb409('0x51'))['from'](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))[_0xb409('0x39')]('ListId\x20=\x20?',_0x5d6a8a[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')](_0xb409('0x7e')))[_0xb409('0x72')]();_0x1b15d8['push'](db[_0xb409('0x8a')][_0xb409('0x30')](_0x3e9611));}return BPromise['all'](_0x1b15d8);}})[_0xb409('0x20')](function(){return _0x3da1b3;})[_0xb409('0x20')](respondWithResult(_0x453bb5,null))['catch'](handleError(_0x453bb5,null));};exports[_0xb409('0x90')]=function(_0x20eb70,_0x68612d,_0x11a224){return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x20eb70[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x68612d,null))['then'](function(_0x3b7f3a){if(_0x3b7f3a){return _0x3b7f3a[_0xb409('0x90')](_0x20eb70['query'][_0xb409('0x65')]);}})[_0xb409('0x20')](function(_0x33aa73){if(_0x33aa73){return db[_0xb409('0x5f')][_0xb409('0x21')]({'where':{'ListId':_0x20eb70[_0xb409('0x30')][_0xb409('0x65')],'CampaignId':_0x20eb70[_0xb409('0x43')]['id']}})[_0xb409('0x20')](function(){return _0x33aa73;});}})[_0xb409('0x20')](respondWithStatusCode(_0x68612d,null))[_0xb409('0x41')](handleError(_0x68612d,null));}; \ No newline at end of file +var _0x21f8=['limit','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','UserProfileSection','userProfileId','params','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','insert','NOW()','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count'];(function(_0x5273c9,_0x4a8fe7){var _0x3e95bc=function(_0xa79839){while(--_0xa79839){_0x5273c9['push'](_0x5273c9['shift']());}};_0x3e95bc(++_0x4a8fe7);}(_0x21f8,0x71));var _0x821f=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x21f8[_0xd511d];return _0x3f148e;};'use strict';var emlformat=require(_0x821f('0x0'));var rimraf=require(_0x821f('0x1'));var zipdir=require(_0x821f('0x2'));var jsonpatch=require(_0x821f('0x3'));var rp=require(_0x821f('0x4'));var moment=require(_0x821f('0x5'));var BPromise=require(_0x821f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x821f('0x7'));var csv=require(_0x821f('0x8'));var ejs=require(_0x821f('0x9'));var fs=require('fs');var fs_extra=require(_0x821f('0xa'));var _=require(_0x821f('0xb'));var squel=require(_0x821f('0xc'));var crypto=require(_0x821f('0xd'));var jsforce=require(_0x821f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x821f('0xf'));var Papa=require(_0x821f('0x10'));var Redis=require(_0x821f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x821f('0x12'));var as=require(_0x821f('0x13'));var hardwareService=require(_0x821f('0x14'));var logger=require(_0x821f('0x15'))(_0x821f('0x16'));var utils=require(_0x821f('0x17'));var config=require(_0x821f('0x18'));var licenseUtil=require(_0x821f('0x19'));var db=require(_0x821f('0x1a'))['db'];function respondWithStatusCode(_0x2aeb4e,_0x4ba2e2){_0x4ba2e2=_0x4ba2e2||0xcc;return function(_0x4f9752){if(_0x4f9752){return _0x2aeb4e[_0x821f('0x1b')](_0x4ba2e2);}return _0x2aeb4e[_0x821f('0x1c')](_0x4ba2e2)[_0x821f('0x1d')]();};}function respondWithResult(_0x91f4a0,_0x16145e){_0x16145e=_0x16145e||0xc8;return function(_0x42b2fa){if(_0x42b2fa){return _0x91f4a0[_0x821f('0x1c')](_0x16145e)[_0x821f('0x1e')](_0x42b2fa);}};}function respondWithFilteredResult(_0x1aeda5,_0x19d587){return function(_0x4b746c){if(_0x4b746c){var _0x3419ab=typeof _0x19d587['offset']===_0x821f('0x1f')&&typeof _0x19d587['limit']===_0x821f('0x1f');var _0x2b3f5c=_0x4b746c[_0x821f('0x20')];var _0x27c41c=_0x3419ab?0x0:_0x19d587['offset'];var _0x1c015a=_0x3419ab?_0x4b746c[_0x821f('0x20')]:_0x19d587['offset']+_0x19d587[_0x821f('0x21')];var _0x47b0ae;if(_0x1c015a>=_0x2b3f5c){_0x1c015a=_0x2b3f5c;_0x47b0ae=0xc8;}else{_0x47b0ae=0xce;}_0x1aeda5[_0x821f('0x1c')](_0x47b0ae);return _0x1aeda5['set'](_0x821f('0x22'),_0x27c41c+'-'+_0x1c015a+'/'+_0x2b3f5c)[_0x821f('0x1e')](_0x4b746c);}return null;};}function patchUpdates(_0x4fbcf2){return function(_0x4f3283){try{jsonpatch[_0x821f('0x23')](_0x4f3283,_0x4fbcf2,!![]);}catch(_0x187f02){return BPromise[_0x821f('0x24')](_0x187f02);}return _0x4f3283['save']();};}function saveUpdates(_0x3092d8,_0xb5d07){return function(_0x3dda74){if(_0x3dda74){return _0x3dda74['update'](_0x3092d8)[_0x821f('0x25')](function(_0x1ee178){return _0x1ee178;});}return null;};}function removeEntity(_0x4b2e35,_0x4ef246){return function(_0x4ede29){if(_0x4ede29){return _0x4ede29['destroy']()[_0x821f('0x25')](function(){var _0x4af347=_0x4ede29['get']({'plain':!![]});var _0x21c1d9='IvrCampaigns';return db['UserProfileResource'][_0x821f('0x26')]({'where':{'type':_0x21c1d9,'resourceId':_0x4af347['id']}})[_0x821f('0x25')](function(){return _0x4ede29;});})[_0x821f('0x25')](function(){_0x4b2e35[_0x821f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6d94a,_0x418b90){return function(_0x183535){if(!_0x183535){_0xf6d94a[_0x821f('0x1b')](0x194);}return _0x183535;};}function handleError(_0x47f0b6,_0xdd8873){_0xdd8873=_0xdd8873||0x1f4;return function(_0xac9ab1){logger[_0x821f('0x27')](_0xac9ab1[_0x821f('0x28')]);if(_0xac9ab1['name']){delete _0xac9ab1[_0x821f('0x29')];}_0x47f0b6['status'](_0xdd8873)['send'](_0xac9ab1);};}exports[_0x821f('0x2a')]=function(_0xba21fb,_0x962d81){var _0x41c12a={},_0x122e56={},_0x5b10f6={'count':0x0,'rows':[]};var _0x12b057=_[_0x821f('0x2b')](db[_0x821f('0x2c')][_0x821f('0x2d')],function(_0x5429c0){return{'name':_0x5429c0[_0x821f('0x2e')],'type':_0x5429c0[_0x821f('0x2f')][_0x821f('0x30')]};});_0x122e56[_0x821f('0x31')]=_[_0x821f('0x2b')](_0x12b057,_0x821f('0x29'));_0x122e56['query']=_[_0x821f('0x32')](_0xba21fb['query']);_0x122e56[_0x821f('0x33')]=_[_0x821f('0x34')](_0x122e56['model'],_0x122e56['query']);_0x41c12a[_0x821f('0x35')]=_[_0x821f('0x34')](_0x122e56[_0x821f('0x31')],qs[_0x821f('0x36')](_0xba21fb[_0x821f('0x37')]['fields']));_0x41c12a['attributes']=_0x41c12a[_0x821f('0x35')][_0x821f('0x38')]?_0x41c12a[_0x821f('0x35')]:_0x122e56['model'];if(!_0xba21fb[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x41c12a[_0x821f('0x21')]=qs[_0x821f('0x21')](_0xba21fb[_0x821f('0x37')][_0x821f('0x21')]);_0x41c12a['offset']=qs['offset'](_0xba21fb[_0x821f('0x37')][_0x821f('0x3b')]);}_0x41c12a[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0xba21fb[_0x821f('0x37')]['sort']);_0x41c12a['where']=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0xba21fb[_0x821f('0x37')],_0x122e56['filters']),_0x12b057);if(_0xba21fb[_0x821f('0x37')][_0x821f('0x3f')]){_0x41c12a[_0x821f('0x40')]=_['merge'](_0x41c12a[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x12b057,function(_0x147639){if(_0x147639[_0x821f('0x2f')]!==_0x821f('0x41')){var _0x315e59={};_0x315e59[_0x147639['name']]={'$like':'%'+_0xba21fb[_0x821f('0x37')]['filter']+'%'};return _0x315e59;}})});}_0x41c12a=_[_0x821f('0x42')]({},_0x41c12a,_0xba21fb[_0x821f('0x43')]);var _0x404ec7={'where':_0x41c12a[_0x821f('0x40')]};return db[_0x821f('0x2c')][_0x821f('0x20')](_0x404ec7)[_0x821f('0x25')](function(_0x25c0f2){_0x5b10f6['count']=_0x25c0f2;if(_0xba21fb[_0x821f('0x37')][_0x821f('0x44')]){_0x41c12a[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x2c')][_0x821f('0x46')](_0x41c12a);})['then'](function(_0x220e0b){_0x5b10f6[_0x821f('0x47')]=_0x220e0b;return _0x5b10f6;})[_0x821f('0x25')](respondWithFilteredResult(_0x962d81,_0x41c12a))[_0x821f('0x48')](handleError(_0x962d81,null));};exports[_0x821f('0x49')]=function(_0xff3674,_0x26acbe){var _0x1cee9f={'raw':![],'where':{'id':_0xff3674['params']['id']}},_0x122ca0={};_0x122ca0[_0x821f('0x31')]=_['keys'](db[_0x821f('0x2c')]['rawAttributes']);_0x122ca0[_0x821f('0x37')]=_['keys'](_0xff3674[_0x821f('0x37')]);_0x122ca0[_0x821f('0x33')]=_['intersection'](_0x122ca0[_0x821f('0x31')],_0x122ca0['query']);_0x1cee9f[_0x821f('0x35')]=_[_0x821f('0x34')](_0x122ca0['model'],qs[_0x821f('0x36')](_0xff3674[_0x821f('0x37')]['fields']));_0x1cee9f[_0x821f('0x35')]=_0x1cee9f['attributes'][_0x821f('0x38')]?_0x1cee9f[_0x821f('0x35')]:_0x122ca0[_0x821f('0x31')];if(_0xff3674['query'][_0x821f('0x44')]){_0x1cee9f[_0x821f('0x45')]=[{'all':!![]}];}_0x1cee9f=_['merge']({},_0x1cee9f,_0xff3674[_0x821f('0x43')]);return db['Campaign'][_0x821f('0x4a')](_0x1cee9f)[_0x821f('0x25')](handleEntityNotFound(_0x26acbe,null))[_0x821f('0x25')](respondWithResult(_0x26acbe,null))[_0x821f('0x48')](handleError(_0x26acbe,null));};exports[_0x821f('0x4b')]=function(_0x541a2e,_0x314a47){return db[_0x821f('0x2c')][_0x821f('0x4b')](_0x541a2e[_0x821f('0x4c')],{})['then'](function(_0x5c13f6){var _0x16e2b0=_0x541a2e['user']['get']({'plain':!![]});if(!_0x16e2b0)throw new Error(_0x821f('0x4d'));if(_0x16e2b0[_0x821f('0x4e')]===_0x821f('0x4f')){var _0x37715d=_0x5c13f6[_0x821f('0x50')]({'plain':!![]});var _0x4e9470=_0x821f('0x51');return db['UserProfileSection'][_0x821f('0x4a')]({'where':{'name':_0x4e9470,'userProfileId':_0x16e2b0['userProfileId']},'raw':!![]})[_0x821f('0x25')](function(_0x4054a9){if(_0x4054a9&&_0x4054a9[_0x821f('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x37715d[_0x821f('0x29')],'resourceId':_0x37715d['id'],'type':_0x4054a9[_0x821f('0x29')],'sectionId':_0x4054a9['id']},{})[_0x821f('0x25')](function(){return _0x5c13f6;});}else{return _0x5c13f6;}})['catch'](function(_0x386093){logger[_0x821f('0x27')](_0x821f('0x53'),_0x386093);throw _0x386093;});}return _0x5c13f6;})[_0x821f('0x25')](respondWithResult(_0x314a47,0xc9))[_0x821f('0x48')](handleError(_0x314a47,null));};exports['clone']=function(_0x45fcbd,_0x86b32d){var _0x362946={'where':{'id':_0x45fcbd['params']['id']}},_0x35dbb5={};_0x35dbb5[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x2c')][_0x821f('0x2d')]);_0x362946[_0x821f('0x35')]=_['intersection'](_0x35dbb5[_0x821f('0x31')],qs['fields'](_0x45fcbd['query']['fields']));_0x362946['attributes']=_0x362946['attributes'][_0x821f('0x38')]?_0x362946[_0x821f('0x35')]:_0x35dbb5[_0x821f('0x31')];if(_0x45fcbd[_0x821f('0x37')][_0x821f('0x44')]){_0x362946['include']=[{'all':!![]}];}_0x362946=_[_0x821f('0x42')]({},_0x362946,_0x45fcbd[_0x821f('0x43')]);return db['Campaign'][_0x821f('0x4a')](_0x362946)[_0x821f('0x25')](handleEntityNotFound(_0x86b32d,null))[_0x821f('0x25')](function(_0x2e6c20){if(_0x2e6c20){var _0x59e25e=_0x2e6c20[_0x821f('0x50')]({'plain':!![]});_0x59e25e=qs[_0x821f('0x54')](_0x59e25e,['id','createdAt',_0x821f('0x55')]);_0x45fcbd['body']=_[_0x821f('0x54')](_0x45fcbd[_0x821f('0x4c')],['id',_0x821f('0x56'),_0x821f('0x55')]);return db[_0x821f('0x2c')][_0x821f('0x4b')](_[_0x821f('0x42')](_0x59e25e,_0x45fcbd[_0x821f('0x4c')]),{'include':_0x45fcbd[_0x821f('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x821f('0x25')](function(_0x29e6ff){var _0x3e332c=_0x45fcbd['user'][_0x821f('0x50')]({'plain':!![]});if(!_0x3e332c)throw new Error(_0x821f('0x4d'));if(_0x3e332c[_0x821f('0x4e')]===_0x821f('0x4f')){var _0x5004d9=_0x29e6ff[_0x821f('0x50')]({'plain':!![]});var _0x5a87c5=_0x821f('0x51');return db[_0x821f('0x57')][_0x821f('0x4a')]({'where':{'name':_0x5a87c5,'userProfileId':_0x3e332c[_0x821f('0x58')]},'raw':!![]})[_0x821f('0x25')](function(_0x27df7c){if(_0x27df7c&&_0x27df7c[_0x821f('0x52')]===0x0){return db['UserProfileResource'][_0x821f('0x4b')]({'name':_0x5004d9[_0x821f('0x29')],'resourceId':_0x5004d9['id'],'type':_0x27df7c['name'],'sectionId':_0x27df7c['id']},{})[_0x821f('0x25')](function(){return _0x29e6ff;});}else{return _0x29e6ff;}})[_0x821f('0x48')](function(_0x5dafdc){logger[_0x821f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dafdc);throw _0x5dafdc;});}return _0x29e6ff;});}})['then'](respondWithResult(_0x86b32d,0xc9))[_0x821f('0x48')](handleError(_0x86b32d,null));};exports['update']=function(_0x1ccbc0,_0xb77858){if(_0x1ccbc0[_0x821f('0x4c')]['id']){delete _0x1ccbc0[_0x821f('0x4c')]['id'];}return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x1ccbc0[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0xb77858,null))[_0x821f('0x25')](saveUpdates(_0x1ccbc0[_0x821f('0x4c')],null))[_0x821f('0x25')](respondWithResult(_0xb77858,null))[_0x821f('0x48')](handleError(_0xb77858,null));};exports[_0x821f('0x26')]=function(_0x3316cf,_0x399d06){return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x3316cf[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x399d06,null))[_0x821f('0x25')](removeEntity(_0x399d06,null))[_0x821f('0x48')](handleError(_0x399d06,null));};exports[_0x821f('0x5a')]=function(_0x1c8bb9,_0x169f8f,_0x13f19c){var _0x1b1212={'raw':!![],'where':{}};var _0xddd0a4={};var _0x29dc0c={'count':0x0,'rows':[]};return db[_0x821f('0x2c')][_0x821f('0x5b')]({'where':{'id':_0x1c8bb9[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x169f8f,null))[_0x821f('0x25')](function(_0x83a2c5){if(_0x83a2c5){_0xddd0a4['model']=_[_0x821f('0x32')](db[_0x821f('0x5c')][_0x821f('0x2d')]);_0xddd0a4['query']=_[_0x821f('0x32')](_0x1c8bb9[_0x821f('0x37')]);_0xddd0a4['filters']=_[_0x821f('0x34')](_0xddd0a4[_0x821f('0x31')],_0xddd0a4[_0x821f('0x37')]);_0x1b1212[_0x821f('0x35')]=_[_0x821f('0x34')](_0xddd0a4[_0x821f('0x31')],qs[_0x821f('0x36')](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x36')]));_0x1b1212[_0x821f('0x35')]=_0x1b1212[_0x821f('0x35')][_0x821f('0x38')]?_0x1b1212['attributes']:_0xddd0a4[_0x821f('0x31')];if(!_0x1c8bb9[_0x821f('0x37')]['hasOwnProperty'](_0x821f('0x3a'))){_0x1b1212[_0x821f('0x21')]=qs['limit'](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x21')]);_0x1b1212[_0x821f('0x3b')]=qs['offset'](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x3b')]);}_0x1b1212['order']=qs[_0x821f('0x3d')](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x3d')]);_0x1b1212[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x1c8bb9['query'],_0xddd0a4[_0x821f('0x33')]));_0x1b1212['where']['CampaignId']=_0x83a2c5['id'];if(_0x1c8bb9[_0x821f('0x37')][_0x821f('0x3f')]){_0x1b1212['where']=_['merge'](_0x1b1212[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x1b1212[_0x821f('0x35')],function(_0x3a04c3){var _0x4aa0be={};_0x4aa0be[_0x3a04c3]={'$like':'%'+_0x1c8bb9[_0x821f('0x37')]['filter']+'%'};return _0x4aa0be;})});}_0x1b1212=_['merge']({},_0x1b1212,_0x1c8bb9[_0x821f('0x43')]);return db[_0x821f('0x5c')][_0x821f('0x20')]({'where':_0x1b1212[_0x821f('0x40')]})[_0x821f('0x25')](function(_0x406e9d){_0x29dc0c[_0x821f('0x20')]=_0x406e9d;if(_0x1c8bb9[_0x821f('0x37')][_0x821f('0x44')]){_0x1b1212[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x5c')][_0x821f('0x46')](_0x1b1212);})['then'](function(_0x3611c4){_0x29dc0c[_0x821f('0x47')]=_0x3611c4;return _0x29dc0c;});}})[_0x821f('0x25')](respondWithFilteredResult(_0x169f8f,_0x1b1212))[_0x821f('0x48')](handleError(_0x169f8f,null));};exports[_0x821f('0x5d')]=function(_0x2f735e,_0xa5293d,_0x43585b){var _0x4e820c={'raw':!![],'where':{}};var _0x531ffd={};var _0x5f0d0d={'count':0x0,'rows':[]};return db['Campaign'][_0x821f('0x5b')]({'where':{'id':_0x2f735e['params']['id']}})[_0x821f('0x25')](handleEntityNotFound(_0xa5293d,null))[_0x821f('0x25')](function(_0x195dae){if(_0x195dae){_0x531ffd[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x5e')][_0x821f('0x2d')]);_0x531ffd[_0x821f('0x37')]=_[_0x821f('0x32')](_0x2f735e[_0x821f('0x37')]);_0x531ffd[_0x821f('0x33')]=_[_0x821f('0x34')](_0x531ffd[_0x821f('0x31')],_0x531ffd[_0x821f('0x37')]);_0x4e820c['attributes']=_['intersection'](_0x531ffd['model'],qs[_0x821f('0x36')](_0x2f735e['query'][_0x821f('0x36')]));_0x4e820c['attributes']=_0x4e820c[_0x821f('0x35')][_0x821f('0x38')]?_0x4e820c[_0x821f('0x35')]:_0x531ffd[_0x821f('0x31')];if(!_0x2f735e[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x4e820c['limit']=qs[_0x821f('0x21')](_0x2f735e['query'][_0x821f('0x21')]);_0x4e820c[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x2f735e[_0x821f('0x37')][_0x821f('0x3b')]);}_0x4e820c[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0x2f735e[_0x821f('0x37')][_0x821f('0x3d')]);_0x4e820c['where']=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x2f735e['query'],_0x531ffd[_0x821f('0x33')]));_0x4e820c[_0x821f('0x40')]['CampaignId']=_0x195dae['id'];if(_0x2f735e['query'][_0x821f('0x3f')]){_0x4e820c[_0x821f('0x40')]=_[_0x821f('0x42')](_0x4e820c[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x4e820c[_0x821f('0x35')],function(_0x4d558b){var _0x55b21c={};_0x55b21c[_0x4d558b]={'$like':'%'+_0x2f735e[_0x821f('0x37')]['filter']+'%'};return _0x55b21c;})});}_0x4e820c=_[_0x821f('0x42')]({},_0x4e820c,_0x2f735e[_0x821f('0x43')]);return db[_0x821f('0x5e')][_0x821f('0x20')]({'where':_0x4e820c[_0x821f('0x40')]})['then'](function(_0x21ff7d){_0x5f0d0d[_0x821f('0x20')]=_0x21ff7d;if(_0x2f735e[_0x821f('0x37')]['includeAll']){_0x4e820c[_0x821f('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x821f('0x46')](_0x4e820c);})['then'](function(_0x454157){_0x5f0d0d['rows']=_0x454157;return _0x5f0d0d;});}})[_0x821f('0x25')](respondWithFilteredResult(_0xa5293d,_0x4e820c))[_0x821f('0x48')](handleError(_0xa5293d,null));};exports[_0x821f('0x5f')]=function(_0x260c5c,_0x165dcb,_0x5b4539){var _0x515791={'raw':!![],'where':{}};var _0x4e2f02={};var _0x1f52aa={'count':0x0,'rows':[]};return db['Campaign'][_0x821f('0x5b')]({'where':{'id':_0x260c5c[_0x821f('0x59')]['id']}})['then'](handleEntityNotFound(_0x165dcb,null))[_0x821f('0x25')](function(_0x52b202){if(_0x52b202){_0x4e2f02['model']=_[_0x821f('0x32')](db[_0x821f('0x60')][_0x821f('0x2d')]);_0x4e2f02[_0x821f('0x37')]=_[_0x821f('0x32')](_0x260c5c['query']);_0x4e2f02['filters']=_[_0x821f('0x34')](_0x4e2f02[_0x821f('0x31')],_0x4e2f02[_0x821f('0x37')]);_0x515791[_0x821f('0x35')]=_[_0x821f('0x34')](_0x4e2f02[_0x821f('0x31')],qs[_0x821f('0x36')](_0x260c5c[_0x821f('0x37')][_0x821f('0x36')]));_0x515791['attributes']=_0x515791[_0x821f('0x35')][_0x821f('0x38')]?_0x515791[_0x821f('0x35')]:_0x4e2f02[_0x821f('0x31')];if(!_0x260c5c[_0x821f('0x37')][_0x821f('0x39')]('nolimit')){_0x515791['limit']=qs[_0x821f('0x21')](_0x260c5c['query'][_0x821f('0x21')]);_0x515791[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x260c5c['query'][_0x821f('0x3b')]);}_0x515791[_0x821f('0x3c')]=qs['sort'](_0x260c5c[_0x821f('0x37')][_0x821f('0x3d')]);_0x515791[_0x821f('0x40')]=qs[_0x821f('0x33')](_['pick'](_0x260c5c['query'],_0x4e2f02[_0x821f('0x33')]));_0x515791[_0x821f('0x40')][_0x821f('0x61')]=_0x52b202['id'];if(_0x260c5c[_0x821f('0x37')][_0x821f('0x3f')]){_0x515791[_0x821f('0x40')]=_[_0x821f('0x42')](_0x515791['where'],{'$or':_['map'](_0x515791[_0x821f('0x35')],function(_0x27b31f){var _0x45b65a={};_0x45b65a[_0x27b31f]={'$like':'%'+_0x260c5c[_0x821f('0x37')][_0x821f('0x3f')]+'%'};return _0x45b65a;})});}_0x515791=_[_0x821f('0x42')]({},_0x515791,_0x260c5c[_0x821f('0x43')]);return db[_0x821f('0x60')][_0x821f('0x20')]({'where':_0x515791[_0x821f('0x40')]})[_0x821f('0x25')](function(_0x21d120){_0x1f52aa[_0x821f('0x20')]=_0x21d120;if(_0x260c5c[_0x821f('0x37')]['includeAll']){_0x515791[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x60')][_0x821f('0x46')](_0x515791);})[_0x821f('0x25')](function(_0x51f9d7){_0x1f52aa[_0x821f('0x47')]=_0x51f9d7;return _0x1f52aa;});}})[_0x821f('0x25')](respondWithFilteredResult(_0x165dcb,_0x515791))[_0x821f('0x48')](handleError(_0x165dcb,null));};exports['getHopperBlacks']=function(_0x44bfdb,_0x2d95d9,_0x38f366){var _0x6cb426={'raw':!![],'where':{}};var _0x33a628={};var _0x5c0ce4={'count':0x0,'rows':[]};return db[_0x821f('0x2c')]['findOne']({'where':{'id':_0x44bfdb['params']['id']}})['then'](handleEntityNotFound(_0x2d95d9,null))['then'](function(_0x6bcd5b){if(_0x6bcd5b){_0x33a628[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x62')]['rawAttributes']);_0x33a628[_0x821f('0x37')]=_[_0x821f('0x32')](_0x44bfdb['query']);_0x33a628[_0x821f('0x33')]=_[_0x821f('0x34')](_0x33a628[_0x821f('0x31')],_0x33a628[_0x821f('0x37')]);_0x6cb426['attributes']=_[_0x821f('0x34')](_0x33a628['model'],qs[_0x821f('0x36')](_0x44bfdb[_0x821f('0x37')][_0x821f('0x36')]));_0x6cb426['attributes']=_0x6cb426[_0x821f('0x35')][_0x821f('0x38')]?_0x6cb426[_0x821f('0x35')]:_0x33a628[_0x821f('0x31')];if(!_0x44bfdb[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x6cb426['limit']=qs[_0x821f('0x21')](_0x44bfdb[_0x821f('0x37')][_0x821f('0x21')]);_0x6cb426['offset']=qs['offset'](_0x44bfdb[_0x821f('0x37')][_0x821f('0x3b')]);}_0x6cb426[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0x44bfdb['query'][_0x821f('0x3d')]);_0x6cb426[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x44bfdb[_0x821f('0x37')],_0x33a628[_0x821f('0x33')]));_0x6cb426[_0x821f('0x40')][_0x821f('0x61')]=_0x6bcd5b['id'];if(_0x44bfdb['query'][_0x821f('0x3f')]){_0x6cb426['where']=_[_0x821f('0x42')](_0x6cb426[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x6cb426[_0x821f('0x35')],function(_0x3df0c7){var _0x1894a3={};_0x1894a3[_0x3df0c7]={'$like':'%'+_0x44bfdb['query'][_0x821f('0x3f')]+'%'};return _0x1894a3;})});}_0x6cb426=_['merge']({},_0x6cb426,_0x44bfdb[_0x821f('0x43')]);return db['CmHopperBlack'][_0x821f('0x20')]({'where':_0x6cb426[_0x821f('0x40')]})[_0x821f('0x25')](function(_0x3c3085){_0x5c0ce4[_0x821f('0x20')]=_0x3c3085;if(_0x44bfdb['query'][_0x821f('0x44')]){_0x6cb426[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x62')][_0x821f('0x46')](_0x6cb426);})[_0x821f('0x25')](function(_0x22c52a){_0x5c0ce4[_0x821f('0x47')]=_0x22c52a;return _0x5c0ce4;});}})[_0x821f('0x25')](respondWithFilteredResult(_0x2d95d9,_0x6cb426))[_0x821f('0x48')](handleError(_0x2d95d9,null));};exports['getLists']=function(_0x3c8a3e,_0x5186dd,_0x4f0f92){var _0x5eadc1={};var _0x39f66e={};var _0x36b360;var _0x3f6d27;return db[_0x821f('0x2c')][_0x821f('0x5b')]({'where':{'id':_0x3c8a3e[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x5186dd,null))['then'](function(_0xc0a78c){if(_0xc0a78c){_0x36b360=_0xc0a78c;_0x39f66e[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x63')]['rawAttributes']);_0x39f66e[_0x821f('0x37')]=_[_0x821f('0x32')](_0x3c8a3e[_0x821f('0x37')]);_0x39f66e[_0x821f('0x33')]=_[_0x821f('0x34')](_0x39f66e['model'],_0x39f66e[_0x821f('0x37')]);_0x5eadc1[_0x821f('0x35')]=_[_0x821f('0x34')](_0x39f66e[_0x821f('0x31')],qs['fields'](_0x3c8a3e['query'][_0x821f('0x36')]));_0x5eadc1['attributes']=_0x5eadc1[_0x821f('0x35')][_0x821f('0x38')]?_0x5eadc1[_0x821f('0x35')]:_0x39f66e[_0x821f('0x31')];_0x5eadc1['order']=qs[_0x821f('0x3d')](_0x3c8a3e[_0x821f('0x37')][_0x821f('0x3d')]);_0x5eadc1[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x3c8a3e['query'],_0x39f66e[_0x821f('0x33')]));if(_0x3c8a3e[_0x821f('0x37')][_0x821f('0x3f')]){_0x5eadc1[_0x821f('0x40')]=_[_0x821f('0x42')](_0x5eadc1[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x5eadc1[_0x821f('0x35')],function(_0x57ad8f){var _0x1b4de3={};_0x1b4de3[_0x57ad8f]={'$like':'%'+_0x3c8a3e[_0x821f('0x37')][_0x821f('0x3f')]+'%'};return _0x1b4de3;})});}_0x5eadc1=_[_0x821f('0x42')]({},_0x5eadc1,_0x3c8a3e[_0x821f('0x43')]);return _0x36b360[_0x821f('0x64')](_0x5eadc1);}})[_0x821f('0x25')](function(_0x53e224){if(_0x53e224){_0x3f6d27=_0x53e224[_0x821f('0x38')];if(!_0x3c8a3e[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x5eadc1['limit']=qs[_0x821f('0x21')](_0x3c8a3e[_0x821f('0x37')][_0x821f('0x21')]);_0x5eadc1[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x3c8a3e['query'][_0x821f('0x3b')]);}return _0x36b360[_0x821f('0x64')](_0x5eadc1);}})['then'](function(_0x257428){if(_0x257428){return _0x257428?{'count':_0x3f6d27,'rows':_0x257428}:null;}})[_0x821f('0x25')](respondWithResult(_0x5186dd,null))[_0x821f('0x48')](handleError(_0x5186dd,null));};exports[_0x821f('0x65')]=function(_0x377c3d,_0x48fa4e,_0x482271){var _0x518616,_0x2e7e39;var _0x156316=[];var _0x452c2e=moment()[_0x821f('0x66')](_0x821f('0x67'));return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x377c3d[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x48fa4e,null))[_0x821f('0x25')](function(_0x52af51){if(_0x52af51){_0x2e7e39=_0x52af51;return _0x52af51[_0x821f('0x65')](_0x377c3d['body'][_0x821f('0x68')],_[_0x821f('0x54')](_0x377c3d[_0x821f('0x4c')],[_0x821f('0x68'),'id'])||{});}return null;})[_0x821f('0x69')](function(_0x2a79c7){var _0x724c60;var _0xf463c8;_0x518616=_0x2a79c7||[];var _0x5efe47=[];if(_0x2a79c7){for(var _0x5e8e2f=0x0;_0x5e8e2f<_0x2a79c7['length'];_0x5e8e2f+=0x1){var _0x2553fa=_0x2a79c7[_0x5e8e2f][_0x821f('0x50')]({'plain':!![]});_0x2e7e39['dialCheckDuplicateType']=_0x377c3d[_0x821f('0x4c')][_0x821f('0x6a')]?_0x377c3d[_0x821f('0x4c')][_0x821f('0x6a')]:_0x2e7e39[_0x821f('0x6a')];switch(_0x2e7e39['dialCheckDuplicateType']){case _0x821f('0x6b'):_0x724c60=squel['insert']()[_0x821f('0x6c')]('cm_hopper')[_0x821f('0x6d')]([_0x821f('0x6e'),_0x821f('0x6f'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x61'),_0x821f('0x56'),_0x821f('0x55')],squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x6e'),_0x821f('0x6e'))[_0x821f('0x73')]('NOW()',_0x821f('0x6f'))[_0x821f('0x73')]('id',_0x821f('0x70'))['field'](_0x2553fa[_0x821f('0x74')]['toString'](),_0x821f('0x71'))[_0x821f('0x73')](_0x377c3d[_0x821f('0x59')]['id'][_0x821f('0x75')](),'CampaignId')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x56'))[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))[_0x821f('0x76')]('cm_contacts')[_0x821f('0x40')](_0x821f('0x77'))[_0x821f('0x40')]('ListId\x20=\x20?',_0x2553fa[_0x821f('0x74')][_0x821f('0x75')]())['where'](_0x821f('0x78'))[_0x821f('0x40')](_0x821f('0x79'),squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x7a'))[_0x821f('0x76')]('cm_hopper_final')[_0x821f('0x40')](_0x821f('0x7b'),_0x377c3d['params']['id'][_0x821f('0x75')]()))[_0x821f('0x40')](_0x821f('0x79'),squel['select']()['field'](_0x821f('0x7c'))[_0x821f('0x76')](_0x821f('0x7d'))['where'](_0x821f('0x7b'),_0x377c3d['params']['id'][_0x821f('0x75')]())))[_0x821f('0x75')]();break;case'onlyIfOpen':_0x724c60=squel[_0x821f('0x7e')]()[_0x821f('0x6c')](_0x821f('0x7d'))['fromQuery']([_0x821f('0x6e'),'scheduledAt',_0x821f('0x70'),_0x821f('0x71'),'CampaignId',_0x821f('0x56'),_0x821f('0x55')],squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x6e'),_0x821f('0x6e'))['field'](_0x821f('0x7f'),'scheduledAt')[_0x821f('0x73')]('id',_0x821f('0x70'))[_0x821f('0x73')](_0x2553fa['CmListId'][_0x821f('0x75')](),_0x821f('0x71'))['field'](_0x377c3d[_0x821f('0x59')]['id'][_0x821f('0x75')](),_0x821f('0x61'))['field']('\x27'+_0x452c2e+'\x27',_0x821f('0x56'))[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))['from'](_0x821f('0x80'))[_0x821f('0x40')](_0x821f('0x77'))['where'](_0x821f('0x81'),_0x2553fa[_0x821f('0x74')][_0x821f('0x75')]())[_0x821f('0x40')](_0x821f('0x78'))['where'](_0x821f('0x79'),squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x7c'))[_0x821f('0x76')](_0x821f('0x7d'))[_0x821f('0x40')](_0x821f('0x7b'),_0x377c3d['params']['id'][_0x821f('0x75')]())))[_0x821f('0x75')]();break;default:_0x724c60=squel[_0x821f('0x7e')]()['into'](_0x821f('0x7d'))[_0x821f('0x6d')]([_0x821f('0x6e'),_0x821f('0x6f'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x61'),_0x821f('0x56'),_0x821f('0x55')],squel['select']()[_0x821f('0x73')](_0x821f('0x6e'),_0x821f('0x6e'))[_0x821f('0x73')]('NOW()',_0x821f('0x6f'))[_0x821f('0x73')]('id',_0x821f('0x70'))[_0x821f('0x73')](_0x2553fa[_0x821f('0x74')]['toString'](),_0x821f('0x71'))['field'](_0x377c3d[_0x821f('0x59')]['id'][_0x821f('0x75')](),'CampaignId')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27','createdAt')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))[_0x821f('0x76')](_0x821f('0x80'))['where'](_0x821f('0x77'))[_0x821f('0x40')](_0x821f('0x81'),_0x2553fa[_0x821f('0x74')][_0x821f('0x75')]())[_0x821f('0x40')](_0x821f('0x78')))[_0x821f('0x75')]();}_0xf463c8=squel['insert']()['into'](_0x821f('0x82'))[_0x821f('0x6d')]([_0x821f('0x83'),_0x821f('0x6f'),'phone',_0x821f('0x84'),'createdAt',_0x821f('0x55')],squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x85'),'id')[_0x821f('0x73')](_0x821f('0x7f'),_0x821f('0x6f'))[_0x821f('0x73')](_0x821f('0x86'),'phone')['field']('ci.OrderBY',_0x821f('0x84'))[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27','createdAt')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))[_0x821f('0x76')](_0x821f('0x87'),'ci')[_0x821f('0x88')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x821f('0x40')]('h.ListId\x20=\x20?',_0x2553fa['CmListId'][_0x821f('0x75')]())[_0x821f('0x40')]('h.CampaignId=?',_0x377c3d['params']['id'][_0x821f('0x75')]())[_0x821f('0x40')](_0x821f('0x89'),_0x452c2e))['toString']();_0x5efe47[_0x821f('0x8a')](db[_0x821f('0x8b')]['query'](_0x724c60));_0x156316[_0x821f('0x8a')](db[_0x821f('0x8b')]['query'](_0xf463c8));}return BPromise[_0x821f('0x8c')](_0x5efe47);}})[_0x821f('0x25')](function(){return BPromise['all'](_0x156316);})[_0x821f('0x25')](function(){return _0x518616;})['then'](respondWithResult(_0x48fa4e,null))[_0x821f('0x48')](handleError(_0x48fa4e,null));};exports[_0x821f('0x8d')]=function(_0xdf8080,_0x1e6dc1,_0x33830f){return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0xdf8080[_0x821f('0x59')]['id']}})['then'](handleEntityNotFound(_0x1e6dc1,null))[_0x821f('0x25')](function(_0x4b5f37){if(_0x4b5f37){return _0x4b5f37['removeLists'](_0xdf8080[_0x821f('0x37')]['ids']);}})[_0x821f('0x25')](function(_0x5086c0){if(_0x5086c0){return db[_0x821f('0x5c')][_0x821f('0x26')]({'where':{'ListId':_0xdf8080['query'][_0x821f('0x68')],'CampaignId':_0xdf8080['params']['id']}})[_0x821f('0x25')](function(){return _0x5086c0;});}})[_0x821f('0x25')](respondWithStatusCode(_0x1e6dc1,null))[_0x821f('0x48')](handleError(_0x1e6dc1,null));};exports['getBlackLists']=function(_0x2b736f,_0x54419c,_0x499632){var _0x515b3e={};var _0x322175={};var _0x3406d8;var _0x3c6074;return db[_0x821f('0x2c')][_0x821f('0x5b')]({'where':{'id':_0x2b736f[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x54419c,null))[_0x821f('0x25')](function(_0x22bced){if(_0x22bced){_0x3406d8=_0x22bced;_0x322175[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x63')]['rawAttributes']);_0x322175[_0x821f('0x37')]=_[_0x821f('0x32')](_0x2b736f['query']);_0x322175[_0x821f('0x33')]=_[_0x821f('0x34')](_0x322175['model'],_0x322175[_0x821f('0x37')]);_0x515b3e[_0x821f('0x35')]=_[_0x821f('0x34')](_0x322175[_0x821f('0x31')],qs[_0x821f('0x36')](_0x2b736f[_0x821f('0x37')]['fields']));_0x515b3e[_0x821f('0x35')]=_0x515b3e[_0x821f('0x35')]['length']?_0x515b3e[_0x821f('0x35')]:_0x322175[_0x821f('0x31')];_0x515b3e[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0x2b736f[_0x821f('0x37')]['sort']);_0x515b3e[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x2b736f[_0x821f('0x37')],_0x322175[_0x821f('0x33')]));if(_0x2b736f[_0x821f('0x37')][_0x821f('0x3f')]){_0x515b3e[_0x821f('0x40')]=_[_0x821f('0x42')](_0x515b3e[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x515b3e[_0x821f('0x35')],function(_0x45666a){var _0x54b949={};_0x54b949[_0x45666a]={'$like':'%'+_0x2b736f[_0x821f('0x37')][_0x821f('0x3f')]+'%'};return _0x54b949;})});}_0x515b3e=_[_0x821f('0x42')]({},_0x515b3e,_0x2b736f[_0x821f('0x43')]);return _0x3406d8[_0x821f('0x8e')](_0x515b3e);}})['then'](function(_0x3a8910){if(_0x3a8910){_0x3c6074=_0x3a8910[_0x821f('0x38')];if(!_0x2b736f['query'][_0x821f('0x39')]('nolimit')){_0x515b3e[_0x821f('0x21')]=qs[_0x821f('0x21')](_0x2b736f[_0x821f('0x37')][_0x821f('0x21')]);_0x515b3e[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x2b736f['query']['offset']);}return _0x3406d8[_0x821f('0x8e')](_0x515b3e);}})[_0x821f('0x25')](function(_0x29a44f){if(_0x29a44f){return _0x29a44f?{'count':_0x3c6074,'rows':_0x29a44f}:null;}})[_0x821f('0x25')](respondWithResult(_0x54419c,null))['catch'](handleError(_0x54419c,null));};exports[_0x821f('0x8f')]=function(_0x273bdb,_0x365f32,_0x3a8e6d){var _0x1796f1,_0x303bbf;var _0x55f70f=[];var _0x3c0747=moment()[_0x821f('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x821f('0x2c')]['find']({'where':{'id':_0x273bdb['params']['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x365f32,null))['then'](function(_0x9a5990){if(_0x9a5990){_0x303bbf=_0x9a5990;return _0x9a5990[_0x821f('0x8f')](_0x273bdb[_0x821f('0x4c')][_0x821f('0x68')],_['omit'](_0x273bdb[_0x821f('0x4c')],[_0x821f('0x68'),'id'])||{});}return null;})['spread'](function(_0x25bd07){var _0x1ede1f;var _0x2a137c;_0x1796f1=_0x25bd07||[];var _0x3aba1f=[];if(_0x25bd07){for(var _0x3abba1=0x0;_0x3abba1<_0x25bd07[_0x821f('0x38')];_0x3abba1+=0x1){var _0x340a5b=_0x25bd07[_0x3abba1]['get']({'plain':!![]});_0x1ede1f=squel[_0x821f('0x7e')]()[_0x821f('0x6c')](_0x821f('0x90'))['fromQuery']([_0x821f('0x6e'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x61'),_0x821f('0x56'),_0x821f('0x55')],squel[_0x821f('0x72')]()['field']('phone',_0x821f('0x6e'))[_0x821f('0x73')]('id','ContactId')[_0x821f('0x73')](_0x340a5b[_0x821f('0x74')][_0x821f('0x75')](),_0x821f('0x71'))[_0x821f('0x73')](_0x273bdb[_0x821f('0x59')]['id']['toString'](),_0x821f('0x61'))[_0x821f('0x73')](_0x821f('0x7f'),_0x821f('0x56'))['field'](_0x821f('0x7f'),_0x821f('0x55'))['from'](_0x821f('0x80'))[_0x821f('0x40')](_0x821f('0x77'))[_0x821f('0x40')](_0x821f('0x81'),_0x340a5b[_0x821f('0x74')][_0x821f('0x75')]())[_0x821f('0x40')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x3aba1f['push'](db[_0x821f('0x8b')][_0x821f('0x37')](_0x1ede1f));}return BPromise[_0x821f('0x8c')](_0x3aba1f);}})[_0x821f('0x25')](function(){return _0x1796f1;})[_0x821f('0x25')](respondWithResult(_0x365f32,null))[_0x821f('0x48')](handleError(_0x365f32,null));};exports[_0x821f('0x91')]=function(_0x35338,_0x30b311,_0x2782b5){return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x35338[_0x821f('0x59')]['id']}})['then'](handleEntityNotFound(_0x30b311,null))[_0x821f('0x25')](function(_0x54652f){if(_0x54652f){return _0x54652f['removeBlackLists'](_0x35338['query'][_0x821f('0x68')]);}})[_0x821f('0x25')](function(_0x499553){if(_0x499553){return db['CmHopperBlack'][_0x821f('0x26')]({'where':{'ListId':_0x35338[_0x821f('0x37')][_0x821f('0x68')],'CampaignId':_0x35338[_0x821f('0x59')]['id']}})[_0x821f('0x25')](function(){return _0x499553;});}})['then'](respondWithStatusCode(_0x30b311,null))[_0x821f('0x48')](handleError(_0x30b311,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 54129ae..6f550fa 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(_0x46f098,_0x5f5063){var _0x1eef1d=function(_0x4d8b59){while(--_0x4d8b59){_0x46f098['push'](_0x46f098['shift']());}};_0x1eef1d(++_0x5f5063);}(_0x7a54,0x106));var _0x47a5=function(_0x46405c,_0x33d64c){_0x46405c=_0x46405c-0x0;var _0x4c4e7d=_0x7a54[_0x46405c];return _0x4c4e7d;};'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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index ce34cc5..024594e 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 _0x559a=['Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x559a,0xb3));var _0xa559=function(_0x4278eb,_0x16a32e){_0x4278eb=_0x4278eb-0x0;var _0x393dc1=_0x559a[_0x4278eb];return _0x393dc1;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var moment=require('moment');var BPromise=require(_0xa559('0x2'));var rs=require(_0xa559('0x3'));var fs=require('fs');var Redis=require(_0xa559('0x4'));var db=require(_0xa559('0x5'))['db'];var utils=require(_0xa559('0x6'));var logger=require(_0xa559('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa559('0x8'));var client=jayson[_0xa559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edab4,_0x1a5cec,_0x4eada1){return new BPromise(function(_0xb8055,_0x218e3b){return client[_0xa559('0xa')](_0x2edab4,_0x4eada1)[_0xa559('0xb')](function(_0x48aa9a){logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,_0xa559('0xe'));logger[_0xa559('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1a5cec,'request\x20sent',JSON[_0xa559('0x10')](_0x48aa9a));if(_0x48aa9a[_0xa559('0x11')]){if(_0x48aa9a['error'][_0xa559('0x12')]===0x1f4){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a['error'][_0xa559('0x13')]);return _0x218e3b(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a[_0xa559('0x11')]['message']);return _0xb8055(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}else{logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,'request\x20sent');_0xb8055(_0x48aa9a[_0xa559('0x14')]['message']);}})[_0xa559('0x15')](function(_0x1387b6){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x1387b6);_0x218e3b(_0x1387b6);});});}exports[_0xa559('0x16')]=function(_0x163405){var _0xd21ebf=this;return new Promise(function(_0x1a4c42,_0x16f090){return db[_0xa559('0x17')][_0xa559('0x18')]({'raw':_0x163405[_0xa559('0x19')]?_0x163405[_0xa559('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x163405['options']?_0x163405[_0xa559('0x19')][_0xa559('0x1a')]||null:null,'attributes':_0x163405['options']?_0x163405[_0xa559('0x19')][_0xa559('0x1b')]||null:null,'limit':_0x163405[_0xa559('0x19')]?_0x163405[_0xa559('0x19')][_0xa559('0x1c')]||null:null,'include':_0x163405[_0xa559('0x19')]?_0x163405['options'][_0xa559('0x1d')]?_['map'](_0x163405[_0xa559('0x19')][_0xa559('0x1d')],function(_0x314fef){return{'model':db[_0x314fef['model']],'as':_0x314fef['as'],'attributes':_0x314fef[_0xa559('0x1b')],'include':_0x314fef['include']?_[_0xa559('0x1e')](_0x314fef[_0xa559('0x1d')],function(_0x5834c6){return{'model':db[_0x5834c6[_0xa559('0x1f')]],'as':_0x5834c6['as'],'attributes':_0x5834c6['attributes'],'include':_0x5834c6['include']?_[_0xa559('0x1e')](_0x5834c6[_0xa559('0x1d')],function(_0x3fcf7f){return{'model':db[_0x3fcf7f[_0xa559('0x1f')]],'as':_0x3fcf7f['as'],'attributes':_0x3fcf7f[_0xa559('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa559('0xb')](function(_0x31e24b){logger[_0xa559('0xc')]('GetCampaign',_0x163405);logger[_0xa559('0xf')](_0xa559('0x16'),_0x163405,JSON[_0xa559('0x10')](_0x31e24b));_0x1a4c42(_0x31e24b);})[_0xa559('0x15')](function(_0x5f3fbb){logger[_0xa559('0x11')](_0xa559('0x16'),_0x5f3fbb[_0xa559('0x13')],_0x163405);_0x16f090(_0xd21ebf['error'](0x1f4,_0x5f3fbb[_0xa559('0x13')]));});});}; \ No newline at end of file +var _0x847d=['request','then','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','Campaign,\x20%s,\x20%s','message','info','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','debug','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3b36ec,_0x16d86d){var _0x453b5c=function(_0x3ff48a){while(--_0x3ff48a){_0x3b36ec['push'](_0x3b36ec['shift']());}};_0x453b5c(++_0x16d86d);}(_0x847d,0x14a));var _0xd847=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x847d[_0x817d9b];return _0x2752e1;};'use strict';var _=require('lodash');var util=require(_0xd847('0x0'));var moment=require(_0xd847('0x1'));var BPromise=require(_0xd847('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd847('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd847('0x4'));var logger=require(_0xd847('0x5'))('rpc');var config=require(_0xd847('0x6'));var jayson=require(_0xd847('0x7'));var client=jayson[_0xd847('0x8')][_0xd847('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f3349,_0x20dbfd,_0x19fdb5){return new BPromise(function(_0x2bb22b,_0x235e82){return client[_0xd847('0xa')](_0x5f3349,_0x19fdb5)[_0xd847('0xb')](function(_0x17cb36){logger['info']('Campaign,\x20%s,\x20%s',_0x20dbfd,'request\x20sent');logger['debug'](_0xd847('0xc'),_0x20dbfd,_0xd847('0xd'),JSON[_0xd847('0xe')](_0x17cb36));if(_0x17cb36['error']){if(_0x17cb36['error'][_0xd847('0xf')]===0x1f4){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x235e82(_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);}logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x2bb22b(_0x17cb36['error'][_0xd847('0x12')]);}else{logger[_0xd847('0x13')](_0xd847('0x11'),_0x20dbfd,_0xd847('0xd'));_0x2bb22b(_0x17cb36[_0xd847('0x14')]['message']);}})[_0xd847('0x15')](function(_0x3e1e1c){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x3e1e1c);_0x235e82(_0x3e1e1c);});});}exports['GetCampaign']=function(_0x1ef765){var _0x5eb665=this;return new Promise(function(_0x4b6264,_0x44a57b){return db[_0xd847('0x16')][_0xd847('0x17')]({'raw':_0x1ef765[_0xd847('0x18')]?_0x1ef765['options'][_0xd847('0x19')]===undefined?!![]:![]:!![],'where':_0x1ef765['options']?_0x1ef765['options'][_0xd847('0x1a')]||null:null,'attributes':_0x1ef765[_0xd847('0x18')]?_0x1ef765[_0xd847('0x18')][_0xd847('0x1b')]||null:null,'limit':_0x1ef765[_0xd847('0x18')]?_0x1ef765[_0xd847('0x18')][_0xd847('0x1c')]||null:null,'include':_0x1ef765[_0xd847('0x18')]?_0x1ef765[_0xd847('0x18')][_0xd847('0x1d')]?_[_0xd847('0x1e')](_0x1ef765[_0xd847('0x18')]['include'],function(_0x560563){return{'model':db[_0x560563[_0xd847('0x1f')]],'as':_0x560563['as'],'attributes':_0x560563[_0xd847('0x1b')],'include':_0x560563[_0xd847('0x1d')]?_['map'](_0x560563[_0xd847('0x1d')],function(_0x246920){return{'model':db[_0x246920[_0xd847('0x1f')]],'as':_0x246920['as'],'attributes':_0x246920[_0xd847('0x1b')],'include':_0x246920[_0xd847('0x1d')]?_[_0xd847('0x1e')](_0x246920[_0xd847('0x1d')],function(_0x460eba){return{'model':db[_0x460eba[_0xd847('0x1f')]],'as':_0x460eba['as'],'attributes':_0x460eba['attributes']};}):[]};}):[]};}):[]:[]})[_0xd847('0xb')](function(_0x1d03e2){logger[_0xd847('0x13')](_0xd847('0x20'),_0x1ef765);logger[_0xd847('0x21')](_0xd847('0x20'),_0x1ef765,JSON['stringify'](_0x1d03e2));_0x4b6264(_0x1d03e2);})[_0xd847('0x15')](function(_0x5375fe){logger['error']('GetCampaign',_0x5375fe[_0xd847('0x12')],_0x1ef765);_0x44a57b(_0x5eb665[_0xd847('0x10')](0x1f4,_0x5375fe[_0xd847('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 58bd5e8..9802e15 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 _0xdf71=['create','/:id/clone','clone','post','addLists','addBlackLists','put','destroy','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists'];(function(_0x150340,_0x11959e){var _0x51d792=function(_0x4a587d){while(--_0x4a587d){_0x150340['push'](_0x150340['shift']());}};_0x51d792(++_0x11959e);}(_0xdf71,0x1d2));var _0x1df7=function(_0x4a4760,_0x7ce6b4){_0x4a4760=_0x4a4760-0x0;var _0x3c2c17=_0xdf71[_0x4a4760];return _0x3c2c17;};'use strict';var multer=require(_0x1df7('0x0'));var util=require('util');var path=require(_0x1df7('0x1'));var timeout=require(_0x1df7('0x2'));var express=require(_0x1df7('0x3'));var router=express[_0x1df7('0x4')]();var fs_extra=require(_0x1df7('0x5'));var auth=require(_0x1df7('0x6'));var interaction=require(_0x1df7('0x7'));var config=require('../../config/environment');var controller=require(_0x1df7('0x8'));router[_0x1df7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1df7('0x9')](_0x1df7('0xa'),auth['isAuthenticated'](),controller[_0x1df7('0xb')]);router['get'](_0x1df7('0xc'),auth[_0x1df7('0xd')](),controller[_0x1df7('0xe')]);router[_0x1df7('0x9')]('/:id/hopper_histories',auth[_0x1df7('0xd')](),controller[_0x1df7('0xf')]);router[_0x1df7('0x9')](_0x1df7('0x10'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x11')]);router['get'](_0x1df7('0x12'),auth['isAuthenticated'](),controller[_0x1df7('0x13')]);router[_0x1df7('0x9')](_0x1df7('0x14'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x15')]);router['get'](_0x1df7('0x16'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1df7('0x18')]);router['post'](_0x1df7('0x19'),auth['isAuthenticated'](),controller[_0x1df7('0x1a')]);router[_0x1df7('0x1b')](_0x1df7('0x14'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x1c')]);router['post'](_0x1df7('0x16'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x1d')]);router[_0x1df7('0x1e')](_0x1df7('0xa'),auth[_0x1df7('0xd')](),controller['update']);router['delete'](_0x1df7('0xa'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x1f')]);router[_0x1df7('0x20')](_0x1df7('0x14'),auth[_0x1df7('0xd')](),controller['removeLists']);router[_0x1df7('0x20')](_0x1df7('0x16'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x21')]);module[_0x1df7('0x22')]=router; \ No newline at end of file +var _0xfb3f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xfb3f,0xb2));var _0xffb3=function(_0x52b52b,_0x2d911b){_0x52b52b=_0x52b52b-0x0;var _0x32f894=_0xfb3f[_0x52b52b];return _0x32f894;};'use strict';var multer=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var path=require(_0xffb3('0x2'));var timeout=require(_0xffb3('0x3'));var express=require('express');var router=express[_0xffb3('0x4')]();var fs_extra=require(_0xffb3('0x5'));var auth=require(_0xffb3('0x6'));var interaction=require(_0xffb3('0x7'));var config=require('../../config/environment');var controller=require(_0xffb3('0x8'));router[_0xffb3('0x9')]('/',auth['isAuthenticated'](),controller[_0xffb3('0xa')]);router[_0xffb3('0x9')](_0xffb3('0xb'),auth['isAuthenticated'](),controller[_0xffb3('0xc')]);router[_0xffb3('0x9')](_0xffb3('0xd'),auth[_0xffb3('0xe')](),controller['getHoppers']);router[_0xffb3('0x9')](_0xffb3('0xf'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x10')]);router[_0xffb3('0x9')](_0xffb3('0x11'),auth[_0xffb3('0xe')](),controller['getHopperFinals']);router[_0xffb3('0x9')](_0xffb3('0x12'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x13')]);router[_0xffb3('0x9')](_0xffb3('0x14'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x15')]);router[_0xffb3('0x9')](_0xffb3('0x16'),auth['isAuthenticated'](),controller[_0xffb3('0x17')]);router[_0xffb3('0x18')]('/',auth[_0xffb3('0xe')](),controller['create']);router[_0xffb3('0x18')](_0xffb3('0x19'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1a')]);router[_0xffb3('0x18')](_0xffb3('0x14'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1b')]);router[_0xffb3('0x18')](_0xffb3('0x16'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1c')]);router[_0xffb3('0x1d')](_0xffb3('0xb'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1e')]);router['delete'](_0xffb3('0xb'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1f')]);router[_0xffb3('0x20')]('/:id/lists',auth['isAuthenticated'](),controller[_0xffb3('0x21')]);router['delete']('/:id/blacklists',auth[_0xffb3('0xe')](),controller[_0xffb3('0x22')]);module[_0xffb3('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index b7c4dd0..8e43245 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 _0x3bf8=['getDataValue','sequelize','TEXT','medium','VIRTUAL'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3bf8,0x132));var _0x83bf=function(_0x5e2ece,_0x1a1633){_0x5e2ece=_0x5e2ece-0x0;var _0x5aed84=_0x3bf8[_0x5e2ece];return _0x5aed84;};'use strict';var Sequelize=require(_0x83bf('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x83bf('0x1')],'length':_0x83bf('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x83bf('0x3')],'get':function(){return this[_0x83bf('0x4')]('key');}}}; \ No newline at end of file +var _0x549e=['TEXT','medium','getDataValue','key','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x549e,0xe8));var _0xe549=function(_0x220a35,_0x215368){_0x220a35=_0x220a35-0x0;var _0x4808dd=_0x549e[_0x220a35];return _0x4808dd;};'use strict';var Sequelize=require('sequelize');module[_0xe549('0x0')]={'key':{'type':Sequelize[_0xe549('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xe549('0x2')],'length':_0xe549('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe549('0x4')](_0xe549('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 8606484..bbab60f 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 _0x5b44=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','options','count','includeAll','include','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x5b44,0x101));var _0x45b4=function(_0x584afc,_0x84064f){_0x584afc=_0x584afc-0x0;var _0x3d60f8=_0x5b44[_0x584afc];return _0x3d60f8;};'use strict';var emlformat=require(_0x45b4('0x0'));var rimraf=require(_0x45b4('0x1'));var zipdir=require(_0x45b4('0x2'));var jsonpatch=require(_0x45b4('0x3'));var rp=require('request-promise');var moment=require(_0x45b4('0x4'));var BPromise=require(_0x45b4('0x5'));var Mustache=require('mustache');var util=require(_0x45b4('0x6'));var path=require(_0x45b4('0x7'));var sox=require(_0x45b4('0x8'));var csv=require(_0x45b4('0x9'));var ejs=require(_0x45b4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45b4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x45b4('0xc'));var deskjs=require(_0x45b4('0xd'));var toCsv=require(_0x45b4('0x9'));var querystring=require(_0x45b4('0xe'));var Papa=require(_0x45b4('0xf'));var Redis=require('ioredis');var authService=require(_0x45b4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x45b4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45b4('0x12'))(_0x45b4('0x13'));var utils=require(_0x45b4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x45b4('0x15'))['db'];function respondWithStatusCode(_0x2841e9,_0x1b7c86){_0x1b7c86=_0x1b7c86||0xcc;return function(_0xcda46c){if(_0xcda46c){return _0x2841e9['sendStatus'](_0x1b7c86);}return _0x2841e9[_0x45b4('0x16')](_0x1b7c86)['end']();};}function respondWithResult(_0x407807,_0x2cc6f9){_0x2cc6f9=_0x2cc6f9||0xc8;return function(_0x1eec44){if(_0x1eec44){return _0x407807['status'](_0x2cc6f9)[_0x45b4('0x17')](_0x1eec44);}};}function respondWithFilteredResult(_0x558bca,_0x3c23a0){return function(_0x119320){if(_0x119320){var _0x33c88c=typeof _0x3c23a0[_0x45b4('0x18')]===_0x45b4('0x19')&&typeof _0x3c23a0['limit']===_0x45b4('0x19');var _0x228efe=_0x119320['count'];var _0x4b25e1=_0x33c88c?0x0:_0x3c23a0[_0x45b4('0x18')];var _0x5a242f=_0x33c88c?_0x119320['count']:_0x3c23a0[_0x45b4('0x18')]+_0x3c23a0['limit'];var _0x4907e6;if(_0x5a242f>=_0x228efe){_0x5a242f=_0x228efe;_0x4907e6=0xc8;}else{_0x4907e6=0xce;}_0x558bca[_0x45b4('0x16')](_0x4907e6);return _0x558bca['set'](_0x45b4('0x1a'),_0x4b25e1+'-'+_0x5a242f+'/'+_0x228efe)['json'](_0x119320);}return null;};}function patchUpdates(_0x1deb11){return function(_0x52534f){try{jsonpatch['apply'](_0x52534f,_0x1deb11,!![]);}catch(_0x3058ca){return BPromise[_0x45b4('0x1b')](_0x3058ca);}return _0x52534f[_0x45b4('0x1c')]();};}function saveUpdates(_0x1e1c37,_0x5305ff){return function(_0x4bf56f){if(_0x4bf56f){return _0x4bf56f[_0x45b4('0x1d')](_0x1e1c37)[_0x45b4('0x1e')](function(_0x4aa2b5){return _0x4aa2b5;});}return null;};}function removeEntity(_0x5d3c69,_0x2cef39){return function(_0x898d73){if(_0x898d73){return _0x898d73[_0x45b4('0x1f')]()[_0x45b4('0x1e')](function(){var _0x3af261=_0x898d73[_0x45b4('0x20')]({'plain':!![]});var _0x4469ac=_0x45b4('0x21');return db[_0x45b4('0x22')][_0x45b4('0x1f')]({'where':{'type':_0x4469ac,'resourceId':_0x3af261['id']}})['then'](function(){return _0x898d73;});})[_0x45b4('0x1e')](function(){_0x5d3c69[_0x45b4('0x16')](0xcc)[_0x45b4('0x23')]();});}};}function handleEntityNotFound(_0x2e6287,_0x44783b){return function(_0x25b8e1){if(!_0x25b8e1){_0x2e6287[_0x45b4('0x24')](0x194);}return _0x25b8e1;};}function handleError(_0xc3d163,_0x571461){_0x571461=_0x571461||0x1f4;return function(_0x6e680b){logger[_0x45b4('0x25')](_0x6e680b[_0x45b4('0x26')]);if(_0x6e680b[_0x45b4('0x27')]){delete _0x6e680b[_0x45b4('0x27')];}_0xc3d163[_0x45b4('0x16')](_0x571461)[_0x45b4('0x28')](_0x6e680b);};}exports[_0x45b4('0x29')]=function(_0x224854,_0x2740f7){var _0x5c9888={},_0x218b5f={},_0x295f4e={'count':0x0,'rows':[]};var _0x4bbee5=_[_0x45b4('0x2a')](db[_0x45b4('0x2b')][_0x45b4('0x2c')],function(_0x4a69f9){return{'name':_0x4a69f9['fieldName'],'type':_0x4a69f9[_0x45b4('0x2d')][_0x45b4('0x2e')]};});_0x218b5f[_0x45b4('0x2f')]=_[_0x45b4('0x2a')](_0x4bbee5,_0x45b4('0x27'));_0x218b5f[_0x45b4('0x30')]=_[_0x45b4('0x31')](_0x224854['query']);_0x218b5f[_0x45b4('0x32')]=_[_0x45b4('0x33')](_0x218b5f[_0x45b4('0x2f')],_0x218b5f['query']);_0x5c9888[_0x45b4('0x34')]=_[_0x45b4('0x33')](_0x218b5f[_0x45b4('0x2f')],qs[_0x45b4('0x35')](_0x224854['query'][_0x45b4('0x35')]));_0x5c9888[_0x45b4('0x34')]=_0x5c9888['attributes'][_0x45b4('0x36')]?_0x5c9888[_0x45b4('0x34')]:_0x218b5f[_0x45b4('0x2f')];if(!_0x224854[_0x45b4('0x30')][_0x45b4('0x37')](_0x45b4('0x38'))){_0x5c9888[_0x45b4('0x39')]=qs['limit'](_0x224854['query'][_0x45b4('0x39')]);_0x5c9888[_0x45b4('0x18')]=qs[_0x45b4('0x18')](_0x224854[_0x45b4('0x30')][_0x45b4('0x18')]);}_0x5c9888[_0x45b4('0x3a')]=qs[_0x45b4('0x3b')](_0x224854[_0x45b4('0x30')]['sort']);_0x5c9888['where']=qs[_0x45b4('0x32')](_[_0x45b4('0x3c')](_0x224854[_0x45b4('0x30')],_0x218b5f[_0x45b4('0x32')]),_0x4bbee5);if(_0x224854[_0x45b4('0x30')][_0x45b4('0x3d')]){_0x5c9888[_0x45b4('0x3e')]=_['merge'](_0x5c9888[_0x45b4('0x3e')],{'$or':[{'key':{'$like':'%'+_0x224854[_0x45b4('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x224854['query'][_0x45b4('0x3d')]+'%'}}]});}_0x5c9888=_['merge']({},_0x5c9888,_0x224854[_0x45b4('0x3f')]);var _0x3e0320={'where':_0x5c9888[_0x45b4('0x3e')]};return db[_0x45b4('0x2b')]['count'](_0x3e0320)[_0x45b4('0x1e')](function(_0x26c10a){_0x295f4e[_0x45b4('0x40')]=_0x26c10a;if(_0x224854[_0x45b4('0x30')][_0x45b4('0x41')]){_0x5c9888[_0x45b4('0x42')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5c9888);})[_0x45b4('0x1e')](function(_0x2394bb){_0x295f4e[_0x45b4('0x43')]=_0x2394bb;return _0x295f4e;})[_0x45b4('0x1e')](respondWithFilteredResult(_0x2740f7,_0x5c9888))[_0x45b4('0x44')](handleError(_0x2740f7,null));};exports[_0x45b4('0x45')]=function(_0x30b2ca,_0x4b01bc){var _0x53a26a={'raw':!![],'where':{'id':_0x30b2ca[_0x45b4('0x46')]['id']}},_0x206069={};_0x206069[_0x45b4('0x2f')]=_[_0x45b4('0x31')](db[_0x45b4('0x2b')][_0x45b4('0x2c')]);_0x206069[_0x45b4('0x30')]=_[_0x45b4('0x31')](_0x30b2ca['query']);_0x206069[_0x45b4('0x32')]=_['intersection'](_0x206069[_0x45b4('0x2f')],_0x206069[_0x45b4('0x30')]);_0x53a26a[_0x45b4('0x34')]=_['intersection'](_0x206069['model'],qs[_0x45b4('0x35')](_0x30b2ca['query'][_0x45b4('0x35')]));_0x53a26a[_0x45b4('0x34')]=_0x53a26a[_0x45b4('0x34')][_0x45b4('0x36')]?_0x53a26a[_0x45b4('0x34')]:_0x206069[_0x45b4('0x2f')];if(_0x30b2ca[_0x45b4('0x30')][_0x45b4('0x41')]){_0x53a26a['include']=[{'all':!![]}];}_0x53a26a=_['merge']({},_0x53a26a,_0x30b2ca[_0x45b4('0x3f')]);return db[_0x45b4('0x2b')][_0x45b4('0x47')](_0x53a26a)['then'](handleEntityNotFound(_0x4b01bc,null))['then'](respondWithResult(_0x4b01bc,null))[_0x45b4('0x44')](handleError(_0x4b01bc,null));};exports[_0x45b4('0x1d')]=function(_0x10e434,_0xf077e1){if(_0x10e434['body']['id']){delete _0x10e434['body']['id'];}return db[_0x45b4('0x2b')]['find']({'where':{'id':_0x10e434['params']['id']}})[_0x45b4('0x1e')](handleEntityNotFound(_0xf077e1,null))['then'](saveUpdates(_0x10e434[_0x45b4('0x48')],null))[_0x45b4('0x1e')](respondWithResult(_0xf077e1,null))[_0x45b4('0x44')](handleError(_0xf077e1,null));};exports['destroy']=function(_0x407241,_0xea2f33){return db[_0x45b4('0x2b')][_0x45b4('0x47')]({'where':{'id':_0x407241['params']['id']}})[_0x45b4('0x1e')](handleEntityNotFound(_0xea2f33,null))[_0x45b4('0x1e')](removeEntity(_0xea2f33,null))[_0x45b4('0x44')](handleError(_0xea2f33,null));};exports[_0x45b4('0x49')]=function(_0x1a8e4f,_0x5a7dd7){var _0x18126d={'key':_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x2e')]};if(_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4a')]){_0x18126d[_0x45b4('0x4a')]=_0x1a8e4f['body'][_0x45b4('0x4a')];}else if(_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4b')]){_0x18126d[_0x45b4('0x4b')]=_0x1a8e4f['body'][_0x45b4('0x4b')];}else if(_0x1a8e4f['body'][_0x45b4('0x4c')]){_0x18126d[_0x45b4('0x4c')]=_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4c')];}else if(_0x1a8e4f[_0x45b4('0x48')]['ChatWebsiteId']){_0x18126d[_0x45b4('0x4d')]=_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4d')];}return db[_0x45b4('0x2b')][_0x45b4('0x47')]({'where':_0x18126d})['then'](function(_0x27c645){if(_0x27c645){throw new db['Sequelize'][(_0x45b4('0x4e'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x45b4('0x2b')][_0x45b4('0x49')](_0x1a8e4f['body']);})[_0x45b4('0x1e')](function(_0x2bf465){var _0x17e5ad=_0x1a8e4f['user'][_0x45b4('0x20')]({'plain':!![]});if(!_0x17e5ad)throw new Error(_0x45b4('0x4f'));if(_0x17e5ad[_0x45b4('0x50')]===_0x45b4('0x51')){var _0x46557e=_0x2bf465['get']({'plain':!![]});return db['UserProfileSection'][_0x45b4('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x17e5ad[_0x45b4('0x52')]},'raw':!![]})[_0x45b4('0x1e')](function(_0x29c169){if(_0x29c169&&_0x29c169[_0x45b4('0x53')]===0x0){return db[_0x45b4('0x22')]['create']({'name':_0x46557e['name'],'resourceId':_0x46557e['id'],'type':_0x29c169['name'],'sectionId':_0x29c169['id']},{})[_0x45b4('0x1e')](function(){return _0x2bf465;});}else{return _0x2bf465;}})['catch'](function(_0x4d27f9){logger['error'](_0x45b4('0x54'),_0x4d27f9);throw _0x4d27f9;});}return _0x2bf465;})[_0x45b4('0x1e')](respondWithResult(_0x5a7dd7,0xc9))[_0x45b4('0x44')](handleError(_0x5a7dd7,null));}; \ No newline at end of file +var _0x718e=['error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','find','catch','params','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','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','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','limit','undefined','count','offset','Content-Range','json','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x718e,0x143));var _0xe718=function(_0x12b859,_0x40804e){_0x12b859=_0x12b859-0x0;var _0x867976=_0x718e[_0x12b859];return _0x867976;};'use strict';var emlformat=require(_0xe718('0x0'));var rimraf=require(_0xe718('0x1'));var zipdir=require(_0xe718('0x2'));var jsonpatch=require(_0xe718('0x3'));var rp=require('request-promise');var moment=require(_0xe718('0x4'));var BPromise=require(_0xe718('0x5'));var Mustache=require(_0xe718('0x6'));var util=require(_0xe718('0x7'));var path=require(_0xe718('0x8'));var sox=require(_0xe718('0x9'));var csv=require(_0xe718('0xa'));var ejs=require(_0xe718('0xb'));var fs=require('fs');var fs_extra=require(_0xe718('0xc'));var _=require(_0xe718('0xd'));var squel=require(_0xe718('0xe'));var crypto=require('crypto');var jsforce=require(_0xe718('0xf'));var deskjs=require(_0xe718('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe718('0x11'));var Redis=require(_0xe718('0x12'));var authService=require(_0xe718('0x13'));var qs=require(_0xe718('0x14'));var as=require(_0xe718('0x15'));var hardwareService=require(_0xe718('0x16'));var logger=require('../../config/logger')(_0xe718('0x17'));var utils=require(_0xe718('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45afe7,_0x51443d){_0x51443d=_0x51443d||0xcc;return function(_0x22a3b2){if(_0x22a3b2){return _0x45afe7[_0xe718('0x19')](_0x51443d);}return _0x45afe7[_0xe718('0x1a')](_0x51443d)['end']();};}function respondWithResult(_0x57dc19,_0x5ae7fc){_0x5ae7fc=_0x5ae7fc||0xc8;return function(_0x1bb5de){if(_0x1bb5de){return _0x57dc19[_0xe718('0x1a')](_0x5ae7fc)['json'](_0x1bb5de);}};}function respondWithFilteredResult(_0x8a3fc1,_0x6e640b){return function(_0x212230){if(_0x212230){var _0x3f45ee=typeof _0x6e640b['offset']==='undefined'&&typeof _0x6e640b[_0xe718('0x1b')]===_0xe718('0x1c');var _0x15c810=_0x212230[_0xe718('0x1d')];var _0x1b21bc=_0x3f45ee?0x0:_0x6e640b[_0xe718('0x1e')];var _0x3529ee=_0x3f45ee?_0x212230[_0xe718('0x1d')]:_0x6e640b['offset']+_0x6e640b['limit'];var _0x3ccb3d;if(_0x3529ee>=_0x15c810){_0x3529ee=_0x15c810;_0x3ccb3d=0xc8;}else{_0x3ccb3d=0xce;}_0x8a3fc1['status'](_0x3ccb3d);return _0x8a3fc1['set'](_0xe718('0x1f'),_0x1b21bc+'-'+_0x3529ee+'/'+_0x15c810)[_0xe718('0x20')](_0x212230);}return null;};}function patchUpdates(_0x38ff8a){return function(_0x3bb95c){try{jsonpatch['apply'](_0x3bb95c,_0x38ff8a,!![]);}catch(_0x3940b7){return BPromise[_0xe718('0x21')](_0x3940b7);}return _0x3bb95c['save']();};}function saveUpdates(_0x45e0f8,_0x173b2a){return function(_0x26ed0b){if(_0x26ed0b){return _0x26ed0b[_0xe718('0x22')](_0x45e0f8)[_0xe718('0x23')](function(_0x335884){return _0x335884;});}return null;};}function removeEntity(_0x492610,_0x39b9b3){return function(_0x2cfac8){if(_0x2cfac8){return _0x2cfac8[_0xe718('0x24')]()[_0xe718('0x23')](function(){var _0x3f6ade=_0x2cfac8[_0xe718('0x25')]({'plain':!![]});var _0x18702e=_0xe718('0x26');return db[_0xe718('0x27')][_0xe718('0x24')]({'where':{'type':_0x18702e,'resourceId':_0x3f6ade['id']}})[_0xe718('0x23')](function(){return _0x2cfac8;});})[_0xe718('0x23')](function(){_0x492610[_0xe718('0x1a')](0xcc)[_0xe718('0x28')]();});}};}function handleEntityNotFound(_0x17ee64,_0x3994d7){return function(_0x1d3149){if(!_0x1d3149){_0x17ee64[_0xe718('0x19')](0x194);}return _0x1d3149;};}function handleError(_0x94c480,_0x426781){_0x426781=_0x426781||0x1f4;return function(_0x21ccb7){logger[_0xe718('0x29')](_0x21ccb7[_0xe718('0x2a')]);if(_0x21ccb7['name']){delete _0x21ccb7[_0xe718('0x2b')];}_0x94c480[_0xe718('0x1a')](_0x426781)[_0xe718('0x2c')](_0x21ccb7);};}exports[_0xe718('0x2d')]=function(_0x349f48,_0x2d334f){var _0x1f790a={},_0x66bfba={},_0x570e0b={'count':0x0,'rows':[]};var _0x277f02=_[_0xe718('0x2e')](db[_0xe718('0x2f')][_0xe718('0x30')],function(_0x513fa4){return{'name':_0x513fa4[_0xe718('0x31')],'type':_0x513fa4[_0xe718('0x32')][_0xe718('0x33')]};});_0x66bfba['model']=_[_0xe718('0x2e')](_0x277f02,_0xe718('0x2b'));_0x66bfba[_0xe718('0x34')]=_[_0xe718('0x35')](_0x349f48['query']);_0x66bfba[_0xe718('0x36')]=_[_0xe718('0x37')](_0x66bfba[_0xe718('0x38')],_0x66bfba[_0xe718('0x34')]);_0x1f790a[_0xe718('0x39')]=_['intersection'](_0x66bfba['model'],qs[_0xe718('0x3a')](_0x349f48[_0xe718('0x34')][_0xe718('0x3a')]));_0x1f790a['attributes']=_0x1f790a[_0xe718('0x39')]['length']?_0x1f790a[_0xe718('0x39')]:_0x66bfba[_0xe718('0x38')];if(!_0x349f48[_0xe718('0x34')][_0xe718('0x3b')](_0xe718('0x3c'))){_0x1f790a[_0xe718('0x1b')]=qs[_0xe718('0x1b')](_0x349f48[_0xe718('0x34')][_0xe718('0x1b')]);_0x1f790a[_0xe718('0x1e')]=qs[_0xe718('0x1e')](_0x349f48['query'][_0xe718('0x1e')]);}_0x1f790a[_0xe718('0x3d')]=qs[_0xe718('0x3e')](_0x349f48[_0xe718('0x34')][_0xe718('0x3e')]);_0x1f790a[_0xe718('0x3f')]=qs[_0xe718('0x36')](_[_0xe718('0x40')](_0x349f48[_0xe718('0x34')],_0x66bfba[_0xe718('0x36')]),_0x277f02);if(_0x349f48['query'][_0xe718('0x41')]){_0x1f790a['where']=_[_0xe718('0x42')](_0x1f790a['where'],{'$or':[{'key':{'$like':'%'+_0x349f48['query'][_0xe718('0x41')]+'%'}},{'value':{'$like':'%'+_0x349f48[_0xe718('0x34')][_0xe718('0x41')]+'%'}}]});}_0x1f790a=_[_0xe718('0x42')]({},_0x1f790a,_0x349f48[_0xe718('0x43')]);var _0x45eab5={'where':_0x1f790a[_0xe718('0x3f')]};return db[_0xe718('0x2f')][_0xe718('0x1d')](_0x45eab5)[_0xe718('0x23')](function(_0x463118){_0x570e0b[_0xe718('0x1d')]=_0x463118;if(_0x349f48[_0xe718('0x34')][_0xe718('0x44')]){_0x1f790a[_0xe718('0x45')]=[{'all':!![]}];}return db[_0xe718('0x2f')][_0xe718('0x46')](_0x1f790a);})[_0xe718('0x23')](function(_0x367172){_0x570e0b[_0xe718('0x47')]=_0x367172;return _0x570e0b;})[_0xe718('0x23')](respondWithFilteredResult(_0x2d334f,_0x1f790a))['catch'](handleError(_0x2d334f,null));};exports['show']=function(_0xd58b26,_0x1adfaa){var _0x3d5ce9={'raw':!![],'where':{'id':_0xd58b26['params']['id']}},_0x1273de={};_0x1273de[_0xe718('0x38')]=_[_0xe718('0x35')](db[_0xe718('0x2f')][_0xe718('0x30')]);_0x1273de[_0xe718('0x34')]=_[_0xe718('0x35')](_0xd58b26[_0xe718('0x34')]);_0x1273de['filters']=_[_0xe718('0x37')](_0x1273de[_0xe718('0x38')],_0x1273de[_0xe718('0x34')]);_0x3d5ce9[_0xe718('0x39')]=_[_0xe718('0x37')](_0x1273de[_0xe718('0x38')],qs[_0xe718('0x3a')](_0xd58b26[_0xe718('0x34')][_0xe718('0x3a')]));_0x3d5ce9[_0xe718('0x39')]=_0x3d5ce9[_0xe718('0x39')]['length']?_0x3d5ce9[_0xe718('0x39')]:_0x1273de[_0xe718('0x38')];if(_0xd58b26['query']['includeAll']){_0x3d5ce9[_0xe718('0x45')]=[{'all':!![]}];}_0x3d5ce9=_['merge']({},_0x3d5ce9,_0xd58b26[_0xe718('0x43')]);return db[_0xe718('0x2f')][_0xe718('0x48')](_0x3d5ce9)[_0xe718('0x23')](handleEntityNotFound(_0x1adfaa,null))[_0xe718('0x23')](respondWithResult(_0x1adfaa,null))[_0xe718('0x49')](handleError(_0x1adfaa,null));};exports['update']=function(_0x3e6f8f,_0x4352f7){if(_0x3e6f8f['body']['id']){delete _0x3e6f8f['body']['id'];}return db[_0xe718('0x2f')][_0xe718('0x48')]({'where':{'id':_0x3e6f8f[_0xe718('0x4a')]['id']}})[_0xe718('0x23')](handleEntityNotFound(_0x4352f7,null))[_0xe718('0x23')](saveUpdates(_0x3e6f8f[_0xe718('0x4b')],null))['then'](respondWithResult(_0x4352f7,null))[_0xe718('0x49')](handleError(_0x4352f7,null));};exports[_0xe718('0x24')]=function(_0x2a1584,_0x1837e5){return db['CannedAnswer'][_0xe718('0x48')]({'where':{'id':_0x2a1584[_0xe718('0x4a')]['id']}})[_0xe718('0x23')](handleEntityNotFound(_0x1837e5,null))[_0xe718('0x23')](removeEntity(_0x1837e5,null))[_0xe718('0x49')](handleError(_0x1837e5,null));};exports[_0xe718('0x4c')]=function(_0x51df69,_0x50ac7a){var _0x395052={'key':_0x51df69['body'][_0xe718('0x33')]};if(_0x51df69[_0xe718('0x4b')][_0xe718('0x4d')]){_0x395052['MailAccountId']=_0x51df69[_0xe718('0x4b')][_0xe718('0x4d')];}else if(_0x51df69[_0xe718('0x4b')]['SmsAccountId']){_0x395052[_0xe718('0x4e')]=_0x51df69['body'][_0xe718('0x4e')];}else if(_0x51df69[_0xe718('0x4b')][_0xe718('0x4f')]){_0x395052[_0xe718('0x4f')]=_0x51df69[_0xe718('0x4b')]['OpenchannelAccountId'];}else if(_0x51df69[_0xe718('0x4b')][_0xe718('0x50')]){_0x395052[_0xe718('0x50')]=_0x51df69['body'][_0xe718('0x50')];}return db['CannedAnswer'][_0xe718('0x48')]({'where':_0x395052})[_0xe718('0x23')](function(_0x4e0725){if(_0x4e0725){throw new db[(_0xe718('0x51'))][(_0xe718('0x52'))](_0xe718('0x53'));}return db['CannedAnswer']['create'](_0x51df69[_0xe718('0x4b')]);})[_0xe718('0x23')](function(_0x5b0153){var _0x386c17=_0x51df69['user'][_0xe718('0x25')]({'plain':!![]});if(!_0x386c17)throw new Error(_0xe718('0x54'));if(_0x386c17[_0xe718('0x55')]===_0xe718('0x56')){var _0x3d754b=_0x5b0153[_0xe718('0x25')]({'plain':!![]});return db[_0xe718('0x57')][_0xe718('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x386c17[_0xe718('0x58')]},'raw':!![]})[_0xe718('0x23')](function(_0x32d2e3){if(_0x32d2e3&&_0x32d2e3[_0xe718('0x59')]===0x0){return db[_0xe718('0x27')][_0xe718('0x4c')]({'name':_0x3d754b[_0xe718('0x2b')],'resourceId':_0x3d754b['id'],'type':_0x32d2e3[_0xe718('0x2b')],'sectionId':_0x32d2e3['id']},{})['then'](function(){return _0x5b0153;});}else{return _0x5b0153;}})[_0xe718('0x49')](function(_0x3a51de){logger[_0xe718('0x29')](_0xe718('0x5a'),_0x3a51de);throw _0x3a51de;});}return _0x5b0153;})[_0xe718('0x23')](respondWithResult(_0x50ac7a,0xc9))[_0xe718('0x49')](handleError(_0x50ac7a,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 5270cef..974a53f 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 _0x482b=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5d1c54,_0x1f2a92){var _0x2ecd1b=function(_0x344211){while(--_0x344211){_0x5d1c54['push'](_0x5d1c54['shift']());}};_0x2ecd1b(++_0x1f2a92);}(_0x482b,0x12a));var _0xb482=function(_0x2baf26,_0x425803){_0x2baf26=_0x2baf26-0x0;var _0x4cc2ad=_0x482b[_0x2baf26];return _0x4cc2ad;};'use strict';var _=require(_0xb482('0x0'));var util=require(_0xb482('0x1'));var logger=require(_0xb482('0x2'))('api');var moment=require(_0xb482('0x3'));var BPromise=require('bluebird');var rp=require(_0xb482('0x4'));var fs=require('fs');var path=require(_0xb482('0x5'));var rimraf=require(_0xb482('0x6'));var config=require(_0xb482('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0xb482('0x8')]=function(_0x3a6412,_0x254284){return _0x3a6412[_0xb482('0x9')](_0xb482('0xa'),attributes,{'tableName':_0xb482('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb482('0xc'),'collate':_0xb482('0xd')});}; \ No newline at end of file +var _0x4281=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci'];(function(_0x11b53b,_0x188564){var _0x529666=function(_0x54ef3a){while(--_0x54ef3a){_0x11b53b['push'](_0x11b53b['shift']());}};_0x529666(++_0x188564);}(_0x4281,0x1a4));var _0x1428=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0x4281[_0x102881];return _0x5c63d0;};'use strict';var _=require(_0x1428('0x0'));var util=require(_0x1428('0x1'));var logger=require(_0x1428('0x2'))(_0x1428('0x3'));var moment=require(_0x1428('0x4'));var BPromise=require(_0x1428('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1428('0x6'));var rimraf=require(_0x1428('0x7'));var config=require('../../config/environment');var attributes=require(_0x1428('0x8'));module[_0x1428('0x9')]=function(_0x2bac75,_0x33b855){return _0x2bac75[_0x1428('0xa')](_0x1428('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1428('0xc'),'collate':_0x1428('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 41ddde7..b5c487d 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(_0x5314c7,_0x392ead){var _0x81347c=function(_0x577f79){while(--_0x577f79){_0x5314c7['push'](_0x5314c7['shift']());}};_0x81347c(++_0x392ead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x28b37c,_0x57386c){var _0x276e9d=function(_0x56e6fc){while(--_0x56e6fc){_0x28b37c['push'](_0x28b37c['shift']());}};_0x276e9d(++_0x57386c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var 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 96858b5..22dc302 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 _0xaddc=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x399dd8,_0x33eb97){var _0x592a3d=function(_0x48ebe6){while(--_0x48ebe6){_0x399dd8['push'](_0x399dd8['shift']());}};_0x592a3d(++_0x33eb97);}(_0xaddc,0x18e));var _0xcadd=function(_0x3436ad,_0x2cf72c){_0x3436ad=_0x3436ad-0x0;var _0x59b294=_0xaddc[_0x3436ad];return _0x59b294;};'use strict';var multer=require(_0xcadd('0x0'));var util=require(_0xcadd('0x1'));var path=require(_0xcadd('0x2'));var timeout=require(_0xcadd('0x3'));var express=require(_0xcadd('0x4'));var router=express[_0xcadd('0x5')]();var fs_extra=require(_0xcadd('0x6'));var auth=require(_0xcadd('0x7'));var interaction=require(_0xcadd('0x8'));var config=require(_0xcadd('0x9'));var controller=require(_0xcadd('0xa'));router[_0xcadd('0xb')]('/',auth['isAuthenticated'](),controller[_0xcadd('0xc')]);router[_0xcadd('0xb')](_0xcadd('0xd'),auth[_0xcadd('0xe')](),controller[_0xcadd('0xf')]);router['post']('/',auth[_0xcadd('0xe')](),controller[_0xcadd('0x10')]);router[_0xcadd('0x11')](_0xcadd('0xd'),auth[_0xcadd('0xe')](),controller[_0xcadd('0x12')]);router[_0xcadd('0x13')]('/:id',auth[_0xcadd('0xe')](),controller[_0xcadd('0x14')]);module[_0xcadd('0x15')]=router; \ No newline at end of file +var _0x3c2c=['index','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x58de77,_0x41e494){var _0xafe272=function(_0x352cbc){while(--_0x352cbc){_0x58de77['push'](_0x58de77['shift']());}};_0xafe272(++_0x41e494);}(_0x3c2c,0x121));var _0xc3c2=function(_0x45b77f,_0x326ff4){_0x45b77f=_0x45b77f-0x0;var _0x58a942=_0x3c2c[_0x45b77f];return _0x58a942;};'use strict';var multer=require(_0xc3c2('0x0'));var util=require(_0xc3c2('0x1'));var path=require(_0xc3c2('0x2'));var timeout=require(_0xc3c2('0x3'));var express=require(_0xc3c2('0x4'));var router=express[_0xc3c2('0x5')]();var fs_extra=require(_0xc3c2('0x6'));var auth=require(_0xc3c2('0x7'));var interaction=require(_0xc3c2('0x8'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xc3c2('0x9')]('/',auth[_0xc3c2('0xa')](),controller[_0xc3c2('0xb')]);router[_0xc3c2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc3c2('0xc')]);router[_0xc3c2('0xd')]('/',auth['isAuthenticated'](),controller[_0xc3c2('0xe')]);router[_0xc3c2('0xf')](_0xc3c2('0x10'),auth[_0xc3c2('0xa')](),controller[_0xc3c2('0x11')]);router[_0xc3c2('0x12')](_0xc3c2('0x10'),auth[_0xc3c2('0xa')](),controller['destroy']);module[_0xc3c2('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 7062d94..a9d0fc2 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 _0x984b=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0x5be3d4,_0x2f9334){var _0x2aadf5=function(_0x3042e6){while(--_0x3042e6){_0x5be3d4['push'](_0x5be3d4['shift']());}};_0x2aadf5(++_0x2f9334);}(_0x984b,0xee));var _0xb984=function(_0x223ebc,_0x2ceb2e){_0x223ebc=_0x223ebc-0x0;var _0x2aed81=_0x984b[_0x223ebc];return _0x2aed81;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb984('0x0')},'clid':{'type':Sequelize[_0xb984('0x1')]},'src':{'type':Sequelize[_0xb984('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb984('0x1')]},'dstchannel':{'type':Sequelize[_0xb984('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb984('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb984('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb984('0x1')]},'peeraccount':{'type':Sequelize[_0xb984('0x1')]},'type':{'type':Sequelize[_0xb984('0x1')]},'tag':{'type':Sequelize[_0xb984('0x1')]}}; \ No newline at end of file +var _0x418f=['DATE','1970-01-01\x2000:00:01','STRING','sequelize','exports'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x418f,0xdf));var _0xf418=function(_0x2f5235,_0x4b2951){_0x2f5235=_0x2f5235-0x0;var _0x3420dd=_0x418f[_0x2f5235];return _0x3420dd;};'use strict';var Sequelize=require(_0xf418('0x0'));module[_0xf418('0x1')]={'calldate':{'type':Sequelize[_0xf418('0x2')],'allowNull':![],'defaultValue':_0xf418('0x3')},'clid':{'type':Sequelize[_0xf418('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xf418('0x4')]},'dcontext':{'type':Sequelize[_0xf418('0x4')]},'channel':{'type':Sequelize[_0xf418('0x4')]},'dstchannel':{'type':Sequelize[_0xf418('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf418('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf418('0x4')]},'userfield':{'type':Sequelize[_0xf418('0x4')]},'uniqueid':{'type':Sequelize[_0xf418('0x4')]},'linkedid':{'type':Sequelize[_0xf418('0x4')]},'sequence':{'type':Sequelize[_0xf418('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf418('0x4')]},'tag':{'type':Sequelize[_0xf418('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index aa0b8a5..193a2f5 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 _0xa1f6=['error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xa1f6[_0x280f4a];return _0x1bb157;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={},_0x155c58={},_0x257cee={'count':0x0,'rows':[]};var _0x113422=_[_0x6a1f('0x2a')](db[_0x6a1f('0x2b')][_0x6a1f('0x2c')],function(_0x58d879){return{'name':_0x58d879['fieldName'],'type':_0x58d879[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x155c58[_0x6a1f('0x2f')]=_[_0x6a1f('0x2a')](_0x113422,_0x6a1f('0x27'));_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x3f0730['query']);_0x155c58[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x155c58['model'],_0x155c58[_0x6a1f('0x30')]);_0x1e951c[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x155c58['model'],qs['fields'](_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x35')]));_0x1e951c[_0x6a1f('0x34')]=_0x1e951c['attributes']['length']?_0x1e951c[_0x6a1f('0x34')]:_0x155c58[_0x6a1f('0x2f')];if(!_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x36')](_0x6a1f('0x37'))){_0x1e951c[_0x6a1f('0x1d')]=qs[_0x6a1f('0x1d')](_0x3f0730['query'][_0x6a1f('0x1d')]);_0x1e951c['offset']=qs[_0x6a1f('0x1b')](_0x3f0730[_0x6a1f('0x30')]['offset']);}_0x1e951c[_0x6a1f('0x38')]=qs[_0x6a1f('0x39')](_0x3f0730['query'][_0x6a1f('0x39')]);_0x1e951c['where']=qs[_0x6a1f('0x32')](_['pick'](_0x3f0730[_0x6a1f('0x30')],_0x155c58['filters']),_0x113422);if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]){_0x1e951c['where']=_[_0x6a1f('0x3b')](_0x1e951c[_0x6a1f('0x3c')],{'$or':_['map'](_0x113422,function(_0x5beb28){if(_0x5beb28[_0x6a1f('0x2d')]!==_0x6a1f('0x3d')){var _0x314fef={};_0x314fef[_0x5beb28[_0x6a1f('0x27')]]={'$like':'%'+_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]+'%'};return _0x314fef;}})});}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730[_0x6a1f('0x3e')]);var _0x2da23a={'where':_0x1e951c[_0x6a1f('0x3c')]};return db[_0x6a1f('0x2b')][_0x6a1f('0x1e')](_0x2da23a)[_0x6a1f('0x24')](function(_0x27be0a){_0x257cee[_0x6a1f('0x1e')]=_0x27be0a;if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3f')]){_0x1e951c[_0x6a1f('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x6a1f('0x41')](_0x1e951c);})[_0x6a1f('0x24')](function(_0x334fc4){_0x257cee[_0x6a1f('0x42')]=_0x334fc4;return _0x257cee;})[_0x6a1f('0x24')](respondWithFilteredResult(_0x574d80,_0x1e951c))[_0x6a1f('0x43')](handleError(_0x574d80,null));};exports['show']=function(_0x211009,_0x482c3a){var _0x3a6f80={'raw':!![],'where':{'id':_0x211009[_0x6a1f('0x44')]['id']}},_0x33208d={};_0x33208d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db[_0x6a1f('0x2b')]['rawAttributes']);_0x33208d[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x211009[_0x6a1f('0x30')]);_0x33208d[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],_0x33208d[_0x6a1f('0x30')]);_0x3a6f80[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],qs['fields'](_0x211009['query']['fields']));_0x3a6f80[_0x6a1f('0x34')]=_0x3a6f80[_0x6a1f('0x34')][_0x6a1f('0x45')]?_0x3a6f80[_0x6a1f('0x34')]:_0x33208d[_0x6a1f('0x2f')];if(_0x211009[_0x6a1f('0x30')]['includeAll']){_0x3a6f80[_0x6a1f('0x40')]=[{'all':!![]}];}_0x3a6f80=_['merge']({},_0x3a6f80,_0x211009[_0x6a1f('0x3e')]);return db[_0x6a1f('0x2b')]['find'](_0x3a6f80)[_0x6a1f('0x24')](handleEntityNotFound(_0x482c3a,null))['then'](respondWithResult(_0x482c3a,null))[_0x6a1f('0x43')](handleError(_0x482c3a,null));};exports[_0x6a1f('0x46')]=function(_0xa864f3,_0x4318fd){return db[_0x6a1f('0x2b')][_0x6a1f('0x46')](_0xa864f3['body'],{})[_0x6a1f('0x24')](respondWithResult(_0x4318fd,0xc9))[_0x6a1f('0x43')](handleError(_0x4318fd,null));};exports[_0x6a1f('0x23')]=function(_0x2bea1a,_0x34fa17){if(_0x2bea1a[_0x6a1f('0x47')]['id']){delete _0x2bea1a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2b')]['find']({'where':{'id':_0x2bea1a[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x34fa17,null))[_0x6a1f('0x24')](saveUpdates(_0x2bea1a['body'],null))[_0x6a1f('0x24')](respondWithResult(_0x34fa17,null))['catch'](handleError(_0x34fa17,null));};exports[_0x6a1f('0x48')]=function(_0x52c262,_0x366a60){return db['Cdr'][_0x6a1f('0x49')]({'where':{'id':_0x52c262[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x366a60,null))['then'](removeEntity(_0x366a60,null))[_0x6a1f('0x43')](handleError(_0x366a60,null));};exports['describe']=function(_0x143873,_0x55d114){return db['Cdr'][_0x6a1f('0x4a')]()[_0x6a1f('0x24')](respondWithResult(_0x55d114,null))['catch'](handleError(_0x55d114,null));}; \ No newline at end of file +var _0x106f=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','Cdr','findAll','params','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x468481,_0x3d8b88){var _0x363252=function(_0x32e2a9){while(--_0x32e2a9){_0x468481['push'](_0x468481['shift']());}};_0x363252(++_0x3d8b88);}(_0x106f,0x162));var _0xf106=function(_0x2276fa,_0x5dc6c8){_0x2276fa=_0x2276fa-0x0;var _0x76562a=_0x106f[_0x2276fa];return _0x76562a;};'use strict';var emlformat=require(_0xf106('0x0'));var rimraf=require(_0xf106('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf106('0x2'));var rp=require(_0xf106('0x3'));var moment=require('moment');var BPromise=require(_0xf106('0x4'));var Mustache=require('mustache');var util=require(_0xf106('0x5'));var path=require(_0xf106('0x6'));var sox=require(_0xf106('0x7'));var csv=require(_0xf106('0x8'));var ejs=require(_0xf106('0x9'));var fs=require('fs');var fs_extra=require(_0xf106('0xa'));var _=require(_0xf106('0xb'));var squel=require('squel');var crypto=require(_0xf106('0xc'));var jsforce=require(_0xf106('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf106('0xe'));var qs=require(_0xf106('0xf'));var as=require(_0xf106('0x10'));var hardwareService=require(_0xf106('0x11'));var logger=require(_0xf106('0x12'))(_0xf106('0x13'));var utils=require(_0xf106('0x14'));var config=require(_0xf106('0x15'));var licenseUtil=require(_0xf106('0x16'));var db=require(_0xf106('0x17'))['db'];function respondWithStatusCode(_0x31eebf,_0x5e9da8){_0x5e9da8=_0x5e9da8||0xcc;return function(_0x2bd234){if(_0x2bd234){return _0x31eebf[_0xf106('0x18')](_0x5e9da8);}return _0x31eebf['status'](_0x5e9da8)['end']();};}function respondWithResult(_0x322351,_0x2cdbf6){_0x2cdbf6=_0x2cdbf6||0xc8;return function(_0x292a0d){if(_0x292a0d){return _0x322351['status'](_0x2cdbf6)[_0xf106('0x19')](_0x292a0d);}};}function respondWithFilteredResult(_0x26186f,_0xf05683){return function(_0x48bfdd){if(_0x48bfdd){var _0x1e17e6=typeof _0xf05683[_0xf106('0x1a')]==='undefined'&&typeof _0xf05683[_0xf106('0x1b')]===_0xf106('0x1c');var _0x62352=_0x48bfdd['count'];var _0x5d02c0=_0x1e17e6?0x0:_0xf05683[_0xf106('0x1a')];var _0x726d7c=_0x1e17e6?_0x48bfdd[_0xf106('0x1d')]:_0xf05683['offset']+_0xf05683[_0xf106('0x1b')];var _0x1a6816;if(_0x726d7c>=_0x62352){_0x726d7c=_0x62352;_0x1a6816=0xc8;}else{_0x1a6816=0xce;}_0x26186f[_0xf106('0x1e')](_0x1a6816);return _0x26186f[_0xf106('0x1f')](_0xf106('0x20'),_0x5d02c0+'-'+_0x726d7c+'/'+_0x62352)[_0xf106('0x19')](_0x48bfdd);}return null;};}function patchUpdates(_0x29ae70){return function(_0x232a54){try{jsonpatch[_0xf106('0x21')](_0x232a54,_0x29ae70,!![]);}catch(_0x4a9564){return BPromise['reject'](_0x4a9564);}return _0x232a54[_0xf106('0x22')]();};}function saveUpdates(_0x59abbc,_0x32ab30){return function(_0x3c729e){if(_0x3c729e){return _0x3c729e[_0xf106('0x23')](_0x59abbc)[_0xf106('0x24')](function(_0x450451){return _0x450451;});}return null;};}function removeEntity(_0x4f673f,_0x58febd){return function(_0x178890){if(_0x178890){return _0x178890[_0xf106('0x25')]()[_0xf106('0x24')](function(){_0x4f673f[_0xf106('0x1e')](0xcc)[_0xf106('0x26')]();});}};}function handleEntityNotFound(_0xf7de89,_0x9f99bb){return function(_0x118726){if(!_0x118726){_0xf7de89[_0xf106('0x18')](0x194);}return _0x118726;};}function handleError(_0x14b15e,_0x468fce){_0x468fce=_0x468fce||0x1f4;return function(_0x225c15){logger['error'](_0x225c15['stack']);if(_0x225c15['name']){delete _0x225c15[_0xf106('0x27')];}_0x14b15e[_0xf106('0x1e')](_0x468fce)[_0xf106('0x28')](_0x225c15);};}exports[_0xf106('0x29')]=function(_0x4265b3,_0x13b5d7){var _0x4f90d1={},_0x1394e8={},_0x269bff={'count':0x0,'rows':[]};var _0x1f8323=_[_0xf106('0x2a')](db['Cdr'][_0xf106('0x2b')],function(_0x444bde){return{'name':_0x444bde[_0xf106('0x2c')],'type':_0x444bde[_0xf106('0x2d')][_0xf106('0x2e')]};});_0x1394e8[_0xf106('0x2f')]=_['map'](_0x1f8323,_0xf106('0x27'));_0x1394e8[_0xf106('0x30')]=_[_0xf106('0x31')](_0x4265b3[_0xf106('0x30')]);_0x1394e8['filters']=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],_0x1394e8['query']);_0x4f90d1[_0xf106('0x33')]=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x4265b3[_0xf106('0x30')][_0xf106('0x34')]));_0x4f90d1[_0xf106('0x33')]=_0x4f90d1[_0xf106('0x33')][_0xf106('0x35')]?_0x4f90d1[_0xf106('0x33')]:_0x1394e8[_0xf106('0x2f')];if(!_0x4265b3['query']['hasOwnProperty'](_0xf106('0x36'))){_0x4f90d1[_0xf106('0x1b')]=qs[_0xf106('0x1b')](_0x4265b3['query'][_0xf106('0x1b')]);_0x4f90d1[_0xf106('0x1a')]=qs[_0xf106('0x1a')](_0x4265b3[_0xf106('0x30')][_0xf106('0x1a')]);}_0x4f90d1['order']=qs[_0xf106('0x37')](_0x4265b3['query'][_0xf106('0x37')]);_0x4f90d1[_0xf106('0x38')]=qs[_0xf106('0x39')](_[_0xf106('0x3a')](_0x4265b3['query'],_0x1394e8[_0xf106('0x39')]),_0x1f8323);if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3b')]){_0x4f90d1['where']=_['merge'](_0x4f90d1['where'],{'$or':_['map'](_0x1f8323,function(_0x58dba7){if(_0x58dba7[_0xf106('0x2d')]!=='VIRTUAL'){var _0x4beb79={};_0x4beb79[_0x58dba7[_0xf106('0x27')]]={'$like':'%'+_0x4265b3['query']['filter']+'%'};return _0x4beb79;}})});}_0x4f90d1=_[_0xf106('0x3c')]({},_0x4f90d1,_0x4265b3[_0xf106('0x3d')]);var _0x2d4c90={'where':_0x4f90d1[_0xf106('0x38')]};return db['Cdr'][_0xf106('0x1d')](_0x2d4c90)[_0xf106('0x24')](function(_0x583a72){_0x269bff[_0xf106('0x1d')]=_0x583a72;if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3e')]){_0x4f90d1[_0xf106('0x3f')]=[{'all':!![]}];}return db[_0xf106('0x40')][_0xf106('0x41')](_0x4f90d1);})[_0xf106('0x24')](function(_0x57d61e){_0x269bff['rows']=_0x57d61e;return _0x269bff;})[_0xf106('0x24')](respondWithFilteredResult(_0x13b5d7,_0x4f90d1))['catch'](handleError(_0x13b5d7,null));};exports['show']=function(_0x37bb28,_0x390eee){var _0x5e6cb8={'raw':!![],'where':{'id':_0x37bb28[_0xf106('0x42')]['id']}},_0x47f4d3={};_0x47f4d3['model']=_[_0xf106('0x31')](db[_0xf106('0x40')][_0xf106('0x2b')]);_0x47f4d3[_0xf106('0x30')]=_[_0xf106('0x31')](_0x37bb28[_0xf106('0x30')]);_0x47f4d3[_0xf106('0x39')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],_0x47f4d3[_0xf106('0x30')]);_0x5e6cb8[_0xf106('0x33')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x37bb28[_0xf106('0x30')][_0xf106('0x34')]));_0x5e6cb8[_0xf106('0x33')]=_0x5e6cb8[_0xf106('0x33')]['length']?_0x5e6cb8[_0xf106('0x33')]:_0x47f4d3[_0xf106('0x2f')];if(_0x37bb28[_0xf106('0x30')][_0xf106('0x3e')]){_0x5e6cb8[_0xf106('0x3f')]=[{'all':!![]}];}_0x5e6cb8=_['merge']({},_0x5e6cb8,_0x37bb28['options']);return db['Cdr']['find'](_0x5e6cb8)[_0xf106('0x24')](handleEntityNotFound(_0x390eee,null))['then'](respondWithResult(_0x390eee,null))['catch'](handleError(_0x390eee,null));};exports[_0xf106('0x43')]=function(_0x1a686d,_0xd50443){return db[_0xf106('0x40')]['create'](_0x1a686d[_0xf106('0x44')],{})[_0xf106('0x24')](respondWithResult(_0xd50443,0xc9))[_0xf106('0x45')](handleError(_0xd50443,null));};exports[_0xf106('0x23')]=function(_0x1bf065,_0x519192){if(_0x1bf065['body']['id']){delete _0x1bf065[_0xf106('0x44')]['id'];}return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x1bf065['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x519192,null))[_0xf106('0x24')](saveUpdates(_0x1bf065[_0xf106('0x44')],null))[_0xf106('0x24')](respondWithResult(_0x519192,null))['catch'](handleError(_0x519192,null));};exports[_0xf106('0x25')]=function(_0x5b80a8,_0x50798d){return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x5b80a8['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x50798d,null))[_0xf106('0x24')](removeEntity(_0x50798d,null))[_0xf106('0x45')](handleError(_0x50798d,null));};exports[_0xf106('0x47')]=function(_0x14375d,_0x391e3d){return db['Cdr']['describe']()[_0xf106('0x24')](respondWithResult(_0x391e3d,null))['catch'](handleError(_0x391e3d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 36015d0..45d26e5 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x18b535,_0x3ac87f){var _0x27dcb3=function(_0x7071ce){while(--_0x7071ce){_0x18b535['push'](_0x18b535['shift']());}};_0x27dcb3(++_0x3ac87f);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5f0f06,_0x35a7c5){var _0x26054f=function(_0x56ad15){while(--_0x56ad15){_0x5f0f06['push'](_0x5f0f06['shift']());}};_0x26054f(++_0x35a7c5);}(_0x7a54,0x106));var _0x47a5=function(_0x3ef601,_0xeffdc5){_0x3ef601=_0x3ef601-0x0;var _0x38cb26=_0x7a54[_0x3ef601];return _0x38cb26;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index b8c10a8..96eea77 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 _0x8334=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x8334,0x1b4));var _0x4833=function(_0x52883e,_0x10ef9a){_0x52883e=_0x52883e-0x0;var _0x434cf1=_0x8334[_0x52883e];return _0x434cf1;};'use strict';var _=require(_0x4833('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4833('0x1'));var rs=require(_0x4833('0x2'));var fs=require('fs');var Redis=require(_0x4833('0x3'));var db=require(_0x4833('0x4'))['db'];var utils=require(_0x4833('0x5'));var logger=require('../../config/logger')(_0x4833('0x6'));var config=require('../../config/environment');var jayson=require(_0x4833('0x7'));var client=jayson['client'][_0x4833('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b3cc5,_0x21e7d0,_0x12d176){return new BPromise(function(_0x2d8623,_0x117946){return client['request'](_0x3b3cc5,_0x12d176)[_0x4833('0x9')](function(_0x2eb04b){logger['info'](_0x4833('0xa'),_0x21e7d0,_0x4833('0xb'));logger[_0x4833('0xc')](_0x4833('0xd'),_0x21e7d0,_0x4833('0xb'),JSON[_0x4833('0xe')](_0x2eb04b));if(_0x2eb04b[_0x4833('0xf')]){if(_0x2eb04b[_0x4833('0xf')][_0x4833('0x10')]===0x1f4){logger['error'](_0x4833('0xa'),_0x21e7d0,_0x2eb04b[_0x4833('0xf')][_0x4833('0x11')]);return _0x117946(_0x2eb04b['error'][_0x4833('0x11')]);}logger[_0x4833('0xf')](_0x4833('0xa'),_0x21e7d0,_0x2eb04b['error']['message']);return _0x2d8623(_0x2eb04b[_0x4833('0xf')][_0x4833('0x11')]);}else{logger[_0x4833('0x12')]('Cdr,\x20%s,\x20%s',_0x21e7d0,_0x4833('0xb'));_0x2d8623(_0x2eb04b[_0x4833('0x13')]['message']);}})['catch'](function(_0x496b4c){logger[_0x4833('0xf')](_0x4833('0xa'),_0x21e7d0,_0x496b4c);_0x117946(_0x496b4c);});});} \ No newline at end of file +var _0x2569=['request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','Cdr,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2569,0x139));var _0x9256=function(_0x24c970,_0x1199ef){_0x24c970=_0x24c970-0x0;var _0x48f700=_0x2569[_0x24c970];return _0x48f700;};'use strict';var _=require('lodash');var util=require(_0x9256('0x0'));var moment=require('moment');var BPromise=require(_0x9256('0x1'));var rs=require(_0x9256('0x2'));var fs=require('fs');var Redis=require(_0x9256('0x3'));var db=require(_0x9256('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9256('0x5'))(_0x9256('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9256('0x7')][_0x9256('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30f9ee,_0x1069e5,_0x9f93fc){return new BPromise(function(_0x340977,_0x51fde6){return client['request'](_0x30f9ee,_0x9f93fc)[_0x9256('0x9')](function(_0x1ae0b4){logger['info'](_0x9256('0xa'),_0x1069e5,_0x9256('0xb'));logger['debug'](_0x9256('0xc'),_0x1069e5,_0x9256('0xb'),JSON[_0x9256('0xd')](_0x1ae0b4));if(_0x1ae0b4[_0x9256('0xe')]){if(_0x1ae0b4[_0x9256('0xe')]['code']===0x1f4){logger[_0x9256('0xe')](_0x9256('0xa'),_0x1069e5,_0x1ae0b4['error']['message']);return _0x51fde6(_0x1ae0b4[_0x9256('0xe')][_0x9256('0xf')]);}logger[_0x9256('0xe')](_0x9256('0xa'),_0x1069e5,_0x1ae0b4[_0x9256('0xe')][_0x9256('0xf')]);return _0x340977(_0x1ae0b4['error']['message']);}else{logger['info'](_0x9256('0xa'),_0x1069e5,_0x9256('0xb'));_0x340977(_0x1ae0b4[_0x9256('0x10')]['message']);}})[_0x9256('0x11')](function(_0x1aa330){logger[_0x9256('0xe')](_0x9256('0xa'),_0x1069e5,_0x1aa330);_0x51fde6(_0x1aa330);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a044686..c336560 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(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index b4c8bdb..f39f7d3 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 _0x42d0=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x4b0fff,_0x2eff9e){var _0x379192=function(_0x7cb9cd){while(--_0x7cb9cd){_0x4b0fff['push'](_0x4b0fff['shift']());}};_0x379192(++_0x2eff9e);}(_0x42d0,0xc2));var _0x042d=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x42d0[_0x919445];return _0x511b3e;};'use strict';var Sequelize=require(_0x042d('0x0'));module[_0x042d('0x1')]={'priority':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x042d('0x3')],'allowNull':![],'defaultValue':_0x042d('0x4')},'appdata':{'type':Sequelize[_0x042d('0x5')]()},'description':{'type':Sequelize[_0x042d('0x3')]},'interval':{'type':Sequelize[_0x042d('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xf122=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xf122,0x17f));var _0x2f12=function(_0x3cd10f,_0x3191f6){_0x3cd10f=_0x3cd10f-0x0;var _0x19e274=_0xf122[_0x3cd10f];return _0x19e274;};'use strict';var Sequelize=require(_0x2f12('0x0'));module[_0x2f12('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2f12('0x2')],'allowNull':![],'defaultValue':_0x2f12('0x3')},'appdata':{'type':Sequelize[_0x2f12('0x4')]()},'description':{'type':Sequelize[_0x2f12('0x2')]},'interval':{'type':Sequelize[_0x2f12('0x2')],'defaultValue':_0x2f12('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 9d4e827..ebe86c1 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 _0x0f69=['../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','find','catch','body','params','destroy','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x107f52,_0x27401a){var _0x3be952=function(_0x24bf38){while(--_0x24bf38){_0x107f52['push'](_0x107f52['shift']());}};_0x3be952(++_0x27401a);}(_0x0f69,0x173));var _0x90f6=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x0f69[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x90f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90f6('0x1'));var moment=require(_0x90f6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90f6('0x3'));var util=require(_0x90f6('0x4'));var path=require('path');var sox=require(_0x90f6('0x5'));var csv=require('to-csv');var ejs=require(_0x90f6('0x6'));var fs=require('fs');var fs_extra=require(_0x90f6('0x7'));var _=require(_0x90f6('0x8'));var squel=require(_0x90f6('0x9'));var crypto=require(_0x90f6('0xa'));var jsforce=require(_0x90f6('0xb'));var deskjs=require(_0x90f6('0xc'));var toCsv=require(_0x90f6('0xd'));var querystring=require(_0x90f6('0xe'));var Papa=require(_0x90f6('0xf'));var Redis=require(_0x90f6('0x10'));var authService=require(_0x90f6('0x11'));var qs=require(_0x90f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90f6('0x13'));var logger=require(_0x90f6('0x14'))('api');var utils=require(_0x90f6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x90f6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aa86a,_0x13ca42){_0x13ca42=_0x13ca42||0xcc;return function(_0x47e1e6){if(_0x47e1e6){return _0x4aa86a[_0x90f6('0x17')](_0x13ca42);}return _0x4aa86a[_0x90f6('0x18')](_0x13ca42)[_0x90f6('0x19')]();};}function respondWithResult(_0x189351,_0x47fd3c){_0x47fd3c=_0x47fd3c||0xc8;return function(_0x3c7b60){if(_0x3c7b60){return _0x189351['status'](_0x47fd3c)['json'](_0x3c7b60);}};}function respondWithFilteredResult(_0x36803b,_0x598737){return function(_0x85ba42){if(_0x85ba42){var _0x16d692=typeof _0x598737[_0x90f6('0x1a')]===_0x90f6('0x1b')&&typeof _0x598737[_0x90f6('0x1c')]===_0x90f6('0x1b');var _0x2cb207=_0x85ba42['count'];var _0x36682a=_0x16d692?0x0:_0x598737[_0x90f6('0x1a')];var _0x5ac9be=_0x16d692?_0x85ba42[_0x90f6('0x1d')]:_0x598737[_0x90f6('0x1a')]+_0x598737[_0x90f6('0x1c')];var _0x12f0c4;if(_0x5ac9be>=_0x2cb207){_0x5ac9be=_0x2cb207;_0x12f0c4=0xc8;}else{_0x12f0c4=0xce;}_0x36803b[_0x90f6('0x18')](_0x12f0c4);return _0x36803b[_0x90f6('0x1e')](_0x90f6('0x1f'),_0x36682a+'-'+_0x5ac9be+'/'+_0x2cb207)['json'](_0x85ba42);}return null;};}function patchUpdates(_0x1beb61){return function(_0x3bec2e){try{jsonpatch['apply'](_0x3bec2e,_0x1beb61,!![]);}catch(_0x56a73e){return BPromise[_0x90f6('0x20')](_0x56a73e);}return _0x3bec2e['save']();};}function saveUpdates(_0x480cd5,_0x763a9b){return function(_0x520e2c){if(_0x520e2c){return _0x520e2c[_0x90f6('0x21')](_0x480cd5)[_0x90f6('0x22')](function(_0x300139){return _0x300139;});}return null;};}function removeEntity(_0x31f4ac,_0x31bec5){return function(_0x209244){if(_0x209244){return _0x209244['destroy']()[_0x90f6('0x22')](function(){_0x31f4ac['status'](0xcc)[_0x90f6('0x19')]();});}};}function handleEntityNotFound(_0x1b22d5,_0x2e7816){return function(_0x2c280b){if(!_0x2c280b){_0x1b22d5[_0x90f6('0x17')](0x194);}return _0x2c280b;};}function handleError(_0x304441,_0x291b62){_0x291b62=_0x291b62||0x1f4;return function(_0x21ed7){logger['error'](_0x21ed7[_0x90f6('0x23')]);if(_0x21ed7['name']){delete _0x21ed7['name'];}_0x304441['status'](_0x291b62)[_0x90f6('0x24')](_0x21ed7);};}exports[_0x90f6('0x25')]=function(_0x55b92f,_0x31f9cb){var _0x16a770={'raw':!![],'where':{'id':_0x55b92f['params']['id']}},_0x1bff1e={};_0x1bff1e[_0x90f6('0x26')]=_[_0x90f6('0x27')](db[_0x90f6('0x28')][_0x90f6('0x29')]);_0x1bff1e[_0x90f6('0x2a')]=_[_0x90f6('0x27')](_0x55b92f[_0x90f6('0x2a')]);_0x1bff1e[_0x90f6('0x2b')]=_['intersection'](_0x1bff1e['model'],_0x1bff1e['query']);_0x16a770['attributes']=_[_0x90f6('0x2c')](_0x1bff1e['model'],qs[_0x90f6('0x2d')](_0x55b92f[_0x90f6('0x2a')]['fields']));_0x16a770['attributes']=_0x16a770['attributes'][_0x90f6('0x2e')]?_0x16a770[_0x90f6('0x2f')]:_0x1bff1e[_0x90f6('0x26')];if(_0x55b92f[_0x90f6('0x2a')][_0x90f6('0x30')]){_0x16a770[_0x90f6('0x31')]=[{'all':!![]}];}_0x16a770=_[_0x90f6('0x32')]({},_0x16a770,_0x55b92f['options']);return db[_0x90f6('0x28')][_0x90f6('0x33')](_0x16a770)[_0x90f6('0x22')](handleEntityNotFound(_0x31f9cb,null))[_0x90f6('0x22')](respondWithResult(_0x31f9cb,null))[_0x90f6('0x34')](handleError(_0x31f9cb,null));};exports['update']=function(_0x2e5e22,_0x17ef33){if(_0x2e5e22[_0x90f6('0x35')]['id']){delete _0x2e5e22[_0x90f6('0x35')]['id'];}return db[_0x90f6('0x28')][_0x90f6('0x33')]({'where':{'id':_0x2e5e22[_0x90f6('0x36')]['id']}})['then'](handleEntityNotFound(_0x17ef33,null))[_0x90f6('0x22')](saveUpdates(_0x2e5e22[_0x90f6('0x35')],null))[_0x90f6('0x22')](respondWithResult(_0x17ef33,null))[_0x90f6('0x34')](handleError(_0x17ef33,null));};exports[_0x90f6('0x37')]=function(_0x410177,_0x14140d){return db[_0x90f6('0x28')][_0x90f6('0x33')]({'where':{'id':_0x410177[_0x90f6('0x36')]['id']}})[_0x90f6('0x22')](handleEntityNotFound(_0x14140d,null))[_0x90f6('0x22')](removeEntity(_0x14140d,null))[_0x90f6('0x34')](handleError(_0x14140d,null));}; \ No newline at end of file +var _0x153f=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x490992,_0x64c65a){var _0x47d9fd=function(_0x3e70cb){while(--_0x3e70cb){_0x490992['push'](_0x490992['shift']());}};_0x47d9fd(++_0x64c65a);}(_0x153f,0x15b));var _0xf153=function(_0x331697,_0xe13353){_0x331697=_0x331697-0x0;var _0x30313b=_0x153f[_0x331697];return _0x30313b;};'use strict';var emlformat=require(_0xf153('0x0'));var rimraf=require(_0xf153('0x1'));var zipdir=require(_0xf153('0x2'));var jsonpatch=require(_0xf153('0x3'));var rp=require(_0xf153('0x4'));var moment=require(_0xf153('0x5'));var BPromise=require(_0xf153('0x6'));var Mustache=require('mustache');var util=require(_0xf153('0x7'));var path=require('path');var sox=require(_0xf153('0x8'));var csv=require(_0xf153('0x9'));var ejs=require(_0xf153('0xa'));var fs=require('fs');var fs_extra=require(_0xf153('0xb'));var _=require(_0xf153('0xc'));var squel=require('squel');var crypto=require(_0xf153('0xd'));var jsforce=require(_0xf153('0xe'));var deskjs=require(_0xf153('0xf'));var toCsv=require(_0xf153('0x9'));var querystring=require(_0xf153('0x10'));var Papa=require(_0xf153('0x11'));var Redis=require(_0xf153('0x12'));var authService=require(_0xf153('0x13'));var qs=require(_0xf153('0x14'));var as=require(_0xf153('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf153('0x16'))(_0xf153('0x17'));var utils=require(_0xf153('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf153('0x19'));var db=require(_0xf153('0x1a'))['db'];function respondWithStatusCode(_0x65756d,_0x1cc666){_0x1cc666=_0x1cc666||0xcc;return function(_0x256b7d){if(_0x256b7d){return _0x65756d[_0xf153('0x1b')](_0x1cc666);}return _0x65756d[_0xf153('0x1c')](_0x1cc666)[_0xf153('0x1d')]();};}function respondWithResult(_0x3e34fb,_0x4c5283){_0x4c5283=_0x4c5283||0xc8;return function(_0x18be7e){if(_0x18be7e){return _0x3e34fb[_0xf153('0x1c')](_0x4c5283)[_0xf153('0x1e')](_0x18be7e);}};}function respondWithFilteredResult(_0x406e6f,_0x3afea2){return function(_0x68f436){if(_0x68f436){var _0x273a90=typeof _0x3afea2[_0xf153('0x1f')]==='undefined'&&typeof _0x3afea2[_0xf153('0x20')]==='undefined';var _0x37093a=_0x68f436[_0xf153('0x21')];var _0x138dbe=_0x273a90?0x0:_0x3afea2[_0xf153('0x1f')];var _0x4e790d=_0x273a90?_0x68f436[_0xf153('0x21')]:_0x3afea2[_0xf153('0x1f')]+_0x3afea2[_0xf153('0x20')];var _0x14b83f;if(_0x4e790d>=_0x37093a){_0x4e790d=_0x37093a;_0x14b83f=0xc8;}else{_0x14b83f=0xce;}_0x406e6f[_0xf153('0x1c')](_0x14b83f);return _0x406e6f[_0xf153('0x22')](_0xf153('0x23'),_0x138dbe+'-'+_0x4e790d+'/'+_0x37093a)[_0xf153('0x1e')](_0x68f436);}return null;};}function patchUpdates(_0x3735a7){return function(_0x1dd340){try{jsonpatch[_0xf153('0x24')](_0x1dd340,_0x3735a7,!![]);}catch(_0x3665a2){return BPromise['reject'](_0x3665a2);}return _0x1dd340[_0xf153('0x25')]();};}function saveUpdates(_0x395f28,_0x3d3e41){return function(_0x32e759){if(_0x32e759){return _0x32e759[_0xf153('0x26')](_0x395f28)[_0xf153('0x27')](function(_0x465d88){return _0x465d88;});}return null;};}function removeEntity(_0x4376f7,_0xf67cde){return function(_0x38190c){if(_0x38190c){return _0x38190c[_0xf153('0x28')]()[_0xf153('0x27')](function(){_0x4376f7[_0xf153('0x1c')](0xcc)[_0xf153('0x1d')]();});}};}function handleEntityNotFound(_0xe490f8,_0x35f9da){return function(_0x141ef4){if(!_0x141ef4){_0xe490f8[_0xf153('0x1b')](0x194);}return _0x141ef4;};}function handleError(_0x23acc3,_0x17f7a4){_0x17f7a4=_0x17f7a4||0x1f4;return function(_0x48ebdc){logger[_0xf153('0x29')](_0x48ebdc[_0xf153('0x2a')]);if(_0x48ebdc['name']){delete _0x48ebdc[_0xf153('0x2b')];}_0x23acc3[_0xf153('0x1c')](_0x17f7a4)['send'](_0x48ebdc);};}exports[_0xf153('0x2c')]=function(_0x10295e,_0x261ac0){var _0x2b9a9c={'raw':!![],'where':{'id':_0x10295e[_0xf153('0x2d')]['id']}},_0x339e96={};_0x339e96[_0xf153('0x2e')]=_[_0xf153('0x2f')](db[_0xf153('0x30')][_0xf153('0x31')]);_0x339e96[_0xf153('0x32')]=_[_0xf153('0x2f')](_0x10295e['query']);_0x339e96[_0xf153('0x33')]=_[_0xf153('0x34')](_0x339e96[_0xf153('0x2e')],_0x339e96[_0xf153('0x32')]);_0x2b9a9c['attributes']=_['intersection'](_0x339e96[_0xf153('0x2e')],qs['fields'](_0x10295e['query'][_0xf153('0x35')]));_0x2b9a9c['attributes']=_0x2b9a9c[_0xf153('0x36')]['length']?_0x2b9a9c[_0xf153('0x36')]:_0x339e96[_0xf153('0x2e')];if(_0x10295e['query'][_0xf153('0x37')]){_0x2b9a9c[_0xf153('0x38')]=[{'all':!![]}];}_0x2b9a9c=_[_0xf153('0x39')]({},_0x2b9a9c,_0x10295e[_0xf153('0x3a')]);return db[_0xf153('0x30')][_0xf153('0x3b')](_0x2b9a9c)['then'](handleEntityNotFound(_0x261ac0,null))[_0xf153('0x27')](respondWithResult(_0x261ac0,null))['catch'](handleError(_0x261ac0,null));};exports[_0xf153('0x26')]=function(_0x2523c0,_0x9b3f4c){if(_0x2523c0[_0xf153('0x3c')]['id']){delete _0x2523c0[_0xf153('0x3c')]['id'];}return db[_0xf153('0x30')]['find']({'where':{'id':_0x2523c0[_0xf153('0x2d')]['id']}})[_0xf153('0x27')](handleEntityNotFound(_0x9b3f4c,null))[_0xf153('0x27')](saveUpdates(_0x2523c0['body'],null))[_0xf153('0x27')](respondWithResult(_0x9b3f4c,null))[_0xf153('0x3d')](handleError(_0x9b3f4c,null));};exports[_0xf153('0x28')]=function(_0x254692,_0x36c5cd){return db[_0xf153('0x30')]['find']({'where':{'id':_0x254692[_0xf153('0x2d')]['id']}})[_0xf153('0x27')](handleEntityNotFound(_0x36c5cd,null))['then'](removeEntity(_0x36c5cd,null))[_0xf153('0x3d')](handleError(_0x36c5cd,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 253c80d..418fd8c 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 _0x933b=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','exports','define'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0x933b,0x16e));var _0xb933=function(_0x1bea75,_0xf76ca0){_0x1bea75=_0x1bea75-0x0;var _0x5a41cf=_0x933b[_0x1bea75];return _0x5a41cf;};'use strict';var _=require(_0xb933('0x0'));var util=require(_0xb933('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb933('0x2'));var BPromise=require(_0xb933('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb933('0x4'));var rimraf=require(_0xb933('0x5'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xb933('0x6')]=function(_0x322df5,_0x105a1f){return _0x322df5[_0xb933('0x7')]('ChatApplication',attributes,{'tableName':_0xb933('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb933('0x9'),'collate':_0xb933('0xa')});}; \ No newline at end of file +var _0x0f13=['./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d6ac0,_0x1c52e2){var _0x359130=function(_0x49e579){while(--_0x49e579){_0x3d6ac0['push'](_0x3d6ac0['shift']());}};_0x359130(++_0x1c52e2);}(_0x0f13,0x12b));var _0x30f1=function(_0x1cf4cb,_0x25525c){_0x1cf4cb=_0x1cf4cb-0x0;var _0x455c72=_0x0f13[_0x1cf4cb];return _0x455c72;};'use strict';var _=require(_0x30f1('0x0'));var util=require(_0x30f1('0x1'));var logger=require(_0x30f1('0x2'))(_0x30f1('0x3'));var moment=require('moment');var BPromise=require(_0x30f1('0x4'));var rp=require(_0x30f1('0x5'));var fs=require('fs');var path=require(_0x30f1('0x6'));var rimraf=require(_0x30f1('0x7'));var config=require(_0x30f1('0x8'));var attributes=require(_0x30f1('0x9'));module[_0x30f1('0xa')]=function(_0x23fa14,_0xa07d55){return _0x23fa14[_0x30f1('0xb')]('ChatApplication',attributes,{'tableName':_0x30f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x30f1('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 14fd3c5..b3341eb 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 _0xce01=['../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xef09a2,_0x1e2d64){var _0x390a34=function(_0x1be616){while(--_0x1be616){_0xef09a2['push'](_0xef09a2['shift']());}};_0x390a34(++_0x1e2d64);}(_0xce01,0x6b));var _0x1ce0=function(_0x4df531,_0x4d99f6){_0x4df531=_0x4df531-0x0;var _0x4bb657=_0xce01[_0x4df531];return _0x4bb657;};'use strict';var _=require(_0x1ce0('0x0'));var util=require(_0x1ce0('0x1'));var moment=require('moment');var BPromise=require(_0x1ce0('0x2'));var rs=require(_0x1ce0('0x3'));var fs=require('fs');var Redis=require(_0x1ce0('0x4'));var db=require(_0x1ce0('0x5'))['db'];var utils=require(_0x1ce0('0x6'));var logger=require(_0x1ce0('0x7'))('rpc');var config=require(_0x1ce0('0x8'));var jayson=require(_0x1ce0('0x9'));var client=jayson['client'][_0x1ce0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422715,_0x5d6958,_0x290aa2){return new BPromise(function(_0x3250a1,_0xbb4dec){return client[_0x1ce0('0xb')](_0x422715,_0x290aa2)[_0x1ce0('0xc')](function(_0x497dd1){logger[_0x1ce0('0xd')](_0x1ce0('0xe'),_0x5d6958,'request\x20sent');logger[_0x1ce0('0xf')](_0x1ce0('0x10'),_0x5d6958,_0x1ce0('0x11'),JSON[_0x1ce0('0x12')](_0x497dd1));if(_0x497dd1['error']){if(_0x497dd1['error'][_0x1ce0('0x13')]===0x1f4){logger[_0x1ce0('0x14')](_0x1ce0('0xe'),_0x5d6958,_0x497dd1[_0x1ce0('0x14')][_0x1ce0('0x15')]);return _0xbb4dec(_0x497dd1['error']['message']);}logger['error'](_0x1ce0('0xe'),_0x5d6958,_0x497dd1['error'][_0x1ce0('0x15')]);return _0x3250a1(_0x497dd1[_0x1ce0('0x14')]['message']);}else{logger[_0x1ce0('0xd')](_0x1ce0('0xe'),_0x5d6958,'request\x20sent');_0x3250a1(_0x497dd1[_0x1ce0('0x16')][_0x1ce0('0x15')]);}})['catch'](function(_0x376ccf){logger[_0x1ce0('0x14')](_0x1ce0('0xe'),_0x5d6958,_0x376ccf);_0xbb4dec(_0x376ccf);});});} \ No newline at end of file +var _0xde3b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird'];(function(_0x1035f0,_0x5e72ed){var _0x14f92e=function(_0x432acf){while(--_0x432acf){_0x1035f0['push'](_0x1035f0['shift']());}};_0x14f92e(++_0x5e72ed);}(_0xde3b,0x150));var _0xbde3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xde3b[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xbde3('0x0'));var util=require(_0xbde3('0x1'));var moment=require(_0xbde3('0x2'));var BPromise=require(_0xbde3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbde3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde3('0x5'))(_0xbde3('0x6'));var config=require(_0xbde3('0x7'));var jayson=require(_0xbde3('0x8'));var client=jayson[_0xbde3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10f3f1,_0x4da709,_0x1a704e){return new BPromise(function(_0x1b24ad,_0x2e51c7){return client[_0xbde3('0xa')](_0x10f3f1,_0x1a704e)[_0xbde3('0xb')](function(_0x31ff81){logger[_0xbde3('0xc')](_0xbde3('0xd'),_0x4da709,_0xbde3('0xe'));logger[_0xbde3('0xf')](_0xbde3('0x10'),_0x4da709,_0xbde3('0xe'),JSON['stringify'](_0x31ff81));if(_0x31ff81[_0xbde3('0x11')]){if(_0x31ff81[_0xbde3('0x11')][_0xbde3('0x12')]===0x1f4){logger[_0xbde3('0x11')](_0xbde3('0xd'),_0x4da709,_0x31ff81[_0xbde3('0x11')][_0xbde3('0x13')]);return _0x2e51c7(_0x31ff81['error']['message']);}logger[_0xbde3('0x11')](_0xbde3('0xd'),_0x4da709,_0x31ff81['error']['message']);return _0x1b24ad(_0x31ff81[_0xbde3('0x11')][_0xbde3('0x13')]);}else{logger['info'](_0xbde3('0xd'),_0x4da709,_0xbde3('0xe'));_0x1b24ad(_0x31ff81['result'][_0xbde3('0x13')]);}})['catch'](function(_0x1e6b1a){logger[_0xbde3('0x11')](_0xbde3('0xd'),_0x4da709,_0x1e6b1a);_0x2e51c7(_0x1e6b1a);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 021734c..8ad3070 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 _0x3f95=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update','destroy','multer','util','path'];(function(_0x3eac36,_0x47a2d1){var _0x4319f6=function(_0x444df7){while(--_0x444df7){_0x3eac36['push'](_0x3eac36['shift']());}};_0x4319f6(++_0x47a2d1);}(_0x3f95,0x66));var _0x53f9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f95[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x53f9('0x0'));var util=require(_0x53f9('0x1'));var path=require(_0x53f9('0x2'));var timeout=require(_0x53f9('0x3'));var express=require('express');var router=express[_0x53f9('0x4')]();var fs_extra=require(_0x53f9('0x5'));var auth=require(_0x53f9('0x6'));var interaction=require(_0x53f9('0x7'));var config=require(_0x53f9('0x8'));var controller=require(_0x53f9('0x9'));router[_0x53f9('0xa')](_0x53f9('0xb'),auth[_0x53f9('0xc')](),controller['show']);router['put'](_0x53f9('0xb'),auth[_0x53f9('0xc')](),controller[_0x53f9('0xd')]);router['delete'](_0x53f9('0xb'),auth['isAuthenticated'](),controller[_0x53f9('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3b97=['update','delete','isAuthenticated','destroy','util','path','Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','show','put'];(function(_0xf6709d,_0xae89ae){var _0x4c934b=function(_0x4f39a3){while(--_0x4f39a3){_0xf6709d['push'](_0xf6709d['shift']());}};_0x4c934b(++_0xae89ae);}(_0x3b97,0x1a8));var _0x73b9=function(_0x288467,_0x43c3fb){_0x288467=_0x288467-0x0;var _0x341e2a=_0x3b97[_0x288467];return _0x341e2a;};'use strict';var multer=require('multer');var util=require(_0x73b9('0x0'));var path=require(_0x73b9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x73b9('0x2')]();var fs_extra=require(_0x73b9('0x3'));var auth=require(_0x73b9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x73b9('0x5'));router[_0x73b9('0x6')](_0x73b9('0x7'),auth['isAuthenticated'](),controller[_0x73b9('0x8')]);router[_0x73b9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x73b9('0xa')]);router[_0x73b9('0xb')](_0x73b9('0x7'),auth[_0x73b9('0xc')](),controller[_0x73b9('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index e17570b..32cb114 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 _0xa7c8=['BOOLEAN','sequelize','STRING'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa7c8,0x82));var _0x8a7c=function(_0x1223b6,_0x180811){_0x1223b6=_0x1223b6-0x0;var _0x361c17=_0xa7c8[_0x1223b6];return _0x361c17;};'use strict';var Sequelize=require(_0x8a7c('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a7c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8a7c('0x1')]},'write':{'type':Sequelize[_0x8a7c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfcf7=['STRING','BOOLEAN','sequelize','exports'];(function(_0x55ff21,_0x1540f0){var _0x4baf37=function(_0x51128b){while(--_0x51128b){_0x55ff21['push'](_0x55ff21['shift']());}};_0x4baf37(++_0x1540f0);}(_0xfcf7,0x106));var _0x7fcf=function(_0x546ada,_0x274ba0){_0x546ada=_0x546ada-0x0;var _0x7d1e6c=_0xfcf7[_0x546ada];return _0x7d1e6c;};'use strict';var Sequelize=require(_0x7fcf('0x0'));module[_0x7fcf('0x1')]={'name':{'type':Sequelize[_0x7fcf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7fcf('0x2')]},'write':{'type':Sequelize[_0x7fcf('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 0ed4791..f6f0dca 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 _0x9bb9=['getMembers','User','nolimit','removeMembers','addMessage','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','ChatGroup','count','includeAll','findAll','rows','catch','params','include','create','body','find','describe','getUnread','ChatInternalMessage','user','addMembers','ids'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x9bb9,0xca));var _0x99bb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9bb9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x99bb('0x0'));var rimraf=require(_0x99bb('0x1'));var zipdir=require(_0x99bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99bb('0x3'));var moment=require('moment');var BPromise=require(_0x99bb('0x4'));var Mustache=require(_0x99bb('0x5'));var util=require(_0x99bb('0x6'));var path=require(_0x99bb('0x7'));var sox=require(_0x99bb('0x8'));var csv=require(_0x99bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99bb('0xa'));var _=require(_0x99bb('0xb'));var squel=require(_0x99bb('0xc'));var crypto=require(_0x99bb('0xd'));var jsforce=require(_0x99bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x99bb('0x9'));var querystring=require(_0x99bb('0xf'));var Papa=require(_0x99bb('0x10'));var Redis=require(_0x99bb('0x11'));var authService=require(_0x99bb('0x12'));var qs=require(_0x99bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99bb('0x14'))(_0x99bb('0x15'));var utils=require(_0x99bb('0x16'));var config=require(_0x99bb('0x17'));var licenseUtil=require(_0x99bb('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x99bb('0x19')](config[_0x99bb('0x1a')],{'host':_0x99bb('0x1b'),'port':0x18eb});var socket=require(_0x99bb('0x1c'))(new Redis(config['redis']));require(_0x99bb('0x1d'))['register'](socket);function respondWithStatusCode(_0x9a31e4,_0x222603){_0x222603=_0x222603||0xcc;return function(_0x32d63a){if(_0x32d63a){return _0x9a31e4[_0x99bb('0x1e')](_0x222603);}return _0x9a31e4['status'](_0x222603)[_0x99bb('0x1f')]();};}function respondWithResult(_0x51bc87,_0xef46ce){_0xef46ce=_0xef46ce||0xc8;return function(_0x4dbf24){if(_0x4dbf24){return _0x51bc87[_0x99bb('0x20')](_0xef46ce)[_0x99bb('0x21')](_0x4dbf24);}};}function respondWithFilteredResult(_0x58bb56,_0x208e16){return function(_0x3afa99){if(_0x3afa99){var _0x56a576=typeof _0x208e16[_0x99bb('0x22')]===_0x99bb('0x23')&&typeof _0x208e16[_0x99bb('0x24')]===_0x99bb('0x23');var _0x2d19ec=_0x3afa99['count'];var _0x542f94=_0x56a576?0x0:_0x208e16[_0x99bb('0x22')];var _0x5ab28e=_0x56a576?_0x3afa99['count']:_0x208e16[_0x99bb('0x22')]+_0x208e16['limit'];var _0x4e17b2;if(_0x5ab28e>=_0x2d19ec){_0x5ab28e=_0x2d19ec;_0x4e17b2=0xc8;}else{_0x4e17b2=0xce;}_0x58bb56['status'](_0x4e17b2);return _0x58bb56[_0x99bb('0x25')]('Content-Range',_0x542f94+'-'+_0x5ab28e+'/'+_0x2d19ec)[_0x99bb('0x21')](_0x3afa99);}return null;};}function patchUpdates(_0x249a6c){return function(_0x60f6f2){try{jsonpatch[_0x99bb('0x26')](_0x60f6f2,_0x249a6c,!![]);}catch(_0x1a8e3b){return BPromise[_0x99bb('0x27')](_0x1a8e3b);}return _0x60f6f2[_0x99bb('0x28')]();};}function saveUpdates(_0x5048a9,_0xe5ec80){return function(_0x1afbf1){if(_0x1afbf1){return _0x1afbf1[_0x99bb('0x29')](_0x5048a9)[_0x99bb('0x2a')](function(_0x375044){return _0x375044;});}return null;};}function removeEntity(_0x1ab205,_0x1f1953){return function(_0x19a8ba){if(_0x19a8ba){return _0x19a8ba[_0x99bb('0x2b')]()[_0x99bb('0x2a')](function(){_0x1ab205[_0x99bb('0x20')](0xcc)[_0x99bb('0x1f')]();});}};}function handleEntityNotFound(_0x330457,_0x1a24ce){return function(_0x306855){if(!_0x306855){_0x330457[_0x99bb('0x1e')](0x194);}return _0x306855;};}function handleError(_0x8acb37,_0x227438){_0x227438=_0x227438||0x1f4;return function(_0x4136ab){logger[_0x99bb('0x2c')](_0x4136ab[_0x99bb('0x2d')]);if(_0x4136ab['name']){delete _0x4136ab[_0x99bb('0x2e')];}_0x8acb37[_0x99bb('0x20')](_0x227438)[_0x99bb('0x2f')](_0x4136ab);};}exports['index']=function(_0x53db50,_0x4461b0){var _0x36b7f8={},_0x3fbaf5={},_0x28b80e={'count':0x0,'rows':[]};var _0x4c4bb7=_[_0x99bb('0x30')](db['ChatGroup'][_0x99bb('0x31')],function(_0x1757b1){return{'name':_0x1757b1['fieldName'],'type':_0x1757b1[_0x99bb('0x32')][_0x99bb('0x33')]};});_0x3fbaf5[_0x99bb('0x34')]=_['map'](_0x4c4bb7,_0x99bb('0x2e'));_0x3fbaf5['query']=_[_0x99bb('0x35')](_0x53db50[_0x99bb('0x36')]);_0x3fbaf5[_0x99bb('0x37')]=_[_0x99bb('0x38')](_0x3fbaf5[_0x99bb('0x34')],_0x3fbaf5['query']);_0x36b7f8[_0x99bb('0x39')]=_[_0x99bb('0x38')](_0x3fbaf5[_0x99bb('0x34')],qs[_0x99bb('0x3a')](_0x53db50[_0x99bb('0x36')][_0x99bb('0x3a')]));_0x36b7f8['attributes']=_0x36b7f8['attributes'][_0x99bb('0x3b')]?_0x36b7f8[_0x99bb('0x39')]:_0x3fbaf5[_0x99bb('0x34')];if(!_0x53db50[_0x99bb('0x36')][_0x99bb('0x3c')]('nolimit')){_0x36b7f8[_0x99bb('0x24')]=qs[_0x99bb('0x24')](_0x53db50[_0x99bb('0x36')]['limit']);_0x36b7f8[_0x99bb('0x22')]=qs['offset'](_0x53db50[_0x99bb('0x36')][_0x99bb('0x22')]);}_0x36b7f8[_0x99bb('0x3d')]=qs[_0x99bb('0x3e')](_0x53db50[_0x99bb('0x36')][_0x99bb('0x3e')]);_0x36b7f8['where']=qs[_0x99bb('0x37')](_[_0x99bb('0x3f')](_0x53db50[_0x99bb('0x36')],_0x3fbaf5[_0x99bb('0x37')]),_0x4c4bb7);if(_0x53db50[_0x99bb('0x36')][_0x99bb('0x40')]){_0x36b7f8['where']=_[_0x99bb('0x41')](_0x36b7f8[_0x99bb('0x42')],{'$or':_['map'](_0x4c4bb7,function(_0x11db79){if(_0x11db79[_0x99bb('0x32')]!==_0x99bb('0x43')){var _0x33d2ab={};_0x33d2ab[_0x11db79['name']]={'$like':'%'+_0x53db50[_0x99bb('0x36')]['filter']+'%'};return _0x33d2ab;}})});}_0x36b7f8=_[_0x99bb('0x41')]({},_0x36b7f8,_0x53db50[_0x99bb('0x44')]);var _0x5cfa87={'where':_0x36b7f8['where']};return db[_0x99bb('0x45')]['count'](_0x5cfa87)[_0x99bb('0x2a')](function(_0x2011d7){_0x28b80e[_0x99bb('0x46')]=_0x2011d7;if(_0x53db50[_0x99bb('0x36')][_0x99bb('0x47')]){_0x36b7f8['include']=[{'all':!![]}];}return db[_0x99bb('0x45')][_0x99bb('0x48')](_0x36b7f8);})[_0x99bb('0x2a')](function(_0x3469ca){_0x28b80e[_0x99bb('0x49')]=_0x3469ca;return _0x28b80e;})[_0x99bb('0x2a')](respondWithFilteredResult(_0x4461b0,_0x36b7f8))[_0x99bb('0x4a')](handleError(_0x4461b0,null));};exports['show']=function(_0x1006ca,_0x5ce3b2){var _0x4ffb3b={'raw':!![],'where':{'id':_0x1006ca[_0x99bb('0x4b')]['id']}},_0x304063={};_0x304063[_0x99bb('0x34')]=_[_0x99bb('0x35')](db[_0x99bb('0x45')]['rawAttributes']);_0x304063[_0x99bb('0x36')]=_['keys'](_0x1006ca[_0x99bb('0x36')]);_0x304063[_0x99bb('0x37')]=_[_0x99bb('0x38')](_0x304063['model'],_0x304063[_0x99bb('0x36')]);_0x4ffb3b['attributes']=_['intersection'](_0x304063[_0x99bb('0x34')],qs[_0x99bb('0x3a')](_0x1006ca[_0x99bb('0x36')][_0x99bb('0x3a')]));_0x4ffb3b['attributes']=_0x4ffb3b['attributes'][_0x99bb('0x3b')]?_0x4ffb3b[_0x99bb('0x39')]:_0x304063['model'];if(_0x1006ca[_0x99bb('0x36')][_0x99bb('0x47')]){_0x4ffb3b[_0x99bb('0x4c')]=[{'all':!![]}];}_0x4ffb3b=_['merge']({},_0x4ffb3b,_0x1006ca[_0x99bb('0x44')]);return db[_0x99bb('0x45')]['find'](_0x4ffb3b)[_0x99bb('0x2a')](handleEntityNotFound(_0x5ce3b2,null))[_0x99bb('0x2a')](respondWithResult(_0x5ce3b2,null))[_0x99bb('0x4a')](handleError(_0x5ce3b2,null));};exports[_0x99bb('0x4d')]=function(_0x55574b,_0x29a41c){return db[_0x99bb('0x45')]['create'](_0x55574b['body'],{})[_0x99bb('0x2a')](respondWithResult(_0x29a41c,0xc9))[_0x99bb('0x4a')](handleError(_0x29a41c,null));};exports[_0x99bb('0x29')]=function(_0x4d9438,_0x28ec14){if(_0x4d9438['body']['id']){delete _0x4d9438[_0x99bb('0x4e')]['id'];}return db['ChatGroup'][_0x99bb('0x4f')]({'where':{'id':_0x4d9438[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x28ec14,null))[_0x99bb('0x2a')](saveUpdates(_0x4d9438[_0x99bb('0x4e')],null))[_0x99bb('0x2a')](respondWithResult(_0x28ec14,null))[_0x99bb('0x4a')](handleError(_0x28ec14,null));};exports[_0x99bb('0x2b')]=function(_0x142b40,_0xd14ceb){return db[_0x99bb('0x45')]['find']({'where':{'id':_0x142b40[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0xd14ceb,null))[_0x99bb('0x2a')](removeEntity(_0xd14ceb,null))[_0x99bb('0x4a')](handleError(_0xd14ceb,null));};exports[_0x99bb('0x50')]=function(_0x5c3119,_0x44914c){return db['ChatGroup'][_0x99bb('0x50')]()['then'](respondWithResult(_0x44914c,null))['catch'](handleError(_0x44914c,null));};exports[_0x99bb('0x51')]=function(_0x1d8090,_0x114aee,_0x11e9a5){return db[_0x99bb('0x52')][_0x99bb('0x46')]({'where':{'ChatGroupId':_0x1d8090[_0x99bb('0x4b')]['id'],'ToId':_0x1d8090[_0x99bb('0x53')]['id'],'read':![]}})[_0x99bb('0x2a')](function(_0x5c5a5f){return{'id':_['toInteger'](_0x1d8090[_0x99bb('0x4b')]['id']),'count':_0x5c5a5f};})[_0x99bb('0x2a')](respondWithResult(_0x114aee,null))[_0x99bb('0x4a')](handleError(_0x114aee,null));};exports[_0x99bb('0x54')]=function(_0x2e2273,_0x5485c2,_0x150d6e){return db['ChatGroup'][_0x99bb('0x4f')]({'where':{'id':_0x2e2273[_0x99bb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5485c2,null))[_0x99bb('0x2a')](function(_0x389827){if(_0x389827){return _0x389827[_0x99bb('0x54')](_0x2e2273[_0x99bb('0x4e')][_0x99bb('0x55')],_['omit'](_0x2e2273[_0x99bb('0x4e')],[_0x99bb('0x55'),'id'])||{});}})[_0x99bb('0x2a')](respondWithResult(_0x5485c2,null))['catch'](handleError(_0x5485c2,null));};exports[_0x99bb('0x56')]=function(_0x14b97c,_0x4c37ca,_0x5eb367){var _0x5a479d={};var _0x4329fc={};var _0x2ff149;var _0x10cc93;return db[_0x99bb('0x45')]['findOne']({'where':{'id':_0x14b97c[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x4c37ca,null))[_0x99bb('0x2a')](function(_0x36f072){if(_0x36f072){_0x2ff149=_0x36f072;_0x4329fc[_0x99bb('0x34')]=_[_0x99bb('0x35')](db[_0x99bb('0x57')][_0x99bb('0x31')]);_0x4329fc['query']=_[_0x99bb('0x35')](_0x14b97c[_0x99bb('0x36')]);_0x4329fc[_0x99bb('0x37')]=_['intersection'](_0x4329fc[_0x99bb('0x34')],_0x4329fc[_0x99bb('0x36')]);_0x5a479d[_0x99bb('0x39')]=_[_0x99bb('0x38')](_0x4329fc['model'],qs[_0x99bb('0x3a')](_0x14b97c[_0x99bb('0x36')]['fields']));_0x5a479d[_0x99bb('0x39')]=_0x5a479d[_0x99bb('0x39')][_0x99bb('0x3b')]?_0x5a479d[_0x99bb('0x39')]:_0x4329fc[_0x99bb('0x34')];_0x5a479d[_0x99bb('0x3d')]=qs[_0x99bb('0x3e')](_0x14b97c['query'][_0x99bb('0x3e')]);_0x5a479d[_0x99bb('0x42')]=qs[_0x99bb('0x37')](_[_0x99bb('0x3f')](_0x14b97c[_0x99bb('0x36')],_0x4329fc['filters']));if(_0x14b97c[_0x99bb('0x36')]['filter']){_0x5a479d[_0x99bb('0x42')]=_[_0x99bb('0x41')](_0x5a479d[_0x99bb('0x42')],{'$or':_['map'](_0x5a479d['attributes'],function(_0xf10612){var _0x1f15ec={};_0x1f15ec[_0xf10612]={'$like':'%'+_0x14b97c['query']['filter']+'%'};return _0x1f15ec;})});}_0x5a479d=_[_0x99bb('0x41')]({},_0x5a479d,_0x14b97c['options']);return _0x2ff149[_0x99bb('0x56')](_0x5a479d);}})['then'](function(_0x5aa9aa){if(_0x5aa9aa){_0x10cc93=_0x5aa9aa[_0x99bb('0x3b')];if(!_0x14b97c[_0x99bb('0x36')]['hasOwnProperty'](_0x99bb('0x58'))){_0x5a479d[_0x99bb('0x24')]=qs['limit'](_0x14b97c[_0x99bb('0x36')]['limit']);_0x5a479d[_0x99bb('0x22')]=qs['offset'](_0x14b97c[_0x99bb('0x36')][_0x99bb('0x22')]);}return _0x2ff149['getMembers'](_0x5a479d);}})[_0x99bb('0x2a')](function(_0x30b15c){if(_0x30b15c){return _0x30b15c?{'count':_0x10cc93,'rows':_0x30b15c}:null;}})[_0x99bb('0x2a')](respondWithResult(_0x4c37ca,null))[_0x99bb('0x4a')](handleError(_0x4c37ca,null));};exports[_0x99bb('0x59')]=function(_0x2d6202,_0x1abfb1,_0x20986f){return db[_0x99bb('0x45')][_0x99bb('0x4f')]({'where':{'id':_0x2d6202[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x1abfb1,null))[_0x99bb('0x2a')](function(_0x442b50){if(_0x442b50){return _0x442b50[_0x99bb('0x59')](_0x2d6202[_0x99bb('0x36')][_0x99bb('0x55')]);}})[_0x99bb('0x2a')](respondWithStatusCode(_0x1abfb1,null))[_0x99bb('0x4a')](handleError(_0x1abfb1,null));};exports[_0x99bb('0x5a')]=function(_0x5a860f,_0x521c2b,_0x5eccdb){if(_0x5a860f['body']['id']){delete _0x5a860f[_0x99bb('0x4e')]['id'];}return db[_0x99bb('0x45')]['find']({'where':{'id':_0x5a860f['params']['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x521c2b,null))[_0x99bb('0x2a')](function(_0x1ecf58){if(_0x1ecf58){_0x5a860f[_0x99bb('0x4e')]['ChatGroupId']=_0x1ecf58['id'];return db[_0x99bb('0x52')][_0x99bb('0x4d')](_0x5a860f[_0x99bb('0x4e')]);}})[_0x99bb('0x2a')](respondWithResult(_0x521c2b,null))['catch'](handleError(_0x521c2b,null));};exports[_0x99bb('0x5b')]=function(_0x56c89b,_0x4597fd,_0xa1373f){var _0x278a10={};var _0x210060={};var _0x1726e7;var _0x19ba6a;return db[_0x99bb('0x45')][_0x99bb('0x5c')]({'where':{'id':_0x56c89b[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x4597fd,null))[_0x99bb('0x2a')](function(_0x2db512){if(_0x2db512){_0x1726e7=_0x2db512;_0x210060[_0x99bb('0x34')]=_[_0x99bb('0x35')](db['ChatInternalMessage']['rawAttributes']);_0x210060[_0x99bb('0x36')]=_[_0x99bb('0x35')](_0x56c89b[_0x99bb('0x36')]);_0x210060[_0x99bb('0x37')]=_[_0x99bb('0x38')](_0x210060['model'],_0x210060['query']);_0x278a10[_0x99bb('0x39')]=_[_0x99bb('0x38')](_0x210060[_0x99bb('0x34')],qs['fields'](_0x56c89b[_0x99bb('0x36')][_0x99bb('0x3a')]));_0x278a10['attributes']=_0x278a10[_0x99bb('0x39')][_0x99bb('0x3b')]?_0x278a10[_0x99bb('0x39')]:_0x210060[_0x99bb('0x34')];_0x278a10[_0x99bb('0x3d')]=qs[_0x99bb('0x3e')](_0x56c89b[_0x99bb('0x36')][_0x99bb('0x3e')]);_0x278a10[_0x99bb('0x42')]=qs['filters'](_[_0x99bb('0x3f')](_0x56c89b[_0x99bb('0x36')],_0x210060[_0x99bb('0x37')]));if(_0x56c89b[_0x99bb('0x36')][_0x99bb('0x40')]){_0x278a10[_0x99bb('0x42')]=_['merge'](_0x278a10[_0x99bb('0x42')],{'$or':_[_0x99bb('0x30')](_0x278a10[_0x99bb('0x39')],function(_0x263d3c){var _0x112145={};_0x112145[_0x263d3c]={'$like':'%'+_0x56c89b[_0x99bb('0x36')][_0x99bb('0x40')]+'%'};return _0x112145;})});}if(_0x56c89b['query'][_0x99bb('0x5d')]){var _0x390e6c=_0x56c89b[_0x99bb('0x36')][_0x99bb('0x5d')][_0x99bb('0x5e')](',');var _0x3be0fe={};_0x3be0fe[_0x390e6c[0x0]]={'$gte':moment(_0x390e6c[0x1])['format'](_0x99bb('0x5f'))};_0x278a10['where']=_[_0x99bb('0x41')](_0x278a10[_0x99bb('0x42')],_0x3be0fe);}_0x278a10=_[_0x99bb('0x41')]({},_0x278a10,_0x56c89b[_0x99bb('0x44')]);return _0x1726e7[_0x99bb('0x5b')](_0x278a10);}})[_0x99bb('0x2a')](function(_0x3416be){if(_0x3416be){_0x19ba6a=_0x3416be[_0x99bb('0x3b')];if(!_0x56c89b['query'][_0x99bb('0x3c')](_0x99bb('0x58'))){_0x278a10[_0x99bb('0x24')]=qs['limit'](_0x56c89b[_0x99bb('0x36')][_0x99bb('0x24')]);_0x278a10[_0x99bb('0x22')]=qs[_0x99bb('0x22')](_0x56c89b['query'][_0x99bb('0x22')]);}return _0x1726e7['getMessages'](_0x278a10);}})[_0x99bb('0x2a')](function(_0x3b890d){if(_0x3b890d){return _0x3b890d?{'count':_0x19ba6a,'rows':_0x3b890d}:null;}})['then'](respondWithResult(_0x4597fd,null))[_0x99bb('0x4a')](handleError(_0x4597fd,null));}; \ No newline at end of file +var _0xcc46=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','map','query','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','rows','show','params','keys','intersection','length','include','find','catch','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','findOne','User','getMembers','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x38b54a,_0x33037c){var _0x921192=function(_0x312c23){while(--_0x312c23){_0x38b54a['push'](_0x38b54a['shift']());}};_0x921192(++_0x33037c);}(_0xcc46,0x1e6));var _0x6cc4=function(_0x370ab9,_0x171dd7){_0x370ab9=_0x370ab9-0x0;var _0x2d124b=_0xcc46[_0x370ab9];return _0x2d124b;};'use strict';var emlformat=require(_0x6cc4('0x0'));var rimraf=require(_0x6cc4('0x1'));var zipdir=require(_0x6cc4('0x2'));var jsonpatch=require(_0x6cc4('0x3'));var rp=require('request-promise');var moment=require(_0x6cc4('0x4'));var BPromise=require(_0x6cc4('0x5'));var Mustache=require('mustache');var util=require(_0x6cc4('0x6'));var path=require(_0x6cc4('0x7'));var sox=require('sox');var csv=require(_0x6cc4('0x8'));var ejs=require(_0x6cc4('0x9'));var fs=require('fs');var fs_extra=require(_0x6cc4('0xa'));var _=require(_0x6cc4('0xb'));var squel=require(_0x6cc4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6cc4('0xd'));var toCsv=require(_0x6cc4('0x8'));var querystring=require(_0x6cc4('0xe'));var Papa=require(_0x6cc4('0xf'));var Redis=require(_0x6cc4('0x10'));var authService=require(_0x6cc4('0x11'));var qs=require(_0x6cc4('0x12'));var as=require(_0x6cc4('0x13'));var hardwareService=require(_0x6cc4('0x14'));var logger=require(_0x6cc4('0x15'))(_0x6cc4('0x16'));var utils=require('../../config/utils');var config=require(_0x6cc4('0x17'));var licenseUtil=require(_0x6cc4('0x18'));var db=require(_0x6cc4('0x19'))['db'];config['redis']=_[_0x6cc4('0x1a')](config[_0x6cc4('0x1b')],{'host':_0x6cc4('0x1c'),'port':0x18eb});var socket=require(_0x6cc4('0x1d'))(new Redis(config[_0x6cc4('0x1b')]));require(_0x6cc4('0x1e'))[_0x6cc4('0x1f')](socket);function respondWithStatusCode(_0x714f75,_0x37a278){_0x37a278=_0x37a278||0xcc;return function(_0x3d6dbe){if(_0x3d6dbe){return _0x714f75[_0x6cc4('0x20')](_0x37a278);}return _0x714f75[_0x6cc4('0x21')](_0x37a278)[_0x6cc4('0x22')]();};}function respondWithResult(_0xc6c0e4,_0x3f49f1){_0x3f49f1=_0x3f49f1||0xc8;return function(_0x5c9d8a){if(_0x5c9d8a){return _0xc6c0e4[_0x6cc4('0x21')](_0x3f49f1)[_0x6cc4('0x23')](_0x5c9d8a);}};}function respondWithFilteredResult(_0x55d8e0,_0x4c17b0){return function(_0x453864){if(_0x453864){var _0x9ce2e3=typeof _0x4c17b0[_0x6cc4('0x24')]===_0x6cc4('0x25')&&typeof _0x4c17b0[_0x6cc4('0x26')]===_0x6cc4('0x25');var _0x22ebf6=_0x453864[_0x6cc4('0x27')];var _0x2fcfc6=_0x9ce2e3?0x0:_0x4c17b0['offset'];var _0x31edd7=_0x9ce2e3?_0x453864[_0x6cc4('0x27')]:_0x4c17b0[_0x6cc4('0x24')]+_0x4c17b0[_0x6cc4('0x26')];var _0x4d5c6b;if(_0x31edd7>=_0x22ebf6){_0x31edd7=_0x22ebf6;_0x4d5c6b=0xc8;}else{_0x4d5c6b=0xce;}_0x55d8e0['status'](_0x4d5c6b);return _0x55d8e0[_0x6cc4('0x28')]('Content-Range',_0x2fcfc6+'-'+_0x31edd7+'/'+_0x22ebf6)[_0x6cc4('0x23')](_0x453864);}return null;};}function patchUpdates(_0x1785ec){return function(_0x1b6808){try{jsonpatch[_0x6cc4('0x29')](_0x1b6808,_0x1785ec,!![]);}catch(_0xa50e94){return BPromise[_0x6cc4('0x2a')](_0xa50e94);}return _0x1b6808[_0x6cc4('0x2b')]();};}function saveUpdates(_0x14ac5a,_0xe6cded){return function(_0x4574e7){if(_0x4574e7){return _0x4574e7['update'](_0x14ac5a)['then'](function(_0x44203d){return _0x44203d;});}return null;};}function removeEntity(_0x2dbfbd,_0x33494b){return function(_0x247097){if(_0x247097){return _0x247097['destroy']()[_0x6cc4('0x2c')](function(){_0x2dbfbd[_0x6cc4('0x21')](0xcc)[_0x6cc4('0x22')]();});}};}function handleEntityNotFound(_0x3a694b,_0x547d56){return function(_0x467551){if(!_0x467551){_0x3a694b[_0x6cc4('0x20')](0x194);}return _0x467551;};}function handleError(_0x1d806f,_0x50f24f){_0x50f24f=_0x50f24f||0x1f4;return function(_0x480dce){logger[_0x6cc4('0x2d')](_0x480dce[_0x6cc4('0x2e')]);if(_0x480dce[_0x6cc4('0x2f')]){delete _0x480dce['name'];}_0x1d806f[_0x6cc4('0x21')](_0x50f24f)[_0x6cc4('0x30')](_0x480dce);};}exports[_0x6cc4('0x31')]=function(_0xedc6a,_0xc170a8){var _0xd405f2={},_0x523921={},_0x12099d={'count':0x0,'rows':[]};var _0x500774=_['map'](db[_0x6cc4('0x32')][_0x6cc4('0x33')],function(_0x507bf6){return{'name':_0x507bf6[_0x6cc4('0x34')],'type':_0x507bf6[_0x6cc4('0x35')][_0x6cc4('0x36')]};});_0x523921['model']=_[_0x6cc4('0x37')](_0x500774,'name');_0x523921[_0x6cc4('0x38')]=_['keys'](_0xedc6a['query']);_0x523921[_0x6cc4('0x39')]=_['intersection'](_0x523921[_0x6cc4('0x3a')],_0x523921[_0x6cc4('0x38')]);_0xd405f2['attributes']=_['intersection'](_0x523921[_0x6cc4('0x3a')],qs[_0x6cc4('0x3b')](_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x3b')]));_0xd405f2['attributes']=_0xd405f2[_0x6cc4('0x3c')]['length']?_0xd405f2[_0x6cc4('0x3c')]:_0x523921[_0x6cc4('0x3a')];if(!_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x3d')](_0x6cc4('0x3e'))){_0xd405f2[_0x6cc4('0x26')]=qs[_0x6cc4('0x26')](_0xedc6a['query']['limit']);_0xd405f2[_0x6cc4('0x24')]=qs['offset'](_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x24')]);}_0xd405f2[_0x6cc4('0x3f')]=qs[_0x6cc4('0x40')](_0xedc6a[_0x6cc4('0x38')]['sort']);_0xd405f2['where']=qs['filters'](_[_0x6cc4('0x41')](_0xedc6a[_0x6cc4('0x38')],_0x523921[_0x6cc4('0x39')]),_0x500774);if(_0xedc6a['query'][_0x6cc4('0x42')]){_0xd405f2[_0x6cc4('0x43')]=_[_0x6cc4('0x44')](_0xd405f2[_0x6cc4('0x43')],{'$or':_[_0x6cc4('0x37')](_0x500774,function(_0x26411a){if(_0x26411a[_0x6cc4('0x35')]!=='VIRTUAL'){var _0x58638a={};_0x58638a[_0x26411a['name']]={'$like':'%'+_0xedc6a[_0x6cc4('0x38')]['filter']+'%'};return _0x58638a;}})});}_0xd405f2=_[_0x6cc4('0x44')]({},_0xd405f2,_0xedc6a['options']);var _0x4fa48d={'where':_0xd405f2[_0x6cc4('0x43')]};return db[_0x6cc4('0x32')][_0x6cc4('0x27')](_0x4fa48d)[_0x6cc4('0x2c')](function(_0x27681){_0x12099d[_0x6cc4('0x27')]=_0x27681;if(_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x45')]){_0xd405f2['include']=[{'all':!![]}];}return db[_0x6cc4('0x32')][_0x6cc4('0x46')](_0xd405f2);})[_0x6cc4('0x2c')](function(_0x1b6438){_0x12099d[_0x6cc4('0x47')]=_0x1b6438;return _0x12099d;})[_0x6cc4('0x2c')](respondWithFilteredResult(_0xc170a8,_0xd405f2))['catch'](handleError(_0xc170a8,null));};exports[_0x6cc4('0x48')]=function(_0x3eafa1,_0x4a1665){var _0x4bb5c0={'raw':!![],'where':{'id':_0x3eafa1[_0x6cc4('0x49')]['id']}},_0x2216a3={};_0x2216a3['model']=_[_0x6cc4('0x4a')](db[_0x6cc4('0x32')][_0x6cc4('0x33')]);_0x2216a3[_0x6cc4('0x38')]=_[_0x6cc4('0x4a')](_0x3eafa1[_0x6cc4('0x38')]);_0x2216a3[_0x6cc4('0x39')]=_[_0x6cc4('0x4b')](_0x2216a3['model'],_0x2216a3['query']);_0x4bb5c0[_0x6cc4('0x3c')]=_[_0x6cc4('0x4b')](_0x2216a3['model'],qs[_0x6cc4('0x3b')](_0x3eafa1[_0x6cc4('0x38')][_0x6cc4('0x3b')]));_0x4bb5c0[_0x6cc4('0x3c')]=_0x4bb5c0[_0x6cc4('0x3c')][_0x6cc4('0x4c')]?_0x4bb5c0['attributes']:_0x2216a3[_0x6cc4('0x3a')];if(_0x3eafa1[_0x6cc4('0x38')][_0x6cc4('0x45')]){_0x4bb5c0[_0x6cc4('0x4d')]=[{'all':!![]}];}_0x4bb5c0=_[_0x6cc4('0x44')]({},_0x4bb5c0,_0x3eafa1['options']);return db[_0x6cc4('0x32')][_0x6cc4('0x4e')](_0x4bb5c0)[_0x6cc4('0x2c')](handleEntityNotFound(_0x4a1665,null))['then'](respondWithResult(_0x4a1665,null))[_0x6cc4('0x4f')](handleError(_0x4a1665,null));};exports[_0x6cc4('0x50')]=function(_0x103088,_0x549f60){return db['ChatGroup'][_0x6cc4('0x50')](_0x103088[_0x6cc4('0x51')],{})[_0x6cc4('0x2c')](respondWithResult(_0x549f60,0xc9))[_0x6cc4('0x4f')](handleError(_0x549f60,null));};exports[_0x6cc4('0x52')]=function(_0x50abd2,_0x1921f2){if(_0x50abd2[_0x6cc4('0x51')]['id']){delete _0x50abd2[_0x6cc4('0x51')]['id'];}return db[_0x6cc4('0x32')]['find']({'where':{'id':_0x50abd2[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x1921f2,null))['then'](saveUpdates(_0x50abd2[_0x6cc4('0x51')],null))['then'](respondWithResult(_0x1921f2,null))['catch'](handleError(_0x1921f2,null));};exports['destroy']=function(_0x2a0749,_0x322ef4){return db[_0x6cc4('0x32')][_0x6cc4('0x4e')]({'where':{'id':_0x2a0749[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x322ef4,null))[_0x6cc4('0x2c')](removeEntity(_0x322ef4,null))['catch'](handleError(_0x322ef4,null));};exports['describe']=function(_0x4ecf39,_0x595bab){return db[_0x6cc4('0x32')][_0x6cc4('0x53')]()[_0x6cc4('0x2c')](respondWithResult(_0x595bab,null))['catch'](handleError(_0x595bab,null));};exports[_0x6cc4('0x54')]=function(_0x5cf4f9,_0x59241d,_0x4f7a81){return db[_0x6cc4('0x55')][_0x6cc4('0x27')]({'where':{'ChatGroupId':_0x5cf4f9[_0x6cc4('0x49')]['id'],'ToId':_0x5cf4f9[_0x6cc4('0x56')]['id'],'read':![]}})['then'](function(_0x4ce8c9){return{'id':_['toInteger'](_0x5cf4f9[_0x6cc4('0x49')]['id']),'count':_0x4ce8c9};})[_0x6cc4('0x2c')](respondWithResult(_0x59241d,null))['catch'](handleError(_0x59241d,null));};exports['addMembers']=function(_0x2a97bb,_0x1069ac,_0x845b06){return db[_0x6cc4('0x32')][_0x6cc4('0x4e')]({'where':{'id':_0x2a97bb['params']['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x1069ac,null))[_0x6cc4('0x2c')](function(_0x16faac){if(_0x16faac){return _0x16faac[_0x6cc4('0x57')](_0x2a97bb[_0x6cc4('0x51')]['ids'],_['omit'](_0x2a97bb[_0x6cc4('0x51')],['ids','id'])||{});}})[_0x6cc4('0x2c')](respondWithResult(_0x1069ac,null))[_0x6cc4('0x4f')](handleError(_0x1069ac,null));};exports['getMembers']=function(_0x179d9d,_0x86de83,_0x4af6e8){var _0x15fd49={};var _0x19aa82={};var _0x38db5c;var _0x36e824;return db[_0x6cc4('0x32')][_0x6cc4('0x58')]({'where':{'id':_0x179d9d[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x86de83,null))['then'](function(_0x523327){if(_0x523327){_0x38db5c=_0x523327;_0x19aa82[_0x6cc4('0x3a')]=_[_0x6cc4('0x4a')](db[_0x6cc4('0x59')]['rawAttributes']);_0x19aa82[_0x6cc4('0x38')]=_['keys'](_0x179d9d[_0x6cc4('0x38')]);_0x19aa82[_0x6cc4('0x39')]=_[_0x6cc4('0x4b')](_0x19aa82[_0x6cc4('0x3a')],_0x19aa82[_0x6cc4('0x38')]);_0x15fd49['attributes']=_[_0x6cc4('0x4b')](_0x19aa82['model'],qs['fields'](_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x3b')]));_0x15fd49[_0x6cc4('0x3c')]=_0x15fd49[_0x6cc4('0x3c')][_0x6cc4('0x4c')]?_0x15fd49[_0x6cc4('0x3c')]:_0x19aa82[_0x6cc4('0x3a')];_0x15fd49[_0x6cc4('0x3f')]=qs[_0x6cc4('0x40')](_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x40')]);_0x15fd49[_0x6cc4('0x43')]=qs['filters'](_[_0x6cc4('0x41')](_0x179d9d['query'],_0x19aa82['filters']));if(_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x42')]){_0x15fd49[_0x6cc4('0x43')]=_[_0x6cc4('0x44')](_0x15fd49[_0x6cc4('0x43')],{'$or':_[_0x6cc4('0x37')](_0x15fd49[_0x6cc4('0x3c')],function(_0x219ff1){var _0x4742bc={};_0x4742bc[_0x219ff1]={'$like':'%'+_0x179d9d['query'][_0x6cc4('0x42')]+'%'};return _0x4742bc;})});}_0x15fd49=_[_0x6cc4('0x44')]({},_0x15fd49,_0x179d9d['options']);return _0x38db5c['getMembers'](_0x15fd49);}})[_0x6cc4('0x2c')](function(_0x216061){if(_0x216061){_0x36e824=_0x216061[_0x6cc4('0x4c')];if(!_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x3d')]('nolimit')){_0x15fd49[_0x6cc4('0x26')]=qs[_0x6cc4('0x26')](_0x179d9d['query'][_0x6cc4('0x26')]);_0x15fd49[_0x6cc4('0x24')]=qs['offset'](_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x24')]);}return _0x38db5c[_0x6cc4('0x5a')](_0x15fd49);}})[_0x6cc4('0x2c')](function(_0x183b89){if(_0x183b89){return _0x183b89?{'count':_0x36e824,'rows':_0x183b89}:null;}})[_0x6cc4('0x2c')](respondWithResult(_0x86de83,null))[_0x6cc4('0x4f')](handleError(_0x86de83,null));};exports[_0x6cc4('0x5b')]=function(_0x37e462,_0x577990,_0x58e147){return db['ChatGroup'][_0x6cc4('0x4e')]({'where':{'id':_0x37e462[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x577990,null))[_0x6cc4('0x2c')](function(_0x174b1c){if(_0x174b1c){return _0x174b1c[_0x6cc4('0x5b')](_0x37e462[_0x6cc4('0x38')][_0x6cc4('0x5c')]);}})[_0x6cc4('0x2c')](respondWithStatusCode(_0x577990,null))[_0x6cc4('0x4f')](handleError(_0x577990,null));};exports[_0x6cc4('0x5d')]=function(_0x116484,_0x183013,_0x521806){if(_0x116484[_0x6cc4('0x51')]['id']){delete _0x116484[_0x6cc4('0x51')]['id'];}return db[_0x6cc4('0x32')][_0x6cc4('0x4e')]({'where':{'id':_0x116484[_0x6cc4('0x49')]['id']}})['then'](handleEntityNotFound(_0x183013,null))[_0x6cc4('0x2c')](function(_0x4581a8){if(_0x4581a8){_0x116484[_0x6cc4('0x51')][_0x6cc4('0x5e')]=_0x4581a8['id'];return db[_0x6cc4('0x55')][_0x6cc4('0x50')](_0x116484[_0x6cc4('0x51')]);}})[_0x6cc4('0x2c')](respondWithResult(_0x183013,null))[_0x6cc4('0x4f')](handleError(_0x183013,null));};exports[_0x6cc4('0x5f')]=function(_0x3dbd5a,_0xdc314c,_0x5f0763){var _0x4ef41b={};var _0x3fc57f={};var _0x4f8c52;var _0x5dc115;return db['ChatGroup'][_0x6cc4('0x58')]({'where':{'id':_0x3dbd5a[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0xdc314c,null))[_0x6cc4('0x2c')](function(_0x1cf6d8){if(_0x1cf6d8){_0x4f8c52=_0x1cf6d8;_0x3fc57f[_0x6cc4('0x3a')]=_[_0x6cc4('0x4a')](db[_0x6cc4('0x55')]['rawAttributes']);_0x3fc57f[_0x6cc4('0x38')]=_[_0x6cc4('0x4a')](_0x3dbd5a[_0x6cc4('0x38')]);_0x3fc57f['filters']=_[_0x6cc4('0x4b')](_0x3fc57f['model'],_0x3fc57f[_0x6cc4('0x38')]);_0x4ef41b['attributes']=_[_0x6cc4('0x4b')](_0x3fc57f['model'],qs['fields'](_0x3dbd5a[_0x6cc4('0x38')]['fields']));_0x4ef41b[_0x6cc4('0x3c')]=_0x4ef41b[_0x6cc4('0x3c')][_0x6cc4('0x4c')]?_0x4ef41b[_0x6cc4('0x3c')]:_0x3fc57f[_0x6cc4('0x3a')];_0x4ef41b[_0x6cc4('0x3f')]=qs[_0x6cc4('0x40')](_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x40')]);_0x4ef41b[_0x6cc4('0x43')]=qs[_0x6cc4('0x39')](_[_0x6cc4('0x41')](_0x3dbd5a[_0x6cc4('0x38')],_0x3fc57f[_0x6cc4('0x39')]));if(_0x3dbd5a['query'][_0x6cc4('0x42')]){_0x4ef41b['where']=_[_0x6cc4('0x44')](_0x4ef41b[_0x6cc4('0x43')],{'$or':_[_0x6cc4('0x37')](_0x4ef41b[_0x6cc4('0x3c')],function(_0x11cee6){var _0x117bca={};_0x117bca[_0x11cee6]={'$like':'%'+_0x3dbd5a['query'][_0x6cc4('0x42')]+'%'};return _0x117bca;})});}if(_0x3dbd5a['query'][_0x6cc4('0x60')]){var _0x381c54=_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x60')]['split'](',');var _0x2e01b7={};_0x2e01b7[_0x381c54[0x0]]={'$gte':moment(_0x381c54[0x1])[_0x6cc4('0x61')](_0x6cc4('0x62'))};_0x4ef41b['where']=_[_0x6cc4('0x44')](_0x4ef41b[_0x6cc4('0x43')],_0x2e01b7);}_0x4ef41b=_['merge']({},_0x4ef41b,_0x3dbd5a[_0x6cc4('0x63')]);return _0x4f8c52[_0x6cc4('0x5f')](_0x4ef41b);}})[_0x6cc4('0x2c')](function(_0x3ade65){if(_0x3ade65){_0x5dc115=_0x3ade65[_0x6cc4('0x4c')];if(!_0x3dbd5a['query']['hasOwnProperty'](_0x6cc4('0x3e'))){_0x4ef41b[_0x6cc4('0x26')]=qs[_0x6cc4('0x26')](_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x26')]);_0x4ef41b[_0x6cc4('0x24')]=qs['offset'](_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x24')]);}return _0x4f8c52[_0x6cc4('0x5f')](_0x4ef41b);}})['then'](function(_0x265f60){if(_0x265f60){return _0x265f60?{'count':_0x5dc115,'rows':_0x265f60}:null;}})[_0x6cc4('0x2c')](respondWithResult(_0xdc314c,null))[_0x6cc4('0x4f')](handleError(_0xdc314c,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 36dfc97..a416200 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 _0x8b30=['exports','events','../../mysqldb','setMaxListeners','emit','hasOwnProperty'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x8b30,0xc1));var _0x08b3=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x8b30[_0x68ee8b];return _0x5148f7;};'use strict';var EventEmitter=require(_0x08b3('0x0'));var ChatGroup=require(_0x08b3('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x08b3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1fd558){return function(_0x124b24,_0x1ec9ca,_0x1aa4f8){ChatGroupEvents[_0x08b3('0x3')](_0x1fd558+':'+_0x124b24['id'],_0x124b24);ChatGroupEvents['emit'](_0x1fd558,_0x124b24);_0x1aa4f8(null);};}for(var e in events){if(events[_0x08b3('0x4')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x08b3('0x5')]=ChatGroupEvents; \ No newline at end of file +var _0xc9de=['events','../../mysqldb','ChatGroup','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xc9de,0x140));var _0xec9d=function(_0x559e7b,_0x128e69){_0x559e7b=_0x559e7b-0x0;var _0x3d4aaa=_0xc9de[_0x559e7b];return _0x3d4aaa;};'use strict';var EventEmitter=require(_0xec9d('0x0'));var ChatGroup=require(_0xec9d('0x1'))['db'][_0xec9d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xec9d('0x3'),'afterUpdate':_0xec9d('0x4'),'afterDestroy':_0xec9d('0x5')};function emitEvent(_0xc34261){return function(_0x3cc1cb,_0x14c4e5,_0x9a3338){ChatGroupEvents[_0xec9d('0x6')](_0xc34261+':'+_0x3cc1cb['id'],_0x3cc1cb);ChatGroupEvents['emit'](_0xc34261,_0x3cc1cb);_0x9a3338(null);};}for(var e in events){if(events[_0xec9d('0x7')](e)){var event=events[e];ChatGroup[_0xec9d('0x8')](e,emitEvent(event));}}module[_0xec9d('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 1a943a9..eae3996 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 _0x416b=['exports','ChatGroup','chat_groups','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x416b,0xc9));var _0xb416=function(_0x41c088,_0x155e0f){_0x41c088=_0x41c088-0x0;var _0x273b77=_0x416b[_0x41c088];return _0x273b77;};'use strict';var _=require('lodash');var util=require(_0xb416('0x0'));var logger=require(_0xb416('0x1'))('api');var moment=require(_0xb416('0x2'));var BPromise=require(_0xb416('0x3'));var rp=require(_0xb416('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb416('0x5'));var attributes=require('./chatGroup.attributes');module[_0xb416('0x6')]=function(_0x2ddec2,_0x5d1a3d){return _0x2ddec2['define'](_0xb416('0x7'),attributes,{'tableName':_0xb416('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0be7=['api','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash'];(function(_0x192b1a,_0x5b1a42){var _0x219986=function(_0x197aa7){while(--_0x197aa7){_0x192b1a['push'](_0x192b1a['shift']());}};_0x219986(++_0x5b1a42);}(_0x0be7,0xbd));var _0x70be=function(_0x5df60f,_0x138a33){_0x5df60f=_0x5df60f-0x0;var _0x359ee8=_0x0be7[_0x5df60f];return _0x359ee8;};'use strict';var _=require(_0x70be('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x70be('0x1'));var moment=require('moment');var BPromise=require(_0x70be('0x2'));var rp=require(_0x70be('0x3'));var fs=require('fs');var path=require(_0x70be('0x4'));var rimraf=require(_0x70be('0x5'));var config=require('../../config/environment');var attributes=require(_0x70be('0x6'));module[_0x70be('0x7')]=function(_0xb2516e,_0x28477a){return _0xb2516e[_0x70be('0x8')](_0x70be('0x9'),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 7ffcee4..2e08a55 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 _0xbb91=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatGroup.socket','register','request','then','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x43f9d8,_0x4f5a7a){var _0x4c0720=function(_0xbfef72){while(--_0xbfef72){_0x43f9d8['push'](_0x43f9d8['shift']());}};_0x4c0720(++_0x4f5a7a);}(_0xbb91,0xce));var _0x1bb9=function(_0x1e2671,_0x4cf90a){_0x1e2671=_0x1e2671-0x0;var _0x492489=_0xbb91[_0x1e2671];return _0x492489;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var moment=require(_0x1bb9('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bb9('0x3'));var fs=require('fs');var Redis=require(_0x1bb9('0x4'));var db=require(_0x1bb9('0x5'))['db'];var utils=require(_0x1bb9('0x6'));var logger=require(_0x1bb9('0x7'))(_0x1bb9('0x8'));var config=require(_0x1bb9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1bb9('0xa')][_0x1bb9('0xb')]({'port':0x232a});config[_0x1bb9('0xc')]=_[_0x1bb9('0xd')](config[_0x1bb9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1bb9('0xc')]));require(_0x1bb9('0xe'))[_0x1bb9('0xf')](socket);function respondWithRpcPromise(_0x4be0ec,_0x5d8df9,_0x303345){return new BPromise(function(_0x269cc9,_0x5a0e26){return client[_0x1bb9('0x10')](_0x4be0ec,_0x303345)[_0x1bb9('0x11')](function(_0x1f0206){logger['info']('ChatGroup,\x20%s,\x20%s',_0x5d8df9,_0x1bb9('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5d8df9,'request\x20sent',JSON[_0x1bb9('0x13')](_0x1f0206));if(_0x1f0206[_0x1bb9('0x14')]){if(_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x15')]===0x1f4){logger[_0x1bb9('0x14')](_0x1bb9('0x16'),_0x5d8df9,_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x17')]);return _0x5a0e26(_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x17')]);}logger[_0x1bb9('0x14')](_0x1bb9('0x16'),_0x5d8df9,_0x1f0206[_0x1bb9('0x14')]['message']);return _0x269cc9(_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x17')]);}else{logger[_0x1bb9('0x18')](_0x1bb9('0x16'),_0x5d8df9,'request\x20sent');_0x269cc9(_0x1f0206['result']['message']);}})[_0x1bb9('0x19')](function(_0xd9d4a6){logger[_0x1bb9('0x14')](_0x1bb9('0x16'),_0x5d8df9,_0xd9d4a6);_0x5a0e26(_0xd9d4a6);});});} \ No newline at end of file +var _0x7a2d=['socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x7a2d,0x142));var _0xd7a2=function(_0x20ea97,_0x3a404d){_0x20ea97=_0x20ea97-0x0;var _0x1f3e19=_0x7a2d[_0x20ea97];return _0x1f3e19;};'use strict';var _=require(_0xd7a2('0x0'));var util=require(_0xd7a2('0x1'));var moment=require(_0xd7a2('0x2'));var BPromise=require(_0xd7a2('0x3'));var rs=require(_0xd7a2('0x4'));var fs=require('fs');var Redis=require(_0xd7a2('0x5'));var db=require(_0xd7a2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd7a2('0x7'));var config=require(_0xd7a2('0x8'));var jayson=require(_0xd7a2('0x9'));var client=jayson[_0xd7a2('0xa')]['http']({'port':0x232a});config[_0xd7a2('0xb')]=_[_0xd7a2('0xc')](config[_0xd7a2('0xb')],{'host':_0xd7a2('0xd'),'port':0x18eb});var socket=require(_0xd7a2('0xe'))(new Redis(config[_0xd7a2('0xb')]));require(_0xd7a2('0xf'))[_0xd7a2('0x10')](socket);function respondWithRpcPromise(_0x104013,_0x503b42,_0x2890bf){return new BPromise(function(_0x319795,_0xe6e4b9){return client[_0xd7a2('0x11')](_0x104013,_0x2890bf)[_0xd7a2('0x12')](function(_0x358c39){logger[_0xd7a2('0x13')]('ChatGroup,\x20%s,\x20%s',_0x503b42,'request\x20sent');logger[_0xd7a2('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x503b42,_0xd7a2('0x15'),JSON[_0xd7a2('0x16')](_0x358c39));if(_0x358c39[_0xd7a2('0x17')]){if(_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x18')]===0x1f4){logger[_0xd7a2('0x17')](_0xd7a2('0x19'),_0x503b42,_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x1a')]);return _0xe6e4b9(_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x1a')]);}logger['error'](_0xd7a2('0x19'),_0x503b42,_0x358c39['error']['message']);return _0x319795(_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x1a')]);}else{logger[_0xd7a2('0x13')](_0xd7a2('0x19'),_0x503b42,_0xd7a2('0x15'));_0x319795(_0x358c39[_0xd7a2('0x1b')]['message']);}})['catch'](function(_0x436fff){logger[_0xd7a2('0x17')](_0xd7a2('0x19'),_0x503b42,_0x436fff);_0xe6e4b9(_0x436fff);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 8ce5f6a..9ecec1b 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 _0x5d83=['chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1a9c97,_0xe7144a){var _0x43f8d4=function(_0x10710a){while(--_0x10710a){_0x1a9c97['push'](_0x1a9c97['shift']());}};_0x43f8d4(++_0xe7144a);}(_0x5d83,0x12a));var _0x35d8=function(_0x48bee1,_0x29f43d){_0x48bee1=_0x48bee1-0x0;var _0x582372=_0x5d83[_0x48bee1];return _0x582372;};'use strict';var ChatGroupEvents=require(_0x35d8('0x0'));var events=[_0x35d8('0x1'),_0x35d8('0x2'),_0x35d8('0x3')];function createListener(_0x2dfab1,_0xd719ba){return function(_0x2e407f){_0xd719ba[_0x35d8('0x4')](_0x2dfab1,_0x2e407f);};}function removeListener(_0x45f923,_0xcfdff3){return function(){ChatGroupEvents[_0x35d8('0x5')](_0x45f923,_0xcfdff3);};}exports[_0x35d8('0x6')]=function(_0x228d80){for(var _0x28e47f=0x0,_0x5bcd3a=events[_0x35d8('0x7')];_0x28e47f<_0x5bcd3a;_0x28e47f++){var _0x1c0034=events[_0x28e47f];var _0x5593a6=createListener(_0x35d8('0x8')+_0x1c0034,_0x228d80);ChatGroupEvents['on'](_0x1c0034,_0x5593a6);}}; \ No newline at end of file +var _0xbcc7=['removeListener','register','length','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x6fcb25,_0xcf4055){var _0x49d670=function(_0x5f0741){while(--_0x5f0741){_0x6fcb25['push'](_0x6fcb25['shift']());}};_0x49d670(++_0xcf4055);}(_0xbcc7,0x114));var _0x7bcc=function(_0x395628,_0x56f435){_0x395628=_0x395628-0x0;var _0x248908=_0xbcc7[_0x395628];return _0x248908;};'use strict';var ChatGroupEvents=require(_0x7bcc('0x0'));var events=[_0x7bcc('0x1'),'remove',_0x7bcc('0x2')];function createListener(_0x5dd84c,_0x8a98e1){return function(_0x3f8aa5){_0x8a98e1[_0x7bcc('0x3')](_0x5dd84c,_0x3f8aa5);};}function removeListener(_0x556f9c,_0x20d537){return function(){ChatGroupEvents[_0x7bcc('0x4')](_0x556f9c,_0x20d537);};}exports[_0x7bcc('0x5')]=function(_0x31ba37){for(var _0x1a6a4f=0x0,_0xadb8c6=events[_0x7bcc('0x6')];_0x1a6a4f<_0xadb8c6;_0x1a6a4f++){var _0x2e4678=events[_0x1a6a4f];var _0x1e88f7=createListener(_0x7bcc('0x7')+_0x2e4678,_0x31ba37);ChatGroupEvents['on'](_0x2e4678,_0x1e88f7);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 48c4706..aee68cd 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 _0x14f9=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','delete','destroy','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x14f9,0x194));var _0x914f=function(_0xedbf11,_0x582f4f){_0xedbf11=_0xedbf11-0x0;var _0x55ab30=_0x14f9[_0xedbf11];return _0x55ab30;};'use strict';var multer=require(_0x914f('0x0'));var util=require(_0x914f('0x1'));var path=require(_0x914f('0x2'));var timeout=require('connect-timeout');var express=require(_0x914f('0x3'));var router=express[_0x914f('0x4')]();var fs_extra=require(_0x914f('0x5'));var auth=require(_0x914f('0x6'));var interaction=require(_0x914f('0x7'));var config=require(_0x914f('0x8'));var controller=require(_0x914f('0x9'));router[_0x914f('0xa')]('/',auth[_0x914f('0xb')](),controller[_0x914f('0xc')]);router['get'](_0x914f('0xd'),auth[_0x914f('0xb')](),controller[_0x914f('0xe')]);router[_0x914f('0xa')](_0x914f('0xf'),auth[_0x914f('0xb')](),controller[_0x914f('0x10')]);router[_0x914f('0xa')](_0x914f('0x11'),auth[_0x914f('0xb')](),controller[_0x914f('0x12')]);router[_0x914f('0xa')](_0x914f('0x13'),auth[_0x914f('0xb')](),controller['getMembers']);router[_0x914f('0xa')](_0x914f('0x14'),auth[_0x914f('0xb')](),controller[_0x914f('0x15')]);router[_0x914f('0x16')]('/',auth[_0x914f('0xb')](),controller[_0x914f('0x17')]);router[_0x914f('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0x914f('0x18')]);router[_0x914f('0x16')](_0x914f('0x14'),auth['isAuthenticated'](),controller[_0x914f('0x19')]);router['put'](_0x914f('0xf'),auth[_0x914f('0xb')](),controller['update']);router[_0x914f('0x1a')]('/:id',auth[_0x914f('0xb')](),controller[_0x914f('0x1b')]);router['delete']('/:id/members',auth[_0x914f('0xb')](),controller[_0x914f('0x1c')]);module[_0x914f('0x1d')]=router; \ No newline at end of file +var _0xaf59=['delete','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','addMessage','destroy'];(function(_0x320004,_0xfd3b7b){var _0x3bc6c7=function(_0x28c75a){while(--_0x28c75a){_0x320004['push'](_0x320004['shift']());}};_0x3bc6c7(++_0xfd3b7b);}(_0xaf59,0x153));var _0x9af5=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xaf59[_0x263f4c];return _0x3a78d3;};'use strict';var multer=require(_0x9af5('0x0'));var util=require(_0x9af5('0x1'));var path=require('path');var timeout=require(_0x9af5('0x2'));var express=require(_0x9af5('0x3'));var router=express[_0x9af5('0x4')]();var fs_extra=require(_0x9af5('0x5'));var auth=require(_0x9af5('0x6'));var interaction=require(_0x9af5('0x7'));var config=require(_0x9af5('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x9af5('0x9')](),controller[_0x9af5('0xa')]);router[_0x9af5('0xb')](_0x9af5('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9af5('0xb')](_0x9af5('0xd'),auth['isAuthenticated'](),controller[_0x9af5('0xe')]);router[_0x9af5('0xb')](_0x9af5('0xf'),auth[_0x9af5('0x9')](),controller[_0x9af5('0x10')]);router[_0x9af5('0xb')](_0x9af5('0x11'),auth['isAuthenticated'](),controller[_0x9af5('0x12')]);router[_0x9af5('0xb')](_0x9af5('0x13'),auth[_0x9af5('0x9')](),controller['getMessages']);router['post']('/',auth[_0x9af5('0x9')](),controller[_0x9af5('0x14')]);router[_0x9af5('0x15')]('/:id/members',auth[_0x9af5('0x9')](),controller[_0x9af5('0x16')]);router[_0x9af5('0x15')](_0x9af5('0x13'),auth[_0x9af5('0x9')](),controller[_0x9af5('0x17')]);router['put'](_0x9af5('0xd'),auth[_0x9af5('0x9')](),controller['update']);router['delete']('/:id',auth[_0x9af5('0x9')](),controller[_0x9af5('0x18')]);router[_0x9af5('0x19')]('/:id/members',auth['isAuthenticated'](),controller[_0x9af5('0x1a')]);module[_0x9af5('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 6d5de1e..ce0f9a6 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 _0x83f2=['long','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','STRING','TEXT'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x83f2,0x184));var _0x283f=function(_0x2bef52,_0x29bfb0){_0x2bef52=_0x2bef52-0x0;var _0x2715b1=_0x83f2[_0x2bef52];return _0x2715b1;};'use strict';var Sequelize=require('sequelize');module[_0x283f('0x0')]={'closed':{'type':Sequelize[_0x283f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x283f('0x2')]},'ratingType':{'type':Sequelize[_0x283f('0x3')](_0x283f('0x4'),_0x283f('0x5')),'defaultValue':_0x283f('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x283f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x283f('0x6')]},'secondDisposition':{'type':Sequelize[_0x283f('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x283f('0x6')]},'browserName':{'type':Sequelize[_0x283f('0x6')]},'browserVersion':{'type':Sequelize[_0x283f('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x283f('0x6')]},'deviceModel':{'type':Sequelize[_0x283f('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x283f('0x6')]},'referer':{'type':Sequelize[_0x283f('0x7')]},'customerIp':{'type':Sequelize[_0x283f('0x6')]},'formData':{'type':Sequelize[_0x283f('0x7')](_0x283f('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x283f('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x283f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x283f('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x283f('0x2')]}}; \ No newline at end of file +var _0x3a42=['BOOLEAN','INTEGER','thumb','star','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3a42,0x148));var _0x23a4=function(_0x261d18,_0x13490f){_0x261d18=_0x261d18-0x0;var _0x3e7208=_0x3a42[_0x261d18];return _0x3e7208;};'use strict';var Sequelize=require(_0x23a4('0x0'));module[_0x23a4('0x1')]={'closed':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x23a4('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x23a4('0x4')),'defaultValue':_0x23a4('0x5')},'ratingMessage':{'type':Sequelize[_0x23a4('0x6')]},'pathTranscript':{'type':Sequelize[_0x23a4('0x6')]},'mailTranscript':{'type':Sequelize[_0x23a4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x23a4('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x23a4('0x7')]},'thirdDisposition':{'type':Sequelize[_0x23a4('0x7')]},'note':{'type':Sequelize[_0x23a4('0x7')]},'browserName':{'type':Sequelize[_0x23a4('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x23a4('0x7')]},'osVersion':{'type':Sequelize[_0x23a4('0x7')]},'deviceModel':{'type':Sequelize[_0x23a4('0x7')]},'deviceVendor':{'type':Sequelize[_0x23a4('0x7')]},'deviceType':{'type':Sequelize[_0x23a4('0x7')]},'referer':{'type':Sequelize[_0x23a4('0x6')]},'customerIp':{'type':Sequelize[_0x23a4('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x23a4('0x9'))},'read1stAt':{'type':Sequelize[_0x23a4('0x8')]},'lastMsgAt':{'type':Sequelize[_0x23a4('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x23a4('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x23a4('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x23a4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x23a4('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index e291466..7de5fc3 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 _0xcc81=['tail','existsSync','pipe','createWriteStream','lastName','renderFile','transcript-','createPdfFromHTML','rimraf','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','destroy','stack','name','render','merge','body','contact','agent','interaction','account','index','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','chat','user','catch','params','model','keys','query','filters','intersection','attributes','fields','include','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooNote','vidaooMetadata','vidaooApiKey','email','vidaooTopic','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','customUpdate','CmContact','Contact','abandon','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','format','now','pathTranscript','Messages','ChatWebsiteId','%s%d','System','Visitor','ContactId','agentIdentifier','agent_alias','User','alias','fullname','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','count','includeAll','findAll','getMyMessages','order','ChatInteractionId','map','includeAgent','rows','addTags','setTags','spread','color','emit','chatInteractionTags:save','download','toString','server','files','tmp','transcript-%d-%s.zip','push','firstName','createdAt','read','Account','Owner','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','browserName','osName','referer','customerIp','customerPort'];(function(_0x2f177c,_0x3717bb){var _0x7c655a=function(_0x5f32ca){while(--_0x5f32ca){_0x2f177c['push'](_0x2f177c['shift']());}};_0x7c655a(++_0x3717bb);}(_0xcc81,0x19c));var _0x1cc8=function(_0x242566,_0x4ec88d){_0x242566=_0x242566-0x0;var _0x1bc410=_0xcc81[_0x242566];return _0x1bc410;};'use strict';var rimraf=require(_0x1cc8('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require(_0x1cc8('0x1'));var BPromise=require(_0x1cc8('0x2'));var Mustache=require(_0x1cc8('0x3'));var util=require(_0x1cc8('0x4'));var path=require(_0x1cc8('0x5'));var ejs=require(_0x1cc8('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x1cc8('0x7'));var interaction=require(_0x1cc8('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x1cc8('0x9'));var logger=require(_0x1cc8('0xa'))(_0x1cc8('0xb'));var config=require(_0x1cc8('0xc'));var db=require(_0x1cc8('0xd'))['db'];config[_0x1cc8('0xe')]=_[_0x1cc8('0xf')](config[_0x1cc8('0xe')],{'host':_0x1cc8('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cc8('0xe')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1cc8('0x11')][_0x1cc8('0x12')]({'port':0x232b});var client9004=jayson['client'][_0x1cc8('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x553f1f,_0x378edc,_0x5885d9,_0x5eba59){return new BPromise(function(_0x4d9126,_0x1aeafb){var _0x4a1bef=_0x5eba59||client;return _0x4a1bef[_0x1cc8('0x13')](_0x553f1f,_0x5885d9)[_0x1cc8('0x14')](function(_0x4905c1){logger[_0x1cc8('0x15')](_0x1cc8('0x16'),_0x378edc,_0x1cc8('0x17'));logger[_0x1cc8('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x378edc,_0x1cc8('0x17'),JSON[_0x1cc8('0x19')](_0x4905c1));if(_0x4905c1[_0x1cc8('0x1a')]){if(_0x4905c1[_0x1cc8('0x1a')][_0x1cc8('0x1b')]===0x1f4){logger[_0x1cc8('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x378edc,_0x4905c1[_0x1cc8('0x1a')][_0x1cc8('0x1c')]);return _0x1aeafb(_0x4905c1['error'][_0x1cc8('0x1c')]);}logger[_0x1cc8('0x1a')](_0x1cc8('0x16'),_0x378edc,_0x4905c1['error'][_0x1cc8('0x1c')]);return _0x4d9126(_0x4905c1[_0x1cc8('0x1a')][_0x1cc8('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x378edc,_0x1cc8('0x17'));_0x4d9126(_0x4905c1[_0x1cc8('0x1d')][_0x1cc8('0x1c')]);}})['catch'](function(_0x33977e){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x378edc,_0x33977e);_0x1aeafb(_0x33977e);});});}function respondWithStatusCode(_0x4f58f3,_0x401be0){_0x401be0=_0x401be0||0xcc;return function(_0x3bf0c3){if(_0x3bf0c3){return _0x4f58f3[_0x1cc8('0x1e')](_0x401be0);}return _0x4f58f3[_0x1cc8('0x1f')](_0x401be0)[_0x1cc8('0x20')]();};}function respondWithResult(_0x1892bd,_0x1ea6ab){_0x1ea6ab=_0x1ea6ab||0xc8;return function(_0x1fff8b){if(_0x1fff8b){return _0x1892bd[_0x1cc8('0x1f')](_0x1ea6ab)[_0x1cc8('0x21')](_0x1fff8b);}};}function respondWithFilteredResult(_0x51b8f3,_0x1d89ab){return function(_0x28ba0d){if(_0x28ba0d){var _0x366de2=typeof _0x1d89ab[_0x1cc8('0x22')]===_0x1cc8('0x23')&&typeof _0x1d89ab[_0x1cc8('0x24')]===_0x1cc8('0x23');var _0x29e834=_0x28ba0d['count'];var _0x1185d2=_0x366de2?0x0:_0x1d89ab['offset'];var _0x3f7d75=_0x366de2?_0x28ba0d['count']:_0x1d89ab[_0x1cc8('0x22')]+_0x1d89ab[_0x1cc8('0x24')];var _0x3ec068;if(_0x3f7d75>=_0x29e834){_0x3f7d75=_0x29e834;_0x3ec068=0xc8;}else{_0x3ec068=0xce;}_0x51b8f3[_0x1cc8('0x1f')](_0x3ec068);return _0x51b8f3[_0x1cc8('0x25')](_0x1cc8('0x26'),_0x1185d2+'-'+_0x3f7d75+'/'+_0x29e834)['json'](_0x28ba0d);}return null;};}function saveUpdates(_0x5b7857){return function(_0x28846a){if(_0x28846a){return _0x28846a['update'](_0x5b7857)[_0x1cc8('0x14')](function(_0x2c6af0){return _0x2c6af0;});}return null;};}function removeEntity(_0x31f7c4){return function(_0x3f56c7){if(_0x3f56c7){return _0x3f56c7[_0x1cc8('0x27')]()[_0x1cc8('0x14')](function(){_0x31f7c4[_0x1cc8('0x1f')](0xcc)[_0x1cc8('0x20')]();});}};}function handleEntityNotFound(_0x33addb){return function(_0x32a80d){if(!_0x32a80d){_0x33addb['sendStatus'](0x194);}return _0x32a80d;};}function handleError(_0x16dd52,_0x2a5f11){_0x2a5f11=_0x2a5f11||0x1f4;return function(_0x2ccdf9){logger[_0x1cc8('0x1a')](_0x2ccdf9[_0x1cc8('0x28')]);if(_0x2ccdf9['name']){delete _0x2ccdf9[_0x1cc8('0x29')];}_0x16dd52[_0x1cc8('0x1f')](_0x2a5f11)['send'](_0x2ccdf9);};}function getMustacheRender(_0x54c350,_0xf2e326){return Mustache[_0x1cc8('0x2a')](_0x54c350,_[_0x1cc8('0x2b')](_0xf2e326[_0x1cc8('0x2c')],{'contact':_0xf2e326[_0x1cc8('0x2d')],'message':_0xf2e326[_0x1cc8('0x1c')],'agent':_0xf2e326[_0x1cc8('0x2e')],'interaction':_0xf2e326[_0x1cc8('0x2f')],'account':_0xf2e326[_0x1cc8('0x30')]}))||'';}exports[_0x1cc8('0x31')]=function(_0x216ca4,_0x4c613f){var _0x179e5c={};var _0x247920=_['map'](db[_0x1cc8('0x32')][_0x1cc8('0x33')],function(_0xf3c75){return{'name':_0xf3c75[_0x1cc8('0x34')],'type':_0xf3c75[_0x1cc8('0x35')][_0x1cc8('0x36')]};});_0x179e5c=qs[_0x1cc8('0x37')](_0x247920,_0x216ca4);return interaction['findAll'](_0x1cc8('0x38'),_0x216ca4['query'],_0x216ca4[_0x1cc8('0x39')],_0x179e5c,_0x247920)['then'](respondWithFilteredResult(_0x4c613f,_0x179e5c))[_0x1cc8('0x3a')](handleError(_0x4c613f,null));};exports['show']=function(_0xf98c1d,_0x300b02){var _0x244efe={'raw':![],'where':{'id':_0xf98c1d[_0x1cc8('0x3b')]['id']}},_0x15b6cc={};_0x15b6cc[_0x1cc8('0x3c')]=_[_0x1cc8('0x3d')](db['ChatInteraction'][_0x1cc8('0x33')]);_0x15b6cc[_0x1cc8('0x3e')]=_['keys'](_0xf98c1d[_0x1cc8('0x3e')]);_0x15b6cc[_0x1cc8('0x3f')]=_[_0x1cc8('0x40')](_0x15b6cc['model'],_0x15b6cc[_0x1cc8('0x3e')]);_0x244efe[_0x1cc8('0x41')]=_[_0x1cc8('0x40')](_0x15b6cc['model'],qs['fields'](_0xf98c1d['query'][_0x1cc8('0x42')]));_0x244efe['attributes']=_0x244efe[_0x1cc8('0x41')]['length']?_0x244efe[_0x1cc8('0x41')]:_0x15b6cc[_0x1cc8('0x3c')];if(_0xf98c1d[_0x1cc8('0x3e')]['includeAll']){_0x244efe[_0x1cc8('0x43')]=[{'all':!![]}];}_0x244efe=_['merge']({},_0x244efe,_0xf98c1d[_0x1cc8('0x44')]);return db[_0x1cc8('0x32')][_0x1cc8('0x45')](_0x244efe)[_0x1cc8('0x14')](handleEntityNotFound(_0x300b02,null))[_0x1cc8('0x14')](respondWithResult(_0x300b02,null))[_0x1cc8('0x3a')](handleError(_0x300b02,null));};exports[_0x1cc8('0x46')]=function(_0x20b2e1,_0x3eb52e){return db[_0x1cc8('0x32')]['create'](_0x20b2e1['body'],{})[_0x1cc8('0x14')](respondWithResult(_0x3eb52e,0xc9))[_0x1cc8('0x3a')](handleError(_0x3eb52e,null));};exports[_0x1cc8('0x47')]=function(_0x24d55c,_0x5b88de){if(_0x24d55c[_0x1cc8('0x2c')]['id']){delete _0x24d55c[_0x1cc8('0x2c')]['id'];}return db['ChatInteraction'][_0x1cc8('0x45')]({'where':{'id':_0x24d55c[_0x1cc8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5b88de,null))[_0x1cc8('0x14')](saveUpdates(_0x24d55c[_0x1cc8('0x2c')],null))[_0x1cc8('0x14')](respondWithResult(_0x5b88de,null))[_0x1cc8('0x3a')](handleError(_0x5b88de,null));};exports[_0x1cc8('0x27')]=function(_0xbedfd7,_0x15d7df){return db[_0x1cc8('0x32')]['find']({'where':{'id':_0xbedfd7[_0x1cc8('0x3b')]['id']}})[_0x1cc8('0x14')](handleEntityNotFound(_0x15d7df,null))[_0x1cc8('0x14')](removeEntity(_0x15d7df,null))[_0x1cc8('0x3a')](handleError(_0x15d7df,null));};exports[_0x1cc8('0x48')]=function(_0x2e766f,_0x572996){return db[_0x1cc8('0x32')][_0x1cc8('0x48')]()[_0x1cc8('0x14')](respondWithResult(_0x572996,null))['catch'](handleError(_0x572996,null));};exports[_0x1cc8('0x49')]=function(_0x29e2e1,_0x18624a){var _0x5a5e54=_0x29e2e1[_0x1cc8('0x3b')]['id'];var _0x263a08;var _0x232f22;var _0x268706;return db[_0x1cc8('0x32')][_0x1cc8('0x4a')]({'where':{'id':_0x5a5e54}})[_0x1cc8('0x14')](function(_0x4010f1){_0x263a08=_0x4010f1;return db[_0x1cc8('0x4b')][_0x1cc8('0x4a')]({'where':{'id':_0x4010f1['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1cc8('0x4c'),'vidaooTopic',_0x1cc8('0x4d'),_0x1cc8('0x4e')],'raw':!![]});})[_0x1cc8('0x14')](function(_0x23fc59){if(_0x23fc59&&_0x23fc59[_0x1cc8('0x4f')]&&_0x23fc59['vidaooEscalation']){_0x232f22=_0x23fc59;var _0xb981b1={'interaction':{'id':_0x5a5e54},'agent':{'id':_0x29e2e1[_0x1cc8('0x39')]['id'],'name':_0x29e2e1[_0x1cc8('0x39')][_0x1cc8('0x29')],'fullname':_0x29e2e1[_0x1cc8('0x39')]['fullname'],'email':_0x29e2e1[_0x1cc8('0x39')][_0x1cc8('0x50')]},'contact':_0x29e2e1[_0x1cc8('0x2c')]['contact'],'account':_0x29e2e1[_0x1cc8('0x2c')][_0x1cc8('0x30')]};var _0x577121={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x23fc59[_0x1cc8('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x29e2e1['user'][_0x1cc8('0x50')]],'buttons':null,'topic':_0x232f22[_0x1cc8('0x51')],'note':_[_0x1cc8('0x52')](_0x232f22[_0x1cc8('0x4d')])?null:getMustacheRender(_0x232f22['vidaooNote'],_0xb981b1),'metadata':null},'redirect':_0x1cc8('0x53'),'json':!![]};try{if(!_[_0x1cc8('0x52')](_0x232f22[_0x1cc8('0x4e')])){var _0x12f1a7=getMustacheRender(_0x232f22[_0x1cc8('0x4e')],_0xb981b1);var _0xe47bc8=JSON[_0x1cc8('0x54')](_0x12f1a7);_0x577121['body'][_0x1cc8('0x55')]=_0xe47bc8;}}catch(_0x442821){throw new db[(_0x1cc8('0x56'))]['ValidationError'](_0x1cc8('0x57'));}return rp(_0x577121);}else{throw new db[(_0x1cc8('0x56'))]['ValidationError'](_0x1cc8('0x58'));}})[_0x1cc8('0x14')](function(_0x4ee36d){_0x268706=_0x4ee36d;if(_0x268706['id']){var _0x7c3130={'body':_0x268706[_0x1cc8('0x59')],'ChatWebsiteId':_0x232f22['id'],'ChatInteractionId':_0x263a08['id'],'direction':_0x1cc8('0x5a'),'UserId':_0x29e2e1[_0x1cc8('0x39')]['id']};return db[_0x1cc8('0x5b')][_0x1cc8('0x46')](_0x7c3130,{});}else{throw new db[(_0x1cc8('0x56'))][(_0x1cc8('0x5c'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x263a08['updateAttributes']({'vidaooSessionId':_0x268706['id']});})['then'](respondWithResult(_0x18624a,null))[_0x1cc8('0x3a')](handleError(_0x18624a,null));};exports[_0x1cc8('0x5d')]=function(_0x132a39,_0x4ff23d){if(_0x132a39[_0x1cc8('0x2c')]['id']){delete _0x132a39[_0x1cc8('0x2c')]['id'];}return db['ChatInteraction'][_0x1cc8('0x45')]({'where':{'id':_0x132a39['params']['id']},'include':[{'model':db[_0x1cc8('0x5e')],'as':_0x1cc8('0x5f')}]})['then'](handleEntityNotFound(_0x4ff23d,null))[_0x1cc8('0x14')](saveUpdates(_0x132a39[_0x1cc8('0x2c')],null))['then'](respondWithResult(_0x4ff23d,null))[_0x1cc8('0x3a')](handleError(_0x4ff23d,null));};exports[_0x1cc8('0x60')]=function(_0x9310f3,_0x31b945){if(_0x9310f3[_0x1cc8('0x2c')]['id']){delete _0x9310f3[_0x1cc8('0x2c')]['id'];}return db[_0x1cc8('0x32')]['find']({'where':{'id':_0x9310f3[_0x1cc8('0x3b')]['id']}})[_0x1cc8('0x14')](function(_0x120a44){if(!_0x120a44){logger[_0x1cc8('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x1cc8('0x60'),0x194,'entity\x20not\x20found');_0x31b945[_0x1cc8('0x1e')](0x194);}else{if(_0x120a44[_0x1cc8('0x61')]){throw new db[(_0x1cc8('0x56'))][(_0x1cc8('0x5c'))](_0x1cc8('0x62'));}}return _0x120a44;})[_0x1cc8('0x14')](function(_0x5e7fcb){if(_0x5e7fcb){return _0x5e7fcb['update']({'closed':_0x9310f3[_0x1cc8('0x2c')][_0x1cc8('0x63')],'disposition':_0x9310f3[_0x1cc8('0x2c')]['disposition']})[_0x1cc8('0x14')](function(_0xc5006b){return _0xc5006b;});}})['then'](function(){return respondWithRpcPromise(_0x1cc8('0x64'),_0x1cc8('0x60'),_0x9310f3[_0x1cc8('0x2c')],client9004);})[_0x1cc8('0x14')](respondWithResult(_0x31b945,null))[_0x1cc8('0x3a')](handleError(_0x31b945,null));};exports[_0x1cc8('0x65')]=function(_0x252163,_0xd7bb6c){_0x252163['body'][_0x1cc8('0x29')]=_0x252163['file'][_0x1cc8('0x66')];_0x252163[_0x1cc8('0x2c')]['basename']=_0x252163[_0x1cc8('0x67')][_0x1cc8('0x68')];_0x252163[_0x1cc8('0x2c')][_0x1cc8('0x35')]=_0x252163[_0x1cc8('0x67')][_0x1cc8('0x69')];return db[_0x1cc8('0x6a')][_0x1cc8('0x46')](_0x252163['body'])[_0x1cc8('0x14')](respondWithResult(_0xd7bb6c,0xc9))[_0x1cc8('0x3a')](handleError(_0xd7bb6c,null));};exports['attachmentDownload']=function(_0x4f114b,_0x41127d){return db[_0x1cc8('0x32')]['findOne']({'where':{'id':_0x4f114b[_0x1cc8('0x3b')]['id']},'raw':!![]})[_0x1cc8('0x14')](handleEntityNotFound(_0x41127d,null))['then'](function(_0xc5ff4c){if(_0xc5ff4c){if(_0xc5ff4c[_0x1cc8('0x63')]){return _0x41127d[_0x1cc8('0x1f')](0x193)[_0x1cc8('0x21')]({'status':0x193,'message':_0x1cc8('0x6b')});}return db[_0x1cc8('0x6a')][_0x1cc8('0x4a')]({'where':{'id':_0x4f114b['query'][_0x1cc8('0x6c')]},'raw':!![]})[_0x1cc8('0x14')](handleEntityNotFound(_0x41127d,null));}})['then'](function(_0x2329f9){if(_0x2329f9){var _0x4d2092=_0x2329f9[_0x1cc8('0x6d')]!==null;var _0x36d828=path[_0x1cc8('0x6e')](config[_0x1cc8('0x6f')],_0x1cc8('0x70'));if(_0x4d2092){_0x36d828=path['join'](_0x36d828,'offline-chat/');}var _0x2ba43d=path['join'](_0x36d828,_0x2329f9[_0x1cc8('0x71')]);return _0x41127d['download'](_0x2ba43d);}})[_0x1cc8('0x3a')](handleError(_0x41127d,null));};exports['close']=function(_0x28bf53,_0x4db1d2){var _0x3c4bad=null;var _0x5d33e9=null;var _0x5ec547=null;if(_0x28bf53[_0x1cc8('0x2c')]['id']){delete _0x28bf53['body']['id'];}if(_0x28bf53[_0x1cc8('0x2c')]['mailTranscript']){_0x5ec547=path[_0x1cc8('0x6e')](config['root'],'server/files/chat/upload/',util[_0x1cc8('0x72')]('transcript-%s.txt',Date[_0x1cc8('0x73')]()));_0x28bf53[_0x1cc8('0x2c')][_0x1cc8('0x74')]=_0x5ec547;}return db[_0x1cc8('0x32')][_0x1cc8('0x45')]({'where':{'id':_0x28bf53[_0x1cc8('0x3b')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x1cc8('0x75'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x1cc8('0x14')](handleEntityNotFound(_0x4db1d2,null))[_0x1cc8('0x14')](saveUpdates(_0x28bf53['body'],null))[_0x1cc8('0x14')](function(_0x2a0a62){if(_0x2a0a62){_0x3c4bad=_0x2a0a62;return db[_0x1cc8('0x4b')][_0x1cc8('0x45')]({'where':{'id':_0x3c4bad[_0x1cc8('0x76')]}});}})[_0x1cc8('0x14')](function(_0x1d5dd3){if(_0x1d5dd3){_0x5d33e9=_0x1d5dd3;return db[_0x1cc8('0x5e')][_0x1cc8('0x45')]({'where':{'id':_0x3c4bad['ContactId']}});}})[_0x1cc8('0x14')](function(_0xff258d){if(_0xff258d){if(_0x5ec547){var _0x1bf0bc=null;for(var _0x32d2e1=0x1;_0x32d2e1<_0x3c4bad[_0x1cc8('0x75')]['length'];++_0x32d2e1){_0x1bf0bc=_0x3c4bad['Messages'][_0x32d2e1];var _0x5a274c=_0x1bf0bc['UserId']?util[_0x1cc8('0x72')](_0x1cc8('0x77'),_0x5d33e9['agentAlias'],_0x1bf0bc['UserId']):_0x1cc8('0x78');var _0x2aed2a=_0x28bf53[_0x1cc8('0x2c')]['customer']||util[_0x1cc8('0x72')](_0x1cc8('0x77'),_0x1cc8('0x79'),_0x1bf0bc[_0x1cc8('0x7a')]);switch(_0x5d33e9[_0x1cc8('0x7b')]){case'website_alias':_0x5a274c=_0x1bf0bc[_0x1cc8('0x61')]?util[_0x1cc8('0x72')]('%s%d',_0x5d33e9['agentAlias'],_0x1bf0bc['UserId']):_0x1cc8('0x78');break;case _0x1cc8('0x7c'):_0x5a274c=_0x1bf0bc[_0x1cc8('0x61')]?_0x1bf0bc[_0x1cc8('0x7d')][_0x1cc8('0x7e')]||_0x1bf0bc['User'][_0x1cc8('0x7f')]:_0x1cc8('0x78');break;case _0x1cc8('0x80'):_0x5a274c=_0x1bf0bc['UserId']?_0x1bf0bc[_0x1cc8('0x7d')][_0x1cc8('0x7f')]:'System';break;default:_0x5a274c=_0x1bf0bc[_0x1cc8('0x61')]?util[_0x1cc8('0x72')](_0x1cc8('0x77'),_0x5d33e9[_0x1cc8('0x81')],_0x1bf0bc[_0x1cc8('0x61')]):_0x1cc8('0x78');}var _0x380b92=util['format'](_0x1cc8('0x82'),moment(_0x1bf0bc['createdAt'])['format'](_0x1cc8('0x83')),_0x1bf0bc[_0x1cc8('0x84')]==='in'?_0x2aed2a:_0x5a274c,_0x1bf0bc[_0x1cc8('0x2c')]);if(!_0x1bf0bc[_0x1cc8('0x85')]){fs[_0x1cc8('0x86')](_0x5ec547,_0x380b92);}}return db['MailAccount'][_0x1cc8('0x4a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1cc8('0x87'),'raw':!![],'include':[{'model':db[_0x1cc8('0x88')],'as':_0x1cc8('0x88'),'raw':!![]}]}]});}}})[_0x1cc8('0x14')](function(_0x1aee1c){if(!_0x1aee1c||!_0x1aee1c[_0x1cc8('0x87')]||!_0x28bf53[_0x1cc8('0x2c')])return _0x3c4bad;var _0x55e74b=_0x1aee1c[_0x1cc8('0x89')]();return respondWithRpcPromise(_0x1cc8('0x8a'),_0x1cc8('0x8b'),{'account':_0x55e74b,'message':{'from':util['format'](_0x1cc8('0x8c'),_0x1aee1c[_0x1cc8('0x29')],_0x1aee1c[_0x1cc8('0x50')]||_0x1aee1c[_0x1cc8('0x87')][_0x1cc8('0x39')]),'to':_0x28bf53['body'][_0x1cc8('0x8d')],'subject':_0x1cc8('0x8e'),'text':util['format'](_0x1cc8('0x8f'),_0x28bf53[_0x1cc8('0x2c')][_0x1cc8('0x8d')]),'attachments':[{'path':_0x5ec547}]}})['then'](function(){return _0x3c4bad;})[_0x1cc8('0x3a')](function(_0x5a74f2){logger[_0x1cc8('0x1a')](_0x5a74f2);});})['then'](respondWithStatusCode(_0x4db1d2,0xc8))['catch'](handleError(_0x4db1d2,null));};exports[_0x1cc8('0x90')]=function(_0x3e6d40,_0x4cb3e5){return db[_0x1cc8('0x5b')][_0x1cc8('0x45')]({'where':{'id':_0x3e6d40['params']['id']}})['then'](handleEntityNotFound(_0x4cb3e5,null))[_0x1cc8('0x14')](function(_0x496b2f){if(_0x496b2f){return _0x496b2f['addMessage'](_0x3e6d40[_0x1cc8('0x2c')][_0x1cc8('0x91')],_[_0x1cc8('0x92')](_0x3e6d40[_0x1cc8('0x2c')],[_0x1cc8('0x91'),'id'])||{});}})[_0x1cc8('0x14')](respondWithResult(_0x4cb3e5,null))[_0x1cc8('0x3a')](handleError(_0x4cb3e5,null));};exports[_0x1cc8('0x93')]=function(_0x36c6eb,_0x50f043){var _0x4f61b1={'raw':![],'where':{}};var _0x133b9d={};var _0x759a2b={'count':0x0,'rows':[]};return db[_0x1cc8('0x32')][_0x1cc8('0x4a')]({'where':{'id':_0x36c6eb[_0x1cc8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x50f043,null))['then'](function(_0xa74a96){if(_0xa74a96){_0x133b9d[_0x1cc8('0x3c')]=_[_0x1cc8('0x3d')](db[_0x1cc8('0x5b')][_0x1cc8('0x33')]);_0x133b9d[_0x1cc8('0x3e')]=_[_0x1cc8('0x3d')](_0x36c6eb[_0x1cc8('0x3e')]);_0x133b9d['filters']=_['intersection'](_0x133b9d[_0x1cc8('0x3c')],_0x133b9d[_0x1cc8('0x3e')]);_0x4f61b1[_0x1cc8('0x41')]=_[_0x1cc8('0x40')](_0x133b9d['model'],qs[_0x1cc8('0x42')](_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x42')]));_0x4f61b1[_0x1cc8('0x41')]=_0x4f61b1[_0x1cc8('0x41')][_0x1cc8('0x94')]?_0x4f61b1[_0x1cc8('0x41')]:_0x133b9d[_0x1cc8('0x3c')];if(!_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x95')](_0x1cc8('0x96'))){_0x4f61b1[_0x1cc8('0x24')]=qs['limit'](_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x24')]);_0x4f61b1[_0x1cc8('0x22')]=qs[_0x1cc8('0x22')](_0x36c6eb['query'][_0x1cc8('0x22')]);}_0x4f61b1['order']=qs['sort'](_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x97')]);_0x4f61b1[_0x1cc8('0x98')]=qs[_0x1cc8('0x3f')](_[_0x1cc8('0x99')](_0x36c6eb[_0x1cc8('0x3e')],_0x133b9d[_0x1cc8('0x3f')]));_0x4f61b1[_0x1cc8('0x98')]['ChatInteractionId']=_0xa74a96['id'];if(_0x36c6eb['query'][_0x1cc8('0x9a')]){_0x4f61b1[_0x1cc8('0x98')]=_['merge'](_0x4f61b1[_0x1cc8('0x98')],{'$or':_['map'](_0x4f61b1[_0x1cc8('0x41')],function(_0x444a7b){var _0x447cb7={};_0x447cb7[_0x444a7b]={'$like':'%'+_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x9a')]+'%'};return _0x447cb7;})});}if(_0x36c6eb['query'][_0x1cc8('0x9b')]){var _0x29b3c1=_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x9b')]['split'](',');var _0x388357={};_0x388357[_0x29b3c1[0x0]]={'$gte':moment(_0x29b3c1[0x1])[_0x1cc8('0x72')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4f61b1[_0x1cc8('0x98')]=_[_0x1cc8('0x2b')](_0x4f61b1['where'],_0x388357);}_0x4f61b1=_['merge']({},_0x4f61b1,_0x36c6eb[_0x1cc8('0x44')]);return db[_0x1cc8('0x5b')]['count']({'where':_0x4f61b1[_0x1cc8('0x98')]})[_0x1cc8('0x14')](function(_0x1b8d07){_0x759a2b[_0x1cc8('0x9c')]=_0x1b8d07;if(_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x9d')]){_0x4f61b1[_0x1cc8('0x43')]=[{'all':!![]}];}return db[_0x1cc8('0x5b')][_0x1cc8('0x9e')](_0x4f61b1);})[_0x1cc8('0x14')](function(_0xa2b4a7){_0x759a2b['rows']=_0xa2b4a7;return _0x759a2b;});}})[_0x1cc8('0x14')](respondWithFilteredResult(_0x50f043,_0x4f61b1))[_0x1cc8('0x3a')](handleError(_0x50f043,null));};exports[_0x1cc8('0x9f')]=function(_0x40427a,_0x1c63b9){var _0x336472={'where':{}},_0x4a91df={},_0x53487e={'count':0x0,'rows':[]};return db[_0x1cc8('0x32')][_0x1cc8('0x4a')]({'where':{'id':_0x40427a[_0x1cc8('0x3b')]['id']}})[_0x1cc8('0x14')](handleEntityNotFound(_0x1c63b9,null))[_0x1cc8('0x14')](function(_0x3183b0){if(_0x3183b0){_0x4a91df[_0x1cc8('0x3c')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x4a91df[_0x1cc8('0x3e')]=_[_0x1cc8('0x3d')](_0x40427a['query']);_0x4a91df['filters']=_['intersection'](_0x4a91df[_0x1cc8('0x3c')],_0x4a91df[_0x1cc8('0x3e')]);_0x336472[_0x1cc8('0x41')]=_['intersection'](_0x4a91df[_0x1cc8('0x3c')],qs[_0x1cc8('0x42')](_0x40427a[_0x1cc8('0x3e')]['fields']));_0x336472[_0x1cc8('0x41')]=_0x336472[_0x1cc8('0x41')][_0x1cc8('0x94')]?_0x336472['attributes']:_0x4a91df['model'];if(!_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x95')](_0x1cc8('0x96'))){_0x336472['limit']=qs[_0x1cc8('0x24')](_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x24')]);_0x336472[_0x1cc8('0x22')]=qs[_0x1cc8('0x22')](_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x22')]);}_0x336472[_0x1cc8('0xa0')]=qs[_0x1cc8('0x97')](_0x40427a['query'][_0x1cc8('0x97')]);_0x336472[_0x1cc8('0x98')]=qs['filters'](_[_0x1cc8('0x99')](_0x40427a[_0x1cc8('0x3e')],_0x4a91df[_0x1cc8('0x3f')]));_0x336472[_0x1cc8('0x98')][_0x1cc8('0xa1')]=_0x3183b0['id'];if(_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x9a')]){_0x336472[_0x1cc8('0x98')]=_[_0x1cc8('0x2b')](_0x336472[_0x1cc8('0x98')],{'$or':_[_0x1cc8('0xa2')](_0x336472[_0x1cc8('0x41')],function(_0x3657ce){var _0x6d042b={};_0x6d042b[_0x3657ce]={'$like':'%'+_0x40427a['query'][_0x1cc8('0x9a')]+'%'};return _0x6d042b;})});}_0x336472[_0x1cc8('0x98')][_0x1cc8('0x85')]=![];if(_0x40427a['query']['id']){_0x336472[_0x1cc8('0x98')]['id']={'$gt':_0x40427a[_0x1cc8('0x3e')]['id']};}_0x336472=_[_0x1cc8('0x2b')]({},_0x336472,_0x40427a[_0x1cc8('0x44')]);return db[_0x1cc8('0x5b')][_0x1cc8('0x9c')]({'where':_0x336472[_0x1cc8('0x98')]})[_0x1cc8('0x14')](function(_0x2caaf2){_0x53487e[_0x1cc8('0x9c')]=_0x2caaf2;_0x336472[_0x1cc8('0x43')]=[];if(_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0xa3')]){_0x336472['include']['push']({'model':db[_0x1cc8('0x7d')],'as':_0x1cc8('0x7d'),'attributes':['id',_0x1cc8('0x7f'),_0x1cc8('0x7e')]});}if(_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x9d')]){_0x336472[_0x1cc8('0x43')]=[{'all':!![]}];}return db[_0x1cc8('0x5b')][_0x1cc8('0x9e')](_0x336472);})[_0x1cc8('0x14')](function(_0x26adeb){_0x53487e[_0x1cc8('0xa4')]=_0x26adeb;return _0x53487e;});}})['then'](respondWithFilteredResult(_0x1c63b9,_0x336472))[_0x1cc8('0x3a')](handleError(_0x1c63b9,null));};exports[_0x1cc8('0xa5')]=function(_0x2ec144,_0x46ab52){return db[_0x1cc8('0x32')]['find']({'where':{'id':_0x2ec144[_0x1cc8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46ab52,null))['then'](function(_0x4a0d0e){if(_0x4a0d0e){return _0x4a0d0e[_0x1cc8('0xa6')](_0x2ec144[_0x1cc8('0x2c')][_0x1cc8('0x91')],_[_0x1cc8('0x92')](_0x2ec144[_0x1cc8('0x2c')],[_0x1cc8('0x91'),'id'])||{})[_0x1cc8('0xa7')](function(){return db['Tag'][_0x1cc8('0x9e')]({'attributes':['id',_0x1cc8('0x29'),_0x1cc8('0xa8')],'where':{'id':_0x2ec144[_0x1cc8('0x2c')]['ids']}});})['then'](function(_0x40c289){socket[_0x1cc8('0xa9')](_0x1cc8('0xaa'),{'id':Number(_0x2ec144['params']['id']),'tags':_0x40c289||[]});return{'id':Number(_0x2ec144['params']['id']),'tags':_0x40c289||[]};});}})[_0x1cc8('0x14')](respondWithResult(_0x46ab52,null))[_0x1cc8('0x3a')](handleError(_0x46ab52,null));};exports['removeTags']=function(_0x10ef13,_0x5272fe){return db[_0x1cc8('0x32')][_0x1cc8('0x45')]({'where':{'id':_0x10ef13['params']['id']}})[_0x1cc8('0x14')](handleEntityNotFound(_0x5272fe,null))[_0x1cc8('0x14')](function(_0x32b2e4){if(_0x32b2e4){return _0x32b2e4['removeTags'](_0x10ef13[_0x1cc8('0x3e')][_0x1cc8('0x91')]);}})[_0x1cc8('0x14')](respondWithStatusCode(_0x5272fe,null))[_0x1cc8('0x3a')](handleError(_0x5272fe,null));};exports[_0x1cc8('0xab')]=function(_0x5ca706,_0x49d46a){var _0x18de8f=moment()['unix']()[_0x1cc8('0xac')]();var _0x12684a=path[_0x1cc8('0x6e')](config[_0x1cc8('0x6f')],_0x1cc8('0xad'),_0x1cc8('0xae'),_0x1cc8('0xaf'));var _0x22f358=path[_0x1cc8('0x6e')](config[_0x1cc8('0x6f')],'server','files','attachments');var _0x522b4b=path[_0x1cc8('0x6e')](_0x12684a,_0x18de8f);var _0x343cfc=util[_0x1cc8('0x72')](_0x1cc8('0xb0'),_0x5ca706['params']['id'],_0x18de8f);var _0x271c1c=path[_0x1cc8('0x6e')](_0x12684a,_0x343cfc);var _0x22a6d1=[];_0x22a6d1[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x7d')],'as':_0x1cc8('0x7d'),'attributes':['id',_0x1cc8('0x7f')],'raw':!![]});_0x22a6d1[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x5e')],'as':_0x1cc8('0x5f'),'attributes':['id',_0x1cc8('0xb2'),'lastName'],'raw':!![]});if(_0x5ca706[_0x1cc8('0x3e')]['attachments']){_0x22a6d1[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x6a')],'as':'Attachment','raw':!![]});}var _0x542afb=[{'model':db['ChatMessage'],'as':_0x1cc8('0x75'),'attributes':['id',_0x1cc8('0x2c'),_0x1cc8('0xb3'),'direction',_0x1cc8('0x85'),_0x1cc8('0xb4')],'include':_0x22a6d1}];_0x542afb[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x4b')],'as':_0x1cc8('0xb5'),'attributes':['id','name']});_0x542afb[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x7d')],'as':_0x1cc8('0xb6'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x1cc8('0x45')]({'where':{'id':_0x5ca706[_0x1cc8('0x3b')]['id']},'include':_0x542afb})['then'](handleEntityNotFound(_0x49d46a,null))[_0x1cc8('0x14')](function(_0x126b5e){if(_0x126b5e){var _0x4d9184=_0x126b5e['get']({'plain':!![]});fs[_0x1cc8('0xb7')](_0x522b4b);var _0x3fcc21={'channel':_0x1cc8('0xb8'),'account':_0x4d9184[_0x1cc8('0xb5')]['name'],'agent':_0x4d9184[_0x1cc8('0xb6')]?_0x4d9184['Owner'][_0x1cc8('0x7f')]:_0x1cc8('0xb9'),'createdAt':moment(_0x4d9184[_0x1cc8('0xb3')])[_0x1cc8('0x72')](_0x1cc8('0xba'))[_0x1cc8('0xac')](),'closedAt':_0x4d9184['closed']?moment(_0x4d9184[_0x1cc8('0xbb')])['format'](_0x1cc8('0xba'))['toString']():'','disposition':_0x4d9184[_0x1cc8('0xbc')],'chatInfo':{'browser':_0x4d9184[_0x1cc8('0xbd')],'os':_0x4d9184[_0x1cc8('0xbe')],'referer':_0x4d9184[_0x1cc8('0xbf')],'customerIp':_0x4d9184[_0x1cc8('0xc0')],'customerPort':_0x4d9184[_0x1cc8('0xc1')]?_0x4d9184[_0x1cc8('0xc1')]:'N.A.'},'messages':_(_0x4d9184[_0x1cc8('0x75')])[_0x1cc8('0xc2')]()[_0x1cc8('0x9a')]({'secret':![]})[_0x1cc8('0xa2')](function(_0x2fa656){if(_0x2fa656[_0x1cc8('0x6a')]){var _0x3d1e64=path[_0x1cc8('0x6e')](_0x22f358,_0x2fa656['Attachment'][_0x1cc8('0x71')]);if(fs[_0x1cc8('0xc3')](_0x3d1e64)){fs['createReadStream'](_0x3d1e64)[_0x1cc8('0xc4')](fs[_0x1cc8('0xc5')](path[_0x1cc8('0x6e')](_0x522b4b,_0x2fa656[_0x1cc8('0x6a')][_0x1cc8('0x71')])));}}return{'date':moment(_0x2fa656['createdAt'])[_0x1cc8('0x72')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1cc8('0xac')](),'sender':_0x2fa656[_0x1cc8('0x84')]==='out'?_0x2fa656[_0x1cc8('0x7d')]?_0x2fa656[_0x1cc8('0x7d')][_0x1cc8('0x7f')]:'System':_0x2fa656[_0x1cc8('0x5f')][_0x1cc8('0xb2')]+(_0x2fa656[_0x1cc8('0x5f')][_0x1cc8('0xc6')]?'\x20'+_0x2fa656[_0x1cc8('0x5f')]['lastName']:''),'body':_0x2fa656[_0x1cc8('0x6a')]?_0x2fa656[_0x1cc8('0x6a')][_0x1cc8('0x71')]:_0x2fa656['body'],'direction':_0x2fa656[_0x1cc8('0x84')]===_0x1cc8('0x5a')?'A':'C','secret':_0x2fa656[_0x1cc8('0x85')],'read':_0x2fa656[_0x1cc8('0xb4')],'attachment':_0x2fa656[_0x1cc8('0x6a')]};})['value']()};return ejs[_0x1cc8('0xc7')](path['join'](config[_0x1cc8('0x6f')],'server','views','downloadInteraction.ejs'),{'interaction':_0x3fcc21})[_0x1cc8('0x14')](function(_0x1777e3){var _0x4f63d8=path[_0x1cc8('0x6e')](_0x522b4b,_0x1cc8('0xc8')+_0x4d9184['id']+'-'+_0x18de8f+'.pdf');var _0x1f2de1={'path':_0x4f63d8,'channel':_0x1cc8('0xb8'),'interactionId':_0x4d9184['id']};return pdf[_0x1cc8('0xc9')](_0x1777e3,_0x1f2de1);})[_0x1cc8('0x14')](function(){return new Promise(function(_0x4b4a51,_0x2f2f27){zipdir(_0x522b4b,{'saveTo':_0x271c1c},function(_0x4bb60e,_0x1c59dc){if(_0x4bb60e)return _0x2f2f27(_0x4bb60e);return _0x4b4a51(_0x1c59dc);});})[_0x1cc8('0x14')](function(){return new BPromise(function(_0x3206f5,_0x2ca04b){rimraf(_0x522b4b,function(_0x7d3e9a){if(_0x7d3e9a)_0x2ca04b(_0x7d3e9a);return _0x3206f5();});});})[_0x1cc8('0x14')](function(){return _0x49d46a[_0x1cc8('0xab')](_0x271c1c,_0x343cfc,function(_0xb4977){if(_0xb4977){logger['error']('err',_0xb4977);}else{fs['unlinkSync'](_0x271c1c);}});});});}else{return _0x49d46a['sendStatus'](0xc8);}})[_0x1cc8('0x3a')](handleError(_0x49d46a,null));}; \ No newline at end of file +var _0xb7d7=['N.A.','existsSync','pipe','createWriteStream','out','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','stack','name','render','body','agent','map','ChatInteraction','type','key','findAll','user','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','update','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','contact','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Sequelize','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','server/files/attachments/','join','download','close','server/files/chat/upload/','format','transcript-%s.txt','User','ContactId','agentAlias','System','customer','%s%d','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','setTags','spread','color','emit','chatInteractionTags:save','unix','toString','root','server','files','attachments','push','fullname','lastName','Messages','secret','read','Account','Owner','get','Chat','closedAt','disposition','browserName','osName','referer','customerIp'];(function(_0x23677a,_0x5e98a1){var _0x3a8969=function(_0x2dc233){while(--_0x2dc233){_0x23677a['push'](_0x23677a['shift']());}};_0x3a8969(++_0x5e98a1);}(_0xb7d7,0xd4));var _0x7b7d=function(_0x45231c,_0x1610a8){_0x45231c=_0x45231c-0x0;var _0x5481b1=_0xb7d7[_0x45231c];return _0x5481b1;};'use strict';var rimraf=require(_0x7b7d('0x0'));var zipdir=require(_0x7b7d('0x1'));var rp=require('request-promise');var moment=require(_0x7b7d('0x2'));var BPromise=require(_0x7b7d('0x3'));var Mustache=require(_0x7b7d('0x4'));var util=require(_0x7b7d('0x5'));var path=require('path');var ejs=require(_0x7b7d('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x7b7d('0x7'));var qs=require(_0x7b7d('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x7b7d('0x9'))(_0x7b7d('0xa'));var config=require(_0x7b7d('0xb'));var db=require(_0x7b7d('0xc'))['db'];config[_0x7b7d('0xd')]=_[_0x7b7d('0xe')](config['redis'],{'host':_0x7b7d('0xf'),'port':0x18eb});var socket=require(_0x7b7d('0x10'))(new Redis(config[_0x7b7d('0xd')]));require(_0x7b7d('0x11'))['register'](socket);var jayson=require(_0x7b7d('0x12'));var client=jayson[_0x7b7d('0x13')][_0x7b7d('0x14')]({'port':0x232b});var client9004=jayson[_0x7b7d('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x189a53,_0x522be9,_0x11b27f,_0x453d03){return new BPromise(function(_0x3306d7,_0x30f541){var _0x3bdb33=_0x453d03||client;return _0x3bdb33[_0x7b7d('0x15')](_0x189a53,_0x11b27f)['then'](function(_0x253a6f){logger[_0x7b7d('0x16')](_0x7b7d('0x17'),_0x522be9,_0x7b7d('0x18'));logger[_0x7b7d('0x19')](_0x7b7d('0x1a'),_0x522be9,_0x7b7d('0x18'),JSON['stringify'](_0x253a6f));if(_0x253a6f[_0x7b7d('0x1b')]){if(_0x253a6f[_0x7b7d('0x1b')]['code']===0x1f4){logger['error'](_0x7b7d('0x17'),_0x522be9,_0x253a6f[_0x7b7d('0x1b')][_0x7b7d('0x1c')]);return _0x30f541(_0x253a6f[_0x7b7d('0x1b')][_0x7b7d('0x1c')]);}logger[_0x7b7d('0x1b')](_0x7b7d('0x17'),_0x522be9,_0x253a6f[_0x7b7d('0x1b')]['message']);return _0x3306d7(_0x253a6f[_0x7b7d('0x1b')][_0x7b7d('0x1c')]);}else{logger[_0x7b7d('0x16')](_0x7b7d('0x17'),_0x522be9,_0x7b7d('0x18'));_0x3306d7(_0x253a6f[_0x7b7d('0x1d')][_0x7b7d('0x1c')]);}})[_0x7b7d('0x1e')](function(_0x375f2c){logger[_0x7b7d('0x1b')](_0x7b7d('0x17'),_0x522be9,_0x375f2c);_0x30f541(_0x375f2c);});});}function respondWithStatusCode(_0x7e3df7,_0x3455fa){_0x3455fa=_0x3455fa||0xcc;return function(_0x108bf1){if(_0x108bf1){return _0x7e3df7['sendStatus'](_0x3455fa);}return _0x7e3df7[_0x7b7d('0x1f')](_0x3455fa)[_0x7b7d('0x20')]();};}function respondWithResult(_0x234f3c,_0x453dc9){_0x453dc9=_0x453dc9||0xc8;return function(_0x15494c){if(_0x15494c){return _0x234f3c[_0x7b7d('0x1f')](_0x453dc9)[_0x7b7d('0x21')](_0x15494c);}};}function respondWithFilteredResult(_0x59282a,_0x2d85d9){return function(_0xe91dd3){if(_0xe91dd3){var _0x435f73=typeof _0x2d85d9[_0x7b7d('0x22')]===_0x7b7d('0x23')&&typeof _0x2d85d9['limit']===_0x7b7d('0x23');var _0x17bc53=_0xe91dd3[_0x7b7d('0x24')];var _0x2c5457=_0x435f73?0x0:_0x2d85d9[_0x7b7d('0x22')];var _0x508c47=_0x435f73?_0xe91dd3[_0x7b7d('0x24')]:_0x2d85d9[_0x7b7d('0x22')]+_0x2d85d9[_0x7b7d('0x25')];var _0x368582;if(_0x508c47>=_0x17bc53){_0x508c47=_0x17bc53;_0x368582=0xc8;}else{_0x368582=0xce;}_0x59282a[_0x7b7d('0x1f')](_0x368582);return _0x59282a[_0x7b7d('0x26')](_0x7b7d('0x27'),_0x2c5457+'-'+_0x508c47+'/'+_0x17bc53)[_0x7b7d('0x21')](_0xe91dd3);}return null;};}function saveUpdates(_0x5f5482){return function(_0x3ca59c){if(_0x3ca59c){return _0x3ca59c['update'](_0x5f5482)[_0x7b7d('0x28')](function(_0x51d781){return _0x51d781;});}return null;};}function removeEntity(_0x163357){return function(_0x450c8b){if(_0x450c8b){return _0x450c8b[_0x7b7d('0x29')]()[_0x7b7d('0x28')](function(){_0x163357[_0x7b7d('0x1f')](0xcc)[_0x7b7d('0x20')]();});}};}function handleEntityNotFound(_0x17e6a7){return function(_0x80bd08){if(!_0x80bd08){_0x17e6a7[_0x7b7d('0x2a')](0x194);}return _0x80bd08;};}function handleError(_0x5a22c7,_0x106eaf){_0x106eaf=_0x106eaf||0x1f4;return function(_0x5209a6){logger[_0x7b7d('0x1b')](_0x5209a6[_0x7b7d('0x2b')]);if(_0x5209a6[_0x7b7d('0x2c')]){delete _0x5209a6['name'];}_0x5a22c7[_0x7b7d('0x1f')](_0x106eaf)['send'](_0x5209a6);};}function getMustacheRender(_0x407c95,_0x40f5dc){return Mustache[_0x7b7d('0x2d')](_0x407c95,_['merge'](_0x40f5dc[_0x7b7d('0x2e')],{'contact':_0x40f5dc['contact'],'message':_0x40f5dc[_0x7b7d('0x1c')],'agent':_0x40f5dc[_0x7b7d('0x2f')],'interaction':_0x40f5dc['interaction'],'account':_0x40f5dc['account']}))||'';}exports['index']=function(_0x45bddd,_0xa2d6ec){var _0x331fc5={};var _0x339e77=_[_0x7b7d('0x30')](db[_0x7b7d('0x31')]['rawAttributes'],function(_0x83dadd){return{'name':_0x83dadd['fieldName'],'type':_0x83dadd[_0x7b7d('0x32')][_0x7b7d('0x33')]};});_0x331fc5=qs['getOptions'](_0x339e77,_0x45bddd);return interaction[_0x7b7d('0x34')]('chat',_0x45bddd['query'],_0x45bddd[_0x7b7d('0x35')],_0x331fc5,_0x339e77)[_0x7b7d('0x28')](respondWithFilteredResult(_0xa2d6ec,_0x331fc5))[_0x7b7d('0x1e')](handleError(_0xa2d6ec,null));};exports[_0x7b7d('0x36')]=function(_0x4e4f9f,_0x24011e){var _0x4686b6={'raw':![],'where':{'id':_0x4e4f9f[_0x7b7d('0x37')]['id']}},_0x18bf5f={};_0x18bf5f[_0x7b7d('0x38')]=_[_0x7b7d('0x39')](db[_0x7b7d('0x31')][_0x7b7d('0x3a')]);_0x18bf5f[_0x7b7d('0x3b')]=_['keys'](_0x4e4f9f[_0x7b7d('0x3b')]);_0x18bf5f[_0x7b7d('0x3c')]=_['intersection'](_0x18bf5f['model'],_0x18bf5f['query']);_0x4686b6[_0x7b7d('0x3d')]=_[_0x7b7d('0x3e')](_0x18bf5f[_0x7b7d('0x38')],qs[_0x7b7d('0x3f')](_0x4e4f9f[_0x7b7d('0x3b')][_0x7b7d('0x3f')]));_0x4686b6[_0x7b7d('0x3d')]=_0x4686b6['attributes'][_0x7b7d('0x40')]?_0x4686b6[_0x7b7d('0x3d')]:_0x18bf5f[_0x7b7d('0x38')];if(_0x4e4f9f[_0x7b7d('0x3b')][_0x7b7d('0x41')]){_0x4686b6[_0x7b7d('0x42')]=[{'all':!![]}];}_0x4686b6=_[_0x7b7d('0x43')]({},_0x4686b6,_0x4e4f9f[_0x7b7d('0x44')]);return db[_0x7b7d('0x31')][_0x7b7d('0x45')](_0x4686b6)[_0x7b7d('0x28')](handleEntityNotFound(_0x24011e,null))[_0x7b7d('0x28')](respondWithResult(_0x24011e,null))[_0x7b7d('0x1e')](handleError(_0x24011e,null));};exports[_0x7b7d('0x46')]=function(_0x183143,_0x510d43){return db['ChatInteraction']['create'](_0x183143[_0x7b7d('0x2e')],{})[_0x7b7d('0x28')](respondWithResult(_0x510d43,0xc9))[_0x7b7d('0x1e')](handleError(_0x510d43,null));};exports[_0x7b7d('0x47')]=function(_0xd43aa1,_0x39ab2a){if(_0xd43aa1[_0x7b7d('0x2e')]['id']){delete _0xd43aa1['body']['id'];}return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0xd43aa1[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x39ab2a,null))['then'](saveUpdates(_0xd43aa1['body'],null))['then'](respondWithResult(_0x39ab2a,null))[_0x7b7d('0x1e')](handleError(_0x39ab2a,null));};exports[_0x7b7d('0x29')]=function(_0x3037f2,_0x5cab49){return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x3037f2[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x5cab49,null))['then'](removeEntity(_0x5cab49,null))['catch'](handleError(_0x5cab49,null));};exports[_0x7b7d('0x48')]=function(_0x53974e,_0x526187){return db['ChatInteraction'][_0x7b7d('0x48')]()['then'](respondWithResult(_0x526187,null))[_0x7b7d('0x1e')](handleError(_0x526187,null));};exports['createVidaooSession']=function(_0x5e443e,_0x2569a1){var _0x5301af=_0x5e443e['params']['id'];var _0x23d2a3;var _0x5d0435;var _0x481e84;return db['ChatInteraction'][_0x7b7d('0x49')]({'where':{'id':_0x5301af}})[_0x7b7d('0x28')](function(_0x54b6df){_0x23d2a3=_0x54b6df;return db[_0x7b7d('0x4a')][_0x7b7d('0x49')]({'where':{'id':_0x54b6df[_0x7b7d('0x4b')]},'attributes':['id',_0x7b7d('0x4c'),_0x7b7d('0x4d'),_0x7b7d('0x4e'),_0x7b7d('0x4f'),'vidaooMetadata'],'raw':!![]});})[_0x7b7d('0x28')](function(_0x4ae9ac){if(_0x4ae9ac&&_0x4ae9ac[_0x7b7d('0x4c')]&&_0x4ae9ac[_0x7b7d('0x4d')]){_0x5d0435=_0x4ae9ac;var _0x205616={'interaction':{'id':_0x5301af},'agent':{'id':_0x5e443e[_0x7b7d('0x35')]['id'],'name':_0x5e443e[_0x7b7d('0x35')][_0x7b7d('0x2c')],'fullname':_0x5e443e[_0x7b7d('0x35')]['fullname'],'email':_0x5e443e[_0x7b7d('0x35')][_0x7b7d('0x50')]},'contact':_0x5e443e[_0x7b7d('0x2e')][_0x7b7d('0x51')],'account':_0x5e443e[_0x7b7d('0x2e')][_0x7b7d('0x52')]};var _0x31dd9c={'rejectUnauthorized':![],'method':_0x7b7d('0x53'),'url':_0x7b7d('0x54'),'headers':{'X-APIKEY':_0x4ae9ac['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e443e[_0x7b7d('0x35')][_0x7b7d('0x50')]],'buttons':null,'topic':_0x5d0435[_0x7b7d('0x4e')],'note':_['isNull'](_0x5d0435['vidaooNote'])?null:getMustacheRender(_0x5d0435['vidaooNote'],_0x205616),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7b7d('0x55')](_0x5d0435[_0x7b7d('0x56')])){var _0x4f7fec=getMustacheRender(_0x5d0435[_0x7b7d('0x56')],_0x205616);var _0xd48e06=JSON[_0x7b7d('0x57')](_0x4f7fec);_0x31dd9c[_0x7b7d('0x2e')][_0x7b7d('0x58')]=_0xd48e06;}}catch(_0x48b6c3){throw new db['Sequelize']['ValidationError'](_0x7b7d('0x59'));}return rp(_0x31dd9c);}else{throw new db['Sequelize'][(_0x7b7d('0x5a'))](_0x7b7d('0x5b'));}})[_0x7b7d('0x28')](function(_0x86b851){_0x481e84=_0x86b851;if(_0x481e84['id']){var _0x46c782={'body':_0x481e84['join_url'],'ChatWebsiteId':_0x5d0435['id'],'ChatInteractionId':_0x23d2a3['id'],'direction':'out','UserId':_0x5e443e[_0x7b7d('0x35')]['id']};return db[_0x7b7d('0x5c')][_0x7b7d('0x46')](_0x46c782,{});}else{throw new db['Sequelize'][(_0x7b7d('0x5a'))](_0x7b7d('0x5d'));}})[_0x7b7d('0x28')](function(){return _0x23d2a3[_0x7b7d('0x5e')]({'vidaooSessionId':_0x481e84['id']});})[_0x7b7d('0x28')](respondWithResult(_0x2569a1,null))['catch'](handleError(_0x2569a1,null));};exports[_0x7b7d('0x5f')]=function(_0x45a077,_0x5dd48f){if(_0x45a077[_0x7b7d('0x2e')]['id']){delete _0x45a077[_0x7b7d('0x2e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x45a077[_0x7b7d('0x37')]['id']},'include':[{'model':db[_0x7b7d('0x60')],'as':_0x7b7d('0x61')}]})[_0x7b7d('0x28')](handleEntityNotFound(_0x5dd48f,null))['then'](saveUpdates(_0x45a077['body'],null))[_0x7b7d('0x28')](respondWithResult(_0x5dd48f,null))[_0x7b7d('0x1e')](handleError(_0x5dd48f,null));};exports[_0x7b7d('0x62')]=function(_0x34c969,_0x1da821){if(_0x34c969[_0x7b7d('0x2e')]['id']){delete _0x34c969[_0x7b7d('0x2e')]['id'];}return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x34c969[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](function(_0x32d9f2){if(!_0x32d9f2){logger[_0x7b7d('0x1b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x7b7d('0x62'),0x194,_0x7b7d('0x63'));_0x1da821[_0x7b7d('0x2a')](0x194);}else{if(_0x32d9f2[_0x7b7d('0x64')]){throw new db[(_0x7b7d('0x65'))][(_0x7b7d('0x5a'))](_0x7b7d('0x66'));}}return _0x32d9f2;})[_0x7b7d('0x28')](function(_0x5efb4f){if(_0x5efb4f){return _0x5efb4f[_0x7b7d('0x47')]({'closed':_0x34c969[_0x7b7d('0x2e')][_0x7b7d('0x67')],'disposition':_0x34c969[_0x7b7d('0x2e')]['disposition']})[_0x7b7d('0x28')](function(_0xd4a500){return _0xd4a500;});}})['then'](function(){return respondWithRpcPromise(_0x7b7d('0x68'),_0x7b7d('0x62'),_0x34c969[_0x7b7d('0x2e')],client9004);})[_0x7b7d('0x28')](respondWithResult(_0x1da821,null))[_0x7b7d('0x1e')](handleError(_0x1da821,null));};exports[_0x7b7d('0x69')]=function(_0x20b9d4,_0x3f739e){_0x20b9d4[_0x7b7d('0x2e')][_0x7b7d('0x2c')]=_0x20b9d4['file'][_0x7b7d('0x6a')];_0x20b9d4[_0x7b7d('0x2e')][_0x7b7d('0x6b')]=_0x20b9d4[_0x7b7d('0x6c')][_0x7b7d('0x6d')];_0x20b9d4[_0x7b7d('0x2e')]['type']=_0x20b9d4[_0x7b7d('0x6c')]['mimetype'];return db[_0x7b7d('0x6e')][_0x7b7d('0x46')](_0x20b9d4['body'])[_0x7b7d('0x28')](respondWithResult(_0x3f739e,0xc9))['catch'](handleError(_0x3f739e,null));};exports[_0x7b7d('0x6f')]=function(_0xddea6,_0x5d92bb){return db['ChatInteraction'][_0x7b7d('0x49')]({'where':{'id':_0xddea6['params']['id']},'raw':!![]})[_0x7b7d('0x28')](handleEntityNotFound(_0x5d92bb,null))['then'](function(_0x4a9af9){if(_0x4a9af9){if(_0x4a9af9[_0x7b7d('0x67')]){return _0x5d92bb['status'](0x193)[_0x7b7d('0x21')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0xddea6['query'][_0x7b7d('0x70')]},'raw':!![]})['then'](handleEntityNotFound(_0x5d92bb,null));}})[_0x7b7d('0x28')](function(_0x2c06bb){if(_0x2c06bb){var _0x3f793c=_0x2c06bb[_0x7b7d('0x71')]!==null;var _0x327503=path['join'](config['root'],_0x7b7d('0x72'));if(_0x3f793c){_0x327503=path[_0x7b7d('0x73')](_0x327503,'offline-chat/');}var _0x383ea0=path[_0x7b7d('0x73')](_0x327503,_0x2c06bb[_0x7b7d('0x6b')]);return _0x5d92bb[_0x7b7d('0x74')](_0x383ea0);}})[_0x7b7d('0x1e')](handleError(_0x5d92bb,null));};exports[_0x7b7d('0x75')]=function(_0x434b73,_0x35887f){var _0x51fa77=null;var _0x4321ca=null;var _0x250ed4=null;if(_0x434b73[_0x7b7d('0x2e')]['id']){delete _0x434b73['body']['id'];}if(_0x434b73['body']['mailTranscript']){_0x250ed4=path[_0x7b7d('0x73')](config['root'],_0x7b7d('0x76'),util[_0x7b7d('0x77')](_0x7b7d('0x78'),Date['now']()));_0x434b73[_0x7b7d('0x2e')]['pathTranscript']=_0x250ed4;}return db[_0x7b7d('0x31')]['find']({'where':{'id':_0x434b73['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x7b7d('0x79')],'as':_0x7b7d('0x79')}]}]})['then'](handleEntityNotFound(_0x35887f,null))['then'](saveUpdates(_0x434b73[_0x7b7d('0x2e')],null))[_0x7b7d('0x28')](function(_0x2aaea9){if(_0x2aaea9){_0x51fa77=_0x2aaea9;return db[_0x7b7d('0x4a')][_0x7b7d('0x45')]({'where':{'id':_0x51fa77[_0x7b7d('0x4b')]}});}})[_0x7b7d('0x28')](function(_0x5c0a45){if(_0x5c0a45){_0x4321ca=_0x5c0a45;return db[_0x7b7d('0x60')]['find']({'where':{'id':_0x51fa77[_0x7b7d('0x7a')]}});}})[_0x7b7d('0x28')](function(_0x5c2e3e){if(_0x5c2e3e){if(_0x250ed4){var _0x1ca989=null;for(var _0x20f9c9=0x1;_0x20f9c9<_0x51fa77['Messages'][_0x7b7d('0x40')];++_0x20f9c9){_0x1ca989=_0x51fa77['Messages'][_0x20f9c9];var _0x5d5dec=_0x1ca989[_0x7b7d('0x64')]?util[_0x7b7d('0x77')]('%s%d',_0x4321ca[_0x7b7d('0x7b')],_0x1ca989['UserId']):_0x7b7d('0x7c');var _0x3e3110=_0x434b73['body'][_0x7b7d('0x7d')]||util[_0x7b7d('0x77')](_0x7b7d('0x7e'),_0x7b7d('0x7f'),_0x1ca989[_0x7b7d('0x7a')]);switch(_0x4321ca['agentIdentifier']){case _0x7b7d('0x80'):_0x5d5dec=_0x1ca989[_0x7b7d('0x64')]?util['format'](_0x7b7d('0x7e'),_0x4321ca[_0x7b7d('0x7b')],_0x1ca989[_0x7b7d('0x64')]):_0x7b7d('0x7c');break;case _0x7b7d('0x81'):_0x5d5dec=_0x1ca989[_0x7b7d('0x64')]?_0x1ca989['User'][_0x7b7d('0x82')]||_0x1ca989[_0x7b7d('0x79')]['fullname']:'System';break;case _0x7b7d('0x83'):_0x5d5dec=_0x1ca989['UserId']?_0x1ca989['User']['fullname']:'System';break;default:_0x5d5dec=_0x1ca989['UserId']?util[_0x7b7d('0x77')]('%s%d',_0x4321ca[_0x7b7d('0x7b')],_0x1ca989['UserId']):_0x7b7d('0x7c');}var _0x58826c=util[_0x7b7d('0x77')](_0x7b7d('0x84'),moment(_0x1ca989[_0x7b7d('0x85')])[_0x7b7d('0x77')](_0x7b7d('0x86')),_0x1ca989[_0x7b7d('0x87')]==='in'?_0x3e3110:_0x5d5dec,_0x1ca989[_0x7b7d('0x2e')]);if(!_0x1ca989['secret']){fs[_0x7b7d('0x88')](_0x250ed4,_0x58826c);}}return db[_0x7b7d('0x89')][_0x7b7d('0x49')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x7b7d('0x8a'),'raw':!![],'include':[{'model':db[_0x7b7d('0x8b')],'as':_0x7b7d('0x8b'),'raw':!![]}]}]});}}})[_0x7b7d('0x28')](function(_0x3a34ab){if(!_0x3a34ab||!_0x3a34ab['Smtp']||!_0x434b73[_0x7b7d('0x2e')])return _0x51fa77;var _0x45e386=_0x3a34ab[_0x7b7d('0x8c')]();return respondWithRpcPromise(_0x7b7d('0x8d'),'sendMail',{'account':_0x45e386,'message':{'from':util[_0x7b7d('0x77')](_0x7b7d('0x8e'),_0x3a34ab[_0x7b7d('0x2c')],_0x3a34ab[_0x7b7d('0x50')]||_0x3a34ab[_0x7b7d('0x8a')][_0x7b7d('0x35')]),'to':_0x434b73[_0x7b7d('0x2e')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x7b7d('0x77')](_0x7b7d('0x8f'),_0x434b73[_0x7b7d('0x2e')]['mailTranscript']),'attachments':[{'path':_0x250ed4}]}})[_0x7b7d('0x28')](function(){return _0x51fa77;})['catch'](function(_0x2f1c94){logger[_0x7b7d('0x1b')](_0x2f1c94);});})[_0x7b7d('0x28')](respondWithStatusCode(_0x35887f,0xc8))['catch'](handleError(_0x35887f,null));};exports[_0x7b7d('0x90')]=function(_0x287455,_0x300712){return db[_0x7b7d('0x5c')][_0x7b7d('0x45')]({'where':{'id':_0x287455[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x300712,null))[_0x7b7d('0x28')](function(_0x41c186){if(_0x41c186){return _0x41c186[_0x7b7d('0x90')](_0x287455[_0x7b7d('0x2e')][_0x7b7d('0x91')],_[_0x7b7d('0x92')](_0x287455['body'],['ids','id'])||{});}})[_0x7b7d('0x28')](respondWithResult(_0x300712,null))[_0x7b7d('0x1e')](handleError(_0x300712,null));};exports[_0x7b7d('0x93')]=function(_0x477e9e,_0x122891){var _0x11cf09={'raw':![],'where':{}};var _0x26642f={};var _0x148e26={'count':0x0,'rows':[]};return db[_0x7b7d('0x31')][_0x7b7d('0x49')]({'where':{'id':_0x477e9e[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x122891,null))[_0x7b7d('0x28')](function(_0xaa43c0){if(_0xaa43c0){_0x26642f['model']=_[_0x7b7d('0x39')](db[_0x7b7d('0x5c')]['rawAttributes']);_0x26642f[_0x7b7d('0x3b')]=_[_0x7b7d('0x39')](_0x477e9e['query']);_0x26642f[_0x7b7d('0x3c')]=_[_0x7b7d('0x3e')](_0x26642f[_0x7b7d('0x38')],_0x26642f[_0x7b7d('0x3b')]);_0x11cf09[_0x7b7d('0x3d')]=_['intersection'](_0x26642f[_0x7b7d('0x38')],qs[_0x7b7d('0x3f')](_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x3f')]));_0x11cf09[_0x7b7d('0x3d')]=_0x11cf09[_0x7b7d('0x3d')][_0x7b7d('0x40')]?_0x11cf09[_0x7b7d('0x3d')]:_0x26642f[_0x7b7d('0x38')];if(!_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x94')](_0x7b7d('0x95'))){_0x11cf09[_0x7b7d('0x25')]=qs[_0x7b7d('0x25')](_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x25')]);_0x11cf09[_0x7b7d('0x22')]=qs[_0x7b7d('0x22')](_0x477e9e['query']['offset']);}_0x11cf09[_0x7b7d('0x96')]=qs[_0x7b7d('0x97')](_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x97')]);_0x11cf09['where']=qs['filters'](_[_0x7b7d('0x98')](_0x477e9e['query'],_0x26642f[_0x7b7d('0x3c')]));_0x11cf09[_0x7b7d('0x99')][_0x7b7d('0x9a')]=_0xaa43c0['id'];if(_0x477e9e['query']['filter']){_0x11cf09[_0x7b7d('0x99')]=_[_0x7b7d('0x43')](_0x11cf09[_0x7b7d('0x99')],{'$or':_['map'](_0x11cf09[_0x7b7d('0x3d')],function(_0x810420){var _0x183554={};_0x183554[_0x810420]={'$like':'%'+_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x9b')]+'%'};return _0x183554;})});}if(_0x477e9e[_0x7b7d('0x3b')]['$gte']){var _0x934eef=_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x9c')][_0x7b7d('0x9d')](',');var _0x253d03={};_0x253d03[_0x934eef[0x0]]={'$gte':moment(_0x934eef[0x1])['format'](_0x7b7d('0x9e'))};_0x11cf09[_0x7b7d('0x99')]=_[_0x7b7d('0x43')](_0x11cf09[_0x7b7d('0x99')],_0x253d03);}_0x11cf09=_[_0x7b7d('0x43')]({},_0x11cf09,_0x477e9e[_0x7b7d('0x44')]);return db['ChatMessage'][_0x7b7d('0x24')]({'where':_0x11cf09['where']})[_0x7b7d('0x28')](function(_0x42adb7){_0x148e26[_0x7b7d('0x24')]=_0x42adb7;if(_0x477e9e['query'][_0x7b7d('0x41')]){_0x11cf09[_0x7b7d('0x42')]=[{'all':!![]}];}return db[_0x7b7d('0x5c')][_0x7b7d('0x34')](_0x11cf09);})['then'](function(_0x5b051){_0x148e26[_0x7b7d('0x9f')]=_0x5b051;return _0x148e26;});}})[_0x7b7d('0x28')](respondWithFilteredResult(_0x122891,_0x11cf09))[_0x7b7d('0x1e')](handleError(_0x122891,null));};exports[_0x7b7d('0xa0')]=function(_0x2f0660,_0x8bfc47){var _0x3812ec={'where':{}},_0x210745={},_0x52edd1={'count':0x0,'rows':[]};return db[_0x7b7d('0x31')][_0x7b7d('0x49')]({'where':{'id':_0x2f0660[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x8bfc47,null))[_0x7b7d('0x28')](function(_0x362332){if(_0x362332){_0x210745['model']=_['keys'](db['ChatMessage'][_0x7b7d('0x3a')]);_0x210745[_0x7b7d('0x3b')]=_[_0x7b7d('0x39')](_0x2f0660['query']);_0x210745['filters']=_['intersection'](_0x210745[_0x7b7d('0x38')],_0x210745[_0x7b7d('0x3b')]);_0x3812ec[_0x7b7d('0x3d')]=_[_0x7b7d('0x3e')](_0x210745[_0x7b7d('0x38')],qs[_0x7b7d('0x3f')](_0x2f0660[_0x7b7d('0x3b')][_0x7b7d('0x3f')]));_0x3812ec['attributes']=_0x3812ec[_0x7b7d('0x3d')][_0x7b7d('0x40')]?_0x3812ec[_0x7b7d('0x3d')]:_0x210745[_0x7b7d('0x38')];if(!_0x2f0660[_0x7b7d('0x3b')]['hasOwnProperty']('nolimit')){_0x3812ec[_0x7b7d('0x25')]=qs['limit'](_0x2f0660[_0x7b7d('0x3b')][_0x7b7d('0x25')]);_0x3812ec[_0x7b7d('0x22')]=qs['offset'](_0x2f0660['query']['offset']);}_0x3812ec[_0x7b7d('0x96')]=qs['sort'](_0x2f0660['query']['sort']);_0x3812ec[_0x7b7d('0x99')]=qs[_0x7b7d('0x3c')](_[_0x7b7d('0x98')](_0x2f0660[_0x7b7d('0x3b')],_0x210745[_0x7b7d('0x3c')]));_0x3812ec['where']['ChatInteractionId']=_0x362332['id'];if(_0x2f0660[_0x7b7d('0x3b')]['filter']){_0x3812ec[_0x7b7d('0x99')]=_[_0x7b7d('0x43')](_0x3812ec[_0x7b7d('0x99')],{'$or':_[_0x7b7d('0x30')](_0x3812ec[_0x7b7d('0x3d')],function(_0x499e8b){var _0xa4d7eb={};_0xa4d7eb[_0x499e8b]={'$like':'%'+_0x2f0660[_0x7b7d('0x3b')][_0x7b7d('0x9b')]+'%'};return _0xa4d7eb;})});}_0x3812ec['where']['secret']=![];if(_0x2f0660[_0x7b7d('0x3b')]['id']){_0x3812ec[_0x7b7d('0x99')]['id']={'$gt':_0x2f0660[_0x7b7d('0x3b')]['id']};}_0x3812ec=_['merge']({},_0x3812ec,_0x2f0660[_0x7b7d('0x44')]);return db[_0x7b7d('0x5c')][_0x7b7d('0x24')]({'where':_0x3812ec[_0x7b7d('0x99')]})['then'](function(_0x11092b){_0x52edd1[_0x7b7d('0x24')]=_0x11092b;_0x3812ec[_0x7b7d('0x42')]=[];if(_0x2f0660[_0x7b7d('0x3b')]['includeAgent']){_0x3812ec[_0x7b7d('0x42')]['push']({'model':db['User'],'as':_0x7b7d('0x79'),'attributes':['id','fullname',_0x7b7d('0x82')]});}if(_0x2f0660['query']['includeAll']){_0x3812ec[_0x7b7d('0x42')]=[{'all':!![]}];}return db[_0x7b7d('0x5c')]['findAll'](_0x3812ec);})['then'](function(_0x37c357){_0x52edd1[_0x7b7d('0x9f')]=_0x37c357;return _0x52edd1;});}})[_0x7b7d('0x28')](respondWithFilteredResult(_0x8bfc47,_0x3812ec))[_0x7b7d('0x1e')](handleError(_0x8bfc47,null));};exports['addTags']=function(_0x142f05,_0x4ee027){return db['ChatInteraction']['find']({'where':{'id':_0x142f05[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x4ee027,null))[_0x7b7d('0x28')](function(_0x6f82be){if(_0x6f82be){return _0x6f82be[_0x7b7d('0xa1')](_0x142f05[_0x7b7d('0x2e')][_0x7b7d('0x91')],_[_0x7b7d('0x92')](_0x142f05[_0x7b7d('0x2e')],[_0x7b7d('0x91'),'id'])||{})[_0x7b7d('0xa2')](function(){return db['Tag'][_0x7b7d('0x34')]({'attributes':['id',_0x7b7d('0x2c'),_0x7b7d('0xa3')],'where':{'id':_0x142f05[_0x7b7d('0x2e')][_0x7b7d('0x91')]}});})[_0x7b7d('0x28')](function(_0x23acbd){socket[_0x7b7d('0xa4')](_0x7b7d('0xa5'),{'id':Number(_0x142f05[_0x7b7d('0x37')]['id']),'tags':_0x23acbd||[]});return{'id':Number(_0x142f05[_0x7b7d('0x37')]['id']),'tags':_0x23acbd||[]};});}})[_0x7b7d('0x28')](respondWithResult(_0x4ee027,null))[_0x7b7d('0x1e')](handleError(_0x4ee027,null));};exports['removeTags']=function(_0x1af421,_0x3dd452){return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x1af421[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x3dd452,null))['then'](function(_0x427c3e){if(_0x427c3e){return _0x427c3e['removeTags'](_0x1af421['query']['ids']);}})['then'](respondWithStatusCode(_0x3dd452,null))[_0x7b7d('0x1e')](handleError(_0x3dd452,null));};exports[_0x7b7d('0x74')]=function(_0x4e36c9,_0x489e5a){var _0x4587f1=moment()[_0x7b7d('0xa6')]()[_0x7b7d('0xa7')]();var _0x4dbccf=path[_0x7b7d('0x73')](config[_0x7b7d('0xa8')],_0x7b7d('0xa9'),_0x7b7d('0xaa'),'tmp');var _0x53f279=path[_0x7b7d('0x73')](config[_0x7b7d('0xa8')],_0x7b7d('0xa9'),_0x7b7d('0xaa'),_0x7b7d('0xab'));var _0x488386=path[_0x7b7d('0x73')](_0x4dbccf,_0x4587f1);var _0x32bc47=util[_0x7b7d('0x77')]('transcript-%d-%s.zip',_0x4e36c9[_0x7b7d('0x37')]['id'],_0x4587f1);var _0x5791bc=path[_0x7b7d('0x73')](_0x4dbccf,_0x32bc47);var _0x2336a1=[];_0x2336a1[_0x7b7d('0xac')]({'model':db[_0x7b7d('0x79')],'as':'User','attributes':['id',_0x7b7d('0xad')],'raw':!![]});_0x2336a1[_0x7b7d('0xac')]({'model':db['CmContact'],'as':_0x7b7d('0x61'),'attributes':['id','firstName',_0x7b7d('0xae')],'raw':!![]});if(_0x4e36c9['query'][_0x7b7d('0xab')]){_0x2336a1[_0x7b7d('0xac')]({'model':db[_0x7b7d('0x6e')],'as':_0x7b7d('0x6e'),'raw':!![]});}var _0x1d61d2=[{'model':db[_0x7b7d('0x5c')],'as':_0x7b7d('0xaf'),'attributes':['id','body',_0x7b7d('0x85'),_0x7b7d('0x87'),_0x7b7d('0xb0'),_0x7b7d('0xb1')],'include':_0x2336a1}];_0x1d61d2[_0x7b7d('0xac')]({'model':db['ChatWebsite'],'as':_0x7b7d('0xb2'),'attributes':['id',_0x7b7d('0x2c')]});_0x1d61d2[_0x7b7d('0xac')]({'model':db[_0x7b7d('0x79')],'as':_0x7b7d('0xb3'),'attributes':['id',_0x7b7d('0xad')]});return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x4e36c9[_0x7b7d('0x37')]['id']},'include':_0x1d61d2})['then'](handleEntityNotFound(_0x489e5a,null))['then'](function(_0x55c73c){if(_0x55c73c){var _0x3cac80=_0x55c73c[_0x7b7d('0xb4')]({'plain':!![]});fs['mkdirSync'](_0x488386);var _0x3e4211={'channel':_0x7b7d('0xb5'),'account':_0x3cac80[_0x7b7d('0xb2')]['name'],'agent':_0x3cac80[_0x7b7d('0xb3')]?_0x3cac80[_0x7b7d('0xb3')][_0x7b7d('0xad')]:'N.A.','createdAt':moment(_0x3cac80[_0x7b7d('0x85')])['format'](_0x7b7d('0x9e'))[_0x7b7d('0xa7')](),'closedAt':_0x3cac80['closed']?moment(_0x3cac80[_0x7b7d('0xb6')])[_0x7b7d('0x77')](_0x7b7d('0x9e'))[_0x7b7d('0xa7')]():'','disposition':_0x3cac80[_0x7b7d('0xb7')],'chatInfo':{'browser':_0x3cac80[_0x7b7d('0xb8')],'os':_0x3cac80[_0x7b7d('0xb9')],'referer':_0x3cac80[_0x7b7d('0xba')],'customerIp':_0x3cac80[_0x7b7d('0xbb')],'customerPort':_0x3cac80['customerPort']?_0x3cac80['customerPort']:_0x7b7d('0xbc')},'messages':_(_0x3cac80['Messages'])['tail']()[_0x7b7d('0x9b')]({'secret':![]})['map'](function(_0x564088){if(_0x564088[_0x7b7d('0x6e')]){var _0x56a72d=path['join'](_0x53f279,_0x564088[_0x7b7d('0x6e')][_0x7b7d('0x6b')]);if(fs[_0x7b7d('0xbd')](_0x56a72d)){fs['createReadStream'](_0x56a72d)[_0x7b7d('0xbe')](fs[_0x7b7d('0xbf')](path['join'](_0x488386,_0x564088[_0x7b7d('0x6e')]['basename'])));}}return{'date':moment(_0x564088['createdAt'])[_0x7b7d('0x77')](_0x7b7d('0x9e'))[_0x7b7d('0xa7')](),'sender':_0x564088['direction']===_0x7b7d('0xc0')?_0x564088[_0x7b7d('0x79')]?_0x564088[_0x7b7d('0x79')][_0x7b7d('0xad')]:'System':_0x564088[_0x7b7d('0x61')]['firstName']+(_0x564088[_0x7b7d('0x61')][_0x7b7d('0xae')]?'\x20'+_0x564088[_0x7b7d('0x61')]['lastName']:''),'body':_0x564088[_0x7b7d('0x6e')]?_0x564088[_0x7b7d('0x6e')][_0x7b7d('0x6b')]:_0x564088[_0x7b7d('0x2e')],'direction':_0x564088['direction']===_0x7b7d('0xc0')?'A':'C','secret':_0x564088[_0x7b7d('0xb0')],'read':_0x564088['read'],'attachment':_0x564088['Attachment']};})[_0x7b7d('0xc1')]()};return ejs['renderFile'](path[_0x7b7d('0x73')](config[_0x7b7d('0xa8')],'server',_0x7b7d('0xc2'),_0x7b7d('0xc3')),{'interaction':_0x3e4211})['then'](function(_0x6cb19e){var _0x2c58f2=path[_0x7b7d('0x73')](_0x488386,'transcript-'+_0x3cac80['id']+'-'+_0x4587f1+_0x7b7d('0xc4'));var _0x1de930={'path':_0x2c58f2,'channel':_0x7b7d('0xb5'),'interactionId':_0x3cac80['id']};return pdf[_0x7b7d('0xc5')](_0x6cb19e,_0x1de930);})['then'](function(){return new Promise(function(_0x56580c,_0x3052f7){zipdir(_0x488386,{'saveTo':_0x5791bc},function(_0x4b5721,_0x21190b){if(_0x4b5721)return _0x3052f7(_0x4b5721);return _0x56580c(_0x21190b);});})[_0x7b7d('0x28')](function(){return new BPromise(function(_0x3128d7,_0x56ebd9){rimraf(_0x488386,function(_0x1a9943){if(_0x1a9943)_0x56ebd9(_0x1a9943);return _0x3128d7();});});})[_0x7b7d('0x28')](function(){return _0x489e5a[_0x7b7d('0x74')](_0x5791bc,_0x32bc47,function(_0x3ce239){if(_0x3ce239){logger['error'](_0x7b7d('0xc6'),_0x3ce239);}else{fs[_0x7b7d('0xc7')](_0x5791bc);}});});});}else{return _0x489e5a[_0x7b7d('0x2a')](0xc8);}})['catch'](handleError(_0x489e5a,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index d58edf6..35a5c8f 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 _0x2c67=['then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x2c67,0x81));var _0x72c6=function(_0x26b090,_0x129196){_0x26b090=_0x26b090-0x0;var _0x1e488a=_0x2c67[_0x26b090];return _0x1e488a;};'use strict';var EventEmitter=require(_0x72c6('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x72c6('0x1'))['db'][_0x72c6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x72c6('0x3')](0x0);var events={'afterCreate':_0x72c6('0x4'),'afterUpdate':_0x72c6('0x5'),'afterDestroy':_0x72c6('0x6')};function emitEvent(_0x5be971){return function(_0x1f2acb,_0x2136c2,_0x1d65a3){_0x1f2acb['getUsers']({'attributes':['id'],'raw':!![]})[_0x72c6('0x7')](function(_0x206693){_0x1f2acb[_0x72c6('0x8')](_0x72c6('0x9'),_0x206693[_0x72c6('0xa')](function(_0x534611){return{'id':_0x534611['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1f2acb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x9802aa){_0x1f2acb[_0x72c6('0x8')](_0x72c6('0xb'),_0x9802aa[_0x72c6('0xc')]);ChatInteractionEvents[_0x72c6('0xd')](_0x5be971+':'+_0x1f2acb['id'],_0x1f2acb);ChatInteractionEvents[_0x72c6('0xd')](_0x5be971,_0x1f2acb);_0x1d65a3(null);})[_0x72c6('0xe')](_0x1d65a3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x72c6('0xf')](e,emitEvent(event));}}module[_0x72c6('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x3df6=['exports','../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hook'];(function(_0x46e76c,_0x40dad9){var _0x47f72a=function(_0x3d1802){while(--_0x3d1802){_0x46e76c['push'](_0x46e76c['shift']());}};_0x47f72a(++_0x40dad9);}(_0x3df6,0x13c));var _0x63df=function(_0x3f911c,_0x1441cf){_0x3f911c=_0x3f911c-0x0;var _0x25c459=_0x3df6[_0x3f911c];return _0x25c459;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x63df('0x0'))['db'][_0x63df('0x1')];var ChatMessage=require(_0x63df('0x0'))['db'][_0x63df('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63df('0x3'),'afterUpdate':'update','afterDestroy':_0x63df('0x4')};function emitEvent(_0x1970fd){return function(_0x3a5cab,_0x1bd3f8,_0x3defa0){_0x3a5cab[_0x63df('0x5')]({'attributes':['id'],'raw':!![]})[_0x63df('0x6')](function(_0x13c4e1){_0x3a5cab[_0x63df('0x7')](_0x63df('0x8'),_0x13c4e1[_0x63df('0x9')](function(_0x28fdb7){return{'id':_0x28fdb7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3a5cab['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x110e84){_0x3a5cab[_0x63df('0x7')](_0x63df('0xa'),_0x110e84['length']);ChatInteractionEvents[_0x63df('0xb')](_0x1970fd+':'+_0x3a5cab['id'],_0x3a5cab);ChatInteractionEvents[_0x63df('0xb')](_0x1970fd,_0x3a5cab);_0x3defa0(null);})[_0x63df('0xc')](_0x3defa0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x63df('0xd')](e,emitEvent(event));}}module[_0x63df('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f844eb7..3bd2063 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 _0x8066=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatInteraction','changed','closed'];(function(_0x42dcbb,_0x3bab87){var _0x597f5d=function(_0x3c93c6){while(--_0x3c93c6){_0x42dcbb['push'](_0x42dcbb['shift']());}};_0x597f5d(++_0x3bab87);}(_0x8066,0xe5));var _0x6806=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8066[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x6806('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6806('0x1'));var moment=require(_0x6806('0x2'));var BPromise=require(_0x6806('0x3'));var rp=require(_0x6806('0x4'));var fs=require('fs');var path=require(_0x6806('0x5'));var rimraf=require('rimraf');var config=require(_0x6806('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x6806('0x7')]=function(_0x43b08b,_0x3ed9c3){return _0x43b08b['define'](_0x6806('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2eba39,_0x4831de,_0x58edc8){if(_0x2eba39[_0x6806('0x9')](_0x6806('0xa'))){_0x2eba39[_0x6806('0xb')]=moment()[_0x6806('0xc')](_0x6806('0xd'));}_0x58edc8(null,_0x2eba39);}},'charset':_0x6806('0xe'),'collate':_0x6806('0xf')});}; \ No newline at end of file +var _0xab8c=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0xab8c,0x174));var _0xcab8=function(_0x4c1239,_0x57921a){_0x4c1239=_0x4c1239-0x0;var _0x5c843a=_0xab8c[_0x4c1239];return _0x5c843a;};'use strict';var _=require(_0xcab8('0x0'));var util=require(_0xcab8('0x1'));var logger=require(_0xcab8('0x2'))(_0xcab8('0x3'));var moment=require(_0xcab8('0x4'));var BPromise=require(_0xcab8('0x5'));var rp=require(_0xcab8('0x6'));var fs=require('fs');var path=require(_0xcab8('0x7'));var rimraf=require(_0xcab8('0x8'));var config=require(_0xcab8('0x9'));var attributes=require(_0xcab8('0xa'));module[_0xcab8('0xb')]=function(_0x196eab,_0x1366eb){return _0x196eab[_0xcab8('0xc')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fbf1f,_0x1d3744,_0x27276d){if(_0x3fbf1f[_0xcab8('0xd')]('closed')){_0x3fbf1f[_0xcab8('0xe')]=moment()['format'](_0xcab8('0xf'));}_0x27276d(null,_0x3fbf1f);}},'charset':_0xcab8('0x10'),'collate':_0xcab8('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 7ca5c80..a1579aa 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 _0x2665=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','update','body','options','where','attributes','AddTagsToChatInteraction','ChatInteraction','find','addTags','omit','ids','AddTags','lodash','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2665,0x1d1));var _0x5266=function(_0x5cb488,_0x92f6c7){_0x5cb488=_0x5cb488-0x0;var _0x2270d1=_0x2665[_0x5cb488];return _0x2270d1;};'use strict';var _=require(_0x5266('0x0'));var util=require('util');var moment=require(_0x5266('0x1'));var BPromise=require(_0x5266('0x2'));var rs=require(_0x5266('0x3'));var fs=require('fs');var Redis=require(_0x5266('0x4'));var db=require(_0x5266('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5266('0x6'))(_0x5266('0x7'));var config=require(_0x5266('0x8'));var jayson=require(_0x5266('0x9'));var client=jayson[_0x5266('0xa')]['http']({'port':0x232a});config[_0x5266('0xb')]=_['defaults'](config[_0x5266('0xb')],{'host':_0x5266('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5266('0xb')]));require(_0x5266('0xd'))[_0x5266('0xe')](socket);function respondWithRpcPromise(_0x313874,_0x149ab6,_0x5b1fc1){return new BPromise(function(_0x2b69e8,_0x267a00){return client[_0x5266('0xf')](_0x313874,_0x5b1fc1)[_0x5266('0x10')](function(_0xb3b1ca){logger[_0x5266('0x11')](_0x5266('0x12'),_0x149ab6,_0x5266('0x13'));logger[_0x5266('0x14')](_0x5266('0x15'),_0x149ab6,_0x5266('0x13'),JSON[_0x5266('0x16')](_0xb3b1ca));if(_0xb3b1ca['error']){if(_0xb3b1ca['error']['code']===0x1f4){logger[_0x5266('0x17')](_0x5266('0x12'),_0x149ab6,_0xb3b1ca['error'][_0x5266('0x18')]);return _0x267a00(_0xb3b1ca[_0x5266('0x17')]['message']);}logger[_0x5266('0x17')](_0x5266('0x12'),_0x149ab6,_0xb3b1ca['error']['message']);return _0x2b69e8(_0xb3b1ca[_0x5266('0x17')][_0x5266('0x18')]);}else{logger[_0x5266('0x11')](_0x5266('0x12'),_0x149ab6,_0x5266('0x13'));_0x2b69e8(_0xb3b1ca['result'][_0x5266('0x18')]);}})[_0x5266('0x19')](function(_0x3fff7f){logger['error'](_0x5266('0x12'),_0x149ab6,_0x3fff7f);_0x267a00(_0x3fff7f);});});}exports[_0x5266('0x1a')]=function(_0x3a8b09){var _0x4c4c1f=this;return new Promise(function(_0x5d2c8f,_0x1ed79a){return db['ChatInteraction'][_0x5266('0x1b')](_0x3a8b09[_0x5266('0x1c')],{'raw':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09[_0x5266('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09['options'][_0x5266('0x1e')]||null:null,'attributes':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09[_0x5266('0x1d')][_0x5266('0x1f')]||null:null,'limit':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09['options']['limit']||null:null})[_0x5266('0x10')](function(_0x3fed6c){logger[_0x5266('0x11')]('UpdateChatInteraction',_0x3a8b09);logger['debug'](_0x5266('0x1a'),_0x3a8b09,JSON[_0x5266('0x16')](_0x3fed6c));_0x5d2c8f(_0x3fed6c);})[_0x5266('0x19')](function(_0x15ddbf){logger[_0x5266('0x17')](_0x5266('0x1a'),_0x15ddbf[_0x5266('0x18')],_0x3a8b09);_0x1ed79a(_0x4c4c1f['error'](0x1f4,_0x15ddbf[_0x5266('0x18')]));});});};exports[_0x5266('0x20')]=function(_0x42aa34){return new Promise(function(_0x575662,_0x28aea5){return db[_0x5266('0x21')][_0x5266('0x22')]({'where':_0x42aa34[_0x5266('0x1d')]?_0x42aa34[_0x5266('0x1d')]['where']||null:null})[_0x5266('0x10')](function(_0x474831){if(_0x474831){return _0x474831[_0x5266('0x23')](_0x42aa34['body']['ids'],_[_0x5266('0x24')](_0x42aa34[_0x5266('0x1c')],[_0x5266('0x25'),'id'])||{});}})['spread'](function(_0x13244e){logger[_0x5266('0x11')](_0x5266('0x26'),_0x42aa34);logger['debug'](_0x5266('0x26'),_0x42aa34,JSON[_0x5266('0x16')](_0x13244e));_0x575662(_0x13244e);})[_0x5266('0x19')](function(_0x331af2){logger['error'](_0x5266('0x26'),_0x331af2[_0x5266('0x18')],_0x42aa34);_0x28aea5(_this[_0x5266('0x17')](0x1f4,_0x331af2[_0x5266('0x18')]));});});}; \ No newline at end of file +var _0x17b4=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','request','then','info','request\x20sent'];(function(_0x1649ea,_0x422343){var _0x42787d=function(_0x22f3fb){while(--_0x22f3fb){_0x1649ea['push'](_0x1649ea['shift']());}};_0x42787d(++_0x422343);}(_0x17b4,0x89));var _0x417b=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x17b4[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x417b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x417b('0x1'));var rs=require(_0x417b('0x2'));var fs=require('fs');var Redis=require(_0x417b('0x3'));var db=require(_0x417b('0x4'))['db'];var utils=require(_0x417b('0x5'));var logger=require('../../config/logger')(_0x417b('0x6'));var config=require(_0x417b('0x7'));var jayson=require(_0x417b('0x8'));var client=jayson[_0x417b('0x9')]['http']({'port':0x232a});config[_0x417b('0xa')]=_['defaults'](config[_0x417b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2b3cc9,_0x51e32b,_0x2dd1b3){return new BPromise(function(_0x298769,_0x2d5ab9){return client[_0x417b('0xb')](_0x2b3cc9,_0x2dd1b3)[_0x417b('0xc')](function(_0xfd990f){logger[_0x417b('0xd')]('ChatInteraction,\x20%s,\x20%s',_0x51e32b,_0x417b('0xe'));logger['debug'](_0x417b('0xf'),_0x51e32b,_0x417b('0xe'),JSON[_0x417b('0x10')](_0xfd990f));if(_0xfd990f[_0x417b('0x11')]){if(_0xfd990f['error']['code']===0x1f4){logger[_0x417b('0x11')](_0x417b('0x12'),_0x51e32b,_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);return _0x2d5ab9(_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);}logger[_0x417b('0x11')](_0x417b('0x12'),_0x51e32b,_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);return _0x298769(_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);}else{logger['info'](_0x417b('0x12'),_0x51e32b,_0x417b('0xe'));_0x298769(_0xfd990f[_0x417b('0x14')][_0x417b('0x13')]);}})[_0x417b('0x15')](function(_0x4e60c4){logger[_0x417b('0x11')](_0x417b('0x12'),_0x51e32b,_0x4e60c4);_0x2d5ab9(_0x4e60c4);});});}exports[_0x417b('0x16')]=function(_0x4b4a0f){var _0x1ee16d=this;return new Promise(function(_0x2c73b7,_0x25979b){return db[_0x417b('0x17')][_0x417b('0x18')](_0x4b4a0f[_0x417b('0x19')],{'raw':_0x4b4a0f[_0x417b('0x1a')]?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b4a0f[_0x417b('0x1a')]?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1c')]||null:null,'attributes':_0x4b4a0f[_0x417b('0x1a')]?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1d')]||null:null,'limit':_0x4b4a0f['options']?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1e')]||null:null})['then'](function(_0x20c1ab){logger[_0x417b('0xd')](_0x417b('0x16'),_0x4b4a0f);logger['debug'](_0x417b('0x16'),_0x4b4a0f,JSON['stringify'](_0x20c1ab));_0x2c73b7(_0x20c1ab);})[_0x417b('0x15')](function(_0x18c455){logger[_0x417b('0x11')](_0x417b('0x16'),_0x18c455[_0x417b('0x13')],_0x4b4a0f);_0x25979b(_0x1ee16d[_0x417b('0x11')](0x1f4,_0x18c455['message']));});});};exports[_0x417b('0x1f')]=function(_0x52cc58){return new Promise(function(_0x4bf260,_0x15d5c5){return db[_0x417b('0x17')][_0x417b('0x20')]({'where':_0x52cc58[_0x417b('0x1a')]?_0x52cc58[_0x417b('0x1a')][_0x417b('0x1c')]||null:null})['then'](function(_0x32f791){if(_0x32f791){return _0x32f791[_0x417b('0x21')](_0x52cc58['body'][_0x417b('0x22')],_[_0x417b('0x23')](_0x52cc58[_0x417b('0x19')],[_0x417b('0x22'),'id'])||{});}})[_0x417b('0x24')](function(_0x505074){logger[_0x417b('0xd')](_0x417b('0x25'),_0x52cc58);logger['debug'](_0x417b('0x25'),_0x52cc58,JSON[_0x417b('0x10')](_0x505074));_0x4bf260(_0x505074);})[_0x417b('0x15')](function(_0x411483){logger[_0x417b('0x11')]('AddTags',_0x411483['message'],_0x52cc58);_0x15d5c5(_this[_0x417b('0x11')](0x1f4,_0x411483[_0x417b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 178a9aa..b8cf917 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 _0xd689=['save','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x56faeb,_0xc940de){var _0x1b96a9=function(_0x3cdf68){while(--_0x3cdf68){_0x56faeb['push'](_0x56faeb['shift']());}};_0x1b96a9(++_0xc940de);}(_0xd689,0x1cd));var _0x9d68=function(_0x305c8f,_0xc5f7fb){_0x305c8f=_0x305c8f-0x0;var _0x5ddc30=_0xd689[_0x305c8f];return _0x5ddc30;};'use strict';var ChatInteractionEvents=require(_0x9d68('0x0'));var events=[_0x9d68('0x1'),'remove',_0x9d68('0x2')];function createListener(_0x5e8ddc,_0x443d35){return function(_0x4243c8){_0x443d35[_0x9d68('0x3')](_0x5e8ddc,_0x4243c8);};}function removeListener(_0x493d93,_0x4fc29d){return function(){ChatInteractionEvents[_0x9d68('0x4')](_0x493d93,_0x4fc29d);};}exports[_0x9d68('0x5')]=function(_0x58ebd6){for(var _0x492239=0x0,_0x160f4c=events['length'];_0x492239<_0x160f4c;_0x492239++){var _0x438093=events[_0x492239];var _0x27af52=createListener(_0x9d68('0x6')+_0x438093,_0x58ebd6);ChatInteractionEvents['on'](_0x438093,_0x27af52);}}; \ No newline at end of file +var _0xe801=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x3aaac1,_0x4222b9){var _0x3e2469=function(_0x2734e3){while(--_0x2734e3){_0x3aaac1['push'](_0x3aaac1['shift']());}};_0x3e2469(++_0x4222b9);}(_0xe801,0x69));var _0x1e80=function(_0xce31d3,_0x271f26){_0xce31d3=_0xce31d3-0x0;var _0x3fb648=_0xe801[_0xce31d3];return _0x3fb648;};'use strict';var ChatInteractionEvents=require(_0x1e80('0x0'));var events=[_0x1e80('0x1'),_0x1e80('0x2'),_0x1e80('0x3')];function createListener(_0x4a0db2,_0x50359e){return function(_0x28049f){_0x50359e[_0x1e80('0x4')](_0x4a0db2,_0x28049f);};}function removeListener(_0x68e655,_0x41ee15){return function(){ChatInteractionEvents[_0x1e80('0x5')](_0x68e655,_0x41ee15);};}exports[_0x1e80('0x6')]=function(_0x5d93a7){for(var _0x27b027=0x0,_0x26d5f0=events['length'];_0x27b027<_0x26d5f0;_0x27b027++){var _0x566744=events[_0x27b027];var _0x4893d6=createListener(_0x1e80('0x7')+_0x566744,_0x5d93a7);ChatInteractionEvents['on'](_0x566744,_0x4893d6);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index e534762..61d71ab 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 _0x916c=['chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','removeTags','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','get','/:id/my_messages','getMyMessages','/:id/download','create','post','createVidaooSession','diskStorage','root','format','%s-%s','originalname','single','file','/:id/messages','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x916c,0x152));var _0xc916=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0x916c[_0x2df1f2];return _0x38652b;};'use strict';var multer=require(_0xc916('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc916('0x1'));var express=require('express');var router=express[_0xc916('0x2')]();var fs_extra=require(_0xc916('0x3'));var auth=require(_0xc916('0x4'));var interaction=require(_0xc916('0x5'));var config=require('../../config/environment');var controller=require(_0xc916('0x6'));router['get']('/',auth[_0xc916('0x7')](),controller[_0xc916('0x8')]);router['get'](_0xc916('0x9'),auth[_0xc916('0x7')](),controller[_0xc916('0xa')]);router['get'](_0xc916('0xb'),auth[_0xc916('0xc')](),controller[_0xc916('0xd')]);router['get']('/:id/attachment_download',auth[_0xc916('0xc')](),controller[_0xc916('0xe')]);router['get']('/:id/messages',auth[_0xc916('0x7')](),controller[_0xc916('0xf')]);router[_0xc916('0x10')](_0xc916('0x11'),auth[_0xc916('0xc')](),controller[_0xc916('0x12')]);router[_0xc916('0x10')](_0xc916('0x13'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xc916('0x14')]);router[_0xc916('0x15')]('/:id/vidaoo',auth[_0xc916('0x7')](),controller[_0xc916('0x16')]);var upload=multer({'storage':multer[_0xc916('0x17')]({'destination':function(_0x312a19,_0x3730f1,_0x49a95d){_0x49a95d(null,path['join'](config[_0xc916('0x18')],'server/files/attachments/'));},'filename':function(_0x5a142b,_0x3ff957,_0x3868cf){_0x3868cf(null,util[_0xc916('0x19')](_0xc916('0x1a'),Date['now'](),_0x3ff957[_0xc916('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc916('0x15')]('/:id/attachment_upload',upload[_0xc916('0x1c')](_0xc916('0x1d')),controller['attachmentUpload']);router[_0xc916('0x15')](_0xc916('0x1e'),auth[_0xc916('0xc')](),controller[_0xc916('0x1f')]);router['post'](_0xc916('0x20'),auth[_0xc916('0x7')](),interaction['tracked']('chat',_0xc916('0x21')),controller[_0xc916('0x22')]);router[_0xc916('0x23')](_0xc916('0xb'),auth['isAuthenticated'](),interaction[_0xc916('0x24')](_0xc916('0x25'),_0xc916('0x26')),controller[_0xc916('0x27')]);router[_0xc916('0x23')]('/:id/custom_update',controller[_0xc916('0x28')]);router[_0xc916('0x23')](_0xc916('0x29'),auth[_0xc916('0xc')](),controller[_0xc916('0x2a')]);router['put'](_0xc916('0x2b'),controller['close']);router['delete'](_0xc916('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xc916('0x25'),_0xc916('0x2c')),controller['destroy']);router['delete'](_0xc916('0x20'),auth[_0xc916('0x7')](),controller[_0xc916('0x2d')]);module[_0xc916('0x2e')]=router; \ No newline at end of file +var _0x894f=['file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','root','%s-%s','now','originalname','/:id/attachment_upload','single'];(function(_0x107abb,_0x4d0688){var _0x4c746c=function(_0x1750b4){while(--_0x1750b4){_0x107abb['push'](_0x107abb['shift']());}};_0x4c746c(++_0x4d0688);}(_0x894f,0xd5));var _0xf894=function(_0x3ffaf7,_0x503a5a){_0x3ffaf7=_0x3ffaf7-0x0;var _0x172e99=_0x894f[_0x3ffaf7];return _0x172e99;};'use strict';var multer=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var path=require(_0xf894('0x2'));var timeout=require(_0xf894('0x3'));var express=require(_0xf894('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf894('0x5'));var interaction=require(_0xf894('0x6'));var config=require(_0xf894('0x7'));var controller=require(_0xf894('0x8'));router[_0xf894('0x9')]('/',auth[_0xf894('0xa')](),controller[_0xf894('0xb')]);router[_0xf894('0x9')](_0xf894('0xc'),auth[_0xf894('0xa')](),controller[_0xf894('0xd')]);router[_0xf894('0x9')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0xf894('0xe')]);router[_0xf894('0x9')](_0xf894('0xf'),auth[_0xf894('0x10')](),controller[_0xf894('0x11')]);router[_0xf894('0x9')](_0xf894('0x12'),auth[_0xf894('0xa')](),controller[_0xf894('0x13')]);router[_0xf894('0x9')](_0xf894('0x14'),auth[_0xf894('0x10')](),controller[_0xf894('0x15')]);router[_0xf894('0x9')](_0xf894('0x16'),auth[_0xf894('0xa')](),controller['download']);router[_0xf894('0x17')]('/',auth[_0xf894('0xa')](),controller['create']);router[_0xf894('0x17')](_0xf894('0x18'),auth[_0xf894('0xa')](),controller[_0xf894('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xcc4a0c,_0x2a6475,_0x55187f){_0x55187f(null,path['join'](config[_0xf894('0x1a')],'server/files/attachments/'));},'filename':function(_0xa442db,_0x583951,_0x482aab){_0x482aab(null,util['format'](_0xf894('0x1b'),Date[_0xf894('0x1c')](),_0x583951[_0xf894('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf894('0x1e'),upload[_0xf894('0x1f')](_0xf894('0x20')),controller[_0xf894('0x21')]);router[_0xf894('0x17')](_0xf894('0x12'),auth[_0xf894('0x10')](),controller[_0xf894('0x22')]);router[_0xf894('0x17')]('/:id/tags',auth[_0xf894('0xa')](),interaction[_0xf894('0x23')](_0xf894('0x24'),_0xf894('0x25')),controller['addTags']);router[_0xf894('0x26')](_0xf894('0x27'),auth[_0xf894('0xa')](),interaction['tracked']('chat',_0xf894('0x28')),controller[_0xf894('0x29')]);router[_0xf894('0x26')](_0xf894('0x2a'),controller[_0xf894('0x2b')]);router[_0xf894('0x26')]('/:id/abandon',auth[_0xf894('0x10')](),controller['abandon']);router[_0xf894('0x26')]('/:id/close',controller['close']);router[_0xf894('0x2c')](_0xf894('0x27'),auth[_0xf894('0xa')](),interaction[_0xf894('0x23')](_0xf894('0x24'),'chatinteraction:destroy'),controller[_0xf894('0x2d')]);router['delete'](_0xf894('0x2e'),auth[_0xf894('0xa')](),controller[_0xf894('0x2f')]);module[_0xf894('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 6d1fe01..ac4a00e 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 _0x2354=['exports','TEXT','medium','INTEGER'];(function(_0x5d124d,_0x2b5378){var _0x99203=function(_0x1c339e){while(--_0x1c339e){_0x5d124d['push'](_0x5d124d['shift']());}};_0x99203(++_0x2b5378);}(_0x2354,0x84));var _0x4235=function(_0x63ba8,_0x5b4583){_0x63ba8=_0x63ba8-0x0;var _0x93620c=_0x2354[_0x63ba8];return _0x93620c;};'use strict';var Sequelize=require('sequelize');module[_0x4235('0x0')]={'body':{'type':Sequelize[_0x4235('0x1')](_0x4235('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4235('0x3')]}}; \ No newline at end of file +var _0xd95d=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd95d,0x16e));var _0xdd95=function(_0x3adb1e,_0x2145b0){_0x3adb1e=_0x3adb1e-0x0;var _0xe5dba9=_0xd95d[_0x3adb1e];return _0xe5dba9;};'use strict';var Sequelize=require(_0xdd95('0x0'));module[_0xdd95('0x1')]={'body':{'type':Sequelize[_0xdd95('0x2')](_0xdd95('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdd95('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdd95('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 61dd431..fefc494 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 _0xad5a=['lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','messages','createdAt','lastMessageAt','format'];(function(_0x8d7430,_0x503f1c){var _0x51797b=function(_0x319a74){while(--_0x319a74){_0x8d7430['push'](_0x8d7430['shift']());}};_0x51797b(++_0x503f1c);}(_0xad5a,0x91));var _0xaad5=function(_0x176a00,_0x421b0e){_0x176a00=_0x176a00-0x0;var _0x1f2c82=_0xad5a[_0x176a00];return _0x1f2c82;};'use strict';var emlformat=require(_0xaad5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaad5('0x1'));var jsonpatch=require(_0xaad5('0x2'));var rp=require(_0xaad5('0x3'));var moment=require(_0xaad5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaad5('0x5'));var util=require(_0xaad5('0x6'));var path=require(_0xaad5('0x7'));var sox=require(_0xaad5('0x8'));var csv=require(_0xaad5('0x9'));var ejs=require(_0xaad5('0xa'));var fs=require('fs');var fs_extra=require(_0xaad5('0xb'));var _=require('lodash');var squel=require(_0xaad5('0xc'));var crypto=require(_0xaad5('0xd'));var jsforce=require(_0xaad5('0xe'));var deskjs=require(_0xaad5('0xf'));var toCsv=require(_0xaad5('0x9'));var querystring=require(_0xaad5('0x10'));var Papa=require(_0xaad5('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaad5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaad5('0x13'));var logger=require('../../config/logger')(_0xaad5('0x14'));var utils=require(_0xaad5('0x15'));var config=require(_0xaad5('0x16'));var licenseUtil=require(_0xaad5('0x17'));var db=require(_0xaad5('0x18'))['db'];config[_0xaad5('0x19')]=_[_0xaad5('0x1a')](config[_0xaad5('0x19')],{'host':_0xaad5('0x1b'),'port':0x18eb});var socket=require(_0xaad5('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xaad5('0x1d')](socket);function respondWithStatusCode(_0x1c7501,_0x175fe9){_0x175fe9=_0x175fe9||0xcc;return function(_0x58a375){if(_0x58a375){return _0x1c7501['sendStatus'](_0x175fe9);}return _0x1c7501[_0xaad5('0x1e')](_0x175fe9)[_0xaad5('0x1f')]();};}function respondWithResult(_0x5bab1d,_0x3ac99a){_0x3ac99a=_0x3ac99a||0xc8;return function(_0x1934dd){if(_0x1934dd){return _0x5bab1d[_0xaad5('0x1e')](_0x3ac99a)[_0xaad5('0x20')](_0x1934dd);}};}function respondWithFilteredResult(_0x2187c5,_0x45a110){return function(_0x3c64d8){if(_0x3c64d8){var _0x728823=typeof _0x45a110[_0xaad5('0x21')]===_0xaad5('0x22')&&typeof _0x45a110['limit']===_0xaad5('0x22');var _0x31a0aa=_0x3c64d8['count'];var _0x25b6cd=_0x728823?0x0:_0x45a110[_0xaad5('0x21')];var _0x38dd98=_0x728823?_0x3c64d8[_0xaad5('0x23')]:_0x45a110['offset']+_0x45a110[_0xaad5('0x24')];var _0x299ec0;if(_0x38dd98>=_0x31a0aa){_0x38dd98=_0x31a0aa;_0x299ec0=0xc8;}else{_0x299ec0=0xce;}_0x2187c5[_0xaad5('0x1e')](_0x299ec0);return _0x2187c5[_0xaad5('0x25')](_0xaad5('0x26'),_0x25b6cd+'-'+_0x38dd98+'/'+_0x31a0aa)['json'](_0x3c64d8);}return null;};}function patchUpdates(_0x11e3e6){return function(_0x1af9ab){try{jsonpatch['apply'](_0x1af9ab,_0x11e3e6,!![]);}catch(_0x49458c){return BPromise[_0xaad5('0x27')](_0x49458c);}return _0x1af9ab[_0xaad5('0x28')]();};}function saveUpdates(_0x2ce312,_0x30cc5c){return function(_0x117484){if(_0x117484){return _0x117484[_0xaad5('0x29')](_0x2ce312)['then'](function(_0x161d77){return _0x161d77;});}return null;};}function removeEntity(_0x4546cc,_0x4fda48){return function(_0x2126eb){if(_0x2126eb){return _0x2126eb[_0xaad5('0x2a')]()[_0xaad5('0x2b')](function(){_0x4546cc[_0xaad5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b4a6f,_0x160376){return function(_0x1d7c93){if(!_0x1d7c93){_0x1b4a6f[_0xaad5('0x2c')](0x194);}return _0x1d7c93;};}function handleError(_0x1d0e30,_0x3e3237){_0x3e3237=_0x3e3237||0x1f4;return function(_0x1712df){logger[_0xaad5('0x2d')](_0x1712df[_0xaad5('0x2e')]);if(_0x1712df['name']){delete _0x1712df[_0xaad5('0x2f')];}_0x1d0e30[_0xaad5('0x1e')](_0x3e3237)[_0xaad5('0x30')](_0x1712df);};}exports[_0xaad5('0x31')]=function(_0x386f7f,_0x400d34){var _0x1c0dad={},_0x15efa2={},_0x495f56={'count':0x0,'rows':[]};var _0x2bc080=_['map'](db[_0xaad5('0x32')][_0xaad5('0x33')],function(_0x56f390){return{'name':_0x56f390[_0xaad5('0x34')],'type':_0x56f390[_0xaad5('0x35')]['key']};});_0x15efa2[_0xaad5('0x36')]=_[_0xaad5('0x37')](_0x2bc080,_0xaad5('0x2f'));_0x15efa2[_0xaad5('0x38')]=_[_0xaad5('0x39')](_0x386f7f[_0xaad5('0x38')]);_0x15efa2[_0xaad5('0x3a')]=_[_0xaad5('0x3b')](_0x15efa2[_0xaad5('0x36')],_0x15efa2[_0xaad5('0x38')]);_0x1c0dad[_0xaad5('0x3c')]=_[_0xaad5('0x3b')](_0x15efa2['model'],qs[_0xaad5('0x3d')](_0x386f7f[_0xaad5('0x38')]['fields']));_0x1c0dad[_0xaad5('0x3c')]=_0x1c0dad['attributes'][_0xaad5('0x3e')]?_0x1c0dad[_0xaad5('0x3c')]:_0x15efa2[_0xaad5('0x36')];if(!_0x386f7f['query'][_0xaad5('0x3f')](_0xaad5('0x40'))){_0x1c0dad[_0xaad5('0x24')]=qs[_0xaad5('0x24')](_0x386f7f[_0xaad5('0x38')][_0xaad5('0x24')]);_0x1c0dad['offset']=qs[_0xaad5('0x21')](_0x386f7f[_0xaad5('0x38')][_0xaad5('0x21')]);}_0x1c0dad['order']=qs[_0xaad5('0x41')](_0x386f7f[_0xaad5('0x38')][_0xaad5('0x41')]);_0x1c0dad['where']=qs[_0xaad5('0x3a')](_['pick'](_0x386f7f[_0xaad5('0x38')],_0x15efa2['filters']),_0x2bc080);if(_0x386f7f[_0xaad5('0x38')][_0xaad5('0x42')]){_0x1c0dad[_0xaad5('0x43')]=_[_0xaad5('0x44')](_0x1c0dad[_0xaad5('0x43')],{'$or':_[_0xaad5('0x37')](_0x2bc080,function(_0x5b083a){if(_0x5b083a[_0xaad5('0x35')]!==_0xaad5('0x45')){var _0x4eb191={};_0x4eb191[_0x5b083a[_0xaad5('0x2f')]]={'$like':'%'+_0x386f7f[_0xaad5('0x38')][_0xaad5('0x42')]+'%'};return _0x4eb191;}})});}_0x1c0dad=_[_0xaad5('0x44')]({},_0x1c0dad,_0x386f7f[_0xaad5('0x46')]);var _0x2293f8={'where':_0x1c0dad['where']};return db[_0xaad5('0x32')][_0xaad5('0x23')](_0x2293f8)[_0xaad5('0x2b')](function(_0x2fd72c){_0x495f56['count']=_0x2fd72c;if(_0x386f7f[_0xaad5('0x38')]['includeAll']){_0x1c0dad[_0xaad5('0x47')]=[{'all':!![]}];}return db[_0xaad5('0x32')][_0xaad5('0x48')](_0x1c0dad);})['then'](function(_0x55f82a){_0x495f56['rows']=_0x55f82a;return _0x495f56;})['then'](respondWithFilteredResult(_0x400d34,_0x1c0dad))[_0xaad5('0x49')](handleError(_0x400d34,null));};exports[_0xaad5('0x4a')]=function(_0xfeb2ca,_0x153745){var _0x2cd9bb={'raw':!![],'where':{'id':_0xfeb2ca[_0xaad5('0x4b')]['id']}},_0xfc29c7={};_0xfc29c7[_0xaad5('0x36')]=_[_0xaad5('0x39')](db[_0xaad5('0x32')][_0xaad5('0x33')]);_0xfc29c7[_0xaad5('0x38')]=_[_0xaad5('0x39')](_0xfeb2ca['query']);_0xfc29c7[_0xaad5('0x3a')]=_[_0xaad5('0x3b')](_0xfc29c7['model'],_0xfc29c7['query']);_0x2cd9bb['attributes']=_['intersection'](_0xfc29c7[_0xaad5('0x36')],qs['fields'](_0xfeb2ca[_0xaad5('0x38')][_0xaad5('0x3d')]));_0x2cd9bb[_0xaad5('0x3c')]=_0x2cd9bb[_0xaad5('0x3c')]['length']?_0x2cd9bb[_0xaad5('0x3c')]:_0xfc29c7['model'];if(_0xfeb2ca[_0xaad5('0x38')][_0xaad5('0x4c')]){_0x2cd9bb[_0xaad5('0x47')]=[{'all':!![]}];}_0x2cd9bb=_[_0xaad5('0x44')]({},_0x2cd9bb,_0xfeb2ca[_0xaad5('0x46')]);return db['ChatInternalMessage'][_0xaad5('0x4d')](_0x2cd9bb)[_0xaad5('0x2b')](handleEntityNotFound(_0x153745,null))['then'](respondWithResult(_0x153745,null))[_0xaad5('0x49')](handleError(_0x153745,null));};exports['create']=function(_0x45011b,_0x40262d){return db[_0xaad5('0x32')][_0xaad5('0x4e')](_0x45011b[_0xaad5('0x4f')],{})[_0xaad5('0x2b')](respondWithResult(_0x40262d,0xc9))[_0xaad5('0x49')](handleError(_0x40262d,null));};exports['update']=function(_0x193da6,_0x2cd0bc){if(_0x193da6[_0xaad5('0x4f')]['id']){delete _0x193da6[_0xaad5('0x4f')]['id'];}return db['ChatInternalMessage'][_0xaad5('0x4d')]({'where':{'id':_0x193da6[_0xaad5('0x4b')]['id']}})[_0xaad5('0x2b')](handleEntityNotFound(_0x2cd0bc,null))['then'](saveUpdates(_0x193da6[_0xaad5('0x4f')],null))[_0xaad5('0x2b')](respondWithResult(_0x2cd0bc,null))[_0xaad5('0x49')](handleError(_0x2cd0bc,null));};exports[_0xaad5('0x2a')]=function(_0x44fb29,_0x470910){return db[_0xaad5('0x32')][_0xaad5('0x4d')]({'where':{'id':_0x44fb29['params']['id']}})['then'](handleEntityNotFound(_0x470910,null))[_0xaad5('0x2b')](removeEntity(_0x470910,null))[_0xaad5('0x49')](handleError(_0x470910,null));};exports[_0xaad5('0x50')]=function(_0x579a01,_0x3bcedc){return db[_0xaad5('0x32')][_0xaad5('0x50')]()[_0xaad5('0x2b')](respondWithResult(_0x3bcedc,null))[_0xaad5('0x49')](handleError(_0x3bcedc,null));};function wrapUser(_0x298674){return function(_0x4067da){var _0x19117b=_0x298674['get']({'plain':!![]});_0x19117b[_0xaad5('0x51')]=[];if(_0x4067da){_0x19117b['lastMessageAt']=_0x4067da[_0xaad5('0x52')];_0x19117b['lastMessage']=_0x4067da;}else{_0x19117b[_0xaad5('0x53')]=moment(0x0)[_0xaad5('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x19117b[_0xaad5('0x55')]={};}return _0x19117b;};}exports[_0xaad5('0x56')]=function(_0x2d18e7,_0x18a175,_0x4452a0){var _0x12a4b7=[];return db[_0xaad5('0x57')][_0xaad5('0x48')]({'where':{'role':[_0xaad5('0x58'),_0xaad5('0x59'),_0xaad5('0x5a')]},'attributes':['id',_0xaad5('0x5b'),_0xaad5('0x2f'),_0xaad5('0x5c'),_0xaad5('0x5d'),_0xaad5('0x5e'),_0xaad5('0x5f'),_0xaad5('0x60'),'allowmessenger',_0xaad5('0x61')],'order':qs[_0xaad5('0x41')](_0xaad5('0x62')),'include':[{'model':db[_0xaad5('0x63')],'as':_0xaad5('0x64'),'attributes':['id',_0xaad5('0x2f'),_0xaad5('0x35')],'through':{'attributes':[]}}]})[_0xaad5('0x2b')](function(_0x43f6ee){if(_0x43f6ee){var _0x2737c3=_0x2d18e7[_0xaad5('0x5a')][_0xaad5('0x65')]({'plain':!![]});if(!_0x2737c3)throw new Error(_0xaad5('0x66'));if(_0x2737c3['role']===_0xaad5('0x5a')){return db[_0xaad5('0x67')][_0xaad5('0x4d')]({'where':{'name':_0xaad5('0x68'),'userProfileId':_0x2737c3[_0xaad5('0x69')]},'raw':!![]})[_0xaad5('0x2b')](function(_0x581234){if(_0x581234){if(_0x581234[_0xaad5('0x6a')]===0x0){return db[_0xaad5('0x6b')][_0xaad5('0x48')]({'where':{'sectionId':_0x581234['id']},'raw':!![]})[_0xaad5('0x2b')](function(_0x9bdff5){var _0x4cd693=[];if(_[_0xaad5('0x6c')](_0x9bdff5)){_0x4cd693=_[_0xaad5('0x42')](_0x43f6ee,function(_0x10c980){if(_0x10c980[_0xaad5('0x5c')]!==_0xaad5('0x58')){return _0x10c980;}});return _0x4cd693;}else{for(var _0x488dea=0x0;_0x488dea<_0x43f6ee[_0xaad5('0x3e')];_0x488dea++){var _0x1d4349=_0x43f6ee[_0x488dea];if(_0x1d4349[_0xaad5('0x5c')]===_0xaad5('0x58')){var _0x17a84c=_['find'](_0x9bdff5,function(_0x383de9){return _0x383de9[_0xaad5('0x6d')]===_0x1d4349['id'];});if(_0x17a84c)_0x4cd693[_0xaad5('0x6e')](_0x1d4349);}else{_0x4cd693[_0xaad5('0x6e')](_0x1d4349);}}return _0x4cd693;}});}else{return _0x43f6ee;}}else{var _0x5bf25c=_[_0xaad5('0x42')](_0x43f6ee,function(_0x5adc99){if(_0x5adc99[_0xaad5('0x5c')]!=='agent'){return _0x5adc99;}});return _0x5bf25c;}});}else{return _0x43f6ee;}}})[_0xaad5('0x2b')](function(_0x1d0c39){var _0xb998e8=[];if(_0x1d0c39){_0x12a4b7=_0x1d0c39;for(var _0x12a21a=0x0;_0x12a21a<_0x1d0c39['length'];_0x12a21a+=0x1){_0x12a4b7[_0x12a21a][_0xaad5('0x51')]=[];_0xb998e8[_0xaad5('0x6e')](db[_0xaad5('0x32')]['find']({'where':{'FromId':[_0x2d18e7[_0xaad5('0x5a')]['id'],_0x1d0c39[_0x12a21a]['id']],'ToId':[_0x2d18e7['user']['id'],_0x1d0c39[_0x12a21a]['id']],'ChatGroupId':null},'attributes':['id',_0xaad5('0x52'),_0xaad5('0x6f'),_0xaad5('0x70'),'read',_0xaad5('0x4f')],'order':qs['sort'](_0xaad5('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xaad5('0x2b')](wrapUser(_0x1d0c39[_0x12a21a])));}return BPromise[_0xaad5('0x72')](_0xb998e8);}return[];})['then'](function(_0x212e5e){return{'rows':_0x212e5e,'count':_0x212e5e[_0xaad5('0x3e')]};})[_0xaad5('0x2b')](respondWithResult(_0x18a175,null))[_0xaad5('0x49')](handleError(_0x18a175,null));}; \ No newline at end of file +var _0x5e4a=['params','rawAttributes','catch','create','body','find','describe','messages','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','fullname','role','userpic','online','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','createdAt','FromId','ToId','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','ChatInternalMessage','findAll','rows'];(function(_0xe503ff,_0xc9e5e4){var _0x345c46=function(_0x3f6bc7){while(--_0x3f6bc7){_0xe503ff['push'](_0xe503ff['shift']());}};_0x345c46(++_0xc9e5e4);}(_0x5e4a,0xf3));var _0xa5e4=function(_0x5a42b2,_0x49e23f){_0x5a42b2=_0x5a42b2-0x0;var _0x6fa38d=_0x5e4a[_0x5a42b2];return _0x6fa38d;};'use strict';var emlformat=require(_0xa5e4('0x0'));var rimraf=require(_0xa5e4('0x1'));var zipdir=require(_0xa5e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5e4('0x3'));var moment=require(_0xa5e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5e4('0x5'));var util=require(_0xa5e4('0x6'));var path=require('path');var sox=require(_0xa5e4('0x7'));var csv=require(_0xa5e4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5e4('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa5e4('0xa'));var jsforce=require(_0xa5e4('0xb'));var deskjs=require(_0xa5e4('0xc'));var toCsv=require(_0xa5e4('0x8'));var querystring=require(_0xa5e4('0xd'));var Papa=require('papaparse');var Redis=require(_0xa5e4('0xe'));var authService=require(_0xa5e4('0xf'));var qs=require(_0xa5e4('0x10'));var as=require(_0xa5e4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa5e4('0x12'));var utils=require(_0xa5e4('0x13'));var config=require(_0xa5e4('0x14'));var licenseUtil=require(_0xa5e4('0x15'));var db=require(_0xa5e4('0x16'))['db'];config['redis']=_[_0xa5e4('0x17')](config[_0xa5e4('0x18')],{'host':_0xa5e4('0x19'),'port':0x18eb});var socket=require(_0xa5e4('0x1a'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xa5e4('0x1b')](socket);function respondWithStatusCode(_0xe84edd,_0x2a6440){_0x2a6440=_0x2a6440||0xcc;return function(_0x4a79bc){if(_0x4a79bc){return _0xe84edd['sendStatus'](_0x2a6440);}return _0xe84edd[_0xa5e4('0x1c')](_0x2a6440)['end']();};}function respondWithResult(_0x533a52,_0x4a5416){_0x4a5416=_0x4a5416||0xc8;return function(_0x3bd692){if(_0x3bd692){return _0x533a52[_0xa5e4('0x1c')](_0x4a5416)[_0xa5e4('0x1d')](_0x3bd692);}};}function respondWithFilteredResult(_0x1901f6,_0x165fa3){return function(_0x164a21){if(_0x164a21){var _0x51ebee=typeof _0x165fa3['offset']===_0xa5e4('0x1e')&&typeof _0x165fa3[_0xa5e4('0x1f')]===_0xa5e4('0x1e');var _0x176b21=_0x164a21[_0xa5e4('0x20')];var _0x1d3622=_0x51ebee?0x0:_0x165fa3[_0xa5e4('0x21')];var _0x2c957a=_0x51ebee?_0x164a21[_0xa5e4('0x20')]:_0x165fa3[_0xa5e4('0x21')]+_0x165fa3['limit'];var _0x26185b;if(_0x2c957a>=_0x176b21){_0x2c957a=_0x176b21;_0x26185b=0xc8;}else{_0x26185b=0xce;}_0x1901f6[_0xa5e4('0x1c')](_0x26185b);return _0x1901f6['set'](_0xa5e4('0x22'),_0x1d3622+'-'+_0x2c957a+'/'+_0x176b21)[_0xa5e4('0x1d')](_0x164a21);}return null;};}function patchUpdates(_0x3fe2d8){return function(_0x297820){try{jsonpatch[_0xa5e4('0x23')](_0x297820,_0x3fe2d8,!![]);}catch(_0x21e677){return BPromise[_0xa5e4('0x24')](_0x21e677);}return _0x297820[_0xa5e4('0x25')]();};}function saveUpdates(_0x200ce1,_0x584631){return function(_0x3eb5ad){if(_0x3eb5ad){return _0x3eb5ad[_0xa5e4('0x26')](_0x200ce1)['then'](function(_0x51b027){return _0x51b027;});}return null;};}function removeEntity(_0x2ed137,_0x43311a){return function(_0x426967){if(_0x426967){return _0x426967[_0xa5e4('0x27')]()[_0xa5e4('0x28')](function(){_0x2ed137[_0xa5e4('0x1c')](0xcc)[_0xa5e4('0x29')]();});}};}function handleEntityNotFound(_0x3a5d08,_0xe4e21f){return function(_0xbc8455){if(!_0xbc8455){_0x3a5d08[_0xa5e4('0x2a')](0x194);}return _0xbc8455;};}function handleError(_0x59204b,_0x2290cc){_0x2290cc=_0x2290cc||0x1f4;return function(_0x4d0859){logger[_0xa5e4('0x2b')](_0x4d0859[_0xa5e4('0x2c')]);if(_0x4d0859[_0xa5e4('0x2d')]){delete _0x4d0859[_0xa5e4('0x2d')];}_0x59204b['status'](_0x2290cc)[_0xa5e4('0x2e')](_0x4d0859);};}exports[_0xa5e4('0x2f')]=function(_0x5a6ba8,_0xf2498a){var _0x2ca8d6={},_0x34d2d4={},_0x4e4df6={'count':0x0,'rows':[]};var _0x4fcb5c=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x52ee6b){return{'name':_0x52ee6b[_0xa5e4('0x30')],'type':_0x52ee6b[_0xa5e4('0x31')][_0xa5e4('0x32')]};});_0x34d2d4[_0xa5e4('0x33')]=_['map'](_0x4fcb5c,_0xa5e4('0x2d'));_0x34d2d4[_0xa5e4('0x34')]=_[_0xa5e4('0x35')](_0x5a6ba8['query']);_0x34d2d4[_0xa5e4('0x36')]=_[_0xa5e4('0x37')](_0x34d2d4['model'],_0x34d2d4[_0xa5e4('0x34')]);_0x2ca8d6['attributes']=_[_0xa5e4('0x37')](_0x34d2d4[_0xa5e4('0x33')],qs[_0xa5e4('0x38')](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x38')]));_0x2ca8d6[_0xa5e4('0x39')]=_0x2ca8d6['attributes'][_0xa5e4('0x3a')]?_0x2ca8d6[_0xa5e4('0x39')]:_0x34d2d4['model'];if(!_0x5a6ba8['query'][_0xa5e4('0x3b')](_0xa5e4('0x3c'))){_0x2ca8d6[_0xa5e4('0x1f')]=qs[_0xa5e4('0x1f')](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x1f')]);_0x2ca8d6['offset']=qs[_0xa5e4('0x21')](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x21')]);}_0x2ca8d6['order']=qs['sort'](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x3d')]);_0x2ca8d6[_0xa5e4('0x3e')]=qs['filters'](_[_0xa5e4('0x3f')](_0x5a6ba8['query'],_0x34d2d4[_0xa5e4('0x36')]),_0x4fcb5c);if(_0x5a6ba8['query'][_0xa5e4('0x40')]){_0x2ca8d6['where']=_[_0xa5e4('0x41')](_0x2ca8d6[_0xa5e4('0x3e')],{'$or':_['map'](_0x4fcb5c,function(_0x4a2881){if(_0x4a2881[_0xa5e4('0x31')]!=='VIRTUAL'){var _0x2cfc51={};_0x2cfc51[_0x4a2881[_0xa5e4('0x2d')]]={'$like':'%'+_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x40')]+'%'};return _0x2cfc51;}})});}_0x2ca8d6=_['merge']({},_0x2ca8d6,_0x5a6ba8[_0xa5e4('0x42')]);var _0x388b41={'where':_0x2ca8d6['where']};return db['ChatInternalMessage']['count'](_0x388b41)['then'](function(_0x40126b){_0x4e4df6[_0xa5e4('0x20')]=_0x40126b;if(_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x43')]){_0x2ca8d6[_0xa5e4('0x44')]=[{'all':!![]}];}return db[_0xa5e4('0x45')][_0xa5e4('0x46')](_0x2ca8d6);})[_0xa5e4('0x28')](function(_0x294939){_0x4e4df6[_0xa5e4('0x47')]=_0x294939;return _0x4e4df6;})['then'](respondWithFilteredResult(_0xf2498a,_0x2ca8d6))['catch'](handleError(_0xf2498a,null));};exports['show']=function(_0x4ffd64,_0x3689b5){var _0x52740c={'raw':!![],'where':{'id':_0x4ffd64[_0xa5e4('0x48')]['id']}},_0x5f16cd={};_0x5f16cd[_0xa5e4('0x33')]=_['keys'](db[_0xa5e4('0x45')][_0xa5e4('0x49')]);_0x5f16cd[_0xa5e4('0x34')]=_[_0xa5e4('0x35')](_0x4ffd64[_0xa5e4('0x34')]);_0x5f16cd['filters']=_['intersection'](_0x5f16cd[_0xa5e4('0x33')],_0x5f16cd[_0xa5e4('0x34')]);_0x52740c[_0xa5e4('0x39')]=_[_0xa5e4('0x37')](_0x5f16cd['model'],qs[_0xa5e4('0x38')](_0x4ffd64[_0xa5e4('0x34')][_0xa5e4('0x38')]));_0x52740c[_0xa5e4('0x39')]=_0x52740c[_0xa5e4('0x39')][_0xa5e4('0x3a')]?_0x52740c[_0xa5e4('0x39')]:_0x5f16cd['model'];if(_0x4ffd64[_0xa5e4('0x34')][_0xa5e4('0x43')]){_0x52740c[_0xa5e4('0x44')]=[{'all':!![]}];}_0x52740c=_['merge']({},_0x52740c,_0x4ffd64['options']);return db['ChatInternalMessage']['find'](_0x52740c)[_0xa5e4('0x28')](handleEntityNotFound(_0x3689b5,null))[_0xa5e4('0x28')](respondWithResult(_0x3689b5,null))[_0xa5e4('0x4a')](handleError(_0x3689b5,null));};exports[_0xa5e4('0x4b')]=function(_0x312695,_0x85e375){return db[_0xa5e4('0x45')][_0xa5e4('0x4b')](_0x312695[_0xa5e4('0x4c')],{})[_0xa5e4('0x28')](respondWithResult(_0x85e375,0xc9))[_0xa5e4('0x4a')](handleError(_0x85e375,null));};exports[_0xa5e4('0x26')]=function(_0x3ded6c,_0x217afd){if(_0x3ded6c[_0xa5e4('0x4c')]['id']){delete _0x3ded6c[_0xa5e4('0x4c')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3ded6c['params']['id']}})['then'](handleEntityNotFound(_0x217afd,null))[_0xa5e4('0x28')](saveUpdates(_0x3ded6c[_0xa5e4('0x4c')],null))[_0xa5e4('0x28')](respondWithResult(_0x217afd,null))[_0xa5e4('0x4a')](handleError(_0x217afd,null));};exports[_0xa5e4('0x27')]=function(_0x2a1a58,_0x30bafe){return db['ChatInternalMessage'][_0xa5e4('0x4d')]({'where':{'id':_0x2a1a58[_0xa5e4('0x48')]['id']}})[_0xa5e4('0x28')](handleEntityNotFound(_0x30bafe,null))[_0xa5e4('0x28')](removeEntity(_0x30bafe,null))[_0xa5e4('0x4a')](handleError(_0x30bafe,null));};exports[_0xa5e4('0x4e')]=function(_0x35bd0c,_0x35e1f8){return db[_0xa5e4('0x45')][_0xa5e4('0x4e')]()[_0xa5e4('0x28')](respondWithResult(_0x35e1f8,null))[_0xa5e4('0x4a')](handleError(_0x35e1f8,null));};function wrapUser(_0x34794c){return function(_0x237413){var _0x4f8480=_0x34794c['get']({'plain':!![]});_0x4f8480[_0xa5e4('0x4f')]=[];if(_0x237413){_0x4f8480['lastMessageAt']=_0x237413['createdAt'];_0x4f8480[_0xa5e4('0x50')]=_0x237413;}else{_0x4f8480[_0xa5e4('0x51')]=moment(0x0)['format'](_0xa5e4('0x52'));_0x4f8480['lastMessage']={};}return _0x4f8480;};}exports[_0xa5e4('0x53')]=function(_0x3ec843,_0x4dbc21,_0x12d70a){var _0x1dc79a=[];return db['User'][_0xa5e4('0x46')]({'where':{'role':[_0xa5e4('0x54'),'admin',_0xa5e4('0x55')]},'attributes':['id',_0xa5e4('0x56'),_0xa5e4('0x2d'),_0xa5e4('0x57'),_0xa5e4('0x58'),'internal',_0xa5e4('0x59'),'lastLoginAt',_0xa5e4('0x5a'),_0xa5e4('0x5b')],'order':qs[_0xa5e4('0x3d')]('-online'),'include':[{'model':db[_0xa5e4('0x5c')],'as':'VoiceQueues','attributes':['id',_0xa5e4('0x2d'),'type'],'through':{'attributes':[]}}]})[_0xa5e4('0x28')](function(_0x48fe88){if(_0x48fe88){var _0x1014df=_0x3ec843[_0xa5e4('0x55')]['get']({'plain':!![]});if(!_0x1014df)throw new Error(_0xa5e4('0x5d'));if(_0x1014df[_0xa5e4('0x57')]===_0xa5e4('0x55')){return db[_0xa5e4('0x5e')][_0xa5e4('0x4d')]({'where':{'name':_0xa5e4('0x5f'),'userProfileId':_0x1014df[_0xa5e4('0x60')]},'raw':!![]})[_0xa5e4('0x28')](function(_0x2282bf){if(_0x2282bf){if(_0x2282bf[_0xa5e4('0x61')]===0x0){return db[_0xa5e4('0x62')][_0xa5e4('0x46')]({'where':{'sectionId':_0x2282bf['id']},'raw':!![]})['then'](function(_0x2fe9be){var _0x1b9abc=[];if(_[_0xa5e4('0x63')](_0x2fe9be)){_0x1b9abc=_[_0xa5e4('0x40')](_0x48fe88,function(_0x18359b){if(_0x18359b[_0xa5e4('0x57')]!=='agent'){return _0x18359b;}});return _0x1b9abc;}else{for(var _0x400218=0x0;_0x400218<_0x48fe88['length'];_0x400218++){var _0x5418df=_0x48fe88[_0x400218];if(_0x5418df['role']===_0xa5e4('0x54')){var _0x46e582=_[_0xa5e4('0x4d')](_0x2fe9be,function(_0xfb472f){return _0xfb472f['resourceId']===_0x5418df['id'];});if(_0x46e582)_0x1b9abc['push'](_0x5418df);}else{_0x1b9abc['push'](_0x5418df);}}return _0x1b9abc;}});}else{return _0x48fe88;}}else{var _0x525212=_[_0xa5e4('0x40')](_0x48fe88,function(_0x21e68d){if(_0x21e68d[_0xa5e4('0x57')]!=='agent'){return _0x21e68d;}});return _0x525212;}});}else{return _0x48fe88;}}})[_0xa5e4('0x28')](function(_0x3b3bb8){var _0x56ee2a=[];if(_0x3b3bb8){_0x1dc79a=_0x3b3bb8;for(var _0x25ca2b=0x0;_0x25ca2b<_0x3b3bb8[_0xa5e4('0x3a')];_0x25ca2b+=0x1){_0x1dc79a[_0x25ca2b][_0xa5e4('0x4f')]=[];_0x56ee2a[_0xa5e4('0x64')](db[_0xa5e4('0x45')][_0xa5e4('0x4d')]({'where':{'FromId':[_0x3ec843[_0xa5e4('0x55')]['id'],_0x3b3bb8[_0x25ca2b]['id']],'ToId':[_0x3ec843[_0xa5e4('0x55')]['id'],_0x3b3bb8[_0x25ca2b]['id']],'ChatGroupId':null},'attributes':['id',_0xa5e4('0x65'),_0xa5e4('0x66'),_0xa5e4('0x67'),'read',_0xa5e4('0x4c')],'order':qs[_0xa5e4('0x3d')](_0xa5e4('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa5e4('0x28')](wrapUser(_0x3b3bb8[_0x25ca2b])));}return BPromise['all'](_0x56ee2a);}return[];})[_0xa5e4('0x28')](function(_0x9a5f3f){return{'rows':_0x9a5f3f,'count':_0x9a5f3f[_0xa5e4('0x3a')]};})[_0xa5e4('0x28')](respondWithResult(_0x4dbc21,null))['catch'](handleError(_0x4dbc21,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 1daeff9..ad168bb 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 _0xf133=['update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage','setMaxListeners'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0xf133,0x166));var _0x3f13=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xf133[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x3f13('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3f13('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3f13('0x2'),'afterDestroy':_0x3f13('0x3')};function emitEvent(_0x3fb529){return function(_0x525734,_0x32b39b,_0x38e420){ChatInternalMessageEvents[_0x3f13('0x4')](_0x3fb529+':'+_0x525734['id'],_0x525734);ChatInternalMessageEvents['emit'](_0x3fb529,_0x525734);_0x38e420(null);};}for(var e in events){if(events[_0x3f13('0x5')](e)){var event=events[e];ChatInternalMessage[_0x3f13('0x6')](e,emitEvent(event));}}module[_0x3f13('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x197c=['remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x197c,0xc1));var _0xc197=function(_0x58f65e,_0x467d61){_0x58f65e=_0x58f65e-0x0;var _0x35684b=_0x197c[_0x58f65e];return _0x35684b;};'use strict';var EventEmitter=require(_0xc197('0x0'));var ChatInternalMessage=require(_0xc197('0x1'))['db'][_0xc197('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc197('0x3'),'afterUpdate':_0xc197('0x4'),'afterDestroy':_0xc197('0x5')};function emitEvent(_0x288aa1){return function(_0x39a525,_0x5b8019,_0x1eaf99){ChatInternalMessageEvents[_0xc197('0x6')](_0x288aa1+':'+_0x39a525['id'],_0x39a525);ChatInternalMessageEvents[_0xc197('0x6')](_0x288aa1,_0x39a525);_0x1eaf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc197('0x7')](e,emitEvent(event));}}module[_0xc197('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 208a247..0abb8ff 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 _0x5db0=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x31c3db,_0x10b243){var _0x57c39c=function(_0x456dda){while(--_0x456dda){_0x31c3db['push'](_0x31c3db['shift']());}};_0x57c39c(++_0x10b243);}(_0x5db0,0x158));var _0x05db=function(_0x198ac3,_0x51a6ba){_0x198ac3=_0x198ac3-0x0;var _0x3b0276=_0x5db0[_0x198ac3];return _0x3b0276;};'use strict';var _=require(_0x05db('0x0'));var util=require(_0x05db('0x1'));var logger=require(_0x05db('0x2'))(_0x05db('0x3'));var moment=require(_0x05db('0x4'));var BPromise=require('bluebird');var rp=require(_0x05db('0x5'));var fs=require('fs');var path=require(_0x05db('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x05db('0x7')]=function(_0x4e69c0,_0x4e01f0){return _0x4e69c0[_0x05db('0x8')](_0x05db('0x9'),attributes,{'tableName':_0x05db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x05db('0xb'),'collate':_0x05db('0xc')});}; \ No newline at end of file +var _0xf311=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4_unicode_ci'];(function(_0x1c6817,_0x1c32ac){var _0x3bbb97=function(_0x156a6f){while(--_0x156a6f){_0x1c6817['push'](_0x1c6817['shift']());}};_0x3bbb97(++_0x1c32ac);}(_0xf311,0x1c3));var _0x1f31=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf311[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x1f31('0x0'));var logger=require(_0x1f31('0x1'))(_0x1f31('0x2'));var moment=require(_0x1f31('0x3'));var BPromise=require('bluebird');var rp=require(_0x1f31('0x4'));var fs=require('fs');var path=require(_0x1f31('0x5'));var rimraf=require('rimraf');var config=require(_0x1f31('0x6'));var attributes=require(_0x1f31('0x7'));module[_0x1f31('0x8')]=function(_0x4b97f9,_0x2e0b5b){return _0x4b97f9['define'](_0x1f31('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1f31('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 9bea06a..5758b13 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 _0xc6e5=['../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b97fa,_0x4399a6){var _0x44267a=function(_0x60f28){while(--_0x60f28){_0x3b97fa['push'](_0x3b97fa['shift']());}};_0x44267a(++_0x4399a6);}(_0xc6e5,0x192));var _0x5c6e=function(_0x44ff66,_0x247610){_0x44ff66=_0x44ff66-0x0;var _0x3f64a4=_0xc6e5[_0x44ff66];return _0x3f64a4;};'use strict';var _=require(_0x5c6e('0x0'));var util=require(_0x5c6e('0x1'));var moment=require('moment');var BPromise=require(_0x5c6e('0x2'));var rs=require(_0x5c6e('0x3'));var fs=require('fs');var Redis=require(_0x5c6e('0x4'));var db=require(_0x5c6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c6e('0x6'))('rpc');var config=require(_0x5c6e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5c6e('0x8')][_0x5c6e('0x9')]({'port':0x232a});config[_0x5c6e('0xa')]=_[_0x5c6e('0xb')](config[_0x5c6e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c6e('0xc'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5c6e('0xd')](socket);function respondWithRpcPromise(_0x274a2b,_0x3490b3,_0x4d7f2d){return new BPromise(function(_0x2415a7,_0x55f61d){return client[_0x5c6e('0xe')](_0x274a2b,_0x4d7f2d)[_0x5c6e('0xf')](function(_0x38b967){logger[_0x5c6e('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x3490b3,'request\x20sent');logger[_0x5c6e('0x11')](_0x5c6e('0x12'),_0x3490b3,'request\x20sent',JSON['stringify'](_0x38b967));if(_0x38b967[_0x5c6e('0x13')]){if(_0x38b967[_0x5c6e('0x13')]['code']===0x1f4){logger['error'](_0x5c6e('0x14'),_0x3490b3,_0x38b967[_0x5c6e('0x13')][_0x5c6e('0x15')]);return _0x55f61d(_0x38b967[_0x5c6e('0x13')][_0x5c6e('0x15')]);}logger[_0x5c6e('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x3490b3,_0x38b967[_0x5c6e('0x13')]['message']);return _0x2415a7(_0x38b967[_0x5c6e('0x13')][_0x5c6e('0x15')]);}else{logger[_0x5c6e('0x10')](_0x5c6e('0x14'),_0x3490b3,'request\x20sent');_0x2415a7(_0x38b967[_0x5c6e('0x16')][_0x5c6e('0x15')]);}})[_0x5c6e('0x17')](function(_0x238a98){logger[_0x5c6e('0x13')](_0x5c6e('0x14'),_0x3490b3,_0x238a98);_0x55f61d(_0x238a98);});});} \ No newline at end of file +var _0xd95b=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','request','info','request\x20sent','debug'];(function(_0x20b04f,_0xc07087){var _0x591839=function(_0x2570b4){while(--_0x2570b4){_0x20b04f['push'](_0x20b04f['shift']());}};_0x591839(++_0xc07087);}(_0xd95b,0x126));var _0xbd95=function(_0x2b8983,_0x54abb2){_0x2b8983=_0x2b8983-0x0;var _0x3ce526=_0xd95b[_0x2b8983];return _0x3ce526;};'use strict';var _=require('lodash');var util=require(_0xbd95('0x0'));var moment=require(_0xbd95('0x1'));var BPromise=require(_0xbd95('0x2'));var rs=require(_0xbd95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd95('0x4'))['db'];var utils=require(_0xbd95('0x5'));var logger=require(_0xbd95('0x6'))('rpc');var config=require(_0xbd95('0x7'));var jayson=require(_0xbd95('0x8'));var client=jayson['client'][_0xbd95('0x9')]({'port':0x232a});config[_0xbd95('0xa')]=_[_0xbd95('0xb')](config['redis'],{'host':_0xbd95('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd95('0xa')]));require(_0xbd95('0xd'))['register'](socket);function respondWithRpcPromise(_0x27ee03,_0x490825,_0x1c8ca0){return new BPromise(function(_0x893dcb,_0x4ed6e8){return client[_0xbd95('0xe')](_0x27ee03,_0x1c8ca0)['then'](function(_0xd8a13d){logger[_0xbd95('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x490825,_0xbd95('0x10'));logger[_0xbd95('0x11')](_0xbd95('0x12'),_0x490825,_0xbd95('0x10'),JSON[_0xbd95('0x13')](_0xd8a13d));if(_0xd8a13d[_0xbd95('0x14')]){if(_0xd8a13d[_0xbd95('0x14')]['code']===0x1f4){logger[_0xbd95('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x490825,_0xd8a13d[_0xbd95('0x14')][_0xbd95('0x15')]);return _0x4ed6e8(_0xd8a13d[_0xbd95('0x14')][_0xbd95('0x15')]);}logger[_0xbd95('0x14')](_0xbd95('0x16'),_0x490825,_0xd8a13d['error'][_0xbd95('0x15')]);return _0x893dcb(_0xd8a13d['error'][_0xbd95('0x15')]);}else{logger[_0xbd95('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x490825,_0xbd95('0x10'));_0x893dcb(_0xd8a13d[_0xbd95('0x17')][_0xbd95('0x15')]);}})['catch'](function(_0x172092){logger[_0xbd95('0x14')](_0xbd95('0x16'),_0x490825,_0x172092);_0x4ed6e8(_0x172092);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7552ed8..d2eae21 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 _0x7af2=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','removeListener'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x7af2,0x1bb));var _0x27af=function(_0x592edb,_0x2e4d3f){_0x592edb=_0x592edb-0x0;var _0x108fc8=_0x7af2[_0x592edb];return _0x108fc8;};'use strict';var ChatInternalMessageEvents=require(_0x27af('0x0'));var events=[_0x27af('0x1'),_0x27af('0x2'),'update'];function createListener(_0xab5b1a,_0x2535d8){return function(_0xa8ea9b){_0x2535d8[_0x27af('0x3')](_0xab5b1a,_0xa8ea9b);};}function removeListener(_0x49461e,_0x7b3edc){return function(){ChatInternalMessageEvents[_0x27af('0x4')](_0x49461e,_0x7b3edc);};}exports[_0x27af('0x5')]=function(_0x3e40ef){for(var _0x2edbaa=0x0,_0x3ed398=events[_0x27af('0x6')];_0x2edbaa<_0x3ed398;_0x2edbaa++){var _0x368035=events[_0x2edbaa];var _0x314047=createListener(_0x27af('0x7')+_0x368035,_0x3e40ef);ChatInternalMessageEvents['on'](_0x368035,_0x314047);}}; \ No newline at end of file +var _0xb0d4=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','register','length'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xb0d4,0xd1));var _0x4b0d=function(_0x66808a,_0x60f3bd){_0x66808a=_0x66808a-0x0;var _0x760006=_0xb0d4[_0x66808a];return _0x760006;};'use strict';var ChatInternalMessageEvents=require(_0x4b0d('0x0'));var events=[_0x4b0d('0x1'),_0x4b0d('0x2'),_0x4b0d('0x3')];function createListener(_0x1c2911,_0xeaad4a){return function(_0x43c6e8){_0xeaad4a[_0x4b0d('0x4')](_0x1c2911,_0x43c6e8);};}function removeListener(_0x2bf4a6,_0x287fa7){return function(){ChatInternalMessageEvents['removeListener'](_0x2bf4a6,_0x287fa7);};}exports[_0x4b0d('0x5')]=function(_0x5aa827){for(var _0x157f19=0x0,_0x307bab=events[_0x4b0d('0x6')];_0x157f19<_0x307bab;_0x157f19++){var _0x310df8=events[_0x157f19];var _0xe767fb=createListener(_0x4b0d('0x7')+_0x310df8,_0x5aa827);ChatInternalMessageEvents['on'](_0x310df8,_0xe767fb);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 2c7ed9a..3d5f169 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 _0x66d2=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','getUsers','/:id','show','create','put','update','delete'];(function(_0x41ea43,_0x449611){var _0x273c57=function(_0x218037){while(--_0x218037){_0x41ea43['push'](_0x41ea43['shift']());}};_0x273c57(++_0x449611);}(_0x66d2,0x17b));var _0x266d=function(_0x5276ff,_0x4e416f){_0x5276ff=_0x5276ff-0x0;var _0x197192=_0x66d2[_0x5276ff];return _0x197192;};'use strict';var multer=require(_0x266d('0x0'));var util=require(_0x266d('0x1'));var path=require(_0x266d('0x2'));var timeout=require(_0x266d('0x3'));var express=require(_0x266d('0x4'));var router=express['Router']();var fs_extra=require(_0x266d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x266d('0x6'));var config=require(_0x266d('0x7'));var controller=require(_0x266d('0x8'));router[_0x266d('0x9')]('/',auth[_0x266d('0xa')](),controller[_0x266d('0xb')]);router[_0x266d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x266d('0xc')]);router[_0x266d('0x9')]('/users',auth[_0x266d('0xa')](),controller[_0x266d('0xd')]);router[_0x266d('0x9')](_0x266d('0xe'),auth[_0x266d('0xa')](),controller[_0x266d('0xf')]);router['post']('/',auth[_0x266d('0xa')](),controller[_0x266d('0x10')]);router[_0x266d('0x11')](_0x266d('0xe'),controller[_0x266d('0x12')]);router[_0x266d('0x13')](_0x266d('0xe'),auth[_0x266d('0xa')](),controller['destroy']);module[_0x266d('0x14')]=router; \ No newline at end of file +var _0xdef5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','getUsers','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x1321d6,_0x4424c6){var _0x3aae91=function(_0x5b7fe1){while(--_0x5b7fe1){_0x1321d6['push'](_0x1321d6['shift']());}};_0x3aae91(++_0x4424c6);}(_0xdef5,0x1b1));var _0x5def=function(_0x360f9c,_0x208039){_0x360f9c=_0x360f9c-0x0;var _0x4f916c=_0xdef5[_0x360f9c];return _0x4f916c;};'use strict';var multer=require(_0x5def('0x0'));var util=require('util');var path=require(_0x5def('0x1'));var timeout=require(_0x5def('0x2'));var express=require(_0x5def('0x3'));var router=express[_0x5def('0x4')]();var fs_extra=require(_0x5def('0x5'));var auth=require(_0x5def('0x6'));var interaction=require(_0x5def('0x7'));var config=require(_0x5def('0x8'));var controller=require(_0x5def('0x9'));router['get']('/',auth[_0x5def('0xa')](),controller[_0x5def('0xb')]);router[_0x5def('0xc')](_0x5def('0xd'),auth[_0x5def('0xa')](),controller[_0x5def('0xe')]);router['get']('/users',auth[_0x5def('0xa')](),controller[_0x5def('0xf')]);router[_0x5def('0xc')](_0x5def('0x10'),auth['isAuthenticated'](),controller[_0x5def('0x11')]);router[_0x5def('0x12')]('/',auth[_0x5def('0xa')](),controller[_0x5def('0x13')]);router[_0x5def('0x14')](_0x5def('0x10'),controller['update']);router[_0x5def('0x15')]('/:id',auth[_0x5def('0xa')](),controller[_0x5def('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index e34d5c4..7316709 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 _0xceb0=['ENUM','out','TEXT','BOOLEAN'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xceb0,0x173));var _0x0ceb=function(_0x3cb8b6,_0x5cad07){_0x3cb8b6=_0x3cb8b6-0x0;var _0xbc94f4=_0xceb0[_0x3cb8b6];return _0xbc94f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0ceb('0x0')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0ceb('0x1')]('in',_0x0ceb('0x2')),'defaultValue':_0x0ceb('0x2'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0ceb('0x3')]}}; \ No newline at end of file +var _0xabad=['sequelize','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x33ff91,_0x795acd){var _0x14d1bd=function(_0x32fc59){while(--_0x32fc59){_0x33ff91['push'](_0x33ff91['shift']());}};_0x14d1bd(++_0x795acd);}(_0xabad,0x150));var _0xdaba=function(_0x2724ab,_0x4890a8){_0x2724ab=_0x2724ab-0x0;var _0x3e05d8=_0xabad[_0x2724ab];return _0x3e05d8;};'use strict';var Sequelize=require(_0xdaba('0x0'));module['exports']={'body':{'type':Sequelize[_0xdaba('0x1')](_0xdaba('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdaba('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdaba('0x4')]('in',_0xdaba('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdaba('0x6')]},'providerName':{'type':Sequelize[_0xdaba('0x7')]},'providerResponse':{'type':Sequelize[_0xdaba('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index e970d91..bc94e5b 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 _0x29de=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','reject','RejectMessage','ContactId','QueryTypes','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','send','ChatMessage','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','length','find','create','body','params','describe','chat','read','readAt','format'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x29de,0x134));var _0xe29d=function(_0x49c0b3,_0x4a1b06){_0x49c0b3=_0x49c0b3-0x0;var _0x245c6f=_0x29de[_0x49c0b3];return _0x245c6f;};'use strict';var emlformat=require(_0xe29d('0x0'));var rimraf=require(_0xe29d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe29d('0x2'));var rp=require(_0xe29d('0x3'));var moment=require(_0xe29d('0x4'));var BPromise=require(_0xe29d('0x5'));var Mustache=require(_0xe29d('0x6'));var util=require(_0xe29d('0x7'));var path=require(_0xe29d('0x8'));var sox=require('sox');var csv=require(_0xe29d('0x9'));var ejs=require(_0xe29d('0xa'));var fs=require('fs');var fs_extra=require(_0xe29d('0xb'));var _=require(_0xe29d('0xc'));var squel=require('squel');var crypto=require(_0xe29d('0xd'));var jsforce=require(_0xe29d('0xe'));var deskjs=require(_0xe29d('0xf'));var toCsv=require(_0xe29d('0x9'));var querystring=require('querystring');var Papa=require(_0xe29d('0x10'));var Redis=require(_0xe29d('0x11'));var authService=require(_0xe29d('0x12'));var qs=require(_0xe29d('0x13'));var as=require(_0xe29d('0x14'));var hardwareService=require(_0xe29d('0x15'));var logger=require(_0xe29d('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe29d('0x17'));var db=require(_0xe29d('0x18'))['db'];config[_0xe29d('0x19')]=_[_0xe29d('0x1a')](config[_0xe29d('0x19')],{'host':_0xe29d('0x1b'),'port':0x18eb});var socket=require(_0xe29d('0x1c'))(new Redis(config[_0xe29d('0x19')]));require(_0xe29d('0x1d'))[_0xe29d('0x1e')](socket);var jayson=require(_0xe29d('0x1f'));var client=jayson[_0xe29d('0x20')][_0xe29d('0x21')]({'port':0x232c});var client9002=jayson[_0xe29d('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a42aa,_0x1554e5,_0x234b1d,_0x42b7cc){return new BPromise(function(_0x343050,_0x1b1a89){var _0xce6a86=_0x42b7cc||client;return _0xce6a86['request'](_0x3a42aa,_0x234b1d)[_0xe29d('0x22')](function(_0x39c9fe){logger[_0xe29d('0x23')](_0xe29d('0x24'),_0x1554e5,'request\x20sent');logger[_0xe29d('0x25')](_0xe29d('0x26'),_0x1554e5,_0xe29d('0x27'),JSON[_0xe29d('0x28')](_0x39c9fe));if(_0x39c9fe['error']){if(_0x39c9fe[_0xe29d('0x29')]['code']===0x1f4){logger[_0xe29d('0x29')](_0xe29d('0x24'),_0x1554e5,_0x39c9fe[_0xe29d('0x29')][_0xe29d('0x2a')]);return _0x1b1a89(_0x39c9fe[_0xe29d('0x29')][_0xe29d('0x2a')]);}logger[_0xe29d('0x29')]('ChatMessage,\x20%s,\x20%s',_0x1554e5,_0x39c9fe[_0xe29d('0x29')][_0xe29d('0x2a')]);return _0x343050(_0x39c9fe[_0xe29d('0x29')]['message']);}else{logger[_0xe29d('0x23')](_0xe29d('0x24'),_0x1554e5,_0xe29d('0x27'));_0x343050(_0x39c9fe[_0xe29d('0x2b')]['message']);}})[_0xe29d('0x2c')](function(_0x163856){logger['error'](_0xe29d('0x24'),_0x1554e5,_0x163856);_0x1b1a89(_0x163856);});});}function respondWithStatusCode(_0x345eb0,_0xd41e75){_0xd41e75=_0xd41e75||0xcc;return function(_0x487bd9){if(_0x487bd9){return _0x345eb0[_0xe29d('0x2d')](_0xd41e75);}return _0x345eb0['status'](_0xd41e75)['end']();};}function respondWithResult(_0x5438de,_0x24155c){_0x24155c=_0x24155c||0xc8;return function(_0x5044a1){if(_0x5044a1){return _0x5438de[_0xe29d('0x2e')](_0x24155c)[_0xe29d('0x2f')](_0x5044a1);}};}function respondWithFilteredResult(_0x2af1e9,_0x1e0b17){return function(_0x35a33a){if(_0x35a33a){var _0x410f3e=typeof _0x1e0b17[_0xe29d('0x30')]===_0xe29d('0x31')&&typeof _0x1e0b17['limit']==='undefined';var _0x217503=_0x35a33a[_0xe29d('0x32')];var _0x2485a6=_0x410f3e?0x0:_0x1e0b17[_0xe29d('0x30')];var _0xc75459=_0x410f3e?_0x35a33a[_0xe29d('0x32')]:_0x1e0b17['offset']+_0x1e0b17[_0xe29d('0x33')];var _0x3159d8;if(_0xc75459>=_0x217503){_0xc75459=_0x217503;_0x3159d8=0xc8;}else{_0x3159d8=0xce;}_0x2af1e9['status'](_0x3159d8);return _0x2af1e9[_0xe29d('0x34')](_0xe29d('0x35'),_0x2485a6+'-'+_0xc75459+'/'+_0x217503)[_0xe29d('0x2f')](_0x35a33a);}return null;};}function patchUpdates(_0x2a2fe7){return function(_0x2ef01c){try{jsonpatch[_0xe29d('0x36')](_0x2ef01c,_0x2a2fe7,!![]);}catch(_0xe5646e){return BPromise['reject'](_0xe5646e);}return _0x2ef01c[_0xe29d('0x37')]();};}function saveUpdates(_0x4f211c,_0x51d4ef){return function(_0x79ab21){if(_0x79ab21){return _0x79ab21['update'](_0x4f211c)['then'](function(_0x31bd5e){return _0x31bd5e;});}return null;};}function removeEntity(_0x3da158,_0x1e1b53){return function(_0x32b8ef){if(_0x32b8ef){return _0x32b8ef[_0xe29d('0x38')]()['then'](function(){_0x3da158[_0xe29d('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517bb9,_0x5c9e1c){return function(_0xacb365){if(!_0xacb365){_0x517bb9[_0xe29d('0x2d')](0x194);}return _0xacb365;};}function handleError(_0x311de2,_0x157fe4){_0x157fe4=_0x157fe4||0x1f4;return function(_0x30d658){logger['error'](_0x30d658['stack']);if(_0x30d658['name']){delete _0x30d658['name'];}_0x311de2['status'](_0x157fe4)[_0xe29d('0x39')](_0x30d658);};}exports['index']=function(_0x3c93ce,_0x4ed94a){var _0x63f9f5={},_0x35ca12={},_0x53fedf={'count':0x0,'rows':[]};var _0x1ada11=_['map'](db[_0xe29d('0x3a')][_0xe29d('0x3b')],function(_0x200018){return{'name':_0x200018[_0xe29d('0x3c')],'type':_0x200018[_0xe29d('0x3d')][_0xe29d('0x3e')]};});_0x35ca12['model']=_['map'](_0x1ada11,_0xe29d('0x3f'));_0x35ca12[_0xe29d('0x40')]=_[_0xe29d('0x41')](_0x3c93ce['query']);_0x35ca12[_0xe29d('0x42')]=_['intersection'](_0x35ca12['model'],_0x35ca12[_0xe29d('0x40')]);_0x63f9f5['attributes']=_[_0xe29d('0x43')](_0x35ca12[_0xe29d('0x44')],qs['fields'](_0x3c93ce['query'][_0xe29d('0x45')]));_0x63f9f5[_0xe29d('0x46')]=_0x63f9f5[_0xe29d('0x46')]['length']?_0x63f9f5[_0xe29d('0x46')]:_0x35ca12[_0xe29d('0x44')];if(!_0x3c93ce['query'][_0xe29d('0x47')](_0xe29d('0x48'))){_0x63f9f5[_0xe29d('0x33')]=qs[_0xe29d('0x33')](_0x3c93ce[_0xe29d('0x40')][_0xe29d('0x33')]);_0x63f9f5[_0xe29d('0x30')]=qs[_0xe29d('0x30')](_0x3c93ce[_0xe29d('0x40')]['offset']);}_0x63f9f5[_0xe29d('0x49')]=qs[_0xe29d('0x4a')](_0x3c93ce['query'][_0xe29d('0x4a')]);_0x63f9f5[_0xe29d('0x4b')]=qs[_0xe29d('0x42')](_[_0xe29d('0x4c')](_0x3c93ce[_0xe29d('0x40')],_0x35ca12[_0xe29d('0x42')]),_0x1ada11);if(_0x3c93ce[_0xe29d('0x40')][_0xe29d('0x4d')]){_0x63f9f5['where']=_[_0xe29d('0x4e')](_0x63f9f5[_0xe29d('0x4b')],{'$or':_['map'](_0x1ada11,function(_0x35c65c){if(_0x35c65c[_0xe29d('0x3d')]!==_0xe29d('0x4f')){var _0x3fdc2a={};_0x3fdc2a[_0x35c65c[_0xe29d('0x3f')]]={'$like':'%'+_0x3c93ce[_0xe29d('0x40')][_0xe29d('0x4d')]+'%'};return _0x3fdc2a;}})});}_0x63f9f5=_[_0xe29d('0x4e')]({},_0x63f9f5,_0x3c93ce[_0xe29d('0x50')]);var _0x5ae35a={'where':_0x63f9f5[_0xe29d('0x4b')]};return db[_0xe29d('0x3a')][_0xe29d('0x32')](_0x5ae35a)[_0xe29d('0x22')](function(_0x1a965d){_0x53fedf[_0xe29d('0x32')]=_0x1a965d;if(_0x3c93ce['query'][_0xe29d('0x51')]){_0x63f9f5[_0xe29d('0x52')]=[{'all':!![]}];}return db[_0xe29d('0x3a')][_0xe29d('0x53')](_0x63f9f5);})[_0xe29d('0x22')](function(_0x22fad8){_0x53fedf['rows']=_0x22fad8;return _0x53fedf;})[_0xe29d('0x22')](respondWithFilteredResult(_0x4ed94a,_0x63f9f5))[_0xe29d('0x2c')](handleError(_0x4ed94a,null));};exports['show']=function(_0x3168c1,_0x54a6d0){var _0x31af5e={'raw':!![],'where':{'id':_0x3168c1['params']['id']}},_0x21cf2b={};_0x21cf2b[_0xe29d('0x44')]=_[_0xe29d('0x41')](db[_0xe29d('0x3a')][_0xe29d('0x3b')]);_0x21cf2b[_0xe29d('0x40')]=_['keys'](_0x3168c1[_0xe29d('0x40')]);_0x21cf2b[_0xe29d('0x42')]=_[_0xe29d('0x43')](_0x21cf2b[_0xe29d('0x44')],_0x21cf2b[_0xe29d('0x40')]);_0x31af5e[_0xe29d('0x46')]=_[_0xe29d('0x43')](_0x21cf2b[_0xe29d('0x44')],qs[_0xe29d('0x45')](_0x3168c1[_0xe29d('0x40')][_0xe29d('0x45')]));_0x31af5e[_0xe29d('0x46')]=_0x31af5e[_0xe29d('0x46')][_0xe29d('0x54')]?_0x31af5e['attributes']:_0x21cf2b[_0xe29d('0x44')];if(_0x3168c1['query']['includeAll']){_0x31af5e[_0xe29d('0x52')]=[{'all':!![]}];}_0x31af5e=_[_0xe29d('0x4e')]({},_0x31af5e,_0x3168c1[_0xe29d('0x50')]);return db['ChatMessage'][_0xe29d('0x55')](_0x31af5e)[_0xe29d('0x22')](handleEntityNotFound(_0x54a6d0,null))[_0xe29d('0x22')](respondWithResult(_0x54a6d0,null))[_0xe29d('0x2c')](handleError(_0x54a6d0,null));};exports[_0xe29d('0x56')]=function(_0x4e96de,_0x489df5){return db['ChatMessage'][_0xe29d('0x56')](_0x4e96de['body'],{})[_0xe29d('0x22')](respondWithResult(_0x489df5,0xc9))[_0xe29d('0x2c')](handleError(_0x489df5,null));};exports['update']=function(_0x38d01e,_0x512b6a){if(_0x38d01e[_0xe29d('0x57')]['id']){delete _0x38d01e[_0xe29d('0x57')]['id'];}return db[_0xe29d('0x3a')][_0xe29d('0x55')]({'where':{'id':_0x38d01e['params']['id']}})['then'](handleEntityNotFound(_0x512b6a,null))['then'](saveUpdates(_0x38d01e[_0xe29d('0x57')],null))[_0xe29d('0x22')](respondWithResult(_0x512b6a,null))['catch'](handleError(_0x512b6a,null));};exports[_0xe29d('0x38')]=function(_0x578f80,_0x2e3861){return db[_0xe29d('0x3a')][_0xe29d('0x55')]({'where':{'id':_0x578f80[_0xe29d('0x58')]['id']}})[_0xe29d('0x22')](handleEntityNotFound(_0x2e3861,null))[_0xe29d('0x22')](removeEntity(_0x2e3861,null))[_0xe29d('0x2c')](handleError(_0x2e3861,null));};exports[_0xe29d('0x59')]=function(_0x5d8ab8,_0x4eac35){return db[_0xe29d('0x3a')][_0xe29d('0x59')]()[_0xe29d('0x22')](respondWithResult(_0x4eac35,null))[_0xe29d('0x2c')](handleError(_0x4eac35,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x41063f,_0x4594de,_0x52fde1){var _0x38660e={'agent':{},'channel':_0xe29d('0x5a')};if(_0x41063f[_0xe29d('0x57')]['id']){delete _0x41063f['body']['id'];}_0x41063f[_0xe29d('0x57')][_0xe29d('0x5b')]=!![];_0x41063f[_0xe29d('0x57')][_0xe29d('0x5c')]=moment()[_0xe29d('0x5d')](_0xe29d('0x5e'));_0x41063f['body'][_0xe29d('0x5f')]=_0x41063f['body'][_0xe29d('0x5f')]||_0x41063f[_0xe29d('0x60')]['id'];_0x38660e[_0xe29d('0x61')]['id']=_0x41063f[_0xe29d('0x57')][_0xe29d('0x5f')];return db['ChatMessage'][_0xe29d('0x55')]({'where':{'id':_0x41063f['params']['id'],'UserId':null}})[_0xe29d('0x22')](handleEntityNotFound(_0x4594de,null))[_0xe29d('0x22')](saveUpdates(_0x41063f[_0xe29d('0x57')],null))['then'](function(_0x2febbd){if(_0x2febbd){_0x38660e[_0xe29d('0x2a')]=_0x2febbd[_0xe29d('0x62')]({'plain':!![]});return db[_0xe29d('0x63')][_0xe29d('0x55')]({'where':{'id':_0x2febbd[_0xe29d('0x64')]}});}return null;})[_0xe29d('0x22')](handleEntityNotFound(_0x4594de,null))[_0xe29d('0x22')](function(_0x5e584d){if(_0x5e584d){return _0x5e584d[_0xe29d('0x65')]({'UserId':_0x41063f[_0xe29d('0x57')][_0xe29d('0x5f')],'read1stAt':_[_0xe29d('0x66')](_0x5e584d[_0xe29d('0x67')])?moment()['format'](_0xe29d('0x5e')):undefined});}return null;})[_0xe29d('0x22')](function(_0x2dea58){if(_0x2dea58){_0x38660e[_0xe29d('0x68')]=_0x2dea58['get']({'plain':!![]});interaction_log[_0xe29d('0x23')](_0xe29d('0x69'),_0x41063f[_0xe29d('0x60')]['id'],_0x41063f[_0xe29d('0x60')][_0xe29d('0x3f')],_0x41063f[_0xe29d('0x60')][_0xe29d('0x6a')],_0x38660e[_0xe29d('0x68')]['id'],_0x41063f[_0xe29d('0x57')]?JSON[_0xe29d('0x28')](_0x41063f[_0xe29d('0x57')]):_0xe29d('0x6b'));return respondWithRpcPromise('AcceptMessage',_0xe29d('0x6c'),_0x38660e);}return null;})[_0xe29d('0x22')](function(_0x26a81a){var _0x5b92ea=_0xe29d('0x6d')+_0x26a81a[_0xe29d('0x2a')]['ContactId'];return db[_0xe29d('0x6e')]['query'](_0x5b92ea,{'type':db[_0xe29d('0x6f')]['QueryTypes'][_0xe29d('0x70')],'raw':!![]})['then'](function(_0x241d57){return _0x241d57;});})['then'](function(_0x1f3572){if(_0x1f3572){_0x38660e[_0xe29d('0x2a')][_0xe29d('0x71')]=_0x1f3572[0x0];if(!_0x41063f[_0xe29d('0x57')]['UserId'])return;return db[_0xe29d('0x72')][_0xe29d('0x55')]({'where':{'id':_0x41063f[_0xe29d('0x57')]['UserId'],'role':_0xe29d('0x61')},'attributes':['id',_0xe29d('0x3f'),_0xe29d('0x73'),_0xe29d('0x74'),_0xe29d('0x75')],'raw':!![]});}return null;})[_0xe29d('0x22')](function(_0x33de75){if(!_0x33de75)return null;_0x38660e[_0xe29d('0x2a')][_0xe29d('0x61')]=_0x33de75;return _0x38660e;})[_0xe29d('0x22')](function(_0x16ed4b){if(_0x16ed4b){if(_0x41063f[_0xe29d('0x57')]['manual']){_0x38660e[_0xe29d('0x2a')][_0xe29d('0x76')]=util[_0xe29d('0x5d')](_0xe29d('0x77'),_0x41063f[_0xe29d('0x60')][_0xe29d('0x3f')]);_0x38660e[_0xe29d('0x2a')][_0xe29d('0x78')]=_0x38660e[_0xe29d('0x78')];_0x38660e[_0xe29d('0x2a')][_0xe29d('0x79')]=_0x38660e[_0xe29d('0x78')];_0x38660e[_0xe29d('0x2a')][_0xe29d('0x7a')]=_0xe29d('0x7b');return respondWithRpcPromise(_0xe29d('0x7c'),_0xe29d('0x7c'),{'event':_0xe29d('0x7d'),'message':_[_0xe29d('0x4e')](_0x38660e[_0xe29d('0x2a')],JSON[_0xe29d('0x7e')](_0x38660e[_0xe29d('0x68')][_0xe29d('0x7f')]))},client9002)[_0xe29d('0x22')](function(){return _0x38660e;});}return _0x38660e;}return null;})[_0xe29d('0x22')](respondWithResult(_0x4594de,null))[_0xe29d('0x2c')](handleError(_0x4594de,null));};var interaction_log=require(_0xe29d('0x16'))(_0xe29d('0x80'));exports[_0xe29d('0x81')]=function(_0x47c843,_0x1ac75f,_0x48ef0b){var _0x4f3137={'agent':{},'channel':'chat'};if(_0x47c843[_0xe29d('0x57')]['id']){delete _0x47c843[_0xe29d('0x57')]['id'];}_0x47c843[_0xe29d('0x57')]['UserId']=_0x47c843[_0xe29d('0x57')][_0xe29d('0x5f')]||_0x47c843[_0xe29d('0x60')]['id'];_0x4f3137['agent']['id']=_0x47c843[_0xe29d('0x57')][_0xe29d('0x5f')];return db[_0xe29d('0x3a')][_0xe29d('0x55')]({'where':{'id':_0x47c843[_0xe29d('0x58')]['id'],'UserId':null}})[_0xe29d('0x22')](handleEntityNotFound(_0x1ac75f,null))[_0xe29d('0x22')](function(_0x395cb7){if(_0x395cb7){_0x4f3137[_0xe29d('0x2a')]=_0x395cb7[_0xe29d('0x62')]({'plain':!![]});return db[_0xe29d('0x63')]['find']({'where':{'id':_0x395cb7[_0xe29d('0x64')]}});}return null;})[_0xe29d('0x22')](handleEntityNotFound(_0x1ac75f,null))['then'](function(_0x8ad0ab){if(_0x8ad0ab){_0x4f3137['interaction']=_0x8ad0ab['get']({'plain':!![]});interaction_log[_0xe29d('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47c843[_0xe29d('0x60')]['id'],_0x47c843[_0xe29d('0x60')]['name'],_0x47c843['user'][_0xe29d('0x6a')],_0x4f3137[_0xe29d('0x68')]['id'],_0x47c843[_0xe29d('0x57')]?JSON[_0xe29d('0x28')](_0x47c843[_0xe29d('0x57')]):_0xe29d('0x6b'));return respondWithRpcPromise(_0xe29d('0x82'),'rejectMessage',_0x4f3137);}return null;})[_0xe29d('0x22')](function(_0x350aa1){var _0x2f8c07=_0xe29d('0x6d')+_0x350aa1[_0xe29d('0x2a')][_0xe29d('0x83')];return db[_0xe29d('0x6e')][_0xe29d('0x40')](_0x2f8c07,{'type':db[_0xe29d('0x6f')][_0xe29d('0x84')][_0xe29d('0x70')],'raw':!![]})[_0xe29d('0x22')](function(_0x25970f){return _0x25970f;});})[_0xe29d('0x22')](function(_0x29d5fe){if(_0x29d5fe){_0x4f3137[_0xe29d('0x2a')][_0xe29d('0x71')]=_0x29d5fe[0x0];if(!_0x47c843[_0xe29d('0x57')][_0xe29d('0x5f')])return;return db[_0xe29d('0x72')][_0xe29d('0x55')]({'where':{'id':_0x47c843[_0xe29d('0x57')]['UserId'],'role':_0xe29d('0x61')},'attributes':['id',_0xe29d('0x3f'),_0xe29d('0x73'),_0xe29d('0x74'),_0xe29d('0x75')],'raw':!![]});}return null;})['then'](function(_0x4f0cbf){if(!_0x4f0cbf)return null;_0x4f3137[_0xe29d('0x2a')][_0xe29d('0x61')]=_0x4f0cbf;return _0x4f3137;})[_0xe29d('0x22')](function(_0x41722a){if(_0x41722a){_0x41722a[_0xe29d('0x2a')][_0xe29d('0x76')]=util[_0xe29d('0x5d')](_0xe29d('0x77'),_0x47c843['user']['name']);_0x41722a[_0xe29d('0x2a')]['channel']=_0x4f3137[_0xe29d('0x78')];_0x41722a[_0xe29d('0x2a')][_0xe29d('0x79')]=_0x4f3137[_0xe29d('0x78')];_0x41722a['message'][_0xe29d('0x7a')]='reject';respondWithRpcPromise(_0xe29d('0x7c'),_0xe29d('0x7c'),{'event':_0xe29d('0x85'),'message':_['merge'](_0x4f3137[_0xe29d('0x2a')],JSON[_0xe29d('0x7e')](_0x4f3137[_0xe29d('0x68')][_0xe29d('0x7f')]))},client9002);return _0x4f3137;}return null;})[_0xe29d('0x22')](respondWithResult(_0x1ac75f,null))[_0xe29d('0x2c')](handleError(_0x1ac75f,null));}; \ No newline at end of file +var _0xc695=['chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteraction','get','RejectMessage','rejectMessage','contact','email','internal','interface','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','destroy','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','includeAll','find','body','params','catch','describe','../../config/logger'];(function(_0x56b477,_0x324907){var _0x4d4a52=function(_0xf5f913){while(--_0xf5f913){_0x56b477['push'](_0x56b477['shift']());}};_0x4d4a52(++_0x324907);}(_0xc695,0x1ae));var _0x5c69=function(_0x3fd50c,_0x1b41ed){_0x3fd50c=_0x3fd50c-0x0;var _0x4cebb2=_0xc695[_0x3fd50c];return _0x4cebb2;};'use strict';var emlformat=require(_0x5c69('0x0'));var rimraf=require(_0x5c69('0x1'));var zipdir=require(_0x5c69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c69('0x3'));var moment=require('moment');var BPromise=require(_0x5c69('0x4'));var Mustache=require(_0x5c69('0x5'));var util=require(_0x5c69('0x6'));var path=require(_0x5c69('0x7'));var sox=require('sox');var csv=require(_0x5c69('0x8'));var ejs=require(_0x5c69('0x9'));var fs=require('fs');var fs_extra=require(_0x5c69('0xa'));var _=require(_0x5c69('0xb'));var squel=require(_0x5c69('0xc'));var crypto=require('crypto');var jsforce=require(_0x5c69('0xd'));var deskjs=require(_0x5c69('0xe'));var toCsv=require(_0x5c69('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c69('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5c69('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c69('0x11'));var utils=require(_0x5c69('0x12'));var config=require(_0x5c69('0x13'));var licenseUtil=require(_0x5c69('0x14'));var db=require(_0x5c69('0x15'))['db'];config[_0x5c69('0x16')]=_[_0x5c69('0x17')](config[_0x5c69('0x16')],{'host':_0x5c69('0x18'),'port':0x18eb});var socket=require(_0x5c69('0x19'))(new Redis(config[_0x5c69('0x16')]));require('./chatMessage.socket')[_0x5c69('0x1a')](socket);var jayson=require(_0x5c69('0x1b'));var client=jayson['client'][_0x5c69('0x1c')]({'port':0x232c});var client9002=jayson[_0x5c69('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aa5db,_0xf5615f,_0x331d94,_0x1f70aa){return new BPromise(function(_0x17ec1f,_0x408dd1){var _0x4b90af=_0x1f70aa||client;return _0x4b90af[_0x5c69('0x1e')](_0x1aa5db,_0x331d94)[_0x5c69('0x1f')](function(_0x52e70b){logger[_0x5c69('0x20')](_0x5c69('0x21'),_0xf5615f,_0x5c69('0x22'));logger[_0x5c69('0x23')](_0x5c69('0x24'),_0xf5615f,_0x5c69('0x22'),JSON[_0x5c69('0x25')](_0x52e70b));if(_0x52e70b[_0x5c69('0x26')]){if(_0x52e70b[_0x5c69('0x26')]['code']===0x1f4){logger[_0x5c69('0x26')](_0x5c69('0x21'),_0xf5615f,_0x52e70b['error'][_0x5c69('0x27')]);return _0x408dd1(_0x52e70b[_0x5c69('0x26')][_0x5c69('0x27')]);}logger[_0x5c69('0x26')](_0x5c69('0x21'),_0xf5615f,_0x52e70b[_0x5c69('0x26')]['message']);return _0x17ec1f(_0x52e70b[_0x5c69('0x26')][_0x5c69('0x27')]);}else{logger['info'](_0x5c69('0x21'),_0xf5615f,_0x5c69('0x22'));_0x17ec1f(_0x52e70b[_0x5c69('0x28')]['message']);}})['catch'](function(_0x548d76){logger['error'](_0x5c69('0x21'),_0xf5615f,_0x548d76);_0x408dd1(_0x548d76);});});}function respondWithStatusCode(_0xeff031,_0x1bf201){_0x1bf201=_0x1bf201||0xcc;return function(_0x45fbf2){if(_0x45fbf2){return _0xeff031[_0x5c69('0x29')](_0x1bf201);}return _0xeff031[_0x5c69('0x2a')](_0x1bf201)[_0x5c69('0x2b')]();};}function respondWithResult(_0x33578e,_0x42b0e3){_0x42b0e3=_0x42b0e3||0xc8;return function(_0x4e55a0){if(_0x4e55a0){return _0x33578e['status'](_0x42b0e3)['json'](_0x4e55a0);}};}function respondWithFilteredResult(_0x2b1607,_0x3d1af5){return function(_0xc74a5e){if(_0xc74a5e){var _0x5b6146=typeof _0x3d1af5[_0x5c69('0x2c')]===_0x5c69('0x2d')&&typeof _0x3d1af5[_0x5c69('0x2e')]===_0x5c69('0x2d');var _0x32b458=_0xc74a5e[_0x5c69('0x2f')];var _0x398ec2=_0x5b6146?0x0:_0x3d1af5[_0x5c69('0x2c')];var _0x4e9dd3=_0x5b6146?_0xc74a5e[_0x5c69('0x2f')]:_0x3d1af5['offset']+_0x3d1af5[_0x5c69('0x2e')];var _0xa9be78;if(_0x4e9dd3>=_0x32b458){_0x4e9dd3=_0x32b458;_0xa9be78=0xc8;}else{_0xa9be78=0xce;}_0x2b1607[_0x5c69('0x2a')](_0xa9be78);return _0x2b1607['set']('Content-Range',_0x398ec2+'-'+_0x4e9dd3+'/'+_0x32b458)[_0x5c69('0x30')](_0xc74a5e);}return null;};}function patchUpdates(_0xc0dd2a){return function(_0x33d022){try{jsonpatch[_0x5c69('0x31')](_0x33d022,_0xc0dd2a,!![]);}catch(_0x5e4055){return BPromise[_0x5c69('0x32')](_0x5e4055);}return _0x33d022['save']();};}function saveUpdates(_0xcbf544,_0x28b70e){return function(_0x4d7e4b){if(_0x4d7e4b){return _0x4d7e4b[_0x5c69('0x33')](_0xcbf544)[_0x5c69('0x1f')](function(_0x385857){return _0x385857;});}return null;};}function removeEntity(_0xa3cf33,_0x41195f){return function(_0x57dd34){if(_0x57dd34){return _0x57dd34[_0x5c69('0x34')]()[_0x5c69('0x1f')](function(){_0xa3cf33[_0x5c69('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5f75,_0x25718a){return function(_0x22db34){if(!_0x22db34){_0x2d5f75[_0x5c69('0x29')](0x194);}return _0x22db34;};}function handleError(_0x3bf6c6,_0x35c255){_0x35c255=_0x35c255||0x1f4;return function(_0x1699af){logger[_0x5c69('0x26')](_0x1699af[_0x5c69('0x35')]);if(_0x1699af[_0x5c69('0x36')]){delete _0x1699af[_0x5c69('0x36')];}_0x3bf6c6[_0x5c69('0x2a')](_0x35c255)[_0x5c69('0x37')](_0x1699af);};}exports['index']=function(_0x185cbb,_0x495b27){var _0x5f4461={},_0x1966e7={},_0xf50860={'count':0x0,'rows':[]};var _0x143238=_['map'](db[_0x5c69('0x38')][_0x5c69('0x39')],function(_0x2415a4){return{'name':_0x2415a4[_0x5c69('0x3a')],'type':_0x2415a4[_0x5c69('0x3b')][_0x5c69('0x3c')]};});_0x1966e7[_0x5c69('0x3d')]=_[_0x5c69('0x3e')](_0x143238,_0x5c69('0x36'));_0x1966e7[_0x5c69('0x3f')]=_[_0x5c69('0x40')](_0x185cbb[_0x5c69('0x3f')]);_0x1966e7[_0x5c69('0x41')]=_['intersection'](_0x1966e7[_0x5c69('0x3d')],_0x1966e7[_0x5c69('0x3f')]);_0x5f4461[_0x5c69('0x42')]=_[_0x5c69('0x43')](_0x1966e7[_0x5c69('0x3d')],qs['fields'](_0x185cbb['query'][_0x5c69('0x44')]));_0x5f4461[_0x5c69('0x42')]=_0x5f4461[_0x5c69('0x42')][_0x5c69('0x45')]?_0x5f4461[_0x5c69('0x42')]:_0x1966e7['model'];if(!_0x185cbb['query'][_0x5c69('0x46')](_0x5c69('0x47'))){_0x5f4461['limit']=qs[_0x5c69('0x2e')](_0x185cbb[_0x5c69('0x3f')][_0x5c69('0x2e')]);_0x5f4461['offset']=qs[_0x5c69('0x2c')](_0x185cbb['query'][_0x5c69('0x2c')]);}_0x5f4461[_0x5c69('0x48')]=qs[_0x5c69('0x49')](_0x185cbb[_0x5c69('0x3f')]['sort']);_0x5f4461[_0x5c69('0x4a')]=qs[_0x5c69('0x41')](_['pick'](_0x185cbb[_0x5c69('0x3f')],_0x1966e7[_0x5c69('0x41')]),_0x143238);if(_0x185cbb[_0x5c69('0x3f')]['filter']){_0x5f4461[_0x5c69('0x4a')]=_[_0x5c69('0x4b')](_0x5f4461[_0x5c69('0x4a')],{'$or':_[_0x5c69('0x3e')](_0x143238,function(_0xfd3729){if(_0xfd3729[_0x5c69('0x3b')]!==_0x5c69('0x4c')){var _0x507f23={};_0x507f23[_0xfd3729[_0x5c69('0x36')]]={'$like':'%'+_0x185cbb['query'][_0x5c69('0x4d')]+'%'};return _0x507f23;}})});}_0x5f4461=_['merge']({},_0x5f4461,_0x185cbb[_0x5c69('0x4e')]);var _0x17ce96={'where':_0x5f4461[_0x5c69('0x4a')]};return db[_0x5c69('0x38')][_0x5c69('0x2f')](_0x17ce96)[_0x5c69('0x1f')](function(_0x4a4717){_0xf50860['count']=_0x4a4717;if(_0x185cbb[_0x5c69('0x3f')]['includeAll']){_0x5f4461[_0x5c69('0x4f')]=[{'all':!![]}];}return db[_0x5c69('0x38')][_0x5c69('0x50')](_0x5f4461);})[_0x5c69('0x1f')](function(_0x37c852){_0xf50860[_0x5c69('0x51')]=_0x37c852;return _0xf50860;})[_0x5c69('0x1f')](respondWithFilteredResult(_0x495b27,_0x5f4461))['catch'](handleError(_0x495b27,null));};exports[_0x5c69('0x52')]=function(_0x467692,_0x454aba){var _0x31efaf={'raw':!![],'where':{'id':_0x467692['params']['id']}},_0x135389={};_0x135389['model']=_[_0x5c69('0x40')](db[_0x5c69('0x38')][_0x5c69('0x39')]);_0x135389['query']=_[_0x5c69('0x40')](_0x467692[_0x5c69('0x3f')]);_0x135389[_0x5c69('0x41')]=_[_0x5c69('0x43')](_0x135389['model'],_0x135389[_0x5c69('0x3f')]);_0x31efaf[_0x5c69('0x42')]=_[_0x5c69('0x43')](_0x135389[_0x5c69('0x3d')],qs['fields'](_0x467692[_0x5c69('0x3f')][_0x5c69('0x44')]));_0x31efaf[_0x5c69('0x42')]=_0x31efaf[_0x5c69('0x42')]['length']?_0x31efaf[_0x5c69('0x42')]:_0x135389['model'];if(_0x467692[_0x5c69('0x3f')][_0x5c69('0x53')]){_0x31efaf[_0x5c69('0x4f')]=[{'all':!![]}];}_0x31efaf=_[_0x5c69('0x4b')]({},_0x31efaf,_0x467692['options']);return db[_0x5c69('0x38')][_0x5c69('0x54')](_0x31efaf)[_0x5c69('0x1f')](handleEntityNotFound(_0x454aba,null))[_0x5c69('0x1f')](respondWithResult(_0x454aba,null))['catch'](handleError(_0x454aba,null));};exports['create']=function(_0x4cc7cd,_0x1a9e2a){return db['ChatMessage']['create'](_0x4cc7cd['body'],{})[_0x5c69('0x1f')](respondWithResult(_0x1a9e2a,0xc9))['catch'](handleError(_0x1a9e2a,null));};exports[_0x5c69('0x33')]=function(_0x119c35,_0x41c889){if(_0x119c35[_0x5c69('0x55')]['id']){delete _0x119c35[_0x5c69('0x55')]['id'];}return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x119c35[_0x5c69('0x56')]['id']}})['then'](handleEntityNotFound(_0x41c889,null))[_0x5c69('0x1f')](saveUpdates(_0x119c35[_0x5c69('0x55')],null))[_0x5c69('0x1f')](respondWithResult(_0x41c889,null))[_0x5c69('0x57')](handleError(_0x41c889,null));};exports['destroy']=function(_0x391edf,_0x484730){return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x391edf[_0x5c69('0x56')]['id']}})[_0x5c69('0x1f')](handleEntityNotFound(_0x484730,null))['then'](removeEntity(_0x484730,null))[_0x5c69('0x57')](handleError(_0x484730,null));};exports[_0x5c69('0x58')]=function(_0x4337e4,_0x555007){return db[_0x5c69('0x38')][_0x5c69('0x58')]()['then'](respondWithResult(_0x555007,null))[_0x5c69('0x57')](handleError(_0x555007,null));};var interaction_log=require(_0x5c69('0x59'))(_0x5c69('0x5a'));exports[_0x5c69('0x5b')]=function(_0x50f335,_0xe27e7b,_0x2170de){var _0x48c1b1={'agent':{},'channel':'chat'};if(_0x50f335[_0x5c69('0x55')]['id']){delete _0x50f335['body']['id'];}_0x50f335[_0x5c69('0x55')][_0x5c69('0x5c')]=!![];_0x50f335[_0x5c69('0x55')][_0x5c69('0x5d')]=moment()[_0x5c69('0x5e')](_0x5c69('0x5f'));_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')]=_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')]||_0x50f335[_0x5c69('0x61')]['id'];_0x48c1b1[_0x5c69('0x62')]['id']=_0x50f335['body']['UserId'];return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x50f335[_0x5c69('0x56')]['id'],'UserId':null}})[_0x5c69('0x1f')](handleEntityNotFound(_0xe27e7b,null))['then'](saveUpdates(_0x50f335[_0x5c69('0x55')],null))[_0x5c69('0x1f')](function(_0x4094ee){if(_0x4094ee){_0x48c1b1[_0x5c69('0x27')]=_0x4094ee['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4094ee[_0x5c69('0x63')]}});}return null;})[_0x5c69('0x1f')](handleEntityNotFound(_0xe27e7b,null))[_0x5c69('0x1f')](function(_0x2e5a18){if(_0x2e5a18){return _0x2e5a18[_0x5c69('0x33')]({'UserId':_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')],'read1stAt':_[_0x5c69('0x64')](_0x2e5a18[_0x5c69('0x65')])?moment()[_0x5c69('0x5e')](_0x5c69('0x5f')):undefined});}return null;})[_0x5c69('0x1f')](function(_0x28737a){if(_0x28737a){_0x48c1b1[_0x5c69('0x66')]=_0x28737a['get']({'plain':!![]});interaction_log[_0x5c69('0x20')](_0x5c69('0x67'),_0x50f335[_0x5c69('0x61')]['id'],_0x50f335[_0x5c69('0x61')]['name'],_0x50f335['user'][_0x5c69('0x68')],_0x48c1b1[_0x5c69('0x66')]['id'],_0x50f335[_0x5c69('0x55')]?JSON[_0x5c69('0x25')](_0x50f335['body']):_0x5c69('0x69'));return respondWithRpcPromise('AcceptMessage',_0x5c69('0x6a'),_0x48c1b1);}return null;})[_0x5c69('0x1f')](function(_0x5f25b7){var _0x59092d=_0x5c69('0x6b')+_0x5f25b7['message']['ContactId'];return db[_0x5c69('0x6c')][_0x5c69('0x3f')](_0x59092d,{'type':db[_0x5c69('0x6d')][_0x5c69('0x6e')][_0x5c69('0x6f')],'raw':!![]})[_0x5c69('0x1f')](function(_0x37ed5a){return _0x37ed5a;});})[_0x5c69('0x1f')](function(_0x4e612e){if(_0x4e612e){_0x48c1b1[_0x5c69('0x27')]['contact']=_0x4e612e[0x0];if(!_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')])return;return db[_0x5c69('0x70')][_0x5c69('0x54')]({'where':{'id':_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')],'role':_0x5c69('0x62')},'attributes':['id',_0x5c69('0x36'),_0x5c69('0x71'),'email','internal'],'raw':!![]});}return null;})[_0x5c69('0x1f')](function(_0x197bb6){if(!_0x197bb6)return null;_0x48c1b1[_0x5c69('0x27')]['agent']=_0x197bb6;return _0x48c1b1;})['then'](function(_0xbed95b){if(_0xbed95b){if(_0x50f335['body']['manual']){_0x48c1b1[_0x5c69('0x27')]['interface']=util[_0x5c69('0x5e')](_0x5c69('0x72'),_0x50f335[_0x5c69('0x61')][_0x5c69('0x36')]);_0x48c1b1[_0x5c69('0x27')][_0x5c69('0x73')]=_0x48c1b1[_0x5c69('0x73')];_0x48c1b1[_0x5c69('0x27')][_0x5c69('0x74')]=_0x48c1b1[_0x5c69('0x73')];_0x48c1b1[_0x5c69('0x27')][_0x5c69('0x75')]=_0x5c69('0x5b');return respondWithRpcPromise(_0x5c69('0x76'),_0x5c69('0x76'),{'event':_0x5c69('0x77'),'message':_[_0x5c69('0x4b')](_0x48c1b1[_0x5c69('0x27')],JSON[_0x5c69('0x78')](_0x48c1b1['interaction'][_0x5c69('0x79')]))},client9002)[_0x5c69('0x1f')](function(){return _0x48c1b1;});}return _0x48c1b1;}return null;})[_0x5c69('0x1f')](respondWithResult(_0xe27e7b,null))[_0x5c69('0x57')](handleError(_0xe27e7b,null));};var interaction_log=require(_0x5c69('0x59'))(_0x5c69('0x5a'));exports[_0x5c69('0x32')]=function(_0x2cfd92,_0x37d1f9,_0x18bacb){var _0x149770={'agent':{},'channel':'chat'};if(_0x2cfd92[_0x5c69('0x55')]['id']){delete _0x2cfd92[_0x5c69('0x55')]['id'];}_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')]=_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')]||_0x2cfd92[_0x5c69('0x61')]['id'];_0x149770[_0x5c69('0x62')]['id']=_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')];return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x2cfd92[_0x5c69('0x56')]['id'],'UserId':null}})[_0x5c69('0x1f')](handleEntityNotFound(_0x37d1f9,null))['then'](function(_0x3b9137){if(_0x3b9137){_0x149770['message']=_0x3b9137['get']({'plain':!![]});return db[_0x5c69('0x7a')][_0x5c69('0x54')]({'where':{'id':_0x3b9137[_0x5c69('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x37d1f9,null))[_0x5c69('0x1f')](function(_0x20a2fd){if(_0x20a2fd){_0x149770[_0x5c69('0x66')]=_0x20a2fd[_0x5c69('0x7b')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cfd92['user']['id'],_0x2cfd92[_0x5c69('0x61')][_0x5c69('0x36')],_0x2cfd92[_0x5c69('0x61')][_0x5c69('0x68')],_0x149770[_0x5c69('0x66')]['id'],_0x2cfd92[_0x5c69('0x55')]?JSON['stringify'](_0x2cfd92[_0x5c69('0x55')]):_0x5c69('0x69'));return respondWithRpcPromise(_0x5c69('0x7c'),_0x5c69('0x7d'),_0x149770);}return null;})[_0x5c69('0x1f')](function(_0x59f304){var _0x612c46='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x59f304['message']['ContactId'];return db[_0x5c69('0x6c')][_0x5c69('0x3f')](_0x612c46,{'type':db[_0x5c69('0x6d')]['QueryTypes'][_0x5c69('0x6f')],'raw':!![]})[_0x5c69('0x1f')](function(_0x32b8b2){return _0x32b8b2;});})['then'](function(_0xb23d0){if(_0xb23d0){_0x149770[_0x5c69('0x27')][_0x5c69('0x7e')]=_0xb23d0[0x0];if(!_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')])return;return db[_0x5c69('0x70')][_0x5c69('0x54')]({'where':{'id':_0x2cfd92['body'][_0x5c69('0x60')],'role':_0x5c69('0x62')},'attributes':['id',_0x5c69('0x36'),_0x5c69('0x71'),_0x5c69('0x7f'),_0x5c69('0x80')],'raw':!![]});}return null;})[_0x5c69('0x1f')](function(_0x132faa){if(!_0x132faa)return null;_0x149770['message'][_0x5c69('0x62')]=_0x132faa;return _0x149770;})[_0x5c69('0x1f')](function(_0x54e1bb){if(_0x54e1bb){_0x54e1bb['message'][_0x5c69('0x81')]=util[_0x5c69('0x5e')]('SIP/%s',_0x2cfd92[_0x5c69('0x61')][_0x5c69('0x36')]);_0x54e1bb[_0x5c69('0x27')][_0x5c69('0x73')]=_0x149770[_0x5c69('0x73')];_0x54e1bb[_0x5c69('0x27')][_0x5c69('0x74')]=_0x149770[_0x5c69('0x73')];_0x54e1bb[_0x5c69('0x27')][_0x5c69('0x75')]='reject';respondWithRpcPromise(_0x5c69('0x76'),_0x5c69('0x76'),{'event':'rejectmessage','message':_['merge'](_0x149770[_0x5c69('0x27')],JSON[_0x5c69('0x78')](_0x149770['interaction'][_0x5c69('0x79')]))},client9002);return _0x149770;}return null;})['then'](respondWithResult(_0x37d1f9,null))[_0x5c69('0x57')](handleError(_0x37d1f9,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index b5463ea..dcda08b 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 _0xd192=['remove','emit','hasOwnProperty','exports','events','ChatMessage','setMaxListeners','save','update'];(function(_0xc83b33,_0x5d6cee){var _0x4dd7b8=function(_0x3687bf){while(--_0x3687bf){_0xc83b33['push'](_0xc83b33['shift']());}};_0x4dd7b8(++_0x5d6cee);}(_0xd192,0x67));var _0x2d19=function(_0x1fdbef,_0x41d245){_0x1fdbef=_0x1fdbef-0x0;var _0x21680a=_0xd192[_0x1fdbef];return _0x21680a;};'use strict';var EventEmitter=require(_0x2d19('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x2d19('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2d19('0x2')](0x0);var events={'afterCreate':_0x2d19('0x3'),'afterUpdate':_0x2d19('0x4'),'afterDestroy':_0x2d19('0x5')};function emitEvent(_0x5ebd1b){return function(_0x6330ae,_0x9d3b95,_0x426924){ChatMessageEvents[_0x2d19('0x6')](_0x5ebd1b+':'+_0x6330ae['id'],_0x6330ae);ChatMessageEvents[_0x2d19('0x6')](_0x5ebd1b,_0x6330ae);_0x426924(null);};}for(var e in events){if(events[_0x2d19('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x2d19('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xc55a=['update','remove','emit','hook','exports','events','ChatMessage','setMaxListeners','save'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xc55a,0x9e));var _0xac55=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc55a[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0xac55('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xac55('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xac55('0x2')](0x0);var events={'afterCreate':_0xac55('0x3'),'afterUpdate':_0xac55('0x4'),'afterDestroy':_0xac55('0x5')};function emitEvent(_0x4e8b6d){return function(_0x438d8,_0x144589,_0x27530d){ChatMessageEvents['emit'](_0x4e8b6d+':'+_0x438d8['id'],_0x438d8);ChatMessageEvents[_0xac55('0x6')](_0x4e8b6d,_0x438d8);_0x27530d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xac55('0x7')](e,emitEvent(event));}}module[_0xac55('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 0cb5027..1c52016 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 _0x8d20=['path','rimraf','../../config/environment','exports','define','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f2438,_0x1aa150){var _0x25d498=function(_0x2a3fe4){while(--_0x2a3fe4){_0x1f2438['push'](_0x1f2438['shift']());}};_0x25d498(++_0x1aa150);}(_0x8d20,0x1c5));var _0x08d2=function(_0x4136b8,_0x9ce0ab){_0x4136b8=_0x4136b8-0x0;var _0x161647=_0x8d20[_0x4136b8];return _0x161647;};'use strict';var _=require('lodash');var util=require(_0x08d2('0x0'));var logger=require(_0x08d2('0x1'))(_0x08d2('0x2'));var moment=require(_0x08d2('0x3'));var BPromise=require(_0x08d2('0x4'));var rp=require(_0x08d2('0x5'));var fs=require('fs');var path=require(_0x08d2('0x6'));var rimraf=require(_0x08d2('0x7'));var config=require(_0x08d2('0x8'));var attributes=require('./chatMessage.attributes');module[_0x08d2('0x9')]=function(_0x459e2c,_0x1acbf4){return _0x459e2c[_0x08d2('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x08d2('0xb'),'fields':[_0x08d2('0xc')],'type':_0x08d2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xaf964,_0x3ff53f,_0x3f9e21){var _0x3112d0=_0x459e2c['models'];var _0x463135=_0xaf964['get']({'plain':!![]});if(_0x463135[_0x08d2('0xe')][_0x08d2('0xf')]()==='in'||_0x463135[_0x08d2('0xe')]['toLowerCase']()==='out'&&!_0x463135[_0x08d2('0x10')]&&!_[_0x08d2('0x11')](_0x463135[_0x08d2('0x12')])){_0x3112d0[_0x08d2('0x13')][_0x08d2('0x14')]({'where':{'id':_0x463135['ChatInteractionId']}})[_0x08d2('0x15')](function(_0x3c4718){if(_0x3c4718){_0x3c4718[_0x08d2('0x16')]({'lastMsgAt':_0x463135[_0x08d2('0x17')],'lastMsgDirection':_0x463135[_0x08d2('0xe')][_0x08d2('0xf')]()});}})[_0x08d2('0x18')](function(_0x3f355a){console['error'](_0x3f355a);});}_0x3f9e21();}},'charset':_0x08d2('0x19'),'collate':_0x08d2('0x1a')});}; \ No newline at end of file +var _0x8b0d=['then','createdAt','catch','error','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x8b0d,0x1f2));var _0xd8b0=function(_0x3d0c6c,_0x56c36c){_0x3d0c6c=_0x3d0c6c-0x0;var _0x13f5b6=_0x8b0d[_0x3d0c6c];return _0x13f5b6;};'use strict';var _=require(_0xd8b0('0x0'));var util=require(_0xd8b0('0x1'));var logger=require(_0xd8b0('0x2'))('api');var moment=require(_0xd8b0('0x3'));var BPromise=require(_0xd8b0('0x4'));var rp=require(_0xd8b0('0x5'));var fs=require('fs');var path=require(_0xd8b0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd8b0('0x7'));module[_0xd8b0('0x8')]=function(_0x34bae6,_0x1bd8cd){return _0x34bae6[_0xd8b0('0x9')]('ChatMessage',attributes,{'tableName':_0xd8b0('0xa'),'paranoid':![],'indexes':[{'name':_0xd8b0('0xb'),'fields':[_0xd8b0('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51c1f2,_0x532c0c,_0x5bafb4){var _0x4e38bd=_0x34bae6[_0xd8b0('0xd')];var _0x6b2f28=_0x51c1f2['get']({'plain':!![]});if(_0x6b2f28[_0xd8b0('0xe')][_0xd8b0('0xf')]()==='in'||_0x6b2f28[_0xd8b0('0xe')][_0xd8b0('0xf')]()===_0xd8b0('0x10')&&!_0x6b2f28[_0xd8b0('0x11')]&&!_[_0xd8b0('0x12')](_0x6b2f28[_0xd8b0('0x13')])){_0x4e38bd['ChatInteraction'][_0xd8b0('0x14')]({'where':{'id':_0x6b2f28[_0xd8b0('0x15')]}})[_0xd8b0('0x16')](function(_0x564b7f){if(_0x564b7f){_0x564b7f['update']({'lastMsgAt':_0x6b2f28[_0xd8b0('0x17')],'lastMsgDirection':_0x6b2f28[_0xd8b0('0xe')][_0xd8b0('0xf')]()});}})[_0xd8b0('0x18')](function(_0x5f308c){console[_0xd8b0('0x19')](_0x5f308c);});}_0x5bafb4();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 539e282..bdfd031 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 _0xa808=['stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatMessage','ChatMessage','body','options','raw'];(function(_0x37679c,_0x1873fe){var _0x26b3b4=function(_0xb6ce4d){while(--_0xb6ce4d){_0x37679c['push'](_0x37679c['shift']());}};_0x26b3b4(++_0x1873fe);}(_0xa808,0x12b));var _0x8a80=function(_0x466fc5,_0x44df27){_0x466fc5=_0x466fc5-0x0;var _0x351e8a=_0xa808[_0x466fc5];return _0x351e8a;};'use strict';var _=require(_0x8a80('0x0'));var util=require(_0x8a80('0x1'));var moment=require('moment');var BPromise=require(_0x8a80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a80('0x3'));var db=require(_0x8a80('0x4'))['db'];var utils=require(_0x8a80('0x5'));var logger=require('../../config/logger')(_0x8a80('0x6'));var config=require(_0x8a80('0x7'));var jayson=require(_0x8a80('0x8'));var client=jayson[_0x8a80('0x9')][_0x8a80('0xa')]({'port':0x232a});config[_0x8a80('0xb')]=_[_0x8a80('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8a80('0xd'))(new Redis(config[_0x8a80('0xb')]));require(_0x8a80('0xe'))[_0x8a80('0xf')](socket);function respondWithRpcPromise(_0x27361c,_0x606674,_0x8f8cdd){return new BPromise(function(_0x30868c,_0x3702d6){return client['request'](_0x27361c,_0x8f8cdd)[_0x8a80('0x10')](function(_0x527d7a){logger[_0x8a80('0x11')](_0x8a80('0x12'),_0x606674,_0x8a80('0x13'));logger[_0x8a80('0x14')](_0x8a80('0x15'),_0x606674,_0x8a80('0x13'),JSON['stringify'](_0x527d7a));if(_0x527d7a[_0x8a80('0x16')]){if(_0x527d7a[_0x8a80('0x16')][_0x8a80('0x17')]===0x1f4){logger[_0x8a80('0x16')](_0x8a80('0x12'),_0x606674,_0x527d7a['error'][_0x8a80('0x18')]);return _0x3702d6(_0x527d7a[_0x8a80('0x16')]['message']);}logger[_0x8a80('0x16')](_0x8a80('0x12'),_0x606674,_0x527d7a['error'][_0x8a80('0x18')]);return _0x30868c(_0x527d7a['error'][_0x8a80('0x18')]);}else{logger['info'](_0x8a80('0x12'),_0x606674,_0x8a80('0x13'));_0x30868c(_0x527d7a[_0x8a80('0x19')][_0x8a80('0x18')]);}})['catch'](function(_0x10e306){logger[_0x8a80('0x16')]('ChatMessage,\x20%s,\x20%s',_0x606674,_0x10e306);_0x3702d6(_0x10e306);});});}exports[_0x8a80('0x1a')]=function(_0x2e68e5){var _0x24f342=this;return new Promise(function(_0x328b04,_0x55250a){return db[_0x8a80('0x1b')]['create'](_0x2e68e5[_0x8a80('0x1c')],{'raw':_0x2e68e5[_0x8a80('0x1d')]?_0x2e68e5[_0x8a80('0x1d')][_0x8a80('0x1e')]===undefined?!![]:![]:!![]})[_0x8a80('0x10')](function(_0x395532){logger[_0x8a80('0x11')](_0x8a80('0x1a'),_0x2e68e5);logger[_0x8a80('0x14')](_0x8a80('0x1a'),_0x2e68e5,JSON[_0x8a80('0x1f')](_0x395532));_0x328b04(_0x395532);})[_0x8a80('0x20')](function(_0x1e1e9f){logger['error'](_0x8a80('0x1a'),_0x1e1e9f['message'],_0x2e68e5);_0x55250a(_0x24f342['error'](0x1f4,_0x1e1e9f[_0x8a80('0x18')]));});});}; \ No newline at end of file +var _0x3a94=['redis','defaults','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x11c93e,_0xd3235e){var _0x3d1726=function(_0x3dc228){while(--_0x3dc228){_0x11c93e['push'](_0x11c93e['shift']());}};_0x3d1726(++_0xd3235e);}(_0x3a94,0x105));var _0x43a9=function(_0x5866c7,_0x5f4a5c){_0x5866c7=_0x5866c7-0x0;var _0x14a350=_0x3a94[_0x5866c7];return _0x14a350;};'use strict';var _=require(_0x43a9('0x0'));var util=require(_0x43a9('0x1'));var moment=require('moment');var BPromise=require(_0x43a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43a9('0x3'));var db=require(_0x43a9('0x4'))['db'];var utils=require(_0x43a9('0x5'));var logger=require('../../config/logger')(_0x43a9('0x6'));var config=require(_0x43a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43a9('0x8')]['http']({'port':0x232a});config[_0x43a9('0x9')]=_[_0x43a9('0xa')](config[_0x43a9('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43a9('0x9')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4562f6,_0x95b0c2,_0x1b17f8){return new BPromise(function(_0x530d23,_0x31362d){return client[_0x43a9('0xb')](_0x4562f6,_0x1b17f8)[_0x43a9('0xc')](function(_0x1ba77b){logger['info'](_0x43a9('0xd'),_0x95b0c2,_0x43a9('0xe'));logger[_0x43a9('0xf')](_0x43a9('0x10'),_0x95b0c2,'request\x20sent',JSON[_0x43a9('0x11')](_0x1ba77b));if(_0x1ba77b['error']){if(_0x1ba77b['error'][_0x43a9('0x12')]===0x1f4){logger[_0x43a9('0x13')](_0x43a9('0xd'),_0x95b0c2,_0x1ba77b[_0x43a9('0x13')][_0x43a9('0x14')]);return _0x31362d(_0x1ba77b[_0x43a9('0x13')][_0x43a9('0x14')]);}logger[_0x43a9('0x13')](_0x43a9('0xd'),_0x95b0c2,_0x1ba77b[_0x43a9('0x13')]['message']);return _0x530d23(_0x1ba77b[_0x43a9('0x13')]['message']);}else{logger[_0x43a9('0x15')](_0x43a9('0xd'),_0x95b0c2,'request\x20sent');_0x530d23(_0x1ba77b[_0x43a9('0x16')]['message']);}})[_0x43a9('0x17')](function(_0x106898){logger[_0x43a9('0x13')](_0x43a9('0xd'),_0x95b0c2,_0x106898);_0x31362d(_0x106898);});});}exports[_0x43a9('0x18')]=function(_0x14b265){var _0x2bf949=this;return new Promise(function(_0x143e58,_0x4f69e8){return db[_0x43a9('0x19')][_0x43a9('0x1a')](_0x14b265[_0x43a9('0x1b')],{'raw':_0x14b265[_0x43a9('0x1c')]?_0x14b265['options'][_0x43a9('0x1d')]===undefined?!![]:![]:!![]})[_0x43a9('0xc')](function(_0x3de3ed){logger[_0x43a9('0x15')](_0x43a9('0x18'),_0x14b265);logger[_0x43a9('0xf')](_0x43a9('0x18'),_0x14b265,JSON['stringify'](_0x3de3ed));_0x143e58(_0x3de3ed);})[_0x43a9('0x17')](function(_0xbeb8ce){logger[_0x43a9('0x13')](_0x43a9('0x18'),_0xbeb8ce['message'],_0x14b265);_0x4f69e8(_0x2bf949[_0x43a9('0x13')](0x1f4,_0xbeb8ce['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index aadcb60..05d8854 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 _0x49c4=['chatMessage:','./chatMessage.events','remove','update','emit','register','length'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x49c4,0x9b));var _0x449c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x49c4[_0x2641f9];return _0x585741;};'use strict';var ChatMessageEvents=require(_0x449c('0x0'));var events=['save',_0x449c('0x1'),_0x449c('0x2')];function createListener(_0x17bf65,_0x1d60ee){return function(_0x2646ac){_0x1d60ee[_0x449c('0x3')](_0x17bf65,_0x2646ac);};}function removeListener(_0x23314e,_0x5b564c){return function(){ChatMessageEvents['removeListener'](_0x23314e,_0x5b564c);};}exports[_0x449c('0x4')]=function(_0x442e56){for(var _0x12586c=0x0,_0x2db09a=events[_0x449c('0x5')];_0x12586c<_0x2db09a;_0x12586c++){var _0x43cb0e=events[_0x12586c];var _0x3e6354=createListener(_0x449c('0x6')+_0x43cb0e,_0x442e56);ChatMessageEvents['on'](_0x43cb0e,_0x3e6354);}}; \ No newline at end of file +var _0x1db9=['remove','update','emit','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x2f742b,_0x3ca4ad){var _0x4ffc39=function(_0x236f2f){while(--_0x236f2f){_0x2f742b['push'](_0x2f742b['shift']());}};_0x4ffc39(++_0x3ca4ad);}(_0x1db9,0x176));var _0x91db=function(_0x359e56,_0x4522f6){_0x359e56=_0x359e56-0x0;var _0x2b2662=_0x1db9[_0x359e56];return _0x2b2662;};'use strict';var ChatMessageEvents=require(_0x91db('0x0'));var events=[_0x91db('0x1'),_0x91db('0x2'),_0x91db('0x3')];function createListener(_0xcdfaed,_0xb6de0b){return function(_0x49b8c5){_0xb6de0b[_0x91db('0x4')](_0xcdfaed,_0x49b8c5);};}function removeListener(_0x42ae75,_0x59c944){return function(){ChatMessageEvents['removeListener'](_0x42ae75,_0x59c944);};}exports[_0x91db('0x5')]=function(_0x4b3f5c){for(var _0x5e69d9=0x0,_0x433c75=events[_0x91db('0x6')];_0x5e69d9<_0x433c75;_0x5e69d9++){var _0x45fea0=events[_0x5e69d9];var _0x2330c2=createListener(_0x91db('0x7')+_0x45fea0,_0x4b3f5c);ChatMessageEvents['on'](_0x45fea0,_0x2330c2);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 08e839d..008819d 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 _0x95b9=['reject','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept'];(function(_0x21852b,_0x252996){var _0x369e2f=function(_0x58974a){while(--_0x58974a){_0x21852b['push'](_0x21852b['shift']());}};_0x369e2f(++_0x252996);}(_0x95b9,0xc1));var _0x995b=function(_0x5a5f4a,_0x38b29c){_0x5a5f4a=_0x5a5f4a-0x0;var _0x5cec38=_0x95b9[_0x5a5f4a];return _0x5cec38;};'use strict';var multer=require('multer');var util=require(_0x995b('0x0'));var path=require(_0x995b('0x1'));var timeout=require('connect-timeout');var express=require(_0x995b('0x2'));var router=express[_0x995b('0x3')]();var fs_extra=require(_0x995b('0x4'));var auth=require(_0x995b('0x5'));var interaction=require(_0x995b('0x6'));var config=require('../../config/environment');var controller=require(_0x995b('0x7'));router[_0x995b('0x8')]('/',auth[_0x995b('0x9')](),controller['index']);router[_0x995b('0x8')](_0x995b('0xa'),auth[_0x995b('0x9')](),controller[_0x995b('0xb')]);router[_0x995b('0x8')](_0x995b('0xc'),auth[_0x995b('0x9')](),controller[_0x995b('0xd')]);router[_0x995b('0xe')]('/',auth['isAuthenticated'](),interaction[_0x995b('0xf')](_0x995b('0x10'),_0x995b('0x11')),controller[_0x995b('0x12')]);router[_0x995b('0x13')](_0x995b('0xc'),controller[_0x995b('0x14')]);router[_0x995b('0x13')](_0x995b('0x15'),auth[_0x995b('0x9')](),controller[_0x995b('0x16')]);router['put']('/:id/reject',auth[_0x995b('0x9')](),controller[_0x995b('0x17')]);router[_0x995b('0x18')](_0x995b('0xc'),auth['isAuthenticated'](),controller[_0x995b('0x19')]);module[_0x995b('0x1a')]=router; \ No newline at end of file +var _0x15bb=['chatmessage:create','create','put','update','accept','/:id/reject','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','post','tracked','chat'];(function(_0x2b435e,_0x427598){var _0x4cab98=function(_0x5d4981){while(--_0x5d4981){_0x2b435e['push'](_0x2b435e['shift']());}};_0x4cab98(++_0x427598);}(_0x15bb,0x140));var _0xb15b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x15bb[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xb15b('0x0'));var util=require(_0xb15b('0x1'));var path=require(_0xb15b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb15b('0x3'));var router=express[_0xb15b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb15b('0x5'));var interaction=require(_0xb15b('0x6'));var config=require(_0xb15b('0x7'));var controller=require(_0xb15b('0x8'));router[_0xb15b('0x9')]('/',auth[_0xb15b('0xa')](),controller[_0xb15b('0xb')]);router[_0xb15b('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb15b('0x9')](_0xb15b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb15b('0xd')]('/',auth[_0xb15b('0xa')](),interaction[_0xb15b('0xe')](_0xb15b('0xf'),_0xb15b('0x10')),controller[_0xb15b('0x11')]);router[_0xb15b('0x12')]('/:id',controller[_0xb15b('0x13')]);router[_0xb15b('0x12')]('/:id/accept',auth[_0xb15b('0xa')](),controller[_0xb15b('0x14')]);router['put'](_0xb15b('0x15'),auth[_0xb15b('0xa')](),controller['reject']);router[_0xb15b('0x16')]('/:id',auth[_0xb15b('0xa')](),controller['destroy']);module[_0xb15b('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index de44d8d..70132e0 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0b0e[_0x53ccf2];return _0x5a2964;};'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 +var _0x757a=['exports','TEXT'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x757a,0xde));var _0xa757=function(_0x43745e,_0x5db622){_0x43745e=_0x43745e-0x0;var _0x24b299=_0x757a[_0x43745e];return _0x24b299;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index ece8cb4..1d6f460 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(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x7a54,0x106));var _0x47a5=function(_0x491320,_0x2992f0){_0x491320=_0x491320-0x0;var _0x3de290=_0x7a54[_0x491320];return _0x3de290;};'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(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x7a54,0x106));var _0x47a5=function(_0x545264,_0x5930ed){_0x545264=_0x545264-0x0;var _0x5796fb=_0x7a54[_0x545264];return _0x5796fb;};'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 1934637..fb1160c 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 _0x8591=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x45de85,_0x551d79){var _0x56d89d=function(_0x420e56){while(--_0x420e56){_0x45de85['push'](_0x45de85['shift']());}};_0x56d89d(++_0x551d79);}(_0x8591,0x1ec));var _0x1859=function(_0x51e3e5,_0x255f82){_0x51e3e5=_0x51e3e5-0x0;var _0x117d19=_0x8591[_0x51e3e5];return _0x117d19;};'use strict';var EventEmitter=require(_0x1859('0x0'));var ChatOfflineMessage=require(_0x1859('0x1'))['db'][_0x1859('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1859('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1859('0x4'),'afterDestroy':_0x1859('0x5')};function emitEvent(_0x3f27f1){return function(_0x18633f,_0x5c9dbf,_0x20e51f){ChatOfflineMessageEvents['emit'](_0x3f27f1+':'+_0x18633f['id'],_0x18633f);ChatOfflineMessageEvents[_0x1859('0x6')](_0x3f27f1,_0x18633f);_0x20e51f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x1859('0x7')](e,emitEvent(event));}}module[_0x1859('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x7e4b=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x3bcdce,_0x1c46e6){var _0x4bf157=function(_0x481b75){while(--_0x481b75){_0x3bcdce['push'](_0x3bcdce['shift']());}};_0x4bf157(++_0x1c46e6);}(_0x7e4b,0x84));var _0xb7e4=function(_0x138edd,_0x2ff254){_0x138edd=_0x138edd-0x0;var _0x53c23d=_0x7e4b[_0x138edd];return _0x53c23d;};'use strict';var EventEmitter=require(_0xb7e4('0x0'));var ChatOfflineMessage=require(_0xb7e4('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xb7e4('0x2')](0x0);var events={'afterCreate':_0xb7e4('0x3'),'afterUpdate':'update','afterDestroy':_0xb7e4('0x4')};function emitEvent(_0x1d32fd){return function(_0x2fca1d,_0x32f781,_0xb51013){ChatOfflineMessageEvents[_0xb7e4('0x5')](_0x1d32fd+':'+_0x2fca1d['id'],_0x2fca1d);ChatOfflineMessageEvents[_0xb7e4('0x5')](_0x1d32fd,_0x2fca1d);_0xb51013(null);};}for(var e in events){if(events[_0xb7e4('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xb7e4('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 1b28419..51fe314 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 _0xd165=['utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x5c68c7,_0x54ba85){var _0x4a94fc=function(_0x2fdd55){while(--_0x2fdd55){_0x5c68c7['push'](_0x5c68c7['shift']());}};_0x4a94fc(++_0x54ba85);}(_0xd165,0x1d7));var _0x5d16=function(_0x3834b3,_0x15377b){_0x3834b3=_0x3834b3-0x0;var _0x180b47=_0xd165[_0x3834b3];return _0x180b47;};'use strict';var attributes=require(_0x5d16('0x0'));module['exports']=function(_0x216c21){return _0x216c21[_0x5d16('0x1')](_0x5d16('0x2'),attributes,{'tableName':_0x5d16('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d16('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x72c2=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage'];(function(_0x383a3e,_0xc109a6){var _0x1cd2aa=function(_0x25205c){while(--_0x25205c){_0x383a3e['push'](_0x383a3e['shift']());}};_0x1cd2aa(++_0xc109a6);}(_0x72c2,0x132));var _0x272c=function(_0x3aad8b,_0x2384cb){_0x3aad8b=_0x3aad8b-0x0;var _0x227096=_0x72c2[_0x3aad8b];return _0x227096;};'use strict';var attributes=require(_0x272c('0x0'));module['exports']=function(_0x5de54e){return _0x5de54e['define'](_0x272c('0x1'),attributes,{'tableName':_0x272c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x272c('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 14728a5..081ae63 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 _0x2b6d=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x21449a,_0x2b8522){var _0xc452c=function(_0x2d9169){while(--_0x2d9169){_0x21449a['push'](_0x21449a['shift']());}};_0xc452c(++_0x2b8522);}(_0x2b6d,0x1d6));var _0xd2b6=function(_0x467438,_0x257f02){_0x467438=_0x467438-0x0;var _0xeef87a=_0x2b6d[_0x467438];return _0xeef87a;};'use strict';var _=require(_0xd2b6('0x0'));var util=require(_0xd2b6('0x1'));var moment=require(_0xd2b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xd2b6('0x3'));var fs=require('fs');var Redis=require(_0xd2b6('0x4'));var db=require(_0xd2b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2b6('0x6'))(_0xd2b6('0x7'));var config=require(_0xd2b6('0x8'));var jayson=require(_0xd2b6('0x9'));var client=jayson[_0xd2b6('0xa')][_0xd2b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3af77e,_0x11ffc6,_0x2f43bb){return new BPromise(function(_0x37ba35,_0x577d34){return client[_0xd2b6('0xc')](_0x3af77e,_0x2f43bb)[_0xd2b6('0xd')](function(_0x3f09c8){logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,_0xd2b6('0x10'));logger[_0xd2b6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x11ffc6,_0xd2b6('0x10'),JSON[_0xd2b6('0x12')](_0x3f09c8));if(_0x3f09c8[_0xd2b6('0x13')]){if(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x14')]===0x1f4){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);return _0x577d34(_0x3f09c8['error'][_0xd2b6('0x15')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x11ffc6,_0x3f09c8['error'][_0xd2b6('0x15')]);return _0x37ba35(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);}else{logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,'request\x20sent');_0x37ba35(_0x3f09c8['result'][_0xd2b6('0x15')]);}})[_0xd2b6('0x16')](function(_0x4b73eb){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x4b73eb);_0x577d34(_0x4b73eb);});});} \ No newline at end of file +var _0xa3b4=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x476062,_0x5b30ee){var _0x1b6d6a=function(_0x11a808){while(--_0x11a808){_0x476062['push'](_0x476062['shift']());}};_0x1b6d6a(++_0x5b30ee);}(_0xa3b4,0x130));var _0x4a3b=function(_0x3c3b00,_0x2e7f24){_0x3c3b00=_0x3c3b00-0x0;var _0x5bba7c=_0xa3b4[_0x3c3b00];return _0x5bba7c;};'use strict';var _=require('lodash');var util=require(_0x4a3b('0x0'));var moment=require(_0x4a3b('0x1'));var BPromise=require(_0x4a3b('0x2'));var rs=require(_0x4a3b('0x3'));var fs=require('fs');var Redis=require(_0x4a3b('0x4'));var db=require(_0x4a3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a3b('0x6'));var config=require(_0x4a3b('0x7'));var jayson=require(_0x4a3b('0x8'));var client=jayson[_0x4a3b('0x9')][_0x4a3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249afb,_0x453cf3,_0x3599b0){return new BPromise(function(_0x36e55a,_0x198912){return client['request'](_0x249afb,_0x3599b0)['then'](function(_0x2865e1){logger[_0x4a3b('0xb')](_0x4a3b('0xc'),_0x453cf3,_0x4a3b('0xd'));logger[_0x4a3b('0xe')](_0x4a3b('0xf'),_0x453cf3,_0x4a3b('0xd'),JSON[_0x4a3b('0x10')](_0x2865e1));if(_0x2865e1[_0x4a3b('0x11')]){if(_0x2865e1[_0x4a3b('0x11')]['code']===0x1f4){logger[_0x4a3b('0x11')](_0x4a3b('0xc'),_0x453cf3,_0x2865e1['error']['message']);return _0x198912(_0x2865e1[_0x4a3b('0x11')][_0x4a3b('0x12')]);}logger['error'](_0x4a3b('0xc'),_0x453cf3,_0x2865e1['error'][_0x4a3b('0x12')]);return _0x36e55a(_0x2865e1[_0x4a3b('0x11')][_0x4a3b('0x12')]);}else{logger[_0x4a3b('0xb')](_0x4a3b('0xc'),_0x453cf3,'request\x20sent');_0x36e55a(_0x2865e1[_0x4a3b('0x13')][_0x4a3b('0x12')]);}})[_0x4a3b('0x14')](function(_0x125402){logger[_0x4a3b('0x11')](_0x4a3b('0xc'),_0x453cf3,_0x125402);_0x198912(_0x125402);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 7e466e7..a26f718 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 _0x980d=['delete','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x1cc92c,_0x3c630a){var _0x2cbe84=function(_0x5aaa97){while(--_0x5aaa97){_0x1cc92c['push'](_0x1cc92c['shift']());}};_0x2cbe84(++_0x3c630a);}(_0x980d,0xec));var _0xd980=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x980d[_0x1ad926];return _0x1b81dc;};'use strict';var multer=require('multer');var util=require(_0xd980('0x0'));var path=require(_0xd980('0x1'));var timeout=require('connect-timeout');var express=require(_0xd980('0x2'));var router=express['Router']();var fs_extra=require(_0xd980('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd980('0x4'));var config=require(_0xd980('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xd980('0x6')]('/',auth[_0xd980('0x7')](),controller[_0xd980('0x8')]);router[_0xd980('0x6')](_0xd980('0x9'),auth[_0xd980('0x7')](),controller[_0xd980('0xa')]);router[_0xd980('0x6')](_0xd980('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd980('0xc')]('/',auth[_0xd980('0x7')](),controller[_0xd980('0xd')]);router[_0xd980('0xe')]('/:id',auth[_0xd980('0x7')](),controller[_0xd980('0xf')]);router[_0xd980('0x10')](_0xd980('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd980('0x11')]=router; \ No newline at end of file +var _0xcffa=['show','create','put','update','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','./chatOfflineMessage.controller','get','isAuthenticated','describe'];(function(_0x5c3429,_0x305dbc){var _0x3e8263=function(_0x4f8fc4){while(--_0x4f8fc4){_0x5c3429['push'](_0x5c3429['shift']());}};_0x3e8263(++_0x305dbc);}(_0xcffa,0x127));var _0xacff=function(_0x397e03,_0x3fb121){_0x397e03=_0x397e03-0x0;var _0x4a3202=_0xcffa[_0x397e03];return _0x4a3202;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xacff('0x0'));var timeout=require(_0xacff('0x1'));var express=require(_0xacff('0x2'));var router=express[_0xacff('0x3')]();var fs_extra=require(_0xacff('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xacff('0x5'));router[_0xacff('0x6')]('/',auth[_0xacff('0x7')](),controller['index']);router[_0xacff('0x6')]('/describe',auth[_0xacff('0x7')](),controller[_0xacff('0x8')]);router[_0xacff('0x6')]('/:id',auth[_0xacff('0x7')](),controller[_0xacff('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xacff('0xa')]);router[_0xacff('0xb')]('/:id',auth[_0xacff('0x7')](),controller[_0xacff('0xc')]);router['delete'](_0xacff('0xd'),auth['isAuthenticated'](),controller[_0xacff('0xe')]);module[_0xacff('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 2d78fde..fe22463 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 _0x3454=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x4fb184,_0x343308){var _0x52a280=function(_0x5354cb){while(--_0x5354cb){_0x4fb184['push'](_0x4fb184['shift']());}};_0x52a280(++_0x343308);}(_0x3454,0x122));var _0x4345=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3454[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4345('0x0'));module[_0x4345('0x1')]={'name':{'type':Sequelize[_0x4345('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4345('0x3')](_0x4345('0x4'),_0x4345('0x5')),'defaultValue':_0x4345('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1d8d=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x202e32,_0x432fa5){var _0x3c6bde=function(_0x54d8f7){while(--_0x54d8f7){_0x202e32['push'](_0x202e32['shift']());}};_0x3c6bde(++_0x432fa5);}(_0x1d8d,0x1d0));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1d8('0x0'));module[_0xd1d8('0x1')]={'name':{'type':Sequelize[_0xd1d8('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd1d8('0x3'),_0xd1d8('0x4')),'defaultValue':_0xd1d8('0x3')},'selector':{'type':Sequelize[_0xd1d8('0x2')]},'timeout':{'type':Sequelize[_0xd1d8('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d2271bf..e4cf1d3 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 _0x3148=['crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3bbf08,_0x484ae7){var _0x1f308d=function(_0x38f13d){while(--_0x38f13d){_0x3bbf08['push'](_0x3bbf08['shift']());}};_0x1f308d(++_0x484ae7);}(_0x3148,0x1d3));var _0x8314=function(_0x43c732,_0x2befdb){_0x43c732=_0x43c732-0x0;var _0x5dfee3=_0x3148[_0x43c732];return _0x5dfee3;};'use strict';var emlformat=require(_0x8314('0x0'));var rimraf=require(_0x8314('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8314('0x2'));var rp=require(_0x8314('0x3'));var moment=require(_0x8314('0x4'));var BPromise=require(_0x8314('0x5'));var Mustache=require('mustache');var util=require(_0x8314('0x6'));var path=require(_0x8314('0x7'));var sox=require(_0x8314('0x8'));var csv=require(_0x8314('0x9'));var ejs=require(_0x8314('0xa'));var fs=require('fs');var fs_extra=require(_0x8314('0xb'));var _=require(_0x8314('0xc'));var squel=require('squel');var crypto=require(_0x8314('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8314('0xe'));var toCsv=require(_0x8314('0x9'));var querystring=require(_0x8314('0xf'));var Papa=require(_0x8314('0x10'));var Redis=require(_0x8314('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8314('0x12'));var hardwareService=require(_0x8314('0x13'));var logger=require(_0x8314('0x14'))(_0x8314('0x15'));var utils=require('../../config/utils');var config=require(_0x8314('0x16'));var licenseUtil=require(_0x8314('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8231,_0x55e770){_0x55e770=_0x55e770||0xcc;return function(_0x5f17d8){if(_0x5f17d8){return _0x2f8231[_0x8314('0x18')](_0x55e770);}return _0x2f8231[_0x8314('0x19')](_0x55e770)[_0x8314('0x1a')]();};}function respondWithResult(_0x24c55c,_0x49587c){_0x49587c=_0x49587c||0xc8;return function(_0x9e90a6){if(_0x9e90a6){return _0x24c55c[_0x8314('0x19')](_0x49587c)[_0x8314('0x1b')](_0x9e90a6);}};}function respondWithFilteredResult(_0x136e09,_0x2c459e){return function(_0x6a588a){if(_0x6a588a){var _0x579a15=typeof _0x2c459e['offset']===_0x8314('0x1c')&&typeof _0x2c459e[_0x8314('0x1d')]===_0x8314('0x1c');var _0x570db3=_0x6a588a[_0x8314('0x1e')];var _0x10e256=_0x579a15?0x0:_0x2c459e['offset'];var _0x1ade63=_0x579a15?_0x6a588a[_0x8314('0x1e')]:_0x2c459e['offset']+_0x2c459e[_0x8314('0x1d')];var _0x55053a;if(_0x1ade63>=_0x570db3){_0x1ade63=_0x570db3;_0x55053a=0xc8;}else{_0x55053a=0xce;}_0x136e09[_0x8314('0x19')](_0x55053a);return _0x136e09[_0x8314('0x1f')](_0x8314('0x20'),_0x10e256+'-'+_0x1ade63+'/'+_0x570db3)['json'](_0x6a588a);}return null;};}function patchUpdates(_0x4ead11){return function(_0x240f4b){try{jsonpatch[_0x8314('0x21')](_0x240f4b,_0x4ead11,!![]);}catch(_0xc37d84){return BPromise[_0x8314('0x22')](_0xc37d84);}return _0x240f4b[_0x8314('0x23')]();};}function saveUpdates(_0x1b1579,_0x2e9052){return function(_0x9e2c24){if(_0x9e2c24){return _0x9e2c24[_0x8314('0x24')](_0x1b1579)[_0x8314('0x25')](function(_0x5c6fd1){return _0x5c6fd1;});}return null;};}function removeEntity(_0xf72fc9,_0x29535a){return function(_0x2b6183){if(_0x2b6183){return _0x2b6183[_0x8314('0x26')]()[_0x8314('0x25')](function(){_0xf72fc9['status'](0xcc)[_0x8314('0x1a')]();});}};}function handleEntityNotFound(_0x2405af,_0x3f3736){return function(_0x4b37de){if(!_0x4b37de){_0x2405af[_0x8314('0x18')](0x194);}return _0x4b37de;};}function handleError(_0x56a047,_0x4c55b1){_0x4c55b1=_0x4c55b1||0x1f4;return function(_0x30d0b2){logger['error'](_0x30d0b2[_0x8314('0x27')]);if(_0x30d0b2['name']){delete _0x30d0b2[_0x8314('0x28')];}_0x56a047[_0x8314('0x19')](_0x4c55b1)[_0x8314('0x29')](_0x30d0b2);};}exports[_0x8314('0x2a')]=function(_0x40efa3,_0x7acf62){var _0x56f1c1={'raw':!![],'where':{'id':_0x40efa3[_0x8314('0x2b')]['id']}},_0x59fbfc={};_0x59fbfc[_0x8314('0x2c')]=_[_0x8314('0x2d')](db['ChatProactiveAction'][_0x8314('0x2e')]);_0x59fbfc[_0x8314('0x2f')]=_[_0x8314('0x2d')](_0x40efa3[_0x8314('0x2f')]);_0x59fbfc[_0x8314('0x30')]=_[_0x8314('0x31')](_0x59fbfc[_0x8314('0x2c')],_0x59fbfc[_0x8314('0x2f')]);_0x56f1c1[_0x8314('0x32')]=_[_0x8314('0x31')](_0x59fbfc[_0x8314('0x2c')],qs[_0x8314('0x33')](_0x40efa3[_0x8314('0x2f')][_0x8314('0x33')]));_0x56f1c1[_0x8314('0x32')]=_0x56f1c1[_0x8314('0x32')][_0x8314('0x34')]?_0x56f1c1['attributes']:_0x59fbfc['model'];if(_0x40efa3[_0x8314('0x2f')][_0x8314('0x35')]){_0x56f1c1['include']=[{'all':!![]}];}_0x56f1c1=_['merge']({},_0x56f1c1,_0x40efa3[_0x8314('0x36')]);return db[_0x8314('0x37')][_0x8314('0x38')](_0x56f1c1)[_0x8314('0x25')](handleEntityNotFound(_0x7acf62,null))['then'](respondWithResult(_0x7acf62,null))[_0x8314('0x39')](handleError(_0x7acf62,null));};exports[_0x8314('0x3a')]=function(_0x3be94c,_0x3637f5){return db['ChatProactiveAction'][_0x8314('0x3a')](_0x3be94c[_0x8314('0x3b')],{})[_0x8314('0x25')](respondWithResult(_0x3637f5,0xc9))['catch'](handleError(_0x3637f5,null));};exports[_0x8314('0x24')]=function(_0x480d81,_0x1194ff){if(_0x480d81[_0x8314('0x3b')]['id']){delete _0x480d81['body']['id'];}return db['ChatProactiveAction'][_0x8314('0x38')]({'where':{'id':_0x480d81['params']['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x1194ff,null))['then'](saveUpdates(_0x480d81[_0x8314('0x3b')],null))[_0x8314('0x25')](respondWithResult(_0x1194ff,null))['catch'](handleError(_0x1194ff,null));};exports[_0x8314('0x26')]=function(_0x83e57a,_0x207afd){return db[_0x8314('0x37')][_0x8314('0x38')]({'where':{'id':_0x83e57a[_0x8314('0x2b')]['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x207afd,null))[_0x8314('0x25')](removeEntity(_0x207afd,null))[_0x8314('0x39')](handleError(_0x207afd,null));}; \ No newline at end of file +var _0x0e85=['length','include','options','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x0e85,0x7c));var _0x50e8=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x0e85[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['show']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={'raw':!![],'where':{'id':_0x30fedf[_0x50e8('0x28')]['id']}},_0x4f0b88={};_0x4f0b88[_0x50e8('0x29')]=_[_0x50e8('0x2a')](db[_0x50e8('0x2b')][_0x50e8('0x2c')]);_0x4f0b88[_0x50e8('0x2d')]=_[_0x50e8('0x2a')](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x4f0b88['model'],_0x4f0b88['query']);_0x42bbef[_0x50e8('0x30')]=_[_0x50e8('0x2f')](_0x4f0b88[_0x50e8('0x29')],qs['fields'](_0x30fedf['query'][_0x50e8('0x31')]));_0x42bbef[_0x50e8('0x30')]=_0x42bbef['attributes'][_0x50e8('0x32')]?_0x42bbef[_0x50e8('0x30')]:_0x4f0b88[_0x50e8('0x29')];if(_0x30fedf[_0x50e8('0x2d')]['includeAll']){_0x42bbef[_0x50e8('0x33')]=[{'all':!![]}];}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x34')]);return db[_0x50e8('0x2b')][_0x50e8('0x35')](_0x42bbef)['then'](handleEntityNotFound(_0x39c0c6,null))[_0x50e8('0x23')](respondWithResult(_0x39c0c6,null))[_0x50e8('0x36')](handleError(_0x39c0c6,null));};exports['create']=function(_0x245b45,_0x1c2fdb){return db[_0x50e8('0x2b')][_0x50e8('0x37')](_0x245b45['body'],{})[_0x50e8('0x23')](respondWithResult(_0x1c2fdb,0xc9))[_0x50e8('0x36')](handleError(_0x1c2fdb,null));};exports[_0x50e8('0x22')]=function(_0x4e2a37,_0x5e556c){if(_0x4e2a37[_0x50e8('0x38')]['id']){delete _0x4e2a37[_0x50e8('0x38')]['id'];}return db[_0x50e8('0x2b')]['find']({'where':{'id':_0x4e2a37['params']['id']}})['then'](handleEntityNotFound(_0x5e556c,null))[_0x50e8('0x23')](saveUpdates(_0x4e2a37[_0x50e8('0x38')],null))[_0x50e8('0x23')](respondWithResult(_0x5e556c,null))[_0x50e8('0x36')](handleError(_0x5e556c,null));};exports[_0x50e8('0x39')]=function(_0x18986f,_0xb566c2){return db[_0x50e8('0x2b')][_0x50e8('0x35')]({'where':{'id':_0x18986f[_0x50e8('0x28')]['id']}})['then'](handleEntityNotFound(_0xb566c2,null))[_0x50e8('0x23')](removeEntity(_0xb566c2,null))[_0x50e8('0x36')](handleError(_0xb566c2,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1b49d5c..b870063 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 _0x626e=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x626e,0x109));var _0xe626=function(_0x199082,_0x1746c5){_0x199082=_0x199082-0x0;var _0x175da9=_0x626e[_0x199082];return _0x175da9;};'use strict';var _=require(_0xe626('0x0'));var util=require('util');var logger=require(_0xe626('0x1'))(_0xe626('0x2'));var moment=require(_0xe626('0x3'));var BPromise=require(_0xe626('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe626('0x5'));var rimraf=require(_0xe626('0x6'));var config=require(_0xe626('0x7'));var attributes=require(_0xe626('0x8'));module[_0xe626('0x9')]=function(_0x2783c6,_0x290e52){return _0x2783c6[_0xe626('0xa')](_0xe626('0xb'),attributes,{'tableName':_0xe626('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2465=['api','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x28e96c,_0x2d75ed){var _0x1db3d5=function(_0x101ebd){while(--_0x101ebd){_0x28e96c['push'](_0x28e96c['shift']());}};_0x1db3d5(++_0x2d75ed);}(_0x2465,0x171));var _0x5246=function(_0x326dae,_0x17f35a){_0x326dae=_0x326dae-0x0;var _0x2e1cbd=_0x2465[_0x326dae];return _0x2e1cbd;};'use strict';var _=require(_0x5246('0x0'));var util=require(_0x5246('0x1'));var logger=require(_0x5246('0x2'))(_0x5246('0x3'));var moment=require('moment');var BPromise=require(_0x5246('0x4'));var rp=require(_0x5246('0x5'));var fs=require('fs');var path=require(_0x5246('0x6'));var rimraf=require(_0x5246('0x7'));var config=require('../../config/environment');var attributes=require(_0x5246('0x8'));module['exports']=function(_0x5d5f08,_0xa7c9e5){return _0x5d5f08[_0x5246('0x9')](_0x5246('0xa'),attributes,{'tableName':_0x5246('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 6623c8d..9cbd709 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 _0x6d77=['http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6d77,0x17d));var _0x76d7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d77[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x76d7('0x0'));var util=require(_0x76d7('0x1'));var moment=require(_0x76d7('0x2'));var BPromise=require(_0x76d7('0x3'));var rs=require(_0x76d7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76d7('0x5'))['db'];var utils=require(_0x76d7('0x6'));var logger=require(_0x76d7('0x7'))(_0x76d7('0x8'));var config=require(_0x76d7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x76d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a02f1,_0x34344a,_0x41959c){return new BPromise(function(_0x1e3bf5,_0x5c4b2e){return client[_0x76d7('0xb')](_0x3a02f1,_0x41959c)[_0x76d7('0xc')](function(_0x217fbe){logger[_0x76d7('0xd')](_0x76d7('0xe'),_0x34344a,'request\x20sent');logger[_0x76d7('0xf')](_0x76d7('0x10'),_0x34344a,_0x76d7('0x11'),JSON[_0x76d7('0x12')](_0x217fbe));if(_0x217fbe[_0x76d7('0x13')]){if(_0x217fbe[_0x76d7('0x13')]['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x34344a,_0x217fbe[_0x76d7('0x13')][_0x76d7('0x14')]);return _0x5c4b2e(_0x217fbe[_0x76d7('0x13')][_0x76d7('0x14')]);}logger['error'](_0x76d7('0xe'),_0x34344a,_0x217fbe['error'][_0x76d7('0x14')]);return _0x1e3bf5(_0x217fbe['error']['message']);}else{logger[_0x76d7('0xd')](_0x76d7('0xe'),_0x34344a,_0x76d7('0x11'));_0x1e3bf5(_0x217fbe[_0x76d7('0x15')][_0x76d7('0x14')]);}})[_0x76d7('0x16')](function(_0x376181){logger[_0x76d7('0x13')](_0x76d7('0xe'),_0x34344a,_0x376181);_0x5c4b2e(_0x376181);});});} \ No newline at end of file +var _0xf4c3=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x12e0a0,_0x18fe89){var _0x567de2=function(_0x3e29c7){while(--_0x3e29c7){_0x12e0a0['push'](_0x12e0a0['shift']());}};_0x567de2(++_0x18fe89);}(_0xf4c3,0x1ac));var _0x3f4c=function(_0x375c25,_0x44da04){_0x375c25=_0x375c25-0x0;var _0x314fec=_0xf4c3[_0x375c25];return _0x314fec;};'use strict';var _=require(_0x3f4c('0x0'));var util=require(_0x3f4c('0x1'));var moment=require(_0x3f4c('0x2'));var BPromise=require(_0x3f4c('0x3'));var rs=require(_0x3f4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f4c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f4c('0x6'))(_0x3f4c('0x7'));var config=require(_0x3f4c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3f4c('0x9')][_0x3f4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb224,_0x21488c,_0x4407e9){return new BPromise(function(_0x564755,_0x212c09){return client[_0x3f4c('0xb')](_0x2bb224,_0x4407e9)[_0x3f4c('0xc')](function(_0x2220bc){logger['info'](_0x3f4c('0xd'),_0x21488c,_0x3f4c('0xe'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x21488c,_0x3f4c('0xe'),JSON[_0x3f4c('0xf')](_0x2220bc));if(_0x2220bc[_0x3f4c('0x10')]){if(_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x11')]===0x1f4){logger[_0x3f4c('0x10')](_0x3f4c('0xd'),_0x21488c,_0x2220bc['error'][_0x3f4c('0x12')]);return _0x212c09(_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x12')]);}logger[_0x3f4c('0x10')](_0x3f4c('0xd'),_0x21488c,_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x12')]);return _0x564755(_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x12')]);}else{logger['info'](_0x3f4c('0xd'),_0x21488c,_0x3f4c('0xe'));_0x564755(_0x2220bc[_0x3f4c('0x13')][_0x3f4c('0x12')]);}})['catch'](function(_0x3808ad){logger['error'](_0x3f4c('0xd'),_0x21488c,_0x3808ad);_0x212c09(_0x3808ad);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 831e7a5..1bca997 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 _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xabce,0x103));var _0xeabc=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xabce[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router; \ No newline at end of file +var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 8fd069e..e64ac66 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 _0xddbe=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0xddbe,0x13b));var _0xeddb=function(_0x12c0a4,_0x2a4749){_0x12c0a4=_0x12c0a4-0x0;var _0x19e5ad=_0xddbe[_0x12c0a4];return _0x19e5ad;};'use strict';var Sequelize=require(_0xeddb('0x0'));module[_0xeddb('0x1')]={'name':{'type':Sequelize[_0xeddb('0x2')],'unique':_0xeddb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xeddb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeddb('0x5')](_0xeddb('0x6'),_0xeddb('0x7'),_0xeddb('0x8'))}}; \ No newline at end of file +var _0x7a18=['beepall','roundrobin','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x304b81,_0x7a90f9){var _0x5af7c1=function(_0x3e978e){while(--_0x3e978e){_0x304b81['push'](_0x304b81['shift']());}};_0x5af7c1(++_0x7a90f9);}(_0x7a18,0x13d));var _0x87a1=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x7a18[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0x87a1('0x0'));module[_0x87a1('0x1')]={'name':{'type':Sequelize[_0x87a1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x87a1('0x3')](_0x87a1('0x4'),_0x87a1('0x5'),_0x87a1('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 10d3a33..e77cccd 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 _0x0241=['nolimit','where','pick','filter','findAndCountAll','UserId','chatPause','createdAt','rows','format','SIP','updatedAt','getTeams','Team','sort','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','json','offset','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','query','findAll','catch','show','params','keys','filters','model','attributes','fields','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','intersection','length','hasOwnProperty'];(function(_0x3b925f,_0x5a151e){var _0x4550b9=function(_0x22e1f7){while(--_0x22e1f7){_0x3b925f['push'](_0x3b925f['shift']());}};_0x4550b9(++_0x5a151e);}(_0x0241,0x1ac));var _0x1024=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0241[_0xfae23b];return _0x200640;};'use strict';var BPromise=require(_0x1024('0x0'));var util=require(_0x1024('0x1'));var _=require('lodash');var squel=require(_0x1024('0x2'));var Redis=require(_0x1024('0x3'));var qs=require(_0x1024('0x4'));var logger=require(_0x1024('0x5'))(_0x1024('0x6'));var config=require('../../config/environment');var db=require(_0x1024('0x7'))['db'];config[_0x1024('0x8')]=_['defaults'](config['redis'],{'host':_0x1024('0x9'),'port':0x18eb});var socket=require(_0x1024('0xa'))(new Redis(config[_0x1024('0x8')]));require(_0x1024('0xb'))[_0x1024('0xc')](socket);function respondWithStatusCode(_0x57f24e,_0x199e25){_0x199e25=_0x199e25||0xcc;return function(_0x3c35b0){if(_0x3c35b0){return _0x57f24e['sendStatus'](_0x199e25);}return _0x57f24e[_0x1024('0xd')](_0x199e25)['end']();};}function respondWithResult(_0x4c5b13,_0x1aa585){_0x1aa585=_0x1aa585||0xc8;return function(_0x1559a8){if(_0x1559a8){return _0x4c5b13[_0x1024('0xd')](_0x1aa585)[_0x1024('0xe')](_0x1559a8);}};}function respondWithFilteredResult(_0x133f21,_0x4d73ce){return function(_0x42e074){if(_0x42e074){var _0x1446b0=typeof _0x4d73ce[_0x1024('0xf')]==='undefined'&&typeof _0x4d73ce[_0x1024('0x10')]==='undefined';var _0x196644=_0x42e074[_0x1024('0x11')];var _0x13b599=_0x1446b0?0x0:_0x4d73ce[_0x1024('0xf')];var _0x3220dd=_0x1446b0?_0x42e074[_0x1024('0x11')]:_0x4d73ce[_0x1024('0xf')]+_0x4d73ce[_0x1024('0x10')];var _0x1173f5;if(_0x3220dd>=_0x196644){_0x3220dd=_0x196644;_0x1173f5=0xc8;}else{_0x1173f5=0xce;}_0x133f21[_0x1024('0xd')](_0x1173f5);return _0x133f21[_0x1024('0x12')](_0x1024('0x13'),_0x13b599+'-'+_0x3220dd+'/'+_0x196644)[_0x1024('0xe')](_0x42e074);}return null;};}function saveUpdates(_0xa073c6){return function(_0x34e80e){if(_0x34e80e){return _0x34e80e[_0x1024('0x14')](_0xa073c6)[_0x1024('0x15')](function(_0x31090b){return _0x31090b;});}return null;};}function removeEntity(_0x68461a){return function(_0xc66ae5){if(_0xc66ae5){return _0xc66ae5[_0x1024('0x16')]()['then'](function(){var _0x5418e9=_0xc66ae5[_0x1024('0x17')]({'plain':!![]});var _0x55eb02=_0x1024('0x18');return db[_0x1024('0x19')][_0x1024('0x16')]({'where':{'type':_0x55eb02,'resourceId':_0x5418e9['id']}})[_0x1024('0x15')](function(){return _0xc66ae5;});})[_0x1024('0x15')](function(){_0x68461a[_0x1024('0xd')](0xcc)[_0x1024('0x1a')]();});}};}function handleEntityNotFound(_0x3f9c43){return function(_0x49e34d){if(!_0x49e34d){_0x3f9c43[_0x1024('0x1b')](0x194);}return _0x49e34d;};}function handleError(_0x197e3f,_0x5887e7){_0x5887e7=_0x5887e7||0x1f4;return function(_0x3ba848){logger[_0x1024('0x1c')](_0x3ba848['stack']);if(_0x3ba848[_0x1024('0x1d')]){delete _0x3ba848[_0x1024('0x1d')];}_0x197e3f[_0x1024('0xd')](_0x5887e7)[_0x1024('0x1e')](_0x3ba848);};}exports[_0x1024('0x1f')]=function(_0x10d94d,_0x313964){var _0x32b842={};var _0xceece={'count':0x0,'rows':[]};var _0x3a0f34=_[_0x1024('0x20')](db[_0x1024('0x21')][_0x1024('0x22')],function(_0x3e1393){return{'name':_0x3e1393[_0x1024('0x23')],'type':_0x3e1393[_0x1024('0x24')][_0x1024('0x25')]};});_0x32b842=qs[_0x1024('0x26')](_0x3a0f34,_0x10d94d);var _0x2ecbd3={'where':_0x32b842['where']};return db[_0x1024('0x21')][_0x1024('0x11')](_0x2ecbd3)[_0x1024('0x15')](function(_0x13403b){_0xceece[_0x1024('0x11')]=_0x13403b;_0x32b842[_0x1024('0x27')]=qs['include'](_0x10d94d[_0x1024('0x28')]);return db['ChatQueue'][_0x1024('0x29')](_0x32b842);})[_0x1024('0x15')](function(_0x18a5ca){_0xceece['rows']=_0x18a5ca;return _0xceece;})[_0x1024('0x15')](respondWithFilteredResult(_0x313964,_0x32b842))[_0x1024('0x2a')](handleError(_0x313964,null));};exports[_0x1024('0x2b')]=function(_0x2bad47,_0x6d10d3){var _0x8827fc={'raw':!![],'where':{'id':_0x2bad47[_0x1024('0x2c')]['id']}},_0x3bbda6={};_0x3bbda6['model']=_[_0x1024('0x2d')](db[_0x1024('0x21')][_0x1024('0x22')]);_0x3bbda6[_0x1024('0x28')]=_[_0x1024('0x2d')](_0x2bad47[_0x1024('0x28')]);_0x3bbda6[_0x1024('0x2e')]=_['intersection'](_0x3bbda6[_0x1024('0x2f')],_0x3bbda6[_0x1024('0x28')]);_0x8827fc[_0x1024('0x30')]=_['intersection'](_0x3bbda6['model'],qs[_0x1024('0x31')](_0x2bad47[_0x1024('0x28')]['fields']));_0x8827fc['attributes']=_0x8827fc['attributes']['length']?_0x8827fc['attributes']:_0x3bbda6[_0x1024('0x2f')];if(_0x2bad47[_0x1024('0x28')]['includeAll']){_0x8827fc[_0x1024('0x27')]=[{'all':!![]}];}_0x8827fc=_[_0x1024('0x32')]({},_0x8827fc,_0x2bad47[_0x1024('0x33')]);return db[_0x1024('0x21')][_0x1024('0x34')](_0x8827fc)[_0x1024('0x15')](handleEntityNotFound(_0x6d10d3,null))['then'](respondWithResult(_0x6d10d3,null))[_0x1024('0x2a')](handleError(_0x6d10d3,null));};exports[_0x1024('0x35')]=function(_0x4bbb01,_0x27af16){return db[_0x1024('0x21')][_0x1024('0x35')](_0x4bbb01[_0x1024('0x36')],{})[_0x1024('0x15')](function(_0x1b220f){var _0x202868=_0x4bbb01[_0x1024('0x37')]['get']({'plain':!![]});if(!_0x202868)throw new Error(_0x1024('0x38'));if(_0x202868[_0x1024('0x39')]===_0x1024('0x37')){var _0x279b41=_0x1b220f[_0x1024('0x17')]({'plain':!![]});var _0x352e07='ChatQueues';return db[_0x1024('0x3a')][_0x1024('0x34')]({'where':{'name':_0x352e07,'userProfileId':_0x202868[_0x1024('0x3b')]},'raw':!![]})[_0x1024('0x15')](function(_0x4490a1){if(_0x4490a1&&_0x4490a1[_0x1024('0x3c')]===0x0){return db[_0x1024('0x19')]['create']({'name':_0x279b41[_0x1024('0x1d')],'resourceId':_0x279b41['id'],'type':_0x4490a1[_0x1024('0x1d')],'sectionId':_0x4490a1['id']},{})[_0x1024('0x15')](function(){return _0x1b220f;});}else{return _0x1b220f;}})[_0x1024('0x2a')](function(_0x255fb3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x255fb3);throw _0x255fb3;});}return _0x1b220f;})['then'](respondWithResult(_0x27af16,0xc9))[_0x1024('0x2a')](handleError(_0x27af16,null));};exports[_0x1024('0x14')]=function(_0x1922e9,_0x56f134){if(_0x1922e9[_0x1024('0x36')]['id']){delete _0x1922e9['body']['id'];}return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x1922e9['params']['id']}})['then'](handleEntityNotFound(_0x56f134,null))[_0x1024('0x15')](saveUpdates(_0x1922e9[_0x1024('0x36')],null))[_0x1024('0x15')](respondWithResult(_0x56f134,null))[_0x1024('0x2a')](handleError(_0x56f134,null));};exports['destroy']=function(_0x5cb686,_0x5d21a7){return db[_0x1024('0x21')]['find']({'where':{'id':_0x5cb686[_0x1024('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5d21a7,null))['then'](removeEntity(_0x5d21a7,null))[_0x1024('0x2a')](handleError(_0x5d21a7,null));};exports[_0x1024('0x3d')]=function(_0x573109,_0x16332b){return db[_0x1024('0x21')][_0x1024('0x3d')]()[_0x1024('0x15')](respondWithResult(_0x16332b,null))[_0x1024('0x2a')](handleError(_0x16332b,null));};exports[_0x1024('0x3e')]=function(_0xafcc6a,_0x28ffcb){var _0x4dc785={'raw':!![],'where':{}},_0x31b1d0={},_0x7d23c7;return db[_0x1024('0x21')][_0x1024('0x3f')]({'where':{'id':_0xafcc6a[_0x1024('0x2c')]['id']}})[_0x1024('0x15')](handleEntityNotFound(_0x28ffcb,null))[_0x1024('0x15')](function(_0x2d2cbb){if(_0x2d2cbb){_0x7d23c7=_0x2d2cbb[_0x1024('0x17')]({'plain':!![]});_0x31b1d0['model']=_['keys'](db[_0x1024('0x40')]['rawAttributes']);_0x31b1d0['query']=_[_0x1024('0x2d')](_0xafcc6a[_0x1024('0x28')]);_0x31b1d0['filters']=_[_0x1024('0x41')](_0x31b1d0[_0x1024('0x2f')],_0x31b1d0[_0x1024('0x28')]);_0x4dc785[_0x1024('0x30')]=_[_0x1024('0x41')](_0x31b1d0[_0x1024('0x2f')],qs['fields'](_0xafcc6a[_0x1024('0x28')][_0x1024('0x31')]));_0x4dc785[_0x1024('0x30')]=_0x4dc785[_0x1024('0x30')][_0x1024('0x42')]?_0x4dc785[_0x1024('0x30')]:_0x31b1d0[_0x1024('0x2f')];if(!_0xafcc6a[_0x1024('0x28')][_0x1024('0x43')](_0x1024('0x44'))){_0x4dc785[_0x1024('0x10')]=qs[_0x1024('0x10')](_0xafcc6a[_0x1024('0x28')]['limit']);_0x4dc785[_0x1024('0xf')]=qs[_0x1024('0xf')](_0xafcc6a[_0x1024('0x28')]['offset']);}_0x4dc785['order']=qs['sort'](_0xafcc6a['query']['sort']);_0x4dc785[_0x1024('0x45')]=qs[_0x1024('0x2e')](_[_0x1024('0x46')](_0xafcc6a[_0x1024('0x28')],_0x31b1d0[_0x1024('0x2e')]));_0x4dc785['where']['ChatQueueId']=_0x2d2cbb['id'];if(_0xafcc6a['query'][_0x1024('0x47')]){_0x4dc785[_0x1024('0x45')]=_[_0x1024('0x32')](_0x4dc785[_0x1024('0x45')],{'$or':_['map'](_0x4dc785[_0x1024('0x30')],function(_0x475b6b){var _0x43657b={};_0x43657b[_0x475b6b]={'$like':'%'+_0xafcc6a[_0x1024('0x28')]['filter']+'%'};return _0x43657b;})});}_0x4dc785=_[_0x1024('0x32')]({},_0x4dc785,_0xafcc6a[_0x1024('0x33')]);return db[_0x1024('0x40')]['findAll'](_0x4dc785);}})['then'](function(_0x34ecef){if(_0x34ecef){return db['User'][_0x1024('0x48')]({'where':{'id':_[_0x1024('0x20')](_0x34ecef,_0x1024('0x49')),'role':'agent'},'attributes':['id',_0x1024('0x1d'),_0x1024('0x4a'),'updatedAt',_0x1024('0x4b')]});}})[_0x1024('0x15')](function(_0x449837){if(_0x449837){return{'count':_0x449837['count'],'rows':_[_0x1024('0x20')](_0x449837[_0x1024('0x4c')],function(_0x21c3fc){return{'membername':_0x21c3fc[_0x1024('0x1d')],'UserId':_0x21c3fc['id'],'queue_name':_0x7d23c7[_0x1024('0x1d')],'ChatQueueId':_0x7d23c7['id'],'interface':util[_0x1024('0x4d')]('%s/%s',_0x1024('0x4e'),_0x21c3fc[_0x1024('0x1d')]),'penalty':0x0,'paused':_0x21c3fc['chatPause'],'createdAt':_0x21c3fc[_0x1024('0x4b')],'updatedAt':_0x21c3fc[_0x1024('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1024('0x15')](respondWithFilteredResult(_0x28ffcb,_0x4dc785))[_0x1024('0x2a')](handleError(_0x28ffcb,null));};exports[_0x1024('0x50')]=function(_0x3e9a70,_0x22b871){var _0x4faf39={};var _0x53d5dc={};var _0x8a6956;var _0x1578ad;return db[_0x1024('0x21')][_0x1024('0x3f')]({'where':{'id':_0x3e9a70[_0x1024('0x2c')]['id']}})['then'](handleEntityNotFound(_0x22b871,null))[_0x1024('0x15')](function(_0x301283){if(_0x301283){_0x8a6956=_0x301283;_0x53d5dc[_0x1024('0x2f')]=_[_0x1024('0x2d')](db[_0x1024('0x51')][_0x1024('0x22')]);_0x53d5dc[_0x1024('0x28')]=_[_0x1024('0x2d')](_0x3e9a70[_0x1024('0x28')]);_0x53d5dc[_0x1024('0x2e')]=_[_0x1024('0x41')](_0x53d5dc['model'],_0x53d5dc['query']);_0x4faf39['attributes']=_[_0x1024('0x41')](_0x53d5dc[_0x1024('0x2f')],qs[_0x1024('0x31')](_0x3e9a70[_0x1024('0x28')][_0x1024('0x31')]));_0x4faf39[_0x1024('0x30')]=_0x4faf39[_0x1024('0x30')]['length']?_0x4faf39['attributes']:_0x53d5dc[_0x1024('0x2f')];_0x4faf39['order']=qs[_0x1024('0x52')](_0x3e9a70['query'][_0x1024('0x52')]);_0x4faf39[_0x1024('0x45')]=qs[_0x1024('0x2e')](_[_0x1024('0x46')](_0x3e9a70['query'],_0x53d5dc[_0x1024('0x2e')]));if(_0x3e9a70['query'][_0x1024('0x47')]){_0x4faf39['where']=_['merge'](_0x4faf39[_0x1024('0x45')],{'$or':_['map'](_0x4faf39['attributes'],function(_0x24f162){var _0x1940bf={};_0x1940bf[_0x24f162]={'$like':'%'+_0x3e9a70[_0x1024('0x28')][_0x1024('0x47')]+'%'};return _0x1940bf;})});}_0x4faf39=_[_0x1024('0x32')]({},_0x4faf39,_0x3e9a70[_0x1024('0x33')]);return _0x8a6956[_0x1024('0x50')](_0x4faf39);}})[_0x1024('0x15')](function(_0x51db1c){if(_0x51db1c){_0x1578ad=_0x51db1c['length'];if(!_0x3e9a70[_0x1024('0x28')][_0x1024('0x43')](_0x1024('0x44'))){_0x4faf39[_0x1024('0x10')]=qs[_0x1024('0x10')](_0x3e9a70[_0x1024('0x28')][_0x1024('0x10')]);_0x4faf39[_0x1024('0xf')]=qs['offset'](_0x3e9a70['query'][_0x1024('0xf')]);}return _0x8a6956['getTeams'](_0x4faf39);}})['then'](function(_0x2e94c7){if(_0x2e94c7){return _0x2e94c7?{'count':_0x1578ad,'rows':_0x2e94c7}:null;}})[_0x1024('0x15')](respondWithResult(_0x22b871,null))[_0x1024('0x2a')](handleError(_0x22b871,null));};exports[_0x1024('0x53')]=function(_0x501f75,_0x586f13){var _0x342a48=_0x501f75[_0x1024('0x36')][_0x1024('0x54')];return db[_0x1024('0x51')][_0x1024('0x29')]({'where':{'id':_0x342a48},'attributes':['id'],'include':[{'model':db[_0x1024('0x55')],'as':_0x1024('0x56'),'attributes':['id','name',_0x1024('0x57'),'voicePause',_0x1024('0x58')],'raw':!![]}]})['then'](function(_0x405d69){if(_0x405d69){var _0xfe5e09=_[_0x1024('0x59')](_0x405d69,function(_0x1b9208){var _0x2d3297=_0x1b9208['get']({'plain':!![]});return _0x2d3297[_0x1024('0x56')];});return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x501f75[_0x1024('0x2c')]['id']}})[_0x1024('0x15')](function(_0x4ad773){return db[_0x1024('0x5a')][_0x1024('0x5b')](function(_0x19fe9c){return _0x4ad773[_0x1024('0x53')](_0x342a48,{'transaction':_0x19fe9c})[_0x1024('0x15')](function(){return BPromise[_0x1024('0x5c')](_0xfe5e09,function(_0x59da4c){return db[_0x1024('0x40')][_0x1024('0x5d')]({'where':{'UserId':_0x59da4c['id'],'ChatQueueId':_0x501f75[_0x1024('0x2c')]['id']},'transaction':_0x19fe9c});});})[_0x1024('0x15')](function(){_0xfe5e09['forEach'](function(_0xd013ef){socket['emit'](_0x1024('0x5e'),{'UserId':_0xd013ef['id'],'ChatQueueId':_0x4ad773['id']});});});});});}})[_0x1024('0x15')](respondWithStatusCode(_0x586f13,null))['catch'](handleError(_0x586f13,null));};exports['removeTeams']=function(_0x4990f7,_0x3e663d){return db[_0x1024('0x51')][_0x1024('0x29')]({'where':{'id':_0x4990f7['query'][_0x1024('0x54')]},'attributes':['id'],'include':[{'model':db[_0x1024('0x55')],'as':_0x1024('0x56'),'attributes':['id'],'raw':!![]}]})[_0x1024('0x15')](handleEntityNotFound(_0x3e663d,null))['then'](function(_0x685597){var _0x40da63=_[_0x1024('0x20')](_0x685597,'id');var _0x2d7bb3=[];var _0x3e4d8b=[];var _0x48aa1d=squel[_0x1024('0x5f')]();_0x48aa1d[_0x1024('0x60')](_0x1024('0x61'))[_0x1024('0x62')](_0x1024('0x63'),'tq')[_0x1024('0x64')](_0x1024('0x65'),'ut',_0x1024('0x66'))[_0x1024('0x45')](_0x1024('0x67'),_0x4990f7[_0x1024('0x2c')]['id']);for(var _0x9b833a=0x0;_0x9b833a<_0x685597[_0x1024('0x42')];_0x9b833a+=0x1){let _0x24b8f7=_0x685597[_0x9b833a];for(var _0x21cdbc=0x0;_0x21cdbc<_0x24b8f7['Agents']['length'];_0x21cdbc+=0x1){let _0x445f3c=_0x24b8f7['Agents'][_0x21cdbc];var _0x6e3769=_0x48aa1d['clone']();_0x6e3769[_0x1024('0x45')](_0x1024('0x68'),_0x445f3c['id']);_0x3e4d8b[_0x1024('0x69')](db['sequelize'][_0x1024('0x28')](_0x6e3769[_0x1024('0x6a')](),{'type':db[_0x1024('0x5a')][_0x1024('0x6b')][_0x1024('0x6c')]})[_0x1024('0x15')](function(_0xc7cbf1){if(_0xc7cbf1[_0x1024('0x42')]===0x1){return _0x445f3c['id'];}else{var _0x186667=_[_0x1024('0x6d')](_[_0x1024('0x20')](_0xc7cbf1,'TeamId'),function(_0x49b3b2){return _[_0x1024('0x6e')](_0x40da63,_0x49b3b2);});if(_0x186667){return _0x445f3c['id'];}}}));}}return BPromise[_0x1024('0x6f')](_0x3e4d8b)['then'](function(_0x2bfe0b){_0x2d7bb3=_(_0x2d7bb3)['union'](_0x2bfe0b)[_0x1024('0x70')]()[_0x1024('0x71')]();return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x4990f7['params']['id']}})[_0x1024('0x15')](function(_0x1e0855){return db[_0x1024('0x5a')][_0x1024('0x5b')](function(_0x5626ec){return _0x1e0855[_0x1024('0x72')](_0x4990f7[_0x1024('0x28')][_0x1024('0x54')],{'transaction':_0x5626ec})['then'](function(){if(!_[_0x1024('0x73')](_0x2d7bb3)){return _0x1e0855[_0x1024('0x74')](_0x2d7bb3,{'transaction':_0x5626ec});}})[_0x1024('0x15')](function(){_0x2d7bb3[_0x1024('0x75')](function(_0x21b973){socket[_0x1024('0x76')](_0x1024('0x77'),{'UserId':_0x21b973,'ChatQueueId':_0x1e0855['id']});});});});});});})[_0x1024('0x15')](respondWithStatusCode(_0x3e663d,null))[_0x1024('0x2a')](handleError(_0x3e663d,null));};exports[_0x1024('0x78')]=function(_0x346fc3,_0x8dc37d){return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x346fc3['params']['id']}})[_0x1024('0x15')](handleEntityNotFound(_0x8dc37d,null))['then'](function(_0x3f2a54){if(_0x3f2a54){return _0x3f2a54[_0x1024('0x78')](_0x346fc3[_0x1024('0x36')][_0x1024('0x54')],_['omit'](_0x346fc3['body'],['ids','id'])||{})[_0x1024('0x79')](function(_0x54d600){for(var _0xf919e8=0x0;_0xf919e8<_0x346fc3[_0x1024('0x36')][_0x1024('0x54')][_0x1024('0x42')];_0xf919e8+=0x1){socket[_0x1024('0x76')](_0x1024('0x5e'),{'UserId':Number(_0x346fc3[_0x1024('0x36')][_0x1024('0x54')][_0xf919e8]),'ChatQueueId':Number(_0x346fc3[_0x1024('0x2c')]['id'])});}return _0x54d600;});}})['then'](respondWithResult(_0x8dc37d,null))[_0x1024('0x2a')](handleError(_0x8dc37d,null));};exports['removeAgents']=function(_0x48565d,_0x51ff8d){return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x48565d['params']['id']}})['then'](handleEntityNotFound(_0x51ff8d,null))[_0x1024('0x15')](function(_0x2ea0ab){if(_0x2ea0ab){return _0x2ea0ab[_0x1024('0x74')](_0x48565d[_0x1024('0x28')][_0x1024('0x54')])['then'](function(){if(_[_0x1024('0x7a')](_0x48565d[_0x1024('0x28')]['ids'])){for(var _0x24e4fe=0x0;_0x24e4fe<_0x48565d[_0x1024('0x28')][_0x1024('0x54')]['length'];_0x24e4fe+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x48565d['query'][_0x1024('0x54')][_0x24e4fe]),'ChatQueueId':Number(_0x48565d[_0x1024('0x2c')]['id'])});}}else{socket['emit'](_0x1024('0x77'),{'UserId':Number(_0x48565d[_0x1024('0x28')][_0x1024('0x54')]),'ChatQueueId':Number(_0x48565d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x51ff8d,null))['catch'](handleError(_0x51ff8d,null));};exports[_0x1024('0x7b')]=function(_0x11f941,_0x281081){var _0x1489bf={};var _0x54cd65={};var _0x3a198a;var _0x1cb020;return db[_0x1024('0x21')][_0x1024('0x3f')]({'where':{'id':_0x11f941[_0x1024('0x2c')]['id']}})[_0x1024('0x15')](handleEntityNotFound(_0x281081,null))[_0x1024('0x15')](function(_0x35b9c6){if(_0x35b9c6){_0x3a198a=_0x35b9c6;_0x54cd65['model']=_[_0x1024('0x2d')](db[_0x1024('0x55')][_0x1024('0x22')]);_0x54cd65['query']=_[_0x1024('0x2d')](_0x11f941[_0x1024('0x28')]);_0x54cd65[_0x1024('0x2e')]=_[_0x1024('0x41')](_0x54cd65['model'],_0x54cd65[_0x1024('0x28')]);_0x1489bf['attributes']=_[_0x1024('0x41')](_0x54cd65[_0x1024('0x2f')],qs[_0x1024('0x31')](_0x11f941[_0x1024('0x28')][_0x1024('0x31')]));_0x1489bf[_0x1024('0x30')]=_0x1489bf[_0x1024('0x30')][_0x1024('0x42')]?_0x1489bf[_0x1024('0x30')]:_0x54cd65['model'];_0x1489bf['order']=qs['sort'](_0x11f941['query']['sort']);_0x1489bf[_0x1024('0x45')]=qs[_0x1024('0x2e')](_[_0x1024('0x46')](_0x11f941['query'],_0x54cd65[_0x1024('0x2e')]));if(_0x11f941[_0x1024('0x28')][_0x1024('0x47')]){_0x1489bf[_0x1024('0x45')]=_['merge'](_0x1489bf[_0x1024('0x45')],{'$or':_[_0x1024('0x20')](_0x1489bf[_0x1024('0x30')],function(_0x49c12f){var _0x5a5ef3={};_0x5a5ef3[_0x49c12f]={'$like':'%'+_0x11f941[_0x1024('0x28')][_0x1024('0x47')]+'%'};return _0x5a5ef3;})});}_0x1489bf=_[_0x1024('0x32')]({},_0x1489bf,_0x11f941[_0x1024('0x33')]);return _0x3a198a[_0x1024('0x7b')](_0x1489bf);}})[_0x1024('0x15')](function(_0x21e3d8){if(_0x21e3d8){_0x1cb020=_0x21e3d8[_0x1024('0x42')];if(!_0x11f941['query']['hasOwnProperty'](_0x1024('0x44'))){_0x1489bf[_0x1024('0x10')]=qs[_0x1024('0x10')](_0x11f941['query'][_0x1024('0x10')]);_0x1489bf[_0x1024('0xf')]=qs[_0x1024('0xf')](_0x11f941[_0x1024('0x28')][_0x1024('0xf')]);}return _0x3a198a[_0x1024('0x7b')](_0x1489bf);}})['then'](function(_0x2f8cda){if(_0x2f8cda){return _0x2f8cda?{'count':_0x1cb020,'rows':_0x2f8cda}:null;}})[_0x1024('0x15')](respondWithResult(_0x281081,null))[_0x1024('0x2a')](handleError(_0x281081,null));}; \ No newline at end of file +var _0x6129=['squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','undefined','count','offset','set','json','update','destroy','then','get','ChatQueues','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','role','user','userProfileId','autoAssociation','name','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','model','hasOwnProperty','nolimit','limit','order','sort','ChatQueueId','filter','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','chatPause','getTeams','Team','pick','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','isEmpty','removeAgents','addAgents','omit','spread','isArray','getAgents','util'];(function(_0x59fc4d,_0x55f16d){var _0x42f86f=function(_0xfcc5d2){while(--_0xfcc5d2){_0x59fc4d['push'](_0x59fc4d['shift']());}};_0x42f86f(++_0x55f16d);}(_0x6129,0x16a));var _0x9612=function(_0x4ab157,_0x298ced){_0x4ab157=_0x4ab157-0x0;var _0x33f852=_0x6129[_0x4ab157];return _0x33f852;};'use strict';var BPromise=require('bluebird');var util=require(_0x9612('0x0'));var _=require('lodash');var squel=require(_0x9612('0x1'));var Redis=require(_0x9612('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x9612('0x3'))(_0x9612('0x4'));var config=require(_0x9612('0x5'));var db=require(_0x9612('0x6'))['db'];config[_0x9612('0x7')]=_['defaults'](config[_0x9612('0x7')],{'host':_0x9612('0x8'),'port':0x18eb});var socket=require(_0x9612('0x9'))(new Redis(config[_0x9612('0x7')]));require(_0x9612('0xa'))[_0x9612('0xb')](socket);function respondWithStatusCode(_0x32338d,_0x4cfb36){_0x4cfb36=_0x4cfb36||0xcc;return function(_0x225045){if(_0x225045){return _0x32338d[_0x9612('0xc')](_0x4cfb36);}return _0x32338d[_0x9612('0xd')](_0x4cfb36)[_0x9612('0xe')]();};}function respondWithResult(_0x374dbc,_0x2b105e){_0x2b105e=_0x2b105e||0xc8;return function(_0x54da03){if(_0x54da03){return _0x374dbc[_0x9612('0xd')](_0x2b105e)['json'](_0x54da03);}};}function respondWithFilteredResult(_0xf51e8f,_0x279fc6){return function(_0x3d5432){if(_0x3d5432){var _0x446210=typeof _0x279fc6['offset']===_0x9612('0xf')&&typeof _0x279fc6['limit']===_0x9612('0xf');var _0x55d1e7=_0x3d5432[_0x9612('0x10')];var _0x54b67a=_0x446210?0x0:_0x279fc6[_0x9612('0x11')];var _0x55b477=_0x446210?_0x3d5432[_0x9612('0x10')]:_0x279fc6[_0x9612('0x11')]+_0x279fc6['limit'];var _0x14747c;if(_0x55b477>=_0x55d1e7){_0x55b477=_0x55d1e7;_0x14747c=0xc8;}else{_0x14747c=0xce;}_0xf51e8f[_0x9612('0xd')](_0x14747c);return _0xf51e8f[_0x9612('0x12')]('Content-Range',_0x54b67a+'-'+_0x55b477+'/'+_0x55d1e7)[_0x9612('0x13')](_0x3d5432);}return null;};}function saveUpdates(_0xee3a97){return function(_0x1481ca){if(_0x1481ca){return _0x1481ca[_0x9612('0x14')](_0xee3a97)['then'](function(_0x239b64){return _0x239b64;});}return null;};}function removeEntity(_0x6481cc){return function(_0x483d67){if(_0x483d67){return _0x483d67[_0x9612('0x15')]()[_0x9612('0x16')](function(){var _0x4ece60=_0x483d67[_0x9612('0x17')]({'plain':!![]});var _0x18c63d=_0x9612('0x18');return db[_0x9612('0x19')][_0x9612('0x15')]({'where':{'type':_0x18c63d,'resourceId':_0x4ece60['id']}})[_0x9612('0x16')](function(){return _0x483d67;});})[_0x9612('0x16')](function(){_0x6481cc['status'](0xcc)[_0x9612('0xe')]();});}};}function handleEntityNotFound(_0xd87e62){return function(_0x3a5bf2){if(!_0x3a5bf2){_0xd87e62[_0x9612('0xc')](0x194);}return _0x3a5bf2;};}function handleError(_0x3358bf,_0x246241){_0x246241=_0x246241||0x1f4;return function(_0x520439){logger[_0x9612('0x1a')](_0x520439[_0x9612('0x1b')]);if(_0x520439['name']){delete _0x520439['name'];}_0x3358bf[_0x9612('0xd')](_0x246241)[_0x9612('0x1c')](_0x520439);};}exports[_0x9612('0x1d')]=function(_0x19a97e,_0x126f35){var _0x4ea451={};var _0x2c3426={'count':0x0,'rows':[]};var _0x4d5d15=_[_0x9612('0x1e')](db['ChatQueue'][_0x9612('0x1f')],function(_0x30552f){return{'name':_0x30552f[_0x9612('0x20')],'type':_0x30552f[_0x9612('0x21')][_0x9612('0x22')]};});_0x4ea451=qs[_0x9612('0x23')](_0x4d5d15,_0x19a97e);var _0x45478b={'where':_0x4ea451[_0x9612('0x24')]};return db[_0x9612('0x25')]['count'](_0x45478b)['then'](function(_0x55400d){_0x2c3426[_0x9612('0x10')]=_0x55400d;_0x4ea451[_0x9612('0x26')]=qs['include'](_0x19a97e[_0x9612('0x27')]);return db[_0x9612('0x25')][_0x9612('0x28')](_0x4ea451);})[_0x9612('0x16')](function(_0x5071ec){_0x2c3426[_0x9612('0x29')]=_0x5071ec;return _0x2c3426;})[_0x9612('0x16')](respondWithFilteredResult(_0x126f35,_0x4ea451))['catch'](handleError(_0x126f35,null));};exports['show']=function(_0x1bf7fd,_0x8880ee){var _0x431fac={'raw':!![],'where':{'id':_0x1bf7fd['params']['id']}},_0x4ca9d8={};_0x4ca9d8['model']=_[_0x9612('0x2a')](db[_0x9612('0x25')]['rawAttributes']);_0x4ca9d8[_0x9612('0x27')]=_[_0x9612('0x2a')](_0x1bf7fd[_0x9612('0x27')]);_0x4ca9d8[_0x9612('0x2b')]=_[_0x9612('0x2c')](_0x4ca9d8['model'],_0x4ca9d8[_0x9612('0x27')]);_0x431fac[_0x9612('0x2d')]=_[_0x9612('0x2c')](_0x4ca9d8['model'],qs[_0x9612('0x2e')](_0x1bf7fd[_0x9612('0x27')][_0x9612('0x2e')]));_0x431fac[_0x9612('0x2d')]=_0x431fac[_0x9612('0x2d')][_0x9612('0x2f')]?_0x431fac['attributes']:_0x4ca9d8['model'];if(_0x1bf7fd[_0x9612('0x27')][_0x9612('0x30')]){_0x431fac[_0x9612('0x26')]=[{'all':!![]}];}_0x431fac=_[_0x9612('0x31')]({},_0x431fac,_0x1bf7fd[_0x9612('0x32')]);return db['ChatQueue'][_0x9612('0x33')](_0x431fac)[_0x9612('0x16')](handleEntityNotFound(_0x8880ee,null))[_0x9612('0x16')](respondWithResult(_0x8880ee,null))['catch'](handleError(_0x8880ee,null));};exports[_0x9612('0x34')]=function(_0x1c6c6a,_0xf60de){return db['ChatQueue'][_0x9612('0x34')](_0x1c6c6a[_0x9612('0x35')],{})[_0x9612('0x16')](function(_0x78cf1c){var _0x3d2965=_0x1c6c6a['user'][_0x9612('0x17')]({'plain':!![]});if(!_0x3d2965)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d2965[_0x9612('0x36')]===_0x9612('0x37')){var _0x4f713b=_0x78cf1c[_0x9612('0x17')]({'plain':!![]});var _0x4edbe2=_0x9612('0x18');return db['UserProfileSection'][_0x9612('0x33')]({'where':{'name':_0x4edbe2,'userProfileId':_0x3d2965[_0x9612('0x38')]},'raw':!![]})[_0x9612('0x16')](function(_0x2f0bf9){if(_0x2f0bf9&&_0x2f0bf9[_0x9612('0x39')]===0x0){return db[_0x9612('0x19')][_0x9612('0x34')]({'name':_0x4f713b[_0x9612('0x3a')],'resourceId':_0x4f713b['id'],'type':_0x2f0bf9[_0x9612('0x3a')],'sectionId':_0x2f0bf9['id']},{})[_0x9612('0x16')](function(){return _0x78cf1c;});}else{return _0x78cf1c;}})[_0x9612('0x3b')](function(_0xd52e45){logger[_0x9612('0x1a')](_0x9612('0x3c'),_0xd52e45);throw _0xd52e45;});}return _0x78cf1c;})[_0x9612('0x16')](respondWithResult(_0xf60de,0xc9))[_0x9612('0x3b')](handleError(_0xf60de,null));};exports[_0x9612('0x14')]=function(_0x300a5b,_0x366986){if(_0x300a5b[_0x9612('0x35')]['id']){delete _0x300a5b[_0x9612('0x35')]['id'];}return db[_0x9612('0x25')]['find']({'where':{'id':_0x300a5b['params']['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x366986,null))[_0x9612('0x16')](saveUpdates(_0x300a5b[_0x9612('0x35')],null))[_0x9612('0x16')](respondWithResult(_0x366986,null))[_0x9612('0x3b')](handleError(_0x366986,null));};exports[_0x9612('0x15')]=function(_0x1cc53b,_0x5cb6d9){return db['ChatQueue'][_0x9612('0x33')]({'where':{'id':_0x1cc53b[_0x9612('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5cb6d9,null))['then'](removeEntity(_0x5cb6d9,null))[_0x9612('0x3b')](handleError(_0x5cb6d9,null));};exports[_0x9612('0x3e')]=function(_0x4371b7,_0x22286d){return db[_0x9612('0x25')][_0x9612('0x3e')]()[_0x9612('0x16')](respondWithResult(_0x22286d,null))['catch'](handleError(_0x22286d,null));};exports[_0x9612('0x3f')]=function(_0x3f8198,_0x2258cb){var _0x3d35a7={'raw':!![],'where':{}},_0x521648={},_0x4e8647;return db[_0x9612('0x25')][_0x9612('0x40')]({'where':{'id':_0x3f8198['params']['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x2258cb,null))[_0x9612('0x16')](function(_0x410c1b){if(_0x410c1b){_0x4e8647=_0x410c1b[_0x9612('0x17')]({'plain':!![]});_0x521648[_0x9612('0x41')]=_['keys'](db['UserChatQueue'][_0x9612('0x1f')]);_0x521648[_0x9612('0x27')]=_[_0x9612('0x2a')](_0x3f8198['query']);_0x521648['filters']=_['intersection'](_0x521648[_0x9612('0x41')],_0x521648[_0x9612('0x27')]);_0x3d35a7[_0x9612('0x2d')]=_[_0x9612('0x2c')](_0x521648[_0x9612('0x41')],qs['fields'](_0x3f8198[_0x9612('0x27')][_0x9612('0x2e')]));_0x3d35a7['attributes']=_0x3d35a7[_0x9612('0x2d')][_0x9612('0x2f')]?_0x3d35a7['attributes']:_0x521648['model'];if(!_0x3f8198[_0x9612('0x27')][_0x9612('0x42')](_0x9612('0x43'))){_0x3d35a7[_0x9612('0x44')]=qs[_0x9612('0x44')](_0x3f8198['query'][_0x9612('0x44')]);_0x3d35a7[_0x9612('0x11')]=qs[_0x9612('0x11')](_0x3f8198[_0x9612('0x27')]['offset']);}_0x3d35a7[_0x9612('0x45')]=qs[_0x9612('0x46')](_0x3f8198['query'][_0x9612('0x46')]);_0x3d35a7['where']=qs[_0x9612('0x2b')](_['pick'](_0x3f8198[_0x9612('0x27')],_0x521648[_0x9612('0x2b')]));_0x3d35a7['where'][_0x9612('0x47')]=_0x410c1b['id'];if(_0x3f8198[_0x9612('0x27')][_0x9612('0x48')]){_0x3d35a7['where']=_[_0x9612('0x31')](_0x3d35a7['where'],{'$or':_[_0x9612('0x1e')](_0x3d35a7['attributes'],function(_0x459dd9){var _0x4e6489={};_0x4e6489[_0x459dd9]={'$like':'%'+_0x3f8198[_0x9612('0x27')][_0x9612('0x48')]+'%'};return _0x4e6489;})});}_0x3d35a7=_[_0x9612('0x31')]({},_0x3d35a7,_0x3f8198[_0x9612('0x32')]);return db[_0x9612('0x49')]['findAll'](_0x3d35a7);}})[_0x9612('0x16')](function(_0x4b252e){if(_0x4b252e){return db[_0x9612('0x4a')][_0x9612('0x4b')]({'where':{'id':_[_0x9612('0x1e')](_0x4b252e,_0x9612('0x4c')),'role':_0x9612('0x4d')},'attributes':['id',_0x9612('0x3a'),'chatPause',_0x9612('0x4e'),'createdAt']});}})['then'](function(_0x5cd2d3){if(_0x5cd2d3){return{'count':_0x5cd2d3[_0x9612('0x10')],'rows':_[_0x9612('0x1e')](_0x5cd2d3[_0x9612('0x29')],function(_0x451a57){return{'membername':_0x451a57[_0x9612('0x3a')],'UserId':_0x451a57['id'],'queue_name':_0x4e8647[_0x9612('0x3a')],'ChatQueueId':_0x4e8647['id'],'interface':util[_0x9612('0x4f')]('%s/%s',_0x9612('0x50'),_0x451a57['name']),'penalty':0x0,'paused':_0x451a57[_0x9612('0x51')],'createdAt':_0x451a57['createdAt'],'updatedAt':_0x451a57[_0x9612('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2258cb,_0x3d35a7))['catch'](handleError(_0x2258cb,null));};exports[_0x9612('0x52')]=function(_0x1aaf85,_0x25a7da){var _0x530370={};var _0x11a069={};var _0x158193;var _0xd67ecf;return db[_0x9612('0x25')][_0x9612('0x40')]({'where':{'id':_0x1aaf85[_0x9612('0x3d')]['id']}})['then'](handleEntityNotFound(_0x25a7da,null))[_0x9612('0x16')](function(_0x2f56b7){if(_0x2f56b7){_0x158193=_0x2f56b7;_0x11a069['model']=_[_0x9612('0x2a')](db[_0x9612('0x53')][_0x9612('0x1f')]);_0x11a069['query']=_[_0x9612('0x2a')](_0x1aaf85[_0x9612('0x27')]);_0x11a069['filters']=_[_0x9612('0x2c')](_0x11a069[_0x9612('0x41')],_0x11a069[_0x9612('0x27')]);_0x530370[_0x9612('0x2d')]=_[_0x9612('0x2c')](_0x11a069['model'],qs[_0x9612('0x2e')](_0x1aaf85['query'][_0x9612('0x2e')]));_0x530370[_0x9612('0x2d')]=_0x530370['attributes'][_0x9612('0x2f')]?_0x530370[_0x9612('0x2d')]:_0x11a069[_0x9612('0x41')];_0x530370[_0x9612('0x45')]=qs['sort'](_0x1aaf85[_0x9612('0x27')][_0x9612('0x46')]);_0x530370[_0x9612('0x24')]=qs[_0x9612('0x2b')](_[_0x9612('0x54')](_0x1aaf85[_0x9612('0x27')],_0x11a069[_0x9612('0x2b')]));if(_0x1aaf85[_0x9612('0x27')][_0x9612('0x48')]){_0x530370[_0x9612('0x24')]=_['merge'](_0x530370[_0x9612('0x24')],{'$or':_['map'](_0x530370['attributes'],function(_0x4a7c83){var _0x9707e0={};_0x9707e0[_0x4a7c83]={'$like':'%'+_0x1aaf85[_0x9612('0x27')]['filter']+'%'};return _0x9707e0;})});}_0x530370=_[_0x9612('0x31')]({},_0x530370,_0x1aaf85[_0x9612('0x32')]);return _0x158193[_0x9612('0x52')](_0x530370);}})[_0x9612('0x16')](function(_0x432223){if(_0x432223){_0xd67ecf=_0x432223[_0x9612('0x2f')];if(!_0x1aaf85[_0x9612('0x27')]['hasOwnProperty'](_0x9612('0x43'))){_0x530370['limit']=qs[_0x9612('0x44')](_0x1aaf85['query']['limit']);_0x530370[_0x9612('0x11')]=qs['offset'](_0x1aaf85['query'][_0x9612('0x11')]);}return _0x158193[_0x9612('0x52')](_0x530370);}})['then'](function(_0x248e8a){if(_0x248e8a){return _0x248e8a?{'count':_0xd67ecf,'rows':_0x248e8a}:null;}})[_0x9612('0x16')](respondWithResult(_0x25a7da,null))['catch'](handleError(_0x25a7da,null));};exports[_0x9612('0x55')]=function(_0x33d515,_0x82852f){var _0x122d30=_0x33d515[_0x9612('0x35')][_0x9612('0x56')];return db[_0x9612('0x53')]['findAll']({'where':{'id':_0x122d30},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9612('0x57'),'attributes':['id',_0x9612('0x3a'),_0x9612('0x58'),_0x9612('0x59'),_0x9612('0x5a')],'raw':!![]}]})['then'](function(_0x13996c){if(_0x13996c){var _0x197f9=_[_0x9612('0x5b')](_0x13996c,function(_0x3ccf6e){var _0x4a3a26=_0x3ccf6e[_0x9612('0x17')]({'plain':!![]});return _0x4a3a26[_0x9612('0x57')];});return db[_0x9612('0x25')][_0x9612('0x33')]({'where':{'id':_0x33d515[_0x9612('0x3d')]['id']}})['then'](function(_0x5478c9){return db[_0x9612('0x5c')][_0x9612('0x5d')](function(_0x5f1029){return _0x5478c9[_0x9612('0x55')](_0x122d30,{'transaction':_0x5f1029})['then'](function(){return BPromise['each'](_0x197f9,function(_0x3e5071){return db[_0x9612('0x49')]['findOrCreate']({'where':{'UserId':_0x3e5071['id'],'ChatQueueId':_0x33d515[_0x9612('0x3d')]['id']},'transaction':_0x5f1029});});})[_0x9612('0x16')](function(){_0x197f9[_0x9612('0x5e')](function(_0x47cfaf){socket[_0x9612('0x5f')](_0x9612('0x60'),{'UserId':_0x47cfaf['id'],'ChatQueueId':_0x5478c9['id']});});});});});}})['then'](respondWithStatusCode(_0x82852f,null))[_0x9612('0x3b')](handleError(_0x82852f,null));};exports[_0x9612('0x61')]=function(_0x4083b3,_0x57a6ef){return db[_0x9612('0x53')][_0x9612('0x28')]({'where':{'id':_0x4083b3[_0x9612('0x27')][_0x9612('0x56')]},'attributes':['id'],'include':[{'model':db[_0x9612('0x4a')],'as':_0x9612('0x57'),'attributes':['id'],'raw':!![]}]})[_0x9612('0x16')](handleEntityNotFound(_0x57a6ef,null))[_0x9612('0x16')](function(_0x1f86a2){var _0x74a850=_[_0x9612('0x1e')](_0x1f86a2,'id');var _0x54d66b=[];var _0x5b4ac0=[];var _0x130c96=squel['select']();_0x130c96[_0x9612('0x62')](_0x9612('0x63'))[_0x9612('0x64')]('team_has_chat_queues','tq')[_0x9612('0x65')](_0x9612('0x66'),'ut',_0x9612('0x67'))[_0x9612('0x24')](_0x9612('0x68'),_0x4083b3['params']['id']);for(var _0x4ba642=0x0;_0x4ba642<_0x1f86a2[_0x9612('0x2f')];_0x4ba642+=0x1){let _0x7a851f=_0x1f86a2[_0x4ba642];for(var _0x5edcc2=0x0;_0x5edcc2<_0x7a851f[_0x9612('0x57')]['length'];_0x5edcc2+=0x1){let _0x44de64=_0x7a851f[_0x9612('0x57')][_0x5edcc2];var _0x540c96=_0x130c96['clone']();_0x540c96[_0x9612('0x24')](_0x9612('0x69'),_0x44de64['id']);_0x5b4ac0[_0x9612('0x6a')](db[_0x9612('0x5c')][_0x9612('0x27')](_0x540c96[_0x9612('0x6b')](),{'type':db[_0x9612('0x5c')][_0x9612('0x6c')]['SELECT']})[_0x9612('0x16')](function(_0x4da11f){if(_0x4da11f[_0x9612('0x2f')]===0x1){return _0x44de64['id'];}else{var _0x1f7856=_[_0x9612('0x6d')](_[_0x9612('0x1e')](_0x4da11f,_0x9612('0x6e')),function(_0x496adf){return _[_0x9612('0x6f')](_0x74a850,_0x496adf);});if(_0x1f7856){return _0x44de64['id'];}}}));}}return BPromise['all'](_0x5b4ac0)[_0x9612('0x16')](function(_0x2128a1){_0x54d66b=_(_0x54d66b)[_0x9612('0x70')](_0x2128a1)[_0x9612('0x71')]()['value']();return db[_0x9612('0x25')][_0x9612('0x33')]({'where':{'id':_0x4083b3['params']['id']}})[_0x9612('0x16')](function(_0x19fb96){return db[_0x9612('0x5c')][_0x9612('0x5d')](function(_0x2260ba){return _0x19fb96[_0x9612('0x61')](_0x4083b3[_0x9612('0x27')]['ids'],{'transaction':_0x2260ba})[_0x9612('0x16')](function(){if(!_[_0x9612('0x72')](_0x54d66b)){return _0x19fb96[_0x9612('0x73')](_0x54d66b,{'transaction':_0x2260ba});}})[_0x9612('0x16')](function(){_0x54d66b['forEach'](function(_0x13b802){socket[_0x9612('0x5f')]('userChatQueue:remove',{'UserId':_0x13b802,'ChatQueueId':_0x19fb96['id']});});});});});});})['then'](respondWithStatusCode(_0x57a6ef,null))[_0x9612('0x3b')](handleError(_0x57a6ef,null));};exports[_0x9612('0x74')]=function(_0x397fdc,_0x111635){return db[_0x9612('0x25')]['find']({'where':{'id':_0x397fdc[_0x9612('0x3d')]['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x111635,null))[_0x9612('0x16')](function(_0x371afc){if(_0x371afc){return _0x371afc[_0x9612('0x74')](_0x397fdc['body'][_0x9612('0x56')],_[_0x9612('0x75')](_0x397fdc['body'],[_0x9612('0x56'),'id'])||{})[_0x9612('0x76')](function(_0x365fd5){for(var _0x357044=0x0;_0x357044<_0x397fdc[_0x9612('0x35')][_0x9612('0x56')][_0x9612('0x2f')];_0x357044+=0x1){socket[_0x9612('0x5f')]('userChatQueue:save',{'UserId':Number(_0x397fdc['body'][_0x9612('0x56')][_0x357044]),'ChatQueueId':Number(_0x397fdc[_0x9612('0x3d')]['id'])});}return _0x365fd5;});}})[_0x9612('0x16')](respondWithResult(_0x111635,null))[_0x9612('0x3b')](handleError(_0x111635,null));};exports[_0x9612('0x73')]=function(_0x211551,_0x52741e){return db[_0x9612('0x25')][_0x9612('0x33')]({'where':{'id':_0x211551[_0x9612('0x3d')]['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x52741e,null))['then'](function(_0x50291f){if(_0x50291f){return _0x50291f[_0x9612('0x73')](_0x211551[_0x9612('0x27')][_0x9612('0x56')])['then'](function(){if(_[_0x9612('0x77')](_0x211551[_0x9612('0x27')][_0x9612('0x56')])){for(var _0x122946=0x0;_0x122946<_0x211551[_0x9612('0x27')][_0x9612('0x56')][_0x9612('0x2f')];_0x122946+=0x1){socket[_0x9612('0x5f')]('userChatQueue:remove',{'UserId':Number(_0x211551[_0x9612('0x27')][_0x9612('0x56')][_0x122946]),'ChatQueueId':Number(_0x211551[_0x9612('0x3d')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x211551[_0x9612('0x27')][_0x9612('0x56')]),'ChatQueueId':Number(_0x211551[_0x9612('0x3d')]['id'])});}});}})[_0x9612('0x16')](respondWithStatusCode(_0x52741e,null))[_0x9612('0x3b')](handleError(_0x52741e,null));};exports[_0x9612('0x78')]=function(_0x18f990,_0x5856e5){var _0x321b72={};var _0x5abc65={};var _0x18477a;var _0x2011f8;return db[_0x9612('0x25')][_0x9612('0x40')]({'where':{'id':_0x18f990[_0x9612('0x3d')]['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x5856e5,null))[_0x9612('0x16')](function(_0x3aa24f){if(_0x3aa24f){_0x18477a=_0x3aa24f;_0x5abc65[_0x9612('0x41')]=_['keys'](db[_0x9612('0x4a')][_0x9612('0x1f')]);_0x5abc65[_0x9612('0x27')]=_[_0x9612('0x2a')](_0x18f990['query']);_0x5abc65['filters']=_[_0x9612('0x2c')](_0x5abc65[_0x9612('0x41')],_0x5abc65[_0x9612('0x27')]);_0x321b72['attributes']=_[_0x9612('0x2c')](_0x5abc65[_0x9612('0x41')],qs['fields'](_0x18f990[_0x9612('0x27')][_0x9612('0x2e')]));_0x321b72[_0x9612('0x2d')]=_0x321b72['attributes'][_0x9612('0x2f')]?_0x321b72[_0x9612('0x2d')]:_0x5abc65[_0x9612('0x41')];_0x321b72[_0x9612('0x45')]=qs['sort'](_0x18f990[_0x9612('0x27')][_0x9612('0x46')]);_0x321b72[_0x9612('0x24')]=qs[_0x9612('0x2b')](_[_0x9612('0x54')](_0x18f990[_0x9612('0x27')],_0x5abc65['filters']));if(_0x18f990[_0x9612('0x27')]['filter']){_0x321b72[_0x9612('0x24')]=_[_0x9612('0x31')](_0x321b72[_0x9612('0x24')],{'$or':_['map'](_0x321b72[_0x9612('0x2d')],function(_0x1d095e){var _0x1799e8={};_0x1799e8[_0x1d095e]={'$like':'%'+_0x18f990[_0x9612('0x27')][_0x9612('0x48')]+'%'};return _0x1799e8;})});}_0x321b72=_['merge']({},_0x321b72,_0x18f990[_0x9612('0x32')]);return _0x18477a[_0x9612('0x78')](_0x321b72);}})['then'](function(_0x14acf6){if(_0x14acf6){_0x2011f8=_0x14acf6['length'];if(!_0x18f990['query'][_0x9612('0x42')](_0x9612('0x43'))){_0x321b72[_0x9612('0x44')]=qs[_0x9612('0x44')](_0x18f990[_0x9612('0x27')][_0x9612('0x44')]);_0x321b72[_0x9612('0x11')]=qs['offset'](_0x18f990['query'][_0x9612('0x11')]);}return _0x18477a[_0x9612('0x78')](_0x321b72);}})[_0x9612('0x16')](function(_0x37fb1d){if(_0x37fb1d){return _0x37fb1d?{'count':_0x2011f8,'rows':_0x37fb1d}:null;}})[_0x9612('0x16')](respondWithResult(_0x5856e5,null))[_0x9612('0x3b')](handleError(_0x5856e5,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index a86ab0a..ae7da73 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 _0x62fb=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1d7ed7,_0x3a5e6a){var _0x3fcf8d=function(_0x4c3cfe){while(--_0x4c3cfe){_0x1d7ed7['push'](_0x1d7ed7['shift']());}};_0x3fcf8d(++_0x3a5e6a);}(_0x62fb,0x172));var _0xb62f=function(_0x4f491e,_0xbd7715){_0x4f491e=_0x4f491e-0x0;var _0x24c954=_0x62fb[_0x4f491e];return _0x24c954;};'use strict';var EventEmitter=require(_0xb62f('0x0'));var ChatQueue=require(_0xb62f('0x1'))['db'][_0xb62f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb62f('0x3')](0x0);var events={'afterCreate':_0xb62f('0x4'),'afterUpdate':_0xb62f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22e459){return function(_0x4ba244,_0x21de3f,_0x12fce1){ChatQueueEvents[_0xb62f('0x6')](_0x22e459+':'+_0x4ba244['id'],_0x4ba244);ChatQueueEvents[_0xb62f('0x6')](_0x22e459,_0x4ba244);_0x12fce1(null);};}for(var e in events){if(events[_0xb62f('0x7')](e)){var event=events[e];ChatQueue[_0xb62f('0x8')](e,emitEvent(event));}}module[_0xb62f('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x09a4=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x20b844,_0x1fcefc){var _0x146bcc=function(_0x1abbe9){while(--_0x1abbe9){_0x20b844['push'](_0x20b844['shift']());}};_0x146bcc(++_0x1fcefc);}(_0x09a4,0x147));var _0x409a=function(_0xc28ad2,_0x5de7dd){_0xc28ad2=_0xc28ad2-0x0;var _0x3df1e2=_0x09a4[_0xc28ad2];return _0x3df1e2;};'use strict';var EventEmitter=require(_0x409a('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x409a('0x1')](0x0);var events={'afterCreate':_0x409a('0x2'),'afterUpdate':_0x409a('0x3'),'afterDestroy':_0x409a('0x4')};function emitEvent(_0x56b8c5){return function(_0x2db9e0,_0x630525,_0x32e3cf){ChatQueueEvents[_0x409a('0x5')](_0x56b8c5+':'+_0x2db9e0['id'],_0x2db9e0);ChatQueueEvents[_0x409a('0x5')](_0x56b8c5,_0x2db9e0);_0x32e3cf(null);};}for(var e in events){if(events[_0x409a('0x6')](e)){var event=events[e];ChatQueue[_0x409a('0x7')](e,emitEvent(event));}}module[_0x409a('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 6ffae9f..4c23bb4 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 _0x311f=['ChatQueue','chat_queues','util','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3b6d96,_0x5d3241){var _0x1e6b1c=function(_0x200631){while(--_0x200631){_0x3b6d96['push'](_0x3b6d96['shift']());}};_0x1e6b1c(++_0x5d3241);}(_0x311f,0xc0));var _0xf311=function(_0x487fb9,_0x43c08e){_0x487fb9=_0x487fb9-0x0;var _0x44d36a=_0x311f[_0x487fb9];return _0x44d36a;};'use strict';var _=require('lodash');var util=require(_0xf311('0x0'));var logger=require('../../config/logger')(_0xf311('0x1'));var moment=require(_0xf311('0x2'));var BPromise=require('bluebird');var rp=require(_0xf311('0x3'));var fs=require('fs');var path=require(_0xf311('0x4'));var rimraf=require(_0xf311('0x5'));var config=require(_0xf311('0x6'));var attributes=require('./chatQueue.attributes');module[_0xf311('0x7')]=function(_0x1362b1,_0x54c7d7){return _0x1362b1['define'](_0xf311('0x8'),attributes,{'tableName':_0xf311('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcae2=['bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','moment'];(function(_0x23f58d,_0x22b11c){var _0x515d10=function(_0x18fe4a){while(--_0x18fe4a){_0x23f58d['push'](_0x23f58d['shift']());}};_0x515d10(++_0x22b11c);}(_0xcae2,0x1a1));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2cae('0x0'));var logger=require(_0x2cae('0x1'))('api');var moment=require(_0x2cae('0x2'));var BPromise=require(_0x2cae('0x3'));var rp=require(_0x2cae('0x4'));var fs=require('fs');var path=require(_0x2cae('0x5'));var rimraf=require(_0x2cae('0x6'));var config=require('../../config/environment');var attributes=require(_0x2cae('0x7'));module[_0x2cae('0x8')]=function(_0x3371f0,_0x312a86){return _0x3371f0[_0x2cae('0x9')](_0x2cae('0xa'),attributes,{'tableName':_0x2cae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index cae5450..699b026 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 _0x8b26=['./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','model','map','then','ChatQueue','find','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x8b26,0x1f3));var _0x68b2=function(_0x3875b1,_0x47cf1a){_0x3875b1=_0x3875b1-0x0;var _0x1e9c55=_0x8b26[_0x3875b1];return _0x1e9c55;};'use strict';var _=require(_0x68b2('0x0'));var util=require(_0x68b2('0x1'));var moment=require(_0x68b2('0x2'));var BPromise=require('bluebird');var rs=require(_0x68b2('0x3'));var fs=require('fs');var Redis=require(_0x68b2('0x4'));var db=require(_0x68b2('0x5'))['db'];var utils=require(_0x68b2('0x6'));var logger=require(_0x68b2('0x7'))(_0x68b2('0x8'));var config=require(_0x68b2('0x9'));var jayson=require(_0x68b2('0xa'));var client=jayson[_0x68b2('0xb')][_0x68b2('0xc')]({'port':0x232a});config['redis']=_[_0x68b2('0xd')](config[_0x68b2('0xe')],{'host':_0x68b2('0xf'),'port':0x18eb});var socket=require(_0x68b2('0x10'))(new Redis(config['redis']));require(_0x68b2('0x11'))['register'](socket);function respondWithRpcPromise(_0x5d960c,_0x45e46b,_0x17fd91){return new BPromise(function(_0x179350,_0x4b31c6){return client[_0x68b2('0x12')](_0x5d960c,_0x17fd91)['then'](function(_0x5ef591){logger[_0x68b2('0x13')](_0x68b2('0x14'),_0x45e46b,_0x68b2('0x15'));logger[_0x68b2('0x16')](_0x68b2('0x17'),_0x45e46b,_0x68b2('0x15'),JSON[_0x68b2('0x18')](_0x5ef591));if(_0x5ef591[_0x68b2('0x19')]){if(_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1a')]===0x1f4){logger[_0x68b2('0x19')]('ChatQueue,\x20%s,\x20%s',_0x45e46b,_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1b')]);return _0x4b31c6(_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1b')]);}logger[_0x68b2('0x19')]('ChatQueue,\x20%s,\x20%s',_0x45e46b,_0x5ef591[_0x68b2('0x19')]['message']);return _0x179350(_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1b')]);}else{logger[_0x68b2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x45e46b,'request\x20sent');_0x179350(_0x5ef591[_0x68b2('0x1c')][_0x68b2('0x1b')]);}})[_0x68b2('0x1d')](function(_0x5836a5){logger[_0x68b2('0x19')](_0x68b2('0x14'),_0x45e46b,_0x5836a5);_0x4b31c6(_0x5836a5);});});}exports[_0x68b2('0x1e')]=function(_0x28af4d){var _0x313704=this;return new Promise(function(_0x240c89,_0x8ddd65){return db['ChatQueue'][_0x68b2('0x1f')]({'raw':_0x28af4d[_0x68b2('0x20')]?_0x28af4d[_0x68b2('0x20')][_0x68b2('0x21')]===undefined?!![]:![]:!![],'where':_0x28af4d[_0x68b2('0x20')]?_0x28af4d['options'][_0x68b2('0x22')]||null:null,'attributes':_0x28af4d[_0x68b2('0x20')]?_0x28af4d[_0x68b2('0x20')][_0x68b2('0x23')]||null:null,'limit':_0x28af4d['options']?_0x28af4d[_0x68b2('0x20')]['limit']||null:null,'include':_0x28af4d[_0x68b2('0x20')]?_0x28af4d[_0x68b2('0x20')][_0x68b2('0x24')]?_['map'](_0x28af4d['options'][_0x68b2('0x24')],function(_0x4ecbb3){return{'model':db[_0x4ecbb3[_0x68b2('0x25')]],'as':_0x4ecbb3['as'],'attributes':_0x4ecbb3[_0x68b2('0x23')],'include':_0x4ecbb3[_0x68b2('0x24')]?_[_0x68b2('0x26')](_0x4ecbb3['include'],function(_0x219142){return{'model':db[_0x219142[_0x68b2('0x25')]],'as':_0x219142['as'],'attributes':_0x219142['attributes'],'include':_0x219142[_0x68b2('0x24')]?_['map'](_0x219142[_0x68b2('0x24')],function(_0x5a073b){return{'model':db[_0x5a073b[_0x68b2('0x25')]],'as':_0x5a073b['as'],'attributes':_0x5a073b[_0x68b2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x68b2('0x27')](function(_0x356899){logger[_0x68b2('0x13')]('GetChatQueue',_0x28af4d);logger[_0x68b2('0x16')](_0x68b2('0x1e'),_0x28af4d,JSON['stringify'](_0x356899));_0x240c89(_0x356899);})[_0x68b2('0x1d')](function(_0x4bdb95){logger[_0x68b2('0x19')](_0x68b2('0x1e'),_0x4bdb95[_0x68b2('0x1b')],_0x28af4d);_0x8ddd65(_0x313704[_0x68b2('0x19')](0x1f4,_0x4bdb95[_0x68b2('0x1b')]));});});};exports['ShowChatQueue']=function(_0x533586){var _0x36c81b=this;return new Promise(function(_0x6da681,_0x26dac1){return db[_0x68b2('0x28')][_0x68b2('0x29')]({'raw':_0x533586['options']?_0x533586[_0x68b2('0x20')][_0x68b2('0x21')]===undefined?!![]:![]:!![],'where':_0x533586[_0x68b2('0x20')]?_0x533586[_0x68b2('0x20')][_0x68b2('0x22')]||null:null,'attributes':_0x533586[_0x68b2('0x20')]?_0x533586['options'][_0x68b2('0x23')]||null:null,'include':_0x533586['options']?_0x533586[_0x68b2('0x20')][_0x68b2('0x24')]?_[_0x68b2('0x26')](_0x533586[_0x68b2('0x20')]['include'],function(_0x58552d){return{'model':db[_0x58552d[_0x68b2('0x25')]],'as':_0x58552d['as'],'attributes':_0x58552d[_0x68b2('0x23')],'include':_0x58552d[_0x68b2('0x24')]?_['map'](_0x58552d[_0x68b2('0x24')],function(_0x524fac){return{'model':db[_0x524fac[_0x68b2('0x25')]],'as':_0x524fac['as'],'attributes':_0x524fac[_0x68b2('0x23')],'include':_0x524fac[_0x68b2('0x24')]?_[_0x68b2('0x26')](_0x524fac[_0x68b2('0x24')],function(_0x23ca1b){return{'model':db[_0x23ca1b[_0x68b2('0x25')]],'as':_0x23ca1b['as'],'attributes':_0x23ca1b[_0x68b2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x68b2('0x27')](function(_0x5c05ee){logger[_0x68b2('0x13')](_0x68b2('0x2a'),_0x533586);logger[_0x68b2('0x16')](_0x68b2('0x2a'),_0x533586,JSON[_0x68b2('0x18')](_0x5c05ee));_0x6da681(_0x5c05ee);})[_0x68b2('0x1d')](function(_0x3fdb97){logger[_0x68b2('0x19')](_0x68b2('0x2a'),_0x3fdb97[_0x68b2('0x1b')],_0x533586);_0x26dac1(_0x36c81b[_0x68b2('0x19')](0x1f4,_0x3fdb97[_0x68b2('0x1b')]));});});}; \ No newline at end of file +var _0xde6f=['stringify','error','code','ChatQueue,\x20%s,\x20%s','message','GetChatQueue','ChatQueue','options','limit','include','model','attributes','map','ShowChatQueue','find','raw','where','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0xed9fea,_0x5ed774){var _0x198f12=function(_0xfb85f6){while(--_0xfb85f6){_0xed9fea['push'](_0xed9fea['shift']());}};_0x198f12(++_0x5ed774);}(_0xde6f,0x84));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfde6('0x0'));var BPromise=require(_0xfde6('0x1'));var rs=require(_0xfde6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfde6('0x3'))['db'];var utils=require(_0xfde6('0x4'));var logger=require(_0xfde6('0x5'))(_0xfde6('0x6'));var config=require(_0xfde6('0x7'));var jayson=require(_0xfde6('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xfde6('0x9')]=_[_0xfde6('0xa')](config[_0xfde6('0x9')],{'host':_0xfde6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfde6('0x9')]));require(_0xfde6('0xc'))[_0xfde6('0xd')](socket);function respondWithRpcPromise(_0x5d890c,_0x27e896,_0x470b8a){return new BPromise(function(_0x48dd4c,_0x5167e2){return client[_0xfde6('0xe')](_0x5d890c,_0x470b8a)[_0xfde6('0xf')](function(_0x37df80){logger[_0xfde6('0x10')]('ChatQueue,\x20%s,\x20%s',_0x27e896,_0xfde6('0x11'));logger[_0xfde6('0x12')](_0xfde6('0x13'),_0x27e896,_0xfde6('0x11'),JSON[_0xfde6('0x14')](_0x37df80));if(_0x37df80['error']){if(_0x37df80[_0xfde6('0x15')][_0xfde6('0x16')]===0x1f4){logger['error'](_0xfde6('0x17'),_0x27e896,_0x37df80[_0xfde6('0x15')][_0xfde6('0x18')]);return _0x5167e2(_0x37df80['error'][_0xfde6('0x18')]);}logger[_0xfde6('0x15')](_0xfde6('0x17'),_0x27e896,_0x37df80[_0xfde6('0x15')]['message']);return _0x48dd4c(_0x37df80['error'][_0xfde6('0x18')]);}else{logger['info'](_0xfde6('0x17'),_0x27e896,_0xfde6('0x11'));_0x48dd4c(_0x37df80['result'][_0xfde6('0x18')]);}})['catch'](function(_0x122e45){logger[_0xfde6('0x15')](_0xfde6('0x17'),_0x27e896,_0x122e45);_0x5167e2(_0x122e45);});});}exports[_0xfde6('0x19')]=function(_0x1ec215){var _0x386622=this;return new Promise(function(_0x37b4dc,_0x1841d8){return db[_0xfde6('0x1a')]['findAll']({'raw':_0x1ec215[_0xfde6('0x1b')]?_0x1ec215[_0xfde6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1ec215[_0xfde6('0x1b')]?_0x1ec215[_0xfde6('0x1b')]['where']||null:null,'attributes':_0x1ec215[_0xfde6('0x1b')]?_0x1ec215[_0xfde6('0x1b')]['attributes']||null:null,'limit':_0x1ec215['options']?_0x1ec215[_0xfde6('0x1b')][_0xfde6('0x1c')]||null:null,'include':_0x1ec215['options']?_0x1ec215[_0xfde6('0x1b')]['include']?_['map'](_0x1ec215[_0xfde6('0x1b')][_0xfde6('0x1d')],function(_0x62e9b8){return{'model':db[_0x62e9b8[_0xfde6('0x1e')]],'as':_0x62e9b8['as'],'attributes':_0x62e9b8[_0xfde6('0x1f')],'include':_0x62e9b8[_0xfde6('0x1d')]?_['map'](_0x62e9b8[_0xfde6('0x1d')],function(_0x262373){return{'model':db[_0x262373['model']],'as':_0x262373['as'],'attributes':_0x262373[_0xfde6('0x1f')],'include':_0x262373['include']?_[_0xfde6('0x20')](_0x262373[_0xfde6('0x1d')],function(_0x59661f){return{'model':db[_0x59661f[_0xfde6('0x1e')]],'as':_0x59661f['as'],'attributes':_0x59661f[_0xfde6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c043){logger[_0xfde6('0x10')]('GetChatQueue',_0x1ec215);logger[_0xfde6('0x12')]('GetChatQueue',_0x1ec215,JSON[_0xfde6('0x14')](_0x43c043));_0x37b4dc(_0x43c043);})['catch'](function(_0x52c0db){logger['error'](_0xfde6('0x19'),_0x52c0db[_0xfde6('0x18')],_0x1ec215);_0x1841d8(_0x386622[_0xfde6('0x15')](0x1f4,_0x52c0db[_0xfde6('0x18')]));});});};exports[_0xfde6('0x21')]=function(_0x5a9f1a){var _0x488f7b=this;return new Promise(function(_0x5ae689,_0x183e89){return db[_0xfde6('0x1a')][_0xfde6('0x22')]({'raw':_0x5a9f1a[_0xfde6('0x1b')]?_0x5a9f1a[_0xfde6('0x1b')][_0xfde6('0x23')]===undefined?!![]:![]:!![],'where':_0x5a9f1a[_0xfde6('0x1b')]?_0x5a9f1a[_0xfde6('0x1b')][_0xfde6('0x24')]||null:null,'attributes':_0x5a9f1a['options']?_0x5a9f1a[_0xfde6('0x1b')][_0xfde6('0x1f')]||null:null,'include':_0x5a9f1a[_0xfde6('0x1b')]?_0x5a9f1a[_0xfde6('0x1b')]['include']?_[_0xfde6('0x20')](_0x5a9f1a['options'][_0xfde6('0x1d')],function(_0x359181){return{'model':db[_0x359181[_0xfde6('0x1e')]],'as':_0x359181['as'],'attributes':_0x359181[_0xfde6('0x1f')],'include':_0x359181['include']?_[_0xfde6('0x20')](_0x359181['include'],function(_0x337da2){return{'model':db[_0x337da2[_0xfde6('0x1e')]],'as':_0x337da2['as'],'attributes':_0x337da2['attributes'],'include':_0x337da2[_0xfde6('0x1d')]?_[_0xfde6('0x20')](_0x337da2[_0xfde6('0x1d')],function(_0xa1fc20){return{'model':db[_0xa1fc20['model']],'as':_0xa1fc20['as'],'attributes':_0xa1fc20[_0xfde6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfde6('0xf')](function(_0x3d8957){logger[_0xfde6('0x10')](_0xfde6('0x21'),_0x5a9f1a);logger[_0xfde6('0x12')](_0xfde6('0x21'),_0x5a9f1a,JSON[_0xfde6('0x14')](_0x3d8957));_0x5ae689(_0x3d8957);})[_0xfde6('0x25')](function(_0x312c9b){logger[_0xfde6('0x15')](_0xfde6('0x21'),_0x312c9b[_0xfde6('0x18')],_0x5a9f1a);_0x183e89(_0x488f7b[_0xfde6('0x15')](0x1f4,_0x312c9b[_0xfde6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e226723..553b4df 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 _0x425d=['./chatQueue.events','remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x425d,0x1e0));var _0xd425=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0x425d[_0x2726ad];return _0xd87993;};'use strict';var ChatQueueEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){ChatQueueEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);ChatQueueEvents['on'](_0x50b061,_0xb6ba8e);}}; \ No newline at end of file +var _0x2123=['./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1a215b,_0x5749df){var _0x245257=function(_0x15ef3d){while(--_0x15ef3d){_0x1a215b['push'](_0x1a215b['shift']());}};_0x245257(++_0x5749df);}(_0x2123,0x190));var _0x3212=function(_0x10ee18,_0x16a291){_0x10ee18=_0x10ee18-0x0;var _0xd8c465=_0x2123[_0x10ee18];return _0xd8c465;};'use strict';var ChatQueueEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatQueueEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatQueue:'+_0x4b35e9,_0x5d9d36);ChatQueueEvents['on'](_0x4b35e9,_0x3e17a3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 21852c8..a5f94b0 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x455944,_0x487e92){var _0x52f79e=function(_0x208418){while(--_0x208418){_0x455944['push'](_0x455944['shift']());}};_0x52f79e(++_0x487e92);}(_0xe14b,0x93));var _0xbe14=function(_0xa82c60,_0x3f05bf){_0xa82c60=_0xa82c60-0x0;var _0x291fef=_0xe14b[_0xa82c60];return _0x291fef;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4f1550,_0x34864a){var _0x2ea3ca=function(_0x272eb5){while(--_0x272eb5){_0x4f1550['push'](_0x4f1550['shift']());}};_0x2ea3ca(++_0x34864a);}(_0x55ca,0x126));var _0xa55c=function(_0x2ecd91,_0x1f21e8){_0x2ecd91=_0x2ecd91-0x0;var _0x3bf737=_0x55ca[_0x2ecd91];return _0x3bf737;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 8ed0a16..278b12f 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 _0xb85f=['STRING','DATE','sequelize','exports'];(function(_0x57d9a7,_0x2b6a19){var _0x5e02f1=function(_0x5aacc5){while(--_0x5aacc5){_0x57d9a7['push'](_0x57d9a7['shift']());}};_0x5e02f1(++_0x2b6a19);}(_0xb85f,0x132));var _0xfb85=function(_0xcc6ae,_0x11bc90){_0xcc6ae=_0xcc6ae-0x0;var _0x57e3a8=_0xb85f[_0xcc6ae];return _0x57e3a8;};'use strict';var moment=require('moment');var Sequelize=require(_0xfb85('0x0'));module[_0xfb85('0x1')]={'uniqueid':{'type':Sequelize[_0xfb85('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfb85('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfb85('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe747=['DATE','moment','sequelize','STRING'];(function(_0x47a844,_0x45be97){var _0x570f07=function(_0x1acea7){while(--_0x1acea7){_0x47a844['push'](_0x47a844['shift']());}};_0x570f07(++_0x45be97);}(_0xe747,0x13d));var _0x7e74=function(_0x3bc5a1,_0x530b19){_0x3bc5a1=_0x3bc5a1-0x0;var _0x5d23a3=_0xe747[_0x3bc5a1];return _0x5d23a3;};'use strict';var moment=require(_0x7e74('0x0'));var Sequelize=require(_0x7e74('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x7e74('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7e74('0x3')]},'acceptAt':{'type':Sequelize[_0x7e74('0x3')]},'exitAt':{'type':Sequelize[_0x7e74('0x3')]},'reason':{'type':Sequelize[_0x7e74('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index bb929af..f47e527 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 _0x8458=['reject','update','then','destroy','error','stack','name','send','map','ChatQueueReport','fieldName','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x8458,0x1a5));var _0x8845=function(_0x8c52ba,_0x20a269){_0x8c52ba=_0x8c52ba-0x0;var _0x248eeb=_0x8458[_0x8c52ba];return _0x248eeb;};'use strict';var emlformat=require(_0x8845('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8845('0x1'));var jsonpatch=require(_0x8845('0x2'));var rp=require(_0x8845('0x3'));var moment=require(_0x8845('0x4'));var BPromise=require(_0x8845('0x5'));var Mustache=require('mustache');var util=require(_0x8845('0x6'));var path=require(_0x8845('0x7'));var sox=require(_0x8845('0x8'));var csv=require(_0x8845('0x9'));var ejs=require(_0x8845('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8845('0xb'));var squel=require('squel');var crypto=require(_0x8845('0xc'));var jsforce=require(_0x8845('0xd'));var deskjs=require(_0x8845('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8845('0xf'));var Papa=require(_0x8845('0x10'));var Redis=require('ioredis');var authService=require(_0x8845('0x11'));var qs=require(_0x8845('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8845('0x13'));var logger=require(_0x8845('0x14'))(_0x8845('0x15'));var utils=require(_0x8845('0x16'));var config=require(_0x8845('0x17'));var licenseUtil=require(_0x8845('0x18'));var db=require(_0x8845('0x19'))['db'];function respondWithStatusCode(_0x160380,_0x189cfc){_0x189cfc=_0x189cfc||0xcc;return function(_0x2b11dd){if(_0x2b11dd){return _0x160380[_0x8845('0x1a')](_0x189cfc);}return _0x160380[_0x8845('0x1b')](_0x189cfc)[_0x8845('0x1c')]();};}function respondWithResult(_0x2b9b36,_0x4a3a96){_0x4a3a96=_0x4a3a96||0xc8;return function(_0x110541){if(_0x110541){return _0x2b9b36[_0x8845('0x1b')](_0x4a3a96)['json'](_0x110541);}};}function respondWithFilteredResult(_0x2df404,_0x4138c4){return function(_0x15e80e){if(_0x15e80e){var _0x4e56d2=typeof _0x4138c4['offset']==='undefined'&&typeof _0x4138c4[_0x8845('0x1d')]===_0x8845('0x1e');var _0x41c8dc=_0x15e80e[_0x8845('0x1f')];var _0x10f1d5=_0x4e56d2?0x0:_0x4138c4[_0x8845('0x20')];var _0x433170=_0x4e56d2?_0x15e80e['count']:_0x4138c4['offset']+_0x4138c4['limit'];var _0x2afdda;if(_0x433170>=_0x41c8dc){_0x433170=_0x41c8dc;_0x2afdda=0xc8;}else{_0x2afdda=0xce;}_0x2df404[_0x8845('0x1b')](_0x2afdda);return _0x2df404[_0x8845('0x21')](_0x8845('0x22'),_0x10f1d5+'-'+_0x433170+'/'+_0x41c8dc)['json'](_0x15e80e);}return null;};}function patchUpdates(_0x2e94f5){return function(_0x5a5197){try{jsonpatch['apply'](_0x5a5197,_0x2e94f5,!![]);}catch(_0x1ccdca){return BPromise[_0x8845('0x23')](_0x1ccdca);}return _0x5a5197['save']();};}function saveUpdates(_0x450bfc,_0x23a0d3){return function(_0x597fc5){if(_0x597fc5){return _0x597fc5[_0x8845('0x24')](_0x450bfc)[_0x8845('0x25')](function(_0x2b7ad7){return _0x2b7ad7;});}return null;};}function removeEntity(_0x391972,_0x4e48b1){return function(_0x5cd766){if(_0x5cd766){return _0x5cd766[_0x8845('0x26')]()[_0x8845('0x25')](function(){_0x391972[_0x8845('0x1b')](0xcc)[_0x8845('0x1c')]();});}};}function handleEntityNotFound(_0x3d2fca,_0x18819c){return function(_0x37eea4){if(!_0x37eea4){_0x3d2fca[_0x8845('0x1a')](0x194);}return _0x37eea4;};}function handleError(_0x9f40e8,_0x21be51){_0x21be51=_0x21be51||0x1f4;return function(_0x3e1e6e){logger[_0x8845('0x27')](_0x3e1e6e[_0x8845('0x28')]);if(_0x3e1e6e[_0x8845('0x29')]){delete _0x3e1e6e[_0x8845('0x29')];}_0x9f40e8[_0x8845('0x1b')](_0x21be51)[_0x8845('0x2a')](_0x3e1e6e);};}exports['index']=function(_0x47dfff,_0x3a831f){var _0xd1f69e={},_0x26cae2={},_0x3cc594={'count':0x0,'rows':[]};var _0x26dd9e=_[_0x8845('0x2b')](db[_0x8845('0x2c')]['rawAttributes'],function(_0x2991cd){return{'name':_0x2991cd[_0x8845('0x2d')],'type':_0x2991cd['type'][_0x8845('0x2e')]};});_0x26cae2[_0x8845('0x2f')]=_[_0x8845('0x2b')](_0x26dd9e,_0x8845('0x29'));_0x26cae2[_0x8845('0x30')]=_[_0x8845('0x31')](_0x47dfff[_0x8845('0x30')]);_0x26cae2[_0x8845('0x32')]=_['intersection'](_0x26cae2['model'],_0x26cae2[_0x8845('0x30')]);_0xd1f69e[_0x8845('0x33')]=_['intersection'](_0x26cae2[_0x8845('0x2f')],qs[_0x8845('0x34')](_0x47dfff[_0x8845('0x30')]['fields']));_0xd1f69e['attributes']=_0xd1f69e[_0x8845('0x33')]['length']?_0xd1f69e[_0x8845('0x33')]:_0x26cae2[_0x8845('0x2f')];if(!_0x47dfff[_0x8845('0x30')]['hasOwnProperty'](_0x8845('0x35'))){_0xd1f69e[_0x8845('0x1d')]=qs[_0x8845('0x1d')](_0x47dfff['query'][_0x8845('0x1d')]);_0xd1f69e['offset']=qs[_0x8845('0x20')](_0x47dfff[_0x8845('0x30')][_0x8845('0x20')]);}_0xd1f69e[_0x8845('0x36')]=qs[_0x8845('0x37')](_0x47dfff[_0x8845('0x30')][_0x8845('0x37')]);_0xd1f69e[_0x8845('0x38')]=qs['filters'](_[_0x8845('0x39')](_0x47dfff['query'],_0x26cae2[_0x8845('0x32')]),_0x26dd9e);if(_0x47dfff['query'][_0x8845('0x3a')]){_0xd1f69e[_0x8845('0x38')]=_['merge'](_0xd1f69e[_0x8845('0x38')],{'$or':_['map'](_0x26dd9e,function(_0x1c08a3){if(_0x1c08a3[_0x8845('0x3b')]!==_0x8845('0x3c')){var _0x13d360={};_0x13d360[_0x1c08a3[_0x8845('0x29')]]={'$like':'%'+_0x47dfff[_0x8845('0x30')][_0x8845('0x3a')]+'%'};return _0x13d360;}})});}_0xd1f69e=_[_0x8845('0x3d')]({},_0xd1f69e,_0x47dfff[_0x8845('0x3e')]);var _0x1b967b={'where':_0xd1f69e['where']};return db[_0x8845('0x2c')]['count'](_0x1b967b)[_0x8845('0x25')](function(_0x39cfb6){_0x3cc594['count']=_0x39cfb6;if(_0x47dfff[_0x8845('0x30')][_0x8845('0x3f')]){_0xd1f69e[_0x8845('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x8845('0x41')](_0xd1f69e);})['then'](function(_0x4d3a05){_0x3cc594[_0x8845('0x42')]=_0x4d3a05;return _0x3cc594;})[_0x8845('0x25')](respondWithFilteredResult(_0x3a831f,_0xd1f69e))[_0x8845('0x43')](handleError(_0x3a831f,null));};exports[_0x8845('0x44')]=function(_0x17bff3,_0x3c19c0){var _0x5002c4={'raw':!![],'where':{'id':_0x17bff3[_0x8845('0x45')]['id']}},_0x4f576a={};_0x4f576a[_0x8845('0x2f')]=_[_0x8845('0x31')](db[_0x8845('0x2c')][_0x8845('0x46')]);_0x4f576a[_0x8845('0x30')]=_[_0x8845('0x31')](_0x17bff3[_0x8845('0x30')]);_0x4f576a['filters']=_[_0x8845('0x47')](_0x4f576a[_0x8845('0x2f')],_0x4f576a[_0x8845('0x30')]);_0x5002c4['attributes']=_[_0x8845('0x47')](_0x4f576a[_0x8845('0x2f')],qs[_0x8845('0x34')](_0x17bff3[_0x8845('0x30')][_0x8845('0x34')]));_0x5002c4[_0x8845('0x33')]=_0x5002c4['attributes']['length']?_0x5002c4[_0x8845('0x33')]:_0x4f576a[_0x8845('0x2f')];if(_0x17bff3['query'][_0x8845('0x3f')]){_0x5002c4[_0x8845('0x40')]=[{'all':!![]}];}_0x5002c4=_[_0x8845('0x3d')]({},_0x5002c4,_0x17bff3['options']);return db[_0x8845('0x2c')]['find'](_0x5002c4)['then'](handleEntityNotFound(_0x3c19c0,null))[_0x8845('0x25')](respondWithResult(_0x3c19c0,null))[_0x8845('0x43')](handleError(_0x3c19c0,null));};exports[_0x8845('0x48')]=function(_0x45c22e,_0x2d4ca6){return db[_0x8845('0x2c')]['create'](_0x45c22e[_0x8845('0x49')],{})['then'](respondWithResult(_0x2d4ca6,0xc9))[_0x8845('0x43')](handleError(_0x2d4ca6,null));};exports[_0x8845('0x24')]=function(_0x3bd655,_0x3dbe0a){if(_0x3bd655['body']['id']){delete _0x3bd655[_0x8845('0x49')]['id'];}return db[_0x8845('0x2c')][_0x8845('0x4a')]({'where':{'id':_0x3bd655[_0x8845('0x45')]['id']}})[_0x8845('0x25')](handleEntityNotFound(_0x3dbe0a,null))[_0x8845('0x25')](saveUpdates(_0x3bd655[_0x8845('0x49')],null))['then'](respondWithResult(_0x3dbe0a,null))[_0x8845('0x43')](handleError(_0x3dbe0a,null));};exports[_0x8845('0x26')]=function(_0x2e9ce6,_0x176356){return db[_0x8845('0x2c')]['find']({'where':{'id':_0x2e9ce6[_0x8845('0x45')]['id']}})[_0x8845('0x25')](handleEntityNotFound(_0x176356,null))[_0x8845('0x25')](removeEntity(_0x176356,null))['catch'](handleError(_0x176356,null));};exports[_0x8845('0x4b')]=function(_0x2f8f9e,_0x81f01a){return db[_0x8845('0x2c')][_0x8845('0x4b')]()[_0x8845('0x25')](respondWithResult(_0x81f01a,null))['catch'](handleError(_0x81f01a,null));}; \ No newline at end of file +var _0xaf11=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf11,0x12f));var _0x1af1=function(_0x5825bf,_0x106229){_0x5825bf=_0x5825bf-0x0;var _0x5e842f=_0xaf11[_0x5825bf];return _0x5e842f;};'use strict';var emlformat=require(_0x1af1('0x0'));var rimraf=require(_0x1af1('0x1'));var zipdir=require(_0x1af1('0x2'));var jsonpatch=require(_0x1af1('0x3'));var rp=require('request-promise');var moment=require(_0x1af1('0x4'));var BPromise=require(_0x1af1('0x5'));var Mustache=require(_0x1af1('0x6'));var util=require('util');var path=require(_0x1af1('0x7'));var sox=require(_0x1af1('0x8'));var csv=require(_0x1af1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1af1('0xa'));var _=require('lodash');var squel=require(_0x1af1('0xb'));var crypto=require(_0x1af1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1af1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1af1('0xe'));var Redis=require(_0x1af1('0xf'));var authService=require(_0x1af1('0x10'));var qs=require(_0x1af1('0x11'));var as=require(_0x1af1('0x12'));var hardwareService=require(_0x1af1('0x13'));var logger=require('../../config/logger')(_0x1af1('0x14'));var utils=require(_0x1af1('0x15'));var config=require(_0x1af1('0x16'));var licenseUtil=require(_0x1af1('0x17'));var db=require(_0x1af1('0x18'))['db'];function respondWithStatusCode(_0x20141a,_0x339763){_0x339763=_0x339763||0xcc;return function(_0x5e4634){if(_0x5e4634){return _0x20141a[_0x1af1('0x19')](_0x339763);}return _0x20141a[_0x1af1('0x1a')](_0x339763)[_0x1af1('0x1b')]();};}function respondWithResult(_0x2fe8d4,_0x4e92d5){_0x4e92d5=_0x4e92d5||0xc8;return function(_0x19f4e3){if(_0x19f4e3){return _0x2fe8d4[_0x1af1('0x1a')](_0x4e92d5)[_0x1af1('0x1c')](_0x19f4e3);}};}function respondWithFilteredResult(_0x5d842d,_0x1e756b){return function(_0x41b905){if(_0x41b905){var _0x38df6f=typeof _0x1e756b[_0x1af1('0x1d')]===_0x1af1('0x1e')&&typeof _0x1e756b[_0x1af1('0x1f')]===_0x1af1('0x1e');var _0x45dd76=_0x41b905[_0x1af1('0x20')];var _0x20c17b=_0x38df6f?0x0:_0x1e756b['offset'];var _0x4da591=_0x38df6f?_0x41b905['count']:_0x1e756b[_0x1af1('0x1d')]+_0x1e756b['limit'];var _0xf1c8ae;if(_0x4da591>=_0x45dd76){_0x4da591=_0x45dd76;_0xf1c8ae=0xc8;}else{_0xf1c8ae=0xce;}_0x5d842d[_0x1af1('0x1a')](_0xf1c8ae);return _0x5d842d[_0x1af1('0x21')](_0x1af1('0x22'),_0x20c17b+'-'+_0x4da591+'/'+_0x45dd76)[_0x1af1('0x1c')](_0x41b905);}return null;};}function patchUpdates(_0x5d336){return function(_0x4af71a){try{jsonpatch[_0x1af1('0x23')](_0x4af71a,_0x5d336,!![]);}catch(_0x2ef81a){return BPromise[_0x1af1('0x24')](_0x2ef81a);}return _0x4af71a['save']();};}function saveUpdates(_0x3d1ed1,_0xca2e20){return function(_0x535a8e){if(_0x535a8e){return _0x535a8e[_0x1af1('0x25')](_0x3d1ed1)[_0x1af1('0x26')](function(_0x187dd4){return _0x187dd4;});}return null;};}function removeEntity(_0x51c213,_0x8952cf){return function(_0x4003db){if(_0x4003db){return _0x4003db['destroy']()['then'](function(){_0x51c213['status'](0xcc)[_0x1af1('0x1b')]();});}};}function handleEntityNotFound(_0x5df091,_0x50c0e0){return function(_0x21c60c){if(!_0x21c60c){_0x5df091[_0x1af1('0x19')](0x194);}return _0x21c60c;};}function handleError(_0x3d19e7,_0xbd139d){_0xbd139d=_0xbd139d||0x1f4;return function(_0x6222f1){logger['error'](_0x6222f1[_0x1af1('0x27')]);if(_0x6222f1[_0x1af1('0x28')]){delete _0x6222f1[_0x1af1('0x28')];}_0x3d19e7[_0x1af1('0x1a')](_0xbd139d)[_0x1af1('0x29')](_0x6222f1);};}exports[_0x1af1('0x2a')]=function(_0x4b655b,_0x40e32f){var _0x50438e={},_0x40630d={},_0x440da4={'count':0x0,'rows':[]};var _0x526aba=_['map'](db[_0x1af1('0x2b')][_0x1af1('0x2c')],function(_0x2c1494){return{'name':_0x2c1494[_0x1af1('0x2d')],'type':_0x2c1494['type'][_0x1af1('0x2e')]};});_0x40630d[_0x1af1('0x2f')]=_['map'](_0x526aba,_0x1af1('0x28'));_0x40630d['query']=_[_0x1af1('0x30')](_0x4b655b[_0x1af1('0x31')]);_0x40630d[_0x1af1('0x32')]=_[_0x1af1('0x33')](_0x40630d['model'],_0x40630d[_0x1af1('0x31')]);_0x50438e[_0x1af1('0x34')]=_[_0x1af1('0x33')](_0x40630d['model'],qs['fields'](_0x4b655b[_0x1af1('0x31')]['fields']));_0x50438e[_0x1af1('0x34')]=_0x50438e[_0x1af1('0x34')]['length']?_0x50438e['attributes']:_0x40630d[_0x1af1('0x2f')];if(!_0x4b655b['query'][_0x1af1('0x35')](_0x1af1('0x36'))){_0x50438e[_0x1af1('0x1f')]=qs[_0x1af1('0x1f')](_0x4b655b['query'][_0x1af1('0x1f')]);_0x50438e['offset']=qs[_0x1af1('0x1d')](_0x4b655b['query'][_0x1af1('0x1d')]);}_0x50438e[_0x1af1('0x37')]=qs[_0x1af1('0x38')](_0x4b655b[_0x1af1('0x31')]['sort']);_0x50438e[_0x1af1('0x39')]=qs[_0x1af1('0x32')](_[_0x1af1('0x3a')](_0x4b655b[_0x1af1('0x31')],_0x40630d[_0x1af1('0x32')]),_0x526aba);if(_0x4b655b[_0x1af1('0x31')]['filter']){_0x50438e[_0x1af1('0x39')]=_[_0x1af1('0x3b')](_0x50438e['where'],{'$or':_[_0x1af1('0x3c')](_0x526aba,function(_0x53ef03){if(_0x53ef03[_0x1af1('0x3d')]!==_0x1af1('0x3e')){var _0x4569f5={};_0x4569f5[_0x53ef03[_0x1af1('0x28')]]={'$like':'%'+_0x4b655b[_0x1af1('0x31')]['filter']+'%'};return _0x4569f5;}})});}_0x50438e=_['merge']({},_0x50438e,_0x4b655b[_0x1af1('0x3f')]);var _0x36ab51={'where':_0x50438e[_0x1af1('0x39')]};return db[_0x1af1('0x2b')][_0x1af1('0x20')](_0x36ab51)['then'](function(_0x4683d5){_0x440da4['count']=_0x4683d5;if(_0x4b655b[_0x1af1('0x31')][_0x1af1('0x40')]){_0x50438e[_0x1af1('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x1af1('0x42')](_0x50438e);})[_0x1af1('0x26')](function(_0x13331d){_0x440da4[_0x1af1('0x43')]=_0x13331d;return _0x440da4;})[_0x1af1('0x26')](respondWithFilteredResult(_0x40e32f,_0x50438e))['catch'](handleError(_0x40e32f,null));};exports[_0x1af1('0x44')]=function(_0x115e96,_0x501056){var _0x4ca014={'raw':!![],'where':{'id':_0x115e96['params']['id']}},_0x4c6d0b={};_0x4c6d0b[_0x1af1('0x2f')]=_[_0x1af1('0x30')](db[_0x1af1('0x2b')]['rawAttributes']);_0x4c6d0b[_0x1af1('0x31')]=_[_0x1af1('0x30')](_0x115e96[_0x1af1('0x31')]);_0x4c6d0b[_0x1af1('0x32')]=_[_0x1af1('0x33')](_0x4c6d0b[_0x1af1('0x2f')],_0x4c6d0b['query']);_0x4ca014[_0x1af1('0x34')]=_[_0x1af1('0x33')](_0x4c6d0b[_0x1af1('0x2f')],qs[_0x1af1('0x45')](_0x115e96['query'][_0x1af1('0x45')]));_0x4ca014[_0x1af1('0x34')]=_0x4ca014['attributes']['length']?_0x4ca014[_0x1af1('0x34')]:_0x4c6d0b[_0x1af1('0x2f')];if(_0x115e96['query'][_0x1af1('0x40')]){_0x4ca014[_0x1af1('0x41')]=[{'all':!![]}];}_0x4ca014=_['merge']({},_0x4ca014,_0x115e96[_0x1af1('0x3f')]);return db['ChatQueueReport'][_0x1af1('0x46')](_0x4ca014)['then'](handleEntityNotFound(_0x501056,null))[_0x1af1('0x26')](respondWithResult(_0x501056,null))[_0x1af1('0x47')](handleError(_0x501056,null));};exports['create']=function(_0xabb1c6,_0x1587da){return db[_0x1af1('0x2b')][_0x1af1('0x48')](_0xabb1c6[_0x1af1('0x49')],{})['then'](respondWithResult(_0x1587da,0xc9))[_0x1af1('0x47')](handleError(_0x1587da,null));};exports['update']=function(_0x46e41d,_0x3856be){if(_0x46e41d['body']['id']){delete _0x46e41d[_0x1af1('0x49')]['id'];}return db[_0x1af1('0x2b')][_0x1af1('0x46')]({'where':{'id':_0x46e41d['params']['id']}})[_0x1af1('0x26')](handleEntityNotFound(_0x3856be,null))[_0x1af1('0x26')](saveUpdates(_0x46e41d[_0x1af1('0x49')],null))['then'](respondWithResult(_0x3856be,null))[_0x1af1('0x47')](handleError(_0x3856be,null));};exports[_0x1af1('0x4a')]=function(_0x59b710,_0x27a5d8){return db[_0x1af1('0x2b')][_0x1af1('0x46')]({'where':{'id':_0x59b710['params']['id']}})[_0x1af1('0x26')](handleEntityNotFound(_0x27a5d8,null))[_0x1af1('0x26')](removeEntity(_0x27a5d8,null))[_0x1af1('0x47')](handleError(_0x27a5d8,null));};exports['describe']=function(_0x5b06a5,_0x452d44){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x452d44,null))[_0x1af1('0x47')](handleError(_0x452d44,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 77cf8de..5d4d423 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_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 +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x237cec,_0x15476b){var _0x553476=function(_0x532733){while(--_0x532733){_0x237cec['push'](_0x237cec['shift']());}};_0x553476(++_0x15476b);}(_0x757a,0xde));var _0xa757=function(_0x4eaaaa,_0x28e660){_0x4eaaaa=_0x4eaaaa-0x0;var _0x46d9d9=_0x757a[_0x4eaaaa];return _0x46d9d9;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c483d91..bf0a32d 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 _0x1a58=['UpdateChatQueueReport','update','where','attributes','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport'];(function(_0xa37959,_0x1759fe){var _0x17c997=function(_0x3a5019){while(--_0x3a5019){_0xa37959['push'](_0xa37959['shift']());}};_0x17c997(++_0x1759fe);}(_0x1a58,0x1b6));var _0x81a5=function(_0x22c15a,_0x2d6084){_0x22c15a=_0x22c15a-0x0;var _0x1071ca=_0x1a58[_0x22c15a];return _0x1071ca;};'use strict';var _=require(_0x81a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81a5('0x1'));var fs=require('fs');var Redis=require(_0x81a5('0x2'));var db=require(_0x81a5('0x3'))['db'];var utils=require(_0x81a5('0x4'));var logger=require(_0x81a5('0x5'))(_0x81a5('0x6'));var config=require(_0x81a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x81a5('0x8')][_0x81a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x882e6d,_0x230901,_0x2eefaf){return new BPromise(function(_0x5b6070,_0x2dafee){return client[_0x81a5('0xa')](_0x882e6d,_0x2eefaf)[_0x81a5('0xb')](function(_0x222675){logger[_0x81a5('0xc')](_0x81a5('0xd'),_0x230901,_0x81a5('0xe'));logger[_0x81a5('0xf')](_0x81a5('0x10'),_0x230901,_0x81a5('0xe'),JSON[_0x81a5('0x11')](_0x222675));if(_0x222675[_0x81a5('0x12')]){if(_0x222675[_0x81a5('0x12')][_0x81a5('0x13')]===0x1f4){logger[_0x81a5('0x12')](_0x81a5('0xd'),_0x230901,_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);return _0x2dafee(_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);}logger['error'](_0x81a5('0xd'),_0x230901,_0x222675[_0x81a5('0x12')]['message']);return _0x5b6070(_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);}else{logger[_0x81a5('0xc')](_0x81a5('0xd'),_0x230901,_0x81a5('0xe'));_0x5b6070(_0x222675['result']['message']);}})[_0x81a5('0x15')](function(_0x150d74){logger[_0x81a5('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x230901,_0x150d74);_0x2dafee(_0x150d74);});});}exports['CreateChatQueueReport']=function(_0x2c4cff){var _0x5ae466=this;return new Promise(function(_0x3fefc5,_0x21f32b){return db[_0x81a5('0x16')][_0x81a5('0x17')](_0x2c4cff['body'],{'raw':_0x2c4cff[_0x81a5('0x18')]?_0x2c4cff['options'][_0x81a5('0x19')]===undefined?!![]:![]:!![]})[_0x81a5('0xb')](function(_0x15093a){logger[_0x81a5('0xc')](_0x81a5('0x1a'),_0x2c4cff);logger[_0x81a5('0xf')](_0x81a5('0x1a'),_0x2c4cff,JSON['stringify'](_0x15093a));_0x3fefc5(_0x15093a);})[_0x81a5('0x15')](function(_0x33ff5c){logger[_0x81a5('0x12')]('CreateChatQueueReport',_0x33ff5c['message'],_0x2c4cff);_0x21f32b(_0x5ae466['error'](0x1f4,_0x33ff5c[_0x81a5('0x14')]));});});};exports[_0x81a5('0x1b')]=function(_0x46a3bc){var _0x25c55c=this;return new Promise(function(_0x3107fa,_0x2b3267){return db[_0x81a5('0x16')][_0x81a5('0x1c')](_0x46a3bc['body'],{'raw':_0x46a3bc['options']?_0x46a3bc[_0x81a5('0x18')][_0x81a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46a3bc[_0x81a5('0x18')]?_0x46a3bc['options'][_0x81a5('0x1d')]||null:null,'attributes':_0x46a3bc[_0x81a5('0x18')]?_0x46a3bc[_0x81a5('0x18')][_0x81a5('0x1e')]||null:null,'limit':_0x46a3bc['options']?_0x46a3bc[_0x81a5('0x18')]['limit']||null:null})['then'](function(_0x24aeec){logger[_0x81a5('0xc')](_0x81a5('0x1b'),_0x46a3bc);logger[_0x81a5('0xf')](_0x81a5('0x1b'),_0x46a3bc,JSON['stringify'](_0x24aeec));_0x3107fa(_0x24aeec);})[_0x81a5('0x15')](function(_0x17dda2){logger['error'](_0x81a5('0x1b'),_0x17dda2[_0x81a5('0x14')],_0x46a3bc);_0x2b3267(_0x25c55c[_0x81a5('0x12')](0x1f4,_0x17dda2['message']));});});}; \ No newline at end of file +var _0x315e=['info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x315e,0x1dd));var _0xe315=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x315e[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xe315('0x0'));var util=require(_0xe315('0x1'));var moment=require(_0xe315('0x2'));var BPromise=require('bluebird');var rs=require(_0xe315('0x3'));var fs=require('fs');var Redis=require(_0xe315('0x4'));var db=require(_0xe315('0x5'))['db'];var utils=require(_0xe315('0x6'));var logger=require(_0xe315('0x7'))(_0xe315('0x8'));var config=require(_0xe315('0x9'));var jayson=require(_0xe315('0xa'));var client=jayson['client'][_0xe315('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x137531,_0x3b920a,_0x19332e){return new BPromise(function(_0x3fd83b,_0x59b2bf){return client['request'](_0x137531,_0x19332e)[_0xe315('0xc')](function(_0xdcfc4f){logger[_0xe315('0xd')](_0xe315('0xe'),_0x3b920a,_0xe315('0xf'));logger['debug'](_0xe315('0x10'),_0x3b920a,_0xe315('0xf'),JSON[_0xe315('0x11')](_0xdcfc4f));if(_0xdcfc4f[_0xe315('0x12')]){if(_0xdcfc4f['error'][_0xe315('0x13')]===0x1f4){logger[_0xe315('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3b920a,_0xdcfc4f['error'][_0xe315('0x14')]);return _0x59b2bf(_0xdcfc4f[_0xe315('0x12')]['message']);}logger[_0xe315('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3b920a,_0xdcfc4f[_0xe315('0x12')][_0xe315('0x14')]);return _0x3fd83b(_0xdcfc4f[_0xe315('0x12')]['message']);}else{logger[_0xe315('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3b920a,_0xe315('0xf'));_0x3fd83b(_0xdcfc4f[_0xe315('0x15')]['message']);}})[_0xe315('0x16')](function(_0x22e06e){logger[_0xe315('0x12')](_0xe315('0xe'),_0x3b920a,_0x22e06e);_0x59b2bf(_0x22e06e);});});}exports[_0xe315('0x17')]=function(_0x112821){var _0x2e5e24=this;return new Promise(function(_0x10e106,_0x49f764){return db[_0xe315('0x18')][_0xe315('0x19')](_0x112821[_0xe315('0x1a')],{'raw':_0x112821[_0xe315('0x1b')]?_0x112821[_0xe315('0x1b')][_0xe315('0x1c')]===undefined?!![]:![]:!![]})[_0xe315('0xc')](function(_0x566672){logger[_0xe315('0xd')](_0xe315('0x17'),_0x112821);logger[_0xe315('0x1d')]('CreateChatQueueReport',_0x112821,JSON['stringify'](_0x566672));_0x10e106(_0x566672);})[_0xe315('0x16')](function(_0x249386){logger['error'](_0xe315('0x17'),_0x249386[_0xe315('0x14')],_0x112821);_0x49f764(_0x2e5e24[_0xe315('0x12')](0x1f4,_0x249386[_0xe315('0x14')]));});});};exports[_0xe315('0x1e')]=function(_0x151940){var _0x426296=this;return new Promise(function(_0x10ac47,_0x959f7d){return db[_0xe315('0x18')][_0xe315('0x1f')](_0x151940[_0xe315('0x1a')],{'raw':_0x151940['options']?_0x151940['options'][_0xe315('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x151940[_0xe315('0x1b')]?_0x151940[_0xe315('0x1b')][_0xe315('0x20')]||null:null,'attributes':_0x151940[_0xe315('0x1b')]?_0x151940['options'][_0xe315('0x21')]||null:null,'limit':_0x151940[_0xe315('0x1b')]?_0x151940[_0xe315('0x1b')][_0xe315('0x22')]||null:null})[_0xe315('0xc')](function(_0x29571d){logger[_0xe315('0xd')](_0xe315('0x1e'),_0x151940);logger[_0xe315('0x1d')](_0xe315('0x1e'),_0x151940,JSON[_0xe315('0x11')](_0x29571d));_0x10ac47(_0x29571d);})['catch'](function(_0x5e4a9f){logger[_0xe315('0x12')]('UpdateChatQueueReport',_0x5e4a9f[_0xe315('0x14')],_0x151940);_0x959f7d(_0x426296[_0xe315('0x12')](0x1f4,_0x5e4a9f['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 3327675..5db3d93 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 _0x8551=['put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0xa5fdf4,_0x553bc8){var _0x45a73d=function(_0x3d6276){while(--_0x3d6276){_0xa5fdf4['push'](_0xa5fdf4['shift']());}};_0x45a73d(++_0x553bc8);}(_0x8551,0x159));var _0x1855=function(_0xd24b43,_0x11caa4){_0xd24b43=_0xd24b43-0x0;var _0x2b1b44=_0x8551[_0xd24b43];return _0x2b1b44;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1855('0x0'));var express=require(_0x1855('0x1'));var router=express[_0x1855('0x2')]();var fs_extra=require(_0x1855('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1855('0x4'));var config=require('../../config/environment');var controller=require(_0x1855('0x5'));router[_0x1855('0x6')]('/',auth['isAuthenticated'](),controller[_0x1855('0x7')]);router[_0x1855('0x6')](_0x1855('0x8'),auth[_0x1855('0x9')](),controller[_0x1855('0xa')]);router['get'](_0x1855('0xb'),auth[_0x1855('0x9')](),controller[_0x1855('0xc')]);router[_0x1855('0xd')]('/',auth[_0x1855('0x9')](),controller[_0x1855('0xe')]);router[_0x1855('0xf')](_0x1855('0xb'),auth[_0x1855('0x9')](),controller[_0x1855('0x10')]);router[_0x1855('0x11')](_0x1855('0xb'),auth[_0x1855('0x9')](),controller[_0x1855('0x12')]);module[_0x1855('0x13')]=router; \ No newline at end of file +var _0xb95e=['update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x306698,_0x20c637){var _0x4bcae4=function(_0x367a31){while(--_0x367a31){_0x306698['push'](_0x306698['shift']());}};_0x4bcae4(++_0x20c637);}(_0xb95e,0xf5));var _0xeb95=function(_0x39a70a,_0xb0a23c){_0x39a70a=_0x39a70a-0x0;var _0x356be6=_0xb95e[_0x39a70a];return _0x356be6;};'use strict';var multer=require(_0xeb95('0x0'));var util=require(_0xeb95('0x1'));var path=require(_0xeb95('0x2'));var timeout=require(_0xeb95('0x3'));var express=require('express');var router=express[_0xeb95('0x4')]();var fs_extra=require(_0xeb95('0x5'));var auth=require(_0xeb95('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb95('0x7'));var controller=require(_0xeb95('0x8'));router['get']('/',auth[_0xeb95('0x9')](),controller[_0xeb95('0xa')]);router[_0xeb95('0xb')](_0xeb95('0xc'),auth[_0xeb95('0x9')](),controller[_0xeb95('0xd')]);router[_0xeb95('0xb')](_0xeb95('0xe'),auth[_0xeb95('0x9')](),controller[_0xeb95('0xf')]);router[_0xeb95('0x10')]('/',auth[_0xeb95('0x9')](),controller[_0xeb95('0x11')]);router[_0xeb95('0x12')]('/:id',auth[_0xeb95('0x9')](),controller[_0xeb95('0x13')]);router[_0xeb95('0x14')](_0xeb95('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb95('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index f2eb892..8cd8b4b 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3e1768,_0x2e9066){var _0x489604=function(_0x388f87){while(--_0x388f87){_0x3e1768['push'](_0x3e1768['shift']());}};_0x489604(++_0x2e9066);}(_0x70e0,0x17b));var _0x070e=function(_0x8635cc,_0x1bee82){_0x8635cc=_0x8635cc-0x0;var _0x27600a=_0x70e0[_0x8635cc];return _0x27600a;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x34e8,0x12c));var _0x834e=function(_0x55567c,_0x393abe){_0x55567c=_0x55567c-0x0;var _0x259f31=_0x34e8[_0x55567c];return _0x259f31;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d831648..d5612e0 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 _0x1d63=['rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','ChatTransferReport','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d63,0x13c));var _0x31d6=function(_0x4744f4,_0x515ab0){_0x4744f4=_0x4744f4-0x0;var _0x2c4640=_0x1d63[_0x4744f4];return _0x2c4640;};'use strict';var emlformat=require(_0x31d6('0x0'));var rimraf=require(_0x31d6('0x1'));var zipdir=require(_0x31d6('0x2'));var jsonpatch=require(_0x31d6('0x3'));var rp=require(_0x31d6('0x4'));var moment=require(_0x31d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31d6('0x6'));var util=require(_0x31d6('0x7'));var path=require(_0x31d6('0x8'));var sox=require('sox');var csv=require(_0x31d6('0x9'));var ejs=require(_0x31d6('0xa'));var fs=require('fs');var fs_extra=require(_0x31d6('0xb'));var _=require(_0x31d6('0xc'));var squel=require(_0x31d6('0xd'));var crypto=require(_0x31d6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x31d6('0xf'));var toCsv=require(_0x31d6('0x9'));var querystring=require(_0x31d6('0x10'));var Papa=require(_0x31d6('0x11'));var Redis=require(_0x31d6('0x12'));var authService=require(_0x31d6('0x13'));var qs=require(_0x31d6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d6('0x15'));var logger=require('../../config/logger')(_0x31d6('0x16'));var utils=require(_0x31d6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x31d6('0x18'));var db=require(_0x31d6('0x19'))['db'];function respondWithStatusCode(_0x4526c1,_0x4bd034){_0x4bd034=_0x4bd034||0xcc;return function(_0x2b6181){if(_0x2b6181){return _0x4526c1['sendStatus'](_0x4bd034);}return _0x4526c1[_0x31d6('0x1a')](_0x4bd034)[_0x31d6('0x1b')]();};}function respondWithResult(_0x5336a5,_0x5e11fd){_0x5e11fd=_0x5e11fd||0xc8;return function(_0x53fc0d){if(_0x53fc0d){return _0x5336a5[_0x31d6('0x1a')](_0x5e11fd)[_0x31d6('0x1c')](_0x53fc0d);}};}function respondWithFilteredResult(_0x3b5160,_0x565f0f){return function(_0x2c97c9){if(_0x2c97c9){var _0x291685=typeof _0x565f0f[_0x31d6('0x1d')]===_0x31d6('0x1e')&&typeof _0x565f0f['limit']===_0x31d6('0x1e');var _0x394692=_0x2c97c9[_0x31d6('0x1f')];var _0x1b1b77=_0x291685?0x0:_0x565f0f[_0x31d6('0x1d')];var _0x3a4857=_0x291685?_0x2c97c9[_0x31d6('0x1f')]:_0x565f0f[_0x31d6('0x1d')]+_0x565f0f[_0x31d6('0x20')];var _0x6122fd;if(_0x3a4857>=_0x394692){_0x3a4857=_0x394692;_0x6122fd=0xc8;}else{_0x6122fd=0xce;}_0x3b5160[_0x31d6('0x1a')](_0x6122fd);return _0x3b5160[_0x31d6('0x21')](_0x31d6('0x22'),_0x1b1b77+'-'+_0x3a4857+'/'+_0x394692)['json'](_0x2c97c9);}return null;};}function patchUpdates(_0x46ab30){return function(_0x5e5705){try{jsonpatch[_0x31d6('0x23')](_0x5e5705,_0x46ab30,!![]);}catch(_0x25a64c){return BPromise[_0x31d6('0x24')](_0x25a64c);}return _0x5e5705[_0x31d6('0x25')]();};}function saveUpdates(_0x33cf6c,_0x3e8415){return function(_0x473746){if(_0x473746){return _0x473746[_0x31d6('0x26')](_0x33cf6c)['then'](function(_0x56e3bc){return _0x56e3bc;});}return null;};}function removeEntity(_0x5e3120,_0x5a78e8){return function(_0x1091d2){if(_0x1091d2){return _0x1091d2[_0x31d6('0x27')]()[_0x31d6('0x28')](function(){_0x5e3120[_0x31d6('0x1a')](0xcc)[_0x31d6('0x1b')]();});}};}function handleEntityNotFound(_0xb62601,_0x3052ef){return function(_0x210162){if(!_0x210162){_0xb62601[_0x31d6('0x29')](0x194);}return _0x210162;};}function handleError(_0x18a8bb,_0x2a04b0){_0x2a04b0=_0x2a04b0||0x1f4;return function(_0x2d7c12){logger[_0x31d6('0x2a')](_0x2d7c12[_0x31d6('0x2b')]);if(_0x2d7c12[_0x31d6('0x2c')]){delete _0x2d7c12[_0x31d6('0x2c')];}_0x18a8bb[_0x31d6('0x1a')](_0x2a04b0)['send'](_0x2d7c12);};}exports['index']=function(_0x481b34,_0x17bc47){var _0x162ad8={},_0x4ed85a={},_0x2c8316={'count':0x0,'rows':[]};var _0xe70926=_[_0x31d6('0x2d')](db['ChatTransferReport'][_0x31d6('0x2e')],function(_0x37581c){return{'name':_0x37581c[_0x31d6('0x2f')],'type':_0x37581c[_0x31d6('0x30')]['key']};});_0x4ed85a['model']=_['map'](_0xe70926,_0x31d6('0x2c'));_0x4ed85a[_0x31d6('0x31')]=_[_0x31d6('0x32')](_0x481b34['query']);_0x4ed85a[_0x31d6('0x33')]=_[_0x31d6('0x34')](_0x4ed85a[_0x31d6('0x35')],_0x4ed85a[_0x31d6('0x31')]);_0x162ad8['attributes']=_[_0x31d6('0x34')](_0x4ed85a[_0x31d6('0x35')],qs[_0x31d6('0x36')](_0x481b34[_0x31d6('0x31')][_0x31d6('0x36')]));_0x162ad8[_0x31d6('0x37')]=_0x162ad8['attributes'][_0x31d6('0x38')]?_0x162ad8[_0x31d6('0x37')]:_0x4ed85a[_0x31d6('0x35')];if(!_0x481b34[_0x31d6('0x31')][_0x31d6('0x39')](_0x31d6('0x3a'))){_0x162ad8[_0x31d6('0x20')]=qs['limit'](_0x481b34[_0x31d6('0x31')]['limit']);_0x162ad8[_0x31d6('0x1d')]=qs[_0x31d6('0x1d')](_0x481b34[_0x31d6('0x31')]['offset']);}_0x162ad8[_0x31d6('0x3b')]=qs[_0x31d6('0x3c')](_0x481b34['query'][_0x31d6('0x3c')]);_0x162ad8[_0x31d6('0x3d')]=qs[_0x31d6('0x33')](_['pick'](_0x481b34['query'],_0x4ed85a[_0x31d6('0x33')]),_0xe70926);if(_0x481b34[_0x31d6('0x31')]['filter']){_0x162ad8[_0x31d6('0x3d')]=_[_0x31d6('0x3e')](_0x162ad8[_0x31d6('0x3d')],{'$or':_[_0x31d6('0x2d')](_0xe70926,function(_0x3ab4e6){if(_0x3ab4e6[_0x31d6('0x30')]!==_0x31d6('0x3f')){var _0x20d3e8={};_0x20d3e8[_0x3ab4e6[_0x31d6('0x2c')]]={'$like':'%'+_0x481b34['query'][_0x31d6('0x40')]+'%'};return _0x20d3e8;}})});}_0x162ad8=_[_0x31d6('0x3e')]({},_0x162ad8,_0x481b34[_0x31d6('0x41')]);var _0x3399f3={'where':_0x162ad8[_0x31d6('0x3d')]};return db[_0x31d6('0x42')]['count'](_0x3399f3)[_0x31d6('0x28')](function(_0x172be9){_0x2c8316['count']=_0x172be9;if(_0x481b34['query'][_0x31d6('0x43')]){_0x162ad8[_0x31d6('0x44')]=[{'all':!![]}];}return db[_0x31d6('0x42')]['findAll'](_0x162ad8);})[_0x31d6('0x28')](function(_0x4329dd){_0x2c8316[_0x31d6('0x45')]=_0x4329dd;return _0x2c8316;})[_0x31d6('0x28')](respondWithFilteredResult(_0x17bc47,_0x162ad8))[_0x31d6('0x46')](handleError(_0x17bc47,null));};exports[_0x31d6('0x47')]=function(_0x3b8379,_0x173c82){var _0x5653b7={'raw':!![],'where':{'id':_0x3b8379[_0x31d6('0x48')]['id']}},_0x2b4055={};_0x2b4055[_0x31d6('0x35')]=_[_0x31d6('0x32')](db[_0x31d6('0x42')][_0x31d6('0x2e')]);_0x2b4055[_0x31d6('0x31')]=_[_0x31d6('0x32')](_0x3b8379[_0x31d6('0x31')]);_0x2b4055['filters']=_[_0x31d6('0x34')](_0x2b4055['model'],_0x2b4055[_0x31d6('0x31')]);_0x5653b7[_0x31d6('0x37')]=_[_0x31d6('0x34')](_0x2b4055[_0x31d6('0x35')],qs[_0x31d6('0x36')](_0x3b8379['query'][_0x31d6('0x36')]));_0x5653b7['attributes']=_0x5653b7[_0x31d6('0x37')][_0x31d6('0x38')]?_0x5653b7[_0x31d6('0x37')]:_0x2b4055[_0x31d6('0x35')];if(_0x3b8379['query'][_0x31d6('0x43')]){_0x5653b7['include']=[{'all':!![]}];}_0x5653b7=_[_0x31d6('0x3e')]({},_0x5653b7,_0x3b8379[_0x31d6('0x41')]);return db[_0x31d6('0x42')][_0x31d6('0x49')](_0x5653b7)[_0x31d6('0x28')](handleEntityNotFound(_0x173c82,null))[_0x31d6('0x28')](respondWithResult(_0x173c82,null))['catch'](handleError(_0x173c82,null));};exports['create']=function(_0x491ff1,_0x4844fc){return db['ChatTransferReport'][_0x31d6('0x4a')](_0x491ff1[_0x31d6('0x4b')],{})[_0x31d6('0x28')](respondWithResult(_0x4844fc,0xc9))[_0x31d6('0x46')](handleError(_0x4844fc,null));};exports[_0x31d6('0x26')]=function(_0xbe0dd5,_0x3c2fb0){if(_0xbe0dd5[_0x31d6('0x4b')]['id']){delete _0xbe0dd5[_0x31d6('0x4b')]['id'];}return db['ChatTransferReport'][_0x31d6('0x49')]({'where':{'id':_0xbe0dd5[_0x31d6('0x48')]['id']}})[_0x31d6('0x28')](handleEntityNotFound(_0x3c2fb0,null))[_0x31d6('0x28')](saveUpdates(_0xbe0dd5['body'],null))['then'](respondWithResult(_0x3c2fb0,null))['catch'](handleError(_0x3c2fb0,null));};exports[_0x31d6('0x27')]=function(_0x3fbaa4,_0x14a71f){return db['ChatTransferReport'][_0x31d6('0x49')]({'where':{'id':_0x3fbaa4[_0x31d6('0x48')]['id']}})[_0x31d6('0x28')](handleEntityNotFound(_0x14a71f,null))[_0x31d6('0x28')](removeEntity(_0x14a71f,null))[_0x31d6('0x46')](handleError(_0x14a71f,null));};exports[_0x31d6('0x4c')]=function(_0x4b7b85,_0x41466a){return db['ChatTransferReport'][_0x31d6('0x4c')]()[_0x31d6('0x28')](respondWithResult(_0x41466a,null))[_0x31d6('0x46')](handleError(_0x41466a,null));}; \ No newline at end of file +var _0xe77e=['set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatTransferReport','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xe77e,0xc4));var _0xee77=function(_0x3bfb60,_0x176e88){_0x3bfb60=_0x3bfb60-0x0;var _0x2a4ef3=_0xe77e[_0x3bfb60];return _0x2a4ef3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee77('0x0'));var zipdir=require(_0xee77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee77('0x2'));var moment=require(_0xee77('0x3'));var BPromise=require(_0xee77('0x4'));var Mustache=require(_0xee77('0x5'));var util=require(_0xee77('0x6'));var path=require(_0xee77('0x7'));var sox=require(_0xee77('0x8'));var csv=require(_0xee77('0x9'));var ejs=require(_0xee77('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xee77('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xee77('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee77('0xd'));var Redis=require(_0xee77('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xee77('0xf'));var as=require(_0xee77('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee77('0x11'))(_0xee77('0x12'));var utils=require(_0xee77('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xee77('0x14'));var db=require(_0xee77('0x15'))['db'];function respondWithStatusCode(_0x4cf31d,_0x375c30){_0x375c30=_0x375c30||0xcc;return function(_0x3bf2b9){if(_0x3bf2b9){return _0x4cf31d[_0xee77('0x16')](_0x375c30);}return _0x4cf31d[_0xee77('0x17')](_0x375c30)['end']();};}function respondWithResult(_0x2cc0cf,_0x240b9a){_0x240b9a=_0x240b9a||0xc8;return function(_0x2373b2){if(_0x2373b2){return _0x2cc0cf[_0xee77('0x17')](_0x240b9a)[_0xee77('0x18')](_0x2373b2);}};}function respondWithFilteredResult(_0x368741,_0x5c6a02){return function(_0x117e06){if(_0x117e06){var _0x384c00=typeof _0x5c6a02[_0xee77('0x19')]===_0xee77('0x1a')&&typeof _0x5c6a02[_0xee77('0x1b')]==='undefined';var _0x253ac3=_0x117e06[_0xee77('0x1c')];var _0x39bbd2=_0x384c00?0x0:_0x5c6a02[_0xee77('0x19')];var _0x10f837=_0x384c00?_0x117e06['count']:_0x5c6a02[_0xee77('0x19')]+_0x5c6a02[_0xee77('0x1b')];var _0x30edfe;if(_0x10f837>=_0x253ac3){_0x10f837=_0x253ac3;_0x30edfe=0xc8;}else{_0x30edfe=0xce;}_0x368741['status'](_0x30edfe);return _0x368741[_0xee77('0x1d')](_0xee77('0x1e'),_0x39bbd2+'-'+_0x10f837+'/'+_0x253ac3)[_0xee77('0x18')](_0x117e06);}return null;};}function patchUpdates(_0x1d4227){return function(_0x1e518f){try{jsonpatch[_0xee77('0x1f')](_0x1e518f,_0x1d4227,!![]);}catch(_0x1ab640){return BPromise[_0xee77('0x20')](_0x1ab640);}return _0x1e518f[_0xee77('0x21')]();};}function saveUpdates(_0x4c45fe,_0x315421){return function(_0xc0ea04){if(_0xc0ea04){return _0xc0ea04[_0xee77('0x22')](_0x4c45fe)[_0xee77('0x23')](function(_0x49f11b){return _0x49f11b;});}return null;};}function removeEntity(_0x5d1faf,_0xa40dad){return function(_0x1ba5f0){if(_0x1ba5f0){return _0x1ba5f0[_0xee77('0x24')]()[_0xee77('0x23')](function(){_0x5d1faf[_0xee77('0x17')](0xcc)[_0xee77('0x25')]();});}};}function handleEntityNotFound(_0x39248b,_0x589a1d){return function(_0x4bf852){if(!_0x4bf852){_0x39248b[_0xee77('0x16')](0x194);}return _0x4bf852;};}function handleError(_0x3a19bf,_0x3321fa){_0x3321fa=_0x3321fa||0x1f4;return function(_0x3e1138){logger[_0xee77('0x26')](_0x3e1138['stack']);if(_0x3e1138[_0xee77('0x27')]){delete _0x3e1138[_0xee77('0x27')];}_0x3a19bf[_0xee77('0x17')](_0x3321fa)['send'](_0x3e1138);};}exports[_0xee77('0x28')]=function(_0x1a8256,_0x737f40){var _0x2ec5d3={},_0x1d04fd={},_0xaa5b68={'count':0x0,'rows':[]};var _0x3974e7=_['map'](db['ChatTransferReport'][_0xee77('0x29')],function(_0x3c1207){return{'name':_0x3c1207[_0xee77('0x2a')],'type':_0x3c1207[_0xee77('0x2b')][_0xee77('0x2c')]};});_0x1d04fd[_0xee77('0x2d')]=_[_0xee77('0x2e')](_0x3974e7,_0xee77('0x27'));_0x1d04fd['query']=_[_0xee77('0x2f')](_0x1a8256['query']);_0x1d04fd[_0xee77('0x30')]=_['intersection'](_0x1d04fd[_0xee77('0x2d')],_0x1d04fd[_0xee77('0x31')]);_0x2ec5d3[_0xee77('0x32')]=_[_0xee77('0x33')](_0x1d04fd[_0xee77('0x2d')],qs[_0xee77('0x34')](_0x1a8256[_0xee77('0x31')]['fields']));_0x2ec5d3['attributes']=_0x2ec5d3['attributes'][_0xee77('0x35')]?_0x2ec5d3[_0xee77('0x32')]:_0x1d04fd[_0xee77('0x2d')];if(!_0x1a8256['query'][_0xee77('0x36')](_0xee77('0x37'))){_0x2ec5d3[_0xee77('0x1b')]=qs[_0xee77('0x1b')](_0x1a8256[_0xee77('0x31')]['limit']);_0x2ec5d3[_0xee77('0x19')]=qs[_0xee77('0x19')](_0x1a8256[_0xee77('0x31')][_0xee77('0x19')]);}_0x2ec5d3[_0xee77('0x38')]=qs[_0xee77('0x39')](_0x1a8256[_0xee77('0x31')][_0xee77('0x39')]);_0x2ec5d3[_0xee77('0x3a')]=qs[_0xee77('0x30')](_[_0xee77('0x3b')](_0x1a8256['query'],_0x1d04fd['filters']),_0x3974e7);if(_0x1a8256[_0xee77('0x31')][_0xee77('0x3c')]){_0x2ec5d3[_0xee77('0x3a')]=_[_0xee77('0x3d')](_0x2ec5d3[_0xee77('0x3a')],{'$or':_[_0xee77('0x2e')](_0x3974e7,function(_0x16bca7){if(_0x16bca7['type']!==_0xee77('0x3e')){var _0x4c280f={};_0x4c280f[_0x16bca7[_0xee77('0x27')]]={'$like':'%'+_0x1a8256['query'][_0xee77('0x3c')]+'%'};return _0x4c280f;}})});}_0x2ec5d3=_[_0xee77('0x3d')]({},_0x2ec5d3,_0x1a8256['options']);var _0x5a7524={'where':_0x2ec5d3[_0xee77('0x3a')]};return db[_0xee77('0x3f')][_0xee77('0x1c')](_0x5a7524)['then'](function(_0x5a80df){_0xaa5b68[_0xee77('0x1c')]=_0x5a80df;if(_0x1a8256[_0xee77('0x31')][_0xee77('0x40')]){_0x2ec5d3[_0xee77('0x41')]=[{'all':!![]}];}return db[_0xee77('0x3f')][_0xee77('0x42')](_0x2ec5d3);})[_0xee77('0x23')](function(_0x3663fd){_0xaa5b68[_0xee77('0x43')]=_0x3663fd;return _0xaa5b68;})[_0xee77('0x23')](respondWithFilteredResult(_0x737f40,_0x2ec5d3))[_0xee77('0x44')](handleError(_0x737f40,null));};exports['show']=function(_0xe989ab,_0x4d9569){var _0x42946d={'raw':!![],'where':{'id':_0xe989ab[_0xee77('0x45')]['id']}},_0x41b86f={};_0x41b86f[_0xee77('0x2d')]=_[_0xee77('0x2f')](db['ChatTransferReport'][_0xee77('0x29')]);_0x41b86f[_0xee77('0x31')]=_['keys'](_0xe989ab[_0xee77('0x31')]);_0x41b86f[_0xee77('0x30')]=_[_0xee77('0x33')](_0x41b86f[_0xee77('0x2d')],_0x41b86f[_0xee77('0x31')]);_0x42946d[_0xee77('0x32')]=_[_0xee77('0x33')](_0x41b86f[_0xee77('0x2d')],qs['fields'](_0xe989ab[_0xee77('0x31')][_0xee77('0x34')]));_0x42946d[_0xee77('0x32')]=_0x42946d[_0xee77('0x32')][_0xee77('0x35')]?_0x42946d[_0xee77('0x32')]:_0x41b86f[_0xee77('0x2d')];if(_0xe989ab[_0xee77('0x31')]['includeAll']){_0x42946d[_0xee77('0x41')]=[{'all':!![]}];}_0x42946d=_[_0xee77('0x3d')]({},_0x42946d,_0xe989ab[_0xee77('0x46')]);return db[_0xee77('0x3f')][_0xee77('0x47')](_0x42946d)[_0xee77('0x23')](handleEntityNotFound(_0x4d9569,null))[_0xee77('0x23')](respondWithResult(_0x4d9569,null))[_0xee77('0x44')](handleError(_0x4d9569,null));};exports[_0xee77('0x48')]=function(_0x39c4f5,_0x15a4cc){return db[_0xee77('0x3f')][_0xee77('0x48')](_0x39c4f5[_0xee77('0x49')],{})[_0xee77('0x23')](respondWithResult(_0x15a4cc,0xc9))[_0xee77('0x44')](handleError(_0x15a4cc,null));};exports[_0xee77('0x22')]=function(_0x505f3c,_0x22d15b){if(_0x505f3c[_0xee77('0x49')]['id']){delete _0x505f3c[_0xee77('0x49')]['id'];}return db[_0xee77('0x3f')][_0xee77('0x47')]({'where':{'id':_0x505f3c[_0xee77('0x45')]['id']}})['then'](handleEntityNotFound(_0x22d15b,null))[_0xee77('0x23')](saveUpdates(_0x505f3c[_0xee77('0x49')],null))[_0xee77('0x23')](respondWithResult(_0x22d15b,null))[_0xee77('0x44')](handleError(_0x22d15b,null));};exports[_0xee77('0x24')]=function(_0x5d32c3,_0x58fa51){return db['ChatTransferReport']['find']({'where':{'id':_0x5d32c3['params']['id']}})[_0xee77('0x23')](handleEntityNotFound(_0x58fa51,null))[_0xee77('0x23')](removeEntity(_0x58fa51,null))[_0xee77('0x44')](handleError(_0x58fa51,null));};exports[_0xee77('0x4a')]=function(_0x538418,_0x528050){return db[_0xee77('0x3f')][_0xee77('0x4a')]()['then'](respondWithResult(_0x528050,null))[_0xee77('0x44')](handleError(_0x528050,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 12a86cc..6ddcae3 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 _0x6845=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x2c3c52,_0x57e3d6){var _0xe670a3=function(_0x467e34){while(--_0x467e34){_0x2c3c52['push'](_0x2c3c52['shift']());}};_0xe670a3(++_0x57e3d6);}(_0x6845,0x17c));var _0x5684=function(_0x49347f,_0x187a45){_0x49347f=_0x49347f-0x0;var _0x467e4f=_0x6845[_0x49347f];return _0x467e4f;};'use strict';var _=require(_0x5684('0x0'));var util=require(_0x5684('0x1'));var logger=require(_0x5684('0x2'))(_0x5684('0x3'));var moment=require('moment');var BPromise=require(_0x5684('0x4'));var rp=require(_0x5684('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5684('0x6'));var config=require(_0x5684('0x7'));var attributes=require(_0x5684('0x8'));module[_0x5684('0x9')]=function(_0x4c6f85,_0x56020f){return _0x4c6f85[_0x5684('0xa')](_0x5684('0xb'),attributes,{'tableName':_0x5684('0xc'),'paranoid':![],'indexes':[{'name':_0x5684('0xd'),'fields':[_0x5684('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd055=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x4c59c2,_0x4c5d26){var _0x4c3a33=function(_0x27bfc7){while(--_0x27bfc7){_0x4c59c2['push'](_0x4c59c2['shift']());}};_0x4c3a33(++_0x4c5d26);}(_0xd055,0x1af));var _0x5d05=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0xd055[_0x1c470d];return _0x12141b;};'use strict';var _=require(_0x5d05('0x0'));var util=require(_0x5d05('0x1'));var logger=require(_0x5d05('0x2'))(_0x5d05('0x3'));var moment=require(_0x5d05('0x4'));var BPromise=require(_0x5d05('0x5'));var rp=require(_0x5d05('0x6'));var fs=require('fs');var path=require(_0x5d05('0x7'));var rimraf=require(_0x5d05('0x8'));var config=require(_0x5d05('0x9'));var attributes=require(_0x5d05('0xa'));module[_0x5d05('0xb')]=function(_0x34366d,_0x2d4152){return _0x34366d[_0x5d05('0xc')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5d05('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 0167ec8..2b39303 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 _0x8b72=['util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8b72,0xe7));var _0x28b7=function(_0x57c2aa,_0x1ce944){_0x57c2aa=_0x57c2aa-0x0;var _0xc614b9=_0x8b72[_0x57c2aa];return _0xc614b9;};'use strict';var _=require('lodash');var util=require(_0x28b7('0x0'));var moment=require('moment');var BPromise=require(_0x28b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28b7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x28b7('0x3'));var logger=require(_0x28b7('0x4'))(_0x28b7('0x5'));var config=require(_0x28b7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x28b7('0x7')][_0x28b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2935ca,_0x95f287,_0x428cb4){return new BPromise(function(_0x56a174,_0x222231){return client[_0x28b7('0x9')](_0x2935ca,_0x428cb4)[_0x28b7('0xa')](function(_0x2cd3d1){logger[_0x28b7('0xb')](_0x28b7('0xc'),_0x95f287,_0x28b7('0xd'));logger[_0x28b7('0xe')](_0x28b7('0xf'),_0x95f287,_0x28b7('0xd'),JSON[_0x28b7('0x10')](_0x2cd3d1));if(_0x2cd3d1['error']){if(_0x2cd3d1['error']['code']===0x1f4){logger[_0x28b7('0x11')](_0x28b7('0xc'),_0x95f287,_0x2cd3d1['error']['message']);return _0x222231(_0x2cd3d1[_0x28b7('0x11')][_0x28b7('0x12')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x95f287,_0x2cd3d1[_0x28b7('0x11')][_0x28b7('0x12')]);return _0x56a174(_0x2cd3d1[_0x28b7('0x11')][_0x28b7('0x12')]);}else{logger['info'](_0x28b7('0xc'),_0x95f287,_0x28b7('0xd'));_0x56a174(_0x2cd3d1[_0x28b7('0x13')][_0x28b7('0x12')]);}})[_0x28b7('0x14')](function(_0x44a9fc){logger[_0x28b7('0x11')](_0x28b7('0xc'),_0x95f287,_0x44a9fc);_0x222231(_0x44a9fc);});});} \ No newline at end of file +var _0x7b2d=['jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1397f1,_0x1498e2){var _0x1a47fb=function(_0x1c2265){while(--_0x1c2265){_0x1397f1['push'](_0x1397f1['shift']());}};_0x1a47fb(++_0x1498e2);}(_0x7b2d,0x81));var _0xd7b2=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7b2d[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xd7b2('0x0'));var moment=require(_0xd7b2('0x1'));var BPromise=require(_0xd7b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7b2('0x3'));var db=require(_0xd7b2('0x4'))['db'];var utils=require(_0xd7b2('0x5'));var logger=require(_0xd7b2('0x6'))(_0xd7b2('0x7'));var config=require(_0xd7b2('0x8'));var jayson=require(_0xd7b2('0x9'));var client=jayson[_0xd7b2('0xa')][_0xd7b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d2beb,_0x4a2c1d,_0x583642){return new BPromise(function(_0x3ddc11,_0x5a9158){return client[_0xd7b2('0xc')](_0x2d2beb,_0x583642)[_0xd7b2('0xd')](function(_0x1acd73){logger[_0xd7b2('0xe')](_0xd7b2('0xf'),_0x4a2c1d,'request\x20sent');logger['debug'](_0xd7b2('0x10'),_0x4a2c1d,'request\x20sent',JSON[_0xd7b2('0x11')](_0x1acd73));if(_0x1acd73['error']){if(_0x1acd73[_0xd7b2('0x12')][_0xd7b2('0x13')]===0x1f4){logger['error'](_0xd7b2('0xf'),_0x4a2c1d,_0x1acd73[_0xd7b2('0x12')][_0xd7b2('0x14')]);return _0x5a9158(_0x1acd73['error']['message']);}logger[_0xd7b2('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4a2c1d,_0x1acd73[_0xd7b2('0x12')][_0xd7b2('0x14')]);return _0x3ddc11(_0x1acd73['error']['message']);}else{logger[_0xd7b2('0xe')](_0xd7b2('0xf'),_0x4a2c1d,_0xd7b2('0x15'));_0x3ddc11(_0x1acd73['result'][_0xd7b2('0x14')]);}})[_0xd7b2('0x16')](function(_0x1443fb){logger[_0xd7b2('0x12')](_0xd7b2('0xf'),_0x4a2c1d,_0x1443fb);_0x5a9158(_0x1443fb);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 156769c..186462f 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 _0x2eea=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x2eea,0xcb));var _0xa2ee=function(_0x1ca7d6,_0x3f531a){_0x1ca7d6=_0x1ca7d6-0x0;var _0x2a64ee=_0x2eea[_0x1ca7d6];return _0x2a64ee;};'use strict';var multer=require(_0xa2ee('0x0'));var util=require(_0xa2ee('0x1'));var path=require(_0xa2ee('0x2'));var timeout=require(_0xa2ee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2ee('0x4'));var config=require(_0xa2ee('0x5'));var controller=require(_0xa2ee('0x6'));router[_0xa2ee('0x7')]('/',auth[_0xa2ee('0x8')](),controller[_0xa2ee('0x9')]);router['get'](_0xa2ee('0xa'),auth[_0xa2ee('0x8')](),controller[_0xa2ee('0xb')]);router[_0xa2ee('0x7')](_0xa2ee('0xc'),auth[_0xa2ee('0x8')](),controller[_0xa2ee('0xd')]);router[_0xa2ee('0xe')]('/',auth['isAuthenticated'](),controller[_0xa2ee('0xf')]);router[_0xa2ee('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa2ee('0x11')](_0xa2ee('0xc'),auth[_0xa2ee('0x8')](),controller[_0xa2ee('0x12')]);module[_0xa2ee('0x13')]=router; \ No newline at end of file +var _0x346d=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','update','delete','/:id','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x346d,0x85));var _0xd346=function(_0x56fc4f,_0xd1f6a){_0x56fc4f=_0x56fc4f-0x0;var _0x5d0c0b=_0x346d[_0x56fc4f];return _0x5d0c0b;};'use strict';var multer=require(_0xd346('0x0'));var util=require(_0xd346('0x1'));var path=require(_0xd346('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd346('0x3')]();var fs_extra=require(_0xd346('0x4'));var auth=require(_0xd346('0x5'));var interaction=require(_0xd346('0x6'));var config=require(_0xd346('0x7'));var controller=require(_0xd346('0x8'));router[_0xd346('0x9')]('/',auth['isAuthenticated'](),controller[_0xd346('0xa')]);router[_0xd346('0x9')](_0xd346('0xb'),auth[_0xd346('0xc')](),controller[_0xd346('0xd')]);router[_0xd346('0x9')]('/:id',auth[_0xd346('0xc')](),controller[_0xd346('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd346('0xf')]);router[_0xd346('0x10')]('/:id',auth[_0xd346('0xc')](),controller[_0xd346('0x11')]);router[_0xd346('0x12')](_0xd346('0x13'),auth[_0xd346('0xc')](),controller[_0xd346('0x14')]);module[_0xd346('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index affd9eb..1a5604a 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 _0x58fd=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','setDataValue','Comments','offlineForm','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x58fd,0x1c3));var _0xd58f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x58fd[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd58f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd58f('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x2')},'mapKeyOffline':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x2')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'defaultValue':_0xd58f('0x3'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd58f('0x3'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd58f('0x4'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd58f('0x1')]},'animation':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd58f('0x7')](_0xd58f('0x8'),_0xd58f('0x9')),'defaultValue':_0xd58f('0x8')},'header_online':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xa')},'start_chat_button':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xb')},'offline_chat_button':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xc')},'header_offline':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xd')},'download_transcript':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x11')},'closingMessageButton':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xc')},'skipMessageButton':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x12')},'conditionAgreement':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xd58f('0x7')](_0xd58f('0x13'),_0xd58f('0x14')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd58f('0x15')],'defaultValue':function(){return JSON[_0xd58f('0x16')]({'items':[{'type':_0xd58f('0x17'),'variable':null,'config':{'placeholder':_0xd58f('0x18'),'type':_0xd58f('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xd58f('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd58f('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd58f('0x1a')](_0xd58f('0x1b'))?JSON['parse'](this[_0xd58f('0x1a')](_0xd58f('0x1b'))):{};},'set':function(_0x58549a){return this[_0xd58f('0x1c')]('onlineForm',JSON['stringify'](_0x58549a));}},'offlineForm':{'type':Sequelize[_0xd58f('0x15')],'defaultValue':function(){return JSON[_0xd58f('0x16')]({'items':[{'type':_0xd58f('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd58f('0x2'),'type':_0xd58f('0x2')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd58f('0x1d')},'props':{'title':_0xd58f('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd58f('0x1e'))?JSON[_0xd58f('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x204487){return this[_0xd58f('0x1c')](_0xd58f('0x1e'),JSON[_0xd58f('0x16')](_0x204487));}},'token':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd58f('0x1')]},'forwardOffline':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd58f('0x1')]},'waitingTitle':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x20')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x21')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x12')},'sendUnmanaged':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd58f('0x15')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd58f('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd58f('0x22');}},'notificationSound':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x23')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x24')},'verticalAlignment':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x25')},'messagesAlignment':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x26')},'defaultTitle':{'type':Sequelize[_0xd58f('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x27')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd58f('0x5')],'comment':_0xd58f('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x16a164){if(!_0x16a164)this[_0xd58f('0x1c')](_0xd58f('0x29'),null);this[_0xd58f('0x1c')](_0xd58f('0x2a'),_0x16a164);}},'vidaooEscalation':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd58f('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd58f('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xd58f('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xd58f('0x15')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd58f('0x15')]}}; \ No newline at end of file +var _0xcd00=['input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify'];(function(_0x1aaf85,_0x2eebaa){var _0x59ad1c=function(_0x338363){while(--_0x338363){_0x1aaf85['push'](_0x1aaf85['shift']());}};_0x59ad1c(++_0x2eebaa);}(_0xcd00,0x12f));var _0x0cd0=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xcd00[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0x0cd0('0x0'));var rs=require(_0x0cd0('0x1'));module[_0x0cd0('0x2')]={'name':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x5')},'customerAlias':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0cd0('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0cd0('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0cd0('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0cd0('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0cd0('0xa')](_0x0cd0('0xb'),_0x0cd0('0xc')),'defaultValue':_0x0cd0('0xb')},'header_online':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xd')},'start_chat_button':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xe')},'offline_chat_button':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x10')},'download_transcript':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0cd0('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0cd0('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x15')},'placeholderMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x16')},'closingMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x17')},'closingMessageButton':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xf')},'skipMessageButton':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x0cd0('0xa')](_0x0cd0('0x18'),_0x0cd0('0x19')),'defaultValue':_0x0cd0('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0cd0('0x12')],'defaultValue':function(){return JSON[_0x0cd0('0x1a')]({'items':[{'type':_0x0cd0('0x1b'),'variable':null,'config':{'placeholder':_0x0cd0('0x1c'),'type':_0x0cd0('0x1d'),'required':!![]},'props':{'title':_0x0cd0('0x1c'),'helpText':''}},{'type':_0x0cd0('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0cd0('0x4'),'type':_0x0cd0('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0cd0('0x1e')]('onlineForm')?JSON['parse'](this[_0x0cd0('0x1e')](_0x0cd0('0x1f'))):{};},'set':function(_0x5664cd){return this[_0x0cd0('0x20')](_0x0cd0('0x1f'),JSON['stringify'](_0x5664cd));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x0cd0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0cd0('0x4'),'type':'email'},'variable':null},{'type':_0x0cd0('0x21'),'config':{'placeholder':_0x0cd0('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x0cd0('0x1e')](_0x0cd0('0x23'))?JSON[_0x0cd0('0x24')](this[_0x0cd0('0x1e')](_0x0cd0('0x23'))):{};},'set':function(_0x57f648){return this[_0x0cd0('0x20')](_0x0cd0('0x23'),JSON['stringify'](_0x57f648));}},'token':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':function(){return rs[_0x0cd0('0x25')]();}},'autoclose':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0cd0('0x3')]},'waitingTitle':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x26')},'waitingMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x29')},'skipUnmanaged':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x2a')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0cd0('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0cd0('0x2b');}},'notificationSound':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x2e')},'messagesAlignment':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x0cd0('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0cd0('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'defaultValue':_0x0cd0('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x30')},'systemAvatar':{'type':Sequelize[_0x0cd0('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0cd0('0x8')],'comment':_0x0cd0('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![],'comment':_0x0cd0('0x32'),'set':function(_0x46cdd3){if(!_0x46cdd3)this[_0x0cd0('0x20')](_0x0cd0('0x33'),null);this['setDataValue'](_0x0cd0('0x34'),_0x46cdd3);}},'vidaooEscalation':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0cd0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'defaultValue':_0x0cd0('0x35')},'vidaooNote':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':function(){return _0x0cd0('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x0cd0('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0cd0('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 1ec55b4..cdf0e74 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 _0x43fd=['filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','Interval','resolve','timezone','ifTime','notify','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','CmContact','Contacts','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','Applications','priority','account','list','List','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','firstName','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','utf8','origin','http://localhost:9000','testWebsiteWithWildcard','x-real-ip','connection','remoteAddress','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','util','fs-extra','lodash','html-to-text','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','user-agent','getResult','customerIp','x-forwarded-for','split','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','address','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','describe','addDisposition','ChatWebsiteId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file'];(function(_0xabbe3d,_0x4c9120){var _0x32d93d=function(_0x2b3722){while(--_0x2b3722){_0xabbe3d['push'](_0xabbe3d['shift']());}};_0x32d93d(++_0x4c9120);}(_0x43fd,0x1ec));var _0xd43f=function(_0x3d2a7b,_0x20b709){_0x3d2a7b=_0x3d2a7b-0x0;var _0xf8adb=_0x43fd[_0x3d2a7b];return _0xf8adb;};'use strict';var Mustache=require('mustache');var util=require(_0xd43f('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd43f('0x1'));var _=require(_0xd43f('0x2'));var querystring=require('querystring');var htmlToText=require(_0xd43f('0x3'));var Redis=require('ioredis');var jayson=require(_0xd43f('0x4'));var qs=require(_0xd43f('0x5'));var logger=require(_0xd43f('0x6'))(_0xd43f('0x7'));var config=require('../../config/environment');var APIBadRequestError=require(_0xd43f('0x8'))[_0xd43f('0x9')];var APINotFoundError=require(_0xd43f('0x8'))[_0xd43f('0xa')];var APIOutOfIntervalError=require('../../errors/api')[_0xd43f('0xb')];var APIHandleError=require(_0xd43f('0x8'))['handleError'];var APIConflictError=require(_0xd43f('0x8'))[_0xd43f('0xc')];var wildcardUtils=require(_0xd43f('0xd'));var URL=require(_0xd43f('0xe'))[_0xd43f('0xf')];var db=require('../../mysqldb')['db'];config[_0xd43f('0x10')]=_[_0xd43f('0x11')](config[_0xd43f('0x10')],{'host':_0xd43f('0x12'),'port':0x18eb});var socket=require(_0xd43f('0x13'))(new Redis(config[_0xd43f('0x10')]));require(_0xd43f('0x14'))[_0xd43f('0x15')](socket);var client=jayson[_0xd43f('0x16')][_0xd43f('0x17')]({'port':0x232c});var client9002=jayson[_0xd43f('0x16')]['http']({'port':0x232a});var client9003=jayson[_0xd43f('0x16')][_0xd43f('0x17')]({'port':0x232b});var client9001=jayson[_0xd43f('0x16')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4c576e,_0x4a2b49,_0x1c729a,_0x3ca2d4){return new Promise(function(_0x4f8862,_0x3c0953){var _0x3647df=_0x3ca2d4||client;return _0x3647df['request'](_0x4c576e,_0x1c729a)['then'](function(_0x4fd639){logger['info'](_0xd43f('0x18'),_0x4a2b49,_0xd43f('0x19'));logger['debug'](_0xd43f('0x1a'),_0x4a2b49,_0xd43f('0x19'),JSON[_0xd43f('0x1b')](_0x4fd639));if(_0x4fd639[_0xd43f('0x1c')]){if(_0x4fd639['error'][_0xd43f('0x1d')]===0x1f4){logger[_0xd43f('0x1c')](_0xd43f('0x18'),_0x4a2b49,_0x4fd639['error']['message']);return _0x3c0953(_0x4fd639['error'][_0xd43f('0x1e')]);}logger[_0xd43f('0x1c')](_0xd43f('0x18'),_0x4a2b49,_0x4fd639[_0xd43f('0x1c')][_0xd43f('0x1e')]);return _0x4f8862(_0x4fd639[_0xd43f('0x1c')][_0xd43f('0x1e')]);}else{logger['info'](_0xd43f('0x18'),_0x4a2b49,'request\x20sent');_0x4f8862(_0x4fd639[_0xd43f('0x1f')]['message']);}})['catch'](function(_0x310195){logger[_0xd43f('0x1c')](_0xd43f('0x18'),_0x4a2b49,_0x310195);_0x3c0953(_0x310195);});});}function respondWithStatusCode(_0x2a38f6,_0x35acd0){_0x35acd0=_0x35acd0||0xcc;return function(_0xcaf5ae){if(_0xcaf5ae){return _0x2a38f6[_0xd43f('0x20')](_0x35acd0);}return _0x2a38f6[_0xd43f('0x21')](_0x35acd0)[_0xd43f('0x22')]();};}function respondWithResult(_0x49d043,_0x26a6c9){_0x26a6c9=_0x26a6c9||0xc8;return function(_0x2d5915){if(_0x2d5915){return _0x49d043[_0xd43f('0x21')](_0x26a6c9)[_0xd43f('0x23')](_0x2d5915);}};}function respondWithFilteredResult(_0x209ccd,_0x4a8b4d){return function(_0x161540){if(_0x161540){var _0x7b6761=typeof _0x4a8b4d[_0xd43f('0x24')]===_0xd43f('0x25')&&typeof _0x4a8b4d[_0xd43f('0x26')]===_0xd43f('0x25');var _0x481b4d=_0x161540[_0xd43f('0x27')];var _0x1f476d=_0x7b6761?0x0:_0x4a8b4d['offset'];var _0x308439=_0x7b6761?_0x161540['count']:_0x4a8b4d['offset']+_0x4a8b4d[_0xd43f('0x26')];var _0x18472c;if(_0x308439>=_0x481b4d){_0x308439=_0x481b4d;_0x18472c=0xc8;}else{_0x18472c=0xce;}_0x209ccd[_0xd43f('0x21')](_0x18472c);return _0x209ccd['set'](_0xd43f('0x28'),_0x1f476d+'-'+_0x308439+'/'+_0x481b4d)[_0xd43f('0x23')](_0x161540);}return null;};}function saveUpdates(_0x5bba3d){return function(_0x557a96){if(_0x557a96){return _0x557a96[_0xd43f('0x29')](_0x5bba3d)[_0xd43f('0x2a')](function(_0xb9e156){return _0xb9e156;});}return null;};}function removeEntity(_0x202a05){return function(_0x49ff92){if(_0x49ff92){return _0x49ff92[_0xd43f('0x2b')]()[_0xd43f('0x2a')](function(){var _0x134b27=_0x49ff92[_0xd43f('0x2c')]({'plain':!![]});var _0x5a5717=_0xd43f('0x2d');return db[_0xd43f('0x2e')]['destroy']({'where':{'type':_0x5a5717,'resourceId':_0x134b27['id']}})[_0xd43f('0x2a')](function(){return _0x49ff92;});})['then'](function(){_0x202a05[_0xd43f('0x21')](0xcc)[_0xd43f('0x22')]();});}};}function handleEntityNotFound(_0x2d91fc){return function(_0x51b765){if(!_0x51b765){_0x2d91fc[_0xd43f('0x20')](0x194);}return _0x51b765;};}function handleError(_0x2ccd50,_0x523718){_0x523718=_0x523718||0x1f4;return function(_0x3b785f){logger[_0xd43f('0x1c')](_0x3b785f[_0xd43f('0x2f')]);if(_0x3b785f['name']){delete _0x3b785f[_0xd43f('0x30')];}_0x2ccd50[_0xd43f('0x21')](_0x523718)[_0xd43f('0x31')](_0x3b785f);};}function createInteractionObject(_0x20682d,_0x176aac,_0x5bce4d,_0x3386d9){var _0x4b1c73=require(_0xd43f('0x32'));var _0x2d8bfe=new _0x4b1c73();var _0x416030=_0x2d8bfe['setUA'](_0x5bce4d[_0xd43f('0x33')])[_0xd43f('0x34')]();var _0x4b1dfa=_0x176aac[_0xd43f('0x35')];if(_0x5bce4d['cf-connecting-ip']){_0x4b1dfa=_0x5bce4d['cf-connecting-ip'];}else if(_0x5bce4d[_0xd43f('0x36')]){_0x4b1dfa=_['first'](_0x5bce4d['x-forwarded-for'][_0xd43f('0x37')](','));}return{'ContactId':_0x3386d9['id'],'ChatWebsiteId':_0x20682d,'from':(_0x3386d9['firstName']||'')+'\x20'+(_0x3386d9['lastName']||''),'customerIp':_0x4b1dfa,'customerPort':_0x5bce4d[_0xd43f('0x38')]?_0x5bce4d[_0xd43f('0x38')]:null,'referer':_0x176aac[_0xd43f('0x39')],'browserName':_0x416030[_0xd43f('0x3a')][_0xd43f('0x30')]&&_0x416030['browser'][_0xd43f('0x3b')]?util[_0xd43f('0x3c')](_0xd43f('0x3d'),_0x416030[_0xd43f('0x3a')][_0xd43f('0x30')],_0x416030[_0xd43f('0x3a')][_0xd43f('0x3b')]):_0xd43f('0x3e'),'browserVersion':_0x416030[_0xd43f('0x3a')][_0xd43f('0x3b')]||_0xd43f('0x3e'),'osName':util['format'](_0xd43f('0x3d'),_0x416030['os'][_0xd43f('0x30')],_0x416030['os']['version']),'osVersion':_0x416030['os']['version'],'deviceModel':_0x416030[_0xd43f('0x3f')][_0xd43f('0x40')]&&_0x416030[_0xd43f('0x3f')]['vendor']?util[_0xd43f('0x3c')](_0xd43f('0x41'),_0x416030[_0xd43f('0x3f')][_0xd43f('0x40')],_0x416030['device']['vendor'],_0x416030[_0xd43f('0x3f')][_0xd43f('0x42')]):null,'deviceVendor':_0x416030[_0xd43f('0x3f')]['vendor'],'deviceType':_0x416030[_0xd43f('0x3f')][_0xd43f('0x42')],'formData':JSON[_0xd43f('0x1b')](_0x176aac)};}exports[_0xd43f('0x43')]=function(_0x33a644,_0xc2a5a6){var _0x15071b={'include':[{'model':db[_0xd43f('0x44')],'as':_0xd43f('0x45')}]},_0xadbc59={},_0x4f5587={'count':0x0,'rows':[]};var _0x386dfa=_[_0xd43f('0x46')](db[_0xd43f('0x47')][_0xd43f('0x48')],function(_0x30fc76){return{'name':_0x30fc76[_0xd43f('0x49')],'type':_0x30fc76[_0xd43f('0x42')][_0xd43f('0x4a')]};});_0xadbc59[_0xd43f('0x40')]=_['map'](_0x386dfa,_0xd43f('0x30'));_0xadbc59[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x33a644[_0xd43f('0x4b')]);_0xadbc59[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0xadbc59['model'],_0xadbc59[_0xd43f('0x4b')]);_0x15071b['attributes']=_[_0xd43f('0x4e')](_0xadbc59['model'],qs[_0xd43f('0x4f')](_0x33a644[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x15071b[_0xd43f('0x50')]=_0x15071b[_0xd43f('0x50')][_0xd43f('0x51')]?_0x15071b[_0xd43f('0x50')]:_0xadbc59[_0xd43f('0x40')];if(!_0x33a644[_0xd43f('0x4b')]['hasOwnProperty'](_0xd43f('0x52'))){_0x15071b[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x33a644[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x15071b[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x33a644[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x15071b[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x33a644['query']['sort']);_0x15071b[_0xd43f('0x55')]=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x33a644['query'],_0xadbc59['filters']),_0x386dfa);if(_0x33a644[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x15071b[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x15071b[_0xd43f('0x55')],{'$or':_['map'](_0x386dfa,function(_0x344797){if(_0x344797[_0xd43f('0x42')]!==_0xd43f('0x59')){var _0xafb5d4={};_0xafb5d4[_0x344797[_0xd43f('0x30')]]={'$like':'%'+_0x33a644[_0xd43f('0x4b')]['filter']+'%'};return _0xafb5d4;}})});}_0x15071b=_[_0xd43f('0x58')]({},_0x15071b,_0x33a644[_0xd43f('0x5a')]);var _0x39e85a={'where':_0x15071b[_0xd43f('0x55')]};return db[_0xd43f('0x47')][_0xd43f('0x27')](_0x39e85a)[_0xd43f('0x2a')](function(_0xece809){_0x4f5587['count']=_0xece809;if(_0x33a644[_0xd43f('0x4b')][_0xd43f('0x5b')]){_0x15071b[_0xd43f('0x5c')]=[{'all':!![]}];}return db['ChatWebsite'][_0xd43f('0x5d')](_0x15071b);})[_0xd43f('0x2a')](function(_0xb719d){_0x4f5587[_0xd43f('0x5e')]=_0xb719d;return _0x4f5587;})[_0xd43f('0x2a')](respondWithFilteredResult(_0xc2a5a6,_0x15071b))[_0xd43f('0x5f')](handleError(_0xc2a5a6,null));};exports[_0xd43f('0x60')]=function(_0x32590d,_0x1c1fd5){var _0x418af0={'raw':![],'where':{'id':_0x32590d[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0x44')],'as':'mandatoryDispositionPause'}]},_0x4ca871={};_0x4ca871[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0x47')]['rawAttributes']);_0x4ca871[_0xd43f('0x4b')]=_['keys'](_0x32590d[_0xd43f('0x4b')]);_0x4ca871['filters']=_[_0xd43f('0x4e')](_0x4ca871['model'],_0x4ca871[_0xd43f('0x4b')]);_0x418af0[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x4ca871['model'],qs['fields'](_0x32590d[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x418af0['attributes']=_0x418af0[_0xd43f('0x50')][_0xd43f('0x51')]?_0x418af0['attributes']:_0x4ca871[_0xd43f('0x40')];if(_0x32590d[_0xd43f('0x4b')][_0xd43f('0x5b')]){_0x418af0[_0xd43f('0x5c')]=[{'all':!![]}];}_0x418af0=_[_0xd43f('0x58')]({},_0x418af0,_0x32590d[_0xd43f('0x5a')]);return db[_0xd43f('0x47')]['find'](_0x418af0)[_0xd43f('0x2a')](handleEntityNotFound(_0x1c1fd5,null))[_0xd43f('0x2a')](respondWithResult(_0x1c1fd5,null))[_0xd43f('0x5f')](handleError(_0x1c1fd5,null));};exports[_0xd43f('0x62')]=function(_0x6ee0ef,_0x18cdd9){var _0x2ff8ad=null;_0x6ee0ef['body'][_0xd43f('0x63')][_0xd43f('0x37')](',')['forEach'](_0x1898b6=>{if(_0x1898b6[_0xd43f('0x64')]()!==''&&!wildcardUtils[_0xd43f('0x65')](_0x1898b6[_0xd43f('0x64')]())){_0x2ff8ad=new APIBadRequestError('\x22'+_0x1898b6[_0xd43f('0x64')]()+_0xd43f('0x66'));}});if(_0x2ff8ad){return handleError(_0x18cdd9,null)(_0x2ff8ad);}return db[_0xd43f('0x47')]['create'](_0x6ee0ef[_0xd43f('0x67')],{})[_0xd43f('0x2a')](function(_0x5b70c8){var _0x451d18=_0x6ee0ef['user'][_0xd43f('0x2c')]({'plain':!![]});if(!_0x451d18)throw new Error(_0xd43f('0x68'));if(_0x451d18[_0xd43f('0x69')]===_0xd43f('0x6a')){var _0x32090e=_0x5b70c8[_0xd43f('0x2c')]({'plain':!![]});var _0x1c59c4=_0xd43f('0x2d');return db[_0xd43f('0x6b')][_0xd43f('0x6c')]({'where':{'name':_0x1c59c4,'userProfileId':_0x451d18[_0xd43f('0x6d')]},'raw':!![]})[_0xd43f('0x2a')](function(_0x332271){if(_0x332271&&_0x332271[_0xd43f('0x6e')]===0x0){return db['UserProfileResource'][_0xd43f('0x62')]({'name':_0x32090e[_0xd43f('0x30')],'resourceId':_0x32090e['id'],'type':_0x332271[_0xd43f('0x30')],'sectionId':_0x332271['id']},{})['then'](function(){return _0x5b70c8;});}else{return _0x5b70c8;}})[_0xd43f('0x5f')](function(_0x5211ee){logger[_0xd43f('0x1c')](_0xd43f('0x6f'),_0x5211ee);throw _0x5211ee;});}return _0x5b70c8;})[_0xd43f('0x2a')](respondWithResult(_0x18cdd9,0xc9))[_0xd43f('0x5f')](handleError(_0x18cdd9,null));};exports['update']=function(_0x1e2258,_0x1a53ce){var _0x15cfb3=null;_0x1e2258['body'][_0xd43f('0x63')]['split'](',')[_0xd43f('0x70')](_0x41d560=>{if(_0x41d560[_0xd43f('0x64')]()!==''&&!wildcardUtils[_0xd43f('0x65')](_0x41d560['trim']())){_0x15cfb3=new APIBadRequestError('\x22'+_0x41d560[_0xd43f('0x64')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x15cfb3){return handleError(_0x1a53ce,null)(_0x15cfb3);}if(_0x1e2258[_0xd43f('0x67')]['id']){delete _0x1e2258['body']['id'];}return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x1e2258['params']['id']},'include':[{'model':db[_0xd43f('0x44')],'as':_0xd43f('0x45')}]})[_0xd43f('0x2a')](handleEntityNotFound(_0x1a53ce,null))[_0xd43f('0x2a')](saveUpdates(_0x1e2258['body'],null))[_0xd43f('0x2a')](respondWithResult(_0x1a53ce,null))[_0xd43f('0x5f')](handleError(_0x1a53ce,null));};exports[_0xd43f('0x2b')]=function(_0x147c6b,_0x5f30f7){return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x147c6b['params']['id']}})['then'](handleEntityNotFound(_0x5f30f7,null))[_0xd43f('0x2a')](removeEntity(_0x5f30f7,null))[_0xd43f('0x5f')](handleError(_0x5f30f7,null));};exports[_0xd43f('0x71')]=function(_0x5346af,_0x209cdc){return db['ChatWebsite'][_0xd43f('0x71')]()[_0xd43f('0x2a')](respondWithResult(_0x209cdc,null))['catch'](handleError(_0x209cdc,null));};exports[_0xd43f('0x72')]=function(_0x45c946,_0x2d6b29){if(_0x45c946[_0xd43f('0x67')]['id']){delete _0x45c946[_0xd43f('0x67')]['id'];}return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x45c946[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x2d6b29,null))[_0xd43f('0x2a')](function(_0x3703b5){if(_0x3703b5){_0x45c946['body'][_0xd43f('0x73')]=_0x3703b5['id'];return db['Disposition'][_0xd43f('0x62')](_0x45c946[_0xd43f('0x67')]);}})[_0xd43f('0x2a')](respondWithResult(_0x2d6b29,null))[_0xd43f('0x5f')](handleError(_0x2d6b29,null));};exports['getDispositions']=function(_0x533892,_0x1ddba2){var _0x104006={'raw':![],'where':{}};var _0x5f0190={};var _0x43d8e7={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x533892[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x1ddba2,null))[_0xd43f('0x2a')](function(_0x49a6b4){if(_0x49a6b4){_0x5f0190[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0x75')][_0xd43f('0x48')]);_0x5f0190[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x533892[_0xd43f('0x4b')]);_0x5f0190[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x5f0190['model'],_0x5f0190['query']);_0x104006[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x5f0190['model'],qs[_0xd43f('0x4f')](_0x533892[_0xd43f('0x4b')]['fields']));_0x104006[_0xd43f('0x50')]=_0x104006[_0xd43f('0x50')][_0xd43f('0x51')]?_0x104006['attributes']:_0x5f0190['model'];if(!_0x533892[_0xd43f('0x4b')][_0xd43f('0x76')](_0xd43f('0x52'))){_0x104006[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x533892[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x104006[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x533892[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x104006[_0xd43f('0x53')]=qs['sort'](_0x533892[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x104006[_0xd43f('0x55')]=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x533892[_0xd43f('0x4b')],_0x5f0190[_0xd43f('0x4d')]));_0x104006['where'][_0xd43f('0x73')]=_0x49a6b4['id'];if(_0x533892[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x104006[_0xd43f('0x55')]=_['merge'](_0x104006[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x104006[_0xd43f('0x50')],function(_0x13dd7f){var _0x1f5d58={};_0x1f5d58[_0x13dd7f]={'$like':'%'+_0x533892[_0xd43f('0x4b')][_0xd43f('0x57')]+'%'};return _0x1f5d58;})});}_0x104006=_[_0xd43f('0x58')]({},_0x104006,_0x533892[_0xd43f('0x5a')]);return db['Disposition'][_0xd43f('0x27')]({'where':_0x104006['where']})[_0xd43f('0x2a')](function(_0x4762fb){_0x43d8e7[_0xd43f('0x27')]=_0x4762fb;if(_0x533892[_0xd43f('0x4b')]['includeAll']){_0x104006[_0xd43f('0x5c')]=[{'all':!![]}];}return db[_0xd43f('0x75')]['findAll'](_0x104006);})[_0xd43f('0x2a')](function(_0x11fbbb){_0x43d8e7[_0xd43f('0x5e')]=_0x11fbbb;return _0x43d8e7;});}})[_0xd43f('0x2a')](respondWithFilteredResult(_0x1ddba2,_0x104006))[_0xd43f('0x5f')](handleError(_0x1ddba2,null));};exports[_0xd43f('0x77')]=function(_0x4f3d39,_0x5c6897){return db['ChatWebsite'][_0xd43f('0x6c')]({'where':{'id':_0x4f3d39['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x5c6897,null))['then'](function(_0x24fc08){if(_0x24fc08){return _0x24fc08[_0xd43f('0x77')](_0x4f3d39[_0xd43f('0x4b')][_0xd43f('0x78')]);}})[_0xd43f('0x2a')](respondWithStatusCode(_0x5c6897,null))[_0xd43f('0x5f')](handleError(_0x5c6897,null));};exports[_0xd43f('0x79')]=function(_0x464c42,_0x17115b){if(_0x464c42[_0xd43f('0x67')]['id']){delete _0x464c42[_0xd43f('0x67')]['id'];}return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x464c42['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x17115b,null))[_0xd43f('0x2a')](function(_0x80efa4){if(_0x80efa4){_0x464c42[_0xd43f('0x67')][_0xd43f('0x73')]=_0x80efa4['id'];return db['CannedAnswer'][_0xd43f('0x62')](_0x464c42[_0xd43f('0x67')]);}})[_0xd43f('0x2a')](respondWithResult(_0x17115b,null))[_0xd43f('0x5f')](handleError(_0x17115b,null));};exports[_0xd43f('0x7a')]=function(_0x41836b,_0x19c24c){var _0x4efd7d={'raw':![],'where':{}};var _0x4cddee={};var _0xb18bde={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x41836b[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x19c24c,null))['then'](function(_0x53a610){if(_0x53a610){_0x4cddee['model']=_[_0xd43f('0x4c')](db[_0xd43f('0x7b')][_0xd43f('0x48')]);_0x4cddee[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x41836b[_0xd43f('0x4b')]);_0x4cddee['filters']=_[_0xd43f('0x4e')](_0x4cddee[_0xd43f('0x40')],_0x4cddee['query']);_0x4efd7d['attributes']=_['intersection'](_0x4cddee[_0xd43f('0x40')],qs[_0xd43f('0x4f')](_0x41836b['query'][_0xd43f('0x4f')]));_0x4efd7d['attributes']=_0x4efd7d[_0xd43f('0x50')]['length']?_0x4efd7d[_0xd43f('0x50')]:_0x4cddee[_0xd43f('0x40')];if(!_0x41836b['query'][_0xd43f('0x76')](_0xd43f('0x52'))){_0x4efd7d[_0xd43f('0x26')]=qs['limit'](_0x41836b['query'][_0xd43f('0x26')]);_0x4efd7d['offset']=qs[_0xd43f('0x24')](_0x41836b[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x4efd7d[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x41836b['query'][_0xd43f('0x54')]);_0x4efd7d['where']=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x41836b['query'],_0x4cddee[_0xd43f('0x4d')]));_0x4efd7d[_0xd43f('0x55')]['ChatWebsiteId']=_0x53a610['id'];if(_0x41836b[_0xd43f('0x4b')]['filter']){_0x4efd7d[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x4efd7d['where'],{'$or':_[_0xd43f('0x46')](_0x4efd7d[_0xd43f('0x50')],function(_0x578e4f){var _0x40538e={};_0x40538e[_0x578e4f]={'$like':'%'+_0x41836b[_0xd43f('0x4b')][_0xd43f('0x57')]+'%'};return _0x40538e;})});}_0x4efd7d=_[_0xd43f('0x58')]({},_0x4efd7d,_0x41836b[_0xd43f('0x5a')]);return db[_0xd43f('0x7b')]['count']({'where':_0x4efd7d[_0xd43f('0x55')]})[_0xd43f('0x2a')](function(_0x3598c2){_0xb18bde[_0xd43f('0x27')]=_0x3598c2;if(_0x41836b['query'][_0xd43f('0x5b')]){_0x4efd7d[_0xd43f('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd43f('0x5d')](_0x4efd7d);})[_0xd43f('0x2a')](function(_0x870d3f){_0xb18bde[_0xd43f('0x5e')]=_0x870d3f;return _0xb18bde;});}})[_0xd43f('0x2a')](respondWithFilteredResult(_0x19c24c,_0x4efd7d))[_0xd43f('0x5f')](handleError(_0x19c24c,null));};exports['removeAnswers']=function(_0x3757e1,_0x570b79){return db['ChatWebsite'][_0xd43f('0x6c')]({'where':{'id':_0x3757e1[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x570b79,null))[_0xd43f('0x2a')](function(_0x5b017d){if(_0x5b017d){return _0x5b017d[_0xd43f('0x7c')](_0x3757e1[_0xd43f('0x4b')][_0xd43f('0x78')]);}})[_0xd43f('0x2a')](respondWithStatusCode(_0x570b79,null))['catch'](handleError(_0x570b79,null));};exports[_0xd43f('0x7d')]=function(_0x21635f,_0x5b2330){_0x21635f['body'][_0xd43f('0x7e')]=_0x21635f[_0xd43f('0x7f')][_0xd43f('0x80')];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x21635f[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x5b2330,null))[_0xd43f('0x2a')](saveUpdates(_0x21635f[_0xd43f('0x67')],null))[_0xd43f('0x2a')](respondWithResult(_0x5b2330,null))[_0xd43f('0x5f')](handleError(_0x5b2330,null));};exports['addAvatar']=function(_0xf41755,_0x458d12){_0xf41755[_0xd43f('0x67')][_0xd43f('0x81')]=_0xf41755['file']['filename'];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0xf41755['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x458d12,null))[_0xd43f('0x2a')](saveUpdates(_0xf41755[_0xd43f('0x67')],null))[_0xd43f('0x2a')](respondWithResult(_0x458d12,null))['catch'](handleError(_0x458d12,null));};exports[_0xd43f('0x82')]=function(_0x37fded,_0x39b6ce){_0x37fded['body'][_0xd43f('0x83')]=_0x37fded[_0xd43f('0x7f')][_0xd43f('0x80')];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x37fded[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x39b6ce,null))['then'](saveUpdates(_0x37fded['body'],null))[_0xd43f('0x2a')](respondWithResult(_0x39b6ce,null))[_0xd43f('0x5f')](handleError(_0x39b6ce,null));};exports[_0xd43f('0x84')]=function(_0x482c1f,_0x203821){_0x482c1f[_0xd43f('0x67')][_0xd43f('0x85')]=_0x482c1f[_0xd43f('0x7f')][_0xd43f('0x80')];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x482c1f['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x203821,null))[_0xd43f('0x2a')](saveUpdates(_0x482c1f[_0xd43f('0x67')],null))[_0xd43f('0x2a')](respondWithResult(_0x203821,null))[_0xd43f('0x5f')](handleError(_0x203821,null));};exports['getLogo']=function(_0x211b48,_0x4fe18a){var _0x5d39a9=path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x88'));var _0x284afe={'where':{'id':_0x211b48[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x7e')],'raw':!![]};var _0x35bf20=![];return require(_0xd43f('0x89'))[_0xd43f('0x8a')]()[_0xd43f('0x2a')](function(_0x5c69b6){if(_0x5c69b6){_0x35bf20=_0x5c69b6[_0xd43f('0x8b')];}})[_0xd43f('0x2a')](function(){return db[_0xd43f('0x47')][_0xd43f('0x6c')](_0x284afe);})[_0xd43f('0x2a')](handleEntityNotFound(_0x4fe18a,null))['then'](function(_0x4158e5){if(_0x4158e5){if(!_[_0xd43f('0x8c')](_0x4158e5[_0xd43f('0x7e')])){if(fs[_0xd43f('0x8d')](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x8e'),_0x4158e5[_0xd43f('0x7e')]))&&_0x35bf20){_0x5d39a9=path[_0xd43f('0x86')](config['root'],'server/files/images/logos/',_0x4158e5[_0xd43f('0x7e')]);}}return _0x4fe18a['download'](_0x5d39a9);}})[_0xd43f('0x5f')](handleError(_0x4fe18a,null));};exports[_0xd43f('0x8f')]=function(_0x475df1,_0x46632f){var _0x48499c=path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x90'));var _0x50f233={'where':{'id':_0x475df1[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x81')],'raw':!![]};return db[_0xd43f('0x47')][_0xd43f('0x6c')](_0x50f233)['then'](handleEntityNotFound(_0x46632f,null))[_0xd43f('0x2a')](function(_0x2d2035){if(_0x2d2035){if(!_[_0xd43f('0x8c')](_0x2d2035['agentAvatar'])){if(fs[_0xd43f('0x8d')](path['join'](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x2d2035[_0xd43f('0x81')]))){_0x48499c=path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x2d2035[_0xd43f('0x81')]);}}return _0x46632f[_0xd43f('0x92')](_0x48499c);}})[_0xd43f('0x5f')](handleError(_0x46632f,null));};exports[_0xd43f('0x93')]=function(_0x57e736,_0x103e10){var _0x4833c6=path[_0xd43f('0x86')](config[_0xd43f('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x58dd26={'where':{'id':_0x57e736[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x83'),_0xd43f('0x94')],'raw':!![]};return db[_0xd43f('0x47')]['find'](_0x58dd26)[_0xd43f('0x2a')](handleEntityNotFound(_0x103e10,null))[_0xd43f('0x2a')](function(_0x55bc9e){if(_0x55bc9e){if(!_[_0xd43f('0x8c')](_0x55bc9e[_0xd43f('0x83')])){if(fs[_0xd43f('0x8d')](path[_0xd43f('0x86')](config['root'],_0xd43f('0x91'),_0x55bc9e[_0xd43f('0x83')]))&&_0x55bc9e[_0xd43f('0x94')]){_0x4833c6=path[_0xd43f('0x86')](config['root'],_0xd43f('0x91'),_0x55bc9e['customerAvatar']);}}return _0x103e10[_0xd43f('0x92')](_0x4833c6);}})[_0xd43f('0x5f')](handleError(_0x103e10,null));};exports[_0xd43f('0x95')]=function(_0x42c198,_0x3df7d4){var _0x2af269=path[_0xd43f('0x86')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x4315d6={'where':{'id':_0x42c198[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x85')],'raw':!![]};return db[_0xd43f('0x47')][_0xd43f('0x6c')](_0x4315d6)[_0xd43f('0x2a')](handleEntityNotFound(_0x3df7d4,null))[_0xd43f('0x2a')](function(_0x1f4052){if(_0x1f4052){if(!_[_0xd43f('0x8c')](_0x1f4052[_0xd43f('0x85')])){if(fs[_0xd43f('0x8d')](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x1f4052[_0xd43f('0x85')]))){_0x2af269=path['join'](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x1f4052[_0xd43f('0x85')]);}}return _0x3df7d4[_0xd43f('0x92')](_0x2af269);}})['catch'](handleError(_0x3df7d4,null));};function checkWebsiteInterval(_0x19c481){var _0x294d4f=_0x19c481[_0xd43f('0x96')];if(!_0x294d4f){return Promise[_0xd43f('0x97')](_0x19c481);}var _0x438520=_0x19c481[_0xd43f('0x98')]||undefined;return _0x294d4f[_0xd43f('0x99')](_0x438520)[_0xd43f('0x2a')](function(_0x24dc61){if(!_0x24dc61){throw new APIOutOfIntervalError();}return _0x19c481;});}exports[_0xd43f('0x9a')]=function(_0x46223a,_0x139970){var _0x41c0ea={'body':_0x46223a[_0xd43f('0x67')],'channel':'chat'};var _0x517f8f=[];var _0x510e67=[];var _0xaf3a26={};var _0x4895a7=![];if(_0x46223a['body']['id']){delete _0x46223a[_0xd43f('0x67')]['id'];}if(_[_0xd43f('0x8c')](_0x46223a[_0xd43f('0x67')][_0xd43f('0x9b')])){throw new APIBadRequestError(_0xd43f('0x9c'));}if(_['isNil'](_0x46223a[_0xd43f('0x67')][_0xd43f('0x9d')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xd43f('0x9e')](_0x46223a['body'][_0xd43f('0x67')])){throw new APIBadRequestError(_0xd43f('0x9f'));}var _0x1d173b=_0x46223a[_0xd43f('0x67')]['customerIp']&&_0x46223a[_0xd43f('0x67')][_0xd43f('0x39')];return db['CmContact'][_0xd43f('0x71')]()[_0xd43f('0x2a')](function(_0x651f61){if(!_0x651f61){throw new Error('No\x20available\x20attributes');}_0x517f8f=Object[_0xd43f('0x4c')](_0x651f61)['filter'](function(_0x50ea34){return![_0xd43f('0xa0'),_0xd43f('0xa1')][_0xd43f('0xa2')](_0x50ea34);});_0x510e67=Object[_0xd43f('0x4c')](_0x651f61)[_0xd43f('0x57')](function(_0x36e2e4){return![_0xd43f('0xa0'),_0xd43f('0xa1'),_0xd43f('0xa3'),_0xd43f('0xa4')]['includes'](_0x36e2e4);});if(!_[_0xd43f('0xa2')](_0x510e67,_0x46223a['body'][_0xd43f('0x9d')])){throw new APIBadRequestError(_0xd43f('0xa5')+_0x510e67['join'](',\x20'));}_0xaf3a26[_0x46223a['body'][_0xd43f('0x9d')]]=_0x46223a[_0xd43f('0x67')][_0xd43f('0x9b')];})['then'](function(){return db['ChatWebsite'][_0xd43f('0x6c')]({'where':{'id':_0x46223a[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0xa6')],'as':'List','include':[{'model':db[_0xd43f('0xa7')],'as':_0xd43f('0xa8'),'where':_0xaf3a26,'limit':0x1,'order':[[_0xd43f('0xa1'),'DESC']]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db[_0xd43f('0x96')],'as':_0xd43f('0x96'),'include':[{'model':db[_0xd43f('0x96')],'as':_0xd43f('0xa9'),'attributes':['id',_0xd43f('0xaa')],'raw':!![]}]}]});})[_0xd43f('0x2a')](function(_0x8824d5){if(!_0x8824d5){throw new APINotFoundError(util[_0xd43f('0x3c')](_0xd43f('0xab'),_0x46223a[_0xd43f('0x61')]['id']));}if(_0x1d173b){return checkWebsiteInterval(_0x8824d5);}return _0x8824d5;})[_0xd43f('0x2a')](function(_0x23cc45){_0x41c0ea['account']=_0x23cc45;_0x41c0ea[_0xd43f('0xac')]=_[_0xd43f('0xad')](_0x23cc45[_0xd43f('0xae')],[_0xd43f('0xaf')],['asc']);if(_0x41c0ea[_0xd43f('0xb0')]['Applications']){delete _0x41c0ea['account'][_0xd43f('0xae')];}_0x41c0ea[_0xd43f('0xb1')]=_0x23cc45[_0xd43f('0xb2')]||{'id':_0x23cc45[_0xd43f('0xa4')]};if(_0x41c0ea['list']&&_0x41c0ea[_0xd43f('0xb1')][_0xd43f('0xa8')][_0xd43f('0x51')]){return _0x41c0ea[_0xd43f('0xb1')][_0xd43f('0xa8')][0x0];}var _0x32a2d6=_['defaults'](_0x46223a[_0xd43f('0x67')],{'firstName':_0x46223a['body']['from'],'ListId':_0x23cc45['ListId']});_0x32a2d6[_0x46223a[_0xd43f('0x67')][_0xd43f('0x9d')]]=_0x46223a[_0xd43f('0x67')]['from'];return db[_0xd43f('0xa7')][_0xd43f('0x62')](_0x32a2d6,{'fields':_0x517f8f,'raw':!![]});})[_0xd43f('0x2a')](function(_0x21669b){_0x41c0ea[_0xd43f('0xb3')]=_0x21669b;var _0x2770cf=createInteractionObject(_0x46223a[_0xd43f('0x61')]['id'],_0x46223a[_0xd43f('0x67')],_0x46223a[_0xd43f('0xb4')],_0x21669b);var _0xab1320={'ChatWebsiteId':_0x46223a[_0xd43f('0x61')]['id']};if(_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')]){_0xab1320['threadId']=_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')];_0xab1320[_0xd43f('0xb6')]=![];return db[_0xd43f('0xb7')][_0xd43f('0x6c')]({'where':_0xab1320})[_0xd43f('0x2a')](function(_0x37b08b){var _0x479d80=_0x46223a[_0xd43f('0x67')]['customerIp']&&_0x46223a[_0xd43f('0x67')][_0xd43f('0x39')];if(_0x37b08b){_0x4895a7=!![];return _0x37b08b;}else if(!_0x479d80&&_0x37b08b&&_0x37b08b[_0xd43f('0xb6')]){throw new APIConflictError(_0xd43f('0xb8'));}_0x2770cf['threadId']=_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')];_0x2770cf[_0xd43f('0xb9')]=_0x46223a[_0xd43f('0x67')][_0xd43f('0xb9')];return db[_0xd43f('0xb7')][_0xd43f('0x62')](_0x2770cf);});}_0xab1320[_0xd43f('0xba')]=_0x21669b['id'];if(_0x46223a[_0xd43f('0x67')]['interaction']&&_0x46223a['body']['interaction']['id']){_0xab1320['id']=_0x46223a[_0xd43f('0x67')][_0xd43f('0xbb')]['id'];return db[_0xd43f('0xb7')][_0xd43f('0x6c')]({'where':_0xab1320})[_0xd43f('0x2a')](function(_0x3095bd){var _0x5654f6=_0x46223a[_0xd43f('0x67')][_0xd43f('0x35')]&&_0x46223a[_0xd43f('0x67')]['referer'];if(!_0x5654f6&&_0x3095bd&&_0x3095bd[_0xd43f('0xb6')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x3095bd){_0x4895a7=!![];return _0x3095bd;}else{return db[_0xd43f('0xb7')][_0xd43f('0x62')](_0x2770cf);}});}return db[_0xd43f('0xb7')][_0xd43f('0x62')](_0x2770cf);})['then'](function(_0x486e3e){if(!_0x4895a7){return _0x486e3e;}var _0x5a9af4={'from':(_0x41c0ea[_0xd43f('0xb3')][_0xd43f('0xbc')]||'')+'\x20'+(_0x41c0ea[_0xd43f('0xb3')][_0xd43f('0xbd')]||'')};if(_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')]&&_0x46223a[_0xd43f('0x67')][_0xd43f('0xbe')]&&_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')]!=_0x46223a[_0xd43f('0x67')][_0xd43f('0xbe')]){_0x5a9af4[_0xd43f('0xb5')]=_0x46223a[_0xd43f('0x67')]['messageId'];}return _0x486e3e[_0xd43f('0x29')](_0x5a9af4);})[_0xd43f('0x2a')](function(_0x1aa11f){_0x41c0ea[_0xd43f('0xbb')]=_0x1aa11f[_0xd43f('0x2c')]({'plain':!![]});_0x41c0ea['interaction'][_0xd43f('0xbf')]=!_0x4895a7;if(_0x41c0ea['interaction']['created']){if(_0x41c0ea[_0xd43f('0xb0')][_0xd43f('0xc0')]){_0x41c0ea[_0xd43f('0xac')]['push']({'id':0x0,'priority':_0x41c0ea[_0xd43f('0xac')][_0xd43f('0x51')]+0x1,'app':_0xd43f('0xc1'),'appdata':_0xd43f('0xc2'),'interval':_0xd43f('0xc3')});}}return db[_0xd43f('0xc4')]['create']({'body':_0x46223a[_0xd43f('0x67')][_0xd43f('0x67')],'ChatWebsiteId':_0x46223a[_0xd43f('0x61')]['id'],'ChatInteractionId':_0x1aa11f['id'],'direction':'in','ContactId':_0x41c0ea[_0xd43f('0xb3')]['id'],'AttachmentId':_0x46223a[_0xd43f('0x67')]['AttachmentId']});})[_0xd43f('0x2a')](function(_0x43442d){_0x41c0ea[_0xd43f('0x1e')]=_0x43442d;if(!_0x41c0ea[_0xd43f('0xbb')][_0xd43f('0xc5')]){return;}return db[_0xd43f('0xc6')]['find']({'attributes':['id',_0xd43f('0x30')],'where':{'id':_0x41c0ea['interaction'][_0xd43f('0xc5')]}});})[_0xd43f('0x2a')](function(_0x19a129){if(_0x19a129){_0x41c0ea[_0xd43f('0xac')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd43f('0xc7'),'appdata':_0x19a129[_0xd43f('0x30')]+','+(_0x41c0ea[_0xd43f('0xb0')][_0xd43f('0xc8')]||0xa),'interval':_0xd43f('0xc3')});_0x41c0ea['forcedOwnership']=!![];}if(!_0x41c0ea[_0xd43f('0xbb')][_0xd43f('0xc9')]){return;}return db[_0xd43f('0xca')]['find']({'attributes':['id','name'],'where':{'id':_0x41c0ea['interaction'][_0xd43f('0xc9')]}});})[_0xd43f('0x2a')](function(_0x5e5e44){if(_0x5e5e44){_0x41c0ea['applications'][_0xd43f('0xcb')]({'id':0x0,'priority':0x1,'app':_0xd43f('0xcc'),'appdata':_0x5e5e44[_0xd43f('0x30')]+','+(_0x41c0ea[_0xd43f('0xb0')][_0xd43f('0xcd')]||0x12c),'interval':_0xd43f('0xc3')});}return respondWithRpcPromise(_0xd43f('0xce'),_0xd43f('0xcf'),_0x41c0ea);})['then'](function(_0xf451bf){respondWithRpcPromise(_0xd43f('0xd0'),_0xd43f('0xd0'),{'event':_0xd43f('0x9a'),'message':_0xf451bf},client9002);return _0xf451bf;})['then'](respondWithResult(_0x139970,null))[_0xd43f('0x5f')](APIHandleError(_0x139970));};exports[_0xd43f('0xd1')]=function(_0x3d9159,_0x3eaa9e){var _0x593918,_0x587c0a,_0x4179cf;var _0x10b29c=[];var _0x132f85={};var _0x5f3cc1=_0x3d9159['files']||[];var _0x31ad17=[];var _0x36398a;return db['CmContact'][_0xd43f('0x71')]()[_0xd43f('0x2a')](function(_0x50c513){if(!_0x50c513){throw new db[(_0xd43f('0xd2'))][(_0xd43f('0xd3'))](_0xd43f('0xd4'));}_0x10b29c=_[_0xd43f('0xd5')](_[_0xd43f('0x4c')](_0x50c513),['createdAt',_0xd43f('0xa1'),_0xd43f('0xa3'),_0xd43f('0xa4')]);if(_0x3d9159[_0xd43f('0x67')]['id']){delete _0x3d9159['body']['id'];}if(_[_0xd43f('0x8c')](_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')])){throw _0x3eaa9e['status'](0x1f4)[_0xd43f('0x31')](new db[(_0xd43f('0xd2'))][(_0xd43f('0xd3'))](_0xd43f('0xd6')));}if(_[_0xd43f('0x8c')](_0x3d9159['body'][_0xd43f('0x67')])||_0x3d9159['body']['body']===''){throw _0x3eaa9e[_0xd43f('0x21')](0x1f4)['send'](new db[(_0xd43f('0xd2'))]['ValidationError'](_0xd43f('0xd7')));}if(_[_0xd43f('0x8c')](_0x3d9159[_0xd43f('0x67')][_0xd43f('0xd8')])){throw _0x3eaa9e[_0xd43f('0x21')](0x1f4)[_0xd43f('0x31')](new db[(_0xd43f('0xd2'))][(_0xd43f('0xd3'))](_0xd43f('0xd9')+_0x10b29c));}if(!_[_0xd43f('0xa2')](_0x10b29c,_0x3d9159[_0xd43f('0x67')][_0xd43f('0xd8')])){throw _0x3eaa9e['status'](0x1f4)['send'](new db[(_0xd43f('0xd2'))]['ValidationError'](_0xd43f('0xda')+_0x10b29c));}_0x132f85[_0x3d9159[_0xd43f('0x67')][_0xd43f('0xd8')]]=_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')];})[_0xd43f('0x2a')](function(){return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x3d9159[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0xa6')],'as':_0xd43f('0xb2')},{'model':db['MailAccount'],'as':_0xd43f('0xdb')}]});})[_0xd43f('0x2a')](handleEntityNotFound(_0x3eaa9e,null))[_0xd43f('0x2a')](function(_0xd9b10a){if(_0xd9b10a&&_0xd9b10a[_0xd43f('0xb2')]){_0x587c0a=_0xd9b10a;var _0x162d9b=_[_0xd43f('0x11')](_0x3d9159[_0xd43f('0x67')],{'firstName':_0x3d9159['body'][_0xd43f('0x9b')],'phone':_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')],'ListId':_0xd9b10a[_0xd43f('0xa4')]});_0x162d9b[_0x3d9159['body'][_0xd43f('0xd8')]]=_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')];return db[_0xd43f('0xa7')][_0xd43f('0xdc')]({'where':_0x132f85,'defaults':_0x162d9b});}})[_0xd43f('0xdd')](function(_0x4e9337){if(_0x4e9337){_0x4179cf=_0x4e9337;var _0x57321f=fs['readFileSync'](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0xde')),'utf8');var _0x372b2d=ejs[_0xd43f('0xdf')](_0x57321f,{'body':_[_0xd43f('0xe0')](_0x3d9159[_0xd43f('0x67')][_0xd43f('0x67')]),'bodyTitle':_0x587c0a[_0xd43f('0xe1')]});return db[_0xd43f('0xe2')]['create']({'body':_0x372b2d,'plainBody':htmlToText[_0xd43f('0xe3')](_0x372b2d),'ContactId':_0x4e9337['id'],'ChatWebsiteId':_0x587c0a['id']});}})[_0xd43f('0x2a')](function(_0x50c93a){_0x36398a=_0x50c93a;if(_0x5f3cc1['length']){var _0x30c306=_0x5f3cc1[_0xd43f('0x46')](function(_0xfe034e){return{'name':_0xfe034e[_0xd43f('0xe4')],'basename':_0xfe034e['filename'],'type':_0xfe034e[_0xd43f('0xe5')],'ChatOfflineMessageId':_0x50c93a['id']};});_0x31ad17=_0x30c306[_0xd43f('0x46')](_0xcad05c=>{var _0x1e4efe={'filename':_0xcad05c[_0xd43f('0x30')],'path':path[_0xd43f('0x86')](config[_0xd43f('0x87')],'server','files',_0xd43f('0xe6'),_0xd43f('0xe7'),_0xcad05c[_0xd43f('0xe8')])};return _0x1e4efe;});if(!_0x587c0a[_0xd43f('0xe9')]){return db[_0xd43f('0xea')][_0xd43f('0xeb')](function(_0x3df481){return db[_0xd43f('0xec')][_0xd43f('0xed')](_0x30c306,{'transaction':_0x3df481});});}}})['then'](function(){if(_0x36398a){_0x593918=_0x36398a;return db[_0xd43f('0xdb')][_0xd43f('0x74')]({'where':{'service':!![]},'include':[{'model':db[_0xd43f('0xee')],'as':_0xd43f('0xef'),'raw':!![],'include':[{'model':db[_0xd43f('0xf0')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xd43f('0x2a')](function(_0x44be88){if(_0x44be88&&_0x44be88[_0xd43f('0xef')]&&_0x587c0a['forwardOffline']&&_0x587c0a[_0xd43f('0xf1')]){var _0x36839a=_0x44be88[_0xd43f('0xf2')]();return respondWithRpcPromise(_0xd43f('0xf3'),_0xd43f('0xf4'),{'account':_0x36839a,'message':{'from':util[_0xd43f('0x3c')](_0xd43f('0xf5'),_0x44be88[_0xd43f('0x30')],_0x44be88[_0xd43f('0xf6')]||_0x44be88[_0xd43f('0xef')][_0xd43f('0x6a')]),'to':_0x587c0a['forwardOfflineAddress'],'subject':_0x587c0a['offlineMessageSubject'],'html':_0x593918[_0xd43f('0x67')],'attachments':_0x31ad17}},client9003)['then'](function(){return _0x593918;})[_0xd43f('0x5f')](function(_0x4b13d0){logger[_0xd43f('0x1c')](_0x4b13d0);});}})[_0xd43f('0x2a')](function(){if(_0x587c0a&&_0x587c0a[_0xd43f('0xe9')]&&_0x587c0a['MailAccountId']){var _0x28bb01=[];if(_0x5f3cc1['length']){_0x28bb01=_0x5f3cc1[_0xd43f('0x46')](function(_0x2bd853){return{'name':_0x2bd853[_0xd43f('0xe4')],'basename':_0x2bd853[_0xd43f('0x80')],'type':_0x2bd853[_0xd43f('0xe5')],'ChatOfflineMessageId':_0x36398a['id']};});}var _0x18fea1;if(!_['isNil'](_0x587c0a[_0xd43f('0xf7')])){var _0x25890a=_['map'](_0x3d9159[_0xd43f('0x67')],function(_0x48f676){return _0x48f676;});var _0xce79fa=_[_0xd43f('0xf8')](_0x25890a)[0x0];var _0x193ee8=_[_0xd43f('0xf9')](_0xce79fa,function(_0x701631){return _0x701631;});_0x18fea1=_0x193ee8[0x1][_0x587c0a['subjectOffline']];}var _0x2f10ee={'from':_0x4179cf[_0xd43f('0xf6')],'firstName':_0x4179cf[_0xd43f('0xbc')],'lastName':_0x4179cf[_0xd43f('0xbd')],'mapKey':_0xd43f('0xf6'),'message':{'from':_0x4179cf[_0xd43f('0xf6')],'to':_0x587c0a['MailAccount'][_0xd43f('0xf6')],'cc':'','subject':_['isNil'](_0x18fea1)?_0x587c0a[_0xd43f('0xfa')]:_0x18fea1,'messageId':'','sentAt':new Date(),'attach':_0x28bb01[_0xd43f('0x51')],'attachments':_0x28bb01,'originChannel':_0xd43f('0xfb'),'ChatWebsiteId':_0x587c0a['id'],'ChatOfflineMessageId':_0x593918['id'],'originTo':_0x587c0a[_0xd43f('0xdb')]['email']},'body':_0x593918[_0xd43f('0x67')]};var _0x17b5c8={'account':{'id':_0x587c0a[_0xd43f('0xfc')]},'body':_0x2f10ee,'log':_0xd43f('0xfd')};return respondWithRpcPromise(_0xd43f('0xfd'),_0xd43f('0xfe'),_0x17b5c8,client9001)[_0xd43f('0x2a')](function(){return _0x593918;})['catch'](function(_0x46c524){logger[_0xd43f('0x1c')](_0x46c524);});}return;})['then'](function(){if(_0x593918){return _0x593918;}})[_0xd43f('0x2a')](respondWithResult(_0x3eaa9e,null))[_0xd43f('0x5f')](function(){for(var _0x1facca of _0x5f3cc1){var _0x1a01b7=path[_0xd43f('0x86')](config['root'],_0xd43f('0xff'),'files',_0xd43f('0xe6'),_0xd43f('0xe7'),_0x1facca[_0xd43f('0x80')]);fs_extra[_0xd43f('0x100')](_0x1a01b7)[_0xd43f('0x5f')](function(_0x45433f){logger[_0xd43f('0x1c')](_0xd43f('0x101'),_0x1a01b7,_0x45433f);});}});};exports[_0xd43f('0x102')]=function(_0x21753f,_0x5aa425){return db[_0xd43f('0xb7')][_0xd43f('0x6c')]({'where':{'id':_0x21753f[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x5aa425,null))[_0xd43f('0x2a')](function(_0x2c1cf4){if(_0x2c1cf4){return _0x2c1cf4[_0xd43f('0x102')](_0x21753f['body'][_0xd43f('0x78')],_[_0xd43f('0x103')](_0x21753f[_0xd43f('0x67')],[_0xd43f('0x78'),'id'])||{});}})['then'](respondWithResult(_0x5aa425,null))[_0xd43f('0x5f')](handleError(_0x5aa425,null));};exports[_0xd43f('0x104')]=function(_0x1845fe,_0x52267d){var _0x55e661={'raw':![],'where':{}};var _0x5264b4={};var _0x58badb={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x1845fe[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x52267d,null))[_0xd43f('0x2a')](function(_0x56c0b6){if(_0x56c0b6){_0x5264b4[_0xd43f('0x40')]=_['keys'](db[_0xd43f('0xb7')][_0xd43f('0x48')]);_0x5264b4[_0xd43f('0x4b')]=_['keys'](_0x1845fe[_0xd43f('0x4b')]);_0x5264b4[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x5264b4[_0xd43f('0x40')],_0x5264b4['query']);_0x55e661[_0xd43f('0x50')]=_['intersection'](_0x5264b4[_0xd43f('0x40')],qs['fields'](_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x55e661[_0xd43f('0x50')]=_0x55e661[_0xd43f('0x50')][_0xd43f('0x51')]?_0x55e661[_0xd43f('0x50')]:_0x5264b4[_0xd43f('0x40')];if(!_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x76')]('nolimit')){_0x55e661[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x1845fe['query'][_0xd43f('0x26')]);_0x55e661[_0xd43f('0x24')]=qs['offset'](_0x1845fe[_0xd43f('0x4b')]['offset']);}_0x55e661[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x55e661[_0xd43f('0x55')]=qs['filters'](_[_0xd43f('0x56')](_0x1845fe['query'],_0x5264b4[_0xd43f('0x4d')]));_0x55e661['where']['ChatWebsiteId']=_0x56c0b6['id'];if(_0x1845fe[_0xd43f('0x4b')]['filter']){_0x55e661[_0xd43f('0x55')]=_['merge'](_0x55e661[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x55e661[_0xd43f('0x50')],function(_0x3bf49f){var _0x1bffe2={};_0x1bffe2[_0x3bf49f]={'$like':'%'+_0x1845fe[_0xd43f('0x4b')]['filter']+'%'};return _0x1bffe2;})});}_0x55e661=_['merge']({},_0x55e661,_0x1845fe[_0xd43f('0x5a')]);return db[_0xd43f('0xb7')][_0xd43f('0x27')]({'where':_0x55e661[_0xd43f('0x55')]})[_0xd43f('0x2a')](function(_0x4ba9cf){_0x58badb[_0xd43f('0x27')]=_0x4ba9cf;if(_0x1845fe[_0xd43f('0x4b')]['includeAll']){_0x55e661[_0xd43f('0x5c')]=[{'model':db[_0xd43f('0xa7')],'as':_0xd43f('0x105'),'required':![]},{'model':db['User'],'as':_0xd43f('0x106'),'attributes':[_0xd43f('0x30'),_0xd43f('0x107'),'internal'],'required':![]},{'model':db[_0xd43f('0x108')],'as':_0xd43f('0x109'),'attributes':['id',_0xd43f('0x30'),_0xd43f('0x10a')],'where':_0x1845fe[_0xd43f('0x4b')]['tag']?{'id':_0x1845fe['query'][_0xd43f('0x10b')]}:undefined,'required':_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x10b')]?!![]:![]}];}return db[_0xd43f('0xb7')][_0xd43f('0x5d')](_0x55e661);})['then'](function(_0x452dc0){_0x58badb[_0xd43f('0x5e')]=_0x452dc0;return _0x58badb;});}})['then'](respondWithFilteredResult(_0x52267d,_0x55e661))[_0xd43f('0x5f')](handleError(_0x52267d,null));};exports[_0xd43f('0x10c')]=function(_0x4050c7,_0x314e00){var _0x5ef2c2=0x0;var _0x3a3a25=0x0;var _0x4f989d=![];var _0x478a6a;var _0x2f6cf1;return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x4050c7[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0x96')],'as':_0xd43f('0x96'),'include':[{'model':db[_0xd43f('0x96')],'as':_0xd43f('0xa9'),'attributes':['id','interval']}]}]})[_0xd43f('0x2a')](handleEntityNotFound(_0x314e00,null))[_0xd43f('0x2a')](function(_0x4acc9f){if(_0x4acc9f){_0x478a6a=_0x4acc9f;return _0x4acc9f[_0xd43f('0x10d')]({'raw':!![]});}})[_0xd43f('0x2a')](function(_0x3156ad){if(_0x478a6a){if(_0x3156ad){_0x2f6cf1=_0x3156ad;}}return require(_0xd43f('0x89'))[_0xd43f('0x8a')]();})['then'](function(_0x559ad7){if(_0x559ad7){_0x3a3a25=_0x559ad7[_0xd43f('0x10e')];_0x4f989d=_0x559ad7[_0xd43f('0x8b')];}})[_0xd43f('0x2a')](function(){return db[_0xd43f('0xb7')]['count']({'where':{'closed':![]}});})['then'](function(_0x1c06fd){_0x5ef2c2=_0x1c06fd;if(_0x3a3a25&&_0x1c06fd>_0x3a3a25){return db['License'][_0xd43f('0x74')]({'where':{'id':0x1}})[_0xd43f('0x2a')](function(_0xbd8d56){if(_0xbd8d56){_0xbd8d56['increment'](_0xd43f('0x10f'));}});}})['then'](function(){var _0x4874fd=_0x478a6a[_0xd43f('0x96')];var _0x2fbf1e=_0x478a6a[_0xd43f('0x98')]||undefined;return _0x4874fd?_0x4874fd['ifTime'](_0x2fbf1e):!![];})['then'](function(_0x3be95e){var _0x4087d9=fs[_0xd43f('0x110')](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x111')),_0xd43f('0x112'));var _0x3b9b2c='3.10.1';var _0x38fe0c=![];var _0x2005e1,_0x1c63d5;if(_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x39')]){_0x2005e1=new URL(_0x4050c7['headers'][_0xd43f('0x39')])[_0xd43f('0x113')];}else if(_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x113')]){_0x2005e1=new URL(_0x4050c7['headers'][_0xd43f('0x113')])[_0xd43f('0x113')];}else{_0x2005e1=_0xd43f('0x114');}_0x1c63d5=typeof _0x478a6a[_0xd43f('0x63')][_0xd43f('0x37')](',')['find'](function(_0x53c9d3){return wildcardUtils[_0xd43f('0x115')](_0x53c9d3,_0x2005e1);})!=='undefined';var _0x5a0613={'chatVersion':_0x3b9b2c,'chatWebsiteAddressOrigin':_0x1c63d5?_0x2005e1:_0x478a6a[_0xd43f('0x63')],'remote':_0x478a6a['remote'],'query':querystring[_0xd43f('0x1b')](_[_0xd43f('0x58')](_0x478a6a[_0xd43f('0x2c')]({'plain':!![]}),{'customerIp':_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x36')]||_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x116')]||_0x4050c7[_0xd43f('0x117')][_0xd43f('0x118')]||_0x4050c7['ip'],'referer':_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x39')],'openedInteractions':_0x5ef2c2,'maxInteractions':_0x3a3a25,'virtual':_0x4f989d['virtual'],'online':_0x3be95e,'custom':_0x4f989d,'address':_0x1c63d5?_0x2005e1:null}))[_0xd43f('0x119')](/'/g,'\x5c\x27')};_0x314e00[_0xd43f('0x31')](ejs[_0xd43f('0xdf')](Mustache[_0xd43f('0xdf')](_0x4087d9,_0x5a0613),{'proactiveActions':_0x2f6cf1,'alignment':_0x478a6a['alignment'],'verticalAlignment':_0x478a6a['verticalAlignment'],'div_color':_0x478a6a[_0xd43f('0x10a')],'labelText':_0x478a6a[_0xd43f('0x11a')],'text_color':_0x478a6a[_0xd43f('0x11b')],'text_button_color':_0x478a6a[_0xd43f('0x11c')],'button_color':_0x478a6a[_0xd43f('0x11d')],'background_color':_0x478a6a[_0xd43f('0x11e')],'hideWhenOffline':_0x478a6a['hideWhenOffline'],'intervalId':_0x478a6a[_0xd43f('0x11f')],'isDevelopment':_0x38fe0c,'chatVersion':_0x3b9b2c}));})[_0xd43f('0x5f')](handleError(_0x314e00,null));};exports['addApplications']=function(_0x4b3e23,_0x415d1e){var _0x2f7253=_0x4b3e23[_0xd43f('0x61')]['id'];var _0x515e60=_0x4b3e23[_0xd43f('0x67')];var _0x3132a2=0xc8;var _0x4b054=null;return db[_0xd43f('0xea')][_0xd43f('0xeb')]({'isolationLevel':db['sequelize'][_0xd43f('0x120')][_0xd43f('0x121')][_0xd43f('0x122')]},function(_0x5c69d9){return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x2f7253},'transaction':_0x5c69d9})[_0xd43f('0x2a')](function(_0x10f796){if(_0x10f796){return db[_0xd43f('0x123')][_0xd43f('0x2b')]({'where':{'ChatWebsiteId':_0x2f7253},'transaction':_0x5c69d9})[_0xd43f('0x2a')](function(){var _0x35aaab=_['map'](_0x515e60,function(_0x160d74){_0x160d74[_0xd43f('0x73')]=_0x2f7253;return _0x160d74;});return db[_0xd43f('0x123')][_0xd43f('0xed')](_0x35aaab,{'transaction':_0x5c69d9});});}else{_0x3132a2=0x194;_0x4b054=[];}});})['then'](function(){if(_0x3132a2!==0x194){return db['ChatApplication'][_0xd43f('0x124')]({'where':{'ChatWebsiteId':_0x2f7253},'order':_0xd43f('0xaf')})[_0xd43f('0x2a')](function(_0xf87efb){_0x4b054=_0xf87efb;});}})[_0xd43f('0x5f')](function(_0x4fbe4c){_0x3132a2=0x1f4;logger[_0xd43f('0x1c')](_0x4fbe4c[_0xd43f('0x2f')]);if(_0x4fbe4c[_0xd43f('0x30')]){delete _0x4fbe4c[_0xd43f('0x30')];}_0x4b054=_0x4fbe4c;})[_0xd43f('0x125')](function(){if(_0x4b054===null){_0x415d1e[_0xd43f('0x20')](_0x3132a2);}else{if(_0x3132a2===0x1f4){_0x415d1e[_0xd43f('0x21')](_0x3132a2)[_0xd43f('0x31')](_0x4b054);}else{_0x415d1e[_0xd43f('0x21')](_0x3132a2)[_0xd43f('0x23')](_0x4b054);}}});};exports[_0xd43f('0x126')]=function(_0x10c59e,_0x221f68){var _0x22ab14={};var _0x169909={};var _0x47a5eb;var _0x2eae07;return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x10c59e['params']['id']}})['then'](handleEntityNotFound(_0x221f68,null))['then'](function(_0x47d583){if(_0x47d583){_0x47a5eb=_0x47d583;_0x169909[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0x123')]['rawAttributes']);_0x169909[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x10c59e[_0xd43f('0x4b')]);_0x169909['filters']=_[_0xd43f('0x4e')](_0x169909[_0xd43f('0x40')],_0x169909[_0xd43f('0x4b')]);_0x22ab14[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x169909[_0xd43f('0x40')],qs[_0xd43f('0x4f')](_0x10c59e[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x22ab14[_0xd43f('0x50')]=_0x22ab14[_0xd43f('0x50')][_0xd43f('0x51')]?_0x22ab14[_0xd43f('0x50')]:_0x169909['model'];_0x22ab14[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x10c59e[_0xd43f('0x4b')]['sort']);_0x22ab14[_0xd43f('0x55')]=qs['filters'](_[_0xd43f('0x56')](_0x10c59e[_0xd43f('0x4b')],_0x169909[_0xd43f('0x4d')]));if(_0x10c59e[_0xd43f('0x4b')]['filter']){_0x22ab14['where']=_[_0xd43f('0x58')](_0x22ab14[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x22ab14[_0xd43f('0x50')],function(_0x303647){var _0xd186b9={};_0xd186b9[_0x303647]={'$like':'%'+_0x10c59e[_0xd43f('0x4b')]['filter']+'%'};return _0xd186b9;})});}_0x22ab14=_[_0xd43f('0x58')]({},_0x22ab14,_0x10c59e[_0xd43f('0x5a')]);return _0x47a5eb['getApplications'](_0x22ab14);}})[_0xd43f('0x2a')](function(_0x1fe152){if(_0x1fe152){_0x2eae07=_0x1fe152[_0xd43f('0x51')];if(!_0x10c59e[_0xd43f('0x4b')]['hasOwnProperty'](_0xd43f('0x52'))){_0x22ab14[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x10c59e[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x22ab14[_0xd43f('0x24')]=qs['offset'](_0x10c59e[_0xd43f('0x4b')][_0xd43f('0x24')]);}return _0x47a5eb[_0xd43f('0x126')](_0x22ab14);}})[_0xd43f('0x2a')](function(_0x4e417f){if(_0x4e417f){return _0x4e417f?{'count':_0x2eae07,'rows':_0x4e417f}:null;}})['then'](respondWithResult(_0x221f68,null))[_0xd43f('0x5f')](handleError(_0x221f68,null));};exports[_0xd43f('0x127')]=function(_0x495ae9,_0x1308e6){return db[_0xd43f('0x128')][_0xd43f('0x6c')]({'where':{'id':_0x495ae9[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x1308e6,null))[_0xd43f('0x2a')](function(_0x80dc00){if(_0x80dc00){return _0x80dc00[_0xd43f('0x127')](_0x495ae9['body']['ids'],_[_0xd43f('0x103')](_0x495ae9[_0xd43f('0x67')],[_0xd43f('0x78'),'id'])||{});}})[_0xd43f('0x2a')](respondWithResult(_0x1308e6,null))['catch'](handleError(_0x1308e6,null));};exports[_0xd43f('0x10d')]=function(_0x40d89c,_0x49daff){var _0x2ddf5b={};var _0x33821b={};var _0x1e66f2;var _0x43a1fa;return db[_0xd43f('0x47')]['findOne']({'where':{'id':_0x40d89c[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x49daff,null))[_0xd43f('0x2a')](function(_0xb93358){if(_0xb93358){_0x1e66f2=_0xb93358;_0x33821b[_0xd43f('0x40')]=_['keys'](db[_0xd43f('0x129')][_0xd43f('0x48')]);_0x33821b[_0xd43f('0x4b')]=_['keys'](_0x40d89c[_0xd43f('0x4b')]);_0x33821b[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x33821b[_0xd43f('0x40')],_0x33821b[_0xd43f('0x4b')]);_0x2ddf5b['attributes']=_[_0xd43f('0x4e')](_0x33821b['model'],qs[_0xd43f('0x4f')](_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x2ddf5b['attributes']=_0x2ddf5b[_0xd43f('0x50')][_0xd43f('0x51')]?_0x2ddf5b[_0xd43f('0x50')]:_0x33821b['model'];_0x2ddf5b[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x40d89c[_0xd43f('0x4b')]['sort']);_0x2ddf5b['where']=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x40d89c['query'],_0x33821b[_0xd43f('0x4d')]));if(_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x2ddf5b[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x2ddf5b[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x2ddf5b['attributes'],function(_0x39fc95){var _0x4bb226={};_0x4bb226[_0x39fc95]={'$like':'%'+_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x57')]+'%'};return _0x4bb226;})});}_0x2ddf5b=_[_0xd43f('0x58')]({},_0x2ddf5b,_0x40d89c[_0xd43f('0x5a')]);return _0x1e66f2['getProactiveActions'](_0x2ddf5b);}})[_0xd43f('0x2a')](function(_0x1eb282){if(_0x1eb282){_0x43a1fa=_0x1eb282[_0xd43f('0x51')];if(!_0x40d89c['query']['hasOwnProperty']('nolimit')){_0x2ddf5b[_0xd43f('0x26')]=qs['limit'](_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x2ddf5b[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x24')]);}return _0x1e66f2['getProactiveActions'](_0x2ddf5b);}})[_0xd43f('0x2a')](function(_0x54437b){if(_0x54437b){return _0x54437b?{'count':_0x43a1fa,'rows':_0x54437b}:null;}})[_0xd43f('0x2a')](respondWithResult(_0x49daff,null))[_0xd43f('0x5f')](handleError(_0x49daff,null));};exports[_0xd43f('0x12a')]=function(_0x501a44,_0x49dd44){var _0x564386=_0x501a44[_0xd43f('0x4b')]['online']===_0xd43f('0x12b')?_0xd43f('0x12c'):'onlineForm';return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'attributes':['id',_0x564386],'where':{'id':_0x501a44['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x49dd44,null))[_0xd43f('0x2a')](function(_0x3e5ad9){if(_0x3e5ad9){var _0x179a4c=_0x3e5ad9[_0x564386];var _0x5e56fa=_0x179a4c&&_0x179a4c[_0xd43f('0x12d')]?_0x179a4c[_0xd43f('0x12d')]:[];_0x49dd44[_0xd43f('0x31')]({'fromKey':_[_0xd43f('0x8c')](_0x179a4c['fromKey'])?undefined:_0x179a4c[_0xd43f('0x12e')],'count':_0x5e56fa[_0xd43f('0x51')],'rows':_0x5e56fa});}})[_0xd43f('0x5f')](handleError(_0x49dd44,null));};exports[_0xd43f('0x12f')]=function(_0x1ec235,_0x2d8bc9){var _0x414a60={'raw':![],'where':{}};var _0x4ebdcd={};var _0x41bbe9={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x1ec235[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x2d8bc9,null))['then'](function(_0x2d3afd){if(_0x2d3afd){_0x4ebdcd[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0xe2')][_0xd43f('0x48')]);_0x4ebdcd[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x1ec235[_0xd43f('0x4b')]);_0x4ebdcd[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x4ebdcd['model'],_0x4ebdcd[_0xd43f('0x4b')]);_0x414a60[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x4ebdcd[_0xd43f('0x40')],qs['fields'](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x414a60[_0xd43f('0x50')]=_0x414a60[_0xd43f('0x50')][_0xd43f('0x51')]?_0x414a60[_0xd43f('0x50')]:_0x4ebdcd[_0xd43f('0x40')];if(!_0x1ec235['query'][_0xd43f('0x76')](_0xd43f('0x52'))){_0x414a60[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x414a60['offset']=qs[_0xd43f('0x24')](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x414a60[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x414a60[_0xd43f('0x55')]=qs['filters'](_[_0xd43f('0x56')](_0x1ec235['query'],_0x4ebdcd[_0xd43f('0x4d')]));_0x414a60[_0xd43f('0x55')][_0xd43f('0x73')]=_0x2d3afd['id'];if(_0x1ec235['query'][_0xd43f('0x57')]){_0x414a60['where']=_[_0xd43f('0x58')](_0x414a60[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x414a60[_0xd43f('0x50')],function(_0x22efb1){var _0x34e038={};_0x34e038[_0x22efb1]={'$like':'%'+_0x1ec235[_0xd43f('0x4b')]['filter']+'%'};return _0x34e038;})});}_0x414a60=_['merge']({},_0x414a60,_0x1ec235[_0xd43f('0x5a')]);return db['ChatOfflineMessage']['count']({'where':_0x414a60['where']})[_0xd43f('0x2a')](function(_0x189375){_0x41bbe9[_0xd43f('0x27')]=_0x189375;if(_0x1ec235['query'][_0xd43f('0x5b')]){_0x414a60[_0xd43f('0x5c')]=[{'all':!![]}];}else{_0x414a60[_0xd43f('0x5c')]=[{'model':db[_0xd43f('0xa7')],'as':_0xd43f('0x105'),'required':![]},{'model':db[_0xd43f('0xec')],'as':'Attachments','required':![]}];}return db[_0xd43f('0xe2')]['findAll'](_0x414a60);})[_0xd43f('0x2a')](function(_0x4a1c14){_0x41bbe9[_0xd43f('0x5e')]=_0x4a1c14;return _0x41bbe9;});}})[_0xd43f('0x2a')](respondWithFilteredResult(_0x2d8bc9,_0x414a60))[_0xd43f('0x5f')](handleError(_0x2d8bc9,null));};exports[_0xd43f('0x130')]=function(_0xcb9333,_0x5a08c4){return db[_0xd43f('0x47')]['find']({'where':{'id':_0xcb9333[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x5a08c4,null))[_0xd43f('0x2a')](function(_0x276899){if(_0x276899){return _0x276899[_0xd43f('0x130')](_0xcb9333[_0xd43f('0x67')]['ids'],_[_0xd43f('0x103')](_0xcb9333['body'],[_0xd43f('0x78'),'id'])||{})[_0xd43f('0xdd')](function(_0x29a4ea){for(var _0x5ae805=0x0;_0x5ae805<_0xcb9333[_0xd43f('0x67')][_0xd43f('0x78')][_0xd43f('0x51')];_0x5ae805+=0x1){socket[_0xd43f('0x131')](_0xd43f('0x132'),{'UserId':Number(_0xcb9333[_0xd43f('0x67')]['ids'][_0x5ae805]),'ChatWebsiteId':Number(_0xcb9333[_0xd43f('0x61')]['id'])});}return _0x29a4ea;});}})[_0xd43f('0x2a')](respondWithResult(_0x5a08c4,null))[_0xd43f('0x5f')](handleError(_0x5a08c4,null));};exports[_0xd43f('0x133')]=function(_0x2d4e34,_0x52fb8a){return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x2d4e34['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x52fb8a,null))[_0xd43f('0x2a')](function(_0x5dac85){if(_0x5dac85){return _0x5dac85[_0xd43f('0x133')](_0x2d4e34[_0xd43f('0x4b')]['ids'])['then'](function(){if(_[_0xd43f('0x134')](_0x2d4e34['query'][_0xd43f('0x78')])){for(var _0x2a5a61=0x0;_0x2a5a61<_0x2d4e34['query'][_0xd43f('0x78')][_0xd43f('0x51')];_0x2a5a61+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2d4e34['query'][_0xd43f('0x78')][_0x2a5a61]),'ChatWebsiteId':Number(_0x2d4e34[_0xd43f('0x61')]['id'])});}}else{socket[_0xd43f('0x131')]('userChatWebsite:remove',{'UserId':Number(_0x2d4e34[_0xd43f('0x4b')][_0xd43f('0x78')]),'ChatWebsiteId':Number(_0x2d4e34[_0xd43f('0x61')]['id'])});}});}})[_0xd43f('0x2a')](respondWithStatusCode(_0x52fb8a,null))['catch'](handleError(_0x52fb8a,null));};exports[_0xd43f('0x135')]=function(_0x595980,_0x1af0a4){var _0x22bd32={};var _0x5174ed={};var _0x1bcde4;var _0x2040d8;return db[_0xd43f('0x47')]['findOne']({'where':{'id':_0x595980[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x1af0a4,null))['then'](function(_0xf5f331){if(_0xf5f331){_0x1bcde4=_0xf5f331;_0x5174ed[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0xc6')][_0xd43f('0x48')]);_0x5174ed[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x595980['query']);_0x5174ed['filters']=_['intersection'](_0x5174ed['model'],_0x5174ed[_0xd43f('0x4b')]);_0x22bd32['attributes']=_[_0xd43f('0x4e')](_0x5174ed['model'],qs[_0xd43f('0x4f')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x22bd32[_0xd43f('0x50')]=_0x22bd32['attributes'][_0xd43f('0x51')]?_0x22bd32[_0xd43f('0x50')]:_0x5174ed[_0xd43f('0x40')];_0x22bd32['order']=qs[_0xd43f('0x54')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x22bd32['where']=qs['filters'](_[_0xd43f('0x56')](_0x595980[_0xd43f('0x4b')],_0x5174ed[_0xd43f('0x4d')]));if(_0x595980[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x22bd32[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x22bd32['where'],{'$or':_[_0xd43f('0x46')](_0x22bd32[_0xd43f('0x50')],function(_0x148b77){var _0x50cc7e={};_0x50cc7e[_0x148b77]={'$like':'%'+_0x595980[_0xd43f('0x4b')]['filter']+'%'};return _0x50cc7e;})});}_0x22bd32=_[_0xd43f('0x58')]({},_0x22bd32,_0x595980['options']);return _0x1bcde4[_0xd43f('0x135')](_0x22bd32);}})['then'](function(_0x36c15e){if(_0x36c15e){_0x2040d8=_0x36c15e[_0xd43f('0x51')];if(!_0x595980[_0xd43f('0x4b')]['hasOwnProperty'](_0xd43f('0x52'))){_0x22bd32['limit']=qs[_0xd43f('0x26')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x22bd32[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x24')]);}return _0x1bcde4[_0xd43f('0x135')](_0x22bd32);}})[_0xd43f('0x2a')](function(_0x190cc9){if(_0x190cc9){return _0x190cc9?{'count':_0x2040d8,'rows':_0x190cc9}:null;}})[_0xd43f('0x2a')](respondWithResult(_0x1af0a4,null))[_0xd43f('0x5f')](handleError(_0x1af0a4,null));}; \ No newline at end of file +var _0xfa2b=['ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','CompanyId','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','toPairsIn','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tags','color','tag','getSnippet','Intervals','custom','License','increment','timezone','ifTime','server/files/chat/iframe.ejs','3.10.1','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','json','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','end','status','offset','undefined','limit','count','then','ChatWebsites','UserProfileResource','destroy','stack','name','setUA','user-agent','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','vendor','device','type','stringify','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','find','create','body','address','split','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','forEach','testWildcardValidity','Pause','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','nolimit','pick','Disposition','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','notify','chat','from','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','Contacts','DESC','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','Applications','priority','asc','List','ListId','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership'];(function(_0x1cb3bd,_0x26d60f){var _0xe19894=function(_0x5ee5a9){while(--_0x5ee5a9){_0x1cb3bd['push'](_0x1cb3bd['shift']());}};_0xe19894(++_0x26d60f);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0xd9bdf5,_0x40909f){_0xd9bdf5=_0xd9bdf5-0x0;var _0x3e0dc6=_0xfa2b[_0xd9bdf5];return _0x3e0dc6;};'use strict';var Mustache=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var ejs=require(_0xbfa2('0x3'));var fs=require('fs');var fs_extra=require(_0xbfa2('0x4'));var _=require(_0xbfa2('0x5'));var querystring=require(_0xbfa2('0x6'));var htmlToText=require(_0xbfa2('0x7'));var Redis=require(_0xbfa2('0x8'));var jayson=require(_0xbfa2('0x9'));var qs=require(_0xbfa2('0xa'));var logger=require(_0xbfa2('0xb'))(_0xbfa2('0xc'));var config=require(_0xbfa2('0xd'));var APIBadRequestError=require(_0xbfa2('0xe'))[_0xbfa2('0xf')];var APINotFoundError=require('../../errors/api')[_0xbfa2('0x10')];var APIOutOfIntervalError=require('../../errors/api')[_0xbfa2('0x11')];var APIHandleError=require(_0xbfa2('0xe'))[_0xbfa2('0x12')];var APIConflictError=require(_0xbfa2('0xe'))[_0xbfa2('0x13')];var wildcardUtils=require(_0xbfa2('0x14'));var URL=require(_0xbfa2('0x15'))[_0xbfa2('0x16')];var db=require(_0xbfa2('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xbfa2('0x18'),'port':0x18eb});var socket=require(_0xbfa2('0x19'))(new Redis(config[_0xbfa2('0x1a')]));require(_0xbfa2('0x1b'))[_0xbfa2('0x1c')](socket);var client=jayson[_0xbfa2('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xbfa2('0x1d')][_0xbfa2('0x1e')]({'port':0x232a});var client9003=jayson[_0xbfa2('0x1d')][_0xbfa2('0x1e')]({'port':0x232b});var client9001=jayson[_0xbfa2('0x1d')]['http']({'port':0x2329});function respondWithRpcPromise(_0xa988cc,_0x47db68,_0x5d3aa2,_0xee34b8){return new Promise(function(_0x55c9fe,_0x560190){var _0xab2c91=_0xee34b8||client;return _0xab2c91[_0xbfa2('0x1f')](_0xa988cc,_0x5d3aa2)['then'](function(_0xb9b6a3){logger[_0xbfa2('0x20')](_0xbfa2('0x21'),_0x47db68,_0xbfa2('0x22'));logger[_0xbfa2('0x23')](_0xbfa2('0x24'),_0x47db68,_0xbfa2('0x22'),JSON['stringify'](_0xb9b6a3));if(_0xb9b6a3[_0xbfa2('0x25')]){if(_0xb9b6a3[_0xbfa2('0x25')][_0xbfa2('0x26')]===0x1f4){logger['error'](_0xbfa2('0x21'),_0x47db68,_0xb9b6a3[_0xbfa2('0x25')]['message']);return _0x560190(_0xb9b6a3[_0xbfa2('0x25')]['message']);}logger['error'](_0xbfa2('0x21'),_0x47db68,_0xb9b6a3[_0xbfa2('0x25')][_0xbfa2('0x27')]);return _0x55c9fe(_0xb9b6a3[_0xbfa2('0x25')]['message']);}else{logger['info'](_0xbfa2('0x21'),_0x47db68,_0xbfa2('0x22'));_0x55c9fe(_0xb9b6a3['result'][_0xbfa2('0x27')]);}})['catch'](function(_0xeb88ab){logger['error'](_0xbfa2('0x21'),_0x47db68,_0xeb88ab);_0x560190(_0xeb88ab);});});}function respondWithStatusCode(_0xbe4d26,_0x8488e1){_0x8488e1=_0x8488e1||0xcc;return function(_0x38c5dc){if(_0x38c5dc){return _0xbe4d26[_0xbfa2('0x28')](_0x8488e1);}return _0xbe4d26['status'](_0x8488e1)[_0xbfa2('0x29')]();};}function respondWithResult(_0x2f9217,_0x4f782b){_0x4f782b=_0x4f782b||0xc8;return function(_0x37ec27){if(_0x37ec27){return _0x2f9217[_0xbfa2('0x2a')](_0x4f782b)['json'](_0x37ec27);}};}function respondWithFilteredResult(_0x2cbc51,_0x5ecd55){return function(_0x16bc84){if(_0x16bc84){var _0x56dd44=typeof _0x5ecd55[_0xbfa2('0x2b')]===_0xbfa2('0x2c')&&typeof _0x5ecd55[_0xbfa2('0x2d')]===_0xbfa2('0x2c');var _0x49d563=_0x16bc84[_0xbfa2('0x2e')];var _0x4aac4e=_0x56dd44?0x0:_0x5ecd55[_0xbfa2('0x2b')];var _0x36a30d=_0x56dd44?_0x16bc84[_0xbfa2('0x2e')]:_0x5ecd55['offset']+_0x5ecd55[_0xbfa2('0x2d')];var _0x17e471;if(_0x36a30d>=_0x49d563){_0x36a30d=_0x49d563;_0x17e471=0xc8;}else{_0x17e471=0xce;}_0x2cbc51[_0xbfa2('0x2a')](_0x17e471);return _0x2cbc51['set']('Content-Range',_0x4aac4e+'-'+_0x36a30d+'/'+_0x49d563)['json'](_0x16bc84);}return null;};}function saveUpdates(_0x2d5050){return function(_0x12069c){if(_0x12069c){return _0x12069c['update'](_0x2d5050)[_0xbfa2('0x2f')](function(_0x2ae697){return _0x2ae697;});}return null;};}function removeEntity(_0x39d1ce){return function(_0x206119){if(_0x206119){return _0x206119['destroy']()[_0xbfa2('0x2f')](function(){var _0x9523b7=_0x206119['get']({'plain':!![]});var _0x63ed08=_0xbfa2('0x30');return db[_0xbfa2('0x31')][_0xbfa2('0x32')]({'where':{'type':_0x63ed08,'resourceId':_0x9523b7['id']}})[_0xbfa2('0x2f')](function(){return _0x206119;});})[_0xbfa2('0x2f')](function(){_0x39d1ce[_0xbfa2('0x2a')](0xcc)[_0xbfa2('0x29')]();});}};}function handleEntityNotFound(_0x787887){return function(_0x5d6c57){if(!_0x5d6c57){_0x787887[_0xbfa2('0x28')](0x194);}return _0x5d6c57;};}function handleError(_0x5c910b,_0x2518dd){_0x2518dd=_0x2518dd||0x1f4;return function(_0x57c93c){logger[_0xbfa2('0x25')](_0x57c93c[_0xbfa2('0x33')]);if(_0x57c93c[_0xbfa2('0x34')]){delete _0x57c93c[_0xbfa2('0x34')];}_0x5c910b[_0xbfa2('0x2a')](_0x2518dd)['send'](_0x57c93c);};}function createInteractionObject(_0x3ed2f0,_0x31bb3f,_0xb264a6,_0xf53cdb){var _0xa6f846=require('user-agent-parser');var _0x4b9647=new _0xa6f846();var _0x2e2674=_0x4b9647[_0xbfa2('0x35')](_0xb264a6[_0xbfa2('0x36')])['getResult']();var _0x4f1362=_0x31bb3f[_0xbfa2('0x37')];if(_0xb264a6[_0xbfa2('0x38')]){_0x4f1362=_0xb264a6['cf-connecting-ip'];}else if(_0xb264a6['x-forwarded-for']){_0x4f1362=_[_0xbfa2('0x39')](_0xb264a6[_0xbfa2('0x3a')]['split'](','));}return{'ContactId':_0xf53cdb['id'],'ChatWebsiteId':_0x3ed2f0,'from':(_0xf53cdb[_0xbfa2('0x3b')]||'')+'\x20'+(_0xf53cdb[_0xbfa2('0x3c')]||''),'customerIp':_0x4f1362,'customerPort':_0xb264a6[_0xbfa2('0x3d')]?_0xb264a6[_0xbfa2('0x3d')]:null,'referer':_0x31bb3f[_0xbfa2('0x3e')],'browserName':_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x34')]&&_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x40')]?util[_0xbfa2('0x41')](_0xbfa2('0x42'),_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x34')],_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x40')]):_0xbfa2('0x43'),'browserVersion':_0x2e2674[_0xbfa2('0x3f')]['version']||_0xbfa2('0x43'),'osName':util[_0xbfa2('0x41')](_0xbfa2('0x42'),_0x2e2674['os'][_0xbfa2('0x34')],_0x2e2674['os'][_0xbfa2('0x40')]),'osVersion':_0x2e2674['os'][_0xbfa2('0x40')],'deviceModel':_0x2e2674['device'][_0xbfa2('0x44')]&&_0x2e2674['device'][_0xbfa2('0x45')]?util[_0xbfa2('0x41')]('%s\x20%s\x20%s',_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x44')],_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x45')],_0x2e2674[_0xbfa2('0x46')]['type']):null,'deviceVendor':_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x45')],'deviceType':_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x47')],'formData':JSON[_0xbfa2('0x48')](_0x31bb3f)};}exports[_0xbfa2('0x49')]=function(_0x1a353b,_0x25a54f){var _0x4a43f8={'include':[{'model':db['Pause'],'as':_0xbfa2('0x4a')}]},_0x20eb6e={},_0xba5a16={'count':0x0,'rows':[]};var _0x38c005=_[_0xbfa2('0x4b')](db[_0xbfa2('0x4c')][_0xbfa2('0x4d')],function(_0x31ef59){return{'name':_0x31ef59[_0xbfa2('0x4e')],'type':_0x31ef59[_0xbfa2('0x47')][_0xbfa2('0x4f')]};});_0x20eb6e['model']=_[_0xbfa2('0x4b')](_0x38c005,_0xbfa2('0x34'));_0x20eb6e[_0xbfa2('0x50')]=_['keys'](_0x1a353b['query']);_0x20eb6e[_0xbfa2('0x51')]=_['intersection'](_0x20eb6e[_0xbfa2('0x44')],_0x20eb6e[_0xbfa2('0x50')]);_0x4a43f8['attributes']=_[_0xbfa2('0x52')](_0x20eb6e[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x1a353b['query'][_0xbfa2('0x53')]));_0x4a43f8['attributes']=_0x4a43f8[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x4a43f8['attributes']:_0x20eb6e[_0xbfa2('0x44')];if(!_0x1a353b['query'][_0xbfa2('0x56')]('nolimit')){_0x4a43f8[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x1a353b[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x4a43f8[_0xbfa2('0x2b')]=qs['offset'](_0x1a353b['query']['offset']);}_0x4a43f8[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x1a353b[_0xbfa2('0x50')]['sort']);_0x4a43f8[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_['pick'](_0x1a353b[_0xbfa2('0x50')],_0x20eb6e[_0xbfa2('0x51')]),_0x38c005);if(_0x1a353b['query'][_0xbfa2('0x5a')]){_0x4a43f8[_0xbfa2('0x59')]=_['merge'](_0x4a43f8['where'],{'$or':_[_0xbfa2('0x4b')](_0x38c005,function(_0x4a705f){if(_0x4a705f[_0xbfa2('0x47')]!==_0xbfa2('0x5b')){var _0x55da83={};_0x55da83[_0x4a705f[_0xbfa2('0x34')]]={'$like':'%'+_0x1a353b[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x55da83;}})});}_0x4a43f8=_[_0xbfa2('0x5c')]({},_0x4a43f8,_0x1a353b[_0xbfa2('0x5d')]);var _0x28d7c5={'where':_0x4a43f8[_0xbfa2('0x59')]};return db[_0xbfa2('0x4c')][_0xbfa2('0x2e')](_0x28d7c5)[_0xbfa2('0x2f')](function(_0x33531){_0xba5a16[_0xbfa2('0x2e')]=_0x33531;if(_0x1a353b[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x4a43f8['include']=[{'all':!![]}];}return db[_0xbfa2('0x4c')]['findAll'](_0x4a43f8);})[_0xbfa2('0x2f')](function(_0x401f2c){_0xba5a16[_0xbfa2('0x5f')]=_0x401f2c;return _0xba5a16;})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x25a54f,_0x4a43f8))[_0xbfa2('0x60')](handleError(_0x25a54f,null));};exports[_0xbfa2('0x61')]=function(_0x36b0df,_0x1b8c24){var _0x41749d={'raw':![],'where':{'id':_0x36b0df[_0xbfa2('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0xbfa2('0x4a')}]},_0x2ea55c={};_0x2ea55c[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0x4c')]['rawAttributes']);_0x2ea55c[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x36b0df[_0xbfa2('0x50')]);_0x2ea55c[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x2ea55c['model'],_0x2ea55c[_0xbfa2('0x50')]);_0x41749d[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x2ea55c[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x36b0df[_0xbfa2('0x50')]['fields']));_0x41749d[_0xbfa2('0x54')]=_0x41749d[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x41749d[_0xbfa2('0x54')]:_0x2ea55c[_0xbfa2('0x44')];if(_0x36b0df['query'][_0xbfa2('0x5e')]){_0x41749d['include']=[{'all':!![]}];}_0x41749d=_[_0xbfa2('0x5c')]({},_0x41749d,_0x36b0df[_0xbfa2('0x5d')]);return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x41749d)['then'](handleEntityNotFound(_0x1b8c24,null))['then'](respondWithResult(_0x1b8c24,null))[_0xbfa2('0x60')](handleError(_0x1b8c24,null));};exports[_0xbfa2('0x65')]=function(_0x15c172,_0x4ec9b0){var _0x1ab345=null;_0x15c172[_0xbfa2('0x66')][_0xbfa2('0x67')][_0xbfa2('0x68')](',')['forEach'](_0x433448=>{if(_0x433448[_0xbfa2('0x69')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x433448[_0xbfa2('0x69')]())){_0x1ab345=new APIBadRequestError('\x22'+_0x433448[_0xbfa2('0x69')]()+_0xbfa2('0x6a'));}});if(_0x1ab345){return handleError(_0x4ec9b0,null)(_0x1ab345);}return db[_0xbfa2('0x4c')]['create'](_0x15c172['body'],{})[_0xbfa2('0x2f')](function(_0x140627){var _0x8de0a6=_0x15c172[_0xbfa2('0x6b')][_0xbfa2('0x6c')]({'plain':!![]});if(!_0x8de0a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8de0a6[_0xbfa2('0x6d')]===_0xbfa2('0x6b')){var _0x3c5ff6=_0x140627['get']({'plain':!![]});var _0x288e11=_0xbfa2('0x30');return db[_0xbfa2('0x6e')][_0xbfa2('0x64')]({'where':{'name':_0x288e11,'userProfileId':_0x8de0a6['userProfileId']},'raw':!![]})['then'](function(_0x149ee3){if(_0x149ee3&&_0x149ee3['autoAssociation']===0x0){return db[_0xbfa2('0x31')][_0xbfa2('0x65')]({'name':_0x3c5ff6[_0xbfa2('0x34')],'resourceId':_0x3c5ff6['id'],'type':_0x149ee3[_0xbfa2('0x34')],'sectionId':_0x149ee3['id']},{})[_0xbfa2('0x2f')](function(){return _0x140627;});}else{return _0x140627;}})['catch'](function(_0x4611e2){logger[_0xbfa2('0x25')](_0xbfa2('0x6f'),_0x4611e2);throw _0x4611e2;});}return _0x140627;})['then'](respondWithResult(_0x4ec9b0,0xc9))['catch'](handleError(_0x4ec9b0,null));};exports[_0xbfa2('0x70')]=function(_0x48029a,_0x5b8407){var _0x5ea6fd=null;_0x48029a[_0xbfa2('0x66')]['address'][_0xbfa2('0x68')](',')[_0xbfa2('0x71')](_0xdde19=>{if(_0xdde19[_0xbfa2('0x69')]()!==''&&!wildcardUtils[_0xbfa2('0x72')](_0xdde19[_0xbfa2('0x69')]())){_0x5ea6fd=new APIBadRequestError('\x22'+_0xdde19[_0xbfa2('0x69')]()+_0xbfa2('0x6a'));}});if(_0x5ea6fd){return handleError(_0x5b8407,null)(_0x5ea6fd);}if(_0x48029a[_0xbfa2('0x66')]['id']){delete _0x48029a[_0xbfa2('0x66')]['id'];}return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x48029a[_0xbfa2('0x62')]['id']},'include':[{'model':db[_0xbfa2('0x73')],'as':_0xbfa2('0x4a')}]})[_0xbfa2('0x2f')](handleEntityNotFound(_0x5b8407,null))[_0xbfa2('0x2f')](saveUpdates(_0x48029a[_0xbfa2('0x66')],null))[_0xbfa2('0x2f')](respondWithResult(_0x5b8407,null))[_0xbfa2('0x60')](handleError(_0x5b8407,null));};exports[_0xbfa2('0x32')]=function(_0x31bab8,_0x4d94a4){return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x31bab8[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x4d94a4,null))[_0xbfa2('0x2f')](removeEntity(_0x4d94a4,null))[_0xbfa2('0x60')](handleError(_0x4d94a4,null));};exports['describe']=function(_0x2dd954,_0x1f4482){return db['ChatWebsite'][_0xbfa2('0x74')]()['then'](respondWithResult(_0x1f4482,null))[_0xbfa2('0x60')](handleError(_0x1f4482,null));};exports[_0xbfa2('0x75')]=function(_0x128617,_0x196367){if(_0x128617[_0xbfa2('0x66')]['id']){delete _0x128617[_0xbfa2('0x66')]['id'];}return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x128617[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x196367,null))[_0xbfa2('0x2f')](function(_0x405375){if(_0x405375){_0x128617['body'][_0xbfa2('0x76')]=_0x405375['id'];return db['Disposition']['create'](_0x128617[_0xbfa2('0x66')]);}})[_0xbfa2('0x2f')](respondWithResult(_0x196367,null))[_0xbfa2('0x60')](handleError(_0x196367,null));};exports[_0xbfa2('0x77')]=function(_0x584bf3,_0x417abc){var _0x4bd996={'raw':![],'where':{}};var _0x3a4027={};var _0x3f077a={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x584bf3[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x417abc,null))[_0xbfa2('0x2f')](function(_0x186b09){if(_0x186b09){_0x3a4027[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db['Disposition'][_0xbfa2('0x4d')]);_0x3a4027[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x584bf3[_0xbfa2('0x50')]);_0x3a4027[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x3a4027['model'],_0x3a4027[_0xbfa2('0x50')]);_0x4bd996[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x3a4027[_0xbfa2('0x44')],qs['fields'](_0x584bf3['query'][_0xbfa2('0x53')]));_0x4bd996[_0xbfa2('0x54')]=_0x4bd996[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x4bd996[_0xbfa2('0x54')]:_0x3a4027[_0xbfa2('0x44')];if(!_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x56')](_0xbfa2('0x79'))){_0x4bd996['limit']=qs['limit'](_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x4bd996['offset']=qs[_0xbfa2('0x2b')](_0x584bf3['query'][_0xbfa2('0x2b')]);}_0x4bd996[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x4bd996['where']=qs['filters'](_[_0xbfa2('0x7a')](_0x584bf3['query'],_0x3a4027[_0xbfa2('0x51')]));_0x4bd996[_0xbfa2('0x59')]['ChatWebsiteId']=_0x186b09['id'];if(_0x584bf3[_0xbfa2('0x50')]['filter']){_0x4bd996['where']=_[_0xbfa2('0x5c')](_0x4bd996[_0xbfa2('0x59')],{'$or':_['map'](_0x4bd996[_0xbfa2('0x54')],function(_0x20ee10){var _0x3bd6d8={};_0x3bd6d8[_0x20ee10]={'$like':'%'+_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x3bd6d8;})});}_0x4bd996=_[_0xbfa2('0x5c')]({},_0x4bd996,_0x584bf3[_0xbfa2('0x5d')]);return db[_0xbfa2('0x7b')][_0xbfa2('0x2e')]({'where':_0x4bd996[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x1e8bd8){_0x3f077a[_0xbfa2('0x2e')]=_0x1e8bd8;if(_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x4bd996[_0xbfa2('0x7c')]=[{'all':!![]}];}return db[_0xbfa2('0x7b')][_0xbfa2('0x7d')](_0x4bd996);})['then'](function(_0x595f1f){_0x3f077a[_0xbfa2('0x5f')]=_0x595f1f;return _0x3f077a;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x417abc,_0x4bd996))[_0xbfa2('0x60')](handleError(_0x417abc,null));};exports[_0xbfa2('0x7e')]=function(_0x46f369,_0x52c47c){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x46f369[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x52c47c,null))[_0xbfa2('0x2f')](function(_0x71ac8e){if(_0x71ac8e){return _0x71ac8e[_0xbfa2('0x7e')](_0x46f369[_0xbfa2('0x50')][_0xbfa2('0x7f')]);}})[_0xbfa2('0x2f')](respondWithStatusCode(_0x52c47c,null))[_0xbfa2('0x60')](handleError(_0x52c47c,null));};exports[_0xbfa2('0x80')]=function(_0x352788,_0x3c398e){if(_0x352788['body']['id']){delete _0x352788[_0xbfa2('0x66')]['id'];}return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x352788['params']['id']}})['then'](handleEntityNotFound(_0x3c398e,null))[_0xbfa2('0x2f')](function(_0x24bb46){if(_0x24bb46){_0x352788[_0xbfa2('0x66')][_0xbfa2('0x76')]=_0x24bb46['id'];return db[_0xbfa2('0x81')][_0xbfa2('0x65')](_0x352788[_0xbfa2('0x66')]);}})['then'](respondWithResult(_0x3c398e,null))['catch'](handleError(_0x3c398e,null));};exports[_0xbfa2('0x82')]=function(_0x2e4715,_0x40dbef){var _0x1cab3f={'raw':![],'where':{}};var _0x5e5a3a={};var _0x1f93eb={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x2e4715[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x40dbef,null))['then'](function(_0x515bad){if(_0x515bad){_0x5e5a3a[_0xbfa2('0x44')]=_['keys'](db[_0xbfa2('0x81')][_0xbfa2('0x4d')]);_0x5e5a3a[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x2e4715[_0xbfa2('0x50')]);_0x5e5a3a[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x5e5a3a['model'],_0x5e5a3a[_0xbfa2('0x50')]);_0x1cab3f[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x5e5a3a[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x2e4715['query']['fields']));_0x1cab3f[_0xbfa2('0x54')]=_0x1cab3f[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x1cab3f['attributes']:_0x5e5a3a[_0xbfa2('0x44')];if(!_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x56')](_0xbfa2('0x79'))){_0x1cab3f['limit']=qs['limit'](_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x1cab3f['offset']=qs[_0xbfa2('0x2b')](_0x2e4715['query'][_0xbfa2('0x2b')]);}_0x1cab3f[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x2e4715['query'][_0xbfa2('0x58')]);_0x1cab3f['where']=qs[_0xbfa2('0x51')](_[_0xbfa2('0x7a')](_0x2e4715[_0xbfa2('0x50')],_0x5e5a3a[_0xbfa2('0x51')]));_0x1cab3f['where'][_0xbfa2('0x76')]=_0x515bad['id'];if(_0x2e4715['query'][_0xbfa2('0x5a')]){_0x1cab3f[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x1cab3f[_0xbfa2('0x59')],{'$or':_[_0xbfa2('0x4b')](_0x1cab3f['attributes'],function(_0x1cc3a6){var _0x4e94d7={};_0x4e94d7[_0x1cc3a6]={'$like':'%'+_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x4e94d7;})});}_0x1cab3f=_[_0xbfa2('0x5c')]({},_0x1cab3f,_0x2e4715[_0xbfa2('0x5d')]);return db[_0xbfa2('0x81')][_0xbfa2('0x2e')]({'where':_0x1cab3f[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x244b4f){_0x1f93eb[_0xbfa2('0x2e')]=_0x244b4f;if(_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x1cab3f['include']=[{'all':!![]}];}return db[_0xbfa2('0x81')][_0xbfa2('0x7d')](_0x1cab3f);})['then'](function(_0x5785aa){_0x1f93eb[_0xbfa2('0x5f')]=_0x5785aa;return _0x1f93eb;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x40dbef,_0x1cab3f))[_0xbfa2('0x60')](handleError(_0x40dbef,null));};exports[_0xbfa2('0x83')]=function(_0x9a0a20,_0xb2ba9f){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x9a0a20['params']['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0xb2ba9f,null))[_0xbfa2('0x2f')](function(_0x267df7){if(_0x267df7){return _0x267df7[_0xbfa2('0x83')](_0x9a0a20[_0xbfa2('0x50')][_0xbfa2('0x7f')]);}})[_0xbfa2('0x2f')](respondWithStatusCode(_0xb2ba9f,null))[_0xbfa2('0x60')](handleError(_0xb2ba9f,null));};exports[_0xbfa2('0x84')]=function(_0x15de6a,_0x3de98d){_0x15de6a[_0xbfa2('0x66')]['sitepic']=_0x15de6a[_0xbfa2('0x85')]['filename'];return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x15de6a[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x3de98d,null))[_0xbfa2('0x2f')](saveUpdates(_0x15de6a[_0xbfa2('0x66')],null))[_0xbfa2('0x2f')](respondWithResult(_0x3de98d,null))[_0xbfa2('0x60')](handleError(_0x3de98d,null));};exports[_0xbfa2('0x86')]=function(_0x178f44,_0x304e23){_0x178f44['body'][_0xbfa2('0x87')]=_0x178f44['file'][_0xbfa2('0x88')];return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x178f44[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x304e23,null))['then'](saveUpdates(_0x178f44[_0xbfa2('0x66')],null))['then'](respondWithResult(_0x304e23,null))[_0xbfa2('0x60')](handleError(_0x304e23,null));};exports[_0xbfa2('0x89')]=function(_0x21555a,_0x599631){_0x21555a[_0xbfa2('0x66')]['customerAvatar']=_0x21555a[_0xbfa2('0x85')][_0xbfa2('0x88')];return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x21555a['params']['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x599631,null))[_0xbfa2('0x2f')](saveUpdates(_0x21555a['body'],null))['then'](respondWithResult(_0x599631,null))['catch'](handleError(_0x599631,null));};exports[_0xbfa2('0x8a')]=function(_0x2d05f6,_0x6713ce){_0x2d05f6[_0xbfa2('0x66')][_0xbfa2('0x8b')]=_0x2d05f6[_0xbfa2('0x85')][_0xbfa2('0x88')];return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x2d05f6['params']['id']}})['then'](handleEntityNotFound(_0x6713ce,null))[_0xbfa2('0x2f')](saveUpdates(_0x2d05f6[_0xbfa2('0x66')],null))[_0xbfa2('0x2f')](respondWithResult(_0x6713ce,null))[_0xbfa2('0x60')](handleError(_0x6713ce,null));};exports[_0xbfa2('0x8c')]=function(_0x24a52a,_0x36577e){var _0x4f7177=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x8f'));var _0x2286ae={'where':{'id':_0x24a52a[_0xbfa2('0x62')]['id']},'attributes':['id',_0xbfa2('0x90')],'raw':!![]};var _0x2f43d5=![];return require(_0xbfa2('0x91'))[_0xbfa2('0x92')]()[_0xbfa2('0x2f')](function(_0x4523a4){if(_0x4523a4){_0x2f43d5=_0x4523a4['custom'];}})[_0xbfa2('0x2f')](function(){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x2286ae);})[_0xbfa2('0x2f')](handleEntityNotFound(_0x36577e,null))[_0xbfa2('0x2f')](function(_0x2a172e){if(_0x2a172e){if(!_[_0xbfa2('0x93')](_0x2a172e['sitepic'])){if(fs[_0xbfa2('0x94')](path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x95'),_0x2a172e[_0xbfa2('0x90')]))&&_0x2f43d5){_0x4f7177=path['join'](config[_0xbfa2('0x8e')],_0xbfa2('0x95'),_0x2a172e[_0xbfa2('0x90')]);}}return _0x36577e[_0xbfa2('0x96')](_0x4f7177);}})['catch'](handleError(_0x36577e,null));};exports[_0xbfa2('0x97')]=function(_0x21f246,_0x3a2070){var _0x1461d4=path[_0xbfa2('0x8d')](config['root'],_0xbfa2('0x98'));var _0x529291={'where':{'id':_0x21f246[_0xbfa2('0x62')]['id']},'attributes':['id',_0xbfa2('0x87')],'raw':!![]};return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x529291)[_0xbfa2('0x2f')](handleEntityNotFound(_0x3a2070,null))[_0xbfa2('0x2f')](function(_0x418594){if(_0x418594){if(!_[_0xbfa2('0x93')](_0x418594['agentAvatar'])){if(fs[_0xbfa2('0x94')](path['join'](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x418594[_0xbfa2('0x87')]))){_0x1461d4=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x418594[_0xbfa2('0x87')]);}}return _0x3a2070[_0xbfa2('0x96')](_0x1461d4);}})[_0xbfa2('0x60')](handleError(_0x3a2070,null));};exports[_0xbfa2('0x9a')]=function(_0x373e78,_0x33828e){var _0x3495b2=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],'server/files/images/avatars/customer_avatar.png');var _0xfcea05={'where':{'id':_0x373e78['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0xfcea05)[_0xbfa2('0x2f')](handleEntityNotFound(_0x33828e,null))[_0xbfa2('0x2f')](function(_0x321b23){if(_0x321b23){if(!_[_0xbfa2('0x93')](_0x321b23['customerAvatar'])){if(fs[_0xbfa2('0x94')](path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x321b23[_0xbfa2('0x9b')]))&&_0x321b23[_0xbfa2('0x9c')]){_0x3495b2=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x321b23['customerAvatar']);}}return _0x33828e[_0xbfa2('0x96')](_0x3495b2);}})['catch'](handleError(_0x33828e,null));};exports[_0xbfa2('0x9d')]=function(_0x44ea29,_0xe51ea7){var _0x2170b8=path[_0xbfa2('0x8d')](config['root'],_0xbfa2('0x9e'));var _0x5e56ad={'where':{'id':_0x44ea29[_0xbfa2('0x62')]['id']},'attributes':['id',_0xbfa2('0x8b')],'raw':!![]};return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x5e56ad)[_0xbfa2('0x2f')](handleEntityNotFound(_0xe51ea7,null))[_0xbfa2('0x2f')](function(_0x2ec64e){if(_0x2ec64e){if(!_[_0xbfa2('0x93')](_0x2ec64e[_0xbfa2('0x8b')])){if(fs[_0xbfa2('0x94')](path['join'](config[_0xbfa2('0x8e')],'server/files/images/avatars/',_0x2ec64e[_0xbfa2('0x8b')]))){_0x2170b8=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x2ec64e[_0xbfa2('0x8b')]);}}return _0xe51ea7[_0xbfa2('0x96')](_0x2170b8);}})[_0xbfa2('0x60')](handleError(_0xe51ea7,null));};function checkWebsiteInterval(_0x68a1b6){var _0x1749ff=_0x68a1b6[_0xbfa2('0x9f')];if(!_0x1749ff){return Promise[_0xbfa2('0xa0')](_0x68a1b6);}var _0x17205f=_0x68a1b6['timezone']||undefined;return _0x1749ff['ifTime'](_0x17205f)['then'](function(_0x403c85){if(!_0x403c85){throw new APIOutOfIntervalError();}return _0x68a1b6;});}exports[_0xbfa2('0xa1')]=function(_0x112b9f,_0x5d4b42){var _0x3ddd75={'body':_0x112b9f[_0xbfa2('0x66')],'channel':_0xbfa2('0xa2')};var _0x5dd72f=[];var _0x1551c5=[];var _0xc559f4={};var _0x2d4041=![];if(_0x112b9f[_0xbfa2('0x66')]['id']){delete _0x112b9f[_0xbfa2('0x66')]['id'];}if(_[_0xbfa2('0x93')](_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xbfa2('0x93')](_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa4')])){throw new APIBadRequestError(_0xbfa2('0xa5'));}if(_[_0xbfa2('0xa6')](_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0x66')])){throw new APIBadRequestError(_0xbfa2('0xa7'));}var _0x22d06f=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0x37')]&&_0x112b9f[_0xbfa2('0x66')]['referer'];return db[_0xbfa2('0xa8')][_0xbfa2('0x74')]()[_0xbfa2('0x2f')](function(_0x1fe7cb){if(!_0x1fe7cb){throw new Error(_0xbfa2('0xa9'));}_0x5dd72f=Object['keys'](_0x1fe7cb)[_0xbfa2('0x5a')](function(_0x89f72a){return![_0xbfa2('0xaa'),'updatedAt']['includes'](_0x89f72a);});_0x1551c5=Object[_0xbfa2('0x63')](_0x1fe7cb)[_0xbfa2('0x5a')](function(_0x24aeeb){return![_0xbfa2('0xaa'),_0xbfa2('0xab'),'CompanyId','ListId'][_0xbfa2('0xac')](_0x24aeeb);});if(!_[_0xbfa2('0xac')](_0x1551c5,_0x112b9f['body'][_0xbfa2('0xa4')])){throw new APIBadRequestError(_0xbfa2('0xad')+_0x1551c5[_0xbfa2('0x8d')](',\x20'));}_0xc559f4[_0x112b9f['body'][_0xbfa2('0xa4')]]=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')];})[_0xbfa2('0x2f')](function(){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x112b9f['params']['id']},'include':[{'model':db[_0xbfa2('0xae')],'as':'List','include':[{'model':db[_0xbfa2('0xa8')],'as':_0xbfa2('0xaf'),'where':_0xc559f4,'limit':0x1,'order':[[_0xbfa2('0xab'),_0xbfa2('0xb0')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db['Interval'],'as':_0xbfa2('0x9f'),'include':[{'model':db[_0xbfa2('0x9f')],'as':'Intervals','attributes':['id',_0xbfa2('0xb1')],'raw':!![]}]}]});})[_0xbfa2('0x2f')](function(_0x29a04e){if(!_0x29a04e){throw new APINotFoundError(util[_0xbfa2('0x41')](_0xbfa2('0xb2'),_0x112b9f[_0xbfa2('0x62')]['id']));}if(_0x22d06f){return checkWebsiteInterval(_0x29a04e);}return _0x29a04e;})[_0xbfa2('0x2f')](function(_0x3937a4){_0x3ddd75[_0xbfa2('0xb3')]=_0x3937a4;_0x3ddd75[_0xbfa2('0xb4')]=_['orderBy'](_0x3937a4[_0xbfa2('0xb5')],[_0xbfa2('0xb6')],[_0xbfa2('0xb7')]);if(_0x3ddd75['account'][_0xbfa2('0xb5')]){delete _0x3ddd75['account']['Applications'];}_0x3ddd75['list']=_0x3937a4[_0xbfa2('0xb8')]||{'id':_0x3937a4[_0xbfa2('0xb9')]};if(_0x3ddd75[_0xbfa2('0xba')]&&_0x3ddd75[_0xbfa2('0xba')][_0xbfa2('0xaf')]['length']){return _0x3ddd75[_0xbfa2('0xba')]['Contacts'][0x0];}var _0x4a99e7=_['defaults'](_0x112b9f[_0xbfa2('0x66')],{'firstName':_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')],'ListId':_0x3937a4['ListId']});_0x4a99e7[_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa4')]]=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')];return db[_0xbfa2('0xa8')][_0xbfa2('0x65')](_0x4a99e7,{'fields':_0x5dd72f,'raw':!![]});})[_0xbfa2('0x2f')](function(_0x20086d){_0x3ddd75[_0xbfa2('0xbb')]=_0x20086d;var _0x40051f=createInteractionObject(_0x112b9f['params']['id'],_0x112b9f[_0xbfa2('0x66')],_0x112b9f[_0xbfa2('0xbc')],_0x20086d);var _0x2c83eb={'ChatWebsiteId':_0x112b9f[_0xbfa2('0x62')]['id']};if(_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xbd')]){_0x2c83eb[_0xbfa2('0xbd')]=_0x112b9f['body']['threadId'];_0x2c83eb[_0xbfa2('0xbe')]=![];return db[_0xbfa2('0xbf')][_0xbfa2('0x64')]({'where':_0x2c83eb})[_0xbfa2('0x2f')](function(_0x59abdc){var _0x17162a=_0x112b9f[_0xbfa2('0x66')]['customerIp']&&_0x112b9f[_0xbfa2('0x66')]['referer'];if(_0x59abdc){_0x2d4041=!![];return _0x59abdc;}else if(!_0x17162a&&_0x59abdc&&_0x59abdc[_0xbfa2('0xbe')]){throw new APIConflictError(_0xbfa2('0xc0'));}_0x40051f[_0xbfa2('0xbd')]=_0x112b9f[_0xbfa2('0x66')]['threadId'];_0x40051f['externalUrl']=_0x112b9f['body']['externalUrl'];return db['ChatInteraction'][_0xbfa2('0x65')](_0x40051f);});}_0x2c83eb[_0xbfa2('0xc1')]=_0x20086d['id'];if(_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc2')]&&_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc2')]['id']){_0x2c83eb['id']=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc2')]['id'];return db['ChatInteraction'][_0xbfa2('0x64')]({'where':_0x2c83eb})[_0xbfa2('0x2f')](function(_0x288f7e){var _0x2ae6eb=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0x37')]&&_0x112b9f['body']['referer'];if(!_0x2ae6eb&&_0x288f7e&&_0x288f7e['closed']){throw new APIConflictError(_0xbfa2('0xc0'));}else if(_0x288f7e){_0x2d4041=!![];return _0x288f7e;}else{return db['ChatInteraction'][_0xbfa2('0x65')](_0x40051f);}});}return db[_0xbfa2('0xbf')][_0xbfa2('0x65')](_0x40051f);})[_0xbfa2('0x2f')](function(_0x5ac9d4){if(!_0x2d4041){return _0x5ac9d4;}var _0x44f395={'from':(_0x3ddd75[_0xbfa2('0xbb')]['firstName']||'')+'\x20'+(_0x3ddd75[_0xbfa2('0xbb')][_0xbfa2('0x3c')]||'')};if(_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xbd')]&&_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc3')]&&_0x112b9f['body'][_0xbfa2('0xbd')]!=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc3')]){_0x44f395[_0xbfa2('0xbd')]=_0x112b9f['body']['messageId'];}return _0x5ac9d4[_0xbfa2('0x70')](_0x44f395);})[_0xbfa2('0x2f')](function(_0x10e794){_0x3ddd75[_0xbfa2('0xc2')]=_0x10e794[_0xbfa2('0x6c')]({'plain':!![]});_0x3ddd75['interaction'][_0xbfa2('0xc4')]=!_0x2d4041;if(_0x3ddd75['interaction'][_0xbfa2('0xc4')]){if(_0x3ddd75[_0xbfa2('0xb3')][_0xbfa2('0xc5')]){_0x3ddd75[_0xbfa2('0xb4')][_0xbfa2('0xc6')]({'id':0x0,'priority':_0x3ddd75[_0xbfa2('0xb4')][_0xbfa2('0x55')]+0x1,'app':_0xbfa2('0xc7'),'appdata':_0xbfa2('0xc8'),'interval':'*,*,*,*'});}}return db[_0xbfa2('0xc9')][_0xbfa2('0x65')]({'body':_0x112b9f[_0xbfa2('0x66')]['body'],'ChatWebsiteId':_0x112b9f[_0xbfa2('0x62')]['id'],'ChatInteractionId':_0x10e794['id'],'direction':'in','ContactId':_0x3ddd75[_0xbfa2('0xbb')]['id'],'AttachmentId':_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xca')]});})[_0xbfa2('0x2f')](function(_0x46b515){_0x3ddd75[_0xbfa2('0x27')]=_0x46b515;if(!_0x3ddd75[_0xbfa2('0xc2')][_0xbfa2('0xcb')]){return;}return db[_0xbfa2('0xcc')][_0xbfa2('0x64')]({'attributes':['id',_0xbfa2('0x34')],'where':{'id':_0x3ddd75[_0xbfa2('0xc2')][_0xbfa2('0xcb')]}});})[_0xbfa2('0x2f')](function(_0xf2681f){if(_0xf2681f){_0x3ddd75[_0xbfa2('0xb4')]['unshift']({'id':0x0,'priority':0x0,'app':_0xbfa2('0xcd'),'appdata':_0xf2681f[_0xbfa2('0x34')]+','+(_0x3ddd75[_0xbfa2('0xb3')][_0xbfa2('0xce')]||0xa),'interval':_0xbfa2('0xcf')});_0x3ddd75[_0xbfa2('0xd0')]=!![];}if(!_0x3ddd75[_0xbfa2('0xc2')]['queueId']){return;}return db[_0xbfa2('0xd1')][_0xbfa2('0x64')]({'attributes':['id',_0xbfa2('0x34')],'where':{'id':_0x3ddd75[_0xbfa2('0xc2')]['queueId']}});})['then'](function(_0x3b1ac8){if(_0x3b1ac8){_0x3ddd75[_0xbfa2('0xb4')]['unshift']({'id':0x0,'priority':0x1,'app':_0xbfa2('0xd2'),'appdata':_0x3b1ac8[_0xbfa2('0x34')]+','+(_0x3ddd75[_0xbfa2('0xb3')][_0xbfa2('0xd3')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xbfa2('0xd4'),_0x3ddd75);})[_0xbfa2('0x2f')](function(_0xcabfa5){respondWithRpcPromise(_0xbfa2('0xd5'),_0xbfa2('0xd5'),{'event':'notify','message':_0xcabfa5},client9002);return _0xcabfa5;})[_0xbfa2('0x2f')](respondWithResult(_0x5d4b42,null))[_0xbfa2('0x60')](APIHandleError(_0x5d4b42));};exports[_0xbfa2('0xd6')]=function(_0x3f4805,_0x776092){var _0x230cbc,_0x2a2f9a,_0xbe9477;var _0x4f6bd3=[];var _0x26b11c={};var _0x43b517=_0x3f4805[_0xbfa2('0xd7')]||[];var _0x38bb2b=[];var _0x24968b;return db['CmContact'][_0xbfa2('0x74')]()[_0xbfa2('0x2f')](function(_0x59ea3c){if(!_0x59ea3c){throw new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))](_0xbfa2('0xda'));}_0x4f6bd3=_[_0xbfa2('0xdb')](_['keys'](_0x59ea3c),[_0xbfa2('0xaa'),'updatedAt',_0xbfa2('0xdc'),_0xbfa2('0xb9')]);if(_0x3f4805['body']['id']){delete _0x3f4805['body']['id'];}if(_[_0xbfa2('0x93')](_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xa3')])){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))](_0xbfa2('0xde')));}if(_['isNil'](_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0x66')])||_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0x66')]===''){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xbfa2('0x93')](_0x3f4805['body'][_0xbfa2('0xdf')])){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db['Sequelize'][(_0xbfa2('0xd9'))](_0xbfa2('0xe0')+_0x4f6bd3));}if(!_[_0xbfa2('0xac')](_0x4f6bd3,_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xdf')])){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))](_0xbfa2('0xe1')+_0x4f6bd3));}_0x26b11c[_0x3f4805['body'][_0xbfa2('0xdf')]]=_0x3f4805['body']['from'];})[_0xbfa2('0x2f')](function(){return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x3f4805[_0xbfa2('0x62')]['id']},'include':[{'model':db[_0xbfa2('0xae')],'as':'List'},{'model':db[_0xbfa2('0xe2')],'as':_0xbfa2('0xe2')}]});})[_0xbfa2('0x2f')](handleEntityNotFound(_0x776092,null))['then'](function(_0x34eda4){if(_0x34eda4&&_0x34eda4[_0xbfa2('0xb8')]){_0x2a2f9a=_0x34eda4;var _0x2ef589=_[_0xbfa2('0xe3')](_0x3f4805[_0xbfa2('0x66')],{'firstName':_0x3f4805['body'][_0xbfa2('0xa3')],'phone':_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xa3')],'ListId':_0x34eda4[_0xbfa2('0xb9')]});_0x2ef589[_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xdf')]]=_0x3f4805['body']['from'];return db[_0xbfa2('0xa8')][_0xbfa2('0xe4')]({'where':_0x26b11c,'defaults':_0x2ef589});}})['spread'](function(_0x1f9ba3){if(_0x1f9ba3){_0xbe9477=_0x1f9ba3;var _0x36e465=fs[_0xbfa2('0xe5')](path[_0xbfa2('0x8d')](config['root'],_0xbfa2('0xe6')),_0xbfa2('0xe7'));var _0x2691cd=ejs[_0xbfa2('0xe8')](_0x36e465,{'body':_[_0xbfa2('0xe9')](_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0x66')]),'bodyTitle':_0x2a2f9a[_0xbfa2('0xea')]});return db[_0xbfa2('0xeb')]['create']({'body':_0x2691cd,'plainBody':htmlToText[_0xbfa2('0xec')](_0x2691cd),'ContactId':_0x1f9ba3['id'],'ChatWebsiteId':_0x2a2f9a['id']});}})[_0xbfa2('0x2f')](function(_0x1eab9d){_0x24968b=_0x1eab9d;if(_0x43b517[_0xbfa2('0x55')]){var _0x1c1d16=_0x43b517['map'](function(_0x2b4733){return{'name':_0x2b4733[_0xbfa2('0xed')],'basename':_0x2b4733['filename'],'type':_0x2b4733[_0xbfa2('0xee')],'ChatOfflineMessageId':_0x1eab9d['id']};});_0x38bb2b=_0x1c1d16[_0xbfa2('0x4b')](_0x1c1df4=>{var _0x19d474={'filename':_0x1c1df4['name'],'path':path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0xef'),_0xbfa2('0xd7'),'attachments',_0xbfa2('0xf0'),_0x1c1df4[_0xbfa2('0xf1')])};return _0x19d474;});if(!_0x2a2f9a['openNewInteraction']){return db['sequelize'][_0xbfa2('0xf2')](function(_0x29340b){return db[_0xbfa2('0xf3')][_0xbfa2('0xf4')](_0x1c1d16,{'transaction':_0x29340b});});}}})[_0xbfa2('0x2f')](function(){if(_0x24968b){_0x230cbc=_0x24968b;return db[_0xbfa2('0xe2')][_0xbfa2('0x78')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbfa2('0xf5'),'raw':!![],'include':[{'model':db[_0xbfa2('0xf6')],'as':_0xbfa2('0xf6'),'raw':!![]}]}]});}})[_0xbfa2('0x2f')](function(_0x596ceb){if(_0x596ceb&&_0x596ceb['Smtp']&&_0x2a2f9a[_0xbfa2('0xf7')]&&_0x2a2f9a[_0xbfa2('0xf8')]){var _0x32aa8b=_0x596ceb[_0xbfa2('0xf9')]();return respondWithRpcPromise(_0xbfa2('0xfa'),_0xbfa2('0xfb'),{'account':_0x32aa8b,'message':{'from':util[_0xbfa2('0x41')](_0xbfa2('0xfc'),_0x596ceb[_0xbfa2('0x34')],_0x596ceb['email']||_0x596ceb[_0xbfa2('0xf5')][_0xbfa2('0x6b')]),'to':_0x2a2f9a['forwardOfflineAddress'],'subject':_0x2a2f9a[_0xbfa2('0xfd')],'html':_0x230cbc[_0xbfa2('0x66')],'attachments':_0x38bb2b}},client9003)['then'](function(){return _0x230cbc;})[_0xbfa2('0x60')](function(_0x419133){logger[_0xbfa2('0x25')](_0x419133);});}})[_0xbfa2('0x2f')](function(){if(_0x2a2f9a&&_0x2a2f9a['openNewInteraction']&&_0x2a2f9a[_0xbfa2('0xfe')]){var _0x5aa1fd=[];if(_0x43b517[_0xbfa2('0x55')]){_0x5aa1fd=_0x43b517[_0xbfa2('0x4b')](function(_0x319f1b){return{'name':_0x319f1b['originalname'],'basename':_0x319f1b['filename'],'type':_0x319f1b[_0xbfa2('0xee')],'ChatOfflineMessageId':_0x24968b['id']};});}var _0x48de8d;if(!_[_0xbfa2('0x93')](_0x2a2f9a['subjectOffline'])){var _0x12f6a3=_[_0xbfa2('0x4b')](_0x3f4805[_0xbfa2('0x66')],function(_0x3c7311){return _0x3c7311;});var _0x106a6a=_[_0xbfa2('0xff')](_0x12f6a3)[0x0];var _0x54bc10=_['mapValues'](_0x106a6a,function(_0x46c45b){return _0x46c45b;});_0x48de8d=_0x54bc10[0x1][_0x2a2f9a['subjectOffline']];}var _0xd721e8={'from':_0xbe9477['email'],'firstName':_0xbe9477[_0xbfa2('0x3b')],'lastName':_0xbe9477[_0xbfa2('0x3c')],'mapKey':_0xbfa2('0x100'),'message':{'from':_0xbe9477[_0xbfa2('0x100')],'to':_0x2a2f9a['MailAccount'][_0xbfa2('0x100')],'cc':'','subject':_[_0xbfa2('0x93')](_0x48de8d)?_0x2a2f9a[_0xbfa2('0xfd')]:_0x48de8d,'messageId':'','sentAt':new Date(),'attach':_0x5aa1fd['length'],'attachments':_0x5aa1fd,'originChannel':_0xbfa2('0x101'),'ChatWebsiteId':_0x2a2f9a['id'],'ChatOfflineMessageId':_0x230cbc['id'],'originTo':_0x2a2f9a[_0xbfa2('0xe2')][_0xbfa2('0x100')]},'body':_0x230cbc[_0xbfa2('0x66')]};var _0x5b8ebf={'account':{'id':_0x2a2f9a[_0xbfa2('0xfe')]},'body':_0xd721e8,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbfa2('0x102'),_0xbfa2('0x103'),_0x5b8ebf,client9001)['then'](function(){return _0x230cbc;})[_0xbfa2('0x60')](function(_0x4e7605){logger[_0xbfa2('0x25')](_0x4e7605);});}return;})[_0xbfa2('0x2f')](function(){if(_0x230cbc){return _0x230cbc;}})[_0xbfa2('0x2f')](respondWithResult(_0x776092,null))['catch'](function(){for(var _0x2cbdb1 of _0x43b517){var _0x28b56f=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0xef'),'files','attachments',_0xbfa2('0xf0'),_0x2cbdb1[_0xbfa2('0x88')]);fs_extra[_0xbfa2('0x104')](_0x28b56f)['catch'](function(_0x560496){logger['error'](_0xbfa2('0x105'),_0x28b56f,_0x560496);});}});};exports[_0xbfa2('0x106')]=function(_0x9201cf,_0x55a754){return db[_0xbfa2('0xbf')][_0xbfa2('0x64')]({'where':{'id':_0x9201cf[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x55a754,null))[_0xbfa2('0x2f')](function(_0x1c1fb9){if(_0x1c1fb9){return _0x1c1fb9[_0xbfa2('0x106')](_0x9201cf['body'][_0xbfa2('0x7f')],_[_0xbfa2('0x107')](_0x9201cf['body'],[_0xbfa2('0x7f'),'id'])||{});}})['then'](respondWithResult(_0x55a754,null))['catch'](handleError(_0x55a754,null));};exports[_0xbfa2('0x108')]=function(_0x5704ec,_0x351b76){var _0x23d4ea={'raw':![],'where':{}};var _0x5a62e6={};var _0x428800={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x5704ec['params']['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x351b76,null))['then'](function(_0x522e82){if(_0x522e82){_0x5a62e6[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0xbf')]['rawAttributes']);_0x5a62e6[_0xbfa2('0x50')]=_['keys'](_0x5704ec[_0xbfa2('0x50')]);_0x5a62e6[_0xbfa2('0x51')]=_['intersection'](_0x5a62e6['model'],_0x5a62e6['query']);_0x23d4ea[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x5a62e6[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x53')]));_0x23d4ea[_0xbfa2('0x54')]=_0x23d4ea[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x23d4ea[_0xbfa2('0x54')]:_0x5a62e6[_0xbfa2('0x44')];if(!_0x5704ec[_0xbfa2('0x50')]['hasOwnProperty'](_0xbfa2('0x79'))){_0x23d4ea[_0xbfa2('0x2d')]=qs['limit'](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x23d4ea['offset']=qs[_0xbfa2('0x2b')](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x2b')]);}_0x23d4ea[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x23d4ea[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_[_0xbfa2('0x7a')](_0x5704ec[_0xbfa2('0x50')],_0x5a62e6[_0xbfa2('0x51')]));_0x23d4ea[_0xbfa2('0x59')][_0xbfa2('0x76')]=_0x522e82['id'];if(_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x5a')]){_0x23d4ea[_0xbfa2('0x59')]=_['merge'](_0x23d4ea[_0xbfa2('0x59')],{'$or':_[_0xbfa2('0x4b')](_0x23d4ea[_0xbfa2('0x54')],function(_0x54a76b){var _0x1f0e96={};_0x1f0e96[_0x54a76b]={'$like':'%'+_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x1f0e96;})});}_0x23d4ea=_[_0xbfa2('0x5c')]({},_0x23d4ea,_0x5704ec[_0xbfa2('0x5d')]);return db[_0xbfa2('0xbf')][_0xbfa2('0x2e')]({'where':_0x23d4ea[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x2a080b){_0x428800[_0xbfa2('0x2e')]=_0x2a080b;if(_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x23d4ea['include']=[{'model':db[_0xbfa2('0xa8')],'as':_0xbfa2('0x109'),'required':![]},{'model':db[_0xbfa2('0xcc')],'as':_0xbfa2('0x10a'),'attributes':[_0xbfa2('0x34'),'fullname',_0xbfa2('0x10b')],'required':![]},{'model':db['Tag'],'as':_0xbfa2('0x10c'),'attributes':['id',_0xbfa2('0x34'),_0xbfa2('0x10d')],'where':_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x10e')]?{'id':_0x5704ec[_0xbfa2('0x50')]['tag']}:undefined,'required':_0x5704ec['query']['tag']?!![]:![]}];}return db[_0xbfa2('0xbf')][_0xbfa2('0x7d')](_0x23d4ea);})['then'](function(_0x5e4edc){_0x428800[_0xbfa2('0x5f')]=_0x5e4edc;return _0x428800;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x351b76,_0x23d4ea))[_0xbfa2('0x60')](handleError(_0x351b76,null));};exports[_0xbfa2('0x10f')]=function(_0x10c637,_0x3043ad){var _0x56532e=0x0;var _0x2e6220=0x0;var _0x2d97f5=![];var _0x391ee0;var _0x1a4931;return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x10c637[_0xbfa2('0x62')]['id']},'include':[{'model':db[_0xbfa2('0x9f')],'as':_0xbfa2('0x9f'),'include':[{'model':db[_0xbfa2('0x9f')],'as':_0xbfa2('0x110'),'attributes':['id',_0xbfa2('0xb1')]}]}]})[_0xbfa2('0x2f')](handleEntityNotFound(_0x3043ad,null))[_0xbfa2('0x2f')](function(_0x1802ae){if(_0x1802ae){_0x391ee0=_0x1802ae;return _0x1802ae['getProactiveActions']({'raw':!![]});}})[_0xbfa2('0x2f')](function(_0x16bf90){if(_0x391ee0){if(_0x16bf90){_0x1a4931=_0x16bf90;}}return require('../../config/license/util')[_0xbfa2('0x92')]();})[_0xbfa2('0x2f')](function(_0x303d04){if(_0x303d04){_0x2e6220=_0x303d04['virtual'];_0x2d97f5=_0x303d04[_0xbfa2('0x111')];}})[_0xbfa2('0x2f')](function(){return db['ChatInteraction'][_0xbfa2('0x2e')]({'where':{'closed':![]}});})['then'](function(_0x39584d){_0x56532e=_0x39584d;if(_0x2e6220&&_0x39584d>_0x2e6220){return db[_0xbfa2('0x112')]['findOne']({'where':{'id':0x1}})[_0xbfa2('0x2f')](function(_0x3eadd8){if(_0x3eadd8){_0x3eadd8[_0xbfa2('0x113')]('chatLicenseExceeded');}});}})[_0xbfa2('0x2f')](function(){var _0x157ccf=_0x391ee0['Interval'];var _0x1da624=_0x391ee0[_0xbfa2('0x114')]||undefined;return _0x157ccf?_0x157ccf[_0xbfa2('0x115')](_0x1da624):!![];})[_0xbfa2('0x2f')](function(_0x2edfbf){var _0x2fbe1b=fs[_0xbfa2('0xe5')](path['join'](config[_0xbfa2('0x8e')],_0xbfa2('0x116')),_0xbfa2('0xe7'));var _0x4ecc5d=_0xbfa2('0x117');var _0x1db897=![];var _0x4caeb1,_0x34a958;if(_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x3e')]){_0x4caeb1=new URL(_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x3e')])[_0xbfa2('0x118')];}else if(_0x10c637['headers'][_0xbfa2('0x118')]){_0x4caeb1=new URL(_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x118')])['origin'];}else{_0x4caeb1=_0xbfa2('0x119');}_0x34a958=typeof _0x391ee0[_0xbfa2('0x67')]['split'](',')[_0xbfa2('0x64')](function(_0x535079){return wildcardUtils[_0xbfa2('0x11a')](_0x535079,_0x4caeb1);})!==_0xbfa2('0x2c');var _0x27cfe4={'chatVersion':_0x4ecc5d,'chatWebsiteAddressOrigin':_0x34a958?_0x4caeb1:_0x391ee0[_0xbfa2('0x67')],'remote':_0x391ee0[_0xbfa2('0x11b')],'query':querystring[_0xbfa2('0x48')](_['merge'](_0x391ee0[_0xbfa2('0x6c')]({'plain':!![]}),{'customerIp':_0x10c637[_0xbfa2('0xbc')]['x-forwarded-for']||_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x11c')]||_0x10c637['connection']['remoteAddress']||_0x10c637['ip'],'referer':_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x3e')],'openedInteractions':_0x56532e,'maxInteractions':_0x2e6220,'virtual':_0x2d97f5[_0xbfa2('0x11d')],'online':_0x2edfbf,'custom':_0x2d97f5,'address':_0x34a958?_0x4caeb1:null}))['replace'](/'/g,'\x5c\x27')};_0x3043ad['send'](ejs[_0xbfa2('0xe8')](Mustache[_0xbfa2('0xe8')](_0x2fbe1b,_0x27cfe4),{'proactiveActions':_0x1a4931,'alignment':_0x391ee0[_0xbfa2('0x11e')],'verticalAlignment':_0x391ee0[_0xbfa2('0x11f')],'div_color':_0x391ee0[_0xbfa2('0x10d')],'labelText':_0x391ee0[_0xbfa2('0x120')],'text_color':_0x391ee0[_0xbfa2('0x121')],'text_button_color':_0x391ee0[_0xbfa2('0x122')],'button_color':_0x391ee0['color_button'],'background_color':_0x391ee0[_0xbfa2('0x123')],'hideWhenOffline':_0x391ee0[_0xbfa2('0x124')],'intervalId':_0x391ee0[_0xbfa2('0x125')],'isDevelopment':_0x1db897,'chatVersion':_0x4ecc5d}));})['catch'](handleError(_0x3043ad,null));};exports[_0xbfa2('0x126')]=function(_0x20eef7,_0x23a94f){var _0x4e0d05=_0x20eef7['params']['id'];var _0x29aace=_0x20eef7[_0xbfa2('0x66')];var _0x3a7171=0xc8;var _0x24efd7=null;return db[_0xbfa2('0x127')][_0xbfa2('0xf2')]({'isolationLevel':db[_0xbfa2('0x127')][_0xbfa2('0x128')][_0xbfa2('0x129')][_0xbfa2('0x12a')]},function(_0x59a06b){return db['ChatWebsite'][_0xbfa2('0x78')]({'where':{'id':_0x4e0d05},'transaction':_0x59a06b})[_0xbfa2('0x2f')](function(_0x232e1a){if(_0x232e1a){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x4e0d05},'transaction':_0x59a06b})[_0xbfa2('0x2f')](function(){var _0x426936=_[_0xbfa2('0x4b')](_0x29aace,function(_0x16f24a){_0x16f24a[_0xbfa2('0x76')]=_0x4e0d05;return _0x16f24a;});return db[_0xbfa2('0x12b')]['bulkCreate'](_0x426936,{'transaction':_0x59a06b});});}else{_0x3a7171=0x194;_0x24efd7=[];}});})['then'](function(){if(_0x3a7171!==0x194){return db[_0xbfa2('0x12b')][_0xbfa2('0x12c')]({'where':{'ChatWebsiteId':_0x4e0d05},'order':_0xbfa2('0xb6')})[_0xbfa2('0x2f')](function(_0x251c7f){_0x24efd7=_0x251c7f;});}})[_0xbfa2('0x60')](function(_0x417090){_0x3a7171=0x1f4;logger[_0xbfa2('0x25')](_0x417090[_0xbfa2('0x33')]);if(_0x417090['name']){delete _0x417090[_0xbfa2('0x34')];}_0x24efd7=_0x417090;})[_0xbfa2('0x12d')](function(){if(_0x24efd7===null){_0x23a94f[_0xbfa2('0x28')](_0x3a7171);}else{if(_0x3a7171===0x1f4){_0x23a94f[_0xbfa2('0x2a')](_0x3a7171)[_0xbfa2('0xdd')](_0x24efd7);}else{_0x23a94f['status'](_0x3a7171)[_0xbfa2('0x12e')](_0x24efd7);}}});};exports[_0xbfa2('0x12f')]=function(_0x5418ad,_0x3c756f){var _0xa838b5={};var _0x4bd2dd={};var _0xfb3358;var _0x13d404;return db[_0xbfa2('0x4c')]['findOne']({'where':{'id':_0x5418ad[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x3c756f,null))['then'](function(_0x42ce7d){if(_0x42ce7d){_0xfb3358=_0x42ce7d;_0x4bd2dd[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0x12b')][_0xbfa2('0x4d')]);_0x4bd2dd[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x5418ad[_0xbfa2('0x50')]);_0x4bd2dd['filters']=_[_0xbfa2('0x52')](_0x4bd2dd[_0xbfa2('0x44')],_0x4bd2dd[_0xbfa2('0x50')]);_0xa838b5[_0xbfa2('0x54')]=_['intersection'](_0x4bd2dd[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x53')]));_0xa838b5[_0xbfa2('0x54')]=_0xa838b5[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0xa838b5[_0xbfa2('0x54')]:_0x4bd2dd['model'];_0xa838b5[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0xa838b5[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_[_0xbfa2('0x7a')](_0x5418ad[_0xbfa2('0x50')],_0x4bd2dd[_0xbfa2('0x51')]));if(_0x5418ad[_0xbfa2('0x50')]['filter']){_0xa838b5[_0xbfa2('0x59')]=_['merge'](_0xa838b5['where'],{'$or':_[_0xbfa2('0x4b')](_0xa838b5['attributes'],function(_0x4f0d33){var _0x1da0b9={};_0x1da0b9[_0x4f0d33]={'$like':'%'+_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x1da0b9;})});}_0xa838b5=_[_0xbfa2('0x5c')]({},_0xa838b5,_0x5418ad[_0xbfa2('0x5d')]);return _0xfb3358['getApplications'](_0xa838b5);}})[_0xbfa2('0x2f')](function(_0x2326da){if(_0x2326da){_0x13d404=_0x2326da[_0xbfa2('0x55')];if(!_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x56')]('nolimit')){_0xa838b5[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0xa838b5[_0xbfa2('0x2b')]=qs[_0xbfa2('0x2b')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x2b')]);}return _0xfb3358[_0xbfa2('0x12f')](_0xa838b5);}})[_0xbfa2('0x2f')](function(_0x8a5e17){if(_0x8a5e17){return _0x8a5e17?{'count':_0x13d404,'rows':_0x8a5e17}:null;}})[_0xbfa2('0x2f')](respondWithResult(_0x3c756f,null))[_0xbfa2('0x60')](handleError(_0x3c756f,null));};exports[_0xbfa2('0x130')]=function(_0x14015b,_0x23ce1b){return db[_0xbfa2('0x131')][_0xbfa2('0x64')]({'where':{'id':_0x14015b['params']['id']}})['then'](handleEntityNotFound(_0x23ce1b,null))[_0xbfa2('0x2f')](function(_0x26ae79){if(_0x26ae79){return _0x26ae79[_0xbfa2('0x130')](_0x14015b[_0xbfa2('0x66')]['ids'],_['omit'](_0x14015b[_0xbfa2('0x66')],[_0xbfa2('0x7f'),'id'])||{});}})[_0xbfa2('0x2f')](respondWithResult(_0x23ce1b,null))[_0xbfa2('0x60')](handleError(_0x23ce1b,null));};exports[_0xbfa2('0x132')]=function(_0x587b0c,_0x3c1962){var _0x136fe9={};var _0x4b338b={};var _0x1bb2ea;var _0x21f97d;return db['ChatWebsite'][_0xbfa2('0x78')]({'where':{'id':_0x587b0c['params']['id']}})['then'](handleEntityNotFound(_0x3c1962,null))['then'](function(_0x4e240f){if(_0x4e240f){_0x1bb2ea=_0x4e240f;_0x4b338b['model']=_[_0xbfa2('0x63')](db[_0xbfa2('0x133')][_0xbfa2('0x4d')]);_0x4b338b['query']=_[_0xbfa2('0x63')](_0x587b0c[_0xbfa2('0x50')]);_0x4b338b[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x4b338b[_0xbfa2('0x44')],_0x4b338b['query']);_0x136fe9[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x4b338b[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x53')]));_0x136fe9[_0xbfa2('0x54')]=_0x136fe9['attributes'][_0xbfa2('0x55')]?_0x136fe9[_0xbfa2('0x54')]:_0x4b338b[_0xbfa2('0x44')];_0x136fe9['order']=qs[_0xbfa2('0x58')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x136fe9[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_['pick'](_0x587b0c[_0xbfa2('0x50')],_0x4b338b[_0xbfa2('0x51')]));if(_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x5a')]){_0x136fe9[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x136fe9['where'],{'$or':_[_0xbfa2('0x4b')](_0x136fe9[_0xbfa2('0x54')],function(_0x357eea){var _0x4bebc9={};_0x4bebc9[_0x357eea]={'$like':'%'+_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x4bebc9;})});}_0x136fe9=_[_0xbfa2('0x5c')]({},_0x136fe9,_0x587b0c['options']);return _0x1bb2ea[_0xbfa2('0x132')](_0x136fe9);}})['then'](function(_0x5297d4){if(_0x5297d4){_0x21f97d=_0x5297d4[_0xbfa2('0x55')];if(!_0x587b0c['query'][_0xbfa2('0x56')]('nolimit')){_0x136fe9[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x136fe9[_0xbfa2('0x2b')]=qs[_0xbfa2('0x2b')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x2b')]);}return _0x1bb2ea[_0xbfa2('0x132')](_0x136fe9);}})[_0xbfa2('0x2f')](function(_0x25762e){if(_0x25762e){return _0x25762e?{'count':_0x21f97d,'rows':_0x25762e}:null;}})[_0xbfa2('0x2f')](respondWithResult(_0x3c1962,null))[_0xbfa2('0x60')](handleError(_0x3c1962,null));};exports[_0xbfa2('0x134')]=function(_0x20f848,_0x5b78d4){var _0x1e745e=_0x20f848['query'][_0xbfa2('0x135')]===_0xbfa2('0x136')?_0xbfa2('0x137'):_0xbfa2('0x138');return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'attributes':['id',_0x1e745e],'where':{'id':_0x20f848[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x5b78d4,null))[_0xbfa2('0x2f')](function(_0x46e94c){if(_0x46e94c){var _0x579c98=_0x46e94c[_0x1e745e];var _0x182f25=_0x579c98&&_0x579c98[_0xbfa2('0x139')]?_0x579c98[_0xbfa2('0x139')]:[];_0x5b78d4[_0xbfa2('0xdd')]({'fromKey':_[_0xbfa2('0x93')](_0x579c98[_0xbfa2('0x13a')])?undefined:_0x579c98[_0xbfa2('0x13a')],'count':_0x182f25[_0xbfa2('0x55')],'rows':_0x182f25});}})[_0xbfa2('0x60')](handleError(_0x5b78d4,null));};exports[_0xbfa2('0x13b')]=function(_0x5afa7d,_0x55e149){var _0x329122={'raw':![],'where':{}};var _0x40918b={};var _0x5ad658={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x5afa7d[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x55e149,null))['then'](function(_0x2d9044){if(_0x2d9044){_0x40918b[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0xeb')][_0xbfa2('0x4d')]);_0x40918b[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x5afa7d[_0xbfa2('0x50')]);_0x40918b[_0xbfa2('0x51')]=_['intersection'](_0x40918b[_0xbfa2('0x44')],_0x40918b[_0xbfa2('0x50')]);_0x329122['attributes']=_[_0xbfa2('0x52')](_0x40918b[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5afa7d[_0xbfa2('0x50')]['fields']));_0x329122[_0xbfa2('0x54')]=_0x329122[_0xbfa2('0x54')]['length']?_0x329122[_0xbfa2('0x54')]:_0x40918b[_0xbfa2('0x44')];if(!_0x5afa7d['query'][_0xbfa2('0x56')](_0xbfa2('0x79'))){_0x329122[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x5afa7d[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x329122[_0xbfa2('0x2b')]=qs[_0xbfa2('0x2b')](_0x5afa7d['query'][_0xbfa2('0x2b')]);}_0x329122[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x5afa7d[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x329122[_0xbfa2('0x59')]=qs['filters'](_[_0xbfa2('0x7a')](_0x5afa7d[_0xbfa2('0x50')],_0x40918b[_0xbfa2('0x51')]));_0x329122['where'][_0xbfa2('0x76')]=_0x2d9044['id'];if(_0x5afa7d[_0xbfa2('0x50')]['filter']){_0x329122[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x329122[_0xbfa2('0x59')],{'$or':_[_0xbfa2('0x4b')](_0x329122[_0xbfa2('0x54')],function(_0xaabda0){var _0x3bd993={};_0x3bd993[_0xaabda0]={'$like':'%'+_0x5afa7d['query'][_0xbfa2('0x5a')]+'%'};return _0x3bd993;})});}_0x329122=_['merge']({},_0x329122,_0x5afa7d['options']);return db[_0xbfa2('0xeb')][_0xbfa2('0x2e')]({'where':_0x329122[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x193c3e){_0x5ad658['count']=_0x193c3e;if(_0x5afa7d[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x329122[_0xbfa2('0x7c')]=[{'all':!![]}];}else{_0x329122['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0xbfa2('0x7d')](_0x329122);})[_0xbfa2('0x2f')](function(_0x11cba6){_0x5ad658[_0xbfa2('0x5f')]=_0x11cba6;return _0x5ad658;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x55e149,_0x329122))[_0xbfa2('0x60')](handleError(_0x55e149,null));};exports[_0xbfa2('0x13c')]=function(_0x505dc0,_0x19e869){return db[_0xbfa2('0x4c')]['find']({'where':{'id':_0x505dc0[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x19e869,null))[_0xbfa2('0x2f')](function(_0x16cfc4){if(_0x16cfc4){return _0x16cfc4[_0xbfa2('0x13c')](_0x505dc0[_0xbfa2('0x66')]['ids'],_[_0xbfa2('0x107')](_0x505dc0[_0xbfa2('0x66')],[_0xbfa2('0x7f'),'id'])||{})[_0xbfa2('0x13d')](function(_0x281f44){for(var _0x28458d=0x0;_0x28458d<_0x505dc0[_0xbfa2('0x66')][_0xbfa2('0x7f')][_0xbfa2('0x55')];_0x28458d+=0x1){socket['emit'](_0xbfa2('0x13e'),{'UserId':Number(_0x505dc0[_0xbfa2('0x66')][_0xbfa2('0x7f')][_0x28458d]),'ChatWebsiteId':Number(_0x505dc0['params']['id'])});}return _0x281f44;});}})[_0xbfa2('0x2f')](respondWithResult(_0x19e869,null))[_0xbfa2('0x60')](handleError(_0x19e869,null));};exports[_0xbfa2('0x13f')]=function(_0xb9e403,_0x4b62d1){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0xb9e403[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x4b62d1,null))[_0xbfa2('0x2f')](function(_0x41fbc2){if(_0x41fbc2){return _0x41fbc2['removeAgents'](_0xb9e403[_0xbfa2('0x50')][_0xbfa2('0x7f')])[_0xbfa2('0x2f')](function(){if(_[_0xbfa2('0x140')](_0xb9e403['query']['ids'])){for(var _0x2e146c=0x0;_0x2e146c<_0xb9e403[_0xbfa2('0x50')][_0xbfa2('0x7f')]['length'];_0x2e146c+=0x1){socket['emit'](_0xbfa2('0x141'),{'UserId':Number(_0xb9e403[_0xbfa2('0x50')][_0xbfa2('0x7f')][_0x2e146c]),'ChatWebsiteId':Number(_0xb9e403['params']['id'])});}}else{socket[_0xbfa2('0x142')](_0xbfa2('0x141'),{'UserId':Number(_0xb9e403['query']['ids']),'ChatWebsiteId':Number(_0xb9e403[_0xbfa2('0x62')]['id'])});}});}})[_0xbfa2('0x2f')](respondWithStatusCode(_0x4b62d1,null))[_0xbfa2('0x60')](handleError(_0x4b62d1,null));};exports[_0xbfa2('0x143')]=function(_0x5111ec,_0x25ed66){var _0x234360={};var _0x7abbda={};var _0x54a6de;var _0x46d92e;return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x5111ec[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x25ed66,null))[_0xbfa2('0x2f')](function(_0x29f310){if(_0x29f310){_0x54a6de=_0x29f310;_0x7abbda[_0xbfa2('0x44')]=_['keys'](db[_0xbfa2('0xcc')][_0xbfa2('0x4d')]);_0x7abbda[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x5111ec[_0xbfa2('0x50')]);_0x7abbda[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x7abbda[_0xbfa2('0x44')],_0x7abbda[_0xbfa2('0x50')]);_0x234360[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x7abbda[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5111ec['query'][_0xbfa2('0x53')]));_0x234360[_0xbfa2('0x54')]=_0x234360[_0xbfa2('0x54')]['length']?_0x234360[_0xbfa2('0x54')]:_0x7abbda[_0xbfa2('0x44')];_0x234360['order']=qs[_0xbfa2('0x58')](_0x5111ec[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x234360[_0xbfa2('0x59')]=qs['filters'](_['pick'](_0x5111ec[_0xbfa2('0x50')],_0x7abbda['filters']));if(_0x5111ec[_0xbfa2('0x50')][_0xbfa2('0x5a')]){_0x234360[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x234360['where'],{'$or':_['map'](_0x234360[_0xbfa2('0x54')],function(_0xc75a24){var _0x202631={};_0x202631[_0xc75a24]={'$like':'%'+_0x5111ec['query'][_0xbfa2('0x5a')]+'%'};return _0x202631;})});}_0x234360=_['merge']({},_0x234360,_0x5111ec[_0xbfa2('0x5d')]);return _0x54a6de[_0xbfa2('0x143')](_0x234360);}})[_0xbfa2('0x2f')](function(_0x21b3d2){if(_0x21b3d2){_0x46d92e=_0x21b3d2['length'];if(!_0x5111ec[_0xbfa2('0x50')][_0xbfa2('0x56')]('nolimit')){_0x234360[_0xbfa2('0x2d')]=qs['limit'](_0x5111ec['query'][_0xbfa2('0x2d')]);_0x234360['offset']=qs['offset'](_0x5111ec[_0xbfa2('0x50')]['offset']);}return _0x54a6de[_0xbfa2('0x143')](_0x234360);}})[_0xbfa2('0x2f')](function(_0x4ca95c){if(_0x4ca95c){return _0x4ca95c?{'count':_0x46d92e,'rows':_0x4ca95c}:null;}})['then'](respondWithResult(_0x25ed66,null))[_0xbfa2('0x60')](handleError(_0x25ed66,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 219bf84..767276d 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 _0x86dd=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x4a12c2,_0x19f176){var _0x297f9f=function(_0x5df143){while(--_0x5df143){_0x4a12c2['push'](_0x4a12c2['shift']());}};_0x297f9f(++_0x19f176);}(_0x86dd,0x1ee));var _0xd86d=function(_0x5b48dc,_0x39c416){_0x5b48dc=_0x5b48dc-0x0;var _0x48031c=_0x86dd[_0x5b48dc];return _0x48031c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xd86d('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd86d('0x1')](0x0);var events={'afterCreate':_0xd86d('0x2'),'afterUpdate':_0xd86d('0x3'),'afterDestroy':_0xd86d('0x4')};function emitEvent(_0x17237d){return function(_0x30a31c,_0x2e82a9,_0x240531){ChatWebsiteEvents[_0xd86d('0x5')](_0x17237d+':'+_0x30a31c['id'],_0x30a31c);ChatWebsiteEvents[_0xd86d('0x5')](_0x17237d,_0x30a31c);_0x240531(null);};}for(var e in events){if(events[_0xd86d('0x6')](e)){var event=events[e];ChatWebsite[_0xd86d('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xca9e=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x275a19,_0x310d3a){var _0x37b693=function(_0x3048df){while(--_0x3048df){_0x275a19['push'](_0x275a19['shift']());}};_0x37b693(++_0x310d3a);}(_0xca9e,0x136));var _0xeca9=function(_0x5f6980,_0x144ad4){_0x5f6980=_0x5f6980-0x0;var _0xcb091a=_0xca9e[_0x5f6980];return _0xcb091a;};'use strict';var EventEmitter=require(_0xeca9('0x0'));var ChatWebsite=require(_0xeca9('0x1'))['db'][_0xeca9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xeca9('0x3')](0x0);var events={'afterCreate':_0xeca9('0x4'),'afterUpdate':_0xeca9('0x5'),'afterDestroy':_0xeca9('0x6')};function emitEvent(_0x2c6185){return function(_0x1b2864,_0x1e0a18,_0x3aba81){ChatWebsiteEvents[_0xeca9('0x7')](_0x2c6185+':'+_0x1b2864['id'],_0x1b2864);ChatWebsiteEvents[_0xeca9('0x7')](_0x2c6185,_0x1b2864);_0x3aba81(null);};}for(var e in events){if(events[_0xeca9('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xeca9('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 566bd0e..0878079 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 _0xbf2b=['chat_websites','lodash','api','moment','request-promise','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x5dfb25,_0x31f4bd){var _0x3c16f7=function(_0x2cbc6b){while(--_0x2cbc6b){_0x5dfb25['push'](_0x5dfb25['shift']());}};_0x3c16f7(++_0x31f4bd);}(_0xbf2b,0xc7));var _0xbbf2=function(_0x59bd24,_0xdde327){_0x59bd24=_0x59bd24-0x0;var _0x41384a=_0xbf2b[_0x59bd24];return _0x41384a;};'use strict';var _=require(_0xbbf2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbbf2('0x1'));var moment=require(_0xbbf2('0x2'));var BPromise=require('bluebird');var rp=require(_0xbbf2('0x3'));var fs=require('fs');var path=require(_0xbbf2('0x4'));var rimraf=require('rimraf');var config=require(_0xbbf2('0x5'));var attributes=require(_0xbbf2('0x6'));module[_0xbbf2('0x7')]=function(_0x453847,_0x1de326){return _0x453847['define']('ChatWebsite',attributes,{'tableName':_0xbbf2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bf2=['lodash','util','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x3d30d5,_0x4f767c){var _0x2ff33f=function(_0x10c7da){while(--_0x10c7da){_0x3d30d5['push'](_0x3d30d5['shift']());}};_0x2ff33f(++_0x4f767c);}(_0x7bf2,0x197));var _0x27bf=function(_0x1d997d,_0x35df68){_0x1d997d=_0x1d997d-0x0;var _0x4d0d9a=_0x7bf2[_0x1d997d];return _0x4d0d9a;};'use strict';var _=require(_0x27bf('0x0'));var util=require(_0x27bf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x27bf('0x2'));var BPromise=require(_0x27bf('0x3'));var rp=require(_0x27bf('0x4'));var fs=require('fs');var path=require(_0x27bf('0x5'));var rimraf=require(_0x27bf('0x6'));var config=require('../../config/environment');var attributes=require(_0x27bf('0x7'));module['exports']=function(_0x499b06,_0x3311fb){return _0x499b06[_0x27bf('0x8')](_0x27bf('0x9'),attributes,{'tableName':_0x27bf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 2e6f1d7..f5b387b 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 _0x2916=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c166f,_0xa0dbc4){var _0x5cbaeb=function(_0x5a1af0){while(--_0x5a1af0){_0x3c166f['push'](_0x3c166f['shift']());}};_0x5cbaeb(++_0xa0dbc4);}(_0x2916,0xac));var _0x6291=function(_0x308ddd,_0x3a8401){_0x308ddd=_0x308ddd-0x0;var _0x3224c3=_0x2916[_0x308ddd];return _0x3224c3;};'use strict';var _=require(_0x6291('0x0'));var util=require(_0x6291('0x1'));var moment=require(_0x6291('0x2'));var BPromise=require('bluebird');var rs=require(_0x6291('0x3'));var fs=require('fs');var Redis=require(_0x6291('0x4'));var db=require(_0x6291('0x5'))['db'];var utils=require(_0x6291('0x6'));var logger=require(_0x6291('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6291('0x8'));var client=jayson[_0x6291('0x9')][_0x6291('0xa')]({'port':0x232a});config['redis']=_[_0x6291('0xb')](config[_0x6291('0xc')],{'host':_0x6291('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6291('0xc')]));require(_0x6291('0xe'))[_0x6291('0xf')](socket);function respondWithRpcPromise(_0x47dc8b,_0x550ef2,_0x6fef8d){return new BPromise(function(_0x3c9bb2,_0x786721){return client['request'](_0x47dc8b,_0x6fef8d)[_0x6291('0x10')](function(_0x5eeec6){logger[_0x6291('0x11')](_0x6291('0x12'),_0x550ef2,_0x6291('0x13'));logger[_0x6291('0x14')](_0x6291('0x15'),_0x550ef2,_0x6291('0x13'),JSON[_0x6291('0x16')](_0x5eeec6));if(_0x5eeec6[_0x6291('0x17')]){if(_0x5eeec6['error'][_0x6291('0x18')]===0x1f4){logger[_0x6291('0x17')](_0x6291('0x12'),_0x550ef2,_0x5eeec6[_0x6291('0x17')]['message']);return _0x786721(_0x5eeec6[_0x6291('0x17')][_0x6291('0x19')]);}logger[_0x6291('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x550ef2,_0x5eeec6[_0x6291('0x17')][_0x6291('0x19')]);return _0x3c9bb2(_0x5eeec6[_0x6291('0x17')][_0x6291('0x19')]);}else{logger[_0x6291('0x11')](_0x6291('0x12'),_0x550ef2,_0x6291('0x13'));_0x3c9bb2(_0x5eeec6[_0x6291('0x1a')][_0x6291('0x19')]);}})[_0x6291('0x1b')](function(_0xf431d7){logger[_0x6291('0x17')](_0x6291('0x12'),_0x550ef2,_0xf431d7);_0x786721(_0xf431d7);});});} \ No newline at end of file +var _0x8823=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x10cf03,_0x5e1bdd){var _0x2b8be8=function(_0x1bb1a7){while(--_0x1bb1a7){_0x10cf03['push'](_0x10cf03['shift']());}};_0x2b8be8(++_0x5e1bdd);}(_0x8823,0x194));var _0x3882=function(_0x308a1b,_0x457867){_0x308a1b=_0x308a1b-0x0;var _0x50fd46=_0x8823[_0x308a1b];return _0x50fd46;};'use strict';var _=require(_0x3882('0x0'));var util=require(_0x3882('0x1'));var moment=require(_0x3882('0x2'));var BPromise=require(_0x3882('0x3'));var rs=require(_0x3882('0x4'));var fs=require('fs');var Redis=require(_0x3882('0x5'));var db=require(_0x3882('0x6'))['db'];var utils=require(_0x3882('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3882('0x8'));var jayson=require(_0x3882('0x9'));var client=jayson[_0x3882('0xa')][_0x3882('0xb')]({'port':0x232a});config[_0x3882('0xc')]=_[_0x3882('0xd')](config['redis'],{'host':_0x3882('0xe'),'port':0x18eb});var socket=require(_0x3882('0xf'))(new Redis(config['redis']));require(_0x3882('0x10'))['register'](socket);function respondWithRpcPromise(_0x4caac8,_0x330abf,_0xc607eb){return new BPromise(function(_0xfc04e3,_0x39a3cb){return client[_0x3882('0x11')](_0x4caac8,_0xc607eb)[_0x3882('0x12')](function(_0x2b363a){logger[_0x3882('0x13')](_0x3882('0x14'),_0x330abf,'request\x20sent');logger[_0x3882('0x15')](_0x3882('0x16'),_0x330abf,_0x3882('0x17'),JSON[_0x3882('0x18')](_0x2b363a));if(_0x2b363a[_0x3882('0x19')]){if(_0x2b363a[_0x3882('0x19')][_0x3882('0x1a')]===0x1f4){logger['error'](_0x3882('0x14'),_0x330abf,_0x2b363a[_0x3882('0x19')][_0x3882('0x1b')]);return _0x39a3cb(_0x2b363a[_0x3882('0x19')]['message']);}logger[_0x3882('0x19')](_0x3882('0x14'),_0x330abf,_0x2b363a[_0x3882('0x19')]['message']);return _0xfc04e3(_0x2b363a[_0x3882('0x19')][_0x3882('0x1b')]);}else{logger[_0x3882('0x13')](_0x3882('0x14'),_0x330abf,'request\x20sent');_0xfc04e3(_0x2b363a['result'][_0x3882('0x1b')]);}})[_0x3882('0x1c')](function(_0x4ea910){logger[_0x3882('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x330abf,_0x4ea910);_0x39a3cb(_0x4ea910);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index feaa03b..40a7d09 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 _0xc47e=['register','length','chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener'];(function(_0x16a9ea,_0x5ace14){var _0x550439=function(_0x33506b){while(--_0x33506b){_0x16a9ea['push'](_0x16a9ea['shift']());}};_0x550439(++_0x5ace14);}(_0xc47e,0x12b));var _0xec47=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xc47e[_0x3a7a9c];return _0x59156e;};'use strict';var ChatWebsiteEvents=require(_0xec47('0x0'));var events=['save',_0xec47('0x1'),_0xec47('0x2')];function createListener(_0x14372f,_0x396843){return function(_0x1849fb){_0x396843[_0xec47('0x3')](_0x14372f,_0x1849fb);};}function removeListener(_0x439bae,_0x387d60){return function(){ChatWebsiteEvents[_0xec47('0x4')](_0x439bae,_0x387d60);};}exports[_0xec47('0x5')]=function(_0xc2527){for(var _0x460ba6=0x0,_0x4ed49c=events[_0xec47('0x6')];_0x460ba6<_0x4ed49c;_0x460ba6++){var _0x52e164=events[_0x460ba6];var _0x5a89c7=createListener(_0xec47('0x7')+_0x52e164,_0xc2527);ChatWebsiteEvents['on'](_0x52e164,_0x5a89c7);}}; \ No newline at end of file +var _0xd4b4=['register','length','save','remove','update'];(function(_0x3f9455,_0x44a884){var _0xbef00=function(_0x158c09){while(--_0x158c09){_0x3f9455['push'](_0x3f9455['shift']());}};_0xbef00(++_0x44a884);}(_0xd4b4,0x1b5));var _0x4d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x4d4b('0x0'),_0x4d4b('0x1'),_0x4d4b('0x2')];function createListener(_0x51e872,_0x2cebe5){return function(_0x58e288){_0x2cebe5['emit'](_0x51e872,_0x58e288);};}function removeListener(_0x302546,_0x33ca05){return function(){ChatWebsiteEvents['removeListener'](_0x302546,_0x33ca05);};}exports[_0x4d4b('0x3')]=function(_0x3c62d6){for(var _0x10c694=0x0,_0x316a0d=events[_0x4d4b('0x4')];_0x10c694<_0x316a0d;_0x10c694++){var _0x1b984f=events[_0x10c694];var _0x363bbb=createListener('chatWebsite:'+_0x1b984f,_0x3c62d6);ChatWebsiteEvents['on'](_0x1b984f,_0x363bbb);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index b809393..63df001 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09df=['test','trim','([\x5cw]+)','localhost','exports','../../../utils/misc','escapeRegExp','URL','replace'];(function(_0x3e4a3f,_0x3c2f2a){var _0x130e52=function(_0x5bd122){while(--_0x5bd122){_0x3e4a3f['push'](_0x3e4a3f['shift']());}};_0x130e52(++_0x3c2f2a);}(_0x09df,0x164));var _0xf09d=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x09df[_0x3511d3];return _0x5d6321;};var escapeRegExp=require(_0xf09d('0x0'))[_0xf09d('0x1')];var URL=require('url')[_0xf09d('0x2')];function testWildcardValidity(_0x55478e){var _0x5bbc52=!![];try{new URL(_0x55478e[_0xf09d('0x3')]('*','localhost'));}catch(_0x4b4911){_0x5bbc52=![];}return _0x5bbc52&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xf09d('0x4')](_0x55478e);}function testWebsiteWithWildcard(_0x436673,_0x4df47c){var _0x4db4e7;var _0x4b452b=escapeRegExp(_0x436673[_0xf09d('0x5')]()['replace'](/\/$/,''))[_0xf09d('0x3')]('\x5c*',_0xf09d('0x6'));try{new URL(_0x436673[_0xf09d('0x3')]('\x5c*',_0xf09d('0x7')));_0x4db4e7=new RegExp(_0x4b452b)[_0xf09d('0x4')](_0x4df47c);}catch(_0x2a59a8){_0x4db4e7=![];}return _0x4db4e7;}module[_0xf09d('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0xb91a=['test','escapeRegExp','url','URL','replace','localhost'];(function(_0x54efc0,_0x5aeea2){var _0x2df0eb=function(_0x2ec005){while(--_0x2ec005){_0x54efc0['push'](_0x54efc0['shift']());}};_0x2df0eb(++_0x5aeea2);}(_0xb91a,0xe5));var _0xab91=function(_0x13ab0a,_0x1c71ae){_0x13ab0a=_0x13ab0a-0x0;var _0xd3cd5f=_0xb91a[_0x13ab0a];return _0xd3cd5f;};var escapeRegExp=require('../../../utils/misc')[_0xab91('0x0')];var URL=require(_0xab91('0x1'))[_0xab91('0x2')];function testWildcardValidity(_0x182972){var _0x485c32=!![];try{new URL(_0x182972[_0xab91('0x3')]('*',_0xab91('0x4')));}catch(_0x53c757){_0x485c32=![];}return _0x485c32&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xab91('0x5')](_0x182972);}function testWebsiteWithWildcard(_0x4ec84d,_0x54c9f4){var _0x1f99d4;var _0x1cce1e=escapeRegExp(_0x4ec84d['trim']()[_0xab91('0x3')](/\/$/,''))[_0xab91('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x4ec84d[_0xab91('0x3')]('\x5c*',_0xab91('0x4')));_0x1f99d4=new RegExp(_0x1cce1e)['test'](_0x54c9f4);}catch(_0x5765fc){_0x1f99d4=![];}return _0x1f99d4;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index fb61c27..a830be3 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 _0x85c2=['attachments','offline-chat','ensureDir','replace','extname','offline','addInteraction','addApplications','addAgents','put','/:id','update','delete','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getDispositions','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','server/files/images/logos/','now','originalname','server/files/images/avatars/','format','%s-%s','/:id/avatar','file','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x85c2,0x1b4));var _0x285c=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x85c2[_0x455c6c];return _0x488242;};'use strict';var multer=require(_0x285c('0x0'));var util=require(_0x285c('0x1'));var path=require(_0x285c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x285c('0x3')]();var fs_extra=require(_0x285c('0x4'));var auth=require(_0x285c('0x5'));var interaction=require(_0x285c('0x6'));var config=require(_0x285c('0x7'));var controller=require('./chatWebsite.controller');router[_0x285c('0x8')]('/',auth[_0x285c('0x9')](),controller[_0x285c('0xa')]);router[_0x285c('0x8')](_0x285c('0xb'),auth[_0x285c('0x9')](),controller[_0x285c('0xc')]);router[_0x285c('0x8')]('/:id',auth[_0x285c('0x9')](),controller['show']);router['get']('/:id/dispositions',auth[_0x285c('0x9')](),controller[_0x285c('0xd')]);router[_0x285c('0x8')]('/:id/canned_answers',auth[_0x285c('0x9')](),controller['getAnswers']);router[_0x285c('0x8')](_0x285c('0xe'),controller[_0x285c('0xf')]);router[_0x285c('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x285c('0x8')](_0x285c('0x10'),controller[_0x285c('0x11')]);router[_0x285c('0x8')](_0x285c('0x12'),controller[_0x285c('0x13')]);router[_0x285c('0x8')](_0x285c('0x14'),auth[_0x285c('0x9')](),controller[_0x285c('0x15')]);router[_0x285c('0x8')](_0x285c('0x16'),controller['getSnippet']);router[_0x285c('0x8')](_0x285c('0x17'),auth[_0x285c('0x9')](),controller[_0x285c('0x18')]);router['get'](_0x285c('0x19'),auth[_0x285c('0x9')](),controller[_0x285c('0x1a')]);router['get'](_0x285c('0x1b'),controller[_0x285c('0x1c')]);router['get'](_0x285c('0x1d'),auth['isAuthenticated'](),controller[_0x285c('0x1e')]);router['get'](_0x285c('0x1f'),auth[_0x285c('0x9')](),controller[_0x285c('0x20')]);router[_0x285c('0x21')]('/',auth[_0x285c('0x9')](),controller[_0x285c('0x22')]);router[_0x285c('0x21')](_0x285c('0x23'),auth[_0x285c('0x9')](),controller['addDisposition']);router[_0x285c('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x285c('0x24')]);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x1099b7,_0x1a3e5f,_0x96d052){_0x96d052(null,path[_0x285c('0x26')](config[_0x285c('0x27')],_0x285c('0x28')));},'filename':function(_0x15b2a3,_0xa927a8,_0x29b038){_0x29b038(null,util['format']('%s-%s',Date[_0x285c('0x29')](),_0xa927a8[_0x285c('0x2a')]));}})});router['post'](_0x285c('0xe'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x14c802,_0x413ccb,_0x22ba23){_0x22ba23(null,path['join'](config['root'],_0x285c('0x2b')));},'filename':function(_0x149d95,_0x17a06d,_0x56f7fd){_0x56f7fd(null,util[_0x285c('0x2c')](_0x285c('0x2d'),Date[_0x285c('0x29')](),_0x17a06d[_0x285c('0x2a')]));}})});router[_0x285c('0x21')](_0x285c('0x2e'),upload['single'](_0x285c('0x2f')),controller[_0x285c('0x30')]);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x594534,_0x3311d5,_0x3de0c4){_0x3de0c4(null,path[_0x285c('0x26')](config[_0x285c('0x27')],'server/files/images/avatars/'));},'filename':function(_0x5d5769,_0x2275c5,_0x18641f){_0x18641f(null,util['format'](_0x285c('0x2d'),Date[_0x285c('0x29')](),_0x2275c5['originalname']));}})});router['post'](_0x285c('0x10'),upload[_0x285c('0x31')](_0x285c('0x2f')),controller[_0x285c('0x32')]);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x238429,_0x5a30e3,_0x21518f){_0x21518f(null,path[_0x285c('0x26')](config[_0x285c('0x27')],_0x285c('0x2b')));},'filename':function(_0x34a752,_0x57683c,_0x66048e){_0x66048e(null,util[_0x285c('0x2c')](_0x285c('0x2d'),Date[_0x285c('0x29')](),_0x57683c[_0x285c('0x2a')]));}})});router[_0x285c('0x21')]('/:id/system_avatar',upload[_0x285c('0x31')](_0x285c('0x2f')),controller[_0x285c('0x33')]);router[_0x285c('0x21')](_0x285c('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x54e831,_0x217fd4,_0x43c755){const _0x1c3590=path['join'](config[_0x285c('0x27')],_0x285c('0x35'),_0x285c('0x36'),_0x285c('0x37'));fs_extra[_0x285c('0x38')](_0x1c3590,function(){_0x43c755(null,_0x1c3590);});},'filename':function(_0xa68a0f,_0x2cfbbe,_0x28b885){const _0x4dc70a=_0x2cfbbe['originalname'][_0x285c('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2b3db9=path[_0x285c('0x3a')](_0x4dc70a);const _0x4f9ae8=Date[_0x285c('0x29')]()+'-'+_0x4dc70a['replace'](_0x2b3db9,'')+_0x2b3db9;_0x28b885(null,_0x4f9ae8);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0x285c('0x3b')]);router[_0x285c('0x21')](_0x285c('0x14'),auth['isAuthenticated'](),controller[_0x285c('0x3c')]);router[_0x285c('0x21')]('/:id/applications',auth[_0x285c('0x9')](),controller[_0x285c('0x3d')]);router[_0x285c('0x21')]('/:id/proactive_actions',auth[_0x285c('0x9')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x285c('0x9')](),controller[_0x285c('0x3e')]);router[_0x285c('0x3f')](_0x285c('0x40'),auth[_0x285c('0x9')](),controller[_0x285c('0x41')]);router[_0x285c('0x42')](_0x285c('0x40'),auth[_0x285c('0x9')](),controller['destroy']);router[_0x285c('0x42')]('/:id/dispositions',auth[_0x285c('0x9')](),controller['removeDispositions']);router[_0x285c('0x42')]('/:id/canned_answers',auth[_0x285c('0x9')](),controller[_0x285c('0x43')]);router['delete'](_0x285c('0x1f'),auth[_0x285c('0x9')](),controller[_0x285c('0x44')]);module[_0x285c('0x45')]=router; \ No newline at end of file +var _0x00fb=['get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','server/files/images/avatars/','single','file','addCustomerAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','./chatWebsite.controller'];(function(_0x371d15,_0xd98587){var _0x32afdf=function(_0x587ba3){while(--_0x587ba3){_0x371d15['push'](_0x371d15['shift']());}};_0x32afdf(++_0xd98587);}(_0x00fb,0xc3));var _0xb00f=function(_0x69b0bf,_0x248a70){_0x69b0bf=_0x69b0bf-0x0;var _0x53a201=_0x00fb[_0x69b0bf];return _0x53a201;};'use strict';var multer=require(_0xb00f('0x0'));var util=require(_0xb00f('0x1'));var path=require('path');var timeout=require(_0xb00f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb00f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb00f('0x4'));var config=require('../../config/environment');var controller=require(_0xb00f('0x5'));router[_0xb00f('0x6')]('/',auth[_0xb00f('0x7')](),controller['index']);router[_0xb00f('0x6')]('/describe',auth[_0xb00f('0x7')](),controller[_0xb00f('0x8')]);router[_0xb00f('0x6')](_0xb00f('0x9'),auth[_0xb00f('0x7')](),controller[_0xb00f('0xa')]);router[_0xb00f('0x6')](_0xb00f('0xb'),auth[_0xb00f('0x7')](),controller[_0xb00f('0xc')]);router[_0xb00f('0x6')](_0xb00f('0xd'),auth['isAuthenticated'](),controller[_0xb00f('0xe')]);router['get'](_0xb00f('0xf'),controller['getLogo']);router[_0xb00f('0x6')](_0xb00f('0x10'),controller[_0xb00f('0x11')]);router[_0xb00f('0x6')](_0xb00f('0x12'),controller[_0xb00f('0x13')]);router['get'](_0xb00f('0x14'),controller[_0xb00f('0x15')]);router['get'](_0xb00f('0x16'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x17')]);router[_0xb00f('0x6')](_0xb00f('0x18'),controller['getSnippet']);router[_0xb00f('0x6')](_0xb00f('0x19'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x1a')]);router['get'](_0xb00f('0x1b'),auth[_0xb00f('0x7')](),controller['getProactiveActions']);router[_0xb00f('0x6')]('/:id/fields',controller[_0xb00f('0x1c')]);router['get'](_0xb00f('0x1d'),auth['isAuthenticated'](),controller[_0xb00f('0x1e')]);router[_0xb00f('0x6')](_0xb00f('0x1f'),auth['isAuthenticated'](),controller[_0xb00f('0x20')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb00f('0x21')]('/:id/dispositions',auth[_0xb00f('0x7')](),controller['addDisposition']);router[_0xb00f('0x21')](_0xb00f('0xd'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x22')]);var upload=multer({'storage':multer[_0xb00f('0x23')]({'destination':function(_0x1ddb74,_0x4869e4,_0x1079ef){_0x1079ef(null,path[_0xb00f('0x24')](config[_0xb00f('0x25')],_0xb00f('0x26')));},'filename':function(_0x2f4d20,_0x4cc239,_0x5a7a7f){_0x5a7a7f(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x4cc239[_0xb00f('0x2a')]));}})});router[_0xb00f('0x21')](_0xb00f('0xf'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42ea66,_0x37cb83,_0x17f08b){_0x17f08b(null,path[_0xb00f('0x24')](config[_0xb00f('0x25')],_0xb00f('0x2b')));},'filename':function(_0xcfcd83,_0x13b73a,_0x410e5b){_0x410e5b(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x13b73a[_0xb00f('0x2a')]));}})});router[_0xb00f('0x21')](_0xb00f('0x10'),upload[_0xb00f('0x2c')](_0xb00f('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xb00f('0x23')]({'destination':function(_0x508372,_0x549856,_0x59ac1c){_0x59ac1c(null,path['join'](config['root'],_0xb00f('0x2b')));},'filename':function(_0x4a72a8,_0x3c0fcc,_0x429557){_0x429557(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x3c0fcc[_0xb00f('0x2a')]));}})});router[_0xb00f('0x21')]('/:id/customer_avatar',upload[_0xb00f('0x2c')](_0xb00f('0x2d')),controller[_0xb00f('0x2e')]);var upload=multer({'storage':multer[_0xb00f('0x23')]({'destination':function(_0x467b12,_0x59433c,_0x738a31){_0x738a31(null,path[_0xb00f('0x24')](config['root'],_0xb00f('0x2b')));},'filename':function(_0x5a7fe1,_0x28444f,_0x1dc7c7){_0x1dc7c7(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x28444f['originalname']));}})});router['post'](_0xb00f('0x14'),upload[_0xb00f('0x2c')]('file'),controller['addSystemAvatar']);router[_0xb00f('0x21')](_0xb00f('0x2f'),controller[_0xb00f('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x310da2,_0x27d5a5,_0x4be295){const _0x499693=path[_0xb00f('0x24')](config['root'],_0xb00f('0x31'),_0xb00f('0x32'),'offline-chat');fs_extra['ensureDir'](_0x499693,function(){_0x4be295(null,_0x499693);});},'filename':function(_0x50e325,_0x801f6b,_0x37f9fc){const _0x227491=_0x801f6b[_0xb00f('0x2a')][_0xb00f('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1135a9=path[_0xb00f('0x34')](_0x227491);const _0x4c0780=Date[_0xb00f('0x29')]()+'-'+_0x227491[_0xb00f('0x33')](_0x1135a9,'')+_0x1135a9;_0x37f9fc(null,_0x4c0780);}})});router[_0xb00f('0x21')](_0xb00f('0x35'),offlineUploadMulter[_0xb00f('0x36')](),controller[_0xb00f('0x37')]);router[_0xb00f('0x21')](_0xb00f('0x16'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x38')]);router[_0xb00f('0x21')](_0xb00f('0x19'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x39')]);router[_0xb00f('0x21')](_0xb00f('0x1b'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x3a')]);router['post']('/:id/users',auth[_0xb00f('0x7')](),controller[_0xb00f('0x3b')]);router[_0xb00f('0x3c')]('/:id',auth['isAuthenticated'](),controller[_0xb00f('0x3d')]);router[_0xb00f('0x3e')](_0xb00f('0x9'),auth['isAuthenticated'](),controller[_0xb00f('0x3f')]);router[_0xb00f('0x3e')](_0xb00f('0xb'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x40')]);router[_0xb00f('0x3e')](_0xb00f('0xd'),auth[_0xb00f('0x7')](),controller['removeAnswers']);router[_0xb00f('0x3e')]('/:id/users',auth[_0xb00f('0x7')](),controller[_0xb00f('0x41')]);module[_0xb00f('0x42')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 65964a3..c6b45e3 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 _0x0ac6=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','env'];(function(_0x53e25c,_0x5a668a){var _0x5dbc9b=function(_0x5f5848){while(--_0x5f5848){_0x53e25c['push'](_0x53e25c['shift']());}};_0x5dbc9b(++_0x5a668a);}(_0x0ac6,0x14c));var _0x60ac=function(_0x32d015,_0x2bd009){_0x32d015=_0x32d015-0x0;var _0x17ceee=_0x0ac6[_0x32d015];return _0x17ceee;};var beaverLogger=require(_0x60ac('0x0'));var express=require('express');var auth=require(_0x60ac('0x1'));var config=require('../config/environment');var router=express[_0x60ac('0x2')]();var isProduction=config[_0x60ac('0x3')]===_0x60ac('0x4')||![];function clientSideLogs(_0x4c4996,_0x27ac7b,_0x25c8f6){var _0x51bc54=_0x4c4996[_0x60ac('0x5')][_0x60ac('0x6')](_0x60ac('0x7'));if(!_0x51bc54){throw new Error(_0x60ac('0x8'));}return beaverLogger[_0x60ac('0x9')]({'uri':_0x60ac('0xa'),'logger':_0x51bc54,'enableCors':!isProduction})(_0x4c4996,_0x27ac7b,_0x25c8f6);}router[_0x60ac('0xb')](auth[_0x60ac('0xc')](),clientSideLogs);module[_0x60ac('0xd')]=router; \ No newline at end of file +var _0xde0b=['client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','express','../config/environment','Router','env','app','get'];(function(_0x1fc845,_0x106c5b){var _0x1118ff=function(_0x1328df){while(--_0x1328df){_0x1fc845['push'](_0x1fc845['shift']());}};_0x1118ff(++_0x106c5b);}(_0xde0b,0xd2));var _0xbde0=function(_0x4af779,_0x3b967d){_0x4af779=_0x4af779-0x0;var _0x41d726=_0xde0b[_0x4af779];return _0x41d726;};var beaverLogger=require('beaver-logger/server');var express=require(_0xbde0('0x0'));var auth=require('../components/auth/service');var config=require(_0xbde0('0x1'));var router=express[_0xbde0('0x2')]();var isProduction=config[_0xbde0('0x3')]==='production'||![];function clientSideLogs(_0x4ee419,_0x3f99cc,_0x348d87){var _0x7a9b80=_0x4ee419[_0xbde0('0x4')][_0xbde0('0x5')](_0xbde0('0x6'));if(!_0x7a9b80){throw new Error(_0xbde0('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0xbde0('0x8'),'logger':_0x7a9b80,'enableCors':!isProduction})(_0x4ee419,_0x3f99cc,_0x348d87);}router[_0xbde0('0x9')](auth[_0xbde0('0xa')](),clientSideLogs);module[_0xbde0('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 df8052f..fb03e5f 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 _0xe02c=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x14a83a,_0x54500b){var _0x474b3d=function(_0x252db6){while(--_0x252db6){_0x14a83a['push'](_0x14a83a['shift']());}};_0x474b3d(++_0x54500b);}(_0xe02c,0x143));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xce02('0x0'));module['exports']={'name':{'type':Sequelize[_0xce02('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xce02('0x2')](_0xce02('0x3'),_0xce02('0x4'),_0xce02('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xce02('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0x7')},'data2':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0x8')},'data3':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0x9')},'data4':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xce02('0xb')},'data6':{'type':Sequelize[_0xce02('0xc')],'comment':_0xce02('0xd')},'data7':{'type':Sequelize[_0xce02('0xc')],'comment':_0xce02('0xe')}}; \ No newline at end of file +var _0x0058=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x0058,0x171));var _0x8005=function(_0x420f60,_0x170446){_0x420f60=_0x420f60-0x0;var _0x365664=_0x0058[_0x420f60];return _0x365664;};'use strict';var Sequelize=require(_0x8005('0x0'));module[_0x8005('0x1')]={'name':{'type':Sequelize[_0x8005('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8005('0x3')](_0x8005('0x4'),_0x8005('0x5'),_0x8005('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8005('0x3')](_0x8005('0x7'),_0x8005('0x8'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x8005('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x8005('0x9')},'data5':{'type':Sequelize[_0x8005('0xa')],'comment':_0x8005('0xb')},'data6':{'type':Sequelize[_0x8005('0xa')],'comment':_0x8005('0xc')},'data7':{'type':Sequelize[_0x8005('0xa')],'comment':_0x8005('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 85b2a36..169c9c1 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 _0x8902=['id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','undefined','count','offset','limit','Content-Range','then','destroy','stack','send','padEnd','index','map','CloudProvider','type','key','model','name','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','findAll','service','MicrosoftAzure','catch','show','params','rawAttributes','intersection','includeAll','options','data3','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','update','find','oauth2MicrosoftAuthorize','findOne','user','error','get','state','from','base64','ascii'];(function(_0x31f917,_0x3a9037){var _0x31d77a=function(_0x5c1553){while(--_0x5c1553){_0x31f917['push'](_0x31f917['shift']());}};_0x31d77a(++_0x3a9037);}(_0x8902,0x6c));var _0x2890=function(_0x2494c2,_0x288476){_0x2494c2=_0x2494c2-0x0;var _0x16f60b=_0x8902[_0x2494c2];return _0x16f60b;};'use strict';var _=require(_0x2890('0x0'));var Redis=require(_0x2890('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x2890('0x2'));var config=require(_0x2890('0x3'));var logger=require('../../config/logger')(_0x2890('0x4'));var db=require(_0x2890('0x5'))['db'];var oauth=require(_0x2890('0x6'));config['redis']=_[_0x2890('0x7')](config[_0x2890('0x8')],{'host':_0x2890('0x9'),'port':0x18eb});var socket=require(_0x2890('0xa'))(new Redis(config[_0x2890('0x8')]));var redis=new Redis(config[_0x2890('0x8')]);function respondWithStatusCode(_0x60e0a2,_0x57d149){_0x57d149=_0x57d149||0xcc;return function(_0x2a1640){if(_0x2a1640){return _0x60e0a2[_0x2890('0xb')](_0x57d149);}return _0x60e0a2['status'](_0x57d149)[_0x2890('0xc')]();};}function respondWithResult(_0x12d51b,_0x42d367){_0x42d367=_0x42d367||0xc8;return function(_0x456bb2){if(_0x456bb2){return _0x12d51b[_0x2890('0xd')](_0x42d367)['json'](_0x456bb2);}};}function respondWithFilteredResult(_0x411bcf,_0x3a2820){return function(_0x4137aa){if(_0x4137aa){var _0x2a099d=typeof _0x3a2820['offset']==='undefined'&&typeof _0x3a2820['limit']===_0x2890('0xe');var _0x530cf9=_0x4137aa[_0x2890('0xf')];var _0x2e4c22=_0x2a099d?0x0:_0x3a2820[_0x2890('0x10')];var _0x1884a3=_0x2a099d?_0x4137aa[_0x2890('0xf')]:_0x3a2820[_0x2890('0x10')]+_0x3a2820[_0x2890('0x11')];var _0x5eb5bb;if(_0x1884a3>=_0x530cf9){_0x1884a3=_0x530cf9;_0x5eb5bb=0xc8;}else{_0x5eb5bb=0xce;}_0x411bcf[_0x2890('0xd')](_0x5eb5bb);return _0x411bcf['set'](_0x2890('0x12'),_0x2e4c22+'-'+_0x1884a3+'/'+_0x530cf9)['json'](_0x4137aa);}return null;};}function saveUpdates(_0x1a8ed0){return function(_0x2098d9){if(_0x2098d9){return _0x2098d9['update'](_0x1a8ed0)[_0x2890('0x13')](function(_0x44b1dd){return _0x44b1dd;});}return null;};}function removeEntity(_0x1b69c8){return function(_0x28ecbf){if(_0x28ecbf){return _0x28ecbf[_0x2890('0x14')]()[_0x2890('0x13')](function(){_0x1b69c8[_0x2890('0xd')](0xcc)[_0x2890('0xc')]();});}};}function handleEntityNotFound(_0x387f02){return function(_0x3c4077){if(!_0x3c4077){_0x387f02[_0x2890('0xb')](0x194);}return _0x3c4077;};}function handleError(_0x1c1288,_0x23afce){_0x23afce=_0x23afce||0x1f4;return function(_0x4b7b9f){logger['error'](_0x4b7b9f[_0x2890('0x15')]);if(_0x4b7b9f['name']){delete _0x4b7b9f['name'];}_0x1c1288[_0x2890('0xd')](_0x23afce)[_0x2890('0x16')](_0x4b7b9f);};}function maskClientSecret(_0x2f3315){return _[_0x2890('0x17')](_0x2f3315['slice'](0x0,0x3),0x14,'*');}exports[_0x2890('0x18')]=function(_0x5d6a02,_0x2ca81f){var _0xae9069={},_0x5d879e={},_0x53dcb2={'count':0x0,'rows':[]};var _0x3f8d2f=_[_0x2890('0x19')](db[_0x2890('0x1a')]['rawAttributes'],function(_0x4fc27d){return{'name':_0x4fc27d['fieldName'],'type':_0x4fc27d[_0x2890('0x1b')][_0x2890('0x1c')]};});_0x5d879e[_0x2890('0x1d')]=_[_0x2890('0x19')](_0x3f8d2f,_0x2890('0x1e'));_0x5d879e[_0x2890('0x1f')]=_[_0x2890('0x20')](_0x5d6a02[_0x2890('0x1f')]);_0x5d879e['filters']=_['intersection'](_0x5d879e[_0x2890('0x1d')],_0x5d879e[_0x2890('0x1f')]);_0xae9069[_0x2890('0x21')]=_['intersection'](_0x5d879e[_0x2890('0x1d')],qs[_0x2890('0x22')](_0x5d6a02[_0x2890('0x1f')]['fields']));_0xae9069[_0x2890('0x21')]=_0xae9069[_0x2890('0x21')][_0x2890('0x23')]?_0xae9069['attributes']:_0x5d879e['model'];if(!_0x5d6a02[_0x2890('0x1f')][_0x2890('0x24')]('nolimit')){_0xae9069[_0x2890('0x11')]=qs[_0x2890('0x11')](_0x5d6a02[_0x2890('0x1f')]['limit']);_0xae9069[_0x2890('0x10')]=qs['offset'](_0x5d6a02['query'][_0x2890('0x10')]);}_0xae9069[_0x2890('0x25')]=qs[_0x2890('0x26')](_0x5d6a02[_0x2890('0x1f')][_0x2890('0x26')]);_0xae9069[_0x2890('0x27')]=qs[_0x2890('0x28')](_['pick'](_0x5d6a02[_0x2890('0x1f')],_0x5d879e[_0x2890('0x28')]),_0x3f8d2f);if(_0x5d6a02[_0x2890('0x1f')]['filter']){_0xae9069[_0x2890('0x27')]=_[_0x2890('0x29')](_0xae9069['where'],{'$or':_['map'](_0x3f8d2f,function(_0x133b42){if(_0x133b42['type']!==_0x2890('0x2a')){var _0x2cc131={};_0x2cc131[_0x133b42[_0x2890('0x1e')]]={'$like':'%'+_0x5d6a02[_0x2890('0x1f')][_0x2890('0x2b')]+'%'};return _0x2cc131;}})});}_0xae9069=_[_0x2890('0x29')]({},_0xae9069,_0x5d6a02['options']);var _0x2ba4c1={'where':_0xae9069[_0x2890('0x27')]};return db[_0x2890('0x1a')][_0x2890('0xf')](_0x2ba4c1)['then'](function(_0x35a0bc){_0x53dcb2['count']=_0x35a0bc;if(_0x5d6a02[_0x2890('0x1f')]['includeAll']){_0xae9069['include']=[{'all':!![]}];}return db[_0x2890('0x1a')][_0x2890('0x2c')](_0xae9069);})[_0x2890('0x13')](function(_0x122075){_0x53dcb2['rows']=_[_0x2890('0x19')](_0x122075,function(_0x506e3e){if(_0x506e3e[_0x2890('0x2d')]===_0x2890('0x2e')){var _0xdfa9ce=encryptor['decryptString'](_0x506e3e['data3']);_0x506e3e['data3']=maskClientSecret(_0xdfa9ce);}return _0x506e3e;});return _0x53dcb2;})['then'](respondWithFilteredResult(_0x2ca81f,_0xae9069))[_0x2890('0x2f')](handleError(_0x2ca81f,null));};exports[_0x2890('0x30')]=function(_0x2a3f2e,_0x2e9ded){var _0x4bc095={'raw':!![],'where':{'id':_0x2a3f2e[_0x2890('0x31')]['id']}},_0x2002e3={};_0x2002e3['model']=_[_0x2890('0x20')](db[_0x2890('0x1a')][_0x2890('0x32')]);_0x2002e3['query']=_[_0x2890('0x20')](_0x2a3f2e[_0x2890('0x1f')]);_0x2002e3[_0x2890('0x28')]=_[_0x2890('0x33')](_0x2002e3[_0x2890('0x1d')],_0x2002e3[_0x2890('0x1f')]);_0x4bc095[_0x2890('0x21')]=_['intersection'](_0x2002e3['model'],qs['fields'](_0x2a3f2e[_0x2890('0x1f')]['fields']));_0x4bc095[_0x2890('0x21')]=_0x4bc095[_0x2890('0x21')][_0x2890('0x23')]?_0x4bc095['attributes']:_0x2002e3[_0x2890('0x1d')];if(_0x2a3f2e[_0x2890('0x1f')][_0x2890('0x34')]){_0x4bc095['include']=[{'all':!![]}];}_0x4bc095=_[_0x2890('0x29')]({},_0x4bc095,_0x2a3f2e[_0x2890('0x35')]);return db['CloudProvider']['find'](_0x4bc095)[_0x2890('0x13')](handleEntityNotFound(_0x2e9ded,null))[_0x2890('0x13')](function(_0x1a117c){if(_0x1a117c[_0x2890('0x2d')]===_0x2890('0x2e')){var _0x5b5119=encryptor['decryptString'](_0x1a117c[_0x2890('0x36')]);_0x1a117c[_0x2890('0x36')]=maskClientSecret(_0x5b5119);}return _0x1a117c;})[_0x2890('0x13')](respondWithResult(_0x2e9ded,null))[_0x2890('0x2f')](handleError(_0x2e9ded,null));};exports['create']=function(_0x421c16,_0x10dad1){if(!_0x421c16[_0x2890('0x37')][_0x2890('0x1e')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x421c16[_0x2890('0x37')][_0x2890('0x2d')])throw new Error(_0x2890('0x38'));var _0x1e0c04=db[_0x2890('0x1a')][_0x2890('0x32')][_0x2890('0x2d')][_0x2890('0x39')];if(!_0x1e0c04[_0x2890('0x3a')](_0x421c16[_0x2890('0x37')][_0x2890('0x2d')]))throw new Error(_0x2890('0x3b')+_0x1e0c04[_0x2890('0x3c')](',\x20'));if(_0x421c16['body'][_0x2890('0x2d')]==='MicrosoftAzure'&&_0x421c16[_0x2890('0x37')]['data3']){_0x421c16[_0x2890('0x37')]['data3']=encryptor[_0x2890('0x3d')](_0x421c16[_0x2890('0x37')]['data3']);}return db[_0x2890('0x1a')][_0x2890('0x3e')](_0x421c16[_0x2890('0x37')],{})['then'](respondWithResult(_0x10dad1,0xc9))[_0x2890('0x2f')](handleError(_0x10dad1,null));};exports[_0x2890('0x3f')]=function(_0x41f7e4,_0x5375b3){if(_0x41f7e4[_0x2890('0x37')]['id']){delete _0x41f7e4[_0x2890('0x37')]['id'];}return db[_0x2890('0x1a')][_0x2890('0x40')]({'where':{'id':_0x41f7e4[_0x2890('0x31')]['id']}})[_0x2890('0x13')](handleEntityNotFound(_0x5375b3,null))[_0x2890('0x13')](function(_0x2085f1){if(_0x2085f1['service']===_0x2890('0x2e')&&_0x41f7e4[_0x2890('0x37')][_0x2890('0x36')]){_0x41f7e4[_0x2890('0x37')][_0x2890('0x36')]=encryptor[_0x2890('0x3d')](_0x41f7e4[_0x2890('0x37')][_0x2890('0x36')]);}return _0x2085f1;})[_0x2890('0x13')](saveUpdates(_0x41f7e4[_0x2890('0x37')],null))[_0x2890('0x13')](respondWithResult(_0x5375b3,null))[_0x2890('0x2f')](handleError(_0x5375b3,null));};exports[_0x2890('0x14')]=function(_0x10c3b9,_0x1278d9){return db[_0x2890('0x1a')][_0x2890('0x40')]({'where':{'id':_0x10c3b9[_0x2890('0x31')]['id']}})['then'](handleEntityNotFound(_0x1278d9,null))['then'](removeEntity(_0x1278d9,null))[_0x2890('0x2f')](handleError(_0x1278d9,null));};exports[_0x2890('0x41')]=function(_0x2ad24c,_0x5901ba){return db[_0x2890('0x1a')][_0x2890('0x42')]({'where':{'id':_0x2ad24c[_0x2890('0x31')]['id']},'raw':!![]})[_0x2890('0x13')](function(_0x1f02de){if(!_0x1f02de)return _0x5901ba[_0x2890('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x1f02de,_0x2ad24c[_0x2890('0x43')]['id'])};})['then'](respondWithResult(_0x5901ba,null))[_0x2890('0x2f')](handleError(_0x5901ba,null));};exports['oauth2MicrosoftCallback']=function(_0x4673a7,_0x2809a3){var _0xf9ef4=_0x4673a7['body'];var _0x25cad5;var _0x48bfa6;if(_0xf9ef4[_0x2890('0x44')])throw _0xf9ef4;redis[_0x2890('0x45')](_0xf9ef4[_0x2890('0x46')])['then'](function(_0x1e8dc2){if(!_0x1e8dc2)throw new Error('Invalid\x20state\x20parameter');_0x25cad5=JSON['parse'](_0x1e8dc2);var _0x49b8dc=Buffer[_0x2890('0x47')](_0xf9ef4['state'],_0x2890('0x48'))['toString'](_0x2890('0x49'));_0x48bfa6=JSON['parse'](_0x49b8dc);if(!oauth['isValidIdToken'](_0xf9ef4[_0x2890('0x4a')],_0x25cad5[_0x2890('0x4b')]))throw new Error(_0x2890('0x4c'));redis[_0x2890('0x4d')](_0xf9ef4[_0x2890('0x46')]);return oauth[_0x2890('0x4e')](_0xf9ef4[_0x2890('0x4f')],_0x25cad5);})[_0x2890('0x13')](function(_0x45f3f6){_0x25cad5['data5']=_0x45f3f6[_0x2890('0x50')];_0x25cad5[_0x2890('0x51')]=_0x45f3f6[_0x2890('0x52')];return db[_0x2890('0x1a')][_0x2890('0x3f')]({'data5':_0x25cad5[_0x2890('0x53')],'data6':_0x25cad5[_0x2890('0x51')]},{'where':{'id':_0x25cad5['id']}});})[_0x2890('0x13')](function(){oauth[_0x2890('0x54')](_0x25cad5);socket[_0x2890('0x55')](_0x2890('0x56'),{'id':_0x48bfa6['id']});return;})[_0x2890('0x13')](respondWithStatusCode(_0x2809a3,null))[_0x2890('0x2f')](function(_0x1f8807){if(_0x48bfa6){socket[_0x2890('0x55')](_0x2890('0x57'),{'id':_0x48bfa6['id']});}if(!_0x25cad5){logger[_0x2890('0x44')](_0x2890('0x58'),_0x1f8807);return _0x2809a3[_0x2890('0xd')](0x1f4)[_0x2890('0x16')](_0x1f8807[_0x2890('0x59')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x25cad5['id'],JSON[_0x2890('0x5a')](_0x1f8807));});}; \ No newline at end of file +var _0x87e3=['data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','error','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','defaults','redis','status','end','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','CloudProvider','then','includeAll','findAll','service','MicrosoftAzure','decryptString','catch','show','params','keys','include','merge','find','data3','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','get','Invalid\x20state\x20parameter','parse','state','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5'];(function(_0x126743,_0x531a54){var _0x4c5c3e=function(_0x2f96ca){while(--_0x2f96ca){_0x126743['push'](_0x126743['shift']());}};_0x4c5c3e(++_0x531a54);}(_0x87e3,0xc5));var _0x387e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x87e3[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x387e('0x0'));var Redis=require(_0x387e('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x387e('0x2'));var config=require(_0x387e('0x3'));var logger=require('../../config/logger')('api');var db=require(_0x387e('0x4'))['db'];var oauth=require(_0x387e('0x5'));config['redis']=_[_0x387e('0x6')](config[_0x387e('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x387e('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x38976e,_0x8a3d8f){_0x8a3d8f=_0x8a3d8f||0xcc;return function(_0x165dd4){if(_0x165dd4){return _0x38976e['sendStatus'](_0x8a3d8f);}return _0x38976e[_0x387e('0x8')](_0x8a3d8f)[_0x387e('0x9')]();};}function respondWithResult(_0x2edf22,_0x3aa180){_0x3aa180=_0x3aa180||0xc8;return function(_0x14b025){if(_0x14b025){return _0x2edf22[_0x387e('0x8')](_0x3aa180)[_0x387e('0xa')](_0x14b025);}};}function respondWithFilteredResult(_0x1465a8,_0x4bff45){return function(_0x294e00){if(_0x294e00){var _0x2997c4=typeof _0x4bff45[_0x387e('0xb')]===_0x387e('0xc')&&typeof _0x4bff45[_0x387e('0xd')]===_0x387e('0xc');var _0x127243=_0x294e00[_0x387e('0xe')];var _0x1bac31=_0x2997c4?0x0:_0x4bff45[_0x387e('0xb')];var _0x3fcc90=_0x2997c4?_0x294e00[_0x387e('0xe')]:_0x4bff45['offset']+_0x4bff45[_0x387e('0xd')];var _0x127bdf;if(_0x3fcc90>=_0x127243){_0x3fcc90=_0x127243;_0x127bdf=0xc8;}else{_0x127bdf=0xce;}_0x1465a8[_0x387e('0x8')](_0x127bdf);return _0x1465a8[_0x387e('0xf')]('Content-Range',_0x1bac31+'-'+_0x3fcc90+'/'+_0x127243)['json'](_0x294e00);}return null;};}function saveUpdates(_0x3bee76){return function(_0x5be448){if(_0x5be448){return _0x5be448[_0x387e('0x10')](_0x3bee76)['then'](function(_0x1dad77){return _0x1dad77;});}return null;};}function removeEntity(_0x17ead2){return function(_0x1797a9){if(_0x1797a9){return _0x1797a9[_0x387e('0x11')]()['then'](function(){_0x17ead2[_0x387e('0x8')](0xcc)[_0x387e('0x9')]();});}};}function handleEntityNotFound(_0x518449){return function(_0x246567){if(!_0x246567){_0x518449['sendStatus'](0x194);}return _0x246567;};}function handleError(_0x4c8fdd,_0x4c7853){_0x4c7853=_0x4c7853||0x1f4;return function(_0x42a994){logger['error'](_0x42a994[_0x387e('0x12')]);if(_0x42a994[_0x387e('0x13')]){delete _0x42a994[_0x387e('0x13')];}_0x4c8fdd['status'](_0x4c7853)[_0x387e('0x14')](_0x42a994);};}function maskClientSecret(_0x1cefc8){return _[_0x387e('0x15')](_0x1cefc8[_0x387e('0x16')](0x0,0x3),0x14,'*');}exports[_0x387e('0x17')]=function(_0x3c3f6e,_0x525639){var _0x15d182={},_0x277f81={},_0x845fa0={'count':0x0,'rows':[]};var _0x4f7950=_[_0x387e('0x18')](db['CloudProvider'][_0x387e('0x19')],function(_0x39113e){return{'name':_0x39113e[_0x387e('0x1a')],'type':_0x39113e[_0x387e('0x1b')][_0x387e('0x1c')]};});_0x277f81[_0x387e('0x1d')]=_[_0x387e('0x18')](_0x4f7950,_0x387e('0x13'));_0x277f81[_0x387e('0x1e')]=_['keys'](_0x3c3f6e[_0x387e('0x1e')]);_0x277f81['filters']=_['intersection'](_0x277f81[_0x387e('0x1d')],_0x277f81[_0x387e('0x1e')]);_0x15d182[_0x387e('0x1f')]=_[_0x387e('0x20')](_0x277f81['model'],qs['fields'](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x21')]));_0x15d182[_0x387e('0x1f')]=_0x15d182['attributes'][_0x387e('0x22')]?_0x15d182['attributes']:_0x277f81[_0x387e('0x1d')];if(!_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x23')](_0x387e('0x24'))){_0x15d182['limit']=qs[_0x387e('0xd')](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0xd')]);_0x15d182[_0x387e('0xb')]=qs[_0x387e('0xb')](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0xb')]);}_0x15d182[_0x387e('0x25')]=qs[_0x387e('0x26')](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x26')]);_0x15d182[_0x387e('0x27')]=qs[_0x387e('0x28')](_[_0x387e('0x29')](_0x3c3f6e[_0x387e('0x1e')],_0x277f81[_0x387e('0x28')]),_0x4f7950);if(_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x2a')]){_0x15d182[_0x387e('0x27')]=_['merge'](_0x15d182[_0x387e('0x27')],{'$or':_[_0x387e('0x18')](_0x4f7950,function(_0x202136){if(_0x202136[_0x387e('0x1b')]!==_0x387e('0x2b')){var _0x5afa5a={};_0x5afa5a[_0x202136[_0x387e('0x13')]]={'$like':'%'+_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x2a')]+'%'};return _0x5afa5a;}})});}_0x15d182=_['merge']({},_0x15d182,_0x3c3f6e[_0x387e('0x2c')]);var _0x235501={'where':_0x15d182[_0x387e('0x27')]};return db[_0x387e('0x2d')][_0x387e('0xe')](_0x235501)[_0x387e('0x2e')](function(_0x2c01db){_0x845fa0[_0x387e('0xe')]=_0x2c01db;if(_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x2f')]){_0x15d182['include']=[{'all':!![]}];}return db['CloudProvider'][_0x387e('0x30')](_0x15d182);})[_0x387e('0x2e')](function(_0x317431){_0x845fa0['rows']=_['map'](_0x317431,function(_0x3a8f8f){if(_0x3a8f8f[_0x387e('0x31')]===_0x387e('0x32')){var _0x31c8f8=encryptor[_0x387e('0x33')](_0x3a8f8f['data3']);_0x3a8f8f['data3']=maskClientSecret(_0x31c8f8);}return _0x3a8f8f;});return _0x845fa0;})[_0x387e('0x2e')](respondWithFilteredResult(_0x525639,_0x15d182))[_0x387e('0x34')](handleError(_0x525639,null));};exports[_0x387e('0x35')]=function(_0x1faf90,_0x2a4328){var _0x6a6e3a={'raw':!![],'where':{'id':_0x1faf90[_0x387e('0x36')]['id']}},_0x4e493d={};_0x4e493d[_0x387e('0x1d')]=_[_0x387e('0x37')](db[_0x387e('0x2d')][_0x387e('0x19')]);_0x4e493d['query']=_[_0x387e('0x37')](_0x1faf90[_0x387e('0x1e')]);_0x4e493d[_0x387e('0x28')]=_[_0x387e('0x20')](_0x4e493d[_0x387e('0x1d')],_0x4e493d[_0x387e('0x1e')]);_0x6a6e3a[_0x387e('0x1f')]=_['intersection'](_0x4e493d[_0x387e('0x1d')],qs[_0x387e('0x21')](_0x1faf90[_0x387e('0x1e')][_0x387e('0x21')]));_0x6a6e3a[_0x387e('0x1f')]=_0x6a6e3a[_0x387e('0x1f')][_0x387e('0x22')]?_0x6a6e3a[_0x387e('0x1f')]:_0x4e493d['model'];if(_0x1faf90[_0x387e('0x1e')][_0x387e('0x2f')]){_0x6a6e3a[_0x387e('0x38')]=[{'all':!![]}];}_0x6a6e3a=_[_0x387e('0x39')]({},_0x6a6e3a,_0x1faf90[_0x387e('0x2c')]);return db[_0x387e('0x2d')][_0x387e('0x3a')](_0x6a6e3a)[_0x387e('0x2e')](handleEntityNotFound(_0x2a4328,null))['then'](function(_0x351e1c){if(_0x351e1c[_0x387e('0x31')]===_0x387e('0x32')){var _0x434332=encryptor['decryptString'](_0x351e1c[_0x387e('0x3b')]);_0x351e1c[_0x387e('0x3b')]=maskClientSecret(_0x434332);}return _0x351e1c;})[_0x387e('0x2e')](respondWithResult(_0x2a4328,null))[_0x387e('0x34')](handleError(_0x2a4328,null));};exports[_0x387e('0x3c')]=function(_0x53155e,_0x7b051c){if(!_0x53155e[_0x387e('0x3d')][_0x387e('0x13')])throw new Error(_0x387e('0x3e'));if(!_0x53155e[_0x387e('0x3d')][_0x387e('0x31')])throw new Error(_0x387e('0x3f'));var _0x5db50b=db[_0x387e('0x2d')][_0x387e('0x19')][_0x387e('0x31')][_0x387e('0x40')];if(!_0x5db50b[_0x387e('0x41')](_0x53155e[_0x387e('0x3d')][_0x387e('0x31')]))throw new Error(_0x387e('0x42')+_0x5db50b['join'](',\x20'));if(_0x53155e[_0x387e('0x3d')]['service']==='MicrosoftAzure'&&_0x53155e['body'][_0x387e('0x3b')]){_0x53155e[_0x387e('0x3d')]['data3']=encryptor[_0x387e('0x43')](_0x53155e['body'][_0x387e('0x3b')]);}return db[_0x387e('0x2d')][_0x387e('0x3c')](_0x53155e['body'],{})[_0x387e('0x2e')](respondWithResult(_0x7b051c,0xc9))['catch'](handleError(_0x7b051c,null));};exports[_0x387e('0x10')]=function(_0xb9087d,_0x2e9b64){if(_0xb9087d['body']['id']){delete _0xb9087d[_0x387e('0x3d')]['id'];}return db[_0x387e('0x2d')][_0x387e('0x3a')]({'where':{'id':_0xb9087d[_0x387e('0x36')]['id']}})[_0x387e('0x2e')](handleEntityNotFound(_0x2e9b64,null))['then'](function(_0x1f624e){if(_0x1f624e[_0x387e('0x31')]===_0x387e('0x32')&&_0xb9087d['body'][_0x387e('0x3b')]){_0xb9087d[_0x387e('0x3d')][_0x387e('0x3b')]=encryptor[_0x387e('0x43')](_0xb9087d[_0x387e('0x3d')]['data3']);}return _0x1f624e;})[_0x387e('0x2e')](saveUpdates(_0xb9087d[_0x387e('0x3d')],null))['then'](respondWithResult(_0x2e9b64,null))[_0x387e('0x34')](handleError(_0x2e9b64,null));};exports[_0x387e('0x11')]=function(_0x373757,_0x12c275){return db[_0x387e('0x2d')]['find']({'where':{'id':_0x373757[_0x387e('0x36')]['id']}})['then'](handleEntityNotFound(_0x12c275,null))[_0x387e('0x2e')](removeEntity(_0x12c275,null))[_0x387e('0x34')](handleError(_0x12c275,null));};exports[_0x387e('0x44')]=function(_0x9e261e,_0x503d99){return db['CloudProvider'][_0x387e('0x45')]({'where':{'id':_0x9e261e['params']['id']},'raw':!![]})[_0x387e('0x2e')](function(_0x461765){if(!_0x461765)return _0x503d99[_0x387e('0x46')](0x194);return{'url':oauth[_0x387e('0x47')](_0x461765,_0x9e261e['user']['id'])};})[_0x387e('0x2e')](respondWithResult(_0x503d99,null))[_0x387e('0x34')](handleError(_0x503d99,null));};exports['oauth2MicrosoftCallback']=function(_0x41de28,_0x78553c){var _0x49c6ab=_0x41de28[_0x387e('0x3d')];var _0x1c8e22;var _0x1d59e2;if(_0x49c6ab['error'])throw _0x49c6ab;redis[_0x387e('0x48')](_0x49c6ab['state'])[_0x387e('0x2e')](function(_0xb973db){if(!_0xb973db)throw new Error(_0x387e('0x49'));_0x1c8e22=JSON[_0x387e('0x4a')](_0xb973db);var _0x2485ce=Buffer['from'](_0x49c6ab[_0x387e('0x4b')],'base64')[_0x387e('0x4c')](_0x387e('0x4d'));_0x1d59e2=JSON[_0x387e('0x4a')](_0x2485ce);if(!oauth[_0x387e('0x4e')](_0x49c6ab[_0x387e('0x4f')],_0x1c8e22['oauth2Claims']))throw new Error(_0x387e('0x50'));redis[_0x387e('0x51')](_0x49c6ab[_0x387e('0x4b')]);return oauth[_0x387e('0x52')](_0x49c6ab[_0x387e('0x53')],_0x1c8e22);})[_0x387e('0x2e')](function(_0x165d5a){_0x1c8e22[_0x387e('0x54')]=_0x165d5a['access_token'];_0x1c8e22[_0x387e('0x55')]=_0x165d5a[_0x387e('0x56')];return db['CloudProvider'][_0x387e('0x10')]({'data5':_0x1c8e22[_0x387e('0x54')],'data6':_0x1c8e22[_0x387e('0x55')]},{'where':{'id':_0x1c8e22['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x1c8e22);socket[_0x387e('0x57')](_0x387e('0x58'),{'id':_0x1d59e2['id']});return;})[_0x387e('0x2e')](respondWithStatusCode(_0x78553c,null))[_0x387e('0x34')](function(_0x475e21){if(_0x1d59e2){socket['emit'](_0x387e('0x59'),{'id':_0x1d59e2['id']});}if(!_0x1c8e22){logger['error'](_0x387e('0x5a'),_0x475e21);return _0x78553c[_0x387e('0x8')](0x1f4)['send'](_0x475e21[_0x387e('0x5b')]);}logger[_0x387e('0x5c')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1c8e22['id'],JSON[_0x387e('0x5d')](_0x475e21));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index dd12bee..68df5aa 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 _0x6f1b=['../../config/logger','request-promise','rimraf','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0x3aa1a3,_0x148306){var _0x427f8e=function(_0x3f31e1){while(--_0x3f31e1){_0x3aa1a3['push'](_0x3aa1a3['shift']());}};_0x427f8e(++_0x148306);}(_0x6f1b,0x15e));var _0xb6f1=function(_0x1cd2d7,_0x281cda){_0x1cd2d7=_0x1cd2d7-0x0;var _0x5342fb=_0x6f1b[_0x1cd2d7];return _0x5342fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb6f1('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb6f1('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb6f1('0x2'));var config=require('../../config/environment');var attributes=require(_0xb6f1('0x3'));module['exports']=function(_0x51242e,_0x3e33a3){return _0x51242e[_0xb6f1('0x4')](_0xb6f1('0x5'),attributes,{'tableName':_0xb6f1('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc51=['util','../../config/logger','api','moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','cloud_providers','lodash'];(function(_0x1d04fc,_0x57ff67){var _0x41b7e8=function(_0x2b412f){while(--_0x2b412f){_0x1d04fc['push'](_0x1d04fc['shift']());}};_0x41b7e8(++_0x57ff67);}(_0xcc51,0xcb));var _0x1cc5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xcc51[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x1cc5('0x0'));var util=require(_0x1cc5('0x1'));var logger=require(_0x1cc5('0x2'))(_0x1cc5('0x3'));var moment=require(_0x1cc5('0x4'));var BPromise=require('bluebird');var rp=require(_0x1cc5('0x5'));var fs=require('fs');var path=require(_0x1cc5('0x6'));var rimraf=require(_0x1cc5('0x7'));var config=require('../../config/environment');var attributes=require(_0x1cc5('0x8'));module[_0x1cc5('0x9')]=function(_0x448c6f,_0x4fa5c4){return _0x448c6f[_0x1cc5('0xa')]('CloudProvider',attributes,{'tableName':_0x1cc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 4b56ccb..24f3268 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 _0x4079=['decryptString','data2','data5','access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','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','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','stringify','base64','randomBytes','toString','hex','client_id','data4','form_post','state','nonce','prompt','login','value','oauth2/','set','payload','aud','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data1'];(function(_0x4472ea,_0x1c5c44){var _0x37d760=function(_0x39526b){while(--_0x39526b){_0x4472ea['push'](_0x4472ea['shift']());}};_0x37d760(++_0x1c5c44);}(_0x4079,0xe6));var _0x9407=function(_0x3b8a6a,_0x56c2df){_0x3b8a6a=_0x3b8a6a-0x0;var _0x4b2128=_0x4079[_0x3b8a6a];return _0x4b2128;};'use strict';var _=require(_0x9407('0x0'));var crypto=require(_0x9407('0x1'));var jwt=require(_0x9407('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x9407('0x3'));var encryptor=require(_0x9407('0x4'));var config=require(_0x9407('0x5'));var logger=require(_0x9407('0x6'))(_0x9407('0x7'));var schedule=require(_0x9407('0x8'));var db=require(_0x9407('0x9'))['db'];config[_0x9407('0xa')]=_[_0x9407('0xb')](config[_0x9407('0xa')],{'host':_0x9407('0xc'),'port':0x18eb});var redis=new Redis(config[_0x9407('0xa')]);var MICROSOFT_AUTH_URL=_0x9407('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x9407('0xe'),_0x9407('0xf'),_0x9407('0x10'),_0x9407('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x9407('0xe'),_0x9407('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x9407('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x9407('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xe79757){var _0xcdd15f=_[_0x9407('0x14')](AZURE_AUTH_SCOPES[_0xe79757[_0x9407('0x15')]]);if(_0xe79757[_0x9407('0x15')]===_0x9407('0x16'))_0xcdd15f[_0x9407('0x17')](_0xe79757[_0x9407('0x18')]+_0x9407('0x19'));return _0xcdd15f[_0x9407('0x1a')]('\x20');}function getAccessTokenScope(_0x37dc6a){if(_0x37dc6a[_0x9407('0x15')]===_0x9407('0x1b'))return _0x9407('0x1c');if(_0x37dc6a[_0x9407('0x15')]===_0x9407('0x16'))return _0x37dc6a[_0x9407('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4c5713,_0x132243){var _0x5efb46=MICROSOFT_AUTH_URL[_0x9407('0x1d')](_0x9407('0x1e'),_0x4c5713['data2']);var _0x323189=['code','id_token'];var _0x2f999c=Buffer['from'](JSON[_0x9407('0x1f')]({'id':_0x132243}))['toString'](_0x9407('0x20'));var _0x19d694=crypto[_0x9407('0x21')](0x10)[_0x9407('0x22')](_0x9407('0x23'));var _0x5b30ae=getAuthorizationScopes(_0x4c5713);var _0x1bda52=[{'key':_0x9407('0x24'),'value':_0x4c5713['data1']},{'key':'response_type','value':encodeURIComponent(_0x323189[_0x9407('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x4c5713[_0x9407('0x25')]},{'key':'response_mode','value':_0x9407('0x26')},{'key':'scope','value':encodeURIComponent(_0x5b30ae)},{'key':_0x9407('0x27'),'value':_0x2f999c},{'key':_0x9407('0x28'),'value':_0x19d694},{'key':_0x9407('0x29'),'value':_0x9407('0x2a')}];var _0x230396=_0x5efb46+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9407('0x14')](_0x1bda52,function(_0x235084){return _0x235084['key']+'='+_0x235084[_0x9407('0x2b')];})[_0x9407('0x1a')]('&');_0x4c5713['oauth2Claims']={'issuer':_0x5efb46[_0x9407('0x1d')](_0x9407('0x2c'),''),'audience':_0x4c5713['data1'],'state':_0x2f999c,'nonce':_0x19d694};redis[_0x9407('0x2d')](_0x2f999c,JSON[_0x9407('0x1f')](_0x4c5713));return _0x230396;}function isValidIdToken(_0x7bb4b7,_0x3744d3){try{var _0x30c49f=jwt['decode'](_0x7bb4b7,{'complete':!![]});var _0x475614=_0x30c49f[_0x9407('0x2e')];if(_0x475614['iss']!==_0x3744d3['issuer'])return![];if(_0x475614[_0x9407('0x2f')]!==_0x3744d3[_0x9407('0x30')])return![];if(_0x475614['nonce']!==_0x3744d3[_0x9407('0x28')])return![];if(moment()['isAfter'](moment[_0x9407('0x31')](_0x475614[_0x9407('0x32')])))return![];return!![];}catch(_0x17810e){throw _0x17810e;}}function refreshOauth2MicrosoftAccessToken(_0xeeac74){return Promise[_0x9407('0x33')]()[_0x9407('0x34')](function(){if(_0xeeac74[_0x9407('0x35')])return _0xeeac74;return db[_0x9407('0x36')][_0x9407('0x37')]({'where':{'id':_0xeeac74['id']},'raw':!![]});})[_0x9407('0x34')](function(_0x44a0bf){var _0x1ea0cc={'grant_type':_0x9407('0x38'),'refresh_token':_0x44a0bf['data6'],'scope':getAccessTokenScope(_0x44a0bf),'redirect_uri':_0x44a0bf[_0x9407('0x25')],'client_id':_0x44a0bf[_0x9407('0x39')],'client_secret':encryptor[_0x9407('0x3a')](_0x44a0bf[_0x9407('0x35')])};var _0x234985={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x9407('0x1d')](_0x9407('0x1e'),_0x44a0bf[_0x9407('0x3b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1ea0cc,'json':!![]};return rp(_0x234985);})[_0x9407('0x34')](function(_0x57e02a){_0xeeac74[_0x9407('0x3c')]=_0x57e02a[_0x9407('0x3d')];_0xeeac74[_0x9407('0x3e')]=_0x57e02a[_0x9407('0x38')];return db[_0x9407('0x36')][_0x9407('0x3f')]({'data5':_0xeeac74[_0x9407('0x3c')],'data6':_0xeeac74[_0x9407('0x3e')]},{'where':{'id':_0xeeac74['id']}});})[_0x9407('0x34')](function(){return _0xeeac74;})[_0x9407('0x40')](function(_0x1fad7c){logger[_0x9407('0x41')](_0x9407('0x42'),_0xeeac74['id'],_0x1fad7c);});}function getOauth2MicrosoftAccessToken(_0xb1c69d,_0x3fde07){var _0x1b281c={'grant_type':'authorization_code','code':_0xb1c69d,'scope':getAccessTokenScope(_0x3fde07),'redirect_uri':_0x3fde07[_0x9407('0x25')],'client_id':_0x3fde07[_0x9407('0x39')],'client_secret':encryptor['decryptString'](_0x3fde07[_0x9407('0x35')])};var _0x4af167={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x9407('0x1d')](_0x9407('0x1e'),_0x3fde07[_0x9407('0x3b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1b281c,'json':!![]};return rp(_0x4af167);}function startRefreshInterval(_0x16c0a3){var _0x1dd025=schedule[_0x9407('0x43')];if(_0x1dd025[_0x16c0a3['id']])clearInterval(_0x1dd025[_0x16c0a3['id']]);_0x1dd025[_0x16c0a3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9407('0x44')](this,{'id':_0x16c0a3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9407('0x43')]=_0x1dd025;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x9407('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9407('0x34')](function(_0x20eca7){var _0x26eac9=_0x20eca7[_0x9407('0x14')](function(_0x378075){return refreshOauth2MicrosoftAccessToken(_0x378075)[_0x9407('0x34')](function(_0x35dd5a){startRefreshInterval(_0x35dd5a);});});return Promise[_0x9407('0x46')](_0x26eac9);})['catch'](function(_0x58f8bf){var _0x558582=_0x58f8bf?util['inspect'](_0x58f8bf,{'showHidden':![],'depth':null}):'';logger[_0x9407('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x558582);});}module[_0x9407('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x71b2=['Outlook365','replace','{TENANT_ID}','code','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','nonce','prompt','oauth2Claims','oauth2/','set','decode','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data2','data5','data6','update','catch','authorization_code','bind','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','push','data7','/.default','join'];(function(_0x4c809c,_0x38cece){var _0x423955=function(_0x1ed9a7){while(--_0x1ed9a7){_0x4c809c['push'](_0x4c809c['shift']());}};_0x423955(++_0x38cece);}(_0x71b2,0x154));var _0x271b=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x71b2[_0x1fa759];return _0x2da9f4;};'use strict';var _=require(_0x271b('0x0'));var crypto=require('crypto');var jwt=require(_0x271b('0x1'));var moment=require(_0x271b('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x271b('0x3'));var config=require(_0x271b('0x4'));var logger=require(_0x271b('0x5'))(_0x271b('0x6'));var schedule=require(_0x271b('0x7'));var db=require(_0x271b('0x8'))['db'];config[_0x271b('0x9')]=_[_0x271b('0xa')](config['redis'],{'host':_0x271b('0xb'),'port':0x18eb});var redis=new Redis(config[_0x271b('0x9')]);var MICROSOFT_AUTH_URL=_0x271b('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile','email',_0x271b('0xd'),_0x271b('0xe'),_0x271b('0xf'),_0x271b('0x10')],'Dynamics365':[_0x271b('0x11'),_0x271b('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x271b('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5806f9){var _0x11bca7=_[_0x271b('0x13')](AZURE_AUTH_SCOPES[_0x5806f9[_0x271b('0x14')]]);if(_0x5806f9[_0x271b('0x14')]==='Dynamics365')_0x11bca7[_0x271b('0x15')](_0x5806f9[_0x271b('0x16')]+_0x271b('0x17'));return _0x11bca7[_0x271b('0x18')]('\x20');}function getAccessTokenScope(_0x104700){if(_0x104700[_0x271b('0x14')]===_0x271b('0x19'))return _0x271b('0xe');if(_0x104700[_0x271b('0x14')]==='Dynamics365')return _0x104700[_0x271b('0x16')]+_0x271b('0x17');}function generateMicrosoftAuthorizationUrl(_0x583286,_0x271b8a){var _0x39fabb=MICROSOFT_AUTH_URL[_0x271b('0x1a')](_0x271b('0x1b'),_0x583286['data2']);var _0x773eb4=[_0x271b('0x1c'),'id_token'];var _0xfa6c08=Buffer['from'](JSON[_0x271b('0x1d')]({'id':_0x271b8a}))[_0x271b('0x1e')](_0x271b('0x1f'));var _0x59c0f7=crypto[_0x271b('0x20')](0x10)['toString'](_0x271b('0x21'));var _0x453b72=getAuthorizationScopes(_0x583286);var _0xd39d94=[{'key':_0x271b('0x22'),'value':_0x583286[_0x271b('0x23')]},{'key':_0x271b('0x24'),'value':encodeURIComponent(_0x773eb4[_0x271b('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x583286[_0x271b('0x25')]},{'key':_0x271b('0x26'),'value':_0x271b('0x27')},{'key':_0x271b('0x28'),'value':encodeURIComponent(_0x453b72)},{'key':'state','value':_0xfa6c08},{'key':_0x271b('0x29'),'value':_0x59c0f7},{'key':_0x271b('0x2a'),'value':'login'}];var _0x1d2516=_0x39fabb+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x271b('0x13')](_0xd39d94,function(_0x5d2ca7){return _0x5d2ca7['key']+'='+_0x5d2ca7['value'];})[_0x271b('0x18')]('&');_0x583286[_0x271b('0x2b')]={'issuer':_0x39fabb[_0x271b('0x1a')](_0x271b('0x2c'),''),'audience':_0x583286[_0x271b('0x23')],'state':_0xfa6c08,'nonce':_0x59c0f7};redis[_0x271b('0x2d')](_0xfa6c08,JSON['stringify'](_0x583286));return _0x1d2516;}function isValidIdToken(_0x3c538f,_0x1545e4){try{var _0x843335=jwt[_0x271b('0x2e')](_0x3c538f,{'complete':!![]});var _0x3acf71=_0x843335['payload'];if(_0x3acf71[_0x271b('0x2f')]!==_0x1545e4[_0x271b('0x30')])return![];if(_0x3acf71[_0x271b('0x31')]!==_0x1545e4[_0x271b('0x32')])return![];if(_0x3acf71[_0x271b('0x29')]!==_0x1545e4[_0x271b('0x29')])return![];if(moment()[_0x271b('0x33')](moment[_0x271b('0x34')](_0x3acf71[_0x271b('0x35')])))return![];return!![];}catch(_0x229e68){throw _0x229e68;}}function refreshOauth2MicrosoftAccessToken(_0x41d788){return Promise[_0x271b('0x36')]()[_0x271b('0x37')](function(){if(_0x41d788[_0x271b('0x38')])return _0x41d788;return db[_0x271b('0x39')][_0x271b('0x3a')]({'where':{'id':_0x41d788['id']},'raw':!![]});})[_0x271b('0x37')](function(_0x59ebeb){var _0x355c58={'grant_type':_0x271b('0x3b'),'refresh_token':_0x59ebeb['data6'],'scope':getAccessTokenScope(_0x59ebeb),'redirect_uri':_0x59ebeb[_0x271b('0x25')],'client_id':_0x59ebeb[_0x271b('0x23')],'client_secret':encryptor[_0x271b('0x3c')](_0x59ebeb[_0x271b('0x38')])};var _0x4f6797={'method':_0x271b('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x271b('0x1a')](_0x271b('0x1b'),_0x59ebeb[_0x271b('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x355c58,'json':!![]};return rp(_0x4f6797);})['then'](function(_0x2700b6){_0x41d788[_0x271b('0x3f')]=_0x2700b6['access_token'];_0x41d788[_0x271b('0x40')]=_0x2700b6[_0x271b('0x3b')];return db[_0x271b('0x39')][_0x271b('0x41')]({'data5':_0x41d788[_0x271b('0x3f')],'data6':_0x41d788[_0x271b('0x40')]},{'where':{'id':_0x41d788['id']}});})[_0x271b('0x37')](function(){return _0x41d788;})[_0x271b('0x42')](function(_0x4b1344){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x41d788['id'],_0x4b1344);});}function getOauth2MicrosoftAccessToken(_0x25b013,_0x5b690a){var _0x234824={'grant_type':_0x271b('0x43'),'code':_0x25b013,'scope':getAccessTokenScope(_0x5b690a),'redirect_uri':_0x5b690a[_0x271b('0x25')],'client_id':_0x5b690a[_0x271b('0x23')],'client_secret':encryptor['decryptString'](_0x5b690a[_0x271b('0x38')])};var _0x10aa39={'method':_0x271b('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x271b('0x1a')]('{TENANT_ID}',_0x5b690a[_0x271b('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x234824,'json':!![]};return rp(_0x10aa39);}function startRefreshInterval(_0x56a31e){var _0x2e3340=schedule['intervals'];if(_0x2e3340[_0x56a31e['id']])clearInterval(_0x2e3340[_0x56a31e['id']]);_0x2e3340[_0x56a31e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x271b('0x44')](this,{'id':_0x56a31e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2e3340;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x38b7cc){var _0x2525cc=_0x38b7cc[_0x271b('0x13')](function(_0x23f2b3){return refreshOauth2MicrosoftAccessToken(_0x23f2b3)['then'](function(_0x3692f9){startRefreshInterval(_0x3692f9);});});return Promise['all'](_0x2525cc);})[_0x271b('0x42')](function(_0x1ec035){var _0x5ef841=_0x1ec035?util[_0x271b('0x45')](_0x1ec035,{'showHidden':![],'depth':null}):'';logger[_0x271b('0x46')](_0x271b('0x47'),_0x5ef841);});}module[_0x271b('0x48')]={'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 8aae128..e05b1c4 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 _0x8227=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3e8c83,_0x561dc7){var _0x488c0d=function(_0x5eff9f){while(--_0x5eff9f){_0x3e8c83['push'](_0x3e8c83['shift']());}};_0x488c0d(++_0x561dc7);}(_0x8227,0x146));var _0x7822=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8227[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7822('0x0'));var moment=require('moment');var BPromise=require(_0x7822('0x1'));var rs=require(_0x7822('0x2'));var fs=require('fs');var Redis=require(_0x7822('0x3'));var db=require(_0x7822('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7822('0x5'))(_0x7822('0x6'));var config=require(_0x7822('0x7'));var jayson=require(_0x7822('0x8'));var client=jayson[_0x7822('0x9')][_0x7822('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb55,_0x23d59f,_0x4c5213){return new BPromise(function(_0xe2a3cf,_0x5d749e){return client[_0x7822('0xb')](_0x3fdb55,_0x4c5213)[_0x7822('0xc')](function(_0x3ba7cb){logger[_0x7822('0xd')](_0x7822('0xe'),_0x23d59f,_0x7822('0xf'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x23d59f,_0x7822('0xf'),JSON['stringify'](_0x3ba7cb));if(_0x3ba7cb[_0x7822('0x10')]){if(_0x3ba7cb[_0x7822('0x10')][_0x7822('0x11')]===0x1f4){logger[_0x7822('0x10')](_0x7822('0xe'),_0x23d59f,_0x3ba7cb[_0x7822('0x10')]['message']);return _0x5d749e(_0x3ba7cb['error'][_0x7822('0x12')]);}logger[_0x7822('0x10')]('CloudProvider,\x20%s,\x20%s',_0x23d59f,_0x3ba7cb[_0x7822('0x10')][_0x7822('0x12')]);return _0xe2a3cf(_0x3ba7cb[_0x7822('0x10')][_0x7822('0x12')]);}else{logger[_0x7822('0xd')]('CloudProvider,\x20%s,\x20%s',_0x23d59f,'request\x20sent');_0xe2a3cf(_0x3ba7cb[_0x7822('0x13')][_0x7822('0x12')]);}})[_0x7822('0x14')](function(_0x144fdb){logger[_0x7822('0x10')](_0x7822('0xe'),_0x23d59f,_0x144fdb);_0x5d749e(_0x144fdb);});});} \ No newline at end of file +var _0xaa64=['rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5235b6,_0x13aab0){var _0x302d39=function(_0x63977c){while(--_0x63977c){_0x5235b6['push'](_0x5235b6['shift']());}};_0x302d39(++_0x13aab0);}(_0xaa64,0xf7));var _0x4aa6=function(_0x2818a7,_0xb38d51){_0x2818a7=_0x2818a7-0x0;var _0x3d7a89=_0xaa64[_0x2818a7];return _0x3d7a89;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require('moment');var BPromise=require(_0x4aa6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aa6('0x3'));var db=require(_0x4aa6('0x4'))['db'];var utils=require(_0x4aa6('0x5'));var logger=require('../../config/logger')(_0x4aa6('0x6'));var config=require(_0x4aa6('0x7'));var jayson=require(_0x4aa6('0x8'));var client=jayson[_0x4aa6('0x9')][_0x4aa6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7dd83d,_0x39c4b5,_0x49e174){return new BPromise(function(_0x529c89,_0xee21ba){return client[_0x4aa6('0xb')](_0x7dd83d,_0x49e174)['then'](function(_0x26619c){logger['info'](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));logger[_0x4aa6('0xe')](_0x4aa6('0xf'),_0x39c4b5,'request\x20sent',JSON[_0x4aa6('0x10')](_0x26619c));if(_0x26619c[_0x4aa6('0x11')]){if(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x12')]===0x1f4){logger[_0x4aa6('0x11')](_0x4aa6('0xc'),_0x39c4b5,_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);return _0xee21ba(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}logger['error'](_0x4aa6('0xc'),_0x39c4b5,_0x26619c['error']['message']);return _0x529c89(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}else{logger[_0x4aa6('0x14')](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));_0x529c89(_0x26619c[_0x4aa6('0x15')][_0x4aa6('0x13')]);}})[_0x4aa6('0x16')](function(_0x530ed0){logger[_0x4aa6('0x11')]('CloudProvider,\x20%s,\x20%s',_0x39c4b5,_0x530ed0);_0xee21ba(_0x530ed0);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index bee90a8..6cb0be8 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x132387,_0x45fbc5){var _0x426409=function(_0x205d43){while(--_0x205d43){_0x132387['push'](_0x132387['shift']());}};_0x426409(++_0x45fbc5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'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')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x5f2f,0x73));var _0xf5f2=function(_0x26ef11,_0x5be4e1){_0x26ef11=_0x26ef11-0x0;var _0x61ca13=_0x5f2f[_0x26ef11];return _0x61ca13;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 761fae9..69381b5 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 _0x1323=['name','sequelize','STRING'];(function(_0x447ce1,_0x11cf0b){var _0x4c1e7a=function(_0x6693b9){while(--_0x6693b9){_0x447ce1['push'](_0x447ce1['shift']());}};_0x4c1e7a(++_0x11cf0b);}(_0x1323,0x1f3));var _0x3132=function(_0x348c39,_0x2b1cf3){_0x348c39=_0x348c39-0x0;var _0x135ce4=_0x1323[_0x348c39];return _0x135ce4;};'use strict';var Sequelize=require(_0x3132('0x0'));module['exports']={'name':{'type':Sequelize[_0x3132('0x1')],'unique':_0x3132('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3132('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x3132('0x1')]},'phone':{'type':Sequelize[_0x3132('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3132('0x1')]},'street':{'type':Sequelize[_0x3132('0x1')]},'postalCode':{'type':Sequelize[_0x3132('0x1')]},'city':{'type':Sequelize[_0x3132('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3132('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3132('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x3132('0x1')]},'sCity':{'type':Sequelize[_0x3132('0x1')]},'sCountry':{'type':Sequelize[_0x3132('0x1')]},'description':{'type':Sequelize[_0x3132('0x1')]}}; \ No newline at end of file +var _0xd6a1=['STRING','name','sequelize','exports'];(function(_0x4ebbc4,_0x4bd3ab){var _0x17c498=function(_0xa45a50){while(--_0xa45a50){_0x4ebbc4['push'](_0x4ebbc4['shift']());}};_0x17c498(++_0x4bd3ab);}(_0xd6a1,0x82));var _0x1d6a=function(_0x495203,_0x536f9d){_0x495203=_0x495203-0x0;var _0x1da659=_0xd6a1[_0x495203];return _0x1da659;};'use strict';var Sequelize=require(_0x1d6a('0x0'));module[_0x1d6a('0x1')]={'name':{'type':Sequelize[_0x1d6a('0x2')],'unique':_0x1d6a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1d6a('0x2')]},'companyId':{'type':Sequelize[_0x1d6a('0x2')]},'website':{'type':Sequelize[_0x1d6a('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1d6a('0x2')]},'type':{'type':Sequelize[_0x1d6a('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1d6a('0x2')]},'country':{'type':Sequelize[_0x1d6a('0x2')]},'email':{'type':Sequelize[_0x1d6a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1d6a('0x2')]},'sStreet':{'type':Sequelize[_0x1d6a('0x2')]},'sPostalCode':{'type':Sequelize[_0x1d6a('0x2')]},'sCity':{'type':Sequelize[_0x1d6a('0x2')]},'sCountry':{'type':Sequelize[_0x1d6a('0x2')]},'description':{'type':Sequelize[_0x1d6a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 7825ace..313ae2a 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 _0xb8d5=['include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','ids','omit','getContacts','findOne','CmContact','rawAttributes','sort','eml-format','rimraf','zip-dir','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','then','get','UserProfileResource','destroy','end','error','name','index','CmCompany','describe','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','options','includeAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb8d5,0xc7));var _0x5b8d=function(_0x186d3b,_0x25d00c){_0x186d3b=_0x186d3b-0x0;var _0x278910=_0xb8d5[_0x186d3b];return _0x278910;};'use strict';var emlformat=require(_0x5b8d('0x0'));var rimraf=require(_0x5b8d('0x1'));var zipdir=require(_0x5b8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b8d('0x3'));var Mustache=require(_0x5b8d('0x4'));var util=require(_0x5b8d('0x5'));var path=require(_0x5b8d('0x6'));var sox=require(_0x5b8d('0x7'));var csv=require(_0x5b8d('0x8'));var ejs=require(_0x5b8d('0x9'));var fs=require('fs');var fs_extra=require(_0x5b8d('0xa'));var _=require(_0x5b8d('0xb'));var squel=require(_0x5b8d('0xc'));var crypto=require(_0x5b8d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b8d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b8d('0xf'));var Papa=require(_0x5b8d('0x10'));var Redis=require(_0x5b8d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b8d('0x12'));var as=require(_0x5b8d('0x13'));var hardwareService=require(_0x5b8d('0x14'));var logger=require('../../config/logger')(_0x5b8d('0x15'));var utils=require('../../config/utils');var config=require(_0x5b8d('0x16'));var licenseUtil=require(_0x5b8d('0x17'));var db=require(_0x5b8d('0x18'))['db'];function respondWithStatusCode(_0xb46210,_0x52416c){_0x52416c=_0x52416c||0xcc;return function(_0x56a76d){if(_0x56a76d){return _0xb46210[_0x5b8d('0x19')](_0x52416c);}return _0xb46210[_0x5b8d('0x1a')](_0x52416c)['end']();};}function respondWithResult(_0x26eca4,_0xe5d3fa){_0xe5d3fa=_0xe5d3fa||0xc8;return function(_0xaa4342){if(_0xaa4342){return _0x26eca4[_0x5b8d('0x1a')](_0xe5d3fa)[_0x5b8d('0x1b')](_0xaa4342);}};}function respondWithFilteredResult(_0x409b95,_0x514787){return function(_0x201ca9){if(_0x201ca9){var _0x2cf1eb=typeof _0x514787[_0x5b8d('0x1c')]===_0x5b8d('0x1d')&&typeof _0x514787[_0x5b8d('0x1e')]==='undefined';var _0x43936e=_0x201ca9[_0x5b8d('0x1f')];var _0x551cc8=_0x2cf1eb?0x0:_0x514787[_0x5b8d('0x1c')];var _0xff10e=_0x2cf1eb?_0x201ca9['count']:_0x514787[_0x5b8d('0x1c')]+_0x514787[_0x5b8d('0x1e')];var _0x39a348;if(_0xff10e>=_0x43936e){_0xff10e=_0x43936e;_0x39a348=0xc8;}else{_0x39a348=0xce;}_0x409b95[_0x5b8d('0x1a')](_0x39a348);return _0x409b95['set']('Content-Range',_0x551cc8+'-'+_0xff10e+'/'+_0x43936e)[_0x5b8d('0x1b')](_0x201ca9);}return null;};}function patchUpdates(_0x4f7017){return function(_0x248c62){try{jsonpatch[_0x5b8d('0x20')](_0x248c62,_0x4f7017,!![]);}catch(_0x590de0){return BPromise[_0x5b8d('0x21')](_0x590de0);}return _0x248c62['save']();};}function saveUpdates(_0x5c5627,_0x2b9997){return function(_0x49687c){if(_0x49687c){return _0x49687c['update'](_0x5c5627)[_0x5b8d('0x22')](function(_0x8fa4fc){return _0x8fa4fc;});}return null;};}function removeEntity(_0x5b0eba,_0x32531d){return function(_0x55f7dc){if(_0x55f7dc){return _0x55f7dc['destroy']()[_0x5b8d('0x22')](function(){var _0x432e4f=_0x55f7dc[_0x5b8d('0x23')]({'plain':!![]});var _0x5a965c='Companies';return db[_0x5b8d('0x24')][_0x5b8d('0x25')]({'where':{'type':_0x5a965c,'resourceId':_0x432e4f['id']}})['then'](function(){return _0x55f7dc;});})['then'](function(){_0x5b0eba[_0x5b8d('0x1a')](0xcc)[_0x5b8d('0x26')]();});}};}function handleEntityNotFound(_0x556b9b,_0x455b54){return function(_0x57870f){if(!_0x57870f){_0x556b9b[_0x5b8d('0x19')](0x194);}return _0x57870f;};}function handleError(_0x140206,_0x578254){_0x578254=_0x578254||0x1f4;return function(_0x2c3d61){logger[_0x5b8d('0x27')](_0x2c3d61['stack']);if(_0x2c3d61[_0x5b8d('0x28')]){delete _0x2c3d61[_0x5b8d('0x28')];}_0x140206['status'](_0x578254)['send'](_0x2c3d61);};}exports[_0x5b8d('0x29')]=function(_0xc12e56,_0x3db4c9){var _0x11ba31={},_0x1960da={},_0x2d4fda={'count':0x0,'rows':[]};return db[_0x5b8d('0x2a')][_0x5b8d('0x2b')]()[_0x5b8d('0x22')](function(_0xf3516c){_0x1960da['model']=_[_0x5b8d('0x2c')](_0xf3516c);_0x1960da[_0x5b8d('0x2d')]=_[_0x5b8d('0x2c')](_0xc12e56[_0x5b8d('0x2d')]);_0x1960da[_0x5b8d('0x2e')]=_[_0x5b8d('0x2f')](_0x1960da['model'],_0x1960da[_0x5b8d('0x2d')]);_0x11ba31['attributes']=_[_0x5b8d('0x2f')](_0x1960da['model'],qs[_0x5b8d('0x30')](_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x30')]));_0x11ba31[_0x5b8d('0x31')]=_0x11ba31['attributes'][_0x5b8d('0x32')]?_0x11ba31[_0x5b8d('0x31')]:_0x1960da[_0x5b8d('0x33')];if(!_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x34')](_0x5b8d('0x35'))){_0x11ba31['limit']=qs['limit'](_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x1e')]);_0x11ba31[_0x5b8d('0x1c')]=qs['offset'](_0xc12e56[_0x5b8d('0x2d')]['offset']);}_0x11ba31[_0x5b8d('0x36')]=qs['sort'](_0xc12e56['query']['sort']);_0x11ba31['where']=qs['filters'](_[_0x5b8d('0x37')](_0xc12e56[_0x5b8d('0x2d')],_0x1960da['filters']),_0xf3516c);if(_0xc12e56['query'][_0x5b8d('0x38')]){_0x11ba31[_0x5b8d('0x39')]=_[_0x5b8d('0x3a')](_0x11ba31[_0x5b8d('0x39')],{'$or':_[_0x5b8d('0x3b')](_0x11ba31[_0x5b8d('0x31')],function(_0x2ebe97){var _0x1a6751={};_0x1a6751[_0x2ebe97]={'$like':'%'+_0xc12e56[_0x5b8d('0x2d')]['filter']+'%'};return _0x1a6751;})});}_0x11ba31=_[_0x5b8d('0x3a')]({},_0x11ba31,_0xc12e56[_0x5b8d('0x3c')]);var _0x536ced={'where':_0x11ba31[_0x5b8d('0x39')]};return db[_0x5b8d('0x2a')][_0x5b8d('0x1f')](_0x536ced)['then'](function(_0xd23313){_0x2d4fda[_0x5b8d('0x1f')]=_0xd23313;if(_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x3d')]){_0x11ba31[_0x5b8d('0x3e')]=[{'all':!![]}];}return db[_0x5b8d('0x2a')][_0x5b8d('0x3f')](_0x11ba31);})['then'](function(_0x4593c3){_0x2d4fda[_0x5b8d('0x40')]=_0x4593c3;return _0x2d4fda;})[_0x5b8d('0x22')](respondWithFilteredResult(_0x3db4c9,_0x11ba31))['catch'](handleError(_0x3db4c9,null));})[_0x5b8d('0x41')](handleError(_0x3db4c9,null));};exports[_0x5b8d('0x42')]=function(_0x4a5cb4,_0x16972a){var _0x40ba7c={'raw':![],'where':{'id':_0x4a5cb4[_0x5b8d('0x43')]['id']}},_0x5b2895={};_0x5b2895['model']=_[_0x5b8d('0x2c')](db[_0x5b8d('0x2a')]['rawAttributes']);_0x5b2895[_0x5b8d('0x2d')]=_['keys'](_0x4a5cb4[_0x5b8d('0x2d')]);_0x5b2895[_0x5b8d('0x2e')]=_[_0x5b8d('0x2f')](_0x5b2895[_0x5b8d('0x33')],_0x5b2895[_0x5b8d('0x2d')]);_0x40ba7c[_0x5b8d('0x31')]=_['intersection'](_0x5b2895['model'],qs[_0x5b8d('0x30')](_0x4a5cb4['query']['fields']));_0x40ba7c['attributes']=_0x40ba7c[_0x5b8d('0x31')][_0x5b8d('0x32')]?_0x40ba7c['attributes']:_0x5b2895['model'];if(_0x4a5cb4[_0x5b8d('0x2d')][_0x5b8d('0x3d')]){_0x40ba7c[_0x5b8d('0x3e')]=[{'all':!![]}];}_0x40ba7c=_[_0x5b8d('0x3a')]({},_0x40ba7c,_0x4a5cb4['options']);return db[_0x5b8d('0x2a')][_0x5b8d('0x44')](_0x40ba7c)[_0x5b8d('0x22')](handleEntityNotFound(_0x16972a,null))['then'](respondWithResult(_0x16972a,null))[_0x5b8d('0x41')](handleError(_0x16972a,null));};exports[_0x5b8d('0x45')]=function(_0x544b56,_0x1a29fa){return db['CmCompany']['create'](_0x544b56['body'],{})[_0x5b8d('0x22')](function(_0x580c32){var _0x4ce837=_0x544b56[_0x5b8d('0x46')][_0x5b8d('0x23')]({'plain':!![]});if(!_0x4ce837)throw new Error(_0x5b8d('0x47'));if(_0x4ce837[_0x5b8d('0x48')]===_0x5b8d('0x46')){var _0x1c8d6a=_0x580c32[_0x5b8d('0x23')]({'plain':!![]});var _0x474924=_0x5b8d('0x49');return db[_0x5b8d('0x4a')][_0x5b8d('0x44')]({'where':{'name':_0x474924,'userProfileId':_0x4ce837[_0x5b8d('0x4b')]},'raw':!![]})['then'](function(_0x1a5147){if(_0x1a5147&&_0x1a5147[_0x5b8d('0x4c')]===0x0){return db[_0x5b8d('0x24')]['create']({'name':_0x1c8d6a[_0x5b8d('0x28')],'resourceId':_0x1c8d6a['id'],'type':_0x1a5147[_0x5b8d('0x28')],'sectionId':_0x1a5147['id']},{})['then'](function(){return _0x580c32;});}else{return _0x580c32;}})['catch'](function(_0x1ac492){logger[_0x5b8d('0x27')](_0x5b8d('0x4d'),_0x1ac492);throw _0x1ac492;});}return _0x580c32;})[_0x5b8d('0x22')](respondWithResult(_0x1a29fa,0xc9))[_0x5b8d('0x41')](handleError(_0x1a29fa,null));};exports['update']=function(_0x25e632,_0x572b25){if(_0x25e632[_0x5b8d('0x4e')]['id']){delete _0x25e632[_0x5b8d('0x4e')]['id'];}return db[_0x5b8d('0x2a')]['find']({'where':{'id':_0x25e632[_0x5b8d('0x43')]['id']}})[_0x5b8d('0x22')](handleEntityNotFound(_0x572b25,null))['then'](saveUpdates(_0x25e632['body'],null))[_0x5b8d('0x22')](respondWithResult(_0x572b25,null))[_0x5b8d('0x41')](handleError(_0x572b25,null));};exports['destroy']=function(_0x8e8855,_0x14276b){return db[_0x5b8d('0x2a')]['find']({'where':{'id':_0x8e8855[_0x5b8d('0x43')]['id']}})['then'](handleEntityNotFound(_0x14276b,null))[_0x5b8d('0x22')](removeEntity(_0x14276b,null))[_0x5b8d('0x41')](handleError(_0x14276b,null));};exports['describe']=function(_0x1c0e3a,_0x331b68){return db[_0x5b8d('0x2a')][_0x5b8d('0x2b')]()[_0x5b8d('0x22')](respondWithResult(_0x331b68,null))[_0x5b8d('0x41')](handleError(_0x331b68,null));};exports['addContacts']=function(_0x17132d,_0x1d4a8d,_0x34d4fd){return db['CmContact']['find']({'where':{'id':_0x17132d[_0x5b8d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d4a8d,null))[_0x5b8d('0x22')](function(_0x5b36e9){if(_0x5b36e9){return _0x5b36e9[_0x5b8d('0x4f')](_0x17132d[_0x5b8d('0x4e')][_0x5b8d('0x50')],_[_0x5b8d('0x51')](_0x17132d[_0x5b8d('0x4e')],[_0x5b8d('0x50'),'id'])||{});}})[_0x5b8d('0x22')](respondWithResult(_0x1d4a8d,null))['catch'](handleError(_0x1d4a8d,null));};exports[_0x5b8d('0x52')]=function(_0xdbaaff,_0xb3df0,_0x38c5e8){var _0x192d95={};var _0x5b27f1={};var _0x59dcca;var _0x2a51d9;return db[_0x5b8d('0x2a')][_0x5b8d('0x53')]({'where':{'id':_0xdbaaff['params']['id']}})[_0x5b8d('0x22')](handleEntityNotFound(_0xb3df0,null))[_0x5b8d('0x22')](function(_0x5cd3c2){if(_0x5cd3c2){_0x59dcca=_0x5cd3c2;_0x5b27f1[_0x5b8d('0x33')]=_[_0x5b8d('0x2c')](db[_0x5b8d('0x54')][_0x5b8d('0x55')]);_0x5b27f1[_0x5b8d('0x2d')]=_[_0x5b8d('0x2c')](_0xdbaaff[_0x5b8d('0x2d')]);_0x5b27f1['filters']=_[_0x5b8d('0x2f')](_0x5b27f1[_0x5b8d('0x33')],_0x5b27f1[_0x5b8d('0x2d')]);_0x192d95['attributes']=_[_0x5b8d('0x2f')](_0x5b27f1[_0x5b8d('0x33')],qs[_0x5b8d('0x30')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x30')]));_0x192d95[_0x5b8d('0x31')]=_0x192d95[_0x5b8d('0x31')]['length']?_0x192d95[_0x5b8d('0x31')]:_0x5b27f1[_0x5b8d('0x33')];_0x192d95[_0x5b8d('0x36')]=qs[_0x5b8d('0x56')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x56')]);_0x192d95[_0x5b8d('0x39')]=qs[_0x5b8d('0x2e')](_[_0x5b8d('0x37')](_0xdbaaff[_0x5b8d('0x2d')],_0x5b27f1[_0x5b8d('0x2e')]));if(_0xdbaaff[_0x5b8d('0x2d')]['filter']){_0x192d95[_0x5b8d('0x39')]=_[_0x5b8d('0x3a')](_0x192d95[_0x5b8d('0x39')],{'$or':_[_0x5b8d('0x3b')](_0x192d95[_0x5b8d('0x31')],function(_0x19e58d){var _0x490f17={};_0x490f17[_0x19e58d]={'$like':'%'+_0xdbaaff['query'][_0x5b8d('0x38')]+'%'};return _0x490f17;})});}_0x192d95=_[_0x5b8d('0x3a')]({},_0x192d95,_0xdbaaff['options']);return _0x59dcca[_0x5b8d('0x52')](_0x192d95);}})['then'](function(_0x532ba0){if(_0x532ba0){_0x2a51d9=_0x532ba0['length'];if(!_0xdbaaff[_0x5b8d('0x2d')]['hasOwnProperty'](_0x5b8d('0x35'))){_0x192d95[_0x5b8d('0x1e')]=qs[_0x5b8d('0x1e')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x1e')]);_0x192d95[_0x5b8d('0x1c')]=qs[_0x5b8d('0x1c')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x1c')]);}return _0x59dcca[_0x5b8d('0x52')](_0x192d95);}})[_0x5b8d('0x22')](function(_0x5488e2){if(_0x5488e2){return _0x5488e2?{'count':_0x2a51d9,'rows':_0x5488e2}:null;}})['then'](respondWithResult(_0xb3df0,null))['catch'](handleError(_0xb3df0,null));}; \ No newline at end of file +var _0x9397=['../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','destroy','then','get','Companies','UserProfileResource','sendStatus','error','stack','name','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','map','options','where','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x42b45b,_0x217c8a){var _0x13b752=function(_0xd550a5){while(--_0xd550a5){_0x42b45b['push'](_0x42b45b['shift']());}};_0x13b752(++_0x217c8a);}(_0x9397,0x99));var _0x7939=function(_0x26b367,_0x158299){_0x26b367=_0x26b367-0x0;var _0x5a7c9f=_0x9397[_0x26b367];return _0x5a7c9f;};'use strict';var emlformat=require(_0x7939('0x0'));var rimraf=require(_0x7939('0x1'));var zipdir=require(_0x7939('0x2'));var jsonpatch=require(_0x7939('0x3'));var rp=require(_0x7939('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7939('0x5'));var path=require('path');var sox=require(_0x7939('0x6'));var csv=require('to-csv');var ejs=require(_0x7939('0x7'));var fs=require('fs');var fs_extra=require(_0x7939('0x8'));var _=require(_0x7939('0x9'));var squel=require(_0x7939('0xa'));var crypto=require(_0x7939('0xb'));var jsforce=require(_0x7939('0xc'));var deskjs=require(_0x7939('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7939('0xe'));var Papa=require(_0x7939('0xf'));var Redis=require(_0x7939('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7939('0x11'));var hardwareService=require(_0x7939('0x12'));var logger=require(_0x7939('0x13'))(_0x7939('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7939('0x15'));var db=require(_0x7939('0x16'))['db'];function respondWithStatusCode(_0x37a40c,_0x170d11){_0x170d11=_0x170d11||0xcc;return function(_0x15f6f9){if(_0x15f6f9){return _0x37a40c['sendStatus'](_0x170d11);}return _0x37a40c['status'](_0x170d11)[_0x7939('0x17')]();};}function respondWithResult(_0x10e41f,_0x4ecfb4){_0x4ecfb4=_0x4ecfb4||0xc8;return function(_0x516947){if(_0x516947){return _0x10e41f[_0x7939('0x18')](_0x4ecfb4)['json'](_0x516947);}};}function respondWithFilteredResult(_0x266271,_0x355b6f){return function(_0x26a815){if(_0x26a815){var _0x3ce616=typeof _0x355b6f['offset']===_0x7939('0x19')&&typeof _0x355b6f[_0x7939('0x1a')]==='undefined';var _0x56c0a8=_0x26a815[_0x7939('0x1b')];var _0x4812fd=_0x3ce616?0x0:_0x355b6f[_0x7939('0x1c')];var _0x32a61c=_0x3ce616?_0x26a815[_0x7939('0x1b')]:_0x355b6f['offset']+_0x355b6f['limit'];var _0x7f876b;if(_0x32a61c>=_0x56c0a8){_0x32a61c=_0x56c0a8;_0x7f876b=0xc8;}else{_0x7f876b=0xce;}_0x266271[_0x7939('0x18')](_0x7f876b);return _0x266271['set'](_0x7939('0x1d'),_0x4812fd+'-'+_0x32a61c+'/'+_0x56c0a8)[_0x7939('0x1e')](_0x26a815);}return null;};}function patchUpdates(_0x597ca6){return function(_0x85ac5b){try{jsonpatch[_0x7939('0x1f')](_0x85ac5b,_0x597ca6,!![]);}catch(_0x9dce2c){return BPromise[_0x7939('0x20')](_0x9dce2c);}return _0x85ac5b[_0x7939('0x21')]();};}function saveUpdates(_0x1b3613,_0x244a64){return function(_0x26c3d9){if(_0x26c3d9){return _0x26c3d9['update'](_0x1b3613)['then'](function(_0x214739){return _0x214739;});}return null;};}function removeEntity(_0x46be45,_0x255e1d){return function(_0x275d32){if(_0x275d32){return _0x275d32[_0x7939('0x22')]()[_0x7939('0x23')](function(){var _0xd1687a=_0x275d32[_0x7939('0x24')]({'plain':!![]});var _0x277579=_0x7939('0x25');return db[_0x7939('0x26')]['destroy']({'where':{'type':_0x277579,'resourceId':_0xd1687a['id']}})['then'](function(){return _0x275d32;});})[_0x7939('0x23')](function(){_0x46be45['status'](0xcc)[_0x7939('0x17')]();});}};}function handleEntityNotFound(_0x22839a,_0x486a97){return function(_0x4c77ae){if(!_0x4c77ae){_0x22839a[_0x7939('0x27')](0x194);}return _0x4c77ae;};}function handleError(_0x358d05,_0x313dcb){_0x313dcb=_0x313dcb||0x1f4;return function(_0x1f581d){logger[_0x7939('0x28')](_0x1f581d[_0x7939('0x29')]);if(_0x1f581d[_0x7939('0x2a')]){delete _0x1f581d['name'];}_0x358d05[_0x7939('0x18')](_0x313dcb)['send'](_0x1f581d);};}exports['index']=function(_0x22bfef,_0x2f359e){var _0xdec873={},_0x2d73fb={},_0x3cfdc0={'count':0x0,'rows':[]};return db[_0x7939('0x2b')][_0x7939('0x2c')]()[_0x7939('0x23')](function(_0x51df1a){_0x2d73fb[_0x7939('0x2d')]=_[_0x7939('0x2e')](_0x51df1a);_0x2d73fb[_0x7939('0x2f')]=_['keys'](_0x22bfef['query']);_0x2d73fb['filters']=_[_0x7939('0x30')](_0x2d73fb[_0x7939('0x2d')],_0x2d73fb[_0x7939('0x2f')]);_0xdec873[_0x7939('0x31')]=_[_0x7939('0x30')](_0x2d73fb[_0x7939('0x2d')],qs[_0x7939('0x32')](_0x22bfef['query'][_0x7939('0x32')]));_0xdec873['attributes']=_0xdec873[_0x7939('0x31')][_0x7939('0x33')]?_0xdec873[_0x7939('0x31')]:_0x2d73fb['model'];if(!_0x22bfef[_0x7939('0x2f')][_0x7939('0x34')](_0x7939('0x35'))){_0xdec873[_0x7939('0x1a')]=qs[_0x7939('0x1a')](_0x22bfef[_0x7939('0x2f')][_0x7939('0x1a')]);_0xdec873[_0x7939('0x1c')]=qs[_0x7939('0x1c')](_0x22bfef['query'][_0x7939('0x1c')]);}_0xdec873[_0x7939('0x36')]=qs[_0x7939('0x37')](_0x22bfef[_0x7939('0x2f')]['sort']);_0xdec873['where']=qs[_0x7939('0x38')](_[_0x7939('0x39')](_0x22bfef[_0x7939('0x2f')],_0x2d73fb[_0x7939('0x38')]),_0x51df1a);if(_0x22bfef[_0x7939('0x2f')][_0x7939('0x3a')]){_0xdec873['where']=_[_0x7939('0x3b')](_0xdec873['where'],{'$or':_[_0x7939('0x3c')](_0xdec873[_0x7939('0x31')],function(_0x3b6686){var _0xfd6110={};_0xfd6110[_0x3b6686]={'$like':'%'+_0x22bfef[_0x7939('0x2f')]['filter']+'%'};return _0xfd6110;})});}_0xdec873=_[_0x7939('0x3b')]({},_0xdec873,_0x22bfef[_0x7939('0x3d')]);var _0x198756={'where':_0xdec873[_0x7939('0x3e')]};return db['CmCompany'][_0x7939('0x1b')](_0x198756)[_0x7939('0x23')](function(_0x21b90b){_0x3cfdc0['count']=_0x21b90b;if(_0x22bfef[_0x7939('0x2f')][_0x7939('0x3f')]){_0xdec873['include']=[{'all':!![]}];}return db[_0x7939('0x2b')][_0x7939('0x40')](_0xdec873);})[_0x7939('0x23')](function(_0x250338){_0x3cfdc0[_0x7939('0x41')]=_0x250338;return _0x3cfdc0;})[_0x7939('0x23')](respondWithFilteredResult(_0x2f359e,_0xdec873))[_0x7939('0x42')](handleError(_0x2f359e,null));})[_0x7939('0x42')](handleError(_0x2f359e,null));};exports[_0x7939('0x43')]=function(_0x40e523,_0x3a18dd){var _0xdf7d4={'raw':![],'where':{'id':_0x40e523['params']['id']}},_0x242619={};_0x242619[_0x7939('0x2d')]=_[_0x7939('0x2e')](db[_0x7939('0x2b')][_0x7939('0x44')]);_0x242619[_0x7939('0x2f')]=_[_0x7939('0x2e')](_0x40e523[_0x7939('0x2f')]);_0x242619[_0x7939('0x38')]=_[_0x7939('0x30')](_0x242619[_0x7939('0x2d')],_0x242619['query']);_0xdf7d4[_0x7939('0x31')]=_[_0x7939('0x30')](_0x242619['model'],qs[_0x7939('0x32')](_0x40e523['query'][_0x7939('0x32')]));_0xdf7d4[_0x7939('0x31')]=_0xdf7d4[_0x7939('0x31')][_0x7939('0x33')]?_0xdf7d4[_0x7939('0x31')]:_0x242619[_0x7939('0x2d')];if(_0x40e523[_0x7939('0x2f')]['includeAll']){_0xdf7d4[_0x7939('0x45')]=[{'all':!![]}];}_0xdf7d4=_[_0x7939('0x3b')]({},_0xdf7d4,_0x40e523['options']);return db[_0x7939('0x2b')][_0x7939('0x46')](_0xdf7d4)[_0x7939('0x23')](handleEntityNotFound(_0x3a18dd,null))[_0x7939('0x23')](respondWithResult(_0x3a18dd,null))[_0x7939('0x42')](handleError(_0x3a18dd,null));};exports[_0x7939('0x47')]=function(_0x2a18ba,_0x2ad43f){return db[_0x7939('0x2b')][_0x7939('0x47')](_0x2a18ba[_0x7939('0x48')],{})[_0x7939('0x23')](function(_0x3ae0d0){var _0x186825=_0x2a18ba[_0x7939('0x49')][_0x7939('0x24')]({'plain':!![]});if(!_0x186825)throw new Error(_0x7939('0x4a'));if(_0x186825[_0x7939('0x4b')]===_0x7939('0x49')){var _0x7d037e=_0x3ae0d0['get']({'plain':!![]});var _0x14f06a='Companies';return db[_0x7939('0x4c')][_0x7939('0x46')]({'where':{'name':_0x14f06a,'userProfileId':_0x186825[_0x7939('0x4d')]},'raw':!![]})[_0x7939('0x23')](function(_0x288c4c){if(_0x288c4c&&_0x288c4c[_0x7939('0x4e')]===0x0){return db['UserProfileResource'][_0x7939('0x47')]({'name':_0x7d037e[_0x7939('0x2a')],'resourceId':_0x7d037e['id'],'type':_0x288c4c[_0x7939('0x2a')],'sectionId':_0x288c4c['id']},{})[_0x7939('0x23')](function(){return _0x3ae0d0;});}else{return _0x3ae0d0;}})[_0x7939('0x42')](function(_0x3d1430){logger[_0x7939('0x28')](_0x7939('0x4f'),_0x3d1430);throw _0x3d1430;});}return _0x3ae0d0;})[_0x7939('0x23')](respondWithResult(_0x2ad43f,0xc9))[_0x7939('0x42')](handleError(_0x2ad43f,null));};exports['update']=function(_0x4c62f3,_0x4a0121){if(_0x4c62f3[_0x7939('0x48')]['id']){delete _0x4c62f3[_0x7939('0x48')]['id'];}return db[_0x7939('0x2b')][_0x7939('0x46')]({'where':{'id':_0x4c62f3[_0x7939('0x50')]['id']}})['then'](handleEntityNotFound(_0x4a0121,null))[_0x7939('0x23')](saveUpdates(_0x4c62f3['body'],null))['then'](respondWithResult(_0x4a0121,null))[_0x7939('0x42')](handleError(_0x4a0121,null));};exports['destroy']=function(_0x28d784,_0x227515){return db[_0x7939('0x2b')][_0x7939('0x46')]({'where':{'id':_0x28d784[_0x7939('0x50')]['id']}})[_0x7939('0x23')](handleEntityNotFound(_0x227515,null))[_0x7939('0x23')](removeEntity(_0x227515,null))[_0x7939('0x42')](handleError(_0x227515,null));};exports['describe']=function(_0x40404b,_0x48814d){return db[_0x7939('0x2b')][_0x7939('0x2c')]()[_0x7939('0x23')](respondWithResult(_0x48814d,null))[_0x7939('0x42')](handleError(_0x48814d,null));};exports[_0x7939('0x51')]=function(_0x200e62,_0x123137,_0x5f08cb){return db[_0x7939('0x52')]['find']({'where':{'id':_0x200e62[_0x7939('0x50')]['id']}})[_0x7939('0x23')](handleEntityNotFound(_0x123137,null))['then'](function(_0x4090c0){if(_0x4090c0){return _0x4090c0[_0x7939('0x51')](_0x200e62[_0x7939('0x48')][_0x7939('0x53')],_[_0x7939('0x54')](_0x200e62[_0x7939('0x48')],[_0x7939('0x53'),'id'])||{});}})[_0x7939('0x23')](respondWithResult(_0x123137,null))[_0x7939('0x42')](handleError(_0x123137,null));};exports[_0x7939('0x55')]=function(_0x4c9730,_0x577dd9,_0x1116ea){var _0x31524b={};var _0x1d0d19={};var _0x31ab7d;var _0x111cd9;return db[_0x7939('0x2b')][_0x7939('0x56')]({'where':{'id':_0x4c9730[_0x7939('0x50')]['id']}})[_0x7939('0x23')](handleEntityNotFound(_0x577dd9,null))[_0x7939('0x23')](function(_0x3042f1){if(_0x3042f1){_0x31ab7d=_0x3042f1;_0x1d0d19[_0x7939('0x2d')]=_[_0x7939('0x2e')](db[_0x7939('0x52')][_0x7939('0x44')]);_0x1d0d19[_0x7939('0x2f')]=_[_0x7939('0x2e')](_0x4c9730['query']);_0x1d0d19[_0x7939('0x38')]=_[_0x7939('0x30')](_0x1d0d19['model'],_0x1d0d19['query']);_0x31524b[_0x7939('0x31')]=_[_0x7939('0x30')](_0x1d0d19[_0x7939('0x2d')],qs[_0x7939('0x32')](_0x4c9730[_0x7939('0x2f')]['fields']));_0x31524b['attributes']=_0x31524b[_0x7939('0x31')][_0x7939('0x33')]?_0x31524b['attributes']:_0x1d0d19['model'];_0x31524b[_0x7939('0x36')]=qs[_0x7939('0x37')](_0x4c9730[_0x7939('0x2f')][_0x7939('0x37')]);_0x31524b[_0x7939('0x3e')]=qs[_0x7939('0x38')](_[_0x7939('0x39')](_0x4c9730[_0x7939('0x2f')],_0x1d0d19[_0x7939('0x38')]));if(_0x4c9730[_0x7939('0x2f')][_0x7939('0x3a')]){_0x31524b[_0x7939('0x3e')]=_['merge'](_0x31524b[_0x7939('0x3e')],{'$or':_['map'](_0x31524b[_0x7939('0x31')],function(_0x1b09fd){var _0x19670c={};_0x19670c[_0x1b09fd]={'$like':'%'+_0x4c9730[_0x7939('0x2f')]['filter']+'%'};return _0x19670c;})});}_0x31524b=_['merge']({},_0x31524b,_0x4c9730[_0x7939('0x3d')]);return _0x31ab7d['getContacts'](_0x31524b);}})['then'](function(_0x143513){if(_0x143513){_0x111cd9=_0x143513[_0x7939('0x33')];if(!_0x4c9730[_0x7939('0x2f')]['hasOwnProperty'](_0x7939('0x35'))){_0x31524b['limit']=qs[_0x7939('0x1a')](_0x4c9730[_0x7939('0x2f')][_0x7939('0x1a')]);_0x31524b[_0x7939('0x1c')]=qs[_0x7939('0x1c')](_0x4c9730[_0x7939('0x2f')][_0x7939('0x1c')]);}return _0x31ab7d[_0x7939('0x55')](_0x31524b);}})['then'](function(_0x1eba29){if(_0x1eba29){return _0x1eba29?{'count':_0x111cd9,'rows':_0x1eba29}:null;}})[_0x7939('0x23')](respondWithResult(_0x577dd9,null))[_0x7939('0x42')](handleError(_0x577dd9,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 407e4a4..e4d0b2e 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 _0x4c57=['api','bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x2ca865,_0x93e8bf){var _0x31510d=function(_0x182b9b){while(--_0x182b9b){_0x2ca865['push'](_0x2ca865['shift']());}};_0x31510d(++_0x93e8bf);}(_0x4c57,0x81));var _0x74c5=function(_0x5b942d,_0x1cc659){_0x5b942d=_0x5b942d-0x0;var _0x2e3f86=_0x4c57[_0x5b942d];return _0x2e3f86;};'use strict';var _=require(_0x74c5('0x0'));var util=require(_0x74c5('0x1'));var logger=require(_0x74c5('0x2'))(_0x74c5('0x3'));var moment=require('moment');var BPromise=require(_0x74c5('0x4'));var rp=require(_0x74c5('0x5'));var fs=require('fs');var path=require(_0x74c5('0x6'));var rimraf=require('rimraf');var config=require(_0x74c5('0x7'));var attributes=require('./cmCompany.attributes');module[_0x74c5('0x8')]=function(_0x4b8d2b,_0x4c512a){return _0x4b8d2b[_0x74c5('0x9')](_0x74c5('0xa'),attributes,{'tableName':_0x74c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebfa=['rimraf','../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','moment','bluebird','request-promise'];(function(_0x163d8f,_0x168394){var _0x3f3c38=function(_0x17318e){while(--_0x17318e){_0x163d8f['push'](_0x163d8f['shift']());}};_0x3f3c38(++_0x168394);}(_0xebfa,0xdd));var _0xaebf=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xebfa[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaebf('0x0'));var BPromise=require(_0xaebf('0x1'));var rp=require(_0xaebf('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaebf('0x3'));var config=require(_0xaebf('0x4'));var attributes=require(_0xaebf('0x5'));module['exports']=function(_0xe6f54e,_0x2f4286){return _0xe6f54e['define'](_0xaebf('0x6'),attributes,{'tableName':_0xaebf('0x7'),'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 34c7439..4a4b704 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 _0x1666=['http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x2aba0f,_0x29a10c){var _0x26e2ac=function(_0x278db7){while(--_0x278db7){_0x2aba0f['push'](_0x2aba0f['shift']());}};_0x26e2ac(++_0x29a10c);}(_0x1666,0x107));var _0x6166=function(_0x2197f7,_0x2a2d89){_0x2197f7=_0x2197f7-0x0;var _0x522991=_0x1666[_0x2197f7];return _0x522991;};'use strict';var _=require(_0x6166('0x0'));var util=require(_0x6166('0x1'));var moment=require(_0x6166('0x2'));var BPromise=require(_0x6166('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6166('0x4'));var db=require(_0x6166('0x5'))['db'];var utils=require(_0x6166('0x6'));var logger=require(_0x6166('0x7'))(_0x6166('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6166('0x9')][_0x6166('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf84b7,_0x3f84c0,_0x23b00c){return new BPromise(function(_0x544e39,_0x1eee6f){return client[_0x6166('0xb')](_0xf84b7,_0x23b00c)[_0x6166('0xc')](function(_0x5bab4b){logger[_0x6166('0xd')](_0x6166('0xe'),_0x3f84c0,_0x6166('0xf'));logger['debug'](_0x6166('0x10'),_0x3f84c0,_0x6166('0xf'),JSON['stringify'](_0x5bab4b));if(_0x5bab4b[_0x6166('0x11')]){if(_0x5bab4b[_0x6166('0x11')]['code']===0x1f4){logger[_0x6166('0x11')]('CmCompany,\x20%s,\x20%s',_0x3f84c0,_0x5bab4b['error'][_0x6166('0x12')]);return _0x1eee6f(_0x5bab4b['error'][_0x6166('0x12')]);}logger[_0x6166('0x11')](_0x6166('0xe'),_0x3f84c0,_0x5bab4b['error'][_0x6166('0x12')]);return _0x544e39(_0x5bab4b['error'][_0x6166('0x12')]);}else{logger[_0x6166('0xd')]('CmCompany,\x20%s,\x20%s',_0x3f84c0,'request\x20sent');_0x544e39(_0x5bab4b[_0x6166('0x13')][_0x6166('0x12')]);}})[_0x6166('0x14')](function(_0x4a26b9){logger['error'](_0x6166('0xe'),_0x3f84c0,_0x4a26b9);_0x1eee6f(_0x4a26b9);});});} \ No newline at end of file +var _0x29d1=['moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0x29d1,0x12f));var _0x129d=function(_0x9dc8be,_0x1bab69){_0x9dc8be=_0x9dc8be-0x0;var _0x115701=_0x29d1[_0x9dc8be];return _0x115701;};'use strict';var _=require(_0x129d('0x0'));var util=require('util');var moment=require(_0x129d('0x1'));var BPromise=require(_0x129d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x129d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x129d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x129d('0x5'));var jayson=require(_0x129d('0x6'));var client=jayson[_0x129d('0x7')][_0x129d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c51e5,_0x180663,_0x291770){return new BPromise(function(_0x5c8a6e,_0x4df997){return client[_0x129d('0x9')](_0x3c51e5,_0x291770)['then'](function(_0x2b5abb){logger[_0x129d('0xa')](_0x129d('0xb'),_0x180663,_0x129d('0xc'));logger[_0x129d('0xd')](_0x129d('0xe'),_0x180663,_0x129d('0xc'),JSON['stringify'](_0x2b5abb));if(_0x2b5abb[_0x129d('0xf')]){if(_0x2b5abb['error'][_0x129d('0x10')]===0x1f4){logger[_0x129d('0xf')]('CmCompany,\x20%s,\x20%s',_0x180663,_0x2b5abb['error']['message']);return _0x4df997(_0x2b5abb[_0x129d('0xf')][_0x129d('0x11')]);}logger[_0x129d('0xf')](_0x129d('0xb'),_0x180663,_0x2b5abb[_0x129d('0xf')]['message']);return _0x5c8a6e(_0x2b5abb[_0x129d('0xf')][_0x129d('0x11')]);}else{logger[_0x129d('0xa')](_0x129d('0xb'),_0x180663,_0x129d('0xc'));_0x5c8a6e(_0x2b5abb['result'][_0x129d('0x11')]);}})[_0x129d('0x12')](function(_0x4afde4){logger[_0x129d('0xf')]('CmCompany,\x20%s,\x20%s',_0x180663,_0x4afde4);_0x4df997(_0x4afde4);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 4d29e3d..8d987cc 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 _0x1635=['../../config/environment','get','index','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x20c19f,_0xe79d0e){var _0x4e6151=function(_0x5744a9){while(--_0x5744a9){_0x20c19f['push'](_0x20c19f['shift']());}};_0x4e6151(++_0xe79d0e);}(_0x1635,0xea));var _0x5163=function(_0x2dd69d,_0x34fb32){_0x2dd69d=_0x2dd69d-0x0;var _0x31149b=_0x1635[_0x2dd69d];return _0x31149b;};'use strict';var multer=require(_0x5163('0x0'));var util=require(_0x5163('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5163('0x2'));var router=express[_0x5163('0x3')]();var fs_extra=require(_0x5163('0x4'));var auth=require(_0x5163('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5163('0x6'));var controller=require('./cmCompany.controller');router[_0x5163('0x7')]('/',auth['isAuthenticated'](),controller[_0x5163('0x8')]);router[_0x5163('0x7')]('/describe',auth[_0x5163('0x9')](),controller[_0x5163('0xa')]);router[_0x5163('0x7')](_0x5163('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x5163('0xc'),auth[_0x5163('0x9')](),controller[_0x5163('0xd')]);router[_0x5163('0xe')]('/',auth[_0x5163('0x9')](),controller[_0x5163('0xf')]);router[_0x5163('0xe')](_0x5163('0xc'),auth['isAuthenticated'](),controller['addContacts']);router[_0x5163('0x10')](_0x5163('0xb'),auth[_0x5163('0x9')](),controller['update']);router[_0x5163('0x11')](_0x5163('0xb'),auth[_0x5163('0x9')](),controller[_0x5163('0x12')]);module[_0x5163('0x13')]=router; \ No newline at end of file +var _0xa6f4=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x44f37d,_0x1dc5f5){var _0x36de2f=function(_0x5a899d){while(--_0x5a899d){_0x44f37d['push'](_0x44f37d['shift']());}};_0x36de2f(++_0x1dc5f5);}(_0xa6f4,0x1f2));var _0x4a6f=function(_0x4288fd,_0x147149){_0x4288fd=_0x4288fd-0x0;var _0x5502f0=_0xa6f4[_0x4288fd];return _0x5502f0;};'use strict';var multer=require(_0x4a6f('0x0'));var util=require(_0x4a6f('0x1'));var path=require(_0x4a6f('0x2'));var timeout=require(_0x4a6f('0x3'));var express=require(_0x4a6f('0x4'));var router=express[_0x4a6f('0x5')]();var fs_extra=require(_0x4a6f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4a6f('0x7'));var config=require(_0x4a6f('0x8'));var controller=require('./cmCompany.controller');router[_0x4a6f('0x9')]('/',auth[_0x4a6f('0xa')](),controller['index']);router['get']('/describe',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0xb')]);router[_0x4a6f('0x9')](_0x4a6f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4a6f('0x9')](_0x4a6f('0xd'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0xe')]);router[_0x4a6f('0xf')]('/',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x10')]);router[_0x4a6f('0xf')]('/:id/contacts',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x11')]);router[_0x4a6f('0x12')](_0x4a6f('0xc'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x13')]);router[_0x4a6f('0x14')](_0x4a6f('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index e54023d..7e2b7a9 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 _0xf306=['INTEGER','lodash','sequelize','exports','STRING','TEXT'];(function(_0x477daf,_0x324543){var _0x26dd75=function(_0x3502ae){while(--_0x3502ae){_0x477daf['push'](_0x477daf['shift']());}};_0x26dd75(++_0x324543);}(_0xf306,0x145));var _0x6f30=function(_0x1760e9,_0xbbfd0b){_0x1760e9=_0x1760e9-0x0;var _0x3fe586=_0xf306[_0x1760e9];return _0x3fe586;};'use strict';var _=require(_0x6f30('0x0'));var Sequelize=require(_0x6f30('0x1'));module[_0x6f30('0x2')]={'firstName':{'type':Sequelize[_0x6f30('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6f30('0x3')]},'street':{'type':Sequelize[_0x6f30('0x3')]},'postalCode':{'type':Sequelize[_0x6f30('0x3')]},'city':{'type':Sequelize[_0x6f30('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6f30('0x3')]},'description':{'type':Sequelize[_0x6f30('0x4')]},'phone':{'type':Sequelize[_0x6f30('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6f30('0x3')]},'email':{'type':Sequelize[_0x6f30('0x3')]},'url':{'type':Sequelize[_0x6f30('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x6f30('0x3')]},'twitter':{'type':Sequelize[_0x6f30('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x6f30('0x3')]},'viber':{'type':Sequelize[_0x6f30('0x3')]},'line':{'type':Sequelize[_0x6f30('0x3')]},'wechat':{'type':Sequelize[_0x6f30('0x3')]},'telegram':{'type':Sequelize[_0x6f30('0x3')]},'UserId':{'type':Sequelize[_0x6f30('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x6f30('0x3')]},'priority':{'type':Sequelize[_0x6f30('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x6f30('0x3')]},'utcOffset':{'type':Sequelize[_0x6f30('0x5')]}}; \ No newline at end of file +var _0x99bb=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x158339,_0x121062){var _0x5f3c50=function(_0x59b0fd){while(--_0x59b0fd){_0x158339['push'](_0x158339['shift']());}};_0x5f3c50(++_0x121062);}(_0x99bb,0x6c));var _0xb99b=function(_0xc35e79,_0x37df8f){_0xc35e79=_0xc35e79-0x0;var _0x2f2750=_0x99bb[_0xc35e79];return _0x2f2750;};'use strict';var _=require(_0xb99b('0x0'));var Sequelize=require(_0xb99b('0x1'));module[_0xb99b('0x2')]={'firstName':{'type':Sequelize[_0xb99b('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb99b('0x3')]},'street':{'type':Sequelize[_0xb99b('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb99b('0x3')]},'country':{'type':Sequelize[_0xb99b('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb99b('0x3')]},'description':{'type':Sequelize[_0xb99b('0x4')]},'phone':{'type':Sequelize[_0xb99b('0x3')]},'mobile':{'type':Sequelize[_0xb99b('0x3')]},'fax':{'type':Sequelize[_0xb99b('0x3')]},'email':{'type':Sequelize[_0xb99b('0x3')]},'url':{'type':Sequelize[_0xb99b('0x3')]},'facebook':{'type':Sequelize[_0xb99b('0x3')]},'fb_data':{'type':Sequelize[_0xb99b('0x3')]},'twitter':{'type':Sequelize[_0xb99b('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xb99b('0x3')]},'viber':{'type':Sequelize[_0xb99b('0x3')]},'line':{'type':Sequelize[_0xb99b('0x3')]},'wechat':{'type':Sequelize[_0xb99b('0x3')]},'telegram':{'type':Sequelize[_0xb99b('0x3')]},'UserId':{'type':Sequelize[_0xb99b('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xb99b('0x3')]},'priority':{'type':Sequelize[_0xb99b('0x5')](0x2)[_0xb99b('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb99b('0x7')],'defaultValue':Sequelize[_0xb99b('0x8')]},'dialTimezone':{'type':Sequelize[_0xb99b('0x3')]},'utcOffset':{'type':Sequelize[_0xb99b('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index da51ad1..f793e76 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 _0x8dd4=['../../components/parsers/qs','../../config/logger','../../config/environment/shared','redis','defaults','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','update','then','destroy','sendStatus','stack','name','send','describe','getOptions','query','catch','CmContact','find','tags','keys','length','cf_','displayName','analytics','CmCustomField','columnName','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','findAll','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','WhatsappInteraction','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','push','ListId','findOrCreate','spread','contact','all','Tag','color','Phones','params','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','omit','format','pickBy','startsWith','cf_%d','isEmpty','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','filters','intersection','fields','attributes','order','sort','pick','filter','map','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','nolimit','ContactId','options','includeAll','include','getHopperHistories','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','User','agent','binding','../../components/import/cm/csv2','stringify','exit','message','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','-createdAt','channel','includes','toLowerCase','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','callerid','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','DESC','range','findAndCountAll','alias','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','UserId','key','Owner','fullname','Tags','customerIp','customerPort','deviceModel','ratingMessage','referer','substatus','threadId','Interaction','sortBy','reverse','value','moment','bluebird','path','lodash','squel','papaparse','ioredis','../../components/contacts'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x8dd4,0x1dc));var _0x48dd=function(_0x2c78df,_0x4e8eae){_0x2c78df=_0x2c78df-0x0;var _0x1a602d=_0x8dd4[_0x2c78df];return _0x1a602d;};'use strict';var moment=require(_0x48dd('0x0'));var BPromise=require(_0x48dd('0x1'));var util=require('util');var path=require(_0x48dd('0x2'));var fs=require('fs');var _=require(_0x48dd('0x3'));var squel=require(_0x48dd('0x4'));var Papa=require(_0x48dd('0x5'));var Redis=require(_0x48dd('0x6'));var contacts=require(_0x48dd('0x7'));var qs=require(_0x48dd('0x8'));var logger=require(_0x48dd('0x9'))('api');var config=require('../../config/environment');var shared=require(_0x48dd('0xa'));var db=require('../../mysqldb')['db'];config[_0x48dd('0xb')]=_[_0x48dd('0xc')](config[_0x48dd('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48dd('0xb')]));require(_0x48dd('0xd'))[_0x48dd('0xe')](socket);function respondWithResult(_0x2c8ea6,_0x31a56e){_0x31a56e=_0x31a56e||0xc8;return function(_0x59ac9c){if(_0x59ac9c){return _0x2c8ea6[_0x48dd('0xf')](_0x31a56e)[_0x48dd('0x10')](_0x59ac9c);}};}function respondWithFilteredResult(_0xe39852,_0x222daf){return function(_0x120407){if(_0x120407){var _0x198343=typeof _0x222daf[_0x48dd('0x11')]===_0x48dd('0x12')&&typeof _0x222daf[_0x48dd('0x13')]==='undefined';var _0x17ccc8=_0x120407[_0x48dd('0x14')];var _0x57d1d2=_0x198343?0x0:_0x222daf[_0x48dd('0x11')];var _0x4ae985=_0x198343?_0x120407['count']:_0x222daf['offset']+_0x222daf['limit'];var _0x52c2ff;if(_0x4ae985>=_0x17ccc8){_0x4ae985=_0x17ccc8;_0x52c2ff=0xc8;}else{_0x52c2ff=0xce;}_0xe39852[_0x48dd('0xf')](_0x52c2ff);return _0xe39852[_0x48dd('0x15')]('Content-Range',_0x57d1d2+'-'+_0x4ae985+'/'+_0x17ccc8)[_0x48dd('0x10')](_0x120407);}return null;};}function saveUpdates(_0x8848f3){return function(_0x28511c){if(_0x28511c){return _0x28511c[_0x48dd('0x16')](_0x8848f3)[_0x48dd('0x17')](function(_0x2d069e){return _0x2d069e;});}return null;};}function removeEntity(_0x1ded92){return function(_0x1ace51){if(_0x1ace51){return _0x1ace51[_0x48dd('0x18')]()['then'](function(){_0x1ded92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2450bd){return function(_0x540d92){if(!_0x540d92){_0x2450bd[_0x48dd('0x19')](0x194);}return _0x540d92;};}function handleError(_0x3e2392,_0x56c7ae){_0x56c7ae=_0x56c7ae||0x1f4;return function(_0x678a){logger['error'](_0x678a[_0x48dd('0x1a')]);if(_0x678a[_0x48dd('0x1b')]){delete _0x678a[_0x48dd('0x1b')];}_0x3e2392['status'](_0x56c7ae)[_0x48dd('0x1c')](_0x678a);};}exports['index']=function(_0x153648,_0xfdd408){var _0x2d4b38={};return contacts[_0x48dd('0x1d')]()[_0x48dd('0x17')](function(_0x3eeacf){_0x2d4b38=qs[_0x48dd('0x1e')](_0x3eeacf,_0x153648);return contacts['findAll'](_0x153648[_0x48dd('0x1f')],_0x153648['user'],_0x2d4b38,_0x3eeacf);})[_0x48dd('0x17')](respondWithFilteredResult(_0xfdd408,_0x2d4b38))[_0x48dd('0x20')](handleError(_0xfdd408,null));};exports[_0x48dd('0x18')]=function(_0x36c45e,_0xd811c3){return db[_0x48dd('0x21')][_0x48dd('0x22')]({'where':{'id':_0x36c45e['params']['id']}})['then'](handleEntityNotFound(_0xd811c3,null))['then'](removeEntity(_0xd811c3,null))['catch'](handleError(_0xd811c3,null));};exports[_0x48dd('0x1d')]=function(_0x15ec62,_0x1de20d){return db['CmContact'][_0x48dd('0x1d')]()['then'](function(_0x1671a2){delete _0x1671a2[_0x48dd('0x23')];for(var _0x5022ae=0x0;_0x5022ae0x0){return new Promise(function(_0x585bb2){var _0x2c3c37=[];for(var _0xf466a9=0x0;_0xf466a9<_0x596114[_0x48dd('0x25')];_0xf466a9++){_0x2c3c37[_0x48dd('0x59')](insertAdditionalPhones(_0x596114[_0xf466a9][_0x48dd('0x5d')],_0x596114[_0xf466a9][_0x48dd('0x55')]));}Promise[_0x48dd('0x5e')](_0x2c3c37)[_0x48dd('0x17')](function(){_0x585bb2(0x1);});})['then'](function(){return{'success':_0x98c0bb,'failure':_0x286544,'duplicates':_0x13ce6b};});}else{return{'success':_0x98c0bb,'failure':_0x286544,'duplicates':_0x13ce6b};}}})[_0x48dd('0x17')](respondWithResult(_0x588a1b,0xc9))[_0x48dd('0x20')](handleError(_0x588a1b,null));};exports['show']=function(_0x6a478f,_0x108f0d){var _0x3f5d41;return db['CmContact'][_0x48dd('0x1d')]()['then'](function(_0x27bf43){return db[_0x48dd('0x21')]['find']({'where':{'id':_0x6a478f['params']['id']},'include':[{'model':db[_0x48dd('0x5f')],'as':'Tags','attributes':['id',_0x48dd('0x1b'),_0x48dd('0x60')],'required':_0x6a478f[_0x48dd('0x1f')]['tag']?!![]:![]},{'model':db[_0x48dd('0x48')],'as':_0x48dd('0x61'),'where':{'CmContactId':_0x6a478f[_0x48dd('0x62')]['id']},'required':![],'include':[{'model':db[_0x48dd('0x63')],'as':_0x48dd('0x64')}]}],'order':[db[_0x48dd('0x65')]['literal'](_0x48dd('0x66'))],'attributes':_[_0x48dd('0x24')](_0x27bf43)});})[_0x48dd('0x17')](function(_0x3ede7b){if(!_[_0x48dd('0x51')](_0x3ede7b)){_0x3f5d41=_0x3ede7b[_0x48dd('0x35')]({'plain':!![]});var _0x6875b5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3ede7b&&_0x3ede7b['ListId']){if(_0x3ede7b[_0x48dd('0x5a')]){_0x6875b5[_0x48dd('0x58')][_0x48dd('0x67')][_0x48dd('0x59')]({'ListId':{'$ne':_0x3ede7b[_0x48dd('0x5a')]}});}}return db[_0x48dd('0x29')][_0x48dd('0x33')](_0x6875b5);}})[_0x48dd('0x17')](function(_0x4ae357){if(!_[_0x48dd('0x51')](_0x4ae357)){return _[_0x48dd('0x68')](_0x3f5d41,_['map'](_0x4ae357,function(_0x3034e8){return util[_0x48dd('0x69')]('cf_%d',_0x3034e8['id']);}));}})[_0x48dd('0x17')](handleEntityNotFound(_0x108f0d,null))[_0x48dd('0x17')](respondWithResult(_0x108f0d,null))['catch'](handleError(_0x108f0d,null));};exports['update']=function(_0x211bd0,_0x3f179b){var _0x2aebef;if(_0x211bd0['body']['id']){delete _0x211bd0[_0x48dd('0x32')]['id'];}if(!_[_0x48dd('0x51')](_0x211bd0[_0x48dd('0x32')][_0x48dd('0x52')])){var _0x314403=_0x211bd0['body'][_0x48dd('0x52')];if(!_[_0x48dd('0x51')](shared['timezones'][_0x314403]))_0x211bd0[_0x48dd('0x32')][_0x48dd('0x54')]=shared['timezones'][_0x314403]['utcOffset'];}return db[_0x48dd('0x21')][_0x48dd('0x22')]({'where':{'id':_0x211bd0['params']['id']}})[_0x48dd('0x17')](handleEntityNotFound(_0x3f179b,null))['then'](saveUpdates(_0x211bd0[_0x48dd('0x32')],null))[_0x48dd('0x17')](function(_0x4a019a){_0x2aebef=_0x4a019a;var _0x16d814={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4a019a&&_0x4a019a[_0x48dd('0x5a')]){if(_0x4a019a['ListId']){_0x16d814[_0x48dd('0x58')][_0x48dd('0x67')]['push']({'ListId':{'$ne':_0x4a019a['ListId']}});}}return db[_0x48dd('0x29')]['findAll'](_0x16d814);})[_0x48dd('0x17')](function(_0x28c85f){if(_0x28c85f){return _[_0x48dd('0x68')](_[_0x48dd('0x6a')](_0x211bd0['body'],function(_0x1658a3,_0x5f5807){return _[_0x48dd('0x6b')](_0x5f5807,'cf_');}),_['map'](_0x28c85f,function(_0x564030){return util[_0x48dd('0x69')](_0x48dd('0x6c'),_0x564030['id']);}));}})['then'](function(_0x42ff48){if(_0x42ff48&&!_[_0x48dd('0x6d')](_0x42ff48)){var _0x193136=squel[_0x48dd('0x16')]()[_0x48dd('0x6e')]('cm_contacts')[_0x48dd('0x6f')](_0x42ff48)[_0x48dd('0x58')](_0x48dd('0x70'),_0x211bd0[_0x48dd('0x62')]['id'])[_0x48dd('0x71')]();return db['sequelize'][_0x48dd('0x1f')](_0x193136[_0x48dd('0x72')],{'replacements':_0x193136['values']});}})[_0x48dd('0x17')](function(){if(_0x211bd0[_0x48dd('0x32')][_0x48dd('0x73')]&&_0x2aebef){return db['CmHopper'][_0x48dd('0x16')]({'phone':_0x211bd0['body'][_0x48dd('0x73')],'OrderBy':0x0},{'where':{'ContactId':_0x2aebef['id']}});}})[_0x48dd('0x17')](function(){return _0x2aebef;})[_0x48dd('0x17')](respondWithResult(_0x3f179b,null))['catch'](handleError(_0x3f179b,null));};exports[_0x48dd('0x74')]=function(_0x21027a,_0x55a725){var _0x22ce7e={};var _0x241977={};var _0x1af3d4;var _0x27bc56;return db[_0x48dd('0x21')][_0x48dd('0x75')]({'where':{'id':_0x21027a[_0x48dd('0x62')]['id']}})[_0x48dd('0x17')](handleEntityNotFound(_0x55a725,null))[_0x48dd('0x17')](function(_0x58a0d6){if(_0x58a0d6){_0x1af3d4=_0x58a0d6;_0x241977[_0x48dd('0x76')]=_[_0x48dd('0x24')](db[_0x48dd('0x5f')]['rawAttributes']);_0x241977['query']=_[_0x48dd('0x24')](_0x21027a[_0x48dd('0x1f')]);_0x241977[_0x48dd('0x77')]=_['intersection'](_0x241977[_0x48dd('0x76')],_0x241977[_0x48dd('0x1f')]);_0x22ce7e['attributes']=_[_0x48dd('0x78')](_0x241977[_0x48dd('0x76')],qs[_0x48dd('0x79')](_0x21027a[_0x48dd('0x1f')]['fields']));_0x22ce7e['attributes']=_0x22ce7e[_0x48dd('0x7a')]['length']?_0x22ce7e[_0x48dd('0x7a')]:_0x241977[_0x48dd('0x76')];_0x22ce7e[_0x48dd('0x7b')]=qs[_0x48dd('0x7c')](_0x21027a[_0x48dd('0x1f')][_0x48dd('0x7c')]);_0x22ce7e[_0x48dd('0x58')]=qs[_0x48dd('0x77')](_[_0x48dd('0x7d')](_0x21027a[_0x48dd('0x1f')],_0x241977[_0x48dd('0x77')]));if(_0x21027a['query'][_0x48dd('0x7e')]){_0x22ce7e[_0x48dd('0x58')]=_[_0x48dd('0x31')](_0x22ce7e[_0x48dd('0x58')],{'$or':_[_0x48dd('0x7f')](_0x22ce7e[_0x48dd('0x7a')],function(_0x9c32b7){var _0x4343c3={};_0x4343c3[_0x9c32b7]={'$like':'%'+_0x21027a['query'][_0x48dd('0x7e')]+'%'};return _0x4343c3;})});}_0x22ce7e=_['merge']({},_0x22ce7e,_0x21027a['options']);return _0x1af3d4['getTags'](_0x22ce7e);}})['then'](function(_0x26b4ad){if(_0x26b4ad){_0x27bc56=_0x26b4ad[_0x48dd('0x25')];if(!_0x21027a[_0x48dd('0x1f')][_0x48dd('0x30')]('nolimit')){_0x22ce7e[_0x48dd('0x13')]=qs[_0x48dd('0x13')](_0x21027a[_0x48dd('0x1f')][_0x48dd('0x13')]);_0x22ce7e[_0x48dd('0x11')]=qs[_0x48dd('0x11')](_0x21027a[_0x48dd('0x1f')][_0x48dd('0x11')]);}return _0x1af3d4[_0x48dd('0x74')](_0x22ce7e);}})[_0x48dd('0x17')](function(_0x233c73){if(_0x233c73){return _0x233c73?{'count':_0x27bc56,'rows':_0x233c73}:null;}})[_0x48dd('0x17')](respondWithResult(_0x55a725,null))['catch'](handleError(_0x55a725,null));};exports[_0x48dd('0x80')]=function(_0x597e97,_0x31d174){if(_0x597e97[_0x48dd('0x32')]['id']){delete _0x597e97[_0x48dd('0x32')]['id'];}return db[_0x48dd('0x21')][_0x48dd('0x75')]({'where':{'id':_0x597e97['params']['id']}})[_0x48dd('0x17')](handleEntityNotFound(_0x31d174,null))['then'](function(_0x5a4d13){if(_0x5a4d13){return _0x5a4d13[_0x48dd('0x80')](_0x597e97[_0x48dd('0x32')][_0x48dd('0x81')]||[]);}return null;})[_0x48dd('0x17')](respondWithResult(_0x31d174,null))[_0x48dd('0x20')](handleError(_0x31d174,null));};exports[_0x48dd('0x82')]=function(_0x31f2a7,_0x4d9381){var _0x3d4c11=[];_0x3d4c11['push'](addAdditionalPhones(_0x31f2a7[_0x48dd('0x32')]));Promise[_0x48dd('0x5e')](_0x3d4c11)[_0x48dd('0x17')](function(){_0x3d4c11=[];_0x3d4c11[_0x48dd('0x59')](deleteCmHopperPhones(_0x31f2a7[_0x48dd('0x32')]['id']));_0x3d4c11[_0x48dd('0x59')](addCmHopperPhones(_0x31f2a7[_0x48dd('0x32')]['id']));Promise[_0x48dd('0x5e')](_0x3d4c11)['then'](function(){return[0x1];})[_0x48dd('0x17')](respondWithResult(_0x4d9381,null));});};function addAdditionalPhones(_0x28d6a5){var _0x91ad70;return new Promise(function(_0x252658){return db[_0x48dd('0x48')]['destroy']({'where':{'CmContactId':_0x28d6a5['id']}})[_0x48dd('0x17')](function(){db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x48dd('0x83')]})[_0x48dd('0x17')](function(_0x21b7c3){var _0x50d0b8=[];for(var _0x25cf16=0x0;_0x25cf16<_0x28d6a5[_0x48dd('0x84')][_0x48dd('0x25')];_0x25cf16++){var _0x397f81=_0x28d6a5[_0x48dd('0x85')]?_[_0x48dd('0x51')](_0x28d6a5[_0x48dd('0x85')][_0x25cf16])?'':_0x28d6a5['item_types'][_0x25cf16]:_0x28d6a5[_0x48dd('0x84')][_0x25cf16][_0x48dd('0x86')]?_0x28d6a5[_0x48dd('0x84')][_0x25cf16][_0x48dd('0x86')]:'';var _0x3cfad2=_['isNil'](_0x28d6a5[_0x48dd('0x84')][_0x25cf16][_0x48dd('0x87')])?'':_0x28d6a5[_0x48dd('0x84')][_0x25cf16][_0x48dd('0x87')];var _0x5bcc2a=_0x397f81+':'+_0x28d6a5[_0x48dd('0x84')][_0x25cf16][_0x48dd('0x73')]+'§'+_0x3cfad2;if(_[_0x48dd('0x51')](_0x91ad70))_0x91ad70=_0x5bcc2a;else _0x91ad70+=';'+_0x5bcc2a;var _0x16320f=null;var _0x143a39=null;if(_0x28d6a5['item_types']){if(!_[_0x48dd('0x51')](_0x28d6a5['item_types'][_0x25cf16])){_0x143a39=_[_0x48dd('0x22')](_0x21b7c3,function(_0x4cb6e5){return _0x4cb6e5['id']===_0x28d6a5['item_types'][_0x25cf16];});if(!_[_0x48dd('0x51')](_0x143a39)){_0x16320f=_0x143a39[_0x48dd('0x83')];}}}else{if(!_[_0x48dd('0x51')](_0x28d6a5[_0x48dd('0x84')][_0x25cf16])){_0x143a39=_['find'](_0x21b7c3,function(_0x3bb262){return _0x3bb262['id']===_0x28d6a5['items'][_0x25cf16][_0x48dd('0x86')];});if(!_[_0x48dd('0x51')](_0x143a39)){_0x16320f=_0x25cf16;}}}if(_[_0x48dd('0x51')](_0x16320f)){_0x16320f=0x64;}_0x50d0b8[_0x48dd('0x59')](addAdditionalPhone(_0x28d6a5['id'],_0x28d6a5[_0x48dd('0x84')][_0x25cf16]['phone'],_0x28d6a5['item_types']?_[_0x48dd('0x51')](_0x28d6a5['item_types'][_0x25cf16])?null:_0x28d6a5[_0x48dd('0x85')][_0x25cf16]:_0x28d6a5[_0x48dd('0x84')][_0x25cf16][_0x48dd('0x86')]?_0x28d6a5[_0x48dd('0x84')][_0x25cf16][_0x48dd('0x86')]:null,_0x16320f,_0x3cfad2));}Promise[_0x48dd('0x5e')](_0x50d0b8)[_0x48dd('0x17')](function(){db[_0x48dd('0x21')]['update']({'AdditionalPhones':_0x91ad70},{'where':{'id':_0x28d6a5['id']}})[_0x48dd('0x17')](function(){_0x252658(0x1);});});});});});}function addAdditionalPhone(_0x3f25c9,_0x5f1d4e,_0x4469bf,_0x3393e0,_0x1541d7){return db[_0x48dd('0x48')][_0x48dd('0x22')]({'where':{'CmContactId':_0x3f25c9,'item':_0x5f1d4e}})[_0x48dd('0x17')](function(_0x49fcd8){if(_0x49fcd8)logger[_0x48dd('0x2d')]('contact\x20phone\x20exists',_0x49fcd8);else{db[_0x48dd('0x48')][_0x48dd('0x3d')]({'CmContactId':_0x3f25c9,'item':_0x5f1d4e,'ItemTypeId':_0x4469bf,'OrderBy':_0x3393e0,'ItemClass':_0x48dd('0x88'),'description':_0x1541d7});}});}function deleteCmHopperPhones(_0x5652fb){return new Promise(function(_0x5ac1d8){return db[_0x48dd('0x39')][_0x48dd('0x33')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5652fb}})[_0x48dd('0x17')](function(_0x2bbdf8){db[_0x48dd('0x89')][_0x48dd('0x18')]({'where':{'CmHopperId':{'$in':_['map'](_0x2bbdf8,'id')}}});})[_0x48dd('0x17')](function(){_0x5ac1d8(0x1);});});}function addCmHopperPhones(_0x91af03){return new Promise(function(_0x2afc67){return db[_0x48dd('0x39')][_0x48dd('0x33')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x91af03}})['then'](function(_0x478424){var _0xe5fbf2=[];_[_0x48dd('0x7f')](_0x478424,function(_0x2429d2){_0xe5fbf2['push'](createCmHopperPhone(_0x91af03,_0x2429d2['id']));});Promise[_0x48dd('0x5e')](_0xe5fbf2)[_0x48dd('0x17')](function(){_0x2afc67(0x1);});});});}function createCmHopperPhone(_0x27b81e,_0x3b4781){return new Promise(function(_0x2b1dd5){db[_0x48dd('0x48')]['findAll']({'raw':!![],'attributes':[_0x48dd('0x8a'),_0x48dd('0x83')],'where':{'CmContactId':_0x27b81e,'ItemClass':_0x48dd('0x88')},'include':[{'model':db[_0x48dd('0x63')],'attributes':[_0x48dd('0x83')],'as':_0x48dd('0x64')}],'order':['OrderBy',db[_0x48dd('0x65')][_0x48dd('0x8b')](_0x48dd('0x8c'))]})[_0x48dd('0x17')](function(_0x495c7f){var _0x519481=0x1;var _0x59463c=_['map'](_0x495c7f,function(_0x4c71f6){_0x4c71f6['CmHopperId']=_0x3b4781;_0x4c71f6['phone']=_0x4c71f6[_0x48dd('0x8a')];_0x4c71f6[_0x48dd('0x83')]=_0x519481;delete _0x4c71f6[_0x48dd('0x8d')];_0x519481=_0x519481+0x1;return _0x4c71f6;});return db[_0x48dd('0x89')][_0x48dd('0x56')](_0x59463c,{});})[_0x48dd('0x17')](function(){_0x2b1dd5(0x1);});});}function insertAdditionalPhones(_0x588c0b,_0x50214d){return new Promise(function(_0x4e0680){var _0x7715d6=[];for(var _0x473f3b=0x0;_0x473f3b<_0x50214d[_0x48dd('0x25')];_0x473f3b++){var _0x4a4e86=_0x50214d[_0x473f3b];_0x7715d6[_0x48dd('0x59')](parseContactItemType(_0x4a4e86));}Promise[_0x48dd('0x5e')](_0x7715d6)['then'](function(){var _0xc0f4af={'id':_0x588c0b['id'],'items':_0x50214d};return addAdditionalPhones(_0xc0f4af)[_0x48dd('0x17')](function(){return addCmHopperPhones(_0x588c0b['id']);});})['then'](function(){_0x4e0680(_0x588c0b);});});}function parseContactItemType(_0x2abd08){return new Promise(function(_0xae8f65){if(_0x2abd08[_0x48dd('0x30')](_0x48dd('0x86'))){_0xae8f65(_0x2abd08);}else{return db[_0x48dd('0x63')][_0x48dd('0x22')]({'where':{'name':_0x2abd08['ItemType']}})[_0x48dd('0x17')](function(_0x584099){if(_[_0x48dd('0x51')](_0x584099))_0x2abd08[_0x48dd('0x86')]=null;else _0x2abd08[_0x48dd('0x86')]=_0x584099['id'];_0xae8f65(_0x2abd08);});}});}exports['getAdditionalPhones']=function(_0x3cb063,_0x3aef33){return db[_0x48dd('0x48')][_0x48dd('0x33')]({'raw':!![],'where':{'CmContactId':_0x3cb063[_0x48dd('0x62')]['id'],'ItemClass':_0x48dd('0x88')},'include':[{'model':db[_0x48dd('0x63')],'as':_0x48dd('0x64')}],'order':[[_0x48dd('0x83')],[db[_0x48dd('0x65')][_0x48dd('0x8b')]('`ItemType`.OrderBy')]]})[_0x48dd('0x17')](function(_0x143ac0){return _0x143ac0;})[_0x48dd('0x17')](respondWithResult(_0x3aef33,null))[_0x48dd('0x20')](handleError(_0x3aef33,null));};exports[_0x48dd('0x8e')]=function(_0x6a087e,_0xa2d04a){return db[_0x48dd('0x48')][_0x48dd('0x33')]({'raw':!![],'where':{'CmContactId':_0x6a087e['body'][_0x48dd('0x8f')]}})[_0x48dd('0x17')](function(_0x494271){var _0xffbe3b=_[_0x48dd('0x7f')](_0x494271,function(_0x56aedb){_0x56aedb[_0x48dd('0x90')]=_0x6a087e[_0x48dd('0x32')][_0x48dd('0x91')];return _0x56aedb;});return db[_0x48dd('0x48')][_0x48dd('0x56')](_0xffbe3b,{});})['then'](function(){return addCmHopperPhones(_0x6a087e[_0x48dd('0x32')]['toContactId']);})[_0x48dd('0x17')](function(){return['ok'];})[_0x48dd('0x17')](respondWithResult(_0xa2d04a,null))[_0x48dd('0x20')](handleError(_0xa2d04a,null));};exports[_0x48dd('0x92')]=function(_0x54f54f,_0x4e114f){var _0xcc925a=[];_0xcc925a[_0x48dd('0x59')](createCmHopperPhone(_0x54f54f['body']['id'],_0x54f54f['body'][_0x48dd('0x93')]));Promise['all'](_0xcc925a)[_0x48dd('0x17')](function(){return[0x1];})[_0x48dd('0x17')](respondWithResult(_0x4e114f,null));};exports[_0x48dd('0x94')]=function(_0x4697c2,_0x3cab7c){var _0x3c5b8b={'raw':![],'where':{}};var _0x483136={};var _0x2cd630={'count':0x0,'rows':[]};return db['CmContact'][_0x48dd('0x75')]({'where':{'id':_0x4697c2[_0x48dd('0x62')]['id']}})['then'](handleEntityNotFound(_0x3cab7c,null))[_0x48dd('0x17')](function(_0x4d4149){if(_0x4d4149){_0x483136[_0x48dd('0x76')]=_[_0x48dd('0x24')](db['CmHopper'][_0x48dd('0x95')]);_0x483136['query']=_['keys'](_0x4697c2['query']);_0x483136['filters']=_[_0x48dd('0x78')](_0x483136[_0x48dd('0x76')],_0x483136[_0x48dd('0x1f')]);_0x3c5b8b['attributes']=_[_0x48dd('0x78')](_0x483136[_0x48dd('0x76')],qs[_0x48dd('0x79')](_0x4697c2['query'][_0x48dd('0x79')]));_0x3c5b8b[_0x48dd('0x7a')]=_0x3c5b8b[_0x48dd('0x7a')]['length']?_0x3c5b8b[_0x48dd('0x7a')]:_0x483136[_0x48dd('0x76')];if(!_0x4697c2[_0x48dd('0x1f')][_0x48dd('0x30')](_0x48dd('0x96'))){_0x3c5b8b[_0x48dd('0x13')]=qs[_0x48dd('0x13')](_0x4697c2['query'][_0x48dd('0x13')]);_0x3c5b8b[_0x48dd('0x11')]=qs[_0x48dd('0x11')](_0x4697c2[_0x48dd('0x1f')][_0x48dd('0x11')]);}_0x3c5b8b[_0x48dd('0x7b')]=qs[_0x48dd('0x7c')](_0x4697c2[_0x48dd('0x1f')][_0x48dd('0x7c')]);_0x3c5b8b[_0x48dd('0x58')]=qs[_0x48dd('0x77')](_[_0x48dd('0x7d')](_0x4697c2[_0x48dd('0x1f')],_0x483136[_0x48dd('0x77')]));_0x3c5b8b['where'][_0x48dd('0x97')]=_0x4d4149['id'];if(_0x4697c2['query'][_0x48dd('0x7e')]){_0x3c5b8b[_0x48dd('0x58')]=_['merge'](_0x3c5b8b[_0x48dd('0x58')],{'$or':_[_0x48dd('0x7f')](_0x3c5b8b[_0x48dd('0x7a')],function(_0x552dd3){var _0x41a75a={};_0x41a75a[_0x552dd3]={'$like':'%'+_0x4697c2[_0x48dd('0x1f')][_0x48dd('0x7e')]+'%'};return _0x41a75a;})});}_0x3c5b8b=_[_0x48dd('0x31')]({},_0x3c5b8b,_0x4697c2[_0x48dd('0x98')]);return db[_0x48dd('0x39')][_0x48dd('0x14')]({'where':_0x3c5b8b[_0x48dd('0x58')]})[_0x48dd('0x17')](function(_0x2377f7){_0x2cd630[_0x48dd('0x14')]=_0x2377f7;if(_0x4697c2[_0x48dd('0x1f')][_0x48dd('0x99')]){_0x3c5b8b[_0x48dd('0x9a')]=[{'all':!![]}];}return db[_0x48dd('0x39')][_0x48dd('0x33')](_0x3c5b8b);})[_0x48dd('0x17')](function(_0x2666e1){_0x2cd630['rows']=_0x2666e1;return _0x2cd630;});}})[_0x48dd('0x17')](respondWithFilteredResult(_0x3cab7c,_0x3c5b8b))[_0x48dd('0x20')](handleError(_0x3cab7c,null));};exports[_0x48dd('0x9b')]=function(_0x585c3e,_0x4b298a){var _0x36f9fd={'raw':!![],'where':{}};var _0x1c8ce3={};var _0x4962e3={'count':0x0,'rows':[]};return db[_0x48dd('0x21')][_0x48dd('0x75')]({'where':{'id':_0x585c3e['params']['id']}})['then'](handleEntityNotFound(_0x4b298a,null))['then'](function(_0x2128be){if(_0x2128be){_0x1c8ce3[_0x48dd('0x76')]=_[_0x48dd('0x24')](db[_0x48dd('0x4a')][_0x48dd('0x95')]);_0x1c8ce3[_0x48dd('0x1f')]=_[_0x48dd('0x24')](_0x585c3e[_0x48dd('0x1f')]);_0x1c8ce3['filters']=_[_0x48dd('0x78')](_0x1c8ce3[_0x48dd('0x76')],_0x1c8ce3[_0x48dd('0x1f')]);_0x36f9fd[_0x48dd('0x7a')]=_[_0x48dd('0x78')](_0x1c8ce3['model'],qs[_0x48dd('0x79')](_0x585c3e[_0x48dd('0x1f')]['fields']));_0x36f9fd[_0x48dd('0x7a')]=_0x36f9fd[_0x48dd('0x7a')]['length']?_0x36f9fd[_0x48dd('0x7a')]:_0x1c8ce3[_0x48dd('0x76')];if(!_0x585c3e[_0x48dd('0x1f')][_0x48dd('0x30')](_0x48dd('0x96'))){_0x36f9fd[_0x48dd('0x13')]=qs[_0x48dd('0x13')](_0x585c3e[_0x48dd('0x1f')]['limit']);_0x36f9fd[_0x48dd('0x11')]=qs[_0x48dd('0x11')](_0x585c3e[_0x48dd('0x1f')][_0x48dd('0x11')]);}_0x36f9fd[_0x48dd('0x7b')]=qs['sort'](_0x585c3e['query'][_0x48dd('0x7c')]);_0x36f9fd[_0x48dd('0x58')]=qs[_0x48dd('0x77')](_[_0x48dd('0x7d')](_0x585c3e['query'],_0x1c8ce3[_0x48dd('0x77')]));_0x36f9fd[_0x48dd('0x58')][_0x48dd('0x97')]=_0x2128be['id'];if(_0x585c3e['query']['filter']){_0x36f9fd[_0x48dd('0x58')]=_['merge'](_0x36f9fd[_0x48dd('0x58')],{'$or':_[_0x48dd('0x7f')](_0x36f9fd['attributes'],function(_0x31ca9e){var _0x4af4b2={};_0x4af4b2[_0x31ca9e]={'$like':'%'+_0x585c3e[_0x48dd('0x1f')][_0x48dd('0x7e')]+'%'};return _0x4af4b2;})});}_0x36f9fd=_[_0x48dd('0x31')]({},_0x36f9fd,_0x585c3e[_0x48dd('0x98')]);return db[_0x48dd('0x4a')]['count']({'where':_0x36f9fd[_0x48dd('0x58')]})['then'](function(_0x4c9fc8){_0x4962e3[_0x48dd('0x14')]=_0x4c9fc8;if(_0x585c3e[_0x48dd('0x1f')][_0x48dd('0x99')]){_0x36f9fd[_0x48dd('0x9a')]=[{'all':!![]}];}return db[_0x48dd('0x4a')][_0x48dd('0x33')](_0x36f9fd);})['then'](function(_0x44493f){_0x4962e3[_0x48dd('0x9c')]=_0x44493f;return _0x4962e3;});}})[_0x48dd('0x17')](respondWithFilteredResult(_0x4b298a,_0x36f9fd))[_0x48dd('0x20')](handleError(_0x4b298a,null));};exports['getHopperFinals']=function(_0x5457a5,_0x155f17){var _0x51e336={'raw':!![],'where':{}};var _0x126eef={};var _0x456780={'count':0x0,'rows':[]};return db[_0x48dd('0x21')]['findOne']({'where':{'id':_0x5457a5[_0x48dd('0x62')]['id']}})[_0x48dd('0x17')](handleEntityNotFound(_0x155f17,null))[_0x48dd('0x17')](function(_0x987ed0){if(_0x987ed0){_0x126eef[_0x48dd('0x76')]=_[_0x48dd('0x24')](db[_0x48dd('0x49')][_0x48dd('0x95')]);_0x126eef['query']=_[_0x48dd('0x24')](_0x5457a5[_0x48dd('0x1f')]);_0x126eef['filters']=_['intersection'](_0x126eef[_0x48dd('0x76')],_0x126eef[_0x48dd('0x1f')]);_0x51e336[_0x48dd('0x7a')]=_['intersection'](_0x126eef['model'],qs[_0x48dd('0x79')](_0x5457a5[_0x48dd('0x1f')][_0x48dd('0x79')]));_0x51e336['attributes']=_0x51e336['attributes'][_0x48dd('0x25')]?_0x51e336[_0x48dd('0x7a')]:_0x126eef['model'];if(!_0x5457a5[_0x48dd('0x1f')]['hasOwnProperty'](_0x48dd('0x96'))){_0x51e336['limit']=qs['limit'](_0x5457a5[_0x48dd('0x1f')][_0x48dd('0x13')]);_0x51e336['offset']=qs[_0x48dd('0x11')](_0x5457a5[_0x48dd('0x1f')]['offset']);}_0x51e336[_0x48dd('0x7b')]=qs['sort'](_0x5457a5[_0x48dd('0x1f')][_0x48dd('0x7c')]);_0x51e336[_0x48dd('0x58')]=qs['filters'](_['pick'](_0x5457a5[_0x48dd('0x1f')],_0x126eef[_0x48dd('0x77')]));_0x51e336['where'][_0x48dd('0x97')]=_0x987ed0['id'];if(_0x5457a5[_0x48dd('0x1f')]['filter']){_0x51e336[_0x48dd('0x58')]=_[_0x48dd('0x31')](_0x51e336[_0x48dd('0x58')],{'$or':_[_0x48dd('0x7f')](_0x51e336[_0x48dd('0x7a')],function(_0x48907c){var _0x542d94={};_0x542d94[_0x48907c]={'$like':'%'+_0x5457a5[_0x48dd('0x1f')][_0x48dd('0x7e')]+'%'};return _0x542d94;})});}_0x51e336=_[_0x48dd('0x31')]({},_0x51e336,_0x5457a5[_0x48dd('0x98')]);return db[_0x48dd('0x49')][_0x48dd('0x14')]({'where':_0x51e336[_0x48dd('0x58')]})[_0x48dd('0x17')](function(_0x19de64){_0x456780[_0x48dd('0x14')]=_0x19de64;if(_0x5457a5[_0x48dd('0x1f')][_0x48dd('0x99')]){_0x51e336['include']=[{'all':!![]}];}return db[_0x48dd('0x49')][_0x48dd('0x33')](_0x51e336);})[_0x48dd('0x17')](function(_0x54f90e){_0x456780[_0x48dd('0x9c')]=_0x54f90e;return _0x456780;});}})[_0x48dd('0x17')](respondWithFilteredResult(_0x155f17,_0x51e336))[_0x48dd('0x20')](handleError(_0x155f17,null));};exports[_0x48dd('0x9d')]=function(_0x3046b5,_0x56b26a){var _0x810b16={'raw':!![],'where':{}};var _0x313f0d={};var _0xa70905={'count':0x0,'rows':[]};return db[_0x48dd('0x21')][_0x48dd('0x75')]({'where':{'id':_0x3046b5[_0x48dd('0x62')]['id']}})[_0x48dd('0x17')](handleEntityNotFound(_0x56b26a,null))[_0x48dd('0x17')](function(_0xbdbd3a){if(_0xbdbd3a){_0x313f0d[_0x48dd('0x76')]=_[_0x48dd('0x24')](db[_0x48dd('0x9e')]['rawAttributes']);_0x313f0d['query']=_[_0x48dd('0x24')](_0x3046b5[_0x48dd('0x1f')]);_0x313f0d['filters']=_[_0x48dd('0x78')](_0x313f0d[_0x48dd('0x76')],_0x313f0d[_0x48dd('0x1f')]);_0x810b16[_0x48dd('0x7a')]=_['intersection'](_0x313f0d['model'],qs[_0x48dd('0x79')](_0x3046b5['query'][_0x48dd('0x79')]));_0x810b16[_0x48dd('0x7a')]=_0x810b16[_0x48dd('0x7a')][_0x48dd('0x25')]?_0x810b16[_0x48dd('0x7a')]:_0x313f0d['model'];if(!_0x3046b5[_0x48dd('0x1f')][_0x48dd('0x30')]('nolimit')){_0x810b16['limit']=qs[_0x48dd('0x13')](_0x3046b5[_0x48dd('0x1f')][_0x48dd('0x13')]);_0x810b16[_0x48dd('0x11')]=qs[_0x48dd('0x11')](_0x3046b5[_0x48dd('0x1f')][_0x48dd('0x11')]);}_0x810b16['order']=qs[_0x48dd('0x7c')](_0x3046b5['query'][_0x48dd('0x7c')]);_0x810b16['where']=qs[_0x48dd('0x77')](_[_0x48dd('0x7d')](_0x3046b5[_0x48dd('0x1f')],_0x313f0d[_0x48dd('0x77')]));_0x810b16[_0x48dd('0x58')][_0x48dd('0x97')]=_0xbdbd3a['id'];if(_0x3046b5[_0x48dd('0x1f')][_0x48dd('0x7e')]){_0x810b16[_0x48dd('0x58')]=_[_0x48dd('0x31')](_0x810b16[_0x48dd('0x58')],{'$or':_[_0x48dd('0x7f')](_0x810b16['attributes'],function(_0x432e92){var _0x94bde2={};_0x94bde2[_0x432e92]={'$like':'%'+_0x3046b5['query']['filter']+'%'};return _0x94bde2;})});}_0x810b16=_[_0x48dd('0x31')]({},_0x810b16,_0x3046b5[_0x48dd('0x98')]);return db[_0x48dd('0x9e')]['count']({'where':_0x810b16[_0x48dd('0x58')]})[_0x48dd('0x17')](function(_0x555050){_0xa70905[_0x48dd('0x14')]=_0x555050;if(_0x3046b5[_0x48dd('0x1f')][_0x48dd('0x99')]){_0x810b16[_0x48dd('0x9a')]=[{'all':!![]}];}return db[_0x48dd('0x9e')][_0x48dd('0x33')](_0x810b16);})['then'](function(_0x1d0b09){_0xa70905[_0x48dd('0x9c')]=_0x1d0b09;return _0xa70905;});}})[_0x48dd('0x17')](respondWithFilteredResult(_0x56b26a,_0x810b16))[_0x48dd('0x20')](handleError(_0x56b26a,null));};exports[_0x48dd('0x9f')]=function(_0x262117,_0x59f830){try{if(!_0x262117[_0x48dd('0x32')][_0x48dd('0x5a')]){throw new Error(_0x48dd('0xa0'));}if(!_0x262117['body']['binding_keys']){throw new Error(_0x48dd('0xa1'));}if(!_0x262117[_0x48dd('0x32')]['binding_values']){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x262117[_0x48dd('0x32')][_0x48dd('0xa2')]){throw new Error(_0x48dd('0xa3'));}var _0x48393f=_0x262117[_0x48dd('0x32')][_0x48dd('0xa4')][_0x48dd('0xa5')](',');var _0x1c582a=_0x262117[_0x48dd('0x32')][_0x48dd('0xa6')][_0x48dd('0xa5')](',');if(!_0x48393f[_0x48dd('0x25')]||!_0x1c582a[_0x48dd('0x25')]||_0x48393f['length']!==_0x1c582a[_0x48dd('0x25')]){throw new Error(_0x48dd('0xa7'));}_0x262117[_0x48dd('0x32')][_0x48dd('0x79')]=_['zipObject'](_0x48393f,_0x1c582a);if(!_0x262117[_0x48dd('0x32')]['fields'][_0x48dd('0x73')]){throw new Error(_0x48dd('0xa8'));}if(!_0x262117['body']['fields'][_0x48dd('0xa9')]){throw new Error(_0x48dd('0xaa'));}var _0x42c924=path[_0x48dd('0x37')](config[_0x48dd('0xab')],'server/files/tmp',_0x262117[_0x48dd('0xac')][_0x48dd('0xad')]);fs['chmodSync'](_0x42c924,parseInt(_0x48dd('0xae'),0x8));var _0x34687d=require(_0x48dd('0xaf'))[_0x48dd('0xb0')](path[_0x48dd('0x37')](__dirname,'../../components/import/cm/csv'),[_0x42c924,_0x262117['body']['binding_keys'],_0x262117[_0x48dd('0x32')][_0x48dd('0xa6')],_0x262117[_0x48dd('0x32')][_0x48dd('0x5a')],_0x262117[_0x48dd('0x32')][_0x48dd('0xb1')],_0x262117[_0x48dd('0x32')][_0x48dd('0x57')],_0x262117[_0x48dd('0x32')][_0x48dd('0xa2')]]);return _0x59f830[_0x48dd('0xf')](0xc8)[_0x48dd('0x10')]({'message':_0x48dd('0xb2'),'pid':_0x34687d[_0x48dd('0xb3')]});}catch(_0x3180e7){return _0x59f830[_0x48dd('0xf')](0x1f4)[_0x48dd('0x1c')](_0x3180e7);}};exports[_0x48dd('0xb4')]=function(_0x354b38,_0x4fea3e){var _0x4cef4b=fs[_0x48dd('0xb5')](_0x354b38[_0x48dd('0xac')]['path']);Papa[_0x48dd('0xb6')](_0x4cef4b,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4f1107){return _0x4fea3e[_0x48dd('0xf')](0xc8)[_0x48dd('0x10')]({'file':_0x354b38[_0x48dd('0xac')],'fields':_0x4f1107[_0x48dd('0xb7')][_0x48dd('0x79')]});}});};exports['import']=function(_0x34d462,_0x3aab5e){return db[_0x48dd('0xb8')][_0x48dd('0x33')]({'raw':!![],'attributes':['id'],'where':{'role':_0x48dd('0xb9')}})['then'](function(_0xec6d98){var _0x5060ea=![];if(!_0x34d462[_0x48dd('0x32')][_0x48dd('0x5a')]){throw new Error('No\x20ListId\x20specified');}if(!_0x34d462[_0x48dd('0x32')]['binding'][_0x48dd('0x73')]){throw new Error(_0x48dd('0xa8'));}if(!_0x34d462[_0x48dd('0x32')][_0x48dd('0xba')][_0x48dd('0xa9')]){throw new Error(_0x48dd('0xaa'));}if(!_0x34d462['body'][_0x48dd('0xa2')]){throw new Error(_0x48dd('0xa3'));}var _0x27c83=require(_0x48dd('0xaf'))[_0x48dd('0xb0')](path['join'](__dirname,_0x48dd('0xbb')),[_0x34d462[_0x48dd('0x62')]['id'],JSON['stringify'](_0x34d462[_0x48dd('0x32')]),JSON[_0x48dd('0xbc')](_0xec6d98)]);_0x27c83['on']('message',function(){_0x5060ea=!![];return _0x3aab5e[_0x48dd('0xf')](0xc8)[_0x48dd('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x27c83[_0x48dd('0xb3')]});});_0x27c83['on'](_0x48dd('0xbd'),function(_0x1307d6){if(_0x1307d6&&!_0x5060ea){return _0x3aab5e['status'](0x1f4)[_0x48dd('0x10')]({'message':'error\x20child\x20process','pid':_0x27c83['pid']});}});})[_0x48dd('0x20')](handleError(_0x3aab5e,null));};exports['importUpdates']=function(_0x1afe24,_0x5da9f4){return db[_0x48dd('0xb8')][_0x48dd('0x33')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x48dd('0x17')](function(_0x2b7975){var _0x2dfa1a=![];if(!_0x1afe24[_0x48dd('0x32')][_0x48dd('0x5a')]){throw new Error(_0x48dd('0xa0'));}if(!_0x1afe24[_0x48dd('0x32')][_0x48dd('0xba')][_0x48dd('0x73')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1afe24[_0x48dd('0x32')]['binding'][_0x48dd('0xa9')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1afe24['body'][_0x48dd('0xa2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x53670a=require('child_process')[_0x48dd('0xb0')](path['join'](__dirname,'../../components/import/cm/csvUpdates'),[_0x1afe24[_0x48dd('0x62')]['id'],JSON[_0x48dd('0xbc')](_0x1afe24[_0x48dd('0x32')]),JSON['stringify'](_0x2b7975)]);_0x53670a['on'](_0x48dd('0xbe'),function(){_0x2dfa1a=!![];return _0x5da9f4[_0x48dd('0xf')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x53670a['pid']});});_0x53670a['on'](_0x48dd('0xbd'),function(_0x4bf88e){if(_0x4bf88e&&!_0x2dfa1a){return _0x5da9f4[_0x48dd('0xf')](0x1f4)[_0x48dd('0x10')]({'message':_0x48dd('0xbf'),'pid':_0x53670a[_0x48dd('0xb3')]});}});})[_0x48dd('0x20')](handleError(_0x5da9f4,null));};exports[_0x48dd('0xc0')]=function(_0x59d887,_0x55e3a1){var _0x958f59=[_0x48dd('0xc1'),_0x48dd('0xc2'),_0x48dd('0xc3'),_0x48dd('0xc4'),_0x48dd('0xc5'),'whatsapp','voice'];var _0x11adcf={'offset':0x0,'order':qs['sort'](_0x48dd('0xc6'))},_0x1aacca={'count':0x0,'rows':[]};Promise['resolve']()[_0x48dd('0x17')](function(){if(_0x59d887[_0x48dd('0x1f')][_0x48dd('0xc7')]){if(!_[_0x48dd('0xc8')](_0x958f59,_0x59d887['query'][_0x48dd('0xc7')][_0x48dd('0xc9')]())){throw new Error('Invalid\x20channel');}_0x958f59=[_0x59d887[_0x48dd('0x1f')][_0x48dd('0xc7')][_0x48dd('0xc9')]()];}if(_0x59d887['query']['range']){try{var _0x318328=JSON[_0x48dd('0xb6')](_0x59d887[_0x48dd('0x1f')]['range']);if(!moment(_0x318328['from'])['isValid']()){throw new Error(_0x48dd('0xca'));}if(!moment(_0x318328['to'])['isValid']()){throw new Error(_0x48dd('0xcb'));}}catch(_0x56e8b9){throw new Error(_0x48dd('0xcc'));}}if(!_0x59d887[_0x48dd('0x1f')][_0x48dd('0x30')]('nolimit')){_0x11adcf[_0x48dd('0x13')]=qs[_0x48dd('0x13')](_0x59d887[_0x48dd('0x1f')]['limit']||0xa);_0x11adcf['offset']=qs['offset'](_0x59d887[_0x48dd('0x1f')]['offset']);}var _0x11fbe6=_0x958f59[_0x48dd('0x7f')](function(_0x58b137){if(_0x58b137===_0x48dd('0xcd')){var _0x574dfb={'attributes':['id',_0x48dd('0xce'),'type','source','destination',_0x48dd('0xcf'),'starttime',_0x48dd('0xd0'),_0x48dd('0xd1'),'note',_0x48dd('0xd2'),_0x48dd('0xd3'),_0x48dd('0xd4'),_0x48dd('0xd5'),'UserId'],'where':{'ContactId':_0x59d887[_0x48dd('0x62')]['id']},'include':[{'model':db['User'],'as':_0x48dd('0xb8'),'attributes':['id',_0x48dd('0x1b'),'fullname','alias']}],'order':[[_0x48dd('0xd2'),_0x48dd('0xd6')]]};if(_0x59d887['query'][_0x48dd('0xd7')]){_0x574dfb[_0x48dd('0x58')]['createdAt']={'$gte':_0x318328[_0x48dd('0x34')],'$lte':_0x318328['to']};}return db['VoiceCallReport'][_0x48dd('0xd8')](_0x574dfb)[_0x48dd('0x17')](function(_0x234253){_0x1aacca[_0x48dd('0x14')]+=_0x234253[_0x48dd('0x14')];return _[_0x48dd('0x7f')](_0x234253[_0x48dd('0x9c')],function(_0x32390d){var _0x3d13d2=_0x32390d[_0x48dd('0x35')]({'plain':!![]});_0x3d13d2[_0x48dd('0xc7')]=_0x58b137;if(_0x3d13d2['User']){_0x3d13d2[_0x48dd('0xb8')]={'id':_0x3d13d2['User']['id'],'name':_0x3d13d2['User']['name'],'fullname':_0x3d13d2[_0x48dd('0xb8')]['fullname'],'alias':_0x3d13d2[_0x48dd('0xb8')][_0x48dd('0xd9')]};}return _0x3d13d2;});});}else{var _0x2065b8=_[_0x48dd('0xda')](_0x58b137)+(_0x58b137===_0x48dd('0xc2')?_0x48dd('0xdb'):_0x48dd('0xdc'));var _0x3800bf={'attributes':['id',_0x48dd('0xdd'),_0x48dd('0xde'),_0x48dd('0xd2'),_0x48dd('0xdf'),_0x48dd('0xe0'),_0x48dd('0xe1'),'thirdDisposition',_0x48dd('0xe2'),_0x2065b8+'Id'],'where':{'ContactId':_0x59d887[_0x48dd('0x62')]['id']},'include':[{'model':db[_0x2065b8],'as':_0x48dd('0xdc'),'attributes':['id','name',_0x48dd('0xe3')]},{'model':db[_0x48dd('0xb8')],'as':_0x48dd('0xe4'),'attributes':['id',_0x48dd('0x1b'),_0x48dd('0xe5')]},{'model':db[_0x48dd('0x5f')],'as':_0x48dd('0xe6'),'attributes':['id','name',_0x48dd('0x60')],'through':{'attributes':[]}}],'order':[[_0x48dd('0xd2'),_0x48dd('0xd6')]]};if(_0x59d887[_0x48dd('0x1f')][_0x48dd('0xd7')]){_0x3800bf['where'][_0x48dd('0xd2')]={'$gte':_0x318328['from'],'$lte':_0x318328['to']};}switch(_0x58b137){case _0x48dd('0xc2'):_0x3800bf['attributes'][_0x48dd('0x59')]('browserName',_0x48dd('0xe7'),_0x48dd('0xe8'),_0x48dd('0xe9'),'osName',_0x48dd('0xea'),'ratingType','ratingValue',_0x48dd('0xeb'));break;case _0x48dd('0xc1'):_0x3800bf[_0x48dd('0x7a')][_0x48dd('0x59')]('subject',_0x48dd('0xec'));break;case _0x48dd('0xc4'):_0x3800bf[_0x48dd('0x7a')][_0x48dd('0x59')]('externalUrl',_0x48dd('0xed'));break;}return db[_[_0x48dd('0xda')](_0x58b137)+_0x48dd('0xee')]['findAndCountAll'](_0x3800bf)[_0x48dd('0x17')](function(_0x3fa98f){_0x1aacca[_0x48dd('0x14')]+=_0x3fa98f[_0x48dd('0x14')];return _['map'](_0x3fa98f[_0x48dd('0x9c')],function(_0x4a16f2){var _0x2a9c62=_0x4a16f2[_0x48dd('0x35')]({'plain':!![]});_0x2a9c62[_0x48dd('0xc7')]=_0x58b137;if(_0x2a9c62['Owner']){_0x2a9c62['Owner']={'id':_0x2a9c62[_0x48dd('0xe4')]['id'],'name':_0x2a9c62['Owner']['name'],'fullname':_0x2a9c62['Owner']['fullname']};}return _0x2a9c62;});});}});return Promise[_0x48dd('0x5e')](_0x11fbe6);})[_0x48dd('0x17')](function(_0x5242b3){return _(_0x5242b3)['flatten']()[_0x48dd('0xef')](_0x48dd('0xd2'))[_0x48dd('0xf0')]()[_0x48dd('0xf1')]();})[_0x48dd('0x17')](function(_0xe08462){_0x1aacca[_0x48dd('0x9c')]=_0x11adcf['limit']?_0xe08462['slice'](_0x11adcf[_0x48dd('0x11')],_0x11adcf[_0x48dd('0x11')]+_0x11adcf[_0x48dd('0x13')]):_0xe08462;return _0x1aacca;})[_0x48dd('0x17')](respondWithFilteredResult(_0x55e3a1,_0x11adcf))[_0x48dd('0x20')](handleError(_0x55e3a1,null));}; \ No newline at end of file +var _0x163c=['color','tag','Phones','ContactItemType','ItemType','sequelize','literal','$and','omit','map','format','cf_%d','pickBy','isEmpty','table','setFields','toParam','text','values','phone','findOne','model','rawAttributes','intersection','attributes','fields','order','filters','pick','filter','merge','getTags','nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','item_types','items','description','find','ItemTypeId','contact\x20phone\x20exists','PHONE','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','bulkCreate','getHoppers','sort','ContactId','options','includeAll','include','getHopperHistories','rows','getHopperFinals','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','import','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','fork','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','mail','chat','sms','fax','voice','-createdAt','resolve','channel','includes','Invalid\x20channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','userDisposition','userThirdDisposition','UserId','fullname','createdAt','DESC','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','Tag','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','subject','substatus','openchannel','externalUrl','threadId','flatten','sortBy','value','slice','bluebird','path','lodash','squel','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/environment/shared','../../mysqldb','redis','localhost','register','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','end','error','stack','name','index','query','user','catch','CmContact','params','describe','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','alias','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','ChatInteraction','ChatMessage','update','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','duplicates','$or','push','where','ListId','findOrCreate','spread','contact','show','Tags'];(function(_0x5b6f67,_0x401bf8){var _0x152edd=function(_0x42dc2a){while(--_0x42dc2a){_0x5b6f67['push'](_0x5b6f67['shift']());}};_0x152edd(++_0x401bf8);}(_0x163c,0x198));var _0xc163=function(_0x41fa7c,_0x3d711b){_0x41fa7c=_0x41fa7c-0x0;var _0x2fdc36=_0x163c[_0x41fa7c];return _0x2fdc36;};'use strict';var moment=require('moment');var BPromise=require(_0xc163('0x0'));var util=require('util');var path=require(_0xc163('0x1'));var fs=require('fs');var _=require(_0xc163('0x2'));var squel=require(_0xc163('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var contacts=require(_0xc163('0x4'));var qs=require(_0xc163('0x5'));var logger=require(_0xc163('0x6'))('api');var config=require('../../config/environment');var shared=require(_0xc163('0x7'));var db=require(_0xc163('0x8'))['db'];config[_0xc163('0x9')]=_['defaults'](config[_0xc163('0x9')],{'host':_0xc163('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc163('0x9')]));require('./cmContact.socket')[_0xc163('0xb')](socket);function respondWithResult(_0x1bf69f,_0x77f2cb){_0x77f2cb=_0x77f2cb||0xc8;return function(_0x165d04){if(_0x165d04){return _0x1bf69f[_0xc163('0xc')](_0x77f2cb)['json'](_0x165d04);}};}function respondWithFilteredResult(_0x25e340,_0x49adca){return function(_0x3b57f2){if(_0x3b57f2){var _0x4733cd=typeof _0x49adca[_0xc163('0xd')]===_0xc163('0xe')&&typeof _0x49adca[_0xc163('0xf')]===_0xc163('0xe');var _0x501fac=_0x3b57f2[_0xc163('0x10')];var _0x816a19=_0x4733cd?0x0:_0x49adca[_0xc163('0xd')];var _0x20602f=_0x4733cd?_0x3b57f2[_0xc163('0x10')]:_0x49adca[_0xc163('0xd')]+_0x49adca[_0xc163('0xf')];var _0x246b2b;if(_0x20602f>=_0x501fac){_0x20602f=_0x501fac;_0x246b2b=0xc8;}else{_0x246b2b=0xce;}_0x25e340[_0xc163('0xc')](_0x246b2b);return _0x25e340[_0xc163('0x11')](_0xc163('0x12'),_0x816a19+'-'+_0x20602f+'/'+_0x501fac)[_0xc163('0x13')](_0x3b57f2);}return null;};}function saveUpdates(_0x1e9eee){return function(_0x4830f4){if(_0x4830f4){return _0x4830f4['update'](_0x1e9eee)[_0xc163('0x14')](function(_0x2dcafb){return _0x2dcafb;});}return null;};}function removeEntity(_0x2adf61){return function(_0x33e4a7){if(_0x33e4a7){return _0x33e4a7[_0xc163('0x15')]()['then'](function(){_0x2adf61['status'](0xcc)[_0xc163('0x16')]();});}};}function handleEntityNotFound(_0x36b5a2){return function(_0x26238e){if(!_0x26238e){_0x36b5a2['sendStatus'](0x194);}return _0x26238e;};}function handleError(_0x3077db,_0x5daab8){_0x5daab8=_0x5daab8||0x1f4;return function(_0xdb1a28){logger[_0xc163('0x17')](_0xdb1a28[_0xc163('0x18')]);if(_0xdb1a28[_0xc163('0x19')]){delete _0xdb1a28['name'];}_0x3077db[_0xc163('0xc')](_0x5daab8)['send'](_0xdb1a28);};}exports[_0xc163('0x1a')]=function(_0xe2602d,_0x161dc4){var _0x202448={};return contacts['describe']()[_0xc163('0x14')](function(_0x543ab9){_0x202448=qs['getOptions'](_0x543ab9,_0xe2602d);return contacts['findAll'](_0xe2602d[_0xc163('0x1b')],_0xe2602d[_0xc163('0x1c')],_0x202448,_0x543ab9);})[_0xc163('0x14')](respondWithFilteredResult(_0x161dc4,_0x202448))[_0xc163('0x1d')](handleError(_0x161dc4,null));};exports[_0xc163('0x15')]=function(_0x27312b,_0x2b9e84){return db[_0xc163('0x1e')]['find']({'where':{'id':_0x27312b[_0xc163('0x1f')]['id']}})[_0xc163('0x14')](handleEntityNotFound(_0x2b9e84,null))['then'](removeEntity(_0x2b9e84,null))['catch'](handleError(_0x2b9e84,null));};exports[_0xc163('0x20')]=function(_0x21fe8b,_0x2b877b){return db[_0xc163('0x1e')][_0xc163('0x20')]()['then'](function(_0x229031){delete _0x229031[_0xc163('0x21')];for(var _0x1ed49f=0x0;_0x1ed49f0x0){return new Promise(function(_0x479011){var _0x3dc992=[];for(var _0x12f16e=0x0;_0x12f16e<_0x39a198[_0xc163('0x23')];_0x12f16e++){_0x3dc992[_0xc163('0x56')](insertAdditionalPhones(_0x39a198[_0x12f16e][_0xc163('0x5b')],_0x39a198[_0x12f16e][_0xc163('0x53')]));}Promise['all'](_0x3dc992)[_0xc163('0x14')](function(){_0x479011(0x1);});})[_0xc163('0x14')](function(){return{'success':_0x36717a,'failure':_0x4d5948,'duplicates':_0xf990c8};});}else{return{'success':_0x36717a,'failure':_0x4d5948,'duplicates':_0xf990c8};}}})[_0xc163('0x14')](respondWithResult(_0x4a1ba5,0xc9))[_0xc163('0x1d')](handleError(_0x4a1ba5,null));};exports[_0xc163('0x5c')]=function(_0x1501f9,_0x7d4ccc){var _0x3d396c;return db['CmContact'][_0xc163('0x20')]()[_0xc163('0x14')](function(_0x1646fb){return db[_0xc163('0x1e')]['find']({'where':{'id':_0x1501f9[_0xc163('0x1f')]['id']},'include':[{'model':db['Tag'],'as':_0xc163('0x5d'),'attributes':['id',_0xc163('0x19'),_0xc163('0x5e')],'required':_0x1501f9[_0xc163('0x1b')][_0xc163('0x5f')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0xc163('0x60'),'where':{'CmContactId':_0x1501f9['params']['id']},'required':![],'include':[{'model':db[_0xc163('0x61')],'as':_0xc163('0x62')}]}],'order':[db[_0xc163('0x63')][_0xc163('0x64')]('Phones.OrderBy')],'attributes':_[_0xc163('0x22')](_0x1646fb)});})[_0xc163('0x14')](function(_0x4f9354){if(!_[_0xc163('0x4f')](_0x4f9354)){_0x3d396c=_0x4f9354[_0xc163('0x33')]({'plain':!![]});var _0x17df0c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4f9354&&_0x4f9354['ListId']){if(_0x4f9354['ListId']){_0x17df0c['where'][_0xc163('0x65')][_0xc163('0x56')]({'ListId':{'$ne':_0x4f9354[_0xc163('0x58')]}});}}return db[_0xc163('0x29')][_0xc163('0x2a')](_0x17df0c);}})[_0xc163('0x14')](function(_0x56b4ae){if(!_['isNil'](_0x56b4ae)){return _[_0xc163('0x66')](_0x3d396c,_[_0xc163('0x67')](_0x56b4ae,function(_0x1306fd){return util[_0xc163('0x68')](_0xc163('0x69'),_0x1306fd['id']);}));}})['then'](handleEntityNotFound(_0x7d4ccc,null))[_0xc163('0x14')](respondWithResult(_0x7d4ccc,null))[_0xc163('0x1d')](handleError(_0x7d4ccc,null));};exports[_0xc163('0x3c')]=function(_0x1cbe71,_0x446014){var _0x1f8aea;if(_0x1cbe71['body']['id']){delete _0x1cbe71['body']['id'];}if(!_[_0xc163('0x4f')](_0x1cbe71[_0xc163('0x31')]['dialTimezone'])){var _0x32cdb7=_0x1cbe71[_0xc163('0x31')][_0xc163('0x50')];if(!_['isNil'](shared[_0xc163('0x51')][_0x32cdb7]))_0x1cbe71['body'][_0xc163('0x52')]=shared[_0xc163('0x51')][_0x32cdb7][_0xc163('0x52')];}return db[_0xc163('0x1e')]['find']({'where':{'id':_0x1cbe71[_0xc163('0x1f')]['id']}})[_0xc163('0x14')](handleEntityNotFound(_0x446014,null))['then'](saveUpdates(_0x1cbe71[_0xc163('0x31')],null))[_0xc163('0x14')](function(_0x5cb231){_0x1f8aea=_0x5cb231;var _0x5bbbab={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5cb231&&_0x5cb231[_0xc163('0x58')]){if(_0x5cb231[_0xc163('0x58')]){_0x5bbbab['where'][_0xc163('0x65')][_0xc163('0x56')]({'ListId':{'$ne':_0x5cb231[_0xc163('0x58')]}});}}return db['CmCustomField'][_0xc163('0x2a')](_0x5bbbab);})[_0xc163('0x14')](function(_0x331fed){if(_0x331fed){return _[_0xc163('0x66')](_[_0xc163('0x6a')](_0x1cbe71[_0xc163('0x31')],function(_0x4b1972,_0x5392d9){return _[_0xc163('0x24')](_0x5392d9,_0xc163('0x25'));}),_[_0xc163('0x67')](_0x331fed,function(_0x4bfb42){return util['format']('cf_%d',_0x4bfb42['id']);}));}})[_0xc163('0x14')](function(_0x15caa3){if(_0x15caa3&&!_[_0xc163('0x6b')](_0x15caa3)){var _0x8c67e8=squel[_0xc163('0x3c')]()[_0xc163('0x6c')]('cm_contacts')[_0xc163('0x6d')](_0x15caa3)[_0xc163('0x57')]('id\x20=\x20?',_0x1cbe71[_0xc163('0x1f')]['id'])[_0xc163('0x6e')]();return db['sequelize']['query'](_0x8c67e8[_0xc163('0x6f')],{'replacements':_0x8c67e8[_0xc163('0x70')]});}})[_0xc163('0x14')](function(){if(_0x1cbe71[_0xc163('0x31')][_0xc163('0x71')]&&_0x1f8aea){return db[_0xc163('0x37')]['update']({'phone':_0x1cbe71[_0xc163('0x31')][_0xc163('0x71')],'OrderBy':0x0},{'where':{'ContactId':_0x1f8aea['id']}});}})[_0xc163('0x14')](function(){return _0x1f8aea;})['then'](respondWithResult(_0x446014,null))[_0xc163('0x1d')](handleError(_0x446014,null));};exports['getTags']=function(_0x1a7495,_0x18dd23){var _0x571ba2={};var _0x15b057={};var _0x280b40;var _0x501994;return db[_0xc163('0x1e')][_0xc163('0x72')]({'where':{'id':_0x1a7495[_0xc163('0x1f')]['id']}})[_0xc163('0x14')](handleEntityNotFound(_0x18dd23,null))[_0xc163('0x14')](function(_0x5f0869){if(_0x5f0869){_0x280b40=_0x5f0869;_0x15b057[_0xc163('0x73')]=_[_0xc163('0x22')](db['Tag'][_0xc163('0x74')]);_0x15b057[_0xc163('0x1b')]=_['keys'](_0x1a7495['query']);_0x15b057['filters']=_[_0xc163('0x75')](_0x15b057[_0xc163('0x73')],_0x15b057[_0xc163('0x1b')]);_0x571ba2[_0xc163('0x76')]=_[_0xc163('0x75')](_0x15b057['model'],qs[_0xc163('0x77')](_0x1a7495['query'][_0xc163('0x77')]));_0x571ba2[_0xc163('0x76')]=_0x571ba2['attributes'][_0xc163('0x23')]?_0x571ba2['attributes']:_0x15b057[_0xc163('0x73')];_0x571ba2[_0xc163('0x78')]=qs['sort'](_0x1a7495[_0xc163('0x1b')]['sort']);_0x571ba2[_0xc163('0x57')]=qs[_0xc163('0x79')](_[_0xc163('0x7a')](_0x1a7495[_0xc163('0x1b')],_0x15b057['filters']));if(_0x1a7495[_0xc163('0x1b')][_0xc163('0x7b')]){_0x571ba2[_0xc163('0x57')]=_[_0xc163('0x7c')](_0x571ba2['where'],{'$or':_[_0xc163('0x67')](_0x571ba2[_0xc163('0x76')],function(_0x54f4b1){var _0x2fb7fb={};_0x2fb7fb[_0x54f4b1]={'$like':'%'+_0x1a7495[_0xc163('0x1b')]['filter']+'%'};return _0x2fb7fb;})});}_0x571ba2=_[_0xc163('0x7c')]({},_0x571ba2,_0x1a7495['options']);return _0x280b40[_0xc163('0x7d')](_0x571ba2);}})[_0xc163('0x14')](function(_0x458d41){if(_0x458d41){_0x501994=_0x458d41['length'];if(!_0x1a7495['query'][_0xc163('0x30')](_0xc163('0x7e'))){_0x571ba2[_0xc163('0xf')]=qs[_0xc163('0xf')](_0x1a7495[_0xc163('0x1b')][_0xc163('0xf')]);_0x571ba2['offset']=qs[_0xc163('0xd')](_0x1a7495['query'][_0xc163('0xd')]);}return _0x280b40[_0xc163('0x7d')](_0x571ba2);}})[_0xc163('0x14')](function(_0x4848bd){if(_0x4848bd){return _0x4848bd?{'count':_0x501994,'rows':_0x4848bd}:null;}})[_0xc163('0x14')](respondWithResult(_0x18dd23,null))[_0xc163('0x1d')](handleError(_0x18dd23,null));};exports[_0xc163('0x7f')]=function(_0x1e26ed,_0x3be110){if(_0x1e26ed[_0xc163('0x31')]['id']){delete _0x1e26ed[_0xc163('0x31')]['id'];}return db[_0xc163('0x1e')][_0xc163('0x72')]({'where':{'id':_0x1e26ed[_0xc163('0x1f')]['id']}})[_0xc163('0x14')](handleEntityNotFound(_0x3be110,null))[_0xc163('0x14')](function(_0x15e846){if(_0x15e846){return _0x15e846[_0xc163('0x7f')](_0x1e26ed[_0xc163('0x31')][_0xc163('0x80')]||[]);}return null;})[_0xc163('0x14')](respondWithResult(_0x3be110,null))[_0xc163('0x1d')](handleError(_0x3be110,null));};exports[_0xc163('0x81')]=function(_0x334cce,_0x550d4a){var _0x30af6d=[];_0x30af6d[_0xc163('0x56')](addAdditionalPhones(_0x334cce['body']));Promise['all'](_0x30af6d)[_0xc163('0x14')](function(){_0x30af6d=[];_0x30af6d['push'](deleteCmHopperPhones(_0x334cce[_0xc163('0x31')]['id']));_0x30af6d[_0xc163('0x56')](addCmHopperPhones(_0x334cce[_0xc163('0x31')]['id']));Promise[_0xc163('0x82')](_0x30af6d)[_0xc163('0x14')](function(){return[0x1];})['then'](respondWithResult(_0x550d4a,null));});};function addAdditionalPhones(_0x44c2fa){var _0x420760;return new Promise(function(_0x5e989d){return db[_0xc163('0x44')][_0xc163('0x15')]({'where':{'CmContactId':_0x44c2fa['id']}})['then'](function(){db[_0xc163('0x61')][_0xc163('0x2a')]({'raw':!![],'attributes':['id',_0xc163('0x83')]})[_0xc163('0x14')](function(_0xb71380){var _0x10e504=[];for(var _0x3907af=0x0;_0x3907af<_0x44c2fa['items'][_0xc163('0x23')];_0x3907af++){var _0xe2c8a2=_0x44c2fa[_0xc163('0x84')]?_[_0xc163('0x4f')](_0x44c2fa[_0xc163('0x84')][_0x3907af])?'':_0x44c2fa[_0xc163('0x84')][_0x3907af]:_0x44c2fa['items'][_0x3907af]['ItemTypeId']?_0x44c2fa['items'][_0x3907af]['ItemTypeId']:'';var _0x5c6378=_[_0xc163('0x4f')](_0x44c2fa[_0xc163('0x85')][_0x3907af][_0xc163('0x86')])?'':_0x44c2fa['items'][_0x3907af]['description'];var _0x5f0d62=_0xe2c8a2+':'+_0x44c2fa[_0xc163('0x85')][_0x3907af][_0xc163('0x71')]+'§'+_0x5c6378;if(_['isNil'](_0x420760))_0x420760=_0x5f0d62;else _0x420760+=';'+_0x5f0d62;var _0x2f6b24=null;var _0xf64c1f=null;if(_0x44c2fa[_0xc163('0x84')]){if(!_[_0xc163('0x4f')](_0x44c2fa[_0xc163('0x84')][_0x3907af])){_0xf64c1f=_['find'](_0xb71380,function(_0x4ee3ae){return _0x4ee3ae['id']===_0x44c2fa[_0xc163('0x84')][_0x3907af];});if(!_['isNil'](_0xf64c1f)){_0x2f6b24=_0xf64c1f[_0xc163('0x83')];}}}else{if(!_[_0xc163('0x4f')](_0x44c2fa['items'][_0x3907af])){_0xf64c1f=_[_0xc163('0x87')](_0xb71380,function(_0x45ec98){return _0x45ec98['id']===_0x44c2fa[_0xc163('0x85')][_0x3907af][_0xc163('0x88')];});if(!_[_0xc163('0x4f')](_0xf64c1f)){_0x2f6b24=_0x3907af;}}}if(_[_0xc163('0x4f')](_0x2f6b24)){_0x2f6b24=0x64;}_0x10e504[_0xc163('0x56')](addAdditionalPhone(_0x44c2fa['id'],_0x44c2fa[_0xc163('0x85')][_0x3907af][_0xc163('0x71')],_0x44c2fa[_0xc163('0x84')]?_[_0xc163('0x4f')](_0x44c2fa['item_types'][_0x3907af])?null:_0x44c2fa['item_types'][_0x3907af]:_0x44c2fa[_0xc163('0x85')][_0x3907af][_0xc163('0x88')]?_0x44c2fa[_0xc163('0x85')][_0x3907af][_0xc163('0x88')]:null,_0x2f6b24,_0x5c6378));}Promise[_0xc163('0x82')](_0x10e504)['then'](function(){db[_0xc163('0x1e')][_0xc163('0x3c')]({'AdditionalPhones':_0x420760},{'where':{'id':_0x44c2fa['id']}})[_0xc163('0x14')](function(){_0x5e989d(0x1);});});});});});}function addAdditionalPhone(_0x22e2e0,_0x24dba5,_0x465458,_0x50f4fc,_0x46f1e7){return db[_0xc163('0x44')][_0xc163('0x87')]({'where':{'CmContactId':_0x22e2e0,'item':_0x24dba5}})[_0xc163('0x14')](function(_0x4fa732){if(_0x4fa732)logger[_0xc163('0x2e')](_0xc163('0x89'),_0x4fa732);else{db[_0xc163('0x44')][_0xc163('0x39')]({'CmContactId':_0x22e2e0,'item':_0x24dba5,'ItemTypeId':_0x465458,'OrderBy':_0x50f4fc,'ItemClass':_0xc163('0x8a'),'description':_0x46f1e7});}});}function deleteCmHopperPhones(_0x432b87){return new Promise(function(_0x52f37f){return db[_0xc163('0x37')][_0xc163('0x2a')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x432b87}})['then'](function(_0x147030){db['CmHopperAdditionalPhone'][_0xc163('0x15')]({'where':{'CmHopperId':{'$in':_[_0xc163('0x67')](_0x147030,'id')}}});})[_0xc163('0x14')](function(){_0x52f37f(0x1);});});}function addCmHopperPhones(_0x54d6a2){return new Promise(function(_0x49f99f){return db[_0xc163('0x37')][_0xc163('0x2a')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x54d6a2}})[_0xc163('0x14')](function(_0x50ebe2){var _0x565564=[];_[_0xc163('0x67')](_0x50ebe2,function(_0x54233f){_0x565564['push'](createCmHopperPhone(_0x54d6a2,_0x54233f['id']));});Promise[_0xc163('0x82')](_0x565564)[_0xc163('0x14')](function(){_0x49f99f(0x1);});});});}function createCmHopperPhone(_0x25afea,_0x3b104d){return new Promise(function(_0x122f25){db[_0xc163('0x44')]['findAll']({'raw':!![],'attributes':[_0xc163('0x8b'),'OrderBy'],'where':{'CmContactId':_0x25afea,'ItemClass':_0xc163('0x8a')},'include':[{'model':db[_0xc163('0x61')],'attributes':[_0xc163('0x83')],'as':_0xc163('0x62')}],'order':[_0xc163('0x83'),db['sequelize'][_0xc163('0x64')](_0xc163('0x8c'))]})[_0xc163('0x14')](function(_0x40dfb0){var _0x27db4c=0x1;var _0x5313f9=_['map'](_0x40dfb0,function(_0x19d60f){_0x19d60f[_0xc163('0x8d')]=_0x3b104d;_0x19d60f['phone']=_0x19d60f['item'];_0x19d60f[_0xc163('0x83')]=_0x27db4c;delete _0x19d60f[_0xc163('0x8e')];_0x27db4c=_0x27db4c+0x1;return _0x19d60f;});return db['CmHopperAdditionalPhone']['bulkCreate'](_0x5313f9,{});})[_0xc163('0x14')](function(){_0x122f25(0x1);});});}function insertAdditionalPhones(_0x5c89a1,_0x5d2e6f){return new Promise(function(_0x497138){var _0x285473=[];for(var _0x143a3b=0x0;_0x143a3b<_0x5d2e6f['length'];_0x143a3b++){var _0xcf0ee1=_0x5d2e6f[_0x143a3b];_0x285473[_0xc163('0x56')](parseContactItemType(_0xcf0ee1));}Promise[_0xc163('0x82')](_0x285473)[_0xc163('0x14')](function(){var _0x5538fd={'id':_0x5c89a1['id'],'items':_0x5d2e6f};return addAdditionalPhones(_0x5538fd)[_0xc163('0x14')](function(){return addCmHopperPhones(_0x5c89a1['id']);});})[_0xc163('0x14')](function(){_0x497138(_0x5c89a1);});});}function parseContactItemType(_0x371b5f){return new Promise(function(_0x4d2eca){if(_0x371b5f[_0xc163('0x30')]('ItemTypeId')){_0x4d2eca(_0x371b5f);}else{return db[_0xc163('0x61')]['find']({'where':{'name':_0x371b5f[_0xc163('0x62')]}})['then'](function(_0x2db37){if(_['isNil'](_0x2db37))_0x371b5f['ItemTypeId']=null;else _0x371b5f['ItemTypeId']=_0x2db37['id'];_0x4d2eca(_0x371b5f);});}});}exports[_0xc163('0x8f')]=function(_0x78b741,_0x38297f){return db['CmContactHasItem'][_0xc163('0x2a')]({'raw':!![],'where':{'CmContactId':_0x78b741[_0xc163('0x1f')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xc163('0x61')],'as':'ItemType'}],'order':[[_0xc163('0x83')],[db[_0xc163('0x63')]['literal'](_0xc163('0x8c'))]]})['then'](function(_0x47e5e7){return _0x47e5e7;})[_0xc163('0x14')](respondWithResult(_0x38297f,null))[_0xc163('0x1d')](handleError(_0x38297f,null));};exports[_0xc163('0x90')]=function(_0x51e0ea,_0x483ae7){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x51e0ea[_0xc163('0x31')][_0xc163('0x91')]}})['then'](function(_0x4751a0){var _0x2cf8da=_[_0xc163('0x67')](_0x4751a0,function(_0x2746d2){_0x2746d2[_0xc163('0x92')]=_0x51e0ea[_0xc163('0x31')][_0xc163('0x93')];return _0x2746d2;});return db[_0xc163('0x44')][_0xc163('0x94')](_0x2cf8da,{});})['then'](function(){return addCmHopperPhones(_0x51e0ea[_0xc163('0x31')][_0xc163('0x93')]);})[_0xc163('0x14')](function(){return['ok'];})[_0xc163('0x14')](respondWithResult(_0x483ae7,null))['catch'](handleError(_0x483ae7,null));};exports['rescheduleAdditionalPhones']=function(_0x244302,_0x2e7cf4){var _0xcdc61b=[];_0xcdc61b[_0xc163('0x56')](createCmHopperPhone(_0x244302['body']['id'],_0x244302['body']['hopperId']));Promise[_0xc163('0x82')](_0xcdc61b)[_0xc163('0x14')](function(){return[0x1];})[_0xc163('0x14')](respondWithResult(_0x2e7cf4,null));};exports[_0xc163('0x95')]=function(_0xc10eb7,_0x5e3dd1){var _0xcaad23={'raw':![],'where':{}};var _0x5cd58a={};var _0x5cef43={'count':0x0,'rows':[]};return db['CmContact'][_0xc163('0x72')]({'where':{'id':_0xc10eb7[_0xc163('0x1f')]['id']}})['then'](handleEntityNotFound(_0x5e3dd1,null))['then'](function(_0x6d12cb){if(_0x6d12cb){_0x5cd58a['model']=_[_0xc163('0x22')](db[_0xc163('0x37')][_0xc163('0x74')]);_0x5cd58a[_0xc163('0x1b')]=_['keys'](_0xc10eb7[_0xc163('0x1b')]);_0x5cd58a['filters']=_[_0xc163('0x75')](_0x5cd58a[_0xc163('0x73')],_0x5cd58a[_0xc163('0x1b')]);_0xcaad23['attributes']=_[_0xc163('0x75')](_0x5cd58a[_0xc163('0x73')],qs[_0xc163('0x77')](_0xc10eb7[_0xc163('0x1b')][_0xc163('0x77')]));_0xcaad23[_0xc163('0x76')]=_0xcaad23[_0xc163('0x76')][_0xc163('0x23')]?_0xcaad23[_0xc163('0x76')]:_0x5cd58a[_0xc163('0x73')];if(!_0xc10eb7[_0xc163('0x1b')][_0xc163('0x30')](_0xc163('0x7e'))){_0xcaad23[_0xc163('0xf')]=qs['limit'](_0xc10eb7[_0xc163('0x1b')][_0xc163('0xf')]);_0xcaad23['offset']=qs[_0xc163('0xd')](_0xc10eb7[_0xc163('0x1b')][_0xc163('0xd')]);}_0xcaad23['order']=qs[_0xc163('0x96')](_0xc10eb7[_0xc163('0x1b')]['sort']);_0xcaad23[_0xc163('0x57')]=qs['filters'](_['pick'](_0xc10eb7[_0xc163('0x1b')],_0x5cd58a['filters']));_0xcaad23[_0xc163('0x57')][_0xc163('0x97')]=_0x6d12cb['id'];if(_0xc10eb7[_0xc163('0x1b')][_0xc163('0x7b')]){_0xcaad23[_0xc163('0x57')]=_[_0xc163('0x7c')](_0xcaad23[_0xc163('0x57')],{'$or':_[_0xc163('0x67')](_0xcaad23[_0xc163('0x76')],function(_0x2361ac){var _0x1e35fb={};_0x1e35fb[_0x2361ac]={'$like':'%'+_0xc10eb7[_0xc163('0x1b')][_0xc163('0x7b')]+'%'};return _0x1e35fb;})});}_0xcaad23=_['merge']({},_0xcaad23,_0xc10eb7[_0xc163('0x98')]);return db[_0xc163('0x37')][_0xc163('0x10')]({'where':_0xcaad23[_0xc163('0x57')]})['then'](function(_0xfc6a53){_0x5cef43[_0xc163('0x10')]=_0xfc6a53;if(_0xc10eb7[_0xc163('0x1b')][_0xc163('0x99')]){_0xcaad23[_0xc163('0x9a')]=[{'all':!![]}];}return db[_0xc163('0x37')][_0xc163('0x2a')](_0xcaad23);})[_0xc163('0x14')](function(_0x46916b){_0x5cef43['rows']=_0x46916b;return _0x5cef43;});}})[_0xc163('0x14')](respondWithFilteredResult(_0x5e3dd1,_0xcaad23))[_0xc163('0x1d')](handleError(_0x5e3dd1,null));};exports[_0xc163('0x9b')]=function(_0x403fa3,_0x566e7f){var _0xa63df0={'raw':!![],'where':{}};var _0x20ec61={};var _0x7e28f4={'count':0x0,'rows':[]};return db[_0xc163('0x1e')][_0xc163('0x72')]({'where':{'id':_0x403fa3[_0xc163('0x1f')]['id']}})[_0xc163('0x14')](handleEntityNotFound(_0x566e7f,null))[_0xc163('0x14')](function(_0x1d56d7){if(_0x1d56d7){_0x20ec61[_0xc163('0x73')]=_['keys'](db[_0xc163('0x46')][_0xc163('0x74')]);_0x20ec61[_0xc163('0x1b')]=_[_0xc163('0x22')](_0x403fa3[_0xc163('0x1b')]);_0x20ec61[_0xc163('0x79')]=_[_0xc163('0x75')](_0x20ec61[_0xc163('0x73')],_0x20ec61[_0xc163('0x1b')]);_0xa63df0['attributes']=_[_0xc163('0x75')](_0x20ec61[_0xc163('0x73')],qs[_0xc163('0x77')](_0x403fa3['query'][_0xc163('0x77')]));_0xa63df0[_0xc163('0x76')]=_0xa63df0[_0xc163('0x76')][_0xc163('0x23')]?_0xa63df0['attributes']:_0x20ec61[_0xc163('0x73')];if(!_0x403fa3['query'][_0xc163('0x30')](_0xc163('0x7e'))){_0xa63df0[_0xc163('0xf')]=qs[_0xc163('0xf')](_0x403fa3[_0xc163('0x1b')][_0xc163('0xf')]);_0xa63df0['offset']=qs[_0xc163('0xd')](_0x403fa3[_0xc163('0x1b')][_0xc163('0xd')]);}_0xa63df0[_0xc163('0x78')]=qs['sort'](_0x403fa3[_0xc163('0x1b')][_0xc163('0x96')]);_0xa63df0[_0xc163('0x57')]=qs[_0xc163('0x79')](_[_0xc163('0x7a')](_0x403fa3[_0xc163('0x1b')],_0x20ec61[_0xc163('0x79')]));_0xa63df0[_0xc163('0x57')][_0xc163('0x97')]=_0x1d56d7['id'];if(_0x403fa3['query'][_0xc163('0x7b')]){_0xa63df0['where']=_[_0xc163('0x7c')](_0xa63df0[_0xc163('0x57')],{'$or':_[_0xc163('0x67')](_0xa63df0[_0xc163('0x76')],function(_0x4881f9){var _0x779e9c={};_0x779e9c[_0x4881f9]={'$like':'%'+_0x403fa3[_0xc163('0x1b')][_0xc163('0x7b')]+'%'};return _0x779e9c;})});}_0xa63df0=_[_0xc163('0x7c')]({},_0xa63df0,_0x403fa3[_0xc163('0x98')]);return db[_0xc163('0x46')]['count']({'where':_0xa63df0[_0xc163('0x57')]})['then'](function(_0x4446ee){_0x7e28f4[_0xc163('0x10')]=_0x4446ee;if(_0x403fa3[_0xc163('0x1b')][_0xc163('0x99')]){_0xa63df0[_0xc163('0x9a')]=[{'all':!![]}];}return db[_0xc163('0x46')][_0xc163('0x2a')](_0xa63df0);})['then'](function(_0x7dfd8c){_0x7e28f4[_0xc163('0x9c')]=_0x7dfd8c;return _0x7e28f4;});}})['then'](respondWithFilteredResult(_0x566e7f,_0xa63df0))['catch'](handleError(_0x566e7f,null));};exports[_0xc163('0x9d')]=function(_0x522851,_0x9f1aec){var _0x4351ca={'raw':!![],'where':{}};var _0x57f128={};var _0x308d76={'count':0x0,'rows':[]};return db[_0xc163('0x1e')]['findOne']({'where':{'id':_0x522851[_0xc163('0x1f')]['id']}})['then'](handleEntityNotFound(_0x9f1aec,null))[_0xc163('0x14')](function(_0xa912fa){if(_0xa912fa){_0x57f128['model']=_['keys'](db[_0xc163('0x45')][_0xc163('0x74')]);_0x57f128[_0xc163('0x1b')]=_[_0xc163('0x22')](_0x522851[_0xc163('0x1b')]);_0x57f128[_0xc163('0x79')]=_['intersection'](_0x57f128[_0xc163('0x73')],_0x57f128[_0xc163('0x1b')]);_0x4351ca[_0xc163('0x76')]=_[_0xc163('0x75')](_0x57f128[_0xc163('0x73')],qs[_0xc163('0x77')](_0x522851[_0xc163('0x1b')][_0xc163('0x77')]));_0x4351ca[_0xc163('0x76')]=_0x4351ca[_0xc163('0x76')][_0xc163('0x23')]?_0x4351ca[_0xc163('0x76')]:_0x57f128[_0xc163('0x73')];if(!_0x522851[_0xc163('0x1b')][_0xc163('0x30')](_0xc163('0x7e'))){_0x4351ca['limit']=qs[_0xc163('0xf')](_0x522851[_0xc163('0x1b')][_0xc163('0xf')]);_0x4351ca[_0xc163('0xd')]=qs[_0xc163('0xd')](_0x522851[_0xc163('0x1b')][_0xc163('0xd')]);}_0x4351ca[_0xc163('0x78')]=qs[_0xc163('0x96')](_0x522851['query'][_0xc163('0x96')]);_0x4351ca[_0xc163('0x57')]=qs[_0xc163('0x79')](_[_0xc163('0x7a')](_0x522851[_0xc163('0x1b')],_0x57f128['filters']));_0x4351ca[_0xc163('0x57')][_0xc163('0x97')]=_0xa912fa['id'];if(_0x522851[_0xc163('0x1b')][_0xc163('0x7b')]){_0x4351ca[_0xc163('0x57')]=_[_0xc163('0x7c')](_0x4351ca[_0xc163('0x57')],{'$or':_[_0xc163('0x67')](_0x4351ca[_0xc163('0x76')],function(_0x529aa3){var _0x331cc9={};_0x331cc9[_0x529aa3]={'$like':'%'+_0x522851['query'][_0xc163('0x7b')]+'%'};return _0x331cc9;})});}_0x4351ca=_['merge']({},_0x4351ca,_0x522851['options']);return db['CmHopperFinal'][_0xc163('0x10')]({'where':_0x4351ca[_0xc163('0x57')]})[_0xc163('0x14')](function(_0x4f311a){_0x308d76[_0xc163('0x10')]=_0x4f311a;if(_0x522851['query']['includeAll']){_0x4351ca[_0xc163('0x9a')]=[{'all':!![]}];}return db[_0xc163('0x45')][_0xc163('0x2a')](_0x4351ca);})[_0xc163('0x14')](function(_0x1637c1){_0x308d76[_0xc163('0x9c')]=_0x1637c1;return _0x308d76;});}})[_0xc163('0x14')](respondWithFilteredResult(_0x9f1aec,_0x4351ca))['catch'](handleError(_0x9f1aec,null));};exports['getJscriptySessions']=function(_0x145d4c,_0x4359cb){var _0x50729f={'raw':!![],'where':{}};var _0x5eb76a={};var _0x52d006={'count':0x0,'rows':[]};return db[_0xc163('0x1e')]['findOne']({'where':{'id':_0x145d4c[_0xc163('0x1f')]['id']}})[_0xc163('0x14')](handleEntityNotFound(_0x4359cb,null))[_0xc163('0x14')](function(_0xd6d07b){if(_0xd6d07b){_0x5eb76a['model']=_['keys'](db[_0xc163('0x9e')][_0xc163('0x74')]);_0x5eb76a['query']=_[_0xc163('0x22')](_0x145d4c[_0xc163('0x1b')]);_0x5eb76a[_0xc163('0x79')]=_[_0xc163('0x75')](_0x5eb76a[_0xc163('0x73')],_0x5eb76a['query']);_0x50729f['attributes']=_['intersection'](_0x5eb76a[_0xc163('0x73')],qs[_0xc163('0x77')](_0x145d4c[_0xc163('0x1b')][_0xc163('0x77')]));_0x50729f[_0xc163('0x76')]=_0x50729f[_0xc163('0x76')][_0xc163('0x23')]?_0x50729f[_0xc163('0x76')]:_0x5eb76a[_0xc163('0x73')];if(!_0x145d4c[_0xc163('0x1b')][_0xc163('0x30')]('nolimit')){_0x50729f[_0xc163('0xf')]=qs[_0xc163('0xf')](_0x145d4c['query']['limit']);_0x50729f['offset']=qs['offset'](_0x145d4c[_0xc163('0x1b')][_0xc163('0xd')]);}_0x50729f['order']=qs[_0xc163('0x96')](_0x145d4c[_0xc163('0x1b')][_0xc163('0x96')]);_0x50729f[_0xc163('0x57')]=qs[_0xc163('0x79')](_['pick'](_0x145d4c[_0xc163('0x1b')],_0x5eb76a[_0xc163('0x79')]));_0x50729f[_0xc163('0x57')][_0xc163('0x97')]=_0xd6d07b['id'];if(_0x145d4c[_0xc163('0x1b')][_0xc163('0x7b')]){_0x50729f[_0xc163('0x57')]=_[_0xc163('0x7c')](_0x50729f[_0xc163('0x57')],{'$or':_[_0xc163('0x67')](_0x50729f['attributes'],function(_0x41e846){var _0xac1767={};_0xac1767[_0x41e846]={'$like':'%'+_0x145d4c[_0xc163('0x1b')]['filter']+'%'};return _0xac1767;})});}_0x50729f=_[_0xc163('0x7c')]({},_0x50729f,_0x145d4c[_0xc163('0x98')]);return db[_0xc163('0x9e')][_0xc163('0x10')]({'where':_0x50729f['where']})[_0xc163('0x14')](function(_0xae70ae){_0x52d006['count']=_0xae70ae;if(_0x145d4c[_0xc163('0x1b')][_0xc163('0x99')]){_0x50729f[_0xc163('0x9a')]=[{'all':!![]}];}return db[_0xc163('0x9e')][_0xc163('0x2a')](_0x50729f);})[_0xc163('0x14')](function(_0x3484a0){_0x52d006[_0xc163('0x9c')]=_0x3484a0;return _0x52d006;});}})[_0xc163('0x14')](respondWithFilteredResult(_0x4359cb,_0x50729f))[_0xc163('0x1d')](handleError(_0x4359cb,null));};exports[_0xc163('0x9f')]=function(_0x33b716,_0x1fe864){try{if(!_0x33b716['body'][_0xc163('0x58')]){throw new Error(_0xc163('0xa0'));}if(!_0x33b716[_0xc163('0x31')][_0xc163('0xa1')]){throw new Error(_0xc163('0xa2'));}if(!_0x33b716['body']['binding_values']){throw new Error(_0xc163('0xa3'));}if(!_0x33b716['body']['socket_timestamp']){throw new Error(_0xc163('0xa4'));}var _0x2f3733=_0x33b716['body'][_0xc163('0xa1')][_0xc163('0xa5')](',');var _0x498beb=_0x33b716['body'][_0xc163('0xa6')][_0xc163('0xa5')](',');if(!_0x2f3733[_0xc163('0x23')]||!_0x498beb[_0xc163('0x23')]||_0x2f3733[_0xc163('0x23')]!==_0x498beb[_0xc163('0x23')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x33b716[_0xc163('0x31')][_0xc163('0x77')]=_[_0xc163('0xa7')](_0x2f3733,_0x498beb);if(!_0x33b716['body'][_0xc163('0x77')][_0xc163('0x71')]){throw new Error(_0xc163('0xa8'));}if(!_0x33b716[_0xc163('0x31')][_0xc163('0x77')][_0xc163('0xa9')]){throw new Error(_0xc163('0xaa'));}var _0x3ed649=path[_0xc163('0x35')](config['root'],'server/files/tmp',_0x33b716[_0xc163('0xab')][_0xc163('0xac')]);fs['chmodSync'](_0x3ed649,parseInt(_0xc163('0xad'),0x8));var _0x6a2698=require(_0xc163('0xae'))['fork'](path[_0xc163('0x35')](__dirname,_0xc163('0xaf')),[_0x3ed649,_0x33b716[_0xc163('0x31')]['binding_keys'],_0x33b716[_0xc163('0x31')][_0xc163('0xa6')],_0x33b716['body'][_0xc163('0x58')],_0x33b716[_0xc163('0x31')][_0xc163('0xb0')],_0x33b716[_0xc163('0x31')][_0xc163('0x54')],_0x33b716[_0xc163('0x31')][_0xc163('0xb1')]]);return _0x1fe864['status'](0xc8)['json']({'message':_0xc163('0xb2'),'pid':_0x6a2698[_0xc163('0xb3')]});}catch(_0x410f53){return _0x1fe864[_0xc163('0xc')](0x1f4)[_0xc163('0xb4')](_0x410f53);}};exports[_0xc163('0xb5')]=function(_0x4d7b4c,_0x44b59c){var _0x1e2b71=fs[_0xc163('0xb6')](_0x4d7b4c[_0xc163('0xab')][_0xc163('0x1')]);Papa['parse'](_0x1e2b71,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5ee195){return _0x44b59c['status'](0xc8)[_0xc163('0x13')]({'file':_0x4d7b4c['file'],'fields':_0x5ee195['meta'][_0xc163('0x77')]});}});};exports[_0xc163('0xb7')]=function(_0x1da90a,_0x1ed726){return db[_0xc163('0xb8')][_0xc163('0x2a')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc163('0xb9')}})[_0xc163('0x14')](function(_0x38e94d){var _0x8d4b43=![];if(!_0x1da90a[_0xc163('0x31')][_0xc163('0x58')]){throw new Error('No\x20ListId\x20specified');}if(!_0x1da90a['body'][_0xc163('0xba')][_0xc163('0x71')]){throw new Error(_0xc163('0xa8'));}if(!_0x1da90a[_0xc163('0x31')]['binding'][_0xc163('0xa9')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1da90a[_0xc163('0x31')][_0xc163('0xb1')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5cd291=require(_0xc163('0xae'))['fork'](path['join'](__dirname,_0xc163('0xbb')),[_0x1da90a['params']['id'],JSON[_0xc163('0xbc')](_0x1da90a[_0xc163('0x31')]),JSON['stringify'](_0x38e94d)]);_0x5cd291['on'](_0xc163('0xbd'),function(){_0x8d4b43=!![];return _0x1ed726[_0xc163('0xc')](0xc8)['json']({'message':_0xc163('0xbe'),'pid':_0x5cd291[_0xc163('0xb3')]});});_0x5cd291['on'](_0xc163('0xbf'),function(_0x22a7b6){if(_0x22a7b6&&!_0x8d4b43){return _0x1ed726['status'](0x1f4)[_0xc163('0x13')]({'message':'error\x20child\x20process','pid':_0x5cd291['pid']});}});})[_0xc163('0x1d')](handleError(_0x1ed726,null));};exports[_0xc163('0xc0')]=function(_0x188f47,_0x31bd67){return db[_0xc163('0xb8')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xc163('0xb9')}})[_0xc163('0x14')](function(_0xed7795){var _0x4ecaf8=![];if(!_0x188f47[_0xc163('0x31')][_0xc163('0x58')]){throw new Error('No\x20ListId\x20specified');}if(!_0x188f47[_0xc163('0x31')][_0xc163('0xba')][_0xc163('0x71')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x188f47[_0xc163('0x31')][_0xc163('0xba')][_0xc163('0xa9')]){throw new Error(_0xc163('0xaa'));}if(!_0x188f47[_0xc163('0x31')][_0xc163('0xb1')]){throw new Error(_0xc163('0xa4'));}var _0x407e32=require(_0xc163('0xae'))[_0xc163('0xc1')](path[_0xc163('0x35')](__dirname,_0xc163('0xc2')),[_0x188f47[_0xc163('0x1f')]['id'],JSON[_0xc163('0xbc')](_0x188f47[_0xc163('0x31')]),JSON[_0xc163('0xbc')](_0xed7795)]);_0x407e32['on']('message',function(){_0x4ecaf8=!![];return _0x31bd67[_0xc163('0xc')](0xc8)[_0xc163('0x13')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x407e32[_0xc163('0xb3')]});});_0x407e32['on'](_0xc163('0xbf'),function(_0x5b0f09){if(_0x5b0f09&&!_0x4ecaf8){return _0x31bd67[_0xc163('0xc')](0x1f4)[_0xc163('0x13')]({'message':_0xc163('0xc3'),'pid':_0x407e32['pid']});}});})['catch'](handleError(_0x31bd67,null));};exports[_0xc163('0xc4')]=function(_0x3bf3e0,_0x4825fb){var _0x3f8bab=[_0xc163('0xc5'),_0xc163('0xc6'),_0xc163('0xc7'),'openchannel',_0xc163('0xc8'),'whatsapp',_0xc163('0xc9')];var _0x5a39cd={'offset':0x0,'order':qs['sort'](_0xc163('0xca'))},_0x356846={'count':0x0,'rows':[]};Promise[_0xc163('0xcb')]()['then'](function(){if(_0x3bf3e0[_0xc163('0x1b')][_0xc163('0xcc')]){if(!_[_0xc163('0xcd')](_0x3f8bab,_0x3bf3e0[_0xc163('0x1b')][_0xc163('0xcc')]['toLowerCase']())){throw new Error(_0xc163('0xce'));}_0x3f8bab=[_0x3bf3e0[_0xc163('0x1b')][_0xc163('0xcc')]['toLowerCase']()];}if(_0x3bf3e0[_0xc163('0x1b')]['range']){try{var _0x9c896b=JSON[_0xc163('0xcf')](_0x3bf3e0[_0xc163('0x1b')][_0xc163('0xd0')]);if(!moment(_0x9c896b['from'])[_0xc163('0xd1')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x9c896b['to'])[_0xc163('0xd1')]()){throw new Error(_0xc163('0xd2'));}}catch(_0x2c0d95){throw new Error(_0xc163('0xd3'));}}if(!_0x3bf3e0[_0xc163('0x1b')][_0xc163('0x30')](_0xc163('0x7e'))){_0x5a39cd[_0xc163('0xf')]=qs['limit'](_0x3bf3e0['query'][_0xc163('0xf')]||0xa);_0x5a39cd['offset']=qs[_0xc163('0xd')](_0x3bf3e0['query'][_0xc163('0xd')]);}var _0xfd7e7b=_0x3f8bab[_0xc163('0x67')](function(_0x8c01e8){if(_0x8c01e8==='voice'){var _0x4c402c={'attributes':['id',_0xc163('0xd4'),_0xc163('0x2d'),_0xc163('0xd5'),_0xc163('0xd6'),_0xc163('0xd7'),_0xc163('0xd8'),_0xc163('0xd9'),_0xc163('0xda'),_0xc163('0xdb'),'createdAt',_0xc163('0xdc'),'userSecondDisposition',_0xc163('0xdd'),_0xc163('0xde')],'where':{'ContactId':_0x3bf3e0[_0xc163('0x1f')]['id']},'include':[{'model':db[_0xc163('0xb8')],'as':_0xc163('0xb8'),'attributes':['id','name',_0xc163('0xdf'),'alias']}],'order':[[_0xc163('0xe0'),_0xc163('0xe1')]]};if(_0x3bf3e0['query'][_0xc163('0xd0')]){_0x4c402c[_0xc163('0x57')][_0xc163('0xe0')]={'$gte':_0x9c896b['from'],'$lte':_0x9c896b['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x4c402c)[_0xc163('0x14')](function(_0x2bbf15){_0x356846[_0xc163('0x10')]+=_0x2bbf15[_0xc163('0x10')];return _[_0xc163('0x67')](_0x2bbf15[_0xc163('0x9c')],function(_0x2a0305){var _0x24c197=_0x2a0305[_0xc163('0x33')]({'plain':!![]});_0x24c197[_0xc163('0xcc')]=_0x8c01e8;if(_0x24c197[_0xc163('0xb8')]){_0x24c197[_0xc163('0xb8')]={'id':_0x24c197[_0xc163('0xb8')]['id'],'name':_0x24c197['User'][_0xc163('0x19')],'fullname':_0x24c197[_0xc163('0xb8')]['fullname'],'alias':_0x24c197[_0xc163('0xb8')][_0xc163('0x2b')]};}return _0x24c197;});});}else{var _0x44db8a=_[_0xc163('0xe2')](_0x8c01e8)+(_0x8c01e8==='chat'?_0xc163('0xe3'):_0xc163('0xe4'));var _0x3f002f={'attributes':['id','closed',_0xc163('0xe5'),_0xc163('0xe0'),_0xc163('0xdb'),_0xc163('0xe6'),_0xc163('0xe7'),_0xc163('0xe8'),_0xc163('0xde'),_0x44db8a+'Id'],'where':{'ContactId':_0x3bf3e0['params']['id']},'include':[{'model':db[_0x44db8a],'as':'Account','attributes':['id',_0xc163('0x19'),_0xc163('0xe9')]},{'model':db[_0xc163('0xb8')],'as':_0xc163('0xea'),'attributes':['id',_0xc163('0x19'),'fullname']},{'model':db[_0xc163('0xeb')],'as':_0xc163('0x5d'),'attributes':['id',_0xc163('0x19'),_0xc163('0x5e')],'through':{'attributes':[]}}],'order':[[_0xc163('0xe0'),'DESC']]};if(_0x3bf3e0[_0xc163('0x1b')][_0xc163('0xd0')]){_0x3f002f['where']['createdAt']={'$gte':_0x9c896b[_0xc163('0x32')],'$lte':_0x9c896b['to']};}switch(_0x8c01e8){case'chat':_0x3f002f['attributes'][_0xc163('0x56')](_0xc163('0xec'),_0xc163('0xed'),_0xc163('0xee'),_0xc163('0xef'),'osName',_0xc163('0xf0'),'ratingType',_0xc163('0xf1'),'referer');break;case'mail':_0x3f002f[_0xc163('0x76')]['push'](_0xc163('0xf2'),_0xc163('0xf3'));break;case _0xc163('0xf4'):_0x3f002f[_0xc163('0x76')][_0xc163('0x56')](_0xc163('0xf5'),_0xc163('0xf6'));break;}return db[_[_0xc163('0xe2')](_0x8c01e8)+'Interaction']['findAndCountAll'](_0x3f002f)['then'](function(_0x345992){_0x356846[_0xc163('0x10')]+=_0x345992[_0xc163('0x10')];return _[_0xc163('0x67')](_0x345992[_0xc163('0x9c')],function(_0x257914){var _0x38acdf=_0x257914[_0xc163('0x33')]({'plain':!![]});_0x38acdf[_0xc163('0xcc')]=_0x8c01e8;if(_0x38acdf[_0xc163('0xea')]){_0x38acdf[_0xc163('0xea')]={'id':_0x38acdf[_0xc163('0xea')]['id'],'name':_0x38acdf[_0xc163('0xea')]['name'],'fullname':_0x38acdf[_0xc163('0xea')][_0xc163('0xdf')]};}return _0x38acdf;});});}});return Promise[_0xc163('0x82')](_0xfd7e7b);})[_0xc163('0x14')](function(_0x266f58){return _(_0x266f58)[_0xc163('0xf7')]()[_0xc163('0xf8')](_0xc163('0xe0'))['reverse']()[_0xc163('0xf9')]();})['then'](function(_0xa8b90a){_0x356846[_0xc163('0x9c')]=_0x5a39cd[_0xc163('0xf')]?_0xa8b90a[_0xc163('0xfa')](_0x5a39cd[_0xc163('0xd')],_0x5a39cd['offset']+_0x5a39cd[_0xc163('0xf')]):_0xa8b90a;return _0x356846;})[_0xc163('0x14')](respondWithFilteredResult(_0x4825fb,_0x5a39cd))['catch'](handleError(_0x4825fb,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index d0e6447..9f1ba51 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 _0x22f7=['emit','hook','exports','../../mysqldb','save','update','remove'];(function(_0x56b886,_0x1ff474){var _0x164baf=function(_0x575d09){while(--_0x575d09){_0x56b886['push'](_0x56b886['shift']());}};_0x164baf(++_0x1ff474);}(_0x22f7,0x199));var _0x722f=function(_0x321226,_0x55c833){_0x321226=_0x321226-0x0;var _0x2d8c8d=_0x22f7[_0x321226];return _0x2d8c8d;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x722f('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x722f('0x1'),'afterUpdate':_0x722f('0x2'),'afterDestroy':_0x722f('0x3')};function emitEvent(_0x52571f){return function(_0x26086c,_0x5619f5,_0x262ac4){CmContactEvents[_0x722f('0x4')](_0x52571f+':'+_0x26086c['id'],_0x26086c);CmContactEvents[_0x722f('0x4')](_0x52571f,_0x26086c);_0x262ac4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x722f('0x5')](e,emitEvent(event));}}module[_0x722f('0x6')]=CmContactEvents; \ No newline at end of file +var _0x0f6a=['../../mysqldb','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x435ff3,_0x285a1e){var _0x41b152=function(_0x2d8d1d){while(--_0x2d8d1d){_0x435ff3['push'](_0x435ff3['shift']());}};_0x41b152(++_0x285a1e);}(_0x0f6a,0x15d));var _0xa0f6=function(_0x208c12,_0x4676a7){_0x208c12=_0x208c12-0x0;var _0x3bdf88=_0x0f6a[_0x208c12];return _0x3bdf88;};'use strict';var EventEmitter=require(_0xa0f6('0x0'));var CmContact=require(_0xa0f6('0x1'))['db'][_0xa0f6('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xa0f6('0x3')](0x0);var events={'afterCreate':_0xa0f6('0x4'),'afterUpdate':_0xa0f6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x57c97a){return function(_0x5ebe10,_0x4cb957,_0x4bd1a6){CmContactEvents[_0xa0f6('0x6')](_0x57c97a+':'+_0x5ebe10['id'],_0x5ebe10);CmContactEvents[_0xa0f6('0x6')](_0x57c97a,_0x5ebe10);_0x4bd1a6(null);};}for(var e in events){if(events[_0xa0f6('0x7')](e)){var event=events[e];CmContact[_0xa0f6('0x8')](e,emitEvent(event));}}module[_0xa0f6('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 5388532..c43af5e 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 _0x42b3=['email','utf8mb4','utf8mb4_unicode_ci','models','error','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','catch','get','isEmpty','length','ContactId','info','[CmContact][afterDestroy][Succesfull]','inspect','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','Campaign','VoiceQueue','scheduledat','YYYY-MM-DD\x20HH:mm:ss','resolve','findOne','then','isNil','timezones','dialTimezone','utcOffset','add','minutes','phone','format','priority','callbackUniqueid','assign','CmHopper','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','create','dialCheckDuplicateType','always','onlyIfOpen','findAll','outbound','CmList','Lists','ListId','map','all','BlackLists','CmHopperBlack','CmContact','cm_contacts','fti_cm_contacts','firstName','lastName'];(function(_0x5e6e7,_0x592fa6){var _0xfb9ec9=function(_0x66e3f6){while(--_0x66e3f6){_0x5e6e7['push'](_0x5e6e7['shift']());}};_0xfb9ec9(++_0x592fa6);}(_0x42b3,0x14a));var _0x342b=function(_0x2efb96,_0x40a4ce){_0x2efb96=_0x2efb96-0x0;var _0x50d38d=_0x42b3[_0x2efb96];return _0x50d38d;};'use strict';var _=require(_0x342b('0x0'));var util=require(_0x342b('0x1'));var logger=require(_0x342b('0x2'))(_0x342b('0x3'));var moment=require(_0x342b('0x4'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');function getTimezoneCallbackAt(_0x3b4545,_0x382f16,_0x3b4132,_0x3afe1d){var _0x172758=_0x3afe1d?_0x342b('0x5'):_0x342b('0x6');var _0x18366d=_0x3b4132[_0x342b('0x7')]?_0x3b4132[_0x342b('0x7')]:moment()['format'](_0x342b('0x8'));if(_['isNil'](_0x3b4132['dialTimezone'])){return Promise[_0x342b('0x9')](_0x18366d);}return _0x3b4545[_0x172758][_0x342b('0xa')]({'where':{'id':_0x382f16}})[_0x342b('0xb')](function(_0x2bfa47){if(_['isNil'](_0x2bfa47)||_[_0x342b('0xc')](_0x2bfa47['dialTimezone'])){return Promise[_0x342b('0x9')](_0x18366d);}var _0x13c1f4=shared[_0x342b('0xd')];var _0x508786=_0x13c1f4[_0x2bfa47[_0x342b('0xe')]];var _0x385ad6=_0x13c1f4[_0x3b4132['dialTimezone']];if(_[_0x342b('0xc')](_0x508786)&&_[_0x342b('0xc')](_0x385ad6)){return Promise[_0x342b('0x9')](_0x18366d);}var _0x149c8e=_0x508786[_0x342b('0xf')]-_0x385ad6['utcOffset'];var _0xf0ae0f=_0x3b4132[_0x342b('0x7')]?_0x3b4132[_0x342b('0x7')]:moment();_0x18366d=moment(_0xf0ae0f)[_0x342b('0x10')](_0x149c8e,_0x342b('0x11'))['format'](_0x342b('0x8'));return Promise['resolve'](_0x18366d);});}function getNewHopperPayload(_0x4773c7){return{'phone':_0x4773c7[_0x342b('0x12')],'ContactId':_0x4773c7['id'],'ListId':_0x4773c7['ListId'],'scheduledat':_0x4773c7[_0x342b('0x7')]?_0x4773c7[_0x342b('0x7')]:moment()[_0x342b('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4773c7[_0x342b('0x14')]?_0x4773c7[_0x342b('0x14')]:0x2,'callback':_0x4773c7[_0x342b('0x15')]?!![]:![],'callbackuniqueid':_0x4773c7['callbackUniqueid']?_0x4773c7[_0x342b('0x15')]:undefined,'callbackat':_0x4773c7[_0x342b('0x15')]?moment()[_0x342b('0x13')](_0x342b('0x8')):undefined};}function handleAlwaysCheckDuplicate(_0x14d795,_0x10c2a2,_0x23065a,_0x34a039){var _0x10b145={'phone':_0x23065a[_0x342b('0x12')]};var _0x29d35b={'calleridnum':_0x23065a['phone']};if(_0x34a039){Object['assign'](_0x10b145,{'CampaignId':_0x10c2a2['id']});Object[_0x342b('0x16')](_0x29d35b,{'CampaignId':_0x10c2a2['id']});}else{Object[_0x342b('0x16')](_0x10b145,{'VoiceQueueId':_0x10c2a2['id']});Object[_0x342b('0x16')](_0x29d35b,{'VoiceQueueId':_0x10c2a2['id']});}return _0x14d795[_0x342b('0x17')][_0x342b('0xa')]({'where':_0x10b145})[_0x342b('0xb')](function(_0x2b3282){if(_0x2b3282){throw new Error('[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x23065a[_0x342b('0x12')]+_0x342b('0x18')+_0x10c2a2['id']);}return _0x14d795[_0x342b('0x19')][_0x342b('0xa')]({'where':_0x29d35b});})[_0x342b('0xb')](function(_0x714388){if(_0x714388){throw new Error(_0x342b('0x1a')+_0x23065a[_0x342b('0x12')]+_0x342b('0x18')+_0x10c2a2['id']);}var _0x40a96b=getNewHopperPayload(_0x23065a);if(_0x34a039){_0x40a96b[_0x342b('0x1b')]=_0x10c2a2['id'];}else{_0x40a96b[_0x342b('0x1c')]=_0x10c2a2['id'];}return _0x14d795[_0x342b('0x17')]['create'](_0x40a96b);});}function handleOnlyIfOpenCheckDuplicate(_0x3a6d4f,_0x1d2f84,_0x604209,_0x498308){var _0x188622={'phone':_0x604209[_0x342b('0x12')]};if(_0x498308){Object[_0x342b('0x16')](_0x188622,{'CampaignId':_0x1d2f84['id']});}else{Object[_0x342b('0x16')](_0x188622,{'VoiceQueueId':_0x1d2f84['id']});}return _0x3a6d4f[_0x342b('0x17')][_0x342b('0xa')]({'where':_0x188622})[_0x342b('0xb')](function(_0x3ad89c){if(_0x3ad89c){throw new Error(_0x342b('0x1d')+_0x604209[_0x342b('0x12')]+_0x342b('0x18')+_0x1d2f84['id']);}var _0x55eafb=getNewHopperPayload(_0x604209);if(_0x498308){_0x55eafb['CampaignId']=_0x1d2f84['id'];}else{_0x55eafb[_0x342b('0x1c')]=_0x1d2f84['id'];}return _0x3a6d4f['CmHopper'][_0x342b('0x1e')](_0x55eafb);});}function handleNeverCheckDuplicate(_0x411b8e,_0x5c8847,_0x35067e){var _0x4749ef=getNewHopperPayload(_0x35067e);_0x4749ef[_0x342b('0x1c')]=_0x5c8847['id'];return _0x411b8e[_0x342b('0x17')]['create'](_0x4749ef);}function handleCheckDuplicate(_0x473b38,_0x5f1d40,_0x16700b,_0x4dddc5){return getTimezoneCallbackAt(_0x473b38,_0x5f1d40,_0x16700b,_0x4dddc5)[_0x342b('0xb')](function(_0x4d4160){_0x16700b[_0x342b('0x7')]=_0x4d4160;switch(_0x5f1d40[_0x342b('0x1f')]){case _0x342b('0x20'):return handleAlwaysCheckDuplicate(_0x473b38,_0x5f1d40,_0x16700b,_0x4dddc5);case _0x342b('0x21'):return handleOnlyIfOpenCheckDuplicate(_0x473b38,_0x5f1d40,_0x16700b,_0x4dddc5);default:return handleNeverCheckDuplicate(_0x473b38,_0x5f1d40,_0x16700b);}});}function createHopperForVoiceQueues(_0x45ff3d,_0x346323){return _0x45ff3d[_0x342b('0x6')][_0x342b('0x22')]({'where':{'type':_0x342b('0x23')},'attributes':['id',_0x342b('0x1f'),_0x342b('0xe')],'include':[{'model':_0x45ff3d[_0x342b('0x24')],'as':_0x342b('0x25'),'where':{'id':_0x346323[_0x342b('0x26')]}}],'raw':!![]})[_0x342b('0xb')](function(_0xfb606d){var _0x5946e7=_0xfb606d[_0x342b('0x27')](function(_0x3c3fc8){return handleCheckDuplicate(_0x45ff3d,_0x3c3fc8,_0x346323,![]);});return Promise[_0x342b('0x28')](_0x5946e7);});}function createHopperForCampaigns(_0x1aea18,_0x6448c3){return _0x1aea18[_0x342b('0x5')]['findAll']({'attributes':['id',_0x342b('0x1f'),_0x342b('0xe')],'include':[{'model':_0x1aea18[_0x342b('0x24')],'as':_0x342b('0x25'),'where':{'id':_0x6448c3[_0x342b('0x26')]}}],'raw':!![]})[_0x342b('0xb')](function(_0xd1e4c7){var _0x35e5ac=_0xd1e4c7['map'](function(_0x44f980){return handleCheckDuplicate(_0x1aea18,_0x44f980,_0x6448c3,!![]);});return Promise[_0x342b('0x28')](_0x35e5ac);});}function createHopperBlackForVoiceQueues(_0x3c047f,_0x2128e5){return _0x3c047f[_0x342b('0x6')][_0x342b('0x22')]({'where':{'type':_0x342b('0x23')},'attributes':['id'],'include':[{'model':_0x3c047f['CmList'],'as':_0x342b('0x29'),'where':{'id':_0x2128e5['ListId']}}],'raw':!![]})[_0x342b('0xb')](function(_0x4d991d){var _0x53715e=_0x4d991d[_0x342b('0x27')](function(_0x4489d3){return _0x3c047f[_0x342b('0x2a')]['create']({'phone':_0x2128e5['phone'],'ContactId':_0x2128e5['id'],'ListId':_0x2128e5['ListId'],'VoiceQueueId':_0x4489d3['id']});});return Promise[_0x342b('0x28')](_0x53715e);});}function createHopperBlackForCampaigns(_0x4ebbb0,_0x4a5af9){return _0x4ebbb0[_0x342b('0x5')]['findAll']({'attributes':['id'],'include':[{'model':_0x4ebbb0[_0x342b('0x24')],'as':_0x342b('0x29'),'where':{'id':_0x4a5af9[_0x342b('0x26')]}}],'raw':!![]})[_0x342b('0xb')](function(_0x1060af){var _0x26fd71=_0x1060af[_0x342b('0x27')](function(_0x54adfe){return _0x4ebbb0[_0x342b('0x2a')]['create']({'phone':_0x4a5af9['phone'],'ContactId':_0x4a5af9['id'],'ListId':_0x4a5af9[_0x342b('0x26')],'CampaignId':_0x54adfe['id']});});return Promise[_0x342b('0x28')](_0x26fd71);});}module['exports']=function(_0x492844){return _0x492844['define'](_0x342b('0x2b'),attributes,{'tableName':_0x342b('0x2c'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x342b('0x12')]},{'name':_0x342b('0x2d'),'fields':[_0x342b('0x2e'),_0x342b('0x2f'),_0x342b('0x12'),'mobile','fax',_0x342b('0x30')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x342b('0x31'),'collate':_0x342b('0x32'),'hooks':{'afterCreate':function(_0x33e79e,_0x5b7ba2,_0x181cb5){var _0x40da2f=_0x492844[_0x342b('0x33')];var _0x16ae26=_0x33e79e['get']({'plain':!![]});if(!_0x16ae26[_0x342b('0x26')]){logger[_0x342b('0x34')](_0x342b('0x35')+_0x16ae26['id']);return _0x181cb5();}if(!_0x16ae26[_0x342b('0x12')]){return _0x181cb5();}return createHopperForVoiceQueues(_0x40da2f,_0x16ae26)[_0x342b('0xb')](function(){return createHopperBlackForVoiceQueues(_0x40da2f,_0x16ae26);})[_0x342b('0xb')](function(){return createHopperForCampaigns(_0x40da2f,_0x16ae26);})[_0x342b('0xb')](function(){return createHopperBlackForCampaigns(_0x40da2f,_0x16ae26);})[_0x342b('0xb')](function(){return _0x181cb5();})[_0x342b('0x36')](function(_0x28c420){logger['error']('[cmContact][afterCreate]',_0x28c420['message']);_0x181cb5();});},'afterDestroy':function(_0x29f6ad,_0x69a7cf,_0x38c8f1){var _0x3fb39b=_0x492844[_0x342b('0x33')];var _0x138999=_0x29f6ad[_0x342b('0x37')]({'plain':!![]});return _0x3fb39b[_0x342b('0x17')][_0x342b('0x22')]({'raw':!![],'where':{'ListId':_0x138999[_0x342b('0x26')],'ContactId':_0x138999['id']}})[_0x342b('0xb')](function(_0x31c02b){if(!_[_0x342b('0x38')](_0x31c02b)){var _0x426166=[];for(var _0x28f23d=0x0;_0x28f23d<_0x31c02b[_0x342b('0x39')];_0x28f23d+=0x1){var _0x472fba=_0x3fb39b[_0x342b('0x17')]['destroy']({'where':{'ListId':_0x31c02b[_0x28f23d][_0x342b('0x26')],'ContactId':_0x31c02b[_0x28f23d][_0x342b('0x3a')],'VoiceQueueId':_0x31c02b[_0x28f23d][_0x342b('0x1c')],'CampaignId':_0x31c02b[_0x28f23d]['CampaignId']}});_0x426166['push'](_0x472fba);}return Promise['all'](_0x426166);}})[_0x342b('0xb')](function(_0x326a23){logger[_0x342b('0x3b')](_0x342b('0x3c'),util[_0x342b('0x3d')](_0x326a23,{'showHidden':![],'depth':null}));_0x38c8f1();})[_0x342b('0x36')](function(_0x313283){logger[_0x342b('0x34')](_0x342b('0x3e'),util['inspect'](_0x313283,{'showHidden':![],'depth':null}));_0x38c8f1(_0x313283);});}}});}; \ No newline at end of file +var _0xfd94=['isEmpty','length','destroy','ContactId','info','[CmContact][afterDestroy][Succesfull]','inspect','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','../../config/environment/shared','./cmContact.attributes','Campaign','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','resolve','findOne','then','timezones','utcOffset','add','minutes','format','ListId','priority','callbackUniqueid','phone','assign','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId','CmHopper','create','dialCheckDuplicateType','onlyIfOpen','VoiceQueue','outbound','CmList','map','findAll','Lists','all','BlackLists','CmHopperBlack','exports','define','CmContact','cm_contacts','fti_cm_contacts','firstName','mobile','utf8mb4','utf8mb4_unicode_ci','models','get','error','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','catch','message'];(function(_0x4c7fe9,_0x27a4e8){var _0x3ee959=function(_0x559441){while(--_0x559441){_0x4c7fe9['push'](_0x4c7fe9['shift']());}};_0x3ee959(++_0x27a4e8);}(_0xfd94,0xce));var _0x4fd9=function(_0x1ae975,_0x70b40e){_0x1ae975=_0x1ae975-0x0;var _0x2576ca=_0xfd94[_0x1ae975];return _0x2576ca;};'use strict';var _=require(_0x4fd9('0x0'));var util=require(_0x4fd9('0x1'));var logger=require(_0x4fd9('0x2'))(_0x4fd9('0x3'));var moment=require(_0x4fd9('0x4'));var shared=require(_0x4fd9('0x5'));var attributes=require(_0x4fd9('0x6'));function getTimezoneCallbackAt(_0x255f63,_0x43fa93,_0x125de9,_0xc79566){var _0x3275cc=_0xc79566?_0x4fd9('0x7'):'VoiceQueue';var _0x3de6f8=_0x125de9[_0x4fd9('0x8')]?_0x125de9[_0x4fd9('0x8')]:moment()['format'](_0x4fd9('0x9'));if(_[_0x4fd9('0xa')](_0x125de9[_0x4fd9('0xb')])){return Promise[_0x4fd9('0xc')](_0x3de6f8);}return _0x255f63[_0x3275cc][_0x4fd9('0xd')]({'where':{'id':_0x43fa93}})[_0x4fd9('0xe')](function(_0x1a8329){if(_[_0x4fd9('0xa')](_0x1a8329)||_[_0x4fd9('0xa')](_0x1a8329[_0x4fd9('0xb')])){return Promise[_0x4fd9('0xc')](_0x3de6f8);}var _0x334475=shared[_0x4fd9('0xf')];var _0x1d48f9=_0x334475[_0x1a8329[_0x4fd9('0xb')]];var _0x3bda87=_0x334475[_0x125de9[_0x4fd9('0xb')]];if(_[_0x4fd9('0xa')](_0x1d48f9)&&_[_0x4fd9('0xa')](_0x3bda87)){return Promise[_0x4fd9('0xc')](_0x3de6f8);}var _0x546129=_0x1d48f9['utcOffset']-_0x3bda87[_0x4fd9('0x10')];var _0xb2d1cd=_0x125de9[_0x4fd9('0x8')]?_0x125de9[_0x4fd9('0x8')]:moment();_0x3de6f8=moment(_0xb2d1cd)[_0x4fd9('0x11')](_0x546129,_0x4fd9('0x12'))[_0x4fd9('0x13')](_0x4fd9('0x9'));return Promise[_0x4fd9('0xc')](_0x3de6f8);});}function getNewHopperPayload(_0x58a5a2){return{'phone':_0x58a5a2['phone'],'ContactId':_0x58a5a2['id'],'ListId':_0x58a5a2[_0x4fd9('0x14')],'scheduledat':_0x58a5a2['scheduledat']?_0x58a5a2[_0x4fd9('0x8')]:moment()[_0x4fd9('0x13')](_0x4fd9('0x9')),'priority':_0x58a5a2['priority']?_0x58a5a2[_0x4fd9('0x15')]:0x2,'callback':_0x58a5a2[_0x4fd9('0x16')]?!![]:![],'callbackuniqueid':_0x58a5a2[_0x4fd9('0x16')]?_0x58a5a2[_0x4fd9('0x16')]:undefined,'callbackat':_0x58a5a2[_0x4fd9('0x16')]?moment()['format'](_0x4fd9('0x9')):undefined};}function handleAlwaysCheckDuplicate(_0x797583,_0x35b193,_0x111979,_0x289486){var _0x2f72ad={'phone':_0x111979[_0x4fd9('0x17')]};var _0x2b4086={'calleridnum':_0x111979['phone']};if(_0x289486){Object[_0x4fd9('0x18')](_0x2f72ad,{'CampaignId':_0x35b193['id']});Object[_0x4fd9('0x18')](_0x2b4086,{'CampaignId':_0x35b193['id']});}else{Object[_0x4fd9('0x18')](_0x2f72ad,{'VoiceQueueId':_0x35b193['id']});Object[_0x4fd9('0x18')](_0x2b4086,{'VoiceQueueId':_0x35b193['id']});}return _0x797583['CmHopper']['findOne']({'where':_0x2f72ad})[_0x4fd9('0xe')](function(_0x3d2bd1){if(_0x3d2bd1){throw new Error(_0x4fd9('0x19')+_0x111979[_0x4fd9('0x17')]+_0x4fd9('0x1a')+_0x35b193['id']);}return _0x797583['CmHopperFinal']['findOne']({'where':_0x2b4086});})['then'](function(_0x3d6491){if(_0x3d6491){throw new Error(_0x4fd9('0x1b')+_0x111979['phone']+'\x20in\x20Campaign\x20with\x20id\x20'+_0x35b193['id']);}var _0x50a7de=getNewHopperPayload(_0x111979);if(_0x289486){_0x50a7de[_0x4fd9('0x1c')]=_0x35b193['id'];}else{_0x50a7de[_0x4fd9('0x1d')]=_0x35b193['id'];}return _0x797583[_0x4fd9('0x1e')][_0x4fd9('0x1f')](_0x50a7de);});}function handleOnlyIfOpenCheckDuplicate(_0x2d9f63,_0x59e67b,_0x64499a,_0x377eda){var _0x568392={'phone':_0x64499a[_0x4fd9('0x17')]};if(_0x377eda){Object['assign'](_0x568392,{'CampaignId':_0x59e67b['id']});}else{Object['assign'](_0x568392,{'VoiceQueueId':_0x59e67b['id']});}return _0x2d9f63[_0x4fd9('0x1e')]['findOne']({'where':_0x568392})[_0x4fd9('0xe')](function(_0x2436ee){if(_0x2436ee){throw new Error('[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x64499a[_0x4fd9('0x17')]+_0x4fd9('0x1a')+_0x59e67b['id']);}var _0x22ac46=getNewHopperPayload(_0x64499a);if(_0x377eda){_0x22ac46['CampaignId']=_0x59e67b['id'];}else{_0x22ac46[_0x4fd9('0x1d')]=_0x59e67b['id'];}return _0x2d9f63[_0x4fd9('0x1e')][_0x4fd9('0x1f')](_0x22ac46);});}function handleNeverCheckDuplicate(_0x41251c,_0x22e5b7,_0x3d05dc){var _0x52fb39=getNewHopperPayload(_0x3d05dc);_0x52fb39[_0x4fd9('0x1d')]=_0x22e5b7['id'];return _0x41251c[_0x4fd9('0x1e')]['create'](_0x52fb39);}function handleCheckDuplicate(_0x299de5,_0x4ccc87,_0x5e354e,_0x354b46){return getTimezoneCallbackAt(_0x299de5,_0x4ccc87,_0x5e354e,_0x354b46)[_0x4fd9('0xe')](function(_0x50f3cb){_0x5e354e['scheduledat']=_0x50f3cb;switch(_0x4ccc87[_0x4fd9('0x20')]){case'always':return handleAlwaysCheckDuplicate(_0x299de5,_0x4ccc87,_0x5e354e,_0x354b46);case _0x4fd9('0x21'):return handleOnlyIfOpenCheckDuplicate(_0x299de5,_0x4ccc87,_0x5e354e,_0x354b46);default:return handleNeverCheckDuplicate(_0x299de5,_0x4ccc87,_0x5e354e);}});}function createHopperForVoiceQueues(_0x112dbe,_0x2e44bf){return _0x112dbe[_0x4fd9('0x22')]['findAll']({'where':{'type':_0x4fd9('0x23')},'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x112dbe[_0x4fd9('0x24')],'as':'Lists','where':{'id':_0x2e44bf[_0x4fd9('0x14')]}}],'raw':!![]})[_0x4fd9('0xe')](function(_0x3bb37a){var _0x1573a1=_0x3bb37a[_0x4fd9('0x25')](function(_0x48574e){return handleCheckDuplicate(_0x112dbe,_0x48574e,_0x2e44bf,![]);});return Promise['all'](_0x1573a1);});}function createHopperForCampaigns(_0x7d5b6f,_0x4ccadc){return _0x7d5b6f['Campaign'][_0x4fd9('0x26')]({'attributes':['id','dialCheckDuplicateType',_0x4fd9('0xb')],'include':[{'model':_0x7d5b6f[_0x4fd9('0x24')],'as':_0x4fd9('0x27'),'where':{'id':_0x4ccadc['ListId']}}],'raw':!![]})['then'](function(_0x2f89a4){var _0x5b1661=_0x2f89a4[_0x4fd9('0x25')](function(_0xc08aea){return handleCheckDuplicate(_0x7d5b6f,_0xc08aea,_0x4ccadc,!![]);});return Promise[_0x4fd9('0x28')](_0x5b1661);});}function createHopperBlackForVoiceQueues(_0x5aa6cc,_0x2ed68a){return _0x5aa6cc[_0x4fd9('0x22')][_0x4fd9('0x26')]({'where':{'type':_0x4fd9('0x23')},'attributes':['id'],'include':[{'model':_0x5aa6cc[_0x4fd9('0x24')],'as':_0x4fd9('0x29'),'where':{'id':_0x2ed68a[_0x4fd9('0x14')]}}],'raw':!![]})[_0x4fd9('0xe')](function(_0x348c4){var _0x1c41ac=_0x348c4[_0x4fd9('0x25')](function(_0x6e9235){return _0x5aa6cc[_0x4fd9('0x2a')][_0x4fd9('0x1f')]({'phone':_0x2ed68a['phone'],'ContactId':_0x2ed68a['id'],'ListId':_0x2ed68a[_0x4fd9('0x14')],'VoiceQueueId':_0x6e9235['id']});});return Promise[_0x4fd9('0x28')](_0x1c41ac);});}function createHopperBlackForCampaigns(_0x578702,_0x1af059){return _0x578702[_0x4fd9('0x7')][_0x4fd9('0x26')]({'attributes':['id'],'include':[{'model':_0x578702[_0x4fd9('0x24')],'as':_0x4fd9('0x29'),'where':{'id':_0x1af059[_0x4fd9('0x14')]}}],'raw':!![]})['then'](function(_0x5ce733){var _0x15dd7c=_0x5ce733[_0x4fd9('0x25')](function(_0x1b27c0){return _0x578702['CmHopperBlack']['create']({'phone':_0x1af059[_0x4fd9('0x17')],'ContactId':_0x1af059['id'],'ListId':_0x1af059[_0x4fd9('0x14')],'CampaignId':_0x1b27c0['id']});});return Promise[_0x4fd9('0x28')](_0x15dd7c);});}module[_0x4fd9('0x2b')]=function(_0x89050b){return _0x89050b[_0x4fd9('0x2c')](_0x4fd9('0x2d'),attributes,{'tableName':_0x4fd9('0x2e'),'paranoid':!![],'indexes':[{'name':_0x4fd9('0x17'),'fields':[_0x4fd9('0x17')]},{'name':_0x4fd9('0x2f'),'fields':[_0x4fd9('0x30'),'lastName','phone',_0x4fd9('0x31'),'fax','email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x4fd9('0x32'),'collate':_0x4fd9('0x33'),'hooks':{'afterCreate':function(_0xc47b54,_0x3728ed,_0x464f26){var _0x53ceb5=_0x89050b[_0x4fd9('0x34')];var _0x4e3037=_0xc47b54[_0x4fd9('0x35')]({'plain':!![]});if(!_0x4e3037[_0x4fd9('0x14')]){logger[_0x4fd9('0x36')](_0x4fd9('0x37')+_0x4e3037['id']);return _0x464f26();}if(!_0x4e3037[_0x4fd9('0x17')]){return _0x464f26();}return createHopperForVoiceQueues(_0x53ceb5,_0x4e3037)[_0x4fd9('0xe')](function(){return createHopperBlackForVoiceQueues(_0x53ceb5,_0x4e3037);})[_0x4fd9('0xe')](function(){return createHopperForCampaigns(_0x53ceb5,_0x4e3037);})[_0x4fd9('0xe')](function(){return createHopperBlackForCampaigns(_0x53ceb5,_0x4e3037);})[_0x4fd9('0xe')](function(){return _0x464f26();})[_0x4fd9('0x38')](function(_0x4776da){logger['error']('[cmContact][afterCreate]',_0x4776da[_0x4fd9('0x39')]);_0x464f26();});},'afterDestroy':function(_0x1569f2,_0x4554cc,_0x57b3aa){var _0x2520ad=_0x89050b[_0x4fd9('0x34')];var _0x2c9714=_0x1569f2[_0x4fd9('0x35')]({'plain':!![]});return _0x2520ad['CmHopper'][_0x4fd9('0x26')]({'raw':!![],'where':{'ListId':_0x2c9714['ListId'],'ContactId':_0x2c9714['id']}})[_0x4fd9('0xe')](function(_0x433529){if(!_[_0x4fd9('0x3a')](_0x433529)){var _0x16a9a8=[];for(var _0x5471db=0x0;_0x5471db<_0x433529[_0x4fd9('0x3b')];_0x5471db+=0x1){var _0x41ef47=_0x2520ad[_0x4fd9('0x1e')][_0x4fd9('0x3c')]({'where':{'ListId':_0x433529[_0x5471db][_0x4fd9('0x14')],'ContactId':_0x433529[_0x5471db][_0x4fd9('0x3d')],'VoiceQueueId':_0x433529[_0x5471db][_0x4fd9('0x1d')],'CampaignId':_0x433529[_0x5471db][_0x4fd9('0x1c')]}});_0x16a9a8['push'](_0x41ef47);}return Promise[_0x4fd9('0x28')](_0x16a9a8);}})[_0x4fd9('0xe')](function(_0x4d7a5a){logger[_0x4fd9('0x3e')](_0x4fd9('0x3f'),util[_0x4fd9('0x40')](_0x4d7a5a,{'showHidden':![],'depth':null}));_0x57b3aa();})[_0x4fd9('0x38')](function(_0x1d6915){logger[_0x4fd9('0x36')](_0x4fd9('0x41'),util[_0x4fd9('0x40')](_0x1d6915,{'showHidden':![],'depth':null}));_0x57b3aa(_0x1d6915);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 815e04b..6909556 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 _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x5f0178,_0x3488e3){var _0x1182df=function(_0x4d9e99){while(--_0x4d9e99){_0x5f0178['push'](_0x5f0178['shift']());}};_0x1182df(++_0x3488e3);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\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(_0x59c3a8,_0x5ee6e1){var _0x5834b8=function(_0x3d6f16){while(--_0x3d6f16){_0x59c3a8['push'](_0x59c3a8['shift']());}};_0x5834b8(++_0x5ee6e1);}(_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['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 31d5433..3fee399 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 _0x544a=['STRING','sequelize','exports','INTEGER'];(function(_0x5acd5d,_0x1d3cf3){var _0x359411=function(_0x281312){while(--_0x281312){_0x5acd5d['push'](_0x5acd5d['shift']());}};_0x359411(++_0x1d3cf3);}(_0x544a,0xbd));var _0xa544=function(_0x58d127,_0x41d972){_0x58d127=_0x58d127-0x0;var _0x4a594d=_0x544a[_0x58d127];return _0x4a594d;};'use strict';var Sequelize=require(_0xa544('0x0'));module[_0xa544('0x1')]={'CmContactId':{'type':Sequelize[_0xa544('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xa544('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xa544('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xa544('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x7b6b=['sequelize','INTEGER','STRING','PHONE'];(function(_0x3b6a4c,_0x121df3){var _0x7137c4=function(_0xcdf1a3){while(--_0xcdf1a3){_0x3b6a4c['push'](_0x3b6a4c['shift']());}};_0x7137c4(++_0x121df3);}(_0x7b6b,0xac));var _0xb7b6=function(_0x142956,_0x4e83c5){_0x142956=_0x142956-0x0;var _0x5d6d65=_0x7b6b[_0x142956];return _0x5d6d65;};'use strict';var Sequelize=require(_0xb7b6('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xb7b6('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xb7b6('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xb7b6('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xb7b6('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xb7b6('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 0a3b3d1..4888507 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 _0x216c=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','options','CmContactHasItem','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId'];(function(_0x528b7b,_0x11ec67){var _0x20dadf=function(_0x3cedb1){while(--_0x3cedb1){_0x528b7b['push'](_0x528b7b['shift']());}};_0x20dadf(++_0x11ec67);}(_0x216c,0x153));var _0xc216=function(_0x55551a,_0x44aa7e){_0x55551a=_0x55551a-0x0;var _0x1a80b0=_0x216c[_0x55551a];return _0x1a80b0;};'use strict';var emlformat=require(_0xc216('0x0'));var rimraf=require(_0xc216('0x1'));var zipdir=require(_0xc216('0x2'));var jsonpatch=require(_0xc216('0x3'));var rp=require(_0xc216('0x4'));var moment=require(_0xc216('0x5'));var BPromise=require(_0xc216('0x6'));var Mustache=require('mustache');var util=require(_0xc216('0x7'));var path=require(_0xc216('0x8'));var sox=require(_0xc216('0x9'));var csv=require(_0xc216('0xa'));var ejs=require(_0xc216('0xb'));var fs=require('fs');var fs_extra=require(_0xc216('0xc'));var _=require('lodash');var squel=require(_0xc216('0xd'));var crypto=require(_0xc216('0xe'));var jsforce=require(_0xc216('0xf'));var deskjs=require(_0xc216('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc216('0x11'));var Redis=require(_0xc216('0x12'));var authService=require(_0xc216('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc216('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc216('0x15'))(_0xc216('0x16'));var utils=require(_0xc216('0x17'));var config=require(_0xc216('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc216('0x19'))['db'];function respondWithStatusCode(_0x500ec7,_0x3f42be){_0x3f42be=_0x3f42be||0xcc;return function(_0x506d16){if(_0x506d16){return _0x500ec7[_0xc216('0x1a')](_0x3f42be);}return _0x500ec7[_0xc216('0x1b')](_0x3f42be)[_0xc216('0x1c')]();};}function respondWithResult(_0x2adcc1,_0x19c7d1){_0x19c7d1=_0x19c7d1||0xc8;return function(_0x33dcdf){if(_0x33dcdf){return _0x2adcc1[_0xc216('0x1b')](_0x19c7d1)['json'](_0x33dcdf);}};}function respondWithFilteredResult(_0x165278,_0x3d0221){return function(_0x1b26e1){if(_0x1b26e1){var _0x421e04=typeof _0x3d0221[_0xc216('0x1d')]===_0xc216('0x1e')&&typeof _0x3d0221['limit']==='undefined';var _0x1b4cdb=_0x1b26e1['count'];var _0x18f8ce=_0x421e04?0x0:_0x3d0221[_0xc216('0x1d')];var _0x3f70fd=_0x421e04?_0x1b26e1[_0xc216('0x1f')]:_0x3d0221['offset']+_0x3d0221['limit'];var _0x296a85;if(_0x3f70fd>=_0x1b4cdb){_0x3f70fd=_0x1b4cdb;_0x296a85=0xc8;}else{_0x296a85=0xce;}_0x165278[_0xc216('0x1b')](_0x296a85);return _0x165278[_0xc216('0x20')](_0xc216('0x21'),_0x18f8ce+'-'+_0x3f70fd+'/'+_0x1b4cdb)[_0xc216('0x22')](_0x1b26e1);}return null;};}function patchUpdates(_0x40e292){return function(_0x1e6d30){try{jsonpatch[_0xc216('0x23')](_0x1e6d30,_0x40e292,!![]);}catch(_0xa39f23){return BPromise[_0xc216('0x24')](_0xa39f23);}return _0x1e6d30['save']();};}function saveUpdates(_0x214e6d,_0x3c6797){return function(_0x5c16fe){if(_0x5c16fe){return _0x5c16fe['update'](_0x214e6d)[_0xc216('0x25')](function(_0x59fe8f){return _0x59fe8f;});}return null;};}function removeEntity(_0x43ff14,_0x2e0b70){return function(_0x4948a0){if(_0x4948a0){return _0x4948a0[_0xc216('0x26')]()['then'](function(){var _0x16cd93=_0x4948a0[_0xc216('0x27')]({'plain':!![]});var _0x269946=_0xc216('0x28');return db[_0xc216('0x29')][_0xc216('0x26')]({'where':{'type':_0x269946,'resourceId':_0x16cd93['id']}})[_0xc216('0x25')](function(){return _0x4948a0;});})['then'](function(){_0x43ff14['status'](0xcc)[_0xc216('0x1c')]();});}};}function handleEntityNotFound(_0x1d5b30,_0x1ce2af){return function(_0x327f0c){if(!_0x327f0c){_0x1d5b30[_0xc216('0x1a')](0x194);}return _0x327f0c;};}function handleError(_0x32e92c,_0x58d6b2){_0x58d6b2=_0x58d6b2||0x1f4;return function(_0x31c6bc){logger[_0xc216('0x2a')](_0x31c6bc[_0xc216('0x2b')]);if(_0x31c6bc[_0xc216('0x2c')]){delete _0x31c6bc[_0xc216('0x2c')];}_0x32e92c[_0xc216('0x1b')](_0x58d6b2)['send'](_0x31c6bc);};}exports[_0xc216('0x2d')]=function(_0x314113,_0x3ca490){var _0x594327={},_0x9594fe={},_0x310e53={'count':0x0,'rows':[]};var _0x4849dd=_[_0xc216('0x2e')](db['CmContactHasItem'][_0xc216('0x2f')],function(_0x58fee3){return{'name':_0x58fee3[_0xc216('0x30')],'type':_0x58fee3[_0xc216('0x31')][_0xc216('0x32')]};});_0x9594fe[_0xc216('0x33')]=_[_0xc216('0x2e')](_0x4849dd,_0xc216('0x2c'));_0x9594fe[_0xc216('0x34')]=_[_0xc216('0x35')](_0x314113[_0xc216('0x34')]);_0x9594fe[_0xc216('0x36')]=_[_0xc216('0x37')](_0x9594fe[_0xc216('0x33')],_0x9594fe[_0xc216('0x34')]);_0x594327['attributes']=_[_0xc216('0x37')](_0x9594fe[_0xc216('0x33')],qs[_0xc216('0x38')](_0x314113['query']['fields']));_0x594327[_0xc216('0x39')]=_0x594327[_0xc216('0x39')][_0xc216('0x3a')]?_0x594327[_0xc216('0x39')]:_0x9594fe[_0xc216('0x33')];if(!_0x314113[_0xc216('0x34')]['hasOwnProperty'](_0xc216('0x3b'))){_0x594327[_0xc216('0x3c')]=qs['limit'](_0x314113[_0xc216('0x34')][_0xc216('0x3c')]);_0x594327[_0xc216('0x1d')]=qs[_0xc216('0x1d')](_0x314113[_0xc216('0x34')][_0xc216('0x1d')]);}_0x594327[_0xc216('0x3d')]=qs[_0xc216('0x3e')](_0x314113[_0xc216('0x34')]['sort']);_0x594327[_0xc216('0x3f')]=qs[_0xc216('0x36')](_['pick'](_0x314113['query'],_0x9594fe[_0xc216('0x36')]),_0x4849dd);if(_0x314113[_0xc216('0x34')][_0xc216('0x40')]){_0x594327[_0xc216('0x3f')]=_[_0xc216('0x41')](_0x594327[_0xc216('0x3f')],{'$or':_[_0xc216('0x2e')](_0x4849dd,function(_0x529c47){if(_0x529c47[_0xc216('0x31')]!=='VIRTUAL'){var _0x102c53={};_0x102c53[_0x529c47[_0xc216('0x2c')]]={'$like':'%'+_0x314113[_0xc216('0x34')][_0xc216('0x40')]+'%'};return _0x102c53;}})});}_0x594327=_[_0xc216('0x41')]({},_0x594327,_0x314113[_0xc216('0x42')]);var _0x45fff2={'where':_0x594327[_0xc216('0x3f')]};return db[_0xc216('0x43')]['count'](_0x45fff2)[_0xc216('0x25')](function(_0x5ca70c){_0x310e53['count']=_0x5ca70c;if(_0x314113['query'][_0xc216('0x44')]){_0x594327[_0xc216('0x45')]=[{'all':!![]}];}return db['CmContactHasItem'][_0xc216('0x46')](_0x594327);})[_0xc216('0x25')](function(_0x4d52f7){_0x310e53[_0xc216('0x47')]=_0x4d52f7;return _0x310e53;})[_0xc216('0x25')](respondWithFilteredResult(_0x3ca490,_0x594327))[_0xc216('0x48')](handleError(_0x3ca490,null));};exports[_0xc216('0x49')]=function(_0x5cc8a1,_0x4f1c08){var _0x5a2cd1={'raw':!![],'where':{'id':_0x5cc8a1[_0xc216('0x4a')]['id']}},_0x51deb3={};_0x51deb3[_0xc216('0x33')]=_['keys'](db[_0xc216('0x43')][_0xc216('0x2f')]);_0x51deb3[_0xc216('0x34')]=_[_0xc216('0x35')](_0x5cc8a1[_0xc216('0x34')]);_0x51deb3[_0xc216('0x36')]=_[_0xc216('0x37')](_0x51deb3[_0xc216('0x33')],_0x51deb3[_0xc216('0x34')]);_0x5a2cd1[_0xc216('0x39')]=_['intersection'](_0x51deb3[_0xc216('0x33')],qs[_0xc216('0x38')](_0x5cc8a1[_0xc216('0x34')]['fields']));_0x5a2cd1[_0xc216('0x39')]=_0x5a2cd1[_0xc216('0x39')][_0xc216('0x3a')]?_0x5a2cd1[_0xc216('0x39')]:_0x51deb3[_0xc216('0x33')];if(_0x5cc8a1['query'][_0xc216('0x44')]){_0x5a2cd1['include']=[{'all':!![]}];}_0x5a2cd1=_[_0xc216('0x41')]({},_0x5a2cd1,_0x5cc8a1[_0xc216('0x42')]);return db[_0xc216('0x43')][_0xc216('0x4b')](_0x5a2cd1)[_0xc216('0x25')](handleEntityNotFound(_0x4f1c08,null))[_0xc216('0x25')](respondWithResult(_0x4f1c08,null))[_0xc216('0x48')](handleError(_0x4f1c08,null));};exports[_0xc216('0x4c')]=function(_0x175a35,_0x3342ec){return db[_0xc216('0x43')]['create'](_0x175a35[_0xc216('0x4d')],{})[_0xc216('0x25')](function(_0xde1abc){var _0x4035eb=_0x175a35[_0xc216('0x4e')][_0xc216('0x27')]({'plain':!![]});if(!_0x4035eb)throw new Error(_0xc216('0x4f'));if(_0x4035eb['role']===_0xc216('0x4e')){var _0x16be79=_0xde1abc['get']({'plain':!![]});var _0x19aa1a=_0xc216('0x28');return db['UserProfileSection'][_0xc216('0x4b')]({'where':{'name':_0x19aa1a,'userProfileId':_0x4035eb[_0xc216('0x50')]},'raw':!![]})['then'](function(_0x1a2be4){if(_0x1a2be4&&_0x1a2be4[_0xc216('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x16be79[_0xc216('0x2c')],'resourceId':_0x16be79['id'],'type':_0x1a2be4[_0xc216('0x2c')],'sectionId':_0x1a2be4['id']},{})['then'](function(){return _0xde1abc;});}else{return _0xde1abc;}})['catch'](function(_0x310288){logger[_0xc216('0x2a')](_0xc216('0x52'),_0x310288);throw _0x310288;});}return _0xde1abc;})[_0xc216('0x25')](respondWithResult(_0x3342ec,0xc9))[_0xc216('0x48')](handleError(_0x3342ec,null));};exports[_0xc216('0x53')]=function(_0x1fc929,_0x3d03e6){if(_0x1fc929['body']['id']){delete _0x1fc929[_0xc216('0x4d')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x1fc929['params']['id']}})[_0xc216('0x25')](handleEntityNotFound(_0x3d03e6,null))[_0xc216('0x25')](saveUpdates(_0x1fc929[_0xc216('0x4d')],null))[_0xc216('0x25')](respondWithResult(_0x3d03e6,null))['catch'](handleError(_0x3d03e6,null));};exports[_0xc216('0x26')]=function(_0x5f4aae,_0x20e2ee){return db['CmContactHasItem'][_0xc216('0x4b')]({'where':{'id':_0x5f4aae[_0xc216('0x4a')]['id']}})[_0xc216('0x25')](handleEntityNotFound(_0x20e2ee,null))['then'](removeEntity(_0x20e2ee,null))[_0xc216('0x48')](handleError(_0x20e2ee,null));}; \ No newline at end of file +var _0x7f58=['key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','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','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','get','CmContactHasItems','UserProfileResource','stack','send','index','map','CmContactHasItem','fieldName','type'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0x7f58,0x125));var _0x87f5=function(_0x508911,_0x231622){_0x508911=_0x508911-0x0;var _0x3ce3c0=_0x7f58[_0x508911];return _0x3ce3c0;};'use strict';var emlformat=require(_0x87f5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x87f5('0x1'));var rp=require('request-promise');var moment=require(_0x87f5('0x2'));var BPromise=require(_0x87f5('0x3'));var Mustache=require(_0x87f5('0x4'));var util=require(_0x87f5('0x5'));var path=require(_0x87f5('0x6'));var sox=require(_0x87f5('0x7'));var csv=require(_0x87f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87f5('0x9'));var _=require('lodash');var squel=require(_0x87f5('0xa'));var crypto=require(_0x87f5('0xb'));var jsforce=require(_0x87f5('0xc'));var deskjs=require(_0x87f5('0xd'));var toCsv=require(_0x87f5('0x8'));var querystring=require('querystring');var Papa=require(_0x87f5('0xe'));var Redis=require(_0x87f5('0xf'));var authService=require(_0x87f5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x87f5('0x11'));var hardwareService=require(_0x87f5('0x12'));var logger=require(_0x87f5('0x13'))(_0x87f5('0x14'));var utils=require(_0x87f5('0x15'));var config=require(_0x87f5('0x16'));var licenseUtil=require(_0x87f5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42a10e,_0x2f352d){_0x2f352d=_0x2f352d||0xcc;return function(_0x5623d8){if(_0x5623d8){return _0x42a10e[_0x87f5('0x18')](_0x2f352d);}return _0x42a10e[_0x87f5('0x19')](_0x2f352d)[_0x87f5('0x1a')]();};}function respondWithResult(_0x217620,_0x5367d1){_0x5367d1=_0x5367d1||0xc8;return function(_0x9289b){if(_0x9289b){return _0x217620['status'](_0x5367d1)[_0x87f5('0x1b')](_0x9289b);}};}function respondWithFilteredResult(_0x59329d,_0x157ab9){return function(_0xfa34d1){if(_0xfa34d1){var _0x3c33ee=typeof _0x157ab9[_0x87f5('0x1c')]===_0x87f5('0x1d')&&typeof _0x157ab9['limit']===_0x87f5('0x1d');var _0x3a5356=_0xfa34d1['count'];var _0x17eca6=_0x3c33ee?0x0:_0x157ab9[_0x87f5('0x1c')];var _0x22bbd4=_0x3c33ee?_0xfa34d1['count']:_0x157ab9[_0x87f5('0x1c')]+_0x157ab9[_0x87f5('0x1e')];var _0x4fd796;if(_0x22bbd4>=_0x3a5356){_0x22bbd4=_0x3a5356;_0x4fd796=0xc8;}else{_0x4fd796=0xce;}_0x59329d[_0x87f5('0x19')](_0x4fd796);return _0x59329d[_0x87f5('0x1f')](_0x87f5('0x20'),_0x17eca6+'-'+_0x22bbd4+'/'+_0x3a5356)[_0x87f5('0x1b')](_0xfa34d1);}return null;};}function patchUpdates(_0x3158b9){return function(_0x33c6a6){try{jsonpatch[_0x87f5('0x21')](_0x33c6a6,_0x3158b9,!![]);}catch(_0x4663bf){return BPromise[_0x87f5('0x22')](_0x4663bf);}return _0x33c6a6['save']();};}function saveUpdates(_0x911e26,_0x32b13d){return function(_0x339adf){if(_0x339adf){return _0x339adf['update'](_0x911e26)[_0x87f5('0x23')](function(_0x3fe766){return _0x3fe766;});}return null;};}function removeEntity(_0x242a7d,_0x4d7571){return function(_0x4c34c6){if(_0x4c34c6){return _0x4c34c6[_0x87f5('0x24')]()[_0x87f5('0x23')](function(){var _0x1337b3=_0x4c34c6[_0x87f5('0x25')]({'plain':!![]});var _0x431953=_0x87f5('0x26');return db[_0x87f5('0x27')]['destroy']({'where':{'type':_0x431953,'resourceId':_0x1337b3['id']}})[_0x87f5('0x23')](function(){return _0x4c34c6;});})['then'](function(){_0x242a7d[_0x87f5('0x19')](0xcc)[_0x87f5('0x1a')]();});}};}function handleEntityNotFound(_0x39120c,_0x3f6093){return function(_0x52b262){if(!_0x52b262){_0x39120c['sendStatus'](0x194);}return _0x52b262;};}function handleError(_0x18f841,_0x3dc0fd){_0x3dc0fd=_0x3dc0fd||0x1f4;return function(_0x4d716a){logger['error'](_0x4d716a[_0x87f5('0x28')]);if(_0x4d716a['name']){delete _0x4d716a['name'];}_0x18f841[_0x87f5('0x19')](_0x3dc0fd)[_0x87f5('0x29')](_0x4d716a);};}exports[_0x87f5('0x2a')]=function(_0x246e06,_0x2ffb95){var _0x1b6daa={},_0x210ca3={},_0x40d2c7={'count':0x0,'rows':[]};var _0x16fafc=_[_0x87f5('0x2b')](db[_0x87f5('0x2c')]['rawAttributes'],function(_0x2195c4){return{'name':_0x2195c4[_0x87f5('0x2d')],'type':_0x2195c4[_0x87f5('0x2e')][_0x87f5('0x2f')]};});_0x210ca3[_0x87f5('0x30')]=_[_0x87f5('0x2b')](_0x16fafc,_0x87f5('0x31'));_0x210ca3[_0x87f5('0x32')]=_[_0x87f5('0x33')](_0x246e06['query']);_0x210ca3[_0x87f5('0x34')]=_[_0x87f5('0x35')](_0x210ca3['model'],_0x210ca3[_0x87f5('0x32')]);_0x1b6daa[_0x87f5('0x36')]=_[_0x87f5('0x35')](_0x210ca3[_0x87f5('0x30')],qs[_0x87f5('0x37')](_0x246e06['query'][_0x87f5('0x37')]));_0x1b6daa[_0x87f5('0x36')]=_0x1b6daa[_0x87f5('0x36')]['length']?_0x1b6daa['attributes']:_0x210ca3['model'];if(!_0x246e06['query'][_0x87f5('0x38')]('nolimit')){_0x1b6daa['limit']=qs['limit'](_0x246e06['query'][_0x87f5('0x1e')]);_0x1b6daa[_0x87f5('0x1c')]=qs[_0x87f5('0x1c')](_0x246e06[_0x87f5('0x32')][_0x87f5('0x1c')]);}_0x1b6daa[_0x87f5('0x39')]=qs[_0x87f5('0x3a')](_0x246e06[_0x87f5('0x32')]['sort']);_0x1b6daa[_0x87f5('0x3b')]=qs['filters'](_['pick'](_0x246e06[_0x87f5('0x32')],_0x210ca3['filters']),_0x16fafc);if(_0x246e06[_0x87f5('0x32')][_0x87f5('0x3c')]){_0x1b6daa[_0x87f5('0x3b')]=_['merge'](_0x1b6daa[_0x87f5('0x3b')],{'$or':_[_0x87f5('0x2b')](_0x16fafc,function(_0x4a32f6){if(_0x4a32f6[_0x87f5('0x2e')]!==_0x87f5('0x3d')){var _0xb653dc={};_0xb653dc[_0x4a32f6[_0x87f5('0x31')]]={'$like':'%'+_0x246e06[_0x87f5('0x32')]['filter']+'%'};return _0xb653dc;}})});}_0x1b6daa=_[_0x87f5('0x3e')]({},_0x1b6daa,_0x246e06[_0x87f5('0x3f')]);var _0x3fd8da={'where':_0x1b6daa[_0x87f5('0x3b')]};return db[_0x87f5('0x2c')][_0x87f5('0x40')](_0x3fd8da)[_0x87f5('0x23')](function(_0x40a482){_0x40d2c7[_0x87f5('0x40')]=_0x40a482;if(_0x246e06[_0x87f5('0x32')][_0x87f5('0x41')]){_0x1b6daa[_0x87f5('0x42')]=[{'all':!![]}];}return db[_0x87f5('0x2c')][_0x87f5('0x43')](_0x1b6daa);})[_0x87f5('0x23')](function(_0x2021be){_0x40d2c7[_0x87f5('0x44')]=_0x2021be;return _0x40d2c7;})[_0x87f5('0x23')](respondWithFilteredResult(_0x2ffb95,_0x1b6daa))['catch'](handleError(_0x2ffb95,null));};exports[_0x87f5('0x45')]=function(_0x590756,_0x21dfd4){var _0x39e7ab={'raw':!![],'where':{'id':_0x590756[_0x87f5('0x46')]['id']}},_0x83dfa={};_0x83dfa[_0x87f5('0x30')]=_['keys'](db[_0x87f5('0x2c')][_0x87f5('0x47')]);_0x83dfa[_0x87f5('0x32')]=_[_0x87f5('0x33')](_0x590756[_0x87f5('0x32')]);_0x83dfa[_0x87f5('0x34')]=_['intersection'](_0x83dfa[_0x87f5('0x30')],_0x83dfa['query']);_0x39e7ab['attributes']=_[_0x87f5('0x35')](_0x83dfa[_0x87f5('0x30')],qs[_0x87f5('0x37')](_0x590756[_0x87f5('0x32')][_0x87f5('0x37')]));_0x39e7ab[_0x87f5('0x36')]=_0x39e7ab[_0x87f5('0x36')][_0x87f5('0x48')]?_0x39e7ab[_0x87f5('0x36')]:_0x83dfa['model'];if(_0x590756[_0x87f5('0x32')][_0x87f5('0x41')]){_0x39e7ab[_0x87f5('0x42')]=[{'all':!![]}];}_0x39e7ab=_['merge']({},_0x39e7ab,_0x590756[_0x87f5('0x3f')]);return db[_0x87f5('0x2c')][_0x87f5('0x49')](_0x39e7ab)[_0x87f5('0x23')](handleEntityNotFound(_0x21dfd4,null))[_0x87f5('0x23')](respondWithResult(_0x21dfd4,null))['catch'](handleError(_0x21dfd4,null));};exports[_0x87f5('0x4a')]=function(_0x4929da,_0x2056e8){return db[_0x87f5('0x2c')][_0x87f5('0x4a')](_0x4929da[_0x87f5('0x4b')],{})[_0x87f5('0x23')](function(_0x334765){var _0x17c578=_0x4929da['user'][_0x87f5('0x25')]({'plain':!![]});if(!_0x17c578)throw new Error(_0x87f5('0x4c'));if(_0x17c578[_0x87f5('0x4d')]===_0x87f5('0x4e')){var _0x42a844=_0x334765[_0x87f5('0x25')]({'plain':!![]});var _0x32b70f=_0x87f5('0x26');return db['UserProfileSection'][_0x87f5('0x49')]({'where':{'name':_0x32b70f,'userProfileId':_0x17c578[_0x87f5('0x4f')]},'raw':!![]})[_0x87f5('0x23')](function(_0xadd3e2){if(_0xadd3e2&&_0xadd3e2[_0x87f5('0x50')]===0x0){return db[_0x87f5('0x27')][_0x87f5('0x4a')]({'name':_0x42a844[_0x87f5('0x31')],'resourceId':_0x42a844['id'],'type':_0xadd3e2[_0x87f5('0x31')],'sectionId':_0xadd3e2['id']},{})['then'](function(){return _0x334765;});}else{return _0x334765;}})[_0x87f5('0x51')](function(_0x27a809){logger[_0x87f5('0x52')](_0x87f5('0x53'),_0x27a809);throw _0x27a809;});}return _0x334765;})[_0x87f5('0x23')](respondWithResult(_0x2056e8,0xc9))['catch'](handleError(_0x2056e8,null));};exports[_0x87f5('0x54')]=function(_0xeaf032,_0x1bd57c){if(_0xeaf032[_0x87f5('0x4b')]['id']){delete _0xeaf032[_0x87f5('0x4b')]['id'];}return db[_0x87f5('0x2c')]['find']({'where':{'id':_0xeaf032[_0x87f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bd57c,null))['then'](saveUpdates(_0xeaf032[_0x87f5('0x4b')],null))[_0x87f5('0x23')](respondWithResult(_0x1bd57c,null))[_0x87f5('0x51')](handleError(_0x1bd57c,null));};exports['destroy']=function(_0x3a69cc,_0x24f071){return db[_0x87f5('0x2c')][_0x87f5('0x49')]({'where':{'id':_0x3a69cc[_0x87f5('0x46')]['id']}})[_0x87f5('0x23')](handleEntityNotFound(_0x24f071,null))[_0x87f5('0x23')](removeEntity(_0x24f071,null))[_0x87f5('0x51')](handleError(_0x24f071,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 8e19ceb..7bc6c0a 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 _0x5187=['api','moment','bluebird','path','../../config/environment','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger'];(function(_0x46e5fc,_0x5db9aa){var _0x52f4e6=function(_0x51a00){while(--_0x51a00){_0x46e5fc['push'](_0x46e5fc['shift']());}};_0x52f4e6(++_0x5db9aa);}(_0x5187,0x1c0));var _0x7518=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x5187[_0x5c4e16];return _0x36044a;};'use strict';var _=require(_0x7518('0x0'));var util=require(_0x7518('0x1'));var logger=require(_0x7518('0x2'))(_0x7518('0x3'));var moment=require(_0x7518('0x4'));var BPromise=require(_0x7518('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7518('0x6'));var rimraf=require('rimraf');var config=require(_0x7518('0x7'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x209689,_0xbc909d){return _0x209689[_0x7518('0x8')](_0x7518('0x9'),attributes,{'tableName':_0x7518('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd84=['define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmContactHasItem.attributes','exports'];(function(_0x257579,_0x627180){var _0x1a329d=function(_0x27e1f8){while(--_0x27e1f8){_0x257579['push'](_0x257579['shift']());}};_0x1a329d(++_0x627180);}(_0xbd84,0xd3));var _0x4bd8=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xbd84[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x4bd8('0x0'));var util=require(_0x4bd8('0x1'));var logger=require(_0x4bd8('0x2'))(_0x4bd8('0x3'));var moment=require(_0x4bd8('0x4'));var BPromise=require('bluebird');var rp=require(_0x4bd8('0x5'));var fs=require('fs');var path=require(_0x4bd8('0x6'));var rimraf=require(_0x4bd8('0x7'));var config=require('../../config/environment');var attributes=require(_0x4bd8('0x8'));module[_0x4bd8('0x9')]=function(_0x55ca55,_0x190620){return _0x55ca55[_0x4bd8('0xa')](_0x4bd8('0xb'),attributes,{'tableName':_0x4bd8('0xc'),'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 213095a..9e952be 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 _0x6208=['jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1e772a,_0x5419b6){var _0x282f4d=function(_0x2a21cb){while(--_0x2a21cb){_0x1e772a['push'](_0x1e772a['shift']());}};_0x282f4d(++_0x5419b6);}(_0x6208,0x1ea));var _0x8620=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x6208[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x8620('0x0'));var util=require(_0x8620('0x1'));var moment=require(_0x8620('0x2'));var BPromise=require(_0x8620('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8620('0x4'));var db=require(_0x8620('0x5'))['db'];var utils=require(_0x8620('0x6'));var logger=require(_0x8620('0x7'))(_0x8620('0x8'));var config=require(_0x8620('0x9'));var jayson=require(_0x8620('0xa'));var client=jayson['client'][_0x8620('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17109b,_0xf97b7c,_0x41830c){return new BPromise(function(_0x1b8847,_0x5c5508){return client[_0x8620('0xc')](_0x17109b,_0x41830c)[_0x8620('0xd')](function(_0x346ec2){logger[_0x8620('0xe')](_0x8620('0xf'),_0xf97b7c,_0x8620('0x10'));logger[_0x8620('0x11')](_0x8620('0x12'),_0xf97b7c,_0x8620('0x10'),JSON[_0x8620('0x13')](_0x346ec2));if(_0x346ec2[_0x8620('0x14')]){if(_0x346ec2[_0x8620('0x14')][_0x8620('0x15')]===0x1f4){logger[_0x8620('0x14')](_0x8620('0xf'),_0xf97b7c,_0x346ec2[_0x8620('0x14')][_0x8620('0x16')]);return _0x5c5508(_0x346ec2[_0x8620('0x14')][_0x8620('0x16')]);}logger[_0x8620('0x14')](_0x8620('0xf'),_0xf97b7c,_0x346ec2[_0x8620('0x14')]['message']);return _0x1b8847(_0x346ec2[_0x8620('0x14')][_0x8620('0x16')]);}else{logger[_0x8620('0xe')](_0x8620('0xf'),_0xf97b7c,'request\x20sent');_0x1b8847(_0x346ec2[_0x8620('0x17')]['message']);}})[_0x8620('0x18')](function(_0x5e8f12){logger['error'](_0x8620('0xf'),_0xf97b7c,_0x5e8f12);_0x5c5508(_0x5e8f12);});});} \ No newline at end of file +var _0x3e26=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result'];(function(_0xfa4a79,_0x3fc1f2){var _0x6350eb=function(_0x55dc84){while(--_0x55dc84){_0xfa4a79['push'](_0xfa4a79['shift']());}};_0x6350eb(++_0x3fc1f2);}(_0x3e26,0x65));var _0x63e2=function(_0x14208e,_0x4f015b){_0x14208e=_0x14208e-0x0;var _0x55b4c8=_0x3e26[_0x14208e];return _0x55b4c8;};'use strict';var _=require(_0x63e2('0x0'));var util=require(_0x63e2('0x1'));var moment=require('moment');var BPromise=require(_0x63e2('0x2'));var rs=require(_0x63e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63e2('0x4'))['db'];var utils=require(_0x63e2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x63e2('0x6'));var jayson=require(_0x63e2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48907c,_0x3fec9a,_0x5f2261){return new BPromise(function(_0x1c1cc9,_0x39856e){return client[_0x63e2('0x8')](_0x48907c,_0x5f2261)['then'](function(_0x1cf223){logger[_0x63e2('0x9')]('CmContactHasItem,\x20%s,\x20%s',_0x3fec9a,'request\x20sent');logger[_0x63e2('0xa')](_0x63e2('0xb'),_0x3fec9a,_0x63e2('0xc'),JSON[_0x63e2('0xd')](_0x1cf223));if(_0x1cf223[_0x63e2('0xe')]){if(_0x1cf223['error'][_0x63e2('0xf')]===0x1f4){logger[_0x63e2('0xe')](_0x63e2('0x10'),_0x3fec9a,_0x1cf223['error'][_0x63e2('0x11')]);return _0x39856e(_0x1cf223['error'][_0x63e2('0x11')]);}logger[_0x63e2('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x3fec9a,_0x1cf223['error'][_0x63e2('0x11')]);return _0x1c1cc9(_0x1cf223[_0x63e2('0xe')]['message']);}else{logger[_0x63e2('0x9')](_0x63e2('0x10'),_0x3fec9a,_0x63e2('0xc'));_0x1c1cc9(_0x1cf223[_0x63e2('0x12')][_0x63e2('0x11')]);}})[_0x63e2('0x13')](function(_0x5bc7f4){logger[_0x63e2('0xe')](_0x63e2('0x10'),_0x3fec9a,_0x5bc7f4);_0x39856e(_0x5bc7f4);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index ab6c26b..71e45e0 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 _0xab06=['isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get'];(function(_0x5cc40f,_0xd9a3a9){var _0x28db81=function(_0x1c707f){while(--_0x1c707f){_0x5cc40f['push'](_0x5cc40f['shift']());}};_0x28db81(++_0xd9a3a9);}(_0xab06,0xe5));var _0x6ab0=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0xab06[_0x28611e];return _0x530f69;};'use strict';var multer=require(_0x6ab0('0x0'));var util=require(_0x6ab0('0x1'));var path=require(_0x6ab0('0x2'));var timeout=require(_0x6ab0('0x3'));var express=require(_0x6ab0('0x4'));var router=express[_0x6ab0('0x5')]();var fs_extra=require(_0x6ab0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6ab0('0x7'));var config=require(_0x6ab0('0x8'));var controller=require(_0x6ab0('0x9'));router[_0x6ab0('0xa')]('/',auth[_0x6ab0('0xb')](),controller[_0x6ab0('0xc')]);router['get'](_0x6ab0('0xd'),auth[_0x6ab0('0xb')](),controller[_0x6ab0('0xe')]);router['post']('/',auth[_0x6ab0('0xb')](),controller[_0x6ab0('0xf')]);router[_0x6ab0('0x10')]('/:id',auth[_0x6ab0('0xb')](),controller[_0x6ab0('0x11')]);router[_0x6ab0('0x12')](_0x6ab0('0xd'),auth[_0x6ab0('0xb')](),controller[_0x6ab0('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb4aa=['./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x2e1af3,_0x2a077b){var _0x4150cd=function(_0x1e08f3){while(--_0x1e08f3){_0x2e1af3['push'](_0x2e1af3['shift']());}};_0x4150cd(++_0x2a077b);}(_0xb4aa,0x1db));var _0xab4a=function(_0x24433c,_0x39f91a){_0x24433c=_0x24433c-0x0;var _0x4f43c7=_0xb4aa[_0x24433c];return _0x4f43c7;};'use strict';var multer=require(_0xab4a('0x0'));var util=require(_0xab4a('0x1'));var path=require(_0xab4a('0x2'));var timeout=require(_0xab4a('0x3'));var express=require(_0xab4a('0x4'));var router=express[_0xab4a('0x5')]();var fs_extra=require(_0xab4a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab4a('0x7'));var controller=require(_0xab4a('0x8'));router[_0xab4a('0x9')]('/',auth[_0xab4a('0xa')](),controller[_0xab4a('0xb')]);router[_0xab4a('0x9')](_0xab4a('0xc'),auth[_0xab4a('0xa')](),controller[_0xab4a('0xd')]);router[_0xab4a('0xe')]('/',auth[_0xab4a('0xa')](),controller[_0xab4a('0xf')]);router[_0xab4a('0x10')](_0xab4a('0xc'),auth[_0xab4a('0xa')](),controller[_0xab4a('0x11')]);router[_0xab4a('0x12')]('/:id',auth[_0xab4a('0xa')](),controller[_0xab4a('0x13')]);module[_0xab4a('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index a6dd8d1..9e1d2f3 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 _0x7e9f=['alias','STRING','setDataValue','TEXT','type','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue'];(function(_0x28b31b,_0x53a290){var _0x2a8933=function(_0x55557c){while(--_0x55557c){_0x28b31b['push'](_0x28b31b['shift']());}};_0x2a8933(++_0x53a290);}(_0x7e9f,0x11c));var _0xf7e9=function(_0x5ea850,_0x2f19c4){_0x5ea850=_0x5ea850-0x0;var _0x51acb1=_0x7e9f[_0x5ea850];return _0x51acb1;};'use strict';var Sequelize=require(_0xf7e9('0x0'));var _=require(_0xf7e9('0x1'));module[_0xf7e9('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4625f8){return this[_0xf7e9('0x3')](_0xf7e9('0x4'));}},'alias':{'type':Sequelize[_0xf7e9('0x5')],'allowNull':![],'set':function(_0xc97dca){this[_0xf7e9('0x6')](_0xf7e9('0x4'),_0xc97dca?_0xc97dca:this[_0xf7e9('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xf7e9('0x7')]('long'),'get':function(){if(this[_0xf7e9('0x3')](_0xf7e9('0x8'))==='select'){return JSON[_0xf7e9('0x9')](this[_0xf7e9('0x3')]('values'));}else{return this['getDataValue'](_0xf7e9('0xa'));}},'set':function(_0x568ceb){if(Array[_0xf7e9('0xb')](_0x568ceb)){this['setDataValue'](_0xf7e9('0xa'),JSON[_0xf7e9('0xc')](_0x568ceb));}else{this[_0xf7e9('0x6')](_0xf7e9('0xa'),_0x568ceb);}}},'required':{'type':Sequelize[_0xf7e9('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf7e9('0xe')](_0xf7e9('0xf'))}}; \ No newline at end of file +var _0x9210=['alias','STRING','setDataValue','getDataValue','name','select','parse','values','isArray','stringify','BOOLEAN','lodash','exports','VIRTUAL'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x9210,0x123));var _0x0921=function(_0x5e2302,_0x82c61b){_0x5e2302=_0x5e2302-0x0;var _0x595cc1=_0x9210[_0x5e2302];return _0x595cc1;};'use strict';var Sequelize=require('sequelize');var _=require(_0x0921('0x0'));module[_0x0921('0x1')]={'name':{'type':Sequelize[_0x0921('0x2')],'get':function(_0x365319){return this['getDataValue'](_0x0921('0x3'));}},'alias':{'type':Sequelize[_0x0921('0x4')],'allowNull':![],'set':function(_0x4192c0){this[_0x0921('0x5')](_0x0921('0x3'),_0x4192c0?_0x4192c0:this[_0x0921('0x6')](_0x0921('0x7')));}},'type':{'type':Sequelize[_0x0921('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x0921('0x6')]('type')===_0x0921('0x8')){return JSON[_0x0921('0x9')](this[_0x0921('0x6')](_0x0921('0xa')));}else{return this[_0x0921('0x6')](_0x0921('0xa'));}},'set':function(_0x460bb1){if(Array[_0x0921('0xb')](_0x460bb1)){this[_0x0921('0x5')]('values',JSON[_0x0921('0xc')](_0x460bb1));}else{this[_0x0921('0x5')](_0x0921('0xa'),_0x460bb1);}}},'required':{'type':Sequelize[_0x0921('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0921('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 680a71b..ab45867 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 _0xd248=['switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','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/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','body','Sequelize','TEXT','text','number','INTEGER'];(function(_0x42c5fa,_0x308358){var _0x1086af=function(_0x5950da){while(--_0x5950da){_0x42c5fa['push'](_0x42c5fa['shift']());}};_0x1086af(++_0x308358);}(_0xd248,0x16c));var _0x8d24=function(_0x14dc8a,_0x4fe14d){_0x14dc8a=_0x14dc8a-0x0;var _0xc2be12=_0xd248[_0x14dc8a];return _0xc2be12;};'use strict';var emlformat=require(_0x8d24('0x0'));var rimraf=require(_0x8d24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d24('0x2'));var rp=require('request-promise');var moment=require(_0x8d24('0x3'));var BPromise=require(_0x8d24('0x4'));var Mustache=require(_0x8d24('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8d24('0x6'));var csv=require('to-csv');var ejs=require(_0x8d24('0x7'));var fs=require('fs');var fs_extra=require(_0x8d24('0x8'));var _=require(_0x8d24('0x9'));var squel=require(_0x8d24('0xa'));var crypto=require(_0x8d24('0xb'));var jsforce=require(_0x8d24('0xc'));var deskjs=require(_0x8d24('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8d24('0xe'));var authService=require(_0x8d24('0xf'));var qs=require(_0x8d24('0x10'));var as=require(_0x8d24('0x11'));var hardwareService=require(_0x8d24('0x12'));var logger=require(_0x8d24('0x13'))(_0x8d24('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d24('0x15'));var db=require(_0x8d24('0x16'))['db'];function respondWithStatusCode(_0x4e98af,_0xd6c2e3){_0xd6c2e3=_0xd6c2e3||0xcc;return function(_0x23e90e){if(_0x23e90e){return _0x4e98af[_0x8d24('0x17')](_0xd6c2e3);}return _0x4e98af[_0x8d24('0x18')](_0xd6c2e3)[_0x8d24('0x19')]();};}function respondWithResult(_0xd76265,_0x526ff8){_0x526ff8=_0x526ff8||0xc8;return function(_0xead351){if(_0xead351){return _0xd76265[_0x8d24('0x18')](_0x526ff8)['json'](_0xead351);}};}function respondWithFilteredResult(_0x59c0a8,_0x4bf581){return function(_0x30d607){if(_0x30d607){var _0x46077a=typeof _0x4bf581[_0x8d24('0x1a')]===_0x8d24('0x1b')&&typeof _0x4bf581[_0x8d24('0x1c')]===_0x8d24('0x1b');var _0x389da3=_0x30d607['count'];var _0x3fe764=_0x46077a?0x0:_0x4bf581[_0x8d24('0x1a')];var _0x3d94e2=_0x46077a?_0x30d607[_0x8d24('0x1d')]:_0x4bf581['offset']+_0x4bf581[_0x8d24('0x1c')];var _0x9aa993;if(_0x3d94e2>=_0x389da3){_0x3d94e2=_0x389da3;_0x9aa993=0xc8;}else{_0x9aa993=0xce;}_0x59c0a8['status'](_0x9aa993);return _0x59c0a8[_0x8d24('0x1e')](_0x8d24('0x1f'),_0x3fe764+'-'+_0x3d94e2+'/'+_0x389da3)['json'](_0x30d607);}return null;};}function patchUpdates(_0x1a6b5a){return function(_0x35fdca){try{jsonpatch[_0x8d24('0x20')](_0x35fdca,_0x1a6b5a,!![]);}catch(_0x45958b){return BPromise[_0x8d24('0x21')](_0x45958b);}return _0x35fdca[_0x8d24('0x22')]();};}function saveUpdates(_0x4188aa,_0x57a0ce){return function(_0x56f470){if(_0x56f470){return _0x56f470[_0x8d24('0x23')](_0x4188aa)['then'](function(_0x4be451){return _0x4be451;});}return null;};}function removeEntity(_0xd690de,_0x5cccc2){return function(_0xfe2a64){if(_0xfe2a64){return _0xfe2a64[_0x8d24('0x24')]()[_0x8d24('0x25')](function(){_0xd690de[_0x8d24('0x18')](0xcc)[_0x8d24('0x19')]();});}};}function handleEntityNotFound(_0xecbef1,_0x38842e){return function(_0x193029){if(!_0x193029){_0xecbef1['sendStatus'](0x194);}return _0x193029;};}function handleError(_0x45fa81,_0x25d2ba){_0x25d2ba=_0x25d2ba||0x1f4;return function(_0x541420){logger[_0x8d24('0x26')](_0x541420[_0x8d24('0x27')]);if(_0x541420['name']){delete _0x541420[_0x8d24('0x28')];}_0x45fa81[_0x8d24('0x18')](_0x25d2ba)[_0x8d24('0x29')](_0x541420);};}exports[_0x8d24('0x2a')]=function(_0x2060fa,_0x41a3f5){var _0x56d1a7={},_0x21f38f={},_0xc8a823={'count':0x0,'rows':[]};var _0x16e123=_[_0x8d24('0x2b')](db[_0x8d24('0x2c')][_0x8d24('0x2d')],function(_0x3c7dcc){return{'name':_0x3c7dcc['fieldName'],'type':_0x3c7dcc['type'][_0x8d24('0x2e')]};});_0x21f38f[_0x8d24('0x2f')]=_[_0x8d24('0x30')](_[_0x8d24('0x2b')](_0x16e123,_0x8d24('0x28')),['name']);_0x21f38f[_0x8d24('0x31')]=_['keys'](_0x2060fa[_0x8d24('0x31')]);_0x21f38f[_0x8d24('0x32')]=_[_0x8d24('0x33')](_0x21f38f[_0x8d24('0x2f')],_0x21f38f['query']);_0x56d1a7[_0x8d24('0x34')]=_[_0x8d24('0x33')](_0x21f38f[_0x8d24('0x2f')],qs[_0x8d24('0x35')](_0x2060fa[_0x8d24('0x31')][_0x8d24('0x35')]));_0x56d1a7[_0x8d24('0x34')]=_0x56d1a7[_0x8d24('0x34')][_0x8d24('0x36')]?_0x56d1a7[_0x8d24('0x34')]:_0x21f38f[_0x8d24('0x2f')];if(!_0x2060fa['query'][_0x8d24('0x37')](_0x8d24('0x38'))){_0x56d1a7['limit']=qs['limit'](_0x2060fa[_0x8d24('0x31')][_0x8d24('0x1c')]);_0x56d1a7['offset']=qs[_0x8d24('0x1a')](_0x2060fa[_0x8d24('0x31')]['offset']);}_0x56d1a7[_0x8d24('0x39')]=qs[_0x8d24('0x3a')](_0x2060fa[_0x8d24('0x31')][_0x8d24('0x3a')]);_0x56d1a7[_0x8d24('0x3b')]=qs[_0x8d24('0x32')](_[_0x8d24('0x3c')](_0x2060fa['query'],_0x21f38f[_0x8d24('0x32')]),_0x16e123);if(_0x2060fa[_0x8d24('0x31')][_0x8d24('0x3d')]){_0x56d1a7[_0x8d24('0x3b')]=_[_0x8d24('0x3e')](_0x56d1a7[_0x8d24('0x3b')],{'$or':_['map'](_0x16e123,function(_0x3c59b7){if(_0x3c59b7[_0x8d24('0x3f')]!==_0x8d24('0x40')){var _0x4cb96f={};_0x4cb96f[_0x3c59b7[_0x8d24('0x28')]]={'$like':'%'+_0x2060fa[_0x8d24('0x31')][_0x8d24('0x3d')]+'%'};return _0x4cb96f;}})});}_0x56d1a7=_[_0x8d24('0x3e')]({},_0x56d1a7,_0x2060fa['options']);var _0x256246={'where':_0x56d1a7[_0x8d24('0x3b')]};return db[_0x8d24('0x2c')][_0x8d24('0x1d')](_0x256246)[_0x8d24('0x25')](function(_0x5b1b9b){_0xc8a823['count']=_0x5b1b9b;if(_0x2060fa['query'][_0x8d24('0x41')]){_0x56d1a7[_0x8d24('0x42')]=[{'all':!![]}];}return db[_0x8d24('0x2c')][_0x8d24('0x43')](_0x56d1a7);})['then'](function(_0x3569bf){_0xc8a823[_0x8d24('0x44')]=_0x3569bf;return _0xc8a823;})[_0x8d24('0x25')](respondWithFilteredResult(_0x41a3f5,_0x56d1a7))[_0x8d24('0x45')](handleError(_0x41a3f5,null));};exports[_0x8d24('0x46')]=function(_0x18c268,_0x324ce9){var _0x5c33de={'raw':!![],'where':{'id':_0x18c268[_0x8d24('0x47')]['id']}},_0x64cadb={};_0x64cadb['model']=_[_0x8d24('0x48')](db[_0x8d24('0x2c')][_0x8d24('0x2d')]);_0x64cadb['query']=_[_0x8d24('0x48')](_0x18c268[_0x8d24('0x31')]);_0x64cadb[_0x8d24('0x32')]=_[_0x8d24('0x33')](_0x64cadb[_0x8d24('0x2f')],_0x64cadb[_0x8d24('0x31')]);_0x5c33de[_0x8d24('0x34')]=_['intersection'](_0x64cadb['model'],qs[_0x8d24('0x35')](_0x18c268[_0x8d24('0x31')][_0x8d24('0x35')]));_0x5c33de[_0x8d24('0x34')]=_0x5c33de[_0x8d24('0x34')][_0x8d24('0x36')]?_0x5c33de[_0x8d24('0x34')]:_0x64cadb[_0x8d24('0x2f')];if(_0x18c268['query'][_0x8d24('0x41')]){_0x5c33de[_0x8d24('0x42')]=[{'all':!![]}];}_0x5c33de=_['merge']({},_0x5c33de,_0x18c268[_0x8d24('0x49')]);return db['CmCustomField'][_0x8d24('0x4a')](_0x5c33de)[_0x8d24('0x25')](handleEntityNotFound(_0x324ce9,null))[_0x8d24('0x25')](respondWithResult(_0x324ce9,null))[_0x8d24('0x45')](handleError(_0x324ce9,null));};exports[_0x8d24('0x23')]=function(_0xa428ee,_0x5a88e9){if(_0xa428ee['body']['id']){delete _0xa428ee[_0x8d24('0x4b')]['id'];}return db['CmCustomField'][_0x8d24('0x4a')]({'where':{'id':_0xa428ee[_0x8d24('0x47')]['id']}})[_0x8d24('0x25')](handleEntityNotFound(_0x5a88e9,null))[_0x8d24('0x25')](saveUpdates(_0xa428ee['body'],null))[_0x8d24('0x25')](respondWithResult(_0x5a88e9,null))[_0x8d24('0x45')](handleError(_0x5a88e9,null));};exports[_0x8d24('0x24')]=function(_0x47e091,_0x86e8df){return db[_0x8d24('0x2c')]['find']({'where':{'id':_0x47e091['params']['id']}})[_0x8d24('0x25')](handleEntityNotFound(_0x86e8df,null))[_0x8d24('0x25')](removeEntity(_0x86e8df,null))[_0x8d24('0x45')](handleError(_0x86e8df,null));};exports['create']=function(_0x223230,_0x1bf7d3){var _0x355141;return db['sequelize']['transaction'](function(_0x2c2a40){return db[_0x8d24('0x2c')]['create'](_0x223230[_0x8d24('0x4b')],{'transaction':_0x2c2a40})[_0x8d24('0x25')](function(_0x3ca080){_0x355141=_0x3ca080;var _0x2678ae={'type':db[_0x8d24('0x4c')][_0x8d24('0x4d')],'transaction':_0x2c2a40};switch(_0x223230[_0x8d24('0x4b')][_0x8d24('0x3f')]){case _0x8d24('0x4e'):_0x2678ae[_0x8d24('0x3f')]=db['Sequelize'][_0x8d24('0x4d')];break;case _0x8d24('0x4f'):_0x2678ae[_0x8d24('0x3f')]=db['Sequelize'][_0x8d24('0x50')];break;case _0x8d24('0x51'):_0x2678ae[_0x8d24('0x3f')]=db['Sequelize'][_0x8d24('0x52')];_0x2678ae[_0x8d24('0x53')]=![];break;default:}return db[_0x8d24('0x54')][_0x8d24('0x55')][_0x8d24('0x56')](_0x8d24('0x57'),util[_0x8d24('0x58')]('cf_%d',_0x355141['id']),_0x2678ae);})[_0x8d24('0x25')](function(){return _0x355141;});})[_0x8d24('0x25')](respondWithResult(_0x1bf7d3,0xc9))[_0x8d24('0x45')](handleError(_0x1bf7d3,null));}; \ No newline at end of file +var _0xb4c4=['BOOLEAN','defaultValue','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','then','end','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','destroy','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER'];(function(_0x42cf6b,_0x18de6e){var _0x18aacf=function(_0x1d6193){while(--_0x1d6193){_0x42cf6b['push'](_0x42cf6b['shift']());}};_0x18aacf(++_0x18de6e);}(_0xb4c4,0x147));var _0x4b4c=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xb4c4[_0x3bd52b];return _0x1e5b89;};'use strict';var emlformat=require(_0x4b4c('0x0'));var rimraf=require(_0x4b4c('0x1'));var zipdir=require(_0x4b4c('0x2'));var jsonpatch=require(_0x4b4c('0x3'));var rp=require(_0x4b4c('0x4'));var moment=require('moment');var BPromise=require(_0x4b4c('0x5'));var Mustache=require(_0x4b4c('0x6'));var util=require(_0x4b4c('0x7'));var path=require('path');var sox=require(_0x4b4c('0x8'));var csv=require(_0x4b4c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b4c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4b4c('0xb'));var jsforce=require(_0x4b4c('0xc'));var deskjs=require(_0x4b4c('0xd'));var toCsv=require(_0x4b4c('0x9'));var querystring=require('querystring');var Papa=require(_0x4b4c('0xe'));var Redis=require(_0x4b4c('0xf'));var authService=require(_0x4b4c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4b4c('0x11'));var hardwareService=require(_0x4b4c('0x12'));var logger=require(_0x4b4c('0x13'))(_0x4b4c('0x14'));var utils=require(_0x4b4c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b4c('0x16'))['db'];function respondWithStatusCode(_0x86f4ee,_0x3787ed){_0x3787ed=_0x3787ed||0xcc;return function(_0x2d1db4){if(_0x2d1db4){return _0x86f4ee[_0x4b4c('0x17')](_0x3787ed);}return _0x86f4ee['status'](_0x3787ed)['end']();};}function respondWithResult(_0x2692c9,_0x109052){_0x109052=_0x109052||0xc8;return function(_0x8837cc){if(_0x8837cc){return _0x2692c9[_0x4b4c('0x18')](_0x109052)[_0x4b4c('0x19')](_0x8837cc);}};}function respondWithFilteredResult(_0xcd160a,_0x4c05aa){return function(_0x45a1e0){if(_0x45a1e0){var _0x422b4f=typeof _0x4c05aa[_0x4b4c('0x1a')]===_0x4b4c('0x1b')&&typeof _0x4c05aa[_0x4b4c('0x1c')]===_0x4b4c('0x1b');var _0x51421d=_0x45a1e0['count'];var _0x2c0c1d=_0x422b4f?0x0:_0x4c05aa[_0x4b4c('0x1a')];var _0xaf1b19=_0x422b4f?_0x45a1e0[_0x4b4c('0x1d')]:_0x4c05aa[_0x4b4c('0x1a')]+_0x4c05aa[_0x4b4c('0x1c')];var _0x399d8c;if(_0xaf1b19>=_0x51421d){_0xaf1b19=_0x51421d;_0x399d8c=0xc8;}else{_0x399d8c=0xce;}_0xcd160a[_0x4b4c('0x18')](_0x399d8c);return _0xcd160a['set']('Content-Range',_0x2c0c1d+'-'+_0xaf1b19+'/'+_0x51421d)[_0x4b4c('0x19')](_0x45a1e0);}return null;};}function patchUpdates(_0x25140e){return function(_0x22ce3e){try{jsonpatch[_0x4b4c('0x1e')](_0x22ce3e,_0x25140e,!![]);}catch(_0x2e457a){return BPromise[_0x4b4c('0x1f')](_0x2e457a);}return _0x22ce3e['save']();};}function saveUpdates(_0x34b0ab,_0xbd397){return function(_0xedc99a){if(_0xedc99a){return _0xedc99a['update'](_0x34b0ab)[_0x4b4c('0x20')](function(_0x2a71cf){return _0x2a71cf;});}return null;};}function removeEntity(_0x2762ac,_0x5f5736){return function(_0x23d0d3){if(_0x23d0d3){return _0x23d0d3['destroy']()['then'](function(){_0x2762ac[_0x4b4c('0x18')](0xcc)[_0x4b4c('0x21')]();});}};}function handleEntityNotFound(_0x5cbe9d,_0x3245c2){return function(_0x19aa3a){if(!_0x19aa3a){_0x5cbe9d['sendStatus'](0x194);}return _0x19aa3a;};}function handleError(_0x21a9b0,_0x4c39db){_0x4c39db=_0x4c39db||0x1f4;return function(_0x9b417){logger[_0x4b4c('0x22')](_0x9b417[_0x4b4c('0x23')]);if(_0x9b417[_0x4b4c('0x24')]){delete _0x9b417[_0x4b4c('0x24')];}_0x21a9b0[_0x4b4c('0x18')](_0x4c39db)['send'](_0x9b417);};}exports[_0x4b4c('0x25')]=function(_0x23acef,_0x50075f){var _0x234c7d={},_0x3fb291={},_0x333b6b={'count':0x0,'rows':[]};var _0x4dfac9=_[_0x4b4c('0x26')](db[_0x4b4c('0x27')][_0x4b4c('0x28')],function(_0x1dc19d){return{'name':_0x1dc19d[_0x4b4c('0x29')],'type':_0x1dc19d['type'][_0x4b4c('0x2a')]};});_0x3fb291[_0x4b4c('0x2b')]=_['differenceBy'](_[_0x4b4c('0x26')](_0x4dfac9,'name'),[_0x4b4c('0x24')]);_0x3fb291[_0x4b4c('0x2c')]=_[_0x4b4c('0x2d')](_0x23acef[_0x4b4c('0x2c')]);_0x3fb291[_0x4b4c('0x2e')]=_['intersection'](_0x3fb291[_0x4b4c('0x2b')],_0x3fb291[_0x4b4c('0x2c')]);_0x234c7d['attributes']=_[_0x4b4c('0x2f')](_0x3fb291['model'],qs['fields'](_0x23acef['query'][_0x4b4c('0x30')]));_0x234c7d[_0x4b4c('0x31')]=_0x234c7d[_0x4b4c('0x31')][_0x4b4c('0x32')]?_0x234c7d[_0x4b4c('0x31')]:_0x3fb291[_0x4b4c('0x2b')];if(!_0x23acef[_0x4b4c('0x2c')][_0x4b4c('0x33')](_0x4b4c('0x34'))){_0x234c7d['limit']=qs[_0x4b4c('0x1c')](_0x23acef[_0x4b4c('0x2c')][_0x4b4c('0x1c')]);_0x234c7d[_0x4b4c('0x1a')]=qs[_0x4b4c('0x1a')](_0x23acef[_0x4b4c('0x2c')][_0x4b4c('0x1a')]);}_0x234c7d['order']=qs['sort'](_0x23acef[_0x4b4c('0x2c')]['sort']);_0x234c7d[_0x4b4c('0x35')]=qs[_0x4b4c('0x2e')](_[_0x4b4c('0x36')](_0x23acef['query'],_0x3fb291[_0x4b4c('0x2e')]),_0x4dfac9);if(_0x23acef['query'][_0x4b4c('0x37')]){_0x234c7d[_0x4b4c('0x35')]=_[_0x4b4c('0x38')](_0x234c7d['where'],{'$or':_[_0x4b4c('0x26')](_0x4dfac9,function(_0x3e9bdf){if(_0x3e9bdf[_0x4b4c('0x39')]!=='VIRTUAL'){var _0xc42aff={};_0xc42aff[_0x3e9bdf[_0x4b4c('0x24')]]={'$like':'%'+_0x23acef['query'][_0x4b4c('0x37')]+'%'};return _0xc42aff;}})});}_0x234c7d=_[_0x4b4c('0x38')]({},_0x234c7d,_0x23acef[_0x4b4c('0x3a')]);var _0x58b070={'where':_0x234c7d[_0x4b4c('0x35')]};return db[_0x4b4c('0x27')][_0x4b4c('0x1d')](_0x58b070)[_0x4b4c('0x20')](function(_0x27062d){_0x333b6b[_0x4b4c('0x1d')]=_0x27062d;if(_0x23acef[_0x4b4c('0x2c')][_0x4b4c('0x3b')]){_0x234c7d[_0x4b4c('0x3c')]=[{'all':!![]}];}return db[_0x4b4c('0x27')][_0x4b4c('0x3d')](_0x234c7d);})['then'](function(_0x54811e){_0x333b6b[_0x4b4c('0x3e')]=_0x54811e;return _0x333b6b;})['then'](respondWithFilteredResult(_0x50075f,_0x234c7d))[_0x4b4c('0x3f')](handleError(_0x50075f,null));};exports[_0x4b4c('0x40')]=function(_0x121c76,_0x2748a7){var _0x3cd229={'raw':!![],'where':{'id':_0x121c76[_0x4b4c('0x41')]['id']}},_0x229415={};_0x229415[_0x4b4c('0x2b')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x229415[_0x4b4c('0x2c')]=_[_0x4b4c('0x2d')](_0x121c76[_0x4b4c('0x2c')]);_0x229415[_0x4b4c('0x2e')]=_['intersection'](_0x229415['model'],_0x229415[_0x4b4c('0x2c')]);_0x3cd229[_0x4b4c('0x31')]=_[_0x4b4c('0x2f')](_0x229415[_0x4b4c('0x2b')],qs[_0x4b4c('0x30')](_0x121c76[_0x4b4c('0x2c')]['fields']));_0x3cd229[_0x4b4c('0x31')]=_0x3cd229[_0x4b4c('0x31')]['length']?_0x3cd229['attributes']:_0x229415[_0x4b4c('0x2b')];if(_0x121c76['query'][_0x4b4c('0x3b')]){_0x3cd229['include']=[{'all':!![]}];}_0x3cd229=_[_0x4b4c('0x38')]({},_0x3cd229,_0x121c76[_0x4b4c('0x3a')]);return db[_0x4b4c('0x27')][_0x4b4c('0x42')](_0x3cd229)[_0x4b4c('0x20')](handleEntityNotFound(_0x2748a7,null))[_0x4b4c('0x20')](respondWithResult(_0x2748a7,null))[_0x4b4c('0x3f')](handleError(_0x2748a7,null));};exports[_0x4b4c('0x43')]=function(_0x20abb1,_0x189af4){if(_0x20abb1['body']['id']){delete _0x20abb1[_0x4b4c('0x44')]['id'];}return db[_0x4b4c('0x27')][_0x4b4c('0x42')]({'where':{'id':_0x20abb1[_0x4b4c('0x41')]['id']}})[_0x4b4c('0x20')](handleEntityNotFound(_0x189af4,null))[_0x4b4c('0x20')](saveUpdates(_0x20abb1[_0x4b4c('0x44')],null))[_0x4b4c('0x20')](respondWithResult(_0x189af4,null))['catch'](handleError(_0x189af4,null));};exports[_0x4b4c('0x45')]=function(_0x40e25f,_0x4585bc){return db[_0x4b4c('0x27')]['find']({'where':{'id':_0x40e25f[_0x4b4c('0x41')]['id']}})[_0x4b4c('0x20')](handleEntityNotFound(_0x4585bc,null))[_0x4b4c('0x20')](removeEntity(_0x4585bc,null))[_0x4b4c('0x3f')](handleError(_0x4585bc,null));};exports[_0x4b4c('0x46')]=function(_0x4c7632,_0x5447b6){var _0x4e9f30;return db[_0x4b4c('0x47')][_0x4b4c('0x48')](function(_0x1869a2){return db[_0x4b4c('0x27')][_0x4b4c('0x46')](_0x4c7632['body'],{'transaction':_0x1869a2})[_0x4b4c('0x20')](function(_0x276386){_0x4e9f30=_0x276386;var _0x46bc1f={'type':db[_0x4b4c('0x49')][_0x4b4c('0x4a')],'transaction':_0x1869a2};switch(_0x4c7632[_0x4b4c('0x44')]['type']){case _0x4b4c('0x4b'):_0x46bc1f[_0x4b4c('0x39')]=db[_0x4b4c('0x49')]['TEXT'];break;case _0x4b4c('0x4c'):_0x46bc1f[_0x4b4c('0x39')]=db[_0x4b4c('0x49')][_0x4b4c('0x4d')];break;case'switch':_0x46bc1f[_0x4b4c('0x39')]=db['Sequelize'][_0x4b4c('0x4e')];_0x46bc1f[_0x4b4c('0x4f')]=![];break;default:}return db[_0x4b4c('0x47')]['queryInterface']['addColumn'](_0x4b4c('0x50'),util['format']('cf_%d',_0x4e9f30['id']),_0x46bc1f);})['then'](function(){return _0x4e9f30;});})[_0x4b4c('0x20')](respondWithResult(_0x5447b6,0xc9))['catch'](handleError(_0x5447b6,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d03bda7..8f9a73c 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 _0x90b7=['exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x90b7,0x1e4));var _0x790b=function(_0xaf1a2f,_0xffd315){_0xaf1a2f=_0xaf1a2f-0x0;var _0x4fbe51=_0x90b7[_0xaf1a2f];return _0x4fbe51;};'use strict';var _=require(_0x790b('0x0'));var util=require(_0x790b('0x1'));var logger=require(_0x790b('0x2'))(_0x790b('0x3'));var moment=require(_0x790b('0x4'));var BPromise=require(_0x790b('0x5'));var rp=require(_0x790b('0x6'));var fs=require('fs');var path=require(_0x790b('0x7'));var rimraf=require(_0x790b('0x8'));var config=require(_0x790b('0x9'));var attributes=require(_0x790b('0xa'));module[_0x790b('0xb')]=function(_0x58a4b0,_0xbe13ef){return _0x58a4b0[_0x790b('0xc')](_0x790b('0xd'),attributes,{'tableName':_0x790b('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb977=['api','moment','request-promise','rimraf','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x1c0b7c,_0x29c88b){var _0x113efd=function(_0x38efba){while(--_0x38efba){_0x1c0b7c['push'](_0x1c0b7c['shift']());}};_0x113efd(++_0x29c88b);}(_0xb977,0x11b));var _0x7b97=function(_0x5c414d,_0xba6280){_0x5c414d=_0x5c414d-0x0;var _0xf7095a=_0xb977[_0x5c414d];return _0xf7095a;};'use strict';var _=require(_0x7b97('0x0'));var util=require(_0x7b97('0x1'));var logger=require(_0x7b97('0x2'))(_0x7b97('0x3'));var moment=require(_0x7b97('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b97('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b97('0x6'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x7b97('0x7')]=function(_0x46c8c9,_0x29133a){return _0x46c8c9[_0x7b97('0x8')](_0x7b97('0x9'),attributes,{'tableName':_0x7b97('0xa'),'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 b6ae18b..3a1db56 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 _0xf5a6=['then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf5a6,0x7f));var _0x6f5a=function(_0x3eb0d2,_0x2e33e9){_0x3eb0d2=_0x3eb0d2-0x0;var _0x492ef2=_0xf5a6[_0x3eb0d2];return _0x492ef2;};'use strict';var _=require(_0x6f5a('0x0'));var util=require(_0x6f5a('0x1'));var moment=require('moment');var BPromise=require(_0x6f5a('0x2'));var rs=require(_0x6f5a('0x3'));var fs=require('fs');var Redis=require(_0x6f5a('0x4'));var db=require(_0x6f5a('0x5'))['db'];var utils=require(_0x6f5a('0x6'));var logger=require('../../config/logger')(_0x6f5a('0x7'));var config=require(_0x6f5a('0x8'));var jayson=require(_0x6f5a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1e88,_0x38ea6c,_0x576a6c){return new BPromise(function(_0x52e279,_0x55a736){return client[_0x6f5a('0xa')](_0x4c1e88,_0x576a6c)[_0x6f5a('0xb')](function(_0x1e790c){logger['info'](_0x6f5a('0xc'),_0x38ea6c,'request\x20sent');logger[_0x6f5a('0xd')](_0x6f5a('0xe'),_0x38ea6c,_0x6f5a('0xf'),JSON[_0x6f5a('0x10')](_0x1e790c));if(_0x1e790c[_0x6f5a('0x11')]){if(_0x1e790c[_0x6f5a('0x11')][_0x6f5a('0x12')]===0x1f4){logger[_0x6f5a('0x11')](_0x6f5a('0xc'),_0x38ea6c,_0x1e790c[_0x6f5a('0x11')][_0x6f5a('0x13')]);return _0x55a736(_0x1e790c['error'][_0x6f5a('0x13')]);}logger['error'](_0x6f5a('0xc'),_0x38ea6c,_0x1e790c[_0x6f5a('0x11')]['message']);return _0x52e279(_0x1e790c[_0x6f5a('0x11')]['message']);}else{logger[_0x6f5a('0x14')](_0x6f5a('0xc'),_0x38ea6c,_0x6f5a('0xf'));_0x52e279(_0x1e790c[_0x6f5a('0x15')]['message']);}})[_0x6f5a('0x16')](function(_0x4da361){logger['error'](_0x6f5a('0xc'),_0x38ea6c,_0x4da361);_0x55a736(_0x4da361);});});} \ No newline at end of file +var _0x77de=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x526d66,_0x2b2036){var _0x2527ea=function(_0x37bbad){while(--_0x37bbad){_0x526d66['push'](_0x526d66['shift']());}};_0x2527ea(++_0x2b2036);}(_0x77de,0x1d0));var _0xe77d=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x77de[_0x3cf5a3];return _0x39ba2d;};'use strict';var _=require(_0xe77d('0x0'));var util=require(_0xe77d('0x1'));var moment=require(_0xe77d('0x2'));var BPromise=require(_0xe77d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe77d('0x4'));var db=require(_0xe77d('0x5'))['db'];var utils=require(_0xe77d('0x6'));var logger=require(_0xe77d('0x7'))(_0xe77d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe77d('0x9')][_0xe77d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528337,_0x9d4d28,_0x252918){return new BPromise(function(_0xcc5d1f,_0x42be92){return client[_0xe77d('0xb')](_0x528337,_0x252918)[_0xe77d('0xc')](function(_0x52e21d){logger[_0xe77d('0xd')](_0xe77d('0xe'),_0x9d4d28,_0xe77d('0xf'));logger[_0xe77d('0x10')](_0xe77d('0x11'),_0x9d4d28,_0xe77d('0xf'),JSON[_0xe77d('0x12')](_0x52e21d));if(_0x52e21d['error']){if(_0x52e21d['error']['code']===0x1f4){logger['error'](_0xe77d('0xe'),_0x9d4d28,_0x52e21d[_0xe77d('0x13')][_0xe77d('0x14')]);return _0x42be92(_0x52e21d[_0xe77d('0x13')][_0xe77d('0x14')]);}logger[_0xe77d('0x13')](_0xe77d('0xe'),_0x9d4d28,_0x52e21d[_0xe77d('0x13')][_0xe77d('0x14')]);return _0xcc5d1f(_0x52e21d['error']['message']);}else{logger[_0xe77d('0xd')]('CmCustomField,\x20%s,\x20%s',_0x9d4d28,_0xe77d('0xf'));_0xcc5d1f(_0x52e21d[_0xe77d('0x15')]['message']);}})[_0xe77d('0x16')](function(_0x4665e6){logger[_0xe77d('0x13')](_0xe77d('0xe'),_0x9d4d28,_0x4665e6);_0x42be92(_0x4665e6);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index ab232ad..2720743 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 _0xd072=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show'];(function(_0x2e4fd9,_0xd04a69){var _0x2aa740=function(_0x461b1c){while(--_0x461b1c){_0x2e4fd9['push'](_0x2e4fd9['shift']());}};_0x2aa740(++_0xd04a69);}(_0xd072,0x132));var _0x2d07=function(_0x12be8c,_0x4febf3){_0x12be8c=_0x12be8c-0x0;var _0x21291c=_0xd072[_0x12be8c];return _0x21291c;};'use strict';var multer=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var path=require(_0x2d07('0x2'));var timeout=require(_0x2d07('0x3'));var express=require(_0x2d07('0x4'));var router=express[_0x2d07('0x5')]();var fs_extra=require(_0x2d07('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2d07('0x7'));var config=require(_0x2d07('0x8'));var controller=require(_0x2d07('0x9'));router[_0x2d07('0xa')]('/',auth[_0x2d07('0xb')](),controller['index']);router[_0x2d07('0xa')](_0x2d07('0xc'),auth[_0x2d07('0xb')](),controller[_0x2d07('0xd')]);router[_0x2d07('0xe')]('/',auth[_0x2d07('0xb')](),controller[_0x2d07('0xf')]);router['put'](_0x2d07('0xc'),auth[_0x2d07('0xb')](),controller[_0x2d07('0x10')]);router[_0x2d07('0x11')](_0x2d07('0xc'),auth[_0x2d07('0xb')](),controller[_0x2d07('0x12')]);module[_0x2d07('0x13')]=router; \ No newline at end of file +var _0x1782=['../../components/interaction/service','./cmCustomField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','util','path','Router','../../components/auth/service'];(function(_0x44cce7,_0x542e50){var _0x5f1a56=function(_0x584ac2){while(--_0x584ac2){_0x44cce7['push'](_0x44cce7['shift']());}};_0x5f1a56(++_0x542e50);}(_0x1782,0x188));var _0x2178=function(_0x23e36d,_0x502fe1){_0x23e36d=_0x23e36d-0x0;var _0x639868=_0x1782[_0x23e36d];return _0x639868;};'use strict';var multer=require('multer');var util=require(_0x2178('0x0'));var path=require(_0x2178('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2178('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2178('0x3'));var interaction=require(_0x2178('0x4'));var config=require('../../config/environment');var controller=require(_0x2178('0x5'));router['get']('/',auth[_0x2178('0x6')](),controller[_0x2178('0x7')]);router[_0x2178('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2178('0x9')]);router[_0x2178('0xa')]('/',auth[_0x2178('0x6')](),controller[_0x2178('0xb')]);router[_0x2178('0xc')](_0x2178('0xd'),auth['isAuthenticated'](),controller[_0x2178('0xe')]);router[_0x2178('0xf')](_0x2178('0xd'),auth['isAuthenticated'](),controller[_0x2178('0x10')]);module[_0x2178('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 2bc5b80..c6fc87b 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 _0x0789=['STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x0789,0xa7));var _0x9078=function(_0x3fddf3,_0x34cfd6){_0x3fddf3=_0x3fddf3-0x0;var _0x44d4a3=_0x0789[_0x3fddf3];return _0x44d4a3;};'use strict';var moment=require(_0x9078('0x0'));var Sequelize=require(_0x9078('0x1'));module[_0x9078('0x2')]={'phone':{'type':Sequelize[_0x9078('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x9078('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9078('0x5')],'defaultValue':moment()['format'](_0x9078('0x6'))},'countbusyretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9078('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9078('0x5')]},'priority':{'type':Sequelize[_0x9078('0x7')](0x2)[_0x9078('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9078('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9078('0x7')],'unique':_0x9078('0x9')},'ListId':{'type':Sequelize[_0x9078('0x7')],'unique':_0x9078('0x9')},'UserId':{'type':Sequelize[_0x9078('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x9078('0x7')],'unique':_0x9078('0x9')},'CampaignId':{'type':Sequelize[_0x9078('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9078('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x9078('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9078('0x3')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x963a=['INTEGER','DATE','UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','format'];(function(_0x73ac3a,_0x443ce2){var _0xc1cc02=function(_0x2e2ce1){while(--_0x2e2ce1){_0x73ac3a['push'](_0x73ac3a['shift']());}};_0xc1cc02(++_0x443ce2);}(_0x963a,0xf7));var _0xa963=function(_0x490f48,_0x1bf549){_0x490f48=_0x490f48-0x0;var _0x3deda7=_0x963a[_0x490f48];return _0x3deda7;};'use strict';var moment=require('moment');var Sequelize=require(_0xa963('0x0'));module[_0xa963('0x1')]={'phone':{'type':Sequelize[_0xa963('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa963('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xa963('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xa963('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa963('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa963('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa963('0x6')]},'priority':{'type':Sequelize[_0xa963('0x5')](0x2)[_0xa963('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa963('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa963('0x5')],'unique':_0xa963('0x8')},'ListId':{'type':Sequelize[_0xa963('0x5')],'unique':_0xa963('0x8')},'UserId':{'type':Sequelize[_0xa963('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa963('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa963('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa963('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa963('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa963('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa963('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xa963('0x6')],'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 440acd7..651a9eb 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 _0x9c5a=['UserId','user','deleted','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','DESC','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','getOpenContacts','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','moment','lodash','../../config/logger','api','../../config/environment','../../mysqldb','json','undefined','limit','count','offset','status','set','Content-Range','update','sendStatus','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','model','keys','query','filters','intersection','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$in','$like','$notLike','$notILike','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','length','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','omit','updatedAt','statedesc','campaign','membername'];(function(_0x3fec46,_0x2f5d60){var _0x4c779=function(_0x476f1d){while(--_0x476f1d){_0x3fec46['push'](_0x3fec46['shift']());}};_0x4c779(++_0x2f5d60);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x578b4d,_0x336e39){_0x578b4d=_0x578b4d-0x0;var _0x41c5c1=_0x9c5a[_0x578b4d];return _0x41c5c1;};'use strict';var moment=require(_0xa9c5('0x0'));var _=require(_0xa9c5('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xa9c5('0x2'))(_0xa9c5('0x3'));var shared=require(_0xa9c5('0x4'));var db=require(_0xa9c5('0x5'))['db'];function respondWithResult(_0x4f5552,_0x2acfaf){_0x2acfaf=_0x2acfaf||0xc8;return function(_0x3051b1){if(_0x3051b1){return _0x4f5552['status'](_0x2acfaf)[_0xa9c5('0x6')](_0x3051b1);}};}function respondWithFilteredResult(_0x4d9c7a,_0x394d84){return function(_0x3df556){if(_0x3df556){var _0x4cb597=typeof _0x394d84['offset']===_0xa9c5('0x7')&&typeof _0x394d84[_0xa9c5('0x8')]==='undefined';var _0x2e2b3e=_0x3df556[_0xa9c5('0x9')];var _0x51c14c=_0x4cb597?0x0:_0x394d84[_0xa9c5('0xa')];var _0x40a79d=_0x4cb597?_0x3df556['count']:_0x394d84['offset']+_0x394d84[_0xa9c5('0x8')];var _0x11421c;if(_0x40a79d>=_0x2e2b3e){_0x40a79d=_0x2e2b3e;_0x11421c=0xc8;}else{_0x11421c=0xce;}_0x4d9c7a[_0xa9c5('0xb')](_0x11421c);return _0x4d9c7a[_0xa9c5('0xc')](_0xa9c5('0xd'),_0x51c14c+'-'+_0x40a79d+'/'+_0x2e2b3e)[_0xa9c5('0x6')](_0x3df556);}return null;};}function saveUpdates(_0x51c8d,_0x42d5cf){return function(_0x3c5ac7){if(_0x3c5ac7){return _0x3c5ac7[_0xa9c5('0xe')](_0x51c8d)['then'](function(_0x390ca2){return _0x390ca2;});}return null;};}function handleEntityNotFound(_0x1276d2,_0x7df76d){return function(_0x3806c4){if(!_0x3806c4){_0x1276d2[_0xa9c5('0xf')](0x194);}return _0x3806c4;};}function handleError(_0x1dad66,_0x251099){_0x251099=_0x251099||0x1f4;return function(_0x40b001){logger[_0xa9c5('0x10')](_0x40b001[_0xa9c5('0x11')]);if(_0x40b001['name']){delete _0x40b001[_0xa9c5('0x12')];}_0x1dad66[_0xa9c5('0xb')](_0x251099)[_0xa9c5('0x13')](_0x40b001);};}exports['index']=function(_0x2cda1b,_0x1142d9){var _0x2b9ac5={},_0x3b8cf7={},_0x452a9b={'count':0x0,'rows':[]};var _0x349f27=_[_0xa9c5('0x14')](db[_0xa9c5('0x15')][_0xa9c5('0x16')],function(_0x36c486){return{'name':_0x36c486[_0xa9c5('0x17')],'type':_0x36c486[_0xa9c5('0x18')]['key']};});_0x3b8cf7[_0xa9c5('0x19')]=_[_0xa9c5('0x14')](_0x349f27,'name');_0x3b8cf7['query']=_[_0xa9c5('0x1a')](_0x2cda1b[_0xa9c5('0x1b')]);_0x3b8cf7[_0xa9c5('0x1c')]=_[_0xa9c5('0x1d')](_0x3b8cf7[_0xa9c5('0x19')],_0x3b8cf7[_0xa9c5('0x1b')]);_0x3b8cf7['filters']=_['concat'](_0x3b8cf7[_0xa9c5('0x1c')],[_0xa9c5('0x1e'),'$or',_0xa9c5('0x1f'),_0xa9c5('0x20'),_0xa9c5('0x21'),_0xa9c5('0x22'),_0xa9c5('0x23'),_0xa9c5('0x24'),_0xa9c5('0x25'),'$between','$notBetween',_0xa9c5('0x26'),'$notIn',_0xa9c5('0x27'),_0xa9c5('0x28'),'$iLike',_0xa9c5('0x29'),_0xa9c5('0x27'),'$overlap',_0xa9c5('0x2a'),_0xa9c5('0x2b'),_0xa9c5('0x2c')]);_0x2b9ac5[_0xa9c5('0x2d')]=_[_0xa9c5('0x1d')](_0x3b8cf7['model'],qs[_0xa9c5('0x2e')](_0x2cda1b['query'][_0xa9c5('0x2e')]));_0x2b9ac5[_0xa9c5('0x2d')]=_0x2b9ac5[_0xa9c5('0x2d')]['length']?_0x2b9ac5[_0xa9c5('0x2d')]:_0x3b8cf7[_0xa9c5('0x19')];if(!_0x2cda1b['query'][_0xa9c5('0x2f')](_0xa9c5('0x30'))){_0x2b9ac5[_0xa9c5('0x8')]=qs[_0xa9c5('0x8')](_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x8')]);_0x2b9ac5[_0xa9c5('0xa')]=qs['offset'](_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0xa')]);}_0x2b9ac5[_0xa9c5('0x31')]=qs[_0xa9c5('0x32')](_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x32')]);_0x2b9ac5[_0xa9c5('0x33')]=qs[_0xa9c5('0x1c')](_['pick'](_0x2cda1b['query'],_0x3b8cf7[_0xa9c5('0x1c')]),_0x349f27);if(_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x34')]){_0x2b9ac5[_0xa9c5('0x33')]=_[_0xa9c5('0x35')](_0x2b9ac5[_0xa9c5('0x33')],{'$or':_['map'](_0x349f27,function(_0x598920){if(_0x598920['type']!==_0xa9c5('0x36')){var _0x27d614={};_0x27d614[_0x598920['name']]={'$like':'%'+_0x2cda1b[_0xa9c5('0x1b')]['filter']+'%'};return _0x27d614;}})});}_0x2b9ac5=_[_0xa9c5('0x35')]({},_0x2b9ac5,_0x2cda1b[_0xa9c5('0x37')]);var _0x2567be={'where':_0x2b9ac5[_0xa9c5('0x33')]};return db['CmHopper'][_0xa9c5('0x9')](_0x2567be)[_0xa9c5('0x38')](function(_0x191153){_0x452a9b[_0xa9c5('0x9')]=_0x191153;if(_0x2cda1b[_0xa9c5('0x1b')][_0xa9c5('0x39')]){_0x2b9ac5[_0xa9c5('0x3a')]=[{'all':!![]}];}return db[_0xa9c5('0x15')]['findAll'](_0x2b9ac5);})[_0xa9c5('0x38')](function(_0x46e5d2){_0x452a9b[_0xa9c5('0x3b')]=_0x46e5d2;return _0x452a9b;})[_0xa9c5('0x38')](respondWithFilteredResult(_0x1142d9,_0x2b9ac5))[_0xa9c5('0x3c')](handleError(_0x1142d9,null));};exports[_0xa9c5('0x3d')]=function(_0x493b20,_0x307736){var _0x5b7a0a={'raw':!![],'where':{'id':_0x493b20['params']['id']}},_0x2fa3e3={};_0x2fa3e3[_0xa9c5('0x19')]=_[_0xa9c5('0x1a')](db[_0xa9c5('0x15')]['rawAttributes']);_0x2fa3e3[_0xa9c5('0x1b')]=_[_0xa9c5('0x1a')](_0x493b20[_0xa9c5('0x1b')]);_0x2fa3e3[_0xa9c5('0x1c')]=_['intersection'](_0x2fa3e3[_0xa9c5('0x19')],_0x2fa3e3[_0xa9c5('0x1b')]);_0x5b7a0a[_0xa9c5('0x2d')]=_[_0xa9c5('0x1d')](_0x2fa3e3[_0xa9c5('0x19')],qs['fields'](_0x493b20[_0xa9c5('0x1b')]['fields']));_0x5b7a0a[_0xa9c5('0x2d')]=_0x5b7a0a[_0xa9c5('0x2d')][_0xa9c5('0x3e')]?_0x5b7a0a[_0xa9c5('0x2d')]:_0x2fa3e3[_0xa9c5('0x19')];if(_0x493b20[_0xa9c5('0x1b')][_0xa9c5('0x39')]){_0x5b7a0a[_0xa9c5('0x3a')]=[{'all':!![]}];}_0x5b7a0a=_[_0xa9c5('0x35')]({},_0x5b7a0a,_0x493b20[_0xa9c5('0x37')]);return db['CmHopper'][_0xa9c5('0x3f')](_0x5b7a0a)[_0xa9c5('0x38')](handleEntityNotFound(_0x307736,null))[_0xa9c5('0x38')](respondWithResult(_0x307736,null))[_0xa9c5('0x3c')](handleError(_0x307736,null));};exports[_0xa9c5('0x40')]=function(_0x3794d2,_0x583ec9){return db[_0xa9c5('0x15')][_0xa9c5('0x40')](_0x3794d2['body'],{})['then'](respondWithResult(_0x583ec9,0xc9))['catch'](handleError(_0x583ec9,null));};exports['update']=function(_0x4e97bf,_0x160020){if(_0x4e97bf[_0xa9c5('0x41')]['id']){delete _0x4e97bf[_0xa9c5('0x41')]['id'];}return db[_0xa9c5('0x15')][_0xa9c5('0x3f')]({'where':{'id':_0x4e97bf[_0xa9c5('0x42')]['id']}})[_0xa9c5('0x38')](handleEntityNotFound(_0x160020,null))[_0xa9c5('0x38')](saveUpdates(_0x4e97bf[_0xa9c5('0x41')],null))[_0xa9c5('0x38')](respondWithResult(_0x160020,null))[_0xa9c5('0x3c')](handleError(_0x160020,null));};exports[_0xa9c5('0x43')]=function(_0x1c2ccf,_0x4bf8b4){return db[_0xa9c5('0x15')]['describe']()[_0xa9c5('0x38')](respondWithResult(_0x4bf8b4,null))[_0xa9c5('0x3c')](handleError(_0x4bf8b4,null));};exports['destroy']=function(_0x5cbd33,_0xf00970){var _0x32e64a;var _0xeb0720=_0x5cbd33['params']['id'];return db['CmHopper'][_0xa9c5('0x3f')]({'where':{'id':_0x5cbd33[_0xa9c5('0x42')]['id']}})['then'](handleEntityNotFound(_0xf00970,null))[_0xa9c5('0x38')](function(_0x2c095f){if(_0x2c095f){return _0x2c095f[_0xa9c5('0x44')]()[_0xa9c5('0x38')](function(_0x34020f){return _0x34020f;});}})[_0xa9c5('0x38')](function(_0x4b6fc9){_0x32e64a=_0x4b6fc9;if(_0x4b6fc9){if(_0x4b6fc9['VoiceQueueId']||_0x4b6fc9['CampaignId']){return db[_0x4b6fc9[_0xa9c5('0x45')]?_0xa9c5('0x46'):_0xa9c5('0x47')][_0xa9c5('0x3f')]({'where':{'id':_0x4b6fc9[_0xa9c5('0x45')]?_0x4b6fc9[_0xa9c5('0x45')]:_0x4b6fc9['CampaignId']},'attributes':['id',_0xa9c5('0x12')],'raw':!![]});}}})[_0xa9c5('0x38')](function(_0x433a58){var _0x2bdc77={};if(_0x433a58){_[_0xa9c5('0x35')](_0x2bdc77,_[_0xa9c5('0x48')](_0x32e64a['dataValues'],['createdAt',_0xa9c5('0x49'),'id']));_0x2bdc77['state']=0x15;_0x2bdc77[_0xa9c5('0x4a')]='deleted';_0x2bdc77[_0xa9c5('0x4b')]=_0x433a58[_0xa9c5('0x12')];_0x2bdc77[_0xa9c5('0x4c')]=_0x5cbd33['user'][_0xa9c5('0x12')];_0x2bdc77[_0xa9c5('0x4d')]=_0x5cbd33[_0xa9c5('0x4e')]['id'];_0x2bdc77[_0xa9c5('0x4f')]=!![];_0x2bdc77['deletedat']=moment()['format'](_0xa9c5('0x50'));_0x2bdc77[_0xa9c5('0x51')]=_0x32e64a[_0xa9c5('0x52')];_0x2bdc77['campaigntype']=_0x32e64a[_0xa9c5('0x45')]?_0xa9c5('0x53'):_0xa9c5('0x54');return db[_0xa9c5('0x55')][_0xa9c5('0x3f')]({'where':{'id':_0x2bdc77[_0xa9c5('0x56')]},'attributes':[_0xa9c5('0x57'),_0xa9c5('0x58')]})['then'](function(_0x41f528){if(!_['isNil'](_0xf00970)&&!_[_0xa9c5('0x59')](_0x41f528[_0xa9c5('0x57')])){_0x2bdc77[_0xa9c5('0x5a')]=_0x41f528['firstName'];if(!_[_0xa9c5('0x59')](_0x41f528[_0xa9c5('0x58')])){_0x2bdc77['calleridname']+='\x20'+_0x41f528[_0xa9c5('0x58')];}}})[_0xa9c5('0x5b')](function(){return db[_0xa9c5('0x5c')][_0xa9c5('0x40')](_0x2bdc77);});}})['then'](function(_0x3505d3){return db[_0xa9c5('0x5d')][_0xa9c5('0x44')]({'where':{'CmHopperId':_0xeb0720}});})[_0xa9c5('0x38')](function(){return _0xf00970['status'](0xcc)['end']();})[_0xa9c5('0x3c')](handleError(_0xf00970,null));};exports[_0xa9c5('0x5e')]=function(_0x67c1f8,_0x1b676e){var _0x279a26=[];return db[_0xa9c5('0x55')]['describe']()[_0xa9c5('0x38')](function(_0x1e787e){_0x279a26=_[_0xa9c5('0x1a')](_0x1e787e);return _0x67c1f8[_0xa9c5('0x4e')][_0xa9c5('0x5f')]({'where':{'type':_0xa9c5('0x60'),'dialActive':!![],'dialMethod':_0xa9c5('0x61')},'attributes':['id',_0xa9c5('0x62'),_0xa9c5('0x63')],'raw':!![]});})[_0xa9c5('0x38')](function(_0x50d438){if(_0x50d438&&_0x50d438['length']){return db[_0xa9c5('0x64')][_0xa9c5('0x65')](function(_0x3322cc){var _0x47afaa={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xa9c5('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x50d438,'id')},'$or':[{'UserId':null},{'UserId':_0x67c1f8[_0xa9c5('0x4e')]['id']}]};var _0x28c0df={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x50d438)[_0xa9c5('0x34')]([_0xa9c5('0x63'),0x0])[_0xa9c5('0x14')]('id')[_0xa9c5('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x67c1f8[_0xa9c5('0x4e')]['id']}]};var _0x3890b4={'$or':[_0x47afaa,_0x28c0df]};var _0x2f323e=[];if(_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x67')]&&_0x67c1f8[_0xa9c5('0x41')]['direction']===_0xa9c5('0x68')){if(!_[_0xa9c5('0x69')](_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x6a')])){_0x3890b4['id']={'$in':_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x6a')]};}_0x2f323e=[[_0xa9c5('0x6b'),'ASC'],['scheduledAt',_0x50d438[0x0][_0xa9c5('0x62')]==='ASC'?_0xa9c5('0x6c'):_0xa9c5('0x6d')],db['sequelize'][_0xa9c5('0x6e')](_0xa9c5('0x6f')),['id','DESC']];}else{if(!_['isEmpty'](_0x67c1f8[_0xa9c5('0x41')][_0xa9c5('0x6a')])){_0x3890b4['id']={'$notIn':_0x67c1f8[_0xa9c5('0x41')]['hopperIds']};}_0x2f323e=[['priority',_0xa9c5('0x6c')],[_0xa9c5('0x70'),_0x50d438[0x0]['dialOrderByScheduledAt']],db[_0xa9c5('0x64')][_0xa9c5('0x6e')](_0xa9c5('0x71')),['id',_0xa9c5('0x6d')]];}return db[_0xa9c5('0x15')][_0xa9c5('0x72')]({'attributes':['id','scheduledat',_0xa9c5('0x52'),_0xa9c5('0x73')],'where':_0x3890b4,'order':_0x2f323e,'transaction':_0x3322cc,'lock':_0x3322cc[_0xa9c5('0x74')][_0xa9c5('0x75')],'include':[{'model':db['CmContact'],'as':_0xa9c5('0x76'),'attributes':_0x279a26,'include':[{'model':db[_0xa9c5('0x77')],'as':'Company','attributes':['id',_0xa9c5('0x12')]}]},{'model':db[_0xa9c5('0x78')],'as':_0xa9c5('0x79'),'attributes':['id','name']},{'model':db[_0xa9c5('0x46')],'as':_0xa9c5('0x7a'),'attributes':['id',_0xa9c5('0x12'),_0xa9c5('0x7b')]}]})[_0xa9c5('0x38')](function(_0x4db621){if(_0x4db621){return _0x4db621[_0xa9c5('0xe')]({'UserId':_0x67c1f8['user']['id']},{'transaction':_0x3322cc});}});});}})[_0xa9c5('0x38')](handleEntityNotFound(_0x1b676e,null))[_0xa9c5('0x38')](respondWithResult(_0x1b676e,null))[_0xa9c5('0x3c')](handleError(_0x1b676e,null));};exports[_0xa9c5('0x7c')]=function(_0x427817,_0x42b1d7,_0x39fae1){var _0x390d0b=[];var _0x3f6114=_0x427817[_0xa9c5('0x42')]['id'];var _0x2f350e=_0x427817['user']['id'];return db[_0xa9c5('0x55')][_0xa9c5('0x43')]()['then'](function(_0x2a0a94){_0x390d0b=_[_0xa9c5('0x1a')](_0x2a0a94);return db[_0xa9c5('0x64')]['transaction'](function(_0x27bcc0){const _0x282f84={'id':_0x3f6114};return db[_0xa9c5('0x15')][_0xa9c5('0x72')]({'attributes':['id','scheduledat',_0xa9c5('0x73')],'where':_0x282f84,'transaction':_0x27bcc0,'lock':_0x27bcc0[_0xa9c5('0x74')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x390d0b,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xa9c5('0x12')]},{'model':db[_0xa9c5('0x46')],'as':_0xa9c5('0x7a'),'attributes':['id',_0xa9c5('0x12'),_0xa9c5('0x7b')]}]})['then'](function(_0x4d7772){if(_0x4d7772){return _0x4d7772['update']({'UserId':_0x2f350e},{'transaction':_0x27bcc0});}});});})['then'](handleEntityNotFound(_0x42b1d7,null))[_0xa9c5('0x38')](respondWithResult(_0x42b1d7,null))[_0xa9c5('0x3c')](handleError(_0x42b1d7,null));};exports[_0xa9c5('0x7d')]=function(_0x2eda17,_0x5253e8){return _0x2eda17['user'][_0xa9c5('0x5f')]({'where':{'type':_0xa9c5('0x60'),'dialActive':!![],'dialMethod':_0xa9c5('0x61')},'attributes':['id'],'raw':!![]})[_0xa9c5('0x38')](function(_0x1d89ec){if(_0x1d89ec&&_0x1d89ec['length']){return db[_0xa9c5('0x15')][_0xa9c5('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa9c5('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xa9c5('0x14')](_0x1d89ec,'id')},'$or':[{'UserId':null},{'UserId':_0x2eda17[_0xa9c5('0x4e')]['id']}]}});}return 0x0;})[_0xa9c5('0x38')](function(_0x3dfef2){if(!_['isNil'](_0x3dfef2)&&_[_0xa9c5('0x7f')](_0x3dfef2)){return _0x5253e8[_0xa9c5('0xb')](0xc8)['json']({'contacts':_0x3dfef2});}else{logger['error'](_0xa9c5('0x80'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x5253e8[_0xa9c5('0xf')](0x194);}})[_0xa9c5('0x3c')](handleError(_0x5253e8,null));};exports[_0xa9c5('0x81')]=function(_0x2f9757,_0x22661f){var _0x5bc433=shared[_0xa9c5('0x82')];var _0x4c04f7=[];_[_0xa9c5('0x14')](_0x5bc433,function(_0x2ff914){_0x4c04f7[_0xa9c5('0x83')]({'id':_0x2ff914[_0xa9c5('0x12')],'name':_0x2ff914['name'],'utcOffset':_0x2ff914['utcOffset']});});return _0x22661f[_0xa9c5('0xb')](0xc8)['json']({'tz':_0x4c04f7});};exports['getTimezone']=function(_0x38e2f,_0x370bbb){var _0x4cdf88=shared['timezones'];var _0x4335ff={};if(!_[_0xa9c5('0x59')](_0x4cdf88[_0x38e2f[_0xa9c5('0x41')]['id']]))_0x4335ff=_0x4cdf88[_0x38e2f[_0xa9c5('0x41')]['id']];return _0x370bbb['status'](0xc8)['json'](_0x4335ff);}; \ No newline at end of file +var _0xc949=['$or','$gt','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','createdAt','updatedAt','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','recallme','LOCK','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','Contact','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','sendStatus','getTimezones','timezones','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','name','send','index','map','CmHopper','fieldName','key','model','query','keys','filters','intersection','concat'];(function(_0x3a1ff5,_0x4c7476){var _0x50345d=function(_0xa95e6e){while(--_0xa95e6e){_0x3a1ff5['push'](_0x3a1ff5['shift']());}};_0x50345d(++_0x4c7476);}(_0xc949,0x181));var _0x9c94=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xc949[_0x29b609];return _0x54c952;};'use strict';var moment=require(_0x9c94('0x0'));var _=require('lodash');var qs=require(_0x9c94('0x1'));var logger=require(_0x9c94('0x2'))(_0x9c94('0x3'));var shared=require(_0x9c94('0x4'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x11a56c,_0x231762){_0x231762=_0x231762||0xc8;return function(_0x528a17){if(_0x528a17){return _0x11a56c[_0x9c94('0x5')](_0x231762)[_0x9c94('0x6')](_0x528a17);}};}function respondWithFilteredResult(_0x46d560,_0x1357ac){return function(_0x57fcd7){if(_0x57fcd7){var _0xf373e=typeof _0x1357ac[_0x9c94('0x7')]===_0x9c94('0x8')&&typeof _0x1357ac[_0x9c94('0x9')]===_0x9c94('0x8');var _0x423e62=_0x57fcd7[_0x9c94('0xa')];var _0x454b16=_0xf373e?0x0:_0x1357ac[_0x9c94('0x7')];var _0x3287f8=_0xf373e?_0x57fcd7['count']:_0x1357ac[_0x9c94('0x7')]+_0x1357ac[_0x9c94('0x9')];var _0x14c4ae;if(_0x3287f8>=_0x423e62){_0x3287f8=_0x423e62;_0x14c4ae=0xc8;}else{_0x14c4ae=0xce;}_0x46d560[_0x9c94('0x5')](_0x14c4ae);return _0x46d560[_0x9c94('0xb')](_0x9c94('0xc'),_0x454b16+'-'+_0x3287f8+'/'+_0x423e62)[_0x9c94('0x6')](_0x57fcd7);}return null;};}function saveUpdates(_0x423adb,_0x30f64e){return function(_0x1e326f){if(_0x1e326f){return _0x1e326f[_0x9c94('0xd')](_0x423adb)[_0x9c94('0xe')](function(_0x369d70){return _0x369d70;});}return null;};}function handleEntityNotFound(_0x15c51c,_0x54d956){return function(_0x9789bc){if(!_0x9789bc){_0x15c51c['sendStatus'](0x194);}return _0x9789bc;};}function handleError(_0x3d3de5,_0x26e629){_0x26e629=_0x26e629||0x1f4;return function(_0x4f0013){logger[_0x9c94('0xf')](_0x4f0013['stack']);if(_0x4f0013['name']){delete _0x4f0013[_0x9c94('0x10')];}_0x3d3de5['status'](_0x26e629)[_0x9c94('0x11')](_0x4f0013);};}exports[_0x9c94('0x12')]=function(_0x4d9266,_0x201e04){var _0x367eed={},_0x412804={},_0x3b825e={'count':0x0,'rows':[]};var _0x16ef2c=_[_0x9c94('0x13')](db[_0x9c94('0x14')]['rawAttributes'],function(_0x2c9736){return{'name':_0x2c9736[_0x9c94('0x15')],'type':_0x2c9736['type'][_0x9c94('0x16')]};});_0x412804[_0x9c94('0x17')]=_[_0x9c94('0x13')](_0x16ef2c,_0x9c94('0x10'));_0x412804[_0x9c94('0x18')]=_[_0x9c94('0x19')](_0x4d9266[_0x9c94('0x18')]);_0x412804[_0x9c94('0x1a')]=_[_0x9c94('0x1b')](_0x412804[_0x9c94('0x17')],_0x412804[_0x9c94('0x18')]);_0x412804[_0x9c94('0x1a')]=_[_0x9c94('0x1c')](_0x412804[_0x9c94('0x1a')],['$and',_0x9c94('0x1d'),_0x9c94('0x1e'),'$gte',_0x9c94('0x1f'),_0x9c94('0x20'),_0x9c94('0x21'),_0x9c94('0x22'),_0x9c94('0x23'),'$between',_0x9c94('0x24'),_0x9c94('0x25'),'$notIn',_0x9c94('0x26'),'$notLike',_0x9c94('0x27'),_0x9c94('0x28'),_0x9c94('0x26'),_0x9c94('0x29'),_0x9c94('0x2a'),_0x9c94('0x2b'),_0x9c94('0x2c')]);_0x367eed['attributes']=_['intersection'](_0x412804[_0x9c94('0x17')],qs[_0x9c94('0x2d')](_0x4d9266[_0x9c94('0x18')]['fields']));_0x367eed[_0x9c94('0x2e')]=_0x367eed['attributes'][_0x9c94('0x2f')]?_0x367eed[_0x9c94('0x2e')]:_0x412804[_0x9c94('0x17')];if(!_0x4d9266['query']['hasOwnProperty'](_0x9c94('0x30'))){_0x367eed[_0x9c94('0x9')]=qs[_0x9c94('0x9')](_0x4d9266['query']['limit']);_0x367eed['offset']=qs['offset'](_0x4d9266[_0x9c94('0x18')]['offset']);}_0x367eed[_0x9c94('0x31')]=qs[_0x9c94('0x32')](_0x4d9266['query']['sort']);_0x367eed[_0x9c94('0x33')]=qs[_0x9c94('0x1a')](_[_0x9c94('0x34')](_0x4d9266[_0x9c94('0x18')],_0x412804[_0x9c94('0x1a')]),_0x16ef2c);if(_0x4d9266[_0x9c94('0x18')][_0x9c94('0x35')]){_0x367eed[_0x9c94('0x33')]=_[_0x9c94('0x36')](_0x367eed[_0x9c94('0x33')],{'$or':_[_0x9c94('0x13')](_0x16ef2c,function(_0x44392f){if(_0x44392f[_0x9c94('0x37')]!==_0x9c94('0x38')){var _0x3060e8={};_0x3060e8[_0x44392f[_0x9c94('0x10')]]={'$like':'%'+_0x4d9266[_0x9c94('0x18')][_0x9c94('0x35')]+'%'};return _0x3060e8;}})});}_0x367eed=_['merge']({},_0x367eed,_0x4d9266[_0x9c94('0x39')]);var _0x230685={'where':_0x367eed[_0x9c94('0x33')]};return db[_0x9c94('0x14')][_0x9c94('0xa')](_0x230685)[_0x9c94('0xe')](function(_0x13f94c){_0x3b825e['count']=_0x13f94c;if(_0x4d9266[_0x9c94('0x18')]['includeAll']){_0x367eed[_0x9c94('0x3a')]=[{'all':!![]}];}return db[_0x9c94('0x14')][_0x9c94('0x3b')](_0x367eed);})[_0x9c94('0xe')](function(_0x4b2c4e){_0x3b825e[_0x9c94('0x3c')]=_0x4b2c4e;return _0x3b825e;})['then'](respondWithFilteredResult(_0x201e04,_0x367eed))[_0x9c94('0x3d')](handleError(_0x201e04,null));};exports[_0x9c94('0x3e')]=function(_0x3912f0,_0x5e3119){var _0x21e9f7={'raw':!![],'where':{'id':_0x3912f0[_0x9c94('0x3f')]['id']}},_0x4d4dc0={};_0x4d4dc0['model']=_['keys'](db[_0x9c94('0x14')][_0x9c94('0x40')]);_0x4d4dc0[_0x9c94('0x18')]=_[_0x9c94('0x19')](_0x3912f0['query']);_0x4d4dc0[_0x9c94('0x1a')]=_[_0x9c94('0x1b')](_0x4d4dc0[_0x9c94('0x17')],_0x4d4dc0[_0x9c94('0x18')]);_0x21e9f7['attributes']=_[_0x9c94('0x1b')](_0x4d4dc0[_0x9c94('0x17')],qs['fields'](_0x3912f0[_0x9c94('0x18')][_0x9c94('0x2d')]));_0x21e9f7[_0x9c94('0x2e')]=_0x21e9f7['attributes']['length']?_0x21e9f7[_0x9c94('0x2e')]:_0x4d4dc0[_0x9c94('0x17')];if(_0x3912f0[_0x9c94('0x18')][_0x9c94('0x41')]){_0x21e9f7[_0x9c94('0x3a')]=[{'all':!![]}];}_0x21e9f7=_[_0x9c94('0x36')]({},_0x21e9f7,_0x3912f0[_0x9c94('0x39')]);return db[_0x9c94('0x14')][_0x9c94('0x42')](_0x21e9f7)[_0x9c94('0xe')](handleEntityNotFound(_0x5e3119,null))[_0x9c94('0xe')](respondWithResult(_0x5e3119,null))['catch'](handleError(_0x5e3119,null));};exports[_0x9c94('0x43')]=function(_0x5647f9,_0x4ae326){return db[_0x9c94('0x14')][_0x9c94('0x43')](_0x5647f9[_0x9c94('0x44')],{})[_0x9c94('0xe')](respondWithResult(_0x4ae326,0xc9))[_0x9c94('0x3d')](handleError(_0x4ae326,null));};exports[_0x9c94('0xd')]=function(_0x4aeabc,_0x5665d2){if(_0x4aeabc[_0x9c94('0x44')]['id']){delete _0x4aeabc[_0x9c94('0x44')]['id'];}return db[_0x9c94('0x14')]['find']({'where':{'id':_0x4aeabc[_0x9c94('0x3f')]['id']}})[_0x9c94('0xe')](handleEntityNotFound(_0x5665d2,null))['then'](saveUpdates(_0x4aeabc['body'],null))['then'](respondWithResult(_0x5665d2,null))['catch'](handleError(_0x5665d2,null));};exports[_0x9c94('0x45')]=function(_0x5362f4,_0x5ccc46){return db[_0x9c94('0x14')]['describe']()[_0x9c94('0xe')](respondWithResult(_0x5ccc46,null))[_0x9c94('0x3d')](handleError(_0x5ccc46,null));};exports[_0x9c94('0x46')]=function(_0x205f51,_0x22eaa4){var _0x5ae40c;var _0x33ccef=_0x205f51[_0x9c94('0x3f')]['id'];return db[_0x9c94('0x14')][_0x9c94('0x42')]({'where':{'id':_0x205f51[_0x9c94('0x3f')]['id']}})[_0x9c94('0xe')](handleEntityNotFound(_0x22eaa4,null))['then'](function(_0x44311e){if(_0x44311e){return _0x44311e['destroy']()[_0x9c94('0xe')](function(_0x38bb48){return _0x38bb48;});}})[_0x9c94('0xe')](function(_0x48d368){_0x5ae40c=_0x48d368;if(_0x48d368){if(_0x48d368[_0x9c94('0x47')]||_0x48d368[_0x9c94('0x48')]){return db[_0x48d368['VoiceQueueId']?_0x9c94('0x49'):'Campaign'][_0x9c94('0x42')]({'where':{'id':_0x48d368[_0x9c94('0x47')]?_0x48d368['VoiceQueueId']:_0x48d368['CampaignId']},'attributes':['id',_0x9c94('0x10')],'raw':!![]});}}})['then'](function(_0x472107){var _0x3f8448={};if(_0x472107){_[_0x9c94('0x36')](_0x3f8448,_[_0x9c94('0x4a')](_0x5ae40c['dataValues'],[_0x9c94('0x4b'),_0x9c94('0x4c'),'id']));_0x3f8448['state']=0x15;_0x3f8448['statedesc']=_0x9c94('0x4d');_0x3f8448[_0x9c94('0x4e')]=_0x472107[_0x9c94('0x10')];_0x3f8448[_0x9c94('0x4f')]=_0x205f51[_0x9c94('0x50')][_0x9c94('0x10')];_0x3f8448['UserId']=_0x205f51[_0x9c94('0x50')]['id'];_0x3f8448[_0x9c94('0x4d')]=!![];_0x3f8448[_0x9c94('0x51')]=moment()[_0x9c94('0x52')](_0x9c94('0x53'));_0x3f8448[_0x9c94('0x54')]=_0x5ae40c['phone'];_0x3f8448[_0x9c94('0x55')]=_0x5ae40c['VoiceQueueId']?_0x9c94('0x56'):_0x9c94('0x57');return db[_0x9c94('0x58')]['find']({'where':{'id':_0x3f8448[_0x9c94('0x59')]},'attributes':['firstName','lastName']})[_0x9c94('0xe')](function(_0x3b88be){if(!_['isNil'](_0x22eaa4)&&!_[_0x9c94('0x5a')](_0x3b88be[_0x9c94('0x5b')])){_0x3f8448[_0x9c94('0x5c')]=_0x3b88be[_0x9c94('0x5b')];if(!_[_0x9c94('0x5a')](_0x3b88be[_0x9c94('0x5d')])){_0x3f8448[_0x9c94('0x5c')]+='\x20'+_0x3b88be[_0x9c94('0x5d')];}}})[_0x9c94('0x5e')](function(){return db[_0x9c94('0x5f')][_0x9c94('0x43')](_0x3f8448);});}})['then'](function(_0x481a11){return db[_0x9c94('0x60')][_0x9c94('0x46')]({'where':{'CmHopperId':_0x33ccef}});})['then'](function(){return _0x22eaa4[_0x9c94('0x5')](0xcc)[_0x9c94('0x61')]();})[_0x9c94('0x3d')](handleError(_0x22eaa4,null));};exports[_0x9c94('0x62')]=function(_0x249759,_0xd5674b){var _0x4f3f89=[];return db['CmContact']['describe']()[_0x9c94('0xe')](function(_0x5c2ea2){_0x4f3f89=_['keys'](_0x5c2ea2);return _0x249759[_0x9c94('0x50')][_0x9c94('0x63')]({'where':{'type':_0x9c94('0x64'),'dialActive':!![],'dialMethod':_0x9c94('0x65')},'attributes':['id',_0x9c94('0x66'),_0x9c94('0x67')],'raw':!![]});})['then'](function(_0x2a8a97){if(_0x2a8a97&&_0x2a8a97['length']){return db[_0x9c94('0x68')][_0x9c94('0x69')](function(_0x5b4e1a){var _0x1e3e42={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9c94('0x52')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x9c94('0x13')](_0x2a8a97,'id')},'$or':[{'UserId':null},{'UserId':_0x249759[_0x9c94('0x50')]['id']}]};var _0x364450={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2a8a97)[_0x9c94('0x35')](['dialPreviewAutoRecallMe',0x0])[_0x9c94('0x13')]('id')[_0x9c94('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x249759['user']['id']}]};var _0x5b68ac={'$or':[_0x1e3e42,_0x364450]};var _0xf8b2ec=[];if(_0x249759[_0x9c94('0x44')][_0x9c94('0x6b')]&&_0x249759['body']['direction']===_0x9c94('0x6c')){if(!_[_0x9c94('0x6d')](_0x249759[_0x9c94('0x44')]['hopperIds'])){_0x5b68ac['id']={'$in':_0x249759[_0x9c94('0x44')][_0x9c94('0x6e')]};}_0xf8b2ec=[[_0x9c94('0x6f'),_0x9c94('0x70')],[_0x9c94('0x71'),_0x2a8a97[0x0][_0x9c94('0x66')]==='ASC'?_0x9c94('0x72'):_0x9c94('0x70')],db[_0x9c94('0x68')][_0x9c94('0x73')](_0x9c94('0x74')),['id',_0x9c94('0x72')]];}else{if(!_[_0x9c94('0x6d')](_0x249759[_0x9c94('0x44')][_0x9c94('0x6e')])){_0x5b68ac['id']={'$notIn':_0x249759[_0x9c94('0x44')][_0x9c94('0x6e')]};}_0xf8b2ec=[['priority','DESC'],[_0x9c94('0x71'),_0x2a8a97[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal'](_0x9c94('0x75')),['id',_0x9c94('0x70')]];}return db['CmHopper'][_0x9c94('0x76')]({'attributes':['id',_0x9c94('0x77'),_0x9c94('0x78'),_0x9c94('0x79')],'where':_0x5b68ac,'order':_0xf8b2ec,'transaction':_0x5b4e1a,'lock':_0x5b4e1a[_0x9c94('0x7a')]['UPDATE'],'include':[{'model':db[_0x9c94('0x58')],'as':'Contact','attributes':_0x4f3f89,'include':[{'model':db[_0x9c94('0x7b')],'as':_0x9c94('0x7c'),'attributes':['id',_0x9c94('0x10')]}]},{'model':db[_0x9c94('0x7d')],'as':_0x9c94('0x7e'),'attributes':['id',_0x9c94('0x10')]},{'model':db[_0x9c94('0x49')],'as':_0x9c94('0x7f'),'attributes':['id',_0x9c94('0x10'),_0x9c94('0x80')]}]})[_0x9c94('0xe')](function(_0x540996){if(_0x540996){return _0x540996[_0x9c94('0xd')]({'UserId':_0x249759[_0x9c94('0x50')]['id']},{'transaction':_0x5b4e1a});}});});}})[_0x9c94('0xe')](handleEntityNotFound(_0xd5674b,null))['then'](respondWithResult(_0xd5674b,null))[_0x9c94('0x3d')](handleError(_0xd5674b,null));};exports[_0x9c94('0x81')]=function(_0x324b1f,_0x18dd23,_0xc6d42c){var _0x66483b=[];var _0x13988a=_0x324b1f['params']['id'];var _0x1dcfaa=_0x324b1f[_0x9c94('0x50')]['id'];return db[_0x9c94('0x58')]['describe']()[_0x9c94('0xe')](function(_0x59ef88){_0x66483b=_[_0x9c94('0x19')](_0x59ef88);return db[_0x9c94('0x68')]['transaction'](function(_0x3fa6be){const _0x1b0eac={'id':_0x13988a};return db[_0x9c94('0x14')][_0x9c94('0x76')]({'attributes':['id',_0x9c94('0x77'),_0x9c94('0x79')],'where':_0x1b0eac,'transaction':_0x3fa6be,'lock':_0x3fa6be['LOCK']['UPDATE'],'include':[{'model':db[_0x9c94('0x58')],'as':_0x9c94('0x82'),'attributes':_0x66483b,'include':[{'model':db[_0x9c94('0x7b')],'as':'Company','attributes':['id',_0x9c94('0x10')]}]},{'model':db[_0x9c94('0x7d')],'as':_0x9c94('0x7e'),'attributes':['id','name']},{'model':db[_0x9c94('0x49')],'as':'Queue','attributes':['id','name',_0x9c94('0x80')]}]})[_0x9c94('0xe')](function(_0x48d0ea){if(_0x48d0ea){return _0x48d0ea[_0x9c94('0xd')]({'UserId':_0x1dcfaa},{'transaction':_0x3fa6be});}});});})[_0x9c94('0xe')](handleEntityNotFound(_0x18dd23,null))['then'](respondWithResult(_0x18dd23,null))[_0x9c94('0x3d')](handleError(_0x18dd23,null));};exports[_0x9c94('0x83')]=function(_0xe7fc99,_0x1bacd9){return _0xe7fc99[_0x9c94('0x50')][_0x9c94('0x63')]({'where':{'type':_0x9c94('0x64'),'dialActive':!![],'dialMethod':_0x9c94('0x65')},'attributes':['id'],'raw':!![]})[_0x9c94('0xe')](function(_0x540373){if(_0x540373&&_0x540373[_0x9c94('0x2f')]){return db[_0x9c94('0x14')][_0x9c94('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9c94('0x52')](_0x9c94('0x53'))},'VoiceQueueId':{'$in':_['map'](_0x540373,'id')},'$or':[{'UserId':null},{'UserId':_0xe7fc99[_0x9c94('0x50')]['id']}]}});}return 0x0;})['then'](function(_0x2ca6a4){if(!_[_0x9c94('0x5a')](_0x2ca6a4)&&_['isNumber'](_0x2ca6a4)){return _0x1bacd9['status'](0xc8)[_0x9c94('0x6')]({'contacts':_0x2ca6a4});}else{logger[_0x9c94('0xf')](_0x9c94('0x84'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x1bacd9[_0x9c94('0x85')](0x194);}})[_0x9c94('0x3d')](handleError(_0x1bacd9,null));};exports[_0x9c94('0x86')]=function(_0x27cdde,_0x34edf2){var _0x3b7c65=shared[_0x9c94('0x87')];var _0x117e0f=[];_[_0x9c94('0x13')](_0x3b7c65,function(_0x4c9022){_0x117e0f['push']({'id':_0x4c9022['name'],'name':_0x4c9022['name'],'utcOffset':_0x4c9022[_0x9c94('0x88')]});});return _0x34edf2['status'](0xc8)[_0x9c94('0x6')]({'tz':_0x117e0f});};exports[_0x9c94('0x89')]=function(_0x22d5bc,_0x4e23c1){var _0xf55837=shared[_0x9c94('0x87')];var _0x3edf16={};if(!_['isNil'](_0xf55837[_0x22d5bc[_0x9c94('0x44')]['id']]))_0x3edf16=_0xf55837[_0x22d5bc[_0x9c94('0x44')]['id']];return _0x4e23c1[_0x9c94('0x5')](0xc8)[_0x9c94('0x6')](_0x3edf16);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a9af75b..099ca25 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 _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x2a110d,_0x43d2e8){var _0x282f9b=function(_0x1bfcf9){while(--_0x1bfcf9){_0x2a110d['push'](_0x2a110d['shift']());}};_0x282f9b(++_0x43d2e8);}(_0x2542,0x169));var _0x2254=function(_0x1a7d5b,_0xb8611a){_0x1a7d5b=_0x1a7d5b-0x0;var _0x42bc59=_0x2542[_0x1a7d5b];return _0x42bc59;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['path','rimraf','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','moment','bluebird'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x2675,0x75));var _0x5267=function(_0x1faa70,_0x10eeb1){_0x1faa70=_0x1faa70-0x0;var _0x3860aa=_0x2675[_0x1faa70];return _0x3860aa;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x5267('0x9'),'fields':[_0x5267('0x9')]},{'name':'phone','fields':[_0x5267('0xa')]},{'name':'priority','fields':[_0x5267('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 418afdf..461c012 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 _0xf21d=['stringify','catch','error','message','ShowCmHopper','find','debug','CreateCmHopper','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','name','length','UserId','update','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','findAll','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','\x20MINUTE','NOW()','voicePause','CmList','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','options','raw','where','limit','include','map','model','attributes','then','info','GetCmHopper'];(function(_0x25cd2c,_0x42f3b5){var _0x573939=function(_0x1514be){while(--_0x1514be){_0x25cd2c['push'](_0x25cd2c['shift']());}};_0x573939(++_0x42f3b5);}(_0xf21d,0x8c));var _0xdf21=function(_0x5eea2c,_0x2044b3){_0x5eea2c=_0x5eea2c-0x0;var _0x12694b=_0xf21d[_0x5eea2c];return _0x12694b;};'use strict';var _=require(_0xdf21('0x0'));var util=require(_0xdf21('0x1'));var moment=require('moment');var BPromise=require(_0xdf21('0x2'));var db=require(_0xdf21('0x3'))['db'];var logger=require(_0xdf21('0x4'))(_0xdf21('0x5'));exports['GetCmHopper']=function(_0x5eb83d){var _0x374298=this;return new Promise(function(_0x33b955,_0x595dac){return db[_0xdf21('0x6')]['findAll']({'raw':_0x5eb83d['options']?_0x5eb83d[_0xdf21('0x7')][_0xdf21('0x8')]===undefined?!![]:![]:!![],'where':_0x5eb83d['options']?_0x5eb83d[_0xdf21('0x7')][_0xdf21('0x9')]||null:null,'attributes':_0x5eb83d['options']?_0x5eb83d[_0xdf21('0x7')]['attributes']||null:null,'limit':_0x5eb83d['options']?_0x5eb83d[_0xdf21('0x7')][_0xdf21('0xa')]||null:null,'include':_0x5eb83d['options']?_0x5eb83d[_0xdf21('0x7')][_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x5eb83d[_0xdf21('0x7')][_0xdf21('0xb')],function(_0x3d066a){return{'model':db[_0x3d066a[_0xdf21('0xd')]],'as':_0x3d066a['as'],'attributes':_0x3d066a[_0xdf21('0xe')],'include':_0x3d066a[_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x3d066a[_0xdf21('0xb')],function(_0x5b7e97){return{'model':db[_0x5b7e97[_0xdf21('0xd')]],'as':_0x5b7e97['as'],'attributes':_0x5b7e97[_0xdf21('0xe')],'include':_0x5b7e97[_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x5b7e97[_0xdf21('0xb')],function(_0x5b0a16){return{'model':db[_0x5b0a16[_0xdf21('0xd')]],'as':_0x5b0a16['as'],'attributes':_0x5b0a16[_0xdf21('0xe')]};}):[]};}):[]};}):[]:[]})[_0xdf21('0xf')](function(_0x1f472e){logger[_0xdf21('0x10')](_0xdf21('0x11'),_0x5eb83d);logger['debug']('GetCmHopper',_0x5eb83d,JSON[_0xdf21('0x12')](_0x1f472e));_0x33b955(_0x1f472e);})[_0xdf21('0x13')](function(_0x34a258){logger[_0xdf21('0x14')](_0xdf21('0x11'),_0x34a258[_0xdf21('0x15')],_0x5eb83d);_0x595dac(_0x374298['error'](0x1f4,_0x34a258['message']));});});};exports[_0xdf21('0x16')]=function(_0x55d344){var _0x4be8df=this;return new Promise(function(_0xf1af4f,_0x23a8ee){return db[_0xdf21('0x6')][_0xdf21('0x17')]({'raw':_0x55d344['options']?_0x55d344['options'][_0xdf21('0x8')]===undefined?!![]:![]:!![],'where':_0x55d344[_0xdf21('0x7')]?_0x55d344['options'][_0xdf21('0x9')]||null:null,'attributes':_0x55d344[_0xdf21('0x7')]?_0x55d344[_0xdf21('0x7')]['attributes']||null:null,'include':_0x55d344[_0xdf21('0x7')]?_0x55d344[_0xdf21('0x7')][_0xdf21('0xb')]?_['map'](_0x55d344['options']['include'],function(_0x169630){return{'model':db[_0x169630[_0xdf21('0xd')]],'as':_0x169630['as'],'attributes':_0x169630[_0xdf21('0xe')],'include':_0x169630['include']?_[_0xdf21('0xc')](_0x169630[_0xdf21('0xb')],function(_0xac4e64){return{'model':db[_0xac4e64[_0xdf21('0xd')]],'as':_0xac4e64['as'],'attributes':_0xac4e64[_0xdf21('0xe')],'include':_0xac4e64[_0xdf21('0xb')]?_[_0xdf21('0xc')](_0xac4e64[_0xdf21('0xb')],function(_0x4c538d){return{'model':db[_0x4c538d[_0xdf21('0xd')]],'as':_0x4c538d['as'],'attributes':_0x4c538d[_0xdf21('0xe')]};}):[]};}):[]};}):[]:[]})[_0xdf21('0xf')](function(_0x39b183){logger['info'](_0xdf21('0x16'),_0x55d344);logger[_0xdf21('0x18')](_0xdf21('0x16'),_0x55d344,JSON[_0xdf21('0x12')](_0x39b183));_0xf1af4f(_0x39b183);})['catch'](function(_0x49583b){logger[_0xdf21('0x14')]('ShowCmHopper',_0x49583b['message'],_0x55d344);_0x23a8ee(_0x4be8df['error'](0x1f4,_0x49583b[_0xdf21('0x15')]));});});};exports[_0xdf21('0x19')]=function(_0x3814a7){var _0x98dcbc=this;return new Promise(function(_0x3d9a3b,_0x5554b1){return db[_0xdf21('0x6')]['create'](_0x3814a7[_0xdf21('0x1a')],{'raw':_0x3814a7[_0xdf21('0x7')]?_0x3814a7[_0xdf21('0x7')]['raw']===undefined?!![]:![]:!![]})[_0xdf21('0xf')](function(_0x2f5bfb){logger['info'](_0xdf21('0x19'),_0x3814a7);logger[_0xdf21('0x18')](_0xdf21('0x19'),_0x3814a7,JSON[_0xdf21('0x12')](_0x2f5bfb));_0x3d9a3b(_0x2f5bfb);})[_0xdf21('0x13')](function(_0x36d609){logger[_0xdf21('0x14')](_0xdf21('0x19'),_0x36d609[_0xdf21('0x15')],_0x3814a7);_0x5554b1(_0x98dcbc['error'](0x1f4,_0x36d609[_0xdf21('0x15')]));});});};exports[_0xdf21('0x1b')]=function(_0x3da779){var _0x1e609e=this;return new Promise(function(_0xc06e2,_0x1b7e26){return db['CmHopper']['update'](_0x3da779[_0xdf21('0x1a')],{'raw':_0x3da779[_0xdf21('0x7')]?_0x3da779[_0xdf21('0x7')][_0xdf21('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3da779[_0xdf21('0x7')]?_0x3da779[_0xdf21('0x7')][_0xdf21('0x9')]||null:null,'attributes':_0x3da779[_0xdf21('0x7')]?_0x3da779[_0xdf21('0x7')][_0xdf21('0xe')]||null:null,'limit':_0x3da779[_0xdf21('0x7')]?_0x3da779[_0xdf21('0x7')][_0xdf21('0xa')]||null:null})[_0xdf21('0xf')](function(_0x267850){logger['info'](_0xdf21('0x1b'),_0x3da779);logger[_0xdf21('0x10')](_0xdf21('0x1c'),JSON['stringify'](_0x3da779[_0xdf21('0x7')][_0xdf21('0x9')]),_0x3da779['body'][_0xdf21('0x1d')]);logger['debug'](_0xdf21('0x1b'),_0x3da779,JSON[_0xdf21('0x12')](_0x267850));_0xc06e2(_0x267850);})[_0xdf21('0x13')](function(_0xdf76be){logger[_0xdf21('0x14')](_0xdf21('0x1b'),_0xdf76be[_0xdf21('0x15')],_0x3da779);_0x1b7e26(_0x1e609e[_0xdf21('0x14')](0x1f4,_0xdf76be['message']));});});};exports[_0xdf21('0x1e')]=function(_0x40e151){var _0x3650dd=this;return new Promise(function(_0x2ab247,_0x76b44b){return db['CmHopper'][_0xdf21('0x1f')]({'where':_0x40e151['options']?_0x40e151[_0xdf21('0x7')][_0xdf21('0x9')]||null:null})['then'](function(_0x4806d1){logger['info'](_0xdf21('0x1e'),_0x40e151);logger[_0xdf21('0x18')](_0xdf21('0x1e'),_0x40e151,JSON[_0xdf21('0x12')](_0x4806d1));_0x2ab247(_0x4806d1);})[_0xdf21('0x13')](function(_0x19db26){logger[_0xdf21('0x14')]('DestroyCmHopper',_0x19db26['message'],_0x40e151);_0x76b44b(_0x3650dd[_0xdf21('0x14')](0x1f4,_0x19db26[_0xdf21('0x15')]));});});};exports[_0xdf21('0x20')]=function(_0x40de9a){var _0x4a5e2c=this;return new Promise(function(_0x128647,_0x56bf11){return db[_0xdf21('0x21')][_0xdf21('0x22')]()[_0xdf21('0xf')](function(_0x1cd701){return db[_0xdf21('0x23')][_0xdf21('0x24')](function(_0x53170f){return db[_0xdf21('0x6')]['findAll']({'where':_0x40de9a['options']?_0x40de9a[_0xdf21('0x7')]['where']||null:null,'attributes':_0x40de9a[_0xdf21('0x7')]?_0x40de9a[_0xdf21('0x7')]['attributes']||null:null,'limit':_0x40de9a[_0xdf21('0x7')]?_0x40de9a['options'][_0xdf21('0xa')]||null:null,'order':_0x40de9a['options']?_0x40de9a[_0xdf21('0x7')][_0xdf21('0x25')]||null:null,'transaction':_0x53170f,'lock':_0x53170f[_0xdf21('0x26')][_0xdf21('0x27')],'include':[{'model':db['CmContact'],'as':_0xdf21('0x28'),'attributes':_[_0xdf21('0x29')](_0x1cd701)},{'model':db[_0xdf21('0x2a')],'as':'Agent','attributes':['id',_0xdf21('0x2b'),'voicePause']}]})[_0xdf21('0xf')](function(_0x594b75){var _0x505496=[];var _0x1671d8=[];for(var _0x2333e8=0x0;_0x2333e8<_0x594b75[_0xdf21('0x2c')];_0x2333e8+=0x1){var _0xdc97fc=_0x594b75[_0x2333e8][_0xdf21('0x2d')];if(_0xdc97fc===null){_0x505496['push'](_0x594b75[_0x2333e8][_0xdf21('0x2e')](_0x40de9a[_0xdf21('0x1a')],{'transaction':_0x53170f}));}else if(!_0x1671d8[_0xdf21('0x2f')](_0xdc97fc)){_0x1671d8[_0xdf21('0x30')](_0xdc97fc);_0x505496[_0xdf21('0x30')](_0x594b75[_0x2333e8][_0xdf21('0x2e')](_0x40de9a[_0xdf21('0x1a')],{'transaction':_0x53170f}));}}return BPromise[_0xdf21('0x31')](_0x505496);});})[_0xdf21('0xf')](function(_0x2613a0){logger[_0xdf21('0x10')]('GetContactDialer',_0x40de9a);if(_0x2613a0['length']>0x0){logger[_0xdf21('0x10')](_0xdf21('0x32'),_0x2613a0[0x0]['dataValues']['id'],_0x2613a0[0x0][_0xdf21('0x33')][_0xdf21('0x34')],_0x2613a0[0x0][_0xdf21('0x33')]['active']);}logger[_0xdf21('0x18')](_0xdf21('0x20'),_0x40de9a,JSON[_0xdf21('0x12')](_0x2613a0));_0x128647(_0x2613a0);})[_0xdf21('0x13')](function(_0x23678b){logger[_0xdf21('0x14')](_0xdf21('0x20'),_0x23678b[_0xdf21('0x15')],_0x40de9a);_0x56bf11(_0x4a5e2c[_0xdf21('0x14')](0x1f4,_0x23678b[_0xdf21('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x22b775){var _0x31f094=this;return new Promise(function(_0x5442d7,_0x3149e6){return db[_0xdf21('0x23')][_0xdf21('0x24')](function(_0x106fc9){return db[_0xdf21('0x35')]['create'](_0x22b775[_0xdf21('0x1a')],{'raw':_0x22b775['options']?_0x22b775[_0xdf21('0x7')][_0xdf21('0x8')]===undefined?!![]:![]:!![],'transaction':_0x106fc9})[_0xdf21('0xf')](function(){logger[_0xdf21('0x10')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xdf21('0x12')](_0x22b775[_0xdf21('0x7')][_0xdf21('0x9')]),_0x22b775[_0xdf21('0x7')][_0xdf21('0x9')][_0xdf21('0x1d')]);return db[_0xdf21('0x6')][_0xdf21('0x1f')]({'where':_0x22b775['options']?_0x22b775[_0xdf21('0x7')]['where']||null:null,'transaction':_0x106fc9});});})[_0xdf21('0xf')](function(_0x294462){logger[_0xdf21('0x10')](_0xdf21('0x36'),_0x22b775);logger['debug']('MoveContactManagedDialer',_0x22b775,JSON['stringify'](_0x294462));_0x5442d7(_0x294462);})[_0xdf21('0x13')](function(_0xb922a6){logger[_0xdf21('0x14')](_0xdf21('0x36'),_0xb922a6[_0xdf21('0x15')],_0x22b775);_0x3149e6(_0x31f094['error'](0x1f4,_0xb922a6[_0xdf21('0x15')]));});});};exports[_0xdf21('0x37')]=function(_0x5eb3e4){var _0xcd7858=this;return new Promise(function(_0x473905,_0x4108af){return db['CmHopper'][_0xdf21('0x38')]({'raw':_0x5eb3e4[_0xdf21('0x7')]?_0x5eb3e4[_0xdf21('0x7')][_0xdf21('0x8')]===undefined?!![]:![]:!![],'where':_0x5eb3e4[_0xdf21('0x7')]?_0x5eb3e4[_0xdf21('0x7')][_0xdf21('0x9')]||null:null,'attributes':[[db['sequelize']['fn'](_0xdf21('0x39'),db[_0xdf21('0x23')]['fn']('IF',db[_0xdf21('0x23')][_0xdf21('0x3a')](_0xdf21('0x3b')+util[_0xdf21('0x3c')](_0xdf21('0x3d'),moment()[_0xdf21('0x3c')](_0xdf21('0x3e')))+_0xdf21('0x3f')))),_0xdf21('0x40')]]})[_0xdf21('0xf')](function(_0x428e9e){logger[_0xdf21('0x10')](_0xdf21('0x37'),_0x5eb3e4);logger[_0xdf21('0x18')](_0xdf21('0x37'),_0x5eb3e4,JSON[_0xdf21('0x12')](_0x428e9e));_0x473905(_0x428e9e);})[_0xdf21('0x13')](function(_0x39c212){logger[_0xdf21('0x14')](_0xdf21('0x37'),_0x39c212[_0xdf21('0x15')],_0x5eb3e4);_0x4108af(_0xcd7858[_0xdf21('0x14')](0x1f4,_0x39c212[_0xdf21('0x15')]));});});};exports[_0xdf21('0x41')]=function(_0x3a0115){var _0x3ddb06=this;return new Promise(function(_0x2d7511,_0x391003){return db[_0xdf21('0x21')][_0xdf21('0x22')]()['then'](function(){return db[_0xdf21('0x23')][_0xdf21('0x24')](function(_0xdfbdac){return db[_0xdf21('0x6')][_0xdf21('0x38')]({'where':_0x3a0115[_0xdf21('0x7')]?_0x3a0115[_0xdf21('0x7')][_0xdf21('0x9')]||null:null,'attributes':_0x3a0115[_0xdf21('0x7')]?_0x3a0115[_0xdf21('0x7')][_0xdf21('0xe')]||null:null,'limit':0x1,'order':_0x3a0115['options']?_0x3a0115[_0xdf21('0x7')][_0xdf21('0x25')]||null:null,'group':db['CmHopper'][_0xdf21('0x2d')],'transaction':_0xdfbdac,'lock':_0xdfbdac[_0xdf21('0x26')][_0xdf21('0x27')],'include':_0x3a0115[_0xdf21('0x7')]?_0x3a0115[_0xdf21('0x7')][_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x3a0115[_0xdf21('0x7')][_0xdf21('0xb')],function(_0x6c644f){return{'model':db[_0x6c644f[_0xdf21('0xd')]],'as':_0x6c644f['as'],'attributes':_0x6c644f[_0xdf21('0xe')],'include':_0x6c644f[_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x6c644f[_0xdf21('0xb')],function(_0x1f4822){return{'model':db[_0x1f4822[_0xdf21('0xd')]],'as':_0x1f4822['as'],'attributes':_0x1f4822['attributes'],'include':_0x1f4822[_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x1f4822[_0xdf21('0xb')],function(_0x5f2767){return{'model':db[_0x5f2767[_0xdf21('0xd')]],'as':_0x5f2767['as'],'attributes':_0x5f2767[_0xdf21('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26ae35){var _0x3cd843=[];for(var _0x2bc121=0x0;_0x2bc121<_0x26ae35[_0xdf21('0x2c')];_0x2bc121+=0x1){_0x3cd843[_0xdf21('0x30')](_0x26ae35[_0x2bc121][_0xdf21('0x2e')](_0x3a0115['body'],{'transaction':_0xdfbdac}));}return BPromise[_0xdf21('0x31')](_0x3cd843);});})['then'](function(_0x4fd12f){logger[_0xdf21('0x10')]('GetContactRecallMe',_0x3a0115);logger[_0xdf21('0x18')]('GetContactRecallMe',_0x3a0115,JSON[_0xdf21('0x12')](_0x4fd12f));_0x2d7511(_0x4fd12f);})[_0xdf21('0x13')](function(_0x237ba7){logger['error'](_0xdf21('0x41'),_0x237ba7[_0xdf21('0x15')],_0x3a0115);_0x391003(_0x3ddb06[_0xdf21('0x14')](0x1f4,_0x237ba7[_0xdf21('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x1a36ef){var _0x3145d1=this;return new Promise(function(_0x557598,_0x233ca1){db['CmContact'][_0xdf21('0x22')]()['then'](function(_0x3f8acb){return db['CmHopper'][_0xdf21('0x38')]({'raw':_0x1a36ef[_0xdf21('0x7')]?_0x1a36ef['options'][_0xdf21('0x8')]===undefined?!![]:![]:!![],'where':_0x1a36ef['options']?_0x1a36ef[_0xdf21('0x7')][_0xdf21('0x9')]||null:null,'attributes':_0x1a36ef[_0xdf21('0x7')]?_0x1a36ef[_0xdf21('0x7')]['attributes']||null:null,'limit':_0x1a36ef[_0xdf21('0x7')]?_0x1a36ef[_0xdf21('0x7')]['limit']||null:null,'include':_0x1a36ef[_0xdf21('0x7')]?_0x1a36ef[_0xdf21('0x7')][_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x1a36ef[_0xdf21('0x7')][_0xdf21('0xb')],function(_0x410941){return{'model':db[_0x410941['model']],'as':_0x410941['as'],'attributes':_0x410941['as']==='Contact'?_[_0xdf21('0x29')](_0x3f8acb):_0x410941[_0xdf21('0xe')],'include':_0x410941[_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x410941[_0xdf21('0xb')],function(_0x9a83e8){return{'model':db[_0x9a83e8[_0xdf21('0xd')]],'as':_0x9a83e8['as'],'attributes':_0x9a83e8[_0xdf21('0xe')],'include':_0x9a83e8[_0xdf21('0xb')]?_[_0xdf21('0xc')](_0x9a83e8[_0xdf21('0xb')],function(_0x44b09e){return{'model':db[_0x44b09e[_0xdf21('0xd')]],'as':_0x44b09e['as'],'attributes':_0x44b09e[_0xdf21('0xe')]};}):[]};}):[]};}):[]:[]})[_0xdf21('0xf')](function(_0xa8b4d5){logger['info'](_0xdf21('0x11'),_0x1a36ef);logger[_0xdf21('0x18')](_0xdf21('0x11'),_0x1a36ef,JSON['stringify'](_0xa8b4d5));_0x557598(_0xa8b4d5);})[_0xdf21('0x13')](function(_0x2cbf10){logger[_0xdf21('0x14')]('GetCmHopper',_0x2cbf10[_0xdf21('0x15')],_0x1a36ef);_0x233ca1(_0x3145d1[_0xdf21('0x14')](0x1f4,_0x2cbf10['message']));});});});};exports[_0xdf21('0x42')]=function(_0xc89336){var _0x2e6f2f=this;return new Promise(function(_0x5ee58b,_0x5d3f18){return db[_0xdf21('0x21')][_0xdf21('0x43')]({'raw':!![],'where':{'phone':_0xc89336[_0xdf21('0x7')][_0xdf21('0x9')][_0xdf21('0x44')]},'attributes':['id',_0xdf21('0x45')],'order':[['id','DESC']]})[_0xdf21('0xf')](function(_0x386a1f){logger[_0xdf21('0x10')](_0xdf21('0x46'),_0xc89336);logger[_0xdf21('0x18')](_0xdf21('0x46'),_0xc89336,JSON[_0xdf21('0x12')](_0x386a1f));_0x5ee58b(_0x386a1f);})[_0xdf21('0x13')](function(_0x478ea0){logger[_0xdf21('0x14')]('getContactByPhone',_0x478ea0[_0xdf21('0x15')],_0xc89336);_0x5d3f18(_0x2e6f2f[_0xdf21('0x14')](0x1f4,_0x478ea0[_0xdf21('0x15')]));});});};exports['ResetActiveCalls']=function(_0x28402d){var _0x2830b3=this;return new Promise(function(_0x16c0d6,_0x11a36c){return db[_0xdf21('0x23')][_0xdf21('0x24')](function(_0x331a1a){var _0x40b78f=_0x28402d[_0xdf21('0x7')]&&_0x28402d['options']['where']?_0x28402d[_0xdf21('0x7')][_0xdf21('0x9')]:{};return db[_0xdf21('0x6')][_0xdf21('0x2e')](_0x28402d[_0xdf21('0x1a')],{'where':_0x40b78f,'transaction':_0x331a1a})['then'](function(_0x99c093){logger[_0xdf21('0x10')](_0xdf21('0x47'),_0x28402d);logger[_0xdf21('0x18')]('ResetActiveCalls',_0x28402d,JSON[_0xdf21('0x12')](_0x99c093));_0x16c0d6(_0x99c093);})['catch'](function(_0x126207){logger[_0xdf21('0x14')](_0xdf21('0x47'),_0x126207['message'],_0x28402d);_0x11a36c(_0x2830b3[_0xdf21('0x14')](0x1f4,_0x126207['message']));});});});};exports[_0xdf21('0x48')]=function(_0x5d88af){var _0x57a7da=this;var _0x3916d4=_0x5d88af['body'][_0xdf21('0x9')][_0xdf21('0x49')];var _0x17796d=_0x5d88af[_0xdf21('0x1a')][_0xdf21('0x9')]['interval'];var _0x5358de=_0x5d88af[_0xdf21('0x1a')][_0xdf21('0x9')][_0xdf21('0x4a')];return new Promise(function(_0x56aadc,_0x447391){return db[_0xdf21('0x6')]['findAll']({'where':{'voiceQueueId':{'$in':_0x3916d4},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xdf21('0x23')][_0xdf21('0x3a')]('NOW()\x20+\x20INTERVAL\x20'+_0x17796d+_0xdf21('0x4b')),'$gt':db[_0xdf21('0x23')][_0xdf21('0x3a')](_0xdf21('0x4c'))}},'UserId':{'$in':_0x5358de}},'include':[{'model':db['CmContact'],'as':_0xdf21('0x28')},{'model':db[_0xdf21('0x2a')],'as':'Agent','attributes':['id',_0xdf21('0x2b'),_0xdf21('0x4d')]},{'model':db[_0xdf21('0x4e')],'as':'List'}]})[_0xdf21('0xf')](function(_0x5bd5db){if(_0x5bd5db[_0xdf21('0x2c')]>0x0){return db[_0xdf21('0x23')][_0xdf21('0x24')](function(_0x505e47){return db['CmHopper'][_0xdf21('0x2e')]({'recallmeNotifiedDate':db['sequelize'][_0xdf21('0x3a')](_0xdf21('0x4c'))},{'where':{'id':{'$in':_[_0xdf21('0xc')](_0x5bd5db,'id')}},'transaction':_0x505e47})[_0xdf21('0xf')](function(){_0x56aadc(_0x5bd5db);})[_0xdf21('0x13')](function(_0x6c5a06){logger[_0xdf21('0x14')](_0xdf21('0x48'),_0x6c5a06[_0xdf21('0x15')],_0x5d88af);_0x447391(_0x57a7da[_0xdf21('0x14')](0x1f4,_0x6c5a06[_0xdf21('0x15')]));});})['catch'](function(_0xba769){logger[_0xdf21('0x14')](_0xdf21('0x48'),_0xba769['message'],_0x5d88af);_0x447391(_0x57a7da[_0xdf21('0x14')](0x1f4,_0xba769[_0xdf21('0x15')]));});}else{_0x56aadc(_0x5bd5db);}});});}; \ No newline at end of file +var _0x636c=['map','then','GetCmHopper','stringify','error','message','ShowCmHopper','CmHopper','find','info','debug','catch','CreateCmHopper','create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','CmContact','describe','transaction','findAll','limit','order','LOCK','UPDATE','Contact','keys','User','Agent','name','length','UserId','push','update','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','sequelize','CmHopperFinal','active','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','NOW()','voicePause','CmList','List','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','options','raw','where','attributes','include','model'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x636c,0x198));var _0xc636=function(_0x797be7,_0x5c1293){_0x797be7=_0x797be7-0x0;var _0x27d2fa=_0x636c[_0x797be7];return _0x27d2fa;};'use strict';var _=require(_0xc636('0x0'));var util=require('util');var moment=require(_0xc636('0x1'));var BPromise=require(_0xc636('0x2'));var db=require(_0xc636('0x3'))['db'];var logger=require(_0xc636('0x4'))(_0xc636('0x5'));exports['GetCmHopper']=function(_0x7f9ea5){var _0x3f6dad=this;return new Promise(function(_0x58c212,_0x1a65ee){return db['CmHopper']['findAll']({'raw':_0x7f9ea5[_0xc636('0x6')]?_0x7f9ea5[_0xc636('0x6')][_0xc636('0x7')]===undefined?!![]:![]:!![],'where':_0x7f9ea5[_0xc636('0x6')]?_0x7f9ea5[_0xc636('0x6')][_0xc636('0x8')]||null:null,'attributes':_0x7f9ea5[_0xc636('0x6')]?_0x7f9ea5[_0xc636('0x6')][_0xc636('0x9')]||null:null,'limit':_0x7f9ea5[_0xc636('0x6')]?_0x7f9ea5[_0xc636('0x6')]['limit']||null:null,'include':_0x7f9ea5['options']?_0x7f9ea5[_0xc636('0x6')][_0xc636('0xa')]?_['map'](_0x7f9ea5[_0xc636('0x6')][_0xc636('0xa')],function(_0x3eac2a){return{'model':db[_0x3eac2a[_0xc636('0xb')]],'as':_0x3eac2a['as'],'attributes':_0x3eac2a[_0xc636('0x9')],'include':_0x3eac2a[_0xc636('0xa')]?_[_0xc636('0xc')](_0x3eac2a[_0xc636('0xa')],function(_0x337fd9){return{'model':db[_0x337fd9[_0xc636('0xb')]],'as':_0x337fd9['as'],'attributes':_0x337fd9[_0xc636('0x9')],'include':_0x337fd9[_0xc636('0xa')]?_['map'](_0x337fd9[_0xc636('0xa')],function(_0xec5166){return{'model':db[_0xec5166[_0xc636('0xb')]],'as':_0xec5166['as'],'attributes':_0xec5166[_0xc636('0x9')]};}):[]};}):[]};}):[]:[]})[_0xc636('0xd')](function(_0x121634){logger['info']('GetCmHopper',_0x7f9ea5);logger['debug'](_0xc636('0xe'),_0x7f9ea5,JSON[_0xc636('0xf')](_0x121634));_0x58c212(_0x121634);})['catch'](function(_0x2f516a){logger[_0xc636('0x10')](_0xc636('0xe'),_0x2f516a[_0xc636('0x11')],_0x7f9ea5);_0x1a65ee(_0x3f6dad[_0xc636('0x10')](0x1f4,_0x2f516a[_0xc636('0x11')]));});});};exports[_0xc636('0x12')]=function(_0x30440b){var _0x24880a=this;return new Promise(function(_0x3bde69,_0x4b4221){return db[_0xc636('0x13')][_0xc636('0x14')]({'raw':_0x30440b[_0xc636('0x6')]?_0x30440b[_0xc636('0x6')][_0xc636('0x7')]===undefined?!![]:![]:!![],'where':_0x30440b[_0xc636('0x6')]?_0x30440b['options'][_0xc636('0x8')]||null:null,'attributes':_0x30440b['options']?_0x30440b['options'][_0xc636('0x9')]||null:null,'include':_0x30440b[_0xc636('0x6')]?_0x30440b['options'][_0xc636('0xa')]?_[_0xc636('0xc')](_0x30440b[_0xc636('0x6')][_0xc636('0xa')],function(_0xdbc6e7){return{'model':db[_0xdbc6e7['model']],'as':_0xdbc6e7['as'],'attributes':_0xdbc6e7[_0xc636('0x9')],'include':_0xdbc6e7[_0xc636('0xa')]?_['map'](_0xdbc6e7[_0xc636('0xa')],function(_0x838954){return{'model':db[_0x838954['model']],'as':_0x838954['as'],'attributes':_0x838954[_0xc636('0x9')],'include':_0x838954[_0xc636('0xa')]?_[_0xc636('0xc')](_0x838954[_0xc636('0xa')],function(_0x89f71e){return{'model':db[_0x89f71e[_0xc636('0xb')]],'as':_0x89f71e['as'],'attributes':_0x89f71e[_0xc636('0x9')]};}):[]};}):[]};}):[]:[]})[_0xc636('0xd')](function(_0x327fae){logger[_0xc636('0x15')](_0xc636('0x12'),_0x30440b);logger[_0xc636('0x16')](_0xc636('0x12'),_0x30440b,JSON['stringify'](_0x327fae));_0x3bde69(_0x327fae);})[_0xc636('0x17')](function(_0x13be53){logger['error'](_0xc636('0x12'),_0x13be53[_0xc636('0x11')],_0x30440b);_0x4b4221(_0x24880a[_0xc636('0x10')](0x1f4,_0x13be53[_0xc636('0x11')]));});});};exports[_0xc636('0x18')]=function(_0x4733c6){var _0x53c083=this;return new Promise(function(_0x5b464d,_0x3dd950){return db[_0xc636('0x13')][_0xc636('0x19')](_0x4733c6[_0xc636('0x1a')],{'raw':_0x4733c6[_0xc636('0x6')]?_0x4733c6[_0xc636('0x6')][_0xc636('0x7')]===undefined?!![]:![]:!![]})[_0xc636('0xd')](function(_0x3c6aa8){logger[_0xc636('0x15')](_0xc636('0x18'),_0x4733c6);logger[_0xc636('0x16')](_0xc636('0x18'),_0x4733c6,JSON[_0xc636('0xf')](_0x3c6aa8));_0x5b464d(_0x3c6aa8);})['catch'](function(_0x149501){logger[_0xc636('0x10')](_0xc636('0x18'),_0x149501[_0xc636('0x11')],_0x4733c6);_0x3dd950(_0x53c083[_0xc636('0x10')](0x1f4,_0x149501['message']));});});};exports['UpdateCmHopper']=function(_0x5d854b){var _0x434a58=this;return new Promise(function(_0xe40352,_0x5232f2){return db[_0xc636('0x13')]['update'](_0x5d854b[_0xc636('0x1a')],{'raw':_0x5d854b[_0xc636('0x6')]?_0x5d854b['options'][_0xc636('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d854b[_0xc636('0x6')]?_0x5d854b[_0xc636('0x6')][_0xc636('0x8')]||null:null,'attributes':_0x5d854b[_0xc636('0x6')]?_0x5d854b[_0xc636('0x6')]['attributes']||null:null,'limit':_0x5d854b['options']?_0x5d854b[_0xc636('0x6')]['limit']||null:null})[_0xc636('0xd')](function(_0x211d91){logger[_0xc636('0x15')](_0xc636('0x1b'),_0x5d854b);logger[_0xc636('0x15')](_0xc636('0x1c'),JSON['stringify'](_0x5d854b['options'][_0xc636('0x8')]),_0x5d854b[_0xc636('0x1a')]['active']);logger[_0xc636('0x16')]('UpdateCmHopper',_0x5d854b,JSON['stringify'](_0x211d91));_0xe40352(_0x211d91);})[_0xc636('0x17')](function(_0x235423){logger['error'](_0xc636('0x1b'),_0x235423[_0xc636('0x11')],_0x5d854b);_0x5232f2(_0x434a58['error'](0x1f4,_0x235423[_0xc636('0x11')]));});});};exports['DestroyCmHopper']=function(_0x2a6563){var _0x189209=this;return new Promise(function(_0x4a93c0,_0x213159){return db['CmHopper']['destroy']({'where':_0x2a6563[_0xc636('0x6')]?_0x2a6563[_0xc636('0x6')][_0xc636('0x8')]||null:null})[_0xc636('0xd')](function(_0x21d29d){logger[_0xc636('0x15')](_0xc636('0x1d'),_0x2a6563);logger['debug'](_0xc636('0x1d'),_0x2a6563,JSON[_0xc636('0xf')](_0x21d29d));_0x4a93c0(_0x21d29d);})['catch'](function(_0x184faa){logger[_0xc636('0x10')](_0xc636('0x1d'),_0x184faa['message'],_0x2a6563);_0x213159(_0x189209[_0xc636('0x10')](0x1f4,_0x184faa[_0xc636('0x11')]));});});};exports['GetContactDialer']=function(_0x30c330){var _0x460e25=this;return new Promise(function(_0x203023,_0x2c3150){return db[_0xc636('0x1e')][_0xc636('0x1f')]()[_0xc636('0xd')](function(_0xac97cd){return db['sequelize'][_0xc636('0x20')](function(_0x3fdf90){return db['CmHopper'][_0xc636('0x21')]({'where':_0x30c330[_0xc636('0x6')]?_0x30c330[_0xc636('0x6')]['where']||null:null,'attributes':_0x30c330['options']?_0x30c330['options'][_0xc636('0x9')]||null:null,'limit':_0x30c330[_0xc636('0x6')]?_0x30c330[_0xc636('0x6')][_0xc636('0x22')]||null:null,'order':_0x30c330[_0xc636('0x6')]?_0x30c330[_0xc636('0x6')][_0xc636('0x23')]||null:null,'transaction':_0x3fdf90,'lock':_0x3fdf90[_0xc636('0x24')][_0xc636('0x25')],'include':[{'model':db[_0xc636('0x1e')],'as':_0xc636('0x26'),'attributes':_[_0xc636('0x27')](_0xac97cd)},{'model':db[_0xc636('0x28')],'as':_0xc636('0x29'),'attributes':['id',_0xc636('0x2a'),'voicePause']}]})[_0xc636('0xd')](function(_0x205551){var _0x4e066e=[];var _0x28b514=[];for(var _0x290e0a=0x0;_0x290e0a<_0x205551[_0xc636('0x2b')];_0x290e0a+=0x1){var _0x2aa7a9=_0x205551[_0x290e0a][_0xc636('0x2c')];if(_0x2aa7a9===null){_0x4e066e[_0xc636('0x2d')](_0x205551[_0x290e0a][_0xc636('0x2e')](_0x30c330[_0xc636('0x1a')],{'transaction':_0x3fdf90}));}else if(!_0x28b514[_0xc636('0x2f')](_0x2aa7a9)){_0x28b514[_0xc636('0x2d')](_0x2aa7a9);_0x4e066e['push'](_0x205551[_0x290e0a][_0xc636('0x2e')](_0x30c330[_0xc636('0x1a')],{'transaction':_0x3fdf90}));}}return BPromise[_0xc636('0x30')](_0x4e066e);});})['then'](function(_0x2fa41f){logger['info'](_0xc636('0x31'),_0x30c330);if(_0x2fa41f[_0xc636('0x2b')]>0x0){logger[_0xc636('0x15')](_0xc636('0x32'),_0x2fa41f[0x0][_0xc636('0x33')]['id'],_0x2fa41f[0x0]['dataValues'][_0xc636('0x34')],_0x2fa41f[0x0][_0xc636('0x33')]['active']);}logger[_0xc636('0x16')]('GetContactDialer',_0x30c330,JSON[_0xc636('0xf')](_0x2fa41f));_0x203023(_0x2fa41f);})[_0xc636('0x17')](function(_0x9553c2){logger['error'](_0xc636('0x31'),_0x9553c2[_0xc636('0x11')],_0x30c330);_0x2c3150(_0x460e25[_0xc636('0x10')](0x1f4,_0x9553c2[_0xc636('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x5a2e7c){var _0xd09851=this;return new Promise(function(_0x26f9db,_0x223364){return db[_0xc636('0x35')][_0xc636('0x20')](function(_0x3ec136){return db[_0xc636('0x36')][_0xc636('0x19')](_0x5a2e7c[_0xc636('0x1a')],{'raw':_0x5a2e7c['options']?_0x5a2e7c['options'][_0xc636('0x7')]===undefined?!![]:![]:!![],'transaction':_0x3ec136})['then'](function(){logger[_0xc636('0x15')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xc636('0xf')](_0x5a2e7c[_0xc636('0x6')][_0xc636('0x8')]),_0x5a2e7c[_0xc636('0x6')][_0xc636('0x8')][_0xc636('0x37')]);return db[_0xc636('0x13')][_0xc636('0x38')]({'where':_0x5a2e7c[_0xc636('0x6')]?_0x5a2e7c[_0xc636('0x6')][_0xc636('0x8')]||null:null,'transaction':_0x3ec136});});})[_0xc636('0xd')](function(_0x2dc62e){logger[_0xc636('0x15')](_0xc636('0x39'),_0x5a2e7c);logger['debug'](_0xc636('0x39'),_0x5a2e7c,JSON[_0xc636('0xf')](_0x2dc62e));_0x26f9db(_0x2dc62e);})[_0xc636('0x17')](function(_0x3179f3){logger['error'](_0xc636('0x39'),_0x3179f3[_0xc636('0x11')],_0x5a2e7c);_0x223364(_0xd09851['error'](0x1f4,_0x3179f3['message']));});});};exports[_0xc636('0x3a')]=function(_0xd89ca4){var _0x146dbf=this;return new Promise(function(_0x168688,_0x19f03e){return db['CmHopper'][_0xc636('0x21')]({'raw':_0xd89ca4[_0xc636('0x6')]?_0xd89ca4[_0xc636('0x6')][_0xc636('0x7')]===undefined?!![]:![]:!![],'where':_0xd89ca4['options']?_0xd89ca4[_0xc636('0x6')][_0xc636('0x8')]||null:null,'attributes':[[db[_0xc636('0x35')]['fn'](_0xc636('0x3b'),db[_0xc636('0x35')]['fn']('IF',db[_0xc636('0x35')][_0xc636('0x3c')](_0xc636('0x3d')+util[_0xc636('0x3e')](_0xc636('0x3f'),moment()['format'](_0xc636('0x40')))+_0xc636('0x41')))),_0xc636('0x42')]]})[_0xc636('0xd')](function(_0x1f2a05){logger['info'](_0xc636('0x3a'),_0xd89ca4);logger['debug'](_0xc636('0x3a'),_0xd89ca4,JSON[_0xc636('0xf')](_0x1f2a05));_0x168688(_0x1f2a05);})['catch'](function(_0x1d1e3f){logger['error'](_0xc636('0x3a'),_0x1d1e3f[_0xc636('0x11')],_0xd89ca4);_0x19f03e(_0x146dbf[_0xc636('0x10')](0x1f4,_0x1d1e3f[_0xc636('0x11')]));});});};exports['GetContactRecallMe']=function(_0x77af2a){var _0x6468f4=this;return new Promise(function(_0x422a4b,_0x2a6cce){return db[_0xc636('0x1e')]['describe']()[_0xc636('0xd')](function(){return db[_0xc636('0x35')][_0xc636('0x20')](function(_0x57603b){return db[_0xc636('0x13')][_0xc636('0x21')]({'where':_0x77af2a['options']?_0x77af2a[_0xc636('0x6')][_0xc636('0x8')]||null:null,'attributes':_0x77af2a[_0xc636('0x6')]?_0x77af2a['options']['attributes']||null:null,'limit':0x1,'order':_0x77af2a[_0xc636('0x6')]?_0x77af2a[_0xc636('0x6')]['order']||null:null,'group':db['CmHopper'][_0xc636('0x2c')],'transaction':_0x57603b,'lock':_0x57603b['LOCK'][_0xc636('0x25')],'include':_0x77af2a[_0xc636('0x6')]?_0x77af2a[_0xc636('0x6')]['include']?_['map'](_0x77af2a[_0xc636('0x6')]['include'],function(_0x4b2f58){return{'model':db[_0x4b2f58[_0xc636('0xb')]],'as':_0x4b2f58['as'],'attributes':_0x4b2f58[_0xc636('0x9')],'include':_0x4b2f58[_0xc636('0xa')]?_[_0xc636('0xc')](_0x4b2f58[_0xc636('0xa')],function(_0x147406){return{'model':db[_0x147406[_0xc636('0xb')]],'as':_0x147406['as'],'attributes':_0x147406[_0xc636('0x9')],'include':_0x147406['include']?_[_0xc636('0xc')](_0x147406[_0xc636('0xa')],function(_0x410327){return{'model':db[_0x410327[_0xc636('0xb')]],'as':_0x410327['as'],'attributes':_0x410327[_0xc636('0x9')]};}):[]};}):[]};}):[]:[]})[_0xc636('0xd')](function(_0x27fe6f){var _0x320126=[];for(var _0x39e000=0x0;_0x39e000<_0x27fe6f[_0xc636('0x2b')];_0x39e000+=0x1){_0x320126['push'](_0x27fe6f[_0x39e000][_0xc636('0x2e')](_0x77af2a[_0xc636('0x1a')],{'transaction':_0x57603b}));}return BPromise['all'](_0x320126);});})[_0xc636('0xd')](function(_0x5f226d){logger[_0xc636('0x15')]('GetContactRecallMe',_0x77af2a);logger[_0xc636('0x16')]('GetContactRecallMe',_0x77af2a,JSON['stringify'](_0x5f226d));_0x422a4b(_0x5f226d);})['catch'](function(_0x559ce3){logger['error']('GetContactRecallMe',_0x559ce3[_0xc636('0x11')],_0x77af2a);_0x2a6cce(_0x6468f4[_0xc636('0x10')](0x1f4,_0x559ce3['message']));});});});};exports[_0xc636('0x43')]=function(_0x2dc3b9){var _0x3f8df2=this;return new Promise(function(_0x7183be,_0xedc36f){db[_0xc636('0x1e')][_0xc636('0x1f')]()[_0xc636('0xd')](function(_0x5e69d0){return db[_0xc636('0x13')]['findAll']({'raw':_0x2dc3b9[_0xc636('0x6')]?_0x2dc3b9[_0xc636('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x2dc3b9[_0xc636('0x6')]?_0x2dc3b9['options']['where']||null:null,'attributes':_0x2dc3b9['options']?_0x2dc3b9[_0xc636('0x6')][_0xc636('0x9')]||null:null,'limit':_0x2dc3b9[_0xc636('0x6')]?_0x2dc3b9[_0xc636('0x6')]['limit']||null:null,'include':_0x2dc3b9[_0xc636('0x6')]?_0x2dc3b9[_0xc636('0x6')][_0xc636('0xa')]?_[_0xc636('0xc')](_0x2dc3b9[_0xc636('0x6')]['include'],function(_0xd8ffc1){return{'model':db[_0xd8ffc1['model']],'as':_0xd8ffc1['as'],'attributes':_0xd8ffc1['as']==='Contact'?_['keys'](_0x5e69d0):_0xd8ffc1[_0xc636('0x9')],'include':_0xd8ffc1['include']?_[_0xc636('0xc')](_0xd8ffc1[_0xc636('0xa')],function(_0x35e2de){return{'model':db[_0x35e2de[_0xc636('0xb')]],'as':_0x35e2de['as'],'attributes':_0x35e2de[_0xc636('0x9')],'include':_0x35e2de[_0xc636('0xa')]?_[_0xc636('0xc')](_0x35e2de[_0xc636('0xa')],function(_0x5c2143){return{'model':db[_0x5c2143['model']],'as':_0x5c2143['as'],'attributes':_0x5c2143['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x39306d){logger['info'](_0xc636('0xe'),_0x2dc3b9);logger[_0xc636('0x16')](_0xc636('0xe'),_0x2dc3b9,JSON['stringify'](_0x39306d));_0x7183be(_0x39306d);})['catch'](function(_0xaed83f){logger[_0xc636('0x10')](_0xc636('0xe'),_0xaed83f[_0xc636('0x11')],_0x2dc3b9);_0xedc36f(_0x3f8df2[_0xc636('0x10')](0x1f4,_0xaed83f[_0xc636('0x11')]));});});});};exports[_0xc636('0x44')]=function(_0x4617d0){var _0x5f3e34=this;return new Promise(function(_0x2e1a40,_0x7b0b90){return db['CmContact'][_0xc636('0x45')]({'raw':!![],'where':{'phone':_0x4617d0[_0xc636('0x6')][_0xc636('0x8')][_0xc636('0x46')]},'attributes':['id',_0xc636('0x47')],'order':[['id',_0xc636('0x48')]]})[_0xc636('0xd')](function(_0x1c1c0a){logger[_0xc636('0x15')]('getContactByPhone',_0x4617d0);logger[_0xc636('0x16')]('getContactByPhone',_0x4617d0,JSON['stringify'](_0x1c1c0a));_0x2e1a40(_0x1c1c0a);})[_0xc636('0x17')](function(_0x14433b){logger[_0xc636('0x10')](_0xc636('0x49'),_0x14433b[_0xc636('0x11')],_0x4617d0);_0x7b0b90(_0x5f3e34[_0xc636('0x10')](0x1f4,_0x14433b['message']));});});};exports[_0xc636('0x4a')]=function(_0x4911b8){var _0x338b99=this;return new Promise(function(_0x22d742,_0x1932cf){return db[_0xc636('0x35')][_0xc636('0x20')](function(_0x42c8da){var _0x2d6a10=_0x4911b8['options']&&_0x4911b8[_0xc636('0x6')][_0xc636('0x8')]?_0x4911b8[_0xc636('0x6')][_0xc636('0x8')]:{};return db['CmHopper'][_0xc636('0x2e')](_0x4911b8[_0xc636('0x1a')],{'where':_0x2d6a10,'transaction':_0x42c8da})[_0xc636('0xd')](function(_0x45400c){logger['info']('ResetActiveCalls',_0x4911b8);logger[_0xc636('0x16')]('ResetActiveCalls',_0x4911b8,JSON[_0xc636('0xf')](_0x45400c));_0x22d742(_0x45400c);})[_0xc636('0x17')](function(_0x286f52){logger[_0xc636('0x10')](_0xc636('0x4a'),_0x286f52[_0xc636('0x11')],_0x4911b8);_0x1932cf(_0x338b99[_0xc636('0x10')](0x1f4,_0x286f52[_0xc636('0x11')]));});});});};exports[_0xc636('0x4b')]=function(_0x1cc54c){var _0x3c7819=this;var _0x2b2af9=_0x1cc54c[_0xc636('0x1a')]['where'][_0xc636('0x4c')];var _0x2d7eee=_0x1cc54c['body'][_0xc636('0x8')][_0xc636('0x4d')];var _0x481f95=_0x1cc54c[_0xc636('0x1a')][_0xc636('0x8')][_0xc636('0x4e')];return new Promise(function(_0x6282a0,_0x606476){return db[_0xc636('0x13')][_0xc636('0x21')]({'where':{'voiceQueueId':{'$in':_0x2b2af9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xc636('0x35')][_0xc636('0x3c')]('NOW()\x20+\x20INTERVAL\x20'+_0x2d7eee+_0xc636('0x4f')),'$gt':db[_0xc636('0x35')]['literal'](_0xc636('0x50'))}},'UserId':{'$in':_0x481f95}},'include':[{'model':db[_0xc636('0x1e')],'as':'Contact'},{'model':db['User'],'as':_0xc636('0x29'),'attributes':['id',_0xc636('0x2a'),_0xc636('0x51')]},{'model':db[_0xc636('0x52')],'as':_0xc636('0x53')}]})[_0xc636('0xd')](function(_0x1e74ad){if(_0x1e74ad[_0xc636('0x2b')]>0x0){return db[_0xc636('0x35')]['transaction'](function(_0x3a177f){return db[_0xc636('0x13')][_0xc636('0x2e')]({'recallmeNotifiedDate':db[_0xc636('0x35')][_0xc636('0x3c')]('NOW()')},{'where':{'id':{'$in':_[_0xc636('0xc')](_0x1e74ad,'id')}},'transaction':_0x3a177f})['then'](function(){_0x6282a0(_0x1e74ad);})[_0xc636('0x17')](function(_0x529003){logger[_0xc636('0x10')](_0xc636('0x4b'),_0x529003[_0xc636('0x11')],_0x1cc54c);_0x606476(_0x3c7819['error'](0x1f4,_0x529003[_0xc636('0x11')]));});})[_0xc636('0x17')](function(_0x3956cb){logger[_0xc636('0x10')](_0xc636('0x4b'),_0x3956cb['message'],_0x1cc54c);_0x606476(_0x3c7819[_0xc636('0x10')](0x1f4,_0x3956cb[_0xc636('0x11')]));});}else{_0x6282a0(_0x1e74ad);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index ad069d1..fb0999e 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 _0xfe65=['./cmHopper.controller','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','create','post','getPreview','/timezone','getTimezone','put','update','delete','exports','express'];(function(_0x47bfff,_0x20f3c3){var _0x2f7c23=function(_0x18b433){while(--_0x18b433){_0x47bfff['push'](_0x47bfff['shift']());}};_0x2f7c23(++_0x20f3c3);}(_0xfe65,0xe5));var _0x5fe6=function(_0x76a667,_0x456b95){_0x76a667=_0x76a667-0x0;var _0xaac135=_0xfe65[_0x76a667];return _0xaac135;};'use strict';var express=require(_0x5fe6('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x5fe6('0x1'));router['get']('/',auth[_0x5fe6('0x2')](),controller[_0x5fe6('0x3')]);router[_0x5fe6('0x4')](_0x5fe6('0x5'),auth[_0x5fe6('0x2')](),controller['describe']);router[_0x5fe6('0x4')](_0x5fe6('0x6'),auth['isAuthenticated'](),controller[_0x5fe6('0x7')]);router['get'](_0x5fe6('0x8'),auth[_0x5fe6('0x2')](),controller[_0x5fe6('0x9')]);router[_0x5fe6('0x4')](_0x5fe6('0xa'),auth[_0x5fe6('0x2')](),controller[_0x5fe6('0xb')]);router['get'](_0x5fe6('0xc'),auth['isAuthenticated'](),controller[_0x5fe6('0xd')]);router['post']('/',auth[_0x5fe6('0x2')](),controller[_0x5fe6('0xe')]);router[_0x5fe6('0xf')]('/preview',auth[_0x5fe6('0x2')](),controller[_0x5fe6('0x10')]);router[_0x5fe6('0xf')](_0x5fe6('0x11'),auth[_0x5fe6('0x2')](),controller[_0x5fe6('0x12')]);router[_0x5fe6('0x13')](_0x5fe6('0xa'),auth[_0x5fe6('0x2')](),controller[_0x5fe6('0x14')]);router[_0x5fe6('0x15')](_0x5fe6('0xa'),auth[_0x5fe6('0x2')](),controller['destroy']);module[_0x5fe6('0x16')]=router; \ No newline at end of file +var _0x0852=['../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router'];(function(_0xf8c8f5,_0x21c735){var _0x2691c4=function(_0x201865){while(--_0x201865){_0xf8c8f5['push'](_0xf8c8f5['shift']());}};_0x2691c4(++_0x21c735);}(_0x0852,0x16a));var _0x2085=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x0852[_0x500419];return _0x241c1a;};'use strict';var express=require(_0x2085('0x0'));var router=express[_0x2085('0x1')]();var auth=require(_0x2085('0x2'));var controller=require(_0x2085('0x3'));router[_0x2085('0x4')]('/',auth[_0x2085('0x5')](),controller[_0x2085('0x6')]);router[_0x2085('0x4')](_0x2085('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x2085('0x4')](_0x2085('0x8'),auth[_0x2085('0x5')](),controller[_0x2085('0x9')]);router[_0x2085('0x4')](_0x2085('0xa'),auth[_0x2085('0x5')](),controller[_0x2085('0xb')]);router[_0x2085('0x4')](_0x2085('0xc'),auth['isAuthenticated'](),controller[_0x2085('0xd')]);router[_0x2085('0x4')](_0x2085('0xe'),auth['isAuthenticated'](),controller[_0x2085('0xf')]);router[_0x2085('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2085('0x10')](_0x2085('0x11'),auth['isAuthenticated'](),controller[_0x2085('0x12')]);router[_0x2085('0x10')](_0x2085('0x13'),auth['isAuthenticated'](),controller[_0x2085('0x14')]);router[_0x2085('0x15')](_0x2085('0xc'),auth[_0x2085('0x5')](),controller[_0x2085('0x16')]);router[_0x2085('0x17')]('/:id',auth[_0x2085('0x5')](),controller[_0x2085('0x18')]);module[_0x2085('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 4d07628..b4fd6a6 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 _0xed93=['exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x5deec8,_0x5530f9){var _0x50cf5f=function(_0x44ce43){while(--_0x44ce43){_0x5deec8['push'](_0x5deec8['shift']());}};_0x50cf5f(++_0x5530f9);}(_0xed93,0x1f0));var _0x3ed9=function(_0x4d9497,_0x3e2eb6){_0x4d9497=_0x4d9497-0x0;var _0x2a48b1=_0xed93[_0x4d9497];return _0x2a48b1;};'use strict';var moment=require(_0x3ed9('0x0'));var Sequelize=require('sequelize');module[_0x3ed9('0x1')]={'CmHopperId':{'type':Sequelize[_0x3ed9('0x2')]},'phone':{'type':Sequelize[_0x3ed9('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x3ed9('0x4')],'defaultValue':moment()[_0x3ed9('0x5')](_0x3ed9('0x6'))},'countbusyretry':{'type':Sequelize[_0x3ed9('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3ed9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3ed9('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x3ed9('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3ed9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3ed9('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3ed9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8504=['moment','sequelize','exports','STRING','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8504,0x118));var _0x4850=function(_0x1aebfe,_0xb00c5b){_0x1aebfe=_0x1aebfe-0x0;var _0x3f0f9b=_0x8504[_0x1aebfe];return _0x3f0f9b;};'use strict';var moment=require(_0x4850('0x0'));var Sequelize=require(_0x4850('0x1'));module[_0x4850('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x4850('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4850('0x5')],'defaultValue':moment()[_0x4850('0x6')](_0x4850('0x7'))},'countbusyretry':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4850('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 60df248..b1acf90 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 _0x0b8d=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','options','includeAll','include','rows','show','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation'];(function(_0x115d8d,_0xacde78){var _0x250c76=function(_0x5a5236){while(--_0x5a5236){_0x115d8d['push'](_0x115d8d['shift']());}};_0x250c76(++_0xacde78);}(_0x0b8d,0x107));var _0xd0b8=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x0b8d[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0xd0b8('0x0'));var rimraf=require(_0xd0b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0b8('0x2'));var rp=require(_0xd0b8('0x3'));var moment=require(_0xd0b8('0x4'));var BPromise=require(_0xd0b8('0x5'));var Mustache=require(_0xd0b8('0x6'));var util=require('util');var path=require(_0xd0b8('0x7'));var sox=require(_0xd0b8('0x8'));var csv=require(_0xd0b8('0x9'));var ejs=require(_0xd0b8('0xa'));var fs=require('fs');var fs_extra=require(_0xd0b8('0xb'));var _=require(_0xd0b8('0xc'));var squel=require('squel');var crypto=require(_0xd0b8('0xd'));var jsforce=require(_0xd0b8('0xe'));var deskjs=require(_0xd0b8('0xf'));var toCsv=require(_0xd0b8('0x9'));var querystring=require(_0xd0b8('0x10'));var Papa=require(_0xd0b8('0x11'));var Redis=require(_0xd0b8('0x12'));var authService=require(_0xd0b8('0x13'));var qs=require(_0xd0b8('0x14'));var as=require(_0xd0b8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0b8('0x16'))(_0xd0b8('0x17'));var utils=require(_0xd0b8('0x18'));var config=require(_0xd0b8('0x19'));var licenseUtil=require(_0xd0b8('0x1a'));var db=require(_0xd0b8('0x1b'))['db'];function respondWithStatusCode(_0x455dbd,_0x4344ad){_0x4344ad=_0x4344ad||0xcc;return function(_0x868478){if(_0x868478){return _0x455dbd['sendStatus'](_0x4344ad);}return _0x455dbd[_0xd0b8('0x1c')](_0x4344ad)[_0xd0b8('0x1d')]();};}function respondWithResult(_0x54ea72,_0x34c3d6){_0x34c3d6=_0x34c3d6||0xc8;return function(_0x426590){if(_0x426590){return _0x54ea72[_0xd0b8('0x1c')](_0x34c3d6)[_0xd0b8('0x1e')](_0x426590);}};}function respondWithFilteredResult(_0x516a0f,_0x2fcbee){return function(_0x143e20){if(_0x143e20){var _0x395734=typeof _0x2fcbee[_0xd0b8('0x1f')]===_0xd0b8('0x20')&&typeof _0x2fcbee['limit']===_0xd0b8('0x20');var _0x541b40=_0x143e20[_0xd0b8('0x21')];var _0x2b753f=_0x395734?0x0:_0x2fcbee['offset'];var _0x553a37=_0x395734?_0x143e20[_0xd0b8('0x21')]:_0x2fcbee[_0xd0b8('0x1f')]+_0x2fcbee['limit'];var _0x3a9486;if(_0x553a37>=_0x541b40){_0x553a37=_0x541b40;_0x3a9486=0xc8;}else{_0x3a9486=0xce;}_0x516a0f[_0xd0b8('0x1c')](_0x3a9486);return _0x516a0f[_0xd0b8('0x22')](_0xd0b8('0x23'),_0x2b753f+'-'+_0x553a37+'/'+_0x541b40)[_0xd0b8('0x1e')](_0x143e20);}return null;};}function patchUpdates(_0x3d8e00){return function(_0x2a71c1){try{jsonpatch[_0xd0b8('0x24')](_0x2a71c1,_0x3d8e00,!![]);}catch(_0x15b187){return BPromise[_0xd0b8('0x25')](_0x15b187);}return _0x2a71c1[_0xd0b8('0x26')]();};}function saveUpdates(_0x3aeb40,_0x1e8bc6){return function(_0x559c84){if(_0x559c84){return _0x559c84[_0xd0b8('0x27')](_0x3aeb40)[_0xd0b8('0x28')](function(_0xab2e1d){return _0xab2e1d;});}return null;};}function removeEntity(_0x51cc93,_0x530471){return function(_0x2a9e72){if(_0x2a9e72){return _0x2a9e72[_0xd0b8('0x29')]()[_0xd0b8('0x28')](function(){var _0x55e327=_0x2a9e72[_0xd0b8('0x2a')]({'plain':!![]});var _0x479443='CmHopperAdditionalPhones';return db[_0xd0b8('0x2b')]['destroy']({'where':{'type':_0x479443,'resourceId':_0x55e327['id']}})[_0xd0b8('0x28')](function(){return _0x2a9e72;});})['then'](function(){_0x51cc93[_0xd0b8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34cdba,_0x3546c8){return function(_0x385f3d){if(!_0x385f3d){_0x34cdba['sendStatus'](0x194);}return _0x385f3d;};}function handleError(_0x5f0303,_0x595010){_0x595010=_0x595010||0x1f4;return function(_0x3781e4){logger[_0xd0b8('0x2c')](_0x3781e4['stack']);if(_0x3781e4[_0xd0b8('0x2d')]){delete _0x3781e4[_0xd0b8('0x2d')];}_0x5f0303['status'](_0x595010)[_0xd0b8('0x2e')](_0x3781e4);};}exports['index']=function(_0x3eebf7,_0x37f808){var _0x8dc863={},_0x551cbf={},_0x2b9559={'count':0x0,'rows':[]};var _0x17c320=_[_0xd0b8('0x2f')](db[_0xd0b8('0x30')][_0xd0b8('0x31')],function(_0x3b3e75){return{'name':_0x3b3e75[_0xd0b8('0x32')],'type':_0x3b3e75['type'][_0xd0b8('0x33')]};});_0x551cbf['model']=_['map'](_0x17c320,_0xd0b8('0x2d'));_0x551cbf[_0xd0b8('0x34')]=_['keys'](_0x3eebf7[_0xd0b8('0x34')]);_0x551cbf[_0xd0b8('0x35')]=_['intersection'](_0x551cbf['model'],_0x551cbf[_0xd0b8('0x34')]);_0x8dc863[_0xd0b8('0x36')]=_[_0xd0b8('0x37')](_0x551cbf[_0xd0b8('0x38')],qs[_0xd0b8('0x39')](_0x3eebf7['query'][_0xd0b8('0x39')]));_0x8dc863[_0xd0b8('0x36')]=_0x8dc863[_0xd0b8('0x36')][_0xd0b8('0x3a')]?_0x8dc863[_0xd0b8('0x36')]:_0x551cbf[_0xd0b8('0x38')];if(!_0x3eebf7[_0xd0b8('0x34')][_0xd0b8('0x3b')](_0xd0b8('0x3c'))){_0x8dc863[_0xd0b8('0x3d')]=qs['limit'](_0x3eebf7[_0xd0b8('0x34')]['limit']);_0x8dc863['offset']=qs[_0xd0b8('0x1f')](_0x3eebf7[_0xd0b8('0x34')][_0xd0b8('0x1f')]);}_0x8dc863['order']=qs['sort'](_0x3eebf7[_0xd0b8('0x34')][_0xd0b8('0x3e')]);_0x8dc863[_0xd0b8('0x3f')]=qs[_0xd0b8('0x35')](_[_0xd0b8('0x40')](_0x3eebf7[_0xd0b8('0x34')],_0x551cbf['filters']),_0x17c320);if(_0x3eebf7[_0xd0b8('0x34')][_0xd0b8('0x41')]){_0x8dc863[_0xd0b8('0x3f')]=_[_0xd0b8('0x42')](_0x8dc863[_0xd0b8('0x3f')],{'$or':_[_0xd0b8('0x2f')](_0x17c320,function(_0x59b25a){if(_0x59b25a[_0xd0b8('0x43')]!=='VIRTUAL'){var _0x29b88f={};_0x29b88f[_0x59b25a[_0xd0b8('0x2d')]]={'$like':'%'+_0x3eebf7[_0xd0b8('0x34')]['filter']+'%'};return _0x29b88f;}})});}_0x8dc863=_[_0xd0b8('0x42')]({},_0x8dc863,_0x3eebf7[_0xd0b8('0x44')]);var _0x164b00={'where':_0x8dc863[_0xd0b8('0x3f')]};return db[_0xd0b8('0x30')][_0xd0b8('0x21')](_0x164b00)[_0xd0b8('0x28')](function(_0x1b983f){_0x2b9559[_0xd0b8('0x21')]=_0x1b983f;if(_0x3eebf7[_0xd0b8('0x34')][_0xd0b8('0x45')]){_0x8dc863[_0xd0b8('0x46')]=[{'all':!![]}];}return db[_0xd0b8('0x30')]['findAll'](_0x8dc863);})[_0xd0b8('0x28')](function(_0x38e86f){_0x2b9559[_0xd0b8('0x47')]=_0x38e86f;return _0x2b9559;})['then'](respondWithFilteredResult(_0x37f808,_0x8dc863))['catch'](handleError(_0x37f808,null));};exports[_0xd0b8('0x48')]=function(_0x57a2f6,_0x23189a){var _0x3f2dce={'raw':!![],'where':{'id':_0x57a2f6['params']['id']}},_0x564db7={};_0x564db7[_0xd0b8('0x38')]=_[_0xd0b8('0x49')](db[_0xd0b8('0x30')][_0xd0b8('0x31')]);_0x564db7[_0xd0b8('0x34')]=_[_0xd0b8('0x49')](_0x57a2f6[_0xd0b8('0x34')]);_0x564db7[_0xd0b8('0x35')]=_[_0xd0b8('0x37')](_0x564db7[_0xd0b8('0x38')],_0x564db7[_0xd0b8('0x34')]);_0x3f2dce[_0xd0b8('0x36')]=_[_0xd0b8('0x37')](_0x564db7[_0xd0b8('0x38')],qs[_0xd0b8('0x39')](_0x57a2f6[_0xd0b8('0x34')][_0xd0b8('0x39')]));_0x3f2dce[_0xd0b8('0x36')]=_0x3f2dce[_0xd0b8('0x36')][_0xd0b8('0x3a')]?_0x3f2dce['attributes']:_0x564db7[_0xd0b8('0x38')];if(_0x57a2f6[_0xd0b8('0x34')][_0xd0b8('0x45')]){_0x3f2dce['include']=[{'all':!![]}];}_0x3f2dce=_[_0xd0b8('0x42')]({},_0x3f2dce,_0x57a2f6['options']);return db['CmHopperAdditionalPhone'][_0xd0b8('0x4a')](_0x3f2dce)['then'](handleEntityNotFound(_0x23189a,null))[_0xd0b8('0x28')](respondWithResult(_0x23189a,null))[_0xd0b8('0x4b')](handleError(_0x23189a,null));};exports[_0xd0b8('0x4c')]=function(_0x3108e3,_0xa1f163){return db['CmHopperAdditionalPhone'][_0xd0b8('0x4c')](_0x3108e3[_0xd0b8('0x4d')],{})['then'](function(_0x5ba4e8){var _0x168014=_0x3108e3['user']['get']({'plain':!![]});if(!_0x168014)throw new Error(_0xd0b8('0x4e'));if(_0x168014[_0xd0b8('0x4f')]===_0xd0b8('0x50')){var _0x373478=_0x5ba4e8[_0xd0b8('0x2a')]({'plain':!![]});var _0x4dcab3=_0xd0b8('0x51');return db[_0xd0b8('0x52')][_0xd0b8('0x4a')]({'where':{'name':_0x4dcab3,'userProfileId':_0x168014[_0xd0b8('0x53')]},'raw':!![]})[_0xd0b8('0x28')](function(_0x5a517b){if(_0x5a517b&&_0x5a517b[_0xd0b8('0x54')]===0x0){return db[_0xd0b8('0x2b')][_0xd0b8('0x4c')]({'name':_0x373478[_0xd0b8('0x2d')],'resourceId':_0x373478['id'],'type':_0x5a517b[_0xd0b8('0x2d')],'sectionId':_0x5a517b['id']},{})[_0xd0b8('0x28')](function(){return _0x5ba4e8;});}else{return _0x5ba4e8;}})[_0xd0b8('0x4b')](function(_0x55707d){logger['error'](_0xd0b8('0x55'),_0x55707d);throw _0x55707d;});}return _0x5ba4e8;})[_0xd0b8('0x28')](respondWithResult(_0xa1f163,0xc9))[_0xd0b8('0x4b')](handleError(_0xa1f163,null));};exports[_0xd0b8('0x27')]=function(_0x4637b5,_0x8bec8e){if(_0x4637b5[_0xd0b8('0x4d')]['id']){delete _0x4637b5['body']['id'];}return db[_0xd0b8('0x30')][_0xd0b8('0x4a')]({'where':{'id':_0x4637b5[_0xd0b8('0x56')]['id']}})[_0xd0b8('0x28')](handleEntityNotFound(_0x8bec8e,null))[_0xd0b8('0x28')](saveUpdates(_0x4637b5[_0xd0b8('0x4d')],null))[_0xd0b8('0x28')](respondWithResult(_0x8bec8e,null))[_0xd0b8('0x4b')](handleError(_0x8bec8e,null));};exports[_0xd0b8('0x29')]=function(_0xa307e3,_0xc2667e){return db['CmHopperAdditionalPhone'][_0xd0b8('0x4a')]({'where':{'id':_0xa307e3[_0xd0b8('0x56')]['id']}})[_0xd0b8('0x28')](handleEntityNotFound(_0xc2667e,null))[_0xd0b8('0x28')](removeEntity(_0xc2667e,null))['catch'](handleError(_0xc2667e,null));}; \ No newline at end of file +var _0xe614=['reject','save','update','then','CmHopperAdditionalPhones','UserProfileResource','destroy','error','stack','name','map','CmHopperAdditionalPhone','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','where','filter','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xe614,0x1bf));var _0x4e61=function(_0x1dd577,_0x3f8604){_0x1dd577=_0x1dd577-0x0;var _0x4df4c4=_0xe614[_0x1dd577];return _0x4df4c4;};'use strict';var emlformat=require(_0x4e61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e61('0x1'));var jsonpatch=require(_0x4e61('0x2'));var rp=require(_0x4e61('0x3'));var moment=require('moment');var BPromise=require(_0x4e61('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4e61('0x5'));var sox=require(_0x4e61('0x6'));var csv=require(_0x4e61('0x7'));var ejs=require(_0x4e61('0x8'));var fs=require('fs');var fs_extra=require(_0x4e61('0x9'));var _=require(_0x4e61('0xa'));var squel=require('squel');var crypto=require(_0x4e61('0xb'));var jsforce=require(_0x4e61('0xc'));var deskjs=require(_0x4e61('0xd'));var toCsv=require(_0x4e61('0x7'));var querystring=require(_0x4e61('0xe'));var Papa=require(_0x4e61('0xf'));var Redis=require(_0x4e61('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4e61('0x11'));var as=require(_0x4e61('0x12'));var hardwareService=require(_0x4e61('0x13'));var logger=require(_0x4e61('0x14'))(_0x4e61('0x15'));var utils=require(_0x4e61('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1152a9,_0x2553f6){_0x2553f6=_0x2553f6||0xcc;return function(_0x552ff0){if(_0x552ff0){return _0x1152a9[_0x4e61('0x17')](_0x2553f6);}return _0x1152a9[_0x4e61('0x18')](_0x2553f6)[_0x4e61('0x19')]();};}function respondWithResult(_0x513f22,_0xdc28fc){_0xdc28fc=_0xdc28fc||0xc8;return function(_0x4fda92){if(_0x4fda92){return _0x513f22[_0x4e61('0x18')](_0xdc28fc)[_0x4e61('0x1a')](_0x4fda92);}};}function respondWithFilteredResult(_0x5ec97c,_0x4faa4e){return function(_0x4d6595){if(_0x4d6595){var _0x20279e=typeof _0x4faa4e['offset']===_0x4e61('0x1b')&&typeof _0x4faa4e[_0x4e61('0x1c')]===_0x4e61('0x1b');var _0x5e831c=_0x4d6595['count'];var _0x416f72=_0x20279e?0x0:_0x4faa4e[_0x4e61('0x1d')];var _0x7659cb=_0x20279e?_0x4d6595[_0x4e61('0x1e')]:_0x4faa4e['offset']+_0x4faa4e[_0x4e61('0x1c')];var _0x3d0e1f;if(_0x7659cb>=_0x5e831c){_0x7659cb=_0x5e831c;_0x3d0e1f=0xc8;}else{_0x3d0e1f=0xce;}_0x5ec97c[_0x4e61('0x18')](_0x3d0e1f);return _0x5ec97c['set'](_0x4e61('0x1f'),_0x416f72+'-'+_0x7659cb+'/'+_0x5e831c)[_0x4e61('0x1a')](_0x4d6595);}return null;};}function patchUpdates(_0x4ceddd){return function(_0x5f1149){try{jsonpatch[_0x4e61('0x20')](_0x5f1149,_0x4ceddd,!![]);}catch(_0x564365){return BPromise[_0x4e61('0x21')](_0x564365);}return _0x5f1149[_0x4e61('0x22')]();};}function saveUpdates(_0x51ae00,_0x3096f6){return function(_0x1af784){if(_0x1af784){return _0x1af784[_0x4e61('0x23')](_0x51ae00)['then'](function(_0x56d1ef){return _0x56d1ef;});}return null;};}function removeEntity(_0x29b3c7,_0x325b84){return function(_0x123b7f){if(_0x123b7f){return _0x123b7f['destroy']()[_0x4e61('0x24')](function(){var _0x4fc0dd=_0x123b7f['get']({'plain':!![]});var _0x3e99d0=_0x4e61('0x25');return db[_0x4e61('0x26')][_0x4e61('0x27')]({'where':{'type':_0x3e99d0,'resourceId':_0x4fc0dd['id']}})[_0x4e61('0x24')](function(){return _0x123b7f;});})[_0x4e61('0x24')](function(){_0x29b3c7[_0x4e61('0x18')](0xcc)[_0x4e61('0x19')]();});}};}function handleEntityNotFound(_0x282db8,_0x1f1fa9){return function(_0x389a92){if(!_0x389a92){_0x282db8[_0x4e61('0x17')](0x194);}return _0x389a92;};}function handleError(_0x45929b,_0x58f25b){_0x58f25b=_0x58f25b||0x1f4;return function(_0xcadf81){logger[_0x4e61('0x28')](_0xcadf81[_0x4e61('0x29')]);if(_0xcadf81[_0x4e61('0x2a')]){delete _0xcadf81['name'];}_0x45929b[_0x4e61('0x18')](_0x58f25b)['send'](_0xcadf81);};}exports['index']=function(_0x190446,_0x5d789a){var _0x472c02={},_0x56fa51={},_0x3377c6={'count':0x0,'rows':[]};var _0x3c869b=_[_0x4e61('0x2b')](db[_0x4e61('0x2c')][_0x4e61('0x2d')],function(_0x486189){return{'name':_0x486189['fieldName'],'type':_0x486189[_0x4e61('0x2e')][_0x4e61('0x2f')]};});_0x56fa51[_0x4e61('0x30')]=_[_0x4e61('0x2b')](_0x3c869b,_0x4e61('0x2a'));_0x56fa51[_0x4e61('0x31')]=_[_0x4e61('0x32')](_0x190446[_0x4e61('0x31')]);_0x56fa51['filters']=_[_0x4e61('0x33')](_0x56fa51['model'],_0x56fa51[_0x4e61('0x31')]);_0x472c02['attributes']=_[_0x4e61('0x33')](_0x56fa51[_0x4e61('0x30')],qs[_0x4e61('0x34')](_0x190446[_0x4e61('0x31')][_0x4e61('0x34')]));_0x472c02[_0x4e61('0x35')]=_0x472c02[_0x4e61('0x35')][_0x4e61('0x36')]?_0x472c02[_0x4e61('0x35')]:_0x56fa51[_0x4e61('0x30')];if(!_0x190446[_0x4e61('0x31')]['hasOwnProperty'](_0x4e61('0x37'))){_0x472c02['limit']=qs[_0x4e61('0x1c')](_0x190446['query'][_0x4e61('0x1c')]);_0x472c02[_0x4e61('0x1d')]=qs[_0x4e61('0x1d')](_0x190446[_0x4e61('0x31')][_0x4e61('0x1d')]);}_0x472c02[_0x4e61('0x38')]=qs[_0x4e61('0x39')](_0x190446[_0x4e61('0x31')][_0x4e61('0x39')]);_0x472c02['where']=qs[_0x4e61('0x3a')](_[_0x4e61('0x3b')](_0x190446[_0x4e61('0x31')],_0x56fa51[_0x4e61('0x3a')]),_0x3c869b);if(_0x190446[_0x4e61('0x31')]['filter']){_0x472c02[_0x4e61('0x3c')]=_['merge'](_0x472c02['where'],{'$or':_[_0x4e61('0x2b')](_0x3c869b,function(_0xa09569){if(_0xa09569[_0x4e61('0x2e')]!=='VIRTUAL'){var _0x362825={};_0x362825[_0xa09569['name']]={'$like':'%'+_0x190446[_0x4e61('0x31')][_0x4e61('0x3d')]+'%'};return _0x362825;}})});}_0x472c02=_[_0x4e61('0x3e')]({},_0x472c02,_0x190446[_0x4e61('0x3f')]);var _0x46ba42={'where':_0x472c02[_0x4e61('0x3c')]};return db['CmHopperAdditionalPhone'][_0x4e61('0x1e')](_0x46ba42)[_0x4e61('0x24')](function(_0x88ffc2){_0x3377c6[_0x4e61('0x1e')]=_0x88ffc2;if(_0x190446[_0x4e61('0x31')]['includeAll']){_0x472c02['include']=[{'all':!![]}];}return db[_0x4e61('0x2c')][_0x4e61('0x40')](_0x472c02);})[_0x4e61('0x24')](function(_0x5798d7){_0x3377c6[_0x4e61('0x41')]=_0x5798d7;return _0x3377c6;})[_0x4e61('0x24')](respondWithFilteredResult(_0x5d789a,_0x472c02))[_0x4e61('0x42')](handleError(_0x5d789a,null));};exports[_0x4e61('0x43')]=function(_0x4e3af4,_0x3fe7e4){var _0x37f3ae={'raw':!![],'where':{'id':_0x4e3af4[_0x4e61('0x44')]['id']}},_0x1272bc={};_0x1272bc['model']=_[_0x4e61('0x32')](db[_0x4e61('0x2c')][_0x4e61('0x2d')]);_0x1272bc['query']=_['keys'](_0x4e3af4[_0x4e61('0x31')]);_0x1272bc['filters']=_['intersection'](_0x1272bc[_0x4e61('0x30')],_0x1272bc[_0x4e61('0x31')]);_0x37f3ae[_0x4e61('0x35')]=_['intersection'](_0x1272bc[_0x4e61('0x30')],qs[_0x4e61('0x34')](_0x4e3af4[_0x4e61('0x31')][_0x4e61('0x34')]));_0x37f3ae['attributes']=_0x37f3ae[_0x4e61('0x35')][_0x4e61('0x36')]?_0x37f3ae[_0x4e61('0x35')]:_0x1272bc[_0x4e61('0x30')];if(_0x4e3af4[_0x4e61('0x31')][_0x4e61('0x45')]){_0x37f3ae[_0x4e61('0x46')]=[{'all':!![]}];}_0x37f3ae=_[_0x4e61('0x3e')]({},_0x37f3ae,_0x4e3af4[_0x4e61('0x3f')]);return db['CmHopperAdditionalPhone'][_0x4e61('0x47')](_0x37f3ae)[_0x4e61('0x24')](handleEntityNotFound(_0x3fe7e4,null))['then'](respondWithResult(_0x3fe7e4,null))[_0x4e61('0x42')](handleError(_0x3fe7e4,null));};exports['create']=function(_0x328daa,_0xa19a58){return db[_0x4e61('0x2c')][_0x4e61('0x48')](_0x328daa[_0x4e61('0x49')],{})[_0x4e61('0x24')](function(_0xd938c9){var _0x5c3ad5=_0x328daa[_0x4e61('0x4a')]['get']({'plain':!![]});if(!_0x5c3ad5)throw new Error(_0x4e61('0x4b'));if(_0x5c3ad5['role']===_0x4e61('0x4a')){var _0x5eefa3=_0xd938c9[_0x4e61('0x4c')]({'plain':!![]});var _0x1fe99f=_0x4e61('0x25');return db[_0x4e61('0x4d')]['find']({'where':{'name':_0x1fe99f,'userProfileId':_0x5c3ad5[_0x4e61('0x4e')]},'raw':!![]})[_0x4e61('0x24')](function(_0x3253bc){if(_0x3253bc&&_0x3253bc[_0x4e61('0x4f')]===0x0){return db[_0x4e61('0x26')][_0x4e61('0x48')]({'name':_0x5eefa3['name'],'resourceId':_0x5eefa3['id'],'type':_0x3253bc[_0x4e61('0x2a')],'sectionId':_0x3253bc['id']},{})[_0x4e61('0x24')](function(){return _0xd938c9;});}else{return _0xd938c9;}})[_0x4e61('0x42')](function(_0x5da83d){logger[_0x4e61('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5da83d);throw _0x5da83d;});}return _0xd938c9;})[_0x4e61('0x24')](respondWithResult(_0xa19a58,0xc9))[_0x4e61('0x42')](handleError(_0xa19a58,null));};exports[_0x4e61('0x23')]=function(_0x57a768,_0x51cda4){if(_0x57a768[_0x4e61('0x49')]['id']){delete _0x57a768[_0x4e61('0x49')]['id'];}return db[_0x4e61('0x2c')][_0x4e61('0x47')]({'where':{'id':_0x57a768[_0x4e61('0x44')]['id']}})[_0x4e61('0x24')](handleEntityNotFound(_0x51cda4,null))['then'](saveUpdates(_0x57a768[_0x4e61('0x49')],null))[_0x4e61('0x24')](respondWithResult(_0x51cda4,null))['catch'](handleError(_0x51cda4,null));};exports[_0x4e61('0x27')]=function(_0x3f6936,_0x50c895){return db[_0x4e61('0x2c')][_0x4e61('0x47')]({'where':{'id':_0x3f6936[_0x4e61('0x44')]['id']}})[_0x4e61('0x24')](handleEntityNotFound(_0x50c895,null))['then'](removeEntity(_0x50c895,null))[_0x4e61('0x42')](handleError(_0x50c895,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 8b52221..1901425 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 _0x5da1=['CmHopperAdditionalPhone','cm_hopper_additional_phones','api','moment','bluebird','path','../../config/environment','./cmHopperAdditionalPhone.attributes','define'];(function(_0x41a96e,_0x36bf41){var _0x2b7b54=function(_0x65f3f0){while(--_0x65f3f0){_0x41a96e['push'](_0x41a96e['shift']());}};_0x2b7b54(++_0x36bf41);}(_0x5da1,0xbf));var _0x15da=function(_0x16f3c0,_0x175a36){_0x16f3c0=_0x16f3c0-0x0;var _0x24fcc9=_0x5da1[_0x16f3c0];return _0x24fcc9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x15da('0x0'));var moment=require(_0x15da('0x1'));var BPromise=require(_0x15da('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15da('0x3'));var rimraf=require('rimraf');var config=require(_0x15da('0x4'));var attributes=require(_0x15da('0x5'));module['exports']=function(_0x261900,_0x4054bd){return _0x261900[_0x15da('0x6')](_0x15da('0x7'),attributes,{'tableName':_0x15da('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbcd=['exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0xdbcd,0x1bc));var _0xddbc=function(_0x2496cb,_0xcf9d27){_0x2496cb=_0x2496cb-0x0;var _0x5f5c0d=_0xdbcd[_0x2496cb];return _0x5f5c0d;};'use strict';var _=require('lodash');var util=require(_0xddbc('0x0'));var logger=require('../../config/logger')(_0xddbc('0x1'));var moment=require(_0xddbc('0x2'));var BPromise=require(_0xddbc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddbc('0x4'));var rimraf=require(_0xddbc('0x5'));var config=require(_0xddbc('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xddbc('0x7')]=function(_0x44136e,_0x284670){return _0x44136e[_0xddbc('0x8')](_0xddbc('0x9'),attributes,{'tableName':_0xddbc('0xa'),'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 00b645b..f4707d4 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 _0xc6fa=['waitTime','duration','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ContactId','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','then','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','countabandonedretry','countagentrejectretry','catch','VerifyAdditionalPhones','CmHopper'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc6fa,0xbd));var _0xac6f=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0xc6fa[_0x3cfb0d];return _0x3486b4;};'use strict';var _=require(_0xac6f('0x0'));var util=require(_0xac6f('0x1'));var moment=require(_0xac6f('0x2'));var BPromise=require(_0xac6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac6f('0x5'));var logger=require(_0xac6f('0x6'))(_0xac6f('0x7'));var config=require(_0xac6f('0x8'));var jayson=require(_0xac6f('0x9'));var client=jayson['client'][_0xac6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b3b60,_0x9335ff,_0xdbdb88){return new BPromise(function(_0xf719dc,_0x1b4209){return client['request'](_0x5b3b60,_0xdbdb88)['then'](function(_0x367c3a){logger[_0xac6f('0xb')](_0xac6f('0xc'),_0x9335ff,_0xac6f('0xd'));logger[_0xac6f('0xe')](_0xac6f('0xf'),_0x9335ff,_0xac6f('0xd'),JSON[_0xac6f('0x10')](_0x367c3a));if(_0x367c3a[_0xac6f('0x11')]){if(_0x367c3a[_0xac6f('0x11')]['code']===0x1f4){logger[_0xac6f('0x11')](_0xac6f('0xc'),_0x9335ff,_0x367c3a[_0xac6f('0x11')][_0xac6f('0x12')]);return _0x1b4209(_0x367c3a['error']['message']);}logger[_0xac6f('0x11')](_0xac6f('0xc'),_0x9335ff,_0x367c3a['error'][_0xac6f('0x12')]);return _0xf719dc(_0x367c3a[_0xac6f('0x11')][_0xac6f('0x12')]);}else{logger[_0xac6f('0xb')](_0xac6f('0xc'),_0x9335ff,_0xac6f('0xd'));_0xf719dc(_0x367c3a[_0xac6f('0x13')]['message']);}})['catch'](function(_0x4998a6){logger[_0xac6f('0x11')](_0xac6f('0xc'),_0x9335ff,_0x4998a6);_0x1b4209(_0x4998a6);});});}exports['VerifyAdditionalPhones']=function(_0x405b9a){var _0x330f52=this;return new Promise(function(_0x525408,_0x49e69d){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x405b9a['body'][_0xac6f('0x14')],'ListId':_0x405b9a[_0xac6f('0x15')][_0xac6f('0x16')],'VoiceQueueId':_0x405b9a[_0xac6f('0x15')][_0xac6f('0x17')]===undefined?null:_0x405b9a['body'][_0xac6f('0x17')],'CampaignId':_0x405b9a[_0xac6f('0x15')][_0xac6f('0x18')]===undefined?null:_0x405b9a['body']['CampaignId']}})['then'](function(_0x39ba4a){if(_0x39ba4a!=null){return db[_0xac6f('0x19')][_0xac6f('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x39ba4a['id'],'OrderBy':{'$gt':_0x39ba4a[_0xac6f('0x1b')]}},'order':[[_0xac6f('0x1b'),_0xac6f('0x1c')]]})[_0xac6f('0x1d')](function(_0x14774e){var _0x35faa5=0x0;if(_0x14774e){if(_0x14774e[_0xac6f('0x1e')]+_0x14774e[_0xac6f('0x1f')]+_0x14774e[_0xac6f('0x20')]+_0x14774e[_0xac6f('0x21')]+_0x14774e[_0xac6f('0x22')]+_0x14774e['countabandonedretry']+_0x14774e[_0xac6f('0x23')]+_0x14774e['countagentrejectretry']<_0x405b9a[_0xac6f('0x24')][_0xac6f('0x25')])_0x35faa5=0x1;_0x525408({'additional':_0x35faa5});}else{return db[_0xac6f('0x19')][_0xac6f('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x39ba4a['id']},'order':[['OrderBy',_0xac6f('0x1c')]]})[_0xac6f('0x1d')](function(_0x464260){var _0x59477d=0x0;if(_0x464260){if(_0x464260[_0xac6f('0x1e')]+_0x464260[_0xac6f('0x1f')]+_0x464260[_0xac6f('0x20')]+_0x464260[_0xac6f('0x21')]+_0x464260[_0xac6f('0x22')]+_0x464260[_0xac6f('0x26')]+_0x464260['countmachineretry']+_0x464260[_0xac6f('0x27')]<_0x405b9a['entity'][_0xac6f('0x25')])_0x59477d=0x1;_0x525408({'additional':_0x59477d});}else{_0x525408({'additional':0x0});}})[_0xac6f('0x28')](function(_0x1bacea){logger[_0xac6f('0x11')](_0xac6f('0x29'),_0x1bacea[_0xac6f('0x12')]);_0x49e69d(_0x330f52[_0xac6f('0x11')](0x1f4,_0x1bacea[_0xac6f('0x12')]));});}})[_0xac6f('0x28')](function(_0x12875a){logger['error'](_0xac6f('0x29'),_0x12875a[_0xac6f('0x12')]);_0x49e69d(_0x330f52[_0xac6f('0x11')](0x1f4,_0x12875a[_0xac6f('0x12')]));});}else _0x525408({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x1006c7){var _0x2d8f56=this;return new Promise(function(_0x234579,_0xa2bffa){return db[_0xac6f('0x2a')][_0xac6f('0x1a')]({'raw':!![],'where':{'ContactId':_0x1006c7[_0xac6f('0x15')][_0xac6f('0x14')],'ListId':_0x1006c7[_0xac6f('0x15')][_0xac6f('0x16')],'VoiceQueueId':_0x1006c7[_0xac6f('0x15')][_0xac6f('0x17')]===undefined?null:_0x1006c7['body'][_0xac6f('0x17')],'CampaignId':_0x1006c7[_0xac6f('0x15')][_0xac6f('0x18')]===undefined?null:_0x1006c7[_0xac6f('0x15')][_0xac6f('0x18')]}})[_0xac6f('0x1d')](function(_0x39cba0){if(_0x39cba0!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x39cba0['id'],'OrderBy':{'$gte':_0x39cba0[_0xac6f('0x1b')]}},'order':[[_0xac6f('0x1b'),'ASC']]})[_0xac6f('0x1d')](function(_0x4e504e){if(_0x4e504e)return activateAdditionalPhone(_0x39cba0,_0x1006c7[_0xac6f('0x15')],_0x4e504e,_0x1006c7['duration'],_0x1006c7[_0xac6f('0x2b')])[_0xac6f('0x1d')](function(_0x344e11){_0x234579(_0x344e11);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x39cba0['id']},'order':[[_0xac6f('0x1b'),'ASC']]})[_0xac6f('0x1d')](function(_0x12e9b9){if(_0x12e9b9)return activateAdditionalPhone(_0x39cba0,_0x1006c7[_0xac6f('0x15')],_0x12e9b9,_0x1006c7[_0xac6f('0x2c')],_0x1006c7['waitTime'])[_0xac6f('0x1d')](function(_0x1e5626){_0x234579(_0x1e5626);});else{_0x234579({'id':_0x39cba0['id'],'phone':''});}})['catch'](function(_0x33185e){logger[_0xac6f('0x11')](_0xac6f('0x29'),_0x33185e[_0xac6f('0x12')]);_0xa2bffa(_0x2d8f56['error'](0x1f4,_0x33185e[_0xac6f('0x12')]));});}})['catch'](function(_0x42988a){logger[_0xac6f('0x11')](_0xac6f('0x29'),_0x42988a['message']);_0xa2bffa(_0x2d8f56[_0xac6f('0x11')](0x1f4,_0x42988a['message']));});}else _0x234579(0x1);});});};function activateAdditionalPhone(_0xf95d0b,_0x3b6626,_0x46f60b,_0x2ba17d,_0x4e1c31){return new Promise(function(_0x3093ee,_0x1b0baa){var _0x437c7c;if(_['isNil'](_0x46f60b['scheduledat'])){_0x46f60b[_0xac6f('0x2d')]=moment();}if(moment()>moment(_0x46f60b[_0xac6f('0x2d')])){_0x437c7c=moment()[_0xac6f('0x2e')](_0x4e1c31||0x3,_0xac6f('0x2f'));}else{if(_0x46f60b[_0xac6f('0x1b')]==0x0){_0x437c7c=moment(_0x46f60b[_0xac6f('0x2d')]);}else{_0x437c7c=moment()[_0xac6f('0x2e')](_0x4e1c31||0x3,'minutes');}}if(_[_0xac6f('0x30')](_0x437c7c)){_0x437c7c=moment()[_0xac6f('0x2e')](_0x4e1c31||0x3,_0xac6f('0x2f'));}var _0x3be816={'phone':_0xf95d0b[_0xac6f('0x31')],'active':0x0,'OrderBy':_[_0xac6f('0x30')](_0xf95d0b['OrderBy'])?0x0:_0xf95d0b[_0xac6f('0x1b')],'scheduledat':moment()[_0xac6f('0x2e')](_0x2ba17d||0x1,_0xac6f('0x2f')),'countbusyretry':_0x3b6626[_0xac6f('0x1e')],'countcongestionretry':_0x3b6626[_0xac6f('0x1f')],'countnoanswerretry':_0x3b6626['countnoanswerretry'],'countnosuchnumberretry':_0x3b6626[_0xac6f('0x21')],'countdropretry':_0x3b6626[_0xac6f('0x22')],'countabandonedretry':_0x3b6626[_0xac6f('0x26')],'countmachineretry':_0x3b6626[_0xac6f('0x23')],'countagentrejectretry':_0x3b6626[_0xac6f('0x27')],'createdAt':_0x3b6626[_0xac6f('0x32')],'updatedAt':_0x3b6626[_0xac6f('0x33')]};var _0x5a0d41={'CmHopperId':_0xf95d0b['id'],'phone':_0x46f60b['phone'],'active':0x0,'OrderBy':_[_0xac6f('0x30')](_0x46f60b[_0xac6f('0x1b')])?0x0:_0x46f60b[_0xac6f('0x1b')],'scheduledat':_0x437c7c,'countbusyretry':_0x46f60b['countbusyretry'],'countcongestionretry':_0x46f60b[_0xac6f('0x1f')],'countnoanswerretry':_0x46f60b[_0xac6f('0x20')],'countnosuchnumberretry':_0x46f60b[_0xac6f('0x21')],'countdropretry':_0x46f60b[_0xac6f('0x22')],'countabandonedretry':_0x46f60b[_0xac6f('0x26')],'countmachineretry':_0x46f60b[_0xac6f('0x23')],'countagentrejectretry':_0x46f60b[_0xac6f('0x27')],'createdAt':_0x46f60b[_0xac6f('0x32')],'updatedAt':_0x46f60b[_0xac6f('0x33')]};return db[_0xac6f('0x34')][_0xac6f('0x35')](function(_0x39303a){return db[_0xac6f('0x19')][_0xac6f('0x36')](_0x3be816,{'where':{'id':_0x46f60b['id']}},{'transaction':_0x39303a})['then'](function(){return db[_0xac6f('0x2a')][_0xac6f('0x36')](_0x5a0d41,{'where':{'id':_0xf95d0b['id']}},{'transaction':_0x39303a});});})['then'](function(_0x246ed5){_0x3093ee({'id':_0xf95d0b['id'],'phone':_0x46f60b['phone']});})[_0xac6f('0x28')](function(_0x2f08f0){logger[_0xac6f('0x11')](_0xac6f('0x37'),_0x2f08f0[_0xac6f('0x12')]);_0x1b0baa({'error':_0x2f08f0[_0xac6f('0x12')]});});});}exports[_0xac6f('0x38')]=function(_0x27febb){var _0x30cc38=this;return new Promise(function(_0x58cbc8,_0x708046){return db[_0xac6f('0x2a')][_0xac6f('0x36')](_0x27febb[_0xac6f('0x15')][_0xac6f('0x39')],{'where':{'id':_0x27febb[_0xac6f('0x15')]['id']}})[_0xac6f('0x1d')](function(_0x403b58){_0x58cbc8(_0x403b58);})[_0xac6f('0x28')](function(_0x1a4b68){logger[_0xac6f('0x11')]('IncrementPreviewCounters',_0x1a4b68[_0xac6f('0x12')]);_0x708046(_0x30cc38[_0xac6f('0x11')](0x1f4,_0x1a4b68[_0xac6f('0x12')]));});});}; \ No newline at end of file +var _0x89be=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countcongestionretry','dialGlobalMaxRetry','catch','SwapAdditionalPhones','waitTime','duration','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util'];(function(_0x27eaad,_0x53919f){var _0x56cbe3=function(_0x4bc8dd){while(--_0x4bc8dd){_0x27eaad['push'](_0x27eaad['shift']());}};_0x56cbe3(++_0x53919f);}(_0x89be,0x160));var _0xe89b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x89be[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe89b('0x0'));var util=require(_0xe89b('0x1'));var moment=require(_0xe89b('0x2'));var BPromise=require(_0xe89b('0x3'));var rs=require(_0xe89b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe89b('0x5'))['db'];var utils=require(_0xe89b('0x6'));var logger=require(_0xe89b('0x7'))(_0xe89b('0x8'));var config=require(_0xe89b('0x9'));var jayson=require(_0xe89b('0xa'));var client=jayson['client'][_0xe89b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ada1e,_0x523da6,_0x2c3ced){return new BPromise(function(_0x1c482d,_0x51c09a){return client[_0xe89b('0xc')](_0x1ada1e,_0x2c3ced)['then'](function(_0x52dd37){logger[_0xe89b('0xd')](_0xe89b('0xe'),_0x523da6,_0xe89b('0xf'));logger[_0xe89b('0x10')](_0xe89b('0x11'),_0x523da6,_0xe89b('0xf'),JSON[_0xe89b('0x12')](_0x52dd37));if(_0x52dd37[_0xe89b('0x13')]){if(_0x52dd37[_0xe89b('0x13')][_0xe89b('0x14')]===0x1f4){logger[_0xe89b('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x523da6,_0x52dd37[_0xe89b('0x13')]['message']);return _0x51c09a(_0x52dd37[_0xe89b('0x13')][_0xe89b('0x15')]);}logger[_0xe89b('0x13')](_0xe89b('0xe'),_0x523da6,_0x52dd37[_0xe89b('0x13')][_0xe89b('0x15')]);return _0x1c482d(_0x52dd37[_0xe89b('0x13')][_0xe89b('0x15')]);}else{logger[_0xe89b('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x523da6,_0xe89b('0xf'));_0x1c482d(_0x52dd37['result'][_0xe89b('0x15')]);}})['catch'](function(_0x59243c){logger[_0xe89b('0x13')](_0xe89b('0xe'),_0x523da6,_0x59243c);_0x51c09a(_0x59243c);});});}exports[_0xe89b('0x16')]=function(_0x6d5f54){var _0x4185a7=this;return new Promise(function(_0x226995,_0x5b986c){return db[_0xe89b('0x17')][_0xe89b('0x18')]({'raw':!![],'where':{'ContactId':_0x6d5f54['body'][_0xe89b('0x19')],'ListId':_0x6d5f54[_0xe89b('0x1a')][_0xe89b('0x1b')],'VoiceQueueId':_0x6d5f54[_0xe89b('0x1a')][_0xe89b('0x1c')]===undefined?null:_0x6d5f54[_0xe89b('0x1a')]['VoiceQueueId'],'CampaignId':_0x6d5f54[_0xe89b('0x1a')][_0xe89b('0x1d')]===undefined?null:_0x6d5f54['body'][_0xe89b('0x1d')]}})[_0xe89b('0x1e')](function(_0x4e16c5){if(_0x4e16c5!=null){return db[_0xe89b('0x1f')][_0xe89b('0x18')]({'raw':!![],'where':{'CmHopperId':_0x4e16c5['id'],'OrderBy':{'$gt':_0x4e16c5[_0xe89b('0x20')]}},'order':[[_0xe89b('0x20'),_0xe89b('0x21')]]})[_0xe89b('0x1e')](function(_0x37c9e5){var _0x1d4310=0x0;if(_0x37c9e5){if(_0x37c9e5[_0xe89b('0x22')]+_0x37c9e5['countcongestionretry']+_0x37c9e5[_0xe89b('0x23')]+_0x37c9e5[_0xe89b('0x24')]+_0x37c9e5[_0xe89b('0x25')]+_0x37c9e5[_0xe89b('0x26')]+_0x37c9e5[_0xe89b('0x27')]+_0x37c9e5[_0xe89b('0x28')]<_0x6d5f54[_0xe89b('0x29')]['dialGlobalMaxRetry'])_0x1d4310=0x1;_0x226995({'additional':_0x1d4310});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4e16c5['id']},'order':[['OrderBy',_0xe89b('0x21')]]})[_0xe89b('0x1e')](function(_0x485c7d){var _0x12918d=0x0;if(_0x485c7d){if(_0x485c7d[_0xe89b('0x22')]+_0x485c7d[_0xe89b('0x2a')]+_0x485c7d[_0xe89b('0x23')]+_0x485c7d[_0xe89b('0x24')]+_0x485c7d['countdropretry']+_0x485c7d[_0xe89b('0x26')]+_0x485c7d[_0xe89b('0x27')]+_0x485c7d[_0xe89b('0x28')]<_0x6d5f54['entity'][_0xe89b('0x2b')])_0x12918d=0x1;_0x226995({'additional':_0x12918d});}else{_0x226995({'additional':0x0});}})[_0xe89b('0x2c')](function(_0x1739b9){logger[_0xe89b('0x13')](_0xe89b('0x16'),_0x1739b9[_0xe89b('0x15')]);_0x5b986c(_0x4185a7['error'](0x1f4,_0x1739b9['message']));});}})[_0xe89b('0x2c')](function(_0x572f5c){logger[_0xe89b('0x13')](_0xe89b('0x16'),_0x572f5c[_0xe89b('0x15')]);_0x5b986c(_0x4185a7[_0xe89b('0x13')](0x1f4,_0x572f5c[_0xe89b('0x15')]));});}else _0x226995({'additional':0x0});});});};exports[_0xe89b('0x2d')]=function(_0x379493){var _0x17e7c4=this;return new Promise(function(_0x3f54ee,_0x28569c){return db[_0xe89b('0x17')][_0xe89b('0x18')]({'raw':!![],'where':{'ContactId':_0x379493[_0xe89b('0x1a')][_0xe89b('0x19')],'ListId':_0x379493[_0xe89b('0x1a')][_0xe89b('0x1b')],'VoiceQueueId':_0x379493[_0xe89b('0x1a')][_0xe89b('0x1c')]===undefined?null:_0x379493[_0xe89b('0x1a')][_0xe89b('0x1c')],'CampaignId':_0x379493[_0xe89b('0x1a')][_0xe89b('0x1d')]===undefined?null:_0x379493[_0xe89b('0x1a')][_0xe89b('0x1d')]}})[_0xe89b('0x1e')](function(_0xfc4bf4){if(_0xfc4bf4!=null){return db[_0xe89b('0x1f')][_0xe89b('0x18')]({'raw':!![],'where':{'CmHopperId':_0xfc4bf4['id'],'OrderBy':{'$gte':_0xfc4bf4['OrderBy']}},'order':[[_0xe89b('0x20'),_0xe89b('0x21')]]})[_0xe89b('0x1e')](function(_0x1b1090){if(_0x1b1090)return activateAdditionalPhone(_0xfc4bf4,_0x379493[_0xe89b('0x1a')],_0x1b1090,_0x379493['duration'],_0x379493[_0xe89b('0x2e')])['then'](function(_0x5cfbe4){_0x3f54ee(_0x5cfbe4);});else{return db['CmHopperAdditionalPhone'][_0xe89b('0x18')]({'raw':!![],'where':{'CmHopperId':_0xfc4bf4['id']},'order':[['OrderBy','ASC']]})['then'](function(_0x187886){if(_0x187886)return activateAdditionalPhone(_0xfc4bf4,_0x379493[_0xe89b('0x1a')],_0x187886,_0x379493[_0xe89b('0x2f')],_0x379493[_0xe89b('0x2e')])[_0xe89b('0x1e')](function(_0xb6b51){_0x3f54ee(_0xb6b51);});else{_0x3f54ee({'id':_0xfc4bf4['id'],'phone':''});}})['catch'](function(_0x525c8a){logger[_0xe89b('0x13')](_0xe89b('0x16'),_0x525c8a['message']);_0x28569c(_0x17e7c4['error'](0x1f4,_0x525c8a[_0xe89b('0x15')]));});}})[_0xe89b('0x2c')](function(_0x5eb134){logger[_0xe89b('0x13')](_0xe89b('0x16'),_0x5eb134['message']);_0x28569c(_0x17e7c4[_0xe89b('0x13')](0x1f4,_0x5eb134['message']));});}else _0x3f54ee(0x1);});});};function activateAdditionalPhone(_0x38d304,_0x84cb5e,_0x511345,_0x1578db,_0x46e8c1){return new Promise(function(_0x2b16ef,_0x2c1f7c){var _0x17be3c;if(_[_0xe89b('0x30')](_0x511345['scheduledat'])){_0x511345['scheduledat']=moment();}if(moment()>moment(_0x511345[_0xe89b('0x31')])){_0x17be3c=moment()[_0xe89b('0x32')](_0x46e8c1||0x3,_0xe89b('0x33'));}else{if(_0x511345[_0xe89b('0x20')]==0x0){_0x17be3c=moment(_0x511345[_0xe89b('0x31')]);}else{_0x17be3c=moment()[_0xe89b('0x32')](_0x46e8c1||0x3,'minutes');}}if(_[_0xe89b('0x30')](_0x17be3c)){_0x17be3c=moment()[_0xe89b('0x32')](_0x46e8c1||0x3,'minutes');}var _0x3add9c={'phone':_0x38d304[_0xe89b('0x34')],'active':0x0,'OrderBy':_[_0xe89b('0x30')](_0x38d304[_0xe89b('0x20')])?0x0:_0x38d304[_0xe89b('0x20')],'scheduledat':moment()[_0xe89b('0x32')](_0x1578db||0x1,_0xe89b('0x33')),'countbusyretry':_0x84cb5e['countbusyretry'],'countcongestionretry':_0x84cb5e[_0xe89b('0x2a')],'countnoanswerretry':_0x84cb5e[_0xe89b('0x23')],'countnosuchnumberretry':_0x84cb5e[_0xe89b('0x24')],'countdropretry':_0x84cb5e[_0xe89b('0x25')],'countabandonedretry':_0x84cb5e['countabandonedretry'],'countmachineretry':_0x84cb5e[_0xe89b('0x27')],'countagentrejectretry':_0x84cb5e[_0xe89b('0x28')],'createdAt':_0x84cb5e[_0xe89b('0x35')],'updatedAt':_0x84cb5e[_0xe89b('0x36')]};var _0x2dfcc3={'CmHopperId':_0x38d304['id'],'phone':_0x511345[_0xe89b('0x34')],'active':0x0,'OrderBy':_[_0xe89b('0x30')](_0x511345[_0xe89b('0x20')])?0x0:_0x511345[_0xe89b('0x20')],'scheduledat':_0x17be3c,'countbusyretry':_0x511345[_0xe89b('0x22')],'countcongestionretry':_0x511345['countcongestionretry'],'countnoanswerretry':_0x511345['countnoanswerretry'],'countnosuchnumberretry':_0x511345[_0xe89b('0x24')],'countdropretry':_0x511345[_0xe89b('0x25')],'countabandonedretry':_0x511345[_0xe89b('0x26')],'countmachineretry':_0x511345[_0xe89b('0x27')],'countagentrejectretry':_0x511345[_0xe89b('0x28')],'createdAt':_0x511345['createdAt'],'updatedAt':_0x511345[_0xe89b('0x36')]};return db['sequelize'][_0xe89b('0x37')](function(_0x29e1c7){return db[_0xe89b('0x1f')]['update'](_0x3add9c,{'where':{'id':_0x511345['id']}},{'transaction':_0x29e1c7})[_0xe89b('0x1e')](function(){return db[_0xe89b('0x17')][_0xe89b('0x38')](_0x2dfcc3,{'where':{'id':_0x38d304['id']}},{'transaction':_0x29e1c7});});})[_0xe89b('0x1e')](function(_0x283c73){_0x2b16ef({'id':_0x38d304['id'],'phone':_0x511345[_0xe89b('0x34')]});})['catch'](function(_0x16158c){logger[_0xe89b('0x13')](_0xe89b('0x39'),_0x16158c[_0xe89b('0x15')]);_0x2c1f7c({'error':_0x16158c['message']});});});}exports[_0xe89b('0x3a')]=function(_0xcb180e){var _0x20b0fe=this;return new Promise(function(_0x4fe316,_0x4c6067){return db[_0xe89b('0x17')][_0xe89b('0x38')](_0xcb180e['body']['field'],{'where':{'id':_0xcb180e[_0xe89b('0x1a')]['id']}})[_0xe89b('0x1e')](function(_0x5ddb51){_0x4fe316(_0x5ddb51);})[_0xe89b('0x2c')](function(_0xc9ddfb){logger[_0xe89b('0x13')](_0xe89b('0x3a'),_0xc9ddfb['message']);_0x4c6067(_0x20b0fe[_0xe89b('0x13')](0x1f4,_0xc9ddfb[_0xe89b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 1002e5d..ccd36fa 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 _0xb63b=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x416ef5,_0x34d3b8){var _0x2e9370=function(_0x5a9b24){while(--_0x5a9b24){_0x416ef5['push'](_0x416ef5['shift']());}};_0x2e9370(++_0x34d3b8);}(_0xb63b,0x106));var _0xbb63=function(_0x18be73,_0x2a54f7){_0x18be73=_0x18be73-0x0;var _0x4fbe8d=_0xb63b[_0x18be73];return _0x4fbe8d;};'use strict';var multer=require(_0xbb63('0x0'));var util=require(_0xbb63('0x1'));var path=require(_0xbb63('0x2'));var timeout=require(_0xbb63('0x3'));var express=require(_0xbb63('0x4'));var router=express[_0xbb63('0x5')]();var fs_extra=require(_0xbb63('0x6'));var auth=require(_0xbb63('0x7'));var interaction=require(_0xbb63('0x8'));var config=require('../../config/environment');var controller=require(_0xbb63('0x9'));router[_0xbb63('0xa')]('/',auth[_0xbb63('0xb')](),controller['index']);router[_0xbb63('0xa')](_0xbb63('0xc'),auth[_0xbb63('0xb')](),controller[_0xbb63('0xd')]);router[_0xbb63('0xe')]('/',auth[_0xbb63('0xb')](),controller[_0xbb63('0xf')]);router[_0xbb63('0x10')](_0xbb63('0xc'),auth[_0xbb63('0xb')](),controller[_0xbb63('0x11')]);router[_0xbb63('0x12')](_0xbb63('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xbb63('0x13')]=router; \ No newline at end of file +var _0x1903=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperAdditionalPhone.controller','index','get','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0x2ce66f,_0x48bcd0){var _0x8ed528=function(_0x24b54c){while(--_0x24b54c){_0x2ce66f['push'](_0x2ce66f['shift']());}};_0x8ed528(++_0x48bcd0);}(_0x1903,0x7a));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3190('0x0'));var path=require(_0x3190('0x1'));var timeout=require(_0x3190('0x2'));var express=require(_0x3190('0x3'));var router=express[_0x3190('0x4')]();var fs_extra=require(_0x3190('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3190('0x6'));var controller=require(_0x3190('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3190('0x8')]);router[_0x3190('0x9')](_0x3190('0xa'),auth['isAuthenticated'](),controller[_0x3190('0xb')]);router[_0x3190('0xc')]('/',auth[_0x3190('0xd')](),controller[_0x3190('0xe')]);router[_0x3190('0xf')](_0x3190('0xa'),auth[_0x3190('0xd')](),controller[_0x3190('0x10')]);router[_0x3190('0x11')]('/:id',auth[_0x3190('0xd')](),controller[_0x3190('0x12')]);module[_0x3190('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a7db25b..f1eedfb 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 _0xed1f=['moment','sequelize','INTEGER','contactListQueue'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xed1f,0x170));var _0xfed1=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xed1f[_0x1da527];return _0x40fc7c;};'use strict';var moment=require(_0xfed1('0x0'));var Sequelize=require(_0xfed1('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfed1('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xfed1('0x2')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xfed1('0x2')],'unique':_0xfed1('0x3')}}; \ No newline at end of file +var _0x7fbe=['exports','STRING','INTEGER','contactListQueue'];(function(_0x3047c1,_0x3c42f6){var _0x318d43=function(_0x55adc4){while(--_0x55adc4){_0x3047c1['push'](_0x3047c1['shift']());}};_0x318d43(++_0x3c42f6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x76517f,_0x325017){_0x76517f=_0x76517f-0x0;var _0x43cc3a=_0x7fbe[_0x76517f];return _0x43cc3a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe7fb('0x0')]={'phone':{'type':Sequelize[_0xe7fb('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe7fb('0x2')],'unique':_0xe7fb('0x3')},'ListId':{'type':Sequelize[_0xe7fb('0x2')],'unique':_0xe7fb('0x3')},'VoiceQueueId':{'type':Sequelize[_0xe7fb('0x2')],'unique':_0xe7fb('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b26e028..05ead88 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 _0x61c7=['status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','catch','show','length','options','find','update','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2c842c,_0x2c0fec){var _0x584f63=function(_0x38dba1){while(--_0x38dba1){_0x2c842c['push'](_0x2c842c['shift']());}};_0x584f63(++_0x2c0fec);}(_0x61c7,0x76));var _0x761c=function(_0xa5e078,_0x24e6d3){_0xa5e078=_0xa5e078-0x0;var _0x2f669a=_0x61c7[_0xa5e078];return _0x2f669a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x761c('0x0'));var zipdir=require(_0x761c('0x1'));var jsonpatch=require(_0x761c('0x2'));var rp=require(_0x761c('0x3'));var moment=require(_0x761c('0x4'));var BPromise=require(_0x761c('0x5'));var Mustache=require(_0x761c('0x6'));var util=require(_0x761c('0x7'));var path=require(_0x761c('0x8'));var sox=require('sox');var csv=require(_0x761c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x761c('0xa'));var _=require('lodash');var squel=require(_0x761c('0xb'));var crypto=require(_0x761c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x761c('0xd'));var toCsv=require(_0x761c('0x9'));var querystring=require(_0x761c('0xe'));var Papa=require(_0x761c('0xf'));var Redis=require(_0x761c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x761c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x761c('0x12'))('api');var utils=require(_0x761c('0x13'));var config=require(_0x761c('0x14'));var licenseUtil=require(_0x761c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b5183,_0x32e8cd){_0x32e8cd=_0x32e8cd||0xcc;return function(_0x3b4a1b){if(_0x3b4a1b){return _0x1b5183['sendStatus'](_0x32e8cd);}return _0x1b5183[_0x761c('0x16')](_0x32e8cd)[_0x761c('0x17')]();};}function respondWithResult(_0x288e46,_0x4693fd){_0x4693fd=_0x4693fd||0xc8;return function(_0x2a5fae){if(_0x2a5fae){return _0x288e46['status'](_0x4693fd)[_0x761c('0x18')](_0x2a5fae);}};}function respondWithFilteredResult(_0x39aeaa,_0x5771ea){return function(_0x421ece){if(_0x421ece){var _0x122cea=typeof _0x5771ea[_0x761c('0x19')]==='undefined'&&typeof _0x5771ea[_0x761c('0x1a')]==='undefined';var _0x26b2e6=_0x421ece[_0x761c('0x1b')];var _0x4a1132=_0x122cea?0x0:_0x5771ea['offset'];var _0x39038c=_0x122cea?_0x421ece[_0x761c('0x1b')]:_0x5771ea['offset']+_0x5771ea[_0x761c('0x1a')];var _0x4ff462;if(_0x39038c>=_0x26b2e6){_0x39038c=_0x26b2e6;_0x4ff462=0xc8;}else{_0x4ff462=0xce;}_0x39aeaa[_0x761c('0x16')](_0x4ff462);return _0x39aeaa[_0x761c('0x1c')](_0x761c('0x1d'),_0x4a1132+'-'+_0x39038c+'/'+_0x26b2e6)[_0x761c('0x18')](_0x421ece);}return null;};}function patchUpdates(_0x12a6d6){return function(_0x2b681e){try{jsonpatch['apply'](_0x2b681e,_0x12a6d6,!![]);}catch(_0x4cd9c2){return BPromise[_0x761c('0x1e')](_0x4cd9c2);}return _0x2b681e[_0x761c('0x1f')]();};}function saveUpdates(_0xf45339,_0x521404){return function(_0x443fd9){if(_0x443fd9){return _0x443fd9['update'](_0xf45339)[_0x761c('0x20')](function(_0x2b81ab){return _0x2b81ab;});}return null;};}function removeEntity(_0x3ab92c,_0x4a15bd){return function(_0x8ec8db){if(_0x8ec8db){return _0x8ec8db[_0x761c('0x21')]()[_0x761c('0x20')](function(){_0x3ab92c[_0x761c('0x16')](0xcc)[_0x761c('0x17')]();});}};}function handleEntityNotFound(_0x38b94c,_0x4c0a8a){return function(_0x39be7a){if(!_0x39be7a){_0x38b94c[_0x761c('0x22')](0x194);}return _0x39be7a;};}function handleError(_0x5623f6,_0x468212){_0x468212=_0x468212||0x1f4;return function(_0x12fca6){logger['error'](_0x12fca6['stack']);if(_0x12fca6[_0x761c('0x23')]){delete _0x12fca6['name'];}_0x5623f6[_0x761c('0x16')](_0x468212)[_0x761c('0x24')](_0x12fca6);};}exports[_0x761c('0x25')]=function(_0x199595,_0x207a1e){var _0x4b04c8={},_0x185b19={},_0x50a793={'count':0x0,'rows':[]};var _0xbe703f=_[_0x761c('0x26')](db[_0x761c('0x27')][_0x761c('0x28')],function(_0x5ca5d3){return{'name':_0x5ca5d3[_0x761c('0x29')],'type':_0x5ca5d3[_0x761c('0x2a')][_0x761c('0x2b')]};});_0x185b19['model']=_[_0x761c('0x26')](_0xbe703f,_0x761c('0x23'));_0x185b19[_0x761c('0x2c')]=_[_0x761c('0x2d')](_0x199595[_0x761c('0x2c')]);_0x185b19[_0x761c('0x2e')]=_[_0x761c('0x2f')](_0x185b19['model'],_0x185b19[_0x761c('0x2c')]);_0x4b04c8['attributes']=_[_0x761c('0x2f')](_0x185b19[_0x761c('0x30')],qs[_0x761c('0x31')](_0x199595[_0x761c('0x2c')][_0x761c('0x31')]));_0x4b04c8[_0x761c('0x32')]=_0x4b04c8[_0x761c('0x32')]['length']?_0x4b04c8['attributes']:_0x185b19[_0x761c('0x30')];if(!_0x199595[_0x761c('0x2c')][_0x761c('0x33')](_0x761c('0x34'))){_0x4b04c8[_0x761c('0x1a')]=qs[_0x761c('0x1a')](_0x199595[_0x761c('0x2c')][_0x761c('0x1a')]);_0x4b04c8['offset']=qs['offset'](_0x199595[_0x761c('0x2c')][_0x761c('0x19')]);}_0x4b04c8[_0x761c('0x35')]=qs[_0x761c('0x36')](_0x199595[_0x761c('0x2c')][_0x761c('0x36')]);_0x4b04c8[_0x761c('0x37')]=qs['filters'](_[_0x761c('0x38')](_0x199595[_0x761c('0x2c')],_0x185b19[_0x761c('0x2e')]),_0xbe703f);if(_0x199595[_0x761c('0x2c')][_0x761c('0x39')]){_0x4b04c8['where']=_[_0x761c('0x3a')](_0x4b04c8['where'],{'$or':_['map'](_0xbe703f,function(_0x315336){if(_0x315336[_0x761c('0x2a')]!==_0x761c('0x3b')){var _0x1f91da={};_0x1f91da[_0x315336['name']]={'$like':'%'+_0x199595['query'][_0x761c('0x39')]+'%'};return _0x1f91da;}})});}_0x4b04c8=_[_0x761c('0x3a')]({},_0x4b04c8,_0x199595['options']);var _0x5cc2e7={'where':_0x4b04c8[_0x761c('0x37')]};return db[_0x761c('0x27')][_0x761c('0x1b')](_0x5cc2e7)[_0x761c('0x20')](function(_0x3c5e33){_0x50a793[_0x761c('0x1b')]=_0x3c5e33;if(_0x199595[_0x761c('0x2c')][_0x761c('0x3c')]){_0x4b04c8['include']=[{'all':!![]}];}return db[_0x761c('0x27')]['findAll'](_0x4b04c8);})[_0x761c('0x20')](function(_0x5d79d2){_0x50a793['rows']=_0x5d79d2;return _0x50a793;})[_0x761c('0x20')](respondWithFilteredResult(_0x207a1e,_0x4b04c8))[_0x761c('0x3d')](handleError(_0x207a1e,null));};exports[_0x761c('0x3e')]=function(_0xfcecb,_0x34778f){var _0x225927={'raw':!![],'where':{'id':_0xfcecb['params']['id']}},_0x128422={};_0x128422[_0x761c('0x30')]=_[_0x761c('0x2d')](db[_0x761c('0x27')][_0x761c('0x28')]);_0x128422['query']=_[_0x761c('0x2d')](_0xfcecb['query']);_0x128422['filters']=_[_0x761c('0x2f')](_0x128422['model'],_0x128422[_0x761c('0x2c')]);_0x225927[_0x761c('0x32')]=_['intersection'](_0x128422['model'],qs['fields'](_0xfcecb['query'][_0x761c('0x31')]));_0x225927[_0x761c('0x32')]=_0x225927['attributes'][_0x761c('0x3f')]?_0x225927['attributes']:_0x128422[_0x761c('0x30')];if(_0xfcecb[_0x761c('0x2c')][_0x761c('0x3c')]){_0x225927['include']=[{'all':!![]}];}_0x225927=_['merge']({},_0x225927,_0xfcecb[_0x761c('0x40')]);return db[_0x761c('0x27')][_0x761c('0x41')](_0x225927)[_0x761c('0x20')](handleEntityNotFound(_0x34778f,null))[_0x761c('0x20')](respondWithResult(_0x34778f,null))[_0x761c('0x3d')](handleError(_0x34778f,null));};exports[_0x761c('0x42')]=function(_0x1d5bad,_0x16c1c8){if(_0x1d5bad['body']['id']){delete _0x1d5bad[_0x761c('0x43')]['id'];}return db[_0x761c('0x27')][_0x761c('0x41')]({'where':{'id':_0x1d5bad[_0x761c('0x44')]['id']}})[_0x761c('0x20')](handleEntityNotFound(_0x16c1c8,null))[_0x761c('0x20')](saveUpdates(_0x1d5bad[_0x761c('0x43')],null))[_0x761c('0x20')](respondWithResult(_0x16c1c8,null))['catch'](handleError(_0x16c1c8,null));};exports[_0x761c('0x21')]=function(_0x311452,_0x12d7dd){return db[_0x761c('0x27')][_0x761c('0x41')]({'where':{'id':_0x311452[_0x761c('0x44')]['id']}})[_0x761c('0x20')](handleEntityNotFound(_0x12d7dd,null))['then'](removeEntity(_0x12d7dd,null))['catch'](handleError(_0x12d7dd,null));};exports[_0x761c('0x45')]=function(_0x26618a,_0x312eb7){return db[_0x761c('0x27')][_0x761c('0x45')]()['then'](respondWithResult(_0x312eb7,null))[_0x761c('0x3d')](handleError(_0x312eb7,null));}; \ No newline at end of file +var _0x4191=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','CmHopperBlack','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2797af,_0x33c311){var _0x3a6a29=function(_0x5bd7e1){while(--_0x5bd7e1){_0x2797af['push'](_0x2797af['shift']());}};_0x3a6a29(++_0x33c311);}(_0x4191,0x1a8));var _0x1419=function(_0x1e5dd7,_0x1aff9a){_0x1e5dd7=_0x1e5dd7-0x0;var _0x48f942=_0x4191[_0x1e5dd7];return _0x48f942;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1419('0x0'));var jsonpatch=require(_0x1419('0x1'));var rp=require(_0x1419('0x2'));var moment=require(_0x1419('0x3'));var BPromise=require(_0x1419('0x4'));var Mustache=require(_0x1419('0x5'));var util=require(_0x1419('0x6'));var path=require(_0x1419('0x7'));var sox=require('sox');var csv=require(_0x1419('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1419('0x9'));var _=require('lodash');var squel=require(_0x1419('0xa'));var crypto=require('crypto');var jsforce=require(_0x1419('0xb'));var deskjs=require(_0x1419('0xc'));var toCsv=require(_0x1419('0x8'));var querystring=require(_0x1419('0xd'));var Papa=require(_0x1419('0xe'));var Redis=require(_0x1419('0xf'));var authService=require(_0x1419('0x10'));var qs=require(_0x1419('0x11'));var as=require(_0x1419('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1419('0x13'))(_0x1419('0x14'));var utils=require(_0x1419('0x15'));var config=require(_0x1419('0x16'));var licenseUtil=require(_0x1419('0x17'));var db=require(_0x1419('0x18'))['db'];function respondWithStatusCode(_0x324d24,_0x46a1eb){_0x46a1eb=_0x46a1eb||0xcc;return function(_0x50b521){if(_0x50b521){return _0x324d24[_0x1419('0x19')](_0x46a1eb);}return _0x324d24[_0x1419('0x1a')](_0x46a1eb)[_0x1419('0x1b')]();};}function respondWithResult(_0x36717e,_0x4117b4){_0x4117b4=_0x4117b4||0xc8;return function(_0x451e0e){if(_0x451e0e){return _0x36717e[_0x1419('0x1a')](_0x4117b4)[_0x1419('0x1c')](_0x451e0e);}};}function respondWithFilteredResult(_0x225c1c,_0xf7b6aa){return function(_0x49240b){if(_0x49240b){var _0x4f6b50=typeof _0xf7b6aa['offset']===_0x1419('0x1d')&&typeof _0xf7b6aa['limit']===_0x1419('0x1d');var _0x4966d0=_0x49240b[_0x1419('0x1e')];var _0xaa2ef0=_0x4f6b50?0x0:_0xf7b6aa[_0x1419('0x1f')];var _0x49556a=_0x4f6b50?_0x49240b[_0x1419('0x1e')]:_0xf7b6aa[_0x1419('0x1f')]+_0xf7b6aa['limit'];var _0x43053b;if(_0x49556a>=_0x4966d0){_0x49556a=_0x4966d0;_0x43053b=0xc8;}else{_0x43053b=0xce;}_0x225c1c[_0x1419('0x1a')](_0x43053b);return _0x225c1c['set'](_0x1419('0x20'),_0xaa2ef0+'-'+_0x49556a+'/'+_0x4966d0)[_0x1419('0x1c')](_0x49240b);}return null;};}function patchUpdates(_0x3ef806){return function(_0x36f7b7){try{jsonpatch[_0x1419('0x21')](_0x36f7b7,_0x3ef806,!![]);}catch(_0x135088){return BPromise[_0x1419('0x22')](_0x135088);}return _0x36f7b7[_0x1419('0x23')]();};}function saveUpdates(_0xd51685,_0x115266){return function(_0xbe7d0d){if(_0xbe7d0d){return _0xbe7d0d[_0x1419('0x24')](_0xd51685)[_0x1419('0x25')](function(_0x449f83){return _0x449f83;});}return null;};}function removeEntity(_0x59e012,_0x2603de){return function(_0x10424c){if(_0x10424c){return _0x10424c[_0x1419('0x26')]()[_0x1419('0x25')](function(){_0x59e012[_0x1419('0x1a')](0xcc)[_0x1419('0x1b')]();});}};}function handleEntityNotFound(_0x56bcdc,_0x4c882c){return function(_0x41901f){if(!_0x41901f){_0x56bcdc[_0x1419('0x19')](0x194);}return _0x41901f;};}function handleError(_0x45541e,_0x122e95){_0x122e95=_0x122e95||0x1f4;return function(_0x1c437d){logger[_0x1419('0x27')](_0x1c437d[_0x1419('0x28')]);if(_0x1c437d[_0x1419('0x29')]){delete _0x1c437d[_0x1419('0x29')];}_0x45541e['status'](_0x122e95)['send'](_0x1c437d);};}exports[_0x1419('0x2a')]=function(_0x2c6ef7,_0x29aafb){var _0x2ba0fa={},_0x30b7d9={},_0x37fbb3={'count':0x0,'rows':[]};var _0x147384=_[_0x1419('0x2b')](db[_0x1419('0x2c')]['rawAttributes'],function(_0x25c55a){return{'name':_0x25c55a[_0x1419('0x2d')],'type':_0x25c55a['type']['key']};});_0x30b7d9[_0x1419('0x2e')]=_[_0x1419('0x2b')](_0x147384,'name');_0x30b7d9[_0x1419('0x2f')]=_[_0x1419('0x30')](_0x2c6ef7[_0x1419('0x2f')]);_0x30b7d9[_0x1419('0x31')]=_[_0x1419('0x32')](_0x30b7d9['model'],_0x30b7d9[_0x1419('0x2f')]);_0x2ba0fa[_0x1419('0x33')]=_['intersection'](_0x30b7d9[_0x1419('0x2e')],qs[_0x1419('0x34')](_0x2c6ef7['query'][_0x1419('0x34')]));_0x2ba0fa[_0x1419('0x33')]=_0x2ba0fa['attributes'][_0x1419('0x35')]?_0x2ba0fa['attributes']:_0x30b7d9[_0x1419('0x2e')];if(!_0x2c6ef7[_0x1419('0x2f')][_0x1419('0x36')](_0x1419('0x37'))){_0x2ba0fa[_0x1419('0x38')]=qs[_0x1419('0x38')](_0x2c6ef7[_0x1419('0x2f')][_0x1419('0x38')]);_0x2ba0fa[_0x1419('0x1f')]=qs[_0x1419('0x1f')](_0x2c6ef7[_0x1419('0x2f')][_0x1419('0x1f')]);}_0x2ba0fa[_0x1419('0x39')]=qs['sort'](_0x2c6ef7[_0x1419('0x2f')]['sort']);_0x2ba0fa[_0x1419('0x3a')]=qs['filters'](_[_0x1419('0x3b')](_0x2c6ef7[_0x1419('0x2f')],_0x30b7d9[_0x1419('0x31')]),_0x147384);if(_0x2c6ef7['query']['filter']){_0x2ba0fa[_0x1419('0x3a')]=_['merge'](_0x2ba0fa['where'],{'$or':_[_0x1419('0x2b')](_0x147384,function(_0x115f78){if(_0x115f78[_0x1419('0x3c')]!==_0x1419('0x3d')){var _0x178381={};_0x178381[_0x115f78[_0x1419('0x29')]]={'$like':'%'+_0x2c6ef7[_0x1419('0x2f')]['filter']+'%'};return _0x178381;}})});}_0x2ba0fa=_[_0x1419('0x3e')]({},_0x2ba0fa,_0x2c6ef7[_0x1419('0x3f')]);var _0x42ddc7={'where':_0x2ba0fa[_0x1419('0x3a')]};return db['CmHopperBlack'][_0x1419('0x1e')](_0x42ddc7)[_0x1419('0x25')](function(_0xce97d9){_0x37fbb3[_0x1419('0x1e')]=_0xce97d9;if(_0x2c6ef7['query'][_0x1419('0x40')]){_0x2ba0fa[_0x1419('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x1419('0x42')](_0x2ba0fa);})['then'](function(_0x544542){_0x37fbb3['rows']=_0x544542;return _0x37fbb3;})['then'](respondWithFilteredResult(_0x29aafb,_0x2ba0fa))['catch'](handleError(_0x29aafb,null));};exports[_0x1419('0x43')]=function(_0x1f7d1a,_0xe6d9c){var _0x36e4f8={'raw':!![],'where':{'id':_0x1f7d1a[_0x1419('0x44')]['id']}},_0x400666={};_0x400666['model']=_['keys'](db['CmHopperBlack'][_0x1419('0x45')]);_0x400666[_0x1419('0x2f')]=_['keys'](_0x1f7d1a[_0x1419('0x2f')]);_0x400666[_0x1419('0x31')]=_['intersection'](_0x400666[_0x1419('0x2e')],_0x400666['query']);_0x36e4f8[_0x1419('0x33')]=_[_0x1419('0x32')](_0x400666[_0x1419('0x2e')],qs[_0x1419('0x34')](_0x1f7d1a[_0x1419('0x2f')]['fields']));_0x36e4f8[_0x1419('0x33')]=_0x36e4f8[_0x1419('0x33')][_0x1419('0x35')]?_0x36e4f8['attributes']:_0x400666[_0x1419('0x2e')];if(_0x1f7d1a[_0x1419('0x2f')][_0x1419('0x40')]){_0x36e4f8[_0x1419('0x41')]=[{'all':!![]}];}_0x36e4f8=_[_0x1419('0x3e')]({},_0x36e4f8,_0x1f7d1a[_0x1419('0x3f')]);return db[_0x1419('0x2c')][_0x1419('0x46')](_0x36e4f8)[_0x1419('0x25')](handleEntityNotFound(_0xe6d9c,null))[_0x1419('0x25')](respondWithResult(_0xe6d9c,null))[_0x1419('0x47')](handleError(_0xe6d9c,null));};exports['update']=function(_0x30e1c,_0x4d9324){if(_0x30e1c[_0x1419('0x48')]['id']){delete _0x30e1c[_0x1419('0x48')]['id'];}return db[_0x1419('0x2c')][_0x1419('0x46')]({'where':{'id':_0x30e1c[_0x1419('0x44')]['id']}})[_0x1419('0x25')](handleEntityNotFound(_0x4d9324,null))[_0x1419('0x25')](saveUpdates(_0x30e1c[_0x1419('0x48')],null))[_0x1419('0x25')](respondWithResult(_0x4d9324,null))['catch'](handleError(_0x4d9324,null));};exports[_0x1419('0x26')]=function(_0x3ad277,_0x340219){return db[_0x1419('0x2c')]['find']({'where':{'id':_0x3ad277[_0x1419('0x44')]['id']}})[_0x1419('0x25')](handleEntityNotFound(_0x340219,null))[_0x1419('0x25')](removeEntity(_0x340219,null))[_0x1419('0x47')](handleError(_0x340219,null));};exports[_0x1419('0x49')]=function(_0x10b475,_0x269942){return db[_0x1419('0x2c')]['describe']()[_0x1419('0x25')](respondWithResult(_0x269942,null))['catch'](handleError(_0x269942,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 96237c5..d510d83 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 _0xbf83=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','CmHopperBlack','util','../../config/logger','api'];(function(_0x33151f,_0xef8a34){var _0xd97d19=function(_0x32969c){while(--_0x32969c){_0x33151f['push'](_0x33151f['shift']());}};_0xd97d19(++_0xef8a34);}(_0xbf83,0x1cb));var _0x3bf8=function(_0xda3db,_0x28bb11){_0xda3db=_0xda3db-0x0;var _0x3b054a=_0xbf83[_0xda3db];return _0x3b054a;};'use strict';var _=require('lodash');var util=require(_0x3bf8('0x0'));var logger=require(_0x3bf8('0x1'))(_0x3bf8('0x2'));var moment=require(_0x3bf8('0x3'));var BPromise=require(_0x3bf8('0x4'));var rp=require(_0x3bf8('0x5'));var fs=require('fs');var path=require(_0x3bf8('0x6'));var rimraf=require(_0x3bf8('0x7'));var config=require(_0x3bf8('0x8'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x5ce7e6,_0x143183){return _0x5ce7e6[_0x3bf8('0x9')](_0x3bf8('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe759=['request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','bluebird'];(function(_0x430ea6,_0x58db3b){var _0x8c837=function(_0x1123ef){while(--_0x1123ef){_0x430ea6['push'](_0x430ea6['shift']());}};_0x8c837(++_0x58db3b);}(_0xe759,0x1dc));var _0x9e75=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe759[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x9e75('0x0'));var util=require(_0x9e75('0x1'));var logger=require('../../config/logger')(_0x9e75('0x2'));var moment=require('moment');var BPromise=require(_0x9e75('0x3'));var rp=require(_0x9e75('0x4'));var fs=require('fs');var path=require(_0x9e75('0x5'));var rimraf=require('rimraf');var config=require(_0x9e75('0x6'));var attributes=require(_0x9e75('0x7'));module[_0x9e75('0x8')]=function(_0x50b25e,_0x11ca2e){return _0x50b25e[_0x9e75('0x9')](_0x9e75('0xa'),attributes,{'tableName':_0x9e75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 7faa8a0..c89b2c9 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 _0x33d9=['error','code','message','catch','GetCmHopperBlack','options','raw','where','attributes','limit','map','include','model','UpdateCmHopperBlack','body','DestroyCmHopperBlack','CmHopperBlack','destroy','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x33d9,0xa2));var _0x933d=function(_0x512e00,_0x1af120){_0x512e00=_0x512e00-0x0;var _0x371e14=_0x33d9[_0x512e00];return _0x371e14;};'use strict';var _=require(_0x933d('0x0'));var util=require(_0x933d('0x1'));var moment=require(_0x933d('0x2'));var BPromise=require(_0x933d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x933d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x933d('0x5'));var logger=require(_0x933d('0x6'))(_0x933d('0x7'));var config=require(_0x933d('0x8'));var jayson=require(_0x933d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x573164,_0xd581d8,_0x1508ae){return new BPromise(function(_0x42784f,_0x44371f){return client[_0x933d('0xa')](_0x573164,_0x1508ae)[_0x933d('0xb')](function(_0x55ef19){logger[_0x933d('0xc')](_0x933d('0xd'),_0xd581d8,'request\x20sent');logger[_0x933d('0xe')](_0x933d('0xf'),_0xd581d8,_0x933d('0x10'),JSON[_0x933d('0x11')](_0x55ef19));if(_0x55ef19[_0x933d('0x12')]){if(_0x55ef19[_0x933d('0x12')][_0x933d('0x13')]===0x1f4){logger['error'](_0x933d('0xd'),_0xd581d8,_0x55ef19[_0x933d('0x12')][_0x933d('0x14')]);return _0x44371f(_0x55ef19['error']['message']);}logger['error'](_0x933d('0xd'),_0xd581d8,_0x55ef19[_0x933d('0x12')][_0x933d('0x14')]);return _0x42784f(_0x55ef19[_0x933d('0x12')][_0x933d('0x14')]);}else{logger[_0x933d('0xc')](_0x933d('0xd'),_0xd581d8,'request\x20sent');_0x42784f(_0x55ef19['result'][_0x933d('0x14')]);}})[_0x933d('0x15')](function(_0x52d449){logger[_0x933d('0x12')](_0x933d('0xd'),_0xd581d8,_0x52d449);_0x44371f(_0x52d449);});});}exports[_0x933d('0x16')]=function(_0x38cfef){var _0x1be7dc=this;return new Promise(function(_0x3b9264,_0x35c66e){return db['CmHopperBlack']['findAll']({'raw':_0x38cfef[_0x933d('0x17')]?_0x38cfef[_0x933d('0x17')][_0x933d('0x18')]===undefined?!![]:![]:!![],'where':_0x38cfef[_0x933d('0x17')]?_0x38cfef[_0x933d('0x17')][_0x933d('0x19')]||null:null,'attributes':_0x38cfef[_0x933d('0x17')]?_0x38cfef['options'][_0x933d('0x1a')]||null:null,'limit':_0x38cfef[_0x933d('0x17')]?_0x38cfef['options'][_0x933d('0x1b')]||null:null,'include':_0x38cfef[_0x933d('0x17')]?_0x38cfef[_0x933d('0x17')]['include']?_[_0x933d('0x1c')](_0x38cfef[_0x933d('0x17')][_0x933d('0x1d')],function(_0x20a2ba){return{'model':db[_0x20a2ba['model']],'as':_0x20a2ba['as'],'attributes':_0x20a2ba[_0x933d('0x1a')],'include':_0x20a2ba['include']?_[_0x933d('0x1c')](_0x20a2ba[_0x933d('0x1d')],function(_0x33fc70){return{'model':db[_0x33fc70[_0x933d('0x1e')]],'as':_0x33fc70['as'],'attributes':_0x33fc70[_0x933d('0x1a')],'include':_0x33fc70[_0x933d('0x1d')]?_['map'](_0x33fc70[_0x933d('0x1d')],function(_0x165cf3){return{'model':db[_0x165cf3[_0x933d('0x1e')]],'as':_0x165cf3['as'],'attributes':_0x165cf3[_0x933d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x933d('0xb')](function(_0x34d0d8){logger['info'](_0x933d('0x16'),_0x38cfef);logger[_0x933d('0xe')](_0x933d('0x16'),_0x38cfef,JSON['stringify'](_0x34d0d8));_0x3b9264(_0x34d0d8);})[_0x933d('0x15')](function(_0x556cf5){logger[_0x933d('0x12')]('GetCmHopperBlack',_0x556cf5[_0x933d('0x14')],_0x38cfef);_0x35c66e(_0x1be7dc[_0x933d('0x12')](0x1f4,_0x556cf5[_0x933d('0x14')]));});});};exports[_0x933d('0x1f')]=function(_0x57d808){var _0x3ed2a3=this;return new Promise(function(_0x353244,_0x5e95bd){return db['CmHopperBlack']['update'](_0x57d808[_0x933d('0x20')],{'raw':_0x57d808[_0x933d('0x17')]?_0x57d808[_0x933d('0x17')][_0x933d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d808['options']?_0x57d808[_0x933d('0x17')][_0x933d('0x19')]||null:null,'attributes':_0x57d808[_0x933d('0x17')]?_0x57d808[_0x933d('0x17')][_0x933d('0x1a')]||null:null,'limit':_0x57d808[_0x933d('0x17')]?_0x57d808[_0x933d('0x17')][_0x933d('0x1b')]||null:null})['then'](function(_0x1fce35){logger[_0x933d('0xc')](_0x933d('0x1f'),_0x57d808);logger[_0x933d('0xe')]('UpdateCmHopperBlack',_0x57d808,JSON[_0x933d('0x11')](_0x1fce35));_0x353244(_0x1fce35);})[_0x933d('0x15')](function(_0x5bc8ab){logger[_0x933d('0x12')](_0x933d('0x1f'),_0x5bc8ab['message'],_0x57d808);_0x5e95bd(_0x3ed2a3[_0x933d('0x12')](0x1f4,_0x5bc8ab[_0x933d('0x14')]));});});};exports[_0x933d('0x21')]=function(_0x181e2e){var _0x3fc91c=this;return new Promise(function(_0x4c237b,_0x201067){return db[_0x933d('0x22')][_0x933d('0x23')]({'where':_0x181e2e['options']?_0x181e2e[_0x933d('0x17')]['where']||null:null})['then'](function(_0x2ab260){logger['info'](_0x933d('0x21'),_0x181e2e);logger[_0x933d('0xe')]('DestroyCmHopperBlack',_0x181e2e,JSON[_0x933d('0x11')](_0x2ab260));_0x4c237b(_0x2ab260);})[_0x933d('0x15')](function(_0x1743f0){logger['error'](_0x933d('0x21'),_0x1743f0[_0x933d('0x14')],_0x181e2e);_0x201067(_0x3fc91c[_0x933d('0x12')](0x1f4,_0x1743f0[_0x933d('0x14')]));});});}; \ No newline at end of file +var _0xe598=['message','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','limit','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x236e76,_0x3731e0){var _0x4736b3=function(_0x1bad02){while(--_0x1bad02){_0x236e76['push'](_0x236e76['shift']());}};_0x4736b3(++_0x3731e0);}(_0xe598,0x15e));var _0x8e59=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0xe598[_0x1f5887];return _0x21774b;};'use strict';var _=require(_0x8e59('0x0'));var util=require(_0x8e59('0x1'));var moment=require(_0x8e59('0x2'));var BPromise=require(_0x8e59('0x3'));var rs=require(_0x8e59('0x4'));var fs=require('fs');var Redis=require(_0x8e59('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e59('0x6'));var logger=require(_0x8e59('0x7'))(_0x8e59('0x8'));var config=require(_0x8e59('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e59('0xa')][_0x8e59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9484b,_0x5c98f7,_0x2c4997){return new BPromise(function(_0xa2b2a1,_0xbba243){return client[_0x8e59('0xc')](_0x9484b,_0x2c4997)[_0x8e59('0xd')](function(_0x58616a){logger[_0x8e59('0xe')](_0x8e59('0xf'),_0x5c98f7,_0x8e59('0x10'));logger[_0x8e59('0x11')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x5c98f7,_0x8e59('0x10'),JSON[_0x8e59('0x12')](_0x58616a));if(_0x58616a[_0x8e59('0x13')]){if(_0x58616a[_0x8e59('0x13')]['code']===0x1f4){logger[_0x8e59('0x13')](_0x8e59('0xf'),_0x5c98f7,_0x58616a[_0x8e59('0x13')][_0x8e59('0x14')]);return _0xbba243(_0x58616a[_0x8e59('0x13')][_0x8e59('0x14')]);}logger[_0x8e59('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x5c98f7,_0x58616a[_0x8e59('0x13')][_0x8e59('0x14')]);return _0xa2b2a1(_0x58616a[_0x8e59('0x13')][_0x8e59('0x14')]);}else{logger[_0x8e59('0xe')](_0x8e59('0xf'),_0x5c98f7,_0x8e59('0x10'));_0xa2b2a1(_0x58616a[_0x8e59('0x15')][_0x8e59('0x14')]);}})[_0x8e59('0x16')](function(_0x11933e){logger['error'](_0x8e59('0xf'),_0x5c98f7,_0x11933e);_0xbba243(_0x11933e);});});}exports['GetCmHopperBlack']=function(_0x40220f){var _0x31bfd3=this;return new Promise(function(_0xf30dd2,_0x1fbe5e){return db[_0x8e59('0x17')][_0x8e59('0x18')]({'raw':_0x40220f['options']?_0x40220f[_0x8e59('0x19')][_0x8e59('0x1a')]===undefined?!![]:![]:!![],'where':_0x40220f[_0x8e59('0x19')]?_0x40220f[_0x8e59('0x19')][_0x8e59('0x1b')]||null:null,'attributes':_0x40220f['options']?_0x40220f[_0x8e59('0x19')][_0x8e59('0x1c')]||null:null,'limit':_0x40220f[_0x8e59('0x19')]?_0x40220f[_0x8e59('0x19')]['limit']||null:null,'include':_0x40220f[_0x8e59('0x19')]?_0x40220f['options'][_0x8e59('0x1d')]?_['map'](_0x40220f[_0x8e59('0x19')][_0x8e59('0x1d')],function(_0x172320){return{'model':db[_0x172320['model']],'as':_0x172320['as'],'attributes':_0x172320[_0x8e59('0x1c')],'include':_0x172320[_0x8e59('0x1d')]?_[_0x8e59('0x1e')](_0x172320[_0x8e59('0x1d')],function(_0x34fb3c){return{'model':db[_0x34fb3c[_0x8e59('0x1f')]],'as':_0x34fb3c['as'],'attributes':_0x34fb3c[_0x8e59('0x1c')],'include':_0x34fb3c[_0x8e59('0x1d')]?_['map'](_0x34fb3c[_0x8e59('0x1d')],function(_0x2040e5){return{'model':db[_0x2040e5['model']],'as':_0x2040e5['as'],'attributes':_0x2040e5[_0x8e59('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8e59('0xd')](function(_0x41ff48){logger[_0x8e59('0xe')](_0x8e59('0x20'),_0x40220f);logger[_0x8e59('0x11')](_0x8e59('0x20'),_0x40220f,JSON[_0x8e59('0x12')](_0x41ff48));_0xf30dd2(_0x41ff48);})['catch'](function(_0x6f3f62){logger[_0x8e59('0x13')]('GetCmHopperBlack',_0x6f3f62[_0x8e59('0x14')],_0x40220f);_0x1fbe5e(_0x31bfd3[_0x8e59('0x13')](0x1f4,_0x6f3f62[_0x8e59('0x14')]));});});};exports[_0x8e59('0x21')]=function(_0x12f64f){var _0x4e0476=this;return new Promise(function(_0x3ebf54,_0x3287e0){return db[_0x8e59('0x17')][_0x8e59('0x22')](_0x12f64f['body'],{'raw':_0x12f64f['options']?_0x12f64f[_0x8e59('0x19')][_0x8e59('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12f64f[_0x8e59('0x19')]?_0x12f64f[_0x8e59('0x19')][_0x8e59('0x1b')]||null:null,'attributes':_0x12f64f[_0x8e59('0x19')]?_0x12f64f[_0x8e59('0x19')][_0x8e59('0x1c')]||null:null,'limit':_0x12f64f[_0x8e59('0x19')]?_0x12f64f['options'][_0x8e59('0x23')]||null:null})[_0x8e59('0xd')](function(_0x538d1b){logger['info'](_0x8e59('0x21'),_0x12f64f);logger['debug'](_0x8e59('0x21'),_0x12f64f,JSON[_0x8e59('0x12')](_0x538d1b));_0x3ebf54(_0x538d1b);})['catch'](function(_0x52cf83){logger[_0x8e59('0x13')](_0x8e59('0x21'),_0x52cf83[_0x8e59('0x14')],_0x12f64f);_0x3287e0(_0x4e0476[_0x8e59('0x13')](0x1f4,_0x52cf83[_0x8e59('0x14')]));});});};exports[_0x8e59('0x24')]=function(_0x2d1ffd){var _0x5457ea=this;return new Promise(function(_0x333d5c,_0x4d029a){return db[_0x8e59('0x17')]['destroy']({'where':_0x2d1ffd[_0x8e59('0x19')]?_0x2d1ffd[_0x8e59('0x19')][_0x8e59('0x1b')]||null:null})['then'](function(_0x2fbf43){logger[_0x8e59('0xe')]('DestroyCmHopperBlack',_0x2d1ffd);logger[_0x8e59('0x11')](_0x8e59('0x24'),_0x2d1ffd,JSON[_0x8e59('0x12')](_0x2fbf43));_0x333d5c(_0x2fbf43);})[_0x8e59('0x16')](function(_0x44d06b){logger['error']('DestroyCmHopperBlack',_0x44d06b[_0x8e59('0x14')],_0x2d1ffd);_0x4d029a(_0x5457ea[_0x8e59('0x13')](0x1f4,_0x44d06b[_0x8e59('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 796ac27..b1da6ec 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 _0x5334=['isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','index','describe','get','/:id'];(function(_0x544847,_0x18fac5){var _0xa1e70d=function(_0x2cb91c){while(--_0x2cb91c){_0x544847['push'](_0x544847['shift']());}};_0xa1e70d(++_0x18fac5);}(_0x5334,0x84));var _0x4533=function(_0x2dda7b,_0x3364b8){_0x2dda7b=_0x2dda7b-0x0;var _0x172693=_0x5334[_0x2dda7b];return _0x172693;};'use strict';var multer=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var path=require(_0x4533('0x2'));var timeout=require(_0x4533('0x3'));var express=require(_0x4533('0x4'));var router=express['Router']();var fs_extra=require(_0x4533('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4533('0x6'));var config=require(_0x4533('0x7'));var controller=require('./cmHopperBlack.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4533('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4533('0x9')]);router[_0x4533('0xa')](_0x4533('0xb'),auth[_0x4533('0xc')](),controller[_0x4533('0xd')]);router[_0x4533('0xe')](_0x4533('0xb'),auth['isAuthenticated'](),controller[_0x4533('0xf')]);router[_0x4533('0x10')](_0x4533('0xb'),auth[_0x4533('0xc')](),controller['destroy']);module[_0x4533('0x11')]=router; \ No newline at end of file +var _0xa456=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','put','/:id','update','delete','destroy','exports','multer'];(function(_0x18addd,_0x50858a){var _0x905536=function(_0x8ede9d){while(--_0x8ede9d){_0x18addd['push'](_0x18addd['shift']());}};_0x905536(++_0x50858a);}(_0xa456,0x142));var _0x6a45=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xa456[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var fs_extra=require(_0x6a45('0x5'));var auth=require(_0x6a45('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a45('0x7'));var controller=require(_0x6a45('0x8'));router[_0x6a45('0x9')]('/',auth[_0x6a45('0xa')](),controller['index']);router[_0x6a45('0x9')](_0x6a45('0xb'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x9')]('/:id',auth[_0x6a45('0xa')](),controller['show']);router[_0x6a45('0xd')](_0x6a45('0xe'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xf')]);router[_0x6a45('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6a45('0x11')]);module[_0x6a45('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 eb2a3d4..f06c9c0 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 _0xd1fc=['BOOLEAN','sequelize','INTEGER','STRING','DATE','setDataValue','followuptime','diff','seconds'];(function(_0x16f6e4,_0x288b61){var _0x275354=function(_0x43865e){while(--_0x43865e){_0x16f6e4['push'](_0x16f6e4['shift']());}};_0x275354(++_0x288b61);}(_0xd1fc,0x7f));var _0xcd1f=function(_0x5d3bac,_0x2eb657){_0x5d3bac=_0x5d3bac-0x0;var _0x2c8242=_0xd1fc[_0x5d3bac];return _0x2c8242;};'use strict';var Sequelize=require(_0xcd1f('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xcd1f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xcd1f('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xcd1f('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xcd1f('0x2')]},'originatecalleridname':{'type':Sequelize[_0xcd1f('0x2')]},'calleridnum':{'type':Sequelize[_0xcd1f('0x2')]},'calleridname':{'type':Sequelize[_0xcd1f('0x2')]},'starttime':{'type':Sequelize[_0xcd1f('0x3')]},'responsetime':{'type':Sequelize[_0xcd1f('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xcd1f('0x3')]},'endtime':{'type':Sequelize[_0xcd1f('0x3')]},'ringtime':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcd1f('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xcd1f('0x2')]},'membername':{'type':Sequelize[_0xcd1f('0x2')]},'reason':{'type':Sequelize[_0xcd1f('0x2')]},'disposition':{'type':Sequelize[_0xcd1f('0x2')]},'secondDisposition':{'type':Sequelize[_0xcd1f('0x2')]},'thirdDisposition':{'type':Sequelize[_0xcd1f('0x2')]},'dispositionat':{'type':Sequelize[_0xcd1f('0x3')],'set':function(_0x1acb47){var _0x37c195=this['getDataValue']('endtime');if(_0x37c195&&_0x1acb47){this[_0xcd1f('0x4')](_0xcd1f('0x5'),moment(_0x1acb47)[_0xcd1f('0x6')](moment(_0x37c195),_0xcd1f('0x7')));}}},'amd':{'type':Sequelize[_0xcd1f('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xcd1f('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xcd1f('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xcd1f('0x3')]},'callback':{'type':Sequelize[_0xcd1f('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcd1f('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcd1f('0x3')]},'deleted':{'type':Sequelize[_0xcd1f('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xcd1f('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xcd1f('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcd1f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaa4c=['seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue','setDataValue','followuptime','diff'];(function(_0x19c0cf,_0x4d51a2){var _0x4b4fe5=function(_0x20e501){while(--_0x20e501){_0x19c0cf['push'](_0x19c0cf['shift']());}};_0x4b4fe5(++_0x4d51a2);}(_0xaa4c,0x10a));var _0xcaa4=function(_0x1c6738,_0x346582){_0x1c6738=_0x1c6738-0x0;var _0x1263b1=_0xaa4c[_0x1c6738];return _0x1263b1;};'use strict';var Sequelize=require(_0xcaa4('0x0'));var moment=require(_0xcaa4('0x1'));module[_0xcaa4('0x2')]={'state':{'type':Sequelize[_0xcaa4('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xcaa4('0x4')]},'countbusyretry':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xcaa4('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xcaa4('0x5')]},'originatecalleridname':{'type':Sequelize[_0xcaa4('0x5')]},'calleridnum':{'type':Sequelize[_0xcaa4('0x5')]},'calleridname':{'type':Sequelize[_0xcaa4('0x5')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xcaa4('0x4')]},'answertime':{'type':Sequelize[_0xcaa4('0x4')]},'droptime':{'type':Sequelize[_0xcaa4('0x4')]},'endtime':{'type':Sequelize[_0xcaa4('0x4')]},'ringtime':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcaa4('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xcaa4('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xcaa4('0x5')]},'disposition':{'type':Sequelize[_0xcaa4('0x5')]},'secondDisposition':{'type':Sequelize[_0xcaa4('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xcaa4('0x4')],'set':function(_0x4e928a){var _0x855bc6=this[_0xcaa4('0x6')]('endtime');if(_0x855bc6&&_0x4e928a){this[_0xcaa4('0x7')](_0xcaa4('0x8'),moment(_0x4e928a)[_0xcaa4('0x9')](moment(_0x855bc6),_0xcaa4('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xcaa4('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xcaa4('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xcaa4('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xcaa4('0x4')]},'callback':{'type':Sequelize[_0xcaa4('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcaa4('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xcaa4('0x4')]},'recallme':{'type':Sequelize[_0xcaa4('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xcaa4('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcaa4('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcaa4('0x3')],'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 2f6cd25..36adde2 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 _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3cbf29,_0x502fcc){var _0xac4006=function(_0x32fb98){while(--_0x32fb98){_0x3cbf29['push'](_0x3cbf29['shift']());}};_0xac4006(++_0x502fcc);}(_0x0295,0x1f0));var _0x5029=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x0295[_0x400322];return _0xfdd597;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file +var _0x01d9=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','updatedAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x5bd072,_0x3f02d6){var _0x17c868=function(_0x1bcfe4){while(--_0x1bcfe4){_0x5bd072['push'](_0x5bd072['shift']());}};_0x17c868(++_0x3f02d6);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':!![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['CmHopperFinal'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')]()[_0x901d('0x28')](respondWithResult(_0x27459b,null))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x2cd965,_0x23f2a9){if(_0x2cd965['body']['uniqueid']){delete _0x2cd965[_0x901d('0x4c')][_0x901d('0x4d')];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'uniqueid':_0x2cd965[_0x901d('0x48')]['id']}})['then'](handleEntityNotFound(_0x23f2a9,null))['then'](saveUpdates(_0x2cd965[_0x901d('0x4c')],null))[_0x901d('0x28')](respondWithResult(_0x23f2a9,null))['catch'](handleError(_0x23f2a9,null));};exports[_0x901d('0x4e')]=function(_0x165207,_0x4d2b2d,_0x4512e5){return db['CmHopperFinal'][_0x901d('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x165207[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),'noAnswerContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x56')))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db['sequelize']['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),'dropContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x4d2b2d,null))['then'](respondWithResult(_0x4d2b2d,null))[_0x901d('0x46')](handleError(_0x4d2b2d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xabab57,_0x219c23,_0xecc8f9){return db[_0x901d('0x2f')][_0x901d('0x4f')]({'raw':![],'where':{'CampaignId':_0xabab57[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),_0x901d('0x5f')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),_0x901d('0x60')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')]['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x219c23,null))[_0x901d('0x28')](respondWithResult(_0x219c23,null))[_0x901d('0x46')](handleError(_0x219c23,null));};exports[_0x901d('0x61')]=function(_0x5cff96,_0x130dfb,_0x302049){return db[_0x901d('0x62')]['find']({'where':{'id':_0x5cff96[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x130dfb,null))[_0x901d('0x28')](function(_0x4b5e3b){var _0x576d50;if(_0x4b5e3b){_0x576d50=squel['insert']()[_0x901d('0x63')](_0x901d('0x64'))['fromQuery'](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x68'),_0x901d('0x69'),'updatedAt'],squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))['field'](_0x901d('0x6e'),'scheduledAt')[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))[_0x901d('0x6b')](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x70'),_0x901d('0x68'))['field'](_0x901d('0x6e'),_0x901d('0x69'))['field'](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')['where'](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id']['toString']())[_0x901d('0x3e')](_0x901d('0x72'),_0x5cff96[_0x901d('0x4c')][_0x901d('0x73')][_0x901d('0x74')]())['where'](_0x901d('0x75'))[_0x901d('0x3e')](_0x901d('0x76'),squel['select']()[_0x901d('0x6b')](_0x901d('0x6d'))[_0x901d('0x77')](_0x901d('0x64'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')](_0x901d('0x7a')))[_0x901d('0x7b')]('ContactId'))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x576d50);}return[];})['then'](respondWithResult(_0x130dfb,null))[_0x901d('0x46')](handleError(_0x130dfb,null));};exports[_0x901d('0x7c')]=function(_0xa14cbd,_0x34f33f,_0x785f77){return db[_0x901d('0x7d')][_0x901d('0x4a')]({'where':{'id':_0xa14cbd[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x34f33f,null))[_0x901d('0x28')](function(_0x28b640){var _0x45601a;if(_0x28b640){_0x45601a=squel[_0x901d('0x7e')]()[_0x901d('0x63')](_0x901d('0x64'))[_0x901d('0x7f')](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x80'),_0x901d('0x69'),_0x901d('0x81')],squel['select']()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))[_0x901d('0x6b')](_0x901d('0x6e'),_0x901d('0x65'))[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))['field'](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x82'),'CampaignId')['field']('NOW()','createdAt')[_0x901d('0x6b')](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')[_0x901d('0x3e')]('CampaignId\x20=\x20?',_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x20?',_0xa14cbd['body'][_0x901d('0x73')][_0x901d('0x74')]())[_0x901d('0x3e')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x901d('0x6a')]()[_0x901d('0x6b')]('phone')[_0x901d('0x77')]('cm_hopper')['where'](_0x901d('0x83'),_0xa14cbd['params']['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x83'),_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x204'))['group'](_0x901d('0x66')))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x45601a);}return[];})[_0x901d('0x28')](respondWithResult(_0x34f33f,null))[_0x901d('0x46')](handleError(_0x34f33f,null));};exports[_0x901d('0x84')]=function(_0x306491,_0x3cb399,_0x101067){return db['CmHopper'][_0x901d('0x85')]({'where':{'VoiceQueueId':_0x306491[_0x901d('0x4c')][_0x901d('0x68')],'CampaignId':_0x306491[_0x901d('0x4c')][_0x901d('0x80')],'ContactId':_0x306491[_0x901d('0x4c')][_0x901d('0x66')]}})[_0x901d('0x28')](handleEntityNotFound(_0x3cb399,null))[_0x901d('0x28')](function(_0x17b7ef){if(_0x17b7ef){return _0x17b7ef;}return null;})[_0x901d('0x28')](respondWithResult(_0x3cb399,null))[_0x901d('0x46')](handleError(_0x3cb399,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9b7cec5..29590f9 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 _0xc14c=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','exports'];(function(_0x11f20e,_0xfe98c8){var _0x56052f=function(_0x5a42e8){while(--_0x5a42e8){_0x11f20e['push'](_0x11f20e['shift']());}};_0x56052f(++_0xfe98c8);}(_0xc14c,0x1b1));var _0xcc14=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc14c[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xcc14('0x0'));var util=require(_0xcc14('0x1'));var logger=require(_0xcc14('0x2'))('api');var moment=require(_0xcc14('0x3'));var BPromise=require(_0xcc14('0x4'));var rp=require(_0xcc14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xcc14('0x6')]=function(_0x13c84e,_0x35b491){return _0x13c84e['define'](_0xcc14('0x7'),attributes,{'tableName':_0xcc14('0x8'),'paranoid':![],'indexes':[{'name':_0xcc14('0x9'),'fields':['calleridnum']},{'name':_0xcc14('0xa'),'fields':[_0xcc14('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x493f=['uniqueid','util','../../config/logger','api','request-promise','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x493f,0x1c3));var _0xf493=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x493f[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xf493('0x0'));var logger=require(_0xf493('0x1'))(_0xf493('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf493('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf493('0x4'));var attributes=require(_0xf493('0x5'));module['exports']=function(_0x81e9a7,_0x25f826){return _0x81e9a7[_0xf493('0x6')](_0xf493('0x7'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xf493('0x8'),'fields':[_0xf493('0x8')]},{'name':'uniqueid','fields':[_0xf493('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index c5f3f41..8f66a89 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(_0x35ae91,_0x3308ab){var _0x19b5ba=function(_0x39a21a){while(--_0x39a21a){_0x35ae91['push'](_0x35ae91['shift']());}};_0x19b5ba(++_0x3308ab);}(_0xb10b,0x12a));var _0xbb10=function(_0x423f1c,_0x2adb8c){_0x423f1c=_0x423f1c-0x0;var _0xebed4c=_0xb10b[_0x423f1c];return _0xebed4c;};'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 _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(_0x6ddc48,_0x73fe3d){var _0x6d60c6=function(_0x336e41){while(--_0x336e41){_0x6ddc48['push'](_0x6ddc48['shift']());}};_0x6d60c6(++_0x73fe3d);}(_0xb10b,0x12a));var _0xbb10=function(_0xafb8e6,_0x4b3a6b){_0xafb8e6=_0xafb8e6-0x0;var _0x36eec3=_0xb10b[_0xafb8e6];return _0x36eec3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 5000c35..9884409 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 _0xec81=['countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id'];(function(_0x2ec747,_0x2bf5ff){var _0x3b3d3c=function(_0x162e98){while(--_0x162e98){_0x2ec747['push'](_0x2ec747['shift']());}};_0x3b3d3c(++_0x2bf5ff);}(_0xec81,0xf6));var _0x1ec8=function(_0x30f242,_0x361217){_0x30f242=_0x30f242-0x0;var _0x203e30=_0xec81[_0x30f242];return _0x203e30;};'use strict';var multer=require(_0x1ec8('0x0'));var util=require(_0x1ec8('0x1'));var path=require(_0x1ec8('0x2'));var timeout=require(_0x1ec8('0x3'));var express=require('express');var router=express[_0x1ec8('0x4')]();var fs_extra=require(_0x1ec8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1ec8('0x6'));var config=require('../../config/environment');var controller=require(_0x1ec8('0x7'));router[_0x1ec8('0x8')]('/',auth[_0x1ec8('0x9')](),controller[_0x1ec8('0xa')]);router['get'](_0x1ec8('0xb'),auth[_0x1ec8('0x9')](),controller['describe']);router['get']('/:id',auth[_0x1ec8('0x9')](),controller['show']);router['get'](_0x1ec8('0xc'),auth[_0x1ec8('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x1ec8('0x8')](_0x1ec8('0xd'),auth[_0x1ec8('0x9')](),controller[_0x1ec8('0xe')]);router[_0x1ec8('0xf')](_0x1ec8('0x10'),auth[_0x1ec8('0x9')](),controller[_0x1ec8('0x11')]);router[_0x1ec8('0xf')](_0x1ec8('0x12'),auth[_0x1ec8('0x9')](),controller[_0x1ec8('0x13')]);router[_0x1ec8('0xf')](_0x1ec8('0x14'),auth[_0x1ec8('0x9')](),controller[_0x1ec8('0x15')]);router[_0x1ec8('0x16')](_0x1ec8('0x17'),auth[_0x1ec8('0x9')](),controller[_0x1ec8('0x18')]);module[_0x1ec8('0x19')]=router; \ No newline at end of file +var _0xbd4e=['/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','get','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id','update','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xbd4e,0x1cb));var _0xebd4=function(_0x1ed22a,_0x4ff3cf){_0x1ed22a=_0x1ed22a-0x0;var _0x6d1abc=_0xbd4e[_0x1ed22a];return _0x6d1abc;};'use strict';var multer=require(_0xebd4('0x0'));var util=require(_0xebd4('0x1'));var path=require('path');var timeout=require(_0xebd4('0x2'));var express=require(_0xebd4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xebd4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xebd4('0x5'));var controller=require(_0xebd4('0x6'));router['get']('/',auth[_0xebd4('0x7')](),controller[_0xebd4('0x8')]);router['get'](_0xebd4('0x9'),auth[_0xebd4('0x7')](),controller[_0xebd4('0xa')]);router['get']('/:id',auth[_0xebd4('0x7')](),controller[_0xebd4('0xb')]);router['get'](_0xebd4('0xc'),auth[_0xebd4('0x7')](),controller[_0xebd4('0xd')]);router[_0xebd4('0xe')](_0xebd4('0xf'),auth[_0xebd4('0x7')](),controller[_0xebd4('0x10')]);router['post'](_0xebd4('0x11'),auth['isAuthenticated'](),controller[_0xebd4('0x12')]);router[_0xebd4('0x13')]('/voice/campaign/moveContacts/:id',auth[_0xebd4('0x7')](),controller[_0xebd4('0x14')]);router[_0xebd4('0x13')]('/checkContactHopper',auth[_0xebd4('0x7')](),controller[_0xebd4('0x15')]);router[_0xebd4('0x16')](_0xebd4('0x17'),auth[_0xebd4('0x7')](),controller[_0xebd4('0x18')]);module[_0xebd4('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index d2cc9cf..5896a6b 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 _0xb1ad=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0xbddd94,_0x3435df){var _0x4b1d19=function(_0x14048e){while(--_0x14048e){_0xbddd94['push'](_0xbddd94['shift']());}};_0x4b1d19(++_0x3435df);}(_0xb1ad,0x184));var _0xdb1a=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xb1ad[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0xdb1a('0x0'));module[_0xdb1a('0x1')]={'state':{'type':Sequelize[_0xdb1a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xdb1a('0x3')]},'scheduledat':{'type':Sequelize[_0xdb1a('0x4')]},'countbusyretry':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdb1a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xdb1a('0x3')]},'originatecalleridname':{'type':Sequelize[_0xdb1a('0x3')]},'calleridnum':{'type':Sequelize[_0xdb1a('0x3')]},'calleridname':{'type':Sequelize[_0xdb1a('0x3')]},'starttime':{'type':Sequelize[_0xdb1a('0x4')]},'responsetime':{'type':Sequelize[_0xdb1a('0x4')]},'answertime':{'type':Sequelize[_0xdb1a('0x4')]},'droptime':{'type':Sequelize[_0xdb1a('0x4')]},'endtime':{'type':Sequelize[_0xdb1a('0x4')]},'ringtime':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdb1a('0x3')]},'campaign':{'type':Sequelize[_0xdb1a('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xdb1a('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdb1a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdb1a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdb1a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdb1a('0x4')]},'recallme':{'type':Sequelize[_0xdb1a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xdb1a('0x4')]},'edited':{'type':Sequelize[_0xdb1a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdb1a('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e5f=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x8e5f,0xd8));var _0xf8e5=function(_0x5eb0b2,_0x15a498){_0x5eb0b2=_0x5eb0b2-0x0;var _0x3b87f5=_0x8e5f[_0x5eb0b2];return _0x3b87f5;};'use strict';var Sequelize=require('sequelize');module[_0xf8e5('0x0')]={'state':{'type':Sequelize[_0xf8e5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf8e5('0x2')]},'scheduledat':{'type':Sequelize[_0xf8e5('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf8e5('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xf8e5('0x2')]},'calleridnum':{'type':Sequelize[_0xf8e5('0x2')]},'calleridname':{'type':Sequelize[_0xf8e5('0x2')]},'starttime':{'type':Sequelize[_0xf8e5('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xf8e5('0x3')]},'droptime':{'type':Sequelize[_0xf8e5('0x3')]},'endtime':{'type':Sequelize[_0xf8e5('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf8e5('0x2')]},'campaign':{'type':Sequelize[_0xf8e5('0x2')]},'campaigntype':{'type':Sequelize[_0xf8e5('0x2')]},'membername':{'type':Sequelize[_0xf8e5('0x2')]},'reason':{'type':Sequelize[_0xf8e5('0x2')]},'amd':{'type':Sequelize[_0xf8e5('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf8e5('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xf8e5('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf8e5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf8e5('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xf8e5('0x3')]},'edited':{'type':Sequelize[_0xf8e5('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf8e5('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xf8e5('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 32d4dd8..309f3ac 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 _0x5e33=['map','CmHopperHistory','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','describe','update','body','uniqueid','eml-format','rimraf','zip-dir','request-promise','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send'];(function(_0x2b2ce4,_0x38e23a){var _0x347ddd=function(_0x1c8e56){while(--_0x1c8e56){_0x2b2ce4['push'](_0x2b2ce4['shift']());}};_0x347ddd(++_0x38e23a);}(_0x5e33,0x14e));var _0x35e3=function(_0x32d6aa,_0x52f19f){_0x32d6aa=_0x32d6aa-0x0;var _0x237ea8=_0x5e33[_0x32d6aa];return _0x237ea8;};'use strict';var emlformat=require(_0x35e3('0x0'));var rimraf=require(_0x35e3('0x1'));var zipdir=require(_0x35e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35e3('0x3'));var moment=require('moment');var BPromise=require(_0x35e3('0x4'));var Mustache=require(_0x35e3('0x5'));var util=require(_0x35e3('0x6'));var path=require('path');var sox=require(_0x35e3('0x7'));var csv=require(_0x35e3('0x8'));var ejs=require(_0x35e3('0x9'));var fs=require('fs');var fs_extra=require(_0x35e3('0xa'));var _=require(_0x35e3('0xb'));var squel=require(_0x35e3('0xc'));var crypto=require('crypto');var jsforce=require(_0x35e3('0xd'));var deskjs=require(_0x35e3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x35e3('0xf'));var Papa=require(_0x35e3('0x10'));var Redis=require(_0x35e3('0x11'));var authService=require(_0x35e3('0x12'));var qs=require(_0x35e3('0x13'));var as=require(_0x35e3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x35e3('0x15'));var licenseUtil=require(_0x35e3('0x16'));var db=require(_0x35e3('0x17'))['db'];function respondWithStatusCode(_0x39f092,_0xf709f2){_0xf709f2=_0xf709f2||0xcc;return function(_0x50dc92){if(_0x50dc92){return _0x39f092[_0x35e3('0x18')](_0xf709f2);}return _0x39f092[_0x35e3('0x19')](_0xf709f2)[_0x35e3('0x1a')]();};}function respondWithResult(_0x468b1e,_0x2f235){_0x2f235=_0x2f235||0xc8;return function(_0x98b1f0){if(_0x98b1f0){return _0x468b1e[_0x35e3('0x19')](_0x2f235)[_0x35e3('0x1b')](_0x98b1f0);}};}function respondWithFilteredResult(_0x366b07,_0x56c98d){return function(_0x1d63ee){if(_0x1d63ee){var _0x39a480=typeof _0x56c98d[_0x35e3('0x1c')]==='undefined'&&typeof _0x56c98d['limit']==='undefined';var _0x449377=_0x1d63ee[_0x35e3('0x1d')];var _0x5ac4d2=_0x39a480?0x0:_0x56c98d[_0x35e3('0x1c')];var _0xa85b3e=_0x39a480?_0x1d63ee['count']:_0x56c98d[_0x35e3('0x1c')]+_0x56c98d[_0x35e3('0x1e')];var _0x46f215;if(_0xa85b3e>=_0x449377){_0xa85b3e=_0x449377;_0x46f215=0xc8;}else{_0x46f215=0xce;}_0x366b07['status'](_0x46f215);return _0x366b07[_0x35e3('0x1f')](_0x35e3('0x20'),_0x5ac4d2+'-'+_0xa85b3e+'/'+_0x449377)['json'](_0x1d63ee);}return null;};}function patchUpdates(_0x1ee283){return function(_0x50671f){try{jsonpatch[_0x35e3('0x21')](_0x50671f,_0x1ee283,!![]);}catch(_0x323f7b){return BPromise[_0x35e3('0x22')](_0x323f7b);}return _0x50671f[_0x35e3('0x23')]();};}function saveUpdates(_0x2d47de,_0x433746){return function(_0x1dd745){if(_0x1dd745){return _0x1dd745['update'](_0x2d47de)[_0x35e3('0x24')](function(_0x12f4e8){return _0x12f4e8;});}return null;};}function removeEntity(_0x158a4f,_0x45ed32){return function(_0x2d0fa4){if(_0x2d0fa4){return _0x2d0fa4[_0x35e3('0x25')]()['then'](function(){_0x158a4f[_0x35e3('0x19')](0xcc)[_0x35e3('0x1a')]();});}};}function handleEntityNotFound(_0x3e01a2,_0x13325e){return function(_0x1934af){if(!_0x1934af){_0x3e01a2[_0x35e3('0x18')](0x194);}return _0x1934af;};}function handleError(_0x272a2c,_0x2fed2f){_0x2fed2f=_0x2fed2f||0x1f4;return function(_0x5334e8){logger[_0x35e3('0x26')](_0x5334e8['stack']);if(_0x5334e8[_0x35e3('0x27')]){delete _0x5334e8[_0x35e3('0x27')];}_0x272a2c[_0x35e3('0x19')](_0x2fed2f)[_0x35e3('0x28')](_0x5334e8);};}exports['index']=function(_0x22fa58,_0x110d28){var _0x3802c7={},_0x446e46={},_0x1181ac={'count':0x0,'rows':[]};var _0x4ce0cc=_[_0x35e3('0x29')](db[_0x35e3('0x2a')][_0x35e3('0x2b')],function(_0x30123f){return{'name':_0x30123f[_0x35e3('0x2c')],'type':_0x30123f['type'][_0x35e3('0x2d')]};});_0x446e46[_0x35e3('0x2e')]=_['map'](_0x4ce0cc,_0x35e3('0x27'));_0x446e46[_0x35e3('0x2f')]=_['keys'](_0x22fa58[_0x35e3('0x2f')]);_0x446e46[_0x35e3('0x30')]=_[_0x35e3('0x31')](_0x446e46[_0x35e3('0x2e')],_0x446e46['query']);_0x3802c7['attributes']=_[_0x35e3('0x31')](_0x446e46[_0x35e3('0x2e')],qs['fields'](_0x22fa58[_0x35e3('0x2f')]['fields']));_0x3802c7[_0x35e3('0x32')]=_0x3802c7[_0x35e3('0x32')][_0x35e3('0x33')]?_0x3802c7[_0x35e3('0x32')]:_0x446e46['model'];if(!_0x22fa58[_0x35e3('0x2f')]['hasOwnProperty'](_0x35e3('0x34'))){_0x3802c7[_0x35e3('0x1e')]=qs['limit'](_0x22fa58[_0x35e3('0x2f')][_0x35e3('0x1e')]);_0x3802c7[_0x35e3('0x1c')]=qs[_0x35e3('0x1c')](_0x22fa58[_0x35e3('0x2f')][_0x35e3('0x1c')]);}_0x3802c7['order']=qs[_0x35e3('0x35')](_0x22fa58[_0x35e3('0x2f')]['sort']);_0x3802c7[_0x35e3('0x36')]=qs[_0x35e3('0x30')](_[_0x35e3('0x37')](_0x22fa58[_0x35e3('0x2f')],_0x446e46[_0x35e3('0x30')]),_0x4ce0cc);if(_0x22fa58['query'][_0x35e3('0x38')]){_0x3802c7[_0x35e3('0x36')]=_[_0x35e3('0x39')](_0x3802c7['where'],{'$or':_[_0x35e3('0x29')](_0x4ce0cc,function(_0x2e7d68){if(_0x2e7d68[_0x35e3('0x3a')]!==_0x35e3('0x3b')){var _0x1eaeeb={};_0x1eaeeb[_0x2e7d68[_0x35e3('0x27')]]={'$like':'%'+_0x22fa58[_0x35e3('0x2f')][_0x35e3('0x38')]+'%'};return _0x1eaeeb;}})});}_0x3802c7=_[_0x35e3('0x39')]({},_0x3802c7,_0x22fa58[_0x35e3('0x3c')]);var _0x1f1882={'where':_0x3802c7[_0x35e3('0x36')]};return db[_0x35e3('0x2a')][_0x35e3('0x1d')](_0x1f1882)[_0x35e3('0x24')](function(_0x55c117){_0x1181ac[_0x35e3('0x1d')]=_0x55c117;if(_0x22fa58['query'][_0x35e3('0x3d')]){_0x3802c7['include']=[{'all':!![]}];}return db[_0x35e3('0x2a')][_0x35e3('0x3e')](_0x3802c7);})[_0x35e3('0x24')](function(_0x3e4587){_0x1181ac[_0x35e3('0x3f')]=_0x3e4587;return _0x1181ac;})['then'](respondWithFilteredResult(_0x110d28,_0x3802c7))[_0x35e3('0x40')](handleError(_0x110d28,null));};exports[_0x35e3('0x41')]=function(_0xb8b595,_0x3684d4){var _0x88c3c7={'raw':!![],'where':{'id':_0xb8b595[_0x35e3('0x42')]['id']}},_0x469f95={};_0x469f95[_0x35e3('0x2e')]=_['keys'](db[_0x35e3('0x2a')][_0x35e3('0x2b')]);_0x469f95[_0x35e3('0x2f')]=_['keys'](_0xb8b595['query']);_0x469f95[_0x35e3('0x30')]=_[_0x35e3('0x31')](_0x469f95[_0x35e3('0x2e')],_0x469f95['query']);_0x88c3c7[_0x35e3('0x32')]=_[_0x35e3('0x31')](_0x469f95[_0x35e3('0x2e')],qs[_0x35e3('0x43')](_0xb8b595[_0x35e3('0x2f')]['fields']));_0x88c3c7[_0x35e3('0x32')]=_0x88c3c7[_0x35e3('0x32')]['length']?_0x88c3c7[_0x35e3('0x32')]:_0x469f95['model'];if(_0xb8b595[_0x35e3('0x2f')][_0x35e3('0x3d')]){_0x88c3c7[_0x35e3('0x44')]=[{'all':!![]}];}_0x88c3c7=_[_0x35e3('0x39')]({},_0x88c3c7,_0xb8b595['options']);return db[_0x35e3('0x2a')][_0x35e3('0x45')](_0x88c3c7)[_0x35e3('0x24')](handleEntityNotFound(_0x3684d4,null))[_0x35e3('0x24')](respondWithResult(_0x3684d4,null))[_0x35e3('0x40')](handleError(_0x3684d4,null));};exports[_0x35e3('0x46')]=function(_0x33beab,_0x3d78d4){return db[_0x35e3('0x2a')][_0x35e3('0x46')](_0x33beab['body'],{})[_0x35e3('0x24')](respondWithResult(_0x3d78d4,0xc9))[_0x35e3('0x40')](handleError(_0x3d78d4,null));};exports[_0x35e3('0x47')]=function(_0x479d91,_0x2a9351){return db[_0x35e3('0x2a')][_0x35e3('0x47')]()[_0x35e3('0x24')](respondWithResult(_0x2a9351,null))[_0x35e3('0x40')](handleError(_0x2a9351,null));};exports[_0x35e3('0x48')]=function(_0xccaefb,_0x59b12f){if(_0xccaefb[_0x35e3('0x49')][_0x35e3('0x4a')]){delete _0xccaefb[_0x35e3('0x49')]['uniqueid'];}return db[_0x35e3('0x2a')]['find']({'where':{'uniqueid':_0xccaefb[_0x35e3('0x42')]['id']}})[_0x35e3('0x24')](handleEntityNotFound(_0x59b12f,null))[_0x35e3('0x24')](saveUpdates(_0xccaefb[_0x35e3('0x49')],null))['then'](respondWithResult(_0x59b12f,null))[_0x35e3('0x40')](handleError(_0x59b12f,null));}; \ No newline at end of file +var _0x0ea5=['../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','CmHopperHistory','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','length','find','catch','create','describe','uniqueid','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x350e63,_0x61a9eb){var _0x36cd35=function(_0xc05429){while(--_0xc05429){_0x350e63['push'](_0x350e63['shift']());}};_0x36cd35(++_0x61a9eb);}(_0x0ea5,0xc7));var _0x50ea=function(_0x3bd026,_0x1ed033){_0x3bd026=_0x3bd026-0x0;var _0x13a4bf=_0x0ea5[_0x3bd026];return _0x13a4bf;};'use strict';var emlformat=require(_0x50ea('0x0'));var rimraf=require(_0x50ea('0x1'));var zipdir=require(_0x50ea('0x2'));var jsonpatch=require(_0x50ea('0x3'));var rp=require('request-promise');var moment=require(_0x50ea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50ea('0x5'));var util=require(_0x50ea('0x6'));var path=require(_0x50ea('0x7'));var sox=require('sox');var csv=require(_0x50ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50ea('0x9'));var squel=require(_0x50ea('0xa'));var crypto=require(_0x50ea('0xb'));var jsforce=require(_0x50ea('0xc'));var deskjs=require(_0x50ea('0xd'));var toCsv=require('to-csv');var querystring=require(_0x50ea('0xe'));var Papa=require(_0x50ea('0xf'));var Redis=require(_0x50ea('0x10'));var authService=require(_0x50ea('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50ea('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x50ea('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x50ea('0x14'));var db=require(_0x50ea('0x15'))['db'];function respondWithStatusCode(_0x3d0b54,_0x2b4029){_0x2b4029=_0x2b4029||0xcc;return function(_0x40acd0){if(_0x40acd0){return _0x3d0b54[_0x50ea('0x16')](_0x2b4029);}return _0x3d0b54['status'](_0x2b4029)[_0x50ea('0x17')]();};}function respondWithResult(_0x43df80,_0x3fef89){_0x3fef89=_0x3fef89||0xc8;return function(_0xfec4eb){if(_0xfec4eb){return _0x43df80[_0x50ea('0x18')](_0x3fef89)[_0x50ea('0x19')](_0xfec4eb);}};}function respondWithFilteredResult(_0x24f29b,_0x3b9495){return function(_0x36f641){if(_0x36f641){var _0x574c20=typeof _0x3b9495[_0x50ea('0x1a')]===_0x50ea('0x1b')&&typeof _0x3b9495[_0x50ea('0x1c')]===_0x50ea('0x1b');var _0x43562c=_0x36f641[_0x50ea('0x1d')];var _0x596b70=_0x574c20?0x0:_0x3b9495[_0x50ea('0x1a')];var _0x11a54f=_0x574c20?_0x36f641[_0x50ea('0x1d')]:_0x3b9495[_0x50ea('0x1a')]+_0x3b9495[_0x50ea('0x1c')];var _0x1825fa;if(_0x11a54f>=_0x43562c){_0x11a54f=_0x43562c;_0x1825fa=0xc8;}else{_0x1825fa=0xce;}_0x24f29b[_0x50ea('0x18')](_0x1825fa);return _0x24f29b[_0x50ea('0x1e')](_0x50ea('0x1f'),_0x596b70+'-'+_0x11a54f+'/'+_0x43562c)[_0x50ea('0x19')](_0x36f641);}return null;};}function patchUpdates(_0x949973){return function(_0xe8fbfa){try{jsonpatch['apply'](_0xe8fbfa,_0x949973,!![]);}catch(_0xa1c4a){return BPromise[_0x50ea('0x20')](_0xa1c4a);}return _0xe8fbfa[_0x50ea('0x21')]();};}function saveUpdates(_0x21d847,_0x1e3812){return function(_0x2d859b){if(_0x2d859b){return _0x2d859b[_0x50ea('0x22')](_0x21d847)['then'](function(_0x202d11){return _0x202d11;});}return null;};}function removeEntity(_0x2ed66b,_0x32b806){return function(_0x507b59){if(_0x507b59){return _0x507b59[_0x50ea('0x23')]()[_0x50ea('0x24')](function(){_0x2ed66b[_0x50ea('0x18')](0xcc)[_0x50ea('0x17')]();});}};}function handleEntityNotFound(_0x28448b,_0x43fe7f){return function(_0x5051cb){if(!_0x5051cb){_0x28448b['sendStatus'](0x194);}return _0x5051cb;};}function handleError(_0xfd9af1,_0x5d84da){_0x5d84da=_0x5d84da||0x1f4;return function(_0x1b0962){logger['error'](_0x1b0962[_0x50ea('0x25')]);if(_0x1b0962[_0x50ea('0x26')]){delete _0x1b0962[_0x50ea('0x26')];}_0xfd9af1[_0x50ea('0x18')](_0x5d84da)[_0x50ea('0x27')](_0x1b0962);};}exports[_0x50ea('0x28')]=function(_0xbfb449,_0x3181d8){var _0x1c0ced={},_0xef092a={},_0x56719f={'count':0x0,'rows':[]};var _0x46a3c2=_[_0x50ea('0x29')](db[_0x50ea('0x2a')]['rawAttributes'],function(_0x17b350){return{'name':_0x17b350['fieldName'],'type':_0x17b350[_0x50ea('0x2b')][_0x50ea('0x2c')]};});_0xef092a[_0x50ea('0x2d')]=_[_0x50ea('0x29')](_0x46a3c2,_0x50ea('0x26'));_0xef092a[_0x50ea('0x2e')]=_[_0x50ea('0x2f')](_0xbfb449['query']);_0xef092a[_0x50ea('0x30')]=_[_0x50ea('0x31')](_0xef092a[_0x50ea('0x2d')],_0xef092a[_0x50ea('0x2e')]);_0x1c0ced[_0x50ea('0x32')]=_[_0x50ea('0x31')](_0xef092a[_0x50ea('0x2d')],qs[_0x50ea('0x33')](_0xbfb449['query']['fields']));_0x1c0ced[_0x50ea('0x32')]=_0x1c0ced['attributes']['length']?_0x1c0ced[_0x50ea('0x32')]:_0xef092a['model'];if(!_0xbfb449['query']['hasOwnProperty']('nolimit')){_0x1c0ced[_0x50ea('0x1c')]=qs[_0x50ea('0x1c')](_0xbfb449[_0x50ea('0x2e')]['limit']);_0x1c0ced[_0x50ea('0x1a')]=qs[_0x50ea('0x1a')](_0xbfb449[_0x50ea('0x2e')][_0x50ea('0x1a')]);}_0x1c0ced[_0x50ea('0x34')]=qs[_0x50ea('0x35')](_0xbfb449['query'][_0x50ea('0x35')]);_0x1c0ced[_0x50ea('0x36')]=qs[_0x50ea('0x30')](_['pick'](_0xbfb449[_0x50ea('0x2e')],_0xef092a['filters']),_0x46a3c2);if(_0xbfb449[_0x50ea('0x2e')][_0x50ea('0x37')]){_0x1c0ced[_0x50ea('0x36')]=_[_0x50ea('0x38')](_0x1c0ced[_0x50ea('0x36')],{'$or':_[_0x50ea('0x29')](_0x46a3c2,function(_0x415ab2){if(_0x415ab2['type']!==_0x50ea('0x39')){var _0x49c33d={};_0x49c33d[_0x415ab2[_0x50ea('0x26')]]={'$like':'%'+_0xbfb449['query'][_0x50ea('0x37')]+'%'};return _0x49c33d;}})});}_0x1c0ced=_['merge']({},_0x1c0ced,_0xbfb449[_0x50ea('0x3a')]);var _0x3c2057={'where':_0x1c0ced[_0x50ea('0x36')]};return db[_0x50ea('0x2a')]['count'](_0x3c2057)[_0x50ea('0x24')](function(_0x237ca3){_0x56719f[_0x50ea('0x1d')]=_0x237ca3;if(_0xbfb449[_0x50ea('0x2e')][_0x50ea('0x3b')]){_0x1c0ced[_0x50ea('0x3c')]=[{'all':!![]}];}return db[_0x50ea('0x2a')][_0x50ea('0x3d')](_0x1c0ced);})[_0x50ea('0x24')](function(_0x533f4b){_0x56719f[_0x50ea('0x3e')]=_0x533f4b;return _0x56719f;})[_0x50ea('0x24')](respondWithFilteredResult(_0x3181d8,_0x1c0ced))['catch'](handleError(_0x3181d8,null));};exports['show']=function(_0x5064c0,_0x13ecc2){var _0x30fa80={'raw':!![],'where':{'id':_0x5064c0['params']['id']}},_0xba13dd={};_0xba13dd['model']=_[_0x50ea('0x2f')](db[_0x50ea('0x2a')][_0x50ea('0x3f')]);_0xba13dd[_0x50ea('0x2e')]=_['keys'](_0x5064c0[_0x50ea('0x2e')]);_0xba13dd[_0x50ea('0x30')]=_[_0x50ea('0x31')](_0xba13dd[_0x50ea('0x2d')],_0xba13dd[_0x50ea('0x2e')]);_0x30fa80[_0x50ea('0x32')]=_['intersection'](_0xba13dd[_0x50ea('0x2d')],qs[_0x50ea('0x33')](_0x5064c0[_0x50ea('0x2e')][_0x50ea('0x33')]));_0x30fa80[_0x50ea('0x32')]=_0x30fa80[_0x50ea('0x32')][_0x50ea('0x40')]?_0x30fa80[_0x50ea('0x32')]:_0xba13dd[_0x50ea('0x2d')];if(_0x5064c0[_0x50ea('0x2e')][_0x50ea('0x3b')]){_0x30fa80['include']=[{'all':!![]}];}_0x30fa80=_[_0x50ea('0x38')]({},_0x30fa80,_0x5064c0[_0x50ea('0x3a')]);return db[_0x50ea('0x2a')][_0x50ea('0x41')](_0x30fa80)[_0x50ea('0x24')](handleEntityNotFound(_0x13ecc2,null))['then'](respondWithResult(_0x13ecc2,null))[_0x50ea('0x42')](handleError(_0x13ecc2,null));};exports[_0x50ea('0x43')]=function(_0x3fd390,_0x5d28ef){return db[_0x50ea('0x2a')][_0x50ea('0x43')](_0x3fd390['body'],{})[_0x50ea('0x24')](respondWithResult(_0x5d28ef,0xc9))[_0x50ea('0x42')](handleError(_0x5d28ef,null));};exports[_0x50ea('0x44')]=function(_0x56e622,_0xe57396){return db[_0x50ea('0x2a')][_0x50ea('0x44')]()[_0x50ea('0x24')](respondWithResult(_0xe57396,null))[_0x50ea('0x42')](handleError(_0xe57396,null));};exports[_0x50ea('0x22')]=function(_0x3a557e,_0x7dfebf){if(_0x3a557e['body'][_0x50ea('0x45')]){delete _0x3a557e[_0x50ea('0x46')][_0x50ea('0x45')];}return db[_0x50ea('0x2a')][_0x50ea('0x41')]({'where':{'uniqueid':_0x3a557e[_0x50ea('0x47')]['id']}})[_0x50ea('0x24')](handleEntityNotFound(_0x7dfebf,null))[_0x50ea('0x24')](saveUpdates(_0x3a557e[_0x50ea('0x46')],null))[_0x50ea('0x24')](respondWithResult(_0x7dfebf,null))['catch'](handleError(_0x7dfebf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 73dd7c4..e3a7953 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 _0x8921=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8921,0x9a));var _0x1892=function(_0x227648,_0x108213){_0x227648=_0x227648-0x0;var _0x486781=_0x8921[_0x227648];return _0x486781;};'use strict';var _=require(_0x1892('0x0'));var util=require('util');var logger=require(_0x1892('0x1'))(_0x1892('0x2'));var moment=require(_0x1892('0x3'));var BPromise=require(_0x1892('0x4'));var rp=require(_0x1892('0x5'));var fs=require('fs');var path=require(_0x1892('0x6'));var rimraf=require(_0x1892('0x7'));var config=require(_0x1892('0x8'));var attributes=require(_0x1892('0x9'));module[_0x1892('0xa')]=function(_0x40e2e5,_0x238d31){return _0x40e2e5['define'](_0x1892('0xb'),attributes,{'tableName':_0x1892('0xc'),'paranoid':![],'indexes':[{'name':_0x1892('0xd'),'fields':[_0x1892('0xd')]},{'name':_0x1892('0xe'),'fields':[_0x1892('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9bd9=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x4f40c0,_0x2364fd){var _0x15309a=function(_0x56620c){while(--_0x56620c){_0x4f40c0['push'](_0x4f40c0['shift']());}};_0x15309a(++_0x2364fd);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x126121,_0x35e290){_0x126121=_0x126121-0x0;var _0x57d413=_0x9bd9[_0x126121];return _0x57d413;};'use strict';var _=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var logger=require(_0x99bd('0x2'))(_0x99bd('0x3'));var moment=require(_0x99bd('0x4'));var BPromise=require(_0x99bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99bd('0x6'));var rimraf=require('rimraf');var config=require(_0x99bd('0x7'));var attributes=require(_0x99bd('0x8'));module['exports']=function(_0xa1cd99,_0x45b939){return _0xa1cd99[_0x99bd('0x9')](_0x99bd('0xa'),attributes,{'tableName':_0x99bd('0xb'),'paranoid':![],'indexes':[{'name':_0x99bd('0xc'),'fields':[_0x99bd('0xc')]},{'name':_0x99bd('0xd'),'fields':[_0x99bd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index e46b075..1620d96 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 _0xf04c=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','stringify','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf04c,0xfd));var _0xcf04=function(_0x4dbe82,_0x3e7d85){_0x4dbe82=_0x4dbe82-0x0;var _0x5c3e79=_0xf04c[_0x4dbe82];return _0x5c3e79;};'use strict';var _=require(_0xcf04('0x0'));var util=require(_0xcf04('0x1'));var moment=require(_0xcf04('0x2'));var BPromise=require(_0xcf04('0x3'));var rs=require(_0xcf04('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf04('0x5'))['db'];var utils=require(_0xcf04('0x6'));var logger=require(_0xcf04('0x7'))(_0xcf04('0x8'));var config=require('../../config/environment');var jayson=require(_0xcf04('0x9'));var client=jayson[_0xcf04('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d26a7,_0x3a605c,_0x3002e9){return new BPromise(function(_0x2fe602,_0x5023cc){return client[_0xcf04('0xb')](_0x5d26a7,_0x3002e9)[_0xcf04('0xc')](function(_0x2598ed){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x3a605c,_0xcf04('0xd'));logger[_0xcf04('0xe')](_0xcf04('0xf'),_0x3a605c,'request\x20sent',JSON['stringify'](_0x2598ed));if(_0x2598ed[_0xcf04('0x10')]){if(_0x2598ed[_0xcf04('0x10')][_0xcf04('0x11')]===0x1f4){logger[_0xcf04('0x10')](_0xcf04('0x12'),_0x3a605c,_0x2598ed[_0xcf04('0x10')][_0xcf04('0x13')]);return _0x5023cc(_0x2598ed[_0xcf04('0x10')][_0xcf04('0x13')]);}logger[_0xcf04('0x10')](_0xcf04('0x12'),_0x3a605c,_0x2598ed[_0xcf04('0x10')]['message']);return _0x2fe602(_0x2598ed[_0xcf04('0x10')][_0xcf04('0x13')]);}else{logger[_0xcf04('0x14')](_0xcf04('0x12'),_0x3a605c,_0xcf04('0xd'));_0x2fe602(_0x2598ed[_0xcf04('0x15')][_0xcf04('0x13')]);}})[_0xcf04('0x16')](function(_0x33c116){logger['error'](_0xcf04('0x12'),_0x3a605c,_0x33c116);_0x5023cc(_0x33c116);});});}exports[_0xcf04('0x17')]=function(_0x511723){var _0x2e2c5f=this;return new Promise(function(_0x4bb065,_0x494620){return db[_0xcf04('0x18')]['create'](_0x511723[_0xcf04('0x19')],{'raw':_0x511723[_0xcf04('0x1a')]?_0x511723[_0xcf04('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4db7d4){logger[_0xcf04('0x14')](_0xcf04('0x17'),_0x511723);logger[_0xcf04('0xe')]('CreateCmHopperHistory',_0x511723,JSON[_0xcf04('0x1b')](_0x4db7d4));_0x4bb065(_0x4db7d4);})[_0xcf04('0x16')](function(_0x1ff929){logger[_0xcf04('0x10')](_0xcf04('0x17'),_0x1ff929[_0xcf04('0x13')],_0x511723);_0x494620(_0x2e2c5f[_0xcf04('0x10')](0x1f4,_0x1ff929[_0xcf04('0x13')]));});});};exports[_0xcf04('0x1c')]=function(_0x31384a){var _0x5590c5=this;return new Promise(function(_0x352836,_0x505591){return db[_0xcf04('0x18')][_0xcf04('0x1d')]({'raw':_0x31384a[_0xcf04('0x1a')]?_0x31384a['options'][_0xcf04('0x1e')]===undefined?!![]:![]:!![],'where':_0x31384a[_0xcf04('0x1a')]?_0x31384a[_0xcf04('0x1a')][_0xcf04('0x1f')]||null:null,'attributes':[[db[_0xcf04('0x20')]['fn'](_0xcf04('0x21'),db['sequelize'][_0xcf04('0x22')]('id')),_0xcf04('0x23')],[db[_0xcf04('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x25')))),_0xcf04('0x26')],[db['sequelize']['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')]('`state`\x20=\x2010,\x201,\x20null'))),_0xcf04('0x27')],[db[_0xcf04('0x20')]['fn']('COUNT',db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xcf04('0x29')],[db[_0xcf04('0x20')]['fn']('AVG',db[_0xcf04('0x20')]['fn']('IF',db['sequelize'][_0xcf04('0x24')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xcf04('0x2a')]]})[_0xcf04('0xc')](function(_0x5c2c67){logger[_0xcf04('0x14')](_0xcf04('0x1c'),_0x31384a);logger['debug'](_0xcf04('0x1c'),_0x31384a,JSON[_0xcf04('0x1b')](_0x5c2c67));_0x352836(_0x5c2c67);})[_0xcf04('0x16')](function(_0x3a0bb7){logger[_0xcf04('0x10')](_0xcf04('0x1c'),_0x3a0bb7[_0xcf04('0x13')],_0x31384a);_0x505591(_0x5590c5[_0xcf04('0x10')](0x1f4,_0x3a0bb7['message']));});});};exports[_0xcf04('0x2b')]=function(_0x3e4789){var _0x3ae46f=this;return new Promise(function(_0x3bad93,_0x3b0c6e){return db[_0xcf04('0x18')][_0xcf04('0x1d')]({'raw':_0x3e4789['options']?_0x3e4789[_0xcf04('0x1a')][_0xcf04('0x1e')]===undefined?!![]:![]:!![],'where':_0x3e4789['options']?_0x3e4789[_0xcf04('0x1a')]['where']||null:null,'attributes':[[_0xcf04('0x2c'),_0xcf04('0x2d')],[db[_0xcf04('0x20')]['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db['sequelize'][_0xcf04('0x24')](_0xcf04('0x2e')))),'outboundNoSuchCallsDay'],[db[_0xcf04('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x2f')))),_0xcf04('0x30')],[db[_0xcf04('0x20')]['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')]['literal'](_0xcf04('0x25')))),_0xcf04('0x31')],[db[_0xcf04('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcf04('0x20')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xcf04('0x32')],[db['sequelize']['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db['sequelize'][_0xcf04('0x24')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')]['literal'](_0xcf04('0x33')))),'outboundDropCallsDayTimeout'],[db[_0xcf04('0x20')]['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x34')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db['sequelize'][_0xcf04('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),_0xcf04('0x35')],[db[_0xcf04('0x20')]['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x36')))),_0xcf04('0x37')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x38')))),_0xcf04('0x39')],[db[_0xcf04('0x20')]['fn'](_0xcf04('0x21'),db['sequelize']['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xcf04('0x20')]['fn']('COUNT',db[_0xcf04('0x20')]['fn']('IF',db['sequelize'][_0xcf04('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0xcf04('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x3b')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')]['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x3c')))),'outboundReCallsDay']],'group':[_0xcf04('0x2c')]})['then'](function(_0x249040){logger[_0xcf04('0x14')](_0xcf04('0x2b'),_0x3e4789);logger[_0xcf04('0xe')](_0xcf04('0x2b'),_0x3e4789,JSON[_0xcf04('0x1b')](_0x249040));_0x3bad93(_0x249040);})['catch'](function(_0x5b8027){logger['error'](_0xcf04('0x2b'),_0x5b8027[_0xcf04('0x13')],_0x3e4789);_0x3b0c6e(_0x3ae46f[_0xcf04('0x10')](0x1f4,_0x5b8027['message']));});});};exports[_0xcf04('0x3d')]=function(_0x1292bc){var _0x759817=this;return new Promise(function(_0x1fd4ad,_0x51a49d){return db[_0xcf04('0x18')][_0xcf04('0x1d')]({'raw':_0x1292bc['options']?_0x1292bc['options'][_0xcf04('0x1e')]===undefined?!![]:![]:!![],'where':_0x1292bc[_0xcf04('0x1a')]?_0x1292bc[_0xcf04('0x1a')][_0xcf04('0x1f')]||null:null,'attributes':[[_0xcf04('0x2c'),'name'],[db[_0xcf04('0x20')]['fn'](_0xcf04('0x21'),db[_0xcf04('0x20')][_0xcf04('0x22')]('id')),_0xcf04('0x3e')],[db[_0xcf04('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcf04('0x20')][_0xcf04('0x24')](_0xcf04('0x25')))),_0xcf04('0x3f')]],'group':[_0xcf04('0x2c')]})[_0xcf04('0xc')](function(_0x4407c5){logger['info']('GetCampaignHopperHistory',_0x1292bc);logger[_0xcf04('0xe')](_0xcf04('0x3d'),_0x1292bc,JSON[_0xcf04('0x1b')](_0x4407c5));_0x1fd4ad(_0x4407c5);})['catch'](function(_0x18da0f){logger[_0xcf04('0x10')](_0xcf04('0x3d'),_0x18da0f[_0xcf04('0x13')],_0x1292bc);_0x51a49d(_0x759817[_0xcf04('0x10')](0x1f4,_0x18da0f[_0xcf04('0x13')]));});});}; \ No newline at end of file +var _0xcc8d=['jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw','CreateCmHopperHistory','CmHopperHistory','findAll','where','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalAvgHoldtime','AVG','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x56b663,_0x6d3295){var _0x1e7fc6=function(_0x59f999){while(--_0x59f999){_0x56b663['push'](_0x56b663['shift']());}};_0x1e7fc6(++_0x6d3295);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0xcc8d[_0x4812e0];return _0x252e0f;};'use strict';var _=require('lodash');var util=require(_0xdcc8('0x0'));var moment=require(_0xdcc8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcc8('0x2'));var db=require(_0xdcc8('0x3'))['db'];var utils=require(_0xdcc8('0x4'));var logger=require(_0xdcc8('0x5'))(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var jayson=require(_0xdcc8('0x8'));var client=jayson['client'][_0xdcc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfeebba,_0x10dd63,_0x237528){return new BPromise(function(_0x11c497,_0x5a85bd){return client[_0xdcc8('0xa')](_0xfeebba,_0x237528)[_0xdcc8('0xb')](function(_0x118798){logger[_0xdcc8('0xc')](_0xdcc8('0xd'),_0x10dd63,_0xdcc8('0xe'));logger[_0xdcc8('0xf')](_0xdcc8('0x10'),_0x10dd63,_0xdcc8('0xe'),JSON[_0xdcc8('0x11')](_0x118798));if(_0x118798[_0xdcc8('0x12')]){if(_0x118798[_0xdcc8('0x12')]['code']===0x1f4){logger[_0xdcc8('0x12')](_0xdcc8('0xd'),_0x10dd63,_0x118798['error'][_0xdcc8('0x13')]);return _0x5a85bd(_0x118798[_0xdcc8('0x12')][_0xdcc8('0x13')]);}logger[_0xdcc8('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x10dd63,_0x118798[_0xdcc8('0x12')][_0xdcc8('0x13')]);return _0x11c497(_0x118798['error'][_0xdcc8('0x13')]);}else{logger['info'](_0xdcc8('0xd'),_0x10dd63,_0xdcc8('0xe'));_0x11c497(_0x118798[_0xdcc8('0x14')][_0xdcc8('0x13')]);}})[_0xdcc8('0x15')](function(_0x12ace8){logger[_0xdcc8('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x10dd63,_0x12ace8);_0x5a85bd(_0x12ace8);});});}exports['CreateCmHopperHistory']=function(_0x5f515b){var _0x503b97=this;return new Promise(function(_0x509fae,_0x371807){return db['CmHopperHistory'][_0xdcc8('0x16')](_0x5f515b[_0xdcc8('0x17')],{'raw':_0x5f515b[_0xdcc8('0x18')]?_0x5f515b[_0xdcc8('0x18')][_0xdcc8('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4a34a0){logger[_0xdcc8('0xc')](_0xdcc8('0x1a'),_0x5f515b);logger[_0xdcc8('0xf')](_0xdcc8('0x1a'),_0x5f515b,JSON[_0xdcc8('0x11')](_0x4a34a0));_0x509fae(_0x4a34a0);})[_0xdcc8('0x15')](function(_0x4122a6){logger[_0xdcc8('0x12')](_0xdcc8('0x1a'),_0x4122a6[_0xdcc8('0x13')],_0x5f515b);_0x371807(_0x503b97[_0xdcc8('0x12')](0x1f4,_0x4122a6['message']));});});};exports['AvgHandleTime']=function(_0x552b11){var _0x5e8ccf=this;return new Promise(function(_0xc5a91a,_0x252d1e){return db[_0xdcc8('0x1b')][_0xdcc8('0x1c')]({'raw':_0x552b11[_0xdcc8('0x18')]?_0x552b11[_0xdcc8('0x18')][_0xdcc8('0x19')]===undefined?!![]:![]:!![],'where':_0x552b11[_0xdcc8('0x18')]?_0x552b11[_0xdcc8('0x18')][_0xdcc8('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')][_0xdcc8('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0xdcc8('0x1f')]['fn']('COUNT',db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')](_0xdcc8('0x22')))),_0xdcc8('0x23')],[db['sequelize']['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db['sequelize']['fn']('IF',db[_0xdcc8('0x1f')]['literal'](_0xdcc8('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xdcc8('0x1f')]['fn']('AVG',db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xdcc8('0x25')],[db['sequelize']['fn'](_0xdcc8('0x26'),db[_0xdcc8('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xdcc8('0x27')]]})[_0xdcc8('0xb')](function(_0x2e506a){logger[_0xdcc8('0xc')](_0xdcc8('0x28'),_0x552b11);logger[_0xdcc8('0xf')](_0xdcc8('0x28'),_0x552b11,JSON[_0xdcc8('0x11')](_0x2e506a));_0xc5a91a(_0x2e506a);})['catch'](function(_0x3b3d9e){logger['error']('AvgHandleTime',_0x3b3d9e[_0xdcc8('0x13')],_0x552b11);_0x252d1e(_0x5e8ccf[_0xdcc8('0x12')](0x1f4,_0x3b3d9e['message']));});});};exports[_0xdcc8('0x29')]=function(_0x51bb3c){var _0x14b6c3=this;return new Promise(function(_0x23f6a3,_0xf55251){return db[_0xdcc8('0x1b')][_0xdcc8('0x1c')]({'raw':_0x51bb3c['options']?_0x51bb3c[_0xdcc8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x51bb3c[_0xdcc8('0x18')]?_0x51bb3c['options'][_0xdcc8('0x1d')]||null:null,'attributes':[[_0xdcc8('0x2a'),_0xdcc8('0x2b')],[db[_0xdcc8('0x1f')]['fn']('COUNT',db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')](_0xdcc8('0x2c')))),'outboundNoSuchCallsDay'],[db[_0xdcc8('0x1f')]['fn']('COUNT',db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0xdcc8('0x2d')],[db['sequelize']['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')]['literal'](_0xdcc8('0x22')))),'outboundAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xdcc8('0x1f')]['fn']('IF',db['sequelize'][_0xdcc8('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0xdcc8('0x2e')],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')](_0xdcc8('0x2f')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')]['literal'](_0xdcc8('0x30')))),_0xdcc8('0x31')],[db['sequelize']['fn']('COUNT',db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdcc8('0x32')],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')]['literal'](_0xdcc8('0x33')))),_0xdcc8('0x34')],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')](_0xdcc8('0x35')))),_0xdcc8('0x36')],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db['sequelize'][_0xdcc8('0x21')](_0xdcc8('0x37')))),'outboundOriginateFailureCallsDay'],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')]['literal'](_0xdcc8('0x38')))),_0xdcc8('0x39')],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')](_0xdcc8('0x3a')))),'outboundAnswerAgiCallsDay'],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')]['literal'](_0xdcc8('0x3b')))),_0xdcc8('0x39')],[db[_0xdcc8('0x1f')]['fn']('COUNT',db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')](_0xdcc8('0x3c')))),_0xdcc8('0x3d')]],'group':[_0xdcc8('0x2a')]})[_0xdcc8('0xb')](function(_0x5c234b){logger['info'](_0xdcc8('0x29'),_0x51bb3c);logger[_0xdcc8('0xf')](_0xdcc8('0x29'),_0x51bb3c,JSON[_0xdcc8('0x11')](_0x5c234b));_0x23f6a3(_0x5c234b);})[_0xdcc8('0x15')](function(_0x495e79){logger['error']('GetVoiceQueueHopperHistory',_0x495e79['message'],_0x51bb3c);_0xf55251(_0x14b6c3[_0xdcc8('0x12')](0x1f4,_0x495e79[_0xdcc8('0x13')]));});});};exports[_0xdcc8('0x3e')]=function(_0x2cd7d5){var _0x849abf=this;return new Promise(function(_0x504b31,_0x3fef3b){return db['CmHopperHistory'][_0xdcc8('0x1c')]({'raw':_0x2cd7d5[_0xdcc8('0x18')]?_0x2cd7d5[_0xdcc8('0x18')][_0xdcc8('0x19')]===undefined?!![]:![]:!![],'where':_0x2cd7d5[_0xdcc8('0x18')]?_0x2cd7d5[_0xdcc8('0x18')][_0xdcc8('0x1d')]||null:null,'attributes':[[_0xdcc8('0x2a'),_0xdcc8('0x2b')],[db[_0xdcc8('0x1f')]['fn']('COUNT',db['sequelize'][_0xdcc8('0x20')]('id')),_0xdcc8('0x3f')],[db[_0xdcc8('0x1f')]['fn'](_0xdcc8('0x1e'),db[_0xdcc8('0x1f')]['fn']('IF',db[_0xdcc8('0x1f')][_0xdcc8('0x21')](_0xdcc8('0x22')))),_0xdcc8('0x40')]],'group':[_0xdcc8('0x2a')]})[_0xdcc8('0xb')](function(_0x246d57){logger[_0xdcc8('0xc')]('GetCampaignHopperHistory',_0x2cd7d5);logger['debug'](_0xdcc8('0x3e'),_0x2cd7d5,JSON[_0xdcc8('0x11')](_0x246d57));_0x504b31(_0x246d57);})[_0xdcc8('0x15')](function(_0x4ea7a0){logger[_0xdcc8('0x12')](_0xdcc8('0x3e'),_0x4ea7a0[_0xdcc8('0x13')],_0x2cd7d5);_0x3fef3b(_0x849abf['error'](0x1f4,_0x4ea7a0['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 6aa5109..f7923b5 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 _0x655d=['../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40a3bb,_0x5aa60c){var _0x528131=function(_0x5523be){while(--_0x5523be){_0x40a3bb['push'](_0x40a3bb['shift']());}};_0x528131(++_0x5aa60c);}(_0x655d,0xbe));var _0xd655=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x655d[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xd655('0x0'));var util=require(_0xd655('0x1'));var path=require(_0xd655('0x2'));var timeout=require(_0xd655('0x3'));var express=require(_0xd655('0x4'));var router=express['Router']();var fs_extra=require(_0xd655('0x5'));var auth=require(_0xd655('0x6'));var interaction=require(_0xd655('0x7'));var config=require(_0xd655('0x8'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0xd655('0x9')](),controller['index']);router[_0xd655('0xa')](_0xd655('0xb'),auth[_0xd655('0x9')](),controller[_0xd655('0xc')]);router[_0xd655('0xa')](_0xd655('0xd'),auth[_0xd655('0x9')](),controller[_0xd655('0xe')]);router[_0xd655('0xf')]('/',auth[_0xd655('0x9')](),controller[_0xd655('0x10')]);router['put'](_0xd655('0xd'),auth['isAuthenticated'](),controller['update']);module[_0xd655('0x11')]=router; \ No newline at end of file +var _0x1b83=['../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1fcdb5,_0x162157){var _0x44a25f=function(_0x23a18b){while(--_0x23a18b){_0x1fcdb5['push'](_0x1fcdb5['shift']());}};_0x44a25f(++_0x162157);}(_0x1b83,0x13e));var _0x31b8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1b83[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x31b8('0x0'));var util=require('util');var path=require(_0x31b8('0x1'));var timeout=require(_0x31b8('0x2'));var express=require('express');var router=express[_0x31b8('0x3')]();var fs_extra=require(_0x31b8('0x4'));var auth=require(_0x31b8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31b8('0x6'));var controller=require(_0x31b8('0x7'));router[_0x31b8('0x8')]('/',auth[_0x31b8('0x9')](),controller[_0x31b8('0xa')]);router[_0x31b8('0x8')](_0x31b8('0xb'),auth[_0x31b8('0x9')](),controller[_0x31b8('0xc')]);router[_0x31b8('0x8')]('/:id',auth[_0x31b8('0x9')](),controller['show']);router[_0x31b8('0xd')]('/',auth[_0x31b8('0x9')](),controller[_0x31b8('0xe')]);router[_0x31b8('0xf')](_0x31b8('0x10'),auth[_0x31b8('0x9')](),controller['update']);module[_0x31b8('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ca4d122..d5d13b2 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 _0x097c=['STRING','sequelize','exports'];(function(_0x18d57,_0x3a99e2){var _0x5b57ad=function(_0x31c6dc){while(--_0x31c6dc){_0x18d57['push'](_0x18d57['shift']());}};_0x5b57ad(++_0x3a99e2);}(_0x097c,0x1d5));var _0xc097=function(_0x25abc2,_0x1379d9){_0x25abc2=_0x25abc2-0x0;var _0x187caf=_0x097c[_0x25abc2];return _0x187caf;};'use strict';var Sequelize=require(_0xc097('0x0'));module[_0xc097('0x1')]={'name':{'type':Sequelize[_0xc097('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc097('0x2')]},'dialPrefix':{'type':Sequelize[_0xc097('0x2')]}}; \ No newline at end of file +var _0x615a=['STRING','sequelize'];(function(_0x1e339d,_0x1484ee){var _0x126d4b=function(_0x1cdb93){while(--_0x1cdb93){_0x1e339d['push'](_0x1e339d['shift']());}};_0x126d4b(++_0x1484ee);}(_0x615a,0x119));var _0xa615=function(_0x448747,_0x52303a){_0x448747=_0x448747-0x0;var _0x34b9f4=_0x615a[_0x448747];return _0x34b9f4;};'use strict';var Sequelize=require(_0xa615('0x0'));module['exports']={'name':{'type':Sequelize[_0xa615('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa615('0x1')]},'dialPrefix':{'type':Sequelize[_0xa615('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 21bf362..29941be 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 _0x5370=['undefined','limit','count','apply','reject','save','destroy','then','get','Lists','UserProfileResource','error','name','map','CmList','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','update','find','params','describe','addDisposition','ListId','getDispositions','findOne','Disposition','rows','ids','CmContact','tags','isArray','join','each','omit','success','push','dataValues','errors','message','getContacts','CustomFields','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','field','item','cm_contact_has_items','CmContactId\x20=\x20c.id','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','CmCustomField','addCustomFields','text','Sequelize','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset'];(function(_0x23e010,_0x1eaac6){var _0x4bca44=function(_0x55c746){while(--_0x55c746){_0x23e010['push'](_0x23e010['shift']());}};_0x4bca44(++_0x1eaac6);}(_0x5370,0x11f));var _0x0537=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5370[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0537('0x0'));var zipdir=require(_0x0537('0x1'));var jsonpatch=require(_0x0537('0x2'));var rp=require(_0x0537('0x3'));var moment=require(_0x0537('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0537('0x5'));var path=require('path');var sox=require(_0x0537('0x6'));var csv=require(_0x0537('0x7'));var ejs=require(_0x0537('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0537('0x9'));var squel=require(_0x0537('0xa'));var crypto=require(_0x0537('0xb'));var jsforce=require(_0x0537('0xc'));var deskjs=require(_0x0537('0xd'));var toCsv=require(_0x0537('0x7'));var querystring=require(_0x0537('0xe'));var Papa=require(_0x0537('0xf'));var Redis=require(_0x0537('0x10'));var authService=require(_0x0537('0x11'));var qs=require(_0x0537('0x12'));var as=require(_0x0537('0x13'));var hardwareService=require(_0x0537('0x14'));var logger=require('../../config/logger')(_0x0537('0x15'));var utils=require('../../config/utils');var config=require(_0x0537('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var csv_results;config[_0x0537('0x17')]=_[_0x0537('0x18')](config[_0x0537('0x17')],{'host':_0x0537('0x19'),'port':0x18eb});var socket=require(_0x0537('0x1a'))(new Redis(config[_0x0537('0x17')]));require('./cmList.socket')[_0x0537('0x1b')](socket);function respondWithStatusCode(_0x3970c6,_0x1f7896){_0x1f7896=_0x1f7896||0xcc;return function(_0x530719){if(_0x530719){return _0x3970c6[_0x0537('0x1c')](_0x1f7896);}return _0x3970c6[_0x0537('0x1d')](_0x1f7896)[_0x0537('0x1e')]();};}function respondWithResult(_0x2cccd1,_0x716225){_0x716225=_0x716225||0xc8;return function(_0x150eb6){if(_0x150eb6){return _0x2cccd1[_0x0537('0x1d')](_0x716225)[_0x0537('0x1f')](_0x150eb6);}};}function respondWithFilteredResult(_0x51fae9,_0x4c4fb9){return function(_0x489872){if(_0x489872){var _0x222892=typeof _0x4c4fb9[_0x0537('0x20')]===_0x0537('0x21')&&typeof _0x4c4fb9[_0x0537('0x22')]===_0x0537('0x21');var _0x3b1db7=_0x489872[_0x0537('0x23')];var _0x2c8d4c=_0x222892?0x0:_0x4c4fb9['offset'];var _0x403f15=_0x222892?_0x489872['count']:_0x4c4fb9[_0x0537('0x20')]+_0x4c4fb9[_0x0537('0x22')];var _0x131f95;if(_0x403f15>=_0x3b1db7){_0x403f15=_0x3b1db7;_0x131f95=0xc8;}else{_0x131f95=0xce;}_0x51fae9['status'](_0x131f95);return _0x51fae9['set']('Content-Range',_0x2c8d4c+'-'+_0x403f15+'/'+_0x3b1db7)[_0x0537('0x1f')](_0x489872);}return null;};}function patchUpdates(_0x2f3c1d){return function(_0x5c1441){try{jsonpatch[_0x0537('0x24')](_0x5c1441,_0x2f3c1d,!![]);}catch(_0x53369f){return BPromise[_0x0537('0x25')](_0x53369f);}return _0x5c1441[_0x0537('0x26')]();};}function saveUpdates(_0x104776,_0x9920ac){return function(_0x301f94){if(_0x301f94){return _0x301f94['update'](_0x104776)['then'](function(_0x11c400){return _0x11c400;});}return null;};}function removeEntity(_0x362b29,_0x861cfa){return function(_0x276a1c){if(_0x276a1c){return _0x276a1c[_0x0537('0x27')]()[_0x0537('0x28')](function(){var _0x2997c7=_0x276a1c[_0x0537('0x29')]({'plain':!![]});var _0x57d538=_0x0537('0x2a');return db[_0x0537('0x2b')][_0x0537('0x27')]({'where':{'type':_0x57d538,'resourceId':_0x2997c7['id']}})['then'](function(){return _0x276a1c;});})[_0x0537('0x28')](function(){_0x362b29['status'](0xcc)[_0x0537('0x1e')]();});}};}function handleEntityNotFound(_0x4b2a3f,_0x203fcb){return function(_0x694557){if(!_0x694557){_0x4b2a3f[_0x0537('0x1c')](0x194);}return _0x694557;};}function handleError(_0xd2141e,_0x77e9c0){_0x77e9c0=_0x77e9c0||0x1f4;return function(_0x577e36){logger[_0x0537('0x2c')](_0x577e36['stack']);if(_0x577e36[_0x0537('0x2d')]){delete _0x577e36[_0x0537('0x2d')];}_0xd2141e[_0x0537('0x1d')](_0x77e9c0)['send'](_0x577e36);};}exports['index']=function(_0x493fc9,_0x3f1eec){var _0x28861a={},_0x45fd05={},_0x3c2d97={'count':0x0,'rows':[]};var _0x16ad0d=_[_0x0537('0x2e')](db[_0x0537('0x2f')][_0x0537('0x30')],function(_0x5bb294){return{'name':_0x5bb294[_0x0537('0x31')],'type':_0x5bb294[_0x0537('0x32')][_0x0537('0x33')]};});_0x45fd05[_0x0537('0x34')]=_['map'](_0x16ad0d,_0x0537('0x2d'));_0x45fd05[_0x0537('0x35')]=_['keys'](_0x493fc9[_0x0537('0x35')]);_0x45fd05[_0x0537('0x36')]=_[_0x0537('0x37')](_0x45fd05['model'],_0x45fd05[_0x0537('0x35')]);_0x28861a[_0x0537('0x38')]=_[_0x0537('0x37')](_0x45fd05['model'],qs[_0x0537('0x39')](_0x493fc9[_0x0537('0x35')][_0x0537('0x39')]));_0x28861a[_0x0537('0x38')]=_0x28861a[_0x0537('0x38')][_0x0537('0x3a')]?_0x28861a['attributes']:_0x45fd05[_0x0537('0x34')];if(!_0x493fc9[_0x0537('0x35')][_0x0537('0x3b')](_0x0537('0x3c'))){_0x28861a[_0x0537('0x22')]=qs[_0x0537('0x22')](_0x493fc9['query'][_0x0537('0x22')]);_0x28861a[_0x0537('0x20')]=qs[_0x0537('0x20')](_0x493fc9['query'][_0x0537('0x20')]);}_0x28861a[_0x0537('0x3d')]=qs[_0x0537('0x3e')](_0x493fc9[_0x0537('0x35')]['sort']);_0x28861a[_0x0537('0x3f')]=qs['filters'](_[_0x0537('0x40')](_0x493fc9[_0x0537('0x35')],_0x45fd05['filters']),_0x16ad0d);if(_0x493fc9[_0x0537('0x35')][_0x0537('0x41')]){_0x28861a[_0x0537('0x3f')]=_['merge'](_0x28861a['where'],{'$or':_[_0x0537('0x2e')](_0x16ad0d,function(_0x352bf0){if(_0x352bf0[_0x0537('0x32')]!==_0x0537('0x42')){var _0x126d27={};_0x126d27[_0x352bf0['name']]={'$like':'%'+_0x493fc9[_0x0537('0x35')][_0x0537('0x41')]+'%'};return _0x126d27;}})});}_0x28861a=_[_0x0537('0x43')]({},_0x28861a,_0x493fc9[_0x0537('0x44')]);var _0x436ee3={'where':_0x28861a[_0x0537('0x3f')]};return db[_0x0537('0x2f')][_0x0537('0x23')](_0x436ee3)[_0x0537('0x28')](function(_0x592590){_0x3c2d97[_0x0537('0x23')]=_0x592590;if(_0x493fc9['query'][_0x0537('0x45')]){_0x28861a[_0x0537('0x46')]=[{'all':!![]}];}return db[_0x0537('0x2f')][_0x0537('0x47')](_0x28861a);})[_0x0537('0x28')](function(_0x3cbeed){_0x3c2d97['rows']=_0x3cbeed;return _0x3c2d97;})[_0x0537('0x28')](respondWithFilteredResult(_0x3f1eec,_0x28861a))[_0x0537('0x48')](handleError(_0x3f1eec,null));};exports[_0x0537('0x49')]=function(_0x34f871,_0x869057){var _0x1ff801={'raw':![],'where':{'id':_0x34f871['params']['id']}},_0x371bb3={};_0x371bb3['model']=_['keys'](db['CmList'][_0x0537('0x30')]);_0x371bb3[_0x0537('0x35')]=_[_0x0537('0x4a')](_0x34f871['query']);_0x371bb3[_0x0537('0x36')]=_[_0x0537('0x37')](_0x371bb3['model'],_0x371bb3[_0x0537('0x35')]);_0x1ff801[_0x0537('0x38')]=_[_0x0537('0x37')](_0x371bb3[_0x0537('0x34')],qs[_0x0537('0x39')](_0x34f871['query'][_0x0537('0x39')]));_0x1ff801[_0x0537('0x38')]=_0x1ff801[_0x0537('0x38')]['length']?_0x1ff801[_0x0537('0x38')]:_0x371bb3[_0x0537('0x34')];if(_0x34f871[_0x0537('0x35')][_0x0537('0x45')]){_0x1ff801[_0x0537('0x46')]=[{'all':!![]}];}_0x1ff801=_[_0x0537('0x43')]({},_0x1ff801,_0x34f871[_0x0537('0x44')]);return db['CmList']['find'](_0x1ff801)[_0x0537('0x28')](handleEntityNotFound(_0x869057,null))['then'](respondWithResult(_0x869057,null))['catch'](handleError(_0x869057,null));};exports[_0x0537('0x4b')]=function(_0x240e60,_0x5a7157){return db[_0x0537('0x2f')][_0x0537('0x4b')](_0x240e60[_0x0537('0x4c')],{})['then'](function(_0x2073d4){var _0x36e751=_0x240e60[_0x0537('0x4d')][_0x0537('0x29')]({'plain':!![]});if(!_0x36e751)throw new Error(_0x0537('0x4e'));if(_0x36e751['role']===_0x0537('0x4d')){var _0x4fa4f3=_0x2073d4[_0x0537('0x29')]({'plain':!![]});var _0x53e63e=_0x0537('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x53e63e,'userProfileId':_0x36e751[_0x0537('0x4f')]},'raw':!![]})['then'](function(_0x793f5){if(_0x793f5&&_0x793f5[_0x0537('0x50')]===0x0){return db[_0x0537('0x2b')]['create']({'name':_0x4fa4f3[_0x0537('0x2d')],'resourceId':_0x4fa4f3['id'],'type':_0x793f5[_0x0537('0x2d')],'sectionId':_0x793f5['id']},{})[_0x0537('0x28')](function(){return _0x2073d4;});}else{return _0x2073d4;}})[_0x0537('0x48')](function(_0x4518ee){logger[_0x0537('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4518ee);throw _0x4518ee;});}return _0x2073d4;})[_0x0537('0x28')](respondWithResult(_0x5a7157,0xc9))['catch'](handleError(_0x5a7157,null));};exports[_0x0537('0x51')]=function(_0xe5032,_0x18c660){if(_0xe5032[_0x0537('0x4c')]['id']){delete _0xe5032[_0x0537('0x4c')]['id'];}return db[_0x0537('0x2f')][_0x0537('0x52')]({'where':{'id':_0xe5032[_0x0537('0x53')]['id']}})[_0x0537('0x28')](handleEntityNotFound(_0x18c660,null))['then'](saveUpdates(_0xe5032[_0x0537('0x4c')],null))[_0x0537('0x28')](respondWithResult(_0x18c660,null))[_0x0537('0x48')](handleError(_0x18c660,null));};exports[_0x0537('0x27')]=function(_0x26c9b2,_0x17a1c6){return db[_0x0537('0x2f')][_0x0537('0x52')]({'where':{'id':_0x26c9b2[_0x0537('0x53')]['id']}})[_0x0537('0x28')](handleEntityNotFound(_0x17a1c6,null))['then'](removeEntity(_0x17a1c6,null))[_0x0537('0x48')](handleError(_0x17a1c6,null));};exports[_0x0537('0x54')]=function(_0x2585b7,_0x2d044a){return db[_0x0537('0x2f')][_0x0537('0x54')]()[_0x0537('0x28')](respondWithResult(_0x2d044a,null))[_0x0537('0x48')](handleError(_0x2d044a,null));};exports[_0x0537('0x55')]=function(_0x264e3f,_0x1776bc,_0x907393){if(_0x264e3f[_0x0537('0x4c')]['id']){delete _0x264e3f['body']['id'];}return db[_0x0537('0x2f')]['find']({'where':{'id':_0x264e3f[_0x0537('0x53')]['id']}})['then'](handleEntityNotFound(_0x1776bc,null))[_0x0537('0x28')](function(_0xb177ff){if(_0xb177ff){_0x264e3f[_0x0537('0x4c')][_0x0537('0x56')]=_0xb177ff['id'];return db['Disposition'][_0x0537('0x4b')](_0x264e3f['body']);}})['then'](respondWithResult(_0x1776bc,null))['catch'](handleError(_0x1776bc,null));};exports[_0x0537('0x57')]=function(_0x5d005e,_0x3d73c7,_0xb9ae40){var _0x46ffe6={'raw':![],'where':{}};var _0x295687={};var _0x2e20ac={'count':0x0,'rows':[]};return db['CmList'][_0x0537('0x58')]({'where':{'id':_0x5d005e[_0x0537('0x53')]['id']}})[_0x0537('0x28')](handleEntityNotFound(_0x3d73c7,null))['then'](function(_0x369547){if(_0x369547){_0x295687[_0x0537('0x34')]=_[_0x0537('0x4a')](db[_0x0537('0x59')][_0x0537('0x30')]);_0x295687['query']=_['keys'](_0x5d005e[_0x0537('0x35')]);_0x295687[_0x0537('0x36')]=_[_0x0537('0x37')](_0x295687[_0x0537('0x34')],_0x295687[_0x0537('0x35')]);_0x46ffe6[_0x0537('0x38')]=_[_0x0537('0x37')](_0x295687[_0x0537('0x34')],qs[_0x0537('0x39')](_0x5d005e['query']['fields']));_0x46ffe6[_0x0537('0x38')]=_0x46ffe6[_0x0537('0x38')][_0x0537('0x3a')]?_0x46ffe6[_0x0537('0x38')]:_0x295687['model'];if(!_0x5d005e[_0x0537('0x35')][_0x0537('0x3b')]('nolimit')){_0x46ffe6['limit']=qs[_0x0537('0x22')](_0x5d005e[_0x0537('0x35')]['limit']);_0x46ffe6[_0x0537('0x20')]=qs[_0x0537('0x20')](_0x5d005e[_0x0537('0x35')][_0x0537('0x20')]);}_0x46ffe6[_0x0537('0x3d')]=qs['sort'](_0x5d005e[_0x0537('0x35')][_0x0537('0x3e')]);_0x46ffe6[_0x0537('0x3f')]=qs['filters'](_[_0x0537('0x40')](_0x5d005e[_0x0537('0x35')],_0x295687['filters']));_0x46ffe6['where'][_0x0537('0x56')]=_0x369547['id'];if(_0x5d005e[_0x0537('0x35')]['filter']){_0x46ffe6[_0x0537('0x3f')]=_['merge'](_0x46ffe6[_0x0537('0x3f')],{'$or':_[_0x0537('0x2e')](_0x46ffe6[_0x0537('0x38')],function(_0x59f9f9){var _0x3c2001={};_0x3c2001[_0x59f9f9]={'$like':'%'+_0x5d005e[_0x0537('0x35')][_0x0537('0x41')]+'%'};return _0x3c2001;})});}_0x46ffe6=_[_0x0537('0x43')]({},_0x46ffe6,_0x5d005e[_0x0537('0x44')]);return db['Disposition'][_0x0537('0x23')]({'where':_0x46ffe6[_0x0537('0x3f')]})[_0x0537('0x28')](function(_0xd04bcb){_0x2e20ac[_0x0537('0x23')]=_0xd04bcb;if(_0x5d005e[_0x0537('0x35')]['includeAll']){_0x46ffe6['include']=[{'all':!![]}];}return db[_0x0537('0x59')][_0x0537('0x47')](_0x46ffe6);})[_0x0537('0x28')](function(_0x693abb){_0x2e20ac[_0x0537('0x5a')]=_0x693abb;return _0x2e20ac;});}})[_0x0537('0x28')](respondWithFilteredResult(_0x3d73c7,_0x46ffe6))[_0x0537('0x48')](handleError(_0x3d73c7,null));};exports['removeDispositions']=function(_0x140bde,_0x4daabd,_0x1efa7e){return db[_0x0537('0x2f')][_0x0537('0x52')]({'where':{'id':_0x140bde[_0x0537('0x53')]['id']}})[_0x0537('0x28')](handleEntityNotFound(_0x4daabd,null))['then'](function(_0x229f6f){if(_0x229f6f){return _0x229f6f['removeDispositions'](_0x140bde[_0x0537('0x35')][_0x0537('0x5b')]);}})[_0x0537('0x28')](respondWithStatusCode(_0x4daabd,null))[_0x0537('0x48')](handleError(_0x4daabd,null));};exports['addContacts']=function(_0x278911,_0x47434d,_0x2b6777){return db['CmList'][_0x0537('0x52')]({'where':{'id':_0x278911['params']['id']}})[_0x0537('0x28')](handleEntityNotFound(_0x47434d,null))[_0x0537('0x28')](function(_0x408695){if(_0x408695){var _0x29a3b2=[];var _0x4924f4={'success':[],'errors':[]};return db[_0x0537('0x5c')][_0x0537('0x54')]()[_0x0537('0x28')](function(_0x27c207){if(_0x278911[_0x0537('0x4c')][_0x0537('0x5d')]&&_[_0x0537('0x5e')](_0x278911[_0x0537('0x4c')][_0x0537('0x5d')])){if(_0x278911[_0x0537('0x4c')]['tags']['length']){_0x278911['body']['tags']=_0x278911[_0x0537('0x4c')][_0x0537('0x5d')][_0x0537('0x5f')](';')+';';}else{_0x278911[_0x0537('0x4c')][_0x0537('0x5d')]=null;}}else{_0x278911['body'][_0x0537('0x5d')]=null;}if(_0x278911[_0x0537('0x4c')]&&_[_0x0537('0x5e')](_0x278911['body'])){for(var _0x25fdac=0x0;_0x25fdac<_0x278911['body'][_0x0537('0x3a')];_0x25fdac+=0x1){_0x278911['body'][_0x25fdac][_0x0537('0x56')]=_0x278911['params']['id'];_0x29a3b2['push'](_0x278911[_0x0537('0x4c')][_0x25fdac]);}return BPromise[_0x0537('0x60')](_0x29a3b2,function(_0x27ed5a){return db['CmContact'][_0x0537('0x4b')](_[_0x0537('0x61')](_0x27ed5a,['ids','id'])||{},{'fields':_['keys'](_0x27c207),'raw':!![]})[_0x0537('0x28')](function(_0x58dab0){_0x4924f4[_0x0537('0x62')][_0x0537('0x63')](_0x58dab0[_0x0537('0x64')]);})[_0x0537('0x48')](function(_0x43eacb){_0x4924f4[_0x0537('0x65')]['push']({'data':_0x27ed5a,'error':_0x43eacb[_0x0537('0x66')]});});})[_0x0537('0x28')](function(_0x388592){return _0x4924f4;})[_0x0537('0x48')](function(_0x29e67a){return _0x29e67a;});}else{_0x47434d[_0x0537('0x1d')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x47434d,null))['catch'](handleError(_0x47434d,null));};exports[_0x0537('0x67')]=function(_0x597c72,_0x1f97f6,_0x3a3616){var _0x368d0e;return db[_0x0537('0x2f')][_0x0537('0x52')]({'where':{'id':_0x597c72['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x0537('0x68')}]})['then'](handleEntityNotFound(_0x1f97f6,null))[_0x0537('0x28')](function(_0x4a1311){if(_0x4a1311){_0x368d0e=_0x4a1311;return db[_0x0537('0x5c')][_0x0537('0x30')];}})[_0x0537('0x28')](function(_0x59734c){if(_0x59734c){var _0xc9abed={};var _0x59fec3={};_0x59fec3[_0x0537('0x34')]=_['concat'](_[_0x0537('0x4a')](_0x59734c),_[_0x0537('0x2e')](_0x368d0e[_0x0537('0x68')],function(_0x161842){return util['format']('cf_%d',_0x161842['id']);}));_0x59fec3['query']=_[_0x0537('0x4a')](_0x597c72[_0x0537('0x35')]);_0x59fec3[_0x0537('0x36')]=_['intersection'](_0x59fec3[_0x0537('0x34')],_0x59fec3[_0x0537('0x35')]);_0xc9abed[_0x0537('0x38')]=_['intersection'](_0x59fec3[_0x0537('0x34')],qs['fields'](_0x597c72[_0x0537('0x35')][_0x0537('0x39')]));_0xc9abed[_0x0537('0x38')]=_0xc9abed[_0x0537('0x38')][_0x0537('0x3a')]?_0xc9abed[_0x0537('0x38')]:_0x59fec3[_0x0537('0x34')];if(!_0x597c72[_0x0537('0x35')]['hasOwnProperty'](_0x0537('0x3c'))){_0xc9abed['limit']=qs[_0x0537('0x22')](_0x597c72[_0x0537('0x35')][_0x0537('0x22')]);_0xc9abed[_0x0537('0x20')]=qs[_0x0537('0x20')](_0x597c72['query'][_0x0537('0x20')]);}_0xc9abed['order']=qs[_0x0537('0x3e')](_0x597c72[_0x0537('0x35')]['sort']);_0xc9abed[_0x0537('0x3f')]=qs[_0x0537('0x36')](_[_0x0537('0x40')](_0x597c72[_0x0537('0x35')],_0x59fec3[_0x0537('0x36')]));_0xc9abed[_0x0537('0x69')]=!![];if(_0x597c72[_0x0537('0x35')][_0x0537('0x41')]){_0xc9abed['where']=_[_0x0537('0x43')](_0xc9abed[_0x0537('0x3f')],{'$or':_[_0x0537('0x2e')](_0xc9abed[_0x0537('0x38')],function(_0x18bbc2){var _0x17b71d={};_0x17b71d[_0x18bbc2]={'$like':'%'+_0x597c72[_0x0537('0x35')]['filter']+'%'};return _0x17b71d;})});}_0xc9abed=_[_0x0537('0x43')]({},_0xc9abed,_0x597c72[_0x0537('0x44')]);return _0x368d0e['getContacts'](_0xc9abed);}})['then'](respondWithResult(_0x1f97f6,null))[_0x0537('0x48')](handleError(_0x1f97f6,null));};exports[_0x0537('0x6a')]=function(_0xca688c,_0x199861,_0x13beb8){var _0x3e34f8;var _0x2f6a26;var _0x2d0719;var _0x8147d4=_0xca688c['params']['id'];csv_results=[];return db[_0x0537('0x6b')][_0x0537('0x47')]({'attributes':['id',_0x0537('0x2d')],'raw':!![],'order':[_0x0537('0x6c')]})[_0x0537('0x28')](function(_0x1a069a){_0x3e34f8=_0x1a069a;var _0x3f5d00=_[_0x0537('0x4a')](db['CmContact']['rawAttributes']);return db['CmCustomField'][_0x0537('0x47')]({'raw':!![],'attributes':['id',_0x0537('0x6d')]})[_0x0537('0x28')](function(_0x5b4d77){_0x2f6a26=_0x5b4d77;var _0x554c5b=squel[_0x0537('0x6e')]()[_0x0537('0x39')](_0x3f5d00)[_0x0537('0x6f')]('cm_contacts','c')[_0x0537('0x3f')](_0x0537('0x70'),_0x8147d4)[_0x0537('0x3f')](_0x0537('0x71'))[_0x0537('0x72')]();for(var _0x483b70=0x0;_0x483b70<_0x2f6a26[_0x0537('0x3a')];_0x483b70++){_0x554c5b['field'](_0x0537('0x73')+_0x2f6a26[_0x483b70]['id'],'customField_'+_0x2f6a26[_0x483b70]['alias']);}for(var _0x483b70=0x0;_0x483b70<_0x3e34f8['length'];_0x483b70++){_0x554c5b[_0x0537('0x74')](squel[_0x0537('0x6e')]()[_0x0537('0x74')](_0x0537('0x75'))[_0x0537('0x6f')](_0x0537('0x76'))[_0x0537('0x3f')]('ItemTypeId\x20=\x20?',_0x3e34f8[_0x483b70]['id'])['where'](_0x0537('0x77')),'additionalPhone_'+_0x3e34f8[_0x483b70]['name']);_0x554c5b[_0x0537('0x74')](squel['select']()['field']('description')[_0x0537('0x6f')]('cm_contact_has_items')[_0x0537('0x3f')](_0x0537('0x78'),_0x3e34f8[_0x483b70]['id'])[_0x0537('0x3f')](_0x0537('0x77')),_0x0537('0x79')+_0x3e34f8[_0x483b70]['name']);}var _0x118289=[];_0x118289['push'](_0x554c5b[_0x0537('0x7a')]());BPromise[_0x0537('0x60')](_0x118289,handleQuery)['then'](function(_0x5f1b08){handleQuery(_0x554c5b['toString']());var _0x3fe6af=csv_results[0x0];if(!_[_0x0537('0x7b')](_0x3fe6af)){var _0x48c488=toCsv(_0x3fe6af);var _0x42dec2=Date[_0x0537('0x7c')]();fs[_0x0537('0x7d')](util[_0x0537('0x7e')]('/tmp/list_%d_%s.csv',_0x8147d4,_0x42dec2),_0x48c488);_0x199861[_0x0537('0x7f')](_0x0537('0x80'),_0x0537('0x81')+util[_0x0537('0x7e')](_0x0537('0x82'),_0x8147d4,_0x42dec2));_0x199861[_0x0537('0x7f')](_0x0537('0x83'),_0x0537('0x84'));return _0x199861[_0x0537('0x85')](util['format']('/tmp/list_%d_%s.csv',_0x8147d4,_0x42dec2));}else{return _0x199861['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x45b0d3,_0x2ddc8a,_0x4a2977){var _0x2fca5d;delete _0x45b0d3[_0x0537('0x4c')]['id'];return db[_0x0537('0x2f')][_0x0537('0x58')]({'where':{'id':_0x45b0d3['params']['id']}})['then'](handleEntityNotFound(_0x2ddc8a,null))[_0x0537('0x28')](function(_0x44f81d){if(_0x44f81d){return db[_0x0537('0x86')][_0x0537('0x87')](function(_0x243b61){return db[_0x0537('0x88')][_0x0537('0x4b')](_0x45b0d3[_0x0537('0x4c')],{'transaction':_0x243b61})['then'](function(_0x2a4225){_0x2fca5d=_0x2a4225;return _0x44f81d[_0x0537('0x89')](_0x2a4225,{'transaction':_0x243b61});})[_0x0537('0x28')](function(){var _0x23d8af={'type':db['Sequelize']['TEXT'],'transaction':_0x243b61};switch(_0x45b0d3['body']['type']){case _0x0537('0x8a'):_0x23d8af[_0x0537('0x32')]=db[_0x0537('0x8b')][_0x0537('0x8c')];break;case _0x0537('0x8d'):_0x23d8af[_0x0537('0x32')]=db[_0x0537('0x8b')]['INTEGER'];break;case _0x0537('0x8e'):_0x23d8af[_0x0537('0x32')]=db['Sequelize'][_0x0537('0x8f')];_0x23d8af[_0x0537('0x90')]=![];break;default:}return db[_0x0537('0x86')][_0x0537('0x91')][_0x0537('0x92')]('cm_contacts',util[_0x0537('0x7e')](_0x0537('0x93'),_0x2fca5d['id']),_0x23d8af);})[_0x0537('0x28')](function(){return _0x2fca5d;});});}})[_0x0537('0x28')](respondWithResult(_0x2ddc8a,null))[_0x0537('0x48')](handleError(_0x2ddc8a,null));};exports[_0x0537('0x94')]=function(_0x496116,_0xa51f58,_0x1b1ff3){var _0x3c8f25={};var _0x2d6691={};var _0x5c4a60;var _0x5a1b8d;return db[_0x0537('0x2f')]['findOne']({'where':{'id':_0x496116[_0x0537('0x53')]['id']}})[_0x0537('0x28')](handleEntityNotFound(_0xa51f58,null))['then'](function(_0x441344){if(_0x441344){_0x5c4a60=_0x441344;_0x2d6691[_0x0537('0x34')]=_[_0x0537('0x4a')](db[_0x0537('0x88')]['rawAttributes']);_0x2d6691[_0x0537('0x35')]=_['keys'](_0x496116[_0x0537('0x35')]);_0x2d6691[_0x0537('0x36')]=_[_0x0537('0x37')](_0x2d6691[_0x0537('0x34')],_0x2d6691[_0x0537('0x35')]);_0x3c8f25[_0x0537('0x38')]=_['intersection'](_0x2d6691[_0x0537('0x34')],qs['fields'](_0x496116[_0x0537('0x35')][_0x0537('0x39')]));_0x3c8f25[_0x0537('0x38')]=_0x3c8f25['attributes'][_0x0537('0x3a')]?_0x3c8f25[_0x0537('0x38')]:_0x2d6691[_0x0537('0x34')];_0x3c8f25[_0x0537('0x3d')]=qs[_0x0537('0x3e')](_0x496116['query'][_0x0537('0x3e')]);_0x3c8f25['where']=qs[_0x0537('0x36')](_[_0x0537('0x40')](_0x496116['query'],_0x2d6691[_0x0537('0x36')]));_0x3c8f25[_0x0537('0x3f')]=_[_0x0537('0x43')](_0x3c8f25[_0x0537('0x3f')],{'$or':[{'ListId':_0x441344['id']},{'ListId':null}]});if(_0x496116[_0x0537('0x35')][_0x0537('0x41')]){_0x3c8f25['where']=_[_0x0537('0x43')](_0x3c8f25['where'],{'$or':_[_0x0537('0x2e')](_0x3c8f25['attributes'],function(_0x4bf8df){var _0x8eab48={};_0x8eab48[_0x4bf8df]={'$like':'%'+_0x496116[_0x0537('0x35')]['filter']+'%'};return _0x8eab48;})});}_0x3c8f25=_['merge']({},_0x3c8f25,_0x496116[_0x0537('0x44')]);return db[_0x0537('0x88')][_0x0537('0x95')](_0x3c8f25);}})[_0x0537('0x28')](respondWithResult(_0xa51f58,null))[_0x0537('0x48')](handleError(_0xa51f58,null));};exports[_0x0537('0x96')]=function(_0x368ddd,_0x358427){return db[_0x0537('0x88')][_0x0537('0x95')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x358427,null))['then'](function(_0x48f2c6){return _0x48f2c6;})['then'](respondWithResult(_0x358427,null))[_0x0537('0x48')](handleError(_0x358427,null));};exports[_0x0537('0x97')]=function(_0x5dd1de,_0xfeb9c1,_0x1a2f88){return db[_0x0537('0x2f')][_0x0537('0x52')]({'where':{'id':_0x5dd1de[_0x0537('0x53')]['id']}})['then'](handleEntityNotFound(_0xfeb9c1,null))[_0x0537('0x28')](function(_0x2e01d5){if(_0x2e01d5){return _0x2e01d5[_0x0537('0x97')](_0x5dd1de[_0x0537('0x4c')][_0x0537('0x5b')],_[_0x0537('0x61')](_0x5dd1de[_0x0537('0x4c')],[_0x0537('0x5b'),'id'])||{})[_0x0537('0x98')](function(_0x584661){for(var _0x149fa8=0x0;_0x149fa8<_0x5dd1de[_0x0537('0x4c')][_0x0537('0x5b')]['length'];_0x149fa8+=0x1){socket[_0x0537('0x99')](_0x0537('0x9a'),{'UserId':Number(_0x5dd1de['body'][_0x0537('0x5b')][_0x149fa8]),'CmListId':Number(_0x5dd1de['params']['id'])});}return _0x584661;});}})[_0x0537('0x28')](respondWithResult(_0xfeb9c1,null))['catch'](handleError(_0xfeb9c1,null));};exports[_0x0537('0x9b')]=function(_0x3966be,_0x2d8a0b,_0x58f07e){return db[_0x0537('0x2f')]['find']({'where':{'id':_0x3966be[_0x0537('0x53')]['id']}})[_0x0537('0x28')](handleEntityNotFound(_0x2d8a0b,null))[_0x0537('0x28')](function(_0x105397){if(_0x105397){return _0x105397[_0x0537('0x9b')](_0x3966be[_0x0537('0x35')][_0x0537('0x5b')])[_0x0537('0x28')](function(){if(_[_0x0537('0x5e')](_0x3966be[_0x0537('0x35')][_0x0537('0x5b')])){for(var _0x33031b=0x0;_0x33031b<_0x3966be[_0x0537('0x35')][_0x0537('0x5b')]['length'];_0x33031b+=0x1){socket['emit'](_0x0537('0x9c'),{'UserId':Number(_0x3966be[_0x0537('0x35')][_0x0537('0x5b')][_0x33031b]),'CmListId':Number(_0x3966be['params']['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x3966be[_0x0537('0x35')][_0x0537('0x5b')]),'CmListId':Number(_0x3966be[_0x0537('0x53')]['id'])});}});}})[_0x0537('0x28')](respondWithStatusCode(_0x2d8a0b,null))[_0x0537('0x48')](handleError(_0x2d8a0b,null));};exports[_0x0537('0x9d')]=function(_0x5ad9d9,_0x75e5dd,_0x21c2d9){var _0x59553f={};var _0x472ca8={};var _0x7aefc0;var _0x7025a5;return db[_0x0537('0x2f')]['findOne']({'where':{'id':_0x5ad9d9[_0x0537('0x53')]['id']}})[_0x0537('0x28')](handleEntityNotFound(_0x75e5dd,null))[_0x0537('0x28')](function(_0x10e556){if(_0x10e556){_0x7aefc0=_0x10e556;_0x472ca8[_0x0537('0x34')]=_['keys'](db[_0x0537('0x9e')][_0x0537('0x30')]);_0x472ca8[_0x0537('0x35')]=_[_0x0537('0x4a')](_0x5ad9d9[_0x0537('0x35')]);_0x472ca8[_0x0537('0x36')]=_[_0x0537('0x37')](_0x472ca8[_0x0537('0x34')],_0x472ca8[_0x0537('0x35')]);_0x59553f[_0x0537('0x38')]=_[_0x0537('0x37')](_0x472ca8['model'],qs['fields'](_0x5ad9d9['query'][_0x0537('0x39')]));_0x59553f['attributes']=_0x59553f[_0x0537('0x38')]['length']?_0x59553f[_0x0537('0x38')]:_0x472ca8[_0x0537('0x34')];_0x59553f['order']=qs['sort'](_0x5ad9d9[_0x0537('0x35')][_0x0537('0x3e')]);_0x59553f[_0x0537('0x3f')]=qs['filters'](_[_0x0537('0x40')](_0x5ad9d9['query'],_0x472ca8[_0x0537('0x36')]));if(_0x5ad9d9[_0x0537('0x35')][_0x0537('0x41')]){_0x59553f[_0x0537('0x3f')]=_[_0x0537('0x43')](_0x59553f[_0x0537('0x3f')],{'$or':_[_0x0537('0x2e')](_0x59553f[_0x0537('0x38')],function(_0xe64611){var _0x3691d4={};_0x3691d4[_0xe64611]={'$like':'%'+_0x5ad9d9['query'][_0x0537('0x41')]+'%'};return _0x3691d4;})});}_0x59553f=_['merge']({},_0x59553f,_0x5ad9d9[_0x0537('0x44')]);return _0x7aefc0[_0x0537('0x9d')](_0x59553f);}})[_0x0537('0x28')](function(_0x7599e4){if(_0x7599e4){_0x7025a5=_0x7599e4['length'];if(!_0x5ad9d9[_0x0537('0x35')][_0x0537('0x3b')](_0x0537('0x3c'))){_0x59553f[_0x0537('0x22')]=qs['limit'](_0x5ad9d9[_0x0537('0x35')][_0x0537('0x22')]);_0x59553f[_0x0537('0x20')]=qs[_0x0537('0x20')](_0x5ad9d9['query']['offset']);}return _0x7aefc0[_0x0537('0x9d')](_0x59553f);}})[_0x0537('0x28')](function(_0x1df7c0){if(_0x1df7c0){return _0x1df7c0?{'count':_0x7025a5,'rows':_0x1df7c0}:null;}})[_0x0537('0x28')](respondWithResult(_0x75e5dd,null))[_0x0537('0x48')](handleError(_0x75e5dd,null));};function handleQuery(_0x4ed049){logger[_0x0537('0x9f')](_0x4ed049);return db['sequelize'][_0x0537('0x35')](_0x4ed049)['spread'](function(_0x247158){csv_results[_0x0537('0x63')](_0x247158);})['catch'](function(_0x5b3382){logger['error'](_0x5b3382[_0x0537('0x66')]);});} \ No newline at end of file +var _0x2cd8=['isArray','push','CmContact','omit','ids','errors','message','getContacts','concat','CustomFields','format','cf_%d','raw','CmCustomField','alias','cm_contacts','c.deletedAt\x20is\x20null','c.cf_','customField_','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','select','description','from','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','each','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','spread','eml-format','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','index','map','CmList','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','describe','addDisposition','ListId','findOne','Disposition','removeDispositions','addContacts','tags'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x2cd8,0x16f));var _0x82cd=function(_0x377361,_0x3e4a3e){_0x377361=_0x377361-0x0;var _0x569dc7=_0x2cd8[_0x377361];return _0x569dc7;};'use strict';var emlformat=require(_0x82cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x82cd('0x2'));var util=require('util');var path=require(_0x82cd('0x3'));var sox=require(_0x82cd('0x4'));var csv=require(_0x82cd('0x5'));var ejs=require(_0x82cd('0x6'));var fs=require('fs');var fs_extra=require(_0x82cd('0x7'));var _=require(_0x82cd('0x8'));var squel=require(_0x82cd('0x9'));var crypto=require(_0x82cd('0xa'));var jsforce=require(_0x82cd('0xb'));var deskjs=require(_0x82cd('0xc'));var toCsv=require(_0x82cd('0x5'));var querystring=require(_0x82cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x82cd('0xe'));var authService=require(_0x82cd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x82cd('0x10'));var hardwareService=require(_0x82cd('0x11'));var logger=require('../../config/logger')(_0x82cd('0x12'));var utils=require(_0x82cd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x82cd('0x14'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x82cd('0x15')]=_[_0x82cd('0x16')](config[_0x82cd('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x82cd('0x17'))(new Redis(config[_0x82cd('0x15')]));require(_0x82cd('0x18'))['register'](socket);function respondWithStatusCode(_0x2f7cae,_0x1914ac){_0x1914ac=_0x1914ac||0xcc;return function(_0x127775){if(_0x127775){return _0x2f7cae[_0x82cd('0x19')](_0x1914ac);}return _0x2f7cae[_0x82cd('0x1a')](_0x1914ac)[_0x82cd('0x1b')]();};}function respondWithResult(_0x384b6c,_0x409036){_0x409036=_0x409036||0xc8;return function(_0x2ccf83){if(_0x2ccf83){return _0x384b6c[_0x82cd('0x1a')](_0x409036)[_0x82cd('0x1c')](_0x2ccf83);}};}function respondWithFilteredResult(_0x34a141,_0x5c4d31){return function(_0x693944){if(_0x693944){var _0x2d3d89=typeof _0x5c4d31[_0x82cd('0x1d')]==='undefined'&&typeof _0x5c4d31[_0x82cd('0x1e')]===_0x82cd('0x1f');var _0x3f7dbd=_0x693944['count'];var _0x1de074=_0x2d3d89?0x0:_0x5c4d31[_0x82cd('0x1d')];var _0x2248bd=_0x2d3d89?_0x693944[_0x82cd('0x20')]:_0x5c4d31[_0x82cd('0x1d')]+_0x5c4d31[_0x82cd('0x1e')];var _0xa0fb5d;if(_0x2248bd>=_0x3f7dbd){_0x2248bd=_0x3f7dbd;_0xa0fb5d=0xc8;}else{_0xa0fb5d=0xce;}_0x34a141['status'](_0xa0fb5d);return _0x34a141[_0x82cd('0x21')](_0x82cd('0x22'),_0x1de074+'-'+_0x2248bd+'/'+_0x3f7dbd)[_0x82cd('0x1c')](_0x693944);}return null;};}function patchUpdates(_0x27cae8){return function(_0xb77eb5){try{jsonpatch[_0x82cd('0x23')](_0xb77eb5,_0x27cae8,!![]);}catch(_0x154133){return BPromise[_0x82cd('0x24')](_0x154133);}return _0xb77eb5[_0x82cd('0x25')]();};}function saveUpdates(_0x3027b8,_0x578b5a){return function(_0xda892f){if(_0xda892f){return _0xda892f['update'](_0x3027b8)['then'](function(_0xf25e6a){return _0xf25e6a;});}return null;};}function removeEntity(_0x17b17d,_0x1b7d4d){return function(_0xb43678){if(_0xb43678){return _0xb43678[_0x82cd('0x26')]()[_0x82cd('0x27')](function(){var _0x1a9e80=_0xb43678[_0x82cd('0x28')]({'plain':!![]});var _0x88dd0c='Lists';return db[_0x82cd('0x29')][_0x82cd('0x26')]({'where':{'type':_0x88dd0c,'resourceId':_0x1a9e80['id']}})[_0x82cd('0x27')](function(){return _0xb43678;});})[_0x82cd('0x27')](function(){_0x17b17d[_0x82cd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe86425,_0x260834){return function(_0x3b127f){if(!_0x3b127f){_0xe86425['sendStatus'](0x194);}return _0x3b127f;};}function handleError(_0x1e5c93,_0x2a9bf6){_0x2a9bf6=_0x2a9bf6||0x1f4;return function(_0x180d27){logger[_0x82cd('0x2a')](_0x180d27[_0x82cd('0x2b')]);if(_0x180d27[_0x82cd('0x2c')]){delete _0x180d27[_0x82cd('0x2c')];}_0x1e5c93[_0x82cd('0x1a')](_0x2a9bf6)['send'](_0x180d27);};}exports[_0x82cd('0x2d')]=function(_0x3e0526,_0x2868e5){var _0x1dcf57={},_0x10a963={},_0xbcaa62={'count':0x0,'rows':[]};var _0x22364b=_[_0x82cd('0x2e')](db[_0x82cd('0x2f')]['rawAttributes'],function(_0x29d369){return{'name':_0x29d369[_0x82cd('0x30')],'type':_0x29d369['type'][_0x82cd('0x31')]};});_0x10a963['model']=_[_0x82cd('0x2e')](_0x22364b,'name');_0x10a963[_0x82cd('0x32')]=_[_0x82cd('0x33')](_0x3e0526['query']);_0x10a963[_0x82cd('0x34')]=_[_0x82cd('0x35')](_0x10a963[_0x82cd('0x36')],_0x10a963[_0x82cd('0x32')]);_0x1dcf57['attributes']=_[_0x82cd('0x35')](_0x10a963[_0x82cd('0x36')],qs[_0x82cd('0x37')](_0x3e0526['query'][_0x82cd('0x37')]));_0x1dcf57[_0x82cd('0x38')]=_0x1dcf57[_0x82cd('0x38')][_0x82cd('0x39')]?_0x1dcf57[_0x82cd('0x38')]:_0x10a963[_0x82cd('0x36')];if(!_0x3e0526[_0x82cd('0x32')][_0x82cd('0x3a')](_0x82cd('0x3b'))){_0x1dcf57['limit']=qs['limit'](_0x3e0526[_0x82cd('0x32')][_0x82cd('0x1e')]);_0x1dcf57[_0x82cd('0x1d')]=qs[_0x82cd('0x1d')](_0x3e0526[_0x82cd('0x32')][_0x82cd('0x1d')]);}_0x1dcf57[_0x82cd('0x3c')]=qs[_0x82cd('0x3d')](_0x3e0526['query']['sort']);_0x1dcf57['where']=qs[_0x82cd('0x34')](_[_0x82cd('0x3e')](_0x3e0526[_0x82cd('0x32')],_0x10a963[_0x82cd('0x34')]),_0x22364b);if(_0x3e0526['query'][_0x82cd('0x3f')]){_0x1dcf57[_0x82cd('0x40')]=_[_0x82cd('0x41')](_0x1dcf57[_0x82cd('0x40')],{'$or':_[_0x82cd('0x2e')](_0x22364b,function(_0x5dc32c){if(_0x5dc32c[_0x82cd('0x42')]!==_0x82cd('0x43')){var _0x4a7f58={};_0x4a7f58[_0x5dc32c[_0x82cd('0x2c')]]={'$like':'%'+_0x3e0526['query'][_0x82cd('0x3f')]+'%'};return _0x4a7f58;}})});}_0x1dcf57=_[_0x82cd('0x41')]({},_0x1dcf57,_0x3e0526[_0x82cd('0x44')]);var _0x45dc7c={'where':_0x1dcf57[_0x82cd('0x40')]};return db[_0x82cd('0x2f')]['count'](_0x45dc7c)[_0x82cd('0x27')](function(_0x3def87){_0xbcaa62[_0x82cd('0x20')]=_0x3def87;if(_0x3e0526[_0x82cd('0x32')][_0x82cd('0x45')]){_0x1dcf57[_0x82cd('0x46')]=[{'all':!![]}];}return db['CmList'][_0x82cd('0x47')](_0x1dcf57);})['then'](function(_0x3892f6){_0xbcaa62[_0x82cd('0x48')]=_0x3892f6;return _0xbcaa62;})['then'](respondWithFilteredResult(_0x2868e5,_0x1dcf57))[_0x82cd('0x49')](handleError(_0x2868e5,null));};exports['show']=function(_0x331fdc,_0x5943e6){var _0x212cc4={'raw':![],'where':{'id':_0x331fdc[_0x82cd('0x4a')]['id']}},_0x2d4a95={};_0x2d4a95[_0x82cd('0x36')]=_[_0x82cd('0x33')](db[_0x82cd('0x2f')][_0x82cd('0x4b')]);_0x2d4a95[_0x82cd('0x32')]=_['keys'](_0x331fdc[_0x82cd('0x32')]);_0x2d4a95['filters']=_['intersection'](_0x2d4a95['model'],_0x2d4a95[_0x82cd('0x32')]);_0x212cc4[_0x82cd('0x38')]=_[_0x82cd('0x35')](_0x2d4a95[_0x82cd('0x36')],qs[_0x82cd('0x37')](_0x331fdc[_0x82cd('0x32')][_0x82cd('0x37')]));_0x212cc4[_0x82cd('0x38')]=_0x212cc4[_0x82cd('0x38')][_0x82cd('0x39')]?_0x212cc4[_0x82cd('0x38')]:_0x2d4a95[_0x82cd('0x36')];if(_0x331fdc[_0x82cd('0x32')][_0x82cd('0x45')]){_0x212cc4[_0x82cd('0x46')]=[{'all':!![]}];}_0x212cc4=_[_0x82cd('0x41')]({},_0x212cc4,_0x331fdc[_0x82cd('0x44')]);return db[_0x82cd('0x2f')][_0x82cd('0x4c')](_0x212cc4)[_0x82cd('0x27')](handleEntityNotFound(_0x5943e6,null))[_0x82cd('0x27')](respondWithResult(_0x5943e6,null))[_0x82cd('0x49')](handleError(_0x5943e6,null));};exports[_0x82cd('0x4d')]=function(_0x51ae78,_0x5e656e){return db[_0x82cd('0x2f')]['create'](_0x51ae78[_0x82cd('0x4e')],{})[_0x82cd('0x27')](function(_0x191e9f){var _0x51d325=_0x51ae78['user'][_0x82cd('0x28')]({'plain':!![]});if(!_0x51d325)throw new Error(_0x82cd('0x4f'));if(_0x51d325[_0x82cd('0x50')]===_0x82cd('0x51')){var _0x6e3ee2=_0x191e9f[_0x82cd('0x28')]({'plain':!![]});var _0x14c3e5='Lists';return db[_0x82cd('0x52')]['find']({'where':{'name':_0x14c3e5,'userProfileId':_0x51d325['userProfileId']},'raw':!![]})[_0x82cd('0x27')](function(_0x3cf120){if(_0x3cf120&&_0x3cf120[_0x82cd('0x53')]===0x0){return db[_0x82cd('0x29')]['create']({'name':_0x6e3ee2[_0x82cd('0x2c')],'resourceId':_0x6e3ee2['id'],'type':_0x3cf120['name'],'sectionId':_0x3cf120['id']},{})[_0x82cd('0x27')](function(){return _0x191e9f;});}else{return _0x191e9f;}})[_0x82cd('0x49')](function(_0x91841d){logger[_0x82cd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x91841d);throw _0x91841d;});}return _0x191e9f;})[_0x82cd('0x27')](respondWithResult(_0x5e656e,0xc9))[_0x82cd('0x49')](handleError(_0x5e656e,null));};exports['update']=function(_0x37cace,_0x46142c){if(_0x37cace['body']['id']){delete _0x37cace[_0x82cd('0x4e')]['id'];}return db[_0x82cd('0x2f')][_0x82cd('0x4c')]({'where':{'id':_0x37cace[_0x82cd('0x4a')]['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x46142c,null))[_0x82cd('0x27')](saveUpdates(_0x37cace[_0x82cd('0x4e')],null))['then'](respondWithResult(_0x46142c,null))[_0x82cd('0x49')](handleError(_0x46142c,null));};exports[_0x82cd('0x26')]=function(_0x3c9448,_0x290eea){return db[_0x82cd('0x2f')][_0x82cd('0x4c')]({'where':{'id':_0x3c9448[_0x82cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x290eea,null))[_0x82cd('0x27')](removeEntity(_0x290eea,null))['catch'](handleError(_0x290eea,null));};exports[_0x82cd('0x54')]=function(_0x1e9e01,_0x40f9cd){return db[_0x82cd('0x2f')]['describe']()[_0x82cd('0x27')](respondWithResult(_0x40f9cd,null))[_0x82cd('0x49')](handleError(_0x40f9cd,null));};exports[_0x82cd('0x55')]=function(_0x561319,_0x2daefb,_0x382f44){if(_0x561319[_0x82cd('0x4e')]['id']){delete _0x561319[_0x82cd('0x4e')]['id'];}return db[_0x82cd('0x2f')]['find']({'where':{'id':_0x561319[_0x82cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2daefb,null))[_0x82cd('0x27')](function(_0x15d284){if(_0x15d284){_0x561319['body'][_0x82cd('0x56')]=_0x15d284['id'];return db['Disposition'][_0x82cd('0x4d')](_0x561319[_0x82cd('0x4e')]);}})[_0x82cd('0x27')](respondWithResult(_0x2daefb,null))[_0x82cd('0x49')](handleError(_0x2daefb,null));};exports['getDispositions']=function(_0x33e47a,_0x1216f0,_0x55a8dd){var _0x2a7ad5={'raw':![],'where':{}};var _0x391ce1={};var _0x45c8b2={'count':0x0,'rows':[]};return db[_0x82cd('0x2f')][_0x82cd('0x57')]({'where':{'id':_0x33e47a[_0x82cd('0x4a')]['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x1216f0,null))[_0x82cd('0x27')](function(_0x3df9fa){if(_0x3df9fa){_0x391ce1[_0x82cd('0x36')]=_['keys'](db[_0x82cd('0x58')]['rawAttributes']);_0x391ce1[_0x82cd('0x32')]=_[_0x82cd('0x33')](_0x33e47a['query']);_0x391ce1[_0x82cd('0x34')]=_[_0x82cd('0x35')](_0x391ce1[_0x82cd('0x36')],_0x391ce1[_0x82cd('0x32')]);_0x2a7ad5[_0x82cd('0x38')]=_['intersection'](_0x391ce1['model'],qs['fields'](_0x33e47a[_0x82cd('0x32')]['fields']));_0x2a7ad5['attributes']=_0x2a7ad5[_0x82cd('0x38')][_0x82cd('0x39')]?_0x2a7ad5[_0x82cd('0x38')]:_0x391ce1[_0x82cd('0x36')];if(!_0x33e47a[_0x82cd('0x32')][_0x82cd('0x3a')](_0x82cd('0x3b'))){_0x2a7ad5[_0x82cd('0x1e')]=qs[_0x82cd('0x1e')](_0x33e47a[_0x82cd('0x32')][_0x82cd('0x1e')]);_0x2a7ad5[_0x82cd('0x1d')]=qs[_0x82cd('0x1d')](_0x33e47a[_0x82cd('0x32')][_0x82cd('0x1d')]);}_0x2a7ad5['order']=qs['sort'](_0x33e47a['query']['sort']);_0x2a7ad5[_0x82cd('0x40')]=qs['filters'](_[_0x82cd('0x3e')](_0x33e47a['query'],_0x391ce1[_0x82cd('0x34')]));_0x2a7ad5['where'][_0x82cd('0x56')]=_0x3df9fa['id'];if(_0x33e47a[_0x82cd('0x32')][_0x82cd('0x3f')]){_0x2a7ad5[_0x82cd('0x40')]=_[_0x82cd('0x41')](_0x2a7ad5[_0x82cd('0x40')],{'$or':_[_0x82cd('0x2e')](_0x2a7ad5[_0x82cd('0x38')],function(_0x48c92e){var _0x1e5e1b={};_0x1e5e1b[_0x48c92e]={'$like':'%'+_0x33e47a[_0x82cd('0x32')][_0x82cd('0x3f')]+'%'};return _0x1e5e1b;})});}_0x2a7ad5=_[_0x82cd('0x41')]({},_0x2a7ad5,_0x33e47a[_0x82cd('0x44')]);return db['Disposition'][_0x82cd('0x20')]({'where':_0x2a7ad5[_0x82cd('0x40')]})[_0x82cd('0x27')](function(_0x2cae3b){_0x45c8b2[_0x82cd('0x20')]=_0x2cae3b;if(_0x33e47a[_0x82cd('0x32')][_0x82cd('0x45')]){_0x2a7ad5[_0x82cd('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x82cd('0x47')](_0x2a7ad5);})[_0x82cd('0x27')](function(_0x3e5394){_0x45c8b2[_0x82cd('0x48')]=_0x3e5394;return _0x45c8b2;});}})[_0x82cd('0x27')](respondWithFilteredResult(_0x1216f0,_0x2a7ad5))['catch'](handleError(_0x1216f0,null));};exports[_0x82cd('0x59')]=function(_0x4e93a8,_0x32b222,_0x435c67){return db[_0x82cd('0x2f')]['find']({'where':{'id':_0x4e93a8['params']['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x32b222,null))[_0x82cd('0x27')](function(_0x4b840e){if(_0x4b840e){return _0x4b840e[_0x82cd('0x59')](_0x4e93a8['query']['ids']);}})[_0x82cd('0x27')](respondWithStatusCode(_0x32b222,null))[_0x82cd('0x49')](handleError(_0x32b222,null));};exports[_0x82cd('0x5a')]=function(_0x43e1e1,_0x296416,_0xad3153){return db[_0x82cd('0x2f')][_0x82cd('0x4c')]({'where':{'id':_0x43e1e1[_0x82cd('0x4a')]['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x296416,null))[_0x82cd('0x27')](function(_0xe1df1c){if(_0xe1df1c){var _0x59a8e0=[];var _0x2c3cc2={'success':[],'errors':[]};return db['CmContact'][_0x82cd('0x54')]()[_0x82cd('0x27')](function(_0x2a129f){if(_0x43e1e1[_0x82cd('0x4e')][_0x82cd('0x5b')]&&_[_0x82cd('0x5c')](_0x43e1e1[_0x82cd('0x4e')][_0x82cd('0x5b')])){if(_0x43e1e1[_0x82cd('0x4e')]['tags'][_0x82cd('0x39')]){_0x43e1e1[_0x82cd('0x4e')][_0x82cd('0x5b')]=_0x43e1e1['body'][_0x82cd('0x5b')]['join'](';')+';';}else{_0x43e1e1[_0x82cd('0x4e')][_0x82cd('0x5b')]=null;}}else{_0x43e1e1[_0x82cd('0x4e')]['tags']=null;}if(_0x43e1e1[_0x82cd('0x4e')]&&_['isArray'](_0x43e1e1[_0x82cd('0x4e')])){for(var _0x24fb2d=0x0;_0x24fb2d<_0x43e1e1[_0x82cd('0x4e')][_0x82cd('0x39')];_0x24fb2d+=0x1){_0x43e1e1[_0x82cd('0x4e')][_0x24fb2d][_0x82cd('0x56')]=_0x43e1e1[_0x82cd('0x4a')]['id'];_0x59a8e0[_0x82cd('0x5d')](_0x43e1e1[_0x82cd('0x4e')][_0x24fb2d]);}return BPromise['each'](_0x59a8e0,function(_0x32d2f2){return db[_0x82cd('0x5e')][_0x82cd('0x4d')](_[_0x82cd('0x5f')](_0x32d2f2,[_0x82cd('0x60'),'id'])||{},{'fields':_[_0x82cd('0x33')](_0x2a129f),'raw':!![]})[_0x82cd('0x27')](function(_0x3d3b21){_0x2c3cc2['success']['push'](_0x3d3b21['dataValues']);})[_0x82cd('0x49')](function(_0x424669){_0x2c3cc2[_0x82cd('0x61')][_0x82cd('0x5d')]({'data':_0x32d2f2,'error':_0x424669[_0x82cd('0x62')]});});})['then'](function(_0x246ad5){return _0x2c3cc2;})[_0x82cd('0x49')](function(_0x41829d){return _0x41829d;});}else{_0x296416[_0x82cd('0x1a')](0x190)[_0x82cd('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x82cd('0x27')](respondWithResult(_0x296416,null))['catch'](handleError(_0x296416,null));};exports[_0x82cd('0x63')]=function(_0x3394fd,_0x4afeb6,_0x3d2e0a){var _0x463478;return db[_0x82cd('0x2f')]['find']({'where':{'id':_0x3394fd['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x82cd('0x27')](handleEntityNotFound(_0x4afeb6,null))[_0x82cd('0x27')](function(_0x402295){if(_0x402295){_0x463478=_0x402295;return db[_0x82cd('0x5e')][_0x82cd('0x4b')];}})['then'](function(_0xb95a7f){if(_0xb95a7f){var _0x476bcf={};var _0x590d15={};_0x590d15[_0x82cd('0x36')]=_[_0x82cd('0x64')](_[_0x82cd('0x33')](_0xb95a7f),_[_0x82cd('0x2e')](_0x463478[_0x82cd('0x65')],function(_0x4d3b89){return util[_0x82cd('0x66')](_0x82cd('0x67'),_0x4d3b89['id']);}));_0x590d15['query']=_['keys'](_0x3394fd[_0x82cd('0x32')]);_0x590d15['filters']=_['intersection'](_0x590d15[_0x82cd('0x36')],_0x590d15[_0x82cd('0x32')]);_0x476bcf[_0x82cd('0x38')]=_[_0x82cd('0x35')](_0x590d15[_0x82cd('0x36')],qs[_0x82cd('0x37')](_0x3394fd['query']['fields']));_0x476bcf[_0x82cd('0x38')]=_0x476bcf[_0x82cd('0x38')][_0x82cd('0x39')]?_0x476bcf[_0x82cd('0x38')]:_0x590d15[_0x82cd('0x36')];if(!_0x3394fd[_0x82cd('0x32')][_0x82cd('0x3a')](_0x82cd('0x3b'))){_0x476bcf[_0x82cd('0x1e')]=qs[_0x82cd('0x1e')](_0x3394fd[_0x82cd('0x32')][_0x82cd('0x1e')]);_0x476bcf[_0x82cd('0x1d')]=qs[_0x82cd('0x1d')](_0x3394fd[_0x82cd('0x32')][_0x82cd('0x1d')]);}_0x476bcf[_0x82cd('0x3c')]=qs[_0x82cd('0x3d')](_0x3394fd[_0x82cd('0x32')][_0x82cd('0x3d')]);_0x476bcf[_0x82cd('0x40')]=qs[_0x82cd('0x34')](_[_0x82cd('0x3e')](_0x3394fd['query'],_0x590d15['filters']));_0x476bcf[_0x82cd('0x68')]=!![];if(_0x3394fd[_0x82cd('0x32')]['filter']){_0x476bcf[_0x82cd('0x40')]=_['merge'](_0x476bcf[_0x82cd('0x40')],{'$or':_[_0x82cd('0x2e')](_0x476bcf['attributes'],function(_0x2ddece){var _0x281bcf={};_0x281bcf[_0x2ddece]={'$like':'%'+_0x3394fd['query'][_0x82cd('0x3f')]+'%'};return _0x281bcf;})});}_0x476bcf=_['merge']({},_0x476bcf,_0x3394fd[_0x82cd('0x44')]);return _0x463478[_0x82cd('0x63')](_0x476bcf);}})['then'](respondWithResult(_0x4afeb6,null))[_0x82cd('0x49')](handleError(_0x4afeb6,null));};exports['getContactsCsv']=function(_0xebc648,_0x5f47fc,_0x453223){var _0x503ddd;var _0x106720;var _0x295e4c;var _0x30b188=_0xebc648['params']['id'];csv_results=[];return db['ContactItemType'][_0x82cd('0x47')]({'attributes':['id',_0x82cd('0x2c')],'raw':!![],'order':['OrderBy']})[_0x82cd('0x27')](function(_0x2c46de){_0x503ddd=_0x2c46de;var _0x45005a=_[_0x82cd('0x33')](db['CmContact'][_0x82cd('0x4b')]);return db[_0x82cd('0x69')]['findAll']({'raw':!![],'attributes':['id',_0x82cd('0x6a')]})[_0x82cd('0x27')](function(_0x511b3e){_0x106720=_0x511b3e;var _0x4c1da8=squel['select']()[_0x82cd('0x37')](_0x45005a)['from'](_0x82cd('0x6b'),'c')[_0x82cd('0x40')]('c.ListId\x20=\x20?',_0x30b188)['where'](_0x82cd('0x6c'))['distinct']();for(var _0x50be9a=0x0;_0x50be9a<_0x106720[_0x82cd('0x39')];_0x50be9a++){_0x4c1da8['field'](_0x82cd('0x6d')+_0x106720[_0x50be9a]['id'],_0x82cd('0x6e')+_0x106720[_0x50be9a][_0x82cd('0x6a')]);}for(var _0x50be9a=0x0;_0x50be9a<_0x503ddd[_0x82cd('0x39')];_0x50be9a++){_0x4c1da8[_0x82cd('0x6f')](squel['select']()[_0x82cd('0x6f')](_0x82cd('0x70'))['from'](_0x82cd('0x71'))[_0x82cd('0x40')](_0x82cd('0x72'),_0x503ddd[_0x50be9a]['id'])[_0x82cd('0x40')]('CmContactId\x20=\x20c.id'),_0x82cd('0x73')+_0x503ddd[_0x50be9a]['name']);_0x4c1da8[_0x82cd('0x6f')](squel[_0x82cd('0x74')]()[_0x82cd('0x6f')](_0x82cd('0x75'))[_0x82cd('0x76')](_0x82cd('0x71'))[_0x82cd('0x40')](_0x82cd('0x72'),_0x503ddd[_0x50be9a]['id'])[_0x82cd('0x40')](_0x82cd('0x77')),_0x82cd('0x78')+_0x503ddd[_0x50be9a][_0x82cd('0x2c')]);}var _0xaf16e5=[];_0xaf16e5[_0x82cd('0x5d')](_0x4c1da8[_0x82cd('0x79')]());BPromise[_0x82cd('0x7a')](_0xaf16e5,handleQuery)[_0x82cd('0x27')](function(_0x5eb149){handleQuery(_0x4c1da8[_0x82cd('0x79')]());var _0x21ffe8=csv_results[0x0];if(!_[_0x82cd('0x7b')](_0x21ffe8)){var _0x240cde=toCsv(_0x21ffe8);var _0x8ef649=Date['now']();fs[_0x82cd('0x7c')](util[_0x82cd('0x66')](_0x82cd('0x7d'),_0x30b188,_0x8ef649),_0x240cde);_0x5f47fc[_0x82cd('0x7e')]('Content-disposition',_0x82cd('0x7f')+util[_0x82cd('0x66')]('list_%d_%s.csv',_0x30b188,_0x8ef649));_0x5f47fc[_0x82cd('0x7e')](_0x82cd('0x80'),_0x82cd('0x81'));return _0x5f47fc[_0x82cd('0x82')](util['format'](_0x82cd('0x7d'),_0x30b188,_0x8ef649));}else{return _0x5f47fc[_0x82cd('0x19')](0xcc);}});});});};exports[_0x82cd('0x83')]=function(_0xebb211,_0x37c44c,_0xf06f6c){var _0x3ea678;delete _0xebb211[_0x82cd('0x4e')]['id'];return db[_0x82cd('0x2f')][_0x82cd('0x57')]({'where':{'id':_0xebb211['params']['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x37c44c,null))['then'](function(_0x444a26){if(_0x444a26){return db['sequelize'][_0x82cd('0x84')](function(_0x47cd80){return db[_0x82cd('0x69')]['create'](_0xebb211[_0x82cd('0x4e')],{'transaction':_0x47cd80})[_0x82cd('0x27')](function(_0x429e0c){_0x3ea678=_0x429e0c;return _0x444a26[_0x82cd('0x85')](_0x429e0c,{'transaction':_0x47cd80});})['then'](function(){var _0x50c61b={'type':db[_0x82cd('0x86')][_0x82cd('0x87')],'transaction':_0x47cd80};switch(_0xebb211[_0x82cd('0x4e')][_0x82cd('0x42')]){case _0x82cd('0x88'):_0x50c61b['type']=db[_0x82cd('0x86')][_0x82cd('0x87')];break;case _0x82cd('0x89'):_0x50c61b[_0x82cd('0x42')]=db[_0x82cd('0x86')][_0x82cd('0x8a')];break;case _0x82cd('0x8b'):_0x50c61b['type']=db[_0x82cd('0x86')][_0x82cd('0x8c')];_0x50c61b['defaultValue']=![];break;default:}return db[_0x82cd('0x8d')][_0x82cd('0x8e')][_0x82cd('0x8f')]('cm_contacts',util[_0x82cd('0x66')]('cf_%s',_0x3ea678['id']),_0x50c61b);})['then'](function(){return _0x3ea678;});});}})[_0x82cd('0x27')](respondWithResult(_0x37c44c,null))['catch'](handleError(_0x37c44c,null));};exports[_0x82cd('0x90')]=function(_0x48ef4b,_0x549e17,_0x2e8a58){var _0x2ea5f0={};var _0x5d8aeb={};var _0x2c2b5c;var _0x442229;return db[_0x82cd('0x2f')][_0x82cd('0x57')]({'where':{'id':_0x48ef4b[_0x82cd('0x4a')]['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x549e17,null))[_0x82cd('0x27')](function(_0x115fcf){if(_0x115fcf){_0x2c2b5c=_0x115fcf;_0x5d8aeb['model']=_['keys'](db[_0x82cd('0x69')][_0x82cd('0x4b')]);_0x5d8aeb[_0x82cd('0x32')]=_[_0x82cd('0x33')](_0x48ef4b[_0x82cd('0x32')]);_0x5d8aeb[_0x82cd('0x34')]=_['intersection'](_0x5d8aeb[_0x82cd('0x36')],_0x5d8aeb[_0x82cd('0x32')]);_0x2ea5f0[_0x82cd('0x38')]=_[_0x82cd('0x35')](_0x5d8aeb[_0x82cd('0x36')],qs[_0x82cd('0x37')](_0x48ef4b[_0x82cd('0x32')][_0x82cd('0x37')]));_0x2ea5f0[_0x82cd('0x38')]=_0x2ea5f0['attributes']['length']?_0x2ea5f0[_0x82cd('0x38')]:_0x5d8aeb[_0x82cd('0x36')];_0x2ea5f0['order']=qs[_0x82cd('0x3d')](_0x48ef4b[_0x82cd('0x32')][_0x82cd('0x3d')]);_0x2ea5f0['where']=qs[_0x82cd('0x34')](_[_0x82cd('0x3e')](_0x48ef4b[_0x82cd('0x32')],_0x5d8aeb[_0x82cd('0x34')]));_0x2ea5f0['where']=_[_0x82cd('0x41')](_0x2ea5f0[_0x82cd('0x40')],{'$or':[{'ListId':_0x115fcf['id']},{'ListId':null}]});if(_0x48ef4b[_0x82cd('0x32')][_0x82cd('0x3f')]){_0x2ea5f0[_0x82cd('0x40')]=_[_0x82cd('0x41')](_0x2ea5f0[_0x82cd('0x40')],{'$or':_[_0x82cd('0x2e')](_0x2ea5f0[_0x82cd('0x38')],function(_0x55897b){var _0x22c918={};_0x22c918[_0x55897b]={'$like':'%'+_0x48ef4b[_0x82cd('0x32')][_0x82cd('0x3f')]+'%'};return _0x22c918;})});}_0x2ea5f0=_['merge']({},_0x2ea5f0,_0x48ef4b[_0x82cd('0x44')]);return db[_0x82cd('0x69')][_0x82cd('0x91')](_0x2ea5f0);}})[_0x82cd('0x27')](respondWithResult(_0x549e17,null))[_0x82cd('0x49')](handleError(_0x549e17,null));};exports['getGlobalCustomFields']=function(_0x181420,_0x56c8ce){return db['CmCustomField'][_0x82cd('0x91')]({'where':{'ListId':null}})[_0x82cd('0x27')](handleEntityNotFound(_0x56c8ce,null))[_0x82cd('0x27')](function(_0x4d08a8){return _0x4d08a8;})[_0x82cd('0x27')](respondWithResult(_0x56c8ce,null))['catch'](handleError(_0x56c8ce,null));};exports[_0x82cd('0x92')]=function(_0x283540,_0x389873,_0x430182){return db[_0x82cd('0x2f')][_0x82cd('0x4c')]({'where':{'id':_0x283540[_0x82cd('0x4a')]['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x389873,null))[_0x82cd('0x27')](function(_0x4820ef){if(_0x4820ef){return _0x4820ef[_0x82cd('0x92')](_0x283540[_0x82cd('0x4e')][_0x82cd('0x60')],_[_0x82cd('0x5f')](_0x283540['body'],[_0x82cd('0x60'),'id'])||{})['spread'](function(_0x82c1db){for(var _0x594d9a=0x0;_0x594d9a<_0x283540[_0x82cd('0x4e')]['ids']['length'];_0x594d9a+=0x1){socket[_0x82cd('0x93')](_0x82cd('0x94'),{'UserId':Number(_0x283540['body'][_0x82cd('0x60')][_0x594d9a]),'CmListId':Number(_0x283540['params']['id'])});}return _0x82c1db;});}})[_0x82cd('0x27')](respondWithResult(_0x389873,null))[_0x82cd('0x49')](handleError(_0x389873,null));};exports[_0x82cd('0x95')]=function(_0x1935d3,_0x38725c,_0x2c90fc){return db[_0x82cd('0x2f')][_0x82cd('0x4c')]({'where':{'id':_0x1935d3[_0x82cd('0x4a')]['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x38725c,null))[_0x82cd('0x27')](function(_0x249b17){if(_0x249b17){return _0x249b17['removeAgents'](_0x1935d3[_0x82cd('0x32')][_0x82cd('0x60')])[_0x82cd('0x27')](function(){if(_[_0x82cd('0x5c')](_0x1935d3[_0x82cd('0x32')]['ids'])){for(var _0x2c9747=0x0;_0x2c9747<_0x1935d3[_0x82cd('0x32')][_0x82cd('0x60')][_0x82cd('0x39')];_0x2c9747+=0x1){socket[_0x82cd('0x93')]('userCmList:remove',{'UserId':Number(_0x1935d3[_0x82cd('0x32')]['ids'][_0x2c9747]),'CmListId':Number(_0x1935d3[_0x82cd('0x4a')]['id'])});}}else{socket[_0x82cd('0x93')](_0x82cd('0x96'),{'UserId':Number(_0x1935d3['query'][_0x82cd('0x60')]),'CmListId':Number(_0x1935d3[_0x82cd('0x4a')]['id'])});}});}})[_0x82cd('0x27')](respondWithStatusCode(_0x38725c,null))[_0x82cd('0x49')](handleError(_0x38725c,null));};exports['getAgents']=function(_0x3d6fd7,_0x5952b8,_0x213712){var _0x3484ee={};var _0x2ea268={};var _0x491919;var _0x240d2b;return db[_0x82cd('0x2f')][_0x82cd('0x57')]({'where':{'id':_0x3d6fd7[_0x82cd('0x4a')]['id']}})[_0x82cd('0x27')](handleEntityNotFound(_0x5952b8,null))[_0x82cd('0x27')](function(_0x25ed0b){if(_0x25ed0b){_0x491919=_0x25ed0b;_0x2ea268[_0x82cd('0x36')]=_[_0x82cd('0x33')](db['User'][_0x82cd('0x4b')]);_0x2ea268[_0x82cd('0x32')]=_[_0x82cd('0x33')](_0x3d6fd7[_0x82cd('0x32')]);_0x2ea268['filters']=_['intersection'](_0x2ea268[_0x82cd('0x36')],_0x2ea268['query']);_0x3484ee[_0x82cd('0x38')]=_[_0x82cd('0x35')](_0x2ea268[_0x82cd('0x36')],qs[_0x82cd('0x37')](_0x3d6fd7[_0x82cd('0x32')][_0x82cd('0x37')]));_0x3484ee[_0x82cd('0x38')]=_0x3484ee[_0x82cd('0x38')][_0x82cd('0x39')]?_0x3484ee['attributes']:_0x2ea268[_0x82cd('0x36')];_0x3484ee[_0x82cd('0x3c')]=qs['sort'](_0x3d6fd7[_0x82cd('0x32')][_0x82cd('0x3d')]);_0x3484ee[_0x82cd('0x40')]=qs['filters'](_[_0x82cd('0x3e')](_0x3d6fd7['query'],_0x2ea268[_0x82cd('0x34')]));if(_0x3d6fd7['query'][_0x82cd('0x3f')]){_0x3484ee['where']=_[_0x82cd('0x41')](_0x3484ee[_0x82cd('0x40')],{'$or':_[_0x82cd('0x2e')](_0x3484ee[_0x82cd('0x38')],function(_0x337828){var _0x5ee005={};_0x5ee005[_0x337828]={'$like':'%'+_0x3d6fd7['query'][_0x82cd('0x3f')]+'%'};return _0x5ee005;})});}_0x3484ee=_[_0x82cd('0x41')]({},_0x3484ee,_0x3d6fd7[_0x82cd('0x44')]);return _0x491919[_0x82cd('0x97')](_0x3484ee);}})[_0x82cd('0x27')](function(_0x38d4d0){if(_0x38d4d0){_0x240d2b=_0x38d4d0[_0x82cd('0x39')];if(!_0x3d6fd7[_0x82cd('0x32')][_0x82cd('0x3a')](_0x82cd('0x3b'))){_0x3484ee[_0x82cd('0x1e')]=qs[_0x82cd('0x1e')](_0x3d6fd7[_0x82cd('0x32')][_0x82cd('0x1e')]);_0x3484ee['offset']=qs[_0x82cd('0x1d')](_0x3d6fd7[_0x82cd('0x32')][_0x82cd('0x1d')]);}return _0x491919[_0x82cd('0x97')](_0x3484ee);}})[_0x82cd('0x27')](function(_0x71fbcb){if(_0x71fbcb){return _0x71fbcb?{'count':_0x240d2b,'rows':_0x71fbcb}:null;}})[_0x82cd('0x27')](respondWithResult(_0x5952b8,null))[_0x82cd('0x49')](handleError(_0x5952b8,null));};function handleQuery(_0x40e9b0){logger['info'](_0x40e9b0);return db[_0x82cd('0x8d')][_0x82cd('0x32')](_0x40e9b0)[_0x82cd('0x98')](function(_0x2505d7){csv_results[_0x82cd('0x5d')](_0x2505d7);})[_0x82cd('0x49')](function(_0x2da7f8){logger['error'](_0x2da7f8[_0x82cd('0x62')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 25878fb..b667c88 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x2a7c2a,_0x37cc9e){var _0x195732=function(_0x4d3902){while(--_0x4d3902){_0x2a7c2a['push'](_0x2a7c2a['shift']());}};_0x195732(++_0x37cc9e);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x55ca,0x126));var _0xa55c=function(_0x5a2db8,_0x409f2a){_0x5a2db8=_0x5a2db8-0x0;var _0x28b4f8=_0x55ca[_0x5a2db8];return _0x28b4f8;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 0ce7839..8465bdb 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 _0x0bb5=['define','CmList','cm_lists','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x39f18f,_0x41841a){var _0x8285b7=function(_0x196a8f){while(--_0x196a8f){_0x39f18f['push'](_0x39f18f['shift']());}};_0x8285b7(++_0x41841a);}(_0x0bb5,0x148));var _0x50bb=function(_0x369fca,_0x5ed2e9){_0x369fca=_0x369fca-0x0;var _0x2db08f=_0x0bb5[_0x369fca];return _0x2db08f;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50bb('0x2'));var BPromise=require(_0x50bb('0x3'));var rp=require(_0x50bb('0x4'));var fs=require('fs');var path=require(_0x50bb('0x5'));var rimraf=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var attributes=require(_0x50bb('0x8'));module[_0x50bb('0x9')]=function(_0x4e6093,_0x4a105c){return _0x4e6093[_0x50bb('0xa')](_0x50bb('0xb'),attributes,{'tableName':_0x50bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util'];(function(_0x22eca0,_0x5888f5){var _0x39555c=function(_0x345574){while(--_0x345574){_0x22eca0['push'](_0x22eca0['shift']());}};_0x39555c(++_0x5888f5);}(_0xa8a8,0xec));var _0x8a8a=function(_0x1d49c9,_0x2315ff){_0x1d49c9=_0x1d49c9-0x0;var _0x145c6c=_0xa8a8[_0x1d49c9];return _0x145c6c;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'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 798b4d3..27786fb 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 _0x0e0b=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x0e0b,0x1e7));var _0xb0e0=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0x0e0b[_0x3f465d];return _0x121ad1;};'use strict';var _=require('lodash');var util=require(_0xb0e0('0x0'));var moment=require(_0xb0e0('0x1'));var BPromise=require(_0xb0e0('0x2'));var rs=require(_0xb0e0('0x3'));var fs=require('fs');var Redis=require(_0xb0e0('0x4'));var db=require(_0xb0e0('0x5'))['db'];var utils=require(_0xb0e0('0x6'));var logger=require(_0xb0e0('0x7'))(_0xb0e0('0x8'));var config=require(_0xb0e0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb0e0('0xa')]['http']({'port':0x232a});config[_0xb0e0('0xb')]=_[_0xb0e0('0xc')](config['redis'],{'host':_0xb0e0('0xd'),'port':0x18eb});var socket=require(_0xb0e0('0xe'))(new Redis(config[_0xb0e0('0xb')]));require(_0xb0e0('0xf'))[_0xb0e0('0x10')](socket);function respondWithRpcPromise(_0x48b6b5,_0x422a41,_0x25dfa1){return new BPromise(function(_0x35e0b2,_0x5cfc15){return client['request'](_0x48b6b5,_0x25dfa1)[_0xb0e0('0x11')](function(_0x2592b5){logger[_0xb0e0('0x12')](_0xb0e0('0x13'),_0x422a41,_0xb0e0('0x14'));logger[_0xb0e0('0x15')](_0xb0e0('0x16'),_0x422a41,_0xb0e0('0x14'),JSON[_0xb0e0('0x17')](_0x2592b5));if(_0x2592b5['error']){if(_0x2592b5[_0xb0e0('0x18')]['code']===0x1f4){logger[_0xb0e0('0x18')]('CmList,\x20%s,\x20%s',_0x422a41,_0x2592b5[_0xb0e0('0x18')][_0xb0e0('0x19')]);return _0x5cfc15(_0x2592b5[_0xb0e0('0x18')][_0xb0e0('0x19')]);}logger[_0xb0e0('0x18')](_0xb0e0('0x13'),_0x422a41,_0x2592b5[_0xb0e0('0x18')][_0xb0e0('0x19')]);return _0x35e0b2(_0x2592b5[_0xb0e0('0x18')][_0xb0e0('0x19')]);}else{logger[_0xb0e0('0x12')](_0xb0e0('0x13'),_0x422a41,'request\x20sent');_0x35e0b2(_0x2592b5['result'][_0xb0e0('0x19')]);}})[_0xb0e0('0x1a')](function(_0x2bad6f){logger['error']('CmList,\x20%s,\x20%s',_0x422a41,_0x2bad6f);_0x5cfc15(_0x2bad6f);});});} \ No newline at end of file +var _0x7c9a=['request','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','register'];(function(_0x770f7,_0x3af003){var _0xe797c6=function(_0x47d92a){while(--_0x47d92a){_0x770f7['push'](_0x770f7['shift']());}};_0xe797c6(++_0x3af003);}(_0x7c9a,0x1d8));var _0xa7c9=function(_0x2226bd,_0x146ba3){_0x2226bd=_0x2226bd-0x0;var _0x569c58=_0x7c9a[_0x2226bd];return _0x569c58;};'use strict';var _=require('lodash');var util=require(_0xa7c9('0x0'));var moment=require('moment');var BPromise=require(_0xa7c9('0x1'));var rs=require(_0xa7c9('0x2'));var fs=require('fs');var Redis=require(_0xa7c9('0x3'));var db=require(_0xa7c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7c9('0x5'));var config=require(_0xa7c9('0x6'));var jayson=require(_0xa7c9('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xa7c9('0x8')]=_[_0xa7c9('0x9')](config[_0xa7c9('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7c9('0x8')]));require('./cmList.socket')[_0xa7c9('0xa')](socket);function respondWithRpcPromise(_0x1d6298,_0x39c0ff,_0x20111b){return new BPromise(function(_0x3b59cf,_0x28f024){return client[_0xa7c9('0xb')](_0x1d6298,_0x20111b)['then'](function(_0x447a3f){logger[_0xa7c9('0xc')](_0xa7c9('0xd'),_0x39c0ff,'request\x20sent');logger[_0xa7c9('0xe')](_0xa7c9('0xf'),_0x39c0ff,_0xa7c9('0x10'),JSON[_0xa7c9('0x11')](_0x447a3f));if(_0x447a3f[_0xa7c9('0x12')]){if(_0x447a3f['error'][_0xa7c9('0x13')]===0x1f4){logger[_0xa7c9('0x12')](_0xa7c9('0xd'),_0x39c0ff,_0x447a3f[_0xa7c9('0x12')][_0xa7c9('0x14')]);return _0x28f024(_0x447a3f[_0xa7c9('0x12')][_0xa7c9('0x14')]);}logger['error'](_0xa7c9('0xd'),_0x39c0ff,_0x447a3f['error'][_0xa7c9('0x14')]);return _0x3b59cf(_0x447a3f[_0xa7c9('0x12')][_0xa7c9('0x14')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x39c0ff,_0xa7c9('0x10'));_0x3b59cf(_0x447a3f[_0xa7c9('0x15')]['message']);}})[_0xa7c9('0x16')](function(_0x3f1a22){logger[_0xa7c9('0x12')](_0xa7c9('0xd'),_0x39c0ff,_0x3f1a22);_0x28f024(_0x3f1a22);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index ac90765..3f23e76 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 _0x5f9c=['length','cmList:','./cmList.events','save','remove','removeListener','register'];(function(_0x4412e3,_0x9cd8b4){var _0x265790=function(_0x1f6813){while(--_0x1f6813){_0x4412e3['push'](_0x4412e3['shift']());}};_0x265790(++_0x9cd8b4);}(_0x5f9c,0xaa));var _0xc5f9=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x5f9c[_0x5a3cf0];return _0x5a64ee;};'use strict';var CmListEvents=require(_0xc5f9('0x0'));var events=[_0xc5f9('0x1'),_0xc5f9('0x2'),'update'];function createListener(_0x2ac38c,_0x51d332){return function(_0x3027ff){_0x51d332['emit'](_0x2ac38c,_0x3027ff);};}function removeListener(_0x2d0779,_0x2d955f){return function(){CmListEvents[_0xc5f9('0x3')](_0x2d0779,_0x2d955f);};}exports[_0xc5f9('0x4')]=function(_0x3c0c66){for(var _0x2a48db=0x0,_0x4a1bf5=events[_0xc5f9('0x5')];_0x2a48db<_0x4a1bf5;_0x2a48db++){var _0x500e56=events[_0x2a48db];var _0x374cc2=createListener(_0xc5f9('0x6')+_0x500e56,_0x3c0c66);CmListEvents['on'](_0x500e56,_0x374cc2);}}; \ No newline at end of file +var _0xef72=['length','cmList:','./cmList.events','save','remove','removeListener'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0xef72,0xf8));var _0x2ef7=function(_0x429928,_0x2ed0eb){_0x429928=_0x429928-0x0;var _0x15a946=_0xef72[_0x429928];return _0x15a946;};'use strict';var CmListEvents=require(_0x2ef7('0x0'));var events=[_0x2ef7('0x1'),_0x2ef7('0x2'),'update'];function createListener(_0x4cbda5,_0x52afb2){return function(_0x3cd266){_0x52afb2['emit'](_0x4cbda5,_0x3cd266);};}function removeListener(_0x1ceba3,_0x473662){return function(){CmListEvents[_0x2ef7('0x3')](_0x1ceba3,_0x473662);};}exports['register']=function(_0x12ce1b){for(var _0x4ff788=0x0,_0x2186f4=events[_0x2ef7('0x4')];_0x4ff788<_0x2186f4;_0x4ff788++){var _0x113d5f=events[_0x4ff788];var _0x46c61c=createListener(_0x2ef7('0x5')+_0x113d5f,_0x12ce1b);CmListEvents['on'](_0x113d5f,_0x46c61c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 11e524c..3898044 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 _0xe826=['update','delete','destroy','removeDispositions','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','addContacts','/:id/fields','addCustomField','addAgents','put'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xe826,0x1a9));var _0x6e82=function(_0x22ac8a,_0x200a2f){_0x22ac8a=_0x22ac8a-0x0;var _0x510d11=_0xe826[_0x22ac8a];return _0x510d11;};'use strict';var multer=require(_0x6e82('0x0'));var util=require(_0x6e82('0x1'));var path=require(_0x6e82('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6e82('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6e82('0x4'));var interaction=require(_0x6e82('0x5'));var config=require(_0x6e82('0x6'));var controller=require(_0x6e82('0x7'));router[_0x6e82('0x8')]('/',auth[_0x6e82('0x9')](),controller[_0x6e82('0xa')]);router[_0x6e82('0x8')]('/describe',auth[_0x6e82('0x9')](),controller[_0x6e82('0xb')]);router[_0x6e82('0x8')](_0x6e82('0xc'),auth['isAuthenticated'](),controller[_0x6e82('0xd')]);router[_0x6e82('0x8')](_0x6e82('0xe'),auth['isAuthenticated'](),controller[_0x6e82('0xf')]);router[_0x6e82('0x8')](_0x6e82('0x10'),auth[_0x6e82('0x9')](),controller[_0x6e82('0x11')]);router[_0x6e82('0x8')](_0x6e82('0x12'),auth['isAuthenticated'](),controller[_0x6e82('0x13')]);router[_0x6e82('0x8')](_0x6e82('0x14'),auth['isAuthenticated'](),controller[_0x6e82('0x15')]);router[_0x6e82('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router[_0x6e82('0x8')](_0x6e82('0x16'),auth[_0x6e82('0x9')](),controller[_0x6e82('0x17')]);router[_0x6e82('0x18')]('/',auth[_0x6e82('0x9')](),controller['create']);router[_0x6e82('0x18')](_0x6e82('0x10'),auth[_0x6e82('0x9')](),controller['addDisposition']);router[_0x6e82('0x18')](_0x6e82('0x12'),auth[_0x6e82('0x9')](),controller[_0x6e82('0x19')]);router[_0x6e82('0x18')](_0x6e82('0x1a'),auth[_0x6e82('0x9')](),controller[_0x6e82('0x1b')]);router['post']('/:id/users',auth[_0x6e82('0x9')](),controller[_0x6e82('0x1c')]);router[_0x6e82('0x1d')](_0x6e82('0xe'),auth[_0x6e82('0x9')](),controller[_0x6e82('0x1e')]);router[_0x6e82('0x1f')](_0x6e82('0xe'),auth['isAuthenticated'](),controller[_0x6e82('0x20')]);router[_0x6e82('0x1f')]('/:id/dispositions',auth[_0x6e82('0x9')](),controller[_0x6e82('0x21')]);router[_0x6e82('0x1f')](_0x6e82('0x16'),auth[_0x6e82('0x9')](),controller['removeAgents']);module[_0x6e82('0x22')]=router; \ No newline at end of file +var _0xddee=['index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','removeDispositions','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated'];(function(_0x585e74,_0xf268ee){var _0x13bba4=function(_0x456793){while(--_0x456793){_0x585e74['push'](_0x585e74['shift']());}};_0x13bba4(++_0xf268ee);}(_0xddee,0x1d2));var _0xedde=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xddee[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xedde('0x0'));var timeout=require(_0xedde('0x1'));var express=require(_0xedde('0x2'));var router=express['Router']();var fs_extra=require(_0xedde('0x3'));var auth=require(_0xedde('0x4'));var interaction=require(_0xedde('0x5'));var config=require(_0xedde('0x6'));var controller=require(_0xedde('0x7'));router[_0xedde('0x8')]('/',auth[_0xedde('0x9')](),controller[_0xedde('0xa')]);router[_0xedde('0x8')](_0xedde('0xb'),auth['isAuthenticated'](),controller[_0xedde('0xc')]);router[_0xedde('0x8')](_0xedde('0xd'),auth[_0xedde('0x9')](),controller[_0xedde('0xe')]);router[_0xedde('0x8')](_0xedde('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xedde('0x8')](_0xedde('0x10'),auth[_0xedde('0x9')](),controller[_0xedde('0x11')]);router['get'](_0xedde('0x12'),auth[_0xedde('0x9')](),controller[_0xedde('0x13')]);router[_0xedde('0x8')](_0xedde('0x14'),auth[_0xedde('0x9')](),controller['getContactsCsv']);router['get'](_0xedde('0x15'),auth['isAuthenticated'](),controller[_0xedde('0x16')]);router[_0xedde('0x8')](_0xedde('0x17'),auth[_0xedde('0x9')](),controller['getAgents']);router[_0xedde('0x18')]('/',auth[_0xedde('0x9')](),controller[_0xedde('0x19')]);router[_0xedde('0x18')](_0xedde('0x10'),auth[_0xedde('0x9')](),controller[_0xedde('0x1a')]);router[_0xedde('0x18')](_0xedde('0x12'),auth['isAuthenticated'](),controller[_0xedde('0x1b')]);router[_0xedde('0x18')](_0xedde('0x15'),auth[_0xedde('0x9')](),controller[_0xedde('0x1c')]);router[_0xedde('0x18')]('/:id/users',auth[_0xedde('0x9')](),controller[_0xedde('0x1d')]);router[_0xedde('0x1e')]('/:id',auth[_0xedde('0x9')](),controller[_0xedde('0x1f')]);router[_0xedde('0x20')]('/:id',auth[_0xedde('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xedde('0x9')](),controller[_0xedde('0x21')]);router[_0xedde('0x20')](_0xedde('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 337decc..c400ea5 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 _0xdccb=['sequelize','VIRTUAL','getDataValue','field','STRING'];(function(_0xd61f3,_0x166992){var _0x4c6ce7=function(_0x54ea51){while(--_0x54ea51){_0xd61f3['push'](_0xd61f3['shift']());}};_0x4c6ce7(++_0x166992);}(_0xdccb,0x168));var _0xbdcc=function(_0x30df2d,_0x117496){_0x30df2d=_0x30df2d-0x0;var _0x174b6d=_0xdccb[_0x30df2d];return _0x174b6d;};'use strict';var Sequelize=require(_0xbdcc('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdcc('0x1')],'get':function(_0x52ad36){return this[_0xbdcc('0x2')](_0xbdcc('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xbdcc('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xbdcc('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xe29d=['sequelize','exports','getDataValue','field','STRING'];(function(_0x39af5e,_0x6333cb){var _0x3d1607=function(_0x3adf20){while(--_0x3adf20){_0x39af5e['push'](_0x39af5e['shift']());}};_0x3d1607(++_0x6333cb);}(_0xe29d,0x109));var _0xde29=function(_0x19a4f1,_0x542729){_0x19a4f1=_0x19a4f1-0x0;var _0x260213=_0xe29d[_0x19a4f1];return _0x260213;};'use strict';var Sequelize=require(_0xde29('0x0'));module[_0xde29('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x306600){return this[_0xde29('0x2')](_0xde29('0x3'));}},'field':{'type':Sequelize[_0xde29('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xde29('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xde29('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d08a8fe..60de60e 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(_0x1226d9,_0x545616){var _0x3c5ef3=function(_0x186db8){while(--_0x186db8){_0x1226d9['push'](_0x1226d9['shift']());}};_0x3c5ef3(++_0x545616);}(_0x7a54,0x106));var _0x47a5=function(_0x4a1608,_0x304a68){_0x4a1608=_0x4a1608-0x0;var _0x233de1=_0x7a54[_0x4a1608];return _0x233de1;};'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(_0x48d0c4,_0x3fe712){var _0x17a7a8=function(_0x17095e){while(--_0x17095e){_0x48d0c4['push'](_0x48d0c4['shift']());}};_0x17a7a8(++_0x3fe712);}(_0x7a54,0x106));var _0x47a5=function(_0x3aa8ee,_0x13df6d){_0x3aa8ee=_0x3aa8ee-0x0;var _0x59998d=_0x7a54[_0x3aa8ee];return _0x59998d;};'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 015d791..349b258 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 _0xf738=['define','Condition','tools_conditions','../../config/logger','moment','bluebird','path','rimraf','./condition.attributes','exports'];(function(_0xafdfb1,_0x58b859){var _0x31bed=function(_0x2e8df5){while(--_0x2e8df5){_0xafdfb1['push'](_0xafdfb1['shift']());}};_0x31bed(++_0x58b859);}(_0xf738,0x1c5));var _0x8f73=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xf738[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8f73('0x0'))('api');var moment=require(_0x8f73('0x1'));var BPromise=require(_0x8f73('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f73('0x3'));var rimraf=require(_0x8f73('0x4'));var config=require('../../config/environment');var attributes=require(_0x8f73('0x5'));module[_0x8f73('0x6')]=function(_0x24edb8,_0x3830a3){return _0x24edb8[_0x8f73('0x7')](_0x8f73('0x8'),attributes,{'tableName':_0x8f73('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x593c=['tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x593c,0xeb));var _0xc593=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0x593c[_0x3ad7ad];return _0x225a60;};'use strict';var _=require(_0xc593('0x0'));var util=require(_0xc593('0x1'));var logger=require(_0xc593('0x2'))('api');var moment=require(_0xc593('0x3'));var BPromise=require(_0xc593('0x4'));var rp=require(_0xc593('0x5'));var fs=require('fs');var path=require(_0xc593('0x6'));var rimraf=require(_0xc593('0x7'));var config=require('../../config/environment');var attributes=require(_0xc593('0x8'));module[_0xc593('0x9')]=function(_0x5a7d21,_0x4cad48){return _0x5a7d21[_0xc593('0xa')](_0xc593('0xb'),attributes,{'tableName':_0xc593('0xc'),'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 4ed98b3..672e064 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 _0xb544=['then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0xb9d849,_0x5aa518){var _0x2d08a5=function(_0x3511be){while(--_0x3511be){_0xb9d849['push'](_0xb9d849['shift']());}};_0x2d08a5(++_0x5aa518);}(_0xb544,0x128));var _0x4b54=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb544[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x4b54('0x0'));var moment=require(_0x4b54('0x1'));var BPromise=require(_0x4b54('0x2'));var rs=require(_0x4b54('0x3'));var fs=require('fs');var Redis=require(_0x4b54('0x4'));var db=require(_0x4b54('0x5'))['db'];var utils=require(_0x4b54('0x6'));var logger=require(_0x4b54('0x7'))(_0x4b54('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4b54('0x9')][_0x4b54('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b247d,_0x4f412f,_0xe86f23){return new BPromise(function(_0x3133d2,_0x2697e6){return client[_0x4b54('0xb')](_0x3b247d,_0xe86f23)[_0x4b54('0xc')](function(_0x2a912f){logger[_0x4b54('0xd')](_0x4b54('0xe'),_0x4f412f,_0x4b54('0xf'));logger[_0x4b54('0x10')](_0x4b54('0x11'),_0x4f412f,'request\x20sent',JSON[_0x4b54('0x12')](_0x2a912f));if(_0x2a912f[_0x4b54('0x13')]){if(_0x2a912f[_0x4b54('0x13')]['code']===0x1f4){logger[_0x4b54('0x13')](_0x4b54('0xe'),_0x4f412f,_0x2a912f[_0x4b54('0x13')]['message']);return _0x2697e6(_0x2a912f[_0x4b54('0x13')][_0x4b54('0x14')]);}logger[_0x4b54('0x13')](_0x4b54('0xe'),_0x4f412f,_0x2a912f[_0x4b54('0x13')][_0x4b54('0x14')]);return _0x3133d2(_0x2a912f['error']['message']);}else{logger[_0x4b54('0xd')](_0x4b54('0xe'),_0x4f412f,_0x4b54('0xf'));_0x3133d2(_0x2a912f[_0x4b54('0x15')]['message']);}})['catch'](function(_0x532881){logger[_0x4b54('0x13')](_0x4b54('0xe'),_0x4f412f,_0x532881);_0x2697e6(_0x532881);});});} \ No newline at end of file +var _0x54ec=['rpc','../../config/environment','client','http','request','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2f40d5,_0x40bf8a){var _0x2057e3=function(_0x4661cc){while(--_0x4661cc){_0x2f40d5['push'](_0x2f40d5['shift']());}};_0x2057e3(++_0x40bf8a);}(_0x54ec,0x1f3));var _0xc54e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x54ec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc54e('0x0'));var util=require('util');var moment=require(_0xc54e('0x1'));var BPromise=require(_0xc54e('0x2'));var rs=require(_0xc54e('0x3'));var fs=require('fs');var Redis=require(_0xc54e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc54e('0x5'));var logger=require(_0xc54e('0x6'))(_0xc54e('0x7'));var config=require(_0xc54e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc54e('0x9')][_0xc54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e1cf5,_0x569198,_0x2f7ded){return new BPromise(function(_0x2ae7d3,_0x1c1c33){return client[_0xc54e('0xb')](_0x4e1cf5,_0x2f7ded)['then'](function(_0x5ab0df){logger['info']('Condition,\x20%s,\x20%s',_0x569198,'request\x20sent');logger[_0xc54e('0xc')](_0xc54e('0xd'),_0x569198,_0xc54e('0xe'),JSON[_0xc54e('0xf')](_0x5ab0df));if(_0x5ab0df['error']){if(_0x5ab0df[_0xc54e('0x10')][_0xc54e('0x11')]===0x1f4){logger['error'](_0xc54e('0x12'),_0x569198,_0x5ab0df['error'][_0xc54e('0x13')]);return _0x1c1c33(_0x5ab0df[_0xc54e('0x10')]['message']);}logger[_0xc54e('0x10')](_0xc54e('0x12'),_0x569198,_0x5ab0df['error'][_0xc54e('0x13')]);return _0x2ae7d3(_0x5ab0df[_0xc54e('0x10')][_0xc54e('0x13')]);}else{logger['info'](_0xc54e('0x12'),_0x569198,_0xc54e('0xe'));_0x2ae7d3(_0x5ab0df[_0xc54e('0x14')][_0xc54e('0x13')]);}})[_0xc54e('0x15')](function(_0x32fdcc){logger[_0xc54e('0x10')](_0xc54e('0x12'),_0x569198,_0x32fdcc);_0x1c1c33(_0x32fdcc);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 892cda5..f46dc20 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 _0x0149=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','update','delete','destroy','exports','multer'];(function(_0x389b85,_0x243112){var _0x2fd54b=function(_0xc1c935){while(--_0xc1c935){_0x389b85['push'](_0x389b85['shift']());}};_0x2fd54b(++_0x243112);}(_0x0149,0xa4));var _0x9014=function(_0x3fad19,_0x354121){_0x3fad19=_0x3fad19-0x0;var _0x583d77=_0x0149[_0x3fad19];return _0x583d77;};'use strict';var multer=require(_0x9014('0x0'));var util=require(_0x9014('0x1'));var path=require('path');var timeout=require(_0x9014('0x2'));var express=require(_0x9014('0x3'));var router=express[_0x9014('0x4')]();var fs_extra=require(_0x9014('0x5'));var auth=require(_0x9014('0x6'));var interaction=require(_0x9014('0x7'));var config=require(_0x9014('0x8'));var controller=require('./condition.controller');router[_0x9014('0x9')](_0x9014('0xa'),auth['isAuthenticated'](),controller[_0x9014('0xb')]);router[_0x9014('0xc')](_0x9014('0xa'),auth['isAuthenticated'](),controller[_0x9014('0xd')]);module[_0x9014('0xe')]=router; \ No newline at end of file +var _0x7028=['./condition.controller','/:id','update','delete','isAuthenticated','util','connect-timeout','Router','../../components/auth/service'];(function(_0x2656b3,_0x220e83){var _0x565702=function(_0x68ebd3){while(--_0x68ebd3){_0x2656b3['push'](_0x2656b3['shift']());}};_0x565702(++_0x220e83);}(_0x7028,0x11c));var _0x8702=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x7028[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require('multer');var util=require(_0x8702('0x0'));var path=require('path');var timeout=require(_0x8702('0x1'));var express=require('express');var router=express[_0x8702('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8702('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8702('0x4'));router['put'](_0x8702('0x5'),auth['isAuthenticated'](),controller[_0x8702('0x6')]);router[_0x8702('0x7')](_0x8702('0x5'),auth[_0x8702('0x8')](),controller['destroy']);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 47a1f07..25d7c80 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 _0x3b6b=['exports','name','INTEGER','STRING','sequelize'];(function(_0x3e0628,_0x511646){var _0x4e1918=function(_0xe98ca7){while(--_0xe98ca7){_0x3e0628['push'](_0x3e0628['shift']());}};_0x4e1918(++_0x511646);}(_0x3b6b,0x194));var _0xb3b6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b6b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb3b6('0x0'));module[_0xb3b6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb3b6('0x2')},'OrderBy':{'type':Sequelize[_0xb3b6('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xb3b6('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0x3b54=['exports','STRING','name','INTEGER','sequelize'];(function(_0x1c453b,_0x34ed85){var _0x40adde=function(_0x425201){while(--_0x425201){_0x1c453b['push'](_0x1c453b['shift']());}};_0x40adde(++_0x34ed85);}(_0x3b54,0x12b));var _0x43b5=function(_0x3fd275,_0xf0cd7){_0x3fd275=_0x3fd275-0x0;var _0xe4f14f=_0x3b54[_0x3fd275];return _0xe4f14f;};'use strict';var Sequelize=require(_0x43b5('0x0'));module[_0x43b5('0x1')]={'name':{'type':Sequelize[_0x43b5('0x2')],'allowNull':![],'unique':_0x43b5('0x3')},'OrderBy':{'type':Sequelize[_0x43b5('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x43b5('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 7a7d353..6708995 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 _0x28f2=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','ContactItemType','count','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','CmContactHasItem','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'];(function(_0x5483a6,_0x30d8bb){var _0x1f8e85=function(_0x3bbc49){while(--_0x3bbc49){_0x5483a6['push'](_0x5483a6['shift']());}};_0x1f8e85(++_0x30d8bb);}(_0x28f2,0x193));var _0x228f=function(_0x201145,_0x58795d){_0x201145=_0x201145-0x0;var _0x7c007=_0x28f2[_0x201145];return _0x7c007;};'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(){var _0x56fbc2=_0x33e882[_0x228f('0x28')]({'plain':!![]});var _0x306928=_0x228f('0x29');return db[_0x228f('0x2a')][_0x228f('0x27')]({'where':{'type':_0x306928,'resourceId':_0x56fbc2['id']}})['then'](function(){return _0x33e882;});})[_0x228f('0x26')](function(){_0x1dad27['status'](0xcc)[_0x228f('0x1c')]();});}};}function handleEntityNotFound(_0x5afa52,_0x58a151){return function(_0x2b9802){if(!_0x2b9802){_0x5afa52[_0x228f('0x1a')](0x194);}return _0x2b9802;};}function handleError(_0x2a7842,_0x3ab339){_0x3ab339=_0x3ab339||0x1f4;return function(_0x34c735){logger[_0x228f('0x2b')](_0x34c735[_0x228f('0x2c')]);if(_0x34c735[_0x228f('0x2d')]){delete _0x34c735[_0x228f('0x2d')];}_0x2a7842[_0x228f('0x1b')](_0x3ab339)[_0x228f('0x2e')](_0x34c735);};}exports[_0x228f('0x2f')]=function(_0xc25917,_0xc6921f){var _0x2a3677={},_0x4e9ca8={},_0x4148ff={'count':0x0,'rows':[]};var _0x40bf17=_[_0x228f('0x30')](db['ContactItemType'][_0x228f('0x31')],function(_0x41be2d){return{'name':_0x41be2d['fieldName'],'type':_0x41be2d[_0x228f('0x32')][_0x228f('0x33')]};});_0x4e9ca8[_0x228f('0x34')]=_[_0x228f('0x30')](_0x40bf17,'name');_0x4e9ca8[_0x228f('0x35')]=_['keys'](_0xc25917[_0x228f('0x35')]);_0x4e9ca8[_0x228f('0x36')]=_[_0x228f('0x37')](_0x4e9ca8[_0x228f('0x34')],_0x4e9ca8['query']);_0x2a3677[_0x228f('0x38')]=_[_0x228f('0x37')](_0x4e9ca8['model'],qs['fields'](_0xc25917['query'][_0x228f('0x39')]));_0x2a3677[_0x228f('0x38')]=_0x2a3677[_0x228f('0x38')][_0x228f('0x3a')]?_0x2a3677[_0x228f('0x38')]:_0x4e9ca8[_0x228f('0x34')];if(!_0xc25917[_0x228f('0x35')][_0x228f('0x3b')](_0x228f('0x3c'))){_0x2a3677['limit']=qs['limit'](_0xc25917[_0x228f('0x35')][_0x228f('0x1f')]);_0x2a3677[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0xc25917[_0x228f('0x35')][_0x228f('0x1e')]);}_0x2a3677[_0x228f('0x3d')]=qs[_0x228f('0x3e')](_0xc25917[_0x228f('0x35')][_0x228f('0x3e')]);_0x2a3677['where']=qs['filters'](_[_0x228f('0x3f')](_0xc25917[_0x228f('0x35')],_0x4e9ca8[_0x228f('0x36')]),_0x40bf17);if(_0xc25917[_0x228f('0x35')]['filter']){_0x2a3677[_0x228f('0x40')]=_[_0x228f('0x41')](_0x2a3677['where'],{'$or':_['map'](_0x40bf17,function(_0x3da115){if(_0x3da115[_0x228f('0x32')]!=='VIRTUAL'){var _0x12a750={};_0x12a750[_0x3da115[_0x228f('0x2d')]]={'$like':'%'+_0xc25917['query']['filter']+'%'};return _0x12a750;}})});}_0x2a3677=_[_0x228f('0x41')]({},_0x2a3677,_0xc25917['options']);var _0x323d68={'where':_0x2a3677[_0x228f('0x40')]};return db[_0x228f('0x42')][_0x228f('0x43')](_0x323d68)[_0x228f('0x26')](function(_0x20c178){_0x4148ff['count']=_0x20c178;if(_0xc25917[_0x228f('0x35')]['includeAll']){_0x2a3677[_0x228f('0x44')]=[{'all':!![]}];}return db[_0x228f('0x42')][_0x228f('0x45')](_0x2a3677);})[_0x228f('0x26')](function(_0x41cba5){_0x4148ff[_0x228f('0x46')]=_0x41cba5;return _0x4148ff;})[_0x228f('0x26')](respondWithFilteredResult(_0xc6921f,_0x2a3677))[_0x228f('0x47')](handleError(_0xc6921f,null));};exports[_0x228f('0x48')]=function(_0x2592a1,_0x788e8b){var _0x345114={'raw':!![],'where':{'id':_0x2592a1['params']['id']}},_0x19839d={};_0x19839d['model']=_[_0x228f('0x49')](db[_0x228f('0x42')][_0x228f('0x31')]);_0x19839d[_0x228f('0x35')]=_[_0x228f('0x49')](_0x2592a1[_0x228f('0x35')]);_0x19839d[_0x228f('0x36')]=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],_0x19839d[_0x228f('0x35')]);_0x345114['attributes']=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],qs['fields'](_0x2592a1[_0x228f('0x35')]['fields']));_0x345114[_0x228f('0x38')]=_0x345114['attributes'][_0x228f('0x3a')]?_0x345114['attributes']:_0x19839d[_0x228f('0x34')];if(_0x2592a1[_0x228f('0x35')][_0x228f('0x4a')]){_0x345114[_0x228f('0x44')]=[{'all':!![]}];}_0x345114=_[_0x228f('0x41')]({},_0x345114,_0x2592a1[_0x228f('0x4b')]);return db[_0x228f('0x42')][_0x228f('0x4c')](_0x345114)[_0x228f('0x26')](handleEntityNotFound(_0x788e8b,null))[_0x228f('0x26')](respondWithResult(_0x788e8b,null))[_0x228f('0x47')](handleError(_0x788e8b,null));};exports[_0x228f('0x4d')]=function(_0x4099d4,_0x250345){return db[_0x228f('0x42')][_0x228f('0x4d')](_0x4099d4[_0x228f('0x4e')],{})[_0x228f('0x26')](function(_0x1872e2){var _0x55e140=_0x4099d4['user'][_0x228f('0x28')]({'plain':!![]});if(!_0x55e140)throw new Error(_0x228f('0x4f'));if(_0x55e140[_0x228f('0x50')]==='user'){var _0x17bcd9=_0x1872e2[_0x228f('0x28')]({'plain':!![]});var _0x28f91e='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x28f91e,'userProfileId':_0x55e140[_0x228f('0x51')]},'raw':!![]})[_0x228f('0x26')](function(_0x208397){if(_0x208397&&_0x208397[_0x228f('0x52')]===0x0){return db[_0x228f('0x2a')][_0x228f('0x4d')]({'name':_0x17bcd9[_0x228f('0x2d')],'resourceId':_0x17bcd9['id'],'type':_0x208397[_0x228f('0x2d')],'sectionId':_0x208397['id']},{})[_0x228f('0x26')](function(){return _0x1872e2;});}else{return _0x1872e2;}})[_0x228f('0x47')](function(_0x43bbd2){logger[_0x228f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43bbd2);throw _0x43bbd2;});}return _0x1872e2;})[_0x228f('0x26')](respondWithResult(_0x250345,0xc9))[_0x228f('0x47')](handleError(_0x250345,null));};exports[_0x228f('0x25')]=function(_0x561144,_0x3e9f76){if(_0x561144[_0x228f('0x4e')]['id']){delete _0x561144[_0x228f('0x4e')]['id'];}return db[_0x228f('0x42')]['find']({'where':{'id':_0x561144[_0x228f('0x53')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x3e9f76,null))[_0x228f('0x26')](saveUpdates(_0x561144[_0x228f('0x4e')],null))['then'](respondWithResult(_0x3e9f76,null))[_0x228f('0x47')](handleError(_0x3e9f76,null));};exports[_0x228f('0x27')]=function(_0x4b516e,_0x32787c){return db[_0x228f('0x42')][_0x228f('0x4c')]({'where':{'id':_0x4b516e[_0x228f('0x53')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x32787c,null))[_0x228f('0x26')](db[_0x228f('0x54')][_0x228f('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4b516e[_0x228f('0x53')]['id']}}))[_0x228f('0x26')](removeEntity(_0x32787c,null))['catch'](handleError(_0x32787c,null));}; \ No newline at end of file +var _0x1a37=['includeAll','include','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x1a37,0xb4));var _0x71a3=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x1a37[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){var _0xb9c195=_0x5f33c5[_0x71a3('0x26')]({'plain':!![]});var _0xb0f3aa='ContactItemTypes';return db[_0x71a3('0x27')][_0x71a3('0x25')]({'where':{'type':_0xb0f3aa,'resourceId':_0xb9c195['id']}})['then'](function(){return _0x5f33c5;});})[_0x71a3('0x24')](function(){_0x452bc4['status'](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0x2fd3b6,_0x211ea8){return function(_0x35b5c7){if(!_0x35b5c7){_0x2fd3b6[_0x71a3('0x18')](0x194);}return _0x35b5c7;};}function handleError(_0x314439,_0x2317ec){_0x2317ec=_0x2317ec||0x1f4;return function(_0x242b85){logger[_0x71a3('0x28')](_0x242b85[_0x71a3('0x29')]);if(_0x242b85[_0x71a3('0x2a')]){delete _0x242b85[_0x71a3('0x2a')];}_0x314439['status'](_0x2317ec)[_0x71a3('0x2b')](_0x242b85);};}exports[_0x71a3('0x2c')]=function(_0x334db0,_0x23ae85){var _0x4a750c={},_0x18a8fe={},_0x216d84={'count':0x0,'rows':[]};var _0x45d13d=_[_0x71a3('0x2d')](db[_0x71a3('0x2e')][_0x71a3('0x2f')],function(_0x1d09bd){return{'name':_0x1d09bd['fieldName'],'type':_0x1d09bd[_0x71a3('0x30')][_0x71a3('0x31')]};});_0x18a8fe[_0x71a3('0x32')]=_[_0x71a3('0x2d')](_0x45d13d,_0x71a3('0x2a'));_0x18a8fe[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x334db0[_0x71a3('0x33')]);_0x18a8fe[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x18a8fe[_0x71a3('0x32')],_0x18a8fe[_0x71a3('0x33')]);_0x4a750c[_0x71a3('0x37')]=_['intersection'](_0x18a8fe['model'],qs[_0x71a3('0x38')](_0x334db0[_0x71a3('0x33')]['fields']));_0x4a750c[_0x71a3('0x37')]=_0x4a750c[_0x71a3('0x37')]['length']?_0x4a750c[_0x71a3('0x37')]:_0x18a8fe[_0x71a3('0x32')];if(!_0x334db0[_0x71a3('0x33')][_0x71a3('0x39')](_0x71a3('0x3a'))){_0x4a750c[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x334db0['query'][_0x71a3('0x1d')]);_0x4a750c[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x334db0['query'][_0x71a3('0x1b')]);}_0x4a750c[_0x71a3('0x3b')]=qs[_0x71a3('0x3c')](_0x334db0[_0x71a3('0x33')][_0x71a3('0x3c')]);_0x4a750c['where']=qs['filters'](_[_0x71a3('0x3d')](_0x334db0[_0x71a3('0x33')],_0x18a8fe[_0x71a3('0x35')]),_0x45d13d);if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]){_0x4a750c['where']=_[_0x71a3('0x3f')](_0x4a750c[_0x71a3('0x40')],{'$or':_[_0x71a3('0x2d')](_0x45d13d,function(_0x58b833){if(_0x58b833[_0x71a3('0x30')]!=='VIRTUAL'){var _0x3edeff={};_0x3edeff[_0x58b833[_0x71a3('0x2a')]]={'$like':'%'+_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]+'%'};return _0x3edeff;}})});}_0x4a750c=_[_0x71a3('0x3f')]({},_0x4a750c,_0x334db0[_0x71a3('0x41')]);var _0x468ca4={'where':_0x4a750c[_0x71a3('0x40')]};return db[_0x71a3('0x2e')][_0x71a3('0x1e')](_0x468ca4)['then'](function(_0xa49846){_0x216d84['count']=_0xa49846;if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x42')]){_0x4a750c[_0x71a3('0x43')]=[{'all':!![]}];}return db[_0x71a3('0x2e')]['findAll'](_0x4a750c);})[_0x71a3('0x24')](function(_0x4b4fde){_0x216d84['rows']=_0x4b4fde;return _0x216d84;})[_0x71a3('0x24')](respondWithFilteredResult(_0x23ae85,_0x4a750c))[_0x71a3('0x44')](handleError(_0x23ae85,null));};exports[_0x71a3('0x45')]=function(_0x1dc34b,_0x519242){var _0x248a04={'raw':!![],'where':{'id':_0x1dc34b[_0x71a3('0x46')]['id']}},_0x615c6f={};_0x615c6f[_0x71a3('0x32')]=_[_0x71a3('0x34')](db[_0x71a3('0x2e')][_0x71a3('0x2f')]);_0x615c6f[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x1dc34b[_0x71a3('0x33')]);_0x615c6f[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x615c6f[_0x71a3('0x32')],_0x615c6f[_0x71a3('0x33')]);_0x248a04[_0x71a3('0x37')]=_[_0x71a3('0x36')](_0x615c6f['model'],qs[_0x71a3('0x38')](_0x1dc34b[_0x71a3('0x33')]['fields']));_0x248a04[_0x71a3('0x37')]=_0x248a04[_0x71a3('0x37')][_0x71a3('0x47')]?_0x248a04[_0x71a3('0x37')]:_0x615c6f[_0x71a3('0x32')];if(_0x1dc34b['query']['includeAll']){_0x248a04[_0x71a3('0x43')]=[{'all':!![]}];}_0x248a04=_[_0x71a3('0x3f')]({},_0x248a04,_0x1dc34b['options']);return db[_0x71a3('0x2e')][_0x71a3('0x48')](_0x248a04)[_0x71a3('0x24')](handleEntityNotFound(_0x519242,null))[_0x71a3('0x24')](respondWithResult(_0x519242,null))[_0x71a3('0x44')](handleError(_0x519242,null));};exports[_0x71a3('0x49')]=function(_0x501a62,_0x1c9ba6){return db['ContactItemType'][_0x71a3('0x49')](_0x501a62[_0x71a3('0x4a')],{})[_0x71a3('0x24')](function(_0x2f3f19){var _0x32e313=_0x501a62['user'][_0x71a3('0x26')]({'plain':!![]});if(!_0x32e313)throw new Error(_0x71a3('0x4b'));if(_0x32e313[_0x71a3('0x4c')]==='user'){var _0x6c34=_0x2f3f19['get']({'plain':!![]});var _0x278e11=_0x71a3('0x4d');return db['UserProfileSection'][_0x71a3('0x48')]({'where':{'name':_0x278e11,'userProfileId':_0x32e313[_0x71a3('0x4e')]},'raw':!![]})[_0x71a3('0x24')](function(_0x384f38){if(_0x384f38&&_0x384f38[_0x71a3('0x4f')]===0x0){return db[_0x71a3('0x27')][_0x71a3('0x49')]({'name':_0x6c34['name'],'resourceId':_0x6c34['id'],'type':_0x384f38[_0x71a3('0x2a')],'sectionId':_0x384f38['id']},{})['then'](function(){return _0x2f3f19;});}else{return _0x2f3f19;}})[_0x71a3('0x44')](function(_0x480e90){logger[_0x71a3('0x28')](_0x71a3('0x50'),_0x480e90);throw _0x480e90;});}return _0x2f3f19;})[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,0xc9))[_0x71a3('0x44')](handleError(_0x1c9ba6,null));};exports['update']=function(_0x54b80f,_0x1e13ae){if(_0x54b80f[_0x71a3('0x4a')]['id']){delete _0x54b80f[_0x71a3('0x4a')]['id'];}return db[_0x71a3('0x2e')]['find']({'where':{'id':_0x54b80f['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1e13ae,null))[_0x71a3('0x24')](saveUpdates(_0x54b80f[_0x71a3('0x4a')],null))[_0x71a3('0x24')](respondWithResult(_0x1e13ae,null))[_0x71a3('0x44')](handleError(_0x1e13ae,null));};exports['destroy']=function(_0x421b6a,_0x3379cb){return db[_0x71a3('0x2e')][_0x71a3('0x48')]({'where':{'id':_0x421b6a[_0x71a3('0x46')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x3379cb,null))[_0x71a3('0x24')](db[_0x71a3('0x51')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x421b6a[_0x71a3('0x46')]['id']}}))[_0x71a3('0x24')](removeEntity(_0x3379cb,null))[_0x71a3('0x44')](handleError(_0x3379cb,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 8d1bdae..0953868 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 _0x3d20=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','define','tools_contact_item_types'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0x3d20,0x1e1));var _0x03d2=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x3d20[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x03d2('0x0'));var util=require(_0x03d2('0x1'));var logger=require(_0x03d2('0x2'))(_0x03d2('0x3'));var moment=require(_0x03d2('0x4'));var BPromise=require(_0x03d2('0x5'));var rp=require(_0x03d2('0x6'));var fs=require('fs');var path=require(_0x03d2('0x7'));var rimraf=require(_0x03d2('0x8'));var config=require(_0x03d2('0x9'));var attributes=require(_0x03d2('0xa'));module['exports']=function(_0x527ef5,_0x4b376a){return _0x527ef5[_0x03d2('0xb')]('ContactItemType',attributes,{'tableName':_0x03d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae29=['define','ContactItemType','tools_contact_item_types','lodash','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xae29,0xe4));var _0x9ae2=function(_0x22230b,_0x4652e3){_0x22230b=_0x22230b-0x0;var _0x22d304=_0xae29[_0x22230b];return _0x22d304;};'use strict';var _=require(_0x9ae2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9ae2('0x1'));var moment=require('moment');var BPromise=require(_0x9ae2('0x2'));var rp=require(_0x9ae2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ae2('0x4'));var attributes=require('./contactItemType.attributes');module[_0x9ae2('0x5')]=function(_0x52f818,_0x56f9a9){return _0x52f818[_0x9ae2('0x6')](_0x9ae2('0x7'),attributes,{'tableName':_0x9ae2('0x8'),'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 d7e4d3a..9133696 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 _0xd6d5=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','ContactItemType,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis'];(function(_0x51289c,_0x35570c){var _0x5c80a7=function(_0x3328f0){while(--_0x3328f0){_0x51289c['push'](_0x51289c['shift']());}};_0x5c80a7(++_0x35570c);}(_0xd6d5,0x171));var _0x5d6d=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0xd6d5[_0x124f88];return _0xed0e3b;};'use strict';var _=require(_0x5d6d('0x0'));var util=require(_0x5d6d('0x1'));var moment=require(_0x5d6d('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d6d('0x3'));var fs=require('fs');var Redis=require(_0x5d6d('0x4'));var db=require(_0x5d6d('0x5'))['db'];var utils=require(_0x5d6d('0x6'));var logger=require(_0x5d6d('0x7'))('rpc');var config=require(_0x5d6d('0x8'));var jayson=require(_0x5d6d('0x9'));var client=jayson[_0x5d6d('0xa')][_0x5d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x150e8b,_0x5270a0,_0x69d8ce){return new BPromise(function(_0x25e070,_0x5879cc){return client[_0x5d6d('0xc')](_0x150e8b,_0x69d8ce)[_0x5d6d('0xd')](function(_0xbb5875){logger[_0x5d6d('0xe')]('ContactItemType,\x20%s,\x20%s',_0x5270a0,_0x5d6d('0xf'));logger[_0x5d6d('0x10')](_0x5d6d('0x11'),_0x5270a0,_0x5d6d('0xf'),JSON[_0x5d6d('0x12')](_0xbb5875));if(_0xbb5875[_0x5d6d('0x13')]){if(_0xbb5875[_0x5d6d('0x13')]['code']===0x1f4){logger[_0x5d6d('0x13')](_0x5d6d('0x14'),_0x5270a0,_0xbb5875[_0x5d6d('0x13')][_0x5d6d('0x15')]);return _0x5879cc(_0xbb5875[_0x5d6d('0x13')][_0x5d6d('0x15')]);}logger[_0x5d6d('0x13')]('ContactItemType,\x20%s,\x20%s',_0x5270a0,_0xbb5875[_0x5d6d('0x13')][_0x5d6d('0x15')]);return _0x25e070(_0xbb5875[_0x5d6d('0x13')]['message']);}else{logger[_0x5d6d('0xe')](_0x5d6d('0x14'),_0x5270a0,_0x5d6d('0xf'));_0x25e070(_0xbb5875['result']['message']);}})['catch'](function(_0x5b7d75){logger[_0x5d6d('0x13')]('ContactItemType,\x20%s,\x20%s',_0x5270a0,_0x5b7d75);_0x5879cc(_0x5b7d75);});});} \ No newline at end of file +var _0xe07b=['stringify','error','code','message','request\x20sent','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s'];(function(_0x30ce3f,_0x34ad52){var _0x26bbfd=function(_0x31d2f1){while(--_0x31d2f1){_0x30ce3f['push'](_0x30ce3f['shift']());}};_0x26bbfd(++_0x34ad52);}(_0xe07b,0x181));var _0xbe07=function(_0x383615,_0x58b2a2){_0x383615=_0x383615-0x0;var _0x3de719=_0xe07b[_0x383615];return _0x3de719;};'use strict';var _=require(_0xbe07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe07('0x1'));var fs=require('fs');var Redis=require(_0xbe07('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe07('0x3'));var logger=require(_0xbe07('0x4'))(_0xbe07('0x5'));var config=require('../../config/environment');var jayson=require(_0xbe07('0x6'));var client=jayson[_0xbe07('0x7')][_0xbe07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dfcfd,_0x4d36cb,_0x4a0969){return new BPromise(function(_0xe2710,_0x35584b){return client[_0xbe07('0x9')](_0x2dfcfd,_0x4a0969)[_0xbe07('0xa')](function(_0x761c75){logger[_0xbe07('0xb')](_0xbe07('0xc'),_0x4d36cb,'request\x20sent');logger['debug'](_0xbe07('0xd'),_0x4d36cb,'request\x20sent',JSON[_0xbe07('0xe')](_0x761c75));if(_0x761c75[_0xbe07('0xf')]){if(_0x761c75[_0xbe07('0xf')][_0xbe07('0x10')]===0x1f4){logger[_0xbe07('0xf')](_0xbe07('0xc'),_0x4d36cb,_0x761c75[_0xbe07('0xf')][_0xbe07('0x11')]);return _0x35584b(_0x761c75[_0xbe07('0xf')]['message']);}logger['error'](_0xbe07('0xc'),_0x4d36cb,_0x761c75[_0xbe07('0xf')]['message']);return _0xe2710(_0x761c75[_0xbe07('0xf')]['message']);}else{logger[_0xbe07('0xb')](_0xbe07('0xc'),_0x4d36cb,_0xbe07('0x12'));_0xe2710(_0x761c75[_0xbe07('0x13')][_0xbe07('0x11')]);}})[_0xbe07('0x14')](function(_0x2d56d2){logger['error'](_0xbe07('0xc'),_0x4d36cb,_0x2d56d2);_0x35584b(_0x2d56d2);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 6fb6295..1e0410a 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 _0x867b=['get','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./contactItemType.controller'];(function(_0x115f64,_0x22532d){var _0x2ad8f6=function(_0x402875){while(--_0x402875){_0x115f64['push'](_0x115f64['shift']());}};_0x2ad8f6(++_0x22532d);}(_0x867b,0x1b3));var _0xb867=function(_0x4da777,_0x2a02f9){_0x4da777=_0x4da777-0x0;var _0x394a82=_0x867b[_0x4da777];return _0x394a82;};'use strict';var multer=require(_0xb867('0x0'));var util=require('util');var path=require(_0xb867('0x1'));var timeout=require(_0xb867('0x2'));var express=require(_0xb867('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb867('0x4'));var interaction=require(_0xb867('0x5'));var config=require('../../config/environment');var controller=require(_0xb867('0x6'));router[_0xb867('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb867('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb867('0x8')]('/',auth[_0xb867('0x9')](),controller[_0xb867('0xa')]);router[_0xb867('0xb')](_0xb867('0xc'),auth[_0xb867('0x9')](),controller[_0xb867('0xd')]);router[_0xb867('0xe')](_0xb867('0xc'),auth[_0xb867('0x9')](),controller[_0xb867('0xf')]);module[_0xb867('0x10')]=router; \ No newline at end of file +var _0x9fe7=['delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','isAuthenticated','post','create','put','/:id','update'];(function(_0x2cd57,_0x14549f){var _0x39d8a6=function(_0x269346){while(--_0x269346){_0x2cd57['push'](_0x2cd57['shift']());}};_0x39d8a6(++_0x14549f);}(_0x9fe7,0xd4));var _0x79fe=function(_0x131c46,_0x152662){_0x131c46=_0x131c46-0x0;var _0x1664bc=_0x9fe7[_0x131c46];return _0x1664bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x79fe('0x0'));var timeout=require('connect-timeout');var express=require(_0x79fe('0x1'));var router=express[_0x79fe('0x2')]();var fs_extra=require(_0x79fe('0x3'));var auth=require(_0x79fe('0x4'));var interaction=require(_0x79fe('0x5'));var config=require(_0x79fe('0x6'));var controller=require(_0x79fe('0x7'));router[_0x79fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x79fe('0x9')]);router[_0x79fe('0x8')]('/:id',auth[_0x79fe('0xa')](),controller['show']);router[_0x79fe('0xb')]('/',auth[_0x79fe('0xa')](),controller[_0x79fe('0xc')]);router[_0x79fe('0xd')](_0x79fe('0xe'),auth[_0x79fe('0xa')](),controller[_0x79fe('0xf')]);router[_0x79fe('0x10')]('/:id',auth[_0x79fe('0xa')](),controller[_0x79fe('0x11')]);module[_0x79fe('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index f358548..d72f7af 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x53ac65,_0x51cfb3){var _0x4c5122=function(_0x590bc4){while(--_0x590bc4){_0x53ac65['push'](_0x53ac65['shift']());}};_0x4c5122(++_0x51cfb3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x2a7a2b,_0x4790d9){var _0x3565ff=function(_0x36e6ae){while(--_0x36e6ae){_0x2a7a2b['push'](_0x2a7a2b['shift']());}};_0x3565ff(++_0x4790d9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 4e2f9e7..c4e2f90 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 _0x6036=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','include','merge','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','iframe','attrUrl','attrs','https://','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','voice','attrWhatsappAccounts','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x36021c,_0x5eeb8e){var _0x1c6ab4=function(_0x427f63){while(--_0x427f63){_0x36021c['push'](_0x36021c['shift']());}};_0x1c6ab4(++_0x5eeb8e);}(_0x6036,0x6f));var _0x6603=function(_0x62e54b,_0x35d2db){_0x62e54b=_0x62e54b-0x0;var _0x431f2e=_0x6036[_0x62e54b];return _0x431f2e;};'use strict';var emlformat=require(_0x6603('0x0'));var rimraf=require(_0x6603('0x1'));var zipdir=require(_0x6603('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6603('0x3'));var moment=require(_0x6603('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6603('0x5'));var util=require('util');var path=require(_0x6603('0x6'));var sox=require(_0x6603('0x7'));var csv=require(_0x6603('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6603('0x9'));var squel=require(_0x6603('0xa'));var crypto=require('crypto');var jsforce=require(_0x6603('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6603('0x8'));var querystring=require(_0x6603('0xc'));var Papa=require('papaparse');var Redis=require(_0x6603('0xd'));var authService=require(_0x6603('0xe'));var qs=require(_0x6603('0xf'));var as=require(_0x6603('0x10'));var hardwareService=require(_0x6603('0x11'));var logger=require(_0x6603('0x12'))(_0x6603('0x13'));var utils=require(_0x6603('0x14'));var config=require(_0x6603('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6603('0x16'))['db'];config['redis']=_[_0x6603('0x17')](config[_0x6603('0x18')],{'host':_0x6603('0x19'),'port':0x18eb});var socket=require(_0x6603('0x1a'))(new Redis(config[_0x6603('0x18')]));require(_0x6603('0x1b'))['register'](socket);function respondWithStatusCode(_0x553867,_0x3b66e4){_0x3b66e4=_0x3b66e4||0xcc;return function(_0x12cd88){if(_0x12cd88){return _0x553867[_0x6603('0x1c')](_0x3b66e4);}return _0x553867[_0x6603('0x1d')](_0x3b66e4)[_0x6603('0x1e')]();};}function respondWithResult(_0x3ff9e5,_0x28570d){_0x28570d=_0x28570d||0xc8;return function(_0x389b22){if(_0x389b22){return _0x3ff9e5['status'](_0x28570d)[_0x6603('0x1f')](_0x389b22);}};}function respondWithFilteredResult(_0x6eb60,_0x3ebb1d){return function(_0x8f0e29){if(_0x8f0e29){var _0xbe99c7=typeof _0x3ebb1d[_0x6603('0x20')]===_0x6603('0x21')&&typeof _0x3ebb1d[_0x6603('0x22')]===_0x6603('0x21');var _0x5e443d=_0x8f0e29['count'];var _0x30e3ff=_0xbe99c7?0x0:_0x3ebb1d[_0x6603('0x20')];var _0x1b976d=_0xbe99c7?_0x8f0e29[_0x6603('0x23')]:_0x3ebb1d[_0x6603('0x20')]+_0x3ebb1d['limit'];var _0x1a368c;if(_0x1b976d>=_0x5e443d){_0x1b976d=_0x5e443d;_0x1a368c=0xc8;}else{_0x1a368c=0xce;}_0x6eb60['status'](_0x1a368c);return _0x6eb60[_0x6603('0x24')](_0x6603('0x25'),_0x30e3ff+'-'+_0x1b976d+'/'+_0x5e443d)[_0x6603('0x1f')](_0x8f0e29);}return null;};}function patchUpdates(_0x1e73a6){return function(_0x14eea7){try{jsonpatch[_0x6603('0x26')](_0x14eea7,_0x1e73a6,!![]);}catch(_0xc70528){return BPromise[_0x6603('0x27')](_0xc70528);}return _0x14eea7['save']();};}function saveUpdates(_0x53e4f7,_0x488350){return function(_0x549749){if(_0x549749){return _0x549749[_0x6603('0x28')](_0x53e4f7)[_0x6603('0x29')](function(_0x1e074b){return _0x1e074b;});}return null;};}function removeEntity(_0x4d7ff9,_0x3d9685){return function(_0x565baf){if(_0x565baf){return _0x565baf[_0x6603('0x2a')]()['then'](function(){var _0x5c1b8d=_0x565baf[_0x6603('0x2b')]({'plain':!![]});var _0x5b800c=_0x6603('0x2c');return db[_0x6603('0x2d')]['destroy']({'where':{'type':_0x5b800c,'resourceId':_0x5c1b8d['id']}})[_0x6603('0x29')](function(){return _0x565baf;});})[_0x6603('0x29')](function(){_0x4d7ff9['status'](0xcc)[_0x6603('0x1e')]();});}};}function handleEntityNotFound(_0x693a7,_0x1c6fc6){return function(_0x50bba3){if(!_0x50bba3){_0x693a7[_0x6603('0x1c')](0x194);}return _0x50bba3;};}function handleError(_0x2aae65,_0x11870e){_0x11870e=_0x11870e||0x1f4;return function(_0xda420f){logger[_0x6603('0x2e')](_0xda420f[_0x6603('0x2f')]);if(_0xda420f[_0x6603('0x30')]){delete _0xda420f['name'];}_0x2aae65[_0x6603('0x1d')](_0x11870e)[_0x6603('0x31')](_0xda420f);};}exports[_0x6603('0x32')]=function(_0x473bb3,_0x1d7f1e){var _0x488aa5={},_0x54f9a2={},_0x52aebf={'count':0x0,'rows':[]};var _0x770b99=_[_0x6603('0x33')](db[_0x6603('0x34')]['rawAttributes'],function(_0x4d6f44){return{'name':_0x4d6f44[_0x6603('0x35')],'type':_0x4d6f44['type'][_0x6603('0x36')]};});_0x54f9a2[_0x6603('0x37')]=_[_0x6603('0x33')](_0x770b99,_0x6603('0x30'));_0x54f9a2['query']=_[_0x6603('0x38')](_0x473bb3['query']);_0x54f9a2[_0x6603('0x39')]=_[_0x6603('0x3a')](_0x54f9a2[_0x6603('0x37')],_0x54f9a2[_0x6603('0x3b')]);_0x488aa5['attributes']=_[_0x6603('0x3a')](_0x54f9a2['model'],qs[_0x6603('0x3c')](_0x473bb3[_0x6603('0x3b')]['fields']));_0x488aa5['attributes']=_0x488aa5[_0x6603('0x3d')][_0x6603('0x3e')]?_0x488aa5[_0x6603('0x3d')]:_0x54f9a2[_0x6603('0x37')];if(!_0x473bb3[_0x6603('0x3b')][_0x6603('0x3f')](_0x6603('0x40'))){_0x488aa5[_0x6603('0x22')]=qs['limit'](_0x473bb3[_0x6603('0x3b')][_0x6603('0x22')]);_0x488aa5[_0x6603('0x20')]=qs[_0x6603('0x20')](_0x473bb3[_0x6603('0x3b')][_0x6603('0x20')]);}_0x488aa5['order']=qs['sort'](_0x473bb3[_0x6603('0x3b')][_0x6603('0x41')]);_0x488aa5['where']=qs[_0x6603('0x39')](_[_0x6603('0x42')](_0x473bb3[_0x6603('0x3b')],_0x54f9a2[_0x6603('0x39')]),_0x770b99);if(_0x473bb3[_0x6603('0x3b')][_0x6603('0x43')]){_0x488aa5[_0x6603('0x44')]=_['merge'](_0x488aa5[_0x6603('0x44')],{'$or':_[_0x6603('0x33')](_0x770b99,function(_0x285f1d){if(_0x285f1d[_0x6603('0x45')]!==_0x6603('0x46')){var _0x330db9={};_0x330db9[_0x285f1d['name']]={'$like':'%'+_0x473bb3[_0x6603('0x3b')][_0x6603('0x43')]+'%'};return _0x330db9;}})});}_0x488aa5=_['merge']({},_0x488aa5,_0x473bb3[_0x6603('0x47')]);var _0x55a320={'where':_0x488aa5[_0x6603('0x44')]};return db[_0x6603('0x34')]['count'](_0x55a320)['then'](function(_0x4abf88){_0x52aebf[_0x6603('0x23')]=_0x4abf88;if(_0x473bb3[_0x6603('0x3b')][_0x6603('0x48')]){_0x488aa5['include']=[{'all':!![]}];}return db[_0x6603('0x34')][_0x6603('0x49')](_0x488aa5);})[_0x6603('0x29')](function(_0x4c5e19){_0x52aebf['rows']=_0x4c5e19;return _0x52aebf;})[_0x6603('0x29')](respondWithFilteredResult(_0x1d7f1e,_0x488aa5))[_0x6603('0x4a')](handleError(_0x1d7f1e,null));};exports['show']=function(_0x3cc75e,_0x490706){var _0x5efc4f={'raw':![],'where':{'id':_0x3cc75e[_0x6603('0x4b')]['id']}},_0x9db5b={};_0x9db5b['model']=_[_0x6603('0x38')](db['Dashboard'][_0x6603('0x4c')]);_0x9db5b[_0x6603('0x3b')]=_[_0x6603('0x38')](_0x3cc75e['query']);_0x9db5b['filters']=_[_0x6603('0x3a')](_0x9db5b[_0x6603('0x37')],_0x9db5b[_0x6603('0x3b')]);_0x5efc4f['attributes']=_['intersection'](_0x9db5b[_0x6603('0x37')],qs[_0x6603('0x3c')](_0x3cc75e['query'][_0x6603('0x3c')]));_0x5efc4f['attributes']=_0x5efc4f[_0x6603('0x3d')][_0x6603('0x3e')]?_0x5efc4f['attributes']:_0x9db5b[_0x6603('0x37')];if(_0x3cc75e['query'][_0x6603('0x48')]){_0x5efc4f[_0x6603('0x4d')]=[{'all':!![]}];}_0x5efc4f=_[_0x6603('0x4e')]({},_0x5efc4f,_0x3cc75e['options']);return db['Dashboard'][_0x6603('0x4f')](_0x5efc4f)[_0x6603('0x29')](handleEntityNotFound(_0x490706,null))[_0x6603('0x29')](respondWithResult(_0x490706,null))[_0x6603('0x4a')](handleError(_0x490706,null));};exports[_0x6603('0x50')]=function(_0x305cb7,_0x18a731){return db['Dashboard'][_0x6603('0x50')](_0x305cb7[_0x6603('0x51')],{})['then'](function(_0x51d499){var _0xd1ca80=_0x305cb7[_0x6603('0x52')][_0x6603('0x2b')]({'plain':!![]});if(!_0xd1ca80)throw new Error(_0x6603('0x53'));if(_0xd1ca80[_0x6603('0x54')]===_0x6603('0x52')){var _0x29fa38=_0x51d499[_0x6603('0x2b')]({'plain':!![]});var _0xc5aa91=_0x6603('0x2c');return db[_0x6603('0x55')][_0x6603('0x4f')]({'where':{'name':_0xc5aa91,'userProfileId':_0xd1ca80[_0x6603('0x56')]},'raw':!![]})[_0x6603('0x29')](function(_0x353178){if(_0x353178&&_0x353178[_0x6603('0x57')]===0x0){return db[_0x6603('0x2d')][_0x6603('0x50')]({'name':_0x29fa38[_0x6603('0x30')],'resourceId':_0x29fa38['id'],'type':_0x353178['name'],'sectionId':_0x353178['id']},{})[_0x6603('0x29')](function(){return _0x51d499;});}else{return _0x51d499;}})['catch'](function(_0x5664b4){logger[_0x6603('0x2e')](_0x6603('0x58'),_0x5664b4);throw _0x5664b4;});}return _0x51d499;})[_0x6603('0x29')](respondWithResult(_0x18a731,0xc9))[_0x6603('0x4a')](handleError(_0x18a731,null));};exports[_0x6603('0x59')]=function(_0x3ac8c1,_0x2f479b){var _0x1d1c4a={'where':{'id':_0x3ac8c1[_0x6603('0x4b')]['id']}},_0x2abb6a={};_0x2abb6a[_0x6603('0x37')]=_[_0x6603('0x38')](db[_0x6603('0x34')][_0x6603('0x4c')]);_0x1d1c4a[_0x6603('0x3d')]=_[_0x6603('0x3a')](_0x2abb6a[_0x6603('0x37')],qs['fields'](_0x3ac8c1[_0x6603('0x3b')][_0x6603('0x3c')]));_0x1d1c4a['attributes']=_0x1d1c4a[_0x6603('0x3d')][_0x6603('0x3e')]?_0x1d1c4a[_0x6603('0x3d')]:_0x2abb6a['model'];if(_0x3ac8c1[_0x6603('0x3b')][_0x6603('0x48')]){_0x1d1c4a[_0x6603('0x4d')]=[{'all':!![]}];}_0x1d1c4a=_[_0x6603('0x4e')]({},_0x1d1c4a,_0x3ac8c1[_0x6603('0x47')]);return db[_0x6603('0x34')]['find'](_0x1d1c4a)[_0x6603('0x29')](handleEntityNotFound(_0x2f479b,null))[_0x6603('0x29')](function(_0x460f3d){if(_0x460f3d){var _0x4be74f=_0x460f3d[_0x6603('0x2b')]({'plain':!![]});_0x4be74f=qs[_0x6603('0x5a')](_0x4be74f,['id',_0x6603('0x5b'),_0x6603('0x5c')]);_0x3ac8c1[_0x6603('0x51')]=_['omit'](_0x3ac8c1['body'],['id',_0x6603('0x5b'),_0x6603('0x5c')]);return db[_0x6603('0x34')]['create'](_[_0x6603('0x4e')](_0x4be74f,_0x3ac8c1[_0x6603('0x51')]),{'include':_0x3ac8c1[_0x6603('0x3b')][_0x6603('0x48')]?[{'all':!![]}]:undefined})[_0x6603('0x29')](function(_0x4349c7){var _0xd32def=_0x3ac8c1[_0x6603('0x52')][_0x6603('0x2b')]({'plain':!![]});if(!_0xd32def)throw new Error(_0x6603('0x53'));if(_0xd32def['role']===_0x6603('0x52')){var _0x5a54c6=_0x4349c7['get']({'plain':!![]});var _0x466e09='CustomDashboards';return db[_0x6603('0x55')]['find']({'where':{'name':_0x466e09,'userProfileId':_0xd32def[_0x6603('0x56')]},'raw':!![]})[_0x6603('0x29')](function(_0x685618){if(_0x685618&&_0x685618[_0x6603('0x57')]===0x0){return db[_0x6603('0x2d')]['create']({'name':_0x5a54c6[_0x6603('0x30')],'resourceId':_0x5a54c6['id'],'type':_0x685618[_0x6603('0x30')],'sectionId':_0x685618['id']},{})[_0x6603('0x29')](function(){return _0x4349c7;});}else{return _0x4349c7;}})[_0x6603('0x4a')](function(_0x29ec8a){logger[_0x6603('0x2e')](_0x6603('0x58'),_0x29ec8a);throw _0x29ec8a;});}return _0x4349c7;});}})[_0x6603('0x29')](respondWithResult(_0x2f479b,0xc9))['catch'](handleError(_0x2f479b,null));};exports[_0x6603('0x28')]=function(_0xa3ee53,_0x3b98f5){if(_0xa3ee53['body']['id']){delete _0xa3ee53[_0x6603('0x51')]['id'];}return db[_0x6603('0x34')][_0x6603('0x4f')]({'where':{'id':_0xa3ee53['params']['id']}})[_0x6603('0x29')](handleEntityNotFound(_0x3b98f5,null))[_0x6603('0x29')](saveUpdates(_0xa3ee53[_0x6603('0x51')],null))[_0x6603('0x29')](respondWithResult(_0x3b98f5,null))[_0x6603('0x4a')](handleError(_0x3b98f5,null));};exports[_0x6603('0x2a')]=function(_0x28effb,_0x33c2ac){return db['Dashboard'][_0x6603('0x4f')]({'where':{'id':_0x28effb[_0x6603('0x4b')]['id']}})[_0x6603('0x29')](handleEntityNotFound(_0x33c2ac,null))['then'](removeEntity(_0x33c2ac,null))[_0x6603('0x4a')](handleError(_0x33c2ac,null));};function widgetAttributes(_0xbb2182){try{switch(_0xbb2182[_0x6603('0x45')]){case _0x6603('0x5d'):return[{'name':_0x6603('0x5e'),'value':_0xbb2182[_0x6603('0x5e')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x0]?_0xbb2182[_0x6603('0x5f')][0x0]['value']:undefined)||_0x6603('0x60')}];case'custom':return[{'name':'attrPath','value':_0xbb2182['attrPath']||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x0]?_0xbb2182[_0x6603('0x5f')][0x0][_0x6603('0x61')]:undefined)||''}];case _0x6603('0x62'):return[{'name':'attrHourFormat','value':_0xbb2182[_0x6603('0x63')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x0]?_0xbb2182[_0x6603('0x5f')][0x0][_0x6603('0x61')]:undefined)||_0x6603('0x64')},{'name':_0x6603('0x65'),'value':_0xbb2182[_0x6603('0x65')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x1]?_0xbb2182[_0x6603('0x5f')][0x1]['value']:undefined)||_0x6603('0x66')},{'name':_0x6603('0x67'),'value':_0xbb2182['attrFontSize']||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182['attrs'][0x2]?_0xbb2182[_0x6603('0x5f')][0x2][_0x6603('0x61')]:undefined)||0xc}];case _0x6603('0x68'):return[{'name':'attrMetric','value':_0xbb2182[_0x6603('0x69')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x0]?_0xbb2182[_0x6603('0x5f')][0x0][_0x6603('0x61')]:undefined)||_0x6603('0x6a')},{'name':'attrVoiceQueues','value':_0xbb2182[_0x6603('0x6b')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x1]?_0xbb2182[_0x6603('0x5f')][0x1][_0x6603('0x61')]:undefined)||[]},{'name':_0x6603('0x67'),'value':_0xbb2182[_0x6603('0x67')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x2]?_0xbb2182[_0x6603('0x5f')][0x2]['value']:undefined)||0x14},{'name':_0x6603('0x6c'),'value':_0xbb2182['attrChannel']||(_0xbb2182['attrs']&&_0xbb2182['attrs'][0x3]?_0xbb2182['attrs'][0x3][_0x6603('0x61')]:undefined)||'voice'},{'name':_0x6603('0x6d'),'value':_0xbb2182['attrEmailAccounts']||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x4]?_0xbb2182['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0xbb2182[_0x6603('0x6e')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x5]?_0xbb2182[_0x6603('0x5f')][0x5][_0x6603('0x61')]:undefined)||''},{'name':_0x6603('0x6f'),'value':_0xbb2182[_0x6603('0x6f')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182['attrs'][0x6]?_0xbb2182['attrs'][0x6]['value']:undefined)||''},{'name':_0x6603('0x70'),'value':_0xbb2182[_0x6603('0x70')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x7]?_0xbb2182[_0x6603('0x5f')][0x7][_0x6603('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xbb2182['attrWhatsappAccounts']||(_0xbb2182['attrs']&&_0xbb2182[_0x6603('0x5f')][0x8]?_0xbb2182[_0x6603('0x5f')][0x8][_0x6603('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0xbb2182[_0x6603('0x71')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x9]?_0xbb2182['attrs'][0x9][_0x6603('0x61')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x6603('0x72'),'value':_0xbb2182[_0x6603('0x72')]||(_0xbb2182['attrs']&&_0xbb2182[_0x6603('0x5f')][0x0]?_0xbb2182[_0x6603('0x5f')][0x0]['value']:undefined)||_0x6603('0x6a')},{'name':_0x6603('0x73'),'value':_0xbb2182[_0x6603('0x73')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x1]?_0xbb2182[_0x6603('0x5f')][0x1][_0x6603('0x61')]:undefined)||null},{'name':_0x6603('0x74'),'value':_0xbb2182[_0x6603('0x74')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x2]?_0xbb2182[_0x6603('0x5f')][0x2][_0x6603('0x61')]:undefined)||null},{'name':_0x6603('0x6b'),'value':_0xbb2182['attrVoiceQueues']||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x3]?_0xbb2182[_0x6603('0x5f')][0x3][_0x6603('0x61')]:undefined)||[]},{'name':_0x6603('0x6c'),'value':_0xbb2182[_0x6603('0x6c')]||(_0xbb2182['attrs']&&_0xbb2182[_0x6603('0x5f')][0x4]?_0xbb2182[_0x6603('0x5f')][0x4]['value']:undefined)||_0x6603('0x75')},{'name':_0x6603('0x6d'),'value':_0xbb2182[_0x6603('0x6d')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x5]?_0xbb2182['attrs'][0x5]['value']:undefined)||''},{'name':_0x6603('0x6e'),'value':_0xbb2182[_0x6603('0x6e')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x6]?_0xbb2182['attrs'][0x6][_0x6603('0x61')]:undefined)||''},{'name':_0x6603('0x6f'),'value':_0xbb2182[_0x6603('0x6f')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x7]?_0xbb2182['attrs'][0x7][_0x6603('0x61')]:undefined)||''},{'name':_0x6603('0x70'),'value':_0xbb2182[_0x6603('0x70')]||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x8]?_0xbb2182[_0x6603('0x5f')][0x8]['value']:undefined)||''},{'name':_0x6603('0x76'),'value':_0xbb2182['attrWhatsappAccounts']||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182['attrs'][0x9]?_0xbb2182[_0x6603('0x5f')][0x9][_0x6603('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0xbb2182['attrChatWebsites']||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0xa]?_0xbb2182[_0x6603('0x5f')][0xa][_0x6603('0x61')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0xbb2182[_0x6603('0x77')]||(_0xbb2182['attrs']&&_0xbb2182[_0x6603('0x5f')][0x0]?_0xbb2182['attrs'][0x0][_0x6603('0x45')]:undefined)||null,'value':_0xbb2182[_0x6603('0x78')]||(_0xbb2182['attrs']&&_0xbb2182['attrs'][0x0]?_0xbb2182[_0x6603('0x5f')][0x0][_0x6603('0x61')]:undefined)||null},{'name':_0x6603('0x79'),'value':_0xbb2182['attrRefresh']||(_0xbb2182[_0x6603('0x5f')]&&_0xbb2182[_0x6603('0x5f')][0x1]?_0xbb2182['attrs'][0x1][_0x6603('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x3108e1){logger[_0x6603('0x2e')](_0x6603('0x7a'),JSON['stringify'](_0x3108e1));return[];}}exports[_0x6603('0x7b')]=function(_0x376331,_0x9d256e,_0x459f90){if(_0x376331[_0x6603('0x51')]['id']){delete _0x376331['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x376331[_0x6603('0x4b')]['id']}})[_0x6603('0x29')](handleEntityNotFound(_0x9d256e,null))[_0x6603('0x29')](function(_0x55bb36){if(_0x55bb36){_0x376331[_0x6603('0x51')][_0x6603('0x7c')]=_0x55bb36['id'];_0x376331[_0x6603('0x51')][_0x6603('0x5f')]=widgetAttributes(_0x376331[_0x6603('0x51')]);return db[_0x6603('0x7d')]['create'](_0x376331[_0x6603('0x51')]);}})[_0x6603('0x29')](respondWithResult(_0x9d256e,null))['catch'](handleError(_0x9d256e,null));};exports[_0x6603('0x7e')]=function(_0x7e7a72,_0x2dc2d6,_0x287dc6){var _0x55c189={};var _0x4d06b3={};var _0x451f6f;var _0x486979;return db['Dashboard'][_0x6603('0x7f')]({'where':{'id':_0x7e7a72['params']['id']}})[_0x6603('0x29')](handleEntityNotFound(_0x2dc2d6,null))[_0x6603('0x29')](function(_0x231d08){if(_0x231d08){_0x451f6f=_0x231d08;_0x4d06b3['model']=_[_0x6603('0x38')](db[_0x6603('0x7d')][_0x6603('0x4c')]);_0x4d06b3[_0x6603('0x3b')]=_['keys'](_0x7e7a72[_0x6603('0x3b')]);_0x4d06b3[_0x6603('0x39')]=_['intersection'](_0x4d06b3[_0x6603('0x37')],_0x4d06b3[_0x6603('0x3b')]);_0x55c189[_0x6603('0x3d')]=_['intersection'](_0x4d06b3[_0x6603('0x37')],qs['fields'](_0x7e7a72['query'][_0x6603('0x3c')]));_0x55c189[_0x6603('0x3d')]=_0x55c189[_0x6603('0x3d')][_0x6603('0x3e')]?_0x55c189[_0x6603('0x3d')]:_0x4d06b3[_0x6603('0x37')];_0x55c189[_0x6603('0x80')]=qs[_0x6603('0x41')](_0x7e7a72[_0x6603('0x3b')][_0x6603('0x41')]);_0x55c189[_0x6603('0x44')]=qs['filters'](_[_0x6603('0x42')](_0x7e7a72[_0x6603('0x3b')],_0x4d06b3[_0x6603('0x39')]));if(_0x7e7a72[_0x6603('0x3b')][_0x6603('0x43')]){_0x55c189[_0x6603('0x44')]=_[_0x6603('0x4e')](_0x55c189['where'],{'$or':_[_0x6603('0x33')](_0x55c189[_0x6603('0x3d')],function(_0x210f44){var _0x122a5d={};_0x122a5d[_0x210f44]={'$like':'%'+_0x7e7a72['query'][_0x6603('0x43')]+'%'};return _0x122a5d;})});}_0x55c189=_[_0x6603('0x4e')]({},_0x55c189,_0x7e7a72[_0x6603('0x47')]);return _0x451f6f[_0x6603('0x7e')](_0x55c189);}})[_0x6603('0x29')](function(_0x399d9b){if(_0x399d9b){_0x486979=_0x399d9b['length'];if(!_0x7e7a72[_0x6603('0x3b')]['hasOwnProperty'](_0x6603('0x40'))){_0x55c189['limit']=qs[_0x6603('0x22')](_0x7e7a72['query'][_0x6603('0x22')]);_0x55c189[_0x6603('0x20')]=qs[_0x6603('0x20')](_0x7e7a72[_0x6603('0x3b')][_0x6603('0x20')]);}return _0x451f6f[_0x6603('0x7e')](_0x55c189);}})['then'](function(_0x2cef1a){if(_0x2cef1a){return _0x2cef1a?{'count':_0x486979,'rows':_0x2cef1a}:null;}})[_0x6603('0x29')](respondWithResult(_0x2dc2d6,null))[_0x6603('0x4a')](handleError(_0x2dc2d6,null));}; \ No newline at end of file +var _0x20b8=['attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrOpenchannelAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','get','CustomDashboards','destroy','stack','name','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','findAll','rows','catch','show','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','attrUrl','attrs','value','https://','attrPath','attrHourFormat','attrTimezone'];(function(_0x488995,_0x17e672){var _0x5c07fd=function(_0x32bf4b){while(--_0x32bf4b){_0x488995['push'](_0x488995['shift']());}};_0x5c07fd(++_0x17e672);}(_0x20b8,0x9b));var _0x820b=function(_0x350dc7,_0x100ced){_0x350dc7=_0x350dc7-0x0;var _0x1f753e=_0x20b8[_0x350dc7];return _0x1f753e;};'use strict';var emlformat=require(_0x820b('0x0'));var rimraf=require(_0x820b('0x1'));var zipdir=require(_0x820b('0x2'));var jsonpatch=require(_0x820b('0x3'));var rp=require(_0x820b('0x4'));var moment=require(_0x820b('0x5'));var BPromise=require(_0x820b('0x6'));var Mustache=require(_0x820b('0x7'));var util=require(_0x820b('0x8'));var path=require(_0x820b('0x9'));var sox=require(_0x820b('0xa'));var csv=require(_0x820b('0xb'));var ejs=require(_0x820b('0xc'));var fs=require('fs');var fs_extra=require(_0x820b('0xd'));var _=require(_0x820b('0xe'));var squel=require('squel');var crypto=require(_0x820b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x820b('0x10'));var toCsv=require(_0x820b('0xb'));var querystring=require('querystring');var Papa=require(_0x820b('0x11'));var Redis=require(_0x820b('0x12'));var authService=require(_0x820b('0x13'));var qs=require(_0x820b('0x14'));var as=require(_0x820b('0x15'));var hardwareService=require(_0x820b('0x16'));var logger=require(_0x820b('0x17'))(_0x820b('0x18'));var utils=require(_0x820b('0x19'));var config=require(_0x820b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x820b('0x1b'))['db'];config[_0x820b('0x1c')]=_[_0x820b('0x1d')](config[_0x820b('0x1c')],{'host':_0x820b('0x1e'),'port':0x18eb});var socket=require(_0x820b('0x1f'))(new Redis(config[_0x820b('0x1c')]));require('./dashboard.socket')[_0x820b('0x20')](socket);function respondWithStatusCode(_0x542263,_0x3603b0){_0x3603b0=_0x3603b0||0xcc;return function(_0x3dc3ff){if(_0x3dc3ff){return _0x542263[_0x820b('0x21')](_0x3603b0);}return _0x542263[_0x820b('0x22')](_0x3603b0)[_0x820b('0x23')]();};}function respondWithResult(_0x1d0ed7,_0x2773f0){_0x2773f0=_0x2773f0||0xc8;return function(_0x1e6781){if(_0x1e6781){return _0x1d0ed7[_0x820b('0x22')](_0x2773f0)[_0x820b('0x24')](_0x1e6781);}};}function respondWithFilteredResult(_0x30427d,_0x16504c){return function(_0x8c2efc){if(_0x8c2efc){var _0x1319b6=typeof _0x16504c['offset']==='undefined'&&typeof _0x16504c['limit']===_0x820b('0x25');var _0x51b543=_0x8c2efc[_0x820b('0x26')];var _0x194953=_0x1319b6?0x0:_0x16504c[_0x820b('0x27')];var _0x59d815=_0x1319b6?_0x8c2efc[_0x820b('0x26')]:_0x16504c['offset']+_0x16504c[_0x820b('0x28')];var _0x54362f;if(_0x59d815>=_0x51b543){_0x59d815=_0x51b543;_0x54362f=0xc8;}else{_0x54362f=0xce;}_0x30427d[_0x820b('0x22')](_0x54362f);return _0x30427d[_0x820b('0x29')](_0x820b('0x2a'),_0x194953+'-'+_0x59d815+'/'+_0x51b543)[_0x820b('0x24')](_0x8c2efc);}return null;};}function patchUpdates(_0x3b3d3b){return function(_0x457fd5){try{jsonpatch['apply'](_0x457fd5,_0x3b3d3b,!![]);}catch(_0x52a203){return BPromise[_0x820b('0x2b')](_0x52a203);}return _0x457fd5['save']();};}function saveUpdates(_0x342542,_0x3ac2a7){return function(_0x1a8a2f){if(_0x1a8a2f){return _0x1a8a2f[_0x820b('0x2c')](_0x342542)[_0x820b('0x2d')](function(_0x549b29){return _0x549b29;});}return null;};}function removeEntity(_0x1696cf,_0x1fe953){return function(_0x419eeb){if(_0x419eeb){return _0x419eeb['destroy']()[_0x820b('0x2d')](function(){var _0x1ffec7=_0x419eeb[_0x820b('0x2e')]({'plain':!![]});var _0x1bed5d=_0x820b('0x2f');return db['UserProfileResource'][_0x820b('0x30')]({'where':{'type':_0x1bed5d,'resourceId':_0x1ffec7['id']}})[_0x820b('0x2d')](function(){return _0x419eeb;});})[_0x820b('0x2d')](function(){_0x1696cf[_0x820b('0x22')](0xcc)[_0x820b('0x23')]();});}};}function handleEntityNotFound(_0x46f948,_0x26a5b3){return function(_0x5265a7){if(!_0x5265a7){_0x46f948[_0x820b('0x21')](0x194);}return _0x5265a7;};}function handleError(_0x3dfce9,_0x579996){_0x579996=_0x579996||0x1f4;return function(_0xf29200){logger['error'](_0xf29200[_0x820b('0x31')]);if(_0xf29200[_0x820b('0x32')]){delete _0xf29200[_0x820b('0x32')];}_0x3dfce9[_0x820b('0x22')](_0x579996)['send'](_0xf29200);};}exports['index']=function(_0x5ebc9d,_0x3b56ec){var _0x559a98={},_0x10cae3={},_0x39b150={'count':0x0,'rows':[]};var _0x339471=_[_0x820b('0x33')](db[_0x820b('0x34')][_0x820b('0x35')],function(_0x457f91){return{'name':_0x457f91[_0x820b('0x36')],'type':_0x457f91[_0x820b('0x37')][_0x820b('0x38')]};});_0x10cae3[_0x820b('0x39')]=_[_0x820b('0x33')](_0x339471,_0x820b('0x32'));_0x10cae3[_0x820b('0x3a')]=_[_0x820b('0x3b')](_0x5ebc9d[_0x820b('0x3a')]);_0x10cae3[_0x820b('0x3c')]=_['intersection'](_0x10cae3['model'],_0x10cae3[_0x820b('0x3a')]);_0x559a98[_0x820b('0x3d')]=_[_0x820b('0x3e')](_0x10cae3[_0x820b('0x39')],qs[_0x820b('0x3f')](_0x5ebc9d[_0x820b('0x3a')][_0x820b('0x3f')]));_0x559a98[_0x820b('0x3d')]=_0x559a98[_0x820b('0x3d')][_0x820b('0x40')]?_0x559a98[_0x820b('0x3d')]:_0x10cae3['model'];if(!_0x5ebc9d[_0x820b('0x3a')][_0x820b('0x41')](_0x820b('0x42'))){_0x559a98[_0x820b('0x28')]=qs[_0x820b('0x28')](_0x5ebc9d[_0x820b('0x3a')][_0x820b('0x28')]);_0x559a98[_0x820b('0x27')]=qs[_0x820b('0x27')](_0x5ebc9d['query']['offset']);}_0x559a98[_0x820b('0x43')]=qs[_0x820b('0x44')](_0x5ebc9d[_0x820b('0x3a')]['sort']);_0x559a98['where']=qs[_0x820b('0x3c')](_[_0x820b('0x45')](_0x5ebc9d[_0x820b('0x3a')],_0x10cae3['filters']),_0x339471);if(_0x5ebc9d['query']['filter']){_0x559a98['where']=_['merge'](_0x559a98[_0x820b('0x46')],{'$or':_[_0x820b('0x33')](_0x339471,function(_0x424367){if(_0x424367[_0x820b('0x37')]!=='VIRTUAL'){var _0x18e190={};_0x18e190[_0x424367[_0x820b('0x32')]]={'$like':'%'+_0x5ebc9d['query'][_0x820b('0x47')]+'%'};return _0x18e190;}})});}_0x559a98=_[_0x820b('0x48')]({},_0x559a98,_0x5ebc9d[_0x820b('0x49')]);var _0x11a6d8={'where':_0x559a98[_0x820b('0x46')]};return db['Dashboard']['count'](_0x11a6d8)['then'](function(_0x1ecc71){_0x39b150[_0x820b('0x26')]=_0x1ecc71;if(_0x5ebc9d[_0x820b('0x3a')]['includeAll']){_0x559a98['include']=[{'all':!![]}];}return db[_0x820b('0x34')][_0x820b('0x4a')](_0x559a98);})[_0x820b('0x2d')](function(_0x58f7c8){_0x39b150[_0x820b('0x4b')]=_0x58f7c8;return _0x39b150;})['then'](respondWithFilteredResult(_0x3b56ec,_0x559a98))[_0x820b('0x4c')](handleError(_0x3b56ec,null));};exports[_0x820b('0x4d')]=function(_0x5128ce,_0x278031){var _0xe5c611={'raw':![],'where':{'id':_0x5128ce['params']['id']}},_0x5a5460={};_0x5a5460[_0x820b('0x39')]=_[_0x820b('0x3b')](db[_0x820b('0x34')]['rawAttributes']);_0x5a5460[_0x820b('0x3a')]=_['keys'](_0x5128ce[_0x820b('0x3a')]);_0x5a5460[_0x820b('0x3c')]=_[_0x820b('0x3e')](_0x5a5460['model'],_0x5a5460[_0x820b('0x3a')]);_0xe5c611[_0x820b('0x3d')]=_[_0x820b('0x3e')](_0x5a5460['model'],qs['fields'](_0x5128ce[_0x820b('0x3a')][_0x820b('0x3f')]));_0xe5c611[_0x820b('0x3d')]=_0xe5c611[_0x820b('0x3d')][_0x820b('0x40')]?_0xe5c611[_0x820b('0x3d')]:_0x5a5460['model'];if(_0x5128ce[_0x820b('0x3a')][_0x820b('0x4e')]){_0xe5c611[_0x820b('0x4f')]=[{'all':!![]}];}_0xe5c611=_[_0x820b('0x48')]({},_0xe5c611,_0x5128ce['options']);return db[_0x820b('0x34')]['find'](_0xe5c611)[_0x820b('0x2d')](handleEntityNotFound(_0x278031,null))[_0x820b('0x2d')](respondWithResult(_0x278031,null))[_0x820b('0x4c')](handleError(_0x278031,null));};exports['create']=function(_0x310cfc,_0x1a14b3){return db[_0x820b('0x34')][_0x820b('0x50')](_0x310cfc[_0x820b('0x51')],{})['then'](function(_0x22605f){var _0x50de38=_0x310cfc[_0x820b('0x52')][_0x820b('0x2e')]({'plain':!![]});if(!_0x50de38)throw new Error(_0x820b('0x53'));if(_0x50de38[_0x820b('0x54')]===_0x820b('0x52')){var _0x33391b=_0x22605f['get']({'plain':!![]});var _0x2aae74=_0x820b('0x2f');return db[_0x820b('0x55')][_0x820b('0x56')]({'where':{'name':_0x2aae74,'userProfileId':_0x50de38[_0x820b('0x57')]},'raw':!![]})[_0x820b('0x2d')](function(_0x40b9af){if(_0x40b9af&&_0x40b9af[_0x820b('0x58')]===0x0){return db[_0x820b('0x59')][_0x820b('0x50')]({'name':_0x33391b[_0x820b('0x32')],'resourceId':_0x33391b['id'],'type':_0x40b9af[_0x820b('0x32')],'sectionId':_0x40b9af['id']},{})[_0x820b('0x2d')](function(){return _0x22605f;});}else{return _0x22605f;}})[_0x820b('0x4c')](function(_0xedd7b2){logger[_0x820b('0x5a')](_0x820b('0x5b'),_0xedd7b2);throw _0xedd7b2;});}return _0x22605f;})[_0x820b('0x2d')](respondWithResult(_0x1a14b3,0xc9))[_0x820b('0x4c')](handleError(_0x1a14b3,null));};exports[_0x820b('0x5c')]=function(_0x5f7008,_0x546d10){var _0x4c9697={'where':{'id':_0x5f7008[_0x820b('0x5d')]['id']}},_0x4bc922={};_0x4bc922[_0x820b('0x39')]=_[_0x820b('0x3b')](db[_0x820b('0x34')][_0x820b('0x35')]);_0x4c9697[_0x820b('0x3d')]=_[_0x820b('0x3e')](_0x4bc922[_0x820b('0x39')],qs[_0x820b('0x3f')](_0x5f7008['query'][_0x820b('0x3f')]));_0x4c9697[_0x820b('0x3d')]=_0x4c9697[_0x820b('0x3d')][_0x820b('0x40')]?_0x4c9697[_0x820b('0x3d')]:_0x4bc922[_0x820b('0x39')];if(_0x5f7008[_0x820b('0x3a')][_0x820b('0x4e')]){_0x4c9697['include']=[{'all':!![]}];}_0x4c9697=_[_0x820b('0x48')]({},_0x4c9697,_0x5f7008[_0x820b('0x49')]);return db[_0x820b('0x34')][_0x820b('0x56')](_0x4c9697)[_0x820b('0x2d')](handleEntityNotFound(_0x546d10,null))[_0x820b('0x2d')](function(_0x3818ec){if(_0x3818ec){var _0x45893a=_0x3818ec[_0x820b('0x2e')]({'plain':!![]});_0x45893a=qs['omit'](_0x45893a,['id',_0x820b('0x5e'),'updatedAt']);_0x5f7008[_0x820b('0x51')]=_['omit'](_0x5f7008[_0x820b('0x51')],['id','createdAt',_0x820b('0x5f')]);return db[_0x820b('0x34')]['create'](_[_0x820b('0x48')](_0x45893a,_0x5f7008[_0x820b('0x51')]),{'include':_0x5f7008[_0x820b('0x3a')][_0x820b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x292c90){var _0x47f647=_0x5f7008[_0x820b('0x52')]['get']({'plain':!![]});if(!_0x47f647)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47f647[_0x820b('0x54')]===_0x820b('0x52')){var _0x31f5fa=_0x292c90[_0x820b('0x2e')]({'plain':!![]});var _0x200072=_0x820b('0x2f');return db[_0x820b('0x55')][_0x820b('0x56')]({'where':{'name':_0x200072,'userProfileId':_0x47f647[_0x820b('0x57')]},'raw':!![]})['then'](function(_0x135126){if(_0x135126&&_0x135126['autoAssociation']===0x0){return db[_0x820b('0x59')][_0x820b('0x50')]({'name':_0x31f5fa[_0x820b('0x32')],'resourceId':_0x31f5fa['id'],'type':_0x135126[_0x820b('0x32')],'sectionId':_0x135126['id']},{})[_0x820b('0x2d')](function(){return _0x292c90;});}else{return _0x292c90;}})['catch'](function(_0x456246){logger[_0x820b('0x5a')](_0x820b('0x5b'),_0x456246);throw _0x456246;});}return _0x292c90;});}})[_0x820b('0x2d')](respondWithResult(_0x546d10,0xc9))[_0x820b('0x4c')](handleError(_0x546d10,null));};exports['update']=function(_0x358c28,_0x7adf55){if(_0x358c28[_0x820b('0x51')]['id']){delete _0x358c28[_0x820b('0x51')]['id'];}return db[_0x820b('0x34')][_0x820b('0x56')]({'where':{'id':_0x358c28[_0x820b('0x5d')]['id']}})[_0x820b('0x2d')](handleEntityNotFound(_0x7adf55,null))[_0x820b('0x2d')](saveUpdates(_0x358c28[_0x820b('0x51')],null))[_0x820b('0x2d')](respondWithResult(_0x7adf55,null))[_0x820b('0x4c')](handleError(_0x7adf55,null));};exports['destroy']=function(_0x3b3050,_0x57b06b){return db[_0x820b('0x34')][_0x820b('0x56')]({'where':{'id':_0x3b3050['params']['id']}})[_0x820b('0x2d')](handleEntityNotFound(_0x57b06b,null))[_0x820b('0x2d')](removeEntity(_0x57b06b,null))[_0x820b('0x4c')](handleError(_0x57b06b,null));};function widgetAttributes(_0x1f22ce){try{switch(_0x1f22ce[_0x820b('0x37')]){case'iframe':return[{'name':_0x820b('0x60'),'value':_0x1f22ce[_0x820b('0x60')]||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x0]?_0x1f22ce[_0x820b('0x61')][0x0][_0x820b('0x62')]:undefined)||_0x820b('0x63')}];case'custom':return[{'name':_0x820b('0x64'),'value':_0x1f22ce['attrPath']||(_0x1f22ce['attrs']&&_0x1f22ce['attrs'][0x0]?_0x1f22ce[_0x820b('0x61')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x820b('0x65'),'value':_0x1f22ce[_0x820b('0x65')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x0]?_0x1f22ce['attrs'][0x0][_0x820b('0x62')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x1f22ce[_0x820b('0x66')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x1]?_0x1f22ce[_0x820b('0x61')][0x1]['value']:undefined)||'0.00'},{'name':_0x820b('0x67'),'value':_0x1f22ce['attrFontSize']||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x2]?_0x1f22ce[_0x820b('0x61')][0x2][_0x820b('0x62')]:undefined)||0xc}];case _0x820b('0x68'):return[{'name':_0x820b('0x69'),'value':_0x1f22ce[_0x820b('0x69')]||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x0]?_0x1f22ce['attrs'][0x0][_0x820b('0x62')]:undefined)||_0x820b('0x6a')},{'name':_0x820b('0x6b'),'value':_0x1f22ce[_0x820b('0x6b')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce['attrs'][0x1]?_0x1f22ce['attrs'][0x1][_0x820b('0x62')]:undefined)||[]},{'name':_0x820b('0x67'),'value':_0x1f22ce[_0x820b('0x67')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x2]?_0x1f22ce[_0x820b('0x61')][0x2][_0x820b('0x62')]:undefined)||0x14},{'name':'attrChannel','value':_0x1f22ce['attrChannel']||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x3]?_0x1f22ce['attrs'][0x3][_0x820b('0x62')]:undefined)||_0x820b('0x6c')},{'name':_0x820b('0x6d'),'value':_0x1f22ce[_0x820b('0x6d')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x4]?_0x1f22ce['attrs'][0x4][_0x820b('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1f22ce[_0x820b('0x6e')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x5]?_0x1f22ce[_0x820b('0x61')][0x5][_0x820b('0x62')]:undefined)||''},{'name':_0x820b('0x6f'),'value':_0x1f22ce['attrSmsAccounts']||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x6]?_0x1f22ce[_0x820b('0x61')][0x6][_0x820b('0x62')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1f22ce['attrOpenchannelAccounts']||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x7]?_0x1f22ce[_0x820b('0x61')][0x7][_0x820b('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1f22ce[_0x820b('0x70')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce['attrs'][0x8]?_0x1f22ce['attrs'][0x8]['value']:undefined)||''},{'name':_0x820b('0x71'),'value':_0x1f22ce[_0x820b('0x71')]||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x9]?_0x1f22ce[_0x820b('0x61')][0x9][_0x820b('0x62')]:undefined)||''}];case _0x820b('0x72'):case'pie-chart':return[{'name':_0x820b('0x73'),'value':_0x1f22ce[_0x820b('0x73')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce['attrs'][0x0]?_0x1f22ce[_0x820b('0x61')][0x0][_0x820b('0x62')]:undefined)||_0x820b('0x6a')},{'name':'attrSerie2','value':_0x1f22ce[_0x820b('0x74')]||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x1]?_0x1f22ce['attrs'][0x1]['value']:undefined)||null},{'name':_0x820b('0x75'),'value':_0x1f22ce[_0x820b('0x75')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce['attrs'][0x2]?_0x1f22ce[_0x820b('0x61')][0x2][_0x820b('0x62')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1f22ce['attrVoiceQueues']||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x3]?_0x1f22ce[_0x820b('0x61')][0x3]['value']:undefined)||[]},{'name':_0x820b('0x76'),'value':_0x1f22ce[_0x820b('0x76')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x4]?_0x1f22ce[_0x820b('0x61')][0x4][_0x820b('0x62')]:undefined)||'voice'},{'name':_0x820b('0x6d'),'value':_0x1f22ce[_0x820b('0x6d')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x5]?_0x1f22ce['attrs'][0x5][_0x820b('0x62')]:undefined)||''},{'name':_0x820b('0x6e'),'value':_0x1f22ce[_0x820b('0x6e')]||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x6]?_0x1f22ce[_0x820b('0x61')][0x6][_0x820b('0x62')]:undefined)||''},{'name':_0x820b('0x6f'),'value':_0x1f22ce[_0x820b('0x6f')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x7]?_0x1f22ce['attrs'][0x7][_0x820b('0x62')]:undefined)||''},{'name':_0x820b('0x77'),'value':_0x1f22ce[_0x820b('0x77')]||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x8]?_0x1f22ce[_0x820b('0x61')][0x8]['value']:undefined)||''},{'name':_0x820b('0x70'),'value':_0x1f22ce[_0x820b('0x70')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x9]?_0x1f22ce['attrs'][0x9][_0x820b('0x62')]:undefined)||''},{'name':_0x820b('0x71'),'value':_0x1f22ce[_0x820b('0x71')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0xa]?_0x1f22ce['attrs'][0xa][_0x820b('0x62')]:undefined)||''}];case _0x820b('0x78'):return[{'name':_0x820b('0x79'),'type':_0x1f22ce[_0x820b('0x7a')]||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x0]?_0x1f22ce['attrs'][0x0][_0x820b('0x37')]:undefined)||null,'value':_0x1f22ce[_0x820b('0x79')]||(_0x1f22ce['attrs']&&_0x1f22ce[_0x820b('0x61')][0x0]?_0x1f22ce[_0x820b('0x61')][0x0][_0x820b('0x62')]:undefined)||null},{'name':_0x820b('0x7b'),'value':_0x1f22ce['attrRefresh']||(_0x1f22ce[_0x820b('0x61')]&&_0x1f22ce[_0x820b('0x61')][0x1]?_0x1f22ce[_0x820b('0x61')][0x1][_0x820b('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x120b07){logger[_0x820b('0x5a')](_0x820b('0x7c'),JSON[_0x820b('0x7d')](_0x120b07));return[];}}exports[_0x820b('0x7e')]=function(_0x1ff972,_0x1892aa,_0x5161af){if(_0x1ff972['body']['id']){delete _0x1ff972[_0x820b('0x51')]['id'];}return db[_0x820b('0x34')][_0x820b('0x56')]({'where':{'id':_0x1ff972[_0x820b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1892aa,null))['then'](function(_0x52d12a){if(_0x52d12a){_0x1ff972[_0x820b('0x51')][_0x820b('0x7f')]=_0x52d12a['id'];_0x1ff972[_0x820b('0x51')]['attrs']=widgetAttributes(_0x1ff972[_0x820b('0x51')]);return db['DashboardItem'][_0x820b('0x50')](_0x1ff972[_0x820b('0x51')]);}})[_0x820b('0x2d')](respondWithResult(_0x1892aa,null))[_0x820b('0x4c')](handleError(_0x1892aa,null));};exports[_0x820b('0x80')]=function(_0x5da0e2,_0x22a520,_0x4d9832){var _0x501ac1={};var _0xa5ea75={};var _0x22f3eb;var _0x2fc96e;return db[_0x820b('0x34')]['findOne']({'where':{'id':_0x5da0e2[_0x820b('0x5d')]['id']}})[_0x820b('0x2d')](handleEntityNotFound(_0x22a520,null))[_0x820b('0x2d')](function(_0x21078b){if(_0x21078b){_0x22f3eb=_0x21078b;_0xa5ea75[_0x820b('0x39')]=_[_0x820b('0x3b')](db['DashboardItem'][_0x820b('0x35')]);_0xa5ea75[_0x820b('0x3a')]=_[_0x820b('0x3b')](_0x5da0e2[_0x820b('0x3a')]);_0xa5ea75['filters']=_[_0x820b('0x3e')](_0xa5ea75[_0x820b('0x39')],_0xa5ea75[_0x820b('0x3a')]);_0x501ac1[_0x820b('0x3d')]=_['intersection'](_0xa5ea75[_0x820b('0x39')],qs[_0x820b('0x3f')](_0x5da0e2[_0x820b('0x3a')][_0x820b('0x3f')]));_0x501ac1['attributes']=_0x501ac1[_0x820b('0x3d')][_0x820b('0x40')]?_0x501ac1['attributes']:_0xa5ea75[_0x820b('0x39')];_0x501ac1[_0x820b('0x43')]=qs[_0x820b('0x44')](_0x5da0e2['query'][_0x820b('0x44')]);_0x501ac1[_0x820b('0x46')]=qs[_0x820b('0x3c')](_[_0x820b('0x45')](_0x5da0e2[_0x820b('0x3a')],_0xa5ea75[_0x820b('0x3c')]));if(_0x5da0e2[_0x820b('0x3a')][_0x820b('0x47')]){_0x501ac1[_0x820b('0x46')]=_[_0x820b('0x48')](_0x501ac1[_0x820b('0x46')],{'$or':_[_0x820b('0x33')](_0x501ac1[_0x820b('0x3d')],function(_0x157a26){var _0x3316d1={};_0x3316d1[_0x157a26]={'$like':'%'+_0x5da0e2['query'][_0x820b('0x47')]+'%'};return _0x3316d1;})});}_0x501ac1=_[_0x820b('0x48')]({},_0x501ac1,_0x5da0e2[_0x820b('0x49')]);return _0x22f3eb['getItems'](_0x501ac1);}})[_0x820b('0x2d')](function(_0x2fbeb6){if(_0x2fbeb6){_0x2fc96e=_0x2fbeb6[_0x820b('0x40')];if(!_0x5da0e2[_0x820b('0x3a')][_0x820b('0x41')](_0x820b('0x42'))){_0x501ac1[_0x820b('0x28')]=qs[_0x820b('0x28')](_0x5da0e2[_0x820b('0x3a')][_0x820b('0x28')]);_0x501ac1[_0x820b('0x27')]=qs[_0x820b('0x27')](_0x5da0e2['query'][_0x820b('0x27')]);}return _0x22f3eb[_0x820b('0x80')](_0x501ac1);}})[_0x820b('0x2d')](function(_0xaad760){if(_0xaad760){return _0xaad760?{'count':_0x2fc96e,'rows':_0xaad760}:null;}})[_0x820b('0x2d')](respondWithResult(_0x22a520,null))['catch'](handleError(_0x22a520,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 8d94167..0abcd0a 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 _0x1ea9=['remove','emit','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x351327,_0x510c3b){var _0x1d8b4e=function(_0x425fda){while(--_0x425fda){_0x351327['push'](_0x351327['shift']());}};_0x1d8b4e(++_0x510c3b);}(_0x1ea9,0x1b5));var _0x91ea=function(_0x1a507d,_0xcea1af){_0x1a507d=_0x1a507d-0x0;var _0x2dd8fa=_0x1ea9[_0x1a507d];return _0x2dd8fa;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x91ea('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x91ea('0x1')](0x0);var events={'afterCreate':_0x91ea('0x2'),'afterUpdate':_0x91ea('0x3'),'afterDestroy':_0x91ea('0x4')};function emitEvent(_0x379711){return function(_0x39a02c,_0x3126f2,_0x34270e){DashboardEvents[_0x91ea('0x5')](_0x379711+':'+_0x39a02c['id'],_0x39a02c);DashboardEvents[_0x91ea('0x5')](_0x379711,_0x39a02c);_0x34270e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x91ea('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x8549=['setMaxListeners','update','emit','hook','exports'];(function(_0x22476f,_0x101f9b){var _0xeb95a0=function(_0x4bdeda){while(--_0x4bdeda){_0x22476f['push'](_0x22476f['shift']());}};_0xeb95a0(++_0x101f9b);}(_0x8549,0x113));var _0x9854=function(_0xc453f2,_0xd88260){_0xc453f2=_0xc453f2-0x0;var _0x387840=_0x8549[_0xc453f2];return _0x387840;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9854('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9854('0x1'),'afterDestroy':'remove'};function emitEvent(_0x145aeb){return function(_0x1ea948,_0x191f8c,_0x23fe5d){DashboardEvents[_0x9854('0x2')](_0x145aeb+':'+_0x1ea948['id'],_0x1ea948);DashboardEvents['emit'](_0x145aeb,_0x1ea948);_0x23fe5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x9854('0x3')](e,emitEvent(event));}}module[_0x9854('0x4')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 314aaca..f64d9eb 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 _0x9366=['define','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes'];(function(_0x3825e8,_0x4c1f20){var _0x2e1708=function(_0x6f7ff9){while(--_0x6f7ff9){_0x3825e8['push'](_0x3825e8['shift']());}};_0x2e1708(++_0x4c1f20);}(_0x9366,0x7a));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6936('0x0'));var util=require(_0x6936('0x1'));var logger=require(_0x6936('0x2'))(_0x6936('0x3'));var moment=require(_0x6936('0x4'));var BPromise=require(_0x6936('0x5'));var rp=require(_0x6936('0x6'));var fs=require('fs');var path=require(_0x6936('0x7'));var rimraf=require('rimraf');var config=require(_0x6936('0x8'));var attributes=require(_0x6936('0x9'));module['exports']=function(_0x589532,_0x5103fb){return _0x589532[_0x6936('0xa')]('Dashboard',attributes,{'tableName':_0x6936('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52ed=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','dashboards','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x52ed,0x132));var _0xd52e=function(_0x31e00f,_0x1a4e77){_0x31e00f=_0x31e00f-0x0;var _0x260194=_0x52ed[_0x31e00f];return _0x260194;};'use strict';var _=require(_0xd52e('0x0'));var util=require(_0xd52e('0x1'));var logger=require(_0xd52e('0x2'))(_0xd52e('0x3'));var moment=require(_0xd52e('0x4'));var BPromise=require('bluebird');var rp=require(_0xd52e('0x5'));var fs=require('fs');var path=require(_0xd52e('0x6'));var rimraf=require(_0xd52e('0x7'));var config=require(_0xd52e('0x8'));var attributes=require(_0xd52e('0x9'));module['exports']=function(_0x27a637,_0xb6a24a){return _0x27a637['define']('Dashboard',attributes,{'tableName':_0xd52e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 0a654db..b2c6183 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 _0xdd05=['http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2bd7a9,_0x1369a1){var _0x2866ac=function(_0x38302c){while(--_0x38302c){_0x2bd7a9['push'](_0x2bd7a9['shift']());}};_0x2866ac(++_0x1369a1);}(_0xdd05,0x1e4));var _0x5dd0=function(_0x570016,_0x111cb9){_0x570016=_0x570016-0x0;var _0x3b4176=_0xdd05[_0x570016];return _0x3b4176;};'use strict';var _=require(_0x5dd0('0x0'));var util=require(_0x5dd0('0x1'));var moment=require(_0x5dd0('0x2'));var BPromise=require(_0x5dd0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dd0('0x4'));var db=require(_0x5dd0('0x5'))['db'];var utils=require(_0x5dd0('0x6'));var logger=require(_0x5dd0('0x7'))(_0x5dd0('0x8'));var config=require(_0x5dd0('0x9'));var jayson=require(_0x5dd0('0xa'));var client=jayson[_0x5dd0('0xb')][_0x5dd0('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5dd0('0xd')],{'host':_0x5dd0('0xe'),'port':0x18eb});var socket=require(_0x5dd0('0xf'))(new Redis(config['redis']));require(_0x5dd0('0x10'))[_0x5dd0('0x11')](socket);function respondWithRpcPromise(_0x4818b4,_0x1f2813,_0x4da654){return new BPromise(function(_0x3df573,_0x21cbec){return client[_0x5dd0('0x12')](_0x4818b4,_0x4da654)[_0x5dd0('0x13')](function(_0x37eb19){logger[_0x5dd0('0x14')](_0x5dd0('0x15'),_0x1f2813,_0x5dd0('0x16'));logger[_0x5dd0('0x17')](_0x5dd0('0x18'),_0x1f2813,_0x5dd0('0x16'),JSON[_0x5dd0('0x19')](_0x37eb19));if(_0x37eb19[_0x5dd0('0x1a')]){if(_0x37eb19['error'][_0x5dd0('0x1b')]===0x1f4){logger[_0x5dd0('0x1a')](_0x5dd0('0x15'),_0x1f2813,_0x37eb19[_0x5dd0('0x1a')]['message']);return _0x21cbec(_0x37eb19[_0x5dd0('0x1a')][_0x5dd0('0x1c')]);}logger[_0x5dd0('0x1a')](_0x5dd0('0x15'),_0x1f2813,_0x37eb19[_0x5dd0('0x1a')][_0x5dd0('0x1c')]);return _0x3df573(_0x37eb19[_0x5dd0('0x1a')][_0x5dd0('0x1c')]);}else{logger['info'](_0x5dd0('0x15'),_0x1f2813,'request\x20sent');_0x3df573(_0x37eb19[_0x5dd0('0x1d')][_0x5dd0('0x1c')]);}})[_0x5dd0('0x1e')](function(_0x2b7dcf){logger[_0x5dd0('0x1a')](_0x5dd0('0x15'),_0x1f2813,_0x2b7dcf);_0x21cbec(_0x2b7dcf);});});} \ No newline at end of file +var _0x6318=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x8bf9b9,_0x135e79){var _0x13bd99=function(_0x5b3ccc){while(--_0x5b3ccc){_0x8bf9b9['push'](_0x8bf9b9['shift']());}};_0x13bd99(++_0x135e79);}(_0x6318,0x89));var _0x8631=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x6318[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x8631('0x0'));var util=require(_0x8631('0x1'));var moment=require(_0x8631('0x2'));var BPromise=require(_0x8631('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8631('0x4'))['db'];var utils=require(_0x8631('0x5'));var logger=require(_0x8631('0x6'))(_0x8631('0x7'));var config=require(_0x8631('0x8'));var jayson=require(_0x8631('0x9'));var client=jayson[_0x8631('0xa')][_0x8631('0xb')]({'port':0x232a});config[_0x8631('0xc')]=_[_0x8631('0xd')](config[_0x8631('0xc')],{'host':_0x8631('0xe'),'port':0x18eb});var socket=require(_0x8631('0xf'))(new Redis(config[_0x8631('0xc')]));require(_0x8631('0x10'))['register'](socket);function respondWithRpcPromise(_0x4a6403,_0x273bf3,_0x4238f4){return new BPromise(function(_0x3ef065,_0x3d341d){return client['request'](_0x4a6403,_0x4238f4)[_0x8631('0x11')](function(_0x21c99d){logger[_0x8631('0x12')](_0x8631('0x13'),_0x273bf3,_0x8631('0x14'));logger['debug'](_0x8631('0x15'),_0x273bf3,_0x8631('0x14'),JSON[_0x8631('0x16')](_0x21c99d));if(_0x21c99d[_0x8631('0x17')]){if(_0x21c99d[_0x8631('0x17')][_0x8631('0x18')]===0x1f4){logger[_0x8631('0x17')](_0x8631('0x13'),_0x273bf3,_0x21c99d[_0x8631('0x17')]['message']);return _0x3d341d(_0x21c99d[_0x8631('0x17')]['message']);}logger[_0x8631('0x17')](_0x8631('0x13'),_0x273bf3,_0x21c99d[_0x8631('0x17')][_0x8631('0x19')]);return _0x3ef065(_0x21c99d[_0x8631('0x17')]['message']);}else{logger[_0x8631('0x12')]('Dashboard,\x20%s,\x20%s',_0x273bf3,_0x8631('0x14'));_0x3ef065(_0x21c99d[_0x8631('0x1a')][_0x8631('0x19')]);}})[_0x8631('0x1b')](function(_0x570975){logger[_0x8631('0x17')](_0x8631('0x13'),_0x273bf3,_0x570975);_0x3d341d(_0x570975);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 93d8fe6..3f55256 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 _0x3c68=['remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x104513,_0x166e91){var _0x59600d=function(_0x3fac2f){while(--_0x3fac2f){_0x104513['push'](_0x104513['shift']());}};_0x59600d(++_0x166e91);}(_0x3c68,0x10c));var _0x83c6=function(_0x4a63d9,_0x2e32e1){_0x4a63d9=_0x4a63d9-0x0;var _0xca3ba0=_0x3c68[_0x4a63d9];return _0xca3ba0;};'use strict';var DashboardEvents=require(_0x83c6('0x0'));var events=[_0x83c6('0x1'),_0x83c6('0x2'),_0x83c6('0x3')];function createListener(_0xc135a5,_0x2dc4f5){return function(_0x43f17f){_0x2dc4f5[_0x83c6('0x4')](_0xc135a5,_0x43f17f);};}function removeListener(_0x4f04c9,_0x31dfae){return function(){DashboardEvents[_0x83c6('0x5')](_0x4f04c9,_0x31dfae);};}exports[_0x83c6('0x6')]=function(_0x59e973){for(var _0x49b4c4=0x0,_0x5021be=events[_0x83c6('0x7')];_0x49b4c4<_0x5021be;_0x49b4c4++){var _0x1792de=events[_0x49b4c4];var _0x35f537=createListener(_0x83c6('0x8')+_0x1792de,_0x59e973);DashboardEvents['on'](_0x1792de,_0x35f537);}}; \ No newline at end of file +var _0x6256=['length','dashboard:','./dashboard.events','emit','removeListener'];(function(_0x4e01f3,_0x5a1422){var _0x1a1662=function(_0x1b072d){while(--_0x1b072d){_0x4e01f3['push'](_0x4e01f3['shift']());}};_0x1a1662(++_0x5a1422);}(_0x6256,0xde));var _0x6625=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x6256[_0x36c5b0];return _0xf19333;};'use strict';var DashboardEvents=require(_0x6625('0x0'));var events=['save','remove','update'];function createListener(_0x4d675d,_0x1d8d13){return function(_0x1e25bc){_0x1d8d13[_0x6625('0x1')](_0x4d675d,_0x1e25bc);};}function removeListener(_0x15bf98,_0xe2af7d){return function(){DashboardEvents[_0x6625('0x2')](_0x15bf98,_0xe2af7d);};}exports['register']=function(_0x3891fe){for(var _0x2e6cb1=0x0,_0x53ce28=events[_0x6625('0x3')];_0x2e6cb1<_0x53ce28;_0x2e6cb1++){var _0x1ff961=events[_0x2e6cb1];var _0x4d7e1a=createListener(_0x6625('0x4')+_0x1ff961,_0x3891fe);DashboardEvents['on'](_0x1ff961,_0x4d7e1a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 8b54dbd..80622ff 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 _0x2027=['getItems','post','create','/:id/clone','clone','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items'];(function(_0x21310f,_0x2b178d){var _0x5bb5a3=function(_0x5ea0ff){while(--_0x5ea0ff){_0x21310f['push'](_0x21310f['shift']());}};_0x5bb5a3(++_0x2b178d);}(_0x2027,0xb9));var _0x7202=function(_0x542b28,_0x2f5526){_0x542b28=_0x542b28-0x0;var _0x207946=_0x2027[_0x542b28];return _0x207946;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7202('0x0'));var timeout=require(_0x7202('0x1'));var express=require(_0x7202('0x2'));var router=express[_0x7202('0x3')]();var fs_extra=require(_0x7202('0x4'));var auth=require(_0x7202('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7202('0x6'));router[_0x7202('0x7')]('/',auth[_0x7202('0x8')](),controller[_0x7202('0x9')]);router[_0x7202('0x7')](_0x7202('0xa'),auth[_0x7202('0x8')](),controller[_0x7202('0xb')]);router['get'](_0x7202('0xc'),auth[_0x7202('0x8')](),controller[_0x7202('0xd')]);router[_0x7202('0xe')]('/',auth[_0x7202('0x8')](),controller[_0x7202('0xf')]);router['post'](_0x7202('0x10'),auth['isAuthenticated'](),controller[_0x7202('0x11')]);router[_0x7202('0xe')](_0x7202('0xc'),auth[_0x7202('0x8')](),controller['addItem']);router[_0x7202('0x12')](_0x7202('0xa'),auth[_0x7202('0x8')](),controller[_0x7202('0x13')]);router[_0x7202('0x14')](_0x7202('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x7202('0x15')]=router; \ No newline at end of file +var _0xbaac=['util','connect-timeout','express','Router','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','clone','addItem','put','delete','destroy','multer'];(function(_0x6575c,_0x343af6){var _0x46f13b=function(_0x58371f){while(--_0x58371f){_0x6575c['push'](_0x6575c['shift']());}};_0x46f13b(++_0x343af6);}(_0xbaac,0xdb));var _0xcbaa=function(_0x787d44,_0x36fea9){_0x787d44=_0x787d44-0x0;var _0x1c1430=_0xbaac[_0x787d44];return _0x1c1430;};'use strict';var multer=require(_0xcbaa('0x0'));var util=require(_0xcbaa('0x1'));var path=require('path');var timeout=require(_0xcbaa('0x2'));var express=require(_0xcbaa('0x3'));var router=express[_0xcbaa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcbaa('0x5'));var config=require('../../config/environment');var controller=require(_0xcbaa('0x6'));router[_0xcbaa('0x7')]('/',auth[_0xcbaa('0x8')](),controller[_0xcbaa('0x9')]);router[_0xcbaa('0x7')](_0xcbaa('0xa'),auth[_0xcbaa('0x8')](),controller[_0xcbaa('0xb')]);router[_0xcbaa('0x7')](_0xcbaa('0xc'),auth[_0xcbaa('0x8')](),controller[_0xcbaa('0xd')]);router['post']('/',auth[_0xcbaa('0x8')](),controller[_0xcbaa('0xe')]);router[_0xcbaa('0xf')](_0xcbaa('0x10'),auth[_0xcbaa('0x8')](),controller[_0xcbaa('0x11')]);router[_0xcbaa('0xf')](_0xcbaa('0xc'),auth['isAuthenticated'](),controller[_0xcbaa('0x12')]);router[_0xcbaa('0x13')](_0xcbaa('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xcbaa('0x14')](_0xcbaa('0xa'),auth[_0xcbaa('0x8')](),controller[_0xcbaa('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 5b13caa..2542bc3 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 _0x5496=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5496,0x175));var _0x6549=function(_0x2d95c2,_0x4b26a7){_0x2d95c2=_0x2d95c2-0x0;var _0x5db352=_0x5496[_0x2d95c2];return _0x5db352;};'use strict';var Sequelize=require(_0x6549('0x0'));var squel=require(_0x6549('0x1'));var _=require(_0x6549('0x2'));module[_0x6549('0x3')]={'title':{'type':Sequelize[_0x6549('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6549('0x5')]('long'),'get':function(){try{return JSON[_0x6549('0x6')](this[_0x6549('0x7')](_0x6549('0x8')));}catch(_0x4d0473){return[];}},'set':function(_0x5a4658){try{this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify'](_0x5a4658));}catch(_0x1ca8fc){this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6549('0xa')]},'col':{'type':Sequelize[_0x6549('0xa')]},'background':{'type':Sequelize[_0x6549('0x4')],'allowNull':![],'defaultValue':_0x6549('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6549('0x4')]},'titleFontSize':{'type':Sequelize[_0x6549('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x22c169,_0x3298a6){var _0x30cc6f=function(_0x2cd339){while(--_0x2cd339){_0x22c169['push'](_0x22c169['shift']());}};_0x30cc6f(++_0x3298a6);}(_0x53ec,0x192));var _0xc53e=function(_0x2f8177,_0x1bb2a9){_0x2f8177=_0x2f8177-0x0;var _0x249cb4=_0x53ec[_0x2f8177];return _0x249cb4;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('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 94e5aa5..fa3be80 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 _0xefce=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','include','merge','options','DashboardItem','catch','find','type','iframe','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','error','widgetAttributes:\x20%s','create','body','rimraf','request-promise'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xefce,0x1e8));var _0xeefc=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0xefce[_0x5cfb92];return _0x1cd7c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeefc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeefc('0x1'));var moment=require(_0xeefc('0x2'));var BPromise=require(_0xeefc('0x3'));var Mustache=require(_0xeefc('0x4'));var util=require(_0xeefc('0x5'));var path=require(_0xeefc('0x6'));var sox=require(_0xeefc('0x7'));var csv=require(_0xeefc('0x8'));var ejs=require(_0xeefc('0x9'));var fs=require('fs');var fs_extra=require(_0xeefc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeefc('0xb'));var jsforce=require(_0xeefc('0xc'));var deskjs=require(_0xeefc('0xd'));var toCsv=require(_0xeefc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeefc('0xe'));var authService=require(_0xeefc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeefc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeefc('0x11'))(_0xeefc('0x12'));var utils=require('../../config/utils');var config=require(_0xeefc('0x13'));var licenseUtil=require(_0xeefc('0x14'));var db=require(_0xeefc('0x15'))['db'];config['redis']=_[_0xeefc('0x16')](config[_0xeefc('0x17')],{'host':_0xeefc('0x18'),'port':0x18eb});var socket=require(_0xeefc('0x19'))(new Redis(config[_0xeefc('0x17')]));require(_0xeefc('0x1a'))[_0xeefc('0x1b')](socket);function respondWithStatusCode(_0x4537e2,_0x2d5fc1){_0x2d5fc1=_0x2d5fc1||0xcc;return function(_0x3ac92a){if(_0x3ac92a){return _0x4537e2[_0xeefc('0x1c')](_0x2d5fc1);}return _0x4537e2['status'](_0x2d5fc1)[_0xeefc('0x1d')]();};}function respondWithResult(_0x5c447b,_0x2ce41b){_0x2ce41b=_0x2ce41b||0xc8;return function(_0x2fe7c2){if(_0x2fe7c2){return _0x5c447b[_0xeefc('0x1e')](_0x2ce41b)[_0xeefc('0x1f')](_0x2fe7c2);}};}function respondWithFilteredResult(_0x15baaa,_0x49cfe2){return function(_0x1c247e){if(_0x1c247e){var _0x1ea90e=typeof _0x49cfe2['offset']===_0xeefc('0x20')&&typeof _0x49cfe2[_0xeefc('0x21')]===_0xeefc('0x20');var _0x4ba684=_0x1c247e[_0xeefc('0x22')];var _0x1f2825=_0x1ea90e?0x0:_0x49cfe2['offset'];var _0x25ca4d=_0x1ea90e?_0x1c247e['count']:_0x49cfe2[_0xeefc('0x23')]+_0x49cfe2[_0xeefc('0x21')];var _0x3cebaa;if(_0x25ca4d>=_0x4ba684){_0x25ca4d=_0x4ba684;_0x3cebaa=0xc8;}else{_0x3cebaa=0xce;}_0x15baaa[_0xeefc('0x1e')](_0x3cebaa);return _0x15baaa[_0xeefc('0x24')](_0xeefc('0x25'),_0x1f2825+'-'+_0x25ca4d+'/'+_0x4ba684)[_0xeefc('0x1f')](_0x1c247e);}return null;};}function patchUpdates(_0x4ec1c9){return function(_0x168700){try{jsonpatch[_0xeefc('0x26')](_0x168700,_0x4ec1c9,!![]);}catch(_0x6e690b){return BPromise[_0xeefc('0x27')](_0x6e690b);}return _0x168700['save']();};}function saveUpdates(_0x48246d,_0x1a8b12){return function(_0x1f2d59){if(_0x1f2d59){return _0x1f2d59[_0xeefc('0x28')](_0x48246d)[_0xeefc('0x29')](function(_0x4aeaa7){return _0x4aeaa7;});}return null;};}function removeEntity(_0x16e60e,_0x3ea299){return function(_0xceece3){if(_0xceece3){return _0xceece3[_0xeefc('0x2a')]()['then'](function(){_0x16e60e['status'](0xcc)[_0xeefc('0x1d')]();});}};}function handleEntityNotFound(_0x5b7d0d,_0x27f8cd){return function(_0x2d13b6){if(!_0x2d13b6){_0x5b7d0d['sendStatus'](0x194);}return _0x2d13b6;};}function handleError(_0x52dab1,_0x167fe8){_0x167fe8=_0x167fe8||0x1f4;return function(_0x56ea84){logger['error'](_0x56ea84[_0xeefc('0x2b')]);if(_0x56ea84[_0xeefc('0x2c')]){delete _0x56ea84['name'];}_0x52dab1['status'](_0x167fe8)[_0xeefc('0x2d')](_0x56ea84);};}exports[_0xeefc('0x2e')]=function(_0x4369c9,_0x13a33e){var _0x29fc6b={'raw':![],'where':{'id':_0x4369c9[_0xeefc('0x2f')]['id']}},_0x325578={};_0x325578[_0xeefc('0x30')]=_[_0xeefc('0x31')](db['DashboardItem'][_0xeefc('0x32')]);_0x325578[_0xeefc('0x33')]=_[_0xeefc('0x31')](_0x4369c9[_0xeefc('0x33')]);_0x325578[_0xeefc('0x34')]=_[_0xeefc('0x35')](_0x325578[_0xeefc('0x30')],_0x325578[_0xeefc('0x33')]);_0x29fc6b[_0xeefc('0x36')]=_[_0xeefc('0x35')](_0x325578[_0xeefc('0x30')],qs[_0xeefc('0x37')](_0x4369c9[_0xeefc('0x33')]['fields']));_0x29fc6b[_0xeefc('0x36')]=_0x29fc6b[_0xeefc('0x36')]['length']?_0x29fc6b[_0xeefc('0x36')]:_0x325578[_0xeefc('0x30')];if(_0x4369c9['query']['includeAll']){_0x29fc6b[_0xeefc('0x38')]=[{'all':!![]}];}_0x29fc6b=_[_0xeefc('0x39')]({},_0x29fc6b,_0x4369c9[_0xeefc('0x3a')]);return db[_0xeefc('0x3b')]['find'](_0x29fc6b)[_0xeefc('0x29')](handleEntityNotFound(_0x13a33e,null))['then'](respondWithResult(_0x13a33e,null))[_0xeefc('0x3c')](handleError(_0x13a33e,null));};exports[_0xeefc('0x2a')]=function(_0x52b74a,_0x38d4c2){return db[_0xeefc('0x3b')][_0xeefc('0x3d')]({'where':{'id':_0x52b74a[_0xeefc('0x2f')]['id']}})[_0xeefc('0x29')](handleEntityNotFound(_0x38d4c2,null))[_0xeefc('0x29')](removeEntity(_0x38d4c2,null))[_0xeefc('0x3c')](handleError(_0x38d4c2,null));};function widgetAttributes(_0x11186c){try{switch(_0x11186c[_0xeefc('0x3e')]){case _0xeefc('0x3f'):return[{'name':'attrUrl','value':_0x11186c['attrUrl']||(_0x11186c['attrs']&&_0x11186c[_0xeefc('0x40')][0x0]?_0x11186c[_0xeefc('0x40')][0x0][_0xeefc('0x41')]:undefined)||_0xeefc('0x42')}];case'custom':return[{'name':_0xeefc('0x43'),'value':_0x11186c[_0xeefc('0x43')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x0]?_0x11186c['attrs'][0x0][_0xeefc('0x41')]:undefined)||''}];case _0xeefc('0x44'):return[{'name':_0xeefc('0x45'),'value':_0x11186c[_0xeefc('0x45')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x0]?_0x11186c[_0xeefc('0x40')][0x0][_0xeefc('0x41')]:undefined)||_0xeefc('0x46')},{'name':_0xeefc('0x47'),'value':_0x11186c['attrTimezone']||(_0x11186c['attrs']&&_0x11186c[_0xeefc('0x40')][0x1]?_0x11186c[_0xeefc('0x40')][0x1][_0xeefc('0x41')]:undefined)||_0xeefc('0x48')},{'name':_0xeefc('0x49'),'value':_0x11186c[_0xeefc('0x49')]||(_0x11186c['attrs']&&_0x11186c['attrs'][0x2]?_0x11186c[_0xeefc('0x40')][0x2][_0xeefc('0x41')]:undefined)||0xc}];case _0xeefc('0x4a'):return[{'name':_0xeefc('0x4b'),'value':_0x11186c[_0xeefc('0x4b')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x0]?_0x11186c[_0xeefc('0x40')][0x0][_0xeefc('0x41')]:undefined)||'total'},{'name':_0xeefc('0x4c'),'value':_0x11186c[_0xeefc('0x4c')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x1]?_0x11186c[_0xeefc('0x40')][0x1][_0xeefc('0x41')]:undefined)||[]},{'name':_0xeefc('0x49'),'value':_0x11186c[_0xeefc('0x49')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x2]?_0x11186c[_0xeefc('0x40')][0x2][_0xeefc('0x41')]:undefined)||0x14},{'name':_0xeefc('0x4d'),'value':_0x11186c[_0xeefc('0x4d')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c['attrs'][0x3]?_0x11186c[_0xeefc('0x40')][0x3][_0xeefc('0x41')]:undefined)||_0xeefc('0x4e')},{'name':_0xeefc('0x4f'),'value':_0x11186c[_0xeefc('0x4f')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x4]?_0x11186c[_0xeefc('0x40')][0x4][_0xeefc('0x41')]:undefined)||''},{'name':_0xeefc('0x50'),'value':_0x11186c[_0xeefc('0x50')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x5]?_0x11186c[_0xeefc('0x40')][0x5]['value']:undefined)||''},{'name':_0xeefc('0x51'),'value':_0x11186c[_0xeefc('0x51')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x6]?_0x11186c['attrs'][0x6]['value']:undefined)||''},{'name':_0xeefc('0x52'),'value':_0x11186c[_0xeefc('0x52')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x7]?_0x11186c[_0xeefc('0x40')][0x7][_0xeefc('0x41')]:undefined)||''},{'name':_0xeefc('0x53'),'value':_0x11186c[_0xeefc('0x53')]||(_0x11186c['attrs']&&_0x11186c['attrs'][0x8]?_0x11186c[_0xeefc('0x40')][0x8][_0xeefc('0x41')]:undefined)||''},{'name':_0xeefc('0x54'),'value':_0x11186c['attrChatWebsites']||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x9]?_0x11186c[_0xeefc('0x40')][0x9]['value']:undefined)||''}];case _0xeefc('0x55'):case _0xeefc('0x56'):return[{'name':_0xeefc('0x57'),'value':_0x11186c[_0xeefc('0x57')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x0]?_0x11186c['attrs'][0x0]['value']:undefined)||_0xeefc('0x58')},{'name':_0xeefc('0x59'),'value':_0x11186c[_0xeefc('0x59')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x1]?_0x11186c['attrs'][0x1][_0xeefc('0x41')]:undefined)||null},{'name':_0xeefc('0x5a'),'value':_0x11186c[_0xeefc('0x5a')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x2]?_0x11186c[_0xeefc('0x40')][0x2]['value']:undefined)||null},{'name':_0xeefc('0x4c'),'value':_0x11186c[_0xeefc('0x4c')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c['attrs'][0x3]?_0x11186c['attrs'][0x3][_0xeefc('0x41')]:undefined)||[]},{'name':_0xeefc('0x4d'),'value':_0x11186c['attrChannel']||(_0x11186c[_0xeefc('0x40')]&&_0x11186c['attrs'][0x4]?_0x11186c[_0xeefc('0x40')][0x4][_0xeefc('0x41')]:undefined)||_0xeefc('0x4e')},{'name':_0xeefc('0x4f'),'value':_0x11186c['attrEmailAccounts']||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x5]?_0x11186c[_0xeefc('0x40')][0x5][_0xeefc('0x41')]:undefined)||''},{'name':_0xeefc('0x50'),'value':_0x11186c[_0xeefc('0x50')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x6]?_0x11186c[_0xeefc('0x40')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x11186c[_0xeefc('0x51')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x7]?_0x11186c[_0xeefc('0x40')][0x7][_0xeefc('0x41')]:undefined)||''},{'name':_0xeefc('0x52'),'value':_0x11186c[_0xeefc('0x52')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x8]?_0x11186c['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x11186c[_0xeefc('0x53')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c['attrs'][0x9]?_0x11186c[_0xeefc('0x40')][0x9][_0xeefc('0x41')]:undefined)||''},{'name':_0xeefc('0x54'),'value':_0x11186c[_0xeefc('0x54')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0xa]?_0x11186c[_0xeefc('0x40')][0xa][_0xeefc('0x41')]:undefined)||''}];case _0xeefc('0x5b'):return[{'name':_0xeefc('0x5c'),'type':_0x11186c['reportType']||(_0x11186c[_0xeefc('0x40')]&&_0x11186c['attrs'][0x0]?_0x11186c['attrs'][0x0]['type']:undefined)||null,'value':_0x11186c[_0xeefc('0x5c')]||(_0x11186c['attrs']&&_0x11186c[_0xeefc('0x40')][0x0]?_0x11186c[_0xeefc('0x40')][0x0]['value']:undefined)||null},{'name':_0xeefc('0x5d'),'value':_0x11186c[_0xeefc('0x5d')]||(_0x11186c[_0xeefc('0x40')]&&_0x11186c[_0xeefc('0x40')][0x1]?_0x11186c[_0xeefc('0x40')][0x1][_0xeefc('0x41')]:undefined)||0x0}];default:return[];}}catch(_0xa1c28f){logger[_0xeefc('0x5e')](_0xeefc('0x5f'),JSON['stringify'](_0xa1c28f));return[];}}exports[_0xeefc('0x60')]=function(_0x232c64,_0x5c5ec2){if(_0x232c64[_0xeefc('0x61')]){_0x232c64[_0xeefc('0x61')][_0xeefc('0x40')]=widgetAttributes(_0x232c64['body']);}return db['DashboardItem'][_0xeefc('0x60')](_0x232c64[_0xeefc('0x61')],{})[_0xeefc('0x29')](respondWithResult(_0x5c5ec2,0xc9))[_0xeefc('0x3c')](handleError(_0x5c5ec2,null));};exports[_0xeefc('0x28')]=function(_0x34a816,_0x1f5e28){if(_0x34a816['body']['id']){delete _0x34a816[_0xeefc('0x61')]['id'];}_0x34a816['body'][_0xeefc('0x40')]=widgetAttributes(_0x34a816[_0xeefc('0x61')]);return db[_0xeefc('0x3b')]['find']({'where':{'id':_0x34a816[_0xeefc('0x2f')]['id']}})['then'](handleEntityNotFound(_0x1f5e28,null))[_0xeefc('0x29')](saveUpdates(_0x34a816['body'],null))[_0xeefc('0x29')](respondWithResult(_0x1f5e28,null))[_0xeefc('0x3c')](handleError(_0x1f5e28,null));}; \ No newline at end of file +var _0xb470=['attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./dashboardItem.socket','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','show','model','keys','DashboardItem','query','filters','intersection','fields','attributes','length','merge','find','catch','params','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues'];(function(_0xe5d575,_0x8a16d3){var _0x56cd9c=function(_0x5e4662){while(--_0x5e4662){_0xe5d575['push'](_0xe5d575['shift']());}};_0x56cd9c(++_0x8a16d3);}(_0xb470,0x75));var _0x0b47=function(_0x5584b4,_0x586825){_0x5584b4=_0x5584b4-0x0;var _0x4f2c79=_0xb470[_0x5584b4];return _0x4f2c79;};'use strict';var emlformat=require(_0x0b47('0x0'));var rimraf=require(_0x0b47('0x1'));var zipdir=require(_0x0b47('0x2'));var jsonpatch=require(_0x0b47('0x3'));var rp=require('request-promise');var moment=require(_0x0b47('0x4'));var BPromise=require(_0x0b47('0x5'));var Mustache=require(_0x0b47('0x6'));var util=require('util');var path=require(_0x0b47('0x7'));var sox=require(_0x0b47('0x8'));var csv=require(_0x0b47('0x9'));var ejs=require(_0x0b47('0xa'));var fs=require('fs');var fs_extra=require(_0x0b47('0xb'));var _=require(_0x0b47('0xc'));var squel=require(_0x0b47('0xd'));var crypto=require(_0x0b47('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b47('0xf'));var Redis=require(_0x0b47('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b47('0x11'));var as=require(_0x0b47('0x12'));var hardwareService=require(_0x0b47('0x13'));var logger=require(_0x0b47('0x14'))(_0x0b47('0x15'));var utils=require(_0x0b47('0x16'));var config=require(_0x0b47('0x17'));var licenseUtil=require(_0x0b47('0x18'));var db=require(_0x0b47('0x19'))['db'];config[_0x0b47('0x1a')]=_['defaults'](config['redis'],{'host':_0x0b47('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b47('0x1a')]));require(_0x0b47('0x1c'))['register'](socket);function respondWithStatusCode(_0x36fe0a,_0x4089d0){_0x4089d0=_0x4089d0||0xcc;return function(_0x2bb088){if(_0x2bb088){return _0x36fe0a[_0x0b47('0x1d')](_0x4089d0);}return _0x36fe0a[_0x0b47('0x1e')](_0x4089d0)[_0x0b47('0x1f')]();};}function respondWithResult(_0x1e9588,_0x1dc752){_0x1dc752=_0x1dc752||0xc8;return function(_0x130a13){if(_0x130a13){return _0x1e9588[_0x0b47('0x1e')](_0x1dc752)['json'](_0x130a13);}};}function respondWithFilteredResult(_0x151eb6,_0x4e5f56){return function(_0x11f305){if(_0x11f305){var _0x1620fc=typeof _0x4e5f56[_0x0b47('0x20')]==='undefined'&&typeof _0x4e5f56[_0x0b47('0x21')]==='undefined';var _0x4b5bac=_0x11f305[_0x0b47('0x22')];var _0x395591=_0x1620fc?0x0:_0x4e5f56['offset'];var _0x3f1c9c=_0x1620fc?_0x11f305['count']:_0x4e5f56[_0x0b47('0x20')]+_0x4e5f56[_0x0b47('0x21')];var _0x34b129;if(_0x3f1c9c>=_0x4b5bac){_0x3f1c9c=_0x4b5bac;_0x34b129=0xc8;}else{_0x34b129=0xce;}_0x151eb6[_0x0b47('0x1e')](_0x34b129);return _0x151eb6[_0x0b47('0x23')](_0x0b47('0x24'),_0x395591+'-'+_0x3f1c9c+'/'+_0x4b5bac)[_0x0b47('0x25')](_0x11f305);}return null;};}function patchUpdates(_0x2dfdb4){return function(_0x3bff28){try{jsonpatch[_0x0b47('0x26')](_0x3bff28,_0x2dfdb4,!![]);}catch(_0x3e37e8){return BPromise['reject'](_0x3e37e8);}return _0x3bff28[_0x0b47('0x27')]();};}function saveUpdates(_0x11935a,_0x4e481c){return function(_0x32559d){if(_0x32559d){return _0x32559d[_0x0b47('0x28')](_0x11935a)[_0x0b47('0x29')](function(_0xd9c35c){return _0xd9c35c;});}return null;};}function removeEntity(_0x59af8e,_0x47d1b2){return function(_0x375983){if(_0x375983){return _0x375983[_0x0b47('0x2a')]()['then'](function(){_0x59af8e[_0x0b47('0x1e')](0xcc)[_0x0b47('0x1f')]();});}};}function handleEntityNotFound(_0x3f0ab4,_0x195d5a){return function(_0x15db7d){if(!_0x15db7d){_0x3f0ab4[_0x0b47('0x1d')](0x194);}return _0x15db7d;};}function handleError(_0x33a81a,_0xd1ead){_0xd1ead=_0xd1ead||0x1f4;return function(_0x3550cc){logger[_0x0b47('0x2b')](_0x3550cc[_0x0b47('0x2c')]);if(_0x3550cc['name']){delete _0x3550cc['name'];}_0x33a81a[_0x0b47('0x1e')](_0xd1ead)['send'](_0x3550cc);};}exports[_0x0b47('0x2d')]=function(_0x9a2cc1,_0x1842ec){var _0xccf571={'raw':![],'where':{'id':_0x9a2cc1['params']['id']}},_0x1014cd={};_0x1014cd[_0x0b47('0x2e')]=_[_0x0b47('0x2f')](db[_0x0b47('0x30')]['rawAttributes']);_0x1014cd[_0x0b47('0x31')]=_[_0x0b47('0x2f')](_0x9a2cc1[_0x0b47('0x31')]);_0x1014cd[_0x0b47('0x32')]=_[_0x0b47('0x33')](_0x1014cd[_0x0b47('0x2e')],_0x1014cd['query']);_0xccf571['attributes']=_[_0x0b47('0x33')](_0x1014cd[_0x0b47('0x2e')],qs[_0x0b47('0x34')](_0x9a2cc1[_0x0b47('0x31')][_0x0b47('0x34')]));_0xccf571[_0x0b47('0x35')]=_0xccf571[_0x0b47('0x35')][_0x0b47('0x36')]?_0xccf571[_0x0b47('0x35')]:_0x1014cd[_0x0b47('0x2e')];if(_0x9a2cc1[_0x0b47('0x31')]['includeAll']){_0xccf571['include']=[{'all':!![]}];}_0xccf571=_[_0x0b47('0x37')]({},_0xccf571,_0x9a2cc1['options']);return db[_0x0b47('0x30')][_0x0b47('0x38')](_0xccf571)[_0x0b47('0x29')](handleEntityNotFound(_0x1842ec,null))[_0x0b47('0x29')](respondWithResult(_0x1842ec,null))[_0x0b47('0x39')](handleError(_0x1842ec,null));};exports[_0x0b47('0x2a')]=function(_0x56a45e,_0x4948d5){return db['DashboardItem'][_0x0b47('0x38')]({'where':{'id':_0x56a45e[_0x0b47('0x3a')]['id']}})[_0x0b47('0x29')](handleEntityNotFound(_0x4948d5,null))[_0x0b47('0x29')](removeEntity(_0x4948d5,null))[_0x0b47('0x39')](handleError(_0x4948d5,null));};function widgetAttributes(_0x22227f){try{switch(_0x22227f['type']){case _0x0b47('0x3b'):return[{'name':_0x0b47('0x3c'),'value':_0x22227f[_0x0b47('0x3c')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x0]?_0x22227f['attrs'][0x0][_0x0b47('0x3e')]:undefined)||_0x0b47('0x3f')}];case'custom':return[{'name':_0x0b47('0x40'),'value':_0x22227f[_0x0b47('0x40')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x0]?_0x22227f['attrs'][0x0][_0x0b47('0x3e')]:undefined)||''}];case _0x0b47('0x41'):return[{'name':_0x0b47('0x42'),'value':_0x22227f[_0x0b47('0x42')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x0]?_0x22227f[_0x0b47('0x3d')][0x0][_0x0b47('0x3e')]:undefined)||_0x0b47('0x43')},{'name':_0x0b47('0x44'),'value':_0x22227f[_0x0b47('0x44')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x1]?_0x22227f['attrs'][0x1]['value']:undefined)||_0x0b47('0x45')},{'name':'attrFontSize','value':_0x22227f[_0x0b47('0x46')]||(_0x22227f['attrs']&&_0x22227f[_0x0b47('0x3d')][0x2]?_0x22227f[_0x0b47('0x3d')][0x2][_0x0b47('0x3e')]:undefined)||0xc}];case _0x0b47('0x47'):return[{'name':'attrMetric','value':_0x22227f[_0x0b47('0x48')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x0]?_0x22227f[_0x0b47('0x3d')][0x0]['value']:undefined)||_0x0b47('0x49')},{'name':_0x0b47('0x4a'),'value':_0x22227f[_0x0b47('0x4a')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x1]?_0x22227f[_0x0b47('0x3d')][0x1][_0x0b47('0x3e')]:undefined)||[]},{'name':_0x0b47('0x46'),'value':_0x22227f[_0x0b47('0x46')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x2]?_0x22227f['attrs'][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x22227f[_0x0b47('0x4b')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x3]?_0x22227f[_0x0b47('0x3d')][0x3]['value']:undefined)||_0x0b47('0x4c')},{'name':_0x0b47('0x4d'),'value':_0x22227f['attrEmailAccounts']||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x4]?_0x22227f[_0x0b47('0x3d')][0x4][_0x0b47('0x3e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x22227f[_0x0b47('0x4e')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x5]?_0x22227f['attrs'][0x5][_0x0b47('0x3e')]:undefined)||''},{'name':_0x0b47('0x4f'),'value':_0x22227f['attrSmsAccounts']||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x6]?_0x22227f['attrs'][0x6][_0x0b47('0x3e')]:undefined)||''},{'name':_0x0b47('0x50'),'value':_0x22227f['attrOpenchannelAccounts']||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x7]?_0x22227f[_0x0b47('0x3d')][0x7][_0x0b47('0x3e')]:undefined)||''},{'name':_0x0b47('0x51'),'value':_0x22227f['attrWhatsappAccounts']||(_0x22227f['attrs']&&_0x22227f[_0x0b47('0x3d')][0x8]?_0x22227f[_0x0b47('0x3d')][0x8][_0x0b47('0x3e')]:undefined)||''},{'name':_0x0b47('0x52'),'value':_0x22227f[_0x0b47('0x52')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x9]?_0x22227f[_0x0b47('0x3d')][0x9][_0x0b47('0x3e')]:undefined)||''}];case _0x0b47('0x53'):case _0x0b47('0x54'):return[{'name':'attrSerie1','value':_0x22227f[_0x0b47('0x55')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x0]?_0x22227f['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x22227f[_0x0b47('0x56')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x1]?_0x22227f[_0x0b47('0x3d')][0x1][_0x0b47('0x3e')]:undefined)||null},{'name':_0x0b47('0x57'),'value':_0x22227f['attrSerie3']||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x2]?_0x22227f[_0x0b47('0x3d')][0x2]['value']:undefined)||null},{'name':_0x0b47('0x4a'),'value':_0x22227f[_0x0b47('0x4a')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x3]?_0x22227f[_0x0b47('0x3d')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x22227f[_0x0b47('0x4b')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0x4]?_0x22227f[_0x0b47('0x3d')][0x4][_0x0b47('0x3e')]:undefined)||_0x0b47('0x4c')},{'name':_0x0b47('0x4d'),'value':_0x22227f[_0x0b47('0x4d')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x5]?_0x22227f[_0x0b47('0x3d')][0x5]['value']:undefined)||''},{'name':_0x0b47('0x4e'),'value':_0x22227f['attrFaxAccounts']||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x6]?_0x22227f[_0x0b47('0x3d')][0x6]['value']:undefined)||''},{'name':_0x0b47('0x4f'),'value':_0x22227f[_0x0b47('0x4f')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x7]?_0x22227f['attrs'][0x7][_0x0b47('0x3e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x22227f[_0x0b47('0x50')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x8]?_0x22227f[_0x0b47('0x3d')][0x8][_0x0b47('0x3e')]:undefined)||''},{'name':_0x0b47('0x51'),'value':_0x22227f[_0x0b47('0x51')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x9]?_0x22227f[_0x0b47('0x3d')][0x9][_0x0b47('0x3e')]:undefined)||''},{'name':_0x0b47('0x52'),'value':_0x22227f[_0x0b47('0x52')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f['attrs'][0xa]?_0x22227f[_0x0b47('0x3d')][0xa][_0x0b47('0x3e')]:undefined)||''}];case'web-report':return[{'name':_0x0b47('0x58'),'type':_0x22227f[_0x0b47('0x59')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x0]?_0x22227f[_0x0b47('0x3d')][0x0][_0x0b47('0x5a')]:undefined)||null,'value':_0x22227f['attrReport']||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x0]?_0x22227f[_0x0b47('0x3d')][0x0][_0x0b47('0x3e')]:undefined)||null},{'name':'attrRefresh','value':_0x22227f[_0x0b47('0x5b')]||(_0x22227f[_0x0b47('0x3d')]&&_0x22227f[_0x0b47('0x3d')][0x1]?_0x22227f['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x104410){logger['error'](_0x0b47('0x5c'),JSON[_0x0b47('0x5d')](_0x104410));return[];}}exports[_0x0b47('0x5e')]=function(_0x40c054,_0x51f551){if(_0x40c054[_0x0b47('0x5f')]){_0x40c054[_0x0b47('0x5f')][_0x0b47('0x3d')]=widgetAttributes(_0x40c054[_0x0b47('0x5f')]);}return db[_0x0b47('0x30')]['create'](_0x40c054['body'],{})[_0x0b47('0x29')](respondWithResult(_0x51f551,0xc9))[_0x0b47('0x39')](handleError(_0x51f551,null));};exports[_0x0b47('0x28')]=function(_0x5e34d0,_0x1bd576){if(_0x5e34d0['body']['id']){delete _0x5e34d0[_0x0b47('0x5f')]['id'];}_0x5e34d0[_0x0b47('0x5f')][_0x0b47('0x3d')]=widgetAttributes(_0x5e34d0[_0x0b47('0x5f')]);return db[_0x0b47('0x30')][_0x0b47('0x38')]({'where':{'id':_0x5e34d0[_0x0b47('0x3a')]['id']}})[_0x0b47('0x29')](handleEntityNotFound(_0x1bd576,null))[_0x0b47('0x29')](saveUpdates(_0x5e34d0[_0x0b47('0x5f')],null))[_0x0b47('0x29')](respondWithResult(_0x1bd576,null))[_0x0b47('0x39')](handleError(_0x1bd576,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index d79ff44..91d75e4 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 _0xe09e=['update','emit','exports','DashboardItem','setMaxListeners','save'];(function(_0x1536c9,_0x322f06){var _0x375faf=function(_0x5b17a0){while(--_0x5b17a0){_0x1536c9['push'](_0x1536c9['shift']());}};_0x375faf(++_0x322f06);}(_0xe09e,0x177));var _0xee09=function(_0x130d82,_0x25f49b){_0x130d82=_0x130d82-0x0;var _0x112070=_0xe09e[_0x130d82];return _0x112070;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xee09('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xee09('0x1')](0x0);var events={'afterCreate':_0xee09('0x2'),'afterUpdate':_0xee09('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16ef17){return function(_0x6f29f4,_0x530108,_0x9407de){DashboardItemEvents['emit'](_0x16ef17+':'+_0x6f29f4['id'],_0x6f29f4);DashboardItemEvents[_0xee09('0x4')](_0x16ef17,_0x6f29f4);_0x9407de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xee09('0x5')]=DashboardItemEvents; \ No newline at end of file +var _0x5885=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x51317c,_0x11b709){var _0x1700ae=function(_0x3e64bf){while(--_0x3e64bf){_0x51317c['push'](_0x51317c['shift']());}};_0x1700ae(++_0x11b709);}(_0x5885,0x7f));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x5588('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5588('0x1')](0x0);var events={'afterCreate':_0x5588('0x2'),'afterUpdate':_0x5588('0x3'),'afterDestroy':_0x5588('0x4')};function emitEvent(_0x24e7ec){return function(_0xd608f8,_0xf673b,_0x99a5ae){DashboardItemEvents[_0x5588('0x5')](_0x24e7ec+':'+_0xd608f8['id'],_0xd608f8);DashboardItemEvents['emit'](_0x24e7ec,_0xd608f8);_0x99a5ae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x5588('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 2a00de0..649d78e 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 _0xf3bb=['request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','../../config/logger','api','moment','bluebird'];(function(_0x308a5a,_0x407e2f){var _0x5eda97=function(_0x5ee2b8){while(--_0x5ee2b8){_0x308a5a['push'](_0x308a5a['shift']());}};_0x5eda97(++_0x407e2f);}(_0xf3bb,0x1e0));var _0xbf3b=function(_0x2d1721,_0x55c55a){_0x2d1721=_0x2d1721-0x0;var _0x494c4c=_0xf3bb[_0x2d1721];return _0x494c4c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf3b('0x0'))(_0xbf3b('0x1'));var moment=require(_0xbf3b('0x2'));var BPromise=require(_0xbf3b('0x3'));var rp=require(_0xbf3b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf3b('0x5'));var config=require(_0xbf3b('0x6'));var attributes=require(_0xbf3b('0x7'));module[_0xbf3b('0x8')]=function(_0x1bca30,_0x255a12){return _0x1bca30[_0xbf3b('0x9')](_0xbf3b('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf352=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x561192,_0x1b1235){var _0xb44625=function(_0x4c0f18){while(--_0x4c0f18){_0x561192['push'](_0x561192['shift']());}};_0xb44625(++_0x1b1235);}(_0xf352,0x1ac));var _0x2f35=function(_0x4ec24b,_0x1738a8){_0x4ec24b=_0x4ec24b-0x0;var _0x1a5b51=_0xf352[_0x4ec24b];return _0x1a5b51;};'use strict';var _=require(_0x2f35('0x0'));var util=require(_0x2f35('0x1'));var logger=require(_0x2f35('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2f35('0x3'));var rp=require(_0x2f35('0x4'));var fs=require('fs');var path=require(_0x2f35('0x5'));var rimraf=require(_0x2f35('0x6'));var config=require(_0x2f35('0x7'));var attributes=require(_0x2f35('0x8'));module[_0x2f35('0x9')]=function(_0x25308e,_0x3bea5a){return _0x25308e[_0x2f35('0xa')](_0x2f35('0xb'),attributes,{'tableName':_0x2f35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 2ca98c2..49777a9 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 _0x2564=['request\x20sent','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x2564,0xba));var _0x4256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2564[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4256('0x0'));var util=require(_0x4256('0x1'));var moment=require(_0x4256('0x2'));var BPromise=require(_0x4256('0x3'));var rs=require(_0x4256('0x4'));var fs=require('fs');var Redis=require(_0x4256('0x5'));var db=require(_0x4256('0x6'))['db'];var utils=require(_0x4256('0x7'));var logger=require(_0x4256('0x8'))(_0x4256('0x9'));var config=require(_0x4256('0xa'));var jayson=require(_0x4256('0xb'));var client=jayson['client'][_0x4256('0xc')]({'port':0x232a});config[_0x4256('0xd')]=_[_0x4256('0xe')](config[_0x4256('0xd')],{'host':_0x4256('0xf'),'port':0x18eb});var socket=require(_0x4256('0x10'))(new Redis(config[_0x4256('0xd')]));require(_0x4256('0x11'))[_0x4256('0x12')](socket);function respondWithRpcPromise(_0xea3942,_0x3dba6f,_0x467168){return new BPromise(function(_0x179ab1,_0xd15a34){return client[_0x4256('0x13')](_0xea3942,_0x467168)[_0x4256('0x14')](function(_0x5dc66a){logger[_0x4256('0x15')]('DashboardItem,\x20%s,\x20%s',_0x3dba6f,'request\x20sent');logger[_0x4256('0x16')](_0x4256('0x17'),_0x3dba6f,_0x4256('0x18'),JSON[_0x4256('0x19')](_0x5dc66a));if(_0x5dc66a[_0x4256('0x1a')]){if(_0x5dc66a['error']['code']===0x1f4){logger['error'](_0x4256('0x1b'),_0x3dba6f,_0x5dc66a[_0x4256('0x1a')][_0x4256('0x1c')]);return _0xd15a34(_0x5dc66a[_0x4256('0x1a')][_0x4256('0x1c')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x3dba6f,_0x5dc66a[_0x4256('0x1a')][_0x4256('0x1c')]);return _0x179ab1(_0x5dc66a[_0x4256('0x1a')][_0x4256('0x1c')]);}else{logger[_0x4256('0x15')](_0x4256('0x1b'),_0x3dba6f,_0x4256('0x18'));_0x179ab1(_0x5dc66a[_0x4256('0x1d')][_0x4256('0x1c')]);}})['catch'](function(_0x3f6fd3){logger[_0x4256('0x1a')](_0x4256('0x1b'),_0x3dba6f,_0x3f6fd3);_0xd15a34(_0x3f6fd3);});});} \ No newline at end of file +var _0xa8dd=['socket.io-emitter','./dashboardItem.socket','register','request','then','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost'];(function(_0x3599fc,_0x5455e8){var _0x5991c7=function(_0x82374f){while(--_0x82374f){_0x3599fc['push'](_0x3599fc['shift']());}};_0x5991c7(++_0x5455e8);}(_0xa8dd,0x15f));var _0xda8d=function(_0x317b2e,_0x165181){_0x317b2e=_0x317b2e-0x0;var _0x1a30d6=_0xa8dd[_0x317b2e];return _0x1a30d6;};'use strict';var _=require(_0xda8d('0x0'));var util=require(_0xda8d('0x1'));var moment=require(_0xda8d('0x2'));var BPromise=require(_0xda8d('0x3'));var rs=require(_0xda8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda8d('0x5'))['db'];var utils=require(_0xda8d('0x6'));var logger=require('../../config/logger')(_0xda8d('0x7'));var config=require(_0xda8d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xda8d('0x9')]['http']({'port':0x232a});config[_0xda8d('0xa')]=_[_0xda8d('0xb')](config[_0xda8d('0xa')],{'host':_0xda8d('0xc'),'port':0x18eb});var socket=require(_0xda8d('0xd'))(new Redis(config[_0xda8d('0xa')]));require(_0xda8d('0xe'))[_0xda8d('0xf')](socket);function respondWithRpcPromise(_0x1314f6,_0x1533f8,_0x258c7d){return new BPromise(function(_0x15d51b,_0x194a6e){return client[_0xda8d('0x10')](_0x1314f6,_0x258c7d)[_0xda8d('0x11')](function(_0x2ce6f8){logger['info']('DashboardItem,\x20%s,\x20%s',_0x1533f8,_0xda8d('0x12'));logger[_0xda8d('0x13')](_0xda8d('0x14'),_0x1533f8,_0xda8d('0x12'),JSON[_0xda8d('0x15')](_0x2ce6f8));if(_0x2ce6f8[_0xda8d('0x16')]){if(_0x2ce6f8[_0xda8d('0x16')][_0xda8d('0x17')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x1533f8,_0x2ce6f8[_0xda8d('0x16')][_0xda8d('0x18')]);return _0x194a6e(_0x2ce6f8['error'][_0xda8d('0x18')]);}logger[_0xda8d('0x16')](_0xda8d('0x19'),_0x1533f8,_0x2ce6f8[_0xda8d('0x16')][_0xda8d('0x18')]);return _0x15d51b(_0x2ce6f8[_0xda8d('0x16')][_0xda8d('0x18')]);}else{logger[_0xda8d('0x1a')](_0xda8d('0x19'),_0x1533f8,_0xda8d('0x12'));_0x15d51b(_0x2ce6f8[_0xda8d('0x1b')]['message']);}})['catch'](function(_0x6ee67f){logger[_0xda8d('0x16')](_0xda8d('0x19'),_0x1533f8,_0x6ee67f);_0x194a6e(_0x6ee67f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 49d9c37..8a6f468 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 _0x2b79=['register','length','dashboardItem:','update','emit'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x2b79,0x1d9));var _0x92b7=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x2b79[_0x380af2];return _0x1789dc;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save','remove',_0x92b7('0x0')];function createListener(_0x1e542c,_0x4c5aa1){return function(_0x3af9b2){_0x4c5aa1[_0x92b7('0x1')](_0x1e542c,_0x3af9b2);};}function removeListener(_0x2043f3,_0x19ef88){return function(){DashboardItemEvents['removeListener'](_0x2043f3,_0x19ef88);};}exports[_0x92b7('0x2')]=function(_0x1718b5){for(var _0x1a5181=0x0,_0x28528a=events[_0x92b7('0x3')];_0x1a5181<_0x28528a;_0x1a5181++){var _0x45a9c4=events[_0x1a5181];var _0x164cff=createListener(_0x92b7('0x4')+_0x45a9c4,_0x1718b5);DashboardItemEvents['on'](_0x45a9c4,_0x164cff);}}; \ No newline at end of file +var _0x926d=['emit','removeListener','register','./dashboardItem.events','save','remove','update'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x926d,0xa4));var _0xd926=function(_0xe6f4dc,_0x4bd94a){_0xe6f4dc=_0xe6f4dc-0x0;var _0x1e9ede=_0x926d[_0xe6f4dc];return _0x1e9ede;};'use strict';var DashboardItemEvents=require(_0xd926('0x0'));var events=[_0xd926('0x1'),_0xd926('0x2'),_0xd926('0x3')];function createListener(_0xce95f5,_0x4c7a5c){return function(_0x5a02cb){_0x4c7a5c[_0xd926('0x4')](_0xce95f5,_0x5a02cb);};}function removeListener(_0x45740e,_0x297ad9){return function(){DashboardItemEvents[_0xd926('0x5')](_0x45740e,_0x297ad9);};}exports[_0xd926('0x6')]=function(_0x33736c){for(var _0x22e59e=0x0,_0x1ef3c9=events['length'];_0x22e59e<_0x1ef3c9;_0x22e59e++){var _0x46bf0b=events[_0x22e59e];var _0x155c29=createListener('dashboardItem:'+_0x46bf0b,_0x33736c);DashboardItemEvents['on'](_0x46bf0b,_0x155c29);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index bb4d84b..cb79add 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 _0x1b10=['../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','create','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5e17e5,_0x3d73fc){var _0x3ff101=function(_0x4720e8){while(--_0x4720e8){_0x5e17e5['push'](_0x5e17e5['shift']());}};_0x3ff101(++_0x3d73fc);}(_0x1b10,0x159));var _0x01b1=function(_0x4a2324,_0x29b899){_0x4a2324=_0x4a2324-0x0;var _0x1b86b6=_0x1b10[_0x4a2324];return _0x1b86b6;};'use strict';var multer=require(_0x01b1('0x0'));var util=require(_0x01b1('0x1'));var path=require(_0x01b1('0x2'));var timeout=require(_0x01b1('0x3'));var express=require(_0x01b1('0x4'));var router=express[_0x01b1('0x5')]();var fs_extra=require(_0x01b1('0x6'));var auth=require(_0x01b1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x01b1('0x8'));var controller=require(_0x01b1('0x9'));router['get'](_0x01b1('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x01b1('0xb')]);router['put'](_0x01b1('0xa'),auth[_0x01b1('0xc')](),controller[_0x01b1('0xd')]);router['delete'](_0x01b1('0xa'),auth[_0x01b1('0xc')](),controller[_0x01b1('0xe')]);module[_0x01b1('0xf')]=router; \ No newline at end of file +var _0x778c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','put','exports','path','Router'];(function(_0x27b3df,_0x34a01a){var _0x275390=function(_0x46e282){while(--_0x46e282){_0x27b3df['push'](_0x27b3df['shift']());}};_0x275390(++_0x34a01a);}(_0x778c,0xfd));var _0xc778=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x778c[_0x38c652];return _0x218a37;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc778('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc778('0x1')]();var fs_extra=require(_0xc778('0x2'));var auth=require(_0xc778('0x3'));var interaction=require(_0xc778('0x4'));var config=require(_0xc778('0x5'));var controller=require(_0xc778('0x6'));router[_0xc778('0x7')](_0xc778('0x8'),auth['isAuthenticated'](),controller[_0xc778('0x9')]);router[_0xc778('0xa')]('/',auth[_0xc778('0xb')](),controller[_0xc778('0xc')]);router[_0xc778('0xd')](_0xc778('0x8'),auth[_0xc778('0xb')](),controller['update']);router['delete'](_0xc778('0x8'),auth[_0xc778('0xb')](),controller['destroy']);module[_0xc778('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 1ae959b..ab048c3 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 _0x76c4=['ENUM','second','first','STRING','sequelize','exports'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x76c4,0x1ea));var _0x476c=function(_0x51a29f,_0x26bd00){_0x51a29f=_0x51a29f-0x0;var _0x14a794=_0x76c4[_0x51a29f];return _0x14a794;};'use strict';var Sequelize=require(_0x476c('0x0'));module[_0x476c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x476c('0x2')]('first',_0x476c('0x3'),'third'),'allowNull':![],'defaultValue':_0x476c('0x4')},'description':{'type':Sequelize[_0x476c('0x5')]}}; \ No newline at end of file +var _0x8e1b=['sequelize','exports','first','second','third','STRING'];(function(_0x24adc2,_0x175b5a){var _0x24cf9b=function(_0x65738d){while(--_0x65738d){_0x24adc2['push'](_0x24adc2['shift']());}};_0x24cf9b(++_0x175b5a);}(_0x8e1b,0x132));var _0xb8e1=function(_0x2fbe1a,_0x5412d9){_0x2fbe1a=_0x2fbe1a-0x0;var _0x30a0a1=_0x8e1b[_0x2fbe1a];return _0x30a0a1;};'use strict';var Sequelize=require(_0xb8e1('0x0'));module[_0xb8e1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xb8e1('0x2'),_0xb8e1('0x3'),_0xb8e1('0x4')),'allowNull':![],'defaultValue':_0xb8e1('0x2')},'description':{'type':Sequelize[_0xb8e1('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 4ea4ce3..6bc59d8 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 _0xefd8=['VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Dispositions','UserProfileSection','autoAssociation','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Disposition','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick'];(function(_0x2b4a73,_0x510d8d){var _0x4401e7=function(_0x1bdc46){while(--_0x1bdc46){_0x2b4a73['push'](_0x2b4a73['shift']());}};_0x4401e7(++_0x510d8d);}(_0xefd8,0x104));var _0x8efd=function(_0x145028,_0x58a967){_0x145028=_0x145028-0x0;var _0x2d1cdd=_0xefd8[_0x145028];return _0x2d1cdd;};'use strict';var emlformat=require(_0x8efd('0x0'));var rimraf=require(_0x8efd('0x1'));var zipdir=require(_0x8efd('0x2'));var jsonpatch=require(_0x8efd('0x3'));var rp=require(_0x8efd('0x4'));var moment=require(_0x8efd('0x5'));var BPromise=require(_0x8efd('0x6'));var Mustache=require(_0x8efd('0x7'));var util=require(_0x8efd('0x8'));var path=require('path');var sox=require(_0x8efd('0x9'));var csv=require(_0x8efd('0xa'));var ejs=require(_0x8efd('0xb'));var fs=require('fs');var fs_extra=require(_0x8efd('0xc'));var _=require(_0x8efd('0xd'));var squel=require(_0x8efd('0xe'));var crypto=require(_0x8efd('0xf'));var jsforce=require(_0x8efd('0x10'));var deskjs=require(_0x8efd('0x11'));var toCsv=require(_0x8efd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8efd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8efd('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8efd('0x14'));var config=require(_0x8efd('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2adbfb,_0x51449b){_0x51449b=_0x51449b||0xcc;return function(_0x49b92a){if(_0x49b92a){return _0x2adbfb['sendStatus'](_0x51449b);}return _0x2adbfb[_0x8efd('0x16')](_0x51449b)[_0x8efd('0x17')]();};}function respondWithResult(_0xc1f24c,_0x3ed627){_0x3ed627=_0x3ed627||0xc8;return function(_0x13b9d5){if(_0x13b9d5){return _0xc1f24c[_0x8efd('0x16')](_0x3ed627)[_0x8efd('0x18')](_0x13b9d5);}};}function respondWithFilteredResult(_0x2ff533,_0x563a4c){return function(_0x42b92e){if(_0x42b92e){var _0x41c3cf=typeof _0x563a4c[_0x8efd('0x19')]===_0x8efd('0x1a')&&typeof _0x563a4c[_0x8efd('0x1b')]===_0x8efd('0x1a');var _0x4c67cb=_0x42b92e[_0x8efd('0x1c')];var _0x2fe4df=_0x41c3cf?0x0:_0x563a4c[_0x8efd('0x19')];var _0x3c8d07=_0x41c3cf?_0x42b92e[_0x8efd('0x1c')]:_0x563a4c[_0x8efd('0x19')]+_0x563a4c[_0x8efd('0x1b')];var _0x4d776a;if(_0x3c8d07>=_0x4c67cb){_0x3c8d07=_0x4c67cb;_0x4d776a=0xc8;}else{_0x4d776a=0xce;}_0x2ff533[_0x8efd('0x16')](_0x4d776a);return _0x2ff533[_0x8efd('0x1d')](_0x8efd('0x1e'),_0x2fe4df+'-'+_0x3c8d07+'/'+_0x4c67cb)['json'](_0x42b92e);}return null;};}function patchUpdates(_0x3b3bca){return function(_0x4eb558){try{jsonpatch[_0x8efd('0x1f')](_0x4eb558,_0x3b3bca,!![]);}catch(_0xd7fce3){return BPromise[_0x8efd('0x20')](_0xd7fce3);}return _0x4eb558[_0x8efd('0x21')]();};}function saveUpdates(_0x4f9152,_0x5291b9){return function(_0xa10f25){if(_0xa10f25){return _0xa10f25[_0x8efd('0x22')](_0x4f9152)[_0x8efd('0x23')](function(_0x266ff6){return _0x266ff6;});}return null;};}function removeEntity(_0x1873da,_0x10485f){return function(_0x1ed1bb){if(_0x1ed1bb){return _0x1ed1bb[_0x8efd('0x24')]()['then'](function(){var _0x2195a6=_0x1ed1bb[_0x8efd('0x25')]({'plain':!![]});var _0xd4c79d='Dispositions';return db[_0x8efd('0x26')][_0x8efd('0x24')]({'where':{'type':_0xd4c79d,'resourceId':_0x2195a6['id']}})['then'](function(){return _0x1ed1bb;});})[_0x8efd('0x23')](function(){_0x1873da['status'](0xcc)[_0x8efd('0x17')]();});}};}function handleEntityNotFound(_0x3e67e0,_0x2d4aa7){return function(_0x493191){if(!_0x493191){_0x3e67e0['sendStatus'](0x194);}return _0x493191;};}function handleError(_0x14bda7,_0x23abdd){_0x23abdd=_0x23abdd||0x1f4;return function(_0x120887){logger[_0x8efd('0x27')](_0x120887[_0x8efd('0x28')]);if(_0x120887[_0x8efd('0x29')]){delete _0x120887[_0x8efd('0x29')];}_0x14bda7[_0x8efd('0x16')](_0x23abdd)[_0x8efd('0x2a')](_0x120887);};}exports[_0x8efd('0x2b')]=function(_0x3daedf,_0x3529b3){var _0xf6b2f={},_0x4e15d8={},_0x13e58c={'count':0x0,'rows':[]};var _0xbb6e89=_[_0x8efd('0x2c')](db[_0x8efd('0x2d')]['rawAttributes'],function(_0x1351e1){return{'name':_0x1351e1['fieldName'],'type':_0x1351e1[_0x8efd('0x2e')][_0x8efd('0x2f')]};});_0x4e15d8[_0x8efd('0x30')]=_['map'](_0xbb6e89,_0x8efd('0x29'));_0x4e15d8[_0x8efd('0x31')]=_[_0x8efd('0x32')](_0x3daedf[_0x8efd('0x31')]);_0x4e15d8[_0x8efd('0x33')]=_['intersection'](_0x4e15d8['model'],_0x4e15d8[_0x8efd('0x31')]);_0xf6b2f[_0x8efd('0x34')]=_[_0x8efd('0x35')](_0x4e15d8[_0x8efd('0x30')],qs[_0x8efd('0x36')](_0x3daedf[_0x8efd('0x31')][_0x8efd('0x36')]));_0xf6b2f[_0x8efd('0x34')]=_0xf6b2f[_0x8efd('0x34')]['length']?_0xf6b2f[_0x8efd('0x34')]:_0x4e15d8[_0x8efd('0x30')];if(!_0x3daedf['query']['hasOwnProperty'](_0x8efd('0x37'))){_0xf6b2f[_0x8efd('0x1b')]=qs['limit'](_0x3daedf[_0x8efd('0x31')][_0x8efd('0x1b')]);_0xf6b2f[_0x8efd('0x19')]=qs[_0x8efd('0x19')](_0x3daedf[_0x8efd('0x31')][_0x8efd('0x19')]);}_0xf6b2f[_0x8efd('0x38')]=qs[_0x8efd('0x39')](_0x3daedf[_0x8efd('0x31')][_0x8efd('0x39')]);_0xf6b2f[_0x8efd('0x3a')]=qs[_0x8efd('0x33')](_[_0x8efd('0x3b')](_0x3daedf[_0x8efd('0x31')],_0x4e15d8[_0x8efd('0x33')]),_0xbb6e89);if(_0x3daedf[_0x8efd('0x31')]['filter']){_0xf6b2f[_0x8efd('0x3a')]=_['merge'](_0xf6b2f[_0x8efd('0x3a')],{'$or':_[_0x8efd('0x2c')](_0xbb6e89,function(_0x2ace52){if(_0x2ace52['type']!==_0x8efd('0x3c')){var _0x16cd27={};_0x16cd27[_0x2ace52[_0x8efd('0x29')]]={'$like':'%'+_0x3daedf[_0x8efd('0x31')][_0x8efd('0x3d')]+'%'};return _0x16cd27;}})});}_0xf6b2f=_[_0x8efd('0x3e')]({},_0xf6b2f,_0x3daedf[_0x8efd('0x3f')]);var _0x57701e={'where':_0xf6b2f[_0x8efd('0x3a')]};return db[_0x8efd('0x2d')][_0x8efd('0x1c')](_0x57701e)['then'](function(_0x47b488){_0x13e58c[_0x8efd('0x1c')]=_0x47b488;if(_0x3daedf['query'][_0x8efd('0x40')]){_0xf6b2f[_0x8efd('0x41')]=[{'all':!![]}];}return db[_0x8efd('0x2d')][_0x8efd('0x42')](_0xf6b2f);})['then'](function(_0x212a82){_0x13e58c[_0x8efd('0x43')]=_0x212a82;return _0x13e58c;})[_0x8efd('0x23')](respondWithFilteredResult(_0x3529b3,_0xf6b2f))[_0x8efd('0x44')](handleError(_0x3529b3,null));};exports[_0x8efd('0x45')]=function(_0x340eaa,_0x33d98f){var _0x53eb2a={'raw':!![],'where':{'id':_0x340eaa[_0x8efd('0x46')]['id']}},_0x245386={};_0x245386[_0x8efd('0x30')]=_[_0x8efd('0x32')](db[_0x8efd('0x2d')][_0x8efd('0x47')]);_0x245386[_0x8efd('0x31')]=_['keys'](_0x340eaa[_0x8efd('0x31')]);_0x245386[_0x8efd('0x33')]=_[_0x8efd('0x35')](_0x245386[_0x8efd('0x30')],_0x245386['query']);_0x53eb2a[_0x8efd('0x34')]=_[_0x8efd('0x35')](_0x245386['model'],qs[_0x8efd('0x36')](_0x340eaa[_0x8efd('0x31')][_0x8efd('0x36')]));_0x53eb2a[_0x8efd('0x34')]=_0x53eb2a[_0x8efd('0x34')]['length']?_0x53eb2a[_0x8efd('0x34')]:_0x245386[_0x8efd('0x30')];if(_0x340eaa[_0x8efd('0x31')]['includeAll']){_0x53eb2a['include']=[{'all':!![]}];}_0x53eb2a=_['merge']({},_0x53eb2a,_0x340eaa[_0x8efd('0x3f')]);return db[_0x8efd('0x2d')]['find'](_0x53eb2a)[_0x8efd('0x23')](handleEntityNotFound(_0x33d98f,null))[_0x8efd('0x23')](respondWithResult(_0x33d98f,null))['catch'](handleError(_0x33d98f,null));};exports['create']=function(_0x4eb397,_0x39a4f5){return db['Disposition'][_0x8efd('0x48')](_0x4eb397[_0x8efd('0x49')],{})[_0x8efd('0x23')](function(_0x533666){var _0x493b3d=_0x4eb397[_0x8efd('0x4a')][_0x8efd('0x25')]({'plain':!![]});if(!_0x493b3d)throw new Error(_0x8efd('0x4b'));if(_0x493b3d['role']===_0x8efd('0x4a')){var _0x30476e=_0x533666['get']({'plain':!![]});var _0x21536b=_0x8efd('0x4c');return db[_0x8efd('0x4d')]['find']({'where':{'name':_0x21536b,'userProfileId':_0x493b3d['userProfileId']},'raw':!![]})[_0x8efd('0x23')](function(_0x1c53d8){if(_0x1c53d8&&_0x1c53d8[_0x8efd('0x4e')]===0x0){return db[_0x8efd('0x26')]['create']({'name':_0x30476e[_0x8efd('0x29')],'resourceId':_0x30476e['id'],'type':_0x1c53d8['name'],'sectionId':_0x1c53d8['id']},{})['then'](function(){return _0x533666;});}else{return _0x533666;}})[_0x8efd('0x44')](function(_0x31fc0b){logger[_0x8efd('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31fc0b);throw _0x31fc0b;});}return _0x533666;})[_0x8efd('0x23')](respondWithResult(_0x39a4f5,0xc9))[_0x8efd('0x44')](handleError(_0x39a4f5,null));};exports[_0x8efd('0x22')]=function(_0x1d472c,_0x4f3969){if(_0x1d472c[_0x8efd('0x49')]['id']){delete _0x1d472c[_0x8efd('0x49')]['id'];}return db[_0x8efd('0x2d')][_0x8efd('0x4f')]({'where':{'id':_0x1d472c[_0x8efd('0x46')]['id']}})[_0x8efd('0x23')](handleEntityNotFound(_0x4f3969,null))[_0x8efd('0x23')](saveUpdates(_0x1d472c['body'],null))[_0x8efd('0x23')](respondWithResult(_0x4f3969,null))['catch'](handleError(_0x4f3969,null));};exports['destroy']=function(_0x4f6068,_0x3982fd){return db[_0x8efd('0x2d')][_0x8efd('0x4f')]({'where':{'id':_0x4f6068[_0x8efd('0x46')]['id']}})[_0x8efd('0x23')](handleEntityNotFound(_0x3982fd,null))[_0x8efd('0x23')](removeEntity(_0x3982fd,null))['catch'](handleError(_0x3982fd,null));}; \ No newline at end of file +var _0x83c8=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','get','UserProfileResource','then','stack','send','map','Disposition','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filters','pick','filter','merge','name','options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x83c8,0x8a));var _0x883c=function(_0x552e94,_0x110f92){_0x552e94=_0x552e94-0x0;var _0x12587b=_0x83c8[_0x552e94];return _0x12587b;};'use strict';var emlformat=require(_0x883c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x883c('0x1'));var rp=require('request-promise');var moment=require(_0x883c('0x2'));var BPromise=require(_0x883c('0x3'));var Mustache=require(_0x883c('0x4'));var util=require(_0x883c('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x883c('0x6'));var fs=require('fs');var fs_extra=require(_0x883c('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x883c('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x883c('0x9'));var querystring=require(_0x883c('0xa'));var Papa=require(_0x883c('0xb'));var Redis=require('ioredis');var authService=require(_0x883c('0xc'));var qs=require(_0x883c('0xd'));var as=require(_0x883c('0xe'));var hardwareService=require(_0x883c('0xf'));var logger=require('../../config/logger')(_0x883c('0x10'));var utils=require(_0x883c('0x11'));var config=require(_0x883c('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x883c('0x13'))['db'];function respondWithStatusCode(_0x56b57c,_0x13924f){_0x13924f=_0x13924f||0xcc;return function(_0x53472c){if(_0x53472c){return _0x56b57c[_0x883c('0x14')](_0x13924f);}return _0x56b57c[_0x883c('0x15')](_0x13924f)[_0x883c('0x16')]();};}function respondWithResult(_0x557747,_0xb86cdc){_0xb86cdc=_0xb86cdc||0xc8;return function(_0x2ac17f){if(_0x2ac17f){return _0x557747[_0x883c('0x15')](_0xb86cdc)[_0x883c('0x17')](_0x2ac17f);}};}function respondWithFilteredResult(_0x485b1e,_0xfbc8e5){return function(_0x49ebcd){if(_0x49ebcd){var _0x2fdf89=typeof _0xfbc8e5['offset']==='undefined'&&typeof _0xfbc8e5[_0x883c('0x18')]===_0x883c('0x19');var _0x4eaffb=_0x49ebcd[_0x883c('0x1a')];var _0x2620cc=_0x2fdf89?0x0:_0xfbc8e5['offset'];var _0x43bdaf=_0x2fdf89?_0x49ebcd[_0x883c('0x1a')]:_0xfbc8e5[_0x883c('0x1b')]+_0xfbc8e5['limit'];var _0x162fd6;if(_0x43bdaf>=_0x4eaffb){_0x43bdaf=_0x4eaffb;_0x162fd6=0xc8;}else{_0x162fd6=0xce;}_0x485b1e[_0x883c('0x15')](_0x162fd6);return _0x485b1e['set'](_0x883c('0x1c'),_0x2620cc+'-'+_0x43bdaf+'/'+_0x4eaffb)[_0x883c('0x17')](_0x49ebcd);}return null;};}function patchUpdates(_0x5c5c9b){return function(_0x4f170f){try{jsonpatch[_0x883c('0x1d')](_0x4f170f,_0x5c5c9b,!![]);}catch(_0x3cb479){return BPromise[_0x883c('0x1e')](_0x3cb479);}return _0x4f170f[_0x883c('0x1f')]();};}function saveUpdates(_0x29af50,_0x500318){return function(_0x466343){if(_0x466343){return _0x466343['update'](_0x29af50)['then'](function(_0x1ee27d){return _0x1ee27d;});}return null;};}function removeEntity(_0x55b913,_0x13ead7){return function(_0x57bb5e){if(_0x57bb5e){return _0x57bb5e['destroy']()['then'](function(){var _0x55f230=_0x57bb5e[_0x883c('0x20')]({'plain':!![]});var _0x464ffb='Dispositions';return db[_0x883c('0x21')]['destroy']({'where':{'type':_0x464ffb,'resourceId':_0x55f230['id']}})['then'](function(){return _0x57bb5e;});})[_0x883c('0x22')](function(){_0x55b913[_0x883c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db028,_0x2b81cf){return function(_0x42ed9f){if(!_0x42ed9f){_0x2db028[_0x883c('0x14')](0x194);}return _0x42ed9f;};}function handleError(_0x140676,_0x262252){_0x262252=_0x262252||0x1f4;return function(_0x5eb919){logger['error'](_0x5eb919[_0x883c('0x23')]);if(_0x5eb919['name']){delete _0x5eb919['name'];}_0x140676['status'](_0x262252)[_0x883c('0x24')](_0x5eb919);};}exports['index']=function(_0x6560e,_0x14a1c3){var _0x5f3445={},_0xcb97b7={},_0x20af59={'count':0x0,'rows':[]};var _0x1940bd=_[_0x883c('0x25')](db[_0x883c('0x26')][_0x883c('0x27')],function(_0x55d479){return{'name':_0x55d479['fieldName'],'type':_0x55d479[_0x883c('0x28')][_0x883c('0x29')]};});_0xcb97b7['model']=_['map'](_0x1940bd,'name');_0xcb97b7[_0x883c('0x2a')]=_[_0x883c('0x2b')](_0x6560e['query']);_0xcb97b7['filters']=_[_0x883c('0x2c')](_0xcb97b7[_0x883c('0x2d')],_0xcb97b7[_0x883c('0x2a')]);_0x5f3445['attributes']=_[_0x883c('0x2c')](_0xcb97b7[_0x883c('0x2d')],qs[_0x883c('0x2e')](_0x6560e[_0x883c('0x2a')][_0x883c('0x2e')]));_0x5f3445[_0x883c('0x2f')]=_0x5f3445[_0x883c('0x2f')][_0x883c('0x30')]?_0x5f3445[_0x883c('0x2f')]:_0xcb97b7[_0x883c('0x2d')];if(!_0x6560e[_0x883c('0x2a')]['hasOwnProperty']('nolimit')){_0x5f3445[_0x883c('0x18')]=qs[_0x883c('0x18')](_0x6560e['query'][_0x883c('0x18')]);_0x5f3445[_0x883c('0x1b')]=qs['offset'](_0x6560e[_0x883c('0x2a')][_0x883c('0x1b')]);}_0x5f3445[_0x883c('0x31')]=qs['sort'](_0x6560e[_0x883c('0x2a')][_0x883c('0x32')]);_0x5f3445[_0x883c('0x33')]=qs[_0x883c('0x34')](_[_0x883c('0x35')](_0x6560e[_0x883c('0x2a')],_0xcb97b7[_0x883c('0x34')]),_0x1940bd);if(_0x6560e[_0x883c('0x2a')][_0x883c('0x36')]){_0x5f3445[_0x883c('0x33')]=_[_0x883c('0x37')](_0x5f3445['where'],{'$or':_[_0x883c('0x25')](_0x1940bd,function(_0x2c2f8c){if(_0x2c2f8c[_0x883c('0x28')]!=='VIRTUAL'){var _0x5edfc7={};_0x5edfc7[_0x2c2f8c[_0x883c('0x38')]]={'$like':'%'+_0x6560e['query'][_0x883c('0x36')]+'%'};return _0x5edfc7;}})});}_0x5f3445=_[_0x883c('0x37')]({},_0x5f3445,_0x6560e[_0x883c('0x39')]);var _0x197379={'where':_0x5f3445[_0x883c('0x33')]};return db['Disposition']['count'](_0x197379)[_0x883c('0x22')](function(_0x49e546){_0x20af59[_0x883c('0x1a')]=_0x49e546;if(_0x6560e[_0x883c('0x2a')][_0x883c('0x3a')]){_0x5f3445[_0x883c('0x3b')]=[{'all':!![]}];}return db[_0x883c('0x26')][_0x883c('0x3c')](_0x5f3445);})['then'](function(_0x993d51){_0x20af59[_0x883c('0x3d')]=_0x993d51;return _0x20af59;})[_0x883c('0x22')](respondWithFilteredResult(_0x14a1c3,_0x5f3445))[_0x883c('0x3e')](handleError(_0x14a1c3,null));};exports['show']=function(_0x4847a4,_0x44b000){var _0x12404f={'raw':!![],'where':{'id':_0x4847a4[_0x883c('0x3f')]['id']}},_0x308fc5={};_0x308fc5[_0x883c('0x2d')]=_[_0x883c('0x2b')](db['Disposition'][_0x883c('0x27')]);_0x308fc5[_0x883c('0x2a')]=_['keys'](_0x4847a4[_0x883c('0x2a')]);_0x308fc5[_0x883c('0x34')]=_[_0x883c('0x2c')](_0x308fc5[_0x883c('0x2d')],_0x308fc5[_0x883c('0x2a')]);_0x12404f[_0x883c('0x2f')]=_[_0x883c('0x2c')](_0x308fc5[_0x883c('0x2d')],qs[_0x883c('0x2e')](_0x4847a4[_0x883c('0x2a')][_0x883c('0x2e')]));_0x12404f[_0x883c('0x2f')]=_0x12404f['attributes'][_0x883c('0x30')]?_0x12404f[_0x883c('0x2f')]:_0x308fc5[_0x883c('0x2d')];if(_0x4847a4['query'][_0x883c('0x3a')]){_0x12404f[_0x883c('0x3b')]=[{'all':!![]}];}_0x12404f=_['merge']({},_0x12404f,_0x4847a4[_0x883c('0x39')]);return db[_0x883c('0x26')]['find'](_0x12404f)[_0x883c('0x22')](handleEntityNotFound(_0x44b000,null))[_0x883c('0x22')](respondWithResult(_0x44b000,null))[_0x883c('0x3e')](handleError(_0x44b000,null));};exports[_0x883c('0x40')]=function(_0x14b4a7,_0x22971a){return db[_0x883c('0x26')][_0x883c('0x40')](_0x14b4a7[_0x883c('0x41')],{})['then'](function(_0x28b99a){var _0x5388c5=_0x14b4a7[_0x883c('0x42')]['get']({'plain':!![]});if(!_0x5388c5)throw new Error(_0x883c('0x43'));if(_0x5388c5[_0x883c('0x44')]==='user'){var _0x4efec3=_0x28b99a[_0x883c('0x20')]({'plain':!![]});var _0x25e2b5=_0x883c('0x45');return db['UserProfileSection'][_0x883c('0x46')]({'where':{'name':_0x25e2b5,'userProfileId':_0x5388c5[_0x883c('0x47')]},'raw':!![]})['then'](function(_0x33285d){if(_0x33285d&&_0x33285d['autoAssociation']===0x0){return db[_0x883c('0x21')][_0x883c('0x40')]({'name':_0x4efec3[_0x883c('0x38')],'resourceId':_0x4efec3['id'],'type':_0x33285d[_0x883c('0x38')],'sectionId':_0x33285d['id']},{})['then'](function(){return _0x28b99a;});}else{return _0x28b99a;}})['catch'](function(_0x129731){logger[_0x883c('0x48')](_0x883c('0x49'),_0x129731);throw _0x129731;});}return _0x28b99a;})[_0x883c('0x22')](respondWithResult(_0x22971a,0xc9))[_0x883c('0x3e')](handleError(_0x22971a,null));};exports[_0x883c('0x4a')]=function(_0x2f547a,_0x255572){if(_0x2f547a[_0x883c('0x41')]['id']){delete _0x2f547a[_0x883c('0x41')]['id'];}return db['Disposition']['find']({'where':{'id':_0x2f547a[_0x883c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x255572,null))[_0x883c('0x22')](saveUpdates(_0x2f547a[_0x883c('0x41')],null))[_0x883c('0x22')](respondWithResult(_0x255572,null))['catch'](handleError(_0x255572,null));};exports[_0x883c('0x4b')]=function(_0x3bf2a7,_0x52fb85){return db[_0x883c('0x26')][_0x883c('0x46')]({'where':{'id':_0x3bf2a7[_0x883c('0x3f')]['id']}})[_0x883c('0x22')](handleEntityNotFound(_0x52fb85,null))[_0x883c('0x22')](removeEntity(_0x52fb85,null))['catch'](handleError(_0x52fb85,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f51e5f5..e53f35d 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 _0x6012=['util','moment','request-promise','path','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','name_openchannel','name_whatsapp','lodash'];(function(_0x9dfbcf,_0x4469f4){var _0x19cc2c=function(_0x350860){while(--_0x350860){_0x9dfbcf['push'](_0x9dfbcf['shift']());}};_0x19cc2c(++_0x4469f4);}(_0x6012,0x6d));var _0x2601=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x6012[_0x3238ea];return _0x4aaac2;};'use strict';var _=require(_0x2601('0x0'));var util=require(_0x2601('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2601('0x2'));var BPromise=require('bluebird');var rp=require(_0x2601('0x3'));var fs=require('fs');var path=require(_0x2601('0x4'));var rimraf=require(_0x2601('0x5'));var config=require('../../config/environment');var attributes=require(_0x2601('0x6'));module[_0x2601('0x7')]=function(_0xb77728,_0x20b4a6){return _0xb77728[_0x2601('0x8')](_0x2601('0x9'),attributes,{'tableName':_0x2601('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x2601('0xb'),'fields':[_0x2601('0xc'),_0x2601('0xd')]},{'unique':!![],'name':_0x2601('0xe'),'fields':['name',_0x2601('0xf')]},{'unique':!![],'name':_0x2601('0x10'),'fields':[_0x2601('0xc'),_0x2601('0x11')]},{'unique':!![],'name':_0x2601('0x12'),'fields':[_0x2601('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x2601('0x13'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x2601('0x14'),'fields':[_0x2601('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x2601('0x15'),'fields':[_0x2601('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcecd=['OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel'];(function(_0x2bdf2b,_0x4c7785){var _0xf47d2f=function(_0x3c8f7a){while(--_0x3c8f7a){_0x2bdf2b['push'](_0x2bdf2b['shift']());}};_0xf47d2f(++_0x4c7785);}(_0xcecd,0x162));var _0xdcec=function(_0x22597f,_0x42e568){_0x22597f=_0x22597f-0x0;var _0x28c2e3=_0xcecd[_0x22597f];return _0x28c2e3;};'use strict';var _=require(_0xdcec('0x0'));var util=require(_0xdcec('0x1'));var logger=require(_0xdcec('0x2'))(_0xdcec('0x3'));var moment=require(_0xdcec('0x4'));var BPromise=require(_0xdcec('0x5'));var rp=require(_0xdcec('0x6'));var fs=require('fs');var path=require(_0xdcec('0x7'));var rimraf=require(_0xdcec('0x8'));var config=require('../../config/environment');var attributes=require(_0xdcec('0x9'));module[_0xdcec('0xa')]=function(_0x388dcf,_0x5d4370){return _0x388dcf[_0xdcec('0xb')](_0xdcec('0xc'),attributes,{'tableName':_0xdcec('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xdcec('0xe'),'fields':[_0xdcec('0xf'),_0xdcec('0x10')]},{'unique':!![],'name':_0xdcec('0x11'),'fields':[_0xdcec('0xf'),_0xdcec('0x12')]},{'unique':!![],'name':'name_mail','fields':[_0xdcec('0xf'),_0xdcec('0x13')]},{'unique':!![],'name':_0xdcec('0x14'),'fields':['name','SmsAccountId']},{'unique':!![],'name':_0xdcec('0x15'),'fields':[_0xdcec('0xf'),_0xdcec('0x16')]},{'unique':!![],'name':_0xdcec('0x17'),'fields':['name',_0xdcec('0x18')]},{'unique':!![],'name':_0xdcec('0x19'),'fields':['name',_0xdcec('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 8821f26..4ee1f93 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(_0x313dbe,_0x438305){var _0x36b6f3=function(_0x80cc43){while(--_0x80cc43){_0x313dbe['push'](_0x313dbe['shift']());}};_0x36b6f3(++_0x438305);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x11d9c3,_0x43fd80){var _0x316e07=function(_0x20db6a){while(--_0x20db6a){_0x11d9c3['push'](_0x11d9c3['shift']());}};_0x316e07(++_0x43fd80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 48407c0..c98c568 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 _0xdb60=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','create','/:id'];(function(_0x3c22eb,_0x325218){var _0x5d3f47=function(_0x470f2a){while(--_0x470f2a){_0x3c22eb['push'](_0x3c22eb['shift']());}};_0x5d3f47(++_0x325218);}(_0xdb60,0x17a));var _0x0db6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdb60[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0db6('0x0'));var util=require(_0x0db6('0x1'));var path=require(_0x0db6('0x2'));var timeout=require(_0x0db6('0x3'));var express=require(_0x0db6('0x4'));var router=express['Router']();var fs_extra=require(_0x0db6('0x5'));var auth=require(_0x0db6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0db6('0x7'));var controller=require(_0x0db6('0x8'));router[_0x0db6('0x9')]('/',auth[_0x0db6('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0db6('0xb')]);router['put'](_0x0db6('0xc'),auth[_0x0db6('0xa')](),controller[_0x0db6('0xd')]);router[_0x0db6('0xe')](_0x0db6('0xc'),auth['isAuthenticated'](),controller[_0x0db6('0xf')]);module[_0x0db6('0x10')]=router; \ No newline at end of file +var _0x90c7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','index','/:id','isAuthenticated','post','create','update','delete','util','path','connect-timeout','express'];(function(_0x1a486d,_0x4a98e9){var _0x4e5ade=function(_0x5a7005){while(--_0x5a7005){_0x1a486d['push'](_0x1a486d['shift']());}};_0x4e5ade(++_0x4a98e9);}(_0x90c7,0x10c));var _0x790c=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x90c7[_0x110c3d];return _0x226d67;};'use strict';var multer=require('multer');var util=require(_0x790c('0x0'));var path=require(_0x790c('0x1'));var timeout=require(_0x790c('0x2'));var express=require(_0x790c('0x3'));var router=express[_0x790c('0x4')]();var fs_extra=require(_0x790c('0x5'));var auth=require(_0x790c('0x6'));var interaction=require(_0x790c('0x7'));var config=require('../../config/environment');var controller=require(_0x790c('0x8'));router[_0x790c('0x9')]('/',auth['isAuthenticated'](),controller[_0x790c('0xa')]);router[_0x790c('0x9')](_0x790c('0xb'),auth[_0x790c('0xc')](),controller['show']);router[_0x790c('0xd')]('/',auth[_0x790c('0xc')](),controller[_0x790c('0xe')]);router['put'](_0x790c('0xb'),auth[_0x790c('0xc')](),controller[_0x790c('0xf')]);router[_0x790c('0x10')](_0x790c('0xb'),auth[_0x790c('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a6c6d3b..635ba28 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 _0x1dcc=['SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','12000','14400','ENUM','9600','v17,v27,v29','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x3b12e2,_0x4a60b0){_0x3b12e2=_0x3b12e2-0x0;var _0x3283d6=_0x1dcc[_0x3b12e2];return _0x3283d6;};'use strict';var Sequelize=require(_0xc1dc('0x0'));module[_0xc1dc('0x1')]={'name':{'type':Sequelize[_0xc1dc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc1dc('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xc1dc('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xc1dc('0x2')],'defaultValue':_0xc1dc('0x4')},'localstationid':{'type':Sequelize[_0xc1dc('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0xc1dc('0x5'),_0xc1dc('0x6'),_0xc1dc('0x7'),'9600',_0xc1dc('0x8'),_0xc1dc('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xc1dc('0xa')]('2400',_0xc1dc('0x6'),'7200',_0xc1dc('0xb'),_0xc1dc('0x8'),_0xc1dc('0x9')),'defaultValue':_0xc1dc('0x9')},'modem':{'type':Sequelize[_0xc1dc('0x2')],'defaultValue':_0xc1dc('0xc')},'gateway':{'type':Sequelize[_0xc1dc('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc1dc('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc1dc('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xc1dc('0xe'),_0xc1dc('0xf'),_0xc1dc('0x10'),'KHOMP'),'defaultValue':_0xc1dc('0xe')},'key':{'type':Sequelize[_0xc1dc('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc1dc('0x11')],'defaultValue':function(){return _0xc1dc('0x12');}},'notificationSound':{'type':Sequelize[_0xc1dc('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc1dc('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc1dc('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc1dc('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc1dc('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc1dc('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc1dc('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc1dc('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xc1dc('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xc1dc('0x13')],'defaultValue':![],'comment':_0xc1dc('0x15'),'set':function(_0x47c72e){if(!_0x47c72e)this[_0xc1dc('0x16')](_0xc1dc('0x17'),null);this['setDataValue']('mandatoryDisposition',_0x47c72e);}}}; \ No newline at end of file +var _0x7278=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400','4800','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x4fb4fa,_0x566c3b){var _0x3549ce=function(_0x2edf35){while(--_0x2edf35){_0x4fb4fa['push'](_0x4fb4fa['shift']());}};_0x3549ce(++_0x566c3b);}(_0x7278,0x161));var _0x8727=function(_0x2edc8b,_0x441753){_0x2edc8b=_0x2edc8b-0x0;var _0x439bc1=_0x7278[_0x2edc8b];return _0x439bc1;};'use strict';var Sequelize=require(_0x8727('0x0'));module[_0x8727('0x1')]={'name':{'type':Sequelize[_0x8727('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8727('0x2')]},'ecm':{'type':Sequelize[_0x8727('0x3')]('yes','no'),'defaultValue':_0x8727('0x4')},'headerinfo':{'type':Sequelize[_0x8727('0x2')],'defaultValue':_0x8727('0x5')},'localstationid':{'type':Sequelize[_0x8727('0x2')],'unique':_0x8727('0x6')},'minrate':{'type':Sequelize[_0x8727('0x3')](_0x8727('0x7'),'4800',_0x8727('0x8'),_0x8727('0x9'),_0x8727('0xa'),_0x8727('0xb')),'defaultValue':_0x8727('0xc')},'maxrate':{'type':Sequelize['ENUM']('2400','4800',_0x8727('0x8'),_0x8727('0x9'),_0x8727('0xa'),_0x8727('0xb')),'defaultValue':_0x8727('0xb')},'modem':{'type':Sequelize[_0x8727('0x2')],'defaultValue':_0x8727('0xd')},'gateway':{'type':Sequelize[_0x8727('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8727('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8727('0x3')](_0x8727('0xf'),'IAX',_0x8727('0x10'),_0x8727('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x8727('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8727('0x12')],'defaultValue':function(){return _0x8727('0x13');}},'notificationSound':{'type':Sequelize[_0x8727('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8727('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8727('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8727('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8727('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8727('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8727('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8727('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x8727('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x8727('0x14')],'defaultValue':![],'comment':_0x8727('0x16'),'set':function(_0x112f04){if(!_0x112f04)this[_0x8727('0x17')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8727('0x18'),_0x112f04);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 36ebdf1..df80d7e 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 _0x19c5=['attachments','join','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','filename','Messages','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','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','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','FaxAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','findOne','pick','rows','ids','addAnswer','getAnswers','hasOwnProperty','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','priority','appdata','push','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','updatedAt','findById','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x19c5,0xd7));var _0x519c=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x19c5[_0x1a89a1];return _0x3d5b46;};'use strict';var emlformat=require(_0x519c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x519c('0x1'));var rp=require(_0x519c('0x2'));var moment=require(_0x519c('0x3'));var BPromise=require(_0x519c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x519c('0x5'));var sox=require(_0x519c('0x6'));var csv=require(_0x519c('0x7'));var ejs=require(_0x519c('0x8'));var fs=require('fs');var fs_extra=require(_0x519c('0x9'));var _=require(_0x519c('0xa'));var squel=require(_0x519c('0xb'));var crypto=require(_0x519c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x519c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x519c('0xe'));var Papa=require(_0x519c('0xf'));var Redis=require(_0x519c('0x10'));var authService=require(_0x519c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x519c('0x12'));var logger=require(_0x519c('0x13'))(_0x519c('0x14'));var utils=require(_0x519c('0x15'));var config=require(_0x519c('0x16'));var licenseUtil=require(_0x519c('0x17'));var db=require(_0x519c('0x18'))['db'];config[_0x519c('0x19')]=_['defaults'](config['redis'],{'host':_0x519c('0x1a'),'port':0x18eb});var socket=require(_0x519c('0x1b'))(new Redis(config['redis']));require(_0x519c('0x1c'))[_0x519c('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x519c('0x1e')][_0x519c('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x519c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x205c55,_0xf29155,_0x3231a8,_0x29e6df){return new BPromise(function(_0x2256a4,_0x1eea0c){var _0x7d3cb7=_0x29e6df||client;return _0x7d3cb7[_0x519c('0x20')](_0x205c55,_0x3231a8)[_0x519c('0x21')](function(_0xd7d1a9){logger[_0x519c('0x22')](_0x519c('0x23'),_0xf29155,_0x519c('0x24'));logger['debug'](_0x519c('0x25'),_0xf29155,_0x519c('0x24'),JSON[_0x519c('0x26')](_0xd7d1a9));if(_0xd7d1a9['error']){if(_0xd7d1a9['error'][_0x519c('0x27')]===0x1f4){logger[_0x519c('0x28')](_0x519c('0x23'),_0xf29155,_0xd7d1a9['error'][_0x519c('0x29')]);return _0x1eea0c(_0xd7d1a9['error'][_0x519c('0x29')]);}logger[_0x519c('0x28')](_0x519c('0x23'),_0xf29155,_0xd7d1a9[_0x519c('0x28')][_0x519c('0x29')]);return _0x2256a4(_0xd7d1a9[_0x519c('0x28')][_0x519c('0x29')]);}else{logger['info'](_0x519c('0x23'),_0xf29155,'request\x20sent');_0x2256a4(_0xd7d1a9[_0x519c('0x2a')][_0x519c('0x29')]);}})[_0x519c('0x2b')](function(_0x4d586d){logger[_0x519c('0x28')](_0x519c('0x23'),_0xf29155,_0x4d586d);_0x1eea0c(_0x4d586d);});});}function respondWithStatusCode(_0x2a29d6,_0x4ef874){_0x4ef874=_0x4ef874||0xcc;return function(_0x17cf4b){if(_0x17cf4b){return _0x2a29d6[_0x519c('0x2c')](_0x4ef874);}return _0x2a29d6[_0x519c('0x2d')](_0x4ef874)['end']();};}function respondWithResult(_0x2ee2c4,_0x2b530d){_0x2b530d=_0x2b530d||0xc8;return function(_0x380f90){if(_0x380f90){return _0x2ee2c4[_0x519c('0x2d')](_0x2b530d)[_0x519c('0x2e')](_0x380f90);}};}function respondWithFilteredResult(_0xfc4290,_0x170582){return function(_0x1eb79e){if(_0x1eb79e){var _0x42095d=typeof _0x170582[_0x519c('0x2f')]===_0x519c('0x30')&&typeof _0x170582[_0x519c('0x31')]==='undefined';var _0x18cbe1=_0x1eb79e['count'];var _0x54acaf=_0x42095d?0x0:_0x170582['offset'];var _0x22e666=_0x42095d?_0x1eb79e[_0x519c('0x32')]:_0x170582[_0x519c('0x2f')]+_0x170582[_0x519c('0x31')];var _0x2fc259;if(_0x22e666>=_0x18cbe1){_0x22e666=_0x18cbe1;_0x2fc259=0xc8;}else{_0x2fc259=0xce;}_0xfc4290['status'](_0x2fc259);return _0xfc4290[_0x519c('0x33')](_0x519c('0x34'),_0x54acaf+'-'+_0x22e666+'/'+_0x18cbe1)[_0x519c('0x2e')](_0x1eb79e);}return null;};}function patchUpdates(_0x5ec39d){return function(_0x35af68){try{jsonpatch['apply'](_0x35af68,_0x5ec39d,!![]);}catch(_0x408d78){return BPromise[_0x519c('0x35')](_0x408d78);}return _0x35af68[_0x519c('0x36')]();};}function saveUpdates(_0x4de417,_0x2b47cd){return function(_0x3e9cb8){if(_0x3e9cb8){return _0x3e9cb8[_0x519c('0x37')](_0x4de417)[_0x519c('0x21')](function(_0x13b326){return _0x13b326;});}return null;};}function removeEntity(_0x17496e,_0x272ee6){return function(_0x33b7ed){if(_0x33b7ed){return _0x33b7ed['destroy']()[_0x519c('0x21')](function(){var _0x4a386a=_0x33b7ed[_0x519c('0x38')]({'plain':!![]});var _0x3b3f0f='FaxAccounts';return db['UserProfileResource'][_0x519c('0x39')]({'where':{'type':_0x3b3f0f,'resourceId':_0x4a386a['id']}})[_0x519c('0x21')](function(){return _0x33b7ed;});})[_0x519c('0x21')](function(){_0x17496e[_0x519c('0x2d')](0xcc)[_0x519c('0x3a')]();});}};}function handleEntityNotFound(_0x58148b,_0x9c538d){return function(_0x464d72){if(!_0x464d72){_0x58148b[_0x519c('0x2c')](0x194);}return _0x464d72;};}function handleError(_0x27d8f7,_0xaef83a){_0xaef83a=_0xaef83a||0x1f4;return function(_0x56686d){logger[_0x519c('0x28')](_0x56686d[_0x519c('0x3b')]);if(_0x56686d[_0x519c('0x3c')]){delete _0x56686d[_0x519c('0x3c')];}_0x27d8f7[_0x519c('0x2d')](_0xaef83a)[_0x519c('0x3d')](_0x56686d);};}exports['index']=function(_0x549c34,_0x5b0410){var _0x25aa4c={'include':[{'model':db[_0x519c('0x3e')],'as':_0x519c('0x3f')}]},_0x5457f6={},_0x17351f={'count':0x0,'rows':[]};var _0x491d66=_['map'](db[_0x519c('0x40')]['rawAttributes'],function(_0x1ab129){return{'name':_0x1ab129[_0x519c('0x41')],'type':_0x1ab129[_0x519c('0x42')][_0x519c('0x43')]};});_0x5457f6[_0x519c('0x44')]=_[_0x519c('0x45')](_0x491d66,_0x519c('0x3c'));_0x5457f6[_0x519c('0x46')]=_[_0x519c('0x47')](_0x549c34[_0x519c('0x46')]);_0x5457f6[_0x519c('0x48')]=_[_0x519c('0x49')](_0x5457f6[_0x519c('0x44')],_0x5457f6[_0x519c('0x46')]);_0x25aa4c[_0x519c('0x4a')]=_[_0x519c('0x49')](_0x5457f6[_0x519c('0x44')],qs[_0x519c('0x4b')](_0x549c34[_0x519c('0x46')][_0x519c('0x4b')]));_0x25aa4c[_0x519c('0x4a')]=_0x25aa4c[_0x519c('0x4a')][_0x519c('0x4c')]?_0x25aa4c[_0x519c('0x4a')]:_0x5457f6[_0x519c('0x44')];if(!_0x549c34[_0x519c('0x46')]['hasOwnProperty'](_0x519c('0x4d'))){_0x25aa4c[_0x519c('0x31')]=qs['limit'](_0x549c34['query']['limit']);_0x25aa4c['offset']=qs[_0x519c('0x2f')](_0x549c34['query'][_0x519c('0x2f')]);}_0x25aa4c[_0x519c('0x4e')]=qs[_0x519c('0x4f')](_0x549c34['query'][_0x519c('0x4f')]);_0x25aa4c[_0x519c('0x50')]=qs[_0x519c('0x48')](_['pick'](_0x549c34[_0x519c('0x46')],_0x5457f6['filters']),_0x491d66);if(_0x549c34[_0x519c('0x46')][_0x519c('0x51')]){_0x25aa4c[_0x519c('0x50')]=_[_0x519c('0x52')](_0x25aa4c['where'],{'$or':_['map'](_0x491d66,function(_0xf99499){if(_0xf99499[_0x519c('0x42')]!==_0x519c('0x53')){var _0x505d8d={};_0x505d8d[_0xf99499[_0x519c('0x3c')]]={'$like':'%'+_0x549c34[_0x519c('0x46')][_0x519c('0x51')]+'%'};return _0x505d8d;}})});}_0x25aa4c=_[_0x519c('0x52')]({},_0x25aa4c,_0x549c34[_0x519c('0x54')]);var _0x3e033e={'where':_0x25aa4c[_0x519c('0x50')]};return db['FaxAccount'][_0x519c('0x32')](_0x3e033e)[_0x519c('0x21')](function(_0x5c9b75){_0x17351f[_0x519c('0x32')]=_0x5c9b75;if(_0x549c34[_0x519c('0x46')][_0x519c('0x55')]){_0x25aa4c[_0x519c('0x56')]=[{'all':!![]}];}return db[_0x519c('0x40')][_0x519c('0x57')](_0x25aa4c);})['then'](function(_0x2d08d1){_0x17351f['rows']=_0x2d08d1;return _0x17351f;})[_0x519c('0x21')](respondWithFilteredResult(_0x5b0410,_0x25aa4c))[_0x519c('0x2b')](handleError(_0x5b0410,null));};exports[_0x519c('0x58')]=function(_0x5ecfda,_0x18b19f){var _0x9d65cb={'raw':![],'where':{'id':_0x5ecfda[_0x519c('0x59')]['id']},'include':[{'model':db[_0x519c('0x3e')],'as':_0x519c('0x3f')}]},_0x51d8a5={};_0x51d8a5[_0x519c('0x44')]=_['keys'](db[_0x519c('0x40')][_0x519c('0x5a')]);_0x51d8a5[_0x519c('0x46')]=_[_0x519c('0x47')](_0x5ecfda[_0x519c('0x46')]);_0x51d8a5[_0x519c('0x48')]=_['intersection'](_0x51d8a5[_0x519c('0x44')],_0x51d8a5['query']);_0x9d65cb[_0x519c('0x4a')]=_[_0x519c('0x49')](_0x51d8a5[_0x519c('0x44')],qs[_0x519c('0x4b')](_0x5ecfda[_0x519c('0x46')][_0x519c('0x4b')]));_0x9d65cb[_0x519c('0x4a')]=_0x9d65cb[_0x519c('0x4a')][_0x519c('0x4c')]?_0x9d65cb[_0x519c('0x4a')]:_0x51d8a5['model'];if(_0x5ecfda[_0x519c('0x46')][_0x519c('0x55')]){_0x9d65cb[_0x519c('0x56')]=[{'all':!![]}];}_0x9d65cb=_[_0x519c('0x52')]({},_0x9d65cb,_0x5ecfda[_0x519c('0x54')]);return db['FaxAccount']['find'](_0x9d65cb)[_0x519c('0x21')](handleEntityNotFound(_0x18b19f,null))[_0x519c('0x21')](respondWithResult(_0x18b19f,null))[_0x519c('0x2b')](handleError(_0x18b19f,null));};exports['create']=function(_0x505bbc,_0x2a1785){return db[_0x519c('0x40')][_0x519c('0x5b')](_0x505bbc['body'],{})[_0x519c('0x21')](function(_0x32eb75){var _0x325daf=_0x505bbc[_0x519c('0x5c')][_0x519c('0x38')]({'plain':!![]});if(!_0x325daf)throw new Error(_0x519c('0x5d'));if(_0x325daf[_0x519c('0x5e')]===_0x519c('0x5c')){var _0xe6b338=_0x32eb75[_0x519c('0x38')]({'plain':!![]});var _0xbe8880=_0x519c('0x5f');return db['UserProfileSection'][_0x519c('0x60')]({'where':{'name':_0xbe8880,'userProfileId':_0x325daf[_0x519c('0x61')]},'raw':!![]})[_0x519c('0x21')](function(_0x59756d){if(_0x59756d&&_0x59756d['autoAssociation']===0x0){return db['UserProfileResource'][_0x519c('0x5b')]({'name':_0xe6b338[_0x519c('0x3c')],'resourceId':_0xe6b338['id'],'type':_0x59756d[_0x519c('0x3c')],'sectionId':_0x59756d['id']},{})[_0x519c('0x21')](function(){return _0x32eb75;});}else{return _0x32eb75;}})[_0x519c('0x2b')](function(_0x243ef4){logger[_0x519c('0x28')](_0x519c('0x62'),_0x243ef4);throw _0x243ef4;});}return _0x32eb75;})[_0x519c('0x21')](respondWithResult(_0x2a1785,0xc9))[_0x519c('0x2b')](handleError(_0x2a1785,null));};exports[_0x519c('0x37')]=function(_0x4283ac,_0x304f61){if(_0x4283ac[_0x519c('0x63')]['id']){delete _0x4283ac[_0x519c('0x63')]['id'];}return db[_0x519c('0x40')][_0x519c('0x60')]({'where':{'id':_0x4283ac['params']['id']},'include':[{'model':db[_0x519c('0x3e')],'as':_0x519c('0x3f')}]})[_0x519c('0x21')](handleEntityNotFound(_0x304f61,null))['then'](saveUpdates(_0x4283ac[_0x519c('0x63')],null))['then'](respondWithResult(_0x304f61,null))[_0x519c('0x2b')](handleError(_0x304f61,null));};exports[_0x519c('0x39')]=function(_0x4f7714,_0x3d3b14){return db['FaxAccount'][_0x519c('0x60')]({'where':{'id':_0x4f7714[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x3d3b14,null))[_0x519c('0x21')](removeEntity(_0x3d3b14,null))['catch'](handleError(_0x3d3b14,null));};exports[_0x519c('0x64')]=function(_0x5c6d3b,_0x52b6ce){return db[_0x519c('0x40')]['describe']()['then'](respondWithResult(_0x52b6ce,null))[_0x519c('0x2b')](handleError(_0x52b6ce,null));};exports[_0x519c('0x65')]=function(_0x1b4dda,_0x2f0414,_0xb41898){if(_0x1b4dda[_0x519c('0x63')]['id']){delete _0x1b4dda[_0x519c('0x63')]['id'];}return db['FaxAccount'][_0x519c('0x60')]({'where':{'id':_0x1b4dda[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x2f0414,null))[_0x519c('0x21')](function(_0x4823a0){if(_0x4823a0){_0x1b4dda['body'][_0x519c('0x66')]=_0x4823a0['id'];return db[_0x519c('0x67')][_0x519c('0x5b')](_0x1b4dda[_0x519c('0x63')]);}})[_0x519c('0x21')](respondWithResult(_0x2f0414,null))[_0x519c('0x2b')](handleError(_0x2f0414,null));};exports['getDispositions']=function(_0x5509ab,_0x4621a4,_0x4d0aee){var _0x300ee5={'raw':![],'where':{}};var _0x511ea9={};var _0x531290={'count':0x0,'rows':[]};return db[_0x519c('0x40')][_0x519c('0x68')]({'where':{'id':_0x5509ab[_0x519c('0x59')]['id']}})['then'](handleEntityNotFound(_0x4621a4,null))[_0x519c('0x21')](function(_0x269a47){if(_0x269a47){_0x511ea9[_0x519c('0x44')]=_[_0x519c('0x47')](db['Disposition'][_0x519c('0x5a')]);_0x511ea9[_0x519c('0x46')]=_[_0x519c('0x47')](_0x5509ab[_0x519c('0x46')]);_0x511ea9[_0x519c('0x48')]=_[_0x519c('0x49')](_0x511ea9['model'],_0x511ea9['query']);_0x300ee5[_0x519c('0x4a')]=_['intersection'](_0x511ea9['model'],qs[_0x519c('0x4b')](_0x5509ab[_0x519c('0x46')][_0x519c('0x4b')]));_0x300ee5[_0x519c('0x4a')]=_0x300ee5['attributes'][_0x519c('0x4c')]?_0x300ee5['attributes']:_0x511ea9[_0x519c('0x44')];if(!_0x5509ab[_0x519c('0x46')]['hasOwnProperty'](_0x519c('0x4d'))){_0x300ee5[_0x519c('0x31')]=qs[_0x519c('0x31')](_0x5509ab['query'][_0x519c('0x31')]);_0x300ee5[_0x519c('0x2f')]=qs[_0x519c('0x2f')](_0x5509ab[_0x519c('0x46')][_0x519c('0x2f')]);}_0x300ee5[_0x519c('0x4e')]=qs[_0x519c('0x4f')](_0x5509ab['query'][_0x519c('0x4f')]);_0x300ee5[_0x519c('0x50')]=qs['filters'](_[_0x519c('0x69')](_0x5509ab[_0x519c('0x46')],_0x511ea9[_0x519c('0x48')]));_0x300ee5[_0x519c('0x50')][_0x519c('0x66')]=_0x269a47['id'];if(_0x5509ab[_0x519c('0x46')][_0x519c('0x51')]){_0x300ee5['where']=_[_0x519c('0x52')](_0x300ee5['where'],{'$or':_[_0x519c('0x45')](_0x300ee5['attributes'],function(_0x3b0d97){var _0x1390eb={};_0x1390eb[_0x3b0d97]={'$like':'%'+_0x5509ab[_0x519c('0x46')][_0x519c('0x51')]+'%'};return _0x1390eb;})});}_0x300ee5=_[_0x519c('0x52')]({},_0x300ee5,_0x5509ab[_0x519c('0x54')]);return db[_0x519c('0x67')][_0x519c('0x32')]({'where':_0x300ee5['where']})[_0x519c('0x21')](function(_0x59cd65){_0x531290[_0x519c('0x32')]=_0x59cd65;if(_0x5509ab['query'][_0x519c('0x55')]){_0x300ee5[_0x519c('0x56')]=[{'all':!![]}];}return db[_0x519c('0x67')][_0x519c('0x57')](_0x300ee5);})[_0x519c('0x21')](function(_0x4810e4){_0x531290[_0x519c('0x6a')]=_0x4810e4;return _0x531290;});}})[_0x519c('0x21')](respondWithFilteredResult(_0x4621a4,_0x300ee5))[_0x519c('0x2b')](handleError(_0x4621a4,null));};exports['removeDispositions']=function(_0x5b323e,_0xe3ce7,_0x2c6a01){return db[_0x519c('0x40')][_0x519c('0x60')]({'where':{'id':_0x5b323e[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0xe3ce7,null))[_0x519c('0x21')](function(_0x794d81){if(_0x794d81){return _0x794d81['removeDispositions'](_0x5b323e[_0x519c('0x46')][_0x519c('0x6b')]);}})[_0x519c('0x21')](respondWithStatusCode(_0xe3ce7,null))[_0x519c('0x2b')](handleError(_0xe3ce7,null));};exports[_0x519c('0x6c')]=function(_0x40dd62,_0x4788f0,_0x259dce){if(_0x40dd62[_0x519c('0x63')]['id']){delete _0x40dd62[_0x519c('0x63')]['id'];}return db['FaxAccount'][_0x519c('0x60')]({'where':{'id':_0x40dd62['params']['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x4788f0,null))[_0x519c('0x21')](function(_0xc4d6c){if(_0xc4d6c){_0x40dd62[_0x519c('0x63')]['FaxAccountId']=_0xc4d6c['id'];return db['CannedAnswer']['create'](_0x40dd62[_0x519c('0x63')]);}})[_0x519c('0x21')](respondWithResult(_0x4788f0,null))[_0x519c('0x2b')](handleError(_0x4788f0,null));};exports[_0x519c('0x6d')]=function(_0x1d7745,_0x479b9c,_0x4cb83c){var _0x1e5895={'raw':![],'where':{}};var _0x26b630={};var _0x5ccc28={'count':0x0,'rows':[]};return db[_0x519c('0x40')]['findOne']({'where':{'id':_0x1d7745[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x479b9c,null))[_0x519c('0x21')](function(_0x80e49e){if(_0x80e49e){_0x26b630[_0x519c('0x44')]=_[_0x519c('0x47')](db['CannedAnswer'][_0x519c('0x5a')]);_0x26b630[_0x519c('0x46')]=_[_0x519c('0x47')](_0x1d7745[_0x519c('0x46')]);_0x26b630['filters']=_[_0x519c('0x49')](_0x26b630[_0x519c('0x44')],_0x26b630[_0x519c('0x46')]);_0x1e5895[_0x519c('0x4a')]=_[_0x519c('0x49')](_0x26b630[_0x519c('0x44')],qs[_0x519c('0x4b')](_0x1d7745[_0x519c('0x46')][_0x519c('0x4b')]));_0x1e5895[_0x519c('0x4a')]=_0x1e5895[_0x519c('0x4a')][_0x519c('0x4c')]?_0x1e5895[_0x519c('0x4a')]:_0x26b630[_0x519c('0x44')];if(!_0x1d7745['query'][_0x519c('0x6e')](_0x519c('0x4d'))){_0x1e5895[_0x519c('0x31')]=qs[_0x519c('0x31')](_0x1d7745[_0x519c('0x46')]['limit']);_0x1e5895[_0x519c('0x2f')]=qs['offset'](_0x1d7745['query']['offset']);}_0x1e5895[_0x519c('0x4e')]=qs[_0x519c('0x4f')](_0x1d7745[_0x519c('0x46')][_0x519c('0x4f')]);_0x1e5895[_0x519c('0x50')]=qs[_0x519c('0x48')](_['pick'](_0x1d7745[_0x519c('0x46')],_0x26b630[_0x519c('0x48')]));_0x1e5895['where'][_0x519c('0x66')]=_0x80e49e['id'];if(_0x1d7745['query'][_0x519c('0x51')]){_0x1e5895[_0x519c('0x50')]=_[_0x519c('0x52')](_0x1e5895[_0x519c('0x50')],{'$or':_[_0x519c('0x45')](_0x1e5895[_0x519c('0x4a')],function(_0x4b580b){var _0x7f0acc={};_0x7f0acc[_0x4b580b]={'$like':'%'+_0x1d7745['query'][_0x519c('0x51')]+'%'};return _0x7f0acc;})});}_0x1e5895=_['merge']({},_0x1e5895,_0x1d7745[_0x519c('0x54')]);return db[_0x519c('0x6f')][_0x519c('0x32')]({'where':_0x1e5895[_0x519c('0x50')]})[_0x519c('0x21')](function(_0x3e5085){_0x5ccc28[_0x519c('0x32')]=_0x3e5085;if(_0x1d7745[_0x519c('0x46')][_0x519c('0x55')]){_0x1e5895[_0x519c('0x56')]=[{'all':!![]}];}return db[_0x519c('0x6f')]['findAll'](_0x1e5895);})[_0x519c('0x21')](function(_0x1bebd3){_0x5ccc28['rows']=_0x1bebd3;return _0x5ccc28;});}})[_0x519c('0x21')](respondWithFilteredResult(_0x479b9c,_0x1e5895))['catch'](handleError(_0x479b9c,null));};exports['removeAnswers']=function(_0x3948fd,_0x501e8b,_0x9e2f7c){return db[_0x519c('0x40')][_0x519c('0x60')]({'where':{'id':_0x3948fd[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x501e8b,null))[_0x519c('0x21')](function(_0x4b1762){if(_0x4b1762){return _0x4b1762[_0x519c('0x70')](_0x3948fd['query'][_0x519c('0x6b')]);}})[_0x519c('0x21')](respondWithStatusCode(_0x501e8b,null))[_0x519c('0x2b')](handleError(_0x501e8b,null));};exports[_0x519c('0x71')]=function(_0x2e8161,_0x1821f3,_0x385338){return db['FaxInteraction'][_0x519c('0x60')]({'where':{'id':_0x2e8161[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x1821f3,null))[_0x519c('0x21')](function(_0x10c95e){if(_0x10c95e){return _0x10c95e[_0x519c('0x71')](_0x2e8161[_0x519c('0x63')][_0x519c('0x6b')],_[_0x519c('0x72')](_0x2e8161[_0x519c('0x63')],['ids','id'])||{});}})[_0x519c('0x21')](respondWithResult(_0x1821f3,null))[_0x519c('0x2b')](handleError(_0x1821f3,null));};exports[_0x519c('0x73')]=function(_0x495bba,_0x1fd334,_0x51ea20){var _0x1fd8a6={'raw':![],'where':{}};var _0x4036b5={};var _0x583829={'count':0x0,'rows':[]};return db[_0x519c('0x40')][_0x519c('0x68')]({'where':{'id':_0x495bba[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x1fd334,null))['then'](function(_0xbd76ee){if(_0xbd76ee){_0x4036b5['model']=_['keys'](db[_0x519c('0x74')][_0x519c('0x5a')]);_0x4036b5['query']=_[_0x519c('0x47')](_0x495bba[_0x519c('0x46')]);_0x4036b5[_0x519c('0x48')]=_['intersection'](_0x4036b5[_0x519c('0x44')],_0x4036b5[_0x519c('0x46')]);_0x1fd8a6[_0x519c('0x4a')]=_[_0x519c('0x49')](_0x4036b5[_0x519c('0x44')],qs[_0x519c('0x4b')](_0x495bba[_0x519c('0x46')][_0x519c('0x4b')]));_0x1fd8a6['attributes']=_0x1fd8a6['attributes'][_0x519c('0x4c')]?_0x1fd8a6[_0x519c('0x4a')]:_0x4036b5[_0x519c('0x44')];if(!_0x495bba['query']['hasOwnProperty'](_0x519c('0x4d'))){_0x1fd8a6[_0x519c('0x31')]=qs[_0x519c('0x31')](_0x495bba[_0x519c('0x46')]['limit']);_0x1fd8a6[_0x519c('0x2f')]=qs[_0x519c('0x2f')](_0x495bba[_0x519c('0x46')][_0x519c('0x2f')]);}_0x1fd8a6[_0x519c('0x4e')]=qs['sort'](_0x495bba[_0x519c('0x46')]['sort']);_0x1fd8a6[_0x519c('0x50')]=qs[_0x519c('0x48')](_['pick'](_0x495bba[_0x519c('0x46')],_0x4036b5[_0x519c('0x48')]));_0x1fd8a6[_0x519c('0x50')][_0x519c('0x66')]=_0xbd76ee['id'];if(_0x495bba[_0x519c('0x46')][_0x519c('0x51')]){_0x1fd8a6[_0x519c('0x50')]=_['merge'](_0x1fd8a6[_0x519c('0x50')],{'$or':_[_0x519c('0x45')](_0x1fd8a6['attributes'],function(_0x10cf23){var _0x1c0e0c={};_0x1c0e0c[_0x10cf23]={'$like':'%'+_0x495bba[_0x519c('0x46')][_0x519c('0x51')]+'%'};return _0x1c0e0c;})});}_0x1fd8a6=_[_0x519c('0x52')]({},_0x1fd8a6,_0x495bba[_0x519c('0x54')]);return db[_0x519c('0x74')][_0x519c('0x32')]({'where':_0x1fd8a6['where']})['then'](function(_0x59411f){_0x583829[_0x519c('0x32')]=_0x59411f;if(_0x495bba[_0x519c('0x46')][_0x519c('0x55')]){_0x1fd8a6[_0x519c('0x56')]=[{'model':db[_0x519c('0x75')],'as':_0x519c('0x76'),'required':![]},{'model':db[_0x519c('0x77')],'as':_0x519c('0x78'),'attributes':['name',_0x519c('0x79'),_0x519c('0x7a')],'required':![]},{'model':db[_0x519c('0x7b')],'as':_0x519c('0x7c'),'attributes':['id','name',_0x519c('0x7d')],'where':_0x495bba[_0x519c('0x46')]['tag']?{'id':_0x495bba[_0x519c('0x46')][_0x519c('0x7e')]}:undefined,'required':_0x495bba[_0x519c('0x46')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x519c('0x57')](_0x1fd8a6);})[_0x519c('0x21')](function(_0x47a11f){_0x583829[_0x519c('0x6a')]=_0x47a11f;return _0x583829;});}})[_0x519c('0x21')](respondWithFilteredResult(_0x1fd334,_0x1fd8a6))['catch'](handleError(_0x1fd334,null));};exports['addApplications']=function(_0x227364,_0xec21fd){var _0x3956a2=_0x227364[_0x519c('0x59')]['id'];var _0x5163f9=_0x227364[_0x519c('0x63')];var _0x519bec=0xc8;var _0x38e64c=null;return db['sequelize'][_0x519c('0x7f')]({'isolationLevel':db[_0x519c('0x80')][_0x519c('0x81')][_0x519c('0x82')][_0x519c('0x83')]},function(_0x137dfa){return db['FaxAccount']['findOne']({'where':{'id':_0x3956a2},'transaction':_0x137dfa})[_0x519c('0x21')](function(_0x95c0ec){if(_0x95c0ec){return db['FaxApplication'][_0x519c('0x39')]({'where':{'FaxAccountId':_0x3956a2},'transaction':_0x137dfa})[_0x519c('0x21')](function(){var _0x4393e3=_['map'](_0x5163f9,function(_0x17baf4){_0x17baf4[_0x519c('0x66')]=_0x3956a2;return _0x17baf4;});return db[_0x519c('0x84')][_0x519c('0x85')](_0x4393e3,{'transaction':_0x137dfa});});}else{_0x519bec=0x194;_0x38e64c=[];}});})['then'](function(){if(_0x519bec!==0x194){return db[_0x519c('0x84')][_0x519c('0x86')]({'where':{'FaxAccountId':_0x3956a2},'order':'priority'})[_0x519c('0x21')](function(_0x28aec9){_0x38e64c=_0x28aec9;});}})[_0x519c('0x2b')](function(_0x36ad78){_0x519bec=0x1f4;logger[_0x519c('0x28')](_0x36ad78['stack']);if(_0x36ad78[_0x519c('0x3c')]){delete _0x36ad78[_0x519c('0x3c')];}_0x38e64c=_0x36ad78;})[_0x519c('0x87')](function(){if(_0x38e64c===null){_0xec21fd[_0x519c('0x2c')](_0x519bec);}else{if(_0x519bec===0x1f4){_0xec21fd[_0x519c('0x2d')](_0x519bec)[_0x519c('0x3d')](_0x38e64c);}else{_0xec21fd[_0x519c('0x2d')](_0x519bec)[_0x519c('0x2e')](_0x38e64c);}}});};exports[_0x519c('0x88')]=function(_0xc37c20,_0x5199ea,_0x5342f3){var _0x51ccc3={};var _0x34cdbb={};var _0x2b72f9;var _0x1af9a2;return db['FaxAccount'][_0x519c('0x68')]({'where':{'id':_0xc37c20[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x5199ea,null))['then'](function(_0x557542){if(_0x557542){_0x2b72f9=_0x557542;_0x34cdbb[_0x519c('0x44')]=_[_0x519c('0x47')](db[_0x519c('0x84')][_0x519c('0x5a')]);_0x34cdbb['query']=_[_0x519c('0x47')](_0xc37c20[_0x519c('0x46')]);_0x34cdbb['filters']=_[_0x519c('0x49')](_0x34cdbb[_0x519c('0x44')],_0x34cdbb[_0x519c('0x46')]);_0x51ccc3[_0x519c('0x4a')]=_[_0x519c('0x49')](_0x34cdbb[_0x519c('0x44')],qs['fields'](_0xc37c20['query'][_0x519c('0x4b')]));_0x51ccc3[_0x519c('0x4a')]=_0x51ccc3[_0x519c('0x4a')][_0x519c('0x4c')]?_0x51ccc3[_0x519c('0x4a')]:_0x34cdbb['model'];_0x51ccc3[_0x519c('0x4e')]=qs[_0x519c('0x4f')](_0xc37c20[_0x519c('0x46')][_0x519c('0x4f')]);_0x51ccc3[_0x519c('0x50')]=qs[_0x519c('0x48')](_[_0x519c('0x69')](_0xc37c20[_0x519c('0x46')],_0x34cdbb[_0x519c('0x48')]));if(_0xc37c20['query']['filter']){_0x51ccc3[_0x519c('0x50')]=_[_0x519c('0x52')](_0x51ccc3['where'],{'$or':_[_0x519c('0x45')](_0x51ccc3[_0x519c('0x4a')],function(_0x48598c){var _0x2e7886={};_0x2e7886[_0x48598c]={'$like':'%'+_0xc37c20['query'][_0x519c('0x51')]+'%'};return _0x2e7886;})});}_0x51ccc3=_[_0x519c('0x52')]({},_0x51ccc3,_0xc37c20['options']);return _0x2b72f9[_0x519c('0x88')](_0x51ccc3);}})[_0x519c('0x21')](function(_0x35c1d9){if(_0x35c1d9){_0x1af9a2=_0x35c1d9[_0x519c('0x4c')];if(!_0xc37c20[_0x519c('0x46')][_0x519c('0x6e')](_0x519c('0x4d'))){_0x51ccc3[_0x519c('0x31')]=qs[_0x519c('0x31')](_0xc37c20['query'][_0x519c('0x31')]);_0x51ccc3[_0x519c('0x2f')]=qs[_0x519c('0x2f')](_0xc37c20[_0x519c('0x46')][_0x519c('0x2f')]);}return _0x2b72f9['getApplications'](_0x51ccc3);}})[_0x519c('0x21')](function(_0x59c6c1){if(_0x59c6c1){return _0x59c6c1?{'count':_0x1af9a2,'rows':_0x59c6c1}:null;}})[_0x519c('0x21')](respondWithResult(_0x5199ea,null))['catch'](handleError(_0x5199ea,null));};function Extension(_0x21a9cf,_0x2f947e,_0x27fc61,_0x4fb4c2){this[_0x519c('0x89')]=_0x519c('0x8a');this[_0x519c('0x8b')]=_0x21a9cf[_0x519c('0x8c')];this[_0x519c('0x8d')]=_0x4fb4c2;this[_0x519c('0x42')]='system';this['description']=_0x519c('0x8e');this['FaxAccountId']=_0x21a9cf['id'];this[_0x519c('0x8f')]=_0x2f947e;this[_0x519c('0x90')]=_0x27fc61;}function createExtensionsReciveFax(_0x2e1b14){var _0x40cf76=0x1;var _0x1a242b=[];_0x1a242b[_0x519c('0x91')](new Extension(_0x2e1b14,_0x40cf76,'','Answer'));_0x40cf76+=0x1;_0x1a242b['push'](new Extension(_0x2e1b14,_0x40cf76,_0x519c('0x92'),'Set'));_0x40cf76+=0x1;for(var _0x3e34d4 in _0x2e1b14){if(_0x2e1b14[_0x519c('0x6e')](_0x3e34d4)&&(_0x3e34d4==='ecm'||_0x3e34d4===_0x519c('0x8c')||_0x3e34d4===_0x519c('0x93')||_0x3e34d4===_0x519c('0x94')||_0x3e34d4===_0x519c('0x95')||_0x3e34d4===_0x519c('0x96')||_0x3e34d4===_0x519c('0x97')||_0x3e34d4===_0x519c('0x98')||_0x3e34d4===_0x519c('0x99'))){_0x1a242b['push'](new Extension(_0x2e1b14,_0x40cf76,_0x519c('0x9a')+_0x3e34d4+')='+_0x2e1b14[_0x3e34d4],_0x519c('0x9b')));_0x40cf76+=0x1;}}_0x1a242b[_0x519c('0x91')](new Extension(_0x2e1b14,_0x40cf76,'6','Wait'));_0x40cf76+=0x1;_0x1a242b[_0x519c('0x91')](new Extension(_0x2e1b14,_0x40cf76,_0x519c('0x9c'),_0x519c('0x9d')));_0x40cf76=0x0;return _0x1a242b;}exports[_0x519c('0x9e')]=function(_0xd98fbd,_0x4bc8ad,_0x48f3aa){var _0x5df284;return db[_0x519c('0x80')][_0x519c('0x7f')](function(_0x31c986){return db[_0x519c('0x40')][_0x519c('0x5b')](_0xd98fbd['body'],{'transaction':_0x31c986})[_0x519c('0x21')](function(_0x44a8e0){_0x5df284=_0x44a8e0[_0x519c('0x38')]({'plain':!![]});return db[_0x519c('0x9f')]['bulkCreate'](createExtensionsReciveFax(_0x5df284),{'transaction':_0x31c986});});})[_0x519c('0x21')](function(){return _0x5df284;})['then'](respondWithResult(_0x4bc8ad,null))[_0x519c('0x2b')](handleError(_0x4bc8ad,null));};exports[_0x519c('0xa0')]=function(_0x3e8abd,_0x94657f,_0x4ff52e){var _0x2b5ad5;return db['sequelize'][_0x519c('0x7f')](function(_0x4c80c8){return db[_0x519c('0x40')]['update'](_0x3e8abd[_0x519c('0x63')],{'where':{'id':_0x3e8abd[_0x519c('0x63')]['id']},'transaction':_0x4c80c8})[_0x519c('0x21')](function(_0x562250){return db[_0x519c('0x9f')][_0x519c('0x39')]({'where':{'FaxAccountId':_0x3e8abd['body']['id']},'transaction':_0x4c80c8})[_0x519c('0x21')](function(_0x582ff1){return db[_0x519c('0x9f')][_0x519c('0x85')](createExtensionsReciveFax(_[_0x519c('0x72')](_0x3e8abd[_0x519c('0x63')],['tech','key','createdAt',_0x519c('0xa1'),'TrunkId','ListId'])),{'transaction':_0x4c80c8});});});})[_0x519c('0x21')](function(){return db['FaxAccount'][_0x519c('0xa2')](_0x3e8abd[_0x519c('0x63')]['id']);})[_0x519c('0x21')](respondWithResult(_0x94657f,null))[_0x519c('0x2b')](handleError(_0x94657f,null));};exports['getMessages']=function(_0xc048a9,_0x84d9a,_0x574373){var _0x1d1a30={'raw':!![],'where':{}};var _0x2c3fa2={};var _0x2b7ba0={'count':0x0,'rows':[]};return db[_0x519c('0x40')][_0x519c('0x68')]({'where':{'id':_0xc048a9['params']['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x84d9a,null))[_0x519c('0x21')](function(_0x12eda2){if(_0x12eda2){_0x2c3fa2['model']=_[_0x519c('0x47')](db[_0x519c('0xa3')][_0x519c('0x5a')]);_0x2c3fa2[_0x519c('0x46')]=_[_0x519c('0x47')](_0xc048a9[_0x519c('0x46')]);_0x2c3fa2[_0x519c('0x48')]=_[_0x519c('0x49')](_0x2c3fa2[_0x519c('0x44')],_0x2c3fa2[_0x519c('0x46')]);_0x1d1a30[_0x519c('0x4a')]=_[_0x519c('0x49')](_0x2c3fa2['model'],qs[_0x519c('0x4b')](_0xc048a9['query'][_0x519c('0x4b')]));_0x1d1a30[_0x519c('0x4a')]=_0x1d1a30['attributes']['length']?_0x1d1a30[_0x519c('0x4a')]:_0x2c3fa2[_0x519c('0x44')];if(!_0xc048a9[_0x519c('0x46')][_0x519c('0x6e')](_0x519c('0x4d'))){_0x1d1a30[_0x519c('0x31')]=qs[_0x519c('0x31')](_0xc048a9[_0x519c('0x46')][_0x519c('0x31')]);_0x1d1a30[_0x519c('0x2f')]=qs[_0x519c('0x2f')](_0xc048a9[_0x519c('0x46')][_0x519c('0x2f')]);}_0x1d1a30[_0x519c('0x4e')]=qs[_0x519c('0x4f')](_0xc048a9['query'][_0x519c('0x4f')]);_0x1d1a30[_0x519c('0x50')]=qs[_0x519c('0x48')](_[_0x519c('0x69')](_0xc048a9[_0x519c('0x46')],_0x2c3fa2[_0x519c('0x48')]));_0x1d1a30[_0x519c('0x50')][_0x519c('0x66')]=_0x12eda2['id'];if(_0xc048a9[_0x519c('0x46')][_0x519c('0x51')]){_0x1d1a30[_0x519c('0x50')]=_[_0x519c('0x52')](_0x1d1a30[_0x519c('0x50')],{'$or':_[_0x519c('0x45')](_0x1d1a30[_0x519c('0x4a')],function(_0x1f7c77){var _0x20de1b={};_0x20de1b[_0x1f7c77]={'$like':'%'+_0xc048a9[_0x519c('0x46')]['filter']+'%'};return _0x20de1b;})});}if(_0xc048a9['query'][_0x519c('0xa4')]){var _0x257ca7=_0xc048a9[_0x519c('0x46')][_0x519c('0xa4')]['split'](',');var _0x765e18={};_0x765e18[_0x257ca7[0x0]]={'$gte':moment(_0x257ca7[0x1])['format'](_0x519c('0xa5'))};_0x1d1a30[_0x519c('0x50')]=_[_0x519c('0x52')](_0x1d1a30[_0x519c('0x50')],_0x765e18);}_0x1d1a30=_[_0x519c('0x52')]({},_0x1d1a30,_0xc048a9['options']);return db[_0x519c('0xa3')][_0x519c('0x32')]({'where':_0x1d1a30['where']})[_0x519c('0x21')](function(_0x301997){_0x2b7ba0[_0x519c('0x32')]=_0x301997;if(_0xc048a9['query'][_0x519c('0x55')]){_0x1d1a30[_0x519c('0x56')]=[{'all':!![]}];}return db[_0x519c('0xa3')][_0x519c('0x57')](_0x1d1a30);})['then'](function(_0xf9b389){_0x2b7ba0[_0x519c('0x6a')]=_0xf9b389;return _0x2b7ba0;});}})['then'](respondWithFilteredResult(_0x84d9a,_0x1d1a30))[_0x519c('0x2b')](handleError(_0x84d9a,null));};exports[_0x519c('0x3d')]=function(_0x16bf47,_0x5f4219,_0x1f36a){var _0x4da9db,_0x4b9f81={},_0x158741;if(_0x16bf47['body']['to']){_0x158741=_0x16bf47[_0x519c('0x63')]['to'][0x0];}return db[_0x519c('0x40')][_0x519c('0x60')]({'where':{'id':_0x16bf47[_0x519c('0x59')]['id']},'include':[{'model':db[_0x519c('0xa6')],'as':_0x519c('0xa7'),'include':[{'model':db[_0x519c('0x75')],'as':_0x519c('0xa8'),'where':{'fax':_0x158741},'limit':0x1,'order':[[_0x519c('0xa1'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5f4219,null))[_0x519c('0x21')](function(_0x1c9e94){_0x4da9db=_0x1c9e94;if(_0x16bf47['body'][_0x519c('0xa9')]&&_0x16bf47[_0x519c('0x63')][_0x519c('0xa9')][_0x519c('0x4c')]){for(var _0x2f918a=0x0;_0x2f918a<_0x16bf47[_0x519c('0x63')][_0x519c('0xa9')]['length'];_0x2f918a+=0x1){_0x16bf47[_0x519c('0x63')]['attachments'][_0x2f918a]={'filename':_0x16bf47['body'][_0x519c('0xa9')][_0x2f918a][_0x519c('0x3c')],'id':_0x16bf47[_0x519c('0x63')]['attachments'][_0x2f918a]['id'],'path':path[_0x519c('0xaa')](config['root'],'server/files/attachments',_0x16bf47[_0x519c('0x63')][_0x519c('0xa9')][_0x2f918a]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x519c('0xab'),{'FaxAccountId':_[_0x519c('0xac')](_0x16bf47[_0x519c('0x59')]['id'])?undefined:_0x16bf47[_0x519c('0x59')]['id'],'path':_[_0x519c('0xac')](_0x16bf47['body']['attachments'][0x0][_0x519c('0x5')])?undefined:_0x16bf47['body'][_0x519c('0xa9')][0x0][_0x519c('0x5')],'fax':_[_0x519c('0xac')](_0x16bf47[_0x519c('0x63')]['to'][0x0])?undefined:_0x16bf47[_0x519c('0x63')]['to'][0x0]},client9002);})[_0x519c('0x21')](function(){if(_0x4da9db){if(_[_0x519c('0xac')](_0x16bf47['body'][_0x519c('0xad')])){_0x16bf47[_0x519c('0x63')][_0x519c('0xad')]=util[_0x519c('0xae')](_0x519c('0xaf'),_0x4da9db['name'],_0x4da9db[_0x519c('0xb0')]);}if(_0x4da9db['List']){if(_0x4da9db[_0x519c('0xa7')]['Contacts'][_0x519c('0x4c')]){return _0x4da9db[_0x519c('0xa7')][_0x519c('0xa8')][0x0];}else{return db[_0x519c('0x75')][_0x519c('0x5b')](_['defaults'](_0x16bf47[_0x519c('0x63')],{'firstName':_0x16bf47[_0x519c('0x63')]['to'][0x0],'phone':_0x16bf47[_0x519c('0x63')]['to'][0x0],'fax':_0x16bf47[_0x519c('0x63')]['to'][0x0],'ListId':_0x4da9db[_0x519c('0xb1')]}));}}else{throw new Error(_0x519c('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x519c('0x21')](function(_0x397cae){if(_0x397cae){return db[_0x519c('0x74')]['find']({'where':{'ContactId':_0x397cae['id'],'closed':![],'FaxAccountId':_0x4da9db['id']}})[_0x519c('0x21')](function(_0x4dcda7){if(_0x4dcda7){return[_0x4dcda7,![]];}return db[_0x519c('0x74')][_0x519c('0x5b')]({'UserId':_0x16bf47[_0x519c('0x5c')]['id'],'ContactId':_0x397cae['id'],'FaxAccountId':_0x4da9db['id'],'fax':_0x16bf47[_0x519c('0x63')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x519c('0x52')](_0x16bf47[_0x519c('0x63')],{'read':![],'body':_0x16bf47[_0x519c('0x63')][_0x519c('0xa9')][0x0][_0x519c('0xb3')],'FaxAccountId':_0x4da9db['id'],'UserId':_0x16bf47[_0x519c('0x5c')]['id'],'ContactId':_0x397cae['id'],'AttachmentId':_0x16bf47[_0x519c('0x63')][_0x519c('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x519c('0xa3')],'as':_0x519c('0xb4')}]})['then'](function(_0x46cdf7){return[_0x46cdf7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x3f4699,_0x162eec){if(_0x162eec){return _0x3f4699;}return db['FaxMessage'][_0x519c('0x5b')]({'direction':'out','read':![],'body':_0x16bf47['body']['attachments'][0x0][_0x519c('0xb3')],'FaxAccountId':_0x4da9db['id'],'FaxInteractionId':_0x3f4699['id'],'UserId':_0x16bf47[_0x519c('0x5c')]['id'],'ContactId':_0x3f4699[_0x519c('0xb5')],'AttachmentId':_0x16bf47[_0x519c('0x63')][_0x519c('0xa9')][0x0]['id']})[_0x519c('0x21')](function(_0x53bc81){_0x3f4699['dataValues'][_0x519c('0xb4')]=[];_0x3f4699[_0x519c('0xb6')][_0x519c('0xb4')][_0x519c('0x91')](_0x53bc81[_0x519c('0xb6')]);return _0x3f4699;});})[_0x519c('0x21')](function(_0x2a1620){respondWithRpcPromise(_0x519c('0xb7'),_0x519c('0xb7'),{'FaxAccountId':_['isNil'](_0x16bf47['params']['id'])?undefined:_0x16bf47['params']['id'],'path':_[_0x519c('0xac')](_0x16bf47[_0x519c('0x63')][_0x519c('0xa9')][0x0][_0x519c('0x5')])?undefined:_0x16bf47[_0x519c('0x63')]['attachments'][0x0]['path'],'fax':_[_0x519c('0xac')](_0x16bf47[_0x519c('0x63')]['to'][0x0])?undefined:_0x16bf47[_0x519c('0x63')]['to'][0x0],'AttachmentId':_0x16bf47[_0x519c('0x63')]['attachments'][0x0]['id']},client9002)[_0x519c('0x21')](function(_0x20f4d4){logger['info'](_0x519c('0xb8'),_0x20f4d4);})[_0x519c('0x2b')](function(_0x4c6cab){logger[_0x519c('0x22')](_0x519c('0xb8'),_0x4c6cab);});return _0x2a1620;})[_0x519c('0x21')](respondWithResult(_0x5f4219,null))['catch'](handleError(_0x5f4219,null));};exports[_0x519c('0xb9')]=function(_0x50d86f,_0xce7426,_0x3b2b25){return db[_0x519c('0x40')]['find']({'where':{'id':_0x50d86f['params']['id']}})[_0x519c('0x21')](handleEntityNotFound(_0xce7426,null))[_0x519c('0x21')](function(_0x21f963){if(_0x21f963){return _0x21f963['addAgents'](_0x50d86f['body'][_0x519c('0x6b')],_['omit'](_0x50d86f['body'],[_0x519c('0x6b'),'id'])||{})['spread'](function(_0x3a8371){for(var _0x27558a=0x0;_0x27558a<_0x50d86f[_0x519c('0x63')][_0x519c('0x6b')][_0x519c('0x4c')];_0x27558a+=0x1){socket[_0x519c('0xba')](_0x519c('0xbb'),{'UserId':Number(_0x50d86f[_0x519c('0x63')]['ids'][_0x27558a]),'FaxAccountId':Number(_0x50d86f['params']['id'])});}return _0x3a8371;});}})[_0x519c('0x21')](respondWithResult(_0xce7426,null))[_0x519c('0x2b')](handleError(_0xce7426,null));};exports[_0x519c('0xbc')]=function(_0x4a0257,_0x350dfc,_0x5ab34e){return db[_0x519c('0x40')][_0x519c('0x60')]({'where':{'id':_0x4a0257[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x350dfc,null))[_0x519c('0x21')](function(_0x45d913){if(_0x45d913){return _0x45d913[_0x519c('0xbc')](_0x4a0257[_0x519c('0x46')][_0x519c('0x6b')])['then'](function(){if(_[_0x519c('0xbd')](_0x4a0257['query'][_0x519c('0x6b')])){for(var _0x48a4f6=0x0;_0x48a4f6<_0x4a0257[_0x519c('0x46')]['ids'][_0x519c('0x4c')];_0x48a4f6+=0x1){socket[_0x519c('0xba')](_0x519c('0xbe'),{'UserId':Number(_0x4a0257[_0x519c('0x46')]['ids'][_0x48a4f6]),'FaxAccountId':Number(_0x4a0257[_0x519c('0x59')]['id'])});}}else{socket[_0x519c('0xba')](_0x519c('0xbe'),{'UserId':Number(_0x4a0257['query'][_0x519c('0x6b')]),'FaxAccountId':Number(_0x4a0257[_0x519c('0x59')]['id'])});}});}})[_0x519c('0x21')](respondWithStatusCode(_0x350dfc,null))[_0x519c('0x2b')](handleError(_0x350dfc,null));};exports[_0x519c('0xbf')]=function(_0xe80b8f,_0x1dc459,_0x393fe4){var _0x1075c2={};var _0xce06b8={};var _0x9193ee;var _0x489fb7;return db[_0x519c('0x40')][_0x519c('0x68')]({'where':{'id':_0xe80b8f[_0x519c('0x59')]['id']}})[_0x519c('0x21')](handleEntityNotFound(_0x1dc459,null))[_0x519c('0x21')](function(_0xa1e0b2){if(_0xa1e0b2){_0x9193ee=_0xa1e0b2;_0xce06b8[_0x519c('0x44')]=_[_0x519c('0x47')](db['User'][_0x519c('0x5a')]);_0xce06b8[_0x519c('0x46')]=_[_0x519c('0x47')](_0xe80b8f[_0x519c('0x46')]);_0xce06b8[_0x519c('0x48')]=_[_0x519c('0x49')](_0xce06b8[_0x519c('0x44')],_0xce06b8[_0x519c('0x46')]);_0x1075c2['attributes']=_[_0x519c('0x49')](_0xce06b8[_0x519c('0x44')],qs[_0x519c('0x4b')](_0xe80b8f['query'][_0x519c('0x4b')]));_0x1075c2['attributes']=_0x1075c2[_0x519c('0x4a')]['length']?_0x1075c2['attributes']:_0xce06b8[_0x519c('0x44')];_0x1075c2[_0x519c('0x4e')]=qs['sort'](_0xe80b8f[_0x519c('0x46')]['sort']);_0x1075c2[_0x519c('0x50')]=qs[_0x519c('0x48')](_[_0x519c('0x69')](_0xe80b8f[_0x519c('0x46')],_0xce06b8[_0x519c('0x48')]));if(_0xe80b8f[_0x519c('0x46')][_0x519c('0x51')]){_0x1075c2[_0x519c('0x50')]=_[_0x519c('0x52')](_0x1075c2[_0x519c('0x50')],{'$or':_[_0x519c('0x45')](_0x1075c2[_0x519c('0x4a')],function(_0x4bf7c5){var _0x5ae4df={};_0x5ae4df[_0x4bf7c5]={'$like':'%'+_0xe80b8f[_0x519c('0x46')][_0x519c('0x51')]+'%'};return _0x5ae4df;})});}_0x1075c2=_[_0x519c('0x52')]({},_0x1075c2,_0xe80b8f[_0x519c('0x54')]);return _0x9193ee[_0x519c('0xbf')](_0x1075c2);}})[_0x519c('0x21')](function(_0x32b94f){if(_0x32b94f){_0x489fb7=_0x32b94f['length'];if(!_0xe80b8f[_0x519c('0x46')]['hasOwnProperty']('nolimit')){_0x1075c2[_0x519c('0x31')]=qs[_0x519c('0x31')](_0xe80b8f[_0x519c('0x46')]['limit']);_0x1075c2[_0x519c('0x2f')]=qs[_0x519c('0x2f')](_0xe80b8f[_0x519c('0x46')][_0x519c('0x2f')]);}return _0x9193ee[_0x519c('0xbf')](_0x1075c2);}})['then'](function(_0x423100){if(_0x423100){return _0x423100?{'count':_0x489fb7,'rows':_0x423100}:null;}})[_0x519c('0x21')](respondWithResult(_0x1dc459,null))[_0x519c('0x2b')](handleError(_0x1dc459,null));}; \ No newline at end of file +var _0x570e=['CmList','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','FaxAccount','includeAll','findAll','rows','show','params','keys','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','FaxAccountId','getDispositions','findOne','include','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','fullname','internal','Tags','color','tag','transaction','sequelize','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','appdata','Answer','push','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Set','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','updateAccountApplications','VoiceExtension','key','createdAt','updatedAt','TrunkId','findById','getMessages','$gte','split','format','FaxMessage'];(function(_0x168a8b,_0x58be26){var _0x33f6a6=function(_0x5dc1df){while(--_0x5dc1df){_0x168a8b['push'](_0x168a8b['shift']());}};_0x33f6a6(++_0x58be26);}(_0x570e,0x1af));var _0xe570=function(_0x20ebf7,_0x6dc038){_0x20ebf7=_0x20ebf7-0x0;var _0x15ca11=_0x570e[_0x20ebf7];return _0x15ca11;};'use strict';var emlformat=require(_0xe570('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe570('0x1'));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(_0xe570('0xa'));var fs=require('fs');var fs_extra=require(_0xe570('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe570('0xc'));var jsforce=require(_0xe570('0xd'));var deskjs=require(_0xe570('0xe'));var toCsv=require(_0xe570('0x9'));var querystring=require(_0xe570('0xf'));var Papa=require('papaparse');var Redis=require(_0xe570('0x10'));var authService=require(_0xe570('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe570('0x12'));var hardwareService=require(_0xe570('0x13'));var logger=require(_0xe570('0x14'))('api');var utils=require(_0xe570('0x15'));var config=require(_0xe570('0x16'));var licenseUtil=require(_0xe570('0x17'));var db=require(_0xe570('0x18'))['db'];config[_0xe570('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe570('0x1a'))(new Redis(config[_0xe570('0x19')]));require(_0xe570('0x1b'))[_0xe570('0x1c')](socket);var jayson=require(_0xe570('0x1d'));var client=jayson['client'][_0xe570('0x1e')]({'port':0x232c});var client9002=jayson[_0xe570('0x1f')][_0xe570('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1045de,_0x2e9759,_0x315f0e,_0x29b3c6){return new BPromise(function(_0x108c69,_0x24b8eb){var _0x261551=_0x29b3c6||client;return _0x261551['request'](_0x1045de,_0x315f0e)[_0xe570('0x20')](function(_0x27bab2){logger[_0xe570('0x21')]('FaxAccount,\x20%s,\x20%s',_0x2e9759,_0xe570('0x22'));logger[_0xe570('0x23')](_0xe570('0x24'),_0x2e9759,_0xe570('0x22'),JSON[_0xe570('0x25')](_0x27bab2));if(_0x27bab2['error']){if(_0x27bab2[_0xe570('0x26')][_0xe570('0x27')]===0x1f4){logger[_0xe570('0x26')](_0xe570('0x28'),_0x2e9759,_0x27bab2[_0xe570('0x26')][_0xe570('0x29')]);return _0x24b8eb(_0x27bab2[_0xe570('0x26')][_0xe570('0x29')]);}logger[_0xe570('0x26')](_0xe570('0x28'),_0x2e9759,_0x27bab2[_0xe570('0x26')][_0xe570('0x29')]);return _0x108c69(_0x27bab2[_0xe570('0x26')][_0xe570('0x29')]);}else{logger[_0xe570('0x21')](_0xe570('0x28'),_0x2e9759,_0xe570('0x22'));_0x108c69(_0x27bab2[_0xe570('0x2a')][_0xe570('0x29')]);}})[_0xe570('0x2b')](function(_0x6ad5f9){logger[_0xe570('0x26')](_0xe570('0x28'),_0x2e9759,_0x6ad5f9);_0x24b8eb(_0x6ad5f9);});});}function respondWithStatusCode(_0x4f985b,_0x5db1e7){_0x5db1e7=_0x5db1e7||0xcc;return function(_0x5e010f){if(_0x5e010f){return _0x4f985b['sendStatus'](_0x5db1e7);}return _0x4f985b[_0xe570('0x2c')](_0x5db1e7)[_0xe570('0x2d')]();};}function respondWithResult(_0xde9f67,_0x5c7574){_0x5c7574=_0x5c7574||0xc8;return function(_0x23e774){if(_0x23e774){return _0xde9f67[_0xe570('0x2c')](_0x5c7574)[_0xe570('0x2e')](_0x23e774);}};}function respondWithFilteredResult(_0x160b5f,_0x3260ea){return function(_0x49a683){if(_0x49a683){var _0x411d2a=typeof _0x3260ea['offset']===_0xe570('0x2f')&&typeof _0x3260ea[_0xe570('0x30')]===_0xe570('0x2f');var _0x4e98d8=_0x49a683[_0xe570('0x31')];var _0x4cedbd=_0x411d2a?0x0:_0x3260ea[_0xe570('0x32')];var _0x8a402f=_0x411d2a?_0x49a683['count']:_0x3260ea[_0xe570('0x32')]+_0x3260ea[_0xe570('0x30')];var _0x29a199;if(_0x8a402f>=_0x4e98d8){_0x8a402f=_0x4e98d8;_0x29a199=0xc8;}else{_0x29a199=0xce;}_0x160b5f[_0xe570('0x2c')](_0x29a199);return _0x160b5f[_0xe570('0x33')](_0xe570('0x34'),_0x4cedbd+'-'+_0x8a402f+'/'+_0x4e98d8)[_0xe570('0x2e')](_0x49a683);}return null;};}function patchUpdates(_0x243ddb){return function(_0x477c7a){try{jsonpatch[_0xe570('0x35')](_0x477c7a,_0x243ddb,!![]);}catch(_0x233a4a){return BPromise[_0xe570('0x36')](_0x233a4a);}return _0x477c7a[_0xe570('0x37')]();};}function saveUpdates(_0x1314d4,_0x1a7650){return function(_0x5e3c3a){if(_0x5e3c3a){return _0x5e3c3a[_0xe570('0x38')](_0x1314d4)[_0xe570('0x20')](function(_0x46f7df){return _0x46f7df;});}return null;};}function removeEntity(_0x222fb4,_0x55e49f){return function(_0x275102){if(_0x275102){return _0x275102[_0xe570('0x39')]()[_0xe570('0x20')](function(){var _0x49347c=_0x275102[_0xe570('0x3a')]({'plain':!![]});var _0x38fb02=_0xe570('0x3b');return db[_0xe570('0x3c')][_0xe570('0x39')]({'where':{'type':_0x38fb02,'resourceId':_0x49347c['id']}})[_0xe570('0x20')](function(){return _0x275102;});})[_0xe570('0x20')](function(){_0x222fb4[_0xe570('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x358e84,_0x2f0043){return function(_0x5be274){if(!_0x5be274){_0x358e84[_0xe570('0x3d')](0x194);}return _0x5be274;};}function handleError(_0x2b6f47,_0x310b8c){_0x310b8c=_0x310b8c||0x1f4;return function(_0xf3ab2e){logger[_0xe570('0x26')](_0xf3ab2e['stack']);if(_0xf3ab2e[_0xe570('0x3e')]){delete _0xf3ab2e[_0xe570('0x3e')];}_0x2b6f47[_0xe570('0x2c')](_0x310b8c)[_0xe570('0x3f')](_0xf3ab2e);};}exports[_0xe570('0x40')]=function(_0x5346d6,_0x388439){var _0x55e28a={'include':[{'model':db[_0xe570('0x41')],'as':_0xe570('0x42')}]},_0x2f8190={},_0x88af7b={'count':0x0,'rows':[]};var _0x28bf19=_[_0xe570('0x43')](db['FaxAccount'][_0xe570('0x44')],function(_0x19c088){return{'name':_0x19c088[_0xe570('0x45')],'type':_0x19c088[_0xe570('0x46')]['key']};});_0x2f8190[_0xe570('0x47')]=_[_0xe570('0x43')](_0x28bf19,'name');_0x2f8190[_0xe570('0x48')]=_['keys'](_0x5346d6[_0xe570('0x48')]);_0x2f8190[_0xe570('0x49')]=_[_0xe570('0x4a')](_0x2f8190[_0xe570('0x47')],_0x2f8190['query']);_0x55e28a['attributes']=_['intersection'](_0x2f8190['model'],qs['fields'](_0x5346d6[_0xe570('0x48')]['fields']));_0x55e28a[_0xe570('0x4b')]=_0x55e28a[_0xe570('0x4b')][_0xe570('0x4c')]?_0x55e28a[_0xe570('0x4b')]:_0x2f8190[_0xe570('0x47')];if(!_0x5346d6[_0xe570('0x48')][_0xe570('0x4d')](_0xe570('0x4e'))){_0x55e28a['limit']=qs[_0xe570('0x30')](_0x5346d6['query'][_0xe570('0x30')]);_0x55e28a[_0xe570('0x32')]=qs['offset'](_0x5346d6[_0xe570('0x48')]['offset']);}_0x55e28a[_0xe570('0x4f')]=qs[_0xe570('0x50')](_0x5346d6[_0xe570('0x48')]['sort']);_0x55e28a[_0xe570('0x51')]=qs[_0xe570('0x49')](_[_0xe570('0x52')](_0x5346d6[_0xe570('0x48')],_0x2f8190['filters']),_0x28bf19);if(_0x5346d6[_0xe570('0x48')][_0xe570('0x53')]){_0x55e28a['where']=_[_0xe570('0x54')](_0x55e28a[_0xe570('0x51')],{'$or':_[_0xe570('0x43')](_0x28bf19,function(_0x2299e2){if(_0x2299e2[_0xe570('0x46')]!==_0xe570('0x55')){var _0x33cd30={};_0x33cd30[_0x2299e2['name']]={'$like':'%'+_0x5346d6['query'][_0xe570('0x53')]+'%'};return _0x33cd30;}})});}_0x55e28a=_[_0xe570('0x54')]({},_0x55e28a,_0x5346d6['options']);var _0xee4ab2={'where':_0x55e28a[_0xe570('0x51')]};return db[_0xe570('0x56')][_0xe570('0x31')](_0xee4ab2)[_0xe570('0x20')](function(_0x58d910){_0x88af7b['count']=_0x58d910;if(_0x5346d6['query'][_0xe570('0x57')]){_0x55e28a['include']=[{'all':!![]}];}return db[_0xe570('0x56')][_0xe570('0x58')](_0x55e28a);})[_0xe570('0x20')](function(_0x4a465d){_0x88af7b[_0xe570('0x59')]=_0x4a465d;return _0x88af7b;})[_0xe570('0x20')](respondWithFilteredResult(_0x388439,_0x55e28a))[_0xe570('0x2b')](handleError(_0x388439,null));};exports[_0xe570('0x5a')]=function(_0xd7852c,_0xdbeae1){var _0x2a2cb5={'raw':![],'where':{'id':_0xd7852c[_0xe570('0x5b')]['id']},'include':[{'model':db[_0xe570('0x41')],'as':_0xe570('0x42')}]},_0x2e35d3={};_0x2e35d3[_0xe570('0x47')]=_[_0xe570('0x5c')](db['FaxAccount'][_0xe570('0x44')]);_0x2e35d3[_0xe570('0x48')]=_[_0xe570('0x5c')](_0xd7852c[_0xe570('0x48')]);_0x2e35d3[_0xe570('0x49')]=_[_0xe570('0x4a')](_0x2e35d3['model'],_0x2e35d3[_0xe570('0x48')]);_0x2a2cb5[_0xe570('0x4b')]=_[_0xe570('0x4a')](_0x2e35d3[_0xe570('0x47')],qs[_0xe570('0x5d')](_0xd7852c[_0xe570('0x48')][_0xe570('0x5d')]));_0x2a2cb5[_0xe570('0x4b')]=_0x2a2cb5['attributes']['length']?_0x2a2cb5[_0xe570('0x4b')]:_0x2e35d3[_0xe570('0x47')];if(_0xd7852c[_0xe570('0x48')][_0xe570('0x57')]){_0x2a2cb5['include']=[{'all':!![]}];}_0x2a2cb5=_['merge']({},_0x2a2cb5,_0xd7852c[_0xe570('0x5e')]);return db[_0xe570('0x56')][_0xe570('0x5f')](_0x2a2cb5)['then'](handleEntityNotFound(_0xdbeae1,null))[_0xe570('0x20')](respondWithResult(_0xdbeae1,null))['catch'](handleError(_0xdbeae1,null));};exports['create']=function(_0x1c7121,_0x4c9ae9){return db[_0xe570('0x56')][_0xe570('0x60')](_0x1c7121[_0xe570('0x61')],{})[_0xe570('0x20')](function(_0x2b6aa0){var _0x34790b=_0x1c7121[_0xe570('0x62')][_0xe570('0x3a')]({'plain':!![]});if(!_0x34790b)throw new Error(_0xe570('0x63'));if(_0x34790b['role']===_0xe570('0x62')){var _0xe58351=_0x2b6aa0['get']({'plain':!![]});var _0x5c14db=_0xe570('0x3b');return db[_0xe570('0x64')][_0xe570('0x5f')]({'where':{'name':_0x5c14db,'userProfileId':_0x34790b[_0xe570('0x65')]},'raw':!![]})[_0xe570('0x20')](function(_0x51d6b2){if(_0x51d6b2&&_0x51d6b2[_0xe570('0x66')]===0x0){return db[_0xe570('0x3c')]['create']({'name':_0xe58351[_0xe570('0x3e')],'resourceId':_0xe58351['id'],'type':_0x51d6b2['name'],'sectionId':_0x51d6b2['id']},{})[_0xe570('0x20')](function(){return _0x2b6aa0;});}else{return _0x2b6aa0;}})['catch'](function(_0xadc267){logger[_0xe570('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xadc267);throw _0xadc267;});}return _0x2b6aa0;})[_0xe570('0x20')](respondWithResult(_0x4c9ae9,0xc9))[_0xe570('0x2b')](handleError(_0x4c9ae9,null));};exports[_0xe570('0x38')]=function(_0xe89d5c,_0x2819ae){if(_0xe89d5c['body']['id']){delete _0xe89d5c[_0xe570('0x61')]['id'];}return db['FaxAccount'][_0xe570('0x5f')]({'where':{'id':_0xe89d5c[_0xe570('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0xe570('0x42')}]})[_0xe570('0x20')](handleEntityNotFound(_0x2819ae,null))['then'](saveUpdates(_0xe89d5c[_0xe570('0x61')],null))[_0xe570('0x20')](respondWithResult(_0x2819ae,null))[_0xe570('0x2b')](handleError(_0x2819ae,null));};exports[_0xe570('0x39')]=function(_0x3202eb,_0x20f8dc){return db['FaxAccount'][_0xe570('0x5f')]({'where':{'id':_0x3202eb[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x20f8dc,null))[_0xe570('0x20')](removeEntity(_0x20f8dc,null))[_0xe570('0x2b')](handleError(_0x20f8dc,null));};exports['describe']=function(_0x47340f,_0xd16bf){return db[_0xe570('0x56')][_0xe570('0x67')]()[_0xe570('0x20')](respondWithResult(_0xd16bf,null))[_0xe570('0x2b')](handleError(_0xd16bf,null));};exports[_0xe570('0x68')]=function(_0x30929a,_0x296891,_0x47b5f7){if(_0x30929a['body']['id']){delete _0x30929a['body']['id'];}return db['FaxAccount'][_0xe570('0x5f')]({'where':{'id':_0x30929a[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x296891,null))['then'](function(_0x4a4752){if(_0x4a4752){_0x30929a[_0xe570('0x61')][_0xe570('0x69')]=_0x4a4752['id'];return db['Disposition']['create'](_0x30929a[_0xe570('0x61')]);}})['then'](respondWithResult(_0x296891,null))[_0xe570('0x2b')](handleError(_0x296891,null));};exports[_0xe570('0x6a')]=function(_0x3468f3,_0xe8938b,_0x6cdeb6){var _0x5bdc71={'raw':![],'where':{}};var _0x56a98f={};var _0x4984f1={'count':0x0,'rows':[]};return db[_0xe570('0x56')][_0xe570('0x6b')]({'where':{'id':_0x3468f3[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0xe8938b,null))[_0xe570('0x20')](function(_0x2c1a06){if(_0x2c1a06){_0x56a98f['model']=_[_0xe570('0x5c')](db['Disposition']['rawAttributes']);_0x56a98f[_0xe570('0x48')]=_[_0xe570('0x5c')](_0x3468f3[_0xe570('0x48')]);_0x56a98f[_0xe570('0x49')]=_['intersection'](_0x56a98f[_0xe570('0x47')],_0x56a98f['query']);_0x5bdc71[_0xe570('0x4b')]=_[_0xe570('0x4a')](_0x56a98f['model'],qs[_0xe570('0x5d')](_0x3468f3['query'][_0xe570('0x5d')]));_0x5bdc71[_0xe570('0x4b')]=_0x5bdc71[_0xe570('0x4b')]['length']?_0x5bdc71[_0xe570('0x4b')]:_0x56a98f[_0xe570('0x47')];if(!_0x3468f3[_0xe570('0x48')][_0xe570('0x4d')](_0xe570('0x4e'))){_0x5bdc71['limit']=qs[_0xe570('0x30')](_0x3468f3[_0xe570('0x48')][_0xe570('0x30')]);_0x5bdc71[_0xe570('0x32')]=qs[_0xe570('0x32')](_0x3468f3[_0xe570('0x48')][_0xe570('0x32')]);}_0x5bdc71[_0xe570('0x4f')]=qs['sort'](_0x3468f3[_0xe570('0x48')][_0xe570('0x50')]);_0x5bdc71[_0xe570('0x51')]=qs[_0xe570('0x49')](_[_0xe570('0x52')](_0x3468f3[_0xe570('0x48')],_0x56a98f[_0xe570('0x49')]));_0x5bdc71[_0xe570('0x51')][_0xe570('0x69')]=_0x2c1a06['id'];if(_0x3468f3[_0xe570('0x48')][_0xe570('0x53')]){_0x5bdc71[_0xe570('0x51')]=_[_0xe570('0x54')](_0x5bdc71[_0xe570('0x51')],{'$or':_[_0xe570('0x43')](_0x5bdc71[_0xe570('0x4b')],function(_0x1c7377){var _0x2b2ff6={};_0x2b2ff6[_0x1c7377]={'$like':'%'+_0x3468f3['query'][_0xe570('0x53')]+'%'};return _0x2b2ff6;})});}_0x5bdc71=_[_0xe570('0x54')]({},_0x5bdc71,_0x3468f3['options']);return db['Disposition']['count']({'where':_0x5bdc71[_0xe570('0x51')]})[_0xe570('0x20')](function(_0x541ac4){_0x4984f1[_0xe570('0x31')]=_0x541ac4;if(_0x3468f3['query'][_0xe570('0x57')]){_0x5bdc71[_0xe570('0x6c')]=[{'all':!![]}];}return db[_0xe570('0x6d')][_0xe570('0x58')](_0x5bdc71);})['then'](function(_0x134bc0){_0x4984f1[_0xe570('0x59')]=_0x134bc0;return _0x4984f1;});}})[_0xe570('0x20')](respondWithFilteredResult(_0xe8938b,_0x5bdc71))[_0xe570('0x2b')](handleError(_0xe8938b,null));};exports[_0xe570('0x6e')]=function(_0x395755,_0x41b7b1,_0x13b9db){return db[_0xe570('0x56')][_0xe570('0x5f')]({'where':{'id':_0x395755[_0xe570('0x5b')]['id']}})['then'](handleEntityNotFound(_0x41b7b1,null))[_0xe570('0x20')](function(_0x2c1c79){if(_0x2c1c79){return _0x2c1c79['removeDispositions'](_0x395755[_0xe570('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x41b7b1,null))[_0xe570('0x2b')](handleError(_0x41b7b1,null));};exports[_0xe570('0x6f')]=function(_0x487589,_0x45ceae,_0x1a8001){if(_0x487589[_0xe570('0x61')]['id']){delete _0x487589[_0xe570('0x61')]['id'];}return db[_0xe570('0x56')][_0xe570('0x5f')]({'where':{'id':_0x487589[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x45ceae,null))['then'](function(_0x31998e){if(_0x31998e){_0x487589['body']['FaxAccountId']=_0x31998e['id'];return db[_0xe570('0x70')][_0xe570('0x60')](_0x487589[_0xe570('0x61')]);}})[_0xe570('0x20')](respondWithResult(_0x45ceae,null))[_0xe570('0x2b')](handleError(_0x45ceae,null));};exports[_0xe570('0x71')]=function(_0x2bd908,_0x120a43,_0x1f69fa){var _0x3b9c34={'raw':![],'where':{}};var _0x29f18d={};var _0x4e36f1={'count':0x0,'rows':[]};return db[_0xe570('0x56')][_0xe570('0x6b')]({'where':{'id':_0x2bd908[_0xe570('0x5b')]['id']}})['then'](handleEntityNotFound(_0x120a43,null))['then'](function(_0x59583d){if(_0x59583d){_0x29f18d[_0xe570('0x47')]=_['keys'](db[_0xe570('0x70')][_0xe570('0x44')]);_0x29f18d['query']=_[_0xe570('0x5c')](_0x2bd908[_0xe570('0x48')]);_0x29f18d[_0xe570('0x49')]=_['intersection'](_0x29f18d['model'],_0x29f18d['query']);_0x3b9c34[_0xe570('0x4b')]=_['intersection'](_0x29f18d[_0xe570('0x47')],qs[_0xe570('0x5d')](_0x2bd908[_0xe570('0x48')]['fields']));_0x3b9c34[_0xe570('0x4b')]=_0x3b9c34['attributes']['length']?_0x3b9c34[_0xe570('0x4b')]:_0x29f18d[_0xe570('0x47')];if(!_0x2bd908[_0xe570('0x48')][_0xe570('0x4d')](_0xe570('0x4e'))){_0x3b9c34['limit']=qs[_0xe570('0x30')](_0x2bd908[_0xe570('0x48')][_0xe570('0x30')]);_0x3b9c34[_0xe570('0x32')]=qs[_0xe570('0x32')](_0x2bd908[_0xe570('0x48')][_0xe570('0x32')]);}_0x3b9c34['order']=qs[_0xe570('0x50')](_0x2bd908[_0xe570('0x48')][_0xe570('0x50')]);_0x3b9c34['where']=qs[_0xe570('0x49')](_['pick'](_0x2bd908[_0xe570('0x48')],_0x29f18d[_0xe570('0x49')]));_0x3b9c34[_0xe570('0x51')][_0xe570('0x69')]=_0x59583d['id'];if(_0x2bd908[_0xe570('0x48')][_0xe570('0x53')]){_0x3b9c34['where']=_[_0xe570('0x54')](_0x3b9c34['where'],{'$or':_[_0xe570('0x43')](_0x3b9c34['attributes'],function(_0x5f10f9){var _0x45888e={};_0x45888e[_0x5f10f9]={'$like':'%'+_0x2bd908[_0xe570('0x48')][_0xe570('0x53')]+'%'};return _0x45888e;})});}_0x3b9c34=_[_0xe570('0x54')]({},_0x3b9c34,_0x2bd908[_0xe570('0x5e')]);return db[_0xe570('0x70')][_0xe570('0x31')]({'where':_0x3b9c34[_0xe570('0x51')]})['then'](function(_0x407b48){_0x4e36f1['count']=_0x407b48;if(_0x2bd908['query']['includeAll']){_0x3b9c34['include']=[{'all':!![]}];}return db[_0xe570('0x70')][_0xe570('0x58')](_0x3b9c34);})['then'](function(_0x55434a){_0x4e36f1['rows']=_0x55434a;return _0x4e36f1;});}})[_0xe570('0x20')](respondWithFilteredResult(_0x120a43,_0x3b9c34))['catch'](handleError(_0x120a43,null));};exports[_0xe570('0x72')]=function(_0x174f55,_0x11ad1c,_0x24d8d0){return db[_0xe570('0x56')][_0xe570('0x5f')]({'where':{'id':_0x174f55[_0xe570('0x5b')]['id']}})['then'](handleEntityNotFound(_0x11ad1c,null))[_0xe570('0x20')](function(_0x7a14f9){if(_0x7a14f9){return _0x7a14f9[_0xe570('0x72')](_0x174f55[_0xe570('0x48')][_0xe570('0x73')]);}})[_0xe570('0x20')](respondWithStatusCode(_0x11ad1c,null))['catch'](handleError(_0x11ad1c,null));};exports[_0xe570('0x74')]=function(_0x4a80bc,_0x45c973,_0x24d2e0){return db['FaxInteraction']['find']({'where':{'id':_0x4a80bc[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x45c973,null))[_0xe570('0x20')](function(_0x522a2f){if(_0x522a2f){return _0x522a2f[_0xe570('0x74')](_0x4a80bc[_0xe570('0x61')][_0xe570('0x73')],_[_0xe570('0x75')](_0x4a80bc[_0xe570('0x61')],[_0xe570('0x73'),'id'])||{});}})[_0xe570('0x20')](respondWithResult(_0x45c973,null))[_0xe570('0x2b')](handleError(_0x45c973,null));};exports[_0xe570('0x76')]=function(_0x2eb307,_0x2ddf6d,_0x525b58){var _0xf9b658={'raw':![],'where':{}};var _0x432fb1={};var _0x2966a0={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x2eb307[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x2ddf6d,null))[_0xe570('0x20')](function(_0x6ac46){if(_0x6ac46){_0x432fb1[_0xe570('0x47')]=_[_0xe570('0x5c')](db[_0xe570('0x77')]['rawAttributes']);_0x432fb1['query']=_[_0xe570('0x5c')](_0x2eb307[_0xe570('0x48')]);_0x432fb1[_0xe570('0x49')]=_[_0xe570('0x4a')](_0x432fb1[_0xe570('0x47')],_0x432fb1[_0xe570('0x48')]);_0xf9b658['attributes']=_[_0xe570('0x4a')](_0x432fb1[_0xe570('0x47')],qs[_0xe570('0x5d')](_0x2eb307[_0xe570('0x48')][_0xe570('0x5d')]));_0xf9b658['attributes']=_0xf9b658[_0xe570('0x4b')]['length']?_0xf9b658[_0xe570('0x4b')]:_0x432fb1['model'];if(!_0x2eb307[_0xe570('0x48')][_0xe570('0x4d')](_0xe570('0x4e'))){_0xf9b658[_0xe570('0x30')]=qs[_0xe570('0x30')](_0x2eb307[_0xe570('0x48')][_0xe570('0x30')]);_0xf9b658[_0xe570('0x32')]=qs[_0xe570('0x32')](_0x2eb307[_0xe570('0x48')][_0xe570('0x32')]);}_0xf9b658['order']=qs[_0xe570('0x50')](_0x2eb307[_0xe570('0x48')][_0xe570('0x50')]);_0xf9b658[_0xe570('0x51')]=qs['filters'](_['pick'](_0x2eb307['query'],_0x432fb1[_0xe570('0x49')]));_0xf9b658[_0xe570('0x51')][_0xe570('0x69')]=_0x6ac46['id'];if(_0x2eb307['query'][_0xe570('0x53')]){_0xf9b658[_0xe570('0x51')]=_['merge'](_0xf9b658[_0xe570('0x51')],{'$or':_[_0xe570('0x43')](_0xf9b658[_0xe570('0x4b')],function(_0x4de100){var _0x5801bb={};_0x5801bb[_0x4de100]={'$like':'%'+_0x2eb307[_0xe570('0x48')][_0xe570('0x53')]+'%'};return _0x5801bb;})});}_0xf9b658=_[_0xe570('0x54')]({},_0xf9b658,_0x2eb307[_0xe570('0x5e')]);return db[_0xe570('0x77')][_0xe570('0x31')]({'where':_0xf9b658[_0xe570('0x51')]})['then'](function(_0x124a8a){_0x2966a0[_0xe570('0x31')]=_0x124a8a;if(_0x2eb307[_0xe570('0x48')][_0xe570('0x57')]){_0xf9b658[_0xe570('0x6c')]=[{'model':db[_0xe570('0x78')],'as':_0xe570('0x79'),'required':![]},{'model':db[_0xe570('0x7a')],'as':'Owner','attributes':[_0xe570('0x3e'),_0xe570('0x7b'),_0xe570('0x7c')],'required':![]},{'model':db['Tag'],'as':_0xe570('0x7d'),'attributes':['id','name',_0xe570('0x7e')],'where':_0x2eb307[_0xe570('0x48')][_0xe570('0x7f')]?{'id':_0x2eb307[_0xe570('0x48')][_0xe570('0x7f')]}:undefined,'required':_0x2eb307[_0xe570('0x48')]['tag']?!![]:![]}];}return db[_0xe570('0x77')][_0xe570('0x58')](_0xf9b658);})[_0xe570('0x20')](function(_0x538818){_0x2966a0[_0xe570('0x59')]=_0x538818;return _0x2966a0;});}})[_0xe570('0x20')](respondWithFilteredResult(_0x2ddf6d,_0xf9b658))['catch'](handleError(_0x2ddf6d,null));};exports['addApplications']=function(_0x548c61,_0x359c45){var _0x22c2b6=_0x548c61[_0xe570('0x5b')]['id'];var _0x3c6dc5=_0x548c61[_0xe570('0x61')];var _0x317e5b=0xc8;var _0x217bd7=null;return db['sequelize'][_0xe570('0x80')]({'isolationLevel':db[_0xe570('0x81')]['Transaction'][_0xe570('0x82')]['READ_COMMITTED']},function(_0x28166b){return db['FaxAccount']['findOne']({'where':{'id':_0x22c2b6},'transaction':_0x28166b})[_0xe570('0x20')](function(_0x597998){if(_0x597998){return db[_0xe570('0x83')]['destroy']({'where':{'FaxAccountId':_0x22c2b6},'transaction':_0x28166b})[_0xe570('0x20')](function(){var _0x191296=_[_0xe570('0x43')](_0x3c6dc5,function(_0x46c562){_0x46c562['FaxAccountId']=_0x22c2b6;return _0x46c562;});return db[_0xe570('0x83')][_0xe570('0x84')](_0x191296,{'transaction':_0x28166b});});}else{_0x317e5b=0x194;_0x217bd7=[];}});})['then'](function(){if(_0x317e5b!==0x194){return db[_0xe570('0x83')][_0xe570('0x85')]({'where':{'FaxAccountId':_0x22c2b6},'order':_0xe570('0x86')})[_0xe570('0x20')](function(_0x105d10){_0x217bd7=_0x105d10;});}})[_0xe570('0x2b')](function(_0x340dca){_0x317e5b=0x1f4;logger[_0xe570('0x26')](_0x340dca[_0xe570('0x87')]);if(_0x340dca['name']){delete _0x340dca[_0xe570('0x3e')];}_0x217bd7=_0x340dca;})[_0xe570('0x88')](function(){if(_0x217bd7===null){_0x359c45[_0xe570('0x3d')](_0x317e5b);}else{if(_0x317e5b===0x1f4){_0x359c45[_0xe570('0x2c')](_0x317e5b)[_0xe570('0x3f')](_0x217bd7);}else{_0x359c45['status'](_0x317e5b)[_0xe570('0x2e')](_0x217bd7);}}});};exports[_0xe570('0x89')]=function(_0x500c24,_0x5c8e93,_0x381b5f){var _0x37e657={};var _0x4c90c5={};var _0x24c662;var _0x151c1d;return db[_0xe570('0x56')][_0xe570('0x6b')]({'where':{'id':_0x500c24[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x5c8e93,null))[_0xe570('0x20')](function(_0x183b19){if(_0x183b19){_0x24c662=_0x183b19;_0x4c90c5[_0xe570('0x47')]=_['keys'](db['FaxApplication'][_0xe570('0x44')]);_0x4c90c5[_0xe570('0x48')]=_['keys'](_0x500c24['query']);_0x4c90c5[_0xe570('0x49')]=_[_0xe570('0x4a')](_0x4c90c5[_0xe570('0x47')],_0x4c90c5[_0xe570('0x48')]);_0x37e657[_0xe570('0x4b')]=_[_0xe570('0x4a')](_0x4c90c5[_0xe570('0x47')],qs[_0xe570('0x5d')](_0x500c24['query'][_0xe570('0x5d')]));_0x37e657[_0xe570('0x4b')]=_0x37e657[_0xe570('0x4b')][_0xe570('0x4c')]?_0x37e657[_0xe570('0x4b')]:_0x4c90c5[_0xe570('0x47')];_0x37e657[_0xe570('0x4f')]=qs[_0xe570('0x50')](_0x500c24[_0xe570('0x48')][_0xe570('0x50')]);_0x37e657[_0xe570('0x51')]=qs[_0xe570('0x49')](_[_0xe570('0x52')](_0x500c24[_0xe570('0x48')],_0x4c90c5[_0xe570('0x49')]));if(_0x500c24[_0xe570('0x48')][_0xe570('0x53')]){_0x37e657[_0xe570('0x51')]=_['merge'](_0x37e657['where'],{'$or':_[_0xe570('0x43')](_0x37e657['attributes'],function(_0x7d5bec){var _0x59cfad={};_0x59cfad[_0x7d5bec]={'$like':'%'+_0x500c24['query'][_0xe570('0x53')]+'%'};return _0x59cfad;})});}_0x37e657=_['merge']({},_0x37e657,_0x500c24[_0xe570('0x5e')]);return _0x24c662[_0xe570('0x89')](_0x37e657);}})[_0xe570('0x20')](function(_0x1806c3){if(_0x1806c3){_0x151c1d=_0x1806c3[_0xe570('0x4c')];if(!_0x500c24['query'][_0xe570('0x4d')](_0xe570('0x4e'))){_0x37e657[_0xe570('0x30')]=qs[_0xe570('0x30')](_0x500c24[_0xe570('0x48')][_0xe570('0x30')]);_0x37e657[_0xe570('0x32')]=qs[_0xe570('0x32')](_0x500c24['query'][_0xe570('0x32')]);}return _0x24c662[_0xe570('0x89')](_0x37e657);}})[_0xe570('0x20')](function(_0x296ebc){if(_0x296ebc){return _0x296ebc?{'count':_0x151c1d,'rows':_0x296ebc}:null;}})[_0xe570('0x20')](respondWithResult(_0x5c8e93,null))[_0xe570('0x2b')](handleError(_0x5c8e93,null));};function Extension(_0x44c642,_0x86dcb7,_0x3b766e,_0x503e8d){this[_0xe570('0x8a')]=_0xe570('0x8b');this[_0xe570('0x8c')]=_0x44c642[_0xe570('0x8d')];this[_0xe570('0x8e')]=_0x503e8d;this[_0xe570('0x46')]=_0xe570('0x8f');this['description']='Fax\x20Extension';this[_0xe570('0x69')]=_0x44c642['id'];this['priority']=_0x86dcb7;this[_0xe570('0x90')]=_0x3b766e;}function createExtensionsReciveFax(_0x37a47e){var _0x11a1ed=0x1;var _0xf87810=[];_0xf87810['push'](new Extension(_0x37a47e,_0x11a1ed,'',_0xe570('0x91')));_0x11a1ed+=0x1;_0xf87810[_0xe570('0x92')](new Extension(_0x37a47e,_0x11a1ed,_0xe570('0x93'),'Set'));_0x11a1ed+=0x1;for(var _0x2787e5 in _0x37a47e){if(_0x37a47e[_0xe570('0x4d')](_0x2787e5)&&(_0x2787e5===_0xe570('0x94')||_0x2787e5===_0xe570('0x8d')||_0x2787e5==='gateway'||_0x2787e5===_0xe570('0x95')||_0x2787e5===_0xe570('0x96')||_0x2787e5===_0xe570('0x97')||_0x2787e5===_0xe570('0x98')||_0x2787e5===_0xe570('0x99')||_0x2787e5===_0xe570('0x9a'))){_0xf87810[_0xe570('0x92')](new Extension(_0x37a47e,_0x11a1ed,'FAXOPT('+_0x2787e5+')='+_0x37a47e[_0x2787e5],_0xe570('0x9b')));_0x11a1ed+=0x1;}}_0xf87810['push'](new Extension(_0x37a47e,_0x11a1ed,'6',_0xe570('0x9c')));_0x11a1ed+=0x1;_0xf87810[_0xe570('0x92')](new Extension(_0x37a47e,_0x11a1ed,_0xe570('0x9d'),_0xe570('0x9e')));_0x11a1ed=0x0;return _0xf87810;}exports[_0xe570('0x9f')]=function(_0x2221ea,_0x483241,_0x245342){var _0x200f44;return db[_0xe570('0x81')]['transaction'](function(_0x24ca78){return db['FaxAccount']['create'](_0x2221ea[_0xe570('0x61')],{'transaction':_0x24ca78})['then'](function(_0x45fcab){_0x200f44=_0x45fcab[_0xe570('0x3a')]({'plain':!![]});return db['VoiceExtension'][_0xe570('0x84')](createExtensionsReciveFax(_0x200f44),{'transaction':_0x24ca78});});})[_0xe570('0x20')](function(){return _0x200f44;})['then'](respondWithResult(_0x483241,null))['catch'](handleError(_0x483241,null));};exports[_0xe570('0xa0')]=function(_0x2dad1b,_0x4b3c62,_0xe4602c){var _0x5c1d82;return db[_0xe570('0x81')][_0xe570('0x80')](function(_0x5f2ab3){return db[_0xe570('0x56')][_0xe570('0x38')](_0x2dad1b[_0xe570('0x61')],{'where':{'id':_0x2dad1b[_0xe570('0x61')]['id']},'transaction':_0x5f2ab3})['then'](function(_0x267c0d){return db[_0xe570('0xa1')][_0xe570('0x39')]({'where':{'FaxAccountId':_0x2dad1b[_0xe570('0x61')]['id']},'transaction':_0x5f2ab3})['then'](function(_0x5b8c5c){return db[_0xe570('0xa1')][_0xe570('0x84')](createExtensionsReciveFax(_[_0xe570('0x75')](_0x2dad1b['body'],['tech',_0xe570('0xa2'),_0xe570('0xa3'),_0xe570('0xa4'),_0xe570('0xa5'),'ListId'])),{'transaction':_0x5f2ab3});});});})[_0xe570('0x20')](function(){return db[_0xe570('0x56')][_0xe570('0xa6')](_0x2dad1b['body']['id']);})['then'](respondWithResult(_0x4b3c62,null))[_0xe570('0x2b')](handleError(_0x4b3c62,null));};exports[_0xe570('0xa7')]=function(_0x57613e,_0x57cb31,_0x5c8a6e){var _0x580e15={'raw':!![],'where':{}};var _0x503c12={};var _0x100f56={'count':0x0,'rows':[]};return db[_0xe570('0x56')]['findOne']({'where':{'id':_0x57613e[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x57cb31,null))[_0xe570('0x20')](function(_0x2e6fcc){if(_0x2e6fcc){_0x503c12[_0xe570('0x47')]=_[_0xe570('0x5c')](db['FaxMessage'][_0xe570('0x44')]);_0x503c12[_0xe570('0x48')]=_[_0xe570('0x5c')](_0x57613e[_0xe570('0x48')]);_0x503c12[_0xe570('0x49')]=_['intersection'](_0x503c12['model'],_0x503c12[_0xe570('0x48')]);_0x580e15['attributes']=_['intersection'](_0x503c12[_0xe570('0x47')],qs[_0xe570('0x5d')](_0x57613e[_0xe570('0x48')][_0xe570('0x5d')]));_0x580e15[_0xe570('0x4b')]=_0x580e15['attributes'][_0xe570('0x4c')]?_0x580e15[_0xe570('0x4b')]:_0x503c12['model'];if(!_0x57613e[_0xe570('0x48')][_0xe570('0x4d')](_0xe570('0x4e'))){_0x580e15[_0xe570('0x30')]=qs['limit'](_0x57613e[_0xe570('0x48')]['limit']);_0x580e15[_0xe570('0x32')]=qs[_0xe570('0x32')](_0x57613e[_0xe570('0x48')]['offset']);}_0x580e15[_0xe570('0x4f')]=qs[_0xe570('0x50')](_0x57613e['query'][_0xe570('0x50')]);_0x580e15[_0xe570('0x51')]=qs[_0xe570('0x49')](_[_0xe570('0x52')](_0x57613e[_0xe570('0x48')],_0x503c12[_0xe570('0x49')]));_0x580e15[_0xe570('0x51')]['FaxAccountId']=_0x2e6fcc['id'];if(_0x57613e['query'][_0xe570('0x53')]){_0x580e15[_0xe570('0x51')]=_[_0xe570('0x54')](_0x580e15['where'],{'$or':_[_0xe570('0x43')](_0x580e15[_0xe570('0x4b')],function(_0x435a15){var _0x369334={};_0x369334[_0x435a15]={'$like':'%'+_0x57613e[_0xe570('0x48')][_0xe570('0x53')]+'%'};return _0x369334;})});}if(_0x57613e[_0xe570('0x48')][_0xe570('0xa8')]){var _0x410d3b=_0x57613e[_0xe570('0x48')][_0xe570('0xa8')][_0xe570('0xa9')](',');var _0x5a16e3={};_0x5a16e3[_0x410d3b[0x0]]={'$gte':moment(_0x410d3b[0x1])[_0xe570('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')};_0x580e15[_0xe570('0x51')]=_[_0xe570('0x54')](_0x580e15[_0xe570('0x51')],_0x5a16e3);}_0x580e15=_[_0xe570('0x54')]({},_0x580e15,_0x57613e[_0xe570('0x5e')]);return db[_0xe570('0xab')]['count']({'where':_0x580e15['where']})['then'](function(_0x1a6442){_0x100f56[_0xe570('0x31')]=_0x1a6442;if(_0x57613e[_0xe570('0x48')][_0xe570('0x57')]){_0x580e15[_0xe570('0x6c')]=[{'all':!![]}];}return db[_0xe570('0xab')]['findAll'](_0x580e15);})['then'](function(_0x5f19ae){_0x100f56[_0xe570('0x59')]=_0x5f19ae;return _0x100f56;});}})[_0xe570('0x20')](respondWithFilteredResult(_0x57cb31,_0x580e15))['catch'](handleError(_0x57cb31,null));};exports[_0xe570('0x3f')]=function(_0x3c6fa3,_0x589732,_0x202c8e){var _0x1b47ad,_0x1492bf={},_0x11d566;if(_0x3c6fa3['body']['to']){_0x11d566=_0x3c6fa3[_0xe570('0x61')]['to'][0x0];}return db[_0xe570('0x56')][_0xe570('0x5f')]({'where':{'id':_0x3c6fa3[_0xe570('0x5b')]['id']},'include':[{'model':db[_0xe570('0xac')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe570('0xad'),'where':{'fax':_0x11d566},'limit':0x1,'order':[[_0xe570('0xa4'),_0xe570('0xae')]]}]}]})[_0xe570('0x20')](handleEntityNotFound(_0x589732,null))['then'](function(_0x418917){_0x1b47ad=_0x418917;if(_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')]&&_0x3c6fa3['body'][_0xe570('0xaf')]['length']){for(var _0x1dcc66=0x0;_0x1dcc66<_0x3c6fa3[_0xe570('0x61')]['attachments']['length'];_0x1dcc66+=0x1){_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][_0x1dcc66]={'filename':_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][_0x1dcc66][_0xe570('0x3e')],'id':_0x3c6fa3['body'][_0xe570('0xaf')][_0x1dcc66]['id'],'path':path[_0xe570('0xb0')](config['root'],_0xe570('0xb1'),_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][_0x1dcc66][_0xe570('0xb2')])};}}return respondWithRpcPromise(_0xe570('0xb3'),'CheckAfterSend',{'FaxAccountId':_[_0xe570('0xb4')](_0x3c6fa3['params']['id'])?undefined:_0x3c6fa3['params']['id'],'path':_['isNil'](_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][0x0]['path'])?undefined:_0x3c6fa3['body'][_0xe570('0xaf')][0x0][_0xe570('0xb5')],'fax':_[_0xe570('0xb4')](_0x3c6fa3[_0xe570('0x61')]['to'][0x0])?undefined:_0x3c6fa3[_0xe570('0x61')]['to'][0x0]},client9002);})[_0xe570('0x20')](function(){if(_0x1b47ad){if(_[_0xe570('0xb4')](_0x3c6fa3[_0xe570('0x61')][_0xe570('0xb6')])){_0x3c6fa3[_0xe570('0x61')][_0xe570('0xb6')]=util[_0xe570('0xaa')](_0xe570('0xb7'),_0x1b47ad[_0xe570('0x3e')],_0x1b47ad[_0xe570('0xb8')]);}if(_0x1b47ad[_0xe570('0xb9')]){if(_0x1b47ad['List'][_0xe570('0xad')][_0xe570('0x4c')]){return _0x1b47ad['List'][_0xe570('0xad')][0x0];}else{return db[_0xe570('0x78')][_0xe570('0x60')](_[_0xe570('0xba')](_0x3c6fa3[_0xe570('0x61')],{'firstName':_0x3c6fa3[_0xe570('0x61')]['to'][0x0],'phone':_0x3c6fa3[_0xe570('0x61')]['to'][0x0],'fax':_0x3c6fa3[_0xe570('0x61')]['to'][0x0],'ListId':_0x1b47ad[_0xe570('0xbb')]}));}}else{throw new Error(_0xe570('0xbc'));}}else{throw new Error(_0xe570('0xbd'));}})[_0xe570('0x20')](function(_0xc5ce1b){if(_0xc5ce1b){return db['FaxInteraction']['find']({'where':{'ContactId':_0xc5ce1b['id'],'closed':![],'FaxAccountId':_0x1b47ad['id']}})[_0xe570('0x20')](function(_0xc6167b){if(_0xc6167b){return[_0xc6167b,![]];}return db[_0xe570('0x77')][_0xe570('0x60')]({'UserId':_0x3c6fa3[_0xe570('0x62')]['id'],'ContactId':_0xc5ce1b['id'],'FaxAccountId':_0x1b47ad['id'],'fax':_0x3c6fa3['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xe570('0x54')](_0x3c6fa3['body'],{'read':![],'body':_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][0x0]['filename'],'FaxAccountId':_0x1b47ad['id'],'UserId':_0x3c6fa3[_0xe570('0x62')]['id'],'ContactId':_0xc5ce1b['id'],'AttachmentId':_0x3c6fa3[_0xe570('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xe570('0xab')],'as':_0xe570('0xbe')}]})[_0xe570('0x20')](function(_0x100c3d){return[_0x100c3d,!![]];});});}else{throw new Error(_0xe570('0xbf'));}})['spread'](function(_0x4fe0d7,_0x5d2c7a){if(_0x5d2c7a){return _0x4fe0d7;}return db[_0xe570('0xab')][_0xe570('0x60')]({'direction':'out','read':![],'body':_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][0x0]['filename'],'FaxAccountId':_0x1b47ad['id'],'FaxInteractionId':_0x4fe0d7['id'],'UserId':_0x3c6fa3[_0xe570('0x62')]['id'],'ContactId':_0x4fe0d7['ContactId'],'AttachmentId':_0x3c6fa3['body'][_0xe570('0xaf')][0x0]['id']})[_0xe570('0x20')](function(_0x5c4c09){_0x4fe0d7['dataValues'][_0xe570('0xbe')]=[];_0x4fe0d7[_0xe570('0xc0')][_0xe570('0xbe')][_0xe570('0x92')](_0x5c4c09[_0xe570('0xc0')]);return _0x4fe0d7;});})[_0xe570('0x20')](function(_0x3b7d97){respondWithRpcPromise(_0xe570('0xc1'),_0xe570('0xc1'),{'FaxAccountId':_['isNil'](_0x3c6fa3[_0xe570('0x5b')]['id'])?undefined:_0x3c6fa3[_0xe570('0x5b')]['id'],'path':_[_0xe570('0xb4')](_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][0x0][_0xe570('0xb5')])?undefined:_0x3c6fa3['body']['attachments'][0x0][_0xe570('0xb5')],'fax':_[_0xe570('0xb4')](_0x3c6fa3[_0xe570('0x61')]['to'][0x0])?undefined:_0x3c6fa3[_0xe570('0x61')]['to'][0x0],'AttachmentId':_0x3c6fa3[_0xe570('0x61')][_0xe570('0xaf')][0x0]['id']},client9002)[_0xe570('0x20')](function(_0x1a64d4){logger[_0xe570('0x21')](_0xe570('0xc2'),_0x1a64d4);})[_0xe570('0x2b')](function(_0x3cec2a){logger[_0xe570('0x21')](_0xe570('0xc2'),_0x3cec2a);});return _0x3b7d97;})[_0xe570('0x20')](respondWithResult(_0x589732,null))['catch'](handleError(_0x589732,null));};exports[_0xe570('0xc3')]=function(_0x11dd82,_0x1886be,_0x567157){return db[_0xe570('0x56')][_0xe570('0x5f')]({'where':{'id':_0x11dd82[_0xe570('0x5b')]['id']}})[_0xe570('0x20')](handleEntityNotFound(_0x1886be,null))[_0xe570('0x20')](function(_0x458e0e){if(_0x458e0e){return _0x458e0e[_0xe570('0xc3')](_0x11dd82['body'][_0xe570('0x73')],_[_0xe570('0x75')](_0x11dd82[_0xe570('0x61')],[_0xe570('0x73'),'id'])||{})[_0xe570('0xc4')](function(_0x16baa3){for(var _0x49f87d=0x0;_0x49f87d<_0x11dd82['body'][_0xe570('0x73')][_0xe570('0x4c')];_0x49f87d+=0x1){socket[_0xe570('0xc5')](_0xe570('0xc6'),{'UserId':Number(_0x11dd82[_0xe570('0x61')][_0xe570('0x73')][_0x49f87d]),'FaxAccountId':Number(_0x11dd82[_0xe570('0x5b')]['id'])});}return _0x16baa3;});}})[_0xe570('0x20')](respondWithResult(_0x1886be,null))[_0xe570('0x2b')](handleError(_0x1886be,null));};exports['removeAgents']=function(_0x1b454a,_0x388574,_0x2358d3){return db[_0xe570('0x56')]['find']({'where':{'id':_0x1b454a[_0xe570('0x5b')]['id']}})['then'](handleEntityNotFound(_0x388574,null))[_0xe570('0x20')](function(_0x28e4ad){if(_0x28e4ad){return _0x28e4ad[_0xe570('0xc7')](_0x1b454a['query']['ids'])['then'](function(){if(_['isArray'](_0x1b454a['query'][_0xe570('0x73')])){for(var _0x93856=0x0;_0x93856<_0x1b454a[_0xe570('0x48')][_0xe570('0x73')][_0xe570('0x4c')];_0x93856+=0x1){socket[_0xe570('0xc5')]('userFaxAccount:remove',{'UserId':Number(_0x1b454a[_0xe570('0x48')][_0xe570('0x73')][_0x93856]),'FaxAccountId':Number(_0x1b454a[_0xe570('0x5b')]['id'])});}}else{socket[_0xe570('0xc5')]('userFaxAccount:remove',{'UserId':Number(_0x1b454a[_0xe570('0x48')]['ids']),'FaxAccountId':Number(_0x1b454a[_0xe570('0x5b')]['id'])});}});}})[_0xe570('0x20')](respondWithStatusCode(_0x388574,null))['catch'](handleError(_0x388574,null));};exports['getAgents']=function(_0xaddbe7,_0x5cf130,_0x5e0793){var _0x50a48a={};var _0x392010={};var _0x47743b;var _0x148165;return db[_0xe570('0x56')][_0xe570('0x6b')]({'where':{'id':_0xaddbe7[_0xe570('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5cf130,null))[_0xe570('0x20')](function(_0x4203f0){if(_0x4203f0){_0x47743b=_0x4203f0;_0x392010[_0xe570('0x47')]=_[_0xe570('0x5c')](db[_0xe570('0x7a')][_0xe570('0x44')]);_0x392010[_0xe570('0x48')]=_[_0xe570('0x5c')](_0xaddbe7[_0xe570('0x48')]);_0x392010[_0xe570('0x49')]=_[_0xe570('0x4a')](_0x392010[_0xe570('0x47')],_0x392010[_0xe570('0x48')]);_0x50a48a['attributes']=_[_0xe570('0x4a')](_0x392010[_0xe570('0x47')],qs[_0xe570('0x5d')](_0xaddbe7['query']['fields']));_0x50a48a[_0xe570('0x4b')]=_0x50a48a[_0xe570('0x4b')][_0xe570('0x4c')]?_0x50a48a['attributes']:_0x392010['model'];_0x50a48a['order']=qs[_0xe570('0x50')](_0xaddbe7[_0xe570('0x48')]['sort']);_0x50a48a[_0xe570('0x51')]=qs[_0xe570('0x49')](_[_0xe570('0x52')](_0xaddbe7['query'],_0x392010['filters']));if(_0xaddbe7['query']['filter']){_0x50a48a[_0xe570('0x51')]=_['merge'](_0x50a48a[_0xe570('0x51')],{'$or':_[_0xe570('0x43')](_0x50a48a[_0xe570('0x4b')],function(_0x44dbba){var _0x347c14={};_0x347c14[_0x44dbba]={'$like':'%'+_0xaddbe7[_0xe570('0x48')]['filter']+'%'};return _0x347c14;})});}_0x50a48a=_[_0xe570('0x54')]({},_0x50a48a,_0xaddbe7[_0xe570('0x5e')]);return _0x47743b['getAgents'](_0x50a48a);}})[_0xe570('0x20')](function(_0x57da33){if(_0x57da33){_0x148165=_0x57da33[_0xe570('0x4c')];if(!_0xaddbe7['query'][_0xe570('0x4d')]('nolimit')){_0x50a48a['limit']=qs[_0xe570('0x30')](_0xaddbe7['query'][_0xe570('0x30')]);_0x50a48a[_0xe570('0x32')]=qs[_0xe570('0x32')](_0xaddbe7[_0xe570('0x48')][_0xe570('0x32')]);}return _0x47743b[_0xe570('0xc8')](_0x50a48a);}})[_0xe570('0x20')](function(_0x9dd35d){if(_0x9dd35d){return _0x9dd35d?{'count':_0x148165,'rows':_0x9dd35d}:null;}})[_0xe570('0x20')](respondWithResult(_0x5cf130,null))[_0xe570('0x2b')](handleError(_0x5cf130,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d4fc2f3..c02b4f6 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 _0x6d73=['FaxAccount','setMaxListeners','save','remove','hasOwnProperty','hook'];(function(_0x3c62ab,_0x33f23d){var _0x536970=function(_0x3a4759){while(--_0x3a4759){_0x3c62ab['push'](_0x3c62ab['shift']());}};_0x536970(++_0x33f23d);}(_0x6d73,0x132));var _0x36d7=function(_0x386132,_0x5646dd){_0x386132=_0x386132-0x0;var _0x3ba4da=_0x6d73[_0x386132];return _0x3ba4da;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x36d7('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x36d7('0x1')](0x0);var events={'afterCreate':_0x36d7('0x2'),'afterUpdate':'update','afterDestroy':_0x36d7('0x3')};function emitEvent(_0x3fe4a2){return function(_0x36195c,_0x4dfe92,_0x704d55){FaxAccountEvents['emit'](_0x3fe4a2+':'+_0x36195c['id'],_0x36195c);FaxAccountEvents['emit'](_0x3fe4a2,_0x36195c);_0x704d55(null);};}for(var e in events){if(events[_0x36d7('0x4')](e)){var event=events[e];FaxAccount[_0x36d7('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xf926=['FaxAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf926,0xd0));var _0x6f92=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xf926[_0x55f8b4];return _0x2475f9;};'use strict';var EventEmitter=require(_0x6f92('0x0'));var FaxAccount=require(_0x6f92('0x1'))['db'][_0x6f92('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f92('0x3'),'afterUpdate':_0x6f92('0x4'),'afterDestroy':_0x6f92('0x5')};function emitEvent(_0x5baa25){return function(_0x3408e9,_0x1dcab6,_0x1aac5a){FaxAccountEvents[_0x6f92('0x6')](_0x5baa25+':'+_0x3408e9['id'],_0x3408e9);FaxAccountEvents['emit'](_0x5baa25,_0x3408e9);_0x1aac5a(null);};}for(var e in events){if(events[_0x6f92('0x7')](e)){var event=events[e];FaxAccount[_0x6f92('0x8')](e,emitEvent(event));}}module[_0x6f92('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 7080df0..e2a5592 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 _0x40ad=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x40ad,0x9b));var _0xd40a=function(_0x1a362a,_0x532d2e){_0x1a362a=_0x1a362a-0x0;var _0x1c6fc4=_0x40ad[_0x1a362a];return _0x1c6fc4;};'use strict';var _=require(_0xd40a('0x0'));var util=require(_0xd40a('0x1'));var logger=require(_0xd40a('0x2'))('api');var moment=require(_0xd40a('0x3'));var BPromise=require(_0xd40a('0x4'));var rp=require(_0xd40a('0x5'));var fs=require('fs');var path=require(_0xd40a('0x6'));var rimraf=require(_0xd40a('0x7'));var config=require(_0xd40a('0x8'));var attributes=require(_0xd40a('0x9'));module['exports']=function(_0x11b7ce,_0x5e880e){return _0x11b7ce[_0xd40a('0xa')](_0xd40a('0xb'),attributes,{'tableName':_0xd40a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5061=['./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0x5061,0xe6));var _0x1506=function(_0x4c9f76,_0x5e0403){_0x4c9f76=_0x4c9f76-0x0;var _0x551afe=_0x5061[_0x4c9f76];return _0x551afe;};'use strict';var _=require(_0x1506('0x0'));var util=require(_0x1506('0x1'));var logger=require(_0x1506('0x2'))(_0x1506('0x3'));var moment=require(_0x1506('0x4'));var BPromise=require(_0x1506('0x5'));var rp=require(_0x1506('0x6'));var fs=require('fs');var path=require(_0x1506('0x7'));var rimraf=require(_0x1506('0x8'));var config=require(_0x1506('0x9'));var attributes=require(_0x1506('0xa'));module[_0x1506('0xb')]=function(_0x176828,_0xc75d14){return _0x176828[_0x1506('0xc')](_0x1506('0xd'),attributes,{'tableName':_0x1506('0xe'),'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 f7227e7..bbd92a7 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 _0x5b8d=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','attributes','limit','include','map','model','then','GetFaxAccount','catch','NotifyFaxAccount','body','fax','describe','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','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','FaxAccount','find','account','CmList','List','CmContact','Contacts','applications','Applications','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','push','close','*,*,*,*','created','FaxMessage','AttachmentId','interaction','UserId','unshift','agent','name','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x5b8d,0x1c2));var _0xd5b8=function(_0x5a453b,_0x32a8a4){_0x5a453b=_0x5a453b-0x0;var _0x325a5b=_0x5b8d[_0x5a453b];return _0x325a5b;};'use strict';var _=require('lodash');var util=require(_0xd5b8('0x0'));var moment=require('moment');var BPromise=require(_0xd5b8('0x1'));var rs=require(_0xd5b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5b8('0x3'))['db'];var utils=require(_0xd5b8('0x4'));var logger=require(_0xd5b8('0x5'))(_0xd5b8('0x6'));var config=require(_0xd5b8('0x7'));var jayson=require(_0xd5b8('0x8'));var client=jayson[_0xd5b8('0x9')]['http']({'port':0x232c});config['redis']=_[_0xd5b8('0xa')](config[_0xd5b8('0xb')],{'host':_0xd5b8('0xc'),'port':0x18eb});var socket=require(_0xd5b8('0xd'))(new Redis(config[_0xd5b8('0xb')]));require(_0xd5b8('0xe'))[_0xd5b8('0xf')](socket);function respondWithRpcPromise(_0xb42b08,_0xe2d612,_0x23431e){return new BPromise(function(_0x3113da,_0x255f9b){return client[_0xd5b8('0x10')](_0xb42b08,_0x23431e)['then'](function(_0x1f7acb){logger['info'](_0xd5b8('0x11'),_0xe2d612,_0xd5b8('0x12'));logger[_0xd5b8('0x13')](_0xd5b8('0x14'),_0xe2d612,_0xd5b8('0x12'),JSON[_0xd5b8('0x15')](_0x1f7acb));if(_0x1f7acb[_0xd5b8('0x16')]){if(_0x1f7acb['error'][_0xd5b8('0x17')]===0x1f4){logger[_0xd5b8('0x16')](_0xd5b8('0x11'),_0xe2d612,_0x1f7acb[_0xd5b8('0x16')][_0xd5b8('0x18')]);return _0x255f9b(_0x1f7acb[_0xd5b8('0x16')][_0xd5b8('0x18')]);}logger[_0xd5b8('0x16')](_0xd5b8('0x11'),_0xe2d612,_0x1f7acb[_0xd5b8('0x16')][_0xd5b8('0x18')]);return _0x3113da(_0x1f7acb['error']['message']);}else{logger['info'](_0xd5b8('0x11'),_0xe2d612,_0xd5b8('0x12'));_0x3113da(_0x1f7acb[_0xd5b8('0x19')][_0xd5b8('0x18')]);}})['catch'](function(_0x555b0d){logger[_0xd5b8('0x16')](_0xd5b8('0x11'),_0xe2d612,_0x555b0d);_0x255f9b(_0x555b0d);});});}exports['GetFaxAccount']=function(_0x5a7a95){var _0x8e078b=this;return new Promise(function(_0x3bc02e,_0x25792c){return db['FaxAccount']['findAll']({'raw':_0x5a7a95[_0xd5b8('0x1a')]?_0x5a7a95[_0xd5b8('0x1a')][_0xd5b8('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a7a95[_0xd5b8('0x1a')]?_0x5a7a95[_0xd5b8('0x1a')]['where']||null:null,'attributes':_0x5a7a95['options']?_0x5a7a95[_0xd5b8('0x1a')][_0xd5b8('0x1c')]||null:null,'limit':_0x5a7a95['options']?_0x5a7a95[_0xd5b8('0x1a')][_0xd5b8('0x1d')]||null:null,'include':_0x5a7a95[_0xd5b8('0x1a')]?_0x5a7a95[_0xd5b8('0x1a')][_0xd5b8('0x1e')]?_[_0xd5b8('0x1f')](_0x5a7a95[_0xd5b8('0x1a')][_0xd5b8('0x1e')],function(_0x38a0ab){return{'model':db[_0x38a0ab[_0xd5b8('0x20')]],'as':_0x38a0ab['as'],'attributes':_0x38a0ab[_0xd5b8('0x1c')],'include':_0x38a0ab[_0xd5b8('0x1e')]?_[_0xd5b8('0x1f')](_0x38a0ab['include'],function(_0x18d6a9){return{'model':db[_0x18d6a9['model']],'as':_0x18d6a9['as'],'attributes':_0x18d6a9[_0xd5b8('0x1c')],'include':_0x18d6a9[_0xd5b8('0x1e')]?_[_0xd5b8('0x1f')](_0x18d6a9[_0xd5b8('0x1e')],function(_0x193533){return{'model':db[_0x193533[_0xd5b8('0x20')]],'as':_0x193533['as'],'attributes':_0x193533[_0xd5b8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd5b8('0x21')](function(_0x3b3ed2){logger['info'](_0xd5b8('0x22'),_0x5a7a95);logger['debug'](_0xd5b8('0x22'),_0x5a7a95,JSON[_0xd5b8('0x15')](_0x3b3ed2));_0x3bc02e(_0x3b3ed2);})[_0xd5b8('0x23')](function(_0x3e7c48){logger[_0xd5b8('0x16')](_0xd5b8('0x22'),_0x3e7c48[_0xd5b8('0x18')],_0x5a7a95);_0x25792c(_0x8e078b['error'](0x1f4,_0x3e7c48['message']));});});};exports[_0xd5b8('0x24')]=function(_0xac69d9,_0x475b9d,_0x3569c0){var _0x2cb789=this;return new Promise(function(_0x5e3683,_0x81992f){var _0x3766e6={'body':_0xac69d9[_0xd5b8('0x25')],'channel':_0xd5b8('0x26')};var _0x4ab454=[];var _0x22ad06=[];var _0xa33129={};return db['CmContact'][_0xd5b8('0x27')]()[_0xd5b8('0x21')](function(_0x5e51be){if(!_0x5e51be){throw new db[(_0xd5b8('0x28'))]['ValidationError'](_0xd5b8('0x29'));}_0x4ab454=_[_0xd5b8('0x2a')](_[_0xd5b8('0x2b')](_0x5e51be),['createdAt',_0xd5b8('0x2c')]);_0x22ad06=_[_0xd5b8('0x2a')](_[_0xd5b8('0x2b')](_0x5e51be),[_0xd5b8('0x2d'),_0xd5b8('0x2c'),_0xd5b8('0x2e'),_0xd5b8('0x2f')]);if(_0xac69d9['body']['id']){delete _0xac69d9[_0xd5b8('0x25')]['id'];}if(_[_0xd5b8('0x30')](_0xac69d9[_0xd5b8('0x25')][_0xd5b8('0x31')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd5b8('0x30')](_0xac69d9[_0xd5b8('0x25')][_0xd5b8('0x25')])||_0xac69d9[_0xd5b8('0x25')][_0xd5b8('0x25')]===''){throw new db['Sequelize'][(_0xd5b8('0x32'))](_0xd5b8('0x33'));}if(_[_0xd5b8('0x30')](_0xac69d9[_0xd5b8('0x25')][_0xd5b8('0x34')])){throw new db[(_0xd5b8('0x28'))][(_0xd5b8('0x32'))](_0xd5b8('0x35')+_0x22ad06);}if(!_[_0xd5b8('0x36')](_0x22ad06,_0xac69d9[_0xd5b8('0x25')][_0xd5b8('0x34')])){throw new db[(_0xd5b8('0x28'))][(_0xd5b8('0x32'))](_0xd5b8('0x37')+_0x22ad06);}_0xa33129[_0xac69d9[_0xd5b8('0x25')]['mapKey']]=_0xac69d9[_0xd5b8('0x25')][_0xd5b8('0x31')];})[_0xd5b8('0x21')](function(){return db[_0xd5b8('0x38')][_0xd5b8('0x39')]({'where':{'id':_0xac69d9[_0xd5b8('0x3a')]['id']},'include':[{'model':db[_0xd5b8('0x3b')],'as':_0xd5b8('0x3c'),'include':[{'model':db[_0xd5b8('0x3d')],'as':_0xd5b8('0x3e'),'where':_0xa33129,'limit':0x1,'order':[[_0xd5b8('0x2c'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xd5b8('0x21')](function(_0x27857e){if(_0x27857e&&_0x27857e[_0xd5b8('0x3c')]){var _0x53eee8=_0x27857e['get']({'plain':!![]});_0x3766e6[_0xd5b8('0x3a')]=_0x53eee8;_0x3766e6[_0xd5b8('0x3f')]=_0x53eee8[_0xd5b8('0x40')];_0x3766e6['list']=_0x53eee8['List'];_0x3766e6['applications']=_['orderBy'](_0x3766e6[_0xd5b8('0x3f')],[_0xd5b8('0x41')],[_0xd5b8('0x42')]);if(_0x3766e6[_0xd5b8('0x3a')][_0xd5b8('0x40')]){delete _0x3766e6[_0xd5b8('0x3a')]['Applications'];}if(_0x3766e6[_0xd5b8('0x3a')][_0xd5b8('0x3c')]&&_0x3766e6['account'][_0xd5b8('0x3c')][_0xd5b8('0x3e')]['length']){return _0x3766e6[_0xd5b8('0x3a')][_0xd5b8('0x3c')][_0xd5b8('0x3e')][0x0];}var _0x5b07a5=_[_0xd5b8('0xa')](_0xac69d9[_0xd5b8('0x25')],{'firstName':_0xac69d9[_0xd5b8('0x25')]['from'],'ListId':_0x53eee8['ListId']});_0x5b07a5[_0xac69d9['body']['mapKey']]=_0xac69d9[_0xd5b8('0x25')]['from'];return db[_0xd5b8('0x3d')][_0xd5b8('0x43')](_0x5b07a5,{'fields':_0x4ab454,'raw':!![]});}})[_0xd5b8('0x21')](function(_0x365823){_0x3766e6[_0xd5b8('0x44')]=_0x365823;if(_0x365823){var _0x4f6145={'ContactId':_0x365823['id'],'FaxAccountId':_0xac69d9['account']['id'],'fax':_0x365823['fax']};return db[_0xd5b8('0x45')][_0xd5b8('0x39')]({'where':{'ContactId':_0x365823['id'],'closed':![],'FaxAccountId':_0xac69d9['account']['id']}})[_0xd5b8('0x21')](function(_0x316149){if(_0x316149){return[_0x316149,![]];}return db['FaxInteraction'][_0xd5b8('0x43')](_0x4f6145)[_0xd5b8('0x21')](function(_0x4df89d){return[_0x4df89d,!![]];});});}else{throw new Error(_0xd5b8('0x46'));}})[_0xd5b8('0x47')](function(_0x1ec68d,_0x54df22){var _0x2c9c59=_0x1ec68d[_0xd5b8('0x48')]({'plain':!![]});if(_0x54df22){if(_0x3766e6[_0xd5b8('0x3a')]['autoclose']){_0x3766e6[_0xd5b8('0x3f')][_0xd5b8('0x49')]({'id':0x0,'priority':_0x3766e6[_0xd5b8('0x3f')]['length']+0x1,'app':_0xd5b8('0x4a'),'appdata':'unmanaged','interval':_0xd5b8('0x4b')});}_0x2c9c59[_0xd5b8('0x4c')]=!![];}else{_0x2c9c59[_0xd5b8('0x4c')]=![];}_0x3766e6['interaction']=_0x2c9c59;return db[_0xd5b8('0x4d')][_0xd5b8('0x43')]({'body':_0xac69d9[_0xd5b8('0x25')]['body'],'FaxAccountId':_0xac69d9[_0xd5b8('0x3a')]['id'],'FaxInteractionId':_0x1ec68d['id'],'direction':'in','ContactId':_0x1ec68d['ContactId'],'AttachmentId':_0xac69d9['body'][_0xd5b8('0x4e')]});})[_0xd5b8('0x21')](function(_0x1b3375){_0x3766e6[_0xd5b8('0x18')]=_0x1b3375;if(!_0x3766e6[_0xd5b8('0x4f')]['UserId'])return;return db['User'][_0xd5b8('0x39')]({'attributes':['id','name'],'where':{'id':_0x3766e6[_0xd5b8('0x4f')][_0xd5b8('0x50')]}});})[_0xd5b8('0x21')](function(_0x33d118){if(_0x33d118){_0x3766e6[_0xd5b8('0x3f')][_0xd5b8('0x51')]({'id':0x0,'priority':0x0,'app':_0xd5b8('0x52'),'appdata':_0x33d118[_0xd5b8('0x53')]+','+(_0x3766e6[_0xd5b8('0x3a')]['waitForTheAssignedAgent']||0xa),'interval':_0xd5b8('0x4b')});}if(!_0x3766e6['interaction'][_0xd5b8('0x54')])return;return db[_0xd5b8('0x55')][_0xd5b8('0x39')]({'attributes':['id',_0xd5b8('0x53')],'where':{'id':_0x3766e6['interaction'][_0xd5b8('0x54')]}});})[_0xd5b8('0x21')](function(_0x352ee7){if(_0x352ee7){_0x3766e6[_0xd5b8('0x3f')][_0xd5b8('0x51')]({'id':0x0,'priority':0x1,'app':_0xd5b8('0x56'),'appdata':_0x352ee7[_0xd5b8('0x53')]+','+(_0x3766e6[_0xd5b8('0x3a')][_0xd5b8('0x57')]||0x12c),'interval':_0xd5b8('0x4b')});}return respondWithRpcPromise(_0xd5b8('0x58'),_0xd5b8('0x59'),_0x3766e6);})[_0xd5b8('0x21')](function(_0x1c9a1b){_0x5e3683(_0x1c9a1b);})['catch'](function(_0x137355){_0x81992f(_0x2cb789[_0xd5b8('0x16')](0x1f4,_0x137355[_0xd5b8('0x18')]));});});}; \ No newline at end of file +var _0xdf58=['model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','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','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','Applications','get','list','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','created','interaction','ContactId','UserId','User','agent','name','waitForTheAssignedAgent','*,*,*,*','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','redis','defaults','localhost','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x4b3d03,_0x298eb8){var _0x29038d=function(_0x148704){while(--_0x148704){_0x4b3d03['push'](_0x4b3d03['shift']());}};_0x29038d(++_0x298eb8);}(_0xdf58,0x151));var _0x8df5=function(_0x21bb11,_0x25c8c8){_0x21bb11=_0x21bb11-0x0;var _0x797526=_0xdf58[_0x21bb11];return _0x797526;};'use strict';var _=require('lodash');var util=require(_0x8df5('0x0'));var moment=require(_0x8df5('0x1'));var BPromise=require(_0x8df5('0x2'));var rs=require(_0x8df5('0x3'));var fs=require('fs');var Redis=require(_0x8df5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8df5('0x5'));var config=require(_0x8df5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8df5('0x7')][_0x8df5('0x8')]({'port':0x232c});config[_0x8df5('0x9')]=_[_0x8df5('0xa')](config[_0x8df5('0x9')],{'host':_0x8df5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8df5('0x9')]));require(_0x8df5('0xc'))['register'](socket);function respondWithRpcPromise(_0x3503b6,_0x44e1d9,_0x4ab214){return new BPromise(function(_0x389b58,_0x5a25ca){return client['request'](_0x3503b6,_0x4ab214)[_0x8df5('0xd')](function(_0x441847){logger[_0x8df5('0xe')](_0x8df5('0xf'),_0x44e1d9,'request\x20sent');logger[_0x8df5('0x10')](_0x8df5('0x11'),_0x44e1d9,_0x8df5('0x12'),JSON[_0x8df5('0x13')](_0x441847));if(_0x441847[_0x8df5('0x14')]){if(_0x441847[_0x8df5('0x14')][_0x8df5('0x15')]===0x1f4){logger[_0x8df5('0x14')](_0x8df5('0xf'),_0x44e1d9,_0x441847['error'][_0x8df5('0x16')]);return _0x5a25ca(_0x441847['error'][_0x8df5('0x16')]);}logger[_0x8df5('0x14')]('FaxAccount,\x20%s,\x20%s',_0x44e1d9,_0x441847[_0x8df5('0x14')][_0x8df5('0x16')]);return _0x389b58(_0x441847[_0x8df5('0x14')]['message']);}else{logger[_0x8df5('0xe')](_0x8df5('0xf'),_0x44e1d9,_0x8df5('0x12'));_0x389b58(_0x441847[_0x8df5('0x17')][_0x8df5('0x16')]);}})[_0x8df5('0x18')](function(_0x571e5a){logger[_0x8df5('0x14')](_0x8df5('0xf'),_0x44e1d9,_0x571e5a);_0x5a25ca(_0x571e5a);});});}exports[_0x8df5('0x19')]=function(_0x468fd4){var _0x347d0a=this;return new Promise(function(_0x21728c,_0x5a0374){return db[_0x8df5('0x1a')][_0x8df5('0x1b')]({'raw':_0x468fd4[_0x8df5('0x1c')]?_0x468fd4[_0x8df5('0x1c')][_0x8df5('0x1d')]===undefined?!![]:![]:!![],'where':_0x468fd4[_0x8df5('0x1c')]?_0x468fd4[_0x8df5('0x1c')][_0x8df5('0x1e')]||null:null,'attributes':_0x468fd4[_0x8df5('0x1c')]?_0x468fd4[_0x8df5('0x1c')][_0x8df5('0x1f')]||null:null,'limit':_0x468fd4['options']?_0x468fd4[_0x8df5('0x1c')][_0x8df5('0x20')]||null:null,'include':_0x468fd4[_0x8df5('0x1c')]?_0x468fd4[_0x8df5('0x1c')][_0x8df5('0x21')]?_[_0x8df5('0x22')](_0x468fd4[_0x8df5('0x1c')][_0x8df5('0x21')],function(_0xefd3d6){return{'model':db[_0xefd3d6[_0x8df5('0x23')]],'as':_0xefd3d6['as'],'attributes':_0xefd3d6[_0x8df5('0x1f')],'include':_0xefd3d6[_0x8df5('0x21')]?_[_0x8df5('0x22')](_0xefd3d6['include'],function(_0x1369fd){return{'model':db[_0x1369fd['model']],'as':_0x1369fd['as'],'attributes':_0x1369fd['attributes'],'include':_0x1369fd[_0x8df5('0x21')]?_[_0x8df5('0x22')](_0x1369fd[_0x8df5('0x21')],function(_0x27e1cb){return{'model':db[_0x27e1cb[_0x8df5('0x23')]],'as':_0x27e1cb['as'],'attributes':_0x27e1cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x8df5('0xd')](function(_0x2e312c){logger[_0x8df5('0xe')](_0x8df5('0x19'),_0x468fd4);logger[_0x8df5('0x10')](_0x8df5('0x19'),_0x468fd4,JSON[_0x8df5('0x13')](_0x2e312c));_0x21728c(_0x2e312c);})['catch'](function(_0x26c6d6){logger[_0x8df5('0x14')](_0x8df5('0x19'),_0x26c6d6[_0x8df5('0x16')],_0x468fd4);_0x5a0374(_0x347d0a[_0x8df5('0x14')](0x1f4,_0x26c6d6[_0x8df5('0x16')]));});});};exports[_0x8df5('0x24')]=function(_0x52837c,_0x10178b,_0x3b81dc){var _0x142ded=this;return new Promise(function(_0x14a2f6,_0x12211f){var _0x44011a={'body':_0x52837c[_0x8df5('0x25')],'channel':_0x8df5('0x26')};var _0x4a90f3=[];var _0x26b054=[];var _0x17d8d6={};return db[_0x8df5('0x27')][_0x8df5('0x28')]()[_0x8df5('0xd')](function(_0x5cb55b){if(!_0x5cb55b){throw new db[(_0x8df5('0x29'))][(_0x8df5('0x2a'))](_0x8df5('0x2b'));}_0x4a90f3=_['difference'](_[_0x8df5('0x2c')](_0x5cb55b),[_0x8df5('0x2d'),_0x8df5('0x2e')]);_0x26b054=_['difference'](_[_0x8df5('0x2c')](_0x5cb55b),[_0x8df5('0x2d'),_0x8df5('0x2e'),_0x8df5('0x2f'),_0x8df5('0x30')]);if(_0x52837c[_0x8df5('0x25')]['id']){delete _0x52837c['body']['id'];}if(_[_0x8df5('0x31')](_0x52837c[_0x8df5('0x25')][_0x8df5('0x32')])){throw new db[(_0x8df5('0x29'))][(_0x8df5('0x2a'))](_0x8df5('0x33'));}if(_[_0x8df5('0x31')](_0x52837c[_0x8df5('0x25')][_0x8df5('0x25')])||_0x52837c['body']['body']===''){throw new db[(_0x8df5('0x29'))]['ValidationError'](_0x8df5('0x34'));}if(_[_0x8df5('0x31')](_0x52837c[_0x8df5('0x25')][_0x8df5('0x35')])){throw new db[(_0x8df5('0x29'))][(_0x8df5('0x2a'))](_0x8df5('0x36')+_0x26b054);}if(!_['includes'](_0x26b054,_0x52837c[_0x8df5('0x25')]['mapKey'])){throw new db['Sequelize'][(_0x8df5('0x2a'))](_0x8df5('0x37')+_0x26b054);}_0x17d8d6[_0x52837c[_0x8df5('0x25')][_0x8df5('0x35')]]=_0x52837c[_0x8df5('0x25')][_0x8df5('0x32')];})[_0x8df5('0xd')](function(){return db['FaxAccount'][_0x8df5('0x38')]({'where':{'id':_0x52837c[_0x8df5('0x39')]['id']},'include':[{'model':db[_0x8df5('0x3a')],'as':_0x8df5('0x3b'),'include':[{'model':db[_0x8df5('0x27')],'as':_0x8df5('0x3c'),'where':_0x17d8d6,'limit':0x1,'order':[[_0x8df5('0x2e'),_0x8df5('0x3d')]]}]},{'model':db['FaxApplication'],'as':_0x8df5('0x3e')}]});})[_0x8df5('0xd')](function(_0x1c3848){if(_0x1c3848&&_0x1c3848[_0x8df5('0x3b')]){var _0x1addad=_0x1c3848[_0x8df5('0x3f')]({'plain':!![]});_0x44011a[_0x8df5('0x39')]=_0x1addad;_0x44011a['applications']=_0x1addad[_0x8df5('0x3e')];_0x44011a[_0x8df5('0x40')]=_0x1addad[_0x8df5('0x3b')];_0x44011a[_0x8df5('0x41')]=_[_0x8df5('0x42')](_0x44011a[_0x8df5('0x41')],[_0x8df5('0x43')],[_0x8df5('0x44')]);if(_0x44011a['account'][_0x8df5('0x3e')]){delete _0x44011a['account'][_0x8df5('0x3e')];}if(_0x44011a['account'][_0x8df5('0x3b')]&&_0x44011a[_0x8df5('0x39')][_0x8df5('0x3b')][_0x8df5('0x3c')][_0x8df5('0x45')]){return _0x44011a[_0x8df5('0x39')][_0x8df5('0x3b')][_0x8df5('0x3c')][0x0];}var _0x183d92=_[_0x8df5('0xa')](_0x52837c[_0x8df5('0x25')],{'firstName':_0x52837c['body']['from'],'ListId':_0x1addad['ListId']});_0x183d92[_0x52837c['body'][_0x8df5('0x35')]]=_0x52837c[_0x8df5('0x25')]['from'];return db[_0x8df5('0x27')][_0x8df5('0x46')](_0x183d92,{'fields':_0x4a90f3,'raw':!![]});}})[_0x8df5('0xd')](function(_0x5ae88b){_0x44011a[_0x8df5('0x47')]=_0x5ae88b;if(_0x5ae88b){var _0xfc0bb4={'ContactId':_0x5ae88b['id'],'FaxAccountId':_0x52837c['account']['id'],'fax':_0x5ae88b['fax']};return db[_0x8df5('0x48')][_0x8df5('0x38')]({'where':{'ContactId':_0x5ae88b['id'],'closed':![],'FaxAccountId':_0x52837c['account']['id']}})[_0x8df5('0xd')](function(_0x58e261){if(_0x58e261){return[_0x58e261,![]];}return db[_0x8df5('0x48')][_0x8df5('0x46')](_0xfc0bb4)[_0x8df5('0xd')](function(_0x501bfa){return[_0x501bfa,!![]];});});}else{throw new Error(_0x8df5('0x49'));}})[_0x8df5('0x4a')](function(_0x5f246e,_0x360611){var _0x13a745=_0x5f246e['get']({'plain':!![]});if(_0x360611){if(_0x44011a[_0x8df5('0x39')][_0x8df5('0x4b')]){_0x44011a[_0x8df5('0x41')][_0x8df5('0x4c')]({'id':0x0,'priority':_0x44011a[_0x8df5('0x41')][_0x8df5('0x45')]+0x1,'app':'close','appdata':_0x8df5('0x4d'),'interval':'*,*,*,*'});}_0x13a745[_0x8df5('0x4e')]=!![];}else{_0x13a745[_0x8df5('0x4e')]=![];}_0x44011a[_0x8df5('0x4f')]=_0x13a745;return db['FaxMessage']['create']({'body':_0x52837c[_0x8df5('0x25')][_0x8df5('0x25')],'FaxAccountId':_0x52837c['account']['id'],'FaxInteractionId':_0x5f246e['id'],'direction':'in','ContactId':_0x5f246e[_0x8df5('0x50')],'AttachmentId':_0x52837c[_0x8df5('0x25')]['AttachmentId']});})[_0x8df5('0xd')](function(_0x346645){_0x44011a[_0x8df5('0x16')]=_0x346645;if(!_0x44011a[_0x8df5('0x4f')][_0x8df5('0x51')])return;return db[_0x8df5('0x52')][_0x8df5('0x38')]({'attributes':['id','name'],'where':{'id':_0x44011a[_0x8df5('0x4f')][_0x8df5('0x51')]}});})['then'](function(_0x958680){if(_0x958680){_0x44011a['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x8df5('0x53'),'appdata':_0x958680[_0x8df5('0x54')]+','+(_0x44011a[_0x8df5('0x39')][_0x8df5('0x55')]||0xa),'interval':_0x8df5('0x56')});}if(!_0x44011a[_0x8df5('0x4f')][_0x8df5('0x57')])return;return db['FaxQueue'][_0x8df5('0x38')]({'attributes':['id',_0x8df5('0x54')],'where':{'id':_0x44011a[_0x8df5('0x4f')][_0x8df5('0x57')]}});})['then'](function(_0x59114d){if(_0x59114d){_0x44011a[_0x8df5('0x41')][_0x8df5('0x58')]({'id':0x0,'priority':0x1,'app':_0x8df5('0x59'),'appdata':_0x59114d[_0x8df5('0x54')]+','+(_0x44011a[_0x8df5('0x39')][_0x8df5('0x5a')]||0x12c),'interval':_0x8df5('0x56')});}return respondWithRpcPromise(_0x8df5('0x5b'),_0x8df5('0x5c'),_0x44011a);})[_0x8df5('0xd')](function(_0x5dfca9){_0x14a2f6(_0x5dfca9);})[_0x8df5('0x18')](function(_0x441c67){_0x12211f(_0x142ded['error'](0x1f4,_0x441c67[_0x8df5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index c97dad6..e297823 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 _0xf65a=['remove','update','emit','removeListener','length','save'];(function(_0xb5db3c,_0x4e3042){var _0x5a5159=function(_0x2a95f6){while(--_0x2a95f6){_0xb5db3c['push'](_0xb5db3c['shift']());}};_0x5a5159(++_0x4e3042);}(_0xf65a,0x167));var _0xaf65=function(_0x3c5b4c,_0x1e873a){_0x3c5b4c=_0x3c5b4c-0x0;var _0x262dd7=_0xf65a[_0x3c5b4c];return _0x262dd7;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xaf65('0x0'),_0xaf65('0x1'),_0xaf65('0x2')];function createListener(_0x40240a,_0x494f2b){return function(_0x3cf339){_0x494f2b[_0xaf65('0x3')](_0x40240a,_0x3cf339);};}function removeListener(_0x19a3a8,_0x5ca133){return function(){FaxAccountEvents[_0xaf65('0x4')](_0x19a3a8,_0x5ca133);};}exports['register']=function(_0x4aadeb){for(var _0x299d7e=0x0,_0x3d3983=events[_0xaf65('0x5')];_0x299d7e<_0x3d3983;_0x299d7e++){var _0x25c814=events[_0x299d7e];var _0x269d21=createListener('faxAccount:'+_0x25c814,_0x4aadeb);FaxAccountEvents['on'](_0x25c814,_0x269d21);}}; \ No newline at end of file +var _0x54f5=['length','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x459575,_0x5799ea){var _0x18a348=function(_0x4acaef){while(--_0x4acaef){_0x459575['push'](_0x459575['shift']());}};_0x18a348(++_0x5799ea);}(_0x54f5,0xb9));var _0x554f=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x54f5[_0x36909d];return _0x1fd29d;};'use strict';var FaxAccountEvents=require(_0x554f('0x0'));var events=[_0x554f('0x1'),_0x554f('0x2'),_0x554f('0x3')];function createListener(_0x5caf35,_0x2d092e){return function(_0x2d20a3){_0x2d092e[_0x554f('0x4')](_0x5caf35,_0x2d20a3);};}function removeListener(_0x9fa84d,_0x2217a2){return function(){FaxAccountEvents[_0x554f('0x5')](_0x9fa84d,_0x2217a2);};}exports[_0x554f('0x6')]=function(_0x376aa8){for(var _0x1e4f08=0x0,_0x3d0343=events[_0x554f('0x7')];_0x1e4f08<_0x3d0343;_0x1e4f08++){var _0x184d97=events[_0x1e4f08];var _0x253c86=createListener('faxAccount:'+_0x184d97,_0x376aa8);FaxAccountEvents['on'](_0x184d97,_0x253c86);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2ab9490..de2b634 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 _0x4bae=['put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addApplications','/addaccountapplications','/updateaccountapplications','send','addAgents'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x4bae,0xc7));var _0xe4ba=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x4bae[_0x3792e6];return _0x441e44;};'use strict';var multer=require(_0xe4ba('0x0'));var util=require('util');var path=require(_0xe4ba('0x1'));var timeout=require(_0xe4ba('0x2'));var express=require('express');var router=express[_0xe4ba('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe4ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe4ba('0x5'));var controller=require(_0xe4ba('0x6'));router[_0xe4ba('0x7')]('/',auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x9')]);router[_0xe4ba('0x7')](_0xe4ba('0xa'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0xb')]);router[_0xe4ba('0x7')]('/:id',auth[_0xe4ba('0x8')](),controller['show']);router[_0xe4ba('0x7')]('/:id/dispositions',auth[_0xe4ba('0x8')](),controller['getDispositions']);router[_0xe4ba('0x7')](_0xe4ba('0xc'),auth['isAuthenticated'](),controller[_0xe4ba('0xd')]);router[_0xe4ba('0x7')](_0xe4ba('0xe'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0xf')]);router[_0xe4ba('0x7')](_0xe4ba('0x10'),auth['isAuthenticated'](),controller[_0xe4ba('0x11')]);router[_0xe4ba('0x7')]('/:id/messages',auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x12')]);router[_0xe4ba('0x7')](_0xe4ba('0x13'),auth[_0xe4ba('0x8')](),controller['getAgents']);router[_0xe4ba('0x14')]('/',auth['isAuthenticated'](),controller[_0xe4ba('0x15')]);router[_0xe4ba('0x14')](_0xe4ba('0x16'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x17')]);router[_0xe4ba('0x14')](_0xe4ba('0xc'),auth[_0xe4ba('0x8')](),controller['addAnswer']);router[_0xe4ba('0x14')](_0xe4ba('0xe'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xe4ba('0x14')]('/:id/applications',auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x18')]);router['post'](_0xe4ba('0x19'),auth[_0xe4ba('0x8')](),controller['addAccountApplications']);router[_0xe4ba('0x14')](_0xe4ba('0x1a'),auth[_0xe4ba('0x8')](),controller['updateAccountApplications']);router[_0xe4ba('0x14')]('/:id/send',auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x1b')]);router['post'](_0xe4ba('0x13'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x1c')]);router[_0xe4ba('0x1d')](_0xe4ba('0x1e'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x1f')]);router[_0xe4ba('0x20')](_0xe4ba('0x1e'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x21')]);router[_0xe4ba('0x20')](_0xe4ba('0x16'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x22')]);router['delete'](_0xe4ba('0xc'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x23')]);router[_0xe4ba('0x20')](_0xe4ba('0x13'),auth[_0xe4ba('0x8')](),controller[_0xe4ba('0x24')]);module[_0xe4ba('0x25')]=router; \ No newline at end of file +var _0xe4fa=['fs-extra','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','index','get','/:id','show','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','send','addAgents','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe4fa,0x130));var _0xae4f=function(_0x5b7529,_0x2c8073){_0x5b7529=_0x5b7529-0x0;var _0x26df0a=_0xe4fa[_0x5b7529];return _0x26df0a;};'use strict';var multer=require('multer');var util=require(_0xae4f('0x0'));var path=require('path');var timeout=require(_0xae4f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xae4f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xae4f('0x3'));var config=require(_0xae4f('0x4'));var controller=require(_0xae4f('0x5'));router['get']('/',auth[_0xae4f('0x6')](),controller[_0xae4f('0x7')]);router[_0xae4f('0x8')]('/describe',auth[_0xae4f('0x6')](),controller['describe']);router[_0xae4f('0x8')](_0xae4f('0x9'),auth['isAuthenticated'](),controller[_0xae4f('0xa')]);router[_0xae4f('0x8')]('/:id/dispositions',auth[_0xae4f('0x6')](),controller['getDispositions']);router[_0xae4f('0x8')](_0xae4f('0xb'),auth[_0xae4f('0x6')](),controller[_0xae4f('0xc')]);router['get'](_0xae4f('0xd'),auth[_0xae4f('0x6')](),controller['getInteractions']);router[_0xae4f('0x8')](_0xae4f('0xe'),auth['isAuthenticated'](),controller[_0xae4f('0xf')]);router[_0xae4f('0x8')]('/:id/messages',auth[_0xae4f('0x6')](),controller['getMessages']);router[_0xae4f('0x8')](_0xae4f('0x10'),auth[_0xae4f('0x6')](),controller[_0xae4f('0x11')]);router[_0xae4f('0x12')]('/',auth['isAuthenticated'](),controller[_0xae4f('0x13')]);router[_0xae4f('0x12')](_0xae4f('0x14'),auth[_0xae4f('0x6')](),controller[_0xae4f('0x15')]);router['post'](_0xae4f('0xb'),auth['isAuthenticated'](),controller[_0xae4f('0x16')]);router[_0xae4f('0x12')](_0xae4f('0xd'),auth[_0xae4f('0x6')](),controller[_0xae4f('0x17')]);router[_0xae4f('0x12')]('/:id/applications',auth[_0xae4f('0x6')](),controller['addApplications']);router[_0xae4f('0x12')](_0xae4f('0x18'),auth[_0xae4f('0x6')](),controller[_0xae4f('0x19')]);router[_0xae4f('0x12')](_0xae4f('0x1a'),auth[_0xae4f('0x6')](),controller['updateAccountApplications']);router[_0xae4f('0x12')]('/:id/send',auth['isAuthenticated'](),controller[_0xae4f('0x1b')]);router[_0xae4f('0x12')](_0xae4f('0x10'),auth[_0xae4f('0x6')](),controller[_0xae4f('0x1c')]);router['put'](_0xae4f('0x9'),auth[_0xae4f('0x6')](),controller['update']);router[_0xae4f('0x1d')](_0xae4f('0x9'),auth[_0xae4f('0x6')](),controller[_0xae4f('0x1e')]);router[_0xae4f('0x1d')](_0xae4f('0x14'),auth['isAuthenticated'](),controller[_0xae4f('0x1f')]);router[_0xae4f('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xae4f('0x1d')]('/:id/users',auth[_0xae4f('0x6')](),controller[_0xae4f('0x20')]);module[_0xae4f('0x21')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 3f59186..480fe50 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 _0xe0e8=['INTEGER','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x231d2a,_0x5c8ec4){var _0xe6d507=function(_0x28454e){while(--_0x28454e){_0x231d2a['push'](_0x231d2a['shift']());}};_0xe6d507(++_0x5c8ec4);}(_0xe0e8,0xd6));var _0x8e0e=function(_0x4ea31e,_0x45cc3d){_0x4ea31e=_0x4ea31e-0x0;var _0x151f45=_0xe0e8[_0x4ea31e];return _0x151f45;};'use strict';var Sequelize=require(_0x8e0e('0x0'));module[_0x8e0e('0x1')]={'priority':{'type':Sequelize[_0x8e0e('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8e0e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8e0e('0x4')],'defaultValue':_0x8e0e('0x5')}}; \ No newline at end of file +var _0x42c5=['sequelize','exports','noop','TEXT','STRING'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x42c5,0x172));var _0x542c=function(_0x13c382,_0x3215af){_0x13c382=_0x13c382-0x0;var _0x51b131=_0x42c5[_0x13c382];return _0x51b131;};'use strict';var Sequelize=require(_0x542c('0x0'));module[_0x542c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x542c('0x2')},'appdata':{'type':Sequelize[_0x542c('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x542c('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 16e8122..e67c0dc 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 _0x2270=['catch','find','create','body','update','params','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','stack','name','send','map','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','merge','options','FaxApplication','include','findAll','rows'];(function(_0x563b3f,_0x2458a5){var _0x5e1e0f=function(_0x2aefc6){while(--_0x2aefc6){_0x563b3f['push'](_0x563b3f['shift']());}};_0x5e1e0f(++_0x2458a5);}(_0x2270,0xd8));var _0x0227=function(_0x32f1f8,_0x5aaef5){_0x32f1f8=_0x32f1f8-0x0;var _0x58bdf1=_0x2270[_0x32f1f8];return _0x58bdf1;};'use strict';var emlformat=require(_0x0227('0x0'));var rimraf=require(_0x0227('0x1'));var zipdir=require(_0x0227('0x2'));var jsonpatch=require(_0x0227('0x3'));var rp=require(_0x0227('0x4'));var moment=require(_0x0227('0x5'));var BPromise=require(_0x0227('0x6'));var Mustache=require('mustache');var util=require(_0x0227('0x7'));var path=require(_0x0227('0x8'));var sox=require(_0x0227('0x9'));var csv=require(_0x0227('0xa'));var ejs=require(_0x0227('0xb'));var fs=require('fs');var fs_extra=require(_0x0227('0xc'));var _=require('lodash');var squel=require(_0x0227('0xd'));var crypto=require(_0x0227('0xe'));var jsforce=require(_0x0227('0xf'));var deskjs=require(_0x0227('0x10'));var toCsv=require(_0x0227('0xa'));var querystring=require('querystring');var Papa=require(_0x0227('0x11'));var Redis=require('ioredis');var authService=require(_0x0227('0x12'));var qs=require(_0x0227('0x13'));var as=require(_0x0227('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0227('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0227('0x16'));var db=require(_0x0227('0x17'))['db'];function respondWithStatusCode(_0x35e837,_0x16b746){_0x16b746=_0x16b746||0xcc;return function(_0x435798){if(_0x435798){return _0x35e837[_0x0227('0x18')](_0x16b746);}return _0x35e837[_0x0227('0x19')](_0x16b746)[_0x0227('0x1a')]();};}function respondWithResult(_0x2bb9b5,_0x588147){_0x588147=_0x588147||0xc8;return function(_0xe0f358){if(_0xe0f358){return _0x2bb9b5[_0x0227('0x19')](_0x588147)[_0x0227('0x1b')](_0xe0f358);}};}function respondWithFilteredResult(_0x13b27b,_0x511f04){return function(_0x380310){if(_0x380310){var _0x2b6792=typeof _0x511f04[_0x0227('0x1c')]===_0x0227('0x1d')&&typeof _0x511f04[_0x0227('0x1e')]===_0x0227('0x1d');var _0x5be601=_0x380310[_0x0227('0x1f')];var _0x408659=_0x2b6792?0x0:_0x511f04[_0x0227('0x1c')];var _0xe110e4=_0x2b6792?_0x380310['count']:_0x511f04[_0x0227('0x1c')]+_0x511f04[_0x0227('0x1e')];var _0x5d1243;if(_0xe110e4>=_0x5be601){_0xe110e4=_0x5be601;_0x5d1243=0xc8;}else{_0x5d1243=0xce;}_0x13b27b[_0x0227('0x19')](_0x5d1243);return _0x13b27b[_0x0227('0x20')]('Content-Range',_0x408659+'-'+_0xe110e4+'/'+_0x5be601)[_0x0227('0x1b')](_0x380310);}return null;};}function patchUpdates(_0x8ad270){return function(_0x552e50){try{jsonpatch[_0x0227('0x21')](_0x552e50,_0x8ad270,!![]);}catch(_0x50dd2b){return BPromise[_0x0227('0x22')](_0x50dd2b);}return _0x552e50['save']();};}function saveUpdates(_0x27fccf,_0x3a1454){return function(_0x4ad67d){if(_0x4ad67d){return _0x4ad67d['update'](_0x27fccf)[_0x0227('0x23')](function(_0x45e16c){return _0x45e16c;});}return null;};}function removeEntity(_0x3ab251,_0xca0676){return function(_0x40d146){if(_0x40d146){return _0x40d146[_0x0227('0x24')]()['then'](function(){_0x3ab251[_0x0227('0x19')](0xcc)[_0x0227('0x1a')]();});}};}function handleEntityNotFound(_0x33152f,_0x2502fd){return function(_0x3949b5){if(!_0x3949b5){_0x33152f['sendStatus'](0x194);}return _0x3949b5;};}function handleError(_0x17aee8,_0x4a4c83){_0x4a4c83=_0x4a4c83||0x1f4;return function(_0x4ec9b9){logger[_0x0227('0x25')](_0x4ec9b9[_0x0227('0x26')]);if(_0x4ec9b9[_0x0227('0x27')]){delete _0x4ec9b9[_0x0227('0x27')];}_0x17aee8[_0x0227('0x19')](_0x4a4c83)[_0x0227('0x28')](_0x4ec9b9);};}exports['index']=function(_0x477d0f,_0x398e89){var _0x1b530e={},_0x5494a0={},_0x4895d9={'count':0x0,'rows':[]};var _0x268eb4=_[_0x0227('0x29')](db['FaxApplication'][_0x0227('0x2a')],function(_0x1e3f73){return{'name':_0x1e3f73['fieldName'],'type':_0x1e3f73['type'][_0x0227('0x2b')]};});_0x5494a0['model']=_[_0x0227('0x29')](_0x268eb4,'name');_0x5494a0[_0x0227('0x2c')]=_[_0x0227('0x2d')](_0x477d0f['query']);_0x5494a0[_0x0227('0x2e')]=_['intersection'](_0x5494a0[_0x0227('0x2f')],_0x5494a0['query']);_0x1b530e[_0x0227('0x30')]=_[_0x0227('0x31')](_0x5494a0[_0x0227('0x2f')],qs[_0x0227('0x32')](_0x477d0f[_0x0227('0x2c')][_0x0227('0x32')]));_0x1b530e['attributes']=_0x1b530e['attributes'][_0x0227('0x33')]?_0x1b530e[_0x0227('0x30')]:_0x5494a0[_0x0227('0x2f')];if(!_0x477d0f[_0x0227('0x2c')][_0x0227('0x34')](_0x0227('0x35'))){_0x1b530e[_0x0227('0x1e')]=qs[_0x0227('0x1e')](_0x477d0f['query'][_0x0227('0x1e')]);_0x1b530e['offset']=qs['offset'](_0x477d0f[_0x0227('0x2c')][_0x0227('0x1c')]);}_0x1b530e['order']=qs[_0x0227('0x36')](_0x477d0f['query']['sort']);_0x1b530e['where']=qs[_0x0227('0x2e')](_[_0x0227('0x37')](_0x477d0f[_0x0227('0x2c')],_0x5494a0[_0x0227('0x2e')]),_0x268eb4);if(_0x477d0f[_0x0227('0x2c')]['filter']){_0x1b530e[_0x0227('0x38')]=_['merge'](_0x1b530e[_0x0227('0x38')],{'$or':_[_0x0227('0x29')](_0x268eb4,function(_0x5768f2){if(_0x5768f2['type']!==_0x0227('0x39')){var _0x14b565={};_0x14b565[_0x5768f2[_0x0227('0x27')]]={'$like':'%'+_0x477d0f[_0x0227('0x2c')]['filter']+'%'};return _0x14b565;}})});}_0x1b530e=_[_0x0227('0x3a')]({},_0x1b530e,_0x477d0f[_0x0227('0x3b')]);var _0x2bf5cb={'where':_0x1b530e[_0x0227('0x38')]};return db[_0x0227('0x3c')]['count'](_0x2bf5cb)[_0x0227('0x23')](function(_0x5a778c){_0x4895d9[_0x0227('0x1f')]=_0x5a778c;if(_0x477d0f[_0x0227('0x2c')]['includeAll']){_0x1b530e[_0x0227('0x3d')]=[{'all':!![]}];}return db[_0x0227('0x3c')][_0x0227('0x3e')](_0x1b530e);})[_0x0227('0x23')](function(_0x20b688){_0x4895d9[_0x0227('0x3f')]=_0x20b688;return _0x4895d9;})[_0x0227('0x23')](respondWithFilteredResult(_0x398e89,_0x1b530e))[_0x0227('0x40')](handleError(_0x398e89,null));};exports['show']=function(_0x51f15a,_0xc5169d){var _0x5f4c3d={'raw':!![],'where':{'id':_0x51f15a['params']['id']}},_0x27f268={};_0x27f268[_0x0227('0x2f')]=_['keys'](db[_0x0227('0x3c')][_0x0227('0x2a')]);_0x27f268[_0x0227('0x2c')]=_[_0x0227('0x2d')](_0x51f15a['query']);_0x27f268['filters']=_['intersection'](_0x27f268[_0x0227('0x2f')],_0x27f268['query']);_0x5f4c3d[_0x0227('0x30')]=_[_0x0227('0x31')](_0x27f268[_0x0227('0x2f')],qs[_0x0227('0x32')](_0x51f15a[_0x0227('0x2c')][_0x0227('0x32')]));_0x5f4c3d['attributes']=_0x5f4c3d['attributes'][_0x0227('0x33')]?_0x5f4c3d[_0x0227('0x30')]:_0x27f268['model'];if(_0x51f15a['query']['includeAll']){_0x5f4c3d['include']=[{'all':!![]}];}_0x5f4c3d=_[_0x0227('0x3a')]({},_0x5f4c3d,_0x51f15a[_0x0227('0x3b')]);return db[_0x0227('0x3c')][_0x0227('0x41')](_0x5f4c3d)[_0x0227('0x23')](handleEntityNotFound(_0xc5169d,null))[_0x0227('0x23')](respondWithResult(_0xc5169d,null))[_0x0227('0x40')](handleError(_0xc5169d,null));};exports[_0x0227('0x42')]=function(_0x5d2c70,_0x5c7c37){return db[_0x0227('0x3c')][_0x0227('0x42')](_0x5d2c70[_0x0227('0x43')],{})[_0x0227('0x23')](respondWithResult(_0x5c7c37,0xc9))[_0x0227('0x40')](handleError(_0x5c7c37,null));};exports[_0x0227('0x44')]=function(_0x18fc5f,_0x568cc9){if(_0x18fc5f[_0x0227('0x43')]['id']){delete _0x18fc5f[_0x0227('0x43')]['id'];}return db[_0x0227('0x3c')][_0x0227('0x41')]({'where':{'id':_0x18fc5f['params']['id']}})[_0x0227('0x23')](handleEntityNotFound(_0x568cc9,null))[_0x0227('0x23')](saveUpdates(_0x18fc5f['body'],null))[_0x0227('0x23')](respondWithResult(_0x568cc9,null))['catch'](handleError(_0x568cc9,null));};exports[_0x0227('0x24')]=function(_0x2c3940,_0x49bd5d){return db[_0x0227('0x3c')]['find']({'where':{'id':_0x2c3940[_0x0227('0x45')]['id']}})[_0x0227('0x23')](handleEntityNotFound(_0x49bd5d,null))[_0x0227('0x23')](removeEntity(_0x49bd5d,null))['catch'](handleError(_0x49bd5d,null));}; \ No newline at end of file +var _0xb552=['attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','include','FaxApplication','findAll','rows','catch','show','params','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','keys','query','filters','intersection','model','fields'];(function(_0x57b3ab,_0x524afb){var _0x49eac4=function(_0xbbb054){while(--_0xbbb054){_0x57b3ab['push'](_0x57b3ab['shift']());}};_0x49eac4(++_0x524afb);}(_0xb552,0x65));var _0x2b55=function(_0x1779ca,_0x458323){_0x1779ca=_0x1779ca-0x0;var _0x1c2e9c=_0xb552[_0x1779ca];return _0x1c2e9c;};'use strict';var emlformat=require(_0x2b55('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b55('0x1'));var jsonpatch=require(_0x2b55('0x2'));var rp=require(_0x2b55('0x3'));var moment=require(_0x2b55('0x4'));var BPromise=require(_0x2b55('0x5'));var Mustache=require(_0x2b55('0x6'));var util=require('util');var path=require(_0x2b55('0x7'));var sox=require(_0x2b55('0x8'));var csv=require(_0x2b55('0x9'));var ejs=require(_0x2b55('0xa'));var fs=require('fs');var fs_extra=require(_0x2b55('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b55('0xc'));var jsforce=require(_0x2b55('0xd'));var deskjs=require(_0x2b55('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2b55('0xf'));var Papa=require(_0x2b55('0x10'));var Redis=require(_0x2b55('0x11'));var authService=require(_0x2b55('0x12'));var qs=require(_0x2b55('0x13'));var as=require(_0x2b55('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b55('0x15'))(_0x2b55('0x16'));var utils=require(_0x2b55('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b55('0x18'));var db=require(_0x2b55('0x19'))['db'];function respondWithStatusCode(_0x5d2110,_0x57c697){_0x57c697=_0x57c697||0xcc;return function(_0x5e708c){if(_0x5e708c){return _0x5d2110[_0x2b55('0x1a')](_0x57c697);}return _0x5d2110[_0x2b55('0x1b')](_0x57c697)[_0x2b55('0x1c')]();};}function respondWithResult(_0x14f811,_0x42061e){_0x42061e=_0x42061e||0xc8;return function(_0x2a32c0){if(_0x2a32c0){return _0x14f811[_0x2b55('0x1b')](_0x42061e)[_0x2b55('0x1d')](_0x2a32c0);}};}function respondWithFilteredResult(_0xf4d8a6,_0x3f0661){return function(_0x9b8486){if(_0x9b8486){var _0x549677=typeof _0x3f0661[_0x2b55('0x1e')]==='undefined'&&typeof _0x3f0661['limit']===_0x2b55('0x1f');var _0x2e952d=_0x9b8486[_0x2b55('0x20')];var _0x22edd8=_0x549677?0x0:_0x3f0661[_0x2b55('0x1e')];var _0x44c687=_0x549677?_0x9b8486['count']:_0x3f0661[_0x2b55('0x1e')]+_0x3f0661['limit'];var _0x2d1ac9;if(_0x44c687>=_0x2e952d){_0x44c687=_0x2e952d;_0x2d1ac9=0xc8;}else{_0x2d1ac9=0xce;}_0xf4d8a6[_0x2b55('0x1b')](_0x2d1ac9);return _0xf4d8a6[_0x2b55('0x21')](_0x2b55('0x22'),_0x22edd8+'-'+_0x44c687+'/'+_0x2e952d)[_0x2b55('0x1d')](_0x9b8486);}return null;};}function patchUpdates(_0x4c3fb1){return function(_0x3a4fb8){try{jsonpatch[_0x2b55('0x23')](_0x3a4fb8,_0x4c3fb1,!![]);}catch(_0x270f81){return BPromise['reject'](_0x270f81);}return _0x3a4fb8[_0x2b55('0x24')]();};}function saveUpdates(_0x55c2b7,_0x459e86){return function(_0x3f8791){if(_0x3f8791){return _0x3f8791[_0x2b55('0x25')](_0x55c2b7)[_0x2b55('0x26')](function(_0x282a3b){return _0x282a3b;});}return null;};}function removeEntity(_0x47d0ba,_0xf37ef7){return function(_0x491530){if(_0x491530){return _0x491530[_0x2b55('0x27')]()[_0x2b55('0x26')](function(){_0x47d0ba[_0x2b55('0x1b')](0xcc)[_0x2b55('0x1c')]();});}};}function handleEntityNotFound(_0x3fd358,_0x9d485a){return function(_0x501cbc){if(!_0x501cbc){_0x3fd358[_0x2b55('0x1a')](0x194);}return _0x501cbc;};}function handleError(_0xf6cfc9,_0x21f203){_0x21f203=_0x21f203||0x1f4;return function(_0x2d9dcb){logger[_0x2b55('0x28')](_0x2d9dcb[_0x2b55('0x29')]);if(_0x2d9dcb[_0x2b55('0x2a')]){delete _0x2d9dcb['name'];}_0xf6cfc9['status'](_0x21f203)[_0x2b55('0x2b')](_0x2d9dcb);};}exports[_0x2b55('0x2c')]=function(_0x1d2132,_0x434c41){var _0x25d7f7={},_0x214f06={},_0x6c21ac={'count':0x0,'rows':[]};var _0x2e2eb8=_['map'](db['FaxApplication'][_0x2b55('0x2d')],function(_0xc6223){return{'name':_0xc6223['fieldName'],'type':_0xc6223[_0x2b55('0x2e')]['key']};});_0x214f06['model']=_['map'](_0x2e2eb8,'name');_0x214f06['query']=_[_0x2b55('0x2f')](_0x1d2132[_0x2b55('0x30')]);_0x214f06[_0x2b55('0x31')]=_[_0x2b55('0x32')](_0x214f06[_0x2b55('0x33')],_0x214f06['query']);_0x25d7f7['attributes']=_[_0x2b55('0x32')](_0x214f06[_0x2b55('0x33')],qs['fields'](_0x1d2132[_0x2b55('0x30')][_0x2b55('0x34')]));_0x25d7f7[_0x2b55('0x35')]=_0x25d7f7[_0x2b55('0x35')][_0x2b55('0x36')]?_0x25d7f7['attributes']:_0x214f06['model'];if(!_0x1d2132[_0x2b55('0x30')][_0x2b55('0x37')](_0x2b55('0x38'))){_0x25d7f7['limit']=qs[_0x2b55('0x39')](_0x1d2132[_0x2b55('0x30')][_0x2b55('0x39')]);_0x25d7f7[_0x2b55('0x1e')]=qs[_0x2b55('0x1e')](_0x1d2132[_0x2b55('0x30')]['offset']);}_0x25d7f7['order']=qs['sort'](_0x1d2132['query'][_0x2b55('0x3a')]);_0x25d7f7['where']=qs['filters'](_[_0x2b55('0x3b')](_0x1d2132[_0x2b55('0x30')],_0x214f06['filters']),_0x2e2eb8);if(_0x1d2132[_0x2b55('0x30')][_0x2b55('0x3c')]){_0x25d7f7[_0x2b55('0x3d')]=_[_0x2b55('0x3e')](_0x25d7f7[_0x2b55('0x3d')],{'$or':_[_0x2b55('0x3f')](_0x2e2eb8,function(_0x1d7dc3){if(_0x1d7dc3[_0x2b55('0x2e')]!==_0x2b55('0x40')){var _0x1f398c={};_0x1f398c[_0x1d7dc3[_0x2b55('0x2a')]]={'$like':'%'+_0x1d2132[_0x2b55('0x30')][_0x2b55('0x3c')]+'%'};return _0x1f398c;}})});}_0x25d7f7=_[_0x2b55('0x3e')]({},_0x25d7f7,_0x1d2132['options']);var _0x57d509={'where':_0x25d7f7[_0x2b55('0x3d')]};return db['FaxApplication']['count'](_0x57d509)[_0x2b55('0x26')](function(_0x32dd3d){_0x6c21ac[_0x2b55('0x20')]=_0x32dd3d;if(_0x1d2132['query'][_0x2b55('0x41')]){_0x25d7f7[_0x2b55('0x42')]=[{'all':!![]}];}return db[_0x2b55('0x43')][_0x2b55('0x44')](_0x25d7f7);})[_0x2b55('0x26')](function(_0x33043b){_0x6c21ac[_0x2b55('0x45')]=_0x33043b;return _0x6c21ac;})[_0x2b55('0x26')](respondWithFilteredResult(_0x434c41,_0x25d7f7))[_0x2b55('0x46')](handleError(_0x434c41,null));};exports[_0x2b55('0x47')]=function(_0x2853d2,_0x5a5e65){var _0x5eedd6={'raw':!![],'where':{'id':_0x2853d2[_0x2b55('0x48')]['id']}},_0x4dbb37={};_0x4dbb37[_0x2b55('0x33')]=_[_0x2b55('0x2f')](db[_0x2b55('0x43')]['rawAttributes']);_0x4dbb37['query']=_[_0x2b55('0x2f')](_0x2853d2[_0x2b55('0x30')]);_0x4dbb37[_0x2b55('0x31')]=_[_0x2b55('0x32')](_0x4dbb37[_0x2b55('0x33')],_0x4dbb37[_0x2b55('0x30')]);_0x5eedd6['attributes']=_[_0x2b55('0x32')](_0x4dbb37['model'],qs['fields'](_0x2853d2[_0x2b55('0x30')][_0x2b55('0x34')]));_0x5eedd6[_0x2b55('0x35')]=_0x5eedd6[_0x2b55('0x35')][_0x2b55('0x36')]?_0x5eedd6[_0x2b55('0x35')]:_0x4dbb37[_0x2b55('0x33')];if(_0x2853d2[_0x2b55('0x30')][_0x2b55('0x41')]){_0x5eedd6['include']=[{'all':!![]}];}_0x5eedd6=_['merge']({},_0x5eedd6,_0x2853d2[_0x2b55('0x49')]);return db['FaxApplication'][_0x2b55('0x4a')](_0x5eedd6)['then'](handleEntityNotFound(_0x5a5e65,null))[_0x2b55('0x26')](respondWithResult(_0x5a5e65,null))[_0x2b55('0x46')](handleError(_0x5a5e65,null));};exports[_0x2b55('0x4b')]=function(_0x262506,_0x33a6e2){return db[_0x2b55('0x43')][_0x2b55('0x4b')](_0x262506[_0x2b55('0x4c')],{})['then'](respondWithResult(_0x33a6e2,0xc9))[_0x2b55('0x46')](handleError(_0x33a6e2,null));};exports[_0x2b55('0x25')]=function(_0x531911,_0x44a6f0){if(_0x531911[_0x2b55('0x4c')]['id']){delete _0x531911[_0x2b55('0x4c')]['id'];}return db['FaxApplication'][_0x2b55('0x4a')]({'where':{'id':_0x531911[_0x2b55('0x48')]['id']}})[_0x2b55('0x26')](handleEntityNotFound(_0x44a6f0,null))[_0x2b55('0x26')](saveUpdates(_0x531911['body'],null))[_0x2b55('0x26')](respondWithResult(_0x44a6f0,null))[_0x2b55('0x46')](handleError(_0x44a6f0,null));};exports[_0x2b55('0x27')]=function(_0x6f8c1d,_0x4d814c){return db[_0x2b55('0x43')][_0x2b55('0x4a')]({'where':{'id':_0x6f8c1d[_0x2b55('0x48')]['id']}})[_0x2b55('0x26')](handleEntityNotFound(_0x4d814c,null))[_0x2b55('0x26')](removeEntity(_0x4d814c,null))[_0x2b55('0x46')](handleError(_0x4d814c,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 859684d..0e4d389 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 _0xc673=['moment','bluebird','path','rimraf','exports','define','FaxApplication','utf8mb4_unicode_ci','util','api'];(function(_0x4d6c04,_0x5d28c4){var _0x6ad814=function(_0xa0598a){while(--_0xa0598a){_0x4d6c04['push'](_0x4d6c04['shift']());}};_0x6ad814(++_0x5d28c4);}(_0xc673,0x120));var _0x3c67=function(_0x1c05d9,_0x5b1233){_0x1c05d9=_0x1c05d9-0x0;var _0x409f7e=_0xc673[_0x1c05d9];return _0x409f7e;};'use strict';var _=require('lodash');var util=require(_0x3c67('0x0'));var logger=require('../../config/logger')(_0x3c67('0x1'));var moment=require(_0x3c67('0x2'));var BPromise=require(_0x3c67('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c67('0x4'));var rimraf=require(_0x3c67('0x5'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x3c67('0x6')]=function(_0x4c69cc,_0x3f4359){return _0x4c69cc[_0x3c67('0x7')](_0x3c67('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3c67('0x9')});}; \ No newline at end of file +var _0xf671=['bluebird','request-promise','rimraf','../../config/environment','exports','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x18baf4,_0x33086b){var _0x278ed1=function(_0x3ea0a2){while(--_0x3ea0a2){_0x18baf4['push'](_0x18baf4['shift']());}};_0x278ed1(++_0x33086b);}(_0xf671,0xa4));var _0x1f67=function(_0x22e811,_0x3d83c8){_0x22e811=_0x22e811-0x0;var _0x170a4c=_0xf671[_0x22e811];return _0x170a4c;};'use strict';var _=require(_0x1f67('0x0'));var util=require(_0x1f67('0x1'));var logger=require(_0x1f67('0x2'))(_0x1f67('0x3'));var moment=require('moment');var BPromise=require(_0x1f67('0x4'));var rp=require(_0x1f67('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f67('0x6'));var config=require(_0x1f67('0x7'));var attributes=require('./faxApplication.attributes');module[_0x1f67('0x8')]=function(_0x15a087,_0x1c7342){return _0x15a087['define'](_0x1f67('0x9'),attributes,{'tableName':_0x1f67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f67('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9086422..4e0ef6c 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 _0x5e4c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','catch','lodash','util','moment'];(function(_0x1e758b,_0x2ca30b){var _0x458a0e=function(_0x3d46d4){while(--_0x3d46d4){_0x1e758b['push'](_0x1e758b['shift']());}};_0x458a0e(++_0x2ca30b);}(_0x5e4c,0xd6));var _0xc5e4=function(_0xf8be3f,_0x59035b){_0xf8be3f=_0xf8be3f-0x0;var _0x3bed87=_0x5e4c[_0xf8be3f];return _0x3bed87;};'use strict';var _=require(_0xc5e4('0x0'));var util=require(_0xc5e4('0x1'));var moment=require(_0xc5e4('0x2'));var BPromise=require(_0xc5e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5e4('0x4'));var db=require(_0xc5e4('0x5'))['db'];var utils=require(_0xc5e4('0x6'));var logger=require(_0xc5e4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc5e4('0x8'));var client=jayson['client'][_0xc5e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23362a,_0x42df7c,_0x30a958){return new BPromise(function(_0x1ec748,_0x477d26){return client[_0xc5e4('0xa')](_0x23362a,_0x30a958)['then'](function(_0x25baac){logger[_0xc5e4('0xb')](_0xc5e4('0xc'),_0x42df7c,_0xc5e4('0xd'));logger[_0xc5e4('0xe')](_0xc5e4('0xf'),_0x42df7c,_0xc5e4('0xd'),JSON[_0xc5e4('0x10')](_0x25baac));if(_0x25baac['error']){if(_0x25baac[_0xc5e4('0x11')][_0xc5e4('0x12')]===0x1f4){logger[_0xc5e4('0x11')]('FaxApplication,\x20%s,\x20%s',_0x42df7c,_0x25baac['error'][_0xc5e4('0x13')]);return _0x477d26(_0x25baac[_0xc5e4('0x11')][_0xc5e4('0x13')]);}logger[_0xc5e4('0x11')](_0xc5e4('0xc'),_0x42df7c,_0x25baac[_0xc5e4('0x11')][_0xc5e4('0x13')]);return _0x1ec748(_0x25baac[_0xc5e4('0x11')][_0xc5e4('0x13')]);}else{logger[_0xc5e4('0xb')](_0xc5e4('0xc'),_0x42df7c,'request\x20sent');_0x1ec748(_0x25baac[_0xc5e4('0x14')]['message']);}})['catch'](function(_0x302cfc){logger[_0xc5e4('0x11')](_0xc5e4('0xc'),_0x42df7c,_0x302cfc);_0x477d26(_0x302cfc);});});}exports['UpdateFaxApplication']=function(_0xb12285){var _0x1037f4=this;return new Promise(function(_0x3dc7fc,_0x57d6ea){return db[_0xc5e4('0x15')][_0xc5e4('0x16')](_0xb12285[_0xc5e4('0x17')],{'raw':_0xb12285['options']?_0xb12285[_0xc5e4('0x18')][_0xc5e4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb12285['options']?_0xb12285[_0xc5e4('0x18')][_0xc5e4('0x1a')]||null:null,'attributes':_0xb12285[_0xc5e4('0x18')]?_0xb12285[_0xc5e4('0x18')][_0xc5e4('0x1b')]||null:null,'limit':_0xb12285[_0xc5e4('0x18')]?_0xb12285[_0xc5e4('0x18')][_0xc5e4('0x1c')]||null:null})['then'](function(_0x359d54){logger['info'](_0xc5e4('0x1d'),_0xb12285);logger[_0xc5e4('0xe')](_0xc5e4('0x1d'),_0xb12285,JSON[_0xc5e4('0x10')](_0x359d54));_0x3dc7fc(_0x359d54);})[_0xc5e4('0x1e')](function(_0x67fb5f){logger[_0xc5e4('0x11')](_0xc5e4('0x1d'),_0x67fb5f[_0xc5e4('0x13')],_0xb12285);_0x57d6ea(_0x1037f4[_0xc5e4('0x11')](0x1f4,_0x67fb5f['message']));});});}; \ No newline at end of file +var _0x2dd1=['jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x2dd1,0x1a9));var _0x12dd=function(_0x40ded2,_0x59ea0e){_0x40ded2=_0x40ded2-0x0;var _0x59a9f6=_0x2dd1[_0x40ded2];return _0x59a9f6;};'use strict';var _=require(_0x12dd('0x0'));var util=require(_0x12dd('0x1'));var moment=require('moment');var BPromise=require(_0x12dd('0x2'));var rs=require(_0x12dd('0x3'));var fs=require('fs');var Redis=require(_0x12dd('0x4'));var db=require(_0x12dd('0x5'))['db'];var utils=require(_0x12dd('0x6'));var logger=require(_0x12dd('0x7'))(_0x12dd('0x8'));var config=require('../../config/environment');var jayson=require(_0x12dd('0x9'));var client=jayson[_0x12dd('0xa')][_0x12dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f4b23,_0x34f0ca,_0x50d040){return new BPromise(function(_0x188710,_0x107e58){return client[_0x12dd('0xc')](_0x1f4b23,_0x50d040)[_0x12dd('0xd')](function(_0x38dd5b){logger[_0x12dd('0xe')](_0x12dd('0xf'),_0x34f0ca,_0x12dd('0x10'));logger[_0x12dd('0x11')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x34f0ca,_0x12dd('0x10'),JSON[_0x12dd('0x12')](_0x38dd5b));if(_0x38dd5b[_0x12dd('0x13')]){if(_0x38dd5b[_0x12dd('0x13')][_0x12dd('0x14')]===0x1f4){logger[_0x12dd('0x13')](_0x12dd('0xf'),_0x34f0ca,_0x38dd5b[_0x12dd('0x13')][_0x12dd('0x15')]);return _0x107e58(_0x38dd5b[_0x12dd('0x13')][_0x12dd('0x15')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x34f0ca,_0x38dd5b[_0x12dd('0x13')][_0x12dd('0x15')]);return _0x188710(_0x38dd5b[_0x12dd('0x13')][_0x12dd('0x15')]);}else{logger[_0x12dd('0xe')](_0x12dd('0xf'),_0x34f0ca,_0x12dd('0x10'));_0x188710(_0x38dd5b[_0x12dd('0x16')][_0x12dd('0x15')]);}})['catch'](function(_0x46c348){logger[_0x12dd('0x13')]('FaxApplication,\x20%s,\x20%s',_0x34f0ca,_0x46c348);_0x107e58(_0x46c348);});});}exports[_0x12dd('0x17')]=function(_0x177804){var _0x2c5e0f=this;return new Promise(function(_0x107a2d,_0x12c373){return db[_0x12dd('0x18')]['update'](_0x177804[_0x12dd('0x19')],{'raw':_0x177804[_0x12dd('0x1a')]?_0x177804[_0x12dd('0x1a')][_0x12dd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x177804[_0x12dd('0x1a')]?_0x177804[_0x12dd('0x1a')][_0x12dd('0x1c')]||null:null,'attributes':_0x177804[_0x12dd('0x1a')]?_0x177804['options']['attributes']||null:null,'limit':_0x177804[_0x12dd('0x1a')]?_0x177804[_0x12dd('0x1a')][_0x12dd('0x1d')]||null:null})[_0x12dd('0xd')](function(_0x41bf3e){logger[_0x12dd('0xe')](_0x12dd('0x17'),_0x177804);logger[_0x12dd('0x11')](_0x12dd('0x17'),_0x177804,JSON[_0x12dd('0x12')](_0x41bf3e));_0x107a2d(_0x41bf3e);})[_0x12dd('0x1e')](function(_0x48804f){logger[_0x12dd('0x13')](_0x12dd('0x17'),_0x48804f[_0x12dd('0x15')],_0x177804);_0x12c373(_0x2c5e0f['error'](0x1f4,_0x48804f[_0x12dd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 6664488..90531d2 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 _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x228e29,_0xc4e7e6){var _0x401123=function(_0x2dfa68){while(--_0x2dfa68){_0x228e29['push'](_0x228e29['shift']());}};_0x401123(++_0xc4e7e6);}(_0x5c00,0x17e));var _0x05c0=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x5c00[_0x351509];return _0x4e9861;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./faxApplication.controller','get'];(function(_0x284664,_0x455bfa){var _0x2e5d22=function(_0x40f40b){while(--_0x40f40b){_0x284664['push'](_0x284664['shift']());}};_0x2e5d22(++_0x455bfa);}(_0xda2d,0x102));var _0xdda2=function(_0x44f22b,_0x27b6f6){_0x44f22b=_0x44f22b-0x0;var _0x3602fd=_0xda2d[_0x44f22b];return _0x3602fd;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 647b7c2..e541d0b 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 _0x6a95=['ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x354ae6,_0x10f833){var _0x3c02b1=function(_0x68720b){while(--_0x68720b){_0x354ae6['push'](_0x354ae6['shift']());}};_0x3c02b1(++_0x10f833);}(_0x6a95,0x1db));var _0x56a9=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x6a95[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'closed':{'type':Sequelize[_0x56a9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x56a9('0x3')]},'disposition':{'type':Sequelize[_0x56a9('0x4')]},'secondDisposition':{'type':Sequelize[_0x56a9('0x4')]},'thirdDisposition':{'type':Sequelize[_0x56a9('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x56a9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x56a9('0x5')]('in',_0x56a9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x56a9('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x56a9('0x5')]('in',_0x56a9('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x56a9('0x7')]}}; \ No newline at end of file +var _0x8f4c=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x3ab248,_0x1efdbd){var _0x2b7032=function(_0x2b827c){while(--_0x2b827c){_0x3ab248['push'](_0x3ab248['shift']());}};_0x2b7032(++_0x1efdbd);}(_0x8f4c,0x113));var _0xc8f4=function(_0x2acd24,_0xf315ac){_0x2acd24=_0x2acd24-0x0;var _0x546099=_0x8f4c[_0x2acd24];return _0x546099;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'closed':{'type':Sequelize[_0xc8f4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc8f4('0x3')]},'disposition':{'type':Sequelize[_0xc8f4('0x4')]},'secondDisposition':{'type':Sequelize[_0xc8f4('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc8f4('0x4')]},'read1stAt':{'type':Sequelize[_0xc8f4('0x3')]},'fax':{'type':Sequelize[_0xc8f4('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc8f4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xc8f4('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 35b9ea4..de5833e 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 _0xd02c=['Content-Range','update','then','destroy','error','name','send','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','params','describe','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','pick','where','FaxInteractionId','filter','merge','$gte','split','format','FaxMessage','count','addTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','server','files','attachments','transcript-%d-%s.zip','Attachment','createdAt','Messages','get','mkdirSync','basename','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','undefined','limit','offset','set'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xd02c,0x1e5));var _0xcd02=function(_0x3604bc,_0x491f9a){_0x3604bc=_0x3604bc-0x0;var _0x4b873d=_0xd02c[_0x3604bc];return _0x4b873d;};'use strict';var rimraf=require(_0xcd02('0x0'));var zipdir=require(_0xcd02('0x1'));var moment=require(_0xcd02('0x2'));var BPromise=require(_0xcd02('0x3'));var util=require('util');var path=require(_0xcd02('0x4'));var fs=require('fs');var _=require(_0xcd02('0x5'));var Redis=require(_0xcd02('0x6'));var interaction=require(_0xcd02('0x7'));var qs=require(_0xcd02('0x8'));var logger=require(_0xcd02('0x9'))(_0xcd02('0xa'));var config=require('../../config/environment');var db=require(_0xcd02('0xb'))['db'];config[_0xcd02('0xc')]=_[_0xcd02('0xd')](config[_0xcd02('0xc')],{'host':_0xcd02('0xe'),'port':0x18eb});var socket=require(_0xcd02('0xf'))(new Redis(config['redis']));require(_0xcd02('0x10'))['register'](socket);function respondWithStatusCode(_0x545470,_0x42e42b){_0x42e42b=_0x42e42b||0xcc;return function(_0x1f0b7f){if(_0x1f0b7f){return _0x545470[_0xcd02('0x11')](_0x42e42b);}return _0x545470[_0xcd02('0x12')](_0x42e42b)[_0xcd02('0x13')]();};}function respondWithResult(_0x21ec06,_0x55b09b){_0x55b09b=_0x55b09b||0xc8;return function(_0x58dbda){if(_0x58dbda){return _0x21ec06['status'](_0x55b09b)[_0xcd02('0x14')](_0x58dbda);}};}function respondWithFilteredResult(_0x17fbb3,_0x1fb1b4){return function(_0x44ae62){if(_0x44ae62){var _0x510a65=typeof _0x1fb1b4['offset']===_0xcd02('0x15')&&typeof _0x1fb1b4[_0xcd02('0x16')]===_0xcd02('0x15');var _0x2e5d2f=_0x44ae62['count'];var _0x17d338=_0x510a65?0x0:_0x1fb1b4[_0xcd02('0x17')];var _0x16d2df=_0x510a65?_0x44ae62['count']:_0x1fb1b4['offset']+_0x1fb1b4[_0xcd02('0x16')];var _0x6b1ee0;if(_0x16d2df>=_0x2e5d2f){_0x16d2df=_0x2e5d2f;_0x6b1ee0=0xc8;}else{_0x6b1ee0=0xce;}_0x17fbb3[_0xcd02('0x12')](_0x6b1ee0);return _0x17fbb3[_0xcd02('0x18')](_0xcd02('0x19'),_0x17d338+'-'+_0x16d2df+'/'+_0x2e5d2f)[_0xcd02('0x14')](_0x44ae62);}return null;};}function saveUpdates(_0x165fe2){return function(_0x1d7082){if(_0x1d7082){return _0x1d7082[_0xcd02('0x1a')](_0x165fe2)[_0xcd02('0x1b')](function(_0x581062){return _0x581062;});}return null;};}function removeEntity(_0x259a62){return function(_0x53c931){if(_0x53c931){return _0x53c931[_0xcd02('0x1c')]()[_0xcd02('0x1b')](function(){_0x259a62['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274af5){return function(_0x1ed6db){if(!_0x1ed6db){_0x274af5[_0xcd02('0x11')](0x194);}return _0x1ed6db;};}function handleError(_0x490673,_0x35f578){_0x35f578=_0x35f578||0x1f4;return function(_0x446770){logger[_0xcd02('0x1d')](_0x446770['stack']);if(_0x446770[_0xcd02('0x1e')]){delete _0x446770[_0xcd02('0x1e')];}_0x490673[_0xcd02('0x12')](_0x35f578)[_0xcd02('0x1f')](_0x446770);};}exports['index']=function(_0x280a6a,_0x4f63e9){var _0x157bd6={};var _0x47253f=_[_0xcd02('0x20')](db[_0xcd02('0x21')][_0xcd02('0x22')],function(_0x21dd8a){return{'name':_0x21dd8a[_0xcd02('0x23')],'type':_0x21dd8a[_0xcd02('0x24')][_0xcd02('0x25')]};});_0x157bd6=qs[_0xcd02('0x26')](_0x47253f,_0x280a6a);return interaction[_0xcd02('0x27')](_0xcd02('0x28'),_0x280a6a[_0xcd02('0x29')],_0x280a6a[_0xcd02('0x2a')],_0x157bd6,_0x47253f)[_0xcd02('0x1b')](respondWithFilteredResult(_0x4f63e9,_0x157bd6))[_0xcd02('0x2b')](handleError(_0x4f63e9,null));};exports[_0xcd02('0x2c')]=function(_0x9d290a,_0x10f349){var _0x5df121={'raw':![],'where':{'id':_0x9d290a['params']['id']}},_0x3b6ce5={};_0x3b6ce5[_0xcd02('0x2d')]=_[_0xcd02('0x2e')](db['FaxInteraction'][_0xcd02('0x22')]);_0x3b6ce5[_0xcd02('0x29')]=_[_0xcd02('0x2e')](_0x9d290a['query']);_0x3b6ce5[_0xcd02('0x2f')]=_[_0xcd02('0x30')](_0x3b6ce5[_0xcd02('0x2d')],_0x3b6ce5['query']);_0x5df121[_0xcd02('0x31')]=_[_0xcd02('0x30')](_0x3b6ce5[_0xcd02('0x2d')],qs['fields'](_0x9d290a['query'][_0xcd02('0x32')]));_0x5df121[_0xcd02('0x31')]=_0x5df121[_0xcd02('0x31')][_0xcd02('0x33')]?_0x5df121[_0xcd02('0x31')]:_0x3b6ce5['model'];if(_0x9d290a[_0xcd02('0x29')][_0xcd02('0x34')]){_0x5df121[_0xcd02('0x35')]=[{'all':!![]}];}_0x5df121=_['merge']({},_0x5df121,_0x9d290a[_0xcd02('0x36')]);return db[_0xcd02('0x21')][_0xcd02('0x37')](_0x5df121)[_0xcd02('0x1b')](handleEntityNotFound(_0x10f349,null))[_0xcd02('0x1b')](respondWithResult(_0x10f349,null))[_0xcd02('0x2b')](handleError(_0x10f349,null));};exports[_0xcd02('0x38')]=function(_0x22e785,_0x39a335){return db['FaxInteraction'][_0xcd02('0x38')](_0x22e785[_0xcd02('0x39')],{})[_0xcd02('0x1b')](respondWithResult(_0x39a335,0xc9))[_0xcd02('0x2b')](handleError(_0x39a335,null));};exports[_0xcd02('0x1a')]=function(_0x1ed52a,_0x16da8b){if(_0x1ed52a[_0xcd02('0x39')]['id']){delete _0x1ed52a[_0xcd02('0x39')]['id'];}return db[_0xcd02('0x21')][_0xcd02('0x37')]({'where':{'id':_0x1ed52a['params']['id']}})[_0xcd02('0x1b')](handleEntityNotFound(_0x16da8b,null))[_0xcd02('0x1b')](saveUpdates(_0x1ed52a[_0xcd02('0x39')],null))[_0xcd02('0x1b')](respondWithResult(_0x16da8b,null))['catch'](handleError(_0x16da8b,null));};exports[_0xcd02('0x1c')]=function(_0x488707,_0x2ad8d0){return db[_0xcd02('0x21')][_0xcd02('0x37')]({'where':{'id':_0x488707[_0xcd02('0x3a')]['id']}})[_0xcd02('0x1b')](handleEntityNotFound(_0x2ad8d0,null))['then'](removeEntity(_0x2ad8d0,null))[_0xcd02('0x2b')](handleError(_0x2ad8d0,null));};exports[_0xcd02('0x3b')]=function(_0x37c13e,_0x20ecf6){return db[_0xcd02('0x21')][_0xcd02('0x3b')]()[_0xcd02('0x1b')](respondWithResult(_0x20ecf6,null))[_0xcd02('0x2b')](handleError(_0x20ecf6,null));};exports['addMessage']=function(_0x150433,_0x10ff01){return db['FaxMessage'][_0xcd02('0x37')]({'where':{'id':_0x150433[_0xcd02('0x3a')]['id']}})[_0xcd02('0x1b')](handleEntityNotFound(_0x10ff01,null))[_0xcd02('0x1b')](function(_0x578cab){if(_0x578cab){return _0x578cab[_0xcd02('0x3c')](_0x150433[_0xcd02('0x39')][_0xcd02('0x3d')],_[_0xcd02('0x3e')](_0x150433[_0xcd02('0x39')],[_0xcd02('0x3d'),'id'])||{});}})[_0xcd02('0x1b')](respondWithResult(_0x10ff01,null))['catch'](handleError(_0x10ff01,null));};exports[_0xcd02('0x3f')]=function(_0x464201,_0x50e25c){var _0x303d5f={'raw':![],'where':{}};var _0x540c36={};var _0x3b79ff={'count':0x0,'rows':[]};return db[_0xcd02('0x21')]['findOne']({'where':{'id':_0x464201['params']['id']}})[_0xcd02('0x1b')](handleEntityNotFound(_0x50e25c,null))['then'](function(_0x445e9e){if(_0x445e9e){_0x540c36['model']=_[_0xcd02('0x2e')](db['FaxMessage'][_0xcd02('0x22')]);_0x540c36[_0xcd02('0x29')]=_[_0xcd02('0x2e')](_0x464201['query']);_0x540c36[_0xcd02('0x2f')]=_[_0xcd02('0x30')](_0x540c36[_0xcd02('0x2d')],_0x540c36[_0xcd02('0x29')]);_0x303d5f[_0xcd02('0x31')]=_['intersection'](_0x540c36[_0xcd02('0x2d')],qs[_0xcd02('0x32')](_0x464201[_0xcd02('0x29')][_0xcd02('0x32')]));_0x303d5f[_0xcd02('0x31')]=_0x303d5f['attributes']['length']?_0x303d5f[_0xcd02('0x31')]:_0x540c36['model'];if(!_0x464201[_0xcd02('0x29')][_0xcd02('0x40')](_0xcd02('0x41'))){_0x303d5f[_0xcd02('0x16')]=qs[_0xcd02('0x16')](_0x464201[_0xcd02('0x29')][_0xcd02('0x16')]);_0x303d5f[_0xcd02('0x17')]=qs['offset'](_0x464201['query'][_0xcd02('0x17')]);}_0x303d5f['order']=qs[_0xcd02('0x42')](_0x464201['query'][_0xcd02('0x42')]);_0x303d5f['where']=qs['filters'](_[_0xcd02('0x43')](_0x464201['query'],_0x540c36[_0xcd02('0x2f')]));_0x303d5f[_0xcd02('0x44')][_0xcd02('0x45')]=_0x445e9e['id'];if(_0x464201[_0xcd02('0x29')][_0xcd02('0x46')]){_0x303d5f[_0xcd02('0x44')]=_[_0xcd02('0x47')](_0x303d5f['where'],{'$or':_[_0xcd02('0x20')](_0x303d5f[_0xcd02('0x31')],function(_0x335f24){var _0x4818d4={};_0x4818d4[_0x335f24]={'$like':'%'+_0x464201[_0xcd02('0x29')][_0xcd02('0x46')]+'%'};return _0x4818d4;})});}if(_0x464201[_0xcd02('0x29')][_0xcd02('0x48')]){var _0x222e76=_0x464201[_0xcd02('0x29')][_0xcd02('0x48')][_0xcd02('0x49')](',');var _0xc8cc58={};_0xc8cc58[_0x222e76[0x0]]={'$gte':moment(_0x222e76[0x1])[_0xcd02('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x303d5f[_0xcd02('0x44')]=_[_0xcd02('0x47')](_0x303d5f[_0xcd02('0x44')],_0xc8cc58);}_0x303d5f=_[_0xcd02('0x47')]({},_0x303d5f,_0x464201[_0xcd02('0x36')]);return db[_0xcd02('0x4b')][_0xcd02('0x4c')]({'where':_0x303d5f[_0xcd02('0x44')]})[_0xcd02('0x1b')](function(_0x12146a){_0x3b79ff['count']=_0x12146a;if(_0x464201['query'][_0xcd02('0x34')]){_0x303d5f[_0xcd02('0x35')]=[{'all':!![]}];}return db[_0xcd02('0x4b')][_0xcd02('0x27')](_0x303d5f);})[_0xcd02('0x1b')](function(_0x2db0dd){_0x3b79ff['rows']=_0x2db0dd;return _0x3b79ff;});}})[_0xcd02('0x1b')](respondWithFilteredResult(_0x50e25c,_0x303d5f))[_0xcd02('0x2b')](handleError(_0x50e25c,null));};exports[_0xcd02('0x4d')]=function(_0x4ccfb9,_0x9b37f4){return db['FaxInteraction'][_0xcd02('0x37')]({'where':{'id':_0x4ccfb9[_0xcd02('0x3a')]['id']}})[_0xcd02('0x1b')](handleEntityNotFound(_0x9b37f4,null))[_0xcd02('0x1b')](function(_0x25eef7){if(_0x25eef7){return _0x25eef7['setTags'](_0x4ccfb9[_0xcd02('0x39')][_0xcd02('0x3d')],_[_0xcd02('0x3e')](_0x4ccfb9['body'],[_0xcd02('0x3d'),'id'])||{})[_0xcd02('0x4e')](function(){return db['Tag'][_0xcd02('0x27')]({'attributes':['id',_0xcd02('0x1e'),_0xcd02('0x4f')],'where':{'id':_0x4ccfb9['body'][_0xcd02('0x3d')]}});})[_0xcd02('0x1b')](function(_0x28416d){socket[_0xcd02('0x50')](_0xcd02('0x51'),{'id':Number(_0x4ccfb9[_0xcd02('0x3a')]['id']),'tags':_0x28416d||[]});return{'id':Number(_0x4ccfb9[_0xcd02('0x3a')]['id']),'tags':_0x28416d||[]};});}})['then'](respondWithResult(_0x9b37f4,null))[_0xcd02('0x2b')](handleError(_0x9b37f4,null));};exports['removeTags']=function(_0x5eb191,_0x3584c9){return db[_0xcd02('0x21')][_0xcd02('0x37')]({'where':{'id':_0x5eb191[_0xcd02('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3584c9,null))['then'](function(_0x20faec){if(_0x20faec){return _0x20faec[_0xcd02('0x52')](_0x5eb191['query'][_0xcd02('0x3d')]);}})['then'](respondWithStatusCode(_0x3584c9,null))[_0xcd02('0x2b')](handleError(_0x3584c9,null));};exports[_0xcd02('0x53')]=function(_0x57ceb6,_0x340a9b){var _0x234b03=moment()[_0xcd02('0x54')]()[_0xcd02('0x55')]();var _0x4851c7=path[_0xcd02('0x56')](config['root'],_0xcd02('0x57'),_0xcd02('0x58'),'tmp');var _0x187b98=path[_0xcd02('0x56')](config['root'],_0xcd02('0x57'),_0xcd02('0x58'),_0xcd02('0x59'));var _0x1b4aa3=path[_0xcd02('0x56')](_0x4851c7,_0x234b03);var _0x5da082=util[_0xcd02('0x4a')](_0xcd02('0x5a'),_0x57ceb6[_0xcd02('0x3a')]['id'],_0x234b03);var _0xf4b0ce=path[_0xcd02('0x56')](_0x4851c7,_0x5da082);var _0x4fbf5e=[];_0x4fbf5e['push']({'model':db[_0xcd02('0x5b')],'as':_0xcd02('0x5b'),'raw':!![]});var _0x368e12=[{'model':db[_0xcd02('0x4b')],'as':'Messages','attributes':['id',_0xcd02('0x39'),_0xcd02('0x5c')],'include':_0x4fbf5e}];return db[_0xcd02('0x21')][_0xcd02('0x37')]({'where':{'id':_0x57ceb6[_0xcd02('0x3a')]['id']},'include':_0x368e12})[_0xcd02('0x1b')](handleEntityNotFound(_0x340a9b,null))[_0xcd02('0x1b')](function(_0x17355e){if(_0x17355e&&_0x17355e[_0xcd02('0x5d')]){var _0x15f3f1=_0x17355e[_0xcd02('0x5e')]({'plain':!![]});fs[_0xcd02('0x5f')](_0x1b4aa3);for(var _0x3ca043=0x0;_0x3ca043<_0x15f3f1[_0xcd02('0x5d')][_0xcd02('0x33')];_0x3ca043++){var _0x1c5ca0=_0x15f3f1[_0xcd02('0x5d')][_0x3ca043]['Attachment'];if(_0x1c5ca0){var _0x42f34d=path['join'](_0x187b98,_0x1c5ca0[_0xcd02('0x60')]);if(fs['existsSync'](_0x42f34d)){fs['createReadStream'](_0x42f34d)['pipe'](fs[_0xcd02('0x61')](path['join'](_0x1b4aa3,_0x1c5ca0[_0xcd02('0x60')])));}}}return BPromise[_0xcd02('0x62')]()['then'](function(){return new BPromise(function(_0x412345,_0x4bffd3){zipdir(_0x1b4aa3,{'saveTo':_0xf4b0ce},function(_0x383ca8,_0x22493a){if(_0x383ca8)return _0x4bffd3(_0x383ca8);return _0x412345(_0x22493a);});})[_0xcd02('0x1b')](function(){return new BPromise(function(_0x1bdbfd,_0xa7be3d){rimraf(_0x1b4aa3,function(_0x5282d4){if(_0x5282d4)_0xa7be3d(_0x5282d4);return _0x1bdbfd();});});})['then'](function(){return _0x340a9b[_0xcd02('0x53')](_0xf4b0ce,_0x5da082,function(_0x1f1b29){if(_0x1f1b29){console[_0xcd02('0x63')](_0xcd02('0x64'),_0x1f1b29);}else{fs[_0xcd02('0x65')](_0xf4b0ce);}});});});}else{return _0x340a9b[_0xcd02('0x11')](0xc8);}})[_0xcd02('0x2b')](handleError(_0x340a9b,null));}; \ No newline at end of file +var _0xe22e=['YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','Tag','color','emit','removeTags','download','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','createReadStream','pipe','createWriteStream','resolve','err','unlinkSync','rimraf','moment','bluebird','path','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','undefined','count','offset','limit','json','update','then','destroy','end','error','name','send','index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','query','user','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','FaxMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','format'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xe22e,0x143));var _0xee22=function(_0x3494e8,_0x4111ea){_0x3494e8=_0x3494e8-0x0;var _0x20bd8c=_0xe22e[_0x3494e8];return _0x20bd8c;};'use strict';var rimraf=require(_0xee22('0x0'));var zipdir=require('zip-dir');var moment=require(_0xee22('0x1'));var BPromise=require(_0xee22('0x2'));var util=require('util');var path=require(_0xee22('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xee22('0x4'));var qs=require(_0xee22('0x5'));var logger=require(_0xee22('0x6'))('api');var config=require('../../config/environment');var db=require(_0xee22('0x7'))['db'];config['redis']=_[_0xee22('0x8')](config[_0xee22('0x9')],{'host':_0xee22('0xa'),'port':0x18eb});var socket=require(_0xee22('0xb'))(new Redis(config['redis']));require(_0xee22('0xc'))[_0xee22('0xd')](socket);function respondWithStatusCode(_0x3a5bd2,_0x20c9fa){_0x20c9fa=_0x20c9fa||0xcc;return function(_0x57ca1f){if(_0x57ca1f){return _0x3a5bd2[_0xee22('0xe')](_0x20c9fa);}return _0x3a5bd2[_0xee22('0xf')](_0x20c9fa)['end']();};}function respondWithResult(_0x3291dd,_0x20cf87){_0x20cf87=_0x20cf87||0xc8;return function(_0x5bda11){if(_0x5bda11){return _0x3291dd[_0xee22('0xf')](_0x20cf87)['json'](_0x5bda11);}};}function respondWithFilteredResult(_0x36c010,_0x4a6224){return function(_0x29cc57){if(_0x29cc57){var _0x4177be=typeof _0x4a6224['offset']==='undefined'&&typeof _0x4a6224['limit']===_0xee22('0x10');var _0x4e410b=_0x29cc57[_0xee22('0x11')];var _0x498f78=_0x4177be?0x0:_0x4a6224[_0xee22('0x12')];var _0x226c41=_0x4177be?_0x29cc57[_0xee22('0x11')]:_0x4a6224[_0xee22('0x12')]+_0x4a6224[_0xee22('0x13')];var _0x578ed3;if(_0x226c41>=_0x4e410b){_0x226c41=_0x4e410b;_0x578ed3=0xc8;}else{_0x578ed3=0xce;}_0x36c010[_0xee22('0xf')](_0x578ed3);return _0x36c010['set']('Content-Range',_0x498f78+'-'+_0x226c41+'/'+_0x4e410b)[_0xee22('0x14')](_0x29cc57);}return null;};}function saveUpdates(_0x1080a3){return function(_0x1aa8b5){if(_0x1aa8b5){return _0x1aa8b5[_0xee22('0x15')](_0x1080a3)[_0xee22('0x16')](function(_0x511265){return _0x511265;});}return null;};}function removeEntity(_0x31904b){return function(_0x49fb2b){if(_0x49fb2b){return _0x49fb2b[_0xee22('0x17')]()[_0xee22('0x16')](function(){_0x31904b['status'](0xcc)[_0xee22('0x18')]();});}};}function handleEntityNotFound(_0x4c676b){return function(_0x54428e){if(!_0x54428e){_0x4c676b['sendStatus'](0x194);}return _0x54428e;};}function handleError(_0x5a6931,_0x4a032b){_0x4a032b=_0x4a032b||0x1f4;return function(_0x3acb48){logger[_0xee22('0x19')](_0x3acb48['stack']);if(_0x3acb48[_0xee22('0x1a')]){delete _0x3acb48['name'];}_0x5a6931['status'](_0x4a032b)[_0xee22('0x1b')](_0x3acb48);};}exports[_0xee22('0x1c')]=function(_0x2d5b34,_0x59acee){var _0xe98a65={};var _0x195a64=_[_0xee22('0x1d')](db[_0xee22('0x1e')][_0xee22('0x1f')],function(_0x436167){return{'name':_0x436167[_0xee22('0x20')],'type':_0x436167['type'][_0xee22('0x21')]};});_0xe98a65=qs[_0xee22('0x22')](_0x195a64,_0x2d5b34);return interaction['findAll']('fax',_0x2d5b34[_0xee22('0x23')],_0x2d5b34[_0xee22('0x24')],_0xe98a65,_0x195a64)[_0xee22('0x16')](respondWithFilteredResult(_0x59acee,_0xe98a65))[_0xee22('0x25')](handleError(_0x59acee,null));};exports[_0xee22('0x26')]=function(_0x2ef339,_0x2ff3fe){var _0x462256={'raw':![],'where':{'id':_0x2ef339['params']['id']}},_0x4c8098={};_0x4c8098[_0xee22('0x27')]=_[_0xee22('0x28')](db['FaxInteraction'][_0xee22('0x1f')]);_0x4c8098[_0xee22('0x23')]=_[_0xee22('0x28')](_0x2ef339['query']);_0x4c8098[_0xee22('0x29')]=_[_0xee22('0x2a')](_0x4c8098[_0xee22('0x27')],_0x4c8098['query']);_0x462256[_0xee22('0x2b')]=_[_0xee22('0x2a')](_0x4c8098[_0xee22('0x27')],qs[_0xee22('0x2c')](_0x2ef339[_0xee22('0x23')]['fields']));_0x462256[_0xee22('0x2b')]=_0x462256['attributes'][_0xee22('0x2d')]?_0x462256[_0xee22('0x2b')]:_0x4c8098[_0xee22('0x27')];if(_0x2ef339[_0xee22('0x23')][_0xee22('0x2e')]){_0x462256[_0xee22('0x2f')]=[{'all':!![]}];}_0x462256=_[_0xee22('0x30')]({},_0x462256,_0x2ef339[_0xee22('0x31')]);return db[_0xee22('0x1e')][_0xee22('0x32')](_0x462256)[_0xee22('0x16')](handleEntityNotFound(_0x2ff3fe,null))[_0xee22('0x16')](respondWithResult(_0x2ff3fe,null))[_0xee22('0x25')](handleError(_0x2ff3fe,null));};exports[_0xee22('0x33')]=function(_0x2e08eb,_0x2ad096){return db[_0xee22('0x1e')][_0xee22('0x33')](_0x2e08eb[_0xee22('0x34')],{})[_0xee22('0x16')](respondWithResult(_0x2ad096,0xc9))[_0xee22('0x25')](handleError(_0x2ad096,null));};exports[_0xee22('0x15')]=function(_0x166c1e,_0x24013d){if(_0x166c1e['body']['id']){delete _0x166c1e[_0xee22('0x34')]['id'];}return db['FaxInteraction'][_0xee22('0x32')]({'where':{'id':_0x166c1e[_0xee22('0x35')]['id']}})[_0xee22('0x16')](handleEntityNotFound(_0x24013d,null))['then'](saveUpdates(_0x166c1e[_0xee22('0x34')],null))[_0xee22('0x16')](respondWithResult(_0x24013d,null))['catch'](handleError(_0x24013d,null));};exports[_0xee22('0x17')]=function(_0x1051c1,_0x53a9db){return db['FaxInteraction']['find']({'where':{'id':_0x1051c1[_0xee22('0x35')]['id']}})[_0xee22('0x16')](handleEntityNotFound(_0x53a9db,null))[_0xee22('0x16')](removeEntity(_0x53a9db,null))[_0xee22('0x25')](handleError(_0x53a9db,null));};exports[_0xee22('0x36')]=function(_0x24fa93,_0x1ea76b){return db['FaxInteraction'][_0xee22('0x36')]()[_0xee22('0x16')](respondWithResult(_0x1ea76b,null))['catch'](handleError(_0x1ea76b,null));};exports[_0xee22('0x37')]=function(_0x106597,_0x2135b7){return db[_0xee22('0x38')][_0xee22('0x32')]({'where':{'id':_0x106597[_0xee22('0x35')]['id']}})[_0xee22('0x16')](handleEntityNotFound(_0x2135b7,null))[_0xee22('0x16')](function(_0x3639d1){if(_0x3639d1){return _0x3639d1[_0xee22('0x37')](_0x106597[_0xee22('0x34')][_0xee22('0x39')],_[_0xee22('0x3a')](_0x106597['body'],[_0xee22('0x39'),'id'])||{});}})[_0xee22('0x16')](respondWithResult(_0x2135b7,null))[_0xee22('0x25')](handleError(_0x2135b7,null));};exports[_0xee22('0x3b')]=function(_0x32fc44,_0x1ac456){var _0x5231f2={'raw':![],'where':{}};var _0x26758a={};var _0x5c9f6c={'count':0x0,'rows':[]};return db[_0xee22('0x1e')]['findOne']({'where':{'id':_0x32fc44['params']['id']}})['then'](handleEntityNotFound(_0x1ac456,null))[_0xee22('0x16')](function(_0x2fd242){if(_0x2fd242){_0x26758a[_0xee22('0x27')]=_[_0xee22('0x28')](db[_0xee22('0x38')][_0xee22('0x1f')]);_0x26758a[_0xee22('0x23')]=_[_0xee22('0x28')](_0x32fc44[_0xee22('0x23')]);_0x26758a[_0xee22('0x29')]=_[_0xee22('0x2a')](_0x26758a['model'],_0x26758a[_0xee22('0x23')]);_0x5231f2[_0xee22('0x2b')]=_['intersection'](_0x26758a['model'],qs[_0xee22('0x2c')](_0x32fc44[_0xee22('0x23')][_0xee22('0x2c')]));_0x5231f2[_0xee22('0x2b')]=_0x5231f2[_0xee22('0x2b')]['length']?_0x5231f2[_0xee22('0x2b')]:_0x26758a[_0xee22('0x27')];if(!_0x32fc44['query'][_0xee22('0x3c')](_0xee22('0x3d'))){_0x5231f2[_0xee22('0x13')]=qs[_0xee22('0x13')](_0x32fc44[_0xee22('0x23')][_0xee22('0x13')]);_0x5231f2['offset']=qs[_0xee22('0x12')](_0x32fc44[_0xee22('0x23')]['offset']);}_0x5231f2['order']=qs[_0xee22('0x3e')](_0x32fc44[_0xee22('0x23')][_0xee22('0x3e')]);_0x5231f2[_0xee22('0x3f')]=qs[_0xee22('0x29')](_[_0xee22('0x40')](_0x32fc44['query'],_0x26758a[_0xee22('0x29')]));_0x5231f2[_0xee22('0x3f')]['FaxInteractionId']=_0x2fd242['id'];if(_0x32fc44[_0xee22('0x23')][_0xee22('0x41')]){_0x5231f2[_0xee22('0x3f')]=_[_0xee22('0x30')](_0x5231f2[_0xee22('0x3f')],{'$or':_[_0xee22('0x1d')](_0x5231f2['attributes'],function(_0x747735){var _0x1a827d={};_0x1a827d[_0x747735]={'$like':'%'+_0x32fc44[_0xee22('0x23')][_0xee22('0x41')]+'%'};return _0x1a827d;})});}if(_0x32fc44[_0xee22('0x23')][_0xee22('0x42')]){var _0x28b6d6=_0x32fc44[_0xee22('0x23')][_0xee22('0x42')][_0xee22('0x43')](',');var _0x5aac33={};_0x5aac33[_0x28b6d6[0x0]]={'$gte':moment(_0x28b6d6[0x1])[_0xee22('0x44')](_0xee22('0x45'))};_0x5231f2['where']=_[_0xee22('0x30')](_0x5231f2[_0xee22('0x3f')],_0x5aac33);}_0x5231f2=_[_0xee22('0x30')]({},_0x5231f2,_0x32fc44[_0xee22('0x31')]);return db[_0xee22('0x38')]['count']({'where':_0x5231f2['where']})[_0xee22('0x16')](function(_0x2abfa3){_0x5c9f6c[_0xee22('0x11')]=_0x2abfa3;if(_0x32fc44[_0xee22('0x23')][_0xee22('0x2e')]){_0x5231f2[_0xee22('0x2f')]=[{'all':!![]}];}return db[_0xee22('0x38')][_0xee22('0x46')](_0x5231f2);})['then'](function(_0x402781){_0x5c9f6c[_0xee22('0x47')]=_0x402781;return _0x5c9f6c;});}})['then'](respondWithFilteredResult(_0x1ac456,_0x5231f2))['catch'](handleError(_0x1ac456,null));};exports[_0xee22('0x48')]=function(_0x5e187c,_0x54ecdc){return db['FaxInteraction']['find']({'where':{'id':_0x5e187c[_0xee22('0x35')]['id']}})[_0xee22('0x16')](handleEntityNotFound(_0x54ecdc,null))['then'](function(_0x524c5b){if(_0x524c5b){return _0x524c5b[_0xee22('0x49')](_0x5e187c['body'][_0xee22('0x39')],_['omit'](_0x5e187c[_0xee22('0x34')],[_0xee22('0x39'),'id'])||{})['spread'](function(){return db[_0xee22('0x4a')]['findAll']({'attributes':['id','name',_0xee22('0x4b')],'where':{'id':_0x5e187c['body'][_0xee22('0x39')]}});})['then'](function(_0x1c2961){socket[_0xee22('0x4c')]('faxInteractionTags:save',{'id':Number(_0x5e187c['params']['id']),'tags':_0x1c2961||[]});return{'id':Number(_0x5e187c[_0xee22('0x35')]['id']),'tags':_0x1c2961||[]};});}})['then'](respondWithResult(_0x54ecdc,null))['catch'](handleError(_0x54ecdc,null));};exports[_0xee22('0x4d')]=function(_0x1d7da2,_0x4df959){return db[_0xee22('0x1e')][_0xee22('0x32')]({'where':{'id':_0x1d7da2['params']['id']}})[_0xee22('0x16')](handleEntityNotFound(_0x4df959,null))[_0xee22('0x16')](function(_0x5e0dff){if(_0x5e0dff){return _0x5e0dff[_0xee22('0x4d')](_0x1d7da2['query'][_0xee22('0x39')]);}})[_0xee22('0x16')](respondWithStatusCode(_0x4df959,null))[_0xee22('0x25')](handleError(_0x4df959,null));};exports[_0xee22('0x4e')]=function(_0x26b138,_0x114e8d){var _0x3fe30d=moment()['unix']()[_0xee22('0x4f')]();var _0x3b30d7=path['join'](config[_0xee22('0x50')],_0xee22('0x51'),_0xee22('0x52'),_0xee22('0x53'));var _0x5c0b44=path[_0xee22('0x54')](config[_0xee22('0x50')],'server',_0xee22('0x52'),_0xee22('0x55'));var _0x48e442=path[_0xee22('0x54')](_0x3b30d7,_0x3fe30d);var _0x4c57f1=util[_0xee22('0x44')](_0xee22('0x56'),_0x26b138[_0xee22('0x35')]['id'],_0x3fe30d);var _0x457172=path[_0xee22('0x54')](_0x3b30d7,_0x4c57f1);var _0x357465=[];_0x357465[_0xee22('0x57')]({'model':db[_0xee22('0x58')],'as':_0xee22('0x58'),'raw':!![]});var _0x14baf7=[{'model':db[_0xee22('0x38')],'as':_0xee22('0x59'),'attributes':['id','body',_0xee22('0x5a')],'include':_0x357465}];return db['FaxInteraction']['find']({'where':{'id':_0x26b138[_0xee22('0x35')]['id']},'include':_0x14baf7})[_0xee22('0x16')](handleEntityNotFound(_0x114e8d,null))[_0xee22('0x16')](function(_0x32e755){if(_0x32e755&&_0x32e755[_0xee22('0x59')]){var _0x5eb90a=_0x32e755['get']({'plain':!![]});fs[_0xee22('0x5b')](_0x48e442);for(var _0x70406f=0x0;_0x70406f<_0x5eb90a[_0xee22('0x59')][_0xee22('0x2d')];_0x70406f++){var _0x3b0c61=_0x5eb90a['Messages'][_0x70406f][_0xee22('0x58')];if(_0x3b0c61){var _0x355b43=path['join'](_0x5c0b44,_0x3b0c61['basename']);if(fs['existsSync'](_0x355b43)){fs[_0xee22('0x5c')](_0x355b43)[_0xee22('0x5d')](fs[_0xee22('0x5e')](path['join'](_0x48e442,_0x3b0c61['basename'])));}}}return BPromise[_0xee22('0x5f')]()[_0xee22('0x16')](function(){return new BPromise(function(_0x1ff5d5,_0x40b25a){zipdir(_0x48e442,{'saveTo':_0x457172},function(_0x12a6c5,_0x4628d5){if(_0x12a6c5)return _0x40b25a(_0x12a6c5);return _0x1ff5d5(_0x4628d5);});})[_0xee22('0x16')](function(){return new BPromise(function(_0x16caae,_0x324063){rimraf(_0x48e442,function(_0x23f16d){if(_0x23f16d)_0x324063(_0x23f16d);return _0x16caae();});});})['then'](function(){return _0x114e8d[_0xee22('0x4e')](_0x457172,_0x4c57f1,function(_0x24a511){if(_0x24a511){console['log'](_0xee22('0x60'),_0x24a511);}else{fs[_0xee22('0x61')](_0x457172);}});});});}else{return _0x114e8d[_0xee22('0xe')](0xc8);}})['catch'](handleError(_0x114e8d,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 5933364..0e82a91 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 _0xce13=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x4283b7,_0x22f102){var _0x333d48=function(_0x37e373){while(--_0x37e373){_0x4283b7['push'](_0x4283b7['shift']());}};_0x333d48(++_0x22f102);}(_0xce13,0xd5));var _0x3ce1=function(_0x44801a,_0xec2d43){_0x44801a=_0x44801a-0x0;var _0x2dda7f=_0xce13[_0x44801a];return _0x2dda7f;};'use strict';var EventEmitter=require(_0x3ce1('0x0'));var FaxInteraction=require(_0x3ce1('0x1'))['db'][_0x3ce1('0x2')];var FaxMessage=require(_0x3ce1('0x1'))['db'][_0x3ce1('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3ce1('0x4')](0x0);var events={'afterCreate':_0x3ce1('0x5'),'afterUpdate':_0x3ce1('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2a0f19){return function(_0x5b6c5c,_0x110471,_0x189368){_0x5b6c5c['getUsers']({'attributes':['id'],'raw':!![]})[_0x3ce1('0x7')](function(_0x2c5d5c){_0x5b6c5c[_0x3ce1('0x8')](_0x3ce1('0x9'),_0x2c5d5c[_0x3ce1('0xa')](function(_0x4b548e){return{'id':_0x4b548e['id']};}));return FaxMessage[_0x3ce1('0xb')]({'where':{'FaxInteractionId':_0x5b6c5c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3ce1('0x7')](function(_0x2ab775){_0x5b6c5c[_0x3ce1('0x8')](_0x3ce1('0xc'),_0x2ab775[_0x3ce1('0xd')]);FaxInteractionEvents[_0x3ce1('0xe')](_0x2a0f19+':'+_0x5b6c5c['id'],_0x5b6c5c);FaxInteractionEvents['emit'](_0x2a0f19,_0x5b6c5c);_0x189368(null);})[_0x3ce1('0xf')](_0x189368(null));};}for(var e in events){if(events[_0x3ce1('0x10')](e)){var event=events[e];FaxInteraction[_0x3ce1('0x11')](e,emitEvent(event));}}module[_0x3ce1('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x7435=['setDataValue','map','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x2b709b,_0x3395f8){var _0x4528fb=function(_0x10fa8c){while(--_0x10fa8c){_0x2b709b['push'](_0x2b709b['shift']());}};_0x4528fb(++_0x3395f8);}(_0x7435,0x1e9));var _0x5743=function(_0x469708,_0x3dabdd){_0x469708=_0x469708-0x0;var _0x12e7e9=_0x7435[_0x469708];return _0x12e7e9;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x5743('0x0')];var FaxMessage=require(_0x5743('0x1'))['db'][_0x5743('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5743('0x3')](0x0);var events={'afterCreate':_0x5743('0x4'),'afterUpdate':_0x5743('0x5'),'afterDestroy':_0x5743('0x6')};function emitEvent(_0x21d90d){return function(_0x1bc750,_0x3ee6c8,_0x56cfb8){_0x1bc750['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3a910a){_0x1bc750[_0x5743('0x7')]('Users',_0x3a910a[_0x5743('0x8')](function(_0x5eaad5){return{'id':_0x5eaad5['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1bc750['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5743('0x9')](function(_0xf8c3ad){_0x1bc750['setDataValue'](_0x5743('0xa'),_0xf8c3ad[_0x5743('0xb')]);FaxInteractionEvents[_0x5743('0xc')](_0x21d90d+':'+_0x1bc750['id'],_0x1bc750);FaxInteractionEvents[_0x5743('0xc')](_0x21d90d,_0x1bc750);_0x56cfb8(null);})[_0x5743('0xd')](_0x56cfb8(null));};}for(var e in events){if(events[_0x5743('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5743('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d92611b..d6892ff 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 _0x693d=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','closed','format'];(function(_0x4b95fc,_0x3c61f7){var _0x33c2b4=function(_0x138478){while(--_0x138478){_0x4b95fc['push'](_0x4b95fc['shift']());}};_0x33c2b4(++_0x3c61f7);}(_0x693d,0x68));var _0xd693=function(_0x4be15e,_0x55144f){_0x4be15e=_0x4be15e-0x0;var _0x1014c6=_0x693d[_0x4be15e];return _0x1014c6;};'use strict';var _=require(_0xd693('0x0'));var util=require('util');var logger=require(_0xd693('0x1'))(_0xd693('0x2'));var moment=require(_0xd693('0x3'));var BPromise=require('bluebird');var rp=require(_0xd693('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd693('0x5'));var config=require(_0xd693('0x6'));var attributes=require(_0xd693('0x7'));module[_0xd693('0x8')]=function(_0x11a062,_0x58e563){return _0x11a062['define'](_0xd693('0x9'),attributes,{'tableName':_0xd693('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23be39,_0x22533e,_0x12f687){if(_0x23be39['changed'](_0xd693('0xb'))){_0x23be39['closedAt']=moment()[_0xd693('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x12f687(null,_0x23be39);}}});}; \ No newline at end of file +var _0xf3f0=['bluebird','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0xf3f0,0x1bc));var _0x0f3f=function(_0x284246,_0x2a1917){_0x284246=_0x284246-0x0;var _0x211060=_0xf3f0[_0x284246];return _0x211060;};'use strict';var _=require(_0x0f3f('0x0'));var util=require(_0x0f3f('0x1'));var logger=require('../../config/logger')(_0x0f3f('0x2'));var moment=require(_0x0f3f('0x3'));var BPromise=require(_0x0f3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f3f('0x5'));var config=require('../../config/environment');var attributes=require(_0x0f3f('0x6'));module[_0x0f3f('0x7')]=function(_0x432e71,_0x3c7e16){return _0x432e71[_0x0f3f('0x8')](_0x0f3f('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x354d03,_0x4060f1,_0x3112f5){if(_0x354d03[_0x0f3f('0xa')](_0x0f3f('0xb'))){_0x354d03['closedAt']=moment()[_0x0f3f('0xc')](_0x0f3f('0xd'));}_0x3112f5(null,_0x354d03);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 52ebe91..33f4c0d 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 _0xee91=['spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','AddTagsToFaxInteraction','FaxInteraction','addTags','ids','omit'];(function(_0xe724b1,_0x4d2f34){var _0x528840=function(_0x12c505){while(--_0x12c505){_0xe724b1['push'](_0xe724b1['shift']());}};_0x528840(++_0x4d2f34);}(_0xee91,0xc5));var _0x1ee9=function(_0x4e1357,_0x27651d){_0x4e1357=_0x4e1357-0x0;var _0x5857e1=_0xee91[_0x4e1357];return _0x5857e1;};'use strict';var _=require(_0x1ee9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ee9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ee9('0x2'));var db=require(_0x1ee9('0x3'))['db'];var utils=require(_0x1ee9('0x4'));var logger=require(_0x1ee9('0x5'))('rpc');var config=require(_0x1ee9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1ee9('0x7')]['http']({'port':0x232a});config[_0x1ee9('0x8')]=_[_0x1ee9('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1ee9('0xa'))(new Redis(config[_0x1ee9('0x8')]));require(_0x1ee9('0xb'))[_0x1ee9('0xc')](socket);function respondWithRpcPromise(_0x550a95,_0x5ca839,_0x339f39){return new BPromise(function(_0x2c9e96,_0x4a74c7){return client[_0x1ee9('0xd')](_0x550a95,_0x339f39)[_0x1ee9('0xe')](function(_0x12477d){logger['info'](_0x1ee9('0xf'),_0x5ca839,_0x1ee9('0x10'));logger[_0x1ee9('0x11')](_0x1ee9('0x12'),_0x5ca839,_0x1ee9('0x10'),JSON[_0x1ee9('0x13')](_0x12477d));if(_0x12477d[_0x1ee9('0x14')]){if(_0x12477d[_0x1ee9('0x14')][_0x1ee9('0x15')]===0x1f4){logger[_0x1ee9('0x14')](_0x1ee9('0xf'),_0x5ca839,_0x12477d[_0x1ee9('0x14')][_0x1ee9('0x16')]);return _0x4a74c7(_0x12477d[_0x1ee9('0x14')]['message']);}logger[_0x1ee9('0x14')](_0x1ee9('0xf'),_0x5ca839,_0x12477d['error'][_0x1ee9('0x16')]);return _0x2c9e96(_0x12477d['error']['message']);}else{logger[_0x1ee9('0x17')](_0x1ee9('0xf'),_0x5ca839,_0x1ee9('0x10'));_0x2c9e96(_0x12477d['result']['message']);}})[_0x1ee9('0x18')](function(_0x45f932){logger[_0x1ee9('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x5ca839,_0x45f932);_0x4a74c7(_0x45f932);});});}exports[_0x1ee9('0x19')]=function(_0x537f29){var _0x3ed47f=this;return new Promise(function(_0xe24ffb,_0x52b031){return db['FaxInteraction'][_0x1ee9('0x1a')](_0x537f29[_0x1ee9('0x1b')],{'raw':_0x537f29[_0x1ee9('0x1c')]?_0x537f29[_0x1ee9('0x1c')][_0x1ee9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537f29[_0x1ee9('0x1c')]?_0x537f29[_0x1ee9('0x1c')][_0x1ee9('0x1e')]||null:null,'attributes':_0x537f29[_0x1ee9('0x1c')]?_0x537f29[_0x1ee9('0x1c')][_0x1ee9('0x1f')]||null:null,'limit':_0x537f29['options']?_0x537f29[_0x1ee9('0x1c')]['limit']||null:null})['then'](function(_0x2e30a3){logger[_0x1ee9('0x17')](_0x1ee9('0x19'),_0x537f29);logger[_0x1ee9('0x11')](_0x1ee9('0x19'),_0x537f29,JSON[_0x1ee9('0x13')](_0x2e30a3));_0xe24ffb(_0x2e30a3);})[_0x1ee9('0x18')](function(_0x550c5f){logger[_0x1ee9('0x14')](_0x1ee9('0x19'),_0x550c5f['message'],_0x537f29);_0x52b031(_0x3ed47f['error'](0x1f4,_0x550c5f[_0x1ee9('0x16')]));});});};exports[_0x1ee9('0x20')]=function(_0x10d91c){return new Promise(function(_0x41fcda,_0x43e0ac){return db[_0x1ee9('0x21')]['find']({'where':_0x10d91c['options']?_0x10d91c['options'][_0x1ee9('0x1e')]||null:null})[_0x1ee9('0xe')](function(_0x189e22){if(_0x189e22){return _0x189e22[_0x1ee9('0x22')](_0x10d91c['body'][_0x1ee9('0x23')],_[_0x1ee9('0x24')](_0x10d91c[_0x1ee9('0x1b')],[_0x1ee9('0x23'),'id'])||{});}})[_0x1ee9('0x25')](function(_0x19eb80){logger[_0x1ee9('0x17')](_0x1ee9('0x26'),_0x10d91c);logger['debug'](_0x1ee9('0x26'),_0x10d91c,JSON[_0x1ee9('0x13')](_0x19eb80));_0x41fcda(_0x19eb80);})[_0x1ee9('0x18')](function(_0x3d906e){logger[_0x1ee9('0x14')](_0x1ee9('0x26'),_0x3d906e['message'],_0x10d91c);_0x43e0ac(_this[_0x1ee9('0x14')](0x1f4,_0x3d906e[_0x1ee9('0x16')]));});});}; \ No newline at end of file +var _0x3faf=['info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','FaxInteraction,\x20%s,\x20%s','catch','FaxInteraction','update','options','raw','limit','UpdateFaxInteraction','stringify','find','where','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x3faf,0x144));var _0xf3fa=function(_0x584469,_0x287bf4){_0x584469=_0x584469-0x0;var _0x1ceeec=_0x3faf[_0x584469];return _0x1ceeec;};'use strict';var _=require(_0xf3fa('0x0'));var util=require(_0xf3fa('0x1'));var moment=require(_0xf3fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3fa('0x3'));var fs=require('fs');var Redis=require(_0xf3fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3fa('0x5'));var logger=require(_0xf3fa('0x6'))(_0xf3fa('0x7'));var config=require(_0xf3fa('0x8'));var jayson=require(_0xf3fa('0x9'));var client=jayson[_0xf3fa('0xa')][_0xf3fa('0xb')]({'port':0x232a});config[_0xf3fa('0xc')]=_[_0xf3fa('0xd')](config[_0xf3fa('0xc')],{'host':_0xf3fa('0xe'),'port':0x18eb});var socket=require(_0xf3fa('0xf'))(new Redis(config[_0xf3fa('0xc')]));require(_0xf3fa('0x10'))[_0xf3fa('0x11')](socket);function respondWithRpcPromise(_0x53d8f0,_0x2e2c40,_0x4706ae){return new BPromise(function(_0xd0b9a7,_0x2c345b){return client[_0xf3fa('0x12')](_0x53d8f0,_0x4706ae)[_0xf3fa('0x13')](function(_0x37965f){logger[_0xf3fa('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x2e2c40,_0xf3fa('0x15'));logger[_0xf3fa('0x16')](_0xf3fa('0x17'),_0x2e2c40,_0xf3fa('0x15'),JSON['stringify'](_0x37965f));if(_0x37965f[_0xf3fa('0x18')]){if(_0x37965f[_0xf3fa('0x18')][_0xf3fa('0x19')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x2e2c40,_0x37965f[_0xf3fa('0x18')][_0xf3fa('0x1a')]);return _0x2c345b(_0x37965f[_0xf3fa('0x18')][_0xf3fa('0x1a')]);}logger['error'](_0xf3fa('0x1b'),_0x2e2c40,_0x37965f[_0xf3fa('0x18')][_0xf3fa('0x1a')]);return _0xd0b9a7(_0x37965f[_0xf3fa('0x18')][_0xf3fa('0x1a')]);}else{logger[_0xf3fa('0x14')](_0xf3fa('0x1b'),_0x2e2c40,_0xf3fa('0x15'));_0xd0b9a7(_0x37965f['result'][_0xf3fa('0x1a')]);}})[_0xf3fa('0x1c')](function(_0x3f7011){logger[_0xf3fa('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x2e2c40,_0x3f7011);_0x2c345b(_0x3f7011);});});}exports['UpdateFaxInteraction']=function(_0x75dfb1){var _0xb2ab43=this;return new Promise(function(_0x5d1e8f,_0x4a2272){return db[_0xf3fa('0x1d')][_0xf3fa('0x1e')](_0x75dfb1['body'],{'raw':_0x75dfb1[_0xf3fa('0x1f')]?_0x75dfb1[_0xf3fa('0x1f')][_0xf3fa('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x75dfb1[_0xf3fa('0x1f')]?_0x75dfb1[_0xf3fa('0x1f')]['where']||null:null,'attributes':_0x75dfb1[_0xf3fa('0x1f')]?_0x75dfb1[_0xf3fa('0x1f')]['attributes']||null:null,'limit':_0x75dfb1['options']?_0x75dfb1[_0xf3fa('0x1f')][_0xf3fa('0x21')]||null:null})[_0xf3fa('0x13')](function(_0x900652){logger[_0xf3fa('0x14')](_0xf3fa('0x22'),_0x75dfb1);logger[_0xf3fa('0x16')]('UpdateFaxInteraction',_0x75dfb1,JSON[_0xf3fa('0x23')](_0x900652));_0x5d1e8f(_0x900652);})[_0xf3fa('0x1c')](function(_0x3c3681){logger['error'](_0xf3fa('0x22'),_0x3c3681[_0xf3fa('0x1a')],_0x75dfb1);_0x4a2272(_0xb2ab43[_0xf3fa('0x18')](0x1f4,_0x3c3681[_0xf3fa('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x8e6a99){return new Promise(function(_0x219267,_0x3a00fd){return db[_0xf3fa('0x1d')][_0xf3fa('0x24')]({'where':_0x8e6a99[_0xf3fa('0x1f')]?_0x8e6a99[_0xf3fa('0x1f')][_0xf3fa('0x25')]||null:null})[_0xf3fa('0x13')](function(_0x4351f1){if(_0x4351f1){return _0x4351f1[_0xf3fa('0x26')](_0x8e6a99[_0xf3fa('0x27')][_0xf3fa('0x28')],_['omit'](_0x8e6a99['body'],['ids','id'])||{});}})[_0xf3fa('0x29')](function(_0x477fcf){logger[_0xf3fa('0x14')](_0xf3fa('0x2a'),_0x8e6a99);logger[_0xf3fa('0x16')]('AddTags',_0x8e6a99,JSON[_0xf3fa('0x23')](_0x477fcf));_0x219267(_0x477fcf);})[_0xf3fa('0x1c')](function(_0x542469){logger[_0xf3fa('0x18')]('AddTags',_0x542469[_0xf3fa('0x1a')],_0x8e6a99);_0x3a00fd(_this[_0xf3fa('0x18')](0x1f4,_0x542469[_0xf3fa('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index c7f01b0..19a572f 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 _0x5634=['faxInteraction:','./faxInteraction.events','save','remove','emit','register','length'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x5634,0x112));var _0x4563=function(_0x4e18f1,_0x1e85a6){_0x4e18f1=_0x4e18f1-0x0;var _0x12bde4=_0x5634[_0x4e18f1];return _0x12bde4;};'use strict';var FaxInteractionEvents=require(_0x4563('0x0'));var events=[_0x4563('0x1'),_0x4563('0x2'),'update'];function createListener(_0x1b8eec,_0x5b9699){return function(_0x11b69f){_0x5b9699[_0x4563('0x3')](_0x1b8eec,_0x11b69f);};}function removeListener(_0x4c3183,_0x497a46){return function(){FaxInteractionEvents['removeListener'](_0x4c3183,_0x497a46);};}exports[_0x4563('0x4')]=function(_0xe58192){for(var _0x577ee7=0x0,_0x4b1308=events[_0x4563('0x5')];_0x577ee7<_0x4b1308;_0x577ee7++){var _0x188dd6=events[_0x577ee7];var _0x3dc94d=createListener(_0x4563('0x6')+_0x188dd6,_0xe58192);FaxInteractionEvents['on'](_0x188dd6,_0x3dc94d);}}; \ No newline at end of file +var _0x8896=['length','faxInteraction:','remove','update','removeListener','register'];(function(_0x461420,_0x58ec23){var _0x2e9c40=function(_0x39050f){while(--_0x39050f){_0x461420['push'](_0x461420['shift']());}};_0x2e9c40(++_0x58ec23);}(_0x8896,0x1d0));var _0x6889=function(_0x4f890c,_0x5f0d98){_0x4f890c=_0x4f890c-0x0;var _0x53cc03=_0x8896[_0x4f890c];return _0x53cc03;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x6889('0x0'),_0x6889('0x1')];function createListener(_0x63b8ce,_0x564a5e){return function(_0x41b320){_0x564a5e['emit'](_0x63b8ce,_0x41b320);};}function removeListener(_0x2216ce,_0x1e23a2){return function(){FaxInteractionEvents[_0x6889('0x2')](_0x2216ce,_0x1e23a2);};}exports[_0x6889('0x3')]=function(_0x259da9){for(var _0x2b508a=0x0,_0x330182=events[_0x6889('0x4')];_0x2b508a<_0x330182;_0x2b508a++){var _0x12065a=events[_0x2b508a];var _0x5b39de=createListener(_0x6889('0x5')+_0x12065a,_0x259da9);FaxInteractionEvents['on'](_0x12065a,_0x5b39de);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 337be53..9b090b8 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 _0x0a12=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','fax','faxinteraction:addtags','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','path'];(function(_0x18df4c,_0x5f3667){var _0x44a246=function(_0x2febaf){while(--_0x2febaf){_0x18df4c['push'](_0x18df4c['shift']());}};_0x44a246(++_0x5f3667);}(_0x0a12,0x1bf));var _0x20a1=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x0a12[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require(_0x20a1('0x0'));var util=require(_0x20a1('0x1'));var path=require(_0x20a1('0x2'));var timeout=require(_0x20a1('0x3'));var express=require(_0x20a1('0x4'));var router=express[_0x20a1('0x5')]();var fs_extra=require(_0x20a1('0x6'));var auth=require(_0x20a1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x20a1('0x8'));var controller=require(_0x20a1('0x9'));router[_0x20a1('0xa')]('/',auth[_0x20a1('0xb')](),controller[_0x20a1('0xc')]);router[_0x20a1('0xa')](_0x20a1('0xd'),auth[_0x20a1('0xb')](),controller['describe']);router[_0x20a1('0xa')](_0x20a1('0xe'),auth[_0x20a1('0xb')](),controller[_0x20a1('0xf')]);router['get'](_0x20a1('0x10'),auth[_0x20a1('0xb')](),controller[_0x20a1('0x11')]);router['get'](_0x20a1('0x12'),auth['isAuthenticated'](),controller[_0x20a1('0x13')]);router[_0x20a1('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x20a1('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0x20a1('0x14')](_0x20a1('0x15'),auth[_0x20a1('0xb')](),interaction[_0x20a1('0x16')](_0x20a1('0x17'),_0x20a1('0x18')),controller['addTags']);router['put']('/:id',auth[_0x20a1('0xb')](),interaction['tracked'](_0x20a1('0x17'),_0x20a1('0x19')),controller['update']);router[_0x20a1('0x1a')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x20a1('0x17'),_0x20a1('0x1b')),controller[_0x20a1('0x1c')]);router[_0x20a1('0x1a')](_0x20a1('0x15'),auth[_0x20a1('0xb')](),controller[_0x20a1('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x33b4=['tracked','faxinteraction:addtags','addTags','put','fax','delete','faxinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage'];(function(_0x1e9255,_0x5d37c4){var _0x358076=function(_0x5a1a6c){while(--_0x5a1a6c){_0x1e9255['push'](_0x1e9255['shift']());}};_0x358076(++_0x5d37c4);}(_0x33b4,0x81));var _0x433b=function(_0x2c48d3,_0x4ca500){_0x2c48d3=_0x2c48d3-0x0;var _0x1f12aa=_0x33b4[_0x2c48d3];return _0x1f12aa;};'use strict';var multer=require(_0x433b('0x0'));var util=require(_0x433b('0x1'));var path=require(_0x433b('0x2'));var timeout=require(_0x433b('0x3'));var express=require(_0x433b('0x4'));var router=express[_0x433b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x433b('0x6'));var interaction=require(_0x433b('0x7'));var config=require(_0x433b('0x8'));var controller=require(_0x433b('0x9'));router[_0x433b('0xa')]('/',auth[_0x433b('0xb')](),controller['index']);router[_0x433b('0xa')](_0x433b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x433b('0xa')](_0x433b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x433b('0xa')](_0x433b('0xe'),auth[_0x433b('0xb')](),controller[_0x433b('0xf')]);router[_0x433b('0xa')](_0x433b('0x10'),auth[_0x433b('0xb')](),controller[_0x433b('0x11')]);router[_0x433b('0x12')]('/',auth[_0x433b('0xb')](),controller[_0x433b('0x13')]);router[_0x433b('0x12')](_0x433b('0xe'),auth['isAuthenticated'](),controller[_0x433b('0x14')]);router[_0x433b('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x433b('0x15')]('fax',_0x433b('0x16')),controller[_0x433b('0x17')]);router[_0x433b('0x18')](_0x433b('0xd'),auth['isAuthenticated'](),interaction[_0x433b('0x15')](_0x433b('0x19'),'faxinteraction:update'),controller['update']);router[_0x433b('0x1a')](_0x433b('0xd'),auth[_0x433b('0xb')](),interaction[_0x433b('0x15')]('fax',_0x433b('0x1b')),controller['destroy']);router[_0x433b('0x1a')](_0x433b('0x1c'),auth[_0x433b('0xb')](),controller[_0x433b('0x1d')]);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 2efaee8..5917a75 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 _0xb377=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x166acc,_0x111e4e){var _0x209f4d=function(_0x354b62){while(--_0x354b62){_0x166acc['push'](_0x166acc['shift']());}};_0x209f4d(++_0x111e4e);}(_0xb377,0x1b6));var _0x7b37=function(_0x44aebf,_0x27d698){_0x44aebf=_0x44aebf-0x0;var _0x166696=_0xb377[_0x44aebf];return _0x166696;};'use strict';var Sequelize=require(_0x7b37('0x0'));module[_0x7b37('0x1')]={'body':{'type':Sequelize[_0x7b37('0x2')](_0x7b37('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7b37('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7b37('0x5')]('in',_0x7b37('0x6')),'defaultValue':_0x7b37('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x7b37('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7b37('0x7')]}}; \ No newline at end of file +var _0x54ef=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x45887e,_0x11e424){var _0x318854=function(_0x79ce20){while(--_0x79ce20){_0x45887e['push'](_0x45887e['shift']());}};_0x318854(++_0x11e424);}(_0x54ef,0x112));var _0xf54e=function(_0x2871be,_0x3b2fd5){_0x2871be=_0x2871be-0x0;var _0x5a1dde=_0x54ef[_0x2871be];return _0x5a1dde;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'body':{'type':Sequelize[_0xf54e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf54e('0x4')]('in',_0xf54e('0x5')),'defaultValue':_0xf54e('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xf54e('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xf54e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3ea577b..07303e9 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 _0xebe3=['role','rejectMessage','sequelize','Sequelize','rejectmessage','create','CmContact','Attachment','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','root','files','download','join','basename','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','sendStatus','stack','send','index','map','FaxMessage','fieldName','type','key','model','name','keys','query','filters','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','rawAttributes','intersection','include','find','body','params','describe','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xebe3,0xa2));var _0x3ebe=function(_0x1bdeb9,_0x5cb3a9){_0x1bdeb9=_0x1bdeb9-0x0;var _0x874754=_0xebe3[_0x1bdeb9];return _0x874754;};'use strict';var emlformat=require(_0x3ebe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ebe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ebe('0x2'));var moment=require(_0x3ebe('0x3'));var BPromise=require(_0x3ebe('0x4'));var Mustache=require('mustache');var util=require(_0x3ebe('0x5'));var path=require(_0x3ebe('0x6'));var sox=require(_0x3ebe('0x7'));var csv=require(_0x3ebe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ebe('0x9'));var squel=require(_0x3ebe('0xa'));var crypto=require(_0x3ebe('0xb'));var jsforce=require(_0x3ebe('0xc'));var deskjs=require(_0x3ebe('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3ebe('0xe'));var Papa=require('papaparse');var Redis=require(_0x3ebe('0xf'));var authService=require(_0x3ebe('0x10'));var qs=require(_0x3ebe('0x11'));var as=require(_0x3ebe('0x12'));var hardwareService=require(_0x3ebe('0x13'));var logger=require(_0x3ebe('0x14'))('api');var utils=require(_0x3ebe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3ebe('0x16'));var db=require(_0x3ebe('0x17'))['db'];config['redis']=_[_0x3ebe('0x18')](config[_0x3ebe('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ebe('0x1a'))(new Redis(config[_0x3ebe('0x19')]));require(_0x3ebe('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3ebe('0x1c')][_0x3ebe('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x482351,_0x18ab1d,_0x5ec84b,_0x3dff0b){return new BPromise(function(_0xe74edd,_0x8902ed){var _0x4c0ddb=_0x3dff0b||client;return _0x4c0ddb[_0x3ebe('0x1e')](_0x482351,_0x5ec84b)[_0x3ebe('0x1f')](function(_0x3e03b7){logger[_0x3ebe('0x20')](_0x3ebe('0x21'),_0x18ab1d,_0x3ebe('0x22'));logger[_0x3ebe('0x23')](_0x3ebe('0x24'),_0x18ab1d,_0x3ebe('0x22'),JSON[_0x3ebe('0x25')](_0x3e03b7));if(_0x3e03b7[_0x3ebe('0x26')]){if(_0x3e03b7[_0x3ebe('0x26')][_0x3ebe('0x27')]===0x1f4){logger[_0x3ebe('0x26')](_0x3ebe('0x21'),_0x18ab1d,_0x3e03b7['error'][_0x3ebe('0x28')]);return _0x8902ed(_0x3e03b7[_0x3ebe('0x26')][_0x3ebe('0x28')]);}logger[_0x3ebe('0x26')]('FaxMessage,\x20%s,\x20%s',_0x18ab1d,_0x3e03b7[_0x3ebe('0x26')][_0x3ebe('0x28')]);return _0xe74edd(_0x3e03b7[_0x3ebe('0x26')][_0x3ebe('0x28')]);}else{logger[_0x3ebe('0x20')](_0x3ebe('0x21'),_0x18ab1d,'request\x20sent');_0xe74edd(_0x3e03b7[_0x3ebe('0x29')]['message']);}})[_0x3ebe('0x2a')](function(_0x121eed){logger[_0x3ebe('0x26')](_0x3ebe('0x21'),_0x18ab1d,_0x121eed);_0x8902ed(_0x121eed);});});}function respondWithStatusCode(_0x594c52,_0x5d4f33){_0x5d4f33=_0x5d4f33||0xcc;return function(_0x387dc7){if(_0x387dc7){return _0x594c52['sendStatus'](_0x5d4f33);}return _0x594c52[_0x3ebe('0x2b')](_0x5d4f33)[_0x3ebe('0x2c')]();};}function respondWithResult(_0x38e828,_0x4b8007){_0x4b8007=_0x4b8007||0xc8;return function(_0x3b23d7){if(_0x3b23d7){return _0x38e828[_0x3ebe('0x2b')](_0x4b8007)[_0x3ebe('0x2d')](_0x3b23d7);}};}function respondWithFilteredResult(_0x415c26,_0x4208aa){return function(_0x4b1fc6){if(_0x4b1fc6){var _0x4b1f8b=typeof _0x4208aa[_0x3ebe('0x2e')]===_0x3ebe('0x2f')&&typeof _0x4208aa['limit']==='undefined';var _0x5bb6fb=_0x4b1fc6['count'];var _0x19018a=_0x4b1f8b?0x0:_0x4208aa['offset'];var _0xcf9acd=_0x4b1f8b?_0x4b1fc6[_0x3ebe('0x30')]:_0x4208aa['offset']+_0x4208aa[_0x3ebe('0x31')];var _0x48b577;if(_0xcf9acd>=_0x5bb6fb){_0xcf9acd=_0x5bb6fb;_0x48b577=0xc8;}else{_0x48b577=0xce;}_0x415c26[_0x3ebe('0x2b')](_0x48b577);return _0x415c26[_0x3ebe('0x32')](_0x3ebe('0x33'),_0x19018a+'-'+_0xcf9acd+'/'+_0x5bb6fb)[_0x3ebe('0x2d')](_0x4b1fc6);}return null;};}function patchUpdates(_0xb55fce){return function(_0x5a39e2){try{jsonpatch[_0x3ebe('0x34')](_0x5a39e2,_0xb55fce,!![]);}catch(_0x2cacb0){return BPromise['reject'](_0x2cacb0);}return _0x5a39e2[_0x3ebe('0x35')]();};}function saveUpdates(_0x39f4ef,_0x411675){return function(_0x4e5149){if(_0x4e5149){return _0x4e5149[_0x3ebe('0x36')](_0x39f4ef)[_0x3ebe('0x1f')](function(_0x28755f){return _0x28755f;});}return null;};}function removeEntity(_0x13962c,_0x4daaa1){return function(_0x37b11f){if(_0x37b11f){return _0x37b11f[_0x3ebe('0x37')]()[_0x3ebe('0x1f')](function(){_0x13962c[_0x3ebe('0x2b')](0xcc)[_0x3ebe('0x2c')]();});}};}function handleEntityNotFound(_0x483178,_0x11b77c){return function(_0x2d5457){if(!_0x2d5457){_0x483178[_0x3ebe('0x38')](0x194);}return _0x2d5457;};}function handleError(_0x2ea064,_0x5e370f){_0x5e370f=_0x5e370f||0x1f4;return function(_0x53bf59){logger['error'](_0x53bf59[_0x3ebe('0x39')]);if(_0x53bf59['name']){delete _0x53bf59['name'];}_0x2ea064['status'](_0x5e370f)[_0x3ebe('0x3a')](_0x53bf59);};}exports[_0x3ebe('0x3b')]=function(_0x29c1a1,_0xff4e67){var _0x1eec97={},_0x427dd5={},_0x30a2c7={'count':0x0,'rows':[]};var _0xa0bdc8=_[_0x3ebe('0x3c')](db[_0x3ebe('0x3d')]['rawAttributes'],function(_0x56f84a){return{'name':_0x56f84a[_0x3ebe('0x3e')],'type':_0x56f84a[_0x3ebe('0x3f')][_0x3ebe('0x40')]};});_0x427dd5[_0x3ebe('0x41')]=_[_0x3ebe('0x3c')](_0xa0bdc8,_0x3ebe('0x42'));_0x427dd5['query']=_[_0x3ebe('0x43')](_0x29c1a1[_0x3ebe('0x44')]);_0x427dd5[_0x3ebe('0x45')]=_['intersection'](_0x427dd5['model'],_0x427dd5['query']);_0x1eec97[_0x3ebe('0x46')]=_['intersection'](_0x427dd5['model'],qs['fields'](_0x29c1a1['query'][_0x3ebe('0x47')]));_0x1eec97['attributes']=_0x1eec97[_0x3ebe('0x46')][_0x3ebe('0x48')]?_0x1eec97[_0x3ebe('0x46')]:_0x427dd5[_0x3ebe('0x41')];if(!_0x29c1a1[_0x3ebe('0x44')]['hasOwnProperty'](_0x3ebe('0x49'))){_0x1eec97[_0x3ebe('0x31')]=qs[_0x3ebe('0x31')](_0x29c1a1[_0x3ebe('0x44')]['limit']);_0x1eec97[_0x3ebe('0x2e')]=qs[_0x3ebe('0x2e')](_0x29c1a1[_0x3ebe('0x44')][_0x3ebe('0x2e')]);}_0x1eec97[_0x3ebe('0x4a')]=qs[_0x3ebe('0x4b')](_0x29c1a1[_0x3ebe('0x44')][_0x3ebe('0x4b')]);_0x1eec97['where']=qs['filters'](_['pick'](_0x29c1a1['query'],_0x427dd5['filters']),_0xa0bdc8);if(_0x29c1a1[_0x3ebe('0x44')][_0x3ebe('0x4c')]){_0x1eec97[_0x3ebe('0x4d')]=_[_0x3ebe('0x4e')](_0x1eec97[_0x3ebe('0x4d')],{'$or':_[_0x3ebe('0x3c')](_0xa0bdc8,function(_0x58e88e){if(_0x58e88e[_0x3ebe('0x3f')]!==_0x3ebe('0x4f')){var _0x572404={};_0x572404[_0x58e88e[_0x3ebe('0x42')]]={'$like':'%'+_0x29c1a1[_0x3ebe('0x44')]['filter']+'%'};return _0x572404;}})});}_0x1eec97=_[_0x3ebe('0x4e')]({},_0x1eec97,_0x29c1a1[_0x3ebe('0x50')]);var _0x27d41e={'where':_0x1eec97[_0x3ebe('0x4d')]};return db[_0x3ebe('0x3d')]['count'](_0x27d41e)[_0x3ebe('0x1f')](function(_0x3164d6){_0x30a2c7[_0x3ebe('0x30')]=_0x3164d6;if(_0x29c1a1[_0x3ebe('0x44')][_0x3ebe('0x51')]){_0x1eec97['include']=[{'all':!![]}];}return db[_0x3ebe('0x3d')][_0x3ebe('0x52')](_0x1eec97);})[_0x3ebe('0x1f')](function(_0x1266a5){_0x30a2c7['rows']=_0x1266a5;return _0x30a2c7;})['then'](respondWithFilteredResult(_0xff4e67,_0x1eec97))[_0x3ebe('0x2a')](handleError(_0xff4e67,null));};exports[_0x3ebe('0x53')]=function(_0x40fdaf,_0x2497b1){var _0x2c37f8={'raw':!![],'where':{'id':_0x40fdaf['params']['id']}},_0x14521c={};_0x14521c['model']=_[_0x3ebe('0x43')](db[_0x3ebe('0x3d')][_0x3ebe('0x54')]);_0x14521c[_0x3ebe('0x44')]=_[_0x3ebe('0x43')](_0x40fdaf[_0x3ebe('0x44')]);_0x14521c[_0x3ebe('0x45')]=_['intersection'](_0x14521c[_0x3ebe('0x41')],_0x14521c[_0x3ebe('0x44')]);_0x2c37f8[_0x3ebe('0x46')]=_[_0x3ebe('0x55')](_0x14521c[_0x3ebe('0x41')],qs[_0x3ebe('0x47')](_0x40fdaf['query'][_0x3ebe('0x47')]));_0x2c37f8[_0x3ebe('0x46')]=_0x2c37f8['attributes'][_0x3ebe('0x48')]?_0x2c37f8[_0x3ebe('0x46')]:_0x14521c[_0x3ebe('0x41')];if(_0x40fdaf[_0x3ebe('0x44')][_0x3ebe('0x51')]){_0x2c37f8[_0x3ebe('0x56')]=[{'all':!![]}];}_0x2c37f8=_[_0x3ebe('0x4e')]({},_0x2c37f8,_0x40fdaf[_0x3ebe('0x50')]);return db[_0x3ebe('0x3d')][_0x3ebe('0x57')](_0x2c37f8)[_0x3ebe('0x1f')](handleEntityNotFound(_0x2497b1,null))[_0x3ebe('0x1f')](respondWithResult(_0x2497b1,null))[_0x3ebe('0x2a')](handleError(_0x2497b1,null));};exports['update']=function(_0x1a694b,_0x2a2234){if(_0x1a694b[_0x3ebe('0x58')]['id']){delete _0x1a694b['body']['id'];}return db['FaxMessage'][_0x3ebe('0x57')]({'where':{'id':_0x1a694b[_0x3ebe('0x59')]['id']}})[_0x3ebe('0x1f')](handleEntityNotFound(_0x2a2234,null))[_0x3ebe('0x1f')](saveUpdates(_0x1a694b[_0x3ebe('0x58')],null))[_0x3ebe('0x1f')](respondWithResult(_0x2a2234,null))[_0x3ebe('0x2a')](handleError(_0x2a2234,null));};exports[_0x3ebe('0x37')]=function(_0x62296,_0x1c0356){return db[_0x3ebe('0x3d')][_0x3ebe('0x57')]({'where':{'id':_0x62296[_0x3ebe('0x59')]['id']}})[_0x3ebe('0x1f')](handleEntityNotFound(_0x1c0356,null))[_0x3ebe('0x1f')](removeEntity(_0x1c0356,null))['catch'](handleError(_0x1c0356,null));};exports[_0x3ebe('0x5a')]=function(_0xdd1328,_0x4eee00){return db[_0x3ebe('0x3d')][_0x3ebe('0x5a')]()[_0x3ebe('0x1f')](respondWithResult(_0x4eee00,null))[_0x3ebe('0x2a')](handleError(_0x4eee00,null));};var interaction_log=require(_0x3ebe('0x14'))('fax-interactions');exports[_0x3ebe('0x5b')]=function(_0x2cfaf2,_0x57fc48,_0x1c357d){var _0x56d17c={'agent':{},'channel':_0x3ebe('0x5c')};if(_0x2cfaf2[_0x3ebe('0x58')]['id']){delete _0x2cfaf2[_0x3ebe('0x58')]['id'];}_0x2cfaf2['body']['read']=!![];_0x2cfaf2[_0x3ebe('0x58')][_0x3ebe('0x5d')]=moment()[_0x3ebe('0x5e')](_0x3ebe('0x5f'));_0x2cfaf2['body'][_0x3ebe('0x60')]=_0x2cfaf2[_0x3ebe('0x58')][_0x3ebe('0x60')]||_0x2cfaf2['user']['id'];_0x56d17c[_0x3ebe('0x61')]['id']=_0x2cfaf2[_0x3ebe('0x58')][_0x3ebe('0x60')];return db[_0x3ebe('0x3d')]['find']({'where':{'id':_0x2cfaf2[_0x3ebe('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x57fc48,null))['then'](saveUpdates(_0x2cfaf2[_0x3ebe('0x58')],null))['then'](function(_0x14fc53){if(_0x14fc53){_0x56d17c[_0x3ebe('0x28')]=_0x14fc53[_0x3ebe('0x62')]({'plain':!![]});return db[_0x3ebe('0x63')]['find']({'where':{'id':_0x14fc53[_0x3ebe('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x57fc48,null))[_0x3ebe('0x1f')](function(_0x77417e){if(_0x77417e){return _0x77417e[_0x3ebe('0x36')]({'UserId':_0x2cfaf2['body']['UserId'],'read1stAt':_[_0x3ebe('0x65')](_0x77417e[_0x3ebe('0x66')])?moment()['format'](_0x3ebe('0x5f')):undefined});}return null;})[_0x3ebe('0x1f')](function(_0x70a2b9){if(_0x70a2b9){_0x56d17c[_0x3ebe('0x67')]=_0x70a2b9[_0x3ebe('0x62')]({'plain':!![]});interaction_log[_0x3ebe('0x20')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cfaf2[_0x3ebe('0x68')]['id'],_0x2cfaf2[_0x3ebe('0x68')][_0x3ebe('0x42')],_0x2cfaf2[_0x3ebe('0x68')]['role'],_0x56d17c[_0x3ebe('0x67')]['id'],_0x2cfaf2['body']?JSON[_0x3ebe('0x25')](_0x2cfaf2[_0x3ebe('0x58')]):_0x3ebe('0x69'));return respondWithRpcPromise('AcceptMessage',_0x3ebe('0x6a'),_0x56d17c);}return null;})[_0x3ebe('0x1f')](function(_0x3a137a){var _0x50115b=_0x3ebe('0x6b')+_0x3a137a[_0x3ebe('0x28')][_0x3ebe('0x6c')];return db['sequelize'][_0x3ebe('0x44')](_0x50115b,{'type':db['Sequelize'][_0x3ebe('0x6d')][_0x3ebe('0x6e')],'raw':!![]})[_0x3ebe('0x1f')](function(_0x5c50ad){return _0x5c50ad;});})['then'](function(_0x485852){if(_0x485852){_0x56d17c['message']['contact']=_0x485852[0x0];if(!_0x2cfaf2[_0x3ebe('0x58')][_0x3ebe('0x60')])return;return db[_0x3ebe('0x6f')][_0x3ebe('0x57')]({'where':{'id':_0x2cfaf2[_0x3ebe('0x58')]['UserId'],'role':_0x3ebe('0x61')},'attributes':['id',_0x3ebe('0x42'),_0x3ebe('0x70'),_0x3ebe('0x71'),_0x3ebe('0x72')],'raw':!![]});}return null;})[_0x3ebe('0x1f')](function(_0x192f81){if(!_0x192f81)return null;_0x56d17c[_0x3ebe('0x28')][_0x3ebe('0x61')]=_0x192f81;return _0x56d17c;})[_0x3ebe('0x1f')](function(_0x563aa7){if(_0x563aa7){if(_0x2cfaf2[_0x3ebe('0x58')][_0x3ebe('0x73')]){_0x56d17c['message'][_0x3ebe('0x74')]=util[_0x3ebe('0x5e')](_0x3ebe('0x75'),_0x2cfaf2[_0x3ebe('0x68')][_0x3ebe('0x42')]);_0x56d17c['message'][_0x3ebe('0x76')]=_0x56d17c['channel'];_0x56d17c['message'][_0x3ebe('0x77')]=_0x56d17c[_0x3ebe('0x76')];_0x56d17c[_0x3ebe('0x28')][_0x3ebe('0x78')]='accept';return respondWithRpcPromise(_0x3ebe('0x79'),'EventManager',{'event':_0x3ebe('0x7a'),'message':_0x56d17c[_0x3ebe('0x28')]},client9002)[_0x3ebe('0x1f')](function(){return _0x56d17c;});}return _0x56d17c;}return null;})[_0x3ebe('0x1f')](respondWithResult(_0x57fc48,null))[_0x3ebe('0x2a')](handleError(_0x57fc48,null));};var interaction_log=require(_0x3ebe('0x14'))(_0x3ebe('0x7b'));exports[_0x3ebe('0x7c')]=function(_0x327797,_0x5ba57e,_0x170876){var _0x5be27d={'agent':{},'channel':'fax'};if(_0x327797[_0x3ebe('0x58')]['id']){delete _0x327797['body']['id'];}_0x327797[_0x3ebe('0x58')][_0x3ebe('0x60')]=_0x327797['body'][_0x3ebe('0x60')]||_0x327797['user']['id'];_0x5be27d[_0x3ebe('0x61')]['id']=_0x327797['body'][_0x3ebe('0x60')];return db[_0x3ebe('0x3d')]['find']({'where':{'id':_0x327797[_0x3ebe('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ba57e,null))[_0x3ebe('0x1f')](function(_0xf08938){if(_0xf08938){_0x5be27d[_0x3ebe('0x28')]=_0xf08938[_0x3ebe('0x62')]({'plain':!![]});return db[_0x3ebe('0x63')][_0x3ebe('0x57')]({'where':{'id':_0xf08938['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5ba57e,null))[_0x3ebe('0x1f')](function(_0x39e13d){if(_0x39e13d){_0x5be27d[_0x3ebe('0x67')]=_0x39e13d['get']({'plain':!![]});interaction_log['info'](_0x3ebe('0x7d'),_0x327797['user']['id'],_0x327797[_0x3ebe('0x68')][_0x3ebe('0x42')],_0x327797[_0x3ebe('0x68')][_0x3ebe('0x7e')],_0x5be27d[_0x3ebe('0x67')]['id'],_0x327797[_0x3ebe('0x58')]?JSON[_0x3ebe('0x25')](_0x327797['body']):_0x3ebe('0x69'));return respondWithRpcPromise('RejectMessage',_0x3ebe('0x7f'),_0x5be27d);}return null;})[_0x3ebe('0x1f')](function(_0x39f40f){var _0x10b7ac=_0x3ebe('0x6b')+_0x39f40f[_0x3ebe('0x28')][_0x3ebe('0x6c')];return db[_0x3ebe('0x80')][_0x3ebe('0x44')](_0x10b7ac,{'type':db[_0x3ebe('0x81')][_0x3ebe('0x6d')][_0x3ebe('0x6e')],'raw':!![]})[_0x3ebe('0x1f')](function(_0x27ea1b){return _0x27ea1b;});})[_0x3ebe('0x1f')](function(_0x816a7){if(_0x816a7){_0x5be27d[_0x3ebe('0x28')]['contact']=_0x816a7[0x0];if(!_0x327797[_0x3ebe('0x58')][_0x3ebe('0x60')])return;return db[_0x3ebe('0x6f')][_0x3ebe('0x57')]({'where':{'id':_0x327797[_0x3ebe('0x58')][_0x3ebe('0x60')],'role':'agent'},'attributes':['id',_0x3ebe('0x42'),_0x3ebe('0x70'),_0x3ebe('0x71'),_0x3ebe('0x72')],'raw':!![]});}return null;})[_0x3ebe('0x1f')](function(_0x4ead90){if(!_0x4ead90)return null;_0x5be27d[_0x3ebe('0x28')][_0x3ebe('0x61')]=_0x4ead90;return _0x5be27d;})[_0x3ebe('0x1f')](function(_0x56cd82){if(_0x56cd82){_0x56cd82[_0x3ebe('0x28')][_0x3ebe('0x74')]=util[_0x3ebe('0x5e')]('SIP/%s',_0x327797['user'][_0x3ebe('0x42')]);_0x56cd82[_0x3ebe('0x28')][_0x3ebe('0x76')]=_0x5be27d[_0x3ebe('0x76')];_0x56cd82[_0x3ebe('0x28')]['motionChannel']=_0x5be27d[_0x3ebe('0x76')];_0x56cd82[_0x3ebe('0x28')]['event']='reject';respondWithRpcPromise(_0x3ebe('0x79'),_0x3ebe('0x79'),{'event':_0x3ebe('0x82'),'message':_0x56cd82[_0x3ebe('0x28')]},client9002);return _0x5be27d;}return null;})[_0x3ebe('0x1f')](respondWithResult(_0x5ba57e,null))[_0x3ebe('0x2a')](handleError(_0x5ba57e,null));};exports['create']=function(_0x4f5056,_0x1c3870){var _0x27b846;return db[_0x3ebe('0x3d')][_0x3ebe('0x83')](_0x4f5056['body'],{})[_0x3ebe('0x1f')](function(_0xc1ef0b){_0x27b846=_0xc1ef0b;return db[_0x3ebe('0x84')]['findOne']({'where':{'id':_0x27b846[_0x3ebe('0x6c')]}});})[_0x3ebe('0x1f')](function(_0x4b9b59){if(_[_0x3ebe('0x65')](_0x4b9b59)){return;}else{_0x27b846[_0x3ebe('0x5c')]=_0x4b9b59[_0x3ebe('0x5c')];return db[_0x3ebe('0x85')][_0x3ebe('0x86')]({'where':{'id':_0x27b846['AttachmentId']}});}})[_0x3ebe('0x1f')](function(_0x1d53a8){return respondWithRpcPromise(_0x3ebe('0x87'),_0x3ebe('0x87'),{'FaxAccountId':_['isNil'](_0x4f5056[_0x3ebe('0x58')])?undefined:_0x4f5056[_0x3ebe('0x58')][_0x3ebe('0x88')],'path':_[_0x3ebe('0x65')](_0x1d53a8)?undefined:util['format'](_0x3ebe('0x89'),_0x1d53a8['basename']),'fax':_[_0x3ebe('0x65')](_0x27b846[_0x3ebe('0x5c')])?undefined:_0x27b846[_0x3ebe('0x5c')],'AttachmentId':_0x27b846[_0x3ebe('0x8a')]},client9002);})[_0x3ebe('0x1f')](respondWithResult(_0x1c3870,0xc9))[_0x3ebe('0x2a')](handleError(_0x1c3870,null));};exports['download']=function(_0x1cd384,_0x150801){var _0x41863b=path['join'](config[_0x3ebe('0x8b')],'server',_0x3ebe('0x8c'),'attachments');return db['FaxMessage'][_0x3ebe('0x57')]({'where':{'id':_0x1cd384[_0x3ebe('0x59')]['id']},'include':[{'model':db['Attachment'],'as':_0x3ebe('0x85')}]})['then'](handleEntityNotFound(_0x150801,null))[_0x3ebe('0x1f')](function(_0xffcf4d){if(_0xffcf4d){return _0x150801[_0x3ebe('0x8d')](path[_0x3ebe('0x8e')](_0x41863b,_0xffcf4d[_0x3ebe('0x85')][_0x3ebe('0x8f')]));}})[_0x3ebe('0x2a')](handleError(_0x150801,null));}; \ No newline at end of file +var _0x1e81=['acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','SELECT','rejectmessage','create','CmContact','ContactId','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','download','join','root','server','files','attachments','basename','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','intersection','find','body','destroy','params','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager'];(function(_0x51786e,_0x5ee24e){var _0x25b5e2=function(_0x3ce85f){while(--_0x3ce85f){_0x51786e['push'](_0x51786e['shift']());}};_0x25b5e2(++_0x5ee24e);}(_0x1e81,0x138));var _0x11e8=function(_0x593338,_0x2cd36a){_0x593338=_0x593338-0x0;var _0x12e53c=_0x1e81[_0x593338];return _0x12e53c;};'use strict';var emlformat=require(_0x11e8('0x0'));var rimraf=require(_0x11e8('0x1'));var zipdir=require(_0x11e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11e8('0x3'));var moment=require(_0x11e8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x11e8('0x5'));var path=require(_0x11e8('0x6'));var sox=require(_0x11e8('0x7'));var csv=require(_0x11e8('0x8'));var ejs=require(_0x11e8('0x9'));var fs=require('fs');var fs_extra=require(_0x11e8('0xa'));var _=require(_0x11e8('0xb'));var squel=require(_0x11e8('0xc'));var crypto=require(_0x11e8('0xd'));var jsforce=require(_0x11e8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x11e8('0x8'));var querystring=require(_0x11e8('0xf'));var Papa=require(_0x11e8('0x10'));var Redis=require(_0x11e8('0x11'));var authService=require(_0x11e8('0x12'));var qs=require(_0x11e8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x11e8('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x11e8('0x15'));var config=require(_0x11e8('0x16'));var licenseUtil=require(_0x11e8('0x17'));var db=require(_0x11e8('0x18'))['db'];config[_0x11e8('0x19')]=_[_0x11e8('0x1a')](config[_0x11e8('0x19')],{'host':_0x11e8('0x1b'),'port':0x18eb});var socket=require(_0x11e8('0x1c'))(new Redis(config[_0x11e8('0x19')]));require(_0x11e8('0x1d'))[_0x11e8('0x1e')](socket);var jayson=require(_0x11e8('0x1f'));var client=jayson['client'][_0x11e8('0x20')]({'port':0x232c});var client9002=jayson[_0x11e8('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x854ebc,_0x28592d,_0x777dbf,_0x41b878){return new BPromise(function(_0x488610,_0x382f24){var _0x50e57f=_0x41b878||client;return _0x50e57f['request'](_0x854ebc,_0x777dbf)[_0x11e8('0x22')](function(_0x378a99){logger[_0x11e8('0x23')](_0x11e8('0x24'),_0x28592d,_0x11e8('0x25'));logger[_0x11e8('0x26')](_0x11e8('0x27'),_0x28592d,'request\x20sent',JSON[_0x11e8('0x28')](_0x378a99));if(_0x378a99['error']){if(_0x378a99[_0x11e8('0x29')]['code']===0x1f4){logger[_0x11e8('0x29')]('FaxMessage,\x20%s,\x20%s',_0x28592d,_0x378a99[_0x11e8('0x29')]['message']);return _0x382f24(_0x378a99[_0x11e8('0x29')]['message']);}logger['error'](_0x11e8('0x24'),_0x28592d,_0x378a99[_0x11e8('0x29')][_0x11e8('0x2a')]);return _0x488610(_0x378a99[_0x11e8('0x29')][_0x11e8('0x2a')]);}else{logger[_0x11e8('0x23')]('FaxMessage,\x20%s,\x20%s',_0x28592d,_0x11e8('0x25'));_0x488610(_0x378a99[_0x11e8('0x2b')][_0x11e8('0x2a')]);}})[_0x11e8('0x2c')](function(_0x1fed3b){logger[_0x11e8('0x29')](_0x11e8('0x24'),_0x28592d,_0x1fed3b);_0x382f24(_0x1fed3b);});});}function respondWithStatusCode(_0x165c74,_0x1bb8f1){_0x1bb8f1=_0x1bb8f1||0xcc;return function(_0x18bc15){if(_0x18bc15){return _0x165c74['sendStatus'](_0x1bb8f1);}return _0x165c74['status'](_0x1bb8f1)[_0x11e8('0x2d')]();};}function respondWithResult(_0x20033a,_0x18d926){_0x18d926=_0x18d926||0xc8;return function(_0x37946f){if(_0x37946f){return _0x20033a[_0x11e8('0x2e')](_0x18d926)[_0x11e8('0x2f')](_0x37946f);}};}function respondWithFilteredResult(_0xe1fb33,_0xba538e){return function(_0x4c7caf){if(_0x4c7caf){var _0xc6d6f2=typeof _0xba538e[_0x11e8('0x30')]==='undefined'&&typeof _0xba538e[_0x11e8('0x31')]===_0x11e8('0x32');var _0x26ff5d=_0x4c7caf[_0x11e8('0x33')];var _0x5dcfcc=_0xc6d6f2?0x0:_0xba538e[_0x11e8('0x30')];var _0xa82213=_0xc6d6f2?_0x4c7caf['count']:_0xba538e[_0x11e8('0x30')]+_0xba538e['limit'];var _0x554faa;if(_0xa82213>=_0x26ff5d){_0xa82213=_0x26ff5d;_0x554faa=0xc8;}else{_0x554faa=0xce;}_0xe1fb33['status'](_0x554faa);return _0xe1fb33[_0x11e8('0x34')](_0x11e8('0x35'),_0x5dcfcc+'-'+_0xa82213+'/'+_0x26ff5d)['json'](_0x4c7caf);}return null;};}function patchUpdates(_0x446975){return function(_0x1382e9){try{jsonpatch[_0x11e8('0x36')](_0x1382e9,_0x446975,!![]);}catch(_0x2364a9){return BPromise[_0x11e8('0x37')](_0x2364a9);}return _0x1382e9[_0x11e8('0x38')]();};}function saveUpdates(_0x125402,_0x45e31c){return function(_0xdfdcfd){if(_0xdfdcfd){return _0xdfdcfd[_0x11e8('0x39')](_0x125402)[_0x11e8('0x22')](function(_0x39e2fb){return _0x39e2fb;});}return null;};}function removeEntity(_0x471183,_0x2fa28b){return function(_0x47571d){if(_0x47571d){return _0x47571d['destroy']()[_0x11e8('0x22')](function(){_0x471183['status'](0xcc)[_0x11e8('0x2d')]();});}};}function handleEntityNotFound(_0x5300a5,_0x1c37e8){return function(_0x2e7887){if(!_0x2e7887){_0x5300a5[_0x11e8('0x3a')](0x194);}return _0x2e7887;};}function handleError(_0x5a12b7,_0x137996){_0x137996=_0x137996||0x1f4;return function(_0xc7f8d7){logger[_0x11e8('0x29')](_0xc7f8d7[_0x11e8('0x3b')]);if(_0xc7f8d7[_0x11e8('0x3c')]){delete _0xc7f8d7[_0x11e8('0x3c')];}_0x5a12b7[_0x11e8('0x2e')](_0x137996)[_0x11e8('0x3d')](_0xc7f8d7);};}exports[_0x11e8('0x3e')]=function(_0x17ef17,_0x3eb01f){var _0x1b0a5e={},_0xc52ca7={},_0x21126c={'count':0x0,'rows':[]};var _0x21d64d=_[_0x11e8('0x3f')](db[_0x11e8('0x40')][_0x11e8('0x41')],function(_0x146cc0){return{'name':_0x146cc0[_0x11e8('0x42')],'type':_0x146cc0[_0x11e8('0x43')][_0x11e8('0x44')]};});_0xc52ca7[_0x11e8('0x45')]=_[_0x11e8('0x3f')](_0x21d64d,_0x11e8('0x3c'));_0xc52ca7['query']=_[_0x11e8('0x46')](_0x17ef17[_0x11e8('0x47')]);_0xc52ca7[_0x11e8('0x48')]=_['intersection'](_0xc52ca7[_0x11e8('0x45')],_0xc52ca7[_0x11e8('0x47')]);_0x1b0a5e[_0x11e8('0x49')]=_['intersection'](_0xc52ca7[_0x11e8('0x45')],qs['fields'](_0x17ef17[_0x11e8('0x47')][_0x11e8('0x4a')]));_0x1b0a5e['attributes']=_0x1b0a5e[_0x11e8('0x49')][_0x11e8('0x4b')]?_0x1b0a5e[_0x11e8('0x49')]:_0xc52ca7[_0x11e8('0x45')];if(!_0x17ef17['query'][_0x11e8('0x4c')]('nolimit')){_0x1b0a5e[_0x11e8('0x31')]=qs[_0x11e8('0x31')](_0x17ef17[_0x11e8('0x47')][_0x11e8('0x31')]);_0x1b0a5e[_0x11e8('0x30')]=qs[_0x11e8('0x30')](_0x17ef17[_0x11e8('0x47')][_0x11e8('0x30')]);}_0x1b0a5e[_0x11e8('0x4d')]=qs['sort'](_0x17ef17[_0x11e8('0x47')][_0x11e8('0x4e')]);_0x1b0a5e[_0x11e8('0x4f')]=qs[_0x11e8('0x48')](_['pick'](_0x17ef17[_0x11e8('0x47')],_0xc52ca7['filters']),_0x21d64d);if(_0x17ef17['query'][_0x11e8('0x50')]){_0x1b0a5e[_0x11e8('0x4f')]=_[_0x11e8('0x51')](_0x1b0a5e[_0x11e8('0x4f')],{'$or':_['map'](_0x21d64d,function(_0x1fce6c){if(_0x1fce6c[_0x11e8('0x43')]!==_0x11e8('0x52')){var _0x5ab437={};_0x5ab437[_0x1fce6c['name']]={'$like':'%'+_0x17ef17['query']['filter']+'%'};return _0x5ab437;}})});}_0x1b0a5e=_['merge']({},_0x1b0a5e,_0x17ef17[_0x11e8('0x53')]);var _0x3d62ce={'where':_0x1b0a5e['where']};return db['FaxMessage'][_0x11e8('0x33')](_0x3d62ce)[_0x11e8('0x22')](function(_0x49f80b){_0x21126c['count']=_0x49f80b;if(_0x17ef17[_0x11e8('0x47')][_0x11e8('0x54')]){_0x1b0a5e[_0x11e8('0x55')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1b0a5e);})[_0x11e8('0x22')](function(_0x24258b){_0x21126c[_0x11e8('0x56')]=_0x24258b;return _0x21126c;})[_0x11e8('0x22')](respondWithFilteredResult(_0x3eb01f,_0x1b0a5e))[_0x11e8('0x2c')](handleError(_0x3eb01f,null));};exports['show']=function(_0x33c890,_0x45a4c2){var _0x125f5a={'raw':!![],'where':{'id':_0x33c890['params']['id']}},_0x17dfce={};_0x17dfce[_0x11e8('0x45')]=_[_0x11e8('0x46')](db['FaxMessage'][_0x11e8('0x41')]);_0x17dfce[_0x11e8('0x47')]=_[_0x11e8('0x46')](_0x33c890[_0x11e8('0x47')]);_0x17dfce[_0x11e8('0x48')]=_[_0x11e8('0x57')](_0x17dfce[_0x11e8('0x45')],_0x17dfce[_0x11e8('0x47')]);_0x125f5a[_0x11e8('0x49')]=_[_0x11e8('0x57')](_0x17dfce['model'],qs[_0x11e8('0x4a')](_0x33c890[_0x11e8('0x47')][_0x11e8('0x4a')]));_0x125f5a[_0x11e8('0x49')]=_0x125f5a[_0x11e8('0x49')]['length']?_0x125f5a['attributes']:_0x17dfce[_0x11e8('0x45')];if(_0x33c890[_0x11e8('0x47')][_0x11e8('0x54')]){_0x125f5a[_0x11e8('0x55')]=[{'all':!![]}];}_0x125f5a=_[_0x11e8('0x51')]({},_0x125f5a,_0x33c890[_0x11e8('0x53')]);return db[_0x11e8('0x40')][_0x11e8('0x58')](_0x125f5a)[_0x11e8('0x22')](handleEntityNotFound(_0x45a4c2,null))[_0x11e8('0x22')](respondWithResult(_0x45a4c2,null))[_0x11e8('0x2c')](handleError(_0x45a4c2,null));};exports[_0x11e8('0x39')]=function(_0x42b949,_0xd5164d){if(_0x42b949['body']['id']){delete _0x42b949[_0x11e8('0x59')]['id'];}return db[_0x11e8('0x40')][_0x11e8('0x58')]({'where':{'id':_0x42b949['params']['id']}})[_0x11e8('0x22')](handleEntityNotFound(_0xd5164d,null))[_0x11e8('0x22')](saveUpdates(_0x42b949[_0x11e8('0x59')],null))['then'](respondWithResult(_0xd5164d,null))['catch'](handleError(_0xd5164d,null));};exports[_0x11e8('0x5a')]=function(_0x1fce59,_0x30c515){return db[_0x11e8('0x40')][_0x11e8('0x58')]({'where':{'id':_0x1fce59[_0x11e8('0x5b')]['id']}})[_0x11e8('0x22')](handleEntityNotFound(_0x30c515,null))[_0x11e8('0x22')](removeEntity(_0x30c515,null))[_0x11e8('0x2c')](handleError(_0x30c515,null));};exports['describe']=function(_0x4ca003,_0x281668){return db[_0x11e8('0x40')][_0x11e8('0x5c')]()[_0x11e8('0x22')](respondWithResult(_0x281668,null))[_0x11e8('0x2c')](handleError(_0x281668,null));};var interaction_log=require('../../config/logger')(_0x11e8('0x5d'));exports[_0x11e8('0x5e')]=function(_0x5baed5,_0x1e3ccd,_0x15e500){var _0x204933={'agent':{},'channel':_0x11e8('0x5f')};if(_0x5baed5['body']['id']){delete _0x5baed5[_0x11e8('0x59')]['id'];}_0x5baed5[_0x11e8('0x59')]['read']=!![];_0x5baed5[_0x11e8('0x59')][_0x11e8('0x60')]=moment()[_0x11e8('0x61')](_0x11e8('0x62'));_0x5baed5[_0x11e8('0x59')][_0x11e8('0x63')]=_0x5baed5[_0x11e8('0x59')][_0x11e8('0x63')]||_0x5baed5['user']['id'];_0x204933[_0x11e8('0x64')]['id']=_0x5baed5[_0x11e8('0x59')][_0x11e8('0x63')];return db[_0x11e8('0x40')][_0x11e8('0x58')]({'where':{'id':_0x5baed5[_0x11e8('0x5b')]['id'],'UserId':null}})[_0x11e8('0x22')](handleEntityNotFound(_0x1e3ccd,null))[_0x11e8('0x22')](saveUpdates(_0x5baed5['body'],null))[_0x11e8('0x22')](function(_0x2ef76b){if(_0x2ef76b){_0x204933[_0x11e8('0x2a')]=_0x2ef76b[_0x11e8('0x65')]({'plain':!![]});return db['FaxInteraction'][_0x11e8('0x58')]({'where':{'id':_0x2ef76b['FaxInteractionId']}});}return null;})[_0x11e8('0x22')](handleEntityNotFound(_0x1e3ccd,null))[_0x11e8('0x22')](function(_0x3d64ad){if(_0x3d64ad){return _0x3d64ad[_0x11e8('0x39')]({'UserId':_0x5baed5[_0x11e8('0x59')][_0x11e8('0x63')],'read1stAt':_[_0x11e8('0x66')](_0x3d64ad[_0x11e8('0x67')])?moment()['format'](_0x11e8('0x62')):undefined});}return null;})[_0x11e8('0x22')](function(_0x59f319){if(_0x59f319){_0x204933[_0x11e8('0x68')]=_0x59f319[_0x11e8('0x65')]({'plain':!![]});interaction_log['info'](_0x11e8('0x69'),_0x5baed5[_0x11e8('0x6a')]['id'],_0x5baed5[_0x11e8('0x6a')][_0x11e8('0x3c')],_0x5baed5['user'][_0x11e8('0x6b')],_0x204933[_0x11e8('0x68')]['id'],_0x5baed5['body']?JSON[_0x11e8('0x28')](_0x5baed5[_0x11e8('0x59')]):_0x11e8('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x204933);}return null;})[_0x11e8('0x22')](function(_0x39501e){var _0x356f53=_0x11e8('0x6d')+_0x39501e[_0x11e8('0x2a')]['ContactId'];return db[_0x11e8('0x6e')][_0x11e8('0x47')](_0x356f53,{'type':db['Sequelize'][_0x11e8('0x6f')]['SELECT'],'raw':!![]})[_0x11e8('0x22')](function(_0x4a2a3b){return _0x4a2a3b;});})[_0x11e8('0x22')](function(_0x54829f){if(_0x54829f){_0x204933[_0x11e8('0x2a')][_0x11e8('0x70')]=_0x54829f[0x0];if(!_0x5baed5[_0x11e8('0x59')][_0x11e8('0x63')])return;return db[_0x11e8('0x71')]['find']({'where':{'id':_0x5baed5[_0x11e8('0x59')][_0x11e8('0x63')],'role':_0x11e8('0x64')},'attributes':['id',_0x11e8('0x3c'),_0x11e8('0x72'),_0x11e8('0x73'),_0x11e8('0x74')],'raw':!![]});}return null;})[_0x11e8('0x22')](function(_0xc9631f){if(!_0xc9631f)return null;_0x204933['message'][_0x11e8('0x64')]=_0xc9631f;return _0x204933;})[_0x11e8('0x22')](function(_0x22023d){if(_0x22023d){if(_0x5baed5[_0x11e8('0x59')][_0x11e8('0x75')]){_0x204933['message']['interface']=util[_0x11e8('0x61')](_0x11e8('0x76'),_0x5baed5['user'][_0x11e8('0x3c')]);_0x204933[_0x11e8('0x2a')][_0x11e8('0x77')]=_0x204933[_0x11e8('0x77')];_0x204933[_0x11e8('0x2a')][_0x11e8('0x78')]=_0x204933[_0x11e8('0x77')];_0x204933['message'][_0x11e8('0x79')]=_0x11e8('0x5e');return respondWithRpcPromise(_0x11e8('0x7a'),_0x11e8('0x7a'),{'event':_0x11e8('0x7b'),'message':_0x204933[_0x11e8('0x2a')]},client9002)[_0x11e8('0x22')](function(){return _0x204933;});}return _0x204933;}return null;})[_0x11e8('0x22')](respondWithResult(_0x1e3ccd,null))['catch'](handleError(_0x1e3ccd,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['reject']=function(_0x4bf089,_0x1a4c41,_0x2caa07){var _0x302a33={'agent':{},'channel':'fax'};if(_0x4bf089[_0x11e8('0x59')]['id']){delete _0x4bf089['body']['id'];}_0x4bf089['body'][_0x11e8('0x63')]=_0x4bf089[_0x11e8('0x59')][_0x11e8('0x63')]||_0x4bf089[_0x11e8('0x6a')]['id'];_0x302a33[_0x11e8('0x64')]['id']=_0x4bf089['body'][_0x11e8('0x63')];return db['FaxMessage'][_0x11e8('0x58')]({'where':{'id':_0x4bf089[_0x11e8('0x5b')]['id'],'UserId':null}})[_0x11e8('0x22')](handleEntityNotFound(_0x1a4c41,null))[_0x11e8('0x22')](function(_0x46ab4d){if(_0x46ab4d){_0x302a33[_0x11e8('0x2a')]=_0x46ab4d[_0x11e8('0x65')]({'plain':!![]});return db[_0x11e8('0x7c')]['find']({'where':{'id':_0x46ab4d['FaxInteractionId']}});}return null;})[_0x11e8('0x22')](handleEntityNotFound(_0x1a4c41,null))[_0x11e8('0x22')](function(_0x2469b3){if(_0x2469b3){_0x302a33[_0x11e8('0x68')]=_0x2469b3[_0x11e8('0x65')]({'plain':!![]});interaction_log[_0x11e8('0x23')](_0x11e8('0x7d'),_0x4bf089[_0x11e8('0x6a')]['id'],_0x4bf089['user'][_0x11e8('0x3c')],_0x4bf089[_0x11e8('0x6a')][_0x11e8('0x6b')],_0x302a33[_0x11e8('0x68')]['id'],_0x4bf089[_0x11e8('0x59')]?JSON['stringify'](_0x4bf089[_0x11e8('0x59')]):_0x11e8('0x6c'));return respondWithRpcPromise(_0x11e8('0x7e'),'rejectMessage',_0x302a33);}return null;})[_0x11e8('0x22')](function(_0x7214fe){var _0x2e3835=_0x11e8('0x6d')+_0x7214fe[_0x11e8('0x2a')]['ContactId'];return db['sequelize'][_0x11e8('0x47')](_0x2e3835,{'type':db[_0x11e8('0x7f')][_0x11e8('0x6f')][_0x11e8('0x80')],'raw':!![]})[_0x11e8('0x22')](function(_0x73707){return _0x73707;});})['then'](function(_0x4c3d53){if(_0x4c3d53){_0x302a33[_0x11e8('0x2a')][_0x11e8('0x70')]=_0x4c3d53[0x0];if(!_0x4bf089[_0x11e8('0x59')][_0x11e8('0x63')])return;return db[_0x11e8('0x71')][_0x11e8('0x58')]({'where':{'id':_0x4bf089[_0x11e8('0x59')][_0x11e8('0x63')],'role':_0x11e8('0x64')},'attributes':['id',_0x11e8('0x3c'),_0x11e8('0x72'),'email','internal'],'raw':!![]});}return null;})[_0x11e8('0x22')](function(_0x25b93b){if(!_0x25b93b)return null;_0x302a33[_0x11e8('0x2a')][_0x11e8('0x64')]=_0x25b93b;return _0x302a33;})[_0x11e8('0x22')](function(_0x5d16a3){if(_0x5d16a3){_0x5d16a3['message']['interface']=util['format'](_0x11e8('0x76'),_0x4bf089[_0x11e8('0x6a')]['name']);_0x5d16a3[_0x11e8('0x2a')][_0x11e8('0x77')]=_0x302a33[_0x11e8('0x77')];_0x5d16a3[_0x11e8('0x2a')][_0x11e8('0x78')]=_0x302a33[_0x11e8('0x77')];_0x5d16a3['message'][_0x11e8('0x79')]=_0x11e8('0x37');respondWithRpcPromise(_0x11e8('0x7a'),_0x11e8('0x7a'),{'event':_0x11e8('0x81'),'message':_0x5d16a3[_0x11e8('0x2a')]},client9002);return _0x302a33;}return null;})[_0x11e8('0x22')](respondWithResult(_0x1a4c41,null))[_0x11e8('0x2c')](handleError(_0x1a4c41,null));};exports['create']=function(_0xa2ba34,_0x5340fc){var _0x54b925;return db[_0x11e8('0x40')][_0x11e8('0x82')](_0xa2ba34[_0x11e8('0x59')],{})[_0x11e8('0x22')](function(_0x1be903){_0x54b925=_0x1be903;return db[_0x11e8('0x83')]['findOne']({'where':{'id':_0x54b925[_0x11e8('0x84')]}});})[_0x11e8('0x22')](function(_0x1c91ea){if(_[_0x11e8('0x66')](_0x1c91ea)){return;}else{_0x54b925[_0x11e8('0x5f')]=_0x1c91ea['fax'];return db[_0x11e8('0x85')][_0x11e8('0x86')]({'where':{'id':_0x54b925[_0x11e8('0x87')]}});}})[_0x11e8('0x22')](function(_0x491b22){return respondWithRpcPromise(_0x11e8('0x88'),_0x11e8('0x88'),{'FaxAccountId':_['isNil'](_0xa2ba34[_0x11e8('0x59')])?undefined:_0xa2ba34[_0x11e8('0x59')][_0x11e8('0x89')],'path':_[_0x11e8('0x66')](_0x491b22)?undefined:util[_0x11e8('0x61')]('/var/opt/motion2/server/files/attachments/%s',_0x491b22['basename']),'fax':_[_0x11e8('0x66')](_0x54b925['fax'])?undefined:_0x54b925[_0x11e8('0x5f')],'AttachmentId':_0x54b925[_0x11e8('0x87')]},client9002);})[_0x11e8('0x22')](respondWithResult(_0x5340fc,0xc9))[_0x11e8('0x2c')](handleError(_0x5340fc,null));};exports[_0x11e8('0x8a')]=function(_0x2d1381,_0x111d53){var _0x282f94=path[_0x11e8('0x8b')](config[_0x11e8('0x8c')],_0x11e8('0x8d'),_0x11e8('0x8e'),_0x11e8('0x8f'));return db[_0x11e8('0x40')]['find']({'where':{'id':_0x2d1381['params']['id']},'include':[{'model':db[_0x11e8('0x85')],'as':_0x11e8('0x85')}]})[_0x11e8('0x22')](handleEntityNotFound(_0x111d53,null))[_0x11e8('0x22')](function(_0x2e9809){if(_0x2e9809){return _0x111d53[_0x11e8('0x8a')](path['join'](_0x282f94,_0x2e9809[_0x11e8('0x85')][_0x11e8('0x90')]));}})['catch'](handleError(_0x111d53,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 06ca008..3248033 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 _0x7880=['exports','events','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7880,0x10f));var _0x0788=function(_0x66ef11,_0x42f78b){_0x66ef11=_0x66ef11-0x0;var _0x318579=_0x7880[_0x66ef11];return _0x318579;};'use strict';var EventEmitter=require(_0x0788('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x0788('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0788('0x2')](0x0);var events={'afterCreate':_0x0788('0x3'),'afterUpdate':_0x0788('0x4'),'afterDestroy':_0x0788('0x5')};function emitEvent(_0x509799){return function(_0x563529,_0x10143c,_0x487b5b){FaxMessageEvents[_0x0788('0x6')](_0x509799+':'+_0x563529['id'],_0x563529);FaxMessageEvents[_0x0788('0x6')](_0x509799,_0x563529);_0x487b5b(null);};}for(var e in events){if(events[_0x0788('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x0788('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xd386=['FaxMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x466024,_0x549202){var _0x1ebcf5=function(_0x4e6064){while(--_0x4e6064){_0x466024['push'](_0x466024['shift']());}};_0x1ebcf5(++_0x549202);}(_0xd386,0x10c));var _0x6d38=function(_0x7d2272,_0x41f365){_0x7d2272=_0x7d2272-0x0;var _0x5bc56e=_0xd386[_0x7d2272];return _0x5bc56e;};'use strict';var EventEmitter=require(_0x6d38('0x0'));var FaxMessage=require(_0x6d38('0x1'))['db'][_0x6d38('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d38('0x3'),'afterUpdate':_0x6d38('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ce7c5){return function(_0x21b7ee,_0x97f669,_0xa6b2b3){FaxMessageEvents['emit'](_0x1ce7c5+':'+_0x21b7ee['id'],_0x21b7ee);FaxMessageEvents[_0x6d38('0x5')](_0x1ce7c5,_0x21b7ee);_0xa6b2b3(null);};}for(var e in events){if(events[_0x6d38('0x6')](e)){var event=events[e];FaxMessage[_0x6d38('0x7')](e,emitEvent(event));}}module[_0x6d38('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index cf094a3..262fc4f 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 _0xed88=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','update','error'];(function(_0x162367,_0x41f140){var _0x3a23c4=function(_0x572998){while(--_0x572998){_0x162367['push'](_0x162367['shift']());}};_0x3a23c4(++_0x41f140);}(_0xed88,0x17b));var _0x8ed8=function(_0x15f4f4,_0x26072c){_0x15f4f4=_0x15f4f4-0x0;var _0x48f9dc=_0xed88[_0x15f4f4];return _0x48f9dc;};'use strict';var _=require('lodash');var util=require(_0x8ed8('0x0'));var logger=require(_0x8ed8('0x1'))(_0x8ed8('0x2'));var moment=require(_0x8ed8('0x3'));var BPromise=require(_0x8ed8('0x4'));var rp=require(_0x8ed8('0x5'));var fs=require('fs');var path=require(_0x8ed8('0x6'));var rimraf=require(_0x8ed8('0x7'));var config=require(_0x8ed8('0x8'));var attributes=require(_0x8ed8('0x9'));module['exports']=function(_0xc99965,_0x124d30){return _0xc99965[_0x8ed8('0xa')](_0x8ed8('0xb'),attributes,{'tableName':_0x8ed8('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x8ed8('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43a19,_0x42347d,_0x31c193){var _0x219947=_0xc99965[_0x8ed8('0xe')];var _0x352758=_0x43a19[_0x8ed8('0xf')]({'plain':!![]});if(_0x352758[_0x8ed8('0x10')]['toLowerCase']()==='in'||_0x352758[_0x8ed8('0x10')][_0x8ed8('0x11')]()===_0x8ed8('0x12')&&!_0x352758[_0x8ed8('0x13')]&&!_['isNil'](_0x352758[_0x8ed8('0x14')])){_0x219947[_0x8ed8('0x15')][_0x8ed8('0x16')]({'where':{'id':_0x352758[_0x8ed8('0x17')]}})['then'](function(_0x49c620){if(_0x49c620){_0x49c620[_0x8ed8('0x18')]({'lastMsgAt':_0x352758['createdAt'],'lastMsgDirection':_0x352758[_0x8ed8('0x10')][_0x8ed8('0x11')]()});}})['catch'](function(_0x87a6e7){console[_0x8ed8('0x19')](_0x87a6e7);});}_0x31c193();}},'charset':'utf8mb4','collate':_0x8ed8('0x1a')});}; \ No newline at end of file +var _0xe4a1=['fti_fax_messages','models','get','direction','toLowerCase','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages'];(function(_0x3bb10f,_0x4e90df){var _0x4877e5=function(_0x4be32d){while(--_0x4be32d){_0x3bb10f['push'](_0x3bb10f['shift']());}};_0x4877e5(++_0x4e90df);}(_0xe4a1,0xee));var _0x1e4a=function(_0x2bcf98,_0x133745){_0x2bcf98=_0x2bcf98-0x0;var _0x30dc04=_0xe4a1[_0x2bcf98];return _0x30dc04;};'use strict';var _=require(_0x1e4a('0x0'));var util=require(_0x1e4a('0x1'));var logger=require(_0x1e4a('0x2'))(_0x1e4a('0x3'));var moment=require(_0x1e4a('0x4'));var BPromise=require(_0x1e4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e4a('0x6'));var config=require(_0x1e4a('0x7'));var attributes=require(_0x1e4a('0x8'));module[_0x1e4a('0x9')]=function(_0x598180,_0x3e5eac){return _0x598180[_0x1e4a('0xa')]('FaxMessage',attributes,{'tableName':_0x1e4a('0xb'),'paranoid':![],'indexes':[{'name':_0x1e4a('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c2290,_0x3dfbc1,_0x48bd1a){var _0x476de9=_0x598180[_0x1e4a('0xd')];var _0x1ef911=_0x4c2290[_0x1e4a('0xe')]({'plain':!![]});if(_0x1ef911[_0x1e4a('0xf')][_0x1e4a('0x10')]()==='in'||_0x1ef911[_0x1e4a('0xf')][_0x1e4a('0x10')]()==='out'&&!_0x1ef911['secret']&&!_['isNil'](_0x1ef911['UserId'])){_0x476de9[_0x1e4a('0x11')][_0x1e4a('0x12')]({'where':{'id':_0x1ef911[_0x1e4a('0x13')]}})[_0x1e4a('0x14')](function(_0x1015e8){if(_0x1015e8){_0x1015e8[_0x1e4a('0x15')]({'lastMsgAt':_0x1ef911[_0x1e4a('0x16')],'lastMsgDirection':_0x1ef911['direction']['toLowerCase']()});}})[_0x1e4a('0x17')](function(_0x2f3b8e){console['error'](_0x2f3b8e);});}_0x48bd1a();}},'charset':_0x1e4a('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c994342..8fa5729 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 _0x2d17=['create','catch','UpdateFaxMessage','FaxMessage','body','options','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage'];(function(_0x7d1be0,_0x3509e1){var _0x6f1a35=function(_0x15adfc){while(--_0x15adfc){_0x7d1be0['push'](_0x7d1be0['shift']());}};_0x6f1a35(++_0x3509e1);}(_0x2d17,0x17e));var _0x72d1=function(_0x4039e4,_0x3d4436){_0x4039e4=_0x4039e4-0x0;var _0x361a7e=_0x2d17[_0x4039e4];return _0x361a7e;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('FaxMessage,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});}exports[_0x72d1('0x19')]=function(_0x1865c1){var _0x8d6890=this;return new Promise(function(_0x2253fd,_0x1e2411){return db['FaxMessage'][_0x72d1('0x1a')](_0x1865c1['body'],{'raw':_0x1865c1['options']?_0x1865c1['options']['raw']===undefined?!![]:![]:!![]})[_0x72d1('0xf')](function(_0x374602){logger['info'](_0x72d1('0x19'),_0x1865c1);logger[_0x72d1('0x13')](_0x72d1('0x19'),_0x1865c1,JSON[_0x72d1('0x14')](_0x374602));_0x2253fd(_0x374602);})[_0x72d1('0x1b')](function(_0x4e6acd){logger['error'](_0x72d1('0x19'),_0x4e6acd[_0x72d1('0x17')],_0x1865c1);_0x1e2411(_0x8d6890[_0x72d1('0x15')](0x1f4,_0x4e6acd[_0x72d1('0x17')]));});});};exports[_0x72d1('0x1c')]=function(_0x33d530){var _0x163bec=this;return new Promise(function(_0x589f7c,_0x57ec9e){return db[_0x72d1('0x1d')]['update'](_0x33d530[_0x72d1('0x1e')],{'raw':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d530[_0x72d1('0x1f')]?_0x33d530['options'][_0x72d1('0x20')]||null:null,'attributes':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')][_0x72d1('0x21')]||null:null,'limit':_0x33d530['options']?_0x33d530[_0x72d1('0x1f')]['limit']||null:null})[_0x72d1('0xf')](function(_0x32dc5e){logger['info'](_0x72d1('0x1c'),_0x33d530);logger[_0x72d1('0x13')](_0x72d1('0x1c'),_0x33d530,JSON[_0x72d1('0x14')](_0x32dc5e));_0x589f7c(_0x32dc5e);})[_0x72d1('0x1b')](function(_0x52511f){logger[_0x72d1('0x15')](_0x72d1('0x1c'),_0x52511f[_0x72d1('0x17')],_0x33d530);_0x57ec9e(_0x163bec['error'](0x1f4,_0x52511f[_0x72d1('0x17')]));});});}; \ No newline at end of file +var _0xfd28=['message','info','catch','create','body','options','then','CreateFaxMessage','UpdateFaxMessage','FaxMessage','raw','where','attributes','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b7092,_0x508668){var _0x2941da=function(_0x23f816){while(--_0x23f816){_0x3b7092['push'](_0x3b7092['shift']());}};_0x2941da(++_0x508668);}(_0xfd28,0x148));var _0x8fd2=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xfd28[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});config[_0x8fd2('0xa')]=_['defaults'](config['redis'],{'host':_0x8fd2('0xb'),'port':0x18eb});var socket=require(_0x8fd2('0xc'))(new Redis(config[_0x8fd2('0xa')]));require('./faxMessage.socket')[_0x8fd2('0xd')](socket);function respondWithRpcPromise(_0x49ca87,_0x2842f3,_0x5aabf0){return new BPromise(function(_0x34ae5c,_0x4fdf0b){return client[_0x8fd2('0xe')](_0x49ca87,_0x5aabf0)['then'](function(_0x1b6558){logger['info'](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));logger[_0x8fd2('0x11')](_0x8fd2('0x12'),_0x2842f3,_0x8fd2('0x10'),JSON[_0x8fd2('0x13')](_0x1b6558));if(_0x1b6558[_0x8fd2('0x14')]){if(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x15')]===0x1f4){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);return _0x4fdf0b(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);}logger['error'](_0x8fd2('0xf'),_0x2842f3,_0x1b6558['error']['message']);return _0x34ae5c(_0x1b6558['error'][_0x8fd2('0x16')]);}else{logger[_0x8fd2('0x17')](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));_0x34ae5c(_0x1b6558['result'][_0x8fd2('0x16')]);}})[_0x8fd2('0x18')](function(_0x411943){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x411943);_0x4fdf0b(_0x411943);});});}exports['CreateFaxMessage']=function(_0x48ad51){var _0x3a0939=this;return new Promise(function(_0x4a2002,_0x3c03de){return db['FaxMessage'][_0x8fd2('0x19')](_0x48ad51[_0x8fd2('0x1a')],{'raw':_0x48ad51['options']?_0x48ad51[_0x8fd2('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8fd2('0x1c')](function(_0x44ee7a){logger['info'](_0x8fd2('0x1d'),_0x48ad51);logger[_0x8fd2('0x11')](_0x8fd2('0x1d'),_0x48ad51,JSON['stringify'](_0x44ee7a));_0x4a2002(_0x44ee7a);})[_0x8fd2('0x18')](function(_0x3b9e2f){logger[_0x8fd2('0x14')](_0x8fd2('0x1d'),_0x3b9e2f[_0x8fd2('0x16')],_0x48ad51);_0x3c03de(_0x3a0939[_0x8fd2('0x14')](0x1f4,_0x3b9e2f[_0x8fd2('0x16')]));});});};exports[_0x8fd2('0x1e')]=function(_0x1456b4){var _0xbc5945=this;return new Promise(function(_0x3392fb,_0x1f3237){return db[_0x8fd2('0x1f')]['update'](_0x1456b4['body'],{'raw':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1456b4['options']?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x21')]||null:null,'attributes':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x22')]||null:null,'limit':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')]['limit']||null:null})[_0x8fd2('0x1c')](function(_0x13c9b9){logger[_0x8fd2('0x17')](_0x8fd2('0x1e'),_0x1456b4);logger[_0x8fd2('0x11')](_0x8fd2('0x1e'),_0x1456b4,JSON[_0x8fd2('0x13')](_0x13c9b9));_0x3392fb(_0x13c9b9);})['catch'](function(_0x5b992a){logger['error'](_0x8fd2('0x1e'),_0x5b992a[_0x8fd2('0x16')],_0x1456b4);_0x1f3237(_0xbc5945[_0x8fd2('0x14')](0x1f4,_0x5b992a[_0x8fd2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8c23f6f..494662e 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 _0x04b0=['register','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x995cac,_0x3932a7){var _0x22d338=function(_0x5a8c95){while(--_0x5a8c95){_0x995cac['push'](_0x995cac['shift']());}};_0x22d338(++_0x3932a7);}(_0x04b0,0xd2));var _0x004b=function(_0x25a798,_0x1e12ec){_0x25a798=_0x25a798-0x0;var _0xa7c00=_0x04b0[_0x25a798];return _0xa7c00;};'use strict';var FaxMessageEvents=require(_0x004b('0x0'));var events=[_0x004b('0x1'),_0x004b('0x2'),_0x004b('0x3')];function createListener(_0x4e12b1,_0x3e8448){return function(_0x452773){_0x3e8448[_0x004b('0x4')](_0x4e12b1,_0x452773);};}function removeListener(_0x286854,_0x3c16cd){return function(){FaxMessageEvents[_0x004b('0x5')](_0x286854,_0x3c16cd);};}exports[_0x004b('0x6')]=function(_0x4a531d){for(var _0x5e512e=0x0,_0x2806a8=events['length'];_0x5e512e<_0x2806a8;_0x5e512e++){var _0xcf18e7=events[_0x5e512e];var _0x51bf7d=createListener(_0x004b('0x7')+_0xcf18e7,_0x4a531d);FaxMessageEvents['on'](_0xcf18e7,_0x51bf7d);}}; \ No newline at end of file +var _0xcb3e=['removeListener','register','./faxMessage.events','remove','update','emit'];(function(_0x57832d,_0xaf1c8){var _0x4c2a8c=function(_0x13df83){while(--_0x13df83){_0x57832d['push'](_0x57832d['shift']());}};_0x4c2a8c(++_0xaf1c8);}(_0xcb3e,0x1c4));var _0xecb3=function(_0x4528cf,_0x3b1892){_0x4528cf=_0x4528cf-0x0;var _0x4bca53=_0xcb3e[_0x4528cf];return _0x4bca53;};'use strict';var FaxMessageEvents=require(_0xecb3('0x0'));var events=['save',_0xecb3('0x1'),_0xecb3('0x2')];function createListener(_0x1d8689,_0x2e686f){return function(_0x587dae){_0x2e686f[_0xecb3('0x3')](_0x1d8689,_0x587dae);};}function removeListener(_0x1c4ad5,_0x476f99){return function(){FaxMessageEvents[_0xecb3('0x4')](_0x1c4ad5,_0x476f99);};}exports[_0xecb3('0x5')]=function(_0x2a7840){for(var _0x55bb33=0x0,_0x1e8f9c=events['length'];_0x55bb33<_0x1e8f9c;_0x55bb33++){var _0xe5b244=events[_0x55bb33];var _0x246b74=createListener('faxMessage:'+_0xe5b244,_0x2a7840);FaxMessageEvents['on'](_0xe5b244,_0x246b74);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 7da686c..f4f53c8 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 _0x2e54=['download','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0x2e54,0x1dd));var _0x42e5=function(_0x12f331,_0xf732dc){_0x12f331=_0x12f331-0x0;var _0x493b88=_0x2e54[_0x12f331];return _0x493b88;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./faxMessage.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),interaction['tracked'](_0x42e5('0x12'),_0x42e5('0x13')),controller['create']);router[_0x42e5('0x14')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x15')]);router[_0x42e5('0x14')](_0x42e5('0x16'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x17')]);router[_0x42e5('0x14')](_0x42e5('0x18'),auth['isAuthenticated'](),controller[_0x42e5('0x19')]);router[_0x42e5('0x1a')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x1b')]);module[_0x42e5('0x1c')]=router; \ No newline at end of file +var _0x22fb=['destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','update','put','/:id/accept','accept','delete'];(function(_0xefb33e,_0x11bbb5){var _0x529db6=function(_0x4439ea){while(--_0x4439ea){_0xefb33e['push'](_0xefb33e['shift']());}};_0x529db6(++_0x11bbb5);}(_0x22fb,0x192));var _0xb22f=function(_0x2a6b92,_0x3119d0){_0x2a6b92=_0x2a6b92-0x0;var _0x162d02=_0x22fb[_0x2a6b92];return _0x162d02;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0x7')](_0xb22f('0xe'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')]('/',auth[_0xb22f('0x8')](),interaction['tracked']('fax','faxmessage:create'),controller[_0xb22f('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb22f('0x12')]);router[_0xb22f('0x13')](_0xb22f('0x14'),auth[_0xb22f('0x8')](),controller[_0xb22f('0x15')]);router[_0xb22f('0x13')]('/:id/reject',auth[_0xb22f('0x8')](),controller['reject']);router[_0xb22f('0x16')]('/:id',auth[_0xb22f('0x8')](),controller[_0xb22f('0x17')]);module[_0xb22f('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 707c15b..6ec18bf 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 _0x21a8=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x1943d5,_0x16fed5){var _0x3f02ef=function(_0x375acc){while(--_0x375acc){_0x1943d5['push'](_0x1943d5['shift']());}};_0x3f02ef(++_0x16fed5);}(_0x21a8,0xed));var _0x821a=function(_0xdfa25b,_0x4b35ff){_0xdfa25b=_0xdfa25b-0x0;var _0xa0e09c=_0x21a8[_0xdfa25b];return _0xa0e09c;};'use strict';var Sequelize=require(_0x821a('0x0'));module[_0x821a('0x1')]={'name':{'type':Sequelize[_0x821a('0x2')],'unique':_0x821a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x821a('0x2')]},'timeout':{'type':Sequelize[_0x821a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x821a('0x5')](_0x821a('0x6'),_0x821a('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x821a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4d21=['exports','STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x47137a,_0x5322a7){var _0x573b0a=function(_0x59b375){while(--_0x59b375){_0x47137a['push'](_0x47137a['shift']());}};_0x573b0a(++_0x5322a7);}(_0x4d21,0xc3));var _0x14d2=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x4d21[_0x3b711c];return _0x2685f0;};'use strict';var Sequelize=require(_0x14d2('0x0'));module[_0x14d2('0x1')]={'name':{'type':Sequelize[_0x14d2('0x2')],'unique':_0x14d2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x14d2('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x14d2('0x5')]('rrmemory','beepall',_0x14d2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x14d2('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 ea241b2..c65acfc 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 _0x4bd3=['addAgents','spread','isArray','getAgents','order','nolimit','bluebird','lodash','squel','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','get','FaxQueues','UserProfileResource','destroy','end','name','send','index','FaxQueue','rawAttributes','fieldName','key','getOptions','where','include','query','rows','model','keys','filters','attributes','fields','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','intersection','length','sort','pick','FaxQueueId','map','UserFaxQueue','findAll','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','filter','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4bd3,0x174));var _0x34bd=function(_0x3f5726,_0x5d636c){_0x3f5726=_0x3f5726-0x0;var _0x4e7bef=_0x4bd3[_0x3f5726];return _0x4e7bef;};'use strict';var BPromise=require(_0x34bd('0x0'));var util=require('util');var _=require(_0x34bd('0x1'));var squel=require(_0x34bd('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x34bd('0x3'));var config=require(_0x34bd('0x4'));var db=require(_0x34bd('0x5'))['db'];config['redis']=_[_0x34bd('0x6')](config[_0x34bd('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x34bd('0x8'))(new Redis(config[_0x34bd('0x7')]));require('./faxQueue.socket')[_0x34bd('0x9')](socket);function respondWithStatusCode(_0x76de8d,_0x3260ff){_0x3260ff=_0x3260ff||0xcc;return function(_0xed6181){if(_0xed6181){return _0x76de8d[_0x34bd('0xa')](_0x3260ff);}return _0x76de8d[_0x34bd('0xb')](_0x3260ff)['end']();};}function respondWithResult(_0x4102c1,_0x45322f){_0x45322f=_0x45322f||0xc8;return function(_0x282ea6){if(_0x282ea6){return _0x4102c1[_0x34bd('0xb')](_0x45322f)['json'](_0x282ea6);}};}function respondWithFilteredResult(_0x4a8622,_0x3da7a0){return function(_0x5e4ce7){if(_0x5e4ce7){var _0x4ac0dc=typeof _0x3da7a0[_0x34bd('0xc')]===_0x34bd('0xd')&&typeof _0x3da7a0[_0x34bd('0xe')]===_0x34bd('0xd');var _0x2ee180=_0x5e4ce7[_0x34bd('0xf')];var _0x4134ee=_0x4ac0dc?0x0:_0x3da7a0[_0x34bd('0xc')];var _0xf6d2f2=_0x4ac0dc?_0x5e4ce7['count']:_0x3da7a0[_0x34bd('0xc')]+_0x3da7a0['limit'];var _0x4e3886;if(_0xf6d2f2>=_0x2ee180){_0xf6d2f2=_0x2ee180;_0x4e3886=0xc8;}else{_0x4e3886=0xce;}_0x4a8622[_0x34bd('0xb')](_0x4e3886);return _0x4a8622[_0x34bd('0x10')](_0x34bd('0x11'),_0x4134ee+'-'+_0xf6d2f2+'/'+_0x2ee180)[_0x34bd('0x12')](_0x5e4ce7);}return null;};}function saveUpdates(_0x34b91b){return function(_0x1643af){if(_0x1643af){return _0x1643af[_0x34bd('0x13')](_0x34b91b)[_0x34bd('0x14')](function(_0x3b4bf8){return _0x3b4bf8;});}return null;};}function removeEntity(_0x72b197){return function(_0x4b5ebb){if(_0x4b5ebb){return _0x4b5ebb['destroy']()[_0x34bd('0x14')](function(){var _0x324f7d=_0x4b5ebb[_0x34bd('0x15')]({'plain':!![]});var _0x220666=_0x34bd('0x16');return db[_0x34bd('0x17')][_0x34bd('0x18')]({'where':{'type':_0x220666,'resourceId':_0x324f7d['id']}})[_0x34bd('0x14')](function(){return _0x4b5ebb;});})[_0x34bd('0x14')](function(){_0x72b197['status'](0xcc)[_0x34bd('0x19')]();});}};}function handleEntityNotFound(_0xe02cc5){return function(_0x49f625){if(!_0x49f625){_0xe02cc5[_0x34bd('0xa')](0x194);}return _0x49f625;};}function handleError(_0x463224,_0x5e0c06){_0x5e0c06=_0x5e0c06||0x1f4;return function(_0x582772){logger['error'](_0x582772['stack']);if(_0x582772[_0x34bd('0x1a')]){delete _0x582772['name'];}_0x463224[_0x34bd('0xb')](_0x5e0c06)[_0x34bd('0x1b')](_0x582772);};}exports[_0x34bd('0x1c')]=function(_0x5c3c85,_0x41bffd){var _0x14479a={};var _0x4f0dff={'count':0x0,'rows':[]};var _0x457006=_['map'](db[_0x34bd('0x1d')][_0x34bd('0x1e')],function(_0x264c94){return{'name':_0x264c94[_0x34bd('0x1f')],'type':_0x264c94['type'][_0x34bd('0x20')]};});_0x14479a=qs[_0x34bd('0x21')](_0x457006,_0x5c3c85);var _0x5d2e3d={'where':_0x14479a[_0x34bd('0x22')]};return db[_0x34bd('0x1d')][_0x34bd('0xf')](_0x5d2e3d)[_0x34bd('0x14')](function(_0x26b8e7){_0x4f0dff[_0x34bd('0xf')]=_0x26b8e7;_0x14479a[_0x34bd('0x23')]=qs['include'](_0x5c3c85[_0x34bd('0x24')]);return db[_0x34bd('0x1d')]['findAll'](_0x14479a);})['then'](function(_0x38bdba){_0x4f0dff[_0x34bd('0x25')]=_0x38bdba;return _0x4f0dff;})[_0x34bd('0x14')](respondWithFilteredResult(_0x41bffd,_0x14479a))['catch'](handleError(_0x41bffd,null));};exports['show']=function(_0x3cf514,_0x386ee6){var _0x1387b5={'raw':!![],'where':{'id':_0x3cf514['params']['id']}},_0x19eb5d={};_0x19eb5d[_0x34bd('0x26')]=_[_0x34bd('0x27')](db[_0x34bd('0x1d')][_0x34bd('0x1e')]);_0x19eb5d[_0x34bd('0x24')]=_[_0x34bd('0x27')](_0x3cf514['query']);_0x19eb5d[_0x34bd('0x28')]=_['intersection'](_0x19eb5d[_0x34bd('0x26')],_0x19eb5d[_0x34bd('0x24')]);_0x1387b5[_0x34bd('0x29')]=_['intersection'](_0x19eb5d[_0x34bd('0x26')],qs[_0x34bd('0x2a')](_0x3cf514['query'][_0x34bd('0x2a')]));_0x1387b5[_0x34bd('0x29')]=_0x1387b5[_0x34bd('0x29')]['length']?_0x1387b5[_0x34bd('0x29')]:_0x19eb5d[_0x34bd('0x26')];if(_0x3cf514['query'][_0x34bd('0x2b')]){_0x1387b5[_0x34bd('0x23')]=[{'all':!![]}];}_0x1387b5=_[_0x34bd('0x2c')]({},_0x1387b5,_0x3cf514[_0x34bd('0x2d')]);return db[_0x34bd('0x1d')][_0x34bd('0x2e')](_0x1387b5)['then'](handleEntityNotFound(_0x386ee6,null))['then'](respondWithResult(_0x386ee6,null))['catch'](handleError(_0x386ee6,null));};exports[_0x34bd('0x2f')]=function(_0x1258cf,_0x5e30c5){return db['FaxQueue'][_0x34bd('0x2f')](_0x1258cf['body'],{})['then'](function(_0x86b626){var _0xb5a456=_0x1258cf[_0x34bd('0x30')][_0x34bd('0x15')]({'plain':!![]});if(!_0xb5a456)throw new Error(_0x34bd('0x31'));if(_0xb5a456['role']==='user'){var _0xd4edfa=_0x86b626['get']({'plain':!![]});var _0xce6bc6=_0x34bd('0x16');return db[_0x34bd('0x32')][_0x34bd('0x2e')]({'where':{'name':_0xce6bc6,'userProfileId':_0xb5a456[_0x34bd('0x33')]},'raw':!![]})['then'](function(_0x282297){if(_0x282297&&_0x282297[_0x34bd('0x34')]===0x0){return db[_0x34bd('0x17')][_0x34bd('0x2f')]({'name':_0xd4edfa['name'],'resourceId':_0xd4edfa['id'],'type':_0x282297[_0x34bd('0x1a')],'sectionId':_0x282297['id']},{})['then'](function(){return _0x86b626;});}else{return _0x86b626;}})[_0x34bd('0x35')](function(_0x560282){logger['error'](_0x34bd('0x36'),_0x560282);throw _0x560282;});}return _0x86b626;})['then'](respondWithResult(_0x5e30c5,0xc9))[_0x34bd('0x35')](handleError(_0x5e30c5,null));};exports[_0x34bd('0x13')]=function(_0x18e9f6,_0x42a424){if(_0x18e9f6[_0x34bd('0x37')]['id']){delete _0x18e9f6[_0x34bd('0x37')]['id'];}return db[_0x34bd('0x1d')]['find']({'where':{'id':_0x18e9f6['params']['id']}})['then'](handleEntityNotFound(_0x42a424,null))[_0x34bd('0x14')](saveUpdates(_0x18e9f6[_0x34bd('0x37')],null))[_0x34bd('0x14')](respondWithResult(_0x42a424,null))[_0x34bd('0x35')](handleError(_0x42a424,null));};exports['destroy']=function(_0x412fa5,_0x148abe){return db[_0x34bd('0x1d')][_0x34bd('0x2e')]({'where':{'id':_0x412fa5[_0x34bd('0x38')]['id']}})['then'](handleEntityNotFound(_0x148abe,null))[_0x34bd('0x14')](removeEntity(_0x148abe,null))['catch'](handleError(_0x148abe,null));};exports['describe']=function(_0x1c637f,_0x53a114){return db[_0x34bd('0x1d')][_0x34bd('0x39')]()[_0x34bd('0x14')](respondWithResult(_0x53a114,null))[_0x34bd('0x35')](handleError(_0x53a114,null));};exports[_0x34bd('0x3a')]=function(_0x5b061a,_0x4d22ff){var _0x33e8e8={'raw':!![],'where':{}},_0x51f892={},_0x1f3db3;return db[_0x34bd('0x1d')][_0x34bd('0x3b')]({'where':{'id':_0x5b061a['params']['id']}})['then'](handleEntityNotFound(_0x4d22ff,null))['then'](function(_0x5a68f3){if(_0x5a68f3){_0x1f3db3=_0x5a68f3[_0x34bd('0x15')]({'plain':!![]});_0x51f892['model']=_[_0x34bd('0x27')](db['UserFaxQueue'][_0x34bd('0x1e')]);_0x51f892[_0x34bd('0x24')]=_[_0x34bd('0x27')](_0x5b061a[_0x34bd('0x24')]);_0x51f892[_0x34bd('0x28')]=_['intersection'](_0x51f892[_0x34bd('0x26')],_0x51f892[_0x34bd('0x24')]);_0x33e8e8[_0x34bd('0x29')]=_[_0x34bd('0x3c')](_0x51f892[_0x34bd('0x26')],qs['fields'](_0x5b061a[_0x34bd('0x24')][_0x34bd('0x2a')]));_0x33e8e8['attributes']=_0x33e8e8[_0x34bd('0x29')][_0x34bd('0x3d')]?_0x33e8e8['attributes']:_0x51f892['model'];if(!_0x5b061a[_0x34bd('0x24')]['hasOwnProperty']('nolimit')){_0x33e8e8[_0x34bd('0xe')]=qs[_0x34bd('0xe')](_0x5b061a['query']['limit']);_0x33e8e8['offset']=qs['offset'](_0x5b061a[_0x34bd('0x24')][_0x34bd('0xc')]);}_0x33e8e8['order']=qs['sort'](_0x5b061a['query'][_0x34bd('0x3e')]);_0x33e8e8[_0x34bd('0x22')]=qs['filters'](_[_0x34bd('0x3f')](_0x5b061a[_0x34bd('0x24')],_0x51f892[_0x34bd('0x28')]));_0x33e8e8[_0x34bd('0x22')][_0x34bd('0x40')]=_0x5a68f3['id'];if(_0x5b061a[_0x34bd('0x24')]['filter']){_0x33e8e8[_0x34bd('0x22')]=_[_0x34bd('0x2c')](_0x33e8e8[_0x34bd('0x22')],{'$or':_[_0x34bd('0x41')](_0x33e8e8['attributes'],function(_0x1b8b37){var _0x5235e4={};_0x5235e4[_0x1b8b37]={'$like':'%'+_0x5b061a[_0x34bd('0x24')]['filter']+'%'};return _0x5235e4;})});}_0x33e8e8=_[_0x34bd('0x2c')]({},_0x33e8e8,_0x5b061a[_0x34bd('0x2d')]);return db[_0x34bd('0x42')][_0x34bd('0x43')](_0x33e8e8);}})[_0x34bd('0x14')](function(_0x418fa5){if(_0x418fa5){return db[_0x34bd('0x44')][_0x34bd('0x45')]({'where':{'id':_[_0x34bd('0x41')](_0x418fa5,_0x34bd('0x46')),'role':_0x34bd('0x47')},'attributes':['id','name',_0x34bd('0x48'),'updatedAt',_0x34bd('0x49')]});}})['then'](function(_0x3fc297){if(_0x3fc297){return{'count':_0x3fc297['count'],'rows':_[_0x34bd('0x41')](_0x3fc297[_0x34bd('0x25')],function(_0x2da924){return{'membername':_0x2da924[_0x34bd('0x1a')],'UserId':_0x2da924['id'],'queue_name':_0x1f3db3[_0x34bd('0x1a')],'FaxQueueId':_0x1f3db3['id'],'interface':util[_0x34bd('0x4a')](_0x34bd('0x4b'),_0x34bd('0x4c'),_0x2da924[_0x34bd('0x1a')]),'penalty':0x0,'paused':_0x2da924[_0x34bd('0x48')],'createdAt':_0x2da924[_0x34bd('0x49')],'updatedAt':_0x2da924[_0x34bd('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x34bd('0x14')](respondWithFilteredResult(_0x4d22ff,_0x33e8e8))[_0x34bd('0x35')](handleError(_0x4d22ff,null));};exports[_0x34bd('0x4e')]=function(_0x4a0c28,_0x5c5766){var _0x246c52={};var _0x79e6b4={};var _0x352f17;var _0x3e8c8e;return db[_0x34bd('0x1d')]['findOne']({'where':{'id':_0x4a0c28['params']['id']}})['then'](handleEntityNotFound(_0x5c5766,null))['then'](function(_0x24c635){if(_0x24c635){_0x352f17=_0x24c635;_0x79e6b4[_0x34bd('0x26')]=_['keys'](db[_0x34bd('0x4f')][_0x34bd('0x1e')]);_0x79e6b4[_0x34bd('0x24')]=_['keys'](_0x4a0c28[_0x34bd('0x24')]);_0x79e6b4[_0x34bd('0x28')]=_[_0x34bd('0x3c')](_0x79e6b4[_0x34bd('0x26')],_0x79e6b4[_0x34bd('0x24')]);_0x246c52[_0x34bd('0x29')]=_[_0x34bd('0x3c')](_0x79e6b4[_0x34bd('0x26')],qs['fields'](_0x4a0c28['query'][_0x34bd('0x2a')]));_0x246c52['attributes']=_0x246c52[_0x34bd('0x29')][_0x34bd('0x3d')]?_0x246c52[_0x34bd('0x29')]:_0x79e6b4['model'];_0x246c52['order']=qs[_0x34bd('0x3e')](_0x4a0c28[_0x34bd('0x24')][_0x34bd('0x3e')]);_0x246c52['where']=qs['filters'](_[_0x34bd('0x3f')](_0x4a0c28[_0x34bd('0x24')],_0x79e6b4[_0x34bd('0x28')]));if(_0x4a0c28[_0x34bd('0x24')][_0x34bd('0x50')]){_0x246c52[_0x34bd('0x22')]=_[_0x34bd('0x2c')](_0x246c52[_0x34bd('0x22')],{'$or':_[_0x34bd('0x41')](_0x246c52['attributes'],function(_0x4d3118){var _0x3878a0={};_0x3878a0[_0x4d3118]={'$like':'%'+_0x4a0c28['query'][_0x34bd('0x50')]+'%'};return _0x3878a0;})});}_0x246c52=_[_0x34bd('0x2c')]({},_0x246c52,_0x4a0c28[_0x34bd('0x2d')]);return _0x352f17[_0x34bd('0x4e')](_0x246c52);}})['then'](function(_0x50ae2e){if(_0x50ae2e){_0x3e8c8e=_0x50ae2e[_0x34bd('0x3d')];if(!_0x4a0c28[_0x34bd('0x24')][_0x34bd('0x51')]('nolimit')){_0x246c52[_0x34bd('0xe')]=qs['limit'](_0x4a0c28[_0x34bd('0x24')][_0x34bd('0xe')]);_0x246c52[_0x34bd('0xc')]=qs['offset'](_0x4a0c28[_0x34bd('0x24')]['offset']);}return _0x352f17['getTeams'](_0x246c52);}})[_0x34bd('0x14')](function(_0x12ae13){if(_0x12ae13){return _0x12ae13?{'count':_0x3e8c8e,'rows':_0x12ae13}:null;}})[_0x34bd('0x14')](respondWithResult(_0x5c5766,null))['catch'](handleError(_0x5c5766,null));};exports[_0x34bd('0x52')]=function(_0x23ac17,_0xff33cb){var _0x50c5a2=_0x23ac17[_0x34bd('0x37')][_0x34bd('0x53')];return db[_0x34bd('0x4f')][_0x34bd('0x43')]({'where':{'id':_0x50c5a2},'attributes':['id'],'include':[{'model':db[_0x34bd('0x44')],'as':_0x34bd('0x54'),'attributes':['id',_0x34bd('0x1a'),_0x34bd('0x55'),_0x34bd('0x56'),_0x34bd('0x57')],'raw':!![]}]})[_0x34bd('0x14')](function(_0x59e377){if(_0x59e377){var _0x24e164=_['flatMap'](_0x59e377,function(_0x46e98d){var _0x51459d=_0x46e98d[_0x34bd('0x15')]({'plain':!![]});return _0x51459d[_0x34bd('0x54')];});return db[_0x34bd('0x1d')][_0x34bd('0x2e')]({'where':{'id':_0x23ac17[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](function(_0x27adad){return db[_0x34bd('0x58')][_0x34bd('0x59')](function(_0x23f5a6){return _0x27adad['addTeams'](_0x50c5a2,{'transaction':_0x23f5a6})['then'](function(){return BPromise[_0x34bd('0x5a')](_0x24e164,function(_0x31b313){return db[_0x34bd('0x42')]['findOrCreate']({'where':{'UserId':_0x31b313['id'],'FaxQueueId':_0x23ac17['params']['id']},'transaction':_0x23f5a6});});})['then'](function(){_0x24e164[_0x34bd('0x5b')](function(_0x190614){socket[_0x34bd('0x5c')](_0x34bd('0x5d'),{'UserId':_0x190614['id'],'FaxQueueId':_0x27adad['id']});});});});});}})[_0x34bd('0x14')](respondWithStatusCode(_0xff33cb,null))['catch'](handleError(_0xff33cb,null));};exports[_0x34bd('0x5e')]=function(_0x4d94d0,_0x4732f5){return db[_0x34bd('0x4f')]['findAll']({'where':{'id':_0x4d94d0[_0x34bd('0x24')]['ids']},'attributes':['id'],'include':[{'model':db[_0x34bd('0x44')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x34bd('0x14')](handleEntityNotFound(_0x4732f5,null))['then'](function(_0x397396){var _0x38f6f2=_[_0x34bd('0x41')](_0x397396,'id');var _0x35d257=[];var _0x2de8a0=[];var _0x34bb6d=squel[_0x34bd('0x5f')]();_0x34bb6d[_0x34bd('0x60')]('tq.TeamId')[_0x34bd('0x61')](_0x34bd('0x62'),'tq')[_0x34bd('0x63')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x34bd('0x64'),_0x4d94d0[_0x34bd('0x38')]['id']);for(var _0x56935e=0x0;_0x56935e<_0x397396[_0x34bd('0x3d')];_0x56935e+=0x1){let _0x5d0621=_0x397396[_0x56935e];for(var _0x2ccc12=0x0;_0x2ccc12<_0x5d0621[_0x34bd('0x54')][_0x34bd('0x3d')];_0x2ccc12+=0x1){let _0x4c6508=_0x5d0621[_0x34bd('0x54')][_0x2ccc12];var _0x4a05cb=_0x34bb6d[_0x34bd('0x65')]();_0x4a05cb[_0x34bd('0x22')](_0x34bd('0x66'),_0x4c6508['id']);_0x2de8a0[_0x34bd('0x67')](db[_0x34bd('0x58')][_0x34bd('0x24')](_0x4a05cb[_0x34bd('0x68')](),{'type':db[_0x34bd('0x58')][_0x34bd('0x69')][_0x34bd('0x6a')]})[_0x34bd('0x14')](function(_0x23ca28){if(_0x23ca28[_0x34bd('0x3d')]===0x1){return _0x4c6508['id'];}else{var _0x48d9b9=_['every'](_[_0x34bd('0x41')](_0x23ca28,_0x34bd('0x6b')),function(_0x19341e){return _[_0x34bd('0x6c')](_0x38f6f2,_0x19341e);});if(_0x48d9b9){return _0x4c6508['id'];}}}));}}return BPromise[_0x34bd('0x6d')](_0x2de8a0)['then'](function(_0x1799dd){_0x35d257=_(_0x35d257)[_0x34bd('0x6e')](_0x1799dd)[_0x34bd('0x6f')]()[_0x34bd('0x70')]();return db['FaxQueue'][_0x34bd('0x2e')]({'where':{'id':_0x4d94d0['params']['id']}})['then'](function(_0x49ba99){return db['sequelize'][_0x34bd('0x59')](function(_0x1a1111){return _0x49ba99[_0x34bd('0x5e')](_0x4d94d0['query'][_0x34bd('0x53')],{'transaction':_0x1a1111})[_0x34bd('0x14')](function(){if(!_[_0x34bd('0x71')](_0x35d257)){return _0x49ba99[_0x34bd('0x72')](_0x35d257,{'transaction':_0x1a1111});}})[_0x34bd('0x14')](function(){_0x35d257[_0x34bd('0x5b')](function(_0x4624fc){socket[_0x34bd('0x5c')](_0x34bd('0x73'),{'UserId':_0x4624fc,'FaxQueueId':_0x49ba99['id']});});});});});});})[_0x34bd('0x14')](respondWithStatusCode(_0x4732f5,null))[_0x34bd('0x35')](handleError(_0x4732f5,null));};exports['addAgents']=function(_0x5403fa,_0x26620a){return db['FaxQueue'][_0x34bd('0x2e')]({'where':{'id':_0x5403fa[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](handleEntityNotFound(_0x26620a,null))[_0x34bd('0x14')](function(_0x22aa49){if(_0x22aa49){return _0x22aa49[_0x34bd('0x74')](_0x5403fa[_0x34bd('0x37')][_0x34bd('0x53')],_['omit'](_0x5403fa[_0x34bd('0x37')],[_0x34bd('0x53'),'id'])||{})[_0x34bd('0x75')](function(_0x533f32){for(var _0x2b56eb=0x0;_0x2b56eb<_0x5403fa[_0x34bd('0x37')][_0x34bd('0x53')][_0x34bd('0x3d')];_0x2b56eb+=0x1){socket['emit'](_0x34bd('0x5d'),{'UserId':Number(_0x5403fa[_0x34bd('0x37')][_0x34bd('0x53')][_0x2b56eb]),'FaxQueueId':Number(_0x5403fa[_0x34bd('0x38')]['id'])});}return _0x533f32;});}})[_0x34bd('0x14')](respondWithResult(_0x26620a,null))[_0x34bd('0x35')](handleError(_0x26620a,null));};exports[_0x34bd('0x72')]=function(_0x193f37,_0x15651a){return db[_0x34bd('0x1d')]['find']({'where':{'id':_0x193f37[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](handleEntityNotFound(_0x15651a,null))[_0x34bd('0x14')](function(_0x1e9839){if(_0x1e9839){return _0x1e9839[_0x34bd('0x72')](_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')])[_0x34bd('0x14')](function(){if(_[_0x34bd('0x76')](_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')])){for(var _0x1d735f=0x0;_0x1d735f<_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')]['length'];_0x1d735f+=0x1){socket[_0x34bd('0x5c')]('userFaxQueue:remove',{'UserId':Number(_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')][_0x1d735f]),'FaxQueueId':Number(_0x193f37[_0x34bd('0x38')]['id'])});}}else{socket[_0x34bd('0x5c')](_0x34bd('0x73'),{'UserId':Number(_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')]),'FaxQueueId':Number(_0x193f37[_0x34bd('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x15651a,null))[_0x34bd('0x35')](handleError(_0x15651a,null));};exports[_0x34bd('0x77')]=function(_0x3efd93,_0x4d510d){var _0x4519eb={};var _0x58d4b4={};var _0x288b12;var _0x44c6ae;return db['FaxQueue'][_0x34bd('0x3b')]({'where':{'id':_0x3efd93[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](handleEntityNotFound(_0x4d510d,null))[_0x34bd('0x14')](function(_0x2b8917){if(_0x2b8917){_0x288b12=_0x2b8917;_0x58d4b4['model']=_[_0x34bd('0x27')](db['User']['rawAttributes']);_0x58d4b4[_0x34bd('0x24')]=_[_0x34bd('0x27')](_0x3efd93[_0x34bd('0x24')]);_0x58d4b4['filters']=_[_0x34bd('0x3c')](_0x58d4b4['model'],_0x58d4b4[_0x34bd('0x24')]);_0x4519eb[_0x34bd('0x29')]=_['intersection'](_0x58d4b4['model'],qs['fields'](_0x3efd93[_0x34bd('0x24')][_0x34bd('0x2a')]));_0x4519eb['attributes']=_0x4519eb[_0x34bd('0x29')]['length']?_0x4519eb[_0x34bd('0x29')]:_0x58d4b4[_0x34bd('0x26')];_0x4519eb[_0x34bd('0x78')]=qs[_0x34bd('0x3e')](_0x3efd93[_0x34bd('0x24')][_0x34bd('0x3e')]);_0x4519eb[_0x34bd('0x22')]=qs[_0x34bd('0x28')](_['pick'](_0x3efd93[_0x34bd('0x24')],_0x58d4b4[_0x34bd('0x28')]));if(_0x3efd93[_0x34bd('0x24')][_0x34bd('0x50')]){_0x4519eb[_0x34bd('0x22')]=_[_0x34bd('0x2c')](_0x4519eb[_0x34bd('0x22')],{'$or':_[_0x34bd('0x41')](_0x4519eb[_0x34bd('0x29')],function(_0x7cf676){var _0x499703={};_0x499703[_0x7cf676]={'$like':'%'+_0x3efd93[_0x34bd('0x24')]['filter']+'%'};return _0x499703;})});}_0x4519eb=_['merge']({},_0x4519eb,_0x3efd93[_0x34bd('0x2d')]);return _0x288b12[_0x34bd('0x77')](_0x4519eb);}})[_0x34bd('0x14')](function(_0x19671c){if(_0x19671c){_0x44c6ae=_0x19671c['length'];if(!_0x3efd93[_0x34bd('0x24')][_0x34bd('0x51')](_0x34bd('0x79'))){_0x4519eb[_0x34bd('0xe')]=qs['limit'](_0x3efd93['query'][_0x34bd('0xe')]);_0x4519eb[_0x34bd('0xc')]=qs['offset'](_0x3efd93[_0x34bd('0x24')][_0x34bd('0xc')]);}return _0x288b12['getAgents'](_0x4519eb);}})[_0x34bd('0x14')](function(_0x268718){if(_0x268718){return _0x268718?{'count':_0x44c6ae,'rows':_0x268718}:null;}})[_0x34bd('0x14')](respondWithResult(_0x4d510d,null))[_0x34bd('0x35')](handleError(_0x4d510d,null));}; \ No newline at end of file +var _0xeda8=['push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','json','offset','undefined','limit','set','then','destroy','get','FaxQueues','UserProfileResource','status','sendStatus','name','index','map','FaxQueue','type','key','getOptions','where','count','include','query','findAll','catch','show','params','model','keys','filters','intersection','attributes','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','filter','User','UserId','rows','format','%s/%s','SIP','faxPause','updatedAt','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeda8,0x104));var _0x8eda=function(_0x31e870,_0x165958){_0x31e870=_0x31e870-0x0;var _0x545c17=_0xeda8[_0x31e870];return _0x545c17;};'use strict';var BPromise=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var _=require('lodash');var squel=require(_0x8eda('0x2'));var Redis=require(_0x8eda('0x3'));var qs=require(_0x8eda('0x4'));var logger=require(_0x8eda('0x5'))(_0x8eda('0x6'));var config=require(_0x8eda('0x7'));var db=require(_0x8eda('0x8'))['db'];config[_0x8eda('0x9')]=_[_0x8eda('0xa')](config[_0x8eda('0x9')],{'host':_0x8eda('0xb'),'port':0x18eb});var socket=require(_0x8eda('0xc'))(new Redis(config['redis']));require(_0x8eda('0xd'))[_0x8eda('0xe')](socket);function respondWithStatusCode(_0x5aa93d,_0x6b544f){_0x6b544f=_0x6b544f||0xcc;return function(_0x4be9df){if(_0x4be9df){return _0x5aa93d['sendStatus'](_0x6b544f);}return _0x5aa93d['status'](_0x6b544f)['end']();};}function respondWithResult(_0xe69181,_0x2d3739){_0x2d3739=_0x2d3739||0xc8;return function(_0x41442d){if(_0x41442d){return _0xe69181['status'](_0x2d3739)[_0x8eda('0xf')](_0x41442d);}};}function respondWithFilteredResult(_0x5a80ca,_0x3f34c){return function(_0x36689a){if(_0x36689a){var _0x2fdec0=typeof _0x3f34c[_0x8eda('0x10')]===_0x8eda('0x11')&&typeof _0x3f34c[_0x8eda('0x12')]===_0x8eda('0x11');var _0x24ea76=_0x36689a['count'];var _0x500bd4=_0x2fdec0?0x0:_0x3f34c[_0x8eda('0x10')];var _0x223dcf=_0x2fdec0?_0x36689a['count']:_0x3f34c[_0x8eda('0x10')]+_0x3f34c[_0x8eda('0x12')];var _0x123905;if(_0x223dcf>=_0x24ea76){_0x223dcf=_0x24ea76;_0x123905=0xc8;}else{_0x123905=0xce;}_0x5a80ca['status'](_0x123905);return _0x5a80ca[_0x8eda('0x13')]('Content-Range',_0x500bd4+'-'+_0x223dcf+'/'+_0x24ea76)[_0x8eda('0xf')](_0x36689a);}return null;};}function saveUpdates(_0x553382){return function(_0x24aed4){if(_0x24aed4){return _0x24aed4['update'](_0x553382)[_0x8eda('0x14')](function(_0x2a4d2b){return _0x2a4d2b;});}return null;};}function removeEntity(_0x496c77){return function(_0x5e44b7){if(_0x5e44b7){return _0x5e44b7[_0x8eda('0x15')]()[_0x8eda('0x14')](function(){var _0x1b089d=_0x5e44b7[_0x8eda('0x16')]({'plain':!![]});var _0x110f36=_0x8eda('0x17');return db[_0x8eda('0x18')][_0x8eda('0x15')]({'where':{'type':_0x110f36,'resourceId':_0x1b089d['id']}})[_0x8eda('0x14')](function(){return _0x5e44b7;});})[_0x8eda('0x14')](function(){_0x496c77[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33143e){return function(_0x4f8483){if(!_0x4f8483){_0x33143e[_0x8eda('0x1a')](0x194);}return _0x4f8483;};}function handleError(_0x5183bc,_0x1033d6){_0x1033d6=_0x1033d6||0x1f4;return function(_0x2dab25){logger['error'](_0x2dab25['stack']);if(_0x2dab25['name']){delete _0x2dab25[_0x8eda('0x1b')];}_0x5183bc[_0x8eda('0x19')](_0x1033d6)['send'](_0x2dab25);};}exports[_0x8eda('0x1c')]=function(_0x37a8ab,_0x54aa7f){var _0x25e955={};var _0xfa57ca={'count':0x0,'rows':[]};var _0x24b1e1=_[_0x8eda('0x1d')](db[_0x8eda('0x1e')]['rawAttributes'],function(_0x41b5a9){return{'name':_0x41b5a9['fieldName'],'type':_0x41b5a9[_0x8eda('0x1f')][_0x8eda('0x20')]};});_0x25e955=qs[_0x8eda('0x21')](_0x24b1e1,_0x37a8ab);var _0x567f69={'where':_0x25e955[_0x8eda('0x22')]};return db[_0x8eda('0x1e')][_0x8eda('0x23')](_0x567f69)['then'](function(_0x1616ea){_0xfa57ca[_0x8eda('0x23')]=_0x1616ea;_0x25e955['include']=qs[_0x8eda('0x24')](_0x37a8ab[_0x8eda('0x25')]);return db[_0x8eda('0x1e')][_0x8eda('0x26')](_0x25e955);})['then'](function(_0x58dd55){_0xfa57ca['rows']=_0x58dd55;return _0xfa57ca;})[_0x8eda('0x14')](respondWithFilteredResult(_0x54aa7f,_0x25e955))[_0x8eda('0x27')](handleError(_0x54aa7f,null));};exports[_0x8eda('0x28')]=function(_0x540690,_0x4a9ee2){var _0x5b45c1={'raw':!![],'where':{'id':_0x540690[_0x8eda('0x29')]['id']}},_0x244da0={};_0x244da0[_0x8eda('0x2a')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x244da0[_0x8eda('0x25')]=_[_0x8eda('0x2b')](_0x540690[_0x8eda('0x25')]);_0x244da0[_0x8eda('0x2c')]=_[_0x8eda('0x2d')](_0x244da0[_0x8eda('0x2a')],_0x244da0[_0x8eda('0x25')]);_0x5b45c1[_0x8eda('0x2e')]=_[_0x8eda('0x2d')](_0x244da0[_0x8eda('0x2a')],qs[_0x8eda('0x2f')](_0x540690[_0x8eda('0x25')][_0x8eda('0x2f')]));_0x5b45c1[_0x8eda('0x2e')]=_0x5b45c1['attributes'][_0x8eda('0x30')]?_0x5b45c1[_0x8eda('0x2e')]:_0x244da0[_0x8eda('0x2a')];if(_0x540690['query']['includeAll']){_0x5b45c1[_0x8eda('0x24')]=[{'all':!![]}];}_0x5b45c1=_[_0x8eda('0x31')]({},_0x5b45c1,_0x540690[_0x8eda('0x32')]);return db[_0x8eda('0x1e')]['find'](_0x5b45c1)[_0x8eda('0x14')](handleEntityNotFound(_0x4a9ee2,null))[_0x8eda('0x14')](respondWithResult(_0x4a9ee2,null))[_0x8eda('0x27')](handleError(_0x4a9ee2,null));};exports[_0x8eda('0x33')]=function(_0x567aa6,_0x29a706){return db['FaxQueue'][_0x8eda('0x33')](_0x567aa6[_0x8eda('0x34')],{})[_0x8eda('0x14')](function(_0x3b6585){var _0x261e12=_0x567aa6[_0x8eda('0x35')]['get']({'plain':!![]});if(!_0x261e12)throw new Error(_0x8eda('0x36'));if(_0x261e12[_0x8eda('0x37')]===_0x8eda('0x35')){var _0x3b8527=_0x3b6585[_0x8eda('0x16')]({'plain':!![]});var _0x5cf565=_0x8eda('0x17');return db[_0x8eda('0x38')][_0x8eda('0x39')]({'where':{'name':_0x5cf565,'userProfileId':_0x261e12['userProfileId']},'raw':!![]})[_0x8eda('0x14')](function(_0x5d361e){if(_0x5d361e&&_0x5d361e[_0x8eda('0x3a')]===0x0){return db[_0x8eda('0x18')][_0x8eda('0x33')]({'name':_0x3b8527[_0x8eda('0x1b')],'resourceId':_0x3b8527['id'],'type':_0x5d361e[_0x8eda('0x1b')],'sectionId':_0x5d361e['id']},{})['then'](function(){return _0x3b6585;});}else{return _0x3b6585;}})['catch'](function(_0xbf14a1){logger[_0x8eda('0x3b')](_0x8eda('0x3c'),_0xbf14a1);throw _0xbf14a1;});}return _0x3b6585;})[_0x8eda('0x14')](respondWithResult(_0x29a706,0xc9))[_0x8eda('0x27')](handleError(_0x29a706,null));};exports[_0x8eda('0x3d')]=function(_0x18b043,_0xcb6164){if(_0x18b043[_0x8eda('0x34')]['id']){delete _0x18b043[_0x8eda('0x34')]['id'];}return db[_0x8eda('0x1e')][_0x8eda('0x39')]({'where':{'id':_0x18b043[_0x8eda('0x29')]['id']}})[_0x8eda('0x14')](handleEntityNotFound(_0xcb6164,null))[_0x8eda('0x14')](saveUpdates(_0x18b043[_0x8eda('0x34')],null))[_0x8eda('0x14')](respondWithResult(_0xcb6164,null))[_0x8eda('0x27')](handleError(_0xcb6164,null));};exports[_0x8eda('0x15')]=function(_0x55eb65,_0x3711f8){return db[_0x8eda('0x1e')]['find']({'where':{'id':_0x55eb65[_0x8eda('0x29')]['id']}})[_0x8eda('0x14')](handleEntityNotFound(_0x3711f8,null))['then'](removeEntity(_0x3711f8,null))[_0x8eda('0x27')](handleError(_0x3711f8,null));};exports[_0x8eda('0x3e')]=function(_0x51f2a3,_0x307aae){return db[_0x8eda('0x1e')][_0x8eda('0x3e')]()['then'](respondWithResult(_0x307aae,null))[_0x8eda('0x27')](handleError(_0x307aae,null));};exports[_0x8eda('0x3f')]=function(_0x3996b7,_0xd8b8f4){var _0x1fb1a8={'raw':!![],'where':{}},_0x36770a={},_0x2ce641;return db['FaxQueue'][_0x8eda('0x40')]({'where':{'id':_0x3996b7['params']['id']}})[_0x8eda('0x14')](handleEntityNotFound(_0xd8b8f4,null))['then'](function(_0x1a64e8){if(_0x1a64e8){_0x2ce641=_0x1a64e8['get']({'plain':!![]});_0x36770a[_0x8eda('0x2a')]=_['keys'](db[_0x8eda('0x41')][_0x8eda('0x42')]);_0x36770a[_0x8eda('0x25')]=_[_0x8eda('0x2b')](_0x3996b7[_0x8eda('0x25')]);_0x36770a[_0x8eda('0x2c')]=_[_0x8eda('0x2d')](_0x36770a[_0x8eda('0x2a')],_0x36770a[_0x8eda('0x25')]);_0x1fb1a8[_0x8eda('0x2e')]=_[_0x8eda('0x2d')](_0x36770a[_0x8eda('0x2a')],qs['fields'](_0x3996b7[_0x8eda('0x25')][_0x8eda('0x2f')]));_0x1fb1a8[_0x8eda('0x2e')]=_0x1fb1a8[_0x8eda('0x2e')][_0x8eda('0x30')]?_0x1fb1a8[_0x8eda('0x2e')]:_0x36770a[_0x8eda('0x2a')];if(!_0x3996b7[_0x8eda('0x25')][_0x8eda('0x43')](_0x8eda('0x44'))){_0x1fb1a8[_0x8eda('0x12')]=qs[_0x8eda('0x12')](_0x3996b7[_0x8eda('0x25')][_0x8eda('0x12')]);_0x1fb1a8[_0x8eda('0x10')]=qs['offset'](_0x3996b7[_0x8eda('0x25')][_0x8eda('0x10')]);}_0x1fb1a8[_0x8eda('0x45')]=qs[_0x8eda('0x46')](_0x3996b7[_0x8eda('0x25')][_0x8eda('0x46')]);_0x1fb1a8['where']=qs[_0x8eda('0x2c')](_[_0x8eda('0x47')](_0x3996b7[_0x8eda('0x25')],_0x36770a['filters']));_0x1fb1a8[_0x8eda('0x22')]['FaxQueueId']=_0x1a64e8['id'];if(_0x3996b7[_0x8eda('0x25')][_0x8eda('0x48')]){_0x1fb1a8[_0x8eda('0x22')]=_['merge'](_0x1fb1a8[_0x8eda('0x22')],{'$or':_[_0x8eda('0x1d')](_0x1fb1a8[_0x8eda('0x2e')],function(_0x4ce70c){var _0x3d6378={};_0x3d6378[_0x4ce70c]={'$like':'%'+_0x3996b7[_0x8eda('0x25')][_0x8eda('0x48')]+'%'};return _0x3d6378;})});}_0x1fb1a8=_[_0x8eda('0x31')]({},_0x1fb1a8,_0x3996b7[_0x8eda('0x32')]);return db[_0x8eda('0x41')][_0x8eda('0x26')](_0x1fb1a8);}})[_0x8eda('0x14')](function(_0x3f1ca6){if(_0x3f1ca6){return db[_0x8eda('0x49')]['findAndCountAll']({'where':{'id':_[_0x8eda('0x1d')](_0x3f1ca6,_0x8eda('0x4a')),'role':'agent'},'attributes':['id',_0x8eda('0x1b'),'faxPause','updatedAt','createdAt']});}})['then'](function(_0x4b24e1){if(_0x4b24e1){return{'count':_0x4b24e1[_0x8eda('0x23')],'rows':_['map'](_0x4b24e1[_0x8eda('0x4b')],function(_0x1d2b58){return{'membername':_0x1d2b58[_0x8eda('0x1b')],'UserId':_0x1d2b58['id'],'queue_name':_0x2ce641[_0x8eda('0x1b')],'FaxQueueId':_0x2ce641['id'],'interface':util[_0x8eda('0x4c')](_0x8eda('0x4d'),_0x8eda('0x4e'),_0x1d2b58['name']),'penalty':0x0,'paused':_0x1d2b58[_0x8eda('0x4f')],'createdAt':_0x1d2b58['createdAt'],'updatedAt':_0x1d2b58[_0x8eda('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xd8b8f4,_0x1fb1a8))[_0x8eda('0x27')](handleError(_0xd8b8f4,null));};exports['getTeams']=function(_0x31b5ba,_0x147942){var _0x2699f5={};var _0x48a66d={};var _0x589fbe;var _0x55d642;return db[_0x8eda('0x1e')][_0x8eda('0x40')]({'where':{'id':_0x31b5ba['params']['id']}})[_0x8eda('0x14')](handleEntityNotFound(_0x147942,null))['then'](function(_0x52bb01){if(_0x52bb01){_0x589fbe=_0x52bb01;_0x48a66d[_0x8eda('0x2a')]=_[_0x8eda('0x2b')](db[_0x8eda('0x51')][_0x8eda('0x42')]);_0x48a66d['query']=_['keys'](_0x31b5ba[_0x8eda('0x25')]);_0x48a66d[_0x8eda('0x2c')]=_[_0x8eda('0x2d')](_0x48a66d[_0x8eda('0x2a')],_0x48a66d['query']);_0x2699f5[_0x8eda('0x2e')]=_['intersection'](_0x48a66d[_0x8eda('0x2a')],qs['fields'](_0x31b5ba[_0x8eda('0x25')]['fields']));_0x2699f5[_0x8eda('0x2e')]=_0x2699f5[_0x8eda('0x2e')][_0x8eda('0x30')]?_0x2699f5[_0x8eda('0x2e')]:_0x48a66d[_0x8eda('0x2a')];_0x2699f5[_0x8eda('0x45')]=qs[_0x8eda('0x46')](_0x31b5ba[_0x8eda('0x25')][_0x8eda('0x46')]);_0x2699f5['where']=qs['filters'](_[_0x8eda('0x47')](_0x31b5ba['query'],_0x48a66d[_0x8eda('0x2c')]));if(_0x31b5ba[_0x8eda('0x25')][_0x8eda('0x48')]){_0x2699f5[_0x8eda('0x22')]=_[_0x8eda('0x31')](_0x2699f5['where'],{'$or':_['map'](_0x2699f5[_0x8eda('0x2e')],function(_0x1ad3e1){var _0x423df5={};_0x423df5[_0x1ad3e1]={'$like':'%'+_0x31b5ba[_0x8eda('0x25')][_0x8eda('0x48')]+'%'};return _0x423df5;})});}_0x2699f5=_[_0x8eda('0x31')]({},_0x2699f5,_0x31b5ba[_0x8eda('0x32')]);return _0x589fbe['getTeams'](_0x2699f5);}})[_0x8eda('0x14')](function(_0x4dabf6){if(_0x4dabf6){_0x55d642=_0x4dabf6['length'];if(!_0x31b5ba[_0x8eda('0x25')]['hasOwnProperty']('nolimit')){_0x2699f5['limit']=qs['limit'](_0x31b5ba[_0x8eda('0x25')][_0x8eda('0x12')]);_0x2699f5[_0x8eda('0x10')]=qs[_0x8eda('0x10')](_0x31b5ba[_0x8eda('0x25')][_0x8eda('0x10')]);}return _0x589fbe['getTeams'](_0x2699f5);}})[_0x8eda('0x14')](function(_0x2ec7c1){if(_0x2ec7c1){return _0x2ec7c1?{'count':_0x55d642,'rows':_0x2ec7c1}:null;}})[_0x8eda('0x14')](respondWithResult(_0x147942,null))[_0x8eda('0x27')](handleError(_0x147942,null));};exports['addTeams']=function(_0x3d7746,_0x16e3fd){var _0x235246=_0x3d7746[_0x8eda('0x34')][_0x8eda('0x52')];return db[_0x8eda('0x51')]['findAll']({'where':{'id':_0x235246},'attributes':['id'],'include':[{'model':db[_0x8eda('0x49')],'as':_0x8eda('0x53'),'attributes':['id',_0x8eda('0x1b'),_0x8eda('0x54'),_0x8eda('0x55'),_0x8eda('0x56')],'raw':!![]}]})[_0x8eda('0x14')](function(_0x3f3ec5){if(_0x3f3ec5){var _0x3119bc=_[_0x8eda('0x57')](_0x3f3ec5,function(_0x2bdceb){var _0xd84c42=_0x2bdceb[_0x8eda('0x16')]({'plain':!![]});return _0xd84c42[_0x8eda('0x53')];});return db['FaxQueue']['find']({'where':{'id':_0x3d7746[_0x8eda('0x29')]['id']}})[_0x8eda('0x14')](function(_0x1b43c0){return db[_0x8eda('0x58')]['transaction'](function(_0x23d64f){return _0x1b43c0[_0x8eda('0x59')](_0x235246,{'transaction':_0x23d64f})['then'](function(){return BPromise[_0x8eda('0x5a')](_0x3119bc,function(_0x5f0d26){return db[_0x8eda('0x41')][_0x8eda('0x5b')]({'where':{'UserId':_0x5f0d26['id'],'FaxQueueId':_0x3d7746[_0x8eda('0x29')]['id']},'transaction':_0x23d64f});});})['then'](function(){_0x3119bc[_0x8eda('0x5c')](function(_0x3f289c){socket[_0x8eda('0x5d')]('userFaxQueue:save',{'UserId':_0x3f289c['id'],'FaxQueueId':_0x1b43c0['id']});});});});});}})[_0x8eda('0x14')](respondWithStatusCode(_0x16e3fd,null))[_0x8eda('0x27')](handleError(_0x16e3fd,null));};exports[_0x8eda('0x5e')]=function(_0x2f30af,_0x4d7bca){return db['Team'][_0x8eda('0x26')]({'where':{'id':_0x2f30af[_0x8eda('0x25')][_0x8eda('0x52')]},'attributes':['id'],'include':[{'model':db[_0x8eda('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8eda('0x14')](handleEntityNotFound(_0x4d7bca,null))[_0x8eda('0x14')](function(_0x1aca01){var _0x42e6aa=_[_0x8eda('0x1d')](_0x1aca01,'id');var _0x4fb714=[];var _0x2cec88=[];var _0x1a32dd=squel[_0x8eda('0x5f')]();_0x1a32dd['field']('tq.TeamId')['from'](_0x8eda('0x60'),'tq')[_0x8eda('0x61')](_0x8eda('0x62'),'ut',_0x8eda('0x63'))[_0x8eda('0x22')](_0x8eda('0x64'),_0x2f30af[_0x8eda('0x29')]['id']);for(var _0x3f700a=0x0;_0x3f700a<_0x1aca01['length'];_0x3f700a+=0x1){let _0x1bbe8b=_0x1aca01[_0x3f700a];for(var _0x437c6f=0x0;_0x437c6f<_0x1bbe8b[_0x8eda('0x53')]['length'];_0x437c6f+=0x1){let _0x327c83=_0x1bbe8b[_0x8eda('0x53')][_0x437c6f];var _0x3095bd=_0x1a32dd[_0x8eda('0x65')]();_0x3095bd[_0x8eda('0x22')](_0x8eda('0x66'),_0x327c83['id']);_0x2cec88[_0x8eda('0x67')](db[_0x8eda('0x58')][_0x8eda('0x25')](_0x3095bd[_0x8eda('0x68')](),{'type':db[_0x8eda('0x58')]['QueryTypes'][_0x8eda('0x69')]})[_0x8eda('0x14')](function(_0xaf5c4a){if(_0xaf5c4a[_0x8eda('0x30')]===0x1){return _0x327c83['id'];}else{var _0x258c51=_[_0x8eda('0x6a')](_[_0x8eda('0x1d')](_0xaf5c4a,_0x8eda('0x6b')),function(_0x177e66){return _[_0x8eda('0x6c')](_0x42e6aa,_0x177e66);});if(_0x258c51){return _0x327c83['id'];}}}));}}return BPromise[_0x8eda('0x6d')](_0x2cec88)['then'](function(_0x513b25){_0x4fb714=_(_0x4fb714)['union'](_0x513b25)[_0x8eda('0x6e')]()[_0x8eda('0x6f')]();return db['FaxQueue'][_0x8eda('0x39')]({'where':{'id':_0x2f30af[_0x8eda('0x29')]['id']}})[_0x8eda('0x14')](function(_0x4d6bb4){return db[_0x8eda('0x58')]['transaction'](function(_0x4434c6){return _0x4d6bb4['removeTeams'](_0x2f30af[_0x8eda('0x25')][_0x8eda('0x52')],{'transaction':_0x4434c6})['then'](function(){if(!_[_0x8eda('0x70')](_0x4fb714)){return _0x4d6bb4[_0x8eda('0x71')](_0x4fb714,{'transaction':_0x4434c6});}})[_0x8eda('0x14')](function(){_0x4fb714[_0x8eda('0x5c')](function(_0x128cbd){socket[_0x8eda('0x5d')](_0x8eda('0x72'),{'UserId':_0x128cbd,'FaxQueueId':_0x4d6bb4['id']});});});});});});})[_0x8eda('0x14')](respondWithStatusCode(_0x4d7bca,null))[_0x8eda('0x27')](handleError(_0x4d7bca,null));};exports[_0x8eda('0x73')]=function(_0x5566f2,_0x5e7f48){return db['FaxQueue']['find']({'where':{'id':_0x5566f2[_0x8eda('0x29')]['id']}})[_0x8eda('0x14')](handleEntityNotFound(_0x5e7f48,null))[_0x8eda('0x14')](function(_0x599757){if(_0x599757){return _0x599757[_0x8eda('0x73')](_0x5566f2[_0x8eda('0x34')][_0x8eda('0x52')],_[_0x8eda('0x74')](_0x5566f2[_0x8eda('0x34')],[_0x8eda('0x52'),'id'])||{})[_0x8eda('0x75')](function(_0x2402ac){for(var _0x48ff62=0x0;_0x48ff62<_0x5566f2['body'][_0x8eda('0x52')][_0x8eda('0x30')];_0x48ff62+=0x1){socket['emit'](_0x8eda('0x76'),{'UserId':Number(_0x5566f2[_0x8eda('0x34')][_0x8eda('0x52')][_0x48ff62]),'FaxQueueId':Number(_0x5566f2['params']['id'])});}return _0x2402ac;});}})[_0x8eda('0x14')](respondWithResult(_0x5e7f48,null))[_0x8eda('0x27')](handleError(_0x5e7f48,null));};exports[_0x8eda('0x71')]=function(_0x1838b1,_0x1edd9f){return db[_0x8eda('0x1e')][_0x8eda('0x39')]({'where':{'id':_0x1838b1['params']['id']}})[_0x8eda('0x14')](handleEntityNotFound(_0x1edd9f,null))[_0x8eda('0x14')](function(_0x4cb4e6){if(_0x4cb4e6){return _0x4cb4e6['removeAgents'](_0x1838b1['query'][_0x8eda('0x52')])[_0x8eda('0x14')](function(){if(_[_0x8eda('0x77')](_0x1838b1[_0x8eda('0x25')][_0x8eda('0x52')])){for(var _0x1ebc2b=0x0;_0x1ebc2b<_0x1838b1[_0x8eda('0x25')][_0x8eda('0x52')][_0x8eda('0x30')];_0x1ebc2b+=0x1){socket[_0x8eda('0x5d')](_0x8eda('0x72'),{'UserId':Number(_0x1838b1[_0x8eda('0x25')][_0x8eda('0x52')][_0x1ebc2b]),'FaxQueueId':Number(_0x1838b1[_0x8eda('0x29')]['id'])});}}else{socket['emit'](_0x8eda('0x72'),{'UserId':Number(_0x1838b1[_0x8eda('0x25')][_0x8eda('0x52')]),'FaxQueueId':Number(_0x1838b1[_0x8eda('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x1edd9f,null))[_0x8eda('0x27')](handleError(_0x1edd9f,null));};exports[_0x8eda('0x78')]=function(_0x232df2,_0x2596eb){var _0x4732be={};var _0x59690b={};var _0x447936;var _0x2222bb;return db[_0x8eda('0x1e')][_0x8eda('0x40')]({'where':{'id':_0x232df2['params']['id']}})['then'](handleEntityNotFound(_0x2596eb,null))[_0x8eda('0x14')](function(_0x22a4cd){if(_0x22a4cd){_0x447936=_0x22a4cd;_0x59690b[_0x8eda('0x2a')]=_[_0x8eda('0x2b')](db['User'][_0x8eda('0x42')]);_0x59690b[_0x8eda('0x25')]=_[_0x8eda('0x2b')](_0x232df2[_0x8eda('0x25')]);_0x59690b[_0x8eda('0x2c')]=_[_0x8eda('0x2d')](_0x59690b[_0x8eda('0x2a')],_0x59690b[_0x8eda('0x25')]);_0x4732be['attributes']=_[_0x8eda('0x2d')](_0x59690b[_0x8eda('0x2a')],qs[_0x8eda('0x2f')](_0x232df2[_0x8eda('0x25')][_0x8eda('0x2f')]));_0x4732be[_0x8eda('0x2e')]=_0x4732be[_0x8eda('0x2e')][_0x8eda('0x30')]?_0x4732be[_0x8eda('0x2e')]:_0x59690b[_0x8eda('0x2a')];_0x4732be['order']=qs[_0x8eda('0x46')](_0x232df2[_0x8eda('0x25')][_0x8eda('0x46')]);_0x4732be['where']=qs[_0x8eda('0x2c')](_['pick'](_0x232df2['query'],_0x59690b['filters']));if(_0x232df2[_0x8eda('0x25')][_0x8eda('0x48')]){_0x4732be['where']=_[_0x8eda('0x31')](_0x4732be[_0x8eda('0x22')],{'$or':_['map'](_0x4732be[_0x8eda('0x2e')],function(_0x16860f){var _0x5c6183={};_0x5c6183[_0x16860f]={'$like':'%'+_0x232df2['query'][_0x8eda('0x48')]+'%'};return _0x5c6183;})});}_0x4732be=_['merge']({},_0x4732be,_0x232df2['options']);return _0x447936[_0x8eda('0x78')](_0x4732be);}})[_0x8eda('0x14')](function(_0x53bda5){if(_0x53bda5){_0x2222bb=_0x53bda5[_0x8eda('0x30')];if(!_0x232df2[_0x8eda('0x25')][_0x8eda('0x43')]('nolimit')){_0x4732be['limit']=qs[_0x8eda('0x12')](_0x232df2['query']['limit']);_0x4732be['offset']=qs[_0x8eda('0x10')](_0x232df2['query'][_0x8eda('0x10')]);}return _0x447936[_0x8eda('0x78')](_0x4732be);}})[_0x8eda('0x14')](function(_0x14ad01){if(_0x14ad01){return _0x14ad01?{'count':_0x2222bb,'rows':_0x14ad01}:null;}})[_0x8eda('0x14')](respondWithResult(_0x2596eb,null))[_0x8eda('0x27')](handleError(_0x2596eb,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 7b1fb92..2dcc41e 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 _0x0242=['save','update','remove','emit','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0242,0xcc));var _0x2024=function(_0x313927,_0x2b3a6d){_0x313927=_0x313927-0x0;var _0x545b28=_0x0242[_0x313927];return _0x545b28;};'use strict';var EventEmitter=require(_0x2024('0x0'));var FaxQueue=require(_0x2024('0x1'))['db'][_0x2024('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2024('0x3')](0x0);var events={'afterCreate':_0x2024('0x4'),'afterUpdate':_0x2024('0x5'),'afterDestroy':_0x2024('0x6')};function emitEvent(_0x2d11dd){return function(_0x423959,_0x1b3afc,_0x1e2bb8){FaxQueueEvents[_0x2024('0x7')](_0x2d11dd+':'+_0x423959['id'],_0x423959);FaxQueueEvents[_0x2024('0x7')](_0x2d11dd,_0x423959);_0x1e2bb8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xf558=['remove','emit','hasOwnProperty','hook','exports','events','FaxQueue','save','update'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xf558,0x7a));var _0x8f55=function(_0x2d1c7c,_0x2c6379){_0x2d1c7c=_0x2d1c7c-0x0;var _0x53fcae=_0xf558[_0x2d1c7c];return _0x53fcae;};'use strict';var EventEmitter=require(_0x8f55('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x8f55('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8f55('0x2'),'afterUpdate':_0x8f55('0x3'),'afterDestroy':_0x8f55('0x4')};function emitEvent(_0x4bf9cb){return function(_0x4adc11,_0x26e2bf,_0x17bd83){FaxQueueEvents[_0x8f55('0x5')](_0x4bf9cb+':'+_0x4adc11['id'],_0x4adc11);FaxQueueEvents[_0x8f55('0x5')](_0x4bf9cb,_0x4adc11);_0x17bd83(null);};}for(var e in events){if(events[_0x8f55('0x6')](e)){var event=events[e];FaxQueue[_0x8f55('0x7')](e,emitEvent(event));}}module[_0x8f55('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 48a9145..0f37f56 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 _0xa993=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','util','api','moment','bluebird','request-promise'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0xa993,0x16d));var _0x3a99=function(_0x15d56d,_0xfab3d7){_0x15d56d=_0x15d56d-0x0;var _0x5e78d8=_0xa993[_0x15d56d];return _0x5e78d8;};'use strict';var _=require('lodash');var util=require(_0x3a99('0x0'));var logger=require('../../config/logger')(_0x3a99('0x1'));var moment=require(_0x3a99('0x2'));var BPromise=require(_0x3a99('0x3'));var rp=require(_0x3a99('0x4'));var fs=require('fs');var path=require(_0x3a99('0x5'));var rimraf=require(_0x3a99('0x6'));var config=require(_0x3a99('0x7'));var attributes=require(_0x3a99('0x8'));module[_0x3a99('0x9')]=function(_0x4e3057,_0x2380f4){return _0x4e3057['define']('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bca=['../../config/logger','api','moment','bluebird','path','rimraf','lodash'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0bca,0x19c));var _0xa0bc=function(_0x1d8f95,_0xcd1d0e){_0x1d8f95=_0x1d8f95-0x0;var _0x4cb618=_0x0bca[_0x1d8f95];return _0x4cb618;};'use strict';var _=require(_0xa0bc('0x0'));var util=require('util');var logger=require(_0xa0bc('0x1'))(_0xa0bc('0x2'));var moment=require(_0xa0bc('0x3'));var BPromise=require(_0xa0bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0bc('0x5'));var rimraf=require(_0xa0bc('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module['exports']=function(_0x4e68d8,_0x3f196b){return _0x4e68d8['define']('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 7a8f3d7..97c24da 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 _0xc8fe=['findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','debug','FaxQueue','find','ShowFaxQueue','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','register','request','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc8fe,0x180));var _0xec8f=function(_0x33ee3b,_0x4fbfec){_0x33ee3b=_0x33ee3b-0x0;var _0x4b07a9=_0xc8fe[_0x33ee3b];return _0x4b07a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xec8f('0x0'));var rs=require(_0xec8f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec8f('0x2'))['db'];var utils=require(_0xec8f('0x3'));var logger=require(_0xec8f('0x4'))(_0xec8f('0x5'));var config=require(_0xec8f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xec8f('0x7')][_0xec8f('0x8')]({'port':0x232a});config[_0xec8f('0x9')]=_[_0xec8f('0xa')](config[_0xec8f('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xec8f('0xb')](socket);function respondWithRpcPromise(_0x19c96c,_0x4f1e17,_0x4d2496){return new BPromise(function(_0x308aaf,_0x37a12d){return client[_0xec8f('0xc')](_0x19c96c,_0x4d2496)[_0xec8f('0xd')](function(_0x47f889){logger[_0xec8f('0xe')](_0xec8f('0xf'),_0x4f1e17,'request\x20sent');logger['debug'](_0xec8f('0x10'),_0x4f1e17,_0xec8f('0x11'),JSON[_0xec8f('0x12')](_0x47f889));if(_0x47f889[_0xec8f('0x13')]){if(_0x47f889[_0xec8f('0x13')]['code']===0x1f4){logger[_0xec8f('0x13')](_0xec8f('0xf'),_0x4f1e17,_0x47f889[_0xec8f('0x13')][_0xec8f('0x14')]);return _0x37a12d(_0x47f889[_0xec8f('0x13')][_0xec8f('0x14')]);}logger['error'](_0xec8f('0xf'),_0x4f1e17,_0x47f889[_0xec8f('0x13')][_0xec8f('0x14')]);return _0x308aaf(_0x47f889[_0xec8f('0x13')]['message']);}else{logger[_0xec8f('0xe')](_0xec8f('0xf'),_0x4f1e17,_0xec8f('0x11'));_0x308aaf(_0x47f889[_0xec8f('0x15')][_0xec8f('0x14')]);}})[_0xec8f('0x16')](function(_0x120193){logger['error'](_0xec8f('0xf'),_0x4f1e17,_0x120193);_0x37a12d(_0x120193);});});}exports['GetFaxQueue']=function(_0x438147){var _0x3cb48c=this;return new Promise(function(_0x245d02,_0x409a22){return db['FaxQueue'][_0xec8f('0x17')]({'raw':_0x438147[_0xec8f('0x18')]?_0x438147[_0xec8f('0x18')][_0xec8f('0x19')]===undefined?!![]:![]:!![],'where':_0x438147['options']?_0x438147[_0xec8f('0x18')][_0xec8f('0x1a')]||null:null,'attributes':_0x438147['options']?_0x438147[_0xec8f('0x18')][_0xec8f('0x1b')]||null:null,'limit':_0x438147[_0xec8f('0x18')]?_0x438147[_0xec8f('0x18')][_0xec8f('0x1c')]||null:null,'include':_0x438147[_0xec8f('0x18')]?_0x438147[_0xec8f('0x18')][_0xec8f('0x1d')]?_['map'](_0x438147[_0xec8f('0x18')]['include'],function(_0x3d40a3){return{'model':db[_0x3d40a3['model']],'as':_0x3d40a3['as'],'attributes':_0x3d40a3[_0xec8f('0x1b')],'include':_0x3d40a3['include']?_[_0xec8f('0x1e')](_0x3d40a3['include'],function(_0x461099){return{'model':db[_0x461099[_0xec8f('0x1f')]],'as':_0x461099['as'],'attributes':_0x461099[_0xec8f('0x1b')],'include':_0x461099[_0xec8f('0x1d')]?_[_0xec8f('0x1e')](_0x461099[_0xec8f('0x1d')],function(_0x33ee18){return{'model':db[_0x33ee18[_0xec8f('0x1f')]],'as':_0x33ee18['as'],'attributes':_0x33ee18[_0xec8f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xec8f('0xd')](function(_0x72645c){logger['info'](_0xec8f('0x20'),_0x438147);logger[_0xec8f('0x21')]('GetFaxQueue',_0x438147,JSON[_0xec8f('0x12')](_0x72645c));_0x245d02(_0x72645c);})[_0xec8f('0x16')](function(_0x51f8ee){logger[_0xec8f('0x13')]('GetFaxQueue',_0x51f8ee[_0xec8f('0x14')],_0x438147);_0x409a22(_0x3cb48c[_0xec8f('0x13')](0x1f4,_0x51f8ee[_0xec8f('0x14')]));});});};exports['ShowFaxQueue']=function(_0x15839a){var _0x16179b=this;return new Promise(function(_0x221756,_0x3c19ac){return db[_0xec8f('0x22')][_0xec8f('0x23')]({'raw':_0x15839a[_0xec8f('0x18')]?_0x15839a[_0xec8f('0x18')][_0xec8f('0x19')]===undefined?!![]:![]:!![],'where':_0x15839a['options']?_0x15839a[_0xec8f('0x18')][_0xec8f('0x1a')]||null:null,'attributes':_0x15839a[_0xec8f('0x18')]?_0x15839a[_0xec8f('0x18')][_0xec8f('0x1b')]||null:null,'include':_0x15839a['options']?_0x15839a['options']['include']?_[_0xec8f('0x1e')](_0x15839a['options'][_0xec8f('0x1d')],function(_0x42b76a){return{'model':db[_0x42b76a[_0xec8f('0x1f')]],'as':_0x42b76a['as'],'attributes':_0x42b76a[_0xec8f('0x1b')],'include':_0x42b76a['include']?_['map'](_0x42b76a['include'],function(_0x32dd91){return{'model':db[_0x32dd91['model']],'as':_0x32dd91['as'],'attributes':_0x32dd91[_0xec8f('0x1b')],'include':_0x32dd91[_0xec8f('0x1d')]?_['map'](_0x32dd91[_0xec8f('0x1d')],function(_0x54c740){return{'model':db[_0x54c740[_0xec8f('0x1f')]],'as':_0x54c740['as'],'attributes':_0x54c740['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ee273){logger[_0xec8f('0xe')]('ShowFaxQueue',_0x15839a);logger['debug'](_0xec8f('0x24'),_0x15839a,JSON[_0xec8f('0x12')](_0x2ee273));_0x221756(_0x2ee273);})['catch'](function(_0x3733ba){logger[_0xec8f('0x13')]('ShowFaxQueue',_0x3733ba[_0xec8f('0x14')],_0x15839a);_0x3c19ac(_0x16179b[_0xec8f('0x13')](0x1f4,_0x3733ba[_0xec8f('0x14')]));});});}; \ No newline at end of file +var _0x51ae=['map','model','ShowFaxQueue','find','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','include'];(function(_0x366195,_0x50da84){var _0xf37646=function(_0x53a253){while(--_0x53a253){_0x366195['push'](_0x366195['shift']());}};_0xf37646(++_0x50da84);}(_0x51ae,0x1cc));var _0xe51a=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x51ae[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0xe51a('0x0'));var util=require('util');var moment=require(_0xe51a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe51a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe51a('0x3'));var logger=require(_0xe51a('0x4'))(_0xe51a('0x5'));var config=require(_0xe51a('0x6'));var jayson=require(_0xe51a('0x7'));var client=jayson['client'][_0xe51a('0x8')]({'port':0x232a});config['redis']=_[_0xe51a('0x9')](config[_0xe51a('0xa')],{'host':_0xe51a('0xb'),'port':0x18eb});var socket=require(_0xe51a('0xc'))(new Redis(config['redis']));require(_0xe51a('0xd'))['register'](socket);function respondWithRpcPromise(_0xf1903e,_0x32a11e,_0x59d446){return new BPromise(function(_0xa9e8e0,_0x33c40e){return client[_0xe51a('0xe')](_0xf1903e,_0x59d446)[_0xe51a('0xf')](function(_0x411211){logger[_0xe51a('0x10')]('FaxQueue,\x20%s,\x20%s',_0x32a11e,'request\x20sent');logger[_0xe51a('0x11')](_0xe51a('0x12'),_0x32a11e,'request\x20sent',JSON[_0xe51a('0x13')](_0x411211));if(_0x411211[_0xe51a('0x14')]){if(_0x411211['error'][_0xe51a('0x15')]===0x1f4){logger[_0xe51a('0x14')](_0xe51a('0x16'),_0x32a11e,_0x411211[_0xe51a('0x14')][_0xe51a('0x17')]);return _0x33c40e(_0x411211[_0xe51a('0x14')][_0xe51a('0x17')]);}logger[_0xe51a('0x14')](_0xe51a('0x16'),_0x32a11e,_0x411211[_0xe51a('0x14')][_0xe51a('0x17')]);return _0xa9e8e0(_0x411211[_0xe51a('0x14')][_0xe51a('0x17')]);}else{logger[_0xe51a('0x10')](_0xe51a('0x16'),_0x32a11e,_0xe51a('0x18'));_0xa9e8e0(_0x411211[_0xe51a('0x19')]['message']);}})[_0xe51a('0x1a')](function(_0x3ef1a6){logger[_0xe51a('0x14')](_0xe51a('0x16'),_0x32a11e,_0x3ef1a6);_0x33c40e(_0x3ef1a6);});});}exports[_0xe51a('0x1b')]=function(_0x1c6f59){var _0x5d0806=this;return new Promise(function(_0x2e0e9b,_0xadc259){return db[_0xe51a('0x1c')]['findAll']({'raw':_0x1c6f59[_0xe51a('0x1d')]?_0x1c6f59[_0xe51a('0x1d')][_0xe51a('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c6f59[_0xe51a('0x1d')]?_0x1c6f59[_0xe51a('0x1d')][_0xe51a('0x1f')]||null:null,'attributes':_0x1c6f59[_0xe51a('0x1d')]?_0x1c6f59['options'][_0xe51a('0x20')]||null:null,'limit':_0x1c6f59[_0xe51a('0x1d')]?_0x1c6f59['options']['limit']||null:null,'include':_0x1c6f59['options']?_0x1c6f59['options'][_0xe51a('0x21')]?_['map'](_0x1c6f59[_0xe51a('0x1d')]['include'],function(_0x2240e2){return{'model':db[_0x2240e2['model']],'as':_0x2240e2['as'],'attributes':_0x2240e2[_0xe51a('0x20')],'include':_0x2240e2[_0xe51a('0x21')]?_[_0xe51a('0x22')](_0x2240e2[_0xe51a('0x21')],function(_0xe9d01b){return{'model':db[_0xe9d01b[_0xe51a('0x23')]],'as':_0xe9d01b['as'],'attributes':_0xe9d01b[_0xe51a('0x20')],'include':_0xe9d01b['include']?_['map'](_0xe9d01b[_0xe51a('0x21')],function(_0x3bff1b){return{'model':db[_0x3bff1b['model']],'as':_0x3bff1b['as'],'attributes':_0x3bff1b[_0xe51a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe51a('0xf')](function(_0x47ddbe){logger[_0xe51a('0x10')](_0xe51a('0x1b'),_0x1c6f59);logger['debug'](_0xe51a('0x1b'),_0x1c6f59,JSON['stringify'](_0x47ddbe));_0x2e0e9b(_0x47ddbe);})[_0xe51a('0x1a')](function(_0x2789e3){logger[_0xe51a('0x14')](_0xe51a('0x1b'),_0x2789e3[_0xe51a('0x17')],_0x1c6f59);_0xadc259(_0x5d0806[_0xe51a('0x14')](0x1f4,_0x2789e3['message']));});});};exports[_0xe51a('0x24')]=function(_0x5c9ce7){var _0x53a3d6=this;return new Promise(function(_0x13921b,_0x375aca){return db[_0xe51a('0x1c')][_0xe51a('0x25')]({'raw':_0x5c9ce7[_0xe51a('0x1d')]?_0x5c9ce7[_0xe51a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c9ce7[_0xe51a('0x1d')]?_0x5c9ce7[_0xe51a('0x1d')][_0xe51a('0x1f')]||null:null,'attributes':_0x5c9ce7[_0xe51a('0x1d')]?_0x5c9ce7[_0xe51a('0x1d')][_0xe51a('0x20')]||null:null,'include':_0x5c9ce7[_0xe51a('0x1d')]?_0x5c9ce7['options']['include']?_['map'](_0x5c9ce7[_0xe51a('0x1d')][_0xe51a('0x21')],function(_0x4e8192){return{'model':db[_0x4e8192[_0xe51a('0x23')]],'as':_0x4e8192['as'],'attributes':_0x4e8192[_0xe51a('0x20')],'include':_0x4e8192[_0xe51a('0x21')]?_['map'](_0x4e8192['include'],function(_0x51ba10){return{'model':db[_0x51ba10[_0xe51a('0x23')]],'as':_0x51ba10['as'],'attributes':_0x51ba10['attributes'],'include':_0x51ba10[_0xe51a('0x21')]?_[_0xe51a('0x22')](_0x51ba10[_0xe51a('0x21')],function(_0x229eb4){return{'model':db[_0x229eb4['model']],'as':_0x229eb4['as'],'attributes':_0x229eb4['attributes']};}):[]};}):[]};}):[]:[]})[_0xe51a('0xf')](function(_0x2d2637){logger[_0xe51a('0x10')]('ShowFaxQueue',_0x5c9ce7);logger[_0xe51a('0x11')](_0xe51a('0x24'),_0x5c9ce7,JSON[_0xe51a('0x13')](_0x2d2637));_0x13921b(_0x2d2637);})[_0xe51a('0x1a')](function(_0x115eca){logger[_0xe51a('0x14')](_0xe51a('0x24'),_0x115eca[_0xe51a('0x17')],_0x5c9ce7);_0x375aca(_0x53a3d6['error'](0x1f4,_0x115eca['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 7a8a81b..b0a4cb6 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 _0x1219=['emit','length','faxQueue:','./faxQueue.events','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1219,0x1e8));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x9121('0x0'));var events=['save','remove',_0x9121('0x1')];function createListener(_0x7c5cf2,_0x4ea789){return function(_0x2130b3){_0x4ea789[_0x9121('0x2')](_0x7c5cf2,_0x2130b3);};}function removeListener(_0x554268,_0x160acb){return function(){FaxQueueEvents['removeListener'](_0x554268,_0x160acb);};}exports['register']=function(_0x147e98){for(var _0x74337b=0x0,_0x48a1f8=events[_0x9121('0x3')];_0x74337b<_0x48a1f8;_0x74337b++){var _0x22bd2c=events[_0x74337b];var _0x1e7f97=createListener(_0x9121('0x4')+_0x22bd2c,_0x147e98);FaxQueueEvents['on'](_0x22bd2c,_0x1e7f97);}}; \ No newline at end of file +var _0x81c9=['remove','update','emit','removeListener','register','faxQueue:','./faxQueue.events','save'];(function(_0x21f972,_0xafaf3b){var _0x5e65fe=function(_0xb2cf7f){while(--_0xb2cf7f){_0x21f972['push'](_0x21f972['shift']());}};_0x5e65fe(++_0xafaf3b);}(_0x81c9,0x1de));var _0x981c=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x81c9[_0x187ee1];return _0x388160;};'use strict';var FaxQueueEvents=require(_0x981c('0x0'));var events=[_0x981c('0x1'),_0x981c('0x2'),_0x981c('0x3')];function createListener(_0x55ff41,_0x450631){return function(_0x1b15cf){_0x450631[_0x981c('0x4')](_0x55ff41,_0x1b15cf);};}function removeListener(_0x4f8c37,_0xef890a){return function(){FaxQueueEvents[_0x981c('0x5')](_0x4f8c37,_0xef890a);};}exports[_0x981c('0x6')]=function(_0x19aa19){for(var _0x5976c6=0x0,_0x89b46b=events['length'];_0x5976c6<_0x89b46b;_0x5976c6++){var _0x2c34fb=events[_0x5976c6];var _0x2133f9=createListener(_0x981c('0x7')+_0x2c34fb,_0x19aa19);FaxQueueEvents['on'](_0x2c34fb,_0x2133f9);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 71c8f80..e354b56 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 _0x9fe7=['show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x5a7208,_0x4d8078){var _0x1ab14f=function(_0x55fb44){while(--_0x55fb44){_0x5a7208['push'](_0x5a7208['shift']());}};_0x1ab14f(++_0x4d8078);}(_0x9fe7,0x1df));var _0x79fe=function(_0x967518,_0x3330a5){_0x967518=_0x967518-0x0;var _0x481f36=_0x9fe7[_0x967518];return _0x481f36;};'use strict';var multer=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var path=require('path');var timeout=require(_0x79fe('0x2'));var express=require('express');var router=express[_0x79fe('0x3')]();var fs_extra=require(_0x79fe('0x4'));var auth=require(_0x79fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x79fe('0x6'));var controller=require(_0x79fe('0x7'));router[_0x79fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x79fe('0x9')]);router[_0x79fe('0x8')](_0x79fe('0xa'),auth['isAuthenticated'](),controller[_0x79fe('0xb')]);router[_0x79fe('0x8')](_0x79fe('0xc'),auth[_0x79fe('0xd')](),controller[_0x79fe('0xe')]);router['get'](_0x79fe('0xf'),auth[_0x79fe('0xd')](),controller['getMembers']);router[_0x79fe('0x8')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x11')]);router['get'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x13')]);router[_0x79fe('0x14')]('/',auth[_0x79fe('0xd')](),controller[_0x79fe('0x15')]);router[_0x79fe('0x14')](_0x79fe('0x10'),auth['isAuthenticated'](),controller[_0x79fe('0x16')]);router[_0x79fe('0x14')](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x17')]);router[_0x79fe('0x18')]('/:id',auth[_0x79fe('0xd')](),controller[_0x79fe('0x19')]);router[_0x79fe('0x1a')](_0x79fe('0xc'),auth['isAuthenticated'](),controller[_0x79fe('0x1b')]);router[_0x79fe('0x1a')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller['removeTeams']);router['delete'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xbff5=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/users','getAgents','create','/:id/teams','addAgents','update','destroy','removeTeams'];(function(_0x179cce,_0x239422){var _0x54ac6d=function(_0x21a7f0){while(--_0x21a7f0){_0x179cce['push'](_0x179cce['shift']());}};_0x54ac6d(++_0x239422);}(_0xbff5,0x1bc));var _0x5bff=function(_0x3c0ee9,_0x156f1d){_0x3c0ee9=_0x3c0ee9-0x0;var _0x51f129=_0xbff5[_0x3c0ee9];return _0x51f129;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var fs_extra=require(_0x5bff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x7'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x5bff('0x8')]('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xa')]);router[_0x5bff('0x8')](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x8')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router['get'](_0x5bff('0xf'),auth[_0x5bff('0x9')](),controller['getMembers']);router[_0x5bff('0x8')]('/:id/teams',auth[_0x5bff('0x9')](),controller['getTeams']);router[_0x5bff('0x8')](_0x5bff('0x10'),auth['isAuthenticated'](),controller[_0x5bff('0x11')]);router['post']('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0x12')]);router['post'](_0x5bff('0x13'),auth[_0x5bff('0x9')](),controller['addTeams']);router['post'](_0x5bff('0x10'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x14')]);router['put'](_0x5bff('0xd'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x15')]);router['delete'](_0x5bff('0xd'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x16')]);router['delete'](_0x5bff('0x13'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x17')]);router[_0x5bff('0x18')]('/:id/users',auth[_0x5bff('0x9')](),controller['removeAgents']);module[_0x5bff('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 7233e1e..29fd17c 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 _0x735e=['STRING','DATE','moment','sequelize'];(function(_0x257ef6,_0x2ebd60){var _0x52476d=function(_0x474e9b){while(--_0x474e9b){_0x257ef6['push'](_0x257ef6['shift']());}};_0x52476d(++_0x2ebd60);}(_0x735e,0x15a));var _0xe735=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0x735e[_0x4536a4];return _0x4fd1c1;};'use strict';var moment=require(_0xe735('0x0'));var Sequelize=require(_0xe735('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe735('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe735('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe735('0x3')]},'acceptAt':{'type':Sequelize[_0xe735('0x3')]},'exitAt':{'type':Sequelize[_0xe735('0x3')]},'reason':{'type':Sequelize[_0xe735('0x2')]}}; \ No newline at end of file +var _0xce29=['moment','sequelize','exports','STRING','DATE'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xce29,0x159));var _0x9ce2=function(_0x492199,_0x51f647){_0x492199=_0x492199-0x0;var _0x3b626d=_0xce29[_0x492199];return _0x3b626d;};'use strict';var moment=require(_0x9ce2('0x0'));var Sequelize=require(_0x9ce2('0x1'));module[_0x9ce2('0x2')]={'uniqueid':{'type':Sequelize[_0x9ce2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9ce2('0x3')]},'joinAt':{'type':Sequelize[_0x9ce2('0x4')]},'leaveAt':{'type':Sequelize[_0x9ce2('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9ce2('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 7b1cbe4..b9ca901 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 _0xe600=['sort','where','pick','filter','merge','type','VIRTUAL','name','options','include','FaxQueueReport','findAll','rows','catch','show','includeAll','create','body','find','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0xe600,0x159));var _0x0e60=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe600[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e60('0x1'));var rp=require(_0x0e60('0x2'));var moment=require(_0x0e60('0x3'));var BPromise=require(_0x0e60('0x4'));var Mustache=require(_0x0e60('0x5'));var util=require(_0x0e60('0x6'));var path=require(_0x0e60('0x7'));var sox=require(_0x0e60('0x8'));var csv=require(_0x0e60('0x9'));var ejs=require(_0x0e60('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e60('0xb'));var squel=require(_0x0e60('0xc'));var crypto=require(_0x0e60('0xd'));var jsforce=require(_0x0e60('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e60('0x9'));var querystring=require(_0x0e60('0xf'));var Papa=require(_0x0e60('0x10'));var Redis=require(_0x0e60('0x11'));var authService=require(_0x0e60('0x12'));var qs=require(_0x0e60('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e60('0x14'));var logger=require(_0x0e60('0x15'))(_0x0e60('0x16'));var utils=require(_0x0e60('0x17'));var config=require(_0x0e60('0x18'));var licenseUtil=require(_0x0e60('0x19'));var db=require(_0x0e60('0x1a'))['db'];function respondWithStatusCode(_0x2f5ee4,_0x540411){_0x540411=_0x540411||0xcc;return function(_0x2d848f){if(_0x2d848f){return _0x2f5ee4[_0x0e60('0x1b')](_0x540411);}return _0x2f5ee4[_0x0e60('0x1c')](_0x540411)[_0x0e60('0x1d')]();};}function respondWithResult(_0x45328b,_0x37bf95){_0x37bf95=_0x37bf95||0xc8;return function(_0x5d7f84){if(_0x5d7f84){return _0x45328b[_0x0e60('0x1c')](_0x37bf95)['json'](_0x5d7f84);}};}function respondWithFilteredResult(_0x91cd1,_0x128887){return function(_0x170890){if(_0x170890){var _0x5ab4ba=typeof _0x128887[_0x0e60('0x1e')]===_0x0e60('0x1f')&&typeof _0x128887[_0x0e60('0x20')]===_0x0e60('0x1f');var _0x2e6270=_0x170890['count'];var _0x992490=_0x5ab4ba?0x0:_0x128887[_0x0e60('0x1e')];var _0x599c1d=_0x5ab4ba?_0x170890[_0x0e60('0x21')]:_0x128887[_0x0e60('0x1e')]+_0x128887[_0x0e60('0x20')];var _0x504b31;if(_0x599c1d>=_0x2e6270){_0x599c1d=_0x2e6270;_0x504b31=0xc8;}else{_0x504b31=0xce;}_0x91cd1[_0x0e60('0x1c')](_0x504b31);return _0x91cd1['set'](_0x0e60('0x22'),_0x992490+'-'+_0x599c1d+'/'+_0x2e6270)[_0x0e60('0x23')](_0x170890);}return null;};}function patchUpdates(_0xb9f037){return function(_0xabf953){try{jsonpatch[_0x0e60('0x24')](_0xabf953,_0xb9f037,!![]);}catch(_0x31a63e){return BPromise[_0x0e60('0x25')](_0x31a63e);}return _0xabf953[_0x0e60('0x26')]();};}function saveUpdates(_0x352633,_0x10f875){return function(_0x22c0e0){if(_0x22c0e0){return _0x22c0e0[_0x0e60('0x27')](_0x352633)[_0x0e60('0x28')](function(_0x16985f){return _0x16985f;});}return null;};}function removeEntity(_0x4702f,_0x33f9f3){return function(_0x41642c){if(_0x41642c){return _0x41642c[_0x0e60('0x29')]()[_0x0e60('0x28')](function(){_0x4702f['status'](0xcc)[_0x0e60('0x1d')]();});}};}function handleEntityNotFound(_0x41ad9a,_0x5ea254){return function(_0x10451f){if(!_0x10451f){_0x41ad9a['sendStatus'](0x194);}return _0x10451f;};}function handleError(_0x3ddc19,_0x5665c2){_0x5665c2=_0x5665c2||0x1f4;return function(_0x48d950){logger[_0x0e60('0x2a')](_0x48d950[_0x0e60('0x2b')]);if(_0x48d950['name']){delete _0x48d950['name'];}_0x3ddc19[_0x0e60('0x1c')](_0x5665c2)['send'](_0x48d950);};}exports[_0x0e60('0x2c')]=function(_0x548919,_0x4e6b41){var _0x154478={},_0x3d3c13={},_0x2a282d={'count':0x0,'rows':[]};var _0x4d9b18=_[_0x0e60('0x2d')](db['FaxQueueReport'][_0x0e60('0x2e')],function(_0x1d54c0){return{'name':_0x1d54c0[_0x0e60('0x2f')],'type':_0x1d54c0['type'][_0x0e60('0x30')]};});_0x3d3c13[_0x0e60('0x31')]=_[_0x0e60('0x2d')](_0x4d9b18,'name');_0x3d3c13[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x548919[_0x0e60('0x32')]);_0x3d3c13[_0x0e60('0x34')]=_[_0x0e60('0x35')](_0x3d3c13['model'],_0x3d3c13[_0x0e60('0x32')]);_0x154478['attributes']=_[_0x0e60('0x35')](_0x3d3c13['model'],qs[_0x0e60('0x36')](_0x548919[_0x0e60('0x32')][_0x0e60('0x36')]));_0x154478['attributes']=_0x154478[_0x0e60('0x37')][_0x0e60('0x38')]?_0x154478[_0x0e60('0x37')]:_0x3d3c13[_0x0e60('0x31')];if(!_0x548919[_0x0e60('0x32')][_0x0e60('0x39')](_0x0e60('0x3a'))){_0x154478[_0x0e60('0x20')]=qs[_0x0e60('0x20')](_0x548919[_0x0e60('0x32')][_0x0e60('0x20')]);_0x154478[_0x0e60('0x1e')]=qs['offset'](_0x548919[_0x0e60('0x32')][_0x0e60('0x1e')]);}_0x154478[_0x0e60('0x3b')]=qs[_0x0e60('0x3c')](_0x548919['query']['sort']);_0x154478[_0x0e60('0x3d')]=qs['filters'](_[_0x0e60('0x3e')](_0x548919['query'],_0x3d3c13[_0x0e60('0x34')]),_0x4d9b18);if(_0x548919[_0x0e60('0x32')][_0x0e60('0x3f')]){_0x154478[_0x0e60('0x3d')]=_[_0x0e60('0x40')](_0x154478[_0x0e60('0x3d')],{'$or':_[_0x0e60('0x2d')](_0x4d9b18,function(_0x39fac1){if(_0x39fac1[_0x0e60('0x41')]!==_0x0e60('0x42')){var _0xb0a66c={};_0xb0a66c[_0x39fac1[_0x0e60('0x43')]]={'$like':'%'+_0x548919['query'][_0x0e60('0x3f')]+'%'};return _0xb0a66c;}})});}_0x154478=_['merge']({},_0x154478,_0x548919[_0x0e60('0x44')]);var _0x266cae={'where':_0x154478['where']};return db['FaxQueueReport'][_0x0e60('0x21')](_0x266cae)[_0x0e60('0x28')](function(_0x50b793){_0x2a282d[_0x0e60('0x21')]=_0x50b793;if(_0x548919[_0x0e60('0x32')]['includeAll']){_0x154478[_0x0e60('0x45')]=[{'all':!![]}];}return db[_0x0e60('0x46')][_0x0e60('0x47')](_0x154478);})[_0x0e60('0x28')](function(_0x3ac0f0){_0x2a282d[_0x0e60('0x48')]=_0x3ac0f0;return _0x2a282d;})[_0x0e60('0x28')](respondWithFilteredResult(_0x4e6b41,_0x154478))[_0x0e60('0x49')](handleError(_0x4e6b41,null));};exports[_0x0e60('0x4a')]=function(_0x4c89b4,_0x4a2a10){var _0x535c06={'raw':!![],'where':{'id':_0x4c89b4['params']['id']}},_0x39c7d4={};_0x39c7d4[_0x0e60('0x31')]=_[_0x0e60('0x33')](db[_0x0e60('0x46')]['rawAttributes']);_0x39c7d4[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x4c89b4['query']);_0x39c7d4['filters']=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],_0x39c7d4[_0x0e60('0x32')]);_0x535c06[_0x0e60('0x37')]=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],qs['fields'](_0x4c89b4[_0x0e60('0x32')][_0x0e60('0x36')]));_0x535c06[_0x0e60('0x37')]=_0x535c06[_0x0e60('0x37')][_0x0e60('0x38')]?_0x535c06['attributes']:_0x39c7d4['model'];if(_0x4c89b4['query'][_0x0e60('0x4b')]){_0x535c06[_0x0e60('0x45')]=[{'all':!![]}];}_0x535c06=_[_0x0e60('0x40')]({},_0x535c06,_0x4c89b4[_0x0e60('0x44')]);return db['FaxQueueReport']['find'](_0x535c06)['then'](handleEntityNotFound(_0x4a2a10,null))[_0x0e60('0x28')](respondWithResult(_0x4a2a10,null))[_0x0e60('0x49')](handleError(_0x4a2a10,null));};exports[_0x0e60('0x4c')]=function(_0x5fe304,_0x8777f4){return db['FaxQueueReport']['create'](_0x5fe304[_0x0e60('0x4d')],{})[_0x0e60('0x28')](respondWithResult(_0x8777f4,0xc9))[_0x0e60('0x49')](handleError(_0x8777f4,null));};exports[_0x0e60('0x27')]=function(_0x4ad156,_0x36a999){if(_0x4ad156[_0x0e60('0x4d')]['id']){delete _0x4ad156[_0x0e60('0x4d')]['id'];}return db['FaxQueueReport'][_0x0e60('0x4e')]({'where':{'id':_0x4ad156[_0x0e60('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36a999,null))[_0x0e60('0x28')](saveUpdates(_0x4ad156['body'],null))[_0x0e60('0x28')](respondWithResult(_0x36a999,null))[_0x0e60('0x49')](handleError(_0x36a999,null));};exports[_0x0e60('0x29')]=function(_0x2e887c,_0x477a99){return db['FaxQueueReport'][_0x0e60('0x4e')]({'where':{'id':_0x2e887c[_0x0e60('0x4f')]['id']}})[_0x0e60('0x28')](handleEntityNotFound(_0x477a99,null))[_0x0e60('0x28')](removeEntity(_0x477a99,null))['catch'](handleError(_0x477a99,null));};exports[_0x0e60('0x50')]=function(_0x241c9e,_0x5a20f4){return db[_0x0e60('0x46')]['describe']()[_0x0e60('0x28')](respondWithResult(_0x5a20f4,null))['catch'](handleError(_0x5a20f4,null));}; \ No newline at end of file +var _0x028d=['nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','zip-dir','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','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x3f32ec,_0x7e8f4){var _0x35ec52=function(_0x490291){while(--_0x490291){_0x3f32ec['push'](_0x3f32ec['shift']());}};_0x35ec52(++_0x7e8f4);}(_0x028d,0xff));var _0xd028=function(_0xd5edd0,_0x1216d3){_0xd5edd0=_0xd5edd0-0x0;var _0x25ae02=_0x028d[_0xd5edd0];return _0x25ae02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd028('0x0'));var zipdir=require(_0xd028('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd028('0x2'));var moment=require(_0xd028('0x3'));var BPromise=require(_0xd028('0x4'));var Mustache=require(_0xd028('0x5'));var util=require(_0xd028('0x6'));var path=require(_0xd028('0x7'));var sox=require('sox');var csv=require(_0xd028('0x8'));var ejs=require(_0xd028('0x9'));var fs=require('fs');var fs_extra=require(_0xd028('0xa'));var _=require(_0xd028('0xb'));var squel=require(_0xd028('0xc'));var crypto=require(_0xd028('0xd'));var jsforce=require(_0xd028('0xe'));var deskjs=require(_0xd028('0xf'));var toCsv=require(_0xd028('0x8'));var querystring=require(_0xd028('0x10'));var Papa=require(_0xd028('0x11'));var Redis=require(_0xd028('0x12'));var authService=require(_0xd028('0x13'));var qs=require(_0xd028('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd028('0x15'));var logger=require(_0xd028('0x16'))(_0xd028('0x17'));var utils=require(_0xd028('0x18'));var config=require(_0xd028('0x19'));var licenseUtil=require(_0xd028('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b5fa,_0x144696){_0x144696=_0x144696||0xcc;return function(_0x4817a4){if(_0x4817a4){return _0x34b5fa[_0xd028('0x1b')](_0x144696);}return _0x34b5fa[_0xd028('0x1c')](_0x144696)[_0xd028('0x1d')]();};}function respondWithResult(_0x17b112,_0x1667bf){_0x1667bf=_0x1667bf||0xc8;return function(_0x5ec067){if(_0x5ec067){return _0x17b112[_0xd028('0x1c')](_0x1667bf)[_0xd028('0x1e')](_0x5ec067);}};}function respondWithFilteredResult(_0x3937b4,_0x3bac54){return function(_0x12450d){if(_0x12450d){var _0x463d38=typeof _0x3bac54['offset']===_0xd028('0x1f')&&typeof _0x3bac54['limit']===_0xd028('0x1f');var _0x2f4af6=_0x12450d[_0xd028('0x20')];var _0x4df54f=_0x463d38?0x0:_0x3bac54[_0xd028('0x21')];var _0x5a47a6=_0x463d38?_0x12450d[_0xd028('0x20')]:_0x3bac54['offset']+_0x3bac54[_0xd028('0x22')];var _0x415d6c;if(_0x5a47a6>=_0x2f4af6){_0x5a47a6=_0x2f4af6;_0x415d6c=0xc8;}else{_0x415d6c=0xce;}_0x3937b4[_0xd028('0x1c')](_0x415d6c);return _0x3937b4['set'](_0xd028('0x23'),_0x4df54f+'-'+_0x5a47a6+'/'+_0x2f4af6)[_0xd028('0x1e')](_0x12450d);}return null;};}function patchUpdates(_0x1a2767){return function(_0x1648a7){try{jsonpatch[_0xd028('0x24')](_0x1648a7,_0x1a2767,!![]);}catch(_0x4830a4){return BPromise[_0xd028('0x25')](_0x4830a4);}return _0x1648a7[_0xd028('0x26')]();};}function saveUpdates(_0x8a964d,_0x75657f){return function(_0x3203f9){if(_0x3203f9){return _0x3203f9[_0xd028('0x27')](_0x8a964d)[_0xd028('0x28')](function(_0x54beee){return _0x54beee;});}return null;};}function removeEntity(_0x115fef,_0x10d629){return function(_0x13e5f4){if(_0x13e5f4){return _0x13e5f4[_0xd028('0x29')]()['then'](function(){_0x115fef[_0xd028('0x1c')](0xcc)[_0xd028('0x1d')]();});}};}function handleEntityNotFound(_0x26eb4e,_0x3249ea){return function(_0x5b9f3d){if(!_0x5b9f3d){_0x26eb4e[_0xd028('0x1b')](0x194);}return _0x5b9f3d;};}function handleError(_0x128c63,_0x115004){_0x115004=_0x115004||0x1f4;return function(_0x3481be){logger[_0xd028('0x2a')](_0x3481be[_0xd028('0x2b')]);if(_0x3481be[_0xd028('0x2c')]){delete _0x3481be[_0xd028('0x2c')];}_0x128c63[_0xd028('0x1c')](_0x115004)[_0xd028('0x2d')](_0x3481be);};}exports[_0xd028('0x2e')]=function(_0x3112e8,_0x112578){var _0x17594f={},_0x23d9dd={},_0x3b46bb={'count':0x0,'rows':[]};var _0x5d6f95=_['map'](db[_0xd028('0x2f')][_0xd028('0x30')],function(_0x2caf5d){return{'name':_0x2caf5d[_0xd028('0x31')],'type':_0x2caf5d[_0xd028('0x32')][_0xd028('0x33')]};});_0x23d9dd['model']=_['map'](_0x5d6f95,_0xd028('0x2c'));_0x23d9dd[_0xd028('0x34')]=_[_0xd028('0x35')](_0x3112e8[_0xd028('0x34')]);_0x23d9dd[_0xd028('0x36')]=_[_0xd028('0x37')](_0x23d9dd[_0xd028('0x38')],_0x23d9dd['query']);_0x17594f['attributes']=_[_0xd028('0x37')](_0x23d9dd[_0xd028('0x38')],qs['fields'](_0x3112e8['query'][_0xd028('0x39')]));_0x17594f[_0xd028('0x3a')]=_0x17594f[_0xd028('0x3a')][_0xd028('0x3b')]?_0x17594f[_0xd028('0x3a')]:_0x23d9dd[_0xd028('0x38')];if(!_0x3112e8[_0xd028('0x34')][_0xd028('0x3c')](_0xd028('0x3d'))){_0x17594f[_0xd028('0x22')]=qs[_0xd028('0x22')](_0x3112e8['query']['limit']);_0x17594f['offset']=qs['offset'](_0x3112e8['query'][_0xd028('0x21')]);}_0x17594f['order']=qs['sort'](_0x3112e8['query'][_0xd028('0x3e')]);_0x17594f['where']=qs[_0xd028('0x36')](_['pick'](_0x3112e8['query'],_0x23d9dd[_0xd028('0x36')]),_0x5d6f95);if(_0x3112e8[_0xd028('0x34')]['filter']){_0x17594f[_0xd028('0x3f')]=_['merge'](_0x17594f['where'],{'$or':_['map'](_0x5d6f95,function(_0x5941ed){if(_0x5941ed['type']!==_0xd028('0x40')){var _0x24ba63={};_0x24ba63[_0x5941ed['name']]={'$like':'%'+_0x3112e8[_0xd028('0x34')][_0xd028('0x41')]+'%'};return _0x24ba63;}})});}_0x17594f=_[_0xd028('0x42')]({},_0x17594f,_0x3112e8[_0xd028('0x43')]);var _0xc79c76={'where':_0x17594f[_0xd028('0x3f')]};return db['FaxQueueReport'][_0xd028('0x20')](_0xc79c76)[_0xd028('0x28')](function(_0x2d5fab){_0x3b46bb['count']=_0x2d5fab;if(_0x3112e8[_0xd028('0x34')][_0xd028('0x44')]){_0x17594f[_0xd028('0x45')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xd028('0x46')](_0x17594f);})['then'](function(_0x26e51c){_0x3b46bb[_0xd028('0x47')]=_0x26e51c;return _0x3b46bb;})[_0xd028('0x28')](respondWithFilteredResult(_0x112578,_0x17594f))[_0xd028('0x48')](handleError(_0x112578,null));};exports[_0xd028('0x49')]=function(_0x3f86ed,_0x1de847){var _0x42a3fc={'raw':!![],'where':{'id':_0x3f86ed['params']['id']}},_0x3065f2={};_0x3065f2[_0xd028('0x38')]=_[_0xd028('0x35')](db[_0xd028('0x2f')][_0xd028('0x30')]);_0x3065f2['query']=_[_0xd028('0x35')](_0x3f86ed[_0xd028('0x34')]);_0x3065f2[_0xd028('0x36')]=_['intersection'](_0x3065f2[_0xd028('0x38')],_0x3065f2[_0xd028('0x34')]);_0x42a3fc['attributes']=_[_0xd028('0x37')](_0x3065f2[_0xd028('0x38')],qs[_0xd028('0x39')](_0x3f86ed[_0xd028('0x34')][_0xd028('0x39')]));_0x42a3fc[_0xd028('0x3a')]=_0x42a3fc[_0xd028('0x3a')][_0xd028('0x3b')]?_0x42a3fc[_0xd028('0x3a')]:_0x3065f2[_0xd028('0x38')];if(_0x3f86ed['query'][_0xd028('0x44')]){_0x42a3fc[_0xd028('0x45')]=[{'all':!![]}];}_0x42a3fc=_[_0xd028('0x42')]({},_0x42a3fc,_0x3f86ed[_0xd028('0x43')]);return db[_0xd028('0x2f')][_0xd028('0x4a')](_0x42a3fc)['then'](handleEntityNotFound(_0x1de847,null))[_0xd028('0x28')](respondWithResult(_0x1de847,null))[_0xd028('0x48')](handleError(_0x1de847,null));};exports[_0xd028('0x4b')]=function(_0xf0bd53,_0x30d7b6){return db['FaxQueueReport']['create'](_0xf0bd53['body'],{})['then'](respondWithResult(_0x30d7b6,0xc9))[_0xd028('0x48')](handleError(_0x30d7b6,null));};exports[_0xd028('0x27')]=function(_0x2ca45d,_0x3db4b8){if(_0x2ca45d[_0xd028('0x4c')]['id']){delete _0x2ca45d[_0xd028('0x4c')]['id'];}return db[_0xd028('0x2f')][_0xd028('0x4a')]({'where':{'id':_0x2ca45d[_0xd028('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3db4b8,null))[_0xd028('0x28')](saveUpdates(_0x2ca45d[_0xd028('0x4c')],null))[_0xd028('0x28')](respondWithResult(_0x3db4b8,null))[_0xd028('0x48')](handleError(_0x3db4b8,null));};exports[_0xd028('0x29')]=function(_0x13b619,_0x4a2c39){return db['FaxQueueReport'][_0xd028('0x4a')]({'where':{'id':_0x13b619[_0xd028('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a2c39,null))[_0xd028('0x28')](removeEntity(_0x4a2c39,null))[_0xd028('0x48')](handleError(_0x4a2c39,null));};exports[_0xd028('0x4e')]=function(_0x1d337d,_0x29d5d2){return db[_0xd028('0x2f')][_0xd028('0x4e')]()[_0xd028('0x28')](respondWithResult(_0x29d5d2,null))[_0xd028('0x48')](handleError(_0x29d5d2,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a0a4b3b..e3705d4 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x1729d8,_0x481673){var _0x1d9d38=function(_0x50f503){while(--_0x50f503){_0x1729d8['push'](_0x1729d8['shift']());}};_0x1d9d38(++_0x481673);}(_0x7a54,0x106));var _0x47a5=function(_0x4a8edb,_0x46bb37){_0x4a8edb=_0x4a8edb-0x0;var _0x45930a=_0x7a54[_0x4a8edb];return _0x45930a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x52b7f5,_0x2e2834){var _0x41fd6c=function(_0x31f79c){while(--_0x31f79c){_0x52b7f5['push'](_0x52b7f5['shift']());}};_0x41fd6c(++_0x2e2834);}(_0x53ec,0x192));var _0xc53e=function(_0x568f96,_0x32d489){_0x568f96=_0x568f96-0x0;var _0x5a053a=_0x53ec[_0x568f96];return _0x5a053a;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 8a37449..8a8ff22 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 _0x32b7=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x103c7c,_0x3e464d){var _0x18d62b=function(_0x428883){while(--_0x428883){_0x103c7c['push'](_0x103c7c['shift']());}};_0x18d62b(++_0x3e464d);}(_0x32b7,0xb8));var _0x732b=function(_0x78f8ae,_0x5d9321){_0x78f8ae=_0x78f8ae-0x0;var _0x110332=_0x32b7[_0x78f8ae];return _0x110332;};'use strict';var _=require(_0x732b('0x0'));var util=require(_0x732b('0x1'));var moment=require(_0x732b('0x2'));var BPromise=require(_0x732b('0x3'));var rs=require(_0x732b('0x4'));var fs=require('fs');var Redis=require(_0x732b('0x5'));var db=require(_0x732b('0x6'))['db'];var utils=require(_0x732b('0x7'));var logger=require(_0x732b('0x8'))(_0x732b('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x732b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42d078,_0x73e679,_0x47a7b6){return new BPromise(function(_0x29a126,_0x4bb07b){return client[_0x732b('0xb')](_0x42d078,_0x47a7b6)[_0x732b('0xc')](function(_0x35d907){logger[_0x732b('0xd')](_0x732b('0xe'),_0x73e679,_0x732b('0xf'));logger[_0x732b('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x73e679,_0x732b('0xf'),JSON[_0x732b('0x11')](_0x35d907));if(_0x35d907[_0x732b('0x12')]){if(_0x35d907['error']['code']===0x1f4){logger[_0x732b('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x73e679,_0x35d907[_0x732b('0x12')][_0x732b('0x13')]);return _0x4bb07b(_0x35d907[_0x732b('0x12')]['message']);}logger[_0x732b('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x73e679,_0x35d907['error'][_0x732b('0x13')]);return _0x29a126(_0x35d907[_0x732b('0x12')][_0x732b('0x13')]);}else{logger[_0x732b('0xd')](_0x732b('0xe'),_0x73e679,_0x732b('0xf'));_0x29a126(_0x35d907[_0x732b('0x14')][_0x732b('0x13')]);}})[_0x732b('0x15')](function(_0x5e8d89){logger[_0x732b('0x12')](_0x732b('0xe'),_0x73e679,_0x5e8d89);_0x4bb07b(_0x5e8d89);});});}exports['CreateFaxQueueReport']=function(_0x3947c8){var _0x2dbeb=this;return new Promise(function(_0x504957,_0xb170b8){return db[_0x732b('0x16')][_0x732b('0x17')](_0x3947c8[_0x732b('0x18')],{'raw':_0x3947c8[_0x732b('0x19')]?_0x3947c8[_0x732b('0x19')][_0x732b('0x1a')]===undefined?!![]:![]:!![]})[_0x732b('0xc')](function(_0xe9ca53){logger['info'](_0x732b('0x1b'),_0x3947c8);logger[_0x732b('0x10')](_0x732b('0x1b'),_0x3947c8,JSON[_0x732b('0x11')](_0xe9ca53));_0x504957(_0xe9ca53);})['catch'](function(_0x4016c8){logger[_0x732b('0x12')](_0x732b('0x1b'),_0x4016c8[_0x732b('0x13')],_0x3947c8);_0xb170b8(_0x2dbeb[_0x732b('0x12')](0x1f4,_0x4016c8[_0x732b('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x244823){var _0x1a08c2=this;return new Promise(function(_0x3e8ab9,_0x57ef12){return db[_0x732b('0x16')][_0x732b('0x1c')](_0x244823['body'],{'raw':_0x244823['options']?_0x244823['options'][_0x732b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x244823[_0x732b('0x19')]?_0x244823[_0x732b('0x19')][_0x732b('0x1d')]||null:null,'attributes':_0x244823[_0x732b('0x19')]?_0x244823['options'][_0x732b('0x1e')]||null:null,'limit':_0x244823['options']?_0x244823[_0x732b('0x19')][_0x732b('0x1f')]||null:null})[_0x732b('0xc')](function(_0xaadae8){logger[_0x732b('0xd')](_0x732b('0x20'),_0x244823);logger[_0x732b('0x10')]('UpdateFaxQueueReport',_0x244823,JSON[_0x732b('0x11')](_0xaadae8));_0x3e8ab9(_0xaadae8);})['catch'](function(_0x391d0e){logger[_0x732b('0x12')](_0x732b('0x20'),_0x391d0e['message'],_0x244823);_0x57ef12(_0x1a08c2[_0x732b('0x12')](0x1f4,_0x391d0e[_0x732b('0x13')]));});});}; \ No newline at end of file +var _0x9150=['attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','then','debug','UpdateFaxQueueReport','update','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9150,0x16d));var _0x0915=function(_0x832a7d,_0x2fdc59){_0x832a7d=_0x832a7d-0x0;var _0xed007=_0x9150[_0x832a7d];return _0xed007;};'use strict';var _=require('lodash');var util=require(_0x0915('0x0'));var moment=require(_0x0915('0x1'));var BPromise=require(_0x0915('0x2'));var rs=require(_0x0915('0x3'));var fs=require('fs');var Redis=require(_0x0915('0x4'));var db=require(_0x0915('0x5'))['db'];var utils=require(_0x0915('0x6'));var logger=require(_0x0915('0x7'))(_0x0915('0x8'));var config=require('../../config/environment');var jayson=require(_0x0915('0x9'));var client=jayson[_0x0915('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e836f,_0x531002,_0x14dd39){return new BPromise(function(_0x2c293c,_0x1df9ff){return client[_0x0915('0xb')](_0x4e836f,_0x14dd39)['then'](function(_0x5de772){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x531002,_0x0915('0xc'));logger['debug'](_0x0915('0xd'),_0x531002,_0x0915('0xc'),JSON[_0x0915('0xe')](_0x5de772));if(_0x5de772[_0x0915('0xf')]){if(_0x5de772[_0x0915('0xf')][_0x0915('0x10')]===0x1f4){logger[_0x0915('0xf')](_0x0915('0x11'),_0x531002,_0x5de772[_0x0915('0xf')][_0x0915('0x12')]);return _0x1df9ff(_0x5de772[_0x0915('0xf')][_0x0915('0x12')]);}logger[_0x0915('0xf')](_0x0915('0x11'),_0x531002,_0x5de772[_0x0915('0xf')]['message']);return _0x2c293c(_0x5de772[_0x0915('0xf')][_0x0915('0x12')]);}else{logger[_0x0915('0x13')](_0x0915('0x11'),_0x531002,_0x0915('0xc'));_0x2c293c(_0x5de772[_0x0915('0x14')]['message']);}})[_0x0915('0x15')](function(_0x57fae5){logger['error'](_0x0915('0x11'),_0x531002,_0x57fae5);_0x1df9ff(_0x57fae5);});});}exports[_0x0915('0x16')]=function(_0x102bce){var _0x23cdba=this;return new Promise(function(_0x169929,_0x1184a0){return db[_0x0915('0x17')]['create'](_0x102bce[_0x0915('0x18')],{'raw':_0x102bce['options']?_0x102bce[_0x0915('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0915('0x1a')](function(_0x112452){logger[_0x0915('0x13')](_0x0915('0x16'),_0x102bce);logger[_0x0915('0x1b')](_0x0915('0x16'),_0x102bce,JSON['stringify'](_0x112452));_0x169929(_0x112452);})['catch'](function(_0x205393){logger['error'](_0x0915('0x16'),_0x205393[_0x0915('0x12')],_0x102bce);_0x1184a0(_0x23cdba[_0x0915('0xf')](0x1f4,_0x205393[_0x0915('0x12')]));});});};exports[_0x0915('0x1c')]=function(_0x103bb9){var _0x4f91b4=this;return new Promise(function(_0x149838,_0x4586ef){return db[_0x0915('0x17')][_0x0915('0x1d')](_0x103bb9[_0x0915('0x18')],{'raw':_0x103bb9['options']?_0x103bb9[_0x0915('0x19')][_0x0915('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x103bb9[_0x0915('0x19')]?_0x103bb9[_0x0915('0x19')]['where']||null:null,'attributes':_0x103bb9[_0x0915('0x19')]?_0x103bb9[_0x0915('0x19')][_0x0915('0x1f')]||null:null,'limit':_0x103bb9[_0x0915('0x19')]?_0x103bb9[_0x0915('0x19')][_0x0915('0x20')]||null:null})[_0x0915('0x1a')](function(_0x5e3603){logger[_0x0915('0x13')](_0x0915('0x1c'),_0x103bb9);logger[_0x0915('0x1b')]('UpdateFaxQueueReport',_0x103bb9,JSON['stringify'](_0x5e3603));_0x149838(_0x5e3603);})[_0x0915('0x15')](function(_0x130f35){logger[_0x0915('0xf')](_0x0915('0x1c'),_0x130f35['message'],_0x103bb9);_0x4586ef(_0x4f91b4[_0x0915('0xf')](0x1f4,_0x130f35[_0x0915('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a1820f7..1be5605 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 _0x07a8=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','/describe','describe','get','show','post','create','put','/:id','update','delete','destroy'];(function(_0x27bed4,_0xf17e71){var _0x412e9d=function(_0x2c4eb4){while(--_0x2c4eb4){_0x27bed4['push'](_0x27bed4['shift']());}};_0x412e9d(++_0xf17e71);}(_0x07a8,0x151));var _0x807a=function(_0x570acd,_0x40377a){_0x570acd=_0x570acd-0x0;var _0x133635=_0x07a8[_0x570acd];return _0x133635;};'use strict';var multer=require(_0x807a('0x0'));var util=require(_0x807a('0x1'));var path=require(_0x807a('0x2'));var timeout=require(_0x807a('0x3'));var express=require(_0x807a('0x4'));var router=express[_0x807a('0x5')]();var fs_extra=require(_0x807a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x807a('0x7'));var config=require(_0x807a('0x8'));var controller=require(_0x807a('0x9'));router['get']('/',auth[_0x807a('0xa')](),controller[_0x807a('0xb')]);router['get'](_0x807a('0xc'),auth[_0x807a('0xa')](),controller[_0x807a('0xd')]);router[_0x807a('0xe')]('/:id',auth[_0x807a('0xa')](),controller[_0x807a('0xf')]);router[_0x807a('0x10')]('/',auth[_0x807a('0xa')](),controller[_0x807a('0x11')]);router[_0x807a('0x12')](_0x807a('0x13'),auth['isAuthenticated'](),controller[_0x807a('0x14')]);router[_0x807a('0x15')](_0x807a('0x13'),auth[_0x807a('0xa')](),controller[_0x807a('0x16')]);module[_0x807a('0x17')]=router; \ No newline at end of file +var _0x75fe=['show','post','create','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x4f882a,_0xf88f2e){var _0x896723=function(_0x1f9274){while(--_0x1f9274){_0x4f882a['push'](_0x4f882a['shift']());}};_0x896723(++_0xf88f2e);}(_0x75fe,0x109));var _0xe75f=function(_0xe56997,_0x58e51f){_0xe56997=_0xe56997-0x0;var _0x39de07=_0x75fe[_0xe56997];return _0x39de07;};'use strict';var multer=require('multer');var util=require(_0xe75f('0x0'));var path=require(_0xe75f('0x1'));var timeout=require(_0xe75f('0x2'));var express=require(_0xe75f('0x3'));var router=express[_0xe75f('0x4')]();var fs_extra=require(_0xe75f('0x5'));var auth=require(_0xe75f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe75f('0x7'));var controller=require(_0xe75f('0x8'));router[_0xe75f('0x9')]('/',auth['isAuthenticated'](),controller[_0xe75f('0xa')]);router[_0xe75f('0x9')](_0xe75f('0xb'),auth[_0xe75f('0xc')](),controller[_0xe75f('0xd')]);router[_0xe75f('0x9')](_0xe75f('0xe'),auth[_0xe75f('0xc')](),controller[_0xe75f('0xf')]);router[_0xe75f('0x10')]('/',auth[_0xe75f('0xc')](),controller[_0xe75f('0x11')]);router['put'](_0xe75f('0xe'),auth[_0xe75f('0xc')](),controller[_0xe75f('0x12')]);router['delete'](_0xe75f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xe75f('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 879ebc6..7f853fb 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x135b01,_0x17b2ff){var _0x22d364=function(_0x57b100){while(--_0x57b100){_0x135b01['push'](_0x135b01['shift']());}};_0x22d364(++_0x17b2ff);}(_0xaa88,0x137));var _0x8aa8=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xaa88[_0x34b821];return _0x5e00a0;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x2aa788,_0x498eb8){var _0x5be967=function(_0x546ba9){while(--_0x546ba9){_0x2aa788['push'](_0x2aa788['shift']());}};_0x5be967(++_0x498eb8);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index dc01c53..7a21927 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 _0x0eb9=['pick','filter','where','merge','includeAll','include','findAll','rows','catch','length','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x31eb4b,_0x2cf5cd){var _0x3ae61b=function(_0x458b80){while(--_0x458b80){_0x31eb4b['push'](_0x31eb4b['shift']());}};_0x3ae61b(++_0x2cf5cd);}(_0x0eb9,0xec));var _0x90eb=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x0eb9[_0x15fc7a];return _0x3aa9f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90eb('0x0'));var zipdir=require(_0x90eb('0x1'));var jsonpatch=require(_0x90eb('0x2'));var rp=require(_0x90eb('0x3'));var moment=require(_0x90eb('0x4'));var BPromise=require(_0x90eb('0x5'));var Mustache=require(_0x90eb('0x6'));var util=require('util');var path=require(_0x90eb('0x7'));var sox=require(_0x90eb('0x8'));var csv=require(_0x90eb('0x9'));var ejs=require(_0x90eb('0xa'));var fs=require('fs');var fs_extra=require(_0x90eb('0xb'));var _=require(_0x90eb('0xc'));var squel=require('squel');var crypto=require(_0x90eb('0xd'));var jsforce=require(_0x90eb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90eb('0xf'));var Redis=require(_0x90eb('0x10'));var authService=require(_0x90eb('0x11'));var qs=require(_0x90eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90eb('0x13'))(_0x90eb('0x14'));var utils=require(_0x90eb('0x15'));var config=require(_0x90eb('0x16'));var licenseUtil=require(_0x90eb('0x17'));var db=require(_0x90eb('0x18'))['db'];function respondWithStatusCode(_0x28cdbf,_0x19b418){_0x19b418=_0x19b418||0xcc;return function(_0x168eb4){if(_0x168eb4){return _0x28cdbf[_0x90eb('0x19')](_0x19b418);}return _0x28cdbf['status'](_0x19b418)[_0x90eb('0x1a')]();};}function respondWithResult(_0x179ce6,_0x2ab1ea){_0x2ab1ea=_0x2ab1ea||0xc8;return function(_0x507cca){if(_0x507cca){return _0x179ce6[_0x90eb('0x1b')](_0x2ab1ea)['json'](_0x507cca);}};}function respondWithFilteredResult(_0x28b53c,_0x17edc5){return function(_0x106669){if(_0x106669){var _0x144624=typeof _0x17edc5[_0x90eb('0x1c')]===_0x90eb('0x1d')&&typeof _0x17edc5[_0x90eb('0x1e')]===_0x90eb('0x1d');var _0x1d3628=_0x106669[_0x90eb('0x1f')];var _0x12d974=_0x144624?0x0:_0x17edc5[_0x90eb('0x1c')];var _0x2761d7=_0x144624?_0x106669[_0x90eb('0x1f')]:_0x17edc5[_0x90eb('0x1c')]+_0x17edc5['limit'];var _0x33d535;if(_0x2761d7>=_0x1d3628){_0x2761d7=_0x1d3628;_0x33d535=0xc8;}else{_0x33d535=0xce;}_0x28b53c[_0x90eb('0x1b')](_0x33d535);return _0x28b53c[_0x90eb('0x20')](_0x90eb('0x21'),_0x12d974+'-'+_0x2761d7+'/'+_0x1d3628)[_0x90eb('0x22')](_0x106669);}return null;};}function patchUpdates(_0x38d2b0){return function(_0x141c4a){try{jsonpatch[_0x90eb('0x23')](_0x141c4a,_0x38d2b0,!![]);}catch(_0x16249d){return BPromise[_0x90eb('0x24')](_0x16249d);}return _0x141c4a[_0x90eb('0x25')]();};}function saveUpdates(_0x2be86b,_0x5afc12){return function(_0x18e367){if(_0x18e367){return _0x18e367[_0x90eb('0x26')](_0x2be86b)[_0x90eb('0x27')](function(_0x2390fb){return _0x2390fb;});}return null;};}function removeEntity(_0x25125e,_0x2e34f8){return function(_0x5c271a){if(_0x5c271a){return _0x5c271a['destroy']()['then'](function(){_0x25125e[_0x90eb('0x1b')](0xcc)[_0x90eb('0x1a')]();});}};}function handleEntityNotFound(_0x777cd4,_0x2d0b12){return function(_0x8de101){if(!_0x8de101){_0x777cd4[_0x90eb('0x19')](0x194);}return _0x8de101;};}function handleError(_0x3edfd0,_0x5883de){_0x5883de=_0x5883de||0x1f4;return function(_0x31a4f7){logger[_0x90eb('0x28')](_0x31a4f7[_0x90eb('0x29')]);if(_0x31a4f7[_0x90eb('0x2a')]){delete _0x31a4f7[_0x90eb('0x2a')];}_0x3edfd0[_0x90eb('0x1b')](_0x5883de)[_0x90eb('0x2b')](_0x31a4f7);};}exports['index']=function(_0x55c952,_0x5577df){var _0x337335={},_0xb56693={},_0x1588a1={'count':0x0,'rows':[]};var _0x2d2063=_[_0x90eb('0x2c')](db[_0x90eb('0x2d')][_0x90eb('0x2e')],function(_0x2f527d){return{'name':_0x2f527d[_0x90eb('0x2f')],'type':_0x2f527d[_0x90eb('0x30')][_0x90eb('0x31')]};});_0xb56693[_0x90eb('0x32')]=_[_0x90eb('0x2c')](_0x2d2063,_0x90eb('0x2a'));_0xb56693['query']=_[_0x90eb('0x33')](_0x55c952[_0x90eb('0x34')]);_0xb56693[_0x90eb('0x35')]=_[_0x90eb('0x36')](_0xb56693[_0x90eb('0x32')],_0xb56693['query']);_0x337335[_0x90eb('0x37')]=_[_0x90eb('0x36')](_0xb56693[_0x90eb('0x32')],qs['fields'](_0x55c952[_0x90eb('0x34')][_0x90eb('0x38')]));_0x337335['attributes']=_0x337335[_0x90eb('0x37')]['length']?_0x337335[_0x90eb('0x37')]:_0xb56693[_0x90eb('0x32')];if(!_0x55c952['query'][_0x90eb('0x39')]('nolimit')){_0x337335[_0x90eb('0x1e')]=qs[_0x90eb('0x1e')](_0x55c952['query'][_0x90eb('0x1e')]);_0x337335[_0x90eb('0x1c')]=qs[_0x90eb('0x1c')](_0x55c952['query'][_0x90eb('0x1c')]);}_0x337335[_0x90eb('0x3a')]=qs[_0x90eb('0x3b')](_0x55c952[_0x90eb('0x34')][_0x90eb('0x3b')]);_0x337335['where']=qs[_0x90eb('0x35')](_[_0x90eb('0x3c')](_0x55c952[_0x90eb('0x34')],_0xb56693['filters']),_0x2d2063);if(_0x55c952[_0x90eb('0x34')][_0x90eb('0x3d')]){_0x337335[_0x90eb('0x3e')]=_['merge'](_0x337335[_0x90eb('0x3e')],{'$or':_[_0x90eb('0x2c')](_0x2d2063,function(_0x5eac72){if(_0x5eac72[_0x90eb('0x30')]!=='VIRTUAL'){var _0x569695={};_0x569695[_0x5eac72[_0x90eb('0x2a')]]={'$like':'%'+_0x55c952[_0x90eb('0x34')][_0x90eb('0x3d')]+'%'};return _0x569695;}})});}_0x337335=_[_0x90eb('0x3f')]({},_0x337335,_0x55c952['options']);var _0x5f218a={'where':_0x337335['where']};return db[_0x90eb('0x2d')][_0x90eb('0x1f')](_0x5f218a)[_0x90eb('0x27')](function(_0x59d685){_0x1588a1[_0x90eb('0x1f')]=_0x59d685;if(_0x55c952[_0x90eb('0x34')][_0x90eb('0x40')]){_0x337335[_0x90eb('0x41')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x90eb('0x42')](_0x337335);})[_0x90eb('0x27')](function(_0x3737d0){_0x1588a1[_0x90eb('0x43')]=_0x3737d0;return _0x1588a1;})[_0x90eb('0x27')](respondWithFilteredResult(_0x5577df,_0x337335))[_0x90eb('0x44')](handleError(_0x5577df,null));};exports['show']=function(_0x364e11,_0x213132){var _0x5980d9={'raw':!![],'where':{'id':_0x364e11['params']['id']}},_0x29f81b={};_0x29f81b[_0x90eb('0x32')]=_[_0x90eb('0x33')](db[_0x90eb('0x2d')][_0x90eb('0x2e')]);_0x29f81b[_0x90eb('0x34')]=_[_0x90eb('0x33')](_0x364e11[_0x90eb('0x34')]);_0x29f81b['filters']=_['intersection'](_0x29f81b[_0x90eb('0x32')],_0x29f81b['query']);_0x5980d9[_0x90eb('0x37')]=_[_0x90eb('0x36')](_0x29f81b[_0x90eb('0x32')],qs[_0x90eb('0x38')](_0x364e11['query'][_0x90eb('0x38')]));_0x5980d9[_0x90eb('0x37')]=_0x5980d9[_0x90eb('0x37')][_0x90eb('0x45')]?_0x5980d9[_0x90eb('0x37')]:_0x29f81b['model'];if(_0x364e11[_0x90eb('0x34')][_0x90eb('0x40')]){_0x5980d9[_0x90eb('0x41')]=[{'all':!![]}];}_0x5980d9=_['merge']({},_0x5980d9,_0x364e11[_0x90eb('0x46')]);return db['FaxTransferReport'][_0x90eb('0x47')](_0x5980d9)[_0x90eb('0x27')](handleEntityNotFound(_0x213132,null))[_0x90eb('0x27')](respondWithResult(_0x213132,null))['catch'](handleError(_0x213132,null));};exports['create']=function(_0x5a954b,_0x3b03d7){return db[_0x90eb('0x2d')]['create'](_0x5a954b[_0x90eb('0x48')],{})['then'](respondWithResult(_0x3b03d7,0xc9))[_0x90eb('0x44')](handleError(_0x3b03d7,null));};exports['update']=function(_0x136d63,_0xf0bae3){if(_0x136d63[_0x90eb('0x48')]['id']){delete _0x136d63['body']['id'];}return db[_0x90eb('0x2d')][_0x90eb('0x47')]({'where':{'id':_0x136d63['params']['id']}})[_0x90eb('0x27')](handleEntityNotFound(_0xf0bae3,null))[_0x90eb('0x27')](saveUpdates(_0x136d63[_0x90eb('0x48')],null))[_0x90eb('0x27')](respondWithResult(_0xf0bae3,null))['catch'](handleError(_0xf0bae3,null));};exports['destroy']=function(_0x3d72a8,_0x4631aa){return db[_0x90eb('0x2d')][_0x90eb('0x47')]({'where':{'id':_0x3d72a8['params']['id']}})[_0x90eb('0x27')](handleEntityNotFound(_0x4631aa,null))[_0x90eb('0x27')](removeEntity(_0x4631aa,null))[_0x90eb('0x44')](handleError(_0x4631aa,null));};exports[_0x90eb('0x49')]=function(_0x5de044,_0x476a16){return db[_0x90eb('0x2d')][_0x90eb('0x49')]()[_0x90eb('0x27')](respondWithResult(_0x476a16,null))[_0x90eb('0x44')](handleError(_0x476a16,null));}; \ No newline at end of file +var _0xb922=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','catch','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','status','error','stack','name','send','index','map','rawAttributes','fieldName','type','model'];(function(_0x5b2250,_0x445f9d){var _0x10964d=function(_0x77d924){while(--_0x77d924){_0x5b2250['push'](_0x5b2250['shift']());}};_0x10964d(++_0x445f9d);}(_0xb922,0x152));var _0x2b92=function(_0xe2bb9e,_0x2629a9){_0xe2bb9e=_0xe2bb9e-0x0;var _0x43ba10=_0xb922[_0xe2bb9e];return _0x43ba10;};'use strict';var emlformat=require(_0x2b92('0x0'));var rimraf=require(_0x2b92('0x1'));var zipdir=require(_0x2b92('0x2'));var jsonpatch=require(_0x2b92('0x3'));var rp=require(_0x2b92('0x4'));var moment=require(_0x2b92('0x5'));var BPromise=require(_0x2b92('0x6'));var Mustache=require(_0x2b92('0x7'));var util=require(_0x2b92('0x8'));var path=require(_0x2b92('0x9'));var sox=require(_0x2b92('0xa'));var csv=require(_0x2b92('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b92('0xc'));var jsforce=require(_0x2b92('0xd'));var deskjs=require(_0x2b92('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2b92('0xf'));var Papa=require(_0x2b92('0x10'));var Redis=require(_0x2b92('0x11'));var authService=require(_0x2b92('0x12'));var qs=require(_0x2b92('0x13'));var as=require(_0x2b92('0x14'));var hardwareService=require(_0x2b92('0x15'));var logger=require(_0x2b92('0x16'))(_0x2b92('0x17'));var utils=require(_0x2b92('0x18'));var config=require(_0x2b92('0x19'));var licenseUtil=require(_0x2b92('0x1a'));var db=require(_0x2b92('0x1b'))['db'];function respondWithStatusCode(_0x25eeca,_0x561445){_0x561445=_0x561445||0xcc;return function(_0xf99cb3){if(_0xf99cb3){return _0x25eeca['sendStatus'](_0x561445);}return _0x25eeca['status'](_0x561445)[_0x2b92('0x1c')]();};}function respondWithResult(_0x4d1539,_0x5ab7a8){_0x5ab7a8=_0x5ab7a8||0xc8;return function(_0x5ee3eb){if(_0x5ee3eb){return _0x4d1539['status'](_0x5ab7a8)[_0x2b92('0x1d')](_0x5ee3eb);}};}function respondWithFilteredResult(_0x39d029,_0x12a192){return function(_0x347f5e){if(_0x347f5e){var _0x72d9c2=typeof _0x12a192[_0x2b92('0x1e')]===_0x2b92('0x1f')&&typeof _0x12a192['limit']===_0x2b92('0x1f');var _0x13d335=_0x347f5e[_0x2b92('0x20')];var _0x19a649=_0x72d9c2?0x0:_0x12a192[_0x2b92('0x1e')];var _0x2bad96=_0x72d9c2?_0x347f5e[_0x2b92('0x20')]:_0x12a192['offset']+_0x12a192[_0x2b92('0x21')];var _0x1ee3d6;if(_0x2bad96>=_0x13d335){_0x2bad96=_0x13d335;_0x1ee3d6=0xc8;}else{_0x1ee3d6=0xce;}_0x39d029['status'](_0x1ee3d6);return _0x39d029[_0x2b92('0x22')](_0x2b92('0x23'),_0x19a649+'-'+_0x2bad96+'/'+_0x13d335)['json'](_0x347f5e);}return null;};}function patchUpdates(_0x1f76ee){return function(_0x38cb74){try{jsonpatch[_0x2b92('0x24')](_0x38cb74,_0x1f76ee,!![]);}catch(_0x49c181){return BPromise[_0x2b92('0x25')](_0x49c181);}return _0x38cb74[_0x2b92('0x26')]();};}function saveUpdates(_0x4308e1,_0xd9223c){return function(_0x12562c){if(_0x12562c){return _0x12562c['update'](_0x4308e1)[_0x2b92('0x27')](function(_0x26d390){return _0x26d390;});}return null;};}function removeEntity(_0x352969,_0x30ba1a){return function(_0x28de1a){if(_0x28de1a){return _0x28de1a[_0x2b92('0x28')]()[_0x2b92('0x27')](function(){_0x352969[_0x2b92('0x29')](0xcc)[_0x2b92('0x1c')]();});}};}function handleEntityNotFound(_0x778087,_0x236e16){return function(_0xc920ec){if(!_0xc920ec){_0x778087['sendStatus'](0x194);}return _0xc920ec;};}function handleError(_0x18ed04,_0x1e3c29){_0x1e3c29=_0x1e3c29||0x1f4;return function(_0x533472){logger[_0x2b92('0x2a')](_0x533472[_0x2b92('0x2b')]);if(_0x533472[_0x2b92('0x2c')]){delete _0x533472[_0x2b92('0x2c')];}_0x18ed04[_0x2b92('0x29')](_0x1e3c29)[_0x2b92('0x2d')](_0x533472);};}exports[_0x2b92('0x2e')]=function(_0x13743e,_0x49490b){var _0x1249b6={},_0x25bcb8={},_0x48b78e={'count':0x0,'rows':[]};var _0x31e5eb=_[_0x2b92('0x2f')](db['FaxTransferReport'][_0x2b92('0x30')],function(_0x2ceb41){return{'name':_0x2ceb41[_0x2b92('0x31')],'type':_0x2ceb41[_0x2b92('0x32')]['key']};});_0x25bcb8[_0x2b92('0x33')]=_[_0x2b92('0x2f')](_0x31e5eb,_0x2b92('0x2c'));_0x25bcb8[_0x2b92('0x34')]=_[_0x2b92('0x35')](_0x13743e['query']);_0x25bcb8['filters']=_[_0x2b92('0x36')](_0x25bcb8['model'],_0x25bcb8[_0x2b92('0x34')]);_0x1249b6[_0x2b92('0x37')]=_[_0x2b92('0x36')](_0x25bcb8['model'],qs[_0x2b92('0x38')](_0x13743e[_0x2b92('0x34')]['fields']));_0x1249b6[_0x2b92('0x37')]=_0x1249b6[_0x2b92('0x37')][_0x2b92('0x39')]?_0x1249b6[_0x2b92('0x37')]:_0x25bcb8[_0x2b92('0x33')];if(!_0x13743e['query'][_0x2b92('0x3a')](_0x2b92('0x3b'))){_0x1249b6['limit']=qs['limit'](_0x13743e[_0x2b92('0x34')][_0x2b92('0x21')]);_0x1249b6['offset']=qs[_0x2b92('0x1e')](_0x13743e[_0x2b92('0x34')][_0x2b92('0x1e')]);}_0x1249b6['order']=qs['sort'](_0x13743e[_0x2b92('0x34')]['sort']);_0x1249b6[_0x2b92('0x3c')]=qs[_0x2b92('0x3d')](_[_0x2b92('0x3e')](_0x13743e['query'],_0x25bcb8[_0x2b92('0x3d')]),_0x31e5eb);if(_0x13743e[_0x2b92('0x34')]['filter']){_0x1249b6[_0x2b92('0x3c')]=_[_0x2b92('0x3f')](_0x1249b6[_0x2b92('0x3c')],{'$or':_[_0x2b92('0x2f')](_0x31e5eb,function(_0x556396){if(_0x556396['type']!==_0x2b92('0x40')){var _0x1ef2a9={};_0x1ef2a9[_0x556396['name']]={'$like':'%'+_0x13743e[_0x2b92('0x34')]['filter']+'%'};return _0x1ef2a9;}})});}_0x1249b6=_[_0x2b92('0x3f')]({},_0x1249b6,_0x13743e[_0x2b92('0x41')]);var _0x3b1450={'where':_0x1249b6[_0x2b92('0x3c')]};return db[_0x2b92('0x42')]['count'](_0x3b1450)[_0x2b92('0x27')](function(_0x2652f7){_0x48b78e['count']=_0x2652f7;if(_0x13743e[_0x2b92('0x34')][_0x2b92('0x43')]){_0x1249b6[_0x2b92('0x44')]=[{'all':!![]}];}return db[_0x2b92('0x42')][_0x2b92('0x45')](_0x1249b6);})['then'](function(_0x9168f4){_0x48b78e[_0x2b92('0x46')]=_0x9168f4;return _0x48b78e;})[_0x2b92('0x27')](respondWithFilteredResult(_0x49490b,_0x1249b6))[_0x2b92('0x47')](handleError(_0x49490b,null));};exports['show']=function(_0x48d5a4,_0x4a96b6){var _0x290afa={'raw':!![],'where':{'id':_0x48d5a4['params']['id']}},_0x438da3={};_0x438da3[_0x2b92('0x33')]=_[_0x2b92('0x35')](db['FaxTransferReport'][_0x2b92('0x30')]);_0x438da3['query']=_['keys'](_0x48d5a4['query']);_0x438da3[_0x2b92('0x3d')]=_[_0x2b92('0x36')](_0x438da3[_0x2b92('0x33')],_0x438da3[_0x2b92('0x34')]);_0x290afa[_0x2b92('0x37')]=_[_0x2b92('0x36')](_0x438da3[_0x2b92('0x33')],qs['fields'](_0x48d5a4[_0x2b92('0x34')][_0x2b92('0x38')]));_0x290afa[_0x2b92('0x37')]=_0x290afa[_0x2b92('0x37')][_0x2b92('0x39')]?_0x290afa['attributes']:_0x438da3['model'];if(_0x48d5a4['query']['includeAll']){_0x290afa[_0x2b92('0x44')]=[{'all':!![]}];}_0x290afa=_[_0x2b92('0x3f')]({},_0x290afa,_0x48d5a4[_0x2b92('0x41')]);return db[_0x2b92('0x42')][_0x2b92('0x48')](_0x290afa)[_0x2b92('0x27')](handleEntityNotFound(_0x4a96b6,null))[_0x2b92('0x27')](respondWithResult(_0x4a96b6,null))['catch'](handleError(_0x4a96b6,null));};exports[_0x2b92('0x49')]=function(_0x370563,_0x464dcb){return db[_0x2b92('0x42')][_0x2b92('0x49')](_0x370563['body'],{})[_0x2b92('0x27')](respondWithResult(_0x464dcb,0xc9))[_0x2b92('0x47')](handleError(_0x464dcb,null));};exports[_0x2b92('0x4a')]=function(_0x504e96,_0x203a6e){if(_0x504e96[_0x2b92('0x4b')]['id']){delete _0x504e96[_0x2b92('0x4b')]['id'];}return db[_0x2b92('0x42')]['find']({'where':{'id':_0x504e96[_0x2b92('0x4c')]['id']}})[_0x2b92('0x27')](handleEntityNotFound(_0x203a6e,null))[_0x2b92('0x27')](saveUpdates(_0x504e96['body'],null))[_0x2b92('0x27')](respondWithResult(_0x203a6e,null))[_0x2b92('0x47')](handleError(_0x203a6e,null));};exports[_0x2b92('0x28')]=function(_0x26c8ad,_0x42d848){return db[_0x2b92('0x42')][_0x2b92('0x48')]({'where':{'id':_0x26c8ad[_0x2b92('0x4c')]['id']}})[_0x2b92('0x27')](handleEntityNotFound(_0x42d848,null))[_0x2b92('0x27')](removeEntity(_0x42d848,null))[_0x2b92('0x47')](handleError(_0x42d848,null));};exports[_0x2b92('0x4d')]=function(_0x41593e,_0x1191c1){return db[_0x2b92('0x42')]['describe']()[_0x2b92('0x27')](respondWithResult(_0x1191c1,null))[_0x2b92('0x47')](handleError(_0x1191c1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index bc5bc9e..bfa0e56 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 _0x1fed=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','uniqueid','lodash'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1fed,0x1d3));var _0xd1fe=function(_0x171de5,_0x260fd1){_0x171de5=_0x171de5-0x0;var _0x1c2d68=_0x1fed[_0x171de5];return _0x1c2d68;};'use strict';var _=require(_0xd1fe('0x0'));var util=require('util');var logger=require(_0xd1fe('0x1'))(_0xd1fe('0x2'));var moment=require(_0xd1fe('0x3'));var BPromise=require(_0xd1fe('0x4'));var rp=require(_0xd1fe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1fe('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0xd1fe('0x7')]=function(_0x352f93,_0x4f194d){return _0x352f93['define']('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xd1fe('0x8'),'fields':[_0xd1fe('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a03=['bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x3dfa44,_0x46f060){var _0x18acc1=function(_0xa43aae){while(--_0xa43aae){_0x3dfa44['push'](_0x3dfa44['shift']());}};_0x18acc1(++_0x46f060);}(_0x5a03,0x1a8));var _0x35a0=function(_0x2cfd2e,_0x3ed803){_0x2cfd2e=_0x2cfd2e-0x0;var _0x371885=_0x5a03[_0x2cfd2e];return _0x371885;};'use strict';var _=require(_0x35a0('0x0'));var util=require(_0x35a0('0x1'));var logger=require(_0x35a0('0x2'))(_0x35a0('0x3'));var moment=require(_0x35a0('0x4'));var BPromise=require(_0x35a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35a0('0x6'));var rimraf=require(_0x35a0('0x7'));var config=require(_0x35a0('0x8'));var attributes=require(_0x35a0('0x9'));module[_0x35a0('0xa')]=function(_0x1d38ea,_0x16af78){return _0x1d38ea['define'](_0x35a0('0xb'),attributes,{'tableName':_0x35a0('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index aaa0299..fa93353 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 _0x8170=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash'];(function(_0x575fc8,_0x44f8bd){var _0x3af95f=function(_0x370ece){while(--_0x370ece){_0x575fc8['push'](_0x575fc8['shift']());}};_0x3af95f(++_0x44f8bd);}(_0x8170,0x1b4));var _0x0817=function(_0x55e7bf,_0x562619){_0x55e7bf=_0x55e7bf-0x0;var _0x5df4b5=_0x8170[_0x55e7bf];return _0x5df4b5;};'use strict';var _=require(_0x0817('0x0'));var util=require(_0x0817('0x1'));var moment=require(_0x0817('0x2'));var BPromise=require(_0x0817('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0817('0x4'));var db=require(_0x0817('0x5'))['db'];var utils=require(_0x0817('0x6'));var logger=require(_0x0817('0x7'))('rpc');var config=require(_0x0817('0x8'));var jayson=require(_0x0817('0x9'));var client=jayson[_0x0817('0xa')][_0x0817('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59c440,_0x54bf3a,_0x3d7ca9){return new BPromise(function(_0x573560,_0x198630){return client['request'](_0x59c440,_0x3d7ca9)[_0x0817('0xc')](function(_0x4c8aca){logger[_0x0817('0xd')](_0x0817('0xe'),_0x54bf3a,_0x0817('0xf'));logger[_0x0817('0x10')](_0x0817('0x11'),_0x54bf3a,_0x0817('0xf'),JSON[_0x0817('0x12')](_0x4c8aca));if(_0x4c8aca['error']){if(_0x4c8aca['error'][_0x0817('0x13')]===0x1f4){logger[_0x0817('0x14')](_0x0817('0xe'),_0x54bf3a,_0x4c8aca[_0x0817('0x14')][_0x0817('0x15')]);return _0x198630(_0x4c8aca[_0x0817('0x14')][_0x0817('0x15')]);}logger[_0x0817('0x14')](_0x0817('0xe'),_0x54bf3a,_0x4c8aca[_0x0817('0x14')]['message']);return _0x573560(_0x4c8aca[_0x0817('0x14')][_0x0817('0x15')]);}else{logger[_0x0817('0xd')](_0x0817('0xe'),_0x54bf3a,_0x0817('0xf'));_0x573560(_0x4c8aca['result'][_0x0817('0x15')]);}})[_0x0817('0x16')](function(_0x970ff2){logger[_0x0817('0x14')](_0x0817('0xe'),_0x54bf3a,_0x970ff2);_0x198630(_0x970ff2);});});} \ No newline at end of file +var _0x1736=['randomstring','ioredis','../../config/utils','rpc','client','http','request','then','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','bluebird'];(function(_0x5ea3f7,_0x397469){var _0x453b59=function(_0x163fa1){while(--_0x163fa1){_0x5ea3f7['push'](_0x5ea3f7['shift']());}};_0x453b59(++_0x397469);}(_0x1736,0x1dd));var _0x6173=function(_0x28f18d,_0x36cb5a){_0x28f18d=_0x28f18d-0x0;var _0x444890=_0x1736[_0x28f18d];return _0x444890;};'use strict';var _=require(_0x6173('0x0'));var util=require(_0x6173('0x1'));var moment=require('moment');var BPromise=require(_0x6173('0x2'));var rs=require(_0x6173('0x3'));var fs=require('fs');var Redis=require(_0x6173('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6173('0x5'));var logger=require('../../config/logger')(_0x6173('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6173('0x7')][_0x6173('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c9ff4,_0x112808,_0x56d868){return new BPromise(function(_0x15dfd1,_0x2c1ec7){return client[_0x6173('0x9')](_0x1c9ff4,_0x56d868)[_0x6173('0xa')](function(_0x1bc5ce){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x112808,_0x6173('0xb'));logger['debug'](_0x6173('0xc'),_0x112808,_0x6173('0xb'),JSON[_0x6173('0xd')](_0x1bc5ce));if(_0x1bc5ce[_0x6173('0xe')]){if(_0x1bc5ce[_0x6173('0xe')][_0x6173('0xf')]===0x1f4){logger['error'](_0x6173('0x10'),_0x112808,_0x1bc5ce[_0x6173('0xe')][_0x6173('0x11')]);return _0x2c1ec7(_0x1bc5ce[_0x6173('0xe')][_0x6173('0x11')]);}logger[_0x6173('0xe')](_0x6173('0x10'),_0x112808,_0x1bc5ce[_0x6173('0xe')]['message']);return _0x15dfd1(_0x1bc5ce['error'][_0x6173('0x11')]);}else{logger[_0x6173('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x112808,_0x6173('0xb'));_0x15dfd1(_0x1bc5ce[_0x6173('0x13')]['message']);}})['catch'](function(_0xb3fa2e){logger['error'](_0x6173('0x10'),_0x112808,_0xb3fa2e);_0x2c1ec7(_0xb3fa2e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 089fb3b..5ddc6c7 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 _0xc130=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','/:id','post','create'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0xc130,0x1e7));var _0x0c13=function(_0x20e254,_0x2386a7){_0x20e254=_0x20e254-0x0;var _0x359aed=_0xc130[_0x20e254];return _0x359aed;};'use strict';var multer=require(_0x0c13('0x0'));var util=require(_0x0c13('0x1'));var path=require(_0x0c13('0x2'));var timeout=require(_0x0c13('0x3'));var express=require(_0x0c13('0x4'));var router=express[_0x0c13('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0c13('0x6'));var interaction=require(_0x0c13('0x7'));var config=require(_0x0c13('0x8'));var controller=require(_0x0c13('0x9'));router['get']('/',auth[_0x0c13('0xa')](),controller[_0x0c13('0xb')]);router[_0x0c13('0xc')](_0x0c13('0xd'),auth[_0x0c13('0xa')](),controller['describe']);router[_0x0c13('0xc')](_0x0c13('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x0c13('0xf')]('/',auth[_0x0c13('0xa')](),controller[_0x0c13('0x10')]);router[_0x0c13('0x11')](_0x0c13('0xe'),auth[_0x0c13('0xa')](),controller[_0x0c13('0x12')]);router['delete'](_0x0c13('0xe'),auth[_0x0c13('0xa')](),controller[_0x0c13('0x13')]);module[_0x0c13('0x14')]=router; \ No newline at end of file +var _0xf1ff=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','delete','exports','multer','path','express','fs-extra'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0xf1ff,0x84));var _0xff1f=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xf1ff[_0x540133];return _0x26b6e9;};'use strict';var multer=require(_0xff1f('0x0'));var util=require('util');var path=require(_0xff1f('0x1'));var timeout=require('connect-timeout');var express=require(_0xff1f('0x2'));var router=express['Router']();var fs_extra=require(_0xff1f('0x3'));var auth=require(_0xff1f('0x4'));var interaction=require(_0xff1f('0x5'));var config=require(_0xff1f('0x6'));var controller=require(_0xff1f('0x7'));router['get']('/',auth[_0xff1f('0x8')](),controller[_0xff1f('0x9')]);router[_0xff1f('0xa')](_0xff1f('0xb'),auth[_0xff1f('0x8')](),controller['describe']);router[_0xff1f('0xa')](_0xff1f('0xc'),auth[_0xff1f('0x8')](),controller[_0xff1f('0xd')]);router[_0xff1f('0xe')]('/',auth[_0xff1f('0x8')](),controller['create']);router['put'](_0xff1f('0xc'),auth[_0xff1f('0x8')](),controller['update']);router[_0xff1f('0xf')](_0xff1f('0xc'),auth[_0xff1f('0x8')](),controller['destroy']);module[_0xff1f('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index cee7c07..0ec22a0 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 _0xda52=['put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xda52,0x124));var _0x2da5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xda52[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x2da5('0x0'));var path=require(_0x2da5('0x1'));var timeout=require('connect-timeout');var express=require(_0x2da5('0x2'));var router=express[_0x2da5('0x3')]();var fs_extra=require(_0x2da5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2da5('0x5'));var config=require(_0x2da5('0x6'));var controller=require(_0x2da5('0x7'));router['get']('/',auth[_0x2da5('0x8')](),controller[_0x2da5('0x9')]);router[_0x2da5('0xa')](_0x2da5('0xb'),auth['isAuthenticated'](),controller[_0x2da5('0xc')]);router[_0x2da5('0xa')](_0x2da5('0xd'),auth[_0x2da5('0x8')](),controller[_0x2da5('0xe')]);router[_0x2da5('0xa')](_0x2da5('0xf'),auth[_0x2da5('0x8')](),controller[_0x2da5('0x10')]);router[_0x2da5('0x11')]('/',auth[_0x2da5('0x8')](),controller[_0x2da5('0x12')]);router['post'](_0x2da5('0xd'),auth[_0x2da5('0x8')](),controller[_0x2da5('0x13')]);router[_0x2da5('0x14')](_0x2da5('0xb'),auth[_0x2da5('0x8')](),controller['update']);router[_0x2da5('0x15')]('/:id',auth[_0x2da5('0x8')](),controller[_0x2da5('0x16')]);module[_0x2da5('0x17')]=router; \ No newline at end of file +var _0x4011=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','post','create','addConfiguration','put'];(function(_0x24df34,_0x50aa1a){var _0x3980e8=function(_0x24c43f){while(--_0x24c43f){_0x24df34['push'](_0x24df34['shift']());}};_0x3980e8(++_0x50aa1a);}(_0x4011,0x1a5));var _0x1401=function(_0x51b19b,_0x5015d2){_0x51b19b=_0x51b19b-0x0;var _0x1a3cd6=_0x4011[_0x51b19b];return _0x1a3cd6;};'use strict';var multer=require(_0x1401('0x0'));var util=require(_0x1401('0x1'));var path=require(_0x1401('0x2'));var timeout=require(_0x1401('0x3'));var express=require(_0x1401('0x4'));var router=express['Router']();var fs_extra=require(_0x1401('0x5'));var auth=require(_0x1401('0x6'));var interaction=require(_0x1401('0x7'));var config=require('../../config/environment');var controller=require(_0x1401('0x8'));router['get']('/',auth[_0x1401('0x9')](),controller[_0x1401('0xa')]);router[_0x1401('0xb')](_0x1401('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1401('0xb')](_0x1401('0xd'),auth[_0x1401('0x9')](),controller[_0x1401('0xe')]);router[_0x1401('0xb')]('/:id/fields',auth[_0x1401('0x9')](),controller['getFields']);router[_0x1401('0xf')]('/',auth[_0x1401('0x9')](),controller[_0x1401('0x10')]);router[_0x1401('0xf')](_0x1401('0xd'),auth[_0x1401('0x9')](),controller[_0x1401('0x11')]);router[_0x1401('0x12')](_0x1401('0xc'),auth[_0x1401('0x9')](),controller[_0x1401('0x13')]);router[_0x1401('0x14')](_0x1401('0xc'),auth[_0x1401('0x9')](),controller[_0x1401('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 7cfe920..d73761d 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 _0xfc49=['integrationTab','newTab','sequelize','STRING','ENUM','basic'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xfc49,0x128));var _0x9fc4=function(_0x314487,_0x1deac1){_0x314487=_0x314487-0x0;var _0x1c5134=_0xfc49[_0x314487];return _0x1c5134;};'use strict';var Sequelize=require(_0x9fc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x9fc4('0x1')]},'description':{'type':Sequelize[_0x9fc4('0x1')]},'username':{'type':Sequelize[_0x9fc4('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x9fc4('0x2')](_0x9fc4('0x3')),'defaultValue':_0x9fc4('0x3')},'password':{'type':Sequelize[_0x9fc4('0x1')]},'consumerKey':{'type':Sequelize[_0x9fc4('0x1')]},'consumerSecret':{'type':Sequelize[_0x9fc4('0x1')]},'token':{'type':Sequelize[_0x9fc4('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9fc4('0x2')](_0x9fc4('0x4'),_0x9fc4('0x5')),'defaultValue':_0x9fc4('0x4')}}; \ No newline at end of file +var _0xcd1b=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x588bda,_0x825cdb){var _0x476748=function(_0x4d40af){while(--_0x4d40af){_0x588bda['push'](_0x588bda['shift']());}};_0x476748(++_0x825cdb);}(_0xcd1b,0xa3));var _0xbcd1=function(_0x20b117,_0x45f3b6){_0x20b117=_0x20b117-0x0;var _0x321e68=_0xcd1b[_0x20b117];return _0x321e68;};'use strict';var Sequelize=require(_0xbcd1('0x0'));module[_0xbcd1('0x1')]={'name':{'type':Sequelize[_0xbcd1('0x2')]},'description':{'type':Sequelize[_0xbcd1('0x2')]},'username':{'type':Sequelize[_0xbcd1('0x2')]},'remoteUri':{'type':Sequelize[_0xbcd1('0x2')]},'authType':{'type':Sequelize[_0xbcd1('0x3')](_0xbcd1('0x4')),'defaultValue':_0xbcd1('0x4')},'password':{'type':Sequelize[_0xbcd1('0x2')]},'consumerKey':{'type':Sequelize[_0xbcd1('0x2')]},'consumerSecret':{'type':Sequelize[_0xbcd1('0x2')]},'token':{'type':Sequelize[_0xbcd1('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbcd1('0x5'),_0xbcd1('0x6')),'defaultValue':_0xbcd1('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 869b42a..ae16083 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 _0xc249=['password','toString','entries','active','label','test','statusCode','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../components/integrations/configuration','sendStatus','offset','undefined','limit','count','status','set','reject','update','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','destroy','find','getConfigurations','findOne','DeskConfiguration','pick','filter','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','DeskField','Subjects','getFields','priority','remoteUri','authType','username','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s'];(function(_0x4ec42,_0x36177b){var _0x385e11=function(_0x44e535){while(--_0x44e535){_0x4ec42['push'](_0x4ec42['shift']());}};_0x385e11(++_0x36177b);}(_0xc249,0x76));var _0x9c24=function(_0x557fe3,_0x1fdff7){_0x557fe3=_0x557fe3-0x0;var _0x203c68=_0xc249[_0x557fe3];return _0x203c68;};'use strict';var emlformat=require(_0x9c24('0x0'));var rimraf=require(_0x9c24('0x1'));var zipdir=require(_0x9c24('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c24('0x3'));var moment=require(_0x9c24('0x4'));var BPromise=require(_0x9c24('0x5'));var Mustache=require(_0x9c24('0x6'));var util=require(_0x9c24('0x7'));var path=require(_0x9c24('0x8'));var sox=require(_0x9c24('0x9'));var csv=require(_0x9c24('0xa'));var ejs=require(_0x9c24('0xb'));var fs=require('fs');var fs_extra=require(_0x9c24('0xc'));var _=require(_0x9c24('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9c24('0xe'));var deskjs=require(_0x9c24('0xf'));var toCsv=require(_0x9c24('0xa'));var querystring=require(_0x9c24('0x10'));var Papa=require(_0x9c24('0x11'));var Redis=require(_0x9c24('0x12'));var authService=require(_0x9c24('0x13'));var qs=require(_0x9c24('0x14'));var as=require(_0x9c24('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9c24('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9c24('0x17'));function respondWithStatusCode(_0x19cb4e,_0x21fa19){_0x21fa19=_0x21fa19||0xcc;return function(_0x5ef726){if(_0x5ef726){return _0x19cb4e[_0x9c24('0x18')](_0x21fa19);}return _0x19cb4e['status'](_0x21fa19)['end']();};}function respondWithResult(_0x1db8a7,_0x5c305f){_0x5c305f=_0x5c305f||0xc8;return function(_0x171f4f){if(_0x171f4f){return _0x1db8a7['status'](_0x5c305f)['json'](_0x171f4f);}};}function respondWithFilteredResult(_0x21c80a,_0x5c966d){return function(_0x10eab9){if(_0x10eab9){var _0x105468=typeof _0x5c966d[_0x9c24('0x19')]===_0x9c24('0x1a')&&typeof _0x5c966d[_0x9c24('0x1b')]===_0x9c24('0x1a');var _0x3d81ed=_0x10eab9[_0x9c24('0x1c')];var _0x20d1f2=_0x105468?0x0:_0x5c966d[_0x9c24('0x19')];var _0x5f1a54=_0x105468?_0x10eab9['count']:_0x5c966d[_0x9c24('0x19')]+_0x5c966d[_0x9c24('0x1b')];var _0x39d53f;if(_0x5f1a54>=_0x3d81ed){_0x5f1a54=_0x3d81ed;_0x39d53f=0xc8;}else{_0x39d53f=0xce;}_0x21c80a[_0x9c24('0x1d')](_0x39d53f);return _0x21c80a[_0x9c24('0x1e')]('Content-Range',_0x20d1f2+'-'+_0x5f1a54+'/'+_0x3d81ed)['json'](_0x10eab9);}return null;};}function patchUpdates(_0x13c438){return function(_0xb51f3){try{jsonpatch['apply'](_0xb51f3,_0x13c438,!![]);}catch(_0x18cec0){return BPromise[_0x9c24('0x1f')](_0x18cec0);}return _0xb51f3['save']();};}function saveUpdates(_0x1c85c9,_0x1abda4){return function(_0x47f110){if(_0x47f110){return _0x47f110[_0x9c24('0x20')](_0x1c85c9)[_0x9c24('0x21')](function(_0xdaffa9){return _0xdaffa9;});}return null;};}function removeEntity(_0x1d4b44,_0x447cf2){return function(_0x59fff1){if(_0x59fff1){return _0x59fff1['destroy']()['then'](function(){_0x1d4b44[_0x9c24('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37155f,_0x489264){return function(_0x57b314){if(!_0x57b314){_0x37155f[_0x9c24('0x18')](0x194);}return _0x57b314;};}function handleError(_0xaff592,_0x416693){_0x416693=_0x416693||0x1f4;return function(_0x33f2f3){logger[_0x9c24('0x22')](_0x33f2f3[_0x9c24('0x23')]);if(_0x33f2f3[_0x9c24('0x24')]){delete _0x33f2f3[_0x9c24('0x24')];}_0xaff592['status'](_0x416693)[_0x9c24('0x25')](_0x33f2f3);};}exports[_0x9c24('0x26')]=function(_0x399f31,_0x417be4){var _0x302125={},_0x6de98e={},_0x14f9b7={'count':0x0,'rows':[]};var _0x124b6b=_[_0x9c24('0x27')](db[_0x9c24('0x28')][_0x9c24('0x29')],function(_0x77b0a6){return{'name':_0x77b0a6['fieldName'],'type':_0x77b0a6[_0x9c24('0x2a')][_0x9c24('0x2b')]};});_0x6de98e[_0x9c24('0x2c')]=_[_0x9c24('0x27')](_0x124b6b,_0x9c24('0x24'));_0x6de98e[_0x9c24('0x2d')]=_[_0x9c24('0x2e')](_0x399f31[_0x9c24('0x2d')]);_0x6de98e[_0x9c24('0x2f')]=_[_0x9c24('0x30')](_0x6de98e[_0x9c24('0x2c')],_0x6de98e['query']);_0x302125['attributes']=_[_0x9c24('0x30')](_0x6de98e['model'],qs[_0x9c24('0x31')](_0x399f31[_0x9c24('0x2d')][_0x9c24('0x31')]));_0x302125[_0x9c24('0x32')]=_0x302125[_0x9c24('0x32')][_0x9c24('0x33')]?_0x302125[_0x9c24('0x32')]:_0x6de98e[_0x9c24('0x2c')];if(!_0x399f31[_0x9c24('0x2d')][_0x9c24('0x34')](_0x9c24('0x35'))){_0x302125[_0x9c24('0x1b')]=qs[_0x9c24('0x1b')](_0x399f31['query'][_0x9c24('0x1b')]);_0x302125['offset']=qs[_0x9c24('0x19')](_0x399f31[_0x9c24('0x2d')][_0x9c24('0x19')]);}_0x302125[_0x9c24('0x36')]=qs[_0x9c24('0x37')](_0x399f31[_0x9c24('0x2d')][_0x9c24('0x37')]);_0x302125[_0x9c24('0x38')]=qs[_0x9c24('0x2f')](_['pick'](_0x399f31[_0x9c24('0x2d')],_0x6de98e['filters']),_0x124b6b);if(_0x399f31[_0x9c24('0x2d')]['filter']){_0x302125['where']=_[_0x9c24('0x39')](_0x302125['where'],{'$or':_[_0x9c24('0x27')](_0x124b6b,function(_0xb5a903){if(_0xb5a903['type']!==_0x9c24('0x3a')){var _0x3c32c0={};_0x3c32c0[_0xb5a903['name']]={'$like':'%'+_0x399f31[_0x9c24('0x2d')]['filter']+'%'};return _0x3c32c0;}})});}_0x302125=_['merge']({},_0x302125,_0x399f31[_0x9c24('0x3b')]);var _0x5b3e3b={'where':_0x302125[_0x9c24('0x38')]};return db[_0x9c24('0x28')][_0x9c24('0x1c')](_0x5b3e3b)[_0x9c24('0x21')](function(_0xea55f7){_0x14f9b7[_0x9c24('0x1c')]=_0xea55f7;if(_0x399f31['query'][_0x9c24('0x3c')]){_0x302125['include']=[{'all':!![]}];}return db[_0x9c24('0x28')]['findAll'](_0x302125);})[_0x9c24('0x21')](function(_0x48f342){_0x14f9b7[_0x9c24('0x3d')]=_0x48f342;return _0x14f9b7;})[_0x9c24('0x21')](respondWithFilteredResult(_0x417be4,_0x302125))[_0x9c24('0x3e')](handleError(_0x417be4,null));};exports[_0x9c24('0x3f')]=function(_0x317090,_0x16061c){var _0x3f928f={'raw':![],'where':{'id':_0x317090[_0x9c24('0x40')]['id']}},_0x421261={};_0x421261[_0x9c24('0x2c')]=_[_0x9c24('0x2e')](db['DeskAccount'][_0x9c24('0x29')]);_0x421261[_0x9c24('0x2d')]=_[_0x9c24('0x2e')](_0x317090[_0x9c24('0x2d')]);_0x421261[_0x9c24('0x2f')]=_[_0x9c24('0x30')](_0x421261[_0x9c24('0x2c')],_0x421261[_0x9c24('0x2d')]);_0x3f928f['attributes']=_['intersection'](_0x421261[_0x9c24('0x2c')],qs[_0x9c24('0x31')](_0x317090['query'][_0x9c24('0x31')]));_0x3f928f['attributes']=_0x3f928f[_0x9c24('0x32')]['length']?_0x3f928f[_0x9c24('0x32')]:_0x421261[_0x9c24('0x2c')];if(_0x317090[_0x9c24('0x2d')]['includeAll']){_0x3f928f[_0x9c24('0x41')]=[{'all':!![]}];}_0x3f928f=_[_0x9c24('0x39')]({},_0x3f928f,_0x317090[_0x9c24('0x3b')]);return db[_0x9c24('0x28')]['find'](_0x3f928f)[_0x9c24('0x21')](handleEntityNotFound(_0x16061c,null))[_0x9c24('0x21')](respondWithResult(_0x16061c,null))['catch'](handleError(_0x16061c,null));};exports[_0x9c24('0x42')]=function(_0x548a92,_0x3a0663){return db[_0x9c24('0x28')][_0x9c24('0x42')](_0x548a92['body'],{})['then'](respondWithResult(_0x3a0663,0xc9))[_0x9c24('0x3e')](handleError(_0x3a0663,null));};exports[_0x9c24('0x20')]=function(_0x47e3a0,_0x211284){if(_0x47e3a0['body']['id']){delete _0x47e3a0[_0x9c24('0x43')]['id'];}return db[_0x9c24('0x28')]['find']({'where':{'id':_0x47e3a0[_0x9c24('0x40')]['id']}})[_0x9c24('0x21')](handleEntityNotFound(_0x211284,null))[_0x9c24('0x21')](saveUpdates(_0x47e3a0[_0x9c24('0x43')],null))[_0x9c24('0x21')](respondWithResult(_0x211284,null))['catch'](handleError(_0x211284,null));};exports[_0x9c24('0x44')]=function(_0x29ff13,_0x179386){return db['DeskAccount'][_0x9c24('0x45')]({'where':{'id':_0x29ff13[_0x9c24('0x40')]['id']}})['then'](handleEntityNotFound(_0x179386,null))['then'](removeEntity(_0x179386,null))['catch'](handleError(_0x179386,null));};exports[_0x9c24('0x46')]=function(_0x342d49,_0x358dd5,_0x47cce9){var _0x25c22c={};var _0x36a80f={};var _0x25899e;var _0x33ff54;return db[_0x9c24('0x28')][_0x9c24('0x47')]({'where':{'id':_0x342d49['params']['id']}})[_0x9c24('0x21')](handleEntityNotFound(_0x358dd5,null))[_0x9c24('0x21')](function(_0x1e3e51){if(_0x1e3e51){_0x25899e=_0x1e3e51;_0x36a80f['model']=_[_0x9c24('0x2e')](db[_0x9c24('0x48')][_0x9c24('0x29')]);_0x36a80f[_0x9c24('0x2d')]=_[_0x9c24('0x2e')](_0x342d49[_0x9c24('0x2d')]);_0x36a80f[_0x9c24('0x2f')]=_[_0x9c24('0x30')](_0x36a80f[_0x9c24('0x2c')],_0x36a80f[_0x9c24('0x2d')]);_0x25c22c[_0x9c24('0x32')]=_[_0x9c24('0x30')](_0x36a80f[_0x9c24('0x2c')],qs[_0x9c24('0x31')](_0x342d49[_0x9c24('0x2d')][_0x9c24('0x31')]));_0x25c22c[_0x9c24('0x32')]=_0x25c22c[_0x9c24('0x32')][_0x9c24('0x33')]?_0x25c22c[_0x9c24('0x32')]:_0x36a80f[_0x9c24('0x2c')];_0x25c22c[_0x9c24('0x36')]=qs[_0x9c24('0x37')](_0x342d49[_0x9c24('0x2d')]['sort']);_0x25c22c[_0x9c24('0x38')]=qs[_0x9c24('0x2f')](_[_0x9c24('0x49')](_0x342d49[_0x9c24('0x2d')],_0x36a80f[_0x9c24('0x2f')]));if(_0x342d49['query'][_0x9c24('0x4a')]){_0x25c22c['where']=_[_0x9c24('0x39')](_0x25c22c[_0x9c24('0x38')],{'$or':_[_0x9c24('0x27')](_0x25c22c[_0x9c24('0x32')],function(_0x387f62){var _0x20cc65={};_0x20cc65[_0x387f62]={'$like':'%'+_0x342d49['query'][_0x9c24('0x4a')]+'%'};return _0x20cc65;})});}_0x25c22c=_[_0x9c24('0x39')]({},_0x25c22c,_0x342d49[_0x9c24('0x3b')]);return _0x25899e[_0x9c24('0x46')](_0x25c22c);}})['then'](function(_0x3b0d6d){if(_0x3b0d6d){_0x33ff54=_0x3b0d6d[_0x9c24('0x33')];if(!_0x342d49[_0x9c24('0x2d')]['hasOwnProperty'](_0x9c24('0x35'))){_0x25c22c[_0x9c24('0x1b')]=qs[_0x9c24('0x1b')](_0x342d49['query']['limit']);_0x25c22c['offset']=qs[_0x9c24('0x19')](_0x342d49[_0x9c24('0x2d')][_0x9c24('0x19')]);}return _0x25899e[_0x9c24('0x46')](_0x25c22c);}})[_0x9c24('0x21')](function(_0x433c80){if(_0x433c80){return _0x433c80?{'count':_0x33ff54,'rows':_0x433c80}:null;}})['then'](respondWithResult(_0x358dd5,null))['catch'](handleError(_0x358dd5,null));};exports[_0x9c24('0x4b')]=function(_0x4d5894,_0x118918,_0x450410){if(_0x4d5894['body']['id']){delete _0x4d5894['body']['id'];}return db['DeskAccount'][_0x9c24('0x47')]({'where':{'id':_0x4d5894[_0x9c24('0x40')]['id']}})[_0x9c24('0x21')](handleEntityNotFound(_0x118918,null))['then'](function(_0x48738b){if(_0x48738b){_0x4d5894['body'][_0x9c24('0x4c')]=_0x48738b['id'];_0x4d5894['body']['Subjects']=integrations[_0x9c24('0x4d')](_0x4d5894['body']['channel'],_0x4d5894[_0x9c24('0x43')][_0x9c24('0x2a')]);_0x4d5894[_0x9c24('0x43')][_0x9c24('0x4e')]=integrations[_0x9c24('0x4f')](_0x4d5894[_0x9c24('0x43')][_0x9c24('0x50')],_0x4d5894[_0x9c24('0x43')]['type']);return db[_0x9c24('0x48')][_0x9c24('0x42')](_0x4d5894['body'],{'include':[{'model':db[_0x9c24('0x51')],'as':_0x9c24('0x52')},{'model':db[_0x9c24('0x51')],'as':'Descriptions'}]});}return null;})[_0x9c24('0x21')](respondWithResult(_0x118918,null))['catch'](handleError(_0x118918,null));};exports[_0x9c24('0x53')]=function(_0x52c7ba,_0x211431,_0x37350e){var _0x46be61=[{'name':_0x9c24('0x54'),'label':_0x9c24('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 _0x4a0a8c='';return db[_0x9c24('0x28')][_0x9c24('0x47')]({'where':{'id':_0x52c7ba[_0x9c24('0x40')]['id']},'attributes':['id',_0x9c24('0x55'),_0x9c24('0x56'),_0x9c24('0x57'),'password','consumerKey',_0x9c24('0x58'),_0x9c24('0x59'),_0x9c24('0x5a')]})['then'](handleEntityNotFound(_0x211431,null))['then'](function(_0x15667e){if(_0x15667e){_0x4a0a8c=_0x15667e[_0x9c24('0x55')];var _0x1b7e86=_0x4a0a8c[_0x9c24('0x5b')](-0x1);if(_0x1b7e86==='/'){_0x4a0a8c=_0x4a0a8c['substring'](0x0,_0x4a0a8c[_0x9c24('0x5c')](_0x1b7e86));}var _0x19fdd0={'method':_0x9c24('0x5d'),'uri':util[_0x9c24('0x5e')](_0x9c24('0x5f'),_0x4a0a8c),'headers':{'Content-Type':_0x9c24('0x60'),'Accept':_0x9c24('0x60')},'json':!![]};if(_0x15667e['authType']===_0x9c24('0x61')){_0x19fdd0[_0x9c24('0x62')][_0x9c24('0x63')]=util[_0x9c24('0x5e')](_0x9c24('0x64'),new Buffer(util['format'](_0x9c24('0x65'),_0x15667e[_0x9c24('0x57')],_0x15667e[_0x9c24('0x66')]))[_0x9c24('0x67')]('base64'));}return rp(_0x19fdd0)[_0x9c24('0x21')](function(_0x4e96d5){return _0x46be61['concat'](_[_0x9c24('0x27')](_0x4e96d5['_embedded'][_0x9c24('0x68')],function(_0x4e0e97){return{'id':_0x4e0e97[_0x9c24('0x24')],'name':_0x4e0e97['name'],'type':_0x4e0e97[_0x9c24('0x2a')],'active':_0x4e0e97[_0x9c24('0x69')],'label':_0x4e0e97[_0x9c24('0x6a')],'custom':!![]};}));});}})[_0x9c24('0x21')](function(_0x2c3ee2){return{'count':_0x2c3ee2[_0x9c24('0x33')],'rows':_0x2c3ee2};})['then'](respondWithResult(_0x211431,null))['catch'](function(_0x3bb713){var _0x3a36a3=_0x52c7ba['query'][_0x9c24('0x6b')]?0x1f4:_0x3bb713[_0x9c24('0x6c')]||0x1f4;logger[_0x9c24('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x9c24('0x53'),_0x3a36a3,JSON[_0x9c24('0x6d')](_0x3bb713));delete _0x3bb713[_0x9c24('0x24')];if(_0x3a36a3===0x191){_0x3a36a3=0x190;}_0x211431['status'](_0x3a36a3)[_0x9c24('0x25')](_0x52c7ba['query'][_0x9c24('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x3bb713['statusCode']}:_0x3bb713);});}; \ No newline at end of file +var _0x00e7=['_embedded','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','username','password','toString','base64','concat'];(function(_0x453861,_0x174b2d){var _0x26e608=function(_0x24b92b){while(--_0x24b92b){_0x453861['push'](_0x453861['shift']());}};_0x26e608(++_0x174b2d);}(_0x00e7,0x1d8));var _0x700e=function(_0x269c42,_0xeed101){_0x269c42=_0x269c42-0x0;var _0x4dad76=_0x00e7[_0x269c42];return _0x4dad76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x700e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x700e('0x1'));var rp=require(_0x700e('0x2'));var moment=require(_0x700e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x700e('0x4'));var util=require(_0x700e('0x5'));var path=require(_0x700e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x700e('0x7'));var fs=require('fs');var fs_extra=require(_0x700e('0x8'));var _=require(_0x700e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x700e('0xa'));var deskjs=require(_0x700e('0xb'));var toCsv=require(_0x700e('0xc'));var querystring=require('querystring');var Papa=require(_0x700e('0xd'));var Redis=require(_0x700e('0xe'));var authService=require(_0x700e('0xf'));var qs=require(_0x700e('0x10'));var as=require(_0x700e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x700e('0x12'));var utils=require(_0x700e('0x13'));var config=require(_0x700e('0x14'));var licenseUtil=require(_0x700e('0x15'));var db=require(_0x700e('0x16'))['db'];var integrations=require(_0x700e('0x17'));function respondWithStatusCode(_0x5c35fd,_0xb5ade7){_0xb5ade7=_0xb5ade7||0xcc;return function(_0x47255e){if(_0x47255e){return _0x5c35fd['sendStatus'](_0xb5ade7);}return _0x5c35fd[_0x700e('0x18')](_0xb5ade7)[_0x700e('0x19')]();};}function respondWithResult(_0x57dcc2,_0x238948){_0x238948=_0x238948||0xc8;return function(_0x28b660){if(_0x28b660){return _0x57dcc2[_0x700e('0x18')](_0x238948)[_0x700e('0x1a')](_0x28b660);}};}function respondWithFilteredResult(_0x39451b,_0x24437d){return function(_0x285706){if(_0x285706){var _0x54094b=typeof _0x24437d[_0x700e('0x1b')]==='undefined'&&typeof _0x24437d[_0x700e('0x1c')]==='undefined';var _0xee1766=_0x285706[_0x700e('0x1d')];var _0x3fc01e=_0x54094b?0x0:_0x24437d[_0x700e('0x1b')];var _0x3526ec=_0x54094b?_0x285706[_0x700e('0x1d')]:_0x24437d[_0x700e('0x1b')]+_0x24437d[_0x700e('0x1c')];var _0x28ff46;if(_0x3526ec>=_0xee1766){_0x3526ec=_0xee1766;_0x28ff46=0xc8;}else{_0x28ff46=0xce;}_0x39451b[_0x700e('0x18')](_0x28ff46);return _0x39451b[_0x700e('0x1e')]('Content-Range',_0x3fc01e+'-'+_0x3526ec+'/'+_0xee1766)[_0x700e('0x1a')](_0x285706);}return null;};}function patchUpdates(_0x1605b8){return function(_0x22ef56){try{jsonpatch[_0x700e('0x1f')](_0x22ef56,_0x1605b8,!![]);}catch(_0x1619a6){return BPromise[_0x700e('0x20')](_0x1619a6);}return _0x22ef56['save']();};}function saveUpdates(_0x13f70b,_0x4b9e49){return function(_0x3b0bc7){if(_0x3b0bc7){return _0x3b0bc7[_0x700e('0x21')](_0x13f70b)[_0x700e('0x22')](function(_0x40a0e4){return _0x40a0e4;});}return null;};}function removeEntity(_0x1ec605,_0x1b0d21){return function(_0x54a3d4){if(_0x54a3d4){return _0x54a3d4[_0x700e('0x23')]()[_0x700e('0x22')](function(){_0x1ec605['status'](0xcc)[_0x700e('0x19')]();});}};}function handleEntityNotFound(_0x2bdb5f,_0x311c2f){return function(_0x4a5e36){if(!_0x4a5e36){_0x2bdb5f[_0x700e('0x24')](0x194);}return _0x4a5e36;};}function handleError(_0x3484a6,_0x2bef65){_0x2bef65=_0x2bef65||0x1f4;return function(_0x40208a){logger[_0x700e('0x25')](_0x40208a[_0x700e('0x26')]);if(_0x40208a[_0x700e('0x27')]){delete _0x40208a[_0x700e('0x27')];}_0x3484a6['status'](_0x2bef65)[_0x700e('0x28')](_0x40208a);};}exports[_0x700e('0x29')]=function(_0x540ddb,_0x499e01){var _0x121171={},_0xf23f5c={},_0x209261={'count':0x0,'rows':[]};var _0x575436=_[_0x700e('0x2a')](db[_0x700e('0x2b')][_0x700e('0x2c')],function(_0x55e7e5){return{'name':_0x55e7e5[_0x700e('0x2d')],'type':_0x55e7e5[_0x700e('0x2e')][_0x700e('0x2f')]};});_0xf23f5c[_0x700e('0x30')]=_[_0x700e('0x2a')](_0x575436,_0x700e('0x27'));_0xf23f5c[_0x700e('0x31')]=_[_0x700e('0x32')](_0x540ddb[_0x700e('0x31')]);_0xf23f5c[_0x700e('0x33')]=_[_0x700e('0x34')](_0xf23f5c['model'],_0xf23f5c[_0x700e('0x31')]);_0x121171[_0x700e('0x35')]=_['intersection'](_0xf23f5c[_0x700e('0x30')],qs[_0x700e('0x36')](_0x540ddb['query'][_0x700e('0x36')]));_0x121171[_0x700e('0x35')]=_0x121171['attributes'][_0x700e('0x37')]?_0x121171['attributes']:_0xf23f5c[_0x700e('0x30')];if(!_0x540ddb['query'][_0x700e('0x38')](_0x700e('0x39'))){_0x121171[_0x700e('0x1c')]=qs[_0x700e('0x1c')](_0x540ddb[_0x700e('0x31')][_0x700e('0x1c')]);_0x121171[_0x700e('0x1b')]=qs[_0x700e('0x1b')](_0x540ddb[_0x700e('0x31')][_0x700e('0x1b')]);}_0x121171[_0x700e('0x3a')]=qs[_0x700e('0x3b')](_0x540ddb[_0x700e('0x31')]['sort']);_0x121171['where']=qs[_0x700e('0x33')](_[_0x700e('0x3c')](_0x540ddb[_0x700e('0x31')],_0xf23f5c[_0x700e('0x33')]),_0x575436);if(_0x540ddb[_0x700e('0x31')][_0x700e('0x3d')]){_0x121171[_0x700e('0x3e')]=_[_0x700e('0x3f')](_0x121171['where'],{'$or':_[_0x700e('0x2a')](_0x575436,function(_0x1e77c5){if(_0x1e77c5['type']!==_0x700e('0x40')){var _0x3d3a60={};_0x3d3a60[_0x1e77c5[_0x700e('0x27')]]={'$like':'%'+_0x540ddb['query']['filter']+'%'};return _0x3d3a60;}})});}_0x121171=_[_0x700e('0x3f')]({},_0x121171,_0x540ddb['options']);var _0x58c9b0={'where':_0x121171['where']};return db[_0x700e('0x2b')][_0x700e('0x1d')](_0x58c9b0)[_0x700e('0x22')](function(_0x28beff){_0x209261[_0x700e('0x1d')]=_0x28beff;if(_0x540ddb[_0x700e('0x31')][_0x700e('0x41')]){_0x121171['include']=[{'all':!![]}];}return db[_0x700e('0x2b')][_0x700e('0x42')](_0x121171);})[_0x700e('0x22')](function(_0x1db655){_0x209261[_0x700e('0x43')]=_0x1db655;return _0x209261;})[_0x700e('0x22')](respondWithFilteredResult(_0x499e01,_0x121171))['catch'](handleError(_0x499e01,null));};exports[_0x700e('0x44')]=function(_0x541b60,_0x384f33){var _0x680668={'raw':![],'where':{'id':_0x541b60[_0x700e('0x45')]['id']}},_0x442de7={};_0x442de7[_0x700e('0x30')]=_[_0x700e('0x32')](db[_0x700e('0x2b')][_0x700e('0x2c')]);_0x442de7[_0x700e('0x31')]=_[_0x700e('0x32')](_0x541b60[_0x700e('0x31')]);_0x442de7[_0x700e('0x33')]=_[_0x700e('0x34')](_0x442de7[_0x700e('0x30')],_0x442de7[_0x700e('0x31')]);_0x680668[_0x700e('0x35')]=_[_0x700e('0x34')](_0x442de7[_0x700e('0x30')],qs[_0x700e('0x36')](_0x541b60['query']['fields']));_0x680668['attributes']=_0x680668[_0x700e('0x35')]['length']?_0x680668[_0x700e('0x35')]:_0x442de7[_0x700e('0x30')];if(_0x541b60['query']['includeAll']){_0x680668[_0x700e('0x46')]=[{'all':!![]}];}_0x680668=_['merge']({},_0x680668,_0x541b60[_0x700e('0x47')]);return db['DeskAccount'][_0x700e('0x48')](_0x680668)[_0x700e('0x22')](handleEntityNotFound(_0x384f33,null))[_0x700e('0x22')](respondWithResult(_0x384f33,null))[_0x700e('0x49')](handleError(_0x384f33,null));};exports[_0x700e('0x4a')]=function(_0x4f956d,_0x3a6ab9){return db[_0x700e('0x2b')][_0x700e('0x4a')](_0x4f956d[_0x700e('0x4b')],{})[_0x700e('0x22')](respondWithResult(_0x3a6ab9,0xc9))[_0x700e('0x49')](handleError(_0x3a6ab9,null));};exports[_0x700e('0x21')]=function(_0x2271dd,_0x49d6ae){if(_0x2271dd[_0x700e('0x4b')]['id']){delete _0x2271dd[_0x700e('0x4b')]['id'];}return db[_0x700e('0x2b')][_0x700e('0x48')]({'where':{'id':_0x2271dd[_0x700e('0x45')]['id']}})['then'](handleEntityNotFound(_0x49d6ae,null))[_0x700e('0x22')](saveUpdates(_0x2271dd['body'],null))[_0x700e('0x22')](respondWithResult(_0x49d6ae,null))[_0x700e('0x49')](handleError(_0x49d6ae,null));};exports[_0x700e('0x23')]=function(_0x3007c2,_0x1493b2){return db[_0x700e('0x2b')][_0x700e('0x48')]({'where':{'id':_0x3007c2['params']['id']}})[_0x700e('0x22')](handleEntityNotFound(_0x1493b2,null))['then'](removeEntity(_0x1493b2,null))[_0x700e('0x49')](handleError(_0x1493b2,null));};exports[_0x700e('0x4c')]=function(_0x468bff,_0x52803b,_0x75d400){var _0x36ee70={};var _0x38e4a5={};var _0x54a445;var _0x56443e;return db[_0x700e('0x2b')][_0x700e('0x4d')]({'where':{'id':_0x468bff[_0x700e('0x45')]['id']}})['then'](handleEntityNotFound(_0x52803b,null))['then'](function(_0x30a369){if(_0x30a369){_0x54a445=_0x30a369;_0x38e4a5[_0x700e('0x30')]=_[_0x700e('0x32')](db['DeskConfiguration']['rawAttributes']);_0x38e4a5[_0x700e('0x31')]=_['keys'](_0x468bff[_0x700e('0x31')]);_0x38e4a5['filters']=_['intersection'](_0x38e4a5[_0x700e('0x30')],_0x38e4a5[_0x700e('0x31')]);_0x36ee70[_0x700e('0x35')]=_[_0x700e('0x34')](_0x38e4a5['model'],qs[_0x700e('0x36')](_0x468bff[_0x700e('0x31')][_0x700e('0x36')]));_0x36ee70[_0x700e('0x35')]=_0x36ee70['attributes'][_0x700e('0x37')]?_0x36ee70[_0x700e('0x35')]:_0x38e4a5[_0x700e('0x30')];_0x36ee70[_0x700e('0x3a')]=qs[_0x700e('0x3b')](_0x468bff[_0x700e('0x31')]['sort']);_0x36ee70[_0x700e('0x3e')]=qs['filters'](_[_0x700e('0x3c')](_0x468bff[_0x700e('0x31')],_0x38e4a5['filters']));if(_0x468bff[_0x700e('0x31')][_0x700e('0x3d')]){_0x36ee70['where']=_[_0x700e('0x3f')](_0x36ee70['where'],{'$or':_[_0x700e('0x2a')](_0x36ee70[_0x700e('0x35')],function(_0x24a6ba){var _0x1a3a93={};_0x1a3a93[_0x24a6ba]={'$like':'%'+_0x468bff[_0x700e('0x31')][_0x700e('0x3d')]+'%'};return _0x1a3a93;})});}_0x36ee70=_[_0x700e('0x3f')]({},_0x36ee70,_0x468bff[_0x700e('0x47')]);return _0x54a445['getConfigurations'](_0x36ee70);}})[_0x700e('0x22')](function(_0x378e1c){if(_0x378e1c){_0x56443e=_0x378e1c[_0x700e('0x37')];if(!_0x468bff[_0x700e('0x31')][_0x700e('0x38')](_0x700e('0x39'))){_0x36ee70['limit']=qs[_0x700e('0x1c')](_0x468bff[_0x700e('0x31')][_0x700e('0x1c')]);_0x36ee70[_0x700e('0x1b')]=qs['offset'](_0x468bff[_0x700e('0x31')][_0x700e('0x1b')]);}return _0x54a445[_0x700e('0x4c')](_0x36ee70);}})[_0x700e('0x22')](function(_0x4c543c){if(_0x4c543c){return _0x4c543c?{'count':_0x56443e,'rows':_0x4c543c}:null;}})['then'](respondWithResult(_0x52803b,null))[_0x700e('0x49')](handleError(_0x52803b,null));};exports[_0x700e('0x4e')]=function(_0x573027,_0x89031e,_0x36e998){if(_0x573027['body']['id']){delete _0x573027[_0x700e('0x4b')]['id'];}return db['DeskAccount'][_0x700e('0x4d')]({'where':{'id':_0x573027[_0x700e('0x45')]['id']}})['then'](handleEntityNotFound(_0x89031e,null))[_0x700e('0x22')](function(_0x4f18d9){if(_0x4f18d9){_0x573027[_0x700e('0x4b')][_0x700e('0x4f')]=_0x4f18d9['id'];_0x573027['body'][_0x700e('0x50')]=integrations[_0x700e('0x51')](_0x573027['body']['channel'],_0x573027['body'][_0x700e('0x2e')]);_0x573027['body'][_0x700e('0x52')]=integrations['getDescriptions'](_0x573027['body']['channel'],_0x573027[_0x700e('0x4b')]['type']);return db[_0x700e('0x53')][_0x700e('0x4a')](_0x573027[_0x700e('0x4b')],{'include':[{'model':db[_0x700e('0x54')],'as':_0x700e('0x50')},{'model':db[_0x700e('0x54')],'as':_0x700e('0x52')}]});}return null;})[_0x700e('0x22')](respondWithResult(_0x89031e,null))[_0x700e('0x49')](handleError(_0x89031e,null));};exports[_0x700e('0x55')]=function(_0x5e98de,_0x162775,_0x37f581){var _0x217d48=[{'name':'priority','label':_0x700e('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4c270e='';return db['DeskAccount'][_0x700e('0x4d')]({'where':{'id':_0x5e98de[_0x700e('0x45')]['id']},'attributes':['id',_0x700e('0x57'),_0x700e('0x58'),'username','password',_0x700e('0x59'),_0x700e('0x5a'),_0x700e('0x5b'),_0x700e('0x5c')]})[_0x700e('0x22')](handleEntityNotFound(_0x162775,null))[_0x700e('0x22')](function(_0x50f4e7){if(_0x50f4e7){_0x4c270e=_0x50f4e7[_0x700e('0x57')];var _0x1a1303=_0x4c270e[_0x700e('0x5d')](-0x1);if(_0x1a1303==='/'){_0x4c270e=_0x4c270e[_0x700e('0x5e')](0x0,_0x4c270e[_0x700e('0x5f')](_0x1a1303));}var _0x2592fc={'method':_0x700e('0x60'),'uri':util['format'](_0x700e('0x61'),_0x4c270e),'headers':{'Content-Type':_0x700e('0x62'),'Accept':_0x700e('0x62')},'json':!![]};if(_0x50f4e7[_0x700e('0x58')]===_0x700e('0x63')){_0x2592fc['headers'][_0x700e('0x64')]=util['format'](_0x700e('0x65'),new Buffer(util['format'](_0x700e('0x66'),_0x50f4e7[_0x700e('0x67')],_0x50f4e7[_0x700e('0x68')]))[_0x700e('0x69')](_0x700e('0x6a')));}return rp(_0x2592fc)[_0x700e('0x22')](function(_0x3bce14){return _0x217d48[_0x700e('0x6b')](_[_0x700e('0x2a')](_0x3bce14[_0x700e('0x6c')][_0x700e('0x6d')],function(_0x5db81b){return{'id':_0x5db81b[_0x700e('0x27')],'name':_0x5db81b[_0x700e('0x27')],'type':_0x5db81b[_0x700e('0x2e')],'active':_0x5db81b['active'],'label':_0x5db81b[_0x700e('0x6e')],'custom':!![]};}));});}})['then'](function(_0x34077a){return{'count':_0x34077a['length'],'rows':_0x34077a};})[_0x700e('0x22')](respondWithResult(_0x162775,null))['catch'](function(_0x43d91a){var _0x437767=_0x5e98de[_0x700e('0x31')]['test']?0x1f4:_0x43d91a[_0x700e('0x6f')]||0x1f4;logger[_0x700e('0x25')](_0x700e('0x70'),_0x700e('0x55'),_0x437767,JSON[_0x700e('0x71')](_0x43d91a));delete _0x43d91a['name'];if(_0x437767===0x191){_0x437767=0x190;}_0x162775['status'](_0x437767)['send'](_0x5e98de['query'][_0x700e('0x72')]?{'message':_0x700e('0x73'),'statusCode':_0x43d91a[_0x700e('0x6f')]}:_0x43d91a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index a73f43f..4461f91 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 _0x0f2d=['rimraf','../../config/environment','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x219f7a,_0x5d1ce7){var _0x1cdeb2=function(_0x19165f){while(--_0x19165f){_0x219f7a['push'](_0x219f7a['shift']());}};_0x1cdeb2(++_0x5d1ce7);}(_0x0f2d,0xa2));var _0xd0f2=function(_0x4918fb,_0x59a41d){_0x4918fb=_0x4918fb-0x0;var _0x42ef2a=_0x0f2d[_0x4918fb];return _0x42ef2a;};'use strict';var _=require(_0xd0f2('0x0'));var util=require(_0xd0f2('0x1'));var logger=require('../../config/logger')(_0xd0f2('0x2'));var moment=require(_0xd0f2('0x3'));var BPromise=require(_0xd0f2('0x4'));var rp=require(_0xd0f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0f2('0x6'));var config=require(_0xd0f2('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd0f2('0x8')]=function(_0x2c764c,_0x45e2c1){return _0x2c764c[_0xd0f2('0x9')](_0xd0f2('0xa'),attributes,{'tableName':_0xd0f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe45=['moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','exports','define','DeskAccount','../../config/logger','api'];(function(_0xbe048b,_0x2f8970){var _0x1d9099=function(_0x4920e){while(--_0x4920e){_0xbe048b['push'](_0xbe048b['shift']());}};_0x1d9099(++_0x2f8970);}(_0xbe45,0x1b6));var _0x5be4=function(_0x26ed2a,_0x33cf00){_0x26ed2a=_0x26ed2a-0x0;var _0x4ef557=_0xbe45[_0x26ed2a];return _0x4ef557;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5be4('0x0'))(_0x5be4('0x1'));var moment=require(_0x5be4('0x2'));var BPromise=require(_0x5be4('0x3'));var rp=require(_0x5be4('0x4'));var fs=require('fs');var path=require(_0x5be4('0x5'));var rimraf=require(_0x5be4('0x6'));var config=require('../../config/environment');var attributes=require(_0x5be4('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x5be4('0x8')]=function(_0x2892fb,_0xb611a){return _0x2892fb[_0x5be4('0x9')](_0x5be4('0xa'),attributes,{'tableName':'int_desk_accounts','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 dd02685..c8b9c75 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 _0x0d9e=['moment','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','map','model','ShowDeskAccount','find','lodash','util'];(function(_0x23ced6,_0x4e1238){var _0x14ba1b=function(_0xd92213){while(--_0xd92213){_0x23ced6['push'](_0x23ced6['shift']());}};_0x14ba1b(++_0x4e1238);}(_0x0d9e,0x1ab));var _0xe0d9=function(_0x2f1b91,_0x65cb11){_0x2f1b91=_0x2f1b91-0x0;var _0x2b4eb1=_0x0d9e[_0x2f1b91];return _0x2b4eb1;};'use strict';var _=require(_0xe0d9('0x0'));var util=require(_0xe0d9('0x1'));var moment=require(_0xe0d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0d9('0x4'))['db'];var utils=require(_0xe0d9('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe0d9('0x6'));var client=jayson[_0xe0d9('0x7')][_0xe0d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35134c,_0x558cdb,_0x37f334){return new BPromise(function(_0x15abfc,_0x28066a){return client[_0xe0d9('0x9')](_0x35134c,_0x37f334)[_0xe0d9('0xa')](function(_0x4a3c58){logger[_0xe0d9('0xb')](_0xe0d9('0xc'),_0x558cdb,_0xe0d9('0xd'));logger[_0xe0d9('0xe')](_0xe0d9('0xf'),_0x558cdb,'request\x20sent',JSON[_0xe0d9('0x10')](_0x4a3c58));if(_0x4a3c58['error']){if(_0x4a3c58[_0xe0d9('0x11')]['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x558cdb,_0x4a3c58[_0xe0d9('0x11')][_0xe0d9('0x12')]);return _0x28066a(_0x4a3c58[_0xe0d9('0x11')][_0xe0d9('0x12')]);}logger['error'](_0xe0d9('0xc'),_0x558cdb,_0x4a3c58[_0xe0d9('0x11')][_0xe0d9('0x12')]);return _0x15abfc(_0x4a3c58['error'][_0xe0d9('0x12')]);}else{logger[_0xe0d9('0xb')](_0xe0d9('0xc'),_0x558cdb,'request\x20sent');_0x15abfc(_0x4a3c58[_0xe0d9('0x13')]['message']);}})[_0xe0d9('0x14')](function(_0x441e67){logger[_0xe0d9('0x11')](_0xe0d9('0xc'),_0x558cdb,_0x441e67);_0x28066a(_0x441e67);});});}exports[_0xe0d9('0x15')]=function(_0x53dd24){var _0x1cf0c1=this;return new Promise(function(_0x43bf69,_0x231b8d){return db[_0xe0d9('0x16')][_0xe0d9('0x17')]({'raw':_0x53dd24[_0xe0d9('0x18')]?_0x53dd24[_0xe0d9('0x18')][_0xe0d9('0x19')]===undefined?!![]:![]:!![],'where':_0x53dd24[_0xe0d9('0x18')]?_0x53dd24[_0xe0d9('0x18')][_0xe0d9('0x1a')]||null:null,'attributes':_0x53dd24['options']?_0x53dd24[_0xe0d9('0x18')][_0xe0d9('0x1b')]||null:null,'limit':_0x53dd24[_0xe0d9('0x18')]?_0x53dd24[_0xe0d9('0x18')]['limit']||null:null,'include':_0x53dd24[_0xe0d9('0x18')]?_0x53dd24[_0xe0d9('0x18')][_0xe0d9('0x1c')]?_[_0xe0d9('0x1d')](_0x53dd24[_0xe0d9('0x18')][_0xe0d9('0x1c')],function(_0x55eda1){return{'model':db[_0x55eda1[_0xe0d9('0x1e')]],'as':_0x55eda1['as'],'attributes':_0x55eda1[_0xe0d9('0x1b')],'include':_0x55eda1[_0xe0d9('0x1c')]?_['map'](_0x55eda1[_0xe0d9('0x1c')],function(_0x4ce879){return{'model':db[_0x4ce879[_0xe0d9('0x1e')]],'as':_0x4ce879['as'],'attributes':_0x4ce879[_0xe0d9('0x1b')],'include':_0x4ce879[_0xe0d9('0x1c')]?_[_0xe0d9('0x1d')](_0x4ce879[_0xe0d9('0x1c')],function(_0xa8b86){return{'model':db[_0xa8b86[_0xe0d9('0x1e')]],'as':_0xa8b86['as'],'attributes':_0xa8b86[_0xe0d9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0d9('0xa')](function(_0x33c74c){logger[_0xe0d9('0xb')](_0xe0d9('0x15'),_0x53dd24);logger[_0xe0d9('0xe')]('GetDeskAccount',_0x53dd24,JSON[_0xe0d9('0x10')](_0x33c74c));_0x43bf69(_0x33c74c);})[_0xe0d9('0x14')](function(_0x29eb5){logger['error'](_0xe0d9('0x15'),_0x29eb5[_0xe0d9('0x12')],_0x53dd24);_0x231b8d(_0x1cf0c1[_0xe0d9('0x11')](0x1f4,_0x29eb5['message']));});});};exports[_0xe0d9('0x1f')]=function(_0x30d40d){var _0x507074=this;return new Promise(function(_0x39e602,_0x479727){return db[_0xe0d9('0x16')][_0xe0d9('0x20')]({'raw':_0x30d40d[_0xe0d9('0x18')]?_0x30d40d[_0xe0d9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x30d40d[_0xe0d9('0x18')]?_0x30d40d[_0xe0d9('0x18')][_0xe0d9('0x1a')]||null:null,'attributes':_0x30d40d[_0xe0d9('0x18')]?_0x30d40d[_0xe0d9('0x18')][_0xe0d9('0x1b')]||null:null,'include':_0x30d40d[_0xe0d9('0x18')]?_0x30d40d[_0xe0d9('0x18')]['include']?_['map'](_0x30d40d['options']['include'],function(_0x415720){return{'model':db[_0x415720[_0xe0d9('0x1e')]],'as':_0x415720['as'],'attributes':_0x415720['attributes'],'include':_0x415720[_0xe0d9('0x1c')]?_[_0xe0d9('0x1d')](_0x415720['include'],function(_0x22707e){return{'model':db[_0x22707e[_0xe0d9('0x1e')]],'as':_0x22707e['as'],'attributes':_0x22707e[_0xe0d9('0x1b')],'include':_0x22707e[_0xe0d9('0x1c')]?_[_0xe0d9('0x1d')](_0x22707e[_0xe0d9('0x1c')],function(_0x14caee){return{'model':db[_0x14caee[_0xe0d9('0x1e')]],'as':_0x14caee['as'],'attributes':_0x14caee[_0xe0d9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0d9('0xa')](function(_0x403dc2){logger['info'](_0xe0d9('0x1f'),_0x30d40d);logger[_0xe0d9('0xe')](_0xe0d9('0x1f'),_0x30d40d,JSON[_0xe0d9('0x10')](_0x403dc2));_0x39e602(_0x403dc2);})[_0xe0d9('0x14')](function(_0x2480a2){logger[_0xe0d9('0x11')](_0xe0d9('0x1f'),_0x2480a2[_0xe0d9('0x12')],_0x30d40d);_0x479727(_0x507074[_0xe0d9('0x11')](0x1f4,_0x2480a2['message']));});});}; \ No newline at end of file +var _0x97a5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','request\x20sent','result','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','map','include','model','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x22d4f2,_0x5866be){var _0x7dfcab=function(_0x54b8ad){while(--_0x54b8ad){_0x22d4f2['push'](_0x22d4f2['shift']());}};_0x7dfcab(++_0x5866be);}(_0x97a5,0x177));var _0x597a=function(_0x3bf03f,_0xbfd44){_0x3bf03f=_0x3bf03f-0x0;var _0x29dc98=_0x97a5[_0x3bf03f];return _0x29dc98;};'use strict';var _=require(_0x597a('0x0'));var util=require(_0x597a('0x1'));var moment=require(_0x597a('0x2'));var BPromise=require(_0x597a('0x3'));var rs=require(_0x597a('0x4'));var fs=require('fs');var Redis=require(_0x597a('0x5'));var db=require(_0x597a('0x6'))['db'];var utils=require(_0x597a('0x7'));var logger=require(_0x597a('0x8'))(_0x597a('0x9'));var config=require(_0x597a('0xa'));var jayson=require(_0x597a('0xb'));var client=jayson['client'][_0x597a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1603cd,_0x5064a5,_0x3b5956){return new BPromise(function(_0x155882,_0x1c8d56){return client[_0x597a('0xd')](_0x1603cd,_0x3b5956)[_0x597a('0xe')](function(_0xc34ca3){logger[_0x597a('0xf')]('DeskAccount,\x20%s,\x20%s',_0x5064a5,'request\x20sent');logger[_0x597a('0x10')](_0x597a('0x11'),_0x5064a5,'request\x20sent',JSON[_0x597a('0x12')](_0xc34ca3));if(_0xc34ca3[_0x597a('0x13')]){if(_0xc34ca3[_0x597a('0x13')][_0x597a('0x14')]===0x1f4){logger['error'](_0x597a('0x15'),_0x5064a5,_0xc34ca3[_0x597a('0x13')][_0x597a('0x16')]);return _0x1c8d56(_0xc34ca3[_0x597a('0x13')][_0x597a('0x16')]);}logger[_0x597a('0x13')](_0x597a('0x15'),_0x5064a5,_0xc34ca3[_0x597a('0x13')][_0x597a('0x16')]);return _0x155882(_0xc34ca3[_0x597a('0x13')][_0x597a('0x16')]);}else{logger[_0x597a('0xf')](_0x597a('0x15'),_0x5064a5,_0x597a('0x17'));_0x155882(_0xc34ca3[_0x597a('0x18')][_0x597a('0x16')]);}})['catch'](function(_0x510f41){logger[_0x597a('0x13')](_0x597a('0x15'),_0x5064a5,_0x510f41);_0x1c8d56(_0x510f41);});});}exports[_0x597a('0x19')]=function(_0x3d50eb){var _0x163f77=this;return new Promise(function(_0x402b54,_0x3898ce){return db[_0x597a('0x1a')]['findAll']({'raw':_0x3d50eb[_0x597a('0x1b')]?_0x3d50eb[_0x597a('0x1b')][_0x597a('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d50eb[_0x597a('0x1b')]?_0x3d50eb[_0x597a('0x1b')][_0x597a('0x1d')]||null:null,'attributes':_0x3d50eb[_0x597a('0x1b')]?_0x3d50eb[_0x597a('0x1b')][_0x597a('0x1e')]||null:null,'limit':_0x3d50eb[_0x597a('0x1b')]?_0x3d50eb['options'][_0x597a('0x1f')]||null:null,'include':_0x3d50eb['options']?_0x3d50eb['options']['include']?_[_0x597a('0x20')](_0x3d50eb['options']['include'],function(_0x4e8625){return{'model':db[_0x4e8625['model']],'as':_0x4e8625['as'],'attributes':_0x4e8625[_0x597a('0x1e')],'include':_0x4e8625['include']?_[_0x597a('0x20')](_0x4e8625[_0x597a('0x21')],function(_0x1ea22f){return{'model':db[_0x1ea22f[_0x597a('0x22')]],'as':_0x1ea22f['as'],'attributes':_0x1ea22f[_0x597a('0x1e')],'include':_0x1ea22f[_0x597a('0x21')]?_[_0x597a('0x20')](_0x1ea22f[_0x597a('0x21')],function(_0x57101c){return{'model':db[_0x57101c['model']],'as':_0x57101c['as'],'attributes':_0x57101c[_0x597a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x486840){logger[_0x597a('0xf')](_0x597a('0x19'),_0x3d50eb);logger[_0x597a('0x10')]('GetDeskAccount',_0x3d50eb,JSON[_0x597a('0x12')](_0x486840));_0x402b54(_0x486840);})[_0x597a('0x23')](function(_0x29cdea){logger[_0x597a('0x13')](_0x597a('0x19'),_0x29cdea[_0x597a('0x16')],_0x3d50eb);_0x3898ce(_0x163f77['error'](0x1f4,_0x29cdea[_0x597a('0x16')]));});});};exports[_0x597a('0x24')]=function(_0x4aee41){var _0x5d657c=this;return new Promise(function(_0xb093d6,_0x1c998f){return db[_0x597a('0x1a')][_0x597a('0x25')]({'raw':_0x4aee41['options']?_0x4aee41['options'][_0x597a('0x1c')]===undefined?!![]:![]:!![],'where':_0x4aee41[_0x597a('0x1b')]?_0x4aee41['options'][_0x597a('0x1d')]||null:null,'attributes':_0x4aee41[_0x597a('0x1b')]?_0x4aee41[_0x597a('0x1b')][_0x597a('0x1e')]||null:null,'include':_0x4aee41[_0x597a('0x1b')]?_0x4aee41[_0x597a('0x1b')][_0x597a('0x21')]?_[_0x597a('0x20')](_0x4aee41[_0x597a('0x1b')][_0x597a('0x21')],function(_0x17e606){return{'model':db[_0x17e606[_0x597a('0x22')]],'as':_0x17e606['as'],'attributes':_0x17e606[_0x597a('0x1e')],'include':_0x17e606[_0x597a('0x21')]?_['map'](_0x17e606['include'],function(_0x6baa85){return{'model':db[_0x6baa85[_0x597a('0x22')]],'as':_0x6baa85['as'],'attributes':_0x6baa85['attributes'],'include':_0x6baa85[_0x597a('0x21')]?_[_0x597a('0x20')](_0x6baa85[_0x597a('0x21')],function(_0x5057b7){return{'model':db[_0x5057b7['model']],'as':_0x5057b7['as'],'attributes':_0x5057b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x597a('0xe')](function(_0x152804){logger[_0x597a('0xf')]('ShowDeskAccount',_0x4aee41);logger[_0x597a('0x10')](_0x597a('0x24'),_0x4aee41,JSON[_0x597a('0x12')](_0x152804));_0xb093d6(_0x152804);})[_0x597a('0x23')](function(_0x5994b2){logger['error']('ShowDeskAccount',_0x5994b2[_0x597a('0x16')],_0x4aee41);_0x1c998f(_0x5d657c['error'](0x1f4,_0x5994b2['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 0e21d5a..3a90915 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0xb5fec3,_0x156398){var _0x2c90ec=function(_0x1ff6df){while(--_0x1ff6df){_0xb5fec3['push'](_0xb5fec3['shift']());}};_0x2c90ec(++_0x156398);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0xaff59,_0x34b15f){var _0x512721=function(_0x2b4cff){while(--_0x2b4cff){_0xaff59['push'](_0xaff59['shift']());}};_0x512721(++_0x34b15f);}(_0x3e74,0x175));var _0x43e7=function(_0x54c2ab,_0x8b17f7){_0x54c2ab=_0x54c2ab-0x0;var _0x1a5295=_0x3e74[_0x54c2ab];return _0x1a5295;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 99a9bb6..f52f09d 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 _0xefb7=['STRING','exports'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0xefb7,0xf9));var _0x7efb=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xefb7[_0x1db251];return _0x56685a;};'use strict';var Sequelize=require('sequelize');module[_0x7efb('0x0')]={'name':{'type':Sequelize[_0x7efb('0x1')]},'description':{'type':Sequelize[_0x7efb('0x1')]}}; \ No newline at end of file +var _0x5b54=['sequelize','exports','STRING'];(function(_0xf9cb7a,_0x155fd9){var _0x337245=function(_0x385c3b){while(--_0x385c3b){_0xf9cb7a['push'](_0xf9cb7a['shift']());}};_0x337245(++_0x155fd9);}(_0x5b54,0x18f));var _0x45b5=function(_0x4f1297,_0x53846f){_0x4f1297=_0x4f1297-0x0;var _0x3a8538=_0x5b54[_0x4f1297];return _0x3a8538;};'use strict';var Sequelize=require(_0x45b5('0x0'));module[_0x45b5('0x1')]={'name':{'type':Sequelize[_0x45b5('0x2')]},'description':{'type':Sequelize[_0x45b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index aac2df5..875dec6 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 _0x7f1c=['params','getFields','findOne','DeskField','getSubjects','pick','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','rows','show','find','catch','create','body','update'];(function(_0x29f47f,_0x198df0){var _0x28c3ee=function(_0x5eecd3){while(--_0x5eecd3){_0x29f47f['push'](_0x29f47f['shift']());}};_0x28c3ee(++_0x198df0);}(_0x7f1c,0xa9));var _0xc7f1=function(_0x15dd68,_0x268ff5){_0x15dd68=_0x15dd68-0x0;var _0x111dc2=_0x7f1c[_0x15dd68];return _0x111dc2;};'use strict';var emlformat=require(_0xc7f1('0x0'));var rimraf=require(_0xc7f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7f1('0x2'));var rp=require(_0xc7f1('0x3'));var moment=require(_0xc7f1('0x4'));var BPromise=require(_0xc7f1('0x5'));var Mustache=require(_0xc7f1('0x6'));var util=require('util');var path=require(_0xc7f1('0x7'));var sox=require(_0xc7f1('0x8'));var csv=require(_0xc7f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc7f1('0xa'));var squel=require(_0xc7f1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc7f1('0xc'));var toCsv=require(_0xc7f1('0x9'));var querystring=require(_0xc7f1('0xd'));var Papa=require(_0xc7f1('0xe'));var Redis=require(_0xc7f1('0xf'));var authService=require(_0xc7f1('0x10'));var qs=require(_0xc7f1('0x11'));var as=require(_0xc7f1('0x12'));var hardwareService=require(_0xc7f1('0x13'));var logger=require(_0xc7f1('0x14'))('api');var utils=require(_0xc7f1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc7f1('0x16'));var db=require(_0xc7f1('0x17'))['db'];function respondWithStatusCode(_0x2e783f,_0x3cafd3){_0x3cafd3=_0x3cafd3||0xcc;return function(_0x3b8ef0){if(_0x3b8ef0){return _0x2e783f[_0xc7f1('0x18')](_0x3cafd3);}return _0x2e783f[_0xc7f1('0x19')](_0x3cafd3)[_0xc7f1('0x1a')]();};}function respondWithResult(_0x3c8ba7,_0x230222){_0x230222=_0x230222||0xc8;return function(_0x3b087c){if(_0x3b087c){return _0x3c8ba7['status'](_0x230222)['json'](_0x3b087c);}};}function respondWithFilteredResult(_0x25bb85,_0x54673d){return function(_0x2e1614){if(_0x2e1614){var _0x25d87f=typeof _0x54673d[_0xc7f1('0x1b')]==='undefined'&&typeof _0x54673d['limit']===_0xc7f1('0x1c');var _0x207fd3=_0x2e1614['count'];var _0x59e9c9=_0x25d87f?0x0:_0x54673d[_0xc7f1('0x1b')];var _0x411e65=_0x25d87f?_0x2e1614[_0xc7f1('0x1d')]:_0x54673d['offset']+_0x54673d[_0xc7f1('0x1e')];var _0x41354c;if(_0x411e65>=_0x207fd3){_0x411e65=_0x207fd3;_0x41354c=0xc8;}else{_0x41354c=0xce;}_0x25bb85[_0xc7f1('0x19')](_0x41354c);return _0x25bb85['set'](_0xc7f1('0x1f'),_0x59e9c9+'-'+_0x411e65+'/'+_0x207fd3)['json'](_0x2e1614);}return null;};}function patchUpdates(_0x1274c0){return function(_0x158c24){try{jsonpatch['apply'](_0x158c24,_0x1274c0,!![]);}catch(_0x3d858d){return BPromise['reject'](_0x3d858d);}return _0x158c24['save']();};}function saveUpdates(_0x2dbfac,_0x5bfa01){return function(_0x3337a8){if(_0x3337a8){return _0x3337a8['update'](_0x2dbfac)['then'](function(_0x256880){return _0x256880;});}return null;};}function removeEntity(_0x2f6583,_0x36020a){return function(_0x33a483){if(_0x33a483){return _0x33a483[_0xc7f1('0x20')]()[_0xc7f1('0x21')](function(){_0x2f6583[_0xc7f1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x234d8b,_0x7bf8d9){return function(_0x144095){if(!_0x144095){_0x234d8b[_0xc7f1('0x18')](0x194);}return _0x144095;};}function handleError(_0x38f17c,_0x12a8a8){_0x12a8a8=_0x12a8a8||0x1f4;return function(_0x1797c6){logger[_0xc7f1('0x22')](_0x1797c6[_0xc7f1('0x23')]);if(_0x1797c6[_0xc7f1('0x24')]){delete _0x1797c6[_0xc7f1('0x24')];}_0x38f17c['status'](_0x12a8a8)[_0xc7f1('0x25')](_0x1797c6);};}exports[_0xc7f1('0x26')]=function(_0xcacc,_0x30109e){var _0x3f0db2={},_0x42259f={},_0x3652c8={'count':0x0,'rows':[]};var _0x1059ec=_[_0xc7f1('0x27')](db['DeskConfiguration'][_0xc7f1('0x28')],function(_0x464568){return{'name':_0x464568[_0xc7f1('0x29')],'type':_0x464568[_0xc7f1('0x2a')][_0xc7f1('0x2b')]};});_0x42259f[_0xc7f1('0x2c')]=_['map'](_0x1059ec,_0xc7f1('0x24'));_0x42259f[_0xc7f1('0x2d')]=_[_0xc7f1('0x2e')](_0xcacc[_0xc7f1('0x2d')]);_0x42259f[_0xc7f1('0x2f')]=_['intersection'](_0x42259f[_0xc7f1('0x2c')],_0x42259f['query']);_0x3f0db2[_0xc7f1('0x30')]=_[_0xc7f1('0x31')](_0x42259f[_0xc7f1('0x2c')],qs[_0xc7f1('0x32')](_0xcacc[_0xc7f1('0x2d')][_0xc7f1('0x32')]));_0x3f0db2[_0xc7f1('0x30')]=_0x3f0db2[_0xc7f1('0x30')][_0xc7f1('0x33')]?_0x3f0db2['attributes']:_0x42259f['model'];if(!_0xcacc[_0xc7f1('0x2d')][_0xc7f1('0x34')](_0xc7f1('0x35'))){_0x3f0db2[_0xc7f1('0x1e')]=qs['limit'](_0xcacc[_0xc7f1('0x2d')][_0xc7f1('0x1e')]);_0x3f0db2[_0xc7f1('0x1b')]=qs[_0xc7f1('0x1b')](_0xcacc[_0xc7f1('0x2d')][_0xc7f1('0x1b')]);}_0x3f0db2[_0xc7f1('0x36')]=qs[_0xc7f1('0x37')](_0xcacc['query'][_0xc7f1('0x37')]);_0x3f0db2[_0xc7f1('0x38')]=qs[_0xc7f1('0x2f')](_['pick'](_0xcacc[_0xc7f1('0x2d')],_0x42259f[_0xc7f1('0x2f')]),_0x1059ec);if(_0xcacc[_0xc7f1('0x2d')][_0xc7f1('0x39')]){_0x3f0db2[_0xc7f1('0x38')]=_[_0xc7f1('0x3a')](_0x3f0db2[_0xc7f1('0x38')],{'$or':_['map'](_0x1059ec,function(_0x461fb7){if(_0x461fb7['type']!==_0xc7f1('0x3b')){var _0x1306aa={};_0x1306aa[_0x461fb7[_0xc7f1('0x24')]]={'$like':'%'+_0xcacc[_0xc7f1('0x2d')][_0xc7f1('0x39')]+'%'};return _0x1306aa;}})});}_0x3f0db2=_[_0xc7f1('0x3a')]({},_0x3f0db2,_0xcacc[_0xc7f1('0x3c')]);var _0x1bf96f={'where':_0x3f0db2[_0xc7f1('0x38')]};return db[_0xc7f1('0x3d')][_0xc7f1('0x1d')](_0x1bf96f)[_0xc7f1('0x21')](function(_0x26cbb5){_0x3652c8[_0xc7f1('0x1d')]=_0x26cbb5;if(_0xcacc[_0xc7f1('0x2d')][_0xc7f1('0x3e')]){_0x3f0db2[_0xc7f1('0x3f')]=[{'all':!![]}];}return db[_0xc7f1('0x3d')]['findAll'](_0x3f0db2);})['then'](function(_0x458d73){_0x3652c8[_0xc7f1('0x40')]=_0x458d73;return _0x3652c8;})[_0xc7f1('0x21')](respondWithFilteredResult(_0x30109e,_0x3f0db2))['catch'](handleError(_0x30109e,null));};exports[_0xc7f1('0x41')]=function(_0x2d3dd1,_0x383b3a){var _0x5a96cc={'raw':![],'where':{'id':_0x2d3dd1['params']['id']}},_0xe4d637={};_0xe4d637[_0xc7f1('0x2c')]=_[_0xc7f1('0x2e')](db[_0xc7f1('0x3d')]['rawAttributes']);_0xe4d637['query']=_['keys'](_0x2d3dd1[_0xc7f1('0x2d')]);_0xe4d637[_0xc7f1('0x2f')]=_[_0xc7f1('0x31')](_0xe4d637[_0xc7f1('0x2c')],_0xe4d637['query']);_0x5a96cc[_0xc7f1('0x30')]=_[_0xc7f1('0x31')](_0xe4d637['model'],qs[_0xc7f1('0x32')](_0x2d3dd1['query']['fields']));_0x5a96cc[_0xc7f1('0x30')]=_0x5a96cc[_0xc7f1('0x30')][_0xc7f1('0x33')]?_0x5a96cc[_0xc7f1('0x30')]:_0xe4d637[_0xc7f1('0x2c')];if(_0x2d3dd1[_0xc7f1('0x2d')]['includeAll']){_0x5a96cc[_0xc7f1('0x3f')]=[{'all':!![]}];}_0x5a96cc=_['merge']({},_0x5a96cc,_0x2d3dd1['options']);return db['DeskConfiguration'][_0xc7f1('0x42')](_0x5a96cc)[_0xc7f1('0x21')](handleEntityNotFound(_0x383b3a,null))[_0xc7f1('0x21')](respondWithResult(_0x383b3a,null))[_0xc7f1('0x43')](handleError(_0x383b3a,null));};exports[_0xc7f1('0x44')]=function(_0x326d9b,_0x15a34a){return db[_0xc7f1('0x3d')][_0xc7f1('0x44')](_0x326d9b[_0xc7f1('0x45')],{})['then'](respondWithResult(_0x15a34a,0xc9))['catch'](handleError(_0x15a34a,null));};exports[_0xc7f1('0x46')]=function(_0x1e5bc7,_0x67b4b3){if(_0x1e5bc7[_0xc7f1('0x45')]['id']){delete _0x1e5bc7['body']['id'];}return db[_0xc7f1('0x3d')][_0xc7f1('0x42')]({'where':{'id':_0x1e5bc7[_0xc7f1('0x47')]['id']}})[_0xc7f1('0x21')](handleEntityNotFound(_0x67b4b3,null))['then'](saveUpdates(_0x1e5bc7[_0xc7f1('0x45')],null))[_0xc7f1('0x21')](respondWithResult(_0x67b4b3,null))[_0xc7f1('0x43')](handleError(_0x67b4b3,null));};exports[_0xc7f1('0x20')]=function(_0x588bda,_0x42a3bd){return db['DeskConfiguration'][_0xc7f1('0x42')]({'where':{'id':_0x588bda[_0xc7f1('0x47')]['id']}})[_0xc7f1('0x21')](handleEntityNotFound(_0x42a3bd,null))['then'](removeEntity(_0x42a3bd,null))['catch'](handleError(_0x42a3bd,null));};exports[_0xc7f1('0x48')]=function(_0x5c8c42,_0x21a2d5,_0xe3b4bd){var _0x4b58e8={};var _0x5b6dbd={};var _0x146c6c;var _0x2d9bdc;return db[_0xc7f1('0x3d')][_0xc7f1('0x49')]({'where':{'id':_0x5c8c42[_0xc7f1('0x47')]['id']}})['then'](handleEntityNotFound(_0x21a2d5,null))[_0xc7f1('0x21')](function(_0x49fa8a){if(_0x49fa8a){_0x146c6c=_0x49fa8a;_0x5b6dbd['model']=_[_0xc7f1('0x2e')](db[_0xc7f1('0x4a')]['rawAttributes']);_0x5b6dbd[_0xc7f1('0x2d')]=_['keys'](_0x5c8c42['query']);_0x5b6dbd[_0xc7f1('0x2f')]=_[_0xc7f1('0x31')](_0x5b6dbd[_0xc7f1('0x2c')],_0x5b6dbd[_0xc7f1('0x2d')]);_0x4b58e8[_0xc7f1('0x30')]=_['intersection'](_0x5b6dbd['model'],qs[_0xc7f1('0x32')](_0x5c8c42[_0xc7f1('0x2d')][_0xc7f1('0x32')]));_0x4b58e8[_0xc7f1('0x30')]=_0x4b58e8['attributes'][_0xc7f1('0x33')]?_0x4b58e8[_0xc7f1('0x30')]:_0x5b6dbd[_0xc7f1('0x2c')];_0x4b58e8[_0xc7f1('0x36')]=qs['sort'](_0x5c8c42[_0xc7f1('0x2d')][_0xc7f1('0x37')]);_0x4b58e8[_0xc7f1('0x38')]=qs['filters'](_['pick'](_0x5c8c42[_0xc7f1('0x2d')],_0x5b6dbd[_0xc7f1('0x2f')]));if(_0x5c8c42[_0xc7f1('0x2d')][_0xc7f1('0x39')]){_0x4b58e8['where']=_[_0xc7f1('0x3a')](_0x4b58e8[_0xc7f1('0x38')],{'$or':_[_0xc7f1('0x27')](_0x4b58e8[_0xc7f1('0x30')],function(_0x256c74){var _0x3ce42f={};_0x3ce42f[_0x256c74]={'$like':'%'+_0x5c8c42[_0xc7f1('0x2d')][_0xc7f1('0x39')]+'%'};return _0x3ce42f;})});}_0x4b58e8=_['merge']({},_0x4b58e8,_0x5c8c42[_0xc7f1('0x3c')]);return _0x146c6c[_0xc7f1('0x48')](_0x4b58e8);}})['then'](function(_0x5288a3){if(_0x5288a3){_0x2d9bdc=_0x5288a3[_0xc7f1('0x33')];if(!_0x5c8c42['query'][_0xc7f1('0x34')]('nolimit')){_0x4b58e8[_0xc7f1('0x1e')]=qs[_0xc7f1('0x1e')](_0x5c8c42['query'][_0xc7f1('0x1e')]);_0x4b58e8['offset']=qs[_0xc7f1('0x1b')](_0x5c8c42[_0xc7f1('0x2d')][_0xc7f1('0x1b')]);}return _0x146c6c[_0xc7f1('0x48')](_0x4b58e8);}})[_0xc7f1('0x21')](function(_0x20071d){if(_0x20071d){return _0x20071d?{'count':_0x2d9bdc,'rows':_0x20071d}:null;}})['then'](respondWithResult(_0x21a2d5,null))[_0xc7f1('0x43')](handleError(_0x21a2d5,null));};exports[_0xc7f1('0x4b')]=function(_0xf5491a,_0x4f7bf6,_0x27a051){var _0x23f177={};var _0x1290fe={};var _0x1b26c7;var _0x5e2e62;return db[_0xc7f1('0x3d')]['findOne']({'where':{'id':_0xf5491a['params']['id']}})['then'](handleEntityNotFound(_0x4f7bf6,null))[_0xc7f1('0x21')](function(_0x7d274b){if(_0x7d274b){_0x1b26c7=_0x7d274b;_0x1290fe[_0xc7f1('0x2c')]=_[_0xc7f1('0x2e')](db[_0xc7f1('0x4a')][_0xc7f1('0x28')]);_0x1290fe[_0xc7f1('0x2d')]=_['keys'](_0xf5491a[_0xc7f1('0x2d')]);_0x1290fe['filters']=_[_0xc7f1('0x31')](_0x1290fe[_0xc7f1('0x2c')],_0x1290fe[_0xc7f1('0x2d')]);_0x23f177['attributes']=_['intersection'](_0x1290fe['model'],qs['fields'](_0xf5491a[_0xc7f1('0x2d')]['fields']));_0x23f177['attributes']=_0x23f177[_0xc7f1('0x30')]['length']?_0x23f177['attributes']:_0x1290fe[_0xc7f1('0x2c')];_0x23f177['order']=qs['sort'](_0xf5491a[_0xc7f1('0x2d')][_0xc7f1('0x37')]);_0x23f177[_0xc7f1('0x38')]=qs[_0xc7f1('0x2f')](_[_0xc7f1('0x4c')](_0xf5491a[_0xc7f1('0x2d')],_0x1290fe[_0xc7f1('0x2f')]));if(_0xf5491a['query'][_0xc7f1('0x39')]){_0x23f177[_0xc7f1('0x38')]=_[_0xc7f1('0x3a')](_0x23f177[_0xc7f1('0x38')],{'$or':_[_0xc7f1('0x27')](_0x23f177['attributes'],function(_0x386f02){var _0x5550b9={};_0x5550b9[_0x386f02]={'$like':'%'+_0xf5491a[_0xc7f1('0x2d')]['filter']+'%'};return _0x5550b9;})});}_0x23f177=_[_0xc7f1('0x3a')]({},_0x23f177,_0xf5491a['options']);return _0x1b26c7[_0xc7f1('0x4b')](_0x23f177);}})['then'](function(_0x22b440){if(_0x22b440){_0x5e2e62=_0x22b440['length'];if(!_0xf5491a[_0xc7f1('0x2d')][_0xc7f1('0x34')]('nolimit')){_0x23f177[_0xc7f1('0x1e')]=qs['limit'](_0xf5491a[_0xc7f1('0x2d')][_0xc7f1('0x1e')]);_0x23f177['offset']=qs[_0xc7f1('0x1b')](_0xf5491a[_0xc7f1('0x2d')]['offset']);}return _0x1b26c7[_0xc7f1('0x4b')](_0x23f177);}})['then'](function(_0xf8115c){if(_0xf8115c){return _0xf8115c?{'count':_0x5e2e62,'rows':_0xf8115c}:null;}})[_0xc7f1('0x21')](respondWithResult(_0x4f7bf6,null))[_0xc7f1('0x43')](handleError(_0x4f7bf6,null));};exports['getDescriptions']=function(_0xabbc4a,_0x99591f,_0x25acdb){var _0x1ed9ec={};var _0xd2ff92={};var _0x20a3ef;var _0x852e;return db[_0xc7f1('0x3d')][_0xc7f1('0x49')]({'where':{'id':_0xabbc4a[_0xc7f1('0x47')]['id']}})[_0xc7f1('0x21')](handleEntityNotFound(_0x99591f,null))[_0xc7f1('0x21')](function(_0x13aa30){if(_0x13aa30){_0x20a3ef=_0x13aa30;_0xd2ff92[_0xc7f1('0x2c')]=_[_0xc7f1('0x2e')](db[_0xc7f1('0x4a')][_0xc7f1('0x28')]);_0xd2ff92[_0xc7f1('0x2d')]=_['keys'](_0xabbc4a[_0xc7f1('0x2d')]);_0xd2ff92[_0xc7f1('0x2f')]=_['intersection'](_0xd2ff92[_0xc7f1('0x2c')],_0xd2ff92['query']);_0x1ed9ec['attributes']=_[_0xc7f1('0x31')](_0xd2ff92[_0xc7f1('0x2c')],qs[_0xc7f1('0x32')](_0xabbc4a[_0xc7f1('0x2d')]['fields']));_0x1ed9ec[_0xc7f1('0x30')]=_0x1ed9ec[_0xc7f1('0x30')][_0xc7f1('0x33')]?_0x1ed9ec[_0xc7f1('0x30')]:_0xd2ff92[_0xc7f1('0x2c')];_0x1ed9ec[_0xc7f1('0x36')]=qs[_0xc7f1('0x37')](_0xabbc4a[_0xc7f1('0x2d')][_0xc7f1('0x37')]);_0x1ed9ec['where']=qs[_0xc7f1('0x2f')](_[_0xc7f1('0x4c')](_0xabbc4a['query'],_0xd2ff92[_0xc7f1('0x2f')]));if(_0xabbc4a[_0xc7f1('0x2d')][_0xc7f1('0x39')]){_0x1ed9ec['where']=_[_0xc7f1('0x3a')](_0x1ed9ec[_0xc7f1('0x38')],{'$or':_[_0xc7f1('0x27')](_0x1ed9ec[_0xc7f1('0x30')],function(_0x343c23){var _0x9cc3d8={};_0x9cc3d8[_0x343c23]={'$like':'%'+_0xabbc4a[_0xc7f1('0x2d')][_0xc7f1('0x39')]+'%'};return _0x9cc3d8;})});}_0x1ed9ec=_[_0xc7f1('0x3a')]({},_0x1ed9ec,_0xabbc4a[_0xc7f1('0x3c')]);return _0x20a3ef['getDescriptions'](_0x1ed9ec);}})['then'](function(_0x46dff5){if(_0x46dff5){_0x852e=_0x46dff5[_0xc7f1('0x33')];if(!_0xabbc4a[_0xc7f1('0x2d')]['hasOwnProperty']('nolimit')){_0x1ed9ec[_0xc7f1('0x1e')]=qs[_0xc7f1('0x1e')](_0xabbc4a['query'][_0xc7f1('0x1e')]);_0x1ed9ec[_0xc7f1('0x1b')]=qs[_0xc7f1('0x1b')](_0xabbc4a[_0xc7f1('0x2d')]['offset']);}return _0x20a3ef['getDescriptions'](_0x1ed9ec);}})[_0xc7f1('0x21')](function(_0x46d932){if(_0x46d932){return _0x46d932?{'count':_0x852e,'rows':_0x46d932}:null;}})['then'](respondWithResult(_0x99591f,null))[_0xc7f1('0x43')](handleError(_0x99591f,null));};exports[_0xc7f1('0x4d')]=function(_0x42d6a1,_0x19c753,_0x23f869){var _0xb641b4={};var _0x643151={};var _0x420067;var _0x3ec4af;return db['DeskConfiguration'][_0xc7f1('0x49')]({'where':{'id':_0x42d6a1['params']['id']}})[_0xc7f1('0x21')](handleEntityNotFound(_0x19c753,null))[_0xc7f1('0x21')](function(_0x3309e1){if(_0x3309e1){_0x420067=_0x3309e1;_0x643151['model']=_['keys'](db[_0xc7f1('0x4e')][_0xc7f1('0x28')]);_0x643151['query']=_[_0xc7f1('0x2e')](_0x42d6a1[_0xc7f1('0x2d')]);_0x643151['filters']=_[_0xc7f1('0x31')](_0x643151[_0xc7f1('0x2c')],_0x643151[_0xc7f1('0x2d')]);_0xb641b4['attributes']=_['intersection'](_0x643151['model'],qs['fields'](_0x42d6a1[_0xc7f1('0x2d')]['fields']));_0xb641b4[_0xc7f1('0x30')]=_0xb641b4[_0xc7f1('0x30')][_0xc7f1('0x33')]?_0xb641b4[_0xc7f1('0x30')]:_0x643151['model'];_0xb641b4[_0xc7f1('0x36')]=qs['sort'](_0x42d6a1[_0xc7f1('0x2d')][_0xc7f1('0x37')]);_0xb641b4[_0xc7f1('0x38')]=qs['filters'](_[_0xc7f1('0x4c')](_0x42d6a1[_0xc7f1('0x2d')],_0x643151[_0xc7f1('0x2f')]));if(_0x42d6a1[_0xc7f1('0x2d')][_0xc7f1('0x39')]){_0xb641b4[_0xc7f1('0x38')]=_[_0xc7f1('0x3a')](_0xb641b4[_0xc7f1('0x38')],{'$or':_['map'](_0xb641b4[_0xc7f1('0x30')],function(_0x223f13){var _0x3903bd={};_0x3903bd[_0x223f13]={'$like':'%'+_0x42d6a1[_0xc7f1('0x2d')]['filter']+'%'};return _0x3903bd;})});}_0xb641b4=_[_0xc7f1('0x3a')]({},_0xb641b4,_0x42d6a1[_0xc7f1('0x3c')]);return _0x420067[_0xc7f1('0x4d')](_0xb641b4);}})[_0xc7f1('0x21')](function(_0x3ce697){if(_0x3ce697){_0x3ec4af=_0x3ce697[_0xc7f1('0x33')];if(!_0x42d6a1[_0xc7f1('0x2d')][_0xc7f1('0x34')](_0xc7f1('0x35'))){_0xb641b4[_0xc7f1('0x1e')]=qs[_0xc7f1('0x1e')](_0x42d6a1['query']['limit']);_0xb641b4[_0xc7f1('0x1b')]=qs['offset'](_0x42d6a1['query']['offset']);}return _0x420067[_0xc7f1('0x4d')](_0xb641b4);}})['then'](function(_0x3ead7e){if(_0x3ead7e){return _0x3ead7e?{'count':_0x3ec4af,'rows':_0x3ead7e}:null;}})['then'](respondWithResult(_0x19c753,null))[_0xc7f1('0x43')](handleError(_0x19c753,null));};exports['setTags']=function(_0xe0ec5a,_0x5786fb,_0x178d28){if(_0xe0ec5a[_0xc7f1('0x45')]['id']){delete _0xe0ec5a[_0xc7f1('0x45')]['id'];}return db[_0xc7f1('0x3d')][_0xc7f1('0x49')]({'where':{'id':_0xe0ec5a[_0xc7f1('0x47')]['id']}})['then'](handleEntityNotFound(_0x5786fb,null))[_0xc7f1('0x21')](function(_0x4cbc7a){if(_0x4cbc7a){return _0x4cbc7a[_0xc7f1('0x4f')](_0xe0ec5a[_0xc7f1('0x45')]['ids']||[]);}return null;})[_0xc7f1('0x21')](respondWithResult(_0x5786fb,null))['catch'](handleError(_0x5786fb,null));}; \ No newline at end of file +var _0xc580=['where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','DeskField','length','order','getFields','getSubjects','getDescriptions','findOne','getTags','setTags','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','DeskConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort'];(function(_0x247f63,_0x249531){var _0x1d05c1=function(_0x1e6c45){while(--_0x1e6c45){_0x247f63['push'](_0x247f63['shift']());}};_0x1d05c1(++_0x249531);}(_0xc580,0x1b8));var _0x0c58=function(_0x4ffef2,_0x1ae3d7){_0x4ffef2=_0x4ffef2-0x0;var _0x1d5805=_0xc580[_0x4ffef2];return _0x1d5805;};'use strict';var emlformat=require(_0x0c58('0x0'));var rimraf=require(_0x0c58('0x1'));var zipdir=require(_0x0c58('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c58('0x3'));var moment=require(_0x0c58('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0c58('0x5'));var util=require(_0x0c58('0x6'));var path=require(_0x0c58('0x7'));var sox=require(_0x0c58('0x8'));var csv=require(_0x0c58('0x9'));var ejs=require(_0x0c58('0xa'));var fs=require('fs');var fs_extra=require(_0x0c58('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0c58('0xc'));var jsforce=require(_0x0c58('0xd'));var deskjs=require(_0x0c58('0xe'));var toCsv=require(_0x0c58('0x9'));var querystring=require('querystring');var Papa=require(_0x0c58('0xf'));var Redis=require(_0x0c58('0x10'));var authService=require(_0x0c58('0x11'));var qs=require(_0x0c58('0x12'));var as=require(_0x0c58('0x13'));var hardwareService=require(_0x0c58('0x14'));var logger=require(_0x0c58('0x15'))(_0x0c58('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0c58('0x17'));var db=require(_0x0c58('0x18'))['db'];function respondWithStatusCode(_0x132f1e,_0x5461d9){_0x5461d9=_0x5461d9||0xcc;return function(_0x1e1a35){if(_0x1e1a35){return _0x132f1e[_0x0c58('0x19')](_0x5461d9);}return _0x132f1e[_0x0c58('0x1a')](_0x5461d9)[_0x0c58('0x1b')]();};}function respondWithResult(_0x22f899,_0x5b9b09){_0x5b9b09=_0x5b9b09||0xc8;return function(_0x25e481){if(_0x25e481){return _0x22f899[_0x0c58('0x1a')](_0x5b9b09)[_0x0c58('0x1c')](_0x25e481);}};}function respondWithFilteredResult(_0x27f522,_0x409046){return function(_0x53a30f){if(_0x53a30f){var _0x1456ec=typeof _0x409046[_0x0c58('0x1d')]===_0x0c58('0x1e')&&typeof _0x409046[_0x0c58('0x1f')]===_0x0c58('0x1e');var _0x93a4db=_0x53a30f[_0x0c58('0x20')];var _0x5e5b63=_0x1456ec?0x0:_0x409046[_0x0c58('0x1d')];var _0x5dca0d=_0x1456ec?_0x53a30f[_0x0c58('0x20')]:_0x409046['offset']+_0x409046[_0x0c58('0x1f')];var _0x2e6fef;if(_0x5dca0d>=_0x93a4db){_0x5dca0d=_0x93a4db;_0x2e6fef=0xc8;}else{_0x2e6fef=0xce;}_0x27f522[_0x0c58('0x1a')](_0x2e6fef);return _0x27f522['set'](_0x0c58('0x21'),_0x5e5b63+'-'+_0x5dca0d+'/'+_0x93a4db)[_0x0c58('0x1c')](_0x53a30f);}return null;};}function patchUpdates(_0x528df1){return function(_0x3be024){try{jsonpatch[_0x0c58('0x22')](_0x3be024,_0x528df1,!![]);}catch(_0x282b26){return BPromise[_0x0c58('0x23')](_0x282b26);}return _0x3be024[_0x0c58('0x24')]();};}function saveUpdates(_0x183883,_0x8a698d){return function(_0x224c91){if(_0x224c91){return _0x224c91['update'](_0x183883)[_0x0c58('0x25')](function(_0x2259d4){return _0x2259d4;});}return null;};}function removeEntity(_0x1f7a53,_0x5e1999){return function(_0x2e4974){if(_0x2e4974){return _0x2e4974[_0x0c58('0x26')]()[_0x0c58('0x25')](function(){_0x1f7a53[_0x0c58('0x1a')](0xcc)[_0x0c58('0x1b')]();});}};}function handleEntityNotFound(_0x171892,_0x1852ad){return function(_0x5b9bea){if(!_0x5b9bea){_0x171892[_0x0c58('0x19')](0x194);}return _0x5b9bea;};}function handleError(_0x346c09,_0x3bef27){_0x3bef27=_0x3bef27||0x1f4;return function(_0x1a1633){logger[_0x0c58('0x27')](_0x1a1633[_0x0c58('0x28')]);if(_0x1a1633['name']){delete _0x1a1633[_0x0c58('0x29')];}_0x346c09[_0x0c58('0x1a')](_0x3bef27)[_0x0c58('0x2a')](_0x1a1633);};}exports['index']=function(_0xce3920,_0x2fcf7f){var _0x2215d6={},_0xb79e36={},_0xce0b68={'count':0x0,'rows':[]};var _0xfa2b00=_[_0x0c58('0x2b')](db[_0x0c58('0x2c')][_0x0c58('0x2d')],function(_0x29a4e){return{'name':_0x29a4e['fieldName'],'type':_0x29a4e[_0x0c58('0x2e')][_0x0c58('0x2f')]};});_0xb79e36[_0x0c58('0x30')]=_['map'](_0xfa2b00,_0x0c58('0x29'));_0xb79e36[_0x0c58('0x31')]=_[_0x0c58('0x32')](_0xce3920['query']);_0xb79e36[_0x0c58('0x33')]=_['intersection'](_0xb79e36[_0x0c58('0x30')],_0xb79e36['query']);_0x2215d6[_0x0c58('0x34')]=_[_0x0c58('0x35')](_0xb79e36[_0x0c58('0x30')],qs[_0x0c58('0x36')](_0xce3920[_0x0c58('0x31')][_0x0c58('0x36')]));_0x2215d6[_0x0c58('0x34')]=_0x2215d6[_0x0c58('0x34')]['length']?_0x2215d6['attributes']:_0xb79e36[_0x0c58('0x30')];if(!_0xce3920[_0x0c58('0x31')][_0x0c58('0x37')](_0x0c58('0x38'))){_0x2215d6[_0x0c58('0x1f')]=qs[_0x0c58('0x1f')](_0xce3920['query'][_0x0c58('0x1f')]);_0x2215d6['offset']=qs['offset'](_0xce3920[_0x0c58('0x31')][_0x0c58('0x1d')]);}_0x2215d6['order']=qs['sort'](_0xce3920[_0x0c58('0x31')][_0x0c58('0x39')]);_0x2215d6[_0x0c58('0x3a')]=qs[_0x0c58('0x33')](_[_0x0c58('0x3b')](_0xce3920[_0x0c58('0x31')],_0xb79e36[_0x0c58('0x33')]),_0xfa2b00);if(_0xce3920['query'][_0x0c58('0x3c')]){_0x2215d6[_0x0c58('0x3a')]=_[_0x0c58('0x3d')](_0x2215d6[_0x0c58('0x3a')],{'$or':_[_0x0c58('0x2b')](_0xfa2b00,function(_0x285ed1){if(_0x285ed1['type']!=='VIRTUAL'){var _0x74e32b={};_0x74e32b[_0x285ed1[_0x0c58('0x29')]]={'$like':'%'+_0xce3920[_0x0c58('0x31')]['filter']+'%'};return _0x74e32b;}})});}_0x2215d6=_[_0x0c58('0x3d')]({},_0x2215d6,_0xce3920[_0x0c58('0x3e')]);var _0x41ad5b={'where':_0x2215d6['where']};return db[_0x0c58('0x2c')][_0x0c58('0x20')](_0x41ad5b)[_0x0c58('0x25')](function(_0x4c21a6){_0xce0b68['count']=_0x4c21a6;if(_0xce3920[_0x0c58('0x31')][_0x0c58('0x3f')]){_0x2215d6['include']=[{'all':!![]}];}return db[_0x0c58('0x2c')][_0x0c58('0x40')](_0x2215d6);})[_0x0c58('0x25')](function(_0xa5af59){_0xce0b68[_0x0c58('0x41')]=_0xa5af59;return _0xce0b68;})[_0x0c58('0x25')](respondWithFilteredResult(_0x2fcf7f,_0x2215d6))[_0x0c58('0x42')](handleError(_0x2fcf7f,null));};exports[_0x0c58('0x43')]=function(_0x11f459,_0x335106){var _0x49c64d={'raw':![],'where':{'id':_0x11f459[_0x0c58('0x44')]['id']}},_0x2b94e8={};_0x2b94e8['model']=_[_0x0c58('0x32')](db['DeskConfiguration'][_0x0c58('0x2d')]);_0x2b94e8['query']=_[_0x0c58('0x32')](_0x11f459[_0x0c58('0x31')]);_0x2b94e8[_0x0c58('0x33')]=_['intersection'](_0x2b94e8['model'],_0x2b94e8[_0x0c58('0x31')]);_0x49c64d[_0x0c58('0x34')]=_['intersection'](_0x2b94e8[_0x0c58('0x30')],qs['fields'](_0x11f459[_0x0c58('0x31')][_0x0c58('0x36')]));_0x49c64d['attributes']=_0x49c64d['attributes']['length']?_0x49c64d[_0x0c58('0x34')]:_0x2b94e8[_0x0c58('0x30')];if(_0x11f459[_0x0c58('0x31')][_0x0c58('0x3f')]){_0x49c64d[_0x0c58('0x45')]=[{'all':!![]}];}_0x49c64d=_['merge']({},_0x49c64d,_0x11f459['options']);return db[_0x0c58('0x2c')]['find'](_0x49c64d)[_0x0c58('0x25')](handleEntityNotFound(_0x335106,null))[_0x0c58('0x25')](respondWithResult(_0x335106,null))[_0x0c58('0x42')](handleError(_0x335106,null));};exports[_0x0c58('0x46')]=function(_0x54aa2c,_0x5dd837){return db['DeskConfiguration'][_0x0c58('0x46')](_0x54aa2c[_0x0c58('0x47')],{})[_0x0c58('0x25')](respondWithResult(_0x5dd837,0xc9))[_0x0c58('0x42')](handleError(_0x5dd837,null));};exports[_0x0c58('0x48')]=function(_0x2291de,_0x232939){if(_0x2291de[_0x0c58('0x47')]['id']){delete _0x2291de['body']['id'];}return db[_0x0c58('0x2c')][_0x0c58('0x49')]({'where':{'id':_0x2291de['params']['id']}})[_0x0c58('0x25')](handleEntityNotFound(_0x232939,null))[_0x0c58('0x25')](saveUpdates(_0x2291de[_0x0c58('0x47')],null))[_0x0c58('0x25')](respondWithResult(_0x232939,null))[_0x0c58('0x42')](handleError(_0x232939,null));};exports[_0x0c58('0x26')]=function(_0x148870,_0x339b26){return db[_0x0c58('0x2c')]['find']({'where':{'id':_0x148870[_0x0c58('0x44')]['id']}})[_0x0c58('0x25')](handleEntityNotFound(_0x339b26,null))[_0x0c58('0x25')](removeEntity(_0x339b26,null))[_0x0c58('0x42')](handleError(_0x339b26,null));};exports['getFields']=function(_0x180f59,_0x3cfa70,_0x1c1d53){var _0x23553f={};var _0x329eef={};var _0x52df3a;var _0x4e4aba;return db[_0x0c58('0x2c')]['findOne']({'where':{'id':_0x180f59[_0x0c58('0x44')]['id']}})[_0x0c58('0x25')](handleEntityNotFound(_0x3cfa70,null))[_0x0c58('0x25')](function(_0x50c23f){if(_0x50c23f){_0x52df3a=_0x50c23f;_0x329eef[_0x0c58('0x30')]=_[_0x0c58('0x32')](db[_0x0c58('0x4a')][_0x0c58('0x2d')]);_0x329eef[_0x0c58('0x31')]=_[_0x0c58('0x32')](_0x180f59[_0x0c58('0x31')]);_0x329eef[_0x0c58('0x33')]=_[_0x0c58('0x35')](_0x329eef['model'],_0x329eef[_0x0c58('0x31')]);_0x23553f[_0x0c58('0x34')]=_[_0x0c58('0x35')](_0x329eef[_0x0c58('0x30')],qs['fields'](_0x180f59['query'][_0x0c58('0x36')]));_0x23553f[_0x0c58('0x34')]=_0x23553f[_0x0c58('0x34')][_0x0c58('0x4b')]?_0x23553f['attributes']:_0x329eef['model'];_0x23553f[_0x0c58('0x4c')]=qs[_0x0c58('0x39')](_0x180f59[_0x0c58('0x31')]['sort']);_0x23553f['where']=qs['filters'](_['pick'](_0x180f59[_0x0c58('0x31')],_0x329eef[_0x0c58('0x33')]));if(_0x180f59[_0x0c58('0x31')][_0x0c58('0x3c')]){_0x23553f['where']=_[_0x0c58('0x3d')](_0x23553f[_0x0c58('0x3a')],{'$or':_[_0x0c58('0x2b')](_0x23553f[_0x0c58('0x34')],function(_0x402e8d){var _0x3a0fe5={};_0x3a0fe5[_0x402e8d]={'$like':'%'+_0x180f59[_0x0c58('0x31')]['filter']+'%'};return _0x3a0fe5;})});}_0x23553f=_[_0x0c58('0x3d')]({},_0x23553f,_0x180f59[_0x0c58('0x3e')]);return _0x52df3a[_0x0c58('0x4d')](_0x23553f);}})[_0x0c58('0x25')](function(_0x6654db){if(_0x6654db){_0x4e4aba=_0x6654db[_0x0c58('0x4b')];if(!_0x180f59[_0x0c58('0x31')][_0x0c58('0x37')](_0x0c58('0x38'))){_0x23553f['limit']=qs[_0x0c58('0x1f')](_0x180f59[_0x0c58('0x31')][_0x0c58('0x1f')]);_0x23553f[_0x0c58('0x1d')]=qs['offset'](_0x180f59[_0x0c58('0x31')][_0x0c58('0x1d')]);}return _0x52df3a[_0x0c58('0x4d')](_0x23553f);}})[_0x0c58('0x25')](function(_0x4f8872){if(_0x4f8872){return _0x4f8872?{'count':_0x4e4aba,'rows':_0x4f8872}:null;}})[_0x0c58('0x25')](respondWithResult(_0x3cfa70,null))[_0x0c58('0x42')](handleError(_0x3cfa70,null));};exports[_0x0c58('0x4e')]=function(_0x1a7bda,_0x5c97f3,_0x3e4cde){var _0x3c06d4={};var _0x4727d5={};var _0x2847c9;var _0x48b0b1;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1a7bda['params']['id']}})[_0x0c58('0x25')](handleEntityNotFound(_0x5c97f3,null))[_0x0c58('0x25')](function(_0xb2f0f2){if(_0xb2f0f2){_0x2847c9=_0xb2f0f2;_0x4727d5[_0x0c58('0x30')]=_[_0x0c58('0x32')](db[_0x0c58('0x4a')][_0x0c58('0x2d')]);_0x4727d5[_0x0c58('0x31')]=_['keys'](_0x1a7bda[_0x0c58('0x31')]);_0x4727d5[_0x0c58('0x33')]=_[_0x0c58('0x35')](_0x4727d5[_0x0c58('0x30')],_0x4727d5[_0x0c58('0x31')]);_0x3c06d4[_0x0c58('0x34')]=_[_0x0c58('0x35')](_0x4727d5['model'],qs[_0x0c58('0x36')](_0x1a7bda['query'][_0x0c58('0x36')]));_0x3c06d4[_0x0c58('0x34')]=_0x3c06d4['attributes']['length']?_0x3c06d4['attributes']:_0x4727d5[_0x0c58('0x30')];_0x3c06d4[_0x0c58('0x4c')]=qs[_0x0c58('0x39')](_0x1a7bda[_0x0c58('0x31')]['sort']);_0x3c06d4['where']=qs['filters'](_[_0x0c58('0x3b')](_0x1a7bda['query'],_0x4727d5['filters']));if(_0x1a7bda[_0x0c58('0x31')]['filter']){_0x3c06d4[_0x0c58('0x3a')]=_[_0x0c58('0x3d')](_0x3c06d4[_0x0c58('0x3a')],{'$or':_['map'](_0x3c06d4[_0x0c58('0x34')],function(_0x3255b7){var _0x3b7920={};_0x3b7920[_0x3255b7]={'$like':'%'+_0x1a7bda['query'][_0x0c58('0x3c')]+'%'};return _0x3b7920;})});}_0x3c06d4=_[_0x0c58('0x3d')]({},_0x3c06d4,_0x1a7bda['options']);return _0x2847c9[_0x0c58('0x4e')](_0x3c06d4);}})['then'](function(_0x4c6e4c){if(_0x4c6e4c){_0x48b0b1=_0x4c6e4c[_0x0c58('0x4b')];if(!_0x1a7bda['query']['hasOwnProperty'](_0x0c58('0x38'))){_0x3c06d4[_0x0c58('0x1f')]=qs[_0x0c58('0x1f')](_0x1a7bda[_0x0c58('0x31')]['limit']);_0x3c06d4['offset']=qs[_0x0c58('0x1d')](_0x1a7bda['query'][_0x0c58('0x1d')]);}return _0x2847c9[_0x0c58('0x4e')](_0x3c06d4);}})[_0x0c58('0x25')](function(_0x58c31e){if(_0x58c31e){return _0x58c31e?{'count':_0x48b0b1,'rows':_0x58c31e}:null;}})['then'](respondWithResult(_0x5c97f3,null))['catch'](handleError(_0x5c97f3,null));};exports[_0x0c58('0x4f')]=function(_0x5e109d,_0xa1d2ce,_0x8fd93a){var _0x2a6379={};var _0x5e032a={};var _0x532a3c;var _0x177e04;return db[_0x0c58('0x2c')][_0x0c58('0x50')]({'where':{'id':_0x5e109d[_0x0c58('0x44')]['id']}})[_0x0c58('0x25')](handleEntityNotFound(_0xa1d2ce,null))[_0x0c58('0x25')](function(_0x86f88e){if(_0x86f88e){_0x532a3c=_0x86f88e;_0x5e032a[_0x0c58('0x30')]=_[_0x0c58('0x32')](db[_0x0c58('0x4a')]['rawAttributes']);_0x5e032a[_0x0c58('0x31')]=_['keys'](_0x5e109d[_0x0c58('0x31')]);_0x5e032a[_0x0c58('0x33')]=_[_0x0c58('0x35')](_0x5e032a[_0x0c58('0x30')],_0x5e032a['query']);_0x2a6379['attributes']=_['intersection'](_0x5e032a[_0x0c58('0x30')],qs[_0x0c58('0x36')](_0x5e109d['query'][_0x0c58('0x36')]));_0x2a6379[_0x0c58('0x34')]=_0x2a6379['attributes'][_0x0c58('0x4b')]?_0x2a6379[_0x0c58('0x34')]:_0x5e032a['model'];_0x2a6379['order']=qs[_0x0c58('0x39')](_0x5e109d['query']['sort']);_0x2a6379[_0x0c58('0x3a')]=qs['filters'](_[_0x0c58('0x3b')](_0x5e109d[_0x0c58('0x31')],_0x5e032a[_0x0c58('0x33')]));if(_0x5e109d['query'][_0x0c58('0x3c')]){_0x2a6379['where']=_['merge'](_0x2a6379[_0x0c58('0x3a')],{'$or':_[_0x0c58('0x2b')](_0x2a6379['attributes'],function(_0x13621f){var _0x306cfb={};_0x306cfb[_0x13621f]={'$like':'%'+_0x5e109d[_0x0c58('0x31')][_0x0c58('0x3c')]+'%'};return _0x306cfb;})});}_0x2a6379=_[_0x0c58('0x3d')]({},_0x2a6379,_0x5e109d[_0x0c58('0x3e')]);return _0x532a3c[_0x0c58('0x4f')](_0x2a6379);}})['then'](function(_0x273e75){if(_0x273e75){_0x177e04=_0x273e75[_0x0c58('0x4b')];if(!_0x5e109d[_0x0c58('0x31')][_0x0c58('0x37')](_0x0c58('0x38'))){_0x2a6379[_0x0c58('0x1f')]=qs['limit'](_0x5e109d[_0x0c58('0x31')][_0x0c58('0x1f')]);_0x2a6379[_0x0c58('0x1d')]=qs[_0x0c58('0x1d')](_0x5e109d[_0x0c58('0x31')][_0x0c58('0x1d')]);}return _0x532a3c[_0x0c58('0x4f')](_0x2a6379);}})[_0x0c58('0x25')](function(_0xaa0f0c){if(_0xaa0f0c){return _0xaa0f0c?{'count':_0x177e04,'rows':_0xaa0f0c}:null;}})[_0x0c58('0x25')](respondWithResult(_0xa1d2ce,null))[_0x0c58('0x42')](handleError(_0xa1d2ce,null));};exports['getTags']=function(_0x410f6f,_0x482267,_0x2f0246){var _0x2ffc3d={};var _0x34155b={};var _0x50ffbf;var _0x4a92ef;return db[_0x0c58('0x2c')][_0x0c58('0x50')]({'where':{'id':_0x410f6f[_0x0c58('0x44')]['id']}})[_0x0c58('0x25')](handleEntityNotFound(_0x482267,null))[_0x0c58('0x25')](function(_0x3b3e36){if(_0x3b3e36){_0x50ffbf=_0x3b3e36;_0x34155b[_0x0c58('0x30')]=_[_0x0c58('0x32')](db['Tag'][_0x0c58('0x2d')]);_0x34155b[_0x0c58('0x31')]=_[_0x0c58('0x32')](_0x410f6f[_0x0c58('0x31')]);_0x34155b[_0x0c58('0x33')]=_[_0x0c58('0x35')](_0x34155b[_0x0c58('0x30')],_0x34155b['query']);_0x2ffc3d[_0x0c58('0x34')]=_['intersection'](_0x34155b['model'],qs[_0x0c58('0x36')](_0x410f6f[_0x0c58('0x31')][_0x0c58('0x36')]));_0x2ffc3d[_0x0c58('0x34')]=_0x2ffc3d[_0x0c58('0x34')]['length']?_0x2ffc3d[_0x0c58('0x34')]:_0x34155b['model'];_0x2ffc3d[_0x0c58('0x4c')]=qs['sort'](_0x410f6f[_0x0c58('0x31')][_0x0c58('0x39')]);_0x2ffc3d['where']=qs[_0x0c58('0x33')](_[_0x0c58('0x3b')](_0x410f6f['query'],_0x34155b[_0x0c58('0x33')]));if(_0x410f6f[_0x0c58('0x31')][_0x0c58('0x3c')]){_0x2ffc3d[_0x0c58('0x3a')]=_[_0x0c58('0x3d')](_0x2ffc3d[_0x0c58('0x3a')],{'$or':_[_0x0c58('0x2b')](_0x2ffc3d[_0x0c58('0x34')],function(_0x5df200){var _0x1270c6={};_0x1270c6[_0x5df200]={'$like':'%'+_0x410f6f[_0x0c58('0x31')][_0x0c58('0x3c')]+'%'};return _0x1270c6;})});}_0x2ffc3d=_[_0x0c58('0x3d')]({},_0x2ffc3d,_0x410f6f[_0x0c58('0x3e')]);return _0x50ffbf[_0x0c58('0x51')](_0x2ffc3d);}})[_0x0c58('0x25')](function(_0x88b02c){if(_0x88b02c){_0x4a92ef=_0x88b02c[_0x0c58('0x4b')];if(!_0x410f6f[_0x0c58('0x31')]['hasOwnProperty']('nolimit')){_0x2ffc3d[_0x0c58('0x1f')]=qs[_0x0c58('0x1f')](_0x410f6f['query'][_0x0c58('0x1f')]);_0x2ffc3d[_0x0c58('0x1d')]=qs[_0x0c58('0x1d')](_0x410f6f[_0x0c58('0x31')][_0x0c58('0x1d')]);}return _0x50ffbf[_0x0c58('0x51')](_0x2ffc3d);}})['then'](function(_0x4b317d){if(_0x4b317d){return _0x4b317d?{'count':_0x4a92ef,'rows':_0x4b317d}:null;}})[_0x0c58('0x25')](respondWithResult(_0x482267,null))['catch'](handleError(_0x482267,null));};exports[_0x0c58('0x52')]=function(_0xe720a6,_0x4fa88c,_0x5d1b6d){if(_0xe720a6[_0x0c58('0x47')]['id']){delete _0xe720a6[_0x0c58('0x47')]['id'];}return db[_0x0c58('0x2c')][_0x0c58('0x50')]({'where':{'id':_0xe720a6['params']['id']}})[_0x0c58('0x25')](handleEntityNotFound(_0x4fa88c,null))['then'](function(_0x25148a){if(_0x25148a){return _0x25148a[_0x0c58('0x52')](_0xe720a6[_0x0c58('0x47')]['ids']||[]);}return null;})[_0x0c58('0x25')](respondWithResult(_0x4fa88c,null))['catch'](handleError(_0x4fa88c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 3a57509..ab87cfd 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 _0x4380=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','request-promise','../../config/environment'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x4380,0x186));var _0x0438=function(_0x5e1bde,_0x28bbc0){_0x5e1bde=_0x5e1bde-0x0;var _0x1bc73f=_0x4380[_0x5e1bde];return _0x1bc73f;};'use strict';var _=require(_0x0438('0x0'));var util=require(_0x0438('0x1'));var logger=require('../../config/logger')(_0x0438('0x2'));var moment=require(_0x0438('0x3'));var BPromise=require('bluebird');var rp=require(_0x0438('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0438('0x5'));var attributes=require(_0x0438('0x6'));module[_0x0438('0x7')]=function(_0x7c08ad,_0x5180f8){return _0x7c08ad[_0x0438('0x8')](_0x0438('0x9'),attributes,{'tableName':_0x0438('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e86=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x52cc00,_0x38520b){var _0x23cbad=function(_0x34affd){while(--_0x34affd){_0x52cc00['push'](_0x52cc00['shift']());}};_0x23cbad(++_0x38520b);}(_0x4e86,0xf1));var _0x64e8=function(_0x5b6828,_0x4a19d9){_0x5b6828=_0x5b6828-0x0;var _0x2dbd2c=_0x4e86[_0x5b6828];return _0x2dbd2c;};'use strict';var _=require(_0x64e8('0x0'));var util=require('util');var logger=require(_0x64e8('0x1'))('api');var moment=require(_0x64e8('0x2'));var BPromise=require(_0x64e8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64e8('0x4'));var rimraf=require(_0x64e8('0x5'));var config=require(_0x64e8('0x6'));var attributes=require(_0x64e8('0x7'));module['exports']=function(_0x2270f3,_0x43f2aa){return _0x2270f3[_0x64e8('0x8')](_0x64e8('0x9'),attributes,{'tableName':_0x64e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 67192d0..0ff83d7 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 _0xd506=['catch','lodash','../../config/logger','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x287b1b,_0x59403d){var _0x19565d=function(_0x22068d){while(--_0x22068d){_0x287b1b['push'](_0x287b1b['shift']());}};_0x19565d(++_0x59403d);}(_0xd506,0x197));var _0x6d50=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xd506[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x6d50('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d50('0x1'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d50('0x2')][_0x6d50('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x1b0af3,_0x4cf512,_0x9565b6){return new BPromise(function(_0xce67b6,_0x2dacde){return client['request'](_0x1b0af3,_0x9565b6)[_0x6d50('0x4')](function(_0x5012ed){logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,_0x6d50('0x7'));logger[_0x6d50('0x8')](_0x6d50('0x9'),_0x4cf512,_0x6d50('0x7'),JSON['stringify'](_0x5012ed));if(_0x5012ed['error']){if(_0x5012ed['error'][_0x6d50('0xa')]===0x1f4){logger[_0x6d50('0xb')](_0x6d50('0x6'),_0x4cf512,_0x5012ed[_0x6d50('0xb')]['message']);return _0x2dacde(_0x5012ed[_0x6d50('0xb')]['message']);}logger[_0x6d50('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x4cf512,_0x5012ed['error']['message']);return _0xce67b6(_0x5012ed[_0x6d50('0xb')]['message']);}else{logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,'request\x20sent');_0xce67b6(_0x5012ed['result'][_0x6d50('0xc')]);}})[_0x6d50('0xd')](function(_0x38068e){logger['error'](_0x6d50('0x6'),_0x4cf512,_0x38068e);_0x2dacde(_0x38068e);});});} \ No newline at end of file +var _0x1fbb=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x67e0f7,_0x86bdb4){var _0x39a022=function(_0x53d6f1){while(--_0x53d6f1){_0x67e0f7['push'](_0x67e0f7['shift']());}};_0x39a022(++_0x86bdb4);}(_0x1fbb,0x99));var _0xb1fb=function(_0x51eb35,_0x39e8f5){_0x51eb35=_0x51eb35-0x0;var _0x5d19b2=_0x1fbb[_0x51eb35];return _0x5d19b2;};'use strict';var _=require(_0xb1fb('0x0'));var util=require(_0xb1fb('0x1'));var moment=require(_0xb1fb('0x2'));var BPromise=require(_0xb1fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1fb('0x4'));var db=require(_0xb1fb('0x5'))['db'];var utils=require(_0xb1fb('0x6'));var logger=require(_0xb1fb('0x7'))(_0xb1fb('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1fb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27e1f0,_0x4fbb93,_0x52b772){return new BPromise(function(_0x316416,_0x2298d1){return client[_0xb1fb('0xa')](_0x27e1f0,_0x52b772)[_0xb1fb('0xb')](function(_0xb4ca8b){logger[_0xb1fb('0xc')](_0xb1fb('0xd'),_0x4fbb93,_0xb1fb('0xe'));logger['debug'](_0xb1fb('0xf'),_0x4fbb93,'request\x20sent',JSON[_0xb1fb('0x10')](_0xb4ca8b));if(_0xb4ca8b[_0xb1fb('0x11')]){if(_0xb4ca8b[_0xb1fb('0x11')]['code']===0x1f4){logger[_0xb1fb('0x11')](_0xb1fb('0xd'),_0x4fbb93,_0xb4ca8b[_0xb1fb('0x11')][_0xb1fb('0x12')]);return _0x2298d1(_0xb4ca8b[_0xb1fb('0x11')][_0xb1fb('0x12')]);}logger[_0xb1fb('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4fbb93,_0xb4ca8b[_0xb1fb('0x11')][_0xb1fb('0x12')]);return _0x316416(_0xb4ca8b['error'][_0xb1fb('0x12')]);}else{logger[_0xb1fb('0xc')](_0xb1fb('0xd'),_0x4fbb93,_0xb1fb('0xe'));_0x316416(_0xb4ca8b[_0xb1fb('0x13')][_0xb1fb('0x12')]);}})[_0xb1fb('0x14')](function(_0x2cf5cd){logger[_0xb1fb('0x11')](_0xb1fb('0xd'),_0x4fbb93,_0x2cf5cd);_0x2298d1(_0x2cf5cd);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6adc3d6..6608e54 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 _0xef0b=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xef0b,0x1d7));var _0xbef0=function(_0x287089,_0x3f4fb5){_0x287089=_0x287089-0x0;var _0x4484bd=_0xef0b[_0x287089];return _0x4484bd;};'use strict';var multer=require(_0xbef0('0x0'));var util=require('util');var path=require(_0xbef0('0x1'));var timeout=require('connect-timeout');var express=require(_0xbef0('0x2'));var router=express[_0xbef0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbef0('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbef0('0x5'));router[_0xbef0('0x6')]('/',auth[_0xbef0('0x7')](),controller[_0xbef0('0x8')]);router[_0xbef0('0x6')](_0xbef0('0x9'),auth[_0xbef0('0x7')](),controller[_0xbef0('0xa')]);router[_0xbef0('0xb')]('/',auth['isAuthenticated'](),controller[_0xbef0('0xc')]);router[_0xbef0('0xd')](_0xbef0('0x9'),auth[_0xbef0('0x7')](),controller[_0xbef0('0xe')]);router[_0xbef0('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbef0('0x10')]);module[_0xbef0('0x11')]=router; \ No newline at end of file +var _0x6eac=['isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id'];(function(_0x4ddc9b,_0x26a587){var _0x264f1a=function(_0x11ce97){while(--_0x11ce97){_0x4ddc9b['push'](_0x4ddc9b['shift']());}};_0x264f1a(++_0x26a587);}(_0x6eac,0x197));var _0xc6ea=function(_0x26da50,_0x1ff1e5){_0x26da50=_0x26da50-0x0;var _0x561d98=_0x6eac[_0x26da50];return _0x561d98;};'use strict';var multer=require(_0xc6ea('0x0'));var util=require(_0xc6ea('0x1'));var path=require(_0xc6ea('0x2'));var timeout=require(_0xc6ea('0x3'));var express=require(_0xc6ea('0x4'));var router=express['Router']();var fs_extra=require(_0xc6ea('0x5'));var auth=require(_0xc6ea('0x6'));var interaction=require(_0xc6ea('0x7'));var config=require(_0xc6ea('0x8'));var controller=require(_0xc6ea('0x9'));router[_0xc6ea('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6ea('0xb')]);router[_0xc6ea('0xa')](_0xc6ea('0xc'),auth[_0xc6ea('0xd')](),controller[_0xc6ea('0xe')]);router[_0xc6ea('0xf')]('/',auth['isAuthenticated'](),controller[_0xc6ea('0x10')]);router[_0xc6ea('0x11')](_0xc6ea('0xc'),auth[_0xc6ea('0xd')](),controller[_0xc6ea('0x12')]);router[_0xc6ea('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc6ea('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 62c4d42..b4177f1 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 _0x7cc1=['variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x259fd3,_0x19c9e9){var _0x15555b=function(_0x2efa6a){while(--_0x2efa6a){_0x259fd3['push'](_0x259fd3['shift']());}};_0x15555b(++_0x19c9e9);}(_0x7cc1,0xfe));var _0x17cc=function(_0x1bc9ac,_0x179dd5){_0x1bc9ac=_0x1bc9ac-0x0;var _0x5a6f54=_0x7cc1[_0x1bc9ac];return _0x5a6f54;};'use strict';var Sequelize=require('sequelize');module[_0x17cc('0x0')]={'type':{'type':Sequelize[_0x17cc('0x1')](_0x17cc('0x2'),'variable',_0x17cc('0x3'),_0x17cc('0x4'),_0x17cc('0x5')),'defaultValue':_0x17cc('0x2')},'content':{'type':Sequelize[_0x17cc('0x6')]},'key':{'type':Sequelize[_0x17cc('0x6')]},'keyType':{'type':Sequelize[_0x17cc('0x1')]('string',_0x17cc('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x17cc('0x6')]},'nameField':{'type':Sequelize[_0x17cc('0x6')]},'customField':{'type':Sequelize[_0x17cc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17cc('0x6')]}}; \ No newline at end of file +var _0x879d=['picklist','STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue'];(function(_0x14d195,_0x51719c){var _0x43d038=function(_0x352131){while(--_0x352131){_0x14d195['push'](_0x14d195['shift']());}};_0x43d038(++_0x51719c);}(_0x879d,0x1d8));var _0xd879=function(_0x359708,_0x199a31){_0x359708=_0x359708-0x0;var _0x17000a=_0x879d[_0x359708];return _0x17000a;};'use strict';var Sequelize=require('sequelize');module[_0xd879('0x0')]={'type':{'type':Sequelize[_0xd879('0x1')](_0xd879('0x2'),'variable',_0xd879('0x3'),_0xd879('0x4'),_0xd879('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd879('0x6')]},'key':{'type':Sequelize[_0xd879('0x6')]},'keyType':{'type':Sequelize[_0xd879('0x1')](_0xd879('0x2'),_0xd879('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xd879('0x6')]},'idField':{'type':Sequelize[_0xd879('0x6')]},'nameField':{'type':Sequelize[_0xd879('0x6')]},'customField':{'type':Sequelize[_0xd879('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd879('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 9daddac..4f3d277 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 _0x038b=['mustache','util','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','create','body','find','params','destroy','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x4bc9af,_0x154619){var _0x5c45a1=function(_0x353ad3){while(--_0x353ad3){_0x4bc9af['push'](_0x4bc9af['shift']());}};_0x5c45a1(++_0x154619);}(_0x038b,0x114));var _0xb038=function(_0x1125b0,_0x1c643a){_0x1125b0=_0x1125b0-0x0;var _0x13d3f1=_0x038b[_0x1125b0];return _0x13d3f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24'));_0xc387d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2855a6['query']);_0xc387d[_0xb038('0x2f')]=_['intersection'](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x2d')]);_0x12b3b6[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x32')]));_0x12b3b6[_0xb038('0x30')]=_0x12b3b6[_0xb038('0x30')]['length']?_0x12b3b6[_0xb038('0x30')]:_0xc387d[_0xb038('0x2c')];if(!_0x2855a6[_0xb038('0x2d')]['hasOwnProperty']('nolimit')){_0x12b3b6['limit']=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x2855a6[_0xb038('0x2d')]['offset']);}_0x12b3b6[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x34')]);_0x12b3b6['where']=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x2855a6['query'],_0xc387d['filters']),_0x1783d4);if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]){_0x12b3b6[_0xb038('0x37')]=_[_0xb038('0x38')](_0x12b3b6[_0xb038('0x37')],{'$or':_['map'](_0x1783d4,function(_0x404f82){if(_0x404f82[_0xb038('0x2a')]!==_0xb038('0x39')){var _0x2d1e57={};_0x2d1e57[_0x404f82['name']]={'$like':'%'+_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2d1e57;}})});}_0x12b3b6=_[_0xb038('0x38')]({},_0x12b3b6,_0x2855a6['options']);var _0x412d71={'where':_0x12b3b6['where']};return db[_0xb038('0x27')][_0xb038('0x1a')](_0x412d71)[_0xb038('0x22')](function(_0x5ce40c){_0x551b55[_0xb038('0x1a')]=_0x5ce40c;if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x3a')]){_0x12b3b6['include']=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3b')](_0x12b3b6);})[_0xb038('0x22')](function(_0x3c291e){_0x551b55['rows']=_0x3c291e;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x3c')](handleError(_0x28a6a9,null));};exports[_0xb038('0x3d')]=function(_0x2a0436,_0x52e1d6){var _0x19dc7b={'raw':!![],'where':{'id':_0x2a0436['params']['id']}},_0x269c7d={};_0x269c7d[_0xb038('0x2c')]=_[_0xb038('0x2e')](db[_0xb038('0x27')]['rawAttributes']);_0x269c7d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2a0436['query']);_0x269c7d['filters']=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],_0x269c7d[_0xb038('0x2d')]);_0x19dc7b[_0xb038('0x30')]=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2a0436[_0xb038('0x2d')]['fields']));_0x19dc7b['attributes']=_0x19dc7b['attributes'][_0xb038('0x3e')]?_0x19dc7b[_0xb038('0x30')]:_0x269c7d['model'];if(_0x2a0436[_0xb038('0x2d')][_0xb038('0x3a')]){_0x19dc7b[_0xb038('0x3f')]=[{'all':!![]}];}_0x19dc7b=_['merge']({},_0x19dc7b,_0x2a0436[_0xb038('0x40')]);return db['DeskField']['find'](_0x19dc7b)[_0xb038('0x22')](handleEntityNotFound(_0x52e1d6,null))[_0xb038('0x22')](respondWithResult(_0x52e1d6,null))[_0xb038('0x3c')](handleError(_0x52e1d6,null));};exports[_0xb038('0x41')]=function(_0x304515,_0x3b09e3){return db[_0xb038('0x27')][_0xb038('0x41')](_0x304515[_0xb038('0x42')],{})[_0xb038('0x22')](respondWithResult(_0x3b09e3,0xc9))['catch'](handleError(_0x3b09e3,null));};exports[_0xb038('0x21')]=function(_0x3ed968,_0x5c11d7){if(_0x3ed968[_0xb038('0x42')]['id']){delete _0x3ed968[_0xb038('0x42')]['id'];}return db['DeskField'][_0xb038('0x43')]({'where':{'id':_0x3ed968[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x5c11d7,null))[_0xb038('0x22')](saveUpdates(_0x3ed968[_0xb038('0x42')],null))[_0xb038('0x22')](respondWithResult(_0x5c11d7,null))[_0xb038('0x3c')](handleError(_0x5c11d7,null));};exports[_0xb038('0x45')]=function(_0x3a291d,_0x54a826){return db[_0xb038('0x27')][_0xb038('0x43')]({'where':{'id':_0x3a291d[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x54a826,null))[_0xb038('0x22')](removeEntity(_0x54a826,null))[_0xb038('0x3c')](handleError(_0x54a826,null));}; \ No newline at end of file +var _0xc891=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','name','send','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','create','body','find','catch','destroy','eml-format','fast-json-patch'];(function(_0x486aa8,_0x507de8){var _0x180a3d=function(_0x32d627){while(--_0x32d627){_0x486aa8['push'](_0x486aa8['shift']());}};_0x180a3d(++_0x507de8);}(_0xc891,0x152));var _0x1c89=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xc891[_0xea8947];return _0x2455e9;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x1'));var rp=require('request-promise');var moment=require(_0x1c89('0x2'));var BPromise=require(_0x1c89('0x3'));var Mustache=require(_0x1c89('0x4'));var util=require('util');var path=require(_0x1c89('0x5'));var sox=require(_0x1c89('0x6'));var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var licenseUtil=require(_0x1c89('0x12'));var db=require(_0x1c89('0x13'))['db'];function respondWithStatusCode(_0x7a4a2b,_0x27e7c0){_0x27e7c0=_0x27e7c0||0xcc;return function(_0x393b5f){if(_0x393b5f){return _0x7a4a2b[_0x1c89('0x14')](_0x27e7c0);}return _0x7a4a2b['status'](_0x27e7c0)[_0x1c89('0x15')]();};}function respondWithResult(_0x514e4d,_0x46be15){_0x46be15=_0x46be15||0xc8;return function(_0x424651){if(_0x424651){return _0x514e4d[_0x1c89('0x16')](_0x46be15)['json'](_0x424651);}};}function respondWithFilteredResult(_0x45354d,_0x29602e){return function(_0x2c9572){if(_0x2c9572){var _0x4af31b=typeof _0x29602e[_0x1c89('0x17')]===_0x1c89('0x18')&&typeof _0x29602e[_0x1c89('0x19')]===_0x1c89('0x18');var _0x33afcf=_0x2c9572[_0x1c89('0x1a')];var _0x2cb186=_0x4af31b?0x0:_0x29602e[_0x1c89('0x17')];var _0x166444=_0x4af31b?_0x2c9572[_0x1c89('0x1a')]:_0x29602e[_0x1c89('0x17')]+_0x29602e['limit'];var _0x18ce93;if(_0x166444>=_0x33afcf){_0x166444=_0x33afcf;_0x18ce93=0xc8;}else{_0x18ce93=0xce;}_0x45354d[_0x1c89('0x16')](_0x18ce93);return _0x45354d['set'](_0x1c89('0x1b'),_0x2cb186+'-'+_0x166444+'/'+_0x33afcf)[_0x1c89('0x1c')](_0x2c9572);}return null;};}function patchUpdates(_0x14121c){return function(_0x43a17a){try{jsonpatch['apply'](_0x43a17a,_0x14121c,!![]);}catch(_0x4ef155){return BPromise[_0x1c89('0x1d')](_0x4ef155);}return _0x43a17a[_0x1c89('0x1e')]();};}function saveUpdates(_0x253e07,_0x23def1){return function(_0x5b4fbc){if(_0x5b4fbc){return _0x5b4fbc[_0x1c89('0x1f')](_0x253e07)[_0x1c89('0x20')](function(_0x4fbd33){return _0x4fbd33;});}return null;};}function removeEntity(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(_0x1ac0cc){return _0x1ac0cc['destroy']()[_0x1c89('0x20')](function(){_0x45f604[_0x1c89('0x16')](0xcc)[_0x1c89('0x15')]();});}};}function handleEntityNotFound(_0x59a87e,_0x22afe9){return function(_0x49f69b){if(!_0x49f69b){_0x59a87e['sendStatus'](0x194);}return _0x49f69b;};}function handleError(_0x35cc05,_0x352449){_0x352449=_0x352449||0x1f4;return function(_0x4c4694){logger['error'](_0x4c4694['stack']);if(_0x4c4694[_0x1c89('0x21')]){delete _0x4c4694['name'];}_0x35cc05['status'](_0x352449)[_0x1c89('0x22')](_0x4c4694);};}exports['index']=function(_0x193d8d,_0x51aa70){var _0x4dac46={},_0x25500d={},_0x10dc12={'count':0x0,'rows':[]};var _0x14f7cb=_['map'](db[_0x1c89('0x23')][_0x1c89('0x24')],function(_0x487916){return{'name':_0x487916[_0x1c89('0x25')],'type':_0x487916['type'][_0x1c89('0x26')]};});_0x25500d[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x14f7cb,_0x1c89('0x21'));_0x25500d[_0x1c89('0x29')]=_[_0x1c89('0x2a')](_0x193d8d[_0x1c89('0x29')]);_0x25500d[_0x1c89('0x2b')]=_[_0x1c89('0x2c')](_0x25500d[_0x1c89('0x27')],_0x25500d['query']);_0x4dac46[_0x1c89('0x2d')]=_['intersection'](_0x25500d['model'],qs[_0x1c89('0x2e')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x4dac46[_0x1c89('0x2d')]=_0x4dac46[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x4dac46[_0x1c89('0x2d')]:_0x25500d[_0x1c89('0x27')];if(!_0x193d8d[_0x1c89('0x29')][_0x1c89('0x30')](_0x1c89('0x31'))){_0x4dac46['limit']=qs['limit'](_0x193d8d[_0x1c89('0x29')]['limit']);_0x4dac46['offset']=qs[_0x1c89('0x17')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x17')]);}_0x4dac46[_0x1c89('0x32')]=qs[_0x1c89('0x33')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x33')]);_0x4dac46['where']=qs[_0x1c89('0x2b')](_[_0x1c89('0x34')](_0x193d8d['query'],_0x25500d[_0x1c89('0x2b')]),_0x14f7cb);if(_0x193d8d[_0x1c89('0x29')][_0x1c89('0x35')]){_0x4dac46[_0x1c89('0x36')]=_[_0x1c89('0x37')](_0x4dac46['where'],{'$or':_[_0x1c89('0x28')](_0x14f7cb,function(_0x2e6ebd){if(_0x2e6ebd[_0x1c89('0x38')]!=='VIRTUAL'){var _0xed5122={};_0xed5122[_0x2e6ebd['name']]={'$like':'%'+_0x193d8d[_0x1c89('0x29')]['filter']+'%'};return _0xed5122;}})});}_0x4dac46=_[_0x1c89('0x37')]({},_0x4dac46,_0x193d8d[_0x1c89('0x39')]);var _0x45152f={'where':_0x4dac46[_0x1c89('0x36')]};return db[_0x1c89('0x23')][_0x1c89('0x1a')](_0x45152f)[_0x1c89('0x20')](function(_0x1b8566){_0x10dc12[_0x1c89('0x1a')]=_0x1b8566;if(_0x193d8d['query'][_0x1c89('0x3a')]){_0x4dac46[_0x1c89('0x3b')]=[{'all':!![]}];}return db[_0x1c89('0x23')][_0x1c89('0x3c')](_0x4dac46);})['then'](function(_0x36e3a7){_0x10dc12[_0x1c89('0x3d')]=_0x36e3a7;return _0x10dc12;})[_0x1c89('0x20')](respondWithFilteredResult(_0x51aa70,_0x4dac46))['catch'](handleError(_0x51aa70,null));};exports['show']=function(_0xa1d4bb,_0x21fa5c){var _0x5f33c0={'raw':!![],'where':{'id':_0xa1d4bb[_0x1c89('0x3e')]['id']}},_0xebb4c3={};_0xebb4c3[_0x1c89('0x27')]=_[_0x1c89('0x2a')](db[_0x1c89('0x23')][_0x1c89('0x24')]);_0xebb4c3[_0x1c89('0x29')]=_['keys'](_0xa1d4bb[_0x1c89('0x29')]);_0xebb4c3['filters']=_['intersection'](_0xebb4c3[_0x1c89('0x27')],_0xebb4c3[_0x1c89('0x29')]);_0x5f33c0[_0x1c89('0x2d')]=_[_0x1c89('0x2c')](_0xebb4c3[_0x1c89('0x27')],qs[_0x1c89('0x2e')](_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x5f33c0[_0x1c89('0x2d')]=_0x5f33c0[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x5f33c0[_0x1c89('0x2d')]:_0xebb4c3[_0x1c89('0x27')];if(_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x3a')]){_0x5f33c0[_0x1c89('0x3b')]=[{'all':!![]}];}_0x5f33c0=_['merge']({},_0x5f33c0,_0xa1d4bb[_0x1c89('0x39')]);return db['DeskField']['find'](_0x5f33c0)[_0x1c89('0x20')](handleEntityNotFound(_0x21fa5c,null))['then'](respondWithResult(_0x21fa5c,null))['catch'](handleError(_0x21fa5c,null));};exports[_0x1c89('0x3f')]=function(_0x4b4d3f,_0x5f102d){return db['DeskField'][_0x1c89('0x3f')](_0x4b4d3f['body'],{})[_0x1c89('0x20')](respondWithResult(_0x5f102d,0xc9))['catch'](handleError(_0x5f102d,null));};exports[_0x1c89('0x1f')]=function(_0x5114bb,_0x36d5fc){if(_0x5114bb[_0x1c89('0x40')]['id']){delete _0x5114bb[_0x1c89('0x40')]['id'];}return db['DeskField'][_0x1c89('0x41')]({'where':{'id':_0x5114bb[_0x1c89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36d5fc,null))['then'](saveUpdates(_0x5114bb[_0x1c89('0x40')],null))[_0x1c89('0x20')](respondWithResult(_0x36d5fc,null))[_0x1c89('0x42')](handleError(_0x36d5fc,null));};exports[_0x1c89('0x43')]=function(_0x94f616,_0x392fdb){return db[_0x1c89('0x23')][_0x1c89('0x41')]({'where':{'id':_0x94f616[_0x1c89('0x3e')]['id']}})[_0x1c89('0x20')](handleEntityNotFound(_0x392fdb,null))[_0x1c89('0x20')](removeEntity(_0x392fdb,null))[_0x1c89('0x42')](handleError(_0x392fdb,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7416ec6..97de2bf 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 _0x1eca=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','define','int_desk_fields','lodash','util'];(function(_0x9e960d,_0x3cf7cd){var _0x15959a=function(_0x27f18f){while(--_0x27f18f){_0x9e960d['push'](_0x9e960d['shift']());}};_0x15959a(++_0x3cf7cd);}(_0x1eca,0x174));var _0xa1ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1eca[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa1ec('0x0'));var util=require(_0xa1ec('0x1'));var logger=require(_0xa1ec('0x2'))('api');var moment=require(_0xa1ec('0x3'));var BPromise=require(_0xa1ec('0x4'));var rp=require(_0xa1ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1ec('0x6'));var config=require(_0xa1ec('0x7'));var attributes=require(_0xa1ec('0x8'));module['exports']=function(_0x53a856,_0x486171){return _0x53a856[_0xa1ec('0x9')]('DeskField',attributes,{'tableName':_0xa1ec('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdeff=['request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','desk_unique_index','idField','lodash','../../config/logger','bluebird'];(function(_0x403c8d,_0x5e3825){var _0x4ca60d=function(_0x9326c1){while(--_0x9326c1){_0x403c8d['push'](_0x403c8d['shift']());}};_0x4ca60d(++_0x5e3825);}(_0xdeff,0x1e9));var _0xfdef=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0xdeff[_0x8ae98b];return _0xc30bd4;};'use strict';var _=require(_0xfdef('0x0'));var util=require('util');var logger=require(_0xfdef('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfdef('0x2'));var rp=require(_0xfdef('0x3'));var fs=require('fs');var path=require(_0xfdef('0x4'));var rimraf=require(_0xfdef('0x5'));var config=require(_0xfdef('0x6'));var attributes=require(_0xfdef('0x7'));module['exports']=function(_0x178d2d,_0x2acb73){return _0x178d2d[_0xfdef('0x8')](_0xfdef('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xfdef('0xa'),'fields':[_0xfdef('0xb'),'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 e1c4d93..11fd7ea 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 _0x3b93=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2d3811,_0x36afed){var _0x36e9f8=function(_0x18c79c){while(--_0x18c79c){_0x2d3811['push'](_0x2d3811['shift']());}};_0x36e9f8(++_0x36afed);}(_0x3b93,0xda));var _0x33b9=function(_0x57e033,_0x1cabad){_0x57e033=_0x57e033-0x0;var _0x33ae86=_0x3b93[_0x57e033];return _0x33ae86;};'use strict';var _=require('lodash');var util=require(_0x33b9('0x0'));var moment=require(_0x33b9('0x1'));var BPromise=require(_0x33b9('0x2'));var rs=require(_0x33b9('0x3'));var fs=require('fs');var Redis=require(_0x33b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x33b9('0x5'));var logger=require(_0x33b9('0x6'))(_0x33b9('0x7'));var config=require(_0x33b9('0x8'));var jayson=require(_0x33b9('0x9'));var client=jayson[_0x33b9('0xa')][_0x33b9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x479362,_0x47411d,_0x57ef25){return new BPromise(function(_0xbb4676,_0x4a469e){return client[_0x33b9('0xc')](_0x479362,_0x57ef25)[_0x33b9('0xd')](function(_0x986d22){logger[_0x33b9('0xe')](_0x33b9('0xf'),_0x47411d,_0x33b9('0x10'));logger[_0x33b9('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x47411d,_0x33b9('0x10'),JSON['stringify'](_0x986d22));if(_0x986d22[_0x33b9('0x12')]){if(_0x986d22[_0x33b9('0x12')][_0x33b9('0x13')]===0x1f4){logger[_0x33b9('0x12')](_0x33b9('0xf'),_0x47411d,_0x986d22[_0x33b9('0x12')][_0x33b9('0x14')]);return _0x4a469e(_0x986d22[_0x33b9('0x12')][_0x33b9('0x14')]);}logger['error'](_0x33b9('0xf'),_0x47411d,_0x986d22[_0x33b9('0x12')][_0x33b9('0x14')]);return _0xbb4676(_0x986d22[_0x33b9('0x12')]['message']);}else{logger[_0x33b9('0xe')](_0x33b9('0xf'),_0x47411d,_0x33b9('0x10'));_0xbb4676(_0x986d22[_0x33b9('0x15')]['message']);}})[_0x33b9('0x16')](function(_0x4e448d){logger[_0x33b9('0x12')](_0x33b9('0xf'),_0x47411d,_0x4e448d);_0x4a469e(_0x4e448d);});});} \ No newline at end of file +var _0x1623=['http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1623,0x1d8));var _0x3162=function(_0xccc624,_0x340c20){_0xccc624=_0xccc624-0x0;var _0x322002=_0x1623[_0xccc624];return _0x322002;};'use strict';var _=require(_0x3162('0x0'));var util=require(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3162('0x4'));var db=require(_0x3162('0x5'))['db'];var utils=require(_0x3162('0x6'));var logger=require(_0x3162('0x7'))(_0x3162('0x8'));var config=require('../../config/environment');var jayson=require(_0x3162('0x9'));var client=jayson[_0x3162('0xa')][_0x3162('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf3ad49,_0x3ed42b,_0x4c5ce4){return new BPromise(function(_0x3a5c25,_0x484791){return client[_0x3162('0xc')](_0xf3ad49,_0x4c5ce4)[_0x3162('0xd')](function(_0x5b4fc2){logger[_0x3162('0xe')](_0x3162('0xf'),_0x3ed42b,_0x3162('0x10'));logger[_0x3162('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x3ed42b,_0x3162('0x10'),JSON['stringify'](_0x5b4fc2));if(_0x5b4fc2[_0x3162('0x12')]){if(_0x5b4fc2[_0x3162('0x12')][_0x3162('0x13')]===0x1f4){logger[_0x3162('0x12')]('DeskField,\x20%s,\x20%s',_0x3ed42b,_0x5b4fc2[_0x3162('0x12')]['message']);return _0x484791(_0x5b4fc2[_0x3162('0x12')][_0x3162('0x14')]);}logger[_0x3162('0x12')](_0x3162('0xf'),_0x3ed42b,_0x5b4fc2[_0x3162('0x12')][_0x3162('0x14')]);return _0x3a5c25(_0x5b4fc2['error'][_0x3162('0x14')]);}else{logger[_0x3162('0xe')]('DeskField,\x20%s,\x20%s',_0x3ed42b,_0x3162('0x10'));_0x3a5c25(_0x5b4fc2[_0x3162('0x15')]['message']);}})[_0x3162('0x16')](function(_0x49f5b1){logger[_0x3162('0x12')](_0x3162('0xf'),_0x3ed42b,_0x49f5b1);_0x484791(_0x49f5b1);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6cccd3c..6a7f495 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 _0xec61=['./intDynamics365Account.controller','get','index','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','/:id','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x43e346,_0x26e6c4){var _0x1088e1=function(_0x1b4253){while(--_0x1b4253){_0x43e346['push'](_0x43e346['shift']());}};_0x1088e1(++_0x26e6c4);}(_0xec61,0x180));var _0x1ec6=function(_0x24dfb0,_0x4ecc14){_0x24dfb0=_0x24dfb0-0x0;var _0x492128=_0xec61[_0x24dfb0];return _0x492128;};'use strict';var multer=require('multer');var util=require(_0x1ec6('0x0'));var path=require(_0x1ec6('0x1'));var timeout=require(_0x1ec6('0x2'));var express=require('express');var router=express[_0x1ec6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1ec6('0x4'));var interaction=require(_0x1ec6('0x5'));var config=require(_0x1ec6('0x6'));var controller=require(_0x1ec6('0x7'));router[_0x1ec6('0x8')]('/',auth['isAuthenticated'](),controller[_0x1ec6('0x9')]);router['get']('/:id',auth[_0x1ec6('0xa')](),controller[_0x1ec6('0xb')]);router[_0x1ec6('0x8')]('/:id/configurations',auth[_0x1ec6('0xa')](),controller[_0x1ec6('0xc')]);router[_0x1ec6('0x8')](_0x1ec6('0xd'),auth[_0x1ec6('0xa')](),controller[_0x1ec6('0xe')]);router[_0x1ec6('0xf')]('/',auth[_0x1ec6('0xa')](),controller[_0x1ec6('0x10')]);router['post'](_0x1ec6('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x1ec6('0x12')](_0x1ec6('0x13'),auth[_0x1ec6('0xa')](),controller[_0x1ec6('0x14')]);router[_0x1ec6('0x15')](_0x1ec6('0x13'),auth[_0x1ec6('0xa')](),controller['destroy']);module[_0x1ec6('0x16')]=router; \ No newline at end of file +var _0xaf53=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xaf53,0xca));var _0x3af5=function(_0x4abb7a,_0x34465a){_0x4abb7a=_0x4abb7a-0x0;var _0x34a172=_0xaf53[_0x4abb7a];return _0x34a172;};'use strict';var multer=require(_0x3af5('0x0'));var util=require(_0x3af5('0x1'));var path=require(_0x3af5('0x2'));var timeout=require('connect-timeout');var express=require(_0x3af5('0x3'));var router=express[_0x3af5('0x4')]();var fs_extra=require(_0x3af5('0x5'));var auth=require(_0x3af5('0x6'));var interaction=require(_0x3af5('0x7'));var config=require(_0x3af5('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x3af5('0x9')]('/',auth[_0x3af5('0xa')](),controller[_0x3af5('0xb')]);router[_0x3af5('0x9')](_0x3af5('0xc'),auth[_0x3af5('0xa')](),controller[_0x3af5('0xd')]);router['get'](_0x3af5('0xe'),auth['isAuthenticated'](),controller[_0x3af5('0xf')]);router[_0x3af5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3af5('0x10')]);router['post']('/',auth[_0x3af5('0xa')](),controller[_0x3af5('0x11')]);router[_0x3af5('0x12')](_0x3af5('0xe'),auth[_0x3af5('0xa')](),controller[_0x3af5('0x13')]);router['put'](_0x3af5('0xc'),auth[_0x3af5('0xa')](),controller['update']);router[_0x3af5('0x14')](_0x3af5('0xc'),auth[_0x3af5('0xa')](),controller[_0x3af5('0x15')]);module[_0x3af5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ea09471..7574c26 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 _0x448a=['exports','STRING','BOOLEAN'];(function(_0x38be0c,_0xab34e9){var _0x201db3=function(_0x7ceb4){while(--_0x7ceb4){_0x38be0c['push'](_0x38be0c['shift']());}};_0x201db3(++_0xab34e9);}(_0x448a,0x1ef));var _0xa448=function(_0x4d1ece,_0x2ac255){_0x4d1ece=_0x4d1ece-0x0;var _0x535017=_0x448a[_0x4d1ece];return _0x535017;};'use strict';var Sequelize=require('sequelize');module[_0xa448('0x0')]={'name':{'type':Sequelize[_0xa448('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa448('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa448('0x1')]},'clientSecret':{'type':Sequelize[_0xa448('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa448('0x1')]},'modernAuthentication':{'type':Sequelize[_0xa448('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe700=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4acd65,_0x193e16){var _0x1e7c1d=function(_0x49ee80){while(--_0x49ee80){_0x4acd65['push'](_0x4acd65['shift']());}};_0x1e7c1d(++_0x193e16);}(_0xe700,0x75));var _0x0e70=function(_0x52bee5,_0x32eb00){_0x52bee5=_0x52bee5-0x0;var _0xbbab73=_0xe700[_0x52bee5];return _0xbbab73;};'use strict';var Sequelize=require(_0x0e70('0x0'));module[_0x0e70('0x1')]={'name':{'type':Sequelize[_0x0e70('0x2')]},'username':{'type':Sequelize[_0x0e70('0x2')]},'password':{'type':Sequelize[_0x0e70('0x2')]},'remoteUri':{'type':Sequelize[_0x0e70('0x2')]},'tenantId':{'type':Sequelize[_0x0e70('0x2')]},'clientId':{'type':Sequelize[_0x0e70('0x2')]},'clientSecret':{'type':Sequelize[_0x0e70('0x2')]},'serverUrl':{'type':Sequelize[_0x0e70('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x0e70('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index b412b4e..0ce1c27 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 _0x5843=['lastIndexOf','format','%s/api/data/v9.0/','getFields','Incident','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','offset','undefined','limit','status','set','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','substring'];(function(_0x52b914,_0x52bcd3){var _0x21e041=function(_0x379e3a){while(--_0x379e3a){_0x52b914['push'](_0x52b914['shift']());}};_0x21e041(++_0x52bcd3);}(_0x5843,0x74));var _0x3584=function(_0x231f70,_0x6a5f1d){_0x231f70=_0x231f70-0x0;var _0x1ce2cb=_0x5843[_0x231f70];return _0x1ce2cb;};'use strict';var rp=require(_0x3584('0x0'));var util=require('util');var _=require(_0x3584('0x1'));var qs=require(_0x3584('0x2'));var logger=require(_0x3584('0x3'))(_0x3584('0x4'));var db=require(_0x3584('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x6671f,_0x5a8622){_0x5a8622=_0x5a8622||0xc8;return function(_0x3b8a3c){if(_0x3b8a3c){return _0x6671f['status'](_0x5a8622)['json'](_0x3b8a3c);}};}function respondWithFilteredResult(_0xa79ee7,_0x303eac){return function(_0xba1edc){if(_0xba1edc){var _0x3025cf=typeof _0x303eac[_0x3584('0x6')]===_0x3584('0x7')&&typeof _0x303eac['limit']===_0x3584('0x7');var _0x37673d=_0xba1edc['count'];var _0xdfdf39=_0x3025cf?0x0:_0x303eac[_0x3584('0x6')];var _0x333d3e=_0x3025cf?_0xba1edc['count']:_0x303eac[_0x3584('0x6')]+_0x303eac[_0x3584('0x8')];var _0x5714c3;if(_0x333d3e>=_0x37673d){_0x333d3e=_0x37673d;_0x5714c3=0xc8;}else{_0x5714c3=0xce;}_0xa79ee7[_0x3584('0x9')](_0x5714c3);return _0xa79ee7[_0x3584('0xa')]('Content-Range',_0xdfdf39+'-'+_0x333d3e+'/'+_0x37673d)[_0x3584('0xb')](_0xba1edc);}return null;};}function saveUpdates(_0x577576){return function(_0x3ffa24){if(_0x3ffa24){return _0x3ffa24[_0x3584('0xc')](_0x577576)[_0x3584('0xd')](function(_0x10611f){return _0x10611f;});}return null;};}function removeEntity(_0x34b45e){return function(_0x25a1b5){if(_0x25a1b5){return _0x25a1b5[_0x3584('0xe')]()[_0x3584('0xd')](function(){_0x34b45e[_0x3584('0x9')](0xcc)[_0x3584('0xf')]();});}};}function handleEntityNotFound(_0x3f2944){return function(_0x2e62fd){if(!_0x2e62fd){_0x3f2944[_0x3584('0x10')](0x194);}return _0x2e62fd;};}function handleError(_0x1cd803,_0x16f1a5){_0x16f1a5=_0x16f1a5||0x1f4;return function(_0x3ebe90){logger[_0x3584('0x11')](_0x3ebe90[_0x3584('0x12')]);if(_0x3ebe90[_0x3584('0x13')]){delete _0x3ebe90['name'];}_0x1cd803[_0x3584('0x9')](_0x16f1a5)[_0x3584('0x14')](_0x3ebe90);};}exports[_0x3584('0x15')]=function(_0x3b7f8d,_0x348b1a){var _0x5ec2f6={},_0x391d4d={},_0x4d3f4b={'count':0x0,'rows':[]};var _0x5cf047=_[_0x3584('0x16')](db[_0x3584('0x17')][_0x3584('0x18')],function(_0x114cc2){return{'name':_0x114cc2['fieldName'],'type':_0x114cc2['type']['key']};});_0x391d4d[_0x3584('0x19')]=_[_0x3584('0x16')](_0x5cf047,_0x3584('0x13'));_0x391d4d['query']=_['keys'](_0x3b7f8d[_0x3584('0x1a')]);_0x391d4d[_0x3584('0x1b')]=_[_0x3584('0x1c')](_0x391d4d['model'],_0x391d4d[_0x3584('0x1a')]);_0x5ec2f6[_0x3584('0x1d')]=_[_0x3584('0x1c')](_0x391d4d[_0x3584('0x19')],qs['fields'](_0x3b7f8d[_0x3584('0x1a')][_0x3584('0x1e')]));_0x5ec2f6['attributes']=_0x5ec2f6[_0x3584('0x1d')][_0x3584('0x1f')]?_0x5ec2f6[_0x3584('0x1d')]:_0x391d4d[_0x3584('0x19')];if(!_0x3b7f8d[_0x3584('0x1a')][_0x3584('0x20')]('nolimit')){_0x5ec2f6['limit']=qs[_0x3584('0x8')](_0x3b7f8d[_0x3584('0x1a')][_0x3584('0x8')]);_0x5ec2f6[_0x3584('0x6')]=qs[_0x3584('0x6')](_0x3b7f8d[_0x3584('0x1a')]['offset']);}_0x5ec2f6[_0x3584('0x21')]=qs[_0x3584('0x22')](_0x3b7f8d[_0x3584('0x1a')][_0x3584('0x22')]);_0x5ec2f6[_0x3584('0x23')]=qs[_0x3584('0x1b')](_['pick'](_0x3b7f8d[_0x3584('0x1a')],_0x391d4d['filters']),_0x5cf047);if(_0x3b7f8d[_0x3584('0x1a')][_0x3584('0x24')]){_0x5ec2f6['where']=_[_0x3584('0x25')](_0x5ec2f6[_0x3584('0x23')],{'$or':_['map'](_0x5cf047,function(_0x27e671){if(_0x27e671['type']!==_0x3584('0x26')){var _0x22ee83={};_0x22ee83[_0x27e671[_0x3584('0x13')]]={'$like':'%'+_0x3b7f8d[_0x3584('0x1a')]['filter']+'%'};return _0x22ee83;}})});}_0x5ec2f6=_['merge']({},_0x5ec2f6,_0x3b7f8d[_0x3584('0x27')]);var _0x2655ef={'where':_0x5ec2f6[_0x3584('0x23')]};return db[_0x3584('0x17')][_0x3584('0x28')](_0x2655ef)[_0x3584('0xd')](function(_0x2d8de1){_0x4d3f4b[_0x3584('0x28')]=_0x2d8de1;if(_0x3b7f8d['query'][_0x3584('0x29')]){_0x5ec2f6[_0x3584('0x2a')]=[{'all':!![]}];}return db[_0x3584('0x17')][_0x3584('0x2b')](_0x5ec2f6);})[_0x3584('0xd')](function(_0x31d24c){_0x4d3f4b[_0x3584('0x2c')]=_0x31d24c;return _0x4d3f4b;})[_0x3584('0xd')](respondWithFilteredResult(_0x348b1a,_0x5ec2f6))[_0x3584('0x2d')](handleError(_0x348b1a,null));};exports[_0x3584('0x2e')]=function(_0x24a091,_0x4059bf){var _0x397958={'raw':![],'where':{'id':_0x24a091[_0x3584('0x2f')]['id']}},_0x36317d={};_0x36317d['model']=_[_0x3584('0x30')](db['Dynamics365Account'][_0x3584('0x18')]);_0x36317d[_0x3584('0x1a')]=_['keys'](_0x24a091['query']);_0x36317d[_0x3584('0x1b')]=_[_0x3584('0x1c')](_0x36317d[_0x3584('0x19')],_0x36317d[_0x3584('0x1a')]);_0x397958[_0x3584('0x1d')]=_[_0x3584('0x1c')](_0x36317d[_0x3584('0x19')],qs[_0x3584('0x1e')](_0x24a091['query']['fields']));_0x397958[_0x3584('0x1d')]=_0x397958[_0x3584('0x1d')][_0x3584('0x1f')]?_0x397958['attributes']:_0x36317d[_0x3584('0x19')];if(_0x24a091[_0x3584('0x1a')][_0x3584('0x29')]){_0x397958[_0x3584('0x2a')]=[{'all':!![]}];}_0x397958=_[_0x3584('0x25')]({},_0x397958,_0x24a091['options']);return db[_0x3584('0x17')][_0x3584('0x31')](_0x397958)[_0x3584('0xd')](handleEntityNotFound(_0x4059bf,null))['then'](respondWithResult(_0x4059bf,null))[_0x3584('0x2d')](handleError(_0x4059bf,null));};exports[_0x3584('0x32')]=function(_0x341362,_0xb6be5f){return db['Dynamics365Account']['create'](_0x341362[_0x3584('0x33')],{})['then'](respondWithResult(_0xb6be5f,0xc9))[_0x3584('0x2d')](handleError(_0xb6be5f,null));};exports[_0x3584('0xc')]=function(_0x33ed14,_0x3e6a5c){if(_0x33ed14[_0x3584('0x33')]['id']){delete _0x33ed14[_0x3584('0x33')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x33ed14[_0x3584('0x2f')]['id']}})['then'](handleEntityNotFound(_0x3e6a5c,null))[_0x3584('0xd')](saveUpdates(_0x33ed14[_0x3584('0x33')],null))['then'](respondWithResult(_0x3e6a5c,null))[_0x3584('0x2d')](handleError(_0x3e6a5c,null));};exports['destroy']=function(_0x2eb8b8,_0x5d0230){return db['Dynamics365Account'][_0x3584('0x31')]({'where':{'id':_0x2eb8b8[_0x3584('0x2f')]['id']}})[_0x3584('0xd')](handleEntityNotFound(_0x5d0230,null))['then'](removeEntity(_0x5d0230,null))[_0x3584('0x2d')](handleError(_0x5d0230,null));};exports[_0x3584('0x34')]=function(_0x4619f3,_0x256e2d){var _0x5a7223={};var _0x390076={};var _0x269777;var _0x54b68f;return db[_0x3584('0x17')][_0x3584('0x35')]({'where':{'id':_0x4619f3[_0x3584('0x2f')]['id']}})[_0x3584('0xd')](handleEntityNotFound(_0x256e2d,null))['then'](function(_0x74a4d1){if(_0x74a4d1){_0x269777=_0x74a4d1;_0x390076[_0x3584('0x19')]=_['keys'](db[_0x3584('0x36')][_0x3584('0x18')]);_0x390076[_0x3584('0x1a')]=_[_0x3584('0x30')](_0x4619f3[_0x3584('0x1a')]);_0x390076['filters']=_['intersection'](_0x390076['model'],_0x390076[_0x3584('0x1a')]);_0x5a7223[_0x3584('0x1d')]=_['intersection'](_0x390076[_0x3584('0x19')],qs['fields'](_0x4619f3[_0x3584('0x1a')][_0x3584('0x1e')]));_0x5a7223['attributes']=_0x5a7223[_0x3584('0x1d')][_0x3584('0x1f')]?_0x5a7223[_0x3584('0x1d')]:_0x390076[_0x3584('0x19')];_0x5a7223[_0x3584('0x21')]=qs[_0x3584('0x22')](_0x4619f3[_0x3584('0x1a')][_0x3584('0x22')]);_0x5a7223[_0x3584('0x23')]=qs[_0x3584('0x1b')](_['pick'](_0x4619f3['query'],_0x390076[_0x3584('0x1b')]));if(_0x4619f3[_0x3584('0x1a')][_0x3584('0x24')]){_0x5a7223['where']=_[_0x3584('0x25')](_0x5a7223[_0x3584('0x23')],{'$or':_[_0x3584('0x16')](_0x5a7223[_0x3584('0x1d')],function(_0x347850){var _0x42d250={};_0x42d250[_0x347850]={'$like':'%'+_0x4619f3['query']['filter']+'%'};return _0x42d250;})});}_0x5a7223=_[_0x3584('0x25')]({},_0x5a7223,_0x4619f3[_0x3584('0x27')]);return _0x269777[_0x3584('0x34')](_0x5a7223);}})['then'](function(_0x4a42f5){if(_0x4a42f5){_0x54b68f=_0x4a42f5[_0x3584('0x1f')];if(!_0x4619f3['query']['hasOwnProperty'](_0x3584('0x37'))){_0x5a7223[_0x3584('0x8')]=qs[_0x3584('0x8')](_0x4619f3[_0x3584('0x1a')][_0x3584('0x8')]);_0x5a7223[_0x3584('0x6')]=qs[_0x3584('0x6')](_0x4619f3[_0x3584('0x1a')][_0x3584('0x6')]);}return _0x269777[_0x3584('0x34')](_0x5a7223);}})[_0x3584('0xd')](function(_0x36e250){if(_0x36e250){return _0x36e250?{'count':_0x54b68f,'rows':_0x36e250}:null;}})[_0x3584('0xd')](respondWithResult(_0x256e2d,null))[_0x3584('0x2d')](handleError(_0x256e2d,null));};exports[_0x3584('0x38')]=function(_0x155b93,_0x4d760f){if(_0x155b93[_0x3584('0x33')]['id']){delete _0x155b93[_0x3584('0x33')]['id'];}return db[_0x3584('0x17')]['findOne']({'where':{'id':_0x155b93['params']['id']}})[_0x3584('0xd')](handleEntityNotFound(_0x4d760f,null))[_0x3584('0xd')](function(_0x272a6a){if(_0x272a6a){_0x155b93[_0x3584('0x33')]['AccountId']=_0x272a6a['id'];_0x155b93[_0x3584('0x33')][_0x3584('0x39')]=integrations[_0x3584('0x3a')](_0x155b93[_0x3584('0x33')][_0x3584('0x3b')],_0x155b93[_0x3584('0x33')][_0x3584('0x3c')]);_0x155b93[_0x3584('0x33')][_0x3584('0x3d')]=integrations[_0x3584('0x3e')](_0x155b93[_0x3584('0x33')][_0x3584('0x3b')],_0x155b93[_0x3584('0x33')][_0x3584('0x3c')]);return db['Dynamics365Configuration'][_0x3584('0x32')](_0x155b93[_0x3584('0x33')],{'include':[{'model':db[_0x3584('0x3f')],'as':_0x3584('0x39')},{'model':db[_0x3584('0x3f')],'as':_0x3584('0x3d')}]});}return null;})[_0x3584('0xd')](respondWithResult(_0x4d760f,null))[_0x3584('0x2d')](handleError(_0x4d760f,null));};function sanitizeRemoteUri(_0x4e0288){var _0x1b583b=_0x4e0288['slice'](-0x1);if(_0x1b583b==='/')return _0x4e0288[_0x3584('0x40')](0x0,_0x4e0288[_0x3584('0x41')](_0x1b583b));return _0x4e0288;}function getWebApiUrl(_0x1d4024){return util[_0x3584('0x42')](_0x3584('0x43'),_0x1d4024);}exports[_0x3584('0x44')]=function(_0x86698c,_0x467081){var _0x8ffd54=_0x86698c[_0x3584('0x1a')]['ticketType'];var _0x57bd67=_0x8ffd54==='incident'?_0x3584('0x45'):'PhoneCall';var _0x1e3822='';var _0x3b8741='';var _0x2781f2='';var _0x255c1f='';var _0x1a33a6='';var _0x1cb16c='';var _0x29ce85='';var _0x5ef293='';var _0x5299b0=[_0x3584('0x46'),_0x3584('0x47'),_0x3584('0x48'),'ownerid',_0x3584('0x49'),_0x3584('0x4a'),_0x3584('0x4b'),_0x3584('0x4c'),'directioncode',_0x3584('0x4d')];var _0x463c77=[_0x3584('0x4e'),_0x3584('0x4f'),_0x3584('0x50'),_0x3584('0x51'),'contactidname','contactidyominame',_0x3584('0x52'),_0x3584('0x53'),_0x3584('0x54'),_0x3584('0x55'),_0x3584('0x56'),'createdbyyominame',_0x3584('0x57'),_0x3584('0x58'),_0x3584('0x59'),_0x3584('0x5a'),'customeridtype','customeridyominame',_0x3584('0x5b'),_0x3584('0x5c'),_0x3584('0x5d'),_0x3584('0x5e'),_0x3584('0x5f'),_0x3584('0x60'),_0x3584('0x61'),_0x3584('0x62'),_0x3584('0x63'),_0x3584('0x64'),'kbarticleidname',_0x3584('0x65'),_0x3584('0x66'),_0x3584('0x67'),_0x3584('0x68'),_0x3584('0x69'),'modifiedbyyominame','modifiedon',_0x3584('0x6a'),_0x3584('0x6b'),'msdyn_incidenttypename','msdyn_iotalertname',_0x3584('0x6c'),_0x3584('0x6d'),_0x3584('0x6e'),_0x3584('0x6f'),_0x3584('0x70'),'owneridyominame','parentcaseidname',_0x3584('0x71'),'primarycontactidyominame',_0x3584('0x72'),'productidname',_0x3584('0x73'),'resolveby',_0x3584('0x74'),_0x3584('0x75'),_0x3584('0x76'),_0x3584('0x77'),_0x3584('0x78'),'slainvokedidname','slaname',_0x3584('0x79'),_0x3584('0x7a'),_0x3584('0x7b'),_0x3584('0x7c'),_0x3584('0x7d'),_0x3584('0x7e'),_0x3584('0x7f'),_0x3584('0x80'),_0x3584('0x81'),_0x3584('0x82')];var _0x44745f=_0x5299b0[_0x3584('0x83')](_0x463c77);return db[_0x3584('0x17')][_0x3584('0x35')]({'where':{'id':_0x86698c[_0x3584('0x2f')]['id']},'attributes':['id',_0x3584('0x84'),_0x3584('0x85'),'remoteUri',_0x3584('0x86'),_0x3584('0x87'),_0x3584('0x88'),_0x3584('0x89')],'include':[{'model':db[_0x3584('0x8a')],'as':'CloudProvider','attributes':['id',_0x3584('0x8b'),_0x3584('0x8c')]}]})['then'](handleEntityNotFound(_0x467081,null))['then'](function(_0x4fc07c){if(_0x4fc07c){if(_0x4fc07c[_0x3584('0x89')]){_0x4fc07c[_0x3584('0x8d')]=_0x4fc07c[_0x3584('0x8a')][_0x3584('0x8b')];_0x5ef293=sanitizeRemoteUri(_0x4fc07c['CloudProvider'][_0x3584('0x8c')]);_0x29ce85=getWebApiUrl(_0x5ef293);return _0x4fc07c;}_0x5ef293=sanitizeRemoteUri(_0x4fc07c['remoteUri']);_0x29ce85=getWebApiUrl(_0x5ef293);var _0x6479a9={'method':_0x3584('0x8e'),'uri':_0x3584('0x8f')+_0x4fc07c[_0x3584('0x86')]+'/oauth2/token','form':{'client_id':_0x4fc07c['clientId'],'resource':_0x5ef293,'username':_0x4fc07c[_0x3584('0x84')],'password':_0x4fc07c['password'],'grant_type':_0x3584('0x85'),'client_secret':_0x4fc07c['clientSecret']},'json':!![]};return rp(_0x6479a9);}})[_0x3584('0xd')](function(_0xb6b1c4){_0x1cb16c=_0xb6b1c4[_0x3584('0x8d')];var _0x39ed1b={'method':_0x3584('0x90'),'uri':encodeURI(_0x29ce85+_0x3584('0x91')+_0x57bd67+'\x27'),'headers':{'Authorization':_0x3584('0x92')+_0x1cb16c,'If-None-Match':null,'OData-Version':_0x3584('0x93')},'json':!![]};return rp(_0x39ed1b);})[_0x3584('0xd')](function(_0x5279ca){var _0x27dfa4=_0x5279ca['value'][0x0];var _0x44260d=_0x27dfa4[_0x3584('0x94')];var _0x58893c={'method':_0x3584('0x90'),'uri':_0x29ce85+_0x3584('0x95')+_0x44260d+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x3584('0x92')+_0x1cb16c,'If-None-Match':null,'OData-Version':_0x3584('0x93')},'json':!![]};return rp(_0x58893c);})[_0x3584('0xd')](function(_0xed0fda){_0x1e3822=_0xed0fda;_0x3b8741=_0x1e3822['Attributes'];_0x3b8741=_[_0x3584('0x96')](_0x3b8741,function(_0x1bcf77){return!_0x44745f[_0x3584('0x97')](_0x1bcf77[_0x3584('0x98')]);});var _0x766112=[];var _0x5c4165=[];_0x3b8741[_0x3584('0x99')](function(_0x2b9ed8){if(_0x2b9ed8[_0x3584('0x9a')]){var _0x5880c7=_0x2b9ed8[_0x3584('0x9a')][_0x3584('0x40')](_0x2b9ed8['@odata.type'][_0x3584('0x41')]('.')+0x1);if(_0x5880c7===_0x3584('0x9b')){_0x766112[_0x3584('0x9c')](getSelectList(_0x29ce85,_0x8ffd54,_0x5c4165,_0x1e3822[_0x3584('0x94')],_0x2b9ed8[_0x3584('0x94')],_0x1cb16c));}}});return Promise[_0x3584('0x9d')](_0x766112);})[_0x3584('0xd')](function(_0x5dca77){_0x2781f2=_0x5dca77[0x0];var _0x4cad9b=[];var _0xdb12e6=[];_0x3b8741[_0x3584('0x99')](function(_0x2af4cc){if(!_[_0x3584('0x9e')](_0x2af4cc[_0x3584('0x9a')])){var _0x3adbe6=_0x2af4cc[_0x3584('0x9a')]['substring'](_0x2af4cc[_0x3584('0x9a')]['lastIndexOf']('.')+0x1);if(_0x3adbe6===_0x3584('0x9f')){_0x4cad9b[_0x3584('0x9c')](getBooleanList(_0x29ce85,_0x8ffd54,_0xdb12e6,_0x1e3822[_0x3584('0x94')],_0x2af4cc[_0x3584('0x94')],_0x1cb16c));}}});return Promise[_0x3584('0x9d')](_0x4cad9b);})['then'](function(_0x4f32bb){_0x255c1f=_0x4f32bb[0x0];var _0x49ef65=[];var _0x1a1bc0=[];_0x3b8741[_0x3584('0x99')](function(_0x3d0d60){if(_0x3d0d60['@odata.type']){var _0x1a837b=_0x3d0d60[_0x3584('0x9a')][_0x3584('0x40')](_0x3d0d60[_0x3584('0x9a')]['lastIndexOf']('.')+0x1);if(_0x1a837b===_0x3584('0xa0')||_0x1a837b===_0x3584('0xa1')||_0x1a837b==='BigIntAttributeMetadata'||_0x1a837b===_0x3584('0xa2')||_0x1a837b===_0x3584('0xa3')||_0x1a837b==='DateTimeAttributeMetadata'||_0x1a837b===_0x3584('0xa4')||_0x1a837b==='EntityNameAttributeMetadata'||_0x1a837b==='StateAttributeMetadata'||_0x1a837b===_0x3584('0xa5')){_0x49ef65['push'](getInputList(_0x29ce85,_0x8ffd54,_0x1a837b,_0x1a1bc0,_0x1e3822[_0x3584('0x94')],_0x3d0d60[_0x3584('0x94')],_0x1cb16c));}}});return Promise['all'](_0x49ef65);})[_0x3584('0xd')](function(_0x447c95){_0x1a33a6=_0x447c95[0x0];var _0x10eb2c=_0x2781f2[_0x3584('0x83')](_0x255c1f)['concat'](_0x1a33a6);var _0x4c257c={'count':_0x10eb2c['length'],'rows':_0x10eb2c};return _0x4c257c;})[_0x3584('0xd')](respondWithResult(_0x467081,null))[_0x3584('0x2d')](function(_0x229442){var _0x43eb90=_0x86698c['query']['test']?0x1f4:_0x229442['statusCode']||0x1f4;logger[_0x3584('0x11')](_0x229442['stack']);delete _0x229442[_0x3584('0x13')];if(_0x43eb90===0x191){_0x43eb90=0x190;}_0x467081['status'](_0x43eb90)[_0x3584('0x14')](_0x86698c[_0x3584('0x1a')]['test']?{'message':_0x3584('0xa6'),'statusCode':_0x229442[_0x3584('0xa7')]}:_0x229442);});};function getSelectList(_0x58416b,_0x554a91,_0x2ad923,_0x3035d3,_0x1ddcb0,_0x28edb7){var _0x34daee={'method':_0x3584('0x90'),'uri':_0x58416b+_0x3584('0x95')+_0x3035d3+_0x3584('0xa8')+_0x1ddcb0+_0x3584('0xa9')+_0x3584('0xaa'),'headers':{'Authorization':_0x3584('0x92')+_0x28edb7,'If-None-Match':null,'OData-Version':_0x3584('0x93')},'json':!![]};return rp(_0x34daee)[_0x3584('0xd')](function(_0x32ecc3){var _0x1debd1=[];var _0x5a6722=_0x32ecc3[_0x3584('0xab')]['Options'];_0x5a6722[_0x3584('0x99')](function(_0x1f4ede){_0x1debd1[_0x3584('0x9c')]({'name':_0x1f4ede[_0x3584('0xac')][_0x3584('0xad')]['Label'],'value':String(_0x1f4ede[_0x3584('0xae')])});});var _0x1af9b9={'id':_0x554a91+'_'+_0x32ecc3[_0x3584('0x98')],'name':_0x32ecc3[_0x3584('0xaf')][_0x3584('0xad')][_0x3584('0xac')],'custom':![],'options':_0x1debd1};_0x2ad923['push'](_0x1af9b9);return _0x2ad923;});}function getBooleanList(_0x48a7e5,_0x316391,_0x406f4c,_0x262665,_0x22a733,_0x49afdf){var _0x2eb058={'method':_0x3584('0x90'),'uri':_0x48a7e5+_0x3584('0x95')+_0x262665+_0x3584('0xa8')+_0x22a733+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x3584('0x92')+_0x49afdf,'If-None-Match':null,'OData-Version':_0x3584('0x93')},'json':!![]};return rp(_0x2eb058)['then'](function(_0x526846){var _0x4ad253=[];_0x4ad253[_0x3584('0x9c')]({'name':_0x526846['OptionSet'][_0x3584('0xb0')][_0x3584('0xac')][_0x3584('0xad')][_0x3584('0xac')],'value':_0x3584('0xb1')},{'name':_0x526846[_0x3584('0xab')][_0x3584('0xb2')][_0x3584('0xac')][_0x3584('0xad')]['Label'],'value':_0x3584('0xb3')});var _0x3d924f={'id':_0x316391+'_'+_0x526846[_0x3584('0x98')],'name':_0x526846[_0x3584('0xaf')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x4ad253};_0x406f4c[_0x3584('0x9c')](_0x3d924f);return _0x406f4c;});}function getInputList(_0xca394d,_0xda249a,_0x2d6ec3,_0x45f32d,_0x21f0d6,_0x5b5193,_0x1c7a1b){var _0xb1c980={'method':_0x3584('0x90'),'uri':_0xca394d+_0x3584('0x95')+_0x21f0d6+_0x3584('0xa8')+_0x5b5193+')/Microsoft.Dynamics.CRM.'+_0x2d6ec3+_0x3584('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x1c7a1b,'If-None-Match':null,'OData-Version':_0x3584('0x93')},'json':!![]};return rp(_0xb1c980)[_0x3584('0xd')](function(_0x3e00d3){var _0x5b84d9={'id':_0xda249a+'_'+_0x3e00d3[_0x3584('0x98')],'name':_0x3e00d3[_0x3584('0xaf')]['UserLocalizedLabel']?_0x3e00d3[_0x3584('0xaf')][_0x3584('0xad')][_0x3584('0xac')]:_0x3e00d3[_0x3584('0x98')],'custom':![],'options':[]};_0x45f32d[_0x3584('0x9c')](_0x5b84d9);return _0x45f32d;});} \ No newline at end of file +var _0xdc32=['include','findAll','rows','catch','show','params','length','options','create','body','find','getConfigurations','filter','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Configuration','Dynamics365Field','substring','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','sentimentvalue','slainvokedidname','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','password','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','/oauth2/token','username','clientSecret','Bearer\x20','MetadataId','GET','EntityDefinitions(','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','lastIndexOf','BooleanAttributeMetadata','all','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','stack','send',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','error','name','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','includeAll'];(function(_0x20c882,_0x11e4e2){var _0x481a94=function(_0x22b4e5){while(--_0x22b4e5){_0x20c882['push'](_0x20c882['shift']());}};_0x481a94(++_0x11e4e2);}(_0xdc32,0x149));var _0x2dc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc32[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x2dc3('0x0'));var util=require(_0x2dc3('0x1'));var _=require('lodash');var qs=require(_0x2dc3('0x2'));var logger=require(_0x2dc3('0x3'))(_0x2dc3('0x4'));var db=require(_0x2dc3('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x2823a1,_0x5222a7){_0x5222a7=_0x5222a7||0xc8;return function(_0x590742){if(_0x590742){return _0x2823a1[_0x2dc3('0x6')](_0x5222a7)[_0x2dc3('0x7')](_0x590742);}};}function respondWithFilteredResult(_0x42ed74,_0x3566c1){return function(_0x77ed14){if(_0x77ed14){var _0x1ba32e=typeof _0x3566c1[_0x2dc3('0x8')]===_0x2dc3('0x9')&&typeof _0x3566c1[_0x2dc3('0xa')]==='undefined';var _0x353350=_0x77ed14[_0x2dc3('0xb')];var _0x1c0448=_0x1ba32e?0x0:_0x3566c1[_0x2dc3('0x8')];var _0x1511fd=_0x1ba32e?_0x77ed14['count']:_0x3566c1[_0x2dc3('0x8')]+_0x3566c1[_0x2dc3('0xa')];var _0x3b7b9a;if(_0x1511fd>=_0x353350){_0x1511fd=_0x353350;_0x3b7b9a=0xc8;}else{_0x3b7b9a=0xce;}_0x42ed74[_0x2dc3('0x6')](_0x3b7b9a);return _0x42ed74[_0x2dc3('0xc')]('Content-Range',_0x1c0448+'-'+_0x1511fd+'/'+_0x353350)[_0x2dc3('0x7')](_0x77ed14);}return null;};}function saveUpdates(_0x224f52){return function(_0x3a0b1c){if(_0x3a0b1c){return _0x3a0b1c[_0x2dc3('0xd')](_0x224f52)[_0x2dc3('0xe')](function(_0x387bec){return _0x387bec;});}return null;};}function removeEntity(_0x5575d3){return function(_0x2aa84d){if(_0x2aa84d){return _0x2aa84d[_0x2dc3('0xf')]()[_0x2dc3('0xe')](function(){_0x5575d3[_0x2dc3('0x6')](0xcc)[_0x2dc3('0x10')]();});}};}function handleEntityNotFound(_0x2f0e1e){return function(_0x39aa40){if(!_0x39aa40){_0x2f0e1e[_0x2dc3('0x11')](0x194);}return _0x39aa40;};}function handleError(_0x43baf9,_0x5e4770){_0x5e4770=_0x5e4770||0x1f4;return function(_0x6d678d){logger[_0x2dc3('0x12')](_0x6d678d['stack']);if(_0x6d678d[_0x2dc3('0x13')]){delete _0x6d678d['name'];}_0x43baf9[_0x2dc3('0x6')](_0x5e4770)['send'](_0x6d678d);};}exports[_0x2dc3('0x14')]=function(_0x311b9b,_0x16b9f1){var _0x4a480a={},_0x52dfe0={},_0x37785b={'count':0x0,'rows':[]};var _0x25e0e3=_['map'](db[_0x2dc3('0x15')][_0x2dc3('0x16')],function(_0x43d827){return{'name':_0x43d827[_0x2dc3('0x17')],'type':_0x43d827[_0x2dc3('0x18')][_0x2dc3('0x19')]};});_0x52dfe0[_0x2dc3('0x1a')]=_[_0x2dc3('0x1b')](_0x25e0e3,_0x2dc3('0x13'));_0x52dfe0['query']=_[_0x2dc3('0x1c')](_0x311b9b[_0x2dc3('0x1d')]);_0x52dfe0[_0x2dc3('0x1e')]=_[_0x2dc3('0x1f')](_0x52dfe0[_0x2dc3('0x1a')],_0x52dfe0[_0x2dc3('0x1d')]);_0x4a480a[_0x2dc3('0x20')]=_[_0x2dc3('0x1f')](_0x52dfe0['model'],qs['fields'](_0x311b9b[_0x2dc3('0x1d')][_0x2dc3('0x21')]));_0x4a480a[_0x2dc3('0x20')]=_0x4a480a[_0x2dc3('0x20')]['length']?_0x4a480a['attributes']:_0x52dfe0[_0x2dc3('0x1a')];if(!_0x311b9b[_0x2dc3('0x1d')][_0x2dc3('0x22')]('nolimit')){_0x4a480a[_0x2dc3('0xa')]=qs[_0x2dc3('0xa')](_0x311b9b[_0x2dc3('0x1d')][_0x2dc3('0xa')]);_0x4a480a[_0x2dc3('0x8')]=qs[_0x2dc3('0x8')](_0x311b9b[_0x2dc3('0x1d')]['offset']);}_0x4a480a['order']=qs['sort'](_0x311b9b['query'][_0x2dc3('0x23')]);_0x4a480a[_0x2dc3('0x24')]=qs[_0x2dc3('0x1e')](_[_0x2dc3('0x25')](_0x311b9b[_0x2dc3('0x1d')],_0x52dfe0['filters']),_0x25e0e3);if(_0x311b9b[_0x2dc3('0x1d')]['filter']){_0x4a480a[_0x2dc3('0x24')]=_[_0x2dc3('0x26')](_0x4a480a['where'],{'$or':_[_0x2dc3('0x1b')](_0x25e0e3,function(_0x39d125){if(_0x39d125[_0x2dc3('0x18')]!==_0x2dc3('0x27')){var _0x426168={};_0x426168[_0x39d125[_0x2dc3('0x13')]]={'$like':'%'+_0x311b9b[_0x2dc3('0x1d')]['filter']+'%'};return _0x426168;}})});}_0x4a480a=_['merge']({},_0x4a480a,_0x311b9b['options']);var _0x4094ea={'where':_0x4a480a[_0x2dc3('0x24')]};return db[_0x2dc3('0x15')][_0x2dc3('0xb')](_0x4094ea)['then'](function(_0x43f740){_0x37785b['count']=_0x43f740;if(_0x311b9b[_0x2dc3('0x1d')][_0x2dc3('0x28')]){_0x4a480a[_0x2dc3('0x29')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x2dc3('0x2a')](_0x4a480a);})[_0x2dc3('0xe')](function(_0x56c10c){_0x37785b[_0x2dc3('0x2b')]=_0x56c10c;return _0x37785b;})[_0x2dc3('0xe')](respondWithFilteredResult(_0x16b9f1,_0x4a480a))[_0x2dc3('0x2c')](handleError(_0x16b9f1,null));};exports[_0x2dc3('0x2d')]=function(_0x19339b,_0x5b1871){var _0x53b642={'raw':![],'where':{'id':_0x19339b[_0x2dc3('0x2e')]['id']}},_0x27c9e9={};_0x27c9e9[_0x2dc3('0x1a')]=_[_0x2dc3('0x1c')](db[_0x2dc3('0x15')][_0x2dc3('0x16')]);_0x27c9e9[_0x2dc3('0x1d')]=_[_0x2dc3('0x1c')](_0x19339b[_0x2dc3('0x1d')]);_0x27c9e9['filters']=_[_0x2dc3('0x1f')](_0x27c9e9[_0x2dc3('0x1a')],_0x27c9e9[_0x2dc3('0x1d')]);_0x53b642[_0x2dc3('0x20')]=_[_0x2dc3('0x1f')](_0x27c9e9[_0x2dc3('0x1a')],qs[_0x2dc3('0x21')](_0x19339b[_0x2dc3('0x1d')][_0x2dc3('0x21')]));_0x53b642['attributes']=_0x53b642['attributes'][_0x2dc3('0x2f')]?_0x53b642[_0x2dc3('0x20')]:_0x27c9e9[_0x2dc3('0x1a')];if(_0x19339b['query'][_0x2dc3('0x28')]){_0x53b642['include']=[{'all':!![]}];}_0x53b642=_[_0x2dc3('0x26')]({},_0x53b642,_0x19339b[_0x2dc3('0x30')]);return db[_0x2dc3('0x15')]['find'](_0x53b642)[_0x2dc3('0xe')](handleEntityNotFound(_0x5b1871,null))['then'](respondWithResult(_0x5b1871,null))[_0x2dc3('0x2c')](handleError(_0x5b1871,null));};exports[_0x2dc3('0x31')]=function(_0x165b70,_0x409179){return db['Dynamics365Account'][_0x2dc3('0x31')](_0x165b70[_0x2dc3('0x32')],{})['then'](respondWithResult(_0x409179,0xc9))[_0x2dc3('0x2c')](handleError(_0x409179,null));};exports[_0x2dc3('0xd')]=function(_0x2543d7,_0x1f0fe8){if(_0x2543d7[_0x2dc3('0x32')]['id']){delete _0x2543d7[_0x2dc3('0x32')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x2543d7[_0x2dc3('0x2e')]['id']}})[_0x2dc3('0xe')](handleEntityNotFound(_0x1f0fe8,null))[_0x2dc3('0xe')](saveUpdates(_0x2543d7[_0x2dc3('0x32')],null))[_0x2dc3('0xe')](respondWithResult(_0x1f0fe8,null))[_0x2dc3('0x2c')](handleError(_0x1f0fe8,null));};exports['destroy']=function(_0x3388e2,_0x1e9ad1){return db['Dynamics365Account'][_0x2dc3('0x33')]({'where':{'id':_0x3388e2[_0x2dc3('0x2e')]['id']}})[_0x2dc3('0xe')](handleEntityNotFound(_0x1e9ad1,null))['then'](removeEntity(_0x1e9ad1,null))[_0x2dc3('0x2c')](handleError(_0x1e9ad1,null));};exports[_0x2dc3('0x34')]=function(_0xadd790,_0x432316){var _0x11b0b4={};var _0x502b1e={};var _0x3ce8be;var _0xa6923d;return db['Dynamics365Account']['findOne']({'where':{'id':_0xadd790[_0x2dc3('0x2e')]['id']}})['then'](handleEntityNotFound(_0x432316,null))[_0x2dc3('0xe')](function(_0x57df53){if(_0x57df53){_0x3ce8be=_0x57df53;_0x502b1e['model']=_[_0x2dc3('0x1c')](db['Dynamics365Configuration']['rawAttributes']);_0x502b1e[_0x2dc3('0x1d')]=_[_0x2dc3('0x1c')](_0xadd790['query']);_0x502b1e[_0x2dc3('0x1e')]=_[_0x2dc3('0x1f')](_0x502b1e[_0x2dc3('0x1a')],_0x502b1e['query']);_0x11b0b4[_0x2dc3('0x20')]=_[_0x2dc3('0x1f')](_0x502b1e[_0x2dc3('0x1a')],qs['fields'](_0xadd790[_0x2dc3('0x1d')][_0x2dc3('0x21')]));_0x11b0b4[_0x2dc3('0x20')]=_0x11b0b4[_0x2dc3('0x20')][_0x2dc3('0x2f')]?_0x11b0b4[_0x2dc3('0x20')]:_0x502b1e['model'];_0x11b0b4['order']=qs[_0x2dc3('0x23')](_0xadd790[_0x2dc3('0x1d')]['sort']);_0x11b0b4[_0x2dc3('0x24')]=qs[_0x2dc3('0x1e')](_[_0x2dc3('0x25')](_0xadd790['query'],_0x502b1e['filters']));if(_0xadd790[_0x2dc3('0x1d')][_0x2dc3('0x35')]){_0x11b0b4[_0x2dc3('0x24')]=_[_0x2dc3('0x26')](_0x11b0b4['where'],{'$or':_[_0x2dc3('0x1b')](_0x11b0b4['attributes'],function(_0x5e8de6){var _0x380c45={};_0x380c45[_0x5e8de6]={'$like':'%'+_0xadd790[_0x2dc3('0x1d')][_0x2dc3('0x35')]+'%'};return _0x380c45;})});}_0x11b0b4=_['merge']({},_0x11b0b4,_0xadd790[_0x2dc3('0x30')]);return _0x3ce8be[_0x2dc3('0x34')](_0x11b0b4);}})['then'](function(_0x1a367a){if(_0x1a367a){_0xa6923d=_0x1a367a[_0x2dc3('0x2f')];if(!_0xadd790[_0x2dc3('0x1d')][_0x2dc3('0x22')]('nolimit')){_0x11b0b4['limit']=qs[_0x2dc3('0xa')](_0xadd790[_0x2dc3('0x1d')][_0x2dc3('0xa')]);_0x11b0b4['offset']=qs['offset'](_0xadd790[_0x2dc3('0x1d')][_0x2dc3('0x8')]);}return _0x3ce8be['getConfigurations'](_0x11b0b4);}})[_0x2dc3('0xe')](function(_0x553d2d){if(_0x553d2d){return _0x553d2d?{'count':_0xa6923d,'rows':_0x553d2d}:null;}})[_0x2dc3('0xe')](respondWithResult(_0x432316,null))[_0x2dc3('0x2c')](handleError(_0x432316,null));};exports[_0x2dc3('0x36')]=function(_0x31e620,_0x26928b){if(_0x31e620[_0x2dc3('0x32')]['id']){delete _0x31e620[_0x2dc3('0x32')]['id'];}return db[_0x2dc3('0x15')][_0x2dc3('0x37')]({'where':{'id':_0x31e620['params']['id']}})['then'](handleEntityNotFound(_0x26928b,null))[_0x2dc3('0xe')](function(_0x4586fc){if(_0x4586fc){_0x31e620[_0x2dc3('0x32')][_0x2dc3('0x38')]=_0x4586fc['id'];_0x31e620[_0x2dc3('0x32')][_0x2dc3('0x39')]=integrations[_0x2dc3('0x3a')](_0x31e620[_0x2dc3('0x32')]['channel'],_0x31e620[_0x2dc3('0x32')][_0x2dc3('0x18')]);_0x31e620[_0x2dc3('0x32')][_0x2dc3('0x3b')]=integrations[_0x2dc3('0x3c')](_0x31e620[_0x2dc3('0x32')][_0x2dc3('0x3d')],_0x31e620[_0x2dc3('0x32')]['type']);return db[_0x2dc3('0x3e')][_0x2dc3('0x31')](_0x31e620['body'],{'include':[{'model':db[_0x2dc3('0x3f')],'as':'Subjects'},{'model':db[_0x2dc3('0x3f')],'as':_0x2dc3('0x3b')}]});}return null;})[_0x2dc3('0xe')](respondWithResult(_0x26928b,null))['catch'](handleError(_0x26928b,null));};function sanitizeRemoteUri(_0x542339){var _0x3d5470=_0x542339['slice'](-0x1);if(_0x3d5470==='/')return _0x542339[_0x2dc3('0x40')](0x0,_0x542339['lastIndexOf'](_0x3d5470));return _0x542339;}function getWebApiUrl(_0x5b6688){return util[_0x2dc3('0x41')](_0x2dc3('0x42'),_0x5b6688);}exports['getFields']=function(_0x2ae1d5,_0x27d4dc){var _0x5231b2=_0x2ae1d5[_0x2dc3('0x1d')][_0x2dc3('0x43')];var _0x570e0d=_0x5231b2===_0x2dc3('0x44')?_0x2dc3('0x45'):_0x2dc3('0x46');var _0x1ea5ac='';var _0x2c4c0b='';var _0x33b182='';var _0x1a2191='';var _0xbb9d35='';var _0xcc33b0='';var _0x5c8ff5='';var _0x4238d0='';var _0x2e3cec=['title','description',_0x2dc3('0x47'),_0x2dc3('0x48'),_0x2dc3('0x49'),_0x2dc3('0x4a'),_0x2dc3('0x4b'),_0x2dc3('0x4c'),_0x2dc3('0x4d'),_0x2dc3('0x4e')];var _0x106002=[_0x2dc3('0x4f'),_0x2dc3('0x50'),_0x2dc3('0x51'),_0x2dc3('0x52'),_0x2dc3('0x53'),_0x2dc3('0x54'),_0x2dc3('0x55'),_0x2dc3('0x56'),_0x2dc3('0x57'),_0x2dc3('0x58'),_0x2dc3('0x59'),'createdbyyominame','createdon',_0x2dc3('0x5a'),_0x2dc3('0x5b'),_0x2dc3('0x5c'),_0x2dc3('0x5d'),_0x2dc3('0x5e'),'emailaddress',_0x2dc3('0x5f'),'entityimage_timestamp',_0x2dc3('0x60'),_0x2dc3('0x61'),_0x2dc3('0x62'),_0x2dc3('0x63'),'followupby',_0x2dc3('0x64'),_0x2dc3('0x65'),_0x2dc3('0x66'),_0x2dc3('0x67'),_0x2dc3('0x68'),_0x2dc3('0x69'),'modifiedbyexternalpartyyominame',_0x2dc3('0x6a'),_0x2dc3('0x6b'),_0x2dc3('0x6c'),_0x2dc3('0x6d'),'modifiedonbehalfbyyominame',_0x2dc3('0x6e'),_0x2dc3('0x6f'),_0x2dc3('0x70'),_0x2dc3('0x71'),_0x2dc3('0x72'),_0x2dc3('0x73'),_0x2dc3('0x74'),'owneridyominame',_0x2dc3('0x75'),'primarycontactidname','primarycontactidyominame','prioritycodename',_0x2dc3('0x76'),_0x2dc3('0x77'),_0x2dc3('0x78'),_0x2dc3('0x79'),_0x2dc3('0x7a'),'responsiblecontactidname','responsiblecontactidyominame',_0x2dc3('0x7b'),_0x2dc3('0x7c'),'slaname',_0x2dc3('0x7d'),_0x2dc3('0x7e'),'statuscode','subjectidname',_0x2dc3('0x7f'),_0x2dc3('0x80'),_0x2dc3('0x81'),'traversedpath','utcconversiontimezonecode',_0x2dc3('0x82')];var _0x379ec0=_0x2e3cec[_0x2dc3('0x83')](_0x106002);return db[_0x2dc3('0x15')]['findOne']({'where':{'id':_0x2ae1d5[_0x2dc3('0x2e')]['id']},'attributes':['id','username',_0x2dc3('0x84'),_0x2dc3('0x85'),_0x2dc3('0x86'),_0x2dc3('0x87'),'clientSecret',_0x2dc3('0x88')],'include':[{'model':db[_0x2dc3('0x89')],'as':_0x2dc3('0x89'),'attributes':['id',_0x2dc3('0x8a'),_0x2dc3('0x8b')]}]})[_0x2dc3('0xe')](handleEntityNotFound(_0x27d4dc,null))[_0x2dc3('0xe')](function(_0x4d0455){if(_0x4d0455){if(_0x4d0455[_0x2dc3('0x88')]){_0x4d0455[_0x2dc3('0x8c')]=_0x4d0455['CloudProvider'][_0x2dc3('0x8a')];_0x4238d0=sanitizeRemoteUri(_0x4d0455[_0x2dc3('0x89')][_0x2dc3('0x8b')]);_0x5c8ff5=getWebApiUrl(_0x4238d0);return _0x4d0455;}_0x4238d0=sanitizeRemoteUri(_0x4d0455[_0x2dc3('0x85')]);_0x5c8ff5=getWebApiUrl(_0x4238d0);var _0x1297c9={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x4d0455[_0x2dc3('0x86')]+_0x2dc3('0x8d'),'form':{'client_id':_0x4d0455[_0x2dc3('0x87')],'resource':_0x4238d0,'username':_0x4d0455[_0x2dc3('0x8e')],'password':_0x4d0455[_0x2dc3('0x84')],'grant_type':_0x2dc3('0x84'),'client_secret':_0x4d0455[_0x2dc3('0x8f')]},'json':!![]};return rp(_0x1297c9);}})[_0x2dc3('0xe')](function(_0x118007){_0xcc33b0=_0x118007['access_token'];var _0x384d15={'method':'GET','uri':encodeURI(_0x5c8ff5+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x570e0d+'\x27'),'headers':{'Authorization':_0x2dc3('0x90')+_0xcc33b0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x384d15);})[_0x2dc3('0xe')](function(_0x5c7307){var _0x492972=_0x5c7307['value'][0x0];var _0x334965=_0x492972[_0x2dc3('0x91')];var _0x4db89e={'method':_0x2dc3('0x92'),'uri':_0x5c8ff5+_0x2dc3('0x93')+_0x334965+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x2dc3('0x90')+_0xcc33b0,'If-None-Match':null,'OData-Version':_0x2dc3('0x94')},'json':!![]};return rp(_0x4db89e);})[_0x2dc3('0xe')](function(_0x26d803){_0x1ea5ac=_0x26d803;_0x2c4c0b=_0x1ea5ac[_0x2dc3('0x95')];_0x2c4c0b=_[_0x2dc3('0x96')](_0x2c4c0b,function(_0x12a087){return!_0x379ec0[_0x2dc3('0x97')](_0x12a087[_0x2dc3('0x98')]);});var _0x15f478=[];var _0x3c29ba=[];_0x2c4c0b[_0x2dc3('0x99')](function(_0x4e76d4){if(_0x4e76d4[_0x2dc3('0x9a')]){var _0xc78573=_0x4e76d4['@odata.type']['substring'](_0x4e76d4['@odata.type']['lastIndexOf']('.')+0x1);if(_0xc78573===_0x2dc3('0x9b')){_0x15f478[_0x2dc3('0x9c')](getSelectList(_0x5c8ff5,_0x5231b2,_0x3c29ba,_0x1ea5ac[_0x2dc3('0x91')],_0x4e76d4[_0x2dc3('0x91')],_0xcc33b0));}}});return Promise['all'](_0x15f478);})[_0x2dc3('0xe')](function(_0x2ab4e8){_0x33b182=_0x2ab4e8[0x0];var _0x1936c5=[];var _0x18dc21=[];_0x2c4c0b['forEach'](function(_0x56233b){if(!_[_0x2dc3('0x9d')](_0x56233b[_0x2dc3('0x9a')])){var _0x389f84=_0x56233b['@odata.type'][_0x2dc3('0x40')](_0x56233b['@odata.type'][_0x2dc3('0x9e')]('.')+0x1);if(_0x389f84===_0x2dc3('0x9f')){_0x1936c5['push'](getBooleanList(_0x5c8ff5,_0x5231b2,_0x18dc21,_0x1ea5ac['MetadataId'],_0x56233b[_0x2dc3('0x91')],_0xcc33b0));}}});return Promise[_0x2dc3('0xa0')](_0x1936c5);})[_0x2dc3('0xe')](function(_0x267e09){_0x1a2191=_0x267e09[0x0];var _0x57656=[];var _0x47adcf=[];_0x2c4c0b[_0x2dc3('0x99')](function(_0x2b47a7){if(_0x2b47a7[_0x2dc3('0x9a')]){var _0x3392ec=_0x2b47a7[_0x2dc3('0x9a')][_0x2dc3('0x40')](_0x2b47a7[_0x2dc3('0x9a')]['lastIndexOf']('.')+0x1);if(_0x3392ec==='StringAttributeMetadata'||_0x3392ec==='DoubleAttributeMetadata'||_0x3392ec==='BigIntAttributeMetadata'||_0x3392ec===_0x2dc3('0xa1')||_0x3392ec===_0x2dc3('0xa2')||_0x3392ec===_0x2dc3('0xa3')||_0x3392ec===_0x2dc3('0xa4')||_0x3392ec===_0x2dc3('0xa5')||_0x3392ec===_0x2dc3('0xa6')||_0x3392ec==='DecimalAttributeMetadata'){_0x57656['push'](getInputList(_0x5c8ff5,_0x5231b2,_0x3392ec,_0x47adcf,_0x1ea5ac[_0x2dc3('0x91')],_0x2b47a7['MetadataId'],_0xcc33b0));}}});return Promise[_0x2dc3('0xa0')](_0x57656);})['then'](function(_0x1705c5){_0xbb9d35=_0x1705c5[0x0];var _0x2b5dff=_0x33b182[_0x2dc3('0x83')](_0x1a2191)[_0x2dc3('0x83')](_0xbb9d35);var _0x1c2542={'count':_0x2b5dff[_0x2dc3('0x2f')],'rows':_0x2b5dff};return _0x1c2542;})[_0x2dc3('0xe')](respondWithResult(_0x27d4dc,null))['catch'](function(_0x4f6ba7){var _0x56c62d=_0x2ae1d5[_0x2dc3('0x1d')][_0x2dc3('0xa7')]?0x1f4:_0x4f6ba7[_0x2dc3('0xa8')]||0x1f4;logger[_0x2dc3('0x12')](_0x4f6ba7[_0x2dc3('0xa9')]);delete _0x4f6ba7['name'];if(_0x56c62d===0x191){_0x56c62d=0x190;}_0x27d4dc[_0x2dc3('0x6')](_0x56c62d)[_0x2dc3('0xaa')](_0x2ae1d5['query'][_0x2dc3('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x4f6ba7[_0x2dc3('0xa8')]}:_0x4f6ba7);});};function getSelectList(_0x1a1ef0,_0x2b39d4,_0x3880a9,_0x38b934,_0x1cd8a9,_0x427f6f){var _0x32ae01={'method':'GET','uri':_0x1a1ef0+_0x2dc3('0x93')+_0x38b934+_0x2dc3('0xab')+_0x1cd8a9+_0x2dc3('0xac')+_0x2dc3('0xad'),'headers':{'Authorization':_0x2dc3('0x90')+_0x427f6f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x32ae01)[_0x2dc3('0xe')](function(_0x49c6ea){var _0x50cfb4=[];var _0x1f2d60=_0x49c6ea['OptionSet'][_0x2dc3('0xae')];_0x1f2d60[_0x2dc3('0x99')](function(_0x34e808){_0x50cfb4[_0x2dc3('0x9c')]({'name':_0x34e808[_0x2dc3('0xaf')]['UserLocalizedLabel'][_0x2dc3('0xaf')],'value':String(_0x34e808['Value'])});});var _0x48af={'id':_0x2b39d4+'_'+_0x49c6ea[_0x2dc3('0x98')],'name':_0x49c6ea[_0x2dc3('0xb0')][_0x2dc3('0xb1')][_0x2dc3('0xaf')],'custom':![],'options':_0x50cfb4};_0x3880a9['push'](_0x48af);return _0x3880a9;});}function getBooleanList(_0x260ba0,_0x29838c,_0xa6d6b0,_0x4fcb77,_0x1efb06,_0x61b668){var _0x3a809f={'method':'GET','uri':_0x260ba0+_0x2dc3('0x93')+_0x4fcb77+_0x2dc3('0xab')+_0x1efb06+_0x2dc3('0xb2'),'headers':{'Authorization':_0x2dc3('0x90')+_0x61b668,'If-None-Match':null,'OData-Version':_0x2dc3('0x94')},'json':!![]};return rp(_0x3a809f)[_0x2dc3('0xe')](function(_0xed233){var _0x375d76=[];_0x375d76['push']({'name':_0xed233[_0x2dc3('0xb3')]['TrueOption'][_0x2dc3('0xaf')]['UserLocalizedLabel'][_0x2dc3('0xaf')],'value':_0x2dc3('0xb4')},{'name':_0xed233[_0x2dc3('0xb3')][_0x2dc3('0xb5')][_0x2dc3('0xaf')]['UserLocalizedLabel'][_0x2dc3('0xaf')],'value':_0x2dc3('0xb6')});var _0x3459db={'id':_0x29838c+'_'+_0xed233[_0x2dc3('0x98')],'name':_0xed233[_0x2dc3('0xb0')][_0x2dc3('0xb1')][_0x2dc3('0xaf')],'custom':![],'options':_0x375d76};_0xa6d6b0[_0x2dc3('0x9c')](_0x3459db);return _0xa6d6b0;});}function getInputList(_0x491e62,_0x1faf8d,_0x152566,_0x505d7a,_0x39599f,_0x368b56,_0xcb54ae){var _0x4b2b71={'method':_0x2dc3('0x92'),'uri':_0x491e62+_0x2dc3('0x93')+_0x39599f+_0x2dc3('0xab')+_0x368b56+_0x2dc3('0xb7')+_0x152566+_0x2dc3('0xb8'),'headers':{'Authorization':'Bearer\x20'+_0xcb54ae,'If-None-Match':null,'OData-Version':_0x2dc3('0x94')},'json':!![]};return rp(_0x4b2b71)[_0x2dc3('0xe')](function(_0x173c16){var _0x13c004={'id':_0x1faf8d+'_'+_0x173c16['LogicalName'],'name':_0x173c16[_0x2dc3('0xb0')][_0x2dc3('0xb1')]?_0x173c16[_0x2dc3('0xb0')][_0x2dc3('0xb1')]['Label']:_0x173c16[_0x2dc3('0x98')],'custom':![],'options':[]};_0x505d7a[_0x2dc3('0x9c')](_0x13c004);return _0x505d7a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 286be12..5b89773 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x43b7b0,_0x565978){var _0x2b4f6e=function(_0x466532){while(--_0x466532){_0x43b7b0['push'](_0x43b7b0['shift']());}};_0x2b4f6e(++_0x565978);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','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 83dfda7..2e6b8d3 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 _0xc9c1=['where','attributes','limit','include','map','model','info','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw'];(function(_0x5a38e9,_0x2cb2fd){var _0x320217=function(_0x5e5d11){while(--_0x5e5d11){_0x5a38e9['push'](_0x5a38e9['shift']());}};_0x320217(++_0x2cb2fd);}(_0xc9c1,0x120));var _0x1c9c=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xc9c1[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x1c9c('0x0'));var util=require(_0x1c9c('0x1'));var moment=require(_0x1c9c('0x2'));var BPromise=require(_0x1c9c('0x3'));var rs=require(_0x1c9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c9c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c9c('0x6'))(_0x1c9c('0x7'));var config=require(_0x1c9c('0x8'));var jayson=require(_0x1c9c('0x9'));var client=jayson[_0x1c9c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x136e4b,_0x367235,_0x141ea6){return new BPromise(function(_0x340879,_0x3a8ecb){return client[_0x1c9c('0xb')](_0x136e4b,_0x141ea6)[_0x1c9c('0xc')](function(_0x590321){logger['info'](_0x1c9c('0xd'),_0x367235,'request\x20sent');logger[_0x1c9c('0xe')](_0x1c9c('0xf'),_0x367235,'request\x20sent',JSON[_0x1c9c('0x10')](_0x590321));if(_0x590321[_0x1c9c('0x11')]){if(_0x590321[_0x1c9c('0x11')][_0x1c9c('0x12')]===0x1f4){logger[_0x1c9c('0x11')](_0x1c9c('0xd'),_0x367235,_0x590321[_0x1c9c('0x11')][_0x1c9c('0x13')]);return _0x3a8ecb(_0x590321[_0x1c9c('0x11')]['message']);}logger[_0x1c9c('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x367235,_0x590321['error'][_0x1c9c('0x13')]);return _0x340879(_0x590321[_0x1c9c('0x11')][_0x1c9c('0x13')]);}else{logger['info'](_0x1c9c('0xd'),_0x367235,'request\x20sent');_0x340879(_0x590321[_0x1c9c('0x14')][_0x1c9c('0x13')]);}})[_0x1c9c('0x15')](function(_0x21970f){logger['error'](_0x1c9c('0xd'),_0x367235,_0x21970f);_0x3a8ecb(_0x21970f);});});}exports[_0x1c9c('0x16')]=function(_0x1b764d){var _0x549c20=this;return new Promise(function(_0x342d60,_0xd4d17a){return db[_0x1c9c('0x17')][_0x1c9c('0x18')]({'raw':_0x1b764d[_0x1c9c('0x19')]?_0x1b764d[_0x1c9c('0x19')][_0x1c9c('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b764d[_0x1c9c('0x19')]?_0x1b764d[_0x1c9c('0x19')][_0x1c9c('0x1b')]||null:null,'attributes':_0x1b764d[_0x1c9c('0x19')]?_0x1b764d[_0x1c9c('0x19')][_0x1c9c('0x1c')]||null:null,'limit':_0x1b764d[_0x1c9c('0x19')]?_0x1b764d[_0x1c9c('0x19')][_0x1c9c('0x1d')]||null:null,'include':_0x1b764d[_0x1c9c('0x19')]?_0x1b764d[_0x1c9c('0x19')][_0x1c9c('0x1e')]?_[_0x1c9c('0x1f')](_0x1b764d['options'][_0x1c9c('0x1e')],function(_0x1eb218){return{'model':db[_0x1eb218[_0x1c9c('0x20')]],'as':_0x1eb218['as'],'attributes':_0x1eb218[_0x1c9c('0x1c')],'include':_0x1eb218[_0x1c9c('0x1e')]?_[_0x1c9c('0x1f')](_0x1eb218[_0x1c9c('0x1e')],function(_0x13c01){return{'model':db[_0x13c01['model']],'as':_0x13c01['as'],'attributes':_0x13c01['attributes'],'include':_0x13c01[_0x1c9c('0x1e')]?_['map'](_0x13c01[_0x1c9c('0x1e')],function(_0x403f64){return{'model':db[_0x403f64['model']],'as':_0x403f64['as'],'attributes':_0x403f64[_0x1c9c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1c9c('0xc')](function(_0x1c1980){logger[_0x1c9c('0x21')](_0x1c9c('0x16'),_0x1b764d);logger[_0x1c9c('0xe')](_0x1c9c('0x16'),_0x1b764d,JSON[_0x1c9c('0x10')](_0x1c1980));_0x342d60(_0x1c1980);})[_0x1c9c('0x15')](function(_0x5be83b){logger['error'](_0x1c9c('0x16'),_0x5be83b[_0x1c9c('0x13')],_0x1b764d);_0xd4d17a(_0x549c20[_0x1c9c('0x11')](0x1f4,_0x5be83b[_0x1c9c('0x13')]));});});};exports[_0x1c9c('0x22')]=function(_0x200f8a){var _0x5188f5=this;return new Promise(function(_0x308674,_0x541685){return db['Dynamics365Account']['find']({'raw':_0x200f8a[_0x1c9c('0x19')]?_0x200f8a[_0x1c9c('0x19')][_0x1c9c('0x1a')]===undefined?!![]:![]:!![],'where':_0x200f8a[_0x1c9c('0x19')]?_0x200f8a[_0x1c9c('0x19')][_0x1c9c('0x1b')]||null:null,'attributes':_0x200f8a[_0x1c9c('0x19')]?_0x200f8a['options'][_0x1c9c('0x1c')]||null:null,'include':_0x200f8a[_0x1c9c('0x19')]?_0x200f8a[_0x1c9c('0x19')][_0x1c9c('0x1e')]?_[_0x1c9c('0x1f')](_0x200f8a['options'][_0x1c9c('0x1e')],function(_0x44b1f9){return{'model':db[_0x44b1f9[_0x1c9c('0x20')]],'as':_0x44b1f9['as'],'attributes':_0x44b1f9[_0x1c9c('0x1c')],'include':_0x44b1f9[_0x1c9c('0x1e')]?_[_0x1c9c('0x1f')](_0x44b1f9[_0x1c9c('0x1e')],function(_0x20dd25){return{'model':db[_0x20dd25[_0x1c9c('0x20')]],'as':_0x20dd25['as'],'attributes':_0x20dd25[_0x1c9c('0x1c')],'include':_0x20dd25['include']?_['map'](_0x20dd25['include'],function(_0x4f702a){return{'model':db[_0x4f702a['model']],'as':_0x4f702a['as'],'attributes':_0x4f702a['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c9c('0xc')](function(_0x527bff){logger[_0x1c9c('0x21')](_0x1c9c('0x22'),_0x200f8a);logger[_0x1c9c('0xe')]('ShowDynamics365Account',_0x200f8a,JSON[_0x1c9c('0x10')](_0x527bff));_0x308674(_0x527bff);})[_0x1c9c('0x15')](function(_0x23d760){logger[_0x1c9c('0x11')](_0x1c9c('0x22'),_0x23d760['message'],_0x200f8a);_0x541685(_0x5188f5['error'](0x1f4,_0x23d760[_0x1c9c('0x13')]));});});}; \ No newline at end of file +var _0x55fe=['find','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','GetDynamics365Account','catch','ShowDynamics365Account'];(function(_0x10766f,_0x107f8c){var _0x404f0e=function(_0x2c2a14){while(--_0x2c2a14){_0x10766f['push'](_0x10766f['shift']());}};_0x404f0e(++_0x107f8c);}(_0x55fe,0xab));var _0xe55f=function(_0x5824c6,_0x1636ad){_0x5824c6=_0x5824c6-0x0;var _0x292da2=_0x55fe[_0x5824c6];return _0x292da2;};'use strict';var _=require(_0xe55f('0x0'));var util=require(_0xe55f('0x1'));var moment=require(_0xe55f('0x2'));var BPromise=require('bluebird');var rs=require(_0xe55f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe55f('0x4'));var logger=require(_0xe55f('0x5'))(_0xe55f('0x6'));var config=require(_0xe55f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe55f('0x8')][_0xe55f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44e198,_0x3f1188,_0x19a01d){return new BPromise(function(_0x5e21ad,_0x4b9201){return client[_0xe55f('0xa')](_0x44e198,_0x19a01d)[_0xe55f('0xb')](function(_0x500350){logger[_0xe55f('0xc')](_0xe55f('0xd'),_0x3f1188,_0xe55f('0xe'));logger[_0xe55f('0xf')](_0xe55f('0x10'),_0x3f1188,'request\x20sent',JSON[_0xe55f('0x11')](_0x500350));if(_0x500350[_0xe55f('0x12')]){if(_0x500350[_0xe55f('0x12')]['code']===0x1f4){logger[_0xe55f('0x12')](_0xe55f('0xd'),_0x3f1188,_0x500350[_0xe55f('0x12')][_0xe55f('0x13')]);return _0x4b9201(_0x500350[_0xe55f('0x12')][_0xe55f('0x13')]);}logger[_0xe55f('0x12')](_0xe55f('0xd'),_0x3f1188,_0x500350[_0xe55f('0x12')][_0xe55f('0x13')]);return _0x5e21ad(_0x500350[_0xe55f('0x12')]['message']);}else{logger[_0xe55f('0xc')](_0xe55f('0xd'),_0x3f1188,'request\x20sent');_0x5e21ad(_0x500350[_0xe55f('0x14')]['message']);}})['catch'](function(_0x256b17){logger[_0xe55f('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x3f1188,_0x256b17);_0x4b9201(_0x256b17);});});}exports['GetDynamics365Account']=function(_0x3591f1){var _0x4511c1=this;return new Promise(function(_0x577187,_0x3eb8f3){return db[_0xe55f('0x15')][_0xe55f('0x16')]({'raw':_0x3591f1[_0xe55f('0x17')]?_0x3591f1[_0xe55f('0x17')][_0xe55f('0x18')]===undefined?!![]:![]:!![],'where':_0x3591f1[_0xe55f('0x17')]?_0x3591f1[_0xe55f('0x17')]['where']||null:null,'attributes':_0x3591f1[_0xe55f('0x17')]?_0x3591f1[_0xe55f('0x17')][_0xe55f('0x19')]||null:null,'limit':_0x3591f1[_0xe55f('0x17')]?_0x3591f1['options'][_0xe55f('0x1a')]||null:null,'include':_0x3591f1['options']?_0x3591f1[_0xe55f('0x17')][_0xe55f('0x1b')]?_[_0xe55f('0x1c')](_0x3591f1['options'][_0xe55f('0x1b')],function(_0x16eb09){return{'model':db[_0x16eb09[_0xe55f('0x1d')]],'as':_0x16eb09['as'],'attributes':_0x16eb09[_0xe55f('0x19')],'include':_0x16eb09['include']?_[_0xe55f('0x1c')](_0x16eb09[_0xe55f('0x1b')],function(_0xa73ff0){return{'model':db[_0xa73ff0[_0xe55f('0x1d')]],'as':_0xa73ff0['as'],'attributes':_0xa73ff0[_0xe55f('0x19')],'include':_0xa73ff0['include']?_['map'](_0xa73ff0['include'],function(_0x467560){return{'model':db[_0x467560['model']],'as':_0x467560['as'],'attributes':_0x467560[_0xe55f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102f19){logger[_0xe55f('0xc')]('GetDynamics365Account',_0x3591f1);logger['debug'](_0xe55f('0x1e'),_0x3591f1,JSON[_0xe55f('0x11')](_0x102f19));_0x577187(_0x102f19);})[_0xe55f('0x1f')](function(_0x1e6543){logger[_0xe55f('0x12')](_0xe55f('0x1e'),_0x1e6543[_0xe55f('0x13')],_0x3591f1);_0x3eb8f3(_0x4511c1['error'](0x1f4,_0x1e6543['message']));});});};exports[_0xe55f('0x20')]=function(_0x1aacb5){var _0x456716=this;return new Promise(function(_0x34e18e,_0x2b8245){return db[_0xe55f('0x15')][_0xe55f('0x21')]({'raw':_0x1aacb5[_0xe55f('0x17')]?_0x1aacb5[_0xe55f('0x17')][_0xe55f('0x18')]===undefined?!![]:![]:!![],'where':_0x1aacb5[_0xe55f('0x17')]?_0x1aacb5[_0xe55f('0x17')]['where']||null:null,'attributes':_0x1aacb5[_0xe55f('0x17')]?_0x1aacb5[_0xe55f('0x17')][_0xe55f('0x19')]||null:null,'include':_0x1aacb5[_0xe55f('0x17')]?_0x1aacb5[_0xe55f('0x17')]['include']?_['map'](_0x1aacb5['options'][_0xe55f('0x1b')],function(_0x3f3f42){return{'model':db[_0x3f3f42['model']],'as':_0x3f3f42['as'],'attributes':_0x3f3f42[_0xe55f('0x19')],'include':_0x3f3f42[_0xe55f('0x1b')]?_[_0xe55f('0x1c')](_0x3f3f42[_0xe55f('0x1b')],function(_0x4e122b){return{'model':db[_0x4e122b[_0xe55f('0x1d')]],'as':_0x4e122b['as'],'attributes':_0x4e122b[_0xe55f('0x19')],'include':_0x4e122b[_0xe55f('0x1b')]?_['map'](_0x4e122b[_0xe55f('0x1b')],function(_0xd384a2){return{'model':db[_0xd384a2['model']],'as':_0xd384a2['as'],'attributes':_0xd384a2[_0xe55f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe55f('0xb')](function(_0x25c0f7){logger[_0xe55f('0xc')](_0xe55f('0x20'),_0x1aacb5);logger['debug']('ShowDynamics365Account',_0x1aacb5,JSON['stringify'](_0x25c0f7));_0x34e18e(_0x25c0f7);})['catch'](function(_0x55438c){logger[_0xe55f('0x12')](_0xe55f('0x20'),_0x55438c[_0xe55f('0x13')],_0x1aacb5);_0x2b8245(_0x456716[_0xe55f('0x12')](0x1f4,_0x55438c[_0xe55f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index cea33b5..dcb18de 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 _0x70e3=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update'];(function(_0x55e295,_0x48dc82){var _0x1df1a0=function(_0x1b7951){while(--_0x1b7951){_0x55e295['push'](_0x55e295['shift']());}};_0x1df1a0(++_0x48dc82);}(_0x70e3,0x9d));var _0x370e=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x70e3[_0x19b84f];return _0x18067b;};'use strict';var multer=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var path=require(_0x370e('0x2'));var timeout=require(_0x370e('0x3'));var express=require('express');var router=express[_0x370e('0x4')]();var fs_extra=require(_0x370e('0x5'));var auth=require(_0x370e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x370e('0x7'));var controller=require(_0x370e('0x8'));router[_0x370e('0x9')]('/',auth[_0x370e('0xa')](),controller['index']);router[_0x370e('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x370e('0x9')]('/:id/fields',auth[_0x370e('0xa')](),controller['getFields']);router[_0x370e('0x9')](_0x370e('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x370e('0x9')](_0x370e('0xc'),auth[_0x370e('0xa')](),controller[_0x370e('0xd')]);router[_0x370e('0xe')]('/',auth['isAuthenticated'](),controller[_0x370e('0xf')]);router[_0x370e('0x10')](_0x370e('0x11'),auth[_0x370e('0xa')](),controller[_0x370e('0x12')]);router[_0x370e('0x13')](_0x370e('0x11'),auth[_0x370e('0xa')](),controller[_0x370e('0x14')]);module[_0x370e('0x15')]=router; \ No newline at end of file +var _0x867f=['index','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x41d9e7,_0x33ef4a){var _0x282c36=function(_0x2bb2a5){while(--_0x2bb2a5){_0x41d9e7['push'](_0x41d9e7['shift']());}};_0x282c36(++_0x33ef4a);}(_0x867f,0xdc));var _0xf867=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x867f[_0x3a607e];return _0x37b106;};'use strict';var multer=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var path=require(_0xf867('0x2'));var timeout=require('connect-timeout');var express=require(_0xf867('0x3'));var router=express[_0xf867('0x4')]();var fs_extra=require(_0xf867('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf867('0x6'));var config=require('../../config/environment');var controller=require(_0xf867('0x7'));router[_0xf867('0x8')]('/',auth[_0xf867('0x9')](),controller[_0xf867('0xa')]);router[_0xf867('0x8')](_0xf867('0xb'),auth[_0xf867('0x9')](),controller[_0xf867('0xc')]);router[_0xf867('0x8')](_0xf867('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xf867('0x8')](_0xf867('0xe'),auth[_0xf867('0x9')](),controller['getSubjects']);router['get'](_0xf867('0xf'),auth[_0xf867('0x9')](),controller['getDescriptions']);router[_0xf867('0x10')]('/',auth[_0xf867('0x9')](),controller[_0xf867('0x11')]);router[_0xf867('0x12')]('/:id',auth[_0xf867('0x9')](),controller[_0xf867('0x13')]);router[_0xf867('0x14')](_0xf867('0xb'),auth[_0xf867('0x9')](),controller[_0xf867('0x15')]);module[_0xf867('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 425949f..bb0a9bb 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 _0x3cc1=['phonecall','contact','nothing','sequelize','exports','STRING','ENUM','incident'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3cc1,0xd3));var _0x13cc=function(_0x4ca6f3,_0x33fc1c){_0x4ca6f3=_0x4ca6f3-0x0;var _0x167ae5=_0x3cc1[_0x4ca6f3];return _0x167ae5;};'use strict';var Sequelize=require(_0x13cc('0x0'));module[_0x13cc('0x1')]={'name':{'type':Sequelize[_0x13cc('0x2')]},'description':{'type':Sequelize[_0x13cc('0x2')]},'ticketType':{'type':Sequelize[_0x13cc('0x3')](_0x13cc('0x4'),_0x13cc('0x5')),'defaultValue':_0x13cc('0x4')},'moduleCreate':{'type':Sequelize[_0x13cc('0x3')](_0x13cc('0x6'),_0x13cc('0x7')),'defaultValue':_0x13cc('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4e49=['sequelize','STRING','ENUM','contact','nothing'];(function(_0x267f04,_0x18005d){var _0x324621=function(_0x3ef6a9){while(--_0x3ef6a9){_0x267f04['push'](_0x267f04['shift']());}};_0x324621(++_0x18005d);}(_0x4e49,0x14f));var _0x94e4=function(_0x339b73,_0x5a6856){_0x339b73=_0x339b73-0x0;var _0x162667=_0x4e49[_0x339b73];return _0x162667;};'use strict';var Sequelize=require(_0x94e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x94e4('0x1')]},'description':{'type':Sequelize[_0x94e4('0x1')]},'ticketType':{'type':Sequelize[_0x94e4('0x2')]('incident','phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x94e4('0x2')](_0x94e4('0x3'),_0x94e4('0x4')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x94e4('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 9be4ae1..54e5250 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 _0xf466=['filter','where','VIRTUAL','merge','options','count','include','Dynamics365Configuration','findAll','show','params','keys','rawAttributes','includeAll','find','catch','create','body','getFields','findOne','getSubjects','Dynamics365Field','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x5dec9e,_0x2edb79){var _0x501b46=function(_0x558adc){while(--_0x558adc){_0x5dec9e['push'](_0x5dec9e['shift']());}};_0x501b46(++_0x2edb79);}(_0xf466,0x1eb));var _0x6f46=function(_0x66b7e5,_0x2c0406){_0x66b7e5=_0x66b7e5-0x0;var _0x1ad502=_0xf466[_0x66b7e5];return _0x1ad502;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f46('0x0'));var zipdir=require(_0x6f46('0x1'));var jsonpatch=require(_0x6f46('0x2'));var rp=require('request-promise');var moment=require(_0x6f46('0x3'));var BPromise=require(_0x6f46('0x4'));var Mustache=require(_0x6f46('0x5'));var util=require('util');var path=require(_0x6f46('0x6'));var sox=require(_0x6f46('0x7'));var csv=require(_0x6f46('0x8'));var ejs=require(_0x6f46('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f46('0xa'));var squel=require(_0x6f46('0xb'));var crypto=require(_0x6f46('0xc'));var jsforce=require(_0x6f46('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6f46('0x8'));var querystring=require(_0x6f46('0xe'));var Papa=require('papaparse');var Redis=require(_0x6f46('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6f46('0x10'));var hardwareService=require(_0x6f46('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6f46('0x12'));var config=require(_0x6f46('0x13'));var licenseUtil=require(_0x6f46('0x14'));var db=require(_0x6f46('0x15'))['db'];function respondWithStatusCode(_0x14e4a5,_0x165044){_0x165044=_0x165044||0xcc;return function(_0x2f9fa9){if(_0x2f9fa9){return _0x14e4a5[_0x6f46('0x16')](_0x165044);}return _0x14e4a5[_0x6f46('0x17')](_0x165044)[_0x6f46('0x18')]();};}function respondWithResult(_0x56c874,_0x10422b){_0x10422b=_0x10422b||0xc8;return function(_0x19c69e){if(_0x19c69e){return _0x56c874[_0x6f46('0x17')](_0x10422b)['json'](_0x19c69e);}};}function respondWithFilteredResult(_0x4c5518,_0x530bdb){return function(_0xd13be8){if(_0xd13be8){var _0x4fba2d=typeof _0x530bdb[_0x6f46('0x19')]===_0x6f46('0x1a')&&typeof _0x530bdb[_0x6f46('0x1b')]===_0x6f46('0x1a');var _0x5d66e7=_0xd13be8['count'];var _0x1fb101=_0x4fba2d?0x0:_0x530bdb[_0x6f46('0x19')];var _0x421354=_0x4fba2d?_0xd13be8['count']:_0x530bdb[_0x6f46('0x19')]+_0x530bdb['limit'];var _0x5c141e;if(_0x421354>=_0x5d66e7){_0x421354=_0x5d66e7;_0x5c141e=0xc8;}else{_0x5c141e=0xce;}_0x4c5518[_0x6f46('0x17')](_0x5c141e);return _0x4c5518[_0x6f46('0x1c')](_0x6f46('0x1d'),_0x1fb101+'-'+_0x421354+'/'+_0x5d66e7)['json'](_0xd13be8);}return null;};}function patchUpdates(_0x1eccda){return function(_0x5b0f6c){try{jsonpatch[_0x6f46('0x1e')](_0x5b0f6c,_0x1eccda,!![]);}catch(_0x3c1b9c){return BPromise[_0x6f46('0x1f')](_0x3c1b9c);}return _0x5b0f6c[_0x6f46('0x20')]();};}function saveUpdates(_0x103404,_0x12b19e){return function(_0x4a98f9){if(_0x4a98f9){return _0x4a98f9[_0x6f46('0x21')](_0x103404)[_0x6f46('0x22')](function(_0x544ce5){return _0x544ce5;});}return null;};}function removeEntity(_0x4a8e00,_0x11e1c0){return function(_0x117e5b){if(_0x117e5b){return _0x117e5b[_0x6f46('0x23')]()[_0x6f46('0x22')](function(){_0x4a8e00[_0x6f46('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5be765,_0x4ca781){return function(_0x4fcd1a){if(!_0x4fcd1a){_0x5be765[_0x6f46('0x16')](0x194);}return _0x4fcd1a;};}function handleError(_0x34707b,_0x4ba085){_0x4ba085=_0x4ba085||0x1f4;return function(_0x282d2b){logger['error'](_0x282d2b[_0x6f46('0x24')]);if(_0x282d2b[_0x6f46('0x25')]){delete _0x282d2b[_0x6f46('0x25')];}_0x34707b['status'](_0x4ba085)[_0x6f46('0x26')](_0x282d2b);};}exports[_0x6f46('0x27')]=function(_0x2d7d34,_0x278b78){var _0x4b5cd4={},_0x8ac1ea={},_0x55086e={'count':0x0,'rows':[]};var _0xf3f4cd=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x3ce18a){return{'name':_0x3ce18a[_0x6f46('0x28')],'type':_0x3ce18a[_0x6f46('0x29')]['key']};});_0x8ac1ea[_0x6f46('0x2a')]=_[_0x6f46('0x2b')](_0xf3f4cd,_0x6f46('0x25'));_0x8ac1ea['query']=_['keys'](_0x2d7d34[_0x6f46('0x2c')]);_0x8ac1ea['filters']=_[_0x6f46('0x2d')](_0x8ac1ea['model'],_0x8ac1ea[_0x6f46('0x2c')]);_0x4b5cd4[_0x6f46('0x2e')]=_[_0x6f46('0x2d')](_0x8ac1ea[_0x6f46('0x2a')],qs[_0x6f46('0x2f')](_0x2d7d34[_0x6f46('0x2c')][_0x6f46('0x2f')]));_0x4b5cd4['attributes']=_0x4b5cd4[_0x6f46('0x2e')][_0x6f46('0x30')]?_0x4b5cd4[_0x6f46('0x2e')]:_0x8ac1ea[_0x6f46('0x2a')];if(!_0x2d7d34[_0x6f46('0x2c')][_0x6f46('0x31')](_0x6f46('0x32'))){_0x4b5cd4['limit']=qs[_0x6f46('0x1b')](_0x2d7d34[_0x6f46('0x2c')][_0x6f46('0x1b')]);_0x4b5cd4[_0x6f46('0x19')]=qs['offset'](_0x2d7d34['query'][_0x6f46('0x19')]);}_0x4b5cd4[_0x6f46('0x33')]=qs[_0x6f46('0x34')](_0x2d7d34[_0x6f46('0x2c')][_0x6f46('0x34')]);_0x4b5cd4['where']=qs[_0x6f46('0x35')](_[_0x6f46('0x36')](_0x2d7d34['query'],_0x8ac1ea[_0x6f46('0x35')]),_0xf3f4cd);if(_0x2d7d34['query'][_0x6f46('0x37')]){_0x4b5cd4[_0x6f46('0x38')]=_['merge'](_0x4b5cd4[_0x6f46('0x38')],{'$or':_[_0x6f46('0x2b')](_0xf3f4cd,function(_0x2d9585){if(_0x2d9585[_0x6f46('0x29')]!==_0x6f46('0x39')){var _0x48a612={};_0x48a612[_0x2d9585[_0x6f46('0x25')]]={'$like':'%'+_0x2d7d34['query'][_0x6f46('0x37')]+'%'};return _0x48a612;}})});}_0x4b5cd4=_[_0x6f46('0x3a')]({},_0x4b5cd4,_0x2d7d34[_0x6f46('0x3b')]);var _0x1086aa={'where':_0x4b5cd4[_0x6f46('0x38')]};return db['Dynamics365Configuration'][_0x6f46('0x3c')](_0x1086aa)[_0x6f46('0x22')](function(_0x115fbb){_0x55086e[_0x6f46('0x3c')]=_0x115fbb;if(_0x2d7d34[_0x6f46('0x2c')]['includeAll']){_0x4b5cd4[_0x6f46('0x3d')]=[{'all':!![]}];}return db[_0x6f46('0x3e')][_0x6f46('0x3f')](_0x4b5cd4);})[_0x6f46('0x22')](function(_0x54a607){_0x55086e['rows']=_0x54a607;return _0x55086e;})[_0x6f46('0x22')](respondWithFilteredResult(_0x278b78,_0x4b5cd4))['catch'](handleError(_0x278b78,null));};exports[_0x6f46('0x40')]=function(_0x2779f7,_0x55cb1f){var _0x376e76={'raw':![],'where':{'id':_0x2779f7[_0x6f46('0x41')]['id']}},_0x14bfd6={};_0x14bfd6[_0x6f46('0x2a')]=_[_0x6f46('0x42')](db[_0x6f46('0x3e')][_0x6f46('0x43')]);_0x14bfd6[_0x6f46('0x2c')]=_[_0x6f46('0x42')](_0x2779f7[_0x6f46('0x2c')]);_0x14bfd6[_0x6f46('0x35')]=_[_0x6f46('0x2d')](_0x14bfd6[_0x6f46('0x2a')],_0x14bfd6[_0x6f46('0x2c')]);_0x376e76[_0x6f46('0x2e')]=_[_0x6f46('0x2d')](_0x14bfd6[_0x6f46('0x2a')],qs[_0x6f46('0x2f')](_0x2779f7['query'][_0x6f46('0x2f')]));_0x376e76[_0x6f46('0x2e')]=_0x376e76[_0x6f46('0x2e')][_0x6f46('0x30')]?_0x376e76[_0x6f46('0x2e')]:_0x14bfd6[_0x6f46('0x2a')];if(_0x2779f7[_0x6f46('0x2c')][_0x6f46('0x44')]){_0x376e76[_0x6f46('0x3d')]=[{'all':!![]}];}_0x376e76=_[_0x6f46('0x3a')]({},_0x376e76,_0x2779f7['options']);return db[_0x6f46('0x3e')][_0x6f46('0x45')](_0x376e76)['then'](handleEntityNotFound(_0x55cb1f,null))['then'](respondWithResult(_0x55cb1f,null))[_0x6f46('0x46')](handleError(_0x55cb1f,null));};exports[_0x6f46('0x47')]=function(_0x4b9062,_0x316450){return db[_0x6f46('0x3e')][_0x6f46('0x47')](_0x4b9062[_0x6f46('0x48')],{})[_0x6f46('0x22')](respondWithResult(_0x316450,0xc9))['catch'](handleError(_0x316450,null));};exports[_0x6f46('0x21')]=function(_0x17485f,_0x144a45){if(_0x17485f['body']['id']){delete _0x17485f['body']['id'];}return db['Dynamics365Configuration'][_0x6f46('0x45')]({'where':{'id':_0x17485f[_0x6f46('0x41')]['id']}})[_0x6f46('0x22')](handleEntityNotFound(_0x144a45,null))[_0x6f46('0x22')](saveUpdates(_0x17485f[_0x6f46('0x48')],null))[_0x6f46('0x22')](respondWithResult(_0x144a45,null))['catch'](handleError(_0x144a45,null));};exports['destroy']=function(_0x43ddd6,_0x292ce5){return db[_0x6f46('0x3e')][_0x6f46('0x45')]({'where':{'id':_0x43ddd6[_0x6f46('0x41')]['id']}})['then'](handleEntityNotFound(_0x292ce5,null))[_0x6f46('0x22')](removeEntity(_0x292ce5,null))[_0x6f46('0x46')](handleError(_0x292ce5,null));};exports[_0x6f46('0x49')]=function(_0x518805,_0x9874d6,_0x4d7e8c){var _0x17ad43={};var _0x281e29={};var _0x39ac16;var _0x393cd6;return db[_0x6f46('0x3e')][_0x6f46('0x4a')]({'where':{'id':_0x518805[_0x6f46('0x41')]['id']}})['then'](handleEntityNotFound(_0x9874d6,null))[_0x6f46('0x22')](function(_0x28f2e3){if(_0x28f2e3){_0x39ac16=_0x28f2e3;_0x281e29['model']=_[_0x6f46('0x42')](db['Dynamics365Field']['rawAttributes']);_0x281e29[_0x6f46('0x2c')]=_[_0x6f46('0x42')](_0x518805[_0x6f46('0x2c')]);_0x281e29['filters']=_[_0x6f46('0x2d')](_0x281e29[_0x6f46('0x2a')],_0x281e29[_0x6f46('0x2c')]);_0x17ad43['attributes']=_['intersection'](_0x281e29[_0x6f46('0x2a')],qs['fields'](_0x518805[_0x6f46('0x2c')][_0x6f46('0x2f')]));_0x17ad43[_0x6f46('0x2e')]=_0x17ad43[_0x6f46('0x2e')][_0x6f46('0x30')]?_0x17ad43['attributes']:_0x281e29[_0x6f46('0x2a')];_0x17ad43[_0x6f46('0x33')]=qs[_0x6f46('0x34')](_0x518805[_0x6f46('0x2c')][_0x6f46('0x34')]);_0x17ad43[_0x6f46('0x38')]=qs[_0x6f46('0x35')](_['pick'](_0x518805['query'],_0x281e29[_0x6f46('0x35')]));if(_0x518805[_0x6f46('0x2c')][_0x6f46('0x37')]){_0x17ad43['where']=_['merge'](_0x17ad43[_0x6f46('0x38')],{'$or':_[_0x6f46('0x2b')](_0x17ad43[_0x6f46('0x2e')],function(_0x390251){var _0x36a499={};_0x36a499[_0x390251]={'$like':'%'+_0x518805[_0x6f46('0x2c')][_0x6f46('0x37')]+'%'};return _0x36a499;})});}_0x17ad43=_[_0x6f46('0x3a')]({},_0x17ad43,_0x518805['options']);return _0x39ac16[_0x6f46('0x49')](_0x17ad43);}})[_0x6f46('0x22')](function(_0x19674d){if(_0x19674d){_0x393cd6=_0x19674d[_0x6f46('0x30')];if(!_0x518805[_0x6f46('0x2c')]['hasOwnProperty'](_0x6f46('0x32'))){_0x17ad43['limit']=qs[_0x6f46('0x1b')](_0x518805[_0x6f46('0x2c')]['limit']);_0x17ad43['offset']=qs[_0x6f46('0x19')](_0x518805[_0x6f46('0x2c')][_0x6f46('0x19')]);}return _0x39ac16[_0x6f46('0x49')](_0x17ad43);}})[_0x6f46('0x22')](function(_0x16ff33){if(_0x16ff33){return _0x16ff33?{'count':_0x393cd6,'rows':_0x16ff33}:null;}})['then'](respondWithResult(_0x9874d6,null))['catch'](handleError(_0x9874d6,null));};exports[_0x6f46('0x4b')]=function(_0x186b0a,_0x31acdb,_0x268344){var _0x3a3ed3={};var _0x4f79b1={};var _0x4b11c0;var _0x5c728f;return db[_0x6f46('0x3e')][_0x6f46('0x4a')]({'where':{'id':_0x186b0a[_0x6f46('0x41')]['id']}})[_0x6f46('0x22')](handleEntityNotFound(_0x31acdb,null))['then'](function(_0x10b8d5){if(_0x10b8d5){_0x4b11c0=_0x10b8d5;_0x4f79b1[_0x6f46('0x2a')]=_['keys'](db[_0x6f46('0x4c')]['rawAttributes']);_0x4f79b1[_0x6f46('0x2c')]=_[_0x6f46('0x42')](_0x186b0a[_0x6f46('0x2c')]);_0x4f79b1['filters']=_['intersection'](_0x4f79b1['model'],_0x4f79b1[_0x6f46('0x2c')]);_0x3a3ed3['attributes']=_[_0x6f46('0x2d')](_0x4f79b1[_0x6f46('0x2a')],qs[_0x6f46('0x2f')](_0x186b0a[_0x6f46('0x2c')][_0x6f46('0x2f')]));_0x3a3ed3[_0x6f46('0x2e')]=_0x3a3ed3[_0x6f46('0x2e')][_0x6f46('0x30')]?_0x3a3ed3[_0x6f46('0x2e')]:_0x4f79b1[_0x6f46('0x2a')];_0x3a3ed3[_0x6f46('0x33')]=qs['sort'](_0x186b0a[_0x6f46('0x2c')][_0x6f46('0x34')]);_0x3a3ed3['where']=qs[_0x6f46('0x35')](_[_0x6f46('0x36')](_0x186b0a[_0x6f46('0x2c')],_0x4f79b1[_0x6f46('0x35')]));if(_0x186b0a[_0x6f46('0x2c')][_0x6f46('0x37')]){_0x3a3ed3[_0x6f46('0x38')]=_[_0x6f46('0x3a')](_0x3a3ed3[_0x6f46('0x38')],{'$or':_[_0x6f46('0x2b')](_0x3a3ed3[_0x6f46('0x2e')],function(_0x2c6d01){var _0x23826a={};_0x23826a[_0x2c6d01]={'$like':'%'+_0x186b0a[_0x6f46('0x2c')][_0x6f46('0x37')]+'%'};return _0x23826a;})});}_0x3a3ed3=_[_0x6f46('0x3a')]({},_0x3a3ed3,_0x186b0a['options']);return _0x4b11c0['getSubjects'](_0x3a3ed3);}})[_0x6f46('0x22')](function(_0x44eeac){if(_0x44eeac){_0x5c728f=_0x44eeac['length'];if(!_0x186b0a[_0x6f46('0x2c')][_0x6f46('0x31')]('nolimit')){_0x3a3ed3[_0x6f46('0x1b')]=qs[_0x6f46('0x1b')](_0x186b0a[_0x6f46('0x2c')][_0x6f46('0x1b')]);_0x3a3ed3[_0x6f46('0x19')]=qs[_0x6f46('0x19')](_0x186b0a[_0x6f46('0x2c')]['offset']);}return _0x4b11c0[_0x6f46('0x4b')](_0x3a3ed3);}})['then'](function(_0x190e2d){if(_0x190e2d){return _0x190e2d?{'count':_0x5c728f,'rows':_0x190e2d}:null;}})[_0x6f46('0x22')](respondWithResult(_0x31acdb,null))[_0x6f46('0x46')](handleError(_0x31acdb,null));};exports['getDescriptions']=function(_0x178211,_0x48a85e,_0x3879ca){var _0xa37205={};var _0xab223a={};var _0x59e505;var _0x222b52;return db[_0x6f46('0x3e')][_0x6f46('0x4a')]({'where':{'id':_0x178211[_0x6f46('0x41')]['id']}})['then'](handleEntityNotFound(_0x48a85e,null))['then'](function(_0x309963){if(_0x309963){_0x59e505=_0x309963;_0xab223a['model']=_[_0x6f46('0x42')](db[_0x6f46('0x4c')][_0x6f46('0x43')]);_0xab223a[_0x6f46('0x2c')]=_[_0x6f46('0x42')](_0x178211[_0x6f46('0x2c')]);_0xab223a['filters']=_[_0x6f46('0x2d')](_0xab223a[_0x6f46('0x2a')],_0xab223a[_0x6f46('0x2c')]);_0xa37205['attributes']=_[_0x6f46('0x2d')](_0xab223a[_0x6f46('0x2a')],qs[_0x6f46('0x2f')](_0x178211[_0x6f46('0x2c')][_0x6f46('0x2f')]));_0xa37205[_0x6f46('0x2e')]=_0xa37205[_0x6f46('0x2e')][_0x6f46('0x30')]?_0xa37205[_0x6f46('0x2e')]:_0xab223a[_0x6f46('0x2a')];_0xa37205[_0x6f46('0x33')]=qs[_0x6f46('0x34')](_0x178211[_0x6f46('0x2c')][_0x6f46('0x34')]);_0xa37205[_0x6f46('0x38')]=qs[_0x6f46('0x35')](_[_0x6f46('0x36')](_0x178211[_0x6f46('0x2c')],_0xab223a['filters']));if(_0x178211[_0x6f46('0x2c')]['filter']){_0xa37205[_0x6f46('0x38')]=_[_0x6f46('0x3a')](_0xa37205[_0x6f46('0x38')],{'$or':_[_0x6f46('0x2b')](_0xa37205['attributes'],function(_0x2ae6e6){var _0x464f39={};_0x464f39[_0x2ae6e6]={'$like':'%'+_0x178211[_0x6f46('0x2c')]['filter']+'%'};return _0x464f39;})});}_0xa37205=_[_0x6f46('0x3a')]({},_0xa37205,_0x178211['options']);return _0x59e505[_0x6f46('0x4d')](_0xa37205);}})[_0x6f46('0x22')](function(_0xd4bd8e){if(_0xd4bd8e){_0x222b52=_0xd4bd8e['length'];if(!_0x178211[_0x6f46('0x2c')][_0x6f46('0x31')](_0x6f46('0x32'))){_0xa37205[_0x6f46('0x1b')]=qs[_0x6f46('0x1b')](_0x178211[_0x6f46('0x2c')][_0x6f46('0x1b')]);_0xa37205[_0x6f46('0x19')]=qs[_0x6f46('0x19')](_0x178211[_0x6f46('0x2c')][_0x6f46('0x19')]);}return _0x59e505['getDescriptions'](_0xa37205);}})['then'](function(_0x42f660){if(_0x42f660){return _0x42f660?{'count':_0x222b52,'rows':_0x42f660}:null;}})[_0x6f46('0x22')](respondWithResult(_0x48a85e,null))[_0x6f46('0x46')](handleError(_0x48a85e,null));}; \ No newline at end of file +var _0xa857=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','includeAll','find','create','body','getFields','findOne','params','order','nolimit','getSubjects','Dynamics365Field','getDescriptions','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration'];(function(_0x1e4afd,_0x574632){var _0x580791=function(_0x47b7d5){while(--_0x47b7d5){_0x1e4afd['push'](_0x1e4afd['shift']());}};_0x580791(++_0x574632);}(_0xa857,0x10f));var _0x7a85=function(_0xa8b8fa,_0x261194){_0xa8b8fa=_0xa8b8fa-0x0;var _0x10eae9=_0xa857[_0xa8b8fa];return _0x10eae9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a85('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7a85('0x1'));var moment=require(_0x7a85('0x2'));var BPromise=require(_0x7a85('0x3'));var Mustache=require(_0x7a85('0x4'));var util=require(_0x7a85('0x5'));var path=require(_0x7a85('0x6'));var sox=require('sox');var csv=require(_0x7a85('0x7'));var ejs=require(_0x7a85('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7a85('0x9'));var squel=require(_0x7a85('0xa'));var crypto=require(_0x7a85('0xb'));var jsforce=require(_0x7a85('0xc'));var deskjs=require(_0x7a85('0xd'));var toCsv=require(_0x7a85('0x7'));var querystring=require(_0x7a85('0xe'));var Papa=require(_0x7a85('0xf'));var Redis=require(_0x7a85('0x10'));var authService=require(_0x7a85('0x11'));var qs=require(_0x7a85('0x12'));var as=require(_0x7a85('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a85('0x14'))(_0x7a85('0x15'));var utils=require(_0x7a85('0x16'));var config=require(_0x7a85('0x17'));var licenseUtil=require(_0x7a85('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cff25,_0x4258ac){_0x4258ac=_0x4258ac||0xcc;return function(_0x460892){if(_0x460892){return _0x4cff25[_0x7a85('0x19')](_0x4258ac);}return _0x4cff25[_0x7a85('0x1a')](_0x4258ac)['end']();};}function respondWithResult(_0x822529,_0x58879c){_0x58879c=_0x58879c||0xc8;return function(_0x5d64ab){if(_0x5d64ab){return _0x822529[_0x7a85('0x1a')](_0x58879c)[_0x7a85('0x1b')](_0x5d64ab);}};}function respondWithFilteredResult(_0x499593,_0x431adc){return function(_0x2172ec){if(_0x2172ec){var _0xb23f51=typeof _0x431adc[_0x7a85('0x1c')]==='undefined'&&typeof _0x431adc[_0x7a85('0x1d')]===_0x7a85('0x1e');var _0x4cb4ad=_0x2172ec[_0x7a85('0x1f')];var _0x2cbdce=_0xb23f51?0x0:_0x431adc[_0x7a85('0x1c')];var _0x11d13f=_0xb23f51?_0x2172ec[_0x7a85('0x1f')]:_0x431adc[_0x7a85('0x1c')]+_0x431adc[_0x7a85('0x1d')];var _0x2e1ee0;if(_0x11d13f>=_0x4cb4ad){_0x11d13f=_0x4cb4ad;_0x2e1ee0=0xc8;}else{_0x2e1ee0=0xce;}_0x499593['status'](_0x2e1ee0);return _0x499593['set'](_0x7a85('0x20'),_0x2cbdce+'-'+_0x11d13f+'/'+_0x4cb4ad)[_0x7a85('0x1b')](_0x2172ec);}return null;};}function patchUpdates(_0x4270cd){return function(_0x422d19){try{jsonpatch[_0x7a85('0x21')](_0x422d19,_0x4270cd,!![]);}catch(_0x183d6d){return BPromise[_0x7a85('0x22')](_0x183d6d);}return _0x422d19['save']();};}function saveUpdates(_0x7450b0,_0x426141){return function(_0x301edf){if(_0x301edf){return _0x301edf[_0x7a85('0x23')](_0x7450b0)[_0x7a85('0x24')](function(_0x32f554){return _0x32f554;});}return null;};}function removeEntity(_0x5a72a9,_0x2bf24f){return function(_0x493d99){if(_0x493d99){return _0x493d99[_0x7a85('0x25')]()[_0x7a85('0x24')](function(){_0x5a72a9[_0x7a85('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bedf1,_0x17450b){return function(_0x3e88f1){if(!_0x3e88f1){_0x4bedf1[_0x7a85('0x19')](0x194);}return _0x3e88f1;};}function handleError(_0x30c8b5,_0x1bc417){_0x1bc417=_0x1bc417||0x1f4;return function(_0x22dff1){logger[_0x7a85('0x26')](_0x22dff1[_0x7a85('0x27')]);if(_0x22dff1[_0x7a85('0x28')]){delete _0x22dff1[_0x7a85('0x28')];}_0x30c8b5[_0x7a85('0x1a')](_0x1bc417)[_0x7a85('0x29')](_0x22dff1);};}exports[_0x7a85('0x2a')]=function(_0x6eaa4c,_0x40039c){var _0x42cacd={},_0x1957c7={},_0x38b101={'count':0x0,'rows':[]};var _0x50a429=_[_0x7a85('0x2b')](db[_0x7a85('0x2c')][_0x7a85('0x2d')],function(_0x380d1f){return{'name':_0x380d1f[_0x7a85('0x2e')],'type':_0x380d1f[_0x7a85('0x2f')][_0x7a85('0x30')]};});_0x1957c7[_0x7a85('0x31')]=_[_0x7a85('0x2b')](_0x50a429,'name');_0x1957c7[_0x7a85('0x32')]=_[_0x7a85('0x33')](_0x6eaa4c[_0x7a85('0x32')]);_0x1957c7[_0x7a85('0x34')]=_[_0x7a85('0x35')](_0x1957c7[_0x7a85('0x31')],_0x1957c7[_0x7a85('0x32')]);_0x42cacd[_0x7a85('0x36')]=_['intersection'](_0x1957c7['model'],qs[_0x7a85('0x37')](_0x6eaa4c[_0x7a85('0x32')][_0x7a85('0x37')]));_0x42cacd['attributes']=_0x42cacd[_0x7a85('0x36')][_0x7a85('0x38')]?_0x42cacd[_0x7a85('0x36')]:_0x1957c7[_0x7a85('0x31')];if(!_0x6eaa4c[_0x7a85('0x32')][_0x7a85('0x39')]('nolimit')){_0x42cacd[_0x7a85('0x1d')]=qs['limit'](_0x6eaa4c['query'][_0x7a85('0x1d')]);_0x42cacd[_0x7a85('0x1c')]=qs[_0x7a85('0x1c')](_0x6eaa4c[_0x7a85('0x32')][_0x7a85('0x1c')]);}_0x42cacd['order']=qs[_0x7a85('0x3a')](_0x6eaa4c['query'][_0x7a85('0x3a')]);_0x42cacd[_0x7a85('0x3b')]=qs['filters'](_[_0x7a85('0x3c')](_0x6eaa4c[_0x7a85('0x32')],_0x1957c7[_0x7a85('0x34')]),_0x50a429);if(_0x6eaa4c[_0x7a85('0x32')][_0x7a85('0x3d')]){_0x42cacd['where']=_['merge'](_0x42cacd[_0x7a85('0x3b')],{'$or':_['map'](_0x50a429,function(_0x5b4b7f){if(_0x5b4b7f[_0x7a85('0x2f')]!==_0x7a85('0x3e')){var _0x16dfd0={};_0x16dfd0[_0x5b4b7f[_0x7a85('0x28')]]={'$like':'%'+_0x6eaa4c['query']['filter']+'%'};return _0x16dfd0;}})});}_0x42cacd=_[_0x7a85('0x3f')]({},_0x42cacd,_0x6eaa4c[_0x7a85('0x40')]);var _0x1332d8={'where':_0x42cacd[_0x7a85('0x3b')]};return db['Dynamics365Configuration'][_0x7a85('0x1f')](_0x1332d8)[_0x7a85('0x24')](function(_0x3daa2b){_0x38b101[_0x7a85('0x1f')]=_0x3daa2b;if(_0x6eaa4c[_0x7a85('0x32')]['includeAll']){_0x42cacd['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x7a85('0x41')](_0x42cacd);})[_0x7a85('0x24')](function(_0x2e5764){_0x38b101['rows']=_0x2e5764;return _0x38b101;})[_0x7a85('0x24')](respondWithFilteredResult(_0x40039c,_0x42cacd))[_0x7a85('0x42')](handleError(_0x40039c,null));};exports['show']=function(_0x1eb52c,_0x3f8e78){var _0x14fd18={'raw':![],'where':{'id':_0x1eb52c['params']['id']}},_0x30c625={};_0x30c625[_0x7a85('0x31')]=_[_0x7a85('0x33')](db['Dynamics365Configuration']['rawAttributes']);_0x30c625[_0x7a85('0x32')]=_['keys'](_0x1eb52c['query']);_0x30c625['filters']=_[_0x7a85('0x35')](_0x30c625[_0x7a85('0x31')],_0x30c625[_0x7a85('0x32')]);_0x14fd18[_0x7a85('0x36')]=_['intersection'](_0x30c625['model'],qs[_0x7a85('0x37')](_0x1eb52c[_0x7a85('0x32')]['fields']));_0x14fd18[_0x7a85('0x36')]=_0x14fd18[_0x7a85('0x36')][_0x7a85('0x38')]?_0x14fd18[_0x7a85('0x36')]:_0x30c625['model'];if(_0x1eb52c[_0x7a85('0x32')][_0x7a85('0x43')]){_0x14fd18['include']=[{'all':!![]}];}_0x14fd18=_[_0x7a85('0x3f')]({},_0x14fd18,_0x1eb52c['options']);return db[_0x7a85('0x2c')][_0x7a85('0x44')](_0x14fd18)[_0x7a85('0x24')](handleEntityNotFound(_0x3f8e78,null))[_0x7a85('0x24')](respondWithResult(_0x3f8e78,null))[_0x7a85('0x42')](handleError(_0x3f8e78,null));};exports[_0x7a85('0x45')]=function(_0x17328a,_0x3ae018){return db['Dynamics365Configuration'][_0x7a85('0x45')](_0x17328a[_0x7a85('0x46')],{})[_0x7a85('0x24')](respondWithResult(_0x3ae018,0xc9))[_0x7a85('0x42')](handleError(_0x3ae018,null));};exports[_0x7a85('0x23')]=function(_0x5a1969,_0x6fc9b8){if(_0x5a1969[_0x7a85('0x46')]['id']){delete _0x5a1969[_0x7a85('0x46')]['id'];}return db[_0x7a85('0x2c')][_0x7a85('0x44')]({'where':{'id':_0x5a1969['params']['id']}})['then'](handleEntityNotFound(_0x6fc9b8,null))[_0x7a85('0x24')](saveUpdates(_0x5a1969[_0x7a85('0x46')],null))[_0x7a85('0x24')](respondWithResult(_0x6fc9b8,null))[_0x7a85('0x42')](handleError(_0x6fc9b8,null));};exports[_0x7a85('0x25')]=function(_0x3d110a,_0x34af4d){return db[_0x7a85('0x2c')][_0x7a85('0x44')]({'where':{'id':_0x3d110a['params']['id']}})[_0x7a85('0x24')](handleEntityNotFound(_0x34af4d,null))[_0x7a85('0x24')](removeEntity(_0x34af4d,null))[_0x7a85('0x42')](handleError(_0x34af4d,null));};exports[_0x7a85('0x47')]=function(_0x5021f1,_0x316ddc,_0x34382d){var _0x286c3d={};var _0x2fb398={};var _0xef7085;var _0x3db9e0;return db[_0x7a85('0x2c')][_0x7a85('0x48')]({'where':{'id':_0x5021f1[_0x7a85('0x49')]['id']}})[_0x7a85('0x24')](handleEntityNotFound(_0x316ddc,null))['then'](function(_0x4d4305){if(_0x4d4305){_0xef7085=_0x4d4305;_0x2fb398['model']=_[_0x7a85('0x33')](db['Dynamics365Field'][_0x7a85('0x2d')]);_0x2fb398['query']=_['keys'](_0x5021f1[_0x7a85('0x32')]);_0x2fb398[_0x7a85('0x34')]=_[_0x7a85('0x35')](_0x2fb398[_0x7a85('0x31')],_0x2fb398[_0x7a85('0x32')]);_0x286c3d['attributes']=_[_0x7a85('0x35')](_0x2fb398[_0x7a85('0x31')],qs['fields'](_0x5021f1[_0x7a85('0x32')]['fields']));_0x286c3d[_0x7a85('0x36')]=_0x286c3d[_0x7a85('0x36')][_0x7a85('0x38')]?_0x286c3d[_0x7a85('0x36')]:_0x2fb398[_0x7a85('0x31')];_0x286c3d[_0x7a85('0x4a')]=qs[_0x7a85('0x3a')](_0x5021f1[_0x7a85('0x32')]['sort']);_0x286c3d[_0x7a85('0x3b')]=qs[_0x7a85('0x34')](_[_0x7a85('0x3c')](_0x5021f1[_0x7a85('0x32')],_0x2fb398[_0x7a85('0x34')]));if(_0x5021f1[_0x7a85('0x32')][_0x7a85('0x3d')]){_0x286c3d[_0x7a85('0x3b')]=_[_0x7a85('0x3f')](_0x286c3d['where'],{'$or':_['map'](_0x286c3d[_0x7a85('0x36')],function(_0x546d1f){var _0x1ce24f={};_0x1ce24f[_0x546d1f]={'$like':'%'+_0x5021f1[_0x7a85('0x32')][_0x7a85('0x3d')]+'%'};return _0x1ce24f;})});}_0x286c3d=_[_0x7a85('0x3f')]({},_0x286c3d,_0x5021f1[_0x7a85('0x40')]);return _0xef7085[_0x7a85('0x47')](_0x286c3d);}})['then'](function(_0x199794){if(_0x199794){_0x3db9e0=_0x199794[_0x7a85('0x38')];if(!_0x5021f1[_0x7a85('0x32')][_0x7a85('0x39')](_0x7a85('0x4b'))){_0x286c3d[_0x7a85('0x1d')]=qs[_0x7a85('0x1d')](_0x5021f1[_0x7a85('0x32')][_0x7a85('0x1d')]);_0x286c3d['offset']=qs[_0x7a85('0x1c')](_0x5021f1[_0x7a85('0x32')]['offset']);}return _0xef7085[_0x7a85('0x47')](_0x286c3d);}})[_0x7a85('0x24')](function(_0x382a4a){if(_0x382a4a){return _0x382a4a?{'count':_0x3db9e0,'rows':_0x382a4a}:null;}})['then'](respondWithResult(_0x316ddc,null))[_0x7a85('0x42')](handleError(_0x316ddc,null));};exports['getSubjects']=function(_0xac32a6,_0x4cd90c,_0x2bcbeb){var _0x47508c={};var _0x36f27f={};var _0x2fbc35;var _0x5b3cef;return db[_0x7a85('0x2c')]['findOne']({'where':{'id':_0xac32a6[_0x7a85('0x49')]['id']}})[_0x7a85('0x24')](handleEntityNotFound(_0x4cd90c,null))['then'](function(_0x4d9b5c){if(_0x4d9b5c){_0x2fbc35=_0x4d9b5c;_0x36f27f[_0x7a85('0x31')]=_[_0x7a85('0x33')](db['Dynamics365Field']['rawAttributes']);_0x36f27f[_0x7a85('0x32')]=_[_0x7a85('0x33')](_0xac32a6[_0x7a85('0x32')]);_0x36f27f[_0x7a85('0x34')]=_[_0x7a85('0x35')](_0x36f27f[_0x7a85('0x31')],_0x36f27f[_0x7a85('0x32')]);_0x47508c[_0x7a85('0x36')]=_[_0x7a85('0x35')](_0x36f27f[_0x7a85('0x31')],qs[_0x7a85('0x37')](_0xac32a6[_0x7a85('0x32')][_0x7a85('0x37')]));_0x47508c[_0x7a85('0x36')]=_0x47508c['attributes']['length']?_0x47508c[_0x7a85('0x36')]:_0x36f27f[_0x7a85('0x31')];_0x47508c[_0x7a85('0x4a')]=qs[_0x7a85('0x3a')](_0xac32a6[_0x7a85('0x32')][_0x7a85('0x3a')]);_0x47508c[_0x7a85('0x3b')]=qs[_0x7a85('0x34')](_['pick'](_0xac32a6[_0x7a85('0x32')],_0x36f27f['filters']));if(_0xac32a6['query'][_0x7a85('0x3d')]){_0x47508c[_0x7a85('0x3b')]=_[_0x7a85('0x3f')](_0x47508c[_0x7a85('0x3b')],{'$or':_[_0x7a85('0x2b')](_0x47508c['attributes'],function(_0x31a9e3){var _0x1fe794={};_0x1fe794[_0x31a9e3]={'$like':'%'+_0xac32a6[_0x7a85('0x32')][_0x7a85('0x3d')]+'%'};return _0x1fe794;})});}_0x47508c=_[_0x7a85('0x3f')]({},_0x47508c,_0xac32a6[_0x7a85('0x40')]);return _0x2fbc35[_0x7a85('0x4c')](_0x47508c);}})[_0x7a85('0x24')](function(_0x3f289){if(_0x3f289){_0x5b3cef=_0x3f289[_0x7a85('0x38')];if(!_0xac32a6[_0x7a85('0x32')][_0x7a85('0x39')]('nolimit')){_0x47508c[_0x7a85('0x1d')]=qs[_0x7a85('0x1d')](_0xac32a6[_0x7a85('0x32')][_0x7a85('0x1d')]);_0x47508c[_0x7a85('0x1c')]=qs['offset'](_0xac32a6[_0x7a85('0x32')][_0x7a85('0x1c')]);}return _0x2fbc35['getSubjects'](_0x47508c);}})[_0x7a85('0x24')](function(_0x2dbb02){if(_0x2dbb02){return _0x2dbb02?{'count':_0x5b3cef,'rows':_0x2dbb02}:null;}})[_0x7a85('0x24')](respondWithResult(_0x4cd90c,null))['catch'](handleError(_0x4cd90c,null));};exports['getDescriptions']=function(_0xc5c8f9,_0x1036f3,_0xb2cff6){var _0x8c53d3={};var _0x3c6d7c={};var _0x18ae67;var _0x5f04cc;return db['Dynamics365Configuration'][_0x7a85('0x48')]({'where':{'id':_0xc5c8f9[_0x7a85('0x49')]['id']}})['then'](handleEntityNotFound(_0x1036f3,null))['then'](function(_0x31cdb6){if(_0x31cdb6){_0x18ae67=_0x31cdb6;_0x3c6d7c[_0x7a85('0x31')]=_['keys'](db[_0x7a85('0x4d')][_0x7a85('0x2d')]);_0x3c6d7c['query']=_[_0x7a85('0x33')](_0xc5c8f9[_0x7a85('0x32')]);_0x3c6d7c[_0x7a85('0x34')]=_[_0x7a85('0x35')](_0x3c6d7c[_0x7a85('0x31')],_0x3c6d7c['query']);_0x8c53d3[_0x7a85('0x36')]=_[_0x7a85('0x35')](_0x3c6d7c[_0x7a85('0x31')],qs[_0x7a85('0x37')](_0xc5c8f9['query'][_0x7a85('0x37')]));_0x8c53d3['attributes']=_0x8c53d3[_0x7a85('0x36')][_0x7a85('0x38')]?_0x8c53d3[_0x7a85('0x36')]:_0x3c6d7c[_0x7a85('0x31')];_0x8c53d3[_0x7a85('0x4a')]=qs[_0x7a85('0x3a')](_0xc5c8f9['query'][_0x7a85('0x3a')]);_0x8c53d3[_0x7a85('0x3b')]=qs[_0x7a85('0x34')](_['pick'](_0xc5c8f9[_0x7a85('0x32')],_0x3c6d7c['filters']));if(_0xc5c8f9[_0x7a85('0x32')][_0x7a85('0x3d')]){_0x8c53d3[_0x7a85('0x3b')]=_[_0x7a85('0x3f')](_0x8c53d3[_0x7a85('0x3b')],{'$or':_['map'](_0x8c53d3['attributes'],function(_0x57448f){var _0x25aeb8={};_0x25aeb8[_0x57448f]={'$like':'%'+_0xc5c8f9[_0x7a85('0x32')][_0x7a85('0x3d')]+'%'};return _0x25aeb8;})});}_0x8c53d3=_[_0x7a85('0x3f')]({},_0x8c53d3,_0xc5c8f9[_0x7a85('0x40')]);return _0x18ae67['getDescriptions'](_0x8c53d3);}})[_0x7a85('0x24')](function(_0x38056f){if(_0x38056f){_0x5f04cc=_0x38056f[_0x7a85('0x38')];if(!_0xc5c8f9[_0x7a85('0x32')][_0x7a85('0x39')]('nolimit')){_0x8c53d3['limit']=qs[_0x7a85('0x1d')](_0xc5c8f9[_0x7a85('0x32')]['limit']);_0x8c53d3[_0x7a85('0x1c')]=qs[_0x7a85('0x1c')](_0xc5c8f9[_0x7a85('0x32')][_0x7a85('0x1c')]);}return _0x18ae67[_0x7a85('0x4e')](_0x8c53d3);}})[_0x7a85('0x24')](function(_0x353ea4){if(_0x353ea4){return _0x353ea4?{'count':_0x5f04cc,'rows':_0x353ea4}:null;}})[_0x7a85('0x24')](respondWithResult(_0x1036f3,null))[_0x7a85('0x42')](handleError(_0x1036f3,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5b1e4ea..aefc066 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 _0x9c44=['request-promise','path','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','moment','bluebird'];(function(_0x2c39e0,_0x51dd3c){var _0x1141b1=function(_0x414135){while(--_0x414135){_0x2c39e0['push'](_0x2c39e0['shift']());}};_0x1141b1(++_0x51dd3c);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe14d,0x1ee));var _0xde14=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe14d[_0x2d7f0e];return _0x110b07;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 0181193..1c4277b 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 _0x5036=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5036,0x14b));var _0x6503=function(_0x4d821c,_0x22bd0e){_0x4d821c=_0x4d821c-0x0;var _0x15dd5b=_0x5036[_0x4d821c];return _0x15dd5b;};'use strict';var _=require(_0x6503('0x0'));var util=require('util');var moment=require(_0x6503('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6503('0x2'));var db=require(_0x6503('0x3'))['db'];var utils=require(_0x6503('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6503('0x5'));var jayson=require(_0x6503('0x6'));var client=jayson[_0x6503('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba5a3,_0xcb43df,_0x318fe9){return new BPromise(function(_0x3d9944,_0x4057bd){return client[_0x6503('0x8')](_0x4ba5a3,_0x318fe9)[_0x6503('0x9')](function(_0x521493){logger[_0x6503('0xa')](_0x6503('0xb'),_0xcb43df,_0x6503('0xc'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xcb43df,_0x6503('0xc'),JSON[_0x6503('0xd')](_0x521493));if(_0x521493[_0x6503('0xe')]){if(_0x521493[_0x6503('0xe')][_0x6503('0xf')]===0x1f4){logger[_0x6503('0xe')](_0x6503('0xb'),_0xcb43df,_0x521493[_0x6503('0xe')]['message']);return _0x4057bd(_0x521493['error'][_0x6503('0x10')]);}logger[_0x6503('0xe')](_0x6503('0xb'),_0xcb43df,_0x521493[_0x6503('0xe')][_0x6503('0x10')]);return _0x3d9944(_0x521493[_0x6503('0xe')][_0x6503('0x10')]);}else{logger[_0x6503('0xa')](_0x6503('0xb'),_0xcb43df,'request\x20sent');_0x3d9944(_0x521493[_0x6503('0x11')][_0x6503('0x10')]);}})['catch'](function(_0x4fb8a4){logger['error'](_0x6503('0xb'),_0xcb43df,_0x4fb8a4);_0x4057bd(_0x4fb8a4);});});} \ No newline at end of file +var _0xfa6f=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x489d72,_0x264e64){var _0x467599=function(_0x4235e6){while(--_0x4235e6){_0x489d72['push'](_0x489d72['shift']());}};_0x467599(++_0x264e64);}(_0xfa6f,0x1e5));var _0xffa6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfa6f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xffa6('0x0'));var moment=require(_0xffa6('0x1'));var BPromise=require(_0xffa6('0x2'));var rs=require(_0xffa6('0x3'));var fs=require('fs');var Redis=require(_0xffa6('0x4'));var db=require(_0xffa6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xffa6('0x6'))(_0xffa6('0x7'));var config=require(_0xffa6('0x8'));var jayson=require(_0xffa6('0x9'));var client=jayson[_0xffa6('0xa')][_0xffa6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29dc6e,_0x2e824d,_0x52dc0f){return new BPromise(function(_0x4ee629,_0x5bfcb0){return client['request'](_0x29dc6e,_0x52dc0f)[_0xffa6('0xc')](function(_0x48d84a){logger[_0xffa6('0xd')](_0xffa6('0xe'),_0x2e824d,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2e824d,_0xffa6('0xf'),JSON[_0xffa6('0x10')](_0x48d84a));if(_0x48d84a[_0xffa6('0x11')]){if(_0x48d84a[_0xffa6('0x11')][_0xffa6('0x12')]===0x1f4){logger[_0xffa6('0x11')](_0xffa6('0xe'),_0x2e824d,_0x48d84a[_0xffa6('0x11')][_0xffa6('0x13')]);return _0x5bfcb0(_0x48d84a[_0xffa6('0x11')][_0xffa6('0x13')]);}logger[_0xffa6('0x11')](_0xffa6('0xe'),_0x2e824d,_0x48d84a[_0xffa6('0x11')][_0xffa6('0x13')]);return _0x4ee629(_0x48d84a['error'][_0xffa6('0x13')]);}else{logger[_0xffa6('0xd')](_0xffa6('0xe'),_0x2e824d,_0xffa6('0xf'));_0x4ee629(_0x48d84a[_0xffa6('0x14')][_0xffa6('0x13')]);}})[_0xffa6('0x15')](function(_0x4f94b8){logger[_0xffa6('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2e824d,_0x4f94b8);_0x5bfcb0(_0x4f94b8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index eba6115..a0ec6f3 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 _0xc71b=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x31c81b,_0x4a2b1c){var _0x52ab34=function(_0x2e6c48){while(--_0x2e6c48){_0x31c81b['push'](_0x31c81b['shift']());}};_0x52ab34(++_0x4a2b1c);}(_0xc71b,0x7d));var _0xbc71=function(_0x5af0b2,_0x1db833){_0x5af0b2=_0x5af0b2-0x0;var _0x2d7936=_0xc71b[_0x5af0b2];return _0x2d7936;};'use strict';var multer=require(_0xbc71('0x0'));var util=require(_0xbc71('0x1'));var path=require(_0xbc71('0x2'));var timeout=require(_0xbc71('0x3'));var express=require(_0xbc71('0x4'));var router=express['Router']();var fs_extra=require(_0xbc71('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbc71('0x6'));var config=require(_0xbc71('0x7'));var controller=require('./intDynamics365Field.controller');router[_0xbc71('0x8')]('/',auth[_0xbc71('0x9')](),controller['index']);router[_0xbc71('0x8')](_0xbc71('0xa'),auth[_0xbc71('0x9')](),controller['show']);router[_0xbc71('0xb')]('/',auth[_0xbc71('0x9')](),controller[_0xbc71('0xc')]);router[_0xbc71('0xd')]('/:id',auth[_0xbc71('0x9')](),controller[_0xbc71('0xe')]);router[_0xbc71('0xf')](_0xbc71('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xbc71('0x10')]=router; \ No newline at end of file +var _0xae18=['create','update','destroy','exports','util','path','express','Router','../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post'];(function(_0x484aa1,_0x15ed44){var _0x874c1a=function(_0x443d6a){while(--_0x443d6a){_0x484aa1['push'](_0x484aa1['shift']());}};_0x874c1a(++_0x15ed44);}(_0xae18,0x1d5));var _0x8ae1=function(_0x10c913,_0x33a572){_0x10c913=_0x10c913-0x0;var _0x4868be=_0xae18[_0x10c913];return _0x4868be;};'use strict';var multer=require('multer');var util=require(_0x8ae1('0x0'));var path=require(_0x8ae1('0x1'));var timeout=require('connect-timeout');var express=require(_0x8ae1('0x2'));var router=express[_0x8ae1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ae1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8ae1('0x5'));router[_0x8ae1('0x6')]('/',auth[_0x8ae1('0x7')](),controller[_0x8ae1('0x8')]);router[_0x8ae1('0x6')](_0x8ae1('0x9'),auth[_0x8ae1('0x7')](),controller['show']);router[_0x8ae1('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ae1('0xb')]);router['put'](_0x8ae1('0x9'),auth['isAuthenticated'](),controller[_0x8ae1('0xc')]);router['delete']('/:id',auth[_0x8ae1('0x7')](),controller[_0x8ae1('0xd')]);module[_0x8ae1('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f1b5393..e857445 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 _0xa136=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0xa136,0x91));var _0x6a13=function(_0x5501d2,_0x36e066){_0x5501d2=_0x5501d2-0x0;var _0x3bcb21=_0xa136[_0x5501d2];return _0x3bcb21;};'use strict';var Sequelize=require(_0x6a13('0x0'));module[_0x6a13('0x1')]={'type':{'type':Sequelize[_0x6a13('0x2')]('string',_0x6a13('0x3'),_0x6a13('0x4'),_0x6a13('0x5'),_0x6a13('0x6')),'defaultValue':_0x6a13('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6a13('0x8')]},'keyType':{'type':Sequelize[_0x6a13('0x2')](_0x6a13('0x7'),_0x6a13('0x3'),_0x6a13('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6a13('0x8')]},'nameField':{'type':Sequelize[_0x6a13('0x8')]},'customField':{'type':Sequelize[_0x6a13('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a13('0x8')]}}; \ No newline at end of file +var _0x8f01=['exports','keyValue','picklist','STRING','ENUM','string','variable','customVariable','sequelize'];(function(_0x388079,_0x3c05ed){var _0x300b74=function(_0x34cd2c){while(--_0x34cd2c){_0x388079['push'](_0x388079['shift']());}};_0x300b74(++_0x3c05ed);}(_0x8f01,0xd7));var _0x18f0=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0x8f01[_0x492535];return _0x256620;};'use strict';var Sequelize=require(_0x18f0('0x0'));module[_0x18f0('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0x18f0('0x2'),_0x18f0('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x18f0('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x18f0('0x5')](_0x18f0('0x6'),_0x18f0('0x7'),_0x18f0('0x8'))},'keyContent':{'type':Sequelize[_0x18f0('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x18f0('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index e0ae083..a4aaece 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 _0xf868=['findAll','catch','show','params','keys','create','body','update','find','eml-format','rimraf','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include'];(function(_0x2d5844,_0x352c30){var _0x267ff3=function(_0xddca34){while(--_0xddca34){_0x2d5844['push'](_0x2d5844['shift']());}};_0x267ff3(++_0x352c30);}(_0xf868,0x129));var _0x8f86=function(_0x51ae82,_0x4fabc3){_0x51ae82=_0x51ae82-0x0;var _0x588135=_0xf868[_0x51ae82];return _0x588135;};'use strict';var emlformat=require(_0x8f86('0x0'));var rimraf=require(_0x8f86('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f86('0x2'));var BPromise=require(_0x8f86('0x3'));var Mustache=require('mustache');var util=require(_0x8f86('0x4'));var path=require(_0x8f86('0x5'));var sox=require('sox');var csv=require(_0x8f86('0x6'));var ejs=require(_0x8f86('0x7'));var fs=require('fs');var fs_extra=require(_0x8f86('0x8'));var _=require(_0x8f86('0x9'));var squel=require(_0x8f86('0xa'));var crypto=require('crypto');var jsforce=require(_0x8f86('0xb'));var deskjs=require(_0x8f86('0xc'));var toCsv=require(_0x8f86('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8f86('0xd'));var authService=require(_0x8f86('0xe'));var qs=require(_0x8f86('0xf'));var as=require(_0x8f86('0x10'));var hardwareService=require(_0x8f86('0x11'));var logger=require(_0x8f86('0x12'))(_0x8f86('0x13'));var utils=require('../../config/utils');var config=require(_0x8f86('0x14'));var licenseUtil=require(_0x8f86('0x15'));var db=require(_0x8f86('0x16'))['db'];function respondWithStatusCode(_0x1b62aa,_0x112d3c){_0x112d3c=_0x112d3c||0xcc;return function(_0x1d545f){if(_0x1d545f){return _0x1b62aa[_0x8f86('0x17')](_0x112d3c);}return _0x1b62aa[_0x8f86('0x18')](_0x112d3c)[_0x8f86('0x19')]();};}function respondWithResult(_0xb79106,_0x4b4ab6){_0x4b4ab6=_0x4b4ab6||0xc8;return function(_0x112cab){if(_0x112cab){return _0xb79106[_0x8f86('0x18')](_0x4b4ab6)[_0x8f86('0x1a')](_0x112cab);}};}function respondWithFilteredResult(_0x1df05f,_0x3e85ad){return function(_0x182fd5){if(_0x182fd5){var _0x24d3b8=typeof _0x3e85ad[_0x8f86('0x1b')]===_0x8f86('0x1c')&&typeof _0x3e85ad[_0x8f86('0x1d')]===_0x8f86('0x1c');var _0x173cf2=_0x182fd5[_0x8f86('0x1e')];var _0x380178=_0x24d3b8?0x0:_0x3e85ad[_0x8f86('0x1b')];var _0x1a3826=_0x24d3b8?_0x182fd5[_0x8f86('0x1e')]:_0x3e85ad[_0x8f86('0x1b')]+_0x3e85ad[_0x8f86('0x1d')];var _0x4c9a8d;if(_0x1a3826>=_0x173cf2){_0x1a3826=_0x173cf2;_0x4c9a8d=0xc8;}else{_0x4c9a8d=0xce;}_0x1df05f[_0x8f86('0x18')](_0x4c9a8d);return _0x1df05f['set'](_0x8f86('0x1f'),_0x380178+'-'+_0x1a3826+'/'+_0x173cf2)[_0x8f86('0x1a')](_0x182fd5);}return null;};}function patchUpdates(_0x519040){return function(_0x11235c){try{jsonpatch['apply'](_0x11235c,_0x519040,!![]);}catch(_0x46ef21){return BPromise[_0x8f86('0x20')](_0x46ef21);}return _0x11235c['save']();};}function saveUpdates(_0x364b5b,_0x142411){return function(_0x2f69ac){if(_0x2f69ac){return _0x2f69ac['update'](_0x364b5b)[_0x8f86('0x21')](function(_0x4874d5){return _0x4874d5;});}return null;};}function removeEntity(_0x1392fa,_0x41029e){return function(_0x238a4e){if(_0x238a4e){return _0x238a4e[_0x8f86('0x22')]()[_0x8f86('0x21')](function(){_0x1392fa['status'](0xcc)[_0x8f86('0x19')]();});}};}function handleEntityNotFound(_0x3afd3b,_0x50fb9c){return function(_0x328bf5){if(!_0x328bf5){_0x3afd3b[_0x8f86('0x17')](0x194);}return _0x328bf5;};}function handleError(_0x34a6ff,_0x5d2d32){_0x5d2d32=_0x5d2d32||0x1f4;return function(_0x1757f7){logger[_0x8f86('0x23')](_0x1757f7[_0x8f86('0x24')]);if(_0x1757f7[_0x8f86('0x25')]){delete _0x1757f7[_0x8f86('0x25')];}_0x34a6ff[_0x8f86('0x18')](_0x5d2d32)[_0x8f86('0x26')](_0x1757f7);};}exports[_0x8f86('0x27')]=function(_0x1f4878,_0x5ee891){var _0x5e6465={},_0x1fe57a={},_0xf2ad78={'count':0x0,'rows':[]};var _0x327446=_[_0x8f86('0x28')](db[_0x8f86('0x29')][_0x8f86('0x2a')],function(_0xe6c0f7){return{'name':_0xe6c0f7[_0x8f86('0x2b')],'type':_0xe6c0f7[_0x8f86('0x2c')][_0x8f86('0x2d')]};});_0x1fe57a[_0x8f86('0x2e')]=_[_0x8f86('0x28')](_0x327446,_0x8f86('0x25'));_0x1fe57a['query']=_['keys'](_0x1f4878[_0x8f86('0x2f')]);_0x1fe57a['filters']=_['intersection'](_0x1fe57a[_0x8f86('0x2e')],_0x1fe57a['query']);_0x5e6465[_0x8f86('0x30')]=_[_0x8f86('0x31')](_0x1fe57a[_0x8f86('0x2e')],qs[_0x8f86('0x32')](_0x1f4878[_0x8f86('0x2f')][_0x8f86('0x32')]));_0x5e6465['attributes']=_0x5e6465['attributes'][_0x8f86('0x33')]?_0x5e6465['attributes']:_0x1fe57a[_0x8f86('0x2e')];if(!_0x1f4878['query'][_0x8f86('0x34')](_0x8f86('0x35'))){_0x5e6465['limit']=qs['limit'](_0x1f4878[_0x8f86('0x2f')][_0x8f86('0x1d')]);_0x5e6465['offset']=qs['offset'](_0x1f4878['query'][_0x8f86('0x1b')]);}_0x5e6465['order']=qs[_0x8f86('0x36')](_0x1f4878[_0x8f86('0x2f')][_0x8f86('0x36')]);_0x5e6465['where']=qs[_0x8f86('0x37')](_['pick'](_0x1f4878[_0x8f86('0x2f')],_0x1fe57a[_0x8f86('0x37')]),_0x327446);if(_0x1f4878[_0x8f86('0x2f')][_0x8f86('0x38')]){_0x5e6465[_0x8f86('0x39')]=_['merge'](_0x5e6465['where'],{'$or':_['map'](_0x327446,function(_0x1df35f){if(_0x1df35f[_0x8f86('0x2c')]!==_0x8f86('0x3a')){var _0x147385={};_0x147385[_0x1df35f[_0x8f86('0x25')]]={'$like':'%'+_0x1f4878[_0x8f86('0x2f')][_0x8f86('0x38')]+'%'};return _0x147385;}})});}_0x5e6465=_[_0x8f86('0x3b')]({},_0x5e6465,_0x1f4878[_0x8f86('0x3c')]);var _0x8470ec={'where':_0x5e6465[_0x8f86('0x39')]};return db[_0x8f86('0x29')]['count'](_0x8470ec)[_0x8f86('0x21')](function(_0x389c60){_0xf2ad78[_0x8f86('0x1e')]=_0x389c60;if(_0x1f4878['query'][_0x8f86('0x3d')]){_0x5e6465[_0x8f86('0x3e')]=[{'all':!![]}];}return db[_0x8f86('0x29')][_0x8f86('0x3f')](_0x5e6465);})[_0x8f86('0x21')](function(_0xc50bbf){_0xf2ad78['rows']=_0xc50bbf;return _0xf2ad78;})[_0x8f86('0x21')](respondWithFilteredResult(_0x5ee891,_0x5e6465))[_0x8f86('0x40')](handleError(_0x5ee891,null));};exports[_0x8f86('0x41')]=function(_0xdf936c,_0x2295d7){var _0x5d7a7a={'raw':!![],'where':{'id':_0xdf936c[_0x8f86('0x42')]['id']}},_0x414fe6={};_0x414fe6[_0x8f86('0x2e')]=_[_0x8f86('0x43')](db[_0x8f86('0x29')][_0x8f86('0x2a')]);_0x414fe6[_0x8f86('0x2f')]=_['keys'](_0xdf936c[_0x8f86('0x2f')]);_0x414fe6[_0x8f86('0x37')]=_['intersection'](_0x414fe6[_0x8f86('0x2e')],_0x414fe6[_0x8f86('0x2f')]);_0x5d7a7a[_0x8f86('0x30')]=_['intersection'](_0x414fe6[_0x8f86('0x2e')],qs['fields'](_0xdf936c['query'][_0x8f86('0x32')]));_0x5d7a7a[_0x8f86('0x30')]=_0x5d7a7a[_0x8f86('0x30')][_0x8f86('0x33')]?_0x5d7a7a[_0x8f86('0x30')]:_0x414fe6[_0x8f86('0x2e')];if(_0xdf936c[_0x8f86('0x2f')][_0x8f86('0x3d')]){_0x5d7a7a[_0x8f86('0x3e')]=[{'all':!![]}];}_0x5d7a7a=_[_0x8f86('0x3b')]({},_0x5d7a7a,_0xdf936c[_0x8f86('0x3c')]);return db[_0x8f86('0x29')]['find'](_0x5d7a7a)[_0x8f86('0x21')](handleEntityNotFound(_0x2295d7,null))[_0x8f86('0x21')](respondWithResult(_0x2295d7,null))[_0x8f86('0x40')](handleError(_0x2295d7,null));};exports[_0x8f86('0x44')]=function(_0x241ed0,_0x184232){return db[_0x8f86('0x29')][_0x8f86('0x44')](_0x241ed0[_0x8f86('0x45')],{})[_0x8f86('0x21')](respondWithResult(_0x184232,0xc9))[_0x8f86('0x40')](handleError(_0x184232,null));};exports[_0x8f86('0x46')]=function(_0x3f1c72,_0x296ab6){if(_0x3f1c72[_0x8f86('0x45')]['id']){delete _0x3f1c72[_0x8f86('0x45')]['id'];}return db['Dynamics365Field'][_0x8f86('0x47')]({'where':{'id':_0x3f1c72[_0x8f86('0x42')]['id']}})[_0x8f86('0x21')](handleEntityNotFound(_0x296ab6,null))['then'](saveUpdates(_0x3f1c72[_0x8f86('0x45')],null))[_0x8f86('0x21')](respondWithResult(_0x296ab6,null))[_0x8f86('0x40')](handleError(_0x296ab6,null));};exports[_0x8f86('0x22')]=function(_0x3d192a,_0x35eeb8){return db[_0x8f86('0x29')][_0x8f86('0x47')]({'where':{'id':_0x3d192a[_0x8f86('0x42')]['id']}})['then'](handleEntityNotFound(_0x35eeb8,null))[_0x8f86('0x21')](removeEntity(_0x35eeb8,null))['catch'](handleError(_0x35eeb8,null));}; \ No newline at end of file +var _0xe685=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','offset','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe685,0x116));var _0x5e68=function(_0x2f3b4c,_0x2633ff){_0x2f3b4c=_0x2f3b4c-0x0;var _0x4cc7d7=_0xe685[_0x2f3b4c];return _0x4cc7d7;};'use strict';var emlformat=require(_0x5e68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e68('0x1'));var jsonpatch=require(_0x5e68('0x2'));var rp=require(_0x5e68('0x3'));var moment=require(_0x5e68('0x4'));var BPromise=require(_0x5e68('0x5'));var Mustache=require(_0x5e68('0x6'));var util=require(_0x5e68('0x7'));var path=require(_0x5e68('0x8'));var sox=require(_0x5e68('0x9'));var csv=require('to-csv');var ejs=require(_0x5e68('0xa'));var fs=require('fs');var fs_extra=require(_0x5e68('0xb'));var _=require(_0x5e68('0xc'));var squel=require(_0x5e68('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e68('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e68('0xf'));var authService=require(_0x5e68('0x10'));var qs=require(_0x5e68('0x11'));var as=require(_0x5e68('0x12'));var hardwareService=require(_0x5e68('0x13'));var logger=require('../../config/logger')(_0x5e68('0x14'));var utils=require(_0x5e68('0x15'));var config=require(_0x5e68('0x16'));var licenseUtil=require(_0x5e68('0x17'));var db=require(_0x5e68('0x18'))['db'];function respondWithStatusCode(_0x46482d,_0x10361f){_0x10361f=_0x10361f||0xcc;return function(_0x259689){if(_0x259689){return _0x46482d['sendStatus'](_0x10361f);}return _0x46482d[_0x5e68('0x19')](_0x10361f)[_0x5e68('0x1a')]();};}function respondWithResult(_0x187e20,_0x40ead3){_0x40ead3=_0x40ead3||0xc8;return function(_0x24c956){if(_0x24c956){return _0x187e20['status'](_0x40ead3)[_0x5e68('0x1b')](_0x24c956);}};}function respondWithFilteredResult(_0x19bb7d,_0x27fc90){return function(_0x450957){if(_0x450957){var _0x4e9ae9=typeof _0x27fc90['offset']==='undefined'&&typeof _0x27fc90[_0x5e68('0x1c')]===_0x5e68('0x1d');var _0x3b5592=_0x450957['count'];var _0x3d7803=_0x4e9ae9?0x0:_0x27fc90['offset'];var _0x246ec7=_0x4e9ae9?_0x450957['count']:_0x27fc90[_0x5e68('0x1e')]+_0x27fc90[_0x5e68('0x1c')];var _0x1eb730;if(_0x246ec7>=_0x3b5592){_0x246ec7=_0x3b5592;_0x1eb730=0xc8;}else{_0x1eb730=0xce;}_0x19bb7d[_0x5e68('0x19')](_0x1eb730);return _0x19bb7d[_0x5e68('0x1f')](_0x5e68('0x20'),_0x3d7803+'-'+_0x246ec7+'/'+_0x3b5592)[_0x5e68('0x1b')](_0x450957);}return null;};}function patchUpdates(_0x2052a7){return function(_0x1bf07a){try{jsonpatch['apply'](_0x1bf07a,_0x2052a7,!![]);}catch(_0x1c4b9b){return BPromise[_0x5e68('0x21')](_0x1c4b9b);}return _0x1bf07a['save']();};}function saveUpdates(_0x13c509,_0x503c90){return function(_0x5c0986){if(_0x5c0986){return _0x5c0986[_0x5e68('0x22')](_0x13c509)['then'](function(_0x20e84e){return _0x20e84e;});}return null;};}function removeEntity(_0x24fd12,_0x1db798){return function(_0x14254b){if(_0x14254b){return _0x14254b[_0x5e68('0x23')]()[_0x5e68('0x24')](function(){_0x24fd12[_0x5e68('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e3ff,_0x308e80){return function(_0x3e953e){if(!_0x3e953e){_0x4e3ff[_0x5e68('0x25')](0x194);}return _0x3e953e;};}function handleError(_0x4a1f84,_0x524988){_0x524988=_0x524988||0x1f4;return function(_0x54884d){logger[_0x5e68('0x26')](_0x54884d[_0x5e68('0x27')]);if(_0x54884d[_0x5e68('0x28')]){delete _0x54884d[_0x5e68('0x28')];}_0x4a1f84['status'](_0x524988)[_0x5e68('0x29')](_0x54884d);};}exports[_0x5e68('0x2a')]=function(_0xd3357,_0x34d599){var _0x999ce2={},_0x45e431={},_0xaf94fc={'count':0x0,'rows':[]};var _0xa49603=_[_0x5e68('0x2b')](db[_0x5e68('0x2c')][_0x5e68('0x2d')],function(_0x3b0372){return{'name':_0x3b0372[_0x5e68('0x2e')],'type':_0x3b0372['type']['key']};});_0x45e431[_0x5e68('0x2f')]=_[_0x5e68('0x2b')](_0xa49603,_0x5e68('0x28'));_0x45e431[_0x5e68('0x30')]=_[_0x5e68('0x31')](_0xd3357['query']);_0x45e431['filters']=_[_0x5e68('0x32')](_0x45e431[_0x5e68('0x2f')],_0x45e431[_0x5e68('0x30')]);_0x999ce2[_0x5e68('0x33')]=_[_0x5e68('0x32')](_0x45e431[_0x5e68('0x2f')],qs['fields'](_0xd3357['query'][_0x5e68('0x34')]));_0x999ce2[_0x5e68('0x33')]=_0x999ce2[_0x5e68('0x33')][_0x5e68('0x35')]?_0x999ce2[_0x5e68('0x33')]:_0x45e431[_0x5e68('0x2f')];if(!_0xd3357['query'][_0x5e68('0x36')](_0x5e68('0x37'))){_0x999ce2['limit']=qs['limit'](_0xd3357[_0x5e68('0x30')][_0x5e68('0x1c')]);_0x999ce2[_0x5e68('0x1e')]=qs[_0x5e68('0x1e')](_0xd3357[_0x5e68('0x30')][_0x5e68('0x1e')]);}_0x999ce2['order']=qs[_0x5e68('0x38')](_0xd3357[_0x5e68('0x30')][_0x5e68('0x38')]);_0x999ce2[_0x5e68('0x39')]=qs[_0x5e68('0x3a')](_[_0x5e68('0x3b')](_0xd3357[_0x5e68('0x30')],_0x45e431[_0x5e68('0x3a')]),_0xa49603);if(_0xd3357[_0x5e68('0x30')][_0x5e68('0x3c')]){_0x999ce2[_0x5e68('0x39')]=_[_0x5e68('0x3d')](_0x999ce2[_0x5e68('0x39')],{'$or':_['map'](_0xa49603,function(_0x2cdb55){if(_0x2cdb55[_0x5e68('0x3e')]!==_0x5e68('0x3f')){var _0x4b0cd9={};_0x4b0cd9[_0x2cdb55[_0x5e68('0x28')]]={'$like':'%'+_0xd3357[_0x5e68('0x30')][_0x5e68('0x3c')]+'%'};return _0x4b0cd9;}})});}_0x999ce2=_[_0x5e68('0x3d')]({},_0x999ce2,_0xd3357['options']);var _0x59e7d0={'where':_0x999ce2['where']};return db[_0x5e68('0x2c')][_0x5e68('0x40')](_0x59e7d0)[_0x5e68('0x24')](function(_0x17af89){_0xaf94fc[_0x5e68('0x40')]=_0x17af89;if(_0xd3357[_0x5e68('0x30')][_0x5e68('0x41')]){_0x999ce2[_0x5e68('0x42')]=[{'all':!![]}];}return db[_0x5e68('0x2c')][_0x5e68('0x43')](_0x999ce2);})['then'](function(_0x35b07e){_0xaf94fc[_0x5e68('0x44')]=_0x35b07e;return _0xaf94fc;})['then'](respondWithFilteredResult(_0x34d599,_0x999ce2))[_0x5e68('0x45')](handleError(_0x34d599,null));};exports['show']=function(_0x2b7812,_0x5b6391){var _0x363d1c={'raw':!![],'where':{'id':_0x2b7812[_0x5e68('0x46')]['id']}},_0x2e20e3={};_0x2e20e3[_0x5e68('0x2f')]=_[_0x5e68('0x31')](db[_0x5e68('0x2c')][_0x5e68('0x2d')]);_0x2e20e3[_0x5e68('0x30')]=_[_0x5e68('0x31')](_0x2b7812[_0x5e68('0x30')]);_0x2e20e3[_0x5e68('0x3a')]=_['intersection'](_0x2e20e3['model'],_0x2e20e3[_0x5e68('0x30')]);_0x363d1c['attributes']=_[_0x5e68('0x32')](_0x2e20e3[_0x5e68('0x2f')],qs['fields'](_0x2b7812[_0x5e68('0x30')]['fields']));_0x363d1c[_0x5e68('0x33')]=_0x363d1c['attributes'][_0x5e68('0x35')]?_0x363d1c[_0x5e68('0x33')]:_0x2e20e3['model'];if(_0x2b7812[_0x5e68('0x30')][_0x5e68('0x41')]){_0x363d1c[_0x5e68('0x42')]=[{'all':!![]}];}_0x363d1c=_[_0x5e68('0x3d')]({},_0x363d1c,_0x2b7812['options']);return db[_0x5e68('0x2c')][_0x5e68('0x47')](_0x363d1c)[_0x5e68('0x24')](handleEntityNotFound(_0x5b6391,null))[_0x5e68('0x24')](respondWithResult(_0x5b6391,null))[_0x5e68('0x45')](handleError(_0x5b6391,null));};exports[_0x5e68('0x48')]=function(_0x84d2ec,_0x26e50c){return db['Dynamics365Field']['create'](_0x84d2ec[_0x5e68('0x49')],{})[_0x5e68('0x24')](respondWithResult(_0x26e50c,0xc9))[_0x5e68('0x45')](handleError(_0x26e50c,null));};exports[_0x5e68('0x22')]=function(_0x327efb,_0x4e28eb){if(_0x327efb[_0x5e68('0x49')]['id']){delete _0x327efb[_0x5e68('0x49')]['id'];}return db['Dynamics365Field'][_0x5e68('0x47')]({'where':{'id':_0x327efb['params']['id']}})['then'](handleEntityNotFound(_0x4e28eb,null))[_0x5e68('0x24')](saveUpdates(_0x327efb[_0x5e68('0x49')],null))['then'](respondWithResult(_0x4e28eb,null))['catch'](handleError(_0x4e28eb,null));};exports[_0x5e68('0x23')]=function(_0x5235ab,_0x36ec19){return db[_0x5e68('0x2c')][_0x5e68('0x47')]({'where':{'id':_0x5235ab[_0x5e68('0x46')]['id']}})[_0x5e68('0x24')](handleEntityNotFound(_0x36ec19,null))[_0x5e68('0x24')](removeEntity(_0x36ec19,null))[_0x5e68('0x45')](handleError(_0x36ec19,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9968d1d..963e36e 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 _0x53e8=['idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x2be73a,_0x2e4b2e){var _0x3f47b9=function(_0x3dd782){while(--_0x3dd782){_0x2be73a['push'](_0x2be73a['shift']());}};_0x3f47b9(++_0x2e4b2e);}(_0x53e8,0x15b));var _0x853e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x53e8[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x853e('0x0'));var util=require(_0x853e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x853e('0x2'));var BPromise=require(_0x853e('0x3'));var rp=require(_0x853e('0x4'));var fs=require('fs');var path=require(_0x853e('0x5'));var rimraf=require(_0x853e('0x6'));var config=require(_0x853e('0x7'));var attributes=require(_0x853e('0x8'));module[_0x853e('0x9')]=function(_0x56f344,_0x560002){return _0x56f344[_0x853e('0xa')]('Dynamics365Field',attributes,{'tableName':_0x853e('0xb'),'paranoid':![],'indexes':[{'name':_0x853e('0xc'),'fields':[_0x853e('0xd'),_0x853e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x422a=['util','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x422a,0x12b));var _0xa422=function(_0x3943a0,_0x546510){_0x3943a0=_0x3943a0-0x0;var _0x132d6e=_0x422a[_0x3943a0];return _0x132d6e;};'use strict';var _=require(_0xa422('0x0'));var util=require(_0xa422('0x1'));var logger=require('../../config/logger')(_0xa422('0x2'));var moment=require(_0xa422('0x3'));var BPromise=require(_0xa422('0x4'));var rp=require(_0xa422('0x5'));var fs=require('fs');var path=require(_0xa422('0x6'));var rimraf=require(_0xa422('0x7'));var config=require('../../config/environment');var attributes=require(_0xa422('0x8'));module[_0xa422('0x9')]=function(_0x3f5786,_0x422a50){return _0x3f5786['define'](_0xa422('0xa'),attributes,{'tableName':_0xa422('0xb'),'paranoid':![],'indexes':[{'name':_0xa422('0xc'),'fields':[_0xa422('0xd'),_0xa422('0xe')],'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 e9de715..6d4928c 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 _0x5c1c=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c1c,0x1c4));var _0xc5c1=function(_0x55c556,_0x50a349){_0x55c556=_0x55c556-0x0;var _0x5b6507=_0x5c1c[_0x55c556];return _0x5b6507;};'use strict';var _=require('lodash');var util=require(_0xc5c1('0x0'));var moment=require(_0xc5c1('0x1'));var BPromise=require(_0xc5c1('0x2'));var rs=require(_0xc5c1('0x3'));var fs=require('fs');var Redis=require(_0xc5c1('0x4'));var db=require(_0xc5c1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5c1('0x6'))(_0xc5c1('0x7'));var config=require(_0xc5c1('0x8'));var jayson=require(_0xc5c1('0x9'));var client=jayson[_0xc5c1('0xa')][_0xc5c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28a4c2,_0x141941,_0xe16fe2){return new BPromise(function(_0x1bbb68,_0x3f6845){return client[_0xc5c1('0xc')](_0x28a4c2,_0xe16fe2)[_0xc5c1('0xd')](function(_0x5bf08d){logger[_0xc5c1('0xe')](_0xc5c1('0xf'),_0x141941,_0xc5c1('0x10'));logger[_0xc5c1('0x11')](_0xc5c1('0x12'),_0x141941,_0xc5c1('0x10'),JSON[_0xc5c1('0x13')](_0x5bf08d));if(_0x5bf08d['error']){if(_0x5bf08d['error'][_0xc5c1('0x14')]===0x1f4){logger[_0xc5c1('0x15')](_0xc5c1('0xf'),_0x141941,_0x5bf08d['error'][_0xc5c1('0x16')]);return _0x3f6845(_0x5bf08d[_0xc5c1('0x15')][_0xc5c1('0x16')]);}logger[_0xc5c1('0x15')](_0xc5c1('0xf'),_0x141941,_0x5bf08d[_0xc5c1('0x15')]['message']);return _0x1bbb68(_0x5bf08d[_0xc5c1('0x15')][_0xc5c1('0x16')]);}else{logger['info'](_0xc5c1('0xf'),_0x141941,_0xc5c1('0x10'));_0x1bbb68(_0x5bf08d[_0xc5c1('0x17')][_0xc5c1('0x16')]);}})[_0xc5c1('0x18')](function(_0x4bf5f0){logger['error'](_0xc5c1('0xf'),_0x141941,_0x4bf5f0);_0x3f6845(_0x4bf5f0);});});} \ No newline at end of file +var _0x0cfc=['request','then','info','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x11a879,_0x1d692a){var _0x5447b1=function(_0x37ac51){while(--_0x37ac51){_0x11a879['push'](_0x11a879['shift']());}};_0x5447b1(++_0x1d692a);}(_0x0cfc,0x8f));var _0xc0cf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0cfc[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xc0cf('0x0'));var moment=require(_0xc0cf('0x1'));var BPromise=require(_0xc0cf('0x2'));var rs=require(_0xc0cf('0x3'));var fs=require('fs');var Redis=require(_0xc0cf('0x4'));var db=require(_0xc0cf('0x5'))['db'];var utils=require(_0xc0cf('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0cf('0x7'));var jayson=require(_0xc0cf('0x8'));var client=jayson[_0xc0cf('0x9')][_0xc0cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f219d,_0x3bd9ff,_0x318bca){return new BPromise(function(_0x109ee9,_0x2e0860){return client[_0xc0cf('0xb')](_0x4f219d,_0x318bca)[_0xc0cf('0xc')](function(_0x45942f){logger[_0xc0cf('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x3bd9ff,_0xc0cf('0xe'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3bd9ff,_0xc0cf('0xe'),JSON[_0xc0cf('0xf')](_0x45942f));if(_0x45942f[_0xc0cf('0x10')]){if(_0x45942f['error'][_0xc0cf('0x11')]===0x1f4){logger[_0xc0cf('0x10')](_0xc0cf('0x12'),_0x3bd9ff,_0x45942f[_0xc0cf('0x10')]['message']);return _0x2e0860(_0x45942f[_0xc0cf('0x10')][_0xc0cf('0x13')]);}logger[_0xc0cf('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x3bd9ff,_0x45942f['error'][_0xc0cf('0x13')]);return _0x109ee9(_0x45942f[_0xc0cf('0x10')][_0xc0cf('0x13')]);}else{logger[_0xc0cf('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x3bd9ff,_0xc0cf('0xe'));_0x109ee9(_0x45942f[_0xc0cf('0x14')][_0xc0cf('0x13')]);}})[_0xc0cf('0x15')](function(_0x1b6215){logger['error'](_0xc0cf('0x12'),_0x3bd9ff,_0x1b6215);_0x2e0860(_0x1b6215);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8731002..49ca074 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 _0x92f2=['/:id','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x49fb1c,_0x113891){var _0x36cc02=function(_0x308d72){while(--_0x308d72){_0x49fb1c['push'](_0x49fb1c['shift']());}};_0x36cc02(++_0x113891);}(_0x92f2,0x126));var _0x292f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x92f2[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x292f('0x0'));var util=require('util');var path=require(_0x292f('0x1'));var timeout=require('connect-timeout');var express=require(_0x292f('0x2'));var router=express[_0x292f('0x3')]();var fs_extra=require(_0x292f('0x4'));var auth=require(_0x292f('0x5'));var interaction=require(_0x292f('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x292f('0x7')]('/',auth[_0x292f('0x8')](),controller[_0x292f('0x9')]);router[_0x292f('0x7')](_0x292f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x292f('0x7')]('/:id/configurations',auth[_0x292f('0x8')](),controller['getConfigurations']);router[_0x292f('0x7')](_0x292f('0xb'),auth[_0x292f('0x8')](),controller['getFields']);router[_0x292f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x292f('0xc')](_0x292f('0xd'),auth[_0x292f('0x8')](),controller[_0x292f('0xe')]);router[_0x292f('0xf')](_0x292f('0xa'),auth[_0x292f('0x8')](),controller[_0x292f('0x10')]);router[_0x292f('0x11')](_0x292f('0xa'),auth[_0x292f('0x8')](),controller[_0x292f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0930=['/:id','show','/:id/configurations','/:id/fields','create','post','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x22e2c5,_0x115b33){var _0x19e58d=function(_0x11f4ea){while(--_0x11f4ea){_0x22e2c5['push'](_0x22e2c5['shift']());}};_0x19e58d(++_0x115b33);}(_0x0930,0x126));var _0x0093=function(_0x4c2bc5,_0x4984e2){_0x4c2bc5=_0x4c2bc5-0x0;var _0x487209=_0x0930[_0x4c2bc5];return _0x487209;};'use strict';var multer=require('multer');var util=require(_0x0093('0x0'));var path=require('path');var timeout=require(_0x0093('0x1'));var express=require(_0x0093('0x2'));var router=express[_0x0093('0x3')]();var fs_extra=require(_0x0093('0x4'));var auth=require(_0x0093('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0093('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x0093('0x7')]('/',auth[_0x0093('0x8')](),controller[_0x0093('0x9')]);router[_0x0093('0x7')](_0x0093('0xa'),auth[_0x0093('0x8')](),controller[_0x0093('0xb')]);router[_0x0093('0x7')](_0x0093('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x0093('0xd'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x0093('0x8')](),controller[_0x0093('0xe')]);router[_0x0093('0xf')](_0x0093('0xc'),auth[_0x0093('0x8')](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0093('0x10')](_0x0093('0xa'),auth[_0x0093('0x8')](),controller[_0x0093('0x11')]);module[_0x0093('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index f75ad61..0ab891d 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 _0x7916=['sequelize','STRING','username','remoteUri'];(function(_0x55f160,_0x722f1f){var _0x1ddce6=function(_0x28552a){while(--_0x28552a){_0x55f160['push'](_0x55f160['shift']());}};_0x1ddce6(++_0x722f1f);}(_0x7916,0x128));var _0x6791=function(_0x478e89,_0x9d1545){_0x478e89=_0x478e89-0x0;var _0x4eb4e5=_0x7916[_0x478e89];return _0x4eb4e5;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')]},'description':{'type':Sequelize[_0x6791('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6791('0x2')},'apiKey':{'type':Sequelize[_0x6791('0x1')]},'remoteUri':{'type':Sequelize[_0x6791('0x1')],'unique':_0x6791('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x47844,_0x413cca){var _0x23a86a=function(_0x22ee63){while(--_0x22ee63){_0x47844['push'](_0x47844['shift']());}};_0x23a86a(++_0x413cca);}(_0xd943,0x15d));var _0x3d94=function(_0x181380,_0x382e2f){_0x181380=_0x181380-0x0;var _0x97c0c5=_0xd943[_0x181380];return _0x97c0c5;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index c0e0b6b..a24a173 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 _0xb84e=['index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','options','include','findAll','catch','show','includeAll','merge','body','find','params','FreshdeskConfiguration','sort','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','create','getFields','remoteUri','apiKey','slice','lastIndexOf','format','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','custom_text','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send'];(function(_0x304957,_0x486700){var _0x374ca2=function(_0x1123b3){while(--_0x1123b3){_0x304957['push'](_0x304957['shift']());}};_0x374ca2(++_0x486700);}(_0xb84e,0xbf));var _0xeb84=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0xb84e[_0x59e821];return _0x5333f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb84('0x0'));var zipdir=require(_0xeb84('0x1'));var jsonpatch=require(_0xeb84('0x2'));var rp=require(_0xeb84('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb84('0x4'));var util=require(_0xeb84('0x5'));var path=require(_0xeb84('0x6'));var sox=require(_0xeb84('0x7'));var csv=require(_0xeb84('0x8'));var ejs=require(_0xeb84('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb84('0xa'));var crypto=require('crypto');var jsforce=require(_0xeb84('0xb'));var deskjs=require(_0xeb84('0xc'));var toCsv=require(_0xeb84('0x8'));var querystring=require(_0xeb84('0xd'));var Papa=require('papaparse');var Redis=require(_0xeb84('0xe'));var authService=require(_0xeb84('0xf'));var qs=require(_0xeb84('0x10'));var as=require(_0xeb84('0x11'));var hardwareService=require(_0xeb84('0x12'));var logger=require(_0xeb84('0x13'))(_0xeb84('0x14'));var utils=require(_0xeb84('0x15'));var config=require(_0xeb84('0x16'));var licenseUtil=require(_0xeb84('0x17'));var db=require(_0xeb84('0x18'))['db'];var integrations=require(_0xeb84('0x19'));function respondWithStatusCode(_0xfe7209,_0x59692e){_0x59692e=_0x59692e||0xcc;return function(_0x5bab5f){if(_0x5bab5f){return _0xfe7209[_0xeb84('0x1a')](_0x59692e);}return _0xfe7209[_0xeb84('0x1b')](_0x59692e)[_0xeb84('0x1c')]();};}function respondWithResult(_0x24cb39,_0x460016){_0x460016=_0x460016||0xc8;return function(_0xf54282){if(_0xf54282){return _0x24cb39['status'](_0x460016)[_0xeb84('0x1d')](_0xf54282);}};}function respondWithFilteredResult(_0x457b61,_0x105382){return function(_0xff258e){if(_0xff258e){var _0x4e7839=typeof _0x105382[_0xeb84('0x1e')]===_0xeb84('0x1f')&&typeof _0x105382[_0xeb84('0x20')]===_0xeb84('0x1f');var _0x3c5415=_0xff258e['count'];var _0x6ec07d=_0x4e7839?0x0:_0x105382['offset'];var _0x360575=_0x4e7839?_0xff258e[_0xeb84('0x21')]:_0x105382[_0xeb84('0x1e')]+_0x105382['limit'];var _0x568a75;if(_0x360575>=_0x3c5415){_0x360575=_0x3c5415;_0x568a75=0xc8;}else{_0x568a75=0xce;}_0x457b61[_0xeb84('0x1b')](_0x568a75);return _0x457b61[_0xeb84('0x22')](_0xeb84('0x23'),_0x6ec07d+'-'+_0x360575+'/'+_0x3c5415)[_0xeb84('0x1d')](_0xff258e);}return null;};}function patchUpdates(_0x3401ce){return function(_0x30f460){try{jsonpatch[_0xeb84('0x24')](_0x30f460,_0x3401ce,!![]);}catch(_0x224c91){return BPromise[_0xeb84('0x25')](_0x224c91);}return _0x30f460[_0xeb84('0x26')]();};}function saveUpdates(_0x159622,_0xea877a){return function(_0x3d0789){if(_0x3d0789){return _0x3d0789[_0xeb84('0x27')](_0x159622)[_0xeb84('0x28')](function(_0xae2c58){return _0xae2c58;});}return null;};}function removeEntity(_0x507115,_0x22ebf7){return function(_0x64b4ac){if(_0x64b4ac){return _0x64b4ac['destroy']()[_0xeb84('0x28')](function(){_0x507115[_0xeb84('0x1b')](0xcc)[_0xeb84('0x1c')]();});}};}function handleEntityNotFound(_0x993591,_0x3ccca6){return function(_0x31634b){if(!_0x31634b){_0x993591[_0xeb84('0x1a')](0x194);}return _0x31634b;};}function handleError(_0x4c805a,_0x4fae19){_0x4fae19=_0x4fae19||0x1f4;return function(_0x3cb622){logger[_0xeb84('0x29')](_0x3cb622[_0xeb84('0x2a')]);if(_0x3cb622[_0xeb84('0x2b')]){delete _0x3cb622[_0xeb84('0x2b')];}_0x4c805a[_0xeb84('0x1b')](_0x4fae19)[_0xeb84('0x2c')](_0x3cb622);};}exports[_0xeb84('0x2d')]=function(_0x397ecf,_0x87142a){var _0x2cd088={},_0x238772={},_0x414be4={'count':0x0,'rows':[]};var _0xb914ec=_['map'](db[_0xeb84('0x2e')][_0xeb84('0x2f')],function(_0x3e6bd5){return{'name':_0x3e6bd5[_0xeb84('0x30')],'type':_0x3e6bd5[_0xeb84('0x31')][_0xeb84('0x32')]};});_0x238772[_0xeb84('0x33')]=_[_0xeb84('0x34')](_0xb914ec,_0xeb84('0x2b'));_0x238772[_0xeb84('0x35')]=_[_0xeb84('0x36')](_0x397ecf['query']);_0x238772['filters']=_[_0xeb84('0x37')](_0x238772['model'],_0x238772[_0xeb84('0x35')]);_0x2cd088[_0xeb84('0x38')]=_[_0xeb84('0x37')](_0x238772[_0xeb84('0x33')],qs['fields'](_0x397ecf['query'][_0xeb84('0x39')]));_0x2cd088[_0xeb84('0x38')]=_0x2cd088['attributes'][_0xeb84('0x3a')]?_0x2cd088[_0xeb84('0x38')]:_0x238772['model'];if(!_0x397ecf[_0xeb84('0x35')][_0xeb84('0x3b')]('nolimit')){_0x2cd088[_0xeb84('0x20')]=qs['limit'](_0x397ecf['query'][_0xeb84('0x20')]);_0x2cd088['offset']=qs[_0xeb84('0x1e')](_0x397ecf[_0xeb84('0x35')][_0xeb84('0x1e')]);}_0x2cd088[_0xeb84('0x3c')]=qs['sort'](_0x397ecf[_0xeb84('0x35')]['sort']);_0x2cd088[_0xeb84('0x3d')]=qs[_0xeb84('0x3e')](_[_0xeb84('0x3f')](_0x397ecf[_0xeb84('0x35')],_0x238772[_0xeb84('0x3e')]),_0xb914ec);if(_0x397ecf[_0xeb84('0x35')][_0xeb84('0x40')]){_0x2cd088[_0xeb84('0x3d')]=_['merge'](_0x2cd088[_0xeb84('0x3d')],{'$or':_[_0xeb84('0x34')](_0xb914ec,function(_0x46df8a){if(_0x46df8a[_0xeb84('0x31')]!==_0xeb84('0x41')){var _0x413e36={};_0x413e36[_0x46df8a['name']]={'$like':'%'+_0x397ecf['query'][_0xeb84('0x40')]+'%'};return _0x413e36;}})});}_0x2cd088=_['merge']({},_0x2cd088,_0x397ecf[_0xeb84('0x42')]);var _0xa84c41={'where':_0x2cd088[_0xeb84('0x3d')]};return db['FreshdeskAccount'][_0xeb84('0x21')](_0xa84c41)[_0xeb84('0x28')](function(_0x1ee328){_0x414be4['count']=_0x1ee328;if(_0x397ecf[_0xeb84('0x35')]['includeAll']){_0x2cd088[_0xeb84('0x43')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xeb84('0x44')](_0x2cd088);})[_0xeb84('0x28')](function(_0x5095f3){_0x414be4['rows']=_0x5095f3;return _0x414be4;})[_0xeb84('0x28')](respondWithFilteredResult(_0x87142a,_0x2cd088))[_0xeb84('0x45')](handleError(_0x87142a,null));};exports[_0xeb84('0x46')]=function(_0x4e4df3,_0x4eb810){var _0x20edc6={'raw':![],'where':{'id':_0x4e4df3['params']['id']}},_0x354d83={};_0x354d83[_0xeb84('0x33')]=_['keys'](db[_0xeb84('0x2e')][_0xeb84('0x2f')]);_0x354d83['query']=_[_0xeb84('0x36')](_0x4e4df3[_0xeb84('0x35')]);_0x354d83[_0xeb84('0x3e')]=_[_0xeb84('0x37')](_0x354d83[_0xeb84('0x33')],_0x354d83[_0xeb84('0x35')]);_0x20edc6['attributes']=_[_0xeb84('0x37')](_0x354d83[_0xeb84('0x33')],qs['fields'](_0x4e4df3[_0xeb84('0x35')]['fields']));_0x20edc6['attributes']=_0x20edc6[_0xeb84('0x38')][_0xeb84('0x3a')]?_0x20edc6[_0xeb84('0x38')]:_0x354d83[_0xeb84('0x33')];if(_0x4e4df3['query'][_0xeb84('0x47')]){_0x20edc6[_0xeb84('0x43')]=[{'all':!![]}];}_0x20edc6=_[_0xeb84('0x48')]({},_0x20edc6,_0x4e4df3[_0xeb84('0x42')]);return db[_0xeb84('0x2e')]['find'](_0x20edc6)[_0xeb84('0x28')](handleEntityNotFound(_0x4eb810,null))['then'](respondWithResult(_0x4eb810,null))['catch'](handleError(_0x4eb810,null));};exports['create']=function(_0x24cc99,_0x1087da){return db[_0xeb84('0x2e')]['create'](_0x24cc99[_0xeb84('0x49')],{})[_0xeb84('0x28')](respondWithResult(_0x1087da,0xc9))[_0xeb84('0x45')](handleError(_0x1087da,null));};exports[_0xeb84('0x27')]=function(_0x130047,_0x5b9374){if(_0x130047['body']['id']){delete _0x130047['body']['id'];}return db['FreshdeskAccount'][_0xeb84('0x4a')]({'where':{'id':_0x130047[_0xeb84('0x4b')]['id']}})[_0xeb84('0x28')](handleEntityNotFound(_0x5b9374,null))['then'](saveUpdates(_0x130047[_0xeb84('0x49')],null))[_0xeb84('0x28')](respondWithResult(_0x5b9374,null))['catch'](handleError(_0x5b9374,null));};exports['destroy']=function(_0x2837f5,_0xb77b41){return db['FreshdeskAccount']['find']({'where':{'id':_0x2837f5[_0xeb84('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb77b41,null))[_0xeb84('0x28')](removeEntity(_0xb77b41,null))['catch'](handleError(_0xb77b41,null));};exports['getConfigurations']=function(_0x880f19,_0x541829,_0x1529dc){var _0x3aa4b8={};var _0x2ad97c={};var _0x591a7e;var _0x2c0673;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x880f19[_0xeb84('0x4b')]['id']}})[_0xeb84('0x28')](handleEntityNotFound(_0x541829,null))['then'](function(_0x53c259){if(_0x53c259){_0x591a7e=_0x53c259;_0x2ad97c['model']=_['keys'](db[_0xeb84('0x4c')][_0xeb84('0x2f')]);_0x2ad97c[_0xeb84('0x35')]=_[_0xeb84('0x36')](_0x880f19['query']);_0x2ad97c[_0xeb84('0x3e')]=_[_0xeb84('0x37')](_0x2ad97c['model'],_0x2ad97c[_0xeb84('0x35')]);_0x3aa4b8[_0xeb84('0x38')]=_[_0xeb84('0x37')](_0x2ad97c[_0xeb84('0x33')],qs['fields'](_0x880f19[_0xeb84('0x35')]['fields']));_0x3aa4b8[_0xeb84('0x38')]=_0x3aa4b8[_0xeb84('0x38')][_0xeb84('0x3a')]?_0x3aa4b8['attributes']:_0x2ad97c[_0xeb84('0x33')];_0x3aa4b8[_0xeb84('0x3c')]=qs[_0xeb84('0x4d')](_0x880f19[_0xeb84('0x35')][_0xeb84('0x4d')]);_0x3aa4b8[_0xeb84('0x3d')]=qs[_0xeb84('0x3e')](_[_0xeb84('0x3f')](_0x880f19[_0xeb84('0x35')],_0x2ad97c[_0xeb84('0x3e')]));if(_0x880f19['query']['filter']){_0x3aa4b8[_0xeb84('0x3d')]=_[_0xeb84('0x48')](_0x3aa4b8[_0xeb84('0x3d')],{'$or':_[_0xeb84('0x34')](_0x3aa4b8[_0xeb84('0x38')],function(_0xc1f63a){var _0x79551f={};_0x79551f[_0xc1f63a]={'$like':'%'+_0x880f19[_0xeb84('0x35')]['filter']+'%'};return _0x79551f;})});}_0x3aa4b8=_['merge']({},_0x3aa4b8,_0x880f19[_0xeb84('0x42')]);return _0x591a7e[_0xeb84('0x4e')](_0x3aa4b8);}})[_0xeb84('0x28')](function(_0x3505f2){if(_0x3505f2){_0x2c0673=_0x3505f2[_0xeb84('0x3a')];if(!_0x880f19['query'][_0xeb84('0x3b')](_0xeb84('0x4f'))){_0x3aa4b8[_0xeb84('0x20')]=qs['limit'](_0x880f19[_0xeb84('0x35')]['limit']);_0x3aa4b8['offset']=qs[_0xeb84('0x1e')](_0x880f19['query'][_0xeb84('0x1e')]);}return _0x591a7e['getConfigurations'](_0x3aa4b8);}})['then'](function(_0x4fe2e8){if(_0x4fe2e8){return _0x4fe2e8?{'count':_0x2c0673,'rows':_0x4fe2e8}:null;}})['then'](respondWithResult(_0x541829,null))[_0xeb84('0x45')](handleError(_0x541829,null));};exports[_0xeb84('0x50')]=function(_0x10214d,_0x495813,_0x312bd8){if(_0x10214d[_0xeb84('0x49')]['id']){delete _0x10214d[_0xeb84('0x49')]['id'];}return db[_0xeb84('0x2e')][_0xeb84('0x51')]({'where':{'id':_0x10214d['params']['id']}})[_0xeb84('0x28')](handleEntityNotFound(_0x495813,null))[_0xeb84('0x28')](function(_0x1f232c){if(_0x1f232c){_0x10214d[_0xeb84('0x49')][_0xeb84('0x52')]=_0x1f232c['id'];_0x10214d[_0xeb84('0x49')][_0xeb84('0x53')]=integrations['getSubjects'](_0x10214d[_0xeb84('0x49')][_0xeb84('0x54')],_0x10214d['body'][_0xeb84('0x31')]);_0x10214d[_0xeb84('0x49')][_0xeb84('0x55')]=integrations[_0xeb84('0x56')](_0x10214d[_0xeb84('0x49')]['channel'],_0x10214d[_0xeb84('0x49')]['type']);return db['FreshdeskConfiguration'][_0xeb84('0x57')](_0x10214d[_0xeb84('0x49')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0xeb84('0x55')}]});}return null;})[_0xeb84('0x28')](respondWithResult(_0x495813,null))[_0xeb84('0x45')](handleError(_0x495813,null));};exports[_0xeb84('0x58')]=function(_0x3d3ead,_0x327c99,_0x371465){var _0x25daf1='';return db[_0xeb84('0x2e')][_0xeb84('0x51')]({'where':{'id':_0x3d3ead[_0xeb84('0x4b')]['id']},'attributes':['id',_0xeb84('0x59'),_0xeb84('0x5a')]})['then'](handleEntityNotFound(_0x327c99,null))['then'](function(_0x287900){if(_0x287900){_0x25daf1=_0x287900['remoteUri'];var _0x2d841a=_0x25daf1[_0xeb84('0x5b')](-0x1);if(_0x2d841a==='/'){_0x25daf1=_0x25daf1['substring'](0x0,_0x25daf1[_0xeb84('0x5c')](_0x2d841a));}return rp({'method':'GET','uri':util[_0xeb84('0x5d')](_0xeb84('0x5e'),_0x25daf1,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xeb84('0x5d')](_0xeb84('0x5f'),new Buffer(util['format'](_0xeb84('0x60'),_0x287900['apiKey']))[_0xeb84('0x61')](_0xeb84('0x62')))},'json':!![]});}})[_0xeb84('0x28')](function(_0x356ea3){if(_0x356ea3){var _0x1e9921=[_0xeb84('0x63'),_0xeb84('0x64'),_0xeb84('0x65'),_0xeb84('0x66'),_0xeb84('0x1b'),_0xeb84('0x67'),_0xeb84('0x68'),_0xeb84('0x69'),_0xeb84('0x6a'),'group','company'];_[_0xeb84('0x6b')](_0x356ea3,function(_0x38d0f2){return _0x1e9921[_0xeb84('0x6c')](_0x38d0f2[_0xeb84('0x2b')])||!_0x38d0f2['default']&&_0x38d0f2[_0xeb84('0x31')]!==_0xeb84('0x6d')&&_0x38d0f2[_0xeb84('0x31')]!=='custom_dropdown';});return{'count':_0x356ea3[_0xeb84('0x3a')],'rows':_[_0xeb84('0x34')](_0x356ea3,function(_0xb5b6d3){return{'id':_0xb5b6d3[_0xeb84('0x2b')],'name':_0xb5b6d3['label'],'custom':!_0xb5b6d3[_0xeb84('0x6e')],'options':_0xb5b6d3[_0xeb84('0x6f')]?_[_0xeb84('0x34')](_0xb5b6d3[_0xeb84('0x6f')],function(_0x1ab28d){return{'name':_[_0xeb84('0x70')](_0x1ab28d),'value':_0x1ab28d};}):[]};})};}})[_0xeb84('0x28')](respondWithResult(_0x327c99,null))[_0xeb84('0x45')](function(_0x1effa8){var _0x145fdd=_0x3d3ead[_0xeb84('0x35')][_0xeb84('0x71')]?0x1f4:_0x1effa8[_0xeb84('0x72')]||0x1f4;logger['error'](_0xeb84('0x73'),_0xeb84('0x58'),_0x145fdd,JSON[_0xeb84('0x74')](_0x1effa8));delete _0x1effa8['name'];if(_0x145fdd===0x191){_0x145fdd=0x190;}_0x327c99['status'](_0x145fdd)[_0xeb84('0x2c')](_0x3d3ead['query'][_0xeb84('0x71')]?{'message':_0xeb84('0x75'),'statusCode':_0x1effa8['statusCode']}:_0x1effa8);});}; \ No newline at end of file +var _0xfa7c=['custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','update','then','destroy','error','name','send','FreshdeskAccount','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','include','rows','show','params','rawAttributes','includeAll','find','create','body','catch','getConfigurations','findOne','FreshdeskConfiguration','pick','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','GET','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','default'];(function(_0x4f2446,_0x4964f1){var _0x96419e=function(_0x1f2964){while(--_0x1f2964){_0x4f2446['push'](_0x4f2446['shift']());}};_0x96419e(++_0x4964f1);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x2fd759,_0x5f2949){_0x2fd759=_0x2fd759-0x0;var _0x3840ae=_0xfa7c[_0x2fd759];return _0x3840ae;};'use strict';var emlformat=require(_0xcfa7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfa7('0x1'));var jsonpatch=require(_0xcfa7('0x2'));var rp=require(_0xcfa7('0x3'));var moment=require(_0xcfa7('0x4'));var BPromise=require(_0xcfa7('0x5'));var Mustache=require(_0xcfa7('0x6'));var util=require(_0xcfa7('0x7'));var path=require(_0xcfa7('0x8'));var sox=require('sox');var csv=require(_0xcfa7('0x9'));var ejs=require(_0xcfa7('0xa'));var fs=require('fs');var fs_extra=require(_0xcfa7('0xb'));var _=require(_0xcfa7('0xc'));var squel=require('squel');var crypto=require(_0xcfa7('0xd'));var jsforce=require(_0xcfa7('0xe'));var deskjs=require(_0xcfa7('0xf'));var toCsv=require(_0xcfa7('0x9'));var querystring=require(_0xcfa7('0x10'));var Papa=require(_0xcfa7('0x11'));var Redis=require('ioredis');var authService=require(_0xcfa7('0x12'));var qs=require(_0xcfa7('0x13'));var as=require(_0xcfa7('0x14'));var hardwareService=require(_0xcfa7('0x15'));var logger=require(_0xcfa7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xcfa7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcfa7('0x18'))['db'];var integrations=require(_0xcfa7('0x19'));function respondWithStatusCode(_0x53d0fb,_0x299280){_0x299280=_0x299280||0xcc;return function(_0x248c9b){if(_0x248c9b){return _0x53d0fb[_0xcfa7('0x1a')](_0x299280);}return _0x53d0fb[_0xcfa7('0x1b')](_0x299280)[_0xcfa7('0x1c')]();};}function respondWithResult(_0x578718,_0x42500c){_0x42500c=_0x42500c||0xc8;return function(_0x54acf6){if(_0x54acf6){return _0x578718['status'](_0x42500c)[_0xcfa7('0x1d')](_0x54acf6);}};}function respondWithFilteredResult(_0x470a55,_0x29cef5){return function(_0x349679){if(_0x349679){var _0x23b1fb=typeof _0x29cef5['offset']===_0xcfa7('0x1e')&&typeof _0x29cef5[_0xcfa7('0x1f')]===_0xcfa7('0x1e');var _0x266eb9=_0x349679['count'];var _0x21f73c=_0x23b1fb?0x0:_0x29cef5[_0xcfa7('0x20')];var _0x558a21=_0x23b1fb?_0x349679['count']:_0x29cef5[_0xcfa7('0x20')]+_0x29cef5[_0xcfa7('0x1f')];var _0x1ce356;if(_0x558a21>=_0x266eb9){_0x558a21=_0x266eb9;_0x1ce356=0xc8;}else{_0x1ce356=0xce;}_0x470a55[_0xcfa7('0x1b')](_0x1ce356);return _0x470a55[_0xcfa7('0x21')](_0xcfa7('0x22'),_0x21f73c+'-'+_0x558a21+'/'+_0x266eb9)[_0xcfa7('0x1d')](_0x349679);}return null;};}function patchUpdates(_0x602f15){return function(_0x548ef7){try{jsonpatch[_0xcfa7('0x23')](_0x548ef7,_0x602f15,!![]);}catch(_0x4f8e72){return BPromise['reject'](_0x4f8e72);}return _0x548ef7['save']();};}function saveUpdates(_0xdf35fa,_0x49e624){return function(_0x2fba8b){if(_0x2fba8b){return _0x2fba8b[_0xcfa7('0x24')](_0xdf35fa)[_0xcfa7('0x25')](function(_0x3423ad){return _0x3423ad;});}return null;};}function removeEntity(_0xdd7c11,_0x2d00e1){return function(_0x1562c8){if(_0x1562c8){return _0x1562c8[_0xcfa7('0x26')]()['then'](function(){_0xdd7c11[_0xcfa7('0x1b')](0xcc)[_0xcfa7('0x1c')]();});}};}function handleEntityNotFound(_0x312efb,_0x1d5e9c){return function(_0x47f4ac){if(!_0x47f4ac){_0x312efb[_0xcfa7('0x1a')](0x194);}return _0x47f4ac;};}function handleError(_0xabfa5b,_0x3fece6){_0x3fece6=_0x3fece6||0x1f4;return function(_0x29f6d0){logger[_0xcfa7('0x27')](_0x29f6d0['stack']);if(_0x29f6d0[_0xcfa7('0x28')]){delete _0x29f6d0[_0xcfa7('0x28')];}_0xabfa5b[_0xcfa7('0x1b')](_0x3fece6)[_0xcfa7('0x29')](_0x29f6d0);};}exports['index']=function(_0x4c8bf0,_0x569f4e){var _0x10f85f={},_0xdcdae7={},_0x2fd1bd={'count':0x0,'rows':[]};var _0x5b17f5=_['map'](db[_0xcfa7('0x2a')]['rawAttributes'],function(_0x569016){return{'name':_0x569016[_0xcfa7('0x2b')],'type':_0x569016[_0xcfa7('0x2c')][_0xcfa7('0x2d')]};});_0xdcdae7[_0xcfa7('0x2e')]=_[_0xcfa7('0x2f')](_0x5b17f5,_0xcfa7('0x28'));_0xdcdae7[_0xcfa7('0x30')]=_[_0xcfa7('0x31')](_0x4c8bf0['query']);_0xdcdae7['filters']=_[_0xcfa7('0x32')](_0xdcdae7[_0xcfa7('0x2e')],_0xdcdae7[_0xcfa7('0x30')]);_0x10f85f['attributes']=_['intersection'](_0xdcdae7[_0xcfa7('0x2e')],qs[_0xcfa7('0x33')](_0x4c8bf0[_0xcfa7('0x30')]['fields']));_0x10f85f[_0xcfa7('0x34')]=_0x10f85f['attributes'][_0xcfa7('0x35')]?_0x10f85f['attributes']:_0xdcdae7[_0xcfa7('0x2e')];if(!_0x4c8bf0[_0xcfa7('0x30')][_0xcfa7('0x36')](_0xcfa7('0x37'))){_0x10f85f[_0xcfa7('0x1f')]=qs[_0xcfa7('0x1f')](_0x4c8bf0[_0xcfa7('0x30')]['limit']);_0x10f85f[_0xcfa7('0x20')]=qs[_0xcfa7('0x20')](_0x4c8bf0[_0xcfa7('0x30')][_0xcfa7('0x20')]);}_0x10f85f[_0xcfa7('0x38')]=qs[_0xcfa7('0x39')](_0x4c8bf0[_0xcfa7('0x30')][_0xcfa7('0x39')]);_0x10f85f[_0xcfa7('0x3a')]=qs[_0xcfa7('0x3b')](_['pick'](_0x4c8bf0['query'],_0xdcdae7[_0xcfa7('0x3b')]),_0x5b17f5);if(_0x4c8bf0['query'][_0xcfa7('0x3c')]){_0x10f85f[_0xcfa7('0x3a')]=_[_0xcfa7('0x3d')](_0x10f85f['where'],{'$or':_[_0xcfa7('0x2f')](_0x5b17f5,function(_0x43b619){if(_0x43b619['type']!==_0xcfa7('0x3e')){var _0x41b014={};_0x41b014[_0x43b619[_0xcfa7('0x28')]]={'$like':'%'+_0x4c8bf0['query'][_0xcfa7('0x3c')]+'%'};return _0x41b014;}})});}_0x10f85f=_[_0xcfa7('0x3d')]({},_0x10f85f,_0x4c8bf0[_0xcfa7('0x3f')]);var _0x1c8fc6={'where':_0x10f85f[_0xcfa7('0x3a')]};return db[_0xcfa7('0x2a')]['count'](_0x1c8fc6)[_0xcfa7('0x25')](function(_0x4ad534){_0x2fd1bd[_0xcfa7('0x40')]=_0x4ad534;if(_0x4c8bf0[_0xcfa7('0x30')]['includeAll']){_0x10f85f[_0xcfa7('0x41')]=[{'all':!![]}];}return db[_0xcfa7('0x2a')]['findAll'](_0x10f85f);})[_0xcfa7('0x25')](function(_0x5502d5){_0x2fd1bd[_0xcfa7('0x42')]=_0x5502d5;return _0x2fd1bd;})[_0xcfa7('0x25')](respondWithFilteredResult(_0x569f4e,_0x10f85f))['catch'](handleError(_0x569f4e,null));};exports[_0xcfa7('0x43')]=function(_0x3ff0e0,_0x441e86){var _0x98a340={'raw':![],'where':{'id':_0x3ff0e0[_0xcfa7('0x44')]['id']}},_0x194a96={};_0x194a96[_0xcfa7('0x2e')]=_[_0xcfa7('0x31')](db['FreshdeskAccount'][_0xcfa7('0x45')]);_0x194a96[_0xcfa7('0x30')]=_[_0xcfa7('0x31')](_0x3ff0e0[_0xcfa7('0x30')]);_0x194a96[_0xcfa7('0x3b')]=_['intersection'](_0x194a96[_0xcfa7('0x2e')],_0x194a96['query']);_0x98a340[_0xcfa7('0x34')]=_[_0xcfa7('0x32')](_0x194a96[_0xcfa7('0x2e')],qs['fields'](_0x3ff0e0[_0xcfa7('0x30')][_0xcfa7('0x33')]));_0x98a340[_0xcfa7('0x34')]=_0x98a340[_0xcfa7('0x34')][_0xcfa7('0x35')]?_0x98a340[_0xcfa7('0x34')]:_0x194a96['model'];if(_0x3ff0e0[_0xcfa7('0x30')][_0xcfa7('0x46')]){_0x98a340[_0xcfa7('0x41')]=[{'all':!![]}];}_0x98a340=_[_0xcfa7('0x3d')]({},_0x98a340,_0x3ff0e0[_0xcfa7('0x3f')]);return db[_0xcfa7('0x2a')][_0xcfa7('0x47')](_0x98a340)[_0xcfa7('0x25')](handleEntityNotFound(_0x441e86,null))[_0xcfa7('0x25')](respondWithResult(_0x441e86,null))['catch'](handleError(_0x441e86,null));};exports[_0xcfa7('0x48')]=function(_0x2e7800,_0x1c0bcb){return db[_0xcfa7('0x2a')][_0xcfa7('0x48')](_0x2e7800[_0xcfa7('0x49')],{})[_0xcfa7('0x25')](respondWithResult(_0x1c0bcb,0xc9))['catch'](handleError(_0x1c0bcb,null));};exports['update']=function(_0x33660d,_0x3b29ee){if(_0x33660d['body']['id']){delete _0x33660d[_0xcfa7('0x49')]['id'];}return db[_0xcfa7('0x2a')]['find']({'where':{'id':_0x33660d[_0xcfa7('0x44')]['id']}})[_0xcfa7('0x25')](handleEntityNotFound(_0x3b29ee,null))[_0xcfa7('0x25')](saveUpdates(_0x33660d['body'],null))[_0xcfa7('0x25')](respondWithResult(_0x3b29ee,null))[_0xcfa7('0x4a')](handleError(_0x3b29ee,null));};exports['destroy']=function(_0x2a471c,_0x16ea8b){return db[_0xcfa7('0x2a')][_0xcfa7('0x47')]({'where':{'id':_0x2a471c['params']['id']}})[_0xcfa7('0x25')](handleEntityNotFound(_0x16ea8b,null))[_0xcfa7('0x25')](removeEntity(_0x16ea8b,null))['catch'](handleError(_0x16ea8b,null));};exports[_0xcfa7('0x4b')]=function(_0x40dd2d,_0x510239,_0xd89b3e){var _0xd6d55a={};var _0xc2eaaf={};var _0x53a145;var _0x403f51;return db[_0xcfa7('0x2a')][_0xcfa7('0x4c')]({'where':{'id':_0x40dd2d[_0xcfa7('0x44')]['id']}})['then'](handleEntityNotFound(_0x510239,null))[_0xcfa7('0x25')](function(_0x56a3f1){if(_0x56a3f1){_0x53a145=_0x56a3f1;_0xc2eaaf[_0xcfa7('0x2e')]=_[_0xcfa7('0x31')](db[_0xcfa7('0x4d')][_0xcfa7('0x45')]);_0xc2eaaf[_0xcfa7('0x30')]=_[_0xcfa7('0x31')](_0x40dd2d[_0xcfa7('0x30')]);_0xc2eaaf[_0xcfa7('0x3b')]=_[_0xcfa7('0x32')](_0xc2eaaf[_0xcfa7('0x2e')],_0xc2eaaf['query']);_0xd6d55a['attributes']=_['intersection'](_0xc2eaaf[_0xcfa7('0x2e')],qs[_0xcfa7('0x33')](_0x40dd2d[_0xcfa7('0x30')][_0xcfa7('0x33')]));_0xd6d55a[_0xcfa7('0x34')]=_0xd6d55a[_0xcfa7('0x34')][_0xcfa7('0x35')]?_0xd6d55a['attributes']:_0xc2eaaf[_0xcfa7('0x2e')];_0xd6d55a[_0xcfa7('0x38')]=qs[_0xcfa7('0x39')](_0x40dd2d[_0xcfa7('0x30')]['sort']);_0xd6d55a['where']=qs[_0xcfa7('0x3b')](_[_0xcfa7('0x4e')](_0x40dd2d[_0xcfa7('0x30')],_0xc2eaaf[_0xcfa7('0x3b')]));if(_0x40dd2d['query'][_0xcfa7('0x3c')]){_0xd6d55a[_0xcfa7('0x3a')]=_[_0xcfa7('0x3d')](_0xd6d55a[_0xcfa7('0x3a')],{'$or':_[_0xcfa7('0x2f')](_0xd6d55a['attributes'],function(_0x27c5d8){var _0x28f1a5={};_0x28f1a5[_0x27c5d8]={'$like':'%'+_0x40dd2d['query'][_0xcfa7('0x3c')]+'%'};return _0x28f1a5;})});}_0xd6d55a=_[_0xcfa7('0x3d')]({},_0xd6d55a,_0x40dd2d[_0xcfa7('0x3f')]);return _0x53a145['getConfigurations'](_0xd6d55a);}})[_0xcfa7('0x25')](function(_0x5d137e){if(_0x5d137e){_0x403f51=_0x5d137e['length'];if(!_0x40dd2d['query'][_0xcfa7('0x36')]('nolimit')){_0xd6d55a[_0xcfa7('0x1f')]=qs[_0xcfa7('0x1f')](_0x40dd2d['query']['limit']);_0xd6d55a[_0xcfa7('0x20')]=qs[_0xcfa7('0x20')](_0x40dd2d[_0xcfa7('0x30')]['offset']);}return _0x53a145[_0xcfa7('0x4b')](_0xd6d55a);}})[_0xcfa7('0x25')](function(_0x18ecb3){if(_0x18ecb3){return _0x18ecb3?{'count':_0x403f51,'rows':_0x18ecb3}:null;}})[_0xcfa7('0x25')](respondWithResult(_0x510239,null))[_0xcfa7('0x4a')](handleError(_0x510239,null));};exports[_0xcfa7('0x4f')]=function(_0x350055,_0x586f62,_0x53d1ff){if(_0x350055[_0xcfa7('0x49')]['id']){delete _0x350055[_0xcfa7('0x49')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x350055[_0xcfa7('0x44')]['id']}})['then'](handleEntityNotFound(_0x586f62,null))[_0xcfa7('0x25')](function(_0x365d67){if(_0x365d67){_0x350055[_0xcfa7('0x49')]['AccountId']=_0x365d67['id'];_0x350055[_0xcfa7('0x49')]['Subjects']=integrations[_0xcfa7('0x50')](_0x350055['body'][_0xcfa7('0x51')],_0x350055[_0xcfa7('0x49')][_0xcfa7('0x2c')]);_0x350055[_0xcfa7('0x49')][_0xcfa7('0x52')]=integrations[_0xcfa7('0x53')](_0x350055[_0xcfa7('0x49')][_0xcfa7('0x51')],_0x350055[_0xcfa7('0x49')][_0xcfa7('0x2c')]);return db[_0xcfa7('0x4d')][_0xcfa7('0x48')](_0x350055[_0xcfa7('0x49')],{'include':[{'model':db[_0xcfa7('0x54')],'as':'Subjects'},{'model':db[_0xcfa7('0x54')],'as':'Descriptions'}]});}return null;})[_0xcfa7('0x25')](respondWithResult(_0x586f62,null))[_0xcfa7('0x4a')](handleError(_0x586f62,null));};exports['getFields']=function(_0x1bc7a5,_0x300150,_0x68a65d){var _0x2b286f='';return db['FreshdeskAccount'][_0xcfa7('0x4c')]({'where':{'id':_0x1bc7a5[_0xcfa7('0x44')]['id']},'attributes':['id',_0xcfa7('0x55'),_0xcfa7('0x56')]})[_0xcfa7('0x25')](handleEntityNotFound(_0x300150,null))['then'](function(_0x94edeb){if(_0x94edeb){_0x2b286f=_0x94edeb[_0xcfa7('0x55')];var _0x4a0f88=_0x2b286f[_0xcfa7('0x57')](-0x1);if(_0x4a0f88==='/'){_0x2b286f=_0x2b286f[_0xcfa7('0x58')](0x0,_0x2b286f['lastIndexOf'](_0x4a0f88));}return rp({'method':_0xcfa7('0x59'),'uri':util['format']('%s/%s',_0x2b286f,_0xcfa7('0x5a')),'headers':{'Authorization':util[_0xcfa7('0x5b')](_0xcfa7('0x5c'),new Buffer(util[_0xcfa7('0x5b')](_0xcfa7('0x5d'),_0x94edeb[_0xcfa7('0x56')]))[_0xcfa7('0x5e')](_0xcfa7('0x5f')))},'json':!![]});}})['then'](function(_0x498e94){if(_0x498e94){var _0x2306b0=[_0xcfa7('0x60'),_0xcfa7('0x61'),_0xcfa7('0x62'),'description',_0xcfa7('0x1b'),_0xcfa7('0x63'),_0xcfa7('0x64'),_0xcfa7('0x65'),_0xcfa7('0x66'),_0xcfa7('0x64'),_0xcfa7('0x67')];_['remove'](_0x498e94,function(_0x4cc3f8){return _0x2306b0['includes'](_0x4cc3f8[_0xcfa7('0x28')])||!_0x4cc3f8[_0xcfa7('0x68')]&&_0x4cc3f8[_0xcfa7('0x2c')]!=='custom_text'&&_0x4cc3f8[_0xcfa7('0x2c')]!==_0xcfa7('0x69');});return{'count':_0x498e94[_0xcfa7('0x35')],'rows':_[_0xcfa7('0x2f')](_0x498e94,function(_0x4c468e){return{'id':_0x4c468e[_0xcfa7('0x28')],'name':_0x4c468e['label'],'custom':!_0x4c468e[_0xcfa7('0x68')],'options':_0x4c468e[_0xcfa7('0x6a')]?_[_0xcfa7('0x2f')](_0x4c468e[_0xcfa7('0x6a')],function(_0x253036){return{'name':_[_0xcfa7('0x6b')](_0x253036),'value':_0x253036};}):[]};})};}})[_0xcfa7('0x25')](respondWithResult(_0x300150,null))[_0xcfa7('0x4a')](function(_0x324deb){var _0x24fb12=_0x1bc7a5[_0xcfa7('0x30')][_0xcfa7('0x6c')]?0x1f4:_0x324deb[_0xcfa7('0x6d')]||0x1f4;logger[_0xcfa7('0x27')](_0xcfa7('0x6e'),'getFields',_0x24fb12,JSON[_0xcfa7('0x6f')](_0x324deb));delete _0x324deb[_0xcfa7('0x28')];if(_0x24fb12===0x191){_0x24fb12=0x190;}_0x300150[_0xcfa7('0x1b')](_0x24fb12)[_0xcfa7('0x29')](_0x1bc7a5[_0xcfa7('0x30')][_0xcfa7('0x6c')]?{'message':_0xcfa7('0x70'),'statusCode':_0x324deb[_0xcfa7('0x6d')]}:_0x324deb);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6dfa979..a78b551 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 _0x9132=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','int_freshdesk_accounts','util','../../config/logger','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9132,0x1a4));var _0x2913=function(_0x4e0355,_0x2e7a05){_0x4e0355=_0x4e0355-0x0;var _0x11f45f=_0x9132[_0x4e0355];return _0x11f45f;};'use strict';var _=require('lodash');var util=require(_0x2913('0x0'));var logger=require(_0x2913('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2913('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2913('0x3'));var config=require('../../config/environment');var attributes=require(_0x2913('0x4'));var integrations=require(_0x2913('0x5'));module['exports']=function(_0x516beb,_0x40ba1f){return _0x516beb[_0x2913('0x6')]('FreshdeskAccount',attributes,{'tableName':_0x2913('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c48=['define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4f6b44,_0x1589ef){var _0x32e019=function(_0x35f167){while(--_0x35f167){_0x4f6b44['push'](_0x4f6b44['shift']());}};_0x32e019(++_0x1589ef);}(_0x2c48,0x105));var _0x82c4=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x2c48[_0x58d5ac];return _0x37985c;};'use strict';var _=require('lodash');var util=require(_0x82c4('0x0'));var logger=require(_0x82c4('0x1'))(_0x82c4('0x2'));var moment=require(_0x82c4('0x3'));var BPromise=require(_0x82c4('0x4'));var rp=require(_0x82c4('0x5'));var fs=require('fs');var path=require(_0x82c4('0x6'));var rimraf=require(_0x82c4('0x7'));var config=require(_0x82c4('0x8'));var attributes=require(_0x82c4('0x9'));var integrations=require(_0x82c4('0xa'));module[_0x82c4('0xb')]=function(_0x457420,_0x526521){return _0x457420[_0x82c4('0xc')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index ae0cf50..d594d5a 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 _0x0460=['ShowFreshdeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','include','map','model','attributes','stringify','where'];(function(_0x2d09b0,_0x313dfc){var _0x121204=function(_0x21d3a6){while(--_0x21d3a6){_0x2d09b0['push'](_0x2d09b0['shift']());}};_0x121204(++_0x313dfc);}(_0x0460,0xab));var _0x0046=function(_0x283dc1,_0x19adee){_0x283dc1=_0x283dc1-0x0;var _0x49d8a4=_0x0460[_0x283dc1];return _0x49d8a4;};'use strict';var _=require(_0x0046('0x0'));var util=require(_0x0046('0x1'));var moment=require(_0x0046('0x2'));var BPromise=require('bluebird');var rs=require(_0x0046('0x3'));var fs=require('fs');var Redis=require(_0x0046('0x4'));var db=require(_0x0046('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0046('0x6'))('rpc');var config=require(_0x0046('0x7'));var jayson=require(_0x0046('0x8'));var client=jayson[_0x0046('0x9')][_0x0046('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x225be1,_0x421339,_0x21d97e){return new BPromise(function(_0x369814,_0x4e6d48){return client[_0x0046('0xb')](_0x225be1,_0x21d97e)[_0x0046('0xc')](function(_0x3b61bc){logger[_0x0046('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x421339,_0x0046('0xe'));logger[_0x0046('0xf')](_0x0046('0x10'),_0x421339,_0x0046('0xe'),JSON['stringify'](_0x3b61bc));if(_0x3b61bc[_0x0046('0x11')]){if(_0x3b61bc[_0x0046('0x11')][_0x0046('0x12')]===0x1f4){logger[_0x0046('0x11')](_0x0046('0x13'),_0x421339,_0x3b61bc[_0x0046('0x11')][_0x0046('0x14')]);return _0x4e6d48(_0x3b61bc[_0x0046('0x11')][_0x0046('0x14')]);}logger[_0x0046('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x421339,_0x3b61bc[_0x0046('0x11')][_0x0046('0x14')]);return _0x369814(_0x3b61bc[_0x0046('0x11')]['message']);}else{logger[_0x0046('0xd')](_0x0046('0x13'),_0x421339,'request\x20sent');_0x369814(_0x3b61bc['result'][_0x0046('0x14')]);}})[_0x0046('0x15')](function(_0x313301){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x421339,_0x313301);_0x4e6d48(_0x313301);});});}exports[_0x0046('0x16')]=function(_0x525c22){var _0x51519d=this;return new Promise(function(_0x44fe00,_0x21526f){return db[_0x0046('0x17')][_0x0046('0x18')]({'raw':_0x525c22['options']?_0x525c22[_0x0046('0x19')][_0x0046('0x1a')]===undefined?!![]:![]:!![],'where':_0x525c22[_0x0046('0x19')]?_0x525c22['options']['where']||null:null,'attributes':_0x525c22[_0x0046('0x19')]?_0x525c22[_0x0046('0x19')]['attributes']||null:null,'limit':_0x525c22[_0x0046('0x19')]?_0x525c22[_0x0046('0x19')]['limit']||null:null,'include':_0x525c22[_0x0046('0x19')]?_0x525c22[_0x0046('0x19')][_0x0046('0x1b')]?_[_0x0046('0x1c')](_0x525c22['options'][_0x0046('0x1b')],function(_0x3be7c6){return{'model':db[_0x3be7c6[_0x0046('0x1d')]],'as':_0x3be7c6['as'],'attributes':_0x3be7c6[_0x0046('0x1e')],'include':_0x3be7c6['include']?_['map'](_0x3be7c6[_0x0046('0x1b')],function(_0x29b045){return{'model':db[_0x29b045['model']],'as':_0x29b045['as'],'attributes':_0x29b045['attributes'],'include':_0x29b045['include']?_[_0x0046('0x1c')](_0x29b045[_0x0046('0x1b')],function(_0x445549){return{'model':db[_0x445549[_0x0046('0x1d')]],'as':_0x445549['as'],'attributes':_0x445549[_0x0046('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0046('0xc')](function(_0x1a3022){logger['info'](_0x0046('0x16'),_0x525c22);logger['debug']('GetFreshdeskAccount',_0x525c22,JSON[_0x0046('0x1f')](_0x1a3022));_0x44fe00(_0x1a3022);})[_0x0046('0x15')](function(_0x2c5a8b){logger[_0x0046('0x11')](_0x0046('0x16'),_0x2c5a8b[_0x0046('0x14')],_0x525c22);_0x21526f(_0x51519d[_0x0046('0x11')](0x1f4,_0x2c5a8b[_0x0046('0x14')]));});});};exports['ShowFreshdeskAccount']=function(_0x866d14){var _0x6f97da=this;return new Promise(function(_0x4e49f3,_0x27c68a){return db['FreshdeskAccount']['find']({'raw':_0x866d14[_0x0046('0x19')]?_0x866d14[_0x0046('0x19')][_0x0046('0x1a')]===undefined?!![]:![]:!![],'where':_0x866d14[_0x0046('0x19')]?_0x866d14[_0x0046('0x19')][_0x0046('0x20')]||null:null,'attributes':_0x866d14[_0x0046('0x19')]?_0x866d14[_0x0046('0x19')][_0x0046('0x1e')]||null:null,'include':_0x866d14[_0x0046('0x19')]?_0x866d14[_0x0046('0x19')][_0x0046('0x1b')]?_[_0x0046('0x1c')](_0x866d14[_0x0046('0x19')][_0x0046('0x1b')],function(_0x3e9a08){return{'model':db[_0x3e9a08[_0x0046('0x1d')]],'as':_0x3e9a08['as'],'attributes':_0x3e9a08[_0x0046('0x1e')],'include':_0x3e9a08[_0x0046('0x1b')]?_[_0x0046('0x1c')](_0x3e9a08[_0x0046('0x1b')],function(_0x52aa36){return{'model':db[_0x52aa36[_0x0046('0x1d')]],'as':_0x52aa36['as'],'attributes':_0x52aa36[_0x0046('0x1e')],'include':_0x52aa36[_0x0046('0x1b')]?_[_0x0046('0x1c')](_0x52aa36[_0x0046('0x1b')],function(_0x2bb561){return{'model':db[_0x2bb561[_0x0046('0x1d')]],'as':_0x2bb561['as'],'attributes':_0x2bb561[_0x0046('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0046('0xc')](function(_0x4e32ad){logger[_0x0046('0xd')](_0x0046('0x21'),_0x866d14);logger[_0x0046('0xf')](_0x0046('0x21'),_0x866d14,JSON['stringify'](_0x4e32ad));_0x4e49f3(_0x4e32ad);})[_0x0046('0x15')](function(_0x3db27c){logger[_0x0046('0x11')]('ShowFreshdeskAccount',_0x3db27c[_0x0046('0x14')],_0x866d14);_0x27c68a(_0x6f97da[_0x0046('0x11')](0x1f4,_0x3db27c[_0x0046('0x14')]));});});}; \ No newline at end of file +var _0x5990=['request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e6b22,_0x344fb3){var _0x3e58c2=function(_0x3e057d){while(--_0x3e057d){_0x1e6b22['push'](_0x1e6b22['shift']());}};_0x3e58c2(++_0x344fb3);}(_0x5990,0x123));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0599('0x0'));var util=require(_0x0599('0x1'));var moment=require(_0x0599('0x2'));var BPromise=require(_0x0599('0x3'));var rs=require(_0x0599('0x4'));var fs=require('fs');var Redis=require(_0x0599('0x5'));var db=require(_0x0599('0x6'))['db'];var utils=require(_0x0599('0x7'));var logger=require('../../config/logger')(_0x0599('0x8'));var config=require(_0x0599('0x9'));var jayson=require(_0x0599('0xa'));var client=jayson[_0x0599('0xb')][_0x0599('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x441fad,_0x380e50,_0x2da08c){return new BPromise(function(_0x4927d7,_0x4cd24c){return client[_0x0599('0xd')](_0x441fad,_0x2da08c)[_0x0599('0xe')](function(_0x24858){logger['info'](_0x0599('0xf'),_0x380e50,_0x0599('0x10'));logger[_0x0599('0x11')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x380e50,_0x0599('0x10'),JSON['stringify'](_0x24858));if(_0x24858['error']){if(_0x24858[_0x0599('0x12')][_0x0599('0x13')]===0x1f4){logger[_0x0599('0x12')](_0x0599('0xf'),_0x380e50,_0x24858[_0x0599('0x12')]['message']);return _0x4cd24c(_0x24858[_0x0599('0x12')][_0x0599('0x14')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x380e50,_0x24858[_0x0599('0x12')][_0x0599('0x14')]);return _0x4927d7(_0x24858[_0x0599('0x12')][_0x0599('0x14')]);}else{logger[_0x0599('0x15')](_0x0599('0xf'),_0x380e50,_0x0599('0x10'));_0x4927d7(_0x24858[_0x0599('0x16')]['message']);}})[_0x0599('0x17')](function(_0x277d5d){logger[_0x0599('0x12')](_0x0599('0xf'),_0x380e50,_0x277d5d);_0x4cd24c(_0x277d5d);});});}exports[_0x0599('0x18')]=function(_0x24c034){var _0x51a55e=this;return new Promise(function(_0x19ea2a,_0x2f9c54){return db[_0x0599('0x19')][_0x0599('0x1a')]({'raw':_0x24c034[_0x0599('0x1b')]?_0x24c034['options'][_0x0599('0x1c')]===undefined?!![]:![]:!![],'where':_0x24c034['options']?_0x24c034[_0x0599('0x1b')][_0x0599('0x1d')]||null:null,'attributes':_0x24c034['options']?_0x24c034[_0x0599('0x1b')][_0x0599('0x1e')]||null:null,'limit':_0x24c034['options']?_0x24c034[_0x0599('0x1b')][_0x0599('0x1f')]||null:null,'include':_0x24c034['options']?_0x24c034[_0x0599('0x1b')][_0x0599('0x20')]?_[_0x0599('0x21')](_0x24c034[_0x0599('0x1b')][_0x0599('0x20')],function(_0x27e5cd){return{'model':db[_0x27e5cd['model']],'as':_0x27e5cd['as'],'attributes':_0x27e5cd[_0x0599('0x1e')],'include':_0x27e5cd['include']?_[_0x0599('0x21')](_0x27e5cd[_0x0599('0x20')],function(_0x3eb64){return{'model':db[_0x3eb64[_0x0599('0x22')]],'as':_0x3eb64['as'],'attributes':_0x3eb64[_0x0599('0x1e')],'include':_0x3eb64['include']?_[_0x0599('0x21')](_0x3eb64[_0x0599('0x20')],function(_0x1f5fcd){return{'model':db[_0x1f5fcd[_0x0599('0x22')]],'as':_0x1f5fcd['as'],'attributes':_0x1f5fcd[_0x0599('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0599('0xe')](function(_0xa3bd58){logger['info'](_0x0599('0x18'),_0x24c034);logger[_0x0599('0x11')](_0x0599('0x18'),_0x24c034,JSON[_0x0599('0x23')](_0xa3bd58));_0x19ea2a(_0xa3bd58);})[_0x0599('0x17')](function(_0x478a5d){logger[_0x0599('0x12')]('GetFreshdeskAccount',_0x478a5d[_0x0599('0x14')],_0x24c034);_0x2f9c54(_0x51a55e[_0x0599('0x12')](0x1f4,_0x478a5d[_0x0599('0x14')]));});});};exports[_0x0599('0x24')]=function(_0x3fc75c){var _0x194123=this;return new Promise(function(_0x2b93ee,_0x52c864){return db[_0x0599('0x19')][_0x0599('0x25')]({'raw':_0x3fc75c['options']?_0x3fc75c[_0x0599('0x1b')][_0x0599('0x1c')]===undefined?!![]:![]:!![],'where':_0x3fc75c[_0x0599('0x1b')]?_0x3fc75c[_0x0599('0x1b')][_0x0599('0x1d')]||null:null,'attributes':_0x3fc75c['options']?_0x3fc75c[_0x0599('0x1b')][_0x0599('0x1e')]||null:null,'include':_0x3fc75c['options']?_0x3fc75c[_0x0599('0x1b')][_0x0599('0x20')]?_['map'](_0x3fc75c[_0x0599('0x1b')][_0x0599('0x20')],function(_0x4dbdea){return{'model':db[_0x4dbdea[_0x0599('0x22')]],'as':_0x4dbdea['as'],'attributes':_0x4dbdea[_0x0599('0x1e')],'include':_0x4dbdea[_0x0599('0x20')]?_[_0x0599('0x21')](_0x4dbdea[_0x0599('0x20')],function(_0x51aae8){return{'model':db[_0x51aae8[_0x0599('0x22')]],'as':_0x51aae8['as'],'attributes':_0x51aae8[_0x0599('0x1e')],'include':_0x51aae8[_0x0599('0x20')]?_['map'](_0x51aae8[_0x0599('0x20')],function(_0x4fe5d9){return{'model':db[_0x4fe5d9[_0x0599('0x22')]],'as':_0x4fe5d9['as'],'attributes':_0x4fe5d9[_0x0599('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35dc20){logger['info']('ShowFreshdeskAccount',_0x3fc75c);logger['debug']('ShowFreshdeskAccount',_0x3fc75c,JSON[_0x0599('0x23')](_0x35dc20));_0x2b93ee(_0x35dc20);})['catch'](function(_0x4d90a8){logger['error'](_0x0599('0x24'),_0x4d90a8['message'],_0x3fc75c);_0x52c864(_0x194123[_0x0599('0x12')](0x1f4,_0x4d90a8['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 78bf49a..b948404 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 _0x1252=['post','setTags','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x981a2b,_0x509bf7){var _0x3fd5c7=function(_0x43fc2d){while(--_0x43fc2d){_0x981a2b['push'](_0x981a2b['shift']());}};_0x3fd5c7(++_0x509bf7);}(_0x1252,0x1b7));var _0x2125=function(_0x330792,_0x26b33a){_0x330792=_0x330792-0x0;var _0x90c562=_0x1252[_0x330792];return _0x90c562;};'use strict';var multer=require(_0x2125('0x0'));var util=require(_0x2125('0x1'));var path=require('path');var timeout=require(_0x2125('0x2'));var express=require(_0x2125('0x3'));var router=express[_0x2125('0x4')]();var fs_extra=require(_0x2125('0x5'));var auth=require(_0x2125('0x6'));var interaction=require(_0x2125('0x7'));var config=require(_0x2125('0x8'));var controller=require(_0x2125('0x9'));router[_0x2125('0xa')]('/',auth['isAuthenticated'](),controller[_0x2125('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2125('0xc')]);router['get'](_0x2125('0xd'),auth[_0x2125('0xe')](),controller[_0x2125('0xf')]);router['get'](_0x2125('0x10'),auth[_0x2125('0xe')](),controller[_0x2125('0x11')]);router['get'](_0x2125('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x2125('0xa')](_0x2125('0x13'),auth[_0x2125('0xe')](),controller['getTags']);router[_0x2125('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2125('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x2125('0x15')]);router[_0x2125('0x16')](_0x2125('0x17'),auth[_0x2125('0xe')](),controller['update']);router[_0x2125('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x2125('0x19')]);module[_0x2125('0x1a')]=router; \ No newline at end of file +var _0x6545=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated'];(function(_0x40bc7e,_0x2e4594){var _0x2f3ffa=function(_0x33940f){while(--_0x33940f){_0x40bc7e['push'](_0x40bc7e['shift']());}};_0x2f3ffa(++_0x2e4594);}(_0x6545,0x1ea));var _0x5654=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6545[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x5654('0x0'));var path=require('path');var timeout=require(_0x5654('0x1'));var express=require('express');var router=express[_0x5654('0x2')]();var fs_extra=require(_0x5654('0x3'));var auth=require(_0x5654('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5654('0x5'));router[_0x5654('0x6')]('/',auth['isAuthenticated'](),controller[_0x5654('0x7')]);router[_0x5654('0x6')](_0x5654('0x8'),auth[_0x5654('0x9')](),controller[_0x5654('0xa')]);router[_0x5654('0x6')](_0x5654('0xb'),auth['isAuthenticated'](),controller[_0x5654('0xc')]);router[_0x5654('0x6')](_0x5654('0xd'),auth['isAuthenticated'](),controller[_0x5654('0xe')]);router[_0x5654('0x6')](_0x5654('0xf'),auth[_0x5654('0x9')](),controller[_0x5654('0x10')]);router[_0x5654('0x6')](_0x5654('0x11'),auth[_0x5654('0x9')](),controller[_0x5654('0x12')]);router[_0x5654('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5654('0x13')](_0x5654('0x11'),auth[_0x5654('0x9')](),controller[_0x5654('0x14')]);router[_0x5654('0x15')](_0x5654('0x8'),auth['isAuthenticated'](),controller[_0x5654('0x16')]);router[_0x5654('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5654('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 80dbe4d..bb15897 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 _0x95bf=['STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x95bf,0x10f));var _0xf95b=function(_0x2732da,_0x23e816){_0x2732da=_0x2732da-0x0;var _0x241842=_0x95bf[_0x2732da];return _0x241842;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf95b('0x0')]},'description':{'type':Sequelize[_0xf95b('0x0')]}}; \ No newline at end of file +var _0xe7ab=['exports','STRING','sequelize'];(function(_0xa3da82,_0x3be0c4){var _0x55a74=function(_0x4f0f76){while(--_0x4f0f76){_0xa3da82['push'](_0xa3da82['shift']());}};_0x55a74(++_0x3be0c4);}(_0xe7ab,0x146));var _0xbe7a=function(_0x28a40a,_0x439046){_0x28a40a=_0x28a40a-0x0;var _0x11651f=_0xe7ab[_0x28a40a];return _0x11651f;};'use strict';var Sequelize=require(_0xbe7a('0x0'));module[_0xbe7a('0x1')]={'name':{'type':Sequelize[_0xbe7a('0x2')]},'description':{'type':Sequelize[_0xbe7a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 36764d7..9b1473a 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 _0x941e=['catch','params','include','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll'];(function(_0x2b48cf,_0x4ca5bb){var _0x49b711=function(_0x40e008){while(--_0x40e008){_0x2b48cf['push'](_0x2b48cf['shift']());}};_0x49b711(++_0x4ca5bb);}(_0x941e,0x10d));var _0xe941=function(_0x991df0,_0x2e9a2d){_0x991df0=_0x991df0-0x0;var _0x4f27fd=_0x941e[_0x991df0];return _0x4f27fd;};'use strict';var emlformat=require(_0xe941('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe941('0x1'));var jsonpatch=require(_0xe941('0x2'));var rp=require(_0xe941('0x3'));var moment=require(_0xe941('0x4'));var BPromise=require(_0xe941('0x5'));var Mustache=require(_0xe941('0x6'));var util=require(_0xe941('0x7'));var path=require(_0xe941('0x8'));var sox=require(_0xe941('0x9'));var csv=require(_0xe941('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe941('0xb'));var _=require(_0xe941('0xc'));var squel=require(_0xe941('0xd'));var crypto=require(_0xe941('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe941('0xf'));var toCsv=require(_0xe941('0xa'));var querystring=require('querystring');var Papa=require(_0xe941('0x10'));var Redis=require(_0xe941('0x11'));var authService=require(_0xe941('0x12'));var qs=require(_0xe941('0x13'));var as=require(_0xe941('0x14'));var hardwareService=require(_0xe941('0x15'));var logger=require(_0xe941('0x16'))(_0xe941('0x17'));var utils=require(_0xe941('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe941('0x19'));var db=require(_0xe941('0x1a'))['db'];function respondWithStatusCode(_0x1d8ed2,_0x47afb7){_0x47afb7=_0x47afb7||0xcc;return function(_0xa00275){if(_0xa00275){return _0x1d8ed2[_0xe941('0x1b')](_0x47afb7);}return _0x1d8ed2[_0xe941('0x1c')](_0x47afb7)[_0xe941('0x1d')]();};}function respondWithResult(_0x9d7e65,_0x1a3a6f){_0x1a3a6f=_0x1a3a6f||0xc8;return function(_0x5a3cb3){if(_0x5a3cb3){return _0x9d7e65['status'](_0x1a3a6f)[_0xe941('0x1e')](_0x5a3cb3);}};}function respondWithFilteredResult(_0x1e4415,_0x1e71e3){return function(_0x20d245){if(_0x20d245){var _0x33d271=typeof _0x1e71e3[_0xe941('0x1f')]===_0xe941('0x20')&&typeof _0x1e71e3[_0xe941('0x21')]==='undefined';var _0x26d0aa=_0x20d245[_0xe941('0x22')];var _0x22d600=_0x33d271?0x0:_0x1e71e3[_0xe941('0x1f')];var _0x3b5ae6=_0x33d271?_0x20d245[_0xe941('0x22')]:_0x1e71e3[_0xe941('0x1f')]+_0x1e71e3['limit'];var _0x3961b5;if(_0x3b5ae6>=_0x26d0aa){_0x3b5ae6=_0x26d0aa;_0x3961b5=0xc8;}else{_0x3961b5=0xce;}_0x1e4415['status'](_0x3961b5);return _0x1e4415[_0xe941('0x23')]('Content-Range',_0x22d600+'-'+_0x3b5ae6+'/'+_0x26d0aa)['json'](_0x20d245);}return null;};}function patchUpdates(_0x43cfb4){return function(_0x4891d6){try{jsonpatch['apply'](_0x4891d6,_0x43cfb4,!![]);}catch(_0x2d88be){return BPromise[_0xe941('0x24')](_0x2d88be);}return _0x4891d6[_0xe941('0x25')]();};}function saveUpdates(_0x359845,_0xbbf7c){return function(_0x3608c2){if(_0x3608c2){return _0x3608c2[_0xe941('0x26')](_0x359845)['then'](function(_0xb8b6ee){return _0xb8b6ee;});}return null;};}function removeEntity(_0x350bbd,_0x47bd38){return function(_0x258017){if(_0x258017){return _0x258017[_0xe941('0x27')]()[_0xe941('0x28')](function(){_0x350bbd['status'](0xcc)[_0xe941('0x1d')]();});}};}function handleEntityNotFound(_0x3765d9,_0x5adb9c){return function(_0x10ec5a){if(!_0x10ec5a){_0x3765d9[_0xe941('0x1b')](0x194);}return _0x10ec5a;};}function handleError(_0x17fdbe,_0x580dd3){_0x580dd3=_0x580dd3||0x1f4;return function(_0x7c2923){logger[_0xe941('0x29')](_0x7c2923[_0xe941('0x2a')]);if(_0x7c2923['name']){delete _0x7c2923[_0xe941('0x2b')];}_0x17fdbe['status'](_0x580dd3)[_0xe941('0x2c')](_0x7c2923);};}exports[_0xe941('0x2d')]=function(_0x2143b3,_0x2cb278){var _0xb25f53={},_0x1450e8={},_0x5cdd2c={'count':0x0,'rows':[]};var _0x1e3f4d=_[_0xe941('0x2e')](db[_0xe941('0x2f')][_0xe941('0x30')],function(_0x58e622){return{'name':_0x58e622[_0xe941('0x31')],'type':_0x58e622[_0xe941('0x32')][_0xe941('0x33')]};});_0x1450e8[_0xe941('0x34')]=_[_0xe941('0x2e')](_0x1e3f4d,_0xe941('0x2b'));_0x1450e8[_0xe941('0x35')]=_[_0xe941('0x36')](_0x2143b3[_0xe941('0x35')]);_0x1450e8['filters']=_[_0xe941('0x37')](_0x1450e8[_0xe941('0x34')],_0x1450e8['query']);_0xb25f53[_0xe941('0x38')]=_['intersection'](_0x1450e8[_0xe941('0x34')],qs[_0xe941('0x39')](_0x2143b3[_0xe941('0x35')]['fields']));_0xb25f53[_0xe941('0x38')]=_0xb25f53[_0xe941('0x38')][_0xe941('0x3a')]?_0xb25f53[_0xe941('0x38')]:_0x1450e8['model'];if(!_0x2143b3[_0xe941('0x35')][_0xe941('0x3b')](_0xe941('0x3c'))){_0xb25f53[_0xe941('0x21')]=qs[_0xe941('0x21')](_0x2143b3[_0xe941('0x35')]['limit']);_0xb25f53[_0xe941('0x1f')]=qs['offset'](_0x2143b3[_0xe941('0x35')][_0xe941('0x1f')]);}_0xb25f53[_0xe941('0x3d')]=qs[_0xe941('0x3e')](_0x2143b3[_0xe941('0x35')][_0xe941('0x3e')]);_0xb25f53[_0xe941('0x3f')]=qs[_0xe941('0x40')](_[_0xe941('0x41')](_0x2143b3[_0xe941('0x35')],_0x1450e8['filters']),_0x1e3f4d);if(_0x2143b3[_0xe941('0x35')][_0xe941('0x42')]){_0xb25f53[_0xe941('0x3f')]=_[_0xe941('0x43')](_0xb25f53['where'],{'$or':_[_0xe941('0x2e')](_0x1e3f4d,function(_0x307453){if(_0x307453['type']!=='VIRTUAL'){var _0x5c1566={};_0x5c1566[_0x307453['name']]={'$like':'%'+_0x2143b3[_0xe941('0x35')][_0xe941('0x42')]+'%'};return _0x5c1566;}})});}_0xb25f53=_[_0xe941('0x43')]({},_0xb25f53,_0x2143b3[_0xe941('0x44')]);var _0x32720b={'where':_0xb25f53['where']};return db[_0xe941('0x2f')][_0xe941('0x22')](_0x32720b)[_0xe941('0x28')](function(_0x343b16){_0x5cdd2c[_0xe941('0x22')]=_0x343b16;if(_0x2143b3['query'][_0xe941('0x45')]){_0xb25f53['include']=[{'all':!![]}];}return db[_0xe941('0x2f')][_0xe941('0x46')](_0xb25f53);})[_0xe941('0x28')](function(_0x50ef5a){_0x5cdd2c['rows']=_0x50ef5a;return _0x5cdd2c;})[_0xe941('0x28')](respondWithFilteredResult(_0x2cb278,_0xb25f53))[_0xe941('0x47')](handleError(_0x2cb278,null));};exports['show']=function(_0x281f43,_0x2ae544){var _0x15d6d9={'raw':![],'where':{'id':_0x281f43[_0xe941('0x48')]['id']}},_0x26123b={};_0x26123b[_0xe941('0x34')]=_[_0xe941('0x36')](db[_0xe941('0x2f')][_0xe941('0x30')]);_0x26123b['query']=_['keys'](_0x281f43[_0xe941('0x35')]);_0x26123b[_0xe941('0x40')]=_[_0xe941('0x37')](_0x26123b[_0xe941('0x34')],_0x26123b['query']);_0x15d6d9[_0xe941('0x38')]=_[_0xe941('0x37')](_0x26123b[_0xe941('0x34')],qs[_0xe941('0x39')](_0x281f43[_0xe941('0x35')]['fields']));_0x15d6d9['attributes']=_0x15d6d9['attributes'][_0xe941('0x3a')]?_0x15d6d9[_0xe941('0x38')]:_0x26123b[_0xe941('0x34')];if(_0x281f43[_0xe941('0x35')][_0xe941('0x45')]){_0x15d6d9[_0xe941('0x49')]=[{'all':!![]}];}_0x15d6d9=_[_0xe941('0x43')]({},_0x15d6d9,_0x281f43[_0xe941('0x44')]);return db[_0xe941('0x2f')][_0xe941('0x4a')](_0x15d6d9)[_0xe941('0x28')](handleEntityNotFound(_0x2ae544,null))[_0xe941('0x28')](respondWithResult(_0x2ae544,null))[_0xe941('0x47')](handleError(_0x2ae544,null));};exports[_0xe941('0x4b')]=function(_0x21a773,_0x9cae6){return db[_0xe941('0x2f')][_0xe941('0x4b')](_0x21a773[_0xe941('0x4c')],{})[_0xe941('0x28')](respondWithResult(_0x9cae6,0xc9))['catch'](handleError(_0x9cae6,null));};exports[_0xe941('0x26')]=function(_0x3f6573,_0x566b19){if(_0x3f6573['body']['id']){delete _0x3f6573[_0xe941('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0xe941('0x4a')]({'where':{'id':_0x3f6573['params']['id']}})[_0xe941('0x28')](handleEntityNotFound(_0x566b19,null))[_0xe941('0x28')](saveUpdates(_0x3f6573[_0xe941('0x4c')],null))[_0xe941('0x28')](respondWithResult(_0x566b19,null))[_0xe941('0x47')](handleError(_0x566b19,null));};exports[_0xe941('0x27')]=function(_0x15253e,_0x1fbe54){return db['FreshdeskConfiguration'][_0xe941('0x4a')]({'where':{'id':_0x15253e[_0xe941('0x48')]['id']}})[_0xe941('0x28')](handleEntityNotFound(_0x1fbe54,null))[_0xe941('0x28')](removeEntity(_0x1fbe54,null))[_0xe941('0x47')](handleError(_0x1fbe54,null));};exports[_0xe941('0x4d')]=function(_0x4af41f,_0x3363c9,_0x23aaaa){var _0x57c89d={};var _0x4a33ac={};var _0x495438;var _0xa3dd2f;return db[_0xe941('0x2f')][_0xe941('0x4e')]({'where':{'id':_0x4af41f['params']['id']}})[_0xe941('0x28')](handleEntityNotFound(_0x3363c9,null))[_0xe941('0x28')](function(_0x2d0e43){if(_0x2d0e43){_0x495438=_0x2d0e43;_0x4a33ac[_0xe941('0x34')]=_['keys'](db[_0xe941('0x4f')][_0xe941('0x30')]);_0x4a33ac['query']=_[_0xe941('0x36')](_0x4af41f[_0xe941('0x35')]);_0x4a33ac['filters']=_[_0xe941('0x37')](_0x4a33ac['model'],_0x4a33ac['query']);_0x57c89d[_0xe941('0x38')]=_[_0xe941('0x37')](_0x4a33ac['model'],qs[_0xe941('0x39')](_0x4af41f['query']['fields']));_0x57c89d['attributes']=_0x57c89d[_0xe941('0x38')][_0xe941('0x3a')]?_0x57c89d['attributes']:_0x4a33ac[_0xe941('0x34')];_0x57c89d[_0xe941('0x3d')]=qs[_0xe941('0x3e')](_0x4af41f[_0xe941('0x35')][_0xe941('0x3e')]);_0x57c89d[_0xe941('0x3f')]=qs[_0xe941('0x40')](_[_0xe941('0x41')](_0x4af41f[_0xe941('0x35')],_0x4a33ac['filters']));if(_0x4af41f[_0xe941('0x35')][_0xe941('0x42')]){_0x57c89d[_0xe941('0x3f')]=_[_0xe941('0x43')](_0x57c89d[_0xe941('0x3f')],{'$or':_[_0xe941('0x2e')](_0x57c89d[_0xe941('0x38')],function(_0x3e4d6a){var _0x5be38e={};_0x5be38e[_0x3e4d6a]={'$like':'%'+_0x4af41f['query'][_0xe941('0x42')]+'%'};return _0x5be38e;})});}_0x57c89d=_[_0xe941('0x43')]({},_0x57c89d,_0x4af41f[_0xe941('0x44')]);return _0x495438['getFields'](_0x57c89d);}})[_0xe941('0x28')](function(_0x2f02c2){if(_0x2f02c2){_0xa3dd2f=_0x2f02c2[_0xe941('0x3a')];if(!_0x4af41f[_0xe941('0x35')][_0xe941('0x3b')](_0xe941('0x3c'))){_0x57c89d[_0xe941('0x21')]=qs[_0xe941('0x21')](_0x4af41f['query'][_0xe941('0x21')]);_0x57c89d[_0xe941('0x1f')]=qs[_0xe941('0x1f')](_0x4af41f[_0xe941('0x35')][_0xe941('0x1f')]);}return _0x495438[_0xe941('0x4d')](_0x57c89d);}})['then'](function(_0x19c5c3){if(_0x19c5c3){return _0x19c5c3?{'count':_0xa3dd2f,'rows':_0x19c5c3}:null;}})['then'](respondWithResult(_0x3363c9,null))[_0xe941('0x47')](handleError(_0x3363c9,null));};exports[_0xe941('0x50')]=function(_0x15855d,_0x3fe6a0,_0x1f1533){var _0x3ae490={};var _0xde2ae7={};var _0x1c76d7;var _0x317c36;return db[_0xe941('0x2f')][_0xe941('0x4e')]({'where':{'id':_0x15855d[_0xe941('0x48')]['id']}})[_0xe941('0x28')](handleEntityNotFound(_0x3fe6a0,null))[_0xe941('0x28')](function(_0x42fd03){if(_0x42fd03){_0x1c76d7=_0x42fd03;_0xde2ae7[_0xe941('0x34')]=_[_0xe941('0x36')](db[_0xe941('0x4f')][_0xe941('0x30')]);_0xde2ae7['query']=_[_0xe941('0x36')](_0x15855d[_0xe941('0x35')]);_0xde2ae7[_0xe941('0x40')]=_[_0xe941('0x37')](_0xde2ae7[_0xe941('0x34')],_0xde2ae7[_0xe941('0x35')]);_0x3ae490['attributes']=_['intersection'](_0xde2ae7[_0xe941('0x34')],qs[_0xe941('0x39')](_0x15855d[_0xe941('0x35')][_0xe941('0x39')]));_0x3ae490[_0xe941('0x38')]=_0x3ae490[_0xe941('0x38')][_0xe941('0x3a')]?_0x3ae490[_0xe941('0x38')]:_0xde2ae7[_0xe941('0x34')];_0x3ae490[_0xe941('0x3d')]=qs[_0xe941('0x3e')](_0x15855d['query']['sort']);_0x3ae490[_0xe941('0x3f')]=qs[_0xe941('0x40')](_['pick'](_0x15855d[_0xe941('0x35')],_0xde2ae7['filters']));if(_0x15855d[_0xe941('0x35')][_0xe941('0x42')]){_0x3ae490[_0xe941('0x3f')]=_[_0xe941('0x43')](_0x3ae490['where'],{'$or':_[_0xe941('0x2e')](_0x3ae490[_0xe941('0x38')],function(_0x112bae){var _0x24adb7={};_0x24adb7[_0x112bae]={'$like':'%'+_0x15855d['query'][_0xe941('0x42')]+'%'};return _0x24adb7;})});}_0x3ae490=_[_0xe941('0x43')]({},_0x3ae490,_0x15855d[_0xe941('0x44')]);return _0x1c76d7[_0xe941('0x50')](_0x3ae490);}})[_0xe941('0x28')](function(_0xa651e2){if(_0xa651e2){_0x317c36=_0xa651e2[_0xe941('0x3a')];if(!_0x15855d[_0xe941('0x35')][_0xe941('0x3b')](_0xe941('0x3c'))){_0x3ae490['limit']=qs[_0xe941('0x21')](_0x15855d[_0xe941('0x35')]['limit']);_0x3ae490['offset']=qs[_0xe941('0x1f')](_0x15855d[_0xe941('0x35')]['offset']);}return _0x1c76d7[_0xe941('0x50')](_0x3ae490);}})[_0xe941('0x28')](function(_0x67e5f9){if(_0x67e5f9){return _0x67e5f9?{'count':_0x317c36,'rows':_0x67e5f9}:null;}})['then'](respondWithResult(_0x3fe6a0,null))[_0xe941('0x47')](handleError(_0x3fe6a0,null));};exports['getDescriptions']=function(_0x4555cf,_0x3462f8,_0x2d4f34){var _0x3d1d07={};var _0x229d7e={};var _0x2283a4;var _0x409d0c;return db[_0xe941('0x2f')][_0xe941('0x4e')]({'where':{'id':_0x4555cf['params']['id']}})[_0xe941('0x28')](handleEntityNotFound(_0x3462f8,null))[_0xe941('0x28')](function(_0x315f57){if(_0x315f57){_0x2283a4=_0x315f57;_0x229d7e['model']=_['keys'](db['FreshdeskField'][_0xe941('0x30')]);_0x229d7e[_0xe941('0x35')]=_[_0xe941('0x36')](_0x4555cf['query']);_0x229d7e[_0xe941('0x40')]=_[_0xe941('0x37')](_0x229d7e[_0xe941('0x34')],_0x229d7e[_0xe941('0x35')]);_0x3d1d07[_0xe941('0x38')]=_[_0xe941('0x37')](_0x229d7e['model'],qs['fields'](_0x4555cf[_0xe941('0x35')][_0xe941('0x39')]));_0x3d1d07['attributes']=_0x3d1d07['attributes']['length']?_0x3d1d07[_0xe941('0x38')]:_0x229d7e[_0xe941('0x34')];_0x3d1d07[_0xe941('0x3d')]=qs[_0xe941('0x3e')](_0x4555cf['query'][_0xe941('0x3e')]);_0x3d1d07['where']=qs['filters'](_[_0xe941('0x41')](_0x4555cf['query'],_0x229d7e[_0xe941('0x40')]));if(_0x4555cf[_0xe941('0x35')][_0xe941('0x42')]){_0x3d1d07[_0xe941('0x3f')]=_[_0xe941('0x43')](_0x3d1d07[_0xe941('0x3f')],{'$or':_['map'](_0x3d1d07['attributes'],function(_0x45d157){var _0x556c35={};_0x556c35[_0x45d157]={'$like':'%'+_0x4555cf[_0xe941('0x35')][_0xe941('0x42')]+'%'};return _0x556c35;})});}_0x3d1d07=_['merge']({},_0x3d1d07,_0x4555cf[_0xe941('0x44')]);return _0x2283a4[_0xe941('0x51')](_0x3d1d07);}})[_0xe941('0x28')](function(_0x3fd749){if(_0x3fd749){_0x409d0c=_0x3fd749[_0xe941('0x3a')];if(!_0x4555cf[_0xe941('0x35')][_0xe941('0x3b')](_0xe941('0x3c'))){_0x3d1d07[_0xe941('0x21')]=qs['limit'](_0x4555cf[_0xe941('0x35')][_0xe941('0x21')]);_0x3d1d07[_0xe941('0x1f')]=qs[_0xe941('0x1f')](_0x4555cf[_0xe941('0x35')][_0xe941('0x1f')]);}return _0x2283a4[_0xe941('0x51')](_0x3d1d07);}})[_0xe941('0x28')](function(_0x1fc299){if(_0x1fc299){return _0x1fc299?{'count':_0x409d0c,'rows':_0x1fc299}:null;}})[_0xe941('0x28')](respondWithResult(_0x3462f8,null))['catch'](handleError(_0x3462f8,null));};exports[_0xe941('0x52')]=function(_0x2fd70c,_0x2534c9,_0x36c004){var _0x25d4b3={};var _0x598261={};var _0x128f9b;var _0x56fadf;return db[_0xe941('0x2f')][_0xe941('0x4e')]({'where':{'id':_0x2fd70c[_0xe941('0x48')]['id']}})['then'](handleEntityNotFound(_0x2534c9,null))[_0xe941('0x28')](function(_0x111e45){if(_0x111e45){_0x128f9b=_0x111e45;_0x598261['model']=_['keys'](db['Tag'][_0xe941('0x30')]);_0x598261[_0xe941('0x35')]=_['keys'](_0x2fd70c['query']);_0x598261[_0xe941('0x40')]=_[_0xe941('0x37')](_0x598261[_0xe941('0x34')],_0x598261[_0xe941('0x35')]);_0x25d4b3[_0xe941('0x38')]=_[_0xe941('0x37')](_0x598261[_0xe941('0x34')],qs['fields'](_0x2fd70c[_0xe941('0x35')][_0xe941('0x39')]));_0x25d4b3[_0xe941('0x38')]=_0x25d4b3['attributes'][_0xe941('0x3a')]?_0x25d4b3['attributes']:_0x598261[_0xe941('0x34')];_0x25d4b3[_0xe941('0x3d')]=qs[_0xe941('0x3e')](_0x2fd70c[_0xe941('0x35')]['sort']);_0x25d4b3[_0xe941('0x3f')]=qs['filters'](_['pick'](_0x2fd70c['query'],_0x598261[_0xe941('0x40')]));if(_0x2fd70c[_0xe941('0x35')][_0xe941('0x42')]){_0x25d4b3['where']=_[_0xe941('0x43')](_0x25d4b3['where'],{'$or':_[_0xe941('0x2e')](_0x25d4b3[_0xe941('0x38')],function(_0x2522a4){var _0x35b121={};_0x35b121[_0x2522a4]={'$like':'%'+_0x2fd70c[_0xe941('0x35')][_0xe941('0x42')]+'%'};return _0x35b121;})});}_0x25d4b3=_['merge']({},_0x25d4b3,_0x2fd70c['options']);return _0x128f9b[_0xe941('0x52')](_0x25d4b3);}})[_0xe941('0x28')](function(_0x44b688){if(_0x44b688){_0x56fadf=_0x44b688[_0xe941('0x3a')];if(!_0x2fd70c[_0xe941('0x35')]['hasOwnProperty'](_0xe941('0x3c'))){_0x25d4b3[_0xe941('0x21')]=qs['limit'](_0x2fd70c[_0xe941('0x35')][_0xe941('0x21')]);_0x25d4b3[_0xe941('0x1f')]=qs[_0xe941('0x1f')](_0x2fd70c[_0xe941('0x35')][_0xe941('0x1f')]);}return _0x128f9b[_0xe941('0x52')](_0x25d4b3);}})['then'](function(_0x5c5497){if(_0x5c5497){return _0x5c5497?{'count':_0x56fadf,'rows':_0x5c5497}:null;}})['then'](respondWithResult(_0x2534c9,null))[_0xe941('0x47')](handleError(_0x2534c9,null));};exports[_0xe941('0x53')]=function(_0x429587,_0x2d765a,_0x4f7c21){if(_0x429587[_0xe941('0x4c')]['id']){delete _0x429587[_0xe941('0x4c')]['id'];}return db[_0xe941('0x2f')][_0xe941('0x4e')]({'where':{'id':_0x429587['params']['id']}})[_0xe941('0x28')](handleEntityNotFound(_0x2d765a,null))[_0xe941('0x28')](function(_0x5aff25){if(_0x5aff25){return _0x5aff25[_0xe941('0x53')](_0x429587[_0xe941('0x4c')][_0xe941('0x54')]||[]);}return null;})[_0xe941('0x28')](respondWithResult(_0x2d765a,null))[_0xe941('0x47')](handleError(_0x2d765a,null));}; \ No newline at end of file +var _0xfb64=['limit','undefined','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','FreshdeskConfiguration','count','include','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','getFields','FreshdeskField','pick','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2171c2,_0x5e12c7){var _0x24844c=function(_0x57c3d2){while(--_0x57c3d2){_0x2171c2['push'](_0x2171c2['shift']());}};_0x24844c(++_0x5e12c7);}(_0xfb64,0xd8));var _0x4fb6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb64[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x4fb6('0x0'));var rimraf=require(_0x4fb6('0x1'));var zipdir=require(_0x4fb6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4fb6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4fb6('0x4'));var util=require(_0x4fb6('0x5'));var path=require(_0x4fb6('0x6'));var sox=require(_0x4fb6('0x7'));var csv=require(_0x4fb6('0x8'));var ejs=require(_0x4fb6('0x9'));var fs=require('fs');var fs_extra=require(_0x4fb6('0xa'));var _=require(_0x4fb6('0xb'));var squel=require(_0x4fb6('0xc'));var crypto=require('crypto');var jsforce=require(_0x4fb6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4fb6('0x8'));var querystring=require('querystring');var Papa=require(_0x4fb6('0xe'));var Redis=require(_0x4fb6('0xf'));var authService=require(_0x4fb6('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fb6('0x11'))(_0x4fb6('0x12'));var utils=require(_0x4fb6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4fb6('0x14'));var db=require(_0x4fb6('0x15'))['db'];function respondWithStatusCode(_0xc0d017,_0x2dc3c5){_0x2dc3c5=_0x2dc3c5||0xcc;return function(_0x1b4502){if(_0x1b4502){return _0xc0d017[_0x4fb6('0x16')](_0x2dc3c5);}return _0xc0d017[_0x4fb6('0x17')](_0x2dc3c5)[_0x4fb6('0x18')]();};}function respondWithResult(_0x21cacf,_0x274702){_0x274702=_0x274702||0xc8;return function(_0x6b01ed){if(_0x6b01ed){return _0x21cacf['status'](_0x274702)[_0x4fb6('0x19')](_0x6b01ed);}};}function respondWithFilteredResult(_0x5db775,_0x29836f){return function(_0x14c36e){if(_0x14c36e){var _0x82a502=typeof _0x29836f[_0x4fb6('0x1a')]==='undefined'&&typeof _0x29836f[_0x4fb6('0x1b')]===_0x4fb6('0x1c');var _0x84c30d=_0x14c36e['count'];var _0x8555=_0x82a502?0x0:_0x29836f[_0x4fb6('0x1a')];var _0x6d9d6e=_0x82a502?_0x14c36e['count']:_0x29836f[_0x4fb6('0x1a')]+_0x29836f['limit'];var _0x5e8e9b;if(_0x6d9d6e>=_0x84c30d){_0x6d9d6e=_0x84c30d;_0x5e8e9b=0xc8;}else{_0x5e8e9b=0xce;}_0x5db775[_0x4fb6('0x17')](_0x5e8e9b);return _0x5db775[_0x4fb6('0x1d')](_0x4fb6('0x1e'),_0x8555+'-'+_0x6d9d6e+'/'+_0x84c30d)[_0x4fb6('0x19')](_0x14c36e);}return null;};}function patchUpdates(_0x3f0758){return function(_0x11a131){try{jsonpatch[_0x4fb6('0x1f')](_0x11a131,_0x3f0758,!![]);}catch(_0x17d01a){return BPromise[_0x4fb6('0x20')](_0x17d01a);}return _0x11a131['save']();};}function saveUpdates(_0x4f98b6,_0x174189){return function(_0x3312d3){if(_0x3312d3){return _0x3312d3[_0x4fb6('0x21')](_0x4f98b6)[_0x4fb6('0x22')](function(_0xd3246f){return _0xd3246f;});}return null;};}function removeEntity(_0x1be730,_0x284ac6){return function(_0x25c02f){if(_0x25c02f){return _0x25c02f['destroy']()[_0x4fb6('0x22')](function(){_0x1be730['status'](0xcc)[_0x4fb6('0x18')]();});}};}function handleEntityNotFound(_0xbddb14,_0x5e8fe4){return function(_0x5da1ce){if(!_0x5da1ce){_0xbddb14[_0x4fb6('0x16')](0x194);}return _0x5da1ce;};}function handleError(_0x474e72,_0x18b225){_0x18b225=_0x18b225||0x1f4;return function(_0x1c9d21){logger[_0x4fb6('0x23')](_0x1c9d21[_0x4fb6('0x24')]);if(_0x1c9d21['name']){delete _0x1c9d21[_0x4fb6('0x25')];}_0x474e72['status'](_0x18b225)[_0x4fb6('0x26')](_0x1c9d21);};}exports[_0x4fb6('0x27')]=function(_0x3070f2,_0xba7ec6){var _0x3e35c0={},_0x3363cc={},_0x3a6a69={'count':0x0,'rows':[]};var _0x4f3a32=_[_0x4fb6('0x28')](db['FreshdeskConfiguration']['rawAttributes'],function(_0xc8fac5){return{'name':_0xc8fac5['fieldName'],'type':_0xc8fac5[_0x4fb6('0x29')]['key']};});_0x3363cc[_0x4fb6('0x2a')]=_['map'](_0x4f3a32,_0x4fb6('0x25'));_0x3363cc[_0x4fb6('0x2b')]=_[_0x4fb6('0x2c')](_0x3070f2[_0x4fb6('0x2b')]);_0x3363cc[_0x4fb6('0x2d')]=_[_0x4fb6('0x2e')](_0x3363cc[_0x4fb6('0x2a')],_0x3363cc[_0x4fb6('0x2b')]);_0x3e35c0['attributes']=_[_0x4fb6('0x2e')](_0x3363cc[_0x4fb6('0x2a')],qs[_0x4fb6('0x2f')](_0x3070f2['query'][_0x4fb6('0x2f')]));_0x3e35c0[_0x4fb6('0x30')]=_0x3e35c0[_0x4fb6('0x30')][_0x4fb6('0x31')]?_0x3e35c0['attributes']:_0x3363cc[_0x4fb6('0x2a')];if(!_0x3070f2['query'][_0x4fb6('0x32')](_0x4fb6('0x33'))){_0x3e35c0['limit']=qs[_0x4fb6('0x1b')](_0x3070f2['query'][_0x4fb6('0x1b')]);_0x3e35c0[_0x4fb6('0x1a')]=qs[_0x4fb6('0x1a')](_0x3070f2[_0x4fb6('0x2b')][_0x4fb6('0x1a')]);}_0x3e35c0[_0x4fb6('0x34')]=qs[_0x4fb6('0x35')](_0x3070f2[_0x4fb6('0x2b')][_0x4fb6('0x35')]);_0x3e35c0[_0x4fb6('0x36')]=qs['filters'](_['pick'](_0x3070f2['query'],_0x3363cc[_0x4fb6('0x2d')]),_0x4f3a32);if(_0x3070f2['query']['filter']){_0x3e35c0[_0x4fb6('0x36')]=_[_0x4fb6('0x37')](_0x3e35c0[_0x4fb6('0x36')],{'$or':_[_0x4fb6('0x28')](_0x4f3a32,function(_0x5a7bc3){if(_0x5a7bc3[_0x4fb6('0x29')]!==_0x4fb6('0x38')){var _0x56657c={};_0x56657c[_0x5a7bc3[_0x4fb6('0x25')]]={'$like':'%'+_0x3070f2[_0x4fb6('0x2b')][_0x4fb6('0x39')]+'%'};return _0x56657c;}})});}_0x3e35c0=_[_0x4fb6('0x37')]({},_0x3e35c0,_0x3070f2[_0x4fb6('0x3a')]);var _0x385c96={'where':_0x3e35c0[_0x4fb6('0x36')]};return db[_0x4fb6('0x3b')]['count'](_0x385c96)[_0x4fb6('0x22')](function(_0x1d12b2){_0x3a6a69[_0x4fb6('0x3c')]=_0x1d12b2;if(_0x3070f2[_0x4fb6('0x2b')]['includeAll']){_0x3e35c0[_0x4fb6('0x3d')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x3e35c0);})[_0x4fb6('0x22')](function(_0x3a2b72){_0x3a6a69['rows']=_0x3a2b72;return _0x3a6a69;})[_0x4fb6('0x22')](respondWithFilteredResult(_0xba7ec6,_0x3e35c0))[_0x4fb6('0x3e')](handleError(_0xba7ec6,null));};exports[_0x4fb6('0x3f')]=function(_0x2311e5,_0x2903c4){var _0xe464da={'raw':![],'where':{'id':_0x2311e5[_0x4fb6('0x40')]['id']}},_0x179318={};_0x179318[_0x4fb6('0x2a')]=_['keys'](db[_0x4fb6('0x3b')][_0x4fb6('0x41')]);_0x179318[_0x4fb6('0x2b')]=_[_0x4fb6('0x2c')](_0x2311e5['query']);_0x179318[_0x4fb6('0x2d')]=_[_0x4fb6('0x2e')](_0x179318[_0x4fb6('0x2a')],_0x179318[_0x4fb6('0x2b')]);_0xe464da[_0x4fb6('0x30')]=_['intersection'](_0x179318[_0x4fb6('0x2a')],qs[_0x4fb6('0x2f')](_0x2311e5[_0x4fb6('0x2b')][_0x4fb6('0x2f')]));_0xe464da[_0x4fb6('0x30')]=_0xe464da[_0x4fb6('0x30')][_0x4fb6('0x31')]?_0xe464da['attributes']:_0x179318['model'];if(_0x2311e5[_0x4fb6('0x2b')][_0x4fb6('0x42')]){_0xe464da[_0x4fb6('0x3d')]=[{'all':!![]}];}_0xe464da=_[_0x4fb6('0x37')]({},_0xe464da,_0x2311e5['options']);return db[_0x4fb6('0x3b')][_0x4fb6('0x43')](_0xe464da)[_0x4fb6('0x22')](handleEntityNotFound(_0x2903c4,null))[_0x4fb6('0x22')](respondWithResult(_0x2903c4,null))[_0x4fb6('0x3e')](handleError(_0x2903c4,null));};exports[_0x4fb6('0x44')]=function(_0x47861d,_0x44b658){return db['FreshdeskConfiguration'][_0x4fb6('0x44')](_0x47861d[_0x4fb6('0x45')],{})['then'](respondWithResult(_0x44b658,0xc9))['catch'](handleError(_0x44b658,null));};exports[_0x4fb6('0x21')]=function(_0x470de7,_0x1c7a59){if(_0x470de7[_0x4fb6('0x45')]['id']){delete _0x470de7[_0x4fb6('0x45')]['id'];}return db[_0x4fb6('0x3b')][_0x4fb6('0x43')]({'where':{'id':_0x470de7[_0x4fb6('0x40')]['id']}})[_0x4fb6('0x22')](handleEntityNotFound(_0x1c7a59,null))['then'](saveUpdates(_0x470de7[_0x4fb6('0x45')],null))[_0x4fb6('0x22')](respondWithResult(_0x1c7a59,null))['catch'](handleError(_0x1c7a59,null));};exports[_0x4fb6('0x46')]=function(_0x56020b,_0x211dac){return db[_0x4fb6('0x3b')]['find']({'where':{'id':_0x56020b[_0x4fb6('0x40')]['id']}})[_0x4fb6('0x22')](handleEntityNotFound(_0x211dac,null))[_0x4fb6('0x22')](removeEntity(_0x211dac,null))[_0x4fb6('0x3e')](handleError(_0x211dac,null));};exports[_0x4fb6('0x47')]=function(_0x12a104,_0x4af3a7,_0x2b4661){var _0x436d7a={};var _0x51af94={};var _0x36beb0;var _0x351413;return db[_0x4fb6('0x3b')]['findOne']({'where':{'id':_0x12a104[_0x4fb6('0x40')]['id']}})['then'](handleEntityNotFound(_0x4af3a7,null))['then'](function(_0x40be71){if(_0x40be71){_0x36beb0=_0x40be71;_0x51af94['model']=_['keys'](db[_0x4fb6('0x48')]['rawAttributes']);_0x51af94[_0x4fb6('0x2b')]=_[_0x4fb6('0x2c')](_0x12a104['query']);_0x51af94[_0x4fb6('0x2d')]=_[_0x4fb6('0x2e')](_0x51af94['model'],_0x51af94['query']);_0x436d7a[_0x4fb6('0x30')]=_[_0x4fb6('0x2e')](_0x51af94[_0x4fb6('0x2a')],qs[_0x4fb6('0x2f')](_0x12a104[_0x4fb6('0x2b')][_0x4fb6('0x2f')]));_0x436d7a['attributes']=_0x436d7a[_0x4fb6('0x30')][_0x4fb6('0x31')]?_0x436d7a[_0x4fb6('0x30')]:_0x51af94[_0x4fb6('0x2a')];_0x436d7a[_0x4fb6('0x34')]=qs['sort'](_0x12a104[_0x4fb6('0x2b')]['sort']);_0x436d7a[_0x4fb6('0x36')]=qs[_0x4fb6('0x2d')](_[_0x4fb6('0x49')](_0x12a104[_0x4fb6('0x2b')],_0x51af94[_0x4fb6('0x2d')]));if(_0x12a104['query'][_0x4fb6('0x39')]){_0x436d7a[_0x4fb6('0x36')]=_[_0x4fb6('0x37')](_0x436d7a['where'],{'$or':_[_0x4fb6('0x28')](_0x436d7a[_0x4fb6('0x30')],function(_0x588e3f){var _0x2ebb0c={};_0x2ebb0c[_0x588e3f]={'$like':'%'+_0x12a104[_0x4fb6('0x2b')]['filter']+'%'};return _0x2ebb0c;})});}_0x436d7a=_[_0x4fb6('0x37')]({},_0x436d7a,_0x12a104[_0x4fb6('0x3a')]);return _0x36beb0['getFields'](_0x436d7a);}})['then'](function(_0x217ba0){if(_0x217ba0){_0x351413=_0x217ba0[_0x4fb6('0x31')];if(!_0x12a104[_0x4fb6('0x2b')][_0x4fb6('0x32')](_0x4fb6('0x33'))){_0x436d7a[_0x4fb6('0x1b')]=qs[_0x4fb6('0x1b')](_0x12a104[_0x4fb6('0x2b')][_0x4fb6('0x1b')]);_0x436d7a[_0x4fb6('0x1a')]=qs[_0x4fb6('0x1a')](_0x12a104[_0x4fb6('0x2b')][_0x4fb6('0x1a')]);}return _0x36beb0['getFields'](_0x436d7a);}})[_0x4fb6('0x22')](function(_0x3f9d31){if(_0x3f9d31){return _0x3f9d31?{'count':_0x351413,'rows':_0x3f9d31}:null;}})[_0x4fb6('0x22')](respondWithResult(_0x4af3a7,null))[_0x4fb6('0x3e')](handleError(_0x4af3a7,null));};exports[_0x4fb6('0x4a')]=function(_0x18977e,_0x5ad0d2,_0x472d02){var _0x4e7e24={};var _0x299029={};var _0xb62821;var _0x27a59e;return db[_0x4fb6('0x3b')][_0x4fb6('0x4b')]({'where':{'id':_0x18977e[_0x4fb6('0x40')]['id']}})[_0x4fb6('0x22')](handleEntityNotFound(_0x5ad0d2,null))['then'](function(_0x542ca8){if(_0x542ca8){_0xb62821=_0x542ca8;_0x299029[_0x4fb6('0x2a')]=_[_0x4fb6('0x2c')](db['FreshdeskField'][_0x4fb6('0x41')]);_0x299029[_0x4fb6('0x2b')]=_[_0x4fb6('0x2c')](_0x18977e['query']);_0x299029[_0x4fb6('0x2d')]=_[_0x4fb6('0x2e')](_0x299029[_0x4fb6('0x2a')],_0x299029[_0x4fb6('0x2b')]);_0x4e7e24[_0x4fb6('0x30')]=_[_0x4fb6('0x2e')](_0x299029[_0x4fb6('0x2a')],qs['fields'](_0x18977e[_0x4fb6('0x2b')][_0x4fb6('0x2f')]));_0x4e7e24['attributes']=_0x4e7e24['attributes'][_0x4fb6('0x31')]?_0x4e7e24[_0x4fb6('0x30')]:_0x299029['model'];_0x4e7e24[_0x4fb6('0x34')]=qs['sort'](_0x18977e[_0x4fb6('0x2b')][_0x4fb6('0x35')]);_0x4e7e24[_0x4fb6('0x36')]=qs['filters'](_[_0x4fb6('0x49')](_0x18977e[_0x4fb6('0x2b')],_0x299029['filters']));if(_0x18977e[_0x4fb6('0x2b')][_0x4fb6('0x39')]){_0x4e7e24[_0x4fb6('0x36')]=_[_0x4fb6('0x37')](_0x4e7e24[_0x4fb6('0x36')],{'$or':_['map'](_0x4e7e24['attributes'],function(_0x5e0c37){var _0x4f9ac2={};_0x4f9ac2[_0x5e0c37]={'$like':'%'+_0x18977e[_0x4fb6('0x2b')][_0x4fb6('0x39')]+'%'};return _0x4f9ac2;})});}_0x4e7e24=_[_0x4fb6('0x37')]({},_0x4e7e24,_0x18977e[_0x4fb6('0x3a')]);return _0xb62821[_0x4fb6('0x4a')](_0x4e7e24);}})[_0x4fb6('0x22')](function(_0x108c5b){if(_0x108c5b){_0x27a59e=_0x108c5b[_0x4fb6('0x31')];if(!_0x18977e[_0x4fb6('0x2b')][_0x4fb6('0x32')](_0x4fb6('0x33'))){_0x4e7e24[_0x4fb6('0x1b')]=qs[_0x4fb6('0x1b')](_0x18977e[_0x4fb6('0x2b')][_0x4fb6('0x1b')]);_0x4e7e24[_0x4fb6('0x1a')]=qs[_0x4fb6('0x1a')](_0x18977e[_0x4fb6('0x2b')][_0x4fb6('0x1a')]);}return _0xb62821['getSubjects'](_0x4e7e24);}})[_0x4fb6('0x22')](function(_0x4a24bd){if(_0x4a24bd){return _0x4a24bd?{'count':_0x27a59e,'rows':_0x4a24bd}:null;}})[_0x4fb6('0x22')](respondWithResult(_0x5ad0d2,null))[_0x4fb6('0x3e')](handleError(_0x5ad0d2,null));};exports['getDescriptions']=function(_0x2fc0d3,_0x712e99,_0x43a010){var _0x43d474={};var _0x1ea776={};var _0x47952d;var _0x6c0cd6;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x2fc0d3['params']['id']}})['then'](handleEntityNotFound(_0x712e99,null))[_0x4fb6('0x22')](function(_0x56746c){if(_0x56746c){_0x47952d=_0x56746c;_0x1ea776['model']=_[_0x4fb6('0x2c')](db['FreshdeskField'][_0x4fb6('0x41')]);_0x1ea776[_0x4fb6('0x2b')]=_['keys'](_0x2fc0d3[_0x4fb6('0x2b')]);_0x1ea776['filters']=_[_0x4fb6('0x2e')](_0x1ea776[_0x4fb6('0x2a')],_0x1ea776[_0x4fb6('0x2b')]);_0x43d474['attributes']=_[_0x4fb6('0x2e')](_0x1ea776[_0x4fb6('0x2a')],qs['fields'](_0x2fc0d3[_0x4fb6('0x2b')][_0x4fb6('0x2f')]));_0x43d474['attributes']=_0x43d474[_0x4fb6('0x30')][_0x4fb6('0x31')]?_0x43d474[_0x4fb6('0x30')]:_0x1ea776['model'];_0x43d474[_0x4fb6('0x34')]=qs[_0x4fb6('0x35')](_0x2fc0d3[_0x4fb6('0x2b')][_0x4fb6('0x35')]);_0x43d474['where']=qs[_0x4fb6('0x2d')](_[_0x4fb6('0x49')](_0x2fc0d3[_0x4fb6('0x2b')],_0x1ea776[_0x4fb6('0x2d')]));if(_0x2fc0d3[_0x4fb6('0x2b')][_0x4fb6('0x39')]){_0x43d474[_0x4fb6('0x36')]=_[_0x4fb6('0x37')](_0x43d474['where'],{'$or':_[_0x4fb6('0x28')](_0x43d474[_0x4fb6('0x30')],function(_0x38a416){var _0x5f3d98={};_0x5f3d98[_0x38a416]={'$like':'%'+_0x2fc0d3[_0x4fb6('0x2b')]['filter']+'%'};return _0x5f3d98;})});}_0x43d474=_['merge']({},_0x43d474,_0x2fc0d3[_0x4fb6('0x3a')]);return _0x47952d['getDescriptions'](_0x43d474);}})['then'](function(_0x50043b){if(_0x50043b){_0x6c0cd6=_0x50043b['length'];if(!_0x2fc0d3[_0x4fb6('0x2b')][_0x4fb6('0x32')](_0x4fb6('0x33'))){_0x43d474[_0x4fb6('0x1b')]=qs[_0x4fb6('0x1b')](_0x2fc0d3[_0x4fb6('0x2b')]['limit']);_0x43d474[_0x4fb6('0x1a')]=qs[_0x4fb6('0x1a')](_0x2fc0d3[_0x4fb6('0x2b')][_0x4fb6('0x1a')]);}return _0x47952d[_0x4fb6('0x4c')](_0x43d474);}})[_0x4fb6('0x22')](function(_0x7b1b1a){if(_0x7b1b1a){return _0x7b1b1a?{'count':_0x6c0cd6,'rows':_0x7b1b1a}:null;}})['then'](respondWithResult(_0x712e99,null))[_0x4fb6('0x3e')](handleError(_0x712e99,null));};exports[_0x4fb6('0x4d')]=function(_0x2306cb,_0x49850c,_0x14d199){var _0x451bed={};var _0x2bd150={};var _0x16bd2f;var _0x213b60;return db['FreshdeskConfiguration'][_0x4fb6('0x4b')]({'where':{'id':_0x2306cb['params']['id']}})[_0x4fb6('0x22')](handleEntityNotFound(_0x49850c,null))[_0x4fb6('0x22')](function(_0x12feff){if(_0x12feff){_0x16bd2f=_0x12feff;_0x2bd150[_0x4fb6('0x2a')]=_[_0x4fb6('0x2c')](db[_0x4fb6('0x4e')]['rawAttributes']);_0x2bd150[_0x4fb6('0x2b')]=_[_0x4fb6('0x2c')](_0x2306cb[_0x4fb6('0x2b')]);_0x2bd150[_0x4fb6('0x2d')]=_['intersection'](_0x2bd150['model'],_0x2bd150[_0x4fb6('0x2b')]);_0x451bed[_0x4fb6('0x30')]=_['intersection'](_0x2bd150[_0x4fb6('0x2a')],qs[_0x4fb6('0x2f')](_0x2306cb['query'][_0x4fb6('0x2f')]));_0x451bed['attributes']=_0x451bed[_0x4fb6('0x30')][_0x4fb6('0x31')]?_0x451bed[_0x4fb6('0x30')]:_0x2bd150[_0x4fb6('0x2a')];_0x451bed[_0x4fb6('0x34')]=qs[_0x4fb6('0x35')](_0x2306cb['query'][_0x4fb6('0x35')]);_0x451bed[_0x4fb6('0x36')]=qs[_0x4fb6('0x2d')](_[_0x4fb6('0x49')](_0x2306cb['query'],_0x2bd150[_0x4fb6('0x2d')]));if(_0x2306cb[_0x4fb6('0x2b')][_0x4fb6('0x39')]){_0x451bed[_0x4fb6('0x36')]=_[_0x4fb6('0x37')](_0x451bed[_0x4fb6('0x36')],{'$or':_[_0x4fb6('0x28')](_0x451bed[_0x4fb6('0x30')],function(_0x3007f0){var _0x5c0ef8={};_0x5c0ef8[_0x3007f0]={'$like':'%'+_0x2306cb[_0x4fb6('0x2b')]['filter']+'%'};return _0x5c0ef8;})});}_0x451bed=_[_0x4fb6('0x37')]({},_0x451bed,_0x2306cb[_0x4fb6('0x3a')]);return _0x16bd2f[_0x4fb6('0x4d')](_0x451bed);}})['then'](function(_0x1079d8){if(_0x1079d8){_0x213b60=_0x1079d8['length'];if(!_0x2306cb[_0x4fb6('0x2b')][_0x4fb6('0x32')](_0x4fb6('0x33'))){_0x451bed['limit']=qs['limit'](_0x2306cb[_0x4fb6('0x2b')]['limit']);_0x451bed[_0x4fb6('0x1a')]=qs[_0x4fb6('0x1a')](_0x2306cb[_0x4fb6('0x2b')]['offset']);}return _0x16bd2f[_0x4fb6('0x4d')](_0x451bed);}})[_0x4fb6('0x22')](function(_0xe43e30){if(_0xe43e30){return _0xe43e30?{'count':_0x213b60,'rows':_0xe43e30}:null;}})[_0x4fb6('0x22')](respondWithResult(_0x49850c,null))[_0x4fb6('0x3e')](handleError(_0x49850c,null));};exports['setTags']=function(_0x477b81,_0x10442a,_0x19d906){if(_0x477b81['body']['id']){delete _0x477b81[_0x4fb6('0x45')]['id'];}return db[_0x4fb6('0x3b')][_0x4fb6('0x4b')]({'where':{'id':_0x477b81[_0x4fb6('0x40')]['id']}})[_0x4fb6('0x22')](handleEntityNotFound(_0x10442a,null))[_0x4fb6('0x22')](function(_0x239fa5){if(_0x239fa5){return _0x239fa5[_0x4fb6('0x4f')](_0x477b81[_0x4fb6('0x45')][_0x4fb6('0x50')]||[]);}return null;})[_0x4fb6('0x22')](respondWithResult(_0x10442a,null))[_0x4fb6('0x3e')](handleError(_0x10442a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8dc8859..10b4241 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 _0x1ce5=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x421b58,_0x30e951){var _0x4f5339=function(_0x1a0fb2){while(--_0x1a0fb2){_0x421b58['push'](_0x421b58['shift']());}};_0x4f5339(++_0x30e951);}(_0x1ce5,0x73));var _0x51ce=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x1ce5[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x51ce('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x51ce('0x1'));var moment=require(_0x51ce('0x2'));var BPromise=require('bluebird');var rp=require(_0x51ce('0x3'));var fs=require('fs');var path=require(_0x51ce('0x4'));var rimraf=require(_0x51ce('0x5'));var config=require(_0x51ce('0x6'));var attributes=require(_0x51ce('0x7'));module[_0x51ce('0x8')]=function(_0x4f2bb8,_0x55b84c){return _0x4f2bb8[_0x51ce('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x51ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdb2=['api','bluebird','path','rimraf','../../config/environment','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x1bf6e4,_0x3721e8){var _0x44adec=function(_0x530d95){while(--_0x530d95){_0x1bf6e4['push'](_0x1bf6e4['shift']());}};_0x44adec(++_0x3721e8);}(_0xcdb2,0xfa));var _0x2cdb=function(_0x5d1cc4,_0x1cbd9d){_0x5d1cc4=_0x5d1cc4-0x0;var _0xe07bd1=_0xcdb2[_0x5d1cc4];return _0xe07bd1;};'use strict';var _=require(_0x2cdb('0x0'));var util=require(_0x2cdb('0x1'));var logger=require(_0x2cdb('0x2'))(_0x2cdb('0x3'));var moment=require('moment');var BPromise=require(_0x2cdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cdb('0x5'));var rimraf=require(_0x2cdb('0x6'));var config=require(_0x2cdb('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x2cdb('0x8')]=function(_0x17e31d,_0x5e9018){return _0x17e31d[_0x2cdb('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x2cdb('0xa'),'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 5526aaf..8f03de8 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 _0x32f4=['request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x2c0c1f,_0xb8e832){var _0x371cf9=function(_0x4f3de7){while(--_0x4f3de7){_0x2c0c1f['push'](_0x2c0c1f['shift']());}};_0x371cf9(++_0xb8e832);}(_0x32f4,0x69));var _0x432f=function(_0x442ff0,_0x4249fc){_0x442ff0=_0x442ff0-0x0;var _0x820e60=_0x32f4[_0x442ff0];return _0x820e60;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require(_0x432f('0x4'));var fs=require('fs');var Redis=require(_0x432f('0x5'));var db=require(_0x432f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2184c3,_0x49e953,_0x36a0f1){return new BPromise(function(_0x294615,_0x13d9e9){return client[_0x432f('0xb')](_0x2184c3,_0x36a0f1)[_0x432f('0xc')](function(_0x344148){logger[_0x432f('0xd')](_0x432f('0xe'),_0x49e953,_0x432f('0xf'));logger[_0x432f('0x10')](_0x432f('0x11'),_0x49e953,_0x432f('0xf'),JSON[_0x432f('0x12')](_0x344148));if(_0x344148['error']){if(_0x344148['error'][_0x432f('0x13')]===0x1f4){logger[_0x432f('0x14')](_0x432f('0xe'),_0x49e953,_0x344148[_0x432f('0x14')]['message']);return _0x13d9e9(_0x344148['error'][_0x432f('0x15')]);}logger['error'](_0x432f('0xe'),_0x49e953,_0x344148[_0x432f('0x14')]['message']);return _0x294615(_0x344148[_0x432f('0x14')][_0x432f('0x15')]);}else{logger[_0x432f('0xd')](_0x432f('0xe'),_0x49e953,_0x432f('0xf'));_0x294615(_0x344148[_0x432f('0x16')][_0x432f('0x15')]);}})[_0x432f('0x17')](function(_0x31ab63){logger[_0x432f('0x14')](_0x432f('0xe'),_0x49e953,_0x31ab63);_0x13d9e9(_0x31ab63);});});} \ No newline at end of file +var _0x7b2a=['debug','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x5e45aa,_0x5e9db5){var _0x23c617=function(_0x191c67){while(--_0x191c67){_0x5e45aa['push'](_0x5e45aa['shift']());}};_0x23c617(++_0x5e9db5);}(_0x7b2a,0x92));var _0xa7b2=function(_0xf58ba6,_0x410c6b){_0xf58ba6=_0xf58ba6-0x0;var _0xc449a8=_0x7b2a[_0xf58ba6];return _0xc449a8;};'use strict';var _=require(_0xa7b2('0x0'));var util=require(_0xa7b2('0x1'));var moment=require(_0xa7b2('0x2'));var BPromise=require(_0xa7b2('0x3'));var rs=require(_0xa7b2('0x4'));var fs=require('fs');var Redis=require(_0xa7b2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa7b2('0x6'))(_0xa7b2('0x7'));var config=require(_0xa7b2('0x8'));var jayson=require(_0xa7b2('0x9'));var client=jayson['client'][_0xa7b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd1dc03,_0x19433a,_0x28fca1){return new BPromise(function(_0x8e98d9,_0x12ad45){return client[_0xa7b2('0xb')](_0xd1dc03,_0x28fca1)[_0xa7b2('0xc')](function(_0x1b223d){logger[_0xa7b2('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x19433a,_0xa7b2('0xe'));logger[_0xa7b2('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x19433a,_0xa7b2('0xe'),JSON[_0xa7b2('0x10')](_0x1b223d));if(_0x1b223d[_0xa7b2('0x11')]){if(_0x1b223d[_0xa7b2('0x11')][_0xa7b2('0x12')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x19433a,_0x1b223d[_0xa7b2('0x11')][_0xa7b2('0x13')]);return _0x12ad45(_0x1b223d[_0xa7b2('0x11')][_0xa7b2('0x13')]);}logger['error'](_0xa7b2('0x14'),_0x19433a,_0x1b223d[_0xa7b2('0x11')][_0xa7b2('0x13')]);return _0x8e98d9(_0x1b223d['error'][_0xa7b2('0x13')]);}else{logger[_0xa7b2('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x19433a,_0xa7b2('0xe'));_0x8e98d9(_0x1b223d[_0xa7b2('0x15')][_0xa7b2('0x13')]);}})[_0xa7b2('0x16')](function(_0x4aa290){logger['error'](_0xa7b2('0x14'),_0x19433a,_0x4aa290);_0x12ad45(_0x4aa290);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 31088ba..2c1c887 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 _0xef66=['post','delete','destroy','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x3bb4bf,_0x3b93d5){var _0x2700c0=function(_0x3cec67){while(--_0x3cec67){_0x3bb4bf['push'](_0x3bb4bf['shift']());}};_0x2700c0(++_0x3b93d5);}(_0xef66,0x1e4));var _0x6ef6=function(_0x49415b,_0x1f036a){_0x49415b=_0x49415b-0x0;var _0x37c65e=_0xef66[_0x49415b];return _0x37c65e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6ef6('0x0'));var timeout=require(_0x6ef6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ef6('0x2'));var auth=require(_0x6ef6('0x3'));var interaction=require(_0x6ef6('0x4'));var config=require('../../config/environment');var controller=require(_0x6ef6('0x5'));router[_0x6ef6('0x6')]('/',auth[_0x6ef6('0x7')](),controller[_0x6ef6('0x8')]);router['get'](_0x6ef6('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6ef6('0xa')]('/',auth[_0x6ef6('0x7')](),controller['create']);router['put'](_0x6ef6('0x9'),auth[_0x6ef6('0x7')](),controller['update']);router[_0x6ef6('0xb')]('/:id',auth[_0x6ef6('0x7')](),controller[_0x6ef6('0xc')]);module['exports']=router; \ No newline at end of file +var _0x2785=['create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x55affd,_0xaa69f4){var _0x3cc6c5=function(_0x28bbc4){while(--_0x28bbc4){_0x55affd['push'](_0x55affd['shift']());}};_0x3cc6c5(++_0xaa69f4);}(_0x2785,0x76));var _0x5278=function(_0x23e4cf,_0x12704d){_0x23e4cf=_0x23e4cf-0x0;var _0x2bd35a=_0x2785[_0x23e4cf];return _0x2bd35a;};'use strict';var multer=require('multer');var util=require(_0x5278('0x0'));var path=require(_0x5278('0x1'));var timeout=require(_0x5278('0x2'));var express=require(_0x5278('0x3'));var router=express[_0x5278('0x4')]();var fs_extra=require(_0x5278('0x5'));var auth=require(_0x5278('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5278('0x7'));var controller=require(_0x5278('0x8'));router[_0x5278('0x9')]('/',auth[_0x5278('0xa')](),controller[_0x5278('0xb')]);router['get'](_0x5278('0xc'),auth['isAuthenticated'](),controller[_0x5278('0xd')]);router[_0x5278('0xe')]('/',auth[_0x5278('0xa')](),controller[_0x5278('0xf')]);router[_0x5278('0x10')](_0x5278('0xc'),auth[_0x5278('0xa')](),controller['update']);router[_0x5278('0x11')](_0x5278('0xc'),auth[_0x5278('0xa')](),controller[_0x5278('0x12')]);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 6c51975..b4bd524 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 _0x56cb=['exports','string','variable','customVariable','STRING','ENUM'];(function(_0x3b8f3d,_0x3783f0){var _0x3c4cd3=function(_0x572ef2){while(--_0x572ef2){_0x3b8f3d['push'](_0x3b8f3d['shift']());}};_0x3c4cd3(++_0x3783f0);}(_0x56cb,0x6c));var _0xb56c=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x56cb[_0x1daaa9];return _0x1dd221;};'use strict';var Sequelize=require('sequelize');module[_0xb56c('0x0')]={'type':{'type':Sequelize['ENUM'](_0xb56c('0x1'),_0xb56c('0x2'),_0xb56c('0x3'),'keyValue','picklist'),'defaultValue':_0xb56c('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb56c('0x4')]},'keyType':{'type':Sequelize[_0xb56c('0x5')]('string',_0xb56c('0x2'),_0xb56c('0x3'))},'keyContent':{'type':Sequelize[_0xb56c('0x4')]},'idField':{'type':Sequelize[_0xb56c('0x4')]},'nameField':{'type':Sequelize[_0xb56c('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb56c('0x4')]}}; \ No newline at end of file +var _0xae11=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x303a53,_0x95347d){var _0x1a8d03=function(_0x5f08f8){while(--_0x5f08f8){_0x303a53['push'](_0x303a53['shift']());}};_0x1a8d03(++_0x95347d);}(_0xae11,0x17b));var _0x1ae1=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0xae11[_0x57cb4f];return _0x29bb45;};'use strict';var Sequelize=require(_0x1ae1('0x0'));module[_0x1ae1('0x1')]={'type':{'type':Sequelize[_0x1ae1('0x2')](_0x1ae1('0x3'),_0x1ae1('0x4'),_0x1ae1('0x5'),_0x1ae1('0x6'),_0x1ae1('0x7')),'defaultValue':_0x1ae1('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1ae1('0x8')]},'keyType':{'type':Sequelize[_0x1ae1('0x2')]('string',_0x1ae1('0x4'),_0x1ae1('0x5'))},'keyContent':{'type':Sequelize[_0x1ae1('0x8')]},'idField':{'type':Sequelize[_0x1ae1('0x8')]},'nameField':{'type':Sequelize[_0x1ae1('0x8')]},'customField':{'type':Sequelize[_0x1ae1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1ae1('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index bba771e..8f7dd8f 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 _0xad95=['offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','FreshdeskField','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x31ed74,_0x96d0de){var _0x260f84=function(_0x49e5f2){while(--_0x49e5f2){_0x31ed74['push'](_0x31ed74['shift']());}};_0x260f84(++_0x96d0de);}(_0xad95,0x70));var _0x5ad9=function(_0x3677c0,_0x377bb8){_0x3677c0=_0x3677c0-0x0;var _0x5475f1=_0xad95[_0x3677c0];return _0x5475f1;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('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(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){_0x5b816d[_0x5ad9('0x14')](0xcc)[_0x5ad9('0x20')]();});}};}function handleEntityNotFound(_0x1252e6,_0x36da5f){return function(_0x11d919){if(!_0x11d919){_0x1252e6['sendStatus'](0x194);}return _0x11d919;};}function handleError(_0x54e9dd,_0xe6540f){_0xe6540f=_0xe6540f||0x1f4;return function(_0x4f3889){logger[_0x5ad9('0x21')](_0x4f3889['stack']);if(_0x4f3889[_0x5ad9('0x22')]){delete _0x4f3889['name'];}_0x54e9dd['status'](_0xe6540f)[_0x5ad9('0x23')](_0x4f3889);};}exports[_0x5ad9('0x24')]=function(_0x49b3df,_0x509d41){var _0x3942fa={},_0x129804={},_0x1b6faf={'count':0x0,'rows':[]};var _0x2ad078=_[_0x5ad9('0x25')](db[_0x5ad9('0x26')]['rawAttributes'],function(_0x132ec6){return{'name':_0x132ec6[_0x5ad9('0x27')],'type':_0x132ec6[_0x5ad9('0x28')][_0x5ad9('0x29')]};});_0x129804['model']=_['map'](_0x2ad078,_0x5ad9('0x22'));_0x129804[_0x5ad9('0x2a')]=_['keys'](_0x49b3df['query']);_0x129804['filters']=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],_0x129804['query']);_0x3942fa[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],qs[_0x5ad9('0x2e')](_0x49b3df['query']['fields']));_0x3942fa[_0x5ad9('0x2d')]=_0x3942fa[_0x5ad9('0x2d')][_0x5ad9('0x2f')]?_0x3942fa[_0x5ad9('0x2d')]:_0x129804[_0x5ad9('0x2c')];if(!_0x49b3df['query'][_0x5ad9('0x30')](_0x5ad9('0x31'))){_0x3942fa[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x18')]);_0x3942fa['offset']=qs[_0x5ad9('0x16')](_0x49b3df[_0x5ad9('0x2a')]['offset']);}_0x3942fa[_0x5ad9('0x32')]=qs[_0x5ad9('0x33')](_0x49b3df['query'][_0x5ad9('0x33')]);_0x3942fa[_0x5ad9('0x34')]=qs[_0x5ad9('0x35')](_['pick'](_0x49b3df[_0x5ad9('0x2a')],_0x129804[_0x5ad9('0x35')]),_0x2ad078);if(_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x36')]){_0x3942fa['where']=_[_0x5ad9('0x37')](_0x3942fa[_0x5ad9('0x34')],{'$or':_[_0x5ad9('0x25')](_0x2ad078,function(_0x143700){if(_0x143700[_0x5ad9('0x28')]!==_0x5ad9('0x38')){var _0x1f0c06={};_0x1f0c06[_0x143700[_0x5ad9('0x22')]]={'$like':'%'+_0x49b3df[_0x5ad9('0x2a')]['filter']+'%'};return _0x1f0c06;}})});}_0x3942fa=_[_0x5ad9('0x37')]({},_0x3942fa,_0x49b3df[_0x5ad9('0x39')]);var _0x41d733={'where':_0x3942fa[_0x5ad9('0x34')]};return db[_0x5ad9('0x26')]['count'](_0x41d733)[_0x5ad9('0x1f')](function(_0xbbfaa0){_0x1b6faf[_0x5ad9('0x19')]=_0xbbfaa0;if(_0x49b3df['query'][_0x5ad9('0x3a')]){_0x3942fa[_0x5ad9('0x3b')]=[{'all':!![]}];}return db[_0x5ad9('0x26')]['findAll'](_0x3942fa);})[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x1b6faf['rows']=_0x5cfe5b;return _0x1b6faf;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x509d41,_0x3942fa))[_0x5ad9('0x3c')](handleError(_0x509d41,null));};exports[_0x5ad9('0x3d')]=function(_0x24f377,_0x5b8608){var _0x526fda={'raw':!![],'where':{'id':_0x24f377['params']['id']}},_0x552c39={};_0x552c39[_0x5ad9('0x2c')]=_['keys'](db[_0x5ad9('0x26')]['rawAttributes']);_0x552c39[_0x5ad9('0x2a')]=_[_0x5ad9('0x3e')](_0x24f377[_0x5ad9('0x2a')]);_0x552c39[_0x5ad9('0x35')]=_[_0x5ad9('0x2b')](_0x552c39[_0x5ad9('0x2c')],_0x552c39[_0x5ad9('0x2a')]);_0x526fda[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x552c39['model'],qs[_0x5ad9('0x2e')](_0x24f377[_0x5ad9('0x2a')][_0x5ad9('0x2e')]));_0x526fda[_0x5ad9('0x2d')]=_0x526fda[_0x5ad9('0x2d')]['length']?_0x526fda[_0x5ad9('0x2d')]:_0x552c39['model'];if(_0x24f377['query']['includeAll']){_0x526fda[_0x5ad9('0x3b')]=[{'all':!![]}];}_0x526fda=_[_0x5ad9('0x37')]({},_0x526fda,_0x24f377[_0x5ad9('0x39')]);return db['FreshdeskField'][_0x5ad9('0x3f')](_0x526fda)[_0x5ad9('0x1f')](handleEntityNotFound(_0x5b8608,null))[_0x5ad9('0x1f')](respondWithResult(_0x5b8608,null))[_0x5ad9('0x3c')](handleError(_0x5b8608,null));};exports['create']=function(_0x126086,_0x420677){return db[_0x5ad9('0x26')][_0x5ad9('0x40')](_0x126086['body'],{})[_0x5ad9('0x1f')](respondWithResult(_0x420677,0xc9))[_0x5ad9('0x3c')](handleError(_0x420677,null));};exports[_0x5ad9('0x1d')]=function(_0x1e03f,_0x479bbc){if(_0x1e03f[_0x5ad9('0x41')]['id']){delete _0x1e03f[_0x5ad9('0x41')]['id'];}return db['FreshdeskField'][_0x5ad9('0x3f')]({'where':{'id':_0x1e03f['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x479bbc,null))[_0x5ad9('0x1f')](saveUpdates(_0x1e03f[_0x5ad9('0x41')],null))[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,null))[_0x5ad9('0x3c')](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1e')]=function(_0xa0f426,_0x2c3945){return db[_0x5ad9('0x26')][_0x5ad9('0x3f')]({'where':{'id':_0xa0f426[_0x5ad9('0x42')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x2c3945,null))[_0x5ad9('0x1f')](removeEntity(_0x2c3945,null))[_0x5ad9('0x3c')](handleError(_0x2c3945,null));}; \ No newline at end of file +var _0x76dc=['body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','FreshdeskField','includeAll','include','rows','params','options','find','catch','create'];(function(_0x24abf9,_0x477120){var _0x151b4a=function(_0x26eb17){while(--_0x26eb17){_0x24abf9['push'](_0x24abf9['shift']());}};_0x151b4a(++_0x477120);}(_0x76dc,0x1f2));var _0xc76d=function(_0x4066cf,_0x3ecc60){_0x4066cf=_0x4066cf-0x0;var _0x3181a6=_0x76dc[_0x4066cf];return _0x3181a6;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x55ca79,_0x374b9e){return function(_0x476aee){if(!_0x476aee){_0x55ca79[_0xc76d('0x17')](0x194);}return _0x476aee;};}function handleError(_0xd1dda0,_0xfc4aea){_0xfc4aea=_0xfc4aea||0x1f4;return function(_0x1949c4){logger[_0xc76d('0x26')](_0x1949c4['stack']);if(_0x1949c4['name']){delete _0x1949c4[_0xc76d('0x27')];}_0xd1dda0[_0xc76d('0x18')](_0xfc4aea)['send'](_0x1949c4);};}exports[_0xc76d('0x28')]=function(_0x52a79a,_0x64899f){var _0x49fa89={},_0x2039f4={},_0x5cf2e4={'count':0x0,'rows':[]};var _0x13b468=_[_0xc76d('0x29')](db['FreshdeskField'][_0xc76d('0x2a')],function(_0x1c68f3){return{'name':_0x1c68f3[_0xc76d('0x2b')],'type':_0x1c68f3[_0xc76d('0x2c')]['key']};});_0x2039f4[_0xc76d('0x2d')]=_['map'](_0x13b468,_0xc76d('0x27'));_0x2039f4['query']=_[_0xc76d('0x2e')](_0x52a79a[_0xc76d('0x2f')]);_0x2039f4['filters']=_['intersection'](_0x2039f4['model'],_0x2039f4['query']);_0x49fa89[_0xc76d('0x30')]=_[_0xc76d('0x31')](_0x2039f4[_0xc76d('0x2d')],qs[_0xc76d('0x32')](_0x52a79a[_0xc76d('0x2f')]['fields']));_0x49fa89[_0xc76d('0x30')]=_0x49fa89['attributes'][_0xc76d('0x33')]?_0x49fa89['attributes']:_0x2039f4[_0xc76d('0x2d')];if(!_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x34')](_0xc76d('0x35'))){_0x49fa89[_0xc76d('0x1d')]=qs['limit'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1d')]);_0x49fa89[_0xc76d('0x1c')]=qs['offset'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1c')]);}_0x49fa89[_0xc76d('0x36')]=qs['sort'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x37')]);_0x49fa89[_0xc76d('0x38')]=qs[_0xc76d('0x39')](_[_0xc76d('0x3a')](_0x52a79a[_0xc76d('0x2f')],_0x2039f4['filters']),_0x13b468);if(_0x52a79a['query'][_0xc76d('0x3b')]){_0x49fa89['where']=_[_0xc76d('0x3c')](_0x49fa89[_0xc76d('0x38')],{'$or':_[_0xc76d('0x29')](_0x13b468,function(_0x1925a1){if(_0x1925a1['type']!=='VIRTUAL'){var _0xc907eb={};_0xc907eb[_0x1925a1[_0xc76d('0x27')]]={'$like':'%'+_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3b')]+'%'};return _0xc907eb;}})});}_0x49fa89=_[_0xc76d('0x3c')]({},_0x49fa89,_0x52a79a['options']);var _0x42404c={'where':_0x49fa89[_0xc76d('0x38')]};return db[_0xc76d('0x3d')][_0xc76d('0x1b')](_0x42404c)[_0xc76d('0x24')](function(_0x78e14a){_0x5cf2e4[_0xc76d('0x1b')]=_0x78e14a;if(_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3e')]){_0x49fa89[_0xc76d('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x49fa89);})[_0xc76d('0x24')](function(_0x2a0759){_0x5cf2e4[_0xc76d('0x40')]=_0x2a0759;return _0x5cf2e4;})[_0xc76d('0x24')](respondWithFilteredResult(_0x64899f,_0x49fa89))['catch'](handleError(_0x64899f,null));};exports['show']=function(_0x45be72,_0x13a895){var _0x3e471e={'raw':!![],'where':{'id':_0x45be72[_0xc76d('0x41')]['id']}},_0x15eb42={};_0x15eb42[_0xc76d('0x2d')]=_[_0xc76d('0x2e')](db[_0xc76d('0x3d')]['rawAttributes']);_0x15eb42[_0xc76d('0x2f')]=_[_0xc76d('0x2e')](_0x45be72[_0xc76d('0x2f')]);_0x15eb42[_0xc76d('0x39')]=_['intersection'](_0x15eb42['model'],_0x15eb42['query']);_0x3e471e['attributes']=_['intersection'](_0x15eb42['model'],qs['fields'](_0x45be72[_0xc76d('0x2f')][_0xc76d('0x32')]));_0x3e471e[_0xc76d('0x30')]=_0x3e471e[_0xc76d('0x30')][_0xc76d('0x33')]?_0x3e471e[_0xc76d('0x30')]:_0x15eb42[_0xc76d('0x2d')];if(_0x45be72[_0xc76d('0x2f')]['includeAll']){_0x3e471e[_0xc76d('0x3f')]=[{'all':!![]}];}_0x3e471e=_[_0xc76d('0x3c')]({},_0x3e471e,_0x45be72[_0xc76d('0x42')]);return db[_0xc76d('0x3d')][_0xc76d('0x43')](_0x3e471e)[_0xc76d('0x24')](handleEntityNotFound(_0x13a895,null))[_0xc76d('0x24')](respondWithResult(_0x13a895,null))[_0xc76d('0x44')](handleError(_0x13a895,null));};exports[_0xc76d('0x45')]=function(_0x4fb26e,_0x5b41d3){return db[_0xc76d('0x3d')][_0xc76d('0x45')](_0x4fb26e[_0xc76d('0x46')],{})[_0xc76d('0x24')](respondWithResult(_0x5b41d3,0xc9))[_0xc76d('0x44')](handleError(_0x5b41d3,null));};exports['update']=function(_0x25fc9d,_0x1ede13){if(_0x25fc9d['body']['id']){delete _0x25fc9d['body']['id'];}return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25fc9d['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x1ede13,null))[_0xc76d('0x24')](saveUpdates(_0x25fc9d[_0xc76d('0x46')],null))[_0xc76d('0x24')](respondWithResult(_0x1ede13,null))[_0xc76d('0x44')](handleError(_0x1ede13,null));};exports[_0xc76d('0x25')]=function(_0x25a549,_0x10b1b0){return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25a549['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x10b1b0,null))[_0xc76d('0x24')](removeEntity(_0x10b1b0,null))[_0xc76d('0x44')](handleError(_0x10b1b0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 5e01b8a..83fc12a 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 _0x677f=['idField','lodash','util','api','moment','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x39c51e,_0x2cd366){var _0x595842=function(_0x59d47e){while(--_0x59d47e){_0x39c51e['push'](_0x39c51e['shift']());}};_0x595842(++_0x2cd366);}(_0x677f,0xf8));var _0xf677=function(_0xdba1a,_0xc401fd){_0xdba1a=_0xdba1a-0x0;var _0x2d0d34=_0x677f[_0xdba1a];return _0x2d0d34;};'use strict';var _=require(_0xf677('0x0'));var util=require(_0xf677('0x1'));var logger=require('../../config/logger')(_0xf677('0x2'));var moment=require(_0xf677('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf677('0x4'));var rimraf=require(_0xf677('0x5'));var config=require(_0xf677('0x6'));var attributes=require(_0xf677('0x7'));module[_0xf677('0x8')]=function(_0x468326,_0xbc05c5){return _0x468326[_0xf677('0x9')]('FreshdeskField',attributes,{'tableName':_0xf677('0xa'),'paranoid':![],'indexes':[{'name':_0xf677('0xb'),'fields':[_0xf677('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd0=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','rimraf','./intFreshdeskField.attributes'];(function(_0x49f66e,_0x3e2369){var _0x55a1e2=function(_0x50bccd){while(--_0x50bccd){_0x49f66e['push'](_0x49f66e['shift']());}};_0x55a1e2(++_0x3e2369);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xcdd0[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var logger=require(_0x0cdd('0x2'))(_0x0cdd('0x3'));var moment=require('moment');var BPromise=require(_0x0cdd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0cdd('0x5'));var config=require('../../config/environment');var attributes=require(_0x0cdd('0x6'));module[_0x0cdd('0x7')]=function(_0xe80a73,_0x5ca0f9){return _0xe80a73[_0x0cdd('0x8')](_0x0cdd('0x9'),attributes,{'tableName':_0x0cdd('0xa'),'paranoid':![],'indexes':[{'name':_0x0cdd('0xb'),'fields':[_0x0cdd('0xc'),_0x0cdd('0xd')],'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 55f6a4a..cacf281 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 _0x20fe=['stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x209511,_0x231622){var _0x39b937=function(_0x4005a3){while(--_0x4005a3){_0x209511['push'](_0x209511['shift']());}};_0x39b937(++_0x231622);}(_0x20fe,0x130));var _0xe20f=function(_0x319760,_0x44458d){_0x319760=_0x319760-0x0;var _0x4871c3=_0x20fe[_0x319760];return _0x4871c3;};'use strict';var _=require(_0xe20f('0x0'));var util=require(_0xe20f('0x1'));var moment=require(_0xe20f('0x2'));var BPromise=require(_0xe20f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe20f('0x4'));var db=require(_0xe20f('0x5'))['db'];var utils=require(_0xe20f('0x6'));var logger=require(_0xe20f('0x7'))(_0xe20f('0x8'));var config=require(_0xe20f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe20f('0xa')][_0xe20f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d2066,_0x3a2770,_0x1c163f){return new BPromise(function(_0x5af2d7,_0x55375b){return client[_0xe20f('0xc')](_0x1d2066,_0x1c163f)[_0xe20f('0xd')](function(_0x5eaee2){logger[_0xe20f('0xe')](_0xe20f('0xf'),_0x3a2770,'request\x20sent');logger[_0xe20f('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3a2770,_0xe20f('0x11'),JSON[_0xe20f('0x12')](_0x5eaee2));if(_0x5eaee2[_0xe20f('0x13')]){if(_0x5eaee2[_0xe20f('0x13')][_0xe20f('0x14')]===0x1f4){logger[_0xe20f('0x13')](_0xe20f('0xf'),_0x3a2770,_0x5eaee2[_0xe20f('0x13')][_0xe20f('0x15')]);return _0x55375b(_0x5eaee2[_0xe20f('0x13')]['message']);}logger[_0xe20f('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x3a2770,_0x5eaee2[_0xe20f('0x13')]['message']);return _0x5af2d7(_0x5eaee2[_0xe20f('0x13')]['message']);}else{logger[_0xe20f('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x3a2770,_0xe20f('0x11'));_0x5af2d7(_0x5eaee2['result'][_0xe20f('0x15')]);}})[_0xe20f('0x16')](function(_0x3eb9aa){logger[_0xe20f('0x13')](_0xe20f('0xf'),_0x3a2770,_0x3eb9aa);_0x55375b(_0x3eb9aa);});});} \ No newline at end of file +var _0xcb4c=['info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x30fa09,_0x28c43d){var _0x2032db=function(_0x40dcc9){while(--_0x40dcc9){_0x30fa09['push'](_0x30fa09['shift']());}};_0x2032db(++_0x28c43d);}(_0xcb4c,0x126));var _0xccb4=function(_0x90775f,_0x3f9fa1){_0x90775f=_0x90775f-0x0;var _0x134c7d=_0xcb4c[_0x90775f];return _0x134c7d;};'use strict';var _=require('lodash');var util=require(_0xccb4('0x0'));var moment=require(_0xccb4('0x1'));var BPromise=require('bluebird');var rs=require(_0xccb4('0x2'));var fs=require('fs');var Redis=require(_0xccb4('0x3'));var db=require(_0xccb4('0x4'))['db'];var utils=require(_0xccb4('0x5'));var logger=require(_0xccb4('0x6'))(_0xccb4('0x7'));var config=require(_0xccb4('0x8'));var jayson=require(_0xccb4('0x9'));var client=jayson[_0xccb4('0xa')][_0xccb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cb27b,_0x4092b4,_0x32ee87){return new BPromise(function(_0x545e89,_0xc321a1){return client[_0xccb4('0xc')](_0x4cb27b,_0x32ee87)[_0xccb4('0xd')](function(_0x33818d){logger[_0xccb4('0xe')](_0xccb4('0xf'),_0x4092b4,'request\x20sent');logger[_0xccb4('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4092b4,_0xccb4('0x11'),JSON[_0xccb4('0x12')](_0x33818d));if(_0x33818d[_0xccb4('0x13')]){if(_0x33818d[_0xccb4('0x13')][_0xccb4('0x14')]===0x1f4){logger[_0xccb4('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x4092b4,_0x33818d[_0xccb4('0x13')][_0xccb4('0x15')]);return _0xc321a1(_0x33818d[_0xccb4('0x13')][_0xccb4('0x15')]);}logger[_0xccb4('0x13')](_0xccb4('0xf'),_0x4092b4,_0x33818d[_0xccb4('0x13')][_0xccb4('0x15')]);return _0x545e89(_0x33818d['error'][_0xccb4('0x15')]);}else{logger[_0xccb4('0xe')](_0xccb4('0xf'),_0x4092b4,_0xccb4('0x11'));_0x545e89(_0x33818d['result'][_0xccb4('0x15')]);}})['catch'](function(_0x16f23e){logger[_0xccb4('0x13')](_0xccb4('0xf'),_0x4092b4,_0x16f23e);_0xc321a1(_0x16f23e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 7d16e61..53ae3e1 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 _0xf7b4=['destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf7b4,0x152));var _0x4f7b=function(_0x366783,_0x339fd8){_0x366783=_0x366783-0x0;var _0x3562b7=_0xf7b4[_0x366783];return _0x3562b7;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/fields',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);router['post'](_0x4f7b('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x4f7b('0x11')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['delete'](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x13')]);module[_0x4f7b('0x14')]=router; \ No newline at end of file +var _0xcb91=['addConfiguration','update','delete','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x312aad,_0x495b70){var _0x99c6cf=function(_0x20a295){while(--_0x20a295){_0x312aad['push'](_0x312aad['shift']());}};_0x99c6cf(++_0x495b70);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xcb91[_0x1d70db];return _0x3060c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller['destroy']);module[_0x1cb9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 3785e2f..df78511 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 _0x6a55=['STRING','sequelize'];(function(_0x3f3f44,_0x2a3574){var _0xeedf00=function(_0x513427){while(--_0x513427){_0x3f3f44['push'](_0x3f3f44['shift']());}};_0xeedf00(++_0x2a3574);}(_0x6a55,0xdb));var _0x56a5=function(_0x55e059,_0x2df2c5){_0x55e059=_0x55e059-0x0;var _0x1e6bb7=_0x6a55[_0x55e059];return _0x1e6bb7;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8f4c=['sequelize','exports','STRING','username','remoteUri'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8f4c,0x113));var _0xc8f4=function(_0x2d2e0d,_0x2bf907){_0x2d2e0d=_0x2d2e0d-0x0;var _0x103367=_0x8f4c[_0x2d2e0d];return _0x103367;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')]},'description':{'type':Sequelize[_0xc8f4('0x2')]},'username':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x4')},'serverUrl':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index eaebf6d..276bba6 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 _0x0e55=['merge','options','FreshsalesAccount','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','include','body','find','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','users','email','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0e55,0x8e));var _0x50e5=function(_0x4cca4f,_0x414aed){_0x4cca4f=_0x4cca4f-0x0;var _0x4bb584=_0x0e55[_0x4cca4f];return _0x4bb584;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x50e5('0x0'));var jsonpatch=require(_0x50e5('0x1'));var rp=require(_0x50e5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x50e5('0x3'));var util=require(_0x50e5('0x4'));var path=require(_0x50e5('0x5'));var sox=require(_0x50e5('0x6'));var csv=require(_0x50e5('0x7'));var ejs=require(_0x50e5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50e5('0x9'));var squel=require(_0x50e5('0xa'));var crypto=require(_0x50e5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x50e5('0xc'));var toCsv=require(_0x50e5('0x7'));var querystring=require(_0x50e5('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e5('0xe'));var authService=require(_0x50e5('0xf'));var qs=require(_0x50e5('0x10'));var as=require(_0x50e5('0x11'));var hardwareService=require(_0x50e5('0x12'));var logger=require(_0x50e5('0x13'))(_0x50e5('0x14'));var utils=require(_0x50e5('0x15'));var config=require(_0x50e5('0x16'));var licenseUtil=require(_0x50e5('0x17'));var db=require(_0x50e5('0x18'))['db'];var integrations=require(_0x50e5('0x19'));function respondWithStatusCode(_0x24dbbf,_0x5ccc51){_0x5ccc51=_0x5ccc51||0xcc;return function(_0x17fe90){if(_0x17fe90){return _0x24dbbf[_0x50e5('0x1a')](_0x5ccc51);}return _0x24dbbf['status'](_0x5ccc51)[_0x50e5('0x1b')]();};}function respondWithResult(_0x5c1643,_0x5ba80c){_0x5ba80c=_0x5ba80c||0xc8;return function(_0x552850){if(_0x552850){return _0x5c1643[_0x50e5('0x1c')](_0x5ba80c)[_0x50e5('0x1d')](_0x552850);}};}function respondWithFilteredResult(_0x1d5799,_0x4140dd){return function(_0x5ee3d3){if(_0x5ee3d3){var _0x4a67e5=typeof _0x4140dd[_0x50e5('0x1e')]===_0x50e5('0x1f')&&typeof _0x4140dd[_0x50e5('0x20')]===_0x50e5('0x1f');var _0x6d943=_0x5ee3d3[_0x50e5('0x21')];var _0x70fa75=_0x4a67e5?0x0:_0x4140dd[_0x50e5('0x1e')];var _0x4ca979=_0x4a67e5?_0x5ee3d3[_0x50e5('0x21')]:_0x4140dd[_0x50e5('0x1e')]+_0x4140dd[_0x50e5('0x20')];var _0x3b8102;if(_0x4ca979>=_0x6d943){_0x4ca979=_0x6d943;_0x3b8102=0xc8;}else{_0x3b8102=0xce;}_0x1d5799[_0x50e5('0x1c')](_0x3b8102);return _0x1d5799[_0x50e5('0x22')](_0x50e5('0x23'),_0x70fa75+'-'+_0x4ca979+'/'+_0x6d943)[_0x50e5('0x1d')](_0x5ee3d3);}return null;};}function patchUpdates(_0x3193d9){return function(_0x4257d9){try{jsonpatch['apply'](_0x4257d9,_0x3193d9,!![]);}catch(_0x54fd08){return BPromise[_0x50e5('0x24')](_0x54fd08);}return _0x4257d9['save']();};}function saveUpdates(_0x2987d1,_0x1e9b30){return function(_0x2f8386){if(_0x2f8386){return _0x2f8386[_0x50e5('0x25')](_0x2987d1)[_0x50e5('0x26')](function(_0x4f70fe){return _0x4f70fe;});}return null;};}function removeEntity(_0x9d0a02,_0x5adbbe){return function(_0x51d726){if(_0x51d726){return _0x51d726[_0x50e5('0x27')]()[_0x50e5('0x26')](function(){_0x9d0a02[_0x50e5('0x1c')](0xcc)[_0x50e5('0x1b')]();});}};}function handleEntityNotFound(_0x3d81d4,_0x46e3ed){return function(_0x549e80){if(!_0x549e80){_0x3d81d4[_0x50e5('0x1a')](0x194);}return _0x549e80;};}function handleError(_0x4f04a9,_0x3022a3){_0x3022a3=_0x3022a3||0x1f4;return function(_0x2d875f){logger[_0x50e5('0x28')](_0x2d875f[_0x50e5('0x29')]);if(_0x2d875f[_0x50e5('0x2a')]){delete _0x2d875f[_0x50e5('0x2a')];}_0x4f04a9[_0x50e5('0x1c')](_0x3022a3)['send'](_0x2d875f);};}exports['index']=function(_0x42c04d,_0x409419){var _0x94021={},_0x3fb39a={},_0x456f35={'count':0x0,'rows':[]};var _0x142c4d=_[_0x50e5('0x2b')](db['FreshsalesAccount']['rawAttributes'],function(_0x554a8f){return{'name':_0x554a8f[_0x50e5('0x2c')],'type':_0x554a8f[_0x50e5('0x2d')][_0x50e5('0x2e')]};});_0x3fb39a[_0x50e5('0x2f')]=_[_0x50e5('0x2b')](_0x142c4d,_0x50e5('0x2a'));_0x3fb39a[_0x50e5('0x30')]=_['keys'](_0x42c04d[_0x50e5('0x30')]);_0x3fb39a[_0x50e5('0x31')]=_[_0x50e5('0x32')](_0x3fb39a[_0x50e5('0x2f')],_0x3fb39a[_0x50e5('0x30')]);_0x94021['attributes']=_['intersection'](_0x3fb39a['model'],qs[_0x50e5('0x33')](_0x42c04d[_0x50e5('0x30')][_0x50e5('0x33')]));_0x94021[_0x50e5('0x34')]=_0x94021[_0x50e5('0x34')][_0x50e5('0x35')]?_0x94021[_0x50e5('0x34')]:_0x3fb39a['model'];if(!_0x42c04d[_0x50e5('0x30')][_0x50e5('0x36')](_0x50e5('0x37'))){_0x94021[_0x50e5('0x20')]=qs[_0x50e5('0x20')](_0x42c04d['query']['limit']);_0x94021[_0x50e5('0x1e')]=qs[_0x50e5('0x1e')](_0x42c04d['query']['offset']);}_0x94021[_0x50e5('0x38')]=qs[_0x50e5('0x39')](_0x42c04d['query'][_0x50e5('0x39')]);_0x94021[_0x50e5('0x3a')]=qs[_0x50e5('0x31')](_[_0x50e5('0x3b')](_0x42c04d[_0x50e5('0x30')],_0x3fb39a[_0x50e5('0x31')]),_0x142c4d);if(_0x42c04d[_0x50e5('0x30')][_0x50e5('0x3c')]){_0x94021[_0x50e5('0x3a')]=_['merge'](_0x94021[_0x50e5('0x3a')],{'$or':_['map'](_0x142c4d,function(_0x3a5751){if(_0x3a5751[_0x50e5('0x2d')]!==_0x50e5('0x3d')){var _0x5f4b08={};_0x5f4b08[_0x3a5751['name']]={'$like':'%'+_0x42c04d[_0x50e5('0x30')][_0x50e5('0x3c')]+'%'};return _0x5f4b08;}})});}_0x94021=_[_0x50e5('0x3e')]({},_0x94021,_0x42c04d[_0x50e5('0x3f')]);var _0x3f036d={'where':_0x94021['where']};return db[_0x50e5('0x40')][_0x50e5('0x21')](_0x3f036d)[_0x50e5('0x26')](function(_0x111b19){_0x456f35[_0x50e5('0x21')]=_0x111b19;if(_0x42c04d[_0x50e5('0x30')]['includeAll']){_0x94021['include']=[{'all':!![]}];}return db[_0x50e5('0x40')][_0x50e5('0x41')](_0x94021);})[_0x50e5('0x26')](function(_0x100541){_0x456f35[_0x50e5('0x42')]=_0x100541;return _0x456f35;})[_0x50e5('0x26')](respondWithFilteredResult(_0x409419,_0x94021))[_0x50e5('0x43')](handleError(_0x409419,null));};exports[_0x50e5('0x44')]=function(_0x98a631,_0xbd5056){var _0x1e080e={'raw':![],'where':{'id':_0x98a631[_0x50e5('0x45')]['id']}},_0x564dea={};_0x564dea[_0x50e5('0x2f')]=_[_0x50e5('0x46')](db[_0x50e5('0x40')][_0x50e5('0x47')]);_0x564dea[_0x50e5('0x30')]=_[_0x50e5('0x46')](_0x98a631['query']);_0x564dea[_0x50e5('0x31')]=_[_0x50e5('0x32')](_0x564dea[_0x50e5('0x2f')],_0x564dea[_0x50e5('0x30')]);_0x1e080e[_0x50e5('0x34')]=_[_0x50e5('0x32')](_0x564dea[_0x50e5('0x2f')],qs['fields'](_0x98a631['query']['fields']));_0x1e080e['attributes']=_0x1e080e['attributes']['length']?_0x1e080e[_0x50e5('0x34')]:_0x564dea['model'];if(_0x98a631['query'][_0x50e5('0x48')]){_0x1e080e[_0x50e5('0x49')]=[{'all':!![]}];}_0x1e080e=_[_0x50e5('0x3e')]({},_0x1e080e,_0x98a631['options']);return db[_0x50e5('0x40')]['find'](_0x1e080e)[_0x50e5('0x26')](handleEntityNotFound(_0xbd5056,null))['then'](respondWithResult(_0xbd5056,null))[_0x50e5('0x43')](handleError(_0xbd5056,null));};exports['create']=function(_0x2caa7e,_0x5e2d23){return db[_0x50e5('0x40')]['create'](_0x2caa7e['body'],{})['then'](respondWithResult(_0x5e2d23,0xc9))[_0x50e5('0x43')](handleError(_0x5e2d23,null));};exports[_0x50e5('0x25')]=function(_0x4fb072,_0x25f1a3){if(_0x4fb072[_0x50e5('0x4a')]['id']){delete _0x4fb072['body']['id'];}return db[_0x50e5('0x40')][_0x50e5('0x4b')]({'where':{'id':_0x4fb072[_0x50e5('0x45')]['id']}})['then'](handleEntityNotFound(_0x25f1a3,null))[_0x50e5('0x26')](saveUpdates(_0x4fb072['body'],null))[_0x50e5('0x26')](respondWithResult(_0x25f1a3,null))[_0x50e5('0x43')](handleError(_0x25f1a3,null));};exports['destroy']=function(_0x2dc1e5,_0x3242ca){return db[_0x50e5('0x40')][_0x50e5('0x4b')]({'where':{'id':_0x2dc1e5['params']['id']}})[_0x50e5('0x26')](handleEntityNotFound(_0x3242ca,null))[_0x50e5('0x26')](removeEntity(_0x3242ca,null))[_0x50e5('0x43')](handleError(_0x3242ca,null));};exports[_0x50e5('0x4c')]=function(_0x3012c6,_0x169182,_0x3e969f){var _0x4f6ffb={};var _0x311b9a={};var _0x4a7688;var _0x45d5c7;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x3012c6['params']['id']}})['then'](handleEntityNotFound(_0x169182,null))[_0x50e5('0x26')](function(_0x39564d){if(_0x39564d){_0x4a7688=_0x39564d;_0x311b9a[_0x50e5('0x2f')]=_[_0x50e5('0x46')](db[_0x50e5('0x4d')][_0x50e5('0x47')]);_0x311b9a[_0x50e5('0x30')]=_['keys'](_0x3012c6[_0x50e5('0x30')]);_0x311b9a[_0x50e5('0x31')]=_[_0x50e5('0x32')](_0x311b9a[_0x50e5('0x2f')],_0x311b9a['query']);_0x4f6ffb[_0x50e5('0x34')]=_['intersection'](_0x311b9a[_0x50e5('0x2f')],qs['fields'](_0x3012c6[_0x50e5('0x30')][_0x50e5('0x33')]));_0x4f6ffb[_0x50e5('0x34')]=_0x4f6ffb['attributes']['length']?_0x4f6ffb[_0x50e5('0x34')]:_0x311b9a[_0x50e5('0x2f')];_0x4f6ffb[_0x50e5('0x38')]=qs[_0x50e5('0x39')](_0x3012c6[_0x50e5('0x30')][_0x50e5('0x39')]);_0x4f6ffb[_0x50e5('0x3a')]=qs[_0x50e5('0x31')](_[_0x50e5('0x3b')](_0x3012c6[_0x50e5('0x30')],_0x311b9a['filters']));if(_0x3012c6[_0x50e5('0x30')][_0x50e5('0x3c')]){_0x4f6ffb[_0x50e5('0x3a')]=_[_0x50e5('0x3e')](_0x4f6ffb[_0x50e5('0x3a')],{'$or':_[_0x50e5('0x2b')](_0x4f6ffb[_0x50e5('0x34')],function(_0x4b8b18){var _0x38bd3c={};_0x38bd3c[_0x4b8b18]={'$like':'%'+_0x3012c6[_0x50e5('0x30')][_0x50e5('0x3c')]+'%'};return _0x38bd3c;})});}_0x4f6ffb=_[_0x50e5('0x3e')]({},_0x4f6ffb,_0x3012c6[_0x50e5('0x3f')]);return _0x4a7688[_0x50e5('0x4c')](_0x4f6ffb);}})[_0x50e5('0x26')](function(_0x17a6c9){if(_0x17a6c9){_0x45d5c7=_0x17a6c9[_0x50e5('0x35')];if(!_0x3012c6[_0x50e5('0x30')][_0x50e5('0x36')](_0x50e5('0x37'))){_0x4f6ffb[_0x50e5('0x20')]=qs[_0x50e5('0x20')](_0x3012c6[_0x50e5('0x30')]['limit']);_0x4f6ffb[_0x50e5('0x1e')]=qs[_0x50e5('0x1e')](_0x3012c6[_0x50e5('0x30')][_0x50e5('0x1e')]);}return _0x4a7688['getConfigurations'](_0x4f6ffb);}})[_0x50e5('0x26')](function(_0x2c6f7c){if(_0x2c6f7c){return _0x2c6f7c?{'count':_0x45d5c7,'rows':_0x2c6f7c}:null;}})['then'](respondWithResult(_0x169182,null))['catch'](handleError(_0x169182,null));};exports[_0x50e5('0x4e')]=function(_0x2fd777,_0x2cfd96,_0x3d60fa){if(_0x2fd777[_0x50e5('0x4a')]['id']){delete _0x2fd777[_0x50e5('0x4a')]['id'];}return db[_0x50e5('0x40')][_0x50e5('0x4f')]({'where':{'id':_0x2fd777[_0x50e5('0x45')]['id']}})[_0x50e5('0x26')](handleEntityNotFound(_0x2cfd96,null))[_0x50e5('0x26')](function(_0x27649f){if(_0x27649f){_0x2fd777[_0x50e5('0x4a')]['AccountId']=_0x27649f['id'];_0x2fd777['body'][_0x50e5('0x50')]=integrations[_0x50e5('0x51')](_0x2fd777[_0x50e5('0x4a')][_0x50e5('0x52')],_0x2fd777['body']['type']);_0x2fd777[_0x50e5('0x4a')]['Descriptions']=integrations[_0x50e5('0x53')](_0x2fd777['body']['channel'],_0x2fd777[_0x50e5('0x4a')][_0x50e5('0x2d')]);return db[_0x50e5('0x4d')]['create'](_0x2fd777['body'],{'include':[{'model':db[_0x50e5('0x54')],'as':'Subjects'},{'model':db[_0x50e5('0x54')],'as':_0x50e5('0x55')}]});}return null;})[_0x50e5('0x26')](respondWithResult(_0x2cfd96,null))[_0x50e5('0x43')](handleError(_0x2cfd96,null));};exports[_0x50e5('0x56')]=function(_0x22eaec,_0x21751a,_0x32a1aa){var _0x29678e='';var _0x10fe0b='';return db[_0x50e5('0x40')][_0x50e5('0x4f')]({'where':{'id':_0x22eaec[_0x50e5('0x45')]['id']},'attributes':['id',_0x50e5('0x57'),_0x50e5('0x58'),_0x50e5('0x59')]})[_0x50e5('0x26')](handleEntityNotFound(_0x21751a,null))[_0x50e5('0x26')](function(_0x2f9a6c){if(_0x2f9a6c){_0x10fe0b=_0x2f9a6c[_0x50e5('0x57')];_0x29678e=_0x2f9a6c[_0x50e5('0x58')];var _0x4eec9d=_0x2f9a6c[_0x50e5('0x58')][_0x50e5('0x5a')](-0x1);if(_0x4eec9d==='/'){_0x29678e=_0x29678e['substring'](0x0,_0x29678e[_0x50e5('0x5b')](_0x4eec9d));}return rp({'method':_0x50e5('0x5c'),'uri':util[_0x50e5('0x5d')](_0x50e5('0x5e'),_0x29678e,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x2f9a6c['apiKey']},'json':!![]});}})[_0x50e5('0x26')](function(_0x283c23){if(_0x283c23){var _0x4a2fd9=_0x283c23[_0x50e5('0x5f')];var _0x2b0976=![];var _0x25307e=null;for(_0x25307e=0x0;_0x25307e<_0x4a2fd9[_0x50e5('0x35')];_0x25307e++){if(_0x4a2fd9[_0x25307e][_0x50e5('0x60')]===_0x10fe0b){_0x2b0976=!![];}}if(_0x2b0976){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x50e5('0x26')](respondWithResult(_0x21751a,null))[_0x50e5('0x43')](function(_0x5b6548){var _0x5c1195=_0x22eaec[_0x50e5('0x30')][_0x50e5('0x61')]?0x1f4:_0x5b6548['statusCode']||0x1f4;logger[_0x50e5('0x28')](_0x50e5('0x62'),'getFields',_0x5c1195,JSON[_0x50e5('0x63')](_0x5b6548));delete _0x5b6548[_0x50e5('0x2a')];if(_0x5c1195===0x191){_0x5c1195=0x190;}_0x21751a['status'](_0x5c1195)[_0x50e5('0x64')](_0x22eaec['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x5b6548[_0x50e5('0x65')]}:_0x5b6548);});}; \ No newline at end of file +var _0x3231=['apply','reject','save','then','sendStatus','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','catch','show','params','rawAttributes','includeAll','include','find','create','update','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshsalesField','Subjects','Descriptions','username','apiKey','remoteUri','substring','GET','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields','stringify','test','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0x3231,0x16b));var _0x1323=function(_0x111452,_0x1b46c3){_0x111452=_0x111452-0x0;var _0x43d6f5=_0x3231[_0x111452];return _0x43d6f5;};'use strict';var emlformat=require(_0x1323('0x0'));var rimraf=require(_0x1323('0x1'));var zipdir=require(_0x1323('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1323('0x3'));var moment=require(_0x1323('0x4'));var BPromise=require(_0x1323('0x5'));var Mustache=require(_0x1323('0x6'));var util=require(_0x1323('0x7'));var path=require(_0x1323('0x8'));var sox=require('sox');var csv=require(_0x1323('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1323('0xa'));var squel=require(_0x1323('0xb'));var crypto=require(_0x1323('0xc'));var jsforce=require(_0x1323('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1323('0x9'));var querystring=require(_0x1323('0xe'));var Papa=require(_0x1323('0xf'));var Redis=require(_0x1323('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1323('0x11'));var as=require(_0x1323('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1323('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x1323('0x14'));function respondWithStatusCode(_0x18fd2c,_0x314e3b){_0x314e3b=_0x314e3b||0xcc;return function(_0x4d37c5){if(_0x4d37c5){return _0x18fd2c['sendStatus'](_0x314e3b);}return _0x18fd2c[_0x1323('0x15')](_0x314e3b)[_0x1323('0x16')]();};}function respondWithResult(_0x578cb9,_0x2663b7){_0x2663b7=_0x2663b7||0xc8;return function(_0xe9f789){if(_0xe9f789){return _0x578cb9['status'](_0x2663b7)[_0x1323('0x17')](_0xe9f789);}};}function respondWithFilteredResult(_0x2796d6,_0x920328){return function(_0xae7b1a){if(_0xae7b1a){var _0xe09b02=typeof _0x920328[_0x1323('0x18')]==='undefined'&&typeof _0x920328[_0x1323('0x19')]===_0x1323('0x1a');var _0x1b581e=_0xae7b1a['count'];var _0x1fcc0b=_0xe09b02?0x0:_0x920328[_0x1323('0x18')];var _0x5036d9=_0xe09b02?_0xae7b1a[_0x1323('0x1b')]:_0x920328[_0x1323('0x18')]+_0x920328['limit'];var _0x2eba15;if(_0x5036d9>=_0x1b581e){_0x5036d9=_0x1b581e;_0x2eba15=0xc8;}else{_0x2eba15=0xce;}_0x2796d6[_0x1323('0x15')](_0x2eba15);return _0x2796d6['set'](_0x1323('0x1c'),_0x1fcc0b+'-'+_0x5036d9+'/'+_0x1b581e)['json'](_0xae7b1a);}return null;};}function patchUpdates(_0x24ec2b){return function(_0x24bb76){try{jsonpatch[_0x1323('0x1d')](_0x24bb76,_0x24ec2b,!![]);}catch(_0x1320f3){return BPromise[_0x1323('0x1e')](_0x1320f3);}return _0x24bb76[_0x1323('0x1f')]();};}function saveUpdates(_0x2c9024,_0x46c5dd){return function(_0x267d69){if(_0x267d69){return _0x267d69['update'](_0x2c9024)['then'](function(_0x23fa98){return _0x23fa98;});}return null;};}function removeEntity(_0x8466b0,_0x510335){return function(_0xbf2094){if(_0xbf2094){return _0xbf2094['destroy']()[_0x1323('0x20')](function(){_0x8466b0['status'](0xcc)[_0x1323('0x16')]();});}};}function handleEntityNotFound(_0x2b70ad,_0x59d7e1){return function(_0x4678b8){if(!_0x4678b8){_0x2b70ad[_0x1323('0x21')](0x194);}return _0x4678b8;};}function handleError(_0x487212,_0x44f522){_0x44f522=_0x44f522||0x1f4;return function(_0x2df6c0){logger[_0x1323('0x22')](_0x2df6c0[_0x1323('0x23')]);if(_0x2df6c0[_0x1323('0x24')]){delete _0x2df6c0[_0x1323('0x24')];}_0x487212['status'](_0x44f522)[_0x1323('0x25')](_0x2df6c0);};}exports[_0x1323('0x26')]=function(_0x39867d,_0x14209b){var _0x2b163e={},_0x137fca={},_0x20399d={'count':0x0,'rows':[]};var _0x4781ed=_[_0x1323('0x27')](db[_0x1323('0x28')]['rawAttributes'],function(_0x298163){return{'name':_0x298163[_0x1323('0x29')],'type':_0x298163[_0x1323('0x2a')][_0x1323('0x2b')]};});_0x137fca['model']=_[_0x1323('0x27')](_0x4781ed,_0x1323('0x24'));_0x137fca[_0x1323('0x2c')]=_[_0x1323('0x2d')](_0x39867d[_0x1323('0x2c')]);_0x137fca[_0x1323('0x2e')]=_[_0x1323('0x2f')](_0x137fca['model'],_0x137fca[_0x1323('0x2c')]);_0x2b163e[_0x1323('0x30')]=_[_0x1323('0x2f')](_0x137fca[_0x1323('0x31')],qs['fields'](_0x39867d[_0x1323('0x2c')][_0x1323('0x32')]));_0x2b163e[_0x1323('0x30')]=_0x2b163e['attributes'][_0x1323('0x33')]?_0x2b163e[_0x1323('0x30')]:_0x137fca[_0x1323('0x31')];if(!_0x39867d[_0x1323('0x2c')][_0x1323('0x34')]('nolimit')){_0x2b163e[_0x1323('0x19')]=qs[_0x1323('0x19')](_0x39867d[_0x1323('0x2c')]['limit']);_0x2b163e[_0x1323('0x18')]=qs[_0x1323('0x18')](_0x39867d[_0x1323('0x2c')]['offset']);}_0x2b163e[_0x1323('0x35')]=qs[_0x1323('0x36')](_0x39867d['query'][_0x1323('0x36')]);_0x2b163e[_0x1323('0x37')]=qs[_0x1323('0x2e')](_[_0x1323('0x38')](_0x39867d[_0x1323('0x2c')],_0x137fca[_0x1323('0x2e')]),_0x4781ed);if(_0x39867d[_0x1323('0x2c')][_0x1323('0x39')]){_0x2b163e['where']=_[_0x1323('0x3a')](_0x2b163e['where'],{'$or':_['map'](_0x4781ed,function(_0x336721){if(_0x336721['type']!=='VIRTUAL'){var _0x28a79d={};_0x28a79d[_0x336721[_0x1323('0x24')]]={'$like':'%'+_0x39867d['query'][_0x1323('0x39')]+'%'};return _0x28a79d;}})});}_0x2b163e=_['merge']({},_0x2b163e,_0x39867d[_0x1323('0x3b')]);var _0x35621b={'where':_0x2b163e[_0x1323('0x37')]};return db[_0x1323('0x28')][_0x1323('0x1b')](_0x35621b)[_0x1323('0x20')](function(_0x3a26d8){_0x20399d[_0x1323('0x1b')]=_0x3a26d8;if(_0x39867d[_0x1323('0x2c')]['includeAll']){_0x2b163e['include']=[{'all':!![]}];}return db[_0x1323('0x28')][_0x1323('0x3c')](_0x2b163e);})['then'](function(_0x10ee00){_0x20399d['rows']=_0x10ee00;return _0x20399d;})[_0x1323('0x20')](respondWithFilteredResult(_0x14209b,_0x2b163e))[_0x1323('0x3d')](handleError(_0x14209b,null));};exports[_0x1323('0x3e')]=function(_0x9c4dc3,_0x16870a){var _0x2c589e={'raw':![],'where':{'id':_0x9c4dc3[_0x1323('0x3f')]['id']}},_0x5a990f={};_0x5a990f[_0x1323('0x31')]=_[_0x1323('0x2d')](db[_0x1323('0x28')][_0x1323('0x40')]);_0x5a990f[_0x1323('0x2c')]=_['keys'](_0x9c4dc3[_0x1323('0x2c')]);_0x5a990f[_0x1323('0x2e')]=_['intersection'](_0x5a990f[_0x1323('0x31')],_0x5a990f[_0x1323('0x2c')]);_0x2c589e[_0x1323('0x30')]=_[_0x1323('0x2f')](_0x5a990f[_0x1323('0x31')],qs[_0x1323('0x32')](_0x9c4dc3[_0x1323('0x2c')][_0x1323('0x32')]));_0x2c589e[_0x1323('0x30')]=_0x2c589e[_0x1323('0x30')][_0x1323('0x33')]?_0x2c589e[_0x1323('0x30')]:_0x5a990f['model'];if(_0x9c4dc3['query'][_0x1323('0x41')]){_0x2c589e[_0x1323('0x42')]=[{'all':!![]}];}_0x2c589e=_[_0x1323('0x3a')]({},_0x2c589e,_0x9c4dc3['options']);return db['FreshsalesAccount'][_0x1323('0x43')](_0x2c589e)[_0x1323('0x20')](handleEntityNotFound(_0x16870a,null))[_0x1323('0x20')](respondWithResult(_0x16870a,null))[_0x1323('0x3d')](handleError(_0x16870a,null));};exports['create']=function(_0x261c3b,_0x2dbbf7){return db[_0x1323('0x28')][_0x1323('0x44')](_0x261c3b['body'],{})[_0x1323('0x20')](respondWithResult(_0x2dbbf7,0xc9))[_0x1323('0x3d')](handleError(_0x2dbbf7,null));};exports[_0x1323('0x45')]=function(_0x556f42,_0x3a1755){if(_0x556f42['body']['id']){delete _0x556f42[_0x1323('0x46')]['id'];}return db['FreshsalesAccount'][_0x1323('0x43')]({'where':{'id':_0x556f42[_0x1323('0x3f')]['id']}})[_0x1323('0x20')](handleEntityNotFound(_0x3a1755,null))[_0x1323('0x20')](saveUpdates(_0x556f42[_0x1323('0x46')],null))[_0x1323('0x20')](respondWithResult(_0x3a1755,null))['catch'](handleError(_0x3a1755,null));};exports[_0x1323('0x47')]=function(_0x1d265a,_0x10c753){return db[_0x1323('0x28')]['find']({'where':{'id':_0x1d265a[_0x1323('0x3f')]['id']}})[_0x1323('0x20')](handleEntityNotFound(_0x10c753,null))[_0x1323('0x20')](removeEntity(_0x10c753,null))[_0x1323('0x3d')](handleError(_0x10c753,null));};exports[_0x1323('0x48')]=function(_0x4fc1fa,_0x9f58e5,_0xc5f3b0){var _0x82bfb5={};var _0x2307f5={};var _0x5edb5f;var _0x534d26;return db[_0x1323('0x28')][_0x1323('0x49')]({'where':{'id':_0x4fc1fa[_0x1323('0x3f')]['id']}})[_0x1323('0x20')](handleEntityNotFound(_0x9f58e5,null))[_0x1323('0x20')](function(_0x326e0b){if(_0x326e0b){_0x5edb5f=_0x326e0b;_0x2307f5[_0x1323('0x31')]=_['keys'](db[_0x1323('0x4a')][_0x1323('0x40')]);_0x2307f5[_0x1323('0x2c')]=_[_0x1323('0x2d')](_0x4fc1fa['query']);_0x2307f5[_0x1323('0x2e')]=_[_0x1323('0x2f')](_0x2307f5[_0x1323('0x31')],_0x2307f5[_0x1323('0x2c')]);_0x82bfb5[_0x1323('0x30')]=_['intersection'](_0x2307f5['model'],qs[_0x1323('0x32')](_0x4fc1fa[_0x1323('0x2c')][_0x1323('0x32')]));_0x82bfb5[_0x1323('0x30')]=_0x82bfb5[_0x1323('0x30')][_0x1323('0x33')]?_0x82bfb5[_0x1323('0x30')]:_0x2307f5[_0x1323('0x31')];_0x82bfb5[_0x1323('0x35')]=qs[_0x1323('0x36')](_0x4fc1fa[_0x1323('0x2c')][_0x1323('0x36')]);_0x82bfb5[_0x1323('0x37')]=qs[_0x1323('0x2e')](_[_0x1323('0x38')](_0x4fc1fa[_0x1323('0x2c')],_0x2307f5['filters']));if(_0x4fc1fa['query'][_0x1323('0x39')]){_0x82bfb5[_0x1323('0x37')]=_['merge'](_0x82bfb5[_0x1323('0x37')],{'$or':_['map'](_0x82bfb5['attributes'],function(_0x20be54){var _0x2765c7={};_0x2765c7[_0x20be54]={'$like':'%'+_0x4fc1fa[_0x1323('0x2c')][_0x1323('0x39')]+'%'};return _0x2765c7;})});}_0x82bfb5=_['merge']({},_0x82bfb5,_0x4fc1fa[_0x1323('0x3b')]);return _0x5edb5f[_0x1323('0x48')](_0x82bfb5);}})['then'](function(_0x190535){if(_0x190535){_0x534d26=_0x190535[_0x1323('0x33')];if(!_0x4fc1fa[_0x1323('0x2c')][_0x1323('0x34')]('nolimit')){_0x82bfb5[_0x1323('0x19')]=qs[_0x1323('0x19')](_0x4fc1fa[_0x1323('0x2c')]['limit']);_0x82bfb5[_0x1323('0x18')]=qs[_0x1323('0x18')](_0x4fc1fa['query'][_0x1323('0x18')]);}return _0x5edb5f['getConfigurations'](_0x82bfb5);}})['then'](function(_0x322af5){if(_0x322af5){return _0x322af5?{'count':_0x534d26,'rows':_0x322af5}:null;}})[_0x1323('0x20')](respondWithResult(_0x9f58e5,null))[_0x1323('0x3d')](handleError(_0x9f58e5,null));};exports[_0x1323('0x4b')]=function(_0x4c1f95,_0x5dabd0,_0x4a0a26){if(_0x4c1f95[_0x1323('0x46')]['id']){delete _0x4c1f95[_0x1323('0x46')]['id'];}return db[_0x1323('0x28')][_0x1323('0x49')]({'where':{'id':_0x4c1f95['params']['id']}})[_0x1323('0x20')](handleEntityNotFound(_0x5dabd0,null))[_0x1323('0x20')](function(_0x4b4e04){if(_0x4b4e04){_0x4c1f95[_0x1323('0x46')][_0x1323('0x4c')]=_0x4b4e04['id'];_0x4c1f95[_0x1323('0x46')]['Subjects']=integrations[_0x1323('0x4d')](_0x4c1f95[_0x1323('0x46')][_0x1323('0x4e')],_0x4c1f95[_0x1323('0x46')][_0x1323('0x2a')]);_0x4c1f95[_0x1323('0x46')]['Descriptions']=integrations[_0x1323('0x4f')](_0x4c1f95[_0x1323('0x46')]['channel'],_0x4c1f95['body'][_0x1323('0x2a')]);return db['FreshsalesConfiguration'][_0x1323('0x44')](_0x4c1f95[_0x1323('0x46')],{'include':[{'model':db[_0x1323('0x50')],'as':_0x1323('0x51')},{'model':db[_0x1323('0x50')],'as':_0x1323('0x52')}]});}return null;})[_0x1323('0x20')](respondWithResult(_0x5dabd0,null))[_0x1323('0x3d')](handleError(_0x5dabd0,null));};exports['getFields']=function(_0x2d6619,_0x392303,_0x3c46eb){var _0x41d854='';var _0x2d2826='';return db[_0x1323('0x28')]['findOne']({'where':{'id':_0x2d6619['params']['id']},'attributes':['id',_0x1323('0x53'),'remoteUri',_0x1323('0x54')]})[_0x1323('0x20')](handleEntityNotFound(_0x392303,null))[_0x1323('0x20')](function(_0x1ad62f){if(_0x1ad62f){_0x2d2826=_0x1ad62f[_0x1323('0x53')];_0x41d854=_0x1ad62f[_0x1323('0x55')];var _0xa44640=_0x1ad62f[_0x1323('0x55')]['slice'](-0x1);if(_0xa44640==='/'){_0x41d854=_0x41d854[_0x1323('0x56')](0x0,_0x41d854['lastIndexOf'](_0xa44640));}return rp({'method':_0x1323('0x57'),'uri':util[_0x1323('0x58')]('%s%s',_0x41d854,_0x1323('0x59')),'headers':{'Authorization':_0x1323('0x5a')+_0x1ad62f['apiKey']},'json':!![]});}})[_0x1323('0x20')](function(_0x2f5878){if(_0x2f5878){var _0x238274=_0x2f5878[_0x1323('0x5b')];var _0x5d8820=![];var _0x103a22=null;for(_0x103a22=0x0;_0x103a22<_0x238274['length'];_0x103a22++){if(_0x238274[_0x103a22][_0x1323('0x5c')]===_0x2d2826){_0x5d8820=!![];}}if(_0x5d8820){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1323('0x5d')});}}})[_0x1323('0x20')](respondWithResult(_0x392303,null))['catch'](function(_0x227427){var _0x5c65b9=_0x2d6619[_0x1323('0x2c')]['test']?0x1f4:_0x227427[_0x1323('0x5e')]||0x1f4;logger[_0x1323('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x1323('0x5f'),_0x5c65b9,JSON[_0x1323('0x60')](_0x227427));delete _0x227427[_0x1323('0x24')];if(_0x5c65b9===0x191){_0x5c65b9=0x190;}_0x392303[_0x1323('0x15')](_0x5c65b9)[_0x1323('0x25')](_0x2d6619[_0x1323('0x2c')][_0x1323('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0x227427[_0x1323('0x5e')]}:_0x227427);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index cfaa21b..692da23 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 _0xbff5=['FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','define'];(function(_0x3723e1,_0x1bf81d){var _0x465a3f=function(_0x553576){while(--_0x553576){_0x3723e1['push'](_0x3723e1['shift']());}};_0x465a3f(++_0x1bf81d);}(_0xbff5,0x1bc));var _0x5bff=function(_0x1d34fd,_0x4f8ba8){_0x1d34fd=_0x1d34fd-0x0;var _0x14ab3f=_0xbff5[_0x1d34fd];return _0x14ab3f;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var rp=require(_0x5bff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bff('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x5bff('0x8'));module[_0x5bff('0x9')]=function(_0x151add,_0xa54c57){return _0x151add[_0x5bff('0xa')](_0x5bff('0xb'),attributes,{'tableName':_0x5bff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd943=['int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesAccount'];(function(_0x4014b6,_0x2a5163){var _0x1552db=function(_0x5e1287){while(--_0x5e1287){_0x4014b6['push'](_0x4014b6['shift']());}};_0x1552db(++_0x2a5163);}(_0xd943,0x15d));var _0x3d94=function(_0x453531,_0x314b0f){_0x453531=_0x453531-0x0;var _0x2ed220=_0xd943[_0x453531];return _0x2ed220;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3d94('0x9')]=function(_0x51cf1f,_0x54e81f){return _0x51cf1f['define'](_0x3d94('0xa'),attributes,{'tableName':_0x3d94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 82595d1..d3a92e0 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 _0x0295=['find','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','raw','where','include','map','model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount'];(function(_0xf82a8d,_0x3fec8d){var _0x39a911=function(_0x4c3bd4){while(--_0x4c3bd4){_0xf82a8d['push'](_0xf82a8d['shift']());}};_0x39a911(++_0x3fec8d);}(_0x0295,0x1f0));var _0x5029=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0x0295[_0x5e28c2];return _0x1a8cc6;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['GetFreshsalesAccount']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')]({'raw':_0x1ed567[_0x5029('0x17')]?_0x1ed567['options'][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')][_0x5029('0x19')]||null:null,'attributes':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')]['attributes']||null:null,'limit':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')]['limit']||null:null,'include':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')],function(_0x125c26){return{'model':db[_0x125c26[_0x5029('0x1c')]],'as':_0x125c26['as'],'attributes':_0x125c26[_0x5029('0x1d')],'include':_0x125c26['include']?_['map'](_0x125c26['include'],function(_0x588d90){return{'model':db[_0x588d90[_0x5029('0x1c')]],'as':_0x588d90['as'],'attributes':_0x588d90['attributes'],'include':_0x588d90['include']?_[_0x5029('0x1b')](_0x588d90[_0x5029('0x1a')],function(_0x36d810){return{'model':db[_0x36d810['model']],'as':_0x36d810['as'],'attributes':_0x36d810[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x5e45c4){logger[_0x5029('0xb')](_0x5029('0x1e'),_0x1ed567);logger[_0x5029('0xd')]('GetFreshsalesAccount',_0x1ed567,JSON[_0x5029('0xf')](_0x5e45c4));_0x35de81(_0x5e45c4);})[_0x5029('0x14')](function(_0xe5313e){logger['error'](_0x5029('0x1e'),_0xe5313e[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155['error'](0x1f4,_0xe5313e[_0x5029('0x12')]));});});};exports[_0x5029('0x1f')]=function(_0x4434ff){var _0x1c3dd9=this;return new Promise(function(_0x196830,_0x2a1ed6){return db[_0x5029('0x15')][_0x5029('0x20')]({'raw':_0x4434ff[_0x5029('0x17')]?_0x4434ff[_0x5029('0x17')][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x4434ff[_0x5029('0x17')]?_0x4434ff['options'][_0x5029('0x19')]||null:null,'attributes':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')]['attributes']||null:null,'include':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x4434ff['options'][_0x5029('0x1a')],function(_0x15d882){return{'model':db[_0x15d882[_0x5029('0x1c')]],'as':_0x15d882['as'],'attributes':_0x15d882[_0x5029('0x1d')],'include':_0x15d882[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x15d882[_0x5029('0x1a')],function(_0x22205e){return{'model':db[_0x22205e[_0x5029('0x1c')]],'as':_0x22205e['as'],'attributes':_0x22205e['attributes'],'include':_0x22205e[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x22205e[_0x5029('0x1a')],function(_0x1b3817){return{'model':db[_0x1b3817['model']],'as':_0x1b3817['as'],'attributes':_0x1b3817[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x3e2d88){logger['info']('ShowFreshsalesAccount',_0x4434ff);logger[_0x5029('0xd')](_0x5029('0x1f'),_0x4434ff,JSON['stringify'](_0x3e2d88));_0x196830(_0x3e2d88);})['catch'](function(_0x9656f2){logger[_0x5029('0x10')](_0x5029('0x1f'),_0x9656f2[_0x5029('0x12')],_0x4434ff);_0x2a1ed6(_0x1c3dd9[_0x5029('0x10')](0x1f4,_0x9656f2[_0x5029('0x12')]));});});}; \ No newline at end of file +var _0x33af=['include','map','model','ShowFreshsalesAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x33af,0xec));var _0xf33a=function(_0x934754,_0x15bd40){_0x934754=_0x934754-0x0;var _0x5cf1fc=_0x33af[_0x934754];return _0x5cf1fc;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['findAll']({'raw':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x18')]===undefined?!![]:![]:!![],'where':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'limit':_0x524109[_0xf33a('0x17')]?_0x524109['options'][_0xf33a('0x1b')]||null:null,'include':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x524109['options'][_0xf33a('0x1c')],function(_0x5882ba){return{'model':db[_0x5882ba[_0xf33a('0x1e')]],'as':_0x5882ba['as'],'attributes':_0x5882ba[_0xf33a('0x1a')],'include':_0x5882ba[_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x5882ba[_0xf33a('0x1c')],function(_0x4b9801){return{'model':db[_0x4b9801[_0xf33a('0x1e')]],'as':_0x4b9801['as'],'attributes':_0x4b9801[_0xf33a('0x1a')],'include':_0x4b9801['include']?_['map'](_0x4b9801[_0xf33a('0x1c')],function(_0x5f0a53){return{'model':db[_0x5f0a53['model']],'as':_0x5f0a53['as'],'attributes':_0x5f0a53[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x79d653){logger['info'](_0xf33a('0x15'),_0x524109);logger[_0xf33a('0xe')](_0xf33a('0x15'),_0x524109,JSON[_0xf33a('0xf')](_0x79d653));_0x23d9e2(_0x79d653);})[_0xf33a('0x14')](function(_0x3068a9){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x3068a9[_0xf33a('0x12')],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x3068a9[_0xf33a('0x12')]));});});};exports[_0xf33a('0x1f')]=function(_0x22c9f2){var _0x3f714e=this;return new Promise(function(_0x2fd098,_0x5eb14a){return db[_0xf33a('0x16')][_0xf33a('0x20')]({'raw':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'include':_0x22c9f2['options']?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')],function(_0x57e7be){return{'model':db[_0x57e7be['model']],'as':_0x57e7be['as'],'attributes':_0x57e7be[_0xf33a('0x1a')],'include':_0x57e7be['include']?_['map'](_0x57e7be['include'],function(_0x2c4840){return{'model':db[_0x2c4840[_0xf33a('0x1e')]],'as':_0x2c4840['as'],'attributes':_0x2c4840['attributes'],'include':_0x2c4840[_0xf33a('0x1c')]?_['map'](_0x2c4840[_0xf33a('0x1c')],function(_0x1f11b3){return{'model':db[_0x1f11b3[_0xf33a('0x1e')]],'as':_0x1f11b3['as'],'attributes':_0x1f11b3[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf33a('0xa')](function(_0x23c92b){logger['info'](_0xf33a('0x1f'),_0x22c9f2);logger[_0xf33a('0xe')]('ShowFreshsalesAccount',_0x22c9f2,JSON[_0xf33a('0xf')](_0x23c92b));_0x2fd098(_0x23c92b);})[_0xf33a('0x14')](function(_0x3e0a98){logger['error'](_0xf33a('0x1f'),_0x3e0a98[_0xf33a('0x12')],_0x22c9f2);_0x5eb14a(_0x3f714e[_0xf33a('0x10')](0x1f4,_0x3e0a98[_0xf33a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 8ed474c..76a55f4 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 _0x888f=['index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated'];(function(_0x858e7b,_0x274ae4){var _0x417c65=function(_0x4e1519){while(--_0x4e1519){_0x858e7b['push'](_0x858e7b['shift']());}};_0x417c65(++_0x274ae4);}(_0x888f,0x1e3));var _0xf888=function(_0x4c0028,_0x129f6d){_0x4c0028=_0x4c0028-0x0;var _0x221bc2=_0x888f[_0x4c0028];return _0x221bc2;};'use strict';var multer=require(_0xf888('0x0'));var util=require(_0xf888('0x1'));var path=require('path');var timeout=require(_0xf888('0x2'));var express=require(_0xf888('0x3'));var router=express[_0xf888('0x4')]();var fs_extra=require(_0xf888('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf888('0x6'));var config=require(_0xf888('0x7'));var controller=require(_0xf888('0x8'));router[_0xf888('0x9')]('/',auth[_0xf888('0xa')](),controller[_0xf888('0xb')]);router[_0xf888('0x9')](_0xf888('0xc'),auth[_0xf888('0xa')](),controller[_0xf888('0xd')]);router[_0xf888('0x9')](_0xf888('0xe'),auth[_0xf888('0xa')](),controller[_0xf888('0xf')]);router[_0xf888('0x9')](_0xf888('0x10'),auth['isAuthenticated'](),controller[_0xf888('0x11')]);router[_0xf888('0x9')](_0xf888('0x12'),auth[_0xf888('0xa')](),controller[_0xf888('0x13')]);router['post']('/',auth[_0xf888('0xa')](),controller[_0xf888('0x14')]);router[_0xf888('0x15')]('/:id',auth[_0xf888('0xa')](),controller[_0xf888('0x16')]);router[_0xf888('0x17')](_0xf888('0xc'),auth[_0xf888('0xa')](),controller[_0xf888('0x18')]);module[_0xf888('0x19')]=router; \ No newline at end of file +var _0x282f=['getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0x21a748,_0x3fcecb){var _0x302441=function(_0x7d8ddf){while(--_0x7d8ddf){_0x21a748['push'](_0x21a748['shift']());}};_0x302441(++_0x3fcecb);}(_0x282f,0x7d));var _0xf282=function(_0x1421ba,_0x4fd6a9){_0x1421ba=_0x1421ba-0x0;var _0x225a5e=_0x282f[_0x1421ba];return _0x225a5e;};'use strict';var multer=require(_0xf282('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf282('0x1'));var express=require('express');var router=express[_0xf282('0x2')]();var fs_extra=require(_0xf282('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf282('0x4'));var config=require(_0xf282('0x5'));var controller=require(_0xf282('0x6'));router[_0xf282('0x7')]('/',auth[_0xf282('0x8')](),controller[_0xf282('0x9')]);router[_0xf282('0x7')](_0xf282('0xa'),auth[_0xf282('0x8')](),controller[_0xf282('0xb')]);router[_0xf282('0x7')](_0xf282('0xc'),auth[_0xf282('0x8')](),controller[_0xf282('0xd')]);router['get'](_0xf282('0xe'),auth[_0xf282('0x8')](),controller['getDescriptions']);router['get'](_0xf282('0xf'),auth[_0xf282('0x8')](),controller[_0xf282('0x10')]);router['post']('/',auth[_0xf282('0x8')](),controller[_0xf282('0x11')]);router[_0xf282('0x12')](_0xf282('0xa'),auth[_0xf282('0x8')](),controller[_0xf282('0x13')]);router[_0xf282('0x14')](_0xf282('0xa'),auth['isAuthenticated'](),controller[_0xf282('0x15')]);module[_0xf282('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 4c22a5a..d16e4a5 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 _0xfc26=['exports','STRING','sequelize'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xfc26,0x1d3));var _0x6fc2=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0xfc26[_0x367e5b];return _0x4b909e;};'use strict';var Sequelize=require(_0x6fc2('0x0'));module[_0x6fc2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6fc2('0x2')]}}; \ No newline at end of file +var _0xbe45=['STRING','sequelize'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0xbe45,0x1af));var _0x5be4=function(_0x3ae1a0,_0x5c11e1){_0x3ae1a0=_0x3ae1a0-0x0;var _0x5903d8=_0xbe45[_0x3ae1a0];return _0x5903d8;};'use strict';var Sequelize=require(_0x5be4('0x0'));module['exports']={'name':{'type':Sequelize[_0x5be4('0x1')]},'description':{'type':Sequelize[_0x5be4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index d3b16e0..40b955d 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 _0xa338=['show','params','keys','find','create','body','destroy','getSubjects','findOne','FreshsalesField','filter','hasOwnProperty','getDescriptions','getFields','request-promise','moment','bluebird','util','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa338,0xa6));var _0x8a33=function(_0xc5f792,_0x107603){_0xc5f792=_0xc5f792-0x0;var _0x4ea854=_0xa338[_0xc5f792];return _0x4ea854;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a33('0x0'));var moment=require(_0x8a33('0x1'));var BPromise=require(_0x8a33('0x2'));var Mustache=require('mustache');var util=require(_0x8a33('0x3'));var path=require('path');var sox=require(_0x8a33('0x4'));var csv=require('to-csv');var ejs=require(_0x8a33('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8a33('0x6'));var crypto=require(_0x8a33('0x7'));var jsforce=require(_0x8a33('0x8'));var deskjs=require(_0x8a33('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a33('0xa'));var Redis=require(_0x8a33('0xb'));var authService=require(_0x8a33('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x8a33('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a33('0xe'))('api');var utils=require(_0x8a33('0xf'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a33('0x10'))['db'];function respondWithStatusCode(_0x571608,_0xba4cd){_0xba4cd=_0xba4cd||0xcc;return function(_0x3a62c7){if(_0x3a62c7){return _0x571608[_0x8a33('0x11')](_0xba4cd);}return _0x571608[_0x8a33('0x12')](_0xba4cd)[_0x8a33('0x13')]();};}function respondWithResult(_0x12b460,_0x526329){_0x526329=_0x526329||0xc8;return function(_0x2f2e6d){if(_0x2f2e6d){return _0x12b460[_0x8a33('0x12')](_0x526329)['json'](_0x2f2e6d);}};}function respondWithFilteredResult(_0x4bcab3,_0x18e16f){return function(_0x92f078){if(_0x92f078){var _0x5f0a27=typeof _0x18e16f['offset']===_0x8a33('0x14')&&typeof _0x18e16f[_0x8a33('0x15')]===_0x8a33('0x14');var _0x23d3ab=_0x92f078[_0x8a33('0x16')];var _0x535481=_0x5f0a27?0x0:_0x18e16f[_0x8a33('0x17')];var _0x57c1a1=_0x5f0a27?_0x92f078[_0x8a33('0x16')]:_0x18e16f[_0x8a33('0x17')]+_0x18e16f[_0x8a33('0x15')];var _0x380684;if(_0x57c1a1>=_0x23d3ab){_0x57c1a1=_0x23d3ab;_0x380684=0xc8;}else{_0x380684=0xce;}_0x4bcab3['status'](_0x380684);return _0x4bcab3[_0x8a33('0x18')](_0x8a33('0x19'),_0x535481+'-'+_0x57c1a1+'/'+_0x23d3ab)[_0x8a33('0x1a')](_0x92f078);}return null;};}function patchUpdates(_0xf16768){return function(_0xc098bf){try{jsonpatch[_0x8a33('0x1b')](_0xc098bf,_0xf16768,!![]);}catch(_0x2fe0c4){return BPromise[_0x8a33('0x1c')](_0x2fe0c4);}return _0xc098bf[_0x8a33('0x1d')]();};}function saveUpdates(_0x36f146,_0xf020db){return function(_0x30c9ed){if(_0x30c9ed){return _0x30c9ed[_0x8a33('0x1e')](_0x36f146)[_0x8a33('0x1f')](function(_0x7446b8){return _0x7446b8;});}return null;};}function removeEntity(_0x3007bc,_0x5c2451){return function(_0xf495c7){if(_0xf495c7){return _0xf495c7['destroy']()[_0x8a33('0x1f')](function(){_0x3007bc[_0x8a33('0x12')](0xcc)[_0x8a33('0x13')]();});}};}function handleEntityNotFound(_0x42d8f2,_0x59b530){return function(_0x4ba8af){if(!_0x4ba8af){_0x42d8f2[_0x8a33('0x11')](0x194);}return _0x4ba8af;};}function handleError(_0x400f98,_0x39de1b){_0x39de1b=_0x39de1b||0x1f4;return function(_0x983996){logger[_0x8a33('0x20')](_0x983996[_0x8a33('0x21')]);if(_0x983996['name']){delete _0x983996[_0x8a33('0x22')];}_0x400f98[_0x8a33('0x12')](_0x39de1b)[_0x8a33('0x23')](_0x983996);};}exports[_0x8a33('0x24')]=function(_0x462263,_0xbc7a9d){var _0x395823={},_0x5abd8e={},_0x477467={'count':0x0,'rows':[]};var _0x12c4c7=_[_0x8a33('0x25')](db[_0x8a33('0x26')][_0x8a33('0x27')],function(_0x56e0ed){return{'name':_0x56e0ed[_0x8a33('0x28')],'type':_0x56e0ed['type'][_0x8a33('0x29')]};});_0x5abd8e[_0x8a33('0x2a')]=_['map'](_0x12c4c7,_0x8a33('0x22'));_0x5abd8e[_0x8a33('0x2b')]=_['keys'](_0x462263[_0x8a33('0x2b')]);_0x5abd8e[_0x8a33('0x2c')]=_[_0x8a33('0x2d')](_0x5abd8e[_0x8a33('0x2a')],_0x5abd8e[_0x8a33('0x2b')]);_0x395823[_0x8a33('0x2e')]=_[_0x8a33('0x2d')](_0x5abd8e[_0x8a33('0x2a')],qs[_0x8a33('0x2f')](_0x462263[_0x8a33('0x2b')][_0x8a33('0x2f')]));_0x395823[_0x8a33('0x2e')]=_0x395823[_0x8a33('0x2e')][_0x8a33('0x30')]?_0x395823['attributes']:_0x5abd8e[_0x8a33('0x2a')];if(!_0x462263[_0x8a33('0x2b')]['hasOwnProperty'](_0x8a33('0x31'))){_0x395823[_0x8a33('0x15')]=qs[_0x8a33('0x15')](_0x462263[_0x8a33('0x2b')][_0x8a33('0x15')]);_0x395823['offset']=qs[_0x8a33('0x17')](_0x462263[_0x8a33('0x2b')]['offset']);}_0x395823[_0x8a33('0x32')]=qs[_0x8a33('0x33')](_0x462263[_0x8a33('0x2b')][_0x8a33('0x33')]);_0x395823[_0x8a33('0x34')]=qs['filters'](_[_0x8a33('0x35')](_0x462263['query'],_0x5abd8e[_0x8a33('0x2c')]),_0x12c4c7);if(_0x462263[_0x8a33('0x2b')]['filter']){_0x395823[_0x8a33('0x34')]=_[_0x8a33('0x36')](_0x395823['where'],{'$or':_['map'](_0x12c4c7,function(_0x277f3d){if(_0x277f3d[_0x8a33('0x37')]!==_0x8a33('0x38')){var _0xa51f24={};_0xa51f24[_0x277f3d[_0x8a33('0x22')]]={'$like':'%'+_0x462263[_0x8a33('0x2b')]['filter']+'%'};return _0xa51f24;}})});}_0x395823=_[_0x8a33('0x36')]({},_0x395823,_0x462263[_0x8a33('0x39')]);var _0x15ba7a={'where':_0x395823[_0x8a33('0x34')]};return db['FreshsalesConfiguration'][_0x8a33('0x16')](_0x15ba7a)[_0x8a33('0x1f')](function(_0x46313a){_0x477467[_0x8a33('0x16')]=_0x46313a;if(_0x462263[_0x8a33('0x2b')][_0x8a33('0x3a')]){_0x395823[_0x8a33('0x3b')]=[{'all':!![]}];}return db[_0x8a33('0x26')][_0x8a33('0x3c')](_0x395823);})[_0x8a33('0x1f')](function(_0x59057c){_0x477467['rows']=_0x59057c;return _0x477467;})['then'](respondWithFilteredResult(_0xbc7a9d,_0x395823))[_0x8a33('0x3d')](handleError(_0xbc7a9d,null));};exports[_0x8a33('0x3e')]=function(_0x11e50a,_0x5df1ec){var _0x858b25={'raw':![],'where':{'id':_0x11e50a[_0x8a33('0x3f')]['id']}},_0x534bb={};_0x534bb['model']=_[_0x8a33('0x40')](db[_0x8a33('0x26')][_0x8a33('0x27')]);_0x534bb['query']=_['keys'](_0x11e50a['query']);_0x534bb[_0x8a33('0x2c')]=_[_0x8a33('0x2d')](_0x534bb['model'],_0x534bb[_0x8a33('0x2b')]);_0x858b25[_0x8a33('0x2e')]=_[_0x8a33('0x2d')](_0x534bb['model'],qs[_0x8a33('0x2f')](_0x11e50a[_0x8a33('0x2b')]['fields']));_0x858b25[_0x8a33('0x2e')]=_0x858b25[_0x8a33('0x2e')][_0x8a33('0x30')]?_0x858b25['attributes']:_0x534bb[_0x8a33('0x2a')];if(_0x11e50a[_0x8a33('0x2b')][_0x8a33('0x3a')]){_0x858b25[_0x8a33('0x3b')]=[{'all':!![]}];}_0x858b25=_['merge']({},_0x858b25,_0x11e50a[_0x8a33('0x39')]);return db['FreshsalesConfiguration'][_0x8a33('0x41')](_0x858b25)[_0x8a33('0x1f')](handleEntityNotFound(_0x5df1ec,null))[_0x8a33('0x1f')](respondWithResult(_0x5df1ec,null))[_0x8a33('0x3d')](handleError(_0x5df1ec,null));};exports[_0x8a33('0x42')]=function(_0x3db403,_0x60b4fe){return db[_0x8a33('0x26')][_0x8a33('0x42')](_0x3db403['body'],{})[_0x8a33('0x1f')](respondWithResult(_0x60b4fe,0xc9))[_0x8a33('0x3d')](handleError(_0x60b4fe,null));};exports[_0x8a33('0x1e')]=function(_0x19e10e,_0x5374fc){if(_0x19e10e[_0x8a33('0x43')]['id']){delete _0x19e10e[_0x8a33('0x43')]['id'];}return db[_0x8a33('0x26')][_0x8a33('0x41')]({'where':{'id':_0x19e10e[_0x8a33('0x3f')]['id']}})[_0x8a33('0x1f')](handleEntityNotFound(_0x5374fc,null))['then'](saveUpdates(_0x19e10e[_0x8a33('0x43')],null))[_0x8a33('0x1f')](respondWithResult(_0x5374fc,null))[_0x8a33('0x3d')](handleError(_0x5374fc,null));};exports[_0x8a33('0x44')]=function(_0x5d28cc,_0x2e2a5f){return db[_0x8a33('0x26')][_0x8a33('0x41')]({'where':{'id':_0x5d28cc[_0x8a33('0x3f')]['id']}})[_0x8a33('0x1f')](handleEntityNotFound(_0x2e2a5f,null))[_0x8a33('0x1f')](removeEntity(_0x2e2a5f,null))[_0x8a33('0x3d')](handleError(_0x2e2a5f,null));};exports[_0x8a33('0x45')]=function(_0x4cfb1e,_0x341bc1,_0x3583da){var _0x34d1ff={};var _0x31bc17={};var _0x822dfd;var _0x4fac45;return db[_0x8a33('0x26')][_0x8a33('0x46')]({'where':{'id':_0x4cfb1e[_0x8a33('0x3f')]['id']}})[_0x8a33('0x1f')](handleEntityNotFound(_0x341bc1,null))['then'](function(_0x1b2f5f){if(_0x1b2f5f){_0x822dfd=_0x1b2f5f;_0x31bc17[_0x8a33('0x2a')]=_[_0x8a33('0x40')](db[_0x8a33('0x47')][_0x8a33('0x27')]);_0x31bc17[_0x8a33('0x2b')]=_[_0x8a33('0x40')](_0x4cfb1e['query']);_0x31bc17[_0x8a33('0x2c')]=_['intersection'](_0x31bc17['model'],_0x31bc17[_0x8a33('0x2b')]);_0x34d1ff[_0x8a33('0x2e')]=_[_0x8a33('0x2d')](_0x31bc17[_0x8a33('0x2a')],qs[_0x8a33('0x2f')](_0x4cfb1e[_0x8a33('0x2b')][_0x8a33('0x2f')]));_0x34d1ff[_0x8a33('0x2e')]=_0x34d1ff[_0x8a33('0x2e')][_0x8a33('0x30')]?_0x34d1ff[_0x8a33('0x2e')]:_0x31bc17[_0x8a33('0x2a')];_0x34d1ff[_0x8a33('0x32')]=qs[_0x8a33('0x33')](_0x4cfb1e['query'][_0x8a33('0x33')]);_0x34d1ff[_0x8a33('0x34')]=qs[_0x8a33('0x2c')](_[_0x8a33('0x35')](_0x4cfb1e[_0x8a33('0x2b')],_0x31bc17['filters']));if(_0x4cfb1e[_0x8a33('0x2b')][_0x8a33('0x48')]){_0x34d1ff[_0x8a33('0x34')]=_[_0x8a33('0x36')](_0x34d1ff[_0x8a33('0x34')],{'$or':_[_0x8a33('0x25')](_0x34d1ff['attributes'],function(_0x433033){var _0x3b1c1b={};_0x3b1c1b[_0x433033]={'$like':'%'+_0x4cfb1e['query'][_0x8a33('0x48')]+'%'};return _0x3b1c1b;})});}_0x34d1ff=_[_0x8a33('0x36')]({},_0x34d1ff,_0x4cfb1e[_0x8a33('0x39')]);return _0x822dfd['getSubjects'](_0x34d1ff);}})['then'](function(_0xbae41e){if(_0xbae41e){_0x4fac45=_0xbae41e[_0x8a33('0x30')];if(!_0x4cfb1e[_0x8a33('0x2b')][_0x8a33('0x49')]('nolimit')){_0x34d1ff[_0x8a33('0x15')]=qs[_0x8a33('0x15')](_0x4cfb1e['query'][_0x8a33('0x15')]);_0x34d1ff[_0x8a33('0x17')]=qs[_0x8a33('0x17')](_0x4cfb1e[_0x8a33('0x2b')]['offset']);}return _0x822dfd[_0x8a33('0x45')](_0x34d1ff);}})[_0x8a33('0x1f')](function(_0x605a6b){if(_0x605a6b){return _0x605a6b?{'count':_0x4fac45,'rows':_0x605a6b}:null;}})[_0x8a33('0x1f')](respondWithResult(_0x341bc1,null))[_0x8a33('0x3d')](handleError(_0x341bc1,null));};exports['getDescriptions']=function(_0x59c4c4,_0x46e7e9,_0x35a5b9){var _0x168c8d={};var _0x26c4b1={};var _0x316c42;var _0x2fecb3;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x59c4c4[_0x8a33('0x3f')]['id']}})[_0x8a33('0x1f')](handleEntityNotFound(_0x46e7e9,null))[_0x8a33('0x1f')](function(_0x2a3abd){if(_0x2a3abd){_0x316c42=_0x2a3abd;_0x26c4b1[_0x8a33('0x2a')]=_[_0x8a33('0x40')](db[_0x8a33('0x47')][_0x8a33('0x27')]);_0x26c4b1[_0x8a33('0x2b')]=_['keys'](_0x59c4c4[_0x8a33('0x2b')]);_0x26c4b1[_0x8a33('0x2c')]=_[_0x8a33('0x2d')](_0x26c4b1['model'],_0x26c4b1[_0x8a33('0x2b')]);_0x168c8d[_0x8a33('0x2e')]=_[_0x8a33('0x2d')](_0x26c4b1[_0x8a33('0x2a')],qs[_0x8a33('0x2f')](_0x59c4c4[_0x8a33('0x2b')][_0x8a33('0x2f')]));_0x168c8d['attributes']=_0x168c8d[_0x8a33('0x2e')][_0x8a33('0x30')]?_0x168c8d[_0x8a33('0x2e')]:_0x26c4b1['model'];_0x168c8d[_0x8a33('0x32')]=qs['sort'](_0x59c4c4[_0x8a33('0x2b')][_0x8a33('0x33')]);_0x168c8d['where']=qs[_0x8a33('0x2c')](_[_0x8a33('0x35')](_0x59c4c4['query'],_0x26c4b1['filters']));if(_0x59c4c4[_0x8a33('0x2b')][_0x8a33('0x48')]){_0x168c8d[_0x8a33('0x34')]=_[_0x8a33('0x36')](_0x168c8d['where'],{'$or':_[_0x8a33('0x25')](_0x168c8d[_0x8a33('0x2e')],function(_0x44b4f1){var _0x356673={};_0x356673[_0x44b4f1]={'$like':'%'+_0x59c4c4[_0x8a33('0x2b')][_0x8a33('0x48')]+'%'};return _0x356673;})});}_0x168c8d=_['merge']({},_0x168c8d,_0x59c4c4[_0x8a33('0x39')]);return _0x316c42[_0x8a33('0x4a')](_0x168c8d);}})[_0x8a33('0x1f')](function(_0x56ba02){if(_0x56ba02){_0x2fecb3=_0x56ba02[_0x8a33('0x30')];if(!_0x59c4c4[_0x8a33('0x2b')][_0x8a33('0x49')](_0x8a33('0x31'))){_0x168c8d['limit']=qs['limit'](_0x59c4c4[_0x8a33('0x2b')][_0x8a33('0x15')]);_0x168c8d[_0x8a33('0x17')]=qs[_0x8a33('0x17')](_0x59c4c4[_0x8a33('0x2b')][_0x8a33('0x17')]);}return _0x316c42[_0x8a33('0x4a')](_0x168c8d);}})[_0x8a33('0x1f')](function(_0x58fe24){if(_0x58fe24){return _0x58fe24?{'count':_0x2fecb3,'rows':_0x58fe24}:null;}})['then'](respondWithResult(_0x46e7e9,null))['catch'](handleError(_0x46e7e9,null));};exports[_0x8a33('0x4b')]=function(_0x5a44d9,_0x1a23b0,_0xcc55f3){var _0x42b305={};var _0x47dad3={};var _0x2ada53;var _0x136ece;return db[_0x8a33('0x26')]['findOne']({'where':{'id':_0x5a44d9['params']['id']}})['then'](handleEntityNotFound(_0x1a23b0,null))[_0x8a33('0x1f')](function(_0x1a1bc5){if(_0x1a1bc5){_0x2ada53=_0x1a1bc5;_0x47dad3[_0x8a33('0x2a')]=_[_0x8a33('0x40')](db[_0x8a33('0x47')][_0x8a33('0x27')]);_0x47dad3[_0x8a33('0x2b')]=_[_0x8a33('0x40')](_0x5a44d9['query']);_0x47dad3[_0x8a33('0x2c')]=_[_0x8a33('0x2d')](_0x47dad3[_0x8a33('0x2a')],_0x47dad3['query']);_0x42b305[_0x8a33('0x2e')]=_[_0x8a33('0x2d')](_0x47dad3['model'],qs[_0x8a33('0x2f')](_0x5a44d9[_0x8a33('0x2b')]['fields']));_0x42b305[_0x8a33('0x2e')]=_0x42b305[_0x8a33('0x2e')][_0x8a33('0x30')]?_0x42b305[_0x8a33('0x2e')]:_0x47dad3['model'];_0x42b305[_0x8a33('0x32')]=qs[_0x8a33('0x33')](_0x5a44d9[_0x8a33('0x2b')][_0x8a33('0x33')]);_0x42b305[_0x8a33('0x34')]=qs[_0x8a33('0x2c')](_[_0x8a33('0x35')](_0x5a44d9[_0x8a33('0x2b')],_0x47dad3[_0x8a33('0x2c')]));if(_0x5a44d9['query'][_0x8a33('0x48')]){_0x42b305['where']=_[_0x8a33('0x36')](_0x42b305['where'],{'$or':_['map'](_0x42b305[_0x8a33('0x2e')],function(_0x27cfee){var _0x15ec0b={};_0x15ec0b[_0x27cfee]={'$like':'%'+_0x5a44d9[_0x8a33('0x2b')][_0x8a33('0x48')]+'%'};return _0x15ec0b;})});}_0x42b305=_[_0x8a33('0x36')]({},_0x42b305,_0x5a44d9[_0x8a33('0x39')]);return _0x2ada53['getFields'](_0x42b305);}})[_0x8a33('0x1f')](function(_0x2b116d){if(_0x2b116d){_0x136ece=_0x2b116d[_0x8a33('0x30')];if(!_0x5a44d9[_0x8a33('0x2b')][_0x8a33('0x49')](_0x8a33('0x31'))){_0x42b305[_0x8a33('0x15')]=qs[_0x8a33('0x15')](_0x5a44d9[_0x8a33('0x2b')][_0x8a33('0x15')]);_0x42b305['offset']=qs[_0x8a33('0x17')](_0x5a44d9['query'][_0x8a33('0x17')]);}return _0x2ada53[_0x8a33('0x4b')](_0x42b305);}})[_0x8a33('0x1f')](function(_0x371050){if(_0x371050){return _0x371050?{'count':_0x136ece,'rows':_0x371050}:null;}})[_0x8a33('0x1f')](respondWithResult(_0x1a23b0,null))['catch'](handleError(_0x1a23b0,null));}; \ No newline at end of file +var _0xe553=['set','apply','reject','save','then','error','name','send','index','FreshsalesConfiguration','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','map','VIRTUAL','filter','options','includeAll','include','catch','show','find','create','body','update','params','destroy','findOne','FreshsalesField','order','getSubjects','getDescriptions','pick','getFields','rimraf','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x1681de,_0x22e1a9){var _0x323cbf=function(_0x3077b3){while(--_0x3077b3){_0x1681de['push'](_0x1681de['shift']());}};_0x323cbf(++_0x22e1a9);}(_0xe553,0x1a5));var _0x3e55=function(_0x307fcf,_0x394370){_0x307fcf=_0x307fcf-0x0;var _0x35522f=_0xe553[_0x307fcf];return _0x35522f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e55('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3e55('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e55('0x2'));var util=require(_0x3e55('0x3'));var path=require(_0x3e55('0x4'));var sox=require(_0x3e55('0x5'));var csv=require('to-csv');var ejs=require(_0x3e55('0x6'));var fs=require('fs');var fs_extra=require(_0x3e55('0x7'));var _=require(_0x3e55('0x8'));var squel=require(_0x3e55('0x9'));var crypto=require(_0x3e55('0xa'));var jsforce=require(_0x3e55('0xb'));var deskjs=require(_0x3e55('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3e55('0xd'));var Papa=require(_0x3e55('0xe'));var Redis=require(_0x3e55('0xf'));var authService=require(_0x3e55('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e55('0x11'));var utils=require('../../config/utils');var config=require(_0x3e55('0x12'));var licenseUtil=require(_0x3e55('0x13'));var db=require(_0x3e55('0x14'))['db'];function respondWithStatusCode(_0xd97cd2,_0x502faf){_0x502faf=_0x502faf||0xcc;return function(_0x6d551f){if(_0x6d551f){return _0xd97cd2[_0x3e55('0x15')](_0x502faf);}return _0xd97cd2[_0x3e55('0x16')](_0x502faf)[_0x3e55('0x17')]();};}function respondWithResult(_0x311aa9,_0x54301a){_0x54301a=_0x54301a||0xc8;return function(_0x11969d){if(_0x11969d){return _0x311aa9[_0x3e55('0x16')](_0x54301a)[_0x3e55('0x18')](_0x11969d);}};}function respondWithFilteredResult(_0x4a320d,_0xbc75e2){return function(_0x588132){if(_0x588132){var _0x540cd8=typeof _0xbc75e2['offset']===_0x3e55('0x19')&&typeof _0xbc75e2[_0x3e55('0x1a')]===_0x3e55('0x19');var _0x23e87e=_0x588132[_0x3e55('0x1b')];var _0x32b773=_0x540cd8?0x0:_0xbc75e2['offset'];var _0x4f9d2a=_0x540cd8?_0x588132['count']:_0xbc75e2[_0x3e55('0x1c')]+_0xbc75e2['limit'];var _0x35d55e;if(_0x4f9d2a>=_0x23e87e){_0x4f9d2a=_0x23e87e;_0x35d55e=0xc8;}else{_0x35d55e=0xce;}_0x4a320d[_0x3e55('0x16')](_0x35d55e);return _0x4a320d[_0x3e55('0x1d')]('Content-Range',_0x32b773+'-'+_0x4f9d2a+'/'+_0x23e87e)[_0x3e55('0x18')](_0x588132);}return null;};}function patchUpdates(_0x69e24b){return function(_0x5242b0){try{jsonpatch[_0x3e55('0x1e')](_0x5242b0,_0x69e24b,!![]);}catch(_0x4c44bd){return BPromise[_0x3e55('0x1f')](_0x4c44bd);}return _0x5242b0[_0x3e55('0x20')]();};}function saveUpdates(_0x1eebd5,_0x39b0a9){return function(_0x4a1dfa){if(_0x4a1dfa){return _0x4a1dfa['update'](_0x1eebd5)[_0x3e55('0x21')](function(_0x90981){return _0x90981;});}return null;};}function removeEntity(_0x512fab,_0xcbf935){return function(_0x12ae5c){if(_0x12ae5c){return _0x12ae5c['destroy']()['then'](function(){_0x512fab[_0x3e55('0x16')](0xcc)[_0x3e55('0x17')]();});}};}function handleEntityNotFound(_0x4ff87b,_0x370459){return function(_0x50fad7){if(!_0x50fad7){_0x4ff87b[_0x3e55('0x15')](0x194);}return _0x50fad7;};}function handleError(_0x5b2443,_0x3477b6){_0x3477b6=_0x3477b6||0x1f4;return function(_0x3514d2){logger[_0x3e55('0x22')](_0x3514d2['stack']);if(_0x3514d2['name']){delete _0x3514d2[_0x3e55('0x23')];}_0x5b2443[_0x3e55('0x16')](_0x3477b6)[_0x3e55('0x24')](_0x3514d2);};}exports[_0x3e55('0x25')]=function(_0x2a5223,_0xdd9448){var _0x2f30f2={},_0x526973={},_0x1ea8b7={'count':0x0,'rows':[]};var _0x2eea39=_['map'](db[_0x3e55('0x26')][_0x3e55('0x27')],function(_0x15b413){return{'name':_0x15b413['fieldName'],'type':_0x15b413['type'][_0x3e55('0x28')]};});_0x526973[_0x3e55('0x29')]=_['map'](_0x2eea39,'name');_0x526973[_0x3e55('0x2a')]=_[_0x3e55('0x2b')](_0x2a5223['query']);_0x526973['filters']=_[_0x3e55('0x2c')](_0x526973['model'],_0x526973[_0x3e55('0x2a')]);_0x2f30f2['attributes']=_[_0x3e55('0x2c')](_0x526973[_0x3e55('0x29')],qs[_0x3e55('0x2d')](_0x2a5223[_0x3e55('0x2a')][_0x3e55('0x2d')]));_0x2f30f2[_0x3e55('0x2e')]=_0x2f30f2['attributes'][_0x3e55('0x2f')]?_0x2f30f2[_0x3e55('0x2e')]:_0x526973[_0x3e55('0x29')];if(!_0x2a5223[_0x3e55('0x2a')][_0x3e55('0x30')](_0x3e55('0x31'))){_0x2f30f2['limit']=qs[_0x3e55('0x1a')](_0x2a5223[_0x3e55('0x2a')][_0x3e55('0x1a')]);_0x2f30f2[_0x3e55('0x1c')]=qs[_0x3e55('0x1c')](_0x2a5223['query'][_0x3e55('0x1c')]);}_0x2f30f2['order']=qs[_0x3e55('0x32')](_0x2a5223[_0x3e55('0x2a')]['sort']);_0x2f30f2[_0x3e55('0x33')]=qs[_0x3e55('0x34')](_['pick'](_0x2a5223[_0x3e55('0x2a')],_0x526973[_0x3e55('0x34')]),_0x2eea39);if(_0x2a5223['query']['filter']){_0x2f30f2[_0x3e55('0x33')]=_[_0x3e55('0x35')](_0x2f30f2[_0x3e55('0x33')],{'$or':_[_0x3e55('0x36')](_0x2eea39,function(_0x287110){if(_0x287110['type']!==_0x3e55('0x37')){var _0x14b64c={};_0x14b64c[_0x287110[_0x3e55('0x23')]]={'$like':'%'+_0x2a5223[_0x3e55('0x2a')][_0x3e55('0x38')]+'%'};return _0x14b64c;}})});}_0x2f30f2=_[_0x3e55('0x35')]({},_0x2f30f2,_0x2a5223[_0x3e55('0x39')]);var _0x1b4c08={'where':_0x2f30f2['where']};return db[_0x3e55('0x26')][_0x3e55('0x1b')](_0x1b4c08)[_0x3e55('0x21')](function(_0xfa9d6c){_0x1ea8b7[_0x3e55('0x1b')]=_0xfa9d6c;if(_0x2a5223['query'][_0x3e55('0x3a')]){_0x2f30f2[_0x3e55('0x3b')]=[{'all':!![]}];}return db[_0x3e55('0x26')]['findAll'](_0x2f30f2);})[_0x3e55('0x21')](function(_0x24c97c){_0x1ea8b7['rows']=_0x24c97c;return _0x1ea8b7;})[_0x3e55('0x21')](respondWithFilteredResult(_0xdd9448,_0x2f30f2))[_0x3e55('0x3c')](handleError(_0xdd9448,null));};exports[_0x3e55('0x3d')]=function(_0x1755da,_0x1fdbc6){var _0x4e9396={'raw':![],'where':{'id':_0x1755da['params']['id']}},_0x3e4532={};_0x3e4532[_0x3e55('0x29')]=_[_0x3e55('0x2b')](db['FreshsalesConfiguration'][_0x3e55('0x27')]);_0x3e4532['query']=_[_0x3e55('0x2b')](_0x1755da[_0x3e55('0x2a')]);_0x3e4532['filters']=_['intersection'](_0x3e4532['model'],_0x3e4532[_0x3e55('0x2a')]);_0x4e9396[_0x3e55('0x2e')]=_[_0x3e55('0x2c')](_0x3e4532[_0x3e55('0x29')],qs[_0x3e55('0x2d')](_0x1755da['query'][_0x3e55('0x2d')]));_0x4e9396[_0x3e55('0x2e')]=_0x4e9396[_0x3e55('0x2e')][_0x3e55('0x2f')]?_0x4e9396[_0x3e55('0x2e')]:_0x3e4532[_0x3e55('0x29')];if(_0x1755da[_0x3e55('0x2a')][_0x3e55('0x3a')]){_0x4e9396[_0x3e55('0x3b')]=[{'all':!![]}];}_0x4e9396=_[_0x3e55('0x35')]({},_0x4e9396,_0x1755da[_0x3e55('0x39')]);return db[_0x3e55('0x26')][_0x3e55('0x3e')](_0x4e9396)['then'](handleEntityNotFound(_0x1fdbc6,null))[_0x3e55('0x21')](respondWithResult(_0x1fdbc6,null))[_0x3e55('0x3c')](handleError(_0x1fdbc6,null));};exports[_0x3e55('0x3f')]=function(_0x5171e4,_0x9fd12d){return db[_0x3e55('0x26')]['create'](_0x5171e4[_0x3e55('0x40')],{})[_0x3e55('0x21')](respondWithResult(_0x9fd12d,0xc9))[_0x3e55('0x3c')](handleError(_0x9fd12d,null));};exports[_0x3e55('0x41')]=function(_0x593f98,_0x21bff6){if(_0x593f98['body']['id']){delete _0x593f98[_0x3e55('0x40')]['id'];}return db['FreshsalesConfiguration'][_0x3e55('0x3e')]({'where':{'id':_0x593f98[_0x3e55('0x42')]['id']}})['then'](handleEntityNotFound(_0x21bff6,null))[_0x3e55('0x21')](saveUpdates(_0x593f98[_0x3e55('0x40')],null))[_0x3e55('0x21')](respondWithResult(_0x21bff6,null))[_0x3e55('0x3c')](handleError(_0x21bff6,null));};exports[_0x3e55('0x43')]=function(_0x50044a,_0x38ec49){return db[_0x3e55('0x26')]['find']({'where':{'id':_0x50044a['params']['id']}})[_0x3e55('0x21')](handleEntityNotFound(_0x38ec49,null))['then'](removeEntity(_0x38ec49,null))[_0x3e55('0x3c')](handleError(_0x38ec49,null));};exports['getSubjects']=function(_0x4a1697,_0x243520,_0x5e6243){var _0x14f84e={};var _0x178653={};var _0x2b5522;var _0x481ae3;return db['FreshsalesConfiguration'][_0x3e55('0x44')]({'where':{'id':_0x4a1697[_0x3e55('0x42')]['id']}})[_0x3e55('0x21')](handleEntityNotFound(_0x243520,null))[_0x3e55('0x21')](function(_0x3ca4a1){if(_0x3ca4a1){_0x2b5522=_0x3ca4a1;_0x178653['model']=_['keys'](db[_0x3e55('0x45')][_0x3e55('0x27')]);_0x178653[_0x3e55('0x2a')]=_[_0x3e55('0x2b')](_0x4a1697[_0x3e55('0x2a')]);_0x178653[_0x3e55('0x34')]=_[_0x3e55('0x2c')](_0x178653[_0x3e55('0x29')],_0x178653['query']);_0x14f84e[_0x3e55('0x2e')]=_[_0x3e55('0x2c')](_0x178653[_0x3e55('0x29')],qs[_0x3e55('0x2d')](_0x4a1697[_0x3e55('0x2a')]['fields']));_0x14f84e[_0x3e55('0x2e')]=_0x14f84e[_0x3e55('0x2e')][_0x3e55('0x2f')]?_0x14f84e[_0x3e55('0x2e')]:_0x178653[_0x3e55('0x29')];_0x14f84e[_0x3e55('0x46')]=qs['sort'](_0x4a1697[_0x3e55('0x2a')][_0x3e55('0x32')]);_0x14f84e[_0x3e55('0x33')]=qs[_0x3e55('0x34')](_['pick'](_0x4a1697[_0x3e55('0x2a')],_0x178653[_0x3e55('0x34')]));if(_0x4a1697[_0x3e55('0x2a')][_0x3e55('0x38')]){_0x14f84e[_0x3e55('0x33')]=_[_0x3e55('0x35')](_0x14f84e[_0x3e55('0x33')],{'$or':_['map'](_0x14f84e['attributes'],function(_0x1119c8){var _0x80037f={};_0x80037f[_0x1119c8]={'$like':'%'+_0x4a1697[_0x3e55('0x2a')][_0x3e55('0x38')]+'%'};return _0x80037f;})});}_0x14f84e=_[_0x3e55('0x35')]({},_0x14f84e,_0x4a1697[_0x3e55('0x39')]);return _0x2b5522[_0x3e55('0x47')](_0x14f84e);}})['then'](function(_0x21bc26){if(_0x21bc26){_0x481ae3=_0x21bc26[_0x3e55('0x2f')];if(!_0x4a1697[_0x3e55('0x2a')][_0x3e55('0x30')]('nolimit')){_0x14f84e[_0x3e55('0x1a')]=qs[_0x3e55('0x1a')](_0x4a1697[_0x3e55('0x2a')][_0x3e55('0x1a')]);_0x14f84e['offset']=qs[_0x3e55('0x1c')](_0x4a1697['query'][_0x3e55('0x1c')]);}return _0x2b5522[_0x3e55('0x47')](_0x14f84e);}})['then'](function(_0x4d50c9){if(_0x4d50c9){return _0x4d50c9?{'count':_0x481ae3,'rows':_0x4d50c9}:null;}})[_0x3e55('0x21')](respondWithResult(_0x243520,null))['catch'](handleError(_0x243520,null));};exports[_0x3e55('0x48')]=function(_0x179bae,_0x45a94a,_0x18ba31){var _0x320bf3={};var _0x469d16={};var _0x370cc0;var _0xece85f;return db[_0x3e55('0x26')][_0x3e55('0x44')]({'where':{'id':_0x179bae['params']['id']}})[_0x3e55('0x21')](handleEntityNotFound(_0x45a94a,null))[_0x3e55('0x21')](function(_0x14dfd2){if(_0x14dfd2){_0x370cc0=_0x14dfd2;_0x469d16[_0x3e55('0x29')]=_[_0x3e55('0x2b')](db[_0x3e55('0x45')]['rawAttributes']);_0x469d16['query']=_[_0x3e55('0x2b')](_0x179bae['query']);_0x469d16[_0x3e55('0x34')]=_[_0x3e55('0x2c')](_0x469d16[_0x3e55('0x29')],_0x469d16[_0x3e55('0x2a')]);_0x320bf3['attributes']=_[_0x3e55('0x2c')](_0x469d16[_0x3e55('0x29')],qs['fields'](_0x179bae[_0x3e55('0x2a')]['fields']));_0x320bf3[_0x3e55('0x2e')]=_0x320bf3[_0x3e55('0x2e')]['length']?_0x320bf3['attributes']:_0x469d16[_0x3e55('0x29')];_0x320bf3[_0x3e55('0x46')]=qs['sort'](_0x179bae[_0x3e55('0x2a')][_0x3e55('0x32')]);_0x320bf3[_0x3e55('0x33')]=qs[_0x3e55('0x34')](_[_0x3e55('0x49')](_0x179bae[_0x3e55('0x2a')],_0x469d16[_0x3e55('0x34')]));if(_0x179bae[_0x3e55('0x2a')][_0x3e55('0x38')]){_0x320bf3[_0x3e55('0x33')]=_[_0x3e55('0x35')](_0x320bf3[_0x3e55('0x33')],{'$or':_[_0x3e55('0x36')](_0x320bf3['attributes'],function(_0x34f023){var _0x18dc07={};_0x18dc07[_0x34f023]={'$like':'%'+_0x179bae['query'][_0x3e55('0x38')]+'%'};return _0x18dc07;})});}_0x320bf3=_[_0x3e55('0x35')]({},_0x320bf3,_0x179bae[_0x3e55('0x39')]);return _0x370cc0[_0x3e55('0x48')](_0x320bf3);}})[_0x3e55('0x21')](function(_0x1c3f81){if(_0x1c3f81){_0xece85f=_0x1c3f81[_0x3e55('0x2f')];if(!_0x179bae[_0x3e55('0x2a')][_0x3e55('0x30')](_0x3e55('0x31'))){_0x320bf3[_0x3e55('0x1a')]=qs[_0x3e55('0x1a')](_0x179bae[_0x3e55('0x2a')][_0x3e55('0x1a')]);_0x320bf3[_0x3e55('0x1c')]=qs['offset'](_0x179bae[_0x3e55('0x2a')][_0x3e55('0x1c')]);}return _0x370cc0[_0x3e55('0x48')](_0x320bf3);}})['then'](function(_0x4dd953){if(_0x4dd953){return _0x4dd953?{'count':_0xece85f,'rows':_0x4dd953}:null;}})['then'](respondWithResult(_0x45a94a,null))[_0x3e55('0x3c')](handleError(_0x45a94a,null));};exports[_0x3e55('0x4a')]=function(_0x50b56f,_0x842277,_0x4b97cd){var _0x37d4ce={};var _0x2b8b94={};var _0x24d4df;var _0x116b12;return db[_0x3e55('0x26')][_0x3e55('0x44')]({'where':{'id':_0x50b56f[_0x3e55('0x42')]['id']}})[_0x3e55('0x21')](handleEntityNotFound(_0x842277,null))[_0x3e55('0x21')](function(_0x5daa22){if(_0x5daa22){_0x24d4df=_0x5daa22;_0x2b8b94[_0x3e55('0x29')]=_['keys'](db[_0x3e55('0x45')]['rawAttributes']);_0x2b8b94[_0x3e55('0x2a')]=_[_0x3e55('0x2b')](_0x50b56f[_0x3e55('0x2a')]);_0x2b8b94[_0x3e55('0x34')]=_[_0x3e55('0x2c')](_0x2b8b94['model'],_0x2b8b94[_0x3e55('0x2a')]);_0x37d4ce[_0x3e55('0x2e')]=_['intersection'](_0x2b8b94[_0x3e55('0x29')],qs['fields'](_0x50b56f[_0x3e55('0x2a')][_0x3e55('0x2d')]));_0x37d4ce[_0x3e55('0x2e')]=_0x37d4ce[_0x3e55('0x2e')]['length']?_0x37d4ce[_0x3e55('0x2e')]:_0x2b8b94[_0x3e55('0x29')];_0x37d4ce[_0x3e55('0x46')]=qs[_0x3e55('0x32')](_0x50b56f[_0x3e55('0x2a')][_0x3e55('0x32')]);_0x37d4ce[_0x3e55('0x33')]=qs['filters'](_[_0x3e55('0x49')](_0x50b56f[_0x3e55('0x2a')],_0x2b8b94[_0x3e55('0x34')]));if(_0x50b56f[_0x3e55('0x2a')]['filter']){_0x37d4ce[_0x3e55('0x33')]=_[_0x3e55('0x35')](_0x37d4ce[_0x3e55('0x33')],{'$or':_['map'](_0x37d4ce[_0x3e55('0x2e')],function(_0x2d0bab){var _0xce141={};_0xce141[_0x2d0bab]={'$like':'%'+_0x50b56f[_0x3e55('0x2a')]['filter']+'%'};return _0xce141;})});}_0x37d4ce=_[_0x3e55('0x35')]({},_0x37d4ce,_0x50b56f[_0x3e55('0x39')]);return _0x24d4df['getFields'](_0x37d4ce);}})[_0x3e55('0x21')](function(_0x1fd6e8){if(_0x1fd6e8){_0x116b12=_0x1fd6e8[_0x3e55('0x2f')];if(!_0x50b56f['query'][_0x3e55('0x30')]('nolimit')){_0x37d4ce[_0x3e55('0x1a')]=qs[_0x3e55('0x1a')](_0x50b56f[_0x3e55('0x2a')][_0x3e55('0x1a')]);_0x37d4ce[_0x3e55('0x1c')]=qs[_0x3e55('0x1c')](_0x50b56f[_0x3e55('0x2a')][_0x3e55('0x1c')]);}return _0x24d4df[_0x3e55('0x4a')](_0x37d4ce);}})['then'](function(_0x3132fd){if(_0x3132fd){return _0x3132fd?{'count':_0x116b12,'rows':_0x3132fd}:null;}})[_0x3e55('0x21')](respondWithResult(_0x842277,null))[_0x3e55('0x3c')](handleError(_0x842277,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 1ecf5fa..47cc8b9 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 _0x24bf=['exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x4e3676,_0x34db46){var _0x5f3159=function(_0x4f91d9){while(--_0x4f91d9){_0x4e3676['push'](_0x4e3676['shift']());}};_0x5f3159(++_0x34db46);}(_0x24bf,0xfa));var _0xf24b=function(_0x5e2f61,_0x5b29de){_0x5e2f61=_0x5e2f61-0x0;var _0x1cb4d0=_0x24bf[_0x5e2f61];return _0x1cb4d0;};'use strict';var _=require(_0xf24b('0x0'));var util=require(_0xf24b('0x1'));var logger=require(_0xf24b('0x2'))(_0xf24b('0x3'));var moment=require('moment');var BPromise=require(_0xf24b('0x4'));var rp=require(_0xf24b('0x5'));var fs=require('fs');var path=require(_0xf24b('0x6'));var rimraf=require(_0xf24b('0x7'));var config=require(_0xf24b('0x8'));var attributes=require(_0xf24b('0x9'));module[_0xf24b('0xa')]=function(_0x185aaf,_0x52652b){return _0x185aaf['define'](_0xf24b('0xb'),attributes,{'tableName':_0xf24b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdcb=['path','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfdcb,0x89));var _0xbfdc=function(_0x19ee96,_0x48b7d5){_0x19ee96=_0x19ee96-0x0;var _0x57aaf0=_0xfdcb[_0x19ee96];return _0x57aaf0;};'use strict';var _=require(_0xbfdc('0x0'));var util=require(_0xbfdc('0x1'));var logger=require(_0xbfdc('0x2'))(_0xbfdc('0x3'));var moment=require('moment');var BPromise=require(_0xbfdc('0x4'));var rp=require(_0xbfdc('0x5'));var fs=require('fs');var path=require(_0xbfdc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbfdc('0x7'));module[_0xbfdc('0x8')]=function(_0x121412,_0xea710f){return _0x121412['define'](_0xbfdc('0x9'),attributes,{'tableName':_0xbfdc('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 af92e31..b224d50 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 _0x4f53=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x5032ab,_0x366f18){var _0x3312bf=function(_0x41480a){while(--_0x41480a){_0x5032ab['push'](_0x5032ab['shift']());}};_0x3312bf(++_0x366f18);}(_0x4f53,0x69));var _0x34f5=function(_0x1463fb,_0x50229f){_0x1463fb=_0x1463fb-0x0;var _0x4131ff=_0x4f53[_0x1463fb];return _0x4131ff;};'use strict';var _=require(_0x34f5('0x0'));var util=require(_0x34f5('0x1'));var moment=require(_0x34f5('0x2'));var BPromise=require(_0x34f5('0x3'));var rs=require(_0x34f5('0x4'));var fs=require('fs');var Redis=require(_0x34f5('0x5'));var db=require(_0x34f5('0x6'))['db'];var utils=require(_0x34f5('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x34f5('0x8'));var jayson=require(_0x34f5('0x9'));var client=jayson['client'][_0x34f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d971d,_0x150a32,_0x1b335f){return new BPromise(function(_0x1d3000,_0x36cbda){return client[_0x34f5('0xb')](_0x3d971d,_0x1b335f)[_0x34f5('0xc')](function(_0x4f6579){logger[_0x34f5('0xd')](_0x34f5('0xe'),_0x150a32,_0x34f5('0xf'));logger[_0x34f5('0x10')](_0x34f5('0x11'),_0x150a32,_0x34f5('0xf'),JSON[_0x34f5('0x12')](_0x4f6579));if(_0x4f6579[_0x34f5('0x13')]){if(_0x4f6579['error'][_0x34f5('0x14')]===0x1f4){logger[_0x34f5('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x150a32,_0x4f6579[_0x34f5('0x13')][_0x34f5('0x15')]);return _0x36cbda(_0x4f6579[_0x34f5('0x13')][_0x34f5('0x15')]);}logger['error'](_0x34f5('0xe'),_0x150a32,_0x4f6579[_0x34f5('0x13')]['message']);return _0x1d3000(_0x4f6579['error'][_0x34f5('0x15')]);}else{logger[_0x34f5('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x150a32,_0x34f5('0xf'));_0x1d3000(_0x4f6579[_0x34f5('0x16')]['message']);}})[_0x34f5('0x17')](function(_0x2a7df3){logger[_0x34f5('0x13')](_0x34f5('0xe'),_0x150a32,_0x2a7df3);_0x36cbda(_0x2a7df3);});});} \ No newline at end of file +var _0xd16f=['jayson/promise','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x539346,_0x2ee4db){var _0x4e50f0=function(_0x575540){while(--_0x575540){_0x539346['push'](_0x539346['shift']());}};_0x4e50f0(++_0x2ee4db);}(_0xd16f,0x73));var _0xfd16=function(_0x3c846c,_0x1627a5){_0x3c846c=_0x3c846c-0x0;var _0x29f169=_0xd16f[_0x3c846c];return _0x29f169;};'use strict';var _=require(_0xfd16('0x0'));var util=require(_0xfd16('0x1'));var moment=require(_0xfd16('0x2'));var BPromise=require(_0xfd16('0x3'));var rs=require(_0xfd16('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd16('0x5'))['db'];var utils=require(_0xfd16('0x6'));var logger=require(_0xfd16('0x7'))(_0xfd16('0x8'));var config=require(_0xfd16('0x9'));var jayson=require(_0xfd16('0xa'));var client=jayson[_0xfd16('0xb')][_0xfd16('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28dd98,_0x273a26,_0x2dafcc){return new BPromise(function(_0x38acbc,_0x43fb44){return client[_0xfd16('0xd')](_0x28dd98,_0x2dafcc)['then'](function(_0x40a68e){logger['info'](_0xfd16('0xe'),_0x273a26,_0xfd16('0xf'));logger[_0xfd16('0x10')](_0xfd16('0x11'),_0x273a26,_0xfd16('0xf'),JSON[_0xfd16('0x12')](_0x40a68e));if(_0x40a68e[_0xfd16('0x13')]){if(_0x40a68e[_0xfd16('0x13')][_0xfd16('0x14')]===0x1f4){logger['error'](_0xfd16('0xe'),_0x273a26,_0x40a68e[_0xfd16('0x13')][_0xfd16('0x15')]);return _0x43fb44(_0x40a68e[_0xfd16('0x13')]['message']);}logger[_0xfd16('0x13')](_0xfd16('0xe'),_0x273a26,_0x40a68e[_0xfd16('0x13')][_0xfd16('0x15')]);return _0x38acbc(_0x40a68e['error'][_0xfd16('0x15')]);}else{logger[_0xfd16('0x16')](_0xfd16('0xe'),_0x273a26,_0xfd16('0xf'));_0x38acbc(_0x40a68e[_0xfd16('0x17')]['message']);}})[_0xfd16('0x18')](function(_0x52a1b8){logger['error'](_0xfd16('0xe'),_0x273a26,_0x52a1b8);_0x43fb44(_0x52a1b8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index f14df0d..d19c0c0 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 _0xaf1d=['show','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0x8e74d1,_0x5835e9){var _0x31936c=function(_0x17ca2b){while(--_0x17ca2b){_0x8e74d1['push'](_0x8e74d1['shift']());}};_0x31936c(++_0x5835e9);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x123762,_0x5d5e7d){_0x123762=_0x123762-0x0;var _0x20ff95=_0xaf1d[_0x123762];return _0x20ff95;};'use strict';var multer=require(_0xdaf1('0x0'));var util=require(_0xdaf1('0x1'));var path=require(_0xdaf1('0x2'));var timeout=require(_0xdaf1('0x3'));var express=require('express');var router=express[_0xdaf1('0x4')]();var fs_extra=require(_0xdaf1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdaf1('0x6'));var config=require(_0xdaf1('0x7'));var controller=require(_0xdaf1('0x8'));router[_0xdaf1('0x9')]('/',auth[_0xdaf1('0xa')](),controller[_0xdaf1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdaf1('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdaf1('0xd')]);router[_0xdaf1('0xe')](_0xdaf1('0xf'),auth[_0xdaf1('0xa')](),controller['update']);router[_0xdaf1('0x10')](_0xdaf1('0xf'),auth[_0xdaf1('0xa')](),controller[_0xdaf1('0x11')]);module[_0xdaf1('0x12')]=router; \ No newline at end of file +var _0x9ef8=['index','get','/:id','show','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x9ef8,0x17f));var _0x89ef=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x9ef8[_0x211632];return _0x5a1da1;};'use strict';var multer=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var path=require('path');var timeout=require(_0x89ef('0x2'));var express=require(_0x89ef('0x3'));var router=express[_0x89ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89ef('0x5'));var interaction=require(_0x89ef('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0x8')]);router[_0x89ef('0x9')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xb')]);router[_0x89ef('0xc')]('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0xd')]);router['put'](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xe')]);router['delete'](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xf')]);module[_0x89ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 7310a89..0c9d38f 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 _0x29a2=['picklist','string','STRING','BOOLEAN','ENUM','variable','keyValue'];(function(_0x1513c8,_0x4ca319){var _0x261a16=function(_0x5bca8c){while(--_0x5bca8c){_0x1513c8['push'](_0x1513c8['shift']());}};_0x261a16(++_0x4ca319);}(_0x29a2,0x13f));var _0x229a=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x29a2[_0x2ff238];return _0x204a56;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x229a('0x0')]('string',_0x229a('0x1'),'customVariable',_0x229a('0x2'),_0x229a('0x3')),'defaultValue':_0x229a('0x4')},'content':{'type':Sequelize[_0x229a('0x5')]},'key':{'type':Sequelize[_0x229a('0x5')]},'keyType':{'type':Sequelize[_0x229a('0x0')](_0x229a('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x229a('0x5')]},'idField':{'type':Sequelize[_0x229a('0x5')]},'nameField':{'type':Sequelize[_0x229a('0x5')]},'customField':{'type':Sequelize[_0x229a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x229a('0x5')]}}; \ No newline at end of file +var _0xee3d=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee3d,0x88));var _0xdee3=function(_0x2626a6,_0x5eae7b){_0x2626a6=_0x2626a6-0x0;var _0x2bfb93=_0xee3d[_0x2626a6];return _0x2bfb93;};'use strict';var Sequelize=require(_0xdee3('0x0'));module[_0xdee3('0x1')]={'type':{'type':Sequelize[_0xdee3('0x2')](_0xdee3('0x3'),_0xdee3('0x4'),_0xdee3('0x5'),_0xdee3('0x6'),'picklist'),'defaultValue':_0xdee3('0x3')},'content':{'type':Sequelize[_0xdee3('0x7')]},'key':{'type':Sequelize[_0xdee3('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdee3('0x3'),'variable',_0xdee3('0x5'))},'keyContent':{'type':Sequelize[_0xdee3('0x7')]},'idField':{'type':Sequelize[_0xdee3('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdee3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdee3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 27bd4ae..e17ae80 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 _0x6c34=['fast-json-patch','request-promise','moment','util','path','fs-extra','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','create','body','find','params','zip-dir'];(function(_0xce3797,_0x1671a3){var _0x7849f3=function(_0x396abc){while(--_0x396abc){_0xce3797['push'](_0xce3797['shift']());}};_0x7849f3(++_0x1671a3);}(_0x6c34,0x162));var _0x46c3=function(_0x44361b,_0x3c0f01){_0x44361b=_0x44361b-0x0;var _0x210220=_0x6c34[_0x44361b];return _0x210220;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x46c3('0x0'));var jsonpatch=require(_0x46c3('0x1'));var rp=require(_0x46c3('0x2'));var moment=require(_0x46c3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46c3('0x4'));var path=require(_0x46c3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46c3('0x6'));var _=require('lodash');var squel=require(_0x46c3('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46c3('0x8'));var toCsv=require(_0x46c3('0x9'));var querystring=require(_0x46c3('0xa'));var Papa=require(_0x46c3('0xb'));var Redis=require('ioredis');var authService=require(_0x46c3('0xc'));var qs=require(_0x46c3('0xd'));var as=require(_0x46c3('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46c3('0xf'))(_0x46c3('0x10'));var utils=require(_0x46c3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x46c3('0x12'));var db=require(_0x46c3('0x13'))['db'];function respondWithStatusCode(_0x3af895,_0x3421ae){_0x3421ae=_0x3421ae||0xcc;return function(_0x1d12ae){if(_0x1d12ae){return _0x3af895['sendStatus'](_0x3421ae);}return _0x3af895[_0x46c3('0x14')](_0x3421ae)[_0x46c3('0x15')]();};}function respondWithResult(_0x23a446,_0x9eaf5c){_0x9eaf5c=_0x9eaf5c||0xc8;return function(_0x54673f){if(_0x54673f){return _0x23a446['status'](_0x9eaf5c)[_0x46c3('0x16')](_0x54673f);}};}function respondWithFilteredResult(_0x4347be,_0x14a447){return function(_0x339ee9){if(_0x339ee9){var _0x4043fd=typeof _0x14a447[_0x46c3('0x17')]===_0x46c3('0x18')&&typeof _0x14a447[_0x46c3('0x19')]===_0x46c3('0x18');var _0x21533a=_0x339ee9[_0x46c3('0x1a')];var _0x222747=_0x4043fd?0x0:_0x14a447[_0x46c3('0x17')];var _0x1f86f9=_0x4043fd?_0x339ee9['count']:_0x14a447[_0x46c3('0x17')]+_0x14a447[_0x46c3('0x19')];var _0x46b69d;if(_0x1f86f9>=_0x21533a){_0x1f86f9=_0x21533a;_0x46b69d=0xc8;}else{_0x46b69d=0xce;}_0x4347be[_0x46c3('0x14')](_0x46b69d);return _0x4347be[_0x46c3('0x1b')](_0x46c3('0x1c'),_0x222747+'-'+_0x1f86f9+'/'+_0x21533a)[_0x46c3('0x16')](_0x339ee9);}return null;};}function patchUpdates(_0x13932a){return function(_0x1968f9){try{jsonpatch[_0x46c3('0x1d')](_0x1968f9,_0x13932a,!![]);}catch(_0xdd00dd){return BPromise[_0x46c3('0x1e')](_0xdd00dd);}return _0x1968f9[_0x46c3('0x1f')]();};}function saveUpdates(_0x37d982,_0x1a2250){return function(_0xde25d4){if(_0xde25d4){return _0xde25d4[_0x46c3('0x20')](_0x37d982)['then'](function(_0x2af16d){return _0x2af16d;});}return null;};}function removeEntity(_0x51233f,_0x3445e2){return function(_0x294e48){if(_0x294e48){return _0x294e48[_0x46c3('0x21')]()[_0x46c3('0x22')](function(){_0x51233f[_0x46c3('0x14')](0xcc)[_0x46c3('0x15')]();});}};}function handleEntityNotFound(_0xda4081,_0x1a3b44){return function(_0x23cf8c){if(!_0x23cf8c){_0xda4081[_0x46c3('0x23')](0x194);}return _0x23cf8c;};}function handleError(_0xbb60d0,_0xc56780){_0xc56780=_0xc56780||0x1f4;return function(_0x2b5fb5){logger[_0x46c3('0x24')](_0x2b5fb5[_0x46c3('0x25')]);if(_0x2b5fb5[_0x46c3('0x26')]){delete _0x2b5fb5[_0x46c3('0x26')];}_0xbb60d0[_0x46c3('0x14')](_0xc56780)[_0x46c3('0x27')](_0x2b5fb5);};}exports[_0x46c3('0x28')]=function(_0x575764,_0x5f4518){var _0x1cfefd={},_0x3281e0={},_0x4818e9={'count':0x0,'rows':[]};var _0x4e9aec=_[_0x46c3('0x29')](db[_0x46c3('0x2a')][_0x46c3('0x2b')],function(_0x117b5a){return{'name':_0x117b5a[_0x46c3('0x2c')],'type':_0x117b5a[_0x46c3('0x2d')][_0x46c3('0x2e')]};});_0x3281e0[_0x46c3('0x2f')]=_[_0x46c3('0x29')](_0x4e9aec,'name');_0x3281e0[_0x46c3('0x30')]=_[_0x46c3('0x31')](_0x575764[_0x46c3('0x30')]);_0x3281e0[_0x46c3('0x32')]=_[_0x46c3('0x33')](_0x3281e0[_0x46c3('0x2f')],_0x3281e0[_0x46c3('0x30')]);_0x1cfefd[_0x46c3('0x34')]=_[_0x46c3('0x33')](_0x3281e0['model'],qs['fields'](_0x575764['query']['fields']));_0x1cfefd[_0x46c3('0x34')]=_0x1cfefd[_0x46c3('0x34')][_0x46c3('0x35')]?_0x1cfefd[_0x46c3('0x34')]:_0x3281e0[_0x46c3('0x2f')];if(!_0x575764[_0x46c3('0x30')][_0x46c3('0x36')](_0x46c3('0x37'))){_0x1cfefd['limit']=qs[_0x46c3('0x19')](_0x575764[_0x46c3('0x30')][_0x46c3('0x19')]);_0x1cfefd[_0x46c3('0x17')]=qs[_0x46c3('0x17')](_0x575764['query'][_0x46c3('0x17')]);}_0x1cfefd['order']=qs[_0x46c3('0x38')](_0x575764[_0x46c3('0x30')]['sort']);_0x1cfefd[_0x46c3('0x39')]=qs[_0x46c3('0x32')](_[_0x46c3('0x3a')](_0x575764['query'],_0x3281e0[_0x46c3('0x32')]),_0x4e9aec);if(_0x575764[_0x46c3('0x30')][_0x46c3('0x3b')]){_0x1cfefd[_0x46c3('0x39')]=_[_0x46c3('0x3c')](_0x1cfefd[_0x46c3('0x39')],{'$or':_[_0x46c3('0x29')](_0x4e9aec,function(_0x1b4207){if(_0x1b4207[_0x46c3('0x2d')]!==_0x46c3('0x3d')){var _0x22b412={};_0x22b412[_0x1b4207[_0x46c3('0x26')]]={'$like':'%'+_0x575764[_0x46c3('0x30')][_0x46c3('0x3b')]+'%'};return _0x22b412;}})});}_0x1cfefd=_[_0x46c3('0x3c')]({},_0x1cfefd,_0x575764[_0x46c3('0x3e')]);var _0x345398={'where':_0x1cfefd[_0x46c3('0x39')]};return db[_0x46c3('0x2a')][_0x46c3('0x1a')](_0x345398)[_0x46c3('0x22')](function(_0x1e687e){_0x4818e9['count']=_0x1e687e;if(_0x575764[_0x46c3('0x30')][_0x46c3('0x3f')]){_0x1cfefd[_0x46c3('0x40')]=[{'all':!![]}];}return db[_0x46c3('0x2a')][_0x46c3('0x41')](_0x1cfefd);})[_0x46c3('0x22')](function(_0x130983){_0x4818e9['rows']=_0x130983;return _0x4818e9;})[_0x46c3('0x22')](respondWithFilteredResult(_0x5f4518,_0x1cfefd))['catch'](handleError(_0x5f4518,null));};exports['show']=function(_0x50cff2,_0x48ca53){var _0x4fe8fc={'raw':!![],'where':{'id':_0x50cff2['params']['id']}},_0x57bd95={};_0x57bd95['model']=_[_0x46c3('0x31')](db[_0x46c3('0x2a')][_0x46c3('0x2b')]);_0x57bd95['query']=_[_0x46c3('0x31')](_0x50cff2['query']);_0x57bd95[_0x46c3('0x32')]=_['intersection'](_0x57bd95[_0x46c3('0x2f')],_0x57bd95[_0x46c3('0x30')]);_0x4fe8fc[_0x46c3('0x34')]=_[_0x46c3('0x33')](_0x57bd95[_0x46c3('0x2f')],qs['fields'](_0x50cff2[_0x46c3('0x30')]['fields']));_0x4fe8fc[_0x46c3('0x34')]=_0x4fe8fc['attributes'][_0x46c3('0x35')]?_0x4fe8fc['attributes']:_0x57bd95[_0x46c3('0x2f')];if(_0x50cff2[_0x46c3('0x30')]['includeAll']){_0x4fe8fc['include']=[{'all':!![]}];}_0x4fe8fc=_[_0x46c3('0x3c')]({},_0x4fe8fc,_0x50cff2[_0x46c3('0x3e')]);return db[_0x46c3('0x2a')]['find'](_0x4fe8fc)[_0x46c3('0x22')](handleEntityNotFound(_0x48ca53,null))['then'](respondWithResult(_0x48ca53,null))[_0x46c3('0x42')](handleError(_0x48ca53,null));};exports[_0x46c3('0x43')]=function(_0x4c8eef,_0x47e27a){return db[_0x46c3('0x2a')][_0x46c3('0x43')](_0x4c8eef['body'],{})[_0x46c3('0x22')](respondWithResult(_0x47e27a,0xc9))[_0x46c3('0x42')](handleError(_0x47e27a,null));};exports[_0x46c3('0x20')]=function(_0x19f34b,_0x474c53){if(_0x19f34b[_0x46c3('0x44')]['id']){delete _0x19f34b[_0x46c3('0x44')]['id'];}return db[_0x46c3('0x2a')][_0x46c3('0x45')]({'where':{'id':_0x19f34b[_0x46c3('0x46')]['id']}})[_0x46c3('0x22')](handleEntityNotFound(_0x474c53,null))[_0x46c3('0x22')](saveUpdates(_0x19f34b[_0x46c3('0x44')],null))[_0x46c3('0x22')](respondWithResult(_0x474c53,null))[_0x46c3('0x42')](handleError(_0x474c53,null));};exports[_0x46c3('0x21')]=function(_0x101b74,_0x19dc54){return db[_0x46c3('0x2a')][_0x46c3('0x45')]({'where':{'id':_0x101b74[_0x46c3('0x46')]['id']}})[_0x46c3('0x22')](handleEntityNotFound(_0x19dc54,null))[_0x46c3('0x22')](removeEntity(_0x19dc54,null))['catch'](handleError(_0x19dc54,null));}; \ No newline at end of file +var _0xb161=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','FreshsalesField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find','create','body','zip-dir','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'];(function(_0x5c7403,_0x4bf9f0){var _0x101e87=function(_0x2b050f){while(--_0x2b050f){_0x5c7403['push'](_0x5c7403['shift']());}};_0x101e87(++_0x4bf9f0);}(_0xb161,0xc8));var _0x1b16=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0xb161[_0x4e170e];return _0x338291;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b16('0x0'));var jsonpatch=require(_0x1b16('0x1'));var rp=require('request-promise');var moment=require(_0x1b16('0x2'));var BPromise=require(_0x1b16('0x3'));var Mustache=require(_0x1b16('0x4'));var util=require(_0x1b16('0x5'));var path=require('path');var sox=require(_0x1b16('0x6'));var csv=require(_0x1b16('0x7'));var ejs=require(_0x1b16('0x8'));var fs=require('fs');var fs_extra=require(_0x1b16('0x9'));var _=require(_0x1b16('0xa'));var squel=require(_0x1b16('0xb'));var crypto=require(_0x1b16('0xc'));var jsforce=require(_0x1b16('0xd'));var deskjs=require(_0x1b16('0xe'));var toCsv=require(_0x1b16('0x7'));var querystring=require(_0x1b16('0xf'));var Papa=require(_0x1b16('0x10'));var Redis=require(_0x1b16('0x11'));var authService=require(_0x1b16('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b16('0x13'))(_0x1b16('0x14'));var utils=require(_0x1b16('0x15'));var config=require(_0x1b16('0x16'));var licenseUtil=require(_0x1b16('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e801,_0x2d478d){_0x2d478d=_0x2d478d||0xcc;return function(_0x43560e){if(_0x43560e){return _0x15e801[_0x1b16('0x18')](_0x2d478d);}return _0x15e801[_0x1b16('0x19')](_0x2d478d)[_0x1b16('0x1a')]();};}function respondWithResult(_0x109ac7,_0x4948e8){_0x4948e8=_0x4948e8||0xc8;return function(_0x1d2be8){if(_0x1d2be8){return _0x109ac7[_0x1b16('0x19')](_0x4948e8)[_0x1b16('0x1b')](_0x1d2be8);}};}function respondWithFilteredResult(_0x3747de,_0x492a30){return function(_0x2afcba){if(_0x2afcba){var _0x439520=typeof _0x492a30['offset']===_0x1b16('0x1c')&&typeof _0x492a30['limit']===_0x1b16('0x1c');var _0x2887b5=_0x2afcba['count'];var _0x3ac785=_0x439520?0x0:_0x492a30[_0x1b16('0x1d')];var _0x77d3fc=_0x439520?_0x2afcba[_0x1b16('0x1e')]:_0x492a30[_0x1b16('0x1d')]+_0x492a30[_0x1b16('0x1f')];var _0x3b8c59;if(_0x77d3fc>=_0x2887b5){_0x77d3fc=_0x2887b5;_0x3b8c59=0xc8;}else{_0x3b8c59=0xce;}_0x3747de['status'](_0x3b8c59);return _0x3747de[_0x1b16('0x20')](_0x1b16('0x21'),_0x3ac785+'-'+_0x77d3fc+'/'+_0x2887b5)['json'](_0x2afcba);}return null;};}function patchUpdates(_0x4f4f03){return function(_0x44669b){try{jsonpatch['apply'](_0x44669b,_0x4f4f03,!![]);}catch(_0x4a53d8){return BPromise[_0x1b16('0x22')](_0x4a53d8);}return _0x44669b[_0x1b16('0x23')]();};}function saveUpdates(_0x473a82,_0x19d69e){return function(_0x172125){if(_0x172125){return _0x172125[_0x1b16('0x24')](_0x473a82)[_0x1b16('0x25')](function(_0xc6cde5){return _0xc6cde5;});}return null;};}function removeEntity(_0x37c1f5,_0x3c9045){return function(_0x56190a){if(_0x56190a){return _0x56190a[_0x1b16('0x26')]()[_0x1b16('0x25')](function(){_0x37c1f5[_0x1b16('0x19')](0xcc)[_0x1b16('0x1a')]();});}};}function handleEntityNotFound(_0x47deed,_0x2b01c3){return function(_0x59aea5){if(!_0x59aea5){_0x47deed[_0x1b16('0x18')](0x194);}return _0x59aea5;};}function handleError(_0x533c54,_0x348f79){_0x348f79=_0x348f79||0x1f4;return function(_0x220f31){logger[_0x1b16('0x27')](_0x220f31[_0x1b16('0x28')]);if(_0x220f31[_0x1b16('0x29')]){delete _0x220f31['name'];}_0x533c54[_0x1b16('0x19')](_0x348f79)['send'](_0x220f31);};}exports['index']=function(_0x2f891e,_0x53b31d){var _0x4de7dc={},_0xbf6931={},_0x3e7a69={'count':0x0,'rows':[]};var _0x1c7296=_[_0x1b16('0x2a')](db[_0x1b16('0x2b')][_0x1b16('0x2c')],function(_0x69c1a0){return{'name':_0x69c1a0['fieldName'],'type':_0x69c1a0[_0x1b16('0x2d')][_0x1b16('0x2e')]};});_0xbf6931[_0x1b16('0x2f')]=_[_0x1b16('0x2a')](_0x1c7296,_0x1b16('0x29'));_0xbf6931[_0x1b16('0x30')]=_[_0x1b16('0x31')](_0x2f891e[_0x1b16('0x30')]);_0xbf6931[_0x1b16('0x32')]=_[_0x1b16('0x33')](_0xbf6931[_0x1b16('0x2f')],_0xbf6931[_0x1b16('0x30')]);_0x4de7dc[_0x1b16('0x34')]=_[_0x1b16('0x33')](_0xbf6931['model'],qs['fields'](_0x2f891e[_0x1b16('0x30')][_0x1b16('0x35')]));_0x4de7dc[_0x1b16('0x34')]=_0x4de7dc[_0x1b16('0x34')][_0x1b16('0x36')]?_0x4de7dc[_0x1b16('0x34')]:_0xbf6931[_0x1b16('0x2f')];if(!_0x2f891e['query'][_0x1b16('0x37')](_0x1b16('0x38'))){_0x4de7dc['limit']=qs[_0x1b16('0x1f')](_0x2f891e[_0x1b16('0x30')]['limit']);_0x4de7dc[_0x1b16('0x1d')]=qs['offset'](_0x2f891e[_0x1b16('0x30')][_0x1b16('0x1d')]);}_0x4de7dc[_0x1b16('0x39')]=qs[_0x1b16('0x3a')](_0x2f891e[_0x1b16('0x30')][_0x1b16('0x3a')]);_0x4de7dc['where']=qs[_0x1b16('0x32')](_[_0x1b16('0x3b')](_0x2f891e[_0x1b16('0x30')],_0xbf6931[_0x1b16('0x32')]),_0x1c7296);if(_0x2f891e[_0x1b16('0x30')][_0x1b16('0x3c')]){_0x4de7dc[_0x1b16('0x3d')]=_[_0x1b16('0x3e')](_0x4de7dc[_0x1b16('0x3d')],{'$or':_[_0x1b16('0x2a')](_0x1c7296,function(_0x382325){if(_0x382325[_0x1b16('0x2d')]!==_0x1b16('0x3f')){var _0x2f6c39={};_0x2f6c39[_0x382325[_0x1b16('0x29')]]={'$like':'%'+_0x2f891e[_0x1b16('0x30')][_0x1b16('0x3c')]+'%'};return _0x2f6c39;}})});}_0x4de7dc=_['merge']({},_0x4de7dc,_0x2f891e[_0x1b16('0x40')]);var _0x3d3306={'where':_0x4de7dc[_0x1b16('0x3d')]};return db[_0x1b16('0x2b')][_0x1b16('0x1e')](_0x3d3306)[_0x1b16('0x25')](function(_0x29f68d){_0x3e7a69[_0x1b16('0x1e')]=_0x29f68d;if(_0x2f891e[_0x1b16('0x30')][_0x1b16('0x41')]){_0x4de7dc['include']=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x4de7dc);})['then'](function(_0xb2ef35){_0x3e7a69[_0x1b16('0x42')]=_0xb2ef35;return _0x3e7a69;})['then'](respondWithFilteredResult(_0x53b31d,_0x4de7dc))[_0x1b16('0x43')](handleError(_0x53b31d,null));};exports[_0x1b16('0x44')]=function(_0x37be09,_0xd6a807){var _0x2c9b4f={'raw':!![],'where':{'id':_0x37be09[_0x1b16('0x45')]['id']}},_0xd7110e={};_0xd7110e[_0x1b16('0x2f')]=_['keys'](db[_0x1b16('0x2b')][_0x1b16('0x2c')]);_0xd7110e[_0x1b16('0x30')]=_[_0x1b16('0x31')](_0x37be09[_0x1b16('0x30')]);_0xd7110e['filters']=_[_0x1b16('0x33')](_0xd7110e[_0x1b16('0x2f')],_0xd7110e[_0x1b16('0x30')]);_0x2c9b4f[_0x1b16('0x34')]=_[_0x1b16('0x33')](_0xd7110e[_0x1b16('0x2f')],qs[_0x1b16('0x35')](_0x37be09[_0x1b16('0x30')][_0x1b16('0x35')]));_0x2c9b4f[_0x1b16('0x34')]=_0x2c9b4f[_0x1b16('0x34')][_0x1b16('0x36')]?_0x2c9b4f[_0x1b16('0x34')]:_0xd7110e[_0x1b16('0x2f')];if(_0x37be09[_0x1b16('0x30')][_0x1b16('0x41')]){_0x2c9b4f['include']=[{'all':!![]}];}_0x2c9b4f=_[_0x1b16('0x3e')]({},_0x2c9b4f,_0x37be09[_0x1b16('0x40')]);return db[_0x1b16('0x2b')][_0x1b16('0x46')](_0x2c9b4f)['then'](handleEntityNotFound(_0xd6a807,null))['then'](respondWithResult(_0xd6a807,null))[_0x1b16('0x43')](handleError(_0xd6a807,null));};exports[_0x1b16('0x47')]=function(_0x3deba6,_0x46cd48){return db[_0x1b16('0x2b')][_0x1b16('0x47')](_0x3deba6[_0x1b16('0x48')],{})[_0x1b16('0x25')](respondWithResult(_0x46cd48,0xc9))[_0x1b16('0x43')](handleError(_0x46cd48,null));};exports[_0x1b16('0x24')]=function(_0x912d01,_0x310c12){if(_0x912d01[_0x1b16('0x48')]['id']){delete _0x912d01['body']['id'];}return db[_0x1b16('0x2b')][_0x1b16('0x46')]({'where':{'id':_0x912d01[_0x1b16('0x45')]['id']}})[_0x1b16('0x25')](handleEntityNotFound(_0x310c12,null))[_0x1b16('0x25')](saveUpdates(_0x912d01[_0x1b16('0x48')],null))[_0x1b16('0x25')](respondWithResult(_0x310c12,null))[_0x1b16('0x43')](handleError(_0x310c12,null));};exports['destroy']=function(_0x2172c5,_0x4d2db0){return db['FreshsalesField']['find']({'where':{'id':_0x2172c5[_0x1b16('0x45')]['id']}})[_0x1b16('0x25')](handleEntityNotFound(_0x4d2db0,null))[_0x1b16('0x25')](removeEntity(_0x4d2db0,null))[_0x1b16('0x43')](handleError(_0x4d2db0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b92d54b..505c3f7 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 _0xc74c=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xc74c,0x163));var _0xcc74=function(_0xecb6a7,_0x47f68f){_0xecb6a7=_0xecb6a7-0x0;var _0x1db1e4=_0xc74c[_0xecb6a7];return _0x1db1e4;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc74('0x2'));var BPromise=require(_0xcc74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc74('0x4'));var rimraf=require(_0xcc74('0x5'));var config=require(_0xcc74('0x6'));var attributes=require(_0xcc74('0x7'));module[_0xcc74('0x8')]=function(_0x23c249,_0x425b73){return _0x23c249['define'](_0xcc74('0x9'),attributes,{'tableName':_0xcc74('0xa'),'paranoid':![],'indexes':[{'name':_0xcc74('0xb'),'fields':[_0xcc74('0xc'),_0xcc74('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8768=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x39a1d7,_0x4d037f){var _0x4742e2=function(_0x4cb920){while(--_0x4cb920){_0x39a1d7['push'](_0x39a1d7['shift']());}};_0x4742e2(++_0x4d037f);}(_0x8768,0xa1));var _0x8876=function(_0x47c445,_0x242543){_0x47c445=_0x47c445-0x0;var _0x1b9c0c=_0x8768[_0x47c445];return _0x1b9c0c;};'use strict';var _=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var logger=require(_0x8876('0x2'))(_0x8876('0x3'));var moment=require(_0x8876('0x4'));var BPromise=require(_0x8876('0x5'));var rp=require(_0x8876('0x6'));var fs=require('fs');var path=require(_0x8876('0x7'));var rimraf=require(_0x8876('0x8'));var config=require(_0x8876('0x9'));var attributes=require(_0x8876('0xa'));module[_0x8876('0xb')]=function(_0x159d68,_0x5431cb){return _0x159d68[_0x8876('0xc')](_0x8876('0xd'),attributes,{'tableName':_0x8876('0xe'),'paranoid':![],'indexes':[{'name':_0x8876('0xf'),'fields':[_0x8876('0x10'),'FieldId'],'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 40f5a58..4829f37 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 _0x814b=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x814b,0x1a2));var _0xb814=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0x814b[_0xe501ff];return _0x17135d;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2ae15f,_0x3e1860){var _0x42a3d3=function(_0xcd0e60){while(--_0xcd0e60){_0x2ae15f['push'](_0x2ae15f['shift']());}};_0x42a3d3(++_0x3e1860);}(_0x5fab,0x177));var _0xb5fa=function(_0x2fb0e5,_0x45e57a){_0x2fb0e5=_0x2fb0e5-0x0;var _0x584d1f=_0x5fab[_0x2fb0e5];return _0x584d1f;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 0306b26..515fa51 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x59d17f,_0x1a3e87){var _0x24973b=function(_0x3cb4c7){while(--_0x3cb4c7){_0x59d17f['push'](_0x59d17f['shift']());}};_0x24973b(++_0x1a3e87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x42c14c,_0x48e53b){var _0xf25b1=function(_0x934f3d){while(--_0x934f3d){_0x42c14c['push'](_0x42c14c['shift']());}};_0xf25b1(++_0x48e53b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 7bda8d8..d4ea960 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 _0xd798=['ENUM','integrationTab','newTab','STRING'];(function(_0x590fc8,_0x31fe0b){var _0x59f1ba=function(_0x3415fd){while(--_0x3415fd){_0x590fc8['push'](_0x590fc8['shift']());}};_0x59f1ba(++_0x31fe0b);}(_0xd798,0x77));var _0x8d79=function(_0x31d230,_0x7a1294){_0x31d230=_0x31d230-0x0;var _0x34d8a8=_0xd798[_0x31d230];return _0x34d8a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8d79('0x0')]},'username':{'type':Sequelize[_0x8d79('0x0')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8d79('0x0')]},'clientId':{'type':Sequelize[_0x8d79('0x0')]},'clientSecret':{'type':Sequelize[_0x8d79('0x0')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x8d79('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x8d79('0x1')](_0x8d79('0x2'),_0x8d79('0x3')),'defaultValue':_0x8d79('0x2')}}; \ No newline at end of file +var _0xc43c=['newTab','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x41ab5c,_0x14800f){var _0xab348=function(_0x46ea20){while(--_0x46ea20){_0x41ab5c['push'](_0x41ab5c['shift']());}};_0xab348(++_0x14800f);}(_0xc43c,0xd4));var _0xcc43=function(_0x67706c,_0x4c445b){_0x67706c=_0x67706c-0x0;var _0x55c682=_0xc43c[_0x67706c];return _0x55c682;};'use strict';var Sequelize=require(_0xcc43('0x0'));module[_0xcc43('0x1')]={'name':{'type':Sequelize[_0xcc43('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xcc43('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xcc43('0x2')]},'serverUrl':{'type':Sequelize[_0xcc43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcc43('0x3')]('integrationTab',_0xcc43('0x4')),'defaultValue':_0xcc43('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index d5fd490..d7eae34 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 _0x54fb=['channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','boolean','email','textarea','remove','includes','label','custom','picklistValues','true','false','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','query','model','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','SalesforceAccount','includeAll','include','rows','catch','show','params','find','create','body','update','findOne','SalesforceConfiguration','order','pick','hasOwnProperty','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x54fb,0x11f));var _0xb54f=function(_0x4ba961,_0x306042){_0x4ba961=_0x4ba961-0x0;var _0x47436b=_0x54fb[_0x4ba961];return _0x47436b;};'use strict';var emlformat=require(_0xb54f('0x0'));var rimraf=require(_0xb54f('0x1'));var zipdir=require(_0xb54f('0x2'));var jsonpatch=require(_0xb54f('0x3'));var rp=require(_0xb54f('0x4'));var moment=require('moment');var BPromise=require(_0xb54f('0x5'));var Mustache=require(_0xb54f('0x6'));var util=require(_0xb54f('0x7'));var path=require(_0xb54f('0x8'));var sox=require(_0xb54f('0x9'));var csv=require(_0xb54f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb54f('0xb'));var _=require(_0xb54f('0xc'));var squel=require(_0xb54f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb54f('0xe'));var toCsv=require(_0xb54f('0xa'));var querystring=require('querystring');var Papa=require(_0xb54f('0xf'));var Redis=require(_0xb54f('0x10'));var authService=require(_0xb54f('0x11'));var qs=require(_0xb54f('0x12'));var as=require(_0xb54f('0x13'));var hardwareService=require(_0xb54f('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb54f('0x15'));var config=require(_0xb54f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb54f('0x17'))['db'];var integrations=require(_0xb54f('0x18'));function respondWithStatusCode(_0x48bef2,_0x26513b){_0x26513b=_0x26513b||0xcc;return function(_0x936ab0){if(_0x936ab0){return _0x48bef2['sendStatus'](_0x26513b);}return _0x48bef2[_0xb54f('0x19')](_0x26513b)[_0xb54f('0x1a')]();};}function respondWithResult(_0x59dcef,_0x121348){_0x121348=_0x121348||0xc8;return function(_0x117df4){if(_0x117df4){return _0x59dcef[_0xb54f('0x19')](_0x121348)[_0xb54f('0x1b')](_0x117df4);}};}function respondWithFilteredResult(_0x120abf,_0x425f17){return function(_0x11006e){if(_0x11006e){var _0x149667=typeof _0x425f17[_0xb54f('0x1c')]==='undefined'&&typeof _0x425f17[_0xb54f('0x1d')]===_0xb54f('0x1e');var _0x48254f=_0x11006e['count'];var _0xb82c43=_0x149667?0x0:_0x425f17[_0xb54f('0x1c')];var _0x42d8a0=_0x149667?_0x11006e[_0xb54f('0x1f')]:_0x425f17[_0xb54f('0x1c')]+_0x425f17[_0xb54f('0x1d')];var _0x2b534f;if(_0x42d8a0>=_0x48254f){_0x42d8a0=_0x48254f;_0x2b534f=0xc8;}else{_0x2b534f=0xce;}_0x120abf[_0xb54f('0x19')](_0x2b534f);return _0x120abf['set'](_0xb54f('0x20'),_0xb82c43+'-'+_0x42d8a0+'/'+_0x48254f)[_0xb54f('0x1b')](_0x11006e);}return null;};}function patchUpdates(_0x560dce){return function(_0x1969fb){try{jsonpatch['apply'](_0x1969fb,_0x560dce,!![]);}catch(_0x85f2c9){return BPromise[_0xb54f('0x21')](_0x85f2c9);}return _0x1969fb[_0xb54f('0x22')]();};}function saveUpdates(_0x114984,_0x29aceb){return function(_0x26f5b0){if(_0x26f5b0){return _0x26f5b0['update'](_0x114984)[_0xb54f('0x23')](function(_0x129469){return _0x129469;});}return null;};}function removeEntity(_0x39b6b3,_0x33aea5){return function(_0x4384d7){if(_0x4384d7){return _0x4384d7[_0xb54f('0x24')]()[_0xb54f('0x23')](function(){_0x39b6b3['status'](0xcc)[_0xb54f('0x1a')]();});}};}function handleEntityNotFound(_0x2f4455,_0x4d294c){return function(_0x276c16){if(!_0x276c16){_0x2f4455['sendStatus'](0x194);}return _0x276c16;};}function handleError(_0x3522db,_0x3eaa78){_0x3eaa78=_0x3eaa78||0x1f4;return function(_0x3a192d){logger[_0xb54f('0x25')](_0x3a192d['stack']);if(_0x3a192d[_0xb54f('0x26')]){delete _0x3a192d['name'];}_0x3522db[_0xb54f('0x19')](_0x3eaa78)[_0xb54f('0x27')](_0x3a192d);};}exports[_0xb54f('0x28')]=function(_0x54135a,_0x363f39){var _0x382742={},_0x4d04ba={},_0x4bfcee={'count':0x0,'rows':[]};var _0x19e625=_[_0xb54f('0x29')](db['SalesforceAccount'][_0xb54f('0x2a')],function(_0x1f09a9){return{'name':_0x1f09a9[_0xb54f('0x2b')],'type':_0x1f09a9[_0xb54f('0x2c')][_0xb54f('0x2d')]};});_0x4d04ba['model']=_[_0xb54f('0x29')](_0x19e625,'name');_0x4d04ba['query']=_[_0xb54f('0x2e')](_0x54135a['query']);_0x4d04ba[_0xb54f('0x2f')]=_[_0xb54f('0x30')](_0x4d04ba['model'],_0x4d04ba[_0xb54f('0x31')]);_0x382742['attributes']=_[_0xb54f('0x30')](_0x4d04ba[_0xb54f('0x32')],qs[_0xb54f('0x33')](_0x54135a['query'][_0xb54f('0x33')]));_0x382742[_0xb54f('0x34')]=_0x382742[_0xb54f('0x34')][_0xb54f('0x35')]?_0x382742[_0xb54f('0x34')]:_0x4d04ba[_0xb54f('0x32')];if(!_0x54135a[_0xb54f('0x31')]['hasOwnProperty'](_0xb54f('0x36'))){_0x382742[_0xb54f('0x1d')]=qs[_0xb54f('0x1d')](_0x54135a[_0xb54f('0x31')][_0xb54f('0x1d')]);_0x382742[_0xb54f('0x1c')]=qs[_0xb54f('0x1c')](_0x54135a[_0xb54f('0x31')][_0xb54f('0x1c')]);}_0x382742['order']=qs[_0xb54f('0x37')](_0x54135a[_0xb54f('0x31')][_0xb54f('0x37')]);_0x382742[_0xb54f('0x38')]=qs[_0xb54f('0x2f')](_['pick'](_0x54135a[_0xb54f('0x31')],_0x4d04ba[_0xb54f('0x2f')]),_0x19e625);if(_0x54135a['query'][_0xb54f('0x39')]){_0x382742[_0xb54f('0x38')]=_[_0xb54f('0x3a')](_0x382742[_0xb54f('0x38')],{'$or':_[_0xb54f('0x29')](_0x19e625,function(_0x4f53be){if(_0x4f53be[_0xb54f('0x2c')]!==_0xb54f('0x3b')){var _0x4eadc9={};_0x4eadc9[_0x4f53be[_0xb54f('0x26')]]={'$like':'%'+_0x54135a[_0xb54f('0x31')][_0xb54f('0x39')]+'%'};return _0x4eadc9;}})});}_0x382742=_[_0xb54f('0x3a')]({},_0x382742,_0x54135a[_0xb54f('0x3c')]);var _0x1e6601={'where':_0x382742[_0xb54f('0x38')]};return db[_0xb54f('0x3d')]['count'](_0x1e6601)[_0xb54f('0x23')](function(_0x453d99){_0x4bfcee[_0xb54f('0x1f')]=_0x453d99;if(_0x54135a['query'][_0xb54f('0x3e')]){_0x382742[_0xb54f('0x3f')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x382742);})[_0xb54f('0x23')](function(_0x4a06d1){_0x4bfcee[_0xb54f('0x40')]=_0x4a06d1;return _0x4bfcee;})[_0xb54f('0x23')](respondWithFilteredResult(_0x363f39,_0x382742))[_0xb54f('0x41')](handleError(_0x363f39,null));};exports[_0xb54f('0x42')]=function(_0x404b8f,_0x149074){var _0x458294={'raw':![],'where':{'id':_0x404b8f[_0xb54f('0x43')]['id']}},_0x36a049={};_0x36a049['model']=_[_0xb54f('0x2e')](db[_0xb54f('0x3d')]['rawAttributes']);_0x36a049[_0xb54f('0x31')]=_[_0xb54f('0x2e')](_0x404b8f['query']);_0x36a049[_0xb54f('0x2f')]=_[_0xb54f('0x30')](_0x36a049[_0xb54f('0x32')],_0x36a049[_0xb54f('0x31')]);_0x458294['attributes']=_['intersection'](_0x36a049[_0xb54f('0x32')],qs[_0xb54f('0x33')](_0x404b8f[_0xb54f('0x31')]['fields']));_0x458294['attributes']=_0x458294['attributes']['length']?_0x458294['attributes']:_0x36a049['model'];if(_0x404b8f[_0xb54f('0x31')]['includeAll']){_0x458294['include']=[{'all':!![]}];}_0x458294=_[_0xb54f('0x3a')]({},_0x458294,_0x404b8f[_0xb54f('0x3c')]);return db[_0xb54f('0x3d')][_0xb54f('0x44')](_0x458294)['then'](handleEntityNotFound(_0x149074,null))[_0xb54f('0x23')](respondWithResult(_0x149074,null))[_0xb54f('0x41')](handleError(_0x149074,null));};exports[_0xb54f('0x45')]=function(_0x36225e,_0xd2ff35){return db[_0xb54f('0x3d')]['create'](_0x36225e[_0xb54f('0x46')],{})[_0xb54f('0x23')](respondWithResult(_0xd2ff35,0xc9))[_0xb54f('0x41')](handleError(_0xd2ff35,null));};exports[_0xb54f('0x47')]=function(_0x3d64c9,_0x5d622f){if(_0x3d64c9[_0xb54f('0x46')]['id']){delete _0x3d64c9[_0xb54f('0x46')]['id'];}return db[_0xb54f('0x3d')][_0xb54f('0x44')]({'where':{'id':_0x3d64c9['params']['id']}})[_0xb54f('0x23')](handleEntityNotFound(_0x5d622f,null))[_0xb54f('0x23')](saveUpdates(_0x3d64c9[_0xb54f('0x46')],null))['then'](respondWithResult(_0x5d622f,null))['catch'](handleError(_0x5d622f,null));};exports[_0xb54f('0x24')]=function(_0x3edefb,_0x546d33){return db['SalesforceAccount'][_0xb54f('0x44')]({'where':{'id':_0x3edefb[_0xb54f('0x43')]['id']}})[_0xb54f('0x23')](handleEntityNotFound(_0x546d33,null))['then'](removeEntity(_0x546d33,null))['catch'](handleError(_0x546d33,null));};exports['getConfigurations']=function(_0x37f30d,_0x252e7b,_0xf59782){var _0x196b8c={};var _0x48b95b={};var _0x1e1ecb;var _0xb1f8ad;return db[_0xb54f('0x3d')][_0xb54f('0x48')]({'where':{'id':_0x37f30d[_0xb54f('0x43')]['id']}})[_0xb54f('0x23')](handleEntityNotFound(_0x252e7b,null))['then'](function(_0x1c1359){if(_0x1c1359){_0x1e1ecb=_0x1c1359;_0x48b95b[_0xb54f('0x32')]=_[_0xb54f('0x2e')](db[_0xb54f('0x49')][_0xb54f('0x2a')]);_0x48b95b[_0xb54f('0x31')]=_[_0xb54f('0x2e')](_0x37f30d[_0xb54f('0x31')]);_0x48b95b[_0xb54f('0x2f')]=_['intersection'](_0x48b95b[_0xb54f('0x32')],_0x48b95b[_0xb54f('0x31')]);_0x196b8c[_0xb54f('0x34')]=_[_0xb54f('0x30')](_0x48b95b[_0xb54f('0x32')],qs['fields'](_0x37f30d[_0xb54f('0x31')][_0xb54f('0x33')]));_0x196b8c[_0xb54f('0x34')]=_0x196b8c[_0xb54f('0x34')][_0xb54f('0x35')]?_0x196b8c[_0xb54f('0x34')]:_0x48b95b[_0xb54f('0x32')];_0x196b8c[_0xb54f('0x4a')]=qs[_0xb54f('0x37')](_0x37f30d[_0xb54f('0x31')]['sort']);_0x196b8c['where']=qs[_0xb54f('0x2f')](_[_0xb54f('0x4b')](_0x37f30d[_0xb54f('0x31')],_0x48b95b[_0xb54f('0x2f')]));if(_0x37f30d[_0xb54f('0x31')][_0xb54f('0x39')]){_0x196b8c[_0xb54f('0x38')]=_[_0xb54f('0x3a')](_0x196b8c[_0xb54f('0x38')],{'$or':_[_0xb54f('0x29')](_0x196b8c[_0xb54f('0x34')],function(_0x214d1d){var _0x1279e1={};_0x1279e1[_0x214d1d]={'$like':'%'+_0x37f30d['query']['filter']+'%'};return _0x1279e1;})});}_0x196b8c=_[_0xb54f('0x3a')]({},_0x196b8c,_0x37f30d[_0xb54f('0x3c')]);return _0x1e1ecb['getConfigurations'](_0x196b8c);}})[_0xb54f('0x23')](function(_0x1baf6d){if(_0x1baf6d){_0xb1f8ad=_0x1baf6d[_0xb54f('0x35')];if(!_0x37f30d[_0xb54f('0x31')][_0xb54f('0x4c')](_0xb54f('0x36'))){_0x196b8c['limit']=qs['limit'](_0x37f30d['query'][_0xb54f('0x1d')]);_0x196b8c['offset']=qs[_0xb54f('0x1c')](_0x37f30d[_0xb54f('0x31')][_0xb54f('0x1c')]);}return _0x1e1ecb[_0xb54f('0x4d')](_0x196b8c);}})[_0xb54f('0x23')](function(_0x19e748){if(_0x19e748){return _0x19e748?{'count':_0xb1f8ad,'rows':_0x19e748}:null;}})['then'](respondWithResult(_0x252e7b,null))[_0xb54f('0x41')](handleError(_0x252e7b,null));};exports[_0xb54f('0x4e')]=function(_0x39d10c,_0x26a472,_0x5402e8){if(_0x39d10c[_0xb54f('0x46')]['id']){delete _0x39d10c['body']['id'];}return db[_0xb54f('0x3d')][_0xb54f('0x48')]({'where':{'id':_0x39d10c[_0xb54f('0x43')]['id']}})[_0xb54f('0x23')](handleEntityNotFound(_0x26a472,null))['then'](function(_0x18b5bc){if(_0x18b5bc){_0x39d10c[_0xb54f('0x46')][_0xb54f('0x4f')]=_0x18b5bc['id'];_0x39d10c['body'][_0xb54f('0x50')]=integrations[_0xb54f('0x51')](_0x39d10c[_0xb54f('0x46')][_0xb54f('0x52')],_0x39d10c[_0xb54f('0x46')][_0xb54f('0x2c')]);_0x39d10c['body'][_0xb54f('0x53')]=integrations[_0xb54f('0x54')](_0x39d10c[_0xb54f('0x46')][_0xb54f('0x52')],_0x39d10c['body'][_0xb54f('0x2c')]);return db[_0xb54f('0x49')][_0xb54f('0x45')](_0x39d10c[_0xb54f('0x46')],{'include':[{'model':db[_0xb54f('0x55')],'as':_0xb54f('0x50')},{'model':db[_0xb54f('0x55')],'as':_0xb54f('0x53')}]});}return null;})[_0xb54f('0x23')](respondWithResult(_0x26a472,null))['catch'](handleError(_0x26a472,null));};exports[_0xb54f('0x56')]=function(_0x4bc78c,_0xfa6a65,_0x44b74a){var _0x1e68f2;var _0x3b48f5='';var _0x100bbb='Task';return db[_0xb54f('0x3d')][_0xb54f('0x48')]({'where':{'id':_0x4bc78c[_0xb54f('0x43')]['id']},'attributes':['id',_0xb54f('0x57'),_0xb54f('0x58'),_0xb54f('0x59'),_0xb54f('0x5a'),_0xb54f('0x5b'),_0xb54f('0x5c')]})[_0xb54f('0x23')](handleEntityNotFound(_0xfa6a65,null))[_0xb54f('0x23')](function(_0x3db25f){if(_0x3db25f){_0x3b48f5=_0x3db25f[_0xb54f('0x57')];var _0x125b9b=_0x3b48f5[_0xb54f('0x5d')](-0x1);if(_0x125b9b==='/'){_0x3b48f5=_0x3b48f5[_0xb54f('0x5e')](0x0,_0x3b48f5[_0xb54f('0x5f')](_0x125b9b));}_0x1e68f2=new jsforce[(_0xb54f('0x60'))]({'oauth2':{'loginUrl':_0x3b48f5,'clientId':_0x3db25f[_0xb54f('0x58')],'clientSecret':_0x3db25f[_0xb54f('0x59')]}});return _0x1e68f2[_0xb54f('0x61')](_0x3db25f['username'],_0x3db25f['password'][_0xb54f('0x62')](_0x3db25f[_0xb54f('0x5c')]));}})[_0xb54f('0x23')](function(_0x2b3473){if(_0x2b3473){if(!_[_0xb54f('0x63')](_0x4bc78c[_0xb54f('0x31')][_0xb54f('0x64')])){_0x100bbb=_0x4bc78c[_0xb54f('0x31')][_0xb54f('0x64')];}return _0x1e68f2[_0xb54f('0x65')](_0x100bbb)[_0xb54f('0x66')]();}})[_0xb54f('0x23')](function(_0x195ab1){var _0x26a590=[_0xb54f('0x67'),_0xb54f('0x68'),_0xb54f('0x69'),_0xb54f('0x6a'),_0xb54f('0x6b'),_0xb54f('0x6c')];var _0x477e08=['string',_0xb54f('0x6d'),'picklist',_0xb54f('0x6e'),_0xb54f('0x6f'),_0xb54f('0x70'),'phone'];if(_0x195ab1){_[_0xb54f('0x71')](_0x195ab1[_0xb54f('0x33')],function(_0x4364de){return _0x26a590[_0xb54f('0x72')](_0x4364de[_0xb54f('0x26')])||!_0x477e08['includes'](_0x4364de[_0xb54f('0x2c')]);});return{'count':_0x195ab1[_0xb54f('0x33')][_0xb54f('0x35')],'rows':_[_0xb54f('0x29')](_0x195ab1[_0xb54f('0x33')],function(_0x3207d6){return{'id':_0x3207d6['name'],'name':_0x3207d6[_0xb54f('0x73')],'custom':_0x3207d6[_0xb54f('0x74')],'options':_0x3207d6[_0xb54f('0x75')]['length']>0x0?_[_0xb54f('0x29')](_0x3207d6[_0xb54f('0x75')],function(_0x21d3fd){return{'name':_0x21d3fd[_0xb54f('0x73')],'value':_0x21d3fd['value']};}):_0x3207d6['type']==_0xb54f('0x6e')?[{'name':'True','value':_0xb54f('0x76')},{'name':'False','value':_0xb54f('0x77')}]:[]};})};}})[_0xb54f('0x23')](respondWithResult(_0xfa6a65,null))[_0xb54f('0x41')](function(_0x2ca8e6){var _0x315b4e=_0x4bc78c['query'][_0xb54f('0x78')]?0x1f4:_0x2ca8e6['statusCode']||0x1f4;logger[_0xb54f('0x25')](_0xb54f('0x79'),_0xb54f('0x56'),_0x315b4e,JSON['stringify'](_0x2ca8e6));delete _0x2ca8e6[_0xb54f('0x26')];if(_0x315b4e===0x191){_0x315b4e=0x190;}_0xfa6a65[_0xb54f('0x19')](_0x315b4e)[_0xb54f('0x27')](_0x4bc78c[_0xb54f('0x31')][_0xb54f('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x2ca8e6[_0xb54f('0x7a')]}:_0x2ca8e6);});}; \ No newline at end of file +var _0x1b09=['params','find','create','body','findOne','SalesforceConfiguration','filter','options','getConfigurations','addConfiguration','AccountId','getSubjects','channel','getDescriptions','Subjects','SalesforceField','Descriptions','getFields','Task','remoteUri','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','clientId','login','password','ticketType','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','False','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','keys','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','VIRTUAL','includeAll','include','rows','catch','show'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x1b09,0x1ad));var _0x91b0=function(_0x3baaf2,_0x894e3d){_0x3baaf2=_0x3baaf2-0x0;var _0x50e8b0=_0x1b09[_0x3baaf2];return _0x50e8b0;};'use strict';var emlformat=require(_0x91b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91b0('0x1'));var jsonpatch=require(_0x91b0('0x2'));var rp=require('request-promise');var moment=require(_0x91b0('0x3'));var BPromise=require(_0x91b0('0x4'));var Mustache=require(_0x91b0('0x5'));var util=require(_0x91b0('0x6'));var path=require(_0x91b0('0x7'));var sox=require(_0x91b0('0x8'));var csv=require(_0x91b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x91b0('0xa'));var _=require(_0x91b0('0xb'));var squel=require(_0x91b0('0xc'));var crypto=require(_0x91b0('0xd'));var jsforce=require(_0x91b0('0xe'));var deskjs=require(_0x91b0('0xf'));var toCsv=require(_0x91b0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x91b0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x91b0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91b0('0x12'));var logger=require(_0x91b0('0x13'))(_0x91b0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x91b0('0x15'));var db=require(_0x91b0('0x16'))['db'];var integrations=require(_0x91b0('0x17'));function respondWithStatusCode(_0x111de4,_0x44fe46){_0x44fe46=_0x44fe46||0xcc;return function(_0x458fdb){if(_0x458fdb){return _0x111de4[_0x91b0('0x18')](_0x44fe46);}return _0x111de4['status'](_0x44fe46)[_0x91b0('0x19')]();};}function respondWithResult(_0x626403,_0x17638e){_0x17638e=_0x17638e||0xc8;return function(_0x29f3ca){if(_0x29f3ca){return _0x626403[_0x91b0('0x1a')](_0x17638e)[_0x91b0('0x1b')](_0x29f3ca);}};}function respondWithFilteredResult(_0x1913f9,_0x17e2f9){return function(_0x727bee){if(_0x727bee){var _0x3c8872=typeof _0x17e2f9[_0x91b0('0x1c')]===_0x91b0('0x1d')&&typeof _0x17e2f9[_0x91b0('0x1e')]==='undefined';var _0x4b0053=_0x727bee[_0x91b0('0x1f')];var _0x257efa=_0x3c8872?0x0:_0x17e2f9[_0x91b0('0x1c')];var _0x2d6321=_0x3c8872?_0x727bee['count']:_0x17e2f9['offset']+_0x17e2f9['limit'];var _0x3f0d3;if(_0x2d6321>=_0x4b0053){_0x2d6321=_0x4b0053;_0x3f0d3=0xc8;}else{_0x3f0d3=0xce;}_0x1913f9['status'](_0x3f0d3);return _0x1913f9[_0x91b0('0x20')](_0x91b0('0x21'),_0x257efa+'-'+_0x2d6321+'/'+_0x4b0053)['json'](_0x727bee);}return null;};}function patchUpdates(_0x1fe095){return function(_0x395218){try{jsonpatch[_0x91b0('0x22')](_0x395218,_0x1fe095,!![]);}catch(_0x289226){return BPromise[_0x91b0('0x23')](_0x289226);}return _0x395218[_0x91b0('0x24')]();};}function saveUpdates(_0x3fb6a3,_0xe50975){return function(_0x4f5a84){if(_0x4f5a84){return _0x4f5a84[_0x91b0('0x25')](_0x3fb6a3)[_0x91b0('0x26')](function(_0x230345){return _0x230345;});}return null;};}function removeEntity(_0x33bd45,_0x5d54d7){return function(_0x45f35e){if(_0x45f35e){return _0x45f35e[_0x91b0('0x27')]()[_0x91b0('0x26')](function(){_0x33bd45[_0x91b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ffa56,_0x37a707){return function(_0x4f4bb8){if(!_0x4f4bb8){_0x2ffa56['sendStatus'](0x194);}return _0x4f4bb8;};}function handleError(_0x740403,_0x294c72){_0x294c72=_0x294c72||0x1f4;return function(_0x2d0f8e){logger[_0x91b0('0x28')](_0x2d0f8e[_0x91b0('0x29')]);if(_0x2d0f8e[_0x91b0('0x2a')]){delete _0x2d0f8e['name'];}_0x740403['status'](_0x294c72)[_0x91b0('0x2b')](_0x2d0f8e);};}exports[_0x91b0('0x2c')]=function(_0x595d59,_0x21472f){var _0xfad93={},_0x433b3e={},_0x595556={'count':0x0,'rows':[]};var _0x4e5a68=_['map'](db[_0x91b0('0x2d')][_0x91b0('0x2e')],function(_0x2b5f5d){return{'name':_0x2b5f5d[_0x91b0('0x2f')],'type':_0x2b5f5d[_0x91b0('0x30')]['key']};});_0x433b3e[_0x91b0('0x31')]=_['map'](_0x4e5a68,_0x91b0('0x2a'));_0x433b3e['query']=_[_0x91b0('0x32')](_0x595d59['query']);_0x433b3e['filters']=_['intersection'](_0x433b3e[_0x91b0('0x31')],_0x433b3e['query']);_0xfad93['attributes']=_[_0x91b0('0x33')](_0x433b3e['model'],qs[_0x91b0('0x34')](_0x595d59[_0x91b0('0x35')][_0x91b0('0x34')]));_0xfad93[_0x91b0('0x36')]=_0xfad93[_0x91b0('0x36')][_0x91b0('0x37')]?_0xfad93[_0x91b0('0x36')]:_0x433b3e[_0x91b0('0x31')];if(!_0x595d59[_0x91b0('0x35')][_0x91b0('0x38')](_0x91b0('0x39'))){_0xfad93[_0x91b0('0x1e')]=qs[_0x91b0('0x1e')](_0x595d59[_0x91b0('0x35')][_0x91b0('0x1e')]);_0xfad93[_0x91b0('0x1c')]=qs['offset'](_0x595d59[_0x91b0('0x35')][_0x91b0('0x1c')]);}_0xfad93[_0x91b0('0x3a')]=qs[_0x91b0('0x3b')](_0x595d59[_0x91b0('0x35')][_0x91b0('0x3b')]);_0xfad93['where']=qs[_0x91b0('0x3c')](_[_0x91b0('0x3d')](_0x595d59[_0x91b0('0x35')],_0x433b3e[_0x91b0('0x3c')]),_0x4e5a68);if(_0x595d59['query']['filter']){_0xfad93[_0x91b0('0x3e')]=_[_0x91b0('0x3f')](_0xfad93[_0x91b0('0x3e')],{'$or':_[_0x91b0('0x40')](_0x4e5a68,function(_0x2f482f){if(_0x2f482f['type']!==_0x91b0('0x41')){var _0x3d405a={};_0x3d405a[_0x2f482f[_0x91b0('0x2a')]]={'$like':'%'+_0x595d59['query']['filter']+'%'};return _0x3d405a;}})});}_0xfad93=_[_0x91b0('0x3f')]({},_0xfad93,_0x595d59['options']);var _0x375519={'where':_0xfad93[_0x91b0('0x3e')]};return db[_0x91b0('0x2d')]['count'](_0x375519)['then'](function(_0x47b02b){_0x595556[_0x91b0('0x1f')]=_0x47b02b;if(_0x595d59[_0x91b0('0x35')][_0x91b0('0x42')]){_0xfad93[_0x91b0('0x43')]=[{'all':!![]}];}return db[_0x91b0('0x2d')]['findAll'](_0xfad93);})[_0x91b0('0x26')](function(_0x440d13){_0x595556[_0x91b0('0x44')]=_0x440d13;return _0x595556;})[_0x91b0('0x26')](respondWithFilteredResult(_0x21472f,_0xfad93))[_0x91b0('0x45')](handleError(_0x21472f,null));};exports[_0x91b0('0x46')]=function(_0x1b6194,_0x389675){var _0x1373c5={'raw':![],'where':{'id':_0x1b6194[_0x91b0('0x47')]['id']}},_0x3e6965={};_0x3e6965[_0x91b0('0x31')]=_[_0x91b0('0x32')](db['SalesforceAccount'][_0x91b0('0x2e')]);_0x3e6965['query']=_[_0x91b0('0x32')](_0x1b6194[_0x91b0('0x35')]);_0x3e6965[_0x91b0('0x3c')]=_[_0x91b0('0x33')](_0x3e6965[_0x91b0('0x31')],_0x3e6965[_0x91b0('0x35')]);_0x1373c5[_0x91b0('0x36')]=_[_0x91b0('0x33')](_0x3e6965[_0x91b0('0x31')],qs['fields'](_0x1b6194[_0x91b0('0x35')][_0x91b0('0x34')]));_0x1373c5[_0x91b0('0x36')]=_0x1373c5[_0x91b0('0x36')][_0x91b0('0x37')]?_0x1373c5[_0x91b0('0x36')]:_0x3e6965['model'];if(_0x1b6194['query'][_0x91b0('0x42')]){_0x1373c5['include']=[{'all':!![]}];}_0x1373c5=_[_0x91b0('0x3f')]({},_0x1373c5,_0x1b6194['options']);return db[_0x91b0('0x2d')][_0x91b0('0x48')](_0x1373c5)[_0x91b0('0x26')](handleEntityNotFound(_0x389675,null))['then'](respondWithResult(_0x389675,null))['catch'](handleError(_0x389675,null));};exports['create']=function(_0x39beb1,_0xfd1abc){return db[_0x91b0('0x2d')][_0x91b0('0x49')](_0x39beb1[_0x91b0('0x4a')],{})[_0x91b0('0x26')](respondWithResult(_0xfd1abc,0xc9))['catch'](handleError(_0xfd1abc,null));};exports[_0x91b0('0x25')]=function(_0x41ba01,_0x44acaa){if(_0x41ba01[_0x91b0('0x4a')]['id']){delete _0x41ba01[_0x91b0('0x4a')]['id'];}return db[_0x91b0('0x2d')][_0x91b0('0x48')]({'where':{'id':_0x41ba01[_0x91b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x44acaa,null))[_0x91b0('0x26')](saveUpdates(_0x41ba01[_0x91b0('0x4a')],null))[_0x91b0('0x26')](respondWithResult(_0x44acaa,null))[_0x91b0('0x45')](handleError(_0x44acaa,null));};exports['destroy']=function(_0x3635e9,_0x149831){return db[_0x91b0('0x2d')][_0x91b0('0x48')]({'where':{'id':_0x3635e9[_0x91b0('0x47')]['id']}})[_0x91b0('0x26')](handleEntityNotFound(_0x149831,null))[_0x91b0('0x26')](removeEntity(_0x149831,null))[_0x91b0('0x45')](handleError(_0x149831,null));};exports['getConfigurations']=function(_0x46b1a7,_0x44fa04,_0x3f7072){var _0x218882={};var _0x41af89={};var _0x426145;var _0x2a658f;return db[_0x91b0('0x2d')][_0x91b0('0x4b')]({'where':{'id':_0x46b1a7[_0x91b0('0x47')]['id']}})[_0x91b0('0x26')](handleEntityNotFound(_0x44fa04,null))[_0x91b0('0x26')](function(_0x1b6432){if(_0x1b6432){_0x426145=_0x1b6432;_0x41af89['model']=_[_0x91b0('0x32')](db[_0x91b0('0x4c')][_0x91b0('0x2e')]);_0x41af89[_0x91b0('0x35')]=_[_0x91b0('0x32')](_0x46b1a7['query']);_0x41af89[_0x91b0('0x3c')]=_['intersection'](_0x41af89[_0x91b0('0x31')],_0x41af89[_0x91b0('0x35')]);_0x218882['attributes']=_['intersection'](_0x41af89[_0x91b0('0x31')],qs[_0x91b0('0x34')](_0x46b1a7[_0x91b0('0x35')][_0x91b0('0x34')]));_0x218882[_0x91b0('0x36')]=_0x218882[_0x91b0('0x36')][_0x91b0('0x37')]?_0x218882[_0x91b0('0x36')]:_0x41af89[_0x91b0('0x31')];_0x218882[_0x91b0('0x3a')]=qs[_0x91b0('0x3b')](_0x46b1a7[_0x91b0('0x35')][_0x91b0('0x3b')]);_0x218882[_0x91b0('0x3e')]=qs[_0x91b0('0x3c')](_['pick'](_0x46b1a7[_0x91b0('0x35')],_0x41af89[_0x91b0('0x3c')]));if(_0x46b1a7[_0x91b0('0x35')][_0x91b0('0x4d')]){_0x218882[_0x91b0('0x3e')]=_[_0x91b0('0x3f')](_0x218882['where'],{'$or':_[_0x91b0('0x40')](_0x218882['attributes'],function(_0x228824){var _0x56689f={};_0x56689f[_0x228824]={'$like':'%'+_0x46b1a7[_0x91b0('0x35')][_0x91b0('0x4d')]+'%'};return _0x56689f;})});}_0x218882=_[_0x91b0('0x3f')]({},_0x218882,_0x46b1a7[_0x91b0('0x4e')]);return _0x426145[_0x91b0('0x4f')](_0x218882);}})[_0x91b0('0x26')](function(_0x4f4e1e){if(_0x4f4e1e){_0x2a658f=_0x4f4e1e[_0x91b0('0x37')];if(!_0x46b1a7[_0x91b0('0x35')]['hasOwnProperty'](_0x91b0('0x39'))){_0x218882['limit']=qs[_0x91b0('0x1e')](_0x46b1a7[_0x91b0('0x35')]['limit']);_0x218882[_0x91b0('0x1c')]=qs['offset'](_0x46b1a7[_0x91b0('0x35')][_0x91b0('0x1c')]);}return _0x426145['getConfigurations'](_0x218882);}})['then'](function(_0x53d8a0){if(_0x53d8a0){return _0x53d8a0?{'count':_0x2a658f,'rows':_0x53d8a0}:null;}})['then'](respondWithResult(_0x44fa04,null))['catch'](handleError(_0x44fa04,null));};exports[_0x91b0('0x50')]=function(_0x742838,_0xbfc656,_0x51c6b8){if(_0x742838[_0x91b0('0x4a')]['id']){delete _0x742838['body']['id'];}return db[_0x91b0('0x2d')]['findOne']({'where':{'id':_0x742838['params']['id']}})[_0x91b0('0x26')](handleEntityNotFound(_0xbfc656,null))['then'](function(_0x49c086){if(_0x49c086){_0x742838[_0x91b0('0x4a')][_0x91b0('0x51')]=_0x49c086['id'];_0x742838[_0x91b0('0x4a')]['Subjects']=integrations[_0x91b0('0x52')](_0x742838['body'][_0x91b0('0x53')],_0x742838[_0x91b0('0x4a')][_0x91b0('0x30')]);_0x742838[_0x91b0('0x4a')]['Descriptions']=integrations[_0x91b0('0x54')](_0x742838[_0x91b0('0x4a')][_0x91b0('0x53')],_0x742838['body']['type']);return db['SalesforceConfiguration'][_0x91b0('0x49')](_0x742838[_0x91b0('0x4a')],{'include':[{'model':db['SalesforceField'],'as':_0x91b0('0x55')},{'model':db[_0x91b0('0x56')],'as':_0x91b0('0x57')}]});}return null;})['then'](respondWithResult(_0xbfc656,null))['catch'](handleError(_0xbfc656,null));};exports[_0x91b0('0x58')]=function(_0x53b291,_0x25c7a9,_0x5a5fdc){var _0x2a1499;var _0x5b6f62='';var _0x23d5ed=_0x91b0('0x59');return db[_0x91b0('0x2d')][_0x91b0('0x4b')]({'where':{'id':_0x53b291['params']['id']},'attributes':['id',_0x91b0('0x5a'),'clientId',_0x91b0('0x5b'),_0x91b0('0x5c'),'password',_0x91b0('0x5d')]})[_0x91b0('0x26')](handleEntityNotFound(_0x25c7a9,null))[_0x91b0('0x26')](function(_0xa04076){if(_0xa04076){_0x5b6f62=_0xa04076['remoteUri'];var _0x39237d=_0x5b6f62[_0x91b0('0x5e')](-0x1);if(_0x39237d==='/'){_0x5b6f62=_0x5b6f62[_0x91b0('0x5f')](0x0,_0x5b6f62[_0x91b0('0x60')](_0x39237d));}_0x2a1499=new jsforce[(_0x91b0('0x61'))]({'oauth2':{'loginUrl':_0x5b6f62,'clientId':_0xa04076[_0x91b0('0x62')],'clientSecret':_0xa04076[_0x91b0('0x5b')]}});return _0x2a1499[_0x91b0('0x63')](_0xa04076['username'],_0xa04076[_0x91b0('0x64')]['concat'](_0xa04076[_0x91b0('0x5d')]));}})['then'](function(_0xf07814){if(_0xf07814){if(!_['isNil'](_0x53b291['query'][_0x91b0('0x65')])){_0x23d5ed=_0x53b291[_0x91b0('0x35')][_0x91b0('0x65')];}return _0x2a1499['sobject'](_0x23d5ed)[_0x91b0('0x66')]();}})['then'](function(_0x487a){var _0x442a3c=[_0x91b0('0x67'),_0x91b0('0x68'),'IsReminderSet',_0x91b0('0x69'),_0x91b0('0x6a'),_0x91b0('0x6b')];var _0x36d798=['string',_0x91b0('0x6c'),'picklist',_0x91b0('0x6d'),_0x91b0('0x6e'),_0x91b0('0x6f'),_0x91b0('0x70')];if(_0x487a){_[_0x91b0('0x71')](_0x487a[_0x91b0('0x34')],function(_0x234d34){return _0x442a3c['includes'](_0x234d34[_0x91b0('0x2a')])||!_0x36d798[_0x91b0('0x72')](_0x234d34[_0x91b0('0x30')]);});return{'count':_0x487a[_0x91b0('0x34')][_0x91b0('0x37')],'rows':_[_0x91b0('0x40')](_0x487a[_0x91b0('0x34')],function(_0xf4039b){return{'id':_0xf4039b[_0x91b0('0x2a')],'name':_0xf4039b[_0x91b0('0x73')],'custom':_0xf4039b[_0x91b0('0x74')],'options':_0xf4039b[_0x91b0('0x75')][_0x91b0('0x37')]>0x0?_['map'](_0xf4039b['picklistValues'],function(_0x44b777){return{'name':_0x44b777[_0x91b0('0x73')],'value':_0x44b777[_0x91b0('0x76')]};}):_0xf4039b[_0x91b0('0x30')]==_0x91b0('0x6d')?[{'name':'True','value':'true'},{'name':_0x91b0('0x77'),'value':'false'}]:[]};})};}})[_0x91b0('0x26')](respondWithResult(_0x25c7a9,null))['catch'](function(_0x26dae8){var _0x3a0ebf=_0x53b291[_0x91b0('0x35')]['test']?0x1f4:_0x26dae8['statusCode']||0x1f4;logger['error'](_0x91b0('0x78'),'getFields',_0x3a0ebf,JSON[_0x91b0('0x79')](_0x26dae8));delete _0x26dae8[_0x91b0('0x2a')];if(_0x3a0ebf===0x191){_0x3a0ebf=0x190;}_0x25c7a9[_0x91b0('0x1a')](_0x3a0ebf)[_0x91b0('0x2b')](_0x53b291['query'][_0x91b0('0x7a')]?{'message':_0x91b0('0x7b'),'statusCode':_0x26dae8[_0x91b0('0x7c')]}:_0x26dae8);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5aa3ed1..5e725a5 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 _0x73e8=['int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','exports','SalesforceAccount'];(function(_0x67e9ca,_0x419250){var _0x1b81d6=function(_0x483973){while(--_0x483973){_0x67e9ca['push'](_0x67e9ca['shift']());}};_0x1b81d6(++_0x419250);}(_0x73e8,0x151));var _0x873e=function(_0x29bcf4,_0x40c719){_0x29bcf4=_0x29bcf4-0x0;var _0x89d7c6=_0x73e8[_0x29bcf4];return _0x89d7c6;};'use strict';var _=require('lodash');var util=require(_0x873e('0x0'));var logger=require(_0x873e('0x1'))(_0x873e('0x2'));var moment=require(_0x873e('0x3'));var BPromise=require(_0x873e('0x4'));var rp=require(_0x873e('0x5'));var fs=require('fs');var path=require(_0x873e('0x6'));var rimraf=require(_0x873e('0x7'));var config=require('../../config/environment');var attributes=require(_0x873e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x873e('0x9')]=function(_0xc2f882,_0x5a47e9){return _0xc2f882['define'](_0x873e('0xa'),attributes,{'tableName':_0x873e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e8e=['define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3a7520,_0x1f192a){var _0x5b337d=function(_0x573c75){while(--_0x573c75){_0x3a7520['push'](_0x3a7520['shift']());}};_0x5b337d(++_0x1f192a);}(_0x4e8e,0xf3));var _0xe4e8=function(_0x3e943a,_0x30e25c){_0x3e943a=_0x3e943a-0x0;var _0x2575e1=_0x4e8e[_0x3e943a];return _0x2575e1;};'use strict';var _=require('lodash');var util=require(_0xe4e8('0x0'));var logger=require(_0xe4e8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe4e8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4e8('0x3'));var rimraf=require(_0xe4e8('0x4'));var config=require(_0xe4e8('0x5'));var attributes=require(_0xe4e8('0x6'));var integrations=require(_0xe4e8('0x7'));module[_0xe4e8('0x8')]=function(_0xe39b24,_0x291eac){return _0xe39b24[_0xe4e8('0x9')](_0xe4e8('0xa'),attributes,{'tableName':_0xe4e8('0xb'),'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 72ad198..5a0fb3a 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 _0xc3c1=['attributes','ShowSalesforceAccount','find','lodash','util','../../mysqldb','../../config/environment','client','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceAccount,\x20%s,\x20%s','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','include','map','model'];(function(_0x2eee7d,_0x31c23f){var _0x230e5b=function(_0x51e3ae){while(--_0x51e3ae){_0x2eee7d['push'](_0x2eee7d['shift']());}};_0x230e5b(++_0x31c23f);}(_0xc3c1,0x111));var _0x1c3c=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xc3c1[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x1c3c('0x0'));var util=require(_0x1c3c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c3c('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1c3c('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x1c3c('0x4')][_0x1c3c('0x5')]({'port':0x232a});function respondWithRpcPromise(_0xd92598,_0x5787e4,_0x364f58){return new BPromise(function(_0x29dfa1,_0x455f95){return client[_0x1c3c('0x6')](_0xd92598,_0x364f58)[_0x1c3c('0x7')](function(_0x5ce0dc){logger[_0x1c3c('0x8')]('SalesforceAccount,\x20%s,\x20%s',_0x5787e4,_0x1c3c('0x9'));logger[_0x1c3c('0xa')](_0x1c3c('0xb'),_0x5787e4,_0x1c3c('0x9'),JSON[_0x1c3c('0xc')](_0x5ce0dc));if(_0x5ce0dc[_0x1c3c('0xd')]){if(_0x5ce0dc[_0x1c3c('0xd')]['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x5787e4,_0x5ce0dc[_0x1c3c('0xd')][_0x1c3c('0xe')]);return _0x455f95(_0x5ce0dc[_0x1c3c('0xd')][_0x1c3c('0xe')]);}logger['error'](_0x1c3c('0xf'),_0x5787e4,_0x5ce0dc[_0x1c3c('0xd')][_0x1c3c('0xe')]);return _0x29dfa1(_0x5ce0dc[_0x1c3c('0xd')][_0x1c3c('0xe')]);}else{logger[_0x1c3c('0x8')](_0x1c3c('0xf'),_0x5787e4,'request\x20sent');_0x29dfa1(_0x5ce0dc[_0x1c3c('0x10')][_0x1c3c('0xe')]);}})[_0x1c3c('0x11')](function(_0x3039e9){logger[_0x1c3c('0xd')](_0x1c3c('0xf'),_0x5787e4,_0x3039e9);_0x455f95(_0x3039e9);});});}exports[_0x1c3c('0x12')]=function(_0x1d3b7a){var _0xcc2499=this;return new Promise(function(_0x82a3e8,_0x141642){return db[_0x1c3c('0x13')][_0x1c3c('0x14')]({'raw':_0x1d3b7a[_0x1c3c('0x15')]?_0x1d3b7a[_0x1c3c('0x15')][_0x1c3c('0x16')]===undefined?!![]:![]:!![],'where':_0x1d3b7a['options']?_0x1d3b7a[_0x1c3c('0x15')][_0x1c3c('0x17')]||null:null,'attributes':_0x1d3b7a['options']?_0x1d3b7a['options']['attributes']||null:null,'limit':_0x1d3b7a[_0x1c3c('0x15')]?_0x1d3b7a['options']['limit']||null:null,'include':_0x1d3b7a[_0x1c3c('0x15')]?_0x1d3b7a['options'][_0x1c3c('0x18')]?_[_0x1c3c('0x19')](_0x1d3b7a[_0x1c3c('0x15')][_0x1c3c('0x18')],function(_0x798c49){return{'model':db[_0x798c49[_0x1c3c('0x1a')]],'as':_0x798c49['as'],'attributes':_0x798c49[_0x1c3c('0x1b')],'include':_0x798c49['include']?_[_0x1c3c('0x19')](_0x798c49['include'],function(_0x11189f){return{'model':db[_0x11189f[_0x1c3c('0x1a')]],'as':_0x11189f['as'],'attributes':_0x11189f['attributes'],'include':_0x11189f['include']?_[_0x1c3c('0x19')](_0x11189f[_0x1c3c('0x18')],function(_0x335f34){return{'model':db[_0x335f34[_0x1c3c('0x1a')]],'as':_0x335f34['as'],'attributes':_0x335f34['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c3c('0x7')](function(_0xb7972c){logger[_0x1c3c('0x8')](_0x1c3c('0x12'),_0x1d3b7a);logger[_0x1c3c('0xa')](_0x1c3c('0x12'),_0x1d3b7a,JSON[_0x1c3c('0xc')](_0xb7972c));_0x82a3e8(_0xb7972c);})[_0x1c3c('0x11')](function(_0x158320){logger[_0x1c3c('0xd')](_0x1c3c('0x12'),_0x158320[_0x1c3c('0xe')],_0x1d3b7a);_0x141642(_0xcc2499[_0x1c3c('0xd')](0x1f4,_0x158320['message']));});});};exports[_0x1c3c('0x1c')]=function(_0x20438c){var _0x3a9888=this;return new Promise(function(_0x201745,_0x56261c){return db['SalesforceAccount'][_0x1c3c('0x1d')]({'raw':_0x20438c[_0x1c3c('0x15')]?_0x20438c[_0x1c3c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x20438c[_0x1c3c('0x15')]?_0x20438c[_0x1c3c('0x15')][_0x1c3c('0x17')]||null:null,'attributes':_0x20438c['options']?_0x20438c['options'][_0x1c3c('0x1b')]||null:null,'include':_0x20438c['options']?_0x20438c[_0x1c3c('0x15')][_0x1c3c('0x18')]?_[_0x1c3c('0x19')](_0x20438c['options']['include'],function(_0x50b061){return{'model':db[_0x50b061[_0x1c3c('0x1a')]],'as':_0x50b061['as'],'attributes':_0x50b061[_0x1c3c('0x1b')],'include':_0x50b061['include']?_[_0x1c3c('0x19')](_0x50b061[_0x1c3c('0x18')],function(_0x37e091){return{'model':db[_0x37e091[_0x1c3c('0x1a')]],'as':_0x37e091['as'],'attributes':_0x37e091[_0x1c3c('0x1b')],'include':_0x37e091[_0x1c3c('0x18')]?_[_0x1c3c('0x19')](_0x37e091[_0x1c3c('0x18')],function(_0x2ec6a7){return{'model':db[_0x2ec6a7[_0x1c3c('0x1a')]],'as':_0x2ec6a7['as'],'attributes':_0x2ec6a7[_0x1c3c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c7323){logger[_0x1c3c('0x8')](_0x1c3c('0x1c'),_0x20438c);logger[_0x1c3c('0xa')]('ShowSalesforceAccount',_0x20438c,JSON[_0x1c3c('0xc')](_0x1c7323));_0x201745(_0x1c7323);})[_0x1c3c('0x11')](function(_0x53a723){logger[_0x1c3c('0xd')](_0x1c3c('0x1c'),_0x53a723['message'],_0x20438c);_0x56261c(_0x3a9888['error'](0x1f4,_0x53a723[_0x1c3c('0xe')]));});});}; \ No newline at end of file +var _0xc163=['http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','SalesforceAccount','options','raw','where','limit','map','include','attributes','model','catch','ShowSalesforceAccount','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b8e65,_0x45935f){var _0x6f593c=function(_0x2d3c25){while(--_0x2d3c25){_0x2b8e65['push'](_0x2b8e65['shift']());}};_0x6f593c(++_0x45935f);}(_0xc163,0xa1));var _0x3c16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc163[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3c16('0x0'));var util=require(_0x3c16('0x1'));var moment=require(_0x3c16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c16('0x3'))['db'];var utils=require(_0x3c16('0x4'));var logger=require('../../config/logger')(_0x3c16('0x5'));var config=require(_0x3c16('0x6'));var jayson=require(_0x3c16('0x7'));var client=jayson[_0x3c16('0x8')][_0x3c16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33a18e,_0x3d8511,_0x405339){return new BPromise(function(_0x300350,_0x3b4cf8){return client[_0x3c16('0xa')](_0x33a18e,_0x405339)[_0x3c16('0xb')](function(_0x5ea503){logger[_0x3c16('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x3d8511,_0x3c16('0xd'));logger[_0x3c16('0xe')](_0x3c16('0xf'),_0x3d8511,'request\x20sent',JSON[_0x3c16('0x10')](_0x5ea503));if(_0x5ea503['error']){if(_0x5ea503[_0x3c16('0x11')][_0x3c16('0x12')]===0x1f4){logger[_0x3c16('0x11')](_0x3c16('0x13'),_0x3d8511,_0x5ea503['error'][_0x3c16('0x14')]);return _0x3b4cf8(_0x5ea503['error'][_0x3c16('0x14')]);}logger[_0x3c16('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x3d8511,_0x5ea503['error'][_0x3c16('0x14')]);return _0x300350(_0x5ea503[_0x3c16('0x11')][_0x3c16('0x14')]);}else{logger[_0x3c16('0xc')](_0x3c16('0x13'),_0x3d8511,_0x3c16('0xd'));_0x300350(_0x5ea503[_0x3c16('0x15')][_0x3c16('0x14')]);}})['catch'](function(_0x420c42){logger[_0x3c16('0x11')](_0x3c16('0x13'),_0x3d8511,_0x420c42);_0x3b4cf8(_0x420c42);});});}exports[_0x3c16('0x16')]=function(_0x5f4af0){var _0x1f3c95=this;return new Promise(function(_0x336d65,_0x606f4d){return db[_0x3c16('0x17')]['findAll']({'raw':_0x5f4af0[_0x3c16('0x18')]?_0x5f4af0[_0x3c16('0x18')][_0x3c16('0x19')]===undefined?!![]:![]:!![],'where':_0x5f4af0[_0x3c16('0x18')]?_0x5f4af0[_0x3c16('0x18')][_0x3c16('0x1a')]||null:null,'attributes':_0x5f4af0['options']?_0x5f4af0[_0x3c16('0x18')]['attributes']||null:null,'limit':_0x5f4af0[_0x3c16('0x18')]?_0x5f4af0['options'][_0x3c16('0x1b')]||null:null,'include':_0x5f4af0['options']?_0x5f4af0[_0x3c16('0x18')]['include']?_[_0x3c16('0x1c')](_0x5f4af0['options'][_0x3c16('0x1d')],function(_0x5cb01a){return{'model':db[_0x5cb01a['model']],'as':_0x5cb01a['as'],'attributes':_0x5cb01a[_0x3c16('0x1e')],'include':_0x5cb01a[_0x3c16('0x1d')]?_['map'](_0x5cb01a[_0x3c16('0x1d')],function(_0x3edd48){return{'model':db[_0x3edd48[_0x3c16('0x1f')]],'as':_0x3edd48['as'],'attributes':_0x3edd48[_0x3c16('0x1e')],'include':_0x3edd48[_0x3c16('0x1d')]?_[_0x3c16('0x1c')](_0x3edd48[_0x3c16('0x1d')],function(_0x4bd6ce){return{'model':db[_0x4bd6ce[_0x3c16('0x1f')]],'as':_0x4bd6ce['as'],'attributes':_0x4bd6ce[_0x3c16('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3c16('0xb')](function(_0x395d5f){logger[_0x3c16('0xc')](_0x3c16('0x16'),_0x5f4af0);logger[_0x3c16('0xe')](_0x3c16('0x16'),_0x5f4af0,JSON[_0x3c16('0x10')](_0x395d5f));_0x336d65(_0x395d5f);})[_0x3c16('0x20')](function(_0xe4b62a){logger[_0x3c16('0x11')](_0x3c16('0x16'),_0xe4b62a[_0x3c16('0x14')],_0x5f4af0);_0x606f4d(_0x1f3c95[_0x3c16('0x11')](0x1f4,_0xe4b62a[_0x3c16('0x14')]));});});};exports[_0x3c16('0x21')]=function(_0x5bcef0){var _0x422140=this;return new Promise(function(_0x39e49a,_0x4e48b4){return db[_0x3c16('0x17')]['find']({'raw':_0x5bcef0[_0x3c16('0x18')]?_0x5bcef0['options'][_0x3c16('0x19')]===undefined?!![]:![]:!![],'where':_0x5bcef0[_0x3c16('0x18')]?_0x5bcef0['options'][_0x3c16('0x1a')]||null:null,'attributes':_0x5bcef0[_0x3c16('0x18')]?_0x5bcef0['options'][_0x3c16('0x1e')]||null:null,'include':_0x5bcef0[_0x3c16('0x18')]?_0x5bcef0[_0x3c16('0x18')][_0x3c16('0x1d')]?_[_0x3c16('0x1c')](_0x5bcef0['options'][_0x3c16('0x1d')],function(_0x5b4131){return{'model':db[_0x5b4131['model']],'as':_0x5b4131['as'],'attributes':_0x5b4131[_0x3c16('0x1e')],'include':_0x5b4131[_0x3c16('0x1d')]?_['map'](_0x5b4131['include'],function(_0x3ce599){return{'model':db[_0x3ce599[_0x3c16('0x1f')]],'as':_0x3ce599['as'],'attributes':_0x3ce599[_0x3c16('0x1e')],'include':_0x3ce599['include']?_[_0x3c16('0x1c')](_0x3ce599[_0x3c16('0x1d')],function(_0x440050){return{'model':db[_0x440050[_0x3c16('0x1f')]],'as':_0x440050['as'],'attributes':_0x440050[_0x3c16('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3c16('0xb')](function(_0x2f049f){logger[_0x3c16('0xc')]('ShowSalesforceAccount',_0x5bcef0);logger[_0x3c16('0xe')](_0x3c16('0x21'),_0x5bcef0,JSON[_0x3c16('0x10')](_0x2f049f));_0x39e49a(_0x2f049f);})[_0x3c16('0x20')](function(_0x3dbdac){logger[_0x3c16('0x11')](_0x3c16('0x21'),_0x3dbdac[_0x3c16('0x14')],_0x5bcef0);_0x4e48b4(_0x422140['error'](0x1f4,_0x3dbdac[_0x3c16('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1312082..e857553 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xdb28,0x106));var _0x8db2=function(_0x30109f,_0x44d601){_0x30109f=_0x30109f-0x0;var _0x3439af=_0xdb28[_0x30109f];return _0x3439af;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2032,0xd9));var _0x2203=function(_0x91439b,_0x4beb1b){_0x91439b=_0x91439b-0x0;var _0x589f36=_0x2032[_0x91439b];return _0x589f36;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 7dbad94..5b97b2e 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 _0x3360=['Task','ENUM','contact_lead','contact','lead','account_contact_lead','nothing','account','STRING','sequelize','exports'];(function(_0x12bee6,_0x32646b){var _0x769140=function(_0xed8718){while(--_0xed8718){_0x12bee6['push'](_0x12bee6['shift']());}};_0x769140(++_0x32646b);}(_0x3360,0x1d7));var _0x0336=function(_0x1c5490,_0x142e7b){_0x1c5490=_0x1c5490-0x0;var _0xd354e5=_0x3360[_0x1c5490];return _0xd354e5;};'use strict';var Sequelize=require(_0x0336('0x0'));module[_0x0336('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x0336('0x2'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x0336('0x3')](_0x0336('0x4'),_0x0336('0x5'),_0x0336('0x6'),_0x0336('0x7'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x0336('0x3')](_0x0336('0x8'),_0x0336('0x5'),_0x0336('0x6'),_0x0336('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x0336('0xa')]},'additionalSearchAccount':{'type':Sequelize[_0x0336('0xa')]},'additionalSearchContact':{'type':Sequelize[_0x0336('0xa')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x09f2=['exports','STRING','ENUM','Task','Case','lead','account_contact_lead','contact_lead','nothing','sequelize'];(function(_0x1c9cfa,_0xa01a69){var _0x137d24=function(_0x20b32c){while(--_0x20b32c){_0x1c9cfa['push'](_0x1c9cfa['shift']());}};_0x137d24(++_0xa01a69);}(_0x09f2,0x1d5));var _0x209f=function(_0x20dffa,_0x382342){_0x20dffa=_0x20dffa-0x0;var _0x2a76d1=_0x09f2[_0x20dffa];return _0x2a76d1;};'use strict';var Sequelize=require(_0x209f('0x0'));module[_0x209f('0x1')]={'name':{'type':Sequelize[_0x209f('0x2')]},'description':{'type':Sequelize[_0x209f('0x2')]},'ticketType':{'type':Sequelize[_0x209f('0x3')](_0x209f('0x4'),_0x209f('0x5')),'defaultValue':_0x209f('0x4')},'moduleSearch':{'type':Sequelize[_0x209f('0x3')]('contact_lead','contact',_0x209f('0x6'),_0x209f('0x7'),'account'),'defaultValue':_0x209f('0x8')},'moduleCreate':{'type':Sequelize['ENUM'](_0x209f('0x9'),'contact',_0x209f('0x6'),'account'),'defaultValue':_0x209f('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x209f('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x209f('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x209f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index d7b3cd2..d221dcf 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 _0x26be=['map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','SalesforceField','pick','getSubjects','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name'];(function(_0x575a7f,_0x175b25){var _0x5abd15=function(_0x50e5ef){while(--_0x50e5ef){_0x575a7f['push'](_0x575a7f['shift']());}};_0x5abd15(++_0x175b25);}(_0x26be,0x108));var _0xe26b=function(_0x5584b2,_0x2ce3d6){_0x5584b2=_0x5584b2-0x0;var _0x41e183=_0x26be[_0x5584b2];return _0x41e183;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe26b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe26b('0x1'));var rp=require(_0xe26b('0x2'));var moment=require(_0xe26b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe26b('0x4'));var path=require(_0xe26b('0x5'));var sox=require(_0xe26b('0x6'));var csv=require('to-csv');var ejs=require(_0xe26b('0x7'));var fs=require('fs');var fs_extra=require(_0xe26b('0x8'));var _=require(_0xe26b('0x9'));var squel=require('squel');var crypto=require(_0xe26b('0xa'));var jsforce=require(_0xe26b('0xb'));var deskjs=require(_0xe26b('0xc'));var toCsv=require(_0xe26b('0xd'));var querystring=require(_0xe26b('0xe'));var Papa=require(_0xe26b('0xf'));var Redis=require(_0xe26b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe26b('0x11'));var hardwareService=require(_0xe26b('0x12'));var logger=require(_0xe26b('0x13'))(_0xe26b('0x14'));var utils=require(_0xe26b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe26b('0x16'));var db=require(_0xe26b('0x17'))['db'];function respondWithStatusCode(_0x43deec,_0x279ea6){_0x279ea6=_0x279ea6||0xcc;return function(_0x412477){if(_0x412477){return _0x43deec['sendStatus'](_0x279ea6);}return _0x43deec['status'](_0x279ea6)[_0xe26b('0x18')]();};}function respondWithResult(_0x43f399,_0x5b6606){_0x5b6606=_0x5b6606||0xc8;return function(_0x4122c4){if(_0x4122c4){return _0x43f399[_0xe26b('0x19')](_0x5b6606)[_0xe26b('0x1a')](_0x4122c4);}};}function respondWithFilteredResult(_0x1292e9,_0x45cc3c){return function(_0x3ec5d6){if(_0x3ec5d6){var _0x423634=typeof _0x45cc3c[_0xe26b('0x1b')]===_0xe26b('0x1c')&&typeof _0x45cc3c['limit']===_0xe26b('0x1c');var _0x17f0cf=_0x3ec5d6['count'];var _0x2761cc=_0x423634?0x0:_0x45cc3c[_0xe26b('0x1b')];var _0x1f69fd=_0x423634?_0x3ec5d6[_0xe26b('0x1d')]:_0x45cc3c[_0xe26b('0x1b')]+_0x45cc3c[_0xe26b('0x1e')];var _0x265af0;if(_0x1f69fd>=_0x17f0cf){_0x1f69fd=_0x17f0cf;_0x265af0=0xc8;}else{_0x265af0=0xce;}_0x1292e9['status'](_0x265af0);return _0x1292e9['set'](_0xe26b('0x1f'),_0x2761cc+'-'+_0x1f69fd+'/'+_0x17f0cf)['json'](_0x3ec5d6);}return null;};}function patchUpdates(_0x494074){return function(_0x230067){try{jsonpatch[_0xe26b('0x20')](_0x230067,_0x494074,!![]);}catch(_0x3685f0){return BPromise[_0xe26b('0x21')](_0x3685f0);}return _0x230067['save']();};}function saveUpdates(_0x20167c,_0x4bdd6e){return function(_0x29030a){if(_0x29030a){return _0x29030a[_0xe26b('0x22')](_0x20167c)[_0xe26b('0x23')](function(_0x43d557){return _0x43d557;});}return null;};}function removeEntity(_0x5d17f8,_0x404415){return function(_0x33b2fa){if(_0x33b2fa){return _0x33b2fa[_0xe26b('0x24')]()[_0xe26b('0x23')](function(){_0x5d17f8['status'](0xcc)[_0xe26b('0x18')]();});}};}function handleEntityNotFound(_0x16ccf9,_0x85deff){return function(_0x3dce16){if(!_0x3dce16){_0x16ccf9['sendStatus'](0x194);}return _0x3dce16;};}function handleError(_0x3e25b1,_0xf45b3f){_0xf45b3f=_0xf45b3f||0x1f4;return function(_0x418568){logger[_0xe26b('0x25')](_0x418568[_0xe26b('0x26')]);if(_0x418568[_0xe26b('0x27')]){delete _0x418568[_0xe26b('0x27')];}_0x3e25b1[_0xe26b('0x19')](_0xf45b3f)['send'](_0x418568);};}exports['index']=function(_0x248a5e,_0xe0a20c){var _0x9f4fe1={},_0x31fd3c={},_0x199d41={'count':0x0,'rows':[]};var _0x421fd1=_[_0xe26b('0x28')](db[_0xe26b('0x29')][_0xe26b('0x2a')],function(_0x48de02){return{'name':_0x48de02[_0xe26b('0x2b')],'type':_0x48de02['type'][_0xe26b('0x2c')]};});_0x31fd3c[_0xe26b('0x2d')]=_[_0xe26b('0x28')](_0x421fd1,_0xe26b('0x27'));_0x31fd3c[_0xe26b('0x2e')]=_[_0xe26b('0x2f')](_0x248a5e[_0xe26b('0x2e')]);_0x31fd3c[_0xe26b('0x30')]=_[_0xe26b('0x31')](_0x31fd3c['model'],_0x31fd3c[_0xe26b('0x2e')]);_0x9f4fe1[_0xe26b('0x32')]=_['intersection'](_0x31fd3c['model'],qs[_0xe26b('0x33')](_0x248a5e[_0xe26b('0x2e')]['fields']));_0x9f4fe1['attributes']=_0x9f4fe1['attributes'][_0xe26b('0x34')]?_0x9f4fe1[_0xe26b('0x32')]:_0x31fd3c[_0xe26b('0x2d')];if(!_0x248a5e[_0xe26b('0x2e')][_0xe26b('0x35')](_0xe26b('0x36'))){_0x9f4fe1[_0xe26b('0x1e')]=qs[_0xe26b('0x1e')](_0x248a5e[_0xe26b('0x2e')][_0xe26b('0x1e')]);_0x9f4fe1[_0xe26b('0x1b')]=qs['offset'](_0x248a5e[_0xe26b('0x2e')][_0xe26b('0x1b')]);}_0x9f4fe1[_0xe26b('0x37')]=qs[_0xe26b('0x38')](_0x248a5e[_0xe26b('0x2e')][_0xe26b('0x38')]);_0x9f4fe1[_0xe26b('0x39')]=qs[_0xe26b('0x30')](_['pick'](_0x248a5e[_0xe26b('0x2e')],_0x31fd3c[_0xe26b('0x30')]),_0x421fd1);if(_0x248a5e[_0xe26b('0x2e')][_0xe26b('0x3a')]){_0x9f4fe1[_0xe26b('0x39')]=_[_0xe26b('0x3b')](_0x9f4fe1[_0xe26b('0x39')],{'$or':_['map'](_0x421fd1,function(_0x492729){if(_0x492729['type']!==_0xe26b('0x3c')){var _0x587820={};_0x587820[_0x492729[_0xe26b('0x27')]]={'$like':'%'+_0x248a5e['query']['filter']+'%'};return _0x587820;}})});}_0x9f4fe1=_['merge']({},_0x9f4fe1,_0x248a5e[_0xe26b('0x3d')]);var _0x2056e4={'where':_0x9f4fe1[_0xe26b('0x39')]};return db[_0xe26b('0x29')][_0xe26b('0x1d')](_0x2056e4)[_0xe26b('0x23')](function(_0x2bf2ed){_0x199d41[_0xe26b('0x1d')]=_0x2bf2ed;if(_0x248a5e[_0xe26b('0x2e')][_0xe26b('0x3e')]){_0x9f4fe1[_0xe26b('0x3f')]=[{'all':!![]}];}return db[_0xe26b('0x29')][_0xe26b('0x40')](_0x9f4fe1);})[_0xe26b('0x23')](function(_0x7dbcc1){_0x199d41[_0xe26b('0x41')]=_0x7dbcc1;return _0x199d41;})[_0xe26b('0x23')](respondWithFilteredResult(_0xe0a20c,_0x9f4fe1))[_0xe26b('0x42')](handleError(_0xe0a20c,null));};exports['show']=function(_0xd7bdac,_0x47158b){var _0x10178a={'raw':![],'where':{'id':_0xd7bdac[_0xe26b('0x43')]['id']}},_0xc877c9={};_0xc877c9[_0xe26b('0x2d')]=_[_0xe26b('0x2f')](db[_0xe26b('0x29')][_0xe26b('0x2a')]);_0xc877c9[_0xe26b('0x2e')]=_[_0xe26b('0x2f')](_0xd7bdac[_0xe26b('0x2e')]);_0xc877c9[_0xe26b('0x30')]=_['intersection'](_0xc877c9[_0xe26b('0x2d')],_0xc877c9[_0xe26b('0x2e')]);_0x10178a[_0xe26b('0x32')]=_[_0xe26b('0x31')](_0xc877c9[_0xe26b('0x2d')],qs[_0xe26b('0x33')](_0xd7bdac[_0xe26b('0x2e')]['fields']));_0x10178a[_0xe26b('0x32')]=_0x10178a['attributes'][_0xe26b('0x34')]?_0x10178a[_0xe26b('0x32')]:_0xc877c9['model'];if(_0xd7bdac[_0xe26b('0x2e')][_0xe26b('0x3e')]){_0x10178a[_0xe26b('0x3f')]=[{'all':!![]}];}_0x10178a=_[_0xe26b('0x3b')]({},_0x10178a,_0xd7bdac[_0xe26b('0x3d')]);return db[_0xe26b('0x29')][_0xe26b('0x44')](_0x10178a)[_0xe26b('0x23')](handleEntityNotFound(_0x47158b,null))['then'](respondWithResult(_0x47158b,null))[_0xe26b('0x42')](handleError(_0x47158b,null));};exports[_0xe26b('0x45')]=function(_0x2158cb,_0x41d438){return db[_0xe26b('0x29')][_0xe26b('0x45')](_0x2158cb[_0xe26b('0x46')],{})[_0xe26b('0x23')](respondWithResult(_0x41d438,0xc9))[_0xe26b('0x42')](handleError(_0x41d438,null));};exports[_0xe26b('0x22')]=function(_0x273579,_0xf799f8){if(_0x273579[_0xe26b('0x46')]['id']){delete _0x273579[_0xe26b('0x46')]['id'];}return db[_0xe26b('0x29')][_0xe26b('0x44')]({'where':{'id':_0x273579[_0xe26b('0x43')]['id']}})[_0xe26b('0x23')](handleEntityNotFound(_0xf799f8,null))[_0xe26b('0x23')](saveUpdates(_0x273579[_0xe26b('0x46')],null))[_0xe26b('0x23')](respondWithResult(_0xf799f8,null))[_0xe26b('0x42')](handleError(_0xf799f8,null));};exports[_0xe26b('0x24')]=function(_0x142922,_0x48db23){return db[_0xe26b('0x29')][_0xe26b('0x44')]({'where':{'id':_0x142922[_0xe26b('0x43')]['id']}})[_0xe26b('0x23')](handleEntityNotFound(_0x48db23,null))[_0xe26b('0x23')](removeEntity(_0x48db23,null))[_0xe26b('0x42')](handleError(_0x48db23,null));};exports[_0xe26b('0x47')]=function(_0x5a69fa,_0x149cee,_0xe02d0b){var _0x334fa4={};var _0x3458ea={};var _0x72c55b;var _0x4eab7c;return db['SalesforceConfiguration'][_0xe26b('0x48')]({'where':{'id':_0x5a69fa[_0xe26b('0x43')]['id']}})['then'](handleEntityNotFound(_0x149cee,null))[_0xe26b('0x23')](function(_0x3c8196){if(_0x3c8196){_0x72c55b=_0x3c8196;_0x3458ea[_0xe26b('0x2d')]=_['keys'](db[_0xe26b('0x49')][_0xe26b('0x2a')]);_0x3458ea[_0xe26b('0x2e')]=_[_0xe26b('0x2f')](_0x5a69fa[_0xe26b('0x2e')]);_0x3458ea['filters']=_['intersection'](_0x3458ea[_0xe26b('0x2d')],_0x3458ea['query']);_0x334fa4[_0xe26b('0x32')]=_[_0xe26b('0x31')](_0x3458ea['model'],qs[_0xe26b('0x33')](_0x5a69fa['query'][_0xe26b('0x33')]));_0x334fa4['attributes']=_0x334fa4[_0xe26b('0x32')][_0xe26b('0x34')]?_0x334fa4['attributes']:_0x3458ea[_0xe26b('0x2d')];_0x334fa4[_0xe26b('0x37')]=qs[_0xe26b('0x38')](_0x5a69fa['query']['sort']);_0x334fa4['where']=qs[_0xe26b('0x30')](_[_0xe26b('0x4a')](_0x5a69fa[_0xe26b('0x2e')],_0x3458ea['filters']));if(_0x5a69fa[_0xe26b('0x2e')]['filter']){_0x334fa4[_0xe26b('0x39')]=_[_0xe26b('0x3b')](_0x334fa4[_0xe26b('0x39')],{'$or':_['map'](_0x334fa4[_0xe26b('0x32')],function(_0x102ab0){var _0x37603e={};_0x37603e[_0x102ab0]={'$like':'%'+_0x5a69fa[_0xe26b('0x2e')][_0xe26b('0x3a')]+'%'};return _0x37603e;})});}_0x334fa4=_[_0xe26b('0x3b')]({},_0x334fa4,_0x5a69fa['options']);return _0x72c55b['getFields'](_0x334fa4);}})['then'](function(_0x4a63f6){if(_0x4a63f6){_0x4eab7c=_0x4a63f6['length'];if(!_0x5a69fa[_0xe26b('0x2e')][_0xe26b('0x35')](_0xe26b('0x36'))){_0x334fa4['limit']=qs[_0xe26b('0x1e')](_0x5a69fa[_0xe26b('0x2e')][_0xe26b('0x1e')]);_0x334fa4[_0xe26b('0x1b')]=qs['offset'](_0x5a69fa[_0xe26b('0x2e')][_0xe26b('0x1b')]);}return _0x72c55b[_0xe26b('0x47')](_0x334fa4);}})[_0xe26b('0x23')](function(_0x3e863c){if(_0x3e863c){return _0x3e863c?{'count':_0x4eab7c,'rows':_0x3e863c}:null;}})[_0xe26b('0x23')](respondWithResult(_0x149cee,null))[_0xe26b('0x42')](handleError(_0x149cee,null));};exports[_0xe26b('0x4b')]=function(_0x37271c,_0x5df6d3,_0xf7db0a){var _0xb871d1={};var _0x51dea5={};var _0x2236d6;var _0x8f7354;return db['SalesforceConfiguration'][_0xe26b('0x48')]({'where':{'id':_0x37271c['params']['id']}})[_0xe26b('0x23')](handleEntityNotFound(_0x5df6d3,null))[_0xe26b('0x23')](function(_0x43f87e){if(_0x43f87e){_0x2236d6=_0x43f87e;_0x51dea5[_0xe26b('0x2d')]=_[_0xe26b('0x2f')](db[_0xe26b('0x49')][_0xe26b('0x2a')]);_0x51dea5[_0xe26b('0x2e')]=_[_0xe26b('0x2f')](_0x37271c['query']);_0x51dea5[_0xe26b('0x30')]=_[_0xe26b('0x31')](_0x51dea5[_0xe26b('0x2d')],_0x51dea5[_0xe26b('0x2e')]);_0xb871d1['attributes']=_['intersection'](_0x51dea5[_0xe26b('0x2d')],qs[_0xe26b('0x33')](_0x37271c['query'][_0xe26b('0x33')]));_0xb871d1[_0xe26b('0x32')]=_0xb871d1['attributes'][_0xe26b('0x34')]?_0xb871d1['attributes']:_0x51dea5['model'];_0xb871d1[_0xe26b('0x37')]=qs[_0xe26b('0x38')](_0x37271c[_0xe26b('0x2e')][_0xe26b('0x38')]);_0xb871d1[_0xe26b('0x39')]=qs[_0xe26b('0x30')](_[_0xe26b('0x4a')](_0x37271c[_0xe26b('0x2e')],_0x51dea5[_0xe26b('0x30')]));if(_0x37271c[_0xe26b('0x2e')][_0xe26b('0x3a')]){_0xb871d1[_0xe26b('0x39')]=_['merge'](_0xb871d1[_0xe26b('0x39')],{'$or':_[_0xe26b('0x28')](_0xb871d1[_0xe26b('0x32')],function(_0x2ed16a){var _0x2cc0ff={};_0x2cc0ff[_0x2ed16a]={'$like':'%'+_0x37271c[_0xe26b('0x2e')]['filter']+'%'};return _0x2cc0ff;})});}_0xb871d1=_['merge']({},_0xb871d1,_0x37271c[_0xe26b('0x3d')]);return _0x2236d6['getSubjects'](_0xb871d1);}})[_0xe26b('0x23')](function(_0x2f2c51){if(_0x2f2c51){_0x8f7354=_0x2f2c51[_0xe26b('0x34')];if(!_0x37271c[_0xe26b('0x2e')][_0xe26b('0x35')]('nolimit')){_0xb871d1[_0xe26b('0x1e')]=qs['limit'](_0x37271c['query']['limit']);_0xb871d1[_0xe26b('0x1b')]=qs['offset'](_0x37271c['query'][_0xe26b('0x1b')]);}return _0x2236d6[_0xe26b('0x4b')](_0xb871d1);}})['then'](function(_0x3ece84){if(_0x3ece84){return _0x3ece84?{'count':_0x8f7354,'rows':_0x3ece84}:null;}})['then'](respondWithResult(_0x5df6d3,null))[_0xe26b('0x42')](handleError(_0x5df6d3,null));};exports['getDescriptions']=function(_0x19e840,_0x2c517a,_0x3a2c67){var _0x4bb48a={};var _0x37a030={};var _0x5b660e;var _0x57da71;return db['SalesforceConfiguration'][_0xe26b('0x48')]({'where':{'id':_0x19e840['params']['id']}})[_0xe26b('0x23')](handleEntityNotFound(_0x2c517a,null))[_0xe26b('0x23')](function(_0xf00774){if(_0xf00774){_0x5b660e=_0xf00774;_0x37a030[_0xe26b('0x2d')]=_[_0xe26b('0x2f')](db['SalesforceField'][_0xe26b('0x2a')]);_0x37a030['query']=_[_0xe26b('0x2f')](_0x19e840[_0xe26b('0x2e')]);_0x37a030[_0xe26b('0x30')]=_[_0xe26b('0x31')](_0x37a030[_0xe26b('0x2d')],_0x37a030[_0xe26b('0x2e')]);_0x4bb48a['attributes']=_[_0xe26b('0x31')](_0x37a030['model'],qs[_0xe26b('0x33')](_0x19e840[_0xe26b('0x2e')]['fields']));_0x4bb48a[_0xe26b('0x32')]=_0x4bb48a[_0xe26b('0x32')]['length']?_0x4bb48a[_0xe26b('0x32')]:_0x37a030[_0xe26b('0x2d')];_0x4bb48a[_0xe26b('0x37')]=qs[_0xe26b('0x38')](_0x19e840[_0xe26b('0x2e')]['sort']);_0x4bb48a[_0xe26b('0x39')]=qs['filters'](_['pick'](_0x19e840[_0xe26b('0x2e')],_0x37a030[_0xe26b('0x30')]));if(_0x19e840['query'][_0xe26b('0x3a')]){_0x4bb48a[_0xe26b('0x39')]=_[_0xe26b('0x3b')](_0x4bb48a[_0xe26b('0x39')],{'$or':_[_0xe26b('0x28')](_0x4bb48a['attributes'],function(_0x4bd2c3){var _0x88a1dc={};_0x88a1dc[_0x4bd2c3]={'$like':'%'+_0x19e840[_0xe26b('0x2e')][_0xe26b('0x3a')]+'%'};return _0x88a1dc;})});}_0x4bb48a=_[_0xe26b('0x3b')]({},_0x4bb48a,_0x19e840['options']);return _0x5b660e['getDescriptions'](_0x4bb48a);}})[_0xe26b('0x23')](function(_0x289aed){if(_0x289aed){_0x57da71=_0x289aed[_0xe26b('0x34')];if(!_0x19e840[_0xe26b('0x2e')][_0xe26b('0x35')](_0xe26b('0x36'))){_0x4bb48a['limit']=qs[_0xe26b('0x1e')](_0x19e840[_0xe26b('0x2e')]['limit']);_0x4bb48a[_0xe26b('0x1b')]=qs['offset'](_0x19e840[_0xe26b('0x2e')][_0xe26b('0x1b')]);}return _0x5b660e['getDescriptions'](_0x4bb48a);}})[_0xe26b('0x23')](function(_0x34ea44){if(_0x34ea44){return _0x34ea44?{'count':_0x57da71,'rows':_0x34ea44}:null;}})[_0xe26b('0x23')](respondWithResult(_0x2c517a,null))[_0xe26b('0x42')](handleError(_0x2c517a,null));}; \ No newline at end of file +var _0xe436=['where','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','keys','include','create','body','find','getFields','hasOwnProperty','getSubjects','findOne','SalesforceField','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick'];(function(_0x4d212e,_0x4b9aa5){var _0x2abf4f=function(_0xc94088){while(--_0xc94088){_0x4d212e['push'](_0x4d212e['shift']());}};_0x2abf4f(++_0x4b9aa5);}(_0xe436,0x1af));var _0x6e43=function(_0x44eb86,_0x58d8ce){_0x44eb86=_0x44eb86-0x0;var _0x46515f=_0xe436[_0x44eb86];return _0x46515f;};'use strict';var emlformat=require(_0x6e43('0x0'));var rimraf=require(_0x6e43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6e43('0x2'));var moment=require(_0x6e43('0x3'));var BPromise=require(_0x6e43('0x4'));var Mustache=require(_0x6e43('0x5'));var util=require('util');var path=require(_0x6e43('0x6'));var sox=require(_0x6e43('0x7'));var csv=require(_0x6e43('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e43('0x9'));var squel=require(_0x6e43('0xa'));var crypto=require(_0x6e43('0xb'));var jsforce=require(_0x6e43('0xc'));var deskjs=require(_0x6e43('0xd'));var toCsv=require(_0x6e43('0x8'));var querystring=require(_0x6e43('0xe'));var Papa=require('papaparse');var Redis=require(_0x6e43('0xf'));var authService=require(_0x6e43('0x10'));var qs=require(_0x6e43('0x11'));var as=require(_0x6e43('0x12'));var hardwareService=require(_0x6e43('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6e43('0x14'));var licenseUtil=require(_0x6e43('0x15'));var db=require(_0x6e43('0x16'))['db'];function respondWithStatusCode(_0x47d370,_0x40f1ce){_0x40f1ce=_0x40f1ce||0xcc;return function(_0x3f713a){if(_0x3f713a){return _0x47d370[_0x6e43('0x17')](_0x40f1ce);}return _0x47d370[_0x6e43('0x18')](_0x40f1ce)[_0x6e43('0x19')]();};}function respondWithResult(_0x4cf60b,_0x54e828){_0x54e828=_0x54e828||0xc8;return function(_0x458ced){if(_0x458ced){return _0x4cf60b[_0x6e43('0x18')](_0x54e828)[_0x6e43('0x1a')](_0x458ced);}};}function respondWithFilteredResult(_0x475664,_0x5303e7){return function(_0x441acb){if(_0x441acb){var _0x364dd8=typeof _0x5303e7['offset']===_0x6e43('0x1b')&&typeof _0x5303e7['limit']===_0x6e43('0x1b');var _0x5d2f64=_0x441acb[_0x6e43('0x1c')];var _0xd4ee48=_0x364dd8?0x0:_0x5303e7[_0x6e43('0x1d')];var _0xa9280a=_0x364dd8?_0x441acb[_0x6e43('0x1c')]:_0x5303e7['offset']+_0x5303e7[_0x6e43('0x1e')];var _0x268787;if(_0xa9280a>=_0x5d2f64){_0xa9280a=_0x5d2f64;_0x268787=0xc8;}else{_0x268787=0xce;}_0x475664[_0x6e43('0x18')](_0x268787);return _0x475664[_0x6e43('0x1f')](_0x6e43('0x20'),_0xd4ee48+'-'+_0xa9280a+'/'+_0x5d2f64)[_0x6e43('0x1a')](_0x441acb);}return null;};}function patchUpdates(_0xb0e29b){return function(_0x49953d){try{jsonpatch[_0x6e43('0x21')](_0x49953d,_0xb0e29b,!![]);}catch(_0xd5a9e6){return BPromise[_0x6e43('0x22')](_0xd5a9e6);}return _0x49953d[_0x6e43('0x23')]();};}function saveUpdates(_0x3835c4,_0x518119){return function(_0x448402){if(_0x448402){return _0x448402[_0x6e43('0x24')](_0x3835c4)['then'](function(_0x3d7a75){return _0x3d7a75;});}return null;};}function removeEntity(_0x1d631c,_0x438dc3){return function(_0x1e2237){if(_0x1e2237){return _0x1e2237[_0x6e43('0x25')]()[_0x6e43('0x26')](function(){_0x1d631c[_0x6e43('0x18')](0xcc)[_0x6e43('0x19')]();});}};}function handleEntityNotFound(_0x22c451,_0x13a9c1){return function(_0x50d855){if(!_0x50d855){_0x22c451[_0x6e43('0x17')](0x194);}return _0x50d855;};}function handleError(_0x46ca93,_0xf9ded4){_0xf9ded4=_0xf9ded4||0x1f4;return function(_0x46e11f){logger[_0x6e43('0x27')](_0x46e11f[_0x6e43('0x28')]);if(_0x46e11f[_0x6e43('0x29')]){delete _0x46e11f['name'];}_0x46ca93[_0x6e43('0x18')](_0xf9ded4)[_0x6e43('0x2a')](_0x46e11f);};}exports[_0x6e43('0x2b')]=function(_0x5b3198,_0x2fd983){var _0x455a1f={},_0x4d72be={},_0x377db9={'count':0x0,'rows':[]};var _0x4eed76=_[_0x6e43('0x2c')](db[_0x6e43('0x2d')][_0x6e43('0x2e')],function(_0x40b889){return{'name':_0x40b889[_0x6e43('0x2f')],'type':_0x40b889[_0x6e43('0x30')][_0x6e43('0x31')]};});_0x4d72be[_0x6e43('0x32')]=_[_0x6e43('0x2c')](_0x4eed76,_0x6e43('0x29'));_0x4d72be['query']=_['keys'](_0x5b3198['query']);_0x4d72be[_0x6e43('0x33')]=_[_0x6e43('0x34')](_0x4d72be['model'],_0x4d72be[_0x6e43('0x35')]);_0x455a1f[_0x6e43('0x36')]=_[_0x6e43('0x34')](_0x4d72be['model'],qs['fields'](_0x5b3198[_0x6e43('0x35')][_0x6e43('0x37')]));_0x455a1f[_0x6e43('0x36')]=_0x455a1f[_0x6e43('0x36')][_0x6e43('0x38')]?_0x455a1f[_0x6e43('0x36')]:_0x4d72be[_0x6e43('0x32')];if(!_0x5b3198[_0x6e43('0x35')]['hasOwnProperty'](_0x6e43('0x39'))){_0x455a1f[_0x6e43('0x1e')]=qs[_0x6e43('0x1e')](_0x5b3198[_0x6e43('0x35')][_0x6e43('0x1e')]);_0x455a1f[_0x6e43('0x1d')]=qs[_0x6e43('0x1d')](_0x5b3198[_0x6e43('0x35')][_0x6e43('0x1d')]);}_0x455a1f[_0x6e43('0x3a')]=qs[_0x6e43('0x3b')](_0x5b3198[_0x6e43('0x35')]['sort']);_0x455a1f['where']=qs[_0x6e43('0x33')](_[_0x6e43('0x3c')](_0x5b3198[_0x6e43('0x35')],_0x4d72be[_0x6e43('0x33')]),_0x4eed76);if(_0x5b3198[_0x6e43('0x35')]['filter']){_0x455a1f[_0x6e43('0x3d')]=_['merge'](_0x455a1f[_0x6e43('0x3d')],{'$or':_[_0x6e43('0x2c')](_0x4eed76,function(_0x10d0a1){if(_0x10d0a1[_0x6e43('0x30')]!==_0x6e43('0x3e')){var _0x164c52={};_0x164c52[_0x10d0a1[_0x6e43('0x29')]]={'$like':'%'+_0x5b3198['query'][_0x6e43('0x3f')]+'%'};return _0x164c52;}})});}_0x455a1f=_[_0x6e43('0x40')]({},_0x455a1f,_0x5b3198[_0x6e43('0x41')]);var _0x5589f7={'where':_0x455a1f['where']};return db[_0x6e43('0x2d')]['count'](_0x5589f7)['then'](function(_0x3d02a0){_0x377db9['count']=_0x3d02a0;if(_0x5b3198[_0x6e43('0x35')][_0x6e43('0x42')]){_0x455a1f['include']=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x455a1f);})[_0x6e43('0x26')](function(_0x5cff16){_0x377db9[_0x6e43('0x43')]=_0x5cff16;return _0x377db9;})[_0x6e43('0x26')](respondWithFilteredResult(_0x2fd983,_0x455a1f))[_0x6e43('0x44')](handleError(_0x2fd983,null));};exports[_0x6e43('0x45')]=function(_0x9662fe,_0x10e1a2){var _0x256a19={'raw':![],'where':{'id':_0x9662fe[_0x6e43('0x46')]['id']}},_0x3831b8={};_0x3831b8[_0x6e43('0x32')]=_[_0x6e43('0x47')](db['SalesforceConfiguration']['rawAttributes']);_0x3831b8['query']=_[_0x6e43('0x47')](_0x9662fe[_0x6e43('0x35')]);_0x3831b8[_0x6e43('0x33')]=_['intersection'](_0x3831b8[_0x6e43('0x32')],_0x3831b8[_0x6e43('0x35')]);_0x256a19['attributes']=_[_0x6e43('0x34')](_0x3831b8[_0x6e43('0x32')],qs[_0x6e43('0x37')](_0x9662fe[_0x6e43('0x35')]['fields']));_0x256a19[_0x6e43('0x36')]=_0x256a19[_0x6e43('0x36')]['length']?_0x256a19[_0x6e43('0x36')]:_0x3831b8[_0x6e43('0x32')];if(_0x9662fe[_0x6e43('0x35')][_0x6e43('0x42')]){_0x256a19[_0x6e43('0x48')]=[{'all':!![]}];}_0x256a19=_['merge']({},_0x256a19,_0x9662fe[_0x6e43('0x41')]);return db['SalesforceConfiguration']['find'](_0x256a19)[_0x6e43('0x26')](handleEntityNotFound(_0x10e1a2,null))[_0x6e43('0x26')](respondWithResult(_0x10e1a2,null))['catch'](handleError(_0x10e1a2,null));};exports[_0x6e43('0x49')]=function(_0x5a5aba,_0x52274b){return db[_0x6e43('0x2d')]['create'](_0x5a5aba[_0x6e43('0x4a')],{})[_0x6e43('0x26')](respondWithResult(_0x52274b,0xc9))['catch'](handleError(_0x52274b,null));};exports['update']=function(_0x422d2a,_0x447c30){if(_0x422d2a[_0x6e43('0x4a')]['id']){delete _0x422d2a[_0x6e43('0x4a')]['id'];}return db[_0x6e43('0x2d')][_0x6e43('0x4b')]({'where':{'id':_0x422d2a['params']['id']}})[_0x6e43('0x26')](handleEntityNotFound(_0x447c30,null))[_0x6e43('0x26')](saveUpdates(_0x422d2a[_0x6e43('0x4a')],null))[_0x6e43('0x26')](respondWithResult(_0x447c30,null))[_0x6e43('0x44')](handleError(_0x447c30,null));};exports[_0x6e43('0x25')]=function(_0x46d0a0,_0xb84a09){return db[_0x6e43('0x2d')][_0x6e43('0x4b')]({'where':{'id':_0x46d0a0[_0x6e43('0x46')]['id']}})[_0x6e43('0x26')](handleEntityNotFound(_0xb84a09,null))[_0x6e43('0x26')](removeEntity(_0xb84a09,null))[_0x6e43('0x44')](handleError(_0xb84a09,null));};exports[_0x6e43('0x4c')]=function(_0xc6d428,_0x15d8e2,_0x50b7e4){var _0x3a7e86={};var _0x23a8a6={};var _0x200b51;var _0x4199c4;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0xc6d428['params']['id']}})[_0x6e43('0x26')](handleEntityNotFound(_0x15d8e2,null))['then'](function(_0x2aefeb){if(_0x2aefeb){_0x200b51=_0x2aefeb;_0x23a8a6[_0x6e43('0x32')]=_[_0x6e43('0x47')](db['SalesforceField'][_0x6e43('0x2e')]);_0x23a8a6[_0x6e43('0x35')]=_['keys'](_0xc6d428['query']);_0x23a8a6['filters']=_[_0x6e43('0x34')](_0x23a8a6[_0x6e43('0x32')],_0x23a8a6[_0x6e43('0x35')]);_0x3a7e86[_0x6e43('0x36')]=_[_0x6e43('0x34')](_0x23a8a6[_0x6e43('0x32')],qs['fields'](_0xc6d428['query'][_0x6e43('0x37')]));_0x3a7e86[_0x6e43('0x36')]=_0x3a7e86['attributes']['length']?_0x3a7e86[_0x6e43('0x36')]:_0x23a8a6[_0x6e43('0x32')];_0x3a7e86[_0x6e43('0x3a')]=qs[_0x6e43('0x3b')](_0xc6d428[_0x6e43('0x35')]['sort']);_0x3a7e86[_0x6e43('0x3d')]=qs[_0x6e43('0x33')](_[_0x6e43('0x3c')](_0xc6d428[_0x6e43('0x35')],_0x23a8a6[_0x6e43('0x33')]));if(_0xc6d428['query'][_0x6e43('0x3f')]){_0x3a7e86['where']=_[_0x6e43('0x40')](_0x3a7e86['where'],{'$or':_[_0x6e43('0x2c')](_0x3a7e86[_0x6e43('0x36')],function(_0x564cf1){var _0x38846e={};_0x38846e[_0x564cf1]={'$like':'%'+_0xc6d428['query'][_0x6e43('0x3f')]+'%'};return _0x38846e;})});}_0x3a7e86=_[_0x6e43('0x40')]({},_0x3a7e86,_0xc6d428['options']);return _0x200b51[_0x6e43('0x4c')](_0x3a7e86);}})[_0x6e43('0x26')](function(_0x4faaaf){if(_0x4faaaf){_0x4199c4=_0x4faaaf[_0x6e43('0x38')];if(!_0xc6d428['query'][_0x6e43('0x4d')]('nolimit')){_0x3a7e86[_0x6e43('0x1e')]=qs['limit'](_0xc6d428[_0x6e43('0x35')]['limit']);_0x3a7e86[_0x6e43('0x1d')]=qs[_0x6e43('0x1d')](_0xc6d428[_0x6e43('0x35')][_0x6e43('0x1d')]);}return _0x200b51[_0x6e43('0x4c')](_0x3a7e86);}})[_0x6e43('0x26')](function(_0x15da75){if(_0x15da75){return _0x15da75?{'count':_0x4199c4,'rows':_0x15da75}:null;}})[_0x6e43('0x26')](respondWithResult(_0x15d8e2,null))[_0x6e43('0x44')](handleError(_0x15d8e2,null));};exports[_0x6e43('0x4e')]=function(_0x2ab229,_0x9d3085,_0x45cc19){var _0x481636={};var _0x25846c={};var _0x59c390;var _0x1eea49;return db[_0x6e43('0x2d')][_0x6e43('0x4f')]({'where':{'id':_0x2ab229['params']['id']}})[_0x6e43('0x26')](handleEntityNotFound(_0x9d3085,null))[_0x6e43('0x26')](function(_0x3316b2){if(_0x3316b2){_0x59c390=_0x3316b2;_0x25846c[_0x6e43('0x32')]=_[_0x6e43('0x47')](db[_0x6e43('0x50')]['rawAttributes']);_0x25846c['query']=_[_0x6e43('0x47')](_0x2ab229[_0x6e43('0x35')]);_0x25846c['filters']=_['intersection'](_0x25846c[_0x6e43('0x32')],_0x25846c[_0x6e43('0x35')]);_0x481636[_0x6e43('0x36')]=_[_0x6e43('0x34')](_0x25846c[_0x6e43('0x32')],qs[_0x6e43('0x37')](_0x2ab229['query']['fields']));_0x481636[_0x6e43('0x36')]=_0x481636[_0x6e43('0x36')][_0x6e43('0x38')]?_0x481636[_0x6e43('0x36')]:_0x25846c[_0x6e43('0x32')];_0x481636[_0x6e43('0x3a')]=qs[_0x6e43('0x3b')](_0x2ab229['query'][_0x6e43('0x3b')]);_0x481636['where']=qs[_0x6e43('0x33')](_[_0x6e43('0x3c')](_0x2ab229['query'],_0x25846c[_0x6e43('0x33')]));if(_0x2ab229[_0x6e43('0x35')]['filter']){_0x481636[_0x6e43('0x3d')]=_[_0x6e43('0x40')](_0x481636[_0x6e43('0x3d')],{'$or':_[_0x6e43('0x2c')](_0x481636[_0x6e43('0x36')],function(_0x5ce62c){var _0x168cf0={};_0x168cf0[_0x5ce62c]={'$like':'%'+_0x2ab229[_0x6e43('0x35')][_0x6e43('0x3f')]+'%'};return _0x168cf0;})});}_0x481636=_[_0x6e43('0x40')]({},_0x481636,_0x2ab229[_0x6e43('0x41')]);return _0x59c390['getSubjects'](_0x481636);}})[_0x6e43('0x26')](function(_0x535fed){if(_0x535fed){_0x1eea49=_0x535fed[_0x6e43('0x38')];if(!_0x2ab229[_0x6e43('0x35')][_0x6e43('0x4d')](_0x6e43('0x39'))){_0x481636[_0x6e43('0x1e')]=qs['limit'](_0x2ab229['query'][_0x6e43('0x1e')]);_0x481636[_0x6e43('0x1d')]=qs[_0x6e43('0x1d')](_0x2ab229[_0x6e43('0x35')]['offset']);}return _0x59c390[_0x6e43('0x4e')](_0x481636);}})['then'](function(_0x4077fa){if(_0x4077fa){return _0x4077fa?{'count':_0x1eea49,'rows':_0x4077fa}:null;}})[_0x6e43('0x26')](respondWithResult(_0x9d3085,null))[_0x6e43('0x44')](handleError(_0x9d3085,null));};exports[_0x6e43('0x51')]=function(_0x161cae,_0x2f669f,_0x3e168c){var _0x11c009={};var _0x154145={};var _0x50faad;var _0xd30354;return db[_0x6e43('0x2d')][_0x6e43('0x4f')]({'where':{'id':_0x161cae['params']['id']}})[_0x6e43('0x26')](handleEntityNotFound(_0x2f669f,null))[_0x6e43('0x26')](function(_0x2416fe){if(_0x2416fe){_0x50faad=_0x2416fe;_0x154145[_0x6e43('0x32')]=_['keys'](db[_0x6e43('0x50')][_0x6e43('0x2e')]);_0x154145[_0x6e43('0x35')]=_[_0x6e43('0x47')](_0x161cae[_0x6e43('0x35')]);_0x154145[_0x6e43('0x33')]=_[_0x6e43('0x34')](_0x154145[_0x6e43('0x32')],_0x154145[_0x6e43('0x35')]);_0x11c009['attributes']=_['intersection'](_0x154145[_0x6e43('0x32')],qs['fields'](_0x161cae[_0x6e43('0x35')][_0x6e43('0x37')]));_0x11c009[_0x6e43('0x36')]=_0x11c009['attributes'][_0x6e43('0x38')]?_0x11c009['attributes']:_0x154145[_0x6e43('0x32')];_0x11c009['order']=qs['sort'](_0x161cae[_0x6e43('0x35')][_0x6e43('0x3b')]);_0x11c009[_0x6e43('0x3d')]=qs[_0x6e43('0x33')](_[_0x6e43('0x3c')](_0x161cae[_0x6e43('0x35')],_0x154145[_0x6e43('0x33')]));if(_0x161cae[_0x6e43('0x35')]['filter']){_0x11c009[_0x6e43('0x3d')]=_[_0x6e43('0x40')](_0x11c009[_0x6e43('0x3d')],{'$or':_['map'](_0x11c009[_0x6e43('0x36')],function(_0x10b59a){var _0x4c18ad={};_0x4c18ad[_0x10b59a]={'$like':'%'+_0x161cae[_0x6e43('0x35')][_0x6e43('0x3f')]+'%'};return _0x4c18ad;})});}_0x11c009=_['merge']({},_0x11c009,_0x161cae[_0x6e43('0x41')]);return _0x50faad[_0x6e43('0x51')](_0x11c009);}})['then'](function(_0x4653ff){if(_0x4653ff){_0xd30354=_0x4653ff[_0x6e43('0x38')];if(!_0x161cae[_0x6e43('0x35')][_0x6e43('0x4d')](_0x6e43('0x39'))){_0x11c009[_0x6e43('0x1e')]=qs[_0x6e43('0x1e')](_0x161cae[_0x6e43('0x35')][_0x6e43('0x1e')]);_0x11c009[_0x6e43('0x1d')]=qs[_0x6e43('0x1d')](_0x161cae[_0x6e43('0x35')][_0x6e43('0x1d')]);}return _0x50faad['getDescriptions'](_0x11c009);}})[_0x6e43('0x26')](function(_0x15a934){if(_0x15a934){return _0x15a934?{'count':_0xd30354,'rows':_0x15a934}:null;}})[_0x6e43('0x26')](respondWithResult(_0x2f669f,null))[_0x6e43('0x44')](handleError(_0x2f669f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 55213ce..2cd2d43 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 _0xa4ab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa4ab,0x9c));var _0xba4a=function(_0x3b6652,_0x32486d){_0x3b6652=_0x3b6652-0x0;var _0x14d39f=_0xa4ab[_0x3b6652];return _0x14d39f;};'use strict';var _=require(_0xba4a('0x0'));var util=require(_0xba4a('0x1'));var logger=require(_0xba4a('0x2'))(_0xba4a('0x3'));var moment=require(_0xba4a('0x4'));var BPromise=require(_0xba4a('0x5'));var rp=require(_0xba4a('0x6'));var fs=require('fs');var path=require(_0xba4a('0x7'));var rimraf=require(_0xba4a('0x8'));var config=require(_0xba4a('0x9'));var attributes=require(_0xba4a('0xa'));module['exports']=function(_0x3cf46b,_0x55a528){return _0x3cf46b['define'](_0xba4a('0xb'),attributes,{'tableName':_0xba4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cde=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5cde,0x6b));var _0xe5cd=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x5cde[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0xe5cd('0x0'));var util=require(_0xe5cd('0x1'));var logger=require(_0xe5cd('0x2'))('api');var moment=require(_0xe5cd('0x3'));var BPromise=require(_0xe5cd('0x4'));var rp=require(_0xe5cd('0x5'));var fs=require('fs');var path=require(_0xe5cd('0x6'));var rimraf=require(_0xe5cd('0x7'));var config=require('../../config/environment');var attributes=require(_0xe5cd('0x8'));module[_0xe5cd('0x9')]=function(_0x52dd35,_0xa28bbe){return _0x52dd35[_0xe5cd('0xa')](_0xe5cd('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index b239835..10079a5 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 _0x84c2=['stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x28a6ad,_0x351697){var _0xbb804=function(_0x165d37){while(--_0x165d37){_0x28a6ad['push'](_0x28a6ad['shift']());}};_0xbb804(++_0x351697);}(_0x84c2,0x7c));var _0x284c=function(_0x151f23,_0x533521){_0x151f23=_0x151f23-0x0;var _0x3c13a7=_0x84c2[_0x151f23];return _0x3c13a7;};'use strict';var _=require(_0x284c('0x0'));var util=require(_0x284c('0x1'));var moment=require(_0x284c('0x2'));var BPromise=require(_0x284c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x284c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x284c('0x5'))('rpc');var config=require(_0x284c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x284c('0x7')][_0x284c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e4131,_0x54ce15,_0x4fff0d){return new BPromise(function(_0x61e660,_0x4ee59f){return client[_0x284c('0x9')](_0x2e4131,_0x4fff0d)[_0x284c('0xa')](function(_0x1a3c69){logger[_0x284c('0xb')](_0x284c('0xc'),_0x54ce15,_0x284c('0xd'));logger[_0x284c('0xe')](_0x284c('0xf'),_0x54ce15,'request\x20sent',JSON[_0x284c('0x10')](_0x1a3c69));if(_0x1a3c69[_0x284c('0x11')]){if(_0x1a3c69['error']['code']===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x54ce15,_0x1a3c69[_0x284c('0x11')][_0x284c('0x12')]);return _0x4ee59f(_0x1a3c69[_0x284c('0x11')]['message']);}logger[_0x284c('0x11')](_0x284c('0xc'),_0x54ce15,_0x1a3c69['error'][_0x284c('0x12')]);return _0x61e660(_0x1a3c69['error'][_0x284c('0x12')]);}else{logger[_0x284c('0xb')](_0x284c('0xc'),_0x54ce15,'request\x20sent');_0x61e660(_0x1a3c69['result'][_0x284c('0x12')]);}})[_0x284c('0x13')](function(_0x2355a3){logger[_0x284c('0x11')](_0x284c('0xc'),_0x54ce15,_0x2355a3);_0x4ee59f(_0x2355a3);});});} \ No newline at end of file +var _0x0092=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x4ec911,_0x3534a0){var _0x13ab51=function(_0x3ced5c){while(--_0x3ced5c){_0x4ec911['push'](_0x4ec911['shift']());}};_0x13ab51(++_0x3534a0);}(_0x0092,0x6b));var _0x2009=function(_0x40ec84,_0x25f950){_0x40ec84=_0x40ec84-0x0;var _0x3c230c=_0x0092[_0x40ec84];return _0x3c230c;};'use strict';var _=require(_0x2009('0x0'));var util=require(_0x2009('0x1'));var moment=require('moment');var BPromise=require(_0x2009('0x2'));var rs=require(_0x2009('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2009('0x4'))['db'];var utils=require(_0x2009('0x5'));var logger=require(_0x2009('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2009('0x7'));var client=jayson[_0x2009('0x8')][_0x2009('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c1008,_0x2f06b6,_0x53c31d){return new BPromise(function(_0x3d9d15,_0x42c310){return client[_0x2009('0xa')](_0x4c1008,_0x53c31d)[_0x2009('0xb')](function(_0x5d1da9){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x2f06b6,_0x2009('0xc'));logger[_0x2009('0xd')](_0x2009('0xe'),_0x2f06b6,_0x2009('0xc'),JSON[_0x2009('0xf')](_0x5d1da9));if(_0x5d1da9['error']){if(_0x5d1da9[_0x2009('0x10')][_0x2009('0x11')]===0x1f4){logger[_0x2009('0x10')](_0x2009('0x12'),_0x2f06b6,_0x5d1da9[_0x2009('0x10')][_0x2009('0x13')]);return _0x42c310(_0x5d1da9[_0x2009('0x10')][_0x2009('0x13')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2f06b6,_0x5d1da9[_0x2009('0x10')]['message']);return _0x3d9d15(_0x5d1da9['error']['message']);}else{logger['info'](_0x2009('0x12'),_0x2f06b6,_0x2009('0xc'));_0x3d9d15(_0x5d1da9[_0x2009('0x14')]['message']);}})[_0x2009('0x15')](function(_0x281060){logger[_0x2009('0x10')](_0x2009('0x12'),_0x2f06b6,_0x281060);_0x42c310(_0x281060);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index b1edf29..422547c 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 _0x58c4=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id'];(function(_0x5704b2,_0x43d817){var _0x188c8a=function(_0x4150f1){while(--_0x4150f1){_0x5704b2['push'](_0x5704b2['shift']());}};_0x188c8a(++_0x43d817);}(_0x58c4,0x1a7));var _0x458c=function(_0x287ff4,_0x49dc66){_0x287ff4=_0x287ff4-0x0;var _0x4c1ebb=_0x58c4[_0x287ff4];return _0x4c1ebb;};'use strict';var multer=require(_0x458c('0x0'));var util=require(_0x458c('0x1'));var path=require(_0x458c('0x2'));var timeout=require(_0x458c('0x3'));var express=require(_0x458c('0x4'));var router=express[_0x458c('0x5')]();var fs_extra=require(_0x458c('0x6'));var auth=require(_0x458c('0x7'));var interaction=require(_0x458c('0x8'));var config=require(_0x458c('0x9'));var controller=require('./intSalesforceField.controller');router[_0x458c('0xa')]('/',auth[_0x458c('0xb')](),controller[_0x458c('0xc')]);router[_0x458c('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x458c('0xd')]('/',auth[_0x458c('0xb')](),controller[_0x458c('0xe')]);router[_0x458c('0xf')](_0x458c('0x10'),auth[_0x458c('0xb')](),controller[_0x458c('0x11')]);router[_0x458c('0x12')](_0x458c('0x10'),auth[_0x458c('0xb')](),controller['destroy']);module[_0x458c('0x13')]=router; \ No newline at end of file +var _0xb201=['fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','create','put','delete','util','path','connect-timeout','express','Router'];(function(_0x2166a3,_0x237c50){var _0x260035=function(_0x2dbfa2){while(--_0x2dbfa2){_0x2166a3['push'](_0x2166a3['shift']());}};_0x260035(++_0x237c50);}(_0xb201,0xb1));var _0x1b20=function(_0x51f0a4,_0x10a96c){_0x51f0a4=_0x51f0a4-0x0;var _0x3fd467=_0xb201[_0x51f0a4];return _0x3fd467;};'use strict';var multer=require('multer');var util=require(_0x1b20('0x0'));var path=require(_0x1b20('0x1'));var timeout=require(_0x1b20('0x2'));var express=require(_0x1b20('0x3'));var router=express[_0x1b20('0x4')]();var fs_extra=require(_0x1b20('0x5'));var auth=require(_0x1b20('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x1b20('0x7')]('/',auth[_0x1b20('0x8')](),controller['index']);router[_0x1b20('0x7')](_0x1b20('0x9'),auth[_0x1b20('0x8')](),controller[_0x1b20('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1b20('0xb')]);router[_0x1b20('0xc')](_0x1b20('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x1b20('0xd')]('/:id',auth[_0x1b20('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e4e3d6c..ed08063 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 _0x09f2=['sequelize','exports','ENUM','string','keyValue','picklist','STRING','variable','customVariable'];(function(_0x574440,_0x15fb7a){var _0x49970b=function(_0x1fad5e){while(--_0x1fad5e){_0x574440['push'](_0x574440['shift']());}};_0x49970b(++_0x15fb7a);}(_0x09f2,0xd8));var _0x209f=function(_0x2ee751,_0x3dc6ea){_0x2ee751=_0x2ee751-0x0;var _0x2362f0=_0x09f2[_0x2ee751];return _0x2362f0;};'use strict';var Sequelize=require(_0x209f('0x0'));module[_0x209f('0x1')]={'type':{'type':Sequelize[_0x209f('0x2')](_0x209f('0x3'),'variable','customVariable',_0x209f('0x4'),_0x209f('0x5')),'defaultValue':_0x209f('0x3')},'content':{'type':Sequelize[_0x209f('0x6')]},'key':{'type':Sequelize[_0x209f('0x6')]},'keyType':{'type':Sequelize[_0x209f('0x2')](_0x209f('0x3'),_0x209f('0x7'),_0x209f('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x209f('0x6')]},'variableName':{'type':Sequelize[_0x209f('0x6')]}}; \ No newline at end of file +var _0x0ce0=['customVariable','sequelize','ENUM','keyValue','picklist','string','STRING'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0x0ce0,0x15f));var _0x00ce=function(_0x455e82,_0x522f6f){_0x455e82=_0x455e82-0x0;var _0x2d0520=_0x0ce0[_0x455e82];return _0x2d0520;};'use strict';var Sequelize=require(_0x00ce('0x0'));module['exports']={'type':{'type':Sequelize[_0x00ce('0x1')]('string','variable','customVariable',_0x00ce('0x2'),_0x00ce('0x3')),'defaultValue':_0x00ce('0x4')},'content':{'type':Sequelize[_0x00ce('0x5')]},'key':{'type':Sequelize[_0x00ce('0x5')]},'keyType':{'type':Sequelize[_0x00ce('0x1')]('string','variable',_0x00ce('0x6'))},'keyContent':{'type':Sequelize[_0x00ce('0x5')]},'idField':{'type':Sequelize[_0x00ce('0x5')]},'variableName':{'type':Sequelize[_0x00ce('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3724b3b..ecff527 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 _0xb2ad=['catch','create','body','update','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','limit','undefined','count','offset','status','set','Content-Range','json','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','includeAll','find'];(function(_0x585734,_0x48dab4){var _0x402561=function(_0xfd8d43){while(--_0xfd8d43){_0x585734['push'](_0x585734['shift']());}};_0x402561(++_0x48dab4);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x389789,_0x5034d3){_0x389789=_0x389789-0x0;var _0x59d691=_0xb2ad[_0x389789];return _0x59d691;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb2a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb2a('0x1'));var rp=require(_0xdb2a('0x2'));var moment=require(_0xdb2a('0x3'));var BPromise=require(_0xdb2a('0x4'));var Mustache=require(_0xdb2a('0x5'));var util=require('util');var path=require(_0xdb2a('0x6'));var sox=require(_0xdb2a('0x7'));var csv=require(_0xdb2a('0x8'));var ejs=require(_0xdb2a('0x9'));var fs=require('fs');var fs_extra=require(_0xdb2a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb2a('0xb'));var jsforce=require(_0xdb2a('0xc'));var deskjs=require(_0xdb2a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdb2a('0xe'));var Papa=require(_0xdb2a('0xf'));var Redis=require('ioredis');var authService=require(_0xdb2a('0x10'));var qs=require(_0xdb2a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb2a('0x12'))(_0xdb2a('0x13'));var utils=require(_0xdb2a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdb2a('0x15'));var db=require(_0xdb2a('0x16'))['db'];function respondWithStatusCode(_0x5c6688,_0x5f4a7b){_0x5f4a7b=_0x5f4a7b||0xcc;return function(_0x4e1cda){if(_0x4e1cda){return _0x5c6688[_0xdb2a('0x17')](_0x5f4a7b);}return _0x5c6688['status'](_0x5f4a7b)[_0xdb2a('0x18')]();};}function respondWithResult(_0x3c3ac3,_0x527af2){_0x527af2=_0x527af2||0xc8;return function(_0x33045a){if(_0x33045a){return _0x3c3ac3['status'](_0x527af2)['json'](_0x33045a);}};}function respondWithFilteredResult(_0x5d8282,_0x5dbbb1){return function(_0x8a580e){if(_0x8a580e){var _0x2df1fd=typeof _0x5dbbb1['offset']==='undefined'&&typeof _0x5dbbb1[_0xdb2a('0x19')]===_0xdb2a('0x1a');var _0x440dab=_0x8a580e[_0xdb2a('0x1b')];var _0x52508d=_0x2df1fd?0x0:_0x5dbbb1[_0xdb2a('0x1c')];var _0x2de4cf=_0x2df1fd?_0x8a580e[_0xdb2a('0x1b')]:_0x5dbbb1['offset']+_0x5dbbb1['limit'];var _0x424583;if(_0x2de4cf>=_0x440dab){_0x2de4cf=_0x440dab;_0x424583=0xc8;}else{_0x424583=0xce;}_0x5d8282[_0xdb2a('0x1d')](_0x424583);return _0x5d8282[_0xdb2a('0x1e')](_0xdb2a('0x1f'),_0x52508d+'-'+_0x2de4cf+'/'+_0x440dab)[_0xdb2a('0x20')](_0x8a580e);}return null;};}function patchUpdates(_0x5e6a59){return function(_0x5c3824){try{jsonpatch['apply'](_0x5c3824,_0x5e6a59,!![]);}catch(_0x444fcf){return BPromise['reject'](_0x444fcf);}return _0x5c3824['save']();};}function saveUpdates(_0x1e6985,_0x449fba){return function(_0x46910c){if(_0x46910c){return _0x46910c['update'](_0x1e6985)[_0xdb2a('0x21')](function(_0x871b44){return _0x871b44;});}return null;};}function removeEntity(_0x16035f,_0x391378){return function(_0x1f3d54){if(_0x1f3d54){return _0x1f3d54[_0xdb2a('0x22')]()['then'](function(){_0x16035f[_0xdb2a('0x1d')](0xcc)[_0xdb2a('0x18')]();});}};}function handleEntityNotFound(_0x5f00fb,_0x332911){return function(_0x3645e9){if(!_0x3645e9){_0x5f00fb[_0xdb2a('0x17')](0x194);}return _0x3645e9;};}function handleError(_0x28252e,_0x4dd822){_0x4dd822=_0x4dd822||0x1f4;return function(_0xc50c3d){logger[_0xdb2a('0x23')](_0xc50c3d[_0xdb2a('0x24')]);if(_0xc50c3d[_0xdb2a('0x25')]){delete _0xc50c3d['name'];}_0x28252e[_0xdb2a('0x1d')](_0x4dd822)[_0xdb2a('0x26')](_0xc50c3d);};}exports[_0xdb2a('0x27')]=function(_0x2b1c6d,_0x235c06){var _0x565889={},_0x852103={},_0x19e39c={'count':0x0,'rows':[]};var _0x42cc46=_[_0xdb2a('0x28')](db[_0xdb2a('0x29')][_0xdb2a('0x2a')],function(_0x134053){return{'name':_0x134053[_0xdb2a('0x2b')],'type':_0x134053[_0xdb2a('0x2c')][_0xdb2a('0x2d')]};});_0x852103[_0xdb2a('0x2e')]=_[_0xdb2a('0x28')](_0x42cc46,_0xdb2a('0x25'));_0x852103[_0xdb2a('0x2f')]=_[_0xdb2a('0x30')](_0x2b1c6d[_0xdb2a('0x2f')]);_0x852103[_0xdb2a('0x31')]=_[_0xdb2a('0x32')](_0x852103[_0xdb2a('0x2e')],_0x852103[_0xdb2a('0x2f')]);_0x565889['attributes']=_[_0xdb2a('0x32')](_0x852103[_0xdb2a('0x2e')],qs[_0xdb2a('0x33')](_0x2b1c6d['query'][_0xdb2a('0x33')]));_0x565889[_0xdb2a('0x34')]=_0x565889[_0xdb2a('0x34')][_0xdb2a('0x35')]?_0x565889[_0xdb2a('0x34')]:_0x852103[_0xdb2a('0x2e')];if(!_0x2b1c6d[_0xdb2a('0x2f')][_0xdb2a('0x36')](_0xdb2a('0x37'))){_0x565889[_0xdb2a('0x19')]=qs[_0xdb2a('0x19')](_0x2b1c6d[_0xdb2a('0x2f')][_0xdb2a('0x19')]);_0x565889[_0xdb2a('0x1c')]=qs[_0xdb2a('0x1c')](_0x2b1c6d['query'][_0xdb2a('0x1c')]);}_0x565889['order']=qs['sort'](_0x2b1c6d[_0xdb2a('0x2f')][_0xdb2a('0x38')]);_0x565889[_0xdb2a('0x39')]=qs[_0xdb2a('0x31')](_[_0xdb2a('0x3a')](_0x2b1c6d['query'],_0x852103['filters']),_0x42cc46);if(_0x2b1c6d[_0xdb2a('0x2f')]['filter']){_0x565889['where']=_[_0xdb2a('0x3b')](_0x565889[_0xdb2a('0x39')],{'$or':_[_0xdb2a('0x28')](_0x42cc46,function(_0x500616){if(_0x500616[_0xdb2a('0x2c')]!==_0xdb2a('0x3c')){var _0x2fa3e3={};_0x2fa3e3[_0x500616['name']]={'$like':'%'+_0x2b1c6d[_0xdb2a('0x2f')][_0xdb2a('0x3d')]+'%'};return _0x2fa3e3;}})});}_0x565889=_[_0xdb2a('0x3b')]({},_0x565889,_0x2b1c6d[_0xdb2a('0x3e')]);var _0x1efcf8={'where':_0x565889[_0xdb2a('0x39')]};return db[_0xdb2a('0x29')]['count'](_0x1efcf8)[_0xdb2a('0x21')](function(_0x170d7c){_0x19e39c[_0xdb2a('0x1b')]=_0x170d7c;if(_0x2b1c6d[_0xdb2a('0x2f')]['includeAll']){_0x565889[_0xdb2a('0x3f')]=[{'all':!![]}];}return db[_0xdb2a('0x29')]['findAll'](_0x565889);})[_0xdb2a('0x21')](function(_0x39c387){_0x19e39c[_0xdb2a('0x40')]=_0x39c387;return _0x19e39c;})[_0xdb2a('0x21')](respondWithFilteredResult(_0x235c06,_0x565889))['catch'](handleError(_0x235c06,null));};exports['show']=function(_0x4b14f8,_0x2e56b6){var _0x2c69d3={'raw':!![],'where':{'id':_0x4b14f8['params']['id']}},_0x54ffcc={};_0x54ffcc['model']=_['keys'](db[_0xdb2a('0x29')]['rawAttributes']);_0x54ffcc[_0xdb2a('0x2f')]=_[_0xdb2a('0x30')](_0x4b14f8[_0xdb2a('0x2f')]);_0x54ffcc[_0xdb2a('0x31')]=_['intersection'](_0x54ffcc[_0xdb2a('0x2e')],_0x54ffcc[_0xdb2a('0x2f')]);_0x2c69d3[_0xdb2a('0x34')]=_['intersection'](_0x54ffcc[_0xdb2a('0x2e')],qs[_0xdb2a('0x33')](_0x4b14f8[_0xdb2a('0x2f')][_0xdb2a('0x33')]));_0x2c69d3['attributes']=_0x2c69d3[_0xdb2a('0x34')]['length']?_0x2c69d3[_0xdb2a('0x34')]:_0x54ffcc['model'];if(_0x4b14f8['query'][_0xdb2a('0x41')]){_0x2c69d3[_0xdb2a('0x3f')]=[{'all':!![]}];}_0x2c69d3=_[_0xdb2a('0x3b')]({},_0x2c69d3,_0x4b14f8[_0xdb2a('0x3e')]);return db[_0xdb2a('0x29')][_0xdb2a('0x42')](_0x2c69d3)[_0xdb2a('0x21')](handleEntityNotFound(_0x2e56b6,null))['then'](respondWithResult(_0x2e56b6,null))[_0xdb2a('0x43')](handleError(_0x2e56b6,null));};exports[_0xdb2a('0x44')]=function(_0x1352a3,_0x300543){return db['SalesforceField'][_0xdb2a('0x44')](_0x1352a3[_0xdb2a('0x45')],{})['then'](respondWithResult(_0x300543,0xc9))[_0xdb2a('0x43')](handleError(_0x300543,null));};exports[_0xdb2a('0x46')]=function(_0x2daae5,_0x2079d4){if(_0x2daae5['body']['id']){delete _0x2daae5['body']['id'];}return db[_0xdb2a('0x29')]['find']({'where':{'id':_0x2daae5[_0xdb2a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2079d4,null))[_0xdb2a('0x21')](saveUpdates(_0x2daae5[_0xdb2a('0x45')],null))[_0xdb2a('0x21')](respondWithResult(_0x2079d4,null))['catch'](handleError(_0x2079d4,null));};exports[_0xdb2a('0x22')]=function(_0x471013,_0x1ebf04){return db['SalesforceField'][_0xdb2a('0x42')]({'where':{'id':_0x471013['params']['id']}})[_0xdb2a('0x21')](handleEntityNotFound(_0x1ebf04,null))[_0xdb2a('0x21')](removeEntity(_0x1ebf04,null))['catch'](handleError(_0x1ebf04,null));}; \ No newline at end of file +var _0xa3f9=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','fast-json-patch','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'];(function(_0x58128a,_0x8ab991){var _0x56f353=function(_0x925531){while(--_0x925531){_0x58128a['push'](_0x58128a['shift']());}};_0x56f353(++_0x8ab991);}(_0xa3f9,0x116));var _0x9a3f=function(_0x375201,_0x2cdbd8){_0x375201=_0x375201-0x0;var _0x55f38f=_0xa3f9[_0x375201];return _0x55f38f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9a3f('0x0'));var rp=require('request-promise');var moment=require(_0x9a3f('0x1'));var BPromise=require(_0x9a3f('0x2'));var Mustache=require(_0x9a3f('0x3'));var util=require('util');var path=require('path');var sox=require(_0x9a3f('0x4'));var csv=require(_0x9a3f('0x5'));var ejs=require(_0x9a3f('0x6'));var fs=require('fs');var fs_extra=require(_0x9a3f('0x7'));var _=require(_0x9a3f('0x8'));var squel=require(_0x9a3f('0x9'));var crypto=require(_0x9a3f('0xa'));var jsforce=require(_0x9a3f('0xb'));var deskjs=require(_0x9a3f('0xc'));var toCsv=require(_0x9a3f('0x5'));var querystring=require(_0x9a3f('0xd'));var Papa=require(_0x9a3f('0xe'));var Redis=require(_0x9a3f('0xf'));var authService=require(_0x9a3f('0x10'));var qs=require(_0x9a3f('0x11'));var as=require(_0x9a3f('0x12'));var hardwareService=require(_0x9a3f('0x13'));var logger=require(_0x9a3f('0x14'))(_0x9a3f('0x15'));var utils=require(_0x9a3f('0x16'));var config=require(_0x9a3f('0x17'));var licenseUtil=require(_0x9a3f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db834,_0x204ebd){_0x204ebd=_0x204ebd||0xcc;return function(_0x51547f){if(_0x51547f){return _0x4db834[_0x9a3f('0x19')](_0x204ebd);}return _0x4db834['status'](_0x204ebd)[_0x9a3f('0x1a')]();};}function respondWithResult(_0x5d14ea,_0x402774){_0x402774=_0x402774||0xc8;return function(_0x58ba92){if(_0x58ba92){return _0x5d14ea[_0x9a3f('0x1b')](_0x402774)[_0x9a3f('0x1c')](_0x58ba92);}};}function respondWithFilteredResult(_0x2100f5,_0x309086){return function(_0x58ff77){if(_0x58ff77){var _0x31cd1d=typeof _0x309086[_0x9a3f('0x1d')]==='undefined'&&typeof _0x309086[_0x9a3f('0x1e')]===_0x9a3f('0x1f');var _0x48b3b7=_0x58ff77[_0x9a3f('0x20')];var _0x45f648=_0x31cd1d?0x0:_0x309086[_0x9a3f('0x1d')];var _0x11e323=_0x31cd1d?_0x58ff77[_0x9a3f('0x20')]:_0x309086['offset']+_0x309086[_0x9a3f('0x1e')];var _0x962424;if(_0x11e323>=_0x48b3b7){_0x11e323=_0x48b3b7;_0x962424=0xc8;}else{_0x962424=0xce;}_0x2100f5[_0x9a3f('0x1b')](_0x962424);return _0x2100f5[_0x9a3f('0x21')]('Content-Range',_0x45f648+'-'+_0x11e323+'/'+_0x48b3b7)['json'](_0x58ff77);}return null;};}function patchUpdates(_0x282db4){return function(_0x1bed8f){try{jsonpatch[_0x9a3f('0x22')](_0x1bed8f,_0x282db4,!![]);}catch(_0x521c51){return BPromise[_0x9a3f('0x23')](_0x521c51);}return _0x1bed8f[_0x9a3f('0x24')]();};}function saveUpdates(_0xc8671,_0x161ed9){return function(_0x21e14c){if(_0x21e14c){return _0x21e14c[_0x9a3f('0x25')](_0xc8671)[_0x9a3f('0x26')](function(_0x50a40f){return _0x50a40f;});}return null;};}function removeEntity(_0x37ebd8,_0x128d71){return function(_0x30e8ab){if(_0x30e8ab){return _0x30e8ab['destroy']()[_0x9a3f('0x26')](function(){_0x37ebd8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x869ced,_0x48113a){return function(_0xdf51a5){if(!_0xdf51a5){_0x869ced[_0x9a3f('0x19')](0x194);}return _0xdf51a5;};}function handleError(_0x441f6a,_0x3132f6){_0x3132f6=_0x3132f6||0x1f4;return function(_0xe8f3cd){logger[_0x9a3f('0x27')](_0xe8f3cd[_0x9a3f('0x28')]);if(_0xe8f3cd[_0x9a3f('0x29')]){delete _0xe8f3cd[_0x9a3f('0x29')];}_0x441f6a[_0x9a3f('0x1b')](_0x3132f6)[_0x9a3f('0x2a')](_0xe8f3cd);};}exports[_0x9a3f('0x2b')]=function(_0x4c8ddf,_0x354494){var _0x43398a={},_0x2bc8cf={},_0xdef3b2={'count':0x0,'rows':[]};var _0x62c004=_[_0x9a3f('0x2c')](db[_0x9a3f('0x2d')][_0x9a3f('0x2e')],function(_0xa5ba4){return{'name':_0xa5ba4[_0x9a3f('0x2f')],'type':_0xa5ba4[_0x9a3f('0x30')]['key']};});_0x2bc8cf[_0x9a3f('0x31')]=_[_0x9a3f('0x2c')](_0x62c004,_0x9a3f('0x29'));_0x2bc8cf[_0x9a3f('0x32')]=_[_0x9a3f('0x33')](_0x4c8ddf[_0x9a3f('0x32')]);_0x2bc8cf[_0x9a3f('0x34')]=_[_0x9a3f('0x35')](_0x2bc8cf[_0x9a3f('0x31')],_0x2bc8cf[_0x9a3f('0x32')]);_0x43398a[_0x9a3f('0x36')]=_[_0x9a3f('0x35')](_0x2bc8cf[_0x9a3f('0x31')],qs[_0x9a3f('0x37')](_0x4c8ddf['query'][_0x9a3f('0x37')]));_0x43398a[_0x9a3f('0x36')]=_0x43398a['attributes'][_0x9a3f('0x38')]?_0x43398a[_0x9a3f('0x36')]:_0x2bc8cf[_0x9a3f('0x31')];if(!_0x4c8ddf['query']['hasOwnProperty'](_0x9a3f('0x39'))){_0x43398a[_0x9a3f('0x1e')]=qs[_0x9a3f('0x1e')](_0x4c8ddf[_0x9a3f('0x32')][_0x9a3f('0x1e')]);_0x43398a[_0x9a3f('0x1d')]=qs[_0x9a3f('0x1d')](_0x4c8ddf[_0x9a3f('0x32')][_0x9a3f('0x1d')]);}_0x43398a[_0x9a3f('0x3a')]=qs[_0x9a3f('0x3b')](_0x4c8ddf[_0x9a3f('0x32')][_0x9a3f('0x3b')]);_0x43398a[_0x9a3f('0x3c')]=qs[_0x9a3f('0x34')](_[_0x9a3f('0x3d')](_0x4c8ddf[_0x9a3f('0x32')],_0x2bc8cf[_0x9a3f('0x34')]),_0x62c004);if(_0x4c8ddf['query'][_0x9a3f('0x3e')]){_0x43398a[_0x9a3f('0x3c')]=_['merge'](_0x43398a[_0x9a3f('0x3c')],{'$or':_[_0x9a3f('0x2c')](_0x62c004,function(_0x5a7950){if(_0x5a7950['type']!==_0x9a3f('0x3f')){var _0x3bbf71={};_0x3bbf71[_0x5a7950[_0x9a3f('0x29')]]={'$like':'%'+_0x4c8ddf['query'][_0x9a3f('0x3e')]+'%'};return _0x3bbf71;}})});}_0x43398a=_[_0x9a3f('0x40')]({},_0x43398a,_0x4c8ddf['options']);var _0x5fc581={'where':_0x43398a[_0x9a3f('0x3c')]};return db[_0x9a3f('0x2d')][_0x9a3f('0x20')](_0x5fc581)['then'](function(_0x263847){_0xdef3b2[_0x9a3f('0x20')]=_0x263847;if(_0x4c8ddf[_0x9a3f('0x32')][_0x9a3f('0x41')]){_0x43398a[_0x9a3f('0x42')]=[{'all':!![]}];}return db[_0x9a3f('0x2d')][_0x9a3f('0x43')](_0x43398a);})[_0x9a3f('0x26')](function(_0x2e6687){_0xdef3b2[_0x9a3f('0x44')]=_0x2e6687;return _0xdef3b2;})[_0x9a3f('0x26')](respondWithFilteredResult(_0x354494,_0x43398a))[_0x9a3f('0x45')](handleError(_0x354494,null));};exports[_0x9a3f('0x46')]=function(_0x4ca507,_0x3b8771){var _0x5c461f={'raw':!![],'where':{'id':_0x4ca507[_0x9a3f('0x47')]['id']}},_0x311ed1={};_0x311ed1['model']=_[_0x9a3f('0x33')](db[_0x9a3f('0x2d')]['rawAttributes']);_0x311ed1[_0x9a3f('0x32')]=_[_0x9a3f('0x33')](_0x4ca507[_0x9a3f('0x32')]);_0x311ed1[_0x9a3f('0x34')]=_[_0x9a3f('0x35')](_0x311ed1[_0x9a3f('0x31')],_0x311ed1[_0x9a3f('0x32')]);_0x5c461f['attributes']=_['intersection'](_0x311ed1[_0x9a3f('0x31')],qs['fields'](_0x4ca507[_0x9a3f('0x32')][_0x9a3f('0x37')]));_0x5c461f[_0x9a3f('0x36')]=_0x5c461f[_0x9a3f('0x36')][_0x9a3f('0x38')]?_0x5c461f[_0x9a3f('0x36')]:_0x311ed1[_0x9a3f('0x31')];if(_0x4ca507[_0x9a3f('0x32')][_0x9a3f('0x41')]){_0x5c461f[_0x9a3f('0x42')]=[{'all':!![]}];}_0x5c461f=_[_0x9a3f('0x40')]({},_0x5c461f,_0x4ca507['options']);return db[_0x9a3f('0x2d')][_0x9a3f('0x48')](_0x5c461f)[_0x9a3f('0x26')](handleEntityNotFound(_0x3b8771,null))[_0x9a3f('0x26')](respondWithResult(_0x3b8771,null))[_0x9a3f('0x45')](handleError(_0x3b8771,null));};exports[_0x9a3f('0x49')]=function(_0x595173,_0xbb4679){return db[_0x9a3f('0x2d')][_0x9a3f('0x49')](_0x595173[_0x9a3f('0x4a')],{})[_0x9a3f('0x26')](respondWithResult(_0xbb4679,0xc9))[_0x9a3f('0x45')](handleError(_0xbb4679,null));};exports['update']=function(_0x29bd38,_0x2e3d96){if(_0x29bd38[_0x9a3f('0x4a')]['id']){delete _0x29bd38[_0x9a3f('0x4a')]['id'];}return db[_0x9a3f('0x2d')]['find']({'where':{'id':_0x29bd38[_0x9a3f('0x47')]['id']}})[_0x9a3f('0x26')](handleEntityNotFound(_0x2e3d96,null))[_0x9a3f('0x26')](saveUpdates(_0x29bd38[_0x9a3f('0x4a')],null))['then'](respondWithResult(_0x2e3d96,null))[_0x9a3f('0x45')](handleError(_0x2e3d96,null));};exports['destroy']=function(_0x4d51ac,_0x57ca99){return db[_0x9a3f('0x2d')]['find']({'where':{'id':_0x4d51ac[_0x9a3f('0x47')]['id']}})[_0x9a3f('0x26')](handleEntityNotFound(_0x57ca99,null))[_0x9a3f('0x26')](removeEntity(_0x57ca99,null))[_0x9a3f('0x45')](handleError(_0x57ca99,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f78f4e1..88918f7 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 _0xce45=['./intSalesforceField.attributes','exports','define','SalesforceField','idField','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x3d619b,_0x49e8d5){var _0x1d462c=function(_0xa4bc5e){while(--_0xa4bc5e){_0x3d619b['push'](_0x3d619b['shift']());}};_0x1d462c(++_0x49e8d5);}(_0xce45,0x7d));var _0x5ce4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xce45[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5ce4('0x0'))('api');var moment=require(_0x5ce4('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ce4('0x2'));var rimraf=require(_0x5ce4('0x3'));var config=require(_0x5ce4('0x4'));var attributes=require(_0x5ce4('0x5'));module[_0x5ce4('0x6')]=function(_0x17bf04,_0x3ef22a){return _0x17bf04[_0x5ce4('0x7')](_0x5ce4('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x5ce4('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86fd=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intSalesforceField.attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x86fd,0x102));var _0xd86f=function(_0x3f6c29,_0x370d86){_0x3f6c29=_0x3f6c29-0x0;var _0x4af959=_0x86fd[_0x3f6c29];return _0x4af959;};'use strict';var _=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var logger=require(_0xd86f('0x2'))(_0xd86f('0x3'));var moment=require('moment');var BPromise=require(_0xd86f('0x4'));var rp=require(_0xd86f('0x5'));var fs=require('fs');var path=require(_0xd86f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd86f('0x7'));module['exports']=function(_0x536cea,_0x93f924){return _0x536cea[_0xd86f('0x8')](_0xd86f('0x9'),attributes,{'tableName':_0xd86f('0xa'),'paranoid':![],'indexes':[{'name':_0xd86f('0xb'),'fields':[_0xd86f('0xc'),_0xd86f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index ee7388f..5c292d8 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 _0x3f0a=['../../config/logger','rpc','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1a300b,_0xa3a361){var _0x26065a=function(_0x3e6d56){while(--_0x3e6d56){_0x1a300b['push'](_0x1a300b['shift']());}};_0x26065a(++_0xa3a361);}(_0x3f0a,0x1b1));var _0xa3f0=function(_0x2a69ae,_0x8514fe){_0x2a69ae=_0x2a69ae-0x0;var _0x1e6d11=_0x3f0a[_0x2a69ae];return _0x1e6d11;};'use strict';var _=require(_0xa3f0('0x0'));var util=require(_0xa3f0('0x1'));var moment=require(_0xa3f0('0x2'));var BPromise=require(_0xa3f0('0x3'));var rs=require(_0xa3f0('0x4'));var fs=require('fs');var Redis=require(_0xa3f0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3f0('0x6'));var logger=require(_0xa3f0('0x7'))(_0xa3f0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa3f0('0x9')][_0xa3f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d9e06,_0x27ead3,_0x3fd763){return new BPromise(function(_0x27bbee,_0x2aaf56){return client[_0xa3f0('0xb')](_0x3d9e06,_0x3fd763)[_0xa3f0('0xc')](function(_0x5294cf){logger[_0xa3f0('0xd')](_0xa3f0('0xe'),_0x27ead3,_0xa3f0('0xf'));logger[_0xa3f0('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x27ead3,_0xa3f0('0xf'),JSON['stringify'](_0x5294cf));if(_0x5294cf[_0xa3f0('0x11')]){if(_0x5294cf[_0xa3f0('0x11')][_0xa3f0('0x12')]===0x1f4){logger[_0xa3f0('0x11')]('SalesforceField,\x20%s,\x20%s',_0x27ead3,_0x5294cf[_0xa3f0('0x11')][_0xa3f0('0x13')]);return _0x2aaf56(_0x5294cf[_0xa3f0('0x11')][_0xa3f0('0x13')]);}logger[_0xa3f0('0x11')](_0xa3f0('0xe'),_0x27ead3,_0x5294cf[_0xa3f0('0x11')][_0xa3f0('0x13')]);return _0x27bbee(_0x5294cf[_0xa3f0('0x11')]['message']);}else{logger[_0xa3f0('0xd')](_0xa3f0('0xe'),_0x27ead3,_0xa3f0('0xf'));_0x27bbee(_0x5294cf[_0xa3f0('0x14')][_0xa3f0('0x13')]);}})[_0xa3f0('0x15')](function(_0x52ee14){logger[_0xa3f0('0x11')](_0xa3f0('0xe'),_0x27ead3,_0x52ee14);_0x2aaf56(_0x52ee14);});});} \ No newline at end of file +var _0xd5e4=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x4782eb,_0x1dafc9){var _0x9f1353=function(_0x1b74b4){while(--_0x1b74b4){_0x4782eb['push'](_0x4782eb['shift']());}};_0x9f1353(++_0x1dafc9);}(_0xd5e4,0x187));var _0x4d5e=function(_0x4b999b,_0x1ecccd){_0x4b999b=_0x4b999b-0x0;var _0x3bf537=_0xd5e4[_0x4b999b];return _0x3bf537;};'use strict';var _=require(_0x4d5e('0x0'));var util=require(_0x4d5e('0x1'));var moment=require(_0x4d5e('0x2'));var BPromise=require(_0x4d5e('0x3'));var rs=require(_0x4d5e('0x4'));var fs=require('fs');var Redis=require(_0x4d5e('0x5'));var db=require(_0x4d5e('0x6'))['db'];var utils=require(_0x4d5e('0x7'));var logger=require(_0x4d5e('0x8'))(_0x4d5e('0x9'));var config=require('../../config/environment');var jayson=require(_0x4d5e('0xa'));var client=jayson[_0x4d5e('0xb')][_0x4d5e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34027e,_0x205534,_0x1114ef){return new BPromise(function(_0x4b4f25,_0x2bb844){return client[_0x4d5e('0xd')](_0x34027e,_0x1114ef)[_0x4d5e('0xe')](function(_0x4f5b7e){logger['info'](_0x4d5e('0xf'),_0x205534,'request\x20sent');logger[_0x4d5e('0x10')](_0x4d5e('0x11'),_0x205534,_0x4d5e('0x12'),JSON[_0x4d5e('0x13')](_0x4f5b7e));if(_0x4f5b7e['error']){if(_0x4f5b7e[_0x4d5e('0x14')][_0x4d5e('0x15')]===0x1f4){logger[_0x4d5e('0x14')](_0x4d5e('0xf'),_0x205534,_0x4f5b7e[_0x4d5e('0x14')][_0x4d5e('0x16')]);return _0x2bb844(_0x4f5b7e['error']['message']);}logger['error'](_0x4d5e('0xf'),_0x205534,_0x4f5b7e[_0x4d5e('0x14')][_0x4d5e('0x16')]);return _0x4b4f25(_0x4f5b7e['error'][_0x4d5e('0x16')]);}else{logger[_0x4d5e('0x17')](_0x4d5e('0xf'),_0x205534,'request\x20sent');_0x4b4f25(_0x4f5b7e[_0x4d5e('0x18')][_0x4d5e('0x16')]);}})[_0x4d5e('0x19')](function(_0xb409aa){logger[_0x4d5e('0x14')](_0x4d5e('0xf'),_0x205534,_0xb409aa);_0x2bb844(_0xb409aa);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f173529..e9ff794 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 _0x1db3=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x59f1dd,_0x4328ec){var _0x14e459=function(_0x95973){while(--_0x95973){_0x59f1dd['push'](_0x59f1dd['shift']());}};_0x14e459(++_0x4328ec);}(_0x1db3,0x1e5));var _0x31db=function(_0x5ebdc4,_0x1f2f61){_0x5ebdc4=_0x5ebdc4-0x0;var _0x234bd2=_0x1db3[_0x5ebdc4];return _0x234bd2;};'use strict';var multer=require('multer');var util=require(_0x31db('0x0'));var path=require(_0x31db('0x1'));var timeout=require(_0x31db('0x2'));var express=require(_0x31db('0x3'));var router=express[_0x31db('0x4')]();var fs_extra=require(_0x31db('0x5'));var auth=require(_0x31db('0x6'));var interaction=require(_0x31db('0x7'));var config=require(_0x31db('0x8'));var controller=require(_0x31db('0x9'));router[_0x31db('0xa')]('/',auth[_0x31db('0xb')](),controller[_0x31db('0xc')]);router[_0x31db('0xa')](_0x31db('0xd'),auth[_0x31db('0xb')](),controller[_0x31db('0xe')]);router[_0x31db('0xa')](_0x31db('0xf'),auth['isAuthenticated'](),controller[_0x31db('0x10')]);router[_0x31db('0xa')](_0x31db('0x11'),auth[_0x31db('0xb')](),controller[_0x31db('0x12')]);router['post']('/',auth[_0x31db('0xb')](),controller[_0x31db('0x13')]);router[_0x31db('0x14')]('/:id/configurations',auth[_0x31db('0xb')](),controller[_0x31db('0x15')]);router[_0x31db('0x16')](_0x31db('0xd'),auth[_0x31db('0xb')](),controller[_0x31db('0x17')]);router['delete']('/:id',auth[_0x31db('0xb')](),controller['destroy']);module[_0x31db('0x18')]=router; \ No newline at end of file +var _0x4242=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','create','put'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x4242,0xb5));var _0x2424=function(_0x3f22a2,_0x4523ba){_0x3f22a2=_0x3f22a2-0x0;var _0x414a88=_0x4242[_0x3f22a2];return _0x414a88;};'use strict';var multer=require(_0x2424('0x0'));var util=require(_0x2424('0x1'));var path=require(_0x2424('0x2'));var timeout=require(_0x2424('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2424('0x4'));var auth=require(_0x2424('0x5'));var interaction=require(_0x2424('0x6'));var config=require('../../config/environment');var controller=require(_0x2424('0x7'));router[_0x2424('0x8')]('/',auth[_0x2424('0x9')](),controller[_0x2424('0xa')]);router[_0x2424('0x8')]('/:id',auth[_0x2424('0x9')](),controller['show']);router['get'](_0x2424('0xb'),auth[_0x2424('0x9')](),controller[_0x2424('0xc')]);router['get'](_0x2424('0xd'),auth['isAuthenticated'](),controller[_0x2424('0xe')]);router['post']('/',auth[_0x2424('0x9')](),controller[_0x2424('0xf')]);router['post']('/:id/configurations',auth[_0x2424('0x9')](),controller['addConfiguration']);router[_0x2424('0x10')](_0x2424('0x11'),auth['isAuthenticated'](),controller[_0x2424('0x12')]);router[_0x2424('0x13')](_0x2424('0x11'),auth[_0x2424('0x9')](),controller[_0x2424('0x14')]);module[_0x2424('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 176d399..dc00269 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 _0xa3b5=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4f3267,_0x5f04f9){var _0x228a2d=function(_0x42b02d){while(--_0x42b02d){_0x4f3267['push'](_0x4f3267['shift']());}};_0x228a2d(++_0x5f04f9);}(_0xa3b5,0xe7));var _0x5a3b=function(_0x2df4f2,_0x311156){_0x2df4f2=_0x2df4f2-0x0;var _0x3893e0=_0xa3b5[_0x2df4f2];return _0x3893e0;};'use strict';var Sequelize=require(_0x5a3b('0x0'));module[_0x5a3b('0x1')]={'name':{'type':Sequelize[_0x5a3b('0x2')]},'description':{'type':Sequelize[_0x5a3b('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x5a3b('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5a3b('0x2')]},'remoteUri':{'type':Sequelize[_0x5a3b('0x2')],'unique':_0x5a3b('0x4')},'serverUrl':{'type':Sequelize[_0x5a3b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x96ef=['remoteUri','sequelize','exports','STRING','username'];(function(_0x56c4de,_0xf1c874){var _0xd799af=function(_0x30fb9){while(--_0x30fb9){_0x56c4de['push'](_0x56c4de['shift']());}};_0xd799af(++_0xf1c874);}(_0x96ef,0x1af));var _0xf96e=function(_0x283207,_0x49af8f){_0x283207=_0x283207-0x0;var _0x489530=_0x96ef[_0x283207];return _0x489530;};'use strict';var Sequelize=require(_0xf96e('0x0'));module[_0xf96e('0x1')]={'name':{'type':Sequelize[_0xf96e('0x2')]},'description':{'type':Sequelize[_0xf96e('0x2')]},'username':{'type':Sequelize[_0xf96e('0x2')],'unique':_0xf96e('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf96e('0x2')]},'remoteUri':{'type':Sequelize[_0xf96e('0x2')],'unique':_0xf96e('0x4')},'serverUrl':{'type':Sequelize[_0xf96e('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 f566309..7662ad7 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 _0x8470=['incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','child_incidents','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','reopened_by','urgency','problem_id','company','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','sys_tags','escalation','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','True','true','False','inactive','false','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','status','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','include','find','create','body','update','params','findOne','ServicenowConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','hold_reason','knowledge','subcategory','close_code','notify'];(function(_0x4b3882,_0x4ec298){var _0x5b6632=function(_0x5b9f23){while(--_0x5b9f23){_0x4b3882['push'](_0x4b3882['shift']());}};_0x5b6632(++_0x4ec298);}(_0x8470,0x1dc));var _0x0847=function(_0x344be5,_0x10b628){_0x344be5=_0x344be5-0x0;var _0x105169=_0x8470[_0x344be5];return _0x105169;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0847('0x0'));var zipdir=require(_0x0847('0x1'));var jsonpatch=require(_0x0847('0x2'));var rp=require(_0x0847('0x3'));var moment=require(_0x0847('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0847('0x5'));var util=require(_0x0847('0x6'));var path=require(_0x0847('0x7'));var sox=require(_0x0847('0x8'));var csv=require('to-csv');var ejs=require(_0x0847('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0847('0xa'));var squel=require(_0x0847('0xb'));var crypto=require(_0x0847('0xc'));var jsforce=require(_0x0847('0xd'));var deskjs=require(_0x0847('0xe'));var toCsv=require(_0x0847('0xf'));var querystring=require('querystring');var Papa=require(_0x0847('0x10'));var Redis=require('ioredis');var authService=require(_0x0847('0x11'));var qs=require(_0x0847('0x12'));var as=require(_0x0847('0x13'));var hardwareService=require(_0x0847('0x14'));var logger=require(_0x0847('0x15'))(_0x0847('0x16'));var utils=require(_0x0847('0x17'));var config=require(_0x0847('0x18'));var licenseUtil=require(_0x0847('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0847('0x1a'));function respondWithStatusCode(_0x460274,_0x376bdd){_0x376bdd=_0x376bdd||0xcc;return function(_0x3fda76){if(_0x3fda76){return _0x460274[_0x0847('0x1b')](_0x376bdd);}return _0x460274['status'](_0x376bdd)['end']();};}function respondWithResult(_0x3ad9a2,_0x5415a6){_0x5415a6=_0x5415a6||0xc8;return function(_0xba7128){if(_0xba7128){return _0x3ad9a2['status'](_0x5415a6)['json'](_0xba7128);}};}function respondWithFilteredResult(_0x164a7a,_0x312447){return function(_0x21e657){if(_0x21e657){var _0x30967b=typeof _0x312447[_0x0847('0x1c')]==='undefined'&&typeof _0x312447['limit']===_0x0847('0x1d');var _0x4969d2=_0x21e657[_0x0847('0x1e')];var _0x3885af=_0x30967b?0x0:_0x312447['offset'];var _0x129d05=_0x30967b?_0x21e657[_0x0847('0x1e')]:_0x312447[_0x0847('0x1c')]+_0x312447[_0x0847('0x1f')];var _0x3b66e8;if(_0x129d05>=_0x4969d2){_0x129d05=_0x4969d2;_0x3b66e8=0xc8;}else{_0x3b66e8=0xce;}_0x164a7a['status'](_0x3b66e8);return _0x164a7a[_0x0847('0x20')](_0x0847('0x21'),_0x3885af+'-'+_0x129d05+'/'+_0x4969d2)[_0x0847('0x22')](_0x21e657);}return null;};}function patchUpdates(_0x2381b7){return function(_0x5a6723){try{jsonpatch[_0x0847('0x23')](_0x5a6723,_0x2381b7,!![]);}catch(_0x44515b){return BPromise[_0x0847('0x24')](_0x44515b);}return _0x5a6723[_0x0847('0x25')]();};}function saveUpdates(_0x220011,_0x54bf30){return function(_0x2cdd8d){if(_0x2cdd8d){return _0x2cdd8d['update'](_0x220011)[_0x0847('0x26')](function(_0x4b0f07){return _0x4b0f07;});}return null;};}function removeEntity(_0x252691,_0xb19bbd){return function(_0x4c6ca8){if(_0x4c6ca8){return _0x4c6ca8[_0x0847('0x27')]()[_0x0847('0x26')](function(){_0x252691[_0x0847('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3632ec,_0x464f90){return function(_0x5ac2f0){if(!_0x5ac2f0){_0x3632ec['sendStatus'](0x194);}return _0x5ac2f0;};}function handleError(_0x406161,_0x34d053){_0x34d053=_0x34d053||0x1f4;return function(_0x486b84){logger['error'](_0x486b84['stack']);if(_0x486b84[_0x0847('0x29')]){delete _0x486b84['name'];}_0x406161['status'](_0x34d053)[_0x0847('0x2a')](_0x486b84);};}exports[_0x0847('0x2b')]=function(_0x2e4741,_0x338cf0){var _0x37cc11={},_0x3fe8a7={},_0x422bd0={'count':0x0,'rows':[]};var _0x247fe2=_['map'](db[_0x0847('0x2c')][_0x0847('0x2d')],function(_0x4a01c5){return{'name':_0x4a01c5[_0x0847('0x2e')],'type':_0x4a01c5[_0x0847('0x2f')]['key']};});_0x3fe8a7['model']=_[_0x0847('0x30')](_0x247fe2,_0x0847('0x29'));_0x3fe8a7[_0x0847('0x31')]=_[_0x0847('0x32')](_0x2e4741['query']);_0x3fe8a7[_0x0847('0x33')]=_['intersection'](_0x3fe8a7[_0x0847('0x34')],_0x3fe8a7[_0x0847('0x31')]);_0x37cc11[_0x0847('0x35')]=_[_0x0847('0x36')](_0x3fe8a7['model'],qs[_0x0847('0x37')](_0x2e4741[_0x0847('0x31')][_0x0847('0x37')]));_0x37cc11[_0x0847('0x35')]=_0x37cc11[_0x0847('0x35')][_0x0847('0x38')]?_0x37cc11['attributes']:_0x3fe8a7[_0x0847('0x34')];if(!_0x2e4741['query'][_0x0847('0x39')](_0x0847('0x3a'))){_0x37cc11['limit']=qs[_0x0847('0x1f')](_0x2e4741['query']['limit']);_0x37cc11['offset']=qs[_0x0847('0x1c')](_0x2e4741[_0x0847('0x31')][_0x0847('0x1c')]);}_0x37cc11['order']=qs[_0x0847('0x3b')](_0x2e4741[_0x0847('0x31')][_0x0847('0x3b')]);_0x37cc11[_0x0847('0x3c')]=qs[_0x0847('0x33')](_[_0x0847('0x3d')](_0x2e4741[_0x0847('0x31')],_0x3fe8a7[_0x0847('0x33')]),_0x247fe2);if(_0x2e4741[_0x0847('0x31')][_0x0847('0x3e')]){_0x37cc11[_0x0847('0x3c')]=_[_0x0847('0x3f')](_0x37cc11['where'],{'$or':_[_0x0847('0x30')](_0x247fe2,function(_0x3eba1e){if(_0x3eba1e[_0x0847('0x2f')]!==_0x0847('0x40')){var _0x466b45={};_0x466b45[_0x3eba1e[_0x0847('0x29')]]={'$like':'%'+_0x2e4741[_0x0847('0x31')]['filter']+'%'};return _0x466b45;}})});}_0x37cc11=_[_0x0847('0x3f')]({},_0x37cc11,_0x2e4741[_0x0847('0x41')]);var _0x2160f7={'where':_0x37cc11[_0x0847('0x3c')]};return db[_0x0847('0x2c')][_0x0847('0x1e')](_0x2160f7)['then'](function(_0x182c44){_0x422bd0['count']=_0x182c44;if(_0x2e4741[_0x0847('0x31')][_0x0847('0x42')]){_0x37cc11['include']=[{'all':!![]}];}return db[_0x0847('0x2c')][_0x0847('0x43')](_0x37cc11);})['then'](function(_0x1e60bc){_0x422bd0['rows']=_0x1e60bc;return _0x422bd0;})[_0x0847('0x26')](respondWithFilteredResult(_0x338cf0,_0x37cc11))[_0x0847('0x44')](handleError(_0x338cf0,null));};exports['show']=function(_0x2b699b,_0x14086c){var _0x2e4bca={'raw':![],'where':{'id':_0x2b699b['params']['id']}},_0x2e220e={};_0x2e220e['model']=_[_0x0847('0x32')](db[_0x0847('0x2c')][_0x0847('0x2d')]);_0x2e220e[_0x0847('0x31')]=_[_0x0847('0x32')](_0x2b699b['query']);_0x2e220e[_0x0847('0x33')]=_['intersection'](_0x2e220e[_0x0847('0x34')],_0x2e220e[_0x0847('0x31')]);_0x2e4bca['attributes']=_[_0x0847('0x36')](_0x2e220e[_0x0847('0x34')],qs[_0x0847('0x37')](_0x2b699b['query'][_0x0847('0x37')]));_0x2e4bca[_0x0847('0x35')]=_0x2e4bca[_0x0847('0x35')][_0x0847('0x38')]?_0x2e4bca['attributes']:_0x2e220e[_0x0847('0x34')];if(_0x2b699b[_0x0847('0x31')][_0x0847('0x42')]){_0x2e4bca[_0x0847('0x45')]=[{'all':!![]}];}_0x2e4bca=_['merge']({},_0x2e4bca,_0x2b699b[_0x0847('0x41')]);return db[_0x0847('0x2c')][_0x0847('0x46')](_0x2e4bca)[_0x0847('0x26')](handleEntityNotFound(_0x14086c,null))[_0x0847('0x26')](respondWithResult(_0x14086c,null))[_0x0847('0x44')](handleError(_0x14086c,null));};exports[_0x0847('0x47')]=function(_0x4f9ef5,_0x40fb07){return db[_0x0847('0x2c')][_0x0847('0x47')](_0x4f9ef5[_0x0847('0x48')],{})[_0x0847('0x26')](respondWithResult(_0x40fb07,0xc9))[_0x0847('0x44')](handleError(_0x40fb07,null));};exports[_0x0847('0x49')]=function(_0x409aa5,_0x176126){if(_0x409aa5[_0x0847('0x48')]['id']){delete _0x409aa5[_0x0847('0x48')]['id'];}return db[_0x0847('0x2c')][_0x0847('0x46')]({'where':{'id':_0x409aa5['params']['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x176126,null))['then'](saveUpdates(_0x409aa5[_0x0847('0x48')],null))[_0x0847('0x26')](respondWithResult(_0x176126,null))[_0x0847('0x44')](handleError(_0x176126,null));};exports[_0x0847('0x27')]=function(_0x34124d,_0xd2c94){return db[_0x0847('0x2c')][_0x0847('0x46')]({'where':{'id':_0x34124d[_0x0847('0x4a')]['id']}})[_0x0847('0x26')](handleEntityNotFound(_0xd2c94,null))['then'](removeEntity(_0xd2c94,null))['catch'](handleError(_0xd2c94,null));};exports['getConfigurations']=function(_0x4437e4,_0x4fce33,_0x4b8651){var _0x417da5={};var _0x29c4af={};var _0x2ddb68;var _0x5f0d8c;return db['ServicenowAccount'][_0x0847('0x4b')]({'where':{'id':_0x4437e4['params']['id']}})[_0x0847('0x26')](handleEntityNotFound(_0x4fce33,null))[_0x0847('0x26')](function(_0x1c9443){if(_0x1c9443){_0x2ddb68=_0x1c9443;_0x29c4af[_0x0847('0x34')]=_[_0x0847('0x32')](db[_0x0847('0x4c')]['rawAttributes']);_0x29c4af['query']=_['keys'](_0x4437e4[_0x0847('0x31')]);_0x29c4af['filters']=_['intersection'](_0x29c4af[_0x0847('0x34')],_0x29c4af[_0x0847('0x31')]);_0x417da5[_0x0847('0x35')]=_[_0x0847('0x36')](_0x29c4af[_0x0847('0x34')],qs[_0x0847('0x37')](_0x4437e4[_0x0847('0x31')][_0x0847('0x37')]));_0x417da5[_0x0847('0x35')]=_0x417da5[_0x0847('0x35')][_0x0847('0x38')]?_0x417da5[_0x0847('0x35')]:_0x29c4af[_0x0847('0x34')];_0x417da5[_0x0847('0x4d')]=qs[_0x0847('0x3b')](_0x4437e4['query'][_0x0847('0x3b')]);_0x417da5['where']=qs['filters'](_['pick'](_0x4437e4[_0x0847('0x31')],_0x29c4af[_0x0847('0x33')]));if(_0x4437e4[_0x0847('0x31')][_0x0847('0x3e')]){_0x417da5['where']=_[_0x0847('0x3f')](_0x417da5['where'],{'$or':_[_0x0847('0x30')](_0x417da5[_0x0847('0x35')],function(_0x52ffef){var _0x2de0ca={};_0x2de0ca[_0x52ffef]={'$like':'%'+_0x4437e4['query'][_0x0847('0x3e')]+'%'};return _0x2de0ca;})});}_0x417da5=_['merge']({},_0x417da5,_0x4437e4[_0x0847('0x41')]);return _0x2ddb68[_0x0847('0x4e')](_0x417da5);}})['then'](function(_0x34a0e9){if(_0x34a0e9){_0x5f0d8c=_0x34a0e9['length'];if(!_0x4437e4['query'][_0x0847('0x39')]('nolimit')){_0x417da5['limit']=qs['limit'](_0x4437e4[_0x0847('0x31')][_0x0847('0x1f')]);_0x417da5[_0x0847('0x1c')]=qs[_0x0847('0x1c')](_0x4437e4[_0x0847('0x31')][_0x0847('0x1c')]);}return _0x2ddb68['getConfigurations'](_0x417da5);}})[_0x0847('0x26')](function(_0x4953c8){if(_0x4953c8){return _0x4953c8?{'count':_0x5f0d8c,'rows':_0x4953c8}:null;}})['then'](respondWithResult(_0x4fce33,null))[_0x0847('0x44')](handleError(_0x4fce33,null));};exports[_0x0847('0x4f')]=function(_0x378565,_0x841bf0,_0x778ac1){if(_0x378565[_0x0847('0x48')]['id']){delete _0x378565[_0x0847('0x48')]['id'];}return db[_0x0847('0x2c')][_0x0847('0x4b')]({'where':{'id':_0x378565[_0x0847('0x4a')]['id']}})['then'](handleEntityNotFound(_0x841bf0,null))[_0x0847('0x26')](function(_0x51bc97){if(_0x51bc97){_0x378565[_0x0847('0x48')][_0x0847('0x50')]=_0x51bc97['id'];_0x378565[_0x0847('0x48')][_0x0847('0x51')]=integrations[_0x0847('0x52')](_0x378565[_0x0847('0x48')][_0x0847('0x53')],_0x378565[_0x0847('0x48')][_0x0847('0x2f')]);_0x378565[_0x0847('0x48')][_0x0847('0x54')]=integrations['getDescriptions'](_0x378565['body'][_0x0847('0x53')],_0x378565[_0x0847('0x48')][_0x0847('0x2f')]);return db[_0x0847('0x4c')][_0x0847('0x47')](_0x378565[_0x0847('0x48')],{'include':[{'model':db[_0x0847('0x55')],'as':_0x0847('0x51')},{'model':db['ServicenowField'],'as':_0x0847('0x54')}]});}return null;})[_0x0847('0x26')](respondWithResult(_0x841bf0,null))[_0x0847('0x44')](handleError(_0x841bf0,null));};exports['getFields']=function(_0x3fba66,_0x29b036,_0xcf49a9){var _0x5e406a=['made_sla',_0x0847('0x56'),_0x0847('0x57'),_0x0847('0x58'),_0x0847('0x59'),_0x0847('0x5a'),_0x0847('0x5b'),_0x0847('0x5c'),_0x0847('0x5d')];var _0x139814=[_0x0847('0x5e'),_0x0847('0x5f'),_0x0847('0x60'),_0x0847('0x61'),_0x0847('0x62'),'sys_updated_on',_0x0847('0x63'),_0x0847('0x56'),'approval_history','number',_0x0847('0x64'),_0x0847('0x65'),_0x0847('0x66'),_0x0847('0x67'),_0x0847('0x68'),_0x0847('0x69'),_0x0847('0x6a'),_0x0847('0x6b'),'knowledge','order',_0x0847('0x6c'),'closed_at',_0x0847('0x6d'),_0x0847('0x6e'),_0x0847('0x6f'),_0x0847('0x70'),_0x0847('0x71'),_0x0847('0x72'),_0x0847('0x73'),_0x0847('0x74'),'rfc',_0x0847('0x75'),_0x0847('0x76'),_0x0847('0x77'),_0x0847('0x78'),'group_list',_0x0847('0x79'),_0x0847('0x7a'),_0x0847('0x7b'),_0x0847('0x7c'),_0x0847('0x7d'),_0x0847('0x58'),_0x0847('0x7e'),_0x0847('0x7f'),'close_code',_0x0847('0x80'),'delivery_task',_0x0847('0x81'),_0x0847('0x82'),_0x0847('0x83'),_0x0847('0x84'),_0x0847('0x85'),_0x0847('0x86'),_0x0847('0x5a'),_0x0847('0x87'),_0x0847('0x88'),_0x0847('0x89'),'follow_up',_0x0847('0x8a'),'sys_id','contact_type',_0x0847('0x8b'),'incident_state',_0x0847('0x8c'),_0x0847('0x8d'),_0x0847('0x8e'),'reassignment_count','activity_due',_0x0847('0x8f'),_0x0847('0x5c'),_0x0847('0x90'),_0x0847('0x91'),_0x0847('0x92'),_0x0847('0x93'),'due_date',_0x0847('0x94'),'reopen_count',_0x0847('0x95'),_0x0847('0x96'),'upon_approval',_0x0847('0x97'),_0x0847('0x98'),_0x0847('0x5d')];var _0x38d16c='';var _0x205eb7='';var _0x517947=[];var _0x4df4e1='';var _0x1c6173='';var _0x19909d=[];var _0x1298aa='';var _0x2a6eeb='';var _0x239b74={};var _0x2dd3e7='';return db[_0x0847('0x2c')][_0x0847('0x4b')]({'where':{'id':_0x3fba66[_0x0847('0x4a')]['id']},'attributes':['id',_0x0847('0x99'),_0x0847('0x9a'),_0x0847('0x9b'),_0x0847('0x9c'),_0x0847('0x9d')]})['then'](handleEntityNotFound(_0x29b036,null))[_0x0847('0x26')](function(_0x5ca545){if(_0x5ca545){_0x2dd3e7=_0x5ca545[_0x0847('0x9c')];var _0x360397=_0x2dd3e7[_0x0847('0x9e')](-0x1);if(_0x360397==='/'){_0x2dd3e7=_0x2dd3e7[_0x0847('0x9f')](0x0,_0x2dd3e7[_0x0847('0xa0')](_0x360397));}_0x2a6eeb=util[_0x0847('0xa1')](_0x0847('0xa2'),_0x2dd3e7);_0x1298aa=util[_0x0847('0xa1')]('%s/api/now/table/',_0x2dd3e7);_0x239b74={'user':_0x5ca545['username'],'pass':_0x5ca545[_0x0847('0x9a')]};var _0x166824={'method':_0x0847('0xa3'),'uri':_0x2a6eeb+'incident?sysparm_display_value=all','auth':_0x239b74,'json':!![]};return rp(_0x166824);}})[_0x0847('0x26')](function(_0x5c1f68){if(_0x5c1f68['result'][_0x0847('0x38')]>0x0){_0x38d16c=_0x5c1f68[_0x0847('0xa4')];}console[_0x0847('0xa5')](_0x0847('0xa6'),_0x38d16c);_0x19909d=[];_0x205eb7=Object[_0x0847('0xa7')]([],_0x38d16c);_[_0x0847('0xa8')](_0x205eb7,function(_0xf0068e){return!_0x5e406a[_0x0847('0xa9')](_0xf0068e['name']);});_0x205eb7[_0x0847('0xaa')](function(_0x3fb59c){var _0x4dfdeb=createFieldObject(_0x1298aa,_0x239b74,_0x3fb59c[_0x0847('0xab')],_0x3fb59c['name'],_0x3fb59c[_0x0847('0xac')],![]);_0x19909d[_0x0847('0xad')](_0x4dfdeb);});return Promise[_0x0847('0xae')](_0x19909d);})[_0x0847('0x26')](function(_0x4c7136){_0x517947=_0x4c7136;_0x4df4e1=Object[_0x0847('0xa7')]([],_0x38d16c);console['log'](_0x0847('0xaf'),_0x38d16c);_['remove'](_0x4df4e1,function(_0x4921f5){return _0x139814['includes'](_0x4921f5[_0x0847('0x29')]);});console[_0x0847('0xa5')](_0x0847('0xb0'),_0x4df4e1);_0x19909d=[];_0x4df4e1['forEach'](function(_0x4e3c1f){var _0x5a9c8a=createFieldObject(_0x1298aa,_0x239b74,_0x4e3c1f['internalType'],_0x4e3c1f[_0x0847('0x29')],_0x4e3c1f[_0x0847('0xac')],!![]);_0x19909d[_0x0847('0xad')](_0x5a9c8a);});return Promise[_0x0847('0xae')](_0x19909d);})[_0x0847('0x26')](function(_0xb94376){_0x1c6173=_0xb94376;var _0x3610f6=_0x517947[_0x0847('0xb1')](_0x1c6173);return{'count':_0x3610f6[_0x0847('0x38')],'rows':_0x3610f6};})[_0x0847('0x26')](respondWithResult(_0x29b036,null))[_0x0847('0x44')](function(_0x5aa175){console[_0x0847('0xa5')](_0x0847('0xb2')+_0x5aa175);var _0x5134cf=_0x3fba66[_0x0847('0x31')][_0x0847('0xb3')]?0x1f4:_0x5aa175[_0x0847('0xb4')]||0x1f4;logger['error'](_0x5aa175[_0x0847('0xb5')]);delete _0x5aa175['name'];if(_0x5134cf===0x191){_0x5134cf=0x190;}_0x29b036[_0x0847('0x28')](_0x5134cf)[_0x0847('0x2a')](_0x3fba66[_0x0847('0x31')][_0x0847('0xb3')]?{'message':_0x0847('0xb6'),'statusCode':_0x5aa175[_0x0847('0xb4')]}:_0x5aa175);});};function createFieldObject(_0xfbe461,_0x212360,_0x139ae7,_0x64fd68,_0x218bf5,_0x1e776d){return new Promise(function(_0xf21e09,_0x33e3ae){var _0x346b84={'id':_0x64fd68,'name':_0x218bf5,'custom':_0x1e776d};if(_0x139ae7==='boolean'){_0x346b84['options']=[{'name':_0x0847('0xb7'),'value':_0x0847('0xb8')},{'name':_0x0847('0xb9'),'value':'false'}];_0xf21e09(_0x346b84);}else{var _0xcea965={'method':_0x0847('0xa3'),'uri':_0xfbe461+'sys_choice?sysparm_query=name=incident^element='+_0x64fd68,'auth':_0x212360,'json':!![]};return rp(_0xcea965)[_0x0847('0x26')](function(_0x3635a0){var _0x1977ec=[];if(_0x3635a0['result'][_0x0847('0x38')]>0x0){_0x3635a0[_0x0847('0xa4')][_0x0847('0xaa')](function(_0x481948){if(_0x481948[_0x0847('0xba')]===_0x0847('0xbb')){var _0x2f1646={'name':_0x481948['label'],'value':_0x481948[_0x0847('0xbc')]};_0x1977ec[_0x0847('0xad')](_0x2f1646);}});}_0x346b84[_0x0847('0x41')]=_0x1977ec;if(_0x346b84['options']['length']>0x0){_0xf21e09(_0x346b84);}else{if(_0x1e776d==![]){_0xf21e09();}else{_0xf21e09(_0x346b84);}}});}});} \ No newline at end of file +var _0x246e=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','catch','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','activity_due','assigned_to','approval','comments_and_work_notes','reopen_count','sys_tags','upon_approval','correlation_id','location','category','password','email','serverUrl','remoteUri','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','username','GET','result','log','assign','remove','forEach','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','label','concat','ServiceNow\x20error:\x20','test','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x246e,0x162));var _0xe246=function(_0x142304,_0x4119af){_0x142304=_0x142304-0x0;var _0x29af3c=_0x246e[_0x142304];return _0x29af3c;};'use strict';var emlformat=require(_0xe246('0x0'));var rimraf=require(_0xe246('0x1'));var zipdir=require(_0xe246('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe246('0x3'));var BPromise=require(_0xe246('0x4'));var Mustache=require(_0xe246('0x5'));var util=require(_0xe246('0x6'));var path=require(_0xe246('0x7'));var sox=require(_0xe246('0x8'));var csv=require(_0xe246('0x9'));var ejs=require(_0xe246('0xa'));var fs=require('fs');var fs_extra=require(_0xe246('0xb'));var _=require(_0xe246('0xc'));var squel=require(_0xe246('0xd'));var crypto=require(_0xe246('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe246('0xf'));var toCsv=require(_0xe246('0x9'));var querystring=require(_0xe246('0x10'));var Papa=require(_0xe246('0x11'));var Redis=require(_0xe246('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe246('0x13'));var hardwareService=require(_0xe246('0x14'));var logger=require('../../config/logger')(_0xe246('0x15'));var utils=require(_0xe246('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe246('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe246('0x18'));function respondWithStatusCode(_0x28aacd,_0x11ce2b){_0x11ce2b=_0x11ce2b||0xcc;return function(_0x2171a0){if(_0x2171a0){return _0x28aacd[_0xe246('0x19')](_0x11ce2b);}return _0x28aacd[_0xe246('0x1a')](_0x11ce2b)[_0xe246('0x1b')]();};}function respondWithResult(_0x16c352,_0x4e40b8){_0x4e40b8=_0x4e40b8||0xc8;return function(_0x3ebed3){if(_0x3ebed3){return _0x16c352['status'](_0x4e40b8)[_0xe246('0x1c')](_0x3ebed3);}};}function respondWithFilteredResult(_0x315ef3,_0x33053f){return function(_0x5b7ca1){if(_0x5b7ca1){var _0x15ea9b=typeof _0x33053f[_0xe246('0x1d')]===_0xe246('0x1e')&&typeof _0x33053f[_0xe246('0x1f')]===_0xe246('0x1e');var _0x1e2ab3=_0x5b7ca1['count'];var _0x593a15=_0x15ea9b?0x0:_0x33053f[_0xe246('0x1d')];var _0x4af6bc=_0x15ea9b?_0x5b7ca1[_0xe246('0x20')]:_0x33053f[_0xe246('0x1d')]+_0x33053f[_0xe246('0x1f')];var _0x1a772d;if(_0x4af6bc>=_0x1e2ab3){_0x4af6bc=_0x1e2ab3;_0x1a772d=0xc8;}else{_0x1a772d=0xce;}_0x315ef3[_0xe246('0x1a')](_0x1a772d);return _0x315ef3[_0xe246('0x21')](_0xe246('0x22'),_0x593a15+'-'+_0x4af6bc+'/'+_0x1e2ab3)[_0xe246('0x1c')](_0x5b7ca1);}return null;};}function patchUpdates(_0x5f3620){return function(_0x2edc44){try{jsonpatch[_0xe246('0x23')](_0x2edc44,_0x5f3620,!![]);}catch(_0x391b05){return BPromise[_0xe246('0x24')](_0x391b05);}return _0x2edc44[_0xe246('0x25')]();};}function saveUpdates(_0x3addd5,_0x7bb0df){return function(_0x19e0c6){if(_0x19e0c6){return _0x19e0c6[_0xe246('0x26')](_0x3addd5)[_0xe246('0x27')](function(_0x4c7d43){return _0x4c7d43;});}return null;};}function removeEntity(_0x341073,_0x1ce1b){return function(_0x22cc29){if(_0x22cc29){return _0x22cc29[_0xe246('0x28')]()[_0xe246('0x27')](function(){_0x341073[_0xe246('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17de1e,_0x9c0283){return function(_0x20eeb7){if(!_0x20eeb7){_0x17de1e[_0xe246('0x19')](0x194);}return _0x20eeb7;};}function handleError(_0x264284,_0x5e81ed){_0x5e81ed=_0x5e81ed||0x1f4;return function(_0x5b9fdd){logger[_0xe246('0x29')](_0x5b9fdd[_0xe246('0x2a')]);if(_0x5b9fdd[_0xe246('0x2b')]){delete _0x5b9fdd[_0xe246('0x2b')];}_0x264284[_0xe246('0x1a')](_0x5e81ed)[_0xe246('0x2c')](_0x5b9fdd);};}exports[_0xe246('0x2d')]=function(_0x548987,_0xfcb77b){var _0x26f27f={},_0x17f216={},_0x439240={'count':0x0,'rows':[]};var _0x48b665=_[_0xe246('0x2e')](db[_0xe246('0x2f')]['rawAttributes'],function(_0x7476f5){return{'name':_0x7476f5[_0xe246('0x30')],'type':_0x7476f5[_0xe246('0x31')][_0xe246('0x32')]};});_0x17f216[_0xe246('0x33')]=_[_0xe246('0x2e')](_0x48b665,_0xe246('0x2b'));_0x17f216[_0xe246('0x34')]=_[_0xe246('0x35')](_0x548987[_0xe246('0x34')]);_0x17f216[_0xe246('0x36')]=_[_0xe246('0x37')](_0x17f216[_0xe246('0x33')],_0x17f216[_0xe246('0x34')]);_0x26f27f[_0xe246('0x38')]=_[_0xe246('0x37')](_0x17f216[_0xe246('0x33')],qs[_0xe246('0x39')](_0x548987['query'][_0xe246('0x39')]));_0x26f27f[_0xe246('0x38')]=_0x26f27f[_0xe246('0x38')][_0xe246('0x3a')]?_0x26f27f[_0xe246('0x38')]:_0x17f216[_0xe246('0x33')];if(!_0x548987['query'][_0xe246('0x3b')](_0xe246('0x3c'))){_0x26f27f[_0xe246('0x1f')]=qs[_0xe246('0x1f')](_0x548987[_0xe246('0x34')][_0xe246('0x1f')]);_0x26f27f['offset']=qs[_0xe246('0x1d')](_0x548987[_0xe246('0x34')][_0xe246('0x1d')]);}_0x26f27f[_0xe246('0x3d')]=qs[_0xe246('0x3e')](_0x548987['query'][_0xe246('0x3e')]);_0x26f27f[_0xe246('0x3f')]=qs[_0xe246('0x36')](_['pick'](_0x548987[_0xe246('0x34')],_0x17f216[_0xe246('0x36')]),_0x48b665);if(_0x548987[_0xe246('0x34')][_0xe246('0x40')]){_0x26f27f[_0xe246('0x3f')]=_['merge'](_0x26f27f[_0xe246('0x3f')],{'$or':_[_0xe246('0x2e')](_0x48b665,function(_0x4a4ee6){if(_0x4a4ee6[_0xe246('0x31')]!==_0xe246('0x41')){var _0x19ce6f={};_0x19ce6f[_0x4a4ee6[_0xe246('0x2b')]]={'$like':'%'+_0x548987[_0xe246('0x34')][_0xe246('0x40')]+'%'};return _0x19ce6f;}})});}_0x26f27f=_[_0xe246('0x42')]({},_0x26f27f,_0x548987[_0xe246('0x43')]);var _0x4444ec={'where':_0x26f27f[_0xe246('0x3f')]};return db[_0xe246('0x2f')][_0xe246('0x20')](_0x4444ec)[_0xe246('0x27')](function(_0x1e3239){_0x439240['count']=_0x1e3239;if(_0x548987[_0xe246('0x34')][_0xe246('0x44')]){_0x26f27f[_0xe246('0x45')]=[{'all':!![]}];}return db[_0xe246('0x2f')]['findAll'](_0x26f27f);})[_0xe246('0x27')](function(_0x2afee2){_0x439240[_0xe246('0x46')]=_0x2afee2;return _0x439240;})['then'](respondWithFilteredResult(_0xfcb77b,_0x26f27f))['catch'](handleError(_0xfcb77b,null));};exports[_0xe246('0x47')]=function(_0x50a71d,_0x4fe7c6){var _0x44996b={'raw':![],'where':{'id':_0x50a71d[_0xe246('0x48')]['id']}},_0x570feb={};_0x570feb[_0xe246('0x33')]=_[_0xe246('0x35')](db[_0xe246('0x2f')][_0xe246('0x49')]);_0x570feb[_0xe246('0x34')]=_[_0xe246('0x35')](_0x50a71d[_0xe246('0x34')]);_0x570feb[_0xe246('0x36')]=_['intersection'](_0x570feb['model'],_0x570feb[_0xe246('0x34')]);_0x44996b[_0xe246('0x38')]=_[_0xe246('0x37')](_0x570feb[_0xe246('0x33')],qs[_0xe246('0x39')](_0x50a71d[_0xe246('0x34')][_0xe246('0x39')]));_0x44996b[_0xe246('0x38')]=_0x44996b[_0xe246('0x38')][_0xe246('0x3a')]?_0x44996b[_0xe246('0x38')]:_0x570feb[_0xe246('0x33')];if(_0x50a71d[_0xe246('0x34')]['includeAll']){_0x44996b[_0xe246('0x45')]=[{'all':!![]}];}_0x44996b=_[_0xe246('0x42')]({},_0x44996b,_0x50a71d[_0xe246('0x43')]);return db['ServicenowAccount'][_0xe246('0x4a')](_0x44996b)['then'](handleEntityNotFound(_0x4fe7c6,null))['then'](respondWithResult(_0x4fe7c6,null))['catch'](handleError(_0x4fe7c6,null));};exports[_0xe246('0x4b')]=function(_0x1d1341,_0x2f8b33){return db[_0xe246('0x2f')][_0xe246('0x4b')](_0x1d1341[_0xe246('0x4c')],{})['then'](respondWithResult(_0x2f8b33,0xc9))[_0xe246('0x4d')](handleError(_0x2f8b33,null));};exports['update']=function(_0x1fbee8,_0x1540f4){if(_0x1fbee8[_0xe246('0x4c')]['id']){delete _0x1fbee8[_0xe246('0x4c')]['id'];}return db['ServicenowAccount'][_0xe246('0x4a')]({'where':{'id':_0x1fbee8[_0xe246('0x48')]['id']}})[_0xe246('0x27')](handleEntityNotFound(_0x1540f4,null))[_0xe246('0x27')](saveUpdates(_0x1fbee8[_0xe246('0x4c')],null))[_0xe246('0x27')](respondWithResult(_0x1540f4,null))[_0xe246('0x4d')](handleError(_0x1540f4,null));};exports[_0xe246('0x28')]=function(_0x125cc6,_0xae20f){return db[_0xe246('0x2f')]['find']({'where':{'id':_0x125cc6['params']['id']}})['then'](handleEntityNotFound(_0xae20f,null))[_0xe246('0x27')](removeEntity(_0xae20f,null))['catch'](handleError(_0xae20f,null));};exports[_0xe246('0x4e')]=function(_0x9cbaf2,_0x1bdc13,_0x4e7743){var _0x17b679={};var _0x1f3652={};var _0x201189;var _0x596a5f;return db[_0xe246('0x2f')][_0xe246('0x4f')]({'where':{'id':_0x9cbaf2['params']['id']}})[_0xe246('0x27')](handleEntityNotFound(_0x1bdc13,null))[_0xe246('0x27')](function(_0x839bd8){if(_0x839bd8){_0x201189=_0x839bd8;_0x1f3652[_0xe246('0x33')]=_['keys'](db['ServicenowConfiguration'][_0xe246('0x49')]);_0x1f3652[_0xe246('0x34')]=_[_0xe246('0x35')](_0x9cbaf2[_0xe246('0x34')]);_0x1f3652[_0xe246('0x36')]=_[_0xe246('0x37')](_0x1f3652[_0xe246('0x33')],_0x1f3652['query']);_0x17b679[_0xe246('0x38')]=_['intersection'](_0x1f3652[_0xe246('0x33')],qs[_0xe246('0x39')](_0x9cbaf2[_0xe246('0x34')][_0xe246('0x39')]));_0x17b679[_0xe246('0x38')]=_0x17b679[_0xe246('0x38')][_0xe246('0x3a')]?_0x17b679[_0xe246('0x38')]:_0x1f3652[_0xe246('0x33')];_0x17b679['order']=qs[_0xe246('0x3e')](_0x9cbaf2[_0xe246('0x34')][_0xe246('0x3e')]);_0x17b679[_0xe246('0x3f')]=qs['filters'](_[_0xe246('0x50')](_0x9cbaf2[_0xe246('0x34')],_0x1f3652[_0xe246('0x36')]));if(_0x9cbaf2[_0xe246('0x34')][_0xe246('0x40')]){_0x17b679[_0xe246('0x3f')]=_[_0xe246('0x42')](_0x17b679[_0xe246('0x3f')],{'$or':_[_0xe246('0x2e')](_0x17b679[_0xe246('0x38')],function(_0x48f15d){var _0x4a4de2={};_0x4a4de2[_0x48f15d]={'$like':'%'+_0x9cbaf2[_0xe246('0x34')]['filter']+'%'};return _0x4a4de2;})});}_0x17b679=_[_0xe246('0x42')]({},_0x17b679,_0x9cbaf2[_0xe246('0x43')]);return _0x201189[_0xe246('0x4e')](_0x17b679);}})[_0xe246('0x27')](function(_0x245789){if(_0x245789){_0x596a5f=_0x245789[_0xe246('0x3a')];if(!_0x9cbaf2[_0xe246('0x34')]['hasOwnProperty']('nolimit')){_0x17b679[_0xe246('0x1f')]=qs[_0xe246('0x1f')](_0x9cbaf2['query'][_0xe246('0x1f')]);_0x17b679[_0xe246('0x1d')]=qs['offset'](_0x9cbaf2['query']['offset']);}return _0x201189[_0xe246('0x4e')](_0x17b679);}})[_0xe246('0x27')](function(_0x4e7929){if(_0x4e7929){return _0x4e7929?{'count':_0x596a5f,'rows':_0x4e7929}:null;}})[_0xe246('0x27')](respondWithResult(_0x1bdc13,null))[_0xe246('0x4d')](handleError(_0x1bdc13,null));};exports[_0xe246('0x51')]=function(_0x5c92c0,_0xa371a1,_0x30db78){if(_0x5c92c0[_0xe246('0x4c')]['id']){delete _0x5c92c0[_0xe246('0x4c')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x5c92c0['params']['id']}})[_0xe246('0x27')](handleEntityNotFound(_0xa371a1,null))[_0xe246('0x27')](function(_0x35c399){if(_0x35c399){_0x5c92c0['body'][_0xe246('0x52')]=_0x35c399['id'];_0x5c92c0[_0xe246('0x4c')][_0xe246('0x53')]=integrations[_0xe246('0x54')](_0x5c92c0['body'][_0xe246('0x55')],_0x5c92c0['body'][_0xe246('0x31')]);_0x5c92c0['body'][_0xe246('0x56')]=integrations[_0xe246('0x57')](_0x5c92c0[_0xe246('0x4c')][_0xe246('0x55')],_0x5c92c0['body'][_0xe246('0x31')]);return db[_0xe246('0x58')][_0xe246('0x4b')](_0x5c92c0[_0xe246('0x4c')],{'include':[{'model':db[_0xe246('0x59')],'as':_0xe246('0x53')},{'model':db[_0xe246('0x59')],'as':_0xe246('0x56')}]});}return null;})[_0xe246('0x27')](respondWithResult(_0xa371a1,null))[_0xe246('0x4d')](handleError(_0xa371a1,null));};exports[_0xe246('0x5a')]=function(_0x5c6781,_0x3de6ac,_0x2573b6){var _0xd0df63=[_0xe246('0x5b'),_0xe246('0x5c'),_0xe246('0x5d'),_0xe246('0x5e'),_0xe246('0x5f'),_0xe246('0x60'),_0xe246('0x61'),_0xe246('0x62'),'category'];var _0xc13d08=[_0xe246('0x63'),_0xe246('0x5b'),_0xe246('0x64'),_0xe246('0x65'),'upon_reject',_0xe246('0x66'),_0xe246('0x67'),'hold_reason',_0xe246('0x68'),'number',_0xe246('0x69'),_0xe246('0x6a'),_0xe246('0x6b'),_0xe246('0x6c'),_0xe246('0x6d'),'sys_domain',_0xe246('0x6e'),_0xe246('0x6f'),_0xe246('0x5d'),_0xe246('0x3d'),'calendar_stc',_0xe246('0x70'),_0xe246('0x71'),_0xe246('0x72'),_0xe246('0x73'),_0xe246('0x74'),_0xe246('0x75'),'business_service',_0xe246('0x76'),_0xe246('0x77'),'rfc',_0xe246('0x78'),_0xe246('0x79'),'opened_at',_0xe246('0x7a'),_0xe246('0x7b'),_0xe246('0x7c'),_0xe246('0x7d'),_0xe246('0x7e'),_0xe246('0x7f'),_0xe246('0x80'),'subcategory',_0xe246('0x81'),_0xe246('0x82'),_0xe246('0x5f'),_0xe246('0x83'),_0xe246('0x84'),_0xe246('0x85'),'assignment_group',_0xe246('0x86'),_0xe246('0x87'),_0xe246('0x88'),'calendar_duration',_0xe246('0x60'),'sys_class_name',_0xe246('0x89'),_0xe246('0x8a'),_0xe246('0x8b'),_0xe246('0x8c'),_0xe246('0x8d'),_0xe246('0x8e'),_0xe246('0x8f'),_0xe246('0x61'),'urgency',_0xe246('0x90'),_0xe246('0x91'),'reassignment_count',_0xe246('0x92'),_0xe246('0x93'),_0xe246('0x62'),'comments','sla_due',_0xe246('0x94'),_0xe246('0x95'),'due_date','sys_mod_count',_0xe246('0x96'),_0xe246('0x97'),'escalation',_0xe246('0x98'),_0xe246('0x99'),_0xe246('0x9a'),_0xe246('0x9b')];var _0x50c1a3='';var _0xc37362='';var _0x5d64b0=[];var _0x4c97f2='';var _0x13bd74='';var _0x17e69e=[];var _0x2ca3ee='';var _0x1e723e='';var _0x52678d={};var _0x328fcf='';return db[_0xe246('0x2f')][_0xe246('0x4f')]({'where':{'id':_0x5c6781[_0xe246('0x48')]['id']},'attributes':['id','username',_0xe246('0x9c'),_0xe246('0x9d'),'remoteUri',_0xe246('0x9e')]})[_0xe246('0x27')](handleEntityNotFound(_0x3de6ac,null))[_0xe246('0x27')](function(_0x528154){if(_0x528154){_0x328fcf=_0x528154[_0xe246('0x9f')];var _0x4ff999=_0x328fcf[_0xe246('0xa0')](-0x1);if(_0x4ff999==='/'){_0x328fcf=_0x328fcf['substring'](0x0,_0x328fcf[_0xe246('0xa1')](_0x4ff999));}_0x1e723e=util['format'](_0xe246('0xa2'),_0x328fcf);_0x2ca3ee=util[_0xe246('0xa3')]('%s/api/now/table/',_0x328fcf);_0x52678d={'user':_0x528154[_0xe246('0xa4')],'pass':_0x528154[_0xe246('0x9c')]};var _0x390629={'method':_0xe246('0xa5'),'uri':_0x1e723e+'incident?sysparm_display_value=all','auth':_0x52678d,'json':!![]};return rp(_0x390629);}})['then'](function(_0xfbcd85){if(_0xfbcd85['result'][_0xe246('0x3a')]>0x0){_0x50c1a3=_0xfbcd85[_0xe246('0xa6')];}console[_0xe246('0xa7')]('incident\x20table\x20objects',_0x50c1a3);_0x17e69e=[];_0xc37362=Object[_0xe246('0xa8')]([],_0x50c1a3);_[_0xe246('0xa9')](_0xc37362,function(_0x12581b){return!_0xd0df63['includes'](_0x12581b['name']);});_0xc37362[_0xe246('0xaa')](function(_0x1cb9ae){var _0x4456b1=createFieldObject(_0x2ca3ee,_0x52678d,_0x1cb9ae['internalType'],_0x1cb9ae['name'],_0x1cb9ae['label'],![]);_0x17e69e[_0xe246('0xab')](_0x4456b1);});return Promise[_0xe246('0xac')](_0x17e69e);})[_0xe246('0x27')](function(_0x29737b){_0x5d64b0=_0x29737b;_0x4c97f2=Object[_0xe246('0xa8')]([],_0x50c1a3);console[_0xe246('0xa7')](_0xe246('0xad'),_0x50c1a3);_[_0xe246('0xa9')](_0x4c97f2,function(_0x3952be){return _0xc13d08['includes'](_0x3952be[_0xe246('0x2b')]);});console[_0xe246('0xa7')](_0xe246('0xae'),_0x4c97f2);_0x17e69e=[];_0x4c97f2[_0xe246('0xaa')](function(_0x1e4b80){var _0x485381=createFieldObject(_0x2ca3ee,_0x52678d,_0x1e4b80[_0xe246('0xaf')],_0x1e4b80['name'],_0x1e4b80[_0xe246('0xb0')],!![]);_0x17e69e['push'](_0x485381);});return Promise[_0xe246('0xac')](_0x17e69e);})[_0xe246('0x27')](function(_0x18909f){_0x13bd74=_0x18909f;var _0x19a5e4=_0x5d64b0[_0xe246('0xb1')](_0x13bd74);return{'count':_0x19a5e4[_0xe246('0x3a')],'rows':_0x19a5e4};})['then'](respondWithResult(_0x3de6ac,null))[_0xe246('0x4d')](function(_0x1fdc5a){console[_0xe246('0xa7')](_0xe246('0xb2')+_0x1fdc5a);var _0x45385d=_0x5c6781[_0xe246('0x34')][_0xe246('0xb3')]?0x1f4:_0x1fdc5a['statusCode']||0x1f4;logger[_0xe246('0x29')](_0x1fdc5a[_0xe246('0x2a')]);delete _0x1fdc5a[_0xe246('0x2b')];if(_0x45385d===0x191){_0x45385d=0x190;}_0x3de6ac[_0xe246('0x1a')](_0x45385d)[_0xe246('0x2c')](_0x5c6781[_0xe246('0x34')][_0xe246('0xb3')]?{'message':'Wrong\x20credentials','statusCode':_0x1fdc5a['statusCode']}:_0x1fdc5a);});};function createFieldObject(_0x271501,_0x28616c,_0x59d473,_0x4ffd23,_0xa5b15,_0x251ccd){return new Promise(function(_0x5697d5,_0x4ebdf5){var _0x2e57f3={'id':_0x4ffd23,'name':_0xa5b15,'custom':_0x251ccd};if(_0x59d473==='boolean'){_0x2e57f3[_0xe246('0x43')]=[{'name':_0xe246('0xb4'),'value':'true'},{'name':_0xe246('0xb5'),'value':_0xe246('0xb6')}];_0x5697d5(_0x2e57f3);}else{var _0x354451={'method':_0xe246('0xa5'),'uri':_0x271501+_0xe246('0xb7')+_0x4ffd23,'auth':_0x28616c,'json':!![]};return rp(_0x354451)[_0xe246('0x27')](function(_0x2a71cd){var _0x5787f6=[];if(_0x2a71cd[_0xe246('0xa6')][_0xe246('0x3a')]>0x0){_0x2a71cd['result'][_0xe246('0xaa')](function(_0x4fdfea){if(_0x4fdfea[_0xe246('0xb8')]===_0xe246('0xb6')){var _0x5e841b={'name':_0x4fdfea[_0xe246('0xb0')],'value':_0x4fdfea[_0xe246('0xb9')]};_0x5787f6[_0xe246('0xab')](_0x5e841b);}});}_0x2e57f3[_0xe246('0x43')]=_0x5787f6;if(_0x2e57f3['options']['length']>0x0){_0x5697d5(_0x2e57f3);}else{if(_0x251ccd==![]){_0x5697d5();}else{_0x5697d5(_0x2e57f3);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5e5b2bc..719c945 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xf494,0x1c6));var _0x4f49=function(_0x1aab47,_0x4804e3){_0x1aab47=_0x1aab47-0x0;var _0x756ce1=_0xf494[_0x1aab47];return _0x756ce1;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));var integrations=require(_0x4f49('0xa'));module[_0x4f49('0xb')]=function(_0x413530,_0x42b0e8){return _0x413530['define']('ServicenowAccount',attributes,{'tableName':_0x4f49('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0xabce,0x103));var _0xeabc=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xabce[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xeabc('0x8')]=function(_0x52a4d7,_0x229ba4){return _0x52a4d7['define'](_0xeabc('0x9'),attributes,{'tableName':_0xeabc('0xa'),'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 a939c20..e3ea050 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 _0xf8a5=['error','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','map','include','model','debug','find','ShowServicenowAccount','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b6cc1,_0x3b56e2){var _0xe59cfd=function(_0x27cfe0){while(--_0x27cfe0){_0x3b6cc1['push'](_0x3b6cc1['shift']());}};_0xe59cfd(++_0x3b56e2);}(_0xf8a5,0x6a));var _0x5f8a=function(_0x56c067,_0x1aca12){_0x56c067=_0x56c067-0x0;var _0x363198=_0xf8a5[_0x56c067];return _0x363198;};'use strict';var _=require('lodash');var util=require(_0x5f8a('0x0'));var moment=require(_0x5f8a('0x1'));var BPromise=require(_0x5f8a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f8a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5f8a('0x4'));var config=require(_0x5f8a('0x5'));var jayson=require(_0x5f8a('0x6'));var client=jayson['client'][_0x5f8a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bbd74,_0x301c77,_0x456840){return new BPromise(function(_0x819bb1,_0x918a9a){return client[_0x5f8a('0x8')](_0x1bbd74,_0x456840)[_0x5f8a('0x9')](function(_0x4d5926){logger['info'](_0x5f8a('0xa'),_0x301c77,_0x5f8a('0xb'));logger['debug'](_0x5f8a('0xc'),_0x301c77,_0x5f8a('0xb'),JSON[_0x5f8a('0xd')](_0x4d5926));if(_0x4d5926[_0x5f8a('0xe')]){if(_0x4d5926[_0x5f8a('0xe')]['code']===0x1f4){logger[_0x5f8a('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x301c77,_0x4d5926['error'][_0x5f8a('0xf')]);return _0x918a9a(_0x4d5926[_0x5f8a('0xe')][_0x5f8a('0xf')]);}logger[_0x5f8a('0xe')](_0x5f8a('0xa'),_0x301c77,_0x4d5926[_0x5f8a('0xe')][_0x5f8a('0xf')]);return _0x819bb1(_0x4d5926[_0x5f8a('0xe')][_0x5f8a('0xf')]);}else{logger['info'](_0x5f8a('0xa'),_0x301c77,_0x5f8a('0xb'));_0x819bb1(_0x4d5926[_0x5f8a('0x10')][_0x5f8a('0xf')]);}})[_0x5f8a('0x11')](function(_0x5d8930){logger[_0x5f8a('0xe')](_0x5f8a('0xa'),_0x301c77,_0x5d8930);_0x918a9a(_0x5d8930);});});}exports[_0x5f8a('0x12')]=function(_0x1f08bc){var _0xfc2c8f=this;return new Promise(function(_0x206d53,_0x6d91b3){return db[_0x5f8a('0x13')]['findAll']({'raw':_0x1f08bc[_0x5f8a('0x14')]?_0x1f08bc[_0x5f8a('0x14')][_0x5f8a('0x15')]===undefined?!![]:![]:!![],'where':_0x1f08bc[_0x5f8a('0x14')]?_0x1f08bc[_0x5f8a('0x14')][_0x5f8a('0x16')]||null:null,'attributes':_0x1f08bc[_0x5f8a('0x14')]?_0x1f08bc['options'][_0x5f8a('0x17')]||null:null,'limit':_0x1f08bc[_0x5f8a('0x14')]?_0x1f08bc[_0x5f8a('0x14')]['limit']||null:null,'include':_0x1f08bc[_0x5f8a('0x14')]?_0x1f08bc[_0x5f8a('0x14')]['include']?_[_0x5f8a('0x18')](_0x1f08bc[_0x5f8a('0x14')][_0x5f8a('0x19')],function(_0xe7b3b5){return{'model':db[_0xe7b3b5['model']],'as':_0xe7b3b5['as'],'attributes':_0xe7b3b5['attributes'],'include':_0xe7b3b5[_0x5f8a('0x19')]?_[_0x5f8a('0x18')](_0xe7b3b5[_0x5f8a('0x19')],function(_0x2c8961){return{'model':db[_0x2c8961[_0x5f8a('0x1a')]],'as':_0x2c8961['as'],'attributes':_0x2c8961[_0x5f8a('0x17')],'include':_0x2c8961[_0x5f8a('0x19')]?_['map'](_0x2c8961['include'],function(_0x3ab78f){return{'model':db[_0x3ab78f[_0x5f8a('0x1a')]],'as':_0x3ab78f['as'],'attributes':_0x3ab78f[_0x5f8a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5f8a('0x9')](function(_0x2aea1f){logger['info'](_0x5f8a('0x12'),_0x1f08bc);logger[_0x5f8a('0x1b')](_0x5f8a('0x12'),_0x1f08bc,JSON[_0x5f8a('0xd')](_0x2aea1f));_0x206d53(_0x2aea1f);})[_0x5f8a('0x11')](function(_0x11d7c5){logger[_0x5f8a('0xe')]('GetServicenowAccount',_0x11d7c5['message'],_0x1f08bc);_0x6d91b3(_0xfc2c8f[_0x5f8a('0xe')](0x1f4,_0x11d7c5[_0x5f8a('0xf')]));});});};exports['ShowServicenowAccount']=function(_0x1c2df0){var _0x589b58=this;return new Promise(function(_0x334119,_0x5bc259){return db[_0x5f8a('0x13')][_0x5f8a('0x1c')]({'raw':_0x1c2df0[_0x5f8a('0x14')]?_0x1c2df0[_0x5f8a('0x14')][_0x5f8a('0x15')]===undefined?!![]:![]:!![],'where':_0x1c2df0['options']?_0x1c2df0[_0x5f8a('0x14')][_0x5f8a('0x16')]||null:null,'attributes':_0x1c2df0[_0x5f8a('0x14')]?_0x1c2df0[_0x5f8a('0x14')][_0x5f8a('0x17')]||null:null,'include':_0x1c2df0[_0x5f8a('0x14')]?_0x1c2df0[_0x5f8a('0x14')][_0x5f8a('0x19')]?_[_0x5f8a('0x18')](_0x1c2df0[_0x5f8a('0x14')][_0x5f8a('0x19')],function(_0x5c47ff){return{'model':db[_0x5c47ff['model']],'as':_0x5c47ff['as'],'attributes':_0x5c47ff['attributes'],'include':_0x5c47ff[_0x5f8a('0x19')]?_[_0x5f8a('0x18')](_0x5c47ff[_0x5f8a('0x19')],function(_0x31e987){return{'model':db[_0x31e987[_0x5f8a('0x1a')]],'as':_0x31e987['as'],'attributes':_0x31e987[_0x5f8a('0x17')],'include':_0x31e987[_0x5f8a('0x19')]?_[_0x5f8a('0x18')](_0x31e987[_0x5f8a('0x19')],function(_0x38b3fe){return{'model':db[_0x38b3fe[_0x5f8a('0x1a')]],'as':_0x38b3fe['as'],'attributes':_0x38b3fe[_0x5f8a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5f8a('0x9')](function(_0x2093f2){logger['info'](_0x5f8a('0x1d'),_0x1c2df0);logger[_0x5f8a('0x1b')](_0x5f8a('0x1d'),_0x1c2df0,JSON['stringify'](_0x2093f2));_0x334119(_0x2093f2);})[_0x5f8a('0x11')](function(_0x59f4fb){logger[_0x5f8a('0xe')](_0x5f8a('0x1d'),_0x59f4fb[_0x5f8a('0xf')],_0x1c2df0);_0x5bc259(_0x589b58[_0x5f8a('0xe')](0x1f4,_0x59f4fb[_0x5f8a('0xf')]));});});}; \ No newline at end of file +var _0xd61a=['ServicenowAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','findAll','options','where','attributes','limit','include','map','model','stringify','ShowServicenowAccount'];(function(_0x36acad,_0x52944d){var _0x370eb5=function(_0xa1da57){while(--_0xa1da57){_0x36acad['push'](_0x36acad['shift']());}};_0x370eb5(++_0x52944d);}(_0xd61a,0x133));var _0xad61=function(_0x37a505,_0x319129){_0x37a505=_0x37a505-0x0;var _0x5d094e=_0xd61a[_0x37a505];return _0x5d094e;};'use strict';var _=require(_0xad61('0x0'));var util=require(_0xad61('0x1'));var moment=require(_0xad61('0x2'));var BPromise=require('bluebird');var rs=require(_0xad61('0x3'));var fs=require('fs');var Redis=require(_0xad61('0x4'));var db=require(_0xad61('0x5'))['db'];var utils=require(_0xad61('0x6'));var logger=require(_0xad61('0x7'))(_0xad61('0x8'));var config=require(_0xad61('0x9'));var jayson=require(_0xad61('0xa'));var client=jayson[_0xad61('0xb')][_0xad61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd943cc,_0x47dd38,_0x312d21){return new BPromise(function(_0x20b559,_0x9543fa){return client['request'](_0xd943cc,_0x312d21)[_0xad61('0xd')](function(_0x24f63d){logger[_0xad61('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x47dd38,_0xad61('0xf'));logger[_0xad61('0x10')](_0xad61('0x11'),_0x47dd38,_0xad61('0xf'),JSON['stringify'](_0x24f63d));if(_0x24f63d[_0xad61('0x12')]){if(_0x24f63d['error'][_0xad61('0x13')]===0x1f4){logger[_0xad61('0x12')](_0xad61('0x14'),_0x47dd38,_0x24f63d[_0xad61('0x12')][_0xad61('0x15')]);return _0x9543fa(_0x24f63d[_0xad61('0x12')][_0xad61('0x15')]);}logger[_0xad61('0x12')](_0xad61('0x14'),_0x47dd38,_0x24f63d['error']['message']);return _0x20b559(_0x24f63d[_0xad61('0x12')][_0xad61('0x15')]);}else{logger[_0xad61('0xe')](_0xad61('0x14'),_0x47dd38,_0xad61('0xf'));_0x20b559(_0x24f63d[_0xad61('0x16')]['message']);}})[_0xad61('0x17')](function(_0xe4d07e){logger[_0xad61('0x12')](_0xad61('0x14'),_0x47dd38,_0xe4d07e);_0x9543fa(_0xe4d07e);});});}exports[_0xad61('0x18')]=function(_0x242383){var _0x41b4d9=this;return new Promise(function(_0x31425e,_0x5b5329){return db['ServicenowAccount'][_0xad61('0x19')]({'raw':_0x242383[_0xad61('0x1a')]?_0x242383['options']['raw']===undefined?!![]:![]:!![],'where':_0x242383['options']?_0x242383[_0xad61('0x1a')][_0xad61('0x1b')]||null:null,'attributes':_0x242383[_0xad61('0x1a')]?_0x242383[_0xad61('0x1a')][_0xad61('0x1c')]||null:null,'limit':_0x242383[_0xad61('0x1a')]?_0x242383[_0xad61('0x1a')][_0xad61('0x1d')]||null:null,'include':_0x242383[_0xad61('0x1a')]?_0x242383['options'][_0xad61('0x1e')]?_[_0xad61('0x1f')](_0x242383[_0xad61('0x1a')][_0xad61('0x1e')],function(_0x8d5e7f){return{'model':db[_0x8d5e7f[_0xad61('0x20')]],'as':_0x8d5e7f['as'],'attributes':_0x8d5e7f[_0xad61('0x1c')],'include':_0x8d5e7f['include']?_['map'](_0x8d5e7f[_0xad61('0x1e')],function(_0x36bbe4){return{'model':db[_0x36bbe4['model']],'as':_0x36bbe4['as'],'attributes':_0x36bbe4[_0xad61('0x1c')],'include':_0x36bbe4['include']?_['map'](_0x36bbe4[_0xad61('0x1e')],function(_0x59ed9a){return{'model':db[_0x59ed9a['model']],'as':_0x59ed9a['as'],'attributes':_0x59ed9a[_0xad61('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xad61('0xd')](function(_0x622578){logger[_0xad61('0xe')](_0xad61('0x18'),_0x242383);logger[_0xad61('0x10')]('GetServicenowAccount',_0x242383,JSON[_0xad61('0x21')](_0x622578));_0x31425e(_0x622578);})[_0xad61('0x17')](function(_0x144bb6){logger[_0xad61('0x12')](_0xad61('0x18'),_0x144bb6[_0xad61('0x15')],_0x242383);_0x5b5329(_0x41b4d9[_0xad61('0x12')](0x1f4,_0x144bb6['message']));});});};exports[_0xad61('0x22')]=function(_0x463f99){var _0x2a7627=this;return new Promise(function(_0x21f1bc,_0x3617ad){return db[_0xad61('0x23')][_0xad61('0x24')]({'raw':_0x463f99[_0xad61('0x1a')]?_0x463f99[_0xad61('0x1a')][_0xad61('0x25')]===undefined?!![]:![]:!![],'where':_0x463f99[_0xad61('0x1a')]?_0x463f99[_0xad61('0x1a')][_0xad61('0x1b')]||null:null,'attributes':_0x463f99[_0xad61('0x1a')]?_0x463f99[_0xad61('0x1a')][_0xad61('0x1c')]||null:null,'include':_0x463f99[_0xad61('0x1a')]?_0x463f99[_0xad61('0x1a')][_0xad61('0x1e')]?_[_0xad61('0x1f')](_0x463f99[_0xad61('0x1a')][_0xad61('0x1e')],function(_0x16bcc7){return{'model':db[_0x16bcc7['model']],'as':_0x16bcc7['as'],'attributes':_0x16bcc7[_0xad61('0x1c')],'include':_0x16bcc7[_0xad61('0x1e')]?_[_0xad61('0x1f')](_0x16bcc7['include'],function(_0x5942f1){return{'model':db[_0x5942f1[_0xad61('0x20')]],'as':_0x5942f1['as'],'attributes':_0x5942f1[_0xad61('0x1c')],'include':_0x5942f1[_0xad61('0x1e')]?_[_0xad61('0x1f')](_0x5942f1[_0xad61('0x1e')],function(_0x12fd86){return{'model':db[_0x12fd86[_0xad61('0x20')]],'as':_0x12fd86['as'],'attributes':_0x12fd86[_0xad61('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xad61('0xd')](function(_0x2cb680){logger[_0xad61('0xe')](_0xad61('0x22'),_0x463f99);logger[_0xad61('0x10')](_0xad61('0x22'),_0x463f99,JSON[_0xad61('0x21')](_0x2cb680));_0x21f1bc(_0x2cb680);})[_0xad61('0x17')](function(_0x3fb180){logger[_0xad61('0x12')](_0xad61('0x22'),_0x3fb180[_0xad61('0x15')],_0x463f99);_0x3617ad(_0x2a7627[_0xad61('0x12')](0x1f4,_0x3fb180[_0xad61('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7abb563..971744e 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 _0xf9d1=['getSubjects','/:id/descriptions','getDescriptions','create','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects'];(function(_0x58cad4,_0x41e5cf){var _0x3e61e6=function(_0x5dba8e){while(--_0x5dba8e){_0x58cad4['push'](_0x58cad4['shift']());}};_0x3e61e6(++_0x41e5cf);}(_0xf9d1,0x1d5));var _0x1f9d=function(_0x3a7edb,_0x17914c){_0x3a7edb=_0x3a7edb-0x0;var _0x16a489=_0xf9d1[_0x3a7edb];return _0x16a489;};'use strict';var multer=require(_0x1f9d('0x0'));var util=require(_0x1f9d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1f9d('0x2'));var router=express[_0x1f9d('0x3')]();var fs_extra=require(_0x1f9d('0x4'));var auth=require(_0x1f9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f9d('0x6'));var controller=require(_0x1f9d('0x7'));router['get']('/',auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x9')]);router[_0x1f9d('0xa')](_0x1f9d('0xb'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0xc')]);router[_0x1f9d('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1f9d('0xd')]);router[_0x1f9d('0xa')](_0x1f9d('0xe'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0xf')]);router[_0x1f9d('0xa')](_0x1f9d('0x10'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x11')]);router['post']('/',auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x12')]);router['put'](_0x1f9d('0xb'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x13')]);router[_0x1f9d('0x14')](_0x1f9d('0xb'),auth[_0x1f9d('0x8')](),controller[_0x1f9d('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe282=['isAuthenticated','index','get','getFields','getSubjects','post','create','/:id','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0xd90f55,_0x48ac96){var _0x2bfc02=function(_0x2e752d){while(--_0x2e752d){_0xd90f55['push'](_0xd90f55['shift']());}};_0x2bfc02(++_0x48ac96);}(_0xe282,0x119));var _0x2e28=function(_0x5240ca,_0x4e0ac9){_0x5240ca=_0x5240ca-0x0;var _0x21b154=_0xe282[_0x5240ca];return _0x21b154;};'use strict';var multer=require(_0x2e28('0x0'));var util=require(_0x2e28('0x1'));var path=require('path');var timeout=require(_0x2e28('0x2'));var express=require(_0x2e28('0x3'));var router=express[_0x2e28('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2e28('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2e28('0x6'));var controller=require(_0x2e28('0x7'));router['get']('/',auth[_0x2e28('0x8')](),controller[_0x2e28('0x9')]);router['get']('/:id',auth[_0x2e28('0x8')](),controller['show']);router[_0x2e28('0xa')]('/:id/fields',auth[_0x2e28('0x8')](),controller[_0x2e28('0xb')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x2e28('0xc')]);router[_0x2e28('0xa')]('/:id/descriptions',auth[_0x2e28('0x8')](),controller['getDescriptions']);router[_0x2e28('0xd')]('/',auth[_0x2e28('0x8')](),controller[_0x2e28('0xe')]);router['put'](_0x2e28('0xf'),auth[_0x2e28('0x8')](),controller['update']);router['delete']('/:id',auth[_0x2e28('0x8')](),controller[_0x2e28('0x10')]);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 4462338..8cee284 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 _0x8820=['sequelize','exports','STRING'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x8820,0x1ce));var _0x0882=function(_0x36e0bf,_0x5bff08){_0x36e0bf=_0x36e0bf-0x0;var _0x4d40d7=_0x8820[_0x36e0bf];return _0x4d40d7;};'use strict';var Sequelize=require(_0x0882('0x0'));module[_0x0882('0x1')]={'name':{'type':Sequelize[_0x0882('0x2')]},'description':{'type':Sequelize[_0x0882('0x2')]}}; \ No newline at end of file +var _0x9293=['sequelize','exports','STRING'];(function(_0x3c68ac,_0x38b406){var _0x35d849=function(_0x1fb2e0){while(--_0x1fb2e0){_0x3c68ac['push'](_0x3c68ac['shift']());}};_0x35d849(++_0x38b406);}(_0x9293,0x102));var _0x3929=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x9293[_0x5311e8];return _0x582ad8;};'use strict';var Sequelize=require(_0x3929('0x0'));module[_0x3929('0x1')]={'name':{'type':Sequelize[_0x3929('0x2')]},'description':{'type':Sequelize[_0x3929('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 71c25ef..cd46890 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 _0x9499=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','getSubjects','ServicenowField','getDescriptions','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis'];(function(_0x484da6,_0x10686f){var _0x4cbfb7=function(_0xed5b0e){while(--_0xed5b0e){_0x484da6['push'](_0x484da6['shift']());}};_0x4cbfb7(++_0x10686f);}(_0x9499,0xe0));var _0x9949=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9499[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x9949('0x0'));var rimraf=require(_0x9949('0x1'));var zipdir=require(_0x9949('0x2'));var jsonpatch=require(_0x9949('0x3'));var rp=require(_0x9949('0x4'));var moment=require(_0x9949('0x5'));var BPromise=require(_0x9949('0x6'));var Mustache=require(_0x9949('0x7'));var util=require(_0x9949('0x8'));var path=require(_0x9949('0x9'));var sox=require(_0x9949('0xa'));var csv=require('to-csv');var ejs=require(_0x9949('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9949('0xc'));var crypto=require(_0x9949('0xd'));var jsforce=require(_0x9949('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9949('0xf'));var querystring=require(_0x9949('0x10'));var Papa=require(_0x9949('0x11'));var Redis=require(_0x9949('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9949('0x13'));var as=require(_0x9949('0x14'));var hardwareService=require(_0x9949('0x15'));var logger=require(_0x9949('0x16'))(_0x9949('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9949('0x18'))['db'];function respondWithStatusCode(_0x4a0ab7,_0x5610ff){_0x5610ff=_0x5610ff||0xcc;return function(_0x4db152){if(_0x4db152){return _0x4a0ab7[_0x9949('0x19')](_0x5610ff);}return _0x4a0ab7['status'](_0x5610ff)[_0x9949('0x1a')]();};}function respondWithResult(_0x3b07c4,_0x392ed3){_0x392ed3=_0x392ed3||0xc8;return function(_0x520524){if(_0x520524){return _0x3b07c4[_0x9949('0x1b')](_0x392ed3)[_0x9949('0x1c')](_0x520524);}};}function respondWithFilteredResult(_0x19c180,_0x633467){return function(_0x53e604){if(_0x53e604){var _0x1bd1ff=typeof _0x633467['offset']===_0x9949('0x1d')&&typeof _0x633467[_0x9949('0x1e')]===_0x9949('0x1d');var _0x4b5a29=_0x53e604[_0x9949('0x1f')];var _0x1856e5=_0x1bd1ff?0x0:_0x633467[_0x9949('0x20')];var _0x587340=_0x1bd1ff?_0x53e604['count']:_0x633467[_0x9949('0x20')]+_0x633467['limit'];var _0x59d0cd;if(_0x587340>=_0x4b5a29){_0x587340=_0x4b5a29;_0x59d0cd=0xc8;}else{_0x59d0cd=0xce;}_0x19c180['status'](_0x59d0cd);return _0x19c180['set'](_0x9949('0x21'),_0x1856e5+'-'+_0x587340+'/'+_0x4b5a29)[_0x9949('0x1c')](_0x53e604);}return null;};}function patchUpdates(_0x67778){return function(_0x42e161){try{jsonpatch[_0x9949('0x22')](_0x42e161,_0x67778,!![]);}catch(_0xef5855){return BPromise[_0x9949('0x23')](_0xef5855);}return _0x42e161[_0x9949('0x24')]();};}function saveUpdates(_0x9be22,_0x328a8e){return function(_0x5c178c){if(_0x5c178c){return _0x5c178c[_0x9949('0x25')](_0x9be22)[_0x9949('0x26')](function(_0x56efb4){return _0x56efb4;});}return null;};}function removeEntity(_0x2a315b,_0x1a8900){return function(_0x819d14){if(_0x819d14){return _0x819d14[_0x9949('0x27')]()[_0x9949('0x26')](function(){_0x2a315b['status'](0xcc)[_0x9949('0x1a')]();});}};}function handleEntityNotFound(_0xd12746,_0xf107d4){return function(_0x371eb0){if(!_0x371eb0){_0xd12746[_0x9949('0x19')](0x194);}return _0x371eb0;};}function handleError(_0x2f4839,_0xb17d15){_0xb17d15=_0xb17d15||0x1f4;return function(_0xc67ecf){logger['error'](_0xc67ecf[_0x9949('0x28')]);if(_0xc67ecf[_0x9949('0x29')]){delete _0xc67ecf[_0x9949('0x29')];}_0x2f4839['status'](_0xb17d15)[_0x9949('0x2a')](_0xc67ecf);};}exports[_0x9949('0x2b')]=function(_0x436840,_0xc75fc4){var _0x24c2c4={},_0x5a6f5a={},_0x37610b={'count':0x0,'rows':[]};var _0x482678=_[_0x9949('0x2c')](db[_0x9949('0x2d')]['rawAttributes'],function(_0x1cffd6){return{'name':_0x1cffd6[_0x9949('0x2e')],'type':_0x1cffd6[_0x9949('0x2f')]['key']};});_0x5a6f5a[_0x9949('0x30')]=_[_0x9949('0x2c')](_0x482678,_0x9949('0x29'));_0x5a6f5a[_0x9949('0x31')]=_[_0x9949('0x32')](_0x436840[_0x9949('0x31')]);_0x5a6f5a[_0x9949('0x33')]=_[_0x9949('0x34')](_0x5a6f5a[_0x9949('0x30')],_0x5a6f5a[_0x9949('0x31')]);_0x24c2c4[_0x9949('0x35')]=_[_0x9949('0x34')](_0x5a6f5a[_0x9949('0x30')],qs[_0x9949('0x36')](_0x436840[_0x9949('0x31')][_0x9949('0x36')]));_0x24c2c4[_0x9949('0x35')]=_0x24c2c4['attributes'][_0x9949('0x37')]?_0x24c2c4[_0x9949('0x35')]:_0x5a6f5a[_0x9949('0x30')];if(!_0x436840[_0x9949('0x31')][_0x9949('0x38')](_0x9949('0x39'))){_0x24c2c4['limit']=qs['limit'](_0x436840['query'][_0x9949('0x1e')]);_0x24c2c4[_0x9949('0x20')]=qs[_0x9949('0x20')](_0x436840[_0x9949('0x31')]['offset']);}_0x24c2c4[_0x9949('0x3a')]=qs[_0x9949('0x3b')](_0x436840['query'][_0x9949('0x3b')]);_0x24c2c4[_0x9949('0x3c')]=qs[_0x9949('0x33')](_[_0x9949('0x3d')](_0x436840['query'],_0x5a6f5a[_0x9949('0x33')]),_0x482678);if(_0x436840['query'][_0x9949('0x3e')]){_0x24c2c4[_0x9949('0x3c')]=_[_0x9949('0x3f')](_0x24c2c4[_0x9949('0x3c')],{'$or':_[_0x9949('0x2c')](_0x482678,function(_0x1a2179){if(_0x1a2179['type']!=='VIRTUAL'){var _0x539d66={};_0x539d66[_0x1a2179[_0x9949('0x29')]]={'$like':'%'+_0x436840['query'][_0x9949('0x3e')]+'%'};return _0x539d66;}})});}_0x24c2c4=_['merge']({},_0x24c2c4,_0x436840['options']);var _0x3d41e6={'where':_0x24c2c4[_0x9949('0x3c')]};return db[_0x9949('0x2d')][_0x9949('0x1f')](_0x3d41e6)['then'](function(_0x5caf54){_0x37610b[_0x9949('0x1f')]=_0x5caf54;if(_0x436840[_0x9949('0x31')][_0x9949('0x40')]){_0x24c2c4[_0x9949('0x41')]=[{'all':!![]}];}return db[_0x9949('0x2d')][_0x9949('0x42')](_0x24c2c4);})[_0x9949('0x26')](function(_0x22a814){_0x37610b[_0x9949('0x43')]=_0x22a814;return _0x37610b;})[_0x9949('0x26')](respondWithFilteredResult(_0xc75fc4,_0x24c2c4))[_0x9949('0x44')](handleError(_0xc75fc4,null));};exports[_0x9949('0x45')]=function(_0x56f343,_0x324347){var _0x52879d={'raw':![],'where':{'id':_0x56f343[_0x9949('0x46')]['id']}},_0x248a31={};_0x248a31[_0x9949('0x30')]=_[_0x9949('0x32')](db[_0x9949('0x2d')][_0x9949('0x47')]);_0x248a31['query']=_[_0x9949('0x32')](_0x56f343[_0x9949('0x31')]);_0x248a31[_0x9949('0x33')]=_['intersection'](_0x248a31['model'],_0x248a31['query']);_0x52879d[_0x9949('0x35')]=_['intersection'](_0x248a31[_0x9949('0x30')],qs[_0x9949('0x36')](_0x56f343[_0x9949('0x31')][_0x9949('0x36')]));_0x52879d[_0x9949('0x35')]=_0x52879d['attributes'][_0x9949('0x37')]?_0x52879d['attributes']:_0x248a31[_0x9949('0x30')];if(_0x56f343['query'][_0x9949('0x40')]){_0x52879d[_0x9949('0x41')]=[{'all':!![]}];}_0x52879d=_[_0x9949('0x3f')]({},_0x52879d,_0x56f343['options']);return db['ServicenowConfiguration'][_0x9949('0x48')](_0x52879d)[_0x9949('0x26')](handleEntityNotFound(_0x324347,null))['then'](respondWithResult(_0x324347,null))['catch'](handleError(_0x324347,null));};exports[_0x9949('0x49')]=function(_0x19ea5e,_0x30ae4e){return db[_0x9949('0x2d')]['create'](_0x19ea5e['body'],{})[_0x9949('0x26')](respondWithResult(_0x30ae4e,0xc9))['catch'](handleError(_0x30ae4e,null));};exports[_0x9949('0x25')]=function(_0x3be1ba,_0x47d6b5){if(_0x3be1ba[_0x9949('0x4a')]['id']){delete _0x3be1ba[_0x9949('0x4a')]['id'];}return db['ServicenowConfiguration'][_0x9949('0x48')]({'where':{'id':_0x3be1ba[_0x9949('0x46')]['id']}})[_0x9949('0x26')](handleEntityNotFound(_0x47d6b5,null))[_0x9949('0x26')](saveUpdates(_0x3be1ba[_0x9949('0x4a')],null))[_0x9949('0x26')](respondWithResult(_0x47d6b5,null))[_0x9949('0x44')](handleError(_0x47d6b5,null));};exports[_0x9949('0x27')]=function(_0x104c0c,_0x300558){return db[_0x9949('0x2d')][_0x9949('0x48')]({'where':{'id':_0x104c0c[_0x9949('0x46')]['id']}})[_0x9949('0x26')](handleEntityNotFound(_0x300558,null))[_0x9949('0x26')](removeEntity(_0x300558,null))['catch'](handleError(_0x300558,null));};exports[_0x9949('0x4b')]=function(_0x49086e,_0x5b33c2,_0x102c29){var _0x2ffa32={};var _0xfa428b={};var _0x440432;var _0x1fb15b;return db['ServicenowConfiguration'][_0x9949('0x4c')]({'where':{'id':_0x49086e[_0x9949('0x46')]['id']}})[_0x9949('0x26')](handleEntityNotFound(_0x5b33c2,null))['then'](function(_0x2a4502){if(_0x2a4502){_0x440432=_0x2a4502;_0xfa428b['model']=_['keys'](db['ServicenowField'][_0x9949('0x47')]);_0xfa428b[_0x9949('0x31')]=_[_0x9949('0x32')](_0x49086e[_0x9949('0x31')]);_0xfa428b[_0x9949('0x33')]=_[_0x9949('0x34')](_0xfa428b[_0x9949('0x30')],_0xfa428b[_0x9949('0x31')]);_0x2ffa32[_0x9949('0x35')]=_[_0x9949('0x34')](_0xfa428b[_0x9949('0x30')],qs[_0x9949('0x36')](_0x49086e[_0x9949('0x31')][_0x9949('0x36')]));_0x2ffa32[_0x9949('0x35')]=_0x2ffa32['attributes'][_0x9949('0x37')]?_0x2ffa32[_0x9949('0x35')]:_0xfa428b[_0x9949('0x30')];_0x2ffa32[_0x9949('0x3a')]=qs[_0x9949('0x3b')](_0x49086e['query'][_0x9949('0x3b')]);_0x2ffa32[_0x9949('0x3c')]=qs['filters'](_[_0x9949('0x3d')](_0x49086e['query'],_0xfa428b[_0x9949('0x33')]));if(_0x49086e[_0x9949('0x31')]['filter']){_0x2ffa32[_0x9949('0x3c')]=_[_0x9949('0x3f')](_0x2ffa32[_0x9949('0x3c')],{'$or':_[_0x9949('0x2c')](_0x2ffa32[_0x9949('0x35')],function(_0x3d697b){var _0x47aef8={};_0x47aef8[_0x3d697b]={'$like':'%'+_0x49086e[_0x9949('0x31')][_0x9949('0x3e')]+'%'};return _0x47aef8;})});}_0x2ffa32=_[_0x9949('0x3f')]({},_0x2ffa32,_0x49086e['options']);return _0x440432[_0x9949('0x4b')](_0x2ffa32);}})[_0x9949('0x26')](function(_0x4b4b53){if(_0x4b4b53){_0x1fb15b=_0x4b4b53['length'];if(!_0x49086e['query']['hasOwnProperty']('nolimit')){_0x2ffa32['limit']=qs[_0x9949('0x1e')](_0x49086e[_0x9949('0x31')]['limit']);_0x2ffa32[_0x9949('0x20')]=qs[_0x9949('0x20')](_0x49086e[_0x9949('0x31')][_0x9949('0x20')]);}return _0x440432[_0x9949('0x4b')](_0x2ffa32);}})['then'](function(_0x5e278e){if(_0x5e278e){return _0x5e278e?{'count':_0x1fb15b,'rows':_0x5e278e}:null;}})[_0x9949('0x26')](respondWithResult(_0x5b33c2,null))['catch'](handleError(_0x5b33c2,null));};exports[_0x9949('0x4d')]=function(_0x2d84ae,_0x2244b7,_0x298924){var _0x67fea0={};var _0x23e3b1={};var _0x5d9ac2;var _0x6657f2;return db[_0x9949('0x2d')][_0x9949('0x4c')]({'where':{'id':_0x2d84ae[_0x9949('0x46')]['id']}})[_0x9949('0x26')](handleEntityNotFound(_0x2244b7,null))[_0x9949('0x26')](function(_0x53fcc4){if(_0x53fcc4){_0x5d9ac2=_0x53fcc4;_0x23e3b1['model']=_[_0x9949('0x32')](db[_0x9949('0x4e')]['rawAttributes']);_0x23e3b1[_0x9949('0x31')]=_[_0x9949('0x32')](_0x2d84ae[_0x9949('0x31')]);_0x23e3b1[_0x9949('0x33')]=_[_0x9949('0x34')](_0x23e3b1[_0x9949('0x30')],_0x23e3b1[_0x9949('0x31')]);_0x67fea0[_0x9949('0x35')]=_[_0x9949('0x34')](_0x23e3b1[_0x9949('0x30')],qs['fields'](_0x2d84ae[_0x9949('0x31')][_0x9949('0x36')]));_0x67fea0[_0x9949('0x35')]=_0x67fea0[_0x9949('0x35')]['length']?_0x67fea0[_0x9949('0x35')]:_0x23e3b1['model'];_0x67fea0['order']=qs[_0x9949('0x3b')](_0x2d84ae[_0x9949('0x31')]['sort']);_0x67fea0[_0x9949('0x3c')]=qs[_0x9949('0x33')](_[_0x9949('0x3d')](_0x2d84ae[_0x9949('0x31')],_0x23e3b1[_0x9949('0x33')]));if(_0x2d84ae['query'][_0x9949('0x3e')]){_0x67fea0['where']=_[_0x9949('0x3f')](_0x67fea0[_0x9949('0x3c')],{'$or':_['map'](_0x67fea0[_0x9949('0x35')],function(_0x29ba0e){var _0x3a924a={};_0x3a924a[_0x29ba0e]={'$like':'%'+_0x2d84ae['query']['filter']+'%'};return _0x3a924a;})});}_0x67fea0=_[_0x9949('0x3f')]({},_0x67fea0,_0x2d84ae['options']);return _0x5d9ac2[_0x9949('0x4d')](_0x67fea0);}})[_0x9949('0x26')](function(_0x7365b5){if(_0x7365b5){_0x6657f2=_0x7365b5[_0x9949('0x37')];if(!_0x2d84ae[_0x9949('0x31')]['hasOwnProperty'](_0x9949('0x39'))){_0x67fea0[_0x9949('0x1e')]=qs[_0x9949('0x1e')](_0x2d84ae[_0x9949('0x31')][_0x9949('0x1e')]);_0x67fea0[_0x9949('0x20')]=qs[_0x9949('0x20')](_0x2d84ae[_0x9949('0x31')][_0x9949('0x20')]);}return _0x5d9ac2[_0x9949('0x4d')](_0x67fea0);}})[_0x9949('0x26')](function(_0x8c5e9b){if(_0x8c5e9b){return _0x8c5e9b?{'count':_0x6657f2,'rows':_0x8c5e9b}:null;}})[_0x9949('0x26')](respondWithResult(_0x2244b7,null))[_0x9949('0x44')](handleError(_0x2244b7,null));};exports[_0x9949('0x4f')]=function(_0x55425f,_0x25e8d8,_0x59983f){var _0x3a48c4={};var _0x2c5aa2={};var _0xb3976a;var _0x4e9b2e;return db['ServicenowConfiguration'][_0x9949('0x4c')]({'where':{'id':_0x55425f[_0x9949('0x46')]['id']}})['then'](handleEntityNotFound(_0x25e8d8,null))[_0x9949('0x26')](function(_0x19c9cc){if(_0x19c9cc){_0xb3976a=_0x19c9cc;_0x2c5aa2[_0x9949('0x30')]=_['keys'](db[_0x9949('0x4e')]['rawAttributes']);_0x2c5aa2[_0x9949('0x31')]=_['keys'](_0x55425f['query']);_0x2c5aa2[_0x9949('0x33')]=_[_0x9949('0x34')](_0x2c5aa2['model'],_0x2c5aa2[_0x9949('0x31')]);_0x3a48c4[_0x9949('0x35')]=_['intersection'](_0x2c5aa2['model'],qs[_0x9949('0x36')](_0x55425f[_0x9949('0x31')][_0x9949('0x36')]));_0x3a48c4[_0x9949('0x35')]=_0x3a48c4[_0x9949('0x35')][_0x9949('0x37')]?_0x3a48c4[_0x9949('0x35')]:_0x2c5aa2[_0x9949('0x30')];_0x3a48c4[_0x9949('0x3a')]=qs['sort'](_0x55425f[_0x9949('0x31')][_0x9949('0x3b')]);_0x3a48c4['where']=qs[_0x9949('0x33')](_[_0x9949('0x3d')](_0x55425f['query'],_0x2c5aa2['filters']));if(_0x55425f[_0x9949('0x31')][_0x9949('0x3e')]){_0x3a48c4[_0x9949('0x3c')]=_[_0x9949('0x3f')](_0x3a48c4[_0x9949('0x3c')],{'$or':_[_0x9949('0x2c')](_0x3a48c4[_0x9949('0x35')],function(_0x19c35c){var _0x492fb9={};_0x492fb9[_0x19c35c]={'$like':'%'+_0x55425f['query'][_0x9949('0x3e')]+'%'};return _0x492fb9;})});}_0x3a48c4=_['merge']({},_0x3a48c4,_0x55425f[_0x9949('0x50')]);return _0xb3976a[_0x9949('0x4f')](_0x3a48c4);}})[_0x9949('0x26')](function(_0x34eb10){if(_0x34eb10){_0x4e9b2e=_0x34eb10[_0x9949('0x37')];if(!_0x55425f[_0x9949('0x31')][_0x9949('0x38')](_0x9949('0x39'))){_0x3a48c4[_0x9949('0x1e')]=qs[_0x9949('0x1e')](_0x55425f['query'][_0x9949('0x1e')]);_0x3a48c4[_0x9949('0x20')]=qs[_0x9949('0x20')](_0x55425f[_0x9949('0x31')]['offset']);}return _0xb3976a[_0x9949('0x4f')](_0x3a48c4);}})[_0x9949('0x26')](function(_0x23e076){if(_0x23e076){return _0x23e076?{'count':_0x4e9b2e,'rows':_0x23e076}:null;}})[_0x9949('0x26')](respondWithResult(_0x25e8d8,null))[_0x9949('0x44')](handleError(_0x25e8d8,null));}; \ No newline at end of file +var _0x7060=['find','create','body','getFields','ServicenowField','order','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x27c20d,_0x389582){var _0x2871a2=function(_0x3af732){while(--_0x3af732){_0x27c20d['push'](_0x27c20d['shift']());}};_0x2871a2(++_0x389582);}(_0x7060,0xa7));var _0x0706=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7060[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0706('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0706('0x1'));var jsonpatch=require(_0x0706('0x2'));var rp=require(_0x0706('0x3'));var moment=require(_0x0706('0x4'));var BPromise=require(_0x0706('0x5'));var Mustache=require(_0x0706('0x6'));var util=require(_0x0706('0x7'));var path=require(_0x0706('0x8'));var sox=require('sox');var csv=require(_0x0706('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0706('0xa'));var _=require(_0x0706('0xb'));var squel=require(_0x0706('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0706('0xd'));var toCsv=require(_0x0706('0x9'));var querystring=require('querystring');var Papa=require(_0x0706('0xe'));var Redis=require(_0x0706('0xf'));var authService=require(_0x0706('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0706('0x11'));var hardwareService=require(_0x0706('0x12'));var logger=require('../../config/logger')(_0x0706('0x13'));var utils=require(_0x0706('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0706('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f4b9,_0xad8310){_0xad8310=_0xad8310||0xcc;return function(_0x168404){if(_0x168404){return _0x51f4b9[_0x0706('0x16')](_0xad8310);}return _0x51f4b9[_0x0706('0x17')](_0xad8310)[_0x0706('0x18')]();};}function respondWithResult(_0x41da3d,_0x449b2f){_0x449b2f=_0x449b2f||0xc8;return function(_0x3c2018){if(_0x3c2018){return _0x41da3d['status'](_0x449b2f)[_0x0706('0x19')](_0x3c2018);}};}function respondWithFilteredResult(_0xd29200,_0x49e35b){return function(_0x3565e9){if(_0x3565e9){var _0x384996=typeof _0x49e35b[_0x0706('0x1a')]==='undefined'&&typeof _0x49e35b['limit']===_0x0706('0x1b');var _0x3f8a58=_0x3565e9['count'];var _0x6228f8=_0x384996?0x0:_0x49e35b['offset'];var _0x2d42e5=_0x384996?_0x3565e9[_0x0706('0x1c')]:_0x49e35b[_0x0706('0x1a')]+_0x49e35b[_0x0706('0x1d')];var _0x261514;if(_0x2d42e5>=_0x3f8a58){_0x2d42e5=_0x3f8a58;_0x261514=0xc8;}else{_0x261514=0xce;}_0xd29200[_0x0706('0x17')](_0x261514);return _0xd29200['set'](_0x0706('0x1e'),_0x6228f8+'-'+_0x2d42e5+'/'+_0x3f8a58)[_0x0706('0x19')](_0x3565e9);}return null;};}function patchUpdates(_0x33fe15){return function(_0xd1eaf6){try{jsonpatch[_0x0706('0x1f')](_0xd1eaf6,_0x33fe15,!![]);}catch(_0x402f1a){return BPromise[_0x0706('0x20')](_0x402f1a);}return _0xd1eaf6[_0x0706('0x21')]();};}function saveUpdates(_0x5ebbba,_0x9d1c27){return function(_0x48afdf){if(_0x48afdf){return _0x48afdf['update'](_0x5ebbba)[_0x0706('0x22')](function(_0x17de0e){return _0x17de0e;});}return null;};}function removeEntity(_0x1343a3,_0xe5243b){return function(_0x37f716){if(_0x37f716){return _0x37f716[_0x0706('0x23')]()[_0x0706('0x22')](function(){_0x1343a3[_0x0706('0x17')](0xcc)[_0x0706('0x18')]();});}};}function handleEntityNotFound(_0x4777f1,_0x15c022){return function(_0x1baaf2){if(!_0x1baaf2){_0x4777f1[_0x0706('0x16')](0x194);}return _0x1baaf2;};}function handleError(_0x57ef30,_0x26ca91){_0x26ca91=_0x26ca91||0x1f4;return function(_0x2eb3c2){logger['error'](_0x2eb3c2[_0x0706('0x24')]);if(_0x2eb3c2[_0x0706('0x25')]){delete _0x2eb3c2['name'];}_0x57ef30[_0x0706('0x17')](_0x26ca91)[_0x0706('0x26')](_0x2eb3c2);};}exports[_0x0706('0x27')]=function(_0x528dc2,_0x2c6a34){var _0x3f67ad={},_0x265abc={},_0x1e1844={'count':0x0,'rows':[]};var _0x2ad7f6=_[_0x0706('0x28')](db[_0x0706('0x29')][_0x0706('0x2a')],function(_0x385a67){return{'name':_0x385a67[_0x0706('0x2b')],'type':_0x385a67[_0x0706('0x2c')][_0x0706('0x2d')]};});_0x265abc['model']=_[_0x0706('0x28')](_0x2ad7f6,_0x0706('0x25'));_0x265abc['query']=_[_0x0706('0x2e')](_0x528dc2[_0x0706('0x2f')]);_0x265abc['filters']=_[_0x0706('0x30')](_0x265abc['model'],_0x265abc[_0x0706('0x2f')]);_0x3f67ad[_0x0706('0x31')]=_[_0x0706('0x30')](_0x265abc['model'],qs[_0x0706('0x32')](_0x528dc2[_0x0706('0x2f')][_0x0706('0x32')]));_0x3f67ad[_0x0706('0x31')]=_0x3f67ad[_0x0706('0x31')][_0x0706('0x33')]?_0x3f67ad[_0x0706('0x31')]:_0x265abc[_0x0706('0x34')];if(!_0x528dc2[_0x0706('0x2f')][_0x0706('0x35')](_0x0706('0x36'))){_0x3f67ad[_0x0706('0x1d')]=qs['limit'](_0x528dc2[_0x0706('0x2f')]['limit']);_0x3f67ad[_0x0706('0x1a')]=qs[_0x0706('0x1a')](_0x528dc2[_0x0706('0x2f')][_0x0706('0x1a')]);}_0x3f67ad['order']=qs['sort'](_0x528dc2[_0x0706('0x2f')][_0x0706('0x37')]);_0x3f67ad[_0x0706('0x38')]=qs[_0x0706('0x39')](_[_0x0706('0x3a')](_0x528dc2[_0x0706('0x2f')],_0x265abc['filters']),_0x2ad7f6);if(_0x528dc2[_0x0706('0x2f')][_0x0706('0x3b')]){_0x3f67ad[_0x0706('0x38')]=_[_0x0706('0x3c')](_0x3f67ad[_0x0706('0x38')],{'$or':_[_0x0706('0x28')](_0x2ad7f6,function(_0x1ec9e6){if(_0x1ec9e6[_0x0706('0x2c')]!==_0x0706('0x3d')){var _0x439797={};_0x439797[_0x1ec9e6[_0x0706('0x25')]]={'$like':'%'+_0x528dc2[_0x0706('0x2f')][_0x0706('0x3b')]+'%'};return _0x439797;}})});}_0x3f67ad=_[_0x0706('0x3c')]({},_0x3f67ad,_0x528dc2[_0x0706('0x3e')]);var _0x128c19={'where':_0x3f67ad[_0x0706('0x38')]};return db[_0x0706('0x29')][_0x0706('0x1c')](_0x128c19)[_0x0706('0x22')](function(_0x20f076){_0x1e1844[_0x0706('0x1c')]=_0x20f076;if(_0x528dc2[_0x0706('0x2f')][_0x0706('0x3f')]){_0x3f67ad[_0x0706('0x40')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x0706('0x41')](_0x3f67ad);})[_0x0706('0x22')](function(_0x2cf826){_0x1e1844[_0x0706('0x42')]=_0x2cf826;return _0x1e1844;})['then'](respondWithFilteredResult(_0x2c6a34,_0x3f67ad))[_0x0706('0x43')](handleError(_0x2c6a34,null));};exports[_0x0706('0x44')]=function(_0x14ccf6,_0x166ff3){var _0x1c77d9={'raw':![],'where':{'id':_0x14ccf6[_0x0706('0x45')]['id']}},_0x17a25c={};_0x17a25c['model']=_['keys'](db[_0x0706('0x29')][_0x0706('0x2a')]);_0x17a25c[_0x0706('0x2f')]=_[_0x0706('0x2e')](_0x14ccf6['query']);_0x17a25c['filters']=_[_0x0706('0x30')](_0x17a25c[_0x0706('0x34')],_0x17a25c[_0x0706('0x2f')]);_0x1c77d9[_0x0706('0x31')]=_[_0x0706('0x30')](_0x17a25c['model'],qs['fields'](_0x14ccf6[_0x0706('0x2f')][_0x0706('0x32')]));_0x1c77d9['attributes']=_0x1c77d9[_0x0706('0x31')][_0x0706('0x33')]?_0x1c77d9[_0x0706('0x31')]:_0x17a25c['model'];if(_0x14ccf6[_0x0706('0x2f')][_0x0706('0x3f')]){_0x1c77d9[_0x0706('0x40')]=[{'all':!![]}];}_0x1c77d9=_[_0x0706('0x3c')]({},_0x1c77d9,_0x14ccf6[_0x0706('0x3e')]);return db[_0x0706('0x29')][_0x0706('0x46')](_0x1c77d9)[_0x0706('0x22')](handleEntityNotFound(_0x166ff3,null))[_0x0706('0x22')](respondWithResult(_0x166ff3,null))[_0x0706('0x43')](handleError(_0x166ff3,null));};exports[_0x0706('0x47')]=function(_0x19bae8,_0x49df9f){return db[_0x0706('0x29')][_0x0706('0x47')](_0x19bae8[_0x0706('0x48')],{})[_0x0706('0x22')](respondWithResult(_0x49df9f,0xc9))[_0x0706('0x43')](handleError(_0x49df9f,null));};exports['update']=function(_0x3f9963,_0x22570f){if(_0x3f9963[_0x0706('0x48')]['id']){delete _0x3f9963[_0x0706('0x48')]['id'];}return db[_0x0706('0x29')][_0x0706('0x46')]({'where':{'id':_0x3f9963['params']['id']}})[_0x0706('0x22')](handleEntityNotFound(_0x22570f,null))[_0x0706('0x22')](saveUpdates(_0x3f9963[_0x0706('0x48')],null))[_0x0706('0x22')](respondWithResult(_0x22570f,null))['catch'](handleError(_0x22570f,null));};exports['destroy']=function(_0x509c4f,_0x1ef139){return db[_0x0706('0x29')][_0x0706('0x46')]({'where':{'id':_0x509c4f[_0x0706('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ef139,null))['then'](removeEntity(_0x1ef139,null))[_0x0706('0x43')](handleError(_0x1ef139,null));};exports[_0x0706('0x49')]=function(_0x4d83af,_0x277374,_0x4125d8){var _0x23f8e9={};var _0x554cd0={};var _0x3a83ca;var _0x39edf9;return db[_0x0706('0x29')]['findOne']({'where':{'id':_0x4d83af['params']['id']}})[_0x0706('0x22')](handleEntityNotFound(_0x277374,null))[_0x0706('0x22')](function(_0x552ce0){if(_0x552ce0){_0x3a83ca=_0x552ce0;_0x554cd0[_0x0706('0x34')]=_['keys'](db[_0x0706('0x4a')][_0x0706('0x2a')]);_0x554cd0[_0x0706('0x2f')]=_['keys'](_0x4d83af[_0x0706('0x2f')]);_0x554cd0[_0x0706('0x39')]=_[_0x0706('0x30')](_0x554cd0[_0x0706('0x34')],_0x554cd0[_0x0706('0x2f')]);_0x23f8e9[_0x0706('0x31')]=_[_0x0706('0x30')](_0x554cd0['model'],qs[_0x0706('0x32')](_0x4d83af[_0x0706('0x2f')][_0x0706('0x32')]));_0x23f8e9[_0x0706('0x31')]=_0x23f8e9[_0x0706('0x31')][_0x0706('0x33')]?_0x23f8e9['attributes']:_0x554cd0[_0x0706('0x34')];_0x23f8e9[_0x0706('0x4b')]=qs[_0x0706('0x37')](_0x4d83af['query']['sort']);_0x23f8e9['where']=qs[_0x0706('0x39')](_[_0x0706('0x3a')](_0x4d83af['query'],_0x554cd0[_0x0706('0x39')]));if(_0x4d83af[_0x0706('0x2f')][_0x0706('0x3b')]){_0x23f8e9[_0x0706('0x38')]=_['merge'](_0x23f8e9[_0x0706('0x38')],{'$or':_['map'](_0x23f8e9[_0x0706('0x31')],function(_0x46d2f8){var _0x44ea21={};_0x44ea21[_0x46d2f8]={'$like':'%'+_0x4d83af[_0x0706('0x2f')][_0x0706('0x3b')]+'%'};return _0x44ea21;})});}_0x23f8e9=_[_0x0706('0x3c')]({},_0x23f8e9,_0x4d83af['options']);return _0x3a83ca[_0x0706('0x49')](_0x23f8e9);}})[_0x0706('0x22')](function(_0x3579a5){if(_0x3579a5){_0x39edf9=_0x3579a5[_0x0706('0x33')];if(!_0x4d83af['query'][_0x0706('0x35')](_0x0706('0x36'))){_0x23f8e9[_0x0706('0x1d')]=qs[_0x0706('0x1d')](_0x4d83af['query'][_0x0706('0x1d')]);_0x23f8e9['offset']=qs[_0x0706('0x1a')](_0x4d83af[_0x0706('0x2f')][_0x0706('0x1a')]);}return _0x3a83ca[_0x0706('0x49')](_0x23f8e9);}})[_0x0706('0x22')](function(_0x24df85){if(_0x24df85){return _0x24df85?{'count':_0x39edf9,'rows':_0x24df85}:null;}})[_0x0706('0x22')](respondWithResult(_0x277374,null))['catch'](handleError(_0x277374,null));};exports['getSubjects']=function(_0x5d6dba,_0x417f2f,_0xdaa84){var _0x28c863={};var _0xd50e8f={};var _0x23fdf3;var _0x9d944e;return db[_0x0706('0x29')][_0x0706('0x4c')]({'where':{'id':_0x5d6dba[_0x0706('0x45')]['id']}})[_0x0706('0x22')](handleEntityNotFound(_0x417f2f,null))[_0x0706('0x22')](function(_0x1c160d){if(_0x1c160d){_0x23fdf3=_0x1c160d;_0xd50e8f[_0x0706('0x34')]=_[_0x0706('0x2e')](db[_0x0706('0x4a')]['rawAttributes']);_0xd50e8f['query']=_[_0x0706('0x2e')](_0x5d6dba['query']);_0xd50e8f[_0x0706('0x39')]=_[_0x0706('0x30')](_0xd50e8f['model'],_0xd50e8f[_0x0706('0x2f')]);_0x28c863[_0x0706('0x31')]=_[_0x0706('0x30')](_0xd50e8f['model'],qs[_0x0706('0x32')](_0x5d6dba[_0x0706('0x2f')][_0x0706('0x32')]));_0x28c863['attributes']=_0x28c863['attributes'][_0x0706('0x33')]?_0x28c863['attributes']:_0xd50e8f['model'];_0x28c863[_0x0706('0x4b')]=qs[_0x0706('0x37')](_0x5d6dba[_0x0706('0x2f')][_0x0706('0x37')]);_0x28c863[_0x0706('0x38')]=qs[_0x0706('0x39')](_[_0x0706('0x3a')](_0x5d6dba[_0x0706('0x2f')],_0xd50e8f[_0x0706('0x39')]));if(_0x5d6dba[_0x0706('0x2f')][_0x0706('0x3b')]){_0x28c863[_0x0706('0x38')]=_[_0x0706('0x3c')](_0x28c863[_0x0706('0x38')],{'$or':_[_0x0706('0x28')](_0x28c863[_0x0706('0x31')],function(_0x363d24){var _0x9fb03f={};_0x9fb03f[_0x363d24]={'$like':'%'+_0x5d6dba[_0x0706('0x2f')][_0x0706('0x3b')]+'%'};return _0x9fb03f;})});}_0x28c863=_['merge']({},_0x28c863,_0x5d6dba[_0x0706('0x3e')]);return _0x23fdf3[_0x0706('0x4d')](_0x28c863);}})[_0x0706('0x22')](function(_0x3e5b5f){if(_0x3e5b5f){_0x9d944e=_0x3e5b5f[_0x0706('0x33')];if(!_0x5d6dba[_0x0706('0x2f')][_0x0706('0x35')](_0x0706('0x36'))){_0x28c863[_0x0706('0x1d')]=qs[_0x0706('0x1d')](_0x5d6dba[_0x0706('0x2f')][_0x0706('0x1d')]);_0x28c863[_0x0706('0x1a')]=qs[_0x0706('0x1a')](_0x5d6dba[_0x0706('0x2f')][_0x0706('0x1a')]);}return _0x23fdf3[_0x0706('0x4d')](_0x28c863);}})[_0x0706('0x22')](function(_0x1a97bf){if(_0x1a97bf){return _0x1a97bf?{'count':_0x9d944e,'rows':_0x1a97bf}:null;}})[_0x0706('0x22')](respondWithResult(_0x417f2f,null))['catch'](handleError(_0x417f2f,null));};exports[_0x0706('0x4e')]=function(_0x12d031,_0x5de171,_0x2f286d){var _0x13a4bc={};var _0x1e2e1a={};var _0x20a073;var _0x338502;return db[_0x0706('0x29')][_0x0706('0x4c')]({'where':{'id':_0x12d031[_0x0706('0x45')]['id']}})['then'](handleEntityNotFound(_0x5de171,null))[_0x0706('0x22')](function(_0x2e447e){if(_0x2e447e){_0x20a073=_0x2e447e;_0x1e2e1a[_0x0706('0x34')]=_[_0x0706('0x2e')](db[_0x0706('0x4a')][_0x0706('0x2a')]);_0x1e2e1a[_0x0706('0x2f')]=_[_0x0706('0x2e')](_0x12d031[_0x0706('0x2f')]);_0x1e2e1a[_0x0706('0x39')]=_[_0x0706('0x30')](_0x1e2e1a[_0x0706('0x34')],_0x1e2e1a[_0x0706('0x2f')]);_0x13a4bc['attributes']=_[_0x0706('0x30')](_0x1e2e1a[_0x0706('0x34')],qs[_0x0706('0x32')](_0x12d031[_0x0706('0x2f')][_0x0706('0x32')]));_0x13a4bc[_0x0706('0x31')]=_0x13a4bc[_0x0706('0x31')][_0x0706('0x33')]?_0x13a4bc['attributes']:_0x1e2e1a[_0x0706('0x34')];_0x13a4bc[_0x0706('0x4b')]=qs[_0x0706('0x37')](_0x12d031[_0x0706('0x2f')][_0x0706('0x37')]);_0x13a4bc[_0x0706('0x38')]=qs[_0x0706('0x39')](_[_0x0706('0x3a')](_0x12d031[_0x0706('0x2f')],_0x1e2e1a[_0x0706('0x39')]));if(_0x12d031[_0x0706('0x2f')]['filter']){_0x13a4bc[_0x0706('0x38')]=_[_0x0706('0x3c')](_0x13a4bc['where'],{'$or':_[_0x0706('0x28')](_0x13a4bc[_0x0706('0x31')],function(_0xc13db8){var _0x47d14a={};_0x47d14a[_0xc13db8]={'$like':'%'+_0x12d031['query']['filter']+'%'};return _0x47d14a;})});}_0x13a4bc=_[_0x0706('0x3c')]({},_0x13a4bc,_0x12d031[_0x0706('0x3e')]);return _0x20a073['getDescriptions'](_0x13a4bc);}})[_0x0706('0x22')](function(_0x2d583a){if(_0x2d583a){_0x338502=_0x2d583a['length'];if(!_0x12d031[_0x0706('0x2f')][_0x0706('0x35')](_0x0706('0x36'))){_0x13a4bc[_0x0706('0x1d')]=qs[_0x0706('0x1d')](_0x12d031[_0x0706('0x2f')][_0x0706('0x1d')]);_0x13a4bc[_0x0706('0x1a')]=qs['offset'](_0x12d031['query'][_0x0706('0x1a')]);}return _0x20a073['getDescriptions'](_0x13a4bc);}})[_0x0706('0x22')](function(_0x3acd5a){if(_0x3acd5a){return _0x3acd5a?{'count':_0x338502,'rows':_0x3acd5a}:null;}})[_0x0706('0x22')](respondWithResult(_0x5de171,null))[_0x0706('0x43')](handleError(_0x5de171,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b370021..de3c3f6 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 _0x63ad=['rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','util','../../config/logger','path'];(function(_0x4537b4,_0x188476){var _0x5ea5eb=function(_0x399783){while(--_0x399783){_0x4537b4['push'](_0x4537b4['shift']());}};_0x5ea5eb(++_0x188476);}(_0x63ad,0x7d));var _0xd63a=function(_0x5c2ae1,_0x219538){_0x5c2ae1=_0x5c2ae1-0x0;var _0x234373=_0x63ad[_0x5c2ae1];return _0x234373;};'use strict';var _=require('lodash');var util=require(_0xd63a('0x0'));var logger=require(_0xd63a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd63a('0x2'));var rimraf=require(_0xd63a('0x3'));var config=require('../../config/environment');var attributes=require(_0xd63a('0x4'));module[_0xd63a('0x5')]=function(_0x32e509,_0xcfe533){return _0x32e509[_0xd63a('0x6')](_0xd63a('0x7'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe605=['exports','define','int_servicenow_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x37f0a5,_0x368e07){var _0x444e15=function(_0x4ddb96){while(--_0x4ddb96){_0x37f0a5['push'](_0x37f0a5['shift']());}};_0x444e15(++_0x368e07);}(_0xe605,0x92));var _0x5e60=function(_0x5d2518,_0x3e1346){_0x5d2518=_0x5d2518-0x0;var _0x33be7e=_0xe605[_0x5d2518];return _0x33be7e;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var logger=require('../../config/logger')(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var BPromise=require(_0x5e60('0x4'));var rp=require(_0x5e60('0x5'));var fs=require('fs');var path=require(_0x5e60('0x6'));var rimraf=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var attributes=require(_0x5e60('0x9'));module[_0x5e60('0xa')]=function(_0xc41535,_0x1d4a08){return _0xc41535[_0x5e60('0xb')]('ServicenowConfiguration',attributes,{'tableName':_0x5e60('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 ac4bc01..61c3367 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 _0x60ed=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x52f2a2,_0x39aacf){var _0x13d2e5=function(_0x2615bd){while(--_0x2615bd){_0x52f2a2['push'](_0x52f2a2['shift']());}};_0x13d2e5(++_0x39aacf);}(_0x60ed,0x73));var _0xd60e=function(_0x486b2f,_0x2f1e95){_0x486b2f=_0x486b2f-0x0;var _0x2070d5=_0x60ed[_0x486b2f];return _0x2070d5;};'use strict';var _=require(_0xd60e('0x0'));var util=require(_0xd60e('0x1'));var moment=require(_0xd60e('0x2'));var BPromise=require(_0xd60e('0x3'));var rs=require(_0xd60e('0x4'));var fs=require('fs');var Redis=require(_0xd60e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd60e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd60e('0x7')][_0xd60e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3adc23,_0x47b2bf,_0x7988cb){return new BPromise(function(_0xa3aac7,_0xc22bc1){return client['request'](_0x3adc23,_0x7988cb)[_0xd60e('0x9')](function(_0x1ca561){logger[_0xd60e('0xa')](_0xd60e('0xb'),_0x47b2bf,_0xd60e('0xc'));logger[_0xd60e('0xd')](_0xd60e('0xe'),_0x47b2bf,_0xd60e('0xc'),JSON['stringify'](_0x1ca561));if(_0x1ca561[_0xd60e('0xf')]){if(_0x1ca561[_0xd60e('0xf')][_0xd60e('0x10')]===0x1f4){logger[_0xd60e('0xf')](_0xd60e('0xb'),_0x47b2bf,_0x1ca561[_0xd60e('0xf')][_0xd60e('0x11')]);return _0xc22bc1(_0x1ca561['error'][_0xd60e('0x11')]);}logger['error'](_0xd60e('0xb'),_0x47b2bf,_0x1ca561[_0xd60e('0xf')][_0xd60e('0x11')]);return _0xa3aac7(_0x1ca561[_0xd60e('0xf')][_0xd60e('0x11')]);}else{logger[_0xd60e('0xa')](_0xd60e('0xb'),_0x47b2bf,_0xd60e('0xc'));_0xa3aac7(_0x1ca561['result'][_0xd60e('0x11')]);}})[_0xd60e('0x12')](function(_0x2dfb82){logger[_0xd60e('0xf')](_0xd60e('0xb'),_0x47b2bf,_0x2dfb82);_0xc22bc1(_0x2dfb82);});});} \ No newline at end of file +var _0x6033=['catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result'];(function(_0x382dcc,_0x25c6cc){var _0x4b280f=function(_0x1de3d5){while(--_0x1de3d5){_0x382dcc['push'](_0x382dcc['shift']());}};_0x4b280f(++_0x25c6cc);}(_0x6033,0x177));var _0x3603=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6033[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x3603('0x0'));var moment=require('moment');var BPromise=require(_0x3603('0x1'));var rs=require(_0x3603('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3603('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3603('0x4'))(_0x3603('0x5'));var config=require(_0x3603('0x6'));var jayson=require(_0x3603('0x7'));var client=jayson[_0x3603('0x8')][_0x3603('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x499eac,_0x166b62,_0x1d0dc5){return new BPromise(function(_0x39fb08,_0x41675c){return client[_0x3603('0xa')](_0x499eac,_0x1d0dc5)[_0x3603('0xb')](function(_0x2a8ae5){logger[_0x3603('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x166b62,_0x3603('0xd'));logger[_0x3603('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x166b62,_0x3603('0xd'),JSON[_0x3603('0xf')](_0x2a8ae5));if(_0x2a8ae5[_0x3603('0x10')]){if(_0x2a8ae5[_0x3603('0x10')][_0x3603('0x11')]===0x1f4){logger['error'](_0x3603('0x12'),_0x166b62,_0x2a8ae5[_0x3603('0x10')][_0x3603('0x13')]);return _0x41675c(_0x2a8ae5[_0x3603('0x10')][_0x3603('0x13')]);}logger[_0x3603('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x166b62,_0x2a8ae5[_0x3603('0x10')][_0x3603('0x13')]);return _0x39fb08(_0x2a8ae5[_0x3603('0x10')][_0x3603('0x13')]);}else{logger[_0x3603('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x166b62,_0x3603('0xd'));_0x39fb08(_0x2a8ae5[_0x3603('0x14')][_0x3603('0x13')]);}})[_0x3603('0x15')](function(_0x29d992){logger['error'](_0x3603('0x12'),_0x166b62,_0x29d992);_0x41675c(_0x29d992);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 0aa90f6..a12fcec 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 _0xa293=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x336e33,_0x527fa3){var _0x6c333a=function(_0x48dabd){while(--_0x48dabd){_0x336e33['push'](_0x336e33['shift']());}};_0x6c333a(++_0x527fa3);}(_0xa293,0x7f));var _0x3a29=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa293[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x3a29('0x0'));var util=require(_0x3a29('0x1'));var path=require(_0x3a29('0x2'));var timeout=require(_0x3a29('0x3'));var express=require(_0x3a29('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3a29('0x5'));var config=require(_0x3a29('0x6'));var controller=require(_0x3a29('0x7'));router[_0x3a29('0x8')]('/',auth[_0x3a29('0x9')](),controller[_0x3a29('0xa')]);router[_0x3a29('0x8')](_0x3a29('0xb'),auth[_0x3a29('0x9')](),controller[_0x3a29('0xc')]);router['post']('/',auth[_0x3a29('0x9')](),controller[_0x3a29('0xd')]);router[_0x3a29('0xe')](_0x3a29('0xb'),auth[_0x3a29('0x9')](),controller[_0x3a29('0xf')]);router[_0x3a29('0x10')](_0x3a29('0xb'),auth[_0x3a29('0x9')](),controller['destroy']);module[_0x3a29('0x11')]=router; \ No newline at end of file +var _0xbd27=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','create','put','update','delete','/:id','destroy','exports','multer','express','Router','fs-extra'];(function(_0x478379,_0x4f8455){var _0x4b1d00=function(_0x313cdf){while(--_0x313cdf){_0x478379['push'](_0x478379['shift']());}};_0x4b1d00(++_0x4f8455);}(_0xbd27,0x152));var _0x7bd2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbd27[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x7bd2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7bd2('0x1'));var router=express[_0x7bd2('0x2')]();var fs_extra=require(_0x7bd2('0x3'));var auth=require(_0x7bd2('0x4'));var interaction=require(_0x7bd2('0x5'));var config=require(_0x7bd2('0x6'));var controller=require(_0x7bd2('0x7'));router[_0x7bd2('0x8')]('/',auth[_0x7bd2('0x9')](),controller[_0x7bd2('0xa')]);router[_0x7bd2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7bd2('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7bd2('0xc')]);router[_0x7bd2('0xd')]('/:id',auth[_0x7bd2('0x9')](),controller[_0x7bd2('0xe')]);router[_0x7bd2('0xf')](_0x7bd2('0x10'),auth[_0x7bd2('0x9')](),controller[_0x7bd2('0x11')]);module[_0x7bd2('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 2eab86f..b4320d0 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 _0x4ef5=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize','exports'];(function(_0x58f20b,_0x277c99){var _0x480fce=function(_0x50965f){while(--_0x50965f){_0x58f20b['push'](_0x58f20b['shift']());}};_0x480fce(++_0x277c99);}(_0x4ef5,0x1c9));var _0x54ef=function(_0x1e5496,_0xc5ff9b){_0x1e5496=_0x1e5496-0x0;var _0x40ddf7=_0x4ef5[_0x1e5496];return _0x40ddf7;};'use strict';var Sequelize=require(_0x54ef('0x0'));module[_0x54ef('0x1')]={'type':{'type':Sequelize[_0x54ef('0x2')](_0x54ef('0x3'),'variable',_0x54ef('0x4'),_0x54ef('0x5'),_0x54ef('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x54ef('0x7')]},'key':{'type':Sequelize[_0x54ef('0x7')]},'keyType':{'type':Sequelize[_0x54ef('0x2')]('string',_0x54ef('0x8'),_0x54ef('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x54ef('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x54ef('0x7')]}}; \ No newline at end of file +var _0xc74e=['string','STRING','variable','sequelize','exports','ENUM','keyValue'];(function(_0x495b31,_0x44c289){var _0x3e8757=function(_0x426e4e){while(--_0x426e4e){_0x495b31['push'](_0x495b31['shift']());}};_0x3e8757(++_0x44c289);}(_0xc74e,0x184));var _0xec74=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc74e[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xec74('0x0'));module[_0xec74('0x1')]={'type':{'type':Sequelize[_0xec74('0x2')]('string','variable','customVariable',_0xec74('0x3'),'picklist'),'defaultValue':_0xec74('0x4')},'content':{'type':Sequelize[_0xec74('0x5')]},'key':{'type':Sequelize[_0xec74('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0xec74('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xec74('0x5')]},'nameField':{'type':Sequelize[_0xec74('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xec74('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 22735a1..f2dba53 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 _0x84c7=['merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x589d94,_0x535515){var _0x124ed8=function(_0x3ac327){while(--_0x3ac327){_0x589d94['push'](_0x589d94['shift']());}};_0x124ed8(++_0x535515);}(_0x84c7,0xa4));var _0x784c=function(_0x4ff53c,_0x221bf0){_0x4ff53c=_0x4ff53c-0x0;var _0x46b18f=_0x84c7[_0x4ff53c];return _0x46b18f;};'use strict';var emlformat=require(_0x784c('0x0'));var rimraf=require(_0x784c('0x1'));var zipdir=require(_0x784c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x784c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x784c('0x4'));var util=require(_0x784c('0x5'));var path=require(_0x784c('0x6'));var sox=require('sox');var csv=require(_0x784c('0x7'));var ejs=require(_0x784c('0x8'));var fs=require('fs');var fs_extra=require(_0x784c('0x9'));var _=require('lodash');var squel=require(_0x784c('0xa'));var crypto=require(_0x784c('0xb'));var jsforce=require(_0x784c('0xc'));var deskjs=require(_0x784c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x784c('0xe'));var Papa=require('papaparse');var Redis=require(_0x784c('0xf'));var authService=require(_0x784c('0x10'));var qs=require(_0x784c('0x11'));var as=require(_0x784c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x784c('0x13'))('api');var utils=require(_0x784c('0x14'));var config=require(_0x784c('0x15'));var licenseUtil=require(_0x784c('0x16'));var db=require(_0x784c('0x17'))['db'];function respondWithStatusCode(_0x15028c,_0x28510c){_0x28510c=_0x28510c||0xcc;return function(_0x511982){if(_0x511982){return _0x15028c['sendStatus'](_0x28510c);}return _0x15028c[_0x784c('0x18')](_0x28510c)['end']();};}function respondWithResult(_0x20623c,_0xf43f2){_0xf43f2=_0xf43f2||0xc8;return function(_0x4656a5){if(_0x4656a5){return _0x20623c[_0x784c('0x18')](_0xf43f2)['json'](_0x4656a5);}};}function respondWithFilteredResult(_0x45ad23,_0x4b97a6){return function(_0x3f7845){if(_0x3f7845){var _0x118da0=typeof _0x4b97a6['offset']===_0x784c('0x19')&&typeof _0x4b97a6['limit']===_0x784c('0x19');var _0xa7402e=_0x3f7845[_0x784c('0x1a')];var _0x2f0d67=_0x118da0?0x0:_0x4b97a6['offset'];var _0x436c95=_0x118da0?_0x3f7845['count']:_0x4b97a6[_0x784c('0x1b')]+_0x4b97a6[_0x784c('0x1c')];var _0x6a12e7;if(_0x436c95>=_0xa7402e){_0x436c95=_0xa7402e;_0x6a12e7=0xc8;}else{_0x6a12e7=0xce;}_0x45ad23['status'](_0x6a12e7);return _0x45ad23[_0x784c('0x1d')](_0x784c('0x1e'),_0x2f0d67+'-'+_0x436c95+'/'+_0xa7402e)[_0x784c('0x1f')](_0x3f7845);}return null;};}function patchUpdates(_0x3c14ee){return function(_0x2db7d1){try{jsonpatch[_0x784c('0x20')](_0x2db7d1,_0x3c14ee,!![]);}catch(_0x56f18e){return BPromise[_0x784c('0x21')](_0x56f18e);}return _0x2db7d1[_0x784c('0x22')]();};}function saveUpdates(_0x144c6b,_0x5d8d3d){return function(_0x3b048c){if(_0x3b048c){return _0x3b048c[_0x784c('0x23')](_0x144c6b)[_0x784c('0x24')](function(_0x786bdf){return _0x786bdf;});}return null;};}function removeEntity(_0x4c2ccf,_0x4d494c){return function(_0x3a97e2){if(_0x3a97e2){return _0x3a97e2[_0x784c('0x25')]()['then'](function(){_0x4c2ccf[_0x784c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b111,_0x5a6835){return function(_0x3a268c){if(!_0x3a268c){_0x17b111[_0x784c('0x26')](0x194);}return _0x3a268c;};}function handleError(_0x4d8ed0,_0x434c88){_0x434c88=_0x434c88||0x1f4;return function(_0x36cfdc){logger[_0x784c('0x27')](_0x36cfdc[_0x784c('0x28')]);if(_0x36cfdc[_0x784c('0x29')]){delete _0x36cfdc[_0x784c('0x29')];}_0x4d8ed0[_0x784c('0x18')](_0x434c88)[_0x784c('0x2a')](_0x36cfdc);};}exports[_0x784c('0x2b')]=function(_0x1bdadf,_0x1a5524){var _0x56aeb0={},_0x495616={},_0xeef40={'count':0x0,'rows':[]};var _0x166138=_[_0x784c('0x2c')](db[_0x784c('0x2d')][_0x784c('0x2e')],function(_0xa9df5f){return{'name':_0xa9df5f[_0x784c('0x2f')],'type':_0xa9df5f[_0x784c('0x30')]['key']};});_0x495616[_0x784c('0x31')]=_[_0x784c('0x2c')](_0x166138,'name');_0x495616[_0x784c('0x32')]=_[_0x784c('0x33')](_0x1bdadf[_0x784c('0x32')]);_0x495616[_0x784c('0x34')]=_[_0x784c('0x35')](_0x495616[_0x784c('0x31')],_0x495616['query']);_0x56aeb0[_0x784c('0x36')]=_[_0x784c('0x35')](_0x495616['model'],qs['fields'](_0x1bdadf[_0x784c('0x32')][_0x784c('0x37')]));_0x56aeb0['attributes']=_0x56aeb0[_0x784c('0x36')][_0x784c('0x38')]?_0x56aeb0[_0x784c('0x36')]:_0x495616[_0x784c('0x31')];if(!_0x1bdadf[_0x784c('0x32')][_0x784c('0x39')](_0x784c('0x3a'))){_0x56aeb0[_0x784c('0x1c')]=qs[_0x784c('0x1c')](_0x1bdadf[_0x784c('0x32')][_0x784c('0x1c')]);_0x56aeb0[_0x784c('0x1b')]=qs['offset'](_0x1bdadf['query']['offset']);}_0x56aeb0[_0x784c('0x3b')]=qs['sort'](_0x1bdadf[_0x784c('0x32')][_0x784c('0x3c')]);_0x56aeb0[_0x784c('0x3d')]=qs[_0x784c('0x34')](_[_0x784c('0x3e')](_0x1bdadf['query'],_0x495616[_0x784c('0x34')]),_0x166138);if(_0x1bdadf[_0x784c('0x32')][_0x784c('0x3f')]){_0x56aeb0['where']=_[_0x784c('0x40')](_0x56aeb0['where'],{'$or':_['map'](_0x166138,function(_0x2e7d33){if(_0x2e7d33[_0x784c('0x30')]!==_0x784c('0x41')){var _0x23cebd={};_0x23cebd[_0x2e7d33[_0x784c('0x29')]]={'$like':'%'+_0x1bdadf[_0x784c('0x32')]['filter']+'%'};return _0x23cebd;}})});}_0x56aeb0=_['merge']({},_0x56aeb0,_0x1bdadf[_0x784c('0x42')]);var _0x1c94bb={'where':_0x56aeb0['where']};return db[_0x784c('0x2d')][_0x784c('0x1a')](_0x1c94bb)['then'](function(_0x3ca70a){_0xeef40[_0x784c('0x1a')]=_0x3ca70a;if(_0x1bdadf['query']['includeAll']){_0x56aeb0[_0x784c('0x43')]=[{'all':!![]}];}return db['ServicenowField'][_0x784c('0x44')](_0x56aeb0);})['then'](function(_0x1875fd){_0xeef40['rows']=_0x1875fd;return _0xeef40;})[_0x784c('0x24')](respondWithFilteredResult(_0x1a5524,_0x56aeb0))[_0x784c('0x45')](handleError(_0x1a5524,null));};exports[_0x784c('0x46')]=function(_0x176ad5,_0x28c896){var _0x3ffb37={'raw':!![],'where':{'id':_0x176ad5['params']['id']}},_0x1be0a5={};_0x1be0a5[_0x784c('0x31')]=_[_0x784c('0x33')](db[_0x784c('0x2d')][_0x784c('0x2e')]);_0x1be0a5[_0x784c('0x32')]=_[_0x784c('0x33')](_0x176ad5[_0x784c('0x32')]);_0x1be0a5[_0x784c('0x34')]=_[_0x784c('0x35')](_0x1be0a5[_0x784c('0x31')],_0x1be0a5['query']);_0x3ffb37[_0x784c('0x36')]=_[_0x784c('0x35')](_0x1be0a5[_0x784c('0x31')],qs[_0x784c('0x37')](_0x176ad5['query']['fields']));_0x3ffb37[_0x784c('0x36')]=_0x3ffb37['attributes'][_0x784c('0x38')]?_0x3ffb37['attributes']:_0x1be0a5[_0x784c('0x31')];if(_0x176ad5['query'][_0x784c('0x47')]){_0x3ffb37[_0x784c('0x43')]=[{'all':!![]}];}_0x3ffb37=_[_0x784c('0x40')]({},_0x3ffb37,_0x176ad5['options']);return db[_0x784c('0x2d')][_0x784c('0x48')](_0x3ffb37)[_0x784c('0x24')](handleEntityNotFound(_0x28c896,null))['then'](respondWithResult(_0x28c896,null))[_0x784c('0x45')](handleError(_0x28c896,null));};exports[_0x784c('0x49')]=function(_0x422de5,_0x1c0114){return db[_0x784c('0x2d')]['create'](_0x422de5[_0x784c('0x4a')],{})['then'](respondWithResult(_0x1c0114,0xc9))[_0x784c('0x45')](handleError(_0x1c0114,null));};exports[_0x784c('0x23')]=function(_0x2e62da,_0x34699b){if(_0x2e62da[_0x784c('0x4a')]['id']){delete _0x2e62da[_0x784c('0x4a')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x2e62da['params']['id']}})[_0x784c('0x24')](handleEntityNotFound(_0x34699b,null))[_0x784c('0x24')](saveUpdates(_0x2e62da['body'],null))[_0x784c('0x24')](respondWithResult(_0x34699b,null))[_0x784c('0x45')](handleError(_0x34699b,null));};exports['destroy']=function(_0x21591c,_0x527ecb){return db[_0x784c('0x2d')]['find']({'where':{'id':_0x21591c[_0x784c('0x4b')]['id']}})[_0x784c('0x24')](handleEntityNotFound(_0x527ecb,null))['then'](removeEntity(_0x527ecb,null))[_0x784c('0x45')](handleError(_0x527ecb,null));}; \ No newline at end of file +var _0xf280=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','type','model','query','keys','filters'];(function(_0x15f2b9,_0x5bdd5c){var _0x56c53f=function(_0x2f9d14){while(--_0x2f9d14){_0x15f2b9['push'](_0x15f2b9['shift']());}};_0x56c53f(++_0x5bdd5c);}(_0xf280,0xab));var _0x0f28=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xf280[_0x179e11];return _0x549f04;};'use strict';var emlformat=require(_0x0f28('0x0'));var rimraf=require(_0x0f28('0x1'));var zipdir=require(_0x0f28('0x2'));var jsonpatch=require(_0x0f28('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0f28('0x4'));var Mustache=require(_0x0f28('0x5'));var util=require(_0x0f28('0x6'));var path=require(_0x0f28('0x7'));var sox=require(_0x0f28('0x8'));var csv=require(_0x0f28('0x9'));var ejs=require(_0x0f28('0xa'));var fs=require('fs');var fs_extra=require(_0x0f28('0xb'));var _=require(_0x0f28('0xc'));var squel=require(_0x0f28('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0f28('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f28('0xf'));var Papa=require('papaparse');var Redis=require(_0x0f28('0x10'));var authService=require(_0x0f28('0x11'));var qs=require(_0x0f28('0x12'));var as=require(_0x0f28('0x13'));var hardwareService=require(_0x0f28('0x14'));var logger=require('../../config/logger')(_0x0f28('0x15'));var utils=require('../../config/utils');var config=require(_0x0f28('0x16'));var licenseUtil=require(_0x0f28('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x343232,_0xbdca38){_0xbdca38=_0xbdca38||0xcc;return function(_0x49cacc){if(_0x49cacc){return _0x343232[_0x0f28('0x18')](_0xbdca38);}return _0x343232[_0x0f28('0x19')](_0xbdca38)[_0x0f28('0x1a')]();};}function respondWithResult(_0x4c00d6,_0x154ed4){_0x154ed4=_0x154ed4||0xc8;return function(_0x3feae6){if(_0x3feae6){return _0x4c00d6[_0x0f28('0x19')](_0x154ed4)['json'](_0x3feae6);}};}function respondWithFilteredResult(_0x257bac,_0x2f094d){return function(_0x359dca){if(_0x359dca){var _0x11ee52=typeof _0x2f094d[_0x0f28('0x1b')]===_0x0f28('0x1c')&&typeof _0x2f094d['limit']==='undefined';var _0x25837a=_0x359dca[_0x0f28('0x1d')];var _0x552790=_0x11ee52?0x0:_0x2f094d[_0x0f28('0x1b')];var _0x48ed8e=_0x11ee52?_0x359dca['count']:_0x2f094d[_0x0f28('0x1b')]+_0x2f094d[_0x0f28('0x1e')];var _0x429948;if(_0x48ed8e>=_0x25837a){_0x48ed8e=_0x25837a;_0x429948=0xc8;}else{_0x429948=0xce;}_0x257bac[_0x0f28('0x19')](_0x429948);return _0x257bac[_0x0f28('0x1f')](_0x0f28('0x20'),_0x552790+'-'+_0x48ed8e+'/'+_0x25837a)[_0x0f28('0x21')](_0x359dca);}return null;};}function patchUpdates(_0x571045){return function(_0x5b02fd){try{jsonpatch['apply'](_0x5b02fd,_0x571045,!![]);}catch(_0x1084a6){return BPromise[_0x0f28('0x22')](_0x1084a6);}return _0x5b02fd['save']();};}function saveUpdates(_0x521c32,_0x5ac7cd){return function(_0x32d9bb){if(_0x32d9bb){return _0x32d9bb[_0x0f28('0x23')](_0x521c32)['then'](function(_0xff669){return _0xff669;});}return null;};}function removeEntity(_0x421968,_0x517424){return function(_0xbe0986){if(_0xbe0986){return _0xbe0986[_0x0f28('0x24')]()[_0x0f28('0x25')](function(){_0x421968[_0x0f28('0x19')](0xcc)[_0x0f28('0x1a')]();});}};}function handleEntityNotFound(_0x4f6a24,_0x20fd79){return function(_0x52e4b1){if(!_0x52e4b1){_0x4f6a24[_0x0f28('0x18')](0x194);}return _0x52e4b1;};}function handleError(_0x4728de,_0x3acaae){_0x3acaae=_0x3acaae||0x1f4;return function(_0x384e13){logger[_0x0f28('0x26')](_0x384e13[_0x0f28('0x27')]);if(_0x384e13[_0x0f28('0x28')]){delete _0x384e13[_0x0f28('0x28')];}_0x4728de['status'](_0x3acaae)[_0x0f28('0x29')](_0x384e13);};}exports[_0x0f28('0x2a')]=function(_0x44469f,_0x7bf9a8){var _0x13b1e2={},_0x3202aa={},_0x36e52d={'count':0x0,'rows':[]};var _0x8bd2ed=_[_0x0f28('0x2b')](db[_0x0f28('0x2c')][_0x0f28('0x2d')],function(_0x1fd7b9){return{'name':_0x1fd7b9['fieldName'],'type':_0x1fd7b9[_0x0f28('0x2e')]['key']};});_0x3202aa[_0x0f28('0x2f')]=_[_0x0f28('0x2b')](_0x8bd2ed,_0x0f28('0x28'));_0x3202aa[_0x0f28('0x30')]=_[_0x0f28('0x31')](_0x44469f['query']);_0x3202aa[_0x0f28('0x32')]=_[_0x0f28('0x33')](_0x3202aa[_0x0f28('0x2f')],_0x3202aa[_0x0f28('0x30')]);_0x13b1e2['attributes']=_['intersection'](_0x3202aa['model'],qs[_0x0f28('0x34')](_0x44469f[_0x0f28('0x30')][_0x0f28('0x34')]));_0x13b1e2[_0x0f28('0x35')]=_0x13b1e2['attributes'][_0x0f28('0x36')]?_0x13b1e2[_0x0f28('0x35')]:_0x3202aa[_0x0f28('0x2f')];if(!_0x44469f['query'][_0x0f28('0x37')](_0x0f28('0x38'))){_0x13b1e2[_0x0f28('0x1e')]=qs[_0x0f28('0x1e')](_0x44469f[_0x0f28('0x30')][_0x0f28('0x1e')]);_0x13b1e2[_0x0f28('0x1b')]=qs[_0x0f28('0x1b')](_0x44469f[_0x0f28('0x30')][_0x0f28('0x1b')]);}_0x13b1e2[_0x0f28('0x39')]=qs[_0x0f28('0x3a')](_0x44469f['query'][_0x0f28('0x3a')]);_0x13b1e2[_0x0f28('0x3b')]=qs['filters'](_['pick'](_0x44469f[_0x0f28('0x30')],_0x3202aa['filters']),_0x8bd2ed);if(_0x44469f['query'][_0x0f28('0x3c')]){_0x13b1e2[_0x0f28('0x3b')]=_[_0x0f28('0x3d')](_0x13b1e2['where'],{'$or':_[_0x0f28('0x2b')](_0x8bd2ed,function(_0xa7dab9){if(_0xa7dab9[_0x0f28('0x2e')]!==_0x0f28('0x3e')){var _0x32ae44={};_0x32ae44[_0xa7dab9[_0x0f28('0x28')]]={'$like':'%'+_0x44469f[_0x0f28('0x30')][_0x0f28('0x3c')]+'%'};return _0x32ae44;}})});}_0x13b1e2=_[_0x0f28('0x3d')]({},_0x13b1e2,_0x44469f[_0x0f28('0x3f')]);var _0x528819={'where':_0x13b1e2[_0x0f28('0x3b')]};return db[_0x0f28('0x2c')][_0x0f28('0x1d')](_0x528819)[_0x0f28('0x25')](function(_0x5c906b){_0x36e52d[_0x0f28('0x1d')]=_0x5c906b;if(_0x44469f['query'][_0x0f28('0x40')]){_0x13b1e2[_0x0f28('0x41')]=[{'all':!![]}];}return db[_0x0f28('0x2c')][_0x0f28('0x42')](_0x13b1e2);})[_0x0f28('0x25')](function(_0x360e29){_0x36e52d[_0x0f28('0x43')]=_0x360e29;return _0x36e52d;})[_0x0f28('0x25')](respondWithFilteredResult(_0x7bf9a8,_0x13b1e2))[_0x0f28('0x44')](handleError(_0x7bf9a8,null));};exports[_0x0f28('0x45')]=function(_0x4d7555,_0x41cfad){var _0x55a891={'raw':!![],'where':{'id':_0x4d7555[_0x0f28('0x46')]['id']}},_0x3d6397={};_0x3d6397[_0x0f28('0x2f')]=_[_0x0f28('0x31')](db[_0x0f28('0x2c')][_0x0f28('0x2d')]);_0x3d6397['query']=_[_0x0f28('0x31')](_0x4d7555[_0x0f28('0x30')]);_0x3d6397['filters']=_[_0x0f28('0x33')](_0x3d6397[_0x0f28('0x2f')],_0x3d6397[_0x0f28('0x30')]);_0x55a891[_0x0f28('0x35')]=_['intersection'](_0x3d6397[_0x0f28('0x2f')],qs[_0x0f28('0x34')](_0x4d7555[_0x0f28('0x30')][_0x0f28('0x34')]));_0x55a891['attributes']=_0x55a891[_0x0f28('0x35')][_0x0f28('0x36')]?_0x55a891['attributes']:_0x3d6397[_0x0f28('0x2f')];if(_0x4d7555[_0x0f28('0x30')][_0x0f28('0x40')]){_0x55a891['include']=[{'all':!![]}];}_0x55a891=_[_0x0f28('0x3d')]({},_0x55a891,_0x4d7555[_0x0f28('0x3f')]);return db[_0x0f28('0x2c')]['find'](_0x55a891)['then'](handleEntityNotFound(_0x41cfad,null))[_0x0f28('0x25')](respondWithResult(_0x41cfad,null))[_0x0f28('0x44')](handleError(_0x41cfad,null));};exports[_0x0f28('0x47')]=function(_0x37db18,_0x407ced){return db[_0x0f28('0x2c')][_0x0f28('0x47')](_0x37db18[_0x0f28('0x48')],{})[_0x0f28('0x25')](respondWithResult(_0x407ced,0xc9))[_0x0f28('0x44')](handleError(_0x407ced,null));};exports[_0x0f28('0x23')]=function(_0x11f7e7,_0x233f6b){if(_0x11f7e7[_0x0f28('0x48')]['id']){delete _0x11f7e7[_0x0f28('0x48')]['id'];}return db[_0x0f28('0x2c')][_0x0f28('0x49')]({'where':{'id':_0x11f7e7[_0x0f28('0x46')]['id']}})[_0x0f28('0x25')](handleEntityNotFound(_0x233f6b,null))[_0x0f28('0x25')](saveUpdates(_0x11f7e7[_0x0f28('0x48')],null))[_0x0f28('0x25')](respondWithResult(_0x233f6b,null))[_0x0f28('0x44')](handleError(_0x233f6b,null));};exports[_0x0f28('0x24')]=function(_0x3a0ead,_0x571bf1){return db[_0x0f28('0x2c')][_0x0f28('0x49')]({'where':{'id':_0x3a0ead[_0x0f28('0x46')]['id']}})['then'](handleEntityNotFound(_0x571bf1,null))['then'](removeEntity(_0x571bf1,null))[_0x0f28('0x44')](handleError(_0x571bf1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 22fd92d..37d1443 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 _0x9f7d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x23e0db,_0x2ce6fc){var _0x1bad44=function(_0x489c8b){while(--_0x489c8b){_0x23e0db['push'](_0x23e0db['shift']());}};_0x1bad44(++_0x2ce6fc);}(_0x9f7d,0x143));var _0xd9f7=function(_0x1a2e02,_0x1cbc70){_0x1a2e02=_0x1a2e02-0x0;var _0x550bc5=_0x9f7d[_0x1a2e02];return _0x550bc5;};'use strict';var _=require(_0xd9f7('0x0'));var util=require(_0xd9f7('0x1'));var logger=require(_0xd9f7('0x2'))(_0xd9f7('0x3'));var moment=require(_0xd9f7('0x4'));var BPromise=require(_0xd9f7('0x5'));var rp=require(_0xd9f7('0x6'));var fs=require('fs');var path=require(_0xd9f7('0x7'));var rimraf=require(_0xd9f7('0x8'));var config=require(_0xd9f7('0x9'));var attributes=require(_0xd9f7('0xa'));module[_0xd9f7('0xb')]=function(_0x1c1ade,_0x3ff8a7){return _0x1c1ade[_0xd9f7('0xc')](_0xd9f7('0xd'),attributes,{'tableName':_0xd9f7('0xe'),'paranoid':![],'indexes':[{'name':_0xd9f7('0xf'),'fields':[_0xd9f7('0x10'),_0xd9f7('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c9f=['./intServicenowField.attributes','exports','int_servicenow_fields','lodash','util','request-promise','path','rimraf','../../config/environment'];(function(_0x500c02,_0x17afde){var _0x1a1efd=function(_0xa52f03){while(--_0xa52f03){_0x500c02['push'](_0x500c02['shift']());}};_0x1a1efd(++_0x17afde);}(_0x9c9f,0xc9));var _0xf9c9=function(_0x55ef51,_0x425ded){_0x55ef51=_0x55ef51-0x0;var _0x5b98cd=_0x9c9f[_0x55ef51];return _0x5b98cd;};'use strict';var _=require(_0xf9c9('0x0'));var util=require(_0xf9c9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf9c9('0x2'));var fs=require('fs');var path=require(_0xf9c9('0x3'));var rimraf=require(_0xf9c9('0x4'));var config=require(_0xf9c9('0x5'));var attributes=require(_0xf9c9('0x6'));module[_0xf9c9('0x7')]=function(_0x2e6057,_0x425ad9){return _0x2e6057['define']('ServicenowField',attributes,{'tableName':_0xf9c9('0x8'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index cb31942..3505781 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1238e0,_0x16bd9b){_0x1238e0=_0x1238e0-0x0;var _0x59dfc8=_0xbdb7[_0x1238e0];return _0x59dfc8;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _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(_0x58fc56,_0x2b236e){var _0x49a6d3=function(_0x4abad3){while(--_0x4abad3){_0x58fc56['push'](_0x58fc56['shift']());}};_0x49a6d3(++_0x2b236e);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xb7e7[_0xf71120];return _0xbe2fd3;};'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 631bacb..18b0bd4 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(_0x13289a,_0x464236){var _0x13d6be=function(_0x420049){while(--_0x420049){_0x13289a['push'](_0x13289a['shift']());}};_0x13d6be(++_0x464236);}(_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/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(_0x594a40,_0x22c98f){var _0x5b5b76=function(_0x1e502e){while(--_0x1e502e){_0x594a40['push'](_0x594a40['shift']());}};_0x5b5b76(++_0x22c98f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 e239935..eb884ad 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(_0x104318,_0x9080eb){var _0x161104=function(_0x30582c){while(--_0x30582c){_0x104318['push'](_0x104318['shift']());}};_0x161104(++_0x9080eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x4af387,_0x1509c4){var _0x868b4f=function(_0x3db451){while(--_0x3db451){_0x4af387['push'](_0x4af387['shift']());}};_0x868b4f(++_0x1509c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 7d4a533..af02743 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 _0x9034=['lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','offset','count','json','update','then','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','nolimit','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring'];(function(_0x33ed1d,_0x4cc23d){var _0xe103f5=function(_0x5ec520){while(--_0x5ec520){_0x33ed1d['push'](_0x33ed1d['shift']());}};_0xe103f5(++_0x4cc23d);}(_0x9034,0x178));var _0x4903=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9034[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x4903('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4903('0x1'));var jsonpatch=require(_0x4903('0x2'));var rp=require(_0x4903('0x3'));var moment=require(_0x4903('0x4'));var BPromise=require(_0x4903('0x5'));var Mustache=require(_0x4903('0x6'));var util=require(_0x4903('0x7'));var path=require('path');var sox=require(_0x4903('0x8'));var csv=require(_0x4903('0x9'));var ejs=require(_0x4903('0xa'));var fs=require('fs');var fs_extra=require(_0x4903('0xb'));var _=require(_0x4903('0xc'));var squel=require(_0x4903('0xd'));var crypto=require('crypto');var jsforce=require(_0x4903('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4903('0xf'));var Papa=require('papaparse');var Redis=require(_0x4903('0x10'));var authService=require(_0x4903('0x11'));var qs=require(_0x4903('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4903('0x13'));var logger=require(_0x4903('0x14'))(_0x4903('0x15'));var utils=require(_0x4903('0x16'));var config=require(_0x4903('0x17'));var licenseUtil=require(_0x4903('0x18'));var db=require(_0x4903('0x19'))['db'];var integrations=require(_0x4903('0x1a'));function respondWithStatusCode(_0x575ae4,_0x4bdcee){_0x4bdcee=_0x4bdcee||0xcc;return function(_0x4547d0){if(_0x4547d0){return _0x575ae4[_0x4903('0x1b')](_0x4bdcee);}return _0x575ae4[_0x4903('0x1c')](_0x4bdcee)[_0x4903('0x1d')]();};}function respondWithResult(_0x233132,_0x35d992){_0x35d992=_0x35d992||0xc8;return function(_0x5df739){if(_0x5df739){return _0x233132['status'](_0x35d992)['json'](_0x5df739);}};}function respondWithFilteredResult(_0x274aac,_0xad5e76){return function(_0x2c659c){if(_0x2c659c){var _0x8bb29c=typeof _0xad5e76['offset']===_0x4903('0x1e')&&typeof _0xad5e76[_0x4903('0x1f')]==='undefined';var _0x20f2c9=_0x2c659c['count'];var _0x26d48a=_0x8bb29c?0x0:_0xad5e76[_0x4903('0x20')];var _0x2c2029=_0x8bb29c?_0x2c659c[_0x4903('0x21')]:_0xad5e76[_0x4903('0x20')]+_0xad5e76[_0x4903('0x1f')];var _0x5332ee;if(_0x2c2029>=_0x20f2c9){_0x2c2029=_0x20f2c9;_0x5332ee=0xc8;}else{_0x5332ee=0xce;}_0x274aac[_0x4903('0x1c')](_0x5332ee);return _0x274aac['set']('Content-Range',_0x26d48a+'-'+_0x2c2029+'/'+_0x20f2c9)[_0x4903('0x22')](_0x2c659c);}return null;};}function patchUpdates(_0x14e933){return function(_0x1a0e38){try{jsonpatch['apply'](_0x1a0e38,_0x14e933,!![]);}catch(_0x5e2ae3){return BPromise['reject'](_0x5e2ae3);}return _0x1a0e38['save']();};}function saveUpdates(_0x48e8e4,_0x68f9ba){return function(_0x67d7ff){if(_0x67d7ff){return _0x67d7ff[_0x4903('0x23')](_0x48e8e4)[_0x4903('0x24')](function(_0x5735fc){return _0x5735fc;});}return null;};}function removeEntity(_0x2518f9,_0x3b5a56){return function(_0x231e2e){if(_0x231e2e){return _0x231e2e['destroy']()['then'](function(){_0x2518f9[_0x4903('0x1c')](0xcc)[_0x4903('0x1d')]();});}};}function handleEntityNotFound(_0x1ff1fe,_0x4f9e42){return function(_0x2a7717){if(!_0x2a7717){_0x1ff1fe[_0x4903('0x1b')](0x194);}return _0x2a7717;};}function handleError(_0x311f13,_0x2a96e6){_0x2a96e6=_0x2a96e6||0x1f4;return function(_0x156b1d){logger[_0x4903('0x25')](_0x156b1d[_0x4903('0x26')]);if(_0x156b1d[_0x4903('0x27')]){delete _0x156b1d[_0x4903('0x27')];}_0x311f13['status'](_0x2a96e6)[_0x4903('0x28')](_0x156b1d);};}exports[_0x4903('0x29')]=function(_0x25ef2d,_0xaa9b0b){var _0xe03052={},_0x36b340={},_0x20a90e={'count':0x0,'rows':[]};var _0x58a2dc=_[_0x4903('0x2a')](db[_0x4903('0x2b')][_0x4903('0x2c')],function(_0x2afa58){return{'name':_0x2afa58[_0x4903('0x2d')],'type':_0x2afa58[_0x4903('0x2e')][_0x4903('0x2f')]};});_0x36b340['model']=_['map'](_0x58a2dc,'name');_0x36b340[_0x4903('0x30')]=_[_0x4903('0x31')](_0x25ef2d[_0x4903('0x30')]);_0x36b340[_0x4903('0x32')]=_[_0x4903('0x33')](_0x36b340[_0x4903('0x34')],_0x36b340[_0x4903('0x30')]);_0xe03052['attributes']=_[_0x4903('0x33')](_0x36b340[_0x4903('0x34')],qs[_0x4903('0x35')](_0x25ef2d['query'][_0x4903('0x35')]));_0xe03052['attributes']=_0xe03052['attributes']['length']?_0xe03052[_0x4903('0x36')]:_0x36b340['model'];if(!_0x25ef2d[_0x4903('0x30')]['hasOwnProperty']('nolimit')){_0xe03052['limit']=qs['limit'](_0x25ef2d[_0x4903('0x30')][_0x4903('0x1f')]);_0xe03052['offset']=qs[_0x4903('0x20')](_0x25ef2d[_0x4903('0x30')][_0x4903('0x20')]);}_0xe03052[_0x4903('0x37')]=qs[_0x4903('0x38')](_0x25ef2d[_0x4903('0x30')][_0x4903('0x38')]);_0xe03052[_0x4903('0x39')]=qs[_0x4903('0x32')](_[_0x4903('0x3a')](_0x25ef2d[_0x4903('0x30')],_0x36b340[_0x4903('0x32')]),_0x58a2dc);if(_0x25ef2d['query']['filter']){_0xe03052[_0x4903('0x39')]=_[_0x4903('0x3b')](_0xe03052[_0x4903('0x39')],{'$or':_['map'](_0x58a2dc,function(_0x57d09f){if(_0x57d09f[_0x4903('0x2e')]!=='VIRTUAL'){var _0x2508d1={};_0x2508d1[_0x57d09f[_0x4903('0x27')]]={'$like':'%'+_0x25ef2d[_0x4903('0x30')][_0x4903('0x3c')]+'%'};return _0x2508d1;}})});}_0xe03052=_[_0x4903('0x3b')]({},_0xe03052,_0x25ef2d[_0x4903('0x3d')]);var _0x548bd8={'where':_0xe03052[_0x4903('0x39')]};return db['SugarcrmAccount']['count'](_0x548bd8)['then'](function(_0x33dba2){_0x20a90e[_0x4903('0x21')]=_0x33dba2;if(_0x25ef2d[_0x4903('0x30')][_0x4903('0x3e')]){_0xe03052[_0x4903('0x3f')]=[{'all':!![]}];}return db[_0x4903('0x2b')][_0x4903('0x40')](_0xe03052);})[_0x4903('0x24')](function(_0x336f1b){_0x20a90e[_0x4903('0x41')]=_0x336f1b;return _0x20a90e;})[_0x4903('0x24')](respondWithFilteredResult(_0xaa9b0b,_0xe03052))[_0x4903('0x42')](handleError(_0xaa9b0b,null));};exports[_0x4903('0x43')]=function(_0x13f692,_0x55b796){var _0x4bb418={'raw':![],'where':{'id':_0x13f692[_0x4903('0x44')]['id']}},_0x189f9b={};_0x189f9b[_0x4903('0x34')]=_[_0x4903('0x31')](db[_0x4903('0x2b')][_0x4903('0x2c')]);_0x189f9b[_0x4903('0x30')]=_['keys'](_0x13f692['query']);_0x189f9b[_0x4903('0x32')]=_[_0x4903('0x33')](_0x189f9b[_0x4903('0x34')],_0x189f9b[_0x4903('0x30')]);_0x4bb418[_0x4903('0x36')]=_[_0x4903('0x33')](_0x189f9b['model'],qs[_0x4903('0x35')](_0x13f692[_0x4903('0x30')][_0x4903('0x35')]));_0x4bb418[_0x4903('0x36')]=_0x4bb418[_0x4903('0x36')][_0x4903('0x45')]?_0x4bb418[_0x4903('0x36')]:_0x189f9b['model'];if(_0x13f692[_0x4903('0x30')][_0x4903('0x3e')]){_0x4bb418['include']=[{'all':!![]}];}_0x4bb418=_['merge']({},_0x4bb418,_0x13f692['options']);return db['SugarcrmAccount']['find'](_0x4bb418)['then'](handleEntityNotFound(_0x55b796,null))['then'](respondWithResult(_0x55b796,null))['catch'](handleError(_0x55b796,null));};exports[_0x4903('0x46')]=function(_0x48921e,_0x52519f){return db[_0x4903('0x2b')]['create'](_0x48921e['body'],{})[_0x4903('0x24')](respondWithResult(_0x52519f,0xc9))[_0x4903('0x42')](handleError(_0x52519f,null));};exports[_0x4903('0x23')]=function(_0x24ed59,_0x3fdaa0){if(_0x24ed59[_0x4903('0x47')]['id']){delete _0x24ed59[_0x4903('0x47')]['id'];}return db[_0x4903('0x2b')][_0x4903('0x48')]({'where':{'id':_0x24ed59[_0x4903('0x44')]['id']}})[_0x4903('0x24')](handleEntityNotFound(_0x3fdaa0,null))[_0x4903('0x24')](saveUpdates(_0x24ed59[_0x4903('0x47')],null))[_0x4903('0x24')](respondWithResult(_0x3fdaa0,null))[_0x4903('0x42')](handleError(_0x3fdaa0,null));};exports['destroy']=function(_0x2679cb,_0x4f307a){return db[_0x4903('0x2b')][_0x4903('0x48')]({'where':{'id':_0x2679cb[_0x4903('0x44')]['id']}})[_0x4903('0x24')](handleEntityNotFound(_0x4f307a,null))[_0x4903('0x24')](removeEntity(_0x4f307a,null))['catch'](handleError(_0x4f307a,null));};exports[_0x4903('0x49')]=function(_0x1d0046,_0x2bf0f0,_0x3e51bc){var _0x2a0ed0={};var _0x5342e0={};var _0x177523;var _0xb46c45;return db[_0x4903('0x2b')][_0x4903('0x4a')]({'where':{'id':_0x1d0046['params']['id']}})[_0x4903('0x24')](handleEntityNotFound(_0x2bf0f0,null))['then'](function(_0x507552){if(_0x507552){_0x177523=_0x507552;_0x5342e0[_0x4903('0x34')]=_[_0x4903('0x31')](db[_0x4903('0x4b')]['rawAttributes']);_0x5342e0['query']=_[_0x4903('0x31')](_0x1d0046[_0x4903('0x30')]);_0x5342e0[_0x4903('0x32')]=_[_0x4903('0x33')](_0x5342e0['model'],_0x5342e0[_0x4903('0x30')]);_0x2a0ed0[_0x4903('0x36')]=_[_0x4903('0x33')](_0x5342e0[_0x4903('0x34')],qs[_0x4903('0x35')](_0x1d0046[_0x4903('0x30')][_0x4903('0x35')]));_0x2a0ed0['attributes']=_0x2a0ed0[_0x4903('0x36')]['length']?_0x2a0ed0[_0x4903('0x36')]:_0x5342e0[_0x4903('0x34')];_0x2a0ed0[_0x4903('0x37')]=qs[_0x4903('0x38')](_0x1d0046[_0x4903('0x30')]['sort']);_0x2a0ed0[_0x4903('0x39')]=qs[_0x4903('0x32')](_[_0x4903('0x3a')](_0x1d0046[_0x4903('0x30')],_0x5342e0[_0x4903('0x32')]));if(_0x1d0046[_0x4903('0x30')][_0x4903('0x3c')]){_0x2a0ed0[_0x4903('0x39')]=_[_0x4903('0x3b')](_0x2a0ed0['where'],{'$or':_[_0x4903('0x2a')](_0x2a0ed0[_0x4903('0x36')],function(_0x29ee32){var _0x3736e7={};_0x3736e7[_0x29ee32]={'$like':'%'+_0x1d0046[_0x4903('0x30')][_0x4903('0x3c')]+'%'};return _0x3736e7;})});}_0x2a0ed0=_[_0x4903('0x3b')]({},_0x2a0ed0,_0x1d0046[_0x4903('0x3d')]);return _0x177523[_0x4903('0x49')](_0x2a0ed0);}})[_0x4903('0x24')](function(_0x24f067){if(_0x24f067){_0xb46c45=_0x24f067[_0x4903('0x45')];if(!_0x1d0046['query'][_0x4903('0x4c')](_0x4903('0x4d'))){_0x2a0ed0[_0x4903('0x1f')]=qs[_0x4903('0x1f')](_0x1d0046[_0x4903('0x30')][_0x4903('0x1f')]);_0x2a0ed0[_0x4903('0x20')]=qs[_0x4903('0x20')](_0x1d0046[_0x4903('0x30')][_0x4903('0x20')]);}return _0x177523[_0x4903('0x49')](_0x2a0ed0);}})[_0x4903('0x24')](function(_0x29dc85){if(_0x29dc85){return _0x29dc85?{'count':_0xb46c45,'rows':_0x29dc85}:null;}})['then'](respondWithResult(_0x2bf0f0,null))[_0x4903('0x42')](handleError(_0x2bf0f0,null));};exports['addConfiguration']=function(_0x395ff0,_0x12b0af,_0x30bda6){if(_0x395ff0[_0x4903('0x47')]['id']){delete _0x395ff0[_0x4903('0x47')]['id'];}return db['SugarcrmAccount'][_0x4903('0x4a')]({'where':{'id':_0x395ff0[_0x4903('0x44')]['id']}})['then'](handleEntityNotFound(_0x12b0af,null))['then'](function(_0x3a660e){if(_0x3a660e){_0x395ff0[_0x4903('0x47')]['AccountId']=_0x3a660e['id'];_0x395ff0[_0x4903('0x47')][_0x4903('0x4e')]=integrations[_0x4903('0x4f')](_0x395ff0[_0x4903('0x47')][_0x4903('0x50')],_0x395ff0[_0x4903('0x47')][_0x4903('0x2e')]);_0x395ff0[_0x4903('0x47')][_0x4903('0x51')]=integrations['getDescriptions'](_0x395ff0[_0x4903('0x47')][_0x4903('0x50')],_0x395ff0[_0x4903('0x47')][_0x4903('0x2e')]);return db[_0x4903('0x4b')][_0x4903('0x46')](_0x395ff0[_0x4903('0x47')],{'include':[{'model':db['SugarcrmField'],'as':_0x4903('0x4e')},{'model':db[_0x4903('0x52')],'as':'Descriptions'}]});}return null;})[_0x4903('0x24')](respondWithResult(_0x12b0af,null))[_0x4903('0x42')](handleError(_0x12b0af,null));};exports[_0x4903('0x53')]=function(_0x39cfad,_0x5c3e5b,_0x451448){var _0x3ef71c='';var _0x32bfa4=['id',_0x4903('0x27'),_0x4903('0x54'),_0x4903('0x55'),_0x4903('0x56'),_0x4903('0x57'),'duration_hours','duration_minutes',_0x4903('0x58'),_0x4903('0x59'),_0x4903('0x5a'),_0x4903('0x5b')];return db[_0x4903('0x2b')]['findOne']({'where':{'id':_0x39cfad[_0x4903('0x44')]['id']},'attributes':['id',_0x4903('0x5c'),_0x4903('0x5d'),_0x4903('0x5e')]})[_0x4903('0x24')](handleEntityNotFound(_0x5c3e5b,null))[_0x4903('0x24')](function(_0xd358f2){if(_0xd358f2){_0x3ef71c=_0xd358f2[_0x4903('0x5e')];var _0x247690=_0x3ef71c['slice'](-0x1);if(_0x247690==='/'){_0x3ef71c=_0x3ef71c[_0x4903('0x5f')](0x0,_0x3ef71c[_0x4903('0x60')](_0x247690));}return rp({'method':_0x4903('0x61'),'uri':util[_0x4903('0x62')](_0x4903('0x63'),_0x3ef71c,_0x4903('0x64')),'json':!![],'form':{'method':_0x4903('0x65'),'input_type':'JSON','response_type':_0x4903('0x66'),'rest_data':JSON[_0x4903('0x67')]({'user_auth':{'user_name':_0xd358f2[_0x4903('0x5c')],'password':_0xd358f2[_0x4903('0x5d')],'encryption':_0x4903('0x68')},'application':_0x4903('0x69')})}});}})[_0x4903('0x24')](function(_0x5b187e){if(_0x5b187e&&_0x5b187e[_0x4903('0x27')]!==_0x4903('0x6a')&&_0x5b187e['name']!=='Password\x20Expired'){return rp({'method':_0x4903('0x61'),'uri':util[_0x4903('0x62')](_0x4903('0x63'),_0x3ef71c,_0x4903('0x64')),'json':!![],'form':{'method':_0x4903('0x6b'),'input_type':'JSON','response_type':_0x4903('0x66'),'rest_data':JSON[_0x4903('0x67')]({'session':_0x5b187e['id'],'module_name':_0x4903('0x6c')})}})[_0x4903('0x24')](function(_0x1afe05){if(_0x1afe05){var _0x271cb3=_[_0x4903('0x6d')](_0x1afe05[_0x4903('0x6e')]);_['remove'](_0x271cb3,function(_0x50af35){return _0x32bfa4[_0x4903('0x6f')](_0x50af35[_0x4903('0x27')]);});return{'count':_0x271cb3['length'],'rows':_[_0x4903('0x2a')](_0x271cb3,function(_0x35e7a2){return{'id':_0x35e7a2[_0x4903('0x27')],'name':_0x35e7a2[_0x4903('0x70')],'custom':_[_0x4903('0x71')](_0x35e7a2[_0x4903('0x27')],'_c')?!![]:![],'options':_0x35e7a2[_0x4903('0x3d')]?_[_0x4903('0x2a')](_[_0x4903('0x6d')](_0x35e7a2['options']),function(_0x3d2f9b){return{'name':_0x3d2f9b[_0x4903('0x72')],'value':_0x3d2f9b['name']};}):[]};})};}})[_0x4903('0x24')](respondWithResult(_0x5c3e5b,null))[_0x4903('0x42')](function(_0x2c2deb){var _0x4d0733=_0x39cfad[_0x4903('0x30')][_0x4903('0x73')]?0x1f4:_0x2c2deb[_0x4903('0x74')]||0x1f4;logger[_0x4903('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x4903('0x53'),_0x4d0733,JSON[_0x4903('0x67')](_0x2c2deb));delete _0x2c2deb['name'];if(_0x4d0733===0x191){_0x4d0733=0x190;}_0x5c3e5b[_0x4903('0x1c')](_0x4d0733)['send'](_0x39cfad[_0x4903('0x30')][_0x4903('0x73')]?{'message':_0x4903('0x75'),'statusCode':_0x2c2deb[_0x4903('0x74')]}:_0x2c2deb);});}else{var _0x448d7a=0x1f4;_0x5c3e5b['status'](_0x448d7a)[_0x4903('0x28')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x4605=['apply','reject','save','then','destroy','error','stack','name','send','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','SugarcrmAccount','update','body','params','SugarcrmConfiguration','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4605,0x147));var _0x5460=function(_0x231bf2,_0x41bc52){_0x231bf2=_0x231bf2-0x0;var _0x3b99cf=_0x4605[_0x231bf2];return _0x3b99cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5460('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5460('0x1'));var BPromise=require(_0x5460('0x2'));var Mustache=require(_0x5460('0x3'));var util=require('util');var path=require(_0x5460('0x4'));var sox=require('sox');var csv=require(_0x5460('0x5'));var ejs=require(_0x5460('0x6'));var fs=require('fs');var fs_extra=require(_0x5460('0x7'));var _=require(_0x5460('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5460('0x9'));var deskjs=require(_0x5460('0xa'));var toCsv=require(_0x5460('0x5'));var querystring=require(_0x5460('0xb'));var Papa=require(_0x5460('0xc'));var Redis=require('ioredis');var authService=require(_0x5460('0xd'));var qs=require(_0x5460('0xe'));var as=require(_0x5460('0xf'));var hardwareService=require(_0x5460('0x10'));var logger=require(_0x5460('0x11'))(_0x5460('0x12'));var utils=require(_0x5460('0x13'));var config=require(_0x5460('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5460('0x15'))['db'];var integrations=require(_0x5460('0x16'));function respondWithStatusCode(_0x559039,_0x3912f9){_0x3912f9=_0x3912f9||0xcc;return function(_0x18fb65){if(_0x18fb65){return _0x559039[_0x5460('0x17')](_0x3912f9);}return _0x559039[_0x5460('0x18')](_0x3912f9)[_0x5460('0x19')]();};}function respondWithResult(_0xd6cb5e,_0x5c1d3d){_0x5c1d3d=_0x5c1d3d||0xc8;return function(_0x927a96){if(_0x927a96){return _0xd6cb5e[_0x5460('0x18')](_0x5c1d3d)[_0x5460('0x1a')](_0x927a96);}};}function respondWithFilteredResult(_0x22efab,_0x3433ba){return function(_0xd3fb0a){if(_0xd3fb0a){var _0x51776f=typeof _0x3433ba[_0x5460('0x1b')]===_0x5460('0x1c')&&typeof _0x3433ba[_0x5460('0x1d')]==='undefined';var _0x40ef1c=_0xd3fb0a[_0x5460('0x1e')];var _0x3a1ae5=_0x51776f?0x0:_0x3433ba[_0x5460('0x1b')];var _0x4081be=_0x51776f?_0xd3fb0a[_0x5460('0x1e')]:_0x3433ba[_0x5460('0x1b')]+_0x3433ba['limit'];var _0x51da03;if(_0x4081be>=_0x40ef1c){_0x4081be=_0x40ef1c;_0x51da03=0xc8;}else{_0x51da03=0xce;}_0x22efab[_0x5460('0x18')](_0x51da03);return _0x22efab[_0x5460('0x1f')](_0x5460('0x20'),_0x3a1ae5+'-'+_0x4081be+'/'+_0x40ef1c)[_0x5460('0x1a')](_0xd3fb0a);}return null;};}function patchUpdates(_0x35f3b4){return function(_0x250ec6){try{jsonpatch[_0x5460('0x21')](_0x250ec6,_0x35f3b4,!![]);}catch(_0x3a3c39){return BPromise[_0x5460('0x22')](_0x3a3c39);}return _0x250ec6[_0x5460('0x23')]();};}function saveUpdates(_0x58feba,_0x41dd50){return function(_0x40c5c3){if(_0x40c5c3){return _0x40c5c3['update'](_0x58feba)[_0x5460('0x24')](function(_0x25622f){return _0x25622f;});}return null;};}function removeEntity(_0xf5d1cc,_0x47afb2){return function(_0x5bd80e){if(_0x5bd80e){return _0x5bd80e[_0x5460('0x25')]()[_0x5460('0x24')](function(){_0xf5d1cc['status'](0xcc)[_0x5460('0x19')]();});}};}function handleEntityNotFound(_0x3c6b3b,_0x427435){return function(_0x465cba){if(!_0x465cba){_0x3c6b3b['sendStatus'](0x194);}return _0x465cba;};}function handleError(_0x2bba60,_0x5b3e43){_0x5b3e43=_0x5b3e43||0x1f4;return function(_0x3cd0dd){logger[_0x5460('0x26')](_0x3cd0dd[_0x5460('0x27')]);if(_0x3cd0dd['name']){delete _0x3cd0dd[_0x5460('0x28')];}_0x2bba60[_0x5460('0x18')](_0x5b3e43)[_0x5460('0x29')](_0x3cd0dd);};}exports['index']=function(_0x2fdd91,_0x5bb9a2){var _0x83e94d={},_0x44a726={},_0x2633dd={'count':0x0,'rows':[]};var _0x47a938=_[_0x5460('0x2a')](db['SugarcrmAccount']['rawAttributes'],function(_0x58cb1d){return{'name':_0x58cb1d[_0x5460('0x2b')],'type':_0x58cb1d['type'][_0x5460('0x2c')]};});_0x44a726[_0x5460('0x2d')]=_[_0x5460('0x2a')](_0x47a938,_0x5460('0x28'));_0x44a726[_0x5460('0x2e')]=_['keys'](_0x2fdd91[_0x5460('0x2e')]);_0x44a726[_0x5460('0x2f')]=_[_0x5460('0x30')](_0x44a726['model'],_0x44a726['query']);_0x83e94d[_0x5460('0x31')]=_[_0x5460('0x30')](_0x44a726[_0x5460('0x2d')],qs['fields'](_0x2fdd91[_0x5460('0x2e')][_0x5460('0x32')]));_0x83e94d[_0x5460('0x31')]=_0x83e94d[_0x5460('0x31')][_0x5460('0x33')]?_0x83e94d[_0x5460('0x31')]:_0x44a726[_0x5460('0x2d')];if(!_0x2fdd91[_0x5460('0x2e')][_0x5460('0x34')]('nolimit')){_0x83e94d[_0x5460('0x1d')]=qs['limit'](_0x2fdd91[_0x5460('0x2e')][_0x5460('0x1d')]);_0x83e94d[_0x5460('0x1b')]=qs['offset'](_0x2fdd91[_0x5460('0x2e')][_0x5460('0x1b')]);}_0x83e94d[_0x5460('0x35')]=qs[_0x5460('0x36')](_0x2fdd91[_0x5460('0x2e')][_0x5460('0x36')]);_0x83e94d[_0x5460('0x37')]=qs[_0x5460('0x2f')](_[_0x5460('0x38')](_0x2fdd91[_0x5460('0x2e')],_0x44a726['filters']),_0x47a938);if(_0x2fdd91[_0x5460('0x2e')]['filter']){_0x83e94d[_0x5460('0x37')]=_[_0x5460('0x39')](_0x83e94d[_0x5460('0x37')],{'$or':_[_0x5460('0x2a')](_0x47a938,function(_0x3960ab){if(_0x3960ab['type']!==_0x5460('0x3a')){var _0x1b01e5={};_0x1b01e5[_0x3960ab[_0x5460('0x28')]]={'$like':'%'+_0x2fdd91[_0x5460('0x2e')][_0x5460('0x3b')]+'%'};return _0x1b01e5;}})});}_0x83e94d=_[_0x5460('0x39')]({},_0x83e94d,_0x2fdd91[_0x5460('0x3c')]);var _0x83ac4c={'where':_0x83e94d['where']};return db['SugarcrmAccount'][_0x5460('0x1e')](_0x83ac4c)[_0x5460('0x24')](function(_0x4bfc8c){_0x2633dd['count']=_0x4bfc8c;if(_0x2fdd91[_0x5460('0x2e')]['includeAll']){_0x83e94d[_0x5460('0x3d')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x5460('0x3e')](_0x83e94d);})[_0x5460('0x24')](function(_0x1436ed){_0x2633dd[_0x5460('0x3f')]=_0x1436ed;return _0x2633dd;})[_0x5460('0x24')](respondWithFilteredResult(_0x5bb9a2,_0x83e94d))[_0x5460('0x40')](handleError(_0x5bb9a2,null));};exports[_0x5460('0x41')]=function(_0x3c9cfa,_0x271ff){var _0x22a713={'raw':![],'where':{'id':_0x3c9cfa['params']['id']}},_0x189a1e={};_0x189a1e[_0x5460('0x2d')]=_[_0x5460('0x42')](db['SugarcrmAccount'][_0x5460('0x43')]);_0x189a1e[_0x5460('0x2e')]=_[_0x5460('0x42')](_0x3c9cfa['query']);_0x189a1e[_0x5460('0x2f')]=_[_0x5460('0x30')](_0x189a1e[_0x5460('0x2d')],_0x189a1e['query']);_0x22a713[_0x5460('0x31')]=_['intersection'](_0x189a1e[_0x5460('0x2d')],qs[_0x5460('0x32')](_0x3c9cfa[_0x5460('0x2e')]['fields']));_0x22a713[_0x5460('0x31')]=_0x22a713[_0x5460('0x31')]['length']?_0x22a713['attributes']:_0x189a1e[_0x5460('0x2d')];if(_0x3c9cfa[_0x5460('0x2e')][_0x5460('0x44')]){_0x22a713[_0x5460('0x3d')]=[{'all':!![]}];}_0x22a713=_[_0x5460('0x39')]({},_0x22a713,_0x3c9cfa['options']);return db['SugarcrmAccount'][_0x5460('0x45')](_0x22a713)['then'](handleEntityNotFound(_0x271ff,null))[_0x5460('0x24')](respondWithResult(_0x271ff,null))['catch'](handleError(_0x271ff,null));};exports[_0x5460('0x46')]=function(_0x4a52dc,_0xbc34fe){return db[_0x5460('0x47')][_0x5460('0x46')](_0x4a52dc['body'],{})[_0x5460('0x24')](respondWithResult(_0xbc34fe,0xc9))['catch'](handleError(_0xbc34fe,null));};exports[_0x5460('0x48')]=function(_0x17b2dd,_0x40dbb0){if(_0x17b2dd[_0x5460('0x49')]['id']){delete _0x17b2dd[_0x5460('0x49')]['id'];}return db[_0x5460('0x47')][_0x5460('0x45')]({'where':{'id':_0x17b2dd[_0x5460('0x4a')]['id']}})[_0x5460('0x24')](handleEntityNotFound(_0x40dbb0,null))['then'](saveUpdates(_0x17b2dd[_0x5460('0x49')],null))['then'](respondWithResult(_0x40dbb0,null))[_0x5460('0x40')](handleError(_0x40dbb0,null));};exports[_0x5460('0x25')]=function(_0x28480c,_0x393a38){return db['SugarcrmAccount']['find']({'where':{'id':_0x28480c[_0x5460('0x4a')]['id']}})[_0x5460('0x24')](handleEntityNotFound(_0x393a38,null))[_0x5460('0x24')](removeEntity(_0x393a38,null))[_0x5460('0x40')](handleError(_0x393a38,null));};exports['getConfigurations']=function(_0x45094c,_0x131832,_0x4b5ae2){var _0x1f03a2={};var _0x58444f={};var _0x3316c3;var _0x491018;return db[_0x5460('0x47')]['findOne']({'where':{'id':_0x45094c[_0x5460('0x4a')]['id']}})['then'](handleEntityNotFound(_0x131832,null))['then'](function(_0x30566c){if(_0x30566c){_0x3316c3=_0x30566c;_0x58444f[_0x5460('0x2d')]=_[_0x5460('0x42')](db[_0x5460('0x4b')][_0x5460('0x43')]);_0x58444f[_0x5460('0x2e')]=_['keys'](_0x45094c[_0x5460('0x2e')]);_0x58444f['filters']=_[_0x5460('0x30')](_0x58444f[_0x5460('0x2d')],_0x58444f['query']);_0x1f03a2[_0x5460('0x31')]=_['intersection'](_0x58444f[_0x5460('0x2d')],qs[_0x5460('0x32')](_0x45094c['query'][_0x5460('0x32')]));_0x1f03a2[_0x5460('0x31')]=_0x1f03a2[_0x5460('0x31')]['length']?_0x1f03a2[_0x5460('0x31')]:_0x58444f['model'];_0x1f03a2['order']=qs[_0x5460('0x36')](_0x45094c[_0x5460('0x2e')][_0x5460('0x36')]);_0x1f03a2[_0x5460('0x37')]=qs['filters'](_[_0x5460('0x38')](_0x45094c[_0x5460('0x2e')],_0x58444f['filters']));if(_0x45094c['query'][_0x5460('0x3b')]){_0x1f03a2[_0x5460('0x37')]=_[_0x5460('0x39')](_0x1f03a2[_0x5460('0x37')],{'$or':_[_0x5460('0x2a')](_0x1f03a2[_0x5460('0x31')],function(_0x3f03ef){var _0x5ab9b9={};_0x5ab9b9[_0x3f03ef]={'$like':'%'+_0x45094c[_0x5460('0x2e')][_0x5460('0x3b')]+'%'};return _0x5ab9b9;})});}_0x1f03a2=_['merge']({},_0x1f03a2,_0x45094c['options']);return _0x3316c3[_0x5460('0x4c')](_0x1f03a2);}})[_0x5460('0x24')](function(_0x54fbaa){if(_0x54fbaa){_0x491018=_0x54fbaa['length'];if(!_0x45094c[_0x5460('0x2e')][_0x5460('0x34')](_0x5460('0x4d'))){_0x1f03a2['limit']=qs[_0x5460('0x1d')](_0x45094c['query'][_0x5460('0x1d')]);_0x1f03a2[_0x5460('0x1b')]=qs[_0x5460('0x1b')](_0x45094c[_0x5460('0x2e')][_0x5460('0x1b')]);}return _0x3316c3['getConfigurations'](_0x1f03a2);}})['then'](function(_0x147209){if(_0x147209){return _0x147209?{'count':_0x491018,'rows':_0x147209}:null;}})[_0x5460('0x24')](respondWithResult(_0x131832,null))[_0x5460('0x40')](handleError(_0x131832,null));};exports[_0x5460('0x4e')]=function(_0x45ea04,_0xbf8973,_0x378972){if(_0x45ea04[_0x5460('0x49')]['id']){delete _0x45ea04['body']['id'];}return db[_0x5460('0x47')][_0x5460('0x4f')]({'where':{'id':_0x45ea04[_0x5460('0x4a')]['id']}})[_0x5460('0x24')](handleEntityNotFound(_0xbf8973,null))[_0x5460('0x24')](function(_0x5860a9){if(_0x5860a9){_0x45ea04[_0x5460('0x49')][_0x5460('0x50')]=_0x5860a9['id'];_0x45ea04['body'][_0x5460('0x51')]=integrations['getSubjects'](_0x45ea04['body'][_0x5460('0x52')],_0x45ea04[_0x5460('0x49')][_0x5460('0x53')]);_0x45ea04[_0x5460('0x49')][_0x5460('0x54')]=integrations[_0x5460('0x55')](_0x45ea04[_0x5460('0x49')][_0x5460('0x52')],_0x45ea04[_0x5460('0x49')][_0x5460('0x53')]);return db['SugarcrmConfiguration'][_0x5460('0x46')](_0x45ea04['body'],{'include':[{'model':db[_0x5460('0x56')],'as':_0x5460('0x51')},{'model':db[_0x5460('0x56')],'as':_0x5460('0x54')}]});}return null;})['then'](respondWithResult(_0xbf8973,null))[_0x5460('0x40')](handleError(_0xbf8973,null));};exports[_0x5460('0x57')]=function(_0x3a9a5e,_0x1ce985,_0xb3df9c){var _0x5e0a15='';var _0x3495c7=['id',_0x5460('0x28'),'assigned_user_id',_0x5460('0x58'),'description',_0x5460('0x59'),_0x5460('0x5a'),_0x5460('0x5b'),_0x5460('0x5c'),_0x5460('0x5d'),_0x5460('0x5e'),_0x5460('0x5f')];return db[_0x5460('0x47')][_0x5460('0x4f')]({'where':{'id':_0x3a9a5e[_0x5460('0x4a')]['id']},'attributes':['id',_0x5460('0x60'),_0x5460('0x61'),_0x5460('0x62')]})['then'](handleEntityNotFound(_0x1ce985,null))[_0x5460('0x24')](function(_0x76b620){if(_0x76b620){_0x5e0a15=_0x76b620[_0x5460('0x62')];var _0x237af5=_0x5e0a15['slice'](-0x1);if(_0x237af5==='/'){_0x5e0a15=_0x5e0a15[_0x5460('0x63')](0x0,_0x5e0a15['lastIndexOf'](_0x237af5));}return rp({'method':_0x5460('0x64'),'uri':util[_0x5460('0x65')](_0x5460('0x66'),_0x5e0a15,_0x5460('0x67')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x5460('0x68'),'rest_data':JSON[_0x5460('0x69')]({'user_auth':{'user_name':_0x76b620[_0x5460('0x60')],'password':_0x76b620[_0x5460('0x61')],'encryption':'PLAIN'},'application':_0x5460('0x6a')})}});}})[_0x5460('0x24')](function(_0x26db67){if(_0x26db67&&_0x26db67['name']!==_0x5460('0x6b')&&_0x26db67[_0x5460('0x28')]!==_0x5460('0x6c')){return rp({'method':_0x5460('0x64'),'uri':util[_0x5460('0x65')](_0x5460('0x66'),_0x5e0a15,_0x5460('0x67')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x5460('0x68'),'response_type':_0x5460('0x68'),'rest_data':JSON[_0x5460('0x69')]({'session':_0x26db67['id'],'module_name':'Calls'})}})['then'](function(_0x34981a){if(_0x34981a){var _0x1a8840=_[_0x5460('0x6d')](_0x34981a[_0x5460('0x6e')]);_[_0x5460('0x6f')](_0x1a8840,function(_0x1e7e12){return _0x3495c7[_0x5460('0x70')](_0x1e7e12[_0x5460('0x28')]);});return{'count':_0x1a8840['length'],'rows':_[_0x5460('0x2a')](_0x1a8840,function(_0x1470ab){return{'id':_0x1470ab[_0x5460('0x28')],'name':_0x1470ab[_0x5460('0x71')],'custom':_[_0x5460('0x72')](_0x1470ab['name'],'_c')?!![]:![],'options':_0x1470ab[_0x5460('0x3c')]?_['map'](_[_0x5460('0x6d')](_0x1470ab[_0x5460('0x3c')]),function(_0x40e661){return{'name':_0x40e661[_0x5460('0x73')],'value':_0x40e661[_0x5460('0x28')]};}):[]};})};}})[_0x5460('0x24')](respondWithResult(_0x1ce985,null))[_0x5460('0x40')](function(_0x52c3cb){var _0x4b46e4=_0x3a9a5e[_0x5460('0x2e')][_0x5460('0x74')]?0x1f4:_0x52c3cb[_0x5460('0x75')]||0x1f4;logger[_0x5460('0x26')](_0x5460('0x76'),_0x5460('0x57'),_0x4b46e4,JSON[_0x5460('0x69')](_0x52c3cb));delete _0x52c3cb[_0x5460('0x28')];if(_0x4b46e4===0x191){_0x4b46e4=0x190;}_0x1ce985[_0x5460('0x18')](_0x4b46e4)[_0x5460('0x29')](_0x3a9a5e[_0x5460('0x2e')][_0x5460('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x52c3cb[_0x5460('0x75')]}:_0x52c3cb);});}else{var _0x5cf6e8=0x1f4;_0x1ce985[_0x5460('0x18')](_0x5cf6e8)[_0x5460('0x29')]({'message':_0x5460('0x77'),'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 833e946..eb188f8 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 _0x2c5b=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','path'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x2c5b,0x193));var _0xb2c5=function(_0x496a28,_0x4b3bb7){_0x496a28=_0x496a28-0x0;var _0x334cad=_0x2c5b[_0x496a28];return _0x334cad;};'use strict';var _=require(_0xb2c5('0x0'));var util=require('util');var logger=require(_0xb2c5('0x1'))(_0xb2c5('0x2'));var moment=require(_0xb2c5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2c5('0x4'));var rimraf=require(_0xb2c5('0x5'));var config=require(_0xb2c5('0x6'));var attributes=require(_0xb2c5('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xb2c5('0x8')]=function(_0xc08d26,_0x449204){return _0xc08d26[_0xb2c5('0x9')](_0xb2c5('0xa'),attributes,{'tableName':_0xb2c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5229=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','util','../../config/logger','api','moment','path','rimraf'];(function(_0x3959ad,_0x432aec){var _0x567fbd=function(_0x1e4e1c){while(--_0x1e4e1c){_0x3959ad['push'](_0x3959ad['shift']());}};_0x567fbd(++_0x432aec);}(_0x5229,0xba));var _0x9522=function(_0x189b74,_0x5712bf){_0x189b74=_0x189b74-0x0;var _0x1a866d=_0x5229[_0x189b74];return _0x1a866d;};'use strict';var _=require('lodash');var util=require(_0x9522('0x0'));var logger=require(_0x9522('0x1'))(_0x9522('0x2'));var moment=require(_0x9522('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9522('0x4'));var rimraf=require(_0x9522('0x5'));var config=require(_0x9522('0x6'));var attributes=require(_0x9522('0x7'));var integrations=require(_0x9522('0x8'));module[_0x9522('0x9')]=function(_0x5c3497,_0x1d9f4f){return _0x5c3497[_0x9522('0xa')]('SugarcrmAccount',attributes,{'tableName':_0x9522('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 c0cebdb..f9138a4 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 _0x80cf=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','GetSugarcrmAccount','ShowSugarcrmAccount','util','moment','ioredis'];(function(_0x45b479,_0x3e6574){var _0x1c3cbe=function(_0xd53e52){while(--_0xd53e52){_0x45b479['push'](_0x45b479['shift']());}};_0x1c3cbe(++_0x3e6574);}(_0x80cf,0x15d));var _0xf80c=function(_0x1ec8e2,_0x43a12b){_0x1ec8e2=_0x1ec8e2-0x0;var _0x407621=_0x80cf[_0x1ec8e2];return _0x407621;};'use strict';var _=require('lodash');var util=require(_0xf80c('0x0'));var moment=require(_0xf80c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf80c('0x3'));var logger=require(_0xf80c('0x4'))('rpc');var config=require(_0xf80c('0x5'));var jayson=require(_0xf80c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10bf50,_0x119be0,_0x7e5a3b){return new BPromise(function(_0x374bdd,_0x223b09){return client[_0xf80c('0x7')](_0x10bf50,_0x7e5a3b)[_0xf80c('0x8')](function(_0xa6929e){logger[_0xf80c('0x9')](_0xf80c('0xa'),_0x119be0,'request\x20sent');logger['debug'](_0xf80c('0xb'),_0x119be0,'request\x20sent',JSON[_0xf80c('0xc')](_0xa6929e));if(_0xa6929e['error']){if(_0xa6929e[_0xf80c('0xd')][_0xf80c('0xe')]===0x1f4){logger['error'](_0xf80c('0xa'),_0x119be0,_0xa6929e['error'][_0xf80c('0xf')]);return _0x223b09(_0xa6929e[_0xf80c('0xd')][_0xf80c('0xf')]);}logger['error'](_0xf80c('0xa'),_0x119be0,_0xa6929e[_0xf80c('0xd')]['message']);return _0x374bdd(_0xa6929e[_0xf80c('0xd')][_0xf80c('0xf')]);}else{logger['info'](_0xf80c('0xa'),_0x119be0,_0xf80c('0x10'));_0x374bdd(_0xa6929e[_0xf80c('0x11')][_0xf80c('0xf')]);}})[_0xf80c('0x12')](function(_0x3efe0a){logger[_0xf80c('0xd')](_0xf80c('0xa'),_0x119be0,_0x3efe0a);_0x223b09(_0x3efe0a);});});}exports['GetSugarcrmAccount']=function(_0x4edd22){var _0x20cb45=this;return new Promise(function(_0x1851e5,_0x2fb023){return db[_0xf80c('0x13')][_0xf80c('0x14')]({'raw':_0x4edd22[_0xf80c('0x15')]?_0x4edd22[_0xf80c('0x15')][_0xf80c('0x16')]===undefined?!![]:![]:!![],'where':_0x4edd22[_0xf80c('0x15')]?_0x4edd22[_0xf80c('0x15')][_0xf80c('0x17')]||null:null,'attributes':_0x4edd22[_0xf80c('0x15')]?_0x4edd22['options'][_0xf80c('0x18')]||null:null,'limit':_0x4edd22['options']?_0x4edd22[_0xf80c('0x15')][_0xf80c('0x19')]||null:null,'include':_0x4edd22['options']?_0x4edd22[_0xf80c('0x15')]['include']?_[_0xf80c('0x1a')](_0x4edd22[_0xf80c('0x15')][_0xf80c('0x1b')],function(_0xed9ce6){return{'model':db[_0xed9ce6[_0xf80c('0x1c')]],'as':_0xed9ce6['as'],'attributes':_0xed9ce6[_0xf80c('0x18')],'include':_0xed9ce6['include']?_['map'](_0xed9ce6[_0xf80c('0x1b')],function(_0x126ad4){return{'model':db[_0x126ad4[_0xf80c('0x1c')]],'as':_0x126ad4['as'],'attributes':_0x126ad4[_0xf80c('0x18')],'include':_0x126ad4[_0xf80c('0x1b')]?_['map'](_0x126ad4[_0xf80c('0x1b')],function(_0x4c7e3d){return{'model':db[_0x4c7e3d['model']],'as':_0x4c7e3d['as'],'attributes':_0x4c7e3d[_0xf80c('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf80c('0x8')](function(_0x3121e5){logger[_0xf80c('0x9')]('GetSugarcrmAccount',_0x4edd22);logger[_0xf80c('0x1d')](_0xf80c('0x1e'),_0x4edd22,JSON[_0xf80c('0xc')](_0x3121e5));_0x1851e5(_0x3121e5);})[_0xf80c('0x12')](function(_0xf9785e){logger[_0xf80c('0xd')](_0xf80c('0x1e'),_0xf9785e[_0xf80c('0xf')],_0x4edd22);_0x2fb023(_0x20cb45[_0xf80c('0xd')](0x1f4,_0xf9785e[_0xf80c('0xf')]));});});};exports[_0xf80c('0x1f')]=function(_0x34f6dd){var _0xa8fa3f=this;return new Promise(function(_0x157f05,_0x12008c){return db[_0xf80c('0x13')]['find']({'raw':_0x34f6dd[_0xf80c('0x15')]?_0x34f6dd[_0xf80c('0x15')][_0xf80c('0x16')]===undefined?!![]:![]:!![],'where':_0x34f6dd[_0xf80c('0x15')]?_0x34f6dd[_0xf80c('0x15')][_0xf80c('0x17')]||null:null,'attributes':_0x34f6dd['options']?_0x34f6dd[_0xf80c('0x15')][_0xf80c('0x18')]||null:null,'include':_0x34f6dd['options']?_0x34f6dd['options'][_0xf80c('0x1b')]?_['map'](_0x34f6dd['options'][_0xf80c('0x1b')],function(_0x41a285){return{'model':db[_0x41a285[_0xf80c('0x1c')]],'as':_0x41a285['as'],'attributes':_0x41a285[_0xf80c('0x18')],'include':_0x41a285[_0xf80c('0x1b')]?_[_0xf80c('0x1a')](_0x41a285[_0xf80c('0x1b')],function(_0x4574f7){return{'model':db[_0x4574f7[_0xf80c('0x1c')]],'as':_0x4574f7['as'],'attributes':_0x4574f7[_0xf80c('0x18')],'include':_0x4574f7[_0xf80c('0x1b')]?_[_0xf80c('0x1a')](_0x4574f7[_0xf80c('0x1b')],function(_0x1c66cf){return{'model':db[_0x1c66cf[_0xf80c('0x1c')]],'as':_0x1c66cf['as'],'attributes':_0x1c66cf[_0xf80c('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf80c('0x8')](function(_0xbfb66e){logger['info'](_0xf80c('0x1f'),_0x34f6dd);logger[_0xf80c('0x1d')](_0xf80c('0x1f'),_0x34f6dd,JSON['stringify'](_0xbfb66e));_0x157f05(_0xbfb66e);})[_0xf80c('0x12')](function(_0x495325){logger['error'](_0xf80c('0x1f'),_0x495325[_0xf80c('0xf')],_0x34f6dd);_0x12008c(_0xa8fa3f['error'](0x1f4,_0x495325['message']));});});}; \ No newline at end of file +var _0x6a95=['rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6a95,0xf3));var _0x56a9=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x6a95[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var BPromise=require(_0x56a9('0x3'));var rs=require(_0x56a9('0x4'));var fs=require('fs');var Redis=require(_0x56a9('0x5'));var db=require(_0x56a9('0x6'))['db'];var utils=require(_0x56a9('0x7'));var logger=require(_0x56a9('0x8'))(_0x56a9('0x9'));var config=require(_0x56a9('0xa'));var jayson=require(_0x56a9('0xb'));var client=jayson[_0x56a9('0xc')][_0x56a9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x209430,_0xc2b360,_0xfea211){return new BPromise(function(_0x2153f9,_0x42c2cd){return client[_0x56a9('0xe')](_0x209430,_0xfea211)['then'](function(_0x1eaf0c){logger[_0x56a9('0xf')](_0x56a9('0x10'),_0xc2b360,_0x56a9('0x11'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xc2b360,_0x56a9('0x11'),JSON[_0x56a9('0x12')](_0x1eaf0c));if(_0x1eaf0c[_0x56a9('0x13')]){if(_0x1eaf0c['error'][_0x56a9('0x14')]===0x1f4){logger[_0x56a9('0x13')](_0x56a9('0x10'),_0xc2b360,_0x1eaf0c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x42c2cd(_0x1eaf0c[_0x56a9('0x13')][_0x56a9('0x15')]);}logger[_0x56a9('0x13')](_0x56a9('0x10'),_0xc2b360,_0x1eaf0c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x2153f9(_0x1eaf0c[_0x56a9('0x13')][_0x56a9('0x15')]);}else{logger[_0x56a9('0xf')](_0x56a9('0x10'),_0xc2b360,_0x56a9('0x11'));_0x2153f9(_0x1eaf0c['result'][_0x56a9('0x15')]);}})[_0x56a9('0x16')](function(_0x4c37a6){logger[_0x56a9('0x13')](_0x56a9('0x10'),_0xc2b360,_0x4c37a6);_0x42c2cd(_0x4c37a6);});});}exports['GetSugarcrmAccount']=function(_0x119536){var _0x1a3e16=this;return new Promise(function(_0x529cc3,_0x277e31){return db['SugarcrmAccount'][_0x56a9('0x17')]({'raw':_0x119536[_0x56a9('0x18')]?_0x119536['options'][_0x56a9('0x19')]===undefined?!![]:![]:!![],'where':_0x119536[_0x56a9('0x18')]?_0x119536['options'][_0x56a9('0x1a')]||null:null,'attributes':_0x119536[_0x56a9('0x18')]?_0x119536['options'][_0x56a9('0x1b')]||null:null,'limit':_0x119536[_0x56a9('0x18')]?_0x119536[_0x56a9('0x18')]['limit']||null:null,'include':_0x119536[_0x56a9('0x18')]?_0x119536['options'][_0x56a9('0x1c')]?_['map'](_0x119536[_0x56a9('0x18')][_0x56a9('0x1c')],function(_0x540abd){return{'model':db[_0x540abd['model']],'as':_0x540abd['as'],'attributes':_0x540abd[_0x56a9('0x1b')],'include':_0x540abd['include']?_[_0x56a9('0x1d')](_0x540abd['include'],function(_0x58b442){return{'model':db[_0x58b442[_0x56a9('0x1e')]],'as':_0x58b442['as'],'attributes':_0x58b442[_0x56a9('0x1b')],'include':_0x58b442[_0x56a9('0x1c')]?_[_0x56a9('0x1d')](_0x58b442[_0x56a9('0x1c')],function(_0x3d3d43){return{'model':db[_0x3d3d43[_0x56a9('0x1e')]],'as':_0x3d3d43['as'],'attributes':_0x3d3d43[_0x56a9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29cc3b){logger[_0x56a9('0xf')](_0x56a9('0x1f'),_0x119536);logger['debug'](_0x56a9('0x1f'),_0x119536,JSON['stringify'](_0x29cc3b));_0x529cc3(_0x29cc3b);})['catch'](function(_0x47246c){logger[_0x56a9('0x13')](_0x56a9('0x1f'),_0x47246c[_0x56a9('0x15')],_0x119536);_0x277e31(_0x1a3e16[_0x56a9('0x13')](0x1f4,_0x47246c[_0x56a9('0x15')]));});});};exports[_0x56a9('0x20')]=function(_0x5a8ef6){var _0x412d7b=this;return new Promise(function(_0x3985c0,_0x4fbdfa){return db[_0x56a9('0x21')]['find']({'raw':_0x5a8ef6['options']?_0x5a8ef6[_0x56a9('0x18')][_0x56a9('0x19')]===undefined?!![]:![]:!![],'where':_0x5a8ef6[_0x56a9('0x18')]?_0x5a8ef6[_0x56a9('0x18')][_0x56a9('0x1a')]||null:null,'attributes':_0x5a8ef6['options']?_0x5a8ef6[_0x56a9('0x18')]['attributes']||null:null,'include':_0x5a8ef6[_0x56a9('0x18')]?_0x5a8ef6[_0x56a9('0x18')][_0x56a9('0x1c')]?_[_0x56a9('0x1d')](_0x5a8ef6[_0x56a9('0x18')]['include'],function(_0x3870ba){return{'model':db[_0x3870ba['model']],'as':_0x3870ba['as'],'attributes':_0x3870ba['attributes'],'include':_0x3870ba[_0x56a9('0x1c')]?_[_0x56a9('0x1d')](_0x3870ba[_0x56a9('0x1c')],function(_0x4cff13){return{'model':db[_0x4cff13[_0x56a9('0x1e')]],'as':_0x4cff13['as'],'attributes':_0x4cff13[_0x56a9('0x1b')],'include':_0x4cff13['include']?_['map'](_0x4cff13['include'],function(_0x382fa8){return{'model':db[_0x382fa8[_0x56a9('0x1e')]],'as':_0x382fa8['as'],'attributes':_0x382fa8[_0x56a9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x56a9('0x22')](function(_0x3912b1){logger[_0x56a9('0xf')](_0x56a9('0x20'),_0x5a8ef6);logger[_0x56a9('0x23')]('ShowSugarcrmAccount',_0x5a8ef6,JSON[_0x56a9('0x12')](_0x3912b1));_0x3985c0(_0x3912b1);})['catch'](function(_0x26e621){logger['error'](_0x56a9('0x20'),_0x26e621['message'],_0x5a8ef6);_0x4fbdfa(_0x412d7b[_0x56a9('0x13')](0x1f4,_0x26e621[_0x56a9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 5044f67..ec540dc 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 _0x726f=['./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xff2cf,_0xa7d6c6){var _0x4a237b=function(_0x49b52c){while(--_0x49b52c){_0xff2cf['push'](_0xff2cf['shift']());}};_0x4a237b(++_0xa7d6c6);}(_0x726f,0x83));var _0xf726=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x726f[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xf726('0x0'));var util=require(_0xf726('0x1'));var path=require(_0xf726('0x2'));var timeout=require('connect-timeout');var express=require(_0xf726('0x3'));var router=express[_0xf726('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf726('0x5'));var interaction=require(_0xf726('0x6'));var config=require('../../config/environment');var controller=require(_0xf726('0x7'));router[_0xf726('0x8')]('/',auth[_0xf726('0x9')](),controller[_0xf726('0xa')]);router[_0xf726('0x8')](_0xf726('0xb'),auth[_0xf726('0x9')](),controller[_0xf726('0xc')]);router['get'](_0xf726('0xd'),auth['isAuthenticated'](),controller[_0xf726('0xe')]);router[_0xf726('0x8')](_0xf726('0xf'),auth[_0xf726('0x9')](),controller[_0xf726('0x10')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf726('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf726('0x12')]);router[_0xf726('0x13')](_0xf726('0xb'),auth[_0xf726('0x9')](),controller['update']);router[_0xf726('0x14')](_0xf726('0xb'),auth[_0xf726('0x9')](),controller[_0xf726('0x15')]);module[_0xf726('0x16')]=router; \ No newline at end of file +var _0xfd2e=['fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2299fe,_0x3c7a8b){var _0x59e6ac=function(_0xcf533a){while(--_0xcf533a){_0x2299fe['push'](_0x2299fe['shift']());}};_0x59e6ac(++_0x3c7a8b);}(_0xfd2e,0x1a3));var _0xefd2=function(_0x46df04,_0x5c3e9b){_0x46df04=_0x46df04-0x0;var _0x9df292=_0xfd2e[_0x46df04];return _0x9df292;};'use strict';var multer=require(_0xefd2('0x0'));var util=require(_0xefd2('0x1'));var path=require(_0xefd2('0x2'));var timeout=require(_0xefd2('0x3'));var express=require(_0xefd2('0x4'));var router=express[_0xefd2('0x5')]();var fs_extra=require(_0xefd2('0x6'));var auth=require(_0xefd2('0x7'));var interaction=require(_0xefd2('0x8'));var config=require('../../config/environment');var controller=require(_0xefd2('0x9'));router[_0xefd2('0xa')]('/',auth[_0xefd2('0xb')](),controller[_0xefd2('0xc')]);router[_0xefd2('0xa')](_0xefd2('0xd'),auth['isAuthenticated'](),controller[_0xefd2('0xe')]);router[_0xefd2('0xa')](_0xefd2('0xf'),auth['isAuthenticated'](),controller[_0xefd2('0x10')]);router[_0xefd2('0xa')]('/:id/subjects',auth[_0xefd2('0xb')](),controller[_0xefd2('0x11')]);router[_0xefd2('0xa')](_0xefd2('0x12'),auth[_0xefd2('0xb')](),controller[_0xefd2('0x13')]);router[_0xefd2('0x14')]('/',auth[_0xefd2('0xb')](),controller['create']);router[_0xefd2('0x15')](_0xefd2('0xd'),auth[_0xefd2('0xb')](),controller['update']);router[_0xefd2('0x16')](_0xefd2('0xd'),auth[_0xefd2('0xb')](),controller[_0xefd2('0x17')]);module[_0xefd2('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 51677f3..6811949 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 _0xc54a=['sequelize','STRING'];(function(_0x501024,_0x1df381){var _0xbd0d55=function(_0x564a5e){while(--_0x564a5e){_0x501024['push'](_0x501024['shift']());}};_0xbd0d55(++_0x1df381);}(_0xc54a,0x180));var _0xac54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc54a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac54('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac54('0x1')]}}; \ No newline at end of file +var _0x3f9d=['exports','STRING','sequelize'];(function(_0x3583ea,_0x4022ee){var _0x1c6ae2=function(_0x155a25){while(--_0x155a25){_0x3583ea['push'](_0x3583ea['shift']());}};_0x1c6ae2(++_0x4022ee);}(_0x3f9d,0xc8));var _0xd3f9=function(_0x1abfac,_0x45ae54){_0x1abfac=_0x1abfac-0x0;var _0x2f97e6=_0x3f9d[_0x1abfac];return _0x2f97e6;};'use strict';var Sequelize=require(_0xd3f9('0x0'));module[_0xd3f9('0x1')]={'name':{'type':Sequelize[_0xd3f9('0x2')]},'description':{'type':Sequelize[_0xd3f9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index d609bf1..9130fd4 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 _0x7ffb=['map','SugarcrmConfiguration','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','update','body','params','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7ffb,0x1cb));var _0xb7ff=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x7ffb[_0x210718];return _0x541bfc;};'use strict';var emlformat=require(_0xb7ff('0x0'));var rimraf=require(_0xb7ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7ff('0x2'));var rp=require(_0xb7ff('0x3'));var moment=require(_0xb7ff('0x4'));var BPromise=require(_0xb7ff('0x5'));var Mustache=require(_0xb7ff('0x6'));var util=require(_0xb7ff('0x7'));var path=require(_0xb7ff('0x8'));var sox=require('sox');var csv=require(_0xb7ff('0x9'));var ejs=require(_0xb7ff('0xa'));var fs=require('fs');var fs_extra=require(_0xb7ff('0xb'));var _=require(_0xb7ff('0xc'));var squel=require('squel');var crypto=require(_0xb7ff('0xd'));var jsforce=require(_0xb7ff('0xe'));var deskjs=require(_0xb7ff('0xf'));var toCsv=require(_0xb7ff('0x9'));var querystring=require(_0xb7ff('0x10'));var Papa=require('papaparse');var Redis=require(_0xb7ff('0x11'));var authService=require(_0xb7ff('0x12'));var qs=require(_0xb7ff('0x13'));var as=require(_0xb7ff('0x14'));var hardwareService=require(_0xb7ff('0x15'));var logger=require(_0xb7ff('0x16'))(_0xb7ff('0x17'));var utils=require(_0xb7ff('0x18'));var config=require(_0xb7ff('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7ff('0x1a'))['db'];function respondWithStatusCode(_0x453796,_0x23e4ba){_0x23e4ba=_0x23e4ba||0xcc;return function(_0x1ffdd6){if(_0x1ffdd6){return _0x453796['sendStatus'](_0x23e4ba);}return _0x453796['status'](_0x23e4ba)['end']();};}function respondWithResult(_0x56ee13,_0xbe9c1a){_0xbe9c1a=_0xbe9c1a||0xc8;return function(_0x46efdd){if(_0x46efdd){return _0x56ee13['status'](_0xbe9c1a)[_0xb7ff('0x1b')](_0x46efdd);}};}function respondWithFilteredResult(_0x4c4008,_0x3cbaf2){return function(_0x47e142){if(_0x47e142){var _0x3c0aa2=typeof _0x3cbaf2[_0xb7ff('0x1c')]===_0xb7ff('0x1d')&&typeof _0x3cbaf2[_0xb7ff('0x1e')]===_0xb7ff('0x1d');var _0x4717f0=_0x47e142[_0xb7ff('0x1f')];var _0x251082=_0x3c0aa2?0x0:_0x3cbaf2[_0xb7ff('0x1c')];var _0x7572be=_0x3c0aa2?_0x47e142['count']:_0x3cbaf2[_0xb7ff('0x1c')]+_0x3cbaf2[_0xb7ff('0x1e')];var _0x3307e8;if(_0x7572be>=_0x4717f0){_0x7572be=_0x4717f0;_0x3307e8=0xc8;}else{_0x3307e8=0xce;}_0x4c4008[_0xb7ff('0x20')](_0x3307e8);return _0x4c4008[_0xb7ff('0x21')]('Content-Range',_0x251082+'-'+_0x7572be+'/'+_0x4717f0)[_0xb7ff('0x1b')](_0x47e142);}return null;};}function patchUpdates(_0xef5045){return function(_0x560c9b){try{jsonpatch[_0xb7ff('0x22')](_0x560c9b,_0xef5045,!![]);}catch(_0x5f427c){return BPromise[_0xb7ff('0x23')](_0x5f427c);}return _0x560c9b[_0xb7ff('0x24')]();};}function saveUpdates(_0x5cac7e,_0x42b30c){return function(_0xd37f3b){if(_0xd37f3b){return _0xd37f3b['update'](_0x5cac7e)['then'](function(_0x3141a0){return _0x3141a0;});}return null;};}function removeEntity(_0x2a35a5,_0x3fafc3){return function(_0x288373){if(_0x288373){return _0x288373[_0xb7ff('0x25')]()[_0xb7ff('0x26')](function(){_0x2a35a5[_0xb7ff('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe20b,_0x2c1a84){return function(_0x1c6c99){if(!_0x1c6c99){_0x4fe20b[_0xb7ff('0x27')](0x194);}return _0x1c6c99;};}function handleError(_0x5c7b6a,_0x6d84a7){_0x6d84a7=_0x6d84a7||0x1f4;return function(_0x1197a8){logger[_0xb7ff('0x28')](_0x1197a8[_0xb7ff('0x29')]);if(_0x1197a8[_0xb7ff('0x2a')]){delete _0x1197a8[_0xb7ff('0x2a')];}_0x5c7b6a[_0xb7ff('0x20')](_0x6d84a7)[_0xb7ff('0x2b')](_0x1197a8);};}exports[_0xb7ff('0x2c')]=function(_0x37bef1,_0x3b6d76){var _0x36d3ec={},_0x1b7148={},_0x409304={'count':0x0,'rows':[]};var _0x3297d5=_[_0xb7ff('0x2d')](db[_0xb7ff('0x2e')]['rawAttributes'],function(_0x2d61e5){return{'name':_0x2d61e5['fieldName'],'type':_0x2d61e5['type'][_0xb7ff('0x2f')]};});_0x1b7148['model']=_[_0xb7ff('0x2d')](_0x3297d5,'name');_0x1b7148[_0xb7ff('0x30')]=_[_0xb7ff('0x31')](_0x37bef1[_0xb7ff('0x30')]);_0x1b7148[_0xb7ff('0x32')]=_[_0xb7ff('0x33')](_0x1b7148[_0xb7ff('0x34')],_0x1b7148[_0xb7ff('0x30')]);_0x36d3ec[_0xb7ff('0x35')]=_[_0xb7ff('0x33')](_0x1b7148[_0xb7ff('0x34')],qs[_0xb7ff('0x36')](_0x37bef1[_0xb7ff('0x30')]['fields']));_0x36d3ec[_0xb7ff('0x35')]=_0x36d3ec[_0xb7ff('0x35')][_0xb7ff('0x37')]?_0x36d3ec[_0xb7ff('0x35')]:_0x1b7148['model'];if(!_0x37bef1[_0xb7ff('0x30')][_0xb7ff('0x38')](_0xb7ff('0x39'))){_0x36d3ec[_0xb7ff('0x1e')]=qs['limit'](_0x37bef1['query']['limit']);_0x36d3ec[_0xb7ff('0x1c')]=qs[_0xb7ff('0x1c')](_0x37bef1[_0xb7ff('0x30')]['offset']);}_0x36d3ec[_0xb7ff('0x3a')]=qs[_0xb7ff('0x3b')](_0x37bef1['query'][_0xb7ff('0x3b')]);_0x36d3ec[_0xb7ff('0x3c')]=qs[_0xb7ff('0x32')](_[_0xb7ff('0x3d')](_0x37bef1['query'],_0x1b7148[_0xb7ff('0x32')]),_0x3297d5);if(_0x37bef1[_0xb7ff('0x30')][_0xb7ff('0x3e')]){_0x36d3ec[_0xb7ff('0x3c')]=_[_0xb7ff('0x3f')](_0x36d3ec[_0xb7ff('0x3c')],{'$or':_[_0xb7ff('0x2d')](_0x3297d5,function(_0x539b12){if(_0x539b12[_0xb7ff('0x40')]!==_0xb7ff('0x41')){var _0xe36e8f={};_0xe36e8f[_0x539b12[_0xb7ff('0x2a')]]={'$like':'%'+_0x37bef1[_0xb7ff('0x30')][_0xb7ff('0x3e')]+'%'};return _0xe36e8f;}})});}_0x36d3ec=_[_0xb7ff('0x3f')]({},_0x36d3ec,_0x37bef1[_0xb7ff('0x42')]);var _0x4e37ad={'where':_0x36d3ec[_0xb7ff('0x3c')]};return db['SugarcrmConfiguration'][_0xb7ff('0x1f')](_0x4e37ad)['then'](function(_0x4686df){_0x409304[_0xb7ff('0x1f')]=_0x4686df;if(_0x37bef1['query'][_0xb7ff('0x43')]){_0x36d3ec[_0xb7ff('0x44')]=[{'all':!![]}];}return db[_0xb7ff('0x2e')][_0xb7ff('0x45')](_0x36d3ec);})[_0xb7ff('0x26')](function(_0x4b1f76){_0x409304[_0xb7ff('0x46')]=_0x4b1f76;return _0x409304;})[_0xb7ff('0x26')](respondWithFilteredResult(_0x3b6d76,_0x36d3ec))[_0xb7ff('0x47')](handleError(_0x3b6d76,null));};exports[_0xb7ff('0x48')]=function(_0x41d715,_0x4c931b){var _0x52ae6f={'raw':![],'where':{'id':_0x41d715['params']['id']}},_0x291f1c={};_0x291f1c[_0xb7ff('0x34')]=_[_0xb7ff('0x31')](db[_0xb7ff('0x2e')][_0xb7ff('0x49')]);_0x291f1c[_0xb7ff('0x30')]=_[_0xb7ff('0x31')](_0x41d715[_0xb7ff('0x30')]);_0x291f1c[_0xb7ff('0x32')]=_['intersection'](_0x291f1c[_0xb7ff('0x34')],_0x291f1c[_0xb7ff('0x30')]);_0x52ae6f[_0xb7ff('0x35')]=_[_0xb7ff('0x33')](_0x291f1c[_0xb7ff('0x34')],qs[_0xb7ff('0x36')](_0x41d715[_0xb7ff('0x30')]['fields']));_0x52ae6f[_0xb7ff('0x35')]=_0x52ae6f[_0xb7ff('0x35')]['length']?_0x52ae6f['attributes']:_0x291f1c[_0xb7ff('0x34')];if(_0x41d715[_0xb7ff('0x30')]['includeAll']){_0x52ae6f[_0xb7ff('0x44')]=[{'all':!![]}];}_0x52ae6f=_[_0xb7ff('0x3f')]({},_0x52ae6f,_0x41d715[_0xb7ff('0x42')]);return db['SugarcrmConfiguration'][_0xb7ff('0x4a')](_0x52ae6f)[_0xb7ff('0x26')](handleEntityNotFound(_0x4c931b,null))[_0xb7ff('0x26')](respondWithResult(_0x4c931b,null))[_0xb7ff('0x47')](handleError(_0x4c931b,null));};exports[_0xb7ff('0x4b')]=function(_0x3429e6,_0x3ed1c0){return db['SugarcrmConfiguration'][_0xb7ff('0x4b')](_0x3429e6['body'],{})[_0xb7ff('0x26')](respondWithResult(_0x3ed1c0,0xc9))[_0xb7ff('0x47')](handleError(_0x3ed1c0,null));};exports[_0xb7ff('0x4c')]=function(_0x9c2f85,_0x1e3942){if(_0x9c2f85['body']['id']){delete _0x9c2f85[_0xb7ff('0x4d')]['id'];}return db[_0xb7ff('0x2e')][_0xb7ff('0x4a')]({'where':{'id':_0x9c2f85[_0xb7ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1e3942,null))[_0xb7ff('0x26')](saveUpdates(_0x9c2f85[_0xb7ff('0x4d')],null))[_0xb7ff('0x26')](respondWithResult(_0x1e3942,null))[_0xb7ff('0x47')](handleError(_0x1e3942,null));};exports[_0xb7ff('0x25')]=function(_0x45c928,_0x18052a){return db[_0xb7ff('0x2e')][_0xb7ff('0x4a')]({'where':{'id':_0x45c928['params']['id']}})['then'](handleEntityNotFound(_0x18052a,null))[_0xb7ff('0x26')](removeEntity(_0x18052a,null))[_0xb7ff('0x47')](handleError(_0x18052a,null));};exports[_0xb7ff('0x4f')]=function(_0x3244fa,_0x151bc1,_0x17ce75){var _0x39b963={};var _0x54edf5={};var _0x27b590;var _0x44d524;return db[_0xb7ff('0x2e')]['findOne']({'where':{'id':_0x3244fa[_0xb7ff('0x4e')]['id']}})[_0xb7ff('0x26')](handleEntityNotFound(_0x151bc1,null))[_0xb7ff('0x26')](function(_0x545ee5){if(_0x545ee5){_0x27b590=_0x545ee5;_0x54edf5['model']=_[_0xb7ff('0x31')](db[_0xb7ff('0x50')][_0xb7ff('0x49')]);_0x54edf5[_0xb7ff('0x30')]=_[_0xb7ff('0x31')](_0x3244fa['query']);_0x54edf5[_0xb7ff('0x32')]=_[_0xb7ff('0x33')](_0x54edf5[_0xb7ff('0x34')],_0x54edf5[_0xb7ff('0x30')]);_0x39b963[_0xb7ff('0x35')]=_[_0xb7ff('0x33')](_0x54edf5[_0xb7ff('0x34')],qs['fields'](_0x3244fa[_0xb7ff('0x30')][_0xb7ff('0x36')]));_0x39b963[_0xb7ff('0x35')]=_0x39b963[_0xb7ff('0x35')]['length']?_0x39b963[_0xb7ff('0x35')]:_0x54edf5[_0xb7ff('0x34')];_0x39b963[_0xb7ff('0x3a')]=qs['sort'](_0x3244fa['query']['sort']);_0x39b963[_0xb7ff('0x3c')]=qs[_0xb7ff('0x32')](_[_0xb7ff('0x3d')](_0x3244fa[_0xb7ff('0x30')],_0x54edf5[_0xb7ff('0x32')]));if(_0x3244fa[_0xb7ff('0x30')][_0xb7ff('0x3e')]){_0x39b963[_0xb7ff('0x3c')]=_[_0xb7ff('0x3f')](_0x39b963[_0xb7ff('0x3c')],{'$or':_[_0xb7ff('0x2d')](_0x39b963[_0xb7ff('0x35')],function(_0x60f6a6){var _0x293821={};_0x293821[_0x60f6a6]={'$like':'%'+_0x3244fa['query'][_0xb7ff('0x3e')]+'%'};return _0x293821;})});}_0x39b963=_[_0xb7ff('0x3f')]({},_0x39b963,_0x3244fa['options']);return _0x27b590[_0xb7ff('0x4f')](_0x39b963);}})[_0xb7ff('0x26')](function(_0x248d78){if(_0x248d78){_0x44d524=_0x248d78[_0xb7ff('0x37')];if(!_0x3244fa[_0xb7ff('0x30')][_0xb7ff('0x38')](_0xb7ff('0x39'))){_0x39b963[_0xb7ff('0x1e')]=qs[_0xb7ff('0x1e')](_0x3244fa[_0xb7ff('0x30')][_0xb7ff('0x1e')]);_0x39b963[_0xb7ff('0x1c')]=qs[_0xb7ff('0x1c')](_0x3244fa[_0xb7ff('0x30')][_0xb7ff('0x1c')]);}return _0x27b590[_0xb7ff('0x4f')](_0x39b963);}})['then'](function(_0x406dfc){if(_0x406dfc){return _0x406dfc?{'count':_0x44d524,'rows':_0x406dfc}:null;}})[_0xb7ff('0x26')](respondWithResult(_0x151bc1,null))[_0xb7ff('0x47')](handleError(_0x151bc1,null));};exports[_0xb7ff('0x51')]=function(_0x21216c,_0x748616,_0x2da83b){var _0x6d0db={};var _0x879c33={};var _0x155fa7;var _0x1cdf63;return db['SugarcrmConfiguration'][_0xb7ff('0x52')]({'where':{'id':_0x21216c['params']['id']}})[_0xb7ff('0x26')](handleEntityNotFound(_0x748616,null))[_0xb7ff('0x26')](function(_0x3d8063){if(_0x3d8063){_0x155fa7=_0x3d8063;_0x879c33[_0xb7ff('0x34')]=_['keys'](db[_0xb7ff('0x50')]['rawAttributes']);_0x879c33[_0xb7ff('0x30')]=_[_0xb7ff('0x31')](_0x21216c[_0xb7ff('0x30')]);_0x879c33['filters']=_[_0xb7ff('0x33')](_0x879c33['model'],_0x879c33[_0xb7ff('0x30')]);_0x6d0db[_0xb7ff('0x35')]=_['intersection'](_0x879c33[_0xb7ff('0x34')],qs[_0xb7ff('0x36')](_0x21216c[_0xb7ff('0x30')][_0xb7ff('0x36')]));_0x6d0db[_0xb7ff('0x35')]=_0x6d0db[_0xb7ff('0x35')][_0xb7ff('0x37')]?_0x6d0db['attributes']:_0x879c33[_0xb7ff('0x34')];_0x6d0db[_0xb7ff('0x3a')]=qs[_0xb7ff('0x3b')](_0x21216c[_0xb7ff('0x30')][_0xb7ff('0x3b')]);_0x6d0db[_0xb7ff('0x3c')]=qs[_0xb7ff('0x32')](_[_0xb7ff('0x3d')](_0x21216c[_0xb7ff('0x30')],_0x879c33[_0xb7ff('0x32')]));if(_0x21216c[_0xb7ff('0x30')][_0xb7ff('0x3e')]){_0x6d0db[_0xb7ff('0x3c')]=_[_0xb7ff('0x3f')](_0x6d0db[_0xb7ff('0x3c')],{'$or':_['map'](_0x6d0db[_0xb7ff('0x35')],function(_0x379ff9){var _0x21d854={};_0x21d854[_0x379ff9]={'$like':'%'+_0x21216c['query'][_0xb7ff('0x3e')]+'%'};return _0x21d854;})});}_0x6d0db=_['merge']({},_0x6d0db,_0x21216c['options']);return _0x155fa7[_0xb7ff('0x51')](_0x6d0db);}})[_0xb7ff('0x26')](function(_0x23c3c5){if(_0x23c3c5){_0x1cdf63=_0x23c3c5['length'];if(!_0x21216c[_0xb7ff('0x30')][_0xb7ff('0x38')](_0xb7ff('0x39'))){_0x6d0db[_0xb7ff('0x1e')]=qs['limit'](_0x21216c[_0xb7ff('0x30')]['limit']);_0x6d0db[_0xb7ff('0x1c')]=qs[_0xb7ff('0x1c')](_0x21216c[_0xb7ff('0x30')][_0xb7ff('0x1c')]);}return _0x155fa7[_0xb7ff('0x51')](_0x6d0db);}})[_0xb7ff('0x26')](function(_0x294303){if(_0x294303){return _0x294303?{'count':_0x1cdf63,'rows':_0x294303}:null;}})['then'](respondWithResult(_0x748616,null))['catch'](handleError(_0x748616,null));};exports['getDescriptions']=function(_0x390f59,_0x307198,_0x271cbe){var _0x45cdc7={};var _0x15b6d9={};var _0x29964f;var _0x1a9af3;return db[_0xb7ff('0x2e')]['findOne']({'where':{'id':_0x390f59[_0xb7ff('0x4e')]['id']}})[_0xb7ff('0x26')](handleEntityNotFound(_0x307198,null))[_0xb7ff('0x26')](function(_0x1daf83){if(_0x1daf83){_0x29964f=_0x1daf83;_0x15b6d9['model']=_[_0xb7ff('0x31')](db[_0xb7ff('0x50')][_0xb7ff('0x49')]);_0x15b6d9[_0xb7ff('0x30')]=_[_0xb7ff('0x31')](_0x390f59['query']);_0x15b6d9['filters']=_[_0xb7ff('0x33')](_0x15b6d9[_0xb7ff('0x34')],_0x15b6d9[_0xb7ff('0x30')]);_0x45cdc7[_0xb7ff('0x35')]=_[_0xb7ff('0x33')](_0x15b6d9[_0xb7ff('0x34')],qs['fields'](_0x390f59['query'][_0xb7ff('0x36')]));_0x45cdc7[_0xb7ff('0x35')]=_0x45cdc7['attributes'][_0xb7ff('0x37')]?_0x45cdc7[_0xb7ff('0x35')]:_0x15b6d9[_0xb7ff('0x34')];_0x45cdc7[_0xb7ff('0x3a')]=qs[_0xb7ff('0x3b')](_0x390f59[_0xb7ff('0x30')][_0xb7ff('0x3b')]);_0x45cdc7[_0xb7ff('0x3c')]=qs[_0xb7ff('0x32')](_[_0xb7ff('0x3d')](_0x390f59[_0xb7ff('0x30')],_0x15b6d9[_0xb7ff('0x32')]));if(_0x390f59['query'][_0xb7ff('0x3e')]){_0x45cdc7[_0xb7ff('0x3c')]=_['merge'](_0x45cdc7[_0xb7ff('0x3c')],{'$or':_[_0xb7ff('0x2d')](_0x45cdc7[_0xb7ff('0x35')],function(_0x1ee7b0){var _0x177581={};_0x177581[_0x1ee7b0]={'$like':'%'+_0x390f59['query'][_0xb7ff('0x3e')]+'%'};return _0x177581;})});}_0x45cdc7=_[_0xb7ff('0x3f')]({},_0x45cdc7,_0x390f59['options']);return _0x29964f[_0xb7ff('0x53')](_0x45cdc7);}})[_0xb7ff('0x26')](function(_0x54c08c){if(_0x54c08c){_0x1a9af3=_0x54c08c[_0xb7ff('0x37')];if(!_0x390f59[_0xb7ff('0x30')][_0xb7ff('0x38')](_0xb7ff('0x39'))){_0x45cdc7[_0xb7ff('0x1e')]=qs[_0xb7ff('0x1e')](_0x390f59[_0xb7ff('0x30')][_0xb7ff('0x1e')]);_0x45cdc7['offset']=qs[_0xb7ff('0x1c')](_0x390f59[_0xb7ff('0x30')][_0xb7ff('0x1c')]);}return _0x29964f[_0xb7ff('0x53')](_0x45cdc7);}})[_0xb7ff('0x26')](function(_0x4f9df4){if(_0x4f9df4){return _0x4f9df4?{'count':_0x1a9af3,'rows':_0x4f9df4}:null;}})[_0xb7ff('0x26')](respondWithResult(_0x307198,null))[_0xb7ff('0x47')](handleError(_0x307198,null));}; \ No newline at end of file +var _0x55e4=['pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','params','getFields','findOne','SugarcrmField','order','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x1d7535,_0x55638b){var _0x49f25c=function(_0x1510f7){while(--_0x1510f7){_0x1d7535['push'](_0x1d7535['shift']());}};_0x49f25c(++_0x55638b);}(_0x55e4,0x103));var _0x455e=function(_0x14af59,_0xe28d1d){_0x14af59=_0x14af59-0x0;var _0x1a1058=_0x55e4[_0x14af59];return _0x1a1058;};'use strict';var emlformat=require(_0x455e('0x0'));var rimraf=require(_0x455e('0x1'));var zipdir=require(_0x455e('0x2'));var jsonpatch=require(_0x455e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x455e('0x4'));var Mustache=require(_0x455e('0x5'));var util=require(_0x455e('0x6'));var path=require(_0x455e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x455e('0x8'));var fs=require('fs');var fs_extra=require(_0x455e('0x9'));var _=require(_0x455e('0xa'));var squel=require(_0x455e('0xb'));var crypto=require(_0x455e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x455e('0xd'));var toCsv=require(_0x455e('0xe'));var querystring=require('querystring');var Papa=require(_0x455e('0xf'));var Redis=require(_0x455e('0x10'));var authService=require(_0x455e('0x11'));var qs=require(_0x455e('0x12'));var as=require(_0x455e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x455e('0x14'))(_0x455e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x455e('0x16'));var db=require(_0x455e('0x17'))['db'];function respondWithStatusCode(_0x4d7907,_0xa5577f){_0xa5577f=_0xa5577f||0xcc;return function(_0x55b925){if(_0x55b925){return _0x4d7907[_0x455e('0x18')](_0xa5577f);}return _0x4d7907[_0x455e('0x19')](_0xa5577f)[_0x455e('0x1a')]();};}function respondWithResult(_0x3ea93,_0x7511b1){_0x7511b1=_0x7511b1||0xc8;return function(_0x20c0b5){if(_0x20c0b5){return _0x3ea93[_0x455e('0x19')](_0x7511b1)[_0x455e('0x1b')](_0x20c0b5);}};}function respondWithFilteredResult(_0x1324a8,_0x1ab6fb){return function(_0x3be7dd){if(_0x3be7dd){var _0x25f984=typeof _0x1ab6fb[_0x455e('0x1c')]===_0x455e('0x1d')&&typeof _0x1ab6fb['limit']==='undefined';var _0xff0d01=_0x3be7dd[_0x455e('0x1e')];var _0x4299ec=_0x25f984?0x0:_0x1ab6fb[_0x455e('0x1c')];var _0xe41f5c=_0x25f984?_0x3be7dd[_0x455e('0x1e')]:_0x1ab6fb[_0x455e('0x1c')]+_0x1ab6fb[_0x455e('0x1f')];var _0x10f84f;if(_0xe41f5c>=_0xff0d01){_0xe41f5c=_0xff0d01;_0x10f84f=0xc8;}else{_0x10f84f=0xce;}_0x1324a8[_0x455e('0x19')](_0x10f84f);return _0x1324a8['set']('Content-Range',_0x4299ec+'-'+_0xe41f5c+'/'+_0xff0d01)[_0x455e('0x1b')](_0x3be7dd);}return null;};}function patchUpdates(_0x270c6b){return function(_0x3d1b2d){try{jsonpatch['apply'](_0x3d1b2d,_0x270c6b,!![]);}catch(_0x908b76){return BPromise[_0x455e('0x20')](_0x908b76);}return _0x3d1b2d[_0x455e('0x21')]();};}function saveUpdates(_0x308e56,_0x4147ac){return function(_0xba10e8){if(_0xba10e8){return _0xba10e8[_0x455e('0x22')](_0x308e56)[_0x455e('0x23')](function(_0x154dd8){return _0x154dd8;});}return null;};}function removeEntity(_0x22161b,_0x31735e){return function(_0x263df9){if(_0x263df9){return _0x263df9[_0x455e('0x24')]()[_0x455e('0x23')](function(){_0x22161b[_0x455e('0x19')](0xcc)[_0x455e('0x1a')]();});}};}function handleEntityNotFound(_0x436fb9,_0x458eee){return function(_0x2816af){if(!_0x2816af){_0x436fb9[_0x455e('0x18')](0x194);}return _0x2816af;};}function handleError(_0x188a49,_0x5ccd8f){_0x5ccd8f=_0x5ccd8f||0x1f4;return function(_0x247249){logger[_0x455e('0x25')](_0x247249[_0x455e('0x26')]);if(_0x247249[_0x455e('0x27')]){delete _0x247249['name'];}_0x188a49[_0x455e('0x19')](_0x5ccd8f)[_0x455e('0x28')](_0x247249);};}exports['index']=function(_0x28c2a4,_0x548e9e){var _0x40a025={},_0x1f9463={},_0x7bb732={'count':0x0,'rows':[]};var _0x252560=_[_0x455e('0x29')](db[_0x455e('0x2a')][_0x455e('0x2b')],function(_0x1abcf8){return{'name':_0x1abcf8[_0x455e('0x2c')],'type':_0x1abcf8[_0x455e('0x2d')]['key']};});_0x1f9463['model']=_[_0x455e('0x29')](_0x252560,_0x455e('0x27'));_0x1f9463[_0x455e('0x2e')]=_[_0x455e('0x2f')](_0x28c2a4[_0x455e('0x2e')]);_0x1f9463['filters']=_[_0x455e('0x30')](_0x1f9463[_0x455e('0x31')],_0x1f9463[_0x455e('0x2e')]);_0x40a025[_0x455e('0x32')]=_[_0x455e('0x30')](_0x1f9463[_0x455e('0x31')],qs[_0x455e('0x33')](_0x28c2a4['query']['fields']));_0x40a025[_0x455e('0x32')]=_0x40a025[_0x455e('0x32')]['length']?_0x40a025[_0x455e('0x32')]:_0x1f9463[_0x455e('0x31')];if(!_0x28c2a4[_0x455e('0x2e')][_0x455e('0x34')](_0x455e('0x35'))){_0x40a025[_0x455e('0x1f')]=qs['limit'](_0x28c2a4[_0x455e('0x2e')][_0x455e('0x1f')]);_0x40a025['offset']=qs[_0x455e('0x1c')](_0x28c2a4[_0x455e('0x2e')]['offset']);}_0x40a025['order']=qs['sort'](_0x28c2a4['query'][_0x455e('0x36')]);_0x40a025[_0x455e('0x37')]=qs[_0x455e('0x38')](_[_0x455e('0x39')](_0x28c2a4[_0x455e('0x2e')],_0x1f9463['filters']),_0x252560);if(_0x28c2a4['query']['filter']){_0x40a025[_0x455e('0x37')]=_[_0x455e('0x3a')](_0x40a025['where'],{'$or':_[_0x455e('0x29')](_0x252560,function(_0x2e51c6){if(_0x2e51c6[_0x455e('0x2d')]!==_0x455e('0x3b')){var _0x421ba7={};_0x421ba7[_0x2e51c6['name']]={'$like':'%'+_0x28c2a4[_0x455e('0x2e')]['filter']+'%'};return _0x421ba7;}})});}_0x40a025=_[_0x455e('0x3a')]({},_0x40a025,_0x28c2a4[_0x455e('0x3c')]);var _0x373633={'where':_0x40a025['where']};return db[_0x455e('0x2a')]['count'](_0x373633)[_0x455e('0x23')](function(_0x10cdf9){_0x7bb732[_0x455e('0x1e')]=_0x10cdf9;if(_0x28c2a4[_0x455e('0x2e')]['includeAll']){_0x40a025[_0x455e('0x3d')]=[{'all':!![]}];}return db[_0x455e('0x2a')][_0x455e('0x3e')](_0x40a025);})[_0x455e('0x23')](function(_0x38df6e){_0x7bb732[_0x455e('0x3f')]=_0x38df6e;return _0x7bb732;})['then'](respondWithFilteredResult(_0x548e9e,_0x40a025))[_0x455e('0x40')](handleError(_0x548e9e,null));};exports[_0x455e('0x41')]=function(_0x13aef1,_0x2dd29f){var _0xa52521={'raw':![],'where':{'id':_0x13aef1['params']['id']}},_0x14983e={};_0x14983e[_0x455e('0x31')]=_[_0x455e('0x2f')](db['SugarcrmConfiguration']['rawAttributes']);_0x14983e[_0x455e('0x2e')]=_['keys'](_0x13aef1[_0x455e('0x2e')]);_0x14983e[_0x455e('0x38')]=_[_0x455e('0x30')](_0x14983e[_0x455e('0x31')],_0x14983e[_0x455e('0x2e')]);_0xa52521[_0x455e('0x32')]=_['intersection'](_0x14983e['model'],qs['fields'](_0x13aef1[_0x455e('0x2e')][_0x455e('0x33')]));_0xa52521[_0x455e('0x32')]=_0xa52521[_0x455e('0x32')][_0x455e('0x42')]?_0xa52521['attributes']:_0x14983e['model'];if(_0x13aef1[_0x455e('0x2e')][_0x455e('0x43')]){_0xa52521[_0x455e('0x3d')]=[{'all':!![]}];}_0xa52521=_['merge']({},_0xa52521,_0x13aef1[_0x455e('0x3c')]);return db[_0x455e('0x2a')][_0x455e('0x44')](_0xa52521)[_0x455e('0x23')](handleEntityNotFound(_0x2dd29f,null))[_0x455e('0x23')](respondWithResult(_0x2dd29f,null))['catch'](handleError(_0x2dd29f,null));};exports[_0x455e('0x45')]=function(_0x51fd50,_0x228d8b){return db[_0x455e('0x2a')][_0x455e('0x45')](_0x51fd50['body'],{})[_0x455e('0x23')](respondWithResult(_0x228d8b,0xc9))['catch'](handleError(_0x228d8b,null));};exports[_0x455e('0x22')]=function(_0x13ee80,_0x54de3c){if(_0x13ee80['body']['id']){delete _0x13ee80[_0x455e('0x46')]['id'];}return db[_0x455e('0x2a')][_0x455e('0x44')]({'where':{'id':_0x13ee80[_0x455e('0x47')]['id']}})['then'](handleEntityNotFound(_0x54de3c,null))[_0x455e('0x23')](saveUpdates(_0x13ee80[_0x455e('0x46')],null))[_0x455e('0x23')](respondWithResult(_0x54de3c,null))[_0x455e('0x40')](handleError(_0x54de3c,null));};exports[_0x455e('0x24')]=function(_0x177b32,_0x452423){return db[_0x455e('0x2a')][_0x455e('0x44')]({'where':{'id':_0x177b32[_0x455e('0x47')]['id']}})['then'](handleEntityNotFound(_0x452423,null))[_0x455e('0x23')](removeEntity(_0x452423,null))['catch'](handleError(_0x452423,null));};exports[_0x455e('0x48')]=function(_0xfda417,_0x47af43,_0x21cd41){var _0x82cbf6={};var _0x528f43={};var _0x39aa13;var _0x506ac6;return db[_0x455e('0x2a')][_0x455e('0x49')]({'where':{'id':_0xfda417[_0x455e('0x47')]['id']}})['then'](handleEntityNotFound(_0x47af43,null))[_0x455e('0x23')](function(_0x42c8d2){if(_0x42c8d2){_0x39aa13=_0x42c8d2;_0x528f43[_0x455e('0x31')]=_['keys'](db[_0x455e('0x4a')][_0x455e('0x2b')]);_0x528f43[_0x455e('0x2e')]=_['keys'](_0xfda417['query']);_0x528f43[_0x455e('0x38')]=_[_0x455e('0x30')](_0x528f43['model'],_0x528f43['query']);_0x82cbf6[_0x455e('0x32')]=_[_0x455e('0x30')](_0x528f43[_0x455e('0x31')],qs[_0x455e('0x33')](_0xfda417[_0x455e('0x2e')][_0x455e('0x33')]));_0x82cbf6[_0x455e('0x32')]=_0x82cbf6['attributes']['length']?_0x82cbf6[_0x455e('0x32')]:_0x528f43['model'];_0x82cbf6[_0x455e('0x4b')]=qs[_0x455e('0x36')](_0xfda417[_0x455e('0x2e')][_0x455e('0x36')]);_0x82cbf6[_0x455e('0x37')]=qs[_0x455e('0x38')](_['pick'](_0xfda417[_0x455e('0x2e')],_0x528f43[_0x455e('0x38')]));if(_0xfda417[_0x455e('0x2e')][_0x455e('0x4c')]){_0x82cbf6[_0x455e('0x37')]=_[_0x455e('0x3a')](_0x82cbf6['where'],{'$or':_['map'](_0x82cbf6[_0x455e('0x32')],function(_0x2e005e){var _0x473f67={};_0x473f67[_0x2e005e]={'$like':'%'+_0xfda417[_0x455e('0x2e')]['filter']+'%'};return _0x473f67;})});}_0x82cbf6=_['merge']({},_0x82cbf6,_0xfda417['options']);return _0x39aa13['getFields'](_0x82cbf6);}})[_0x455e('0x23')](function(_0x3695f9){if(_0x3695f9){_0x506ac6=_0x3695f9[_0x455e('0x42')];if(!_0xfda417['query'][_0x455e('0x34')](_0x455e('0x35'))){_0x82cbf6[_0x455e('0x1f')]=qs[_0x455e('0x1f')](_0xfda417[_0x455e('0x2e')][_0x455e('0x1f')]);_0x82cbf6[_0x455e('0x1c')]=qs[_0x455e('0x1c')](_0xfda417[_0x455e('0x2e')][_0x455e('0x1c')]);}return _0x39aa13['getFields'](_0x82cbf6);}})[_0x455e('0x23')](function(_0x4676ce){if(_0x4676ce){return _0x4676ce?{'count':_0x506ac6,'rows':_0x4676ce}:null;}})[_0x455e('0x23')](respondWithResult(_0x47af43,null))['catch'](handleError(_0x47af43,null));};exports[_0x455e('0x4d')]=function(_0x360adb,_0x1aed84,_0x4b1cd6){var _0x258b2c={};var _0x386684={};var _0x509108;var _0x55ff15;return db[_0x455e('0x2a')][_0x455e('0x49')]({'where':{'id':_0x360adb[_0x455e('0x47')]['id']}})[_0x455e('0x23')](handleEntityNotFound(_0x1aed84,null))['then'](function(_0x5375e6){if(_0x5375e6){_0x509108=_0x5375e6;_0x386684[_0x455e('0x31')]=_[_0x455e('0x2f')](db['SugarcrmField'][_0x455e('0x2b')]);_0x386684[_0x455e('0x2e')]=_[_0x455e('0x2f')](_0x360adb['query']);_0x386684['filters']=_[_0x455e('0x30')](_0x386684[_0x455e('0x31')],_0x386684[_0x455e('0x2e')]);_0x258b2c[_0x455e('0x32')]=_[_0x455e('0x30')](_0x386684[_0x455e('0x31')],qs[_0x455e('0x33')](_0x360adb[_0x455e('0x2e')][_0x455e('0x33')]));_0x258b2c[_0x455e('0x32')]=_0x258b2c[_0x455e('0x32')][_0x455e('0x42')]?_0x258b2c['attributes']:_0x386684[_0x455e('0x31')];_0x258b2c[_0x455e('0x4b')]=qs['sort'](_0x360adb[_0x455e('0x2e')][_0x455e('0x36')]);_0x258b2c[_0x455e('0x37')]=qs[_0x455e('0x38')](_[_0x455e('0x39')](_0x360adb[_0x455e('0x2e')],_0x386684[_0x455e('0x38')]));if(_0x360adb[_0x455e('0x2e')][_0x455e('0x4c')]){_0x258b2c[_0x455e('0x37')]=_[_0x455e('0x3a')](_0x258b2c[_0x455e('0x37')],{'$or':_['map'](_0x258b2c[_0x455e('0x32')],function(_0x307ff7){var _0x4e7233={};_0x4e7233[_0x307ff7]={'$like':'%'+_0x360adb[_0x455e('0x2e')][_0x455e('0x4c')]+'%'};return _0x4e7233;})});}_0x258b2c=_[_0x455e('0x3a')]({},_0x258b2c,_0x360adb[_0x455e('0x3c')]);return _0x509108['getSubjects'](_0x258b2c);}})['then'](function(_0x480725){if(_0x480725){_0x55ff15=_0x480725[_0x455e('0x42')];if(!_0x360adb['query'][_0x455e('0x34')]('nolimit')){_0x258b2c[_0x455e('0x1f')]=qs[_0x455e('0x1f')](_0x360adb[_0x455e('0x2e')][_0x455e('0x1f')]);_0x258b2c[_0x455e('0x1c')]=qs['offset'](_0x360adb['query'][_0x455e('0x1c')]);}return _0x509108[_0x455e('0x4d')](_0x258b2c);}})[_0x455e('0x23')](function(_0x1580aa){if(_0x1580aa){return _0x1580aa?{'count':_0x55ff15,'rows':_0x1580aa}:null;}})[_0x455e('0x23')](respondWithResult(_0x1aed84,null))[_0x455e('0x40')](handleError(_0x1aed84,null));};exports[_0x455e('0x4e')]=function(_0x308625,_0x9a8909,_0xda59e7){var _0x258b20={};var _0x4ffe9e={};var _0x2df980;var _0x175138;return db[_0x455e('0x2a')]['findOne']({'where':{'id':_0x308625[_0x455e('0x47')]['id']}})[_0x455e('0x23')](handleEntityNotFound(_0x9a8909,null))[_0x455e('0x23')](function(_0x535b86){if(_0x535b86){_0x2df980=_0x535b86;_0x4ffe9e[_0x455e('0x31')]=_[_0x455e('0x2f')](db[_0x455e('0x4a')]['rawAttributes']);_0x4ffe9e[_0x455e('0x2e')]=_['keys'](_0x308625[_0x455e('0x2e')]);_0x4ffe9e[_0x455e('0x38')]=_[_0x455e('0x30')](_0x4ffe9e[_0x455e('0x31')],_0x4ffe9e[_0x455e('0x2e')]);_0x258b20[_0x455e('0x32')]=_[_0x455e('0x30')](_0x4ffe9e['model'],qs[_0x455e('0x33')](_0x308625['query']['fields']));_0x258b20[_0x455e('0x32')]=_0x258b20[_0x455e('0x32')]['length']?_0x258b20[_0x455e('0x32')]:_0x4ffe9e['model'];_0x258b20[_0x455e('0x4b')]=qs[_0x455e('0x36')](_0x308625[_0x455e('0x2e')][_0x455e('0x36')]);_0x258b20[_0x455e('0x37')]=qs[_0x455e('0x38')](_[_0x455e('0x39')](_0x308625['query'],_0x4ffe9e[_0x455e('0x38')]));if(_0x308625[_0x455e('0x2e')][_0x455e('0x4c')]){_0x258b20[_0x455e('0x37')]=_['merge'](_0x258b20[_0x455e('0x37')],{'$or':_[_0x455e('0x29')](_0x258b20['attributes'],function(_0xd1ee78){var _0x9c6889={};_0x9c6889[_0xd1ee78]={'$like':'%'+_0x308625['query'][_0x455e('0x4c')]+'%'};return _0x9c6889;})});}_0x258b20=_[_0x455e('0x3a')]({},_0x258b20,_0x308625[_0x455e('0x3c')]);return _0x2df980[_0x455e('0x4e')](_0x258b20);}})[_0x455e('0x23')](function(_0x241269){if(_0x241269){_0x175138=_0x241269[_0x455e('0x42')];if(!_0x308625[_0x455e('0x2e')][_0x455e('0x34')](_0x455e('0x35'))){_0x258b20[_0x455e('0x1f')]=qs[_0x455e('0x1f')](_0x308625[_0x455e('0x2e')]['limit']);_0x258b20['offset']=qs[_0x455e('0x1c')](_0x308625[_0x455e('0x2e')]['offset']);}return _0x2df980[_0x455e('0x4e')](_0x258b20);}})[_0x455e('0x23')](function(_0x1f4d00){if(_0x1f4d00){return _0x1f4d00?{'count':_0x175138,'rows':_0x1f4d00}:null;}})[_0x455e('0x23')](respondWithResult(_0x9a8909,null))['catch'](handleError(_0x9a8909,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 6748c05..734fa77 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 _0xb3c4=['moment','request-promise','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api'];(function(_0x250416,_0x4255bd){var _0x4d4f14=function(_0x5b4036){while(--_0x5b4036){_0x250416['push'](_0x250416['shift']());}};_0x4d4f14(++_0x4255bd);}(_0xb3c4,0x10b));var _0x4b3c=function(_0x18aee7,_0x3b432f){_0x18aee7=_0x18aee7-0x0;var _0x4cbd28=_0xb3c4[_0x18aee7];return _0x4cbd28;};'use strict';var _=require(_0x4b3c('0x0'));var util=require(_0x4b3c('0x1'));var logger=require('../../config/logger')(_0x4b3c('0x2'));var moment=require(_0x4b3c('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b3c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x4b3c('0x5')]=function(_0x2bee6b,_0x183015){return _0x2bee6b[_0x4b3c('0x6')](_0x4b3c('0x7'),attributes,{'tableName':_0x4b3c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb14f=['../../config/environment','exports','define','int_sugarcrm_configurations','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb14f,0x190));var _0xfb14=function(_0x4e39a2,_0x1e7487){_0x4e39a2=_0x4e39a2-0x0;var _0x576caa=_0xb14f[_0x4e39a2];return _0x576caa;};'use strict';var _=require(_0xfb14('0x0'));var util=require(_0xfb14('0x1'));var logger=require('../../config/logger')(_0xfb14('0x2'));var moment=require('moment');var BPromise=require(_0xfb14('0x3'));var rp=require(_0xfb14('0x4'));var fs=require('fs');var path=require(_0xfb14('0x5'));var rimraf=require(_0xfb14('0x6'));var config=require(_0xfb14('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xfb14('0x8')]=function(_0x19be8f,_0x2bfb59){return _0x19be8f[_0xfb14('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0xfb14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 102c70c..e7f18d1 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 _0xd198=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd198,0x10e));var _0x8d19=function(_0x236e98,_0x3c93cc){_0x236e98=_0x236e98-0x0;var _0x4d0037=_0xd198[_0x236e98];return _0x4d0037;};'use strict';var _=require(_0x8d19('0x0'));var util=require(_0x8d19('0x1'));var moment=require(_0x8d19('0x2'));var BPromise=require('bluebird');var rs=require(_0x8d19('0x3'));var fs=require('fs');var Redis=require(_0x8d19('0x4'));var db=require(_0x8d19('0x5'))['db'];var utils=require(_0x8d19('0x6'));var logger=require(_0x8d19('0x7'))(_0x8d19('0x8'));var config=require(_0x8d19('0x9'));var jayson=require(_0x8d19('0xa'));var client=jayson[_0x8d19('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59c75b,_0x5621ca,_0x19c805){return new BPromise(function(_0x419a49,_0x5373ae){return client[_0x8d19('0xc')](_0x59c75b,_0x19c805)[_0x8d19('0xd')](function(_0x9cd4a7){logger['info'](_0x8d19('0xe'),_0x5621ca,'request\x20sent');logger[_0x8d19('0xf')](_0x8d19('0x10'),_0x5621ca,_0x8d19('0x11'),JSON['stringify'](_0x9cd4a7));if(_0x9cd4a7['error']){if(_0x9cd4a7[_0x8d19('0x12')]['code']===0x1f4){logger[_0x8d19('0x12')](_0x8d19('0xe'),_0x5621ca,_0x9cd4a7[_0x8d19('0x12')][_0x8d19('0x13')]);return _0x5373ae(_0x9cd4a7[_0x8d19('0x12')][_0x8d19('0x13')]);}logger[_0x8d19('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5621ca,_0x9cd4a7[_0x8d19('0x12')]['message']);return _0x419a49(_0x9cd4a7[_0x8d19('0x12')][_0x8d19('0x13')]);}else{logger[_0x8d19('0x14')](_0x8d19('0xe'),_0x5621ca,_0x8d19('0x11'));_0x419a49(_0x9cd4a7[_0x8d19('0x15')][_0x8d19('0x13')]);}})[_0x8d19('0x16')](function(_0x4dbed0){logger[_0x8d19('0x12')](_0x8d19('0xe'),_0x5621ca,_0x4dbed0);_0x5373ae(_0x4dbed0);});});} \ No newline at end of file +var _0x01ce=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment'];(function(_0x1a5ec3,_0xb77a11){var _0x573a9b=function(_0xb3771e){while(--_0xb3771e){_0x1a5ec3['push'](_0x1a5ec3['shift']());}};_0x573a9b(++_0xb77a11);}(_0x01ce,0x1a0));var _0xe01c=function(_0xe7d504,_0x14d181){_0xe7d504=_0xe7d504-0x0;var _0x466b0c=_0x01ce[_0xe7d504];return _0x466b0c;};'use strict';var _=require(_0xe01c('0x0'));var util=require('util');var moment=require(_0xe01c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe01c('0x2'));var fs=require('fs');var Redis=require(_0xe01c('0x3'));var db=require(_0xe01c('0x4'))['db'];var utils=require(_0xe01c('0x5'));var logger=require(_0xe01c('0x6'))(_0xe01c('0x7'));var config=require(_0xe01c('0x8'));var jayson=require(_0xe01c('0x9'));var client=jayson[_0xe01c('0xa')][_0xe01c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b4416,_0xc42452,_0x204ba8){return new BPromise(function(_0x54a85a,_0x28064c){return client[_0xe01c('0xc')](_0x1b4416,_0x204ba8)[_0xe01c('0xd')](function(_0x488f4c){logger['info'](_0xe01c('0xe'),_0xc42452,_0xe01c('0xf'));logger['debug'](_0xe01c('0x10'),_0xc42452,_0xe01c('0xf'),JSON[_0xe01c('0x11')](_0x488f4c));if(_0x488f4c['error']){if(_0x488f4c[_0xe01c('0x12')]['code']===0x1f4){logger[_0xe01c('0x12')](_0xe01c('0xe'),_0xc42452,_0x488f4c[_0xe01c('0x12')][_0xe01c('0x13')]);return _0x28064c(_0x488f4c[_0xe01c('0x12')]['message']);}logger[_0xe01c('0x12')](_0xe01c('0xe'),_0xc42452,_0x488f4c[_0xe01c('0x12')][_0xe01c('0x13')]);return _0x54a85a(_0x488f4c[_0xe01c('0x12')][_0xe01c('0x13')]);}else{logger[_0xe01c('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc42452,'request\x20sent');_0x54a85a(_0x488f4c[_0xe01c('0x15')][_0xe01c('0x13')]);}})['catch'](function(_0x1a08e7){logger[_0xe01c('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc42452,_0x1a08e7);_0x28064c(_0x1a08e7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 57a4812..59d76c5 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 _0x1f56=['post','create','update','delete','util','path','connect-timeout','express','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated'];(function(_0x8e1994,_0x10d574){var _0x57385a=function(_0x136234){while(--_0x136234){_0x8e1994['push'](_0x8e1994['shift']());}};_0x57385a(++_0x10d574);}(_0x1f56,0xd6));var _0x61f5=function(_0x530781,_0x1e144f){_0x530781=_0x530781-0x0;var _0x579d06=_0x1f56[_0x530781];return _0x579d06;};'use strict';var multer=require('multer');var util=require(_0x61f5('0x0'));var path=require(_0x61f5('0x1'));var timeout=require(_0x61f5('0x2'));var express=require(_0x61f5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x61f5('0x4'));var controller=require(_0x61f5('0x5'));router[_0x61f5('0x6')]('/',auth['isAuthenticated'](),controller[_0x61f5('0x7')]);router['get'](_0x61f5('0x8'),auth[_0x61f5('0x9')](),controller['show']);router[_0x61f5('0xa')]('/',auth[_0x61f5('0x9')](),controller[_0x61f5('0xb')]);router['put'](_0x61f5('0x8'),auth['isAuthenticated'](),controller[_0x61f5('0xc')]);router[_0x61f5('0xd')](_0x61f5('0x8'),auth[_0x61f5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8b72=['index','post','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x5973ee,_0x4a097f){var _0x2b88d1=function(_0x41b792){while(--_0x41b792){_0x5973ee['push'](_0x5973ee['shift']());}};_0x2b88d1(++_0x4a097f);}(_0x8b72,0x1c9));var _0x28b7=function(_0x54cf90,_0x52c4ae){_0x54cf90=_0x54cf90-0x0;var _0x3c4781=_0x8b72[_0x54cf90];return _0x3c4781;};'use strict';var multer=require(_0x28b7('0x0'));var util=require(_0x28b7('0x1'));var path=require('path');var timeout=require(_0x28b7('0x2'));var express=require(_0x28b7('0x3'));var router=express['Router']();var fs_extra=require(_0x28b7('0x4'));var auth=require(_0x28b7('0x5'));var interaction=require(_0x28b7('0x6'));var config=require(_0x28b7('0x7'));var controller=require(_0x28b7('0x8'));router[_0x28b7('0x9')]('/',auth[_0x28b7('0xa')](),controller[_0x28b7('0xb')]);router['get']('/:id',auth[_0x28b7('0xa')](),controller['show']);router[_0x28b7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x28b7('0xd')](_0x28b7('0xe'),auth[_0x28b7('0xa')](),controller[_0x28b7('0xf')]);router['delete'](_0x28b7('0xe'),auth[_0x28b7('0xa')](),controller[_0x28b7('0x10')]);module[_0x28b7('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 0b1dc52..5fe829d 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 _0xdee6=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xdee6,0xb5));var _0x6dee=function(_0x4e2e3c,_0x39ece3){_0x4e2e3c=_0x4e2e3c-0x0;var _0x5ee23e=_0xdee6[_0x4e2e3c];return _0x5ee23e;};'use strict';var Sequelize=require(_0x6dee('0x0'));module[_0x6dee('0x1')]={'type':{'type':Sequelize[_0x6dee('0x2')]('string','variable',_0x6dee('0x3'),_0x6dee('0x4'),_0x6dee('0x5')),'defaultValue':_0x6dee('0x6')},'content':{'type':Sequelize[_0x6dee('0x7')]},'key':{'type':Sequelize[_0x6dee('0x7')]},'keyType':{'type':Sequelize[_0x6dee('0x2')](_0x6dee('0x6'),_0x6dee('0x8'),_0x6dee('0x3'))},'keyContent':{'type':Sequelize[_0x6dee('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6dee('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6dee('0x7')]}}; \ No newline at end of file +var _0x2727=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x5de933,_0x3551d6){var _0x41d632=function(_0x7f1ae0){while(--_0x7f1ae0){_0x5de933['push'](_0x5de933['shift']());}};_0x41d632(++_0x3551d6);}(_0x2727,0x66));var _0x7272=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x2727[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x7272('0x0'));module[_0x7272('0x1')]={'type':{'type':Sequelize[_0x7272('0x2')](_0x7272('0x3'),_0x7272('0x4'),_0x7272('0x5'),'keyValue',_0x7272('0x6')),'defaultValue':_0x7272('0x3')},'content':{'type':Sequelize[_0x7272('0x7')]},'key':{'type':Sequelize[_0x7272('0x7')]},'keyType':{'type':Sequelize[_0x7272('0x2')]('string',_0x7272('0x4'),_0x7272('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7272('0x7')]},'customField':{'type':Sequelize[_0x7272('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7272('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index f58bfe8..899b33e 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 _0x9a89=['offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x9a89,0x72));var _0x99a8=function(_0x4dd728,_0x4835b5){_0x4dd728=_0x4dd728-0x0;var _0x273da0=_0x9a89[_0x4dd728];return _0x273da0;};'use strict';var emlformat=require(_0x99a8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x99a8('0x1'));var rp=require(_0x99a8('0x2'));var moment=require('moment');var BPromise=require(_0x99a8('0x3'));var Mustache=require(_0x99a8('0x4'));var util=require(_0x99a8('0x5'));var path=require(_0x99a8('0x6'));var sox=require(_0x99a8('0x7'));var csv=require(_0x99a8('0x8'));var ejs=require(_0x99a8('0x9'));var fs=require('fs');var fs_extra=require(_0x99a8('0xa'));var _=require(_0x99a8('0xb'));var squel=require(_0x99a8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x99a8('0x8'));var querystring=require(_0x99a8('0xd'));var Papa=require(_0x99a8('0xe'));var Redis=require('ioredis');var authService=require(_0x99a8('0xf'));var qs=require(_0x99a8('0x10'));var as=require(_0x99a8('0x11'));var hardwareService=require(_0x99a8('0x12'));var logger=require(_0x99a8('0x13'))(_0x99a8('0x14'));var utils=require(_0x99a8('0x15'));var config=require(_0x99a8('0x16'));var licenseUtil=require(_0x99a8('0x17'));var db=require(_0x99a8('0x18'))['db'];function respondWithStatusCode(_0x2ade12,_0x456da0){_0x456da0=_0x456da0||0xcc;return function(_0x4f4f0f){if(_0x4f4f0f){return _0x2ade12[_0x99a8('0x19')](_0x456da0);}return _0x2ade12[_0x99a8('0x1a')](_0x456da0)[_0x99a8('0x1b')]();};}function respondWithResult(_0x3c35ad,_0x52e90f){_0x52e90f=_0x52e90f||0xc8;return function(_0x455735){if(_0x455735){return _0x3c35ad[_0x99a8('0x1a')](_0x52e90f)[_0x99a8('0x1c')](_0x455735);}};}function respondWithFilteredResult(_0x39a95a,_0x3064d3){return function(_0x218155){if(_0x218155){var _0x3e8af7=typeof _0x3064d3['offset']===_0x99a8('0x1d')&&typeof _0x3064d3[_0x99a8('0x1e')]===_0x99a8('0x1d');var _0x278122=_0x218155[_0x99a8('0x1f')];var _0x2390ef=_0x3e8af7?0x0:_0x3064d3[_0x99a8('0x20')];var _0x22efe1=_0x3e8af7?_0x218155[_0x99a8('0x1f')]:_0x3064d3['offset']+_0x3064d3[_0x99a8('0x1e')];var _0x54e54a;if(_0x22efe1>=_0x278122){_0x22efe1=_0x278122;_0x54e54a=0xc8;}else{_0x54e54a=0xce;}_0x39a95a[_0x99a8('0x1a')](_0x54e54a);return _0x39a95a[_0x99a8('0x21')](_0x99a8('0x22'),_0x2390ef+'-'+_0x22efe1+'/'+_0x278122)[_0x99a8('0x1c')](_0x218155);}return null;};}function patchUpdates(_0x44feb7){return function(_0x5de522){try{jsonpatch['apply'](_0x5de522,_0x44feb7,!![]);}catch(_0xe1b7b0){return BPromise[_0x99a8('0x23')](_0xe1b7b0);}return _0x5de522['save']();};}function saveUpdates(_0x1f4b25,_0x4a137b){return function(_0x7e2fcd){if(_0x7e2fcd){return _0x7e2fcd[_0x99a8('0x24')](_0x1f4b25)[_0x99a8('0x25')](function(_0xfe5093){return _0xfe5093;});}return null;};}function removeEntity(_0x3bdc2e,_0xefbcc8){return function(_0xa7ddbb){if(_0xa7ddbb){return _0xa7ddbb[_0x99a8('0x26')]()[_0x99a8('0x25')](function(){_0x3bdc2e[_0x99a8('0x1a')](0xcc)[_0x99a8('0x1b')]();});}};}function handleEntityNotFound(_0x5b7c26,_0x557b3e){return function(_0x5671cc){if(!_0x5671cc){_0x5b7c26[_0x99a8('0x19')](0x194);}return _0x5671cc;};}function handleError(_0x590fad,_0x4ba9b7){_0x4ba9b7=_0x4ba9b7||0x1f4;return function(_0xbf6c90){logger[_0x99a8('0x27')](_0xbf6c90[_0x99a8('0x28')]);if(_0xbf6c90[_0x99a8('0x29')]){delete _0xbf6c90['name'];}_0x590fad[_0x99a8('0x1a')](_0x4ba9b7)[_0x99a8('0x2a')](_0xbf6c90);};}exports[_0x99a8('0x2b')]=function(_0x166080,_0x3bcb36){var _0x3eafbe={},_0x3a9789={},_0x70f15={'count':0x0,'rows':[]};var _0x16712a=_[_0x99a8('0x2c')](db[_0x99a8('0x2d')][_0x99a8('0x2e')],function(_0xa485a8){return{'name':_0xa485a8[_0x99a8('0x2f')],'type':_0xa485a8[_0x99a8('0x30')][_0x99a8('0x31')]};});_0x3a9789[_0x99a8('0x32')]=_['map'](_0x16712a,_0x99a8('0x29'));_0x3a9789[_0x99a8('0x33')]=_[_0x99a8('0x34')](_0x166080['query']);_0x3a9789[_0x99a8('0x35')]=_[_0x99a8('0x36')](_0x3a9789['model'],_0x3a9789[_0x99a8('0x33')]);_0x3eafbe[_0x99a8('0x37')]=_[_0x99a8('0x36')](_0x3a9789['model'],qs[_0x99a8('0x38')](_0x166080['query'][_0x99a8('0x38')]));_0x3eafbe['attributes']=_0x3eafbe['attributes'][_0x99a8('0x39')]?_0x3eafbe[_0x99a8('0x37')]:_0x3a9789[_0x99a8('0x32')];if(!_0x166080[_0x99a8('0x33')]['hasOwnProperty']('nolimit')){_0x3eafbe[_0x99a8('0x1e')]=qs['limit'](_0x166080[_0x99a8('0x33')]['limit']);_0x3eafbe[_0x99a8('0x20')]=qs[_0x99a8('0x20')](_0x166080[_0x99a8('0x33')][_0x99a8('0x20')]);}_0x3eafbe['order']=qs[_0x99a8('0x3a')](_0x166080[_0x99a8('0x33')]['sort']);_0x3eafbe[_0x99a8('0x3b')]=qs[_0x99a8('0x35')](_['pick'](_0x166080[_0x99a8('0x33')],_0x3a9789['filters']),_0x16712a);if(_0x166080['query'][_0x99a8('0x3c')]){_0x3eafbe[_0x99a8('0x3b')]=_['merge'](_0x3eafbe[_0x99a8('0x3b')],{'$or':_['map'](_0x16712a,function(_0x23bfa3){if(_0x23bfa3[_0x99a8('0x30')]!==_0x99a8('0x3d')){var _0x4d206f={};_0x4d206f[_0x23bfa3[_0x99a8('0x29')]]={'$like':'%'+_0x166080[_0x99a8('0x33')][_0x99a8('0x3c')]+'%'};return _0x4d206f;}})});}_0x3eafbe=_[_0x99a8('0x3e')]({},_0x3eafbe,_0x166080[_0x99a8('0x3f')]);var _0x44377f={'where':_0x3eafbe[_0x99a8('0x3b')]};return db['SugarcrmField'][_0x99a8('0x1f')](_0x44377f)[_0x99a8('0x25')](function(_0x55fd13){_0x70f15[_0x99a8('0x1f')]=_0x55fd13;if(_0x166080[_0x99a8('0x33')][_0x99a8('0x40')]){_0x3eafbe['include']=[{'all':!![]}];}return db['SugarcrmField'][_0x99a8('0x41')](_0x3eafbe);})[_0x99a8('0x25')](function(_0x132640){_0x70f15[_0x99a8('0x42')]=_0x132640;return _0x70f15;})['then'](respondWithFilteredResult(_0x3bcb36,_0x3eafbe))[_0x99a8('0x43')](handleError(_0x3bcb36,null));};exports[_0x99a8('0x44')]=function(_0x425e66,_0x2bddd7){var _0x5dac5a={'raw':!![],'where':{'id':_0x425e66[_0x99a8('0x45')]['id']}},_0x24c1e8={};_0x24c1e8[_0x99a8('0x32')]=_[_0x99a8('0x34')](db[_0x99a8('0x2d')][_0x99a8('0x2e')]);_0x24c1e8[_0x99a8('0x33')]=_[_0x99a8('0x34')](_0x425e66[_0x99a8('0x33')]);_0x24c1e8['filters']=_[_0x99a8('0x36')](_0x24c1e8[_0x99a8('0x32')],_0x24c1e8[_0x99a8('0x33')]);_0x5dac5a['attributes']=_[_0x99a8('0x36')](_0x24c1e8[_0x99a8('0x32')],qs['fields'](_0x425e66[_0x99a8('0x33')]['fields']));_0x5dac5a[_0x99a8('0x37')]=_0x5dac5a[_0x99a8('0x37')][_0x99a8('0x39')]?_0x5dac5a[_0x99a8('0x37')]:_0x24c1e8[_0x99a8('0x32')];if(_0x425e66[_0x99a8('0x33')]['includeAll']){_0x5dac5a['include']=[{'all':!![]}];}_0x5dac5a=_[_0x99a8('0x3e')]({},_0x5dac5a,_0x425e66['options']);return db[_0x99a8('0x2d')][_0x99a8('0x46')](_0x5dac5a)[_0x99a8('0x25')](handleEntityNotFound(_0x2bddd7,null))[_0x99a8('0x25')](respondWithResult(_0x2bddd7,null))[_0x99a8('0x43')](handleError(_0x2bddd7,null));};exports[_0x99a8('0x47')]=function(_0x995943,_0x5d40c8){return db['SugarcrmField']['create'](_0x995943[_0x99a8('0x48')],{})[_0x99a8('0x25')](respondWithResult(_0x5d40c8,0xc9))[_0x99a8('0x43')](handleError(_0x5d40c8,null));};exports['update']=function(_0xca7215,_0x6819f4){if(_0xca7215[_0x99a8('0x48')]['id']){delete _0xca7215[_0x99a8('0x48')]['id'];}return db[_0x99a8('0x2d')][_0x99a8('0x46')]({'where':{'id':_0xca7215['params']['id']}})[_0x99a8('0x25')](handleEntityNotFound(_0x6819f4,null))['then'](saveUpdates(_0xca7215[_0x99a8('0x48')],null))[_0x99a8('0x25')](respondWithResult(_0x6819f4,null))[_0x99a8('0x43')](handleError(_0x6819f4,null));};exports[_0x99a8('0x26')]=function(_0x2c2bc5,_0x109629){return db[_0x99a8('0x2d')][_0x99a8('0x46')]({'where':{'id':_0x2c2bc5['params']['id']}})['then'](handleEntityNotFound(_0x109629,null))['then'](removeEntity(_0x109629,null))[_0x99a8('0x43')](handleError(_0x109629,null));}; \ No newline at end of file +var _0x952a=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','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','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','map','SugarcrmField','rawAttributes','fieldName'];(function(_0x2e0a65,_0x40eb16){var _0x280a6a=function(_0x4d0c2a){while(--_0x4d0c2a){_0x2e0a65['push'](_0x2e0a65['shift']());}};_0x280a6a(++_0x40eb16);}(_0x952a,0x107));var _0xa952=function(_0x1b9106,_0x174dff){_0x1b9106=_0x1b9106-0x0;var _0x4d57e8=_0x952a[_0x1b9106];return _0x4d57e8;};'use strict';var emlformat=require(_0xa952('0x0'));var rimraf=require(_0xa952('0x1'));var zipdir=require(_0xa952('0x2'));var jsonpatch=require(_0xa952('0x3'));var rp=require(_0xa952('0x4'));var moment=require(_0xa952('0x5'));var BPromise=require(_0xa952('0x6'));var Mustache=require('mustache');var util=require(_0xa952('0x7'));var path=require(_0xa952('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa952('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa952('0xa'));var squel=require(_0xa952('0xb'));var crypto=require(_0xa952('0xc'));var jsforce=require(_0xa952('0xd'));var deskjs=require(_0xa952('0xe'));var toCsv=require(_0xa952('0xf'));var querystring=require(_0xa952('0x10'));var Papa=require(_0xa952('0x11'));var Redis=require(_0xa952('0x12'));var authService=require(_0xa952('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa952('0x14'));var hardwareService=require(_0xa952('0x15'));var logger=require('../../config/logger')(_0xa952('0x16'));var utils=require(_0xa952('0x17'));var config=require(_0xa952('0x18'));var licenseUtil=require(_0xa952('0x19'));var db=require(_0xa952('0x1a'))['db'];function respondWithStatusCode(_0x3e3720,_0x37be65){_0x37be65=_0x37be65||0xcc;return function(_0x14888){if(_0x14888){return _0x3e3720['sendStatus'](_0x37be65);}return _0x3e3720[_0xa952('0x1b')](_0x37be65)[_0xa952('0x1c')]();};}function respondWithResult(_0x131c8b,_0x264711){_0x264711=_0x264711||0xc8;return function(_0xfb85b9){if(_0xfb85b9){return _0x131c8b[_0xa952('0x1b')](_0x264711)['json'](_0xfb85b9);}};}function respondWithFilteredResult(_0x289c1e,_0x27250){return function(_0xbb7b4){if(_0xbb7b4){var _0x22357f=typeof _0x27250[_0xa952('0x1d')]==='undefined'&&typeof _0x27250[_0xa952('0x1e')]===_0xa952('0x1f');var _0x5241e1=_0xbb7b4[_0xa952('0x20')];var _0x76b419=_0x22357f?0x0:_0x27250['offset'];var _0x5704d6=_0x22357f?_0xbb7b4[_0xa952('0x20')]:_0x27250[_0xa952('0x1d')]+_0x27250[_0xa952('0x1e')];var _0x5e3032;if(_0x5704d6>=_0x5241e1){_0x5704d6=_0x5241e1;_0x5e3032=0xc8;}else{_0x5e3032=0xce;}_0x289c1e[_0xa952('0x1b')](_0x5e3032);return _0x289c1e[_0xa952('0x21')](_0xa952('0x22'),_0x76b419+'-'+_0x5704d6+'/'+_0x5241e1)[_0xa952('0x23')](_0xbb7b4);}return null;};}function patchUpdates(_0x35807d){return function(_0x10377c){try{jsonpatch[_0xa952('0x24')](_0x10377c,_0x35807d,!![]);}catch(_0x4cef31){return BPromise[_0xa952('0x25')](_0x4cef31);}return _0x10377c[_0xa952('0x26')]();};}function saveUpdates(_0x5b32e7,_0x3eb9c6){return function(_0x440fd5){if(_0x440fd5){return _0x440fd5[_0xa952('0x27')](_0x5b32e7)[_0xa952('0x28')](function(_0x50e896){return _0x50e896;});}return null;};}function removeEntity(_0x122e48,_0x58e9cf){return function(_0x49da41){if(_0x49da41){return _0x49da41['destroy']()[_0xa952('0x28')](function(){_0x122e48[_0xa952('0x1b')](0xcc)[_0xa952('0x1c')]();});}};}function handleEntityNotFound(_0x2713b9,_0x1e7d62){return function(_0x532e34){if(!_0x532e34){_0x2713b9[_0xa952('0x29')](0x194);}return _0x532e34;};}function handleError(_0x2953e5,_0x3ef12d){_0x3ef12d=_0x3ef12d||0x1f4;return function(_0x4366c9){logger['error'](_0x4366c9[_0xa952('0x2a')]);if(_0x4366c9[_0xa952('0x2b')]){delete _0x4366c9['name'];}_0x2953e5[_0xa952('0x1b')](_0x3ef12d)[_0xa952('0x2c')](_0x4366c9);};}exports['index']=function(_0x2f9016,_0x557576){var _0x1f8b4a={},_0x39a021={},_0x4ab460={'count':0x0,'rows':[]};var _0x4c228a=_[_0xa952('0x2d')](db[_0xa952('0x2e')][_0xa952('0x2f')],function(_0x30bd46){return{'name':_0x30bd46[_0xa952('0x30')],'type':_0x30bd46['type'][_0xa952('0x31')]};});_0x39a021[_0xa952('0x32')]=_[_0xa952('0x2d')](_0x4c228a,_0xa952('0x2b'));_0x39a021[_0xa952('0x33')]=_[_0xa952('0x34')](_0x2f9016[_0xa952('0x33')]);_0x39a021[_0xa952('0x35')]=_[_0xa952('0x36')](_0x39a021[_0xa952('0x32')],_0x39a021['query']);_0x1f8b4a[_0xa952('0x37')]=_[_0xa952('0x36')](_0x39a021[_0xa952('0x32')],qs['fields'](_0x2f9016['query'][_0xa952('0x38')]));_0x1f8b4a['attributes']=_0x1f8b4a[_0xa952('0x37')][_0xa952('0x39')]?_0x1f8b4a['attributes']:_0x39a021['model'];if(!_0x2f9016[_0xa952('0x33')]['hasOwnProperty'](_0xa952('0x3a'))){_0x1f8b4a['limit']=qs['limit'](_0x2f9016[_0xa952('0x33')][_0xa952('0x1e')]);_0x1f8b4a[_0xa952('0x1d')]=qs['offset'](_0x2f9016[_0xa952('0x33')][_0xa952('0x1d')]);}_0x1f8b4a[_0xa952('0x3b')]=qs[_0xa952('0x3c')](_0x2f9016['query'][_0xa952('0x3c')]);_0x1f8b4a[_0xa952('0x3d')]=qs[_0xa952('0x35')](_['pick'](_0x2f9016[_0xa952('0x33')],_0x39a021[_0xa952('0x35')]),_0x4c228a);if(_0x2f9016['query'][_0xa952('0x3e')]){_0x1f8b4a[_0xa952('0x3d')]=_['merge'](_0x1f8b4a['where'],{'$or':_['map'](_0x4c228a,function(_0x59156f){if(_0x59156f[_0xa952('0x3f')]!==_0xa952('0x40')){var _0x468b14={};_0x468b14[_0x59156f[_0xa952('0x2b')]]={'$like':'%'+_0x2f9016[_0xa952('0x33')][_0xa952('0x3e')]+'%'};return _0x468b14;}})});}_0x1f8b4a=_[_0xa952('0x41')]({},_0x1f8b4a,_0x2f9016[_0xa952('0x42')]);var _0x1309aa={'where':_0x1f8b4a['where']};return db[_0xa952('0x2e')][_0xa952('0x20')](_0x1309aa)[_0xa952('0x28')](function(_0x289d04){_0x4ab460['count']=_0x289d04;if(_0x2f9016['query']['includeAll']){_0x1f8b4a[_0xa952('0x43')]=[{'all':!![]}];}return db['SugarcrmField'][_0xa952('0x44')](_0x1f8b4a);})[_0xa952('0x28')](function(_0x3a27f1){_0x4ab460[_0xa952('0x45')]=_0x3a27f1;return _0x4ab460;})[_0xa952('0x28')](respondWithFilteredResult(_0x557576,_0x1f8b4a))[_0xa952('0x46')](handleError(_0x557576,null));};exports[_0xa952('0x47')]=function(_0x474752,_0x1e6838){var _0x197388={'raw':!![],'where':{'id':_0x474752[_0xa952('0x48')]['id']}},_0x54e79f={};_0x54e79f[_0xa952('0x32')]=_['keys'](db[_0xa952('0x2e')][_0xa952('0x2f')]);_0x54e79f['query']=_[_0xa952('0x34')](_0x474752['query']);_0x54e79f['filters']=_[_0xa952('0x36')](_0x54e79f[_0xa952('0x32')],_0x54e79f[_0xa952('0x33')]);_0x197388['attributes']=_[_0xa952('0x36')](_0x54e79f[_0xa952('0x32')],qs['fields'](_0x474752[_0xa952('0x33')]['fields']));_0x197388[_0xa952('0x37')]=_0x197388[_0xa952('0x37')][_0xa952('0x39')]?_0x197388['attributes']:_0x54e79f[_0xa952('0x32')];if(_0x474752[_0xa952('0x33')][_0xa952('0x49')]){_0x197388[_0xa952('0x43')]=[{'all':!![]}];}_0x197388=_[_0xa952('0x41')]({},_0x197388,_0x474752[_0xa952('0x42')]);return db[_0xa952('0x2e')][_0xa952('0x4a')](_0x197388)[_0xa952('0x28')](handleEntityNotFound(_0x1e6838,null))[_0xa952('0x28')](respondWithResult(_0x1e6838,null))[_0xa952('0x46')](handleError(_0x1e6838,null));};exports[_0xa952('0x4b')]=function(_0xf35ff0,_0x1af14a){return db['SugarcrmField'][_0xa952('0x4b')](_0xf35ff0[_0xa952('0x4c')],{})[_0xa952('0x28')](respondWithResult(_0x1af14a,0xc9))[_0xa952('0x46')](handleError(_0x1af14a,null));};exports['update']=function(_0x51748e,_0xe6fb00){if(_0x51748e['body']['id']){delete _0x51748e[_0xa952('0x4c')]['id'];}return db[_0xa952('0x2e')][_0xa952('0x4a')]({'where':{'id':_0x51748e[_0xa952('0x48')]['id']}})[_0xa952('0x28')](handleEntityNotFound(_0xe6fb00,null))['then'](saveUpdates(_0x51748e['body'],null))[_0xa952('0x28')](respondWithResult(_0xe6fb00,null))['catch'](handleError(_0xe6fb00,null));};exports[_0xa952('0x4d')]=function(_0x512b26,_0x237f0c){return db[_0xa952('0x2e')][_0xa952('0x4a')]({'where':{'id':_0x512b26['params']['id']}})[_0xa952('0x28')](handleEntityNotFound(_0x237f0c,null))['then'](removeEntity(_0x237f0c,null))[_0xa952('0x46')](handleError(_0x237f0c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index d154e43..7dc7281 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 _0xef40=['../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x290d3b,_0xb7c790){var _0x318eaf=function(_0x4f906c){while(--_0x4f906c){_0x290d3b['push'](_0x290d3b['shift']());}};_0x318eaf(++_0xb7c790);}(_0xef40,0x1c8));var _0x0ef4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xef40[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x0ef4('0x0'));var util=require('util');var logger=require(_0x0ef4('0x1'))(_0x0ef4('0x2'));var moment=require('moment');var BPromise=require(_0x0ef4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ef4('0x4'));var rimraf=require(_0x0ef4('0x5'));var config=require(_0x0ef4('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x0ef4('0x7')]=function(_0x538202,_0x17d8c4){return _0x538202[_0x0ef4('0x8')](_0x0ef4('0x9'),attributes,{'tableName':_0x0ef4('0xa'),'paranoid':![],'indexes':[{'name':_0x0ef4('0xb'),'fields':[_0x0ef4('0xc'),_0x0ef4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed83=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId'];(function(_0xef9ecc,_0x2f9d86){var _0x3796d3=function(_0xa222a3){while(--_0xa222a3){_0xef9ecc['push'](_0xef9ecc['shift']());}};_0x3796d3(++_0x2f9d86);}(_0xed83,0x10a));var _0x3ed8=function(_0x4c2def,_0x3926d6){_0x4c2def=_0x4c2def-0x0;var _0x51a964=_0xed83[_0x4c2def];return _0x51a964;};'use strict';var _=require('lodash');var util=require(_0x3ed8('0x0'));var logger=require(_0x3ed8('0x1'))(_0x3ed8('0x2'));var moment=require(_0x3ed8('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ed8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ed8('0x5'));var config=require(_0x3ed8('0x6'));var attributes=require(_0x3ed8('0x7'));module['exports']=function(_0x3b3100,_0x3a948b){return _0x3b3100[_0x3ed8('0x8')](_0x3ed8('0x9'),attributes,{'tableName':_0x3ed8('0xa'),'paranoid':![],'indexes':[{'name':_0x3ed8('0xb'),'fields':[_0x3ed8('0xc'),_0x3ed8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 29425ab..4b1c45e 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 _0x6572=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','randomstring'];(function(_0xe92d86,_0x1d7dc8){var _0x3f620b=function(_0x1ee2cc){while(--_0x1ee2cc){_0xe92d86['push'](_0xe92d86['shift']());}};_0x3f620b(++_0x1d7dc8);}(_0x6572,0x178));var _0x2657=function(_0xf68c7e,_0x64f474){_0xf68c7e=_0xf68c7e-0x0;var _0x1acc8f=_0x6572[_0xf68c7e];return _0x1acc8f;};'use strict';var _=require(_0x2657('0x0'));var util=require(_0x2657('0x1'));var moment=require(_0x2657('0x2'));var BPromise=require('bluebird');var rs=require(_0x2657('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2657('0x4'))['db'];var utils=require(_0x2657('0x5'));var logger=require(_0x2657('0x6'))(_0x2657('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2657('0x8')][_0x2657('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c7569,_0x446f92,_0x29e626){return new BPromise(function(_0x3fedb2,_0x2e35d7){return client[_0x2657('0xa')](_0x3c7569,_0x29e626)['then'](function(_0x366e83){logger[_0x2657('0xb')](_0x2657('0xc'),_0x446f92,_0x2657('0xd'));logger[_0x2657('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x446f92,'request\x20sent',JSON['stringify'](_0x366e83));if(_0x366e83[_0x2657('0xf')]){if(_0x366e83['error'][_0x2657('0x10')]===0x1f4){logger[_0x2657('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x446f92,_0x366e83['error'][_0x2657('0x11')]);return _0x2e35d7(_0x366e83[_0x2657('0xf')][_0x2657('0x11')]);}logger[_0x2657('0xf')](_0x2657('0xc'),_0x446f92,_0x366e83[_0x2657('0xf')]['message']);return _0x3fedb2(_0x366e83[_0x2657('0xf')][_0x2657('0x11')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x446f92,_0x2657('0xd'));_0x3fedb2(_0x366e83[_0x2657('0x12')][_0x2657('0x11')]);}})['catch'](function(_0xd55343){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x446f92,_0xd55343);_0x2e35d7(_0xd55343);});});} \ No newline at end of file +var _0x20f9=['rpc','../../config/environment','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0x20f9,0x15e));var _0x920f=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x20f9[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x920f('0x0'));var util=require('util');var moment=require(_0x920f('0x1'));var BPromise=require(_0x920f('0x2'));var rs=require(_0x920f('0x3'));var fs=require('fs');var Redis=require(_0x920f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x920f('0x5'));var logger=require(_0x920f('0x6'))(_0x920f('0x7'));var config=require(_0x920f('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25f14a,_0x89ac41,_0x15a68d){return new BPromise(function(_0x5bbd53,_0x17333c){return client[_0x920f('0x9')](_0x25f14a,_0x15a68d)[_0x920f('0xa')](function(_0x2e0d1b){logger[_0x920f('0xb')](_0x920f('0xc'),_0x89ac41,_0x920f('0xd'));logger[_0x920f('0xe')](_0x920f('0xf'),_0x89ac41,_0x920f('0xd'),JSON[_0x920f('0x10')](_0x2e0d1b));if(_0x2e0d1b[_0x920f('0x11')]){if(_0x2e0d1b[_0x920f('0x11')][_0x920f('0x12')]===0x1f4){logger[_0x920f('0x11')](_0x920f('0xc'),_0x89ac41,_0x2e0d1b[_0x920f('0x11')][_0x920f('0x13')]);return _0x17333c(_0x2e0d1b[_0x920f('0x11')][_0x920f('0x13')]);}logger[_0x920f('0x11')](_0x920f('0xc'),_0x89ac41,_0x2e0d1b[_0x920f('0x11')][_0x920f('0x13')]);return _0x5bbd53(_0x2e0d1b['error']['message']);}else{logger[_0x920f('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x89ac41,'request\x20sent');_0x5bbd53(_0x2e0d1b['result'][_0x920f('0x13')]);}})[_0x920f('0x14')](function(_0x527afb){logger[_0x920f('0x11')](_0x920f('0xc'),_0x89ac41,_0x527afb);_0x17333c(_0x527afb);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 33bd222..26d7b01 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 _0x795a=['destroy','exports','util','path','express','fs-extra','../../components/auth/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','delete'];(function(_0xa2b534,_0x4c8503){var _0x58eea8=function(_0x576d12){while(--_0x576d12){_0xa2b534['push'](_0xa2b534['shift']());}};_0x58eea8(++_0x4c8503);}(_0x795a,0xa2));var _0xa795=function(_0x181c82,_0x26790b){_0x181c82=_0x181c82-0x0;var _0x4b4487=_0x795a[_0x181c82];return _0x4b4487;};'use strict';var multer=require('multer');var util=require(_0xa795('0x0'));var path=require(_0xa795('0x1'));var timeout=require('connect-timeout');var express=require(_0xa795('0x2'));var router=express['Router']();var fs_extra=require(_0xa795('0x3'));var auth=require(_0xa795('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa795('0x5'));router[_0xa795('0x6')]('/',auth[_0xa795('0x7')](),controller[_0xa795('0x8')]);router['get'](_0xa795('0x9'),auth['isAuthenticated'](),controller[_0xa795('0xa')]);router['get']('/:id/configurations',auth[_0xa795('0x7')](),controller[_0xa795('0xb')]);router[_0xa795('0x6')](_0xa795('0xc'),auth[_0xa795('0x7')](),controller[_0xa795('0xd')]);router[_0xa795('0xe')]('/',auth[_0xa795('0x7')](),controller['create']);router['post'](_0xa795('0xf'),auth[_0xa795('0x7')](),controller[_0xa795('0x10')]);router['put'](_0xa795('0x9'),auth[_0xa795('0x7')](),controller['update']);router[_0xa795('0x11')](_0xa795('0x9'),auth[_0xa795('0x7')](),controller[_0xa795('0x12')]);module[_0xa795('0x13')]=router; \ No newline at end of file +var _0x7dc0=['./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1d6252,_0x1393ea){var _0x593466=function(_0x34e1f7){while(--_0x34e1f7){_0x1d6252['push'](_0x1d6252['shift']());}};_0x593466(++_0x1393ea);}(_0x7dc0,0x18f));var _0x07dc=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0x7dc0[_0x318256];return _0xb1e352;};'use strict';var multer=require(_0x07dc('0x0'));var util=require(_0x07dc('0x1'));var path=require(_0x07dc('0x2'));var timeout=require(_0x07dc('0x3'));var express=require(_0x07dc('0x4'));var router=express[_0x07dc('0x5')]();var fs_extra=require(_0x07dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x07dc('0x7'));var config=require(_0x07dc('0x8'));var controller=require(_0x07dc('0x9'));router[_0x07dc('0xa')]('/',auth[_0x07dc('0xb')](),controller[_0x07dc('0xc')]);router['get'](_0x07dc('0xd'),auth[_0x07dc('0xb')](),controller[_0x07dc('0xe')]);router[_0x07dc('0xa')](_0x07dc('0xf'),auth['isAuthenticated'](),controller[_0x07dc('0x10')]);router['get'](_0x07dc('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0x07dc('0x12')]('/',auth[_0x07dc('0xb')](),controller[_0x07dc('0x13')]);router[_0x07dc('0x12')](_0x07dc('0xf'),auth['isAuthenticated'](),controller[_0x07dc('0x14')]);router[_0x07dc('0x15')](_0x07dc('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x07dc('0x16')](_0x07dc('0xd'),auth[_0x07dc('0xb')](),controller['destroy']);module[_0x07dc('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 8292815..837e107 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 _0xa012=['HelpDesk','STRING'];(function(_0x534617,_0x41a7ba){var _0x516e6a=function(_0x2cbb81){while(--_0x2cbb81){_0x534617['push'](_0x534617['shift']());}};_0x516e6a(++_0x41a7ba);}(_0xa012,0xc5));var _0x2a01=function(_0x2ce05,_0x306b52){_0x2ce05=_0x2ce05-0x0;var _0x1c6341=_0xa012[_0x2ce05];return _0x1c6341;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2a01('0x0')]},'username':{'type':Sequelize[_0x2a01('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2a01('0x0')],'allowNull':![],'defaultValue':_0x2a01('0x1')},'remoteUri':{'type':Sequelize[_0x2a01('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2a01('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2a01('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x9f4e=['exports','STRING'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x9f4e,0x124));var _0xe9f4=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0x9f4e[_0x5d225a];return _0x1e7761;};'use strict';var Sequelize=require('sequelize');module[_0xe9f4('0x0')]={'name':{'type':Sequelize[_0xe9f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe9f4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe9f4('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe9f4('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe9f4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index f0917ed..744e711 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 _0x6f45=['body','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','result','token','describe','sessionName','reference','owner','remove','false','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create'];(function(_0x34081e,_0x41edc6){var _0x21191c=function(_0x466e52){while(--_0x466e52){_0x34081e['push'](_0x34081e['shift']());}};_0x21191c(++_0x41edc6);}(_0x6f45,0x120));var _0x56f4=function(_0x2bf66a,_0x3a16bc){_0x2bf66a=_0x2bf66a-0x0;var _0x5902c4=_0x6f45[_0x2bf66a];return _0x5902c4;};'use strict';var emlformat=require(_0x56f4('0x0'));var rimraf=require(_0x56f4('0x1'));var zipdir=require(_0x56f4('0x2'));var jsonpatch=require(_0x56f4('0x3'));var rp=require(_0x56f4('0x4'));var moment=require('moment');var BPromise=require(_0x56f4('0x5'));var Mustache=require('mustache');var util=require(_0x56f4('0x6'));var path=require(_0x56f4('0x7'));var sox=require(_0x56f4('0x8'));var csv=require(_0x56f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56f4('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x56f4('0xb'));var jsforce=require(_0x56f4('0xc'));var deskjs=require(_0x56f4('0xd'));var toCsv=require(_0x56f4('0x9'));var querystring=require(_0x56f4('0xe'));var Papa=require(_0x56f4('0xf'));var Redis=require(_0x56f4('0x10'));var authService=require(_0x56f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x56f4('0x12'));var hardwareService=require(_0x56f4('0x13'));var logger=require(_0x56f4('0x14'))(_0x56f4('0x15'));var utils=require(_0x56f4('0x16'));var config=require(_0x56f4('0x17'));var licenseUtil=require(_0x56f4('0x18'));var db=require(_0x56f4('0x19'))['db'];var integrations=require(_0x56f4('0x1a'));function respondWithStatusCode(_0x3e4072,_0x182a5a){_0x182a5a=_0x182a5a||0xcc;return function(_0x2b71c4){if(_0x2b71c4){return _0x3e4072[_0x56f4('0x1b')](_0x182a5a);}return _0x3e4072[_0x56f4('0x1c')](_0x182a5a)[_0x56f4('0x1d')]();};}function respondWithResult(_0x11b14b,_0x532252){_0x532252=_0x532252||0xc8;return function(_0x441816){if(_0x441816){return _0x11b14b[_0x56f4('0x1c')](_0x532252)['json'](_0x441816);}};}function respondWithFilteredResult(_0x2a6d4d,_0x4544ea){return function(_0x36a8f1){if(_0x36a8f1){var _0x1ba54f=typeof _0x4544ea[_0x56f4('0x1e')]===_0x56f4('0x1f')&&typeof _0x4544ea[_0x56f4('0x20')]===_0x56f4('0x1f');var _0x4ca2e8=_0x36a8f1['count'];var _0x3e060b=_0x1ba54f?0x0:_0x4544ea[_0x56f4('0x1e')];var _0x3937c5=_0x1ba54f?_0x36a8f1[_0x56f4('0x21')]:_0x4544ea[_0x56f4('0x1e')]+_0x4544ea[_0x56f4('0x20')];var _0x58f684;if(_0x3937c5>=_0x4ca2e8){_0x3937c5=_0x4ca2e8;_0x58f684=0xc8;}else{_0x58f684=0xce;}_0x2a6d4d[_0x56f4('0x1c')](_0x58f684);return _0x2a6d4d[_0x56f4('0x22')](_0x56f4('0x23'),_0x3e060b+'-'+_0x3937c5+'/'+_0x4ca2e8)['json'](_0x36a8f1);}return null;};}function patchUpdates(_0x1f02b1){return function(_0x5b49e7){try{jsonpatch[_0x56f4('0x24')](_0x5b49e7,_0x1f02b1,!![]);}catch(_0x5208f6){return BPromise[_0x56f4('0x25')](_0x5208f6);}return _0x5b49e7[_0x56f4('0x26')]();};}function saveUpdates(_0x93cafd,_0xdfe525){return function(_0x5f1eb3){if(_0x5f1eb3){return _0x5f1eb3[_0x56f4('0x27')](_0x93cafd)[_0x56f4('0x28')](function(_0x3db82e){return _0x3db82e;});}return null;};}function removeEntity(_0x934d22,_0x529ee2){return function(_0x4be71b){if(_0x4be71b){return _0x4be71b[_0x56f4('0x29')]()[_0x56f4('0x28')](function(){_0x934d22[_0x56f4('0x1c')](0xcc)[_0x56f4('0x1d')]();});}};}function handleEntityNotFound(_0x375a33,_0xa424d0){return function(_0x3a7240){if(!_0x3a7240){_0x375a33[_0x56f4('0x1b')](0x194);}return _0x3a7240;};}function handleError(_0x8971e8,_0x4a549a){_0x4a549a=_0x4a549a||0x1f4;return function(_0x40aafe){logger[_0x56f4('0x2a')](_0x40aafe['stack']);if(_0x40aafe[_0x56f4('0x2b')]){delete _0x40aafe[_0x56f4('0x2b')];}_0x8971e8[_0x56f4('0x1c')](_0x4a549a)['send'](_0x40aafe);};}exports['index']=function(_0x21d272,_0x24f812){var _0x181c9f={},_0x180244={},_0x49bdf7={'count':0x0,'rows':[]};var _0x236cbd=_[_0x56f4('0x2c')](db[_0x56f4('0x2d')][_0x56f4('0x2e')],function(_0x42e1c0){return{'name':_0x42e1c0[_0x56f4('0x2f')],'type':_0x42e1c0[_0x56f4('0x30')][_0x56f4('0x31')]};});_0x180244[_0x56f4('0x32')]=_[_0x56f4('0x2c')](_0x236cbd,_0x56f4('0x2b'));_0x180244[_0x56f4('0x33')]=_[_0x56f4('0x34')](_0x21d272[_0x56f4('0x33')]);_0x180244[_0x56f4('0x35')]=_[_0x56f4('0x36')](_0x180244['model'],_0x180244[_0x56f4('0x33')]);_0x181c9f[_0x56f4('0x37')]=_['intersection'](_0x180244[_0x56f4('0x32')],qs['fields'](_0x21d272['query'][_0x56f4('0x38')]));_0x181c9f[_0x56f4('0x37')]=_0x181c9f[_0x56f4('0x37')][_0x56f4('0x39')]?_0x181c9f[_0x56f4('0x37')]:_0x180244[_0x56f4('0x32')];if(!_0x21d272['query'][_0x56f4('0x3a')](_0x56f4('0x3b'))){_0x181c9f['limit']=qs[_0x56f4('0x20')](_0x21d272[_0x56f4('0x33')]['limit']);_0x181c9f['offset']=qs[_0x56f4('0x1e')](_0x21d272['query'][_0x56f4('0x1e')]);}_0x181c9f['order']=qs[_0x56f4('0x3c')](_0x21d272['query']['sort']);_0x181c9f['where']=qs['filters'](_[_0x56f4('0x3d')](_0x21d272[_0x56f4('0x33')],_0x180244[_0x56f4('0x35')]),_0x236cbd);if(_0x21d272[_0x56f4('0x33')][_0x56f4('0x3e')]){_0x181c9f['where']=_[_0x56f4('0x3f')](_0x181c9f[_0x56f4('0x40')],{'$or':_[_0x56f4('0x2c')](_0x236cbd,function(_0x1a8971){if(_0x1a8971[_0x56f4('0x30')]!==_0x56f4('0x41')){var _0x59f431={};_0x59f431[_0x1a8971[_0x56f4('0x2b')]]={'$like':'%'+_0x21d272[_0x56f4('0x33')][_0x56f4('0x3e')]+'%'};return _0x59f431;}})});}_0x181c9f=_[_0x56f4('0x3f')]({},_0x181c9f,_0x21d272[_0x56f4('0x42')]);var _0x2071a2={'where':_0x181c9f[_0x56f4('0x40')]};return db[_0x56f4('0x2d')][_0x56f4('0x21')](_0x2071a2)['then'](function(_0x2ffd52){_0x49bdf7[_0x56f4('0x21')]=_0x2ffd52;if(_0x21d272['query'][_0x56f4('0x43')]){_0x181c9f[_0x56f4('0x44')]=[{'all':!![]}];}return db[_0x56f4('0x2d')][_0x56f4('0x45')](_0x181c9f);})[_0x56f4('0x28')](function(_0x387f27){_0x49bdf7['rows']=_0x387f27;return _0x49bdf7;})['then'](respondWithFilteredResult(_0x24f812,_0x181c9f))[_0x56f4('0x46')](handleError(_0x24f812,null));};exports[_0x56f4('0x47')]=function(_0x461024,_0x5d7414){var _0x398bb7={'raw':![],'where':{'id':_0x461024[_0x56f4('0x48')]['id']}},_0x24b1a1={};_0x24b1a1['model']=_[_0x56f4('0x34')](db[_0x56f4('0x2d')]['rawAttributes']);_0x24b1a1[_0x56f4('0x33')]=_[_0x56f4('0x34')](_0x461024[_0x56f4('0x33')]);_0x24b1a1['filters']=_[_0x56f4('0x36')](_0x24b1a1[_0x56f4('0x32')],_0x24b1a1[_0x56f4('0x33')]);_0x398bb7[_0x56f4('0x37')]=_[_0x56f4('0x36')](_0x24b1a1[_0x56f4('0x32')],qs[_0x56f4('0x38')](_0x461024[_0x56f4('0x33')]['fields']));_0x398bb7['attributes']=_0x398bb7[_0x56f4('0x37')]['length']?_0x398bb7[_0x56f4('0x37')]:_0x24b1a1[_0x56f4('0x32')];if(_0x461024[_0x56f4('0x33')][_0x56f4('0x43')]){_0x398bb7['include']=[{'all':!![]}];}_0x398bb7=_['merge']({},_0x398bb7,_0x461024[_0x56f4('0x42')]);return db[_0x56f4('0x2d')][_0x56f4('0x49')](_0x398bb7)[_0x56f4('0x28')](handleEntityNotFound(_0x5d7414,null))[_0x56f4('0x28')](respondWithResult(_0x5d7414,null))[_0x56f4('0x46')](handleError(_0x5d7414,null));};exports['create']=function(_0x16abc9,_0x4bf979){return db[_0x56f4('0x2d')][_0x56f4('0x4a')](_0x16abc9[_0x56f4('0x4b')],{})[_0x56f4('0x28')](respondWithResult(_0x4bf979,0xc9))[_0x56f4('0x46')](handleError(_0x4bf979,null));};exports[_0x56f4('0x27')]=function(_0x1f44fe,_0x242687){if(_0x1f44fe[_0x56f4('0x4b')]['id']){delete _0x1f44fe[_0x56f4('0x4b')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x1f44fe[_0x56f4('0x48')]['id']}})[_0x56f4('0x28')](handleEntityNotFound(_0x242687,null))[_0x56f4('0x28')](saveUpdates(_0x1f44fe[_0x56f4('0x4b')],null))['then'](respondWithResult(_0x242687,null))[_0x56f4('0x46')](handleError(_0x242687,null));};exports[_0x56f4('0x29')]=function(_0x24c699,_0x574366){return db['VtigerAccount'][_0x56f4('0x49')]({'where':{'id':_0x24c699[_0x56f4('0x48')]['id']}})[_0x56f4('0x28')](handleEntityNotFound(_0x574366,null))['then'](removeEntity(_0x574366,null))[_0x56f4('0x46')](handleError(_0x574366,null));};exports[_0x56f4('0x4c')]=function(_0x3e9b0a,_0x2f5159,_0x2543bd){var _0x461d6f={};var _0x100ff8={};var _0x400c56;var _0x3ab06a;return db[_0x56f4('0x2d')][_0x56f4('0x4d')]({'where':{'id':_0x3e9b0a['params']['id']}})[_0x56f4('0x28')](handleEntityNotFound(_0x2f5159,null))[_0x56f4('0x28')](function(_0x188dbe){if(_0x188dbe){_0x400c56=_0x188dbe;_0x100ff8[_0x56f4('0x32')]=_[_0x56f4('0x34')](db[_0x56f4('0x4e')][_0x56f4('0x2e')]);_0x100ff8[_0x56f4('0x33')]=_[_0x56f4('0x34')](_0x3e9b0a[_0x56f4('0x33')]);_0x100ff8[_0x56f4('0x35')]=_[_0x56f4('0x36')](_0x100ff8[_0x56f4('0x32')],_0x100ff8[_0x56f4('0x33')]);_0x461d6f[_0x56f4('0x37')]=_[_0x56f4('0x36')](_0x100ff8[_0x56f4('0x32')],qs['fields'](_0x3e9b0a[_0x56f4('0x33')][_0x56f4('0x38')]));_0x461d6f[_0x56f4('0x37')]=_0x461d6f[_0x56f4('0x37')][_0x56f4('0x39')]?_0x461d6f[_0x56f4('0x37')]:_0x100ff8[_0x56f4('0x32')];_0x461d6f[_0x56f4('0x4f')]=qs[_0x56f4('0x3c')](_0x3e9b0a['query'][_0x56f4('0x3c')]);_0x461d6f[_0x56f4('0x40')]=qs[_0x56f4('0x35')](_[_0x56f4('0x3d')](_0x3e9b0a[_0x56f4('0x33')],_0x100ff8[_0x56f4('0x35')]));if(_0x3e9b0a[_0x56f4('0x33')][_0x56f4('0x3e')]){_0x461d6f[_0x56f4('0x40')]=_['merge'](_0x461d6f[_0x56f4('0x40')],{'$or':_['map'](_0x461d6f['attributes'],function(_0xe6cd3c){var _0x1efbfd={};_0x1efbfd[_0xe6cd3c]={'$like':'%'+_0x3e9b0a['query'][_0x56f4('0x3e')]+'%'};return _0x1efbfd;})});}_0x461d6f=_[_0x56f4('0x3f')]({},_0x461d6f,_0x3e9b0a[_0x56f4('0x42')]);return _0x400c56['getConfigurations'](_0x461d6f);}})[_0x56f4('0x28')](function(_0x1d0367){if(_0x1d0367){_0x3ab06a=_0x1d0367[_0x56f4('0x39')];if(!_0x3e9b0a['query'][_0x56f4('0x3a')]('nolimit')){_0x461d6f[_0x56f4('0x20')]=qs[_0x56f4('0x20')](_0x3e9b0a[_0x56f4('0x33')][_0x56f4('0x20')]);_0x461d6f['offset']=qs[_0x56f4('0x1e')](_0x3e9b0a[_0x56f4('0x33')][_0x56f4('0x1e')]);}return _0x400c56[_0x56f4('0x4c')](_0x461d6f);}})[_0x56f4('0x28')](function(_0x1ec03e){if(_0x1ec03e){return _0x1ec03e?{'count':_0x3ab06a,'rows':_0x1ec03e}:null;}})['then'](respondWithResult(_0x2f5159,null))[_0x56f4('0x46')](handleError(_0x2f5159,null));};exports[_0x56f4('0x50')]=function(_0x2ecd1c,_0x386d3e,_0x48b6fa){if(_0x2ecd1c[_0x56f4('0x4b')]['id']){delete _0x2ecd1c[_0x56f4('0x4b')]['id'];}return db[_0x56f4('0x2d')][_0x56f4('0x4d')]({'where':{'id':_0x2ecd1c['params']['id']}})[_0x56f4('0x28')](handleEntityNotFound(_0x386d3e,null))[_0x56f4('0x28')](function(_0x6fa737){if(_0x6fa737){_0x2ecd1c[_0x56f4('0x4b')]['AccountId']=_0x6fa737['id'];_0x2ecd1c['body'][_0x56f4('0x51')]=integrations[_0x56f4('0x52')](_0x2ecd1c['body'][_0x56f4('0x53')],_0x2ecd1c[_0x56f4('0x4b')]['type']);_0x2ecd1c[_0x56f4('0x4b')]['Descriptions']=integrations[_0x56f4('0x54')](_0x2ecd1c['body'][_0x56f4('0x53')],_0x2ecd1c[_0x56f4('0x4b')][_0x56f4('0x30')]);return db[_0x56f4('0x4e')][_0x56f4('0x4a')](_0x2ecd1c[_0x56f4('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0x56f4('0x51')},{'model':db['VtigerField'],'as':_0x56f4('0x55')}]});}return null;})['then'](respondWithResult(_0x386d3e,null))[_0x56f4('0x46')](handleError(_0x386d3e,null));};var md5=require(_0x56f4('0x56'));exports[_0x56f4('0x57')]=function(_0x29b40b,_0x364ccd,_0x463fcd){var _0x26dd9e=null;var _0x3dceaa=null;var _0x5687a7=null;var _0x1f5367=null;var _0x1b4810='';return db[_0x56f4('0x2d')][_0x56f4('0x4d')]({'where':{'id':_0x29b40b['params']['id']},'attributes':['id',_0x56f4('0x2b'),_0x56f4('0x58'),_0x56f4('0x59'),_0x56f4('0x5a'),_0x56f4('0x5b'),_0x56f4('0x5c'),_0x56f4('0x5d')]})['then'](handleEntityNotFound(_0x364ccd,null))[_0x56f4('0x28')](function(_0x2ad3cd){if(_0x2ad3cd){_0x26dd9e=_0x2ad3cd[_0x56f4('0x58')];_0x3dceaa=_0x2ad3cd[_0x56f4('0x5d')];_0x5687a7=_0x2ad3cd[_0x56f4('0x5a')];_0x1b4810=_0x2ad3cd[_0x56f4('0x5b')];var _0x2ac6b7=_0x1b4810[_0x56f4('0x5e')](-0x1);if(_0x2ac6b7==='/'){_0x1b4810=_0x1b4810[_0x56f4('0x5f')](0x0,_0x1b4810[_0x56f4('0x60')](_0x2ac6b7));}_0x1f5367=util[_0x56f4('0x61')](_0x56f4('0x62'),_0x1b4810);var _0x4d759f={'method':_0x56f4('0x63'),'uri':_0x1f5367,'qs':{'operation':_0x56f4('0x64'),'username':_0x2ad3cd[_0x56f4('0x58')]},'json':!![]};return rp(_0x4d759f);}})[_0x56f4('0x28')](function(_0x434618){if(_0x434618[_0x56f4('0x65')]){var _0x58cd8a={'method':'POST','uri':_0x1f5367,'form':{'operation':'login','username':_0x26dd9e,'accessKey':md5(_0x434618[_0x56f4('0x66')][_0x56f4('0x67')]+_0x3dceaa)},'json':!![]};return rp(_0x58cd8a);}})[_0x56f4('0x28')](function(_0x54cf8c){if(_0x54cf8c['success']){var _0x2da6d6={'method':_0x56f4('0x63'),'uri':_0x1f5367,'qs':{'operation':_0x56f4('0x68'),'username':_0x26dd9e,'sessionName':_0x54cf8c[_0x56f4('0x66')][_0x56f4('0x69')],'elementType':_0x5687a7},'json':!![]};return rp(_0x2da6d6);}})['then'](function(_0x36370f){if(_0x36370f[_0x56f4('0x65')]){var _0x12210c=['autogenerated',_0x56f4('0x6a'),_0x56f4('0x6b')];_[_0x56f4('0x6c')](_0x36370f[_0x56f4('0x66')][_0x56f4('0x38')],function(_0x2a5816){return _0x12210c['includes'](_0x2a5816[_0x56f4('0x30')][_0x56f4('0x2b')]);});_['remove'](_0x36370f[_0x56f4('0x66')][_0x56f4('0x38')],function(_0x469fd6){return _0x469fd6['editable']===_0x56f4('0x6d');});return{'count':_0x36370f[_0x56f4('0x66')][_0x56f4('0x38')]['length'],'rows':_[_0x56f4('0x2c')](_0x36370f['result'][_0x56f4('0x38')],function(_0x4e9d49){return{'id':_0x4e9d49[_0x56f4('0x2b')],'name':_0x4e9d49[_0x56f4('0x6e')],'custom':_['startsWith'](_0x4e9d49[_0x56f4('0x2b')],_0x56f4('0x6f'))?!![]:![],'options':_0x4e9d49[_0x56f4('0x30')][_0x56f4('0x2b')]==='picklist'&&_0x4e9d49[_0x56f4('0x30')][_0x56f4('0x70')][_0x56f4('0x39')]>0x0?_[_0x56f4('0x2c')](_0x4e9d49['type'][_0x56f4('0x70')],function(_0x261f27){return{'name':_0x261f27[_0x56f4('0x6e')],'value':_0x261f27[_0x56f4('0x71')]};}):[]};})};}})[_0x56f4('0x28')](respondWithResult(_0x364ccd,null))[_0x56f4('0x46')](function(_0x7d2765){console[_0x56f4('0x72')](_0x56f4('0x73')+_0x7d2765);var _0x2e0aff=_0x29b40b[_0x56f4('0x33')][_0x56f4('0x74')]?0x1f4:_0x7d2765[_0x56f4('0x75')]||0x1f4;logger[_0x56f4('0x2a')](_0x56f4('0x76'),_0x56f4('0x57'),_0x2e0aff,JSON[_0x56f4('0x77')](_0x7d2765));delete _0x7d2765[_0x56f4('0x2b')];if(_0x2e0aff===0x191){_0x2e0aff=0x190;}_0x364ccd[_0x56f4('0x1c')](_0x2e0aff)[_0x56f4('0x78')](_0x29b40b[_0x56f4('0x33')][_0x56f4('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x7d2765[_0x56f4('0x75')]}:_0x7d2765);});}; \ No newline at end of file +var _0x9470=['includeAll','include','rows','catch','show','length','find','body','update','params','destroy','findOne','getConfigurations','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','VtigerField','md5','getFields','username','description','remoteUri','accessKey','moduleName','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','result','describe','sessionName','remove','includes','editable','label','cf_','picklist','picklistValues','log','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','undefined','limit','count','set','Content-Range','apply','reject','then','end','sendStatus','error','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','offset','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x12a5b0,_0x1bb37d){var _0x15d113=function(_0x468501){while(--_0x468501){_0x12a5b0['push'](_0x12a5b0['shift']());}};_0x15d113(++_0x1bb37d);}(_0x9470,0x127));var _0x0947=function(_0x2612dd,_0x1b3ed){_0x2612dd=_0x2612dd-0x0;var _0x15af02=_0x9470[_0x2612dd];return _0x15af02;};'use strict';var emlformat=require(_0x0947('0x0'));var rimraf=require(_0x0947('0x1'));var zipdir=require(_0x0947('0x2'));var jsonpatch=require(_0x0947('0x3'));var rp=require(_0x0947('0x4'));var moment=require(_0x0947('0x5'));var BPromise=require(_0x0947('0x6'));var Mustache=require('mustache');var util=require(_0x0947('0x7'));var path=require('path');var sox=require(_0x0947('0x8'));var csv=require(_0x0947('0x9'));var ejs=require(_0x0947('0xa'));var fs=require('fs');var fs_extra=require(_0x0947('0xb'));var _=require(_0x0947('0xc'));var squel=require('squel');var crypto=require(_0x0947('0xd'));var jsforce=require(_0x0947('0xe'));var deskjs=require(_0x0947('0xf'));var toCsv=require(_0x0947('0x9'));var querystring=require(_0x0947('0x10'));var Papa=require(_0x0947('0x11'));var Redis=require(_0x0947('0x12'));var authService=require(_0x0947('0x13'));var qs=require(_0x0947('0x14'));var as=require(_0x0947('0x15'));var hardwareService=require(_0x0947('0x16'));var logger=require(_0x0947('0x17'))('api');var utils=require(_0x0947('0x18'));var config=require(_0x0947('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0947('0x1a'));function respondWithStatusCode(_0x2aaf56,_0x369284){_0x369284=_0x369284||0xcc;return function(_0x15fb8d){if(_0x15fb8d){return _0x2aaf56['sendStatus'](_0x369284);}return _0x2aaf56[_0x0947('0x1b')](_0x369284)['end']();};}function respondWithResult(_0x37dc45,_0x19db41){_0x19db41=_0x19db41||0xc8;return function(_0x3bce83){if(_0x3bce83){return _0x37dc45['status'](_0x19db41)[_0x0947('0x1c')](_0x3bce83);}};}function respondWithFilteredResult(_0x7b24ea,_0x9353bc){return function(_0x2eacb1){if(_0x2eacb1){var _0x1053cc=typeof _0x9353bc['offset']===_0x0947('0x1d')&&typeof _0x9353bc[_0x0947('0x1e')]===_0x0947('0x1d');var _0x1bc6bb=_0x2eacb1[_0x0947('0x1f')];var _0x49b421=_0x1053cc?0x0:_0x9353bc['offset'];var _0x5201d7=_0x1053cc?_0x2eacb1[_0x0947('0x1f')]:_0x9353bc['offset']+_0x9353bc[_0x0947('0x1e')];var _0x20a4a1;if(_0x5201d7>=_0x1bc6bb){_0x5201d7=_0x1bc6bb;_0x20a4a1=0xc8;}else{_0x20a4a1=0xce;}_0x7b24ea[_0x0947('0x1b')](_0x20a4a1);return _0x7b24ea[_0x0947('0x20')](_0x0947('0x21'),_0x49b421+'-'+_0x5201d7+'/'+_0x1bc6bb)[_0x0947('0x1c')](_0x2eacb1);}return null;};}function patchUpdates(_0x3df6bf){return function(_0x1613a2){try{jsonpatch[_0x0947('0x22')](_0x1613a2,_0x3df6bf,!![]);}catch(_0x3ffb55){return BPromise[_0x0947('0x23')](_0x3ffb55);}return _0x1613a2['save']();};}function saveUpdates(_0x36832f,_0x3d6461){return function(_0x15c751){if(_0x15c751){return _0x15c751['update'](_0x36832f)[_0x0947('0x24')](function(_0x5d3fed){return _0x5d3fed;});}return null;};}function removeEntity(_0x44cf7b,_0x4c52a7){return function(_0x86c53){if(_0x86c53){return _0x86c53['destroy']()[_0x0947('0x24')](function(){_0x44cf7b[_0x0947('0x1b')](0xcc)[_0x0947('0x25')]();});}};}function handleEntityNotFound(_0x1bf3bf,_0x47526d){return function(_0x244367){if(!_0x244367){_0x1bf3bf[_0x0947('0x26')](0x194);}return _0x244367;};}function handleError(_0x441d9b,_0x577d98){_0x577d98=_0x577d98||0x1f4;return function(_0x33b2dc){logger[_0x0947('0x27')](_0x33b2dc[_0x0947('0x28')]);if(_0x33b2dc[_0x0947('0x29')]){delete _0x33b2dc[_0x0947('0x29')];}_0x441d9b[_0x0947('0x1b')](_0x577d98)['send'](_0x33b2dc);};}exports[_0x0947('0x2a')]=function(_0x3acd15,_0x1a45cb){var _0x1201e8={},_0x5c8589={},_0x136c55={'count':0x0,'rows':[]};var _0x3b2bc6=_[_0x0947('0x2b')](db[_0x0947('0x2c')][_0x0947('0x2d')],function(_0x11b750){return{'name':_0x11b750[_0x0947('0x2e')],'type':_0x11b750[_0x0947('0x2f')][_0x0947('0x30')]};});_0x5c8589['model']=_[_0x0947('0x2b')](_0x3b2bc6,'name');_0x5c8589['query']=_[_0x0947('0x31')](_0x3acd15[_0x0947('0x32')]);_0x5c8589[_0x0947('0x33')]=_[_0x0947('0x34')](_0x5c8589[_0x0947('0x35')],_0x5c8589[_0x0947('0x32')]);_0x1201e8[_0x0947('0x36')]=_[_0x0947('0x34')](_0x5c8589[_0x0947('0x35')],qs['fields'](_0x3acd15[_0x0947('0x32')][_0x0947('0x37')]));_0x1201e8[_0x0947('0x36')]=_0x1201e8['attributes']['length']?_0x1201e8[_0x0947('0x36')]:_0x5c8589[_0x0947('0x35')];if(!_0x3acd15['query']['hasOwnProperty']('nolimit')){_0x1201e8['limit']=qs[_0x0947('0x1e')](_0x3acd15[_0x0947('0x32')][_0x0947('0x1e')]);_0x1201e8[_0x0947('0x38')]=qs['offset'](_0x3acd15['query'][_0x0947('0x38')]);}_0x1201e8[_0x0947('0x39')]=qs[_0x0947('0x3a')](_0x3acd15['query'][_0x0947('0x3a')]);_0x1201e8[_0x0947('0x3b')]=qs[_0x0947('0x33')](_[_0x0947('0x3c')](_0x3acd15[_0x0947('0x32')],_0x5c8589[_0x0947('0x33')]),_0x3b2bc6);if(_0x3acd15[_0x0947('0x32')][_0x0947('0x3d')]){_0x1201e8[_0x0947('0x3b')]=_[_0x0947('0x3e')](_0x1201e8[_0x0947('0x3b')],{'$or':_['map'](_0x3b2bc6,function(_0x38ab69){if(_0x38ab69[_0x0947('0x2f')]!==_0x0947('0x3f')){var _0x42385a={};_0x42385a[_0x38ab69[_0x0947('0x29')]]={'$like':'%'+_0x3acd15['query'][_0x0947('0x3d')]+'%'};return _0x42385a;}})});}_0x1201e8=_[_0x0947('0x3e')]({},_0x1201e8,_0x3acd15[_0x0947('0x40')]);var _0x27e0ef={'where':_0x1201e8[_0x0947('0x3b')]};return db[_0x0947('0x2c')][_0x0947('0x1f')](_0x27e0ef)[_0x0947('0x24')](function(_0x2cebb4){_0x136c55[_0x0947('0x1f')]=_0x2cebb4;if(_0x3acd15[_0x0947('0x32')][_0x0947('0x41')]){_0x1201e8[_0x0947('0x42')]=[{'all':!![]}];}return db[_0x0947('0x2c')]['findAll'](_0x1201e8);})[_0x0947('0x24')](function(_0x3781f4){_0x136c55[_0x0947('0x43')]=_0x3781f4;return _0x136c55;})[_0x0947('0x24')](respondWithFilteredResult(_0x1a45cb,_0x1201e8))[_0x0947('0x44')](handleError(_0x1a45cb,null));};exports[_0x0947('0x45')]=function(_0x5b562a,_0x1f4856){var _0x66e629={'raw':![],'where':{'id':_0x5b562a['params']['id']}},_0x4e2408={};_0x4e2408['model']=_[_0x0947('0x31')](db[_0x0947('0x2c')]['rawAttributes']);_0x4e2408[_0x0947('0x32')]=_[_0x0947('0x31')](_0x5b562a[_0x0947('0x32')]);_0x4e2408[_0x0947('0x33')]=_[_0x0947('0x34')](_0x4e2408[_0x0947('0x35')],_0x4e2408[_0x0947('0x32')]);_0x66e629[_0x0947('0x36')]=_['intersection'](_0x4e2408['model'],qs['fields'](_0x5b562a[_0x0947('0x32')][_0x0947('0x37')]));_0x66e629[_0x0947('0x36')]=_0x66e629[_0x0947('0x36')][_0x0947('0x46')]?_0x66e629['attributes']:_0x4e2408[_0x0947('0x35')];if(_0x5b562a[_0x0947('0x32')][_0x0947('0x41')]){_0x66e629[_0x0947('0x42')]=[{'all':!![]}];}_0x66e629=_[_0x0947('0x3e')]({},_0x66e629,_0x5b562a[_0x0947('0x40')]);return db['VtigerAccount'][_0x0947('0x47')](_0x66e629)[_0x0947('0x24')](handleEntityNotFound(_0x1f4856,null))['then'](respondWithResult(_0x1f4856,null))[_0x0947('0x44')](handleError(_0x1f4856,null));};exports['create']=function(_0xdd55ae,_0x227bf3){return db[_0x0947('0x2c')]['create'](_0xdd55ae[_0x0947('0x48')],{})['then'](respondWithResult(_0x227bf3,0xc9))[_0x0947('0x44')](handleError(_0x227bf3,null));};exports[_0x0947('0x49')]=function(_0xcd6547,_0x5bdc34){if(_0xcd6547[_0x0947('0x48')]['id']){delete _0xcd6547['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0xcd6547[_0x0947('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bdc34,null))[_0x0947('0x24')](saveUpdates(_0xcd6547['body'],null))[_0x0947('0x24')](respondWithResult(_0x5bdc34,null))[_0x0947('0x44')](handleError(_0x5bdc34,null));};exports[_0x0947('0x4b')]=function(_0x34012f,_0x311b29){return db['VtigerAccount'][_0x0947('0x47')]({'where':{'id':_0x34012f[_0x0947('0x4a')]['id']}})[_0x0947('0x24')](handleEntityNotFound(_0x311b29,null))[_0x0947('0x24')](removeEntity(_0x311b29,null))[_0x0947('0x44')](handleError(_0x311b29,null));};exports['getConfigurations']=function(_0x3a3fe9,_0x121fe7,_0x3ccbad){var _0x533ed3={};var _0x52e1b3={};var _0x321436;var _0x3596c2;return db[_0x0947('0x2c')][_0x0947('0x4c')]({'where':{'id':_0x3a3fe9['params']['id']}})[_0x0947('0x24')](handleEntityNotFound(_0x121fe7,null))[_0x0947('0x24')](function(_0x40da5e){if(_0x40da5e){_0x321436=_0x40da5e;_0x52e1b3[_0x0947('0x35')]=_[_0x0947('0x31')](db['VtigerConfiguration'][_0x0947('0x2d')]);_0x52e1b3[_0x0947('0x32')]=_['keys'](_0x3a3fe9[_0x0947('0x32')]);_0x52e1b3[_0x0947('0x33')]=_[_0x0947('0x34')](_0x52e1b3['model'],_0x52e1b3[_0x0947('0x32')]);_0x533ed3[_0x0947('0x36')]=_[_0x0947('0x34')](_0x52e1b3[_0x0947('0x35')],qs[_0x0947('0x37')](_0x3a3fe9['query'][_0x0947('0x37')]));_0x533ed3[_0x0947('0x36')]=_0x533ed3[_0x0947('0x36')]['length']?_0x533ed3[_0x0947('0x36')]:_0x52e1b3[_0x0947('0x35')];_0x533ed3[_0x0947('0x39')]=qs[_0x0947('0x3a')](_0x3a3fe9[_0x0947('0x32')][_0x0947('0x3a')]);_0x533ed3[_0x0947('0x3b')]=qs[_0x0947('0x33')](_['pick'](_0x3a3fe9[_0x0947('0x32')],_0x52e1b3[_0x0947('0x33')]));if(_0x3a3fe9[_0x0947('0x32')][_0x0947('0x3d')]){_0x533ed3[_0x0947('0x3b')]=_[_0x0947('0x3e')](_0x533ed3['where'],{'$or':_[_0x0947('0x2b')](_0x533ed3[_0x0947('0x36')],function(_0x320e6c){var _0x1bc7ba={};_0x1bc7ba[_0x320e6c]={'$like':'%'+_0x3a3fe9[_0x0947('0x32')][_0x0947('0x3d')]+'%'};return _0x1bc7ba;})});}_0x533ed3=_[_0x0947('0x3e')]({},_0x533ed3,_0x3a3fe9['options']);return _0x321436[_0x0947('0x4d')](_0x533ed3);}})['then'](function(_0xad83f3){if(_0xad83f3){_0x3596c2=_0xad83f3[_0x0947('0x46')];if(!_0x3a3fe9['query'][_0x0947('0x4e')](_0x0947('0x4f'))){_0x533ed3[_0x0947('0x1e')]=qs[_0x0947('0x1e')](_0x3a3fe9[_0x0947('0x32')][_0x0947('0x1e')]);_0x533ed3[_0x0947('0x38')]=qs[_0x0947('0x38')](_0x3a3fe9[_0x0947('0x32')][_0x0947('0x38')]);}return _0x321436['getConfigurations'](_0x533ed3);}})[_0x0947('0x24')](function(_0x5300c1){if(_0x5300c1){return _0x5300c1?{'count':_0x3596c2,'rows':_0x5300c1}:null;}})[_0x0947('0x24')](respondWithResult(_0x121fe7,null))[_0x0947('0x44')](handleError(_0x121fe7,null));};exports[_0x0947('0x50')]=function(_0x4ef274,_0x349ce2,_0x33f81d){if(_0x4ef274[_0x0947('0x48')]['id']){delete _0x4ef274[_0x0947('0x48')]['id'];}return db[_0x0947('0x2c')][_0x0947('0x4c')]({'where':{'id':_0x4ef274['params']['id']}})[_0x0947('0x24')](handleEntityNotFound(_0x349ce2,null))[_0x0947('0x24')](function(_0x492b23){if(_0x492b23){_0x4ef274[_0x0947('0x48')][_0x0947('0x51')]=_0x492b23['id'];_0x4ef274['body'][_0x0947('0x52')]=integrations[_0x0947('0x53')](_0x4ef274[_0x0947('0x48')]['channel'],_0x4ef274[_0x0947('0x48')][_0x0947('0x2f')]);_0x4ef274[_0x0947('0x48')][_0x0947('0x54')]=integrations[_0x0947('0x55')](_0x4ef274['body'][_0x0947('0x56')],_0x4ef274[_0x0947('0x48')][_0x0947('0x2f')]);return db['VtigerConfiguration'][_0x0947('0x57')](_0x4ef274[_0x0947('0x48')],{'include':[{'model':db[_0x0947('0x58')],'as':_0x0947('0x52')},{'model':db['VtigerField'],'as':_0x0947('0x54')}]});}return null;})[_0x0947('0x24')](respondWithResult(_0x349ce2,null))['catch'](handleError(_0x349ce2,null));};var md5=require(_0x0947('0x59'));exports[_0x0947('0x5a')]=function(_0x44d3bc,_0x3efdf3,_0x1cdef7){var _0x2bc619=null;var _0xe3d45=null;var _0x25de6b=null;var _0x1ccc12=null;var _0x9a77c4='';return db[_0x0947('0x2c')]['findOne']({'where':{'id':_0x44d3bc[_0x0947('0x4a')]['id']},'attributes':['id',_0x0947('0x29'),_0x0947('0x5b'),_0x0947('0x5c'),'moduleName',_0x0947('0x5d'),'serverUrl',_0x0947('0x5e')]})[_0x0947('0x24')](handleEntityNotFound(_0x3efdf3,null))[_0x0947('0x24')](function(_0x5f57ef){if(_0x5f57ef){_0x2bc619=_0x5f57ef[_0x0947('0x5b')];_0xe3d45=_0x5f57ef[_0x0947('0x5e')];_0x25de6b=_0x5f57ef[_0x0947('0x5f')];_0x9a77c4=_0x5f57ef['remoteUri'];var _0x5c469a=_0x9a77c4[_0x0947('0x60')](-0x1);if(_0x5c469a==='/'){_0x9a77c4=_0x9a77c4['substring'](0x0,_0x9a77c4[_0x0947('0x61')](_0x5c469a));}_0x1ccc12=util[_0x0947('0x62')](_0x0947('0x63'),_0x9a77c4);var _0x4eae27={'method':_0x0947('0x64'),'uri':_0x1ccc12,'qs':{'operation':_0x0947('0x65'),'username':_0x5f57ef[_0x0947('0x5b')]},'json':!![]};return rp(_0x4eae27);}})[_0x0947('0x24')](function(_0x99cc35){if(_0x99cc35[_0x0947('0x66')]){var _0x568ff8={'method':_0x0947('0x67'),'uri':_0x1ccc12,'form':{'operation':'login','username':_0x2bc619,'accessKey':md5(_0x99cc35[_0x0947('0x68')]['token']+_0xe3d45)},'json':!![]};return rp(_0x568ff8);}})['then'](function(_0x3cd329){if(_0x3cd329['success']){var _0x5282e9={'method':_0x0947('0x64'),'uri':_0x1ccc12,'qs':{'operation':_0x0947('0x69'),'username':_0x2bc619,'sessionName':_0x3cd329[_0x0947('0x68')][_0x0947('0x6a')],'elementType':_0x25de6b},'json':!![]};return rp(_0x5282e9);}})[_0x0947('0x24')](function(_0xc4e646){if(_0xc4e646[_0x0947('0x66')]){var _0x3bffc2=['autogenerated','reference','owner'];_[_0x0947('0x6b')](_0xc4e646[_0x0947('0x68')]['fields'],function(_0x1d1b47){return _0x3bffc2[_0x0947('0x6c')](_0x1d1b47[_0x0947('0x2f')]['name']);});_['remove'](_0xc4e646[_0x0947('0x68')][_0x0947('0x37')],function(_0x3bf13d){return _0x3bf13d[_0x0947('0x6d')]==='false';});return{'count':_0xc4e646[_0x0947('0x68')][_0x0947('0x37')][_0x0947('0x46')],'rows':_['map'](_0xc4e646[_0x0947('0x68')]['fields'],function(_0x2236c2){return{'id':_0x2236c2[_0x0947('0x29')],'name':_0x2236c2[_0x0947('0x6e')],'custom':_['startsWith'](_0x2236c2[_0x0947('0x29')],_0x0947('0x6f'))?!![]:![],'options':_0x2236c2['type']['name']===_0x0947('0x70')&&_0x2236c2['type'][_0x0947('0x71')]['length']>0x0?_[_0x0947('0x2b')](_0x2236c2[_0x0947('0x2f')]['picklistValues'],function(_0x550370){return{'name':_0x550370[_0x0947('0x6e')],'value':_0x550370['value']};}):[]};})};}})[_0x0947('0x24')](respondWithResult(_0x3efdf3,null))['catch'](function(_0x5cb5c5){console[_0x0947('0x72')]('vTiger\x20error:\x20'+_0x5cb5c5);var _0xc17a7c=_0x44d3bc['query'][_0x0947('0x73')]?0x1f4:_0x5cb5c5['statusCode']||0x1f4;logger[_0x0947('0x27')](_0x0947('0x74'),_0x0947('0x5a'),_0xc17a7c,JSON[_0x0947('0x75')](_0x5cb5c5));delete _0x5cb5c5[_0x0947('0x29')];if(_0xc17a7c===0x191){_0xc17a7c=0x190;}_0x3efdf3[_0x0947('0x1b')](_0xc17a7c)[_0x0947('0x76')](_0x44d3bc[_0x0947('0x32')][_0x0947('0x73')]?{'message':_0x0947('0x77'),'statusCode':_0x5cb5c5['statusCode']}:_0x5cb5c5);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 72e5f78..db24836 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 _0x5bea=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','util','../../config/logger','moment'];(function(_0x54de8e,_0x2c7347){var _0x1e45f6=function(_0x4267ab){while(--_0x4267ab){_0x54de8e['push'](_0x54de8e['shift']());}};_0x1e45f6(++_0x2c7347);}(_0x5bea,0x141));var _0xa5be=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5bea[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xa5be('0x0'));var logger=require(_0xa5be('0x1'))('api');var moment=require(_0xa5be('0x2'));var BPromise=require(_0xa5be('0x3'));var rp=require(_0xa5be('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5be('0x5'));var config=require(_0xa5be('0x6'));var attributes=require(_0xa5be('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xa5be('0x8')]=function(_0x45c013,_0x2cdab3){return _0x45c013['define']('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf827=['api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','int_vtiger_accounts','lodash','util'];(function(_0x180f4f,_0x56ca73){var _0x3cf475=function(_0x5cbe38){while(--_0x5cbe38){_0x180f4f['push'](_0x180f4f['shift']());}};_0x3cf475(++_0x56ca73);}(_0xf827,0xee));var _0x7f82=function(_0xad266a,_0x2a9f72){_0xad266a=_0xad266a-0x0;var _0x1bee49=_0xf827[_0xad266a];return _0x1bee49;};'use strict';var _=require(_0x7f82('0x0'));var util=require(_0x7f82('0x1'));var logger=require('../../config/logger')(_0x7f82('0x2'));var moment=require(_0x7f82('0x3'));var BPromise=require(_0x7f82('0x4'));var rp=require(_0x7f82('0x5'));var fs=require('fs');var path=require(_0x7f82('0x6'));var rimraf=require('rimraf');var config=require(_0x7f82('0x7'));var attributes=require(_0x7f82('0x8'));var integrations=require(_0x7f82('0x9'));module[_0x7f82('0xa')]=function(_0x41f3b4,_0x448768){return _0x41f3b4['define']('VtigerAccount',attributes,{'tableName':_0x7f82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 82e6dcc..b382f92 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 _0x76dc=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','request\x20sent'];(function(_0x253389,_0x594791){var _0x489657=function(_0x4df533){while(--_0x4df533){_0x253389['push'](_0x253389['shift']());}};_0x489657(++_0x594791);}(_0x76dc,0x1f2));var _0xc76d=function(_0x5c8168,_0xe7325e){_0x5c8168=_0x5c8168-0x0;var _0x53079b=_0x76dc[_0x5c8168];return _0x53079b;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var moment=require(_0xc76d('0x2'));var BPromise=require(_0xc76d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc76d('0x4'));var db=require(_0xc76d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc76d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc76d('0x7'));var client=jayson[_0xc76d('0x8')][_0xc76d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4832bd,_0x4ce0bd,_0x119f38){return new BPromise(function(_0x114572,_0x18574f){return client['request'](_0x4832bd,_0x119f38)['then'](function(_0x1dc996){logger[_0xc76d('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4ce0bd,_0xc76d('0xb'));logger['debug'](_0xc76d('0xc'),_0x4ce0bd,_0xc76d('0xb'),JSON[_0xc76d('0xd')](_0x1dc996));if(_0x1dc996[_0xc76d('0xe')]){if(_0x1dc996[_0xc76d('0xe')][_0xc76d('0xf')]===0x1f4){logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);return _0x18574f(_0x1dc996[_0xc76d('0xe')][_0xc76d('0x11')]);}logger[_0xc76d('0xe')](_0xc76d('0x10'),_0x4ce0bd,_0x1dc996['error'][_0xc76d('0x11')]);return _0x114572(_0x1dc996[_0xc76d('0xe')]['message']);}else{logger[_0xc76d('0xa')](_0xc76d('0x10'),_0x4ce0bd,_0xc76d('0xb'));_0x114572(_0x1dc996[_0xc76d('0x12')]['message']);}})[_0xc76d('0x13')](function(_0x5d881c){logger['error'](_0xc76d('0x10'),_0x4ce0bd,_0x5d881c);_0x18574f(_0x5d881c);});});}exports[_0xc76d('0x14')]=function(_0x339623){var _0x23f3ca=this;return new Promise(function(_0xd1d16f,_0x4b0402){return db[_0xc76d('0x15')][_0xc76d('0x16')]({'raw':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x18')]===undefined?!![]:![]:!![],'where':_0x339623['options']?_0x339623[_0xc76d('0x17')][_0xc76d('0x19')]||null:null,'attributes':_0x339623['options']?_0x339623[_0xc76d('0x17')][_0xc76d('0x1a')]||null:null,'limit':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x1b')]||null:null,'include':_0x339623[_0xc76d('0x17')]?_0x339623[_0xc76d('0x17')][_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x339623[_0xc76d('0x17')][_0xc76d('0x1c')],function(_0x5de11f){return{'model':db[_0x5de11f[_0xc76d('0x1e')]],'as':_0x5de11f['as'],'attributes':_0x5de11f[_0xc76d('0x1a')],'include':_0x5de11f['include']?_[_0xc76d('0x1d')](_0x5de11f[_0xc76d('0x1c')],function(_0x55ca79){return{'model':db[_0x55ca79[_0xc76d('0x1e')]],'as':_0x55ca79['as'],'attributes':_0x55ca79[_0xc76d('0x1a')],'include':_0x55ca79[_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x55ca79[_0xc76d('0x1c')],function(_0x1949c4){return{'model':db[_0x1949c4[_0xc76d('0x1e')]],'as':_0x1949c4['as'],'attributes':_0x1949c4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x285430){logger[_0xc76d('0xa')]('GetVtigerAccount',_0x339623);logger[_0xc76d('0x1f')](_0xc76d('0x14'),_0x339623,JSON[_0xc76d('0xd')](_0x285430));_0xd1d16f(_0x285430);})['catch'](function(_0x2039f4){logger['error'](_0xc76d('0x14'),_0x2039f4[_0xc76d('0x11')],_0x339623);_0x4b0402(_0x23f3ca['error'](0x1f4,_0x2039f4[_0xc76d('0x11')]));});});};exports[_0xc76d('0x20')]=function(_0x9ab96c){var _0x2cf501=this;return new Promise(function(_0x4feeda,_0x283e16){return db['VtigerAccount'][_0xc76d('0x21')]({'raw':_0x9ab96c['options']?_0x9ab96c[_0xc76d('0x17')][_0xc76d('0x18')]===undefined?!![]:![]:!![],'where':_0x9ab96c['options']?_0x9ab96c['options']['where']||null:null,'attributes':_0x9ab96c['options']?_0x9ab96c[_0xc76d('0x17')][_0xc76d('0x1a')]||null:null,'include':_0x9ab96c[_0xc76d('0x17')]?_0x9ab96c[_0xc76d('0x17')][_0xc76d('0x1c')]?_['map'](_0x9ab96c[_0xc76d('0x17')]['include'],function(_0x854920){return{'model':db[_0x854920['model']],'as':_0x854920['as'],'attributes':_0x854920[_0xc76d('0x1a')],'include':_0x854920[_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x854920[_0xc76d('0x1c')],function(_0x2aa24d){return{'model':db[_0x2aa24d['model']],'as':_0x2aa24d['as'],'attributes':_0x2aa24d[_0xc76d('0x1a')],'include':_0x2aa24d[_0xc76d('0x1c')]?_[_0xc76d('0x1d')](_0x2aa24d['include'],function(_0x2f69c1){return{'model':db[_0x2f69c1[_0xc76d('0x1e')]],'as':_0x2f69c1['as'],'attributes':_0x2f69c1[_0xc76d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9cbf1e){logger[_0xc76d('0xa')](_0xc76d('0x20'),_0x9ab96c);logger[_0xc76d('0x1f')](_0xc76d('0x20'),_0x9ab96c,JSON[_0xc76d('0xd')](_0x9cbf1e));_0x4feeda(_0x9cbf1e);})['catch'](function(_0x518945){logger[_0xc76d('0xe')]('ShowVtigerAccount',_0x518945[_0xc76d('0x11')],_0x9ab96c);_0x283e16(_0x2cf501[_0xc76d('0xe')](0x1f4,_0x518945[_0xc76d('0x11')]));});});}; \ No newline at end of file +var _0x3c81=['debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xfabffc,_0x4e6767){var _0x11e8db=function(_0x5948c5){while(--_0x5948c5){_0xfabffc['push'](_0xfabffc['shift']());}};_0x11e8db(++_0x4e6767);}(_0x3c81,0x102));var _0x13c8=function(_0x4f22b5,_0x4059c2){_0x4f22b5=_0x4f22b5-0x0;var _0x4d6463=_0x3c81[_0x4f22b5];return _0x4d6463;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});}exports[_0x13c8('0x15')]=function(_0xce1ad2){var _0x28f07e=this;return new Promise(function(_0x346417,_0x251c38){return db[_0x13c8('0x16')][_0x13c8('0x17')]({'raw':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2['options'][_0x13c8('0x19')]===undefined?!![]:![]:!![],'where':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1a')]||null:null,'attributes':_0xce1ad2['options']?_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1b')]||null:null,'limit':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1c')]||null:null,'include':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2['options'][_0x13c8('0x1d')]?_[_0x13c8('0x1e')](_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1d')],function(_0x577df6){return{'model':db[_0x577df6[_0x13c8('0x1f')]],'as':_0x577df6['as'],'attributes':_0x577df6[_0x13c8('0x1b')],'include':_0x577df6['include']?_['map'](_0x577df6[_0x13c8('0x1d')],function(_0x4aff35){return{'model':db[_0x4aff35['model']],'as':_0x4aff35['as'],'attributes':_0x4aff35['attributes'],'include':_0x4aff35[_0x13c8('0x1d')]?_[_0x13c8('0x1e')](_0x4aff35['include'],function(_0x4df077){return{'model':db[_0x4df077[_0x13c8('0x1f')]],'as':_0x4df077['as'],'attributes':_0x4df077['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c7dc4){logger[_0x13c8('0xb')](_0x13c8('0x15'),_0xce1ad2);logger['debug']('GetVtigerAccount',_0xce1ad2,JSON[_0x13c8('0x10')](_0x1c7dc4));_0x346417(_0x1c7dc4);})[_0x13c8('0x20')](function(_0x399840){logger[_0x13c8('0x11')](_0x13c8('0x15'),_0x399840[_0x13c8('0x13')],_0xce1ad2);_0x251c38(_0x28f07e[_0x13c8('0x11')](0x1f4,_0x399840['message']));});});};exports[_0x13c8('0x21')]=function(_0xcbc9b7){var _0x5a5911=this;return new Promise(function(_0x5c85e4,_0x23a725){return db[_0x13c8('0x16')]['find']({'raw':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')][_0x13c8('0x1a')]||null:null,'attributes':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')][_0x13c8('0x1b')]||null:null,'include':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')]['include']?_['map'](_0xcbc9b7[_0x13c8('0x18')][_0x13c8('0x1d')],function(_0x517d01){return{'model':db[_0x517d01[_0x13c8('0x1f')]],'as':_0x517d01['as'],'attributes':_0x517d01['attributes'],'include':_0x517d01[_0x13c8('0x1d')]?_['map'](_0x517d01[_0x13c8('0x1d')],function(_0x53de18){return{'model':db[_0x53de18[_0x13c8('0x1f')]],'as':_0x53de18['as'],'attributes':_0x53de18[_0x13c8('0x1b')],'include':_0x53de18[_0x13c8('0x1d')]?_[_0x13c8('0x1e')](_0x53de18[_0x13c8('0x1d')],function(_0x5287f2){return{'model':db[_0x5287f2[_0x13c8('0x1f')]],'as':_0x5287f2['as'],'attributes':_0x5287f2[_0x13c8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x362b9c){logger[_0x13c8('0xb')](_0x13c8('0x21'),_0xcbc9b7);logger['debug']('ShowVtigerAccount',_0xcbc9b7,JSON['stringify'](_0x362b9c));_0x5c85e4(_0x362b9c);})[_0x13c8('0x20')](function(_0x2c8218){logger[_0x13c8('0x11')](_0x13c8('0x21'),_0x2c8218[_0x13c8('0x13')],_0xcbc9b7);_0x23a725(_0x5a5911[_0x13c8('0x11')](0x1f4,_0x2c8218[_0x13c8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 4df168d..1426a0c 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 _0x1e93=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','post','put'];(function(_0x55bb5c,_0x7e8b57){var _0x4de204=function(_0x9c4a8c){while(--_0x9c4a8c){_0x55bb5c['push'](_0x55bb5c['shift']());}};_0x4de204(++_0x7e8b57);}(_0x1e93,0x1e4));var _0x31e9=function(_0x104596,_0x50e630){_0x104596=_0x104596-0x0;var _0x148413=_0x1e93[_0x104596];return _0x148413;};'use strict';var multer=require(_0x31e9('0x0'));var util=require(_0x31e9('0x1'));var path=require(_0x31e9('0x2'));var timeout=require(_0x31e9('0x3'));var express=require(_0x31e9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x31e9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31e9('0x6'));var controller=require(_0x31e9('0x7'));router[_0x31e9('0x8')]('/',auth[_0x31e9('0x9')](),controller['index']);router[_0x31e9('0x8')](_0x31e9('0xa'),auth['isAuthenticated'](),controller[_0x31e9('0xb')]);router[_0x31e9('0x8')]('/:id/fields',auth[_0x31e9('0x9')](),controller[_0x31e9('0xc')]);router[_0x31e9('0x8')](_0x31e9('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x31e9('0x8')]('/:id/descriptions',auth[_0x31e9('0x9')](),controller['getDescriptions']);router[_0x31e9('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x31e9('0xf')](_0x31e9('0xa'),auth[_0x31e9('0x9')](),controller[_0x31e9('0x10')]);router[_0x31e9('0x11')](_0x31e9('0xa'),auth[_0x31e9('0x9')](),controller[_0x31e9('0x12')]);module[_0x31e9('0x13')]=router; \ No newline at end of file +var _0x6511=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','/:id','multer'];(function(_0x313b89,_0xbcda6){var _0x48dcf9=function(_0x28345a){while(--_0x28345a){_0x313b89['push'](_0x313b89['shift']());}};_0x48dcf9(++_0xbcda6);}(_0x6511,0x141));var _0x1651=function(_0x156696,_0x3a9a2e){_0x156696=_0x156696-0x0;var _0x5ab7c4=_0x6511[_0x156696];return _0x5ab7c4;};'use strict';var multer=require(_0x1651('0x0'));var util=require(_0x1651('0x1'));var path=require(_0x1651('0x2'));var timeout=require(_0x1651('0x3'));var express=require(_0x1651('0x4'));var router=express[_0x1651('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1651('0x6'));var interaction=require(_0x1651('0x7'));var config=require(_0x1651('0x8'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0x1651('0x9')](),controller[_0x1651('0xa')]);router['get']('/:id',auth[_0x1651('0x9')](),controller[_0x1651('0xb')]);router[_0x1651('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1651('0xd')]);router['get'](_0x1651('0xe'),auth[_0x1651('0x9')](),controller[_0x1651('0xf')]);router[_0x1651('0xc')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x1651('0x10')]);router[_0x1651('0x11')]('/',auth[_0x1651('0x9')](),controller[_0x1651('0x12')]);router[_0x1651('0x13')]('/:id',auth[_0x1651('0x9')](),controller[_0x1651('0x14')]);router[_0x1651('0x15')](_0x1651('0x16'),auth[_0x1651('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6f55368..718a0e1 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 _0x89b8=['exports','STRING','sequelize'];(function(_0x39ea8b,_0x581de6){var _0x14b2bd=function(_0x239da9){while(--_0x239da9){_0x39ea8b['push'](_0x39ea8b['shift']());}};_0x14b2bd(++_0x581de6);}(_0x89b8,0xe6));var _0x889b=function(_0x705834,_0xe005b){_0x705834=_0x705834-0x0;var _0x38b1d6=_0x89b8[_0x705834];return _0x38b1d6;};'use strict';var Sequelize=require(_0x889b('0x0'));module[_0x889b('0x1')]={'name':{'type':Sequelize[_0x889b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x824e=['exports','STRING'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x824e,0x1f0));var _0xe824=function(_0x5b791d,_0x49cc81){_0x5b791d=_0x5b791d-0x0;var _0xdd1c36=_0x824e[_0x5b791d];return _0xdd1c36;};'use strict';var Sequelize=require('sequelize');module[_0xe824('0x0')]={'name':{'type':Sequelize[_0xe824('0x1')]},'description':{'type':Sequelize[_0xe824('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 62ac032..eeb2d88 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 _0x159b=['map','VtigerConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x159b,0x181));var _0xb159=function(_0x183046,_0x143537){_0x183046=_0x183046-0x0;var _0x513136=_0x159b[_0x183046];return _0x513136;};'use strict';var emlformat=require(_0xb159('0x0'));var rimraf=require(_0xb159('0x1'));var zipdir=require(_0xb159('0x2'));var jsonpatch=require(_0xb159('0x3'));var rp=require(_0xb159('0x4'));var moment=require(_0xb159('0x5'));var BPromise=require(_0xb159('0x6'));var Mustache=require(_0xb159('0x7'));var util=require('util');var path=require(_0xb159('0x8'));var sox=require(_0xb159('0x9'));var csv=require(_0xb159('0xa'));var ejs=require(_0xb159('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb159('0xc'));var squel=require(_0xb159('0xd'));var crypto=require(_0xb159('0xe'));var jsforce=require(_0xb159('0xf'));var deskjs=require(_0xb159('0x10'));var toCsv=require(_0xb159('0xa'));var querystring=require(_0xb159('0x11'));var Papa=require(_0xb159('0x12'));var Redis=require(_0xb159('0x13'));var authService=require(_0xb159('0x14'));var qs=require(_0xb159('0x15'));var as=require(_0xb159('0x16'));var hardwareService=require(_0xb159('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xb159('0x18'));var config=require(_0xb159('0x19'));var licenseUtil=require(_0xb159('0x1a'));var db=require(_0xb159('0x1b'))['db'];function respondWithStatusCode(_0x7bf9ca,_0x28fa46){_0x28fa46=_0x28fa46||0xcc;return function(_0x5cf1be){if(_0x5cf1be){return _0x7bf9ca[_0xb159('0x1c')](_0x28fa46);}return _0x7bf9ca['status'](_0x28fa46)[_0xb159('0x1d')]();};}function respondWithResult(_0x1471fa,_0x5b162a){_0x5b162a=_0x5b162a||0xc8;return function(_0x541a50){if(_0x541a50){return _0x1471fa[_0xb159('0x1e')](_0x5b162a)[_0xb159('0x1f')](_0x541a50);}};}function respondWithFilteredResult(_0x69c5e2,_0x5e755c){return function(_0x31b670){if(_0x31b670){var _0x20bbb8=typeof _0x5e755c['offset']===_0xb159('0x20')&&typeof _0x5e755c[_0xb159('0x21')]==='undefined';var _0x458621=_0x31b670['count'];var _0x331c64=_0x20bbb8?0x0:_0x5e755c[_0xb159('0x22')];var _0x48fa45=_0x20bbb8?_0x31b670['count']:_0x5e755c[_0xb159('0x22')]+_0x5e755c['limit'];var _0x10f211;if(_0x48fa45>=_0x458621){_0x48fa45=_0x458621;_0x10f211=0xc8;}else{_0x10f211=0xce;}_0x69c5e2[_0xb159('0x1e')](_0x10f211);return _0x69c5e2[_0xb159('0x23')](_0xb159('0x24'),_0x331c64+'-'+_0x48fa45+'/'+_0x458621)[_0xb159('0x1f')](_0x31b670);}return null;};}function patchUpdates(_0x3127d9){return function(_0x2affe8){try{jsonpatch[_0xb159('0x25')](_0x2affe8,_0x3127d9,!![]);}catch(_0x43a3c3){return BPromise[_0xb159('0x26')](_0x43a3c3);}return _0x2affe8[_0xb159('0x27')]();};}function saveUpdates(_0x2d6e2c,_0x37c55a){return function(_0x5d6bb9){if(_0x5d6bb9){return _0x5d6bb9[_0xb159('0x28')](_0x2d6e2c)['then'](function(_0x585afd){return _0x585afd;});}return null;};}function removeEntity(_0x15fcb0,_0x3ff1fe){return function(_0x24e3aa){if(_0x24e3aa){return _0x24e3aa['destroy']()[_0xb159('0x29')](function(){_0x15fcb0[_0xb159('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148571,_0x10cd78){return function(_0x43085d){if(!_0x43085d){_0x148571[_0xb159('0x1c')](0x194);}return _0x43085d;};}function handleError(_0x44a523,_0x2716b3){_0x2716b3=_0x2716b3||0x1f4;return function(_0x12f205){logger[_0xb159('0x2a')](_0x12f205['stack']);if(_0x12f205[_0xb159('0x2b')]){delete _0x12f205[_0xb159('0x2b')];}_0x44a523['status'](_0x2716b3)[_0xb159('0x2c')](_0x12f205);};}exports['index']=function(_0x5bd224,_0x591ba9){var _0x5d1773={},_0x59231b={},_0x3eb8b0={'count':0x0,'rows':[]};var _0x29d50e=_[_0xb159('0x2d')](db[_0xb159('0x2e')]['rawAttributes'],function(_0xdcb129){return{'name':_0xdcb129[_0xb159('0x2f')],'type':_0xdcb129[_0xb159('0x30')][_0xb159('0x31')]};});_0x59231b['model']=_[_0xb159('0x2d')](_0x29d50e,'name');_0x59231b[_0xb159('0x32')]=_[_0xb159('0x33')](_0x5bd224[_0xb159('0x32')]);_0x59231b[_0xb159('0x34')]=_[_0xb159('0x35')](_0x59231b[_0xb159('0x36')],_0x59231b[_0xb159('0x32')]);_0x5d1773[_0xb159('0x37')]=_['intersection'](_0x59231b[_0xb159('0x36')],qs[_0xb159('0x38')](_0x5bd224[_0xb159('0x32')][_0xb159('0x38')]));_0x5d1773[_0xb159('0x37')]=_0x5d1773['attributes'][_0xb159('0x39')]?_0x5d1773['attributes']:_0x59231b[_0xb159('0x36')];if(!_0x5bd224[_0xb159('0x32')][_0xb159('0x3a')](_0xb159('0x3b'))){_0x5d1773[_0xb159('0x21')]=qs[_0xb159('0x21')](_0x5bd224['query'][_0xb159('0x21')]);_0x5d1773[_0xb159('0x22')]=qs[_0xb159('0x22')](_0x5bd224[_0xb159('0x32')]['offset']);}_0x5d1773[_0xb159('0x3c')]=qs['sort'](_0x5bd224['query'][_0xb159('0x3d')]);_0x5d1773[_0xb159('0x3e')]=qs['filters'](_[_0xb159('0x3f')](_0x5bd224[_0xb159('0x32')],_0x59231b['filters']),_0x29d50e);if(_0x5bd224[_0xb159('0x32')][_0xb159('0x40')]){_0x5d1773[_0xb159('0x3e')]=_[_0xb159('0x41')](_0x5d1773[_0xb159('0x3e')],{'$or':_[_0xb159('0x2d')](_0x29d50e,function(_0x2bbba9){if(_0x2bbba9[_0xb159('0x30')]!==_0xb159('0x42')){var _0x4d4e92={};_0x4d4e92[_0x2bbba9[_0xb159('0x2b')]]={'$like':'%'+_0x5bd224[_0xb159('0x32')][_0xb159('0x40')]+'%'};return _0x4d4e92;}})});}_0x5d1773=_[_0xb159('0x41')]({},_0x5d1773,_0x5bd224['options']);var _0x46f7a7={'where':_0x5d1773[_0xb159('0x3e')]};return db[_0xb159('0x2e')][_0xb159('0x43')](_0x46f7a7)['then'](function(_0x8dc8cc){_0x3eb8b0[_0xb159('0x43')]=_0x8dc8cc;if(_0x5bd224[_0xb159('0x32')][_0xb159('0x44')]){_0x5d1773[_0xb159('0x45')]=[{'all':!![]}];}return db[_0xb159('0x2e')][_0xb159('0x46')](_0x5d1773);})['then'](function(_0x376c51){_0x3eb8b0[_0xb159('0x47')]=_0x376c51;return _0x3eb8b0;})[_0xb159('0x29')](respondWithFilteredResult(_0x591ba9,_0x5d1773))[_0xb159('0x48')](handleError(_0x591ba9,null));};exports[_0xb159('0x49')]=function(_0x406fc0,_0x3d8cbc){var _0x15f81c={'raw':![],'where':{'id':_0x406fc0[_0xb159('0x4a')]['id']}},_0x48a908={};_0x48a908[_0xb159('0x36')]=_[_0xb159('0x33')](db[_0xb159('0x2e')][_0xb159('0x4b')]);_0x48a908[_0xb159('0x32')]=_['keys'](_0x406fc0[_0xb159('0x32')]);_0x48a908[_0xb159('0x34')]=_[_0xb159('0x35')](_0x48a908[_0xb159('0x36')],_0x48a908['query']);_0x15f81c[_0xb159('0x37')]=_[_0xb159('0x35')](_0x48a908['model'],qs[_0xb159('0x38')](_0x406fc0[_0xb159('0x32')][_0xb159('0x38')]));_0x15f81c[_0xb159('0x37')]=_0x15f81c[_0xb159('0x37')]['length']?_0x15f81c[_0xb159('0x37')]:_0x48a908[_0xb159('0x36')];if(_0x406fc0[_0xb159('0x32')][_0xb159('0x44')]){_0x15f81c[_0xb159('0x45')]=[{'all':!![]}];}_0x15f81c=_[_0xb159('0x41')]({},_0x15f81c,_0x406fc0[_0xb159('0x4c')]);return db[_0xb159('0x2e')]['find'](_0x15f81c)['then'](handleEntityNotFound(_0x3d8cbc,null))[_0xb159('0x29')](respondWithResult(_0x3d8cbc,null))[_0xb159('0x48')](handleError(_0x3d8cbc,null));};exports[_0xb159('0x4d')]=function(_0x316e39,_0x1bf7d9){return db[_0xb159('0x2e')]['create'](_0x316e39[_0xb159('0x4e')],{})[_0xb159('0x29')](respondWithResult(_0x1bf7d9,0xc9))['catch'](handleError(_0x1bf7d9,null));};exports[_0xb159('0x28')]=function(_0x303e41,_0x32cdd9){if(_0x303e41[_0xb159('0x4e')]['id']){delete _0x303e41['body']['id'];}return db[_0xb159('0x2e')][_0xb159('0x4f')]({'where':{'id':_0x303e41[_0xb159('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32cdd9,null))[_0xb159('0x29')](saveUpdates(_0x303e41[_0xb159('0x4e')],null))['then'](respondWithResult(_0x32cdd9,null))[_0xb159('0x48')](handleError(_0x32cdd9,null));};exports[_0xb159('0x50')]=function(_0x1bf2f4,_0x2e8dbf){return db[_0xb159('0x2e')][_0xb159('0x4f')]({'where':{'id':_0x1bf2f4['params']['id']}})[_0xb159('0x29')](handleEntityNotFound(_0x2e8dbf,null))[_0xb159('0x29')](removeEntity(_0x2e8dbf,null))[_0xb159('0x48')](handleError(_0x2e8dbf,null));};exports[_0xb159('0x51')]=function(_0xe75331,_0x3afd99,_0x1e43ca){var _0x593c39={};var _0x2cc749={};var _0x3e26c6;var _0x11af19;return db['VtigerConfiguration'][_0xb159('0x52')]({'where':{'id':_0xe75331[_0xb159('0x4a')]['id']}})[_0xb159('0x29')](handleEntityNotFound(_0x3afd99,null))['then'](function(_0x3548d0){if(_0x3548d0){_0x3e26c6=_0x3548d0;_0x2cc749[_0xb159('0x36')]=_[_0xb159('0x33')](db[_0xb159('0x53')]['rawAttributes']);_0x2cc749['query']=_[_0xb159('0x33')](_0xe75331['query']);_0x2cc749[_0xb159('0x34')]=_['intersection'](_0x2cc749[_0xb159('0x36')],_0x2cc749[_0xb159('0x32')]);_0x593c39[_0xb159('0x37')]=_[_0xb159('0x35')](_0x2cc749['model'],qs['fields'](_0xe75331[_0xb159('0x32')][_0xb159('0x38')]));_0x593c39[_0xb159('0x37')]=_0x593c39[_0xb159('0x37')][_0xb159('0x39')]?_0x593c39[_0xb159('0x37')]:_0x2cc749[_0xb159('0x36')];_0x593c39[_0xb159('0x3c')]=qs[_0xb159('0x3d')](_0xe75331[_0xb159('0x32')][_0xb159('0x3d')]);_0x593c39[_0xb159('0x3e')]=qs[_0xb159('0x34')](_['pick'](_0xe75331[_0xb159('0x32')],_0x2cc749[_0xb159('0x34')]));if(_0xe75331[_0xb159('0x32')][_0xb159('0x40')]){_0x593c39[_0xb159('0x3e')]=_[_0xb159('0x41')](_0x593c39[_0xb159('0x3e')],{'$or':_[_0xb159('0x2d')](_0x593c39[_0xb159('0x37')],function(_0x2788e1){var _0x564d22={};_0x564d22[_0x2788e1]={'$like':'%'+_0xe75331[_0xb159('0x32')]['filter']+'%'};return _0x564d22;})});}_0x593c39=_['merge']({},_0x593c39,_0xe75331[_0xb159('0x4c')]);return _0x3e26c6[_0xb159('0x51')](_0x593c39);}})['then'](function(_0x3c3c77){if(_0x3c3c77){_0x11af19=_0x3c3c77[_0xb159('0x39')];if(!_0xe75331[_0xb159('0x32')][_0xb159('0x3a')](_0xb159('0x3b'))){_0x593c39[_0xb159('0x21')]=qs[_0xb159('0x21')](_0xe75331[_0xb159('0x32')][_0xb159('0x21')]);_0x593c39['offset']=qs[_0xb159('0x22')](_0xe75331[_0xb159('0x32')][_0xb159('0x22')]);}return _0x3e26c6[_0xb159('0x51')](_0x593c39);}})['then'](function(_0x1ac789){if(_0x1ac789){return _0x1ac789?{'count':_0x11af19,'rows':_0x1ac789}:null;}})[_0xb159('0x29')](respondWithResult(_0x3afd99,null))['catch'](handleError(_0x3afd99,null));};exports[_0xb159('0x54')]=function(_0x5e2e65,_0x33b8a3,_0x57d6c3){var _0x3115a0={};var _0x1eddcf={};var _0x1feff2;var _0x116c3e;return db[_0xb159('0x2e')][_0xb159('0x52')]({'where':{'id':_0x5e2e65[_0xb159('0x4a')]['id']}})[_0xb159('0x29')](handleEntityNotFound(_0x33b8a3,null))[_0xb159('0x29')](function(_0x59d06d){if(_0x59d06d){_0x1feff2=_0x59d06d;_0x1eddcf[_0xb159('0x36')]=_['keys'](db[_0xb159('0x53')][_0xb159('0x4b')]);_0x1eddcf['query']=_[_0xb159('0x33')](_0x5e2e65[_0xb159('0x32')]);_0x1eddcf[_0xb159('0x34')]=_[_0xb159('0x35')](_0x1eddcf['model'],_0x1eddcf[_0xb159('0x32')]);_0x3115a0[_0xb159('0x37')]=_[_0xb159('0x35')](_0x1eddcf['model'],qs[_0xb159('0x38')](_0x5e2e65[_0xb159('0x32')]['fields']));_0x3115a0['attributes']=_0x3115a0[_0xb159('0x37')][_0xb159('0x39')]?_0x3115a0[_0xb159('0x37')]:_0x1eddcf[_0xb159('0x36')];_0x3115a0[_0xb159('0x3c')]=qs[_0xb159('0x3d')](_0x5e2e65[_0xb159('0x32')]['sort']);_0x3115a0[_0xb159('0x3e')]=qs[_0xb159('0x34')](_[_0xb159('0x3f')](_0x5e2e65[_0xb159('0x32')],_0x1eddcf[_0xb159('0x34')]));if(_0x5e2e65['query'][_0xb159('0x40')]){_0x3115a0[_0xb159('0x3e')]=_['merge'](_0x3115a0[_0xb159('0x3e')],{'$or':_['map'](_0x3115a0[_0xb159('0x37')],function(_0x244d91){var _0x2b2525={};_0x2b2525[_0x244d91]={'$like':'%'+_0x5e2e65['query'][_0xb159('0x40')]+'%'};return _0x2b2525;})});}_0x3115a0=_[_0xb159('0x41')]({},_0x3115a0,_0x5e2e65[_0xb159('0x4c')]);return _0x1feff2[_0xb159('0x54')](_0x3115a0);}})[_0xb159('0x29')](function(_0x3aa7f6){if(_0x3aa7f6){_0x116c3e=_0x3aa7f6[_0xb159('0x39')];if(!_0x5e2e65['query'][_0xb159('0x3a')](_0xb159('0x3b'))){_0x3115a0['limit']=qs[_0xb159('0x21')](_0x5e2e65[_0xb159('0x32')][_0xb159('0x21')]);_0x3115a0[_0xb159('0x22')]=qs[_0xb159('0x22')](_0x5e2e65['query'][_0xb159('0x22')]);}return _0x1feff2[_0xb159('0x54')](_0x3115a0);}})['then'](function(_0x223ad5){if(_0x223ad5){return _0x223ad5?{'count':_0x116c3e,'rows':_0x223ad5}:null;}})['then'](respondWithResult(_0x33b8a3,null))[_0xb159('0x48')](handleError(_0x33b8a3,null));};exports['getDescriptions']=function(_0x286033,_0x198b68,_0x42739a){var _0x5b3fb7={};var _0x86fc3b={};var _0x2d1dee;var _0x5a99b9;return db['VtigerConfiguration'][_0xb159('0x52')]({'where':{'id':_0x286033[_0xb159('0x4a')]['id']}})[_0xb159('0x29')](handleEntityNotFound(_0x198b68,null))[_0xb159('0x29')](function(_0xb59095){if(_0xb59095){_0x2d1dee=_0xb59095;_0x86fc3b[_0xb159('0x36')]=_['keys'](db[_0xb159('0x53')]['rawAttributes']);_0x86fc3b[_0xb159('0x32')]=_['keys'](_0x286033[_0xb159('0x32')]);_0x86fc3b[_0xb159('0x34')]=_[_0xb159('0x35')](_0x86fc3b[_0xb159('0x36')],_0x86fc3b['query']);_0x5b3fb7[_0xb159('0x37')]=_[_0xb159('0x35')](_0x86fc3b[_0xb159('0x36')],qs[_0xb159('0x38')](_0x286033[_0xb159('0x32')][_0xb159('0x38')]));_0x5b3fb7['attributes']=_0x5b3fb7[_0xb159('0x37')][_0xb159('0x39')]?_0x5b3fb7['attributes']:_0x86fc3b['model'];_0x5b3fb7[_0xb159('0x3c')]=qs[_0xb159('0x3d')](_0x286033['query'][_0xb159('0x3d')]);_0x5b3fb7['where']=qs['filters'](_[_0xb159('0x3f')](_0x286033[_0xb159('0x32')],_0x86fc3b[_0xb159('0x34')]));if(_0x286033[_0xb159('0x32')][_0xb159('0x40')]){_0x5b3fb7[_0xb159('0x3e')]=_[_0xb159('0x41')](_0x5b3fb7[_0xb159('0x3e')],{'$or':_[_0xb159('0x2d')](_0x5b3fb7[_0xb159('0x37')],function(_0x37a1c7){var _0x4cf214={};_0x4cf214[_0x37a1c7]={'$like':'%'+_0x286033[_0xb159('0x32')]['filter']+'%'};return _0x4cf214;})});}_0x5b3fb7=_['merge']({},_0x5b3fb7,_0x286033['options']);return _0x2d1dee[_0xb159('0x55')](_0x5b3fb7);}})['then'](function(_0x68d1be){if(_0x68d1be){_0x5a99b9=_0x68d1be[_0xb159('0x39')];if(!_0x286033['query'][_0xb159('0x3a')]('nolimit')){_0x5b3fb7['limit']=qs[_0xb159('0x21')](_0x286033[_0xb159('0x32')]['limit']);_0x5b3fb7['offset']=qs[_0xb159('0x22')](_0x286033[_0xb159('0x32')][_0xb159('0x22')]);}return _0x2d1dee[_0xb159('0x55')](_0x5b3fb7);}})[_0xb159('0x29')](function(_0x265fcc){if(_0x265fcc){return _0x265fcc?{'count':_0x5a99b9,'rows':_0x265fcc}:null;}})[_0xb159('0x29')](respondWithResult(_0x198b68,null))[_0xb159('0x48')](handleError(_0x198b68,null));}; \ No newline at end of file +var _0x0df9=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','update','then','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','VtigerConfiguration','include','show','params','keys','length','includeAll','catch','create','body','find','destroy','VtigerField','pick','getFields','findOne','options','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x256e7e,_0x4bd682){var _0x5cd898=function(_0x272713){while(--_0x272713){_0x256e7e['push'](_0x256e7e['shift']());}};_0x5cd898(++_0x4bd682);}(_0x0df9,0x170));var _0x90df=function(_0x26344b,_0xc28ced){_0x26344b=_0x26344b-0x0;var _0x222791=_0x0df9[_0x26344b];return _0x222791;};'use strict';var emlformat=require(_0x90df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90df('0x1'));var jsonpatch=require(_0x90df('0x2'));var rp=require('request-promise');var moment=require(_0x90df('0x3'));var BPromise=require(_0x90df('0x4'));var Mustache=require(_0x90df('0x5'));var util=require(_0x90df('0x6'));var path=require(_0x90df('0x7'));var sox=require(_0x90df('0x8'));var csv=require(_0x90df('0x9'));var ejs=require(_0x90df('0xa'));var fs=require('fs');var fs_extra=require(_0x90df('0xb'));var _=require(_0x90df('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x90df('0xd'));var deskjs=require(_0x90df('0xe'));var toCsv=require('to-csv');var querystring=require(_0x90df('0xf'));var Papa=require(_0x90df('0x10'));var Redis=require(_0x90df('0x11'));var authService=require(_0x90df('0x12'));var qs=require(_0x90df('0x13'));var as=require(_0x90df('0x14'));var hardwareService=require(_0x90df('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x90df('0x16'));var config=require(_0x90df('0x17'));var licenseUtil=require(_0x90df('0x18'));var db=require(_0x90df('0x19'))['db'];function respondWithStatusCode(_0x5b1a00,_0x1aa960){_0x1aa960=_0x1aa960||0xcc;return function(_0x1f4ab7){if(_0x1f4ab7){return _0x5b1a00[_0x90df('0x1a')](_0x1aa960);}return _0x5b1a00[_0x90df('0x1b')](_0x1aa960)[_0x90df('0x1c')]();};}function respondWithResult(_0x5bdab2,_0x52d6bf){_0x52d6bf=_0x52d6bf||0xc8;return function(_0x110966){if(_0x110966){return _0x5bdab2['status'](_0x52d6bf)['json'](_0x110966);}};}function respondWithFilteredResult(_0x5907ee,_0x3746e4){return function(_0x404b64){if(_0x404b64){var _0x4a347b=typeof _0x3746e4[_0x90df('0x1d')]==='undefined'&&typeof _0x3746e4[_0x90df('0x1e')]===_0x90df('0x1f');var _0x448e28=_0x404b64[_0x90df('0x20')];var _0xdee6bb=_0x4a347b?0x0:_0x3746e4['offset'];var _0x224a5b=_0x4a347b?_0x404b64[_0x90df('0x20')]:_0x3746e4[_0x90df('0x1d')]+_0x3746e4['limit'];var _0x3a214e;if(_0x224a5b>=_0x448e28){_0x224a5b=_0x448e28;_0x3a214e=0xc8;}else{_0x3a214e=0xce;}_0x5907ee[_0x90df('0x1b')](_0x3a214e);return _0x5907ee['set'](_0x90df('0x21'),_0xdee6bb+'-'+_0x224a5b+'/'+_0x448e28)[_0x90df('0x22')](_0x404b64);}return null;};}function patchUpdates(_0xc49922){return function(_0x1ca4c1){try{jsonpatch[_0x90df('0x23')](_0x1ca4c1,_0xc49922,!![]);}catch(_0x4117bf){return BPromise['reject'](_0x4117bf);}return _0x1ca4c1['save']();};}function saveUpdates(_0x11d47e,_0x50e9a5){return function(_0x38734e){if(_0x38734e){return _0x38734e[_0x90df('0x24')](_0x11d47e)['then'](function(_0x50f384){return _0x50f384;});}return null;};}function removeEntity(_0x12dce2,_0x47abe1){return function(_0xc1abf0){if(_0xc1abf0){return _0xc1abf0['destroy']()[_0x90df('0x25')](function(){_0x12dce2[_0x90df('0x1b')](0xcc)[_0x90df('0x1c')]();});}};}function handleEntityNotFound(_0x56e7ae,_0x1daa9b){return function(_0x1d4531){if(!_0x1d4531){_0x56e7ae[_0x90df('0x1a')](0x194);}return _0x1d4531;};}function handleError(_0x49690b,_0x45d732){_0x45d732=_0x45d732||0x1f4;return function(_0x5203ad){logger['error'](_0x5203ad[_0x90df('0x26')]);if(_0x5203ad[_0x90df('0x27')]){delete _0x5203ad[_0x90df('0x27')];}_0x49690b[_0x90df('0x1b')](_0x45d732)[_0x90df('0x28')](_0x5203ad);};}exports[_0x90df('0x29')]=function(_0x5f95c8,_0x33d1fb){var _0x37cf9d={},_0x4e6ea2={},_0x1e2c38={'count':0x0,'rows':[]};var _0x2ff8f4=_['map'](db['VtigerConfiguration'][_0x90df('0x2a')],function(_0x589f73){return{'name':_0x589f73[_0x90df('0x2b')],'type':_0x589f73[_0x90df('0x2c')]['key']};});_0x4e6ea2[_0x90df('0x2d')]=_[_0x90df('0x2e')](_0x2ff8f4,_0x90df('0x27'));_0x4e6ea2[_0x90df('0x2f')]=_['keys'](_0x5f95c8[_0x90df('0x2f')]);_0x4e6ea2['filters']=_['intersection'](_0x4e6ea2[_0x90df('0x2d')],_0x4e6ea2[_0x90df('0x2f')]);_0x37cf9d[_0x90df('0x30')]=_[_0x90df('0x31')](_0x4e6ea2[_0x90df('0x2d')],qs[_0x90df('0x32')](_0x5f95c8[_0x90df('0x2f')][_0x90df('0x32')]));_0x37cf9d[_0x90df('0x30')]=_0x37cf9d['attributes']['length']?_0x37cf9d['attributes']:_0x4e6ea2[_0x90df('0x2d')];if(!_0x5f95c8['query'][_0x90df('0x33')](_0x90df('0x34'))){_0x37cf9d[_0x90df('0x1e')]=qs['limit'](_0x5f95c8[_0x90df('0x2f')][_0x90df('0x1e')]);_0x37cf9d[_0x90df('0x1d')]=qs[_0x90df('0x1d')](_0x5f95c8[_0x90df('0x2f')][_0x90df('0x1d')]);}_0x37cf9d[_0x90df('0x35')]=qs['sort'](_0x5f95c8['query'][_0x90df('0x36')]);_0x37cf9d[_0x90df('0x37')]=qs[_0x90df('0x38')](_['pick'](_0x5f95c8[_0x90df('0x2f')],_0x4e6ea2[_0x90df('0x38')]),_0x2ff8f4);if(_0x5f95c8['query']['filter']){_0x37cf9d[_0x90df('0x37')]=_[_0x90df('0x39')](_0x37cf9d[_0x90df('0x37')],{'$or':_['map'](_0x2ff8f4,function(_0x879d3e){if(_0x879d3e[_0x90df('0x2c')]!=='VIRTUAL'){var _0x20480b={};_0x20480b[_0x879d3e[_0x90df('0x27')]]={'$like':'%'+_0x5f95c8[_0x90df('0x2f')][_0x90df('0x3a')]+'%'};return _0x20480b;}})});}_0x37cf9d=_[_0x90df('0x39')]({},_0x37cf9d,_0x5f95c8['options']);var _0x190437={'where':_0x37cf9d[_0x90df('0x37')]};return db[_0x90df('0x3b')]['count'](_0x190437)[_0x90df('0x25')](function(_0x78f6b0){_0x1e2c38['count']=_0x78f6b0;if(_0x5f95c8[_0x90df('0x2f')]['includeAll']){_0x37cf9d[_0x90df('0x3c')]=[{'all':!![]}];}return db[_0x90df('0x3b')]['findAll'](_0x37cf9d);})[_0x90df('0x25')](function(_0x341d21){_0x1e2c38['rows']=_0x341d21;return _0x1e2c38;})[_0x90df('0x25')](respondWithFilteredResult(_0x33d1fb,_0x37cf9d))['catch'](handleError(_0x33d1fb,null));};exports[_0x90df('0x3d')]=function(_0x4c1ac2,_0x2bfdf2){var _0x37214d={'raw':![],'where':{'id':_0x4c1ac2[_0x90df('0x3e')]['id']}},_0x104f77={};_0x104f77[_0x90df('0x2d')]=_[_0x90df('0x3f')](db[_0x90df('0x3b')]['rawAttributes']);_0x104f77['query']=_['keys'](_0x4c1ac2[_0x90df('0x2f')]);_0x104f77[_0x90df('0x38')]=_[_0x90df('0x31')](_0x104f77['model'],_0x104f77['query']);_0x37214d['attributes']=_[_0x90df('0x31')](_0x104f77[_0x90df('0x2d')],qs[_0x90df('0x32')](_0x4c1ac2[_0x90df('0x2f')][_0x90df('0x32')]));_0x37214d['attributes']=_0x37214d[_0x90df('0x30')][_0x90df('0x40')]?_0x37214d[_0x90df('0x30')]:_0x104f77[_0x90df('0x2d')];if(_0x4c1ac2[_0x90df('0x2f')][_0x90df('0x41')]){_0x37214d['include']=[{'all':!![]}];}_0x37214d=_[_0x90df('0x39')]({},_0x37214d,_0x4c1ac2['options']);return db['VtigerConfiguration']['find'](_0x37214d)[_0x90df('0x25')](handleEntityNotFound(_0x2bfdf2,null))[_0x90df('0x25')](respondWithResult(_0x2bfdf2,null))[_0x90df('0x42')](handleError(_0x2bfdf2,null));};exports[_0x90df('0x43')]=function(_0x519dfb,_0xbc15cb){return db[_0x90df('0x3b')][_0x90df('0x43')](_0x519dfb[_0x90df('0x44')],{})[_0x90df('0x25')](respondWithResult(_0xbc15cb,0xc9))[_0x90df('0x42')](handleError(_0xbc15cb,null));};exports[_0x90df('0x24')]=function(_0xb552d,_0x90ad25){if(_0xb552d[_0x90df('0x44')]['id']){delete _0xb552d[_0x90df('0x44')]['id'];}return db[_0x90df('0x3b')][_0x90df('0x45')]({'where':{'id':_0xb552d[_0x90df('0x3e')]['id']}})[_0x90df('0x25')](handleEntityNotFound(_0x90ad25,null))[_0x90df('0x25')](saveUpdates(_0xb552d[_0x90df('0x44')],null))[_0x90df('0x25')](respondWithResult(_0x90ad25,null))[_0x90df('0x42')](handleError(_0x90ad25,null));};exports[_0x90df('0x46')]=function(_0x1d004c,_0x3717ea){return db['VtigerConfiguration']['find']({'where':{'id':_0x1d004c[_0x90df('0x3e')]['id']}})[_0x90df('0x25')](handleEntityNotFound(_0x3717ea,null))[_0x90df('0x25')](removeEntity(_0x3717ea,null))['catch'](handleError(_0x3717ea,null));};exports['getFields']=function(_0x18860a,_0x1acec5,_0x2e92bf){var _0x16ba03={};var _0x5568dc={};var _0x24f463;var _0x47ca8f;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x18860a[_0x90df('0x3e')]['id']}})[_0x90df('0x25')](handleEntityNotFound(_0x1acec5,null))[_0x90df('0x25')](function(_0x1f9306){if(_0x1f9306){_0x24f463=_0x1f9306;_0x5568dc[_0x90df('0x2d')]=_['keys'](db[_0x90df('0x47')]['rawAttributes']);_0x5568dc[_0x90df('0x2f')]=_['keys'](_0x18860a[_0x90df('0x2f')]);_0x5568dc[_0x90df('0x38')]=_['intersection'](_0x5568dc[_0x90df('0x2d')],_0x5568dc[_0x90df('0x2f')]);_0x16ba03['attributes']=_[_0x90df('0x31')](_0x5568dc[_0x90df('0x2d')],qs['fields'](_0x18860a[_0x90df('0x2f')][_0x90df('0x32')]));_0x16ba03['attributes']=_0x16ba03[_0x90df('0x30')][_0x90df('0x40')]?_0x16ba03['attributes']:_0x5568dc[_0x90df('0x2d')];_0x16ba03['order']=qs[_0x90df('0x36')](_0x18860a[_0x90df('0x2f')]['sort']);_0x16ba03['where']=qs[_0x90df('0x38')](_[_0x90df('0x48')](_0x18860a[_0x90df('0x2f')],_0x5568dc['filters']));if(_0x18860a[_0x90df('0x2f')][_0x90df('0x3a')]){_0x16ba03[_0x90df('0x37')]=_[_0x90df('0x39')](_0x16ba03[_0x90df('0x37')],{'$or':_[_0x90df('0x2e')](_0x16ba03[_0x90df('0x30')],function(_0xd1ff53){var _0x31eed3={};_0x31eed3[_0xd1ff53]={'$like':'%'+_0x18860a[_0x90df('0x2f')][_0x90df('0x3a')]+'%'};return _0x31eed3;})});}_0x16ba03=_['merge']({},_0x16ba03,_0x18860a['options']);return _0x24f463[_0x90df('0x49')](_0x16ba03);}})[_0x90df('0x25')](function(_0x2523ae){if(_0x2523ae){_0x47ca8f=_0x2523ae[_0x90df('0x40')];if(!_0x18860a[_0x90df('0x2f')][_0x90df('0x33')]('nolimit')){_0x16ba03[_0x90df('0x1e')]=qs['limit'](_0x18860a[_0x90df('0x2f')][_0x90df('0x1e')]);_0x16ba03[_0x90df('0x1d')]=qs['offset'](_0x18860a[_0x90df('0x2f')][_0x90df('0x1d')]);}return _0x24f463[_0x90df('0x49')](_0x16ba03);}})['then'](function(_0x2913e1){if(_0x2913e1){return _0x2913e1?{'count':_0x47ca8f,'rows':_0x2913e1}:null;}})[_0x90df('0x25')](respondWithResult(_0x1acec5,null))[_0x90df('0x42')](handleError(_0x1acec5,null));};exports['getSubjects']=function(_0xd70b45,_0x599188,_0x13e7a3){var _0x40311b={};var _0x4336cd={};var _0x22ba61;var _0x105752;return db[_0x90df('0x3b')][_0x90df('0x4a')]({'where':{'id':_0xd70b45[_0x90df('0x3e')]['id']}})[_0x90df('0x25')](handleEntityNotFound(_0x599188,null))[_0x90df('0x25')](function(_0x206ac1){if(_0x206ac1){_0x22ba61=_0x206ac1;_0x4336cd['model']=_['keys'](db[_0x90df('0x47')]['rawAttributes']);_0x4336cd[_0x90df('0x2f')]=_[_0x90df('0x3f')](_0xd70b45['query']);_0x4336cd[_0x90df('0x38')]=_[_0x90df('0x31')](_0x4336cd[_0x90df('0x2d')],_0x4336cd['query']);_0x40311b[_0x90df('0x30')]=_[_0x90df('0x31')](_0x4336cd[_0x90df('0x2d')],qs['fields'](_0xd70b45[_0x90df('0x2f')]['fields']));_0x40311b[_0x90df('0x30')]=_0x40311b[_0x90df('0x30')][_0x90df('0x40')]?_0x40311b[_0x90df('0x30')]:_0x4336cd['model'];_0x40311b[_0x90df('0x35')]=qs[_0x90df('0x36')](_0xd70b45[_0x90df('0x2f')]['sort']);_0x40311b[_0x90df('0x37')]=qs[_0x90df('0x38')](_['pick'](_0xd70b45['query'],_0x4336cd[_0x90df('0x38')]));if(_0xd70b45[_0x90df('0x2f')][_0x90df('0x3a')]){_0x40311b['where']=_[_0x90df('0x39')](_0x40311b['where'],{'$or':_[_0x90df('0x2e')](_0x40311b[_0x90df('0x30')],function(_0x538320){var _0x501766={};_0x501766[_0x538320]={'$like':'%'+_0xd70b45[_0x90df('0x2f')]['filter']+'%'};return _0x501766;})});}_0x40311b=_[_0x90df('0x39')]({},_0x40311b,_0xd70b45['options']);return _0x22ba61['getSubjects'](_0x40311b);}})[_0x90df('0x25')](function(_0x21bcd1){if(_0x21bcd1){_0x105752=_0x21bcd1[_0x90df('0x40')];if(!_0xd70b45[_0x90df('0x2f')][_0x90df('0x33')]('nolimit')){_0x40311b[_0x90df('0x1e')]=qs[_0x90df('0x1e')](_0xd70b45[_0x90df('0x2f')][_0x90df('0x1e')]);_0x40311b[_0x90df('0x1d')]=qs[_0x90df('0x1d')](_0xd70b45[_0x90df('0x2f')][_0x90df('0x1d')]);}return _0x22ba61['getSubjects'](_0x40311b);}})[_0x90df('0x25')](function(_0x2f9eab){if(_0x2f9eab){return _0x2f9eab?{'count':_0x105752,'rows':_0x2f9eab}:null;}})[_0x90df('0x25')](respondWithResult(_0x599188,null))[_0x90df('0x42')](handleError(_0x599188,null));};exports['getDescriptions']=function(_0x3b1895,_0x26ac9a,_0x396946){var _0x45f1fc={};var _0x3be2f8={};var _0x16130e;var _0x2ab2a2;return db[_0x90df('0x3b')][_0x90df('0x4a')]({'where':{'id':_0x3b1895[_0x90df('0x3e')]['id']}})['then'](handleEntityNotFound(_0x26ac9a,null))[_0x90df('0x25')](function(_0x3320d3){if(_0x3320d3){_0x16130e=_0x3320d3;_0x3be2f8[_0x90df('0x2d')]=_[_0x90df('0x3f')](db[_0x90df('0x47')]['rawAttributes']);_0x3be2f8['query']=_[_0x90df('0x3f')](_0x3b1895[_0x90df('0x2f')]);_0x3be2f8[_0x90df('0x38')]=_['intersection'](_0x3be2f8[_0x90df('0x2d')],_0x3be2f8['query']);_0x45f1fc[_0x90df('0x30')]=_[_0x90df('0x31')](_0x3be2f8[_0x90df('0x2d')],qs[_0x90df('0x32')](_0x3b1895[_0x90df('0x2f')][_0x90df('0x32')]));_0x45f1fc[_0x90df('0x30')]=_0x45f1fc[_0x90df('0x30')][_0x90df('0x40')]?_0x45f1fc['attributes']:_0x3be2f8[_0x90df('0x2d')];_0x45f1fc[_0x90df('0x35')]=qs[_0x90df('0x36')](_0x3b1895[_0x90df('0x2f')]['sort']);_0x45f1fc[_0x90df('0x37')]=qs[_0x90df('0x38')](_[_0x90df('0x48')](_0x3b1895['query'],_0x3be2f8[_0x90df('0x38')]));if(_0x3b1895[_0x90df('0x2f')]['filter']){_0x45f1fc[_0x90df('0x37')]=_[_0x90df('0x39')](_0x45f1fc[_0x90df('0x37')],{'$or':_['map'](_0x45f1fc[_0x90df('0x30')],function(_0x5ab7e2){var _0x1bea6c={};_0x1bea6c[_0x5ab7e2]={'$like':'%'+_0x3b1895['query'][_0x90df('0x3a')]+'%'};return _0x1bea6c;})});}_0x45f1fc=_[_0x90df('0x39')]({},_0x45f1fc,_0x3b1895[_0x90df('0x4b')]);return _0x16130e['getDescriptions'](_0x45f1fc);}})[_0x90df('0x25')](function(_0x314dd7){if(_0x314dd7){_0x2ab2a2=_0x314dd7[_0x90df('0x40')];if(!_0x3b1895[_0x90df('0x2f')][_0x90df('0x33')]('nolimit')){_0x45f1fc[_0x90df('0x1e')]=qs['limit'](_0x3b1895[_0x90df('0x2f')][_0x90df('0x1e')]);_0x45f1fc[_0x90df('0x1d')]=qs[_0x90df('0x1d')](_0x3b1895[_0x90df('0x2f')][_0x90df('0x1d')]);}return _0x16130e[_0x90df('0x4c')](_0x45f1fc);}})[_0x90df('0x25')](function(_0x29c0cd){if(_0x29c0cd){return _0x29c0cd?{'count':_0x2ab2a2,'rows':_0x29c0cd}:null;}})[_0x90df('0x25')](respondWithResult(_0x26ac9a,null))[_0x90df('0x42')](handleError(_0x26ac9a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 9df15d0..8d78946 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 _0xdd2e=['VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define'];(function(_0x4f288e,_0x31286a){var _0x5087db=function(_0x1cbb9f){while(--_0x1cbb9f){_0x4f288e['push'](_0x4f288e['shift']());}};_0x5087db(++_0x31286a);}(_0xdd2e,0x9e));var _0xedd2=function(_0x5a9a13,_0x3f6cb5){_0x5a9a13=_0x5a9a13-0x0;var _0x26cc45=_0xdd2e[_0x5a9a13];return _0x26cc45;};'use strict';var _=require(_0xedd2('0x0'));var util=require('util');var logger=require(_0xedd2('0x1'))(_0xedd2('0x2'));var moment=require(_0xedd2('0x3'));var BPromise=require('bluebird');var rp=require(_0xedd2('0x4'));var fs=require('fs');var path=require(_0xedd2('0x5'));var rimraf=require(_0xedd2('0x6'));var config=require(_0xedd2('0x7'));var attributes=require(_0xedd2('0x8'));module[_0xedd2('0x9')]=function(_0xa1ea4d,_0x1b39be){return _0xa1ea4d[_0xedd2('0xa')](_0xedd2('0xb'),attributes,{'tableName':_0xedd2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00f1=['../../config/environment','define','VtigerConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00f1,0x107));var _0x100f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00f1[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x100f('0x0'));var logger=require(_0x100f('0x1'))(_0x100f('0x2'));var moment=require(_0x100f('0x3'));var BPromise=require(_0x100f('0x4'));var rp=require(_0x100f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x100f('0x6'));var config=require(_0x100f('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x3533d,_0x4a4d01){return _0x3533d[_0x100f('0x8')](_0x100f('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 8ab59cf..6677b35 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 _0xee0d=['../../config/utils','jayson/promise','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee0d,0xb0));var _0xdee0=function(_0x56df12,_0x1fd0e5){_0x56df12=_0x56df12-0x0;var _0xe9c3a2=_0xee0d[_0x56df12];return _0xe9c3a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdee0('0x0'));var BPromise=require(_0xdee0('0x1'));var rs=require(_0xdee0('0x2'));var fs=require('fs');var Redis=require(_0xdee0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdee0('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdee0('0x5'));var client=jayson['client'][_0xdee0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x51d231,_0x4fdf70,_0x52f01b){return new BPromise(function(_0x1751c1,_0x353597){return client['request'](_0x51d231,_0x52f01b)[_0xdee0('0x7')](function(_0x462d41){logger['info'](_0xdee0('0x8'),_0x4fdf70,_0xdee0('0x9'));logger[_0xdee0('0xa')](_0xdee0('0xb'),_0x4fdf70,_0xdee0('0x9'),JSON[_0xdee0('0xc')](_0x462d41));if(_0x462d41[_0xdee0('0xd')]){if(_0x462d41['error'][_0xdee0('0xe')]===0x1f4){logger[_0xdee0('0xd')](_0xdee0('0x8'),_0x4fdf70,_0x462d41[_0xdee0('0xd')][_0xdee0('0xf')]);return _0x353597(_0x462d41[_0xdee0('0xd')][_0xdee0('0xf')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x4fdf70,_0x462d41[_0xdee0('0xd')][_0xdee0('0xf')]);return _0x1751c1(_0x462d41['error'][_0xdee0('0xf')]);}else{logger['info'](_0xdee0('0x8'),_0x4fdf70,_0xdee0('0x9'));_0x1751c1(_0x462d41[_0xdee0('0x10')][_0xdee0('0xf')]);}})[_0xdee0('0x11')](function(_0x19c164){logger[_0xdee0('0xd')](_0xdee0('0x8'),_0x4fdf70,_0x19c164);_0x353597(_0x19c164);});});} \ No newline at end of file +var _0x1f83=['message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','jayson/promise','client','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x401cca,_0x8d5dfd){var _0x25eaf0=function(_0x5d5ba5){while(--_0x5d5ba5){_0x401cca['push'](_0x401cca['shift']());}};_0x25eaf0(++_0x8d5dfd);}(_0x1f83,0xb3));var _0x31f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f83[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x31f8('0x0'));var util=require(_0x31f8('0x1'));var moment=require(_0x31f8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31f8('0x3'))['db'];var utils=require(_0x31f8('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x31f8('0x5'));var client=jayson[_0x31f8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21f584,_0x315a07,_0x476af9){return new BPromise(function(_0x5e5f51,_0x48136e){return client['request'](_0x21f584,_0x476af9)[_0x31f8('0x7')](function(_0x18442b){logger[_0x31f8('0x8')](_0x31f8('0x9'),_0x315a07,_0x31f8('0xa'));logger['debug'](_0x31f8('0xb'),_0x315a07,_0x31f8('0xa'),JSON['stringify'](_0x18442b));if(_0x18442b[_0x31f8('0xc')]){if(_0x18442b[_0x31f8('0xc')]['code']===0x1f4){logger[_0x31f8('0xc')](_0x31f8('0x9'),_0x315a07,_0x18442b[_0x31f8('0xc')]['message']);return _0x48136e(_0x18442b[_0x31f8('0xc')]['message']);}logger[_0x31f8('0xc')](_0x31f8('0x9'),_0x315a07,_0x18442b[_0x31f8('0xc')][_0x31f8('0xd')]);return _0x5e5f51(_0x18442b['error'][_0x31f8('0xd')]);}else{logger[_0x31f8('0x8')]('VtigerConfiguration,\x20%s,\x20%s',_0x315a07,_0x31f8('0xa'));_0x5e5f51(_0x18442b[_0x31f8('0xe')][_0x31f8('0xd')]);}})[_0x31f8('0xf')](function(_0x1b09c6){logger[_0x31f8('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x315a07,_0x1b09c6);_0x48136e(_0x1b09c6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 89c1fa6..132ce48 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 _0xa48a=['Router','fs-extra','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa48a,0x74));var _0xaa48=function(_0x33f2ba,_0x2dfe6b){_0x33f2ba=_0x33f2ba-0x0;var _0x34a533=_0xa48a[_0x33f2ba];return _0x34a533;};'use strict';var multer=require(_0xaa48('0x0'));var util=require(_0xaa48('0x1'));var path=require(_0xaa48('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa48('0x3'));var router=express[_0xaa48('0x4')]();var fs_extra=require(_0xaa48('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaa48('0x6'));var controller=require(_0xaa48('0x7'));router[_0xaa48('0x8')]('/',auth[_0xaa48('0x9')](),controller[_0xaa48('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaa48('0xb')]);router[_0xaa48('0xc')]('/',auth['isAuthenticated'](),controller[_0xaa48('0xd')]);router[_0xaa48('0xe')]('/:id',auth[_0xaa48('0x9')](),controller[_0xaa48('0xf')]);router[_0xaa48('0x10')](_0xaa48('0x11'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x12')]);module[_0xaa48('0x13')]=router; \ No newline at end of file +var _0x5359=['show','post','create','put','destroy','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0x5246a1,_0x17e856){var _0x4583c3=function(_0x22cbd5){while(--_0x22cbd5){_0x5246a1['push'](_0x5246a1['shift']());}};_0x4583c3(++_0x17e856);}(_0x5359,0x1e5));var _0x9535=function(_0x16b7db,_0x305557){_0x16b7db=_0x16b7db-0x0;var _0x101f5f=_0x5359[_0x16b7db];return _0x101f5f;};'use strict';var multer=require(_0x9535('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9535('0x1'));var router=express['Router']();var fs_extra=require(_0x9535('0x2'));var auth=require(_0x9535('0x3'));var interaction=require(_0x9535('0x4'));var config=require('../../config/environment');var controller=require(_0x9535('0x5'));router[_0x9535('0x6')]('/',auth[_0x9535('0x7')](),controller[_0x9535('0x8')]);router['get'](_0x9535('0x9'),auth[_0x9535('0x7')](),controller[_0x9535('0xa')]);router[_0x9535('0xb')]('/',auth['isAuthenticated'](),controller[_0x9535('0xc')]);router[_0x9535('0xd')]('/:id',auth[_0x9535('0x7')](),controller['update']);router['delete'](_0x9535('0x9'),auth[_0x9535('0x7')](),controller[_0x9535('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2989aea..04124cc 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 _0x55bb=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x24ad5f,_0x4fcf81){var _0xabb54e=function(_0x3b4e86){while(--_0x3b4e86){_0x24ad5f['push'](_0x24ad5f['shift']());}};_0xabb54e(++_0x4fcf81);}(_0x55bb,0x1a4));var _0xb55b=function(_0x5912cd,_0x5cc626){_0x5912cd=_0x5912cd-0x0;var _0x357e80=_0x55bb[_0x5912cd];return _0x357e80;};'use strict';var Sequelize=require(_0xb55b('0x0'));module[_0xb55b('0x1')]={'type':{'type':Sequelize[_0xb55b('0x2')](_0xb55b('0x3'),_0xb55b('0x4'),_0xb55b('0x5'),_0xb55b('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xb55b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xb55b('0x3'),'variable',_0xb55b('0x5'))},'keyContent':{'type':Sequelize[_0xb55b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb55b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7765=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5d546b,_0x377cd2){var _0x4ac044=function(_0xc57c83){while(--_0xc57c83){_0x5d546b['push'](_0x5d546b['shift']());}};_0x4ac044(++_0x377cd2);}(_0x7765,0xc8));var _0x5776=function(_0x3a680b,_0x24d41b){_0x3a680b=_0x3a680b-0x0;var _0x2287dd=_0x7765[_0x3a680b];return _0x2287dd;};'use strict';var Sequelize=require(_0x5776('0x0'));module[_0x5776('0x1')]={'type':{'type':Sequelize[_0x5776('0x2')](_0x5776('0x3'),_0x5776('0x4'),_0x5776('0x5'),_0x5776('0x6'),_0x5776('0x7')),'defaultValue':_0x5776('0x3')},'content':{'type':Sequelize[_0x5776('0x8')]},'key':{'type':Sequelize[_0x5776('0x8')]},'keyType':{'type':Sequelize[_0x5776('0x2')](_0x5776('0x3'),_0x5776('0x4'),_0x5776('0x5'))},'keyContent':{'type':Sequelize[_0x5776('0x8')]},'idField':{'type':Sequelize[_0x5776('0x8')]},'nameField':{'type':Sequelize[_0x5776('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5776('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 7f5db88..5efc213 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 _0x4818=['index','map','rawAttributes','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','VtigerField','includeAll','include','findAll','rows','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x4818,0x145));var _0x8481=function(_0x10ef2c,_0x35bd6d){_0x10ef2c=_0x10ef2c-0x0;var _0x37ed40=_0x4818[_0x10ef2c];return _0x37ed40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8481('0x0'));var zipdir=require(_0x8481('0x1'));var jsonpatch=require(_0x8481('0x2'));var rp=require(_0x8481('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8481('0x4'));var util=require('util');var path=require(_0x8481('0x5'));var sox=require('sox');var csv=require(_0x8481('0x6'));var ejs=require(_0x8481('0x7'));var fs=require('fs');var fs_extra=require(_0x8481('0x8'));var _=require(_0x8481('0x9'));var squel=require(_0x8481('0xa'));var crypto=require(_0x8481('0xb'));var jsforce=require(_0x8481('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8481('0x6'));var querystring=require(_0x8481('0xd'));var Papa=require(_0x8481('0xe'));var Redis=require(_0x8481('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8481('0x10'));var as=require(_0x8481('0x11'));var hardwareService=require(_0x8481('0x12'));var logger=require('../../config/logger')(_0x8481('0x13'));var utils=require(_0x8481('0x14'));var config=require(_0x8481('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8481('0x16'))['db'];function respondWithStatusCode(_0x5148ef,_0x33baf6){_0x33baf6=_0x33baf6||0xcc;return function(_0x272c58){if(_0x272c58){return _0x5148ef[_0x8481('0x17')](_0x33baf6);}return _0x5148ef[_0x8481('0x18')](_0x33baf6)[_0x8481('0x19')]();};}function respondWithResult(_0x2313b7,_0x5590d5){_0x5590d5=_0x5590d5||0xc8;return function(_0x5f1a56){if(_0x5f1a56){return _0x2313b7[_0x8481('0x18')](_0x5590d5)[_0x8481('0x1a')](_0x5f1a56);}};}function respondWithFilteredResult(_0x553714,_0x1c22e6){return function(_0x4433cb){if(_0x4433cb){var _0x3dd10e=typeof _0x1c22e6[_0x8481('0x1b')]===_0x8481('0x1c')&&typeof _0x1c22e6[_0x8481('0x1d')]===_0x8481('0x1c');var _0x53fa95=_0x4433cb[_0x8481('0x1e')];var _0x15fe6a=_0x3dd10e?0x0:_0x1c22e6[_0x8481('0x1b')];var _0xd0a485=_0x3dd10e?_0x4433cb[_0x8481('0x1e')]:_0x1c22e6[_0x8481('0x1b')]+_0x1c22e6['limit'];var _0x47dc23;if(_0xd0a485>=_0x53fa95){_0xd0a485=_0x53fa95;_0x47dc23=0xc8;}else{_0x47dc23=0xce;}_0x553714['status'](_0x47dc23);return _0x553714[_0x8481('0x1f')]('Content-Range',_0x15fe6a+'-'+_0xd0a485+'/'+_0x53fa95)[_0x8481('0x1a')](_0x4433cb);}return null;};}function patchUpdates(_0x1c2336){return function(_0x373666){try{jsonpatch[_0x8481('0x20')](_0x373666,_0x1c2336,!![]);}catch(_0x38ba89){return BPromise[_0x8481('0x21')](_0x38ba89);}return _0x373666[_0x8481('0x22')]();};}function saveUpdates(_0xc6ac7a,_0x37f153){return function(_0xf549e9){if(_0xf549e9){return _0xf549e9[_0x8481('0x23')](_0xc6ac7a)['then'](function(_0xabb2a6){return _0xabb2a6;});}return null;};}function removeEntity(_0x4000ca,_0x35e9f7){return function(_0xc57762){if(_0xc57762){return _0xc57762[_0x8481('0x24')]()[_0x8481('0x25')](function(){_0x4000ca[_0x8481('0x18')](0xcc)[_0x8481('0x19')]();});}};}function handleEntityNotFound(_0x3fab49,_0x4cbad6){return function(_0xd4571d){if(!_0xd4571d){_0x3fab49[_0x8481('0x17')](0x194);}return _0xd4571d;};}function handleError(_0x520a8c,_0x5bb82e){_0x5bb82e=_0x5bb82e||0x1f4;return function(_0x2a2769){logger['error'](_0x2a2769['stack']);if(_0x2a2769[_0x8481('0x26')]){delete _0x2a2769[_0x8481('0x26')];}_0x520a8c['status'](_0x5bb82e)[_0x8481('0x27')](_0x2a2769);};}exports[_0x8481('0x28')]=function(_0x3812d0,_0x324ee0){var _0x5bc54e={},_0x5f0d58={},_0x1929a9={'count':0x0,'rows':[]};var _0xb978a8=_[_0x8481('0x29')](db['VtigerField'][_0x8481('0x2a')],function(_0x499259){return{'name':_0x499259['fieldName'],'type':_0x499259['type'][_0x8481('0x2b')]};});_0x5f0d58['model']=_[_0x8481('0x29')](_0xb978a8,'name');_0x5f0d58['query']=_[_0x8481('0x2c')](_0x3812d0[_0x8481('0x2d')]);_0x5f0d58[_0x8481('0x2e')]=_[_0x8481('0x2f')](_0x5f0d58['model'],_0x5f0d58[_0x8481('0x2d')]);_0x5bc54e[_0x8481('0x30')]=_['intersection'](_0x5f0d58['model'],qs['fields'](_0x3812d0['query'][_0x8481('0x31')]));_0x5bc54e['attributes']=_0x5bc54e[_0x8481('0x30')][_0x8481('0x32')]?_0x5bc54e[_0x8481('0x30')]:_0x5f0d58[_0x8481('0x33')];if(!_0x3812d0[_0x8481('0x2d')][_0x8481('0x34')](_0x8481('0x35'))){_0x5bc54e[_0x8481('0x1d')]=qs[_0x8481('0x1d')](_0x3812d0[_0x8481('0x2d')][_0x8481('0x1d')]);_0x5bc54e[_0x8481('0x1b')]=qs[_0x8481('0x1b')](_0x3812d0[_0x8481('0x2d')][_0x8481('0x1b')]);}_0x5bc54e[_0x8481('0x36')]=qs['sort'](_0x3812d0[_0x8481('0x2d')][_0x8481('0x37')]);_0x5bc54e[_0x8481('0x38')]=qs[_0x8481('0x2e')](_[_0x8481('0x39')](_0x3812d0[_0x8481('0x2d')],_0x5f0d58[_0x8481('0x2e')]),_0xb978a8);if(_0x3812d0['query']['filter']){_0x5bc54e[_0x8481('0x38')]=_['merge'](_0x5bc54e[_0x8481('0x38')],{'$or':_[_0x8481('0x29')](_0xb978a8,function(_0x36b9d8){if(_0x36b9d8[_0x8481('0x3a')]!==_0x8481('0x3b')){var _0x36f7fb={};_0x36f7fb[_0x36b9d8['name']]={'$like':'%'+_0x3812d0[_0x8481('0x2d')][_0x8481('0x3c')]+'%'};return _0x36f7fb;}})});}_0x5bc54e=_[_0x8481('0x3d')]({},_0x5bc54e,_0x3812d0[_0x8481('0x3e')]);var _0x3d0fdb={'where':_0x5bc54e[_0x8481('0x38')]};return db[_0x8481('0x3f')][_0x8481('0x1e')](_0x3d0fdb)['then'](function(_0x4b1ba0){_0x1929a9[_0x8481('0x1e')]=_0x4b1ba0;if(_0x3812d0['query'][_0x8481('0x40')]){_0x5bc54e[_0x8481('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0x8481('0x42')](_0x5bc54e);})[_0x8481('0x25')](function(_0x3a04c4){_0x1929a9[_0x8481('0x43')]=_0x3a04c4;return _0x1929a9;})[_0x8481('0x25')](respondWithFilteredResult(_0x324ee0,_0x5bc54e))['catch'](handleError(_0x324ee0,null));};exports['show']=function(_0x24884e,_0x5f3ba5){var _0xe7905a={'raw':!![],'where':{'id':_0x24884e[_0x8481('0x44')]['id']}},_0x21a730={};_0x21a730[_0x8481('0x33')]=_[_0x8481('0x2c')](db['VtigerField'][_0x8481('0x2a')]);_0x21a730[_0x8481('0x2d')]=_[_0x8481('0x2c')](_0x24884e[_0x8481('0x2d')]);_0x21a730[_0x8481('0x2e')]=_['intersection'](_0x21a730[_0x8481('0x33')],_0x21a730[_0x8481('0x2d')]);_0xe7905a[_0x8481('0x30')]=_['intersection'](_0x21a730[_0x8481('0x33')],qs[_0x8481('0x31')](_0x24884e['query']['fields']));_0xe7905a[_0x8481('0x30')]=_0xe7905a[_0x8481('0x30')][_0x8481('0x32')]?_0xe7905a[_0x8481('0x30')]:_0x21a730[_0x8481('0x33')];if(_0x24884e['query'][_0x8481('0x40')]){_0xe7905a[_0x8481('0x41')]=[{'all':!![]}];}_0xe7905a=_[_0x8481('0x3d')]({},_0xe7905a,_0x24884e[_0x8481('0x3e')]);return db[_0x8481('0x3f')][_0x8481('0x45')](_0xe7905a)['then'](handleEntityNotFound(_0x5f3ba5,null))[_0x8481('0x25')](respondWithResult(_0x5f3ba5,null))[_0x8481('0x46')](handleError(_0x5f3ba5,null));};exports[_0x8481('0x47')]=function(_0x5ad4fa,_0x50fce0){return db['VtigerField'][_0x8481('0x47')](_0x5ad4fa[_0x8481('0x48')],{})[_0x8481('0x25')](respondWithResult(_0x50fce0,0xc9))[_0x8481('0x46')](handleError(_0x50fce0,null));};exports[_0x8481('0x23')]=function(_0x439d31,_0x2e0435){if(_0x439d31[_0x8481('0x48')]['id']){delete _0x439d31['body']['id'];}return db[_0x8481('0x3f')][_0x8481('0x45')]({'where':{'id':_0x439d31['params']['id']}})[_0x8481('0x25')](handleEntityNotFound(_0x2e0435,null))[_0x8481('0x25')](saveUpdates(_0x439d31['body'],null))[_0x8481('0x25')](respondWithResult(_0x2e0435,null))[_0x8481('0x46')](handleError(_0x2e0435,null));};exports[_0x8481('0x24')]=function(_0x347ebf,_0x223bdf){return db['VtigerField'][_0x8481('0x45')]({'where':{'id':_0x347ebf['params']['id']}})[_0x8481('0x25')](handleEntityNotFound(_0x223bdf,null))[_0x8481('0x25')](removeEntity(_0x223bdf,null))['catch'](handleError(_0x223bdf,null));}; \ No newline at end of file +var _0x37c8=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VtigerField','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5a56e9,_0x4d2f90){var _0x3d463d=function(_0x5e624b){while(--_0x5e624b){_0x5a56e9['push'](_0x5a56e9['shift']());}};_0x3d463d(++_0x4d2f90);}(_0x37c8,0x114));var _0x837c=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0x37c8[_0x55c485];return _0x6bb521;};'use strict';var emlformat=require(_0x837c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x837c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x837c('0x2'));var BPromise=require(_0x837c('0x3'));var Mustache=require(_0x837c('0x4'));var util=require(_0x837c('0x5'));var path=require(_0x837c('0x6'));var sox=require(_0x837c('0x7'));var csv=require(_0x837c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x837c('0x9'));var squel=require('squel');var crypto=require(_0x837c('0xa'));var jsforce=require(_0x837c('0xb'));var deskjs=require(_0x837c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x837c('0xd'));var Papa=require(_0x837c('0xe'));var Redis=require('ioredis');var authService=require(_0x837c('0xf'));var qs=require(_0x837c('0x10'));var as=require(_0x837c('0x11'));var hardwareService=require(_0x837c('0x12'));var logger=require(_0x837c('0x13'))(_0x837c('0x14'));var utils=require(_0x837c('0x15'));var config=require(_0x837c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x837c('0x17'))['db'];function respondWithStatusCode(_0x17bbfc,_0x4940cd){_0x4940cd=_0x4940cd||0xcc;return function(_0x47e171){if(_0x47e171){return _0x17bbfc[_0x837c('0x18')](_0x4940cd);}return _0x17bbfc[_0x837c('0x19')](_0x4940cd)[_0x837c('0x1a')]();};}function respondWithResult(_0x157668,_0x4022a4){_0x4022a4=_0x4022a4||0xc8;return function(_0x2cee68){if(_0x2cee68){return _0x157668[_0x837c('0x19')](_0x4022a4)[_0x837c('0x1b')](_0x2cee68);}};}function respondWithFilteredResult(_0x25f37d,_0x13183d){return function(_0x15dcb5){if(_0x15dcb5){var _0x5103a1=typeof _0x13183d[_0x837c('0x1c')]===_0x837c('0x1d')&&typeof _0x13183d[_0x837c('0x1e')]===_0x837c('0x1d');var _0x52aa99=_0x15dcb5['count'];var _0x3f455c=_0x5103a1?0x0:_0x13183d['offset'];var _0xc6a71=_0x5103a1?_0x15dcb5[_0x837c('0x1f')]:_0x13183d[_0x837c('0x1c')]+_0x13183d[_0x837c('0x1e')];var _0x531c0f;if(_0xc6a71>=_0x52aa99){_0xc6a71=_0x52aa99;_0x531c0f=0xc8;}else{_0x531c0f=0xce;}_0x25f37d['status'](_0x531c0f);return _0x25f37d[_0x837c('0x20')](_0x837c('0x21'),_0x3f455c+'-'+_0xc6a71+'/'+_0x52aa99)[_0x837c('0x1b')](_0x15dcb5);}return null;};}function patchUpdates(_0x344dee){return function(_0x46d1ca){try{jsonpatch[_0x837c('0x22')](_0x46d1ca,_0x344dee,!![]);}catch(_0x59d76d){return BPromise[_0x837c('0x23')](_0x59d76d);}return _0x46d1ca[_0x837c('0x24')]();};}function saveUpdates(_0x1b469a,_0x2fb1c5){return function(_0x55227c){if(_0x55227c){return _0x55227c[_0x837c('0x25')](_0x1b469a)[_0x837c('0x26')](function(_0x4aafe0){return _0x4aafe0;});}return null;};}function removeEntity(_0x24299b,_0xed0363){return function(_0xb4fcd7){if(_0xb4fcd7){return _0xb4fcd7[_0x837c('0x27')]()[_0x837c('0x26')](function(){_0x24299b[_0x837c('0x19')](0xcc)[_0x837c('0x1a')]();});}};}function handleEntityNotFound(_0x3bbf5e,_0x42ba26){return function(_0x26840e){if(!_0x26840e){_0x3bbf5e['sendStatus'](0x194);}return _0x26840e;};}function handleError(_0x51720e,_0x578fd1){_0x578fd1=_0x578fd1||0x1f4;return function(_0x4545e9){logger[_0x837c('0x28')](_0x4545e9['stack']);if(_0x4545e9[_0x837c('0x29')]){delete _0x4545e9['name'];}_0x51720e['status'](_0x578fd1)[_0x837c('0x2a')](_0x4545e9);};}exports[_0x837c('0x2b')]=function(_0x43b1c6,_0x5356ec){var _0xa27c33={},_0x31b78d={},_0x58331a={'count':0x0,'rows':[]};var _0x532f8f=_[_0x837c('0x2c')](db[_0x837c('0x2d')][_0x837c('0x2e')],function(_0x3888e4){return{'name':_0x3888e4[_0x837c('0x2f')],'type':_0x3888e4['type'][_0x837c('0x30')]};});_0x31b78d['model']=_[_0x837c('0x2c')](_0x532f8f,_0x837c('0x29'));_0x31b78d[_0x837c('0x31')]=_[_0x837c('0x32')](_0x43b1c6[_0x837c('0x31')]);_0x31b78d[_0x837c('0x33')]=_[_0x837c('0x34')](_0x31b78d['model'],_0x31b78d['query']);_0xa27c33[_0x837c('0x35')]=_[_0x837c('0x34')](_0x31b78d[_0x837c('0x36')],qs[_0x837c('0x37')](_0x43b1c6[_0x837c('0x31')]['fields']));_0xa27c33[_0x837c('0x35')]=_0xa27c33[_0x837c('0x35')][_0x837c('0x38')]?_0xa27c33[_0x837c('0x35')]:_0x31b78d[_0x837c('0x36')];if(!_0x43b1c6['query'][_0x837c('0x39')](_0x837c('0x3a'))){_0xa27c33[_0x837c('0x1e')]=qs[_0x837c('0x1e')](_0x43b1c6[_0x837c('0x31')][_0x837c('0x1e')]);_0xa27c33['offset']=qs[_0x837c('0x1c')](_0x43b1c6['query'][_0x837c('0x1c')]);}_0xa27c33[_0x837c('0x3b')]=qs[_0x837c('0x3c')](_0x43b1c6['query'][_0x837c('0x3c')]);_0xa27c33['where']=qs[_0x837c('0x33')](_[_0x837c('0x3d')](_0x43b1c6['query'],_0x31b78d[_0x837c('0x33')]),_0x532f8f);if(_0x43b1c6[_0x837c('0x31')]['filter']){_0xa27c33['where']=_[_0x837c('0x3e')](_0xa27c33[_0x837c('0x3f')],{'$or':_['map'](_0x532f8f,function(_0x3798a0){if(_0x3798a0['type']!=='VIRTUAL'){var _0x1003c={};_0x1003c[_0x3798a0[_0x837c('0x29')]]={'$like':'%'+_0x43b1c6[_0x837c('0x31')]['filter']+'%'};return _0x1003c;}})});}_0xa27c33=_[_0x837c('0x3e')]({},_0xa27c33,_0x43b1c6[_0x837c('0x40')]);var _0x43511f={'where':_0xa27c33[_0x837c('0x3f')]};return db[_0x837c('0x2d')]['count'](_0x43511f)[_0x837c('0x26')](function(_0x46fb8e){_0x58331a[_0x837c('0x1f')]=_0x46fb8e;if(_0x43b1c6['query'][_0x837c('0x41')]){_0xa27c33[_0x837c('0x42')]=[{'all':!![]}];}return db[_0x837c('0x2d')][_0x837c('0x43')](_0xa27c33);})['then'](function(_0x25f7e9){_0x58331a['rows']=_0x25f7e9;return _0x58331a;})[_0x837c('0x26')](respondWithFilteredResult(_0x5356ec,_0xa27c33))[_0x837c('0x44')](handleError(_0x5356ec,null));};exports[_0x837c('0x45')]=function(_0x3d75fe,_0x237b61){var _0x28592c={'raw':!![],'where':{'id':_0x3d75fe[_0x837c('0x46')]['id']}},_0x317290={};_0x317290['model']=_[_0x837c('0x32')](db[_0x837c('0x2d')][_0x837c('0x2e')]);_0x317290[_0x837c('0x31')]=_['keys'](_0x3d75fe[_0x837c('0x31')]);_0x317290[_0x837c('0x33')]=_['intersection'](_0x317290['model'],_0x317290['query']);_0x28592c[_0x837c('0x35')]=_[_0x837c('0x34')](_0x317290['model'],qs[_0x837c('0x37')](_0x3d75fe[_0x837c('0x31')]['fields']));_0x28592c[_0x837c('0x35')]=_0x28592c[_0x837c('0x35')][_0x837c('0x38')]?_0x28592c['attributes']:_0x317290['model'];if(_0x3d75fe[_0x837c('0x31')][_0x837c('0x41')]){_0x28592c[_0x837c('0x42')]=[{'all':!![]}];}_0x28592c=_[_0x837c('0x3e')]({},_0x28592c,_0x3d75fe['options']);return db[_0x837c('0x2d')][_0x837c('0x47')](_0x28592c)[_0x837c('0x26')](handleEntityNotFound(_0x237b61,null))['then'](respondWithResult(_0x237b61,null))[_0x837c('0x44')](handleError(_0x237b61,null));};exports[_0x837c('0x48')]=function(_0x39fc92,_0x149720){return db[_0x837c('0x2d')][_0x837c('0x48')](_0x39fc92[_0x837c('0x49')],{})[_0x837c('0x26')](respondWithResult(_0x149720,0xc9))[_0x837c('0x44')](handleError(_0x149720,null));};exports['update']=function(_0x402dd0,_0x513e1b){if(_0x402dd0['body']['id']){delete _0x402dd0[_0x837c('0x49')]['id'];}return db['VtigerField'][_0x837c('0x47')]({'where':{'id':_0x402dd0[_0x837c('0x46')]['id']}})[_0x837c('0x26')](handleEntityNotFound(_0x513e1b,null))[_0x837c('0x26')](saveUpdates(_0x402dd0[_0x837c('0x49')],null))['then'](respondWithResult(_0x513e1b,null))[_0x837c('0x44')](handleError(_0x513e1b,null));};exports[_0x837c('0x27')]=function(_0x470f8d,_0x511df5){return db[_0x837c('0x2d')][_0x837c('0x47')]({'where':{'id':_0x470f8d['params']['id']}})['then'](handleEntityNotFound(_0x511df5,null))[_0x837c('0x26')](removeEntity(_0x511df5,null))[_0x837c('0x44')](handleError(_0x511df5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3081771..f16b8e8 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 _0x2d59=['int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./intVtigerField.attributes','define','VtigerField'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x2d59,0x1b6));var _0x92d5=function(_0x5dbbf4,_0xb191f7){_0x5dbbf4=_0x5dbbf4-0x0;var _0x2d67cb=_0x2d59[_0x5dbbf4];return _0x2d67cb;};'use strict';var _=require(_0x92d5('0x0'));var util=require(_0x92d5('0x1'));var logger=require(_0x92d5('0x2'))(_0x92d5('0x3'));var moment=require('moment');var BPromise=require(_0x92d5('0x4'));var rp=require(_0x92d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x92d5('0x7'));module['exports']=function(_0x210ccf,_0x3dbdac){return _0x210ccf[_0x92d5('0x8')](_0x92d5('0x9'),attributes,{'tableName':_0x92d5('0xa'),'paranoid':![],'indexes':[{'name':_0x92d5('0xb'),'fields':[_0x92d5('0xc'),_0x92d5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc617=['exports','VtigerField','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x1c2f21,_0x268cdd){var _0x48e6da=function(_0x967920){while(--_0x967920){_0x1c2f21['push'](_0x1c2f21['shift']());}};_0x48e6da(++_0x268cdd);}(_0xc617,0x9a));var _0x7c61=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0xc617[_0x20fdc1];return _0x25397c;};'use strict';var _=require('lodash');var util=require(_0x7c61('0x0'));var logger=require('../../config/logger')(_0x7c61('0x1'));var moment=require(_0x7c61('0x2'));var BPromise=require('bluebird');var rp=require(_0x7c61('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c61('0x4'));var config=require(_0x7c61('0x5'));var attributes=require('./intVtigerField.attributes');module[_0x7c61('0x6')]=function(_0x86982,_0x230882){return _0x86982['define'](_0x7c61('0x7'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index a08a370..41e0b0e 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 _0xbe34=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dd9c0,_0x5c6635){var _0x488ba0=function(_0x3f8861){while(--_0x3f8861){_0x2dd9c0['push'](_0x2dd9c0['shift']());}};_0x488ba0(++_0x5c6635);}(_0xbe34,0x191));var _0x4be3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbe34[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x4be3('0x0'));var moment=require(_0x4be3('0x1'));var BPromise=require(_0x4be3('0x2'));var rs=require(_0x4be3('0x3'));var fs=require('fs');var Redis=require(_0x4be3('0x4'));var db=require(_0x4be3('0x5'))['db'];var utils=require(_0x4be3('0x6'));var logger=require(_0x4be3('0x7'))(_0x4be3('0x8'));var config=require(_0x4be3('0x9'));var jayson=require(_0x4be3('0xa'));var client=jayson[_0x4be3('0xb')][_0x4be3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x375d2c,_0x3b578a,_0x1caab7){return new BPromise(function(_0x2fab76,_0x3c9d90){return client[_0x4be3('0xd')](_0x375d2c,_0x1caab7)[_0x4be3('0xe')](function(_0xbe6df7){logger['info'](_0x4be3('0xf'),_0x3b578a,_0x4be3('0x10'));logger[_0x4be3('0x11')](_0x4be3('0x12'),_0x3b578a,_0x4be3('0x10'),JSON[_0x4be3('0x13')](_0xbe6df7));if(_0xbe6df7[_0x4be3('0x14')]){if(_0xbe6df7[_0x4be3('0x14')][_0x4be3('0x15')]===0x1f4){logger[_0x4be3('0x14')](_0x4be3('0xf'),_0x3b578a,_0xbe6df7[_0x4be3('0x14')][_0x4be3('0x16')]);return _0x3c9d90(_0xbe6df7[_0x4be3('0x14')][_0x4be3('0x16')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x3b578a,_0xbe6df7[_0x4be3('0x14')][_0x4be3('0x16')]);return _0x2fab76(_0xbe6df7[_0x4be3('0x14')]['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x3b578a,_0x4be3('0x10'));_0x2fab76(_0xbe6df7['result'][_0x4be3('0x16')]);}})[_0x4be3('0x17')](function(_0xb8f2ed){logger[_0x4be3('0x14')](_0x4be3('0xf'),_0x3b578a,_0xb8f2ed);_0x3c9d90(_0xb8f2ed);});});} \ No newline at end of file +var _0xadca=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','request\x20sent','debug'];(function(_0x1702b8,_0x28c7da){var _0x50028a=function(_0x4135b1){while(--_0x4135b1){_0x1702b8['push'](_0x1702b8['shift']());}};_0x50028a(++_0x28c7da);}(_0xadca,0xfa));var _0xaadc=function(_0x3e451f,_0x10500d){_0x3e451f=_0x3e451f-0x0;var _0x57978f=_0xadca[_0x3e451f];return _0x57978f;};'use strict';var _=require(_0xaadc('0x0'));var util=require(_0xaadc('0x1'));var moment=require(_0xaadc('0x2'));var BPromise=require('bluebird');var rs=require(_0xaadc('0x3'));var fs=require('fs');var Redis=require(_0xaadc('0x4'));var db=require(_0xaadc('0x5'))['db'];var utils=require(_0xaadc('0x6'));var logger=require(_0xaadc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaadc('0x8')][_0xaadc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32b04d,_0x3d3e31,_0x1eaf82){return new BPromise(function(_0x43fcc2,_0x20fd62){return client[_0xaadc('0xa')](_0x32b04d,_0x1eaf82)[_0xaadc('0xb')](function(_0x498d81){logger['info']('VtigerField,\x20%s,\x20%s',_0x3d3e31,_0xaadc('0xc'));logger[_0xaadc('0xd')](_0xaadc('0xe'),_0x3d3e31,_0xaadc('0xc'),JSON[_0xaadc('0xf')](_0x498d81));if(_0x498d81[_0xaadc('0x10')]){if(_0x498d81[_0xaadc('0x10')]['code']===0x1f4){logger['error'](_0xaadc('0x11'),_0x3d3e31,_0x498d81['error'][_0xaadc('0x12')]);return _0x20fd62(_0x498d81['error'][_0xaadc('0x12')]);}logger[_0xaadc('0x10')](_0xaadc('0x11'),_0x3d3e31,_0x498d81[_0xaadc('0x10')][_0xaadc('0x12')]);return _0x43fcc2(_0x498d81[_0xaadc('0x10')][_0xaadc('0x12')]);}else{logger[_0xaadc('0x13')]('VtigerField,\x20%s,\x20%s',_0x3d3e31,_0xaadc('0xc'));_0x43fcc2(_0x498d81[_0xaadc('0x14')]['message']);}})[_0xaadc('0x15')](function(_0x562327){logger[_0xaadc('0x10')](_0xaadc('0x11'),_0x3d3e31,_0x562327);_0x20fd62(_0x562327);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 029e77f..9feda7c 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 _0x2304=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','get','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2304,0x192));var _0x4230=function(_0x3ed5e5,_0x32705b){_0x3ed5e5=_0x3ed5e5-0x0;var _0x4510bb=_0x2304[_0x3ed5e5];return _0x4510bb;};'use strict';var multer=require(_0x4230('0x0'));var util=require(_0x4230('0x1'));var path=require(_0x4230('0x2'));var timeout=require(_0x4230('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4230('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4230('0x5'));var controller=require('./intZendeskAccount.controller');router[_0x4230('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4230('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4230('0x7')]);router['get'](_0x4230('0x8'),auth['isAuthenticated'](),controller[_0x4230('0x9')]);router['get'](_0x4230('0xa'),auth[_0x4230('0xb')](),controller[_0x4230('0xc')]);router[_0x4230('0xd')]('/',auth['isAuthenticated'](),controller[_0x4230('0xe')]);router['post'](_0x4230('0x8'),auth['isAuthenticated'](),controller[_0x4230('0xf')]);router[_0x4230('0x10')](_0x4230('0x11'),auth[_0x4230('0xb')](),controller[_0x4230('0x12')]);router[_0x4230('0x13')](_0x4230('0x11'),auth[_0x4230('0xb')](),controller[_0x4230('0x14')]);module[_0x4230('0x15')]=router; \ No newline at end of file +var _0xaaaf=['get','isAuthenticated','index','getConfigurations','getFields','post','create','put','/:id','update','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x160c42,_0x383a96){var _0xcc4c25=function(_0x6e66fd){while(--_0x6e66fd){_0x160c42['push'](_0x160c42['shift']());}};_0xcc4c25(++_0x383a96);}(_0xaaaf,0x108));var _0xfaaa=function(_0x1bfebb,_0x3f2d72){_0x1bfebb=_0x1bfebb-0x0;var _0x29f205=_0xaaaf[_0x1bfebb];return _0x29f205;};'use strict';var multer=require('multer');var util=require(_0xfaaa('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfaaa('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xfaaa('0x2'));var interaction=require(_0xfaaa('0x3'));var config=require(_0xfaaa('0x4'));var controller=require(_0xfaaa('0x5'));router[_0xfaaa('0x6')]('/',auth[_0xfaaa('0x7')](),controller[_0xfaaa('0x8')]);router[_0xfaaa('0x6')]('/:id',auth[_0xfaaa('0x7')](),controller['show']);router[_0xfaaa('0x6')]('/:id/configurations',auth[_0xfaaa('0x7')](),controller[_0xfaaa('0x9')]);router['get']('/:id/fields',auth[_0xfaaa('0x7')](),controller[_0xfaaa('0xa')]);router[_0xfaaa('0xb')]('/',auth[_0xfaaa('0x7')](),controller[_0xfaaa('0xc')]);router[_0xfaaa('0xb')]('/:id/configurations',auth[_0xfaaa('0x7')](),controller['addConfiguration']);router[_0xfaaa('0xd')](_0xfaaa('0xe'),auth[_0xfaaa('0x7')](),controller[_0xfaaa('0xf')]);router['delete'](_0xfaaa('0xe'),auth[_0xfaaa('0x7')](),controller[_0xfaaa('0x10')]);module[_0xfaaa('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 532fed0..dfb325c 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 _0x1298=['exports','STRING','username','remoteUri','password','token','ENUM','integrationTab','newTab'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x1298,0x19e));var _0x8129=function(_0x47846d,_0x4b674f){_0x47846d=_0x47846d-0x0;var _0x6121f7=_0x1298[_0x47846d];return _0x6121f7;};'use strict';var Sequelize=require('sequelize');module[_0x8129('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8129('0x1')]},'username':{'type':Sequelize[_0x8129('0x1')],'unique':_0x8129('0x2')},'password':{'type':Sequelize[_0x8129('0x1')]},'token':{'type':Sequelize[_0x8129('0x1')]},'remoteUri':{'type':Sequelize[_0x8129('0x1')],'unique':_0x8129('0x3')},'authType':{'type':Sequelize['ENUM'](_0x8129('0x4'),_0x8129('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8129('0x6')](_0x8129('0x7'),_0x8129('0x8')),'defaultValue':_0x8129('0x7')}}; \ No newline at end of file +var _0xaf5a=['username','ENUM','password','token','integrationTab','newTab','exports','STRING'];(function(_0x34fa62,_0xe0e02f){var _0x19cf42=function(_0x28779a){while(--_0x28779a){_0x34fa62['push'](_0x34fa62['shift']());}};_0x19cf42(++_0xe0e02f);}(_0xaf5a,0x116));var _0xaaf5=function(_0x5b3b6a,_0x906f49){_0x5b3b6a=_0x5b3b6a-0x0;var _0x4a9af7=_0xaf5a[_0x5b3b6a];return _0x4a9af7;};'use strict';var Sequelize=require('sequelize');module[_0xaaf5('0x0')]={'name':{'type':Sequelize[_0xaaf5('0x1')]},'description':{'type':Sequelize[_0xaaf5('0x1')]},'username':{'type':Sequelize[_0xaaf5('0x1')],'unique':_0xaaf5('0x2')},'password':{'type':Sequelize[_0xaaf5('0x1')]},'token':{'type':Sequelize[_0xaaf5('0x1')]},'remoteUri':{'type':Sequelize[_0xaaf5('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xaaf5('0x3')](_0xaaf5('0x4'),_0xaaf5('0x5')),'defaultValue':_0xaaf5('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xaaf5('0x6'),_0xaaf5('0x7')),'defaultValue':_0xaaf5('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index d271980..3fd34a0 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 _0x5423=['Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','ZendeskConfiguration','nolimit','findOne','AccountId','getSubjects','channel','type','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','ticket_fields','headers','Basic\x20%s','format','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x5423,0xe3));var _0x3542=function(_0x41e32d,_0x2e4342){_0x41e32d=_0x41e32d-0x0;var _0x471ede=_0x5423[_0x41e32d];return _0x471ede;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];var integrations=require(_0x3542('0x18'));function respondWithStatusCode(_0x43e977,_0x4ee86){_0x4ee86=_0x4ee86||0xcc;return function(_0x1a9062){if(_0x1a9062){return _0x43e977[_0x3542('0x19')](_0x4ee86);}return _0x43e977[_0x3542('0x1a')](_0x4ee86)[_0x3542('0x1b')]();};}function respondWithResult(_0x4bac5b,_0x14fe57){_0x14fe57=_0x14fe57||0xc8;return function(_0x4fb366){if(_0x4fb366){return _0x4bac5b[_0x3542('0x1a')](_0x14fe57)[_0x3542('0x1c')](_0x4fb366);}};}function respondWithFilteredResult(_0xc33d42,_0x546fbd){return function(_0x270312){if(_0x270312){var _0x177fb9=typeof _0x546fbd[_0x3542('0x1d')]==='undefined'&&typeof _0x546fbd[_0x3542('0x1e')]===_0x3542('0x1f');var _0x116859=_0x270312[_0x3542('0x20')];var _0x493d95=_0x177fb9?0x0:_0x546fbd[_0x3542('0x1d')];var _0x53d4aa=_0x177fb9?_0x270312[_0x3542('0x20')]:_0x546fbd[_0x3542('0x1d')]+_0x546fbd['limit'];var _0x1c6403;if(_0x53d4aa>=_0x116859){_0x53d4aa=_0x116859;_0x1c6403=0xc8;}else{_0x1c6403=0xce;}_0xc33d42[_0x3542('0x1a')](_0x1c6403);return _0xc33d42[_0x3542('0x21')](_0x3542('0x22'),_0x493d95+'-'+_0x53d4aa+'/'+_0x116859)[_0x3542('0x1c')](_0x270312);}return null;};}function patchUpdates(_0x4a7695){return function(_0x4a74b0){try{jsonpatch['apply'](_0x4a74b0,_0x4a7695,!![]);}catch(_0x17e3cf){return BPromise['reject'](_0x17e3cf);}return _0x4a74b0[_0x3542('0x23')]();};}function saveUpdates(_0x551645,_0x1d5f1e){return function(_0x55774d){if(_0x55774d){return _0x55774d['update'](_0x551645)[_0x3542('0x24')](function(_0xe3f983){return _0xe3f983;});}return null;};}function removeEntity(_0x5ae097,_0x5d05b2){return function(_0x3fc964){if(_0x3fc964){return _0x3fc964['destroy']()[_0x3542('0x24')](function(){_0x5ae097[_0x3542('0x1a')](0xcc)[_0x3542('0x1b')]();});}};}function handleEntityNotFound(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(!_0xf1f7d0){_0x2f2e63[_0x3542('0x19')](0x194);}return _0xf1f7d0;};}function handleError(_0x1e156e,_0x18dc6c){_0x18dc6c=_0x18dc6c||0x1f4;return function(_0x2841a1){logger[_0x3542('0x25')](_0x2841a1[_0x3542('0x26')]);if(_0x2841a1[_0x3542('0x27')]){delete _0x2841a1[_0x3542('0x27')];}_0x1e156e[_0x3542('0x1a')](_0x18dc6c)[_0x3542('0x28')](_0x2841a1);};}exports[_0x3542('0x29')]=function(_0x20eda1,_0x3bd666){var _0x5590a2={},_0x31ad47={},_0x35bbc9={'count':0x0,'rows':[]};var _0x2aec76=_['map'](db[_0x3542('0x2a')][_0x3542('0x2b')],function(_0x2e883a){return{'name':_0x2e883a[_0x3542('0x2c')],'type':_0x2e883a['type']['key']};});_0x31ad47[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x2aec76,_0x3542('0x27'));_0x31ad47[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x20eda1[_0x3542('0x2f')]);_0x31ad47[_0x3542('0x31')]=_['intersection'](_0x31ad47['model'],_0x31ad47[_0x3542('0x2f')]);_0x5590a2['attributes']=_['intersection'](_0x31ad47[_0x3542('0x2d')],qs['fields'](_0x20eda1['query'][_0x3542('0x32')]));_0x5590a2[_0x3542('0x33')]=_0x5590a2[_0x3542('0x33')]['length']?_0x5590a2[_0x3542('0x33')]:_0x31ad47['model'];if(!_0x20eda1[_0x3542('0x2f')][_0x3542('0x34')]('nolimit')){_0x5590a2[_0x3542('0x1e')]=qs['limit'](_0x20eda1[_0x3542('0x2f')][_0x3542('0x1e')]);_0x5590a2[_0x3542('0x1d')]=qs['offset'](_0x20eda1[_0x3542('0x2f')]['offset']);}_0x5590a2[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x20eda1[_0x3542('0x2f')][_0x3542('0x36')]);_0x5590a2[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x20eda1[_0x3542('0x2f')],_0x31ad47[_0x3542('0x31')]),_0x2aec76);if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]){_0x5590a2[_0x3542('0x37')]=_[_0x3542('0x3a')](_0x5590a2['where'],{'$or':_[_0x3542('0x2e')](_0x2aec76,function(_0x4a80ea){if(_0x4a80ea['type']!==_0x3542('0x3b')){var _0x3ffccc={};_0x3ffccc[_0x4a80ea[_0x3542('0x27')]]={'$like':'%'+_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x3ffccc;}})});}_0x5590a2=_[_0x3542('0x3a')]({},_0x5590a2,_0x20eda1[_0x3542('0x3c')]);var _0x42e87a={'where':_0x5590a2['where']};return db[_0x3542('0x2a')]['count'](_0x42e87a)[_0x3542('0x24')](function(_0x2baa01){_0x35bbc9['count']=_0x2baa01;if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x3d')]){_0x5590a2['include']=[{'all':!![]}];}return db[_0x3542('0x2a')][_0x3542('0x3e')](_0x5590a2);})['then'](function(_0x2682d0){_0x35bbc9[_0x3542('0x3f')]=_0x2682d0;return _0x35bbc9;})[_0x3542('0x24')](respondWithFilteredResult(_0x3bd666,_0x5590a2))[_0x3542('0x40')](handleError(_0x3bd666,null));};exports[_0x3542('0x41')]=function(_0xb12441,_0x2b54b9){var _0x4bf45a={'raw':![],'where':{'id':_0xb12441[_0x3542('0x42')]['id']}},_0x542e0c={};_0x542e0c[_0x3542('0x2d')]=_[_0x3542('0x30')](db[_0x3542('0x2a')][_0x3542('0x2b')]);_0x542e0c['query']=_[_0x3542('0x30')](_0xb12441['query']);_0x542e0c[_0x3542('0x31')]=_[_0x3542('0x43')](_0x542e0c[_0x3542('0x2d')],_0x542e0c['query']);_0x4bf45a[_0x3542('0x33')]=_[_0x3542('0x43')](_0x542e0c['model'],qs[_0x3542('0x32')](_0xb12441[_0x3542('0x2f')][_0x3542('0x32')]));_0x4bf45a[_0x3542('0x33')]=_0x4bf45a[_0x3542('0x33')][_0x3542('0x44')]?_0x4bf45a[_0x3542('0x33')]:_0x542e0c[_0x3542('0x2d')];if(_0xb12441['query']['includeAll']){_0x4bf45a['include']=[{'all':!![]}];}_0x4bf45a=_[_0x3542('0x3a')]({},_0x4bf45a,_0xb12441[_0x3542('0x3c')]);return db[_0x3542('0x2a')][_0x3542('0x45')](_0x4bf45a)[_0x3542('0x24')](handleEntityNotFound(_0x2b54b9,null))[_0x3542('0x24')](respondWithResult(_0x2b54b9,null))[_0x3542('0x40')](handleError(_0x2b54b9,null));};exports['create']=function(_0x157683,_0x14b960){return db[_0x3542('0x2a')][_0x3542('0x46')](_0x157683['body'],{})[_0x3542('0x24')](respondWithResult(_0x14b960,0xc9))[_0x3542('0x40')](handleError(_0x14b960,null));};exports['update']=function(_0x528f8c,_0x1fb253){if(_0x528f8c[_0x3542('0x47')]['id']){delete _0x528f8c[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x528f8c[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x1fb253,null))['then'](saveUpdates(_0x528f8c[_0x3542('0x47')],null))[_0x3542('0x24')](respondWithResult(_0x1fb253,null))[_0x3542('0x40')](handleError(_0x1fb253,null));};exports[_0x3542('0x48')]=function(_0x1ebc82,_0x28be34){return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x1ebc82[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x28be34,null))['then'](removeEntity(_0x28be34,null))[_0x3542('0x40')](handleError(_0x28be34,null));};exports['getConfigurations']=function(_0x5a798a,_0x572e7a,_0x286222){var _0xd5c5c3={};var _0x381885={};var _0x48cfc4;var _0x2db495;return db[_0x3542('0x2a')]['findOne']({'where':{'id':_0x5a798a[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x572e7a,null))[_0x3542('0x24')](function(_0x196c59){if(_0x196c59){_0x48cfc4=_0x196c59;_0x381885[_0x3542('0x2d')]=_['keys'](db[_0x3542('0x49')][_0x3542('0x2b')]);_0x381885[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5a798a[_0x3542('0x2f')]);_0x381885['filters']=_['intersection'](_0x381885[_0x3542('0x2d')],_0x381885[_0x3542('0x2f')]);_0xd5c5c3[_0x3542('0x33')]=_['intersection'](_0x381885[_0x3542('0x2d')],qs[_0x3542('0x32')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x32')]));_0xd5c5c3[_0x3542('0x33')]=_0xd5c5c3['attributes']['length']?_0xd5c5c3[_0x3542('0x33')]:_0x381885['model'];_0xd5c5c3[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x5a798a['query'][_0x3542('0x36')]);_0xd5c5c3[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x5a798a[_0x3542('0x2f')],_0x381885['filters']));if(_0x5a798a['query'][_0x3542('0x39')]){_0xd5c5c3['where']=_[_0x3542('0x3a')](_0xd5c5c3[_0x3542('0x37')],{'$or':_[_0x3542('0x2e')](_0xd5c5c3['attributes'],function(_0xd9c90c){var _0x1f8ddb={};_0x1f8ddb[_0xd9c90c]={'$like':'%'+_0x5a798a[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x1f8ddb;})});}_0xd5c5c3=_[_0x3542('0x3a')]({},_0xd5c5c3,_0x5a798a[_0x3542('0x3c')]);return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})[_0x3542('0x24')](function(_0x3ee446){if(_0x3ee446){_0x2db495=_0x3ee446[_0x3542('0x44')];if(!_0x5a798a[_0x3542('0x2f')][_0x3542('0x34')](_0x3542('0x4a'))){_0xd5c5c3['limit']=qs[_0x3542('0x1e')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1e')]);_0xd5c5c3[_0x3542('0x1d')]=qs['offset'](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1d')]);}return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})['then'](function(_0x2908e5){if(_0x2908e5){return _0x2908e5?{'count':_0x2db495,'rows':_0x2908e5}:null;}})['then'](respondWithResult(_0x572e7a,null))[_0x3542('0x40')](handleError(_0x572e7a,null));};exports['addConfiguration']=function(_0x484204,_0x42a34a,_0x471408){if(_0x484204[_0x3542('0x47')]['id']){delete _0x484204[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x4b')]({'where':{'id':_0x484204[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a34a,null))[_0x3542('0x24')](function(_0xf1cf57){if(_0xf1cf57){_0x484204[_0x3542('0x47')][_0x3542('0x4c')]=_0xf1cf57['id'];_0x484204[_0x3542('0x47')]['Subjects']=integrations[_0x3542('0x4d')](_0x484204[_0x3542('0x47')][_0x3542('0x4e')],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);_0x484204[_0x3542('0x47')][_0x3542('0x50')]=integrations['getDescriptions'](_0x484204[_0x3542('0x47')]['channel'],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);return db[_0x3542('0x49')][_0x3542('0x46')](_0x484204['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x3542('0x51')],'as':_0x3542('0x50')}]});}return null;})[_0x3542('0x24')](respondWithResult(_0x42a34a,null))[_0x3542('0x40')](handleError(_0x42a34a,null));};exports[_0x3542('0x52')]=function(_0x2afc71,_0x3c84fa,_0x77f0af){var _0x2b0de0='';return db['ZendeskAccount'][_0x3542('0x4b')]({'where':{'id':_0x2afc71[_0x3542('0x42')]['id']},'attributes':['id',_0x3542('0x53'),_0x3542('0x54'),_0x3542('0x55'),'authType','remoteUri']})[_0x3542('0x24')](handleEntityNotFound(_0x3c84fa,null))[_0x3542('0x24')](function(_0x52c26d){if(_0x52c26d){_0x2b0de0=_0x52c26d[_0x3542('0x56')];var _0x4b5327=_0x2b0de0[_0x3542('0x57')](-0x1);if(_0x4b5327==='/'){_0x2b0de0=_0x2b0de0['substring'](0x0,_0x2b0de0[_0x3542('0x58')](_0x4b5327));}var _0x153e1b={'method':'GET','uri':util['format']('%s/%s',_0x2b0de0,_0x3542('0x59')),'json':!![]};switch(_0x52c26d['authType']){case _0x3542('0x54'):_0x153e1b[_0x3542('0x5a')]={'Authorization':util['format'](_0x3542('0x5b'),new Buffer(util[_0x3542('0x5c')](_0x3542('0x5d'),_0x52c26d['username'],_0x52c26d[_0x3542('0x54')]))['toString'](_0x3542('0x5e')))};break;case'token':_0x153e1b[_0x3542('0x5a')]={'Authorization':util[_0x3542('0x5c')](_0x3542('0x5b'),new Buffer(util['format'](_0x3542('0x5f'),_0x52c26d[_0x3542('0x53')],_0x52c26d[_0x3542('0x55')]))[_0x3542('0x60')]('base64'))};break;default:throw new db['Sequelize'][(_0x3542('0x61'))](_0x3542('0x62'));}return rp(_0x153e1b);}})[_0x3542('0x24')](function(_0xaa97d5){if(_0xaa97d5){var _0x191fdd=[_0x3542('0x63'),_0x3542('0x64'),_0x3542('0x65'),_0x3542('0x66')];_[_0x3542('0x67')](_0xaa97d5[_0x3542('0x59')],function(_0x1c318c){return _0x191fdd[_0x3542('0x68')](_0x1c318c[_0x3542('0x4f')]);});return{'count':_0xaa97d5[_0x3542('0x59')][_0x3542('0x44')],'rows':_[_0x3542('0x2e')](_0xaa97d5[_0x3542('0x59')],function(_0x4e04b6){return{'id':_0x4e04b6['id'],'name':_0x4e04b6[_0x3542('0x69')]>0x7?_0x4e04b6[_0x3542('0x6a')]:_0x4e04b6['type'],'custom':_0x4e04b6['position']>0x7?!![]:![],'options':_0x4e04b6[_0x3542('0x6b')]?_0x4e04b6[_0x3542('0x6b')]:_0x4e04b6[_0x3542('0x6c')]?_0x4e04b6[_0x3542('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3c84fa,null))[_0x3542('0x40')](function(_0x2d17ce){var _0x54e723=_0x2afc71[_0x3542('0x2f')]['test']?0x1f4:_0x2d17ce[_0x3542('0x6d')]||0x1f4;logger['error'](_0x3542('0x6e'),_0x3542('0x52'),_0x54e723,JSON[_0x3542('0x6f')](_0x2d17ce));delete _0x2d17ce[_0x3542('0x27')];if(_0x54e723===0x191){_0x54e723=0x190;}_0x3c84fa[_0x3542('0x1a')](_0x54e723)[_0x3542('0x28')](_0x2afc71[_0x3542('0x2f')]['test']?{'message':_0x3542('0x70'),'statusCode':_0x2d17ce['statusCode']}:_0x2d17ce);});}; \ 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f8c,0x104));var _0xc3f8=function(_0x2f14b6,_0xa0b328){_0x2f14b6=_0x2f14b6-0x0;var _0x1b42e2=_0x3f8c[_0x2f14b6];return _0x1b42e2;};'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 cc2a9cc..800f050 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 _0x7e30=['exports','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7e30,0xc5));var _0x07e3=function(_0x3f8a65,_0x405747){_0x3f8a65=_0x3f8a65-0x0;var _0x558655=_0x7e30[_0x3f8a65];return _0x558655;};'use strict';var _=require(_0x07e3('0x0'));var util=require(_0x07e3('0x1'));var logger=require(_0x07e3('0x2'))(_0x07e3('0x3'));var moment=require(_0x07e3('0x4'));var BPromise=require(_0x07e3('0x5'));var rp=require(_0x07e3('0x6'));var fs=require('fs');var path=require(_0x07e3('0x7'));var rimraf=require('rimraf');var config=require(_0x07e3('0x8'));var attributes=require(_0x07e3('0x9'));var integrations=require(_0x07e3('0xa'));module[_0x07e3('0xb')]=function(_0x54b806,_0x39f932){return _0x54b806['define']('ZendeskAccount',attributes,{'tableName':_0x07e3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b64=['int_zendesk_accounts','util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount'];(function(_0x4b93fe,_0x1ce6e2){var _0x4af931=function(_0x11c943){while(--_0x11c943){_0x4b93fe['push'](_0x4b93fe['shift']());}};_0x4af931(++_0x1ce6e2);}(_0x4b64,0x1e1));var _0x44b6=function(_0x3a3a31,_0x3a6ac7){_0x3a3a31=_0x3a3a31-0x0;var _0x4e7062=_0x4b64[_0x3a3a31];return _0x4e7062;};'use strict';var _=require('lodash');var util=require(_0x44b6('0x0'));var logger=require('../../config/logger')(_0x44b6('0x1'));var moment=require(_0x44b6('0x2'));var BPromise=require(_0x44b6('0x3'));var rp=require(_0x44b6('0x4'));var fs=require('fs');var path=require(_0x44b6('0x5'));var rimraf=require(_0x44b6('0x6'));var config=require('../../config/environment');var attributes=require(_0x44b6('0x7'));var integrations=require(_0x44b6('0x8'));module[_0x44b6('0x9')]=function(_0x16f2e2,_0xa5655){return _0x16f2e2['define'](_0x44b6('0xa'),attributes,{'tableName':_0x44b6('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 9ffadae..58852b0 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 _0xc254=['code','ZendeskAccount,\x20%s,\x20%s','error','message','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','include','map','model','ShowZendeskAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xc254,0x1ed));var _0x4c25=function(_0x31a8eb,_0x3ceefb){_0x31a8eb=_0x31a8eb-0x0;var _0x81004b=_0xc254[_0x31a8eb];return _0x81004b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c25('0x0'));var BPromise=require(_0x4c25('0x1'));var rs=require(_0x4c25('0x2'));var fs=require('fs');var Redis=require(_0x4c25('0x3'));var db=require(_0x4c25('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4c25('0x5'));var config=require(_0x4c25('0x6'));var jayson=require(_0x4c25('0x7'));var client=jayson[_0x4c25('0x8')][_0x4c25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ec8e5,_0x3be779,_0x556c92){return new BPromise(function(_0x2360c0,_0xff9f5b){return client[_0x4c25('0xa')](_0x3ec8e5,_0x556c92)[_0x4c25('0xb')](function(_0x108ef4){logger[_0x4c25('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x3be779,_0x4c25('0xd'));logger[_0x4c25('0xe')](_0x4c25('0xf'),_0x3be779,_0x4c25('0xd'),JSON[_0x4c25('0x10')](_0x108ef4));if(_0x108ef4['error']){if(_0x108ef4['error'][_0x4c25('0x11')]===0x1f4){logger['error'](_0x4c25('0x12'),_0x3be779,_0x108ef4[_0x4c25('0x13')]['message']);return _0xff9f5b(_0x108ef4[_0x4c25('0x13')]['message']);}logger[_0x4c25('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x3be779,_0x108ef4[_0x4c25('0x13')][_0x4c25('0x14')]);return _0x2360c0(_0x108ef4[_0x4c25('0x13')][_0x4c25('0x14')]);}else{logger[_0x4c25('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x3be779,_0x4c25('0xd'));_0x2360c0(_0x108ef4[_0x4c25('0x15')][_0x4c25('0x14')]);}})[_0x4c25('0x16')](function(_0x234735){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3be779,_0x234735);_0xff9f5b(_0x234735);});});}exports[_0x4c25('0x17')]=function(_0x9b96ca){var _0xd1a8ba=this;return new Promise(function(_0x137143,_0x39e7e1){return db[_0x4c25('0x18')]['findAll']({'raw':_0x9b96ca['options']?_0x9b96ca[_0x4c25('0x19')][_0x4c25('0x1a')]===undefined?!![]:![]:!![],'where':_0x9b96ca['options']?_0x9b96ca[_0x4c25('0x19')][_0x4c25('0x1b')]||null:null,'attributes':_0x9b96ca[_0x4c25('0x19')]?_0x9b96ca[_0x4c25('0x19')][_0x4c25('0x1c')]||null:null,'limit':_0x9b96ca[_0x4c25('0x19')]?_0x9b96ca['options']['limit']||null:null,'include':_0x9b96ca[_0x4c25('0x19')]?_0x9b96ca['options'][_0x4c25('0x1d')]?_[_0x4c25('0x1e')](_0x9b96ca['options'][_0x4c25('0x1d')],function(_0x52bc21){return{'model':db[_0x52bc21['model']],'as':_0x52bc21['as'],'attributes':_0x52bc21[_0x4c25('0x1c')],'include':_0x52bc21[_0x4c25('0x1d')]?_[_0x4c25('0x1e')](_0x52bc21[_0x4c25('0x1d')],function(_0x807bf7){return{'model':db[_0x807bf7[_0x4c25('0x1f')]],'as':_0x807bf7['as'],'attributes':_0x807bf7[_0x4c25('0x1c')],'include':_0x807bf7[_0x4c25('0x1d')]?_['map'](_0x807bf7[_0x4c25('0x1d')],function(_0x42e8cb){return{'model':db[_0x42e8cb[_0x4c25('0x1f')]],'as':_0x42e8cb['as'],'attributes':_0x42e8cb[_0x4c25('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a3454){logger[_0x4c25('0xc')]('GetZendeskAccount',_0x9b96ca);logger[_0x4c25('0xe')](_0x4c25('0x17'),_0x9b96ca,JSON[_0x4c25('0x10')](_0x3a3454));_0x137143(_0x3a3454);})[_0x4c25('0x16')](function(_0x1448f){logger['error'](_0x4c25('0x17'),_0x1448f[_0x4c25('0x14')],_0x9b96ca);_0x39e7e1(_0xd1a8ba[_0x4c25('0x13')](0x1f4,_0x1448f[_0x4c25('0x14')]));});});};exports[_0x4c25('0x20')]=function(_0xcd6933){var _0xdd32af=this;return new Promise(function(_0x15df0c,_0x10bd9c){return db['ZendeskAccount'][_0x4c25('0x21')]({'raw':_0xcd6933[_0x4c25('0x19')]?_0xcd6933[_0x4c25('0x19')][_0x4c25('0x1a')]===undefined?!![]:![]:!![],'where':_0xcd6933[_0x4c25('0x19')]?_0xcd6933['options']['where']||null:null,'attributes':_0xcd6933[_0x4c25('0x19')]?_0xcd6933[_0x4c25('0x19')][_0x4c25('0x1c')]||null:null,'include':_0xcd6933['options']?_0xcd6933['options']['include']?_[_0x4c25('0x1e')](_0xcd6933['options'][_0x4c25('0x1d')],function(_0x57c47e){return{'model':db[_0x57c47e[_0x4c25('0x1f')]],'as':_0x57c47e['as'],'attributes':_0x57c47e[_0x4c25('0x1c')],'include':_0x57c47e['include']?_[_0x4c25('0x1e')](_0x57c47e[_0x4c25('0x1d')],function(_0x51eb78){return{'model':db[_0x51eb78['model']],'as':_0x51eb78['as'],'attributes':_0x51eb78[_0x4c25('0x1c')],'include':_0x51eb78[_0x4c25('0x1d')]?_[_0x4c25('0x1e')](_0x51eb78[_0x4c25('0x1d')],function(_0x49401d){return{'model':db[_0x49401d['model']],'as':_0x49401d['as'],'attributes':_0x49401d[_0x4c25('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4c25('0xb')](function(_0x51ba0b){logger[_0x4c25('0xc')](_0x4c25('0x20'),_0xcd6933);logger[_0x4c25('0xe')](_0x4c25('0x20'),_0xcd6933,JSON[_0x4c25('0x10')](_0x51ba0b));_0x15df0c(_0x51ba0b);})[_0x4c25('0x16')](function(_0x4ce3ac){logger[_0x4c25('0x13')](_0x4c25('0x20'),_0x4ce3ac[_0x4c25('0x14')],_0xcd6933);_0x10bd9c(_0xdd32af[_0x4c25('0x13')](0x1f4,_0x4ce3ac[_0x4c25('0x14')]));});});}; \ No newline at end of file +var _0x0e1c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','include','then','ShowZendeskAccount','find','model','lodash','util','moment','randomstring'];(function(_0x42a03e,_0x5e9ec5){var _0x18f141=function(_0xb9fdfe){while(--_0xb9fdfe){_0x42a03e['push'](_0x42a03e['shift']());}};_0x18f141(++_0x5e9ec5);}(_0x0e1c,0x140));var _0xc0e1=function(_0x312686,_0xd9b8fd){_0x312686=_0x312686-0x0;var _0xe81b05=_0x0e1c[_0x312686];return _0xe81b05;};'use strict';var _=require(_0xc0e1('0x0'));var util=require(_0xc0e1('0x1'));var moment=require(_0xc0e1('0x2'));var BPromise=require('bluebird');var rs=require(_0xc0e1('0x3'));var fs=require('fs');var Redis=require(_0xc0e1('0x4'));var db=require(_0xc0e1('0x5'))['db'];var utils=require(_0xc0e1('0x6'));var logger=require(_0xc0e1('0x7'))(_0xc0e1('0x8'));var config=require('../../config/environment');var jayson=require(_0xc0e1('0x9'));var client=jayson['client'][_0xc0e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19d1da,_0x545dad,_0x173ca6){return new BPromise(function(_0x14a4b7,_0x144609){return client[_0xc0e1('0xb')](_0x19d1da,_0x173ca6)['then'](function(_0x254f7a){logger[_0xc0e1('0xc')](_0xc0e1('0xd'),_0x545dad,_0xc0e1('0xe'));logger[_0xc0e1('0xf')](_0xc0e1('0x10'),_0x545dad,_0xc0e1('0xe'),JSON[_0xc0e1('0x11')](_0x254f7a));if(_0x254f7a[_0xc0e1('0x12')]){if(_0x254f7a['error'][_0xc0e1('0x13')]===0x1f4){logger[_0xc0e1('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);return _0x144609(_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);}logger[_0xc0e1('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);return _0x14a4b7(_0x254f7a[_0xc0e1('0x12')][_0xc0e1('0x14')]);}else{logger[_0xc0e1('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0xc0e1('0xe'));_0x14a4b7(_0x254f7a['result'][_0xc0e1('0x14')]);}})[_0xc0e1('0x15')](function(_0xc50504){logger[_0xc0e1('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x545dad,_0xc50504);_0x144609(_0xc50504);});});}exports[_0xc0e1('0x16')]=function(_0x2ff42f){var _0x5e1888=this;return new Promise(function(_0x59392b,_0x410231){return db[_0xc0e1('0x17')][_0xc0e1('0x18')]({'raw':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f['options'][_0xc0e1('0x1b')]||null:null,'attributes':_0x2ff42f['options']?_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1c')]||null:null,'limit':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1d')]||null:null,'include':_0x2ff42f[_0xc0e1('0x19')]?_0x2ff42f['options']['include']?_[_0xc0e1('0x1e')](_0x2ff42f[_0xc0e1('0x19')][_0xc0e1('0x1f')],function(_0x185e63){return{'model':db[_0x185e63['model']],'as':_0x185e63['as'],'attributes':_0x185e63[_0xc0e1('0x1c')],'include':_0x185e63['include']?_[_0xc0e1('0x1e')](_0x185e63['include'],function(_0x44c34a){return{'model':db[_0x44c34a['model']],'as':_0x44c34a['as'],'attributes':_0x44c34a[_0xc0e1('0x1c')],'include':_0x44c34a[_0xc0e1('0x1f')]?_['map'](_0x44c34a['include'],function(_0x1a8e3e){return{'model':db[_0x1a8e3e['model']],'as':_0x1a8e3e['as'],'attributes':_0x1a8e3e[_0xc0e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0e1('0x20')](function(_0x177358){logger[_0xc0e1('0xc')]('GetZendeskAccount',_0x2ff42f);logger[_0xc0e1('0xf')](_0xc0e1('0x16'),_0x2ff42f,JSON['stringify'](_0x177358));_0x59392b(_0x177358);})[_0xc0e1('0x15')](function(_0x4aee04){logger[_0xc0e1('0x12')]('GetZendeskAccount',_0x4aee04[_0xc0e1('0x14')],_0x2ff42f);_0x410231(_0x5e1888[_0xc0e1('0x12')](0x1f4,_0x4aee04['message']));});});};exports[_0xc0e1('0x21')]=function(_0x159caa){var _0x4b8213=this;return new Promise(function(_0x50b12f,_0x464080){return db[_0xc0e1('0x17')][_0xc0e1('0x22')]({'raw':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1b')]||null:null,'attributes':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1c')]||null:null,'include':_0x159caa[_0xc0e1('0x19')]?_0x159caa[_0xc0e1('0x19')][_0xc0e1('0x1f')]?_[_0xc0e1('0x1e')](_0x159caa[_0xc0e1('0x19')]['include'],function(_0x586489){return{'model':db[_0x586489[_0xc0e1('0x23')]],'as':_0x586489['as'],'attributes':_0x586489['attributes'],'include':_0x586489[_0xc0e1('0x1f')]?_[_0xc0e1('0x1e')](_0x586489[_0xc0e1('0x1f')],function(_0x18914d){return{'model':db[_0x18914d[_0xc0e1('0x23')]],'as':_0x18914d['as'],'attributes':_0x18914d[_0xc0e1('0x1c')],'include':_0x18914d[_0xc0e1('0x1f')]?_[_0xc0e1('0x1e')](_0x18914d[_0xc0e1('0x1f')],function(_0x296f74){return{'model':db[_0x296f74[_0xc0e1('0x23')]],'as':_0x296f74['as'],'attributes':_0x296f74[_0xc0e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0e1('0x20')](function(_0x4fb759){logger[_0xc0e1('0xc')]('ShowZendeskAccount',_0x159caa);logger[_0xc0e1('0xf')](_0xc0e1('0x21'),_0x159caa,JSON[_0xc0e1('0x11')](_0x4fb759));_0x50b12f(_0x4fb759);})[_0xc0e1('0x15')](function(_0x36759b){logger[_0xc0e1('0x12')](_0xc0e1('0x21'),_0x36759b['message'],_0x159caa);_0x464080(_0x4b8213[_0xc0e1('0x12')](0x1f4,_0x36759b['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2f022db..121dae1 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x5a6af9,_0x418dd5){var _0x2d71c8=function(_0x585409){while(--_0x585409){_0x5a6af9['push'](_0x5a6af9['shift']());}};_0x2d71c8(++_0x418dd5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3d1cc0,_0x360211){_0x3d1cc0=_0x3d1cc0-0x0;var _0x6e01ad=_0xf4eb[_0x3d1cc0];return _0x6e01ad;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file +var _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3df822,_0x299495){var _0x4e457d=function(_0x68a45f){while(--_0x68a45f){_0x3df822['push'](_0x3df822['shift']());}};_0x4e457d(++_0x299495);}(_0xea28,0x13a));var _0x8ea2=function(_0x27e276,_0x28acfc){_0x27e276=_0x27e276-0x0;var _0x46693c=_0xea28[_0x27e276];return _0x46693c;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 8989fcc..b11f28b 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 _0x5567=['exports','STRING'];(function(_0x850e8a,_0x44e1d7){var _0x2339eb=function(_0x9b4301){while(--_0x9b4301){_0x850e8a['push'](_0x850e8a['shift']());}};_0x2339eb(++_0x44e1d7);}(_0x5567,0x78));var _0x7556=function(_0x102b30,_0x4a8551){_0x102b30=_0x102b30-0x0;var _0x599fc6=_0x5567[_0x102b30];return _0x599fc6;};'use strict';var Sequelize=require('sequelize');module[_0x7556('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7556('0x1')]}}; \ No newline at end of file +var _0x0e7c=['STRING','exports'];(function(_0x2a2591,_0x958577){var _0x45bde5=function(_0x581142){while(--_0x581142){_0x2a2591['push'](_0x2a2591['shift']());}};_0x45bde5(++_0x958577);}(_0x0e7c,0x1af));var _0xc0e7=function(_0x5491e5,_0x37a869){_0x5491e5=_0x5491e5-0x0;var _0x214eb5=_0x0e7c[_0x5491e5];return _0x214eb5;};'use strict';var Sequelize=require('sequelize');module[_0xc0e7('0x0')]={'name':{'type':Sequelize[_0xc0e7('0x1')]},'description':{'type':Sequelize[_0xc0e7('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 77d3691..f5d8d90 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 _0x93c4=['filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2ab131,_0x8d2d5){var _0x5d3c9f=function(_0x112861){while(--_0x112861){_0x2ab131['push'](_0x2ab131['shift']());}};_0x5d3c9f(++_0x8d2d5);}(_0x93c4,0xbb));var _0x493c=function(_0x4789e1,_0x33a07e){_0x4789e1=_0x4789e1-0x0;var _0x2d4958=_0x93c4[_0x4789e1];return _0x2d4958;};'use strict';var emlformat=require(_0x493c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x493c('0x1'));var jsonpatch=require(_0x493c('0x2'));var rp=require('request-promise');var moment=require(_0x493c('0x3'));var BPromise=require(_0x493c('0x4'));var Mustache=require(_0x493c('0x5'));var util=require('util');var path=require(_0x493c('0x6'));var sox=require(_0x493c('0x7'));var csv=require(_0x493c('0x8'));var ejs=require(_0x493c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x493c('0xa'));var squel=require(_0x493c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x493c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x493c('0xd'));var Papa=require(_0x493c('0xe'));var Redis=require(_0x493c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x493c('0x10'));var as=require(_0x493c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x493c('0x12'))('api');var utils=require(_0x493c('0x13'));var config=require(_0x493c('0x14'));var licenseUtil=require(_0x493c('0x15'));var db=require(_0x493c('0x16'))['db'];function respondWithStatusCode(_0x16dd6f,_0xbfacab){_0xbfacab=_0xbfacab||0xcc;return function(_0x47d27d){if(_0x47d27d){return _0x16dd6f[_0x493c('0x17')](_0xbfacab);}return _0x16dd6f[_0x493c('0x18')](_0xbfacab)[_0x493c('0x19')]();};}function respondWithResult(_0x79c819,_0x2d63b4){_0x2d63b4=_0x2d63b4||0xc8;return function(_0x21328e){if(_0x21328e){return _0x79c819[_0x493c('0x18')](_0x2d63b4)[_0x493c('0x1a')](_0x21328e);}};}function respondWithFilteredResult(_0x471c79,_0x442fc0){return function(_0x577500){if(_0x577500){var _0x85e7f9=typeof _0x442fc0[_0x493c('0x1b')]===_0x493c('0x1c')&&typeof _0x442fc0[_0x493c('0x1d')]===_0x493c('0x1c');var _0x5365fa=_0x577500[_0x493c('0x1e')];var _0x4472d6=_0x85e7f9?0x0:_0x442fc0['offset'];var _0x532782=_0x85e7f9?_0x577500[_0x493c('0x1e')]:_0x442fc0['offset']+_0x442fc0['limit'];var _0x1bf81c;if(_0x532782>=_0x5365fa){_0x532782=_0x5365fa;_0x1bf81c=0xc8;}else{_0x1bf81c=0xce;}_0x471c79[_0x493c('0x18')](_0x1bf81c);return _0x471c79[_0x493c('0x1f')](_0x493c('0x20'),_0x4472d6+'-'+_0x532782+'/'+_0x5365fa)[_0x493c('0x1a')](_0x577500);}return null;};}function patchUpdates(_0x3d1db8){return function(_0x3371a3){try{jsonpatch['apply'](_0x3371a3,_0x3d1db8,!![]);}catch(_0x2bd306){return BPromise['reject'](_0x2bd306);}return _0x3371a3[_0x493c('0x21')]();};}function saveUpdates(_0x3a8e0a,_0x353634){return function(_0x2978ba){if(_0x2978ba){return _0x2978ba[_0x493c('0x22')](_0x3a8e0a)[_0x493c('0x23')](function(_0x1f506a){return _0x1f506a;});}return null;};}function removeEntity(_0x1d9571,_0x2f876c){return function(_0x396886){if(_0x396886){return _0x396886[_0x493c('0x24')]()[_0x493c('0x23')](function(){_0x1d9571['status'](0xcc)[_0x493c('0x19')]();});}};}function handleEntityNotFound(_0x15d495,_0x35a9f0){return function(_0x58afcc){if(!_0x58afcc){_0x15d495[_0x493c('0x17')](0x194);}return _0x58afcc;};}function handleError(_0x4e07b4,_0x533173){_0x533173=_0x533173||0x1f4;return function(_0x22eaa9){logger['error'](_0x22eaa9[_0x493c('0x25')]);if(_0x22eaa9[_0x493c('0x26')]){delete _0x22eaa9['name'];}_0x4e07b4['status'](_0x533173)['send'](_0x22eaa9);};}exports[_0x493c('0x27')]=function(_0x3d1780,_0x2207d8){var _0x3cdc05={},_0x1e52d9={},_0x5fc08={'count':0x0,'rows':[]};var _0x2da152=_[_0x493c('0x28')](db[_0x493c('0x29')][_0x493c('0x2a')],function(_0x27d0b0){return{'name':_0x27d0b0[_0x493c('0x2b')],'type':_0x27d0b0[_0x493c('0x2c')][_0x493c('0x2d')]};});_0x1e52d9[_0x493c('0x2e')]=_[_0x493c('0x28')](_0x2da152,_0x493c('0x26'));_0x1e52d9[_0x493c('0x2f')]=_['keys'](_0x3d1780['query']);_0x1e52d9[_0x493c('0x30')]=_[_0x493c('0x31')](_0x1e52d9[_0x493c('0x2e')],_0x1e52d9['query']);_0x3cdc05[_0x493c('0x32')]=_[_0x493c('0x31')](_0x1e52d9['model'],qs[_0x493c('0x33')](_0x3d1780['query'][_0x493c('0x33')]));_0x3cdc05[_0x493c('0x32')]=_0x3cdc05[_0x493c('0x32')][_0x493c('0x34')]?_0x3cdc05[_0x493c('0x32')]:_0x1e52d9['model'];if(!_0x3d1780[_0x493c('0x2f')][_0x493c('0x35')](_0x493c('0x36'))){_0x3cdc05[_0x493c('0x1d')]=qs[_0x493c('0x1d')](_0x3d1780[_0x493c('0x2f')][_0x493c('0x1d')]);_0x3cdc05['offset']=qs[_0x493c('0x1b')](_0x3d1780[_0x493c('0x2f')]['offset']);}_0x3cdc05[_0x493c('0x37')]=qs[_0x493c('0x38')](_0x3d1780['query'][_0x493c('0x38')]);_0x3cdc05[_0x493c('0x39')]=qs[_0x493c('0x30')](_[_0x493c('0x3a')](_0x3d1780[_0x493c('0x2f')],_0x1e52d9[_0x493c('0x30')]),_0x2da152);if(_0x3d1780['query'][_0x493c('0x3b')]){_0x3cdc05[_0x493c('0x39')]=_['merge'](_0x3cdc05[_0x493c('0x39')],{'$or':_[_0x493c('0x28')](_0x2da152,function(_0x2260ec){if(_0x2260ec[_0x493c('0x2c')]!==_0x493c('0x3c')){var _0x3ca82a={};_0x3ca82a[_0x2260ec[_0x493c('0x26')]]={'$like':'%'+_0x3d1780[_0x493c('0x2f')][_0x493c('0x3b')]+'%'};return _0x3ca82a;}})});}_0x3cdc05=_['merge']({},_0x3cdc05,_0x3d1780[_0x493c('0x3d')]);var _0x4ee5a5={'where':_0x3cdc05[_0x493c('0x39')]};return db[_0x493c('0x29')][_0x493c('0x1e')](_0x4ee5a5)[_0x493c('0x23')](function(_0x121306){_0x5fc08[_0x493c('0x1e')]=_0x121306;if(_0x3d1780['query'][_0x493c('0x3e')]){_0x3cdc05[_0x493c('0x3f')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x493c('0x40')](_0x3cdc05);})[_0x493c('0x23')](function(_0x58c500){_0x5fc08[_0x493c('0x41')]=_0x58c500;return _0x5fc08;})[_0x493c('0x23')](respondWithFilteredResult(_0x2207d8,_0x3cdc05))[_0x493c('0x42')](handleError(_0x2207d8,null));};exports[_0x493c('0x43')]=function(_0x3fe06b,_0x4b19d8){var _0x210ae5={'raw':![],'where':{'id':_0x3fe06b[_0x493c('0x44')]['id']}},_0x531497={};_0x531497[_0x493c('0x2e')]=_[_0x493c('0x45')](db[_0x493c('0x29')]['rawAttributes']);_0x531497[_0x493c('0x2f')]=_[_0x493c('0x45')](_0x3fe06b[_0x493c('0x2f')]);_0x531497[_0x493c('0x30')]=_[_0x493c('0x31')](_0x531497[_0x493c('0x2e')],_0x531497[_0x493c('0x2f')]);_0x210ae5[_0x493c('0x32')]=_['intersection'](_0x531497[_0x493c('0x2e')],qs['fields'](_0x3fe06b['query']['fields']));_0x210ae5[_0x493c('0x32')]=_0x210ae5[_0x493c('0x32')]['length']?_0x210ae5[_0x493c('0x32')]:_0x531497[_0x493c('0x2e')];if(_0x3fe06b[_0x493c('0x2f')][_0x493c('0x3e')]){_0x210ae5[_0x493c('0x3f')]=[{'all':!![]}];}_0x210ae5=_[_0x493c('0x46')]({},_0x210ae5,_0x3fe06b[_0x493c('0x3d')]);return db[_0x493c('0x29')][_0x493c('0x47')](_0x210ae5)[_0x493c('0x23')](handleEntityNotFound(_0x4b19d8,null))['then'](respondWithResult(_0x4b19d8,null))[_0x493c('0x42')](handleError(_0x4b19d8,null));};exports['create']=function(_0x226829,_0x45ce1d){return db[_0x493c('0x29')][_0x493c('0x48')](_0x226829[_0x493c('0x49')],{})[_0x493c('0x23')](respondWithResult(_0x45ce1d,0xc9))[_0x493c('0x42')](handleError(_0x45ce1d,null));};exports['update']=function(_0x5bd860,_0x3661ea){if(_0x5bd860['body']['id']){delete _0x5bd860['body']['id'];}return db['ZendeskConfiguration'][_0x493c('0x47')]({'where':{'id':_0x5bd860['params']['id']}})[_0x493c('0x23')](handleEntityNotFound(_0x3661ea,null))[_0x493c('0x23')](saveUpdates(_0x5bd860[_0x493c('0x49')],null))[_0x493c('0x23')](respondWithResult(_0x3661ea,null))[_0x493c('0x42')](handleError(_0x3661ea,null));};exports['destroy']=function(_0x2a34fa,_0x3ef76b){return db['ZendeskConfiguration'][_0x493c('0x47')]({'where':{'id':_0x2a34fa[_0x493c('0x44')]['id']}})[_0x493c('0x23')](handleEntityNotFound(_0x3ef76b,null))[_0x493c('0x23')](removeEntity(_0x3ef76b,null))[_0x493c('0x42')](handleError(_0x3ef76b,null));};exports[_0x493c('0x4a')]=function(_0x47443a,_0x31b2fe,_0x58d807){var _0x1c084f={};var _0x2faadd={};var _0x1a65b1;var _0x2195d7;return db[_0x493c('0x29')][_0x493c('0x4b')]({'where':{'id':_0x47443a[_0x493c('0x44')]['id']}})['then'](handleEntityNotFound(_0x31b2fe,null))[_0x493c('0x23')](function(_0xe74ea1){if(_0xe74ea1){_0x1a65b1=_0xe74ea1;_0x2faadd[_0x493c('0x2e')]=_['keys'](db[_0x493c('0x4c')][_0x493c('0x2a')]);_0x2faadd[_0x493c('0x2f')]=_['keys'](_0x47443a[_0x493c('0x2f')]);_0x2faadd[_0x493c('0x30')]=_[_0x493c('0x31')](_0x2faadd['model'],_0x2faadd[_0x493c('0x2f')]);_0x1c084f[_0x493c('0x32')]=_[_0x493c('0x31')](_0x2faadd['model'],qs[_0x493c('0x33')](_0x47443a[_0x493c('0x2f')]['fields']));_0x1c084f[_0x493c('0x32')]=_0x1c084f['attributes']['length']?_0x1c084f[_0x493c('0x32')]:_0x2faadd[_0x493c('0x2e')];_0x1c084f['order']=qs[_0x493c('0x38')](_0x47443a['query'][_0x493c('0x38')]);_0x1c084f[_0x493c('0x39')]=qs[_0x493c('0x30')](_['pick'](_0x47443a[_0x493c('0x2f')],_0x2faadd[_0x493c('0x30')]));if(_0x47443a['query'][_0x493c('0x3b')]){_0x1c084f[_0x493c('0x39')]=_[_0x493c('0x46')](_0x1c084f['where'],{'$or':_[_0x493c('0x28')](_0x1c084f[_0x493c('0x32')],function(_0x328da7){var _0x210ee9={};_0x210ee9[_0x328da7]={'$like':'%'+_0x47443a[_0x493c('0x2f')][_0x493c('0x3b')]+'%'};return _0x210ee9;})});}_0x1c084f=_[_0x493c('0x46')]({},_0x1c084f,_0x47443a[_0x493c('0x3d')]);return _0x1a65b1[_0x493c('0x4a')](_0x1c084f);}})['then'](function(_0x4b8f44){if(_0x4b8f44){_0x2195d7=_0x4b8f44['length'];if(!_0x47443a[_0x493c('0x2f')][_0x493c('0x35')](_0x493c('0x36'))){_0x1c084f[_0x493c('0x1d')]=qs[_0x493c('0x1d')](_0x47443a[_0x493c('0x2f')][_0x493c('0x1d')]);_0x1c084f[_0x493c('0x1b')]=qs[_0x493c('0x1b')](_0x47443a[_0x493c('0x2f')][_0x493c('0x1b')]);}return _0x1a65b1[_0x493c('0x4a')](_0x1c084f);}})[_0x493c('0x23')](function(_0x24fba2){if(_0x24fba2){return _0x24fba2?{'count':_0x2195d7,'rows':_0x24fba2}:null;}})['then'](respondWithResult(_0x31b2fe,null))['catch'](handleError(_0x31b2fe,null));};exports[_0x493c('0x4d')]=function(_0x5b7f9b,_0x57baf2,_0xb15d5e){var _0x253830={};var _0x28db62={};var _0x35f963;var _0x73a4a8;return db[_0x493c('0x29')]['findOne']({'where':{'id':_0x5b7f9b[_0x493c('0x44')]['id']}})[_0x493c('0x23')](handleEntityNotFound(_0x57baf2,null))[_0x493c('0x23')](function(_0x9419b7){if(_0x9419b7){_0x35f963=_0x9419b7;_0x28db62['model']=_[_0x493c('0x45')](db['ZendeskField'][_0x493c('0x2a')]);_0x28db62[_0x493c('0x2f')]=_['keys'](_0x5b7f9b[_0x493c('0x2f')]);_0x28db62[_0x493c('0x30')]=_['intersection'](_0x28db62['model'],_0x28db62[_0x493c('0x2f')]);_0x253830[_0x493c('0x32')]=_[_0x493c('0x31')](_0x28db62[_0x493c('0x2e')],qs[_0x493c('0x33')](_0x5b7f9b['query'][_0x493c('0x33')]));_0x253830[_0x493c('0x32')]=_0x253830[_0x493c('0x32')][_0x493c('0x34')]?_0x253830[_0x493c('0x32')]:_0x28db62[_0x493c('0x2e')];_0x253830[_0x493c('0x37')]=qs[_0x493c('0x38')](_0x5b7f9b['query'][_0x493c('0x38')]);_0x253830[_0x493c('0x39')]=qs[_0x493c('0x30')](_[_0x493c('0x3a')](_0x5b7f9b[_0x493c('0x2f')],_0x28db62[_0x493c('0x30')]));if(_0x5b7f9b[_0x493c('0x2f')][_0x493c('0x3b')]){_0x253830[_0x493c('0x39')]=_[_0x493c('0x46')](_0x253830['where'],{'$or':_[_0x493c('0x28')](_0x253830[_0x493c('0x32')],function(_0x4f9a83){var _0x48d7d9={};_0x48d7d9[_0x4f9a83]={'$like':'%'+_0x5b7f9b[_0x493c('0x2f')][_0x493c('0x3b')]+'%'};return _0x48d7d9;})});}_0x253830=_[_0x493c('0x46')]({},_0x253830,_0x5b7f9b['options']);return _0x35f963[_0x493c('0x4d')](_0x253830);}})['then'](function(_0x53a87e){if(_0x53a87e){_0x73a4a8=_0x53a87e[_0x493c('0x34')];if(!_0x5b7f9b[_0x493c('0x2f')][_0x493c('0x35')](_0x493c('0x36'))){_0x253830[_0x493c('0x1d')]=qs['limit'](_0x5b7f9b[_0x493c('0x2f')][_0x493c('0x1d')]);_0x253830[_0x493c('0x1b')]=qs[_0x493c('0x1b')](_0x5b7f9b[_0x493c('0x2f')][_0x493c('0x1b')]);}return _0x35f963[_0x493c('0x4d')](_0x253830);}})[_0x493c('0x23')](function(_0x190fda){if(_0x190fda){return _0x190fda?{'count':_0x73a4a8,'rows':_0x190fda}:null;}})['then'](respondWithResult(_0x57baf2,null))[_0x493c('0x42')](handleError(_0x57baf2,null));};exports[_0x493c('0x4e')]=function(_0x38579e,_0xab5470,_0x4d32c0){var _0x4695b4={};var _0x3b3cd3={};var _0x108720;var _0x5adbd8;return db['ZendeskConfiguration'][_0x493c('0x4b')]({'where':{'id':_0x38579e[_0x493c('0x44')]['id']}})[_0x493c('0x23')](handleEntityNotFound(_0xab5470,null))[_0x493c('0x23')](function(_0x1e9f5d){if(_0x1e9f5d){_0x108720=_0x1e9f5d;_0x3b3cd3[_0x493c('0x2e')]=_[_0x493c('0x45')](db['ZendeskField'][_0x493c('0x2a')]);_0x3b3cd3['query']=_[_0x493c('0x45')](_0x38579e['query']);_0x3b3cd3[_0x493c('0x30')]=_[_0x493c('0x31')](_0x3b3cd3['model'],_0x3b3cd3['query']);_0x4695b4[_0x493c('0x32')]=_[_0x493c('0x31')](_0x3b3cd3[_0x493c('0x2e')],qs[_0x493c('0x33')](_0x38579e[_0x493c('0x2f')][_0x493c('0x33')]));_0x4695b4[_0x493c('0x32')]=_0x4695b4[_0x493c('0x32')][_0x493c('0x34')]?_0x4695b4[_0x493c('0x32')]:_0x3b3cd3[_0x493c('0x2e')];_0x4695b4['order']=qs[_0x493c('0x38')](_0x38579e[_0x493c('0x2f')][_0x493c('0x38')]);_0x4695b4[_0x493c('0x39')]=qs[_0x493c('0x30')](_[_0x493c('0x3a')](_0x38579e[_0x493c('0x2f')],_0x3b3cd3[_0x493c('0x30')]));if(_0x38579e[_0x493c('0x2f')][_0x493c('0x3b')]){_0x4695b4[_0x493c('0x39')]=_[_0x493c('0x46')](_0x4695b4[_0x493c('0x39')],{'$or':_['map'](_0x4695b4['attributes'],function(_0x34d5fa){var _0x48993f={};_0x48993f[_0x34d5fa]={'$like':'%'+_0x38579e[_0x493c('0x2f')][_0x493c('0x3b')]+'%'};return _0x48993f;})});}_0x4695b4=_[_0x493c('0x46')]({},_0x4695b4,_0x38579e[_0x493c('0x3d')]);return _0x108720['getDescriptions'](_0x4695b4);}})[_0x493c('0x23')](function(_0x5af5a7){if(_0x5af5a7){_0x5adbd8=_0x5af5a7[_0x493c('0x34')];if(!_0x38579e[_0x493c('0x2f')][_0x493c('0x35')]('nolimit')){_0x4695b4[_0x493c('0x1d')]=qs[_0x493c('0x1d')](_0x38579e[_0x493c('0x2f')][_0x493c('0x1d')]);_0x4695b4['offset']=qs['offset'](_0x38579e['query'][_0x493c('0x1b')]);}return _0x108720[_0x493c('0x4e')](_0x4695b4);}})[_0x493c('0x23')](function(_0x475892){if(_0x475892){return _0x475892?{'count':_0x5adbd8,'rows':_0x475892}:null;}})[_0x493c('0x23')](respondWithResult(_0xab5470,null))[_0x493c('0x42')](handleError(_0xab5470,null));};exports[_0x493c('0x4f')]=function(_0x249c06,_0x34b356,_0x18e11b){var _0x2aa6f9={};var _0x128404={};var _0x2f8bea;var _0x1af942;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x249c06['params']['id']}})[_0x493c('0x23')](handleEntityNotFound(_0x34b356,null))[_0x493c('0x23')](function(_0xa039ec){if(_0xa039ec){_0x2f8bea=_0xa039ec;_0x128404[_0x493c('0x2e')]=_['keys'](db['Tag'][_0x493c('0x2a')]);_0x128404['query']=_[_0x493c('0x45')](_0x249c06[_0x493c('0x2f')]);_0x128404[_0x493c('0x30')]=_['intersection'](_0x128404[_0x493c('0x2e')],_0x128404[_0x493c('0x2f')]);_0x2aa6f9[_0x493c('0x32')]=_['intersection'](_0x128404[_0x493c('0x2e')],qs[_0x493c('0x33')](_0x249c06[_0x493c('0x2f')][_0x493c('0x33')]));_0x2aa6f9[_0x493c('0x32')]=_0x2aa6f9[_0x493c('0x32')][_0x493c('0x34')]?_0x2aa6f9[_0x493c('0x32')]:_0x128404['model'];_0x2aa6f9[_0x493c('0x37')]=qs[_0x493c('0x38')](_0x249c06[_0x493c('0x2f')]['sort']);_0x2aa6f9[_0x493c('0x39')]=qs[_0x493c('0x30')](_[_0x493c('0x3a')](_0x249c06[_0x493c('0x2f')],_0x128404[_0x493c('0x30')]));if(_0x249c06[_0x493c('0x2f')][_0x493c('0x3b')]){_0x2aa6f9[_0x493c('0x39')]=_[_0x493c('0x46')](_0x2aa6f9[_0x493c('0x39')],{'$or':_[_0x493c('0x28')](_0x2aa6f9['attributes'],function(_0x2feda5){var _0x101f88={};_0x101f88[_0x2feda5]={'$like':'%'+_0x249c06[_0x493c('0x2f')]['filter']+'%'};return _0x101f88;})});}_0x2aa6f9=_[_0x493c('0x46')]({},_0x2aa6f9,_0x249c06[_0x493c('0x3d')]);return _0x2f8bea[_0x493c('0x4f')](_0x2aa6f9);}})[_0x493c('0x23')](function(_0x24ac8e){if(_0x24ac8e){_0x1af942=_0x24ac8e['length'];if(!_0x249c06[_0x493c('0x2f')][_0x493c('0x35')](_0x493c('0x36'))){_0x2aa6f9[_0x493c('0x1d')]=qs[_0x493c('0x1d')](_0x249c06[_0x493c('0x2f')][_0x493c('0x1d')]);_0x2aa6f9[_0x493c('0x1b')]=qs[_0x493c('0x1b')](_0x249c06[_0x493c('0x2f')][_0x493c('0x1b')]);}return _0x2f8bea[_0x493c('0x4f')](_0x2aa6f9);}})['then'](function(_0x981170){if(_0x981170){return _0x981170?{'count':_0x1af942,'rows':_0x981170}:null;}})[_0x493c('0x23')](respondWithResult(_0x34b356,null))['catch'](handleError(_0x34b356,null));};exports[_0x493c('0x50')]=function(_0x4795bd,_0x98daf3,_0x3a9ae3){if(_0x4795bd[_0x493c('0x49')]['id']){delete _0x4795bd[_0x493c('0x49')]['id'];}return db[_0x493c('0x29')][_0x493c('0x4b')]({'where':{'id':_0x4795bd['params']['id']}})[_0x493c('0x23')](handleEntityNotFound(_0x98daf3,null))[_0x493c('0x23')](function(_0x17a46e){if(_0x17a46e){return _0x17a46e[_0x493c('0x50')](_0x4795bd[_0x493c('0x49')][_0x493c('0x51')]||[]);}return null;})[_0x493c('0x23')](respondWithResult(_0x98daf3,null))[_0x493c('0x42')](handleError(_0x98daf3,null));}; \ No newline at end of file +var _0x980d=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','index','map','ZendeskConfiguration','rawAttributes','fieldName','model','name','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','type','filter','options','includeAll','include','findAll','rows','params','intersection','create','catch','body','find','getFields','ZendeskField','order','findOne','getSubjects','getDescriptions','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5c7b94,_0x571d6b){var _0x3d21c2=function(_0x270460){while(--_0x270460){_0x5c7b94['push'](_0x5c7b94['shift']());}};_0x3d21c2(++_0x571d6b);}(_0x980d,0xa3));var _0xd980=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x980d[_0x28f32c];return _0x355402;};'use strict';var emlformat=require(_0xd980('0x0'));var rimraf=require(_0xd980('0x1'));var zipdir=require(_0xd980('0x2'));var jsonpatch=require(_0xd980('0x3'));var rp=require(_0xd980('0x4'));var moment=require(_0xd980('0x5'));var BPromise=require(_0xd980('0x6'));var Mustache=require(_0xd980('0x7'));var util=require(_0xd980('0x8'));var path=require(_0xd980('0x9'));var sox=require(_0xd980('0xa'));var csv=require('to-csv');var ejs=require(_0xd980('0xb'));var fs=require('fs');var fs_extra=require(_0xd980('0xc'));var _=require(_0xd980('0xd'));var squel=require(_0xd980('0xe'));var crypto=require(_0xd980('0xf'));var jsforce=require(_0xd980('0x10'));var deskjs=require(_0xd980('0x11'));var toCsv=require(_0xd980('0x12'));var querystring=require(_0xd980('0x13'));var Papa=require(_0xd980('0x14'));var Redis=require(_0xd980('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xd980('0x16'));var as=require(_0xd980('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd980('0x18'));var utils=require(_0xd980('0x19'));var config=require(_0xd980('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd980('0x1b'))['db'];function respondWithStatusCode(_0x4b8609,_0x272b09){_0x272b09=_0x272b09||0xcc;return function(_0x333f33){if(_0x333f33){return _0x4b8609[_0xd980('0x1c')](_0x272b09);}return _0x4b8609[_0xd980('0x1d')](_0x272b09)[_0xd980('0x1e')]();};}function respondWithResult(_0x1e92eb,_0x13e2df){_0x13e2df=_0x13e2df||0xc8;return function(_0x39cf93){if(_0x39cf93){return _0x1e92eb[_0xd980('0x1d')](_0x13e2df)[_0xd980('0x1f')](_0x39cf93);}};}function respondWithFilteredResult(_0x3df22c,_0x1c4d21){return function(_0x501e06){if(_0x501e06){var _0x1bde2f=typeof _0x1c4d21[_0xd980('0x20')]===_0xd980('0x21')&&typeof _0x1c4d21[_0xd980('0x22')]===_0xd980('0x21');var _0x9d6a02=_0x501e06['count'];var _0xab0eab=_0x1bde2f?0x0:_0x1c4d21['offset'];var _0x28ec7b=_0x1bde2f?_0x501e06[_0xd980('0x23')]:_0x1c4d21[_0xd980('0x20')]+_0x1c4d21[_0xd980('0x22')];var _0x1f22f0;if(_0x28ec7b>=_0x9d6a02){_0x28ec7b=_0x9d6a02;_0x1f22f0=0xc8;}else{_0x1f22f0=0xce;}_0x3df22c[_0xd980('0x1d')](_0x1f22f0);return _0x3df22c[_0xd980('0x24')](_0xd980('0x25'),_0xab0eab+'-'+_0x28ec7b+'/'+_0x9d6a02)[_0xd980('0x1f')](_0x501e06);}return null;};}function patchUpdates(_0x5844d7){return function(_0x4ca5b9){try{jsonpatch[_0xd980('0x26')](_0x4ca5b9,_0x5844d7,!![]);}catch(_0x9509cf){return BPromise[_0xd980('0x27')](_0x9509cf);}return _0x4ca5b9['save']();};}function saveUpdates(_0x82991a,_0x104247){return function(_0xd374f8){if(_0xd374f8){return _0xd374f8[_0xd980('0x28')](_0x82991a)[_0xd980('0x29')](function(_0xeb30d4){return _0xeb30d4;});}return null;};}function removeEntity(_0x37b53d,_0x1c4776){return function(_0x36707f){if(_0x36707f){return _0x36707f[_0xd980('0x2a')]()['then'](function(){_0x37b53d[_0xd980('0x1d')](0xcc)[_0xd980('0x1e')]();});}};}function handleEntityNotFound(_0x5d9bd2,_0x208f1c){return function(_0x512286){if(!_0x512286){_0x5d9bd2[_0xd980('0x1c')](0x194);}return _0x512286;};}function handleError(_0x4a9099,_0x383141){_0x383141=_0x383141||0x1f4;return function(_0x57692e){logger[_0xd980('0x2b')](_0x57692e[_0xd980('0x2c')]);if(_0x57692e['name']){delete _0x57692e['name'];}_0x4a9099[_0xd980('0x1d')](_0x383141)['send'](_0x57692e);};}exports[_0xd980('0x2d')]=function(_0x151412,_0x650470){var _0x4e836c={},_0x315fea={},_0x22de87={'count':0x0,'rows':[]};var _0x36e85f=_[_0xd980('0x2e')](db[_0xd980('0x2f')][_0xd980('0x30')],function(_0x4bcdcc){return{'name':_0x4bcdcc[_0xd980('0x31')],'type':_0x4bcdcc['type']['key']};});_0x315fea[_0xd980('0x32')]=_[_0xd980('0x2e')](_0x36e85f,_0xd980('0x33'));_0x315fea['query']=_[_0xd980('0x34')](_0x151412[_0xd980('0x35')]);_0x315fea['filters']=_['intersection'](_0x315fea[_0xd980('0x32')],_0x315fea[_0xd980('0x35')]);_0x4e836c[_0xd980('0x36')]=_['intersection'](_0x315fea[_0xd980('0x32')],qs[_0xd980('0x37')](_0x151412['query'][_0xd980('0x37')]));_0x4e836c[_0xd980('0x36')]=_0x4e836c[_0xd980('0x36')][_0xd980('0x38')]?_0x4e836c[_0xd980('0x36')]:_0x315fea['model'];if(!_0x151412[_0xd980('0x35')][_0xd980('0x39')](_0xd980('0x3a'))){_0x4e836c[_0xd980('0x22')]=qs[_0xd980('0x22')](_0x151412[_0xd980('0x35')][_0xd980('0x22')]);_0x4e836c['offset']=qs[_0xd980('0x20')](_0x151412['query'][_0xd980('0x20')]);}_0x4e836c['order']=qs['sort'](_0x151412[_0xd980('0x35')][_0xd980('0x3b')]);_0x4e836c['where']=qs[_0xd980('0x3c')](_[_0xd980('0x3d')](_0x151412[_0xd980('0x35')],_0x315fea[_0xd980('0x3c')]),_0x36e85f);if(_0x151412['query']['filter']){_0x4e836c[_0xd980('0x3e')]=_[_0xd980('0x3f')](_0x4e836c[_0xd980('0x3e')],{'$or':_['map'](_0x36e85f,function(_0x2c1aa0){if(_0x2c1aa0[_0xd980('0x40')]!=='VIRTUAL'){var _0x52e908={};_0x52e908[_0x2c1aa0['name']]={'$like':'%'+_0x151412[_0xd980('0x35')][_0xd980('0x41')]+'%'};return _0x52e908;}})});}_0x4e836c=_['merge']({},_0x4e836c,_0x151412[_0xd980('0x42')]);var _0x1f57fc={'where':_0x4e836c[_0xd980('0x3e')]};return db[_0xd980('0x2f')][_0xd980('0x23')](_0x1f57fc)[_0xd980('0x29')](function(_0x247d89){_0x22de87['count']=_0x247d89;if(_0x151412['query'][_0xd980('0x43')]){_0x4e836c[_0xd980('0x44')]=[{'all':!![]}];}return db[_0xd980('0x2f')][_0xd980('0x45')](_0x4e836c);})[_0xd980('0x29')](function(_0x44f9e5){_0x22de87[_0xd980('0x46')]=_0x44f9e5;return _0x22de87;})[_0xd980('0x29')](respondWithFilteredResult(_0x650470,_0x4e836c))['catch'](handleError(_0x650470,null));};exports['show']=function(_0x2105e0,_0x504823){var _0x5a9d73={'raw':![],'where':{'id':_0x2105e0[_0xd980('0x47')]['id']}},_0x40b63a={};_0x40b63a[_0xd980('0x32')]=_['keys'](db[_0xd980('0x2f')][_0xd980('0x30')]);_0x40b63a[_0xd980('0x35')]=_[_0xd980('0x34')](_0x2105e0[_0xd980('0x35')]);_0x40b63a['filters']=_[_0xd980('0x48')](_0x40b63a[_0xd980('0x32')],_0x40b63a[_0xd980('0x35')]);_0x5a9d73['attributes']=_[_0xd980('0x48')](_0x40b63a[_0xd980('0x32')],qs[_0xd980('0x37')](_0x2105e0['query']['fields']));_0x5a9d73['attributes']=_0x5a9d73[_0xd980('0x36')][_0xd980('0x38')]?_0x5a9d73['attributes']:_0x40b63a[_0xd980('0x32')];if(_0x2105e0[_0xd980('0x35')]['includeAll']){_0x5a9d73['include']=[{'all':!![]}];}_0x5a9d73=_[_0xd980('0x3f')]({},_0x5a9d73,_0x2105e0['options']);return db[_0xd980('0x2f')]['find'](_0x5a9d73)[_0xd980('0x29')](handleEntityNotFound(_0x504823,null))[_0xd980('0x29')](respondWithResult(_0x504823,null))['catch'](handleError(_0x504823,null));};exports[_0xd980('0x49')]=function(_0x35bd21,_0x252372){return db['ZendeskConfiguration'][_0xd980('0x49')](_0x35bd21['body'],{})[_0xd980('0x29')](respondWithResult(_0x252372,0xc9))[_0xd980('0x4a')](handleError(_0x252372,null));};exports['update']=function(_0x12a419,_0x2d6f7f){if(_0x12a419[_0xd980('0x4b')]['id']){delete _0x12a419[_0xd980('0x4b')]['id'];}return db[_0xd980('0x2f')][_0xd980('0x4c')]({'where':{'id':_0x12a419[_0xd980('0x47')]['id']}})[_0xd980('0x29')](handleEntityNotFound(_0x2d6f7f,null))[_0xd980('0x29')](saveUpdates(_0x12a419[_0xd980('0x4b')],null))[_0xd980('0x29')](respondWithResult(_0x2d6f7f,null))[_0xd980('0x4a')](handleError(_0x2d6f7f,null));};exports[_0xd980('0x2a')]=function(_0x153ea0,_0x373467){return db[_0xd980('0x2f')][_0xd980('0x4c')]({'where':{'id':_0x153ea0[_0xd980('0x47')]['id']}})[_0xd980('0x29')](handleEntityNotFound(_0x373467,null))[_0xd980('0x29')](removeEntity(_0x373467,null))['catch'](handleError(_0x373467,null));};exports[_0xd980('0x4d')]=function(_0x2f442e,_0x39645a,_0x175c9c){var _0x333682={};var _0x442e31={};var _0x396e54;var _0x50df99;return db[_0xd980('0x2f')]['findOne']({'where':{'id':_0x2f442e[_0xd980('0x47')]['id']}})[_0xd980('0x29')](handleEntityNotFound(_0x39645a,null))['then'](function(_0x26d3de){if(_0x26d3de){_0x396e54=_0x26d3de;_0x442e31[_0xd980('0x32')]=_[_0xd980('0x34')](db[_0xd980('0x4e')][_0xd980('0x30')]);_0x442e31[_0xd980('0x35')]=_['keys'](_0x2f442e[_0xd980('0x35')]);_0x442e31['filters']=_[_0xd980('0x48')](_0x442e31[_0xd980('0x32')],_0x442e31[_0xd980('0x35')]);_0x333682['attributes']=_[_0xd980('0x48')](_0x442e31['model'],qs[_0xd980('0x37')](_0x2f442e[_0xd980('0x35')][_0xd980('0x37')]));_0x333682[_0xd980('0x36')]=_0x333682[_0xd980('0x36')][_0xd980('0x38')]?_0x333682[_0xd980('0x36')]:_0x442e31[_0xd980('0x32')];_0x333682[_0xd980('0x4f')]=qs[_0xd980('0x3b')](_0x2f442e[_0xd980('0x35')][_0xd980('0x3b')]);_0x333682[_0xd980('0x3e')]=qs[_0xd980('0x3c')](_[_0xd980('0x3d')](_0x2f442e[_0xd980('0x35')],_0x442e31[_0xd980('0x3c')]));if(_0x2f442e[_0xd980('0x35')]['filter']){_0x333682[_0xd980('0x3e')]=_[_0xd980('0x3f')](_0x333682['where'],{'$or':_[_0xd980('0x2e')](_0x333682['attributes'],function(_0x376e13){var _0x3a4c02={};_0x3a4c02[_0x376e13]={'$like':'%'+_0x2f442e['query']['filter']+'%'};return _0x3a4c02;})});}_0x333682=_['merge']({},_0x333682,_0x2f442e[_0xd980('0x42')]);return _0x396e54['getFields'](_0x333682);}})[_0xd980('0x29')](function(_0x4237af){if(_0x4237af){_0x50df99=_0x4237af['length'];if(!_0x2f442e[_0xd980('0x35')]['hasOwnProperty'](_0xd980('0x3a'))){_0x333682['limit']=qs[_0xd980('0x22')](_0x2f442e[_0xd980('0x35')]['limit']);_0x333682['offset']=qs['offset'](_0x2f442e[_0xd980('0x35')]['offset']);}return _0x396e54['getFields'](_0x333682);}})['then'](function(_0x3984cf){if(_0x3984cf){return _0x3984cf?{'count':_0x50df99,'rows':_0x3984cf}:null;}})[_0xd980('0x29')](respondWithResult(_0x39645a,null))[_0xd980('0x4a')](handleError(_0x39645a,null));};exports['getSubjects']=function(_0x5b25a0,_0x1b5166,_0x4478ed){var _0xd8b93f={};var _0x31ddee={};var _0x3f353e;var _0x1f915f;return db[_0xd980('0x2f')][_0xd980('0x50')]({'where':{'id':_0x5b25a0[_0xd980('0x47')]['id']}})[_0xd980('0x29')](handleEntityNotFound(_0x1b5166,null))[_0xd980('0x29')](function(_0x50e9a9){if(_0x50e9a9){_0x3f353e=_0x50e9a9;_0x31ddee['model']=_['keys'](db[_0xd980('0x4e')][_0xd980('0x30')]);_0x31ddee['query']=_[_0xd980('0x34')](_0x5b25a0[_0xd980('0x35')]);_0x31ddee[_0xd980('0x3c')]=_['intersection'](_0x31ddee[_0xd980('0x32')],_0x31ddee['query']);_0xd8b93f['attributes']=_[_0xd980('0x48')](_0x31ddee[_0xd980('0x32')],qs[_0xd980('0x37')](_0x5b25a0['query'][_0xd980('0x37')]));_0xd8b93f[_0xd980('0x36')]=_0xd8b93f[_0xd980('0x36')][_0xd980('0x38')]?_0xd8b93f['attributes']:_0x31ddee['model'];_0xd8b93f[_0xd980('0x4f')]=qs[_0xd980('0x3b')](_0x5b25a0[_0xd980('0x35')][_0xd980('0x3b')]);_0xd8b93f[_0xd980('0x3e')]=qs[_0xd980('0x3c')](_[_0xd980('0x3d')](_0x5b25a0[_0xd980('0x35')],_0x31ddee[_0xd980('0x3c')]));if(_0x5b25a0['query'][_0xd980('0x41')]){_0xd8b93f['where']=_[_0xd980('0x3f')](_0xd8b93f[_0xd980('0x3e')],{'$or':_[_0xd980('0x2e')](_0xd8b93f[_0xd980('0x36')],function(_0x684d77){var _0x17d202={};_0x17d202[_0x684d77]={'$like':'%'+_0x5b25a0[_0xd980('0x35')][_0xd980('0x41')]+'%'};return _0x17d202;})});}_0xd8b93f=_['merge']({},_0xd8b93f,_0x5b25a0[_0xd980('0x42')]);return _0x3f353e[_0xd980('0x51')](_0xd8b93f);}})[_0xd980('0x29')](function(_0x50608d){if(_0x50608d){_0x1f915f=_0x50608d[_0xd980('0x38')];if(!_0x5b25a0[_0xd980('0x35')]['hasOwnProperty'](_0xd980('0x3a'))){_0xd8b93f[_0xd980('0x22')]=qs[_0xd980('0x22')](_0x5b25a0[_0xd980('0x35')][_0xd980('0x22')]);_0xd8b93f['offset']=qs['offset'](_0x5b25a0[_0xd980('0x35')][_0xd980('0x20')]);}return _0x3f353e[_0xd980('0x51')](_0xd8b93f);}})[_0xd980('0x29')](function(_0x1eefe8){if(_0x1eefe8){return _0x1eefe8?{'count':_0x1f915f,'rows':_0x1eefe8}:null;}})[_0xd980('0x29')](respondWithResult(_0x1b5166,null))['catch'](handleError(_0x1b5166,null));};exports[_0xd980('0x52')]=function(_0x3f6026,_0x168e50,_0x18a71f){var _0x2ff113={};var _0x44bc67={};var _0x48e656;var _0xe87f9d;return db[_0xd980('0x2f')][_0xd980('0x50')]({'where':{'id':_0x3f6026[_0xd980('0x47')]['id']}})[_0xd980('0x29')](handleEntityNotFound(_0x168e50,null))[_0xd980('0x29')](function(_0x3a04e9){if(_0x3a04e9){_0x48e656=_0x3a04e9;_0x44bc67[_0xd980('0x32')]=_[_0xd980('0x34')](db[_0xd980('0x4e')][_0xd980('0x30')]);_0x44bc67[_0xd980('0x35')]=_[_0xd980('0x34')](_0x3f6026[_0xd980('0x35')]);_0x44bc67[_0xd980('0x3c')]=_[_0xd980('0x48')](_0x44bc67[_0xd980('0x32')],_0x44bc67[_0xd980('0x35')]);_0x2ff113[_0xd980('0x36')]=_[_0xd980('0x48')](_0x44bc67[_0xd980('0x32')],qs[_0xd980('0x37')](_0x3f6026[_0xd980('0x35')][_0xd980('0x37')]));_0x2ff113[_0xd980('0x36')]=_0x2ff113[_0xd980('0x36')]['length']?_0x2ff113[_0xd980('0x36')]:_0x44bc67[_0xd980('0x32')];_0x2ff113[_0xd980('0x4f')]=qs[_0xd980('0x3b')](_0x3f6026[_0xd980('0x35')][_0xd980('0x3b')]);_0x2ff113['where']=qs[_0xd980('0x3c')](_[_0xd980('0x3d')](_0x3f6026[_0xd980('0x35')],_0x44bc67['filters']));if(_0x3f6026['query'][_0xd980('0x41')]){_0x2ff113[_0xd980('0x3e')]=_[_0xd980('0x3f')](_0x2ff113[_0xd980('0x3e')],{'$or':_['map'](_0x2ff113['attributes'],function(_0x1f3b79){var _0x54290a={};_0x54290a[_0x1f3b79]={'$like':'%'+_0x3f6026[_0xd980('0x35')]['filter']+'%'};return _0x54290a;})});}_0x2ff113=_[_0xd980('0x3f')]({},_0x2ff113,_0x3f6026['options']);return _0x48e656[_0xd980('0x52')](_0x2ff113);}})['then'](function(_0x547cf7){if(_0x547cf7){_0xe87f9d=_0x547cf7['length'];if(!_0x3f6026[_0xd980('0x35')][_0xd980('0x39')](_0xd980('0x3a'))){_0x2ff113['limit']=qs[_0xd980('0x22')](_0x3f6026[_0xd980('0x35')]['limit']);_0x2ff113[_0xd980('0x20')]=qs[_0xd980('0x20')](_0x3f6026[_0xd980('0x35')][_0xd980('0x20')]);}return _0x48e656[_0xd980('0x52')](_0x2ff113);}})['then'](function(_0x193b84){if(_0x193b84){return _0x193b84?{'count':_0xe87f9d,'rows':_0x193b84}:null;}})[_0xd980('0x29')](respondWithResult(_0x168e50,null))['catch'](handleError(_0x168e50,null));};exports[_0xd980('0x53')]=function(_0x4fdaaf,_0x5d4049,_0x3661ba){var _0x2daa28={};var _0x282289={};var _0x743e83;var _0x48d523;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4fdaaf[_0xd980('0x47')]['id']}})[_0xd980('0x29')](handleEntityNotFound(_0x5d4049,null))['then'](function(_0x2075ba){if(_0x2075ba){_0x743e83=_0x2075ba;_0x282289['model']=_[_0xd980('0x34')](db['Tag'][_0xd980('0x30')]);_0x282289[_0xd980('0x35')]=_[_0xd980('0x34')](_0x4fdaaf['query']);_0x282289[_0xd980('0x3c')]=_['intersection'](_0x282289['model'],_0x282289[_0xd980('0x35')]);_0x2daa28['attributes']=_[_0xd980('0x48')](_0x282289[_0xd980('0x32')],qs[_0xd980('0x37')](_0x4fdaaf[_0xd980('0x35')][_0xd980('0x37')]));_0x2daa28[_0xd980('0x36')]=_0x2daa28[_0xd980('0x36')]['length']?_0x2daa28[_0xd980('0x36')]:_0x282289['model'];_0x2daa28[_0xd980('0x4f')]=qs[_0xd980('0x3b')](_0x4fdaaf[_0xd980('0x35')][_0xd980('0x3b')]);_0x2daa28[_0xd980('0x3e')]=qs[_0xd980('0x3c')](_[_0xd980('0x3d')](_0x4fdaaf[_0xd980('0x35')],_0x282289[_0xd980('0x3c')]));if(_0x4fdaaf[_0xd980('0x35')][_0xd980('0x41')]){_0x2daa28[_0xd980('0x3e')]=_[_0xd980('0x3f')](_0x2daa28[_0xd980('0x3e')],{'$or':_[_0xd980('0x2e')](_0x2daa28['attributes'],function(_0x5b64cc){var _0x48e45c={};_0x48e45c[_0x5b64cc]={'$like':'%'+_0x4fdaaf['query'][_0xd980('0x41')]+'%'};return _0x48e45c;})});}_0x2daa28=_[_0xd980('0x3f')]({},_0x2daa28,_0x4fdaaf['options']);return _0x743e83[_0xd980('0x53')](_0x2daa28);}})[_0xd980('0x29')](function(_0x49a0c8){if(_0x49a0c8){_0x48d523=_0x49a0c8[_0xd980('0x38')];if(!_0x4fdaaf[_0xd980('0x35')][_0xd980('0x39')](_0xd980('0x3a'))){_0x2daa28['limit']=qs[_0xd980('0x22')](_0x4fdaaf[_0xd980('0x35')][_0xd980('0x22')]);_0x2daa28[_0xd980('0x20')]=qs[_0xd980('0x20')](_0x4fdaaf[_0xd980('0x35')]['offset']);}return _0x743e83['getTags'](_0x2daa28);}})['then'](function(_0x22686d){if(_0x22686d){return _0x22686d?{'count':_0x48d523,'rows':_0x22686d}:null;}})['then'](respondWithResult(_0x5d4049,null))[_0xd980('0x4a')](handleError(_0x5d4049,null));};exports['setTags']=function(_0x3a8c01,_0x49e4a4,_0x19f5d4){if(_0x3a8c01[_0xd980('0x4b')]['id']){delete _0x3a8c01[_0xd980('0x4b')]['id'];}return db[_0xd980('0x2f')][_0xd980('0x50')]({'where':{'id':_0x3a8c01['params']['id']}})[_0xd980('0x29')](handleEntityNotFound(_0x49e4a4,null))[_0xd980('0x29')](function(_0x342c36){if(_0x342c36){return _0x342c36['setTags'](_0x3a8c01[_0xd980('0x4b')][_0xd980('0x54')]||[]);}return null;})[_0xd980('0x29')](respondWithResult(_0x49e4a4,null))[_0xd980('0x4a')](handleError(_0x49e4a4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c00a707..102404f 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 _0xf7b4=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment'];(function(_0x1b92d1,_0x5756d7){var _0x514acc=function(_0x1fcb7c){while(--_0x1fcb7c){_0x1b92d1['push'](_0x1b92d1['shift']());}};_0x514acc(++_0x5756d7);}(_0xf7b4,0x152));var _0x4f7b=function(_0x3d807a,_0x17d648){_0x3d807a=_0x3d807a-0x0;var _0x250fb5=_0xf7b4[_0x3d807a];return _0x250fb5;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0x4fc2,0x111));var _0x24fc=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x4fc2[_0x3a99f4];return _0xea0b42;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'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 235394a..aa303af 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 _0x50c7=['stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug'];(function(_0x1fd5eb,_0x235203){var _0x102365=function(_0x54de1f){while(--_0x54de1f){_0x1fd5eb['push'](_0x1fd5eb['shift']());}};_0x102365(++_0x235203);}(_0x50c7,0xcd));var _0x750c=function(_0x550288,_0xcbedb1){_0x550288=_0x550288-0x0;var _0x311d16=_0x50c7[_0x550288];return _0x311d16;};'use strict';var _=require('lodash');var util=require(_0x750c('0x0'));var moment=require(_0x750c('0x1'));var BPromise=require(_0x750c('0x2'));var rs=require(_0x750c('0x3'));var fs=require('fs');var Redis=require(_0x750c('0x4'));var db=require(_0x750c('0x5'))['db'];var utils=require(_0x750c('0x6'));var logger=require(_0x750c('0x7'))(_0x750c('0x8'));var config=require(_0x750c('0x9'));var jayson=require(_0x750c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d44f0,_0x1f0991,_0x41fc4c){return new BPromise(function(_0x128f16,_0x529996){return client['request'](_0x4d44f0,_0x41fc4c)[_0x750c('0xb')](function(_0x2fcb10){logger[_0x750c('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1f0991,_0x750c('0xd'));logger[_0x750c('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1f0991,_0x750c('0xd'),JSON[_0x750c('0xf')](_0x2fcb10));if(_0x2fcb10[_0x750c('0x10')]){if(_0x2fcb10[_0x750c('0x10')]['code']===0x1f4){logger['error'](_0x750c('0x11'),_0x1f0991,_0x2fcb10[_0x750c('0x10')][_0x750c('0x12')]);return _0x529996(_0x2fcb10[_0x750c('0x10')]['message']);}logger['error'](_0x750c('0x11'),_0x1f0991,_0x2fcb10['error'][_0x750c('0x12')]);return _0x128f16(_0x2fcb10[_0x750c('0x10')][_0x750c('0x12')]);}else{logger[_0x750c('0xc')](_0x750c('0x11'),_0x1f0991,_0x750c('0xd'));_0x128f16(_0x2fcb10[_0x750c('0x13')][_0x750c('0x12')]);}})['catch'](function(_0x37a616){logger['error'](_0x750c('0x11'),_0x1f0991,_0x37a616);_0x529996(_0x37a616);});});} \ No newline at end of file +var _0x50fb=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','then','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ZendeskConfiguration,\x20%s,\x20%s','result','catch'];(function(_0x32c2a8,_0x3c8f88){var _0x3df1ef=function(_0x51d0c8){while(--_0x51d0c8){_0x32c2a8['push'](_0x32c2a8['shift']());}};_0x3df1ef(++_0x3c8f88);}(_0x50fb,0x1a4));var _0xb50f=function(_0x3b80de,_0x20a62a){_0x3b80de=_0x3b80de-0x0;var _0x4e0dbe=_0x50fb[_0x3b80de];return _0x4e0dbe;};'use strict';var _=require(_0xb50f('0x0'));var util=require(_0xb50f('0x1'));var moment=require(_0xb50f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb50f('0x3'));var fs=require('fs');var Redis=require(_0xb50f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb50f('0x5'));var logger=require(_0xb50f('0x6'))(_0xb50f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x331a42,_0x2331f4,_0x17384f){return new BPromise(function(_0xdb0c41,_0xedffc6){return client[_0xb50f('0x8')](_0x331a42,_0x17384f)[_0xb50f('0x9')](function(_0x36b224){logger[_0xb50f('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2331f4,'request\x20sent');logger[_0xb50f('0xb')](_0xb50f('0xc'),_0x2331f4,_0xb50f('0xd'),JSON[_0xb50f('0xe')](_0x36b224));if(_0x36b224['error']){if(_0x36b224['error']['code']===0x1f4){logger[_0xb50f('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2331f4,_0x36b224[_0xb50f('0xf')][_0xb50f('0x10')]);return _0xedffc6(_0x36b224['error'][_0xb50f('0x10')]);}logger[_0xb50f('0xf')](_0xb50f('0x11'),_0x2331f4,_0x36b224[_0xb50f('0xf')][_0xb50f('0x10')]);return _0xdb0c41(_0x36b224[_0xb50f('0xf')][_0xb50f('0x10')]);}else{logger[_0xb50f('0xa')](_0xb50f('0x11'),_0x2331f4,'request\x20sent');_0xdb0c41(_0x36b224[_0xb50f('0x12')][_0xb50f('0x10')]);}})[_0xb50f('0x13')](function(_0x165c48){logger[_0xb50f('0xf')](_0xb50f('0x11'),_0x2331f4,_0x165c48);_0xedffc6(_0x165c48);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 248a19d..ceda8bd 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 _0x6341=['index','show','post','create','/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x6341,0xa0));var _0x1634=function(_0x6361ae,_0x327fe2){_0x6361ae=_0x6361ae-0x0;var _0x300fde=_0x6341[_0x6361ae];return _0x300fde;};'use strict';var multer=require('multer');var util=require(_0x1634('0x0'));var path=require(_0x1634('0x1'));var timeout=require('connect-timeout');var express=require(_0x1634('0x2'));var router=express[_0x1634('0x3')]();var fs_extra=require(_0x1634('0x4'));var auth=require(_0x1634('0x5'));var interaction=require(_0x1634('0x6'));var config=require(_0x1634('0x7'));var controller=require(_0x1634('0x8'));router[_0x1634('0x9')]('/',auth[_0x1634('0xa')](),controller[_0x1634('0xb')]);router[_0x1634('0x9')]('/:id',auth[_0x1634('0xa')](),controller[_0x1634('0xc')]);router[_0x1634('0xd')]('/',auth['isAuthenticated'](),controller[_0x1634('0xe')]);router['put'](_0x1634('0xf'),auth['isAuthenticated'](),controller[_0x1634('0x10')]);router[_0x1634('0x11')]('/:id',auth[_0x1634('0xa')](),controller[_0x1634('0x12')]);module['exports']=router; \ No newline at end of file +var _0x956c=['update','delete','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','create','put'];(function(_0x4b5835,_0x46fc05){var _0x2e10c9=function(_0x18a70e){while(--_0x18a70e){_0x4b5835['push'](_0x4b5835['shift']());}};_0x2e10c9(++_0x46fc05);}(_0x956c,0x128));var _0xc956=function(_0x564b6e,_0x539879){_0x564b6e=_0x564b6e-0x0;var _0x48eb87=_0x956c[_0x564b6e];return _0x48eb87;};'use strict';var multer=require(_0xc956('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc956('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc956('0x2'));var interaction=require(_0xc956('0x3'));var config=require(_0xc956('0x4'));var controller=require(_0xc956('0x5'));router[_0xc956('0x6')]('/',auth['isAuthenticated'](),controller[_0xc956('0x7')]);router[_0xc956('0x6')](_0xc956('0x8'),auth[_0xc956('0x9')](),controller['show']);router['post']('/',auth[_0xc956('0x9')](),controller[_0xc956('0xa')]);router[_0xc956('0xb')](_0xc956('0x8'),auth[_0xc956('0x9')](),controller[_0xc956('0xc')]);router[_0xc956('0xd')]('/:id',auth[_0xc956('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index abdad55..179dd36 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 _0x9385=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist'];(function(_0x47cd42,_0x4f129e){var _0x9f7132=function(_0x5e8bff){while(--_0x5e8bff){_0x47cd42['push'](_0x47cd42['shift']());}};_0x9f7132(++_0x4f129e);}(_0x9385,0x111));var _0x5938=function(_0x4183ee,_0x43d0fb){_0x4183ee=_0x4183ee-0x0;var _0xfa8f02=_0x9385[_0x4183ee];return _0xfa8f02;};'use strict';var Sequelize=require(_0x5938('0x0'));module[_0x5938('0x1')]={'type':{'type':Sequelize[_0x5938('0x2')]('string',_0x5938('0x3'),_0x5938('0x4'),'keyValue',_0x5938('0x5')),'defaultValue':_0x5938('0x6')},'content':{'type':Sequelize[_0x5938('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5938('0x2')](_0x5938('0x6'),_0x5938('0x3'),_0x5938('0x4'))},'keyContent':{'type':Sequelize[_0x5938('0x7')]},'idField':{'type':Sequelize[_0x5938('0x7')]},'nameField':{'type':Sequelize[_0x5938('0x7')]},'customField':{'type':Sequelize[_0x5938('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5938('0x7')]}}; \ No newline at end of file +var _0x95a5=['string','variable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x95a5,0x1de));var _0x595a=function(_0x2eaf80,_0x1bfe87){_0x2eaf80=_0x2eaf80-0x0;var _0x39d77f=_0x95a5[_0x2eaf80];return _0x39d77f;};'use strict';var Sequelize=require('sequelize');module[_0x595a('0x0')]={'type':{'type':Sequelize[_0x595a('0x1')](_0x595a('0x2'),_0x595a('0x3'),'customVariable',_0x595a('0x4'),_0x595a('0x5')),'defaultValue':_0x595a('0x2')},'content':{'type':Sequelize[_0x595a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x595a('0x1')]('string',_0x595a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x595a('0x6')]},'idField':{'type':Sequelize[_0x595a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x595a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x595a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 23a1880..a70aa47 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 _0xcdad=['type','VIRTUAL','options','includeAll','include','rows','length','find','catch','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x4fa378,_0x4dc5b4){var _0x2b8dc7=function(_0x49dfc3){while(--_0x49dfc3){_0x4fa378['push'](_0x4fa378['shift']());}};_0x2b8dc7(++_0x4dc5b4);}(_0xcdad,0x175));var _0xdcda=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xcdad[_0x1347f8];return _0x218368;};'use strict';var emlformat=require(_0xdcda('0x0'));var rimraf=require(_0xdcda('0x1'));var zipdir=require(_0xdcda('0x2'));var jsonpatch=require(_0xdcda('0x3'));var rp=require(_0xdcda('0x4'));var moment=require(_0xdcda('0x5'));var BPromise=require(_0xdcda('0x6'));var Mustache=require(_0xdcda('0x7'));var util=require('util');var path=require(_0xdcda('0x8'));var sox=require(_0xdcda('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdcda('0xa'));var _=require('lodash');var squel=require(_0xdcda('0xb'));var crypto=require(_0xdcda('0xc'));var jsforce=require(_0xdcda('0xd'));var deskjs=require(_0xdcda('0xe'));var toCsv=require(_0xdcda('0xf'));var querystring=require(_0xdcda('0x10'));var Papa=require(_0xdcda('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdcda('0x12'));var hardwareService=require(_0xdcda('0x13'));var logger=require('../../config/logger')(_0xdcda('0x14'));var utils=require('../../config/utils');var config=require(_0xdcda('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcda('0x16'))['db'];function respondWithStatusCode(_0x4a9838,_0x55ee46){_0x55ee46=_0x55ee46||0xcc;return function(_0x6a081f){if(_0x6a081f){return _0x4a9838[_0xdcda('0x17')](_0x55ee46);}return _0x4a9838[_0xdcda('0x18')](_0x55ee46)[_0xdcda('0x19')]();};}function respondWithResult(_0x189afd,_0x58f9a9){_0x58f9a9=_0x58f9a9||0xc8;return function(_0x574ef0){if(_0x574ef0){return _0x189afd[_0xdcda('0x18')](_0x58f9a9)[_0xdcda('0x1a')](_0x574ef0);}};}function respondWithFilteredResult(_0x67f3c2,_0xdfa6d9){return function(_0x3af0b5){if(_0x3af0b5){var _0x42d4ec=typeof _0xdfa6d9[_0xdcda('0x1b')]===_0xdcda('0x1c')&&typeof _0xdfa6d9[_0xdcda('0x1d')]===_0xdcda('0x1c');var _0x6823d1=_0x3af0b5[_0xdcda('0x1e')];var _0x338213=_0x42d4ec?0x0:_0xdfa6d9['offset'];var _0x4dda19=_0x42d4ec?_0x3af0b5[_0xdcda('0x1e')]:_0xdfa6d9[_0xdcda('0x1b')]+_0xdfa6d9['limit'];var _0x320238;if(_0x4dda19>=_0x6823d1){_0x4dda19=_0x6823d1;_0x320238=0xc8;}else{_0x320238=0xce;}_0x67f3c2[_0xdcda('0x18')](_0x320238);return _0x67f3c2[_0xdcda('0x1f')](_0xdcda('0x20'),_0x338213+'-'+_0x4dda19+'/'+_0x6823d1)['json'](_0x3af0b5);}return null;};}function patchUpdates(_0x4ef8fb){return function(_0x5d0288){try{jsonpatch[_0xdcda('0x21')](_0x5d0288,_0x4ef8fb,!![]);}catch(_0x237b4f){return BPromise['reject'](_0x237b4f);}return _0x5d0288[_0xdcda('0x22')]();};}function saveUpdates(_0x328a59,_0x582ea5){return function(_0x37fb41){if(_0x37fb41){return _0x37fb41['update'](_0x328a59)[_0xdcda('0x23')](function(_0x5090bb){return _0x5090bb;});}return null;};}function removeEntity(_0x177f34,_0x590e6d){return function(_0x491843){if(_0x491843){return _0x491843['destroy']()['then'](function(){_0x177f34[_0xdcda('0x18')](0xcc)[_0xdcda('0x19')]();});}};}function handleEntityNotFound(_0x15a6f0,_0x4d4118){return function(_0x1b66e9){if(!_0x1b66e9){_0x15a6f0['sendStatus'](0x194);}return _0x1b66e9;};}function handleError(_0x6a4c02,_0x1028b0){_0x1028b0=_0x1028b0||0x1f4;return function(_0x142573){logger[_0xdcda('0x24')](_0x142573[_0xdcda('0x25')]);if(_0x142573[_0xdcda('0x26')]){delete _0x142573['name'];}_0x6a4c02[_0xdcda('0x18')](_0x1028b0)['send'](_0x142573);};}exports[_0xdcda('0x27')]=function(_0x3bd870,_0x27ec4e){var _0x2cedee={},_0x4540ba={},_0x3306dc={'count':0x0,'rows':[]};var _0x2decdc=_[_0xdcda('0x28')](db[_0xdcda('0x29')][_0xdcda('0x2a')],function(_0x54ae13){return{'name':_0x54ae13[_0xdcda('0x2b')],'type':_0x54ae13['type'][_0xdcda('0x2c')]};});_0x4540ba[_0xdcda('0x2d')]=_[_0xdcda('0x28')](_0x2decdc,_0xdcda('0x26'));_0x4540ba[_0xdcda('0x2e')]=_[_0xdcda('0x2f')](_0x3bd870['query']);_0x4540ba[_0xdcda('0x30')]=_['intersection'](_0x4540ba['model'],_0x4540ba[_0xdcda('0x2e')]);_0x2cedee['attributes']=_[_0xdcda('0x31')](_0x4540ba[_0xdcda('0x2d')],qs['fields'](_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x32')]));_0x2cedee[_0xdcda('0x33')]=_0x2cedee['attributes']['length']?_0x2cedee[_0xdcda('0x33')]:_0x4540ba[_0xdcda('0x2d')];if(!_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x34')](_0xdcda('0x35'))){_0x2cedee[_0xdcda('0x1d')]=qs[_0xdcda('0x1d')](_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x1d')]);_0x2cedee[_0xdcda('0x1b')]=qs[_0xdcda('0x1b')](_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x1b')]);}_0x2cedee[_0xdcda('0x36')]=qs['sort'](_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x37')]);_0x2cedee[_0xdcda('0x38')]=qs[_0xdcda('0x30')](_['pick'](_0x3bd870[_0xdcda('0x2e')],_0x4540ba[_0xdcda('0x30')]),_0x2decdc);if(_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x39')]){_0x2cedee[_0xdcda('0x38')]=_[_0xdcda('0x3a')](_0x2cedee[_0xdcda('0x38')],{'$or':_['map'](_0x2decdc,function(_0x5f3f03){if(_0x5f3f03[_0xdcda('0x3b')]!==_0xdcda('0x3c')){var _0x231d04={};_0x231d04[_0x5f3f03[_0xdcda('0x26')]]={'$like':'%'+_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x39')]+'%'};return _0x231d04;}})});}_0x2cedee=_['merge']({},_0x2cedee,_0x3bd870[_0xdcda('0x3d')]);var _0xa20cf1={'where':_0x2cedee[_0xdcda('0x38')]};return db[_0xdcda('0x29')][_0xdcda('0x1e')](_0xa20cf1)[_0xdcda('0x23')](function(_0x333433){_0x3306dc[_0xdcda('0x1e')]=_0x333433;if(_0x3bd870[_0xdcda('0x2e')][_0xdcda('0x3e')]){_0x2cedee[_0xdcda('0x3f')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x2cedee);})[_0xdcda('0x23')](function(_0x2c298d){_0x3306dc[_0xdcda('0x40')]=_0x2c298d;return _0x3306dc;})[_0xdcda('0x23')](respondWithFilteredResult(_0x27ec4e,_0x2cedee))['catch'](handleError(_0x27ec4e,null));};exports['show']=function(_0x4a9293,_0x51bfc8){var _0x41d019={'raw':!![],'where':{'id':_0x4a9293['params']['id']}},_0x8a1943={};_0x8a1943[_0xdcda('0x2d')]=_['keys'](db['ZendeskField'][_0xdcda('0x2a')]);_0x8a1943[_0xdcda('0x2e')]=_[_0xdcda('0x2f')](_0x4a9293['query']);_0x8a1943[_0xdcda('0x30')]=_[_0xdcda('0x31')](_0x8a1943[_0xdcda('0x2d')],_0x8a1943[_0xdcda('0x2e')]);_0x41d019[_0xdcda('0x33')]=_[_0xdcda('0x31')](_0x8a1943['model'],qs[_0xdcda('0x32')](_0x4a9293[_0xdcda('0x2e')][_0xdcda('0x32')]));_0x41d019[_0xdcda('0x33')]=_0x41d019['attributes'][_0xdcda('0x41')]?_0x41d019[_0xdcda('0x33')]:_0x8a1943[_0xdcda('0x2d')];if(_0x4a9293[_0xdcda('0x2e')][_0xdcda('0x3e')]){_0x41d019[_0xdcda('0x3f')]=[{'all':!![]}];}_0x41d019=_['merge']({},_0x41d019,_0x4a9293[_0xdcda('0x3d')]);return db[_0xdcda('0x29')][_0xdcda('0x42')](_0x41d019)[_0xdcda('0x23')](handleEntityNotFound(_0x51bfc8,null))[_0xdcda('0x23')](respondWithResult(_0x51bfc8,null))[_0xdcda('0x43')](handleError(_0x51bfc8,null));};exports[_0xdcda('0x44')]=function(_0x3a7e9b,_0x42212c){return db[_0xdcda('0x29')][_0xdcda('0x44')](_0x3a7e9b[_0xdcda('0x45')],{})[_0xdcda('0x23')](respondWithResult(_0x42212c,0xc9))[_0xdcda('0x43')](handleError(_0x42212c,null));};exports['update']=function(_0x4f1433,_0x15cd68){if(_0x4f1433[_0xdcda('0x45')]['id']){delete _0x4f1433[_0xdcda('0x45')]['id'];}return db['ZendeskField'][_0xdcda('0x42')]({'where':{'id':_0x4f1433['params']['id']}})[_0xdcda('0x23')](handleEntityNotFound(_0x15cd68,null))['then'](saveUpdates(_0x4f1433[_0xdcda('0x45')],null))[_0xdcda('0x23')](respondWithResult(_0x15cd68,null))[_0xdcda('0x43')](handleError(_0x15cd68,null));};exports[_0xdcda('0x46')]=function(_0x429d8a,_0x9b04b8){return db[_0xdcda('0x29')]['find']({'where':{'id':_0x429d8a[_0xdcda('0x47')]['id']}})[_0xdcda('0x23')](handleEntityNotFound(_0x9b04b8,null))[_0xdcda('0x23')](removeEntity(_0x9b04b8,null))['catch'](handleError(_0x9b04b8,null));}; \ No newline at end of file +var _0xd89a=['map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','fields','find','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model'];(function(_0xae58e4,_0x3b1f71){var _0x5ab5ea=function(_0x3b1f8e){while(--_0x3b1f8e){_0xae58e4['push'](_0xae58e4['shift']());}};_0x5ab5ea(++_0x3b1f71);}(_0xd89a,0x6b));var _0xad89=function(_0x54d0b1,_0x1abf62){_0x54d0b1=_0x54d0b1-0x0;var _0x26a67c=_0xd89a[_0x54d0b1];return _0x26a67c;};'use strict';var emlformat=require(_0xad89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad89('0x1'));var jsonpatch=require(_0xad89('0x2'));var rp=require(_0xad89('0x3'));var moment=require('moment');var BPromise=require(_0xad89('0x4'));var Mustache=require(_0xad89('0x5'));var util=require('util');var path=require(_0xad89('0x6'));var sox=require(_0xad89('0x7'));var csv=require(_0xad89('0x8'));var ejs=require(_0xad89('0x9'));var fs=require('fs');var fs_extra=require(_0xad89('0xa'));var _=require(_0xad89('0xb'));var squel=require('squel');var crypto=require(_0xad89('0xc'));var jsforce=require(_0xad89('0xd'));var deskjs=require(_0xad89('0xe'));var toCsv=require(_0xad89('0x8'));var querystring=require(_0xad89('0xf'));var Papa=require(_0xad89('0x10'));var Redis=require(_0xad89('0x11'));var authService=require(_0xad89('0x12'));var qs=require(_0xad89('0x13'));var as=require(_0xad89('0x14'));var hardwareService=require(_0xad89('0x15'));var logger=require(_0xad89('0x16'))(_0xad89('0x17'));var utils=require(_0xad89('0x18'));var config=require(_0xad89('0x19'));var licenseUtil=require(_0xad89('0x1a'));var db=require(_0xad89('0x1b'))['db'];function respondWithStatusCode(_0x566dd0,_0x2a183f){_0x2a183f=_0x2a183f||0xcc;return function(_0x5ed58e){if(_0x5ed58e){return _0x566dd0[_0xad89('0x1c')](_0x2a183f);}return _0x566dd0['status'](_0x2a183f)['end']();};}function respondWithResult(_0x36877b,_0x3e939f){_0x3e939f=_0x3e939f||0xc8;return function(_0x2d117c){if(_0x2d117c){return _0x36877b[_0xad89('0x1d')](_0x3e939f)[_0xad89('0x1e')](_0x2d117c);}};}function respondWithFilteredResult(_0x48eeb3,_0xf70bc9){return function(_0x5b59e9){if(_0x5b59e9){var _0x40080a=typeof _0xf70bc9[_0xad89('0x1f')]===_0xad89('0x20')&&typeof _0xf70bc9[_0xad89('0x21')]===_0xad89('0x20');var _0x1e8222=_0x5b59e9[_0xad89('0x22')];var _0x2f2d27=_0x40080a?0x0:_0xf70bc9[_0xad89('0x1f')];var _0x443061=_0x40080a?_0x5b59e9['count']:_0xf70bc9[_0xad89('0x1f')]+_0xf70bc9[_0xad89('0x21')];var _0x3db469;if(_0x443061>=_0x1e8222){_0x443061=_0x1e8222;_0x3db469=0xc8;}else{_0x3db469=0xce;}_0x48eeb3[_0xad89('0x1d')](_0x3db469);return _0x48eeb3[_0xad89('0x23')](_0xad89('0x24'),_0x2f2d27+'-'+_0x443061+'/'+_0x1e8222)['json'](_0x5b59e9);}return null;};}function patchUpdates(_0x2196c4){return function(_0x258939){try{jsonpatch[_0xad89('0x25')](_0x258939,_0x2196c4,!![]);}catch(_0x2aa575){return BPromise[_0xad89('0x26')](_0x2aa575);}return _0x258939['save']();};}function saveUpdates(_0x26722c,_0x4d8de1){return function(_0xae35b1){if(_0xae35b1){return _0xae35b1['update'](_0x26722c)[_0xad89('0x27')](function(_0x17bdb7){return _0x17bdb7;});}return null;};}function removeEntity(_0x3ed5fe,_0x5429a6){return function(_0x1718af){if(_0x1718af){return _0x1718af[_0xad89('0x28')]()[_0xad89('0x27')](function(){_0x3ed5fe[_0xad89('0x1d')](0xcc)[_0xad89('0x29')]();});}};}function handleEntityNotFound(_0x32eca3,_0x39eca3){return function(_0x2bc22c){if(!_0x2bc22c){_0x32eca3[_0xad89('0x1c')](0x194);}return _0x2bc22c;};}function handleError(_0x1aeba5,_0x3fa578){_0x3fa578=_0x3fa578||0x1f4;return function(_0x3584dd){logger[_0xad89('0x2a')](_0x3584dd[_0xad89('0x2b')]);if(_0x3584dd[_0xad89('0x2c')]){delete _0x3584dd[_0xad89('0x2c')];}_0x1aeba5[_0xad89('0x1d')](_0x3fa578)[_0xad89('0x2d')](_0x3584dd);};}exports[_0xad89('0x2e')]=function(_0x818f57,_0x27923f){var _0x431c34={},_0x1b234a={},_0x3d5250={'count':0x0,'rows':[]};var _0x109d7e=_['map'](db[_0xad89('0x2f')][_0xad89('0x30')],function(_0x23ed7b){return{'name':_0x23ed7b[_0xad89('0x31')],'type':_0x23ed7b[_0xad89('0x32')][_0xad89('0x33')]};});_0x1b234a[_0xad89('0x34')]=_[_0xad89('0x35')](_0x109d7e,_0xad89('0x2c'));_0x1b234a[_0xad89('0x36')]=_['keys'](_0x818f57[_0xad89('0x36')]);_0x1b234a[_0xad89('0x37')]=_[_0xad89('0x38')](_0x1b234a[_0xad89('0x34')],_0x1b234a[_0xad89('0x36')]);_0x431c34['attributes']=_['intersection'](_0x1b234a['model'],qs['fields'](_0x818f57[_0xad89('0x36')]['fields']));_0x431c34[_0xad89('0x39')]=_0x431c34[_0xad89('0x39')][_0xad89('0x3a')]?_0x431c34[_0xad89('0x39')]:_0x1b234a['model'];if(!_0x818f57[_0xad89('0x36')][_0xad89('0x3b')]('nolimit')){_0x431c34['limit']=qs[_0xad89('0x21')](_0x818f57[_0xad89('0x36')][_0xad89('0x21')]);_0x431c34[_0xad89('0x1f')]=qs[_0xad89('0x1f')](_0x818f57[_0xad89('0x36')]['offset']);}_0x431c34[_0xad89('0x3c')]=qs[_0xad89('0x3d')](_0x818f57[_0xad89('0x36')]['sort']);_0x431c34['where']=qs[_0xad89('0x37')](_[_0xad89('0x3e')](_0x818f57['query'],_0x1b234a[_0xad89('0x37')]),_0x109d7e);if(_0x818f57[_0xad89('0x36')][_0xad89('0x3f')]){_0x431c34[_0xad89('0x40')]=_[_0xad89('0x41')](_0x431c34[_0xad89('0x40')],{'$or':_[_0xad89('0x35')](_0x109d7e,function(_0x39c411){if(_0x39c411[_0xad89('0x32')]!==_0xad89('0x42')){var _0xc4e4a2={};_0xc4e4a2[_0x39c411['name']]={'$like':'%'+_0x818f57[_0xad89('0x36')][_0xad89('0x3f')]+'%'};return _0xc4e4a2;}})});}_0x431c34=_[_0xad89('0x41')]({},_0x431c34,_0x818f57[_0xad89('0x43')]);var _0x1aef20={'where':_0x431c34['where']};return db[_0xad89('0x2f')][_0xad89('0x22')](_0x1aef20)[_0xad89('0x27')](function(_0x291b19){_0x3d5250[_0xad89('0x22')]=_0x291b19;if(_0x818f57[_0xad89('0x36')][_0xad89('0x44')]){_0x431c34[_0xad89('0x45')]=[{'all':!![]}];}return db[_0xad89('0x2f')][_0xad89('0x46')](_0x431c34);})['then'](function(_0x4b2796){_0x3d5250[_0xad89('0x47')]=_0x4b2796;return _0x3d5250;})[_0xad89('0x27')](respondWithFilteredResult(_0x27923f,_0x431c34))[_0xad89('0x48')](handleError(_0x27923f,null));};exports['show']=function(_0x7a92e9,_0x3c4d54){var _0x5bb6f9={'raw':!![],'where':{'id':_0x7a92e9['params']['id']}},_0x1a1975={};_0x1a1975[_0xad89('0x34')]=_[_0xad89('0x49')](db[_0xad89('0x2f')][_0xad89('0x30')]);_0x1a1975[_0xad89('0x36')]=_['keys'](_0x7a92e9[_0xad89('0x36')]);_0x1a1975[_0xad89('0x37')]=_[_0xad89('0x38')](_0x1a1975['model'],_0x1a1975[_0xad89('0x36')]);_0x5bb6f9[_0xad89('0x39')]=_[_0xad89('0x38')](_0x1a1975['model'],qs[_0xad89('0x4a')](_0x7a92e9[_0xad89('0x36')][_0xad89('0x4a')]));_0x5bb6f9[_0xad89('0x39')]=_0x5bb6f9[_0xad89('0x39')]['length']?_0x5bb6f9[_0xad89('0x39')]:_0x1a1975[_0xad89('0x34')];if(_0x7a92e9[_0xad89('0x36')][_0xad89('0x44')]){_0x5bb6f9[_0xad89('0x45')]=[{'all':!![]}];}_0x5bb6f9=_[_0xad89('0x41')]({},_0x5bb6f9,_0x7a92e9[_0xad89('0x43')]);return db['ZendeskField'][_0xad89('0x4b')](_0x5bb6f9)[_0xad89('0x27')](handleEntityNotFound(_0x3c4d54,null))['then'](respondWithResult(_0x3c4d54,null))[_0xad89('0x48')](handleError(_0x3c4d54,null));};exports[_0xad89('0x4c')]=function(_0x2fc65c,_0x24c3a8){return db[_0xad89('0x2f')][_0xad89('0x4c')](_0x2fc65c[_0xad89('0x4d')],{})[_0xad89('0x27')](respondWithResult(_0x24c3a8,0xc9))['catch'](handleError(_0x24c3a8,null));};exports[_0xad89('0x4e')]=function(_0x21423c,_0x5a8906){if(_0x21423c[_0xad89('0x4d')]['id']){delete _0x21423c[_0xad89('0x4d')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x21423c['params']['id']}})['then'](handleEntityNotFound(_0x5a8906,null))[_0xad89('0x27')](saveUpdates(_0x21423c['body'],null))['then'](respondWithResult(_0x5a8906,null))[_0xad89('0x48')](handleError(_0x5a8906,null));};exports[_0xad89('0x28')]=function(_0x1820c3,_0x18197b){return db['ZendeskField']['find']({'where':{'id':_0x1820c3[_0xad89('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18197b,null))[_0xad89('0x27')](removeEntity(_0x18197b,null))[_0xad89('0x48')](handleError(_0x18197b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 2a3bc45..5b9a09d 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 _0xf653=['./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x38b348,_0xb807b3){var _0x4a21ff=function(_0x3fbb64){while(--_0x3fbb64){_0x38b348['push'](_0x38b348['shift']());}};_0x4a21ff(++_0xb807b3);}(_0xf653,0x177));var _0x3f65=function(_0x3a4294,_0x5b8ad3){_0x3a4294=_0x3a4294-0x0;var _0x326da8=_0xf653[_0x3a4294];return _0x326da8;};'use strict';var _=require(_0x3f65('0x0'));var util=require(_0x3f65('0x1'));var logger=require(_0x3f65('0x2'))(_0x3f65('0x3'));var moment=require(_0x3f65('0x4'));var BPromise=require(_0x3f65('0x5'));var rp=require(_0x3f65('0x6'));var fs=require('fs');var path=require(_0x3f65('0x7'));var rimraf=require(_0x3f65('0x8'));var config=require('../../config/environment');var attributes=require(_0x3f65('0x9'));module[_0x3f65('0xa')]=function(_0x4d85bb,_0xe06798){return _0x4d85bb[_0x3f65('0xb')](_0x3f65('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x3f65('0xd'),'fields':[_0x3f65('0xe'),_0x3f65('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb174=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','api','moment'];(function(_0x12ee87,_0x228c39){var _0x47baa4=function(_0xc695ee){while(--_0xc695ee){_0x12ee87['push'](_0x12ee87['shift']());}};_0x47baa4(++_0x228c39);}(_0xb174,0xec));var _0x4b17=function(_0x461adf,_0x4c4a66){_0x461adf=_0x461adf-0x0;var _0x3e2cf4=_0xb174[_0x461adf];return _0x3e2cf4;};'use strict';var _=require(_0x4b17('0x0'));var util=require(_0x4b17('0x1'));var logger=require('../../config/logger')(_0x4b17('0x2'));var moment=require(_0x4b17('0x3'));var BPromise=require(_0x4b17('0x4'));var rp=require(_0x4b17('0x5'));var fs=require('fs');var path=require(_0x4b17('0x6'));var rimraf=require(_0x4b17('0x7'));var config=require(_0x4b17('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x4b17('0x9')]=function(_0x1f6b81,_0x555625){return _0x1f6b81[_0x4b17('0xa')](_0x4b17('0xb'),attributes,{'tableName':_0x4b17('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x4b17('0xd'),_0x4b17('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 37ab664..1f41e8c 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 _0x3789=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x57c40b,_0x10d1bf){var _0x6b3de0=function(_0x3f4a28){while(--_0x3f4a28){_0x57c40b['push'](_0x57c40b['shift']());}};_0x6b3de0(++_0x10d1bf);}(_0x3789,0x1f0));var _0x9378=function(_0x203c0b,_0x2589d7){_0x203c0b=_0x203c0b-0x0;var _0x2af9d3=_0x3789[_0x203c0b];return _0x2af9d3;};'use strict';var _=require(_0x9378('0x0'));var util=require('util');var moment=require(_0x9378('0x1'));var BPromise=require(_0x9378('0x2'));var rs=require(_0x9378('0x3'));var fs=require('fs');var Redis=require(_0x9378('0x4'));var db=require(_0x9378('0x5'))['db'];var utils=require(_0x9378('0x6'));var logger=require(_0x9378('0x7'))(_0x9378('0x8'));var config=require(_0x9378('0x9'));var jayson=require(_0x9378('0xa'));var client=jayson[_0x9378('0xb')][_0x9378('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40c31c,_0x9fe920,_0x26e9c4){return new BPromise(function(_0x3624bf,_0x26365a){return client[_0x9378('0xd')](_0x40c31c,_0x26e9c4)[_0x9378('0xe')](function(_0x5d0593){logger[_0x9378('0xf')](_0x9378('0x10'),_0x9fe920,_0x9378('0x11'));logger[_0x9378('0x12')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x9fe920,'request\x20sent',JSON[_0x9378('0x13')](_0x5d0593));if(_0x5d0593[_0x9378('0x14')]){if(_0x5d0593[_0x9378('0x14')]['code']===0x1f4){logger[_0x9378('0x14')](_0x9378('0x10'),_0x9fe920,_0x5d0593[_0x9378('0x14')]['message']);return _0x26365a(_0x5d0593[_0x9378('0x14')][_0x9378('0x15')]);}logger[_0x9378('0x14')]('ZendeskField,\x20%s,\x20%s',_0x9fe920,_0x5d0593[_0x9378('0x14')][_0x9378('0x15')]);return _0x3624bf(_0x5d0593['error']['message']);}else{logger['info'](_0x9378('0x10'),_0x9fe920,_0x9378('0x11'));_0x3624bf(_0x5d0593[_0x9378('0x16')][_0x9378('0x15')]);}})[_0x9378('0x17')](function(_0x2cc1ba){logger['error'](_0x9378('0x10'),_0x9fe920,_0x2cc1ba);_0x26365a(_0x2cc1ba);});});} \ No newline at end of file +var _0xbf05=['then','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2988e2,_0x554c01){var _0x36ff19=function(_0x201a4e){while(--_0x201a4e){_0x2988e2['push'](_0x2988e2['shift']());}};_0x36ff19(++_0x554c01);}(_0xbf05,0x1c2));var _0x5bf0=function(_0x5af1c0,_0x1c283b){_0x5af1c0=_0x5af1c0-0x0;var _0x2792a6=_0xbf05[_0x5af1c0];return _0x2792a6;};'use strict';var _=require('lodash');var util=require(_0x5bf0('0x0'));var moment=require(_0x5bf0('0x1'));var BPromise=require(_0x5bf0('0x2'));var rs=require(_0x5bf0('0x3'));var fs=require('fs');var Redis=require(_0x5bf0('0x4'));var db=require(_0x5bf0('0x5'))['db'];var utils=require(_0x5bf0('0x6'));var logger=require(_0x5bf0('0x7'))(_0x5bf0('0x8'));var config=require(_0x5bf0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5bf0('0xa')][_0x5bf0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e8f97,_0x14acf4,_0x47b6f){return new BPromise(function(_0x570328,_0x3f6b4a){return client['request'](_0x1e8f97,_0x47b6f)[_0x5bf0('0xc')](function(_0xd9e51e){logger['info'](_0x5bf0('0xd'),_0x14acf4,_0x5bf0('0xe'));logger['debug'](_0x5bf0('0xf'),_0x14acf4,_0x5bf0('0xe'),JSON[_0x5bf0('0x10')](_0xd9e51e));if(_0xd9e51e[_0x5bf0('0x11')]){if(_0xd9e51e[_0x5bf0('0x11')][_0x5bf0('0x12')]===0x1f4){logger[_0x5bf0('0x11')](_0x5bf0('0xd'),_0x14acf4,_0xd9e51e[_0x5bf0('0x11')]['message']);return _0x3f6b4a(_0xd9e51e[_0x5bf0('0x11')][_0x5bf0('0x13')]);}logger[_0x5bf0('0x11')](_0x5bf0('0xd'),_0x14acf4,_0xd9e51e['error'][_0x5bf0('0x13')]);return _0x570328(_0xd9e51e[_0x5bf0('0x11')]['message']);}else{logger['info'](_0x5bf0('0xd'),_0x14acf4,_0x5bf0('0xe'));_0x570328(_0xd9e51e[_0x5bf0('0x14')][_0x5bf0('0x13')]);}})[_0x5bf0('0x15')](function(_0x45301a){logger[_0x5bf0('0x11')](_0x5bf0('0xd'),_0x14acf4,_0x45301a);_0x3f6b4a(_0x45301a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f457e26..1bd207c 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 _0x5db2=['../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x20203a,_0x51b253){var _0x7e4f44=function(_0x3214e3){while(--_0x3214e3){_0x20203a['push'](_0x20203a['shift']());}};_0x7e4f44(++_0x51b253);}(_0x5db2,0xf3));var _0x25db=function(_0x215231,_0x2b80cf){_0x215231=_0x215231-0x0;var _0x9361c9=_0x5db2[_0x215231];return _0x9361c9;};'use strict';var multer=require(_0x25db('0x0'));var util=require(_0x25db('0x1'));var path=require(_0x25db('0x2'));var timeout=require('connect-timeout');var express=require(_0x25db('0x3'));var router=express[_0x25db('0x4')]();var fs_extra=require(_0x25db('0x5'));var auth=require(_0x25db('0x6'));var interaction=require(_0x25db('0x7'));var config=require(_0x25db('0x8'));var controller=require(_0x25db('0x9'));router[_0x25db('0xa')]('/',auth[_0x25db('0xb')](),controller[_0x25db('0xc')]);router['get'](_0x25db('0xd'),auth[_0x25db('0xb')](),controller[_0x25db('0xe')]);router[_0x25db('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x25db('0xf')]);router[_0x25db('0xa')](_0x25db('0x10'),auth[_0x25db('0xb')](),controller[_0x25db('0x11')]);router[_0x25db('0x12')]('/',auth[_0x25db('0xb')](),controller[_0x25db('0x13')]);router[_0x25db('0x12')](_0x25db('0x14'),auth[_0x25db('0xb')](),controller[_0x25db('0x15')]);router['put'](_0x25db('0xd'),auth[_0x25db('0xb')](),controller[_0x25db('0x16')]);router['delete'](_0x25db('0xd'),auth[_0x25db('0xb')](),controller[_0x25db('0x17')]);module[_0x25db('0x18')]=router; \ No newline at end of file +var _0x01f2=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x21f4ec,_0x10230a){var _0x8b6a3f=function(_0x12123e){while(--_0x12123e){_0x21f4ec['push'](_0x21f4ec['shift']());}};_0x8b6a3f(++_0x10230a);}(_0x01f2,0xad));var _0x201f=function(_0x243eca,_0x5e775e){_0x243eca=_0x243eca-0x0;var _0x11ce5a=_0x01f2[_0x243eca];return _0x11ce5a;};'use strict';var multer=require(_0x201f('0x0'));var util=require(_0x201f('0x1'));var path=require(_0x201f('0x2'));var timeout=require(_0x201f('0x3'));var express=require(_0x201f('0x4'));var router=express[_0x201f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x201f('0x6'));var interaction=require(_0x201f('0x7'));var config=require(_0x201f('0x8'));var controller=require(_0x201f('0x9'));router[_0x201f('0xa')]('/',auth[_0x201f('0xb')](),controller[_0x201f('0xc')]);router[_0x201f('0xa')](_0x201f('0xd'),auth[_0x201f('0xb')](),controller[_0x201f('0xe')]);router[_0x201f('0xa')](_0x201f('0xf'),auth[_0x201f('0xb')](),controller[_0x201f('0x10')]);router['get'](_0x201f('0x11'),auth['isAuthenticated'](),controller[_0x201f('0x12')]);router['post']('/',auth[_0x201f('0xb')](),controller[_0x201f('0x13')]);router[_0x201f('0x14')](_0x201f('0xf'),auth[_0x201f('0xb')](),controller[_0x201f('0x15')]);router[_0x201f('0x16')]('/:id',auth[_0x201f('0xb')](),controller[_0x201f('0x17')]);router[_0x201f('0x18')](_0x201f('0xd'),auth[_0x201f('0xb')](),controller[_0x201f('0x19')]);module[_0x201f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 5b7c2f1..668270f 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 _0x5636=['sequelize','exports','STRING'];(function(_0x18b452,_0x12b82f){var _0x3d0225=function(_0x1ce71c){while(--_0x1ce71c){_0x18b452['push'](_0x18b452['shift']());}};_0x3d0225(++_0x12b82f);}(_0x5636,0x102));var _0x6563=function(_0x4de45c,_0xe18381){_0x4de45c=_0x4de45c-0x0;var _0x65b96f=_0x5636[_0x4de45c];return _0x65b96f;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x6563('0x2')]},'clientId':{'type':Sequelize[_0x6563('0x2')]},'clientSecret':{'type':Sequelize[_0x6563('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x6563('0x2')]},'refreshToken':{'type':Sequelize[_0x6563('0x2')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','sequelize'];(function(_0x568d66,_0xbb1827){var _0x52270c=function(_0x375b1f){while(--_0x375b1f){_0x568d66['push'](_0x568d66['shift']());}};_0x52270c(++_0xbb1827);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4ef826,_0x2e0ac8){_0x4ef826=_0x4ef826-0x0;var _0x154b8=_0xf3cd[_0x4ef826];return _0x154b8;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'name':{'type':Sequelize[_0xdf3c('0x2')]},'description':{'type':Sequelize[_0xdf3c('0x2')]},'host':{'type':Sequelize[_0xdf3c('0x2')]},'zone':{'type':Sequelize[_0xdf3c('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdf3c('0x2')]},'serverUrl':{'type':Sequelize[_0xdf3c('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xdf3c('0x2')]},'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 baccea5..a9d8675 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 _0x441b=['clientId','clientSecret','access_token','getFields','host','serverUrl','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','display_label','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','rows','params','intersection','find','catch','create','body','getConfigurations','ZohoConfiguration','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x441b,0xa2));var _0xb441=function(_0x3d1e90,_0x33e6bd){_0x3d1e90=_0x3d1e90-0x0;var _0x49ccc2=_0x441b[_0x3d1e90];return _0x49ccc2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb441('0x0'));var jsonpatch=require(_0xb441('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb441('0x2'));var Mustache=require(_0xb441('0x3'));var util=require(_0xb441('0x4'));var path=require(_0xb441('0x5'));var sox=require(_0xb441('0x6'));var csv=require(_0xb441('0x7'));var ejs=require(_0xb441('0x8'));var fs=require('fs');var fs_extra=require(_0xb441('0x9'));var _=require(_0xb441('0xa'));var squel=require('squel');var crypto=require(_0xb441('0xb'));var jsforce=require(_0xb441('0xc'));var deskjs=require(_0xb441('0xd'));var toCsv=require(_0xb441('0x7'));var querystring=require(_0xb441('0xe'));var Papa=require(_0xb441('0xf'));var Redis=require(_0xb441('0x10'));var authService=require(_0xb441('0x11'));var qs=require(_0xb441('0x12'));var as=require(_0xb441('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb441('0x14'))(_0xb441('0x15'));var utils=require('../../config/utils');var config=require(_0xb441('0x16'));var licenseUtil=require(_0xb441('0x17'));var db=require(_0xb441('0x18'))['db'];var integrations=require(_0xb441('0x19'));function respondWithStatusCode(_0x1dfa60,_0x427cbb){_0x427cbb=_0x427cbb||0xcc;return function(_0x4449a3){if(_0x4449a3){return _0x1dfa60[_0xb441('0x1a')](_0x427cbb);}return _0x1dfa60[_0xb441('0x1b')](_0x427cbb)['end']();};}function respondWithResult(_0x2bef01,_0x5ca983){_0x5ca983=_0x5ca983||0xc8;return function(_0x28c0ef){if(_0x28c0ef){return _0x2bef01[_0xb441('0x1b')](_0x5ca983)[_0xb441('0x1c')](_0x28c0ef);}};}function respondWithFilteredResult(_0x528703,_0x20e2c0){return function(_0x6b7cf){if(_0x6b7cf){var _0x3dc135=typeof _0x20e2c0['offset']===_0xb441('0x1d')&&typeof _0x20e2c0[_0xb441('0x1e')]===_0xb441('0x1d');var _0x72f3b=_0x6b7cf[_0xb441('0x1f')];var _0x1eb812=_0x3dc135?0x0:_0x20e2c0[_0xb441('0x20')];var _0x3a5bcd=_0x3dc135?_0x6b7cf[_0xb441('0x1f')]:_0x20e2c0[_0xb441('0x20')]+_0x20e2c0[_0xb441('0x1e')];var _0x9ff992;if(_0x3a5bcd>=_0x72f3b){_0x3a5bcd=_0x72f3b;_0x9ff992=0xc8;}else{_0x9ff992=0xce;}_0x528703['status'](_0x9ff992);return _0x528703['set'](_0xb441('0x21'),_0x1eb812+'-'+_0x3a5bcd+'/'+_0x72f3b)[_0xb441('0x1c')](_0x6b7cf);}return null;};}function patchUpdates(_0x35c873){return function(_0x1228be){try{jsonpatch['apply'](_0x1228be,_0x35c873,!![]);}catch(_0x55d79c){return BPromise[_0xb441('0x22')](_0x55d79c);}return _0x1228be[_0xb441('0x23')]();};}function saveUpdates(_0x272482,_0x1d8ac3){return function(_0x394886){if(_0x394886){return _0x394886[_0xb441('0x24')](_0x272482)[_0xb441('0x25')](function(_0x468851){return _0x468851;});}return null;};}function removeEntity(_0xa4b36a,_0x39e89c){return function(_0x3b7529){if(_0x3b7529){return _0x3b7529[_0xb441('0x26')]()[_0xb441('0x25')](function(){_0xa4b36a[_0xb441('0x1b')](0xcc)[_0xb441('0x27')]();});}};}function handleEntityNotFound(_0x42d641,_0x49b734){return function(_0x1abd97){if(!_0x1abd97){_0x42d641[_0xb441('0x1a')](0x194);}return _0x1abd97;};}function handleError(_0x256149,_0x469bbf){_0x469bbf=_0x469bbf||0x1f4;return function(_0x2484c5){logger[_0xb441('0x28')](_0x2484c5[_0xb441('0x29')]);if(_0x2484c5[_0xb441('0x2a')]){delete _0x2484c5[_0xb441('0x2a')];}_0x256149['status'](_0x469bbf)['send'](_0x2484c5);};}exports[_0xb441('0x2b')]=function(_0x386215,_0x3c0c5a){var _0xf04d54={},_0x1912b5={},_0x222755={'count':0x0,'rows':[]};var _0x22b7f7=_[_0xb441('0x2c')](db['ZohoAccount'][_0xb441('0x2d')],function(_0x3b7b8c){return{'name':_0x3b7b8c[_0xb441('0x2e')],'type':_0x3b7b8c[_0xb441('0x2f')][_0xb441('0x30')]};});_0x1912b5[_0xb441('0x31')]=_[_0xb441('0x2c')](_0x22b7f7,_0xb441('0x2a'));_0x1912b5['query']=_[_0xb441('0x32')](_0x386215[_0xb441('0x33')]);_0x1912b5['filters']=_['intersection'](_0x1912b5[_0xb441('0x31')],_0x1912b5[_0xb441('0x33')]);_0xf04d54[_0xb441('0x34')]=_['intersection'](_0x1912b5[_0xb441('0x31')],qs[_0xb441('0x35')](_0x386215[_0xb441('0x33')][_0xb441('0x35')]));_0xf04d54[_0xb441('0x34')]=_0xf04d54['attributes'][_0xb441('0x36')]?_0xf04d54[_0xb441('0x34')]:_0x1912b5['model'];if(!_0x386215[_0xb441('0x33')][_0xb441('0x37')]('nolimit')){_0xf04d54[_0xb441('0x1e')]=qs['limit'](_0x386215['query'][_0xb441('0x1e')]);_0xf04d54[_0xb441('0x20')]=qs[_0xb441('0x20')](_0x386215[_0xb441('0x33')][_0xb441('0x20')]);}_0xf04d54['order']=qs[_0xb441('0x38')](_0x386215[_0xb441('0x33')][_0xb441('0x38')]);_0xf04d54[_0xb441('0x39')]=qs[_0xb441('0x3a')](_['pick'](_0x386215['query'],_0x1912b5[_0xb441('0x3a')]),_0x22b7f7);if(_0x386215[_0xb441('0x33')][_0xb441('0x3b')]){_0xf04d54[_0xb441('0x39')]=_[_0xb441('0x3c')](_0xf04d54['where'],{'$or':_[_0xb441('0x2c')](_0x22b7f7,function(_0x39d8a4){if(_0x39d8a4[_0xb441('0x2f')]!==_0xb441('0x3d')){var _0x332f39={};_0x332f39[_0x39d8a4[_0xb441('0x2a')]]={'$like':'%'+_0x386215[_0xb441('0x33')][_0xb441('0x3b')]+'%'};return _0x332f39;}})});}_0xf04d54=_['merge']({},_0xf04d54,_0x386215[_0xb441('0x3e')]);var _0x4c227c={'where':_0xf04d54[_0xb441('0x39')]};return db[_0xb441('0x3f')][_0xb441('0x1f')](_0x4c227c)[_0xb441('0x25')](function(_0xfa8f7b){_0x222755[_0xb441('0x1f')]=_0xfa8f7b;if(_0x386215[_0xb441('0x33')][_0xb441('0x40')]){_0xf04d54[_0xb441('0x41')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0xf04d54);})[_0xb441('0x25')](function(_0x4d6fc0){_0x222755[_0xb441('0x42')]=_0x4d6fc0;return _0x222755;})[_0xb441('0x25')](respondWithFilteredResult(_0x3c0c5a,_0xf04d54))['catch'](handleError(_0x3c0c5a,null));};exports['show']=function(_0x44999a,_0x5b0f4b){var _0x2bbabf={'raw':![],'where':{'id':_0x44999a[_0xb441('0x43')]['id']}},_0x4157f3={};_0x4157f3[_0xb441('0x31')]=_[_0xb441('0x32')](db[_0xb441('0x3f')][_0xb441('0x2d')]);_0x4157f3[_0xb441('0x33')]=_['keys'](_0x44999a[_0xb441('0x33')]);_0x4157f3[_0xb441('0x3a')]=_['intersection'](_0x4157f3['model'],_0x4157f3['query']);_0x2bbabf[_0xb441('0x34')]=_[_0xb441('0x44')](_0x4157f3['model'],qs[_0xb441('0x35')](_0x44999a[_0xb441('0x33')][_0xb441('0x35')]));_0x2bbabf[_0xb441('0x34')]=_0x2bbabf[_0xb441('0x34')][_0xb441('0x36')]?_0x2bbabf[_0xb441('0x34')]:_0x4157f3[_0xb441('0x31')];if(_0x44999a['query'][_0xb441('0x40')]){_0x2bbabf[_0xb441('0x41')]=[{'all':!![]}];}_0x2bbabf=_[_0xb441('0x3c')]({},_0x2bbabf,_0x44999a[_0xb441('0x3e')]);return db[_0xb441('0x3f')][_0xb441('0x45')](_0x2bbabf)[_0xb441('0x25')](handleEntityNotFound(_0x5b0f4b,null))[_0xb441('0x25')](respondWithResult(_0x5b0f4b,null))[_0xb441('0x46')](handleError(_0x5b0f4b,null));};exports[_0xb441('0x47')]=function(_0x32c6c4,_0x17bcbd){return db[_0xb441('0x3f')][_0xb441('0x47')](_0x32c6c4[_0xb441('0x48')],{})['then'](respondWithResult(_0x17bcbd,0xc9))[_0xb441('0x46')](handleError(_0x17bcbd,null));};exports[_0xb441('0x24')]=function(_0x2462be,_0x3b9716){if(_0x2462be['body']['id']){delete _0x2462be[_0xb441('0x48')]['id'];}return db[_0xb441('0x3f')][_0xb441('0x45')]({'where':{'id':_0x2462be[_0xb441('0x43')]['id']}})[_0xb441('0x25')](handleEntityNotFound(_0x3b9716,null))[_0xb441('0x25')](saveUpdates(_0x2462be['body'],null))[_0xb441('0x25')](respondWithResult(_0x3b9716,null))[_0xb441('0x46')](handleError(_0x3b9716,null));};exports[_0xb441('0x26')]=function(_0x4ffa17,_0x57d2d5){return db[_0xb441('0x3f')][_0xb441('0x45')]({'where':{'id':_0x4ffa17[_0xb441('0x43')]['id']}})['then'](handleEntityNotFound(_0x57d2d5,null))[_0xb441('0x25')](removeEntity(_0x57d2d5,null))[_0xb441('0x46')](handleError(_0x57d2d5,null));};exports[_0xb441('0x49')]=function(_0x2bc194,_0x489342,_0x3c9c82){var _0x2093b8={};var _0x400824={};var _0x4efa71;var _0x25e578;return db[_0xb441('0x3f')]['findOne']({'where':{'id':_0x2bc194['params']['id']}})['then'](handleEntityNotFound(_0x489342,null))[_0xb441('0x25')](function(_0x30b4cc){if(_0x30b4cc){_0x4efa71=_0x30b4cc;_0x400824[_0xb441('0x31')]=_['keys'](db[_0xb441('0x4a')][_0xb441('0x2d')]);_0x400824[_0xb441('0x33')]=_[_0xb441('0x32')](_0x2bc194[_0xb441('0x33')]);_0x400824[_0xb441('0x3a')]=_[_0xb441('0x44')](_0x400824[_0xb441('0x31')],_0x400824[_0xb441('0x33')]);_0x2093b8[_0xb441('0x34')]=_[_0xb441('0x44')](_0x400824[_0xb441('0x31')],qs[_0xb441('0x35')](_0x2bc194['query']['fields']));_0x2093b8[_0xb441('0x34')]=_0x2093b8[_0xb441('0x34')][_0xb441('0x36')]?_0x2093b8['attributes']:_0x400824[_0xb441('0x31')];_0x2093b8[_0xb441('0x4b')]=qs[_0xb441('0x38')](_0x2bc194[_0xb441('0x33')][_0xb441('0x38')]);_0x2093b8[_0xb441('0x39')]=qs[_0xb441('0x3a')](_['pick'](_0x2bc194[_0xb441('0x33')],_0x400824[_0xb441('0x3a')]));if(_0x2bc194[_0xb441('0x33')][_0xb441('0x3b')]){_0x2093b8['where']=_[_0xb441('0x3c')](_0x2093b8['where'],{'$or':_[_0xb441('0x2c')](_0x2093b8['attributes'],function(_0x43560b){var _0x24f01d={};_0x24f01d[_0x43560b]={'$like':'%'+_0x2bc194[_0xb441('0x33')][_0xb441('0x3b')]+'%'};return _0x24f01d;})});}_0x2093b8=_[_0xb441('0x3c')]({},_0x2093b8,_0x2bc194[_0xb441('0x3e')]);return _0x4efa71[_0xb441('0x49')](_0x2093b8);}})[_0xb441('0x25')](function(_0x51d41c){if(_0x51d41c){_0x25e578=_0x51d41c[_0xb441('0x36')];if(!_0x2bc194[_0xb441('0x33')]['hasOwnProperty'](_0xb441('0x4c'))){_0x2093b8['limit']=qs['limit'](_0x2bc194[_0xb441('0x33')][_0xb441('0x1e')]);_0x2093b8[_0xb441('0x20')]=qs[_0xb441('0x20')](_0x2bc194[_0xb441('0x33')][_0xb441('0x20')]);}return _0x4efa71[_0xb441('0x49')](_0x2093b8);}})[_0xb441('0x25')](function(_0x417b07){if(_0x417b07){return _0x417b07?{'count':_0x25e578,'rows':_0x417b07}:null;}})[_0xb441('0x25')](respondWithResult(_0x489342,null))['catch'](handleError(_0x489342,null));};exports[_0xb441('0x4d')]=function(_0x5d30cb,_0x1e146d,_0x434a75){if(_0x5d30cb[_0xb441('0x48')]['id']){delete _0x5d30cb[_0xb441('0x48')]['id'];}return db[_0xb441('0x3f')][_0xb441('0x4e')]({'where':{'id':_0x5d30cb[_0xb441('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e146d,null))[_0xb441('0x25')](function(_0xdb9973){if(_0xdb9973){_0x5d30cb['body'][_0xb441('0x4f')]=_0xdb9973['id'];_0x5d30cb['body'][_0xb441('0x50')]=integrations[_0xb441('0x51')](_0x5d30cb[_0xb441('0x48')][_0xb441('0x52')],_0x5d30cb[_0xb441('0x48')][_0xb441('0x2f')]);_0x5d30cb[_0xb441('0x48')][_0xb441('0x53')]=integrations[_0xb441('0x54')](_0x5d30cb['body'][_0xb441('0x52')],_0x5d30cb['body'][_0xb441('0x2f')]);return db[_0xb441('0x4a')][_0xb441('0x47')](_0x5d30cb['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0xb441('0x55')],'as':'Descriptions'}]});}return null;})[_0xb441('0x25')](respondWithResult(_0x1e146d,null))[_0xb441('0x46')](handleError(_0x1e146d,null));};function getAccessToken(_0xbccdcf){return new Promise(function(_0x596aa5,_0x27c356){var _0x5dc363;switch(_0xbccdcf['zone']){case'US':_0x5dc363=_0xb441('0x56');break;case'AU':_0x5dc363=_0xb441('0x57');break;case'EU':_0x5dc363=_0xb441('0x58');break;case'IN':_0x5dc363=_0xb441('0x59');break;case'CN':_0x5dc363=_0xb441('0x5a');break;default:_0x5dc363=_0xb441('0x58');break;}var _0x208569={'method':_0xb441('0x5b'),'uri':_0x5dc363+_0xb441('0x5c'),'qs':{'refresh_token':_0xbccdcf[_0xb441('0x5d')],'client_id':_0xbccdcf[_0xb441('0x5e')],'client_secret':_0xbccdcf[_0xb441('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x208569)['then'](function(_0x100b46){if(_0x100b46[_0xb441('0x60')]){_0x596aa5(_0x100b46[_0xb441('0x60')]);}else{_0x27c356('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xb441('0x46')](function(_0x568aae){_0x27c356(_0x568aae);});});}exports[_0xb441('0x61')]=function(_0x2ddd42,_0x3a0949,_0x1e25ff){var _0x505afa,_0x56cd02,_0x533e73,_0x4970b7,_0x2a421d;return db[_0xb441('0x3f')][_0xb441('0x4e')]({'where':{'id':_0x2ddd42[_0xb441('0x43')]['id']},'attributes':['id',_0xb441('0x62'),'zone','clientId',_0xb441('0x5f'),_0xb441('0x63'),'code','refreshToken']})['then'](handleEntityNotFound(_0x3a0949,null))[_0xb441('0x25')](function(_0x5efa2c){_0x2a421d=_0x5efa2c;_0x505afa=_0x2a421d[_0xb441('0x62')];_0x56cd02=_0x505afa===_0xb441('0x64')?'eu':'com';_0x533e73=_0x2a421d['serverUrl'];var _0x42b4b0=_0x533e73[_0xb441('0x65')](-0x1);if(_0x42b4b0==='/'||_0x42b4b0==='\x5c'||_0x42b4b0===':'){_0x533e73=_0x533e73[_0xb441('0x66')](0x0,_0x533e73[_0xb441('0x67')](_0x42b4b0));}if(!_0x2a421d['refreshToken']){throw new Error(_0xb441('0x68'));}return getAccessToken(_0x2a421d);})['then'](function(_0x9ab901){if(_0x9ab901){return rp({'method':_0xb441('0x69'),'uri':util[_0xb441('0x6a')](_0xb441('0x6b'),_0x56cd02),'qs':{'module':'Calls'},'headers':{'Authorization':_0xb441('0x6c')+_0x9ab901},'json':!![]});}})['then'](function(_0x51c8c){if(_0x51c8c){if(_0x51c8c[_0xb441('0x6d')]&&_0x51c8c[_0xb441('0x6d')][_0xb441('0x28')]){throw new Error(_0x51c8c[_0xb441('0x6d')]['error'][_0xb441('0x6e')]);}var _0x4bd370=[];var _0x357e37=[];var _0x28d17a=[_0xb441('0x6f'),_0xb441('0x70'),_0xb441('0x71'),_0xb441('0x72'),_0xb441('0x73'),_0xb441('0x74'),'Call_Start_Time',_0xb441('0x75')];_0x357e37=_[_0xb441('0x76')](_0x51c8c[_0xb441('0x35')],function(_0x35d6c3){return _0x28d17a['includes'](_0x35d6c3['api_name']);});for(var _0x1b1b4b=0x0;_0x1b1b4b<_0x357e37[_0xb441('0x36')];_0x1b1b4b++){if(_0x357e37[_0x1b1b4b]['system_mandatory']===![]){_0x4bd370['push']({'id':_0x357e37[_0x1b1b4b]['id'],'name':_0x357e37[_0x1b1b4b][_0xb441('0x77')],'custom':_0x357e37[_0x1b1b4b]['custom_field'],'options':_0x357e37[_0x1b1b4b]['data_type']===_0xb441('0x78')&&_0x357e37[_0x1b1b4b][_0xb441('0x79')][_0xb441('0x36')]>-0x1?_[_0xb441('0x2c')](_0x357e37[_0x1b1b4b]['pick_list_values'],function(_0x17f750){return{'name':_0x17f750,'value':_0x17f750};}):[]});}}return{'count':_0x4bd370[_0xb441('0x36')],'rows':_0x4bd370};}else{return{'count':0x0,'rows':[]};}})[_0xb441('0x25')](respondWithResult(_0x3a0949,null))[_0xb441('0x46')](function(_0x10a22b){var _0x25c12e=_0x2ddd42[_0xb441('0x33')][_0xb441('0x7a')]?0x1f4:_0x10a22b['statusCode']||0x1f4;logger['error'](_0xb441('0x7b'),'getFields',_0x25c12e,JSON[_0xb441('0x7c')](_0x10a22b));delete _0x10a22b[_0xb441('0x2a')];if(_0x25c12e===0x191){_0x25c12e=0x190;}_0x3a0949[_0xb441('0x1b')](_0x25c12e)[_0xb441('0x7d')](_0x2ddd42[_0xb441('0x33')][_0xb441('0x7a')]?{'message':_0xb441('0x7e'),'statusCode':_0x10a22b[_0xb441('0x7f')]}:_0x10a22b);});}; \ No newline at end of file +var _0x08ad=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','ZohoAccount','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','findOne','ZohoConfiguration','pick','getConfigurations','addConfiguration','AccountId','Descriptions','getDescriptions','channel','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','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','refreshToken','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x21fa02,_0x1f41bb){var _0x3c1f03=function(_0x9b7dd9){while(--_0x9b7dd9){_0x21fa02['push'](_0x21fa02['shift']());}};_0x3c1f03(++_0x1f41bb);}(_0x08ad,0xfa));var _0xd08a=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x08ad[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require(_0xd08a('0x0'));var rimraf=require(_0xd08a('0x1'));var zipdir=require(_0xd08a('0x2'));var jsonpatch=require(_0xd08a('0x3'));var rp=require(_0xd08a('0x4'));var moment=require(_0xd08a('0x5'));var BPromise=require(_0xd08a('0x6'));var Mustache=require(_0xd08a('0x7'));var util=require(_0xd08a('0x8'));var path=require(_0xd08a('0x9'));var sox=require(_0xd08a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd08a('0xb'));var _=require(_0xd08a('0xc'));var squel=require(_0xd08a('0xd'));var crypto=require(_0xd08a('0xe'));var jsforce=require(_0xd08a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd08a('0x10'));var querystring=require(_0xd08a('0x11'));var Papa=require(_0xd08a('0x12'));var Redis=require(_0xd08a('0x13'));var authService=require(_0xd08a('0x14'));var qs=require(_0xd08a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd08a('0x16'))('api');var utils=require(_0xd08a('0x17'));var config=require(_0xd08a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd08a('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x11b569,_0x51ca5b){_0x51ca5b=_0x51ca5b||0xcc;return function(_0x13dda0){if(_0x13dda0){return _0x11b569[_0xd08a('0x1a')](_0x51ca5b);}return _0x11b569[_0xd08a('0x1b')](_0x51ca5b)[_0xd08a('0x1c')]();};}function respondWithResult(_0x2a8e54,_0x4ef251){_0x4ef251=_0x4ef251||0xc8;return function(_0x5f24a0){if(_0x5f24a0){return _0x2a8e54[_0xd08a('0x1b')](_0x4ef251)['json'](_0x5f24a0);}};}function respondWithFilteredResult(_0x52fd6f,_0x5f4d72){return function(_0x2e5fd4){if(_0x2e5fd4){var _0x1990cc=typeof _0x5f4d72[_0xd08a('0x1d')]==='undefined'&&typeof _0x5f4d72[_0xd08a('0x1e')]===_0xd08a('0x1f');var _0xcaef41=_0x2e5fd4['count'];var _0x3f883e=_0x1990cc?0x0:_0x5f4d72[_0xd08a('0x1d')];var _0x1f1dba=_0x1990cc?_0x2e5fd4[_0xd08a('0x20')]:_0x5f4d72['offset']+_0x5f4d72[_0xd08a('0x1e')];var _0x3c1d5f;if(_0x1f1dba>=_0xcaef41){_0x1f1dba=_0xcaef41;_0x3c1d5f=0xc8;}else{_0x3c1d5f=0xce;}_0x52fd6f[_0xd08a('0x1b')](_0x3c1d5f);return _0x52fd6f[_0xd08a('0x21')](_0xd08a('0x22'),_0x3f883e+'-'+_0x1f1dba+'/'+_0xcaef41)[_0xd08a('0x23')](_0x2e5fd4);}return null;};}function patchUpdates(_0x2203cf){return function(_0x337887){try{jsonpatch[_0xd08a('0x24')](_0x337887,_0x2203cf,!![]);}catch(_0x51a21d){return BPromise[_0xd08a('0x25')](_0x51a21d);}return _0x337887['save']();};}function saveUpdates(_0x1150fd,_0x31afb0){return function(_0xde7913){if(_0xde7913){return _0xde7913[_0xd08a('0x26')](_0x1150fd)[_0xd08a('0x27')](function(_0x279449){return _0x279449;});}return null;};}function removeEntity(_0x54daa6,_0x3db915){return function(_0x4f5176){if(_0x4f5176){return _0x4f5176[_0xd08a('0x28')]()[_0xd08a('0x27')](function(){_0x54daa6[_0xd08a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f633a,_0x4770f5){return function(_0x5226c0){if(!_0x5226c0){_0x1f633a[_0xd08a('0x1a')](0x194);}return _0x5226c0;};}function handleError(_0x14ff6b,_0xb07129){_0xb07129=_0xb07129||0x1f4;return function(_0x962d4a){logger[_0xd08a('0x29')](_0x962d4a['stack']);if(_0x962d4a[_0xd08a('0x2a')]){delete _0x962d4a[_0xd08a('0x2a')];}_0x14ff6b[_0xd08a('0x1b')](_0xb07129)[_0xd08a('0x2b')](_0x962d4a);};}exports[_0xd08a('0x2c')]=function(_0x53f033,_0x2d3b50){var _0x1cfda6={},_0x164352={},_0x58f30f={'count':0x0,'rows':[]};var _0x132a3d=_['map'](db[_0xd08a('0x2d')][_0xd08a('0x2e')],function(_0x413fd2){return{'name':_0x413fd2['fieldName'],'type':_0x413fd2[_0xd08a('0x2f')]['key']};});_0x164352[_0xd08a('0x30')]=_[_0xd08a('0x31')](_0x132a3d,_0xd08a('0x2a'));_0x164352[_0xd08a('0x32')]=_[_0xd08a('0x33')](_0x53f033['query']);_0x164352[_0xd08a('0x34')]=_[_0xd08a('0x35')](_0x164352[_0xd08a('0x30')],_0x164352['query']);_0x1cfda6[_0xd08a('0x36')]=_[_0xd08a('0x35')](_0x164352[_0xd08a('0x30')],qs['fields'](_0x53f033[_0xd08a('0x32')]['fields']));_0x1cfda6[_0xd08a('0x36')]=_0x1cfda6[_0xd08a('0x36')][_0xd08a('0x37')]?_0x1cfda6[_0xd08a('0x36')]:_0x164352[_0xd08a('0x30')];if(!_0x53f033[_0xd08a('0x32')][_0xd08a('0x38')](_0xd08a('0x39'))){_0x1cfda6['limit']=qs[_0xd08a('0x1e')](_0x53f033[_0xd08a('0x32')][_0xd08a('0x1e')]);_0x1cfda6['offset']=qs[_0xd08a('0x1d')](_0x53f033[_0xd08a('0x32')][_0xd08a('0x1d')]);}_0x1cfda6[_0xd08a('0x3a')]=qs[_0xd08a('0x3b')](_0x53f033['query'][_0xd08a('0x3b')]);_0x1cfda6['where']=qs[_0xd08a('0x34')](_['pick'](_0x53f033[_0xd08a('0x32')],_0x164352['filters']),_0x132a3d);if(_0x53f033[_0xd08a('0x32')][_0xd08a('0x3c')]){_0x1cfda6[_0xd08a('0x3d')]=_[_0xd08a('0x3e')](_0x1cfda6['where'],{'$or':_['map'](_0x132a3d,function(_0x2a5977){if(_0x2a5977['type']!==_0xd08a('0x3f')){var _0x81756f={};_0x81756f[_0x2a5977['name']]={'$like':'%'+_0x53f033['query']['filter']+'%'};return _0x81756f;}})});}_0x1cfda6=_[_0xd08a('0x3e')]({},_0x1cfda6,_0x53f033[_0xd08a('0x40')]);var _0x5455df={'where':_0x1cfda6[_0xd08a('0x3d')]};return db['ZohoAccount'][_0xd08a('0x20')](_0x5455df)[_0xd08a('0x27')](function(_0x46dee8){_0x58f30f[_0xd08a('0x20')]=_0x46dee8;if(_0x53f033['query'][_0xd08a('0x41')]){_0x1cfda6[_0xd08a('0x42')]=[{'all':!![]}];}return db[_0xd08a('0x2d')][_0xd08a('0x43')](_0x1cfda6);})[_0xd08a('0x27')](function(_0x3c244f){_0x58f30f[_0xd08a('0x44')]=_0x3c244f;return _0x58f30f;})['then'](respondWithFilteredResult(_0x2d3b50,_0x1cfda6))[_0xd08a('0x45')](handleError(_0x2d3b50,null));};exports[_0xd08a('0x46')]=function(_0x1a2377,_0x1d490e){var _0x3bbfe1={'raw':![],'where':{'id':_0x1a2377[_0xd08a('0x47')]['id']}},_0x14679e={};_0x14679e[_0xd08a('0x30')]=_[_0xd08a('0x33')](db['ZohoAccount'][_0xd08a('0x2e')]);_0x14679e[_0xd08a('0x32')]=_[_0xd08a('0x33')](_0x1a2377[_0xd08a('0x32')]);_0x14679e[_0xd08a('0x34')]=_[_0xd08a('0x35')](_0x14679e[_0xd08a('0x30')],_0x14679e['query']);_0x3bbfe1[_0xd08a('0x36')]=_[_0xd08a('0x35')](_0x14679e[_0xd08a('0x30')],qs[_0xd08a('0x48')](_0x1a2377[_0xd08a('0x32')][_0xd08a('0x48')]));_0x3bbfe1[_0xd08a('0x36')]=_0x3bbfe1[_0xd08a('0x36')][_0xd08a('0x37')]?_0x3bbfe1[_0xd08a('0x36')]:_0x14679e['model'];if(_0x1a2377[_0xd08a('0x32')][_0xd08a('0x41')]){_0x3bbfe1[_0xd08a('0x42')]=[{'all':!![]}];}_0x3bbfe1=_[_0xd08a('0x3e')]({},_0x3bbfe1,_0x1a2377['options']);return db[_0xd08a('0x2d')]['find'](_0x3bbfe1)[_0xd08a('0x27')](handleEntityNotFound(_0x1d490e,null))[_0xd08a('0x27')](respondWithResult(_0x1d490e,null))[_0xd08a('0x45')](handleError(_0x1d490e,null));};exports['create']=function(_0x3102cc,_0x5e3d67){return db[_0xd08a('0x2d')][_0xd08a('0x49')](_0x3102cc[_0xd08a('0x4a')],{})[_0xd08a('0x27')](respondWithResult(_0x5e3d67,0xc9))[_0xd08a('0x45')](handleError(_0x5e3d67,null));};exports[_0xd08a('0x26')]=function(_0x186ad8,_0x1ff93b){if(_0x186ad8[_0xd08a('0x4a')]['id']){delete _0x186ad8[_0xd08a('0x4a')]['id'];}return db[_0xd08a('0x2d')]['find']({'where':{'id':_0x186ad8[_0xd08a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ff93b,null))[_0xd08a('0x27')](saveUpdates(_0x186ad8[_0xd08a('0x4a')],null))[_0xd08a('0x27')](respondWithResult(_0x1ff93b,null))[_0xd08a('0x45')](handleError(_0x1ff93b,null));};exports[_0xd08a('0x28')]=function(_0x24d936,_0x5407ed){return db[_0xd08a('0x2d')][_0xd08a('0x4b')]({'where':{'id':_0x24d936['params']['id']}})[_0xd08a('0x27')](handleEntityNotFound(_0x5407ed,null))[_0xd08a('0x27')](removeEntity(_0x5407ed,null))[_0xd08a('0x45')](handleError(_0x5407ed,null));};exports['getConfigurations']=function(_0x3a3261,_0x274467,_0x31a019){var _0x41ecf3={};var _0xc4913b={};var _0x289cce;var _0x1f9eff;return db[_0xd08a('0x2d')][_0xd08a('0x4c')]({'where':{'id':_0x3a3261[_0xd08a('0x47')]['id']}})[_0xd08a('0x27')](handleEntityNotFound(_0x274467,null))[_0xd08a('0x27')](function(_0x26bfcc){if(_0x26bfcc){_0x289cce=_0x26bfcc;_0xc4913b['model']=_[_0xd08a('0x33')](db[_0xd08a('0x4d')][_0xd08a('0x2e')]);_0xc4913b[_0xd08a('0x32')]=_['keys'](_0x3a3261[_0xd08a('0x32')]);_0xc4913b[_0xd08a('0x34')]=_['intersection'](_0xc4913b[_0xd08a('0x30')],_0xc4913b[_0xd08a('0x32')]);_0x41ecf3[_0xd08a('0x36')]=_[_0xd08a('0x35')](_0xc4913b[_0xd08a('0x30')],qs[_0xd08a('0x48')](_0x3a3261['query'][_0xd08a('0x48')]));_0x41ecf3[_0xd08a('0x36')]=_0x41ecf3[_0xd08a('0x36')][_0xd08a('0x37')]?_0x41ecf3[_0xd08a('0x36')]:_0xc4913b['model'];_0x41ecf3[_0xd08a('0x3a')]=qs[_0xd08a('0x3b')](_0x3a3261[_0xd08a('0x32')][_0xd08a('0x3b')]);_0x41ecf3['where']=qs[_0xd08a('0x34')](_[_0xd08a('0x4e')](_0x3a3261[_0xd08a('0x32')],_0xc4913b[_0xd08a('0x34')]));if(_0x3a3261[_0xd08a('0x32')][_0xd08a('0x3c')]){_0x41ecf3[_0xd08a('0x3d')]=_[_0xd08a('0x3e')](_0x41ecf3[_0xd08a('0x3d')],{'$or':_[_0xd08a('0x31')](_0x41ecf3[_0xd08a('0x36')],function(_0x212e2e){var _0x16dc35={};_0x16dc35[_0x212e2e]={'$like':'%'+_0x3a3261[_0xd08a('0x32')][_0xd08a('0x3c')]+'%'};return _0x16dc35;})});}_0x41ecf3=_['merge']({},_0x41ecf3,_0x3a3261[_0xd08a('0x40')]);return _0x289cce[_0xd08a('0x4f')](_0x41ecf3);}})[_0xd08a('0x27')](function(_0x33c22a){if(_0x33c22a){_0x1f9eff=_0x33c22a[_0xd08a('0x37')];if(!_0x3a3261['query'][_0xd08a('0x38')](_0xd08a('0x39'))){_0x41ecf3[_0xd08a('0x1e')]=qs['limit'](_0x3a3261[_0xd08a('0x32')][_0xd08a('0x1e')]);_0x41ecf3[_0xd08a('0x1d')]=qs[_0xd08a('0x1d')](_0x3a3261[_0xd08a('0x32')][_0xd08a('0x1d')]);}return _0x289cce[_0xd08a('0x4f')](_0x41ecf3);}})[_0xd08a('0x27')](function(_0x40a634){if(_0x40a634){return _0x40a634?{'count':_0x1f9eff,'rows':_0x40a634}:null;}})['then'](respondWithResult(_0x274467,null))[_0xd08a('0x45')](handleError(_0x274467,null));};exports[_0xd08a('0x50')]=function(_0x34e425,_0x44823f,_0x30df0c){if(_0x34e425[_0xd08a('0x4a')]['id']){delete _0x34e425[_0xd08a('0x4a')]['id'];}return db[_0xd08a('0x2d')][_0xd08a('0x4c')]({'where':{'id':_0x34e425[_0xd08a('0x47')]['id']}})[_0xd08a('0x27')](handleEntityNotFound(_0x44823f,null))[_0xd08a('0x27')](function(_0xcf7378){if(_0xcf7378){_0x34e425[_0xd08a('0x4a')][_0xd08a('0x51')]=_0xcf7378['id'];_0x34e425[_0xd08a('0x4a')]['Subjects']=integrations['getSubjects'](_0x34e425[_0xd08a('0x4a')]['channel'],_0x34e425['body'][_0xd08a('0x2f')]);_0x34e425[_0xd08a('0x4a')][_0xd08a('0x52')]=integrations[_0xd08a('0x53')](_0x34e425[_0xd08a('0x4a')][_0xd08a('0x54')],_0x34e425['body']['type']);return db[_0xd08a('0x4d')][_0xd08a('0x49')](_0x34e425[_0xd08a('0x4a')],{'include':[{'model':db[_0xd08a('0x55')],'as':'Subjects'},{'model':db[_0xd08a('0x55')],'as':_0xd08a('0x52')}]});}return null;})[_0xd08a('0x27')](respondWithResult(_0x44823f,null))[_0xd08a('0x45')](handleError(_0x44823f,null));};function getAccessToken(_0x4df118){return new Promise(function(_0x3d7e01,_0x45cfbc){var _0x5b714f;switch(_0x4df118[_0xd08a('0x56')]){case'US':_0x5b714f=_0xd08a('0x57');break;case'AU':_0x5b714f=_0xd08a('0x58');break;case'EU':_0x5b714f=_0xd08a('0x59');break;case'IN':_0x5b714f=_0xd08a('0x5a');break;case'CN':_0x5b714f=_0xd08a('0x5b');break;default:_0x5b714f=_0xd08a('0x59');break;}var _0x3e407e={'method':_0xd08a('0x5c'),'uri':_0x5b714f+_0xd08a('0x5d'),'qs':{'refresh_token':_0x4df118['refreshToken'],'client_id':_0x4df118[_0xd08a('0x5e')],'client_secret':_0x4df118[_0xd08a('0x5f')],'grant_type':_0xd08a('0x60')},'json':!![]};return rp(_0x3e407e)[_0xd08a('0x27')](function(_0x3a1d9e){if(_0x3a1d9e[_0xd08a('0x61')]){_0x3d7e01(_0x3a1d9e[_0xd08a('0x61')]);}else{_0x45cfbc(_0xd08a('0x62'));}})[_0xd08a('0x45')](function(_0x1ff284){_0x45cfbc(_0x1ff284);});});}exports[_0xd08a('0x63')]=function(_0xa02d2e,_0x48626f,_0xd4e265){var _0x568808,_0x582452,_0x25d615,_0x473ddd,_0x534e96;return db[_0xd08a('0x2d')]['findOne']({'where':{'id':_0xa02d2e['params']['id']},'attributes':['id',_0xd08a('0x64'),'zone',_0xd08a('0x5e'),_0xd08a('0x5f'),_0xd08a('0x65'),_0xd08a('0x66'),'refreshToken']})[_0xd08a('0x27')](handleEntityNotFound(_0x48626f,null))[_0xd08a('0x27')](function(_0x133d9c){_0x534e96=_0x133d9c;_0x568808=_0x534e96[_0xd08a('0x64')];_0x582452=_0x568808===_0xd08a('0x67')?'eu':_0xd08a('0x68');_0x25d615=_0x534e96[_0xd08a('0x65')];var _0x436eb5=_0x25d615[_0xd08a('0x69')](-0x1);if(_0x436eb5==='/'||_0x436eb5==='\x5c'||_0x436eb5===':'){_0x25d615=_0x25d615[_0xd08a('0x6a')](0x0,_0x25d615[_0xd08a('0x6b')](_0x436eb5));}if(!_0x534e96[_0xd08a('0x6c')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x534e96);})[_0xd08a('0x27')](function(_0x44bc14){if(_0x44bc14){return rp({'method':_0xd08a('0x6d'),'uri':util[_0xd08a('0x6e')](_0xd08a('0x6f'),_0x582452),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x44bc14},'json':!![]});}})[_0xd08a('0x27')](function(_0x2ffc93){if(_0x2ffc93){if(_0x2ffc93[_0xd08a('0x70')]&&_0x2ffc93[_0xd08a('0x70')][_0xd08a('0x29')]){throw new Error(_0x2ffc93[_0xd08a('0x70')][_0xd08a('0x29')][_0xd08a('0x71')]);}var _0x9bb889=[];var _0x22b36a=[];var _0x5487a9=[_0xd08a('0x72'),'Subject',_0xd08a('0x73'),_0xd08a('0x74'),_0xd08a('0x75'),_0xd08a('0x76'),_0xd08a('0x77'),_0xd08a('0x78')];_0x22b36a=_[_0xd08a('0x79')](_0x2ffc93['fields'],function(_0x2ce171){return _0x5487a9['includes'](_0x2ce171[_0xd08a('0x7a')]);});for(var _0x597ca5=0x0;_0x597ca5<_0x22b36a[_0xd08a('0x37')];_0x597ca5++){if(_0x22b36a[_0x597ca5]['system_mandatory']===![]){_0x9bb889[_0xd08a('0x7b')]({'id':_0x22b36a[_0x597ca5]['id'],'name':_0x22b36a[_0x597ca5][_0xd08a('0x7c')],'custom':_0x22b36a[_0x597ca5][_0xd08a('0x7d')],'options':_0x22b36a[_0x597ca5][_0xd08a('0x7e')]==='picklist'&&_0x22b36a[_0x597ca5][_0xd08a('0x7f')]['length']>-0x1?_[_0xd08a('0x31')](_0x22b36a[_0x597ca5][_0xd08a('0x7f')],function(_0x4bf34e){return{'name':_0x4bf34e,'value':_0x4bf34e};}):[]});}}return{'count':_0x9bb889['length'],'rows':_0x9bb889};}else{return{'count':0x0,'rows':[]};}})[_0xd08a('0x27')](respondWithResult(_0x48626f,null))[_0xd08a('0x45')](function(_0x3d8e82){var _0x1de0b3=_0xa02d2e['query'][_0xd08a('0x80')]?0x1f4:_0x3d8e82[_0xd08a('0x81')]||0x1f4;logger[_0xd08a('0x29')](_0xd08a('0x82'),_0xd08a('0x63'),_0x1de0b3,JSON[_0xd08a('0x83')](_0x3d8e82));delete _0x3d8e82[_0xd08a('0x2a')];if(_0x1de0b3===0x191){_0x1de0b3=0x190;}_0x48626f[_0xd08a('0x1b')](_0x1de0b3)['send'](_0xa02d2e['query']['test']?{'message':_0xd08a('0x84'),'statusCode':_0x3d8e82[_0xd08a('0x81')]}:_0x3d8e82);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index b0db775..ae743d0 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 _0xc96e=['host','slice','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','code','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','info','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','format'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0xc96e,0xe1));var _0xec96=function(_0x52af3a,_0x4ed2a0){_0x52af3a=_0x52af3a-0x0;var _0x5c2f98=_0xc96e[_0x52af3a];return _0x5c2f98;};'use strict';var _=require('lodash');var util=require(_0xec96('0x0'));var logger=require(_0xec96('0x1'))(_0xec96('0x2'));var moment=require(_0xec96('0x3'));var BPromise=require(_0xec96('0x4'));var rp=require(_0xec96('0x5'));var fs=require('fs');var path=require(_0xec96('0x6'));var rimraf=require(_0xec96('0x7'));var config=require(_0xec96('0x8'));var attributes=require(_0xec96('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xec96('0xa')]=function(_0x1fbcd7,_0x54412d){return _0x1fbcd7['define'](_0xec96('0xb'),attributes,{'tableName':_0xec96('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x15b209,_0x596a80,_0x541f80){if(_0x15b209['changed'](_0xec96('0xd'))||_0x15b209[_0xec96('0xe')](_0xec96('0xf'))||_0x15b209['changed'](_0xec96('0x10'))||_0x15b209[_0xec96('0xe')]('clientSecret')||_0x15b209['changed'](_0xec96('0x11'))||_0x15b209[_0xec96('0xe')]('host')){var _0x2558a8,_0x51858b;_0x2558a8=_0x15b209[_0xec96('0xf')];var _0x264237=_0x2558a8['slice'](-0x1);if(_0x264237==='/'||_0x264237==='\x5c'||_0x264237===':'){_0x2558a8=_0x2558a8[_0xec96('0x12')](0x0,_0x2558a8[_0xec96('0x13')](_0x264237));}switch(_0x15b209[_0xec96('0xd')]){case'US':_0x51858b=_0xec96('0x14');break;case'AU':_0x51858b=_0xec96('0x15');break;case'IN':_0x51858b=_0xec96('0x16');break;case'CN':_0x51858b=_0xec96('0x17');break;default:_0x51858b='https://accounts.zoho.eu';break;}var _0xefa12a={'method':_0xec96('0x18'),'uri':_0x51858b+'/oauth/v2/token','form':{'grant_type':_0xec96('0x19'),'client_id':_0x15b209[_0xec96('0x10')],'client_secret':_0x15b209[_0xec96('0x1a')],'redirect_uri':_0x15b209[_0xec96('0xf')],'code':_0x15b209[_0xec96('0x11')]},'headers':{'Content-Type':_0xec96('0x1b')}};return rp(_0xefa12a)[_0xec96('0x1c')](function(_0x382044){var _0xff469f=JSON[_0xec96('0x1d')](_0x382044);if(_0xff469f[_0xec96('0x1e')]){_0x15b209['refreshToken']=_0xff469f[_0xec96('0x1e')];logger[_0xec96('0x1f')](util['format'](_0xec96('0x20'),_0x15b209[_0xec96('0x21')],_0x15b209['id']));}else{logger[_0xec96('0x22')](util['format'](_0xec96('0x23'),_0x15b209[_0xec96('0x21')],_0x15b209['id']),util[_0xec96('0x24')](_0xff469f,{'showHidden':![],'depth':null}));}return _0x541f80(null,_0x596a80);})[_0xec96('0x25')](function(_0x40def9){logger[_0xec96('0x22')](util[_0xec96('0x26')](_0xec96('0x23'),_0x15b209[_0xec96('0x21')],_0x15b209['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x541f80(_0x40def9);});}else{return _0x541f80(null,_0x596a80);}},'beforeUpdate':function(_0xb017e2,_0x3e9974,_0x5b751e){if(_0xb017e2[_0xec96('0xe')](_0xec96('0xd'))||_0xb017e2[_0xec96('0xe')](_0xec96('0xf'))||_0xb017e2['changed'](_0xec96('0x10'))||_0xb017e2['changed'](_0xec96('0x1a'))||_0xb017e2[_0xec96('0xe')](_0xec96('0x11'))||_0xb017e2['changed'](_0xec96('0x27'))){var _0x68b17b,_0x582aa3;_0x68b17b=_0xb017e2['serverUrl'];var _0x569226=_0x68b17b[_0xec96('0x28')](-0x1);if(_0x569226==='/'||_0x569226==='\x5c'||_0x569226===':'){_0x68b17b=_0x68b17b[_0xec96('0x12')](0x0,_0x68b17b['lastIndexOf'](_0x569226));}switch(_0xb017e2['zone']){case'US':_0x582aa3=_0xec96('0x14');break;case'AU':_0x582aa3=_0xec96('0x15');break;case'IN':_0x582aa3=_0xec96('0x16');break;case'CN':_0x582aa3='https://accounts.zoho.com.cn';break;default:_0x582aa3=_0xec96('0x29');break;}var _0x5676d0={'method':_0xec96('0x18'),'uri':_0x582aa3+_0xec96('0x2a'),'form':{'grant_type':_0xec96('0x19'),'client_id':_0xb017e2[_0xec96('0x10')],'client_secret':_0xb017e2[_0xec96('0x1a')],'redirect_uri':_0xb017e2['serverUrl'],'code':_0xb017e2[_0xec96('0x11')]},'headers':{'Content-Type':_0xec96('0x1b')}};return rp(_0x5676d0)['then'](function(_0x23535e){var _0x238718=JSON['parse'](_0x23535e);if(_0x238718[_0xec96('0x1e')]){_0xb017e2[_0xec96('0x2b')]=_0x238718['refresh_token'];logger['info'](util[_0xec96('0x26')](_0xec96('0x20'),_0xb017e2[_0xec96('0x21')],_0xb017e2['id']));}else{logger[_0xec96('0x22')](util[_0xec96('0x26')](_0xec96('0x23'),_0xb017e2[_0xec96('0x21')],_0xb017e2['id']),util['inspect'](_0x238718,{'showHidden':![],'depth':null}));}return _0x5b751e(null,_0x3e9974);})[_0xec96('0x25')](function(_0x5d8a7e){logger['error'](util[_0xec96('0x26')](_0xec96('0x23'),_0xb017e2[_0xec96('0x21')],_0xb017e2['id']),util[_0xec96('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x5b751e(_0x5d8a7e);});}else{return _0x5b751e(null,_0x3e9974);}}}});}; \ No newline at end of file +var _0xdd18=['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','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','slice','substring','lastIndexOf','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','zone'];(function(_0x2dd273,_0x4daf5c){var _0x1f3be3=function(_0x1f8a79){while(--_0x1f8a79){_0x2dd273['push'](_0x2dd273['shift']());}};_0x1f3be3(++_0x4daf5c);}(_0xdd18,0x1dd));var _0x8dd1=function(_0x534f4f,_0xd9e172){_0x534f4f=_0x534f4f-0x0;var _0x3aa387=_0xdd18[_0x534f4f];return _0x3aa387;};'use strict';var _=require('lodash');var util=require(_0x8dd1('0x0'));var logger=require(_0x8dd1('0x1'))(_0x8dd1('0x2'));var moment=require('moment');var BPromise=require(_0x8dd1('0x3'));var rp=require(_0x8dd1('0x4'));var fs=require('fs');var path=require(_0x8dd1('0x5'));var rimraf=require(_0x8dd1('0x6'));var config=require('../../config/environment');var attributes=require(_0x8dd1('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8dd1('0x8')]=function(_0x323148,_0x5f10fa){return _0x323148['define'](_0x8dd1('0x9'),attributes,{'tableName':_0x8dd1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x29d210,_0x13162c,_0x528832){if(_0x29d210[_0x8dd1('0xb')]('zone')||_0x29d210[_0x8dd1('0xb')](_0x8dd1('0xc'))||_0x29d210[_0x8dd1('0xb')]('clientId')||_0x29d210[_0x8dd1('0xb')](_0x8dd1('0xd'))||_0x29d210[_0x8dd1('0xb')]('code')||_0x29d210[_0x8dd1('0xb')]('host')){var _0x403ed6,_0x1a3ab2;_0x403ed6=_0x29d210[_0x8dd1('0xc')];var _0x54b5ac=_0x403ed6['slice'](-0x1);if(_0x54b5ac==='/'||_0x54b5ac==='\x5c'||_0x54b5ac===':'){_0x403ed6=_0x403ed6['substring'](0x0,_0x403ed6['lastIndexOf'](_0x54b5ac));}switch(_0x29d210[_0x8dd1('0xe')]){case'US':_0x1a3ab2=_0x8dd1('0xf');break;case'AU':_0x1a3ab2=_0x8dd1('0x10');break;case'IN':_0x1a3ab2='https://accounts.zoho.in';break;case'CN':_0x1a3ab2=_0x8dd1('0x11');break;default:_0x1a3ab2=_0x8dd1('0x12');break;}var _0x4b7cbe={'method':_0x8dd1('0x13'),'uri':_0x1a3ab2+_0x8dd1('0x14'),'form':{'grant_type':_0x8dd1('0x15'),'client_id':_0x29d210[_0x8dd1('0x16')],'client_secret':_0x29d210[_0x8dd1('0xd')],'redirect_uri':_0x29d210[_0x8dd1('0xc')],'code':_0x29d210[_0x8dd1('0x17')]},'headers':{'Content-Type':_0x8dd1('0x18')}};return rp(_0x4b7cbe)[_0x8dd1('0x19')](function(_0x202dd4){var _0x26b72a=JSON[_0x8dd1('0x1a')](_0x202dd4);if(_0x26b72a[_0x8dd1('0x1b')]){_0x29d210[_0x8dd1('0x1c')]=_0x26b72a[_0x8dd1('0x1b')];logger[_0x8dd1('0x1d')](util[_0x8dd1('0x1e')](_0x8dd1('0x1f'),_0x29d210['name'],_0x29d210['id']));}else{logger[_0x8dd1('0x20')](util[_0x8dd1('0x1e')](_0x8dd1('0x21'),_0x29d210[_0x8dd1('0x22')],_0x29d210['id']),util[_0x8dd1('0x23')](_0x26b72a,{'showHidden':![],'depth':null}));}return _0x528832(null,_0x13162c);})[_0x8dd1('0x24')](function(_0x79acb){logger[_0x8dd1('0x20')](util[_0x8dd1('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x29d210[_0x8dd1('0x22')],_0x29d210['id']),util[_0x8dd1('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x528832(_0x79acb);});}else{return _0x528832(null,_0x13162c);}},'beforeUpdate':function(_0x57c839,_0x384334,_0x18488d){if(_0x57c839[_0x8dd1('0xb')]('zone')||_0x57c839[_0x8dd1('0xb')](_0x8dd1('0xc'))||_0x57c839['changed'](_0x8dd1('0x16'))||_0x57c839['changed'](_0x8dd1('0xd'))||_0x57c839[_0x8dd1('0xb')]('code')||_0x57c839[_0x8dd1('0xb')](_0x8dd1('0x25'))){var _0x1f15af,_0xf9b133;_0x1f15af=_0x57c839['serverUrl'];var _0x221a88=_0x1f15af[_0x8dd1('0x26')](-0x1);if(_0x221a88==='/'||_0x221a88==='\x5c'||_0x221a88===':'){_0x1f15af=_0x1f15af[_0x8dd1('0x27')](0x0,_0x1f15af[_0x8dd1('0x28')](_0x221a88));}switch(_0x57c839['zone']){case'US':_0xf9b133=_0x8dd1('0xf');break;case'AU':_0xf9b133='https://accounts.zoho.com.au';break;case'IN':_0xf9b133='https://accounts.zoho.in';break;case'CN':_0xf9b133=_0x8dd1('0x11');break;default:_0xf9b133=_0x8dd1('0x12');break;}var _0x26dd6c={'method':_0x8dd1('0x13'),'uri':_0xf9b133+_0x8dd1('0x14'),'form':{'grant_type':_0x8dd1('0x15'),'client_id':_0x57c839['clientId'],'client_secret':_0x57c839[_0x8dd1('0xd')],'redirect_uri':_0x57c839['serverUrl'],'code':_0x57c839[_0x8dd1('0x17')]},'headers':{'Content-Type':_0x8dd1('0x18')}};return rp(_0x26dd6c)['then'](function(_0x7d132c){var _0x2e6b99=JSON[_0x8dd1('0x1a')](_0x7d132c);if(_0x2e6b99[_0x8dd1('0x1b')]){_0x57c839['refreshToken']=_0x2e6b99['refresh_token'];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x57c839['name'],_0x57c839['id']));}else{logger[_0x8dd1('0x20')](util[_0x8dd1('0x1e')](_0x8dd1('0x21'),_0x57c839[_0x8dd1('0x22')],_0x57c839['id']),util[_0x8dd1('0x23')](_0x2e6b99,{'showHidden':![],'depth':null}));}return _0x18488d(null,_0x384334);})[_0x8dd1('0x24')](function(_0x1a9497){logger[_0x8dd1('0x20')](util[_0x8dd1('0x1e')](_0x8dd1('0x21'),_0x57c839[_0x8dd1('0x22')],_0x57c839['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x18488d(_0x1a9497);});}else{return _0x18488d(null,_0x384334);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index fa33e07..ad80516 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 _0x341c=['then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowZohoAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2a00c2,_0x13611a){var _0xa5290e=function(_0xd4328c){while(--_0xd4328c){_0x2a00c2['push'](_0x2a00c2['shift']());}};_0xa5290e(++_0x13611a);}(_0x341c,0xcc));var _0xc341=function(_0xd62e7a,_0xac4f19){_0xd62e7a=_0xd62e7a-0x0;var _0x1bf0c8=_0x341c[_0xd62e7a];return _0x1bf0c8;};'use strict';var _=require(_0xc341('0x0'));var util=require('util');var moment=require(_0xc341('0x1'));var BPromise=require('bluebird');var rs=require(_0xc341('0x2'));var fs=require('fs');var Redis=require(_0xc341('0x3'));var db=require(_0xc341('0x4'))['db'];var utils=require(_0xc341('0x5'));var logger=require(_0xc341('0x6'))(_0xc341('0x7'));var config=require(_0xc341('0x8'));var jayson=require(_0xc341('0x9'));var client=jayson['client'][_0xc341('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13c5b4,_0x296387,_0x31ce96){return new BPromise(function(_0x3e83c9,_0x53aab7){return client[_0xc341('0xb')](_0x13c5b4,_0x31ce96)[_0xc341('0xc')](function(_0x3f08b0){logger[_0xc341('0xd')](_0xc341('0xe'),_0x296387,_0xc341('0xf'));logger['debug'](_0xc341('0x10'),_0x296387,_0xc341('0xf'),JSON[_0xc341('0x11')](_0x3f08b0));if(_0x3f08b0[_0xc341('0x12')]){if(_0x3f08b0[_0xc341('0x12')][_0xc341('0x13')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x296387,_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);return _0x53aab7(_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);}logger[_0xc341('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x296387,_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);return _0x3e83c9(_0x3f08b0[_0xc341('0x12')][_0xc341('0x14')]);}else{logger[_0xc341('0xd')](_0xc341('0xe'),_0x296387,_0xc341('0xf'));_0x3e83c9(_0x3f08b0[_0xc341('0x15')][_0xc341('0x14')]);}})[_0xc341('0x16')](function(_0x1d499c){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x296387,_0x1d499c);_0x53aab7(_0x1d499c);});});}exports[_0xc341('0x17')]=function(_0x19d0bc){var _0x2d9f4e=this;return new Promise(function(_0x31f1ae,_0x1017fc){return db[_0xc341('0x18')][_0xc341('0x19')]({'raw':_0x19d0bc[_0xc341('0x1a')]?_0x19d0bc[_0xc341('0x1a')][_0xc341('0x1b')]===undefined?!![]:![]:!![],'where':_0x19d0bc[_0xc341('0x1a')]?_0x19d0bc[_0xc341('0x1a')]['where']||null:null,'attributes':_0x19d0bc['options']?_0x19d0bc[_0xc341('0x1a')][_0xc341('0x1c')]||null:null,'limit':_0x19d0bc[_0xc341('0x1a')]?_0x19d0bc[_0xc341('0x1a')][_0xc341('0x1d')]||null:null,'include':_0x19d0bc[_0xc341('0x1a')]?_0x19d0bc['options'][_0xc341('0x1e')]?_[_0xc341('0x1f')](_0x19d0bc[_0xc341('0x1a')]['include'],function(_0x5c749b){return{'model':db[_0x5c749b[_0xc341('0x20')]],'as':_0x5c749b['as'],'attributes':_0x5c749b['attributes'],'include':_0x5c749b[_0xc341('0x1e')]?_[_0xc341('0x1f')](_0x5c749b[_0xc341('0x1e')],function(_0x36b60e){return{'model':db[_0x36b60e[_0xc341('0x20')]],'as':_0x36b60e['as'],'attributes':_0x36b60e['attributes'],'include':_0x36b60e[_0xc341('0x1e')]?_[_0xc341('0x1f')](_0x36b60e[_0xc341('0x1e')],function(_0x349380){return{'model':db[_0x349380[_0xc341('0x20')]],'as':_0x349380['as'],'attributes':_0x349380[_0xc341('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc341('0xc')](function(_0x51af9d){logger[_0xc341('0xd')](_0xc341('0x17'),_0x19d0bc);logger[_0xc341('0x21')](_0xc341('0x17'),_0x19d0bc,JSON[_0xc341('0x11')](_0x51af9d));_0x31f1ae(_0x51af9d);})[_0xc341('0x16')](function(_0x192611){logger[_0xc341('0x12')](_0xc341('0x17'),_0x192611['message'],_0x19d0bc);_0x1017fc(_0x2d9f4e[_0xc341('0x12')](0x1f4,_0x192611[_0xc341('0x14')]));});});};exports[_0xc341('0x22')]=function(_0x32185a){var _0x13c225=this;return new Promise(function(_0x2a3e7c,_0x1a7ab3){return db[_0xc341('0x18')][_0xc341('0x23')]({'raw':_0x32185a[_0xc341('0x1a')]?_0x32185a[_0xc341('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x32185a['options']?_0x32185a[_0xc341('0x1a')]['where']||null:null,'attributes':_0x32185a[_0xc341('0x1a')]?_0x32185a[_0xc341('0x1a')][_0xc341('0x1c')]||null:null,'include':_0x32185a[_0xc341('0x1a')]?_0x32185a[_0xc341('0x1a')][_0xc341('0x1e')]?_[_0xc341('0x1f')](_0x32185a[_0xc341('0x1a')][_0xc341('0x1e')],function(_0x5784dd){return{'model':db[_0x5784dd[_0xc341('0x20')]],'as':_0x5784dd['as'],'attributes':_0x5784dd[_0xc341('0x1c')],'include':_0x5784dd[_0xc341('0x1e')]?_[_0xc341('0x1f')](_0x5784dd[_0xc341('0x1e')],function(_0x59d6eb){return{'model':db[_0x59d6eb['model']],'as':_0x59d6eb['as'],'attributes':_0x59d6eb['attributes'],'include':_0x59d6eb[_0xc341('0x1e')]?_[_0xc341('0x1f')](_0x59d6eb[_0xc341('0x1e')],function(_0x1a6b85){return{'model':db[_0x1a6b85['model']],'as':_0x1a6b85['as'],'attributes':_0x1a6b85['attributes']};}):[]};}):[]};}):[]:[]})[_0xc341('0xc')](function(_0x424b6c){logger[_0xc341('0xd')](_0xc341('0x22'),_0x32185a);logger['debug'](_0xc341('0x22'),_0x32185a,JSON[_0xc341('0x11')](_0x424b6c));_0x2a3e7c(_0x424b6c);})['catch'](function(_0x882e09){logger['error'](_0xc341('0x22'),_0x882e09[_0xc341('0x14')],_0x32185a);_0x1a7ab3(_0x13c225[_0xc341('0x12')](0x1f4,_0x882e09[_0xc341('0x14')]));});});}; \ No newline at end of file +var _0x199d=['rpc','../../config/environment','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','model','map','debug','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x199d,0x13d));var _0xd199=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x199d[_0x2abc3d];return _0x252745;};'use strict';var _=require(_0xd199('0x0'));var util=require(_0xd199('0x1'));var moment=require(_0xd199('0x2'));var BPromise=require(_0xd199('0x3'));var rs=require(_0xd199('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd199('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd199('0x6'))(_0xd199('0x7'));var config=require(_0xd199('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd199('0x9')][_0xd199('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5506c4,_0x366a78,_0x2e16ec){return new BPromise(function(_0x2e365a,_0x57a6d7){return client[_0xd199('0xb')](_0x5506c4,_0x2e16ec)[_0xd199('0xc')](function(_0x27cbe6){logger['info'](_0xd199('0xd'),_0x366a78,_0xd199('0xe'));logger['debug'](_0xd199('0xf'),_0x366a78,'request\x20sent',JSON[_0xd199('0x10')](_0x27cbe6));if(_0x27cbe6[_0xd199('0x11')]){if(_0x27cbe6[_0xd199('0x11')][_0xd199('0x12')]===0x1f4){logger[_0xd199('0x11')](_0xd199('0xd'),_0x366a78,_0x27cbe6[_0xd199('0x11')][_0xd199('0x13')]);return _0x57a6d7(_0x27cbe6[_0xd199('0x11')][_0xd199('0x13')]);}logger[_0xd199('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x366a78,_0x27cbe6[_0xd199('0x11')]['message']);return _0x2e365a(_0x27cbe6[_0xd199('0x11')][_0xd199('0x13')]);}else{logger[_0xd199('0x14')](_0xd199('0xd'),_0x366a78,'request\x20sent');_0x2e365a(_0x27cbe6[_0xd199('0x15')][_0xd199('0x13')]);}})[_0xd199('0x16')](function(_0x16a7c5){logger[_0xd199('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x366a78,_0x16a7c5);_0x57a6d7(_0x16a7c5);});});}exports[_0xd199('0x17')]=function(_0x57f3f7){var _0xf97c6e=this;return new Promise(function(_0xd01c21,_0x3d7fff){return db[_0xd199('0x18')][_0xd199('0x19')]({'raw':_0x57f3f7[_0xd199('0x1a')]?_0x57f3f7[_0xd199('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x57f3f7[_0xd199('0x1a')]?_0x57f3f7[_0xd199('0x1a')][_0xd199('0x1b')]||null:null,'attributes':_0x57f3f7[_0xd199('0x1a')]?_0x57f3f7['options'][_0xd199('0x1c')]||null:null,'limit':_0x57f3f7['options']?_0x57f3f7['options'][_0xd199('0x1d')]||null:null,'include':_0x57f3f7[_0xd199('0x1a')]?_0x57f3f7[_0xd199('0x1a')]['include']?_['map'](_0x57f3f7[_0xd199('0x1a')][_0xd199('0x1e')],function(_0x5653d0){return{'model':db[_0x5653d0[_0xd199('0x1f')]],'as':_0x5653d0['as'],'attributes':_0x5653d0[_0xd199('0x1c')],'include':_0x5653d0[_0xd199('0x1e')]?_[_0xd199('0x20')](_0x5653d0[_0xd199('0x1e')],function(_0x3aa616){return{'model':db[_0x3aa616[_0xd199('0x1f')]],'as':_0x3aa616['as'],'attributes':_0x3aa616[_0xd199('0x1c')],'include':_0x3aa616[_0xd199('0x1e')]?_['map'](_0x3aa616['include'],function(_0x2dd652){return{'model':db[_0x2dd652[_0xd199('0x1f')]],'as':_0x2dd652['as'],'attributes':_0x2dd652[_0xd199('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49bd83){logger[_0xd199('0x14')](_0xd199('0x17'),_0x57f3f7);logger[_0xd199('0x21')](_0xd199('0x17'),_0x57f3f7,JSON[_0xd199('0x10')](_0x49bd83));_0xd01c21(_0x49bd83);})[_0xd199('0x16')](function(_0x3c1269){logger[_0xd199('0x11')](_0xd199('0x17'),_0x3c1269[_0xd199('0x13')],_0x57f3f7);_0x3d7fff(_0xf97c6e['error'](0x1f4,_0x3c1269[_0xd199('0x13')]));});});};exports['ShowZohoAccount']=function(_0x5220a3){var _0x63c67c=this;return new Promise(function(_0x444380,_0x1eceff){return db[_0xd199('0x18')][_0xd199('0x22')]({'raw':_0x5220a3[_0xd199('0x1a')]?_0x5220a3['options'][_0xd199('0x23')]===undefined?!![]:![]:!![],'where':_0x5220a3[_0xd199('0x1a')]?_0x5220a3[_0xd199('0x1a')][_0xd199('0x1b')]||null:null,'attributes':_0x5220a3['options']?_0x5220a3[_0xd199('0x1a')][_0xd199('0x1c')]||null:null,'include':_0x5220a3['options']?_0x5220a3['options']['include']?_[_0xd199('0x20')](_0x5220a3[_0xd199('0x1a')][_0xd199('0x1e')],function(_0x542ad9){return{'model':db[_0x542ad9['model']],'as':_0x542ad9['as'],'attributes':_0x542ad9[_0xd199('0x1c')],'include':_0x542ad9['include']?_[_0xd199('0x20')](_0x542ad9[_0xd199('0x1e')],function(_0x3abae){return{'model':db[_0x3abae[_0xd199('0x1f')]],'as':_0x3abae['as'],'attributes':_0x3abae['attributes'],'include':_0x3abae[_0xd199('0x1e')]?_[_0xd199('0x20')](_0x3abae[_0xd199('0x1e')],function(_0xc42ecb){return{'model':db[_0xc42ecb[_0xd199('0x1f')]],'as':_0xc42ecb['as'],'attributes':_0xc42ecb[_0xd199('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd199('0xc')](function(_0x59f04f){logger['info']('ShowZohoAccount',_0x5220a3);logger[_0xd199('0x21')]('ShowZohoAccount',_0x5220a3,JSON[_0xd199('0x10')](_0x59f04f));_0x444380(_0x59f04f);})[_0xd199('0x16')](function(_0x103ddd){logger[_0xd199('0x11')]('ShowZohoAccount',_0x103ddd['message'],_0x5220a3);_0x1eceff(_0x63c67c[_0xd199('0x11')](0x1f4,_0x103ddd[_0xd199('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index dbf9878..0dfacdc 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 _0xb9d3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x32ab2f,_0x3eea13){var _0x13caf2=function(_0x4050e4){while(--_0x4050e4){_0x32ab2f['push'](_0x32ab2f['shift']());}};_0x13caf2(++_0x3eea13);}(_0xb9d3,0xd3));var _0x3b9d=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb9d3[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0x3b9d('0x0'));var util=require('util');var path=require(_0x3b9d('0x1'));var timeout=require(_0x3b9d('0x2'));var express=require(_0x3b9d('0x3'));var router=express[_0x3b9d('0x4')]();var fs_extra=require(_0x3b9d('0x5'));var auth=require(_0x3b9d('0x6'));var interaction=require(_0x3b9d('0x7'));var config=require(_0x3b9d('0x8'));var controller=require(_0x3b9d('0x9'));router[_0x3b9d('0xa')]('/',auth[_0x3b9d('0xb')](),controller['index']);router[_0x3b9d('0xa')](_0x3b9d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3b9d('0xa')](_0x3b9d('0xd'),auth[_0x3b9d('0xb')](),controller[_0x3b9d('0xe')]);router[_0x3b9d('0xa')]('/:id/subjects',auth[_0x3b9d('0xb')](),controller[_0x3b9d('0xf')]);router['get'](_0x3b9d('0x10'),auth[_0x3b9d('0xb')](),controller[_0x3b9d('0x11')]);router[_0x3b9d('0x12')]('/',auth[_0x3b9d('0xb')](),controller[_0x3b9d('0x13')]);router[_0x3b9d('0x14')](_0x3b9d('0xc'),auth[_0x3b9d('0xb')](),controller[_0x3b9d('0x15')]);router['delete'](_0x3b9d('0xc'),auth[_0x3b9d('0xb')](),controller[_0x3b9d('0x16')]);module[_0x3b9d('0x17')]=router; \ No newline at end of file +var _0x8be1=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x5503dd,_0x4b0e5c){var _0x378f23=function(_0x4682ae){while(--_0x4682ae){_0x5503dd['push'](_0x5503dd['shift']());}};_0x378f23(++_0x4b0e5c);}(_0x8be1,0x17b));var _0x18be=function(_0x3eb4da,_0x2bf8da){_0x3eb4da=_0x3eb4da-0x0;var _0x40134a=_0x8be1[_0x3eb4da];return _0x40134a;};'use strict';var multer=require(_0x18be('0x0'));var util=require('util');var path=require(_0x18be('0x1'));var timeout=require('connect-timeout');var express=require(_0x18be('0x2'));var router=express[_0x18be('0x3')]();var fs_extra=require(_0x18be('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x18be('0x5'));var controller=require('./intZohoConfiguration.controller');router[_0x18be('0x6')]('/',auth[_0x18be('0x7')](),controller[_0x18be('0x8')]);router[_0x18be('0x6')](_0x18be('0x9'),auth[_0x18be('0x7')](),controller[_0x18be('0xa')]);router[_0x18be('0x6')](_0x18be('0xb'),auth[_0x18be('0x7')](),controller[_0x18be('0xc')]);router['get'](_0x18be('0xd'),auth[_0x18be('0x7')](),controller[_0x18be('0xe')]);router[_0x18be('0x6')](_0x18be('0xf'),auth['isAuthenticated'](),controller[_0x18be('0x10')]);router[_0x18be('0x11')]('/',auth['isAuthenticated'](),controller[_0x18be('0x12')]);router[_0x18be('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18be('0x14')]);router[_0x18be('0x15')](_0x18be('0x9'),auth[_0x18be('0x7')](),controller[_0x18be('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 72e3b50..e7f5e80 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 _0x89c9=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x3517e0,_0x1d59aa){var _0x36d8cc=function(_0x8d102a){while(--_0x8d102a){_0x3517e0['push'](_0x3517e0['shift']());}};_0x36d8cc(++_0x1d59aa);}(_0x89c9,0xb0));var _0x989c=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0x89c9[_0x4a45b4];return _0x1a99c9;};'use strict';var Sequelize=require(_0x989c('0x0'));module[_0x989c('0x1')]={'name':{'type':Sequelize[_0x989c('0x2')]},'moduleCreate':{'type':Sequelize[_0x989c('0x3')](_0x989c('0x4'),_0x989c('0x5'),_0x989c('0x6')),'defaultValue':_0x989c('0x4')},'moduleSearch':{'type':Sequelize[_0x989c('0x3')]('contact_lead','contact','lead'),'defaultValue':_0x989c('0x7')},'description':{'type':Sequelize[_0x989c('0x2')]}}; \ No newline at end of file +var _0xf837=['lead','contact_lead','sequelize','exports','STRING','ENUM','contact'];(function(_0x4b1fdd,_0x4a82e5){var _0x2b731a=function(_0x561f71){while(--_0x561f71){_0x4b1fdd['push'](_0x4b1fdd['shift']());}};_0x2b731a(++_0x4a82e5);}(_0xf837,0x1ec));var _0x7f83=function(_0xc3b145,_0x287dc7){_0xc3b145=_0xc3b145-0x0;var _0x1f5f32=_0xf837[_0xc3b145];return _0x1f5f32;};'use strict';var Sequelize=require(_0x7f83('0x0'));module[_0x7f83('0x1')]={'name':{'type':Sequelize[_0x7f83('0x2')]},'moduleCreate':{'type':Sequelize[_0x7f83('0x3')]('lead',_0x7f83('0x4'),'nothing'),'defaultValue':_0x7f83('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0x7f83('0x6'),_0x7f83('0x4'),_0x7f83('0x5')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x7f83('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 68e1c90..dcbb96d 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 _0xfd7b=['filters','attributes','intersection','fields','query','length','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','findAll','catch','show','params','includeAll','include','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','stack','name','send','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0xfd7b,0x72));var _0xbfd7=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xfd7b[_0x424501];return _0xb719af;};'use strict';var emlformat=require(_0xbfd7('0x0'));var rimraf=require(_0xbfd7('0x1'));var zipdir=require(_0xbfd7('0x2'));var jsonpatch=require(_0xbfd7('0x3'));var rp=require(_0xbfd7('0x4'));var moment=require('moment');var BPromise=require(_0xbfd7('0x5'));var Mustache=require(_0xbfd7('0x6'));var util=require('util');var path=require(_0xbfd7('0x7'));var sox=require(_0xbfd7('0x8'));var csv=require(_0xbfd7('0x9'));var ejs=require(_0xbfd7('0xa'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xb'));var _=require(_0xbfd7('0xc'));var squel=require(_0xbfd7('0xd'));var crypto=require(_0xbfd7('0xe'));var jsforce=require(_0xbfd7('0xf'));var deskjs=require(_0xbfd7('0x10'));var toCsv=require(_0xbfd7('0x9'));var querystring=require('querystring');var Papa=require(_0xbfd7('0x11'));var Redis=require(_0xbfd7('0x12'));var authService=require(_0xbfd7('0x13'));var qs=require(_0xbfd7('0x14'));var as=require(_0xbfd7('0x15'));var hardwareService=require(_0xbfd7('0x16'));var logger=require(_0xbfd7('0x17'))(_0xbfd7('0x18'));var utils=require(_0xbfd7('0x19'));var config=require(_0xbfd7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbfd7('0x1b'))['db'];function respondWithStatusCode(_0xbce78d,_0x49c785){_0x49c785=_0x49c785||0xcc;return function(_0x24a105){if(_0x24a105){return _0xbce78d['sendStatus'](_0x49c785);}return _0xbce78d['status'](_0x49c785)['end']();};}function respondWithResult(_0xdf46b6,_0x336210){_0x336210=_0x336210||0xc8;return function(_0x16bd75){if(_0x16bd75){return _0xdf46b6[_0xbfd7('0x1c')](_0x336210)[_0xbfd7('0x1d')](_0x16bd75);}};}function respondWithFilteredResult(_0x4e8488,_0x3b427a){return function(_0x4fe448){if(_0x4fe448){var _0x16f951=typeof _0x3b427a[_0xbfd7('0x1e')]==='undefined'&&typeof _0x3b427a[_0xbfd7('0x1f')]==='undefined';var _0x355793=_0x4fe448[_0xbfd7('0x20')];var _0x55f04c=_0x16f951?0x0:_0x3b427a[_0xbfd7('0x1e')];var _0x5068f2=_0x16f951?_0x4fe448[_0xbfd7('0x20')]:_0x3b427a['offset']+_0x3b427a[_0xbfd7('0x1f')];var _0x46cf64;if(_0x5068f2>=_0x355793){_0x5068f2=_0x355793;_0x46cf64=0xc8;}else{_0x46cf64=0xce;}_0x4e8488[_0xbfd7('0x1c')](_0x46cf64);return _0x4e8488[_0xbfd7('0x21')](_0xbfd7('0x22'),_0x55f04c+'-'+_0x5068f2+'/'+_0x355793)[_0xbfd7('0x1d')](_0x4fe448);}return null;};}function patchUpdates(_0x3078f5){return function(_0x26d24b){try{jsonpatch[_0xbfd7('0x23')](_0x26d24b,_0x3078f5,!![]);}catch(_0x2e7286){return BPromise['reject'](_0x2e7286);}return _0x26d24b[_0xbfd7('0x24')]();};}function saveUpdates(_0xfb5dc8,_0x242d40){return function(_0x5c6d02){if(_0x5c6d02){return _0x5c6d02[_0xbfd7('0x25')](_0xfb5dc8)[_0xbfd7('0x26')](function(_0x699672){return _0x699672;});}return null;};}function removeEntity(_0x188957,_0x2dcab0){return function(_0x247954){if(_0x247954){return _0x247954[_0xbfd7('0x27')]()[_0xbfd7('0x26')](function(){_0x188957[_0xbfd7('0x1c')](0xcc)[_0xbfd7('0x28')]();});}};}function handleEntityNotFound(_0x25ee36,_0x3f4137){return function(_0x75e7f1){if(!_0x75e7f1){_0x25ee36[_0xbfd7('0x29')](0x194);}return _0x75e7f1;};}function handleError(_0x4349b1,_0x13e5bf){_0x13e5bf=_0x13e5bf||0x1f4;return function(_0x21dd50){logger['error'](_0x21dd50[_0xbfd7('0x2a')]);if(_0x21dd50[_0xbfd7('0x2b')]){delete _0x21dd50[_0xbfd7('0x2b')];}_0x4349b1[_0xbfd7('0x1c')](_0x13e5bf)[_0xbfd7('0x2c')](_0x21dd50);};}exports['index']=function(_0x2d6ba3,_0x41003f){var _0x5607db={},_0x156572={},_0x160f83={'count':0x0,'rows':[]};var _0x397cfe=_['map'](db[_0xbfd7('0x2d')][_0xbfd7('0x2e')],function(_0x5a1891){return{'name':_0x5a1891[_0xbfd7('0x2f')],'type':_0x5a1891[_0xbfd7('0x30')][_0xbfd7('0x31')]};});_0x156572[_0xbfd7('0x32')]=_['map'](_0x397cfe,_0xbfd7('0x2b'));_0x156572['query']=_[_0xbfd7('0x33')](_0x2d6ba3['query']);_0x156572[_0xbfd7('0x34')]=_['intersection'](_0x156572[_0xbfd7('0x32')],_0x156572['query']);_0x5607db[_0xbfd7('0x35')]=_[_0xbfd7('0x36')](_0x156572['model'],qs[_0xbfd7('0x37')](_0x2d6ba3[_0xbfd7('0x38')][_0xbfd7('0x37')]));_0x5607db[_0xbfd7('0x35')]=_0x5607db[_0xbfd7('0x35')][_0xbfd7('0x39')]?_0x5607db[_0xbfd7('0x35')]:_0x156572['model'];if(!_0x2d6ba3[_0xbfd7('0x38')]['hasOwnProperty'](_0xbfd7('0x3a'))){_0x5607db[_0xbfd7('0x1f')]=qs['limit'](_0x2d6ba3[_0xbfd7('0x38')][_0xbfd7('0x1f')]);_0x5607db[_0xbfd7('0x1e')]=qs['offset'](_0x2d6ba3[_0xbfd7('0x38')][_0xbfd7('0x1e')]);}_0x5607db[_0xbfd7('0x3b')]=qs['sort'](_0x2d6ba3[_0xbfd7('0x38')][_0xbfd7('0x3c')]);_0x5607db[_0xbfd7('0x3d')]=qs[_0xbfd7('0x34')](_[_0xbfd7('0x3e')](_0x2d6ba3['query'],_0x156572['filters']),_0x397cfe);if(_0x2d6ba3['query']['filter']){_0x5607db[_0xbfd7('0x3d')]=_['merge'](_0x5607db[_0xbfd7('0x3d')],{'$or':_[_0xbfd7('0x3f')](_0x397cfe,function(_0x497565){if(_0x497565['type']!==_0xbfd7('0x40')){var _0x4fdd10={};_0x4fdd10[_0x497565[_0xbfd7('0x2b')]]={'$like':'%'+_0x2d6ba3[_0xbfd7('0x38')][_0xbfd7('0x41')]+'%'};return _0x4fdd10;}})});}_0x5607db=_[_0xbfd7('0x42')]({},_0x5607db,_0x2d6ba3[_0xbfd7('0x43')]);var _0x1deb7c={'where':_0x5607db[_0xbfd7('0x3d')]};return db[_0xbfd7('0x2d')][_0xbfd7('0x20')](_0x1deb7c)[_0xbfd7('0x26')](function(_0x5de50e){_0x160f83['count']=_0x5de50e;if(_0x2d6ba3['query']['includeAll']){_0x5607db['include']=[{'all':!![]}];}return db[_0xbfd7('0x2d')][_0xbfd7('0x44')](_0x5607db);})['then'](function(_0x2f531a){_0x160f83['rows']=_0x2f531a;return _0x160f83;})['then'](respondWithFilteredResult(_0x41003f,_0x5607db))[_0xbfd7('0x45')](handleError(_0x41003f,null));};exports[_0xbfd7('0x46')]=function(_0x57d44d,_0x345897){var _0xdefb73={'raw':![],'where':{'id':_0x57d44d[_0xbfd7('0x47')]['id']}},_0xa648be={};_0xa648be[_0xbfd7('0x32')]=_[_0xbfd7('0x33')](db[_0xbfd7('0x2d')][_0xbfd7('0x2e')]);_0xa648be[_0xbfd7('0x38')]=_[_0xbfd7('0x33')](_0x57d44d[_0xbfd7('0x38')]);_0xa648be[_0xbfd7('0x34')]=_[_0xbfd7('0x36')](_0xa648be[_0xbfd7('0x32')],_0xa648be[_0xbfd7('0x38')]);_0xdefb73[_0xbfd7('0x35')]=_[_0xbfd7('0x36')](_0xa648be[_0xbfd7('0x32')],qs[_0xbfd7('0x37')](_0x57d44d[_0xbfd7('0x38')][_0xbfd7('0x37')]));_0xdefb73[_0xbfd7('0x35')]=_0xdefb73['attributes'][_0xbfd7('0x39')]?_0xdefb73[_0xbfd7('0x35')]:_0xa648be['model'];if(_0x57d44d['query'][_0xbfd7('0x48')]){_0xdefb73[_0xbfd7('0x49')]=[{'all':!![]}];}_0xdefb73=_[_0xbfd7('0x42')]({},_0xdefb73,_0x57d44d[_0xbfd7('0x43')]);return db[_0xbfd7('0x2d')][_0xbfd7('0x4a')](_0xdefb73)['then'](handleEntityNotFound(_0x345897,null))[_0xbfd7('0x26')](respondWithResult(_0x345897,null))['catch'](handleError(_0x345897,null));};exports[_0xbfd7('0x4b')]=function(_0x503b1f,_0x2b4190){return db[_0xbfd7('0x2d')][_0xbfd7('0x4b')](_0x503b1f[_0xbfd7('0x4c')],{})[_0xbfd7('0x26')](respondWithResult(_0x2b4190,0xc9))[_0xbfd7('0x45')](handleError(_0x2b4190,null));};exports[_0xbfd7('0x25')]=function(_0x2373db,_0x3452ab){if(_0x2373db[_0xbfd7('0x4c')]['id']){delete _0x2373db[_0xbfd7('0x4c')]['id'];}return db[_0xbfd7('0x2d')][_0xbfd7('0x4a')]({'where':{'id':_0x2373db['params']['id']}})['then'](handleEntityNotFound(_0x3452ab,null))[_0xbfd7('0x26')](saveUpdates(_0x2373db[_0xbfd7('0x4c')],null))['then'](respondWithResult(_0x3452ab,null))[_0xbfd7('0x45')](handleError(_0x3452ab,null));};exports[_0xbfd7('0x27')]=function(_0x5a1051,_0x28d433){return db['ZohoConfiguration'][_0xbfd7('0x4a')]({'where':{'id':_0x5a1051['params']['id']}})['then'](handleEntityNotFound(_0x28d433,null))[_0xbfd7('0x26')](removeEntity(_0x28d433,null))[_0xbfd7('0x45')](handleError(_0x28d433,null));};exports[_0xbfd7('0x4d')]=function(_0x16b9c7,_0x216190,_0x51136b){var _0x38fc24={};var _0x1b51c9={};var _0x484e14;var _0xc6a344;return db['ZohoConfiguration'][_0xbfd7('0x4e')]({'where':{'id':_0x16b9c7[_0xbfd7('0x47')]['id']}})['then'](handleEntityNotFound(_0x216190,null))[_0xbfd7('0x26')](function(_0x4499d2){if(_0x4499d2){_0x484e14=_0x4499d2;_0x1b51c9['model']=_[_0xbfd7('0x33')](db[_0xbfd7('0x4f')]['rawAttributes']);_0x1b51c9[_0xbfd7('0x38')]=_['keys'](_0x16b9c7[_0xbfd7('0x38')]);_0x1b51c9[_0xbfd7('0x34')]=_[_0xbfd7('0x36')](_0x1b51c9['model'],_0x1b51c9[_0xbfd7('0x38')]);_0x38fc24[_0xbfd7('0x35')]=_[_0xbfd7('0x36')](_0x1b51c9['model'],qs[_0xbfd7('0x37')](_0x16b9c7[_0xbfd7('0x38')][_0xbfd7('0x37')]));_0x38fc24[_0xbfd7('0x35')]=_0x38fc24[_0xbfd7('0x35')][_0xbfd7('0x39')]?_0x38fc24[_0xbfd7('0x35')]:_0x1b51c9[_0xbfd7('0x32')];_0x38fc24[_0xbfd7('0x3b')]=qs['sort'](_0x16b9c7[_0xbfd7('0x38')][_0xbfd7('0x3c')]);_0x38fc24['where']=qs[_0xbfd7('0x34')](_[_0xbfd7('0x3e')](_0x16b9c7[_0xbfd7('0x38')],_0x1b51c9[_0xbfd7('0x34')]));if(_0x16b9c7[_0xbfd7('0x38')]['filter']){_0x38fc24[_0xbfd7('0x3d')]=_['merge'](_0x38fc24[_0xbfd7('0x3d')],{'$or':_[_0xbfd7('0x3f')](_0x38fc24[_0xbfd7('0x35')],function(_0x5c8d4e){var _0x91fafe={};_0x91fafe[_0x5c8d4e]={'$like':'%'+_0x16b9c7[_0xbfd7('0x38')][_0xbfd7('0x41')]+'%'};return _0x91fafe;})});}_0x38fc24=_[_0xbfd7('0x42')]({},_0x38fc24,_0x16b9c7[_0xbfd7('0x43')]);return _0x484e14['getFields'](_0x38fc24);}})[_0xbfd7('0x26')](function(_0xf8cd33){if(_0xf8cd33){_0xc6a344=_0xf8cd33[_0xbfd7('0x39')];if(!_0x16b9c7[_0xbfd7('0x38')][_0xbfd7('0x50')](_0xbfd7('0x3a'))){_0x38fc24['limit']=qs[_0xbfd7('0x1f')](_0x16b9c7[_0xbfd7('0x38')]['limit']);_0x38fc24[_0xbfd7('0x1e')]=qs[_0xbfd7('0x1e')](_0x16b9c7[_0xbfd7('0x38')][_0xbfd7('0x1e')]);}return _0x484e14[_0xbfd7('0x4d')](_0x38fc24);}})['then'](function(_0x1631a4){if(_0x1631a4){return _0x1631a4?{'count':_0xc6a344,'rows':_0x1631a4}:null;}})['then'](respondWithResult(_0x216190,null))['catch'](handleError(_0x216190,null));};exports['getSubjects']=function(_0x397ede,_0x52caeb,_0x15a78e){var _0x4c14a8={};var _0x4ea40e={};var _0x3305dd;var _0x548f55;return db[_0xbfd7('0x2d')][_0xbfd7('0x4e')]({'where':{'id':_0x397ede['params']['id']}})[_0xbfd7('0x26')](handleEntityNotFound(_0x52caeb,null))['then'](function(_0x462194){if(_0x462194){_0x3305dd=_0x462194;_0x4ea40e[_0xbfd7('0x32')]=_[_0xbfd7('0x33')](db[_0xbfd7('0x4f')][_0xbfd7('0x2e')]);_0x4ea40e[_0xbfd7('0x38')]=_[_0xbfd7('0x33')](_0x397ede[_0xbfd7('0x38')]);_0x4ea40e['filters']=_[_0xbfd7('0x36')](_0x4ea40e['model'],_0x4ea40e[_0xbfd7('0x38')]);_0x4c14a8['attributes']=_[_0xbfd7('0x36')](_0x4ea40e[_0xbfd7('0x32')],qs[_0xbfd7('0x37')](_0x397ede['query'][_0xbfd7('0x37')]));_0x4c14a8[_0xbfd7('0x35')]=_0x4c14a8[_0xbfd7('0x35')][_0xbfd7('0x39')]?_0x4c14a8[_0xbfd7('0x35')]:_0x4ea40e[_0xbfd7('0x32')];_0x4c14a8[_0xbfd7('0x3b')]=qs['sort'](_0x397ede[_0xbfd7('0x38')][_0xbfd7('0x3c')]);_0x4c14a8['where']=qs[_0xbfd7('0x34')](_[_0xbfd7('0x3e')](_0x397ede['query'],_0x4ea40e[_0xbfd7('0x34')]));if(_0x397ede[_0xbfd7('0x38')]['filter']){_0x4c14a8[_0xbfd7('0x3d')]=_[_0xbfd7('0x42')](_0x4c14a8[_0xbfd7('0x3d')],{'$or':_[_0xbfd7('0x3f')](_0x4c14a8[_0xbfd7('0x35')],function(_0x3a7a3e){var _0x660c2={};_0x660c2[_0x3a7a3e]={'$like':'%'+_0x397ede[_0xbfd7('0x38')][_0xbfd7('0x41')]+'%'};return _0x660c2;})});}_0x4c14a8=_[_0xbfd7('0x42')]({},_0x4c14a8,_0x397ede[_0xbfd7('0x43')]);return _0x3305dd[_0xbfd7('0x51')](_0x4c14a8);}})['then'](function(_0x50b8af){if(_0x50b8af){_0x548f55=_0x50b8af[_0xbfd7('0x39')];if(!_0x397ede[_0xbfd7('0x38')][_0xbfd7('0x50')](_0xbfd7('0x3a'))){_0x4c14a8['limit']=qs[_0xbfd7('0x1f')](_0x397ede[_0xbfd7('0x38')][_0xbfd7('0x1f')]);_0x4c14a8['offset']=qs[_0xbfd7('0x1e')](_0x397ede[_0xbfd7('0x38')][_0xbfd7('0x1e')]);}return _0x3305dd[_0xbfd7('0x51')](_0x4c14a8);}})[_0xbfd7('0x26')](function(_0x596b95){if(_0x596b95){return _0x596b95?{'count':_0x548f55,'rows':_0x596b95}:null;}})[_0xbfd7('0x26')](respondWithResult(_0x52caeb,null))[_0xbfd7('0x45')](handleError(_0x52caeb,null));};exports[_0xbfd7('0x52')]=function(_0x5be775,_0x1276f6,_0xb1d320){var _0x403cf8={};var _0x5619a2={};var _0x211b19;var _0x51a2c1;return db[_0xbfd7('0x2d')][_0xbfd7('0x4e')]({'where':{'id':_0x5be775[_0xbfd7('0x47')]['id']}})['then'](handleEntityNotFound(_0x1276f6,null))[_0xbfd7('0x26')](function(_0x5fdcf8){if(_0x5fdcf8){_0x211b19=_0x5fdcf8;_0x5619a2[_0xbfd7('0x32')]=_[_0xbfd7('0x33')](db[_0xbfd7('0x4f')][_0xbfd7('0x2e')]);_0x5619a2[_0xbfd7('0x38')]=_['keys'](_0x5be775[_0xbfd7('0x38')]);_0x5619a2[_0xbfd7('0x34')]=_[_0xbfd7('0x36')](_0x5619a2['model'],_0x5619a2[_0xbfd7('0x38')]);_0x403cf8[_0xbfd7('0x35')]=_[_0xbfd7('0x36')](_0x5619a2['model'],qs[_0xbfd7('0x37')](_0x5be775[_0xbfd7('0x38')][_0xbfd7('0x37')]));_0x403cf8[_0xbfd7('0x35')]=_0x403cf8[_0xbfd7('0x35')][_0xbfd7('0x39')]?_0x403cf8[_0xbfd7('0x35')]:_0x5619a2[_0xbfd7('0x32')];_0x403cf8['order']=qs['sort'](_0x5be775[_0xbfd7('0x38')]['sort']);_0x403cf8[_0xbfd7('0x3d')]=qs[_0xbfd7('0x34')](_[_0xbfd7('0x3e')](_0x5be775[_0xbfd7('0x38')],_0x5619a2[_0xbfd7('0x34')]));if(_0x5be775['query'][_0xbfd7('0x41')]){_0x403cf8[_0xbfd7('0x3d')]=_[_0xbfd7('0x42')](_0x403cf8['where'],{'$or':_[_0xbfd7('0x3f')](_0x403cf8['attributes'],function(_0x503790){var _0x121f94={};_0x121f94[_0x503790]={'$like':'%'+_0x5be775[_0xbfd7('0x38')]['filter']+'%'};return _0x121f94;})});}_0x403cf8=_['merge']({},_0x403cf8,_0x5be775[_0xbfd7('0x43')]);return _0x211b19[_0xbfd7('0x52')](_0x403cf8);}})[_0xbfd7('0x26')](function(_0x5a77b1){if(_0x5a77b1){_0x51a2c1=_0x5a77b1[_0xbfd7('0x39')];if(!_0x5be775[_0xbfd7('0x38')][_0xbfd7('0x50')](_0xbfd7('0x3a'))){_0x403cf8[_0xbfd7('0x1f')]=qs[_0xbfd7('0x1f')](_0x5be775[_0xbfd7('0x38')][_0xbfd7('0x1f')]);_0x403cf8[_0xbfd7('0x1e')]=qs['offset'](_0x5be775[_0xbfd7('0x38')][_0xbfd7('0x1e')]);}return _0x211b19[_0xbfd7('0x52')](_0x403cf8);}})[_0xbfd7('0x26')](function(_0xdab222){if(_0xdab222){return _0xdab222?{'count':_0x51a2c1,'rows':_0xdab222}:null;}})[_0xbfd7('0x26')](respondWithResult(_0x1276f6,null))[_0xbfd7('0x45')](handleError(_0x1276f6,null));}; \ No newline at end of file +var _0xeebb=['keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','params','catch','create','body','find','ZohoField','options','nolimit','getSubjects','getDescriptions','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','Content-Range','reject','update','then','destroy','sendStatus','error','stack','index','map','ZohoConfiguration','rawAttributes','fieldName','model','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeebb,0x1ee));var _0xbeeb=function(_0x15cbf2,_0x50e69a){_0x15cbf2=_0x15cbf2-0x0;var _0x2be316=_0xeebb[_0x15cbf2];return _0x2be316;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbeeb('0x0'));var jsonpatch=require(_0xbeeb('0x1'));var rp=require(_0xbeeb('0x2'));var moment=require(_0xbeeb('0x3'));var BPromise=require(_0xbeeb('0x4'));var Mustache=require(_0xbeeb('0x5'));var util=require(_0xbeeb('0x6'));var path=require(_0xbeeb('0x7'));var sox=require(_0xbeeb('0x8'));var csv=require(_0xbeeb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbeeb('0xa'));var _=require(_0xbeeb('0xb'));var squel=require('squel');var crypto=require(_0xbeeb('0xc'));var jsforce=require(_0xbeeb('0xd'));var deskjs=require(_0xbeeb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbeeb('0xf'));var Papa=require('papaparse');var Redis=require(_0xbeeb('0x10'));var authService=require(_0xbeeb('0x11'));var qs=require(_0xbeeb('0x12'));var as=require(_0xbeeb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbeeb('0x14'))(_0xbeeb('0x15'));var utils=require(_0xbeeb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbeeb('0x17'));var db=require(_0xbeeb('0x18'))['db'];function respondWithStatusCode(_0x16319e,_0x557543){_0x557543=_0x557543||0xcc;return function(_0x43849e){if(_0x43849e){return _0x16319e['sendStatus'](_0x557543);}return _0x16319e[_0xbeeb('0x19')](_0x557543)['end']();};}function respondWithResult(_0x44abf2,_0xfd5ad1){_0xfd5ad1=_0xfd5ad1||0xc8;return function(_0x240e90){if(_0x240e90){return _0x44abf2[_0xbeeb('0x19')](_0xfd5ad1)[_0xbeeb('0x1a')](_0x240e90);}};}function respondWithFilteredResult(_0x3b74ab,_0x29b971){return function(_0x43856b){if(_0x43856b){var _0x11c8a3=typeof _0x29b971[_0xbeeb('0x1b')]===_0xbeeb('0x1c')&&typeof _0x29b971[_0xbeeb('0x1d')]==='undefined';var _0x1655ff=_0x43856b['count'];var _0x5dea2c=_0x11c8a3?0x0:_0x29b971['offset'];var _0x5077ee=_0x11c8a3?_0x43856b['count']:_0x29b971['offset']+_0x29b971[_0xbeeb('0x1d')];var _0x203adf;if(_0x5077ee>=_0x1655ff){_0x5077ee=_0x1655ff;_0x203adf=0xc8;}else{_0x203adf=0xce;}_0x3b74ab[_0xbeeb('0x19')](_0x203adf);return _0x3b74ab['set'](_0xbeeb('0x1e'),_0x5dea2c+'-'+_0x5077ee+'/'+_0x1655ff)[_0xbeeb('0x1a')](_0x43856b);}return null;};}function patchUpdates(_0x510ea4){return function(_0x3630b9){try{jsonpatch['apply'](_0x3630b9,_0x510ea4,!![]);}catch(_0x13d321){return BPromise[_0xbeeb('0x1f')](_0x13d321);}return _0x3630b9['save']();};}function saveUpdates(_0x18db64,_0x4105d2){return function(_0x4ba7db){if(_0x4ba7db){return _0x4ba7db[_0xbeeb('0x20')](_0x18db64)[_0xbeeb('0x21')](function(_0x1830b1){return _0x1830b1;});}return null;};}function removeEntity(_0x542c76,_0x412b80){return function(_0x42a7f3){if(_0x42a7f3){return _0x42a7f3[_0xbeeb('0x22')]()[_0xbeeb('0x21')](function(){_0x542c76[_0xbeeb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2350dc,_0x1ec090){return function(_0x7a24ba){if(!_0x7a24ba){_0x2350dc[_0xbeeb('0x23')](0x194);}return _0x7a24ba;};}function handleError(_0x576629,_0x40584b){_0x40584b=_0x40584b||0x1f4;return function(_0x4fe514){logger[_0xbeeb('0x24')](_0x4fe514[_0xbeeb('0x25')]);if(_0x4fe514['name']){delete _0x4fe514['name'];}_0x576629[_0xbeeb('0x19')](_0x40584b)['send'](_0x4fe514);};}exports[_0xbeeb('0x26')]=function(_0x18b078,_0x3331dd){var _0x27124c={},_0x22404f={},_0x509ce0={'count':0x0,'rows':[]};var _0xbe0a4e=_[_0xbeeb('0x27')](db[_0xbeeb('0x28')][_0xbeeb('0x29')],function(_0x15a1fe){return{'name':_0x15a1fe[_0xbeeb('0x2a')],'type':_0x15a1fe['type']['key']};});_0x22404f[_0xbeeb('0x2b')]=_['map'](_0xbe0a4e,_0xbeeb('0x2c'));_0x22404f['query']=_[_0xbeeb('0x2d')](_0x18b078[_0xbeeb('0x2e')]);_0x22404f[_0xbeeb('0x2f')]=_['intersection'](_0x22404f[_0xbeeb('0x2b')],_0x22404f[_0xbeeb('0x2e')]);_0x27124c[_0xbeeb('0x30')]=_[_0xbeeb('0x31')](_0x22404f[_0xbeeb('0x2b')],qs[_0xbeeb('0x32')](_0x18b078[_0xbeeb('0x2e')][_0xbeeb('0x32')]));_0x27124c['attributes']=_0x27124c[_0xbeeb('0x30')][_0xbeeb('0x33')]?_0x27124c[_0xbeeb('0x30')]:_0x22404f[_0xbeeb('0x2b')];if(!_0x18b078['query'][_0xbeeb('0x34')]('nolimit')){_0x27124c[_0xbeeb('0x1d')]=qs[_0xbeeb('0x1d')](_0x18b078['query'][_0xbeeb('0x1d')]);_0x27124c[_0xbeeb('0x1b')]=qs['offset'](_0x18b078[_0xbeeb('0x2e')]['offset']);}_0x27124c[_0xbeeb('0x35')]=qs[_0xbeeb('0x36')](_0x18b078[_0xbeeb('0x2e')][_0xbeeb('0x36')]);_0x27124c[_0xbeeb('0x37')]=qs[_0xbeeb('0x2f')](_[_0xbeeb('0x38')](_0x18b078[_0xbeeb('0x2e')],_0x22404f[_0xbeeb('0x2f')]),_0xbe0a4e);if(_0x18b078[_0xbeeb('0x2e')]['filter']){_0x27124c['where']=_[_0xbeeb('0x39')](_0x27124c[_0xbeeb('0x37')],{'$or':_['map'](_0xbe0a4e,function(_0x241015){if(_0x241015['type']!==_0xbeeb('0x3a')){var _0x2dfb23={};_0x2dfb23[_0x241015[_0xbeeb('0x2c')]]={'$like':'%'+_0x18b078[_0xbeeb('0x2e')][_0xbeeb('0x3b')]+'%'};return _0x2dfb23;}})});}_0x27124c=_[_0xbeeb('0x39')]({},_0x27124c,_0x18b078['options']);var _0x4b7fdf={'where':_0x27124c['where']};return db[_0xbeeb('0x28')]['count'](_0x4b7fdf)[_0xbeeb('0x21')](function(_0x4d6faf){_0x509ce0[_0xbeeb('0x3c')]=_0x4d6faf;if(_0x18b078[_0xbeeb('0x2e')][_0xbeeb('0x3d')]){_0x27124c[_0xbeeb('0x3e')]=[{'all':!![]}];}return db[_0xbeeb('0x28')][_0xbeeb('0x3f')](_0x27124c);})[_0xbeeb('0x21')](function(_0x10f615){_0x509ce0[_0xbeeb('0x40')]=_0x10f615;return _0x509ce0;})[_0xbeeb('0x21')](respondWithFilteredResult(_0x3331dd,_0x27124c))['catch'](handleError(_0x3331dd,null));};exports[_0xbeeb('0x41')]=function(_0x246dd1,_0x3ad6e1){var _0x446b9e={'raw':![],'where':{'id':_0x246dd1[_0xbeeb('0x42')]['id']}},_0x472239={};_0x472239['model']=_[_0xbeeb('0x2d')](db['ZohoConfiguration']['rawAttributes']);_0x472239['query']=_[_0xbeeb('0x2d')](_0x246dd1[_0xbeeb('0x2e')]);_0x472239[_0xbeeb('0x2f')]=_['intersection'](_0x472239[_0xbeeb('0x2b')],_0x472239[_0xbeeb('0x2e')]);_0x446b9e[_0xbeeb('0x30')]=_[_0xbeeb('0x31')](_0x472239['model'],qs[_0xbeeb('0x32')](_0x246dd1[_0xbeeb('0x2e')][_0xbeeb('0x32')]));_0x446b9e[_0xbeeb('0x30')]=_0x446b9e[_0xbeeb('0x30')]['length']?_0x446b9e[_0xbeeb('0x30')]:_0x472239[_0xbeeb('0x2b')];if(_0x246dd1[_0xbeeb('0x2e')]['includeAll']){_0x446b9e[_0xbeeb('0x3e')]=[{'all':!![]}];}_0x446b9e=_['merge']({},_0x446b9e,_0x246dd1['options']);return db['ZohoConfiguration']['find'](_0x446b9e)[_0xbeeb('0x21')](handleEntityNotFound(_0x3ad6e1,null))[_0xbeeb('0x21')](respondWithResult(_0x3ad6e1,null))[_0xbeeb('0x43')](handleError(_0x3ad6e1,null));};exports[_0xbeeb('0x44')]=function(_0x4adfc0,_0x447fe9){return db['ZohoConfiguration'][_0xbeeb('0x44')](_0x4adfc0[_0xbeeb('0x45')],{})[_0xbeeb('0x21')](respondWithResult(_0x447fe9,0xc9))[_0xbeeb('0x43')](handleError(_0x447fe9,null));};exports[_0xbeeb('0x20')]=function(_0x530dcc,_0x162e68){if(_0x530dcc[_0xbeeb('0x45')]['id']){delete _0x530dcc['body']['id'];}return db['ZohoConfiguration'][_0xbeeb('0x46')]({'where':{'id':_0x530dcc['params']['id']}})[_0xbeeb('0x21')](handleEntityNotFound(_0x162e68,null))[_0xbeeb('0x21')](saveUpdates(_0x530dcc[_0xbeeb('0x45')],null))['then'](respondWithResult(_0x162e68,null))['catch'](handleError(_0x162e68,null));};exports[_0xbeeb('0x22')]=function(_0x5e3f0f,_0x456fcd){return db[_0xbeeb('0x28')]['find']({'where':{'id':_0x5e3f0f[_0xbeeb('0x42')]['id']}})[_0xbeeb('0x21')](handleEntityNotFound(_0x456fcd,null))[_0xbeeb('0x21')](removeEntity(_0x456fcd,null))[_0xbeeb('0x43')](handleError(_0x456fcd,null));};exports['getFields']=function(_0x1dff9b,_0x39984a,_0x15e680){var _0x204b00={};var _0x89b8a0={};var _0x1b3154;var _0x5ea558;return db[_0xbeeb('0x28')]['findOne']({'where':{'id':_0x1dff9b[_0xbeeb('0x42')]['id']}})[_0xbeeb('0x21')](handleEntityNotFound(_0x39984a,null))[_0xbeeb('0x21')](function(_0x5f08cc){if(_0x5f08cc){_0x1b3154=_0x5f08cc;_0x89b8a0[_0xbeeb('0x2b')]=_[_0xbeeb('0x2d')](db[_0xbeeb('0x47')][_0xbeeb('0x29')]);_0x89b8a0['query']=_['keys'](_0x1dff9b[_0xbeeb('0x2e')]);_0x89b8a0[_0xbeeb('0x2f')]=_['intersection'](_0x89b8a0['model'],_0x89b8a0[_0xbeeb('0x2e')]);_0x204b00['attributes']=_[_0xbeeb('0x31')](_0x89b8a0[_0xbeeb('0x2b')],qs['fields'](_0x1dff9b[_0xbeeb('0x2e')]['fields']));_0x204b00['attributes']=_0x204b00[_0xbeeb('0x30')][_0xbeeb('0x33')]?_0x204b00['attributes']:_0x89b8a0[_0xbeeb('0x2b')];_0x204b00['order']=qs[_0xbeeb('0x36')](_0x1dff9b[_0xbeeb('0x2e')]['sort']);_0x204b00[_0xbeeb('0x37')]=qs[_0xbeeb('0x2f')](_[_0xbeeb('0x38')](_0x1dff9b[_0xbeeb('0x2e')],_0x89b8a0[_0xbeeb('0x2f')]));if(_0x1dff9b[_0xbeeb('0x2e')][_0xbeeb('0x3b')]){_0x204b00[_0xbeeb('0x37')]=_[_0xbeeb('0x39')](_0x204b00[_0xbeeb('0x37')],{'$or':_[_0xbeeb('0x27')](_0x204b00[_0xbeeb('0x30')],function(_0x3cfd64){var _0x13bb3c={};_0x13bb3c[_0x3cfd64]={'$like':'%'+_0x1dff9b[_0xbeeb('0x2e')]['filter']+'%'};return _0x13bb3c;})});}_0x204b00=_['merge']({},_0x204b00,_0x1dff9b[_0xbeeb('0x48')]);return _0x1b3154['getFields'](_0x204b00);}})[_0xbeeb('0x21')](function(_0x3c1091){if(_0x3c1091){_0x5ea558=_0x3c1091[_0xbeeb('0x33')];if(!_0x1dff9b[_0xbeeb('0x2e')][_0xbeeb('0x34')](_0xbeeb('0x49'))){_0x204b00[_0xbeeb('0x1d')]=qs[_0xbeeb('0x1d')](_0x1dff9b[_0xbeeb('0x2e')][_0xbeeb('0x1d')]);_0x204b00['offset']=qs[_0xbeeb('0x1b')](_0x1dff9b[_0xbeeb('0x2e')][_0xbeeb('0x1b')]);}return _0x1b3154['getFields'](_0x204b00);}})['then'](function(_0x498140){if(_0x498140){return _0x498140?{'count':_0x5ea558,'rows':_0x498140}:null;}})[_0xbeeb('0x21')](respondWithResult(_0x39984a,null))[_0xbeeb('0x43')](handleError(_0x39984a,null));};exports[_0xbeeb('0x4a')]=function(_0x5f0553,_0x53c1fb,_0x5ab904){var _0x4c343e={};var _0x382d84={};var _0x4d3750;var _0x3f1177;return db[_0xbeeb('0x28')]['findOne']({'where':{'id':_0x5f0553[_0xbeeb('0x42')]['id']}})['then'](handleEntityNotFound(_0x53c1fb,null))[_0xbeeb('0x21')](function(_0x517112){if(_0x517112){_0x4d3750=_0x517112;_0x382d84[_0xbeeb('0x2b')]=_[_0xbeeb('0x2d')](db[_0xbeeb('0x47')]['rawAttributes']);_0x382d84[_0xbeeb('0x2e')]=_[_0xbeeb('0x2d')](_0x5f0553['query']);_0x382d84[_0xbeeb('0x2f')]=_['intersection'](_0x382d84['model'],_0x382d84[_0xbeeb('0x2e')]);_0x4c343e[_0xbeeb('0x30')]=_['intersection'](_0x382d84[_0xbeeb('0x2b')],qs['fields'](_0x5f0553['query']['fields']));_0x4c343e[_0xbeeb('0x30')]=_0x4c343e[_0xbeeb('0x30')]['length']?_0x4c343e[_0xbeeb('0x30')]:_0x382d84['model'];_0x4c343e[_0xbeeb('0x35')]=qs[_0xbeeb('0x36')](_0x5f0553[_0xbeeb('0x2e')]['sort']);_0x4c343e[_0xbeeb('0x37')]=qs['filters'](_[_0xbeeb('0x38')](_0x5f0553[_0xbeeb('0x2e')],_0x382d84[_0xbeeb('0x2f')]));if(_0x5f0553['query'][_0xbeeb('0x3b')]){_0x4c343e['where']=_['merge'](_0x4c343e[_0xbeeb('0x37')],{'$or':_[_0xbeeb('0x27')](_0x4c343e[_0xbeeb('0x30')],function(_0x2545cb){var _0x31dea5={};_0x31dea5[_0x2545cb]={'$like':'%'+_0x5f0553[_0xbeeb('0x2e')][_0xbeeb('0x3b')]+'%'};return _0x31dea5;})});}_0x4c343e=_[_0xbeeb('0x39')]({},_0x4c343e,_0x5f0553[_0xbeeb('0x48')]);return _0x4d3750['getSubjects'](_0x4c343e);}})[_0xbeeb('0x21')](function(_0x24f272){if(_0x24f272){_0x3f1177=_0x24f272[_0xbeeb('0x33')];if(!_0x5f0553[_0xbeeb('0x2e')][_0xbeeb('0x34')](_0xbeeb('0x49'))){_0x4c343e[_0xbeeb('0x1d')]=qs[_0xbeeb('0x1d')](_0x5f0553[_0xbeeb('0x2e')][_0xbeeb('0x1d')]);_0x4c343e[_0xbeeb('0x1b')]=qs['offset'](_0x5f0553['query'][_0xbeeb('0x1b')]);}return _0x4d3750[_0xbeeb('0x4a')](_0x4c343e);}})[_0xbeeb('0x21')](function(_0x4e13d8){if(_0x4e13d8){return _0x4e13d8?{'count':_0x3f1177,'rows':_0x4e13d8}:null;}})[_0xbeeb('0x21')](respondWithResult(_0x53c1fb,null))['catch'](handleError(_0x53c1fb,null));};exports[_0xbeeb('0x4b')]=function(_0xccb23d,_0x275ee0,_0x378a8f){var _0x2496b3={};var _0x10b06a={};var _0x4d149e;var _0x5815fc;return db['ZohoConfiguration'][_0xbeeb('0x4c')]({'where':{'id':_0xccb23d['params']['id']}})[_0xbeeb('0x21')](handleEntityNotFound(_0x275ee0,null))['then'](function(_0xd2445){if(_0xd2445){_0x4d149e=_0xd2445;_0x10b06a[_0xbeeb('0x2b')]=_[_0xbeeb('0x2d')](db[_0xbeeb('0x47')][_0xbeeb('0x29')]);_0x10b06a[_0xbeeb('0x2e')]=_[_0xbeeb('0x2d')](_0xccb23d[_0xbeeb('0x2e')]);_0x10b06a[_0xbeeb('0x2f')]=_[_0xbeeb('0x31')](_0x10b06a[_0xbeeb('0x2b')],_0x10b06a[_0xbeeb('0x2e')]);_0x2496b3[_0xbeeb('0x30')]=_[_0xbeeb('0x31')](_0x10b06a['model'],qs['fields'](_0xccb23d[_0xbeeb('0x2e')][_0xbeeb('0x32')]));_0x2496b3[_0xbeeb('0x30')]=_0x2496b3[_0xbeeb('0x30')][_0xbeeb('0x33')]?_0x2496b3[_0xbeeb('0x30')]:_0x10b06a[_0xbeeb('0x2b')];_0x2496b3[_0xbeeb('0x35')]=qs['sort'](_0xccb23d[_0xbeeb('0x2e')][_0xbeeb('0x36')]);_0x2496b3['where']=qs[_0xbeeb('0x2f')](_[_0xbeeb('0x38')](_0xccb23d[_0xbeeb('0x2e')],_0x10b06a[_0xbeeb('0x2f')]));if(_0xccb23d[_0xbeeb('0x2e')][_0xbeeb('0x3b')]){_0x2496b3[_0xbeeb('0x37')]=_[_0xbeeb('0x39')](_0x2496b3[_0xbeeb('0x37')],{'$or':_[_0xbeeb('0x27')](_0x2496b3[_0xbeeb('0x30')],function(_0x48121a){var _0x34279e={};_0x34279e[_0x48121a]={'$like':'%'+_0xccb23d[_0xbeeb('0x2e')][_0xbeeb('0x3b')]+'%'};return _0x34279e;})});}_0x2496b3=_[_0xbeeb('0x39')]({},_0x2496b3,_0xccb23d[_0xbeeb('0x48')]);return _0x4d149e[_0xbeeb('0x4b')](_0x2496b3);}})[_0xbeeb('0x21')](function(_0x2240db){if(_0x2240db){_0x5815fc=_0x2240db[_0xbeeb('0x33')];if(!_0xccb23d[_0xbeeb('0x2e')][_0xbeeb('0x34')](_0xbeeb('0x49'))){_0x2496b3['limit']=qs[_0xbeeb('0x1d')](_0xccb23d[_0xbeeb('0x2e')][_0xbeeb('0x1d')]);_0x2496b3[_0xbeeb('0x1b')]=qs['offset'](_0xccb23d['query']['offset']);}return _0x4d149e[_0xbeeb('0x4b')](_0x2496b3);}})[_0xbeeb('0x21')](function(_0x16ceaf){if(_0x16ceaf){return _0x16ceaf?{'count':_0x5815fc,'rows':_0x16ceaf}:null;}})[_0xbeeb('0x21')](respondWithResult(_0x275ee0,null))['catch'](handleError(_0x275ee0,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index d456cb6..5fc2ee9 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 _0xee7f=['../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1c5bf5,_0x2be5ee){var _0x1c81b8=function(_0x584a5b){while(--_0x584a5b){_0x1c5bf5['push'](_0x1c5bf5['shift']());}};_0x1c81b8(++_0x2be5ee);}(_0xee7f,0x1b1));var _0xfee7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee7f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfee7('0x0'));var util=require(_0xfee7('0x1'));var logger=require(_0xfee7('0x2'))(_0xfee7('0x3'));var moment=require(_0xfee7('0x4'));var BPromise=require(_0xfee7('0x5'));var rp=require(_0xfee7('0x6'));var fs=require('fs');var path=require(_0xfee7('0x7'));var rimraf=require(_0xfee7('0x8'));var config=require(_0xfee7('0x9'));var attributes=require(_0xfee7('0xa'));module['exports']=function(_0x57a7ff,_0x112b9e){return _0x57a7ff[_0xfee7('0xb')](_0xfee7('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8101=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5b7412,_0x28b1ed){var _0x2a55f5=function(_0x296ae9){while(--_0x296ae9){_0x5b7412['push'](_0x5b7412['shift']());}};_0x2a55f5(++_0x28b1ed);}(_0x8101,0x88));var _0x1810=function(_0x45ac0c,_0x2f8a58){_0x45ac0c=_0x45ac0c-0x0;var _0x4b4074=_0x8101[_0x45ac0c];return _0x4b4074;};'use strict';var _=require(_0x1810('0x0'));var util=require(_0x1810('0x1'));var logger=require(_0x1810('0x2'))(_0x1810('0x3'));var moment=require(_0x1810('0x4'));var BPromise=require(_0x1810('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1810('0x6'));var rimraf=require(_0x1810('0x7'));var config=require(_0x1810('0x8'));var attributes=require(_0x1810('0x9'));module[_0x1810('0xa')]=function(_0x58240d,_0x4b4286){return _0x58240d[_0x1810('0xb')]('ZohoConfiguration',attributes,{'tableName':_0x1810('0xc'),'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 ffbda68..9114070 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 _0x0599=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5b2d8f,_0x53f9d4){var _0x2f1fdf=function(_0x1fd085){while(--_0x1fd085){_0x5b2d8f['push'](_0x5b2d8f['shift']());}};_0x2f1fdf(++_0x53f9d4);}(_0x0599,0x1c7));var _0x9059=function(_0x21cdff,_0x2fb117){_0x21cdff=_0x21cdff-0x0;var _0x4385bf=_0x0599[_0x21cdff];return _0x4385bf;};'use strict';var _=require('lodash');var util=require(_0x9059('0x0'));var moment=require(_0x9059('0x1'));var BPromise=require(_0x9059('0x2'));var rs=require(_0x9059('0x3'));var fs=require('fs');var Redis=require(_0x9059('0x4'));var db=require(_0x9059('0x5'))['db'];var utils=require(_0x9059('0x6'));var logger=require('../../config/logger')(_0x9059('0x7'));var config=require('../../config/environment');var jayson=require(_0x9059('0x8'));var client=jayson[_0x9059('0x9')][_0x9059('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed75c,_0x1ebebe,_0x4921b4){return new BPromise(function(_0x20e139,_0x598f1e){return client[_0x9059('0xb')](_0x5ed75c,_0x4921b4)['then'](function(_0x5a72f7){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x1ebebe,'request\x20sent');logger[_0x9059('0xc')](_0x9059('0xd'),_0x1ebebe,'request\x20sent',JSON[_0x9059('0xe')](_0x5a72f7));if(_0x5a72f7['error']){if(_0x5a72f7[_0x9059('0xf')][_0x9059('0x10')]===0x1f4){logger['error'](_0x9059('0x11'),_0x1ebebe,_0x5a72f7[_0x9059('0xf')][_0x9059('0x12')]);return _0x598f1e(_0x5a72f7['error'][_0x9059('0x12')]);}logger[_0x9059('0xf')](_0x9059('0x11'),_0x1ebebe,_0x5a72f7[_0x9059('0xf')][_0x9059('0x12')]);return _0x20e139(_0x5a72f7[_0x9059('0xf')][_0x9059('0x12')]);}else{logger[_0x9059('0x13')](_0x9059('0x11'),_0x1ebebe,_0x9059('0x14'));_0x20e139(_0x5a72f7[_0x9059('0x15')][_0x9059('0x12')]);}})[_0x9059('0x16')](function(_0x39811d){logger['error'](_0x9059('0x11'),_0x1ebebe,_0x39811d);_0x598f1e(_0x39811d);});});} \ No newline at end of file +var _0x5250=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x561098,_0xdd1933){var _0x42701a=function(_0x2ab50f){while(--_0x2ab50f){_0x561098['push'](_0x561098['shift']());}};_0x42701a(++_0xdd1933);}(_0x5250,0x169));var _0x0525=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x5250[_0x267d8d];return _0x11a98f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0525('0x0'));var BPromise=require(_0x0525('0x1'));var rs=require(_0x0525('0x2'));var fs=require('fs');var Redis=require(_0x0525('0x3'));var db=require(_0x0525('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0525('0x5'))(_0x0525('0x6'));var config=require(_0x0525('0x7'));var jayson=require(_0x0525('0x8'));var client=jayson[_0x0525('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x198242,_0x570d03,_0x49091f){return new BPromise(function(_0x5c9cdc,_0x37d609){return client[_0x0525('0xa')](_0x198242,_0x49091f)['then'](function(_0x53d964){logger[_0x0525('0xb')](_0x0525('0xc'),_0x570d03,_0x0525('0xd'));logger['debug'](_0x0525('0xe'),_0x570d03,_0x0525('0xd'),JSON['stringify'](_0x53d964));if(_0x53d964[_0x0525('0xf')]){if(_0x53d964['error'][_0x0525('0x10')]===0x1f4){logger[_0x0525('0xf')](_0x0525('0xc'),_0x570d03,_0x53d964[_0x0525('0xf')][_0x0525('0x11')]);return _0x37d609(_0x53d964['error'][_0x0525('0x11')]);}logger[_0x0525('0xf')](_0x0525('0xc'),_0x570d03,_0x53d964[_0x0525('0xf')][_0x0525('0x11')]);return _0x5c9cdc(_0x53d964[_0x0525('0xf')][_0x0525('0x11')]);}else{logger[_0x0525('0xb')](_0x0525('0xc'),_0x570d03,_0x0525('0xd'));_0x5c9cdc(_0x53d964[_0x0525('0x12')]['message']);}})[_0x0525('0x13')](function(_0x44a9b3){logger[_0x0525('0xf')](_0x0525('0xc'),_0x570d03,_0x44a9b3);_0x37d609(_0x44a9b3);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 4bdf123..82ba963 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 _0x9cd9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x9cd9,0x10b));var _0x99cd=function(_0x2028e6,_0x25c8db){_0x2028e6=_0x2028e6-0x0;var _0x9a9441=_0x9cd9[_0x2028e6];return _0x9a9441;};'use strict';var multer=require(_0x99cd('0x0'));var util=require('util');var path=require(_0x99cd('0x1'));var timeout=require(_0x99cd('0x2'));var express=require(_0x99cd('0x3'));var router=express[_0x99cd('0x4')]();var fs_extra=require(_0x99cd('0x5'));var auth=require(_0x99cd('0x6'));var interaction=require(_0x99cd('0x7'));var config=require(_0x99cd('0x8'));var controller=require(_0x99cd('0x9'));router[_0x99cd('0xa')]('/',auth[_0x99cd('0xb')](),controller['index']);router[_0x99cd('0xa')](_0x99cd('0xc'),auth[_0x99cd('0xb')](),controller['show']);router['post']('/',auth[_0x99cd('0xb')](),controller[_0x99cd('0xd')]);router[_0x99cd('0xe')]('/:id',auth[_0x99cd('0xb')](),controller[_0x99cd('0xf')]);router[_0x99cd('0x10')](_0x99cd('0xc'),auth[_0x99cd('0xb')](),controller['destroy']);module[_0x99cd('0x11')]=router; \ No newline at end of file +var _0x829c=['./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x437e13,_0x3af614){var _0x1b5131=function(_0x4f5393){while(--_0x4f5393){_0x437e13['push'](_0x437e13['shift']());}};_0x1b5131(++_0x3af614);}(_0x829c,0x88));var _0xc829=function(_0x4be1fa,_0xe5d3eb){_0x4be1fa=_0x4be1fa-0x0;var _0x37a98b=_0x829c[_0x4be1fa];return _0x37a98b;};'use strict';var multer=require(_0xc829('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc829('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc829('0x2'));var config=require(_0xc829('0x3'));var controller=require(_0xc829('0x4'));router[_0xc829('0x5')]('/',auth[_0xc829('0x6')](),controller[_0xc829('0x7')]);router['get'](_0xc829('0x8'),auth[_0xc829('0x6')](),controller[_0xc829('0x9')]);router[_0xc829('0xa')]('/',auth[_0xc829('0x6')](),controller['create']);router['put'](_0xc829('0x8'),auth[_0xc829('0x6')](),controller['update']);router[_0xc829('0xb')]('/:id',auth[_0xc829('0x6')](),controller[_0xc829('0xc')]);module[_0xc829('0xd')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 9763ae4..492c231 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 _0xb92a=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0xa3b328,_0x4650e8){var _0x278f18=function(_0x36d52d){while(--_0x36d52d){_0xa3b328['push'](_0xa3b328['shift']());}};_0x278f18(++_0x4650e8);}(_0xb92a,0x194));var _0xab92=function(_0x3fd827,_0x2a2206){_0x3fd827=_0x3fd827-0x0;var _0x197eaf=_0xb92a[_0x3fd827];return _0x197eaf;};'use strict';var Sequelize=require(_0xab92('0x0'));module[_0xab92('0x1')]={'type':{'type':Sequelize[_0xab92('0x2')](_0xab92('0x3'),_0xab92('0x4'),'customVariable',_0xab92('0x5'),_0xab92('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xab92('0x7')]},'key':{'type':Sequelize[_0xab92('0x7')]},'keyType':{'type':Sequelize[_0xab92('0x2')](_0xab92('0x3'),_0xab92('0x4'),_0xab92('0x8'))},'keyContent':{'type':Sequelize[_0xab92('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xab92('0x7')]},'customField':{'type':Sequelize[_0xab92('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x85ca=['variable','customVariable','BOOLEAN','sequelize','picklist','string','STRING'];(function(_0x2277be,_0x35a10a){var _0x452b7f=function(_0x44c670){while(--_0x44c670){_0x2277be['push'](_0x2277be['shift']());}};_0x452b7f(++_0x35a10a);}(_0x85ca,0x96));var _0xa85c=function(_0x12dfcd,_0x38d3cd){_0x12dfcd=_0x12dfcd-0x0;var _0x197f39=_0x85ca[_0x12dfcd];return _0x197f39;};'use strict';var Sequelize=require(_0xa85c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable','customVariable','keyValue',_0xa85c('0x1')),'defaultValue':_0xa85c('0x2')},'content':{'type':Sequelize[_0xa85c('0x3')]},'key':{'type':Sequelize[_0xa85c('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0xa85c('0x2'),_0xa85c('0x4'),_0xa85c('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa85c('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa85c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa85c('0x3')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 5f3add6..f2cb99f 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 _0x0d7a=['index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','show','params','length','create','body','catch','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x280587,_0x4e9971){var _0x3b7543=function(_0x1e94de){while(--_0x1e94de){_0x280587['push'](_0x280587['shift']());}};_0x3b7543(++_0x4e9971);}(_0x0d7a,0x1e4));var _0xa0d7=function(_0x49ee37,_0x36dd00){_0x49ee37=_0x49ee37-0x0;var _0x228552=_0x0d7a[_0x49ee37];return _0x228552;};'use strict';var emlformat=require(_0xa0d7('0x0'));var rimraf=require(_0xa0d7('0x1'));var zipdir=require(_0xa0d7('0x2'));var jsonpatch=require(_0xa0d7('0x3'));var rp=require(_0xa0d7('0x4'));var moment=require(_0xa0d7('0x5'));var BPromise=require(_0xa0d7('0x6'));var Mustache=require(_0xa0d7('0x7'));var util=require(_0xa0d7('0x8'));var path=require('path');var sox=require(_0xa0d7('0x9'));var csv=require('to-csv');var ejs=require(_0xa0d7('0xa'));var fs=require('fs');var fs_extra=require(_0xa0d7('0xb'));var _=require('lodash');var squel=require(_0xa0d7('0xc'));var crypto=require('crypto');var jsforce=require(_0xa0d7('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa0d7('0xe'));var Papa=require(_0xa0d7('0xf'));var Redis=require(_0xa0d7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa0d7('0x11'));var hardwareService=require(_0xa0d7('0x12'));var logger=require(_0xa0d7('0x13'))(_0xa0d7('0x14'));var utils=require('../../config/utils');var config=require(_0xa0d7('0x15'));var licenseUtil=require(_0xa0d7('0x16'));var db=require(_0xa0d7('0x17'))['db'];function respondWithStatusCode(_0x3b086f,_0x246c72){_0x246c72=_0x246c72||0xcc;return function(_0x4b6f67){if(_0x4b6f67){return _0x3b086f[_0xa0d7('0x18')](_0x246c72);}return _0x3b086f[_0xa0d7('0x19')](_0x246c72)[_0xa0d7('0x1a')]();};}function respondWithResult(_0x2d3146,_0x50d53d){_0x50d53d=_0x50d53d||0xc8;return function(_0x4f75e4){if(_0x4f75e4){return _0x2d3146[_0xa0d7('0x19')](_0x50d53d)[_0xa0d7('0x1b')](_0x4f75e4);}};}function respondWithFilteredResult(_0xa27275,_0xec3bbd){return function(_0x14089b){if(_0x14089b){var _0x25ac1d=typeof _0xec3bbd['offset']===_0xa0d7('0x1c')&&typeof _0xec3bbd[_0xa0d7('0x1d')]===_0xa0d7('0x1c');var _0x25ad5a=_0x14089b[_0xa0d7('0x1e')];var _0x55f487=_0x25ac1d?0x0:_0xec3bbd[_0xa0d7('0x1f')];var _0x2d10b9=_0x25ac1d?_0x14089b['count']:_0xec3bbd[_0xa0d7('0x1f')]+_0xec3bbd[_0xa0d7('0x1d')];var _0x88113d;if(_0x2d10b9>=_0x25ad5a){_0x2d10b9=_0x25ad5a;_0x88113d=0xc8;}else{_0x88113d=0xce;}_0xa27275[_0xa0d7('0x19')](_0x88113d);return _0xa27275['set'](_0xa0d7('0x20'),_0x55f487+'-'+_0x2d10b9+'/'+_0x25ad5a)[_0xa0d7('0x1b')](_0x14089b);}return null;};}function patchUpdates(_0x1980e8){return function(_0x3c60f5){try{jsonpatch[_0xa0d7('0x21')](_0x3c60f5,_0x1980e8,!![]);}catch(_0x520da6){return BPromise[_0xa0d7('0x22')](_0x520da6);}return _0x3c60f5[_0xa0d7('0x23')]();};}function saveUpdates(_0x262de5,_0x1f280d){return function(_0x174756){if(_0x174756){return _0x174756[_0xa0d7('0x24')](_0x262de5)[_0xa0d7('0x25')](function(_0x3fb274){return _0x3fb274;});}return null;};}function removeEntity(_0xef05cc,_0x169260){return function(_0x255ec7){if(_0x255ec7){return _0x255ec7['destroy']()[_0xa0d7('0x25')](function(){_0xef05cc['status'](0xcc)[_0xa0d7('0x1a')]();});}};}function handleEntityNotFound(_0x38e59d,_0x166217){return function(_0x5ac2dd){if(!_0x5ac2dd){_0x38e59d[_0xa0d7('0x18')](0x194);}return _0x5ac2dd;};}function handleError(_0x3eb645,_0x21587c){_0x21587c=_0x21587c||0x1f4;return function(_0x54eb86){logger[_0xa0d7('0x26')](_0x54eb86['stack']);if(_0x54eb86['name']){delete _0x54eb86[_0xa0d7('0x27')];}_0x3eb645[_0xa0d7('0x19')](_0x21587c)[_0xa0d7('0x28')](_0x54eb86);};}exports[_0xa0d7('0x29')]=function(_0x7819d0,_0x4d16ea){var _0x58d6af={},_0x3188db={},_0x91f3b={'count':0x0,'rows':[]};var _0x4c734f=_['map'](db['ZohoField'][_0xa0d7('0x2a')],function(_0x5185f3){return{'name':_0x5185f3[_0xa0d7('0x2b')],'type':_0x5185f3[_0xa0d7('0x2c')][_0xa0d7('0x2d')]};});_0x3188db[_0xa0d7('0x2e')]=_[_0xa0d7('0x2f')](_0x4c734f,_0xa0d7('0x27'));_0x3188db['query']=_[_0xa0d7('0x30')](_0x7819d0[_0xa0d7('0x31')]);_0x3188db[_0xa0d7('0x32')]=_['intersection'](_0x3188db[_0xa0d7('0x2e')],_0x3188db[_0xa0d7('0x31')]);_0x58d6af[_0xa0d7('0x33')]=_[_0xa0d7('0x34')](_0x3188db[_0xa0d7('0x2e')],qs[_0xa0d7('0x35')](_0x7819d0[_0xa0d7('0x31')][_0xa0d7('0x35')]));_0x58d6af[_0xa0d7('0x33')]=_0x58d6af['attributes']['length']?_0x58d6af[_0xa0d7('0x33')]:_0x3188db[_0xa0d7('0x2e')];if(!_0x7819d0[_0xa0d7('0x31')]['hasOwnProperty'](_0xa0d7('0x36'))){_0x58d6af['limit']=qs['limit'](_0x7819d0['query'][_0xa0d7('0x1d')]);_0x58d6af[_0xa0d7('0x1f')]=qs[_0xa0d7('0x1f')](_0x7819d0[_0xa0d7('0x31')][_0xa0d7('0x1f')]);}_0x58d6af[_0xa0d7('0x37')]=qs['sort'](_0x7819d0[_0xa0d7('0x31')][_0xa0d7('0x38')]);_0x58d6af[_0xa0d7('0x39')]=qs[_0xa0d7('0x32')](_['pick'](_0x7819d0[_0xa0d7('0x31')],_0x3188db[_0xa0d7('0x32')]),_0x4c734f);if(_0x7819d0[_0xa0d7('0x31')][_0xa0d7('0x3a')]){_0x58d6af[_0xa0d7('0x39')]=_[_0xa0d7('0x3b')](_0x58d6af['where'],{'$or':_[_0xa0d7('0x2f')](_0x4c734f,function(_0x1a5c41){if(_0x1a5c41['type']!==_0xa0d7('0x3c')){var _0x1b95fc={};_0x1b95fc[_0x1a5c41[_0xa0d7('0x27')]]={'$like':'%'+_0x7819d0['query'][_0xa0d7('0x3a')]+'%'};return _0x1b95fc;}})});}_0x58d6af=_['merge']({},_0x58d6af,_0x7819d0[_0xa0d7('0x3d')]);var _0x4f2a22={'where':_0x58d6af['where']};return db[_0xa0d7('0x3e')]['count'](_0x4f2a22)[_0xa0d7('0x25')](function(_0x27c758){_0x91f3b[_0xa0d7('0x1e')]=_0x27c758;if(_0x7819d0[_0xa0d7('0x31')][_0xa0d7('0x3f')]){_0x58d6af[_0xa0d7('0x40')]=[{'all':!![]}];}return db[_0xa0d7('0x3e')][_0xa0d7('0x41')](_0x58d6af);})[_0xa0d7('0x25')](function(_0x48cea2){_0x91f3b[_0xa0d7('0x42')]=_0x48cea2;return _0x91f3b;})[_0xa0d7('0x25')](respondWithFilteredResult(_0x4d16ea,_0x58d6af))['catch'](handleError(_0x4d16ea,null));};exports[_0xa0d7('0x43')]=function(_0x2c2c7a,_0x3eef8a){var _0x5f2b3b={'raw':!![],'where':{'id':_0x2c2c7a[_0xa0d7('0x44')]['id']}},_0x13e9d5={};_0x13e9d5[_0xa0d7('0x2e')]=_['keys'](db[_0xa0d7('0x3e')][_0xa0d7('0x2a')]);_0x13e9d5['query']=_[_0xa0d7('0x30')](_0x2c2c7a[_0xa0d7('0x31')]);_0x13e9d5[_0xa0d7('0x32')]=_[_0xa0d7('0x34')](_0x13e9d5['model'],_0x13e9d5[_0xa0d7('0x31')]);_0x5f2b3b[_0xa0d7('0x33')]=_['intersection'](_0x13e9d5[_0xa0d7('0x2e')],qs[_0xa0d7('0x35')](_0x2c2c7a['query'][_0xa0d7('0x35')]));_0x5f2b3b[_0xa0d7('0x33')]=_0x5f2b3b[_0xa0d7('0x33')][_0xa0d7('0x45')]?_0x5f2b3b[_0xa0d7('0x33')]:_0x13e9d5[_0xa0d7('0x2e')];if(_0x2c2c7a[_0xa0d7('0x31')]['includeAll']){_0x5f2b3b[_0xa0d7('0x40')]=[{'all':!![]}];}_0x5f2b3b=_[_0xa0d7('0x3b')]({},_0x5f2b3b,_0x2c2c7a[_0xa0d7('0x3d')]);return db['ZohoField']['find'](_0x5f2b3b)[_0xa0d7('0x25')](handleEntityNotFound(_0x3eef8a,null))['then'](respondWithResult(_0x3eef8a,null))['catch'](handleError(_0x3eef8a,null));};exports[_0xa0d7('0x46')]=function(_0x2b9875,_0x58fecc){return db[_0xa0d7('0x3e')][_0xa0d7('0x46')](_0x2b9875[_0xa0d7('0x47')],{})[_0xa0d7('0x25')](respondWithResult(_0x58fecc,0xc9))[_0xa0d7('0x48')](handleError(_0x58fecc,null));};exports[_0xa0d7('0x24')]=function(_0x26c63c,_0x31f125){if(_0x26c63c[_0xa0d7('0x47')]['id']){delete _0x26c63c[_0xa0d7('0x47')]['id'];}return db[_0xa0d7('0x3e')]['find']({'where':{'id':_0x26c63c['params']['id']}})[_0xa0d7('0x25')](handleEntityNotFound(_0x31f125,null))[_0xa0d7('0x25')](saveUpdates(_0x26c63c[_0xa0d7('0x47')],null))[_0xa0d7('0x25')](respondWithResult(_0x31f125,null))[_0xa0d7('0x48')](handleError(_0x31f125,null));};exports[_0xa0d7('0x49')]=function(_0x2dcfcb,_0x4a3844){return db[_0xa0d7('0x3e')][_0xa0d7('0x4a')]({'where':{'id':_0x2dcfcb[_0xa0d7('0x44')]['id']}})[_0xa0d7('0x25')](handleEntityNotFound(_0x4a3844,null))[_0xa0d7('0x25')](removeEntity(_0x4a3844,null))[_0xa0d7('0x48')](handleError(_0x4a3844,null));}; \ No newline at end of file +var _0x8be9=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','type','merge','options','include','rows','show','fields','includeAll','find','update','body','catch','params','eml-format'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0x8be9,0x8f));var _0x98be=function(_0x29ffb9,_0x2adaed){_0x29ffb9=_0x29ffb9-0x0;var _0xdc4d93=_0x8be9[_0x29ffb9];return _0xdc4d93;};'use strict';var emlformat=require(_0x98be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98be('0x1'));var jsonpatch=require(_0x98be('0x2'));var rp=require(_0x98be('0x3'));var moment=require(_0x98be('0x4'));var BPromise=require(_0x98be('0x5'));var Mustache=require(_0x98be('0x6'));var util=require('util');var path=require(_0x98be('0x7'));var sox=require('sox');var csv=require(_0x98be('0x8'));var ejs=require(_0x98be('0x9'));var fs=require('fs');var fs_extra=require(_0x98be('0xa'));var _=require('lodash');var squel=require(_0x98be('0xb'));var crypto=require(_0x98be('0xc'));var jsforce=require(_0x98be('0xd'));var deskjs=require(_0x98be('0xe'));var toCsv=require(_0x98be('0x8'));var querystring=require(_0x98be('0xf'));var Papa=require('papaparse');var Redis=require(_0x98be('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x98be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98be('0x12'));var logger=require('../../config/logger')(_0x98be('0x13'));var utils=require(_0x98be('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x98be('0x15'));var db=require(_0x98be('0x16'))['db'];function respondWithStatusCode(_0x3079b4,_0x29e79a){_0x29e79a=_0x29e79a||0xcc;return function(_0x54a068){if(_0x54a068){return _0x3079b4[_0x98be('0x17')](_0x29e79a);}return _0x3079b4[_0x98be('0x18')](_0x29e79a)[_0x98be('0x19')]();};}function respondWithResult(_0x2ff1a8,_0x498516){_0x498516=_0x498516||0xc8;return function(_0x390821){if(_0x390821){return _0x2ff1a8[_0x98be('0x18')](_0x498516)[_0x98be('0x1a')](_0x390821);}};}function respondWithFilteredResult(_0x340876,_0x48d941){return function(_0x220935){if(_0x220935){var _0x25f877=typeof _0x48d941[_0x98be('0x1b')]===_0x98be('0x1c')&&typeof _0x48d941['limit']===_0x98be('0x1c');var _0x2db17d=_0x220935[_0x98be('0x1d')];var _0x3d894b=_0x25f877?0x0:_0x48d941[_0x98be('0x1b')];var _0x16cd04=_0x25f877?_0x220935[_0x98be('0x1d')]:_0x48d941[_0x98be('0x1b')]+_0x48d941['limit'];var _0x2b717f;if(_0x16cd04>=_0x2db17d){_0x16cd04=_0x2db17d;_0x2b717f=0xc8;}else{_0x2b717f=0xce;}_0x340876[_0x98be('0x18')](_0x2b717f);return _0x340876[_0x98be('0x1e')](_0x98be('0x1f'),_0x3d894b+'-'+_0x16cd04+'/'+_0x2db17d)[_0x98be('0x1a')](_0x220935);}return null;};}function patchUpdates(_0x447816){return function(_0x2af795){try{jsonpatch['apply'](_0x2af795,_0x447816,!![]);}catch(_0x4f46f6){return BPromise[_0x98be('0x20')](_0x4f46f6);}return _0x2af795[_0x98be('0x21')]();};}function saveUpdates(_0x4812ff,_0x4b9d5e){return function(_0x11bdb1){if(_0x11bdb1){return _0x11bdb1['update'](_0x4812ff)['then'](function(_0x2095ef){return _0x2095ef;});}return null;};}function removeEntity(_0x3ddef1,_0x4c1a79){return function(_0x159c42){if(_0x159c42){return _0x159c42[_0x98be('0x22')]()[_0x98be('0x23')](function(){_0x3ddef1['status'](0xcc)[_0x98be('0x19')]();});}};}function handleEntityNotFound(_0x21636f,_0x1f9e35){return function(_0x5eded3){if(!_0x5eded3){_0x21636f['sendStatus'](0x194);}return _0x5eded3;};}function handleError(_0x2e30ff,_0x556c18){_0x556c18=_0x556c18||0x1f4;return function(_0x33f069){logger[_0x98be('0x24')](_0x33f069[_0x98be('0x25')]);if(_0x33f069[_0x98be('0x26')]){delete _0x33f069[_0x98be('0x26')];}_0x2e30ff['status'](_0x556c18)[_0x98be('0x27')](_0x33f069);};}exports['index']=function(_0x19c1e9,_0x48f8fa){var _0x2d6793={},_0x19842a={},_0x2de5c0={'count':0x0,'rows':[]};var _0x433d4f=_[_0x98be('0x28')](db[_0x98be('0x29')][_0x98be('0x2a')],function(_0x2af772){return{'name':_0x2af772[_0x98be('0x2b')],'type':_0x2af772['type'][_0x98be('0x2c')]};});_0x19842a['model']=_[_0x98be('0x28')](_0x433d4f,'name');_0x19842a['query']=_[_0x98be('0x2d')](_0x19c1e9[_0x98be('0x2e')]);_0x19842a[_0x98be('0x2f')]=_[_0x98be('0x30')](_0x19842a[_0x98be('0x31')],_0x19842a[_0x98be('0x2e')]);_0x2d6793[_0x98be('0x32')]=_[_0x98be('0x30')](_0x19842a[_0x98be('0x31')],qs['fields'](_0x19c1e9['query']['fields']));_0x2d6793[_0x98be('0x32')]=_0x2d6793[_0x98be('0x32')][_0x98be('0x33')]?_0x2d6793[_0x98be('0x32')]:_0x19842a[_0x98be('0x31')];if(!_0x19c1e9[_0x98be('0x2e')][_0x98be('0x34')]('nolimit')){_0x2d6793[_0x98be('0x35')]=qs['limit'](_0x19c1e9['query'][_0x98be('0x35')]);_0x2d6793[_0x98be('0x1b')]=qs[_0x98be('0x1b')](_0x19c1e9[_0x98be('0x2e')][_0x98be('0x1b')]);}_0x2d6793[_0x98be('0x36')]=qs['sort'](_0x19c1e9[_0x98be('0x2e')][_0x98be('0x37')]);_0x2d6793[_0x98be('0x38')]=qs[_0x98be('0x2f')](_[_0x98be('0x39')](_0x19c1e9[_0x98be('0x2e')],_0x19842a['filters']),_0x433d4f);if(_0x19c1e9['query'][_0x98be('0x3a')]){_0x2d6793[_0x98be('0x38')]=_['merge'](_0x2d6793['where'],{'$or':_['map'](_0x433d4f,function(_0x5751f1){if(_0x5751f1[_0x98be('0x3b')]!=='VIRTUAL'){var _0x25fb2d={};_0x25fb2d[_0x5751f1[_0x98be('0x26')]]={'$like':'%'+_0x19c1e9[_0x98be('0x2e')][_0x98be('0x3a')]+'%'};return _0x25fb2d;}})});}_0x2d6793=_[_0x98be('0x3c')]({},_0x2d6793,_0x19c1e9[_0x98be('0x3d')]);var _0x4a074d={'where':_0x2d6793[_0x98be('0x38')]};return db[_0x98be('0x29')][_0x98be('0x1d')](_0x4a074d)[_0x98be('0x23')](function(_0x201de3){_0x2de5c0[_0x98be('0x1d')]=_0x201de3;if(_0x19c1e9[_0x98be('0x2e')]['includeAll']){_0x2d6793[_0x98be('0x3e')]=[{'all':!![]}];}return db[_0x98be('0x29')]['findAll'](_0x2d6793);})[_0x98be('0x23')](function(_0x562663){_0x2de5c0[_0x98be('0x3f')]=_0x562663;return _0x2de5c0;})[_0x98be('0x23')](respondWithFilteredResult(_0x48f8fa,_0x2d6793))['catch'](handleError(_0x48f8fa,null));};exports[_0x98be('0x40')]=function(_0x484064,_0x407e57){var _0x451361={'raw':!![],'where':{'id':_0x484064['params']['id']}},_0x575cbf={};_0x575cbf[_0x98be('0x31')]=_[_0x98be('0x2d')](db[_0x98be('0x29')][_0x98be('0x2a')]);_0x575cbf['query']=_[_0x98be('0x2d')](_0x484064[_0x98be('0x2e')]);_0x575cbf[_0x98be('0x2f')]=_[_0x98be('0x30')](_0x575cbf[_0x98be('0x31')],_0x575cbf[_0x98be('0x2e')]);_0x451361[_0x98be('0x32')]=_[_0x98be('0x30')](_0x575cbf[_0x98be('0x31')],qs[_0x98be('0x41')](_0x484064[_0x98be('0x2e')][_0x98be('0x41')]));_0x451361[_0x98be('0x32')]=_0x451361[_0x98be('0x32')][_0x98be('0x33')]?_0x451361[_0x98be('0x32')]:_0x575cbf[_0x98be('0x31')];if(_0x484064[_0x98be('0x2e')][_0x98be('0x42')]){_0x451361[_0x98be('0x3e')]=[{'all':!![]}];}_0x451361=_[_0x98be('0x3c')]({},_0x451361,_0x484064[_0x98be('0x3d')]);return db['ZohoField'][_0x98be('0x43')](_0x451361)['then'](handleEntityNotFound(_0x407e57,null))[_0x98be('0x23')](respondWithResult(_0x407e57,null))['catch'](handleError(_0x407e57,null));};exports['create']=function(_0x226ce9,_0x18fa37){return db[_0x98be('0x29')]['create'](_0x226ce9['body'],{})[_0x98be('0x23')](respondWithResult(_0x18fa37,0xc9))['catch'](handleError(_0x18fa37,null));};exports[_0x98be('0x44')]=function(_0x2f65e2,_0x3b20a5){if(_0x2f65e2[_0x98be('0x45')]['id']){delete _0x2f65e2[_0x98be('0x45')]['id'];}return db[_0x98be('0x29')][_0x98be('0x43')]({'where':{'id':_0x2f65e2['params']['id']}})[_0x98be('0x23')](handleEntityNotFound(_0x3b20a5,null))[_0x98be('0x23')](saveUpdates(_0x2f65e2[_0x98be('0x45')],null))[_0x98be('0x23')](respondWithResult(_0x3b20a5,null))[_0x98be('0x46')](handleError(_0x3b20a5,null));};exports['destroy']=function(_0x5cf654,_0x41592d){return db['ZohoField'][_0x98be('0x43')]({'where':{'id':_0x5cf654[_0x98be('0x47')]['id']}})[_0x98be('0x23')](handleEntityNotFound(_0x41592d,null))['then'](removeEntity(_0x41592d,null))['catch'](handleError(_0x41592d,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 13608e8..21f6ad7 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 _0x0adf=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0x44303b,_0x4fbb8a){var _0x22380c=function(_0x2f16e9){while(--_0x2f16e9){_0x44303b['push'](_0x44303b['shift']());}};_0x22380c(++_0x4fbb8a);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x369b33,_0x3006bd){_0x369b33=_0x369b33-0x0;var _0x501bb6=_0x0adf[_0x369b33];return _0x501bb6;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var logger=require(_0xf0ad('0x2'))('api');var moment=require(_0xf0ad('0x3'));var BPromise=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var fs=require('fs');var path=require(_0xf0ad('0x6'));var rimraf=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var attributes=require(_0xf0ad('0x9'));module['exports']=function(_0x3bbf85,_0x53221f){return _0x3bbf85[_0xf0ad('0xa')](_0xf0ad('0xb'),attributes,{'tableName':_0xf0ad('0xc'),'paranoid':![],'indexes':[{'name':_0xf0ad('0xd'),'fields':[_0xf0ad('0xe'),_0xf0ad('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed1c=['lodash','util','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0xed1c,0xe4));var _0xced1=function(_0x170768,_0x1861fd){_0x170768=_0x170768-0x0;var _0x58f9d3=_0xed1c[_0x170768];return _0x58f9d3;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'paranoid':![],'indexes':[{'name':_0xced1('0x9'),'fields':[_0xced1('0xa'),_0xced1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index c2d2850..803561e 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 _0x4ffe=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x32f193,_0x612afc){var _0x5bb92e=function(_0x555645){while(--_0x555645){_0x32f193['push'](_0x32f193['shift']());}};_0x5bb92e(++_0x612afc);}(_0x4ffe,0x11b));var _0xe4ff=function(_0x5775c4,_0x11631c){_0x5775c4=_0x5775c4-0x0;var _0xa2e3a1=_0x4ffe[_0x5775c4];return _0xa2e3a1;};'use strict';var _=require(_0xe4ff('0x0'));var util=require(_0xe4ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe4ff('0x2'));var fs=require('fs');var Redis=require(_0xe4ff('0x3'));var db=require(_0xe4ff('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe4ff('0x5'));var jayson=require(_0xe4ff('0x6'));var client=jayson['client'][_0xe4ff('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x373a9f,_0x54037c,_0x316e53){return new BPromise(function(_0x20800a,_0x1f558a){return client['request'](_0x373a9f,_0x316e53)[_0xe4ff('0x8')](function(_0x56a185){logger[_0xe4ff('0x9')](_0xe4ff('0xa'),_0x54037c,_0xe4ff('0xb'));logger[_0xe4ff('0xc')](_0xe4ff('0xd'),_0x54037c,'request\x20sent',JSON[_0xe4ff('0xe')](_0x56a185));if(_0x56a185[_0xe4ff('0xf')]){if(_0x56a185['error'][_0xe4ff('0x10')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x54037c,_0x56a185[_0xe4ff('0xf')][_0xe4ff('0x11')]);return _0x1f558a(_0x56a185[_0xe4ff('0xf')][_0xe4ff('0x11')]);}logger[_0xe4ff('0xf')](_0xe4ff('0xa'),_0x54037c,_0x56a185['error'][_0xe4ff('0x11')]);return _0x20800a(_0x56a185[_0xe4ff('0xf')]['message']);}else{logger[_0xe4ff('0x9')](_0xe4ff('0xa'),_0x54037c,_0xe4ff('0xb'));_0x20800a(_0x56a185[_0xe4ff('0x12')]['message']);}})[_0xe4ff('0x13')](function(_0x5773b2){logger[_0xe4ff('0xf')](_0xe4ff('0xa'),_0x54037c,_0x5773b2);_0x1f558a(_0x5773b2);});});} \ No newline at end of file +var _0xb83e=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c61dd,_0x318fa4){var _0x1b8e4e=function(_0x393c50){while(--_0x393c50){_0x4c61dd['push'](_0x4c61dd['shift']());}};_0x1b8e4e(++_0x318fa4);}(_0xb83e,0x139));var _0xeb83=function(_0x2509be,_0x5c9173){_0x2509be=_0x2509be-0x0;var _0x2f2f00=_0xb83e[_0x2509be];return _0x2f2f00;};'use strict';var _=require(_0xeb83('0x0'));var util=require(_0xeb83('0x1'));var moment=require(_0xeb83('0x2'));var BPromise=require(_0xeb83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb83('0x4'));var db=require(_0xeb83('0x5'))['db'];var utils=require(_0xeb83('0x6'));var logger=require('../../config/logger')(_0xeb83('0x7'));var config=require(_0xeb83('0x8'));var jayson=require(_0xeb83('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56d247,_0x5849e0,_0x2829d8){return new BPromise(function(_0x5464e2,_0x566fad){return client[_0xeb83('0xa')](_0x56d247,_0x2829d8)['then'](function(_0x4f805f){logger['info'](_0xeb83('0xb'),_0x5849e0,_0xeb83('0xc'));logger[_0xeb83('0xd')](_0xeb83('0xe'),_0x5849e0,_0xeb83('0xc'),JSON[_0xeb83('0xf')](_0x4f805f));if(_0x4f805f[_0xeb83('0x10')]){if(_0x4f805f['error'][_0xeb83('0x11')]===0x1f4){logger[_0xeb83('0x10')](_0xeb83('0xb'),_0x5849e0,_0x4f805f[_0xeb83('0x10')][_0xeb83('0x12')]);return _0x566fad(_0x4f805f[_0xeb83('0x10')][_0xeb83('0x12')]);}logger[_0xeb83('0x10')](_0xeb83('0xb'),_0x5849e0,_0x4f805f[_0xeb83('0x10')][_0xeb83('0x12')]);return _0x5464e2(_0x4f805f[_0xeb83('0x10')][_0xeb83('0x12')]);}else{logger[_0xeb83('0x13')](_0xeb83('0xb'),_0x5849e0,_0xeb83('0xc'));_0x5464e2(_0x4f805f[_0xeb83('0x14')][_0xeb83('0x12')]);}})[_0xeb83('0x15')](function(_0x2b15c9){logger[_0xeb83('0x10')](_0xeb83('0xb'),_0x5849e0,_0x2b15c9);_0x566fad(_0x2b15c9);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 34ee3b5..64a9e13 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x16aa87,_0x203397){var _0x207322=function(_0x55bb41){while(--_0x55bb41){_0x16aa87['push'](_0x16aa87['shift']());}};_0x207322(++_0x203397);}(_0xe706,0xa3));var _0x6e70=function(_0x180ac2,_0x219d65){_0x180ac2=_0x180ac2-0x0;var _0xfcaede=_0xe706[_0x180ac2];return _0xfcaede;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4a9a0c,_0x120b8a){var _0x316d25=function(_0x3f8c2c){while(--_0x3f8c2c){_0x4a9a0c['push'](_0x4a9a0c['shift']());}};_0x316d25(++_0x120b8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 4ad9e74..5d53552 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 _0xf492=['unique_name_and_version','app.js','state','sequelize','STRING'];(function(_0x3a850e,_0x53ea18){var _0x52e7c6=function(_0x11343d){while(--_0x11343d){_0x3a850e['push'](_0x3a850e['shift']());}};_0x52e7c6(++_0x53ea18);}(_0xf492,0xb2));var _0x2f49=function(_0x5a73d0,_0x59ec9a){_0x5a73d0=_0x5a73d0-0x0;var _0x3c845a=_0xf492[_0x5a73d0];return _0x3c845a;};'use strict';var Sequelize=require(_0x2f49('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f49('0x1')],'allowNull':![],'unique':_0x2f49('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x2f49('0x1')],'defaultValue':_0x2f49('0x3')},'filename':{'type':Sequelize[_0x2f49('0x1')]},'path':{'type':Sequelize[_0x2f49('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x2f49('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x2f49('0x1')],'unique':_0x2f49('0x4')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x2f49('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x2f49('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0aab=['state','sequelize','unique_name_and_version','STRING','app.js','BOOLEAN'];(function(_0x59a0e4,_0x492f2c){var _0x64e2f9=function(_0x42df1e){while(--_0x42df1e){_0x59a0e4['push'](_0x59a0e4['shift']());}};_0x64e2f9(++_0x492f2c);}(_0x0aab,0x169));var _0xb0aa=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0x0aab[_0x483ab9];return _0x35043b;};'use strict';var Sequelize=require(_0xb0aa('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb0aa('0x1')},'version':{'type':Sequelize[_0xb0aa('0x2')],'allowNull':![],'unique':_0xb0aa('0x1')},'main':{'type':Sequelize[_0xb0aa('0x2')],'defaultValue':_0xb0aa('0x3')},'filename':{'type':Sequelize[_0xb0aa('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb0aa('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xb0aa('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xb0aa('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0xb0aa('0x5')},'description':{'type':Sequelize[_0xb0aa('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xb0aa('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 e0532ee..18a71f0 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 _0x1a85=['includeAll','find','create','body','params','destroy','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields'];(function(_0x15c070,_0x10012d){var _0x3f81bb=function(_0x237443){while(--_0x237443){_0x15c070['push'](_0x15c070['shift']());}};_0x3f81bb(++_0x10012d);}(_0x1a85,0x178));var _0x51a8=function(_0x568039,_0x570f8e){_0x568039=_0x568039-0x0;var _0x1595fc=_0x1a85[_0x568039];return _0x1595fc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['Integration'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));}; \ No newline at end of file +var _0xb016=['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','end','error','name','send','index','map','Integration','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body'];(function(_0x47fd9e,_0x5a982d){var _0xf56302=function(_0x1e5558){while(--_0x1e5558){_0x47fd9e['push'](_0x47fd9e['shift']());}};_0xf56302(++_0x5a982d);}(_0xb016,0x159));var _0x6b01=function(_0x32a0db,_0x5f347e){_0x32a0db=_0x32a0db-0x0;var _0x3b8a6c=_0xb016[_0x32a0db];return _0x3b8a6c;};'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(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['Integration'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 8a04a41..1c66f91 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 _0xca3a=['Integration','integrations','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./integration.attributes','define'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xca3a,0x115));var _0xaca3=function(_0x12b7d2,_0xe4fb32){_0x12b7d2=_0x12b7d2-0x0;var _0x454dd3=_0xca3a[_0x12b7d2];return _0x454dd3;};'use strict';var _=require(_0xaca3('0x0'));var util=require('util');var logger=require(_0xaca3('0x1'))(_0xaca3('0x2'));var moment=require(_0xaca3('0x3'));var BPromise=require(_0xaca3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaca3('0x5'));var config=require(_0xaca3('0x6'));var attributes=require(_0xaca3('0x7'));module['exports']=function(_0x31062d,_0x2f0424){return _0x31062d[_0xaca3('0x8')](_0xaca3('0x9'),attributes,{'tableName':_0xaca3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47db=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util'];(function(_0x246c59,_0x1bf1a1){var _0x23a1f4=function(_0x4c90c5){while(--_0x4c90c5){_0x246c59['push'](_0x246c59['shift']());}};_0x23a1f4(++_0x1bf1a1);}(_0x47db,0x16a));var _0xb47d=function(_0x9d94ce,_0x368242){_0x9d94ce=_0x9d94ce-0x0;var _0x147808=_0x47db[_0x9d94ce];return _0x147808;};'use strict';var _=require(_0xb47d('0x0'));var util=require(_0xb47d('0x1'));var logger=require(_0xb47d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb47d('0x3'));var rp=require(_0xb47d('0x4'));var fs=require('fs');var path=require(_0xb47d('0x5'));var rimraf=require(_0xb47d('0x6'));var config=require(_0xb47d('0x7'));var attributes=require(_0xb47d('0x8'));module[_0xb47d('0x9')]=function(_0x20f7f8,_0x1406d7){return _0x20f7f8[_0xb47d('0xa')](_0xb47d('0xb'),attributes,{'tableName':_0xb47d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index db9e5e8..b798a83 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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x59c7fa,_0x3b204e){var _0x4d1789=function(_0x5d9ba8){while(--_0x5d9ba8){_0x59c7fa['push'](_0x59c7fa['shift']());}};_0x4d1789(++_0x3b204e);}(_0x7880,0x1f4));var _0x0788=function(_0x4f7576,_0x138a8f){_0x4f7576=_0x4f7576-0x0;var _0x45d522=_0x7880[_0x4f7576];return _0x45d522;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file +var _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x245e9c,_0x3846b6){var _0x423cb0=function(_0x5acac9){while(--_0x5acac9){_0x245e9c['push'](_0x245e9c['shift']());}};_0x423cb0(++_0x3846b6);}(_0x896e,0x1e9));var _0xe896=function(_0x3c70bc,_0x7f05ff){_0x3c70bc=_0x3c70bc-0x0;var _0x1137a3=_0x896e[_0x3c70bc];return _0x1137a3;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 795ec96..dce73b1 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4974e1,_0x1e8028){var _0x2793d8=function(_0x452836){while(--_0x452836){_0x4974e1['push'](_0x4974e1['shift']());}};_0x2793d8(++_0x1e8028);}(_0x4975,0x86));var _0x5497=function(_0x12b6c3,_0x148024){_0x12b6c3=_0x12b6c3-0x0;var _0x4adfa0=_0x4975[_0x12b6c3];return _0x4adfa0;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x5c75ea,_0x1b9094){var _0x5d74cb=function(_0x3c51a0){while(--_0x3c51a0){_0x5c75ea['push'](_0x5c75ea['shift']());}};_0x5d74cb(++_0x1b9094);}(_0xef0f,0x168));var _0xfef0=function(_0x780e9,_0x292723){_0x780e9=_0x780e9-0x0;var _0x4231f2=_0xef0f[_0x780e9];return _0x4231f2;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 38f2656..9382847 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 _0xd4c8=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED'];(function(_0xade558,_0x466b32){var _0x1c8491=function(_0x5ee8f1){while(--_0x5ee8f1){_0xade558['push'](_0xade558['shift']());}};_0x1c8491(++_0x466b32);}(_0xd4c8,0x1e4));var _0x8d4c=function(_0x43902f,_0x27940f){_0x43902f=_0x43902f-0x0;var _0x3a6467=_0xd4c8[_0x43902f];return _0x3a6467;};'use strict';var Sequelize=require(_0x8d4c('0x0'));module[_0x8d4c('0x1')]={'integration':{'type':Sequelize[_0x8d4c('0x2')]},'eventChannel':{'type':Sequelize[_0x8d4c('0x2')]},'exitStatus':{'type':Sequelize[_0x8d4c('0x2')]},'ticketId':{'type':Sequelize[_0x8d4c('0x2')]},'integrationId':{'type':Sequelize[_0x8d4c('0x3')]},'contacts':{'type':Sequelize[_0x8d4c('0x2')]},'uniqueid':{'type':Sequelize[_0x8d4c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8d4c('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x8d4c('0x2')]},'membername':{'type':Sequelize[_0x8d4c('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8d4c('0x4')]},'agentconnectAt':{'type':Sequelize[_0x8d4c('0x4')]},'holdtime':{'type':Sequelize[_0x8d4c('0x3')]},'agentcomplete':{'type':Sequelize[_0x8d4c('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8d4c('0x4')]},'talktime':{'type':Sequelize[_0x8d4c('0x3')]},'agentacw':{'type':Sequelize[_0x8d4c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8d4c('0x3')]},'reason':{'type':Sequelize[_0x8d4c('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x8d4c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8d4c('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8d4c('0x4')]},'lastevent':{'type':Sequelize[_0x8d4c('0x2')]},'channel':{'type':Sequelize[_0x8d4c('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8d4c('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8d4c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8d4c('0x2')]},'context':{'type':Sequelize[_0x8d4c('0x2')]},'exten':{'type':Sequelize[_0x8d4c('0x2')]},'priority':{'type':Sequelize[_0x8d4c('0x2')]},'destchannel':{'type':Sequelize[_0x8d4c('0x2')]},'destchannelstate':{'type':Sequelize[_0x8d4c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x8d4c('0x2')]},'destcalleridname':{'type':Sequelize[_0x8d4c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8d4c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8d4c('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8d4c('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8d4c('0x2')]},'destpriority':{'type':Sequelize[_0x8d4c('0x2')]},'destuniqueid':{'type':Sequelize[_0x8d4c('0x2')]},'messageId':{'type':Sequelize[_0x8d4c('0x2')]},'inReplyTo':{'type':Sequelize[_0x8d4c('0x2')]},'subject':{'type':Sequelize[_0x8d4c('0x2')]},'from':{'type':Sequelize[_0x8d4c('0x2')]},'to':{'type':Sequelize[_0x8d4c('0x2')]},'cc':{'type':Sequelize[_0x8d4c('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x8d4c('0x6')]},'text':{'type':Sequelize[_0x8d4c('0x6')]},'status':{'type':Sequelize['ENUM'](_0x8d4c('0x7'),_0x8d4c('0x8'),_0x8d4c('0x9'),_0x8d4c('0xa'))},'url':{'type':Sequelize[_0x8d4c('0x2')]},'app':{'type':Sequelize[_0x8d4c('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x8d4c('0x3')]}}; \ No newline at end of file +var _0x1e67=['STRING','INTEGER','DATE','BOOLEAN','TEXT','FAILED','exports'];(function(_0x382951,_0x5b333e){var _0x47bfa0=function(_0x49f446){while(--_0x49f446){_0x382951['push'](_0x382951['shift']());}};_0x47bfa0(++_0x5b333e);}(_0x1e67,0x195));var _0x71e6=function(_0x59ad69,_0x1714c1){_0x59ad69=_0x59ad69-0x0;var _0x5a0cf9=_0x1e67[_0x59ad69];return _0x5a0cf9;};'use strict';var Sequelize=require('sequelize');module[_0x71e6('0x0')]={'integration':{'type':Sequelize[_0x71e6('0x1')]},'eventChannel':{'type':Sequelize[_0x71e6('0x1')]},'exitStatus':{'type':Sequelize[_0x71e6('0x1')]},'ticketId':{'type':Sequelize[_0x71e6('0x1')]},'integrationId':{'type':Sequelize[_0x71e6('0x2')]},'contacts':{'type':Sequelize[_0x71e6('0x1')]},'uniqueid':{'type':Sequelize[_0x71e6('0x1')]},'calleridnum':{'type':Sequelize[_0x71e6('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x71e6('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x71e6('0x1')]},'agentcalledAt':{'type':Sequelize[_0x71e6('0x3')]},'agentconnectAt':{'type':Sequelize[_0x71e6('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x71e6('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x71e6('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x71e6('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x71e6('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x71e6('0x3')]},'agentdump':{'type':Sequelize[_0x71e6('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x71e6('0x3')]},'lastevent':{'type':Sequelize[_0x71e6('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x71e6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x71e6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x71e6('0x1')]},'connectedlinename':{'type':Sequelize[_0x71e6('0x1')]},'language':{'type':Sequelize[_0x71e6('0x1')]},'accountcode':{'type':Sequelize[_0x71e6('0x1')]},'context':{'type':Sequelize[_0x71e6('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x71e6('0x1')]},'destchannel':{'type':Sequelize[_0x71e6('0x1')]},'destchannelstate':{'type':Sequelize[_0x71e6('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x71e6('0x1')]},'destcalleridnum':{'type':Sequelize[_0x71e6('0x1')]},'destcalleridname':{'type':Sequelize[_0x71e6('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x71e6('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x71e6('0x1')]},'destaccountcode':{'type':Sequelize[_0x71e6('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x71e6('0x1')]},'destpriority':{'type':Sequelize[_0x71e6('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x71e6('0x1')]},'inReplyTo':{'type':Sequelize[_0x71e6('0x1')]},'subject':{'type':Sequelize[_0x71e6('0x1')]},'from':{'type':Sequelize[_0x71e6('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x71e6('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x71e6('0x5')]},'text':{'type':Sequelize[_0x71e6('0x5')]},'status':{'type':Sequelize['ENUM']('SENT','SENDING','RECEIVED',_0x71e6('0x6'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x71e6('0x1')]},'projectId':{'type':Sequelize[_0x71e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 55e44be..eca27fe 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 _0x87ad=['where','filters','VIRTUAL','filter','merge','options','IntegrationReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','end','status','offset','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87ad,0x183));var _0xd87a=function(_0x57f58a,_0x2a840c){_0x57f58a=_0x57f58a-0x0;var _0x3b745d=_0x87ad[_0x57f58a];return _0x3b745d;};'use strict';var emlformat=require(_0xd87a('0x0'));var rimraf=require(_0xd87a('0x1'));var zipdir=require(_0xd87a('0x2'));var jsonpatch=require(_0xd87a('0x3'));var rp=require(_0xd87a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd87a('0x5'));var util=require(_0xd87a('0x6'));var path=require(_0xd87a('0x7'));var sox=require(_0xd87a('0x8'));var csv=require(_0xd87a('0x9'));var ejs=require(_0xd87a('0xa'));var fs=require('fs');var fs_extra=require(_0xd87a('0xb'));var _=require(_0xd87a('0xc'));var squel=require(_0xd87a('0xd'));var crypto=require(_0xd87a('0xe'));var jsforce=require(_0xd87a('0xf'));var deskjs=require(_0xd87a('0x10'));var toCsv=require(_0xd87a('0x9'));var querystring=require(_0xd87a('0x11'));var Papa=require(_0xd87a('0x12'));var Redis=require(_0xd87a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd87a('0x14'));var as=require(_0xd87a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd87a('0x16'))('api');var utils=require(_0xd87a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd87a('0x18'))['db'];function respondWithStatusCode(_0xc8b201,_0xa3fae9){_0xa3fae9=_0xa3fae9||0xcc;return function(_0x2caa4f){if(_0x2caa4f){return _0xc8b201['sendStatus'](_0xa3fae9);}return _0xc8b201['status'](_0xa3fae9)[_0xd87a('0x19')]();};}function respondWithResult(_0x3d41fa,_0x3e07ad){_0x3e07ad=_0x3e07ad||0xc8;return function(_0x48e661){if(_0x48e661){return _0x3d41fa[_0xd87a('0x1a')](_0x3e07ad)['json'](_0x48e661);}};}function respondWithFilteredResult(_0x115e0c,_0x2e62df){return function(_0x276574){if(_0x276574){var _0x221853=typeof _0x2e62df[_0xd87a('0x1b')]===_0xd87a('0x1c')&&typeof _0x2e62df['limit']==='undefined';var _0x5dce72=_0x276574[_0xd87a('0x1d')];var _0x35cbad=_0x221853?0x0:_0x2e62df[_0xd87a('0x1b')];var _0x40c704=_0x221853?_0x276574['count']:_0x2e62df[_0xd87a('0x1b')]+_0x2e62df['limit'];var _0x216e69;if(_0x40c704>=_0x5dce72){_0x40c704=_0x5dce72;_0x216e69=0xc8;}else{_0x216e69=0xce;}_0x115e0c[_0xd87a('0x1a')](_0x216e69);return _0x115e0c[_0xd87a('0x1e')](_0xd87a('0x1f'),_0x35cbad+'-'+_0x40c704+'/'+_0x5dce72)[_0xd87a('0x20')](_0x276574);}return null;};}function patchUpdates(_0x1dfec7){return function(_0x18d224){try{jsonpatch[_0xd87a('0x21')](_0x18d224,_0x1dfec7,!![]);}catch(_0x554e2b){return BPromise['reject'](_0x554e2b);}return _0x18d224['save']();};}function saveUpdates(_0x4cb624,_0x2bd2f7){return function(_0x330fc8){if(_0x330fc8){return _0x330fc8[_0xd87a('0x22')](_0x4cb624)[_0xd87a('0x23')](function(_0x4ae286){return _0x4ae286;});}return null;};}function removeEntity(_0x3fdbfe,_0x4429ff){return function(_0x5987d2){if(_0x5987d2){return _0x5987d2[_0xd87a('0x24')]()[_0xd87a('0x23')](function(){_0x3fdbfe[_0xd87a('0x1a')](0xcc)[_0xd87a('0x19')]();});}};}function handleEntityNotFound(_0x507d52,_0x5c0faf){return function(_0x517df9){if(!_0x517df9){_0x507d52['sendStatus'](0x194);}return _0x517df9;};}function handleError(_0x3c689f,_0x109dec){_0x109dec=_0x109dec||0x1f4;return function(_0x5d3293){logger[_0xd87a('0x25')](_0x5d3293[_0xd87a('0x26')]);if(_0x5d3293[_0xd87a('0x27')]){delete _0x5d3293['name'];}_0x3c689f['status'](_0x109dec)[_0xd87a('0x28')](_0x5d3293);};}exports[_0xd87a('0x29')]=function(_0x357750,_0x1c4620){var _0x4c1fe4={},_0x18d77a={},_0x4824d6={'count':0x0,'rows':[]};var _0x38c9a1=_[_0xd87a('0x2a')](db['IntegrationReport']['rawAttributes'],function(_0x32ac91){return{'name':_0x32ac91['fieldName'],'type':_0x32ac91[_0xd87a('0x2b')][_0xd87a('0x2c')]};});_0x18d77a['model']=_['map'](_0x38c9a1,'name');_0x18d77a[_0xd87a('0x2d')]=_[_0xd87a('0x2e')](_0x357750[_0xd87a('0x2d')]);_0x18d77a['filters']=_[_0xd87a('0x2f')](_0x18d77a[_0xd87a('0x30')],_0x18d77a['query']);_0x4c1fe4[_0xd87a('0x31')]=_[_0xd87a('0x2f')](_0x18d77a['model'],qs[_0xd87a('0x32')](_0x357750[_0xd87a('0x2d')][_0xd87a('0x32')]));_0x4c1fe4[_0xd87a('0x31')]=_0x4c1fe4['attributes'][_0xd87a('0x33')]?_0x4c1fe4[_0xd87a('0x31')]:_0x18d77a[_0xd87a('0x30')];if(!_0x357750[_0xd87a('0x2d')][_0xd87a('0x34')](_0xd87a('0x35'))){_0x4c1fe4[_0xd87a('0x36')]=qs[_0xd87a('0x36')](_0x357750[_0xd87a('0x2d')][_0xd87a('0x36')]);_0x4c1fe4[_0xd87a('0x1b')]=qs[_0xd87a('0x1b')](_0x357750['query'][_0xd87a('0x1b')]);}_0x4c1fe4[_0xd87a('0x37')]=qs[_0xd87a('0x38')](_0x357750[_0xd87a('0x2d')][_0xd87a('0x38')]);_0x4c1fe4[_0xd87a('0x39')]=qs['filters'](_['pick'](_0x357750[_0xd87a('0x2d')],_0x18d77a[_0xd87a('0x3a')]),_0x38c9a1);if(_0x357750[_0xd87a('0x2d')]['filter']){_0x4c1fe4[_0xd87a('0x39')]=_['merge'](_0x4c1fe4['where'],{'$or':_[_0xd87a('0x2a')](_0x38c9a1,function(_0x2cb38a){if(_0x2cb38a[_0xd87a('0x2b')]!==_0xd87a('0x3b')){var _0x1e6549={};_0x1e6549[_0x2cb38a[_0xd87a('0x27')]]={'$like':'%'+_0x357750[_0xd87a('0x2d')][_0xd87a('0x3c')]+'%'};return _0x1e6549;}})});}_0x4c1fe4=_[_0xd87a('0x3d')]({},_0x4c1fe4,_0x357750[_0xd87a('0x3e')]);var _0x3e3e61={'where':_0x4c1fe4[_0xd87a('0x39')]};return db[_0xd87a('0x3f')][_0xd87a('0x1d')](_0x3e3e61)[_0xd87a('0x23')](function(_0x480c58){_0x4824d6[_0xd87a('0x1d')]=_0x480c58;if(_0x357750[_0xd87a('0x2d')][_0xd87a('0x40')]){_0x4c1fe4[_0xd87a('0x41')]=[{'all':!![]}];}return db[_0xd87a('0x3f')][_0xd87a('0x42')](_0x4c1fe4);})[_0xd87a('0x23')](function(_0x18f65d){_0x4824d6[_0xd87a('0x43')]=_0x18f65d;return _0x4824d6;})[_0xd87a('0x23')](respondWithFilteredResult(_0x1c4620,_0x4c1fe4))[_0xd87a('0x44')](handleError(_0x1c4620,null));};exports['show']=function(_0x5db32e,_0x3f2d8b){var _0x2b7a67={'raw':![],'where':{'id':_0x5db32e[_0xd87a('0x45')]['id']}},_0x47e3f8={};_0x47e3f8['model']=_['keys'](db['IntegrationReport']['rawAttributes']);_0x47e3f8[_0xd87a('0x2d')]=_[_0xd87a('0x2e')](_0x5db32e['query']);_0x47e3f8['filters']=_['intersection'](_0x47e3f8[_0xd87a('0x30')],_0x47e3f8[_0xd87a('0x2d')]);_0x2b7a67['attributes']=_['intersection'](_0x47e3f8['model'],qs[_0xd87a('0x32')](_0x5db32e['query'][_0xd87a('0x32')]));_0x2b7a67[_0xd87a('0x31')]=_0x2b7a67[_0xd87a('0x31')][_0xd87a('0x33')]?_0x2b7a67[_0xd87a('0x31')]:_0x47e3f8['model'];if(_0x5db32e[_0xd87a('0x2d')][_0xd87a('0x40')]){_0x2b7a67[_0xd87a('0x41')]=[{'all':!![]}];}_0x2b7a67=_[_0xd87a('0x3d')]({},_0x2b7a67,_0x5db32e['options']);return db['IntegrationReport'][_0xd87a('0x46')](_0x2b7a67)['then'](handleEntityNotFound(_0x3f2d8b,null))[_0xd87a('0x23')](respondWithResult(_0x3f2d8b,null))[_0xd87a('0x44')](handleError(_0x3f2d8b,null));};exports[_0xd87a('0x47')]=function(_0x35c3c5,_0x3098da){return db['IntegrationReport'][_0xd87a('0x47')](_0x35c3c5[_0xd87a('0x48')],{})['then'](respondWithResult(_0x3098da,0xc9))[_0xd87a('0x44')](handleError(_0x3098da,null));};exports[_0xd87a('0x22')]=function(_0x317c21,_0x402c46){if(_0x317c21[_0xd87a('0x48')]['id']){delete _0x317c21[_0xd87a('0x48')]['id'];}return db['IntegrationReport'][_0xd87a('0x46')]({'where':{'id':_0x317c21['params']['id']}})['then'](handleEntityNotFound(_0x402c46,null))['then'](saveUpdates(_0x317c21[_0xd87a('0x48')],null))['then'](respondWithResult(_0x402c46,null))[_0xd87a('0x44')](handleError(_0x402c46,null));};exports['destroy']=function(_0x3077c0,_0x346ea6){return db[_0xd87a('0x3f')][_0xd87a('0x46')]({'where':{'id':_0x3077c0['params']['id']}})[_0xd87a('0x23')](handleEntityNotFound(_0x346ea6,null))[_0xd87a('0x23')](removeEntity(_0x346ea6,null))['catch'](handleError(_0x346ea6,null));};exports['describe']=function(_0x169d22,_0x16fad8){return db[_0xd87a('0x3f')][_0xd87a('0x49')]()[_0xd87a('0x23')](respondWithResult(_0x16fad8,null))[_0xd87a('0x44')](handleError(_0x16fad8,null));}; \ No newline at end of file +var _0xdaf8=['params','merge','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','save','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0xdaf8,0xdc));var _0x8daf=function(_0x2102d2,_0x27eebf){_0x2102d2=_0x2102d2-0x0;var _0x5226a0=_0xdaf8[_0x2102d2];return _0x5226a0;};'use strict';var emlformat=require(_0x8daf('0x0'));var rimraf=require(_0x8daf('0x1'));var zipdir=require(_0x8daf('0x2'));var jsonpatch=require(_0x8daf('0x3'));var rp=require(_0x8daf('0x4'));var moment=require('moment');var BPromise=require(_0x8daf('0x5'));var Mustache=require(_0x8daf('0x6'));var util=require(_0x8daf('0x7'));var path=require(_0x8daf('0x8'));var sox=require(_0x8daf('0x9'));var csv=require('to-csv');var ejs=require(_0x8daf('0xa'));var fs=require('fs');var fs_extra=require(_0x8daf('0xb'));var _=require('lodash');var squel=require(_0x8daf('0xc'));var crypto=require('crypto');var jsforce=require(_0x8daf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8daf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8daf('0xf'));var hardwareService=require(_0x8daf('0x10'));var logger=require(_0x8daf('0x11'))(_0x8daf('0x12'));var utils=require(_0x8daf('0x13'));var config=require(_0x8daf('0x14'));var licenseUtil=require(_0x8daf('0x15'));var db=require(_0x8daf('0x16'))['db'];function respondWithStatusCode(_0x563784,_0x5d7f17){_0x5d7f17=_0x5d7f17||0xcc;return function(_0x9b2b49){if(_0x9b2b49){return _0x563784[_0x8daf('0x17')](_0x5d7f17);}return _0x563784[_0x8daf('0x18')](_0x5d7f17)[_0x8daf('0x19')]();};}function respondWithResult(_0x54a610,_0x207c9b){_0x207c9b=_0x207c9b||0xc8;return function(_0x4c2667){if(_0x4c2667){return _0x54a610[_0x8daf('0x18')](_0x207c9b)[_0x8daf('0x1a')](_0x4c2667);}};}function respondWithFilteredResult(_0x4f75c2,_0x577976){return function(_0x5f11cd){if(_0x5f11cd){var _0x30bdd4=typeof _0x577976[_0x8daf('0x1b')]==='undefined'&&typeof _0x577976['limit']==='undefined';var _0x46618e=_0x5f11cd[_0x8daf('0x1c')];var _0x345956=_0x30bdd4?0x0:_0x577976[_0x8daf('0x1b')];var _0x226c44=_0x30bdd4?_0x5f11cd[_0x8daf('0x1c')]:_0x577976['offset']+_0x577976[_0x8daf('0x1d')];var _0x259ab1;if(_0x226c44>=_0x46618e){_0x226c44=_0x46618e;_0x259ab1=0xc8;}else{_0x259ab1=0xce;}_0x4f75c2[_0x8daf('0x18')](_0x259ab1);return _0x4f75c2['set']('Content-Range',_0x345956+'-'+_0x226c44+'/'+_0x46618e)[_0x8daf('0x1a')](_0x5f11cd);}return null;};}function patchUpdates(_0x9e14ea){return function(_0x5cefb3){try{jsonpatch['apply'](_0x5cefb3,_0x9e14ea,!![]);}catch(_0x254b78){return BPromise['reject'](_0x254b78);}return _0x5cefb3[_0x8daf('0x1e')]();};}function saveUpdates(_0x677e97,_0x268e3c){return function(_0x3c2cd7){if(_0x3c2cd7){return _0x3c2cd7['update'](_0x677e97)[_0x8daf('0x1f')](function(_0x26a709){return _0x26a709;});}return null;};}function removeEntity(_0x22f186,_0x535f0e){return function(_0x46a2e8){if(_0x46a2e8){return _0x46a2e8[_0x8daf('0x20')]()[_0x8daf('0x1f')](function(){_0x22f186[_0x8daf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5498,_0x25feb5){return function(_0x2c32d9){if(!_0x2c32d9){_0x2a5498[_0x8daf('0x17')](0x194);}return _0x2c32d9;};}function handleError(_0x579bf7,_0x5e1b7a){_0x5e1b7a=_0x5e1b7a||0x1f4;return function(_0xe9d090){logger[_0x8daf('0x21')](_0xe9d090[_0x8daf('0x22')]);if(_0xe9d090[_0x8daf('0x23')]){delete _0xe9d090[_0x8daf('0x23')];}_0x579bf7['status'](_0x5e1b7a)[_0x8daf('0x24')](_0xe9d090);};}exports[_0x8daf('0x25')]=function(_0x82ebf6,_0x246c08){var _0x313e3f={},_0x561ccc={},_0x1d8b77={'count':0x0,'rows':[]};var _0xfd28da=_[_0x8daf('0x26')](db[_0x8daf('0x27')][_0x8daf('0x28')],function(_0x11c7ee){return{'name':_0x11c7ee[_0x8daf('0x29')],'type':_0x11c7ee['type'][_0x8daf('0x2a')]};});_0x561ccc[_0x8daf('0x2b')]=_[_0x8daf('0x26')](_0xfd28da,_0x8daf('0x23'));_0x561ccc[_0x8daf('0x2c')]=_[_0x8daf('0x2d')](_0x82ebf6[_0x8daf('0x2c')]);_0x561ccc['filters']=_[_0x8daf('0x2e')](_0x561ccc['model'],_0x561ccc['query']);_0x313e3f[_0x8daf('0x2f')]=_[_0x8daf('0x2e')](_0x561ccc[_0x8daf('0x2b')],qs[_0x8daf('0x30')](_0x82ebf6['query'][_0x8daf('0x30')]));_0x313e3f[_0x8daf('0x2f')]=_0x313e3f['attributes'][_0x8daf('0x31')]?_0x313e3f['attributes']:_0x561ccc[_0x8daf('0x2b')];if(!_0x82ebf6['query'][_0x8daf('0x32')]('nolimit')){_0x313e3f[_0x8daf('0x1d')]=qs['limit'](_0x82ebf6[_0x8daf('0x2c')]['limit']);_0x313e3f['offset']=qs[_0x8daf('0x1b')](_0x82ebf6[_0x8daf('0x2c')][_0x8daf('0x1b')]);}_0x313e3f[_0x8daf('0x33')]=qs['sort'](_0x82ebf6[_0x8daf('0x2c')][_0x8daf('0x34')]);_0x313e3f['where']=qs[_0x8daf('0x35')](_[_0x8daf('0x36')](_0x82ebf6['query'],_0x561ccc[_0x8daf('0x35')]),_0xfd28da);if(_0x82ebf6['query'][_0x8daf('0x37')]){_0x313e3f[_0x8daf('0x38')]=_['merge'](_0x313e3f[_0x8daf('0x38')],{'$or':_[_0x8daf('0x26')](_0xfd28da,function(_0xf26427){if(_0xf26427['type']!==_0x8daf('0x39')){var _0xf62295={};_0xf62295[_0xf26427[_0x8daf('0x23')]]={'$like':'%'+_0x82ebf6[_0x8daf('0x2c')][_0x8daf('0x37')]+'%'};return _0xf62295;}})});}_0x313e3f=_['merge']({},_0x313e3f,_0x82ebf6[_0x8daf('0x3a')]);var _0x466ded={'where':_0x313e3f[_0x8daf('0x38')]};return db[_0x8daf('0x27')][_0x8daf('0x1c')](_0x466ded)[_0x8daf('0x1f')](function(_0x50547d){_0x1d8b77[_0x8daf('0x1c')]=_0x50547d;if(_0x82ebf6['query']['includeAll']){_0x313e3f[_0x8daf('0x3b')]=[{'all':!![]}];}return db[_0x8daf('0x27')][_0x8daf('0x3c')](_0x313e3f);})[_0x8daf('0x1f')](function(_0x8e549b){_0x1d8b77[_0x8daf('0x3d')]=_0x8e549b;return _0x1d8b77;})['then'](respondWithFilteredResult(_0x246c08,_0x313e3f))[_0x8daf('0x3e')](handleError(_0x246c08,null));};exports[_0x8daf('0x3f')]=function(_0x324ade,_0x8fb428){var _0x5262b6={'raw':![],'where':{'id':_0x324ade[_0x8daf('0x40')]['id']}},_0x1d202f={};_0x1d202f[_0x8daf('0x2b')]=_[_0x8daf('0x2d')](db['IntegrationReport'][_0x8daf('0x28')]);_0x1d202f[_0x8daf('0x2c')]=_[_0x8daf('0x2d')](_0x324ade[_0x8daf('0x2c')]);_0x1d202f[_0x8daf('0x35')]=_[_0x8daf('0x2e')](_0x1d202f[_0x8daf('0x2b')],_0x1d202f['query']);_0x5262b6[_0x8daf('0x2f')]=_['intersection'](_0x1d202f[_0x8daf('0x2b')],qs[_0x8daf('0x30')](_0x324ade[_0x8daf('0x2c')][_0x8daf('0x30')]));_0x5262b6['attributes']=_0x5262b6[_0x8daf('0x2f')][_0x8daf('0x31')]?_0x5262b6['attributes']:_0x1d202f[_0x8daf('0x2b')];if(_0x324ade['query']['includeAll']){_0x5262b6[_0x8daf('0x3b')]=[{'all':!![]}];}_0x5262b6=_[_0x8daf('0x41')]({},_0x5262b6,_0x324ade['options']);return db['IntegrationReport']['find'](_0x5262b6)['then'](handleEntityNotFound(_0x8fb428,null))[_0x8daf('0x1f')](respondWithResult(_0x8fb428,null))[_0x8daf('0x3e')](handleError(_0x8fb428,null));};exports[_0x8daf('0x42')]=function(_0x367cb4,_0x15d736){return db[_0x8daf('0x27')][_0x8daf('0x42')](_0x367cb4['body'],{})[_0x8daf('0x1f')](respondWithResult(_0x15d736,0xc9))[_0x8daf('0x3e')](handleError(_0x15d736,null));};exports[_0x8daf('0x43')]=function(_0x18da47,_0x23cdcc){if(_0x18da47[_0x8daf('0x44')]['id']){delete _0x18da47[_0x8daf('0x44')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x18da47['params']['id']}})[_0x8daf('0x1f')](handleEntityNotFound(_0x23cdcc,null))[_0x8daf('0x1f')](saveUpdates(_0x18da47[_0x8daf('0x44')],null))[_0x8daf('0x1f')](respondWithResult(_0x23cdcc,null))['catch'](handleError(_0x23cdcc,null));};exports[_0x8daf('0x20')]=function(_0x4dc7a3,_0x37e581){return db[_0x8daf('0x27')][_0x8daf('0x45')]({'where':{'id':_0x4dc7a3[_0x8daf('0x40')]['id']}})[_0x8daf('0x1f')](handleEntityNotFound(_0x37e581,null))[_0x8daf('0x1f')](removeEntity(_0x37e581,null))[_0x8daf('0x3e')](handleError(_0x37e581,null));};exports[_0x8daf('0x46')]=function(_0x46433d,_0x567c33){return db[_0x8daf('0x27')]['describe']()['then'](respondWithResult(_0x567c33,null))[_0x8daf('0x3e')](handleError(_0x567c33,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index cfb00d1..fd7c1ae 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 _0x4e9f=['../../config/environment','./integrationReport.attributes','IntegrationReport','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x4e9f,0x107));var _0xf4e9=function(_0x218575,_0x4a6910){_0x218575=_0x218575-0x0;var _0x1da7f0=_0x4e9f[_0x218575];return _0x1da7f0;};'use strict';var _=require(_0xf4e9('0x0'));var util=require(_0xf4e9('0x1'));var logger=require('../../config/logger')(_0xf4e9('0x2'));var moment=require('moment');var BPromise=require(_0xf4e9('0x3'));var rp=require(_0xf4e9('0x4'));var fs=require('fs');var path=require(_0xf4e9('0x5'));var rimraf=require(_0xf4e9('0x6'));var config=require(_0xf4e9('0x7'));var attributes=require(_0xf4e9('0x8'));module['exports']=function(_0x3362b5,_0x5510b2){return _0x3362b5['define'](_0xf4e9('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4102=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0x2496f5,_0x5489fa){var _0x49f194=function(_0x5545f1){while(--_0x5545f1){_0x2496f5['push'](_0x2496f5['shift']());}};_0x49f194(++_0x5489fa);}(_0x4102,0x1af));var _0x2410=function(_0x32da4c,_0x968f9e){_0x32da4c=_0x32da4c-0x0;var _0x2ee92c=_0x4102[_0x32da4c];return _0x2ee92c;};'use strict';var _=require(_0x2410('0x0'));var util=require(_0x2410('0x1'));var logger=require(_0x2410('0x2'))(_0x2410('0x3'));var moment=require('moment');var BPromise=require(_0x2410('0x4'));var rp=require(_0x2410('0x5'));var fs=require('fs');var path=require(_0x2410('0x6'));var rimraf=require('rimraf');var config=require(_0x2410('0x7'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x245e79,_0x8447d6){return _0x245e79[_0x2410('0x8')](_0x2410('0x9'),attributes,{'tableName':_0x2410('0xa'),'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 008cb94..e204c7f 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 _0x7a54=['info','IntegrationReport,\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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x397ef3,_0x2e5068){_0x397ef3=_0x397ef3-0x0;var _0x432104=_0x7a54[_0x397ef3];return _0x432104;};'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')]('IntegrationReport,\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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3e655a,_0x1a2097){var _0x40a6c5=function(_0x53044d){while(--_0x53044d){_0x3e655a['push'](_0x3e655a['shift']());}};_0x40a6c5(++_0x1a2097);}(_0x2ef3,0xba));var _0x32ef=function(_0xc7c02a,_0x43812f){_0xc7c02a=_0xc7c02a-0x0;var _0x50aa96=_0x2ef3[_0xc7c02a];return _0x50aa96;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 59f8d7e..a245f25 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 _0x14c5=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','update'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x14c5,0x1de));var _0x514c=function(_0x581d4a,_0x18ba03){_0x581d4a=_0x581d4a-0x0;var _0x3257a7=_0x14c5[_0x581d4a];return _0x3257a7;};'use strict';var multer=require(_0x514c('0x0'));var util=require(_0x514c('0x1'));var path=require(_0x514c('0x2'));var timeout=require('connect-timeout');var express=require(_0x514c('0x3'));var router=express[_0x514c('0x4')]();var fs_extra=require(_0x514c('0x5'));var auth=require(_0x514c('0x6'));var interaction=require(_0x514c('0x7'));var config=require(_0x514c('0x8'));var controller=require(_0x514c('0x9'));router[_0x514c('0xa')]('/',auth[_0x514c('0xb')](),controller['index']);router[_0x514c('0xa')](_0x514c('0xc'),auth[_0x514c('0xb')](),controller[_0x514c('0xd')]);router[_0x514c('0xa')](_0x514c('0xe'),auth[_0x514c('0xb')](),controller[_0x514c('0xf')]);router['post']('/',auth[_0x514c('0xb')](),controller[_0x514c('0x10')]);router[_0x514c('0x11')](_0x514c('0xe'),auth[_0x514c('0xb')](),controller[_0x514c('0x12')]);router[_0x514c('0x11')](_0x514c('0x13'),auth[_0x514c('0xb')](),controller[_0x514c('0x14')]);router['put'](_0x514c('0xc'),auth['isAuthenticated'](),controller[_0x514c('0x15')]);router[_0x514c('0x16')](_0x514c('0xc'),auth['isAuthenticated'](),controller[_0x514c('0x17')]);module[_0x514c('0x18')]=router; \ No newline at end of file +var _0xa786=['update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x5e1396,_0x34b52e){var _0x32e3e0=function(_0x33bc3f){while(--_0x33bc3f){_0x5e1396['push'](_0x5e1396['shift']());}};_0x32e3e0(++_0x34b52e);}(_0xa786,0x71));var _0x6a78=function(_0x18d313,_0x406974){_0x18d313=_0x18d313-0x0;var _0x169f1e=_0xa786[_0x18d313];return _0x169f1e;};'use strict';var multer=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var path=require(_0x6a78('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a78('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a78('0x4'));var interaction=require(_0x6a78('0x5'));var config=require(_0x6a78('0x6'));var controller=require(_0x6a78('0x7'));router[_0x6a78('0x8')]('/',auth[_0x6a78('0x9')](),controller[_0x6a78('0xa')]);router['get'](_0x6a78('0xb'),auth[_0x6a78('0x9')](),controller[_0x6a78('0xc')]);router[_0x6a78('0x8')](_0x6a78('0xd'),auth[_0x6a78('0x9')](),controller[_0x6a78('0xe')]);router[_0x6a78('0xf')]('/',auth[_0x6a78('0x9')](),controller['create']);router[_0x6a78('0xf')](_0x6a78('0xd'),auth[_0x6a78('0x9')](),controller['addInterval']);router[_0x6a78('0xf')](_0x6a78('0x10'),auth[_0x6a78('0x9')](),controller[_0x6a78('0x11')]);router[_0x6a78('0x12')]('/:id',auth[_0x6a78('0x9')](),controller[_0x6a78('0x13')]);router[_0x6a78('0x14')]('/:id',auth[_0x6a78('0x9')](),controller[_0x6a78('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index deaf3a8..5a7588a 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 _0x3ea0=['exports','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3ea0,0x1d3));var _0x03ea=function(_0x279755,_0x42ad77){_0x279755=_0x279755-0x0;var _0x138178=_0x3ea0[_0x279755];return _0x138178;};'use strict';var Sequelize=require(_0x03ea('0x0'));module[_0x03ea('0x1')]={'name':{'type':Sequelize[_0x03ea('0x2')]},'description':{'type':Sequelize[_0x03ea('0x2')]},'interval':{'type':Sequelize[_0x03ea('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf266=['exports','STRING','sequelize'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xf266,0x12b));var _0x6f26=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xf266[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x6f26('0x0'));module[_0x6f26('0x1')]={'name':{'type':Sequelize[_0x6f26('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index aed3235..b251b74 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 _0xfb99=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','undefined','count','offset','set','json','reject','save','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','Interval','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','merge','where','type','VIRTUAL','filter','options','includeAll','include','show','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getIntervals','findOne','pick','addIntervals','findAll','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','api'];(function(_0x1ddb93,_0x84f55e){var _0x4151b4=function(_0x3239df){while(--_0x3239df){_0x1ddb93['push'](_0x1ddb93['shift']());}};_0x4151b4(++_0x84f55e);}(_0xfb99,0x1e1));var _0x9fb9=function(_0x56a314,_0x4b4da8){_0x56a314=_0x56a314-0x0;var _0x490282=_0xfb99[_0x56a314];return _0x490282;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9fb9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9fb9('0x1'));var moment=require(_0x9fb9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9fb9('0x3'));var util=require(_0x9fb9('0x4'));var path=require(_0x9fb9('0x5'));var sox=require('sox');var csv=require(_0x9fb9('0x6'));var ejs=require(_0x9fb9('0x7'));var fs=require('fs');var fs_extra=require(_0x9fb9('0x8'));var _=require(_0x9fb9('0x9'));var squel=require(_0x9fb9('0xa'));var crypto=require(_0x9fb9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9fb9('0xc'));var toCsv=require(_0x9fb9('0x6'));var querystring=require('querystring');var Papa=require(_0x9fb9('0xd'));var Redis=require(_0x9fb9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9fb9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9fb9('0x10'));var utils=require(_0x9fb9('0x11'));var config=require(_0x9fb9('0x12'));var licenseUtil=require(_0x9fb9('0x13'));var db=require(_0x9fb9('0x14'))['db'];var extensions=require(_0x9fb9('0x15'));function respondWithStatusCode(_0x457764,_0x41a935){_0x41a935=_0x41a935||0xcc;return function(_0x2961df){if(_0x2961df){return _0x457764['sendStatus'](_0x41a935);}return _0x457764[_0x9fb9('0x16')](_0x41a935)[_0x9fb9('0x17')]();};}function respondWithResult(_0x648bd9,_0x31c5de){_0x31c5de=_0x31c5de||0xc8;return function(_0x11c096){if(_0x11c096){return _0x648bd9[_0x9fb9('0x16')](_0x31c5de)['json'](_0x11c096);}};}function respondWithFilteredResult(_0x102d86,_0x1f6673){return function(_0x1e6ec1){if(_0x1e6ec1){var _0x5a74af=typeof _0x1f6673['offset']===_0x9fb9('0x18')&&typeof _0x1f6673['limit']===_0x9fb9('0x18');var _0x49dad9=_0x1e6ec1[_0x9fb9('0x19')];var _0x3fbc7a=_0x5a74af?0x0:_0x1f6673['offset'];var _0x5e7273=_0x5a74af?_0x1e6ec1[_0x9fb9('0x19')]:_0x1f6673[_0x9fb9('0x1a')]+_0x1f6673['limit'];var _0x2ea6e2;if(_0x5e7273>=_0x49dad9){_0x5e7273=_0x49dad9;_0x2ea6e2=0xc8;}else{_0x2ea6e2=0xce;}_0x102d86[_0x9fb9('0x16')](_0x2ea6e2);return _0x102d86[_0x9fb9('0x1b')]('Content-Range',_0x3fbc7a+'-'+_0x5e7273+'/'+_0x49dad9)[_0x9fb9('0x1c')](_0x1e6ec1);}return null;};}function patchUpdates(_0x5aad85){return function(_0x3a41e7){try{jsonpatch['apply'](_0x3a41e7,_0x5aad85,!![]);}catch(_0x10db18){return BPromise[_0x9fb9('0x1d')](_0x10db18);}return _0x3a41e7[_0x9fb9('0x1e')]();};}function saveUpdates(_0x2ec7b0,_0x1a03f){return function(_0x276646){if(_0x276646){return _0x276646['update'](_0x2ec7b0)[_0x9fb9('0x1f')](function(_0x1ab6d9){return _0x1ab6d9;});}return null;};}function removeEntity(_0x2c187e,_0x3acc19){return function(_0x402658){if(_0x402658){return _0x402658[_0x9fb9('0x20')]()[_0x9fb9('0x1f')](function(){var _0x401183=_0x402658[_0x9fb9('0x21')]({'plain':!![]});var _0x463e36='Intervals';return db[_0x9fb9('0x22')][_0x9fb9('0x20')]({'where':{'type':_0x463e36,'resourceId':_0x401183['id']}})['then'](function(){return _0x402658;});})[_0x9fb9('0x1f')](function(){_0x2c187e['status'](0xcc)[_0x9fb9('0x17')]();});}};}function handleEntityNotFound(_0x2b3837,_0x5e3b4e){return function(_0x39d73c){if(!_0x39d73c){_0x2b3837[_0x9fb9('0x23')](0x194);}return _0x39d73c;};}function handleError(_0x28651d,_0x4e71ae){_0x4e71ae=_0x4e71ae||0x1f4;return function(_0x3dc626){logger['error'](_0x3dc626[_0x9fb9('0x24')]);if(_0x3dc626[_0x9fb9('0x25')]){delete _0x3dc626['name'];}_0x28651d[_0x9fb9('0x16')](_0x4e71ae)[_0x9fb9('0x26')](_0x3dc626);};}exports[_0x9fb9('0x27')]=function(_0x4ffaaa,_0x27cff7){var _0x10cc5a={},_0x431f22={},_0x2e48a5={'count':0x0,'rows':[]};var _0x20399a=_[_0x9fb9('0x28')](db[_0x9fb9('0x29')][_0x9fb9('0x2a')],function(_0x1a3f02){return{'name':_0x1a3f02[_0x9fb9('0x2b')],'type':_0x1a3f02['type']['key']};});_0x431f22[_0x9fb9('0x2c')]=_['map'](_0x20399a,_0x9fb9('0x25'));_0x431f22[_0x9fb9('0x2d')]=_[_0x9fb9('0x2e')](_0x4ffaaa[_0x9fb9('0x2d')]);_0x431f22['filters']=_[_0x9fb9('0x2f')](_0x431f22[_0x9fb9('0x2c')],_0x431f22[_0x9fb9('0x2d')]);_0x10cc5a[_0x9fb9('0x30')]=_['intersection'](_0x431f22[_0x9fb9('0x2c')],qs[_0x9fb9('0x31')](_0x4ffaaa[_0x9fb9('0x2d')][_0x9fb9('0x31')]));_0x10cc5a[_0x9fb9('0x30')]=_0x10cc5a[_0x9fb9('0x30')]['length']?_0x10cc5a[_0x9fb9('0x30')]:_0x431f22[_0x9fb9('0x2c')];if(!_0x4ffaaa[_0x9fb9('0x2d')][_0x9fb9('0x32')](_0x9fb9('0x33'))){_0x10cc5a[_0x9fb9('0x34')]=qs[_0x9fb9('0x34')](_0x4ffaaa[_0x9fb9('0x2d')][_0x9fb9('0x34')]);_0x10cc5a['offset']=qs['offset'](_0x4ffaaa['query']['offset']);}_0x10cc5a[_0x9fb9('0x35')]=qs[_0x9fb9('0x36')](_0x4ffaaa[_0x9fb9('0x2d')][_0x9fb9('0x36')]);_0x10cc5a['where']=qs[_0x9fb9('0x37')](_['pick'](_0x4ffaaa[_0x9fb9('0x2d')],_0x431f22['filters']),_0x20399a);if(_0x4ffaaa[_0x9fb9('0x2d')]['filter']){_0x10cc5a['where']=_[_0x9fb9('0x38')](_0x10cc5a[_0x9fb9('0x39')],{'$or':_['map'](_0x20399a,function(_0x31f2cb){if(_0x31f2cb[_0x9fb9('0x3a')]!==_0x9fb9('0x3b')){var _0x3f260f={};_0x3f260f[_0x31f2cb[_0x9fb9('0x25')]]={'$like':'%'+_0x4ffaaa[_0x9fb9('0x2d')][_0x9fb9('0x3c')]+'%'};return _0x3f260f;}})});}_0x10cc5a=_[_0x9fb9('0x38')]({},_0x10cc5a,_0x4ffaaa[_0x9fb9('0x3d')]);var _0x1c90f8={'where':_0x10cc5a[_0x9fb9('0x39')]};return db[_0x9fb9('0x29')][_0x9fb9('0x19')](_0x1c90f8)[_0x9fb9('0x1f')](function(_0x2ba722){_0x2e48a5[_0x9fb9('0x19')]=_0x2ba722;if(_0x4ffaaa[_0x9fb9('0x2d')][_0x9fb9('0x3e')]){_0x10cc5a[_0x9fb9('0x3f')]=[{'all':!![]}];}return db[_0x9fb9('0x29')]['findAll'](_0x10cc5a);})[_0x9fb9('0x1f')](function(_0x988685){_0x2e48a5['rows']=_0x988685;return _0x2e48a5;})[_0x9fb9('0x1f')](respondWithFilteredResult(_0x27cff7,_0x10cc5a))['catch'](handleError(_0x27cff7,null));};exports[_0x9fb9('0x40')]=function(_0x3f7f57,_0x2a721f){var _0xe6deac={'raw':!![],'where':{'id':_0x3f7f57['params']['id']}},_0x5a2efe={};_0x5a2efe[_0x9fb9('0x2c')]=_['keys'](db[_0x9fb9('0x29')][_0x9fb9('0x2a')]);_0x5a2efe[_0x9fb9('0x2d')]=_[_0x9fb9('0x2e')](_0x3f7f57[_0x9fb9('0x2d')]);_0x5a2efe[_0x9fb9('0x37')]=_[_0x9fb9('0x2f')](_0x5a2efe[_0x9fb9('0x2c')],_0x5a2efe[_0x9fb9('0x2d')]);_0xe6deac[_0x9fb9('0x30')]=_['intersection'](_0x5a2efe[_0x9fb9('0x2c')],qs[_0x9fb9('0x31')](_0x3f7f57[_0x9fb9('0x2d')][_0x9fb9('0x31')]));_0xe6deac[_0x9fb9('0x30')]=_0xe6deac['attributes'][_0x9fb9('0x41')]?_0xe6deac[_0x9fb9('0x30')]:_0x5a2efe['model'];if(_0x3f7f57[_0x9fb9('0x2d')][_0x9fb9('0x3e')]){_0xe6deac[_0x9fb9('0x3f')]=[{'all':!![]}];}_0xe6deac=_['merge']({},_0xe6deac,_0x3f7f57[_0x9fb9('0x3d')]);return db[_0x9fb9('0x29')][_0x9fb9('0x42')](_0xe6deac)[_0x9fb9('0x1f')](handleEntityNotFound(_0x2a721f,null))['then'](respondWithResult(_0x2a721f,null))[_0x9fb9('0x43')](handleError(_0x2a721f,null));};exports['create']=function(_0x337b61,_0x548a19){return db['Interval'][_0x9fb9('0x44')](_0x337b61[_0x9fb9('0x45')],{})[_0x9fb9('0x1f')](function(_0x345e6e){var _0x444035=_0x337b61[_0x9fb9('0x46')][_0x9fb9('0x21')]({'plain':!![]});if(!_0x444035)throw new Error(_0x9fb9('0x47'));if(_0x444035[_0x9fb9('0x48')]===_0x9fb9('0x46')){var _0x5e74f1=_0x345e6e['get']({'plain':!![]});var _0x1612e5=_0x9fb9('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1612e5,'userProfileId':_0x444035[_0x9fb9('0x4a')]},'raw':!![]})[_0x9fb9('0x1f')](function(_0x32efd7){if(_0x32efd7&&_0x32efd7['autoAssociation']===0x0){return db[_0x9fb9('0x22')][_0x9fb9('0x44')]({'name':_0x5e74f1[_0x9fb9('0x25')],'resourceId':_0x5e74f1['id'],'type':_0x32efd7['name'],'sectionId':_0x32efd7['id']},{})[_0x9fb9('0x1f')](function(){return _0x345e6e;});}else{return _0x345e6e;}})['catch'](function(_0x21f8ab){logger['error'](_0x9fb9('0x4b'),_0x21f8ab);throw _0x21f8ab;});}return _0x345e6e;})[_0x9fb9('0x1f')](respondWithResult(_0x548a19,0xc9))[_0x9fb9('0x43')](handleError(_0x548a19,null));};exports[_0x9fb9('0x4c')]=function(_0x1ff19c,_0x29a16b){if(_0x1ff19c['body']['id']){delete _0x1ff19c[_0x9fb9('0x45')]['id'];}return db[_0x9fb9('0x29')]['find']({'where':{'id':_0x1ff19c['params']['id']}})[_0x9fb9('0x1f')](handleEntityNotFound(_0x29a16b,null))[_0x9fb9('0x1f')](saveUpdates(_0x1ff19c[_0x9fb9('0x45')],null))[_0x9fb9('0x1f')](respondWithResult(_0x29a16b,null))[_0x9fb9('0x43')](handleError(_0x29a16b,null));};exports[_0x9fb9('0x20')]=function(_0xee2cdb,_0x56fdf0){return db[_0x9fb9('0x29')][_0x9fb9('0x42')]({'where':{'id':_0xee2cdb[_0x9fb9('0x4d')]['id']}})[_0x9fb9('0x1f')](handleEntityNotFound(_0x56fdf0,null))[_0x9fb9('0x1f')](removeEntity(_0x56fdf0,null))[_0x9fb9('0x43')](handleError(_0x56fdf0,null));};exports['addInterval']=function(_0x2e8093,_0x5b7c9f,_0x56606e){if(_0x2e8093[_0x9fb9('0x45')]['id']){delete _0x2e8093[_0x9fb9('0x45')]['id'];}return db['Interval'][_0x9fb9('0x42')]({'where':{'id':_0x2e8093['params']['id']}})[_0x9fb9('0x1f')](handleEntityNotFound(_0x5b7c9f,null))[_0x9fb9('0x1f')](function(_0x21838d){if(_0x21838d){_0x2e8093[_0x9fb9('0x45')]['IntervalId']=_0x21838d['id'];return db[_0x9fb9('0x29')]['create'](_0x2e8093[_0x9fb9('0x45')]);}})[_0x9fb9('0x1f')](respondWithResult(_0x5b7c9f,null))[_0x9fb9('0x43')](handleError(_0x5b7c9f,null));};exports[_0x9fb9('0x4e')]=function(_0x336ff7,_0x35db9e,_0xe3c96d){var _0xc0577c={};var _0x190cb0={};var _0x5a189b;var _0x31bfcb;return db[_0x9fb9('0x29')][_0x9fb9('0x4f')]({'where':{'id':_0x336ff7[_0x9fb9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35db9e,null))[_0x9fb9('0x1f')](function(_0xf539c2){if(_0xf539c2){_0x5a189b=_0xf539c2;_0x190cb0[_0x9fb9('0x2c')]=_['keys'](db['Interval'][_0x9fb9('0x2a')]);_0x190cb0[_0x9fb9('0x2d')]=_[_0x9fb9('0x2e')](_0x336ff7[_0x9fb9('0x2d')]);_0x190cb0['filters']=_['intersection'](_0x190cb0['model'],_0x190cb0[_0x9fb9('0x2d')]);_0xc0577c[_0x9fb9('0x30')]=_[_0x9fb9('0x2f')](_0x190cb0[_0x9fb9('0x2c')],qs['fields'](_0x336ff7['query'][_0x9fb9('0x31')]));_0xc0577c[_0x9fb9('0x30')]=_0xc0577c[_0x9fb9('0x30')][_0x9fb9('0x41')]?_0xc0577c[_0x9fb9('0x30')]:_0x190cb0['model'];_0xc0577c[_0x9fb9('0x35')]=qs[_0x9fb9('0x36')](_0x336ff7['query'][_0x9fb9('0x36')]);_0xc0577c['where']=qs[_0x9fb9('0x37')](_[_0x9fb9('0x50')](_0x336ff7[_0x9fb9('0x2d')],_0x190cb0[_0x9fb9('0x37')]));if(_0x336ff7[_0x9fb9('0x2d')][_0x9fb9('0x3c')]){_0xc0577c[_0x9fb9('0x39')]=_['merge'](_0xc0577c['where'],{'$or':_['map'](_0xc0577c[_0x9fb9('0x30')],function(_0x177c15){var _0x223d44={};_0x223d44[_0x177c15]={'$like':'%'+_0x336ff7[_0x9fb9('0x2d')]['filter']+'%'};return _0x223d44;})});}_0xc0577c=_[_0x9fb9('0x38')]({},_0xc0577c,_0x336ff7[_0x9fb9('0x3d')]);return _0x5a189b[_0x9fb9('0x4e')](_0xc0577c);}})[_0x9fb9('0x1f')](function(_0x53b943){if(_0x53b943){_0x31bfcb=_0x53b943[_0x9fb9('0x41')];if(!_0x336ff7[_0x9fb9('0x2d')][_0x9fb9('0x32')](_0x9fb9('0x33'))){_0xc0577c[_0x9fb9('0x34')]=qs[_0x9fb9('0x34')](_0x336ff7['query'][_0x9fb9('0x34')]);_0xc0577c[_0x9fb9('0x1a')]=qs[_0x9fb9('0x1a')](_0x336ff7[_0x9fb9('0x2d')][_0x9fb9('0x1a')]);}return _0x5a189b['getIntervals'](_0xc0577c);}})[_0x9fb9('0x1f')](function(_0x56b53e){if(_0x56b53e){return _0x56b53e?{'count':_0x31bfcb,'rows':_0x56b53e}:null;}})[_0x9fb9('0x1f')](respondWithResult(_0x35db9e,null))[_0x9fb9('0x43')](handleError(_0x35db9e,null));};exports[_0x9fb9('0x51')]=function(_0x55b421,_0x40767c,_0x322328){return db[_0x9fb9('0x29')][_0x9fb9('0x4f')]({'where':{'id':_0x55b421[_0x9fb9('0x4d')]['id']}})[_0x9fb9('0x1f')](handleEntityNotFound(_0x40767c,null))['then'](function(_0x22f189){if(_0x22f189){return db['sequelize']['transaction'](function(_0x348acd){return db['Interval']['destroy']({'where':{'IntervalId':_0x55b421[_0x9fb9('0x4d')]['id']},'transaction':_0x348acd})[_0x9fb9('0x1f')](function(_0x37aa73){var _0xc7f6f5=_['map'](_0x55b421['body'],function(_0x4b6bd3){delete _0x4b6bd3['id'];_0x4b6bd3['IntervalId']=_0x55b421[_0x9fb9('0x4d')]['id'];return _0x4b6bd3;});return db['Interval']['bulkCreate'](_0xc7f6f5,{'transaction':_0x348acd});});})[_0x9fb9('0x1f')](function(){return db[_0x9fb9('0x29')][_0x9fb9('0x52')]({'where':{'IntervalId':_0x55b421[_0x9fb9('0x4d')]['id']}});});}})[_0x9fb9('0x1f')](respondWithResult(_0x40767c,null))['catch'](handleError(_0x40767c,null));}; \ No newline at end of file +var _0x171b=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Interval','includeAll','include','rows','catch','params','length','options','create'];(function(_0x4c9af8,_0x38679b){var _0x4b39c4=function(_0x17c8dd){while(--_0x17c8dd){_0x4c9af8['push'](_0x4c9af8['shift']());}};_0x4b39c4(++_0x38679b);}(_0x171b,0x1da));var _0xb171=function(_0x489c76,_0x51944c){_0x489c76=_0x489c76-0x0;var _0x420e6d=_0x171b[_0x489c76];return _0x420e6d;};'use strict';var emlformat=require(_0xb171('0x0'));var rimraf=require(_0xb171('0x1'));var zipdir=require(_0xb171('0x2'));var jsonpatch=require(_0xb171('0x3'));var rp=require(_0xb171('0x4'));var moment=require(_0xb171('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb171('0x6'));var util=require(_0xb171('0x7'));var path=require('path');var sox=require(_0xb171('0x8'));var csv=require(_0xb171('0x9'));var ejs=require(_0xb171('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb171('0xb'));var squel=require(_0xb171('0xc'));var crypto=require(_0xb171('0xd'));var jsforce=require(_0xb171('0xe'));var deskjs=require(_0xb171('0xf'));var toCsv=require(_0xb171('0x9'));var querystring=require(_0xb171('0x10'));var Papa=require(_0xb171('0x11'));var Redis=require(_0xb171('0x12'));var authService=require(_0xb171('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb171('0x14'));var hardwareService=require(_0xb171('0x15'));var logger=require(_0xb171('0x16'))('api');var utils=require(_0xb171('0x17'));var config=require(_0xb171('0x18'));var licenseUtil=require(_0xb171('0x19'));var db=require('../../mysqldb')['db'];var extensions=require(_0xb171('0x1a'));function respondWithStatusCode(_0x5bad74,_0x219c00){_0x219c00=_0x219c00||0xcc;return function(_0xfa6154){if(_0xfa6154){return _0x5bad74[_0xb171('0x1b')](_0x219c00);}return _0x5bad74[_0xb171('0x1c')](_0x219c00)[_0xb171('0x1d')]();};}function respondWithResult(_0xd1e395,_0x4b5ef4){_0x4b5ef4=_0x4b5ef4||0xc8;return function(_0x2473e2){if(_0x2473e2){return _0xd1e395[_0xb171('0x1c')](_0x4b5ef4)[_0xb171('0x1e')](_0x2473e2);}};}function respondWithFilteredResult(_0x2fbd8f,_0x937d99){return function(_0x2ad9a2){if(_0x2ad9a2){var _0x885aa4=typeof _0x937d99[_0xb171('0x1f')]===_0xb171('0x20')&&typeof _0x937d99[_0xb171('0x21')]===_0xb171('0x20');var _0x453e3d=_0x2ad9a2[_0xb171('0x22')];var _0x24db0d=_0x885aa4?0x0:_0x937d99['offset'];var _0x535cb0=_0x885aa4?_0x2ad9a2[_0xb171('0x22')]:_0x937d99[_0xb171('0x1f')]+_0x937d99[_0xb171('0x21')];var _0x104c03;if(_0x535cb0>=_0x453e3d){_0x535cb0=_0x453e3d;_0x104c03=0xc8;}else{_0x104c03=0xce;}_0x2fbd8f[_0xb171('0x1c')](_0x104c03);return _0x2fbd8f[_0xb171('0x23')](_0xb171('0x24'),_0x24db0d+'-'+_0x535cb0+'/'+_0x453e3d)[_0xb171('0x1e')](_0x2ad9a2);}return null;};}function patchUpdates(_0xbbc60){return function(_0x1fdb7b){try{jsonpatch[_0xb171('0x25')](_0x1fdb7b,_0xbbc60,!![]);}catch(_0x138787){return BPromise['reject'](_0x138787);}return _0x1fdb7b[_0xb171('0x26')]();};}function saveUpdates(_0x55fc61,_0xd4340a){return function(_0x529029){if(_0x529029){return _0x529029[_0xb171('0x27')](_0x55fc61)[_0xb171('0x28')](function(_0x4d5cd5){return _0x4d5cd5;});}return null;};}function removeEntity(_0x5cf2f4,_0x54c31d){return function(_0x5b7e74){if(_0x5b7e74){return _0x5b7e74[_0xb171('0x29')]()[_0xb171('0x28')](function(){var _0x13823c=_0x5b7e74[_0xb171('0x2a')]({'plain':!![]});var _0xddd9e4=_0xb171('0x2b');return db[_0xb171('0x2c')][_0xb171('0x29')]({'where':{'type':_0xddd9e4,'resourceId':_0x13823c['id']}})['then'](function(){return _0x5b7e74;});})[_0xb171('0x28')](function(){_0x5cf2f4[_0xb171('0x1c')](0xcc)[_0xb171('0x1d')]();});}};}function handleEntityNotFound(_0x2844b5,_0x421b15){return function(_0x155074){if(!_0x155074){_0x2844b5[_0xb171('0x1b')](0x194);}return _0x155074;};}function handleError(_0x1736c8,_0x1538a9){_0x1538a9=_0x1538a9||0x1f4;return function(_0x2a83d3){logger[_0xb171('0x2d')](_0x2a83d3[_0xb171('0x2e')]);if(_0x2a83d3['name']){delete _0x2a83d3[_0xb171('0x2f')];}_0x1736c8[_0xb171('0x1c')](_0x1538a9)[_0xb171('0x30')](_0x2a83d3);};}exports['index']=function(_0x1490ab,_0x28193c){var _0x260d3d={},_0x1d292d={},_0x2d5533={'count':0x0,'rows':[]};var _0x3e674f=_[_0xb171('0x31')](db['Interval'][_0xb171('0x32')],function(_0x2e7f3a){return{'name':_0x2e7f3a['fieldName'],'type':_0x2e7f3a[_0xb171('0x33')][_0xb171('0x34')]};});_0x1d292d[_0xb171('0x35')]=_[_0xb171('0x31')](_0x3e674f,_0xb171('0x2f'));_0x1d292d[_0xb171('0x36')]=_[_0xb171('0x37')](_0x1490ab[_0xb171('0x36')]);_0x1d292d[_0xb171('0x38')]=_[_0xb171('0x39')](_0x1d292d[_0xb171('0x35')],_0x1d292d[_0xb171('0x36')]);_0x260d3d['attributes']=_[_0xb171('0x39')](_0x1d292d['model'],qs['fields'](_0x1490ab['query'][_0xb171('0x3a')]));_0x260d3d[_0xb171('0x3b')]=_0x260d3d['attributes']['length']?_0x260d3d['attributes']:_0x1d292d[_0xb171('0x35')];if(!_0x1490ab[_0xb171('0x36')][_0xb171('0x3c')](_0xb171('0x3d'))){_0x260d3d[_0xb171('0x21')]=qs[_0xb171('0x21')](_0x1490ab[_0xb171('0x36')][_0xb171('0x21')]);_0x260d3d[_0xb171('0x1f')]=qs[_0xb171('0x1f')](_0x1490ab[_0xb171('0x36')][_0xb171('0x1f')]);}_0x260d3d[_0xb171('0x3e')]=qs[_0xb171('0x3f')](_0x1490ab[_0xb171('0x36')][_0xb171('0x3f')]);_0x260d3d['where']=qs['filters'](_[_0xb171('0x40')](_0x1490ab['query'],_0x1d292d['filters']),_0x3e674f);if(_0x1490ab['query'][_0xb171('0x41')]){_0x260d3d[_0xb171('0x42')]=_[_0xb171('0x43')](_0x260d3d[_0xb171('0x42')],{'$or':_['map'](_0x3e674f,function(_0x36b76d){if(_0x36b76d['type']!==_0xb171('0x44')){var _0x892079={};_0x892079[_0x36b76d[_0xb171('0x2f')]]={'$like':'%'+_0x1490ab[_0xb171('0x36')][_0xb171('0x41')]+'%'};return _0x892079;}})});}_0x260d3d=_[_0xb171('0x43')]({},_0x260d3d,_0x1490ab['options']);var _0x4354bc={'where':_0x260d3d[_0xb171('0x42')]};return db[_0xb171('0x45')]['count'](_0x4354bc)['then'](function(_0x4adad3){_0x2d5533[_0xb171('0x22')]=_0x4adad3;if(_0x1490ab['query'][_0xb171('0x46')]){_0x260d3d[_0xb171('0x47')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x260d3d);})['then'](function(_0x3bb571){_0x2d5533[_0xb171('0x48')]=_0x3bb571;return _0x2d5533;})[_0xb171('0x28')](respondWithFilteredResult(_0x28193c,_0x260d3d))[_0xb171('0x49')](handleError(_0x28193c,null));};exports['show']=function(_0x383afe,_0x3228b4){var _0x289efb={'raw':!![],'where':{'id':_0x383afe[_0xb171('0x4a')]['id']}},_0x53697a={};_0x53697a[_0xb171('0x35')]=_[_0xb171('0x37')](db['Interval'][_0xb171('0x32')]);_0x53697a['query']=_['keys'](_0x383afe[_0xb171('0x36')]);_0x53697a[_0xb171('0x38')]=_[_0xb171('0x39')](_0x53697a[_0xb171('0x35')],_0x53697a[_0xb171('0x36')]);_0x289efb[_0xb171('0x3b')]=_[_0xb171('0x39')](_0x53697a[_0xb171('0x35')],qs['fields'](_0x383afe[_0xb171('0x36')][_0xb171('0x3a')]));_0x289efb['attributes']=_0x289efb[_0xb171('0x3b')][_0xb171('0x4b')]?_0x289efb['attributes']:_0x53697a[_0xb171('0x35')];if(_0x383afe[_0xb171('0x36')][_0xb171('0x46')]){_0x289efb[_0xb171('0x47')]=[{'all':!![]}];}_0x289efb=_[_0xb171('0x43')]({},_0x289efb,_0x383afe[_0xb171('0x4c')]);return db[_0xb171('0x45')]['find'](_0x289efb)[_0xb171('0x28')](handleEntityNotFound(_0x3228b4,null))[_0xb171('0x28')](respondWithResult(_0x3228b4,null))[_0xb171('0x49')](handleError(_0x3228b4,null));};exports['create']=function(_0x21e4d8,_0x2523d8){return db['Interval'][_0xb171('0x4d')](_0x21e4d8[_0xb171('0x4e')],{})[_0xb171('0x28')](function(_0x49f69d){var _0x5c911d=_0x21e4d8[_0xb171('0x4f')][_0xb171('0x2a')]({'plain':!![]});if(!_0x5c911d)throw new Error(_0xb171('0x50'));if(_0x5c911d[_0xb171('0x51')]===_0xb171('0x4f')){var _0x46744d=_0x49f69d[_0xb171('0x2a')]({'plain':!![]});var _0x429b52='Intervals';return db[_0xb171('0x52')][_0xb171('0x53')]({'where':{'name':_0x429b52,'userProfileId':_0x5c911d['userProfileId']},'raw':!![]})[_0xb171('0x28')](function(_0x509a05){if(_0x509a05&&_0x509a05[_0xb171('0x54')]===0x0){return db[_0xb171('0x2c')]['create']({'name':_0x46744d[_0xb171('0x2f')],'resourceId':_0x46744d['id'],'type':_0x509a05['name'],'sectionId':_0x509a05['id']},{})['then'](function(){return _0x49f69d;});}else{return _0x49f69d;}})[_0xb171('0x49')](function(_0x3b44ec){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b44ec);throw _0x3b44ec;});}return _0x49f69d;})[_0xb171('0x28')](respondWithResult(_0x2523d8,0xc9))['catch'](handleError(_0x2523d8,null));};exports['update']=function(_0x48fe56,_0x2a2c2a){if(_0x48fe56['body']['id']){delete _0x48fe56[_0xb171('0x4e')]['id'];}return db[_0xb171('0x45')][_0xb171('0x53')]({'where':{'id':_0x48fe56['params']['id']}})['then'](handleEntityNotFound(_0x2a2c2a,null))[_0xb171('0x28')](saveUpdates(_0x48fe56[_0xb171('0x4e')],null))[_0xb171('0x28')](respondWithResult(_0x2a2c2a,null))[_0xb171('0x49')](handleError(_0x2a2c2a,null));};exports[_0xb171('0x29')]=function(_0x50ee49,_0x1b11e2){return db[_0xb171('0x45')]['find']({'where':{'id':_0x50ee49['params']['id']}})[_0xb171('0x28')](handleEntityNotFound(_0x1b11e2,null))[_0xb171('0x28')](removeEntity(_0x1b11e2,null))[_0xb171('0x49')](handleError(_0x1b11e2,null));};exports['addInterval']=function(_0x2808a8,_0x123d35,_0x4f8b12){if(_0x2808a8[_0xb171('0x4e')]['id']){delete _0x2808a8[_0xb171('0x4e')]['id'];}return db[_0xb171('0x45')][_0xb171('0x53')]({'where':{'id':_0x2808a8[_0xb171('0x4a')]['id']}})['then'](handleEntityNotFound(_0x123d35,null))[_0xb171('0x28')](function(_0x41d149){if(_0x41d149){_0x2808a8['body'][_0xb171('0x55')]=_0x41d149['id'];return db['Interval'][_0xb171('0x4d')](_0x2808a8['body']);}})[_0xb171('0x28')](respondWithResult(_0x123d35,null))[_0xb171('0x49')](handleError(_0x123d35,null));};exports[_0xb171('0x56')]=function(_0x42f210,_0x30d1f6,_0x5c8592){var _0x3d1b98={};var _0x11f3e1={};var _0x48cfb2;var _0xdefb84;return db['Interval']['findOne']({'where':{'id':_0x42f210['params']['id']}})[_0xb171('0x28')](handleEntityNotFound(_0x30d1f6,null))[_0xb171('0x28')](function(_0xb542cb){if(_0xb542cb){_0x48cfb2=_0xb542cb;_0x11f3e1[_0xb171('0x35')]=_[_0xb171('0x37')](db[_0xb171('0x45')][_0xb171('0x32')]);_0x11f3e1[_0xb171('0x36')]=_[_0xb171('0x37')](_0x42f210[_0xb171('0x36')]);_0x11f3e1[_0xb171('0x38')]=_['intersection'](_0x11f3e1[_0xb171('0x35')],_0x11f3e1[_0xb171('0x36')]);_0x3d1b98[_0xb171('0x3b')]=_[_0xb171('0x39')](_0x11f3e1['model'],qs[_0xb171('0x3a')](_0x42f210[_0xb171('0x36')][_0xb171('0x3a')]));_0x3d1b98[_0xb171('0x3b')]=_0x3d1b98[_0xb171('0x3b')]['length']?_0x3d1b98[_0xb171('0x3b')]:_0x11f3e1[_0xb171('0x35')];_0x3d1b98[_0xb171('0x3e')]=qs[_0xb171('0x3f')](_0x42f210[_0xb171('0x36')]['sort']);_0x3d1b98[_0xb171('0x42')]=qs[_0xb171('0x38')](_[_0xb171('0x40')](_0x42f210[_0xb171('0x36')],_0x11f3e1[_0xb171('0x38')]));if(_0x42f210[_0xb171('0x36')][_0xb171('0x41')]){_0x3d1b98[_0xb171('0x42')]=_[_0xb171('0x43')](_0x3d1b98['where'],{'$or':_['map'](_0x3d1b98[_0xb171('0x3b')],function(_0x817d92){var _0x4ee14b={};_0x4ee14b[_0x817d92]={'$like':'%'+_0x42f210[_0xb171('0x36')][_0xb171('0x41')]+'%'};return _0x4ee14b;})});}_0x3d1b98=_[_0xb171('0x43')]({},_0x3d1b98,_0x42f210['options']);return _0x48cfb2[_0xb171('0x56')](_0x3d1b98);}})[_0xb171('0x28')](function(_0x51fb9b){if(_0x51fb9b){_0xdefb84=_0x51fb9b[_0xb171('0x4b')];if(!_0x42f210[_0xb171('0x36')][_0xb171('0x3c')]('nolimit')){_0x3d1b98[_0xb171('0x21')]=qs[_0xb171('0x21')](_0x42f210[_0xb171('0x36')]['limit']);_0x3d1b98['offset']=qs[_0xb171('0x1f')](_0x42f210['query'][_0xb171('0x1f')]);}return _0x48cfb2[_0xb171('0x56')](_0x3d1b98);}})[_0xb171('0x28')](function(_0x226f4f){if(_0x226f4f){return _0x226f4f?{'count':_0xdefb84,'rows':_0x226f4f}:null;}})[_0xb171('0x28')](respondWithResult(_0x30d1f6,null))['catch'](handleError(_0x30d1f6,null));};exports[_0xb171('0x57')]=function(_0x51cd42,_0x248d81,_0x15bef4){return db[_0xb171('0x45')][_0xb171('0x58')]({'where':{'id':_0x51cd42[_0xb171('0x4a')]['id']}})['then'](handleEntityNotFound(_0x248d81,null))[_0xb171('0x28')](function(_0x42a127){if(_0x42a127){return db[_0xb171('0x59')][_0xb171('0x5a')](function(_0x3f1095){return db[_0xb171('0x45')]['destroy']({'where':{'IntervalId':_0x51cd42[_0xb171('0x4a')]['id']},'transaction':_0x3f1095})['then'](function(_0x157a6b){var _0x2bc87a=_[_0xb171('0x31')](_0x51cd42[_0xb171('0x4e')],function(_0x5b2bfb){delete _0x5b2bfb['id'];_0x5b2bfb['IntervalId']=_0x51cd42[_0xb171('0x4a')]['id'];return _0x5b2bfb;});return db[_0xb171('0x45')]['bulkCreate'](_0x2bc87a,{'transaction':_0x3f1095});});})[_0xb171('0x28')](function(){return db['Interval'][_0xb171('0x5b')]({'where':{'IntervalId':_0x51cd42['params']['id']}});});}})[_0xb171('0x28')](respondWithResult(_0x248d81,null))[_0xb171('0x49')](handleError(_0x248d81,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7ac4bc6..35140e4 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 _0xb8e7=['rewrite','string','interval','getIntervals','map','ifTime','then','reduce','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals'];(function(_0x255554,_0x267e8a){var _0x54eef9=function(_0x188665){while(--_0x188665){_0x255554['push'](_0x255554['shift']());}};_0x54eef9(++_0x267e8a);}(_0xb8e7,0x70));var _0x7b8e=function(_0x49db4f,_0x2498bc){_0x49db4f=_0x49db4f-0x0;var _0x21e442=_0xb8e7[_0x49db4f];return _0x21e442;};'use strict';var attributes=require(_0x7b8e('0x0'));var extensions=require(_0x7b8e('0x1'));var iftime=require('../../utils/iftime')['iftime'];module[_0x7b8e('0x2')]=function(_0x33a45f){return _0x33a45f[_0x7b8e('0x3')]('Interval',attributes,{'tableName':_0x7b8e('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e5068){extensions['rewrite'](_0x33a45f,_0x1e5068);},'afterBulkCreate':function(_0x14e84b,_0x52f4bd,_0x59c04e){_0x59c04e();extensions[_0x7b8e('0x5')](_0x33a45f,_0x14e84b[0x0]);},'afterUpdate':function(_0x2894dd){extensions[_0x7b8e('0x5')](_0x33a45f,_0x2894dd);},'afterDestroy':function(_0x1515f9){extensions[_0x7b8e('0x5')](_0x33a45f,_0x1515f9);}},'instanceMethods':{'ifTime':function(_0x2708e5=undefined,_0x473e2e=new Date()){if(typeof this['interval']===_0x7b8e('0x6')){return iftime(this[_0x7b8e('0x7')],_0x2708e5,_0x473e2e);}else{return this[_0x7b8e('0x8')]()['then'](function(_0x213927){return Promise['all'](_0x213927[_0x7b8e('0x9')](function(_0x2e1811){return _0x2e1811[_0x7b8e('0xa')](_0x2708e5,_0x473e2e);}));})[_0x7b8e('0xb')](function(_0x5c2c94){return _0x5c2c94[_0x7b8e('0xc')](function(_0x30e5dc,_0x8e9509){return _0x30e5dc||_0x8e9509;},![]);});}}}});}; \ No newline at end of file +var _0xd887=['interval','string','getIntervals','then','all','map','reduce','./interval.attributes','../../utils/iftime','exports','tools_intervals','rewrite'];(function(_0x10515b,_0x2adcfa){var _0x1cd1c1=function(_0x584211){while(--_0x584211){_0x10515b['push'](_0x10515b['shift']());}};_0x1cd1c1(++_0x2adcfa);}(_0xd887,0x13f));var _0x7d88=function(_0x3e86e2,_0xbdc053){_0x3e86e2=_0x3e86e2-0x0;var _0x3ff730=_0xd887[_0x3e86e2];return _0x3ff730;};'use strict';var attributes=require(_0x7d88('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x7d88('0x1'))['iftime'];module[_0x7d88('0x2')]=function(_0x5cba4b){return _0x5cba4b['define']('Interval',attributes,{'tableName':_0x7d88('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e58eb){extensions['rewrite'](_0x5cba4b,_0x5e58eb);},'afterBulkCreate':function(_0xf50606,_0x1ebd60,_0x3beda3){_0x3beda3();extensions[_0x7d88('0x4')](_0x5cba4b,_0xf50606[0x0]);},'afterUpdate':function(_0xf22af9){extensions[_0x7d88('0x4')](_0x5cba4b,_0xf22af9);},'afterDestroy':function(_0x4484f2){extensions[_0x7d88('0x4')](_0x5cba4b,_0x4484f2);}},'instanceMethods':{'ifTime':function(_0x5ad310=undefined,_0x17e5e2=new Date()){if(typeof this[_0x7d88('0x5')]===_0x7d88('0x6')){return iftime(this[_0x7d88('0x5')],_0x5ad310,_0x17e5e2);}else{return this[_0x7d88('0x7')]()[_0x7d88('0x8')](function(_0x629acc){return Promise[_0x7d88('0x9')](_0x629acc[_0x7d88('0xa')](function(_0x4d2c8c){return _0x4d2c8c['ifTime'](_0x5ad310,_0x17e5e2);}));})['then'](function(_0x278b53){return _0x278b53[_0x7d88('0xb')](function(_0x207922,_0x2359b1){return _0x207922||_0x2359b1;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 39f2b46..e48e0e4 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 _0x119c=['IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','../../config/logger','GetInterval','Interval','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','error','message','ShowInterval','info','catch','findAll','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervals','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s'];(function(_0x2f4d41,_0x525047){var _0x3b0bb2=function(_0x19960d){while(--_0x19960d){_0x2f4d41['push'](_0x2f4d41['shift']());}};_0x3b0bb2(++_0x525047);}(_0x119c,0xcc));var _0xc119=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x119c[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0xc119('0x0'));var util=require(_0xc119('0x1'));var db=require(_0xc119('0x2'))['db'];var iftime=require(_0xc119('0x3'))['iftime'];var logger=require(_0xc119('0x4'))('rpc');exports[_0xc119('0x5')]=function(_0x204d28){var _0x30ed2c=this;return new Promise(function(_0x2693da,_0x2f2ebe){return db[_0xc119('0x6')]['findAll']({'raw':_0x204d28[_0xc119('0x7')]?_0x204d28[_0xc119('0x7')][_0xc119('0x8')]===undefined?!![]:![]:!![],'where':_0x204d28[_0xc119('0x7')]?_0x204d28[_0xc119('0x7')][_0xc119('0x9')]||null:null,'attributes':_0x204d28[_0xc119('0x7')]?_0x204d28[_0xc119('0x7')][_0xc119('0xa')]||null:null,'limit':_0x204d28['options']?_0x204d28[_0xc119('0x7')][_0xc119('0xb')]||null:null,'include':_0x204d28['options']?_0x204d28[_0xc119('0x7')][_0xc119('0xc')]?_[_0xc119('0xd')](_0x204d28[_0xc119('0x7')][_0xc119('0xc')],function(_0x4a6a40){return{'model':db[_0x4a6a40[_0xc119('0xe')]],'as':_0x4a6a40['as'],'attributes':_0x4a6a40['attributes'],'include':_0x4a6a40[_0xc119('0xc')]?_['map'](_0x4a6a40[_0xc119('0xc')],function(_0x46206b){return{'model':db[_0x46206b[_0xc119('0xe')]],'as':_0x46206b['as'],'attributes':_0x46206b[_0xc119('0xa')],'include':_0x46206b['include']?_['map'](_0x46206b[_0xc119('0xc')],function(_0x131d56){return{'model':db[_0x131d56[_0xc119('0xe')]],'as':_0x131d56['as'],'attributes':_0x131d56['attributes']};}):[]};}):[]};}):[]:[]})[_0xc119('0xf')](function(_0x44d4db){logger['info'](_0xc119('0x5'),_0x204d28);logger[_0xc119('0x10')](_0xc119('0x5'),_0x204d28,JSON[_0xc119('0x11')](_0x44d4db));_0x2693da(_0x44d4db);})['catch'](function(_0x48a79e){logger[_0xc119('0x12')]('GetInterval',_0x48a79e[_0xc119('0x13')],_0x204d28);_0x2f2ebe(_0x30ed2c[_0xc119('0x12')](0x1f4,_0x48a79e['message']));});});};exports[_0xc119('0x14')]=function(_0x3b4654){var _0x10ee6c=this;return new Promise(function(_0xec179,_0x1b7358){return db[_0xc119('0x6')]['find']({'raw':_0x3b4654[_0xc119('0x7')]?_0x3b4654[_0xc119('0x7')][_0xc119('0x8')]===undefined?!![]:![]:!![],'where':_0x3b4654[_0xc119('0x7')]?_0x3b4654[_0xc119('0x7')][_0xc119('0x9')]||null:null,'attributes':_0x3b4654[_0xc119('0x7')]?_0x3b4654[_0xc119('0x7')]['attributes']||null:null,'include':_0x3b4654[_0xc119('0x7')]?_0x3b4654[_0xc119('0x7')][_0xc119('0xc')]?_[_0xc119('0xd')](_0x3b4654[_0xc119('0x7')][_0xc119('0xc')],function(_0x312087){return{'model':db[_0x312087[_0xc119('0xe')]],'as':_0x312087['as'],'attributes':_0x312087['attributes'],'include':_0x312087[_0xc119('0xc')]?_[_0xc119('0xd')](_0x312087[_0xc119('0xc')],function(_0xfaa968){return{'model':db[_0xfaa968['model']],'as':_0xfaa968['as'],'attributes':_0xfaa968['attributes'],'include':_0xfaa968['include']?_[_0xc119('0xd')](_0xfaa968[_0xc119('0xc')],function(_0x3e7a4c){return{'model':db[_0x3e7a4c['model']],'as':_0x3e7a4c['as'],'attributes':_0x3e7a4c['attributes']};}):[]};}):[]};}):[]:[]})[_0xc119('0xf')](function(_0x5b3229){logger[_0xc119('0x15')](_0xc119('0x14'),_0x3b4654);logger[_0xc119('0x10')](_0xc119('0x14'),_0x3b4654,JSON['stringify'](_0x5b3229));_0xec179(_0x5b3229);})[_0xc119('0x16')](function(_0x15a303){logger['error']('ShowInterval',_0x15a303[_0xc119('0x13')],_0x3b4654);_0x1b7358(_0x10ee6c[_0xc119('0x12')](0x1f4,_0x15a303['message']));});});};function checkArrayOfIntervals(_0x690303,_0x8f82c8){var _0xb29ab2=[];return db[_0xc119('0x6')][_0xc119('0x17')]({'where':{'id':_0x690303}})[_0xc119('0xf')](function(_0x34f767){_0xb29ab2=_0x34f767;return Promise[_0xc119('0x18')](_0xb29ab2[_0xc119('0xd')](function(_0x15c645){return _0x15c645[_0xc119('0x19')](_0x8f82c8);}));})['then'](function(_0x46e8bc){var _0x259e0b=_0x46e8bc[_0xc119('0x1a')](function(_0x138052,_0x562582){return _0x138052||_0x562582;},![]);logger['info'](util[_0xc119('0x1b')](_0xc119('0x1c'),_0xb29ab2['map'](function(_0xd28175){return _0xd28175[_0xc119('0x1d')];})[_0xc119('0x1e')](',\x20'),_0xb29ab2['map'](function(_0x446314){return _0x446314['id'];})[_0xc119('0x1e')](',\x20')));return _0x259e0b;});}function checkSingleInterval(_0x1968bf,_0x1c399b){return db[_0xc119('0x6')]['findById'](_0x1968bf)[_0xc119('0xf')](function(_0x36d089){if(_0x36d089){logger[_0xc119('0x15')](util[_0xc119('0x1b')](_0xc119('0x1f'),_0x36d089[_0xc119('0x1d')],_0x36d089['id']));return _0x36d089['ifTime'](_0x1c399b);}});}exports[_0xc119('0x20')]=function(_0x49f03f){var _0x4dc10a=_0x49f03f['intervalIds'];var _0x3121c5=Array['isArray'](_0x49f03f['intervals'])?_0x49f03f['intervals']:typeof _0x49f03f[_0xc119('0x21')]==='string'?[_0x49f03f['intervals']]:[];var _0x184385=_0x49f03f['timezone']||undefined;var _0x274431=![];if(_0x3121c5[_0xc119('0x22')]){logger[_0xc119('0x15')](util[_0xc119('0x1b')](_0xc119('0x23'),_0x3121c5[_0xc119('0x1e')](';\x20')));}if(_0x184385){logger['info'](util['format'](_0xc119('0x24'),_0x184385));}logger[_0xc119('0x10')](_0xc119('0x25'),_0x274431);logger[_0xc119('0x26')](_0xc119('0x20'),_0x49f03f);return Promise[_0xc119('0x27')]()['then'](function(){if(Array['isArray'](_0x4dc10a)){return checkArrayOfIntervals(_0x4dc10a,_0x184385);}else if(_0x4dc10a){return checkSingleInterval(_0x4dc10a,_0x184385);}})[_0xc119('0xf')](function(_0x5a3082){var _0x256de3=_0x3121c5[_0xc119('0x1a')](function(_0x5c9409,_0x14809c){return _0x5c9409||iftime(_0x14809c,_0x184385);},![]);_0x274431=_0x5a3082||_0x256de3;return _0x274431;})[_0xc119('0x16')](function(_0x53adf4){logger[_0xc119('0x12')]('IntervalIftime',_0x49f03f,_0x53adf4);throw this[_0xc119('0x12')](0x1f4,_0x53adf4[_0xc119('0x13')]);});}; \ No newline at end of file +var _0x84ca=['attributes','map','include','model','then','info','stringify','error','message','ShowInterval','find','raw','debug','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','IntervalIftime','resolve','catch','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','where'];(function(_0x34ddee,_0x4ba642){var _0x256bb9=function(_0x497071){while(--_0x497071){_0x34ddee['push'](_0x34ddee['shift']());}};_0x256bb9(++_0x4ba642);}(_0x84ca,0x72));var _0xa84c=function(_0x544ea7,_0x2c3c17){_0x544ea7=_0x544ea7-0x0;var _0x48b96c=_0x84ca[_0x544ea7];return _0x48b96c;};'use strict';var _=require(_0xa84c('0x0'));var util=require(_0xa84c('0x1'));var db=require(_0xa84c('0x2'))['db'];var iftime=require(_0xa84c('0x3'))[_0xa84c('0x4')];var logger=require(_0xa84c('0x5'))(_0xa84c('0x6'));exports[_0xa84c('0x7')]=function(_0x3fefd4){var _0x36516d=this;return new Promise(function(_0x25a844,_0x4c70c2){return db[_0xa84c('0x8')][_0xa84c('0x9')]({'raw':_0x3fefd4[_0xa84c('0xa')]?_0x3fefd4['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fefd4[_0xa84c('0xa')]?_0x3fefd4[_0xa84c('0xa')][_0xa84c('0xb')]||null:null,'attributes':_0x3fefd4['options']?_0x3fefd4['options'][_0xa84c('0xc')]||null:null,'limit':_0x3fefd4[_0xa84c('0xa')]?_0x3fefd4[_0xa84c('0xa')]['limit']||null:null,'include':_0x3fefd4[_0xa84c('0xa')]?_0x3fefd4['options']['include']?_[_0xa84c('0xd')](_0x3fefd4[_0xa84c('0xa')][_0xa84c('0xe')],function(_0x1c9a58){return{'model':db[_0x1c9a58[_0xa84c('0xf')]],'as':_0x1c9a58['as'],'attributes':_0x1c9a58[_0xa84c('0xc')],'include':_0x1c9a58[_0xa84c('0xe')]?_['map'](_0x1c9a58[_0xa84c('0xe')],function(_0x1ee6f7){return{'model':db[_0x1ee6f7[_0xa84c('0xf')]],'as':_0x1ee6f7['as'],'attributes':_0x1ee6f7[_0xa84c('0xc')],'include':_0x1ee6f7['include']?_[_0xa84c('0xd')](_0x1ee6f7[_0xa84c('0xe')],function(_0x2b595d){return{'model':db[_0x2b595d[_0xa84c('0xf')]],'as':_0x2b595d['as'],'attributes':_0x2b595d[_0xa84c('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa84c('0x10')](function(_0x16fb36){logger[_0xa84c('0x11')](_0xa84c('0x7'),_0x3fefd4);logger['debug']('GetInterval',_0x3fefd4,JSON[_0xa84c('0x12')](_0x16fb36));_0x25a844(_0x16fb36);})['catch'](function(_0xac1716){logger[_0xa84c('0x13')]('GetInterval',_0xac1716[_0xa84c('0x14')],_0x3fefd4);_0x4c70c2(_0x36516d[_0xa84c('0x13')](0x1f4,_0xac1716[_0xa84c('0x14')]));});});};exports[_0xa84c('0x15')]=function(_0x2e1f37){var _0x609d2e=this;return new Promise(function(_0x240b7c,_0x170d95){return db[_0xa84c('0x8')][_0xa84c('0x16')]({'raw':_0x2e1f37[_0xa84c('0xa')]?_0x2e1f37[_0xa84c('0xa')][_0xa84c('0x17')]===undefined?!![]:![]:!![],'where':_0x2e1f37[_0xa84c('0xa')]?_0x2e1f37['options'][_0xa84c('0xb')]||null:null,'attributes':_0x2e1f37[_0xa84c('0xa')]?_0x2e1f37[_0xa84c('0xa')][_0xa84c('0xc')]||null:null,'include':_0x2e1f37[_0xa84c('0xa')]?_0x2e1f37['options'][_0xa84c('0xe')]?_[_0xa84c('0xd')](_0x2e1f37[_0xa84c('0xa')][_0xa84c('0xe')],function(_0x6a7f72){return{'model':db[_0x6a7f72['model']],'as':_0x6a7f72['as'],'attributes':_0x6a7f72['attributes'],'include':_0x6a7f72['include']?_[_0xa84c('0xd')](_0x6a7f72[_0xa84c('0xe')],function(_0x54dadf){return{'model':db[_0x54dadf[_0xa84c('0xf')]],'as':_0x54dadf['as'],'attributes':_0x54dadf[_0xa84c('0xc')],'include':_0x54dadf[_0xa84c('0xe')]?_[_0xa84c('0xd')](_0x54dadf['include'],function(_0x30fd0d){return{'model':db[_0x30fd0d[_0xa84c('0xf')]],'as':_0x30fd0d['as'],'attributes':_0x30fd0d[_0xa84c('0xc')]};}):[]};}):[]};}):[]:[]})[_0xa84c('0x10')](function(_0x277b4a){logger[_0xa84c('0x11')]('ShowInterval',_0x2e1f37);logger[_0xa84c('0x18')](_0xa84c('0x15'),_0x2e1f37,JSON[_0xa84c('0x12')](_0x277b4a));_0x240b7c(_0x277b4a);})['catch'](function(_0x283409){logger[_0xa84c('0x13')](_0xa84c('0x15'),_0x283409[_0xa84c('0x14')],_0x2e1f37);_0x170d95(_0x609d2e['error'](0x1f4,_0x283409[_0xa84c('0x14')]));});});};function checkArrayOfIntervals(_0x2cded3,_0x2247e9){var _0x266f97=[];return db['Interval'][_0xa84c('0x9')]({'where':{'id':_0x2cded3}})[_0xa84c('0x10')](function(_0x4a5d76){_0x266f97=_0x4a5d76;return Promise['all'](_0x266f97[_0xa84c('0xd')](function(_0x2f4229){return _0x2f4229[_0xa84c('0x19')](_0x2247e9);}));})[_0xa84c('0x10')](function(_0x7e390e){var _0x2828f7=_0x7e390e[_0xa84c('0x1a')](function(_0x3bb812,_0x1e5042){return _0x3bb812||_0x1e5042;},![]);logger[_0xa84c('0x11')](util[_0xa84c('0x1b')](_0xa84c('0x1c'),_0x266f97[_0xa84c('0xd')](function(_0x9e4458){return _0x9e4458[_0xa84c('0x1d')];})[_0xa84c('0x1e')](',\x20'),_0x266f97[_0xa84c('0xd')](function(_0x125405){return _0x125405['id'];})['join'](',\x20')));return _0x2828f7;});}function checkSingleInterval(_0x28360e,_0x431784){return db[_0xa84c('0x8')]['findById'](_0x28360e)[_0xa84c('0x10')](function(_0x3f1c88){if(_0x3f1c88){logger['info'](util[_0xa84c('0x1b')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x3f1c88[_0xa84c('0x1d')],_0x3f1c88['id']));return _0x3f1c88['ifTime'](_0x431784);}});}exports['IntervalIftime']=function(_0x2428a5){var _0x2b3140=_0x2428a5[_0xa84c('0x1f')];var _0x352227=Array[_0xa84c('0x20')](_0x2428a5['intervals'])?_0x2428a5[_0xa84c('0x21')]:typeof _0x2428a5['intervals']===_0xa84c('0x22')?[_0x2428a5[_0xa84c('0x21')]]:[];var _0x40529e=_0x2428a5[_0xa84c('0x23')]||undefined;var _0x493e60=![];if(_0x352227['length']){logger[_0xa84c('0x11')](util[_0xa84c('0x1b')](_0xa84c('0x24'),_0x352227['join'](';\x20')));}if(_0x40529e){logger[_0xa84c('0x11')](util[_0xa84c('0x1b')](_0xa84c('0x25'),_0x40529e));}logger[_0xa84c('0x18')]('Iftime',_0x493e60);logger[_0xa84c('0x26')](_0xa84c('0x27'),_0x2428a5);return Promise[_0xa84c('0x28')]()[_0xa84c('0x10')](function(){if(Array[_0xa84c('0x20')](_0x2b3140)){return checkArrayOfIntervals(_0x2b3140,_0x40529e);}else if(_0x2b3140){return checkSingleInterval(_0x2b3140,_0x40529e);}})[_0xa84c('0x10')](function(_0xc71edd){var _0x3653b2=_0x352227[_0xa84c('0x1a')](function(_0x2c39b0,_0x50c5ef){return _0x2c39b0||iftime(_0x50c5ef,_0x40529e);},![]);_0x493e60=_0xc71edd||_0x3653b2;return _0x493e60;})[_0xa84c('0x29')](function(_0xf385f2){logger[_0xa84c('0x13')](_0xa84c('0x27'),_0x2428a5,_0xf385f2);throw this[_0xa84c('0x13')](0x1f4,_0xf385f2[_0xa84c('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 908a536..bb9f96f 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x34dab1,_0x2214f8){var _0x4c91a2=function(_0x265983){while(--_0x265983){_0x34dab1['push'](_0x34dab1['shift']());}};_0x4c91a2(++_0x2214f8);}(_0x2ef3,0xba));var _0x32ef=function(_0x495a4b,_0x286098){_0x495a4b=_0x495a4b-0x0;var _0x385494=_0x2ef3[_0x495a4b];return _0x385494;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index b7a490e..8eb3d9e 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 _0x5976=['POST','toString','base64','request','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','connection','remoteAddress','socket','body','../../config/logger','api','support','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue'];(function(_0x1fd4f0,_0x5bac6d){var _0x1cd3d4=function(_0x4ca2e0){while(--_0x4ca2e0){_0x1fd4f0['push'](_0x1fd4f0['shift']());}};_0x1cd3d4(++_0x5bac6d);}(_0x5976,0xfd));var _0x6597=function(_0x3a5461,_0x3aeaf5){_0x3a5461=_0x3a5461-0x0;var _0x484909=_0x5976[_0x3a5461];return _0x484909;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x6597('0x0'))(_0x6597('0x1'));var USERNAME=_0x6597('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x27af4c,_0x80b57d){var _0x3e89dd={'fields':{'project':{'key':_0x27af4c['key']||'MOTGUI'},'summary':(_0x27af4c[_0x6597('0x3')]||_0x6597('0x4'))+_0x6597('0x5')+_0x27af4c['ip'],'description':_0x27af4c[_0x6597('0x6')]||JSON[_0x6597('0x7')](_0x27af4c),'issuetype':{'name':_0x27af4c['issuetype']||_0x6597('0x8')}}};_0x3e89dd[_0x6597('0x9')][_0x6597('0xa')]=_0x27af4c['email'];_0x3e89dd[_0x6597('0x9')][_0x6597('0xb')]=_0x27af4c[_0x6597('0xc')];_0x3e89dd[_0x6597('0x9')][_0x6597('0xd')]=_0x27af4c[_0x6597('0xe')];_0x3e89dd[_0x6597('0x9')]['customfield_11503']=_0x27af4c['name'];_0x3e89dd[_0x6597('0x9')][_0x6597('0xf')]=_0x27af4c[_0x6597('0x10')];_0x3e89dd[_0x6597('0x9')][_0x6597('0x11')]=_0x27af4c['ip'];var _0x430fdc={'host':_0x6597('0x12'),'port':0x1bb,'path':_0x6597('0x13'),'method':_0x6597('0x14'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6597('0x15')](_0x6597('0x16'))}};var _0x2c02bc=JSON[_0x6597('0x7')](_0x3e89dd);var _0xa5e599=https[_0x6597('0x17')](_0x430fdc,function(_0x1abf16){_0x1abf16['setEncoding'](_0x6597('0x18'));var _0xf618c4='';_0x1abf16['on']('data',function(_0x2c078f){_0xf618c4+=_0x2c078f;});_0x1abf16['on'](_0x6597('0x19'),function(){if(_0x80b57d){return _0x80b57d[_0x6597('0x1a')](_0x1abf16[_0x6597('0x1b')])[_0x6597('0x1c')](JSON[_0x6597('0x1d')](_0xf618c4));}});});_0xa5e599['on'](_0x6597('0x1e'),function(_0x1518f9){if(_0x80b57d){return _0x80b57d['status'](0x1f4)['json']({'errors':[{'message':_0x6597('0x1f'),'type':_0x6597('0x20')}]});}});_0xa5e599[_0x6597('0x21')](_0x2c02bc);_0xa5e599[_0x6597('0x19')]();}exports[_0x6597('0x22')]=openIssue;exports['send']=function(_0x4c43b7,_0xe643ae){_0x4c43b7['body']['ip']=_0x4c43b7['headers']['x-forwarded-for']||_0x4c43b7[_0x6597('0x23')][_0x6597('0x24')]||_0x4c43b7['socket'][_0x6597('0x24')]||_0x4c43b7[_0x6597('0x23')][_0x6597('0x25')][_0x6597('0x24')];return openIssue(_0x4c43b7[_0x6597('0x26')],_0xe643ae);}; \ No newline at end of file +var _0xae73=['newToken','customfield_11503','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','parse','error','api.jira','write','openIssue','body','headers','x-forwarded-for','remoteAddress','connection','socket','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','fields','customfield_11501','customfield_11502'];(function(_0x306ee5,_0x2866b9){var _0xb53cce=function(_0x544ec6){while(--_0x544ec6){_0x306ee5['push'](_0x306ee5['shift']());}};_0xb53cce(++_0x2866b9);}(_0xae73,0x1c4));var _0x3ae7=function(_0x304e0e,_0x2654a3){_0x304e0e=_0x304e0e-0x0;var _0x4449c8=_0xae73[_0x304e0e];return _0x4449c8;};'use strict';var BPromise=require(_0x3ae7('0x0'));var https=require(_0x3ae7('0x1'));var logger=require('../../config/logger')(_0x3ae7('0x2'));var USERNAME=_0x3ae7('0x3');var PASSWORD=_0x3ae7('0x4');function openIssue(_0x535896,_0x428516){var _0xb266ca={'fields':{'project':{'key':_0x535896[_0x3ae7('0x5')]||_0x3ae7('0x6')},'summary':(_0x535896['summary']||_0x3ae7('0x7'))+_0x3ae7('0x8')+_0x535896['ip'],'description':_0x535896[_0x3ae7('0x9')]||JSON[_0x3ae7('0xa')](_0x535896),'issuetype':{'name':_0x535896[_0x3ae7('0xb')]||_0x3ae7('0xc')}}};_0xb266ca['fields'][_0x3ae7('0xd')]=_0x535896[_0x3ae7('0xe')];_0xb266ca[_0x3ae7('0xf')][_0x3ae7('0x10')]=_0x535896['oldToken'];_0xb266ca[_0x3ae7('0xf')][_0x3ae7('0x11')]=_0x535896[_0x3ae7('0x12')];_0xb266ca['fields'][_0x3ae7('0x13')]=_0x535896['name'];_0xb266ca[_0x3ae7('0xf')][_0x3ae7('0x14')]=_0x535896[_0x3ae7('0x15')];_0xb266ca['fields'][_0x3ae7('0x16')]=_0x535896['ip'];var _0x47a5b4={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3ae7('0x17'),'method':_0x3ae7('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x3ae7('0x19'),'Authorization':_0x3ae7('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x3ae7('0x1b')](_0x3ae7('0x1c'))}};var _0x50a4fd=JSON[_0x3ae7('0xa')](_0xb266ca);var _0x396556=https[_0x3ae7('0x1d')](_0x47a5b4,function(_0x3b5589){_0x3b5589[_0x3ae7('0x1e')](_0x3ae7('0x1f'));var _0x3bd82a='';_0x3b5589['on'](_0x3ae7('0x20'),function(_0x4a9149){_0x3bd82a+=_0x4a9149;});_0x3b5589['on']('end',function(){if(_0x428516){return _0x428516[_0x3ae7('0x21')](_0x3b5589[_0x3ae7('0x22')])[_0x3ae7('0x23')](JSON[_0x3ae7('0x24')](_0x3bd82a));}});});_0x396556['on'](_0x3ae7('0x25'),function(_0x318ab6){if(_0x428516){return _0x428516[_0x3ae7('0x21')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x3ae7('0x26')}]});}});_0x396556[_0x3ae7('0x27')](_0x50a4fd);_0x396556['end']();}exports[_0x3ae7('0x28')]=openIssue;exports['send']=function(_0x517d45,_0x1c0011){_0x517d45[_0x3ae7('0x29')]['ip']=_0x517d45[_0x3ae7('0x2a')][_0x3ae7('0x2b')]||_0x517d45['connection'][_0x3ae7('0x2c')]||_0x517d45['socket']['remoteAddress']||_0x517d45[_0x3ae7('0x2d')][_0x3ae7('0x2e')][_0x3ae7('0x2c')];return openIssue(_0x517d45[_0x3ae7('0x29')],_0x1c0011);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9653aea..fda6432 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 _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x503940,_0x88f90){var _0x5a10c2=function(_0x12a6bb){while(--_0x12a6bb){_0x503940['push'](_0x503940['shift']());}};_0x5a10c2(++_0x88f90);}(_0x4522,0x1a0));var _0x2452=function(_0x2875a5,_0x2a83d1){_0x2875a5=_0x2875a5-0x0;var _0x5cb141=_0x4522[_0x2875a5];return _0x5cb141;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2452('0xf')]);router['put']('/:id',auth[_0x2452('0x9')](),controller[_0x2452('0x10')]);router[_0x2452('0x11')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x12')]);module[_0x2452('0x13')]=router; \ No newline at end of file +var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x49d940,_0x516f31){var _0x3201be=function(_0x311c8c){while(--_0x311c8c){_0x49d940['push'](_0x49d940['shift']());}};_0x3201be(++_0x516f31);}(_0x91a7,0xe7));var _0x791a=function(_0x2d9fdf,_0xa94c69){_0x2d9fdf=_0x2d9fdf-0x0;var _0x3e6e38=_0x91a7[_0x2d9fdf];return _0x3e6e38;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index e435e1d..309e17d 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x54a206,_0x2281b5){_0x54a206=_0x54a206-0x0;var _0x44a310=_0x7a54[_0x54a206];return _0x44a310;};'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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x2b786a,_0x30061b){_0x2b786a=_0x2b786a-0x0;var _0x19064b=_0x7a54[_0x2b786a];return _0x19064b;};'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 5b99280..58e88ce 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 _0x6f47=['undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','JscriptyAnswerReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x289d01,_0x3388dc){var _0x465dff=function(_0x1b7b32){while(--_0x1b7b32){_0x289d01['push'](_0x289d01['shift']());}};_0x465dff(++_0x3388dc);}(_0x6f47,0xc7));var _0x76f4=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6f47[_0x173441];return _0x2423a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76f4('0x0'));var zipdir=require(_0x76f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76f4('0x2'));var moment=require('moment');var BPromise=require(_0x76f4('0x3'));var Mustache=require('mustache');var util=require(_0x76f4('0x4'));var path=require(_0x76f4('0x5'));var sox=require(_0x76f4('0x6'));var csv=require(_0x76f4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76f4('0x8'));var _=require(_0x76f4('0x9'));var squel=require(_0x76f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76f4('0xb'));var deskjs=require(_0x76f4('0xc'));var toCsv=require(_0x76f4('0x7'));var querystring=require(_0x76f4('0xd'));var Papa=require(_0x76f4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f4('0xf'));var as=require(_0x76f4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76f4('0x11'));var utils=require(_0x76f4('0x12'));var config=require(_0x76f4('0x13'));var licenseUtil=require(_0x76f4('0x14'));var db=require(_0x76f4('0x15'))['db'];function respondWithStatusCode(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xcc;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0x16')](_0xf7e347);}return _0xafd21e['status'](_0xf7e347)[_0x76f4('0x17')]();};}function respondWithResult(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0xc8;return function(_0x4b6021){if(_0x4b6021){return _0x30dabf['status'](_0x5da1ff)[_0x76f4('0x18')](_0x4b6021);}};}function respondWithFilteredResult(_0x3dd240,_0x979946){return function(_0x40252d){if(_0x40252d){var _0x3d8f5a=typeof _0x979946[_0x76f4('0x19')]===_0x76f4('0x1a')&&typeof _0x979946[_0x76f4('0x1b')]===_0x76f4('0x1a');var _0xb159a9=_0x40252d[_0x76f4('0x1c')];var _0x2d4bd1=_0x3d8f5a?0x0:_0x979946[_0x76f4('0x19')];var _0x38450e=_0x3d8f5a?_0x40252d[_0x76f4('0x1c')]:_0x979946[_0x76f4('0x19')]+_0x979946[_0x76f4('0x1b')];var _0x3e809f;if(_0x38450e>=_0xb159a9){_0x38450e=_0xb159a9;_0x3e809f=0xc8;}else{_0x3e809f=0xce;}_0x3dd240[_0x76f4('0x1d')](_0x3e809f);return _0x3dd240[_0x76f4('0x1e')](_0x76f4('0x1f'),_0x2d4bd1+'-'+_0x38450e+'/'+_0xb159a9)[_0x76f4('0x18')](_0x40252d);}return null;};}function patchUpdates(_0x5bf3d5){return function(_0x262937){try{jsonpatch['apply'](_0x262937,_0x5bf3d5,!![]);}catch(_0x13f3b1){return BPromise[_0x76f4('0x20')](_0x13f3b1);}return _0x262937[_0x76f4('0x21')]();};}function saveUpdates(_0x517c00,_0x567f2a){return function(_0x52da65){if(_0x52da65){return _0x52da65[_0x76f4('0x22')](_0x517c00)[_0x76f4('0x23')](function(_0x14bfe5){return _0x14bfe5;});}return null;};}function removeEntity(_0x2b6d51,_0x42ef70){return function(_0x4786c9){if(_0x4786c9){return _0x4786c9[_0x76f4('0x24')]()['then'](function(){_0x2b6d51['status'](0xcc)[_0x76f4('0x17')]();});}};}function handleEntityNotFound(_0x497913,_0x288365){return function(_0x5355bd){if(!_0x5355bd){_0x497913['sendStatus'](0x194);}return _0x5355bd;};}function handleError(_0x4f6087,_0x470242){_0x470242=_0x470242||0x1f4;return function(_0x38300d){logger[_0x76f4('0x25')](_0x38300d[_0x76f4('0x26')]);if(_0x38300d[_0x76f4('0x27')]){delete _0x38300d[_0x76f4('0x27')];}_0x4f6087['status'](_0x470242)[_0x76f4('0x28')](_0x38300d);};}exports['index']=function(_0x5346be,_0x5b3f07){var _0x10ddb4={},_0x30f02e={},_0x41dea4={'count':0x0,'rows':[]};var _0x1dea0e=_['map'](db[_0x76f4('0x29')]['rawAttributes'],function(_0x259c26){return{'name':_0x259c26[_0x76f4('0x2a')],'type':_0x259c26[_0x76f4('0x2b')][_0x76f4('0x2c')]};});_0x30f02e[_0x76f4('0x2d')]=_['map'](_0x1dea0e,'name');_0x30f02e[_0x76f4('0x2e')]=_[_0x76f4('0x2f')](_0x5346be[_0x76f4('0x2e')]);_0x30f02e[_0x76f4('0x30')]=_[_0x76f4('0x31')](_0x30f02e[_0x76f4('0x2d')],_0x30f02e[_0x76f4('0x2e')]);_0x10ddb4[_0x76f4('0x32')]=_[_0x76f4('0x31')](_0x30f02e[_0x76f4('0x2d')],qs[_0x76f4('0x33')](_0x5346be[_0x76f4('0x2e')]['fields']));_0x10ddb4['attributes']=_0x10ddb4['attributes']['length']?_0x10ddb4[_0x76f4('0x32')]:_0x30f02e[_0x76f4('0x2d')];if(!_0x5346be[_0x76f4('0x2e')][_0x76f4('0x34')](_0x76f4('0x35'))){_0x10ddb4['limit']=qs[_0x76f4('0x1b')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x1b')]);_0x10ddb4[_0x76f4('0x19')]=qs[_0x76f4('0x19')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x19')]);}_0x10ddb4[_0x76f4('0x36')]=qs[_0x76f4('0x37')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x37')]);_0x10ddb4[_0x76f4('0x38')]=qs[_0x76f4('0x30')](_[_0x76f4('0x39')](_0x5346be[_0x76f4('0x2e')],_0x30f02e[_0x76f4('0x30')]),_0x1dea0e);if(_0x5346be[_0x76f4('0x2e')][_0x76f4('0x3a')]){_0x10ddb4['where']=_[_0x76f4('0x3b')](_0x10ddb4[_0x76f4('0x38')],{'$or':_[_0x76f4('0x3c')](_0x1dea0e,function(_0x589637){if(_0x589637['type']!==_0x76f4('0x3d')){var _0x487926={};_0x487926[_0x589637[_0x76f4('0x27')]]={'$like':'%'+_0x5346be['query'][_0x76f4('0x3a')]+'%'};return _0x487926;}})});}_0x10ddb4=_[_0x76f4('0x3b')]({},_0x10ddb4,_0x5346be[_0x76f4('0x3e')]);var _0x378675={'where':_0x10ddb4[_0x76f4('0x38')]};return db[_0x76f4('0x29')][_0x76f4('0x1c')](_0x378675)[_0x76f4('0x23')](function(_0x16779e){_0x41dea4[_0x76f4('0x1c')]=_0x16779e;if(_0x5346be['query']['includeAll']){_0x10ddb4[_0x76f4('0x3f')]=[{'all':!![]}];}return db[_0x76f4('0x29')][_0x76f4('0x40')](_0x10ddb4);})[_0x76f4('0x23')](function(_0x2b7dc8){_0x41dea4[_0x76f4('0x41')]=_0x2b7dc8;return _0x41dea4;})[_0x76f4('0x23')](respondWithFilteredResult(_0x5b3f07,_0x10ddb4))[_0x76f4('0x42')](handleError(_0x5b3f07,null));};exports[_0x76f4('0x43')]=function(_0x5b667b,_0xbc3d7e){var _0xe744af={'raw':!![],'where':{'id':_0x5b667b['params']['id']}},_0x4f0d1a={};_0x4f0d1a[_0x76f4('0x2d')]=_[_0x76f4('0x2f')](db[_0x76f4('0x29')][_0x76f4('0x44')]);_0x4f0d1a[_0x76f4('0x2e')]=_['keys'](_0x5b667b[_0x76f4('0x2e')]);_0x4f0d1a[_0x76f4('0x30')]=_[_0x76f4('0x31')](_0x4f0d1a[_0x76f4('0x2d')],_0x4f0d1a[_0x76f4('0x2e')]);_0xe744af[_0x76f4('0x32')]=_['intersection'](_0x4f0d1a[_0x76f4('0x2d')],qs[_0x76f4('0x33')](_0x5b667b[_0x76f4('0x2e')]['fields']));_0xe744af['attributes']=_0xe744af[_0x76f4('0x32')][_0x76f4('0x45')]?_0xe744af[_0x76f4('0x32')]:_0x4f0d1a[_0x76f4('0x2d')];if(_0x5b667b[_0x76f4('0x2e')]['includeAll']){_0xe744af['include']=[{'all':!![]}];}_0xe744af=_[_0x76f4('0x3b')]({},_0xe744af,_0x5b667b['options']);return db[_0x76f4('0x29')][_0x76f4('0x46')](_0xe744af)['then'](handleEntityNotFound(_0xbc3d7e,null))['then'](respondWithResult(_0xbc3d7e,null))[_0x76f4('0x42')](handleError(_0xbc3d7e,null));};exports[_0x76f4('0x47')]=function(_0x3f35ce,_0x217d3a){return db['JscriptyAnswerReport'][_0x76f4('0x47')](_0x3f35ce[_0x76f4('0x48')],{})[_0x76f4('0x23')](respondWithResult(_0x217d3a,0xc9))['catch'](handleError(_0x217d3a,null));};exports[_0x76f4('0x22')]=function(_0x6bbcf2,_0x535eca){if(_0x6bbcf2['body']['id']){delete _0x6bbcf2[_0x76f4('0x48')]['id'];}return db[_0x76f4('0x29')][_0x76f4('0x46')]({'where':{'id':_0x6bbcf2[_0x76f4('0x49')]['id']}})[_0x76f4('0x23')](handleEntityNotFound(_0x535eca,null))['then'](saveUpdates(_0x6bbcf2[_0x76f4('0x48')],null))['then'](respondWithResult(_0x535eca,null))[_0x76f4('0x42')](handleError(_0x535eca,null));};exports[_0x76f4('0x24')]=function(_0x270baf,_0x5e9a45){return db[_0x76f4('0x29')][_0x76f4('0x46')]({'where':{'id':_0x270baf['params']['id']}})[_0x76f4('0x23')](handleEntityNotFound(_0x5e9a45,null))[_0x76f4('0x23')](removeEntity(_0x5e9a45,null))[_0x76f4('0x42')](handleError(_0x5e9a45,null));};exports[_0x76f4('0x4a')]=function(_0x40ff20,_0x479c4b){return db[_0x76f4('0x29')]['describe']()[_0x76f4('0x23')](respondWithResult(_0x479c4b,null))[_0x76f4('0x42')](handleError(_0x479c4b,null));}; \ No newline at end of file +var _0x10af=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','then','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','nolimit','order','sort','pick','filters','filter','where','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x482816,_0x35e716){var _0xb89169=function(_0x379c49){while(--_0x379c49){_0x482816['push'](_0x482816['shift']());}};_0xb89169(++_0x35e716);}(_0x10af,0xfc));var _0xf10a=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x10af[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require(_0xf10a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf10a('0x1'));var jsonpatch=require(_0xf10a('0x2'));var rp=require(_0xf10a('0x3'));var moment=require(_0xf10a('0x4'));var BPromise=require(_0xf10a('0x5'));var Mustache=require(_0xf10a('0x6'));var util=require(_0xf10a('0x7'));var path=require(_0xf10a('0x8'));var sox=require('sox');var csv=require(_0xf10a('0x9'));var ejs=require(_0xf10a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf10a('0xb'));var crypto=require(_0xf10a('0xc'));var jsforce=require(_0xf10a('0xd'));var deskjs=require(_0xf10a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf10a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf10a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf10a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf10a('0x12'))('api');var utils=require(_0xf10a('0x13'));var config=require(_0xf10a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf10a('0x15'))['db'];function respondWithStatusCode(_0x24632c,_0x4191bb){_0x4191bb=_0x4191bb||0xcc;return function(_0x22ffab){if(_0x22ffab){return _0x24632c[_0xf10a('0x16')](_0x4191bb);}return _0x24632c[_0xf10a('0x17')](_0x4191bb)[_0xf10a('0x18')]();};}function respondWithResult(_0x305767,_0xe03766){_0xe03766=_0xe03766||0xc8;return function(_0x50ba60){if(_0x50ba60){return _0x305767[_0xf10a('0x17')](_0xe03766)['json'](_0x50ba60);}};}function respondWithFilteredResult(_0x5b72ad,_0x26f4a5){return function(_0x3117cd){if(_0x3117cd){var _0x484c3a=typeof _0x26f4a5[_0xf10a('0x19')]===_0xf10a('0x1a')&&typeof _0x26f4a5['limit']===_0xf10a('0x1a');var _0x10ab5=_0x3117cd[_0xf10a('0x1b')];var _0x1deaa1=_0x484c3a?0x0:_0x26f4a5[_0xf10a('0x19')];var _0x20a858=_0x484c3a?_0x3117cd[_0xf10a('0x1b')]:_0x26f4a5[_0xf10a('0x19')]+_0x26f4a5[_0xf10a('0x1c')];var _0x463e75;if(_0x20a858>=_0x10ab5){_0x20a858=_0x10ab5;_0x463e75=0xc8;}else{_0x463e75=0xce;}_0x5b72ad[_0xf10a('0x17')](_0x463e75);return _0x5b72ad['set'](_0xf10a('0x1d'),_0x1deaa1+'-'+_0x20a858+'/'+_0x10ab5)[_0xf10a('0x1e')](_0x3117cd);}return null;};}function patchUpdates(_0xa1614e){return function(_0x4db4b0){try{jsonpatch[_0xf10a('0x1f')](_0x4db4b0,_0xa1614e,!![]);}catch(_0x5c55b0){return BPromise['reject'](_0x5c55b0);}return _0x4db4b0['save']();};}function saveUpdates(_0x135fc0,_0x3b61d8){return function(_0x2dc858){if(_0x2dc858){return _0x2dc858['update'](_0x135fc0)[_0xf10a('0x20')](function(_0x429a75){return _0x429a75;});}return null;};}function removeEntity(_0x569bb5,_0xc760e8){return function(_0x439e48){if(_0x439e48){return _0x439e48['destroy']()[_0xf10a('0x20')](function(){_0x569bb5[_0xf10a('0x17')](0xcc)[_0xf10a('0x18')]();});}};}function handleEntityNotFound(_0x4defdf,_0x33866c){return function(_0x4834b5){if(!_0x4834b5){_0x4defdf[_0xf10a('0x16')](0x194);}return _0x4834b5;};}function handleError(_0x1ef7f3,_0x1550b4){_0x1550b4=_0x1550b4||0x1f4;return function(_0x547bb7){logger['error'](_0x547bb7['stack']);if(_0x547bb7[_0xf10a('0x21')]){delete _0x547bb7['name'];}_0x1ef7f3['status'](_0x1550b4)[_0xf10a('0x22')](_0x547bb7);};}exports[_0xf10a('0x23')]=function(_0x3cf00d,_0x47d800){var _0x39b99b={},_0x265a74={},_0x1ad807={'count':0x0,'rows':[]};var _0x457a53=_[_0xf10a('0x24')](db[_0xf10a('0x25')][_0xf10a('0x26')],function(_0x5cd734){return{'name':_0x5cd734[_0xf10a('0x27')],'type':_0x5cd734[_0xf10a('0x28')]['key']};});_0x265a74[_0xf10a('0x29')]=_[_0xf10a('0x24')](_0x457a53,_0xf10a('0x21'));_0x265a74[_0xf10a('0x2a')]=_['keys'](_0x3cf00d['query']);_0x265a74['filters']=_[_0xf10a('0x2b')](_0x265a74[_0xf10a('0x29')],_0x265a74[_0xf10a('0x2a')]);_0x39b99b[_0xf10a('0x2c')]=_[_0xf10a('0x2b')](_0x265a74[_0xf10a('0x29')],qs[_0xf10a('0x2d')](_0x3cf00d['query'][_0xf10a('0x2d')]));_0x39b99b['attributes']=_0x39b99b[_0xf10a('0x2c')]['length']?_0x39b99b[_0xf10a('0x2c')]:_0x265a74[_0xf10a('0x29')];if(!_0x3cf00d[_0xf10a('0x2a')]['hasOwnProperty'](_0xf10a('0x2e'))){_0x39b99b['limit']=qs['limit'](_0x3cf00d[_0xf10a('0x2a')]['limit']);_0x39b99b[_0xf10a('0x19')]=qs['offset'](_0x3cf00d[_0xf10a('0x2a')][_0xf10a('0x19')]);}_0x39b99b[_0xf10a('0x2f')]=qs[_0xf10a('0x30')](_0x3cf00d[_0xf10a('0x2a')][_0xf10a('0x30')]);_0x39b99b['where']=qs['filters'](_[_0xf10a('0x31')](_0x3cf00d[_0xf10a('0x2a')],_0x265a74[_0xf10a('0x32')]),_0x457a53);if(_0x3cf00d[_0xf10a('0x2a')][_0xf10a('0x33')]){_0x39b99b[_0xf10a('0x34')]=_['merge'](_0x39b99b[_0xf10a('0x34')],{'$or':_[_0xf10a('0x24')](_0x457a53,function(_0x2ad05b){if(_0x2ad05b[_0xf10a('0x28')]!=='VIRTUAL'){var _0x31cb95={};_0x31cb95[_0x2ad05b[_0xf10a('0x21')]]={'$like':'%'+_0x3cf00d[_0xf10a('0x2a')][_0xf10a('0x33')]+'%'};return _0x31cb95;}})});}_0x39b99b=_['merge']({},_0x39b99b,_0x3cf00d[_0xf10a('0x35')]);var _0x5a9717={'where':_0x39b99b['where']};return db[_0xf10a('0x25')][_0xf10a('0x1b')](_0x5a9717)[_0xf10a('0x20')](function(_0x599c94){_0x1ad807[_0xf10a('0x1b')]=_0x599c94;if(_0x3cf00d[_0xf10a('0x2a')]['includeAll']){_0x39b99b[_0xf10a('0x36')]=[{'all':!![]}];}return db[_0xf10a('0x25')][_0xf10a('0x37')](_0x39b99b);})[_0xf10a('0x20')](function(_0x1bd2a7){_0x1ad807[_0xf10a('0x38')]=_0x1bd2a7;return _0x1ad807;})['then'](respondWithFilteredResult(_0x47d800,_0x39b99b))[_0xf10a('0x39')](handleError(_0x47d800,null));};exports[_0xf10a('0x3a')]=function(_0x18dc00,_0x5ca33c){var _0x2782c1={'raw':!![],'where':{'id':_0x18dc00['params']['id']}},_0x5ee6b8={};_0x5ee6b8[_0xf10a('0x29')]=_[_0xf10a('0x3b')](db[_0xf10a('0x25')][_0xf10a('0x26')]);_0x5ee6b8[_0xf10a('0x2a')]=_[_0xf10a('0x3b')](_0x18dc00[_0xf10a('0x2a')]);_0x5ee6b8[_0xf10a('0x32')]=_[_0xf10a('0x2b')](_0x5ee6b8['model'],_0x5ee6b8['query']);_0x2782c1[_0xf10a('0x2c')]=_['intersection'](_0x5ee6b8[_0xf10a('0x29')],qs[_0xf10a('0x2d')](_0x18dc00[_0xf10a('0x2a')][_0xf10a('0x2d')]));_0x2782c1[_0xf10a('0x2c')]=_0x2782c1['attributes'][_0xf10a('0x3c')]?_0x2782c1[_0xf10a('0x2c')]:_0x5ee6b8[_0xf10a('0x29')];if(_0x18dc00['query'][_0xf10a('0x3d')]){_0x2782c1[_0xf10a('0x36')]=[{'all':!![]}];}_0x2782c1=_['merge']({},_0x2782c1,_0x18dc00[_0xf10a('0x35')]);return db[_0xf10a('0x25')][_0xf10a('0x3e')](_0x2782c1)[_0xf10a('0x20')](handleEntityNotFound(_0x5ca33c,null))[_0xf10a('0x20')](respondWithResult(_0x5ca33c,null))['catch'](handleError(_0x5ca33c,null));};exports[_0xf10a('0x3f')]=function(_0x3803ce,_0x26e6ca){return db['JscriptyAnswerReport'][_0xf10a('0x3f')](_0x3803ce[_0xf10a('0x40')],{})[_0xf10a('0x20')](respondWithResult(_0x26e6ca,0xc9))[_0xf10a('0x39')](handleError(_0x26e6ca,null));};exports['update']=function(_0xe56343,_0x4ad1ac){if(_0xe56343['body']['id']){delete _0xe56343[_0xf10a('0x40')]['id'];}return db['JscriptyAnswerReport'][_0xf10a('0x3e')]({'where':{'id':_0xe56343[_0xf10a('0x41')]['id']}})[_0xf10a('0x20')](handleEntityNotFound(_0x4ad1ac,null))[_0xf10a('0x20')](saveUpdates(_0xe56343[_0xf10a('0x40')],null))['then'](respondWithResult(_0x4ad1ac,null))['catch'](handleError(_0x4ad1ac,null));};exports[_0xf10a('0x42')]=function(_0xa6f668,_0x56c6ce){return db['JscriptyAnswerReport'][_0xf10a('0x3e')]({'where':{'id':_0xa6f668[_0xf10a('0x41')]['id']}})[_0xf10a('0x20')](handleEntityNotFound(_0x56c6ce,null))['then'](removeEntity(_0x56c6ce,null))['catch'](handleError(_0x56c6ce,null));};exports[_0xf10a('0x43')]=function(_0x3d0dfb,_0x3cf73f){return db[_0xf10a('0x25')][_0xf10a('0x43')]()[_0xf10a('0x20')](respondWithResult(_0x3cf73f,null))[_0xf10a('0x39')](handleError(_0x3cf73f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 30867df..15907c9 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 _0x3a60=['JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','bluebird','path','exports','define'];(function(_0x484933,_0x38001a){var _0x5059d9=function(_0x3c659e){while(--_0x3c659e){_0x484933['push'](_0x484933['shift']());}};_0x5059d9(++_0x38001a);}(_0x3a60,0x192));var _0x03a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a60[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x03a6('0x0'));var util=require('util');var logger=require(_0x03a6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x03a6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03a6('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x03a6('0x4')]=function(_0x26e7cb,_0x2ecae3){return _0x26e7cb[_0x03a6('0x5')](_0x03a6('0x6'),attributes,{'tableName':_0x03a6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe028=['request-promise','rimraf','./jscriptyAnswerReport.attributes','exports','report_jscripty_answers','util','../../config/logger','api','moment','bluebird'];(function(_0x1042b9,_0x4a42fe){var _0x4a8ec6=function(_0x2a6ed1){while(--_0x2a6ed1){_0x1042b9['push'](_0x1042b9['shift']());}};_0x4a8ec6(++_0x4a42fe);}(_0xe028,0x195));var _0x8e02=function(_0x25ea2a,_0x33c1ec){_0x25ea2a=_0x25ea2a-0x0;var _0x127a45=_0xe028[_0x25ea2a];return _0x127a45;};'use strict';var _=require('lodash');var util=require(_0x8e02('0x0'));var logger=require(_0x8e02('0x1'))(_0x8e02('0x2'));var moment=require(_0x8e02('0x3'));var BPromise=require(_0x8e02('0x4'));var rp=require(_0x8e02('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e02('0x6'));var config=require('../../config/environment');var attributes=require(_0x8e02('0x7'));module[_0x8e02('0x8')]=function(_0x597f0e,_0x2e24ec){return _0x597f0e['define']('JscriptyAnswerReport',attributes,{'tableName':_0x8e02('0x9'),'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 e7270dd..9a9e7a5 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 _0x7e04=['code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x392991,_0x1f7ce9){var _0x3f9b68=function(_0x161044){while(--_0x161044){_0x392991['push'](_0x392991['shift']());}};_0x3f9b68(++_0x1f7ce9);}(_0x7e04,0xd6));var _0x47e0=function(_0x3a3baf,_0x2bd37c){_0x3a3baf=_0x3a3baf-0x0;var _0x5266bf=_0x7e04[_0x3a3baf];return _0x5266bf;};'use strict';var _=require(_0x47e0('0x0'));var util=require(_0x47e0('0x1'));var moment=require(_0x47e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x47e0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47e0('0x4'));var logger=require(_0x47e0('0x5'))('rpc');var config=require(_0x47e0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x47e0('0x7')][_0x47e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbcdc9c,_0x4c19a5,_0x5acee7){return new BPromise(function(_0x18f831,_0x2ac307){return client[_0x47e0('0x9')](_0xbcdc9c,_0x5acee7)['then'](function(_0x4d2e59){logger[_0x47e0('0xa')](_0x47e0('0xb'),_0x4c19a5,_0x47e0('0xc'));logger[_0x47e0('0xd')](_0x47e0('0xe'),_0x4c19a5,_0x47e0('0xc'),JSON[_0x47e0('0xf')](_0x4d2e59));if(_0x4d2e59['error']){if(_0x4d2e59[_0x47e0('0x10')][_0x47e0('0x11')]===0x1f4){logger[_0x47e0('0x10')](_0x47e0('0xb'),_0x4c19a5,_0x4d2e59['error'][_0x47e0('0x12')]);return _0x2ac307(_0x4d2e59[_0x47e0('0x10')][_0x47e0('0x12')]);}logger['error'](_0x47e0('0xb'),_0x4c19a5,_0x4d2e59[_0x47e0('0x10')][_0x47e0('0x12')]);return _0x18f831(_0x4d2e59[_0x47e0('0x10')][_0x47e0('0x12')]);}else{logger['info'](_0x47e0('0xb'),_0x4c19a5,'request\x20sent');_0x18f831(_0x4d2e59[_0x47e0('0x13')][_0x47e0('0x12')]);}})[_0x47e0('0x14')](function(_0x194854){logger[_0x47e0('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4c19a5,_0x194854);_0x2ac307(_0x194854);});});} \ No newline at end of file +var _0xd1f5=['stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xd1f5,0x1bf));var _0x5d1f=function(_0x1ec6d9,_0x2c034d){_0x1ec6d9=_0x1ec6d9-0x0;var _0xd8189e=_0xd1f5[_0x1ec6d9];return _0xd8189e;};'use strict';var _=require('lodash');var util=require(_0x5d1f('0x0'));var moment=require(_0x5d1f('0x1'));var BPromise=require(_0x5d1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d1f('0x3'));var db=require(_0x5d1f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5d1f('0x5'));var jayson=require(_0x5d1f('0x6'));var client=jayson[_0x5d1f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a623c,_0x2cf344,_0x1a5fde){return new BPromise(function(_0x3564f4,_0x193f4c){return client[_0x5d1f('0x8')](_0x1a623c,_0x1a5fde)[_0x5d1f('0x9')](function(_0x5e100c){logger['info'](_0x5d1f('0xa'),_0x2cf344,_0x5d1f('0xb'));logger['debug'](_0x5d1f('0xc'),_0x2cf344,'request\x20sent',JSON[_0x5d1f('0xd')](_0x5e100c));if(_0x5e100c[_0x5d1f('0xe')]){if(_0x5e100c[_0x5d1f('0xe')][_0x5d1f('0xf')]===0x1f4){logger['error'](_0x5d1f('0xa'),_0x2cf344,_0x5e100c['error'][_0x5d1f('0x10')]);return _0x193f4c(_0x5e100c[_0x5d1f('0xe')]['message']);}logger[_0x5d1f('0xe')](_0x5d1f('0xa'),_0x2cf344,_0x5e100c[_0x5d1f('0xe')][_0x5d1f('0x10')]);return _0x3564f4(_0x5e100c[_0x5d1f('0xe')][_0x5d1f('0x10')]);}else{logger[_0x5d1f('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2cf344,_0x5d1f('0xb'));_0x3564f4(_0x5e100c[_0x5d1f('0x12')]['message']);}})[_0x5d1f('0x13')](function(_0x4935bb){logger[_0x5d1f('0xe')](_0x5d1f('0xa'),_0x2cf344,_0x4935bb);_0x193f4c(_0x4935bb);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ce66592..0a2c25d 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 _0xecb8=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','/:id/clone','put'];(function(_0x28997c,_0x1a8c0e){var _0x60f804=function(_0x1a8075){while(--_0x1a8075){_0x28997c['push'](_0x28997c['shift']());}};_0x60f804(++_0x1a8c0e);}(_0xecb8,0x1dd));var _0x8ecb=function(_0x4f37c9,_0x5ac4a3){_0x4f37c9=_0x4f37c9-0x0;var _0x11513b=_0xecb8[_0x4f37c9];return _0x11513b;};'use strict';var multer=require(_0x8ecb('0x0'));var util=require(_0x8ecb('0x1'));var path=require(_0x8ecb('0x2'));var timeout=require(_0x8ecb('0x3'));var express=require(_0x8ecb('0x4'));var router=express[_0x8ecb('0x5')]();var fs_extra=require(_0x8ecb('0x6'));var auth=require(_0x8ecb('0x7'));var interaction=require(_0x8ecb('0x8'));var config=require(_0x8ecb('0x9'));var controller=require('./jscriptyProject.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8ecb('0xa')]);router[_0x8ecb('0xb')](_0x8ecb('0xc'),auth[_0x8ecb('0xd')](),controller['show']);router['get'](_0x8ecb('0xe'),auth[_0x8ecb('0xd')](),controller[_0x8ecb('0xf')]);router[_0x8ecb('0xb')](_0x8ecb('0x10'),auth['isAuthenticated'](),controller[_0x8ecb('0x11')]);router[_0x8ecb('0xb')]('/:id/summary',auth[_0x8ecb('0xd')](),timeout(_0x8ecb('0x12')),controller[_0x8ecb('0x13')]);router[_0x8ecb('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x8ecb('0x15'),auth[_0x8ecb('0xd')](),controller['clone']);router[_0x8ecb('0x16')](_0x8ecb('0xc'),auth[_0x8ecb('0xd')](),controller['update']);router[_0x8ecb('0x17')](_0x8ecb('0xc'),auth[_0x8ecb('0xd')](),controller['destroy']);module[_0x8ecb('0x18')]=router; \ No newline at end of file +var _0xeda0=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update'];(function(_0x1a3b56,_0x222655){var _0x46f4ee=function(_0x3d01cc){while(--_0x3d01cc){_0x1a3b56['push'](_0x1a3b56['shift']());}};_0x46f4ee(++_0x222655);}(_0xeda0,0xed));var _0x0eda=function(_0x4119e9,_0x3c0cf5){_0x4119e9=_0x4119e9-0x0;var _0x5e5774=_0xeda0[_0x4119e9];return _0x5e5774;};'use strict';var multer=require(_0x0eda('0x0'));var util=require(_0x0eda('0x1'));var path=require(_0x0eda('0x2'));var timeout=require(_0x0eda('0x3'));var express=require('express');var router=express[_0x0eda('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0eda('0x5'));var interaction=require(_0x0eda('0x6'));var config=require(_0x0eda('0x7'));var controller=require('./jscriptyProject.controller');router[_0x0eda('0x8')]('/',auth[_0x0eda('0x9')](),controller[_0x0eda('0xa')]);router['get'](_0x0eda('0xb'),auth[_0x0eda('0x9')](),controller[_0x0eda('0xc')]);router[_0x0eda('0x8')](_0x0eda('0xd'),auth[_0x0eda('0x9')](),controller['getSessions']);router[_0x0eda('0x8')]('/:id/answers',auth[_0x0eda('0x9')](),controller['getAnswers']);router[_0x0eda('0x8')](_0x0eda('0xe'),auth[_0x0eda('0x9')](),timeout(_0x0eda('0xf')),controller[_0x0eda('0x10')]);router[_0x0eda('0x11')]('/',auth['isAuthenticated'](),controller[_0x0eda('0x12')]);router[_0x0eda('0x11')](_0x0eda('0x13'),auth['isAuthenticated'](),controller[_0x0eda('0x14')]);router[_0x0eda('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x0eda('0x16')]);router[_0x0eda('0x17')](_0x0eda('0xb'),auth[_0x0eda('0x9')](),controller[_0x0eda('0x18')]);module[_0x0eda('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a008c03..e0560ce 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 _0x4bfd=['formData','getDataValue','BOOLEAN','util','exports','name','TEXT','long','setDataValue','stringify'];(function(_0x70812d,_0x5c1495){var _0x4e5c35=function(_0x55521c){while(--_0x55521c){_0x70812d['push'](_0x70812d['shift']());}};_0x4e5c35(++_0x5c1495);}(_0x4bfd,0x99));var _0xd4bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4bfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xd4bf('0x0'));module[_0xd4bf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd4bf('0x2')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd4bf('0x3')](_0xd4bf('0x4')),'set':function(_0x9d524c){if(_['isObjectLike'](_0x9d524c)){this[_0xd4bf('0x5')]('formData',JSON[_0xd4bf('0x6')](_0x9d524c));}else if(_['isString'](_0x9d524c)){this[_0xd4bf('0x5')](_0xd4bf('0x7'),_0x9d524c);}else{this['setDataValue'](_0xd4bf('0x7'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0xd4bf('0x2'))||'',this[_0xd4bf('0x8')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd4bf('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xfa5e=['name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING'];(function(_0x1b81ab,_0x3e2893){var _0x2c5af6=function(_0x17cb14){while(--_0x17cb14){_0x1b81ab['push'](_0x1b81ab['shift']());}};_0x2c5af6(++_0x3e2893);}(_0xfa5e,0x109));var _0xefa5=function(_0x28b640,_0x370a79){_0x28b640=_0x28b640-0x0;var _0x4f0b1a=_0xfa5e[_0x28b640];return _0x4f0b1a;};'use strict';var Sequelize=require(_0xefa5('0x0'));var _=require(_0xefa5('0x1'));var util=require(_0xefa5('0x2'));module[_0xefa5('0x3')]={'name':{'type':Sequelize[_0xefa5('0x4')],'unique':_0xefa5('0x5')},'description':{'type':Sequelize[_0xefa5('0x4')]},'formData':{'type':Sequelize[_0xefa5('0x6')](_0xefa5('0x7')),'set':function(_0x471432){if(_[_0xefa5('0x8')](_0x471432)){this[_0xefa5('0x9')](_0xefa5('0xa'),JSON[_0xefa5('0xb')](_0x471432));}else if(_[_0xefa5('0xc')](_0x471432)){this[_0xefa5('0x9')](_0xefa5('0xa'),_0x471432);}else{this[_0xefa5('0x9')](_0xefa5('0xa'),util[_0xefa5('0xd')](_0xefa5('0xe'),this[_0xefa5('0xf')]('name')||'',this['getDataValue'](_0xefa5('0x10'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xefa5('0x11')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xefa5('0x11')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index f546f88..85e8427 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 _0xa24a=['pick','merge','VIRTUAL','options','includeAll','include','rows','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','find','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','filter','findAll','getAnswers','JscriptyAnswerReport','ProjectId','fromCharCode','indexOf','toString','replace','startTime','starttime','parse','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Projects','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x13fd59,_0x2e05b1){var _0x2e6ce7=function(_0x519a4b){while(--_0x519a4b){_0x13fd59['push'](_0x13fd59['shift']());}};_0x2e6ce7(++_0x2e05b1);}(_0xa24a,0x1a2));var _0xaa24=function(_0x4f0cf4,_0x18bac8){_0x4f0cf4=_0x4f0cf4-0x0;var _0x7c59a3=_0xa24a[_0x4f0cf4];return _0x7c59a3;};'use strict';var emlformat=require(_0xaa24('0x0'));var rimraf=require(_0xaa24('0x1'));var zipdir=require(_0xaa24('0x2'));var jsonpatch=require(_0xaa24('0x3'));var rp=require(_0xaa24('0x4'));var moment=require(_0xaa24('0x5'));var BPromise=require(_0xaa24('0x6'));var Mustache=require(_0xaa24('0x7'));var util=require(_0xaa24('0x8'));var path=require(_0xaa24('0x9'));var sox=require('sox');var csv=require(_0xaa24('0xa'));var ejs=require(_0xaa24('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa24('0xc'));var squel=require(_0xaa24('0xd'));var crypto=require('crypto');var jsforce=require(_0xaa24('0xe'));var deskjs=require(_0xaa24('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa24('0x10'));var Redis=require(_0xaa24('0x11'));var authService=require(_0xaa24('0x12'));var qs=require(_0xaa24('0x13'));var as=require(_0xaa24('0x14'));var hardwareService=require(_0xaa24('0x15'));var logger=require(_0xaa24('0x16'))(_0xaa24('0x17'));var utils=require(_0xaa24('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa24('0x19'))['db'];function respondWithStatusCode(_0x5ed529,_0x238bd2){_0x238bd2=_0x238bd2||0xcc;return function(_0x2c44ac){if(_0x2c44ac){return _0x5ed529[_0xaa24('0x1a')](_0x238bd2);}return _0x5ed529[_0xaa24('0x1b')](_0x238bd2)['end']();};}function respondWithResult(_0x32e5b9,_0x414379){_0x414379=_0x414379||0xc8;return function(_0x472f5f){if(_0x472f5f){return _0x32e5b9[_0xaa24('0x1b')](_0x414379)[_0xaa24('0x1c')](_0x472f5f);}};}function respondWithFilteredResult(_0x5099f1,_0x2db740){return function(_0x4adb32){if(_0x4adb32){var _0xe6baa0=typeof _0x2db740[_0xaa24('0x1d')]===_0xaa24('0x1e')&&typeof _0x2db740[_0xaa24('0x1f')]===_0xaa24('0x1e');var _0x3bb589=_0x4adb32['count'];var _0x2c2df2=_0xe6baa0?0x0:_0x2db740[_0xaa24('0x1d')];var _0x4e1712=_0xe6baa0?_0x4adb32[_0xaa24('0x20')]:_0x2db740[_0xaa24('0x1d')]+_0x2db740[_0xaa24('0x1f')];var _0x17b573;if(_0x4e1712>=_0x3bb589){_0x4e1712=_0x3bb589;_0x17b573=0xc8;}else{_0x17b573=0xce;}_0x5099f1[_0xaa24('0x1b')](_0x17b573);return _0x5099f1[_0xaa24('0x21')](_0xaa24('0x22'),_0x2c2df2+'-'+_0x4e1712+'/'+_0x3bb589)[_0xaa24('0x1c')](_0x4adb32);}return null;};}function patchUpdates(_0x181c7e){return function(_0xc34093){try{jsonpatch[_0xaa24('0x23')](_0xc34093,_0x181c7e,!![]);}catch(_0x3da691){return BPromise[_0xaa24('0x24')](_0x3da691);}return _0xc34093['save']();};}function saveUpdates(_0x3bdf56,_0x5bac34){return function(_0x17e4e9){if(_0x17e4e9){return _0x17e4e9[_0xaa24('0x25')](_0x3bdf56)[_0xaa24('0x26')](function(_0x3c0858){return _0x3c0858;});}return null;};}function removeEntity(_0x5eb3fb,_0x5447c0){return function(_0x4f90a8){if(_0x4f90a8){return _0x4f90a8[_0xaa24('0x27')]()[_0xaa24('0x26')](function(){var _0x2a3d2b=_0x4f90a8[_0xaa24('0x28')]({'plain':!![]});var _0x4e6742=_0xaa24('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e6742,'resourceId':_0x2a3d2b['id']}})[_0xaa24('0x26')](function(){return _0x4f90a8;});})['then'](function(){_0x5eb3fb[_0xaa24('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f85f9,_0xc7d404){return function(_0x53a3c9){if(!_0x53a3c9){_0x1f85f9[_0xaa24('0x1a')](0x194);}return _0x53a3c9;};}function handleError(_0x42a720,_0x45d8dc){_0x45d8dc=_0x45d8dc||0x1f4;return function(_0x40dbdd){logger[_0xaa24('0x2a')](_0x40dbdd[_0xaa24('0x2b')]);if(_0x40dbdd[_0xaa24('0x2c')]){delete _0x40dbdd['name'];}_0x42a720['status'](_0x45d8dc)[_0xaa24('0x2d')](_0x40dbdd);};}exports[_0xaa24('0x2e')]=function(_0x506d00,_0x3e9943){var _0x345b9b={},_0x59c675={},_0x22af48={'count':0x0,'rows':[]};var _0x183cd0=_[_0xaa24('0x2f')](db[_0xaa24('0x30')][_0xaa24('0x31')],function(_0x39a532){return{'name':_0x39a532[_0xaa24('0x32')],'type':_0x39a532[_0xaa24('0x33')][_0xaa24('0x34')]};});_0x59c675[_0xaa24('0x35')]=_[_0xaa24('0x2f')](_0x183cd0,'name');_0x59c675[_0xaa24('0x36')]=_[_0xaa24('0x37')](_0x506d00[_0xaa24('0x36')]);_0x59c675[_0xaa24('0x38')]=_[_0xaa24('0x39')](_0x59c675['model'],_0x59c675[_0xaa24('0x36')]);_0x345b9b['attributes']=_['intersection'](_0x59c675[_0xaa24('0x35')],qs[_0xaa24('0x3a')](_0x506d00['query'][_0xaa24('0x3a')]));_0x345b9b[_0xaa24('0x3b')]=_0x345b9b[_0xaa24('0x3b')][_0xaa24('0x3c')]?_0x345b9b[_0xaa24('0x3b')]:_0x59c675[_0xaa24('0x35')];if(!_0x506d00['query'][_0xaa24('0x3d')](_0xaa24('0x3e'))){_0x345b9b[_0xaa24('0x1f')]=qs[_0xaa24('0x1f')](_0x506d00['query'][_0xaa24('0x1f')]);_0x345b9b[_0xaa24('0x1d')]=qs[_0xaa24('0x1d')](_0x506d00[_0xaa24('0x36')][_0xaa24('0x1d')]);}_0x345b9b[_0xaa24('0x3f')]=qs['sort'](_0x506d00[_0xaa24('0x36')][_0xaa24('0x40')]);_0x345b9b[_0xaa24('0x41')]=qs[_0xaa24('0x38')](_[_0xaa24('0x42')](_0x506d00[_0xaa24('0x36')],_0x59c675[_0xaa24('0x38')]),_0x183cd0);if(_0x506d00[_0xaa24('0x36')]['filter']){_0x345b9b[_0xaa24('0x41')]=_[_0xaa24('0x43')](_0x345b9b[_0xaa24('0x41')],{'$or':_[_0xaa24('0x2f')](_0x183cd0,function(_0x551753){if(_0x551753[_0xaa24('0x33')]!==_0xaa24('0x44')){var _0x9d025a={};_0x9d025a[_0x551753[_0xaa24('0x2c')]]={'$like':'%'+_0x506d00[_0xaa24('0x36')]['filter']+'%'};return _0x9d025a;}})});}_0x345b9b=_[_0xaa24('0x43')]({},_0x345b9b,_0x506d00[_0xaa24('0x45')]);var _0xb9cd52={'where':_0x345b9b[_0xaa24('0x41')]};return db['JscriptyProject'][_0xaa24('0x20')](_0xb9cd52)[_0xaa24('0x26')](function(_0x30fc9a){_0x22af48[_0xaa24('0x20')]=_0x30fc9a;if(_0x506d00['query'][_0xaa24('0x46')]){_0x345b9b[_0xaa24('0x47')]=[{'all':!![]}];}return db[_0xaa24('0x30')]['findAll'](_0x345b9b);})[_0xaa24('0x26')](function(_0x429b7c){_0x22af48[_0xaa24('0x48')]=_0x429b7c;return _0x22af48;})[_0xaa24('0x26')](respondWithFilteredResult(_0x3e9943,_0x345b9b))['catch'](handleError(_0x3e9943,null));};exports[_0xaa24('0x49')]=function(_0x1311eb,_0x4448c0){var _0x3b02e2={'raw':![],'where':{'id':_0x1311eb['params']['id']}},_0x4ffef9={};_0x4ffef9[_0xaa24('0x35')]=_[_0xaa24('0x37')](db[_0xaa24('0x30')]['rawAttributes']);_0x4ffef9[_0xaa24('0x36')]=_[_0xaa24('0x37')](_0x1311eb[_0xaa24('0x36')]);_0x4ffef9[_0xaa24('0x38')]=_[_0xaa24('0x39')](_0x4ffef9['model'],_0x4ffef9[_0xaa24('0x36')]);_0x3b02e2[_0xaa24('0x3b')]=_[_0xaa24('0x39')](_0x4ffef9['model'],qs[_0xaa24('0x3a')](_0x1311eb['query'][_0xaa24('0x3a')]));_0x3b02e2[_0xaa24('0x3b')]=_0x3b02e2[_0xaa24('0x3b')]['length']?_0x3b02e2[_0xaa24('0x3b')]:_0x4ffef9['model'];if(_0x1311eb[_0xaa24('0x36')]['includeAll']){_0x3b02e2[_0xaa24('0x47')]=[{'all':!![]}];}_0x3b02e2=_[_0xaa24('0x43')]({},_0x3b02e2,_0x1311eb['options']);return db[_0xaa24('0x30')]['find'](_0x3b02e2)['then'](handleEntityNotFound(_0x4448c0,null))[_0xaa24('0x26')](respondWithResult(_0x4448c0,null))['catch'](handleError(_0x4448c0,null));};exports[_0xaa24('0x4a')]=function(_0x375fc2,_0x1baa0d){return db[_0xaa24('0x30')][_0xaa24('0x4a')](_0x375fc2[_0xaa24('0x4b')],{})['then'](function(_0x44c4aa){var _0x1c29a1=_0x375fc2['user'][_0xaa24('0x28')]({'plain':!![]});if(!_0x1c29a1)throw new Error(_0xaa24('0x4c'));if(_0x1c29a1[_0xaa24('0x4d')]===_0xaa24('0x4e')){var _0x4805cd=_0x44c4aa[_0xaa24('0x28')]({'plain':!![]});var _0x1f7173=_0xaa24('0x29');return db[_0xaa24('0x4f')]['find']({'where':{'name':_0x1f7173,'userProfileId':_0x1c29a1['userProfileId']},'raw':!![]})['then'](function(_0xa4777d){if(_0xa4777d&&_0xa4777d[_0xaa24('0x50')]===0x0){return db[_0xaa24('0x51')][_0xaa24('0x4a')]({'name':_0x4805cd['name'],'resourceId':_0x4805cd['id'],'type':_0xa4777d['name'],'sectionId':_0xa4777d['id']},{})[_0xaa24('0x26')](function(){return _0x44c4aa;});}else{return _0x44c4aa;}})[_0xaa24('0x52')](function(_0x14e828){logger[_0xaa24('0x2a')](_0xaa24('0x53'),_0x14e828);throw _0x14e828;});}return _0x44c4aa;})[_0xaa24('0x26')](respondWithResult(_0x1baa0d,0xc9))[_0xaa24('0x52')](handleError(_0x1baa0d,null));};exports[_0xaa24('0x54')]=function(_0x3c4054,_0xabe8bf){var _0x344899={'where':{'id':_0x3c4054[_0xaa24('0x55')]['id']}},_0x493e42={};_0x493e42[_0xaa24('0x35')]=_['keys'](db['JscriptyProject'][_0xaa24('0x31')]);_0x344899['attributes']=_[_0xaa24('0x39')](_0x493e42[_0xaa24('0x35')],qs[_0xaa24('0x3a')](_0x3c4054[_0xaa24('0x36')][_0xaa24('0x3a')]));_0x344899[_0xaa24('0x3b')]=_0x344899[_0xaa24('0x3b')][_0xaa24('0x3c')]?_0x344899[_0xaa24('0x3b')]:_0x493e42['model'];if(_0x3c4054[_0xaa24('0x36')]['includeAll']){_0x344899['include']=[{'all':!![]}];}_0x344899=_[_0xaa24('0x43')]({},_0x344899,_0x3c4054['options']);return db['JscriptyProject'][_0xaa24('0x56')](_0x344899)[_0xaa24('0x26')](handleEntityNotFound(_0xabe8bf,null))[_0xaa24('0x26')](function(_0x126350){if(_0x126350){var _0x1074fb=_0x126350['get']({'plain':!![]});_0x1074fb=qs[_0xaa24('0x57')](_0x1074fb,['id',_0xaa24('0x58'),_0xaa24('0x59')]);_0x3c4054['body']=_[_0xaa24('0x57')](_0x3c4054[_0xaa24('0x4b')],['id',_0xaa24('0x58'),_0xaa24('0x59')]);return db[_0xaa24('0x30')][_0xaa24('0x4a')](_[_0xaa24('0x43')](_0x1074fb,_0x3c4054['body']),{'include':_0x3c4054['query'][_0xaa24('0x46')]?[{'all':!![]}]:undefined})[_0xaa24('0x26')](function(_0x2a598b){var _0x4c65ed=_0x3c4054[_0xaa24('0x4e')]['get']({'plain':!![]});if(!_0x4c65ed)throw new Error(_0xaa24('0x4c'));if(_0x4c65ed['role']==='user'){var _0x122c60=_0x2a598b['get']({'plain':!![]});var _0x31c372=_0xaa24('0x29');return db[_0xaa24('0x4f')]['find']({'where':{'name':_0x31c372,'userProfileId':_0x4c65ed['userProfileId']},'raw':!![]})['then'](function(_0x768a41){if(_0x768a41&&_0x768a41[_0xaa24('0x50')]===0x0){return db[_0xaa24('0x51')][_0xaa24('0x4a')]({'name':_0x122c60[_0xaa24('0x2c')],'resourceId':_0x122c60['id'],'type':_0x768a41[_0xaa24('0x2c')],'sectionId':_0x768a41['id']},{})[_0xaa24('0x26')](function(){return _0x2a598b;});}else{return _0x2a598b;}})[_0xaa24('0x52')](function(_0x42e964){logger[_0xaa24('0x2a')](_0xaa24('0x53'),_0x42e964);throw _0x42e964;});}return _0x2a598b;});}})[_0xaa24('0x26')](respondWithResult(_0xabe8bf,0xc9))[_0xaa24('0x52')](handleError(_0xabe8bf,null));};exports[_0xaa24('0x25')]=function(_0xad7105,_0x419150){if(_0xad7105[_0xaa24('0x4b')]['id']){delete _0xad7105[_0xaa24('0x4b')]['id'];}return db['JscriptyProject'][_0xaa24('0x56')]({'where':{'id':_0xad7105[_0xaa24('0x55')]['id']}})[_0xaa24('0x26')](handleEntityNotFound(_0x419150,null))['then'](saveUpdates(_0xad7105[_0xaa24('0x4b')],null))[_0xaa24('0x26')](respondWithResult(_0x419150,null))['catch'](handleError(_0x419150,null));};exports[_0xaa24('0x27')]=function(_0x583932,_0x123ea1){return db[_0xaa24('0x30')][_0xaa24('0x56')]({'where':{'id':_0x583932[_0xaa24('0x55')]['id']}})[_0xaa24('0x26')](handleEntityNotFound(_0x123ea1,null))[_0xaa24('0x26')](removeEntity(_0x123ea1,null))[_0xaa24('0x52')](handleError(_0x123ea1,null));};exports[_0xaa24('0x5a')]=function(_0x30d5e8,_0x187046,_0x345ef3){var _0x32ecfd={'raw':!![],'where':{}};var _0x1674e5={};var _0x1b72a1={'count':0x0,'rows':[]};return db[_0xaa24('0x30')][_0xaa24('0x5b')]({'where':{'id':_0x30d5e8[_0xaa24('0x55')]['id']}})[_0xaa24('0x26')](handleEntityNotFound(_0x187046,null))[_0xaa24('0x26')](function(_0x5649d1){if(_0x5649d1){_0x1674e5[_0xaa24('0x35')]=_[_0xaa24('0x37')](db[_0xaa24('0x5c')][_0xaa24('0x31')]);_0x1674e5[_0xaa24('0x36')]=_['keys'](_0x30d5e8[_0xaa24('0x36')]);_0x1674e5['filters']=_[_0xaa24('0x39')](_0x1674e5[_0xaa24('0x35')],_0x1674e5[_0xaa24('0x36')]);_0x32ecfd[_0xaa24('0x3b')]=_[_0xaa24('0x39')](_0x1674e5[_0xaa24('0x35')],qs[_0xaa24('0x3a')](_0x30d5e8['query'][_0xaa24('0x3a')]));_0x32ecfd[_0xaa24('0x3b')]=_0x32ecfd[_0xaa24('0x3b')][_0xaa24('0x3c')]?_0x32ecfd[_0xaa24('0x3b')]:_0x1674e5[_0xaa24('0x35')];if(!_0x30d5e8['query'][_0xaa24('0x3d')](_0xaa24('0x3e'))){_0x32ecfd['limit']=qs[_0xaa24('0x1f')](_0x30d5e8[_0xaa24('0x36')][_0xaa24('0x1f')]);_0x32ecfd[_0xaa24('0x1d')]=qs[_0xaa24('0x1d')](_0x30d5e8[_0xaa24('0x36')][_0xaa24('0x1d')]);}_0x32ecfd[_0xaa24('0x3f')]=qs['sort'](_0x30d5e8[_0xaa24('0x36')][_0xaa24('0x40')]);_0x32ecfd[_0xaa24('0x41')]=qs[_0xaa24('0x38')](_[_0xaa24('0x42')](_0x30d5e8[_0xaa24('0x36')],_0x1674e5['filters']));_0x32ecfd[_0xaa24('0x41')]['ProjectId']=_0x5649d1['id'];if(_0x30d5e8[_0xaa24('0x36')][_0xaa24('0x5d')]){_0x32ecfd['where']=_[_0xaa24('0x43')](_0x32ecfd[_0xaa24('0x41')],{'$or':_[_0xaa24('0x2f')](_0x32ecfd[_0xaa24('0x3b')],function(_0x1eaa24){var _0xb9e12e={};_0xb9e12e[_0x1eaa24]={'$like':'%'+_0x30d5e8[_0xaa24('0x36')][_0xaa24('0x5d')]+'%'};return _0xb9e12e;})});}_0x32ecfd=_['merge']({},_0x32ecfd,_0x30d5e8['options']);return db['JscriptySessionReport'][_0xaa24('0x20')]({'where':_0x32ecfd[_0xaa24('0x41')]})[_0xaa24('0x26')](function(_0x3210f4){_0x1b72a1[_0xaa24('0x20')]=_0x3210f4;if(_0x30d5e8['query'][_0xaa24('0x46')]){_0x32ecfd['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xaa24('0x5e')](_0x32ecfd);})[_0xaa24('0x26')](function(_0x2531ef){_0x1b72a1[_0xaa24('0x48')]=_0x2531ef;return _0x1b72a1;});}})['then'](respondWithFilteredResult(_0x187046,_0x32ecfd))[_0xaa24('0x52')](handleError(_0x187046,null));};exports[_0xaa24('0x5f')]=function(_0x1678b8,_0x2919f5,_0x192ea8){var _0x49fbc0={'raw':!![],'where':{}};var _0x2bfd61={};var _0x2c9e14={'count':0x0,'rows':[]};return db[_0xaa24('0x30')][_0xaa24('0x5b')]({'where':{'id':_0x1678b8[_0xaa24('0x55')]['id']}})[_0xaa24('0x26')](handleEntityNotFound(_0x2919f5,null))['then'](function(_0x4ec4e6){if(_0x4ec4e6){_0x2bfd61[_0xaa24('0x35')]=_['keys'](db[_0xaa24('0x60')]['rawAttributes']);_0x2bfd61[_0xaa24('0x36')]=_['keys'](_0x1678b8[_0xaa24('0x36')]);_0x2bfd61[_0xaa24('0x38')]=_[_0xaa24('0x39')](_0x2bfd61[_0xaa24('0x35')],_0x2bfd61['query']);_0x49fbc0[_0xaa24('0x3b')]=_[_0xaa24('0x39')](_0x2bfd61['model'],qs[_0xaa24('0x3a')](_0x1678b8[_0xaa24('0x36')][_0xaa24('0x3a')]));_0x49fbc0['attributes']=_0x49fbc0[_0xaa24('0x3b')]['length']?_0x49fbc0['attributes']:_0x2bfd61[_0xaa24('0x35')];if(!_0x1678b8[_0xaa24('0x36')][_0xaa24('0x3d')](_0xaa24('0x3e'))){_0x49fbc0[_0xaa24('0x1f')]=qs[_0xaa24('0x1f')](_0x1678b8[_0xaa24('0x36')][_0xaa24('0x1f')]);_0x49fbc0[_0xaa24('0x1d')]=qs[_0xaa24('0x1d')](_0x1678b8[_0xaa24('0x36')]['offset']);}_0x49fbc0[_0xaa24('0x3f')]=qs[_0xaa24('0x40')](_0x1678b8['query'][_0xaa24('0x40')]);_0x49fbc0[_0xaa24('0x41')]=qs[_0xaa24('0x38')](_[_0xaa24('0x42')](_0x1678b8[_0xaa24('0x36')],_0x2bfd61[_0xaa24('0x38')]));_0x49fbc0[_0xaa24('0x41')][_0xaa24('0x61')]=_0x4ec4e6['id'];if(_0x1678b8[_0xaa24('0x36')][_0xaa24('0x5d')]){_0x49fbc0[_0xaa24('0x41')]=_[_0xaa24('0x43')](_0x49fbc0[_0xaa24('0x41')],{'$or':_[_0xaa24('0x2f')](_0x49fbc0[_0xaa24('0x3b')],function(_0xca3ea2){var _0x1cd757={};_0x1cd757[_0xca3ea2]={'$like':'%'+_0x1678b8[_0xaa24('0x36')]['filter']+'%'};return _0x1cd757;})});}_0x49fbc0=_['merge']({},_0x49fbc0,_0x1678b8['options']);return db[_0xaa24('0x60')]['count']({'where':_0x49fbc0['where']})[_0xaa24('0x26')](function(_0x496524){_0x2c9e14[_0xaa24('0x20')]=_0x496524;if(_0x1678b8[_0xaa24('0x36')]['includeAll']){_0x49fbc0[_0xaa24('0x47')]=[{'all':!![]}];}return db[_0xaa24('0x60')][_0xaa24('0x5e')](_0x49fbc0);})[_0xaa24('0x26')](function(_0xc01d38){_0x2c9e14[_0xaa24('0x48')]=_0xc01d38;return _0x2c9e14;});}})[_0xaa24('0x26')](respondWithFilteredResult(_0x2919f5,_0x49fbc0))['catch'](handleError(_0x2919f5,null));};function char(_0x54fcb7){return'number'===typeof _0x54fcb7?String[_0xaa24('0x62')][_0xaa24('0x23')](null,arguments):_0x54fcb7;}function needsEncapsulation(_0x20d671){return!!_0x20d671&&(_0x20d671['toString']()[_0xaa24('0x63')](char(0xd))>=0x0||_0x20d671[_0xaa24('0x64')]()[_0xaa24('0x63')](char(0xa))>=0x0||_0x20d671['toString']()[_0xaa24('0x63')](char(0x2c))>=0x0||_0x20d671[_0xaa24('0x64')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x14c8de){var _0x4d71c6=char(0x22),_0x5d7ffa='\x5c'+char(0x22),_0x87ce9b=_0x14c8de[_0xaa24('0x64')]()[_0xaa24('0x65')](new RegExp(_0x4d71c6,'g'),_0x5d7ffa);return _0x4d71c6+_0x87ce9b+_0x4d71c6;}exports['getSummary']=function(_0x4d8e91,_0x4c972f,_0x46fe87){var _0x4a3d8f,_0x12badb;var _0x490b6a={'where':{'ProjectId':_0x4d8e91['params']['id']}};if(_0x4d8e91[_0xaa24('0x36')][_0xaa24('0x66')]){_0x490b6a[_0xaa24('0x41')][_0xaa24('0x67')]=JSON[_0xaa24('0x68')](_0x4d8e91[_0xaa24('0x36')]['startTime']);}return db['JscriptySessionReport'][_0xaa24('0x5e')](_0x490b6a)[_0xaa24('0x26')](handleEntityNotFound(_0x4c972f,null))[_0xaa24('0x26')](function(_0x3d69f6){if(_0x3d69f6){_0x4a3d8f=_0x3d69f6;return db['JscriptyQuestionReport'][_0xaa24('0x5e')]({'where':{'SessionId':{'$in':_['map'](_0x4a3d8f,'id')},'ProjectId':_0x4d8e91[_0xaa24('0x55')]['id']},'order':'-createdAt'});}})[_0xaa24('0x26')](handleEntityNotFound(_0x4c972f,null))['then'](function(_0x13626b){if(_0x13626b){_0x12badb=_0x13626b;var _0x2eeb89={};for(var _0xf9d34b=0x0,_0x523315=_0x12badb['length'];_0xf9d34b<_0x523315;_0xf9d34b++){if(!_0x2eeb89[_0xaa24('0x3d')](_0x12badb[_0xf9d34b][_0xaa24('0x69')])){_0x2eeb89[_0x12badb[_0xf9d34b][_0xaa24('0x69')]]=needsEncapsulation(_0x12badb[_0xf9d34b][_0xaa24('0x6a')])?encapsulate(_0x12badb[_0xf9d34b]['question']):_0x12badb[_0xf9d34b][_0xaa24('0x6a')];}}var _0x42168f=[],_0xf4a391={};for(var _0x326418=0x0,_0x544d22=_0x4a3d8f[_0xaa24('0x3c')];_0x326418<_0x544d22;_0x326418++){_0xf4a391={'ProjectId':_0x4d8e91[_0xaa24('0x55')]['id'],'SessionId':_0x4a3d8f[_0x326418]['id'],'StartTime':moment(_0x4a3d8f[_0x326418][_0xaa24('0x67')])[_0xaa24('0x6b')](_0xaa24('0x6c'))};for(var _0x11e775=0x0,_0x245451=_0x12badb['length'];_0x11e775<_0x245451;_0x11e775++){if(_0x12badb[_0x11e775][_0xaa24('0x6d')]==_0x4a3d8f[_0x326418]['id']&&_0x2eeb89['hasOwnProperty'](_0x12badb[_0x11e775][_0xaa24('0x69')])){_0xf4a391[_0x2eeb89[_0x12badb[_0x11e775][_0xaa24('0x69')]]]=_0x12badb[_0x11e775]['answer'];}}for(var _0x3e2d78 in _0x2eeb89){if(!_0xf4a391[_0xaa24('0x3d')](_0x2eeb89[_0x3e2d78])){_0xf4a391[_0x2eeb89[_0x3e2d78]]=null;}}_0x42168f[_0xaa24('0x6e')](_0xf4a391);}return _0x42168f;}})[_0xaa24('0x26')](function(_0x5af1c3){if(!_[_0xaa24('0x6f')](_0x5af1c3)){var _0x128104=toCsv(_0x5af1c3);var _0x4832b0=Date[_0xaa24('0x70')]();fs[_0xaa24('0x71')](util[_0xaa24('0x6b')](_0xaa24('0x72'),_0x4d8e91[_0xaa24('0x55')]['id'],_0x4832b0),_0x128104);_0x4c972f[_0xaa24('0x73')]('Content-disposition',_0xaa24('0x74')+util[_0xaa24('0x6b')](_0xaa24('0x75'),_0x4d8e91[_0xaa24('0x55')]['id'],_0x4832b0));_0x4c972f[_0xaa24('0x73')](_0xaa24('0x76'),_0xaa24('0x77'));return _0x4c972f[_0xaa24('0x78')](util[_0xaa24('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4d8e91['params']['id'],_0x4832b0));}else{return _0x4c972f[_0xaa24('0x1a')](0xcc);}})[_0xaa24('0x52')](handleError(_0x4c972f,null));}; \ No newline at end of file +var _0x40a3=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','include','options','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','nolimit','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','getSummary','starttime','JscriptyQuestionReport','-createdAt','hasOwnProperty','questionId','question','format','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','request-promise','bluebird','mustache','util','path'];(function(_0x3b2573,_0x3c93f0){var _0xceb236=function(_0x67dc6){while(--_0x67dc6){_0x3b2573['push'](_0x3b2573['shift']());}};_0xceb236(++_0x3c93f0);}(_0x40a3,0x153));var _0x340a=function(_0x423da1,_0x596d06){_0x423da1=_0x423da1-0x0;var _0xe6eeaf=_0x40a3[_0x423da1];return _0xe6eeaf;};'use strict';var emlformat=require(_0x340a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x340a('0x1'));var moment=require('moment');var BPromise=require(_0x340a('0x2'));var Mustache=require(_0x340a('0x3'));var util=require(_0x340a('0x4'));var path=require(_0x340a('0x5'));var sox=require(_0x340a('0x6'));var csv=require(_0x340a('0x7'));var ejs=require(_0x340a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x340a('0x9'));var squel=require(_0x340a('0xa'));var crypto=require('crypto');var jsforce=require(_0x340a('0xb'));var deskjs=require(_0x340a('0xc'));var toCsv=require(_0x340a('0x7'));var querystring=require(_0x340a('0xd'));var Papa=require(_0x340a('0xe'));var Redis=require('ioredis');var authService=require(_0x340a('0xf'));var qs=require(_0x340a('0x10'));var as=require(_0x340a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x340a('0x12'))('api');var utils=require(_0x340a('0x13'));var config=require(_0x340a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x340a('0x15'))['db'];function respondWithStatusCode(_0x45b078,_0x315bc7){_0x315bc7=_0x315bc7||0xcc;return function(_0x3e7b35){if(_0x3e7b35){return _0x45b078[_0x340a('0x16')](_0x315bc7);}return _0x45b078[_0x340a('0x17')](_0x315bc7)[_0x340a('0x18')]();};}function respondWithResult(_0x393484,_0x2f9105){_0x2f9105=_0x2f9105||0xc8;return function(_0x150fe7){if(_0x150fe7){return _0x393484[_0x340a('0x17')](_0x2f9105)[_0x340a('0x19')](_0x150fe7);}};}function respondWithFilteredResult(_0xa1b711,_0xe93d15){return function(_0x435879){if(_0x435879){var _0x4caee8=typeof _0xe93d15[_0x340a('0x1a')]==='undefined'&&typeof _0xe93d15['limit']===_0x340a('0x1b');var _0x1a2ab1=_0x435879[_0x340a('0x1c')];var _0x18c94d=_0x4caee8?0x0:_0xe93d15[_0x340a('0x1a')];var _0x4587f7=_0x4caee8?_0x435879[_0x340a('0x1c')]:_0xe93d15[_0x340a('0x1a')]+_0xe93d15[_0x340a('0x1d')];var _0x29da7e;if(_0x4587f7>=_0x1a2ab1){_0x4587f7=_0x1a2ab1;_0x29da7e=0xc8;}else{_0x29da7e=0xce;}_0xa1b711['status'](_0x29da7e);return _0xa1b711[_0x340a('0x1e')]('Content-Range',_0x18c94d+'-'+_0x4587f7+'/'+_0x1a2ab1)[_0x340a('0x19')](_0x435879);}return null;};}function patchUpdates(_0x30f383){return function(_0x24c49e){try{jsonpatch[_0x340a('0x1f')](_0x24c49e,_0x30f383,!![]);}catch(_0x5b3aeb){return BPromise['reject'](_0x5b3aeb);}return _0x24c49e[_0x340a('0x20')]();};}function saveUpdates(_0xddb829,_0x4a8c22){return function(_0x18fe5d){if(_0x18fe5d){return _0x18fe5d[_0x340a('0x21')](_0xddb829)[_0x340a('0x22')](function(_0x47a572){return _0x47a572;});}return null;};}function removeEntity(_0x5b4e51,_0x3b3ada){return function(_0xf0fd20){if(_0xf0fd20){return _0xf0fd20['destroy']()[_0x340a('0x22')](function(){var _0x2ca1d9=_0xf0fd20[_0x340a('0x23')]({'plain':!![]});var _0x12bb94=_0x340a('0x24');return db[_0x340a('0x25')][_0x340a('0x26')]({'where':{'type':_0x12bb94,'resourceId':_0x2ca1d9['id']}})[_0x340a('0x22')](function(){return _0xf0fd20;});})[_0x340a('0x22')](function(){_0x5b4e51['status'](0xcc)[_0x340a('0x18')]();});}};}function handleEntityNotFound(_0x4c59ff,_0x259c95){return function(_0x4337f7){if(!_0x4337f7){_0x4c59ff['sendStatus'](0x194);}return _0x4337f7;};}function handleError(_0x5226c6,_0x52399d){_0x52399d=_0x52399d||0x1f4;return function(_0x151a15){logger[_0x340a('0x27')](_0x151a15[_0x340a('0x28')]);if(_0x151a15['name']){delete _0x151a15[_0x340a('0x29')];}_0x5226c6[_0x340a('0x17')](_0x52399d)['send'](_0x151a15);};}exports[_0x340a('0x2a')]=function(_0x3f2157,_0x233f65){var _0x31cc57={},_0x3ad80f={},_0x40a061={'count':0x0,'rows':[]};var _0x50646e=_[_0x340a('0x2b')](db[_0x340a('0x2c')][_0x340a('0x2d')],function(_0x40eed6){return{'name':_0x40eed6[_0x340a('0x2e')],'type':_0x40eed6[_0x340a('0x2f')][_0x340a('0x30')]};});_0x3ad80f[_0x340a('0x31')]=_[_0x340a('0x2b')](_0x50646e,_0x340a('0x29'));_0x3ad80f['query']=_[_0x340a('0x32')](_0x3f2157[_0x340a('0x33')]);_0x3ad80f[_0x340a('0x34')]=_[_0x340a('0x35')](_0x3ad80f['model'],_0x3ad80f[_0x340a('0x33')]);_0x31cc57['attributes']=_[_0x340a('0x35')](_0x3ad80f['model'],qs[_0x340a('0x36')](_0x3f2157['query']['fields']));_0x31cc57[_0x340a('0x37')]=_0x31cc57['attributes'][_0x340a('0x38')]?_0x31cc57[_0x340a('0x37')]:_0x3ad80f[_0x340a('0x31')];if(!_0x3f2157[_0x340a('0x33')]['hasOwnProperty']('nolimit')){_0x31cc57['limit']=qs[_0x340a('0x1d')](_0x3f2157[_0x340a('0x33')]['limit']);_0x31cc57['offset']=qs[_0x340a('0x1a')](_0x3f2157[_0x340a('0x33')]['offset']);}_0x31cc57[_0x340a('0x39')]=qs[_0x340a('0x3a')](_0x3f2157[_0x340a('0x33')][_0x340a('0x3a')]);_0x31cc57[_0x340a('0x3b')]=qs[_0x340a('0x34')](_[_0x340a('0x3c')](_0x3f2157[_0x340a('0x33')],_0x3ad80f[_0x340a('0x34')]),_0x50646e);if(_0x3f2157[_0x340a('0x33')][_0x340a('0x3d')]){_0x31cc57[_0x340a('0x3b')]=_[_0x340a('0x3e')](_0x31cc57['where'],{'$or':_[_0x340a('0x2b')](_0x50646e,function(_0x2f92a1){if(_0x2f92a1[_0x340a('0x2f')]!==_0x340a('0x3f')){var _0xfb41f9={};_0xfb41f9[_0x2f92a1[_0x340a('0x29')]]={'$like':'%'+_0x3f2157[_0x340a('0x33')][_0x340a('0x3d')]+'%'};return _0xfb41f9;}})});}_0x31cc57=_[_0x340a('0x3e')]({},_0x31cc57,_0x3f2157['options']);var _0x102bf9={'where':_0x31cc57[_0x340a('0x3b')]};return db['JscriptyProject'][_0x340a('0x1c')](_0x102bf9)[_0x340a('0x22')](function(_0x2414b7){_0x40a061[_0x340a('0x1c')]=_0x2414b7;if(_0x3f2157['query'][_0x340a('0x40')]){_0x31cc57['include']=[{'all':!![]}];}return db[_0x340a('0x2c')][_0x340a('0x41')](_0x31cc57);})[_0x340a('0x22')](function(_0x53f628){_0x40a061[_0x340a('0x42')]=_0x53f628;return _0x40a061;})[_0x340a('0x22')](respondWithFilteredResult(_0x233f65,_0x31cc57))[_0x340a('0x43')](handleError(_0x233f65,null));};exports['show']=function(_0x4b63ea,_0x1fcdf7){var _0x39a26d={'raw':![],'where':{'id':_0x4b63ea[_0x340a('0x44')]['id']}},_0x56d421={};_0x56d421[_0x340a('0x31')]=_[_0x340a('0x32')](db[_0x340a('0x2c')][_0x340a('0x2d')]);_0x56d421['query']=_[_0x340a('0x32')](_0x4b63ea[_0x340a('0x33')]);_0x56d421[_0x340a('0x34')]=_[_0x340a('0x35')](_0x56d421[_0x340a('0x31')],_0x56d421[_0x340a('0x33')]);_0x39a26d[_0x340a('0x37')]=_[_0x340a('0x35')](_0x56d421[_0x340a('0x31')],qs[_0x340a('0x36')](_0x4b63ea['query'][_0x340a('0x36')]));_0x39a26d[_0x340a('0x37')]=_0x39a26d[_0x340a('0x37')]['length']?_0x39a26d[_0x340a('0x37')]:_0x56d421[_0x340a('0x31')];if(_0x4b63ea[_0x340a('0x33')]['includeAll']){_0x39a26d['include']=[{'all':!![]}];}_0x39a26d=_[_0x340a('0x3e')]({},_0x39a26d,_0x4b63ea['options']);return db[_0x340a('0x2c')][_0x340a('0x45')](_0x39a26d)[_0x340a('0x22')](handleEntityNotFound(_0x1fcdf7,null))[_0x340a('0x22')](respondWithResult(_0x1fcdf7,null))[_0x340a('0x43')](handleError(_0x1fcdf7,null));};exports[_0x340a('0x46')]=function(_0x40b124,_0xe3ff17){return db[_0x340a('0x2c')]['create'](_0x40b124[_0x340a('0x47')],{})['then'](function(_0x254fd2){var _0x2fe3c5=_0x40b124[_0x340a('0x48')][_0x340a('0x23')]({'plain':!![]});if(!_0x2fe3c5)throw new Error(_0x340a('0x49'));if(_0x2fe3c5[_0x340a('0x4a')]===_0x340a('0x48')){var _0x217493=_0x254fd2[_0x340a('0x23')]({'plain':!![]});var _0x4bf599=_0x340a('0x24');return db[_0x340a('0x4b')][_0x340a('0x45')]({'where':{'name':_0x4bf599,'userProfileId':_0x2fe3c5[_0x340a('0x4c')]},'raw':!![]})[_0x340a('0x22')](function(_0x554e3f){if(_0x554e3f&&_0x554e3f[_0x340a('0x4d')]===0x0){return db[_0x340a('0x25')][_0x340a('0x46')]({'name':_0x217493[_0x340a('0x29')],'resourceId':_0x217493['id'],'type':_0x554e3f[_0x340a('0x29')],'sectionId':_0x554e3f['id']},{})[_0x340a('0x22')](function(){return _0x254fd2;});}else{return _0x254fd2;}})[_0x340a('0x43')](function(_0x567bc7){logger[_0x340a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x567bc7);throw _0x567bc7;});}return _0x254fd2;})[_0x340a('0x22')](respondWithResult(_0xe3ff17,0xc9))['catch'](handleError(_0xe3ff17,null));};exports['clone']=function(_0x33019f,_0x54f539){var _0xd32403={'where':{'id':_0x33019f[_0x340a('0x44')]['id']}},_0x1067f6={};_0x1067f6['model']=_['keys'](db[_0x340a('0x2c')][_0x340a('0x2d')]);_0xd32403[_0x340a('0x37')]=_[_0x340a('0x35')](_0x1067f6[_0x340a('0x31')],qs[_0x340a('0x36')](_0x33019f[_0x340a('0x33')][_0x340a('0x36')]));_0xd32403[_0x340a('0x37')]=_0xd32403['attributes'][_0x340a('0x38')]?_0xd32403['attributes']:_0x1067f6[_0x340a('0x31')];if(_0x33019f['query'][_0x340a('0x40')]){_0xd32403[_0x340a('0x4e')]=[{'all':!![]}];}_0xd32403=_['merge']({},_0xd32403,_0x33019f[_0x340a('0x4f')]);return db[_0x340a('0x2c')][_0x340a('0x45')](_0xd32403)['then'](handleEntityNotFound(_0x54f539,null))[_0x340a('0x22')](function(_0x1e31e0){if(_0x1e31e0){var _0x4d3470=_0x1e31e0[_0x340a('0x23')]({'plain':!![]});_0x4d3470=qs[_0x340a('0x50')](_0x4d3470,['id',_0x340a('0x51'),_0x340a('0x52')]);_0x33019f[_0x340a('0x47')]=_[_0x340a('0x50')](_0x33019f[_0x340a('0x47')],['id',_0x340a('0x51'),_0x340a('0x52')]);return db[_0x340a('0x2c')][_0x340a('0x46')](_[_0x340a('0x3e')](_0x4d3470,_0x33019f[_0x340a('0x47')]),{'include':_0x33019f['query'][_0x340a('0x40')]?[{'all':!![]}]:undefined})[_0x340a('0x22')](function(_0x433cf0){var _0x23cadf=_0x33019f[_0x340a('0x48')][_0x340a('0x23')]({'plain':!![]});if(!_0x23cadf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23cadf[_0x340a('0x4a')]==='user'){var _0x467700=_0x433cf0[_0x340a('0x23')]({'plain':!![]});var _0x374319=_0x340a('0x24');return db[_0x340a('0x4b')][_0x340a('0x45')]({'where':{'name':_0x374319,'userProfileId':_0x23cadf[_0x340a('0x4c')]},'raw':!![]})[_0x340a('0x22')](function(_0x42e67e){if(_0x42e67e&&_0x42e67e[_0x340a('0x4d')]===0x0){return db[_0x340a('0x25')]['create']({'name':_0x467700[_0x340a('0x29')],'resourceId':_0x467700['id'],'type':_0x42e67e[_0x340a('0x29')],'sectionId':_0x42e67e['id']},{})[_0x340a('0x22')](function(){return _0x433cf0;});}else{return _0x433cf0;}})['catch'](function(_0xc47389){logger[_0x340a('0x27')](_0x340a('0x53'),_0xc47389);throw _0xc47389;});}return _0x433cf0;});}})['then'](respondWithResult(_0x54f539,0xc9))[_0x340a('0x43')](handleError(_0x54f539,null));};exports[_0x340a('0x21')]=function(_0x24bd9b,_0x19eee5){if(_0x24bd9b[_0x340a('0x47')]['id']){delete _0x24bd9b['body']['id'];}return db[_0x340a('0x2c')][_0x340a('0x45')]({'where':{'id':_0x24bd9b[_0x340a('0x44')]['id']}})[_0x340a('0x22')](handleEntityNotFound(_0x19eee5,null))['then'](saveUpdates(_0x24bd9b['body'],null))['then'](respondWithResult(_0x19eee5,null))['catch'](handleError(_0x19eee5,null));};exports[_0x340a('0x26')]=function(_0x1d083a,_0x3c02fa){return db[_0x340a('0x2c')][_0x340a('0x45')]({'where':{'id':_0x1d083a[_0x340a('0x44')]['id']}})[_0x340a('0x22')](handleEntityNotFound(_0x3c02fa,null))[_0x340a('0x22')](removeEntity(_0x3c02fa,null))[_0x340a('0x43')](handleError(_0x3c02fa,null));};exports[_0x340a('0x54')]=function(_0x26ecc9,_0x475003,_0x3f2c2a){var _0x246d96={'raw':!![],'where':{}};var _0x16d8e7={};var _0x509333={'count':0x0,'rows':[]};return db[_0x340a('0x2c')]['findOne']({'where':{'id':_0x26ecc9[_0x340a('0x44')]['id']}})[_0x340a('0x22')](handleEntityNotFound(_0x475003,null))[_0x340a('0x22')](function(_0x1b5ef4){if(_0x1b5ef4){_0x16d8e7['model']=_[_0x340a('0x32')](db['JscriptySessionReport'][_0x340a('0x2d')]);_0x16d8e7[_0x340a('0x33')]=_[_0x340a('0x32')](_0x26ecc9[_0x340a('0x33')]);_0x16d8e7['filters']=_[_0x340a('0x35')](_0x16d8e7['model'],_0x16d8e7[_0x340a('0x33')]);_0x246d96[_0x340a('0x37')]=_['intersection'](_0x16d8e7[_0x340a('0x31')],qs[_0x340a('0x36')](_0x26ecc9[_0x340a('0x33')][_0x340a('0x36')]));_0x246d96[_0x340a('0x37')]=_0x246d96[_0x340a('0x37')][_0x340a('0x38')]?_0x246d96[_0x340a('0x37')]:_0x16d8e7[_0x340a('0x31')];if(!_0x26ecc9[_0x340a('0x33')]['hasOwnProperty'](_0x340a('0x55'))){_0x246d96[_0x340a('0x1d')]=qs[_0x340a('0x1d')](_0x26ecc9[_0x340a('0x33')][_0x340a('0x1d')]);_0x246d96[_0x340a('0x1a')]=qs[_0x340a('0x1a')](_0x26ecc9['query'][_0x340a('0x1a')]);}_0x246d96[_0x340a('0x39')]=qs[_0x340a('0x3a')](_0x26ecc9[_0x340a('0x33')]['sort']);_0x246d96[_0x340a('0x3b')]=qs[_0x340a('0x34')](_[_0x340a('0x3c')](_0x26ecc9[_0x340a('0x33')],_0x16d8e7[_0x340a('0x34')]));_0x246d96[_0x340a('0x3b')]['ProjectId']=_0x1b5ef4['id'];if(_0x26ecc9[_0x340a('0x33')][_0x340a('0x3d')]){_0x246d96[_0x340a('0x3b')]=_[_0x340a('0x3e')](_0x246d96['where'],{'$or':_['map'](_0x246d96[_0x340a('0x37')],function(_0x5020e2){var _0x562555={};_0x562555[_0x5020e2]={'$like':'%'+_0x26ecc9[_0x340a('0x33')][_0x340a('0x3d')]+'%'};return _0x562555;})});}_0x246d96=_['merge']({},_0x246d96,_0x26ecc9[_0x340a('0x4f')]);return db[_0x340a('0x56')][_0x340a('0x1c')]({'where':_0x246d96['where']})[_0x340a('0x22')](function(_0x422cf1){_0x509333[_0x340a('0x1c')]=_0x422cf1;if(_0x26ecc9[_0x340a('0x33')]['includeAll']){_0x246d96['include']=[{'all':!![]}];}return db[_0x340a('0x56')][_0x340a('0x41')](_0x246d96);})[_0x340a('0x22')](function(_0x271f15){_0x509333[_0x340a('0x42')]=_0x271f15;return _0x509333;});}})[_0x340a('0x22')](respondWithFilteredResult(_0x475003,_0x246d96))[_0x340a('0x43')](handleError(_0x475003,null));};exports[_0x340a('0x57')]=function(_0x25b57b,_0x317e8f,_0x4eebea){var _0x178c25={'raw':!![],'where':{}};var _0x309dc3={};var _0x180efd={'count':0x0,'rows':[]};return db[_0x340a('0x2c')][_0x340a('0x58')]({'where':{'id':_0x25b57b['params']['id']}})['then'](handleEntityNotFound(_0x317e8f,null))['then'](function(_0xb1780){if(_0xb1780){_0x309dc3[_0x340a('0x31')]=_[_0x340a('0x32')](db[_0x340a('0x59')]['rawAttributes']);_0x309dc3['query']=_['keys'](_0x25b57b[_0x340a('0x33')]);_0x309dc3[_0x340a('0x34')]=_[_0x340a('0x35')](_0x309dc3[_0x340a('0x31')],_0x309dc3[_0x340a('0x33')]);_0x178c25['attributes']=_[_0x340a('0x35')](_0x309dc3[_0x340a('0x31')],qs['fields'](_0x25b57b[_0x340a('0x33')][_0x340a('0x36')]));_0x178c25[_0x340a('0x37')]=_0x178c25[_0x340a('0x37')][_0x340a('0x38')]?_0x178c25[_0x340a('0x37')]:_0x309dc3[_0x340a('0x31')];if(!_0x25b57b['query']['hasOwnProperty'](_0x340a('0x55'))){_0x178c25[_0x340a('0x1d')]=qs[_0x340a('0x1d')](_0x25b57b[_0x340a('0x33')][_0x340a('0x1d')]);_0x178c25['offset']=qs['offset'](_0x25b57b[_0x340a('0x33')]['offset']);}_0x178c25[_0x340a('0x39')]=qs[_0x340a('0x3a')](_0x25b57b['query'][_0x340a('0x3a')]);_0x178c25[_0x340a('0x3b')]=qs[_0x340a('0x34')](_['pick'](_0x25b57b['query'],_0x309dc3[_0x340a('0x34')]));_0x178c25[_0x340a('0x3b')][_0x340a('0x5a')]=_0xb1780['id'];if(_0x25b57b[_0x340a('0x33')]['filter']){_0x178c25[_0x340a('0x3b')]=_[_0x340a('0x3e')](_0x178c25['where'],{'$or':_[_0x340a('0x2b')](_0x178c25[_0x340a('0x37')],function(_0x137ba8){var _0x51a0e1={};_0x51a0e1[_0x137ba8]={'$like':'%'+_0x25b57b[_0x340a('0x33')][_0x340a('0x3d')]+'%'};return _0x51a0e1;})});}_0x178c25=_[_0x340a('0x3e')]({},_0x178c25,_0x25b57b[_0x340a('0x4f')]);return db[_0x340a('0x59')][_0x340a('0x1c')]({'where':_0x178c25[_0x340a('0x3b')]})[_0x340a('0x22')](function(_0x328fe9){_0x180efd[_0x340a('0x1c')]=_0x328fe9;if(_0x25b57b[_0x340a('0x33')]['includeAll']){_0x178c25[_0x340a('0x4e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x340a('0x41')](_0x178c25);})['then'](function(_0x180855){_0x180efd[_0x340a('0x42')]=_0x180855;return _0x180efd;});}})[_0x340a('0x22')](respondWithFilteredResult(_0x317e8f,_0x178c25))[_0x340a('0x43')](handleError(_0x317e8f,null));};function char(_0x429a7a){return _0x340a('0x5b')===typeof _0x429a7a?String[_0x340a('0x5c')][_0x340a('0x1f')](null,arguments):_0x429a7a;}function needsEncapsulation(_0x49c4cb){return!!_0x49c4cb&&(_0x49c4cb[_0x340a('0x5d')]()[_0x340a('0x5e')](char(0xd))>=0x0||_0x49c4cb['toString']()[_0x340a('0x5e')](char(0xa))>=0x0||_0x49c4cb[_0x340a('0x5d')]()['indexOf'](char(0x2c))>=0x0||_0x49c4cb[_0x340a('0x5d')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x1a878b){var _0x613a1c=char(0x22),_0x23cceb='\x5c'+char(0x22),_0x588b13=_0x1a878b[_0x340a('0x5d')]()['replace'](new RegExp(_0x613a1c,'g'),_0x23cceb);return _0x613a1c+_0x588b13+_0x613a1c;}exports[_0x340a('0x5f')]=function(_0x470c4f,_0x23bcf9,_0x48b715){var _0x40ea49,_0x468bd8;var _0x4d7587={'where':{'ProjectId':_0x470c4f[_0x340a('0x44')]['id']}};if(_0x470c4f[_0x340a('0x33')]['startTime']){_0x4d7587['where'][_0x340a('0x60')]=JSON['parse'](_0x470c4f[_0x340a('0x33')]['startTime']);}return db[_0x340a('0x56')][_0x340a('0x41')](_0x4d7587)[_0x340a('0x22')](handleEntityNotFound(_0x23bcf9,null))['then'](function(_0x4964e8){if(_0x4964e8){_0x40ea49=_0x4964e8;return db[_0x340a('0x61')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x40ea49,'id')},'ProjectId':_0x470c4f[_0x340a('0x44')]['id']},'order':_0x340a('0x62')});}})[_0x340a('0x22')](handleEntityNotFound(_0x23bcf9,null))[_0x340a('0x22')](function(_0x3f7cc5){if(_0x3f7cc5){_0x468bd8=_0x3f7cc5;var _0x1d4a92={};for(var _0x790c37=0x0,_0x1d7195=_0x468bd8[_0x340a('0x38')];_0x790c37<_0x1d7195;_0x790c37++){if(!_0x1d4a92[_0x340a('0x63')](_0x468bd8[_0x790c37]['questionId'])){_0x1d4a92[_0x468bd8[_0x790c37][_0x340a('0x64')]]=needsEncapsulation(_0x468bd8[_0x790c37][_0x340a('0x65')])?encapsulate(_0x468bd8[_0x790c37][_0x340a('0x65')]):_0x468bd8[_0x790c37][_0x340a('0x65')];}}var _0x45c50b=[],_0x2ec0ee={};for(var _0xfc82e9=0x0,_0x4821af=_0x40ea49[_0x340a('0x38')];_0xfc82e9<_0x4821af;_0xfc82e9++){_0x2ec0ee={'ProjectId':_0x470c4f[_0x340a('0x44')]['id'],'SessionId':_0x40ea49[_0xfc82e9]['id'],'StartTime':moment(_0x40ea49[_0xfc82e9][_0x340a('0x60')])[_0x340a('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3ce423=0x0,_0x289511=_0x468bd8[_0x340a('0x38')];_0x3ce423<_0x289511;_0x3ce423++){if(_0x468bd8[_0x3ce423][_0x340a('0x67')]==_0x40ea49[_0xfc82e9]['id']&&_0x1d4a92[_0x340a('0x63')](_0x468bd8[_0x3ce423][_0x340a('0x64')])){_0x2ec0ee[_0x1d4a92[_0x468bd8[_0x3ce423][_0x340a('0x64')]]]=_0x468bd8[_0x3ce423][_0x340a('0x68')];}}for(var _0x421403 in _0x1d4a92){if(!_0x2ec0ee[_0x340a('0x63')](_0x1d4a92[_0x421403])){_0x2ec0ee[_0x1d4a92[_0x421403]]=null;}}_0x45c50b['push'](_0x2ec0ee);}return _0x45c50b;}})[_0x340a('0x22')](function(_0x9ddff5){if(!_[_0x340a('0x69')](_0x9ddff5)){var _0x47cd36=toCsv(_0x9ddff5);var _0x20e2b3=Date[_0x340a('0x6a')]();fs[_0x340a('0x6b')](util[_0x340a('0x66')](_0x340a('0x6c'),_0x470c4f[_0x340a('0x44')]['id'],_0x20e2b3),_0x47cd36);_0x23bcf9['setHeader'](_0x340a('0x6d'),'attachment;\x20filename='+util[_0x340a('0x66')](_0x340a('0x6e'),_0x470c4f[_0x340a('0x44')]['id'],_0x20e2b3));_0x23bcf9[_0x340a('0x6f')](_0x340a('0x70'),_0x340a('0x71'));return _0x23bcf9[_0x340a('0x72')](util['format'](_0x340a('0x6c'),_0x470c4f[_0x340a('0x44')]['id'],_0x20e2b3));}else{return _0x23bcf9['sendStatus'](0xcc);}})['catch'](handleError(_0x23bcf9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index f5fdfca..ebe058c 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 _0x5455=['util','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x1cac0d,_0x5282ff){var _0x166f0d=function(_0x1191c5){while(--_0x1191c5){_0x1cac0d['push'](_0x1cac0d['shift']());}};_0x166f0d(++_0x5282ff);}(_0x5455,0x197));var _0x5545=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5455[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require(_0x5545('0x0'));var logger=require(_0x5545('0x1'))(_0x5545('0x2'));var moment=require(_0x5545('0x3'));var BPromise=require(_0x5545('0x4'));var rp=require(_0x5545('0x5'));var fs=require('fs');var path=require(_0x5545('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5545('0x7'));module[_0x5545('0x8')]=function(_0x5c22f1,_0x5a6ac7){return _0x5c22f1[_0x5545('0x9')](_0x5545('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bd7=['JscriptyProject','../../config/logger','api','moment','request-promise','path','rimraf','./jscriptyProject.attributes'];(function(_0x34e46d,_0x5df86a){var _0x1cc6aa=function(_0x5a22f7){while(--_0x5a22f7){_0x34e46d['push'](_0x34e46d['shift']());}};_0x1cc6aa(++_0x5df86a);}(_0x3bd7,0x199));var _0x73bd=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x3bd7[_0x204eb7];return _0x37e444;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73bd('0x0'))(_0x73bd('0x1'));var moment=require(_0x73bd('0x2'));var BPromise=require('bluebird');var rp=require(_0x73bd('0x3'));var fs=require('fs');var path=require(_0x73bd('0x4'));var rimraf=require(_0x73bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x73bd('0x6'));module['exports']=function(_0xe20fe9,_0x1aa5e1){return _0xe20fe9['define'](_0x73bd('0x7'),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 0059984..861f01a 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x5cb367,_0x27ec9d){var _0x279365=function(_0x1d9d85){while(--_0x1d9d85){_0x5cb367['push'](_0x5cb367['shift']());}};_0x279365(++_0x27ec9d);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3a79c8,_0x3bd0ac){var _0x3eb881=function(_0x64fa15){while(--_0x64fa15){_0x3a79c8['push'](_0x3a79c8['shift']());}};_0x3eb881(++_0x3bd0ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index e16477b..62c18d2 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 _0xe127=['../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1fa666,_0x252c0e){var _0x3c862c=function(_0x4241d7){while(--_0x4241d7){_0x1fa666['push'](_0x1fa666['shift']());}};_0x3c862c(++_0x252c0e);}(_0xe127,0xbe));var _0x7e12=function(_0x232ded,_0x29b9f4){_0x232ded=_0x232ded-0x0;var _0x4ae3a0=_0xe127[_0x232ded];return _0x4ae3a0;};'use strict';var multer=require(_0x7e12('0x0'));var util=require(_0x7e12('0x1'));var path=require(_0x7e12('0x2'));var timeout=require(_0x7e12('0x3'));var express=require(_0x7e12('0x4'));var router=express['Router']();var fs_extra=require(_0x7e12('0x5'));var auth=require(_0x7e12('0x6'));var interaction=require(_0x7e12('0x7'));var config=require(_0x7e12('0x8'));var controller=require(_0x7e12('0x9'));router[_0x7e12('0xa')]('/',auth[_0x7e12('0xb')](),controller[_0x7e12('0xc')]);router[_0x7e12('0xa')](_0x7e12('0xd'),auth[_0x7e12('0xb')](),controller[_0x7e12('0xe')]);router[_0x7e12('0xa')](_0x7e12('0xf'),auth[_0x7e12('0xb')](),controller['show']);router[_0x7e12('0x10')]('/',auth[_0x7e12('0xb')](),controller[_0x7e12('0x11')]);router[_0x7e12('0x12')](_0x7e12('0xf'),auth[_0x7e12('0xb')](),controller[_0x7e12('0x13')]);router[_0x7e12('0x14')](_0x7e12('0xf'),auth[_0x7e12('0xb')](),controller[_0x7e12('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6bab=['isAuthenticated','show','post','put','update','delete','/:id','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index'];(function(_0x23018a,_0xc2ce29){var _0x295a10=function(_0x988d98){while(--_0x988d98){_0x23018a['push'](_0x23018a['shift']());}};_0x295a10(++_0xc2ce29);}(_0x6bab,0x1e5));var _0xb6ba=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x6bab[_0x648163];return _0x199d4d;};'use strict';var multer=require(_0xb6ba('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb6ba('0x1'));var express=require(_0xb6ba('0x2'));var router=express['Router']();var fs_extra=require(_0xb6ba('0x3'));var auth=require(_0xb6ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb6ba('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0xb6ba('0x6')]('/',auth['isAuthenticated'](),controller[_0xb6ba('0x7')]);router[_0xb6ba('0x6')]('/describe',auth[_0xb6ba('0x8')](),controller['describe']);router[_0xb6ba('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xb6ba('0x9')]);router[_0xb6ba('0xa')]('/',auth[_0xb6ba('0x8')](),controller['create']);router[_0xb6ba('0xb')]('/:id',auth[_0xb6ba('0x8')](),controller[_0xb6ba('0xc')]);router[_0xb6ba('0xd')](_0xb6ba('0xe'),auth[_0xb6ba('0x8')](),controller[_0xb6ba('0xf')]);module[_0xb6ba('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 193aab6..a8ab59e 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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x2cb1db,_0x360db9){_0x2cb1db=_0x2cb1db-0x0;var _0x39f318=_0x7a54[_0x2cb1db];return _0x39f318;};'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(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7a54,0x106));var _0x47a5=function(_0x462cc9,_0x33eeee){_0x462cc9=_0x462cc9-0x0;var _0x1e7802=_0x7a54[_0x462cc9];return _0x1e7802;};'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 e328ae3..cd95251 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 _0xbb22=['catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','find'];(function(_0x2fd481,_0x5f11de){var _0x4cf32f=function(_0x4afae4){while(--_0x4afae4){_0x2fd481['push'](_0x2fd481['shift']());}};_0x4cf32f(++_0x5f11de);}(_0xbb22,0xe8));var _0x2bb2=function(_0x1a7eff,_0x3c4d2c){_0x1a7eff=_0x1a7eff-0x0;var _0x5e9e63=_0xbb22[_0x1a7eff];return _0x5e9e63;};'use strict';var emlformat=require(_0x2bb2('0x0'));var rimraf=require(_0x2bb2('0x1'));var zipdir=require(_0x2bb2('0x2'));var jsonpatch=require(_0x2bb2('0x3'));var rp=require(_0x2bb2('0x4'));var moment=require(_0x2bb2('0x5'));var BPromise=require(_0x2bb2('0x6'));var Mustache=require(_0x2bb2('0x7'));var util=require(_0x2bb2('0x8'));var path=require(_0x2bb2('0x9'));var sox=require(_0x2bb2('0xa'));var csv=require(_0x2bb2('0xb'));var ejs=require(_0x2bb2('0xc'));var fs=require('fs');var fs_extra=require(_0x2bb2('0xd'));var _=require('lodash');var squel=require(_0x2bb2('0xe'));var crypto=require(_0x2bb2('0xf'));var jsforce=require(_0x2bb2('0x10'));var deskjs=require(_0x2bb2('0x11'));var toCsv=require(_0x2bb2('0xb'));var querystring=require(_0x2bb2('0x12'));var Papa=require(_0x2bb2('0x13'));var Redis=require(_0x2bb2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2bb2('0x15'));var as=require(_0x2bb2('0x16'));var hardwareService=require(_0x2bb2('0x17'));var logger=require(_0x2bb2('0x18'))('api');var utils=require(_0x2bb2('0x19'));var config=require(_0x2bb2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2bb2('0x1b'))['db'];function respondWithStatusCode(_0x34cf9c,_0x4f3a2a){_0x4f3a2a=_0x4f3a2a||0xcc;return function(_0x4c9810){if(_0x4c9810){return _0x34cf9c[_0x2bb2('0x1c')](_0x4f3a2a);}return _0x34cf9c[_0x2bb2('0x1d')](_0x4f3a2a)['end']();};}function respondWithResult(_0x19db69,_0x9b1865){_0x9b1865=_0x9b1865||0xc8;return function(_0x20b757){if(_0x20b757){return _0x19db69[_0x2bb2('0x1d')](_0x9b1865)['json'](_0x20b757);}};}function respondWithFilteredResult(_0x535ca9,_0x22f1eb){return function(_0x1b04ac){if(_0x1b04ac){var _0x5b983c=typeof _0x22f1eb[_0x2bb2('0x1e')]==='undefined'&&typeof _0x22f1eb['limit']==='undefined';var _0x20ebce=_0x1b04ac[_0x2bb2('0x1f')];var _0x4dfd62=_0x5b983c?0x0:_0x22f1eb['offset'];var _0x87cd04=_0x5b983c?_0x1b04ac[_0x2bb2('0x1f')]:_0x22f1eb['offset']+_0x22f1eb[_0x2bb2('0x20')];var _0x23f253;if(_0x87cd04>=_0x20ebce){_0x87cd04=_0x20ebce;_0x23f253=0xc8;}else{_0x23f253=0xce;}_0x535ca9['status'](_0x23f253);return _0x535ca9[_0x2bb2('0x21')](_0x2bb2('0x22'),_0x4dfd62+'-'+_0x87cd04+'/'+_0x20ebce)[_0x2bb2('0x23')](_0x1b04ac);}return null;};}function patchUpdates(_0x57df82){return function(_0x3fd04f){try{jsonpatch[_0x2bb2('0x24')](_0x3fd04f,_0x57df82,!![]);}catch(_0x577eef){return BPromise[_0x2bb2('0x25')](_0x577eef);}return _0x3fd04f['save']();};}function saveUpdates(_0x111353,_0x207518){return function(_0x3e5b5c){if(_0x3e5b5c){return _0x3e5b5c[_0x2bb2('0x26')](_0x111353)[_0x2bb2('0x27')](function(_0x188c04){return _0x188c04;});}return null;};}function removeEntity(_0x801a4c,_0x11073a){return function(_0x416540){if(_0x416540){return _0x416540[_0x2bb2('0x28')]()[_0x2bb2('0x27')](function(){_0x801a4c['status'](0xcc)[_0x2bb2('0x29')]();});}};}function handleEntityNotFound(_0x4074a3,_0x5f75df){return function(_0x10c31b){if(!_0x10c31b){_0x4074a3[_0x2bb2('0x1c')](0x194);}return _0x10c31b;};}function handleError(_0x46c299,_0x3eba55){_0x3eba55=_0x3eba55||0x1f4;return function(_0x32d17b){logger[_0x2bb2('0x2a')](_0x32d17b[_0x2bb2('0x2b')]);if(_0x32d17b[_0x2bb2('0x2c')]){delete _0x32d17b[_0x2bb2('0x2c')];}_0x46c299[_0x2bb2('0x1d')](_0x3eba55)[_0x2bb2('0x2d')](_0x32d17b);};}exports[_0x2bb2('0x2e')]=function(_0x53fcb4,_0x2370a4){var _0x17ff47={},_0x5104a1={},_0x31bdaa={'count':0x0,'rows':[]};var _0x46707e=_[_0x2bb2('0x2f')](db[_0x2bb2('0x30')][_0x2bb2('0x31')],function(_0x3c9c7a){return{'name':_0x3c9c7a[_0x2bb2('0x32')],'type':_0x3c9c7a[_0x2bb2('0x33')][_0x2bb2('0x34')]};});_0x5104a1[_0x2bb2('0x35')]=_[_0x2bb2('0x2f')](_0x46707e,'name');_0x5104a1[_0x2bb2('0x36')]=_['keys'](_0x53fcb4[_0x2bb2('0x36')]);_0x5104a1[_0x2bb2('0x37')]=_[_0x2bb2('0x38')](_0x5104a1[_0x2bb2('0x35')],_0x5104a1['query']);_0x17ff47['attributes']=_[_0x2bb2('0x38')](_0x5104a1['model'],qs['fields'](_0x53fcb4[_0x2bb2('0x36')][_0x2bb2('0x39')]));_0x17ff47[_0x2bb2('0x3a')]=_0x17ff47['attributes'][_0x2bb2('0x3b')]?_0x17ff47[_0x2bb2('0x3a')]:_0x5104a1[_0x2bb2('0x35')];if(!_0x53fcb4[_0x2bb2('0x36')][_0x2bb2('0x3c')](_0x2bb2('0x3d'))){_0x17ff47[_0x2bb2('0x20')]=qs[_0x2bb2('0x20')](_0x53fcb4[_0x2bb2('0x36')][_0x2bb2('0x20')]);_0x17ff47[_0x2bb2('0x1e')]=qs[_0x2bb2('0x1e')](_0x53fcb4['query'][_0x2bb2('0x1e')]);}_0x17ff47[_0x2bb2('0x3e')]=qs[_0x2bb2('0x3f')](_0x53fcb4[_0x2bb2('0x36')][_0x2bb2('0x3f')]);_0x17ff47[_0x2bb2('0x40')]=qs[_0x2bb2('0x37')](_['pick'](_0x53fcb4[_0x2bb2('0x36')],_0x5104a1['filters']),_0x46707e);if(_0x53fcb4['query'][_0x2bb2('0x41')]){_0x17ff47['where']=_[_0x2bb2('0x42')](_0x17ff47[_0x2bb2('0x40')],{'$or':_[_0x2bb2('0x2f')](_0x46707e,function(_0x151205){if(_0x151205[_0x2bb2('0x33')]!==_0x2bb2('0x43')){var _0x398d29={};_0x398d29[_0x151205[_0x2bb2('0x2c')]]={'$like':'%'+_0x53fcb4[_0x2bb2('0x36')][_0x2bb2('0x41')]+'%'};return _0x398d29;}})});}_0x17ff47=_[_0x2bb2('0x42')]({},_0x17ff47,_0x53fcb4[_0x2bb2('0x44')]);var _0x22aac8={'where':_0x17ff47[_0x2bb2('0x40')]};return db['JscriptyQuestionReport'][_0x2bb2('0x1f')](_0x22aac8)[_0x2bb2('0x27')](function(_0x2ee3ab){_0x31bdaa['count']=_0x2ee3ab;if(_0x53fcb4['query'][_0x2bb2('0x45')]){_0x17ff47[_0x2bb2('0x46')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x17ff47);})[_0x2bb2('0x27')](function(_0x183ddf){_0x31bdaa['rows']=_0x183ddf;return _0x31bdaa;})[_0x2bb2('0x27')](respondWithFilteredResult(_0x2370a4,_0x17ff47))['catch'](handleError(_0x2370a4,null));};exports['show']=function(_0x5f05fb,_0x6a1d14){var _0x2854c0={'raw':!![],'where':{'id':_0x5f05fb['params']['id']}},_0x3032a3={};_0x3032a3[_0x2bb2('0x35')]=_['keys'](db[_0x2bb2('0x30')]['rawAttributes']);_0x3032a3['query']=_['keys'](_0x5f05fb[_0x2bb2('0x36')]);_0x3032a3['filters']=_[_0x2bb2('0x38')](_0x3032a3['model'],_0x3032a3['query']);_0x2854c0['attributes']=_[_0x2bb2('0x38')](_0x3032a3['model'],qs[_0x2bb2('0x39')](_0x5f05fb[_0x2bb2('0x36')][_0x2bb2('0x39')]));_0x2854c0[_0x2bb2('0x3a')]=_0x2854c0[_0x2bb2('0x3a')]['length']?_0x2854c0[_0x2bb2('0x3a')]:_0x3032a3[_0x2bb2('0x35')];if(_0x5f05fb[_0x2bb2('0x36')][_0x2bb2('0x45')]){_0x2854c0[_0x2bb2('0x46')]=[{'all':!![]}];}_0x2854c0=_[_0x2bb2('0x42')]({},_0x2854c0,_0x5f05fb[_0x2bb2('0x44')]);return db[_0x2bb2('0x30')][_0x2bb2('0x47')](_0x2854c0)[_0x2bb2('0x27')](handleEntityNotFound(_0x6a1d14,null))['then'](respondWithResult(_0x6a1d14,null))[_0x2bb2('0x48')](handleError(_0x6a1d14,null));};exports['create']=function(_0xc0beeb,_0xf627db){return db[_0x2bb2('0x30')]['create'](_0xc0beeb[_0x2bb2('0x49')],{})['then'](respondWithResult(_0xf627db,0xc9))[_0x2bb2('0x48')](handleError(_0xf627db,null));};exports[_0x2bb2('0x26')]=function(_0x42d2a8,_0x19c2c9){if(_0x42d2a8['body']['id']){delete _0x42d2a8['body']['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x42d2a8['params']['id']}})[_0x2bb2('0x27')](handleEntityNotFound(_0x19c2c9,null))[_0x2bb2('0x27')](saveUpdates(_0x42d2a8[_0x2bb2('0x49')],null))[_0x2bb2('0x27')](respondWithResult(_0x19c2c9,null))[_0x2bb2('0x48')](handleError(_0x19c2c9,null));};exports[_0x2bb2('0x28')]=function(_0x4672aa,_0x3b5f7f){return db['JscriptyQuestionReport'][_0x2bb2('0x47')]({'where':{'id':_0x4672aa[_0x2bb2('0x4a')]['id']}})[_0x2bb2('0x27')](handleEntityNotFound(_0x3b5f7f,null))[_0x2bb2('0x27')](removeEntity(_0x3b5f7f,null))[_0x2bb2('0x48')](handleError(_0x3b5f7f,null));};exports[_0x2bb2('0x4b')]=function(_0x2b7f6b,_0x3b6b79){return db[_0x2bb2('0x30')]['describe']()[_0x2bb2('0x27')](respondWithResult(_0x3b6b79,null))[_0x2bb2('0x48')](handleError(_0x3b6b79,null));}; \ No newline at end of file +var _0x1937=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','JscriptyQuestionReport','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','then','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format'];(function(_0x18d6e4,_0x44cc4a){var _0x5e35f7=function(_0x33c9d0){while(--_0x33c9d0){_0x18d6e4['push'](_0x18d6e4['shift']());}};_0x5e35f7(++_0x44cc4a);}(_0x1937,0x9d));var _0x7193=function(_0x3ee378,_0x43a23a){_0x3ee378=_0x3ee378-0x0;var _0x1ac69a=_0x1937[_0x3ee378];return _0x1ac69a;};'use strict';var emlformat=require(_0x7193('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7193('0x1'));var jsonpatch=require(_0x7193('0x2'));var rp=require(_0x7193('0x3'));var moment=require(_0x7193('0x4'));var BPromise=require(_0x7193('0x5'));var Mustache=require(_0x7193('0x6'));var util=require(_0x7193('0x7'));var path=require(_0x7193('0x8'));var sox=require(_0x7193('0x9'));var csv=require(_0x7193('0xa'));var ejs=require(_0x7193('0xb'));var fs=require('fs');var fs_extra=require(_0x7193('0xc'));var _=require(_0x7193('0xd'));var squel=require(_0x7193('0xe'));var crypto=require(_0x7193('0xf'));var jsforce=require(_0x7193('0x10'));var deskjs=require(_0x7193('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7193('0x12'));var Papa=require(_0x7193('0x13'));var Redis=require(_0x7193('0x14'));var authService=require(_0x7193('0x15'));var qs=require(_0x7193('0x16'));var as=require(_0x7193('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7193('0x18'));var utils=require(_0x7193('0x19'));var config=require(_0x7193('0x1a'));var licenseUtil=require(_0x7193('0x1b'));var db=require(_0x7193('0x1c'))['db'];function respondWithStatusCode(_0x59b802,_0x3f63a0){_0x3f63a0=_0x3f63a0||0xcc;return function(_0x1ecc61){if(_0x1ecc61){return _0x59b802['sendStatus'](_0x3f63a0);}return _0x59b802[_0x7193('0x1d')](_0x3f63a0)[_0x7193('0x1e')]();};}function respondWithResult(_0x2d79f2,_0x41dfcd){_0x41dfcd=_0x41dfcd||0xc8;return function(_0x5eb2f5){if(_0x5eb2f5){return _0x2d79f2[_0x7193('0x1d')](_0x41dfcd)[_0x7193('0x1f')](_0x5eb2f5);}};}function respondWithFilteredResult(_0x5c318a,_0x1cd719){return function(_0x2aa700){if(_0x2aa700){var _0x1cccdf=typeof _0x1cd719[_0x7193('0x20')]==='undefined'&&typeof _0x1cd719[_0x7193('0x21')]===_0x7193('0x22');var _0x3d5ad1=_0x2aa700[_0x7193('0x23')];var _0x5a373a=_0x1cccdf?0x0:_0x1cd719[_0x7193('0x20')];var _0x3fb8ff=_0x1cccdf?_0x2aa700[_0x7193('0x23')]:_0x1cd719[_0x7193('0x20')]+_0x1cd719['limit'];var _0x398e2a;if(_0x3fb8ff>=_0x3d5ad1){_0x3fb8ff=_0x3d5ad1;_0x398e2a=0xc8;}else{_0x398e2a=0xce;}_0x5c318a[_0x7193('0x1d')](_0x398e2a);return _0x5c318a[_0x7193('0x24')](_0x7193('0x25'),_0x5a373a+'-'+_0x3fb8ff+'/'+_0x3d5ad1)['json'](_0x2aa700);}return null;};}function patchUpdates(_0x1f7bab){return function(_0x2c7dbb){try{jsonpatch[_0x7193('0x26')](_0x2c7dbb,_0x1f7bab,!![]);}catch(_0x2a9fa7){return BPromise[_0x7193('0x27')](_0x2a9fa7);}return _0x2c7dbb[_0x7193('0x28')]();};}function saveUpdates(_0xb19aa3,_0x1c4b76){return function(_0x3337d6){if(_0x3337d6){return _0x3337d6[_0x7193('0x29')](_0xb19aa3)['then'](function(_0x132ca2){return _0x132ca2;});}return null;};}function removeEntity(_0x178bed,_0x40b874){return function(_0x164fea){if(_0x164fea){return _0x164fea[_0x7193('0x2a')]()['then'](function(){_0x178bed['status'](0xcc)[_0x7193('0x1e')]();});}};}function handleEntityNotFound(_0x1631c5,_0x24b484){return function(_0x5ba18c){if(!_0x5ba18c){_0x1631c5['sendStatus'](0x194);}return _0x5ba18c;};}function handleError(_0x5a130f,_0x3512ea){_0x3512ea=_0x3512ea||0x1f4;return function(_0x2cf1e5){logger[_0x7193('0x2b')](_0x2cf1e5[_0x7193('0x2c')]);if(_0x2cf1e5[_0x7193('0x2d')]){delete _0x2cf1e5[_0x7193('0x2d')];}_0x5a130f['status'](_0x3512ea)['send'](_0x2cf1e5);};}exports[_0x7193('0x2e')]=function(_0x3f5b64,_0x14123e){var _0x7b241d={},_0x19bd05={},_0x104167={'count':0x0,'rows':[]};var _0x224f9c=_[_0x7193('0x2f')](db[_0x7193('0x30')]['rawAttributes'],function(_0x2ddf15){return{'name':_0x2ddf15['fieldName'],'type':_0x2ddf15[_0x7193('0x31')][_0x7193('0x32')]};});_0x19bd05[_0x7193('0x33')]=_['map'](_0x224f9c,_0x7193('0x2d'));_0x19bd05[_0x7193('0x34')]=_['keys'](_0x3f5b64[_0x7193('0x34')]);_0x19bd05['filters']=_[_0x7193('0x35')](_0x19bd05[_0x7193('0x33')],_0x19bd05[_0x7193('0x34')]);_0x7b241d['attributes']=_[_0x7193('0x35')](_0x19bd05[_0x7193('0x33')],qs[_0x7193('0x36')](_0x3f5b64[_0x7193('0x34')]['fields']));_0x7b241d[_0x7193('0x37')]=_0x7b241d[_0x7193('0x37')][_0x7193('0x38')]?_0x7b241d[_0x7193('0x37')]:_0x19bd05[_0x7193('0x33')];if(!_0x3f5b64[_0x7193('0x34')][_0x7193('0x39')](_0x7193('0x3a'))){_0x7b241d['limit']=qs['limit'](_0x3f5b64[_0x7193('0x34')][_0x7193('0x21')]);_0x7b241d['offset']=qs[_0x7193('0x20')](_0x3f5b64['query'][_0x7193('0x20')]);}_0x7b241d['order']=qs[_0x7193('0x3b')](_0x3f5b64['query'][_0x7193('0x3b')]);_0x7b241d[_0x7193('0x3c')]=qs[_0x7193('0x3d')](_[_0x7193('0x3e')](_0x3f5b64[_0x7193('0x34')],_0x19bd05[_0x7193('0x3d')]),_0x224f9c);if(_0x3f5b64['query'][_0x7193('0x3f')]){_0x7b241d[_0x7193('0x3c')]=_[_0x7193('0x40')](_0x7b241d[_0x7193('0x3c')],{'$or':_[_0x7193('0x2f')](_0x224f9c,function(_0x42bc0c){if(_0x42bc0c['type']!=='VIRTUAL'){var _0x363160={};_0x363160[_0x42bc0c['name']]={'$like':'%'+_0x3f5b64[_0x7193('0x34')][_0x7193('0x3f')]+'%'};return _0x363160;}})});}_0x7b241d=_[_0x7193('0x40')]({},_0x7b241d,_0x3f5b64[_0x7193('0x41')]);var _0x5697fa={'where':_0x7b241d['where']};return db[_0x7193('0x30')][_0x7193('0x23')](_0x5697fa)['then'](function(_0xac3e5e){_0x104167[_0x7193('0x23')]=_0xac3e5e;if(_0x3f5b64[_0x7193('0x34')][_0x7193('0x42')]){_0x7b241d[_0x7193('0x43')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x7193('0x44')](_0x7b241d);})[_0x7193('0x45')](function(_0x9f46b3){_0x104167['rows']=_0x9f46b3;return _0x104167;})[_0x7193('0x45')](respondWithFilteredResult(_0x14123e,_0x7b241d))[_0x7193('0x46')](handleError(_0x14123e,null));};exports[_0x7193('0x47')]=function(_0x4921f2,_0x13fe58){var _0x3747ff={'raw':!![],'where':{'id':_0x4921f2[_0x7193('0x48')]['id']}},_0xa59856={};_0xa59856['model']=_[_0x7193('0x49')](db[_0x7193('0x30')][_0x7193('0x4a')]);_0xa59856['query']=_[_0x7193('0x49')](_0x4921f2[_0x7193('0x34')]);_0xa59856[_0x7193('0x3d')]=_[_0x7193('0x35')](_0xa59856[_0x7193('0x33')],_0xa59856[_0x7193('0x34')]);_0x3747ff['attributes']=_[_0x7193('0x35')](_0xa59856[_0x7193('0x33')],qs[_0x7193('0x36')](_0x4921f2[_0x7193('0x34')][_0x7193('0x36')]));_0x3747ff[_0x7193('0x37')]=_0x3747ff[_0x7193('0x37')][_0x7193('0x38')]?_0x3747ff['attributes']:_0xa59856[_0x7193('0x33')];if(_0x4921f2[_0x7193('0x34')][_0x7193('0x42')]){_0x3747ff[_0x7193('0x43')]=[{'all':!![]}];}_0x3747ff=_['merge']({},_0x3747ff,_0x4921f2['options']);return db[_0x7193('0x30')][_0x7193('0x4b')](_0x3747ff)[_0x7193('0x45')](handleEntityNotFound(_0x13fe58,null))[_0x7193('0x45')](respondWithResult(_0x13fe58,null))['catch'](handleError(_0x13fe58,null));};exports[_0x7193('0x4c')]=function(_0x3225d6,_0x50152a){return db[_0x7193('0x30')][_0x7193('0x4c')](_0x3225d6[_0x7193('0x4d')],{})[_0x7193('0x45')](respondWithResult(_0x50152a,0xc9))[_0x7193('0x46')](handleError(_0x50152a,null));};exports['update']=function(_0x3f0618,_0x53a871){if(_0x3f0618[_0x7193('0x4d')]['id']){delete _0x3f0618['body']['id'];}return db[_0x7193('0x30')][_0x7193('0x4b')]({'where':{'id':_0x3f0618[_0x7193('0x48')]['id']}})['then'](handleEntityNotFound(_0x53a871,null))['then'](saveUpdates(_0x3f0618['body'],null))['then'](respondWithResult(_0x53a871,null))['catch'](handleError(_0x53a871,null));};exports['destroy']=function(_0x32fec8,_0x5efc48){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x32fec8[_0x7193('0x48')]['id']}})[_0x7193('0x45')](handleEntityNotFound(_0x5efc48,null))[_0x7193('0x45')](removeEntity(_0x5efc48,null))[_0x7193('0x46')](handleError(_0x5efc48,null));};exports[_0x7193('0x4e')]=function(_0x1b6285,_0x1fc67d){return db[_0x7193('0x30')][_0x7193('0x4e')]()[_0x7193('0x45')](respondWithResult(_0x1fc67d,null))['catch'](handleError(_0x1fc67d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index cea7fcf..b058718 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 _0xcf5d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util'];(function(_0x33c056,_0x40c095){var _0x31e666=function(_0x25beb3){while(--_0x25beb3){_0x33c056['push'](_0x33c056['shift']());}};_0x31e666(++_0x40c095);}(_0xcf5d,0x132));var _0xdcf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf5d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdcf5('0x0'));var util=require(_0xdcf5('0x1'));var logger=require(_0xdcf5('0x2'))(_0xdcf5('0x3'));var moment=require(_0xdcf5('0x4'));var BPromise=require(_0xdcf5('0x5'));var rp=require(_0xdcf5('0x6'));var fs=require('fs');var path=require(_0xdcf5('0x7'));var rimraf=require(_0xdcf5('0x8'));var config=require(_0xdcf5('0x9'));var attributes=require(_0xdcf5('0xa'));module[_0xdcf5('0xb')]=function(_0x1177c6,_0x196e3f){return _0x1177c6[_0xdcf5('0xc')]('JscriptyQuestionReport',attributes,{'tableName':_0xdcf5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa11=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_questions','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xaa11,0xd7));var _0x1aa1=function(_0x45494,_0x1040a5){_0x45494=_0x45494-0x0;var _0x2ee547=_0xaa11[_0x45494];return _0x2ee547;};'use strict';var _=require(_0x1aa1('0x0'));var util=require(_0x1aa1('0x1'));var logger=require('../../config/logger')(_0x1aa1('0x2'));var moment=require(_0x1aa1('0x3'));var BPromise=require(_0x1aa1('0x4'));var rp=require(_0x1aa1('0x5'));var fs=require('fs');var path=require(_0x1aa1('0x6'));var rimraf=require(_0x1aa1('0x7'));var config=require(_0x1aa1('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x1aa1('0x9')]=function(_0x48a815,_0x4a66a4){return _0x48a815[_0x1aa1('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x1aa1('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 429f9f0..ad236ac 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 _0x3ea2=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x1324bd,_0x2e28f7){var _0x3ddf48=function(_0x14843c){while(--_0x14843c){_0x1324bd['push'](_0x1324bd['shift']());}};_0x3ddf48(++_0x2e28f7);}(_0x3ea2,0x14b));var _0x23ea=function(_0x3cafb8,_0x32860e){_0x3cafb8=_0x3cafb8-0x0;var _0x4b7f85=_0x3ea2[_0x3cafb8];return _0x4b7f85;};'use strict';var _=require(_0x23ea('0x0'));var util=require(_0x23ea('0x1'));var moment=require(_0x23ea('0x2'));var BPromise=require(_0x23ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23ea('0x4'));var db=require(_0x23ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23ea('0x6'))(_0x23ea('0x7'));var config=require(_0x23ea('0x8'));var jayson=require(_0x23ea('0x9'));var client=jayson[_0x23ea('0xa')][_0x23ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e83de,_0x271a62,_0x293e5a){return new BPromise(function(_0x59f7da,_0xc3225c){return client['request'](_0x5e83de,_0x293e5a)[_0x23ea('0xc')](function(_0x5c5ae8){logger[_0x23ea('0xd')](_0x23ea('0xe'),_0x271a62,_0x23ea('0xf'));logger[_0x23ea('0x10')](_0x23ea('0x11'),_0x271a62,_0x23ea('0xf'),JSON['stringify'](_0x5c5ae8));if(_0x5c5ae8['error']){if(_0x5c5ae8['error'][_0x23ea('0x12')]===0x1f4){logger[_0x23ea('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x271a62,_0x5c5ae8[_0x23ea('0x13')][_0x23ea('0x14')]);return _0xc3225c(_0x5c5ae8[_0x23ea('0x13')][_0x23ea('0x14')]);}logger[_0x23ea('0x13')](_0x23ea('0xe'),_0x271a62,_0x5c5ae8[_0x23ea('0x13')][_0x23ea('0x14')]);return _0x59f7da(_0x5c5ae8[_0x23ea('0x13')]['message']);}else{logger[_0x23ea('0xd')](_0x23ea('0xe'),_0x271a62,_0x23ea('0xf'));_0x59f7da(_0x5c5ae8[_0x23ea('0x15')][_0x23ea('0x14')]);}})[_0x23ea('0x16')](function(_0xa5e43c){logger['error'](_0x23ea('0xe'),_0x271a62,_0xa5e43c);_0xc3225c(_0xa5e43c);});});} \ No newline at end of file +var _0xe2ac=['http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x30c7d6,_0x3177cf){var _0x207b5c=function(_0x2f9f57){while(--_0x2f9f57){_0x30c7d6['push'](_0x30c7d6['shift']());}};_0x207b5c(++_0x3177cf);}(_0xe2ac,0x1c3));var _0xce2a=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xe2ac[_0x5dc03e];return _0x466a07;};'use strict';var _=require(_0xce2a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xce2a('0x1'));var rs=require(_0xce2a('0x2'));var fs=require('fs');var Redis=require(_0xce2a('0x3'));var db=require(_0xce2a('0x4'))['db'];var utils=require(_0xce2a('0x5'));var logger=require(_0xce2a('0x6'))('rpc');var config=require(_0xce2a('0x7'));var jayson=require(_0xce2a('0x8'));var client=jayson['client'][_0xce2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a4a99,_0x39e073,_0x3432ec){return new BPromise(function(_0x2a92fa,_0x2c702a){return client[_0xce2a('0xa')](_0x2a4a99,_0x3432ec)[_0xce2a('0xb')](function(_0x40d801){logger[_0xce2a('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x39e073,_0xce2a('0xd'));logger[_0xce2a('0xe')](_0xce2a('0xf'),_0x39e073,'request\x20sent',JSON[_0xce2a('0x10')](_0x40d801));if(_0x40d801['error']){if(_0x40d801[_0xce2a('0x11')][_0xce2a('0x12')]===0x1f4){logger[_0xce2a('0x11')](_0xce2a('0x13'),_0x39e073,_0x40d801['error'][_0xce2a('0x14')]);return _0x2c702a(_0x40d801[_0xce2a('0x11')][_0xce2a('0x14')]);}logger['error'](_0xce2a('0x13'),_0x39e073,_0x40d801['error'][_0xce2a('0x14')]);return _0x2a92fa(_0x40d801[_0xce2a('0x11')][_0xce2a('0x14')]);}else{logger[_0xce2a('0xc')](_0xce2a('0x13'),_0x39e073,_0xce2a('0xd'));_0x2a92fa(_0x40d801[_0xce2a('0x15')]['message']);}})[_0xce2a('0x16')](function(_0x5c3247){logger[_0xce2a('0x11')](_0xce2a('0x13'),_0x39e073,_0x5c3247);_0x2c702a(_0x5c3247);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index c5b387f..2ba06cf 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 _0x8e01=['destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','describe','/:id','show','get','getQuestions','post','create','update','delete'];(function(_0x3c20c9,_0x49d60c){var _0x173dc3=function(_0x112999){while(--_0x112999){_0x3c20c9['push'](_0x3c20c9['shift']());}};_0x173dc3(++_0x49d60c);}(_0x8e01,0x6b));var _0x18e0=function(_0xfba8c5,_0x59f156){_0xfba8c5=_0xfba8c5-0x0;var _0x3d8c82=_0x8e01[_0xfba8c5];return _0x3d8c82;};'use strict';var multer=require('multer');var util=require(_0x18e0('0x0'));var path=require(_0x18e0('0x1'));var timeout=require(_0x18e0('0x2'));var express=require(_0x18e0('0x3'));var router=express[_0x18e0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x18e0('0x5'));var config=require(_0x18e0('0x6'));var controller=require(_0x18e0('0x7'));router['get']('/',auth[_0x18e0('0x8')](),controller[_0x18e0('0x9')]);router['get']('/describe',auth[_0x18e0('0x8')](),controller[_0x18e0('0xa')]);router['get'](_0x18e0('0xb'),auth[_0x18e0('0x8')](),controller[_0x18e0('0xc')]);router[_0x18e0('0xd')]('/:id/questions',auth[_0x18e0('0x8')](),controller[_0x18e0('0xe')]);router[_0x18e0('0xf')]('/',auth[_0x18e0('0x8')](),controller[_0x18e0('0x10')]);router['put'](_0x18e0('0xb'),auth[_0x18e0('0x8')](),controller[_0x18e0('0x11')]);router[_0x18e0('0x12')](_0x18e0('0xb'),auth[_0x18e0('0x8')](),controller[_0x18e0('0x13')]);module[_0x18e0('0x14')]=router; \ No newline at end of file +var _0xff56=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','show','/:id/questions','getQuestions','post','create','put','/:id','update','delete'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xff56,0x160));var _0x6ff5=function(_0x355b88,_0x2ae399){_0x355b88=_0x355b88-0x0;var _0xa40ccc=_0xff56[_0x355b88];return _0xa40ccc;};'use strict';var multer=require(_0x6ff5('0x0'));var util=require(_0x6ff5('0x1'));var path=require(_0x6ff5('0x2'));var timeout=require(_0x6ff5('0x3'));var express=require(_0x6ff5('0x4'));var router=express[_0x6ff5('0x5')]();var fs_extra=require(_0x6ff5('0x6'));var auth=require(_0x6ff5('0x7'));var interaction=require(_0x6ff5('0x8'));var config=require('../../config/environment');var controller=require(_0x6ff5('0x9'));router['get']('/',auth[_0x6ff5('0xa')](),controller[_0x6ff5('0xb')]);router[_0x6ff5('0xc')](_0x6ff5('0xd'),auth[_0x6ff5('0xa')](),controller['describe']);router['get']('/:id',auth[_0x6ff5('0xa')](),controller[_0x6ff5('0xe')]);router[_0x6ff5('0xc')](_0x6ff5('0xf'),auth[_0x6ff5('0xa')](),controller[_0x6ff5('0x10')]);router[_0x6ff5('0x11')]('/',auth[_0x6ff5('0xa')](),controller[_0x6ff5('0x12')]);router[_0x6ff5('0x13')](_0x6ff5('0x14'),auth[_0x6ff5('0xa')](),controller[_0x6ff5('0x15')]);router[_0x6ff5('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x6ff5('0x17')]);module[_0x6ff5('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 06d40ca..7a48e45 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 _0x9811=['STRING','BOOLEAN','sequelize','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2c6229,_0x31548f){var _0x4ce5ee=function(_0x17279a){while(--_0x17279a){_0x2c6229['push'](_0x2c6229['shift']());}};_0x4ce5ee(++_0x31548f);}(_0x9811,0x92));var _0x1981=function(_0x196ee8,_0xdb9c49){_0x196ee8=_0x196ee8-0x0;var _0x24bba1=_0x9811[_0x196ee8];return _0x24bba1;};'use strict';var moment=require('moment');var Sequelize=require(_0x1981('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x1981('0x1')],'set':function(_0x387f9d){this[_0x1981('0x2')](_0x1981('0x3'),_0x387f9d);this[_0x1981('0x2')](_0x1981('0x4'),moment()[_0x1981('0x5')](_0x1981('0x6')));}},'endtime':{'type':Sequelize[_0x1981('0x1')]},'membername':{'type':Sequelize[_0x1981('0x7')]},'projectname':{'type':Sequelize[_0x1981('0x7')]},'queue':{'type':Sequelize[_0x1981('0x7')]},'uniqueid':{'type':Sequelize[_0x1981('0x7')]},'calleridname':{'type':Sequelize[_0x1981('0x7')]},'calleridnum':{'type':Sequelize[_0x1981('0x7')]},'completed':{'type':Sequelize[_0x1981('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xf34f=['YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','starttime','setDataValue','endtime'];(function(_0x3f8ef3,_0x3d70fa){var _0x139f54=function(_0x168e9d){while(--_0x168e9d){_0x3f8ef3['push'](_0x3f8ef3['shift']());}};_0x139f54(++_0x3d70fa);}(_0xf34f,0x64));var _0xff34=function(_0x5b560e,_0x4b8328){_0x5b560e=_0x5b560e-0x0;var _0xe56212=_0xf34f[_0x5b560e];return _0xe56212;};'use strict';var moment=require(_0xff34('0x0'));var Sequelize=require('sequelize');module[_0xff34('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x36c919){this['setDataValue'](_0xff34('0x2'),_0x36c919);this[_0xff34('0x3')](_0xff34('0x4'),moment()['format'](_0xff34('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xff34('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xff34('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xff34('0x6')]},'calleridnum':{'type':Sequelize[_0xff34('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 0ba227b..a9c9007 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 _0x3ff8=['where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','create','find','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3ff8,0x142));var _0x83ff=function(_0xb54b31,_0x4ac97c){_0xb54b31=_0xb54b31-0x0;var _0x49d88b=_0x3ff8[_0xb54b31];return _0x49d88b;};'use strict';var emlformat=require(_0x83ff('0x0'));var rimraf=require(_0x83ff('0x1'));var zipdir=require(_0x83ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x83ff('0x3'));var BPromise=require(_0x83ff('0x4'));var Mustache=require(_0x83ff('0x5'));var util=require(_0x83ff('0x6'));var path=require('path');var sox=require(_0x83ff('0x7'));var csv=require(_0x83ff('0x8'));var ejs=require(_0x83ff('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x83ff('0xa'));var crypto=require(_0x83ff('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x83ff('0x8'));var querystring=require(_0x83ff('0xc'));var Papa=require(_0x83ff('0xd'));var Redis=require(_0x83ff('0xe'));var authService=require(_0x83ff('0xf'));var qs=require(_0x83ff('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83ff('0x11'));var logger=require('../../config/logger')(_0x83ff('0x12'));var utils=require(_0x83ff('0x13'));var config=require(_0x83ff('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x83ff('0x15'))['db'];function respondWithStatusCode(_0x3ccd07,_0x45cb44){_0x45cb44=_0x45cb44||0xcc;return function(_0x204718){if(_0x204718){return _0x3ccd07[_0x83ff('0x16')](_0x45cb44);}return _0x3ccd07[_0x83ff('0x17')](_0x45cb44)['end']();};}function respondWithResult(_0x2ebdb1,_0x464635){_0x464635=_0x464635||0xc8;return function(_0x7b9dea){if(_0x7b9dea){return _0x2ebdb1[_0x83ff('0x17')](_0x464635)[_0x83ff('0x18')](_0x7b9dea);}};}function respondWithFilteredResult(_0x2b9eb0,_0x5bfb93){return function(_0x1dc125){if(_0x1dc125){var _0x4853a1=typeof _0x5bfb93[_0x83ff('0x19')]===_0x83ff('0x1a')&&typeof _0x5bfb93['limit']==='undefined';var _0x10dd81=_0x1dc125['count'];var _0x549117=_0x4853a1?0x0:_0x5bfb93[_0x83ff('0x19')];var _0x293d30=_0x4853a1?_0x1dc125[_0x83ff('0x1b')]:_0x5bfb93['offset']+_0x5bfb93[_0x83ff('0x1c')];var _0x2bbba7;if(_0x293d30>=_0x10dd81){_0x293d30=_0x10dd81;_0x2bbba7=0xc8;}else{_0x2bbba7=0xce;}_0x2b9eb0[_0x83ff('0x17')](_0x2bbba7);return _0x2b9eb0[_0x83ff('0x1d')](_0x83ff('0x1e'),_0x549117+'-'+_0x293d30+'/'+_0x10dd81)['json'](_0x1dc125);}return null;};}function patchUpdates(_0xcd6a2){return function(_0x316000){try{jsonpatch['apply'](_0x316000,_0xcd6a2,!![]);}catch(_0x46068b){return BPromise[_0x83ff('0x1f')](_0x46068b);}return _0x316000['save']();};}function saveUpdates(_0x539e25,_0x52de1b){return function(_0x516287){if(_0x516287){return _0x516287[_0x83ff('0x20')](_0x539e25)[_0x83ff('0x21')](function(_0x2c70dd){return _0x2c70dd;});}return null;};}function removeEntity(_0x3d0ae5,_0x3d6cbc){return function(_0x5c597b){if(_0x5c597b){return _0x5c597b[_0x83ff('0x22')]()[_0x83ff('0x21')](function(){_0x3d0ae5['status'](0xcc)[_0x83ff('0x23')]();});}};}function handleEntityNotFound(_0x76c4db,_0x42c765){return function(_0x18428f){if(!_0x18428f){_0x76c4db[_0x83ff('0x16')](0x194);}return _0x18428f;};}function handleError(_0x4ab5d5,_0x54c863){_0x54c863=_0x54c863||0x1f4;return function(_0x24c963){logger[_0x83ff('0x24')](_0x24c963[_0x83ff('0x25')]);if(_0x24c963[_0x83ff('0x26')]){delete _0x24c963[_0x83ff('0x26')];}_0x4ab5d5[_0x83ff('0x17')](_0x54c863)[_0x83ff('0x27')](_0x24c963);};}exports[_0x83ff('0x28')]=function(_0x479e39,_0x4c272f){var _0x15ebaf={},_0x2e9867={},_0x5270d9={'count':0x0,'rows':[]};var _0x2d9f01=_['map'](db[_0x83ff('0x29')][_0x83ff('0x2a')],function(_0x14eab7){return{'name':_0x14eab7[_0x83ff('0x2b')],'type':_0x14eab7[_0x83ff('0x2c')]['key']};});_0x2e9867[_0x83ff('0x2d')]=_[_0x83ff('0x2e')](_0x2d9f01,_0x83ff('0x26'));_0x2e9867['query']=_[_0x83ff('0x2f')](_0x479e39[_0x83ff('0x30')]);_0x2e9867[_0x83ff('0x31')]=_[_0x83ff('0x32')](_0x2e9867[_0x83ff('0x2d')],_0x2e9867['query']);_0x15ebaf[_0x83ff('0x33')]=_[_0x83ff('0x32')](_0x2e9867[_0x83ff('0x2d')],qs[_0x83ff('0x34')](_0x479e39[_0x83ff('0x30')][_0x83ff('0x34')]));_0x15ebaf[_0x83ff('0x33')]=_0x15ebaf[_0x83ff('0x33')][_0x83ff('0x35')]?_0x15ebaf[_0x83ff('0x33')]:_0x2e9867['model'];if(!_0x479e39[_0x83ff('0x30')][_0x83ff('0x36')](_0x83ff('0x37'))){_0x15ebaf['limit']=qs[_0x83ff('0x1c')](_0x479e39[_0x83ff('0x30')]['limit']);_0x15ebaf['offset']=qs[_0x83ff('0x19')](_0x479e39[_0x83ff('0x30')]['offset']);}_0x15ebaf[_0x83ff('0x38')]=qs[_0x83ff('0x39')](_0x479e39['query'][_0x83ff('0x39')]);_0x15ebaf[_0x83ff('0x3a')]=qs[_0x83ff('0x31')](_['pick'](_0x479e39[_0x83ff('0x30')],_0x2e9867[_0x83ff('0x31')]),_0x2d9f01);if(_0x479e39[_0x83ff('0x30')][_0x83ff('0x3b')]){_0x15ebaf[_0x83ff('0x3a')]=_[_0x83ff('0x3c')](_0x15ebaf[_0x83ff('0x3a')],{'$or':_[_0x83ff('0x2e')](_0x2d9f01,function(_0x1853c0){if(_0x1853c0['type']!==_0x83ff('0x3d')){var _0xb3e31d={};_0xb3e31d[_0x1853c0[_0x83ff('0x26')]]={'$like':'%'+_0x479e39[_0x83ff('0x30')][_0x83ff('0x3b')]+'%'};return _0xb3e31d;}})});}_0x15ebaf=_[_0x83ff('0x3c')]({},_0x15ebaf,_0x479e39[_0x83ff('0x3e')]);var _0x23da15={'where':_0x15ebaf['where']};return db[_0x83ff('0x29')]['count'](_0x23da15)['then'](function(_0x551783){_0x5270d9['count']=_0x551783;if(_0x479e39['query'][_0x83ff('0x3f')]){_0x15ebaf[_0x83ff('0x40')]=[{'all':!![]}];}return db[_0x83ff('0x29')][_0x83ff('0x41')](_0x15ebaf);})['then'](function(_0x20138f){_0x5270d9['rows']=_0x20138f;return _0x5270d9;})['then'](respondWithFilteredResult(_0x4c272f,_0x15ebaf))[_0x83ff('0x42')](handleError(_0x4c272f,null));};exports['show']=function(_0x5c9078,_0x570561){var _0x2b27b8={'raw':!![],'where':{'id':_0x5c9078[_0x83ff('0x43')]['id']}},_0x12722d={};_0x12722d['model']=_[_0x83ff('0x2f')](db[_0x83ff('0x29')][_0x83ff('0x2a')]);_0x12722d['query']=_[_0x83ff('0x2f')](_0x5c9078[_0x83ff('0x30')]);_0x12722d[_0x83ff('0x31')]=_['intersection'](_0x12722d[_0x83ff('0x2d')],_0x12722d[_0x83ff('0x30')]);_0x2b27b8['attributes']=_[_0x83ff('0x32')](_0x12722d[_0x83ff('0x2d')],qs[_0x83ff('0x34')](_0x5c9078[_0x83ff('0x30')][_0x83ff('0x34')]));_0x2b27b8[_0x83ff('0x33')]=_0x2b27b8[_0x83ff('0x33')][_0x83ff('0x35')]?_0x2b27b8[_0x83ff('0x33')]:_0x12722d[_0x83ff('0x2d')];if(_0x5c9078[_0x83ff('0x30')][_0x83ff('0x3f')]){_0x2b27b8[_0x83ff('0x40')]=[{'all':!![]}];}_0x2b27b8=_[_0x83ff('0x3c')]({},_0x2b27b8,_0x5c9078[_0x83ff('0x3e')]);return db[_0x83ff('0x29')]['find'](_0x2b27b8)[_0x83ff('0x21')](handleEntityNotFound(_0x570561,null))['then'](respondWithResult(_0x570561,null))['catch'](handleError(_0x570561,null));};exports[_0x83ff('0x44')]=function(_0x25c315,_0x225288){return db[_0x83ff('0x29')]['create'](_0x25c315['body'],{})[_0x83ff('0x21')](respondWithResult(_0x225288,0xc9))[_0x83ff('0x42')](handleError(_0x225288,null));};exports[_0x83ff('0x20')]=function(_0x51cd8b,_0x199986){if(_0x51cd8b['body']['id']){delete _0x51cd8b['body']['id'];}return db[_0x83ff('0x29')][_0x83ff('0x45')]({'where':{'id':_0x51cd8b[_0x83ff('0x43')]['id']}})['then'](handleEntityNotFound(_0x199986,null))['then'](saveUpdates(_0x51cd8b[_0x83ff('0x46')],null))[_0x83ff('0x21')](respondWithResult(_0x199986,null))[_0x83ff('0x42')](handleError(_0x199986,null));};exports[_0x83ff('0x22')]=function(_0x5a5f37,_0x111956){return db['JscriptySessionReport'][_0x83ff('0x45')]({'where':{'id':_0x5a5f37[_0x83ff('0x43')]['id']}})[_0x83ff('0x21')](handleEntityNotFound(_0x111956,null))[_0x83ff('0x21')](removeEntity(_0x111956,null))[_0x83ff('0x42')](handleError(_0x111956,null));};exports[_0x83ff('0x47')]=function(_0x164744,_0x161edb){return db[_0x83ff('0x29')][_0x83ff('0x47')]()[_0x83ff('0x21')](respondWithResult(_0x161edb,null))[_0x83ff('0x42')](handleError(_0x161edb,null));};exports[_0x83ff('0x48')]=function(_0x21b594,_0x19eb52,_0x27f927){var _0x57e9da={'raw':!![],'where':{}};var _0x4e9502={};var _0x237f06={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x83ff('0x49')]({'where':{'id':_0x21b594['params']['id']}})[_0x83ff('0x21')](handleEntityNotFound(_0x19eb52,null))[_0x83ff('0x21')](function(_0x110dd3){if(_0x110dd3){_0x4e9502[_0x83ff('0x2d')]=_[_0x83ff('0x2f')](db[_0x83ff('0x4a')][_0x83ff('0x2a')]);_0x4e9502['query']=_[_0x83ff('0x2f')](_0x21b594['query']);_0x4e9502[_0x83ff('0x31')]=_[_0x83ff('0x32')](_0x4e9502[_0x83ff('0x2d')],_0x4e9502[_0x83ff('0x30')]);_0x57e9da['attributes']=_['intersection'](_0x4e9502['model'],qs[_0x83ff('0x34')](_0x21b594[_0x83ff('0x30')][_0x83ff('0x34')]));_0x57e9da[_0x83ff('0x33')]=_0x57e9da[_0x83ff('0x33')][_0x83ff('0x35')]?_0x57e9da[_0x83ff('0x33')]:_0x4e9502['model'];if(!_0x21b594['query'][_0x83ff('0x36')]('nolimit')){_0x57e9da[_0x83ff('0x1c')]=qs[_0x83ff('0x1c')](_0x21b594[_0x83ff('0x30')]['limit']);_0x57e9da['offset']=qs[_0x83ff('0x19')](_0x21b594['query'][_0x83ff('0x19')]);}_0x57e9da[_0x83ff('0x38')]=qs[_0x83ff('0x39')](_0x21b594['query'][_0x83ff('0x39')]);_0x57e9da[_0x83ff('0x3a')]=qs[_0x83ff('0x31')](_['pick'](_0x21b594[_0x83ff('0x30')],_0x4e9502[_0x83ff('0x31')]));_0x57e9da['where'][_0x83ff('0x4b')]=_0x110dd3['id'];if(_0x21b594['query'][_0x83ff('0x3b')]){_0x57e9da[_0x83ff('0x3a')]=_[_0x83ff('0x3c')](_0x57e9da[_0x83ff('0x3a')],{'$or':_['map'](_0x57e9da['attributes'],function(_0x58281a){var _0x2bedb2={};_0x2bedb2[_0x58281a]={'$like':'%'+_0x21b594[_0x83ff('0x30')]['filter']+'%'};return _0x2bedb2;})});}_0x57e9da=_[_0x83ff('0x3c')]({},_0x57e9da,_0x21b594['options']);return db[_0x83ff('0x4a')]['count']({'where':_0x57e9da[_0x83ff('0x3a')]})[_0x83ff('0x21')](function(_0x33647a){_0x237f06[_0x83ff('0x1b')]=_0x33647a;if(_0x21b594[_0x83ff('0x30')][_0x83ff('0x3f')]){_0x57e9da[_0x83ff('0x40')]=[{'all':!![]}];}return db[_0x83ff('0x4a')][_0x83ff('0x41')](_0x57e9da);})['then'](function(_0x25de9e){_0x237f06['rows']=_0x25de9e;return _0x237f06;});}})[_0x83ff('0x21')](respondWithFilteredResult(_0x19eb52,_0x57e9da))['catch'](handleError(_0x19eb52,null));}; \ No newline at end of file +var _0xcd1c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','JscriptySessionReport','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','include','rows','show','params','includeAll','find','create','body','catch','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','options','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2cff89,_0x3c953a){var _0x34298f=function(_0x5f4580){while(--_0x5f4580){_0x2cff89['push'](_0x2cff89['shift']());}};_0x34298f(++_0x3c953a);}(_0xcd1c,0x130));var _0xccd1=function(_0xf95355,_0x5ab11d){_0xf95355=_0xf95355-0x0;var _0x1108b1=_0xcd1c[_0xf95355];return _0x1108b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xccd1('0x0'));var zipdir=require(_0xccd1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccd1('0x2'));var moment=require('moment');var BPromise=require(_0xccd1('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xccd1('0x4'));var sox=require(_0xccd1('0x5'));var csv=require(_0xccd1('0x6'));var ejs=require(_0xccd1('0x7'));var fs=require('fs');var fs_extra=require(_0xccd1('0x8'));var _=require(_0xccd1('0x9'));var squel=require('squel');var crypto=require(_0xccd1('0xa'));var jsforce=require(_0xccd1('0xb'));var deskjs=require(_0xccd1('0xc'));var toCsv=require(_0xccd1('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xccd1('0xd'));var authService=require(_0xccd1('0xe'));var qs=require(_0xccd1('0xf'));var as=require(_0xccd1('0x10'));var hardwareService=require(_0xccd1('0x11'));var logger=require(_0xccd1('0x12'))('api');var utils=require(_0xccd1('0x13'));var config=require(_0xccd1('0x14'));var licenseUtil=require(_0xccd1('0x15'));var db=require(_0xccd1('0x16'))['db'];function respondWithStatusCode(_0x497d17,_0x523a7c){_0x523a7c=_0x523a7c||0xcc;return function(_0x1b0df5){if(_0x1b0df5){return _0x497d17[_0xccd1('0x17')](_0x523a7c);}return _0x497d17[_0xccd1('0x18')](_0x523a7c)[_0xccd1('0x19')]();};}function respondWithResult(_0x2e50b6,_0x3f37c5){_0x3f37c5=_0x3f37c5||0xc8;return function(_0x517848){if(_0x517848){return _0x2e50b6['status'](_0x3f37c5)[_0xccd1('0x1a')](_0x517848);}};}function respondWithFilteredResult(_0xea42af,_0x2d4cac){return function(_0x284631){if(_0x284631){var _0x390c6d=typeof _0x2d4cac[_0xccd1('0x1b')]===_0xccd1('0x1c')&&typeof _0x2d4cac[_0xccd1('0x1d')]===_0xccd1('0x1c');var _0x47fe14=_0x284631[_0xccd1('0x1e')];var _0x50dc0f=_0x390c6d?0x0:_0x2d4cac['offset'];var _0x41f2d6=_0x390c6d?_0x284631['count']:_0x2d4cac['offset']+_0x2d4cac[_0xccd1('0x1d')];var _0x35cfa0;if(_0x41f2d6>=_0x47fe14){_0x41f2d6=_0x47fe14;_0x35cfa0=0xc8;}else{_0x35cfa0=0xce;}_0xea42af[_0xccd1('0x18')](_0x35cfa0);return _0xea42af[_0xccd1('0x1f')](_0xccd1('0x20'),_0x50dc0f+'-'+_0x41f2d6+'/'+_0x47fe14)[_0xccd1('0x1a')](_0x284631);}return null;};}function patchUpdates(_0x2367c5){return function(_0x5ca03a){try{jsonpatch[_0xccd1('0x21')](_0x5ca03a,_0x2367c5,!![]);}catch(_0x3f11db){return BPromise['reject'](_0x3f11db);}return _0x5ca03a[_0xccd1('0x22')]();};}function saveUpdates(_0x3db2af,_0x463589){return function(_0x1489c6){if(_0x1489c6){return _0x1489c6[_0xccd1('0x23')](_0x3db2af)[_0xccd1('0x24')](function(_0x285b3c){return _0x285b3c;});}return null;};}function removeEntity(_0x137f3f,_0x4cd969){return function(_0x250f15){if(_0x250f15){return _0x250f15[_0xccd1('0x25')]()['then'](function(){_0x137f3f[_0xccd1('0x18')](0xcc)[_0xccd1('0x19')]();});}};}function handleEntityNotFound(_0x1bce14,_0x4daef1){return function(_0x404f80){if(!_0x404f80){_0x1bce14[_0xccd1('0x17')](0x194);}return _0x404f80;};}function handleError(_0x37daea,_0x1c9a7a){_0x1c9a7a=_0x1c9a7a||0x1f4;return function(_0x2d3f9b){logger[_0xccd1('0x26')](_0x2d3f9b[_0xccd1('0x27')]);if(_0x2d3f9b[_0xccd1('0x28')]){delete _0x2d3f9b[_0xccd1('0x28')];}_0x37daea[_0xccd1('0x18')](_0x1c9a7a)['send'](_0x2d3f9b);};}exports[_0xccd1('0x29')]=function(_0x1ac9dd,_0x36f8ca){var _0x3b55f7={},_0x2de133={},_0x26d699={'count':0x0,'rows':[]};var _0x59fde2=_['map'](db[_0xccd1('0x2a')][_0xccd1('0x2b')],function(_0x27bc89){return{'name':_0x27bc89[_0xccd1('0x2c')],'type':_0x27bc89['type'][_0xccd1('0x2d')]};});_0x2de133[_0xccd1('0x2e')]=_[_0xccd1('0x2f')](_0x59fde2,_0xccd1('0x28'));_0x2de133['query']=_[_0xccd1('0x30')](_0x1ac9dd['query']);_0x2de133[_0xccd1('0x31')]=_[_0xccd1('0x32')](_0x2de133['model'],_0x2de133[_0xccd1('0x33')]);_0x3b55f7[_0xccd1('0x34')]=_['intersection'](_0x2de133[_0xccd1('0x2e')],qs[_0xccd1('0x35')](_0x1ac9dd[_0xccd1('0x33')][_0xccd1('0x35')]));_0x3b55f7[_0xccd1('0x34')]=_0x3b55f7[_0xccd1('0x34')][_0xccd1('0x36')]?_0x3b55f7['attributes']:_0x2de133[_0xccd1('0x2e')];if(!_0x1ac9dd['query'][_0xccd1('0x37')](_0xccd1('0x38'))){_0x3b55f7['limit']=qs[_0xccd1('0x1d')](_0x1ac9dd[_0xccd1('0x33')][_0xccd1('0x1d')]);_0x3b55f7['offset']=qs[_0xccd1('0x1b')](_0x1ac9dd[_0xccd1('0x33')]['offset']);}_0x3b55f7[_0xccd1('0x39')]=qs[_0xccd1('0x3a')](_0x1ac9dd['query'][_0xccd1('0x3a')]);_0x3b55f7[_0xccd1('0x3b')]=qs['filters'](_[_0xccd1('0x3c')](_0x1ac9dd[_0xccd1('0x33')],_0x2de133[_0xccd1('0x31')]),_0x59fde2);if(_0x1ac9dd[_0xccd1('0x33')]['filter']){_0x3b55f7[_0xccd1('0x3b')]=_[_0xccd1('0x3d')](_0x3b55f7[_0xccd1('0x3b')],{'$or':_['map'](_0x59fde2,function(_0x1a21f){if(_0x1a21f[_0xccd1('0x3e')]!==_0xccd1('0x3f')){var _0x537ee4={};_0x537ee4[_0x1a21f[_0xccd1('0x28')]]={'$like':'%'+_0x1ac9dd[_0xccd1('0x33')][_0xccd1('0x40')]+'%'};return _0x537ee4;}})});}_0x3b55f7=_[_0xccd1('0x3d')]({},_0x3b55f7,_0x1ac9dd['options']);var _0x2a9a7e={'where':_0x3b55f7[_0xccd1('0x3b')]};return db[_0xccd1('0x2a')][_0xccd1('0x1e')](_0x2a9a7e)['then'](function(_0x441dd6){_0x26d699[_0xccd1('0x1e')]=_0x441dd6;if(_0x1ac9dd['query']['includeAll']){_0x3b55f7[_0xccd1('0x41')]=[{'all':!![]}];}return db[_0xccd1('0x2a')]['findAll'](_0x3b55f7);})[_0xccd1('0x24')](function(_0x3837de){_0x26d699[_0xccd1('0x42')]=_0x3837de;return _0x26d699;})[_0xccd1('0x24')](respondWithFilteredResult(_0x36f8ca,_0x3b55f7))['catch'](handleError(_0x36f8ca,null));};exports[_0xccd1('0x43')]=function(_0xeb979e,_0x1ec778){var _0x3d2c3b={'raw':!![],'where':{'id':_0xeb979e[_0xccd1('0x44')]['id']}},_0x3339f6={};_0x3339f6[_0xccd1('0x2e')]=_['keys'](db[_0xccd1('0x2a')][_0xccd1('0x2b')]);_0x3339f6[_0xccd1('0x33')]=_[_0xccd1('0x30')](_0xeb979e[_0xccd1('0x33')]);_0x3339f6[_0xccd1('0x31')]=_[_0xccd1('0x32')](_0x3339f6[_0xccd1('0x2e')],_0x3339f6['query']);_0x3d2c3b[_0xccd1('0x34')]=_[_0xccd1('0x32')](_0x3339f6[_0xccd1('0x2e')],qs[_0xccd1('0x35')](_0xeb979e[_0xccd1('0x33')][_0xccd1('0x35')]));_0x3d2c3b[_0xccd1('0x34')]=_0x3d2c3b['attributes'][_0xccd1('0x36')]?_0x3d2c3b[_0xccd1('0x34')]:_0x3339f6[_0xccd1('0x2e')];if(_0xeb979e['query'][_0xccd1('0x45')]){_0x3d2c3b[_0xccd1('0x41')]=[{'all':!![]}];}_0x3d2c3b=_[_0xccd1('0x3d')]({},_0x3d2c3b,_0xeb979e['options']);return db[_0xccd1('0x2a')][_0xccd1('0x46')](_0x3d2c3b)[_0xccd1('0x24')](handleEntityNotFound(_0x1ec778,null))['then'](respondWithResult(_0x1ec778,null))['catch'](handleError(_0x1ec778,null));};exports[_0xccd1('0x47')]=function(_0x379a82,_0x12719b){return db[_0xccd1('0x2a')][_0xccd1('0x47')](_0x379a82[_0xccd1('0x48')],{})['then'](respondWithResult(_0x12719b,0xc9))[_0xccd1('0x49')](handleError(_0x12719b,null));};exports[_0xccd1('0x23')]=function(_0x10d7e1,_0x2e4608){if(_0x10d7e1[_0xccd1('0x48')]['id']){delete _0x10d7e1[_0xccd1('0x48')]['id'];}return db[_0xccd1('0x2a')][_0xccd1('0x46')]({'where':{'id':_0x10d7e1['params']['id']}})[_0xccd1('0x24')](handleEntityNotFound(_0x2e4608,null))[_0xccd1('0x24')](saveUpdates(_0x10d7e1[_0xccd1('0x48')],null))[_0xccd1('0x24')](respondWithResult(_0x2e4608,null))[_0xccd1('0x49')](handleError(_0x2e4608,null));};exports['destroy']=function(_0x4fc2ab,_0x3a1973){return db['JscriptySessionReport'][_0xccd1('0x46')]({'where':{'id':_0x4fc2ab[_0xccd1('0x44')]['id']}})[_0xccd1('0x24')](handleEntityNotFound(_0x3a1973,null))[_0xccd1('0x24')](removeEntity(_0x3a1973,null))[_0xccd1('0x49')](handleError(_0x3a1973,null));};exports[_0xccd1('0x4a')]=function(_0x299272,_0x1876f5){return db['JscriptySessionReport'][_0xccd1('0x4a')]()['then'](respondWithResult(_0x1876f5,null))['catch'](handleError(_0x1876f5,null));};exports[_0xccd1('0x4b')]=function(_0x19249c,_0x15ef19,_0x5312e4){var _0x440fb1={'raw':!![],'where':{}};var _0x3609e3={};var _0x3f747a={'count':0x0,'rows':[]};return db[_0xccd1('0x2a')][_0xccd1('0x4c')]({'where':{'id':_0x19249c[_0xccd1('0x44')]['id']}})[_0xccd1('0x24')](handleEntityNotFound(_0x15ef19,null))['then'](function(_0x1be98f){if(_0x1be98f){_0x3609e3[_0xccd1('0x2e')]=_['keys'](db[_0xccd1('0x4d')][_0xccd1('0x2b')]);_0x3609e3['query']=_['keys'](_0x19249c['query']);_0x3609e3[_0xccd1('0x31')]=_[_0xccd1('0x32')](_0x3609e3[_0xccd1('0x2e')],_0x3609e3[_0xccd1('0x33')]);_0x440fb1[_0xccd1('0x34')]=_['intersection'](_0x3609e3[_0xccd1('0x2e')],qs[_0xccd1('0x35')](_0x19249c[_0xccd1('0x33')][_0xccd1('0x35')]));_0x440fb1[_0xccd1('0x34')]=_0x440fb1['attributes'][_0xccd1('0x36')]?_0x440fb1[_0xccd1('0x34')]:_0x3609e3['model'];if(!_0x19249c[_0xccd1('0x33')][_0xccd1('0x37')]('nolimit')){_0x440fb1[_0xccd1('0x1d')]=qs['limit'](_0x19249c[_0xccd1('0x33')][_0xccd1('0x1d')]);_0x440fb1[_0xccd1('0x1b')]=qs['offset'](_0x19249c[_0xccd1('0x33')][_0xccd1('0x1b')]);}_0x440fb1[_0xccd1('0x39')]=qs[_0xccd1('0x3a')](_0x19249c[_0xccd1('0x33')][_0xccd1('0x3a')]);_0x440fb1[_0xccd1('0x3b')]=qs[_0xccd1('0x31')](_[_0xccd1('0x3c')](_0x19249c[_0xccd1('0x33')],_0x3609e3[_0xccd1('0x31')]));_0x440fb1[_0xccd1('0x3b')][_0xccd1('0x4e')]=_0x1be98f['id'];if(_0x19249c[_0xccd1('0x33')][_0xccd1('0x40')]){_0x440fb1[_0xccd1('0x3b')]=_[_0xccd1('0x3d')](_0x440fb1[_0xccd1('0x3b')],{'$or':_['map'](_0x440fb1[_0xccd1('0x34')],function(_0x34c3e9){var _0x1c8377={};_0x1c8377[_0x34c3e9]={'$like':'%'+_0x19249c[_0xccd1('0x33')][_0xccd1('0x40')]+'%'};return _0x1c8377;})});}_0x440fb1=_[_0xccd1('0x3d')]({},_0x440fb1,_0x19249c[_0xccd1('0x4f')]);return db[_0xccd1('0x4d')][_0xccd1('0x1e')]({'where':_0x440fb1[_0xccd1('0x3b')]})[_0xccd1('0x24')](function(_0x2eb972){_0x3f747a[_0xccd1('0x1e')]=_0x2eb972;if(_0x19249c[_0xccd1('0x33')][_0xccd1('0x45')]){_0x440fb1[_0xccd1('0x41')]=[{'all':!![]}];}return db[_0xccd1('0x4d')]['findAll'](_0x440fb1);})[_0xccd1('0x24')](function(_0x39bdce){_0x3f747a[_0xccd1('0x42')]=_0x39bdce;return _0x3f747a;});}})[_0xccd1('0x24')](respondWithFilteredResult(_0x15ef19,_0x440fb1))['catch'](handleError(_0x15ef19,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index e75caea..f6792c4 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 _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x385713,_0xbe2a41){var _0x619260=function(_0x2c67cc){while(--_0x2c67cc){_0x385713['push'](_0x385713['shift']());}};_0x619260(++_0xbe2a41);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));module[_0xd7df('0xb')]=function(_0x36cf0f,_0x39ce98){return _0x36cf0f[_0xd7df('0xc')](_0xd7df('0xd'),attributes,{'tableName':_0xd7df('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25fa=['path','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3e8a52,_0x5df9fc){var _0x44b92f=function(_0x10451){while(--_0x10451){_0x3e8a52['push'](_0x3e8a52['shift']());}};_0x44b92f(++_0x5df9fc);}(_0x25fa,0x109));var _0xa25f=function(_0x56459d,_0x2f4c6e){_0x56459d=_0x56459d-0x0;var _0x4714e5=_0x25fa[_0x56459d];return _0x4714e5;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require('moment');var BPromise=require(_0xa25f('0x3'));var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa25f('0x6'));module['exports']=function(_0x2ea9ea,_0x3ab530){return _0x2ea9ea[_0xa25f('0x7')](_0xa25f('0x8'),attributes,{'tableName':_0xa25f('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 3e10200..76c3224 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 _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch'];(function(_0x262a27,_0x54d899){var _0x382363=function(_0x5d3d4c){while(--_0x5d3d4c){_0x262a27['push'](_0x262a27['shift']());}};_0x382363(++_0x54d899);}(_0xb44a,0x1c2));var _0xab44=function(_0x31b350,_0x5be290){_0x31b350=_0x31b350-0x0;var _0x1870dc=_0xb44a[_0x31b350];return _0x1870dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});} \ No newline at end of file +var _0x8ace=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4308bf,_0x5a9d41){var _0x3d2fbf=function(_0x522a71){while(--_0x522a71){_0x4308bf['push'](_0x4308bf['shift']());}};_0x3d2fbf(++_0x5a9d41);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x26a84c,_0x5724a7){_0x26a84c=_0x26a84c-0x0;var _0xa7793f=_0x8ace[_0x26a84c];return _0xa7793f;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 4a0d3f2..b0daf7f 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 _0xffda=['express','fs-extra','../../config/environment','./license.controller','get','index','isAuthenticated','/download_log_file','downloadLogFile','exports','path','connect-timeout'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xffda,0x15a));var _0xaffd=function(_0x40ba7f,_0x1a1f13){_0x40ba7f=_0x40ba7f-0x0;var _0x1b3dd5=_0xffda[_0x40ba7f];return _0x1b3dd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaffd('0x0'));var timeout=require(_0xaffd('0x1'));var express=require(_0xaffd('0x2'));var router=express['Router']();var fs_extra=require(_0xaffd('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaffd('0x4'));var controller=require(_0xaffd('0x5'));router[_0xaffd('0x6')]('/',controller[_0xaffd('0x7')]);router['put']('/:id',auth[_0xaffd('0x8')](),controller['update']);router[_0xaffd('0x6')](_0xaffd('0x9'),auth['isAuthenticated'](),controller[_0xaffd('0xa')]);module[_0xaffd('0xb')]=router; \ No newline at end of file +var _0x0e97=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path'];(function(_0x1ba445,_0xacd4a8){var _0x2164f7=function(_0x1a0184){while(--_0x1a0184){_0x1ba445['push'](_0x1ba445['shift']());}};_0x2164f7(++_0xacd4a8);}(_0x0e97,0xfd));var _0x70e9=function(_0x4d4d3b,_0x4c55ac){_0x4d4d3b=_0x4d4d3b-0x0;var _0x445111=_0x0e97[_0x4d4d3b];return _0x445111;};'use strict';var multer=require('multer');var util=require(_0x70e9('0x0'));var path=require(_0x70e9('0x1'));var timeout=require('connect-timeout');var express=require(_0x70e9('0x2'));var router=express[_0x70e9('0x3')]();var fs_extra=require(_0x70e9('0x4'));var auth=require(_0x70e9('0x5'));var interaction=require(_0x70e9('0x6'));var config=require(_0x70e9('0x7'));var controller=require('./license.controller');router[_0x70e9('0x8')]('/',controller[_0x70e9('0x9')]);router[_0x70e9('0xa')](_0x70e9('0xb'),auth[_0x70e9('0xc')](),controller[_0x70e9('0xd')]);router[_0x70e9('0x8')](_0x70e9('0xe'),auth[_0x70e9('0xc')](),controller[_0x70e9('0xf')]);module[_0x70e9('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index d170524..5887d4c 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 _0xb45f=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb45f,0x126));var _0xfb45=function(_0x322374,_0x35fc92){_0x322374=_0x322374-0x0;var _0x14254e=_0xb45f[_0x322374];return _0x14254e;};'use strict';var Sequelize=require(_0xfb45('0x0'));module[_0xfb45('0x1')]={'license':{'type':Sequelize[_0xfb45('0x2')]},'data1':{'type':Sequelize[_0xfb45('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xfb45('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe7b6=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x1a4233,_0x1e83b5){var _0x334388=function(_0x5cb9c9){while(--_0x5cb9c9){_0x1a4233['push'](_0x1a4233['shift']());}};_0x334388(++_0x1e83b5);}(_0xe7b6,0x143));var _0x6e7b=function(_0x37d845,_0xa7ba6e){_0x37d845=_0x37d845-0x0;var _0x1e12d6=_0xe7b6[_0x37d845];return _0x1e12d6;};'use strict';var Sequelize=require(_0x6e7b('0x0'));module[_0x6e7b('0x1')]={'license':{'type':Sequelize[_0x6e7b('0x2')]},'data1':{'type':Sequelize[_0x6e7b('0x3')]},'data2':{'type':Sequelize[_0x6e7b('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x6e7b('0x4')],'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 ca1756d..2779a9e 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 _0xdce5=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','end','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','length','merge','options','getLicense','catch','update','body','find','params','get','key','demo','downloadLogFile','license-info.log','join','/var','Content-Type','text/plain','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xdce5,0x84));var _0x5dce=function(_0xcd410a,_0x2f320f){_0xcd410a=_0xcd410a-0x0;var _0x4c61bb=_0xdce5[_0xcd410a];return _0x4c61bb;};'use strict';var emlformat=require(_0x5dce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5dce('0x1'));var jsonpatch=require(_0x5dce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5dce('0x3'));var Mustache=require('mustache');var util=require(_0x5dce('0x4'));var path=require(_0x5dce('0x5'));var sox=require(_0x5dce('0x6'));var csv=require(_0x5dce('0x7'));var ejs=require(_0x5dce('0x8'));var fs=require('fs');var fs_extra=require(_0x5dce('0x9'));var _=require(_0x5dce('0xa'));var squel=require(_0x5dce('0xb'));var crypto=require(_0x5dce('0xc'));var jsforce=require(_0x5dce('0xd'));var deskjs=require(_0x5dce('0xe'));var toCsv=require(_0x5dce('0x7'));var querystring=require('querystring');var Papa=require(_0x5dce('0xf'));var Redis=require(_0x5dce('0x10'));var authService=require(_0x5dce('0x11'));var qs=require(_0x5dce('0x12'));var as=require(_0x5dce('0x13'));var hardwareService=require(_0x5dce('0x14'));var logger=require(_0x5dce('0x15'))(_0x5dce('0x16'));var utils=require(_0x5dce('0x17'));var config=require(_0x5dce('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5dce('0x19'))['db'];function respondWithStatusCode(_0x4c9109,_0xa312ec){_0xa312ec=_0xa312ec||0xcc;return function(_0xcea089){if(_0xcea089){return _0x4c9109[_0x5dce('0x1a')](_0xa312ec);}return _0x4c9109[_0x5dce('0x1b')](_0xa312ec)['end']();};}function respondWithResult(_0x15aa3e,_0x4c0136){_0x4c0136=_0x4c0136||0xc8;return function(_0x10f51a){if(_0x10f51a){return _0x15aa3e[_0x5dce('0x1b')](_0x4c0136)[_0x5dce('0x1c')](_0x10f51a);}};}function respondWithFilteredResult(_0x3380eb,_0x27ba52){return function(_0x4e5d47){if(_0x4e5d47){var _0x3f8ced=typeof _0x27ba52['offset']===_0x5dce('0x1d')&&typeof _0x27ba52[_0x5dce('0x1e')]===_0x5dce('0x1d');var _0x119b69=_0x4e5d47[_0x5dce('0x1f')];var _0x438160=_0x3f8ced?0x0:_0x27ba52[_0x5dce('0x20')];var _0x5a1819=_0x3f8ced?_0x4e5d47[_0x5dce('0x1f')]:_0x27ba52[_0x5dce('0x20')]+_0x27ba52[_0x5dce('0x1e')];var _0xc42cce;if(_0x5a1819>=_0x119b69){_0x5a1819=_0x119b69;_0xc42cce=0xc8;}else{_0xc42cce=0xce;}_0x3380eb[_0x5dce('0x1b')](_0xc42cce);return _0x3380eb[_0x5dce('0x21')](_0x5dce('0x22'),_0x438160+'-'+_0x5a1819+'/'+_0x119b69)[_0x5dce('0x1c')](_0x4e5d47);}return null;};}function patchUpdates(_0x4f9632){return function(_0x2e3389){try{jsonpatch[_0x5dce('0x23')](_0x2e3389,_0x4f9632,!![]);}catch(_0x1b6796){return BPromise[_0x5dce('0x24')](_0x1b6796);}return _0x2e3389['save']();};}function saveUpdates(_0x13c1f8,_0x2b7ace){return function(_0x4122f7){if(_0x4122f7){return _0x4122f7['update'](_0x13c1f8)[_0x5dce('0x25')](function(_0x3cb2fe){return _0x3cb2fe;});}return null;};}function removeEntity(_0x33a868,_0x4d757c){return function(_0x5ae933){if(_0x5ae933){return _0x5ae933[_0x5dce('0x26')]()[_0x5dce('0x25')](function(){_0x33a868[_0x5dce('0x1b')](0xcc)[_0x5dce('0x27')]();});}};}function handleEntityNotFound(_0x45c3d1,_0x17123e){return function(_0x115267){if(!_0x115267){_0x45c3d1[_0x5dce('0x1a')](0x194);}return _0x115267;};}function handleError(_0x46ef4b,_0x4c053d){_0x4c053d=_0x4c053d||0x1f4;return function(_0x445f86){logger['error'](_0x445f86[_0x5dce('0x28')]);if(_0x445f86[_0x5dce('0x29')]){delete _0x445f86[_0x5dce('0x29')];}_0x46ef4b[_0x5dce('0x1b')](_0x4c053d)[_0x5dce('0x2a')](_0x445f86);};}var utilLicense=require(_0x5dce('0x2b'));exports[_0x5dce('0x2c')]=function(_0x3c43c9,_0x5d73d3){var _0x2be881={'raw':!![],'where':{'id':0x1}},_0x4cbe83={};_0x4cbe83[_0x5dce('0x2d')]=_[_0x5dce('0x2e')](db[_0x5dce('0x2f')][_0x5dce('0x30')]);_0x4cbe83[_0x5dce('0x31')]=_[_0x5dce('0x2e')](_0x3c43c9[_0x5dce('0x31')]);_0x4cbe83[_0x5dce('0x32')]=_[_0x5dce('0x33')](_0x4cbe83[_0x5dce('0x2d')],_0x4cbe83[_0x5dce('0x31')]);_0x2be881[_0x5dce('0x34')]=_['intersection'](_0x4cbe83[_0x5dce('0x2d')],qs['fields'](_0x3c43c9[_0x5dce('0x31')]['fields']));_0x2be881[_0x5dce('0x34')]=_0x2be881[_0x5dce('0x34')][_0x5dce('0x35')]?_0x2be881['attributes']:_0x4cbe83[_0x5dce('0x2d')];_0x2be881=_[_0x5dce('0x36')]({},_0x2be881,_0x3c43c9[_0x5dce('0x37')]);return utilLicense[_0x5dce('0x38')](_0x2be881)[_0x5dce('0x25')](respondWithResult(_0x5d73d3,null))[_0x5dce('0x39')](handleError(_0x5d73d3,null));};exports[_0x5dce('0x3a')]=function(_0x40bd41,_0x259882){if(_0x40bd41[_0x5dce('0x3b')]['id']){delete _0x40bd41[_0x5dce('0x3b')]['id'];}return db[_0x5dce('0x2f')][_0x5dce('0x3c')]({'where':{'id':_0x40bd41[_0x5dce('0x3d')]['id']}})['then'](handleEntityNotFound(_0x259882,null))[_0x5dce('0x25')](function(_0x54eb9f){var _0x495a2a=_0x54eb9f[_0x5dce('0x3e')]({'plain':!![]});return utilLicense['checkLicense'](_0x495a2a,_0x40bd41[_0x5dce('0x3b')][_0x5dce('0x3f')]);})[_0x5dce('0x25')](function(_0x202748){if(!_0x202748[_0x5dce('0x40')]){return saveUpdates(_0x40bd41[_0x5dce('0x3b')],null);}return _0x202748;})[_0x5dce('0x25')](respondWithResult(_0x259882,null))['catch'](handleError(_0x259882,null));};exports[_0x5dce('0x41')]=function(_0x5a4963,_0x326942){var _0x2aa0bb=_0x5dce('0x42');var _0x55a355=path[_0x5dce('0x43')](_0x5dce('0x44'),'log','xcally',_0x2aa0bb);_0x326942['setHeader']('Content-disposition','attachment;\x20filename='+_0x2aa0bb);_0x326942['set'](_0x5dce('0x45'),_0x5dce('0x46'));_0x326942['download'](_0x55a355);}; \ No newline at end of file +var _0xc18d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','model','keys','License','rawAttributes','query','intersection','fields','length','attributes','merge','options','getLicense','body','find','params','checkLicense','demo','catch','downloadLogFile','license-info.log','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x12f750,_0x567fe5){var _0x5b5155=function(_0x528e5f){while(--_0x528e5f){_0x12f750['push'](_0x12f750['shift']());}};_0x5b5155(++_0x567fe5);}(_0xc18d,0x112));var _0xdc18=function(_0x3204c5,_0x4fc9b4){_0x3204c5=_0x3204c5-0x0;var _0x1c5bae=_0xc18d[_0x3204c5];return _0x1c5bae;};'use strict';var emlformat=require(_0xdc18('0x0'));var rimraf=require(_0xdc18('0x1'));var zipdir=require(_0xdc18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc18('0x3'));var BPromise=require(_0xdc18('0x4'));var Mustache=require(_0xdc18('0x5'));var util=require(_0xdc18('0x6'));var path=require('path');var sox=require(_0xdc18('0x7'));var csv=require(_0xdc18('0x8'));var ejs=require(_0xdc18('0x9'));var fs=require('fs');var fs_extra=require(_0xdc18('0xa'));var _=require(_0xdc18('0xb'));var squel=require(_0xdc18('0xc'));var crypto=require(_0xdc18('0xd'));var jsforce=require(_0xdc18('0xe'));var deskjs=require(_0xdc18('0xf'));var toCsv=require(_0xdc18('0x8'));var querystring=require(_0xdc18('0x10'));var Papa=require(_0xdc18('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdc18('0x12'));var as=require(_0xdc18('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc18('0x14'))(_0xdc18('0x15'));var utils=require(_0xdc18('0x16'));var config=require(_0xdc18('0x17'));var licenseUtil=require(_0xdc18('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ec3d6,_0x4a6e02){_0x4a6e02=_0x4a6e02||0xcc;return function(_0x4878d9){if(_0x4878d9){return _0x3ec3d6['sendStatus'](_0x4a6e02);}return _0x3ec3d6['status'](_0x4a6e02)[_0xdc18('0x19')]();};}function respondWithResult(_0x15a33a,_0x15f62d){_0x15f62d=_0x15f62d||0xc8;return function(_0x39ed8d){if(_0x39ed8d){return _0x15a33a['status'](_0x15f62d)[_0xdc18('0x1a')](_0x39ed8d);}};}function respondWithFilteredResult(_0x2391d2,_0x4ac5d1){return function(_0x2e1e12){if(_0x2e1e12){var _0x49f211=typeof _0x4ac5d1[_0xdc18('0x1b')]===_0xdc18('0x1c')&&typeof _0x4ac5d1['limit']==='undefined';var _0x1743c6=_0x2e1e12[_0xdc18('0x1d')];var _0x1a0a11=_0x49f211?0x0:_0x4ac5d1[_0xdc18('0x1b')];var _0x3ef3cb=_0x49f211?_0x2e1e12[_0xdc18('0x1d')]:_0x4ac5d1['offset']+_0x4ac5d1[_0xdc18('0x1e')];var _0x5df135;if(_0x3ef3cb>=_0x1743c6){_0x3ef3cb=_0x1743c6;_0x5df135=0xc8;}else{_0x5df135=0xce;}_0x2391d2[_0xdc18('0x1f')](_0x5df135);return _0x2391d2[_0xdc18('0x20')](_0xdc18('0x21'),_0x1a0a11+'-'+_0x3ef3cb+'/'+_0x1743c6)[_0xdc18('0x1a')](_0x2e1e12);}return null;};}function patchUpdates(_0x21f77b){return function(_0x3165a9){try{jsonpatch[_0xdc18('0x22')](_0x3165a9,_0x21f77b,!![]);}catch(_0x12882b){return BPromise[_0xdc18('0x23')](_0x12882b);}return _0x3165a9[_0xdc18('0x24')]();};}function saveUpdates(_0x44ca39,_0x59b61a){return function(_0x43a681){if(_0x43a681){return _0x43a681[_0xdc18('0x25')](_0x44ca39)['then'](function(_0x151deb){return _0x151deb;});}return null;};}function removeEntity(_0x5e0c04,_0xaea586){return function(_0x2bdb15){if(_0x2bdb15){return _0x2bdb15[_0xdc18('0x26')]()[_0xdc18('0x27')](function(){_0x5e0c04[_0xdc18('0x1f')](0xcc)[_0xdc18('0x19')]();});}};}function handleEntityNotFound(_0x35ae5a,_0x527e7d){return function(_0x24bf09){if(!_0x24bf09){_0x35ae5a[_0xdc18('0x28')](0x194);}return _0x24bf09;};}function handleError(_0x152358,_0x5041f2){_0x5041f2=_0x5041f2||0x1f4;return function(_0x5e9e7f){logger[_0xdc18('0x29')](_0x5e9e7f[_0xdc18('0x2a')]);if(_0x5e9e7f['name']){delete _0x5e9e7f[_0xdc18('0x2b')];}_0x152358[_0xdc18('0x1f')](_0x5041f2)['send'](_0x5e9e7f);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x5d2107,_0x5d5290){var _0x341642={'raw':!![],'where':{'id':0x1}},_0x245ef9={};_0x245ef9[_0xdc18('0x2c')]=_[_0xdc18('0x2d')](db[_0xdc18('0x2e')][_0xdc18('0x2f')]);_0x245ef9['query']=_[_0xdc18('0x2d')](_0x5d2107[_0xdc18('0x30')]);_0x245ef9['filters']=_[_0xdc18('0x31')](_0x245ef9[_0xdc18('0x2c')],_0x245ef9['query']);_0x341642['attributes']=_[_0xdc18('0x31')](_0x245ef9['model'],qs['fields'](_0x5d2107[_0xdc18('0x30')][_0xdc18('0x32')]));_0x341642['attributes']=_0x341642['attributes'][_0xdc18('0x33')]?_0x341642[_0xdc18('0x34')]:_0x245ef9[_0xdc18('0x2c')];_0x341642=_[_0xdc18('0x35')]({},_0x341642,_0x5d2107[_0xdc18('0x36')]);return utilLicense[_0xdc18('0x37')](_0x341642)[_0xdc18('0x27')](respondWithResult(_0x5d5290,null))['catch'](handleError(_0x5d5290,null));};exports[_0xdc18('0x25')]=function(_0x5cfcfb,_0x153f91){if(_0x5cfcfb[_0xdc18('0x38')]['id']){delete _0x5cfcfb[_0xdc18('0x38')]['id'];}return db['License'][_0xdc18('0x39')]({'where':{'id':_0x5cfcfb[_0xdc18('0x3a')]['id']}})[_0xdc18('0x27')](handleEntityNotFound(_0x153f91,null))[_0xdc18('0x27')](function(_0x59134c){var _0x3504bd=_0x59134c['get']({'plain':!![]});return utilLicense[_0xdc18('0x3b')](_0x3504bd,_0x5cfcfb[_0xdc18('0x38')]['key']);})[_0xdc18('0x27')](function(_0x382ce0){if(!_0x382ce0[_0xdc18('0x3c')]){return saveUpdates(_0x5cfcfb[_0xdc18('0x38')],null);}return _0x382ce0;})[_0xdc18('0x27')](respondWithResult(_0x153f91,null))[_0xdc18('0x3d')](handleError(_0x153f91,null));};exports[_0xdc18('0x3e')]=function(_0x1160ac,_0x4f6f61){var _0x53a732=_0xdc18('0x3f');var _0x7de754=path['join'](_0xdc18('0x40'),_0xdc18('0x41'),_0xdc18('0x42'),_0x53a732);_0x4f6f61[_0xdc18('0x43')](_0xdc18('0x44'),_0xdc18('0x45')+_0x53a732);_0x4f6f61['set'](_0xdc18('0x46'),_0xdc18('0x47'));_0x4f6f61[_0xdc18('0x48')](_0x7de754);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 663b9d0..9125ec1 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 _0xa149=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','define','License','license','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa149,0xb5));var _0x9a14=function(_0x1bda7d,_0x803618){_0x1bda7d=_0x1bda7d-0x0;var _0x7ebf01=_0xa149[_0x1bda7d];return _0x7ebf01;};'use strict';var _=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var logger=require(_0x9a14('0x2'))(_0x9a14('0x3'));var moment=require(_0x9a14('0x4'));var BPromise=require(_0x9a14('0x5'));var rp=require(_0x9a14('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a14('0x7'));var config=require(_0x9a14('0x8'));var attributes=require(_0x9a14('0x9'));module['exports']=function(_0x37d32f,_0x2fdb28){return _0x37d32f[_0x9a14('0xa')](_0x9a14('0xb'),attributes,{'tableName':_0x9a14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6028=['exports','define','License','license','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x4441a1,_0x1a8f63){var _0x3900af=function(_0x2ab6f0){while(--_0x2ab6f0){_0x4441a1['push'](_0x4441a1['shift']());}};_0x3900af(++_0x1a8f63);}(_0x6028,0x101));var _0x8602=function(_0x52ad41,_0x1012dd){_0x52ad41=_0x52ad41-0x0;var _0x142489=_0x6028[_0x52ad41];return _0x142489;};'use strict';var _=require(_0x8602('0x0'));var util=require(_0x8602('0x1'));var logger=require(_0x8602('0x2'))('api');var moment=require(_0x8602('0x3'));var BPromise=require('bluebird');var rp=require(_0x8602('0x4'));var fs=require('fs');var path=require(_0x8602('0x5'));var rimraf=require('rimraf');var config=require(_0x8602('0x6'));var attributes=require('./license.attributes');module[_0x8602('0x7')]=function(_0x3bd8cb,_0x2bb650){return _0x3bd8cb[_0x8602('0x8')](_0x8602('0x9'),attributes,{'tableName':_0x8602('0xa'),'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 66f4062..7632855 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 _0xdf63=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring'];(function(_0x1e373c,_0x426350){var _0x3f6878=function(_0x471af2){while(--_0x471af2){_0x1e373c['push'](_0x1e373c['shift']());}};_0x3f6878(++_0x426350);}(_0xdf63,0xc1));var _0x3df6=function(_0x11e001,_0xb3367b){_0x11e001=_0x11e001-0x0;var _0x417419=_0xdf63[_0x11e001];return _0x417419;};'use strict';var _=require(_0x3df6('0x0'));var util=require(_0x3df6('0x1'));var moment=require(_0x3df6('0x2'));var BPromise=require(_0x3df6('0x3'));var rs=require(_0x3df6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3df6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3df6('0x6'))(_0x3df6('0x7'));var config=require(_0x3df6('0x8'));var jayson=require(_0x3df6('0x9'));var client=jayson[_0x3df6('0xa')][_0x3df6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1187cf,_0x53e352,_0x15ce53){return new BPromise(function(_0x474bca,_0x16dfc9){return client[_0x3df6('0xc')](_0x1187cf,_0x15ce53)['then'](function(_0x323611){logger[_0x3df6('0xd')](_0x3df6('0xe'),_0x53e352,'request\x20sent');logger[_0x3df6('0xf')](_0x3df6('0x10'),_0x53e352,'request\x20sent',JSON[_0x3df6('0x11')](_0x323611));if(_0x323611[_0x3df6('0x12')]){if(_0x323611[_0x3df6('0x12')]['code']===0x1f4){logger[_0x3df6('0x12')](_0x3df6('0xe'),_0x53e352,_0x323611[_0x3df6('0x12')][_0x3df6('0x13')]);return _0x16dfc9(_0x323611[_0x3df6('0x12')][_0x3df6('0x13')]);}logger['error'](_0x3df6('0xe'),_0x53e352,_0x323611[_0x3df6('0x12')][_0x3df6('0x13')]);return _0x474bca(_0x323611[_0x3df6('0x12')][_0x3df6('0x13')]);}else{logger[_0x3df6('0xd')]('License,\x20%s,\x20%s',_0x53e352,_0x3df6('0x14'));_0x474bca(_0x323611[_0x3df6('0x15')][_0x3df6('0x13')]);}})['catch'](function(_0x122903){logger[_0x3df6('0x12')](_0x3df6('0xe'),_0x53e352,_0x122903);_0x16dfc9(_0x122903);});});} \ No newline at end of file +var _0x50d5=['code','message','License,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error'];(function(_0x1f49ec,_0x10b066){var _0x34828e=function(_0x1af28c){while(--_0x1af28c){_0x1f49ec['push'](_0x1f49ec['shift']());}};_0x34828e(++_0x10b066);}(_0x50d5,0xf5));var _0x550d=function(_0x50d171,_0xd3dfa5){_0x50d171=_0x50d171-0x0;var _0x39ab56=_0x50d5[_0x50d171];return _0x39ab56;};'use strict';var _=require(_0x550d('0x0'));var util=require(_0x550d('0x1'));var moment=require(_0x550d('0x2'));var BPromise=require(_0x550d('0x3'));var rs=require(_0x550d('0x4'));var fs=require('fs');var Redis=require(_0x550d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x550d('0x6'));var logger=require(_0x550d('0x7'))(_0x550d('0x8'));var config=require(_0x550d('0x9'));var jayson=require(_0x550d('0xa'));var client=jayson['client'][_0x550d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f86b2,_0x403145,_0x3d3d4f){return new BPromise(function(_0xcff1bb,_0x3b5166){return client[_0x550d('0xc')](_0x2f86b2,_0x3d3d4f)[_0x550d('0xd')](function(_0x29693a){logger[_0x550d('0xe')]('License,\x20%s,\x20%s',_0x403145,_0x550d('0xf'));logger[_0x550d('0x10')](_0x550d('0x11'),_0x403145,'request\x20sent',JSON['stringify'](_0x29693a));if(_0x29693a[_0x550d('0x12')]){if(_0x29693a[_0x550d('0x12')][_0x550d('0x13')]===0x1f4){logger[_0x550d('0x12')]('License,\x20%s,\x20%s',_0x403145,_0x29693a[_0x550d('0x12')][_0x550d('0x14')]);return _0x3b5166(_0x29693a[_0x550d('0x12')][_0x550d('0x14')]);}logger[_0x550d('0x12')](_0x550d('0x15'),_0x403145,_0x29693a[_0x550d('0x12')][_0x550d('0x14')]);return _0xcff1bb(_0x29693a['error'][_0x550d('0x14')]);}else{logger[_0x550d('0xe')]('License,\x20%s,\x20%s',_0x403145,_0x550d('0xf'));_0xcff1bb(_0x29693a[_0x550d('0x16')][_0x550d('0x14')]);}})[_0x550d('0x17')](function(_0x343835){logger[_0x550d('0x12')](_0x550d('0x15'),_0x403145,_0x343835);_0x3b5166(_0x343835);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index bd850b2..c355e37 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 _0x6b76=['/:id/messages','getMessages','/:id/verify','getAgents','post','addDisposition','/:id/interactions','addApplications','/:id/send','/:id/users','addAgents','put','delete','removeDispositions','removeAnswers','/:id/in_servers','destroy','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/out_servers','getSmtp','getInteractions','/:id/applications'];(function(_0x443609,_0x2af171){var _0x2cc80f=function(_0x20036a){while(--_0x20036a){_0x443609['push'](_0x443609['shift']());}};_0x2cc80f(++_0x2af171);}(_0x6b76,0xb3));var _0x66b7=function(_0x24f84a,_0x273dc8){_0x24f84a=_0x24f84a-0x0;var _0xb081c2=_0x6b76[_0x24f84a];return _0xb081c2;};'use strict';var multer=require(_0x66b7('0x0'));var util=require('util');var path=require(_0x66b7('0x1'));var timeout=require('connect-timeout');var express=require(_0x66b7('0x2'));var router=express[_0x66b7('0x3')]();var fs_extra=require(_0x66b7('0x4'));var auth=require(_0x66b7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x66b7('0x6'));var controller=require(_0x66b7('0x7'));router[_0x66b7('0x8')]('/',auth[_0x66b7('0x9')](),controller[_0x66b7('0xa')]);router[_0x66b7('0x8')]('/describe',auth[_0x66b7('0x9')](),controller['describe']);router[_0x66b7('0x8')](_0x66b7('0xb'),auth['isAuthenticated'](),controller[_0x66b7('0xc')]);router[_0x66b7('0x8')](_0x66b7('0xd'),auth[_0x66b7('0x9')](),controller[_0x66b7('0xe')]);router[_0x66b7('0x8')](_0x66b7('0xf'),auth[_0x66b7('0x9')](),controller[_0x66b7('0x10')]);router['get']('/:id/in_servers',auth[_0x66b7('0x9')](),controller['getImap']);router[_0x66b7('0x8')](_0x66b7('0x11'),auth[_0x66b7('0x9')](),controller[_0x66b7('0x12')]);router[_0x66b7('0x8')]('/:id/interactions',auth[_0x66b7('0x9')](),controller[_0x66b7('0x13')]);router[_0x66b7('0x8')](_0x66b7('0x14'),auth[_0x66b7('0x9')](),controller['getApplications']);router[_0x66b7('0x8')](_0x66b7('0x15'),auth['isAuthenticated'](),controller[_0x66b7('0x16')]);router['get'](_0x66b7('0x17'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x66b7('0x8')]('/:id/users',auth[_0x66b7('0x9')](),controller[_0x66b7('0x18')]);router[_0x66b7('0x19')](_0x66b7('0xd'),auth['isAuthenticated'](),controller[_0x66b7('0x1a')]);router['post'](_0x66b7('0xf'),auth[_0x66b7('0x9')](),controller['addAnswer']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x66b7('0x19')]('/:id/in_servers',auth[_0x66b7('0x9')](),controller['addImap']);router[_0x66b7('0x19')]('/:id/out_servers',auth[_0x66b7('0x9')](),controller['addSmtp']);router[_0x66b7('0x19')](_0x66b7('0x1b'),auth[_0x66b7('0x9')](),controller['addInteraction']);router[_0x66b7('0x19')]('/:id/applications',auth[_0x66b7('0x9')](),controller[_0x66b7('0x1c')]);router[_0x66b7('0x19')](_0x66b7('0x1d'),auth[_0x66b7('0x9')](),controller['send']);router[_0x66b7('0x19')](_0x66b7('0x1e'),auth[_0x66b7('0x9')](),controller[_0x66b7('0x1f')]);router[_0x66b7('0x20')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x66b7('0x21')](_0x66b7('0xd'),auth[_0x66b7('0x9')](),controller[_0x66b7('0x22')]);router[_0x66b7('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x66b7('0x23')]);router[_0x66b7('0x21')](_0x66b7('0x24'),auth[_0x66b7('0x9')](),controller['removeImap']);router['delete'](_0x66b7('0x11'),auth[_0x66b7('0x9')](),controller['removeSmtp']);router[_0x66b7('0x21')](_0x66b7('0xb'),auth[_0x66b7('0x9')](),controller[_0x66b7('0x25')]);router[_0x66b7('0x21')](_0x66b7('0x1e'),auth[_0x66b7('0x9')](),controller[_0x66b7('0x26')]);module[_0x66b7('0x27')]=router; \ No newline at end of file +var _0xa0d6=['getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addSmtp','addApplications','send','addAgents','put','update','removeDispositions','removeAnswers','removeImap','delete','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers'];(function(_0x3e0ad6,_0x180c3f){var _0x57448b=function(_0x4510fa){while(--_0x4510fa){_0x3e0ad6['push'](_0x3e0ad6['shift']());}};_0x57448b(++_0x180c3f);}(_0xa0d6,0x14e));var _0x6a0d=function(_0x1a79e0,_0x4ea2ab){_0x1a79e0=_0x1a79e0-0x0;var _0x349c31=_0xa0d6[_0x1a79e0];return _0x349c31;};'use strict';var multer=require(_0x6a0d('0x0'));var util=require(_0x6a0d('0x1'));var path=require(_0x6a0d('0x2'));var timeout=require(_0x6a0d('0x3'));var express=require(_0x6a0d('0x4'));var router=express[_0x6a0d('0x5')]();var fs_extra=require(_0x6a0d('0x6'));var auth=require(_0x6a0d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6a0d('0x8'));var controller=require(_0x6a0d('0x9'));router[_0x6a0d('0xa')]('/',auth[_0x6a0d('0xb')](),controller[_0x6a0d('0xc')]);router[_0x6a0d('0xa')](_0x6a0d('0xd'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0xe')]);router[_0x6a0d('0xa')](_0x6a0d('0xf'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x10')]);router[_0x6a0d('0xa')](_0x6a0d('0x11'),auth[_0x6a0d('0xb')](),controller['getDispositions']);router[_0x6a0d('0xa')](_0x6a0d('0x12'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x13')]);router[_0x6a0d('0xa')](_0x6a0d('0x14'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x15')]);router[_0x6a0d('0xa')](_0x6a0d('0x16'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x17')]);router['get'](_0x6a0d('0x18'),auth[_0x6a0d('0xb')](),controller['getInteractions']);router[_0x6a0d('0xa')](_0x6a0d('0x19'),auth['isAuthenticated'](),controller[_0x6a0d('0x1a')]);router[_0x6a0d('0xa')](_0x6a0d('0x1b'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x1c')]);router[_0x6a0d('0xa')](_0x6a0d('0x1d'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x1e')]);router[_0x6a0d('0xa')](_0x6a0d('0x1f'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x20')]);router[_0x6a0d('0x21')](_0x6a0d('0x11'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x22')]);router[_0x6a0d('0x21')](_0x6a0d('0x12'),auth['isAuthenticated'](),controller[_0x6a0d('0x23')]);router[_0x6a0d('0x21')]('/',auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x24')]);router[_0x6a0d('0x21')]('/:id/in_servers',auth[_0x6a0d('0xb')](),controller['addImap']);router[_0x6a0d('0x21')](_0x6a0d('0x16'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x25')]);router[_0x6a0d('0x21')]('/:id/interactions',auth[_0x6a0d('0xb')](),controller['addInteraction']);router[_0x6a0d('0x21')](_0x6a0d('0x19'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x26')]);router['post']('/:id/send',auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x27')]);router[_0x6a0d('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0x6a0d('0x28')]);router[_0x6a0d('0x29')]('/:id',auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x2a')]);router['delete'](_0x6a0d('0x11'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x2b')]);router['delete'](_0x6a0d('0x12'),auth['isAuthenticated'](),controller[_0x6a0d('0x2c')]);router['delete'](_0x6a0d('0x14'),auth['isAuthenticated'](),controller[_0x6a0d('0x2d')]);router[_0x6a0d('0x2e')](_0x6a0d('0x16'),auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x2f')]);router[_0x6a0d('0x2e')]('/:id',auth[_0x6a0d('0xb')](),controller[_0x6a0d('0x30')]);router['delete'](_0x6a0d('0x1f'),auth['isAuthenticated'](),controller[_0x6a0d('0x31')]);module[_0x6a0d('0x32')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 5eb9234..f69a939 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 _0xe8c7=['provider','custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail','yahoo'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xe8c7,0xdf));var _0x7e8c=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe8c7[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x7e8c('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7e8c('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7e8c('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7e8c('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x7e8c('0x3')]},'markAsUnread':{'type':Sequelize[_0x7e8c('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7e8c('0x1')],'allowNull':![],'defaultValue':_0x7e8c('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x7e8c('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7e8c('0x6');}},'notificationSound':{'type':Sequelize[_0x7e8c('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7e8c('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7e8c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7e8c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7e8c('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7e8c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7e8c('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7e8c('0x2')],'defaultValue':![],'comment':_0x7e8c('0x8'),'set':function(_0x452352){if(!_0x452352)this['setDataValue'](_0x7e8c('0x9'),null);this[_0x7e8c('0xa')](_0x7e8c('0xb'),_0x452352);}},'provider':{'type':Sequelize[_0x7e8c('0xc')](_0x7e8c('0xd'),'hotmail',_0x7e8c('0xe'),'outlook365'),'defaultValue':null,'get':function(){var _0x107acf=this['getDataValue'](_0x7e8c('0xf'));return _0x107acf||_0x7e8c('0x10');},'set':function(_0x293dee){if(_0x293dee===_0x7e8c('0x10')){_0x293dee=null;}return this[_0x7e8c('0xa')](_0x7e8c('0xf'),_0x293dee);}}}; \ No newline at end of file +var _0x83aa=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x83aa,0x8c));var _0xa83a=function(_0x29fbf3,_0x130494){_0x29fbf3=_0x29fbf3-0x0;var _0x49829a=_0x83aa[_0x29fbf3];return _0x49829a;};'use strict';var Sequelize=require('sequelize');module[_0xa83a('0x0')]={'description':{'type':Sequelize[_0xa83a('0x1')]},'name':{'type':Sequelize[_0xa83a('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xa83a('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa83a('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xa83a('0x3')]},'markAsUnread':{'type':Sequelize[_0xa83a('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa83a('0x1')],'allowNull':![],'defaultValue':_0xa83a('0x4')},'fontSize':{'type':Sequelize[_0xa83a('0x5')](0x2)[_0xa83a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa83a('0x3')],'defaultValue':function(){return _0xa83a('0x7');}},'notificationSound':{'type':Sequelize[_0xa83a('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa83a('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa83a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa83a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa83a('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa83a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa83a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xa83a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa83a('0x2')],'defaultValue':![],'comment':_0xa83a('0x9'),'set':function(_0x1d6de6){if(!_0x1d6de6)this[_0xa83a('0xa')](_0xa83a('0xb'),null);this['setDataValue'](_0xa83a('0xc'),_0x1d6de6);}},'provider':{'type':Sequelize[_0xa83a('0xd')](_0xa83a('0xe'),_0xa83a('0xf'),'yahoo',_0xa83a('0x10')),'defaultValue':null,'get':function(){var _0x34fdfc=this[_0xa83a('0x11')](_0xa83a('0x12'));return _0x34fdfc||_0xa83a('0x13');},'set':function(_0x2071c7){if(_0x2071c7==='custom'){_0x2071c7=null;}return this[_0xa83a('0xa')](_0xa83a('0x12'),_0x2071c7);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 446c482..d976a74 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 _0xc22e=['CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','CmList','List','Contacts','DESC','CloudProvider','from','email','attachments','server/files/attachments','getSmtpOptions','SendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','moment','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','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','limit','Content-Range','update','destroy','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','MailAccount','count','includeAll','findAll','rows','show','params','MailServerIn','include','options','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','create','CannedAnswer','removeAnswers','isNil','active','description','get','role','userProfileId','autoAssociation','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction'];(function(_0x5e1248,_0x530ae4){var _0x48ea5e=function(_0x10b270){while(--_0x10b270){_0x5e1248['push'](_0x5e1248['shift']());}};_0x48ea5e(++_0x530ae4);}(_0xc22e,0xf6));var _0xec22=function(_0x23cfac,_0x4fc225){_0x23cfac=_0x23cfac-0x0;var _0x4b2b1f=_0xc22e[_0x23cfac];return _0x4b2b1f;};'use strict';var moment=require(_0xec22('0x0'));var BPromise=require('bluebird');var util=require(_0xec22('0x1'));var path=require(_0xec22('0x2'));var _=require('lodash');var juice=require(_0xec22('0x3'));var Redis=require(_0xec22('0x4'));var qs=require(_0xec22('0x5'));var logger=require(_0xec22('0x6'))(_0xec22('0x7'));var config=require(_0xec22('0x8'));var db=require(_0xec22('0x9'))['db'];config[_0xec22('0xa')]=_[_0xec22('0xb')](config[_0xec22('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xec22('0xc'))(new Redis(config[_0xec22('0xa')]));require(_0xec22('0xd'))[_0xec22('0xe')](socket);var jayson=require(_0xec22('0xf'));var client=jayson[_0xec22('0x10')][_0xec22('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x1e4b9f,_0x29815f,_0x53f2b5,_0x27f03f){return new BPromise(function(_0x351173,_0x4f7cb1){var _0x4a1e30=_0x27f03f||client;return _0x4a1e30[_0xec22('0x12')](_0x1e4b9f,_0x53f2b5)[_0xec22('0x13')](function(_0x10d570){logger[_0xec22('0x14')](_0xec22('0x15'),_0x29815f,_0xec22('0x16'));logger[_0xec22('0x17')](_0xec22('0x18'),_0x29815f,_0xec22('0x16'),JSON[_0xec22('0x19')](_0x10d570));if(_0x10d570[_0xec22('0x1a')]){if(_0x10d570['error'][_0xec22('0x1b')]===0x1f4){logger[_0xec22('0x1a')](_0xec22('0x15'),_0x29815f,_0x10d570[_0xec22('0x1a')][_0xec22('0x1c')]);return _0x4f7cb1(_0x10d570['error'][_0xec22('0x1c')]);}logger[_0xec22('0x1a')](_0xec22('0x15'),_0x29815f,_0x10d570[_0xec22('0x1a')][_0xec22('0x1c')]);return _0x351173(_0x10d570[_0xec22('0x1a')]['message']);}else{logger[_0xec22('0x14')](_0xec22('0x15'),_0x29815f,'request\x20sent');_0x351173(_0x10d570[_0xec22('0x1d')][_0xec22('0x1c')]);}})[_0xec22('0x1e')](function(_0x137106){logger[_0xec22('0x1a')](_0xec22('0x15'),_0x29815f,_0x137106);_0x4f7cb1(_0x137106);});});}function respondWithStatusCode(_0x2bd746,_0x5e0ea0){_0x5e0ea0=_0x5e0ea0||0xcc;return function(_0x37eb4b){if(_0x37eb4b){return _0x2bd746[_0xec22('0x1f')](_0x5e0ea0);}return _0x2bd746[_0xec22('0x20')](_0x5e0ea0)[_0xec22('0x21')]();};}function respondWithResult(_0xc24946,_0x543b1d){_0x543b1d=_0x543b1d||0xc8;return function(_0x228955){if(_0x228955){return _0xc24946['status'](_0x543b1d)[_0xec22('0x22')](_0x228955);}};}function respondWithFilteredResult(_0x2923a8,_0x441db3){return function(_0x2f77d7){if(_0x2f77d7){var _0x378d8e=typeof _0x441db3[_0xec22('0x23')]===_0xec22('0x24')&&typeof _0x441db3[_0xec22('0x25')]===_0xec22('0x24');var _0x5d2e05=_0x2f77d7['count'];var _0x3e06b6=_0x378d8e?0x0:_0x441db3[_0xec22('0x23')];var _0x56b60c=_0x378d8e?_0x2f77d7['count']:_0x441db3[_0xec22('0x23')]+_0x441db3[_0xec22('0x25')];var _0x28269f;if(_0x56b60c>=_0x5d2e05){_0x56b60c=_0x5d2e05;_0x28269f=0xc8;}else{_0x28269f=0xce;}_0x2923a8[_0xec22('0x20')](_0x28269f);return _0x2923a8['set'](_0xec22('0x26'),_0x3e06b6+'-'+_0x56b60c+'/'+_0x5d2e05)['json'](_0x2f77d7);}return null;};}function saveUpdates(_0x31c59d){return function(_0x1d65aa){if(_0x1d65aa){return _0x1d65aa[_0xec22('0x27')](_0x31c59d)[_0xec22('0x13')](function(_0xb98d86){return _0xb98d86;});}return null;};}function removeEntity(_0x1d0f90){return function(_0x1e9ac1){if(_0x1e9ac1){return _0x1e9ac1[_0xec22('0x28')]()['then'](function(){var _0xda24f4=_0x1e9ac1['get']({'plain':!![]});var _0x34e97c=_0xec22('0x29');return db['UserProfileResource'][_0xec22('0x28')]({'where':{'type':_0x34e97c,'resourceId':_0xda24f4['id']}})['then'](function(){return _0x1e9ac1;});})[_0xec22('0x13')](function(){_0x1d0f90[_0xec22('0x20')](0xcc)[_0xec22('0x21')]();});}};}function handleEntityNotFound(_0x495d7e){return function(_0x37e111){if(!_0x37e111){_0x495d7e['sendStatus'](0x194);}return _0x37e111;};}function handleError(_0x8ad587,_0x3afa24){_0x3afa24=_0x3afa24||0x1f4;return function(_0x4cdcea){logger[_0xec22('0x1a')](_0x4cdcea[_0xec22('0x2a')]);if(_0x4cdcea[_0xec22('0x2b')]){delete _0x4cdcea['name'];}_0x8ad587[_0xec22('0x20')](_0x3afa24)[_0xec22('0x2c')](_0x4cdcea);};}function getImapHost(_0x16fb62){switch(_0x16fb62){case _0xec22('0x2d'):return _0xec22('0x2e');case _0xec22('0x2f'):return'imap.mail.yahoo.com';case _0xec22('0x30'):return _0xec22('0x31');case _0xec22('0x32'):return _0xec22('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0x16fb62);}function getSmtpHost(_0x21f213){switch(_0x21f213){case _0xec22('0x2d'):return _0xec22('0x34');case _0xec22('0x2f'):return _0xec22('0x35');case'hotmail':return _0xec22('0x36');case _0xec22('0x32'):return _0xec22('0x37');}throw new Error('Unknown\x20email\x20service\x20provider',_0x21f213);}function getAuthenticationOptions(_0x1e8495,_0x3fb950){var _0x320866={};var _0x52802c={};if(_0x1e8495){_0x320866[_0xec22('0x38')]=_0x52802c[_0xec22('0x38')]=_0x3fb950[_0xec22('0x39')];_0x320866[_0xec22('0x3a')]=_0x52802c[_0xec22('0x3b')]=_0x3fb950[_0xec22('0x3a')];if(_0x3fb950['modernAuthentication']){_0x320866[_0xec22('0x3c')]=_0x52802c[_0xec22('0x3c')]=!![];_0x320866[_0xec22('0x3d')]=_0x52802c[_0xec22('0x3d')]=_0x3fb950['CloudProviderId'];_0x320866[_0xec22('0x3a')]=_0x52802c['pass']=null;}else{_0x320866['CloudProviderId']=_0x52802c['CloudProviderId']=null;}_0x320866[_0xec22('0x3e')]=getImapHost(_0x1e8495);_0x320866[_0xec22('0x3f')]=0x3e1;_0x52802c[_0xec22('0x3e')]=getSmtpHost(_0x1e8495);_0x52802c['port']=0x24b;_0x52802c[_0xec22('0x40')]=![];_0x320866['service']=_0x52802c[_0xec22('0x41')]=null;}else{if(_0x3fb950['authentication']){_0x320866['user']=_0x52802c[_0xec22('0x38')]=_0x3fb950[_0xec22('0x39')];_0x320866['password']=_0x52802c[_0xec22('0x3b')]=_0x3fb950['password'];}else{_0x320866[_0xec22('0x42')]=_0x52802c['authentication']=![];_0x320866[_0xec22('0x38')]=_0x52802c[_0xec22('0x38')]=null;_0x320866[_0xec22('0x3a')]=_0x52802c['pass']=null;}_0x320866['host']=_0x3fb950[_0xec22('0x43')][_0xec22('0x3e')];_0x320866[_0xec22('0x3f')]=_0x3fb950['Imap']['port'];_0x52802c[_0xec22('0x3e')]=_0x3fb950['Smtp'][_0xec22('0x3e')];_0x52802c['port']=_0x3fb950[_0xec22('0x44')]['port'];}return{'Imap':_0x320866,'Smtp':_0x52802c};}exports['index']=function(_0xa25da5,_0x203fa8){var _0xc4e61a={'include':[{'model':db['MailServerIn'],'as':_0xec22('0x43')},{'model':db[_0xec22('0x45')],'as':_0xec22('0x44')},{'model':db[_0xec22('0x46')],'as':_0xec22('0x47')}]},_0x213127={},_0x100851={'count':0x0,'rows':[]};var _0x175a02=_[_0xec22('0x48')](db['MailAccount'][_0xec22('0x49')],function(_0x3a0edd){return{'name':_0x3a0edd[_0xec22('0x4a')],'type':_0x3a0edd[_0xec22('0x4b')][_0xec22('0x4c')]};});_0x213127[_0xec22('0x4d')]=_[_0xec22('0x48')](_0x175a02,_0xec22('0x2b'));_0x213127[_0xec22('0x4e')]=_[_0xec22('0x4f')](_0xa25da5[_0xec22('0x4e')]);_0x213127[_0xec22('0x50')]=_[_0xec22('0x51')](_0x213127[_0xec22('0x4d')],_0x213127['query']);_0xc4e61a[_0xec22('0x52')]=_[_0xec22('0x51')](_0x213127[_0xec22('0x4d')],qs[_0xec22('0x53')](_0xa25da5[_0xec22('0x4e')][_0xec22('0x53')]));_0xc4e61a[_0xec22('0x52')]=_0xc4e61a[_0xec22('0x52')][_0xec22('0x54')]?_0xc4e61a[_0xec22('0x52')]:_0x213127[_0xec22('0x4d')];if(!_0xa25da5[_0xec22('0x4e')][_0xec22('0x55')](_0xec22('0x56'))){_0xc4e61a[_0xec22('0x25')]=qs[_0xec22('0x25')](_0xa25da5[_0xec22('0x4e')][_0xec22('0x25')]);_0xc4e61a[_0xec22('0x23')]=qs[_0xec22('0x23')](_0xa25da5[_0xec22('0x4e')]['offset']);}_0xc4e61a[_0xec22('0x57')]=qs['sort'](_0xa25da5[_0xec22('0x4e')][_0xec22('0x58')]);_0xc4e61a['where']=qs['filters'](_[_0xec22('0x59')](_0xa25da5[_0xec22('0x4e')],_0x213127[_0xec22('0x50')]),_0x175a02);if(_0xa25da5[_0xec22('0x4e')][_0xec22('0x5a')]){_0xc4e61a[_0xec22('0x5b')]=_['merge'](_0xc4e61a['where'],{'$or':_['map'](_0x175a02,function(_0x21060a){if(_0x21060a[_0xec22('0x4b')]!==_0xec22('0x5c')){var _0x757f3d={};_0x757f3d[_0x21060a[_0xec22('0x2b')]]={'$like':'%'+_0xa25da5['query'][_0xec22('0x5a')]+'%'};return _0x757f3d;}})});}_0xc4e61a=_[_0xec22('0x5d')]({},_0xc4e61a,_0xa25da5['options']);var _0x139f46={'where':_0xc4e61a[_0xec22('0x5b')]};return db[_0xec22('0x5e')][_0xec22('0x5f')](_0x139f46)[_0xec22('0x13')](function(_0x58c56d){_0x100851['count']=_0x58c56d;if(_0xa25da5[_0xec22('0x4e')][_0xec22('0x60')]){_0xc4e61a['include']=[{'all':!![]}];}return db[_0xec22('0x5e')][_0xec22('0x61')](_0xc4e61a);})[_0xec22('0x13')](function(_0x399619){_0x100851[_0xec22('0x62')]=_0x399619;return _0x100851;})[_0xec22('0x13')](respondWithFilteredResult(_0x203fa8,_0xc4e61a))[_0xec22('0x1e')](handleError(_0x203fa8,null));};exports[_0xec22('0x63')]=function(_0x1a31dd,_0x363d10){var _0x13e566={'raw':![],'where':{'id':_0x1a31dd[_0xec22('0x64')]['id']},'include':[{'model':db[_0xec22('0x65')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xec22('0x44')},{'model':db[_0xec22('0x46')],'as':_0xec22('0x47')}]},_0x29473f={};_0x29473f[_0xec22('0x4d')]=_[_0xec22('0x4f')](db[_0xec22('0x5e')]['rawAttributes']);_0x29473f[_0xec22('0x4e')]=_[_0xec22('0x4f')](_0x1a31dd[_0xec22('0x4e')]);_0x29473f[_0xec22('0x50')]=_[_0xec22('0x51')](_0x29473f['model'],_0x29473f[_0xec22('0x4e')]);_0x13e566[_0xec22('0x52')]=_['intersection'](_0x29473f[_0xec22('0x4d')],qs[_0xec22('0x53')](_0x1a31dd['query']['fields']));_0x13e566['attributes']=_0x13e566['attributes'][_0xec22('0x54')]?_0x13e566['attributes']:_0x29473f[_0xec22('0x4d')];if(_0x1a31dd['query'][_0xec22('0x60')]){_0x13e566[_0xec22('0x66')]=[{'all':!![]}];}_0x13e566=_['merge']({},_0x13e566,_0x1a31dd[_0xec22('0x67')]);return db['MailAccount'][_0xec22('0x68')](_0x13e566)[_0xec22('0x13')](handleEntityNotFound(_0x363d10,null))['then'](respondWithResult(_0x363d10,null))[_0xec22('0x1e')](handleError(_0x363d10,null));};exports[_0xec22('0x27')]=function(_0x3e451f,_0x1df00f){if(_0x3e451f[_0xec22('0x69')]['id']){delete _0x3e451f[_0xec22('0x69')]['id'];}var _0x2a7851=_0x3e451f[_0xec22('0x69')][_0xec22('0x6a')]===_0xec22('0x6b')?null:_0x3e451f['body'][_0xec22('0x6a')];var _0x3bc477=_0x3e451f['body']['Imap']||{};var _0x58d507=_0x3e451f[_0xec22('0x69')][_0xec22('0x44')]||{};if(_0x2a7851){_0x3bc477[_0xec22('0x3e')]=getImapHost(_0x2a7851);_0x3bc477[_0xec22('0x3f')]=0x3e1;_0x58d507['host']=getSmtpHost(_0x2a7851);_0x58d507['port']=0x24b;_0x58d507[_0xec22('0x40')]=![];}if(_0x58d507[_0xec22('0x3c')]){_0x58d507['secure']=![];}else{_0x58d507[_0xec22('0x3d')]=null;}if(!_0x3bc477['modernAuthentication'])_0x3bc477['CloudProviderId']=null;_0x3e451f['body'][_0xec22('0x43')]=_0x3bc477;_0x3e451f[_0xec22('0x69')][_0xec22('0x44')]=_0x58d507;return db[_0xec22('0x5e')]['find']({'where':{'id':_0x3e451f[_0xec22('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xec22('0x43')},{'model':db[_0xec22('0x45')],'as':'Smtp'},{'model':db[_0xec22('0x46')],'as':_0xec22('0x47')}]})[_0xec22('0x13')](handleEntityNotFound(_0x1df00f,null))[_0xec22('0x13')](function(_0x1948bd){if(!_0x1948bd)throw new Error(_0xec22('0x6c'));if(_0x1948bd[_0xec22('0x41')])delete _0x3e451f[_0xec22('0x69')][_0xec22('0x43')];return _0x1948bd;})[_0xec22('0x13')](saveUpdates(_0x3e451f[_0xec22('0x69')],null))['then'](function(_0x4ce2e7){if(!_0x3e451f[_0xec22('0x69')][_0xec22('0x43')])return _0x4ce2e7;return db[_0xec22('0x65')]['update'](_0x3e451f['body'][_0xec22('0x43')],{'where':{'MailAccountId':_0x4ce2e7['id']}})[_0xec22('0x13')](function(){return _0x4ce2e7;});})[_0xec22('0x13')](function(_0x2c4b13){if(!_0x3e451f[_0xec22('0x69')][_0xec22('0x44')])return _0x2c4b13;return db['MailServerOut']['update'](_0x3e451f['body']['Smtp'],{'where':{'MailAccountId':_0x2c4b13['id']}})[_0xec22('0x13')](function(){return _0x2c4b13;});})[_0xec22('0x13')](respondWithResult(_0x1df00f,null))[_0xec22('0x1e')](handleError(_0x1df00f,null));};exports[_0xec22('0x6d')]=function(_0x261836,_0xd5c943){return db[_0xec22('0x5e')][_0xec22('0x6d')]()['then'](respondWithResult(_0xd5c943,null))[_0xec22('0x1e')](handleError(_0xd5c943,null));};exports['addDisposition']=function(_0xa9c474,_0x72cf11){if(_0xa9c474[_0xec22('0x69')]['id']){delete _0xa9c474['body']['id'];}return db[_0xec22('0x5e')][_0xec22('0x68')]({'where':{'id':_0xa9c474['params']['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x72cf11,null))['then'](function(_0x46c48c){if(_0x46c48c){_0xa9c474[_0xec22('0x69')][_0xec22('0x6e')]=_0x46c48c['id'];return db[_0xec22('0x6f')]['create'](_0xa9c474[_0xec22('0x69')]);}})[_0xec22('0x13')](respondWithResult(_0x72cf11,null))[_0xec22('0x1e')](handleError(_0x72cf11,null));};exports[_0xec22('0x70')]=function(_0x35c712,_0xd8ba29){var _0x57ed9a={'raw':![],'where':{}};var _0x3f37f7={};var _0x2c5f49={'count':0x0,'rows':[]};return db[_0xec22('0x5e')][_0xec22('0x71')]({'where':{'id':_0x35c712[_0xec22('0x64')]['id']}})['then'](handleEntityNotFound(_0xd8ba29,null))[_0xec22('0x13')](function(_0x2e5033){if(_0x2e5033){_0x3f37f7[_0xec22('0x4d')]=_[_0xec22('0x4f')](db[_0xec22('0x6f')][_0xec22('0x49')]);_0x3f37f7[_0xec22('0x4e')]=_['keys'](_0x35c712['query']);_0x3f37f7[_0xec22('0x50')]=_['intersection'](_0x3f37f7['model'],_0x3f37f7[_0xec22('0x4e')]);_0x57ed9a[_0xec22('0x52')]=_[_0xec22('0x51')](_0x3f37f7['model'],qs['fields'](_0x35c712['query'][_0xec22('0x53')]));_0x57ed9a['attributes']=_0x57ed9a['attributes'][_0xec22('0x54')]?_0x57ed9a[_0xec22('0x52')]:_0x3f37f7[_0xec22('0x4d')];if(!_0x35c712['query'][_0xec22('0x55')](_0xec22('0x56'))){_0x57ed9a[_0xec22('0x25')]=qs[_0xec22('0x25')](_0x35c712[_0xec22('0x4e')][_0xec22('0x25')]);_0x57ed9a['offset']=qs[_0xec22('0x23')](_0x35c712[_0xec22('0x4e')][_0xec22('0x23')]);}_0x57ed9a[_0xec22('0x57')]=qs[_0xec22('0x58')](_0x35c712['query'][_0xec22('0x58')]);_0x57ed9a['where']=qs[_0xec22('0x50')](_[_0xec22('0x59')](_0x35c712[_0xec22('0x4e')],_0x3f37f7[_0xec22('0x50')]));_0x57ed9a[_0xec22('0x5b')][_0xec22('0x6e')]=_0x2e5033['id'];if(_0x35c712[_0xec22('0x4e')]['filter']){_0x57ed9a[_0xec22('0x5b')]=_[_0xec22('0x5d')](_0x57ed9a[_0xec22('0x5b')],{'$or':_['map'](_0x57ed9a[_0xec22('0x52')],function(_0x13eba4){var _0x51a9f3={};_0x51a9f3[_0x13eba4]={'$like':'%'+_0x35c712['query']['filter']+'%'};return _0x51a9f3;})});}_0x57ed9a=_[_0xec22('0x5d')]({},_0x57ed9a,_0x35c712[_0xec22('0x67')]);return db['Disposition'][_0xec22('0x5f')]({'where':_0x57ed9a['where']})[_0xec22('0x13')](function(_0x1d31e8){_0x2c5f49[_0xec22('0x5f')]=_0x1d31e8;if(_0x35c712[_0xec22('0x4e')]['includeAll']){_0x57ed9a[_0xec22('0x66')]=[{'all':!![]}];}return db[_0xec22('0x6f')][_0xec22('0x61')](_0x57ed9a);})['then'](function(_0x3851b5){_0x2c5f49[_0xec22('0x62')]=_0x3851b5;return _0x2c5f49;});}})[_0xec22('0x13')](respondWithFilteredResult(_0xd8ba29,_0x57ed9a))['catch'](handleError(_0xd8ba29,null));};exports[_0xec22('0x72')]=function(_0x588666,_0x55f981){return db[_0xec22('0x5e')]['find']({'where':{'id':_0x588666[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x55f981,null))[_0xec22('0x13')](function(_0x447c5b){if(_0x447c5b){return _0x447c5b[_0xec22('0x72')](_0x588666[_0xec22('0x4e')][_0xec22('0x73')]);}})[_0xec22('0x13')](respondWithStatusCode(_0x55f981,null))[_0xec22('0x1e')](handleError(_0x55f981,null));};exports['addAnswer']=function(_0x13073a,_0x44d3a0){if(_0x13073a[_0xec22('0x69')]['id']){delete _0x13073a[_0xec22('0x69')]['id'];}return db[_0xec22('0x5e')]['find']({'where':{'id':_0x13073a[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x44d3a0,null))[_0xec22('0x13')](function(_0xbeb897){if(_0xbeb897){_0x13073a[_0xec22('0x69')][_0xec22('0x6e')]=_0xbeb897['id'];return db['CannedAnswer'][_0xec22('0x74')](_0x13073a['body']);}})[_0xec22('0x13')](respondWithResult(_0x44d3a0,null))['catch'](handleError(_0x44d3a0,null));};exports['getAnswers']=function(_0x21af57,_0x3f5e75){var _0x26027c={'raw':![],'where':{}};var _0x563b9b={};var _0x7cfa3f={'count':0x0,'rows':[]};return db[_0xec22('0x5e')][_0xec22('0x71')]({'where':{'id':_0x21af57[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x3f5e75,null))[_0xec22('0x13')](function(_0x1d720b){if(_0x1d720b){_0x563b9b[_0xec22('0x4d')]=_[_0xec22('0x4f')](db[_0xec22('0x75')][_0xec22('0x49')]);_0x563b9b[_0xec22('0x4e')]=_['keys'](_0x21af57[_0xec22('0x4e')]);_0x563b9b[_0xec22('0x50')]=_['intersection'](_0x563b9b[_0xec22('0x4d')],_0x563b9b[_0xec22('0x4e')]);_0x26027c[_0xec22('0x52')]=_[_0xec22('0x51')](_0x563b9b[_0xec22('0x4d')],qs[_0xec22('0x53')](_0x21af57[_0xec22('0x4e')][_0xec22('0x53')]));_0x26027c[_0xec22('0x52')]=_0x26027c[_0xec22('0x52')][_0xec22('0x54')]?_0x26027c[_0xec22('0x52')]:_0x563b9b[_0xec22('0x4d')];if(!_0x21af57[_0xec22('0x4e')][_0xec22('0x55')]('nolimit')){_0x26027c[_0xec22('0x25')]=qs[_0xec22('0x25')](_0x21af57['query'][_0xec22('0x25')]);_0x26027c[_0xec22('0x23')]=qs[_0xec22('0x23')](_0x21af57['query']['offset']);}_0x26027c[_0xec22('0x57')]=qs[_0xec22('0x58')](_0x21af57['query'][_0xec22('0x58')]);_0x26027c['where']=qs['filters'](_[_0xec22('0x59')](_0x21af57[_0xec22('0x4e')],_0x563b9b[_0xec22('0x50')]));_0x26027c[_0xec22('0x5b')]['MailAccountId']=_0x1d720b['id'];if(_0x21af57[_0xec22('0x4e')][_0xec22('0x5a')]){_0x26027c[_0xec22('0x5b')]=_[_0xec22('0x5d')](_0x26027c[_0xec22('0x5b')],{'$or':_[_0xec22('0x48')](_0x26027c[_0xec22('0x52')],function(_0x14c1e4){var _0x4452d1={};_0x4452d1[_0x14c1e4]={'$like':'%'+_0x21af57[_0xec22('0x4e')][_0xec22('0x5a')]+'%'};return _0x4452d1;})});}_0x26027c=_['merge']({},_0x26027c,_0x21af57[_0xec22('0x67')]);return db[_0xec22('0x75')]['count']({'where':_0x26027c[_0xec22('0x5b')]})[_0xec22('0x13')](function(_0x5eca84){_0x7cfa3f['count']=_0x5eca84;if(_0x21af57[_0xec22('0x4e')][_0xec22('0x60')]){_0x26027c[_0xec22('0x66')]=[{'all':!![]}];}return db[_0xec22('0x75')][_0xec22('0x61')](_0x26027c);})[_0xec22('0x13')](function(_0x2ba457){_0x7cfa3f['rows']=_0x2ba457;return _0x7cfa3f;});}})[_0xec22('0x13')](respondWithFilteredResult(_0x3f5e75,_0x26027c))['catch'](handleError(_0x3f5e75,null));};exports['removeAnswers']=function(_0x5164d8,_0x18e1bd){return db[_0xec22('0x5e')][_0xec22('0x68')]({'where':{'id':_0x5164d8[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x18e1bd,null))['then'](function(_0x555e32){if(_0x555e32){return _0x555e32[_0xec22('0x76')](_0x5164d8[_0xec22('0x4e')][_0xec22('0x73')]);}})[_0xec22('0x13')](respondWithStatusCode(_0x18e1bd,null))[_0xec22('0x1e')](handleError(_0x18e1bd,null));};exports['create']=function(_0x3a0396,_0x3096a4){var _0x945afc={'name':_0x3a0396['body'][_0xec22('0x2b')],'key':_0x3a0396[_0xec22('0x69')][_0xec22('0x4c')],'provider':_0x3a0396[_0xec22('0x69')][_0xec22('0x6a')]===_0xec22('0x6b')?null:_0x3a0396['body'][_0xec22('0x6a')],'email':_0x3a0396[_0xec22('0x69')]['email'],'ListId':_0x3a0396[_0xec22('0x69')]['ListId'],'active':!_[_0xec22('0x77')](_0x3a0396[_0xec22('0x69')][_0xec22('0x78')])?_0x3a0396['body']['active']:!![],'description':_0x3a0396[_0xec22('0x69')][_0xec22('0x79')]||null};var _0x4862da=getAuthenticationOptions(_0x945afc[_0xec22('0x6a')],_0x3a0396[_0xec22('0x69')]);_0x945afc['Imap']=_0x4862da['Imap'];_0x945afc[_0xec22('0x44')]=_0x4862da[_0xec22('0x44')];return db['MailAccount'][_0xec22('0x74')](_0x945afc,{'include':[{'model':db['MailServerOut'],'as':_0xec22('0x44')},{'model':db[_0xec22('0x65')],'as':'Imap'}]})[_0xec22('0x13')](function(_0x3db1e4){var _0x3459ce=_0x3a0396[_0xec22('0x38')][_0xec22('0x7a')]({'plain':!![]});if(!_0x3459ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3459ce[_0xec22('0x7b')]===_0xec22('0x38')){var _0x1fa92a=_0x3db1e4[_0xec22('0x7a')]({'plain':!![]});return db['UserProfileSection'][_0xec22('0x68')]({'where':{'name':_0xec22('0x29'),'userProfileId':_0x3459ce[_0xec22('0x7c')]},'raw':!![]})[_0xec22('0x13')](function(_0x55a066){if(_0x55a066&&_0x55a066[_0xec22('0x7d')]===0x0){return db['UserProfileResource'][_0xec22('0x74')]({'name':_0x1fa92a['name'],'resourceId':_0x1fa92a['id'],'type':_0x55a066[_0xec22('0x2b')],'sectionId':_0x55a066['id']},{})['then'](function(){return _0x3db1e4;});}else{return _0x3db1e4;}})[_0xec22('0x1e')](function(_0x40465c){logger[_0xec22('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40465c);throw _0x40465c;});}return _0x3db1e4;})[_0xec22('0x13')](respondWithResult(_0x3096a4,0xc9))[_0xec22('0x1e')](handleError(_0x3096a4,null));};exports[_0xec22('0x7e')]=function(_0x35eeee,_0x5a5d70){return db[_0xec22('0x5e')][_0xec22('0x71')]({'where':{'id':_0x35eeee[_0xec22('0x64')]['id']}})['then'](handleEntityNotFound(_0x5a5d70,null))['then'](function(_0x19c863){if(_0x19c863){return _0x19c863['getImap']();}return null;})[_0xec22('0x13')](respondWithResult(_0x5a5d70,null))[_0xec22('0x1e')](handleError(_0x5a5d70,null));};exports[_0xec22('0x7f')]=function(_0xadaa83,_0x1d444a){if(_0xadaa83['body']['id']){delete _0xadaa83[_0xec22('0x69')]['id'];}return db['MailAccount']['find']({'where':{'id':_0xadaa83['params']['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x1d444a,null))[_0xec22('0x13')](function(_0x3b9bed){if(_0x3b9bed){_0xadaa83[_0xec22('0x69')]['MailAccountId']=_0x3b9bed['id'];return db['MailServerIn'][_0xec22('0x74')](_0xadaa83[_0xec22('0x69')]);}})[_0xec22('0x13')](respondWithResult(_0x1d444a,null))[_0xec22('0x1e')](handleError(_0x1d444a,null));};exports['removeImap']=function(_0x242954,_0x24f9de){return db[_0xec22('0x5e')]['findOne']({'where':{'id':_0x242954[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x24f9de,null))[_0xec22('0x13')](function(_0x402fc2){if(_0x402fc2){return _0x402fc2[_0xec22('0x80')](null);}return null;})[_0xec22('0x13')](respondWithStatusCode(_0x24f9de,null))[_0xec22('0x1e')](handleError(_0x24f9de,null));};exports[_0xec22('0x81')]=function(_0x5afbc6,_0xe78c11){return db[_0xec22('0x5e')][_0xec22('0x71')]({'where':{'id':_0x5afbc6['params']['id']}})[_0xec22('0x13')](handleEntityNotFound(_0xe78c11,null))[_0xec22('0x13')](function(_0x310e2d){if(_0x310e2d){return _0x310e2d[_0xec22('0x81')]();}return null;})[_0xec22('0x13')](respondWithResult(_0xe78c11,null))[_0xec22('0x1e')](handleError(_0xe78c11,null));};exports[_0xec22('0x82')]=function(_0x3bbc6b,_0x336e67){if(_0x3bbc6b[_0xec22('0x69')]['id']){delete _0x3bbc6b[_0xec22('0x69')]['id'];}return db[_0xec22('0x5e')]['find']({'where':{'id':_0x3bbc6b[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x336e67,null))[_0xec22('0x13')](function(_0x1c9380){if(_0x1c9380){_0x3bbc6b[_0xec22('0x69')]['MailAccountId']=_0x1c9380['id'];return db[_0xec22('0x45')][_0xec22('0x74')](_0x3bbc6b[_0xec22('0x69')]);}})[_0xec22('0x13')](respondWithResult(_0x336e67,null))[_0xec22('0x1e')](handleError(_0x336e67,null));};exports[_0xec22('0x83')]=function(_0x59093e,_0x178003){return db[_0xec22('0x5e')][_0xec22('0x71')]({'where':{'id':_0x59093e[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x178003,null))[_0xec22('0x13')](function(_0x151f46){if(_0x151f46){return _0x151f46[_0xec22('0x84')](null);}return null;})[_0xec22('0x13')](respondWithStatusCode(_0x178003,null))[_0xec22('0x1e')](handleError(_0x178003,null));};exports['addInteraction']=function(_0x3d3d5e,_0x3d3b3d){return db['MailInteraction']['find']({'where':{'id':_0x3d3d5e[_0xec22('0x64')]['id']}})['then'](handleEntityNotFound(_0x3d3b3d,null))[_0xec22('0x13')](function(_0x1beac8){if(_0x1beac8){return _0x1beac8[_0xec22('0x85')](_0x3d3d5e[_0xec22('0x69')][_0xec22('0x73')],_['omit'](_0x3d3d5e['body'],[_0xec22('0x73'),'id'])||{});}})[_0xec22('0x13')](respondWithResult(_0x3d3b3d,null))[_0xec22('0x1e')](handleError(_0x3d3b3d,null));};exports[_0xec22('0x86')]=function(_0x4a0a18,_0x553e7f){var _0x13908a={'raw':![],'where':{}};var _0x4ff257={};var _0x3193af={'count':0x0,'rows':[]};return db[_0xec22('0x5e')][_0xec22('0x71')]({'where':{'id':_0x4a0a18[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x553e7f,null))[_0xec22('0x13')](function(_0x12a18e){if(_0x12a18e){_0x4ff257['model']=_[_0xec22('0x4f')](db[_0xec22('0x87')][_0xec22('0x49')]);_0x4ff257[_0xec22('0x4e')]=_[_0xec22('0x4f')](_0x4a0a18['query']);_0x4ff257['filters']=_['intersection'](_0x4ff257[_0xec22('0x4d')],_0x4ff257[_0xec22('0x4e')]);_0x13908a[_0xec22('0x52')]=_[_0xec22('0x51')](_0x4ff257[_0xec22('0x4d')],qs[_0xec22('0x53')](_0x4a0a18[_0xec22('0x4e')][_0xec22('0x53')]));_0x13908a['attributes']=_0x13908a[_0xec22('0x52')][_0xec22('0x54')]?_0x13908a['attributes']:_0x4ff257[_0xec22('0x4d')];if(!_0x4a0a18[_0xec22('0x4e')]['hasOwnProperty'](_0xec22('0x56'))){_0x13908a['limit']=qs[_0xec22('0x25')](_0x4a0a18[_0xec22('0x4e')][_0xec22('0x25')]);_0x13908a[_0xec22('0x23')]=qs[_0xec22('0x23')](_0x4a0a18[_0xec22('0x4e')][_0xec22('0x23')]);}_0x13908a[_0xec22('0x57')]=qs[_0xec22('0x58')](_0x4a0a18[_0xec22('0x4e')][_0xec22('0x58')]);_0x13908a[_0xec22('0x5b')]=qs[_0xec22('0x50')](_[_0xec22('0x59')](_0x4a0a18['query'],_0x4ff257[_0xec22('0x50')]));_0x13908a[_0xec22('0x5b')][_0xec22('0x6e')]=_0x12a18e['id'];if(_0x4a0a18[_0xec22('0x4e')][_0xec22('0x5a')]){_0x13908a[_0xec22('0x5b')]=_[_0xec22('0x5d')](_0x13908a[_0xec22('0x5b')],{'$or':_[_0xec22('0x48')](_0x13908a[_0xec22('0x52')],function(_0x58f4cc){var _0x5774b2={};_0x5774b2[_0x58f4cc]={'$like':'%'+_0x4a0a18[_0xec22('0x4e')][_0xec22('0x5a')]+'%'};return _0x5774b2;})});}_0x13908a=_[_0xec22('0x5d')]({},_0x13908a,_0x4a0a18['options']);return db['MailInteraction'][_0xec22('0x5f')]({'where':_0x13908a['where']})[_0xec22('0x13')](function(_0x405a12){_0x3193af[_0xec22('0x5f')]=_0x405a12;if(_0x4a0a18[_0xec22('0x4e')][_0xec22('0x60')]){_0x13908a[_0xec22('0x66')]=[{'model':db[_0xec22('0x88')],'as':_0xec22('0x89'),'required':![]},{'model':db[_0xec22('0x8a')],'as':_0xec22('0x8b'),'attributes':[_0xec22('0x2b'),'fullname',_0xec22('0x8c')],'required':![]},{'model':db[_0xec22('0x8d')],'as':_0xec22('0x8e'),'attributes':['id','name',_0xec22('0x8f')],'where':_0x4a0a18['query'][_0xec22('0x90')]?{'id':_0x4a0a18[_0xec22('0x4e')][_0xec22('0x90')]}:undefined,'required':_0x4a0a18['query'][_0xec22('0x90')]?!![]:![]}];}return db[_0xec22('0x87')][_0xec22('0x61')](_0x13908a);})['then'](function(_0xc421a1){_0x3193af['rows']=_0xc421a1;return _0x3193af;});}})['then'](respondWithFilteredResult(_0x553e7f,_0x13908a))[_0xec22('0x1e')](handleError(_0x553e7f,null));};exports[_0xec22('0x91')]=function addApplications(_0x15a40f,_0x2dfe2e){var _0x57d855=_0x15a40f[_0xec22('0x64')]['id'];var _0x54974d=_0x15a40f[_0xec22('0x69')];var _0x19bf51=0xc8;var _0x13ecf6=null;return db[_0xec22('0x92')][_0xec22('0x93')]({'isolationLevel':db['sequelize'][_0xec22('0x94')][_0xec22('0x95')]['READ_COMMITTED']},function(_0x261df6){return db[_0xec22('0x5e')][_0xec22('0x71')]({'where':{'id':_0x57d855},'transaction':_0x261df6})[_0xec22('0x13')](function(_0x48fac9){if(_0x48fac9){return db['MailApplication'][_0xec22('0x28')]({'where':{'MailAccountId':_0x57d855},'transaction':_0x261df6})[_0xec22('0x13')](function(){var _0x25b821=_[_0xec22('0x48')](_0x54974d,function(_0x1717f9){_0x1717f9[_0xec22('0x6e')]=_0x57d855;return _0x1717f9;});return db[_0xec22('0x96')][_0xec22('0x97')](_0x25b821,{'transaction':_0x261df6});});}else{_0x19bf51=0x194;_0x13ecf6=[];}});})[_0xec22('0x13')](function(){if(_0x19bf51!==0x194){return db[_0xec22('0x96')][_0xec22('0x98')]({'where':{'MailAccountId':_0x57d855},'order':_0xec22('0x99')})[_0xec22('0x13')](function(_0x546871){_0x13ecf6=_0x546871;});}})[_0xec22('0x1e')](function(_0x57bf07){_0x19bf51=0x1f4;logger[_0xec22('0x1a')](_0x57bf07[_0xec22('0x2a')]);if(_0x57bf07[_0xec22('0x2b')]){delete _0x57bf07['name'];}_0x13ecf6=_0x57bf07;})['finally'](function(){if(_0x13ecf6===null){_0x2dfe2e[_0xec22('0x1f')](_0x19bf51);}else{if(_0x19bf51===0x1f4){_0x2dfe2e[_0xec22('0x20')](_0x19bf51)['send'](_0x13ecf6);}else{_0x2dfe2e[_0xec22('0x20')](_0x19bf51)[_0xec22('0x22')](_0x13ecf6);}}});};exports[_0xec22('0x9a')]=function(_0x228c55,_0x267777){var _0x2998f2={};var _0x1b7039={};var _0x5afc8d;var _0x200f98;return db['MailAccount'][_0xec22('0x71')]({'where':{'id':_0x228c55[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x267777,null))[_0xec22('0x13')](function(_0x388b6a){if(_0x388b6a){_0x5afc8d=_0x388b6a;_0x1b7039[_0xec22('0x4d')]=_[_0xec22('0x4f')](db[_0xec22('0x96')][_0xec22('0x49')]);_0x1b7039['query']=_[_0xec22('0x4f')](_0x228c55[_0xec22('0x4e')]);_0x1b7039['filters']=_['intersection'](_0x1b7039[_0xec22('0x4d')],_0x1b7039[_0xec22('0x4e')]);_0x2998f2[_0xec22('0x52')]=_[_0xec22('0x51')](_0x1b7039['model'],qs['fields'](_0x228c55[_0xec22('0x4e')][_0xec22('0x53')]));_0x2998f2['attributes']=_0x2998f2[_0xec22('0x52')][_0xec22('0x54')]?_0x2998f2[_0xec22('0x52')]:_0x1b7039[_0xec22('0x4d')];_0x2998f2['order']=qs[_0xec22('0x58')](_0x228c55[_0xec22('0x4e')]['sort']);_0x2998f2[_0xec22('0x5b')]=qs[_0xec22('0x50')](_[_0xec22('0x59')](_0x228c55[_0xec22('0x4e')],_0x1b7039[_0xec22('0x50')]));if(_0x228c55[_0xec22('0x4e')]['filter']){_0x2998f2[_0xec22('0x5b')]=_[_0xec22('0x5d')](_0x2998f2[_0xec22('0x5b')],{'$or':_['map'](_0x2998f2[_0xec22('0x52')],function(_0x9c63ca){var _0xfc4e70={};_0xfc4e70[_0x9c63ca]={'$like':'%'+_0x228c55[_0xec22('0x4e')][_0xec22('0x5a')]+'%'};return _0xfc4e70;})});}_0x2998f2=_[_0xec22('0x5d')]({},_0x2998f2,_0x228c55['options']);return _0x5afc8d[_0xec22('0x9a')](_0x2998f2);}})[_0xec22('0x13')](function(_0x244d72){if(_0x244d72){_0x200f98=_0x244d72[_0xec22('0x54')];if(!_0x228c55[_0xec22('0x4e')][_0xec22('0x55')]('nolimit')){_0x2998f2[_0xec22('0x25')]=qs[_0xec22('0x25')](_0x228c55[_0xec22('0x4e')][_0xec22('0x25')]);_0x2998f2[_0xec22('0x23')]=qs[_0xec22('0x23')](_0x228c55[_0xec22('0x4e')][_0xec22('0x23')]);}return _0x5afc8d[_0xec22('0x9a')](_0x2998f2);}})[_0xec22('0x13')](function(_0x758663){if(_0x758663){return _0x758663?{'count':_0x200f98,'rows':_0x758663}:null;}})[_0xec22('0x13')](respondWithResult(_0x267777,null))[_0xec22('0x1e')](handleError(_0x267777,null));};exports[_0xec22('0x9b')]=function(_0x51874b,_0x568fa4){var _0x559cc7={'raw':!![],'where':{}};var _0x3563f5={};var _0x10c4f1={'count':0x0,'rows':[]};return db['MailAccount'][_0xec22('0x71')]({'where':{'id':_0x51874b[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x568fa4,null))[_0xec22('0x13')](function(_0x5c08dc){if(_0x5c08dc){_0x3563f5[_0xec22('0x4d')]=_['keys'](db['MailMessage']['rawAttributes']);_0x3563f5[_0xec22('0x4e')]=_[_0xec22('0x4f')](_0x51874b['query']);_0x3563f5[_0xec22('0x50')]=_[_0xec22('0x51')](_0x3563f5['model'],_0x3563f5[_0xec22('0x4e')]);_0x559cc7[_0xec22('0x52')]=_[_0xec22('0x51')](_0x3563f5[_0xec22('0x4d')],qs['fields'](_0x51874b[_0xec22('0x4e')]['fields']));_0x559cc7[_0xec22('0x52')]=_0x559cc7[_0xec22('0x52')][_0xec22('0x54')]?_0x559cc7[_0xec22('0x52')]:_0x3563f5[_0xec22('0x4d')];if(!_0x51874b[_0xec22('0x4e')][_0xec22('0x55')](_0xec22('0x56'))){_0x559cc7[_0xec22('0x25')]=qs[_0xec22('0x25')](_0x51874b['query']['limit']);_0x559cc7[_0xec22('0x23')]=qs['offset'](_0x51874b['query'][_0xec22('0x23')]);}_0x559cc7['order']=qs[_0xec22('0x58')](_0x51874b[_0xec22('0x4e')][_0xec22('0x58')]);_0x559cc7['where']=qs[_0xec22('0x50')](_[_0xec22('0x59')](_0x51874b[_0xec22('0x4e')],_0x3563f5['filters']));_0x559cc7[_0xec22('0x5b')][_0xec22('0x6e')]=_0x5c08dc['id'];if(_0x51874b['query'][_0xec22('0x5a')]){_0x559cc7[_0xec22('0x5b')]=_['merge'](_0x559cc7['where'],{'$or':_[_0xec22('0x48')](_0x559cc7[_0xec22('0x52')],function(_0x39c672){var _0x4b0e40={};_0x4b0e40[_0x39c672]={'$like':'%'+_0x51874b[_0xec22('0x4e')][_0xec22('0x5a')]+'%'};return _0x4b0e40;})});}if(_0x51874b[_0xec22('0x4e')][_0xec22('0x9c')]){var _0x652af1=_0x51874b[_0xec22('0x4e')][_0xec22('0x9c')]['split'](',');var _0x2d67a6={};_0x2d67a6[_0x652af1[0x0]]={'$gte':moment(_0x652af1[0x1])[_0xec22('0x9d')](_0xec22('0x9e'))};_0x559cc7[_0xec22('0x5b')]=_[_0xec22('0x5d')](_0x559cc7[_0xec22('0x5b')],_0x2d67a6);}_0x559cc7=_[_0xec22('0x5d')]({},_0x559cc7,_0x51874b[_0xec22('0x67')]);return db['MailMessage'][_0xec22('0x5f')]({'where':_0x559cc7['where']})[_0xec22('0x13')](function(_0x260293){_0x10c4f1[_0xec22('0x5f')]=_0x260293;if(_0x51874b[_0xec22('0x4e')]['includeAll']){_0x559cc7[_0xec22('0x66')]=[{'all':!![]}];}return db[_0xec22('0x9f')]['findAll'](_0x559cc7);})['then'](function(_0x5effa1){if(_0x51874b['query'][_0xec22('0xa0')]===_0xec22('0xa1')){for(var _0x261382=0x0;_0x261382<_0x5effa1[_0xec22('0x54')];_0x261382++){_0x5effa1[_0x261382][_0xec22('0x69')]=juice(_0x5effa1[_0x261382][_0xec22('0x69')]);}}_0x10c4f1[_0xec22('0x62')]=_0x5effa1;return _0x10c4f1;});}})[_0xec22('0x13')](respondWithFilteredResult(_0x568fa4,_0x559cc7))[_0xec22('0x1e')](handleError(_0x568fa4,null));};exports[_0xec22('0x2c')]=function(_0x562026,_0x144976){var _0x561a9c,_0x548dd5={},_0xba85e2;if(_0x562026['body']['to']){_0xba85e2=_0x562026[_0xec22('0x69')]['to'][_0xec22('0xa2')](',')[0x0];}return db[_0xec22('0x5e')][_0xec22('0x68')]({'where':{'id':_0x562026[_0xec22('0x64')]['id']},'include':[{'model':db[_0xec22('0xa3')],'as':_0xec22('0xa4'),'include':[{'model':db[_0xec22('0x88')],'as':_0xec22('0xa5'),'where':{'email':_0xba85e2},'limit':0x1,'order':[['updatedAt',_0xec22('0xa6')]]}]},{'model':db[_0xec22('0x45')],'as':_0xec22('0x44'),'raw':!![],'include':[{'model':db[_0xec22('0xa7')],'as':_0xec22('0xa7'),'raw':!![]}]}]})[_0xec22('0x13')](handleEntityNotFound(_0x144976,null))[_0xec22('0x13')](function(_0x358f87){if(!_0x358f87)return;_0x561a9c=_0x358f87;if(!_0x358f87[_0xec22('0x44')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0xec22('0x77')](_0x562026['body']['from'])){_0x562026['body'][_0xec22('0xa8')]=util[_0xec22('0x9d')]('%s\x20<%s>',_0x358f87['name'],_0x358f87[_0xec22('0xa9')]||_0x358f87['Smtp'][_0xec22('0x38')]);}if(_0x562026[_0xec22('0x69')][_0xec22('0xaa')]&&_0x562026['body'][_0xec22('0xaa')]['length']){for(var _0x298198=0x0;_0x298198<_0x562026[_0xec22('0x69')][_0xec22('0xaa')][_0xec22('0x54')];_0x298198+=0x1){_0x562026[_0xec22('0x69')][_0xec22('0xaa')][_0x298198]={'filename':_0x562026[_0xec22('0x69')][_0xec22('0xaa')][_0x298198][_0xec22('0x2b')],'path':path['join'](config['root'],_0xec22('0xab'),_0x562026['body']['attachments'][_0x298198]['basename'])};}}var _0x5ca320=_0x358f87[_0xec22('0xac')]();return respondWithRpcPromise(_0xec22('0xad'),'sendMail',{'account':_0x5ca320,'message':_0x562026[_0xec22('0x69')]});})['then'](function(_0x5a8098){if(!_0x5a8098)return;_0x548dd5=_0x5a8098;if(!_0x561a9c['List'])throw new Error(_0xec22('0xae'));if(_0x561a9c[_0xec22('0xa4')][_0xec22('0xa5')][_0xec22('0x54')])return _0x561a9c[_0xec22('0xa4')][_0xec22('0xa5')][0x0];return db[_0xec22('0x88')][_0xec22('0x74')](_['defaults'](_0x562026[_0xec22('0x69')],{'firstName':_0x562026[_0xec22('0x69')]['to'],'email':_0x562026[_0xec22('0x69')]['to'],'phone':_0x562026[_0xec22('0x69')]['to'],'ListId':_0x561a9c['ListId']}));})[_0xec22('0x13')](function(_0x28cb79){if(!_0x28cb79)return;var _0x1d98b8={'UserId':_0x562026[_0xec22('0x38')]['id'],'ContactId':_0x28cb79['id'],'MailAccountId':_0x561a9c['id'],'inReplyTo':_0x548dd5[_0xec22('0xaf')],'to':_0x562026[_0xec22('0x69')][_0xec22('0xa8')],'cc':_0x562026['body']['cc'],'subject':_0x562026[_0xec22('0x69')]['subject'],'attach':_0x562026[_0xec22('0x69')][_0xec22('0xb0')],'firstMsgDirection':_0xec22('0xb1'),'lastMsgAt':moment()[_0xec22('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xec22('0xb1'),'Messages':[_[_0xec22('0x5d')](_0x562026[_0xec22('0x69')],{'messageId':_0x548dd5['messageId'],'sentAt':moment()[_0xec22('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x561a9c['id'],'UserId':_0x562026['user']['id'],'ContactId':_0x28cb79['id']})]};if(_0x562026[_0xec22('0x69')][_0xec22('0xb2')]){_0x1d98b8=_[_0xec22('0x5d')](_0x1d98b8,_0x562026['body'][_0xec22('0xb2')]);}return db[_0xec22('0x87')][_0xec22('0x74')](_0x1d98b8,{'include':[{'model':db[_0xec22('0x9f')],'as':_0xec22('0xb3')}]});})[_0xec22('0x13')](respondWithResult(_0x144976,null))[_0xec22('0x1e')](handleError(_0x144976,null));};exports[_0xec22('0xb4')]=function(_0x31f166,_0x4a4eb6){return db['MailAccount'][_0xec22('0x68')]({'where':{'id':_0x31f166[_0xec22('0x64')]['id']},'include':[{'model':db[_0xec22('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xec22('0x13')](handleEntityNotFound(_0x4a4eb6,null))['then'](function(_0x361e43){if(!_0x361e43[_0xec22('0x44')])return;var _0x587c2e=_0x361e43[_0xec22('0xac')]();return respondWithRpcPromise('VerifySmtp',_0xec22('0xb4'),{'account':_0x587c2e});})['then'](respondWithResult(_0x4a4eb6,null))[_0xec22('0x1e')](handleError(_0x4a4eb6,null));};exports[_0xec22('0x28')]=function(_0x39adea,_0x50ca77){return db[_0xec22('0x5e')]['find']({'where':{'id':_0x39adea[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x50ca77,null))[_0xec22('0x13')](function(_0x553461){if(_0x553461&&_0x553461[_0xec22('0x41')]){throw new db[(_0xec22('0xb5'))]['ValidationError'](_0xec22('0xb6'));}return _0x553461;})[_0xec22('0x13')](removeEntity(_0x50ca77,null))['catch'](handleError(_0x50ca77,null));};exports[_0xec22('0xb7')]=function(_0x11dda1,_0x3c2e39){return db[_0xec22('0x5e')]['find']({'where':{'id':_0x11dda1[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x3c2e39,null))[_0xec22('0x13')](function(_0x58058e){if(_0x58058e){return _0x58058e[_0xec22('0xb7')](_0x11dda1[_0xec22('0x69')][_0xec22('0x73')],_[_0xec22('0xb8')](_0x11dda1[_0xec22('0x69')],[_0xec22('0x73'),'id'])||{})[_0xec22('0xb9')](function(_0x2ef3ac){for(var _0x3ad396=0x0;_0x3ad396<_0x11dda1[_0xec22('0x69')]['ids']['length'];_0x3ad396+=0x1){socket['emit'](_0xec22('0xba'),{'UserId':Number(_0x11dda1[_0xec22('0x69')]['ids'][_0x3ad396]),'MailAccountId':Number(_0x11dda1['params']['id'])});}return _0x2ef3ac;});}})['then'](respondWithResult(_0x3c2e39,null))[_0xec22('0x1e')](handleError(_0x3c2e39,null));};exports[_0xec22('0xbb')]=function(_0x43ac58,_0x363df2){return db[_0xec22('0x5e')]['find']({'where':{'id':_0x43ac58[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x363df2,null))[_0xec22('0x13')](function(_0x2c3c77){if(_0x2c3c77){return _0x2c3c77[_0xec22('0xbb')](_0x43ac58[_0xec22('0x4e')]['ids'])[_0xec22('0x13')](function(){if(_['isArray'](_0x43ac58['query'][_0xec22('0x73')])){for(var _0x40f437=0x0;_0x40f437<_0x43ac58[_0xec22('0x4e')]['ids'][_0xec22('0x54')];_0x40f437+=0x1){socket[_0xec22('0xbc')](_0xec22('0xbd'),{'UserId':Number(_0x43ac58['query'][_0xec22('0x73')][_0x40f437]),'MailAccountId':Number(_0x43ac58['params']['id'])});}}else{socket[_0xec22('0xbc')](_0xec22('0xbd'),{'UserId':Number(_0x43ac58[_0xec22('0x4e')][_0xec22('0x73')]),'MailAccountId':Number(_0x43ac58[_0xec22('0x64')]['id'])});}});}})[_0xec22('0x13')](respondWithStatusCode(_0x363df2,null))[_0xec22('0x1e')](handleError(_0x363df2,null));};exports[_0xec22('0xbe')]=function(_0x5dfa87,_0x36426a){var _0x21ab7f={};var _0x249d9c={};var _0x5223bb;var _0x4f0c68;return db['MailAccount'][_0xec22('0x71')]({'where':{'id':_0x5dfa87[_0xec22('0x64')]['id']}})[_0xec22('0x13')](handleEntityNotFound(_0x36426a,null))[_0xec22('0x13')](function(_0x2391d8){if(_0x2391d8){_0x5223bb=_0x2391d8;_0x249d9c[_0xec22('0x4d')]=_[_0xec22('0x4f')](db[_0xec22('0x8a')][_0xec22('0x49')]);_0x249d9c['query']=_[_0xec22('0x4f')](_0x5dfa87[_0xec22('0x4e')]);_0x249d9c['filters']=_[_0xec22('0x51')](_0x249d9c[_0xec22('0x4d')],_0x249d9c['query']);_0x21ab7f[_0xec22('0x52')]=_['intersection'](_0x249d9c[_0xec22('0x4d')],qs['fields'](_0x5dfa87[_0xec22('0x4e')][_0xec22('0x53')]));_0x21ab7f[_0xec22('0x52')]=_0x21ab7f[_0xec22('0x52')]['length']?_0x21ab7f[_0xec22('0x52')]:_0x249d9c['model'];_0x21ab7f[_0xec22('0x57')]=qs['sort'](_0x5dfa87[_0xec22('0x4e')]['sort']);_0x21ab7f[_0xec22('0x5b')]=qs[_0xec22('0x50')](_[_0xec22('0x59')](_0x5dfa87[_0xec22('0x4e')],_0x249d9c[_0xec22('0x50')]));if(_0x5dfa87[_0xec22('0x4e')][_0xec22('0x5a')]){_0x21ab7f[_0xec22('0x5b')]=_[_0xec22('0x5d')](_0x21ab7f['where'],{'$or':_[_0xec22('0x48')](_0x21ab7f[_0xec22('0x52')],function(_0x411762){var _0x1187f7={};_0x1187f7[_0x411762]={'$like':'%'+_0x5dfa87[_0xec22('0x4e')][_0xec22('0x5a')]+'%'};return _0x1187f7;})});}_0x21ab7f=_[_0xec22('0x5d')]({},_0x21ab7f,_0x5dfa87[_0xec22('0x67')]);return _0x5223bb['getAgents'](_0x21ab7f);}})[_0xec22('0x13')](function(_0x73fdfe){if(_0x73fdfe){_0x4f0c68=_0x73fdfe['length'];if(!_0x5dfa87['query'][_0xec22('0x55')](_0xec22('0x56'))){_0x21ab7f[_0xec22('0x25')]=qs[_0xec22('0x25')](_0x5dfa87[_0xec22('0x4e')][_0xec22('0x25')]);_0x21ab7f['offset']=qs[_0xec22('0x23')](_0x5dfa87['query'][_0xec22('0x23')]);}return _0x5223bb['getAgents'](_0x21ab7f);}})[_0xec22('0x13')](function(_0x47771c){if(_0x47771c){return _0x47771c?{'count':_0x4f0c68,'rows':_0x47771c}:null;}})[_0xec22('0x13')](respondWithResult(_0x36426a,null))[_0xec22('0x1e')](handleError(_0x36426a,null));}; \ No newline at end of file +var _0x29c7=['modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','intersection','length','find','update','body','provider','custom','describe','addDisposition','MailAccountId','Disposition','findOne','sort','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','List','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','basename','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','subject','format','out','messageId','Interaction','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','MailAccount,\x20%s,\x20%s','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','destroy','get','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','outlook365','user','username','pass','password'];(function(_0x5266fc,_0x151dde){var _0x5bef0a=function(_0x3f29b9){while(--_0x3f29b9){_0x5266fc['push'](_0x5266fc['shift']());}};_0x5bef0a(++_0x151dde);}(_0x29c7,0x147));var _0x729c=function(_0x367cdf,_0x15b107){_0x367cdf=_0x367cdf-0x0;var _0x2d3561=_0x29c7[_0x367cdf];return _0x2d3561;};'use strict';var moment=require(_0x729c('0x0'));var BPromise=require('bluebird');var util=require(_0x729c('0x1'));var path=require(_0x729c('0x2'));var _=require(_0x729c('0x3'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x729c('0x4'));var logger=require('../../config/logger')(_0x729c('0x5'));var config=require(_0x729c('0x6'));var db=require(_0x729c('0x7'))['db'];config[_0x729c('0x8')]=_[_0x729c('0x9')](config[_0x729c('0x8')],{'host':_0x729c('0xa'),'port':0x18eb});var socket=require(_0x729c('0xb'))(new Redis(config[_0x729c('0x8')]));require('./mailAccount.socket')[_0x729c('0xc')](socket);var jayson=require(_0x729c('0xd'));var client=jayson[_0x729c('0xe')][_0x729c('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x645350,_0x4852d8,_0x1b1b16,_0x11cf37){return new BPromise(function(_0x4fa112,_0x25cdc4){var _0x1321ff=_0x11cf37||client;return _0x1321ff[_0x729c('0x10')](_0x645350,_0x1b1b16)[_0x729c('0x11')](function(_0x53470e){logger[_0x729c('0x12')]('MailAccount,\x20%s,\x20%s',_0x4852d8,_0x729c('0x13'));logger[_0x729c('0x14')](_0x729c('0x15'),_0x4852d8,_0x729c('0x13'),JSON['stringify'](_0x53470e));if(_0x53470e[_0x729c('0x16')]){if(_0x53470e[_0x729c('0x16')]['code']===0x1f4){logger[_0x729c('0x16')]('MailAccount,\x20%s,\x20%s',_0x4852d8,_0x53470e['error'][_0x729c('0x17')]);return _0x25cdc4(_0x53470e[_0x729c('0x16')][_0x729c('0x17')]);}logger[_0x729c('0x16')](_0x729c('0x18'),_0x4852d8,_0x53470e[_0x729c('0x16')][_0x729c('0x17')]);return _0x4fa112(_0x53470e[_0x729c('0x16')][_0x729c('0x17')]);}else{logger[_0x729c('0x12')](_0x729c('0x18'),_0x4852d8,_0x729c('0x13'));_0x4fa112(_0x53470e['result']['message']);}})[_0x729c('0x19')](function(_0x3a3557){logger['error']('MailAccount,\x20%s,\x20%s',_0x4852d8,_0x3a3557);_0x25cdc4(_0x3a3557);});});}function respondWithStatusCode(_0x156893,_0x4e9da8){_0x4e9da8=_0x4e9da8||0xcc;return function(_0x47d240){if(_0x47d240){return _0x156893[_0x729c('0x1a')](_0x4e9da8);}return _0x156893['status'](_0x4e9da8)[_0x729c('0x1b')]();};}function respondWithResult(_0x5229d5,_0x5a0efe){_0x5a0efe=_0x5a0efe||0xc8;return function(_0x143280){if(_0x143280){return _0x5229d5[_0x729c('0x1c')](_0x5a0efe)[_0x729c('0x1d')](_0x143280);}};}function respondWithFilteredResult(_0xfb4e5e,_0x46b62c){return function(_0x460153){if(_0x460153){var _0x5f0808=typeof _0x46b62c['offset']===_0x729c('0x1e')&&typeof _0x46b62c[_0x729c('0x1f')]===_0x729c('0x1e');var _0x4825be=_0x460153[_0x729c('0x20')];var _0x14899b=_0x5f0808?0x0:_0x46b62c[_0x729c('0x21')];var _0x382d7d=_0x5f0808?_0x460153[_0x729c('0x20')]:_0x46b62c[_0x729c('0x21')]+_0x46b62c[_0x729c('0x1f')];var _0x149aec;if(_0x382d7d>=_0x4825be){_0x382d7d=_0x4825be;_0x149aec=0xc8;}else{_0x149aec=0xce;}_0xfb4e5e[_0x729c('0x1c')](_0x149aec);return _0xfb4e5e['set'](_0x729c('0x22'),_0x14899b+'-'+_0x382d7d+'/'+_0x4825be)['json'](_0x460153);}return null;};}function saveUpdates(_0x3b8306){return function(_0xc2671f){if(_0xc2671f){return _0xc2671f['update'](_0x3b8306)[_0x729c('0x11')](function(_0x991203){return _0x991203;});}return null;};}function removeEntity(_0x12e8b0){return function(_0x4843a8){if(_0x4843a8){return _0x4843a8[_0x729c('0x23')]()[_0x729c('0x11')](function(){var _0x4c83c1=_0x4843a8[_0x729c('0x24')]({'plain':!![]});var _0x1bd691=_0x729c('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1bd691,'resourceId':_0x4c83c1['id']}})[_0x729c('0x11')](function(){return _0x4843a8;});})[_0x729c('0x11')](function(){_0x12e8b0[_0x729c('0x1c')](0xcc)[_0x729c('0x1b')]();});}};}function handleEntityNotFound(_0x4704b4){return function(_0x19072a){if(!_0x19072a){_0x4704b4[_0x729c('0x1a')](0x194);}return _0x19072a;};}function handleError(_0x273a12,_0x20c25f){_0x20c25f=_0x20c25f||0x1f4;return function(_0x5821c4){logger[_0x729c('0x16')](_0x5821c4[_0x729c('0x26')]);if(_0x5821c4[_0x729c('0x27')]){delete _0x5821c4['name'];}_0x273a12[_0x729c('0x1c')](_0x20c25f)[_0x729c('0x28')](_0x5821c4);};}function getImapHost(_0x217cb7){switch(_0x217cb7){case _0x729c('0x29'):return _0x729c('0x2a');case _0x729c('0x2b'):return'imap.mail.yahoo.com';case _0x729c('0x2c'):return _0x729c('0x2d');case'outlook365':return _0x729c('0x2e');}throw new Error(_0x729c('0x2f'),_0x217cb7);}function getSmtpHost(_0x9ef34f){switch(_0x9ef34f){case _0x729c('0x29'):return _0x729c('0x30');case _0x729c('0x2b'):return'smtp.mail.yahoo.com';case _0x729c('0x2c'):return _0x729c('0x31');case _0x729c('0x32'):return'smtp.office365.com';}throw new Error(_0x729c('0x2f'),_0x9ef34f);}function getAuthenticationOptions(_0x3f0618,_0x48e780){var _0x2eefec={};var _0x3875c9={};if(_0x3f0618){_0x2eefec[_0x729c('0x33')]=_0x3875c9['user']=_0x48e780[_0x729c('0x34')];_0x2eefec['password']=_0x3875c9[_0x729c('0x35')]=_0x48e780[_0x729c('0x36')];if(_0x48e780[_0x729c('0x37')]){_0x2eefec['modernAuthentication']=_0x3875c9[_0x729c('0x37')]=!![];_0x2eefec[_0x729c('0x38')]=_0x3875c9[_0x729c('0x38')]=_0x48e780[_0x729c('0x38')];_0x2eefec[_0x729c('0x36')]=_0x3875c9[_0x729c('0x35')]=null;}else{_0x2eefec[_0x729c('0x38')]=_0x3875c9[_0x729c('0x38')]=null;}_0x2eefec[_0x729c('0x39')]=getImapHost(_0x3f0618);_0x2eefec[_0x729c('0x3a')]=0x3e1;_0x3875c9['host']=getSmtpHost(_0x3f0618);_0x3875c9['port']=0x24b;_0x3875c9[_0x729c('0x3b')]=![];_0x2eefec[_0x729c('0x3c')]=_0x3875c9[_0x729c('0x3c')]=null;}else{if(_0x48e780[_0x729c('0x3d')]){_0x2eefec[_0x729c('0x33')]=_0x3875c9['user']=_0x48e780['username'];_0x2eefec['password']=_0x3875c9[_0x729c('0x35')]=_0x48e780[_0x729c('0x36')];}else{_0x2eefec[_0x729c('0x3d')]=_0x3875c9['authentication']=![];_0x2eefec[_0x729c('0x33')]=_0x3875c9[_0x729c('0x33')]=null;_0x2eefec[_0x729c('0x36')]=_0x3875c9[_0x729c('0x35')]=null;}_0x2eefec[_0x729c('0x39')]=_0x48e780[_0x729c('0x3e')]['host'];_0x2eefec[_0x729c('0x3a')]=_0x48e780['Imap'][_0x729c('0x3a')];_0x3875c9[_0x729c('0x39')]=_0x48e780['Smtp']['host'];_0x3875c9[_0x729c('0x3a')]=_0x48e780[_0x729c('0x3f')][_0x729c('0x3a')];}return{'Imap':_0x2eefec,'Smtp':_0x3875c9};}exports[_0x729c('0x40')]=function(_0x371b0f,_0x55c951){var _0x510712={'include':[{'model':db[_0x729c('0x41')],'as':_0x729c('0x3e')},{'model':db[_0x729c('0x42')],'as':_0x729c('0x3f')},{'model':db[_0x729c('0x43')],'as':_0x729c('0x44')}]},_0x512d0a={},_0x20e2fc={'count':0x0,'rows':[]};var _0x558212=_['map'](db[_0x729c('0x45')][_0x729c('0x46')],function(_0x3b8737){return{'name':_0x3b8737[_0x729c('0x47')],'type':_0x3b8737['type']['key']};});_0x512d0a[_0x729c('0x48')]=_[_0x729c('0x49')](_0x558212,_0x729c('0x27'));_0x512d0a[_0x729c('0x4a')]=_[_0x729c('0x4b')](_0x371b0f['query']);_0x512d0a[_0x729c('0x4c')]=_['intersection'](_0x512d0a[_0x729c('0x48')],_0x512d0a['query']);_0x510712['attributes']=_['intersection'](_0x512d0a[_0x729c('0x48')],qs[_0x729c('0x4d')](_0x371b0f[_0x729c('0x4a')]['fields']));_0x510712['attributes']=_0x510712[_0x729c('0x4e')]['length']?_0x510712[_0x729c('0x4e')]:_0x512d0a[_0x729c('0x48')];if(!_0x371b0f['query'][_0x729c('0x4f')](_0x729c('0x50'))){_0x510712['limit']=qs[_0x729c('0x1f')](_0x371b0f[_0x729c('0x4a')]['limit']);_0x510712['offset']=qs[_0x729c('0x21')](_0x371b0f['query'][_0x729c('0x21')]);}_0x510712[_0x729c('0x51')]=qs['sort'](_0x371b0f[_0x729c('0x4a')]['sort']);_0x510712[_0x729c('0x52')]=qs[_0x729c('0x4c')](_[_0x729c('0x53')](_0x371b0f[_0x729c('0x4a')],_0x512d0a[_0x729c('0x4c')]),_0x558212);if(_0x371b0f[_0x729c('0x4a')]['filter']){_0x510712[_0x729c('0x52')]=_[_0x729c('0x54')](_0x510712[_0x729c('0x52')],{'$or':_[_0x729c('0x49')](_0x558212,function(_0x77ffd4){if(_0x77ffd4[_0x729c('0x55')]!==_0x729c('0x56')){var _0x360c58={};_0x360c58[_0x77ffd4['name']]={'$like':'%'+_0x371b0f[_0x729c('0x4a')][_0x729c('0x57')]+'%'};return _0x360c58;}})});}_0x510712=_[_0x729c('0x54')]({},_0x510712,_0x371b0f[_0x729c('0x58')]);var _0x2bc26a={'where':_0x510712[_0x729c('0x52')]};return db[_0x729c('0x45')][_0x729c('0x20')](_0x2bc26a)['then'](function(_0x35a542){_0x20e2fc['count']=_0x35a542;if(_0x371b0f[_0x729c('0x4a')][_0x729c('0x59')]){_0x510712[_0x729c('0x5a')]=[{'all':!![]}];}return db['MailAccount'][_0x729c('0x5b')](_0x510712);})[_0x729c('0x11')](function(_0xa2540){_0x20e2fc[_0x729c('0x5c')]=_0xa2540;return _0x20e2fc;})[_0x729c('0x11')](respondWithFilteredResult(_0x55c951,_0x510712))[_0x729c('0x19')](handleError(_0x55c951,null));};exports['show']=function(_0x485542,_0xd149c){var _0x26049b={'raw':![],'where':{'id':_0x485542[_0x729c('0x5d')]['id']},'include':[{'model':db[_0x729c('0x41')],'as':_0x729c('0x3e')},{'model':db[_0x729c('0x42')],'as':_0x729c('0x3f')},{'model':db['Pause'],'as':_0x729c('0x44')}]},_0x4f2673={};_0x4f2673[_0x729c('0x48')]=_[_0x729c('0x4b')](db['MailAccount'][_0x729c('0x46')]);_0x4f2673[_0x729c('0x4a')]=_[_0x729c('0x4b')](_0x485542[_0x729c('0x4a')]);_0x4f2673[_0x729c('0x4c')]=_[_0x729c('0x5e')](_0x4f2673[_0x729c('0x48')],_0x4f2673[_0x729c('0x4a')]);_0x26049b[_0x729c('0x4e')]=_[_0x729c('0x5e')](_0x4f2673[_0x729c('0x48')],qs[_0x729c('0x4d')](_0x485542[_0x729c('0x4a')][_0x729c('0x4d')]));_0x26049b[_0x729c('0x4e')]=_0x26049b[_0x729c('0x4e')][_0x729c('0x5f')]?_0x26049b[_0x729c('0x4e')]:_0x4f2673[_0x729c('0x48')];if(_0x485542['query'][_0x729c('0x59')]){_0x26049b[_0x729c('0x5a')]=[{'all':!![]}];}_0x26049b=_[_0x729c('0x54')]({},_0x26049b,_0x485542[_0x729c('0x58')]);return db[_0x729c('0x45')][_0x729c('0x60')](_0x26049b)[_0x729c('0x11')](handleEntityNotFound(_0xd149c,null))[_0x729c('0x11')](respondWithResult(_0xd149c,null))[_0x729c('0x19')](handleError(_0xd149c,null));};exports[_0x729c('0x61')]=function(_0xacf6af,_0xa8f530){if(_0xacf6af[_0x729c('0x62')]['id']){delete _0xacf6af[_0x729c('0x62')]['id'];}var _0x118339=_0xacf6af[_0x729c('0x62')][_0x729c('0x63')]===_0x729c('0x64')?null:_0xacf6af[_0x729c('0x62')][_0x729c('0x63')];var _0x51e499=_0xacf6af[_0x729c('0x62')][_0x729c('0x3e')]||{};var _0x674ea1=_0xacf6af[_0x729c('0x62')][_0x729c('0x3f')]||{};if(_0x118339){_0x51e499[_0x729c('0x39')]=getImapHost(_0x118339);_0x51e499['port']=0x3e1;_0x674ea1[_0x729c('0x39')]=getSmtpHost(_0x118339);_0x674ea1['port']=0x24b;_0x674ea1['secure']=![];}if(_0x674ea1['modernAuthentication']){_0x674ea1['secure']=![];}else{_0x674ea1[_0x729c('0x38')]=null;}if(!_0x51e499[_0x729c('0x37')])_0x51e499[_0x729c('0x38')]=null;_0xacf6af[_0x729c('0x62')][_0x729c('0x3e')]=_0x51e499;_0xacf6af[_0x729c('0x62')]['Smtp']=_0x674ea1;return db[_0x729c('0x45')][_0x729c('0x60')]({'where':{'id':_0xacf6af[_0x729c('0x5d')]['id']},'include':[{'model':db[_0x729c('0x41')],'as':'Imap'},{'model':db[_0x729c('0x42')],'as':'Smtp'},{'model':db['Pause'],'as':_0x729c('0x44')}]})['then'](handleEntityNotFound(_0xa8f530,null))[_0x729c('0x11')](function(_0x5ef90d){if(!_0x5ef90d)throw new Error('Mail\x20Account\x20not\x20found');if(_0x5ef90d['service'])delete _0xacf6af['body'][_0x729c('0x3e')];return _0x5ef90d;})[_0x729c('0x11')](saveUpdates(_0xacf6af[_0x729c('0x62')],null))['then'](function(_0xf3ab72){if(!_0xacf6af[_0x729c('0x62')][_0x729c('0x3e')])return _0xf3ab72;return db[_0x729c('0x41')][_0x729c('0x61')](_0xacf6af[_0x729c('0x62')][_0x729c('0x3e')],{'where':{'MailAccountId':_0xf3ab72['id']}})[_0x729c('0x11')](function(){return _0xf3ab72;});})[_0x729c('0x11')](function(_0x43dcdd){if(!_0xacf6af[_0x729c('0x62')][_0x729c('0x3f')])return _0x43dcdd;return db[_0x729c('0x42')]['update'](_0xacf6af['body'][_0x729c('0x3f')],{'where':{'MailAccountId':_0x43dcdd['id']}})['then'](function(){return _0x43dcdd;});})[_0x729c('0x11')](respondWithResult(_0xa8f530,null))[_0x729c('0x19')](handleError(_0xa8f530,null));};exports[_0x729c('0x65')]=function(_0x411669,_0x21e6b4){return db['MailAccount'][_0x729c('0x65')]()['then'](respondWithResult(_0x21e6b4,null))[_0x729c('0x19')](handleError(_0x21e6b4,null));};exports[_0x729c('0x66')]=function(_0x3eda34,_0x2b52f0){if(_0x3eda34[_0x729c('0x62')]['id']){delete _0x3eda34[_0x729c('0x62')]['id'];}return db[_0x729c('0x45')]['find']({'where':{'id':_0x3eda34[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x2b52f0,null))[_0x729c('0x11')](function(_0x5b11ca){if(_0x5b11ca){_0x3eda34[_0x729c('0x62')][_0x729c('0x67')]=_0x5b11ca['id'];return db[_0x729c('0x68')]['create'](_0x3eda34[_0x729c('0x62')]);}})[_0x729c('0x11')](respondWithResult(_0x2b52f0,null))[_0x729c('0x19')](handleError(_0x2b52f0,null));};exports['getDispositions']=function(_0x53dc60,_0x51ed98){var _0x4b4175={'raw':![],'where':{}};var _0x12d2df={};var _0x333d89={'count':0x0,'rows':[]};return db[_0x729c('0x45')][_0x729c('0x69')]({'where':{'id':_0x53dc60[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x51ed98,null))['then'](function(_0x41d94b){if(_0x41d94b){_0x12d2df['model']=_[_0x729c('0x4b')](db[_0x729c('0x68')]['rawAttributes']);_0x12d2df[_0x729c('0x4a')]=_['keys'](_0x53dc60['query']);_0x12d2df[_0x729c('0x4c')]=_[_0x729c('0x5e')](_0x12d2df[_0x729c('0x48')],_0x12d2df[_0x729c('0x4a')]);_0x4b4175['attributes']=_[_0x729c('0x5e')](_0x12d2df[_0x729c('0x48')],qs[_0x729c('0x4d')](_0x53dc60[_0x729c('0x4a')][_0x729c('0x4d')]));_0x4b4175[_0x729c('0x4e')]=_0x4b4175['attributes'][_0x729c('0x5f')]?_0x4b4175[_0x729c('0x4e')]:_0x12d2df[_0x729c('0x48')];if(!_0x53dc60[_0x729c('0x4a')][_0x729c('0x4f')]('nolimit')){_0x4b4175[_0x729c('0x1f')]=qs['limit'](_0x53dc60['query'][_0x729c('0x1f')]);_0x4b4175[_0x729c('0x21')]=qs[_0x729c('0x21')](_0x53dc60['query'][_0x729c('0x21')]);}_0x4b4175[_0x729c('0x51')]=qs[_0x729c('0x6a')](_0x53dc60[_0x729c('0x4a')][_0x729c('0x6a')]);_0x4b4175[_0x729c('0x52')]=qs[_0x729c('0x4c')](_[_0x729c('0x53')](_0x53dc60['query'],_0x12d2df['filters']));_0x4b4175[_0x729c('0x52')][_0x729c('0x67')]=_0x41d94b['id'];if(_0x53dc60[_0x729c('0x4a')][_0x729c('0x57')]){_0x4b4175[_0x729c('0x52')]=_[_0x729c('0x54')](_0x4b4175[_0x729c('0x52')],{'$or':_[_0x729c('0x49')](_0x4b4175[_0x729c('0x4e')],function(_0x47e35b){var _0x589353={};_0x589353[_0x47e35b]={'$like':'%'+_0x53dc60['query'][_0x729c('0x57')]+'%'};return _0x589353;})});}_0x4b4175=_['merge']({},_0x4b4175,_0x53dc60[_0x729c('0x58')]);return db[_0x729c('0x68')][_0x729c('0x20')]({'where':_0x4b4175[_0x729c('0x52')]})[_0x729c('0x11')](function(_0x45bbe5){_0x333d89[_0x729c('0x20')]=_0x45bbe5;if(_0x53dc60['query'][_0x729c('0x59')]){_0x4b4175['include']=[{'all':!![]}];}return db[_0x729c('0x68')]['findAll'](_0x4b4175);})[_0x729c('0x11')](function(_0x3c8621){_0x333d89['rows']=_0x3c8621;return _0x333d89;});}})[_0x729c('0x11')](respondWithFilteredResult(_0x51ed98,_0x4b4175))[_0x729c('0x19')](handleError(_0x51ed98,null));};exports[_0x729c('0x6b')]=function(_0x47b090,_0x8b1d75){return db[_0x729c('0x45')][_0x729c('0x60')]({'where':{'id':_0x47b090[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x8b1d75,null))[_0x729c('0x11')](function(_0x250a21){if(_0x250a21){return _0x250a21[_0x729c('0x6b')](_0x47b090['query'][_0x729c('0x6c')]);}})[_0x729c('0x11')](respondWithStatusCode(_0x8b1d75,null))[_0x729c('0x19')](handleError(_0x8b1d75,null));};exports[_0x729c('0x6d')]=function(_0x37222c,_0x4cb53f){if(_0x37222c[_0x729c('0x62')]['id']){delete _0x37222c[_0x729c('0x62')]['id'];}return db[_0x729c('0x45')][_0x729c('0x60')]({'where':{'id':_0x37222c[_0x729c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4cb53f,null))['then'](function(_0x39111f){if(_0x39111f){_0x37222c[_0x729c('0x62')][_0x729c('0x67')]=_0x39111f['id'];return db[_0x729c('0x6e')][_0x729c('0x6f')](_0x37222c[_0x729c('0x62')]);}})[_0x729c('0x11')](respondWithResult(_0x4cb53f,null))[_0x729c('0x19')](handleError(_0x4cb53f,null));};exports[_0x729c('0x70')]=function(_0x41845e,_0x7f7eee){var _0x1d921a={'raw':![],'where':{}};var _0x47877c={};var _0x653c29={'count':0x0,'rows':[]};return db[_0x729c('0x45')][_0x729c('0x69')]({'where':{'id':_0x41845e[_0x729c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x7f7eee,null))['then'](function(_0xec9771){if(_0xec9771){_0x47877c[_0x729c('0x48')]=_[_0x729c('0x4b')](db[_0x729c('0x6e')][_0x729c('0x46')]);_0x47877c[_0x729c('0x4a')]=_[_0x729c('0x4b')](_0x41845e[_0x729c('0x4a')]);_0x47877c[_0x729c('0x4c')]=_[_0x729c('0x5e')](_0x47877c[_0x729c('0x48')],_0x47877c[_0x729c('0x4a')]);_0x1d921a['attributes']=_[_0x729c('0x5e')](_0x47877c['model'],qs[_0x729c('0x4d')](_0x41845e[_0x729c('0x4a')]['fields']));_0x1d921a[_0x729c('0x4e')]=_0x1d921a[_0x729c('0x4e')][_0x729c('0x5f')]?_0x1d921a[_0x729c('0x4e')]:_0x47877c['model'];if(!_0x41845e[_0x729c('0x4a')][_0x729c('0x4f')](_0x729c('0x50'))){_0x1d921a[_0x729c('0x1f')]=qs['limit'](_0x41845e[_0x729c('0x4a')][_0x729c('0x1f')]);_0x1d921a['offset']=qs[_0x729c('0x21')](_0x41845e[_0x729c('0x4a')][_0x729c('0x21')]);}_0x1d921a[_0x729c('0x51')]=qs[_0x729c('0x6a')](_0x41845e[_0x729c('0x4a')][_0x729c('0x6a')]);_0x1d921a[_0x729c('0x52')]=qs[_0x729c('0x4c')](_[_0x729c('0x53')](_0x41845e['query'],_0x47877c['filters']));_0x1d921a[_0x729c('0x52')][_0x729c('0x67')]=_0xec9771['id'];if(_0x41845e['query'][_0x729c('0x57')]){_0x1d921a[_0x729c('0x52')]=_[_0x729c('0x54')](_0x1d921a[_0x729c('0x52')],{'$or':_[_0x729c('0x49')](_0x1d921a[_0x729c('0x4e')],function(_0x1ff6c5){var _0x4536e7={};_0x4536e7[_0x1ff6c5]={'$like':'%'+_0x41845e[_0x729c('0x4a')][_0x729c('0x57')]+'%'};return _0x4536e7;})});}_0x1d921a=_[_0x729c('0x54')]({},_0x1d921a,_0x41845e[_0x729c('0x58')]);return db[_0x729c('0x6e')][_0x729c('0x20')]({'where':_0x1d921a[_0x729c('0x52')]})[_0x729c('0x11')](function(_0x221ec5){_0x653c29[_0x729c('0x20')]=_0x221ec5;if(_0x41845e[_0x729c('0x4a')][_0x729c('0x59')]){_0x1d921a[_0x729c('0x5a')]=[{'all':!![]}];}return db[_0x729c('0x6e')]['findAll'](_0x1d921a);})['then'](function(_0x244ca5){_0x653c29['rows']=_0x244ca5;return _0x653c29;});}})[_0x729c('0x11')](respondWithFilteredResult(_0x7f7eee,_0x1d921a))['catch'](handleError(_0x7f7eee,null));};exports[_0x729c('0x71')]=function(_0x137ba2,_0x4fc925){return db[_0x729c('0x45')][_0x729c('0x60')]({'where':{'id':_0x137ba2['params']['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x4fc925,null))[_0x729c('0x11')](function(_0x51ed36){if(_0x51ed36){return _0x51ed36[_0x729c('0x71')](_0x137ba2[_0x729c('0x4a')][_0x729c('0x6c')]);}})['then'](respondWithStatusCode(_0x4fc925,null))[_0x729c('0x19')](handleError(_0x4fc925,null));};exports['create']=function(_0x4d842c,_0x75e860){var _0x227b20={'name':_0x4d842c['body']['name'],'key':_0x4d842c[_0x729c('0x62')]['key'],'provider':_0x4d842c[_0x729c('0x62')][_0x729c('0x63')]===_0x729c('0x64')?null:_0x4d842c['body'][_0x729c('0x63')],'email':_0x4d842c[_0x729c('0x62')][_0x729c('0x72')],'ListId':_0x4d842c['body']['ListId'],'active':!_[_0x729c('0x73')](_0x4d842c[_0x729c('0x62')][_0x729c('0x74')])?_0x4d842c[_0x729c('0x62')][_0x729c('0x74')]:!![],'description':_0x4d842c[_0x729c('0x62')][_0x729c('0x75')]||null};var _0x54a3bd=getAuthenticationOptions(_0x227b20['provider'],_0x4d842c[_0x729c('0x62')]);_0x227b20[_0x729c('0x3e')]=_0x54a3bd[_0x729c('0x3e')];_0x227b20[_0x729c('0x3f')]=_0x54a3bd[_0x729c('0x3f')];return db[_0x729c('0x45')][_0x729c('0x6f')](_0x227b20,{'include':[{'model':db[_0x729c('0x42')],'as':_0x729c('0x3f')},{'model':db[_0x729c('0x41')],'as':_0x729c('0x3e')}]})['then'](function(_0x37c43f){var _0x3d3181=_0x4d842c[_0x729c('0x33')][_0x729c('0x24')]({'plain':!![]});if(!_0x3d3181)throw new Error(_0x729c('0x76'));if(_0x3d3181[_0x729c('0x77')]===_0x729c('0x33')){var _0x1ca820=_0x37c43f[_0x729c('0x24')]({'plain':!![]});return db[_0x729c('0x78')]['find']({'where':{'name':_0x729c('0x25'),'userProfileId':_0x3d3181[_0x729c('0x79')]},'raw':!![]})[_0x729c('0x11')](function(_0xd0d0dc){if(_0xd0d0dc&&_0xd0d0dc['autoAssociation']===0x0){return db[_0x729c('0x7a')][_0x729c('0x6f')]({'name':_0x1ca820[_0x729c('0x27')],'resourceId':_0x1ca820['id'],'type':_0xd0d0dc[_0x729c('0x27')],'sectionId':_0xd0d0dc['id']},{})[_0x729c('0x11')](function(){return _0x37c43f;});}else{return _0x37c43f;}})['catch'](function(_0x3f0713){logger[_0x729c('0x16')](_0x729c('0x7b'),_0x3f0713);throw _0x3f0713;});}return _0x37c43f;})[_0x729c('0x11')](respondWithResult(_0x75e860,0xc9))['catch'](handleError(_0x75e860,null));};exports[_0x729c('0x7c')]=function(_0x48427d,_0x36102b){return db[_0x729c('0x45')][_0x729c('0x69')]({'where':{'id':_0x48427d[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x36102b,null))[_0x729c('0x11')](function(_0x55e360){if(_0x55e360){return _0x55e360[_0x729c('0x7c')]();}return null;})[_0x729c('0x11')](respondWithResult(_0x36102b,null))[_0x729c('0x19')](handleError(_0x36102b,null));};exports[_0x729c('0x7d')]=function(_0x476db7,_0x4a503a){if(_0x476db7[_0x729c('0x62')]['id']){delete _0x476db7['body']['id'];}return db['MailAccount'][_0x729c('0x60')]({'where':{'id':_0x476db7[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x4a503a,null))[_0x729c('0x11')](function(_0x29a85a){if(_0x29a85a){_0x476db7[_0x729c('0x62')]['MailAccountId']=_0x29a85a['id'];return db['MailServerIn']['create'](_0x476db7[_0x729c('0x62')]);}})['then'](respondWithResult(_0x4a503a,null))[_0x729c('0x19')](handleError(_0x4a503a,null));};exports[_0x729c('0x7e')]=function(_0x23e019,_0x19762a){return db[_0x729c('0x45')]['findOne']({'where':{'id':_0x23e019[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x19762a,null))[_0x729c('0x11')](function(_0x453fea){if(_0x453fea){return _0x453fea[_0x729c('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x19762a,null))[_0x729c('0x19')](handleError(_0x19762a,null));};exports[_0x729c('0x80')]=function(_0xa84650,_0x5df462){return db['MailAccount'][_0x729c('0x69')]({'where':{'id':_0xa84650[_0x729c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5df462,null))['then'](function(_0x313f33){if(_0x313f33){return _0x313f33['getSmtp']();}return null;})[_0x729c('0x11')](respondWithResult(_0x5df462,null))[_0x729c('0x19')](handleError(_0x5df462,null));};exports[_0x729c('0x81')]=function(_0x43d50b,_0x465bc9){if(_0x43d50b[_0x729c('0x62')]['id']){delete _0x43d50b['body']['id'];}return db[_0x729c('0x45')]['find']({'where':{'id':_0x43d50b['params']['id']}})['then'](handleEntityNotFound(_0x465bc9,null))[_0x729c('0x11')](function(_0x2ace25){if(_0x2ace25){_0x43d50b[_0x729c('0x62')][_0x729c('0x67')]=_0x2ace25['id'];return db['MailServerOut'][_0x729c('0x6f')](_0x43d50b[_0x729c('0x62')]);}})[_0x729c('0x11')](respondWithResult(_0x465bc9,null))[_0x729c('0x19')](handleError(_0x465bc9,null));};exports[_0x729c('0x82')]=function(_0xe6cb0a,_0x340b27){return db[_0x729c('0x45')][_0x729c('0x69')]({'where':{'id':_0xe6cb0a[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x340b27,null))[_0x729c('0x11')](function(_0x34f1fa){if(_0x34f1fa){return _0x34f1fa[_0x729c('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x340b27,null))['catch'](handleError(_0x340b27,null));};exports[_0x729c('0x84')]=function(_0x27e38f,_0x58ed8b){return db[_0x729c('0x85')][_0x729c('0x60')]({'where':{'id':_0x27e38f[_0x729c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x58ed8b,null))['then'](function(_0x4c8d5b){if(_0x4c8d5b){return _0x4c8d5b[_0x729c('0x84')](_0x27e38f['body'][_0x729c('0x6c')],_[_0x729c('0x86')](_0x27e38f[_0x729c('0x62')],['ids','id'])||{});}})[_0x729c('0x11')](respondWithResult(_0x58ed8b,null))[_0x729c('0x19')](handleError(_0x58ed8b,null));};exports[_0x729c('0x87')]=function(_0xc8b45c,_0x119a20){var _0x706a30={'raw':![],'where':{}};var _0x9bf32b={};var _0x187fa7={'count':0x0,'rows':[]};return db[_0x729c('0x45')]['findOne']({'where':{'id':_0xc8b45c['params']['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x119a20,null))['then'](function(_0x53f101){if(_0x53f101){_0x9bf32b['model']=_[_0x729c('0x4b')](db[_0x729c('0x85')][_0x729c('0x46')]);_0x9bf32b[_0x729c('0x4a')]=_[_0x729c('0x4b')](_0xc8b45c['query']);_0x9bf32b['filters']=_[_0x729c('0x5e')](_0x9bf32b[_0x729c('0x48')],_0x9bf32b[_0x729c('0x4a')]);_0x706a30[_0x729c('0x4e')]=_[_0x729c('0x5e')](_0x9bf32b[_0x729c('0x48')],qs['fields'](_0xc8b45c['query'][_0x729c('0x4d')]));_0x706a30[_0x729c('0x4e')]=_0x706a30[_0x729c('0x4e')][_0x729c('0x5f')]?_0x706a30[_0x729c('0x4e')]:_0x9bf32b[_0x729c('0x48')];if(!_0xc8b45c[_0x729c('0x4a')][_0x729c('0x4f')](_0x729c('0x50'))){_0x706a30[_0x729c('0x1f')]=qs['limit'](_0xc8b45c[_0x729c('0x4a')][_0x729c('0x1f')]);_0x706a30[_0x729c('0x21')]=qs[_0x729c('0x21')](_0xc8b45c[_0x729c('0x4a')][_0x729c('0x21')]);}_0x706a30['order']=qs[_0x729c('0x6a')](_0xc8b45c['query'][_0x729c('0x6a')]);_0x706a30['where']=qs[_0x729c('0x4c')](_[_0x729c('0x53')](_0xc8b45c['query'],_0x9bf32b[_0x729c('0x4c')]));_0x706a30[_0x729c('0x52')]['MailAccountId']=_0x53f101['id'];if(_0xc8b45c[_0x729c('0x4a')][_0x729c('0x57')]){_0x706a30[_0x729c('0x52')]=_[_0x729c('0x54')](_0x706a30[_0x729c('0x52')],{'$or':_[_0x729c('0x49')](_0x706a30[_0x729c('0x4e')],function(_0x435ab7){var _0x1262cb={};_0x1262cb[_0x435ab7]={'$like':'%'+_0xc8b45c[_0x729c('0x4a')][_0x729c('0x57')]+'%'};return _0x1262cb;})});}_0x706a30=_[_0x729c('0x54')]({},_0x706a30,_0xc8b45c[_0x729c('0x58')]);return db[_0x729c('0x85')][_0x729c('0x20')]({'where':_0x706a30[_0x729c('0x52')]})[_0x729c('0x11')](function(_0x1722b8){_0x187fa7[_0x729c('0x20')]=_0x1722b8;if(_0xc8b45c[_0x729c('0x4a')][_0x729c('0x59')]){_0x706a30[_0x729c('0x5a')]=[{'model':db[_0x729c('0x88')],'as':_0x729c('0x89'),'required':![]},{'model':db[_0x729c('0x8a')],'as':_0x729c('0x8b'),'attributes':['name',_0x729c('0x8c'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x729c('0x8d'),'attributes':['id',_0x729c('0x27'),_0x729c('0x8e')],'where':_0xc8b45c[_0x729c('0x4a')][_0x729c('0x8f')]?{'id':_0xc8b45c[_0x729c('0x4a')][_0x729c('0x8f')]}:undefined,'required':_0xc8b45c['query'][_0x729c('0x8f')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x706a30);})[_0x729c('0x11')](function(_0x22d842){_0x187fa7[_0x729c('0x5c')]=_0x22d842;return _0x187fa7;});}})['then'](respondWithFilteredResult(_0x119a20,_0x706a30))[_0x729c('0x19')](handleError(_0x119a20,null));};exports['addApplications']=function addApplications(_0xf8c884,_0x4bf2e5){var _0x50870d=_0xf8c884[_0x729c('0x5d')]['id'];var _0x1f3dfa=_0xf8c884['body'];var _0x150b23=0xc8;var _0x207217=null;return db[_0x729c('0x90')][_0x729c('0x91')]({'isolationLevel':db['sequelize'][_0x729c('0x92')][_0x729c('0x93')][_0x729c('0x94')]},function(_0x4b8794){return db[_0x729c('0x45')][_0x729c('0x69')]({'where':{'id':_0x50870d},'transaction':_0x4b8794})[_0x729c('0x11')](function(_0x1603d4){if(_0x1603d4){return db[_0x729c('0x95')]['destroy']({'where':{'MailAccountId':_0x50870d},'transaction':_0x4b8794})['then'](function(){var _0x36bb29=_['map'](_0x1f3dfa,function(_0x2f47fc){_0x2f47fc[_0x729c('0x67')]=_0x50870d;return _0x2f47fc;});return db[_0x729c('0x95')]['bulkCreate'](_0x36bb29,{'transaction':_0x4b8794});});}else{_0x150b23=0x194;_0x207217=[];}});})['then'](function(){if(_0x150b23!==0x194){return db[_0x729c('0x95')][_0x729c('0x96')]({'where':{'MailAccountId':_0x50870d},'order':_0x729c('0x97')})['then'](function(_0x24d598){_0x207217=_0x24d598;});}})['catch'](function(_0x35a682){_0x150b23=0x1f4;logger['error'](_0x35a682[_0x729c('0x26')]);if(_0x35a682['name']){delete _0x35a682['name'];}_0x207217=_0x35a682;})[_0x729c('0x98')](function(){if(_0x207217===null){_0x4bf2e5[_0x729c('0x1a')](_0x150b23);}else{if(_0x150b23===0x1f4){_0x4bf2e5['status'](_0x150b23)['send'](_0x207217);}else{_0x4bf2e5[_0x729c('0x1c')](_0x150b23)[_0x729c('0x1d')](_0x207217);}}});};exports['getApplications']=function(_0x33d67f,_0x3e985a){var _0x2c4215={};var _0x1308e0={};var _0x5e7c5e;var _0x1b485b;return db['MailAccount']['findOne']({'where':{'id':_0x33d67f[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x3e985a,null))[_0x729c('0x11')](function(_0xfbae12){if(_0xfbae12){_0x5e7c5e=_0xfbae12;_0x1308e0[_0x729c('0x48')]=_[_0x729c('0x4b')](db[_0x729c('0x95')][_0x729c('0x46')]);_0x1308e0[_0x729c('0x4a')]=_[_0x729c('0x4b')](_0x33d67f[_0x729c('0x4a')]);_0x1308e0[_0x729c('0x4c')]=_[_0x729c('0x5e')](_0x1308e0['model'],_0x1308e0[_0x729c('0x4a')]);_0x2c4215[_0x729c('0x4e')]=_[_0x729c('0x5e')](_0x1308e0[_0x729c('0x48')],qs[_0x729c('0x4d')](_0x33d67f[_0x729c('0x4a')]['fields']));_0x2c4215[_0x729c('0x4e')]=_0x2c4215[_0x729c('0x4e')][_0x729c('0x5f')]?_0x2c4215[_0x729c('0x4e')]:_0x1308e0[_0x729c('0x48')];_0x2c4215[_0x729c('0x51')]=qs[_0x729c('0x6a')](_0x33d67f['query'][_0x729c('0x6a')]);_0x2c4215[_0x729c('0x52')]=qs[_0x729c('0x4c')](_[_0x729c('0x53')](_0x33d67f[_0x729c('0x4a')],_0x1308e0['filters']));if(_0x33d67f[_0x729c('0x4a')][_0x729c('0x57')]){_0x2c4215['where']=_[_0x729c('0x54')](_0x2c4215[_0x729c('0x52')],{'$or':_[_0x729c('0x49')](_0x2c4215[_0x729c('0x4e')],function(_0x3cdd8b){var _0x250b39={};_0x250b39[_0x3cdd8b]={'$like':'%'+_0x33d67f['query'][_0x729c('0x57')]+'%'};return _0x250b39;})});}_0x2c4215=_[_0x729c('0x54')]({},_0x2c4215,_0x33d67f[_0x729c('0x58')]);return _0x5e7c5e[_0x729c('0x99')](_0x2c4215);}})['then'](function(_0x3b0d36){if(_0x3b0d36){_0x1b485b=_0x3b0d36[_0x729c('0x5f')];if(!_0x33d67f[_0x729c('0x4a')]['hasOwnProperty'](_0x729c('0x50'))){_0x2c4215[_0x729c('0x1f')]=qs[_0x729c('0x1f')](_0x33d67f['query'][_0x729c('0x1f')]);_0x2c4215[_0x729c('0x21')]=qs[_0x729c('0x21')](_0x33d67f[_0x729c('0x4a')]['offset']);}return _0x5e7c5e[_0x729c('0x99')](_0x2c4215);}})[_0x729c('0x11')](function(_0x3c7304){if(_0x3c7304){return _0x3c7304?{'count':_0x1b485b,'rows':_0x3c7304}:null;}})[_0x729c('0x11')](respondWithResult(_0x3e985a,null))['catch'](handleError(_0x3e985a,null));};exports[_0x729c('0x9a')]=function(_0x2abeca,_0x4f009b){var _0x1b8cf8={'raw':!![],'where':{}};var _0x46ffd0={};var _0x44abc4={'count':0x0,'rows':[]};return db[_0x729c('0x45')][_0x729c('0x69')]({'where':{'id':_0x2abeca[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x4f009b,null))[_0x729c('0x11')](function(_0x1c9bed){if(_0x1c9bed){_0x46ffd0[_0x729c('0x48')]=_[_0x729c('0x4b')](db['MailMessage'][_0x729c('0x46')]);_0x46ffd0[_0x729c('0x4a')]=_[_0x729c('0x4b')](_0x2abeca[_0x729c('0x4a')]);_0x46ffd0[_0x729c('0x4c')]=_[_0x729c('0x5e')](_0x46ffd0[_0x729c('0x48')],_0x46ffd0[_0x729c('0x4a')]);_0x1b8cf8['attributes']=_[_0x729c('0x5e')](_0x46ffd0[_0x729c('0x48')],qs['fields'](_0x2abeca[_0x729c('0x4a')][_0x729c('0x4d')]));_0x1b8cf8[_0x729c('0x4e')]=_0x1b8cf8[_0x729c('0x4e')][_0x729c('0x5f')]?_0x1b8cf8[_0x729c('0x4e')]:_0x46ffd0[_0x729c('0x48')];if(!_0x2abeca[_0x729c('0x4a')][_0x729c('0x4f')](_0x729c('0x50'))){_0x1b8cf8[_0x729c('0x1f')]=qs[_0x729c('0x1f')](_0x2abeca['query'][_0x729c('0x1f')]);_0x1b8cf8[_0x729c('0x21')]=qs[_0x729c('0x21')](_0x2abeca[_0x729c('0x4a')][_0x729c('0x21')]);}_0x1b8cf8[_0x729c('0x51')]=qs[_0x729c('0x6a')](_0x2abeca['query'][_0x729c('0x6a')]);_0x1b8cf8['where']=qs['filters'](_[_0x729c('0x53')](_0x2abeca[_0x729c('0x4a')],_0x46ffd0[_0x729c('0x4c')]));_0x1b8cf8['where'][_0x729c('0x67')]=_0x1c9bed['id'];if(_0x2abeca[_0x729c('0x4a')]['filter']){_0x1b8cf8[_0x729c('0x52')]=_[_0x729c('0x54')](_0x1b8cf8['where'],{'$or':_['map'](_0x1b8cf8[_0x729c('0x4e')],function(_0x5402f6){var _0x1abc31={};_0x1abc31[_0x5402f6]={'$like':'%'+_0x2abeca[_0x729c('0x4a')][_0x729c('0x57')]+'%'};return _0x1abc31;})});}if(_0x2abeca[_0x729c('0x4a')][_0x729c('0x9b')]){var _0x4c9f06=_0x2abeca[_0x729c('0x4a')][_0x729c('0x9b')][_0x729c('0x9c')](',');var _0x28563c={};_0x28563c[_0x4c9f06[0x0]]={'$gte':moment(_0x4c9f06[0x1])['format'](_0x729c('0x9d'))};_0x1b8cf8[_0x729c('0x52')]=_['merge'](_0x1b8cf8[_0x729c('0x52')],_0x28563c);}_0x1b8cf8=_[_0x729c('0x54')]({},_0x1b8cf8,_0x2abeca['options']);return db['MailMessage'][_0x729c('0x20')]({'where':_0x1b8cf8[_0x729c('0x52')]})[_0x729c('0x11')](function(_0x1f2a44){_0x44abc4[_0x729c('0x20')]=_0x1f2a44;if(_0x2abeca[_0x729c('0x4a')][_0x729c('0x59')]){_0x1b8cf8[_0x729c('0x5a')]=[{'all':!![]}];}return db[_0x729c('0x9e')][_0x729c('0x5b')](_0x1b8cf8);})['then'](function(_0x363d09){if(_0x2abeca['query'][_0x729c('0x9f')]===_0x729c('0xa0')){for(var _0x59d88e=0x0;_0x59d88e<_0x363d09[_0x729c('0x5f')];_0x59d88e++){_0x363d09[_0x59d88e]['body']=juice(_0x363d09[_0x59d88e]['body']);}}_0x44abc4[_0x729c('0x5c')]=_0x363d09;return _0x44abc4;});}})['then'](respondWithFilteredResult(_0x4f009b,_0x1b8cf8))[_0x729c('0x19')](handleError(_0x4f009b,null));};exports['send']=function(_0xfe618f,_0x563615){var _0x2ae1d6,_0x51b62d={},_0x40100b;if(_0xfe618f['body']['to']){_0x40100b=_0xfe618f[_0x729c('0x62')]['to'][_0x729c('0x9c')](',')[0x0];}return db[_0x729c('0x45')]['find']({'where':{'id':_0xfe618f[_0x729c('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x729c('0xa1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x40100b},'limit':0x1,'order':[['updatedAt',_0x729c('0xa2')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x729c('0xa3')],'as':_0x729c('0xa3'),'raw':!![]}]}]})[_0x729c('0x11')](handleEntityNotFound(_0x563615,null))['then'](function(_0x10dbb3){if(!_0x10dbb3)return;_0x2ae1d6=_0x10dbb3;if(!_0x10dbb3[_0x729c('0x3f')])throw new Error(_0x729c('0xa4'));if(_[_0x729c('0x73')](_0xfe618f[_0x729c('0x62')][_0x729c('0xa5')])){_0xfe618f[_0x729c('0x62')][_0x729c('0xa5')]=util['format']('%s\x20<%s>',_0x10dbb3[_0x729c('0x27')],_0x10dbb3[_0x729c('0x72')]||_0x10dbb3[_0x729c('0x3f')]['user']);}if(_0xfe618f[_0x729c('0x62')][_0x729c('0xa6')]&&_0xfe618f[_0x729c('0x62')][_0x729c('0xa6')]['length']){for(var _0x591aea=0x0;_0x591aea<_0xfe618f['body']['attachments'][_0x729c('0x5f')];_0x591aea+=0x1){_0xfe618f['body'][_0x729c('0xa6')][_0x591aea]={'filename':_0xfe618f[_0x729c('0x62')][_0x729c('0xa6')][_0x591aea][_0x729c('0x27')],'path':path[_0x729c('0xa7')](config[_0x729c('0xa8')],'server/files/attachments',_0xfe618f[_0x729c('0x62')][_0x729c('0xa6')][_0x591aea][_0x729c('0xa9')])};}}var _0x4b98b3=_0x10dbb3['getSmtpOptions']();return respondWithRpcPromise(_0x729c('0xaa'),_0x729c('0xab'),{'account':_0x4b98b3,'message':_0xfe618f[_0x729c('0x62')]});})[_0x729c('0x11')](function(_0x3a7eae){if(!_0x3a7eae)return;_0x51b62d=_0x3a7eae;if(!_0x2ae1d6[_0x729c('0xa1')])throw new Error(_0x729c('0xac'));if(_0x2ae1d6['List'][_0x729c('0xad')][_0x729c('0x5f')])return _0x2ae1d6[_0x729c('0xa1')]['Contacts'][0x0];return db[_0x729c('0x88')][_0x729c('0x6f')](_['defaults'](_0xfe618f[_0x729c('0x62')],{'firstName':_0xfe618f[_0x729c('0x62')]['to'],'email':_0xfe618f[_0x729c('0x62')]['to'],'phone':_0xfe618f[_0x729c('0x62')]['to'],'ListId':_0x2ae1d6[_0x729c('0xae')]}));})[_0x729c('0x11')](function(_0xc44a4b){if(!_0xc44a4b)return;var _0x27df72={'UserId':_0xfe618f[_0x729c('0x33')]['id'],'ContactId':_0xc44a4b['id'],'MailAccountId':_0x2ae1d6['id'],'inReplyTo':_0x51b62d['messageId'],'to':_0xfe618f[_0x729c('0x62')][_0x729c('0xa5')],'cc':_0xfe618f[_0x729c('0x62')]['cc'],'subject':_0xfe618f[_0x729c('0x62')][_0x729c('0xaf')],'attach':_0xfe618f[_0x729c('0x62')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x729c('0xb0')](_0x729c('0x9d')),'lastMsgDirection':_0x729c('0xb1'),'Messages':[_[_0x729c('0x54')](_0xfe618f['body'],{'messageId':_0x51b62d[_0x729c('0xb2')],'sentAt':moment()[_0x729c('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2ae1d6['id'],'UserId':_0xfe618f[_0x729c('0x33')]['id'],'ContactId':_0xc44a4b['id']})]};if(_0xfe618f['body'][_0x729c('0xb3')]){_0x27df72=_[_0x729c('0x54')](_0x27df72,_0xfe618f[_0x729c('0x62')]['Interaction']);}return db[_0x729c('0x85')]['create'](_0x27df72,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x729c('0x11')](respondWithResult(_0x563615,null))[_0x729c('0x19')](handleError(_0x563615,null));};exports[_0x729c('0xb4')]=function(_0x404c93,_0x2a48c6){return db[_0x729c('0x45')][_0x729c('0x60')]({'where':{'id':_0x404c93[_0x729c('0x5d')]['id']},'include':[{'model':db[_0x729c('0x42')],'as':_0x729c('0x3f'),'raw':!![],'include':[{'model':db[_0x729c('0xa3')],'as':_0x729c('0xa3'),'raw':!![]}]}]})[_0x729c('0x11')](handleEntityNotFound(_0x2a48c6,null))[_0x729c('0x11')](function(_0x582e91){if(!_0x582e91[_0x729c('0x3f')])return;var _0x51b2fa=_0x582e91['getSmtpOptions']();return respondWithRpcPromise(_0x729c('0xb5'),'verifySmtp',{'account':_0x51b2fa});})[_0x729c('0x11')](respondWithResult(_0x2a48c6,null))['catch'](handleError(_0x2a48c6,null));};exports[_0x729c('0x23')]=function(_0x47b3c9,_0x2e9361){return db[_0x729c('0x45')][_0x729c('0x60')]({'where':{'id':_0x47b3c9['params']['id']}})['then'](handleEntityNotFound(_0x2e9361,null))[_0x729c('0x11')](function(_0x11901f){if(_0x11901f&&_0x11901f[_0x729c('0x3c')]){throw new db['Sequelize'][(_0x729c('0xb6'))](_0x729c('0xb7'));}return _0x11901f;})[_0x729c('0x11')](removeEntity(_0x2e9361,null))[_0x729c('0x19')](handleError(_0x2e9361,null));};exports[_0x729c('0xb8')]=function(_0x3fab16,_0x4b348c){return db[_0x729c('0x45')]['find']({'where':{'id':_0x3fab16[_0x729c('0x5d')]['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x4b348c,null))['then'](function(_0x295f1c){if(_0x295f1c){return _0x295f1c[_0x729c('0xb8')](_0x3fab16[_0x729c('0x62')][_0x729c('0x6c')],_[_0x729c('0x86')](_0x3fab16[_0x729c('0x62')],[_0x729c('0x6c'),'id'])||{})[_0x729c('0xb9')](function(_0x10e749){for(var _0x11b802=0x0;_0x11b802<_0x3fab16[_0x729c('0x62')][_0x729c('0x6c')][_0x729c('0x5f')];_0x11b802+=0x1){socket[_0x729c('0xba')]('userMailAccount:save',{'UserId':Number(_0x3fab16['body']['ids'][_0x11b802]),'MailAccountId':Number(_0x3fab16['params']['id'])});}return _0x10e749;});}})[_0x729c('0x11')](respondWithResult(_0x4b348c,null))['catch'](handleError(_0x4b348c,null));};exports[_0x729c('0xbb')]=function(_0x1e739f,_0x39d292){return db[_0x729c('0x45')][_0x729c('0x60')]({'where':{'id':_0x1e739f['params']['id']}})[_0x729c('0x11')](handleEntityNotFound(_0x39d292,null))['then'](function(_0x379840){if(_0x379840){return _0x379840[_0x729c('0xbb')](_0x1e739f[_0x729c('0x4a')][_0x729c('0x6c')])[_0x729c('0x11')](function(){if(_[_0x729c('0xbc')](_0x1e739f[_0x729c('0x4a')][_0x729c('0x6c')])){for(var _0x486664=0x0;_0x486664<_0x1e739f['query']['ids'][_0x729c('0x5f')];_0x486664+=0x1){socket[_0x729c('0xba')](_0x729c('0xbd'),{'UserId':Number(_0x1e739f['query'][_0x729c('0x6c')][_0x486664]),'MailAccountId':Number(_0x1e739f[_0x729c('0x5d')]['id'])});}}else{socket[_0x729c('0xba')](_0x729c('0xbd'),{'UserId':Number(_0x1e739f['query']['ids']),'MailAccountId':Number(_0x1e739f[_0x729c('0x5d')]['id'])});}});}})[_0x729c('0x11')](respondWithStatusCode(_0x39d292,null))[_0x729c('0x19')](handleError(_0x39d292,null));};exports[_0x729c('0xbe')]=function(_0x55fa02,_0x35e559){var _0x11af2d={};var _0x523014={};var _0x28d66d;var _0x250a04;return db[_0x729c('0x45')][_0x729c('0x69')]({'where':{'id':_0x55fa02[_0x729c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x35e559,null))['then'](function(_0x50b984){if(_0x50b984){_0x28d66d=_0x50b984;_0x523014[_0x729c('0x48')]=_[_0x729c('0x4b')](db[_0x729c('0x8a')][_0x729c('0x46')]);_0x523014[_0x729c('0x4a')]=_[_0x729c('0x4b')](_0x55fa02['query']);_0x523014['filters']=_[_0x729c('0x5e')](_0x523014[_0x729c('0x48')],_0x523014[_0x729c('0x4a')]);_0x11af2d[_0x729c('0x4e')]=_['intersection'](_0x523014[_0x729c('0x48')],qs[_0x729c('0x4d')](_0x55fa02['query'][_0x729c('0x4d')]));_0x11af2d[_0x729c('0x4e')]=_0x11af2d['attributes']['length']?_0x11af2d['attributes']:_0x523014['model'];_0x11af2d[_0x729c('0x51')]=qs[_0x729c('0x6a')](_0x55fa02[_0x729c('0x4a')]['sort']);_0x11af2d[_0x729c('0x52')]=qs[_0x729c('0x4c')](_['pick'](_0x55fa02[_0x729c('0x4a')],_0x523014[_0x729c('0x4c')]));if(_0x55fa02[_0x729c('0x4a')]['filter']){_0x11af2d[_0x729c('0x52')]=_[_0x729c('0x54')](_0x11af2d[_0x729c('0x52')],{'$or':_[_0x729c('0x49')](_0x11af2d[_0x729c('0x4e')],function(_0x36732c){var _0x358f34={};_0x358f34[_0x36732c]={'$like':'%'+_0x55fa02['query'][_0x729c('0x57')]+'%'};return _0x358f34;})});}_0x11af2d=_[_0x729c('0x54')]({},_0x11af2d,_0x55fa02[_0x729c('0x58')]);return _0x28d66d[_0x729c('0xbe')](_0x11af2d);}})[_0x729c('0x11')](function(_0x2a5c6f){if(_0x2a5c6f){_0x250a04=_0x2a5c6f[_0x729c('0x5f')];if(!_0x55fa02[_0x729c('0x4a')][_0x729c('0x4f')](_0x729c('0x50'))){_0x11af2d[_0x729c('0x1f')]=qs[_0x729c('0x1f')](_0x55fa02[_0x729c('0x4a')][_0x729c('0x1f')]);_0x11af2d[_0x729c('0x21')]=qs[_0x729c('0x21')](_0x55fa02[_0x729c('0x4a')]['offset']);}return _0x28d66d[_0x729c('0xbe')](_0x11af2d);}})[_0x729c('0x11')](function(_0x127135){if(_0x127135){return _0x127135?{'count':_0x250a04,'rows':_0x127135}:null;}})['then'](respondWithResult(_0x35e559,null))[_0x729c('0x19')](handleError(_0x35e559,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index d10f8bb..7fbb4a9 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 _0xbdc2=['events','../../mysqldb','MailAccount','setMaxListeners','remove','emit','hook','exports'];(function(_0x2a1c9b,_0x5039f0){var _0x3b6f01=function(_0x51414b){while(--_0x51414b){_0x2a1c9b['push'](_0x2a1c9b['shift']());}};_0x3b6f01(++_0x5039f0);}(_0xbdc2,0x148));var _0x2bdc=function(_0x3efd24,_0x307e53){_0x3efd24=_0x3efd24-0x0;var _0x5df6f2=_0xbdc2[_0x3efd24];return _0x5df6f2;};'use strict';var EventEmitter=require(_0x2bdc('0x0'));var MailAccount=require(_0x2bdc('0x1'))['db'][_0x2bdc('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2bdc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2bdc('0x4')};function emitEvent(_0x1d9116){return function(_0x522434,_0x1855bd,_0x378db8){MailAccountEvents['emit'](_0x1d9116+':'+_0x522434['id'],_0x522434);MailAccountEvents[_0x2bdc('0x5')](_0x1d9116,_0x522434);_0x378db8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x2bdc('0x6')](e,emitEvent(event));}}module[_0x2bdc('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xd70e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd70e,0x157));var _0xed70=function(_0x4f3fae,_0x338661){_0x4f3fae=_0x4f3fae-0x0;var _0x2bb251=_0xd70e[_0x4f3fae];return _0x2bb251;};'use strict';var EventEmitter=require(_0xed70('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xed70('0x1')](0x0);var events={'afterCreate':_0xed70('0x2'),'afterUpdate':_0xed70('0x3'),'afterDestroy':_0xed70('0x4')};function emitEvent(_0x269875){return function(_0x411dcd,_0x289ce9,_0x54f657){MailAccountEvents[_0xed70('0x5')](_0x269875+':'+_0x411dcd['id'],_0x411dcd);MailAccountEvents[_0xed70('0x5')](_0x269875,_0x411dcd);_0x54f657(null);};}for(var e in events){if(events[_0xed70('0x6')](e)){var event=events[e];MailAccount[_0xed70('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 10f440c..47d3bab 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 _0x7eab=['port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','define','MailAccount','mail_accounts','provider','custom','host','Smtp'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7eab,0x89));var _0xb7ea=function(_0x2fe2f4,_0x159383){_0x2fe2f4=_0x2fe2f4-0x0;var _0x3232a3=_0x7eab[_0x2fe2f4];return _0x3232a3;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x2a8d4e){return _0x2a8d4e[_0xb7ea('0x0')](_0xb7ea('0x1'),attributes,{'tableName':_0xb7ea('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3db25f=this;var _0x4e78a6={'id':_0x3db25f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3db25f[_0xb7ea('0x3')]!==_0xb7ea('0x4')){_0x4e78a6['service']=_0x3db25f['provider'];}else{_0x4e78a6[_0xb7ea('0x5')]=_0x3db25f[_0xb7ea('0x6')][_0xb7ea('0x5')];_0x4e78a6[_0xb7ea('0x7')]=_0x3db25f[_0xb7ea('0x6')][_0xb7ea('0x7')];_0x4e78a6['secure']=_0x3db25f['Smtp'][_0xb7ea('0x8')];}if(_0x3db25f[_0xb7ea('0x6')]['authentication']){if(_0x3db25f[_0xb7ea('0x6')][_0xb7ea('0x9')]){if(!_0x3db25f['Smtp'][_0xb7ea('0xa')])throw new Error(_0xb7ea('0xb'));_0x4e78a6[_0xb7ea('0xc')]={'type':'OAuth2','user':_0x3db25f[_0xb7ea('0x6')][_0xb7ea('0xd')],'accessToken':_0x3db25f[_0xb7ea('0x6')][_0xb7ea('0xa')][_0xb7ea('0xe')]};}else{_0x4e78a6[_0xb7ea('0xc')]={'user':_0x3db25f['Smtp'][_0xb7ea('0xd')],'pass':_0x3db25f[_0xb7ea('0x6')][_0xb7ea('0xf')]};}}return _0x4e78a6;}}});}; \ No newline at end of file +var _0x4932=['exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass'];(function(_0x330652,_0x545c6f){var _0x2b81af=function(_0x53821f){while(--_0x53821f){_0x330652['push'](_0x330652['shift']());}};_0x2b81af(++_0x545c6f);}(_0x4932,0xb4));var _0x2493=function(_0x7e6283,_0x1bf561){_0x7e6283=_0x7e6283-0x0;var _0x1264f0=_0x4932[_0x7e6283];return _0x1264f0;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x2493('0x0')]=function(_0x526257){return _0x526257[_0x2493('0x1')](_0x2493('0x2'),attributes,{'tableName':_0x2493('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5a8347=this;var _0x31f48b={'id':_0x5a8347['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5a8347[_0x2493('0x4')]!==_0x2493('0x5')){_0x31f48b[_0x2493('0x6')]=_0x5a8347[_0x2493('0x4')];}else{_0x31f48b[_0x2493('0x7')]=_0x5a8347[_0x2493('0x8')][_0x2493('0x7')];_0x31f48b['port']=_0x5a8347[_0x2493('0x8')][_0x2493('0x9')];_0x31f48b[_0x2493('0xa')]=_0x5a8347[_0x2493('0x8')][_0x2493('0xa')];}if(_0x5a8347[_0x2493('0x8')][_0x2493('0xb')]){if(_0x5a8347[_0x2493('0x8')][_0x2493('0xc')]){if(!_0x5a8347[_0x2493('0x8')][_0x2493('0xd')])throw new Error(_0x2493('0xe'));_0x31f48b[_0x2493('0xf')]={'type':_0x2493('0x10'),'user':_0x5a8347['Smtp'][_0x2493('0x11')],'accessToken':_0x5a8347[_0x2493('0x8')][_0x2493('0xd')][_0x2493('0x12')]};}else{_0x31f48b['auth']={'user':_0x5a8347['Smtp'][_0x2493('0x11')],'pass':_0x5a8347[_0x2493('0x8')][_0x2493('0x13')]};}}return _0x31f48b;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 6a8ae62..100ac8b 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 _0xee3c=['localhost','socket.io-emitter','./mailAccount.socket','register','request','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','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','CloudProvider','List','applications','orderBy','priority','asc','push','close','autoclose','*,*,*,*','length','create','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','update','attach','interaction','get','created','MailMessage','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2d3a48,_0x5d84f7){var _0x5569af=function(_0x2353f7){while(--_0x2353f7){_0x2d3a48['push'](_0x2d3a48['shift']());}};_0x5569af(++_0x5d84f7);}(_0xee3c,0x14a));var _0xcee3=function(_0x518ba1,_0x54ff90){_0x518ba1=_0x518ba1-0x0;var _0x517896=_0xee3c[_0x518ba1];return _0x517896;};'use strict';var _=require(_0xcee3('0x0'));var moment=require(_0xcee3('0x1'));var BPromise=require(_0xcee3('0x2'));var rs=require(_0xcee3('0x3'));var Redis=require(_0xcee3('0x4'));var db=require(_0xcee3('0x5'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0xcee3('0x6'));var jayson=require(_0xcee3('0x7'));var client=jayson[_0xcee3('0x8')][_0xcee3('0x9')]({'port':0x232c});config[_0xcee3('0xa')]=_[_0xcee3('0xb')](config[_0xcee3('0xa')],{'host':_0xcee3('0xc'),'port':0x18eb});var socket=require(_0xcee3('0xd'))(new Redis(config[_0xcee3('0xa')]));require(_0xcee3('0xe'))[_0xcee3('0xf')](socket);function respondWithRpcPromise(_0x861421,_0x81de8e,_0x15d2af){return new BPromise(function(_0x507d8c,_0x1ed6a6){return client[_0xcee3('0x10')](_0x861421,_0x15d2af)[_0xcee3('0x11')](function(_0x2790ba){logger[_0xcee3('0x12')](_0xcee3('0x13'),_0x81de8e,'request\x20sent');logger[_0xcee3('0x14')](_0xcee3('0x15'),_0x81de8e,_0xcee3('0x16'),JSON[_0xcee3('0x17')](_0x2790ba));if(_0x2790ba[_0xcee3('0x18')]){if(_0x2790ba['error'][_0xcee3('0x19')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x81de8e,_0x2790ba['error'][_0xcee3('0x1a')]);return _0x1ed6a6(_0x2790ba[_0xcee3('0x18')]['message']);}logger['error'](_0xcee3('0x13'),_0x81de8e,_0x2790ba['error'][_0xcee3('0x1a')]);return _0x507d8c(_0x2790ba['error'][_0xcee3('0x1a')]);}else{logger[_0xcee3('0x12')]('MailAccount,\x20%s,\x20%s',_0x81de8e,_0xcee3('0x16'));_0x507d8c(_0x2790ba[_0xcee3('0x1b')][_0xcee3('0x1a')]);}})[_0xcee3('0x1c')](function(_0x50bf6e){logger[_0xcee3('0x18')](_0xcee3('0x13'),_0x81de8e,_0x50bf6e);_0x1ed6a6(_0x50bf6e);});});}exports[_0xcee3('0x1d')]=function(_0x11bf37){var _0x52f4d7=this;return new Promise(function(_0x254de7,_0xf2f32){return db[_0xcee3('0x1e')][_0xcee3('0x1f')]({'raw':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x21')]===undefined?!![]:![]:!![],'where':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x22')]||null:null,'attributes':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x23')]||null:null,'limit':_0x11bf37['options']?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x24')]||null:null,'include':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x25')]?_['map'](_0x11bf37['options'][_0xcee3('0x25')],function(_0x5b92ba){return{'model':db[_0x5b92ba['model']],'as':_0x5b92ba['as'],'attributes':_0x5b92ba[_0xcee3('0x23')],'include':_0x5b92ba['include']?_[_0xcee3('0x26')](_0x5b92ba[_0xcee3('0x25')],function(_0x19a15e){return{'model':db[_0x19a15e['model']],'as':_0x19a15e['as'],'attributes':_0x19a15e[_0xcee3('0x23')],'include':_0x19a15e['include']?_[_0xcee3('0x26')](_0x19a15e['include'],function(_0x2c2d48){return{'model':db[_0x2c2d48[_0xcee3('0x27')]],'as':_0x2c2d48['as'],'attributes':_0x2c2d48['attributes']};}):[]};}):[]};}):[]:[]})[_0xcee3('0x11')](function(_0x1efb1b){logger['info'](_0xcee3('0x1d'),_0x11bf37);logger['debug']('GetMailAccount',_0x11bf37,JSON[_0xcee3('0x17')](_0x1efb1b));_0x254de7(_0x1efb1b);})['catch'](function(_0x22e342){logger[_0xcee3('0x18')](_0xcee3('0x1d'),_0x22e342[_0xcee3('0x1a')],_0x11bf37);_0xf2f32(_0x52f4d7[_0xcee3('0x18')](0x1f4,_0x22e342[_0xcee3('0x1a')]));});});};exports[_0xcee3('0x28')]=function(_0x5ce5be){var _0x298a29=this;return new Promise(function(_0x56f705,_0x74019c){return db[_0xcee3('0x1e')][_0xcee3('0x29')]({'raw':_0x5ce5be[_0xcee3('0x20')]?_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x21')]===undefined?!![]:![]:!![],'where':_0x5ce5be[_0xcee3('0x20')]?_0x5ce5be[_0xcee3('0x20')]['where']||null:null,'attributes':_0x5ce5be[_0xcee3('0x20')]?_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x23')]||null:null,'include':_0x5ce5be['options']?_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x25')]?_['map'](_0x5ce5be[_0xcee3('0x20')]['include'],function(_0x2a4996){return{'model':db[_0x2a4996['model']],'as':_0x2a4996['as'],'attributes':_0x2a4996['attributes'],'include':_0x2a4996[_0xcee3('0x25')]?_['map'](_0x2a4996[_0xcee3('0x25')],function(_0x322e05){return{'model':db[_0x322e05[_0xcee3('0x27')]],'as':_0x322e05['as'],'attributes':_0x322e05[_0xcee3('0x23')],'include':_0x322e05['include']?_['map'](_0x322e05[_0xcee3('0x25')],function(_0x45feca){return{'model':db[_0x45feca['model']],'as':_0x45feca['as'],'attributes':_0x45feca[_0xcee3('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcee3('0x11')](function(_0x55081a){if(_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x2a')]===!![])_0x55081a[_0xcee3('0x2b')](_0xcee3('0x2c'),_0x55081a[_0xcee3('0x2d')]());logger[_0xcee3('0x12')]('ShowMailAccount',_0x5ce5be);logger[_0xcee3('0x14')](_0xcee3('0x28'),_0x5ce5be,JSON[_0xcee3('0x17')](_0x55081a));_0x56f705(_0x55081a);})[_0xcee3('0x1c')](function(_0x3ea90f){logger[_0xcee3('0x18')](_0xcee3('0x28'),_0x3ea90f['message'],_0x5ce5be);_0x74019c(_0x298a29[_0xcee3('0x18')](0x1f4,_0x3ea90f[_0xcee3('0x1a')]));});});};exports[_0xcee3('0x2e')]=function(_0x51aae6){var _0x45dab9=this;return new Promise(function(_0x436961,_0x5a7c9f){var _0x305bfa={'body':_0x51aae6[_0xcee3('0x2f')],'channel':_0xcee3('0x30')};var _0x5b4b40=_[_0xcee3('0x31')](_[_0xcee3('0x32')](db[_0xcee3('0x33')][_0xcee3('0x34')]),[_0xcee3('0x35'),'updatedAt','CompanyId',_0xcee3('0x36')]);var _0x41cd61=![];if(_0x51aae6[_0xcee3('0x2f')]['id']){delete _0x51aae6[_0xcee3('0x2f')]['id'];}if(_[_0xcee3('0x37')](_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')])){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xcee3('0x37')](_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x2f')])||_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x2f')]===''){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,_0xcee3('0x39')));}if(_['isNil'](_0x51aae6[_0xcee3('0x2f')]['mapKey'])){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,_0xcee3('0x3a')+_0x5b4b40));}if(!_['includes'](_0x5b4b40,_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x3b')])){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,_0xcee3('0x3c')+_0x5b4b40));}var _0x12d32e={};_0x12d32e[_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x3b')]]=_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')];return db[_0xcee3('0x1e')]['find']({'where':{'id':_0x51aae6[_0xcee3('0x3d')]['id']},'include':[{'model':db[_0xcee3('0x3e')],'as':'List','include':[{'model':db[_0xcee3('0x33')],'as':_0xcee3('0x3f'),'where':_0x12d32e,'limit':0x1,'order':[[_0xcee3('0x40'),_0xcee3('0x41')]]}]},{'model':db[_0xcee3('0x42')],'as':_0xcee3('0x43')},{'model':db[_0xcee3('0x44')],'as':'Smtp','include':[{'model':db[_0xcee3('0x45')],'as':_0xcee3('0x45')}]}]})[_0xcee3('0x11')](function(_0x27022b){if(_0x27022b&&_0x27022b[_0xcee3('0x46')]){var _0x2a0b71=_0x27022b['get']({'plain':!![]});_0x305bfa[_0xcee3('0x3d')]=_['omit'](_0x2a0b71,[_0xcee3('0x43'),_0xcee3('0x46')]);_0x305bfa[_0xcee3('0x3d')]['smtpOptions']=_0x27022b['getSmtpOptions']();_0x305bfa[_0xcee3('0x47')]=_0x2a0b71[_0xcee3('0x43')];_0x305bfa['list']=_0x2a0b71[_0xcee3('0x46')];_0x305bfa['applications']=_[_0xcee3('0x48')](_0x305bfa[_0xcee3('0x47')],[_0xcee3('0x49')],[_0xcee3('0x4a')]);if(_0x305bfa['account']&&_0x305bfa['account']['autoclose']){_0x305bfa[_0xcee3('0x47')][_0xcee3('0x4b')]({'id':0x0,'priority':_0x305bfa[_0xcee3('0x47')]['length']+0x1,'app':_0xcee3('0x4c'),'appdata':_0xcee3('0x4d'),'interval':_0xcee3('0x4e')});}if(_0x305bfa[_0xcee3('0x3d')][_0xcee3('0x43')]){delete _0x305bfa[_0xcee3('0x3d')][_0xcee3('0x43')];}if(_0x305bfa['account']['List']){delete _0x305bfa[_0xcee3('0x3d')]['List'];}if(_0x2a0b71['List']['Contacts'][_0xcee3('0x4f')]){return _0x2a0b71[_0xcee3('0x46')][_0xcee3('0x3f')][0x0];}var _0x295451=_[_0xcee3('0xb')](_0x51aae6['body'],{'firstName':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')],'ListId':_0x2a0b71[_0xcee3('0x36')]});_0x295451[_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x3b')]]=_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')];return db[_0xcee3('0x33')][_0xcee3('0x50')](_0x295451);}else{throw new Error('List\x20not\x20found');}})[_0xcee3('0x11')](function(_0x2e7a8d){_0x305bfa[_0xcee3('0x51')]=_0x2e7a8d;if(_0x2e7a8d){if(!_0x51aae6['body'][_0xcee3('0x1a')]['messageId']){_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x52')]=rs[_0xcee3('0x53')]()+'\x20'+_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x38')];}var _0x46f817={'ContactId':_0x2e7a8d['id'],'MailAccountId':_0x51aae6['account']['id'],'inReplyTo':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x52')],'to':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')][_0xcee3('0x38')],'cc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['cc'],'subject':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x54')],'attach':_0x51aae6['body']['message']['attach'],'lastMsgAt':moment()[_0xcee3('0x55')](_0xcee3('0x56')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x51aae6[_0xcee3('0x3d')]['id']},'include':[{'model':db['MailMessage'],'as':_0xcee3('0x57'),'attributes':[_0xcee3('0x52')],'where':{'messageId':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x58')]}}]})[_0xcee3('0x11')](function(_0x1b5d89){if(_0x1b5d89){return[_0x1b5d89,![]];}return db['MailInteraction']['create'](_0x46f817)[_0xcee3('0x11')](function(_0x9d6ffd){return[_0x9d6ffd,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x22e6b9,_0x3ce8ad){if(_0x22e6b9){_0x41cd61=_0x3ce8ad;if(!_0x3ce8ad){return _0x22e6b9[_0xcee3('0x59')]({'inReplyTo':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['messageId'],'to':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['from'],'cc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['cc'],'subject':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x54')],'attach':_0x22e6b9[_0xcee3('0x5a')]?_0x22e6b9['attach']:_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x5a')],'substatus':null,'substatusAt':moment()[_0xcee3('0x55')](_0xcee3('0x56')),'lastMsgAt':moment()[_0xcee3('0x55')](_0xcee3('0x56')),'lastMsgDirection':'in'});}else{return _0x22e6b9;}}})[_0xcee3('0x11')](function(_0x1cb05d){_0x305bfa[_0xcee3('0x5b')]=_0x1cb05d[_0xcee3('0x5c')]({'plain':!![]});_0x305bfa['interaction'][_0xcee3('0x5d')]=_0x41cd61;return db[_0xcee3('0x5e')][_0xcee3('0x50')]({'body':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x2f')],'MailAccountId':_0x51aae6['account']['id'],'MailInteractionId':_0x1cb05d['id'],'direction':'in','ContactId':_0x305bfa[_0xcee3('0x51')]['id'],'messageId':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['messageId'],'from':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['from'],'to':_0x51aae6['body'][_0xcee3('0x1a')]['to'],'cc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['cc'],'subject':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x54')],'attach':_0x51aae6[_0xcee3('0x2f')]['message']['attach'],'Attachments':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x5f')],'originTo':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')][_0xcee3('0x60')],'originCc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['originCc'],'bcc':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x61')],'ChatWebsiteId':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x62')]||null,'originChannel':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')][_0xcee3('0x63')]||_0xcee3('0x64'),'ChatOfflineMessageId':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x65')]||null},{'include':[{'model':db[_0xcee3('0x66')],'as':'Attachments'}]});})['then'](function(_0x23cd22){_0x305bfa[_0xcee3('0x1a')]=_0x23cd22;if(!_0x305bfa[_0xcee3('0x5b')][_0xcee3('0x67')]){return;}return db[_0xcee3('0x68')]['find']({'attributes':['id',_0xcee3('0x69')],'where':{'id':_0x305bfa['interaction']['UserId']}});})['then'](function(_0x237a9d){if(_0x237a9d){_0x305bfa[_0xcee3('0x47')][_0xcee3('0x6a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x237a9d[_0xcee3('0x69')]+','+(_0x305bfa[_0xcee3('0x3d')][_0xcee3('0x6b')]||0xa),'interval':_0xcee3('0x4e')});}if(!_0x305bfa[_0xcee3('0x5b')][_0xcee3('0x6c')]){return;}return db[_0xcee3('0x6d')][_0xcee3('0x29')]({'attributes':['id',_0xcee3('0x69')],'where':{'id':_0x305bfa['interaction'][_0xcee3('0x6c')]}});})[_0xcee3('0x11')](function(_0x513fce){if(_0x513fce){_0x305bfa[_0xcee3('0x47')][_0xcee3('0x6a')]({'id':0x0,'priority':0x1,'app':_0xcee3('0x6e'),'appdata':_0x513fce[_0xcee3('0x69')]+','+(_0x305bfa[_0xcee3('0x3d')][_0xcee3('0x6f')]||0x12c),'interval':_0xcee3('0x4e')});}return respondWithRpcPromise(_0xcee3('0x70'),_0xcee3('0x71'),_0x305bfa);})[_0xcee3('0x11')](function(_0x17cb5c){_0x436961(_0x17cb5c);})[_0xcee3('0x1c')](function(_0x51d3cf){_0x5a7c9f(_0x45dab9['error'](0x1f4,_0x51d3cf['message']));});});}; \ No newline at end of file +var _0x9f5a=['result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','map','include','model','info','ShowMailAccount','find','where','smtp','setDataValue','NotifyMailAccount','body','difference','CmContact','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','Smtp','CloudProvider','get','account','getSmtpOptions','applications','orderBy','priority','autoclose','push','length','*,*,*,*','create','contact','messageId','subject','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','attach','format','interaction','created','MailMessage','attachments','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','MailQueue','queueId','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4c783d,_0x3a86cc){var _0x541562=function(_0x2f1658){while(--_0x2f1658){_0x4c783d['push'](_0x4c783d['shift']());}};_0x541562(++_0x3a86cc);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x14f044,_0x1600e2){_0x14f044=_0x14f044-0x0;var _0x335fa5=_0x9f5a[_0x14f044];return _0x335fa5;};'use strict';var _=require(_0xa9f5('0x0'));var moment=require(_0xa9f5('0x1'));var BPromise=require(_0xa9f5('0x2'));var rs=require(_0xa9f5('0x3'));var Redis=require('ioredis');var db=require(_0xa9f5('0x4'))['db'];var logger=require(_0xa9f5('0x5'))(_0xa9f5('0x6'));var config=require('../../config/environment');var jayson=require(_0xa9f5('0x7'));var client=jayson['client'][_0xa9f5('0x8')]({'port':0x232c});config[_0xa9f5('0x9')]=_['defaults'](config[_0xa9f5('0x9')],{'host':_0xa9f5('0xa'),'port':0x18eb});var socket=require(_0xa9f5('0xb'))(new Redis(config[_0xa9f5('0x9')]));require(_0xa9f5('0xc'))[_0xa9f5('0xd')](socket);function respondWithRpcPromise(_0x189ef8,_0x4cb5a5,_0x2e0ff8){return new BPromise(function(_0x2ec4a7,_0x4bb362){return client[_0xa9f5('0xe')](_0x189ef8,_0x2e0ff8)[_0xa9f5('0xf')](function(_0x4ebcf5){logger['info'](_0xa9f5('0x10'),_0x4cb5a5,_0xa9f5('0x11'));logger[_0xa9f5('0x12')](_0xa9f5('0x13'),_0x4cb5a5,'request\x20sent',JSON[_0xa9f5('0x14')](_0x4ebcf5));if(_0x4ebcf5[_0xa9f5('0x15')]){if(_0x4ebcf5[_0xa9f5('0x15')]['code']===0x1f4){logger[_0xa9f5('0x15')](_0xa9f5('0x10'),_0x4cb5a5,_0x4ebcf5['error']['message']);return _0x4bb362(_0x4ebcf5['error'][_0xa9f5('0x16')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x4cb5a5,_0x4ebcf5[_0xa9f5('0x15')][_0xa9f5('0x16')]);return _0x2ec4a7(_0x4ebcf5[_0xa9f5('0x15')][_0xa9f5('0x16')]);}else{logger['info'](_0xa9f5('0x10'),_0x4cb5a5,_0xa9f5('0x11'));_0x2ec4a7(_0x4ebcf5[_0xa9f5('0x17')][_0xa9f5('0x16')]);}})[_0xa9f5('0x18')](function(_0x1ee027){logger[_0xa9f5('0x15')](_0xa9f5('0x10'),_0x4cb5a5,_0x1ee027);_0x4bb362(_0x1ee027);});});}exports[_0xa9f5('0x19')]=function(_0x38bd22){var _0x31f97e=this;return new Promise(function(_0x27a7b0,_0x4e0c93){return db[_0xa9f5('0x1a')][_0xa9f5('0x1b')]({'raw':_0x38bd22[_0xa9f5('0x1c')]?_0x38bd22[_0xa9f5('0x1c')][_0xa9f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x38bd22[_0xa9f5('0x1c')]?_0x38bd22[_0xa9f5('0x1c')]['where']||null:null,'attributes':_0x38bd22[_0xa9f5('0x1c')]?_0x38bd22[_0xa9f5('0x1c')][_0xa9f5('0x1e')]||null:null,'limit':_0x38bd22[_0xa9f5('0x1c')]?_0x38bd22[_0xa9f5('0x1c')][_0xa9f5('0x1f')]||null:null,'include':_0x38bd22[_0xa9f5('0x1c')]?_0x38bd22[_0xa9f5('0x1c')]['include']?_[_0xa9f5('0x20')](_0x38bd22[_0xa9f5('0x1c')][_0xa9f5('0x21')],function(_0x24c8eb){return{'model':db[_0x24c8eb[_0xa9f5('0x22')]],'as':_0x24c8eb['as'],'attributes':_0x24c8eb[_0xa9f5('0x1e')],'include':_0x24c8eb['include']?_[_0xa9f5('0x20')](_0x24c8eb['include'],function(_0x53caa4){return{'model':db[_0x53caa4['model']],'as':_0x53caa4['as'],'attributes':_0x53caa4[_0xa9f5('0x1e')],'include':_0x53caa4[_0xa9f5('0x21')]?_[_0xa9f5('0x20')](_0x53caa4[_0xa9f5('0x21')],function(_0x30fa9f){return{'model':db[_0x30fa9f[_0xa9f5('0x22')]],'as':_0x30fa9f['as'],'attributes':_0x30fa9f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9f5('0xf')](function(_0x43ba93){logger[_0xa9f5('0x23')](_0xa9f5('0x19'),_0x38bd22);logger[_0xa9f5('0x12')](_0xa9f5('0x19'),_0x38bd22,JSON[_0xa9f5('0x14')](_0x43ba93));_0x27a7b0(_0x43ba93);})[_0xa9f5('0x18')](function(_0x5a422b){logger['error']('GetMailAccount',_0x5a422b[_0xa9f5('0x16')],_0x38bd22);_0x4e0c93(_0x31f97e[_0xa9f5('0x15')](0x1f4,_0x5a422b[_0xa9f5('0x16')]));});});};exports[_0xa9f5('0x24')]=function(_0x33dd3a){var _0x45cd27=this;return new Promise(function(_0x43c3f3,_0x68c4fb){return db[_0xa9f5('0x1a')][_0xa9f5('0x25')]({'raw':_0x33dd3a[_0xa9f5('0x1c')]?_0x33dd3a[_0xa9f5('0x1c')][_0xa9f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x33dd3a['options']?_0x33dd3a[_0xa9f5('0x1c')][_0xa9f5('0x26')]||null:null,'attributes':_0x33dd3a[_0xa9f5('0x1c')]?_0x33dd3a[_0xa9f5('0x1c')][_0xa9f5('0x1e')]||null:null,'include':_0x33dd3a[_0xa9f5('0x1c')]?_0x33dd3a[_0xa9f5('0x1c')][_0xa9f5('0x21')]?_['map'](_0x33dd3a[_0xa9f5('0x1c')]['include'],function(_0x26e251){return{'model':db[_0x26e251[_0xa9f5('0x22')]],'as':_0x26e251['as'],'attributes':_0x26e251['attributes'],'include':_0x26e251[_0xa9f5('0x21')]?_[_0xa9f5('0x20')](_0x26e251[_0xa9f5('0x21')],function(_0x2cbd28){return{'model':db[_0x2cbd28['model']],'as':_0x2cbd28['as'],'attributes':_0x2cbd28[_0xa9f5('0x1e')],'include':_0x2cbd28[_0xa9f5('0x21')]?_['map'](_0x2cbd28[_0xa9f5('0x21')],function(_0x23232b){return{'model':db[_0x23232b[_0xa9f5('0x22')]],'as':_0x23232b['as'],'attributes':_0x23232b[_0xa9f5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa9f5('0xf')](function(_0x41f6a4){if(_0x33dd3a[_0xa9f5('0x1c')][_0xa9f5('0x27')]===!![])_0x41f6a4[_0xa9f5('0x28')]('smtpOptions',_0x41f6a4['getSmtpOptions']());logger[_0xa9f5('0x23')](_0xa9f5('0x24'),_0x33dd3a);logger['debug'](_0xa9f5('0x24'),_0x33dd3a,JSON[_0xa9f5('0x14')](_0x41f6a4));_0x43c3f3(_0x41f6a4);})[_0xa9f5('0x18')](function(_0x371af3){logger['error'](_0xa9f5('0x24'),_0x371af3[_0xa9f5('0x16')],_0x33dd3a);_0x68c4fb(_0x45cd27['error'](0x1f4,_0x371af3[_0xa9f5('0x16')]));});});};exports[_0xa9f5('0x29')]=function(_0x5df1a6){var _0x10de90=this;return new Promise(function(_0x40b5fb,_0x4fd6f6){var _0x1a9915={'body':_0x5df1a6[_0xa9f5('0x2a')],'channel':'mail'};var _0x2ee2a2=_[_0xa9f5('0x2b')](_['keys'](db[_0xa9f5('0x2c')]['rawAttributes']),[_0xa9f5('0x2d'),_0xa9f5('0x2e'),'CompanyId',_0xa9f5('0x2f')]);var _0x488380=![];if(_0x5df1a6['body']['id']){delete _0x5df1a6[_0xa9f5('0x2a')]['id'];}if(_[_0xa9f5('0x30')](_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x31')])){return _0x4fd6f6(_0x10de90[_0xa9f5('0x15')](0x1f4,_0xa9f5('0x32')));}if(_[_0xa9f5('0x30')](_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x2a')])||_0x5df1a6['body'][_0xa9f5('0x2a')]===''){return _0x4fd6f6(_0x10de90[_0xa9f5('0x15')](0x1f4,_0xa9f5('0x33')));}if(_[_0xa9f5('0x30')](_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x34')])){return _0x4fd6f6(_0x10de90[_0xa9f5('0x15')](0x1f4,_0xa9f5('0x35')+_0x2ee2a2));}if(!_[_0xa9f5('0x36')](_0x2ee2a2,_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x34')])){return _0x4fd6f6(_0x10de90[_0xa9f5('0x15')](0x1f4,_0xa9f5('0x37')+_0x2ee2a2));}var _0xd95e3={};_0xd95e3[_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x34')]]=_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x31')];return db[_0xa9f5('0x1a')]['find']({'where':{'id':_0x5df1a6['account']['id']},'include':[{'model':db[_0xa9f5('0x38')],'as':_0xa9f5('0x39'),'include':[{'model':db['CmContact'],'as':_0xa9f5('0x3a'),'where':_0xd95e3,'limit':0x1,'order':[[_0xa9f5('0x2e'),_0xa9f5('0x3b')]]}]},{'model':db['MailApplication'],'as':_0xa9f5('0x3c')},{'model':db['MailServerOut'],'as':_0xa9f5('0x3d'),'include':[{'model':db[_0xa9f5('0x3e')],'as':_0xa9f5('0x3e')}]}]})[_0xa9f5('0xf')](function(_0x102ed8){if(_0x102ed8&&_0x102ed8[_0xa9f5('0x39')]){var _0x4e17a9=_0x102ed8[_0xa9f5('0x3f')]({'plain':!![]});_0x1a9915['account']=_['omit'](_0x4e17a9,[_0xa9f5('0x3c'),'List']);_0x1a9915[_0xa9f5('0x40')]['smtpOptions']=_0x102ed8[_0xa9f5('0x41')]();_0x1a9915[_0xa9f5('0x42')]=_0x4e17a9[_0xa9f5('0x3c')];_0x1a9915['list']=_0x4e17a9[_0xa9f5('0x39')];_0x1a9915[_0xa9f5('0x42')]=_[_0xa9f5('0x43')](_0x1a9915['applications'],[_0xa9f5('0x44')],['asc']);if(_0x1a9915['account']&&_0x1a9915[_0xa9f5('0x40')][_0xa9f5('0x45')]){_0x1a9915[_0xa9f5('0x42')][_0xa9f5('0x46')]({'id':0x0,'priority':_0x1a9915['applications'][_0xa9f5('0x47')]+0x1,'app':'close','appdata':_0xa9f5('0x45'),'interval':_0xa9f5('0x48')});}if(_0x1a9915[_0xa9f5('0x40')]['Applications']){delete _0x1a9915['account'][_0xa9f5('0x3c')];}if(_0x1a9915[_0xa9f5('0x40')]['List']){delete _0x1a9915[_0xa9f5('0x40')][_0xa9f5('0x39')];}if(_0x4e17a9[_0xa9f5('0x39')][_0xa9f5('0x3a')][_0xa9f5('0x47')]){return _0x4e17a9[_0xa9f5('0x39')][_0xa9f5('0x3a')][0x0];}var _0x1a1207=_['defaults'](_0x5df1a6['body'],{'firstName':_0x5df1a6['body'][_0xa9f5('0x31')],'ListId':_0x4e17a9['ListId']});_0x1a1207[_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x34')]]=_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x31')];return db[_0xa9f5('0x2c')][_0xa9f5('0x49')](_0x1a1207);}else{throw new Error('List\x20not\x20found');}})[_0xa9f5('0xf')](function(_0x1782c2){_0x1a9915[_0xa9f5('0x4a')]=_0x1782c2;if(_0x1782c2){if(!_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')]['messageId']){_0x5df1a6[_0xa9f5('0x2a')]['message']['messageId']=rs['generate']()+'\x20'+_0x5df1a6[_0xa9f5('0x2a')]['message'][_0xa9f5('0x31')];}var _0xd106c7={'ContactId':_0x1782c2['id'],'MailAccountId':_0x5df1a6[_0xa9f5('0x40')]['id'],'inReplyTo':_0x5df1a6['body']['message'][_0xa9f5('0x4b')],'to':_0x5df1a6['body'][_0xa9f5('0x16')][_0xa9f5('0x31')],'cc':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')]['cc'],'subject':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x4c')],'attach':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')]['attach'],'lastMsgAt':moment()['format'](_0xa9f5('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xa9f5('0x25')]({'where':{'closed':![],'MailAccountId':_0x5df1a6[_0xa9f5('0x40')]['id']},'include':[{'model':db['MailMessage'],'as':_0xa9f5('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x4f')]}}]})['then'](function(_0x32c65a){if(_0x32c65a){return[_0x32c65a,![]];}return db[_0xa9f5('0x50')][_0xa9f5('0x49')](_0xd106c7)['then'](function(_0x2eaa8c){return[_0x2eaa8c,!![]];});});}else{throw new Error(_0xa9f5('0x51'));}})[_0xa9f5('0x52')](function(_0x2bf5fb,_0x417ce5){if(_0x2bf5fb){_0x488380=_0x417ce5;if(!_0x417ce5){return _0x2bf5fb['update']({'inReplyTo':_0x5df1a6[_0xa9f5('0x2a')]['message'][_0xa9f5('0x4b')],'to':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x31')],'cc':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')]['cc'],'subject':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x4c')],'attach':_0x2bf5fb[_0xa9f5('0x53')]?_0x2bf5fb[_0xa9f5('0x53')]:_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x53')],'substatus':null,'substatusAt':moment()[_0xa9f5('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xa9f5('0x54')](_0xa9f5('0x4d')),'lastMsgDirection':'in'});}else{return _0x2bf5fb;}}})[_0xa9f5('0xf')](function(_0xf228d9){_0x1a9915['interaction']=_0xf228d9[_0xa9f5('0x3f')]({'plain':!![]});_0x1a9915[_0xa9f5('0x55')][_0xa9f5('0x56')]=_0x488380;return db[_0xa9f5('0x57')]['create']({'body':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x2a')],'MailAccountId':_0x5df1a6['account']['id'],'MailInteractionId':_0xf228d9['id'],'direction':'in','ContactId':_0x1a9915[_0xa9f5('0x4a')]['id'],'messageId':_0x5df1a6[_0xa9f5('0x2a')]['message']['messageId'],'from':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x31')],'to':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')]['to'],'cc':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')]['cc'],'subject':_0x5df1a6['body']['message'][_0xa9f5('0x4c')],'attach':_0x5df1a6['body'][_0xa9f5('0x16')]['attach'],'Attachments':_0x5df1a6['body'][_0xa9f5('0x16')][_0xa9f5('0x58')],'originTo':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')]['originTo'],'originCc':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x59')],'bcc':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x5a')],'ChatWebsiteId':_0x5df1a6[_0xa9f5('0x2a')][_0xa9f5('0x16')][_0xa9f5('0x5b')]||null,'originChannel':_0x5df1a6[_0xa9f5('0x2a')]['message']['originChannel']||_0xa9f5('0x5c'),'ChatOfflineMessageId':_0x5df1a6[_0xa9f5('0x2a')]['message'][_0xa9f5('0x5d')]||null},{'include':[{'model':db[_0xa9f5('0x5e')],'as':_0xa9f5('0x5f')}]});})[_0xa9f5('0xf')](function(_0x358809){_0x1a9915[_0xa9f5('0x16')]=_0x358809;if(!_0x1a9915[_0xa9f5('0x55')][_0xa9f5('0x60')]){return;}return db[_0xa9f5('0x61')][_0xa9f5('0x25')]({'attributes':['id','name'],'where':{'id':_0x1a9915['interaction'][_0xa9f5('0x60')]}});})[_0xa9f5('0xf')](function(_0x5a8788){if(_0x5a8788){_0x1a9915['applications'][_0xa9f5('0x62')]({'id':0x0,'priority':0x0,'app':_0xa9f5('0x63'),'appdata':_0x5a8788[_0xa9f5('0x64')]+','+(_0x1a9915['account'][_0xa9f5('0x65')]||0xa),'interval':_0xa9f5('0x48')});}if(!_0x1a9915[_0xa9f5('0x55')]['queueId']){return;}return db[_0xa9f5('0x66')][_0xa9f5('0x25')]({'attributes':['id','name'],'where':{'id':_0x1a9915['interaction'][_0xa9f5('0x67')]}});})['then'](function(_0x3e9f14){if(_0x3e9f14){_0x1a9915[_0xa9f5('0x42')][_0xa9f5('0x62')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3e9f14[_0xa9f5('0x64')]+','+(_0x1a9915['account']['waitForTheAssignedQueue']||0x12c),'interval':_0xa9f5('0x48')});}return respondWithRpcPromise(_0xa9f5('0x68'),_0xa9f5('0x69'),_0x1a9915);})[_0xa9f5('0xf')](function(_0x4e874b){_0x40b5fb(_0x4e874b);})[_0xa9f5('0x18')](function(_0x1bdb4a){_0x4fd6f6(_0x10de90['error'](0x1f4,_0x1bdb4a[_0xa9f5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 8a64f24..132c6e7 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 _0xa702=['register','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x3e1d48,_0x171785){var _0x19c714=function(_0x502da1){while(--_0x502da1){_0x3e1d48['push'](_0x3e1d48['shift']());}};_0x19c714(++_0x171785);}(_0xa702,0x1ae));var _0x2a70=function(_0x58ca65,_0x4a4560){_0x58ca65=_0x58ca65-0x0;var _0x2ed1c4=_0xa702[_0x58ca65];return _0x2ed1c4;};'use strict';var MailAccountEvents=require(_0x2a70('0x0'));var events=[_0x2a70('0x1'),_0x2a70('0x2'),_0x2a70('0x3')];function createListener(_0x3fd554,_0x53128e){return function(_0x40c062){_0x53128e['emit'](_0x3fd554,_0x40c062);};}function removeListener(_0x55c9b2,_0x3c1629){return function(){MailAccountEvents['removeListener'](_0x55c9b2,_0x3c1629);};}exports[_0x2a70('0x4')]=function(_0x16cdc3){for(var _0x4b2915=0x0,_0x54e5a2=events[_0x2a70('0x5')];_0x4b2915<_0x54e5a2;_0x4b2915++){var _0x261c54=events[_0x4b2915];var _0x51e726=createListener(_0x2a70('0x6')+_0x261c54,_0x16cdc3);MailAccountEvents['on'](_0x261c54,_0x51e726);}}; \ No newline at end of file +var _0x3b48=['mailAccount:','./mailAccount.events','save','remove','update','removeListener','register','length'];(function(_0x36c97f,_0x445d22){var _0x42f8ce=function(_0x1e6a9d){while(--_0x1e6a9d){_0x36c97f['push'](_0x36c97f['shift']());}};_0x42f8ce(++_0x445d22);}(_0x3b48,0x1b1));var _0x83b4=function(_0x23af15,_0x4eec90){_0x23af15=_0x23af15-0x0;var _0x2fd2f4=_0x3b48[_0x23af15];return _0x2fd2f4;};'use strict';var MailAccountEvents=require(_0x83b4('0x0'));var events=[_0x83b4('0x1'),_0x83b4('0x2'),_0x83b4('0x3')];function createListener(_0x4e3adc,_0xfb81de){return function(_0x31a982){_0xfb81de['emit'](_0x4e3adc,_0x31a982);};}function removeListener(_0x516c2a,_0x48a0f8){return function(){MailAccountEvents[_0x83b4('0x4')](_0x516c2a,_0x48a0f8);};}exports[_0x83b4('0x5')]=function(_0x242695){for(var _0xd5b8ed=0x0,_0x1e9cc6=events[_0x83b4('0x6')];_0xd5b8ed<_0x1e9cc6;_0xd5b8ed++){var _0x11e7d6=events[_0xd5b8ed];var _0x29592d=createListener(_0x83b4('0x7')+_0x11e7d6,_0x242695);MailAccountEvents['on'](_0x11e7d6,_0x29592d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9cafd91..db0e444 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 _0x255f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout'];(function(_0x311582,_0x402341){var _0x1c3541=function(_0x2574fc){while(--_0x2574fc){_0x311582['push'](_0x311582['shift']());}};_0x1c3541(++_0x402341);}(_0x255f,0x1a1));var _0xf255=function(_0x17c3cb,_0x2fab9b){_0x17c3cb=_0x17c3cb-0x0;var _0x59f56b=_0x255f[_0x17c3cb];return _0x59f56b;};'use strict';var multer=require(_0xf255('0x0'));var util=require(_0xf255('0x1'));var path=require('path');var timeout=require(_0xf255('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf255('0x3'));var interaction=require(_0xf255('0x4'));var config=require(_0xf255('0x5'));var controller=require('./mailApplication.controller');router[_0xf255('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf255('0x7')](_0xf255('0x8'),auth['isAuthenticated'](),controller[_0xf255('0x9')]);router[_0xf255('0xa')](_0xf255('0x8'),auth[_0xf255('0xb')](),controller[_0xf255('0xc')]);module[_0xf255('0xd')]=router; \ No newline at end of file +var _0xa8e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','path','express','fs-extra'];(function(_0x220a43,_0x4e7a87){var _0x231f61=function(_0xa4a968){while(--_0xa4a968){_0x220a43['push'](_0x220a43['shift']());}};_0x231f61(++_0x4e7a87);}(_0xa8e9,0x93));var _0x9a8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa8e9[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9a8e('0x0'));var timeout=require('connect-timeout');var express=require(_0x9a8e('0x1'));var router=express['Router']();var fs_extra=require(_0x9a8e('0x2'));var auth=require(_0x9a8e('0x3'));var interaction=require(_0x9a8e('0x4'));var config=require(_0x9a8e('0x5'));var controller=require(_0x9a8e('0x6'));router[_0x9a8e('0x7')](_0x9a8e('0x8'),auth[_0x9a8e('0x9')](),controller[_0x9a8e('0xa')]);router[_0x9a8e('0xb')](_0x9a8e('0x8'),auth[_0x9a8e('0x9')](),controller[_0x9a8e('0xc')]);router[_0x9a8e('0xd')](_0x9a8e('0x8'),auth[_0x9a8e('0x9')](),controller[_0x9a8e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index e15c45e..78ef62a 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 _0x21dc=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x4bebdb,_0x295d82){var _0xf1c964=function(_0x8c87b1){while(--_0x8c87b1){_0x4bebdb['push'](_0x4bebdb['shift']());}};_0xf1c964(++_0x295d82);}(_0x21dc,0x151));var _0xc21d=function(_0x40cf58,_0x2c4366){_0x40cf58=_0x40cf58-0x0;var _0x3758ee=_0x21dc[_0x40cf58];return _0x3758ee;};'use strict';var Sequelize=require(_0xc21d('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc21d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc21d('0x2')],'allowNull':![],'defaultValue':_0xc21d('0x3')},'appdata':{'type':Sequelize[_0xc21d('0x4')]()},'description':{'type':Sequelize[_0xc21d('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc21d('0x5')}}; \ No newline at end of file +var _0xb944=['exports','STRING','sequelize'];(function(_0x1fd3d4,_0xc6bbde){var _0x70047=function(_0x4f7920){while(--_0x4f7920){_0x1fd3d4['push'](_0x1fd3d4['shift']());}};_0x70047(++_0xc6bbde);}(_0xb944,0x68));var _0x4b94=function(_0x3e7d64,_0x53d71b){_0x3e7d64=_0x3e7d64-0x0;var _0x137f44=_0xb944[_0x3e7d64];return _0x137f44;};'use strict';var Sequelize=require(_0x4b94('0x0'));module[_0x4b94('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4b94('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4b94('0x2')]},'interval':{'type':Sequelize[_0x4b94('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 337cb85..5959b03 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x5ac3c0,_0x4c7d91){var _0x32588d=function(_0x5b43c8){while(--_0x5b43c8){_0x5ac3c0['push'](_0x5ac3c0['shift']());}};_0x32588d(++_0x4c7d91);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0xcb91[_0x14a862];return _0x245eb5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x354d14,_0x45b04a){var _0x136988=function(_0x4c4c21){while(--_0x4c4c21){_0x354d14['push'](_0x354d14['shift']());}};_0x136988(++_0x45b04a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0xcb91[_0x27beea];return _0x122645;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a0357df..50fa984 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 _0xded1=['utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x5b77da,_0x261c70){var _0x30daf8=function(_0x416948){while(--_0x416948){_0x5b77da['push'](_0x5b77da['shift']());}};_0x30daf8(++_0x261c70);}(_0xded1,0x160));var _0x1ded=function(_0x434179,_0x21181f){_0x434179=_0x434179-0x0;var _0xac926f=_0xded1[_0x434179];return _0xac926f;};'use strict';var _=require('lodash');var util=require(_0x1ded('0x0'));var logger=require('../../config/logger')(_0x1ded('0x1'));var moment=require(_0x1ded('0x2'));var BPromise=require(_0x1ded('0x3'));var rp=require(_0x1ded('0x4'));var fs=require('fs');var path=require(_0x1ded('0x5'));var rimraf=require(_0x1ded('0x6'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x1ded('0x7')]=function(_0x597d0e,_0x58baeb){return _0x597d0e[_0x1ded('0x8')](_0x1ded('0x9'),attributes,{'tableName':_0x1ded('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ded('0xb'),'collate':_0x1ded('0xc')});}; \ No newline at end of file +var _0xd825=['lodash','util','api','path','rimraf','../../config/environment','./mailApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci'];(function(_0x31953c,_0x3a8ab2){var _0x1b5b88=function(_0x517771){while(--_0x517771){_0x31953c['push'](_0x31953c['shift']());}};_0x1b5b88(++_0x3a8ab2);}(_0xd825,0xb4));var _0x5d82=function(_0x4f4a8d,_0x35fa8b){_0x4f4a8d=_0x4f4a8d-0x0;var _0x5ce49c=_0xd825[_0x4f4a8d];return _0x5ce49c;};'use strict';var _=require(_0x5d82('0x0'));var util=require(_0x5d82('0x1'));var logger=require('../../config/logger')(_0x5d82('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d82('0x3'));var rimraf=require(_0x5d82('0x4'));var config=require(_0x5d82('0x5'));var attributes=require(_0x5d82('0x6'));module[_0x5d82('0x7')]=function(_0x1fdd51,_0x4a39cc){return _0x1fdd51['define']('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d82('0x8'),'collate':_0x5d82('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index a034b0e..7c0c12a 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 _0x749d=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','where','limit','debug','lodash','util','moment'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x749d,0x185));var _0xd749=function(_0x16348e,_0x31a912){_0x16348e=_0x16348e-0x0;var _0x2adfeb=_0x749d[_0x16348e];return _0x2adfeb;};'use strict';var _=require(_0xd749('0x0'));var util=require(_0xd749('0x1'));var moment=require(_0xd749('0x2'));var BPromise=require(_0xd749('0x3'));var rs=require(_0xd749('0x4'));var fs=require('fs');var Redis=require(_0xd749('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd749('0x6'));var logger=require(_0xd749('0x7'))(_0xd749('0x8'));var config=require('../../config/environment');var jayson=require(_0xd749('0x9'));var client=jayson[_0xd749('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2620ab,_0x3dc35b,_0x1d5fd3){return new BPromise(function(_0x1dc3e1,_0x48067e){return client['request'](_0x2620ab,_0x1d5fd3)['then'](function(_0x238c5b){logger[_0xd749('0xb')](_0xd749('0xc'),_0x3dc35b,_0xd749('0xd'));logger['debug'](_0xd749('0xe'),_0x3dc35b,_0xd749('0xd'),JSON[_0xd749('0xf')](_0x238c5b));if(_0x238c5b['error']){if(_0x238c5b[_0xd749('0x10')][_0xd749('0x11')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x3dc35b,_0x238c5b[_0xd749('0x10')][_0xd749('0x12')]);return _0x48067e(_0x238c5b[_0xd749('0x10')][_0xd749('0x12')]);}logger[_0xd749('0x10')](_0xd749('0xc'),_0x3dc35b,_0x238c5b[_0xd749('0x10')][_0xd749('0x12')]);return _0x1dc3e1(_0x238c5b[_0xd749('0x10')][_0xd749('0x12')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x3dc35b,_0xd749('0xd'));_0x1dc3e1(_0x238c5b[_0xd749('0x13')][_0xd749('0x12')]);}})[_0xd749('0x14')](function(_0x7d8897){logger[_0xd749('0x10')]('MailApplication,\x20%s,\x20%s',_0x3dc35b,_0x7d8897);_0x48067e(_0x7d8897);});});}exports[_0xd749('0x15')]=function(_0x3cce09){var _0x5da2e6=this;return new Promise(function(_0x26269b,_0x1ad0a5){return db['MailApplication'][_0xd749('0x16')](_0x3cce09['body'],{'raw':_0x3cce09[_0xd749('0x17')]?_0x3cce09[_0xd749('0x17')][_0xd749('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cce09[_0xd749('0x17')]?_0x3cce09[_0xd749('0x17')][_0xd749('0x19')]||null:null,'attributes':_0x3cce09[_0xd749('0x17')]?_0x3cce09[_0xd749('0x17')]['attributes']||null:null,'limit':_0x3cce09[_0xd749('0x17')]?_0x3cce09[_0xd749('0x17')][_0xd749('0x1a')]||null:null})['then'](function(_0x3bf27a){logger[_0xd749('0xb')]('UpdateMailApplication',_0x3cce09);logger[_0xd749('0x1b')](_0xd749('0x15'),_0x3cce09,JSON[_0xd749('0xf')](_0x3bf27a));_0x26269b(_0x3bf27a);})[_0xd749('0x14')](function(_0x5343b5){logger[_0xd749('0x10')](_0xd749('0x15'),_0x5343b5[_0xd749('0x12')],_0x3cce09);_0x1ad0a5(_0x5da2e6[_0xd749('0x10')](0x1f4,_0x5343b5[_0xd749('0x12')]));});});}; \ No newline at end of file +var _0x0111=['error','message','info','result','catch','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','then','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x0111,0x1ce));var _0x1011=function(_0x2a2137,_0x280212){_0x2a2137=_0x2a2137-0x0;var _0x466f22=_0x0111[_0x2a2137];return _0x466f22;};'use strict';var _=require('lodash');var util=require(_0x1011('0x0'));var moment=require(_0x1011('0x1'));var BPromise=require(_0x1011('0x2'));var rs=require(_0x1011('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1011('0x4'))['db'];var utils=require(_0x1011('0x5'));var logger=require('../../config/logger')(_0x1011('0x6'));var config=require('../../config/environment');var jayson=require(_0x1011('0x7'));var client=jayson[_0x1011('0x8')][_0x1011('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e0cc1,_0x4d6487,_0x44e1b1){return new BPromise(function(_0x47bb6a,_0x431fc3){return client['request'](_0x4e0cc1,_0x44e1b1)['then'](function(_0x23681b){logger['info'](_0x1011('0xa'),_0x4d6487,_0x1011('0xb'));logger['debug'](_0x1011('0xc'),_0x4d6487,_0x1011('0xb'),JSON[_0x1011('0xd')](_0x23681b));if(_0x23681b[_0x1011('0xe')]){if(_0x23681b[_0x1011('0xe')]['code']===0x1f4){logger[_0x1011('0xe')]('MailApplication,\x20%s,\x20%s',_0x4d6487,_0x23681b[_0x1011('0xe')]['message']);return _0x431fc3(_0x23681b['error'][_0x1011('0xf')]);}logger[_0x1011('0xe')](_0x1011('0xa'),_0x4d6487,_0x23681b[_0x1011('0xe')]['message']);return _0x47bb6a(_0x23681b[_0x1011('0xe')][_0x1011('0xf')]);}else{logger[_0x1011('0x10')](_0x1011('0xa'),_0x4d6487,'request\x20sent');_0x47bb6a(_0x23681b[_0x1011('0x11')]['message']);}})[_0x1011('0x12')](function(_0x568d98){logger['error'](_0x1011('0xa'),_0x4d6487,_0x568d98);_0x431fc3(_0x568d98);});});}exports[_0x1011('0x13')]=function(_0x53c81a){var _0x276c0e=this;return new Promise(function(_0x21bb4e,_0x3db612){return db[_0x1011('0x14')]['update'](_0x53c81a[_0x1011('0x15')],{'raw':_0x53c81a[_0x1011('0x16')]?_0x53c81a[_0x1011('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53c81a['options']?_0x53c81a['options'][_0x1011('0x17')]||null:null,'attributes':_0x53c81a[_0x1011('0x16')]?_0x53c81a[_0x1011('0x16')][_0x1011('0x18')]||null:null,'limit':_0x53c81a[_0x1011('0x16')]?_0x53c81a[_0x1011('0x16')][_0x1011('0x19')]||null:null})[_0x1011('0x1a')](function(_0x1e9b06){logger[_0x1011('0x10')](_0x1011('0x13'),_0x53c81a);logger[_0x1011('0x1b')](_0x1011('0x13'),_0x53c81a,JSON[_0x1011('0xd')](_0x1e9b06));_0x21bb4e(_0x1e9b06);})[_0x1011('0x12')](function(_0x6bc253){logger['error']('UpdateMailApplication',_0x6bc253[_0x1011('0xf')],_0x53c81a);_0x3db612(_0x276c0e['error'](0x1f4,_0x6bc253['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 53edbea..601b0f6 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 _0x2ec2=['update','delete','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','tracked'];(function(_0x30b85d,_0x37483b){var _0x1f8c05=function(_0x4e26a6){while(--_0x4e26a6){_0x30b85d['push'](_0x30b85d['shift']());}};_0x1f8c05(++_0x37483b);}(_0x2ec2,0xb4));var _0x22ec=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x2ec2[_0x18b344];return _0x5ef6bb;};'use strict';var express=require(_0x22ec('0x0'));var router=express[_0x22ec('0x1')]();var auth=require(_0x22ec('0x2'));var interaction=require(_0x22ec('0x3'));var controller=require('./mailInteraction.controller');router[_0x22ec('0x4')]('/',auth[_0x22ec('0x5')](),controller[_0x22ec('0x6')]);router['get'](_0x22ec('0x7'),auth[_0x22ec('0x5')](),controller[_0x22ec('0x8')]);router[_0x22ec('0x4')](_0x22ec('0x9'),auth[_0x22ec('0x5')](),controller['show']);router[_0x22ec('0x4')](_0x22ec('0xa'),auth[_0x22ec('0x5')](),controller[_0x22ec('0xb')]);router['get'](_0x22ec('0xc'),auth[_0x22ec('0x5')](),controller[_0x22ec('0xd')]);router[_0x22ec('0xe')]('/',auth[_0x22ec('0x5')](),controller[_0x22ec('0xf')]);router[_0x22ec('0xe')](_0x22ec('0xa'),auth['isAuthenticated'](),controller[_0x22ec('0x10')]);router[_0x22ec('0xe')](_0x22ec('0x11'),auth[_0x22ec('0x5')](),interaction['tracked'](_0x22ec('0x12'),'mailinteraction:addtags'),controller['addTags']);router['put'](_0x22ec('0x9'),auth[_0x22ec('0x5')](),interaction[_0x22ec('0x13')](_0x22ec('0x12'),'mailinteraction:update'),controller[_0x22ec('0x14')]);router[_0x22ec('0x15')](_0x22ec('0x9'),auth[_0x22ec('0x5')](),interaction['tracked']('mail',_0x22ec('0x16')),controller[_0x22ec('0x17')]);router[_0x22ec('0x15')](_0x22ec('0x11'),auth['isAuthenticated'](),controller[_0x22ec('0x18')]);module['exports']=router; \ No newline at end of file +var _0x534d=['exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','mailinteraction:addtags','addTags','put','tracked','mail','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags'];(function(_0x11fd81,_0x1cf891){var _0x47d215=function(_0xe9dd8d){while(--_0xe9dd8d){_0x11fd81['push'](_0x11fd81['shift']());}};_0x47d215(++_0x1cf891);}(_0x534d,0x79));var _0xd534=function(_0x5968f1,_0x1b6a59){_0x5968f1=_0x5968f1-0x0;var _0x180ec6=_0x534d[_0x5968f1];return _0x180ec6;};'use strict';var express=require(_0xd534('0x0'));var router=express[_0xd534('0x1')]();var auth=require(_0xd534('0x2'));var interaction=require(_0xd534('0x3'));var controller=require(_0xd534('0x4'));router[_0xd534('0x5')]('/',auth[_0xd534('0x6')](),controller[_0xd534('0x7')]);router[_0xd534('0x5')](_0xd534('0x8'),auth[_0xd534('0x6')](),controller[_0xd534('0x9')]);router[_0xd534('0x5')](_0xd534('0xa'),auth[_0xd534('0x6')](),controller[_0xd534('0xb')]);router[_0xd534('0x5')](_0xd534('0xc'),auth[_0xd534('0x6')](),controller['getMessages']);router[_0xd534('0x5')](_0xd534('0xd'),auth[_0xd534('0x6')](),controller[_0xd534('0xe')]);router[_0xd534('0xf')]('/',auth['isAuthenticated'](),controller[_0xd534('0x10')]);router[_0xd534('0xf')](_0xd534('0xc'),auth[_0xd534('0x6')](),controller[_0xd534('0x11')]);router[_0xd534('0xf')](_0xd534('0x12'),auth[_0xd534('0x6')](),interaction['tracked']('mail',_0xd534('0x13')),controller[_0xd534('0x14')]);router[_0xd534('0x15')](_0xd534('0xa'),auth[_0xd534('0x6')](),interaction[_0xd534('0x16')](_0xd534('0x17'),_0xd534('0x18')),controller[_0xd534('0x19')]);router[_0xd534('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0xd534('0x16')](_0xd534('0x17'),_0xd534('0x1b')),controller['destroy']);router['delete'](_0xd534('0x12'),auth[_0xd534('0x6')](),controller[_0xd534('0x1c')]);module[_0xd534('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 51172c8..81d4562 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 _0x96f8=['TEXT','long','BOOLEAN','out','ENUM','sequelize','iconv','exports','DATE','STRING'];(function(_0x429ea5,_0x94873d){var _0x374eed=function(_0x568113){while(--_0x568113){_0x429ea5['push'](_0x429ea5['shift']());}};_0x374eed(++_0x94873d);}(_0x96f8,0xcd));var _0x896f=function(_0x455b28,_0x2b28d2){_0x455b28=_0x455b28-0x0;var _0x2bc6e9=_0x96f8[_0x455b28];return _0x2bc6e9;};'use strict';var Sequelize=require(_0x896f('0x0'));var iconv=require(_0x896f('0x1'));module[_0x896f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x896f('0x3')]},'disposition':{'type':Sequelize[_0x896f('0x4')]},'secondDisposition':{'type':Sequelize[_0x896f('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x896f('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x896f('0x5')](_0x896f('0x6'))},'subject':{'type':Sequelize[_0x896f('0x5')]()},'attach':{'type':Sequelize[_0x896f('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x896f('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x896f('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x896f('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x896f('0x9')]('in',_0x896f('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe0ef=['ENUM','out','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xe0ef,0x137));var _0xfe0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0ef[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfe0e('0x0'));var iconv=require(_0xfe0e('0x1'));module[_0xfe0e('0x2')]={'closed':{'type':Sequelize[_0xfe0e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfe0e('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xfe0e('0x5')]},'thirdDisposition':{'type':Sequelize[_0xfe0e('0x5')]},'note':{'type':Sequelize[_0xfe0e('0x5')]},'inReplyTo':{'type':Sequelize[_0xfe0e('0x5')](0x1fe)},'to':{'type':Sequelize[_0xfe0e('0x5')]},'cc':{'type':Sequelize[_0xfe0e('0x6')](_0xfe0e('0x7'))},'subject':{'type':Sequelize[_0xfe0e('0x6')]()},'attach':{'type':Sequelize[_0xfe0e('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xfe0e('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xfe0e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xfe0e('0x8')]('in',_0xfe0e('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfe0e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xfe0e('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfe0e('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfe0e('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2a632de..0b8bf34 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 _0x9914=['MailInteraction','keys','filters','intersection','model','attributes','fields','length','includeAll','include','find','create','body','describe','MailMessage','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','sort','where','pick','MailInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','setTags','spread','color','emit','mailInteractionTags:save','removeTags','unix','toString','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','mkdirSync','from','missing.recipient@your.company.com','format','headers','Bcc','existsSync','readFileSync','build','message%d.eml','download','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','then','end','error','name','send','map','rawAttributes','fieldName','type','key','getOptions','query','user','catch','params'];(function(_0x2b678d,_0x521dd6){var _0xd14d71=function(_0x502f5b){while(--_0x502f5b){_0x2b678d['push'](_0x2b678d['shift']());}};_0xd14d71(++_0x521dd6);}(_0x9914,0xb2));var _0x4991=function(_0x4741aa,_0x521cb5){_0x4741aa=_0x4741aa-0x0;var _0x23d9aa=_0x9914[_0x4741aa];return _0x23d9aa;};'use strict';var emlformat=require(_0x4991('0x0'));var rimraf=require(_0x4991('0x1'));var zipdir=require('zip-dir');var moment=require(_0x4991('0x2'));var BPromise=require(_0x4991('0x3'));var util=require(_0x4991('0x4'));var path=require(_0x4991('0x5'));var fs=require('fs');var _=require(_0x4991('0x6'));var juice=require('juice');var Redis=require(_0x4991('0x7'));var interaction=require(_0x4991('0x8'));var qs=require(_0x4991('0x9'));var logger=require('../../config/logger')(_0x4991('0xa'));var config=require(_0x4991('0xb'));var db=require(_0x4991('0xc'))['db'];var htmlEntities=require(_0x4991('0xd'));config[_0x4991('0xe')]=_[_0x4991('0xf')](config['redis'],{'host':_0x4991('0x10'),'port':0x18eb});var socket=require(_0x4991('0x11'))(new Redis(config['redis']));require(_0x4991('0x12'))['register'](socket);function respondWithStatusCode(_0x330d26,_0x448a61){_0x448a61=_0x448a61||0xcc;return function(_0x1c3ff4){if(_0x1c3ff4){return _0x330d26[_0x4991('0x13')](_0x448a61);}return _0x330d26['status'](_0x448a61)['end']();};}function respondWithResult(_0x44d663,_0x247a74){_0x247a74=_0x247a74||0xc8;return function(_0x9b4a89){if(_0x9b4a89){return _0x44d663[_0x4991('0x14')](_0x247a74)[_0x4991('0x15')](_0x9b4a89);}};}function respondWithFilteredResult(_0x2673e3,_0x1d53c3){return function(_0x277d99){if(_0x277d99){var _0x38b5d0=typeof _0x1d53c3[_0x4991('0x16')]==='undefined'&&typeof _0x1d53c3[_0x4991('0x17')]===_0x4991('0x18');var _0x3d9f9a=_0x277d99[_0x4991('0x19')];var _0x49b514=_0x38b5d0?0x0:_0x1d53c3['offset'];var _0x4ae5f3=_0x38b5d0?_0x277d99[_0x4991('0x19')]:_0x1d53c3[_0x4991('0x16')]+_0x1d53c3[_0x4991('0x17')];var _0x56e5b1;if(_0x4ae5f3>=_0x3d9f9a){_0x4ae5f3=_0x3d9f9a;_0x56e5b1=0xc8;}else{_0x56e5b1=0xce;}_0x2673e3[_0x4991('0x14')](_0x56e5b1);return _0x2673e3[_0x4991('0x1a')](_0x4991('0x1b'),_0x49b514+'-'+_0x4ae5f3+'/'+_0x3d9f9a)[_0x4991('0x15')](_0x277d99);}return null;};}function saveUpdates(_0x428d74){return function(_0x23a28d){if(_0x23a28d){return _0x23a28d[_0x4991('0x1c')](_0x428d74)['then'](function(_0x5c0164){return _0x5c0164;});}return null;};}function removeEntity(_0x25ab39){return function(_0x452eef){if(_0x452eef){return _0x452eef['destroy']()[_0x4991('0x1d')](function(){_0x25ab39[_0x4991('0x14')](0xcc)[_0x4991('0x1e')]();});}};}function handleEntityNotFound(_0x506864){return function(_0x10b221){if(!_0x10b221){_0x506864[_0x4991('0x13')](0x194);}return _0x10b221;};}function handleError(_0x12df49,_0x19c144){_0x19c144=_0x19c144||0x1f4;return function(_0x887b53){logger[_0x4991('0x1f')](_0x887b53['stack']);if(_0x887b53[_0x4991('0x20')]){delete _0x887b53[_0x4991('0x20')];}_0x12df49[_0x4991('0x14')](_0x19c144)[_0x4991('0x21')](_0x887b53);};}exports['index']=function(_0x3848ae,_0x57f4ee){var _0x371282={};var _0x10982f=_[_0x4991('0x22')](db['MailInteraction'][_0x4991('0x23')],function(_0x14bea8){return{'name':_0x14bea8[_0x4991('0x24')],'type':_0x14bea8[_0x4991('0x25')][_0x4991('0x26')]};});_0x371282=qs[_0x4991('0x27')](_0x10982f,_0x3848ae);return interaction['findAll']('mail',_0x3848ae[_0x4991('0x28')],_0x3848ae[_0x4991('0x29')],_0x371282,_0x10982f)[_0x4991('0x1d')](respondWithFilteredResult(_0x57f4ee,_0x371282))[_0x4991('0x2a')](handleError(_0x57f4ee,null));};exports['show']=function(_0xed9fc5,_0x396760){var _0x1e8d88={'raw':![],'where':{'id':_0xed9fc5[_0x4991('0x2b')]['id']}},_0x25af28={};_0x25af28['model']=_['keys'](db[_0x4991('0x2c')]['rawAttributes']);_0x25af28[_0x4991('0x28')]=_[_0x4991('0x2d')](_0xed9fc5[_0x4991('0x28')]);_0x25af28[_0x4991('0x2e')]=_[_0x4991('0x2f')](_0x25af28[_0x4991('0x30')],_0x25af28[_0x4991('0x28')]);_0x1e8d88[_0x4991('0x31')]=_[_0x4991('0x2f')](_0x25af28[_0x4991('0x30')],qs['fields'](_0xed9fc5['query'][_0x4991('0x32')]));_0x1e8d88[_0x4991('0x31')]=_0x1e8d88[_0x4991('0x31')][_0x4991('0x33')]?_0x1e8d88[_0x4991('0x31')]:_0x25af28['model'];if(_0xed9fc5[_0x4991('0x28')][_0x4991('0x34')]){_0x1e8d88[_0x4991('0x35')]=[{'all':!![]}];}_0x1e8d88=_['merge']({},_0x1e8d88,_0xed9fc5['options']);return db[_0x4991('0x2c')][_0x4991('0x36')](_0x1e8d88)[_0x4991('0x1d')](handleEntityNotFound(_0x396760,null))[_0x4991('0x1d')](respondWithResult(_0x396760,null))['catch'](handleError(_0x396760,null));};exports[_0x4991('0x37')]=function(_0x397cfa,_0x497a30){return db['MailInteraction']['create'](_0x397cfa['body'],{})[_0x4991('0x1d')](respondWithResult(_0x497a30,0xc9))['catch'](handleError(_0x497a30,null));};exports[_0x4991('0x1c')]=function(_0x33713f,_0x1dac5a){if(_0x33713f[_0x4991('0x38')]['id']){delete _0x33713f[_0x4991('0x38')]['id'];}return db[_0x4991('0x2c')][_0x4991('0x36')]({'where':{'id':_0x33713f[_0x4991('0x2b')]['id']}})[_0x4991('0x1d')](handleEntityNotFound(_0x1dac5a,null))['then'](saveUpdates(_0x33713f[_0x4991('0x38')],null))['then'](respondWithResult(_0x1dac5a,null))[_0x4991('0x2a')](handleError(_0x1dac5a,null));};exports['destroy']=function(_0x248b80,_0x4bea48){return db[_0x4991('0x2c')][_0x4991('0x36')]({'where':{'id':_0x248b80[_0x4991('0x2b')]['id']}})[_0x4991('0x1d')](handleEntityNotFound(_0x4bea48,null))[_0x4991('0x1d')](removeEntity(_0x4bea48,null))[_0x4991('0x2a')](handleError(_0x4bea48,null));};exports[_0x4991('0x39')]=function(_0x4f3944,_0x2cbbc3){return db[_0x4991('0x2c')]['describe']()[_0x4991('0x1d')](respondWithResult(_0x2cbbc3,null))[_0x4991('0x2a')](handleError(_0x2cbbc3,null));};exports['addMessage']=function(_0xdccd8b,_0x2108af){return db[_0x4991('0x3a')][_0x4991('0x36')]({'where':{'id':_0xdccd8b[_0x4991('0x2b')]['id']}})[_0x4991('0x1d')](handleEntityNotFound(_0x2108af,null))[_0x4991('0x1d')](function(_0x5b76d1){if(_0x5b76d1){return _0x5b76d1[_0x4991('0x3b')](_0xdccd8b[_0x4991('0x38')]['ids'],_[_0x4991('0x3c')](_0xdccd8b[_0x4991('0x38')],[_0x4991('0x3d'),'id'])||{});}})[_0x4991('0x1d')](respondWithResult(_0x2108af,null))[_0x4991('0x2a')](handleError(_0x2108af,null));};exports[_0x4991('0x3e')]=function(_0x4f3793,_0x188e30){var _0x5402b8={'raw':![],'where':{}};var _0x5ccce6={};var _0x25e3f9={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x4f3793[_0x4991('0x2b')]['id']}})[_0x4991('0x1d')](handleEntityNotFound(_0x188e30,null))[_0x4991('0x1d')](function(_0x3c2f5d){if(_0x3c2f5d){_0x5ccce6[_0x4991('0x30')]=_[_0x4991('0x2d')](db[_0x4991('0x3a')][_0x4991('0x23')]);_0x5ccce6['query']=_['keys'](_0x4f3793[_0x4991('0x28')]);_0x5ccce6[_0x4991('0x2e')]=_[_0x4991('0x2f')](_0x5ccce6[_0x4991('0x30')],_0x5ccce6[_0x4991('0x28')]);_0x5402b8['attributes']=_[_0x4991('0x2f')](_0x5ccce6[_0x4991('0x30')],qs[_0x4991('0x32')](_0x4f3793[_0x4991('0x28')]['fields']));_0x5402b8[_0x4991('0x31')]=_0x5402b8['attributes'][_0x4991('0x33')]?_0x5402b8[_0x4991('0x31')]:_0x5ccce6['model'];if(!_0x4f3793[_0x4991('0x28')][_0x4991('0x3f')](_0x4991('0x40'))){_0x5402b8[_0x4991('0x17')]=qs[_0x4991('0x17')](_0x4f3793[_0x4991('0x28')][_0x4991('0x17')]);_0x5402b8[_0x4991('0x16')]=qs['offset'](_0x4f3793[_0x4991('0x28')][_0x4991('0x16')]);}_0x5402b8['order']=qs['sort'](_0x4f3793[_0x4991('0x28')][_0x4991('0x41')]);_0x5402b8[_0x4991('0x42')]=qs[_0x4991('0x2e')](_[_0x4991('0x43')](_0x4f3793['query'],_0x5ccce6['filters']));_0x5402b8['where'][_0x4991('0x44')]=_0x3c2f5d['id'];if(_0x4f3793[_0x4991('0x28')][_0x4991('0x45')]){_0x5402b8[_0x4991('0x42')]=_[_0x4991('0x46')](_0x5402b8[_0x4991('0x42')],{'$or':_[_0x4991('0x22')](_0x5402b8['attributes'],function(_0x64f793){var _0x598297={};_0x598297[_0x64f793]={'$like':'%'+_0x4f3793[_0x4991('0x28')][_0x4991('0x45')]+'%'};return _0x598297;})});}if(_0x4f3793[_0x4991('0x28')]['$gte']){var _0x2a1c0f=_0x4f3793[_0x4991('0x28')][_0x4991('0x47')][_0x4991('0x48')](',');var _0x41bfe2={};_0x41bfe2[_0x2a1c0f[0x0]]={'$gte':moment(_0x2a1c0f[0x1])['format'](_0x4991('0x49'))};_0x5402b8[_0x4991('0x42')]=_[_0x4991('0x46')](_0x5402b8[_0x4991('0x42')],_0x41bfe2);}_0x5402b8=_['merge']({},_0x5402b8,_0x4f3793[_0x4991('0x4a')]);return db['MailMessage']['count']({'where':_0x5402b8[_0x4991('0x42')]})[_0x4991('0x1d')](function(_0x82e3b3){_0x25e3f9['count']=_0x82e3b3;if(_0x4f3793['query'][_0x4991('0x34')]){_0x5402b8['include']=[{'all':!![]}];}return db[_0x4991('0x3a')][_0x4991('0x4b')](_0x5402b8);})['then'](function(_0x335d72){if(_0x4f3793[_0x4991('0x28')][_0x4991('0x4c')]===_0x4991('0x4d')){for(var _0x51fb6e=0x0;_0x51fb6e<_0x335d72['length'];_0x51fb6e++){_0x335d72[_0x51fb6e][_0x4991('0x38')]=juice(_0x335d72[_0x51fb6e][_0x4991('0x38')]);}}_0x25e3f9['rows']=_0x335d72;return _0x25e3f9;});}})[_0x4991('0x1d')](respondWithFilteredResult(_0x188e30,_0x5402b8))[_0x4991('0x2a')](handleError(_0x188e30,null));};exports['addTags']=function(_0x538d4e,_0x1dac24){return db['MailInteraction']['find']({'where':{'id':_0x538d4e[_0x4991('0x2b')]['id']}})[_0x4991('0x1d')](handleEntityNotFound(_0x1dac24,null))[_0x4991('0x1d')](function(_0x37da84){if(_0x37da84){return _0x37da84[_0x4991('0x4e')](_0x538d4e[_0x4991('0x38')][_0x4991('0x3d')],_[_0x4991('0x3c')](_0x538d4e[_0x4991('0x38')],[_0x4991('0x3d'),'id'])||{})[_0x4991('0x4f')](function(){return db['Tag'][_0x4991('0x4b')]({'attributes':['id','name',_0x4991('0x50')],'where':{'id':_0x538d4e[_0x4991('0x38')][_0x4991('0x3d')]}});})[_0x4991('0x1d')](function(_0x110e0c){socket[_0x4991('0x51')](_0x4991('0x52'),{'id':Number(_0x538d4e[_0x4991('0x2b')]['id']),'tags':_0x110e0c||[]});return{'id':Number(_0x538d4e['params']['id']),'tags':_0x110e0c||[]};});}})[_0x4991('0x1d')](respondWithResult(_0x1dac24,null))['catch'](handleError(_0x1dac24,null));};exports[_0x4991('0x53')]=function(_0x116ee8,_0x30580e){return db[_0x4991('0x2c')]['find']({'where':{'id':_0x116ee8['params']['id']}})['then'](handleEntityNotFound(_0x30580e,null))['then'](function(_0x1267a5){if(_0x1267a5){return _0x1267a5[_0x4991('0x53')](_0x116ee8[_0x4991('0x28')]['ids']);}})[_0x4991('0x1d')](respondWithStatusCode(_0x30580e,null))['catch'](handleError(_0x30580e,null));};exports['download']=function(_0x15cf40,_0x57537d){var _0x46b05b=moment()[_0x4991('0x54')]()[_0x4991('0x55')]();var _0xe6a299=path[_0x4991('0x56')](config['root'],_0x4991('0x57'),'files',_0x4991('0x58'));var _0x1c3fc8=path[_0x4991('0x56')](config[_0x4991('0x59')],_0x4991('0x57'),_0x4991('0x5a'),_0x4991('0x5b'));var _0x1f33f3=path[_0x4991('0x56')](_0xe6a299,_0x46b05b);var _0x34cd8a=util['format'](_0x4991('0x5c'),_0x15cf40['params']['id'],_0x46b05b);var _0x124280=path[_0x4991('0x56')](_0xe6a299,_0x34cd8a);var _0x2daa77=[];if(_0x15cf40[_0x4991('0x28')]['attachments']){_0x2daa77['push']({'model':db[_0x4991('0x5d')],'as':_0x4991('0x5e'),'raw':!![]});}var _0x24c753=[{'model':db[_0x4991('0x3a')],'as':_0x4991('0x5f'),'attributes':['id','body','from','to','cc',_0x4991('0x60'),_0x4991('0x61'),_0x4991('0x62')],'where':{'secret':![]},'order':qs[_0x4991('0x41')]('id'),'include':_0x2daa77}];return db[_0x4991('0x2c')][_0x4991('0x36')]({'where':{'id':_0x15cf40['params']['id']},'include':_0x24c753})['then'](handleEntityNotFound(_0x57537d,null))[_0x4991('0x1d')](function(_0x3c185a){if(_0x3c185a&&_0x3c185a['Messages']){var _0x3a042a=_0x3c185a['get']({'plain':!![]});fs[_0x4991('0x63')](_0x1f33f3);return BPromise['each'](_0x3a042a['Messages'],function(_0x37f964,_0xcf733d){var _0x215666={'from':_0x37f964[_0x4991('0x64')],'to':_0x37f964['to']||_0x4991('0x65'),'subject':_0x37f964['subject'],'html':htmlEntities['decode'](_0x37f964[_0x4991('0x38')]),'headers':{'Date':moment(_0x37f964['createdAt'])[_0x4991('0x66')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x37f964['cc']){_0x215666[_0x4991('0x67')]['Cc']=_0x37f964['cc'];}if(_0x37f964[_0x4991('0x60')]){_0x215666['headers'][_0x4991('0x68')]=_0x37f964[_0x4991('0x60')];}return new BPromise(function(_0x31cb9e,_0x24c953){if(_0x37f964[_0x4991('0x5e')]){for(var _0xc70a9b=0x0;_0xc70a9b<_0x37f964[_0x4991('0x5e')]['length'];_0xc70a9b++){var _0x3605f4=_0x37f964['Attachments'][_0xc70a9b];var _0xe4fd7=path[_0x4991('0x56')](_0x1c3fc8,_0x3605f4['basename']);if(fs[_0x4991('0x69')](_0xe4fd7)){_0x215666['attachments']['push']({'name':_0x3605f4[_0x4991('0x20')],'contentType':_0x3605f4[_0x4991('0x25')],'data':fs[_0x4991('0x6a')](_0xe4fd7)});}}}emlformat[_0x4991('0x6b')](_0x215666,function(_0xee558f,_0x2fbc38){if(_0xee558f)return _0x24c953(_0xee558f);fs['writeFileSync'](path[_0x4991('0x56')](_0x1f33f3,util[_0x4991('0x66')](_0x4991('0x6c'),_0xcf733d)),_0x2fbc38);return _0x31cb9e(_0x2fbc38);});});})[_0x4991('0x1d')](function(){return new BPromise(function(_0x6aa4e3,_0x50560c){zipdir(_0x1f33f3,{'saveTo':_0x124280},function(_0x48b9da,_0x37b7a3){if(_0x48b9da)return _0x50560c(_0x48b9da);return _0x6aa4e3(_0x37b7a3);});})[_0x4991('0x1d')](function(){return new BPromise(function(_0x46f66e,_0x43b8ec){rimraf(_0x1f33f3,function(_0x24044c){if(_0x24044c)_0x43b8ec(_0x24044c);return _0x46f66e();});});})[_0x4991('0x1d')](function(){return _0x57537d[_0x4991('0x6d')](_0x124280,_0x34cd8a,function(_0x4ccdbc){if(!_0x4ccdbc)fs[_0x4991('0x6e')](_0x124280);});});});}else{return _0x57537d['sendStatus'](0xc8);}})[_0x4991('0x2a')](handleError(_0x57537d,null));}; \ No newline at end of file +var _0xbc7b=['undefined','limit','offset','set','Content-Range','update','destroy','then','error','name','send','index','map','MailInteraction','rawAttributes','key','getOptions','findAll','mail','query','user','catch','params','model','keys','filters','attributes','intersection','fields','length','merge','options','find','body','describe','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','includeAll','include','MailMessage','inlineCss','true','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','from','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','type','message%d.eml','unlinkSync','rimraf','zip-dir','bluebird','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0xbc7b,0xd0));var _0xbbc7=function(_0x53df79,_0xc2ce38){_0x53df79=_0x53df79-0x0;var _0x4616f9=_0xbc7b[_0x53df79];return _0x4616f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbc7('0x0'));var zipdir=require(_0xbbc7('0x1'));var moment=require('moment');var BPromise=require(_0xbbc7('0x2'));var util=require('util');var path=require(_0xbbc7('0x3'));var fs=require('fs');var _=require('lodash');var juice=require(_0xbbc7('0x4'));var Redis=require(_0xbbc7('0x5'));var interaction=require(_0xbbc7('0x6'));var qs=require(_0xbbc7('0x7'));var logger=require(_0xbbc7('0x8'))(_0xbbc7('0x9'));var config=require(_0xbbc7('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xbbc7('0xb'));config[_0xbbc7('0xc')]=_['defaults'](config[_0xbbc7('0xc')],{'host':_0xbbc7('0xd'),'port':0x18eb});var socket=require(_0xbbc7('0xe'))(new Redis(config[_0xbbc7('0xc')]));require(_0xbbc7('0xf'))['register'](socket);function respondWithStatusCode(_0xbe82e7,_0x1ceb71){_0x1ceb71=_0x1ceb71||0xcc;return function(_0x505219){if(_0x505219){return _0xbe82e7[_0xbbc7('0x10')](_0x1ceb71);}return _0xbe82e7[_0xbbc7('0x11')](_0x1ceb71)[_0xbbc7('0x12')]();};}function respondWithResult(_0x3d22a9,_0x1398c9){_0x1398c9=_0x1398c9||0xc8;return function(_0x417b00){if(_0x417b00){return _0x3d22a9[_0xbbc7('0x11')](_0x1398c9)[_0xbbc7('0x13')](_0x417b00);}};}function respondWithFilteredResult(_0x1808b0,_0x30aa06){return function(_0x39619a){if(_0x39619a){var _0x5e9853=typeof _0x30aa06['offset']===_0xbbc7('0x14')&&typeof _0x30aa06[_0xbbc7('0x15')]===_0xbbc7('0x14');var _0x200615=_0x39619a['count'];var _0x45efc9=_0x5e9853?0x0:_0x30aa06[_0xbbc7('0x16')];var _0x38ac51=_0x5e9853?_0x39619a['count']:_0x30aa06[_0xbbc7('0x16')]+_0x30aa06[_0xbbc7('0x15')];var _0xe08c0;if(_0x38ac51>=_0x200615){_0x38ac51=_0x200615;_0xe08c0=0xc8;}else{_0xe08c0=0xce;}_0x1808b0[_0xbbc7('0x11')](_0xe08c0);return _0x1808b0[_0xbbc7('0x17')](_0xbbc7('0x18'),_0x45efc9+'-'+_0x38ac51+'/'+_0x200615)['json'](_0x39619a);}return null;};}function saveUpdates(_0x581b0c){return function(_0x50eff0){if(_0x50eff0){return _0x50eff0[_0xbbc7('0x19')](_0x581b0c)['then'](function(_0x112919){return _0x112919;});}return null;};}function removeEntity(_0x1d628d){return function(_0x331e33){if(_0x331e33){return _0x331e33[_0xbbc7('0x1a')]()[_0xbbc7('0x1b')](function(){_0x1d628d[_0xbbc7('0x11')](0xcc)[_0xbbc7('0x12')]();});}};}function handleEntityNotFound(_0x39761a){return function(_0x5552a5){if(!_0x5552a5){_0x39761a[_0xbbc7('0x10')](0x194);}return _0x5552a5;};}function handleError(_0xe88aba,_0xca8334){_0xca8334=_0xca8334||0x1f4;return function(_0x108e49){logger[_0xbbc7('0x1c')](_0x108e49['stack']);if(_0x108e49[_0xbbc7('0x1d')]){delete _0x108e49['name'];}_0xe88aba[_0xbbc7('0x11')](_0xca8334)[_0xbbc7('0x1e')](_0x108e49);};}exports[_0xbbc7('0x1f')]=function(_0x186820,_0x4f0cdf){var _0x2c45a3={};var _0x292239=_[_0xbbc7('0x20')](db[_0xbbc7('0x21')][_0xbbc7('0x22')],function(_0x327fac){return{'name':_0x327fac['fieldName'],'type':_0x327fac['type'][_0xbbc7('0x23')]};});_0x2c45a3=qs[_0xbbc7('0x24')](_0x292239,_0x186820);return interaction[_0xbbc7('0x25')](_0xbbc7('0x26'),_0x186820[_0xbbc7('0x27')],_0x186820[_0xbbc7('0x28')],_0x2c45a3,_0x292239)[_0xbbc7('0x1b')](respondWithFilteredResult(_0x4f0cdf,_0x2c45a3))[_0xbbc7('0x29')](handleError(_0x4f0cdf,null));};exports['show']=function(_0x57dc4b,_0x393b78){var _0x5b98d6={'raw':![],'where':{'id':_0x57dc4b[_0xbbc7('0x2a')]['id']}},_0x664352={};_0x664352[_0xbbc7('0x2b')]=_['keys'](db[_0xbbc7('0x21')][_0xbbc7('0x22')]);_0x664352[_0xbbc7('0x27')]=_[_0xbbc7('0x2c')](_0x57dc4b[_0xbbc7('0x27')]);_0x664352[_0xbbc7('0x2d')]=_['intersection'](_0x664352[_0xbbc7('0x2b')],_0x664352[_0xbbc7('0x27')]);_0x5b98d6[_0xbbc7('0x2e')]=_[_0xbbc7('0x2f')](_0x664352[_0xbbc7('0x2b')],qs[_0xbbc7('0x30')](_0x57dc4b['query'][_0xbbc7('0x30')]));_0x5b98d6[_0xbbc7('0x2e')]=_0x5b98d6[_0xbbc7('0x2e')][_0xbbc7('0x31')]?_0x5b98d6['attributes']:_0x664352[_0xbbc7('0x2b')];if(_0x57dc4b[_0xbbc7('0x27')]['includeAll']){_0x5b98d6['include']=[{'all':!![]}];}_0x5b98d6=_[_0xbbc7('0x32')]({},_0x5b98d6,_0x57dc4b[_0xbbc7('0x33')]);return db[_0xbbc7('0x21')][_0xbbc7('0x34')](_0x5b98d6)[_0xbbc7('0x1b')](handleEntityNotFound(_0x393b78,null))[_0xbbc7('0x1b')](respondWithResult(_0x393b78,null))['catch'](handleError(_0x393b78,null));};exports['create']=function(_0xb44090,_0x10832e){return db['MailInteraction']['create'](_0xb44090[_0xbbc7('0x35')],{})[_0xbbc7('0x1b')](respondWithResult(_0x10832e,0xc9))[_0xbbc7('0x29')](handleError(_0x10832e,null));};exports['update']=function(_0x17c0bd,_0x1b81ff){if(_0x17c0bd[_0xbbc7('0x35')]['id']){delete _0x17c0bd[_0xbbc7('0x35')]['id'];}return db[_0xbbc7('0x21')]['find']({'where':{'id':_0x17c0bd[_0xbbc7('0x2a')]['id']}})[_0xbbc7('0x1b')](handleEntityNotFound(_0x1b81ff,null))[_0xbbc7('0x1b')](saveUpdates(_0x17c0bd[_0xbbc7('0x35')],null))['then'](respondWithResult(_0x1b81ff,null))[_0xbbc7('0x29')](handleError(_0x1b81ff,null));};exports[_0xbbc7('0x1a')]=function(_0x4e1212,_0x15c9bc){return db['MailInteraction'][_0xbbc7('0x34')]({'where':{'id':_0x4e1212[_0xbbc7('0x2a')]['id']}})['then'](handleEntityNotFound(_0x15c9bc,null))[_0xbbc7('0x1b')](removeEntity(_0x15c9bc,null))[_0xbbc7('0x29')](handleError(_0x15c9bc,null));};exports[_0xbbc7('0x36')]=function(_0x539710,_0x19fdd4){return db[_0xbbc7('0x21')][_0xbbc7('0x36')]()[_0xbbc7('0x1b')](respondWithResult(_0x19fdd4,null))['catch'](handleError(_0x19fdd4,null));};exports[_0xbbc7('0x37')]=function(_0x506cf4,_0x4aec5a){return db['MailMessage'][_0xbbc7('0x34')]({'where':{'id':_0x506cf4[_0xbbc7('0x2a')]['id']}})[_0xbbc7('0x1b')](handleEntityNotFound(_0x4aec5a,null))[_0xbbc7('0x1b')](function(_0xa8cad8){if(_0xa8cad8){return _0xa8cad8['addMessage'](_0x506cf4[_0xbbc7('0x35')]['ids'],_[_0xbbc7('0x38')](_0x506cf4[_0xbbc7('0x35')],[_0xbbc7('0x39'),'id'])||{});}})[_0xbbc7('0x1b')](respondWithResult(_0x4aec5a,null))[_0xbbc7('0x29')](handleError(_0x4aec5a,null));};exports[_0xbbc7('0x3a')]=function(_0x4559d0,_0x5bb208){var _0x1284ce={'raw':![],'where':{}};var _0x3c5c7e={};var _0x1172d7={'count':0x0,'rows':[]};return db[_0xbbc7('0x21')]['findOne']({'where':{'id':_0x4559d0[_0xbbc7('0x2a')]['id']}})[_0xbbc7('0x1b')](handleEntityNotFound(_0x5bb208,null))['then'](function(_0x2053cb){if(_0x2053cb){_0x3c5c7e[_0xbbc7('0x2b')]=_[_0xbbc7('0x2c')](db['MailMessage']['rawAttributes']);_0x3c5c7e[_0xbbc7('0x27')]=_['keys'](_0x4559d0['query']);_0x3c5c7e[_0xbbc7('0x2d')]=_[_0xbbc7('0x2f')](_0x3c5c7e['model'],_0x3c5c7e[_0xbbc7('0x27')]);_0x1284ce[_0xbbc7('0x2e')]=_[_0xbbc7('0x2f')](_0x3c5c7e[_0xbbc7('0x2b')],qs[_0xbbc7('0x30')](_0x4559d0['query'][_0xbbc7('0x30')]));_0x1284ce[_0xbbc7('0x2e')]=_0x1284ce[_0xbbc7('0x2e')][_0xbbc7('0x31')]?_0x1284ce[_0xbbc7('0x2e')]:_0x3c5c7e[_0xbbc7('0x2b')];if(!_0x4559d0[_0xbbc7('0x27')][_0xbbc7('0x3b')]('nolimit')){_0x1284ce[_0xbbc7('0x15')]=qs[_0xbbc7('0x15')](_0x4559d0[_0xbbc7('0x27')][_0xbbc7('0x15')]);_0x1284ce[_0xbbc7('0x16')]=qs[_0xbbc7('0x16')](_0x4559d0[_0xbbc7('0x27')][_0xbbc7('0x16')]);}_0x1284ce[_0xbbc7('0x3c')]=qs[_0xbbc7('0x3d')](_0x4559d0[_0xbbc7('0x27')]['sort']);_0x1284ce[_0xbbc7('0x3e')]=qs[_0xbbc7('0x2d')](_[_0xbbc7('0x3f')](_0x4559d0[_0xbbc7('0x27')],_0x3c5c7e[_0xbbc7('0x2d')]));_0x1284ce[_0xbbc7('0x3e')][_0xbbc7('0x40')]=_0x2053cb['id'];if(_0x4559d0[_0xbbc7('0x27')][_0xbbc7('0x41')]){_0x1284ce[_0xbbc7('0x3e')]=_[_0xbbc7('0x32')](_0x1284ce['where'],{'$or':_[_0xbbc7('0x20')](_0x1284ce[_0xbbc7('0x2e')],function(_0x1d1231){var _0x464ad5={};_0x464ad5[_0x1d1231]={'$like':'%'+_0x4559d0[_0xbbc7('0x27')]['filter']+'%'};return _0x464ad5;})});}if(_0x4559d0[_0xbbc7('0x27')][_0xbbc7('0x42')]){var _0x31a43b=_0x4559d0['query'][_0xbbc7('0x42')][_0xbbc7('0x43')](',');var _0x3f5057={};_0x3f5057[_0x31a43b[0x0]]={'$gte':moment(_0x31a43b[0x1])['format'](_0xbbc7('0x44'))};_0x1284ce[_0xbbc7('0x3e')]=_[_0xbbc7('0x32')](_0x1284ce[_0xbbc7('0x3e')],_0x3f5057);}_0x1284ce=_[_0xbbc7('0x32')]({},_0x1284ce,_0x4559d0[_0xbbc7('0x33')]);return db['MailMessage'][_0xbbc7('0x45')]({'where':_0x1284ce[_0xbbc7('0x3e')]})[_0xbbc7('0x1b')](function(_0x3846a8){_0x1172d7['count']=_0x3846a8;if(_0x4559d0['query'][_0xbbc7('0x46')]){_0x1284ce[_0xbbc7('0x47')]=[{'all':!![]}];}return db[_0xbbc7('0x48')]['findAll'](_0x1284ce);})[_0xbbc7('0x1b')](function(_0x22375b){if(_0x4559d0[_0xbbc7('0x27')][_0xbbc7('0x49')]===_0xbbc7('0x4a')){for(var _0x5f26a0=0x0;_0x5f26a0<_0x22375b['length'];_0x5f26a0++){_0x22375b[_0x5f26a0][_0xbbc7('0x35')]=juice(_0x22375b[_0x5f26a0][_0xbbc7('0x35')]);}}_0x1172d7[_0xbbc7('0x4b')]=_0x22375b;return _0x1172d7;});}})[_0xbbc7('0x1b')](respondWithFilteredResult(_0x5bb208,_0x1284ce))['catch'](handleError(_0x5bb208,null));};exports['addTags']=function(_0x563c55,_0xd7450){return db[_0xbbc7('0x21')][_0xbbc7('0x34')]({'where':{'id':_0x563c55[_0xbbc7('0x2a')]['id']}})[_0xbbc7('0x1b')](handleEntityNotFound(_0xd7450,null))[_0xbbc7('0x1b')](function(_0x46c0fa){if(_0x46c0fa){return _0x46c0fa[_0xbbc7('0x4c')](_0x563c55[_0xbbc7('0x35')][_0xbbc7('0x39')],_['omit'](_0x563c55[_0xbbc7('0x35')],[_0xbbc7('0x39'),'id'])||{})[_0xbbc7('0x4d')](function(){return db[_0xbbc7('0x4e')]['findAll']({'attributes':['id',_0xbbc7('0x1d'),_0xbbc7('0x4f')],'where':{'id':_0x563c55[_0xbbc7('0x35')][_0xbbc7('0x39')]}});})['then'](function(_0x3355ca){socket[_0xbbc7('0x50')]('mailInteractionTags:save',{'id':Number(_0x563c55[_0xbbc7('0x2a')]['id']),'tags':_0x3355ca||[]});return{'id':Number(_0x563c55[_0xbbc7('0x2a')]['id']),'tags':_0x3355ca||[]};});}})['then'](respondWithResult(_0xd7450,null))[_0xbbc7('0x29')](handleError(_0xd7450,null));};exports[_0xbbc7('0x51')]=function(_0x2c0741,_0x73363e){return db[_0xbbc7('0x21')][_0xbbc7('0x34')]({'where':{'id':_0x2c0741['params']['id']}})[_0xbbc7('0x1b')](handleEntityNotFound(_0x73363e,null))[_0xbbc7('0x1b')](function(_0x1b2f15){if(_0x1b2f15){return _0x1b2f15[_0xbbc7('0x51')](_0x2c0741[_0xbbc7('0x27')][_0xbbc7('0x39')]);}})[_0xbbc7('0x1b')](respondWithStatusCode(_0x73363e,null))[_0xbbc7('0x29')](handleError(_0x73363e,null));};exports[_0xbbc7('0x52')]=function(_0x1c1473,_0x9d5343){var _0x17a2c0=moment()[_0xbbc7('0x53')]()[_0xbbc7('0x54')]();var _0x4415b8=path['join'](config[_0xbbc7('0x55')],_0xbbc7('0x56'),_0xbbc7('0x57'),_0xbbc7('0x58'));var _0x27e0da=path[_0xbbc7('0x59')](config[_0xbbc7('0x55')],_0xbbc7('0x56'),_0xbbc7('0x57'),_0xbbc7('0x5a'));var _0x5f2624=path[_0xbbc7('0x59')](_0x4415b8,_0x17a2c0);var _0x5df1e2=util[_0xbbc7('0x5b')](_0xbbc7('0x5c'),_0x1c1473[_0xbbc7('0x2a')]['id'],_0x17a2c0);var _0x13fe6b=path[_0xbbc7('0x59')](_0x4415b8,_0x5df1e2);var _0x17aeeb=[];if(_0x1c1473[_0xbbc7('0x27')]['attachments']){_0x17aeeb[_0xbbc7('0x5d')]({'model':db[_0xbbc7('0x5e')],'as':_0xbbc7('0x5f'),'raw':!![]});}var _0x1498ac=[{'model':db[_0xbbc7('0x48')],'as':_0xbbc7('0x60'),'attributes':['id','body','from','to','cc',_0xbbc7('0x61'),_0xbbc7('0x62'),_0xbbc7('0x63')],'where':{'secret':![]},'order':qs[_0xbbc7('0x3d')]('id'),'include':_0x17aeeb}];return db[_0xbbc7('0x21')]['find']({'where':{'id':_0x1c1473[_0xbbc7('0x2a')]['id']},'include':_0x1498ac})[_0xbbc7('0x1b')](handleEntityNotFound(_0x9d5343,null))[_0xbbc7('0x1b')](function(_0x5bd2d5){if(_0x5bd2d5&&_0x5bd2d5[_0xbbc7('0x60')]){var _0x5c6d86=_0x5bd2d5[_0xbbc7('0x64')]({'plain':!![]});fs[_0xbbc7('0x65')](_0x5f2624);return BPromise[_0xbbc7('0x66')](_0x5c6d86['Messages'],function(_0x112cde,_0x309f81){var _0x3f3a80={'from':_0x112cde[_0xbbc7('0x67')],'to':_0x112cde['to']||_0xbbc7('0x68'),'subject':_0x112cde[_0xbbc7('0x62')],'html':htmlEntities[_0xbbc7('0x69')](_0x112cde[_0xbbc7('0x35')]),'headers':{'Date':moment(_0x112cde[_0xbbc7('0x63')])[_0xbbc7('0x5b')](_0xbbc7('0x6a'))},'attachments':[]};if(_0x112cde['cc']){_0x3f3a80['headers']['Cc']=_0x112cde['cc'];}if(_0x112cde[_0xbbc7('0x61')]){_0x3f3a80[_0xbbc7('0x6b')][_0xbbc7('0x6c')]=_0x112cde['bcc'];}return new BPromise(function(_0x2fce38,_0x1fd65d){if(_0x112cde[_0xbbc7('0x5f')]){for(var _0x7433d8=0x0;_0x7433d8<_0x112cde[_0xbbc7('0x5f')][_0xbbc7('0x31')];_0x7433d8++){var _0xfafe7f=_0x112cde[_0xbbc7('0x5f')][_0x7433d8];var _0x5ca44c=path['join'](_0x27e0da,_0xfafe7f[_0xbbc7('0x6d')]);if(fs[_0xbbc7('0x6e')](_0x5ca44c)){_0x3f3a80['attachments'][_0xbbc7('0x5d')]({'name':_0xfafe7f['name'],'contentType':_0xfafe7f[_0xbbc7('0x6f')],'data':fs['readFileSync'](_0x5ca44c)});}}}emlformat['build'](_0x3f3a80,function(_0x40b818,_0x30cfcf){if(_0x40b818)return _0x1fd65d(_0x40b818);fs['writeFileSync'](path['join'](_0x5f2624,util[_0xbbc7('0x5b')](_0xbbc7('0x70'),_0x309f81)),_0x30cfcf);return _0x2fce38(_0x30cfcf);});});})[_0xbbc7('0x1b')](function(){return new BPromise(function(_0xad8afd,_0x5db782){zipdir(_0x5f2624,{'saveTo':_0x13fe6b},function(_0x1e385f,_0xb8a5c2){if(_0x1e385f)return _0x5db782(_0x1e385f);return _0xad8afd(_0xb8a5c2);});})[_0xbbc7('0x1b')](function(){return new BPromise(function(_0x32d694,_0x48dda8){rimraf(_0x5f2624,function(_0x4de31c){if(_0x4de31c)_0x48dda8(_0x4de31c);return _0x32d694();});});})[_0xbbc7('0x1b')](function(){return _0x9d5343[_0xbbc7('0x52')](_0x13fe6b,_0x5df1e2,function(_0x78a199){if(!_0x78a199)fs[_0xbbc7('0x71')](_0x13fe6b);});});});}else{return _0x9d5343[_0xbbc7('0x10')](0xc8);}})['catch'](handleError(_0x9d5343,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 67c029c..39e2fd0 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 _0x6d49=['events','../../mysqldb','MailMessage','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x10a6d7,_0x1c6d0c){var _0x179e59=function(_0x1bdb7c){while(--_0x1bdb7c){_0x10a6d7['push'](_0x10a6d7['shift']());}};_0x179e59(++_0x1c6d0c);}(_0x6d49,0x1b0));var _0x96d4=function(_0x193159,_0x18fc4c){_0x193159=_0x193159-0x0;var _0x24bb0e=_0x6d49[_0x193159];return _0x24bb0e;};'use strict';var EventEmitter=require(_0x96d4('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x96d4('0x1'))['db'][_0x96d4('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x96d4('0x3'),'afterDestroy':_0x96d4('0x4')};function emitEvent(_0x42ae06){return function(_0x9bedf2,_0x269209,_0x5339c8){_0x9bedf2['getUsers']({'attributes':['id'],'raw':!![]})[_0x96d4('0x5')](function(_0x244eea){_0x9bedf2[_0x96d4('0x6')](_0x96d4('0x7'),_0x244eea[_0x96d4('0x8')](function(_0x134b1d){return{'id':_0x134b1d['id']};}));return MailMessage[_0x96d4('0x9')]({'where':{'MailInteractionId':_0x9bedf2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x96d4('0x5')](function(_0x467b0c){_0x9bedf2[_0x96d4('0x6')](_0x96d4('0xa'),_0x467b0c[_0x96d4('0xb')]);MailInteractionEvents[_0x96d4('0xc')](_0x42ae06+':'+_0x9bedf2['id'],_0x9bedf2);MailInteractionEvents[_0x96d4('0xc')](_0x42ae06,_0x9bedf2);_0x5339c8(null);})[_0x96d4('0xd')](_0x5339c8(null));};}for(var e in events){if(events[_0x96d4('0xe')](e)){var event=events[e];MailInteraction[_0x96d4('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x18d1=['catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x13b853,_0x409644){var _0xec64c2=function(_0x441774){while(--_0x441774){_0x13b853['push'](_0x13b853['shift']());}};_0xec64c2(++_0x409644);}(_0x18d1,0x18f));var _0x118d=function(_0x7e7985,_0x1e534f){_0x7e7985=_0x7e7985-0x0;var _0x33a480=_0x18d1[_0x7e7985];return _0x33a480;};'use strict';var EventEmitter=require(_0x118d('0x0'));var MailInteraction=require(_0x118d('0x1'))['db'][_0x118d('0x2')];var MailMessage=require(_0x118d('0x1'))['db'][_0x118d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x118d('0x4')](0x0);var events={'afterCreate':_0x118d('0x5'),'afterUpdate':'update','afterDestroy':_0x118d('0x6')};function emitEvent(_0x27e420){return function(_0x3dae0b,_0x45b28c,_0x56fb88){_0x3dae0b[_0x118d('0x7')]({'attributes':['id'],'raw':!![]})[_0x118d('0x8')](function(_0x5b42b8){_0x3dae0b[_0x118d('0x9')](_0x118d('0xa'),_0x5b42b8['map'](function(_0x12d033){return{'id':_0x12d033['id']};}));return MailMessage[_0x118d('0xb')]({'where':{'MailInteractionId':_0x3dae0b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x118d('0x8')](function(_0x1507d2){_0x3dae0b[_0x118d('0x9')](_0x118d('0xc'),_0x1507d2[_0x118d('0xd')]);MailInteractionEvents[_0x118d('0xe')](_0x27e420+':'+_0x3dae0b['id'],_0x3dae0b);MailInteractionEvents[_0x118d('0xe')](_0x27e420,_0x3dae0b);_0x56fb88(null);})[_0x118d('0xf')](_0x56fb88(null));};}for(var e in events){if(events[_0x118d('0x10')](e)){var event=events[e];MailInteraction[_0x118d('0x11')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index d21ccc7..23ae399 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 _0xb20e=['closed','closedAt','format','changed','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x450ad5,_0x43becc){var _0x6a97d3=function(_0x33a51a){while(--_0x33a51a){_0x450ad5['push'](_0x450ad5['shift']());}};_0x6a97d3(++_0x43becc);}(_0xb20e,0x193));var _0xeb20=function(_0x481cdd,_0x10365b){_0x481cdd=_0x481cdd-0x0;var _0x2b70a4=_0xb20e[_0x481cdd];return _0x2b70a4;};'use strict';var _=require(_0xeb20('0x0'));var util=require('util');var logger=require(_0xeb20('0x1'))(_0xeb20('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeb20('0x3'));var fs=require('fs');var path=require(_0xeb20('0x4'));var rimraf=require(_0xeb20('0x5'));var config=require('../../config/environment');var attributes=require(_0xeb20('0x6'));module[_0xeb20('0x7')]=function(_0x4a25be,_0x4bc3a8){return _0x4a25be[_0xeb20('0x8')](_0xeb20('0x9'),attributes,{'tableName':_0xeb20('0xa'),'paranoid':![],'indexes':[{'name':_0xeb20('0xb'),'fields':[_0xeb20('0xc'),'to'],'type':_0xeb20('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3fc874,_0x443f9b,_0x5da617){if(_0x3fc874[_0xeb20('0xe')]){_0x3fc874[_0xeb20('0xf')]=moment()['format'](_0xeb20('0x10'));}if(_0x3fc874[_0xeb20('0x11')]){_0x3fc874[_0xeb20('0x12')]=moment()[_0xeb20('0x13')](_0xeb20('0x10'));}_0x5da617(null,_0x443f9b);},'beforeUpdate':function(_0x2b74cb,_0x3e3762,_0x403454){if(_0x2b74cb[_0xeb20('0x14')](_0xeb20('0xe'))){_0x2b74cb[_0xeb20('0xf')]=_0x2b74cb[_0xeb20('0xe')]?moment()[_0xeb20('0x13')](_0xeb20('0x10')):null;}if(_0x2b74cb['changed']('closed')){_0x2b74cb[_0xeb20('0x12')]=moment()[_0xeb20('0x13')](_0xeb20('0x10'));_0x2b74cb[_0xeb20('0xe')]=null;_0x2b74cb[_0xeb20('0xf')]=null;}_0x403454(null,_0x2b74cb);},'afterUpdate':function(_0x350f5e,_0x356efa,_0xafb139){var _0x504f2c=_0x4a25be[_0xeb20('0x15')];var _0x15af12=_0x350f5e['get']({'plain':!![]});if(_0x15af12[_0xeb20('0x11')]){return _0x504f2c[_0xeb20('0x16')][_0xeb20('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x15af12['id']}})[_0xeb20('0x18')](function(){_0xafb139();})[_0xeb20('0x19')](function(_0xc070f2){_0xafb139(_0xc070f2);});}else{_0xafb139();}}},'charset':_0xeb20('0x1a'),'collate':_0xeb20('0x1b')});}; \ No newline at end of file +var _0x2bfd=['YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','models','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','path','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','FULLTEXT','substatus','substatusAt'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x2bfd,0x151));var _0xd2bf=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x2bfd[_0x4ffa64];return _0x5da001;};'use strict';var _=require(_0xd2bf('0x0'));var util=require(_0xd2bf('0x1'));var logger=require(_0xd2bf('0x2'))(_0xd2bf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2bf('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2bf('0x5'));module[_0xd2bf('0x6')]=function(_0x4ada8b,_0x53ad5b){return _0x4ada8b[_0xd2bf('0x7')](_0xd2bf('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xd2bf('0x9'),'fields':['subject','to'],'type':_0xd2bf('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53e418,_0x301a7d,_0x5a3e9d){if(_0x53e418[_0xd2bf('0xb')]){_0x53e418[_0xd2bf('0xc')]=moment()['format'](_0xd2bf('0xd'));}if(_0x53e418[_0xd2bf('0xe')]){_0x53e418['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5a3e9d(null,_0x301a7d);},'beforeUpdate':function(_0x4c4864,_0x51c043,_0x4c35e5){if(_0x4c4864['changed'](_0xd2bf('0xb'))){_0x4c4864['substatusAt']=_0x4c4864[_0xd2bf('0xb')]?moment()[_0xd2bf('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x4c4864[_0xd2bf('0x10')](_0xd2bf('0xe'))){_0x4c4864[_0xd2bf('0x11')]=moment()[_0xd2bf('0xf')](_0xd2bf('0xd'));_0x4c4864[_0xd2bf('0xb')]=null;_0x4c4864[_0xd2bf('0xc')]=null;}_0x4c35e5(null,_0x4c4864);},'afterUpdate':function(_0x4d7562,_0xd4f7fd,_0x276ee4){var _0x2ff9a2=_0x4ada8b[_0xd2bf('0x12')];var _0x248780=_0x4d7562[_0xd2bf('0x13')]({'plain':!![]});if(_0x248780[_0xd2bf('0xe')]){return _0x2ff9a2[_0xd2bf('0x14')][_0xd2bf('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x248780['id']}})[_0xd2bf('0x16')](function(){_0x276ee4();})[_0xd2bf('0x17')](function(_0x1111b6){_0x276ee4(_0x1111b6);});}else{_0x276ee4();}}},'charset':_0xd2bf('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index cdca20f..b5e44e8 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 _0x17ed=['localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','then','stringify','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis'];(function(_0x24e118,_0x8d841f){var _0x5a149a=function(_0x15ff7a){while(--_0x15ff7a){_0x24e118['push'](_0x24e118['shift']());}};_0x5a149a(++_0x8d841f);}(_0x17ed,0xeb));var _0xd17e=function(_0x477433,_0x2c06b5){_0x477433=_0x477433-0x0;var _0x33191f=_0x17ed[_0x477433];return _0x33191f;};'use strict';var _=require('lodash');var util=require(_0xd17e('0x0'));var moment=require(_0xd17e('0x1'));var BPromise=require(_0xd17e('0x2'));var rs=require(_0xd17e('0x3'));var fs=require('fs');var Redis=require(_0xd17e('0x4'));var db=require(_0xd17e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd17e('0x6'))(_0xd17e('0x7'));var config=require(_0xd17e('0x8'));var jayson=require(_0xd17e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd17e('0xa')]=_['defaults'](config[_0xd17e('0xa')],{'host':_0xd17e('0xb'),'port':0x18eb});var socket=require(_0xd17e('0xc'))(new Redis(config[_0xd17e('0xa')]));require(_0xd17e('0xd'))[_0xd17e('0xe')](socket);function respondWithRpcPromise(_0x4b8813,_0xa89dd8,_0x4b7837){return new BPromise(function(_0x43e49c,_0x155e23){return client[_0xd17e('0xf')](_0x4b8813,_0x4b7837)['then'](function(_0x1447aa){logger[_0xd17e('0x10')]('MailInteraction,\x20%s,\x20%s',_0xa89dd8,_0xd17e('0x11'));logger[_0xd17e('0x12')](_0xd17e('0x13'),_0xa89dd8,'request\x20sent',JSON['stringify'](_0x1447aa));if(_0x1447aa[_0xd17e('0x14')]){if(_0x1447aa['error']['code']===0x1f4){logger['error'](_0xd17e('0x15'),_0xa89dd8,_0x1447aa[_0xd17e('0x14')][_0xd17e('0x16')]);return _0x155e23(_0x1447aa['error'][_0xd17e('0x16')]);}logger[_0xd17e('0x14')](_0xd17e('0x15'),_0xa89dd8,_0x1447aa[_0xd17e('0x14')]['message']);return _0x43e49c(_0x1447aa[_0xd17e('0x14')][_0xd17e('0x16')]);}else{logger[_0xd17e('0x10')]('MailInteraction,\x20%s,\x20%s',_0xa89dd8,_0xd17e('0x11'));_0x43e49c(_0x1447aa[_0xd17e('0x17')][_0xd17e('0x16')]);}})[_0xd17e('0x18')](function(_0x3f3666){logger['error'](_0xd17e('0x15'),_0xa89dd8,_0x3f3666);_0x155e23(_0x3f3666);});});}exports[_0xd17e('0x19')]=function(_0x571eaa){var _0x985eb8=this;return new Promise(function(_0x552a46,_0x24fea2){return db[_0xd17e('0x1a')][_0xd17e('0x1b')](_0x571eaa[_0xd17e('0x1c')],{'raw':_0x571eaa[_0xd17e('0x1d')]?_0x571eaa['options'][_0xd17e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x571eaa[_0xd17e('0x1d')]?_0x571eaa[_0xd17e('0x1d')][_0xd17e('0x1f')]||null:null,'attributes':_0x571eaa[_0xd17e('0x1d')]?_0x571eaa[_0xd17e('0x1d')][_0xd17e('0x20')]||null:null,'limit':_0x571eaa[_0xd17e('0x1d')]?_0x571eaa[_0xd17e('0x1d')]['limit']||null:null})[_0xd17e('0x21')](function(_0xc3897e){logger[_0xd17e('0x10')](_0xd17e('0x19'),_0x571eaa);logger[_0xd17e('0x12')](_0xd17e('0x19'),_0x571eaa,JSON[_0xd17e('0x22')](_0xc3897e));_0x552a46(_0xc3897e);})[_0xd17e('0x18')](function(_0x5c3004){logger['error'](_0xd17e('0x19'),_0x5c3004[_0xd17e('0x16')],_0x571eaa);_0x24fea2(_0x985eb8[_0xd17e('0x14')](0x1f4,_0x5c3004[_0xd17e('0x16')]));});});};exports[_0xd17e('0x23')]=function(_0x412a47){return new Promise(function(_0x26734d,_0x1ebed8){return db['MailInteraction'][_0xd17e('0x24')]({'where':_0x412a47['options']?_0x412a47[_0xd17e('0x1d')]['where']||null:null})[_0xd17e('0x21')](function(_0x1fb181){if(_0x1fb181){return _0x1fb181[_0xd17e('0x25')](_0x412a47[_0xd17e('0x1c')]['ids'],_['omit'](_0x412a47[_0xd17e('0x1c')],[_0xd17e('0x26'),'id'])||{});}})[_0xd17e('0x27')](function(_0x302996){logger['info'](_0xd17e('0x28'),_0x412a47);logger[_0xd17e('0x12')](_0xd17e('0x28'),_0x412a47,JSON[_0xd17e('0x22')](_0x302996));_0x26734d(_0x302996);})[_0xd17e('0x18')](function(_0x1bbccf){logger[_0xd17e('0x14')]('AddTags',_0x1bbccf['message'],_0x412a47);_0x1ebed8(_this[_0xd17e('0x14')](0x1f4,_0x1bbccf[_0xd17e('0x16')]));});});}; \ No newline at end of file +var _0x2f70=['limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where'];(function(_0x13a1ec,_0x5d98e0){var _0x191727=function(_0x1b8465){while(--_0x1b8465){_0x13a1ec['push'](_0x13a1ec['shift']());}};_0x191727(++_0x5d98e0);}(_0x2f70,0xb8));var _0x02f7=function(_0x43709a,_0x47f7a6){_0x43709a=_0x43709a-0x0;var _0xd32611=_0x2f70[_0x43709a];return _0xd32611;};'use strict';var _=require(_0x02f7('0x0'));var util=require(_0x02f7('0x1'));var moment=require(_0x02f7('0x2'));var BPromise=require(_0x02f7('0x3'));var rs=require(_0x02f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02f7('0x5'))['db'];var utils=require(_0x02f7('0x6'));var logger=require(_0x02f7('0x7'))(_0x02f7('0x8'));var config=require(_0x02f7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x02f7('0xa')][_0x02f7('0xb')]({'port':0x232a});config[_0x02f7('0xc')]=_[_0x02f7('0xd')](config[_0x02f7('0xc')],{'host':_0x02f7('0xe'),'port':0x18eb});var socket=require(_0x02f7('0xf'))(new Redis(config[_0x02f7('0xc')]));require(_0x02f7('0x10'))['register'](socket);function respondWithRpcPromise(_0x22916a,_0x1469ae,_0x52f505){return new BPromise(function(_0x112155,_0x131a6f){return client[_0x02f7('0x11')](_0x22916a,_0x52f505)[_0x02f7('0x12')](function(_0x241e1f){logger[_0x02f7('0x13')](_0x02f7('0x14'),_0x1469ae,'request\x20sent');logger[_0x02f7('0x15')](_0x02f7('0x16'),_0x1469ae,_0x02f7('0x17'),JSON[_0x02f7('0x18')](_0x241e1f));if(_0x241e1f[_0x02f7('0x19')]){if(_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1a')]===0x1f4){logger[_0x02f7('0x19')]('MailInteraction,\x20%s,\x20%s',_0x1469ae,_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);return _0x131a6f(_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);}logger[_0x02f7('0x19')](_0x02f7('0x14'),_0x1469ae,_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);return _0x112155(_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);}else{logger[_0x02f7('0x13')]('MailInteraction,\x20%s,\x20%s',_0x1469ae,'request\x20sent');_0x112155(_0x241e1f[_0x02f7('0x1c')][_0x02f7('0x1b')]);}})[_0x02f7('0x1d')](function(_0x1034a8){logger[_0x02f7('0x19')](_0x02f7('0x14'),_0x1469ae,_0x1034a8);_0x131a6f(_0x1034a8);});});}exports[_0x02f7('0x1e')]=function(_0x53e26d){var _0xd2505f=this;return new Promise(function(_0x3dd659,_0x28d92e){return db[_0x02f7('0x1f')]['update'](_0x53e26d[_0x02f7('0x20')],{'raw':_0x53e26d[_0x02f7('0x21')]?_0x53e26d[_0x02f7('0x21')][_0x02f7('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53e26d[_0x02f7('0x21')]?_0x53e26d[_0x02f7('0x21')][_0x02f7('0x23')]||null:null,'attributes':_0x53e26d[_0x02f7('0x21')]?_0x53e26d['options']['attributes']||null:null,'limit':_0x53e26d['options']?_0x53e26d[_0x02f7('0x21')][_0x02f7('0x24')]||null:null})[_0x02f7('0x12')](function(_0x511ad9){logger[_0x02f7('0x13')](_0x02f7('0x1e'),_0x53e26d);logger[_0x02f7('0x15')]('UpdateMailInteraction',_0x53e26d,JSON['stringify'](_0x511ad9));_0x3dd659(_0x511ad9);})['catch'](function(_0x514680){logger[_0x02f7('0x19')]('UpdateMailInteraction',_0x514680[_0x02f7('0x1b')],_0x53e26d);_0x28d92e(_0xd2505f[_0x02f7('0x19')](0x1f4,_0x514680[_0x02f7('0x1b')]));});});};exports[_0x02f7('0x25')]=function(_0x18517f){return new Promise(function(_0x12dc30,_0x2da29e){return db[_0x02f7('0x1f')][_0x02f7('0x26')]({'where':_0x18517f[_0x02f7('0x21')]?_0x18517f[_0x02f7('0x21')]['where']||null:null})[_0x02f7('0x12')](function(_0x375bb5){if(_0x375bb5){return _0x375bb5[_0x02f7('0x27')](_0x18517f[_0x02f7('0x20')][_0x02f7('0x28')],_[_0x02f7('0x29')](_0x18517f['body'],[_0x02f7('0x28'),'id'])||{});}})[_0x02f7('0x2a')](function(_0x1c6409){logger[_0x02f7('0x13')](_0x02f7('0x2b'),_0x18517f);logger[_0x02f7('0x15')](_0x02f7('0x2b'),_0x18517f,JSON[_0x02f7('0x18')](_0x1c6409));_0x12dc30(_0x1c6409);})[_0x02f7('0x1d')](function(_0x2d9192){logger[_0x02f7('0x19')]('AddTags',_0x2d9192[_0x02f7('0x1b')],_0x18517f);_0x2da29e(_this['error'](0x1f4,_0x2d9192[_0x02f7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 3cba288..8303fcc 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 _0x7a9e=['register','length','remove','update','emit','removeListener'];(function(_0x855981,_0x408ef4){var _0x3bcf44=function(_0x158b1d){while(--_0x158b1d){_0x855981['push'](_0x855981['shift']());}};_0x3bcf44(++_0x408ef4);}(_0x7a9e,0x7a));var _0xe7a9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7a9e[_0x57b54c];return _0x59cc19;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xe7a9('0x0'),_0xe7a9('0x1')];function createListener(_0x5aa819,_0x335c7e){return function(_0x580ba7){_0x335c7e[_0xe7a9('0x2')](_0x5aa819,_0x580ba7);};}function removeListener(_0x135a4a,_0x29bffd){return function(){MailInteractionEvents[_0xe7a9('0x3')](_0x135a4a,_0x29bffd);};}exports[_0xe7a9('0x4')]=function(_0x14376a){for(var _0x4e5240=0x0,_0x449a04=events[_0xe7a9('0x5')];_0x4e5240<_0x449a04;_0x4e5240++){var _0x1355bf=events[_0x4e5240];var _0x374491=createListener('mailInteraction:'+_0x1355bf,_0x14376a);MailInteractionEvents['on'](_0x1355bf,_0x374491);}}; \ No newline at end of file +var _0xfbc8=['removeListener','register','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0xc7301f,_0x5cb8ef){var _0x5f1b18=function(_0x460409){while(--_0x460409){_0xc7301f['push'](_0xc7301f['shift']());}};_0x5f1b18(++_0x5cb8ef);}(_0xfbc8,0x143));var _0x8fbc=function(_0x55c3d9,_0x3bf75c){_0x55c3d9=_0x55c3d9-0x0;var _0x19fd97=_0xfbc8[_0x55c3d9];return _0x19fd97;};'use strict';var MailInteractionEvents=require(_0x8fbc('0x0'));var events=[_0x8fbc('0x1'),_0x8fbc('0x2'),_0x8fbc('0x3')];function createListener(_0x5d0678,_0x5663b8){return function(_0x30b12d){_0x5663b8[_0x8fbc('0x4')](_0x5d0678,_0x30b12d);};}function removeListener(_0x5802a7,_0x3f20b9){return function(){MailInteractionEvents[_0x8fbc('0x5')](_0x5802a7,_0x3f20b9);};}exports[_0x8fbc('0x6')]=function(_0x229096){for(var _0x4cde38=0x0,_0x3b36aa=events['length'];_0x4cde38<_0x3b36aa;_0x4cde38++){var _0xe3a469=events[_0x4cde38];var _0x12252b=createListener(_0x8fbc('0x7')+_0xe3a469,_0x229096);MailInteractionEvents['on'](_0xe3a469,_0x12252b);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 9a3c4cf..dc0ed3c 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a87=['isAuthenticated','describe','express','./mailInteractionHasTag.controller','/describe'];(function(_0x3d9f4b,_0x3ea5f7){var _0x5a26e6=function(_0x4c7f40){while(--_0x4c7f40){_0x3d9f4b['push'](_0x3d9f4b['shift']());}};_0x5a26e6(++_0x3ea5f7);}(_0x8a87,0x6b));var _0x78a8=function(_0x47c53e,_0x35f7f3){_0x47c53e=_0x47c53e-0x0;var _0x306afd=_0x8a87[_0x47c53e];return _0x306afd;};'use strict';var express=require(_0x78a8('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x78a8('0x1'));router['get'](_0x78a8('0x2'),auth[_0x78a8('0x3')](),controller[_0x78a8('0x4')]);module['exports']=router; \ No newline at end of file +var _0x6075=['exports','Router','../../components/auth/service','./mailInteractionHasTag.controller','get','/describe','isAuthenticated','describe'];(function(_0x587504,_0x3a83b3){var _0x9952d=function(_0x486dba){while(--_0x486dba){_0x587504['push'](_0x587504['shift']());}};_0x9952d(++_0x3a83b3);}(_0x6075,0x191));var _0x5607=function(_0x750c70,_0x465885){_0x750c70=_0x750c70-0x0;var _0x1cfcb6=_0x6075[_0x750c70];return _0x1cfcb6;};'use strict';var express=require('express');var router=express[_0x5607('0x0')]();var auth=require(_0x5607('0x1'));var controller=require(_0x5607('0x2'));router[_0x5607('0x3')](_0x5607('0x4'),auth[_0x5607('0x5')](),controller[_0x5607('0x6')]);module[_0x5607('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index ee5496e..4d8f411 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x193675,_0x38eb2b){var _0x3e7761=function(_0x4ff923){while(--_0x4ff923){_0x193675['push'](_0x193675['shift']());}};_0x3e7761(++_0x38eb2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x472e45,_0x4ae08a){var _0x5ee4ec=function(_0x336910){while(--_0x336910){_0x472e45['push'](_0x472e45['shift']());}};_0x5ee4ec(++_0x4ae08a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 1f6b5ec..fc32dfb 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0147=['sequelize','INTEGER'];(function(_0x479800,_0xeb9990){var _0x357c80=function(_0x41830d){while(--_0x41830d){_0x479800['push'](_0x479800['shift']());}};_0x357c80(++_0xeb9990);}(_0x0147,0xe6));var _0x7014=function(_0x30bdd9,_0x2167d5){_0x30bdd9=_0x30bdd9-0x0;var _0x274549=_0x0147[_0x30bdd9];return _0x274549;};'use strict';var Sequelize=require(_0x7014('0x0'));module['exports']={'MailInteractionId':{'type':Sequelize[_0x7014('0x1')],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file +var _0xfffe=['sequelize','INTEGER'];(function(_0x5c76d3,_0x59931b){var _0x4761f2=function(_0x32c072){while(--_0x32c072){_0x5c76d3['push'](_0x5c76d3['shift']());}};_0x4761f2(++_0x59931b);}(_0xfffe,0xfa));var _0xefff=function(_0x277201,_0x17569c){_0x277201=_0x277201-0x0;var _0x1768c7=_0xfffe[_0x277201];return _0x1768c7;};'use strict';var Sequelize=require(_0xefff('0x0'));module['exports']={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xefff('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 28b9ccb..cf0d94c 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3072=['mail_interaction_has_tags','define'];(function(_0x70cb42,_0x1ded0a){var _0x47b99d=function(_0x3248b0){while(--_0x3248b0){_0x70cb42['push'](_0x70cb42['shift']());}};_0x47b99d(++_0x1ded0a);}(_0x3072,0xd1));var _0x2307=function(_0x3a9b38,_0x1a2480){_0x3a9b38=_0x3a9b38-0x0;var _0x2a3269=_0x3072[_0x3a9b38];return _0x2a3269;};'use strict';var attributes=require('./mailInteractionHasTag');module['exports']=function(_0x3ffdca){return _0x3ffdca[_0x2307('0x0')]('MailInteractionHasTag',attributes,{'tableName':_0x2307('0x1'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea38=['define'];(function(_0x5f09ad,_0x2d16bf){var _0x158a86=function(_0x3b214f){while(--_0x3b214f){_0x5f09ad['push'](_0x5f09ad['shift']());}};_0x158a86(++_0x2d16bf);}(_0xea38,0x199));var _0x8ea3=function(_0x45fa48,_0x82cc2f){_0x45fa48=_0x45fa48-0x0;var _0x9a43f6=_0xea38[_0x45fa48];return _0x9a43f6;};'use strict';var attributes=require('./mailInteractionHasTag');module['exports']=function(_0x4d0bae){return _0x4d0bae[_0x8ea3('0x0')]('MailInteractionHasTag',attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0f1170d..2eea7ac 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 _0x1752=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x236007,_0x3f90c0){var _0x5e34cb=function(_0x34799e){while(--_0x34799e){_0x236007['push'](_0x236007['shift']());}};_0x5e34cb(++_0x3f90c0);}(_0x1752,0xa5));var _0x2175=function(_0x3bee11,_0x3f2d0a){_0x3bee11=_0x3bee11-0x0;var _0x3b67b=_0x1752[_0x3bee11];return _0x3b67b;};'use strict';var multer=require('multer');var util=require(_0x2175('0x0'));var path=require(_0x2175('0x1'));var timeout=require(_0x2175('0x2'));var express=require(_0x2175('0x3'));var router=express[_0x2175('0x4')]();var fs_extra=require(_0x2175('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2175('0x6'));var config=require(_0x2175('0x7'));var controller=require(_0x2175('0x8'));router[_0x2175('0x9')]('/',auth[_0x2175('0xa')](),controller[_0x2175('0xb')]);router[_0x2175('0x9')](_0x2175('0xc'),auth[_0x2175('0xa')](),controller[_0x2175('0xd')]);router['get'](_0x2175('0xe'),auth[_0x2175('0xa')](),controller[_0x2175('0xf')]);router[_0x2175('0x9')](_0x2175('0x10'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x2175('0xa')](),interaction['tracked']('mail','mailmessage:create'),controller['create']);router[_0x2175('0x11')]('/:id',auth[_0x2175('0xa')](),controller[_0x2175('0x12')]);router['put'](_0x2175('0x13'),auth[_0x2175('0xa')](),controller[_0x2175('0x14')]);router[_0x2175('0x11')](_0x2175('0x15'),auth[_0x2175('0xa')](),controller[_0x2175('0x16')]);router[_0x2175('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x2175('0x18')]);module[_0x2175('0x19')]=router; \ No newline at end of file +var _0xeebe=['show','download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x39879d,_0x5eb23a){var _0x49ac79=function(_0x14c5ab){while(--_0x14c5ab){_0x39879d['push'](_0x39879d['shift']());}};_0x49ac79(++_0x5eb23a);}(_0xeebe,0xff));var _0xeeeb=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xeebe[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0xeeeb('0x0'));var util=require('util');var path=require(_0xeeeb('0x1'));var timeout=require('connect-timeout');var express=require(_0xeeeb('0x2'));var router=express[_0xeeeb('0x3')]();var fs_extra=require(_0xeeeb('0x4'));var auth=require(_0xeeeb('0x5'));var interaction=require(_0xeeeb('0x6'));var config=require(_0xeeeb('0x7'));var controller=require(_0xeeeb('0x8'));router[_0xeeeb('0x9')]('/',auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xb')]);router[_0xeeeb('0x9')](_0xeeeb('0xc'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xd')]);router[_0xeeeb('0x9')](_0xeeeb('0xe'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xf')]);router['get']('/:id/download',auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x10')]);router[_0xeeeb('0x11')]('/',auth['isAuthenticated'](),interaction[_0xeeeb('0x12')](_0xeeeb('0x13'),_0xeeeb('0x14')),controller['create']);router[_0xeeeb('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xeeeb('0x16')]);router[_0xeeeb('0x15')](_0xeeeb('0x17'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x18')]);router[_0xeeeb('0x15')](_0xeeeb('0x19'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x1a')]);router[_0xeeeb('0x1b')](_0xeeeb('0xe'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x1c')]);module[_0xeeeb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 36e4fae..6295c40 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 _0x3273=['TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','sequelize','lodash','exports'];(function(_0x2bd6d9,_0x2071cb){var _0x4b4929=function(_0x41a57b){while(--_0x41a57b){_0x2bd6d9['push'](_0x2bd6d9['shift']());}};_0x4b4929(++_0x2071cb);}(_0x3273,0xf9));var _0x3327=function(_0x5dfd65,_0x1ad889){_0x5dfd65=_0x5dfd65-0x0;var _0x47f853=_0x3273[_0x5dfd65];return _0x47f853;};'use strict';var Sequelize=require(_0x3327('0x0'));var _=require(_0x3327('0x1'));module[_0x3327('0x2')]={'body':{'type':Sequelize[_0x3327('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x3327('0x3')](_0x3327('0x4'))},'read':{'type':Sequelize[_0x3327('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3327('0x6')]('in',_0x3327('0x7')),'defaultValue':_0x3327('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3327('0x8')](0x1fe)},'from':{'type':Sequelize[_0x3327('0x8')]},'to':{'type':Sequelize[_0x3327('0x3')]('long')},'cc':{'type':Sequelize[_0x3327('0x3')](_0x3327('0x9'))},'bcc':{'type':Sequelize['TEXT'](_0x3327('0x9'))},'subject':{'type':Sequelize[_0x3327('0x3')]},'sentAt':{'type':Sequelize[_0x3327('0xa')]},'attach':{'type':Sequelize[_0x3327('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3327('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3327('0xa')]},'originTo':{'type':Sequelize[_0x3327('0x3')](_0x3327('0x9'))},'originCc':{'type':Sequelize[_0x3327('0x3')](_0x3327('0x9'))},'originChannel':{'type':Sequelize[_0x3327('0x6')]('Email','Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xd950=['out','STRING','INTEGER','DATE','Chat','Email','sequelize','lodash','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x1c9ce8,_0x5f4a9f){var _0x265023=function(_0x52b54d){while(--_0x52b54d){_0x1c9ce8['push'](_0x1c9ce8['shift']());}};_0x265023(++_0x5f4a9f);}(_0xd950,0x17f));var _0x0d95=function(_0xab59cf,_0xdf6abc){_0xab59cf=_0xab59cf-0x0;var _0x68ddbf=_0xd950[_0xab59cf];return _0x68ddbf;};'use strict';var Sequelize=require(_0x0d95('0x0'));var _=require(_0x0d95('0x1'));module['exports']={'body':{'type':Sequelize[_0x0d95('0x2')](_0x0d95('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0d95('0x2')](_0x0d95('0x4'))},'read':{'type':Sequelize[_0x0d95('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0d95('0x6')]('in',_0x0d95('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x0d95('0x8')](0x1fe)},'from':{'type':Sequelize[_0x0d95('0x8')]},'to':{'type':Sequelize[_0x0d95('0x2')](_0x0d95('0x3'))},'cc':{'type':Sequelize['TEXT'](_0x0d95('0x3'))},'bcc':{'type':Sequelize[_0x0d95('0x2')]('long')},'subject':{'type':Sequelize[_0x0d95('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x0d95('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0d95('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0d95('0xa')]},'originTo':{'type':Sequelize[_0x0d95('0x2')]('long')},'originCc':{'type':Sequelize[_0x0d95('0x2')](_0x0d95('0x3'))},'originChannel':{'type':Sequelize[_0x0d95('0x6')]('Email',_0x0d95('0xb')),'defaultValue':_0x0d95('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 aabdf2d..72e2cfb 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 _0x47fa=['acceptmessage','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','Sequelize','QueryTypes','contact','reject','EventManager','rejectmessage','download','unix','toString','files','tmp','root','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','push','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','undefined','limit','count','offset','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','length','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','Contacts','defaults','List\x20not\x20found','SendMail','sendMail','messageId','accept','read','format','UserId','user','agent','get','MailInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0x47fa,0xba));var _0xa47f=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x47fa[_0x59616b];return _0x5c4523;};'use strict';var emlformat=require(_0xa47f('0x0'));var moment=require(_0xa47f('0x1'));var BPromise=require(_0xa47f('0x2'));var util=require(_0xa47f('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xa47f('0x4'));var htmlToText=require(_0xa47f('0x5'));var qs=require(_0xa47f('0x6'));var logger=require(_0xa47f('0x7'))(_0xa47f('0x8'));var interaction_log=require('../../config/logger')(_0xa47f('0x9'));var config=require('../../config/environment');var db=require(_0xa47f('0xa'))['db'];config['redis']=_['defaults'](config[_0xa47f('0xb')],{'host':_0xa47f('0xc'),'port':0x18eb});var socket=require(_0xa47f('0xd'))(new Redis(config[_0xa47f('0xb')]));var htmlEntities=require(_0xa47f('0xe'));require('./mailMessage.socket')[_0xa47f('0xf')](socket);var jayson=require(_0xa47f('0x10'));var client=jayson['client'][_0xa47f('0x11')]({'port':0x232c});var client9003=jayson['client'][_0xa47f('0x11')]({'port':0x232b});var client9002=jayson[_0xa47f('0x12')][_0xa47f('0x11')]({'port':0x232a});function respondWithRpcPromise(_0xe6dff5,_0x5dfc3c,_0xf98780,_0x26fdd1){return new BPromise(function(_0x3bc2d5,_0x57c128){var _0x2da381=_0x26fdd1||client;return _0x2da381[_0xa47f('0x13')](_0xe6dff5,_0xf98780)[_0xa47f('0x14')](function(_0x341bf6){logger[_0xa47f('0x15')](_0xa47f('0x16'),_0x5dfc3c,_0xa47f('0x17'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x5dfc3c,_0xa47f('0x17'),JSON[_0xa47f('0x18')](_0x341bf6));if(_0x341bf6[_0xa47f('0x19')]){if(_0x341bf6[_0xa47f('0x19')][_0xa47f('0x1a')]===0x1f4){logger[_0xa47f('0x19')](_0xa47f('0x16'),_0x5dfc3c,_0x341bf6['error'][_0xa47f('0x1b')]);return _0x57c128(_0x341bf6[_0xa47f('0x19')][_0xa47f('0x1b')]);}logger[_0xa47f('0x19')](_0xa47f('0x16'),_0x5dfc3c,_0x341bf6[_0xa47f('0x19')][_0xa47f('0x1b')]);return _0x3bc2d5(_0x341bf6[_0xa47f('0x19')]['message']);}else{logger['info'](_0xa47f('0x16'),_0x5dfc3c,_0xa47f('0x17'));_0x3bc2d5(_0x341bf6[_0xa47f('0x1c')][_0xa47f('0x1b')]);}})[_0xa47f('0x1d')](function(_0x232037){logger[_0xa47f('0x19')]('MailMessage,\x20%s,\x20%s',_0x5dfc3c,_0x232037);_0x57c128(_0x232037);});});}function respondWithResult(_0x4e5b1e,_0x4026cf){_0x4026cf=_0x4026cf||0xc8;return function(_0x4923d5){if(_0x4923d5){return _0x4e5b1e[_0xa47f('0x1e')](_0x4026cf)['json'](_0x4923d5);}};}function respondWithFilteredResult(_0x284b8c,_0x1351d8){return function(_0x459531){if(_0x459531){var _0xf5285d=typeof _0x1351d8['offset']===_0xa47f('0x1f')&&typeof _0x1351d8[_0xa47f('0x20')]==='undefined';var _0x26cf89=_0x459531[_0xa47f('0x21')];var _0x439fec=_0xf5285d?0x0:_0x1351d8[_0xa47f('0x22')];var _0x3d93c4=_0xf5285d?_0x459531[_0xa47f('0x21')]:_0x1351d8[_0xa47f('0x22')]+_0x1351d8[_0xa47f('0x20')];var _0x4943f1;if(_0x3d93c4>=_0x26cf89){_0x3d93c4=_0x26cf89;_0x4943f1=0xc8;}else{_0x4943f1=0xce;}_0x284b8c[_0xa47f('0x1e')](_0x4943f1);return _0x284b8c['set']('Content-Range',_0x439fec+'-'+_0x3d93c4+'/'+_0x26cf89)['json'](_0x459531);}return null;};}function saveUpdates(_0x3720c2){return function(_0x1d951b){if(_0x1d951b){return _0x1d951b[_0xa47f('0x23')](_0x3720c2)[_0xa47f('0x14')](function(_0x402c30){return _0x402c30;});}return null;};}function removeEntity(_0x1e5912){return function(_0x1499f1){if(_0x1499f1){return _0x1499f1[_0xa47f('0x24')]()[_0xa47f('0x14')](function(){_0x1e5912['status'](0xcc)[_0xa47f('0x25')]();});}};}function handleEntityNotFound(_0x1d37c4){return function(_0x59e8cb){if(!_0x59e8cb){_0x1d37c4[_0xa47f('0x26')](0x194);}return _0x59e8cb;};}function handleError(_0x55d909,_0xc854f){_0xc854f=_0xc854f||0x1f4;return function(_0x3d38ff){logger[_0xa47f('0x19')](_0x3d38ff[_0xa47f('0x27')]);if(_0x3d38ff[_0xa47f('0x28')]){delete _0x3d38ff[_0xa47f('0x28')];}_0x55d909[_0xa47f('0x1e')](_0xc854f)[_0xa47f('0x29')](_0x3d38ff);};}exports[_0xa47f('0x2a')]=function(_0x2ee442,_0x595c5d){var _0x57eeaf={},_0x3c772d={},_0x24d723={'count':0x0,'rows':[]};var _0x27de41=_[_0xa47f('0x2b')](db[_0xa47f('0x2c')]['rawAttributes'],function(_0x438ae3){return{'name':_0x438ae3[_0xa47f('0x2d')],'type':_0x438ae3[_0xa47f('0x2e')]['key']};});_0x3c772d[_0xa47f('0x2f')]=_['map'](_0x27de41,_0xa47f('0x28'));_0x3c772d['query']=_[_0xa47f('0x30')](_0x2ee442['query']);_0x3c772d[_0xa47f('0x31')]=_[_0xa47f('0x32')](_0x3c772d[_0xa47f('0x2f')],_0x3c772d[_0xa47f('0x33')]);_0x57eeaf[_0xa47f('0x34')]=_[_0xa47f('0x32')](_0x3c772d['model'],qs[_0xa47f('0x35')](_0x2ee442[_0xa47f('0x33')]['fields']));_0x57eeaf[_0xa47f('0x34')]=_0x57eeaf[_0xa47f('0x34')]['length']?_0x57eeaf[_0xa47f('0x34')]:_0x3c772d[_0xa47f('0x2f')];if(!_0x2ee442[_0xa47f('0x33')][_0xa47f('0x36')]('nolimit')){_0x57eeaf[_0xa47f('0x20')]=qs['limit'](_0x2ee442[_0xa47f('0x33')]['limit']);_0x57eeaf[_0xa47f('0x22')]=qs['offset'](_0x2ee442['query'][_0xa47f('0x22')]);}_0x57eeaf[_0xa47f('0x37')]=qs[_0xa47f('0x38')](_0x2ee442[_0xa47f('0x33')]['sort']);_0x57eeaf[_0xa47f('0x39')]=qs['filters'](_['pick'](_0x2ee442[_0xa47f('0x33')],_0x3c772d['filters']),_0x27de41);if(_0x2ee442[_0xa47f('0x33')][_0xa47f('0x3a')]){_0x57eeaf['where']=_[_0xa47f('0x3b')](_0x57eeaf[_0xa47f('0x39')],{'$or':_[_0xa47f('0x2b')](_0x27de41,function(_0x3baaa8){if(_0x3baaa8[_0xa47f('0x2e')]!==_0xa47f('0x3c')){var _0x411995={};_0x411995[_0x3baaa8[_0xa47f('0x28')]]={'$like':'%'+_0x2ee442[_0xa47f('0x33')][_0xa47f('0x3a')]+'%'};return _0x411995;}})});}_0x57eeaf=_[_0xa47f('0x3b')]({},_0x57eeaf,_0x2ee442[_0xa47f('0x3d')]);var _0x22dc6a={'where':_0x57eeaf['where']};return db['MailMessage'][_0xa47f('0x21')](_0x22dc6a)[_0xa47f('0x14')](function(_0x39d57e){_0x24d723[_0xa47f('0x21')]=_0x39d57e;if(_0x2ee442[_0xa47f('0x33')][_0xa47f('0x3e')]){_0x57eeaf[_0xa47f('0x3f')]=[{'all':!![]}];}return db[_0xa47f('0x2c')]['findAll'](_0x57eeaf);})[_0xa47f('0x14')](function(_0x4380f4){_0x24d723[_0xa47f('0x40')]=_0x4380f4;return _0x24d723;})['then'](respondWithFilteredResult(_0x595c5d,_0x57eeaf))['catch'](handleError(_0x595c5d,null));};exports['show']=function(_0x1998e0,_0x4c034b){var _0xea86ac={'raw':!![],'where':{'id':_0x1998e0[_0xa47f('0x41')]['id']}},_0x45c49b={};_0x45c49b[_0xa47f('0x2f')]=_['keys'](db[_0xa47f('0x2c')][_0xa47f('0x42')]);_0x45c49b[_0xa47f('0x33')]=_[_0xa47f('0x30')](_0x1998e0['query']);_0x45c49b[_0xa47f('0x31')]=_['intersection'](_0x45c49b[_0xa47f('0x2f')],_0x45c49b[_0xa47f('0x33')]);_0xea86ac[_0xa47f('0x34')]=_[_0xa47f('0x32')](_0x45c49b[_0xa47f('0x2f')],qs[_0xa47f('0x35')](_0x1998e0[_0xa47f('0x33')][_0xa47f('0x35')]));_0xea86ac[_0xa47f('0x34')]=_0xea86ac[_0xa47f('0x34')][_0xa47f('0x43')]?_0xea86ac['attributes']:_0x45c49b[_0xa47f('0x2f')];if(_0x1998e0[_0xa47f('0x33')][_0xa47f('0x3e')]){_0xea86ac[_0xa47f('0x3f')]=[{'all':!![]}];}_0xea86ac=_[_0xa47f('0x3b')]({},_0xea86ac,_0x1998e0[_0xa47f('0x3d')]);return db[_0xa47f('0x2c')][_0xa47f('0x44')](_0xea86ac)['then'](handleEntityNotFound(_0x4c034b,null))['then'](respondWithResult(_0x4c034b,null))[_0xa47f('0x1d')](handleError(_0x4c034b,null));};exports['update']=function(_0x3a5721,_0x13d395){if(_0x3a5721[_0xa47f('0x45')]['id']){delete _0x3a5721[_0xa47f('0x45')]['id'];}return db[_0xa47f('0x2c')][_0xa47f('0x44')]({'where':{'id':_0x3a5721[_0xa47f('0x41')]['id']}})[_0xa47f('0x14')](handleEntityNotFound(_0x13d395,null))[_0xa47f('0x14')](saveUpdates(_0x3a5721[_0xa47f('0x45')],null))[_0xa47f('0x14')](respondWithResult(_0x13d395,null))[_0xa47f('0x1d')](handleError(_0x13d395,null));};exports[_0xa47f('0x24')]=function(_0x480e48,_0x52b32e){return db['MailMessage']['find']({'where':{'id':_0x480e48[_0xa47f('0x41')]['id']}})[_0xa47f('0x14')](handleEntityNotFound(_0x52b32e,null))[_0xa47f('0x14')](removeEntity(_0x52b32e,null))[_0xa47f('0x1d')](handleError(_0x52b32e,null));};exports[_0xa47f('0x46')]=function(_0x2acf40,_0x56f7dd){return db['MailMessage'][_0xa47f('0x46')]()[_0xa47f('0x14')](respondWithResult(_0x56f7dd,null))[_0xa47f('0x1d')](handleError(_0x56f7dd,null));};exports[_0xa47f('0x47')]=function(_0x4a1010,_0x301a60){return db[_0xa47f('0x2c')][_0xa47f('0x47')](_0x4a1010[_0xa47f('0x45')])[_0xa47f('0x14')](function(_0x725004){if(_0x725004){if(_0x725004[_0xa47f('0x48')]===_0xa47f('0x49')&&!_0x725004[_0xa47f('0x4a')]){var _0x2d4ceb,_0x31dd5d,_0x376afd;if(_0x4a1010[_0xa47f('0x45')]['to']){_0x31dd5d=_0x4a1010[_0xa47f('0x45')]['to'][_0xa47f('0x4b')](',')[0x0];}return db[_0xa47f('0x4c')][_0xa47f('0x4d')]({'where':{'id':_0x725004[_0xa47f('0x4e')]},'include':[{'model':db[_0xa47f('0x4f')],'as':_0xa47f('0x50'),'include':[{'model':db[_0xa47f('0x51')],'as':'Contacts','where':{'email':_0x31dd5d},'limit':0x1,'order':[[_0xa47f('0x52'),_0xa47f('0x53')]]}]},{'model':db['MailServerOut'],'as':_0xa47f('0x54'),'raw':!![],'include':[{'model':db[_0xa47f('0x55')],'as':_0xa47f('0x55'),'raw':!![]}]}]})['then'](function(_0x567712){_0x2d4ceb=_0x567712;if(!_0x2d4ceb||!_0x2d4ceb['Smtp'])return;var _0x3efa25=_0x2d4ceb[_0xa47f('0x56')]();if(_0x4a1010['body'][_0xa47f('0x57')]&&_0x4a1010[_0xa47f('0x45')][_0xa47f('0x57')][_0xa47f('0x43')]){for(var _0xe82590=0x0;_0xe82590<_0x4a1010[_0xa47f('0x45')][_0xa47f('0x57')]['length'];_0xe82590+=0x1){_0x4a1010['body']['attachments'][_0xe82590]={'filename':_0x4a1010[_0xa47f('0x45')]['attachments'][_0xe82590][_0xa47f('0x28')],'path':path[_0xa47f('0x58')](config['root'],_0xa47f('0x59'),_0x4a1010[_0xa47f('0x45')][_0xa47f('0x57')][_0xe82590][_0xa47f('0x5a')])};}}_0x376afd={'account':_0x3efa25,'message':_0x4a1010[_0xa47f('0x45')]};return;})[_0xa47f('0x14')](function(){if(_0x2d4ceb['List']){if(_0x2d4ceb[_0xa47f('0x50')][_0xa47f('0x5b')][_0xa47f('0x43')]){return _0x2d4ceb[_0xa47f('0x50')][_0xa47f('0x5b')][0x0];}else{return db[_0xa47f('0x51')][_0xa47f('0x47')](_[_0xa47f('0x5c')](_0x4a1010['body'],{'firstName':_0x4a1010[_0xa47f('0x45')]['to'],'email':_0x4a1010[_0xa47f('0x45')]['to'],'phone':_0x4a1010[_0xa47f('0x45')]['to'],'ListId':_0x2d4ceb['ListId']}));}}else{throw new Error(_0xa47f('0x5d'));}})['then'](function(){if(_0x376afd){return respondWithRpcPromise(_0xa47f('0x5e'),_0xa47f('0x5f'),_0x376afd,client9003)[_0xa47f('0x14')](function(_0x30cd59){return _0x725004[_0xa47f('0x23')]({'read':!![],'messageId':_0x30cd59[_0xa47f('0x60')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0xe18fd9){logger[_0xa47f('0x19')]('%s',JSON[_0xa47f('0x18')](_0xe18fd9));return _0x725004;});}return _0x725004;});}return _0x725004;}})['then'](respondWithResult(_0x301a60,0xc9))[_0xa47f('0x1d')](handleError(_0x301a60,null));};exports[_0xa47f('0x61')]=function(_0xcd0334,_0x1dee61){var _0x5cb39b={'agent':{},'channel':'mail'};if(_0xcd0334[_0xa47f('0x45')]['id']){delete _0xcd0334[_0xa47f('0x45')]['id'];}_0xcd0334['body'][_0xa47f('0x62')]=!![];_0xcd0334[_0xa47f('0x45')]['readAt']=moment()[_0xa47f('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0xcd0334[_0xa47f('0x45')][_0xa47f('0x64')]=_0xcd0334[_0xa47f('0x45')][_0xa47f('0x64')]||_0xcd0334[_0xa47f('0x65')]['id'];_0x5cb39b[_0xa47f('0x66')]['id']=_0xcd0334['body']['UserId'];return db[_0xa47f('0x2c')][_0xa47f('0x44')]({'where':{'id':_0xcd0334['params']['id'],'UserId':null}})[_0xa47f('0x14')](handleEntityNotFound(_0x1dee61,null))['then'](saveUpdates(_0xcd0334['body'],null))['then'](function(_0x5bb45f){if(_0x5bb45f){_0x5cb39b[_0xa47f('0x1b')]=_0x5bb45f[_0xa47f('0x67')]({'plain':!![]});return db[_0xa47f('0x68')]['find']({'where':{'id':_0x5bb45f['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1dee61,null))[_0xa47f('0x14')](function(_0x13c1c9){if(_0x13c1c9){return _0x13c1c9[_0xa47f('0x23')]({'UserId':_0xcd0334[_0xa47f('0x45')][_0xa47f('0x64')],'read1stAt':_['isNil'](_0x13c1c9[_0xa47f('0x69')])?moment()[_0xa47f('0x63')](_0xa47f('0x6a')):undefined});}return null;})['then'](function(_0x4025af){if(_0x4025af){_0x5cb39b['interaction']=_0x4025af['get']({'plain':!![]});interaction_log['info'](_0xa47f('0x6b'),_0xcd0334[_0xa47f('0x65')]['id'],_0xcd0334[_0xa47f('0x65')][_0xa47f('0x28')],_0xcd0334[_0xa47f('0x65')][_0xa47f('0x6c')],_0x5cb39b[_0xa47f('0x6d')]['id'],_0xcd0334[_0xa47f('0x45')]?JSON['stringify'](_0xcd0334[_0xa47f('0x45')]):_0xa47f('0x6e'));return respondWithRpcPromise('AcceptMessage',_0xa47f('0x6f'),_0x5cb39b);}return null;})['then'](function(_0x3a2d7e){var _0x1ee7d0=_0xa47f('0x70')+_0x3a2d7e[_0xa47f('0x1b')][_0xa47f('0x71')];return db[_0xa47f('0x72')]['query'](_0x1ee7d0,{'type':db['Sequelize']['QueryTypes'][_0xa47f('0x73')],'raw':!![]})[_0xa47f('0x14')](function(_0x5037df){return _0x5037df;});})[_0xa47f('0x14')](function(_0xa8a6aa){if(_0xa8a6aa){_0x5cb39b[_0xa47f('0x1b')]['contact']=_0xa8a6aa[0x0];if(!_0xcd0334['body'][_0xa47f('0x64')])return;return db[_0xa47f('0x74')]['find']({'where':{'id':_0xcd0334['body'][_0xa47f('0x64')],'role':_0xa47f('0x66')},'attributes':['id',_0xa47f('0x28'),_0xa47f('0x75'),'email',_0xa47f('0x76')],'raw':!![]});}return null;})['then'](function(_0x284d2a){if(!_0x284d2a)return null;_0x5cb39b['message'][_0xa47f('0x66')]=_0x284d2a;return _0x5cb39b;})[_0xa47f('0x14')](function(_0x113946){if(_0x113946){if(_0xcd0334[_0xa47f('0x45')][_0xa47f('0x77')]){_0x5cb39b[_0xa47f('0x1b')][_0xa47f('0x78')]=util[_0xa47f('0x63')](_0xa47f('0x79'),_0xcd0334[_0xa47f('0x65')][_0xa47f('0x28')]);_0x5cb39b[_0xa47f('0x1b')]['channel']=_0x5cb39b[_0xa47f('0x7a')];_0x5cb39b[_0xa47f('0x1b')][_0xa47f('0x7b')]=_0x5cb39b[_0xa47f('0x7a')];_0x5cb39b['message'][_0xa47f('0x7c')]=_0xa47f('0x61');_0x5cb39b[_0xa47f('0x1b')][_0xa47f('0x45')]=htmlToText[_0xa47f('0x7d')](_0x5cb39b[_0xa47f('0x1b')]['body']);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xa47f('0x7e'),'message':_0x5cb39b[_0xa47f('0x1b')]},client9002)[_0xa47f('0x14')](function(){return _0x5cb39b;});}return _0x5cb39b;}return null;})['then'](respondWithResult(_0x1dee61,null))[_0xa47f('0x1d')](handleError(_0x1dee61,null));};exports['reject']=function(_0x58d8f2,_0x51d36f){var _0x4751e7={'agent':{},'channel':_0xa47f('0x7f')};if(_0x58d8f2['body']['id']){delete _0x58d8f2[_0xa47f('0x45')]['id'];}_0x58d8f2[_0xa47f('0x45')][_0xa47f('0x64')]=_0x58d8f2[_0xa47f('0x45')][_0xa47f('0x64')]||_0x58d8f2[_0xa47f('0x65')]['id'];_0x4751e7['agent']['id']=_0x58d8f2[_0xa47f('0x45')][_0xa47f('0x64')];return db[_0xa47f('0x2c')][_0xa47f('0x44')]({'where':{'id':_0x58d8f2[_0xa47f('0x41')]['id'],'UserId':null}})[_0xa47f('0x14')](handleEntityNotFound(_0x51d36f,null))[_0xa47f('0x14')](function(_0x48a76e){if(_0x48a76e){_0x4751e7[_0xa47f('0x1b')]=_0x48a76e['get']({'plain':!![]});return db[_0xa47f('0x68')][_0xa47f('0x44')]({'where':{'id':_0x48a76e[_0xa47f('0x80')]}});}return null;})[_0xa47f('0x14')](handleEntityNotFound(_0x51d36f,null))[_0xa47f('0x14')](function(_0x3d52ee){if(_0x3d52ee){_0x4751e7['interaction']=_0x3d52ee[_0xa47f('0x67')]({'plain':!![]});interaction_log[_0xa47f('0x15')](_0xa47f('0x81'),_0x58d8f2[_0xa47f('0x65')]['id'],_0x58d8f2['user'][_0xa47f('0x28')],_0x58d8f2[_0xa47f('0x65')][_0xa47f('0x6c')],_0x4751e7[_0xa47f('0x6d')]['id'],_0x58d8f2[_0xa47f('0x45')]?JSON[_0xa47f('0x18')](_0x58d8f2[_0xa47f('0x45')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4751e7);}return null;})[_0xa47f('0x14')](function(_0x7a4acc){var _0x344027='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x7a4acc[_0xa47f('0x1b')][_0xa47f('0x71')];return db[_0xa47f('0x72')][_0xa47f('0x33')](_0x344027,{'type':db[_0xa47f('0x82')][_0xa47f('0x83')][_0xa47f('0x73')],'raw':!![]})[_0xa47f('0x14')](function(_0x2e10da){return _0x2e10da;});})['then'](function(_0x7ba79c){if(_0x7ba79c){_0x4751e7[_0xa47f('0x1b')][_0xa47f('0x84')]=_0x7ba79c[0x0];if(!_0x58d8f2[_0xa47f('0x45')][_0xa47f('0x64')])return;return db['User']['find']({'where':{'id':_0x58d8f2[_0xa47f('0x45')][_0xa47f('0x64')],'role':_0xa47f('0x66')},'attributes':['id',_0xa47f('0x28'),_0xa47f('0x75'),'email',_0xa47f('0x76')],'raw':!![]});}return null;})[_0xa47f('0x14')](function(_0x484d5a){if(!_0x484d5a)return null;_0x4751e7['message'][_0xa47f('0x66')]=_0x484d5a;return _0x4751e7;})['then'](function(_0x1b6a4b){if(_0x1b6a4b){_0x1b6a4b[_0xa47f('0x1b')][_0xa47f('0x78')]=util[_0xa47f('0x63')](_0xa47f('0x79'),_0x58d8f2[_0xa47f('0x65')][_0xa47f('0x28')]);_0x1b6a4b[_0xa47f('0x1b')][_0xa47f('0x7a')]=_0x4751e7[_0xa47f('0x7a')];_0x1b6a4b[_0xa47f('0x1b')][_0xa47f('0x7b')]=_0x4751e7['channel'];_0x1b6a4b[_0xa47f('0x1b')][_0xa47f('0x7c')]=_0xa47f('0x85');_0x1b6a4b[_0xa47f('0x1b')][_0xa47f('0x45')]=htmlToText[_0xa47f('0x7d')](_0x4751e7[_0xa47f('0x1b')][_0xa47f('0x45')]);respondWithRpcPromise(_0xa47f('0x86'),_0xa47f('0x86'),{'event':_0xa47f('0x87'),'message':_0x1b6a4b[_0xa47f('0x1b')]},client9002);return _0x4751e7;}return null;})[_0xa47f('0x14')](respondWithResult(_0x51d36f,null))[_0xa47f('0x1d')](handleError(_0x51d36f,null));};exports[_0xa47f('0x88')]=function(_0x5d173c,_0x1b1722){var _0x39f413=moment()[_0xa47f('0x89')]()[_0xa47f('0x8a')]();var _0x391dd6=path['join'](config['root'],'server',_0xa47f('0x8b'),_0xa47f('0x8c'));var _0x20f397=path[_0xa47f('0x58')](config[_0xa47f('0x8d')],'server','files',_0xa47f('0x57'));var _0x106b6a=util[_0xa47f('0x63')]('message-%s.eml',_0x39f413);return db[_0xa47f('0x2c')]['find']({'where':{'id':_0x5d173c[_0xa47f('0x41')]['id']},'attributes':['id',_0xa47f('0x45'),_0xa47f('0x8e'),'to','cc','bcc',_0xa47f('0x8f'),_0xa47f('0x90')],'include':_0x5d173c[_0xa47f('0x33')][_0xa47f('0x57')]?[{'model':db[_0xa47f('0x91')],'as':_0xa47f('0x92')}]:undefined})['then'](handleEntityNotFound(_0x1b1722,null))[_0xa47f('0x14')](function(_0x3f263c){if(_0x3f263c){var _0x3be7eb=_0x3f263c;var _0x4051cd={'from':_0x3be7eb['from'],'to':_0x3be7eb['to'],'subject':_0x3be7eb[_0xa47f('0x8f')],'html':htmlEntities[_0xa47f('0x93')](_0x3be7eb[_0xa47f('0x45')]),'headers':{'Date':moment(_0x3be7eb['createdAt'])[_0xa47f('0x63')](_0xa47f('0x94'))},'attachments':[]};if(_0x3f263c['cc']){_0x4051cd[_0xa47f('0x95')]['Cc']=_0x3f263c['cc'];}if(_0x3f263c[_0xa47f('0x96')]){_0x4051cd['headers']['Bcc']=_0x3f263c[_0xa47f('0x96')];}return new BPromise(function(_0x5da765,_0x24f5d9){if(_0x3f263c[_0xa47f('0x92')]){for(var _0x5d87f2=0x0;_0x5d87f2<_0x3f263c[_0xa47f('0x92')][_0xa47f('0x43')];_0x5d87f2++){var _0x5ad0a5=_0x3f263c['Attachments'][_0x5d87f2];var _0x132402=path['join'](_0x20f397,_0x5ad0a5[_0xa47f('0x5a')]);if(fs[_0xa47f('0x97')](_0x132402)){_0x4051cd[_0xa47f('0x57')][_0xa47f('0x98')]({'name':_0x5ad0a5[_0xa47f('0x28')],'contentType':_0x5ad0a5[_0xa47f('0x2e')],'data':fs[_0xa47f('0x99')](_0x132402)});}}}emlformat[_0xa47f('0x9a')](_0x4051cd,function(_0x4f0a6e,_0x150590){if(_0x4f0a6e)return _0x24f5d9(_0x4f0a6e);fs['writeFileSync'](path[_0xa47f('0x58')](_0x391dd6,_0x106b6a),_0x150590);return _0x5da765(_0x150590);});});}})[_0xa47f('0x14')](function(_0x78a30f){if(_0x78a30f){return _0x1b1722['download'](path[_0xa47f('0x58')](_0x391dd6,_0x106b6a),_0x106b6a,function(_0x8e46e0){if(!_0x8e46e0)fs[_0xa47f('0x9b')](path[_0xa47f('0x58')](_0x391dd6,_0x106b6a));});}})[_0xa47f('0x1d')](handleError(_0x1b1722,null));}; \ No newline at end of file +var _0x4c20=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','find','catch','update','body','describe','create','direction','out','secret','split','MailAccountId','CmList','List','Contacts','CloudProvider','Smtp','getSmtpOptions','attachments','root','server/files/attachments','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','SIP/%s','fromString','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','build','writeFileSync','bluebird','util','path','lodash','ioredis','html-to-text','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','http','client','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','info','status','json','offset','undefined','count','limit','set','Content-Range','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','type','model','keys','query','filters','intersection','attributes'];(function(_0x3cdd16,_0x58d2d6){var _0x15cad7=function(_0x2cdd6c){while(--_0x2cdd6c){_0x3cdd16['push'](_0x3cdd16['shift']());}};_0x15cad7(++_0x58d2d6);}(_0x4c20,0x66));var _0x04c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c20[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x04c2('0x0'));var util=require(_0x04c2('0x1'));var path=require(_0x04c2('0x2'));var fs=require('fs');var _=require(_0x04c2('0x3'));var Redis=require(_0x04c2('0x4'));var htmlToText=require(_0x04c2('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x04c2('0x6'))(_0x04c2('0x7'));var interaction_log=require(_0x04c2('0x6'))('mail-interactions');var config=require(_0x04c2('0x8'));var db=require(_0x04c2('0x9'))['db'];config[_0x04c2('0xa')]=_[_0x04c2('0xb')](config[_0x04c2('0xa')],{'host':_0x04c2('0xc'),'port':0x18eb});var socket=require(_0x04c2('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0x04c2('0xe'));require('./mailMessage.socket')[_0x04c2('0xf')](socket);var jayson=require(_0x04c2('0x10'));var client=jayson['client'][_0x04c2('0x11')]({'port':0x232c});var client9003=jayson[_0x04c2('0x12')]['http']({'port':0x232b});var client9002=jayson[_0x04c2('0x12')][_0x04c2('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x4553a8,_0x1ad04c,_0x1091a2,_0x24c090){return new BPromise(function(_0x1a20bd,_0x94f67c){var _0x5b2f99=_0x24c090||client;return _0x5b2f99[_0x04c2('0x13')](_0x4553a8,_0x1091a2)[_0x04c2('0x14')](function(_0x3122dd){logger['info'](_0x04c2('0x15'),_0x1ad04c,_0x04c2('0x16'));logger[_0x04c2('0x17')](_0x04c2('0x18'),_0x1ad04c,'request\x20sent',JSON['stringify'](_0x3122dd));if(_0x3122dd[_0x04c2('0x19')]){if(_0x3122dd[_0x04c2('0x19')]['code']===0x1f4){logger['error'](_0x04c2('0x15'),_0x1ad04c,_0x3122dd['error'][_0x04c2('0x1a')]);return _0x94f67c(_0x3122dd[_0x04c2('0x19')]['message']);}logger['error'](_0x04c2('0x15'),_0x1ad04c,_0x3122dd['error'][_0x04c2('0x1a')]);return _0x1a20bd(_0x3122dd[_0x04c2('0x19')]['message']);}else{logger[_0x04c2('0x1b')](_0x04c2('0x15'),_0x1ad04c,_0x04c2('0x16'));_0x1a20bd(_0x3122dd['result']['message']);}})['catch'](function(_0x2db6ac){logger[_0x04c2('0x19')]('MailMessage,\x20%s,\x20%s',_0x1ad04c,_0x2db6ac);_0x94f67c(_0x2db6ac);});});}function respondWithResult(_0x438f3f,_0x122c7e){_0x122c7e=_0x122c7e||0xc8;return function(_0x26435b){if(_0x26435b){return _0x438f3f[_0x04c2('0x1c')](_0x122c7e)[_0x04c2('0x1d')](_0x26435b);}};}function respondWithFilteredResult(_0x4238d1,_0x535c82){return function(_0x21c4b6){if(_0x21c4b6){var _0x341ec6=typeof _0x535c82[_0x04c2('0x1e')]===_0x04c2('0x1f')&&typeof _0x535c82['limit']==='undefined';var _0x45413e=_0x21c4b6['count'];var _0x121c08=_0x341ec6?0x0:_0x535c82[_0x04c2('0x1e')];var _0x37765a=_0x341ec6?_0x21c4b6[_0x04c2('0x20')]:_0x535c82[_0x04c2('0x1e')]+_0x535c82[_0x04c2('0x21')];var _0x1afce2;if(_0x37765a>=_0x45413e){_0x37765a=_0x45413e;_0x1afce2=0xc8;}else{_0x1afce2=0xce;}_0x4238d1[_0x04c2('0x1c')](_0x1afce2);return _0x4238d1[_0x04c2('0x22')](_0x04c2('0x23'),_0x121c08+'-'+_0x37765a+'/'+_0x45413e)[_0x04c2('0x1d')](_0x21c4b6);}return null;};}function saveUpdates(_0x5ae579){return function(_0x497907){if(_0x497907){return _0x497907['update'](_0x5ae579)[_0x04c2('0x14')](function(_0x4c1534){return _0x4c1534;});}return null;};}function removeEntity(_0xed3de9){return function(_0x2c789d){if(_0x2c789d){return _0x2c789d[_0x04c2('0x24')]()['then'](function(){_0xed3de9[_0x04c2('0x1c')](0xcc)[_0x04c2('0x25')]();});}};}function handleEntityNotFound(_0x34d20b){return function(_0x45d775){if(!_0x45d775){_0x34d20b['sendStatus'](0x194);}return _0x45d775;};}function handleError(_0x53d676,_0x563ee4){_0x563ee4=_0x563ee4||0x1f4;return function(_0x1c50c7){logger[_0x04c2('0x19')](_0x1c50c7[_0x04c2('0x26')]);if(_0x1c50c7['name']){delete _0x1c50c7[_0x04c2('0x27')];}_0x53d676[_0x04c2('0x1c')](_0x563ee4)[_0x04c2('0x28')](_0x1c50c7);};}exports[_0x04c2('0x29')]=function(_0x234b9c,_0x66bbbf){var _0x115ec5={},_0x4e9535={},_0x437fa0={'count':0x0,'rows':[]};var _0x556331=_[_0x04c2('0x2a')](db[_0x04c2('0x2b')][_0x04c2('0x2c')],function(_0x3922ae){return{'name':_0x3922ae['fieldName'],'type':_0x3922ae[_0x04c2('0x2d')]['key']};});_0x4e9535[_0x04c2('0x2e')]=_[_0x04c2('0x2a')](_0x556331,_0x04c2('0x27'));_0x4e9535['query']=_[_0x04c2('0x2f')](_0x234b9c[_0x04c2('0x30')]);_0x4e9535[_0x04c2('0x31')]=_[_0x04c2('0x32')](_0x4e9535['model'],_0x4e9535['query']);_0x115ec5[_0x04c2('0x33')]=_['intersection'](_0x4e9535[_0x04c2('0x2e')],qs['fields'](_0x234b9c['query'][_0x04c2('0x34')]));_0x115ec5[_0x04c2('0x33')]=_0x115ec5[_0x04c2('0x33')][_0x04c2('0x35')]?_0x115ec5[_0x04c2('0x33')]:_0x4e9535[_0x04c2('0x2e')];if(!_0x234b9c[_0x04c2('0x30')][_0x04c2('0x36')](_0x04c2('0x37'))){_0x115ec5['limit']=qs[_0x04c2('0x21')](_0x234b9c[_0x04c2('0x30')]['limit']);_0x115ec5['offset']=qs[_0x04c2('0x1e')](_0x234b9c[_0x04c2('0x30')][_0x04c2('0x1e')]);}_0x115ec5[_0x04c2('0x38')]=qs[_0x04c2('0x39')](_0x234b9c[_0x04c2('0x30')][_0x04c2('0x39')]);_0x115ec5[_0x04c2('0x3a')]=qs[_0x04c2('0x31')](_[_0x04c2('0x3b')](_0x234b9c['query'],_0x4e9535[_0x04c2('0x31')]),_0x556331);if(_0x234b9c[_0x04c2('0x30')]['filter']){_0x115ec5[_0x04c2('0x3a')]=_[_0x04c2('0x3c')](_0x115ec5[_0x04c2('0x3a')],{'$or':_[_0x04c2('0x2a')](_0x556331,function(_0x554340){if(_0x554340[_0x04c2('0x2d')]!==_0x04c2('0x3d')){var _0x14aa24={};_0x14aa24[_0x554340[_0x04c2('0x27')]]={'$like':'%'+_0x234b9c[_0x04c2('0x30')]['filter']+'%'};return _0x14aa24;}})});}_0x115ec5=_[_0x04c2('0x3c')]({},_0x115ec5,_0x234b9c['options']);var _0x55001b={'where':_0x115ec5[_0x04c2('0x3a')]};return db[_0x04c2('0x2b')]['count'](_0x55001b)[_0x04c2('0x14')](function(_0x36ef79){_0x437fa0[_0x04c2('0x20')]=_0x36ef79;if(_0x234b9c[_0x04c2('0x30')]['includeAll']){_0x115ec5[_0x04c2('0x3e')]=[{'all':!![]}];}return db['MailMessage'][_0x04c2('0x3f')](_0x115ec5);})[_0x04c2('0x14')](function(_0x428806){_0x437fa0[_0x04c2('0x40')]=_0x428806;return _0x437fa0;})[_0x04c2('0x14')](respondWithFilteredResult(_0x66bbbf,_0x115ec5))['catch'](handleError(_0x66bbbf,null));};exports[_0x04c2('0x41')]=function(_0x5dd6a9,_0x1255b7){var _0x50f988={'raw':!![],'where':{'id':_0x5dd6a9[_0x04c2('0x42')]['id']}},_0x34f0ce={};_0x34f0ce['model']=_['keys'](db[_0x04c2('0x2b')]['rawAttributes']);_0x34f0ce[_0x04c2('0x30')]=_['keys'](_0x5dd6a9[_0x04c2('0x30')]);_0x34f0ce['filters']=_[_0x04c2('0x32')](_0x34f0ce['model'],_0x34f0ce['query']);_0x50f988[_0x04c2('0x33')]=_[_0x04c2('0x32')](_0x34f0ce[_0x04c2('0x2e')],qs['fields'](_0x5dd6a9['query'][_0x04c2('0x34')]));_0x50f988[_0x04c2('0x33')]=_0x50f988[_0x04c2('0x33')][_0x04c2('0x35')]?_0x50f988[_0x04c2('0x33')]:_0x34f0ce[_0x04c2('0x2e')];if(_0x5dd6a9[_0x04c2('0x30')][_0x04c2('0x43')]){_0x50f988[_0x04c2('0x3e')]=[{'all':!![]}];}_0x50f988=_['merge']({},_0x50f988,_0x5dd6a9[_0x04c2('0x44')]);return db['MailMessage'][_0x04c2('0x45')](_0x50f988)[_0x04c2('0x14')](handleEntityNotFound(_0x1255b7,null))['then'](respondWithResult(_0x1255b7,null))[_0x04c2('0x46')](handleError(_0x1255b7,null));};exports[_0x04c2('0x47')]=function(_0x4f62d8,_0x4337b6){if(_0x4f62d8['body']['id']){delete _0x4f62d8[_0x04c2('0x48')]['id'];}return db[_0x04c2('0x2b')]['find']({'where':{'id':_0x4f62d8[_0x04c2('0x42')]['id']}})[_0x04c2('0x14')](handleEntityNotFound(_0x4337b6,null))['then'](saveUpdates(_0x4f62d8[_0x04c2('0x48')],null))['then'](respondWithResult(_0x4337b6,null))[_0x04c2('0x46')](handleError(_0x4337b6,null));};exports[_0x04c2('0x24')]=function(_0x301d17,_0x57dd2f){return db['MailMessage'][_0x04c2('0x45')]({'where':{'id':_0x301d17['params']['id']}})['then'](handleEntityNotFound(_0x57dd2f,null))[_0x04c2('0x14')](removeEntity(_0x57dd2f,null))[_0x04c2('0x46')](handleError(_0x57dd2f,null));};exports[_0x04c2('0x49')]=function(_0x455179,_0x567684){return db[_0x04c2('0x2b')][_0x04c2('0x49')]()[_0x04c2('0x14')](respondWithResult(_0x567684,null))['catch'](handleError(_0x567684,null));};exports[_0x04c2('0x4a')]=function(_0x4cf06d,_0x47656e){return db[_0x04c2('0x2b')][_0x04c2('0x4a')](_0x4cf06d['body'])[_0x04c2('0x14')](function(_0xc83ed9){if(_0xc83ed9){if(_0xc83ed9[_0x04c2('0x4b')]===_0x04c2('0x4c')&&!_0xc83ed9[_0x04c2('0x4d')]){var _0x65f4e6,_0x5e408f,_0x500f14;if(_0x4cf06d[_0x04c2('0x48')]['to']){_0x5e408f=_0x4cf06d[_0x04c2('0x48')]['to'][_0x04c2('0x4e')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0xc83ed9[_0x04c2('0x4f')]},'include':[{'model':db[_0x04c2('0x50')],'as':_0x04c2('0x51'),'include':[{'model':db['CmContact'],'as':_0x04c2('0x52'),'where':{'email':_0x5e408f},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x04c2('0x53')],'as':_0x04c2('0x53'),'raw':!![]}]}]})[_0x04c2('0x14')](function(_0xd0d3d0){_0x65f4e6=_0xd0d3d0;if(!_0x65f4e6||!_0x65f4e6[_0x04c2('0x54')])return;var _0x213566=_0x65f4e6[_0x04c2('0x55')]();if(_0x4cf06d[_0x04c2('0x48')][_0x04c2('0x56')]&&_0x4cf06d[_0x04c2('0x48')][_0x04c2('0x56')]['length']){for(var _0x425c3b=0x0;_0x425c3b<_0x4cf06d[_0x04c2('0x48')][_0x04c2('0x56')][_0x04c2('0x35')];_0x425c3b+=0x1){_0x4cf06d[_0x04c2('0x48')][_0x04c2('0x56')][_0x425c3b]={'filename':_0x4cf06d['body'][_0x04c2('0x56')][_0x425c3b][_0x04c2('0x27')],'path':path['join'](config[_0x04c2('0x57')],_0x04c2('0x58'),_0x4cf06d['body']['attachments'][_0x425c3b]['basename'])};}}_0x500f14={'account':_0x213566,'message':_0x4cf06d[_0x04c2('0x48')]};return;})[_0x04c2('0x14')](function(){if(_0x65f4e6[_0x04c2('0x51')]){if(_0x65f4e6['List'][_0x04c2('0x52')][_0x04c2('0x35')]){return _0x65f4e6[_0x04c2('0x51')][_0x04c2('0x52')][0x0];}else{return db[_0x04c2('0x59')]['create'](_['defaults'](_0x4cf06d[_0x04c2('0x48')],{'firstName':_0x4cf06d[_0x04c2('0x48')]['to'],'email':_0x4cf06d['body']['to'],'phone':_0x4cf06d[_0x04c2('0x48')]['to'],'ListId':_0x65f4e6[_0x04c2('0x5a')]}));}}else{throw new Error(_0x04c2('0x5b'));}})['then'](function(){if(_0x500f14){return respondWithRpcPromise(_0x04c2('0x5c'),_0x04c2('0x5d'),_0x500f14,client9003)[_0x04c2('0x14')](function(_0x4c6782){return _0xc83ed9[_0x04c2('0x47')]({'read':!![],'messageId':_0x4c6782[_0x04c2('0x5e')],'sentAt':moment()[_0x04c2('0x5f')](_0x04c2('0x60'))});})[_0x04c2('0x46')](function(_0x288f47){logger[_0x04c2('0x19')]('%s',JSON[_0x04c2('0x61')](_0x288f47));return _0xc83ed9;});}return _0xc83ed9;});}return _0xc83ed9;}})[_0x04c2('0x14')](respondWithResult(_0x47656e,0xc9))[_0x04c2('0x46')](handleError(_0x47656e,null));};exports[_0x04c2('0x62')]=function(_0x33128b,_0x56cca5){var _0x51a06e={'agent':{},'channel':_0x04c2('0x63')};if(_0x33128b[_0x04c2('0x48')]['id']){delete _0x33128b[_0x04c2('0x48')]['id'];}_0x33128b[_0x04c2('0x48')][_0x04c2('0x64')]=!![];_0x33128b[_0x04c2('0x48')]['readAt']=moment()[_0x04c2('0x5f')](_0x04c2('0x60'));_0x33128b[_0x04c2('0x48')][_0x04c2('0x65')]=_0x33128b[_0x04c2('0x48')][_0x04c2('0x65')]||_0x33128b[_0x04c2('0x66')]['id'];_0x51a06e[_0x04c2('0x67')]['id']=_0x33128b[_0x04c2('0x48')][_0x04c2('0x65')];return db[_0x04c2('0x2b')][_0x04c2('0x45')]({'where':{'id':_0x33128b[_0x04c2('0x42')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x56cca5,null))[_0x04c2('0x14')](saveUpdates(_0x33128b[_0x04c2('0x48')],null))[_0x04c2('0x14')](function(_0x27f408){if(_0x27f408){_0x51a06e[_0x04c2('0x1a')]=_0x27f408[_0x04c2('0x68')]({'plain':!![]});return db[_0x04c2('0x69')][_0x04c2('0x45')]({'where':{'id':_0x27f408[_0x04c2('0x6a')]}});}return null;})[_0x04c2('0x14')](handleEntityNotFound(_0x56cca5,null))[_0x04c2('0x14')](function(_0x3610c2){if(_0x3610c2){return _0x3610c2['update']({'UserId':_0x33128b[_0x04c2('0x48')][_0x04c2('0x65')],'read1stAt':_[_0x04c2('0x6b')](_0x3610c2[_0x04c2('0x6c')])?moment()[_0x04c2('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x04c2('0x14')](function(_0x2de003){if(_0x2de003){_0x51a06e[_0x04c2('0x6d')]=_0x2de003[_0x04c2('0x68')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33128b[_0x04c2('0x66')]['id'],_0x33128b[_0x04c2('0x66')][_0x04c2('0x27')],_0x33128b['user']['role'],_0x51a06e[_0x04c2('0x6d')]['id'],_0x33128b[_0x04c2('0x48')]?JSON[_0x04c2('0x61')](_0x33128b[_0x04c2('0x48')]):'null');return respondWithRpcPromise(_0x04c2('0x6e'),_0x04c2('0x6f'),_0x51a06e);}return null;})['then'](function(_0x3b1ffd){var _0x393da7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b1ffd['message'][_0x04c2('0x70')];return db[_0x04c2('0x71')][_0x04c2('0x30')](_0x393da7,{'type':db['Sequelize'][_0x04c2('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x50a37f){return _0x50a37f;});})['then'](function(_0x83ea8d){if(_0x83ea8d){_0x51a06e[_0x04c2('0x1a')][_0x04c2('0x73')]=_0x83ea8d[0x0];if(!_0x33128b[_0x04c2('0x48')]['UserId'])return;return db[_0x04c2('0x74')][_0x04c2('0x45')]({'where':{'id':_0x33128b[_0x04c2('0x48')][_0x04c2('0x65')],'role':_0x04c2('0x67')},'attributes':['id',_0x04c2('0x27'),_0x04c2('0x75'),_0x04c2('0x76'),_0x04c2('0x77')],'raw':!![]});}return null;})['then'](function(_0x5380c1){if(!_0x5380c1)return null;_0x51a06e[_0x04c2('0x1a')]['agent']=_0x5380c1;return _0x51a06e;})['then'](function(_0x84dea4){if(_0x84dea4){if(_0x33128b[_0x04c2('0x48')][_0x04c2('0x78')]){_0x51a06e[_0x04c2('0x1a')][_0x04c2('0x79')]=util[_0x04c2('0x5f')]('SIP/%s',_0x33128b[_0x04c2('0x66')][_0x04c2('0x27')]);_0x51a06e[_0x04c2('0x1a')][_0x04c2('0x7a')]=_0x51a06e[_0x04c2('0x7a')];_0x51a06e[_0x04c2('0x1a')][_0x04c2('0x7b')]=_0x51a06e[_0x04c2('0x7a')];_0x51a06e[_0x04c2('0x1a')][_0x04c2('0x7c')]='accept';_0x51a06e[_0x04c2('0x1a')][_0x04c2('0x48')]=htmlToText['fromString'](_0x51a06e[_0x04c2('0x1a')][_0x04c2('0x48')]);return respondWithRpcPromise(_0x04c2('0x7d'),_0x04c2('0x7d'),{'event':'acceptmessage','message':_0x51a06e[_0x04c2('0x1a')]},client9002)[_0x04c2('0x14')](function(){return _0x51a06e;});}return _0x51a06e;}return null;})[_0x04c2('0x14')](respondWithResult(_0x56cca5,null))[_0x04c2('0x46')](handleError(_0x56cca5,null));};exports[_0x04c2('0x7e')]=function(_0x3ae94,_0x53dfc6){var _0x1e1315={'agent':{},'channel':_0x04c2('0x63')};if(_0x3ae94[_0x04c2('0x48')]['id']){delete _0x3ae94['body']['id'];}_0x3ae94['body']['UserId']=_0x3ae94[_0x04c2('0x48')][_0x04c2('0x65')]||_0x3ae94['user']['id'];_0x1e1315[_0x04c2('0x67')]['id']=_0x3ae94[_0x04c2('0x48')][_0x04c2('0x65')];return db['MailMessage'][_0x04c2('0x45')]({'where':{'id':_0x3ae94[_0x04c2('0x42')]['id'],'UserId':null}})[_0x04c2('0x14')](handleEntityNotFound(_0x53dfc6,null))[_0x04c2('0x14')](function(_0x4902a9){if(_0x4902a9){_0x1e1315[_0x04c2('0x1a')]=_0x4902a9[_0x04c2('0x68')]({'plain':!![]});return db['MailInteraction'][_0x04c2('0x45')]({'where':{'id':_0x4902a9[_0x04c2('0x6a')]}});}return null;})[_0x04c2('0x14')](handleEntityNotFound(_0x53dfc6,null))[_0x04c2('0x14')](function(_0x2442f){if(_0x2442f){_0x1e1315['interaction']=_0x2442f[_0x04c2('0x68')]({'plain':!![]});interaction_log[_0x04c2('0x1b')](_0x04c2('0x7f'),_0x3ae94[_0x04c2('0x66')]['id'],_0x3ae94['user'][_0x04c2('0x27')],_0x3ae94[_0x04c2('0x66')]['role'],_0x1e1315[_0x04c2('0x6d')]['id'],_0x3ae94[_0x04c2('0x48')]?JSON[_0x04c2('0x61')](_0x3ae94['body']):_0x04c2('0x80'));return respondWithRpcPromise(_0x04c2('0x81'),'rejectMessage',_0x1e1315);}return null;})[_0x04c2('0x14')](function(_0x10d423){var _0x362f34=_0x04c2('0x82')+_0x10d423[_0x04c2('0x1a')]['ContactId'];return db[_0x04c2('0x71')][_0x04c2('0x30')](_0x362f34,{'type':db[_0x04c2('0x83')]['QueryTypes'][_0x04c2('0x84')],'raw':!![]})[_0x04c2('0x14')](function(_0x9793d2){return _0x9793d2;});})[_0x04c2('0x14')](function(_0x4a378b){if(_0x4a378b){_0x1e1315[_0x04c2('0x1a')][_0x04c2('0x73')]=_0x4a378b[0x0];if(!_0x3ae94['body'][_0x04c2('0x65')])return;return db[_0x04c2('0x74')][_0x04c2('0x45')]({'where':{'id':_0x3ae94[_0x04c2('0x48')][_0x04c2('0x65')],'role':_0x04c2('0x67')},'attributes':['id',_0x04c2('0x27'),_0x04c2('0x75'),_0x04c2('0x76'),'internal'],'raw':!![]});}return null;})[_0x04c2('0x14')](function(_0x18ebfe){if(!_0x18ebfe)return null;_0x1e1315[_0x04c2('0x1a')][_0x04c2('0x67')]=_0x18ebfe;return _0x1e1315;})[_0x04c2('0x14')](function(_0x429245){if(_0x429245){_0x429245['message']['interface']=util['format'](_0x04c2('0x85'),_0x3ae94['user'][_0x04c2('0x27')]);_0x429245[_0x04c2('0x1a')][_0x04c2('0x7a')]=_0x1e1315[_0x04c2('0x7a')];_0x429245[_0x04c2('0x1a')][_0x04c2('0x7b')]=_0x1e1315['channel'];_0x429245[_0x04c2('0x1a')][_0x04c2('0x7c')]='reject';_0x429245[_0x04c2('0x1a')]['body']=htmlToText[_0x04c2('0x86')](_0x1e1315[_0x04c2('0x1a')][_0x04c2('0x48')]);respondWithRpcPromise('EventManager',_0x04c2('0x7d'),{'event':_0x04c2('0x87'),'message':_0x429245[_0x04c2('0x1a')]},client9002);return _0x1e1315;}return null;})[_0x04c2('0x14')](respondWithResult(_0x53dfc6,null))['catch'](handleError(_0x53dfc6,null));};exports[_0x04c2('0x88')]=function(_0x31d297,_0x3a811c){var _0x3c96ae=moment()[_0x04c2('0x89')]()[_0x04c2('0x8a')]();var _0x25ada7=path[_0x04c2('0x8b')](config['root'],_0x04c2('0x8c'),_0x04c2('0x8d'),_0x04c2('0x8e'));var _0x281e7a=path[_0x04c2('0x8b')](config[_0x04c2('0x57')],'server','files','attachments');var _0x8cb090=util[_0x04c2('0x5f')](_0x04c2('0x8f'),_0x3c96ae);return db[_0x04c2('0x2b')][_0x04c2('0x45')]({'where':{'id':_0x31d297['params']['id']},'attributes':['id',_0x04c2('0x48'),_0x04c2('0x90'),'to','cc',_0x04c2('0x91'),'subject',_0x04c2('0x92')],'include':_0x31d297[_0x04c2('0x30')]['attachments']?[{'model':db[_0x04c2('0x93')],'as':_0x04c2('0x94')}]:undefined})['then'](handleEntityNotFound(_0x3a811c,null))['then'](function(_0x272951){if(_0x272951){var _0x5d2af4=_0x272951;var _0x3aa4ec={'from':_0x5d2af4['from'],'to':_0x5d2af4['to'],'subject':_0x5d2af4['subject'],'html':htmlEntities['decode'](_0x5d2af4['body']),'headers':{'Date':moment(_0x5d2af4['createdAt'])[_0x04c2('0x5f')](_0x04c2('0x95'))},'attachments':[]};if(_0x272951['cc']){_0x3aa4ec[_0x04c2('0x96')]['Cc']=_0x272951['cc'];}if(_0x272951[_0x04c2('0x91')]){_0x3aa4ec['headers']['Bcc']=_0x272951[_0x04c2('0x91')];}return new BPromise(function(_0x1b4710,_0x19ee86){if(_0x272951['Attachments']){for(var _0x5f5962=0x0;_0x5f5962<_0x272951[_0x04c2('0x94')][_0x04c2('0x35')];_0x5f5962++){var _0x3839d0=_0x272951[_0x04c2('0x94')][_0x5f5962];var _0x5b7217=path['join'](_0x281e7a,_0x3839d0[_0x04c2('0x97')]);if(fs['existsSync'](_0x5b7217)){_0x3aa4ec[_0x04c2('0x56')]['push']({'name':_0x3839d0[_0x04c2('0x27')],'contentType':_0x3839d0[_0x04c2('0x2d')],'data':fs['readFileSync'](_0x5b7217)});}}}emlformat[_0x04c2('0x98')](_0x3aa4ec,function(_0x4cb8a7,_0x1edf54){if(_0x4cb8a7)return _0x19ee86(_0x4cb8a7);fs[_0x04c2('0x99')](path[_0x04c2('0x8b')](_0x25ada7,_0x8cb090),_0x1edf54);return _0x1b4710(_0x1edf54);});});}})[_0x04c2('0x14')](function(_0x26e3bb){if(_0x26e3bb){return _0x3a811c['download'](path[_0x04c2('0x8b')](_0x25ada7,_0x8cb090),_0x8cb090,function(_0xe4d51c){if(!_0xe4d51c)fs['unlinkSync'](path[_0x04c2('0x8b')](_0x25ada7,_0x8cb090));});}})['catch'](handleError(_0x3a811c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d81ff03..511280c 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 _0xd5c8=['save','remove','emit','hook','exports','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd5c8,0x19d));var _0x8d5c=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0xd5c8[_0x562faf];return _0x22c1f6;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x8d5c('0x0'))['db'][_0x8d5c('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8d5c('0x2')](0x0);var events={'afterCreate':_0x8d5c('0x3'),'afterUpdate':'update','afterDestroy':_0x8d5c('0x4')};function emitEvent(_0x2c150d){return function(_0x5e98a9,_0x451ce7,_0x3630e2){MailMessageEvents['emit'](_0x2c150d+':'+_0x5e98a9['id'],_0x5e98a9);MailMessageEvents[_0x8d5c('0x5')](_0x2c150d,_0x5e98a9);_0x3630e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x8d5c('0x6')](e,emitEvent(event));}}module[_0x8d5c('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x3edb=['events','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x44c8be,_0x3fb5a5){var _0x576851=function(_0x4c4ce9){while(--_0x4c4ce9){_0x44c8be['push'](_0x44c8be['shift']());}};_0x576851(++_0x3fb5a5);}(_0x3edb,0x19d));var _0xb3ed=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x3edb[_0x29b609];return _0x54c952;};'use strict';var EventEmitter=require(_0xb3ed('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb3ed('0x1'),'afterDestroy':_0xb3ed('0x2')};function emitEvent(_0xd87711){return function(_0x68366f,_0x2b7f0a,_0x1450b0){MailMessageEvents[_0xb3ed('0x3')](_0xd87711+':'+_0x68366f['id'],_0x68366f);MailMessageEvents[_0xb3ed('0x3')](_0xd87711,_0x68366f);_0x1450b0(null);};}for(var e in events){if(events[_0xb3ed('0x4')](e)){var event=events[e];MailMessage[_0xb3ed('0x5')](e,emitEvent(event));}}module[_0xb3ed('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index f6c81c8..2b09c2c 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 _0x5c6e=['UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','html-to-text','../../config/environment','./mailMessage.attributes','mail_messages','messageId','fti_mail_messages','FULLTEXT','body','models','get','direction','toLowerCase','out'];(function(_0x3e199b,_0x3148ff){var _0x15ea7c=function(_0x5dac5e){while(--_0x5dac5e){_0x3e199b['push'](_0x3e199b['shift']());}};_0x15ea7c(++_0x3148ff);}(_0x5c6e,0x110));var _0xe5c6=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x5c6e[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0xe5c6('0x0'));var util=require(_0xe5c6('0x1'));var logger=require('../../config/logger')(_0xe5c6('0x2'));var moment=require(_0xe5c6('0x3'));var BPromise=require('bluebird');var rp=require(_0xe5c6('0x4'));var htmlToText=require(_0xe5c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe5c6('0x6'));var attributes=require(_0xe5c6('0x7'));module['exports']=function(_0x1a4999,_0x1cdd0a){return _0x1a4999['define']('MailMessage',attributes,{'tableName':_0xe5c6('0x8'),'paranoid':![],'indexes':[{'name':_0xe5c6('0x9'),'fields':[_0xe5c6('0x9')]},{'name':_0xe5c6('0xa'),'fields':['plainBody','subject'],'type':_0xe5c6('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x375c17,_0x56efb8,_0x10f67d){if(_0x375c17['body']){_0x375c17['plainBody']=htmlToText['fromString'](_0x375c17[_0xe5c6('0xc')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x10f67d(null,_0x56efb8);},'afterCreate':function(_0x43d589,_0x1017fd,_0x7061a2){var _0xed61e9=_0x1a4999[_0xe5c6('0xd')];var _0x4724e7=_0x43d589[_0xe5c6('0xe')]({'plain':!![]});if(_0x4724e7[_0xe5c6('0xf')]['toLowerCase']()==='in'||_0x4724e7[_0xe5c6('0xf')][_0xe5c6('0x10')]()===_0xe5c6('0x11')&&!_0x4724e7['secret']&&!_['isNil'](_0x4724e7[_0xe5c6('0x12')])){_0xed61e9[_0xe5c6('0x13')][_0xe5c6('0x14')]({'where':{'id':_0x4724e7[_0xe5c6('0x15')]}})[_0xe5c6('0x16')](function(_0x5efe71){if(_0x5efe71){_0x5efe71[_0xe5c6('0x17')]({'lastMsgAt':_0x4724e7[_0xe5c6('0x18')],'lastMsgDirection':_0x4724e7['direction']['toLowerCase']()});}})[_0xe5c6('0x19')](function(_0x25115f){console[_0xe5c6('0x1a')](_0x25115f);});}_0x7061a2();}},'charset':_0xe5c6('0x1b'),'collate':_0xe5c6('0x1c')});}; \ No newline at end of file +var _0x0aaa=['FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','mail_messages','messageId','plainBody','subject'];(function(_0x1f62a4,_0x47437a){var _0x2a99e2=function(_0x233a94){while(--_0x233a94){_0x1f62a4['push'](_0x1f62a4['shift']());}};_0x2a99e2(++_0x47437a);}(_0x0aaa,0x12b));var _0xa0aa=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x0aaa[_0x59befa];return _0x1dd63d;};'use strict';var _=require(_0xa0aa('0x0'));var util=require(_0xa0aa('0x1'));var logger=require(_0xa0aa('0x2'))(_0xa0aa('0x3'));var moment=require('moment');var BPromise=require(_0xa0aa('0x4'));var rp=require(_0xa0aa('0x5'));var htmlToText=require(_0xa0aa('0x6'));var fs=require('fs');var path=require(_0xa0aa('0x7'));var rimraf=require(_0xa0aa('0x8'));var config=require(_0xa0aa('0x9'));var attributes=require(_0xa0aa('0xa'));module[_0xa0aa('0xb')]=function(_0x4e2021,_0x5ed684){return _0x4e2021['define']('MailMessage',attributes,{'tableName':_0xa0aa('0xc'),'paranoid':![],'indexes':[{'name':_0xa0aa('0xd'),'fields':[_0xa0aa('0xd')]},{'name':'fti_mail_messages','fields':[_0xa0aa('0xe'),_0xa0aa('0xf')],'type':_0xa0aa('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1aa0d3,_0x1b09ed,_0x12a2ea){if(_0x1aa0d3[_0xa0aa('0x11')]){_0x1aa0d3['plainBody']=htmlToText[_0xa0aa('0x12')](_0x1aa0d3[_0xa0aa('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x12a2ea(null,_0x1b09ed);},'afterCreate':function(_0x33021f,_0x1a1a13,_0x11bf3b){var _0x5cdd3f=_0x4e2021[_0xa0aa('0x13')];var _0xd48ef8=_0x33021f[_0xa0aa('0x14')]({'plain':!![]});if(_0xd48ef8[_0xa0aa('0x15')][_0xa0aa('0x16')]()==='in'||_0xd48ef8[_0xa0aa('0x15')][_0xa0aa('0x16')]()===_0xa0aa('0x17')&&!_0xd48ef8[_0xa0aa('0x18')]&&!_[_0xa0aa('0x19')](_0xd48ef8[_0xa0aa('0x1a')])){_0x5cdd3f[_0xa0aa('0x1b')]['findOne']({'where':{'id':_0xd48ef8[_0xa0aa('0x1c')]}})[_0xa0aa('0x1d')](function(_0x1f1ea7){if(_0x1f1ea7){_0x1f1ea7[_0xa0aa('0x1e')]({'lastMsgAt':_0xd48ef8[_0xa0aa('0x1f')],'lastMsgDirection':_0xd48ef8[_0xa0aa('0x15')][_0xa0aa('0x16')]()});}})[_0xa0aa('0x20')](function(_0x1df9b0){console[_0xa0aa('0x21')](_0x1df9b0);});}_0x11bf3b();}},'charset':'utf8mb4','collate':_0xa0aa('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 3082e01..90eb4e7 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 _0x1399=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','body','options','raw','debug','stringify'];(function(_0x2bc326,_0x473cf8){var _0x43722e=function(_0x4dd559){while(--_0x4dd559){_0x2bc326['push'](_0x2bc326['shift']());}};_0x43722e(++_0x473cf8);}(_0x1399,0x16c));var _0x9139=function(_0x222711,_0x555389){_0x222711=_0x222711-0x0;var _0x112699=_0x1399[_0x222711];return _0x112699;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});config[_0x9139('0xa')]=_[_0x9139('0xb')](config['redis'],{'host':_0x9139('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9139('0xd'))[_0x9139('0xe')](socket);function respondWithRpcPromise(_0x4830cd,_0x315de8,_0x1bfa6b){return new BPromise(function(_0x5c90eb,_0x4f7f3a){return client[_0x9139('0xf')](_0x4830cd,_0x1bfa6b)[_0x9139('0x10')](function(_0x23357c){logger[_0x9139('0x11')](_0x9139('0x12'),_0x315de8,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'),JSON['stringify'](_0x23357c));if(_0x23357c[_0x9139('0x14')]){if(_0x23357c[_0x9139('0x14')][_0x9139('0x15')]===0x1f4){logger[_0x9139('0x14')]('MailMessage,\x20%s,\x20%s',_0x315de8,_0x23357c[_0x9139('0x14')]['message']);return _0x4f7f3a(_0x23357c['error']['message']);}logger[_0x9139('0x14')](_0x9139('0x12'),_0x315de8,_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);return _0x5c90eb(_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'));_0x5c90eb(_0x23357c[_0x9139('0x17')]['message']);}})['catch'](function(_0x30a363){logger[_0x9139('0x14')]('MailMessage,\x20%s,\x20%s',_0x315de8,_0x30a363);_0x4f7f3a(_0x30a363);});});}exports[_0x9139('0x18')]=function(_0x1ef57b){var _0x1a592e=this;return new Promise(function(_0x3c8296,_0xd2eb33){return db[_0x9139('0x19')][_0x9139('0x1a')](_0x1ef57b[_0x9139('0x1b')],{'raw':_0x1ef57b[_0x9139('0x1c')]?_0x1ef57b[_0x9139('0x1c')][_0x9139('0x1d')]===undefined?!![]:![]:!![]})[_0x9139('0x10')](function(_0x5a3e2e){logger[_0x9139('0x11')](_0x9139('0x18'),_0x1ef57b);logger[_0x9139('0x1e')](_0x9139('0x18'),_0x1ef57b,JSON[_0x9139('0x1f')](_0x5a3e2e));_0x3c8296(_0x5a3e2e);})[_0x9139('0x20')](function(_0x4b7fe0){logger[_0x9139('0x14')](_0x9139('0x18'),_0x4b7fe0['message'],_0x1ef57b);_0xd2eb33(_0x1a592e[_0x9139('0x14')](0x1f4,_0x4b7fe0[_0x9139('0x16')]));});});}; \ No newline at end of file +var _0x0972=['message','catch','CreateMailMessage','MailMessage','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5f27e8,_0xebeec){var _0x5dc1b1=function(_0x1cfb3c){while(--_0x1cfb3c){_0x5f27e8['push'](_0x5f27e8['shift']());}};_0x5dc1b1(++_0xebeec);}(_0x0972,0x64));var _0x2097=function(_0x20ae18,_0x562b61){_0x20ae18=_0x20ae18-0x0;var _0x3d82a6=_0x0972[_0x20ae18];return _0x3d82a6;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});config[_0x2097('0xa')]=_['defaults'](config[_0x2097('0xa')],{'host':_0x2097('0xb'),'port':0x18eb});var socket=require(_0x2097('0xc'))(new Redis(config[_0x2097('0xa')]));require(_0x2097('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e0024,_0x3b8b76,_0x131f06){return new BPromise(function(_0x430754,_0x7baeb3){return client[_0x2097('0xe')](_0x2e0024,_0x131f06)[_0x2097('0xf')](function(_0x1d1166){logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));logger[_0x2097('0x13')](_0x2097('0x14'),_0x3b8b76,_0x2097('0x12'),JSON[_0x2097('0x15')](_0x1d1166));if(_0x1d1166[_0x2097('0x16')]){if(_0x1d1166[_0x2097('0x16')][_0x2097('0x17')]===0x1f4){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x1d1166['error'][_0x2097('0x18')]);return _0x7baeb3(_0x1d1166[_0x2097('0x16')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3b8b76,_0x1d1166[_0x2097('0x16')]['message']);return _0x430754(_0x1d1166[_0x2097('0x16')][_0x2097('0x18')]);}else{logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));_0x430754(_0x1d1166['result'][_0x2097('0x18')]);}})[_0x2097('0x19')](function(_0x451584){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x451584);_0x7baeb3(_0x451584);});});}exports[_0x2097('0x1a')]=function(_0x253f5d){var _0x46b5e0=this;return new Promise(function(_0x5d8b9e,_0x4d957e){return db[_0x2097('0x1b')]['create'](_0x253f5d[_0x2097('0x1c')],{'raw':_0x253f5d[_0x2097('0x1d')]?_0x253f5d['options'][_0x2097('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x2e17c8){logger[_0x2097('0x10')](_0x2097('0x1a'),_0x253f5d);logger[_0x2097('0x13')](_0x2097('0x1a'),_0x253f5d,JSON[_0x2097('0x15')](_0x2e17c8));_0x5d8b9e(_0x2e17c8);})['catch'](function(_0xae5f9){logger['error'](_0x2097('0x1a'),_0xae5f9[_0x2097('0x18')],_0x253f5d);_0x4d957e(_0x46b5e0[_0x2097('0x16')](0x1f4,_0xae5f9[_0x2097('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 1a116f4..8f4ef97 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 _0xc305=['removeListener','length','mailMessage:','./mailMessage.events','update','emit'];(function(_0x2b713c,_0x1a5f8e){var _0x2f0170=function(_0x3ed881){while(--_0x3ed881){_0x2b713c['push'](_0x2b713c['shift']());}};_0x2f0170(++_0x1a5f8e);}(_0xc305,0xcf));var _0x5c30=function(_0x1f62c3,_0x1ff95b){_0x1f62c3=_0x1f62c3-0x0;var _0x385c1c=_0xc305[_0x1f62c3];return _0x385c1c;};'use strict';var MailMessageEvents=require(_0x5c30('0x0'));var events=['save','remove',_0x5c30('0x1')];function createListener(_0x200645,_0x5b6fbc){return function(_0x330e4b){_0x5b6fbc[_0x5c30('0x2')](_0x200645,_0x330e4b);};}function removeListener(_0x388cc5,_0x19b07c){return function(){MailMessageEvents[_0x5c30('0x3')](_0x388cc5,_0x19b07c);};}exports['register']=function(_0x311c48){for(var _0x295b5b=0x0,_0x175135=events[_0x5c30('0x4')];_0x295b5b<_0x175135;_0x295b5b++){var _0x3d6598=events[_0x295b5b];var _0x1d6f15=createListener(_0x5c30('0x5')+_0x3d6598,_0x311c48);MailMessageEvents['on'](_0x3d6598,_0x1d6f15);}}; \ No newline at end of file +var _0x1347=['emit','register','length','mailMessage:','save','remove'];(function(_0xb126fd,_0x5d4512){var _0x3da326=function(_0xcbfd90){while(--_0xcbfd90){_0xb126fd['push'](_0xb126fd['shift']());}};_0x3da326(++_0x5d4512);}(_0x1347,0xd0));var _0x7134=function(_0x2aad02,_0x556ae7){_0x2aad02=_0x2aad02-0x0;var _0x546e5b=_0x1347[_0x2aad02];return _0x546e5b;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x7134('0x0'),_0x7134('0x1'),'update'];function createListener(_0x3e2f6d,_0x43e64d){return function(_0x4e034c){_0x43e64d[_0x7134('0x2')](_0x3e2f6d,_0x4e034c);};}function removeListener(_0x40101e,_0x5593c6){return function(){MailMessageEvents['removeListener'](_0x40101e,_0x5593c6);};}exports[_0x7134('0x3')]=function(_0x59ea30){for(var _0x334b27=0x0,_0x264568=events[_0x7134('0x4')];_0x334b27<_0x264568;_0x334b27++){var _0x75a791=events[_0x334b27];var _0x2dcb83=createListener(_0x7134('0x5')+_0x75a791,_0x59ea30);MailMessageEvents['on'](_0x75a791,_0x2dcb83);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index f9c3d77..a1071ae 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 _0xa8f7=['removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','show','getMembers','/:id/teams','create','post','addAgents','put','/:id','update','destroy','delete','/:id/users'];(function(_0x462f2b,_0x337220){var _0x1308e7=function(_0x5e8a02){while(--_0x5e8a02){_0x462f2b['push'](_0x462f2b['shift']());}};_0x1308e7(++_0x337220);}(_0xa8f7,0x11a));var _0x7a8f=function(_0x164621,_0xe6a879){_0x164621=_0x164621-0x0;var _0x4132e9=_0xa8f7[_0x164621];return _0x4132e9;};'use strict';var multer=require('multer');var util=require(_0x7a8f('0x0'));var path=require(_0x7a8f('0x1'));var timeout=require(_0x7a8f('0x2'));var express=require(_0x7a8f('0x3'));var router=express[_0x7a8f('0x4')]();var fs_extra=require(_0x7a8f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7a8f('0x6'));var config=require(_0x7a8f('0x7'));var controller=require(_0x7a8f('0x8'));router[_0x7a8f('0x9')]('/',auth['isAuthenticated'](),controller[_0x7a8f('0xa')]);router[_0x7a8f('0x9')](_0x7a8f('0xb'),auth[_0x7a8f('0xc')](),controller[_0x7a8f('0xd')]);router[_0x7a8f('0x9')]('/:id',auth[_0x7a8f('0xc')](),controller[_0x7a8f('0xe')]);router[_0x7a8f('0x9')]('/:id/members',auth[_0x7a8f('0xc')](),controller[_0x7a8f('0xf')]);router[_0x7a8f('0x9')](_0x7a8f('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0x7a8f('0x9')]('/:id/users',auth[_0x7a8f('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7a8f('0x11')]);router[_0x7a8f('0x12')](_0x7a8f('0x10'),auth[_0x7a8f('0xc')](),controller['addTeams']);router[_0x7a8f('0x12')]('/:id/users',auth[_0x7a8f('0xc')](),controller[_0x7a8f('0x13')]);router[_0x7a8f('0x14')](_0x7a8f('0x15'),auth['isAuthenticated'](),controller[_0x7a8f('0x16')]);router['delete'](_0x7a8f('0x15'),auth[_0x7a8f('0xc')](),controller[_0x7a8f('0x17')]);router[_0x7a8f('0x18')]('/:id/teams',auth[_0x7a8f('0xc')](),controller['removeTeams']);router['delete'](_0x7a8f('0x19'),auth['isAuthenticated'](),controller[_0x7a8f('0x1a')]);module[_0x7a8f('0x1b')]=router; \ No newline at end of file +var _0xd641=['/:id/users','getAgents','create','addTeams','post','delete','destroy','removeTeams','removeAgents','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd641,0x141));var _0x1d64=function(_0x546f7b,_0x9f64b9){_0x546f7b=_0x546f7b-0x0;var _0x43efe9=_0xd641[_0x546f7b];return _0x43efe9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1d64('0x0'));var express=require(_0x1d64('0x1'));var router=express['Router']();var fs_extra=require(_0x1d64('0x2'));var auth=require(_0x1d64('0x3'));var interaction=require(_0x1d64('0x4'));var config=require('../../config/environment');var controller=require(_0x1d64('0x5'));router[_0x1d64('0x6')]('/',auth[_0x1d64('0x7')](),controller[_0x1d64('0x8')]);router[_0x1d64('0x6')](_0x1d64('0x9'),auth[_0x1d64('0x7')](),controller[_0x1d64('0xa')]);router['get'](_0x1d64('0xb'),auth['isAuthenticated'](),controller[_0x1d64('0xc')]);router[_0x1d64('0x6')](_0x1d64('0xd'),auth[_0x1d64('0x7')](),controller[_0x1d64('0xe')]);router[_0x1d64('0x6')](_0x1d64('0xf'),auth['isAuthenticated'](),controller[_0x1d64('0x10')]);router[_0x1d64('0x6')](_0x1d64('0x11'),auth[_0x1d64('0x7')](),controller[_0x1d64('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d64('0x13')]);router['post']('/:id/teams',auth[_0x1d64('0x7')](),controller[_0x1d64('0x14')]);router[_0x1d64('0x15')](_0x1d64('0x11'),auth[_0x1d64('0x7')](),controller['addAgents']);router['put'](_0x1d64('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1d64('0x16')](_0x1d64('0xb'),auth[_0x1d64('0x7')](),controller[_0x1d64('0x17')]);router[_0x1d64('0x16')](_0x1d64('0xf'),auth[_0x1d64('0x7')](),controller[_0x1d64('0x18')]);router['delete'](_0x1d64('0x11'),auth['isAuthenticated'](),controller[_0x1d64('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 5eec33c..917b54c 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 _0x50e8=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x5e2a2d,_0x3fd79f){var _0x352a1a=function(_0x20b308){while(--_0x20b308){_0x5e2a2d['push'](_0x5e2a2d['shift']());}};_0x352a1a(++_0x3fd79f);}(_0x50e8,0x11f));var _0x850e=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x50e8[_0x267c52];return _0x46c47b;};'use strict';var Sequelize=require(_0x850e('0x0'));module[_0x850e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x850e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x850e('0x3')]},'timeout':{'type':Sequelize[_0x850e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x850e('0x5')](_0x850e('0x6'),_0x850e('0x7'),_0x850e('0x8'))}}; \ No newline at end of file +var _0x2956=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x369a18,_0x303e7c){var _0x19f2ae=function(_0x3b547d){while(--_0x3b547d){_0x369a18['push'](_0x369a18['shift']());}};_0x19f2ae(++_0x303e7c);}(_0x2956,0xa2));var _0x6295=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0x2956[_0x1dd532];return _0x3732aa;};'use strict';var Sequelize=require(_0x6295('0x0'));module[_0x6295('0x1')]={'name':{'type':Sequelize[_0x6295('0x2')],'unique':_0x6295('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6295('0x2')]},'timeout':{'type':Sequelize[_0x6295('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6295('0x5')](_0x6295('0x6'),'beepall',_0x6295('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 28a40f9..4513c52 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 _0x470f=['rawAttributes','length','getTeams','addTeams','ids','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','lodash','squel','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','MailQueues','destroy','error','stack','name','send','index','map','MailQueue','fieldName','type','key','getOptions','where','include','query','rows','catch','show','params','model','filters','attributes','fields','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','keys','UserMailQueue','intersection','hasOwnProperty','nolimit','order','sort','pick','MailQueueId','filter','merge','findAll','User','findAndCountAll','UserId','agent','mailPause','createdAt','%s/%s','SIP','updatedAt','Team'];(function(_0x266294,_0x4abaee){var _0x1d1ac2=function(_0xfe909d){while(--_0xfe909d){_0x266294['push'](_0x266294['shift']());}};_0x1d1ac2(++_0x4abaee);}(_0x470f,0x193));var _0xf470=function(_0xa0c9a4,_0x2299cd){_0xa0c9a4=_0xa0c9a4-0x0;var _0x4d6c9e=_0x470f[_0xa0c9a4];return _0x4d6c9e;};'use strict';var BPromise=require(_0xf470('0x0'));var util=require('util');var _=require(_0xf470('0x1'));var squel=require(_0xf470('0x2'));var Redis=require(_0xf470('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xf470('0x4'))(_0xf470('0x5'));var config=require(_0xf470('0x6'));var db=require('../../mysqldb')['db'];config[_0xf470('0x7')]=_[_0xf470('0x8')](config[_0xf470('0x7')],{'host':_0xf470('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')[_0xf470('0xa')](socket);function respondWithStatusCode(_0x359039,_0x3b3625){_0x3b3625=_0x3b3625||0xcc;return function(_0x39c727){if(_0x39c727){return _0x359039[_0xf470('0xb')](_0x3b3625);}return _0x359039['status'](_0x3b3625)[_0xf470('0xc')]();};}function respondWithResult(_0x468bdf,_0x5a38be){_0x5a38be=_0x5a38be||0xc8;return function(_0x3b197b){if(_0x3b197b){return _0x468bdf[_0xf470('0xd')](_0x5a38be)[_0xf470('0xe')](_0x3b197b);}};}function respondWithFilteredResult(_0x48b9b9,_0x113592){return function(_0x2b388b){if(_0x2b388b){var _0xb1d08d=typeof _0x113592[_0xf470('0xf')]==='undefined'&&typeof _0x113592['limit']===_0xf470('0x10');var _0xd1b4a4=_0x2b388b['count'];var _0x17050e=_0xb1d08d?0x0:_0x113592['offset'];var _0x29c0bd=_0xb1d08d?_0x2b388b[_0xf470('0x11')]:_0x113592[_0xf470('0xf')]+_0x113592[_0xf470('0x12')];var _0x4c04b3;if(_0x29c0bd>=_0xd1b4a4){_0x29c0bd=_0xd1b4a4;_0x4c04b3=0xc8;}else{_0x4c04b3=0xce;}_0x48b9b9['status'](_0x4c04b3);return _0x48b9b9[_0xf470('0x13')](_0xf470('0x14'),_0x17050e+'-'+_0x29c0bd+'/'+_0xd1b4a4)['json'](_0x2b388b);}return null;};}function saveUpdates(_0x59f353){return function(_0x2e2317){if(_0x2e2317){return _0x2e2317[_0xf470('0x15')](_0x59f353)['then'](function(_0x3d17bd){return _0x3d17bd;});}return null;};}function removeEntity(_0x4c25d1){return function(_0x14f0cc){if(_0x14f0cc){return _0x14f0cc['destroy']()[_0xf470('0x16')](function(){var _0x14caab=_0x14f0cc[_0xf470('0x17')]({'plain':!![]});var _0xee43f7=_0xf470('0x18');return db['UserProfileResource'][_0xf470('0x19')]({'where':{'type':_0xee43f7,'resourceId':_0x14caab['id']}})[_0xf470('0x16')](function(){return _0x14f0cc;});})[_0xf470('0x16')](function(){_0x4c25d1['status'](0xcc)[_0xf470('0xc')]();});}};}function handleEntityNotFound(_0x23e447){return function(_0xb328ed){if(!_0xb328ed){_0x23e447[_0xf470('0xb')](0x194);}return _0xb328ed;};}function handleError(_0x5b7786,_0x110d4a){_0x110d4a=_0x110d4a||0x1f4;return function(_0x306277){logger[_0xf470('0x1a')](_0x306277[_0xf470('0x1b')]);if(_0x306277[_0xf470('0x1c')]){delete _0x306277[_0xf470('0x1c')];}_0x5b7786['status'](_0x110d4a)[_0xf470('0x1d')](_0x306277);};}exports[_0xf470('0x1e')]=function(_0x3cd1d2,_0x215658){var _0x4046c5={};var _0x11ab80={'count':0x0,'rows':[]};var _0x1de190=_[_0xf470('0x1f')](db[_0xf470('0x20')]['rawAttributes'],function(_0x1d13d9){return{'name':_0x1d13d9[_0xf470('0x21')],'type':_0x1d13d9[_0xf470('0x22')][_0xf470('0x23')]};});_0x4046c5=qs[_0xf470('0x24')](_0x1de190,_0x3cd1d2);var _0x48e5d4={'where':_0x4046c5[_0xf470('0x25')]};return db[_0xf470('0x20')]['count'](_0x48e5d4)[_0xf470('0x16')](function(_0x30ec24){_0x11ab80[_0xf470('0x11')]=_0x30ec24;_0x4046c5[_0xf470('0x26')]=qs[_0xf470('0x26')](_0x3cd1d2[_0xf470('0x27')]);return db['MailQueue']['findAll'](_0x4046c5);})[_0xf470('0x16')](function(_0x4cd027){_0x11ab80[_0xf470('0x28')]=_0x4cd027;return _0x11ab80;})['then'](respondWithFilteredResult(_0x215658,_0x4046c5))[_0xf470('0x29')](handleError(_0x215658,null));};exports[_0xf470('0x2a')]=function(_0x440cda,_0x8cfe54){var _0x47314d={'raw':!![],'where':{'id':_0x440cda[_0xf470('0x2b')]['id']}},_0x214338={};_0x214338[_0xf470('0x2c')]=_['keys'](db['MailQueue']['rawAttributes']);_0x214338[_0xf470('0x27')]=_['keys'](_0x440cda[_0xf470('0x27')]);_0x214338[_0xf470('0x2d')]=_['intersection'](_0x214338[_0xf470('0x2c')],_0x214338[_0xf470('0x27')]);_0x47314d[_0xf470('0x2e')]=_['intersection'](_0x214338[_0xf470('0x2c')],qs[_0xf470('0x2f')](_0x440cda[_0xf470('0x27')]['fields']));_0x47314d[_0xf470('0x2e')]=_0x47314d['attributes']['length']?_0x47314d['attributes']:_0x214338[_0xf470('0x2c')];if(_0x440cda[_0xf470('0x27')][_0xf470('0x30')]){_0x47314d[_0xf470('0x26')]=[{'all':!![]}];}_0x47314d=_['merge']({},_0x47314d,_0x440cda[_0xf470('0x31')]);return db[_0xf470('0x20')][_0xf470('0x32')](_0x47314d)[_0xf470('0x16')](handleEntityNotFound(_0x8cfe54,null))['then'](respondWithResult(_0x8cfe54,null))[_0xf470('0x29')](handleError(_0x8cfe54,null));};exports['create']=function(_0x5e6d65,_0x401faf){return db[_0xf470('0x20')][_0xf470('0x33')](_0x5e6d65[_0xf470('0x34')],{})[_0xf470('0x16')](function(_0x4f9960){var _0x1dc0ef=_0x5e6d65[_0xf470('0x35')][_0xf470('0x17')]({'plain':!![]});if(!_0x1dc0ef)throw new Error(_0xf470('0x36'));if(_0x1dc0ef[_0xf470('0x37')]===_0xf470('0x35')){var _0x5a3063=_0x4f9960[_0xf470('0x17')]({'plain':!![]});var _0xf94d2d=_0xf470('0x18');return db[_0xf470('0x38')][_0xf470('0x32')]({'where':{'name':_0xf94d2d,'userProfileId':_0x1dc0ef[_0xf470('0x39')]},'raw':!![]})[_0xf470('0x16')](function(_0x138ab4){if(_0x138ab4&&_0x138ab4['autoAssociation']===0x0){return db[_0xf470('0x3a')][_0xf470('0x33')]({'name':_0x5a3063[_0xf470('0x1c')],'resourceId':_0x5a3063['id'],'type':_0x138ab4[_0xf470('0x1c')],'sectionId':_0x138ab4['id']},{})[_0xf470('0x16')](function(){return _0x4f9960;});}else{return _0x4f9960;}})[_0xf470('0x29')](function(_0x4e02e3){logger[_0xf470('0x1a')](_0xf470('0x3b'),_0x4e02e3);throw _0x4e02e3;});}return _0x4f9960;})[_0xf470('0x16')](respondWithResult(_0x401faf,0xc9))['catch'](handleError(_0x401faf,null));};exports[_0xf470('0x15')]=function(_0x2a4ead,_0x5d1896){if(_0x2a4ead[_0xf470('0x34')]['id']){delete _0x2a4ead[_0xf470('0x34')]['id'];}return db[_0xf470('0x20')][_0xf470('0x32')]({'where':{'id':_0x2a4ead[_0xf470('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5d1896,null))[_0xf470('0x16')](saveUpdates(_0x2a4ead[_0xf470('0x34')],null))[_0xf470('0x16')](respondWithResult(_0x5d1896,null))[_0xf470('0x29')](handleError(_0x5d1896,null));};exports['destroy']=function(_0x67897d,_0x56be18){return db[_0xf470('0x20')]['find']({'where':{'id':_0x67897d[_0xf470('0x2b')]['id']}})['then'](handleEntityNotFound(_0x56be18,null))[_0xf470('0x16')](removeEntity(_0x56be18,null))['catch'](handleError(_0x56be18,null));};exports[_0xf470('0x3c')]=function(_0x1f63ae,_0x2abc9e){return db[_0xf470('0x20')][_0xf470('0x3c')]()[_0xf470('0x16')](respondWithResult(_0x2abc9e,null))[_0xf470('0x29')](handleError(_0x2abc9e,null));};exports[_0xf470('0x3d')]=function(_0x1c7ded,_0x9f3ce2){var _0x5c605d={'raw':!![],'where':{}},_0x2f75bf={},_0x6f2a46;return db[_0xf470('0x20')][_0xf470('0x3e')]({'where':{'id':_0x1c7ded[_0xf470('0x2b')]['id']}})[_0xf470('0x16')](handleEntityNotFound(_0x9f3ce2,null))['then'](function(_0x50c5c0){if(_0x50c5c0){_0x6f2a46=_0x50c5c0[_0xf470('0x17')]({'plain':!![]});_0x2f75bf[_0xf470('0x2c')]=_[_0xf470('0x3f')](db[_0xf470('0x40')]['rawAttributes']);_0x2f75bf[_0xf470('0x27')]=_[_0xf470('0x3f')](_0x1c7ded['query']);_0x2f75bf['filters']=_[_0xf470('0x41')](_0x2f75bf['model'],_0x2f75bf[_0xf470('0x27')]);_0x5c605d[_0xf470('0x2e')]=_['intersection'](_0x2f75bf[_0xf470('0x2c')],qs[_0xf470('0x2f')](_0x1c7ded[_0xf470('0x27')][_0xf470('0x2f')]));_0x5c605d[_0xf470('0x2e')]=_0x5c605d['attributes']['length']?_0x5c605d[_0xf470('0x2e')]:_0x2f75bf[_0xf470('0x2c')];if(!_0x1c7ded[_0xf470('0x27')][_0xf470('0x42')](_0xf470('0x43'))){_0x5c605d['limit']=qs[_0xf470('0x12')](_0x1c7ded[_0xf470('0x27')][_0xf470('0x12')]);_0x5c605d['offset']=qs[_0xf470('0xf')](_0x1c7ded['query'][_0xf470('0xf')]);}_0x5c605d[_0xf470('0x44')]=qs[_0xf470('0x45')](_0x1c7ded[_0xf470('0x27')][_0xf470('0x45')]);_0x5c605d[_0xf470('0x25')]=qs['filters'](_[_0xf470('0x46')](_0x1c7ded[_0xf470('0x27')],_0x2f75bf[_0xf470('0x2d')]));_0x5c605d[_0xf470('0x25')][_0xf470('0x47')]=_0x50c5c0['id'];if(_0x1c7ded[_0xf470('0x27')][_0xf470('0x48')]){_0x5c605d[_0xf470('0x25')]=_[_0xf470('0x49')](_0x5c605d[_0xf470('0x25')],{'$or':_[_0xf470('0x1f')](_0x5c605d[_0xf470('0x2e')],function(_0x1a44e7){var _0x30f8b9={};_0x30f8b9[_0x1a44e7]={'$like':'%'+_0x1c7ded[_0xf470('0x27')][_0xf470('0x48')]+'%'};return _0x30f8b9;})});}_0x5c605d=_[_0xf470('0x49')]({},_0x5c605d,_0x1c7ded[_0xf470('0x31')]);return db[_0xf470('0x40')][_0xf470('0x4a')](_0x5c605d);}})[_0xf470('0x16')](function(_0x26550a){if(_0x26550a){return db[_0xf470('0x4b')][_0xf470('0x4c')]({'where':{'id':_['map'](_0x26550a,_0xf470('0x4d')),'role':_0xf470('0x4e')},'attributes':['id',_0xf470('0x1c'),_0xf470('0x4f'),'updatedAt',_0xf470('0x50')]});}})[_0xf470('0x16')](function(_0xb8c7e0){if(_0xb8c7e0){return{'count':_0xb8c7e0[_0xf470('0x11')],'rows':_['map'](_0xb8c7e0['rows'],function(_0x4e5920){return{'membername':_0x4e5920[_0xf470('0x1c')],'UserId':_0x4e5920['id'],'queue_name':_0x6f2a46['name'],'MailQueueId':_0x6f2a46['id'],'interface':util['format'](_0xf470('0x51'),_0xf470('0x52'),_0x4e5920['name']),'penalty':0x0,'paused':_0x4e5920[_0xf470('0x4f')],'createdAt':_0x4e5920[_0xf470('0x50')],'updatedAt':_0x4e5920[_0xf470('0x53')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf470('0x16')](respondWithFilteredResult(_0x9f3ce2,_0x5c605d))[_0xf470('0x29')](handleError(_0x9f3ce2,null));};exports['getTeams']=function(_0x28f900,_0x5e7e5a){var _0x23c553={};var _0x197270={};var _0x54f4b6;var _0x3c8759;return db[_0xf470('0x20')][_0xf470('0x3e')]({'where':{'id':_0x28f900[_0xf470('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5e7e5a,null))['then'](function(_0x4a23a5){if(_0x4a23a5){_0x54f4b6=_0x4a23a5;_0x197270[_0xf470('0x2c')]=_[_0xf470('0x3f')](db[_0xf470('0x54')][_0xf470('0x55')]);_0x197270['query']=_['keys'](_0x28f900[_0xf470('0x27')]);_0x197270[_0xf470('0x2d')]=_[_0xf470('0x41')](_0x197270[_0xf470('0x2c')],_0x197270[_0xf470('0x27')]);_0x23c553['attributes']=_[_0xf470('0x41')](_0x197270[_0xf470('0x2c')],qs[_0xf470('0x2f')](_0x28f900[_0xf470('0x27')]['fields']));_0x23c553[_0xf470('0x2e')]=_0x23c553[_0xf470('0x2e')][_0xf470('0x56')]?_0x23c553[_0xf470('0x2e')]:_0x197270[_0xf470('0x2c')];_0x23c553[_0xf470('0x44')]=qs[_0xf470('0x45')](_0x28f900[_0xf470('0x27')][_0xf470('0x45')]);_0x23c553['where']=qs[_0xf470('0x2d')](_['pick'](_0x28f900[_0xf470('0x27')],_0x197270[_0xf470('0x2d')]));if(_0x28f900[_0xf470('0x27')][_0xf470('0x48')]){_0x23c553['where']=_[_0xf470('0x49')](_0x23c553[_0xf470('0x25')],{'$or':_['map'](_0x23c553['attributes'],function(_0x400712){var _0x4a444d={};_0x4a444d[_0x400712]={'$like':'%'+_0x28f900[_0xf470('0x27')]['filter']+'%'};return _0x4a444d;})});}_0x23c553=_[_0xf470('0x49')]({},_0x23c553,_0x28f900[_0xf470('0x31')]);return _0x54f4b6[_0xf470('0x57')](_0x23c553);}})[_0xf470('0x16')](function(_0xa738f1){if(_0xa738f1){_0x3c8759=_0xa738f1[_0xf470('0x56')];if(!_0x28f900[_0xf470('0x27')][_0xf470('0x42')](_0xf470('0x43'))){_0x23c553['limit']=qs[_0xf470('0x12')](_0x28f900[_0xf470('0x27')][_0xf470('0x12')]);_0x23c553[_0xf470('0xf')]=qs[_0xf470('0xf')](_0x28f900[_0xf470('0x27')][_0xf470('0xf')]);}return _0x54f4b6[_0xf470('0x57')](_0x23c553);}})[_0xf470('0x16')](function(_0x55e3eb){if(_0x55e3eb){return _0x55e3eb?{'count':_0x3c8759,'rows':_0x55e3eb}:null;}})[_0xf470('0x16')](respondWithResult(_0x5e7e5a,null))[_0xf470('0x29')](handleError(_0x5e7e5a,null));};exports[_0xf470('0x58')]=function(_0x3e91ca,_0x455a99){var _0x1c3228=_0x3e91ca['body'][_0xf470('0x59')];return db['Team'][_0xf470('0x4a')]({'where':{'id':_0x1c3228},'attributes':['id'],'include':[{'model':db[_0xf470('0x4b')],'as':'Agents','attributes':['id',_0xf470('0x1c'),'online','voicePause',_0xf470('0x5a')],'raw':!![]}]})[_0xf470('0x16')](function(_0x39cebb){if(_0x39cebb){var _0x4ca190=_[_0xf470('0x5b')](_0x39cebb,function(_0x8f0552){var _0x994d4=_0x8f0552[_0xf470('0x17')]({'plain':!![]});return _0x994d4[_0xf470('0x5c')];});return db[_0xf470('0x20')][_0xf470('0x32')]({'where':{'id':_0x3e91ca[_0xf470('0x2b')]['id']}})['then'](function(_0x54205e){return db[_0xf470('0x5d')][_0xf470('0x5e')](function(_0x4112e7){return _0x54205e[_0xf470('0x58')](_0x1c3228,{'transaction':_0x4112e7})[_0xf470('0x16')](function(){return BPromise[_0xf470('0x5f')](_0x4ca190,function(_0x3c413c){return db[_0xf470('0x40')][_0xf470('0x60')]({'where':{'UserId':_0x3c413c['id'],'MailQueueId':_0x3e91ca[_0xf470('0x2b')]['id']},'transaction':_0x4112e7});});})[_0xf470('0x16')](function(){_0x4ca190[_0xf470('0x61')](function(_0x25f142){socket[_0xf470('0x62')](_0xf470('0x63'),{'UserId':_0x25f142['id'],'MailQueueId':_0x54205e['id']});});});});});}})[_0xf470('0x16')](respondWithStatusCode(_0x455a99,null))[_0xf470('0x29')](handleError(_0x455a99,null));};exports['removeTeams']=function(_0x2ae843,_0x1e5229){return db['Team'][_0xf470('0x4a')]({'where':{'id':_0x2ae843[_0xf470('0x27')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf470('0x4b')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1e5229,null))['then'](function(_0x4d8035){var _0x4801dd=_[_0xf470('0x1f')](_0x4d8035,'id');var _0x4fcbe1=[];var _0x110713=[];var _0x402bbd=squel['select']();_0x402bbd['field'](_0xf470('0x64'))['from']('team_has_mail_queues','tq')[_0xf470('0x65')]('user_has_teams','ut',_0xf470('0x66'))[_0xf470('0x25')](_0xf470('0x67'),_0x2ae843['params']['id']);for(var _0x40345b=0x0;_0x40345b<_0x4d8035[_0xf470('0x56')];_0x40345b+=0x1){let _0x45085d=_0x4d8035[_0x40345b];for(var _0x5c83e1=0x0;_0x5c83e1<_0x45085d[_0xf470('0x5c')][_0xf470('0x56')];_0x5c83e1+=0x1){let _0x94e931=_0x45085d['Agents'][_0x5c83e1];var _0x405af5=_0x402bbd[_0xf470('0x68')]();_0x405af5[_0xf470('0x25')]('ut.UserId\x20=\x20?',_0x94e931['id']);_0x110713[_0xf470('0x69')](db[_0xf470('0x5d')][_0xf470('0x27')](_0x405af5[_0xf470('0x6a')](),{'type':db[_0xf470('0x5d')][_0xf470('0x6b')]['SELECT']})[_0xf470('0x16')](function(_0x10b5ee){if(_0x10b5ee[_0xf470('0x56')]===0x1){return _0x94e931['id'];}else{var _0x401e1e=_['every'](_['map'](_0x10b5ee,_0xf470('0x6c')),function(_0x19fbf5){return _[_0xf470('0x6d')](_0x4801dd,_0x19fbf5);});if(_0x401e1e){return _0x94e931['id'];}}}));}}return BPromise[_0xf470('0x6e')](_0x110713)[_0xf470('0x16')](function(_0x3469b7){_0x4fcbe1=_(_0x4fcbe1)[_0xf470('0x6f')](_0x3469b7)['compact']()[_0xf470('0x70')]();return db[_0xf470('0x20')][_0xf470('0x32')]({'where':{'id':_0x2ae843[_0xf470('0x2b')]['id']}})['then'](function(_0xf700f7){return db['sequelize'][_0xf470('0x5e')](function(_0x156d03){return _0xf700f7[_0xf470('0x71')](_0x2ae843[_0xf470('0x27')][_0xf470('0x59')],{'transaction':_0x156d03})['then'](function(){if(!_[_0xf470('0x72')](_0x4fcbe1)){return _0xf700f7[_0xf470('0x73')](_0x4fcbe1,{'transaction':_0x156d03});}})[_0xf470('0x16')](function(){_0x4fcbe1[_0xf470('0x61')](function(_0x3020f1){socket['emit'](_0xf470('0x74'),{'UserId':_0x3020f1,'MailQueueId':_0xf700f7['id']});});});});});});})['then'](respondWithStatusCode(_0x1e5229,null))[_0xf470('0x29')](handleError(_0x1e5229,null));};exports[_0xf470('0x75')]=function(_0x36ab75,_0x28f077){return db['MailQueue'][_0xf470('0x32')]({'where':{'id':_0x36ab75['params']['id']}})[_0xf470('0x16')](handleEntityNotFound(_0x28f077,null))[_0xf470('0x16')](function(_0x49690b){if(_0x49690b){return _0x49690b[_0xf470('0x75')](_0x36ab75[_0xf470('0x34')][_0xf470('0x59')],_[_0xf470('0x76')](_0x36ab75[_0xf470('0x34')],[_0xf470('0x59'),'id'])||{})[_0xf470('0x77')](function(_0x5e1eca){for(var _0x124179=0x0;_0x124179<_0x36ab75[_0xf470('0x34')][_0xf470('0x59')]['length'];_0x124179+=0x1){socket[_0xf470('0x62')](_0xf470('0x63'),{'UserId':Number(_0x36ab75[_0xf470('0x34')][_0xf470('0x59')][_0x124179]),'MailQueueId':Number(_0x36ab75['params']['id'])});}return _0x5e1eca;});}})[_0xf470('0x16')](respondWithResult(_0x28f077,null))[_0xf470('0x29')](handleError(_0x28f077,null));};exports[_0xf470('0x73')]=function(_0x3e6f95,_0x185554){return db[_0xf470('0x20')][_0xf470('0x32')]({'where':{'id':_0x3e6f95[_0xf470('0x2b')]['id']}})[_0xf470('0x16')](handleEntityNotFound(_0x185554,null))[_0xf470('0x16')](function(_0x3fb2aa){if(_0x3fb2aa){return _0x3fb2aa['removeAgents'](_0x3e6f95['query'][_0xf470('0x59')])[_0xf470('0x16')](function(){if(_[_0xf470('0x78')](_0x3e6f95[_0xf470('0x27')][_0xf470('0x59')])){for(var _0x473b5d=0x0;_0x473b5d<_0x3e6f95[_0xf470('0x27')]['ids']['length'];_0x473b5d+=0x1){socket['emit'](_0xf470('0x74'),{'UserId':Number(_0x3e6f95[_0xf470('0x27')][_0xf470('0x59')][_0x473b5d]),'MailQueueId':Number(_0x3e6f95[_0xf470('0x2b')]['id'])});}}else{socket['emit'](_0xf470('0x74'),{'UserId':Number(_0x3e6f95['query'][_0xf470('0x59')]),'MailQueueId':Number(_0x3e6f95[_0xf470('0x2b')]['id'])});}});}})[_0xf470('0x16')](respondWithStatusCode(_0x185554,null))[_0xf470('0x29')](handleError(_0x185554,null));};exports['getAgents']=function(_0x3734dd,_0x3bbca6){var _0x41dc07={};var _0x22128f={};var _0x573e38;var _0x5c1a64;return db[_0xf470('0x20')]['findOne']({'where':{'id':_0x3734dd['params']['id']}})['then'](handleEntityNotFound(_0x3bbca6,null))[_0xf470('0x16')](function(_0x4865a0){if(_0x4865a0){_0x573e38=_0x4865a0;_0x22128f[_0xf470('0x2c')]=_[_0xf470('0x3f')](db[_0xf470('0x4b')][_0xf470('0x55')]);_0x22128f[_0xf470('0x27')]=_[_0xf470('0x3f')](_0x3734dd[_0xf470('0x27')]);_0x22128f['filters']=_['intersection'](_0x22128f[_0xf470('0x2c')],_0x22128f[_0xf470('0x27')]);_0x41dc07[_0xf470('0x2e')]=_[_0xf470('0x41')](_0x22128f[_0xf470('0x2c')],qs[_0xf470('0x2f')](_0x3734dd[_0xf470('0x27')][_0xf470('0x2f')]));_0x41dc07['attributes']=_0x41dc07[_0xf470('0x2e')][_0xf470('0x56')]?_0x41dc07[_0xf470('0x2e')]:_0x22128f[_0xf470('0x2c')];_0x41dc07[_0xf470('0x44')]=qs[_0xf470('0x45')](_0x3734dd['query'][_0xf470('0x45')]);_0x41dc07[_0xf470('0x25')]=qs[_0xf470('0x2d')](_[_0xf470('0x46')](_0x3734dd[_0xf470('0x27')],_0x22128f['filters']));if(_0x3734dd[_0xf470('0x27')]['filter']){_0x41dc07[_0xf470('0x25')]=_['merge'](_0x41dc07[_0xf470('0x25')],{'$or':_['map'](_0x41dc07['attributes'],function(_0x255606){var _0xd78bd5={};_0xd78bd5[_0x255606]={'$like':'%'+_0x3734dd[_0xf470('0x27')]['filter']+'%'};return _0xd78bd5;})});}_0x41dc07=_[_0xf470('0x49')]({},_0x41dc07,_0x3734dd[_0xf470('0x31')]);return _0x573e38['getAgents'](_0x41dc07);}})[_0xf470('0x16')](function(_0x1a72d4){if(_0x1a72d4){_0x5c1a64=_0x1a72d4[_0xf470('0x56')];if(!_0x3734dd[_0xf470('0x27')][_0xf470('0x42')]('nolimit')){_0x41dc07[_0xf470('0x12')]=qs[_0xf470('0x12')](_0x3734dd[_0xf470('0x27')]['limit']);_0x41dc07[_0xf470('0xf')]=qs['offset'](_0x3734dd['query']['offset']);}return _0x573e38[_0xf470('0x79')](_0x41dc07);}})[_0xf470('0x16')](function(_0x50dec7){if(_0x50dec7){return _0x50dec7?{'count':_0x5c1a64,'rows':_0x50dec7}:null;}})['then'](respondWithResult(_0x3bbca6,null))[_0xf470('0x29')](handleError(_0x3bbca6,null));}; \ No newline at end of file +var _0xee80=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','update','then','destroy','MailQueues','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','include','findAll','catch','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserMailQueue','length','hasOwnProperty','order','sort','where','pick','MailQueueId','filter','merge','findAndCountAll','UserId','agent','mailPause','updatedAt','rows','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','User','Agents','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','join','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','TeamId','includes','union','compact','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','nolimit','util','lodash'];(function(_0x31ca37,_0x2b814f){var _0x4300cd=function(_0x5a8d09){while(--_0x5a8d09){_0x31ca37['push'](_0x31ca37['shift']());}};_0x4300cd(++_0x2b814f);}(_0xee80,0x157));var _0x0ee8=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xee80[_0x29d915];return _0x160f86;};'use strict';var BPromise=require('bluebird');var util=require(_0x0ee8('0x0'));var _=require(_0x0ee8('0x1'));var squel=require('squel');var Redis=require(_0x0ee8('0x2'));var qs=require(_0x0ee8('0x3'));var logger=require(_0x0ee8('0x4'))(_0x0ee8('0x5'));var config=require(_0x0ee8('0x6'));var db=require(_0x0ee8('0x7'))['db'];config[_0x0ee8('0x8')]=_['defaults'](config[_0x0ee8('0x8')],{'host':_0x0ee8('0x9'),'port':0x18eb});var socket=require(_0x0ee8('0xa'))(new Redis(config['redis']));require(_0x0ee8('0xb'))['register'](socket);function respondWithStatusCode(_0x2606b7,_0xd336f5){_0xd336f5=_0xd336f5||0xcc;return function(_0xe323c4){if(_0xe323c4){return _0x2606b7[_0x0ee8('0xc')](_0xd336f5);}return _0x2606b7['status'](_0xd336f5)[_0x0ee8('0xd')]();};}function respondWithResult(_0x2a9b68,_0x3f49e0){_0x3f49e0=_0x3f49e0||0xc8;return function(_0x1639d6){if(_0x1639d6){return _0x2a9b68[_0x0ee8('0xe')](_0x3f49e0)[_0x0ee8('0xf')](_0x1639d6);}};}function respondWithFilteredResult(_0x189e26,_0x2abbfa){return function(_0x37cf38){if(_0x37cf38){var _0x13f642=typeof _0x2abbfa[_0x0ee8('0x10')]===_0x0ee8('0x11')&&typeof _0x2abbfa[_0x0ee8('0x12')]===_0x0ee8('0x11');var _0x1bab1d=_0x37cf38['count'];var _0x433214=_0x13f642?0x0:_0x2abbfa[_0x0ee8('0x10')];var _0x489d84=_0x13f642?_0x37cf38[_0x0ee8('0x13')]:_0x2abbfa['offset']+_0x2abbfa['limit'];var _0x26f7a1;if(_0x489d84>=_0x1bab1d){_0x489d84=_0x1bab1d;_0x26f7a1=0xc8;}else{_0x26f7a1=0xce;}_0x189e26[_0x0ee8('0xe')](_0x26f7a1);return _0x189e26[_0x0ee8('0x14')]('Content-Range',_0x433214+'-'+_0x489d84+'/'+_0x1bab1d)['json'](_0x37cf38);}return null;};}function saveUpdates(_0x3e1bfc){return function(_0x312951){if(_0x312951){return _0x312951[_0x0ee8('0x15')](_0x3e1bfc)[_0x0ee8('0x16')](function(_0x1251e1){return _0x1251e1;});}return null;};}function removeEntity(_0x36d4ed){return function(_0xbe9706){if(_0xbe9706){return _0xbe9706[_0x0ee8('0x17')]()[_0x0ee8('0x16')](function(){var _0x1973cb=_0xbe9706['get']({'plain':!![]});var _0x15b4ee=_0x0ee8('0x18');return db['UserProfileResource'][_0x0ee8('0x17')]({'where':{'type':_0x15b4ee,'resourceId':_0x1973cb['id']}})['then'](function(){return _0xbe9706;});})[_0x0ee8('0x16')](function(){_0x36d4ed[_0x0ee8('0xe')](0xcc)[_0x0ee8('0xd')]();});}};}function handleEntityNotFound(_0x3862c9){return function(_0x4c8f66){if(!_0x4c8f66){_0x3862c9[_0x0ee8('0xc')](0x194);}return _0x4c8f66;};}function handleError(_0x1dce25,_0x35f051){_0x35f051=_0x35f051||0x1f4;return function(_0xc4f1){logger['error'](_0xc4f1[_0x0ee8('0x19')]);if(_0xc4f1[_0x0ee8('0x1a')]){delete _0xc4f1[_0x0ee8('0x1a')];}_0x1dce25[_0x0ee8('0xe')](_0x35f051)[_0x0ee8('0x1b')](_0xc4f1);};}exports[_0x0ee8('0x1c')]=function(_0xeaca49,_0x5cac3b){var _0x1dcb35={};var _0x55a7e5={'count':0x0,'rows':[]};var _0x5a846c=_[_0x0ee8('0x1d')](db[_0x0ee8('0x1e')][_0x0ee8('0x1f')],function(_0x21e353){return{'name':_0x21e353[_0x0ee8('0x20')],'type':_0x21e353[_0x0ee8('0x21')][_0x0ee8('0x22')]};});_0x1dcb35=qs[_0x0ee8('0x23')](_0x5a846c,_0xeaca49);var _0x168d8d={'where':_0x1dcb35['where']};return db[_0x0ee8('0x1e')][_0x0ee8('0x13')](_0x168d8d)[_0x0ee8('0x16')](function(_0x43c02a){_0x55a7e5[_0x0ee8('0x13')]=_0x43c02a;_0x1dcb35[_0x0ee8('0x24')]=qs[_0x0ee8('0x24')](_0xeaca49['query']);return db['MailQueue'][_0x0ee8('0x25')](_0x1dcb35);})[_0x0ee8('0x16')](function(_0x3ba6f1){_0x55a7e5['rows']=_0x3ba6f1;return _0x55a7e5;})['then'](respondWithFilteredResult(_0x5cac3b,_0x1dcb35))[_0x0ee8('0x26')](handleError(_0x5cac3b,null));};exports['show']=function(_0xa2b389,_0x3c6af5){var _0x5f37e7={'raw':!![],'where':{'id':_0xa2b389[_0x0ee8('0x27')]['id']}},_0x2af11b={};_0x2af11b[_0x0ee8('0x28')]=_[_0x0ee8('0x29')](db[_0x0ee8('0x1e')][_0x0ee8('0x1f')]);_0x2af11b[_0x0ee8('0x2a')]=_['keys'](_0xa2b389['query']);_0x2af11b[_0x0ee8('0x2b')]=_[_0x0ee8('0x2c')](_0x2af11b[_0x0ee8('0x28')],_0x2af11b['query']);_0x5f37e7[_0x0ee8('0x2d')]=_[_0x0ee8('0x2c')](_0x2af11b['model'],qs[_0x0ee8('0x2e')](_0xa2b389['query'][_0x0ee8('0x2e')]));_0x5f37e7[_0x0ee8('0x2d')]=_0x5f37e7[_0x0ee8('0x2d')]['length']?_0x5f37e7['attributes']:_0x2af11b[_0x0ee8('0x28')];if(_0xa2b389[_0x0ee8('0x2a')][_0x0ee8('0x2f')]){_0x5f37e7[_0x0ee8('0x24')]=[{'all':!![]}];}_0x5f37e7=_['merge']({},_0x5f37e7,_0xa2b389[_0x0ee8('0x30')]);return db['MailQueue'][_0x0ee8('0x31')](_0x5f37e7)['then'](handleEntityNotFound(_0x3c6af5,null))[_0x0ee8('0x16')](respondWithResult(_0x3c6af5,null))[_0x0ee8('0x26')](handleError(_0x3c6af5,null));};exports[_0x0ee8('0x32')]=function(_0xe7d496,_0x5980f3){return db['MailQueue']['create'](_0xe7d496[_0x0ee8('0x33')],{})[_0x0ee8('0x16')](function(_0x5a812e){var _0x94f8e2=_0xe7d496[_0x0ee8('0x34')][_0x0ee8('0x35')]({'plain':!![]});if(!_0x94f8e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x94f8e2['role']===_0x0ee8('0x34')){var _0x5b5e56=_0x5a812e[_0x0ee8('0x35')]({'plain':!![]});var _0x583f82='MailQueues';return db[_0x0ee8('0x36')][_0x0ee8('0x31')]({'where':{'name':_0x583f82,'userProfileId':_0x94f8e2[_0x0ee8('0x37')]},'raw':!![]})['then'](function(_0x31b001){if(_0x31b001&&_0x31b001[_0x0ee8('0x38')]===0x0){return db['UserProfileResource'][_0x0ee8('0x32')]({'name':_0x5b5e56[_0x0ee8('0x1a')],'resourceId':_0x5b5e56['id'],'type':_0x31b001[_0x0ee8('0x1a')],'sectionId':_0x31b001['id']},{})['then'](function(){return _0x5a812e;});}else{return _0x5a812e;}})[_0x0ee8('0x26')](function(_0x20c964){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20c964);throw _0x20c964;});}return _0x5a812e;})['then'](respondWithResult(_0x5980f3,0xc9))[_0x0ee8('0x26')](handleError(_0x5980f3,null));};exports[_0x0ee8('0x15')]=function(_0x1657ed,_0x5d5fe1){if(_0x1657ed[_0x0ee8('0x33')]['id']){delete _0x1657ed[_0x0ee8('0x33')]['id'];}return db[_0x0ee8('0x1e')]['find']({'where':{'id':_0x1657ed[_0x0ee8('0x27')]['id']}})['then'](handleEntityNotFound(_0x5d5fe1,null))[_0x0ee8('0x16')](saveUpdates(_0x1657ed[_0x0ee8('0x33')],null))['then'](respondWithResult(_0x5d5fe1,null))[_0x0ee8('0x26')](handleError(_0x5d5fe1,null));};exports[_0x0ee8('0x17')]=function(_0x592da1,_0x406077){return db['MailQueue']['find']({'where':{'id':_0x592da1['params']['id']}})[_0x0ee8('0x16')](handleEntityNotFound(_0x406077,null))[_0x0ee8('0x16')](removeEntity(_0x406077,null))[_0x0ee8('0x26')](handleError(_0x406077,null));};exports['describe']=function(_0x2d8621,_0x1f7b63){return db[_0x0ee8('0x1e')][_0x0ee8('0x39')]()[_0x0ee8('0x16')](respondWithResult(_0x1f7b63,null))[_0x0ee8('0x26')](handleError(_0x1f7b63,null));};exports[_0x0ee8('0x3a')]=function(_0x13e058,_0x4049b9){var _0xfbd76a={'raw':!![],'where':{}},_0x2a47ab={},_0x1807fb;return db['MailQueue'][_0x0ee8('0x3b')]({'where':{'id':_0x13e058['params']['id']}})[_0x0ee8('0x16')](handleEntityNotFound(_0x4049b9,null))[_0x0ee8('0x16')](function(_0x537fa3){if(_0x537fa3){_0x1807fb=_0x537fa3['get']({'plain':!![]});_0x2a47ab[_0x0ee8('0x28')]=_[_0x0ee8('0x29')](db[_0x0ee8('0x3c')][_0x0ee8('0x1f')]);_0x2a47ab[_0x0ee8('0x2a')]=_[_0x0ee8('0x29')](_0x13e058[_0x0ee8('0x2a')]);_0x2a47ab[_0x0ee8('0x2b')]=_['intersection'](_0x2a47ab['model'],_0x2a47ab['query']);_0xfbd76a[_0x0ee8('0x2d')]=_[_0x0ee8('0x2c')](_0x2a47ab['model'],qs[_0x0ee8('0x2e')](_0x13e058['query'][_0x0ee8('0x2e')]));_0xfbd76a[_0x0ee8('0x2d')]=_0xfbd76a[_0x0ee8('0x2d')][_0x0ee8('0x3d')]?_0xfbd76a['attributes']:_0x2a47ab[_0x0ee8('0x28')];if(!_0x13e058[_0x0ee8('0x2a')][_0x0ee8('0x3e')]('nolimit')){_0xfbd76a[_0x0ee8('0x12')]=qs['limit'](_0x13e058['query'][_0x0ee8('0x12')]);_0xfbd76a[_0x0ee8('0x10')]=qs[_0x0ee8('0x10')](_0x13e058[_0x0ee8('0x2a')][_0x0ee8('0x10')]);}_0xfbd76a[_0x0ee8('0x3f')]=qs[_0x0ee8('0x40')](_0x13e058['query'][_0x0ee8('0x40')]);_0xfbd76a[_0x0ee8('0x41')]=qs['filters'](_[_0x0ee8('0x42')](_0x13e058[_0x0ee8('0x2a')],_0x2a47ab[_0x0ee8('0x2b')]));_0xfbd76a['where'][_0x0ee8('0x43')]=_0x537fa3['id'];if(_0x13e058[_0x0ee8('0x2a')][_0x0ee8('0x44')]){_0xfbd76a[_0x0ee8('0x41')]=_[_0x0ee8('0x45')](_0xfbd76a[_0x0ee8('0x41')],{'$or':_[_0x0ee8('0x1d')](_0xfbd76a[_0x0ee8('0x2d')],function(_0x5c266c){var _0x431403={};_0x431403[_0x5c266c]={'$like':'%'+_0x13e058['query'][_0x0ee8('0x44')]+'%'};return _0x431403;})});}_0xfbd76a=_[_0x0ee8('0x45')]({},_0xfbd76a,_0x13e058[_0x0ee8('0x30')]);return db[_0x0ee8('0x3c')][_0x0ee8('0x25')](_0xfbd76a);}})[_0x0ee8('0x16')](function(_0x52c850){if(_0x52c850){return db['User'][_0x0ee8('0x46')]({'where':{'id':_[_0x0ee8('0x1d')](_0x52c850,_0x0ee8('0x47')),'role':_0x0ee8('0x48')},'attributes':['id',_0x0ee8('0x1a'),_0x0ee8('0x49'),_0x0ee8('0x4a'),'createdAt']});}})[_0x0ee8('0x16')](function(_0x211838){if(_0x211838){return{'count':_0x211838[_0x0ee8('0x13')],'rows':_['map'](_0x211838[_0x0ee8('0x4b')],function(_0x47367c){return{'membername':_0x47367c['name'],'UserId':_0x47367c['id'],'queue_name':_0x1807fb['name'],'MailQueueId':_0x1807fb['id'],'interface':util[_0x0ee8('0x4c')](_0x0ee8('0x4d'),'SIP',_0x47367c[_0x0ee8('0x1a')]),'penalty':0x0,'paused':_0x47367c[_0x0ee8('0x49')],'createdAt':_0x47367c[_0x0ee8('0x4e')],'updatedAt':_0x47367c[_0x0ee8('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4049b9,_0xfbd76a))['catch'](handleError(_0x4049b9,null));};exports[_0x0ee8('0x4f')]=function(_0x578283,_0x445063){var _0x57d3e1={};var _0x4c1854={};var _0x3e4eec;var _0x198a81;return db[_0x0ee8('0x1e')][_0x0ee8('0x3b')]({'where':{'id':_0x578283['params']['id']}})[_0x0ee8('0x16')](handleEntityNotFound(_0x445063,null))['then'](function(_0x50d82c){if(_0x50d82c){_0x3e4eec=_0x50d82c;_0x4c1854[_0x0ee8('0x28')]=_[_0x0ee8('0x29')](db[_0x0ee8('0x50')][_0x0ee8('0x1f')]);_0x4c1854[_0x0ee8('0x2a')]=_[_0x0ee8('0x29')](_0x578283[_0x0ee8('0x2a')]);_0x4c1854['filters']=_[_0x0ee8('0x2c')](_0x4c1854[_0x0ee8('0x28')],_0x4c1854['query']);_0x57d3e1['attributes']=_[_0x0ee8('0x2c')](_0x4c1854[_0x0ee8('0x28')],qs[_0x0ee8('0x2e')](_0x578283['query']['fields']));_0x57d3e1['attributes']=_0x57d3e1[_0x0ee8('0x2d')][_0x0ee8('0x3d')]?_0x57d3e1[_0x0ee8('0x2d')]:_0x4c1854[_0x0ee8('0x28')];_0x57d3e1[_0x0ee8('0x3f')]=qs['sort'](_0x578283[_0x0ee8('0x2a')]['sort']);_0x57d3e1[_0x0ee8('0x41')]=qs[_0x0ee8('0x2b')](_['pick'](_0x578283[_0x0ee8('0x2a')],_0x4c1854['filters']));if(_0x578283[_0x0ee8('0x2a')]['filter']){_0x57d3e1[_0x0ee8('0x41')]=_['merge'](_0x57d3e1[_0x0ee8('0x41')],{'$or':_['map'](_0x57d3e1['attributes'],function(_0x5c6264){var _0x2721b5={};_0x2721b5[_0x5c6264]={'$like':'%'+_0x578283[_0x0ee8('0x2a')][_0x0ee8('0x44')]+'%'};return _0x2721b5;})});}_0x57d3e1=_[_0x0ee8('0x45')]({},_0x57d3e1,_0x578283['options']);return _0x3e4eec[_0x0ee8('0x4f')](_0x57d3e1);}})[_0x0ee8('0x16')](function(_0x29fe52){if(_0x29fe52){_0x198a81=_0x29fe52[_0x0ee8('0x3d')];if(!_0x578283['query'][_0x0ee8('0x3e')]('nolimit')){_0x57d3e1['limit']=qs['limit'](_0x578283[_0x0ee8('0x2a')][_0x0ee8('0x12')]);_0x57d3e1[_0x0ee8('0x10')]=qs['offset'](_0x578283[_0x0ee8('0x2a')][_0x0ee8('0x10')]);}return _0x3e4eec[_0x0ee8('0x4f')](_0x57d3e1);}})[_0x0ee8('0x16')](function(_0x1f7807){if(_0x1f7807){return _0x1f7807?{'count':_0x198a81,'rows':_0x1f7807}:null;}})[_0x0ee8('0x16')](respondWithResult(_0x445063,null))[_0x0ee8('0x26')](handleError(_0x445063,null));};exports[_0x0ee8('0x51')]=function(_0x3dca5c,_0x5e5b25){var _0x5cee16=_0x3dca5c[_0x0ee8('0x33')][_0x0ee8('0x52')];return db[_0x0ee8('0x50')][_0x0ee8('0x25')]({'where':{'id':_0x5cee16},'attributes':['id'],'include':[{'model':db[_0x0ee8('0x53')],'as':_0x0ee8('0x54'),'attributes':['id',_0x0ee8('0x1a'),'online','voicePause',_0x0ee8('0x55')],'raw':!![]}]})[_0x0ee8('0x16')](function(_0x4df4ae){if(_0x4df4ae){var _0x31ba9b=_[_0x0ee8('0x56')](_0x4df4ae,function(_0xfb12ca){var _0x5e4893=_0xfb12ca['get']({'plain':!![]});return _0x5e4893['Agents'];});return db[_0x0ee8('0x1e')][_0x0ee8('0x31')]({'where':{'id':_0x3dca5c['params']['id']}})[_0x0ee8('0x16')](function(_0x32ee4e){return db['sequelize'][_0x0ee8('0x57')](function(_0x1cc721){return _0x32ee4e[_0x0ee8('0x51')](_0x5cee16,{'transaction':_0x1cc721})['then'](function(){return BPromise[_0x0ee8('0x58')](_0x31ba9b,function(_0x323bf2){return db[_0x0ee8('0x3c')][_0x0ee8('0x59')]({'where':{'UserId':_0x323bf2['id'],'MailQueueId':_0x3dca5c['params']['id']},'transaction':_0x1cc721});});})[_0x0ee8('0x16')](function(){_0x31ba9b[_0x0ee8('0x5a')](function(_0x36c608){socket[_0x0ee8('0x5b')]('userMailQueue:save',{'UserId':_0x36c608['id'],'MailQueueId':_0x32ee4e['id']});});});});});}})[_0x0ee8('0x16')](respondWithStatusCode(_0x5e5b25,null))[_0x0ee8('0x26')](handleError(_0x5e5b25,null));};exports[_0x0ee8('0x5c')]=function(_0x4f2a33,_0x496135){return db[_0x0ee8('0x50')]['findAll']({'where':{'id':_0x4f2a33[_0x0ee8('0x2a')][_0x0ee8('0x52')]},'attributes':['id'],'include':[{'model':db[_0x0ee8('0x53')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x496135,null))[_0x0ee8('0x16')](function(_0x4fff0f){var _0x52e05f=_[_0x0ee8('0x1d')](_0x4fff0f,'id');var _0xb8b394=[];var _0x269b60=[];var _0x419053=squel[_0x0ee8('0x5d')]();_0x419053['field'](_0x0ee8('0x5e'))[_0x0ee8('0x5f')]('team_has_mail_queues','tq')[_0x0ee8('0x60')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x0ee8('0x61'),_0x4f2a33['params']['id']);for(var _0x2bfd49=0x0;_0x2bfd49<_0x4fff0f['length'];_0x2bfd49+=0x1){let _0x734364=_0x4fff0f[_0x2bfd49];for(var _0x3fac35=0x0;_0x3fac35<_0x734364[_0x0ee8('0x54')]['length'];_0x3fac35+=0x1){let _0x304872=_0x734364[_0x0ee8('0x54')][_0x3fac35];var _0x2ddee8=_0x419053['clone']();_0x2ddee8[_0x0ee8('0x41')](_0x0ee8('0x62'),_0x304872['id']);_0x269b60['push'](db[_0x0ee8('0x63')]['query'](_0x2ddee8[_0x0ee8('0x64')](),{'type':db[_0x0ee8('0x63')][_0x0ee8('0x65')][_0x0ee8('0x66')]})['then'](function(_0x5bc781){if(_0x5bc781[_0x0ee8('0x3d')]===0x1){return _0x304872['id'];}else{var _0x171c5d=_['every'](_[_0x0ee8('0x1d')](_0x5bc781,_0x0ee8('0x67')),function(_0x54a2ab){return _[_0x0ee8('0x68')](_0x52e05f,_0x54a2ab);});if(_0x171c5d){return _0x304872['id'];}}}));}}return BPromise['all'](_0x269b60)[_0x0ee8('0x16')](function(_0x240777){_0xb8b394=_(_0xb8b394)[_0x0ee8('0x69')](_0x240777)[_0x0ee8('0x6a')]()['value']();return db[_0x0ee8('0x1e')][_0x0ee8('0x31')]({'where':{'id':_0x4f2a33[_0x0ee8('0x27')]['id']}})['then'](function(_0x4735e4){return db[_0x0ee8('0x63')][_0x0ee8('0x57')](function(_0x468521){return _0x4735e4['removeTeams'](_0x4f2a33[_0x0ee8('0x2a')]['ids'],{'transaction':_0x468521})[_0x0ee8('0x16')](function(){if(!_['isEmpty'](_0xb8b394)){return _0x4735e4[_0x0ee8('0x6b')](_0xb8b394,{'transaction':_0x468521});}})[_0x0ee8('0x16')](function(){_0xb8b394[_0x0ee8('0x5a')](function(_0x1fcf88){socket['emit']('userMailQueue:remove',{'UserId':_0x1fcf88,'MailQueueId':_0x4735e4['id']});});});});});});})[_0x0ee8('0x16')](respondWithStatusCode(_0x496135,null))['catch'](handleError(_0x496135,null));};exports[_0x0ee8('0x6c')]=function(_0x299d0f,_0x3b6174){return db[_0x0ee8('0x1e')]['find']({'where':{'id':_0x299d0f['params']['id']}})['then'](handleEntityNotFound(_0x3b6174,null))[_0x0ee8('0x16')](function(_0x3f3b3f){if(_0x3f3b3f){return _0x3f3b3f[_0x0ee8('0x6c')](_0x299d0f['body']['ids'],_[_0x0ee8('0x6d')](_0x299d0f[_0x0ee8('0x33')],[_0x0ee8('0x52'),'id'])||{})[_0x0ee8('0x6e')](function(_0xbf65){for(var _0x41bd22=0x0;_0x41bd22<_0x299d0f[_0x0ee8('0x33')][_0x0ee8('0x52')][_0x0ee8('0x3d')];_0x41bd22+=0x1){socket[_0x0ee8('0x5b')]('userMailQueue:save',{'UserId':Number(_0x299d0f[_0x0ee8('0x33')][_0x0ee8('0x52')][_0x41bd22]),'MailQueueId':Number(_0x299d0f[_0x0ee8('0x27')]['id'])});}return _0xbf65;});}})[_0x0ee8('0x16')](respondWithResult(_0x3b6174,null))['catch'](handleError(_0x3b6174,null));};exports['removeAgents']=function(_0x498117,_0x2689d3){return db['MailQueue'][_0x0ee8('0x31')]({'where':{'id':_0x498117[_0x0ee8('0x27')]['id']}})[_0x0ee8('0x16')](handleEntityNotFound(_0x2689d3,null))[_0x0ee8('0x16')](function(_0x4730ac){if(_0x4730ac){return _0x4730ac['removeAgents'](_0x498117[_0x0ee8('0x2a')][_0x0ee8('0x52')])[_0x0ee8('0x16')](function(){if(_[_0x0ee8('0x6f')](_0x498117[_0x0ee8('0x2a')]['ids'])){for(var _0x5e20dc=0x0;_0x5e20dc<_0x498117[_0x0ee8('0x2a')]['ids']['length'];_0x5e20dc+=0x1){socket[_0x0ee8('0x5b')](_0x0ee8('0x70'),{'UserId':Number(_0x498117[_0x0ee8('0x2a')][_0x0ee8('0x52')][_0x5e20dc]),'MailQueueId':Number(_0x498117['params']['id'])});}}else{socket[_0x0ee8('0x5b')](_0x0ee8('0x70'),{'UserId':Number(_0x498117[_0x0ee8('0x2a')][_0x0ee8('0x52')]),'MailQueueId':Number(_0x498117[_0x0ee8('0x27')]['id'])});}});}})[_0x0ee8('0x16')](respondWithStatusCode(_0x2689d3,null))['catch'](handleError(_0x2689d3,null));};exports[_0x0ee8('0x71')]=function(_0x1fbb6c,_0x2b2bf6){var _0x334219={};var _0x49bfb4={};var _0x306404;var _0x1139a1;return db[_0x0ee8('0x1e')][_0x0ee8('0x3b')]({'where':{'id':_0x1fbb6c[_0x0ee8('0x27')]['id']}})[_0x0ee8('0x16')](handleEntityNotFound(_0x2b2bf6,null))[_0x0ee8('0x16')](function(_0x4d3a18){if(_0x4d3a18){_0x306404=_0x4d3a18;_0x49bfb4[_0x0ee8('0x28')]=_[_0x0ee8('0x29')](db[_0x0ee8('0x53')]['rawAttributes']);_0x49bfb4[_0x0ee8('0x2a')]=_[_0x0ee8('0x29')](_0x1fbb6c[_0x0ee8('0x2a')]);_0x49bfb4[_0x0ee8('0x2b')]=_[_0x0ee8('0x2c')](_0x49bfb4['model'],_0x49bfb4[_0x0ee8('0x2a')]);_0x334219[_0x0ee8('0x2d')]=_[_0x0ee8('0x2c')](_0x49bfb4[_0x0ee8('0x28')],qs['fields'](_0x1fbb6c[_0x0ee8('0x2a')][_0x0ee8('0x2e')]));_0x334219[_0x0ee8('0x2d')]=_0x334219[_0x0ee8('0x2d')][_0x0ee8('0x3d')]?_0x334219[_0x0ee8('0x2d')]:_0x49bfb4[_0x0ee8('0x28')];_0x334219[_0x0ee8('0x3f')]=qs[_0x0ee8('0x40')](_0x1fbb6c[_0x0ee8('0x2a')][_0x0ee8('0x40')]);_0x334219[_0x0ee8('0x41')]=qs[_0x0ee8('0x2b')](_[_0x0ee8('0x42')](_0x1fbb6c[_0x0ee8('0x2a')],_0x49bfb4[_0x0ee8('0x2b')]));if(_0x1fbb6c[_0x0ee8('0x2a')][_0x0ee8('0x44')]){_0x334219[_0x0ee8('0x41')]=_[_0x0ee8('0x45')](_0x334219[_0x0ee8('0x41')],{'$or':_[_0x0ee8('0x1d')](_0x334219['attributes'],function(_0x430f5b){var _0x844340={};_0x844340[_0x430f5b]={'$like':'%'+_0x1fbb6c[_0x0ee8('0x2a')][_0x0ee8('0x44')]+'%'};return _0x844340;})});}_0x334219=_[_0x0ee8('0x45')]({},_0x334219,_0x1fbb6c[_0x0ee8('0x30')]);return _0x306404[_0x0ee8('0x71')](_0x334219);}})[_0x0ee8('0x16')](function(_0x45e830){if(_0x45e830){_0x1139a1=_0x45e830['length'];if(!_0x1fbb6c['query']['hasOwnProperty'](_0x0ee8('0x72'))){_0x334219['limit']=qs[_0x0ee8('0x12')](_0x1fbb6c[_0x0ee8('0x2a')]['limit']);_0x334219[_0x0ee8('0x10')]=qs[_0x0ee8('0x10')](_0x1fbb6c[_0x0ee8('0x2a')][_0x0ee8('0x10')]);}return _0x306404['getAgents'](_0x334219);}})[_0x0ee8('0x16')](function(_0x2a2277){if(_0x2a2277){return _0x2a2277?{'count':_0x1139a1,'rows':_0x2a2277}:null;}})[_0x0ee8('0x16')](respondWithResult(_0x2b2bf6,null))[_0x0ee8('0x26')](handleError(_0x2b2bf6,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 8f3e454..86f9633 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 _0x5b85=['setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5b85,0x102));var _0x55b8=function(_0x26b65a,_0x2abe39){_0x26b65a=_0x26b65a-0x0;var _0x7c8322=_0x5b85[_0x26b65a];return _0x7c8322;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x55b8('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x55b8('0x1')](0x0);var events={'afterCreate':_0x55b8('0x2'),'afterUpdate':_0x55b8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5cfb7c){return function(_0x2b1fc6,_0x4183e2,_0xd6482a){MailQueueEvents[_0x55b8('0x4')](_0x5cfb7c+':'+_0x2b1fc6['id'],_0x2b1fc6);MailQueueEvents[_0x55b8('0x4')](_0x5cfb7c,_0x2b1fc6);_0xd6482a(null);};}for(var e in events){if(events[_0x55b8('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x55b8('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x7e08=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x219a12,_0x1e70c2){var _0x3a5a0b=function(_0x32ae6e){while(--_0x32ae6e){_0x219a12['push'](_0x219a12['shift']());}};_0x3a5a0b(++_0x1e70c2);}(_0x7e08,0xb3));var _0x87e0=function(_0xed9e57,_0x2d8ac8){_0xed9e57=_0xed9e57-0x0;var _0x4c4190=_0x7e08[_0xed9e57];return _0x4c4190;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x87e0('0x0'))['db'][_0x87e0('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x87e0('0x2')](0x0);var events={'afterCreate':_0x87e0('0x3'),'afterUpdate':_0x87e0('0x4'),'afterDestroy':_0x87e0('0x5')};function emitEvent(_0x50ab34){return function(_0x19560c,_0x28a7a5,_0x30a7dd){MailQueueEvents['emit'](_0x50ab34+':'+_0x19560c['id'],_0x19560c);MailQueueEvents[_0x87e0('0x6')](_0x50ab34,_0x19560c);_0x30a7dd(null);};}for(var e in events){if(events[_0x87e0('0x7')](e)){var event=events[e];MailQueue[_0x87e0('0x8')](e,emitEvent(event));}}module[_0x87e0('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 2834b70..bf57250 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 _0x8816=['mail_queues','lodash','../../config/logger','api','request-promise','path','exports','MailQueue'];(function(_0x2d1cb6,_0x4b4e67){var _0x3d6986=function(_0x4089cb){while(--_0x4089cb){_0x2d1cb6['push'](_0x2d1cb6['shift']());}};_0x3d6986(++_0x4b4e67);}(_0x8816,0x111));var _0x6881=function(_0x2cb8f5,_0x5d15b1){_0x2cb8f5=_0x2cb8f5-0x0;var _0x3afe40=_0x8816[_0x2cb8f5];return _0x3afe40;};'use strict';var _=require(_0x6881('0x0'));var util=require('util');var logger=require(_0x6881('0x1'))(_0x6881('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6881('0x3'));var fs=require('fs');var path=require(_0x6881('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x6881('0x5')]=function(_0x3ad64d,_0x191a46){return _0x3ad64d['define'](_0x6881('0x6'),attributes,{'tableName':_0x6881('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x592c=['bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util','api','moment'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0x592c,0xa6));var _0xc592=function(_0x3e529e,_0x145d98){_0x3e529e=_0x3e529e-0x0;var _0x213f6c=_0x592c[_0x3e529e];return _0x213f6c;};'use strict';var _=require(_0xc592('0x0'));var util=require(_0xc592('0x1'));var logger=require('../../config/logger')(_0xc592('0x2'));var moment=require(_0xc592('0x3'));var BPromise=require(_0xc592('0x4'));var rp=require(_0xc592('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc592('0x6'));var config=require(_0xc592('0x7'));var attributes=require('./mailQueue.attributes');module[_0xc592('0x8')]=function(_0x3c9907,_0x3fb1e3){return _0x3c9907[_0xc592('0x9')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 64489d1..25be3e3 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 _0x1306=['code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','findAll','raw','options','where','limit','include','attributes','map','model','find','ShowMailQueue','lodash','util','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','info','request\x20sent','debug','stringify','error'];(function(_0x1a0f3a,_0x3f82c3){var _0x152ebf=function(_0x2d33ea){while(--_0x2d33ea){_0x1a0f3a['push'](_0x1a0f3a['shift']());}};_0x152ebf(++_0x3f82c3);}(_0x1306,0x17a));var _0x6130=function(_0xa16512,_0x537b0f){_0xa16512=_0xa16512-0x0;var _0x141776=_0x1306[_0xa16512];return _0x141776;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});config[_0x6130('0xe')]=_[_0x6130('0xf')](config[_0x6130('0xe')],{'host':_0x6130('0x10'),'port':0x18eb});var socket=require(_0x6130('0x11'))(new Redis(config[_0x6130('0xe')]));require(_0x6130('0x12'))[_0x6130('0x13')](socket);function respondWithRpcPromise(_0xb9c7e6,_0x34d1a6,_0x2d06a5){return new BPromise(function(_0x107d80,_0xcaf732){return client[_0x6130('0x14')](_0xb9c7e6,_0x2d06a5)[_0x6130('0x15')](function(_0x583072){logger[_0x6130('0x16')]('MailQueue,\x20%s,\x20%s',_0x34d1a6,_0x6130('0x17'));logger[_0x6130('0x18')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x34d1a6,_0x6130('0x17'),JSON[_0x6130('0x19')](_0x583072));if(_0x583072[_0x6130('0x1a')]){if(_0x583072[_0x6130('0x1a')][_0x6130('0x1b')]===0x1f4){logger[_0x6130('0x1a')](_0x6130('0x1c'),_0x34d1a6,_0x583072[_0x6130('0x1a')][_0x6130('0x1d')]);return _0xcaf732(_0x583072[_0x6130('0x1a')][_0x6130('0x1d')]);}logger[_0x6130('0x1a')](_0x6130('0x1c'),_0x34d1a6,_0x583072[_0x6130('0x1a')][_0x6130('0x1d')]);return _0x107d80(_0x583072[_0x6130('0x1a')]['message']);}else{logger['info'](_0x6130('0x1c'),_0x34d1a6,'request\x20sent');_0x107d80(_0x583072[_0x6130('0x1e')][_0x6130('0x1d')]);}})[_0x6130('0x1f')](function(_0x2c83b0){logger[_0x6130('0x1a')]('MailQueue,\x20%s,\x20%s',_0x34d1a6,_0x2c83b0);_0xcaf732(_0x2c83b0);});});}exports[_0x6130('0x20')]=function(_0x4d4b4b){var _0x41fa14=this;return new Promise(function(_0x41f56a,_0x18bb78){return db[_0x6130('0x21')][_0x6130('0x22')]({'raw':_0x4d4b4b['options']?_0x4d4b4b['options'][_0x6130('0x23')]===undefined?!![]:![]:!![],'where':_0x4d4b4b['options']?_0x4d4b4b[_0x6130('0x24')][_0x6130('0x25')]||null:null,'attributes':_0x4d4b4b['options']?_0x4d4b4b['options']['attributes']||null:null,'limit':_0x4d4b4b[_0x6130('0x24')]?_0x4d4b4b['options'][_0x6130('0x26')]||null:null,'include':_0x4d4b4b['options']?_0x4d4b4b['options']['include']?_['map'](_0x4d4b4b['options'][_0x6130('0x27')],function(_0x1ba07d){return{'model':db[_0x1ba07d['model']],'as':_0x1ba07d['as'],'attributes':_0x1ba07d[_0x6130('0x28')],'include':_0x1ba07d['include']?_[_0x6130('0x29')](_0x1ba07d['include'],function(_0x5787a6){return{'model':db[_0x5787a6[_0x6130('0x2a')]],'as':_0x5787a6['as'],'attributes':_0x5787a6[_0x6130('0x28')],'include':_0x5787a6[_0x6130('0x27')]?_[_0x6130('0x29')](_0x5787a6[_0x6130('0x27')],function(_0x392386){return{'model':db[_0x392386[_0x6130('0x2a')]],'as':_0x392386['as'],'attributes':_0x392386[_0x6130('0x28')]};}):[]};}):[]};}):[]:[]})[_0x6130('0x15')](function(_0x5809e4){logger['info'](_0x6130('0x20'),_0x4d4b4b);logger[_0x6130('0x18')](_0x6130('0x20'),_0x4d4b4b,JSON[_0x6130('0x19')](_0x5809e4));_0x41f56a(_0x5809e4);})[_0x6130('0x1f')](function(_0x4e068c){logger[_0x6130('0x1a')](_0x6130('0x20'),_0x4e068c[_0x6130('0x1d')],_0x4d4b4b);_0x18bb78(_0x41fa14[_0x6130('0x1a')](0x1f4,_0x4e068c[_0x6130('0x1d')]));});});};exports['ShowMailQueue']=function(_0x248324){var _0x600c28=this;return new Promise(function(_0x165407,_0x4b0c9c){return db[_0x6130('0x21')][_0x6130('0x2b')]({'raw':_0x248324[_0x6130('0x24')]?_0x248324[_0x6130('0x24')][_0x6130('0x23')]===undefined?!![]:![]:!![],'where':_0x248324[_0x6130('0x24')]?_0x248324[_0x6130('0x24')][_0x6130('0x25')]||null:null,'attributes':_0x248324[_0x6130('0x24')]?_0x248324['options'][_0x6130('0x28')]||null:null,'include':_0x248324['options']?_0x248324['options']['include']?_[_0x6130('0x29')](_0x248324[_0x6130('0x24')][_0x6130('0x27')],function(_0x3b5270){return{'model':db[_0x3b5270[_0x6130('0x2a')]],'as':_0x3b5270['as'],'attributes':_0x3b5270[_0x6130('0x28')],'include':_0x3b5270[_0x6130('0x27')]?_[_0x6130('0x29')](_0x3b5270['include'],function(_0x36a91e){return{'model':db[_0x36a91e[_0x6130('0x2a')]],'as':_0x36a91e['as'],'attributes':_0x36a91e['attributes'],'include':_0x36a91e[_0x6130('0x27')]?_[_0x6130('0x29')](_0x36a91e[_0x6130('0x27')],function(_0x5874cd){return{'model':db[_0x5874cd[_0x6130('0x2a')]],'as':_0x5874cd['as'],'attributes':_0x5874cd[_0x6130('0x28')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f3798){logger[_0x6130('0x16')](_0x6130('0x2c'),_0x248324);logger[_0x6130('0x18')]('ShowMailQueue',_0x248324,JSON['stringify'](_0x5f3798));_0x165407(_0x5f3798);})[_0x6130('0x1f')](function(_0x94a76){logger[_0x6130('0x1a')](_0x6130('0x2c'),_0x94a76[_0x6130('0x1d')],_0x248324);_0x4b0c9c(_0x600c28[_0x6130('0x1a')](0x1f4,_0x94a76[_0x6130('0x1d')]));});});}; \ No newline at end of file +var _0x22c9=['GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailQueue','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x22c9,0x8b));var _0x922c=function(_0x1b8f6f,_0x3dacc0){_0x1b8f6f=_0x1b8f6f-0x0;var _0x15410d=_0x22c9[_0x1b8f6f];return _0x15410d;};'use strict';var _=require(_0x922c('0x0'));var util=require(_0x922c('0x1'));var moment=require(_0x922c('0x2'));var BPromise=require(_0x922c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x922c('0x4'))['db'];var utils=require(_0x922c('0x5'));var logger=require(_0x922c('0x6'))(_0x922c('0x7'));var config=require(_0x922c('0x8'));var jayson=require(_0x922c('0x9'));var client=jayson[_0x922c('0xa')][_0x922c('0xb')]({'port':0x232a});config[_0x922c('0xc')]=_[_0x922c('0xd')](config[_0x922c('0xc')],{'host':_0x922c('0xe'),'port':0x18eb});var socket=require(_0x922c('0xf'))(new Redis(config[_0x922c('0xc')]));require(_0x922c('0x10'))[_0x922c('0x11')](socket);function respondWithRpcPromise(_0x5c30ae,_0x5babe1,_0x51931e){return new BPromise(function(_0x22b029,_0x36ea4b){return client[_0x922c('0x12')](_0x5c30ae,_0x51931e)[_0x922c('0x13')](function(_0x2a8cf7){logger[_0x922c('0x14')](_0x922c('0x15'),_0x5babe1,'request\x20sent');logger[_0x922c('0x16')](_0x922c('0x17'),_0x5babe1,_0x922c('0x18'),JSON['stringify'](_0x2a8cf7));if(_0x2a8cf7['error']){if(_0x2a8cf7['error']['code']===0x1f4){logger['error'](_0x922c('0x15'),_0x5babe1,_0x2a8cf7[_0x922c('0x19')][_0x922c('0x1a')]);return _0x36ea4b(_0x2a8cf7['error'][_0x922c('0x1a')]);}logger['error'](_0x922c('0x15'),_0x5babe1,_0x2a8cf7[_0x922c('0x19')]['message']);return _0x22b029(_0x2a8cf7['error'][_0x922c('0x1a')]);}else{logger['info'](_0x922c('0x15'),_0x5babe1,'request\x20sent');_0x22b029(_0x2a8cf7[_0x922c('0x1b')][_0x922c('0x1a')]);}})[_0x922c('0x1c')](function(_0x3fdee5){logger[_0x922c('0x19')](_0x922c('0x15'),_0x5babe1,_0x3fdee5);_0x36ea4b(_0x3fdee5);});});}exports[_0x922c('0x1d')]=function(_0x405738){var _0x4dd59a=this;return new Promise(function(_0x1b70ff,_0x2f076f){return db[_0x922c('0x1e')][_0x922c('0x1f')]({'raw':_0x405738['options']?_0x405738[_0x922c('0x20')][_0x922c('0x21')]===undefined?!![]:![]:!![],'where':_0x405738[_0x922c('0x20')]?_0x405738[_0x922c('0x20')][_0x922c('0x22')]||null:null,'attributes':_0x405738['options']?_0x405738['options'][_0x922c('0x23')]||null:null,'limit':_0x405738[_0x922c('0x20')]?_0x405738[_0x922c('0x20')][_0x922c('0x24')]||null:null,'include':_0x405738[_0x922c('0x20')]?_0x405738[_0x922c('0x20')][_0x922c('0x25')]?_[_0x922c('0x26')](_0x405738[_0x922c('0x20')][_0x922c('0x25')],function(_0x1b95a0){return{'model':db[_0x1b95a0['model']],'as':_0x1b95a0['as'],'attributes':_0x1b95a0[_0x922c('0x23')],'include':_0x1b95a0[_0x922c('0x25')]?_[_0x922c('0x26')](_0x1b95a0[_0x922c('0x25')],function(_0x1b2b3d){return{'model':db[_0x1b2b3d[_0x922c('0x27')]],'as':_0x1b2b3d['as'],'attributes':_0x1b2b3d['attributes'],'include':_0x1b2b3d['include']?_[_0x922c('0x26')](_0x1b2b3d[_0x922c('0x25')],function(_0x2f9ccb){return{'model':db[_0x2f9ccb[_0x922c('0x27')]],'as':_0x2f9ccb['as'],'attributes':_0x2f9ccb[_0x922c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x922c('0x13')](function(_0x41e4f2){logger[_0x922c('0x14')](_0x922c('0x1d'),_0x405738);logger[_0x922c('0x16')](_0x922c('0x1d'),_0x405738,JSON[_0x922c('0x28')](_0x41e4f2));_0x1b70ff(_0x41e4f2);})[_0x922c('0x1c')](function(_0x22e3e4){logger[_0x922c('0x19')](_0x922c('0x1d'),_0x22e3e4[_0x922c('0x1a')],_0x405738);_0x2f076f(_0x4dd59a[_0x922c('0x19')](0x1f4,_0x22e3e4[_0x922c('0x1a')]));});});};exports[_0x922c('0x29')]=function(_0x275e3a){var _0x20f30b=this;return new Promise(function(_0x12b31c,_0x45ecd4){return db[_0x922c('0x1e')]['find']({'raw':_0x275e3a['options']?_0x275e3a[_0x922c('0x20')][_0x922c('0x21')]===undefined?!![]:![]:!![],'where':_0x275e3a['options']?_0x275e3a[_0x922c('0x20')]['where']||null:null,'attributes':_0x275e3a[_0x922c('0x20')]?_0x275e3a[_0x922c('0x20')]['attributes']||null:null,'include':_0x275e3a['options']?_0x275e3a[_0x922c('0x20')][_0x922c('0x25')]?_[_0x922c('0x26')](_0x275e3a['options']['include'],function(_0x47f49f){return{'model':db[_0x47f49f[_0x922c('0x27')]],'as':_0x47f49f['as'],'attributes':_0x47f49f[_0x922c('0x23')],'include':_0x47f49f[_0x922c('0x25')]?_['map'](_0x47f49f['include'],function(_0x246c81){return{'model':db[_0x246c81[_0x922c('0x27')]],'as':_0x246c81['as'],'attributes':_0x246c81[_0x922c('0x23')],'include':_0x246c81[_0x922c('0x25')]?_[_0x922c('0x26')](_0x246c81[_0x922c('0x25')],function(_0xc4388d){return{'model':db[_0xc4388d[_0x922c('0x27')]],'as':_0xc4388d['as'],'attributes':_0xc4388d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8328dd){logger[_0x922c('0x14')](_0x922c('0x29'),_0x275e3a);logger['debug']('ShowMailQueue',_0x275e3a,JSON[_0x922c('0x28')](_0x8328dd));_0x12b31c(_0x8328dd);})[_0x922c('0x1c')](function(_0x4aa8a3){logger[_0x922c('0x19')](_0x922c('0x29'),_0x4aa8a3['message'],_0x275e3a);_0x45ecd4(_0x20f30b[_0x922c('0x19')](0x1f4,_0x4aa8a3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d802acf..0168c95 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 _0xa9d6=['./mailQueue.events','save','remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0x489ea2,_0x2df9bb){var _0xcb5c6b=function(_0x70024){while(--_0x70024){_0x489ea2['push'](_0x489ea2['shift']());}};_0xcb5c6b(++_0x2df9bb);}(_0xa9d6,0x1ef));var _0x6a9d=function(_0x152e43,_0x23715d){_0x152e43=_0x152e43-0x0;var _0x4fd1ac=_0xa9d6[_0x152e43];return _0x4fd1ac;};'use strict';var MailQueueEvents=require(_0x6a9d('0x0'));var events=[_0x6a9d('0x1'),_0x6a9d('0x2'),_0x6a9d('0x3')];function createListener(_0x3fa9fe,_0x3e2efe){return function(_0x13cdb4){_0x3e2efe[_0x6a9d('0x4')](_0x3fa9fe,_0x13cdb4);};}function removeListener(_0x328b0e,_0xa1c7f9){return function(){MailQueueEvents[_0x6a9d('0x5')](_0x328b0e,_0xa1c7f9);};}exports[_0x6a9d('0x6')]=function(_0x51b14c){for(var _0x1615aa=0x0,_0xe04900=events[_0x6a9d('0x7')];_0x1615aa<_0xe04900;_0x1615aa++){var _0x47d959=events[_0x1615aa];var _0x2905ec=createListener(_0x6a9d('0x8')+_0x47d959,_0x51b14c);MailQueueEvents['on'](_0x47d959,_0x2905ec);}}; \ No newline at end of file +var _0xa39f=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','emit'];(function(_0x450ec1,_0x4adab9){var _0x261897=function(_0x33aabb){while(--_0x33aabb){_0x450ec1['push'](_0x450ec1['shift']());}};_0x261897(++_0x4adab9);}(_0xa39f,0x1e4));var _0xfa39=function(_0x5305f2,_0x180334){_0x5305f2=_0x5305f2-0x0;var _0x59a8f7=_0xa39f[_0x5305f2];return _0x59a8f7;};'use strict';var MailQueueEvents=require(_0xfa39('0x0'));var events=[_0xfa39('0x1'),_0xfa39('0x2'),'update'];function createListener(_0x19139b,_0x441780){return function(_0x1e7851){_0x441780[_0xfa39('0x3')](_0x19139b,_0x1e7851);};}function removeListener(_0x30e6f3,_0x27be8f){return function(){MailQueueEvents[_0xfa39('0x4')](_0x30e6f3,_0x27be8f);};}exports[_0xfa39('0x5')]=function(_0x47dd92){for(var _0x58fbc4=0x0,_0x3d47cc=events[_0xfa39('0x6')];_0x58fbc4<_0x3d47cc;_0x58fbc4++){var _0x4044bc=events[_0x58fbc4];var _0x1ed1f5=createListener(_0xfa39('0x7')+_0x4044bc,_0x47dd92);MailQueueEvents['on'](_0x4044bc,_0x1ed1f5);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 9247993..d09f7a1 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 _0xf858=['get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller'];(function(_0x239d20,_0x449242){var _0x1ff4c1=function(_0x5516e7){while(--_0x5516e7){_0x239d20['push'](_0x239d20['shift']());}};_0x1ff4c1(++_0x449242);}(_0xf858,0x14d));var _0x8f85=function(_0x447209,_0x28cf3d){_0x447209=_0x447209-0x0;var _0x37a12e=_0xf858[_0x447209];return _0x37a12e;};'use strict';var multer=require(_0x8f85('0x0'));var util=require(_0x8f85('0x1'));var path=require(_0x8f85('0x2'));var timeout=require(_0x8f85('0x3'));var express=require(_0x8f85('0x4'));var router=express['Router']();var fs_extra=require(_0x8f85('0x5'));var auth=require(_0x8f85('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8f85('0x7'));var controller=require(_0x8f85('0x8'));router[_0x8f85('0x9')]('/',auth[_0x8f85('0xa')](),controller[_0x8f85('0xb')]);router[_0x8f85('0x9')]('/describe',auth[_0x8f85('0xa')](),controller['describe']);router[_0x8f85('0x9')](_0x8f85('0xc'),auth[_0x8f85('0xa')](),controller[_0x8f85('0xd')]);router[_0x8f85('0xe')]('/',auth[_0x8f85('0xa')](),controller[_0x8f85('0xf')]);router['put'](_0x8f85('0xc'),auth[_0x8f85('0xa')](),controller['update']);router[_0x8f85('0x10')](_0x8f85('0xc'),auth[_0x8f85('0xa')](),controller[_0x8f85('0x11')]);module[_0x8f85('0x12')]=router; \ No newline at end of file +var _0x3132=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3d71ba,_0x49a38b){var _0x5e0ed0=function(_0x4d0bfb){while(--_0x4d0bfb){_0x3d71ba['push'](_0x3d71ba['shift']());}};_0x5e0ed0(++_0x49a38b);}(_0x3132,0x72));var _0x2313=function(_0x5aa992,_0x559ebb){_0x5aa992=_0x5aa992-0x0;var _0x2e2d59=_0x3132[_0x5aa992];return _0x2e2d59;};'use strict';var multer=require(_0x2313('0x0'));var util=require('util');var path=require(_0x2313('0x1'));var timeout=require(_0x2313('0x2'));var express=require(_0x2313('0x3'));var router=express[_0x2313('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2313('0x5'));var interaction=require(_0x2313('0x6'));var config=require(_0x2313('0x7'));var controller=require('./mailQueueReport.controller');router[_0x2313('0x8')]('/',auth['isAuthenticated'](),controller[_0x2313('0x9')]);router['get'](_0x2313('0xa'),auth[_0x2313('0xb')](),controller[_0x2313('0xc')]);router[_0x2313('0x8')](_0x2313('0xd'),auth[_0x2313('0xb')](),controller[_0x2313('0xe')]);router[_0x2313('0xf')]('/',auth[_0x2313('0xb')](),controller[_0x2313('0x10')]);router[_0x2313('0x11')](_0x2313('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2313('0x12')]('/:id',auth[_0x2313('0xb')](),controller['destroy']);module[_0x2313('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index dbd2bba..e0a9a4e 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 _0x54f3=['DATE','exports','STRING'];(function(_0x45a193,_0x497b0a){var _0x226ff2=function(_0x358523){while(--_0x358523){_0x45a193['push'](_0x45a193['shift']());}};_0x226ff2(++_0x497b0a);}(_0x54f3,0x16c));var _0x354f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x54f3[_0xfae23b];return _0x200640;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x354f('0x0')]={'uniqueid':{'type':Sequelize[_0x354f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x354f('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x354f('0x2')]},'acceptAt':{'type':Sequelize[_0x354f('0x2')]},'exitAt':{'type':Sequelize[_0x354f('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x38f6=['exports','STRING','DATE'];(function(_0x12ab09,_0xc1bf6b){var _0x23e5ac=function(_0x45a545){while(--_0x45a545){_0x12ab09['push'](_0x12ab09['shift']());}};_0x23e5ac(++_0xc1bf6b);}(_0x38f6,0x1b6));var _0x638f=function(_0x345a3,_0x486e3d){_0x345a3=_0x345a3-0x0;var _0x5855c4=_0x38f6[_0x345a3];return _0x5855c4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x638f('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x638f('0x1')]},'joinAt':{'type':Sequelize[_0x638f('0x2')]},'leaveAt':{'type':Sequelize[_0x638f('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x638f('0x2')]},'reason':{'type':Sequelize[_0x638f('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d47263e..4919846 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 _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','type'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['MailQueueReport'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['MailQueueReport']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file +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(_0x3432c4,_0x3a710f){var _0xc953f4=function(_0x56feda){while(--_0x56feda){_0x3432c4['push'](_0x3432c4['shift']());}};_0xc953f4(++_0x3a710f);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x41bbe3,_0x58296a){_0x41bbe3=_0x41bbe3-0x0;var _0x2685af=_0xc1c6[_0x41bbe3];return _0x2685af;};'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 diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 681eb96..c8f6237 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 _0xb8de=['moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x3069b3,_0x35049a){var _0x33c845=function(_0x236f99){while(--_0x236f99){_0x3069b3['push'](_0x3069b3['shift']());}};_0x33c845(++_0x35049a);}(_0xb8de,0xa7));var _0xeb8d=function(_0x4aa09f,_0x25f755){_0x4aa09f=_0x4aa09f-0x0;var _0x3089af=_0xb8de[_0x4aa09f];return _0x3089af;};'use strict';var _=require(_0xeb8d('0x0'));var util=require(_0xeb8d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb8d('0x2'));var BPromise=require(_0xeb8d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb8d('0x4'));var rimraf=require(_0xeb8d('0x5'));var config=require(_0xeb8d('0x6'));var attributes=require(_0xeb8d('0x7'));module[_0xeb8d('0x8')]=function(_0x1d8416,_0x3c5f15){return _0x1d8416[_0xeb8d('0x9')](_0xeb8d('0xa'),attributes,{'tableName':_0xeb8d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xeb8d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1db6=['MailQueueReport','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','./mailQueueReport.attributes','exports'];(function(_0x2b9bb1,_0x8b8eed){var _0x4f6c08=function(_0x48a4a1){while(--_0x48a4a1){_0x2b9bb1['push'](_0x2b9bb1['shift']());}};_0x4f6c08(++_0x8b8eed);}(_0x1db6,0xb6));var _0x61db=function(_0x2020eb,_0x4249c1){_0x2020eb=_0x2020eb-0x0;var _0x3825ef=_0x1db6[_0x2020eb];return _0x3825ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x61db('0x0'))(_0x61db('0x1'));var moment=require(_0x61db('0x2'));var BPromise=require(_0x61db('0x3'));var rp=require(_0x61db('0x4'));var fs=require('fs');var path=require(_0x61db('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x61db('0x6'));module[_0x61db('0x7')]=function(_0x3cdcb0,_0x57de66){return _0x3cdcb0['define'](_0x61db('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x61db('0x9'),'fields':[_0x61db('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 98bb941..7a84cd3 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x2ef3,0xba));var _0x32ef=function(_0x3e77cd,_0x5b4a2d){_0x3e77cd=_0x3e77cd-0x0;var _0x8707c4=_0x2ef3[_0x3e77cd];return _0x8707c4;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x127983,_0x50af8f){var _0x251fbe=function(_0x1f9cbb){while(--_0x1f9cbb){_0x127983['push'](_0x127983['shift']());}};_0x251fbe(++_0x50af8f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 133b2ea..f68b564 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x385359,_0x325c57){var _0x2ea4dd=function(_0x1bcf4f){while(--_0x1bcf4f){_0x385359['push'](_0x385359['shift']());}};_0x2ea4dd(++_0x325c57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5cd300,_0x1b5e93){var _0x104113=function(_0x38b316){while(--_0x38b316){_0x5cd300['push'](_0x5cd300['shift']());}};_0x104113(++_0x1b5e93);}(_0xe706,0xa3));var _0x6e70=function(_0xabbd65,_0x546d99){_0xabbd65=_0xabbd65-0x0;var _0x1d005a=_0xe706[_0xabbd65];return _0x1d005a;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0f4b7ac..597e9f1 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 _0x3a41=['INTEGER','INBOX','sequelize','STRING','BOOLEAN'];(function(_0x2a92fb,_0x3fbd10){var _0x140468=function(_0x3a34b3){while(--_0x3a34b3){_0x2a92fb['push'](_0x2a92fb['shift']());}};_0x140468(++_0x3fbd10);}(_0x3a41,0x151));var _0x13a4=function(_0x15eb63,_0xd3f629){_0x15eb63=_0x15eb63-0x0;var _0x19fc81=_0x3a41[_0x15eb63];return _0x19fc81;};'use strict';var Sequelize=require(_0x13a4('0x0'));module['exports']={'description':{'type':Sequelize[_0x13a4('0x1')]},'host':{'type':Sequelize[_0x13a4('0x1')]},'authentication':{'type':Sequelize[_0x13a4('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x13a4('0x1')]},'password':{'type':Sequelize[_0x13a4('0x1')]},'port':{'type':Sequelize[_0x13a4('0x3')]},'tls':{'type':Sequelize[_0x13a4('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x13a4('0x1')],'defaultValue':_0x13a4('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x13a4('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x13a4('0x1')]},'modernAuthentication':{'type':Sequelize[_0x13a4('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xd133=['sequelize','exports','INTEGER','BOOLEAN','STRING','INBOX'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xd133,0x84));var _0x3d13=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0xd133[_0x2baca1];return _0x9aa62a;};'use strict';var Sequelize=require(_0x3d13('0x0'));module[_0x3d13('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3d13('0x2')]},'tls':{'type':Sequelize[_0x3d13('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3d13('0x4')],'defaultValue':_0x3d13('0x5')},'connTimeout':{'type':Sequelize[_0x3d13('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x3d13('0x4')]},'modernAuthentication':{'type':Sequelize[_0x3d13('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 fb9f8d9..2146fec 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 _0x1bb8=['mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailServerIn.attributes','define','MailServerIn'];(function(_0x38a162,_0x4396b2){var _0x1f622b=function(_0x3b3a60){while(--_0x3b3a60){_0x38a162['push'](_0x38a162['shift']());}};_0x1f622b(++_0x4396b2);}(_0x1bb8,0xe5));var _0x81bb=function(_0x39204d,_0x1e3861){_0x39204d=_0x39204d-0x0;var _0x15b0bf=_0x1bb8[_0x39204d];return _0x15b0bf;};'use strict';var _=require(_0x81bb('0x0'));var util=require(_0x81bb('0x1'));var logger=require(_0x81bb('0x2'))(_0x81bb('0x3'));var moment=require(_0x81bb('0x4'));var BPromise=require(_0x81bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81bb('0x6'));var rimraf=require('rimraf');var config=require(_0x81bb('0x7'));var attributes=require(_0x81bb('0x8'));module['exports']=function(_0x3c2924,_0x51b17a){return _0x3c2924[_0x81bb('0x9')](_0x81bb('0xa'),attributes,{'tableName':_0x81bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c10=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x17c688,_0x5231f8){var _0x5addc7=function(_0xaee593){while(--_0xaee593){_0x17c688['push'](_0x17c688['shift']());}};_0x5addc7(++_0x5231f8);}(_0x7c10,0x143));var _0x07c1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7c10[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x07c1('0x0'));var util=require(_0x07c1('0x1'));var logger=require('../../config/logger')(_0x07c1('0x2'));var moment=require(_0x07c1('0x3'));var BPromise=require(_0x07c1('0x4'));var rp=require(_0x07c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07c1('0x6'));var config=require(_0x07c1('0x7'));var attributes=require(_0x07c1('0x8'));module[_0x07c1('0x9')]=function(_0x177996,_0x213146){return _0x177996[_0x07c1('0xa')](_0x07c1('0xb'),attributes,{'tableName':_0x07c1('0xc'),'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 829bdad..5640abc 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 _0x6343=['jayson/promise','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','MailServerIn','findAll','options','where','attributes','limit','include','map','model','GetMailServerIn','stringify','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5a7112,_0x1f9492){var _0x3147f7=function(_0x4d2329){while(--_0x4d2329){_0x5a7112['push'](_0x5a7112['shift']());}};_0x3147f7(++_0x1f9492);}(_0x6343,0x1e9));var _0x3634=function(_0x2012c4,_0x51f3cb){_0x2012c4=_0x2012c4-0x0;var _0x4f7671=_0x6343[_0x2012c4];return _0x4f7671;};'use strict';var _=require('lodash');var util=require(_0x3634('0x0'));var moment=require(_0x3634('0x1'));var BPromise=require(_0x3634('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3634('0x3'))['db'];var utils=require(_0x3634('0x4'));var logger=require(_0x3634('0x5'))('rpc');var config=require(_0x3634('0x6'));var jayson=require(_0x3634('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5410d3,_0x1514b6,_0x25775d){return new BPromise(function(_0x151c89,_0x3089eb){return client[_0x3634('0x8')](_0x5410d3,_0x25775d)[_0x3634('0x9')](function(_0x30f0fe){logger[_0x3634('0xa')](_0x3634('0xb'),_0x1514b6,_0x3634('0xc'));logger[_0x3634('0xd')](_0x3634('0xe'),_0x1514b6,'request\x20sent',JSON['stringify'](_0x30f0fe));if(_0x30f0fe['error']){if(_0x30f0fe['error'][_0x3634('0xf')]===0x1f4){logger['error'](_0x3634('0xb'),_0x1514b6,_0x30f0fe[_0x3634('0x10')][_0x3634('0x11')]);return _0x3089eb(_0x30f0fe[_0x3634('0x10')][_0x3634('0x11')]);}logger[_0x3634('0x10')](_0x3634('0xb'),_0x1514b6,_0x30f0fe['error']['message']);return _0x151c89(_0x30f0fe['error']['message']);}else{logger[_0x3634('0xa')](_0x3634('0xb'),_0x1514b6,'request\x20sent');_0x151c89(_0x30f0fe[_0x3634('0x12')][_0x3634('0x11')]);}})[_0x3634('0x13')](function(_0x414a46){logger[_0x3634('0x10')](_0x3634('0xb'),_0x1514b6,_0x414a46);_0x3089eb(_0x414a46);});});}exports['GetMailServerIn']=function(_0x6bc093){var _0x4d8cd7=this;return new Promise(function(_0x137ea4,_0x2da11a){return db[_0x3634('0x14')][_0x3634('0x15')]({'raw':_0x6bc093[_0x3634('0x16')]?_0x6bc093[_0x3634('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x6bc093[_0x3634('0x16')]?_0x6bc093[_0x3634('0x16')][_0x3634('0x17')]||null:null,'attributes':_0x6bc093[_0x3634('0x16')]?_0x6bc093[_0x3634('0x16')][_0x3634('0x18')]||null:null,'limit':_0x6bc093[_0x3634('0x16')]?_0x6bc093['options'][_0x3634('0x19')]||null:null,'include':_0x6bc093[_0x3634('0x16')]?_0x6bc093[_0x3634('0x16')][_0x3634('0x1a')]?_['map'](_0x6bc093[_0x3634('0x16')][_0x3634('0x1a')],function(_0x54350c){return{'model':db[_0x54350c['model']],'as':_0x54350c['as'],'attributes':_0x54350c[_0x3634('0x18')],'include':_0x54350c[_0x3634('0x1a')]?_[_0x3634('0x1b')](_0x54350c['include'],function(_0x2dbdfb){return{'model':db[_0x2dbdfb[_0x3634('0x1c')]],'as':_0x2dbdfb['as'],'attributes':_0x2dbdfb[_0x3634('0x18')],'include':_0x2dbdfb['include']?_[_0x3634('0x1b')](_0x2dbdfb['include'],function(_0x4c1dca){return{'model':db[_0x4c1dca[_0x3634('0x1c')]],'as':_0x4c1dca['as'],'attributes':_0x4c1dca[_0x3634('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3634('0x9')](function(_0x39abd8){logger[_0x3634('0xa')](_0x3634('0x1d'),_0x6bc093);logger[_0x3634('0xd')](_0x3634('0x1d'),_0x6bc093,JSON[_0x3634('0x1e')](_0x39abd8));_0x137ea4(_0x39abd8);})[_0x3634('0x13')](function(_0xeabd0d){logger['error']('GetMailServerIn',_0xeabd0d[_0x3634('0x11')],_0x6bc093);_0x2da11a(_0x4d8cd7[_0x3634('0x10')](0x1f4,_0xeabd0d[_0x3634('0x11')]));});});}; \ No newline at end of file +var _0x1cbb=['model','map','GetMailServerIn','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','include'];(function(_0xbd707c,_0xbec46a){var _0x1c5485=function(_0x222f41){while(--_0x222f41){_0xbd707c['push'](_0xbd707c['shift']());}};_0x1c5485(++_0xbec46a);}(_0x1cbb,0x18f));var _0xb1cb=function(_0x180283,_0x490f26){_0x180283=_0x180283-0x0;var _0x2ba3a1=_0x1cbb[_0x180283];return _0x2ba3a1;};'use strict';var _=require(_0xb1cb('0x0'));var util=require(_0xb1cb('0x1'));var moment=require('moment');var BPromise=require(_0xb1cb('0x2'));var rs=require(_0xb1cb('0x3'));var fs=require('fs');var Redis=require(_0xb1cb('0x4'));var db=require(_0xb1cb('0x5'))['db'];var utils=require(_0xb1cb('0x6'));var logger=require('../../config/logger')(_0xb1cb('0x7'));var config=require(_0xb1cb('0x8'));var jayson=require(_0xb1cb('0x9'));var client=jayson[_0xb1cb('0xa')][_0xb1cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45f616,_0x405e0e,_0x186d1e){return new BPromise(function(_0x5cab24,_0x530feb){return client[_0xb1cb('0xc')](_0x45f616,_0x186d1e)[_0xb1cb('0xd')](function(_0x3e9606){logger[_0xb1cb('0xe')](_0xb1cb('0xf'),_0x405e0e,_0xb1cb('0x10'));logger[_0xb1cb('0x11')](_0xb1cb('0x12'),_0x405e0e,_0xb1cb('0x10'),JSON[_0xb1cb('0x13')](_0x3e9606));if(_0x3e9606[_0xb1cb('0x14')]){if(_0x3e9606['error'][_0xb1cb('0x15')]===0x1f4){logger[_0xb1cb('0x14')](_0xb1cb('0xf'),_0x405e0e,_0x3e9606['error']['message']);return _0x530feb(_0x3e9606[_0xb1cb('0x14')][_0xb1cb('0x16')]);}logger[_0xb1cb('0x14')](_0xb1cb('0xf'),_0x405e0e,_0x3e9606[_0xb1cb('0x14')][_0xb1cb('0x16')]);return _0x5cab24(_0x3e9606[_0xb1cb('0x14')]['message']);}else{logger[_0xb1cb('0xe')]('MailServerIn,\x20%s,\x20%s',_0x405e0e,_0xb1cb('0x10'));_0x5cab24(_0x3e9606[_0xb1cb('0x17')][_0xb1cb('0x16')]);}})[_0xb1cb('0x18')](function(_0x255ef6){logger[_0xb1cb('0x14')](_0xb1cb('0xf'),_0x405e0e,_0x255ef6);_0x530feb(_0x255ef6);});});}exports['GetMailServerIn']=function(_0x12487f){var _0x1a551e=this;return new Promise(function(_0xc78a83,_0x456a25){return db['MailServerIn'][_0xb1cb('0x19')]({'raw':_0x12487f[_0xb1cb('0x1a')]?_0x12487f[_0xb1cb('0x1a')][_0xb1cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x12487f[_0xb1cb('0x1a')]?_0x12487f['options']['where']||null:null,'attributes':_0x12487f[_0xb1cb('0x1a')]?_0x12487f[_0xb1cb('0x1a')][_0xb1cb('0x1c')]||null:null,'limit':_0x12487f['options']?_0x12487f['options']['limit']||null:null,'include':_0x12487f[_0xb1cb('0x1a')]?_0x12487f['options']['include']?_['map'](_0x12487f['options'][_0xb1cb('0x1d')],function(_0x211526){return{'model':db[_0x211526[_0xb1cb('0x1e')]],'as':_0x211526['as'],'attributes':_0x211526[_0xb1cb('0x1c')],'include':_0x211526[_0xb1cb('0x1d')]?_['map'](_0x211526[_0xb1cb('0x1d')],function(_0xe6e782){return{'model':db[_0xe6e782['model']],'as':_0xe6e782['as'],'attributes':_0xe6e782[_0xb1cb('0x1c')],'include':_0xe6e782[_0xb1cb('0x1d')]?_[_0xb1cb('0x1f')](_0xe6e782[_0xb1cb('0x1d')],function(_0x253d1b){return{'model':db[_0x253d1b['model']],'as':_0x253d1b['as'],'attributes':_0x253d1b['attributes']};}):[]};}):[]};}):[]:[]})[_0xb1cb('0xd')](function(_0x557b3d){logger[_0xb1cb('0xe')](_0xb1cb('0x20'),_0x12487f);logger[_0xb1cb('0x11')]('GetMailServerIn',_0x12487f,JSON[_0xb1cb('0x13')](_0x557b3d));_0xc78a83(_0x557b3d);})[_0xb1cb('0x18')](function(_0xf08c34){logger[_0xb1cb('0x14')](_0xb1cb('0x20'),_0xf08c34[_0xb1cb('0x16')],_0x12487f);_0x456a25(_0x1a551e[_0xb1cb('0x14')](0x1f4,_0xf08c34[_0xb1cb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 13622cb..ec96204 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a54,0x106));var _0x47a5=function(_0x14f5d0,_0x140816){_0x14f5d0=_0x14f5d0-0x0;var _0x1af7e9=_0x7a54[_0x14f5d0];return _0x1af7e9;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0xd41388,_0x4eb3ac){_0xd41388=_0xd41388-0x0;var _0x57e71a=_0x7a54[_0xd41388];return _0x57e71a;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 238626b..8fa69a9 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74f=['BOOLEAN','STRING','INTEGER'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa74f,0x9a));var _0xfa74=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0xa74f[_0x5f519b];return _0x2461e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xfa74('0x0')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xfa74('0x0')]},'port':{'type':Sequelize[_0xfa74('0x1')]},'secure':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xfa74('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x36ee=['BOOLEAN','STRING','INTEGER'];(function(_0x4605a6,_0x4ee25f){var _0x18bc7a=function(_0x2f1228){while(--_0x2f1228){_0x4605a6['push'](_0x4605a6['shift']());}};_0x18bc7a(++_0x4ee25f);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xe36e('0x0')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe36e('0x0')]},'pass':{'type':Sequelize[_0xe36e('0x0')]},'port':{'type':Sequelize[_0xe36e('0x1')]},'secure':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xe36e('0x0')]},'authentication':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xe36e('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 61195a6..c3751fb 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 _0x16ab=['keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','nolimit','sort','pick','filters','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x4655a3,_0x25ad7d){var _0x1dfa29=function(_0x2a6475){while(--_0x2a6475){_0x4655a3['push'](_0x4655a3['shift']());}};_0x1dfa29(++_0x25ad7d);}(_0x16ab,0xe6));var _0xb16a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x16ab[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0xb16a('0x0'));var rimraf=require(_0xb16a('0x1'));var zipdir=require(_0xb16a('0x2'));var jsonpatch=require(_0xb16a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb16a('0x4'));var Mustache=require(_0xb16a('0x5'));var util=require(_0xb16a('0x6'));var path=require(_0xb16a('0x7'));var sox=require(_0xb16a('0x8'));var csv=require(_0xb16a('0x9'));var ejs=require(_0xb16a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb16a('0xb'));var squel=require(_0xb16a('0xc'));var crypto=require(_0xb16a('0xd'));var jsforce=require(_0xb16a('0xe'));var deskjs=require(_0xb16a('0xf'));var toCsv=require(_0xb16a('0x9'));var querystring=require(_0xb16a('0x10'));var Papa=require(_0xb16a('0x11'));var Redis=require(_0xb16a('0x12'));var authService=require(_0xb16a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb16a('0x14'))(_0xb16a('0x15'));var utils=require(_0xb16a('0x16'));var config=require(_0xb16a('0x17'));var licenseUtil=require(_0xb16a('0x18'));var db=require(_0xb16a('0x19'))['db'];function respondWithStatusCode(_0x568978,_0x532e4b){_0x532e4b=_0x532e4b||0xcc;return function(_0x293f5d){if(_0x293f5d){return _0x568978[_0xb16a('0x1a')](_0x532e4b);}return _0x568978['status'](_0x532e4b)[_0xb16a('0x1b')]();};}function respondWithResult(_0x3ba05c,_0x146221){_0x146221=_0x146221||0xc8;return function(_0x4f1deb){if(_0x4f1deb){return _0x3ba05c[_0xb16a('0x1c')](_0x146221)[_0xb16a('0x1d')](_0x4f1deb);}};}function respondWithFilteredResult(_0x1ed83d,_0xa3842c){return function(_0x3e2586){if(_0x3e2586){var _0x125aaa=typeof _0xa3842c[_0xb16a('0x1e')]===_0xb16a('0x1f')&&typeof _0xa3842c[_0xb16a('0x20')]===_0xb16a('0x1f');var _0x500a03=_0x3e2586[_0xb16a('0x21')];var _0x21f01c=_0x125aaa?0x0:_0xa3842c[_0xb16a('0x1e')];var _0x30b019=_0x125aaa?_0x3e2586[_0xb16a('0x21')]:_0xa3842c[_0xb16a('0x1e')]+_0xa3842c[_0xb16a('0x20')];var _0x1430f5;if(_0x30b019>=_0x500a03){_0x30b019=_0x500a03;_0x1430f5=0xc8;}else{_0x1430f5=0xce;}_0x1ed83d[_0xb16a('0x1c')](_0x1430f5);return _0x1ed83d[_0xb16a('0x22')]('Content-Range',_0x21f01c+'-'+_0x30b019+'/'+_0x500a03)[_0xb16a('0x1d')](_0x3e2586);}return null;};}function patchUpdates(_0x1c5857){return function(_0x2ca862){try{jsonpatch[_0xb16a('0x23')](_0x2ca862,_0x1c5857,!![]);}catch(_0x33b1f8){return BPromise[_0xb16a('0x24')](_0x33b1f8);}return _0x2ca862[_0xb16a('0x25')]();};}function saveUpdates(_0x193ef8,_0x872ab3){return function(_0x2ef1a5){if(_0x2ef1a5){return _0x2ef1a5[_0xb16a('0x26')](_0x193ef8)[_0xb16a('0x27')](function(_0x413cf5){return _0x413cf5;});}return null;};}function removeEntity(_0x2e30b3,_0x1b6902){return function(_0x8e221c){if(_0x8e221c){return _0x8e221c[_0xb16a('0x28')]()[_0xb16a('0x27')](function(){_0x2e30b3['status'](0xcc)[_0xb16a('0x1b')]();});}};}function handleEntityNotFound(_0x19d44a,_0x2f125e){return function(_0x4b2b64){if(!_0x4b2b64){_0x19d44a['sendStatus'](0x194);}return _0x4b2b64;};}function handleError(_0x23bdcd,_0x5e25e4){_0x5e25e4=_0x5e25e4||0x1f4;return function(_0x7f1f11){logger['error'](_0x7f1f11[_0xb16a('0x29')]);if(_0x7f1f11[_0xb16a('0x2a')]){delete _0x7f1f11[_0xb16a('0x2a')];}_0x23bdcd['status'](_0x5e25e4)['send'](_0x7f1f11);};}exports[_0xb16a('0x2b')]=function(_0x520c7f,_0x5142f9){var _0x75a06d={},_0xe9ce7f={},_0x4e2f88={'count':0x0,'rows':[]};var _0x504373=_['map'](db[_0xb16a('0x2c')][_0xb16a('0x2d')],function(_0x1bc1f1){return{'name':_0x1bc1f1[_0xb16a('0x2e')],'type':_0x1bc1f1[_0xb16a('0x2f')][_0xb16a('0x30')]};});_0xe9ce7f[_0xb16a('0x31')]=_[_0xb16a('0x32')](_0x504373,_0xb16a('0x2a'));_0xe9ce7f[_0xb16a('0x33')]=_['keys'](_0x520c7f['query']);_0xe9ce7f['filters']=_[_0xb16a('0x34')](_0xe9ce7f[_0xb16a('0x31')],_0xe9ce7f[_0xb16a('0x33')]);_0x75a06d['attributes']=_[_0xb16a('0x34')](_0xe9ce7f[_0xb16a('0x31')],qs[_0xb16a('0x35')](_0x520c7f['query'][_0xb16a('0x35')]));_0x75a06d['attributes']=_0x75a06d[_0xb16a('0x36')][_0xb16a('0x37')]?_0x75a06d['attributes']:_0xe9ce7f[_0xb16a('0x31')];if(!_0x520c7f[_0xb16a('0x33')]['hasOwnProperty'](_0xb16a('0x38'))){_0x75a06d[_0xb16a('0x20')]=qs[_0xb16a('0x20')](_0x520c7f[_0xb16a('0x33')][_0xb16a('0x20')]);_0x75a06d[_0xb16a('0x1e')]=qs[_0xb16a('0x1e')](_0x520c7f[_0xb16a('0x33')]['offset']);}_0x75a06d['order']=qs['sort'](_0x520c7f['query'][_0xb16a('0x39')]);_0x75a06d['where']=qs['filters'](_[_0xb16a('0x3a')](_0x520c7f[_0xb16a('0x33')],_0xe9ce7f[_0xb16a('0x3b')]),_0x504373);if(_0x520c7f[_0xb16a('0x33')]['filter']){_0x75a06d['where']=_[_0xb16a('0x3c')](_0x75a06d[_0xb16a('0x3d')],{'$or':_[_0xb16a('0x32')](_0x504373,function(_0x1f2469){if(_0x1f2469[_0xb16a('0x2f')]!==_0xb16a('0x3e')){var _0x51114f={};_0x51114f[_0x1f2469[_0xb16a('0x2a')]]={'$like':'%'+_0x520c7f[_0xb16a('0x33')]['filter']+'%'};return _0x51114f;}})});}_0x75a06d=_['merge']({},_0x75a06d,_0x520c7f[_0xb16a('0x3f')]);var _0x30f590={'where':_0x75a06d[_0xb16a('0x3d')]};return db['MailServerOut'][_0xb16a('0x21')](_0x30f590)[_0xb16a('0x27')](function(_0x364993){_0x4e2f88[_0xb16a('0x21')]=_0x364993;if(_0x520c7f['query'][_0xb16a('0x40')]){_0x75a06d[_0xb16a('0x41')]=[{'all':!![]}];}return db[_0xb16a('0x2c')][_0xb16a('0x42')](_0x75a06d);})[_0xb16a('0x27')](function(_0x215118){_0x4e2f88[_0xb16a('0x43')]=_0x215118;return _0x4e2f88;})[_0xb16a('0x27')](respondWithFilteredResult(_0x5142f9,_0x75a06d))[_0xb16a('0x44')](handleError(_0x5142f9,null));};exports[_0xb16a('0x45')]=function(_0x242672,_0x53ae1b){var _0x4366d0={'raw':!![],'where':{'id':_0x242672['params']['id']}},_0xe45a7a={};_0xe45a7a[_0xb16a('0x31')]=_['keys'](db[_0xb16a('0x2c')][_0xb16a('0x2d')]);_0xe45a7a['query']=_[_0xb16a('0x46')](_0x242672[_0xb16a('0x33')]);_0xe45a7a[_0xb16a('0x3b')]=_['intersection'](_0xe45a7a[_0xb16a('0x31')],_0xe45a7a[_0xb16a('0x33')]);_0x4366d0[_0xb16a('0x36')]=_[_0xb16a('0x34')](_0xe45a7a[_0xb16a('0x31')],qs[_0xb16a('0x35')](_0x242672[_0xb16a('0x33')]['fields']));_0x4366d0['attributes']=_0x4366d0[_0xb16a('0x36')][_0xb16a('0x37')]?_0x4366d0[_0xb16a('0x36')]:_0xe45a7a[_0xb16a('0x31')];if(_0x242672[_0xb16a('0x33')]['includeAll']){_0x4366d0['include']=[{'all':!![]}];}_0x4366d0=_[_0xb16a('0x3c')]({},_0x4366d0,_0x242672[_0xb16a('0x3f')]);return db['MailServerOut'][_0xb16a('0x47')](_0x4366d0)[_0xb16a('0x27')](handleEntityNotFound(_0x53ae1b,null))['then'](respondWithResult(_0x53ae1b,null))['catch'](handleError(_0x53ae1b,null));};exports['create']=function(_0xf06f53,_0x149439){return db[_0xb16a('0x2c')][_0xb16a('0x48')](_0xf06f53[_0xb16a('0x49')],{})[_0xb16a('0x27')](respondWithResult(_0x149439,0xc9))[_0xb16a('0x44')](handleError(_0x149439,null));};exports[_0xb16a('0x26')]=function(_0x346e10,_0x28757d){if(_0x346e10['body']['id']){delete _0x346e10[_0xb16a('0x49')]['id'];}return db[_0xb16a('0x2c')][_0xb16a('0x47')]({'where':{'id':_0x346e10[_0xb16a('0x4a')]['id']}})[_0xb16a('0x27')](handleEntityNotFound(_0x28757d,null))['then'](saveUpdates(_0x346e10[_0xb16a('0x49')],null))['then'](respondWithResult(_0x28757d,null))[_0xb16a('0x44')](handleError(_0x28757d,null));};exports[_0xb16a('0x28')]=function(_0x3e1593,_0x236df3){return db[_0xb16a('0x2c')]['find']({'where':{'id':_0x3e1593[_0xb16a('0x4a')]['id']}})[_0xb16a('0x27')](handleEntityNotFound(_0x236df3,null))[_0xb16a('0x27')](removeEntity(_0x236df3,null))[_0xb16a('0x44')](handleError(_0x236df3,null));}; \ No newline at end of file +var _0x3bd1=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','error','stack','name','map','MailServerOut','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','then','includeAll','include','catch','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce'];(function(_0x3288be,_0x4883df){var _0x1808c5=function(_0x196133){while(--_0x196133){_0x3288be['push'](_0x3288be['shift']());}};_0x1808c5(++_0x4883df);}(_0x3bd1,0x14a));var _0x13bd=function(_0x4ec01b,_0x43eaaa){_0x4ec01b=_0x4ec01b-0x0;var _0x5159bf=_0x3bd1[_0x4ec01b];return _0x5159bf;};'use strict';var emlformat=require(_0x13bd('0x0'));var rimraf=require(_0x13bd('0x1'));var zipdir=require(_0x13bd('0x2'));var jsonpatch=require(_0x13bd('0x3'));var rp=require(_0x13bd('0x4'));var moment=require(_0x13bd('0x5'));var BPromise=require(_0x13bd('0x6'));var Mustache=require(_0x13bd('0x7'));var util=require(_0x13bd('0x8'));var path=require(_0x13bd('0x9'));var sox=require(_0x13bd('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13bd('0xb'));var squel=require(_0x13bd('0xc'));var crypto=require(_0x13bd('0xd'));var jsforce=require(_0x13bd('0xe'));var deskjs=require(_0x13bd('0xf'));var toCsv=require(_0x13bd('0x10'));var querystring=require(_0x13bd('0x11'));var Papa=require(_0x13bd('0x12'));var Redis=require(_0x13bd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x13bd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x13bd('0x15'))(_0x13bd('0x16'));var utils=require('../../config/utils');var config=require(_0x13bd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x13bd('0x18'))['db'];function respondWithStatusCode(_0x6c6f94,_0x364b1c){_0x364b1c=_0x364b1c||0xcc;return function(_0x2e97d2){if(_0x2e97d2){return _0x6c6f94[_0x13bd('0x19')](_0x364b1c);}return _0x6c6f94[_0x13bd('0x1a')](_0x364b1c)[_0x13bd('0x1b')]();};}function respondWithResult(_0x4c82a7,_0x360b5f){_0x360b5f=_0x360b5f||0xc8;return function(_0x4eb4a7){if(_0x4eb4a7){return _0x4c82a7[_0x13bd('0x1a')](_0x360b5f)[_0x13bd('0x1c')](_0x4eb4a7);}};}function respondWithFilteredResult(_0x137e91,_0x3a44a7){return function(_0x425f15){if(_0x425f15){var _0x56b923=typeof _0x3a44a7['offset']==='undefined'&&typeof _0x3a44a7[_0x13bd('0x1d')]===_0x13bd('0x1e');var _0x311b52=_0x425f15[_0x13bd('0x1f')];var _0x5855ee=_0x56b923?0x0:_0x3a44a7[_0x13bd('0x20')];var _0x3cbc93=_0x56b923?_0x425f15[_0x13bd('0x1f')]:_0x3a44a7[_0x13bd('0x20')]+_0x3a44a7[_0x13bd('0x1d')];var _0x19372d;if(_0x3cbc93>=_0x311b52){_0x3cbc93=_0x311b52;_0x19372d=0xc8;}else{_0x19372d=0xce;}_0x137e91[_0x13bd('0x1a')](_0x19372d);return _0x137e91[_0x13bd('0x21')](_0x13bd('0x22'),_0x5855ee+'-'+_0x3cbc93+'/'+_0x311b52)[_0x13bd('0x1c')](_0x425f15);}return null;};}function patchUpdates(_0x29a3d0){return function(_0xef1c15){try{jsonpatch[_0x13bd('0x23')](_0xef1c15,_0x29a3d0,!![]);}catch(_0x3e0c47){return BPromise[_0x13bd('0x24')](_0x3e0c47);}return _0xef1c15[_0x13bd('0x25')]();};}function saveUpdates(_0x51767a,_0x1d2415){return function(_0x35bccd){if(_0x35bccd){return _0x35bccd['update'](_0x51767a)['then'](function(_0x1aa1c1){return _0x1aa1c1;});}return null;};}function removeEntity(_0x1bae79,_0x5ef2a5){return function(_0x65ee28){if(_0x65ee28){return _0x65ee28['destroy']()['then'](function(){_0x1bae79[_0x13bd('0x1a')](0xcc)[_0x13bd('0x1b')]();});}};}function handleEntityNotFound(_0x2ab838,_0x2a8479){return function(_0x4ced8e){if(!_0x4ced8e){_0x2ab838[_0x13bd('0x19')](0x194);}return _0x4ced8e;};}function handleError(_0x2a6292,_0x5a6ee3){_0x5a6ee3=_0x5a6ee3||0x1f4;return function(_0x188806){logger[_0x13bd('0x26')](_0x188806[_0x13bd('0x27')]);if(_0x188806[_0x13bd('0x28')]){delete _0x188806[_0x13bd('0x28')];}_0x2a6292[_0x13bd('0x1a')](_0x5a6ee3)['send'](_0x188806);};}exports['index']=function(_0x367d42,_0x14e66d){var _0x163112={},_0x318400={},_0x5545df={'count':0x0,'rows':[]};var _0x254b81=_[_0x13bd('0x29')](db[_0x13bd('0x2a')][_0x13bd('0x2b')],function(_0x16d881){return{'name':_0x16d881['fieldName'],'type':_0x16d881[_0x13bd('0x2c')]['key']};});_0x318400[_0x13bd('0x2d')]=_[_0x13bd('0x29')](_0x254b81,_0x13bd('0x28'));_0x318400['query']=_['keys'](_0x367d42[_0x13bd('0x2e')]);_0x318400[_0x13bd('0x2f')]=_[_0x13bd('0x30')](_0x318400['model'],_0x318400[_0x13bd('0x2e')]);_0x163112[_0x13bd('0x31')]=_[_0x13bd('0x30')](_0x318400[_0x13bd('0x2d')],qs[_0x13bd('0x32')](_0x367d42[_0x13bd('0x2e')][_0x13bd('0x32')]));_0x163112['attributes']=_0x163112[_0x13bd('0x31')][_0x13bd('0x33')]?_0x163112[_0x13bd('0x31')]:_0x318400[_0x13bd('0x2d')];if(!_0x367d42[_0x13bd('0x2e')][_0x13bd('0x34')]('nolimit')){_0x163112[_0x13bd('0x1d')]=qs[_0x13bd('0x1d')](_0x367d42[_0x13bd('0x2e')][_0x13bd('0x1d')]);_0x163112['offset']=qs[_0x13bd('0x20')](_0x367d42[_0x13bd('0x2e')]['offset']);}_0x163112[_0x13bd('0x35')]=qs[_0x13bd('0x36')](_0x367d42[_0x13bd('0x2e')][_0x13bd('0x36')]);_0x163112[_0x13bd('0x37')]=qs[_0x13bd('0x2f')](_['pick'](_0x367d42[_0x13bd('0x2e')],_0x318400[_0x13bd('0x2f')]),_0x254b81);if(_0x367d42[_0x13bd('0x2e')][_0x13bd('0x38')]){_0x163112[_0x13bd('0x37')]=_[_0x13bd('0x39')](_0x163112[_0x13bd('0x37')],{'$or':_[_0x13bd('0x29')](_0x254b81,function(_0x2c2b3a){if(_0x2c2b3a[_0x13bd('0x2c')]!==_0x13bd('0x3a')){var _0x3de108={};_0x3de108[_0x2c2b3a[_0x13bd('0x28')]]={'$like':'%'+_0x367d42[_0x13bd('0x2e')][_0x13bd('0x38')]+'%'};return _0x3de108;}})});}_0x163112=_['merge']({},_0x163112,_0x367d42['options']);var _0x21b5d9={'where':_0x163112[_0x13bd('0x37')]};return db[_0x13bd('0x2a')][_0x13bd('0x1f')](_0x21b5d9)[_0x13bd('0x3b')](function(_0x3ce0dc){_0x5545df[_0x13bd('0x1f')]=_0x3ce0dc;if(_0x367d42[_0x13bd('0x2e')][_0x13bd('0x3c')]){_0x163112[_0x13bd('0x3d')]=[{'all':!![]}];}return db[_0x13bd('0x2a')]['findAll'](_0x163112);})['then'](function(_0x26b1e6){_0x5545df['rows']=_0x26b1e6;return _0x5545df;})[_0x13bd('0x3b')](respondWithFilteredResult(_0x14e66d,_0x163112))[_0x13bd('0x3e')](handleError(_0x14e66d,null));};exports['show']=function(_0x470779,_0x55cc8c){var _0x551653={'raw':!![],'where':{'id':_0x470779[_0x13bd('0x3f')]['id']}},_0x1abf1b={};_0x1abf1b[_0x13bd('0x2d')]=_[_0x13bd('0x40')](db[_0x13bd('0x2a')][_0x13bd('0x2b')]);_0x1abf1b[_0x13bd('0x2e')]=_[_0x13bd('0x40')](_0x470779[_0x13bd('0x2e')]);_0x1abf1b['filters']=_['intersection'](_0x1abf1b[_0x13bd('0x2d')],_0x1abf1b[_0x13bd('0x2e')]);_0x551653[_0x13bd('0x31')]=_[_0x13bd('0x30')](_0x1abf1b[_0x13bd('0x2d')],qs[_0x13bd('0x32')](_0x470779[_0x13bd('0x2e')][_0x13bd('0x32')]));_0x551653[_0x13bd('0x31')]=_0x551653[_0x13bd('0x31')][_0x13bd('0x33')]?_0x551653[_0x13bd('0x31')]:_0x1abf1b[_0x13bd('0x2d')];if(_0x470779[_0x13bd('0x2e')]['includeAll']){_0x551653[_0x13bd('0x3d')]=[{'all':!![]}];}_0x551653=_[_0x13bd('0x39')]({},_0x551653,_0x470779[_0x13bd('0x41')]);return db[_0x13bd('0x2a')][_0x13bd('0x42')](_0x551653)[_0x13bd('0x3b')](handleEntityNotFound(_0x55cc8c,null))[_0x13bd('0x3b')](respondWithResult(_0x55cc8c,null))['catch'](handleError(_0x55cc8c,null));};exports[_0x13bd('0x43')]=function(_0x75fc23,_0x559f5d){return db['MailServerOut'][_0x13bd('0x43')](_0x75fc23['body'],{})['then'](respondWithResult(_0x559f5d,0xc9))[_0x13bd('0x3e')](handleError(_0x559f5d,null));};exports['update']=function(_0x54210c,_0x2bf547){if(_0x54210c['body']['id']){delete _0x54210c[_0x13bd('0x44')]['id'];}return db[_0x13bd('0x2a')]['find']({'where':{'id':_0x54210c['params']['id']}})[_0x13bd('0x3b')](handleEntityNotFound(_0x2bf547,null))[_0x13bd('0x3b')](saveUpdates(_0x54210c[_0x13bd('0x44')],null))[_0x13bd('0x3b')](respondWithResult(_0x2bf547,null))[_0x13bd('0x3e')](handleError(_0x2bf547,null));};exports['destroy']=function(_0x42d9e9,_0x4f81d6){return db[_0x13bd('0x2a')][_0x13bd('0x42')]({'where':{'id':_0x42d9e9[_0x13bd('0x3f')]['id']}})[_0x13bd('0x3b')](handleEntityNotFound(_0x4f81d6,null))[_0x13bd('0x3b')](removeEntity(_0x4f81d6,null))[_0x13bd('0x3e')](handleError(_0x4f81d6,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index cb2c00d..30c0100 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 _0x3791=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x528d27,_0xd48bdf){var _0x3bbd1f=function(_0xa7633){while(--_0xa7633){_0x528d27['push'](_0x528d27['shift']());}};_0x3bbd1f(++_0xd48bdf);}(_0x3791,0x88));var _0x1379=function(_0x360ece,_0x32f202){_0x360ece=_0x360ece-0x0;var _0x5f4ff8=_0x3791[_0x360ece];return _0x5f4ff8;};'use strict';var _=require(_0x1379('0x0'));var util=require(_0x1379('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1379('0x2'));var BPromise=require(_0x1379('0x3'));var rp=require(_0x1379('0x4'));var fs=require('fs');var path=require(_0x1379('0x5'));var rimraf=require(_0x1379('0x6'));var config=require(_0x1379('0x7'));var attributes=require(_0x1379('0x8'));module[_0x1379('0x9')]=function(_0x5d9b92,_0x36a1f8){return _0x5d9b92[_0x1379('0xa')](_0x1379('0xb'),attributes,{'tableName':_0x1379('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd244=['request-promise','path','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out','util','../../config/logger','api','moment'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0xd244,0xbc));var _0x4d24=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0xd244[_0x3c4f1f];return _0x19cb69;};'use strict';var _=require('lodash');var util=require(_0x4d24('0x0'));var logger=require(_0x4d24('0x1'))(_0x4d24('0x2'));var moment=require(_0x4d24('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d24('0x4'));var fs=require('fs');var path=require(_0x4d24('0x5'));var rimraf=require(_0x4d24('0x6'));var config=require(_0x4d24('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x4d24('0x8')]=function(_0x590b31,_0x2c3077){return _0x590b31[_0x4d24('0x9')](_0x4d24('0xa'),attributes,{'tableName':_0x4d24('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 52959ac..9acc3dc 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4a1375,_0x5a6374){var _0x236ec8=function(_0x141bb6){while(--_0x141bb6){_0x4a1375['push'](_0x4a1375['shift']());}};_0x236ec8(++_0x5a6374);}(_0x1261,0x144));var _0x1126=function(_0x4b1bb0,_0x7dc32b){_0x4b1bb0=_0x4b1bb0-0x0;var _0x549407=_0x1261[_0x4b1bb0];return _0x549407;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _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(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0x2ef3,0xba));var _0x32ef=function(_0x5a2e49,_0x378079){_0x5a2e49=_0x5a2e49-0x0;var _0xc0de20=_0x2ef3[_0x5a2e49];return _0xc0de20;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 7f6b783..340df77 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 _0xc28e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','destroy','exports','multer','util'];(function(_0x6107d,_0x374ead){var _0xa6f1ac=function(_0x3caae0){while(--_0x3caae0){_0x6107d['push'](_0x6107d['shift']());}};_0xa6f1ac(++_0x374ead);}(_0xc28e,0x139));var _0xec28=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc28e[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xec28('0x0'));var util=require(_0xec28('0x1'));var path=require(_0xec28('0x2'));var timeout=require(_0xec28('0x3'));var express=require('express');var router=express[_0xec28('0x4')]();var fs_extra=require(_0xec28('0x5'));var auth=require(_0xec28('0x6'));var interaction=require(_0xec28('0x7'));var config=require('../../config/environment');var controller=require(_0xec28('0x8'));router[_0xec28('0x9')]('/',auth[_0xec28('0xa')](),controller[_0xec28('0xb')]);router['get'](_0xec28('0xc'),auth[_0xec28('0xa')](),controller[_0xec28('0xd')]);router[_0xec28('0x9')]('/:id',auth[_0xec28('0xa')](),controller[_0xec28('0xe')]);router[_0xec28('0xf')]('/',auth[_0xec28('0xa')](),controller[_0xec28('0x10')]);router[_0xec28('0x11')](_0xec28('0x12'),auth[_0xec28('0xa')](),controller['update']);router['delete'](_0xec28('0x12'),auth[_0xec28('0xa')](),controller[_0xec28('0x13')]);module[_0xec28('0x14')]=router; \ No newline at end of file +var _0xcc01=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xcc01,0x13a));var _0x1cc0=function(_0x1d6d2a,_0x24362e){_0x1d6d2a=_0x1d6d2a-0x0;var _0x399eb7=_0xcc01[_0x1d6d2a];return _0x399eb7;};'use strict';var multer=require(_0x1cc0('0x0'));var util=require(_0x1cc0('0x1'));var path=require(_0x1cc0('0x2'));var timeout=require(_0x1cc0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1cc0('0x4'));var auth=require(_0x1cc0('0x5'));var interaction=require(_0x1cc0('0x6'));var config=require(_0x1cc0('0x7'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0x1cc0('0x8')](),controller[_0x1cc0('0x9')]);router[_0x1cc0('0xa')](_0x1cc0('0xb'),auth[_0x1cc0('0x8')](),controller[_0x1cc0('0xc')]);router[_0x1cc0('0xa')]('/:id',auth[_0x1cc0('0x8')](),controller[_0x1cc0('0xd')]);router['post']('/',auth[_0x1cc0('0x8')](),controller[_0x1cc0('0xe')]);router[_0x1cc0('0xf')](_0x1cc0('0x10'),auth[_0x1cc0('0x8')](),controller[_0x1cc0('0x11')]);router[_0x1cc0('0x12')](_0x1cc0('0x10'),auth['isAuthenticated'](),controller[_0x1cc0('0x13')]);module[_0x1cc0('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 9f18f4e..0af141f 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 _0x0af5=['STRING','name','exports'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0x0af5,0x158));var _0x50af=function(_0xdf4147,_0x3117b7){_0xdf4147=_0xdf4147-0x0;var _0x49b154=_0x0af5[_0xdf4147];return _0x49b154;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'unique':_0x50af('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x50af('0x1')]}}; \ No newline at end of file +var _0x85d0=['STRING'];(function(_0x2e76eb,_0x4564f5){var _0x21b1ba=function(_0x3a914e){while(--_0x3a914e){_0x2e76eb['push'](_0x2e76eb['shift']());}};_0x21b1ba(++_0x4564f5);}(_0x85d0,0x164));var _0x085d=function(_0x48b5c2,_0x5ebe8b){_0x48b5c2=_0x48b5c2-0x0;var _0x6ea4c5=_0x85d0[_0x48b5c2];return _0x6ea4c5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x085d('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d66bc13..401f729 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 _0x2645=['merge','VIRTUAL','filter','options','MailSubstatus','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','type','key','query','filters','intersection','model','attributes','fields','order','sort','pick','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2645,0x1c1));var _0x5264=function(_0x41a57e,_0x26ac40){_0x41a57e=_0x41a57e-0x0;var _0x4f91ee=_0x2645[_0x41a57e];return _0x4f91ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5264('0x0'));var zipdir=require(_0x5264('0x1'));var jsonpatch=require(_0x5264('0x2'));var rp=require(_0x5264('0x3'));var moment=require(_0x5264('0x4'));var BPromise=require(_0x5264('0x5'));var Mustache=require(_0x5264('0x6'));var util=require(_0x5264('0x7'));var path=require(_0x5264('0x8'));var sox=require(_0x5264('0x9'));var csv=require('to-csv');var ejs=require(_0x5264('0xa'));var fs=require('fs');var fs_extra=require(_0x5264('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5264('0xc'));var jsforce=require(_0x5264('0xd'));var deskjs=require(_0x5264('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5264('0xf'));var Papa=require(_0x5264('0x10'));var Redis=require(_0x5264('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5264('0x12'));var as=require(_0x5264('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5264('0x14'))(_0x5264('0x15'));var utils=require(_0x5264('0x16'));var config=require(_0x5264('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5264('0x18'))['db'];function respondWithStatusCode(_0x513e7d,_0x123ffb){_0x123ffb=_0x123ffb||0xcc;return function(_0x2205f8){if(_0x2205f8){return _0x513e7d[_0x5264('0x19')](_0x123ffb);}return _0x513e7d[_0x5264('0x1a')](_0x123ffb)['end']();};}function respondWithResult(_0x50acb9,_0x187c45){_0x187c45=_0x187c45||0xc8;return function(_0x3e1a08){if(_0x3e1a08){return _0x50acb9[_0x5264('0x1a')](_0x187c45)[_0x5264('0x1b')](_0x3e1a08);}};}function respondWithFilteredResult(_0x25601c,_0x4126c1){return function(_0x3c0a19){if(_0x3c0a19){var _0x176b49=typeof _0x4126c1['offset']==='undefined'&&typeof _0x4126c1[_0x5264('0x1c')]===_0x5264('0x1d');var _0x700e0b=_0x3c0a19[_0x5264('0x1e')];var _0x15eeb5=_0x176b49?0x0:_0x4126c1[_0x5264('0x1f')];var _0x15d9f4=_0x176b49?_0x3c0a19[_0x5264('0x1e')]:_0x4126c1['offset']+_0x4126c1['limit'];var _0x318ebe;if(_0x15d9f4>=_0x700e0b){_0x15d9f4=_0x700e0b;_0x318ebe=0xc8;}else{_0x318ebe=0xce;}_0x25601c[_0x5264('0x1a')](_0x318ebe);return _0x25601c[_0x5264('0x20')]('Content-Range',_0x15eeb5+'-'+_0x15d9f4+'/'+_0x700e0b)[_0x5264('0x1b')](_0x3c0a19);}return null;};}function patchUpdates(_0x260d52){return function(_0x55a6d3){try{jsonpatch[_0x5264('0x21')](_0x55a6d3,_0x260d52,!![]);}catch(_0x38bb0d){return BPromise[_0x5264('0x22')](_0x38bb0d);}return _0x55a6d3[_0x5264('0x23')]();};}function saveUpdates(_0x4a473b,_0x3a64d8){return function(_0x21e1b4){if(_0x21e1b4){return _0x21e1b4[_0x5264('0x24')](_0x4a473b)[_0x5264('0x25')](function(_0x41ace3){return _0x41ace3;});}return null;};}function removeEntity(_0x52aee4,_0x53fef2){return function(_0xe2c7e6){if(_0xe2c7e6){return _0xe2c7e6[_0x5264('0x26')]()['then'](function(){_0x52aee4[_0x5264('0x1a')](0xcc)[_0x5264('0x27')]();});}};}function handleEntityNotFound(_0x216dc3,_0x1535ca){return function(_0x3e117a){if(!_0x3e117a){_0x216dc3[_0x5264('0x19')](0x194);}return _0x3e117a;};}function handleError(_0x174bee,_0x3c1562){_0x3c1562=_0x3c1562||0x1f4;return function(_0x3e5d55){logger['error'](_0x3e5d55[_0x5264('0x28')]);if(_0x3e5d55[_0x5264('0x29')]){delete _0x3e5d55[_0x5264('0x29')];}_0x174bee[_0x5264('0x1a')](_0x3c1562)[_0x5264('0x2a')](_0x3e5d55);};}exports['index']=function(_0x336978,_0x40a466){var _0x24dcb2={},_0x32d5ad={},_0x23258d={'count':0x0,'rows':[]};var _0x35ad1a=_['map'](db['MailSubstatus']['rawAttributes'],function(_0x36b054){return{'name':_0x36b054['fieldName'],'type':_0x36b054[_0x5264('0x2b')][_0x5264('0x2c')]};});_0x32d5ad['model']=_['map'](_0x35ad1a,'name');_0x32d5ad[_0x5264('0x2d')]=_['keys'](_0x336978[_0x5264('0x2d')]);_0x32d5ad[_0x5264('0x2e')]=_[_0x5264('0x2f')](_0x32d5ad[_0x5264('0x30')],_0x32d5ad[_0x5264('0x2d')]);_0x24dcb2[_0x5264('0x31')]=_[_0x5264('0x2f')](_0x32d5ad['model'],qs['fields'](_0x336978['query'][_0x5264('0x32')]));_0x24dcb2['attributes']=_0x24dcb2[_0x5264('0x31')]['length']?_0x24dcb2[_0x5264('0x31')]:_0x32d5ad[_0x5264('0x30')];if(!_0x336978[_0x5264('0x2d')]['hasOwnProperty']('nolimit')){_0x24dcb2['limit']=qs[_0x5264('0x1c')](_0x336978[_0x5264('0x2d')][_0x5264('0x1c')]);_0x24dcb2[_0x5264('0x1f')]=qs['offset'](_0x336978[_0x5264('0x2d')][_0x5264('0x1f')]);}_0x24dcb2[_0x5264('0x33')]=qs[_0x5264('0x34')](_0x336978[_0x5264('0x2d')][_0x5264('0x34')]);_0x24dcb2['where']=qs[_0x5264('0x2e')](_[_0x5264('0x35')](_0x336978[_0x5264('0x2d')],_0x32d5ad[_0x5264('0x2e')]),_0x35ad1a);if(_0x336978[_0x5264('0x2d')]['filter']){_0x24dcb2[_0x5264('0x36')]=_[_0x5264('0x37')](_0x24dcb2[_0x5264('0x36')],{'$or':_['map'](_0x35ad1a,function(_0x4b927f){if(_0x4b927f[_0x5264('0x2b')]!==_0x5264('0x38')){var _0x51b900={};_0x51b900[_0x4b927f[_0x5264('0x29')]]={'$like':'%'+_0x336978[_0x5264('0x2d')][_0x5264('0x39')]+'%'};return _0x51b900;}})});}_0x24dcb2=_['merge']({},_0x24dcb2,_0x336978[_0x5264('0x3a')]);var _0x15d366={'where':_0x24dcb2[_0x5264('0x36')]};return db[_0x5264('0x3b')][_0x5264('0x1e')](_0x15d366)['then'](function(_0x3ba247){_0x23258d['count']=_0x3ba247;if(_0x336978[_0x5264('0x2d')][_0x5264('0x3c')]){_0x24dcb2[_0x5264('0x3d')]=[{'all':!![]}];}return db[_0x5264('0x3b')][_0x5264('0x3e')](_0x24dcb2);})[_0x5264('0x25')](function(_0x13b4eb){_0x23258d['rows']=_0x13b4eb;return _0x23258d;})[_0x5264('0x25')](respondWithFilteredResult(_0x40a466,_0x24dcb2))[_0x5264('0x3f')](handleError(_0x40a466,null));};exports[_0x5264('0x40')]=function(_0x1a070f,_0x1db7d8){var _0x8356b4={'raw':!![],'where':{'id':_0x1a070f[_0x5264('0x41')]['id']}},_0xb626d={};_0xb626d['model']=_[_0x5264('0x42')](db[_0x5264('0x3b')][_0x5264('0x43')]);_0xb626d[_0x5264('0x2d')]=_[_0x5264('0x42')](_0x1a070f[_0x5264('0x2d')]);_0xb626d[_0x5264('0x2e')]=_[_0x5264('0x2f')](_0xb626d['model'],_0xb626d[_0x5264('0x2d')]);_0x8356b4[_0x5264('0x31')]=_['intersection'](_0xb626d[_0x5264('0x30')],qs[_0x5264('0x32')](_0x1a070f[_0x5264('0x2d')][_0x5264('0x32')]));_0x8356b4['attributes']=_0x8356b4[_0x5264('0x31')][_0x5264('0x44')]?_0x8356b4[_0x5264('0x31')]:_0xb626d[_0x5264('0x30')];if(_0x1a070f[_0x5264('0x2d')]['includeAll']){_0x8356b4['include']=[{'all':!![]}];}_0x8356b4=_[_0x5264('0x37')]({},_0x8356b4,_0x1a070f['options']);return db['MailSubstatus']['find'](_0x8356b4)[_0x5264('0x25')](handleEntityNotFound(_0x1db7d8,null))[_0x5264('0x25')](respondWithResult(_0x1db7d8,null))[_0x5264('0x3f')](handleError(_0x1db7d8,null));};exports['create']=function(_0x11361c,_0x5525ba){return db[_0x5264('0x3b')]['create'](_0x11361c['body'],{})[_0x5264('0x25')](respondWithResult(_0x5525ba,0xc9))[_0x5264('0x3f')](handleError(_0x5525ba,null));};exports['update']=function(_0x38830e,_0x4d7c7f){if(_0x38830e[_0x5264('0x45')]['id']){delete _0x38830e['body']['id'];}return db[_0x5264('0x3b')][_0x5264('0x46')]({'where':{'id':_0x38830e[_0x5264('0x41')]['id']}})[_0x5264('0x25')](handleEntityNotFound(_0x4d7c7f,null))[_0x5264('0x25')](saveUpdates(_0x38830e[_0x5264('0x45')],null))[_0x5264('0x25')](respondWithResult(_0x4d7c7f,null))[_0x5264('0x3f')](handleError(_0x4d7c7f,null));};exports[_0x5264('0x26')]=function(_0x57b0fd,_0x1eaa97){return db[_0x5264('0x3b')][_0x5264('0x46')]({'where':{'id':_0x57b0fd['params']['id']}})[_0x5264('0x25')](handleEntityNotFound(_0x1eaa97,null))[_0x5264('0x25')](removeEntity(_0x1eaa97,null))[_0x5264('0x3f')](handleError(_0x1eaa97,null));};exports[_0x5264('0x47')]=function(_0x284abb,_0x5d35e5){return db[_0x5264('0x3b')]['describe']()['then'](respondWithResult(_0x5d35e5,null))[_0x5264('0x3f')](handleError(_0x5d35e5,null));}; \ No newline at end of file +var _0xc965=['model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailSubstatus','fieldName','key'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc965,0x18e));var _0x5c96=function(_0xf237f7,_0xb11ac){_0xf237f7=_0xf237f7-0x0;var _0x2c183b=_0xc965[_0xf237f7];return _0x2c183b;};'use strict';var emlformat=require(_0x5c96('0x0'));var rimraf=require(_0x5c96('0x1'));var zipdir=require(_0x5c96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c96('0x3'));var moment=require('moment');var BPromise=require(_0x5c96('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5c96('0x5'));var sox=require(_0x5c96('0x6'));var csv=require(_0x5c96('0x7'));var ejs=require(_0x5c96('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c96('0x9'));var squel=require(_0x5c96('0xa'));var crypto=require(_0x5c96('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5c96('0xc'));var toCsv=require(_0x5c96('0x7'));var querystring=require(_0x5c96('0xd'));var Papa=require('papaparse');var Redis=require(_0x5c96('0xe'));var authService=require(_0x5c96('0xf'));var qs=require(_0x5c96('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c96('0x11'));var logger=require('../../config/logger')(_0x5c96('0x12'));var utils=require(_0x5c96('0x13'));var config=require(_0x5c96('0x14'));var licenseUtil=require(_0x5c96('0x15'));var db=require(_0x5c96('0x16'))['db'];function respondWithStatusCode(_0x2b8ab9,_0xfe7c4c){_0xfe7c4c=_0xfe7c4c||0xcc;return function(_0x485cb0){if(_0x485cb0){return _0x2b8ab9[_0x5c96('0x17')](_0xfe7c4c);}return _0x2b8ab9[_0x5c96('0x18')](_0xfe7c4c)[_0x5c96('0x19')]();};}function respondWithResult(_0x575e51,_0x1a0886){_0x1a0886=_0x1a0886||0xc8;return function(_0x3cc51f){if(_0x3cc51f){return _0x575e51[_0x5c96('0x18')](_0x1a0886)[_0x5c96('0x1a')](_0x3cc51f);}};}function respondWithFilteredResult(_0x1ce0f2,_0x313cad){return function(_0x1eccb2){if(_0x1eccb2){var _0x1c0a4a=typeof _0x313cad[_0x5c96('0x1b')]===_0x5c96('0x1c')&&typeof _0x313cad[_0x5c96('0x1d')]===_0x5c96('0x1c');var _0x20d289=_0x1eccb2['count'];var _0x249b75=_0x1c0a4a?0x0:_0x313cad[_0x5c96('0x1b')];var _0x4dce5b=_0x1c0a4a?_0x1eccb2[_0x5c96('0x1e')]:_0x313cad[_0x5c96('0x1b')]+_0x313cad[_0x5c96('0x1d')];var _0x587196;if(_0x4dce5b>=_0x20d289){_0x4dce5b=_0x20d289;_0x587196=0xc8;}else{_0x587196=0xce;}_0x1ce0f2[_0x5c96('0x18')](_0x587196);return _0x1ce0f2[_0x5c96('0x1f')]('Content-Range',_0x249b75+'-'+_0x4dce5b+'/'+_0x20d289)[_0x5c96('0x1a')](_0x1eccb2);}return null;};}function patchUpdates(_0x1e9485){return function(_0x2fb71d){try{jsonpatch[_0x5c96('0x20')](_0x2fb71d,_0x1e9485,!![]);}catch(_0x2d6860){return BPromise[_0x5c96('0x21')](_0x2d6860);}return _0x2fb71d[_0x5c96('0x22')]();};}function saveUpdates(_0x591869,_0x2fd5ec){return function(_0x191189){if(_0x191189){return _0x191189[_0x5c96('0x23')](_0x591869)[_0x5c96('0x24')](function(_0x3881f5){return _0x3881f5;});}return null;};}function removeEntity(_0x13a1a8,_0xa9ddca){return function(_0x24402b){if(_0x24402b){return _0x24402b[_0x5c96('0x25')]()[_0x5c96('0x24')](function(){_0x13a1a8['status'](0xcc)[_0x5c96('0x19')]();});}};}function handleEntityNotFound(_0x471644,_0x54adbf){return function(_0x12200e){if(!_0x12200e){_0x471644[_0x5c96('0x17')](0x194);}return _0x12200e;};}function handleError(_0x5b0ec1,_0x2d6f43){_0x2d6f43=_0x2d6f43||0x1f4;return function(_0x32c1d0){logger['error'](_0x32c1d0[_0x5c96('0x26')]);if(_0x32c1d0['name']){delete _0x32c1d0[_0x5c96('0x27')];}_0x5b0ec1['status'](_0x2d6f43)[_0x5c96('0x28')](_0x32c1d0);};}exports[_0x5c96('0x29')]=function(_0x464b46,_0x2cd267){var _0x12d032={},_0x5ee11b={},_0x1f62b1={'count':0x0,'rows':[]};var _0x153fa5=_[_0x5c96('0x2a')](db[_0x5c96('0x2b')]['rawAttributes'],function(_0x131204){return{'name':_0x131204[_0x5c96('0x2c')],'type':_0x131204['type'][_0x5c96('0x2d')]};});_0x5ee11b[_0x5c96('0x2e')]=_['map'](_0x153fa5,_0x5c96('0x27'));_0x5ee11b['query']=_[_0x5c96('0x2f')](_0x464b46[_0x5c96('0x30')]);_0x5ee11b[_0x5c96('0x31')]=_['intersection'](_0x5ee11b[_0x5c96('0x2e')],_0x5ee11b[_0x5c96('0x30')]);_0x12d032[_0x5c96('0x32')]=_[_0x5c96('0x33')](_0x5ee11b[_0x5c96('0x2e')],qs[_0x5c96('0x34')](_0x464b46[_0x5c96('0x30')][_0x5c96('0x34')]));_0x12d032[_0x5c96('0x32')]=_0x12d032[_0x5c96('0x32')][_0x5c96('0x35')]?_0x12d032[_0x5c96('0x32')]:_0x5ee11b['model'];if(!_0x464b46[_0x5c96('0x30')][_0x5c96('0x36')](_0x5c96('0x37'))){_0x12d032[_0x5c96('0x1d')]=qs[_0x5c96('0x1d')](_0x464b46[_0x5c96('0x30')][_0x5c96('0x1d')]);_0x12d032[_0x5c96('0x1b')]=qs['offset'](_0x464b46[_0x5c96('0x30')][_0x5c96('0x1b')]);}_0x12d032[_0x5c96('0x38')]=qs[_0x5c96('0x39')](_0x464b46[_0x5c96('0x30')][_0x5c96('0x39')]);_0x12d032[_0x5c96('0x3a')]=qs[_0x5c96('0x31')](_[_0x5c96('0x3b')](_0x464b46[_0x5c96('0x30')],_0x5ee11b['filters']),_0x153fa5);if(_0x464b46[_0x5c96('0x30')][_0x5c96('0x3c')]){_0x12d032['where']=_['merge'](_0x12d032['where'],{'$or':_['map'](_0x153fa5,function(_0x98e507){if(_0x98e507['type']!=='VIRTUAL'){var _0x247f56={};_0x247f56[_0x98e507[_0x5c96('0x27')]]={'$like':'%'+_0x464b46[_0x5c96('0x30')][_0x5c96('0x3c')]+'%'};return _0x247f56;}})});}_0x12d032=_['merge']({},_0x12d032,_0x464b46[_0x5c96('0x3d')]);var _0x47d011={'where':_0x12d032['where']};return db[_0x5c96('0x2b')][_0x5c96('0x1e')](_0x47d011)[_0x5c96('0x24')](function(_0xd82182){_0x1f62b1[_0x5c96('0x1e')]=_0xd82182;if(_0x464b46['query']['includeAll']){_0x12d032['include']=[{'all':!![]}];}return db[_0x5c96('0x2b')][_0x5c96('0x3e')](_0x12d032);})[_0x5c96('0x24')](function(_0x2b0e6f){_0x1f62b1[_0x5c96('0x3f')]=_0x2b0e6f;return _0x1f62b1;})['then'](respondWithFilteredResult(_0x2cd267,_0x12d032))[_0x5c96('0x40')](handleError(_0x2cd267,null));};exports[_0x5c96('0x41')]=function(_0xbd7210,_0x199e22){var _0x6c7580={'raw':!![],'where':{'id':_0xbd7210['params']['id']}},_0x24532c={};_0x24532c[_0x5c96('0x2e')]=_['keys'](db['MailSubstatus'][_0x5c96('0x42')]);_0x24532c['query']=_[_0x5c96('0x2f')](_0xbd7210[_0x5c96('0x30')]);_0x24532c[_0x5c96('0x31')]=_['intersection'](_0x24532c[_0x5c96('0x2e')],_0x24532c[_0x5c96('0x30')]);_0x6c7580[_0x5c96('0x32')]=_[_0x5c96('0x33')](_0x24532c['model'],qs['fields'](_0xbd7210['query'][_0x5c96('0x34')]));_0x6c7580['attributes']=_0x6c7580[_0x5c96('0x32')][_0x5c96('0x35')]?_0x6c7580[_0x5c96('0x32')]:_0x24532c[_0x5c96('0x2e')];if(_0xbd7210[_0x5c96('0x30')][_0x5c96('0x43')]){_0x6c7580[_0x5c96('0x44')]=[{'all':!![]}];}_0x6c7580=_['merge']({},_0x6c7580,_0xbd7210[_0x5c96('0x3d')]);return db[_0x5c96('0x2b')][_0x5c96('0x45')](_0x6c7580)[_0x5c96('0x24')](handleEntityNotFound(_0x199e22,null))[_0x5c96('0x24')](respondWithResult(_0x199e22,null))[_0x5c96('0x40')](handleError(_0x199e22,null));};exports[_0x5c96('0x46')]=function(_0x3d8464,_0x3dcb5d){return db['MailSubstatus'][_0x5c96('0x46')](_0x3d8464[_0x5c96('0x47')],{})[_0x5c96('0x24')](respondWithResult(_0x3dcb5d,0xc9))[_0x5c96('0x40')](handleError(_0x3dcb5d,null));};exports['update']=function(_0x241091,_0x59b2f6){if(_0x241091[_0x5c96('0x47')]['id']){delete _0x241091['body']['id'];}return db['MailSubstatus'][_0x5c96('0x45')]({'where':{'id':_0x241091['params']['id']}})[_0x5c96('0x24')](handleEntityNotFound(_0x59b2f6,null))[_0x5c96('0x24')](saveUpdates(_0x241091['body'],null))[_0x5c96('0x24')](respondWithResult(_0x59b2f6,null))[_0x5c96('0x40')](handleError(_0x59b2f6,null));};exports[_0x5c96('0x25')]=function(_0x5a4fa4,_0x220a06){return db[_0x5c96('0x2b')]['find']({'where':{'id':_0x5a4fa4[_0x5c96('0x48')]['id']}})[_0x5c96('0x24')](handleEntityNotFound(_0x220a06,null))[_0x5c96('0x24')](removeEntity(_0x220a06,null))[_0x5c96('0x40')](handleError(_0x220a06,null));};exports[_0x5c96('0x49')]=function(_0x239684,_0x2c4131){return db[_0x5c96('0x2b')][_0x5c96('0x49')]()[_0x5c96('0x24')](respondWithResult(_0x2c4131,null))[_0x5c96('0x40')](handleError(_0x2c4131,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 154c766..3490359 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 _0x3fe0=['hasOwnProperty','hook','exports','events','../../mysqldb','emit'];(function(_0x56f09c,_0x4ab886){var _0xbb8dfd=function(_0x457899){while(--_0x457899){_0x56f09c['push'](_0x56f09c['shift']());}};_0xbb8dfd(++_0x4ab886);}(_0x3fe0,0xe1));var _0x03fe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3fe0[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x03fe('0x0'));var MailSubstatus=require(_0x03fe('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x3b116f){return function(_0x237c02,_0x88f2a8,_0x3b0bf7){MailSubstatusEvents[_0x03fe('0x2')](_0x3b116f+':'+_0x237c02['id'],_0x237c02);MailSubstatusEvents['emit'](_0x3b116f,_0x237c02);_0x3b0bf7(null);};}for(var e in events){if(events[_0x03fe('0x3')](e)){var event=events[e];MailSubstatus[_0x03fe('0x4')](e,emitEvent(event));}}module[_0x03fe('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x8d07=['MailSubstatus','setMaxListeners','update','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xf7a3a9,_0x46e1e4){var _0x565f5b=function(_0x2ca0e5){while(--_0x2ca0e5){_0xf7a3a9['push'](_0xf7a3a9['shift']());}};_0x565f5b(++_0x46e1e4);}(_0x8d07,0x10f));var _0x78d0=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8d07[_0x36dfbd];return _0x4ecad9;};'use strict';var EventEmitter=require(_0x78d0('0x0'));var MailSubstatus=require(_0x78d0('0x1'))['db'][_0x78d0('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x78d0('0x3')](0x0);var events={'afterUpdate':_0x78d0('0x4')};function emitEvent(_0x39ebf6){return function(_0xeb3080,_0x52d615,_0x2c2a68){MailSubstatusEvents['emit'](_0x39ebf6+':'+_0xeb3080['id'],_0xeb3080);MailSubstatusEvents['emit'](_0x39ebf6,_0xeb3080);_0x2c2a68(null);};}for(var e in events){if(events[_0x78d0('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x78d0('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 79403de..24fa8ef 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 _0xc606=['then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues'];(function(_0x50d053,_0x2bb23b){var _0x13b972=function(_0x2d69a1){while(--_0x2d69a1){_0x50d053['push'](_0x50d053['shift']());}};_0x13b972(++_0x2bb23b);}(_0xc606,0x1e6));var _0x6c60=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0xc606[_0x680821];return _0x3f132c;};'use strict';var attributes=require(_0x6c60('0x0'));module[_0x6c60('0x1')]=function(_0x3968f6){var _0x52d0de=_0x3968f6[_0x6c60('0x2')];return _0x3968f6[_0x6c60('0x3')]('MailSubstatus',attributes,{'tableName':_0x6c60('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x524da3,_0x277494,_0x27b1da){return _0x52d0de[_0x6c60('0x5')]['update']({'value':_0x524da3[_0x6c60('0x6')]},{'where':{'field':_0x6c60('0x7'),'value':_0x524da3[_0x6c60('0x8')][_0x6c60('0x6')]}})[_0x6c60('0x9')](function(){_0x27b1da();})[_0x6c60('0xa')](function(_0x529c8b){_0x27b1da(_0x529c8b);});}}});}; \ No newline at end of file +var _0x954d=['then','catch','exports','MailSubstatus','mail_substatuses','Condition','update','_previousDataValues','name'];(function(_0x2de0d1,_0x2bb5e2){var _0x1c1cae=function(_0x55203e){while(--_0x55203e){_0x2de0d1['push'](_0x2de0d1['shift']());}};_0x1c1cae(++_0x2bb5e2);}(_0x954d,0xd1));var _0xd954=function(_0x40bc01,_0x22a9a9){_0x40bc01=_0x40bc01-0x0;var _0x42365b=_0x954d[_0x40bc01];return _0x42365b;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xd954('0x0')]=function(_0x58434d){var _0x1bd40d=_0x58434d['models'];return _0x58434d['define'](_0xd954('0x1'),attributes,{'tableName':_0xd954('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5dc2ca,_0x373a03,_0x1249b7){return _0x1bd40d[_0xd954('0x3')][_0xd954('0x4')]({'value':_0x5dc2ca['name']},{'where':{'field':'mailSubstatus','value':_0x5dc2ca[_0xd954('0x5')][_0xd954('0x6')]}})[_0xd954('0x7')](function(){_0x1249b7();})[_0xd954('0x8')](function(_0x97ac09){_0x1249b7(_0x97ac09);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 85f9113..fdbcf4b 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 _0x5cbd=['error','code','message','info','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5cbd,0x1d9));var _0xd5cb=function(_0x298cfa,_0x17bc0c){_0x298cfa=_0x298cfa-0x0;var _0x4d8771=_0x5cbd[_0x298cfa];return _0x4d8771;};'use strict';var _=require('lodash');var util=require(_0xd5cb('0x0'));var moment=require(_0xd5cb('0x1'));var BPromise=require(_0xd5cb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5cb('0x3'));var db=require(_0xd5cb('0x4'))['db'];var utils=require(_0xd5cb('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd5cb('0x6'));var client=jayson['client'][_0xd5cb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x363e0f,_0x53c51f,_0x34726c){return new BPromise(function(_0x1af92b,_0x374e24){return client[_0xd5cb('0x8')](_0x363e0f,_0x34726c)['then'](function(_0x2ff77a){logger['info'](_0xd5cb('0x9'),_0x53c51f,_0xd5cb('0xa'));logger[_0xd5cb('0xb')](_0xd5cb('0xc'),_0x53c51f,_0xd5cb('0xa'),JSON['stringify'](_0x2ff77a));if(_0x2ff77a[_0xd5cb('0xd')]){if(_0x2ff77a[_0xd5cb('0xd')][_0xd5cb('0xe')]===0x1f4){logger['error'](_0xd5cb('0x9'),_0x53c51f,_0x2ff77a[_0xd5cb('0xd')][_0xd5cb('0xf')]);return _0x374e24(_0x2ff77a[_0xd5cb('0xd')]['message']);}logger[_0xd5cb('0xd')](_0xd5cb('0x9'),_0x53c51f,_0x2ff77a[_0xd5cb('0xd')][_0xd5cb('0xf')]);return _0x1af92b(_0x2ff77a[_0xd5cb('0xd')][_0xd5cb('0xf')]);}else{logger[_0xd5cb('0x10')](_0xd5cb('0x9'),_0x53c51f,_0xd5cb('0xa'));_0x1af92b(_0x2ff77a[_0xd5cb('0x11')]['message']);}})['catch'](function(_0x3255d4){logger[_0xd5cb('0xd')](_0xd5cb('0x9'),_0x53c51f,_0x3255d4);_0x374e24(_0x3255d4);});});} \ No newline at end of file +var _0x9a5e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x9a5e,0x1e2));var _0xe9a5=function(_0x3cc7ba,_0x2fc1ae){_0x3cc7ba=_0x3cc7ba-0x0;var _0xb25b9b=_0x9a5e[_0x3cc7ba];return _0xb25b9b;};'use strict';var _=require(_0xe9a5('0x0'));var util=require(_0xe9a5('0x1'));var moment=require('moment');var BPromise=require(_0xe9a5('0x2'));var rs=require(_0xe9a5('0x3'));var fs=require('fs');var Redis=require(_0xe9a5('0x4'));var db=require(_0xe9a5('0x5'))['db'];var utils=require(_0xe9a5('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe9a5('0x7'));var client=jayson[_0xe9a5('0x8')][_0xe9a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b887d,_0x2d11ac,_0x469874){return new BPromise(function(_0x1bbf24,_0x1f37c7){return client['request'](_0x2b887d,_0x469874)[_0xe9a5('0xa')](function(_0x342af9){logger[_0xe9a5('0xb')](_0xe9a5('0xc'),_0x2d11ac,_0xe9a5('0xd'));logger['debug'](_0xe9a5('0xe'),_0x2d11ac,_0xe9a5('0xd'),JSON[_0xe9a5('0xf')](_0x342af9));if(_0x342af9[_0xe9a5('0x10')]){if(_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x11')]===0x1f4){logger[_0xe9a5('0x10')](_0xe9a5('0xc'),_0x2d11ac,_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x12')]);return _0x1f37c7(_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x12')]);}logger['error'](_0xe9a5('0xc'),_0x2d11ac,_0x342af9[_0xe9a5('0x10')][_0xe9a5('0x12')]);return _0x1bbf24(_0x342af9[_0xe9a5('0x10')]['message']);}else{logger[_0xe9a5('0xb')](_0xe9a5('0xc'),_0x2d11ac,'request\x20sent');_0x1bbf24(_0x342af9[_0xe9a5('0x13')][_0xe9a5('0x12')]);}})[_0xe9a5('0x14')](function(_0x1b7c6e){logger[_0xe9a5('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x2d11ac,_0x1b7c6e);_0x1f37c7(_0x1b7c6e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index ea7c491..aa3795d 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 _0xa1af=['get','index','/describe','isAuthenticated','describe','/:id','post','create','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller'];(function(_0x141310,_0x196d1d){var _0x30032a=function(_0x1128a8){while(--_0x1128a8){_0x141310['push'](_0x141310['shift']());}};_0x30032a(++_0x196d1d);}(_0xa1af,0xa8));var _0xfa1a=function(_0x3c66ea,_0x6ddf1f){_0x3c66ea=_0x3c66ea-0x0;var _0x120784=_0xa1af[_0x3c66ea];return _0x120784;};'use strict';var multer=require(_0xfa1a('0x0'));var util=require(_0xfa1a('0x1'));var path=require(_0xfa1a('0x2'));var timeout=require(_0xfa1a('0x3'));var express=require('express');var router=express[_0xfa1a('0x4')]();var fs_extra=require(_0xfa1a('0x5'));var auth=require(_0xfa1a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa1a('0x7'));router[_0xfa1a('0x8')]('/',auth['isAuthenticated'](),controller[_0xfa1a('0x9')]);router['get'](_0xfa1a('0xa'),auth[_0xfa1a('0xb')](),controller[_0xfa1a('0xc')]);router['get'](_0xfa1a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xfa1a('0xe')]('/',auth[_0xfa1a('0xb')](),controller[_0xfa1a('0xf')]);router['put'](_0xfa1a('0xd'),auth[_0xfa1a('0xb')](),controller['update']);router['delete'](_0xfa1a('0xd'),auth[_0xfa1a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1eee=['create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x5f4a48,_0x44e5ab){var _0x57f833=function(_0x234cb3){while(--_0x234cb3){_0x5f4a48['push'](_0x5f4a48['shift']());}};_0x57f833(++_0x44e5ab);}(_0x1eee,0x6f));var _0xe1ee=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x1eee[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0xe1ee('0x0'));var util=require(_0xe1ee('0x1'));var path=require(_0xe1ee('0x2'));var timeout=require(_0xe1ee('0x3'));var express=require(_0xe1ee('0x4'));var router=express[_0xe1ee('0x5')]();var fs_extra=require(_0xe1ee('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe1ee('0x7'));router[_0xe1ee('0x8')]('/',auth[_0xe1ee('0x9')](),controller[_0xe1ee('0xa')]);router[_0xe1ee('0x8')](_0xe1ee('0xb'),auth[_0xe1ee('0x9')](),controller[_0xe1ee('0xc')]);router[_0xe1ee('0x8')]('/:id',auth[_0xe1ee('0x9')](),controller[_0xe1ee('0xd')]);router[_0xe1ee('0xe')]('/',auth[_0xe1ee('0x9')](),controller[_0xe1ee('0xf')]);router[_0xe1ee('0x10')](_0xe1ee('0x11'),auth[_0xe1ee('0x9')](),controller[_0xe1ee('0x12')]);router[_0xe1ee('0x13')](_0xe1ee('0x11'),auth[_0xe1ee('0x9')](),controller[_0xe1ee('0x14')]);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 6023ff4..ce7b298 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(_0x1ccbc6,_0x1525c5){var _0x27e215=function(_0x2c826a){while(--_0x2c826a){_0x1ccbc6['push'](_0x1ccbc6['shift']());}};_0x27e215(++_0x1525c5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0xcb91[_0x27ddf5];return _0x26e74a;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x386187,_0x1ad2ac){var _0x4abeaa=function(_0x251f63){while(--_0x251f63){_0x386187['push'](_0x386187['shift']());}};_0x4abeaa(++_0x1ad2ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e13cd1e..89b17f2 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 _0x643f=['create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','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','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','MailTransferReport','key','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x643f,0x133));var _0xf643=function(_0x11b6e9,_0x144376){_0x11b6e9=_0x11b6e9-0x0;var _0x20e413=_0x643f[_0x11b6e9];return _0x20e413;};'use strict';var emlformat=require(_0xf643('0x0'));var rimraf=require(_0xf643('0x1'));var zipdir=require(_0xf643('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf643('0x3'));var moment=require(_0xf643('0x4'));var BPromise=require(_0xf643('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf643('0x6'));var sox=require(_0xf643('0x7'));var csv=require(_0xf643('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf643('0x9'));var squel=require(_0xf643('0xa'));var crypto=require(_0xf643('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf643('0xc'));var toCsv=require(_0xf643('0x8'));var querystring=require(_0xf643('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf643('0xe'));var qs=require(_0xf643('0xf'));var as=require(_0xf643('0x10'));var hardwareService=require(_0xf643('0x11'));var logger=require(_0xf643('0x12'))(_0xf643('0x13'));var utils=require(_0xf643('0x14'));var config=require(_0xf643('0x15'));var licenseUtil=require(_0xf643('0x16'));var db=require(_0xf643('0x17'))['db'];function respondWithStatusCode(_0x367caf,_0x81ddde){_0x81ddde=_0x81ddde||0xcc;return function(_0x5b6d68){if(_0x5b6d68){return _0x367caf[_0xf643('0x18')](_0x81ddde);}return _0x367caf[_0xf643('0x19')](_0x81ddde)[_0xf643('0x1a')]();};}function respondWithResult(_0x28e425,_0x4f46d8){_0x4f46d8=_0x4f46d8||0xc8;return function(_0x3cab2c){if(_0x3cab2c){return _0x28e425[_0xf643('0x19')](_0x4f46d8)[_0xf643('0x1b')](_0x3cab2c);}};}function respondWithFilteredResult(_0x56b6c0,_0x826899){return function(_0x12689a){if(_0x12689a){var _0x2190e9=typeof _0x826899[_0xf643('0x1c')]===_0xf643('0x1d')&&typeof _0x826899[_0xf643('0x1e')]===_0xf643('0x1d');var _0x19fbc1=_0x12689a[_0xf643('0x1f')];var _0x577fd7=_0x2190e9?0x0:_0x826899[_0xf643('0x1c')];var _0x304bc8=_0x2190e9?_0x12689a[_0xf643('0x1f')]:_0x826899[_0xf643('0x1c')]+_0x826899['limit'];var _0x5e2531;if(_0x304bc8>=_0x19fbc1){_0x304bc8=_0x19fbc1;_0x5e2531=0xc8;}else{_0x5e2531=0xce;}_0x56b6c0['status'](_0x5e2531);return _0x56b6c0[_0xf643('0x20')](_0xf643('0x21'),_0x577fd7+'-'+_0x304bc8+'/'+_0x19fbc1)[_0xf643('0x1b')](_0x12689a);}return null;};}function patchUpdates(_0x19bd71){return function(_0x517927){try{jsonpatch['apply'](_0x517927,_0x19bd71,!![]);}catch(_0x47b348){return BPromise[_0xf643('0x22')](_0x47b348);}return _0x517927[_0xf643('0x23')]();};}function saveUpdates(_0xaf0320,_0x35f8d5){return function(_0x47a787){if(_0x47a787){return _0x47a787[_0xf643('0x24')](_0xaf0320)['then'](function(_0x4c6d66){return _0x4c6d66;});}return null;};}function removeEntity(_0x40cc4e,_0x47f8ca){return function(_0x17ddf4){if(_0x17ddf4){return _0x17ddf4[_0xf643('0x25')]()[_0xf643('0x26')](function(){_0x40cc4e[_0xf643('0x19')](0xcc)[_0xf643('0x1a')]();});}};}function handleEntityNotFound(_0x23428b,_0x2e78f5){return function(_0x30d4be){if(!_0x30d4be){_0x23428b[_0xf643('0x18')](0x194);}return _0x30d4be;};}function handleError(_0x211d15,_0x448148){_0x448148=_0x448148||0x1f4;return function(_0x43f1ce){logger[_0xf643('0x27')](_0x43f1ce[_0xf643('0x28')]);if(_0x43f1ce['name']){delete _0x43f1ce[_0xf643('0x29')];}_0x211d15[_0xf643('0x19')](_0x448148)[_0xf643('0x2a')](_0x43f1ce);};}exports[_0xf643('0x2b')]=function(_0x318981,_0x24895f){var _0xb9f230={},_0x5c1786={},_0x46db7c={'count':0x0,'rows':[]};var _0x3606f2=_[_0xf643('0x2c')](db[_0xf643('0x2d')]['rawAttributes'],function(_0x1d123f){return{'name':_0x1d123f['fieldName'],'type':_0x1d123f['type'][_0xf643('0x2e')]};});_0x5c1786[_0xf643('0x2f')]=_[_0xf643('0x2c')](_0x3606f2,'name');_0x5c1786['query']=_['keys'](_0x318981['query']);_0x5c1786[_0xf643('0x30')]=_['intersection'](_0x5c1786[_0xf643('0x2f')],_0x5c1786['query']);_0xb9f230['attributes']=_[_0xf643('0x31')](_0x5c1786[_0xf643('0x2f')],qs[_0xf643('0x32')](_0x318981[_0xf643('0x33')]['fields']));_0xb9f230[_0xf643('0x34')]=_0xb9f230[_0xf643('0x34')][_0xf643('0x35')]?_0xb9f230[_0xf643('0x34')]:_0x5c1786[_0xf643('0x2f')];if(!_0x318981[_0xf643('0x33')][_0xf643('0x36')](_0xf643('0x37'))){_0xb9f230[_0xf643('0x1e')]=qs[_0xf643('0x1e')](_0x318981[_0xf643('0x33')][_0xf643('0x1e')]);_0xb9f230[_0xf643('0x1c')]=qs[_0xf643('0x1c')](_0x318981[_0xf643('0x33')][_0xf643('0x1c')]);}_0xb9f230['order']=qs[_0xf643('0x38')](_0x318981[_0xf643('0x33')]['sort']);_0xb9f230[_0xf643('0x39')]=qs[_0xf643('0x30')](_[_0xf643('0x3a')](_0x318981[_0xf643('0x33')],_0x5c1786[_0xf643('0x30')]),_0x3606f2);if(_0x318981[_0xf643('0x33')][_0xf643('0x3b')]){_0xb9f230[_0xf643('0x39')]=_[_0xf643('0x3c')](_0xb9f230['where'],{'$or':_[_0xf643('0x2c')](_0x3606f2,function(_0x51d1ab){if(_0x51d1ab['type']!==_0xf643('0x3d')){var _0xc9a988={};_0xc9a988[_0x51d1ab[_0xf643('0x29')]]={'$like':'%'+_0x318981['query'][_0xf643('0x3b')]+'%'};return _0xc9a988;}})});}_0xb9f230=_[_0xf643('0x3c')]({},_0xb9f230,_0x318981[_0xf643('0x3e')]);var _0x45e215={'where':_0xb9f230[_0xf643('0x39')]};return db[_0xf643('0x2d')][_0xf643('0x1f')](_0x45e215)[_0xf643('0x26')](function(_0x2c9693){_0x46db7c[_0xf643('0x1f')]=_0x2c9693;if(_0x318981[_0xf643('0x33')][_0xf643('0x3f')]){_0xb9f230['include']=[{'all':!![]}];}return db[_0xf643('0x2d')][_0xf643('0x40')](_0xb9f230);})['then'](function(_0x2ccebe){_0x46db7c[_0xf643('0x41')]=_0x2ccebe;return _0x46db7c;})[_0xf643('0x26')](respondWithFilteredResult(_0x24895f,_0xb9f230))['catch'](handleError(_0x24895f,null));};exports[_0xf643('0x42')]=function(_0x4aa9da,_0x3f7895){var _0x1bf39d={'raw':!![],'where':{'id':_0x4aa9da[_0xf643('0x43')]['id']}},_0x2e1ddb={};_0x2e1ddb[_0xf643('0x2f')]=_[_0xf643('0x44')](db[_0xf643('0x2d')][_0xf643('0x45')]);_0x2e1ddb['query']=_[_0xf643('0x44')](_0x4aa9da['query']);_0x2e1ddb[_0xf643('0x30')]=_[_0xf643('0x31')](_0x2e1ddb[_0xf643('0x2f')],_0x2e1ddb[_0xf643('0x33')]);_0x1bf39d[_0xf643('0x34')]=_[_0xf643('0x31')](_0x2e1ddb[_0xf643('0x2f')],qs['fields'](_0x4aa9da[_0xf643('0x33')]['fields']));_0x1bf39d[_0xf643('0x34')]=_0x1bf39d['attributes'][_0xf643('0x35')]?_0x1bf39d[_0xf643('0x34')]:_0x2e1ddb[_0xf643('0x2f')];if(_0x4aa9da[_0xf643('0x33')]['includeAll']){_0x1bf39d[_0xf643('0x46')]=[{'all':!![]}];}_0x1bf39d=_[_0xf643('0x3c')]({},_0x1bf39d,_0x4aa9da[_0xf643('0x3e')]);return db[_0xf643('0x2d')][_0xf643('0x47')](_0x1bf39d)['then'](handleEntityNotFound(_0x3f7895,null))['then'](respondWithResult(_0x3f7895,null))[_0xf643('0x48')](handleError(_0x3f7895,null));};exports[_0xf643('0x49')]=function(_0x51a9cb,_0x1fb37e){return db[_0xf643('0x2d')]['create'](_0x51a9cb['body'],{})[_0xf643('0x26')](respondWithResult(_0x1fb37e,0xc9))['catch'](handleError(_0x1fb37e,null));};exports[_0xf643('0x24')]=function(_0x40f14c,_0x430c27){if(_0x40f14c[_0xf643('0x4a')]['id']){delete _0x40f14c[_0xf643('0x4a')]['id'];}return db['MailTransferReport'][_0xf643('0x47')]({'where':{'id':_0x40f14c[_0xf643('0x43')]['id']}})['then'](handleEntityNotFound(_0x430c27,null))[_0xf643('0x26')](saveUpdates(_0x40f14c['body'],null))['then'](respondWithResult(_0x430c27,null))[_0xf643('0x48')](handleError(_0x430c27,null));};exports[_0xf643('0x25')]=function(_0x57e697,_0x43cdc2){return db[_0xf643('0x2d')][_0xf643('0x47')]({'where':{'id':_0x57e697['params']['id']}})[_0xf643('0x26')](handleEntityNotFound(_0x43cdc2,null))[_0xf643('0x26')](removeEntity(_0x43cdc2,null))[_0xf643('0x48')](handleError(_0x43cdc2,null));};exports[_0xf643('0x4b')]=function(_0x90340d,_0x13d41f){return db[_0xf643('0x2d')][_0xf643('0x4b')]()[_0xf643('0x26')](respondWithResult(_0x13d41f,null))[_0xf643('0x48')](handleError(_0x13d41f,null));}; \ No newline at end of file +var _0x1061=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','MailTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x17491f,_0x3e1d71){var _0x315d8d=function(_0x263af0){while(--_0x263af0){_0x17491f['push'](_0x17491f['shift']());}};_0x315d8d(++_0x3e1d71);}(_0x1061,0x1a3));var _0x1106=function(_0x4a6655,_0x4f2ef4){_0x4a6655=_0x4a6655-0x0;var _0x3b60d6=_0x1061[_0x4a6655];return _0x3b60d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1106('0x0'));var zipdir=require(_0x1106('0x1'));var jsonpatch=require(_0x1106('0x2'));var rp=require(_0x1106('0x3'));var moment=require(_0x1106('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1106('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1106('0x6'));var ejs=require(_0x1106('0x7'));var fs=require('fs');var fs_extra=require(_0x1106('0x8'));var _=require(_0x1106('0x9'));var squel=require(_0x1106('0xa'));var crypto=require('crypto');var jsforce=require(_0x1106('0xb'));var deskjs=require(_0x1106('0xc'));var toCsv=require(_0x1106('0x6'));var querystring=require(_0x1106('0xd'));var Papa=require(_0x1106('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1106('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1106('0x10'));var logger=require(_0x1106('0x11'))('api');var utils=require(_0x1106('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1106('0x13'));var db=require(_0x1106('0x14'))['db'];function respondWithStatusCode(_0x1d8820,_0x1cd532){_0x1cd532=_0x1cd532||0xcc;return function(_0x5e57cb){if(_0x5e57cb){return _0x1d8820[_0x1106('0x15')](_0x1cd532);}return _0x1d8820[_0x1106('0x16')](_0x1cd532)[_0x1106('0x17')]();};}function respondWithResult(_0x7358b2,_0x534603){_0x534603=_0x534603||0xc8;return function(_0xde81a0){if(_0xde81a0){return _0x7358b2[_0x1106('0x16')](_0x534603)[_0x1106('0x18')](_0xde81a0);}};}function respondWithFilteredResult(_0x14bd21,_0x4387ac){return function(_0x1d5042){if(_0x1d5042){var _0x561f8d=typeof _0x4387ac[_0x1106('0x19')]===_0x1106('0x1a')&&typeof _0x4387ac[_0x1106('0x1b')]===_0x1106('0x1a');var _0xccacdb=_0x1d5042[_0x1106('0x1c')];var _0x238353=_0x561f8d?0x0:_0x4387ac[_0x1106('0x19')];var _0x26cd06=_0x561f8d?_0x1d5042['count']:_0x4387ac[_0x1106('0x19')]+_0x4387ac[_0x1106('0x1b')];var _0x4f5d03;if(_0x26cd06>=_0xccacdb){_0x26cd06=_0xccacdb;_0x4f5d03=0xc8;}else{_0x4f5d03=0xce;}_0x14bd21[_0x1106('0x16')](_0x4f5d03);return _0x14bd21[_0x1106('0x1d')](_0x1106('0x1e'),_0x238353+'-'+_0x26cd06+'/'+_0xccacdb)[_0x1106('0x18')](_0x1d5042);}return null;};}function patchUpdates(_0x1ed401){return function(_0x2b03a7){try{jsonpatch[_0x1106('0x1f')](_0x2b03a7,_0x1ed401,!![]);}catch(_0x190a29){return BPromise[_0x1106('0x20')](_0x190a29);}return _0x2b03a7['save']();};}function saveUpdates(_0x44dbe6,_0x2fcceb){return function(_0x18732e){if(_0x18732e){return _0x18732e[_0x1106('0x21')](_0x44dbe6)[_0x1106('0x22')](function(_0x590172){return _0x590172;});}return null;};}function removeEntity(_0x5317ac,_0x59b6a1){return function(_0x1d4b04){if(_0x1d4b04){return _0x1d4b04['destroy']()[_0x1106('0x22')](function(){_0x5317ac[_0x1106('0x16')](0xcc)[_0x1106('0x17')]();});}};}function handleEntityNotFound(_0x3af1a4,_0x47afef){return function(_0x1c32fd){if(!_0x1c32fd){_0x3af1a4[_0x1106('0x15')](0x194);}return _0x1c32fd;};}function handleError(_0x25d6ce,_0xb862b8){_0xb862b8=_0xb862b8||0x1f4;return function(_0x3cdb48){logger[_0x1106('0x23')](_0x3cdb48[_0x1106('0x24')]);if(_0x3cdb48[_0x1106('0x25')]){delete _0x3cdb48['name'];}_0x25d6ce[_0x1106('0x16')](_0xb862b8)[_0x1106('0x26')](_0x3cdb48);};}exports['index']=function(_0x4872e6,_0x4b7c33){var _0x1469ee={},_0x42da58={},_0x237364={'count':0x0,'rows':[]};var _0x3edce7=_[_0x1106('0x27')](db[_0x1106('0x28')][_0x1106('0x29')],function(_0x5e6d74){return{'name':_0x5e6d74['fieldName'],'type':_0x5e6d74[_0x1106('0x2a')][_0x1106('0x2b')]};});_0x42da58['model']=_[_0x1106('0x27')](_0x3edce7,_0x1106('0x25'));_0x42da58[_0x1106('0x2c')]=_[_0x1106('0x2d')](_0x4872e6[_0x1106('0x2c')]);_0x42da58[_0x1106('0x2e')]=_[_0x1106('0x2f')](_0x42da58[_0x1106('0x30')],_0x42da58[_0x1106('0x2c')]);_0x1469ee[_0x1106('0x31')]=_[_0x1106('0x2f')](_0x42da58[_0x1106('0x30')],qs['fields'](_0x4872e6[_0x1106('0x2c')][_0x1106('0x32')]));_0x1469ee[_0x1106('0x31')]=_0x1469ee[_0x1106('0x31')][_0x1106('0x33')]?_0x1469ee[_0x1106('0x31')]:_0x42da58[_0x1106('0x30')];if(!_0x4872e6[_0x1106('0x2c')]['hasOwnProperty'](_0x1106('0x34'))){_0x1469ee[_0x1106('0x1b')]=qs[_0x1106('0x1b')](_0x4872e6['query'][_0x1106('0x1b')]);_0x1469ee[_0x1106('0x19')]=qs[_0x1106('0x19')](_0x4872e6['query'][_0x1106('0x19')]);}_0x1469ee[_0x1106('0x35')]=qs[_0x1106('0x36')](_0x4872e6[_0x1106('0x2c')][_0x1106('0x36')]);_0x1469ee[_0x1106('0x37')]=qs[_0x1106('0x2e')](_[_0x1106('0x38')](_0x4872e6[_0x1106('0x2c')],_0x42da58[_0x1106('0x2e')]),_0x3edce7);if(_0x4872e6[_0x1106('0x2c')][_0x1106('0x39')]){_0x1469ee[_0x1106('0x37')]=_[_0x1106('0x3a')](_0x1469ee[_0x1106('0x37')],{'$or':_[_0x1106('0x27')](_0x3edce7,function(_0x52cb88){if(_0x52cb88[_0x1106('0x2a')]!==_0x1106('0x3b')){var _0x4e8960={};_0x4e8960[_0x52cb88[_0x1106('0x25')]]={'$like':'%'+_0x4872e6[_0x1106('0x2c')][_0x1106('0x39')]+'%'};return _0x4e8960;}})});}_0x1469ee=_['merge']({},_0x1469ee,_0x4872e6[_0x1106('0x3c')]);var _0x537fe9={'where':_0x1469ee[_0x1106('0x37')]};return db[_0x1106('0x28')][_0x1106('0x1c')](_0x537fe9)[_0x1106('0x22')](function(_0x1a1ae8){_0x237364[_0x1106('0x1c')]=_0x1a1ae8;if(_0x4872e6[_0x1106('0x2c')][_0x1106('0x3d')]){_0x1469ee[_0x1106('0x3e')]=[{'all':!![]}];}return db[_0x1106('0x28')][_0x1106('0x3f')](_0x1469ee);})['then'](function(_0x4fd4d){_0x237364[_0x1106('0x40')]=_0x4fd4d;return _0x237364;})[_0x1106('0x22')](respondWithFilteredResult(_0x4b7c33,_0x1469ee))['catch'](handleError(_0x4b7c33,null));};exports[_0x1106('0x41')]=function(_0xac44bb,_0x53edf9){var _0x2b7ce1={'raw':!![],'where':{'id':_0xac44bb['params']['id']}},_0xe2cd4c={};_0xe2cd4c[_0x1106('0x30')]=_[_0x1106('0x2d')](db[_0x1106('0x28')][_0x1106('0x29')]);_0xe2cd4c[_0x1106('0x2c')]=_[_0x1106('0x2d')](_0xac44bb[_0x1106('0x2c')]);_0xe2cd4c[_0x1106('0x2e')]=_[_0x1106('0x2f')](_0xe2cd4c[_0x1106('0x30')],_0xe2cd4c[_0x1106('0x2c')]);_0x2b7ce1[_0x1106('0x31')]=_[_0x1106('0x2f')](_0xe2cd4c['model'],qs['fields'](_0xac44bb[_0x1106('0x2c')][_0x1106('0x32')]));_0x2b7ce1['attributes']=_0x2b7ce1[_0x1106('0x31')][_0x1106('0x33')]?_0x2b7ce1['attributes']:_0xe2cd4c[_0x1106('0x30')];if(_0xac44bb[_0x1106('0x2c')][_0x1106('0x3d')]){_0x2b7ce1[_0x1106('0x3e')]=[{'all':!![]}];}_0x2b7ce1=_[_0x1106('0x3a')]({},_0x2b7ce1,_0xac44bb[_0x1106('0x3c')]);return db[_0x1106('0x28')][_0x1106('0x42')](_0x2b7ce1)[_0x1106('0x22')](handleEntityNotFound(_0x53edf9,null))['then'](respondWithResult(_0x53edf9,null))[_0x1106('0x43')](handleError(_0x53edf9,null));};exports[_0x1106('0x44')]=function(_0xe133dd,_0x4b0bb8){return db['MailTransferReport'][_0x1106('0x44')](_0xe133dd['body'],{})[_0x1106('0x22')](respondWithResult(_0x4b0bb8,0xc9))[_0x1106('0x43')](handleError(_0x4b0bb8,null));};exports['update']=function(_0x38bb51,_0x4a2bd2){if(_0x38bb51[_0x1106('0x45')]['id']){delete _0x38bb51[_0x1106('0x45')]['id'];}return db[_0x1106('0x28')][_0x1106('0x42')]({'where':{'id':_0x38bb51[_0x1106('0x46')]['id']}})[_0x1106('0x22')](handleEntityNotFound(_0x4a2bd2,null))[_0x1106('0x22')](saveUpdates(_0x38bb51['body'],null))['then'](respondWithResult(_0x4a2bd2,null))[_0x1106('0x43')](handleError(_0x4a2bd2,null));};exports[_0x1106('0x47')]=function(_0x16a60c,_0x573918){return db['MailTransferReport'][_0x1106('0x42')]({'where':{'id':_0x16a60c['params']['id']}})[_0x1106('0x22')](handleEntityNotFound(_0x573918,null))[_0x1106('0x22')](removeEntity(_0x573918,null))[_0x1106('0x43')](handleError(_0x573918,null));};exports[_0x1106('0x48')]=function(_0x4f7280,_0x64028b){return db[_0x1106('0x28')][_0x1106('0x48')]()[_0x1106('0x22')](respondWithResult(_0x64028b,null))['catch'](handleError(_0x64028b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 4faefdb..3e23b31 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 _0x79a8=['request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x4a9ff2,_0x37aece){var _0x297736=function(_0x26fd68){while(--_0x26fd68){_0x4a9ff2['push'](_0x4a9ff2['shift']());}};_0x297736(++_0x37aece);}(_0x79a8,0x1d0));var _0x879a=function(_0x35a0e2,_0x302ad1){_0x35a0e2=_0x35a0e2-0x0;var _0x31ea9a=_0x79a8[_0x35a0e2];return _0x31ea9a;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var logger=require(_0x879a('0x1'))(_0x879a('0x2'));var moment=require(_0x879a('0x3'));var BPromise=require('bluebird');var rp=require(_0x879a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var attributes=require(_0x879a('0x7'));module[_0x879a('0x8')]=function(_0x1808f1,_0x3cb89c){return _0x1808f1[_0x879a('0x9')](_0x879a('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x879a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc300=['../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','moment','bluebird','path','rimraf'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xc300,0x132));var _0x0c30=function(_0x450768,_0x54f53d){_0x450768=_0x450768-0x0;var _0x2d56db=_0xc300[_0x450768];return _0x2d56db;};'use strict';var _=require(_0x0c30('0x0'));var util=require(_0x0c30('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c30('0x2'));var BPromise=require(_0x0c30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c30('0x4'));var rimraf=require(_0x0c30('0x5'));var config=require(_0x0c30('0x6'));var attributes=require(_0x0c30('0x7'));module[_0x0c30('0x8')]=function(_0x99afcb,_0xc8f529){return _0x99afcb[_0x0c30('0x9')]('MailTransferReport',attributes,{'tableName':_0x0c30('0xa'),'paranoid':![],'indexes':[{'name':_0x0c30('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 799320b..d3f7f66 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 _0xe524=['request\x20sent','debug','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','info'];(function(_0x1e844b,_0x562168){var _0x4092f3=function(_0x3e0ca8){while(--_0x3e0ca8){_0x1e844b['push'](_0x1e844b['shift']());}};_0x4092f3(++_0x562168);}(_0xe524,0x1b1));var _0x4e52=function(_0x1dbe24,_0x302a70){_0x1dbe24=_0x1dbe24-0x0;var _0x5a2e2d=_0xe524[_0x1dbe24];return _0x5a2e2d;};'use strict';var _=require('lodash');var util=require(_0x4e52('0x0'));var moment=require('moment');var BPromise=require(_0x4e52('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e52('0x2'));var db=require(_0x4e52('0x3'))['db'];var utils=require(_0x4e52('0x4'));var logger=require(_0x4e52('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4e52('0x6')][_0x4e52('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22c9a7,_0x138e9b,_0x805d1){return new BPromise(function(_0x106296,_0x3f11d3){return client['request'](_0x22c9a7,_0x805d1)['then'](function(_0x2e8f71){logger[_0x4e52('0x8')]('MailTransferReport,\x20%s,\x20%s',_0x138e9b,_0x4e52('0x9'));logger[_0x4e52('0xa')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x138e9b,_0x4e52('0x9'),JSON[_0x4e52('0xb')](_0x2e8f71));if(_0x2e8f71[_0x4e52('0xc')]){if(_0x2e8f71[_0x4e52('0xc')]['code']===0x1f4){logger['error'](_0x4e52('0xd'),_0x138e9b,_0x2e8f71[_0x4e52('0xc')][_0x4e52('0xe')]);return _0x3f11d3(_0x2e8f71[_0x4e52('0xc')][_0x4e52('0xe')]);}logger[_0x4e52('0xc')](_0x4e52('0xd'),_0x138e9b,_0x2e8f71['error'][_0x4e52('0xe')]);return _0x106296(_0x2e8f71[_0x4e52('0xc')][_0x4e52('0xe')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x138e9b,'request\x20sent');_0x106296(_0x2e8f71[_0x4e52('0xf')][_0x4e52('0xe')]);}})[_0x4e52('0x10')](function(_0x3f2d47){logger[_0x4e52('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x138e9b,_0x3f2d47);_0x3f11d3(_0x3f2d47);});});} \ No newline at end of file +var _0x95d7=['lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x524e09,_0x5c6cd6){var _0xfd9f3a=function(_0x3fded9){while(--_0x3fded9){_0x524e09['push'](_0x524e09['shift']());}};_0xfd9f3a(++_0x5c6cd6);}(_0x95d7,0xf0));var _0x795d=function(_0x292d83,_0x3c3f1c){_0x292d83=_0x292d83-0x0;var _0x5772f9=_0x95d7[_0x292d83];return _0x5772f9;};'use strict';var _=require(_0x795d('0x0'));var util=require(_0x795d('0x1'));var moment=require('moment');var BPromise=require(_0x795d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x795d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x795d('0x4'));var logger=require('../../config/logger')(_0x795d('0x5'));var config=require(_0x795d('0x6'));var jayson=require(_0x795d('0x7'));var client=jayson[_0x795d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x520262,_0x208f5a,_0x297541){return new BPromise(function(_0x1345d9,_0x2cab00){return client[_0x795d('0x9')](_0x520262,_0x297541)['then'](function(_0x3031e3){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x208f5a,_0x795d('0xa'));logger[_0x795d('0xb')](_0x795d('0xc'),_0x208f5a,_0x795d('0xa'),JSON[_0x795d('0xd')](_0x3031e3));if(_0x3031e3['error']){if(_0x3031e3[_0x795d('0xe')][_0x795d('0xf')]===0x1f4){logger[_0x795d('0xe')](_0x795d('0x10'),_0x208f5a,_0x3031e3[_0x795d('0xe')]['message']);return _0x2cab00(_0x3031e3[_0x795d('0xe')]['message']);}logger[_0x795d('0xe')](_0x795d('0x10'),_0x208f5a,_0x3031e3[_0x795d('0xe')][_0x795d('0x11')]);return _0x1345d9(_0x3031e3[_0x795d('0xe')][_0x795d('0x11')]);}else{logger['info'](_0x795d('0x10'),_0x208f5a,'request\x20sent');_0x1345d9(_0x3031e3[_0x795d('0x12')][_0x795d('0x11')]);}})[_0x795d('0x13')](function(_0x228265){logger[_0x795d('0xe')](_0x795d('0x10'),_0x208f5a,_0x228265);_0x2cab00(_0x228265);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 445bd99..76dafc2 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 _0x7a2e=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','destroy','multer','util','express'];(function(_0x104d23,_0x39fb6c){var _0x1988c5=function(_0x1c839f){while(--_0x1c839f){_0x104d23['push'](_0x104d23['shift']());}};_0x1988c5(++_0x39fb6c);}(_0x7a2e,0x8d));var _0xe7a2=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7a2e[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xe7a2('0x0'));var util=require(_0xe7a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe7a2('0x2'));var router=express['Router']();var fs_extra=require(_0xe7a2('0x3'));var auth=require(_0xe7a2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe7a2('0x5'));var controller=require('./memberReport.controller');router[_0xe7a2('0x6')]('/',auth[_0xe7a2('0x7')](),controller['index']);router[_0xe7a2('0x6')](_0xe7a2('0x8'),auth[_0xe7a2('0x7')](),controller['describe']);router[_0xe7a2('0x6')](_0xe7a2('0x9'),auth[_0xe7a2('0x7')](),controller[_0xe7a2('0xa')]);router[_0xe7a2('0xb')]('/',auth['isAuthenticated'](),controller[_0xe7a2('0xc')]);router[_0xe7a2('0xd')](_0xe7a2('0x9'),auth[_0xe7a2('0x7')](),controller[_0xe7a2('0xe')]);router['delete'](_0xe7a2('0x9'),auth[_0xe7a2('0x7')](),controller[_0xe7a2('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0fbe=['../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','post','create','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5cdae9,_0x5e30a9){var _0x417701=function(_0x3e0142){while(--_0x3e0142){_0x5cdae9['push'](_0x5cdae9['shift']());}};_0x417701(++_0x5e30a9);}(_0x0fbe,0x71));var _0xe0fb=function(_0x53d210,_0x4874c7){_0x53d210=_0x53d210-0x0;var _0x4ea418=_0x0fbe[_0x53d210];return _0x4ea418;};'use strict';var multer=require(_0xe0fb('0x0'));var util=require(_0xe0fb('0x1'));var path=require('path');var timeout=require(_0xe0fb('0x2'));var express=require(_0xe0fb('0x3'));var router=express['Router']();var fs_extra=require(_0xe0fb('0x4'));var auth=require(_0xe0fb('0x5'));var interaction=require(_0xe0fb('0x6'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router['get']('/',auth[_0xe0fb('0x7')](),controller[_0xe0fb('0x8')]);router[_0xe0fb('0x9')](_0xe0fb('0xa'),auth[_0xe0fb('0x7')](),controller[_0xe0fb('0xb')]);router['get'](_0xe0fb('0xc'),auth[_0xe0fb('0x7')](),controller['show']);router[_0xe0fb('0xd')]('/',auth[_0xe0fb('0x7')](),controller[_0xe0fb('0xe')]);router['put'](_0xe0fb('0xc'),auth[_0xe0fb('0x7')](),controller['update']);router['delete']('/:id',auth[_0xe0fb('0x7')](),controller[_0xe0fb('0xf')]);module[_0xe0fb('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e12af69..a6340cf 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 _0x6832=['LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0x6832,0x1be));var _0x2683=function(_0x15dac1,_0x3368f3){_0x15dac1=_0x15dac1-0x0;var _0x24cbfe=_0x6832[_0x15dac1];return _0x24cbfe;};'use strict';var Sequelize=require(_0x2683('0x0'));var moment=require(_0x2683('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2683('0x2')]},'interface':{'type':Sequelize[_0x2683('0x2')]},'type':{'type':Sequelize[_0x2683('0x2')],'defaultValue':_0x2683('0x3'),'comment':_0x2683('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x2683('0x5')]},'exitAt':{'type':Sequelize[_0x2683('0x5')],'set':function(_0x2a9f99){var _0x3a61c3=moment(_0x2a9f99);var _0x4e2d31=moment(this[_0x2683('0x6')](_0x2683('0x7')));var _0x41a426=_0x3a61c3[_0x2683('0x8')](_0x4e2d31,'seconds');this[_0x2683('0x9')]('exitAt',_0x2a9f99);this['setDataValue'](_0x2683('0xa'),_0x41a426>=0x0?_0x41a426:null);}},'data1':{'type':Sequelize[_0x2683('0x2')],'comment':_0x2683('0xb')},'data2':{'type':Sequelize[_0x2683('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x2683('0x2')],'comment':_0x2683('0xc')},'data4':{'type':Sequelize[_0x2683('0x2')],'comment':_0x2683('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x2683('0xe')},'role':{'type':Sequelize[_0x2683('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2683('0x2')]}}; \ No newline at end of file +var _0x3f53=['DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x3a4e77,_0x3349ba){var _0x35a151=function(_0x3fb70b){while(--_0x3fb70b){_0x3a4e77['push'](_0x3a4e77['shift']());}};_0x35a151(++_0x3349ba);}(_0x3f53,0x181));var _0x33f5=function(_0xbda011,_0x20d7e2){_0xbda011=_0xbda011-0x0;var _0x469a19=_0x3f53[_0xbda011];return _0x469a19;};'use strict';var Sequelize=require(_0x33f5('0x0'));var moment=require(_0x33f5('0x1'));module[_0x33f5('0x2')]={'channel':{'type':Sequelize[_0x33f5('0x3')]},'membername':{'type':Sequelize[_0x33f5('0x3')]},'interface':{'type':Sequelize[_0x33f5('0x3')]},'type':{'type':Sequelize[_0x33f5('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x33f5('0x4')},'duration':{'type':Sequelize[_0x33f5('0x5')]},'enterAt':{'type':Sequelize[_0x33f5('0x6')]},'exitAt':{'type':Sequelize[_0x33f5('0x6')],'set':function(_0x77f95d){var _0x1ea00c=moment(_0x77f95d);var _0x296004=moment(this[_0x33f5('0x7')](_0x33f5('0x8')));var _0x3e06e8=_0x1ea00c[_0x33f5('0x9')](_0x296004,_0x33f5('0xa'));this[_0x33f5('0xb')]('exitAt',_0x77f95d);this[_0x33f5('0xb')](_0x33f5('0xc'),_0x3e06e8>=0x0?_0x3e06e8:null);}},'data1':{'type':Sequelize[_0x33f5('0x3')],'comment':_0x33f5('0xd')},'data2':{'type':Sequelize[_0x33f5('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x33f5('0x3')],'comment':_0x33f5('0xe')},'data4':{'type':Sequelize[_0x33f5('0x3')],'comment':_0x33f5('0xf')},'data5':{'type':Sequelize[_0x33f5('0x3')],'comment':_0x33f5('0x10')},'role':{'type':Sequelize[_0x33f5('0x3')]},'internal':{'type':Sequelize[_0x33f5('0x5')]},'uniqueid':{'type':Sequelize[_0x33f5('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c53703b..238f73e 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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x5c5e95,_0x740a18){var _0x55c9aa=function(_0x52c94e){while(--_0x52c94e){_0x5c5e95['push'](_0x5c5e95['shift']());}};_0x55c9aa(++_0x740a18);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x231bc5,_0x182c85){var _0x5aa049=function(_0x40125d){while(--_0x40125d){_0x231bc5['push'](_0x231bc5['shift']());}};_0x5aa049(++_0x182c85);}(_0x3e74,0x175));var _0x43e7=function(_0x2fa194,_0x167d95){_0x2fa194=_0x2fa194-0x0;var _0x43120a=_0x3e74[_0x2fa194];return _0x43120a;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e34ea2d..d902c7f 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 _0x63f2=['bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment'];(function(_0x3c430b,_0xaeb96d){var _0x54b8d8=function(_0x2cb3ad){while(--_0x2cb3ad){_0x3c430b['push'](_0x3c430b['shift']());}};_0x54b8d8(++_0xaeb96d);}(_0x63f2,0x19b));var _0x263f=function(_0x47e124,_0x1a60ae){_0x47e124=_0x47e124-0x0;var _0x4d8797=_0x63f2[_0x47e124];return _0x4d8797;};'use strict';var _=require(_0x263f('0x0'));var util=require(_0x263f('0x1'));var logger=require(_0x263f('0x2'))(_0x263f('0x3'));var moment=require(_0x263f('0x4'));var BPromise=require(_0x263f('0x5'));var rp=require(_0x263f('0x6'));var fs=require('fs');var path=require(_0x263f('0x7'));var rimraf=require(_0x263f('0x8'));var config=require('../../config/environment');var attributes=require(_0x263f('0x9'));module[_0x263f('0xa')]=function(_0x4c13d7,_0x4551c2){return _0x4c13d7[_0x263f('0xb')](_0x263f('0xc'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x263f('0xd'),'fields':[_0x263f('0xe'),_0x263f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64e4=['report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x4abdb3,_0x2e2e96){var _0x8eafbf=function(_0x48d652){while(--_0x48d652){_0x4abdb3['push'](_0x4abdb3['shift']());}};_0x8eafbf(++_0x2e2e96);}(_0x64e4,0x12a));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x464e('0x0'));var logger=require(_0x464e('0x1'))(_0x464e('0x2'));var moment=require(_0x464e('0x3'));var BPromise=require(_0x464e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x464e('0x5'));var config=require(_0x464e('0x6'));var attributes=require(_0x464e('0x7'));module['exports']=function(_0x2a1d51,_0x3083f7){return _0x2a1d51[_0x464e('0x8')](_0x464e('0x9'),attributes,{'tableName':_0x464e('0xa'),'paranoid':![],'indexes':[{'name':_0x464e('0xb'),'fields':[_0x464e('0xc'),_0x464e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index eb61f10..fdd4544 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 _0x9120=['CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','options','raw','where','limit','include','map','attributes','model'];(function(_0x31218c,_0x28ae34){var _0x13e4ab=function(_0x3e0521){while(--_0x3e0521){_0x31218c['push'](_0x31218c['shift']());}};_0x13e4ab(++_0x28ae34);}(_0x9120,0x1b3));var _0x0912=function(_0x32a0fb,_0xfd5f90){_0x32a0fb=_0x32a0fb-0x0;var _0x41eafe=_0x9120[_0x32a0fb];return _0x41eafe;};'use strict';var _=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var moment=require(_0x0912('0x2'));var BPromise=require(_0x0912('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0912('0x4'))['db'];var utils=require(_0x0912('0x5'));var logger=require(_0x0912('0x6'))(_0x0912('0x7'));var config=require(_0x0912('0x8'));var jayson=require(_0x0912('0x9'));var client=jayson['client'][_0x0912('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345969,_0x438bb2,_0x564522){return new BPromise(function(_0x674709,_0x4383c7){return client[_0x0912('0xb')](_0x345969,_0x564522)[_0x0912('0xc')](function(_0x1532bd){logger['info'](_0x0912('0xd'),_0x438bb2,_0x0912('0xe'));logger[_0x0912('0xf')](_0x0912('0x10'),_0x438bb2,'request\x20sent',JSON[_0x0912('0x11')](_0x1532bd));if(_0x1532bd['error']){if(_0x1532bd[_0x0912('0x12')][_0x0912('0x13')]===0x1f4){logger[_0x0912('0x12')](_0x0912('0xd'),_0x438bb2,_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);return _0x4383c7(_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);}logger[_0x0912('0x12')](_0x0912('0xd'),_0x438bb2,_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);return _0x674709(_0x1532bd[_0x0912('0x12')][_0x0912('0x14')]);}else{logger[_0x0912('0x15')]('MemberReport,\x20%s,\x20%s',_0x438bb2,'request\x20sent');_0x674709(_0x1532bd[_0x0912('0x16')]['message']);}})[_0x0912('0x17')](function(_0x5cd19f){logger[_0x0912('0x12')]('MemberReport,\x20%s,\x20%s',_0x438bb2,_0x5cd19f);_0x4383c7(_0x5cd19f);});});}exports[_0x0912('0x18')]=function(_0x5eace1){var _0x22befd=this;return new Promise(function(_0x5357db,_0x495e2e){return db['MemberReport']['findAll']({'raw':_0x5eace1[_0x0912('0x19')]?_0x5eace1['options'][_0x0912('0x1a')]===undefined?!![]:![]:!![],'where':_0x5eace1[_0x0912('0x19')]?_0x5eace1['options'][_0x0912('0x1b')]||null:null,'attributes':_0x5eace1[_0x0912('0x19')]?_0x5eace1[_0x0912('0x19')]['attributes']||null:null,'limit':_0x5eace1['options']?_0x5eace1[_0x0912('0x19')][_0x0912('0x1c')]||null:null,'include':_0x5eace1[_0x0912('0x19')]?_0x5eace1[_0x0912('0x19')][_0x0912('0x1d')]?_[_0x0912('0x1e')](_0x5eace1[_0x0912('0x19')][_0x0912('0x1d')],function(_0xca7f8b){return{'model':db[_0xca7f8b['model']],'as':_0xca7f8b['as'],'attributes':_0xca7f8b[_0x0912('0x1f')],'include':_0xca7f8b[_0x0912('0x1d')]?_[_0x0912('0x1e')](_0xca7f8b['include'],function(_0x4a938e){return{'model':db[_0x4a938e[_0x0912('0x20')]],'as':_0x4a938e['as'],'attributes':_0x4a938e['attributes'],'include':_0x4a938e['include']?_[_0x0912('0x1e')](_0x4a938e[_0x0912('0x1d')],function(_0x4d45d2){return{'model':db[_0x4d45d2[_0x0912('0x20')]],'as':_0x4d45d2['as'],'attributes':_0x4d45d2[_0x0912('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0912('0xc')](function(_0x2c8e48){logger[_0x0912('0x15')]('GetMemberReport',_0x5eace1);logger[_0x0912('0xf')](_0x0912('0x18'),_0x5eace1,JSON['stringify'](_0x2c8e48));_0x5357db(_0x2c8e48);})[_0x0912('0x17')](function(_0x3428a9){logger[_0x0912('0x12')]('GetMemberReport',_0x3428a9[_0x0912('0x14')],_0x5eace1);_0x495e2e(_0x22befd[_0x0912('0x12')](0x1f4,_0x3428a9[_0x0912('0x14')]));});});};exports[_0x0912('0x21')]=function(_0x5a30d8){var _0x448fa3=this;return new Promise(function(_0x195c08,_0x2a9282){return db[_0x0912('0x22')][_0x0912('0x23')](_0x5a30d8[_0x0912('0x24')],{'raw':_0x5a30d8['options']?_0x5a30d8['options'][_0x0912('0x1a')]===undefined?!![]:![]:!![]})[_0x0912('0xc')](function(_0x485c3d){logger['info'](_0x0912('0x21'),_0x5a30d8);logger[_0x0912('0xf')](_0x0912('0x21'),_0x5a30d8,JSON[_0x0912('0x11')](_0x485c3d));_0x195c08(_0x485c3d);})[_0x0912('0x17')](function(_0x933d56){logger[_0x0912('0x12')](_0x0912('0x21'),_0x933d56['message'],_0x5a30d8);_0x2a9282(_0x448fa3['error'](0x1f4,_0x933d56[_0x0912('0x14')]));});});};exports[_0x0912('0x25')]=function(_0x49628d){var _0x2f2448=this;return new Promise(function(_0x271a9c,_0x39a152){return db[_0x0912('0x22')][_0x0912('0x26')](_0x49628d[_0x0912('0x24')],{'raw':_0x49628d[_0x0912('0x19')]?_0x49628d[_0x0912('0x19')][_0x0912('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49628d['options']?_0x49628d[_0x0912('0x19')][_0x0912('0x1b')]||null:null,'attributes':_0x49628d[_0x0912('0x19')]?_0x49628d[_0x0912('0x19')][_0x0912('0x1f')]||null:null,'limit':_0x49628d[_0x0912('0x19')]?_0x49628d[_0x0912('0x19')]['limit']||null:null})[_0x0912('0xc')](function(_0x4aef9a){logger['info']('UpdateMemberReport',_0x49628d);logger[_0x0912('0xf')](_0x0912('0x25'),_0x49628d,JSON['stringify'](_0x4aef9a));_0x271a9c(_0x4aef9a);})[_0x0912('0x17')](function(_0x200399){logger[_0x0912('0x12')]('UpdateMemberReport',_0x200399[_0x0912('0x14')],_0x49628d);_0x39a152(_0x2f2448[_0x0912('0x12')](0x1f4,_0x200399['message']));});});}; \ No newline at end of file +var _0xed08=['info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','MemberReport','findAll','options','raw','attributes','limit','map','model','include','GetMemberReport','catch','CreateMemberReport','UpdateMemberReport','update','body','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xcea07d,_0x3934da){var _0x107ae7=function(_0x2cb647){while(--_0x2cb647){_0xcea07d['push'](_0xcea07d['shift']());}};_0x107ae7(++_0x3934da);}(_0xed08,0x67));var _0x8ed0=function(_0xfe4d29,_0x1d213f){_0xfe4d29=_0xfe4d29-0x0;var _0x2aa45a=_0xed08[_0xfe4d29];return _0x2aa45a;};'use strict';var _=require('lodash');var util=require(_0x8ed0('0x0'));var moment=require(_0x8ed0('0x1'));var BPromise=require(_0x8ed0('0x2'));var rs=require(_0x8ed0('0x3'));var fs=require('fs');var Redis=require(_0x8ed0('0x4'));var db=require(_0x8ed0('0x5'))['db'];var utils=require(_0x8ed0('0x6'));var logger=require(_0x8ed0('0x7'))(_0x8ed0('0x8'));var config=require(_0x8ed0('0x9'));var jayson=require(_0x8ed0('0xa'));var client=jayson[_0x8ed0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15f266,_0x2eb70c,_0x1c86e6){return new BPromise(function(_0x39642a,_0x18d07d){return client[_0x8ed0('0xc')](_0x15f266,_0x1c86e6)[_0x8ed0('0xd')](function(_0x4f1083){logger[_0x8ed0('0xe')](_0x8ed0('0xf'),_0x2eb70c,_0x8ed0('0x10'));logger[_0x8ed0('0x11')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x2eb70c,_0x8ed0('0x10'),JSON[_0x8ed0('0x12')](_0x4f1083));if(_0x4f1083[_0x8ed0('0x13')]){if(_0x4f1083[_0x8ed0('0x13')][_0x8ed0('0x14')]===0x1f4){logger[_0x8ed0('0x13')](_0x8ed0('0xf'),_0x2eb70c,_0x4f1083[_0x8ed0('0x13')][_0x8ed0('0x15')]);return _0x18d07d(_0x4f1083[_0x8ed0('0x13')]['message']);}logger[_0x8ed0('0x13')](_0x8ed0('0xf'),_0x2eb70c,_0x4f1083['error'][_0x8ed0('0x15')]);return _0x39642a(_0x4f1083[_0x8ed0('0x13')]['message']);}else{logger[_0x8ed0('0xe')](_0x8ed0('0xf'),_0x2eb70c,'request\x20sent');_0x39642a(_0x4f1083[_0x8ed0('0x16')][_0x8ed0('0x15')]);}})['catch'](function(_0x2792c8){logger[_0x8ed0('0x13')](_0x8ed0('0xf'),_0x2eb70c,_0x2792c8);_0x18d07d(_0x2792c8);});});}exports['GetMemberReport']=function(_0x55a134){var _0x5ef89c=this;return new Promise(function(_0x12fb2c,_0x77d537){return db[_0x8ed0('0x17')][_0x8ed0('0x18')]({'raw':_0x55a134[_0x8ed0('0x19')]?_0x55a134[_0x8ed0('0x19')][_0x8ed0('0x1a')]===undefined?!![]:![]:!![],'where':_0x55a134[_0x8ed0('0x19')]?_0x55a134[_0x8ed0('0x19')]['where']||null:null,'attributes':_0x55a134['options']?_0x55a134[_0x8ed0('0x19')][_0x8ed0('0x1b')]||null:null,'limit':_0x55a134['options']?_0x55a134[_0x8ed0('0x19')][_0x8ed0('0x1c')]||null:null,'include':_0x55a134[_0x8ed0('0x19')]?_0x55a134[_0x8ed0('0x19')]['include']?_[_0x8ed0('0x1d')](_0x55a134[_0x8ed0('0x19')]['include'],function(_0x1bf9ef){return{'model':db[_0x1bf9ef[_0x8ed0('0x1e')]],'as':_0x1bf9ef['as'],'attributes':_0x1bf9ef[_0x8ed0('0x1b')],'include':_0x1bf9ef[_0x8ed0('0x1f')]?_[_0x8ed0('0x1d')](_0x1bf9ef[_0x8ed0('0x1f')],function(_0x551c91){return{'model':db[_0x551c91['model']],'as':_0x551c91['as'],'attributes':_0x551c91[_0x8ed0('0x1b')],'include':_0x551c91[_0x8ed0('0x1f')]?_[_0x8ed0('0x1d')](_0x551c91[_0x8ed0('0x1f')],function(_0x108f04){return{'model':db[_0x108f04[_0x8ed0('0x1e')]],'as':_0x108f04['as'],'attributes':_0x108f04['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ed0('0xd')](function(_0x436e54){logger['info'](_0x8ed0('0x20'),_0x55a134);logger[_0x8ed0('0x11')](_0x8ed0('0x20'),_0x55a134,JSON[_0x8ed0('0x12')](_0x436e54));_0x12fb2c(_0x436e54);})[_0x8ed0('0x21')](function(_0xec3bd2){logger[_0x8ed0('0x13')]('GetMemberReport',_0xec3bd2['message'],_0x55a134);_0x77d537(_0x5ef89c['error'](0x1f4,_0xec3bd2[_0x8ed0('0x15')]));});});};exports[_0x8ed0('0x22')]=function(_0x59a78a){var _0x3065c4=this;return new Promise(function(_0x53c60c,_0x46eeca){return db[_0x8ed0('0x17')]['create'](_0x59a78a['body'],{'raw':_0x59a78a[_0x8ed0('0x19')]?_0x59a78a[_0x8ed0('0x19')][_0x8ed0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x30aa44){logger['info'](_0x8ed0('0x22'),_0x59a78a);logger[_0x8ed0('0x11')](_0x8ed0('0x22'),_0x59a78a,JSON[_0x8ed0('0x12')](_0x30aa44));_0x53c60c(_0x30aa44);})[_0x8ed0('0x21')](function(_0x4a2fc0){logger[_0x8ed0('0x13')]('CreateMemberReport',_0x4a2fc0[_0x8ed0('0x15')],_0x59a78a);_0x46eeca(_0x3065c4[_0x8ed0('0x13')](0x1f4,_0x4a2fc0[_0x8ed0('0x15')]));});});};exports[_0x8ed0('0x23')]=function(_0x1cfd71){var _0x8fefec=this;return new Promise(function(_0x6207a6,_0x44f82e){return db[_0x8ed0('0x17')][_0x8ed0('0x24')](_0x1cfd71[_0x8ed0('0x25')],{'raw':_0x1cfd71[_0x8ed0('0x19')]?_0x1cfd71[_0x8ed0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cfd71[_0x8ed0('0x19')]?_0x1cfd71['options'][_0x8ed0('0x26')]||null:null,'attributes':_0x1cfd71['options']?_0x1cfd71[_0x8ed0('0x19')][_0x8ed0('0x1b')]||null:null,'limit':_0x1cfd71[_0x8ed0('0x19')]?_0x1cfd71['options'][_0x8ed0('0x1c')]||null:null})[_0x8ed0('0xd')](function(_0x19777e){logger['info']('UpdateMemberReport',_0x1cfd71);logger[_0x8ed0('0x11')](_0x8ed0('0x23'),_0x1cfd71,JSON[_0x8ed0('0x12')](_0x19777e));_0x6207a6(_0x19777e);})[_0x8ed0('0x21')](function(_0x552ce4){logger[_0x8ed0('0x13')]('UpdateMemberReport',_0x552ce4[_0x8ed0('0x15')],_0x1cfd71);_0x44f82e(_0x8fefec[_0x8ed0('0x13')](0x1f4,_0x552ce4['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index e271264..98f048f 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 _0xa63f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa63f,0x1b6));var _0xfa63=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0xa63f[_0x2aee2f];return _0x19337f;};'use strict';var multer=require(_0xfa63('0x0'));var util=require(_0xfa63('0x1'));var path=require(_0xfa63('0x2'));var timeout=require(_0xfa63('0x3'));var express=require(_0xfa63('0x4'));var router=express[_0xfa63('0x5')]();var fs_extra=require(_0xfa63('0x6'));var auth=require(_0xfa63('0x7'));var interaction=require(_0xfa63('0x8'));var config=require(_0xfa63('0x9'));var controller=require('./migration.controller');router['get']('/',controller[_0xfa63('0xa')]);module[_0xfa63('0xb')]=router; \ No newline at end of file +var _0x738e=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports'];(function(_0x56ca1a,_0x31d15f){var _0x401490=function(_0x3f7302){while(--_0x3f7302){_0x56ca1a['push'](_0x56ca1a['shift']());}};_0x401490(++_0x31d15f);}(_0x738e,0xbe));var _0xe738=function(_0x4e221e,_0x22329a){_0x4e221e=_0x4e221e-0x0;var _0x2297eb=_0x738e[_0x4e221e];return _0x2297eb;};'use strict';var multer=require('multer');var util=require(_0xe738('0x0'));var path=require(_0xe738('0x1'));var timeout=require('connect-timeout');var express=require(_0xe738('0x2'));var router=express['Router']();var fs_extra=require(_0xe738('0x3'));var auth=require(_0xe738('0x4'));var interaction=require(_0xe738('0x5'));var config=require(_0xe738('0x6'));var controller=require(_0xe738('0x7'));router['get']('/',controller[_0xe738('0x8')]);module[_0xe738('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index f6834ba..f5d51de 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 _0xdd62=['exports','STRING','version','sequelize'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xdd62,0x6b));var _0x2dd6=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xdd62[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x2dd6('0x0'));module[_0x2dd6('0x1')]={'version':{'type':Sequelize[_0x2dd6('0x2')],'unique':_0x2dd6('0x3')}}; \ No newline at end of file +var _0x3ea1=['exports','version'];(function(_0x4385fe,_0x38d475){var _0x118e9f=function(_0x4f6235){while(--_0x4f6235){_0x4385fe['push'](_0x4385fe['shift']());}};_0x118e9f(++_0x38d475);}(_0x3ea1,0x16a));var _0x13ea=function(_0x5b157d,_0x3cf94f){_0x5b157d=_0x5b157d-0x0;var _0x4c3288=_0x3ea1[_0x5b157d];return _0x4c3288;};'use strict';var Sequelize=require('sequelize');module[_0x13ea('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x13ea('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1540462..a400a8c 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 _0xdcd4=['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/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','name','index','map','Migration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir'];(function(_0xd20566,_0x1f7a62){var _0x15fcbc=function(_0x562340){while(--_0x562340){_0xd20566['push'](_0xd20566['shift']());}};_0x15fcbc(++_0x1f7a62);}(_0xdcd4,0x1b3));var _0x4dcd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcd4[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x4dcd('0x0'));var rimraf=require(_0x4dcd('0x1'));var zipdir=require(_0x4dcd('0x2'));var jsonpatch=require(_0x4dcd('0x3'));var rp=require(_0x4dcd('0x4'));var moment=require('moment');var BPromise=require(_0x4dcd('0x5'));var Mustache=require(_0x4dcd('0x6'));var util=require(_0x4dcd('0x7'));var path=require(_0x4dcd('0x8'));var sox=require(_0x4dcd('0x9'));var csv=require('to-csv');var ejs=require(_0x4dcd('0xa'));var fs=require('fs');var fs_extra=require(_0x4dcd('0xb'));var _=require(_0x4dcd('0xc'));var squel=require(_0x4dcd('0xd'));var crypto=require(_0x4dcd('0xe'));var jsforce=require(_0x4dcd('0xf'));var deskjs=require(_0x4dcd('0x10'));var toCsv=require(_0x4dcd('0x11'));var querystring=require(_0x4dcd('0x12'));var Papa=require(_0x4dcd('0x13'));var Redis=require(_0x4dcd('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4dcd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dcd('0x16'));var logger=require(_0x4dcd('0x17'))(_0x4dcd('0x18'));var utils=require(_0x4dcd('0x19'));var config=require(_0x4dcd('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4dcd('0x1b'))['db'];function respondWithStatusCode(_0x4b5944,_0x246c2a){_0x246c2a=_0x246c2a||0xcc;return function(_0x3b4c93){if(_0x3b4c93){return _0x4b5944[_0x4dcd('0x1c')](_0x246c2a);}return _0x4b5944[_0x4dcd('0x1d')](_0x246c2a)[_0x4dcd('0x1e')]();};}function respondWithResult(_0x1e2aa9,_0x30a1ec){_0x30a1ec=_0x30a1ec||0xc8;return function(_0xc50e6c){if(_0xc50e6c){return _0x1e2aa9[_0x4dcd('0x1d')](_0x30a1ec)[_0x4dcd('0x1f')](_0xc50e6c);}};}function respondWithFilteredResult(_0x1ef4be,_0x5a7f76){return function(_0x362b68){if(_0x362b68){var _0x5f129f=typeof _0x5a7f76[_0x4dcd('0x20')]==='undefined'&&typeof _0x5a7f76[_0x4dcd('0x21')]===_0x4dcd('0x22');var _0x58cd42=_0x362b68['count'];var _0x4764b9=_0x5f129f?0x0:_0x5a7f76[_0x4dcd('0x20')];var _0x548b2b=_0x5f129f?_0x362b68[_0x4dcd('0x23')]:_0x5a7f76[_0x4dcd('0x20')]+_0x5a7f76[_0x4dcd('0x21')];var _0x1f991b;if(_0x548b2b>=_0x58cd42){_0x548b2b=_0x58cd42;_0x1f991b=0xc8;}else{_0x1f991b=0xce;}_0x1ef4be[_0x4dcd('0x1d')](_0x1f991b);return _0x1ef4be[_0x4dcd('0x24')]('Content-Range',_0x4764b9+'-'+_0x548b2b+'/'+_0x58cd42)['json'](_0x362b68);}return null;};}function patchUpdates(_0x21bd1f){return function(_0x127045){try{jsonpatch[_0x4dcd('0x25')](_0x127045,_0x21bd1f,!![]);}catch(_0x4d0f5b){return BPromise[_0x4dcd('0x26')](_0x4d0f5b);}return _0x127045[_0x4dcd('0x27')]();};}function saveUpdates(_0x31cdbb,_0x3edebf){return function(_0xaafeba){if(_0xaafeba){return _0xaafeba[_0x4dcd('0x28')](_0x31cdbb)[_0x4dcd('0x29')](function(_0x112f68){return _0x112f68;});}return null;};}function removeEntity(_0x421e60,_0x496be7){return function(_0x18fce6){if(_0x18fce6){return _0x18fce6['destroy']()['then'](function(){_0x421e60[_0x4dcd('0x1d')](0xcc)[_0x4dcd('0x1e')]();});}};}function handleEntityNotFound(_0x13c105,_0x13de99){return function(_0x47b3b1){if(!_0x47b3b1){_0x13c105[_0x4dcd('0x1c')](0x194);}return _0x47b3b1;};}function handleError(_0x1c83a1,_0x1d91b3){_0x1d91b3=_0x1d91b3||0x1f4;return function(_0x2cd4e8){logger[_0x4dcd('0x2a')](_0x2cd4e8['stack']);if(_0x2cd4e8[_0x4dcd('0x2b')]){delete _0x2cd4e8[_0x4dcd('0x2b')];}_0x1c83a1[_0x4dcd('0x1d')](_0x1d91b3)['send'](_0x2cd4e8);};}exports[_0x4dcd('0x2c')]=function(_0x1b4f5b,_0x33f582){var _0x3112c9={},_0x11902f={},_0x11022e={'count':0x0,'rows':[]};var _0x34cede=_[_0x4dcd('0x2d')](db[_0x4dcd('0x2e')][_0x4dcd('0x2f')],function(_0x7a1954){return{'name':_0x7a1954[_0x4dcd('0x30')],'type':_0x7a1954[_0x4dcd('0x31')][_0x4dcd('0x32')]};});_0x11902f['model']=_[_0x4dcd('0x2d')](_0x34cede,_0x4dcd('0x2b'));_0x11902f['query']=_[_0x4dcd('0x33')](_0x1b4f5b[_0x4dcd('0x34')]);_0x11902f[_0x4dcd('0x35')]=_[_0x4dcd('0x36')](_0x11902f[_0x4dcd('0x37')],_0x11902f[_0x4dcd('0x34')]);_0x3112c9[_0x4dcd('0x38')]=_[_0x4dcd('0x36')](_0x11902f[_0x4dcd('0x37')],qs[_0x4dcd('0x39')](_0x1b4f5b[_0x4dcd('0x34')][_0x4dcd('0x39')]));_0x3112c9['attributes']=_0x3112c9[_0x4dcd('0x38')][_0x4dcd('0x3a')]?_0x3112c9['attributes']:_0x11902f['model'];if(!_0x1b4f5b[_0x4dcd('0x34')]['hasOwnProperty'](_0x4dcd('0x3b'))){_0x3112c9[_0x4dcd('0x21')]=qs[_0x4dcd('0x21')](_0x1b4f5b[_0x4dcd('0x34')][_0x4dcd('0x21')]);_0x3112c9[_0x4dcd('0x20')]=qs[_0x4dcd('0x20')](_0x1b4f5b[_0x4dcd('0x34')][_0x4dcd('0x20')]);}_0x3112c9[_0x4dcd('0x3c')]=qs[_0x4dcd('0x3d')](_0x1b4f5b[_0x4dcd('0x34')][_0x4dcd('0x3d')]);_0x3112c9[_0x4dcd('0x3e')]=qs[_0x4dcd('0x35')](_[_0x4dcd('0x3f')](_0x1b4f5b[_0x4dcd('0x34')],_0x11902f[_0x4dcd('0x35')]),_0x34cede);if(_0x1b4f5b['query'][_0x4dcd('0x40')]){_0x3112c9[_0x4dcd('0x3e')]=_[_0x4dcd('0x41')](_0x3112c9['where'],{'$or':_[_0x4dcd('0x2d')](_0x34cede,function(_0x39484d){if(_0x39484d['type']!==_0x4dcd('0x42')){var _0x4c9ac4={};_0x4c9ac4[_0x39484d[_0x4dcd('0x2b')]]={'$like':'%'+_0x1b4f5b[_0x4dcd('0x34')][_0x4dcd('0x40')]+'%'};return _0x4c9ac4;}})});}_0x3112c9=_['merge']({},_0x3112c9,_0x1b4f5b[_0x4dcd('0x43')]);var _0x4dfae8={'where':_0x3112c9['where']};return db[_0x4dcd('0x2e')][_0x4dcd('0x23')](_0x4dfae8)[_0x4dcd('0x29')](function(_0xffad47){_0x11022e[_0x4dcd('0x23')]=_0xffad47;if(_0x1b4f5b[_0x4dcd('0x34')][_0x4dcd('0x44')]){_0x3112c9[_0x4dcd('0x45')]=[{'all':!![]}];}return db[_0x4dcd('0x2e')][_0x4dcd('0x46')](_0x3112c9);})[_0x4dcd('0x29')](function(_0x4ccd36){_0x11022e[_0x4dcd('0x47')]=_0x4ccd36;return _0x11022e;})[_0x4dcd('0x29')](respondWithFilteredResult(_0x33f582,_0x3112c9))[_0x4dcd('0x48')](handleError(_0x33f582,null));}; \ No newline at end of file +var _0x14d9=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','Migration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1e16e7,_0x11d381){var _0x1fcd7a=function(_0x544554){while(--_0x544554){_0x1e16e7['push'](_0x1e16e7['shift']());}};_0x1fcd7a(++_0x11d381);}(_0x14d9,0x1a3));var _0x914d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x914d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x914d('0x1'));var rp=require(_0x914d('0x2'));var moment=require(_0x914d('0x3'));var BPromise=require(_0x914d('0x4'));var Mustache=require(_0x914d('0x5'));var util=require(_0x914d('0x6'));var path=require(_0x914d('0x7'));var sox=require(_0x914d('0x8'));var csv=require(_0x914d('0x9'));var ejs=require(_0x914d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x914d('0xb'));var squel=require(_0x914d('0xc'));var crypto=require(_0x914d('0xd'));var jsforce=require(_0x914d('0xe'));var deskjs=require(_0x914d('0xf'));var toCsv=require(_0x914d('0x9'));var querystring=require(_0x914d('0x10'));var Papa=require(_0x914d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x914d('0x12'));var hardwareService=require(_0x914d('0x13'));var logger=require(_0x914d('0x14'))(_0x914d('0x15'));var utils=require(_0x914d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x914d('0x17'));var db=require(_0x914d('0x18'))['db'];function respondWithStatusCode(_0x213ced,_0x41b1d8){_0x41b1d8=_0x41b1d8||0xcc;return function(_0x561103){if(_0x561103){return _0x213ced[_0x914d('0x19')](_0x41b1d8);}return _0x213ced[_0x914d('0x1a')](_0x41b1d8)[_0x914d('0x1b')]();};}function respondWithResult(_0x4931a4,_0x5a5bcc){_0x5a5bcc=_0x5a5bcc||0xc8;return function(_0x5aa8ed){if(_0x5aa8ed){return _0x4931a4[_0x914d('0x1a')](_0x5a5bcc)[_0x914d('0x1c')](_0x5aa8ed);}};}function respondWithFilteredResult(_0x239aea,_0x9e3bb3){return function(_0x287474){if(_0x287474){var _0x44e8fd=typeof _0x9e3bb3[_0x914d('0x1d')]===_0x914d('0x1e')&&typeof _0x9e3bb3[_0x914d('0x1f')]===_0x914d('0x1e');var _0x543523=_0x287474['count'];var _0x682a34=_0x44e8fd?0x0:_0x9e3bb3[_0x914d('0x1d')];var _0xc8271b=_0x44e8fd?_0x287474[_0x914d('0x20')]:_0x9e3bb3[_0x914d('0x1d')]+_0x9e3bb3[_0x914d('0x1f')];var _0x53a819;if(_0xc8271b>=_0x543523){_0xc8271b=_0x543523;_0x53a819=0xc8;}else{_0x53a819=0xce;}_0x239aea[_0x914d('0x1a')](_0x53a819);return _0x239aea[_0x914d('0x21')](_0x914d('0x22'),_0x682a34+'-'+_0xc8271b+'/'+_0x543523)[_0x914d('0x1c')](_0x287474);}return null;};}function patchUpdates(_0x59630c){return function(_0x4ff8a0){try{jsonpatch['apply'](_0x4ff8a0,_0x59630c,!![]);}catch(_0x5c0e34){return BPromise[_0x914d('0x23')](_0x5c0e34);}return _0x4ff8a0['save']();};}function saveUpdates(_0x550cbe,_0x56ff2b){return function(_0x3e65d7){if(_0x3e65d7){return _0x3e65d7[_0x914d('0x24')](_0x550cbe)[_0x914d('0x25')](function(_0x2282e0){return _0x2282e0;});}return null;};}function removeEntity(_0x15e37e,_0xb2b33f){return function(_0x41e798){if(_0x41e798){return _0x41e798[_0x914d('0x26')]()['then'](function(){_0x15e37e[_0x914d('0x1a')](0xcc)[_0x914d('0x1b')]();});}};}function handleEntityNotFound(_0x5257c4,_0x51b820){return function(_0x436a6a){if(!_0x436a6a){_0x5257c4[_0x914d('0x19')](0x194);}return _0x436a6a;};}function handleError(_0x1412a9,_0x5282d0){_0x5282d0=_0x5282d0||0x1f4;return function(_0x3e5aca){logger[_0x914d('0x27')](_0x3e5aca[_0x914d('0x28')]);if(_0x3e5aca[_0x914d('0x29')]){delete _0x3e5aca[_0x914d('0x29')];}_0x1412a9[_0x914d('0x1a')](_0x5282d0)[_0x914d('0x2a')](_0x3e5aca);};}exports[_0x914d('0x2b')]=function(_0x3a81a4,_0x49faa8){var _0x4830cf={},_0x40b940={},_0x22a30e={'count':0x0,'rows':[]};var _0x5e6b6f=_[_0x914d('0x2c')](db[_0x914d('0x2d')]['rawAttributes'],function(_0x25b668){return{'name':_0x25b668[_0x914d('0x2e')],'type':_0x25b668[_0x914d('0x2f')][_0x914d('0x30')]};});_0x40b940[_0x914d('0x31')]=_[_0x914d('0x2c')](_0x5e6b6f,_0x914d('0x29'));_0x40b940[_0x914d('0x32')]=_['keys'](_0x3a81a4[_0x914d('0x32')]);_0x40b940[_0x914d('0x33')]=_[_0x914d('0x34')](_0x40b940[_0x914d('0x31')],_0x40b940['query']);_0x4830cf[_0x914d('0x35')]=_[_0x914d('0x34')](_0x40b940[_0x914d('0x31')],qs[_0x914d('0x36')](_0x3a81a4[_0x914d('0x32')][_0x914d('0x36')]));_0x4830cf[_0x914d('0x35')]=_0x4830cf[_0x914d('0x35')][_0x914d('0x37')]?_0x4830cf['attributes']:_0x40b940[_0x914d('0x31')];if(!_0x3a81a4['query'][_0x914d('0x38')]('nolimit')){_0x4830cf['limit']=qs[_0x914d('0x1f')](_0x3a81a4[_0x914d('0x32')][_0x914d('0x1f')]);_0x4830cf[_0x914d('0x1d')]=qs['offset'](_0x3a81a4['query'][_0x914d('0x1d')]);}_0x4830cf['order']=qs['sort'](_0x3a81a4[_0x914d('0x32')][_0x914d('0x39')]);_0x4830cf[_0x914d('0x3a')]=qs[_0x914d('0x33')](_[_0x914d('0x3b')](_0x3a81a4[_0x914d('0x32')],_0x40b940[_0x914d('0x33')]),_0x5e6b6f);if(_0x3a81a4[_0x914d('0x32')][_0x914d('0x3c')]){_0x4830cf[_0x914d('0x3a')]=_['merge'](_0x4830cf[_0x914d('0x3a')],{'$or':_['map'](_0x5e6b6f,function(_0x58ac29){if(_0x58ac29['type']!==_0x914d('0x3d')){var _0x22becd={};_0x22becd[_0x58ac29[_0x914d('0x29')]]={'$like':'%'+_0x3a81a4[_0x914d('0x32')][_0x914d('0x3c')]+'%'};return _0x22becd;}})});}_0x4830cf=_[_0x914d('0x3e')]({},_0x4830cf,_0x3a81a4[_0x914d('0x3f')]);var _0x3ef706={'where':_0x4830cf[_0x914d('0x3a')]};return db['Migration']['count'](_0x3ef706)['then'](function(_0x4e03a6){_0x22a30e['count']=_0x4e03a6;if(_0x3a81a4[_0x914d('0x32')]['includeAll']){_0x4830cf[_0x914d('0x40')]=[{'all':!![]}];}return db[_0x914d('0x2d')][_0x914d('0x41')](_0x4830cf);})[_0x914d('0x25')](function(_0x44d2f1){_0x22a30e[_0x914d('0x42')]=_0x44d2f1;return _0x22a30e;})['then'](respondWithFilteredResult(_0x49faa8,_0x4830cf))[_0x914d('0x43')](handleError(_0x49faa8,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 934bb36..684d8c0 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 _0x5a54=['bluebird','request-promise','path','exports','define','Migration','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a54,0x126));var _0x45a5=function(_0x11a46e,_0x50686f){_0x11a46e=_0x11a46e-0x0;var _0x14a904=_0x5a54[_0x11a46e];return _0x14a904;};'use strict';var _=require(_0x45a5('0x0'));var util=require(_0x45a5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x45a5('0x2'));var BPromise=require(_0x45a5('0x3'));var rp=require(_0x45a5('0x4'));var fs=require('fs');var path=require(_0x45a5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x45a5('0x6')]=function(_0x425da7,_0x479471){return _0x425da7[_0x45a5('0x7')](_0x45a5('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x497b=['rimraf','../../config/environment','./migration.attributes','define','Migration','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x7b63cf,_0x1c1f4e){var _0x5f3751=function(_0x4db56a){while(--_0x4db56a){_0x7b63cf['push'](_0x7b63cf['shift']());}};_0x5f3751(++_0x1c1f4e);}(_0x497b,0x185));var _0xb497=function(_0x2b4137,_0x2626e8){_0x2b4137=_0x2b4137-0x0;var _0x262d9a=_0x497b[_0x2b4137];return _0x262d9a;};'use strict';var _=require(_0xb497('0x0'));var util=require(_0xb497('0x1'));var logger=require('../../config/logger')(_0xb497('0x2'));var moment=require(_0xb497('0x3'));var BPromise=require(_0xb497('0x4'));var rp=require(_0xb497('0x5'));var fs=require('fs');var path=require(_0xb497('0x6'));var rimraf=require(_0xb497('0x7'));var config=require(_0xb497('0x8'));var attributes=require(_0xb497('0x9'));module['exports']=function(_0x3db6f7,_0x194c5d){return _0x3db6f7[_0xb497('0xa')](_0xb497('0xb'),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 f15abfa..7b848c8 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 _0xcd60=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x55fd40,_0x225b77){var _0x7979f1=function(_0x1d21c1){while(--_0x1d21c1){_0x55fd40['push'](_0x55fd40['shift']());}};_0x7979f1(++_0x225b77);}(_0xcd60,0xf0));var _0x0cd6=function(_0x55b3a3,_0x5c6409){_0x55b3a3=_0x55b3a3-0x0;var _0xb84e40=_0xcd60[_0x55b3a3];return _0xb84e40;};'use strict';var _=require(_0x0cd6('0x0'));var util=require(_0x0cd6('0x1'));var moment=require(_0x0cd6('0x2'));var BPromise=require(_0x0cd6('0x3'));var rs=require(_0x0cd6('0x4'));var fs=require('fs');var Redis=require(_0x0cd6('0x5'));var db=require(_0x0cd6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cd6('0x7'))(_0x0cd6('0x8'));var config=require(_0x0cd6('0x9'));var jayson=require(_0x0cd6('0xa'));var client=jayson[_0x0cd6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ceb47,_0x460833,_0x47c8b2){return new BPromise(function(_0x4714bf,_0x4fb298){return client[_0x0cd6('0xc')](_0x2ceb47,_0x47c8b2)[_0x0cd6('0xd')](function(_0x14f396){logger[_0x0cd6('0xe')](_0x0cd6('0xf'),_0x460833,'request\x20sent');logger[_0x0cd6('0x10')](_0x0cd6('0x11'),_0x460833,_0x0cd6('0x12'),JSON[_0x0cd6('0x13')](_0x14f396));if(_0x14f396[_0x0cd6('0x14')]){if(_0x14f396['error']['code']===0x1f4){logger[_0x0cd6('0x14')](_0x0cd6('0xf'),_0x460833,_0x14f396[_0x0cd6('0x14')]['message']);return _0x4fb298(_0x14f396[_0x0cd6('0x14')]['message']);}logger[_0x0cd6('0x14')](_0x0cd6('0xf'),_0x460833,_0x14f396[_0x0cd6('0x14')][_0x0cd6('0x15')]);return _0x4714bf(_0x14f396[_0x0cd6('0x14')][_0x0cd6('0x15')]);}else{logger[_0x0cd6('0xe')](_0x0cd6('0xf'),_0x460833,_0x0cd6('0x12'));_0x4714bf(_0x14f396[_0x0cd6('0x16')][_0x0cd6('0x15')]);}})[_0x0cd6('0x17')](function(_0x30d35c){logger[_0x0cd6('0x14')]('Migration,\x20%s,\x20%s',_0x460833,_0x30d35c);_0x4fb298(_0x30d35c);});});} \ No newline at end of file +var _0x6c4b=['../../config/logger','rpc','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x6c4b,0x93));var _0xb6c4=function(_0x273be5,_0x4fe892){_0x273be5=_0x273be5-0x0;var _0x29a5be=_0x6c4b[_0x273be5];return _0x29a5be;};'use strict';var _=require(_0xb6c4('0x0'));var util=require(_0xb6c4('0x1'));var moment=require(_0xb6c4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb6c4('0x3'));var fs=require('fs');var Redis=require(_0xb6c4('0x4'));var db=require(_0xb6c4('0x5'))['db'];var utils=require(_0xb6c4('0x6'));var logger=require(_0xb6c4('0x7'))(_0xb6c4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb6c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x109973,_0x38b222,_0x554935){return new BPromise(function(_0x312141,_0x19c12a){return client[_0xb6c4('0xa')](_0x109973,_0x554935)[_0xb6c4('0xb')](function(_0x131e11){logger[_0xb6c4('0xc')](_0xb6c4('0xd'),_0x38b222,'request\x20sent');logger[_0xb6c4('0xe')](_0xb6c4('0xf'),_0x38b222,_0xb6c4('0x10'),JSON[_0xb6c4('0x11')](_0x131e11));if(_0x131e11['error']){if(_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x13')]===0x1f4){logger[_0xb6c4('0x12')](_0xb6c4('0xd'),_0x38b222,_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x14')]);return _0x19c12a(_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x14')]);}logger['error']('Migration,\x20%s,\x20%s',_0x38b222,_0x131e11[_0xb6c4('0x12')]['message']);return _0x312141(_0x131e11[_0xb6c4('0x12')][_0xb6c4('0x14')]);}else{logger[_0xb6c4('0xc')]('Migration,\x20%s,\x20%s',_0x38b222,_0xb6c4('0x10'));_0x312141(_0x131e11[_0xb6c4('0x15')][_0xb6c4('0x14')]);}})['catch'](function(_0x417e00){logger[_0xb6c4('0x12')](_0xb6c4('0xd'),_0x38b222,_0x417e00);_0x19c12a(_0x417e00);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b0542f9..3f4efcc 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 _0x47c5=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3a6b78,_0x2d62be){var _0x4943d4=function(_0x33ab64){while(--_0x33ab64){_0x3a6b78['push'](_0x3a6b78['shift']());}};_0x4943d4(++_0x2d62be);}(_0x47c5,0x165));var _0x547c=function(_0xd28119,_0x2a8097){_0xd28119=_0xd28119-0x0;var _0x418b38=_0x47c5[_0xd28119];return _0x418b38;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0xe')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x10')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x12')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);module[_0x547c('0x14')]=router; \ No newline at end of file +var _0x0a2e=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create'];(function(_0xef5b7e,_0x3a9cbf){var _0x14cf79=function(_0x32d700){while(--_0x32d700){_0xef5b7e['push'](_0xef5b7e['shift']());}};_0x14cf79(++_0x3a9cbf);}(_0x0a2e,0xe1));var _0xe0a2=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0x0a2e[_0x4d67b8];return _0x55af3b;};'use strict';var multer=require(_0xe0a2('0x0'));var util=require(_0xe0a2('0x1'));var path=require(_0xe0a2('0x2'));var timeout=require(_0xe0a2('0x3'));var express=require('express');var router=express[_0xe0a2('0x4')]();var fs_extra=require(_0xe0a2('0x5'));var auth=require(_0xe0a2('0x6'));var interaction=require(_0xe0a2('0x7'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0xe0a2('0x8')]('/',auth[_0xe0a2('0x9')](),controller[_0xe0a2('0xa')]);router[_0xe0a2('0x8')](_0xe0a2('0xb'),auth[_0xe0a2('0x9')](),controller[_0xe0a2('0xc')]);router[_0xe0a2('0xd')]('/',auth[_0xe0a2('0x9')](),controller[_0xe0a2('0xe')]);router[_0xe0a2('0xf')](_0xe0a2('0xb'),auth[_0xe0a2('0x9')](),controller[_0xe0a2('0x10')]);router[_0xe0a2('0x11')](_0xe0a2('0xb'),auth[_0xe0a2('0x9')](),controller[_0xe0a2('0x12')]);module[_0xe0a2('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index a97e315..d6aac57 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 _0xc286=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc286,0x6c));var _0x6c28=function(_0x51f115,_0x78d0f6){_0x51f115=_0x51f115-0x0;var _0x5259dc=_0xc286[_0x51f115];return _0x5259dc;};'use strict';var Sequelize=require(_0x6c28('0x0'));module[_0x6c28('0x1')]={'type':{'type':Sequelize[_0x6c28('0x2')](_0x6c28('0x3'),_0x6c28('0x4'),_0x6c28('0x5'),_0x6c28('0x6'))},'value':{'type':Sequelize[_0x6c28('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6c28('0x7')]}}; \ No newline at end of file +var _0xab85=['exports','ENUM','externip','stun','turn','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab85,0xdf));var _0x5ab8=function(_0x265bf9,_0x4169fa){_0x265bf9=_0x265bf9-0x0;var _0x27e489=_0xab85[_0x265bf9];return _0x27e489;};'use strict';var Sequelize=require(_0x5ab8('0x0'));module[_0x5ab8('0x1')]={'type':{'type':Sequelize[_0x5ab8('0x2')]('localnet',_0x5ab8('0x3'),_0x5ab8('0x4'),_0x5ab8('0x5'))},'value':{'type':Sequelize[_0x5ab8('0x6')]},'username':{'type':Sequelize[_0x5ab8('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4fcb745..8a3b4c6 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 _0x8572=['limit','undefined','count','status','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','Network','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','include','rows','show','rawAttributes','length','includeAll','merge','find','create','findAll','body','toUpperCase','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','params','STUN','/etc/asterisk/sip_xcally_%s.conf','/etc/asterisk/turn_xcally.conf','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','catch','json','offset'];(function(_0x2d2e1f,_0x92052c){var _0x4ec7e4=function(_0x585201){while(--_0x585201){_0x2d2e1f['push'](_0x2d2e1f['shift']());}};_0x4ec7e4(++_0x92052c);}(_0x8572,0xf1));var _0x2857=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x8572[_0x231e16];return _0x570a7c;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x2857('0x0'));var fs=require('fs');var _=require('lodash');var qs=require(_0x2857('0x1'));var logger=require(_0x2857('0x2'))(_0x2857('0x3'));var config=require(_0x2857('0x4'));var db=require(_0x2857('0x5'))['db'];var jayson=require(_0x2857('0x6'));var client=jayson[_0x2857('0x7')][_0x2857('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27e1e7,_0x42dacc,_0x4585ef,_0x4b6d6b){return new Promise(function(_0x36802f,_0x209b64){var _0x1a0d98=_0x4b6d6b||client;return _0x1a0d98[_0x2857('0x9')](_0x27e1e7,_0x4585ef)[_0x2857('0xa')](function(_0x23263d){logger[_0x2857('0xb')]('Network,\x20%s,\x20%s',_0x42dacc,'request\x20sent');logger[_0x2857('0xc')](_0x2857('0xd'),_0x42dacc,_0x2857('0xe'),JSON[_0x2857('0xf')](_0x23263d));if(_0x23263d[_0x2857('0x10')]){if(_0x23263d[_0x2857('0x10')][_0x2857('0x11')]===0x1f4){logger[_0x2857('0x10')](_0x2857('0x12'),_0x42dacc,_0x23263d[_0x2857('0x10')]['message']);return _0x209b64(_0x23263d['error'][_0x2857('0x13')]);}logger[_0x2857('0x10')](_0x2857('0x12'),_0x42dacc,_0x23263d[_0x2857('0x10')][_0x2857('0x13')]);return _0x36802f(_0x23263d[_0x2857('0x10')][_0x2857('0x13')]);}else{logger[_0x2857('0xb')](_0x2857('0x12'),_0x42dacc,_0x2857('0xe'));_0x36802f(_0x23263d['result'][_0x2857('0x13')]);}})[_0x2857('0x14')](function(_0x1056fc){logger['error'](_0x2857('0x12'),_0x42dacc,_0x1056fc);_0x209b64(_0x1056fc);});});}function respondWithResult(_0x5ec11e,_0x413e69){_0x413e69=_0x413e69||0xc8;return function(_0x193a10){if(_0x193a10){return _0x5ec11e['status'](_0x413e69)[_0x2857('0x15')](_0x193a10);}};}function respondWithFilteredResult(_0x55f244,_0x294a5a){return function(_0x32242b){if(_0x32242b){var _0x1dacbe=typeof _0x294a5a[_0x2857('0x16')]==='undefined'&&typeof _0x294a5a[_0x2857('0x17')]===_0x2857('0x18');var _0x9937cd=_0x32242b[_0x2857('0x19')];var _0x47c787=_0x1dacbe?0x0:_0x294a5a[_0x2857('0x16')];var _0x40980c=_0x1dacbe?_0x32242b[_0x2857('0x19')]:_0x294a5a['offset']+_0x294a5a['limit'];var _0x1bf402;if(_0x40980c>=_0x9937cd){_0x40980c=_0x9937cd;_0x1bf402=0xc8;}else{_0x1bf402=0xce;}_0x55f244[_0x2857('0x1a')](_0x1bf402);return _0x55f244[_0x2857('0x1b')](_0x2857('0x1c'),_0x47c787+'-'+_0x40980c+'/'+_0x9937cd)[_0x2857('0x15')](_0x32242b);}return null;};}function saveUpdates(_0x3056cf){return function(_0x1ea004){if(_0x1ea004){return _0x1ea004[_0x2857('0x1d')](_0x3056cf)[_0x2857('0xa')](function(_0x521894){return _0x521894;});}return null;};}function removeEntity(_0x7ab76a){return function(_0x5ad3d2){if(_0x5ad3d2){return _0x5ad3d2[_0x2857('0x1e')]()[_0x2857('0xa')](function(){_0x7ab76a[_0x2857('0x1a')](0xcc)[_0x2857('0x1f')]();});}};}function handleEntityNotFound(_0x1f4c37){return function(_0x1ce102){if(!_0x1ce102){_0x1f4c37[_0x2857('0x20')](0x194);}return _0x1ce102;};}function handleError(_0x592eb3,_0x1302c3){_0x1302c3=_0x1302c3||0x1f4;return function(_0x11ad01){logger[_0x2857('0x10')](_0x11ad01['stack']);if(_0x11ad01[_0x2857('0x21')]){delete _0x11ad01[_0x2857('0x21')];}_0x592eb3[_0x2857('0x1a')](_0x1302c3)[_0x2857('0x22')](_0x11ad01);};}exports[_0x2857('0x23')]=function(_0x414f1e,_0x1df6bf){var _0x128f7e={},_0x3df229={},_0x59f799={'count':0x0,'rows':[]};var _0x3903cd=_[_0x2857('0x24')](db[_0x2857('0x25')]['rawAttributes'],function(_0x3fbd0e){return{'name':_0x3fbd0e[_0x2857('0x26')],'type':_0x3fbd0e['type']['key']};});_0x3df229[_0x2857('0x27')]=_[_0x2857('0x24')](_0x3903cd,_0x2857('0x21'));_0x3df229['query']=_[_0x2857('0x28')](_0x414f1e[_0x2857('0x29')]);_0x3df229[_0x2857('0x2a')]=_[_0x2857('0x2b')](_0x3df229[_0x2857('0x27')],_0x3df229['query']);_0x128f7e[_0x2857('0x2c')]=_[_0x2857('0x2b')](_0x3df229[_0x2857('0x27')],qs[_0x2857('0x2d')](_0x414f1e[_0x2857('0x29')][_0x2857('0x2d')]));_0x128f7e[_0x2857('0x2c')]=_0x128f7e[_0x2857('0x2c')]['length']?_0x128f7e[_0x2857('0x2c')]:_0x3df229[_0x2857('0x27')];if(!_0x414f1e[_0x2857('0x29')][_0x2857('0x2e')](_0x2857('0x2f'))){_0x128f7e['limit']=qs[_0x2857('0x17')](_0x414f1e[_0x2857('0x29')][_0x2857('0x17')]);_0x128f7e[_0x2857('0x16')]=qs[_0x2857('0x16')](_0x414f1e[_0x2857('0x29')][_0x2857('0x16')]);}_0x128f7e[_0x2857('0x30')]=qs[_0x2857('0x31')](_0x414f1e[_0x2857('0x29')][_0x2857('0x31')]);_0x128f7e['where']=qs['filters'](_[_0x2857('0x32')](_0x414f1e[_0x2857('0x29')],_0x3df229[_0x2857('0x2a')]),_0x3903cd);if(_0x414f1e[_0x2857('0x29')][_0x2857('0x33')]){_0x128f7e[_0x2857('0x34')]=_['merge'](_0x128f7e['where'],{'$or':_[_0x2857('0x24')](_0x3903cd,function(_0x4605f0){if(_0x4605f0[_0x2857('0x35')]!==_0x2857('0x36')){var _0x49196b={};_0x49196b[_0x4605f0[_0x2857('0x21')]]={'$like':'%'+_0x414f1e[_0x2857('0x29')]['filter']+'%'};return _0x49196b;}})});}_0x128f7e=_['merge']({},_0x128f7e,_0x414f1e[_0x2857('0x37')]);var _0x26e9ed={'where':_0x128f7e['where']};return db[_0x2857('0x25')]['count'](_0x26e9ed)[_0x2857('0xa')](function(_0x2cc4d1){_0x59f799[_0x2857('0x19')]=_0x2cc4d1;if(_0x414f1e[_0x2857('0x29')]['includeAll']){_0x128f7e[_0x2857('0x38')]=[{'all':!![]}];}return db[_0x2857('0x25')]['findAll'](_0x128f7e);})['then'](function(_0x54ba01){_0x59f799[_0x2857('0x39')]=_0x54ba01;return _0x59f799;})[_0x2857('0xa')](respondWithFilteredResult(_0x1df6bf,_0x128f7e))[_0x2857('0x14')](handleError(_0x1df6bf,null));};exports[_0x2857('0x3a')]=function(_0x5c8864,_0x149b68){var _0x6d30fe={'raw':!![],'where':{'id':_0x5c8864['params']['id']}},_0x4eedde={};_0x4eedde[_0x2857('0x27')]=_['keys'](db[_0x2857('0x25')][_0x2857('0x3b')]);_0x4eedde[_0x2857('0x29')]=_[_0x2857('0x28')](_0x5c8864[_0x2857('0x29')]);_0x4eedde[_0x2857('0x2a')]=_[_0x2857('0x2b')](_0x4eedde['model'],_0x4eedde[_0x2857('0x29')]);_0x6d30fe[_0x2857('0x2c')]=_[_0x2857('0x2b')](_0x4eedde[_0x2857('0x27')],qs['fields'](_0x5c8864['query'][_0x2857('0x2d')]));_0x6d30fe['attributes']=_0x6d30fe[_0x2857('0x2c')][_0x2857('0x3c')]?_0x6d30fe['attributes']:_0x4eedde[_0x2857('0x27')];if(_0x5c8864[_0x2857('0x29')][_0x2857('0x3d')]){_0x6d30fe[_0x2857('0x38')]=[{'all':!![]}];}_0x6d30fe=_[_0x2857('0x3e')]({},_0x6d30fe,_0x5c8864[_0x2857('0x37')]);return db[_0x2857('0x25')][_0x2857('0x3f')](_0x6d30fe)['then'](handleEntityNotFound(_0x149b68,null))[_0x2857('0xa')](respondWithResult(_0x149b68,null))[_0x2857('0x14')](handleError(_0x149b68,null));};exports[_0x2857('0x40')]=function(_0x494b7f,_0x5aa7dd){var _0x6d85f8;return db[_0x2857('0x25')]['create'](_0x494b7f['body'],{'raw':!![]})['then'](function(_0x5a5383){_0x6d85f8=_0x5a5383;return db[_0x2857('0x25')][_0x2857('0x41')]({'where':{'type':_0x494b7f[_0x2857('0x42')][_0x2857('0x35')]},'raw':!![]});})[_0x2857('0xa')](function(_0x22ac27){if(_0x6d85f8[_0x2857('0x35')][_0x2857('0x43')]()=='STUN'){var _0x486c0e=fs[_0x2857('0x44')](path['join'](config[_0x2857('0x45')],_0x2857('0x46')),_0x2857('0x47'));var _0x1a3bba=ejs[_0x2857('0x48')](_0x486c0e,{'networks':_0x22ac27||[]});fs[_0x2857('0x49')](_0x2857('0x4a'),_0x1a3bba);return respondWithRpcPromise(_0x2857('0x4b'),_0x2857('0x40'),{'module':_0x2857('0x4c')});}else if(_0x6d85f8[_0x2857('0x35')]['toUpperCase']()==_0x2857('0x4d')){var _0x254c2a=fs[_0x2857('0x44')](path[_0x2857('0x4e')](config['root'],_0x2857('0x4f')),_0x2857('0x47'));var _0x584900=ejs[_0x2857('0x48')](_0x254c2a,{'networks':_0x22ac27||[]});fs[_0x2857('0x49')]('/etc/asterisk/turn_xcally.conf',_0x584900);return respondWithRpcPromise(_0x2857('0x4b'),_0x2857('0x40'),{'module':_0x2857('0x4c')});}else{var _0x35a08e=fs['readFileSync'](path[_0x2857('0x4e')](config['root'],_0x2857('0x50')),'utf8');var _0x1c5b84=ejs['render'](_0x35a08e,{'networks':_0x22ac27||[]});fs[_0x2857('0x49')](util[_0x2857('0x51')]('/etc/asterisk/sip_xcally_%s.conf',_0x494b7f['body'][_0x2857('0x35')][_0x2857('0x52')]()),_0x1c5b84);return respondWithRpcPromise(_0x2857('0x4b'),_0x2857('0x40'),{'module':_0x2857('0x53')});}})[_0x2857('0xa')](function(){return _0x6d85f8;})['then'](respondWithResult(_0x5aa7dd,0xc9))[_0x2857('0x14')](handleError(_0x5aa7dd,null));};exports[_0x2857('0x1d')]=function(_0x3398a8,_0x252823){var _0x105989;return db['Network'][_0x2857('0x3f')]({'where':{'id':_0x3398a8[_0x2857('0x54')]['id']}})[_0x2857('0xa')](handleEntityNotFound(_0x252823,null))[_0x2857('0xa')](saveUpdates(_0x3398a8['body'],null))['then'](function(_0x37511e){if(_0x37511e){_0x105989=_0x37511e;return db['Network']['findAll']({'where':{'type':_0x105989[_0x2857('0x35')]},'raw':!![]});}return null;})[_0x2857('0xa')](function(_0xe97d32){if(_0x105989[_0x2857('0x35')][_0x2857('0x43')]()==_0x2857('0x55')){var _0x1a7afd=fs[_0x2857('0x44')](path['join'](config[_0x2857('0x45')],_0x2857('0x46')),_0x2857('0x47'));var _0x3289b6=ejs['render'](_0x1a7afd,{'networks':_0xe97d32||[]});fs[_0x2857('0x49')](_0x2857('0x4a'),_0x3289b6);return respondWithRpcPromise('Reload',_0x2857('0x1d'),{'module':_0x2857('0x4c')});}else if(_0x105989['type'][_0x2857('0x43')]()==_0x2857('0x4d')){var _0x66d9b8=fs[_0x2857('0x44')](path[_0x2857('0x4e')](config[_0x2857('0x45')],_0x2857('0x4f')),_0x2857('0x47'));var _0x26c4a8=ejs['render'](_0x66d9b8,{'networks':_0xe97d32||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x26c4a8);return respondWithRpcPromise('Reload',_0x2857('0x1d'),{'module':_0x2857('0x4c')});}else{var _0x2bae2e=fs[_0x2857('0x44')](path[_0x2857('0x4e')](config[_0x2857('0x45')],'server/files/templates/network.ejs'),_0x2857('0x47'));var _0x358a24=ejs[_0x2857('0x48')](_0x2bae2e,{'networks':_0xe97d32||[]});fs['writeFileSync'](util[_0x2857('0x51')](_0x2857('0x56'),_0x3398a8['body'][_0x2857('0x35')]['toLowerCase']()),_0x358a24);return respondWithRpcPromise(_0x2857('0x4b'),_0x2857('0x1d'),{'module':_0x2857('0x53')});}})[_0x2857('0xa')](function(_0x3c5e88){if(_0x3c5e88){return _0x105989;}return null;})[_0x2857('0xa')](respondWithResult(_0x252823,null))[_0x2857('0x14')](handleError(_0x252823,null));};exports[_0x2857('0x1e')]=function(_0x1849eb,_0x3885e4){var _0x2bd390;return db[_0x2857('0x25')]['find']({'where':{'id':_0x1849eb[_0x2857('0x54')]['id']}})[_0x2857('0xa')](function(_0xb1023a){_0x2bd390=_0xb1023a;return _0xb1023a;})[_0x2857('0xa')](handleEntityNotFound(_0x3885e4,null))['then'](removeEntity(_0x3885e4,null))['then'](function(){if(_0x2bd390){return db[_0x2857('0x25')]['findAll']({'where':{'type':_0x2bd390[_0x2857('0x35')]},'raw':!![]});}})[_0x2857('0xa')](function(_0x56ab4a){if(_0x2bd390[_0x2857('0x35')]['toUpperCase']()==_0x2857('0x55')){var _0x1eec0d=fs[_0x2857('0x44')](path[_0x2857('0x4e')](config[_0x2857('0x45')],_0x2857('0x46')),_0x2857('0x47'));var _0x4e3c1d=ejs[_0x2857('0x48')](_0x1eec0d,{'networks':_0x56ab4a||[]});fs[_0x2857('0x49')](_0x2857('0x4a'),_0x4e3c1d);return respondWithRpcPromise(_0x2857('0x4b'),_0x2857('0x1e'),{'module':_0x2857('0x4c')});}else if(_0x2bd390['type'][_0x2857('0x43')]()=='TURN'){var _0x3e7877=fs[_0x2857('0x44')](path[_0x2857('0x4e')](config[_0x2857('0x45')],_0x2857('0x4f')),_0x2857('0x47'));var _0x37cc45=ejs[_0x2857('0x48')](_0x3e7877,{'networks':_0x56ab4a||[]});fs[_0x2857('0x49')](_0x2857('0x57'),_0x37cc45);return respondWithRpcPromise(_0x2857('0x4b'),_0x2857('0x1e'),{'module':_0x2857('0x4c')});}else{var _0x267ea6=fs['readFileSync'](path[_0x2857('0x4e')](config['root'],_0x2857('0x50')),_0x2857('0x47'));var _0x569516=ejs[_0x2857('0x48')](_0x267ea6,{'networks':_0x56ab4a||[]});fs['writeFileSync'](util[_0x2857('0x51')](_0x2857('0x56'),_0x2bd390[_0x2857('0x35')][_0x2857('0x52')]()),_0x569516);return respondWithRpcPromise(_0x2857('0x4b'),'destroy',{'module':_0x2857('0x53')});}})[_0x2857('0x14')](handleError(_0x3885e4,null));}; \ No newline at end of file +var _0x816a=['sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','readFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','chan_sip.so','destroy','util','ejs','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','code','error','message','result','status','json','offset','undefined','count','set','Content-Range','end','sendStatus','name','map','Network','rawAttributes','type','key','query','keys','intersection','attributes','length','model','nolimit','limit','order'];(function(_0x10871b,_0x12e6cc){var _0x25ded0=function(_0x4ee1bc){while(--_0x4ee1bc){_0x10871b['push'](_0x10871b['shift']());}};_0x25ded0(++_0x12e6cc);}(_0x816a,0x1cd));var _0xa816=function(_0x3bd8d9,_0x5f3d62){_0x3bd8d9=_0x3bd8d9-0x0;var _0x554339=_0x816a[_0x3bd8d9];return _0x554339;};'use strict';var util=require(_0xa816('0x0'));var path=require('path');var ejs=require(_0xa816('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0xa816('0x2'));var logger=require(_0xa816('0x3'))(_0xa816('0x4'));var config=require('../../config/environment');var db=require(_0xa816('0x5'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa816('0x6')][_0xa816('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28680d,_0x40d314,_0x3fcf18,_0x2b7a52){return new Promise(function(_0x267ab2,_0x414f98){var _0x5c7476=_0x2b7a52||client;return _0x5c7476[_0xa816('0x8')](_0x28680d,_0x3fcf18)[_0xa816('0x9')](function(_0x453fdc){logger[_0xa816('0xa')](_0xa816('0xb'),_0x40d314,_0xa816('0xc'));logger[_0xa816('0xd')](_0xa816('0xe'),_0x40d314,_0xa816('0xc'),JSON['stringify'](_0x453fdc));if(_0x453fdc['error']){if(_0x453fdc['error'][_0xa816('0xf')]===0x1f4){logger[_0xa816('0x10')](_0xa816('0xb'),_0x40d314,_0x453fdc[_0xa816('0x10')][_0xa816('0x11')]);return _0x414f98(_0x453fdc[_0xa816('0x10')][_0xa816('0x11')]);}logger[_0xa816('0x10')](_0xa816('0xb'),_0x40d314,_0x453fdc[_0xa816('0x10')][_0xa816('0x11')]);return _0x267ab2(_0x453fdc[_0xa816('0x10')]['message']);}else{logger[_0xa816('0xa')](_0xa816('0xb'),_0x40d314,_0xa816('0xc'));_0x267ab2(_0x453fdc[_0xa816('0x12')]['message']);}})['catch'](function(_0x3838a0){logger['error'](_0xa816('0xb'),_0x40d314,_0x3838a0);_0x414f98(_0x3838a0);});});}function respondWithResult(_0x30e6e7,_0x447dcf){_0x447dcf=_0x447dcf||0xc8;return function(_0x20d9ba){if(_0x20d9ba){return _0x30e6e7[_0xa816('0x13')](_0x447dcf)[_0xa816('0x14')](_0x20d9ba);}};}function respondWithFilteredResult(_0x4aa183,_0xd8c132){return function(_0x36e603){if(_0x36e603){var _0x3292ff=typeof _0xd8c132[_0xa816('0x15')]===_0xa816('0x16')&&typeof _0xd8c132['limit']===_0xa816('0x16');var _0x4c5c8a=_0x36e603[_0xa816('0x17')];var _0x3ad7e8=_0x3292ff?0x0:_0xd8c132[_0xa816('0x15')];var _0x4d4ccb=_0x3292ff?_0x36e603[_0xa816('0x17')]:_0xd8c132['offset']+_0xd8c132['limit'];var _0xf16d3d;if(_0x4d4ccb>=_0x4c5c8a){_0x4d4ccb=_0x4c5c8a;_0xf16d3d=0xc8;}else{_0xf16d3d=0xce;}_0x4aa183[_0xa816('0x13')](_0xf16d3d);return _0x4aa183[_0xa816('0x18')](_0xa816('0x19'),_0x3ad7e8+'-'+_0x4d4ccb+'/'+_0x4c5c8a)[_0xa816('0x14')](_0x36e603);}return null;};}function saveUpdates(_0x246fbe){return function(_0x5d1e03){if(_0x5d1e03){return _0x5d1e03['update'](_0x246fbe)[_0xa816('0x9')](function(_0x11ed89){return _0x11ed89;});}return null;};}function removeEntity(_0x45125){return function(_0xc38da7){if(_0xc38da7){return _0xc38da7['destroy']()[_0xa816('0x9')](function(){_0x45125[_0xa816('0x13')](0xcc)[_0xa816('0x1a')]();});}};}function handleEntityNotFound(_0x2aeb48){return function(_0x46eeb6){if(!_0x46eeb6){_0x2aeb48[_0xa816('0x1b')](0x194);}return _0x46eeb6;};}function handleError(_0x41bb6b,_0x7e1b45){_0x7e1b45=_0x7e1b45||0x1f4;return function(_0x526d9a){logger[_0xa816('0x10')](_0x526d9a['stack']);if(_0x526d9a[_0xa816('0x1c')]){delete _0x526d9a['name'];}_0x41bb6b['status'](_0x7e1b45)['send'](_0x526d9a);};}exports['index']=function(_0x361247,_0xf2701){var _0x9fec11={},_0x129eda={},_0x5c8b7f={'count':0x0,'rows':[]};var _0x5ceb01=_[_0xa816('0x1d')](db[_0xa816('0x1e')][_0xa816('0x1f')],function(_0xc3533e){return{'name':_0xc3533e['fieldName'],'type':_0xc3533e[_0xa816('0x20')][_0xa816('0x21')]};});_0x129eda['model']=_[_0xa816('0x1d')](_0x5ceb01,'name');_0x129eda[_0xa816('0x22')]=_[_0xa816('0x23')](_0x361247['query']);_0x129eda['filters']=_[_0xa816('0x24')](_0x129eda['model'],_0x129eda['query']);_0x9fec11[_0xa816('0x25')]=_[_0xa816('0x24')](_0x129eda['model'],qs['fields'](_0x361247[_0xa816('0x22')]['fields']));_0x9fec11[_0xa816('0x25')]=_0x9fec11[_0xa816('0x25')][_0xa816('0x26')]?_0x9fec11['attributes']:_0x129eda[_0xa816('0x27')];if(!_0x361247[_0xa816('0x22')]['hasOwnProperty'](_0xa816('0x28'))){_0x9fec11[_0xa816('0x29')]=qs[_0xa816('0x29')](_0x361247[_0xa816('0x22')]['limit']);_0x9fec11['offset']=qs['offset'](_0x361247[_0xa816('0x22')]['offset']);}_0x9fec11[_0xa816('0x2a')]=qs[_0xa816('0x2b')](_0x361247[_0xa816('0x22')][_0xa816('0x2b')]);_0x9fec11['where']=qs[_0xa816('0x2c')](_[_0xa816('0x2d')](_0x361247['query'],_0x129eda['filters']),_0x5ceb01);if(_0x361247[_0xa816('0x22')][_0xa816('0x2e')]){_0x9fec11['where']=_[_0xa816('0x2f')](_0x9fec11[_0xa816('0x30')],{'$or':_['map'](_0x5ceb01,function(_0x1c9bde){if(_0x1c9bde[_0xa816('0x20')]!==_0xa816('0x31')){var _0x456b99={};_0x456b99[_0x1c9bde['name']]={'$like':'%'+_0x361247[_0xa816('0x22')]['filter']+'%'};return _0x456b99;}})});}_0x9fec11=_[_0xa816('0x2f')]({},_0x9fec11,_0x361247[_0xa816('0x32')]);var _0x38eb82={'where':_0x9fec11[_0xa816('0x30')]};return db[_0xa816('0x1e')][_0xa816('0x17')](_0x38eb82)['then'](function(_0x1eddce){_0x5c8b7f[_0xa816('0x17')]=_0x1eddce;if(_0x361247[_0xa816('0x22')][_0xa816('0x33')]){_0x9fec11[_0xa816('0x34')]=[{'all':!![]}];}return db['Network'][_0xa816('0x35')](_0x9fec11);})['then'](function(_0x21533a){_0x5c8b7f[_0xa816('0x36')]=_0x21533a;return _0x5c8b7f;})[_0xa816('0x9')](respondWithFilteredResult(_0xf2701,_0x9fec11))['catch'](handleError(_0xf2701,null));};exports[_0xa816('0x37')]=function(_0x25a1e6,_0x1fb075){var _0x1e51f6={'raw':!![],'where':{'id':_0x25a1e6[_0xa816('0x38')]['id']}},_0x3aa3c3={};_0x3aa3c3[_0xa816('0x27')]=_[_0xa816('0x23')](db[_0xa816('0x1e')][_0xa816('0x1f')]);_0x3aa3c3[_0xa816('0x22')]=_[_0xa816('0x23')](_0x25a1e6['query']);_0x3aa3c3[_0xa816('0x2c')]=_[_0xa816('0x24')](_0x3aa3c3[_0xa816('0x27')],_0x3aa3c3['query']);_0x1e51f6[_0xa816('0x25')]=_[_0xa816('0x24')](_0x3aa3c3[_0xa816('0x27')],qs[_0xa816('0x39')](_0x25a1e6[_0xa816('0x22')]['fields']));_0x1e51f6[_0xa816('0x25')]=_0x1e51f6[_0xa816('0x25')][_0xa816('0x26')]?_0x1e51f6['attributes']:_0x3aa3c3[_0xa816('0x27')];if(_0x25a1e6[_0xa816('0x22')][_0xa816('0x33')]){_0x1e51f6[_0xa816('0x34')]=[{'all':!![]}];}_0x1e51f6=_[_0xa816('0x2f')]({},_0x1e51f6,_0x25a1e6['options']);return db[_0xa816('0x1e')][_0xa816('0x3a')](_0x1e51f6)['then'](handleEntityNotFound(_0x1fb075,null))[_0xa816('0x9')](respondWithResult(_0x1fb075,null))[_0xa816('0x3b')](handleError(_0x1fb075,null));};exports['create']=function(_0x17f2d8,_0x8cf505){var _0x164609;return db[_0xa816('0x1e')][_0xa816('0x3c')](_0x17f2d8['body'],{'raw':!![]})[_0xa816('0x9')](function(_0x56e874){_0x164609=_0x56e874;return db[_0xa816('0x1e')][_0xa816('0x35')]({'where':{'type':_0x17f2d8[_0xa816('0x3d')][_0xa816('0x20')]},'raw':!![]});})['then'](function(_0x2d7e9c){if(_0x164609[_0xa816('0x20')][_0xa816('0x3e')]()==_0xa816('0x3f')){var _0x371af9=fs['readFileSync'](path[_0xa816('0x40')](config[_0xa816('0x41')],_0xa816('0x42')),_0xa816('0x43'));var _0x4f0780=ejs['render'](_0x371af9,{'networks':_0x2d7e9c||[]});fs[_0xa816('0x44')]('/etc/asterisk/stun_xcally.conf',_0x4f0780);return respondWithRpcPromise(_0xa816('0x45'),_0xa816('0x3c'),{'module':_0xa816('0x46')});}else if(_0x164609[_0xa816('0x20')][_0xa816('0x3e')]()==_0xa816('0x47')){var _0x4024be=fs['readFileSync'](path[_0xa816('0x40')](config[_0xa816('0x41')],_0xa816('0x48')),_0xa816('0x43'));var _0x14def7=ejs[_0xa816('0x49')](_0x4024be,{'networks':_0x2d7e9c||[]});fs['writeFileSync'](_0xa816('0x4a'),_0x14def7);return respondWithRpcPromise(_0xa816('0x45'),_0xa816('0x3c'),{'module':_0xa816('0x46')});}else{var _0x12f351=fs[_0xa816('0x4b')](path['join'](config[_0xa816('0x41')],'server/files/templates/network.ejs'),'utf8');var _0x4b2068=ejs[_0xa816('0x49')](_0x12f351,{'networks':_0x2d7e9c||[]});fs['writeFileSync'](util[_0xa816('0x4c')](_0xa816('0x4d'),_0x17f2d8['body'][_0xa816('0x20')][_0xa816('0x4e')]()),_0x4b2068);return respondWithRpcPromise(_0xa816('0x45'),'create',{'module':'chan_sip.so'});}})[_0xa816('0x9')](function(){return _0x164609;})[_0xa816('0x9')](respondWithResult(_0x8cf505,0xc9))[_0xa816('0x3b')](handleError(_0x8cf505,null));};exports[_0xa816('0x4f')]=function(_0xdf79a3,_0x8e8024){var _0x2e4ff4;return db[_0xa816('0x1e')][_0xa816('0x3a')]({'where':{'id':_0xdf79a3[_0xa816('0x38')]['id']}})[_0xa816('0x9')](handleEntityNotFound(_0x8e8024,null))[_0xa816('0x9')](saveUpdates(_0xdf79a3[_0xa816('0x3d')],null))['then'](function(_0x5a8b66){if(_0x5a8b66){_0x2e4ff4=_0x5a8b66;return db['Network'][_0xa816('0x35')]({'where':{'type':_0x2e4ff4[_0xa816('0x20')]},'raw':!![]});}return null;})[_0xa816('0x9')](function(_0xda6bd5){if(_0x2e4ff4['type']['toUpperCase']()==_0xa816('0x3f')){var _0x13acaf=fs[_0xa816('0x4b')](path[_0xa816('0x40')](config[_0xa816('0x41')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x598656=ejs[_0xa816('0x49')](_0x13acaf,{'networks':_0xda6bd5||[]});fs['writeFileSync'](_0xa816('0x50'),_0x598656);return respondWithRpcPromise(_0xa816('0x45'),'update',{'module':_0xa816('0x46')});}else if(_0x2e4ff4[_0xa816('0x20')][_0xa816('0x3e')]()==_0xa816('0x47')){var _0x5c9dff=fs['readFileSync'](path[_0xa816('0x40')](config[_0xa816('0x41')],_0xa816('0x48')),'utf8');var _0x1e5817=ejs['render'](_0x5c9dff,{'networks':_0xda6bd5||[]});fs[_0xa816('0x44')](_0xa816('0x4a'),_0x1e5817);return respondWithRpcPromise(_0xa816('0x45'),_0xa816('0x4f'),{'module':_0xa816('0x46')});}else{var _0x401194=fs['readFileSync'](path[_0xa816('0x40')](config[_0xa816('0x41')],_0xa816('0x51')),_0xa816('0x43'));var _0x2c07be=ejs[_0xa816('0x49')](_0x401194,{'networks':_0xda6bd5||[]});fs[_0xa816('0x44')](util[_0xa816('0x4c')](_0xa816('0x4d'),_0xdf79a3[_0xa816('0x3d')][_0xa816('0x20')][_0xa816('0x4e')]()),_0x2c07be);return respondWithRpcPromise(_0xa816('0x45'),_0xa816('0x4f'),{'module':_0xa816('0x52')});}})['then'](function(_0x117ff1){if(_0x117ff1){return _0x2e4ff4;}return null;})[_0xa816('0x9')](respondWithResult(_0x8e8024,null))[_0xa816('0x3b')](handleError(_0x8e8024,null));};exports[_0xa816('0x53')]=function(_0x5e141f,_0x274a5a){var _0xbba093;return db[_0xa816('0x1e')][_0xa816('0x3a')]({'where':{'id':_0x5e141f[_0xa816('0x38')]['id']}})[_0xa816('0x9')](function(_0x5de17b){_0xbba093=_0x5de17b;return _0x5de17b;})[_0xa816('0x9')](handleEntityNotFound(_0x274a5a,null))['then'](removeEntity(_0x274a5a,null))[_0xa816('0x9')](function(){if(_0xbba093){return db[_0xa816('0x1e')][_0xa816('0x35')]({'where':{'type':_0xbba093[_0xa816('0x20')]},'raw':!![]});}})['then'](function(_0x33506b){if(_0xbba093[_0xa816('0x20')]['toUpperCase']()=='STUN'){var _0x33f962=fs[_0xa816('0x4b')](path[_0xa816('0x40')](config[_0xa816('0x41')],_0xa816('0x42')),_0xa816('0x43'));var _0x244fc8=ejs[_0xa816('0x49')](_0x33f962,{'networks':_0x33506b||[]});fs[_0xa816('0x44')](_0xa816('0x50'),_0x244fc8);return respondWithRpcPromise(_0xa816('0x45'),_0xa816('0x53'),{'module':_0xa816('0x46')});}else if(_0xbba093['type'][_0xa816('0x3e')]()==_0xa816('0x47')){var _0x2e9fbf=fs['readFileSync'](path[_0xa816('0x40')](config[_0xa816('0x41')],_0xa816('0x48')),_0xa816('0x43'));var _0x2a3b21=ejs['render'](_0x2e9fbf,{'networks':_0x33506b||[]});fs['writeFileSync'](_0xa816('0x4a'),_0x2a3b21);return respondWithRpcPromise(_0xa816('0x45'),_0xa816('0x53'),{'module':_0xa816('0x46')});}else{var _0x18dbb=fs[_0xa816('0x4b')](path[_0xa816('0x40')](config[_0xa816('0x41')],_0xa816('0x51')),'utf8');var _0x453b96=ejs[_0xa816('0x49')](_0x18dbb,{'networks':_0x33506b||[]});fs[_0xa816('0x44')](util[_0xa816('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0xbba093['type'][_0xa816('0x4e')]()),_0x453b96);return respondWithRpcPromise(_0xa816('0x45'),_0xa816('0x53'),{'module':_0xa816('0x52')});}})['catch'](handleError(_0x274a5a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 426bdb4..f625fb0 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 _0xfe57=['Network','network','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x75d34e,_0x49a418){var _0x325207=function(_0xf1c2d9){while(--_0xf1c2d9){_0x75d34e['push'](_0x75d34e['shift']());}};_0x325207(++_0x49a418);}(_0xfe57,0x195));var _0x7fe5=function(_0x228641,_0x25d636){_0x228641=_0x228641-0x0;var _0x5d5d78=_0xfe57[_0x228641];return _0x5d5d78;};'use strict';var _=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7fe5('0x2'));var BPromise=require(_0x7fe5('0x3'));var rp=require(_0x7fe5('0x4'));var fs=require('fs');var path=require(_0x7fe5('0x5'));var rimraf=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var attributes=require(_0x7fe5('0x8'));module[_0x7fe5('0x9')]=function(_0x22e850,_0x188cfb){return _0x22e850[_0x7fe5('0xa')](_0x7fe5('0xb'),attributes,{'tableName':_0x7fe5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb688=['exports','Network','network','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes'];(function(_0xa21fd6,_0x18d121){var _0x6fef01=function(_0x464655){while(--_0x464655){_0xa21fd6['push'](_0xa21fd6['shift']());}};_0x6fef01(++_0x18d121);}(_0xb688,0xcf));var _0x8b68=function(_0x1bb53c,_0x401cfd){_0x1bb53c=_0x1bb53c-0x0;var _0x29be6f=_0xb688[_0x1bb53c];return _0x29be6f;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'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 ccc672f..6f2c1f4 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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x367f20,_0x3eee2f){_0x367f20=_0x367f20-0x0;var _0x125c7b=_0x7a54[_0x367f20];return _0x125c7b;};'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(_0x3316d8,_0x54f54e){_0x3316d8=_0x3316d8-0x0;var _0x7ea4f2=_0x7a54[_0x3316d8];return _0x7ea4f2;};'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 fe635da..397ba79 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 _0xb145=['addAnswer','/:id/applications','addApplications','send','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition'];(function(_0x4092c4,_0x14d046){var _0x270885=function(_0x1d47fa){while(--_0x1d47fa){_0x4092c4['push'](_0x4092c4['shift']());}};_0x270885(++_0x14d046);}(_0xb145,0xa3));var _0x5b14=function(_0x443dc0,_0x4c2e2a){_0x443dc0=_0x443dc0-0x0;var _0x1a4092=_0xb145[_0x443dc0];return _0x1a4092;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x9')]('/:id/dispositions',auth[_0x5b14('0xa')](),controller[_0x5b14('0x10')]);router[_0x5b14('0x9')](_0x5b14('0x11'),auth[_0x5b14('0xa')](),controller['getAnswers']);router[_0x5b14('0x9')]('/:id/applications',auth[_0x5b14('0xa')](),controller[_0x5b14('0x12')]);router[_0x5b14('0x9')](_0x5b14('0x13'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x14')]);router['get'](_0x5b14('0x15'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x16')]);router[_0x5b14('0x17')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0x18')]);router[_0x5b14('0x17')](_0x5b14('0x19'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x1a')]);router[_0x5b14('0x17')](_0x5b14('0x11'),auth['isAuthenticated'](),controller[_0x5b14('0x1b')]);router['post']('/:id/notify',controller['notify']);router[_0x5b14('0x17')](_0x5b14('0x1c'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x1d')]);router[_0x5b14('0x17')](_0x5b14('0x15'),auth[_0x5b14('0xa')](),controller['addAgents']);router['post']('/:id/send',auth[_0x5b14('0xa')](),controller[_0x5b14('0x1e')]);router[_0x5b14('0x1f')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0x20')]);router[_0x5b14('0x21')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x22')]);router['delete'](_0x5b14('0x19'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x5b14('0xa')](),controller[_0x5b14('0x23')]);router[_0x5b14('0x21')]('/:id/users',auth[_0x5b14('0xa')](),controller[_0x5b14('0x24')]);module[_0x5b14('0x25')]=router; \ No newline at end of file +var _0x0120=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getAnswers','/:id/applications','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x9f8aa0,_0x291b27){var _0x2e3753=function(_0x1a52a6){while(--_0x1a52a6){_0x9f8aa0['push'](_0x9f8aa0['shift']());}};_0x2e3753(++_0x291b27);}(_0x0120,0x6f));var _0x0012=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x0120[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var path=require(_0x0012('0x2'));var timeout=require(_0x0012('0x3'));var express=require(_0x0012('0x4'));var router=express[_0x0012('0x5')]();var fs_extra=require(_0x0012('0x6'));var auth=require(_0x0012('0x7'));var interaction=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var controller=require(_0x0012('0xa'));router[_0x0012('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0012('0xc'),auth[_0x0012('0xd')](),controller[_0x0012('0xe')]);router[_0x0012('0xb')](_0x0012('0xf'),auth['isAuthenticated'](),controller[_0x0012('0x10')]);router[_0x0012('0xb')](_0x0012('0x11'),auth[_0x0012('0xd')](),controller['getDispositions']);router[_0x0012('0xb')]('/:id/canned_answers',auth[_0x0012('0xd')](),controller[_0x0012('0x12')]);router[_0x0012('0xb')](_0x0012('0x13'),auth[_0x0012('0xd')](),controller['getApplications']);router[_0x0012('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x0012('0x14'),auth['isAuthenticated'](),controller[_0x0012('0x15')]);router[_0x0012('0x16')]('/',auth['isAuthenticated'](),controller[_0x0012('0x17')]);router[_0x0012('0x16')](_0x0012('0x11'),auth[_0x0012('0xd')](),controller['addDisposition']);router['post'](_0x0012('0x18'),auth[_0x0012('0xd')](),controller[_0x0012('0x19')]);router[_0x0012('0x16')](_0x0012('0x1a'),controller[_0x0012('0x1b')]);router[_0x0012('0x16')](_0x0012('0x13'),auth['isAuthenticated'](),controller[_0x0012('0x1c')]);router[_0x0012('0x16')]('/:id/users',auth[_0x0012('0xd')](),controller[_0x0012('0x1d')]);router[_0x0012('0x16')](_0x0012('0x1e'),auth['isAuthenticated'](),controller['send']);router[_0x0012('0x1f')](_0x0012('0xf'),auth[_0x0012('0xd')](),controller[_0x0012('0x20')]);router[_0x0012('0x21')](_0x0012('0xf'),auth[_0x0012('0xd')](),controller[_0x0012('0x22')]);router['delete'](_0x0012('0x11'),auth[_0x0012('0xd')](),controller['removeDispositions']);router[_0x0012('0x21')](_0x0012('0x18'),auth[_0x0012('0xd')](),controller[_0x0012('0x23')]);router[_0x0012('0x21')]('/:id/users',auth[_0x0012('0xd')](),controller[_0x0012('0x24')]);module[_0x0012('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index bd84742..68514f4 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 _0x6a5d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','generate','STRING','TEXT','BOOLEAN'];(function(_0x5cf3a3,_0x29327c){var _0x349b78=function(_0x465240){while(--_0x465240){_0x5cf3a3['push'](_0x5cf3a3['shift']());}};_0x349b78(++_0x29327c);}(_0x6a5d,0x1d9));var _0xd6a5=function(_0x4a7163,_0x573ac4){_0x4a7163=_0x4a7163-0x0;var _0x2e474f=_0x6a5d[_0x4a7163];return _0x2e474f;};'use strict';var Sequelize=require(_0xd6a5('0x0'));var rs=require(_0xd6a5('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd6a5('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd6a5('0x3')]();}},'replyUri':{'type':Sequelize[_0xd6a5('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd6a5('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd6a5('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6a5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd6a5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd6a5('0x4')]},'queueTransfer':{'type':Sequelize[_0xd6a5('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd6a5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd6a5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6a5('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xd6a5('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd6a5('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x243969){if(!_0x243969)this[_0xd6a5('0x9')](_0xd6a5('0xa'),null);this['setDataValue'](_0xd6a5('0xb'),_0x243969);}}}; \ No newline at end of file +var _0xc3b6=['mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x3d7fb5,_0x16eb5c){var _0x3a9642=function(_0x3f5b2a){while(--_0x3f5b2a){_0x3d7fb5['push'](_0x3d7fb5['shift']());}};_0x3a9642(++_0x16eb5c);}(_0xc3b6,0x15e));var _0x6c3b=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0xc3b6[_0x6a0266];return _0x309e00;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6c3b('0x0'));module[_0x6c3b('0x1')]={'name':{'type':Sequelize[_0x6c3b('0x2')],'unique':_0x6c3b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6c3b('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6c3b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6c3b('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6c3b('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x6c3b('0x2')]},'queueTransfer':{'type':Sequelize[_0x6c3b('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6c3b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6c3b('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6c3b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6c3b('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6c3b('0x6')],'defaultValue':![],'comment':_0x6c3b('0x8'),'set':function(_0x1a47af){if(!_0x1a47af)this[_0x6c3b('0x9')](_0x6c3b('0xa'),null);this[_0x6c3b('0x9')](_0x6c3b('0xb'),_0x1a47af);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 12e35a5..b2f5d60 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 _0x66f4=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','then','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','priority','asc','contact','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','lastName','messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','unshift','queue','waitForTheAssignedQueue','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x440323,_0x88c593){var _0x5cf6de=function(_0x1b9b4d){while(--_0x1b9b4d){_0x440323['push'](_0x440323['shift']());}};_0x5cf6de(++_0x88c593);}(_0x66f4,0xb4));var _0x466f=function(_0x3ae605,_0x50fe07){_0x3ae605=_0x3ae605-0x0;var _0x19191a=_0x66f4[_0x3ae605];return _0x19191a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x466f('0x0'));var zipdir=require(_0x466f('0x1'));var jsonpatch=require(_0x466f('0x2'));var rp=require(_0x466f('0x3'));var moment=require(_0x466f('0x4'));var BPromise=require(_0x466f('0x5'));var Mustache=require(_0x466f('0x6'));var util=require(_0x466f('0x7'));var path=require(_0x466f('0x8'));var sox=require('sox');var csv=require(_0x466f('0x9'));var ejs=require(_0x466f('0xa'));var fs=require('fs');var fs_extra=require(_0x466f('0xb'));var _=require(_0x466f('0xc'));var squel=require('squel');var crypto=require(_0x466f('0xd'));var jsforce=require(_0x466f('0xe'));var deskjs=require(_0x466f('0xf'));var toCsv=require(_0x466f('0x9'));var querystring=require(_0x466f('0x10'));var Papa=require(_0x466f('0x11'));var Redis=require('ioredis');var authService=require(_0x466f('0x12'));var qs=require(_0x466f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x466f('0x14'));var logger=require(_0x466f('0x15'))(_0x466f('0x16'));var utils=require(_0x466f('0x17'));var config=require(_0x466f('0x18'));var licenseUtil=require(_0x466f('0x19'));var db=require(_0x466f('0x1a'))['db'];config[_0x466f('0x1b')]=_[_0x466f('0x1c')](config[_0x466f('0x1b')],{'host':_0x466f('0x1d'),'port':0x18eb});var socket=require(_0x466f('0x1e'))(new Redis(config[_0x466f('0x1b')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x466f('0x1f'));var client=jayson[_0x466f('0x20')][_0x466f('0x21')]({'port':0x232c});var client9002=jayson[_0x466f('0x20')][_0x466f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5d869c,_0xf685b6,_0x2c6649,_0x590cae){return new BPromise(function(_0x3e634a,_0xe40a8d){var _0x356ade=_0x590cae||client;return _0x356ade[_0x466f('0x22')](_0x5d869c,_0x2c6649)['then'](function(_0x4ca395){logger[_0x466f('0x23')](_0x466f('0x24'),_0xf685b6,_0x466f('0x25'));logger[_0x466f('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xf685b6,'request\x20sent',JSON['stringify'](_0x4ca395));if(_0x4ca395['error']){if(_0x4ca395['error'][_0x466f('0x27')]===0x1f4){logger[_0x466f('0x28')](_0x466f('0x24'),_0xf685b6,_0x4ca395[_0x466f('0x28')][_0x466f('0x29')]);return _0xe40a8d(_0x4ca395[_0x466f('0x28')][_0x466f('0x29')]);}logger[_0x466f('0x28')](_0x466f('0x24'),_0xf685b6,_0x4ca395[_0x466f('0x28')]['message']);return _0x3e634a(_0x4ca395[_0x466f('0x28')][_0x466f('0x29')]);}else{logger['info'](_0x466f('0x24'),_0xf685b6,_0x466f('0x25'));_0x3e634a(_0x4ca395[_0x466f('0x2a')][_0x466f('0x29')]);}})[_0x466f('0x2b')](function(_0x4cc38e){logger['error'](_0x466f('0x24'),_0xf685b6,_0x4cc38e);_0xe40a8d(_0x4cc38e);});});}function respondWithStatusCode(_0x182883,_0x30f6c4){_0x30f6c4=_0x30f6c4||0xcc;return function(_0x28d703){if(_0x28d703){return _0x182883[_0x466f('0x2c')](_0x30f6c4);}return _0x182883[_0x466f('0x2d')](_0x30f6c4)[_0x466f('0x2e')]();};}function respondWithResult(_0xfe6b1b,_0x5020f9){_0x5020f9=_0x5020f9||0xc8;return function(_0x1b2840){if(_0x1b2840){return _0xfe6b1b[_0x466f('0x2d')](_0x5020f9)[_0x466f('0x2f')](_0x1b2840);}};}function respondWithFilteredResult(_0x13baea,_0x553d3a){return function(_0x6012eb){if(_0x6012eb){var _0x2e9f76=typeof _0x553d3a[_0x466f('0x30')]===_0x466f('0x31')&&typeof _0x553d3a[_0x466f('0x32')]==='undefined';var _0x533bac=_0x6012eb[_0x466f('0x33')];var _0x3dbc2e=_0x2e9f76?0x0:_0x553d3a[_0x466f('0x30')];var _0x4c4f4d=_0x2e9f76?_0x6012eb['count']:_0x553d3a['offset']+_0x553d3a[_0x466f('0x32')];var _0x4ef5f6;if(_0x4c4f4d>=_0x533bac){_0x4c4f4d=_0x533bac;_0x4ef5f6=0xc8;}else{_0x4ef5f6=0xce;}_0x13baea[_0x466f('0x2d')](_0x4ef5f6);return _0x13baea[_0x466f('0x34')](_0x466f('0x35'),_0x3dbc2e+'-'+_0x4c4f4d+'/'+_0x533bac)[_0x466f('0x2f')](_0x6012eb);}return null;};}function patchUpdates(_0x3a6d3c){return function(_0x5622b1){try{jsonpatch[_0x466f('0x36')](_0x5622b1,_0x3a6d3c,!![]);}catch(_0x27db6a){return BPromise[_0x466f('0x37')](_0x27db6a);}return _0x5622b1[_0x466f('0x38')]();};}function saveUpdates(_0x382021,_0x120fd8){return function(_0xc9542f){if(_0xc9542f){return _0xc9542f['update'](_0x382021)['then'](function(_0x1d377b){return _0x1d377b;});}return null;};}function removeEntity(_0x1012d7,_0x580f57){return function(_0x143f6d){if(_0x143f6d){return _0x143f6d['destroy']()['then'](function(){var _0x2307b5=_0x143f6d[_0x466f('0x39')]({'plain':!![]});var _0x3f927a=_0x466f('0x3a');return db[_0x466f('0x3b')][_0x466f('0x3c')]({'where':{'type':_0x3f927a,'resourceId':_0x2307b5['id']}})[_0x466f('0x3d')](function(){return _0x143f6d;});})['then'](function(){_0x1012d7['status'](0xcc)[_0x466f('0x2e')]();});}};}function handleEntityNotFound(_0x10d64b,_0x25f8fe){return function(_0x5c92fa){if(!_0x5c92fa){_0x10d64b[_0x466f('0x2c')](0x194);}return _0x5c92fa;};}function handleError(_0x1814ec,_0x5026ad){_0x5026ad=_0x5026ad||0x1f4;return function(_0x126b03){logger[_0x466f('0x28')](_0x126b03['stack']);if(_0x126b03[_0x466f('0x3e')]){delete _0x126b03[_0x466f('0x3e')];}_0x1814ec['status'](_0x5026ad)[_0x466f('0x3f')](_0x126b03);};}exports[_0x466f('0x40')]=function(_0xe8dd06,_0x2661fa){var _0x2c5363={'include':[{'model':db['Pause'],'as':_0x466f('0x41')}]},_0x2789d1={},_0x1dfa85={'count':0x0,'rows':[]};var _0xa3cc40=_[_0x466f('0x42')](db[_0x466f('0x43')][_0x466f('0x44')],function(_0x3abc89){return{'name':_0x3abc89[_0x466f('0x45')],'type':_0x3abc89[_0x466f('0x46')][_0x466f('0x47')]};});_0x2789d1[_0x466f('0x48')]=_['map'](_0xa3cc40,_0x466f('0x3e'));_0x2789d1['query']=_[_0x466f('0x49')](_0xe8dd06['query']);_0x2789d1['filters']=_[_0x466f('0x4a')](_0x2789d1[_0x466f('0x48')],_0x2789d1[_0x466f('0x4b')]);_0x2c5363[_0x466f('0x4c')]=_[_0x466f('0x4a')](_0x2789d1[_0x466f('0x48')],qs[_0x466f('0x4d')](_0xe8dd06[_0x466f('0x4b')][_0x466f('0x4d')]));_0x2c5363[_0x466f('0x4c')]=_0x2c5363[_0x466f('0x4c')][_0x466f('0x4e')]?_0x2c5363['attributes']:_0x2789d1[_0x466f('0x48')];if(!_0xe8dd06[_0x466f('0x4b')][_0x466f('0x4f')](_0x466f('0x50'))){_0x2c5363['limit']=qs[_0x466f('0x32')](_0xe8dd06[_0x466f('0x4b')][_0x466f('0x32')]);_0x2c5363[_0x466f('0x30')]=qs[_0x466f('0x30')](_0xe8dd06[_0x466f('0x4b')]['offset']);}_0x2c5363[_0x466f('0x51')]=qs[_0x466f('0x52')](_0xe8dd06[_0x466f('0x4b')][_0x466f('0x52')]);_0x2c5363[_0x466f('0x53')]=qs[_0x466f('0x54')](_['pick'](_0xe8dd06[_0x466f('0x4b')],_0x2789d1[_0x466f('0x54')]),_0xa3cc40);if(_0xe8dd06[_0x466f('0x4b')][_0x466f('0x55')]){_0x2c5363[_0x466f('0x53')]=_[_0x466f('0x56')](_0x2c5363[_0x466f('0x53')],{'$or':_[_0x466f('0x42')](_0xa3cc40,function(_0x1f5ac2){if(_0x1f5ac2['type']!==_0x466f('0x57')){var _0xcf7108={};_0xcf7108[_0x1f5ac2[_0x466f('0x3e')]]={'$like':'%'+_0xe8dd06[_0x466f('0x4b')]['filter']+'%'};return _0xcf7108;}})});}_0x2c5363=_[_0x466f('0x56')]({},_0x2c5363,_0xe8dd06[_0x466f('0x58')]);var _0x59c8f7={'where':_0x2c5363[_0x466f('0x53')]};return db[_0x466f('0x43')][_0x466f('0x33')](_0x59c8f7)['then'](function(_0x3c0eef){_0x1dfa85[_0x466f('0x33')]=_0x3c0eef;if(_0xe8dd06[_0x466f('0x4b')][_0x466f('0x59')]){_0x2c5363[_0x466f('0x5a')]=[{'all':!![]}];}return db[_0x466f('0x43')][_0x466f('0x5b')](_0x2c5363);})[_0x466f('0x3d')](function(_0x1ee618){_0x1dfa85[_0x466f('0x5c')]=_0x1ee618;return _0x1dfa85;})['then'](respondWithFilteredResult(_0x2661fa,_0x2c5363))[_0x466f('0x2b')](handleError(_0x2661fa,null));};exports['show']=function(_0xaf834a,_0x5926a2){var _0x1659c6={'raw':![],'where':{'id':_0xaf834a[_0x466f('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x466f('0x41')}]},_0x7c1587={};_0x7c1587['model']=_['keys'](db[_0x466f('0x43')]['rawAttributes']);_0x7c1587[_0x466f('0x4b')]=_[_0x466f('0x49')](_0xaf834a[_0x466f('0x4b')]);_0x7c1587['filters']=_[_0x466f('0x4a')](_0x7c1587[_0x466f('0x48')],_0x7c1587[_0x466f('0x4b')]);_0x1659c6['attributes']=_['intersection'](_0x7c1587[_0x466f('0x48')],qs['fields'](_0xaf834a[_0x466f('0x4b')][_0x466f('0x4d')]));_0x1659c6[_0x466f('0x4c')]=_0x1659c6[_0x466f('0x4c')][_0x466f('0x4e')]?_0x1659c6[_0x466f('0x4c')]:_0x7c1587[_0x466f('0x48')];if(_0xaf834a[_0x466f('0x4b')][_0x466f('0x59')]){_0x1659c6[_0x466f('0x5a')]=[{'all':!![]}];}_0x1659c6=_[_0x466f('0x56')]({},_0x1659c6,_0xaf834a['options']);return db[_0x466f('0x43')]['find'](_0x1659c6)[_0x466f('0x3d')](handleEntityNotFound(_0x5926a2,null))['then'](respondWithResult(_0x5926a2,null))[_0x466f('0x2b')](handleError(_0x5926a2,null));};exports[_0x466f('0x5e')]=function(_0x400d8f,_0x898a66){return db['OpenchannelAccount'][_0x466f('0x5e')](_0x400d8f[_0x466f('0x5f')],{})['then'](function(_0x5da871){var _0x8af8ce=_0x400d8f[_0x466f('0x60')][_0x466f('0x39')]({'plain':!![]});if(!_0x8af8ce)throw new Error(_0x466f('0x61'));if(_0x8af8ce[_0x466f('0x62')]===_0x466f('0x60')){var _0x140c9f=_0x5da871['get']({'plain':!![]});var _0x5ee2a4='OpenchannelAccounts';return db['UserProfileSection'][_0x466f('0x63')]({'where':{'name':_0x5ee2a4,'userProfileId':_0x8af8ce[_0x466f('0x64')]},'raw':!![]})[_0x466f('0x3d')](function(_0x3bc1a5){if(_0x3bc1a5&&_0x3bc1a5[_0x466f('0x65')]===0x0){return db['UserProfileResource'][_0x466f('0x5e')]({'name':_0x140c9f['name'],'resourceId':_0x140c9f['id'],'type':_0x3bc1a5[_0x466f('0x3e')],'sectionId':_0x3bc1a5['id']},{})['then'](function(){return _0x5da871;});}else{return _0x5da871;}})[_0x466f('0x2b')](function(_0x333fc1){logger[_0x466f('0x28')](_0x466f('0x66'),_0x333fc1);throw _0x333fc1;});}return _0x5da871;})[_0x466f('0x3d')](respondWithResult(_0x898a66,0xc9))[_0x466f('0x2b')](handleError(_0x898a66,null));};exports[_0x466f('0x67')]=function(_0x51e43e,_0x56467b){if(_0x51e43e['body']['id']){delete _0x51e43e[_0x466f('0x5f')]['id'];}return db[_0x466f('0x43')][_0x466f('0x63')]({'where':{'id':_0x51e43e['params']['id']},'include':[{'model':db[_0x466f('0x68')],'as':_0x466f('0x41')}]})[_0x466f('0x3d')](handleEntityNotFound(_0x56467b,null))[_0x466f('0x3d')](saveUpdates(_0x51e43e[_0x466f('0x5f')],null))[_0x466f('0x3d')](respondWithResult(_0x56467b,null))[_0x466f('0x2b')](handleError(_0x56467b,null));};exports[_0x466f('0x3c')]=function(_0x257f0f,_0x2fab2e){return db['OpenchannelAccount'][_0x466f('0x63')]({'where':{'id':_0x257f0f[_0x466f('0x5d')]['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x2fab2e,null))[_0x466f('0x3d')](removeEntity(_0x2fab2e,null))[_0x466f('0x2b')](handleError(_0x2fab2e,null));};exports[_0x466f('0x69')]=function(_0x5c535c,_0x2c9d90){return db[_0x466f('0x43')][_0x466f('0x69')]()['then'](respondWithResult(_0x2c9d90,null))[_0x466f('0x2b')](handleError(_0x2c9d90,null));};exports[_0x466f('0x6a')]=function(_0x3bf77b,_0x52046c,_0x3a6a62){if(_0x3bf77b[_0x466f('0x5f')]['id']){delete _0x3bf77b[_0x466f('0x5f')]['id'];}return db[_0x466f('0x43')]['find']({'where':{'id':_0x3bf77b[_0x466f('0x5d')]['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x52046c,null))[_0x466f('0x3d')](function(_0x494180){if(_0x494180){_0x3bf77b[_0x466f('0x5f')][_0x466f('0x6b')]=_0x494180['id'];return db[_0x466f('0x6c')]['create'](_0x3bf77b[_0x466f('0x5f')]);}})[_0x466f('0x3d')](respondWithResult(_0x52046c,null))[_0x466f('0x2b')](handleError(_0x52046c,null));};exports[_0x466f('0x6d')]=function(_0x5163af,_0x39ca9e,_0xfef85c){var _0x52d761={'raw':![],'where':{}};var _0x5a2ee1={};var _0x2ccd3b={'count':0x0,'rows':[]};return db[_0x466f('0x43')]['findOne']({'where':{'id':_0x5163af[_0x466f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x39ca9e,null))[_0x466f('0x3d')](function(_0x3f57a9){if(_0x3f57a9){_0x5a2ee1[_0x466f('0x48')]=_[_0x466f('0x49')](db[_0x466f('0x6c')][_0x466f('0x44')]);_0x5a2ee1['query']=_[_0x466f('0x49')](_0x5163af[_0x466f('0x4b')]);_0x5a2ee1[_0x466f('0x54')]=_[_0x466f('0x4a')](_0x5a2ee1['model'],_0x5a2ee1[_0x466f('0x4b')]);_0x52d761[_0x466f('0x4c')]=_[_0x466f('0x4a')](_0x5a2ee1['model'],qs['fields'](_0x5163af[_0x466f('0x4b')][_0x466f('0x4d')]));_0x52d761[_0x466f('0x4c')]=_0x52d761[_0x466f('0x4c')][_0x466f('0x4e')]?_0x52d761[_0x466f('0x4c')]:_0x5a2ee1[_0x466f('0x48')];if(!_0x5163af[_0x466f('0x4b')][_0x466f('0x4f')](_0x466f('0x50'))){_0x52d761['limit']=qs[_0x466f('0x32')](_0x5163af[_0x466f('0x4b')][_0x466f('0x32')]);_0x52d761[_0x466f('0x30')]=qs[_0x466f('0x30')](_0x5163af[_0x466f('0x4b')][_0x466f('0x30')]);}_0x52d761[_0x466f('0x51')]=qs[_0x466f('0x52')](_0x5163af['query']['sort']);_0x52d761['where']=qs[_0x466f('0x54')](_[_0x466f('0x6e')](_0x5163af['query'],_0x5a2ee1[_0x466f('0x54')]));_0x52d761[_0x466f('0x53')][_0x466f('0x6b')]=_0x3f57a9['id'];if(_0x5163af[_0x466f('0x4b')][_0x466f('0x55')]){_0x52d761[_0x466f('0x53')]=_['merge'](_0x52d761[_0x466f('0x53')],{'$or':_[_0x466f('0x42')](_0x52d761[_0x466f('0x4c')],function(_0x5b8cbd){var _0x14f6bd={};_0x14f6bd[_0x5b8cbd]={'$like':'%'+_0x5163af[_0x466f('0x4b')][_0x466f('0x55')]+'%'};return _0x14f6bd;})});}_0x52d761=_['merge']({},_0x52d761,_0x5163af[_0x466f('0x58')]);return db[_0x466f('0x6c')][_0x466f('0x33')]({'where':_0x52d761['where']})[_0x466f('0x3d')](function(_0x4cad6e){_0x2ccd3b['count']=_0x4cad6e;if(_0x5163af[_0x466f('0x4b')][_0x466f('0x59')]){_0x52d761[_0x466f('0x5a')]=[{'all':!![]}];}return db[_0x466f('0x6c')]['findAll'](_0x52d761);})[_0x466f('0x3d')](function(_0x34fe4a){_0x2ccd3b[_0x466f('0x5c')]=_0x34fe4a;return _0x2ccd3b;});}})[_0x466f('0x3d')](respondWithFilteredResult(_0x39ca9e,_0x52d761))[_0x466f('0x2b')](handleError(_0x39ca9e,null));};exports[_0x466f('0x6f')]=function(_0x368046,_0x857939,_0x55cdb2){return db[_0x466f('0x43')]['find']({'where':{'id':_0x368046['params']['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x857939,null))[_0x466f('0x3d')](function(_0x3e96fe){if(_0x3e96fe){return _0x3e96fe['removeDispositions'](_0x368046[_0x466f('0x4b')][_0x466f('0x70')]);}})[_0x466f('0x3d')](respondWithStatusCode(_0x857939,null))['catch'](handleError(_0x857939,null));};exports[_0x466f('0x71')]=function(_0x330c48,_0x4346cb,_0x3be5b9){if(_0x330c48[_0x466f('0x5f')]['id']){delete _0x330c48['body']['id'];}return db[_0x466f('0x43')][_0x466f('0x63')]({'where':{'id':_0x330c48[_0x466f('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4346cb,null))[_0x466f('0x3d')](function(_0x8de131){if(_0x8de131){_0x330c48[_0x466f('0x5f')][_0x466f('0x6b')]=_0x8de131['id'];return db[_0x466f('0x72')][_0x466f('0x5e')](_0x330c48[_0x466f('0x5f')]);}})[_0x466f('0x3d')](respondWithResult(_0x4346cb,null))[_0x466f('0x2b')](handleError(_0x4346cb,null));};exports[_0x466f('0x73')]=function(_0x1cc49e,_0x623a05,_0x706214){var _0x51ee9f={'raw':![],'where':{}};var _0x28e29d={};var _0x207169={'count':0x0,'rows':[]};return db[_0x466f('0x43')][_0x466f('0x74')]({'where':{'id':_0x1cc49e[_0x466f('0x5d')]['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x623a05,null))[_0x466f('0x3d')](function(_0x244ebd){if(_0x244ebd){_0x28e29d[_0x466f('0x48')]=_[_0x466f('0x49')](db[_0x466f('0x72')][_0x466f('0x44')]);_0x28e29d[_0x466f('0x4b')]=_['keys'](_0x1cc49e['query']);_0x28e29d[_0x466f('0x54')]=_[_0x466f('0x4a')](_0x28e29d[_0x466f('0x48')],_0x28e29d[_0x466f('0x4b')]);_0x51ee9f[_0x466f('0x4c')]=_[_0x466f('0x4a')](_0x28e29d[_0x466f('0x48')],qs[_0x466f('0x4d')](_0x1cc49e['query'][_0x466f('0x4d')]));_0x51ee9f[_0x466f('0x4c')]=_0x51ee9f['attributes'][_0x466f('0x4e')]?_0x51ee9f[_0x466f('0x4c')]:_0x28e29d[_0x466f('0x48')];if(!_0x1cc49e[_0x466f('0x4b')]['hasOwnProperty'](_0x466f('0x50'))){_0x51ee9f[_0x466f('0x32')]=qs[_0x466f('0x32')](_0x1cc49e['query']['limit']);_0x51ee9f[_0x466f('0x30')]=qs[_0x466f('0x30')](_0x1cc49e['query'][_0x466f('0x30')]);}_0x51ee9f['order']=qs[_0x466f('0x52')](_0x1cc49e['query'][_0x466f('0x52')]);_0x51ee9f[_0x466f('0x53')]=qs['filters'](_['pick'](_0x1cc49e[_0x466f('0x4b')],_0x28e29d[_0x466f('0x54')]));_0x51ee9f[_0x466f('0x53')]['OpenchannelAccountId']=_0x244ebd['id'];if(_0x1cc49e['query'][_0x466f('0x55')]){_0x51ee9f['where']=_[_0x466f('0x56')](_0x51ee9f[_0x466f('0x53')],{'$or':_[_0x466f('0x42')](_0x51ee9f[_0x466f('0x4c')],function(_0x3ee16a){var _0x3cbc74={};_0x3cbc74[_0x3ee16a]={'$like':'%'+_0x1cc49e[_0x466f('0x4b')][_0x466f('0x55')]+'%'};return _0x3cbc74;})});}_0x51ee9f=_[_0x466f('0x56')]({},_0x51ee9f,_0x1cc49e[_0x466f('0x58')]);return db[_0x466f('0x72')][_0x466f('0x33')]({'where':_0x51ee9f[_0x466f('0x53')]})[_0x466f('0x3d')](function(_0xc123e6){_0x207169[_0x466f('0x33')]=_0xc123e6;if(_0x1cc49e[_0x466f('0x4b')][_0x466f('0x59')]){_0x51ee9f[_0x466f('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x466f('0x5b')](_0x51ee9f);})[_0x466f('0x3d')](function(_0xd59c2e){_0x207169[_0x466f('0x5c')]=_0xd59c2e;return _0x207169;});}})[_0x466f('0x3d')](respondWithFilteredResult(_0x623a05,_0x51ee9f))[_0x466f('0x2b')](handleError(_0x623a05,null));};exports[_0x466f('0x75')]=function(_0x4cd33c,_0x2ac8c0,_0xdbb6ca){return db[_0x466f('0x43')][_0x466f('0x63')]({'where':{'id':_0x4cd33c[_0x466f('0x5d')]['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x2ac8c0,null))[_0x466f('0x3d')](function(_0x9fc8b7){if(_0x9fc8b7){return _0x9fc8b7['removeAnswers'](_0x4cd33c[_0x466f('0x4b')][_0x466f('0x70')]);}})[_0x466f('0x3d')](respondWithStatusCode(_0x2ac8c0,null))[_0x466f('0x2b')](handleError(_0x2ac8c0,null));};exports[_0x466f('0x76')]=function(_0x15d0b3,_0x497d42,_0x2add12){var _0x1976ad={'body':_0x15d0b3[_0x466f('0x5f')],'channel':'openchannel'};var _0x51b849=[];var _0x39d13d=[];var _0x5453eb={};var _0x2ce472=![];return db[_0x466f('0x77')][_0x466f('0x69')]()['then'](function(_0x1ebd40){if(!_0x1ebd40){throw new db[(_0x466f('0x78'))][(_0x466f('0x79'))](_0x466f('0x7a'));}_0x51b849=_['difference'](_['keys'](_0x1ebd40),[_0x466f('0x7b'),_0x466f('0x7c')]);_0x39d13d=_['difference'](_[_0x466f('0x49')](_0x1ebd40),[_0x466f('0x7b'),'updatedAt','CompanyId',_0x466f('0x7d')]);if(_0x15d0b3[_0x466f('0x5f')]['id']){delete _0x15d0b3[_0x466f('0x5f')]['id'];}if(_['isNil'](_0x15d0b3['body'][_0x466f('0x7e')])){throw new db[(_0x466f('0x78'))][(_0x466f('0x79'))](_0x466f('0x7f'));}if(_[_0x466f('0x80')](_0x15d0b3[_0x466f('0x5f')][_0x466f('0x5f')])||_0x15d0b3[_0x466f('0x5f')]['body']===''){throw new db[(_0x466f('0x78'))][(_0x466f('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x466f('0x80')](_0x15d0b3['body'][_0x466f('0x81')])){throw new db[(_0x466f('0x78'))][(_0x466f('0x79'))](_0x466f('0x82')+_0x39d13d);}if(!_[_0x466f('0x83')](_0x39d13d,_0x15d0b3[_0x466f('0x5f')]['mapKey'])){throw new db[(_0x466f('0x78'))][(_0x466f('0x79'))](_0x466f('0x84')+_0x39d13d);}_0x5453eb[_0x15d0b3[_0x466f('0x5f')][_0x466f('0x81')]]=_0x15d0b3[_0x466f('0x5f')][_0x466f('0x7e')];})['then'](function(){return db[_0x466f('0x43')]['find']({'where':{'id':_0x15d0b3['params']['id']},'include':[{'model':db['CmList'],'as':_0x466f('0x85'),'include':[{'model':db[_0x466f('0x77')],'as':_0x466f('0x86'),'where':_0x5453eb,'limit':0x1,'order':[[_0x466f('0x7c'),_0x466f('0x87')]]}]},{'model':db[_0x466f('0x88')],'as':_0x466f('0x89')}]});})[_0x466f('0x3d')](handleEntityNotFound(_0x497d42,null))[_0x466f('0x3d')](function(_0xbb9532){if(_0xbb9532&&_0xbb9532[_0x466f('0x85')]){_0x1976ad[_0x466f('0x8a')]=_0xbb9532;_0x1976ad[_0x466f('0x8b')]=_0xbb9532[_0x466f('0x89')];_0x1976ad[_0x466f('0x8c')]=_0xbb9532[_0x466f('0x85')];_0x1976ad[_0x466f('0x8b')]=_['orderBy'](_0x1976ad[_0x466f('0x8b')],[_0x466f('0x8d')],[_0x466f('0x8e')]);if(_0x1976ad['account'][_0x466f('0x89')]){delete _0x1976ad['account']['Applications'];}if(_0x1976ad[_0x466f('0x8a')][_0x466f('0x85')]&&_0x1976ad['account'][_0x466f('0x85')]['Contacts'][_0x466f('0x4e')]){return _0x1976ad[_0x466f('0x8a')][_0x466f('0x85')][_0x466f('0x86')][0x0];}var _0x2f4523=_[_0x466f('0x1c')](_0x15d0b3['body'],{'firstName':_0x15d0b3[_0x466f('0x5f')][_0x466f('0x7e')],'ListId':_0xbb9532['ListId']});_0x2f4523[_0x15d0b3['body']['mapKey']]=_0x15d0b3[_0x466f('0x5f')][_0x466f('0x7e')];return db[_0x466f('0x77')][_0x466f('0x5e')](_0x2f4523,{'fields':_0x51b849,'raw':!![]});}})[_0x466f('0x3d')](handleEntityNotFound(_0x497d42,null))[_0x466f('0x3d')](function(_0x477b50){_0x1976ad[_0x466f('0x8f')]=_0x477b50;if(_0x477b50){var _0x276d5d={'ContactId':_0x477b50['id'],'OpenchannelAccountId':_0x15d0b3['params']['id'],'from':(_0x477b50[_0x466f('0x90')]||'')+'\x20'+(_0x477b50['lastName']||'')};var _0x5c4cb3={'OpenchannelAccountId':_0x15d0b3[_0x466f('0x5d')]['id'],'closed':![]};if(_0x15d0b3[_0x466f('0x5f')]['threadId']){_0x5c4cb3[_0x466f('0x91')]=_0x15d0b3[_0x466f('0x5f')][_0x466f('0x91')];return db['OpenchannelInteraction']['find']({'where':_0x5c4cb3})['then'](function(_0x26a593){if(_0x26a593){return[_0x26a593,![]];}_0x276d5d[_0x466f('0x91')]=_0x15d0b3[_0x466f('0x5f')][_0x466f('0x91')];_0x276d5d[_0x466f('0x92')]=_0x15d0b3[_0x466f('0x5f')][_0x466f('0x92')];return db[_0x466f('0x93')][_0x466f('0x5e')](_0x276d5d)['then'](function(_0xcc884c){return[_0xcc884c,!![]];});});}else{_0x5c4cb3[_0x466f('0x91')]=null;}_0x5c4cb3[_0x466f('0x94')]=_0x477b50['id'];return db[_0x466f('0x93')][_0x466f('0x63')]({'where':_0x5c4cb3})[_0x466f('0x3d')](function(_0x329868){if(_0x329868){return[_0x329868,![]];}return db[_0x466f('0x93')][_0x466f('0x5e')](_0x276d5d)[_0x466f('0x3d')](function(_0x2402ae){return[_0x2402ae,!![]];});});}})[_0x466f('0x95')](function(_0xb618d8,_0x523669){if(_0xb618d8){_0x2ce472=_0x523669;if(!_0x523669){var _0x1f0e61={'from':(_0x1976ad[_0x466f('0x8f')]['firstName']||'')+'\x20'+(_0x1976ad[_0x466f('0x8f')][_0x466f('0x96')]||'')};if(_0x15d0b3[_0x466f('0x5f')]['threadId']&&_0x15d0b3[_0x466f('0x5f')][_0x466f('0x97')]&&_0x15d0b3['body'][_0x466f('0x91')]!=_0x15d0b3['body'][_0x466f('0x97')]){_0x1f0e61[_0x466f('0x91')]=_0x15d0b3[_0x466f('0x5f')][_0x466f('0x97')];}return _0xb618d8[_0x466f('0x67')](_0x1f0e61);}else{return _0xb618d8;}}})[_0x466f('0x3d')](function(_0x5a4b1f){_0x1976ad['interaction']=_0x5a4b1f[_0x466f('0x39')]({'plain':!![]});_0x1976ad[_0x466f('0x98')][_0x466f('0x99')]=_0x2ce472;if(_0x1976ad['interaction'][_0x466f('0x99')]){if(_0x1976ad[_0x466f('0x8a')][_0x466f('0x9a')]){_0x1976ad[_0x466f('0x8b')]['push']({'id':0x0,'priority':_0x1976ad[_0x466f('0x8b')][_0x466f('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x466f('0x9b')});}}return db[_0x466f('0x9c')][_0x466f('0x5e')]({'body':_0x15d0b3[_0x466f('0x5f')]['body'],'OpenchannelAccountId':_0x15d0b3[_0x466f('0x5d')]['id'],'OpenchannelInteractionId':_0x5a4b1f['id'],'direction':'in','ContactId':_0x1976ad['contact']['id'],'AttachmentId':_0x15d0b3[_0x466f('0x5f')][_0x466f('0x9d')]});})[_0x466f('0x3d')](function(_0x16f82c){_0x1976ad[_0x466f('0x29')]=_0x16f82c;if(!_0x1976ad['interaction'][_0x466f('0x9e')])return;return db[_0x466f('0x9f')][_0x466f('0x63')]({'attributes':['id',_0x466f('0x3e')],'where':{'id':_0x1976ad[_0x466f('0x98')]['UserId']}});})[_0x466f('0x3d')](function(_0x22a996){if(_0x22a996){_0x1976ad[_0x466f('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x466f('0xa0'),'appdata':_0x22a996[_0x466f('0x3e')]+','+(_0x1976ad[_0x466f('0x8a')][_0x466f('0xa1')]||0xa),'interval':_0x466f('0x9b')});}if(!_0x1976ad[_0x466f('0x98')][_0x466f('0xa2')])return;return db[_0x466f('0xa3')][_0x466f('0x63')]({'attributes':['id','name'],'where':{'id':_0x1976ad['interaction'][_0x466f('0xa2')]}});})['then'](function(_0x4e3abe){if(_0x4e3abe){_0x1976ad[_0x466f('0x8b')][_0x466f('0xa4')]({'id':0x0,'priority':0x1,'app':_0x466f('0xa5'),'appdata':_0x4e3abe[_0x466f('0x3e')]+','+(_0x1976ad[_0x466f('0x8a')][_0x466f('0xa6')]||0x12c),'interval':_0x466f('0x9b')});}return respondWithRpcPromise('Start',_0x466f('0xa7'),_0x1976ad);})['then'](function(_0x3687f4){respondWithRpcPromise('EventManager',_0x466f('0xa8'),{'event':'notify','message':_0x3687f4},client9002);return _0x3687f4;})['then'](respondWithResult(_0x497d42,null))[_0x466f('0x2b')](handleError(_0x497d42,null));};exports[_0x466f('0xa9')]=function(_0x1b1403,_0x4f1b1d){var _0x341c70=_0x1b1403[_0x466f('0x5d')]['id'];var _0x276696=_0x1b1403[_0x466f('0x5f')];var _0x12a71d=0xc8;var _0x205efe=null;return db[_0x466f('0xaa')][_0x466f('0xab')]({'isolationLevel':db['sequelize']['Transaction'][_0x466f('0xac')][_0x466f('0xad')]},function(_0x2b788f){return db['OpenchannelAccount'][_0x466f('0x74')]({'where':{'id':_0x341c70},'transaction':_0x2b788f})[_0x466f('0x3d')](function(_0x116608){if(_0x116608){return db[_0x466f('0x88')][_0x466f('0x3c')]({'where':{'OpenchannelAccountId':_0x341c70},'transaction':_0x2b788f})[_0x466f('0x3d')](function(){var _0x1255e8=_[_0x466f('0x42')](_0x276696,function(_0x212c78){_0x212c78[_0x466f('0x6b')]=_0x341c70;return _0x212c78;});return db[_0x466f('0x88')]['bulkCreate'](_0x1255e8,{'transaction':_0x2b788f});});}else{_0x12a71d=0x194;_0x205efe=[];}});})[_0x466f('0x3d')](function(){if(_0x12a71d!==0x194){return db[_0x466f('0x88')][_0x466f('0xae')]({'where':{'OpenchannelAccountId':_0x341c70},'order':_0x466f('0x8d')})[_0x466f('0x3d')](function(_0x8db310){_0x205efe=_0x8db310;});}})[_0x466f('0x2b')](function(_0x3ddf5e){_0x12a71d=0x1f4;logger['error'](_0x3ddf5e[_0x466f('0xaf')]);if(_0x3ddf5e[_0x466f('0x3e')]){delete _0x3ddf5e[_0x466f('0x3e')];}_0x205efe=_0x3ddf5e;})[_0x466f('0xb0')](function(){if(_0x205efe===null){_0x4f1b1d[_0x466f('0x2c')](_0x12a71d);}else{if(_0x12a71d===0x1f4){_0x4f1b1d[_0x466f('0x2d')](_0x12a71d)['send'](_0x205efe);}else{_0x4f1b1d['status'](_0x12a71d)['json'](_0x205efe);}}});};exports[_0x466f('0xb1')]=function(_0x1965af,_0x2b1b8a,_0x44c203){var _0x2f421f={};var _0x4bc646={};var _0xd9a648;var _0x29cb1d;return db[_0x466f('0x43')]['findOne']({'where':{'id':_0x1965af[_0x466f('0x5d')]['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x2b1b8a,null))[_0x466f('0x3d')](function(_0x1d8585){if(_0x1d8585){_0xd9a648=_0x1d8585;_0x4bc646[_0x466f('0x48')]=_[_0x466f('0x49')](db[_0x466f('0x88')][_0x466f('0x44')]);_0x4bc646[_0x466f('0x4b')]=_['keys'](_0x1965af[_0x466f('0x4b')]);_0x4bc646['filters']=_['intersection'](_0x4bc646[_0x466f('0x48')],_0x4bc646[_0x466f('0x4b')]);_0x2f421f[_0x466f('0x4c')]=_['intersection'](_0x4bc646[_0x466f('0x48')],qs['fields'](_0x1965af[_0x466f('0x4b')][_0x466f('0x4d')]));_0x2f421f[_0x466f('0x4c')]=_0x2f421f[_0x466f('0x4c')][_0x466f('0x4e')]?_0x2f421f['attributes']:_0x4bc646[_0x466f('0x48')];_0x2f421f['order']=qs[_0x466f('0x52')](_0x1965af[_0x466f('0x4b')][_0x466f('0x52')]);_0x2f421f['where']=qs['filters'](_[_0x466f('0x6e')](_0x1965af[_0x466f('0x4b')],_0x4bc646[_0x466f('0x54')]));if(_0x1965af['query'][_0x466f('0x55')]){_0x2f421f[_0x466f('0x53')]=_['merge'](_0x2f421f[_0x466f('0x53')],{'$or':_[_0x466f('0x42')](_0x2f421f[_0x466f('0x4c')],function(_0x363205){var _0x4cd97e={};_0x4cd97e[_0x363205]={'$like':'%'+_0x1965af[_0x466f('0x4b')][_0x466f('0x55')]+'%'};return _0x4cd97e;})});}_0x2f421f=_[_0x466f('0x56')]({},_0x2f421f,_0x1965af['options']);return _0xd9a648[_0x466f('0xb1')](_0x2f421f);}})[_0x466f('0x3d')](function(_0x15e737){if(_0x15e737){_0x29cb1d=_0x15e737[_0x466f('0x4e')];if(!_0x1965af[_0x466f('0x4b')]['hasOwnProperty'](_0x466f('0x50'))){_0x2f421f[_0x466f('0x32')]=qs[_0x466f('0x32')](_0x1965af[_0x466f('0x4b')][_0x466f('0x32')]);_0x2f421f[_0x466f('0x30')]=qs[_0x466f('0x30')](_0x1965af['query'][_0x466f('0x30')]);}return _0xd9a648['getApplications'](_0x2f421f);}})[_0x466f('0x3d')](function(_0x311f1b){if(_0x311f1b){return _0x311f1b?{'count':_0x29cb1d,'rows':_0x311f1b}:null;}})[_0x466f('0x3d')](respondWithResult(_0x2b1b8a,null))[_0x466f('0x2b')](handleError(_0x2b1b8a,null));};exports[_0x466f('0xb2')]=function(_0x31f01f,_0x543e89,_0x217e6d){var _0x3badf3={'raw':![],'where':{}};var _0x578bef={};var _0x1d31a4={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x31f01f[_0x466f('0x5d')]['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x543e89,null))[_0x466f('0x3d')](function(_0x5d6a36){if(_0x5d6a36){_0x578bef[_0x466f('0x48')]=_[_0x466f('0x49')](db[_0x466f('0x93')][_0x466f('0x44')]);_0x578bef[_0x466f('0x4b')]=_[_0x466f('0x49')](_0x31f01f['query']);_0x578bef[_0x466f('0x54')]=_[_0x466f('0x4a')](_0x578bef[_0x466f('0x48')],_0x578bef['query']);_0x3badf3[_0x466f('0x4c')]=_['intersection'](_0x578bef['model'],qs[_0x466f('0x4d')](_0x31f01f[_0x466f('0x4b')]['fields']));_0x3badf3['attributes']=_0x3badf3[_0x466f('0x4c')][_0x466f('0x4e')]?_0x3badf3[_0x466f('0x4c')]:_0x578bef[_0x466f('0x48')];if(!_0x31f01f[_0x466f('0x4b')]['hasOwnProperty'](_0x466f('0x50'))){_0x3badf3['limit']=qs[_0x466f('0x32')](_0x31f01f[_0x466f('0x4b')][_0x466f('0x32')]);_0x3badf3['offset']=qs[_0x466f('0x30')](_0x31f01f['query'][_0x466f('0x30')]);}_0x3badf3[_0x466f('0x51')]=qs[_0x466f('0x52')](_0x31f01f[_0x466f('0x4b')][_0x466f('0x52')]);_0x3badf3[_0x466f('0x53')]=qs[_0x466f('0x54')](_[_0x466f('0x6e')](_0x31f01f[_0x466f('0x4b')],_0x578bef[_0x466f('0x54')]));_0x3badf3['where']['OpenchannelAccountId']=_0x5d6a36['id'];if(_0x31f01f[_0x466f('0x4b')][_0x466f('0x55')]){_0x3badf3['where']=_[_0x466f('0x56')](_0x3badf3[_0x466f('0x53')],{'$or':_['map'](_0x3badf3[_0x466f('0x4c')],function(_0x208fda){var _0x446e8f={};_0x446e8f[_0x208fda]={'$like':'%'+_0x31f01f['query'][_0x466f('0x55')]+'%'};return _0x446e8f;})});}_0x3badf3=_['merge']({},_0x3badf3,_0x31f01f['options']);return db[_0x466f('0x93')]['count']({'where':_0x3badf3[_0x466f('0x53')]})[_0x466f('0x3d')](function(_0x8bf2e1){_0x1d31a4['count']=_0x8bf2e1;if(_0x31f01f[_0x466f('0x4b')][_0x466f('0x59')]){_0x3badf3[_0x466f('0x5a')]=[{'model':db['CmContact'],'as':_0x466f('0xb3'),'required':![]},{'model':db[_0x466f('0x9f')],'as':_0x466f('0xb4'),'attributes':[_0x466f('0x3e'),'fullname','internal'],'required':![]},{'model':db[_0x466f('0xb5')],'as':'Tags','attributes':['id',_0x466f('0x3e'),_0x466f('0xb6')],'where':_0x31f01f[_0x466f('0x4b')]['tag']?{'id':_0x31f01f[_0x466f('0x4b')][_0x466f('0xb7')]}:undefined,'required':_0x31f01f[_0x466f('0x4b')][_0x466f('0xb7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x466f('0x5b')](_0x3badf3);})[_0x466f('0x3d')](function(_0x2ef4c1){_0x1d31a4[_0x466f('0x5c')]=_0x2ef4c1;return _0x1d31a4;});}})[_0x466f('0x3d')](respondWithFilteredResult(_0x543e89,_0x3badf3))['catch'](handleError(_0x543e89,null));};exports['addAgents']=function(_0x220c03,_0x39bbe1,_0x16bb79){return db['OpenchannelAccount']['find']({'where':{'id':_0x220c03['params']['id']}})['then'](handleEntityNotFound(_0x39bbe1,null))[_0x466f('0x3d')](function(_0x57ad44){if(_0x57ad44){return _0x57ad44[_0x466f('0xb8')](_0x220c03['body'][_0x466f('0x70')],_[_0x466f('0xb9')](_0x220c03['body'],[_0x466f('0x70'),'id'])||{})[_0x466f('0x95')](function(_0x5d8c30){for(var _0x523597=0x0;_0x523597<_0x220c03[_0x466f('0x5f')][_0x466f('0x70')][_0x466f('0x4e')];_0x523597+=0x1){socket[_0x466f('0xba')]('userOpenchannelAccount:save',{'UserId':Number(_0x220c03[_0x466f('0x5f')][_0x466f('0x70')][_0x523597]),'OpenchannelAccountId':Number(_0x220c03['params']['id'])});}return _0x5d8c30;});}})['then'](respondWithResult(_0x39bbe1,null))[_0x466f('0x2b')](handleError(_0x39bbe1,null));};exports[_0x466f('0xbb')]=function(_0x75ff14,_0x5d04f3,_0x40553f){return db['OpenchannelAccount'][_0x466f('0x63')]({'where':{'id':_0x75ff14[_0x466f('0x5d')]['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x5d04f3,null))[_0x466f('0x3d')](function(_0x5291c5){if(_0x5291c5){return _0x5291c5[_0x466f('0xbb')](_0x75ff14[_0x466f('0x4b')][_0x466f('0x70')])[_0x466f('0x3d')](function(){if(_[_0x466f('0xbc')](_0x75ff14[_0x466f('0x4b')][_0x466f('0x70')])){for(var _0x3a02a6=0x0;_0x3a02a6<_0x75ff14['query'][_0x466f('0x70')]['length'];_0x3a02a6+=0x1){socket[_0x466f('0xba')]('userOpenchannelAccount:remove',{'UserId':Number(_0x75ff14[_0x466f('0x4b')][_0x466f('0x70')][_0x3a02a6]),'OpenchannelAccountId':Number(_0x75ff14['params']['id'])});}}else{socket[_0x466f('0xba')](_0x466f('0xbd'),{'UserId':Number(_0x75ff14[_0x466f('0x4b')][_0x466f('0x70')]),'OpenchannelAccountId':Number(_0x75ff14[_0x466f('0x5d')]['id'])});}});}})[_0x466f('0x3d')](respondWithStatusCode(_0x5d04f3,null))['catch'](handleError(_0x5d04f3,null));};exports[_0x466f('0xbe')]=function(_0x7c7249,_0xe88b4c,_0x584106){var _0x58611a={};var _0x45b45f={};var _0x32c841;var _0x668382;return db[_0x466f('0x43')][_0x466f('0x74')]({'where':{'id':_0x7c7249['params']['id']}})['then'](handleEntityNotFound(_0xe88b4c,null))[_0x466f('0x3d')](function(_0x24f49a){if(_0x24f49a){_0x32c841=_0x24f49a;_0x45b45f['model']=_['keys'](db['User'][_0x466f('0x44')]);_0x45b45f['query']=_['keys'](_0x7c7249[_0x466f('0x4b')]);_0x45b45f[_0x466f('0x54')]=_['intersection'](_0x45b45f['model'],_0x45b45f[_0x466f('0x4b')]);_0x58611a[_0x466f('0x4c')]=_[_0x466f('0x4a')](_0x45b45f['model'],qs['fields'](_0x7c7249['query']['fields']));_0x58611a[_0x466f('0x4c')]=_0x58611a['attributes'][_0x466f('0x4e')]?_0x58611a[_0x466f('0x4c')]:_0x45b45f[_0x466f('0x48')];_0x58611a[_0x466f('0x51')]=qs[_0x466f('0x52')](_0x7c7249[_0x466f('0x4b')]['sort']);_0x58611a['where']=qs[_0x466f('0x54')](_[_0x466f('0x6e')](_0x7c7249[_0x466f('0x4b')],_0x45b45f[_0x466f('0x54')]));if(_0x7c7249[_0x466f('0x4b')]['filter']){_0x58611a[_0x466f('0x53')]=_[_0x466f('0x56')](_0x58611a[_0x466f('0x53')],{'$or':_[_0x466f('0x42')](_0x58611a[_0x466f('0x4c')],function(_0x4c0262){var _0x309194={};_0x309194[_0x4c0262]={'$like':'%'+_0x7c7249[_0x466f('0x4b')][_0x466f('0x55')]+'%'};return _0x309194;})});}_0x58611a=_[_0x466f('0x56')]({},_0x58611a,_0x7c7249[_0x466f('0x58')]);return _0x32c841[_0x466f('0xbe')](_0x58611a);}})[_0x466f('0x3d')](function(_0x4dcf1f){if(_0x4dcf1f){_0x668382=_0x4dcf1f['length'];if(!_0x7c7249[_0x466f('0x4b')][_0x466f('0x4f')](_0x466f('0x50'))){_0x58611a['limit']=qs[_0x466f('0x32')](_0x7c7249[_0x466f('0x4b')][_0x466f('0x32')]);_0x58611a[_0x466f('0x30')]=qs[_0x466f('0x30')](_0x7c7249[_0x466f('0x4b')][_0x466f('0x30')]);}return _0x32c841[_0x466f('0xbe')](_0x58611a);}})[_0x466f('0x3d')](function(_0x24d39a){if(_0x24d39a){return _0x24d39a?{'count':_0x668382,'rows':_0x24d39a}:null;}})[_0x466f('0x3d')](respondWithResult(_0xe88b4c,null))[_0x466f('0x2b')](handleError(_0xe88b4c,null));};exports[_0x466f('0x3f')]=function(_0x33555f,_0x482370,_0x2be19f){var _0x3abaed,_0x5f578c,_0x4ded30;if(_['isNil'](_0x33555f['body'][_0x466f('0x5f')])||_0x33555f[_0x466f('0x5f')][_0x466f('0x5f')]===''){throw new db[(_0x466f('0x78'))][(_0x466f('0x79'))](_0x466f('0xbf'));}if(_[_0x466f('0x80')](_0x33555f[_0x466f('0x5f')]['to'])){}_0x3abaed=_0x33555f['body']['to'];return db[_0x466f('0x43')][_0x466f('0x74')]({'where':{'id':_0x33555f['params']['id']}})[_0x466f('0x3d')](handleEntityNotFound(_0x482370,null))[_0x466f('0x3d')](function(_0x135072){if(_0x135072){return db[_0x466f('0x43')][_0x466f('0x63')]({'where':{'id':_0x135072['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x466f('0x86'),'where':{[_0x135072[_0x466f('0x81')]]:_0x3abaed},'limit':0x1,'order':[[_0x466f('0x7c'),'DESC']]}]}]})[_0x466f('0x3d')](handleEntityNotFound(_0x482370,null))[_0x466f('0x3d')](function(_0x5f42de){if(_0x5f42de&&_0x5f42de['List']){_0x5f578c=_0x5f42de[_0x466f('0x39')]({'plain':!![]});if(_0x5f578c[_0x466f('0x85')]&&_0x5f578c[_0x466f('0x85')][_0x466f('0x86')][_0x466f('0x4e')]){return _0x5f578c[_0x466f('0x85')]['Contacts'][0x0];}return db['CmContact'][_0x466f('0x5e')](_['defaults'](_0x33555f['body'],{'firstName':_0x3abaed,[_0x5f42de[_0x466f('0x81')]]:_0x3abaed,'phone':_0x3abaed,'ListId':_0x5f578c[_0x466f('0x7d')]}));}})['then'](handleEntityNotFound(_0x482370,null))[_0x466f('0x3d')](function(_0x1e6d3a){if(_0x1e6d3a){_0x4ded30=_0x1e6d3a;return db[_0x466f('0x93')][_0x466f('0x63')]({'where':{'ContactId':_0x4ded30['id'],'closed':![],'OpenchannelAccountId':_0x5f578c['id']}})[_0x466f('0x3d')](function(_0x3fcaa5){if(_0x3fcaa5){return[_0x3fcaa5,![]];}return db[_0x466f('0x93')][_0x466f('0x5e')]({'UserId':_0x33555f['user']['id'],'ContactId':_0x4ded30['id'],'OpenchannelAccountId':_0x5f578c['id'],'lastMsgDirection':_0x466f('0xc0'),'firstMsgDirection':_0x466f('0xc0'),'Messages':[_[_0x466f('0x56')](_0x33555f[_0x466f('0x5f')],{'read':![],'body':_0x33555f[_0x466f('0x5f')][_0x466f('0x5f')],'OpenchannelAccountId':_0x5f578c['id'],'UserId':_0x33555f[_0x466f('0x60')]['id'],'ContactId':_0x4ded30['id']})]},{'include':[{'model':db[_0x466f('0x9c')],'as':_0x466f('0xc1')}]})[_0x466f('0x3d')](function(_0x3cd85f){return[_0x3cd85f,!![]];});});}})[_0x466f('0x95')](function(_0x38b966,_0x3d8a98){if(_0x3d8a98){return _0x38b966;}return db[_0x466f('0x9c')][_0x466f('0x5e')](_[_0x466f('0x56')](_0x33555f[_0x466f('0x5f')],{'read':![],'body':_0x33555f[_0x466f('0x5f')]['body'],'OpenchannelAccountId':_0x5f578c['id'],'OpenchannelInteractionId':_0x38b966['id'],'UserId':_0x33555f[_0x466f('0x60')]['id'],'ContactId':_0x4ded30['id']}))[_0x466f('0x3d')](function(_0x518d60){_0x38b966[_0x466f('0xc2')][_0x466f('0xc1')]=[];_0x38b966[_0x466f('0xc2')][_0x466f('0xc1')][_0x466f('0xc3')](_0x518d60[_0x466f('0xc2')]);return _0x38b966;});});}})[_0x466f('0x3d')](respondWithResult(_0x482370,null))[_0x466f('0x2b')](handleError(_0x482370,null));}; \ No newline at end of file +var _0x5adb=['stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','params','keys','rawAttributes','fields','options','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','list','applications','orderBy','priority','asc','account','contact','firstName','lastName','OpenchannelInteraction','threadId','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','agent','waitForTheAssignedAgent','OpenchannelQueue','queueId','unshift','waitForTheAssignedQueue','startRouting','EventManager','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Owner','fullname','Tag','Tags','color','tag','addAgents','ids','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','OpenchannelAccounts','UserProfileResource'];(function(_0x2c0c25,_0x5b0a19){var _0x2d8cf8=function(_0x5be48f){while(--_0x5be48f){_0x2c0c25['push'](_0x2c0c25['shift']());}};_0x2d8cf8(++_0x5b0a19);}(_0x5adb,0x84));var _0xb5ad=function(_0x39e02f,_0x2f4a3c){_0x39e02f=_0x39e02f-0x0;var _0x9cf183=_0x5adb[_0x39e02f];return _0x9cf183;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5ad('0x0'));var zipdir=require(_0xb5ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb5ad('0x2'));var moment=require('moment');var BPromise=require(_0xb5ad('0x3'));var Mustache=require(_0xb5ad('0x4'));var util=require(_0xb5ad('0x5'));var path=require('path');var sox=require(_0xb5ad('0x6'));var csv=require(_0xb5ad('0x7'));var ejs=require(_0xb5ad('0x8'));var fs=require('fs');var fs_extra=require(_0xb5ad('0x9'));var _=require('lodash');var squel=require(_0xb5ad('0xa'));var crypto=require(_0xb5ad('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb5ad('0xc'));var toCsv=require(_0xb5ad('0x7'));var querystring=require(_0xb5ad('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb5ad('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb5ad('0xf'));var hardwareService=require(_0xb5ad('0x10'));var logger=require(_0xb5ad('0x11'))(_0xb5ad('0x12'));var utils=require(_0xb5ad('0x13'));var config=require(_0xb5ad('0x14'));var licenseUtil=require(_0xb5ad('0x15'));var db=require('../../mysqldb')['db'];config[_0xb5ad('0x16')]=_[_0xb5ad('0x17')](config[_0xb5ad('0x16')],{'host':_0xb5ad('0x18'),'port':0x18eb});var socket=require(_0xb5ad('0x19'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xb5ad('0x1a'));var client=jayson[_0xb5ad('0x1b')][_0xb5ad('0x1c')]({'port':0x232c});var client9002=jayson[_0xb5ad('0x1b')][_0xb5ad('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x27fbaa,_0x271521,_0x313886,_0x2f13e0){return new BPromise(function(_0x4dfc93,_0xda94c9){var _0x3d37d5=_0x2f13e0||client;return _0x3d37d5[_0xb5ad('0x1d')](_0x27fbaa,_0x313886)['then'](function(_0x362350){logger[_0xb5ad('0x1e')](_0xb5ad('0x1f'),_0x271521,'request\x20sent');logger[_0xb5ad('0x20')](_0xb5ad('0x21'),_0x271521,_0xb5ad('0x22'),JSON[_0xb5ad('0x23')](_0x362350));if(_0x362350[_0xb5ad('0x24')]){if(_0x362350['error'][_0xb5ad('0x25')]===0x1f4){logger[_0xb5ad('0x24')](_0xb5ad('0x1f'),_0x271521,_0x362350[_0xb5ad('0x24')][_0xb5ad('0x26')]);return _0xda94c9(_0x362350[_0xb5ad('0x24')]['message']);}logger['error'](_0xb5ad('0x1f'),_0x271521,_0x362350['error'][_0xb5ad('0x26')]);return _0x4dfc93(_0x362350[_0xb5ad('0x24')][_0xb5ad('0x26')]);}else{logger[_0xb5ad('0x1e')](_0xb5ad('0x1f'),_0x271521,_0xb5ad('0x22'));_0x4dfc93(_0x362350[_0xb5ad('0x27')][_0xb5ad('0x26')]);}})[_0xb5ad('0x28')](function(_0x1dee94){logger[_0xb5ad('0x24')](_0xb5ad('0x1f'),_0x271521,_0x1dee94);_0xda94c9(_0x1dee94);});});}function respondWithStatusCode(_0x3df99f,_0x560215){_0x560215=_0x560215||0xcc;return function(_0x45723b){if(_0x45723b){return _0x3df99f[_0xb5ad('0x29')](_0x560215);}return _0x3df99f['status'](_0x560215)[_0xb5ad('0x2a')]();};}function respondWithResult(_0x5c1e4d,_0x288134){_0x288134=_0x288134||0xc8;return function(_0x3970aa){if(_0x3970aa){return _0x5c1e4d[_0xb5ad('0x2b')](_0x288134)[_0xb5ad('0x2c')](_0x3970aa);}};}function respondWithFilteredResult(_0x5c9829,_0x4bb505){return function(_0x2cdde4){if(_0x2cdde4){var _0x56d948=typeof _0x4bb505['offset']===_0xb5ad('0x2d')&&typeof _0x4bb505[_0xb5ad('0x2e')]===_0xb5ad('0x2d');var _0xef421f=_0x2cdde4[_0xb5ad('0x2f')];var _0x421d85=_0x56d948?0x0:_0x4bb505[_0xb5ad('0x30')];var _0x2a5fea=_0x56d948?_0x2cdde4[_0xb5ad('0x2f')]:_0x4bb505['offset']+_0x4bb505[_0xb5ad('0x2e')];var _0x1812cd;if(_0x2a5fea>=_0xef421f){_0x2a5fea=_0xef421f;_0x1812cd=0xc8;}else{_0x1812cd=0xce;}_0x5c9829['status'](_0x1812cd);return _0x5c9829['set'](_0xb5ad('0x31'),_0x421d85+'-'+_0x2a5fea+'/'+_0xef421f)[_0xb5ad('0x2c')](_0x2cdde4);}return null;};}function patchUpdates(_0x51cdcc){return function(_0x51bf08){try{jsonpatch[_0xb5ad('0x32')](_0x51bf08,_0x51cdcc,!![]);}catch(_0x57aeef){return BPromise[_0xb5ad('0x33')](_0x57aeef);}return _0x51bf08['save']();};}function saveUpdates(_0x8ba88e,_0x1d1e3d){return function(_0x1ef420){if(_0x1ef420){return _0x1ef420[_0xb5ad('0x34')](_0x8ba88e)[_0xb5ad('0x35')](function(_0x1fc1e5){return _0x1fc1e5;});}return null;};}function removeEntity(_0x25023a,_0x505ec8){return function(_0x12e0f8){if(_0x12e0f8){return _0x12e0f8[_0xb5ad('0x36')]()[_0xb5ad('0x35')](function(){var _0x4c31fc=_0x12e0f8[_0xb5ad('0x37')]({'plain':!![]});var _0xc983b=_0xb5ad('0x38');return db[_0xb5ad('0x39')][_0xb5ad('0x36')]({'where':{'type':_0xc983b,'resourceId':_0x4c31fc['id']}})[_0xb5ad('0x35')](function(){return _0x12e0f8;});})[_0xb5ad('0x35')](function(){_0x25023a[_0xb5ad('0x2b')](0xcc)[_0xb5ad('0x2a')]();});}};}function handleEntityNotFound(_0x3b4515,_0x39cb0f){return function(_0xbddf2e){if(!_0xbddf2e){_0x3b4515[_0xb5ad('0x29')](0x194);}return _0xbddf2e;};}function handleError(_0x292ba8,_0x4d68a6){_0x4d68a6=_0x4d68a6||0x1f4;return function(_0x147ef6){logger[_0xb5ad('0x24')](_0x147ef6[_0xb5ad('0x3a')]);if(_0x147ef6[_0xb5ad('0x3b')]){delete _0x147ef6['name'];}_0x292ba8[_0xb5ad('0x2b')](_0x4d68a6)[_0xb5ad('0x3c')](_0x147ef6);};}exports[_0xb5ad('0x3d')]=function(_0x362e13,_0x428e08){var _0x5bcca8={'include':[{'model':db[_0xb5ad('0x3e')],'as':_0xb5ad('0x3f')}]},_0xa33d87={},_0x13bb43={'count':0x0,'rows':[]};var _0x21cdb5=_[_0xb5ad('0x40')](db[_0xb5ad('0x41')]['rawAttributes'],function(_0x46fcf2){return{'name':_0x46fcf2['fieldName'],'type':_0x46fcf2['type'][_0xb5ad('0x42')]};});_0xa33d87['model']=_[_0xb5ad('0x40')](_0x21cdb5,_0xb5ad('0x3b'));_0xa33d87[_0xb5ad('0x43')]=_['keys'](_0x362e13[_0xb5ad('0x43')]);_0xa33d87[_0xb5ad('0x44')]=_[_0xb5ad('0x45')](_0xa33d87[_0xb5ad('0x46')],_0xa33d87[_0xb5ad('0x43')]);_0x5bcca8['attributes']=_['intersection'](_0xa33d87[_0xb5ad('0x46')],qs['fields'](_0x362e13[_0xb5ad('0x43')]['fields']));_0x5bcca8['attributes']=_0x5bcca8[_0xb5ad('0x47')][_0xb5ad('0x48')]?_0x5bcca8[_0xb5ad('0x47')]:_0xa33d87[_0xb5ad('0x46')];if(!_0x362e13[_0xb5ad('0x43')][_0xb5ad('0x49')](_0xb5ad('0x4a'))){_0x5bcca8[_0xb5ad('0x2e')]=qs[_0xb5ad('0x2e')](_0x362e13['query'][_0xb5ad('0x2e')]);_0x5bcca8[_0xb5ad('0x30')]=qs[_0xb5ad('0x30')](_0x362e13[_0xb5ad('0x43')]['offset']);}_0x5bcca8[_0xb5ad('0x4b')]=qs[_0xb5ad('0x4c')](_0x362e13[_0xb5ad('0x43')][_0xb5ad('0x4c')]);_0x5bcca8[_0xb5ad('0x4d')]=qs[_0xb5ad('0x44')](_[_0xb5ad('0x4e')](_0x362e13[_0xb5ad('0x43')],_0xa33d87[_0xb5ad('0x44')]),_0x21cdb5);if(_0x362e13['query']['filter']){_0x5bcca8['where']=_[_0xb5ad('0x4f')](_0x5bcca8[_0xb5ad('0x4d')],{'$or':_['map'](_0x21cdb5,function(_0x322b16){if(_0x322b16[_0xb5ad('0x50')]!==_0xb5ad('0x51')){var _0xd8d39a={};_0xd8d39a[_0x322b16['name']]={'$like':'%'+_0x362e13[_0xb5ad('0x43')][_0xb5ad('0x52')]+'%'};return _0xd8d39a;}})});}_0x5bcca8=_[_0xb5ad('0x4f')]({},_0x5bcca8,_0x362e13['options']);var _0x33327e={'where':_0x5bcca8[_0xb5ad('0x4d')]};return db[_0xb5ad('0x41')]['count'](_0x33327e)[_0xb5ad('0x35')](function(_0x19ee8d){_0x13bb43[_0xb5ad('0x2f')]=_0x19ee8d;if(_0x362e13[_0xb5ad('0x43')][_0xb5ad('0x53')]){_0x5bcca8[_0xb5ad('0x54')]=[{'all':!![]}];}return db[_0xb5ad('0x41')][_0xb5ad('0x55')](_0x5bcca8);})['then'](function(_0x34526c){_0x13bb43[_0xb5ad('0x56')]=_0x34526c;return _0x13bb43;})['then'](respondWithFilteredResult(_0x428e08,_0x5bcca8))[_0xb5ad('0x28')](handleError(_0x428e08,null));};exports['show']=function(_0xbd67d3,_0x1aac6b){var _0x3b89d6={'raw':![],'where':{'id':_0xbd67d3[_0xb5ad('0x57')]['id']},'include':[{'model':db[_0xb5ad('0x3e')],'as':_0xb5ad('0x3f')}]},_0x3d2d82={};_0x3d2d82[_0xb5ad('0x46')]=_[_0xb5ad('0x58')](db['OpenchannelAccount'][_0xb5ad('0x59')]);_0x3d2d82[_0xb5ad('0x43')]=_[_0xb5ad('0x58')](_0xbd67d3[_0xb5ad('0x43')]);_0x3d2d82['filters']=_['intersection'](_0x3d2d82[_0xb5ad('0x46')],_0x3d2d82['query']);_0x3b89d6['attributes']=_[_0xb5ad('0x45')](_0x3d2d82[_0xb5ad('0x46')],qs['fields'](_0xbd67d3['query'][_0xb5ad('0x5a')]));_0x3b89d6[_0xb5ad('0x47')]=_0x3b89d6[_0xb5ad('0x47')][_0xb5ad('0x48')]?_0x3b89d6['attributes']:_0x3d2d82[_0xb5ad('0x46')];if(_0xbd67d3[_0xb5ad('0x43')][_0xb5ad('0x53')]){_0x3b89d6[_0xb5ad('0x54')]=[{'all':!![]}];}_0x3b89d6=_[_0xb5ad('0x4f')]({},_0x3b89d6,_0xbd67d3[_0xb5ad('0x5b')]);return db[_0xb5ad('0x41')][_0xb5ad('0x5c')](_0x3b89d6)[_0xb5ad('0x35')](handleEntityNotFound(_0x1aac6b,null))[_0xb5ad('0x35')](respondWithResult(_0x1aac6b,null))['catch'](handleError(_0x1aac6b,null));};exports['create']=function(_0x39ce8b,_0x41cc79){return db[_0xb5ad('0x41')][_0xb5ad('0x5d')](_0x39ce8b[_0xb5ad('0x5e')],{})[_0xb5ad('0x35')](function(_0x18d439){var _0x367108=_0x39ce8b['user'][_0xb5ad('0x37')]({'plain':!![]});if(!_0x367108)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x367108[_0xb5ad('0x5f')]===_0xb5ad('0x60')){var _0x2fa8fd=_0x18d439[_0xb5ad('0x37')]({'plain':!![]});var _0x393630=_0xb5ad('0x38');return db[_0xb5ad('0x61')][_0xb5ad('0x5c')]({'where':{'name':_0x393630,'userProfileId':_0x367108[_0xb5ad('0x62')]},'raw':!![]})[_0xb5ad('0x35')](function(_0x334f1d){if(_0x334f1d&&_0x334f1d['autoAssociation']===0x0){return db[_0xb5ad('0x39')][_0xb5ad('0x5d')]({'name':_0x2fa8fd[_0xb5ad('0x3b')],'resourceId':_0x2fa8fd['id'],'type':_0x334f1d[_0xb5ad('0x3b')],'sectionId':_0x334f1d['id']},{})[_0xb5ad('0x35')](function(){return _0x18d439;});}else{return _0x18d439;}})['catch'](function(_0x49b957){logger[_0xb5ad('0x24')](_0xb5ad('0x63'),_0x49b957);throw _0x49b957;});}return _0x18d439;})[_0xb5ad('0x35')](respondWithResult(_0x41cc79,0xc9))[_0xb5ad('0x28')](handleError(_0x41cc79,null));};exports[_0xb5ad('0x34')]=function(_0x1f17ca,_0x1ddd35){if(_0x1f17ca[_0xb5ad('0x5e')]['id']){delete _0x1f17ca[_0xb5ad('0x5e')]['id'];}return db[_0xb5ad('0x41')][_0xb5ad('0x5c')]({'where':{'id':_0x1f17ca[_0xb5ad('0x57')]['id']},'include':[{'model':db[_0xb5ad('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xb5ad('0x35')](handleEntityNotFound(_0x1ddd35,null))[_0xb5ad('0x35')](saveUpdates(_0x1f17ca['body'],null))[_0xb5ad('0x35')](respondWithResult(_0x1ddd35,null))[_0xb5ad('0x28')](handleError(_0x1ddd35,null));};exports[_0xb5ad('0x36')]=function(_0x485477,_0x3856ae){return db[_0xb5ad('0x41')]['find']({'where':{'id':_0x485477[_0xb5ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x3856ae,null))[_0xb5ad('0x35')](removeEntity(_0x3856ae,null))['catch'](handleError(_0x3856ae,null));};exports[_0xb5ad('0x64')]=function(_0x362559,_0x34f35c){return db['OpenchannelAccount'][_0xb5ad('0x64')]()[_0xb5ad('0x35')](respondWithResult(_0x34f35c,null))['catch'](handleError(_0x34f35c,null));};exports[_0xb5ad('0x65')]=function(_0x426843,_0x55305e,_0x36b7e0){if(_0x426843[_0xb5ad('0x5e')]['id']){delete _0x426843[_0xb5ad('0x5e')]['id'];}return db['OpenchannelAccount'][_0xb5ad('0x5c')]({'where':{'id':_0x426843[_0xb5ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x55305e,null))[_0xb5ad('0x35')](function(_0x3f8ff5){if(_0x3f8ff5){_0x426843[_0xb5ad('0x5e')][_0xb5ad('0x66')]=_0x3f8ff5['id'];return db[_0xb5ad('0x67')][_0xb5ad('0x5d')](_0x426843[_0xb5ad('0x5e')]);}})[_0xb5ad('0x35')](respondWithResult(_0x55305e,null))['catch'](handleError(_0x55305e,null));};exports[_0xb5ad('0x68')]=function(_0x2d12e5,_0xee9f40,_0x41a6c0){var _0x8848f6={'raw':![],'where':{}};var _0x535b82={};var _0x4ec8d3={'count':0x0,'rows':[]};return db[_0xb5ad('0x41')][_0xb5ad('0x69')]({'where':{'id':_0x2d12e5['params']['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0xee9f40,null))[_0xb5ad('0x35')](function(_0x16155d){if(_0x16155d){_0x535b82[_0xb5ad('0x46')]=_[_0xb5ad('0x58')](db[_0xb5ad('0x67')]['rawAttributes']);_0x535b82[_0xb5ad('0x43')]=_[_0xb5ad('0x58')](_0x2d12e5[_0xb5ad('0x43')]);_0x535b82[_0xb5ad('0x44')]=_['intersection'](_0x535b82[_0xb5ad('0x46')],_0x535b82[_0xb5ad('0x43')]);_0x8848f6[_0xb5ad('0x47')]=_[_0xb5ad('0x45')](_0x535b82[_0xb5ad('0x46')],qs[_0xb5ad('0x5a')](_0x2d12e5[_0xb5ad('0x43')][_0xb5ad('0x5a')]));_0x8848f6['attributes']=_0x8848f6[_0xb5ad('0x47')]['length']?_0x8848f6[_0xb5ad('0x47')]:_0x535b82['model'];if(!_0x2d12e5['query']['hasOwnProperty'](_0xb5ad('0x4a'))){_0x8848f6[_0xb5ad('0x2e')]=qs[_0xb5ad('0x2e')](_0x2d12e5['query'][_0xb5ad('0x2e')]);_0x8848f6[_0xb5ad('0x30')]=qs[_0xb5ad('0x30')](_0x2d12e5[_0xb5ad('0x43')]['offset']);}_0x8848f6[_0xb5ad('0x4b')]=qs['sort'](_0x2d12e5[_0xb5ad('0x43')]['sort']);_0x8848f6['where']=qs[_0xb5ad('0x44')](_['pick'](_0x2d12e5[_0xb5ad('0x43')],_0x535b82[_0xb5ad('0x44')]));_0x8848f6['where'][_0xb5ad('0x66')]=_0x16155d['id'];if(_0x2d12e5[_0xb5ad('0x43')][_0xb5ad('0x52')]){_0x8848f6[_0xb5ad('0x4d')]=_['merge'](_0x8848f6[_0xb5ad('0x4d')],{'$or':_[_0xb5ad('0x40')](_0x8848f6[_0xb5ad('0x47')],function(_0x451876){var _0x1fa095={};_0x1fa095[_0x451876]={'$like':'%'+_0x2d12e5[_0xb5ad('0x43')][_0xb5ad('0x52')]+'%'};return _0x1fa095;})});}_0x8848f6=_[_0xb5ad('0x4f')]({},_0x8848f6,_0x2d12e5[_0xb5ad('0x5b')]);return db[_0xb5ad('0x67')][_0xb5ad('0x2f')]({'where':_0x8848f6['where']})[_0xb5ad('0x35')](function(_0x4182af){_0x4ec8d3[_0xb5ad('0x2f')]=_0x4182af;if(_0x2d12e5[_0xb5ad('0x43')][_0xb5ad('0x53')]){_0x8848f6[_0xb5ad('0x54')]=[{'all':!![]}];}return db[_0xb5ad('0x67')]['findAll'](_0x8848f6);})[_0xb5ad('0x35')](function(_0x58267d){_0x4ec8d3['rows']=_0x58267d;return _0x4ec8d3;});}})['then'](respondWithFilteredResult(_0xee9f40,_0x8848f6))[_0xb5ad('0x28')](handleError(_0xee9f40,null));};exports[_0xb5ad('0x6a')]=function(_0x152e56,_0xe20310,_0x24a48e){return db[_0xb5ad('0x41')][_0xb5ad('0x5c')]({'where':{'id':_0x152e56[_0xb5ad('0x57')]['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0xe20310,null))['then'](function(_0xa67503){if(_0xa67503){return _0xa67503[_0xb5ad('0x6a')](_0x152e56[_0xb5ad('0x43')]['ids']);}})['then'](respondWithStatusCode(_0xe20310,null))[_0xb5ad('0x28')](handleError(_0xe20310,null));};exports[_0xb5ad('0x6b')]=function(_0x23f026,_0x2871b4,_0x1c0c75){if(_0x23f026[_0xb5ad('0x5e')]['id']){delete _0x23f026[_0xb5ad('0x5e')]['id'];}return db[_0xb5ad('0x41')][_0xb5ad('0x5c')]({'where':{'id':_0x23f026[_0xb5ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x2871b4,null))[_0xb5ad('0x35')](function(_0x4b3a0f){if(_0x4b3a0f){_0x23f026[_0xb5ad('0x5e')][_0xb5ad('0x66')]=_0x4b3a0f['id'];return db['CannedAnswer'][_0xb5ad('0x5d')](_0x23f026[_0xb5ad('0x5e')]);}})[_0xb5ad('0x35')](respondWithResult(_0x2871b4,null))[_0xb5ad('0x28')](handleError(_0x2871b4,null));};exports[_0xb5ad('0x6c')]=function(_0x5d8e70,_0x5e0694,_0x611511){var _0x361833={'raw':![],'where':{}};var _0x2a5ea9={};var _0x1c5494={'count':0x0,'rows':[]};return db[_0xb5ad('0x41')][_0xb5ad('0x69')]({'where':{'id':_0x5d8e70[_0xb5ad('0x57')]['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0x5e0694,null))[_0xb5ad('0x35')](function(_0x1c3772){if(_0x1c3772){_0x2a5ea9[_0xb5ad('0x46')]=_[_0xb5ad('0x58')](db[_0xb5ad('0x6d')][_0xb5ad('0x59')]);_0x2a5ea9['query']=_['keys'](_0x5d8e70[_0xb5ad('0x43')]);_0x2a5ea9['filters']=_[_0xb5ad('0x45')](_0x2a5ea9[_0xb5ad('0x46')],_0x2a5ea9[_0xb5ad('0x43')]);_0x361833[_0xb5ad('0x47')]=_[_0xb5ad('0x45')](_0x2a5ea9[_0xb5ad('0x46')],qs[_0xb5ad('0x5a')](_0x5d8e70['query'][_0xb5ad('0x5a')]));_0x361833[_0xb5ad('0x47')]=_0x361833[_0xb5ad('0x47')][_0xb5ad('0x48')]?_0x361833[_0xb5ad('0x47')]:_0x2a5ea9[_0xb5ad('0x46')];if(!_0x5d8e70[_0xb5ad('0x43')][_0xb5ad('0x49')]('nolimit')){_0x361833[_0xb5ad('0x2e')]=qs[_0xb5ad('0x2e')](_0x5d8e70['query']['limit']);_0x361833['offset']=qs[_0xb5ad('0x30')](_0x5d8e70[_0xb5ad('0x43')][_0xb5ad('0x30')]);}_0x361833[_0xb5ad('0x4b')]=qs['sort'](_0x5d8e70[_0xb5ad('0x43')][_0xb5ad('0x4c')]);_0x361833[_0xb5ad('0x4d')]=qs[_0xb5ad('0x44')](_[_0xb5ad('0x4e')](_0x5d8e70['query'],_0x2a5ea9[_0xb5ad('0x44')]));_0x361833[_0xb5ad('0x4d')]['OpenchannelAccountId']=_0x1c3772['id'];if(_0x5d8e70[_0xb5ad('0x43')][_0xb5ad('0x52')]){_0x361833[_0xb5ad('0x4d')]=_['merge'](_0x361833[_0xb5ad('0x4d')],{'$or':_['map'](_0x361833[_0xb5ad('0x47')],function(_0x472417){var _0x2f8dec={};_0x2f8dec[_0x472417]={'$like':'%'+_0x5d8e70[_0xb5ad('0x43')]['filter']+'%'};return _0x2f8dec;})});}_0x361833=_[_0xb5ad('0x4f')]({},_0x361833,_0x5d8e70[_0xb5ad('0x5b')]);return db[_0xb5ad('0x6d')][_0xb5ad('0x2f')]({'where':_0x361833[_0xb5ad('0x4d')]})[_0xb5ad('0x35')](function(_0x3ff97e){_0x1c5494[_0xb5ad('0x2f')]=_0x3ff97e;if(_0x5d8e70[_0xb5ad('0x43')][_0xb5ad('0x53')]){_0x361833[_0xb5ad('0x54')]=[{'all':!![]}];}return db[_0xb5ad('0x6d')]['findAll'](_0x361833);})['then'](function(_0x1550db){_0x1c5494[_0xb5ad('0x56')]=_0x1550db;return _0x1c5494;});}})[_0xb5ad('0x35')](respondWithFilteredResult(_0x5e0694,_0x361833))[_0xb5ad('0x28')](handleError(_0x5e0694,null));};exports['removeAnswers']=function(_0x42e46a,_0x3979c8,_0x271fec){return db[_0xb5ad('0x41')][_0xb5ad('0x5c')]({'where':{'id':_0x42e46a[_0xb5ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x3979c8,null))['then'](function(_0x2ced58){if(_0x2ced58){return _0x2ced58[_0xb5ad('0x6e')](_0x42e46a[_0xb5ad('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x3979c8,null))[_0xb5ad('0x28')](handleError(_0x3979c8,null));};exports[_0xb5ad('0x6f')]=function(_0x23df6c,_0x1330c8,_0x23f632){var _0x7e352c={'body':_0x23df6c[_0xb5ad('0x5e')],'channel':'openchannel'};var _0x1dfaca=[];var _0x15c2e7=[];var _0x3d1416={};var _0x4de484=![];return db[_0xb5ad('0x70')][_0xb5ad('0x64')]()[_0xb5ad('0x35')](function(_0x21711b){if(!_0x21711b){throw new db[(_0xb5ad('0x71'))]['ValidationError'](_0xb5ad('0x72'));}_0x1dfaca=_[_0xb5ad('0x73')](_[_0xb5ad('0x58')](_0x21711b),[_0xb5ad('0x74'),'updatedAt']);_0x15c2e7=_[_0xb5ad('0x73')](_[_0xb5ad('0x58')](_0x21711b),['createdAt',_0xb5ad('0x75'),_0xb5ad('0x76'),_0xb5ad('0x77')]);if(_0x23df6c['body']['id']){delete _0x23df6c['body']['id'];}if(_[_0xb5ad('0x78')](_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x79')])){throw new db[(_0xb5ad('0x71'))][(_0xb5ad('0x7a'))](_0xb5ad('0x7b'));}if(_[_0xb5ad('0x78')](_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x5e')])||_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x5e')]===''){throw new db['Sequelize'][(_0xb5ad('0x7a'))](_0xb5ad('0x7c'));}if(_[_0xb5ad('0x78')](_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x7d')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x15c2e7);}if(!_[_0xb5ad('0x7e')](_0x15c2e7,_0x23df6c[_0xb5ad('0x5e')]['mapKey'])){throw new db[(_0xb5ad('0x71'))][(_0xb5ad('0x7a'))](_0xb5ad('0x7f')+_0x15c2e7);}_0x3d1416[_0x23df6c[_0xb5ad('0x5e')]['mapKey']]=_0x23df6c[_0xb5ad('0x5e')]['from'];})['then'](function(){return db[_0xb5ad('0x41')]['find']({'where':{'id':_0x23df6c['params']['id']},'include':[{'model':db[_0xb5ad('0x80')],'as':_0xb5ad('0x81'),'include':[{'model':db[_0xb5ad('0x70')],'as':_0xb5ad('0x82'),'where':_0x3d1416,'limit':0x1,'order':[[_0xb5ad('0x75'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xb5ad('0x83')}]});})[_0xb5ad('0x35')](handleEntityNotFound(_0x1330c8,null))[_0xb5ad('0x35')](function(_0x31ff12){if(_0x31ff12&&_0x31ff12[_0xb5ad('0x81')]){_0x7e352c['account']=_0x31ff12;_0x7e352c['applications']=_0x31ff12[_0xb5ad('0x83')];_0x7e352c[_0xb5ad('0x84')]=_0x31ff12[_0xb5ad('0x81')];_0x7e352c[_0xb5ad('0x85')]=_[_0xb5ad('0x86')](_0x7e352c[_0xb5ad('0x85')],[_0xb5ad('0x87')],[_0xb5ad('0x88')]);if(_0x7e352c['account']['Applications']){delete _0x7e352c[_0xb5ad('0x89')]['Applications'];}if(_0x7e352c['account']['List']&&_0x7e352c[_0xb5ad('0x89')][_0xb5ad('0x81')][_0xb5ad('0x82')]['length']){return _0x7e352c[_0xb5ad('0x89')]['List'][_0xb5ad('0x82')][0x0];}var _0x3dee29=_['defaults'](_0x23df6c[_0xb5ad('0x5e')],{'firstName':_0x23df6c['body'][_0xb5ad('0x79')],'ListId':_0x31ff12[_0xb5ad('0x77')]});_0x3dee29[_0x23df6c['body'][_0xb5ad('0x7d')]]=_0x23df6c['body'][_0xb5ad('0x79')];return db['CmContact']['create'](_0x3dee29,{'fields':_0x1dfaca,'raw':!![]});}})[_0xb5ad('0x35')](handleEntityNotFound(_0x1330c8,null))[_0xb5ad('0x35')](function(_0x43a1d7){_0x7e352c[_0xb5ad('0x8a')]=_0x43a1d7;if(_0x43a1d7){var _0x31da3b={'ContactId':_0x43a1d7['id'],'OpenchannelAccountId':_0x23df6c['params']['id'],'from':(_0x43a1d7[_0xb5ad('0x8b')]||'')+'\x20'+(_0x43a1d7[_0xb5ad('0x8c')]||'')};var _0x894d26={'OpenchannelAccountId':_0x23df6c['params']['id'],'closed':![]};if(_0x23df6c['body']['threadId']){_0x894d26['threadId']=_0x23df6c[_0xb5ad('0x5e')]['threadId'];return db[_0xb5ad('0x8d')]['find']({'where':_0x894d26})['then'](function(_0x1638ff){if(_0x1638ff){return[_0x1638ff,![]];}_0x31da3b[_0xb5ad('0x8e')]=_0x23df6c[_0xb5ad('0x5e')]['threadId'];_0x31da3b[_0xb5ad('0x8f')]=_0x23df6c['body']['externalUrl'];return db[_0xb5ad('0x8d')]['create'](_0x31da3b)['then'](function(_0x530525){return[_0x530525,!![]];});});}else{_0x894d26[_0xb5ad('0x8e')]=null;}_0x894d26[_0xb5ad('0x90')]=_0x43a1d7['id'];return db[_0xb5ad('0x8d')][_0xb5ad('0x5c')]({'where':_0x894d26})[_0xb5ad('0x35')](function(_0x56da75){if(_0x56da75){return[_0x56da75,![]];}return db[_0xb5ad('0x8d')]['create'](_0x31da3b)[_0xb5ad('0x35')](function(_0x3b7811){return[_0x3b7811,!![]];});});}})[_0xb5ad('0x91')](function(_0x543734,_0x43dede){if(_0x543734){_0x4de484=_0x43dede;if(!_0x43dede){var _0x3d2bc5={'from':(_0x7e352c[_0xb5ad('0x8a')][_0xb5ad('0x8b')]||'')+'\x20'+(_0x7e352c[_0xb5ad('0x8a')][_0xb5ad('0x8c')]||'')};if(_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x8e')]&&_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x92')]&&_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x8e')]!=_0x23df6c[_0xb5ad('0x5e')]['messageId']){_0x3d2bc5[_0xb5ad('0x8e')]=_0x23df6c['body']['messageId'];}return _0x543734['update'](_0x3d2bc5);}else{return _0x543734;}}})[_0xb5ad('0x35')](function(_0x1db936){_0x7e352c[_0xb5ad('0x93')]=_0x1db936['get']({'plain':!![]});_0x7e352c[_0xb5ad('0x93')]['created']=_0x4de484;if(_0x7e352c['interaction'][_0xb5ad('0x94')]){if(_0x7e352c[_0xb5ad('0x89')]['autoclose']){_0x7e352c[_0xb5ad('0x85')][_0xb5ad('0x95')]({'id':0x0,'priority':_0x7e352c[_0xb5ad('0x85')][_0xb5ad('0x48')]+0x1,'app':_0xb5ad('0x96'),'appdata':_0xb5ad('0x97'),'interval':_0xb5ad('0x98')});}}return db[_0xb5ad('0x99')]['create']({'body':_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x5e')],'OpenchannelAccountId':_0x23df6c[_0xb5ad('0x57')]['id'],'OpenchannelInteractionId':_0x1db936['id'],'direction':'in','ContactId':_0x7e352c[_0xb5ad('0x8a')]['id'],'AttachmentId':_0x23df6c[_0xb5ad('0x5e')][_0xb5ad('0x9a')]});})[_0xb5ad('0x35')](function(_0x3dcce2){_0x7e352c[_0xb5ad('0x26')]=_0x3dcce2;if(!_0x7e352c[_0xb5ad('0x93')]['UserId'])return;return db[_0xb5ad('0x9b')][_0xb5ad('0x5c')]({'attributes':['id','name'],'where':{'id':_0x7e352c[_0xb5ad('0x93')]['UserId']}});})['then'](function(_0x520d1c){if(_0x520d1c){_0x7e352c['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xb5ad('0x9c'),'appdata':_0x520d1c[_0xb5ad('0x3b')]+','+(_0x7e352c[_0xb5ad('0x89')][_0xb5ad('0x9d')]||0xa),'interval':_0xb5ad('0x98')});}if(!_0x7e352c[_0xb5ad('0x93')]['queueId'])return;return db[_0xb5ad('0x9e')][_0xb5ad('0x5c')]({'attributes':['id','name'],'where':{'id':_0x7e352c['interaction'][_0xb5ad('0x9f')]}});})[_0xb5ad('0x35')](function(_0x1f314a){if(_0x1f314a){_0x7e352c[_0xb5ad('0x85')][_0xb5ad('0xa0')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1f314a[_0xb5ad('0x3b')]+','+(_0x7e352c[_0xb5ad('0x89')][_0xb5ad('0xa1')]||0x12c),'interval':_0xb5ad('0x98')});}return respondWithRpcPromise('Start',_0xb5ad('0xa2'),_0x7e352c);})['then'](function(_0x564659){respondWithRpcPromise('EventManager',_0xb5ad('0xa3'),{'event':'notify','message':_0x564659},client9002);return _0x564659;})[_0xb5ad('0x35')](respondWithResult(_0x1330c8,null))[_0xb5ad('0x28')](handleError(_0x1330c8,null));};exports[_0xb5ad('0xa4')]=function(_0xfb8134,_0xb02340){var _0x2d0af0=_0xfb8134[_0xb5ad('0x57')]['id'];var _0x376531=_0xfb8134[_0xb5ad('0x5e')];var _0x51a715=0xc8;var _0x49b883=null;return db['sequelize'][_0xb5ad('0xa5')]({'isolationLevel':db[_0xb5ad('0xa6')]['Transaction'][_0xb5ad('0xa7')][_0xb5ad('0xa8')]},function(_0x52b355){return db[_0xb5ad('0x41')][_0xb5ad('0x69')]({'where':{'id':_0x2d0af0},'transaction':_0x52b355})[_0xb5ad('0x35')](function(_0x51a1a5){if(_0x51a1a5){return db['OpenchannelApplication'][_0xb5ad('0x36')]({'where':{'OpenchannelAccountId':_0x2d0af0},'transaction':_0x52b355})[_0xb5ad('0x35')](function(){var _0x17643e=_[_0xb5ad('0x40')](_0x376531,function(_0x14ea64){_0x14ea64[_0xb5ad('0x66')]=_0x2d0af0;return _0x14ea64;});return db[_0xb5ad('0xa9')]['bulkCreate'](_0x17643e,{'transaction':_0x52b355});});}else{_0x51a715=0x194;_0x49b883=[];}});})[_0xb5ad('0x35')](function(){if(_0x51a715!==0x194){return db[_0xb5ad('0xa9')][_0xb5ad('0xaa')]({'where':{'OpenchannelAccountId':_0x2d0af0},'order':'priority'})[_0xb5ad('0x35')](function(_0xedbf6){_0x49b883=_0xedbf6;});}})[_0xb5ad('0x28')](function(_0x40bdec){_0x51a715=0x1f4;logger['error'](_0x40bdec[_0xb5ad('0x3a')]);if(_0x40bdec[_0xb5ad('0x3b')]){delete _0x40bdec[_0xb5ad('0x3b')];}_0x49b883=_0x40bdec;})['finally'](function(){if(_0x49b883===null){_0xb02340[_0xb5ad('0x29')](_0x51a715);}else{if(_0x51a715===0x1f4){_0xb02340['status'](_0x51a715)[_0xb5ad('0x3c')](_0x49b883);}else{_0xb02340[_0xb5ad('0x2b')](_0x51a715)['json'](_0x49b883);}}});};exports['getApplications']=function(_0x51c82a,_0x30b84b,_0x27f2be){var _0x18c7ee={};var _0x2ec5b8={};var _0x5c8850;var _0xcc4890;return db[_0xb5ad('0x41')][_0xb5ad('0x69')]({'where':{'id':_0x51c82a['params']['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0x30b84b,null))[_0xb5ad('0x35')](function(_0x25cee9){if(_0x25cee9){_0x5c8850=_0x25cee9;_0x2ec5b8[_0xb5ad('0x46')]=_['keys'](db[_0xb5ad('0xa9')][_0xb5ad('0x59')]);_0x2ec5b8['query']=_[_0xb5ad('0x58')](_0x51c82a[_0xb5ad('0x43')]);_0x2ec5b8[_0xb5ad('0x44')]=_[_0xb5ad('0x45')](_0x2ec5b8['model'],_0x2ec5b8[_0xb5ad('0x43')]);_0x18c7ee[_0xb5ad('0x47')]=_[_0xb5ad('0x45')](_0x2ec5b8[_0xb5ad('0x46')],qs[_0xb5ad('0x5a')](_0x51c82a[_0xb5ad('0x43')][_0xb5ad('0x5a')]));_0x18c7ee[_0xb5ad('0x47')]=_0x18c7ee[_0xb5ad('0x47')][_0xb5ad('0x48')]?_0x18c7ee[_0xb5ad('0x47')]:_0x2ec5b8[_0xb5ad('0x46')];_0x18c7ee[_0xb5ad('0x4b')]=qs[_0xb5ad('0x4c')](_0x51c82a[_0xb5ad('0x43')]['sort']);_0x18c7ee['where']=qs[_0xb5ad('0x44')](_['pick'](_0x51c82a[_0xb5ad('0x43')],_0x2ec5b8['filters']));if(_0x51c82a[_0xb5ad('0x43')][_0xb5ad('0x52')]){_0x18c7ee[_0xb5ad('0x4d')]=_[_0xb5ad('0x4f')](_0x18c7ee[_0xb5ad('0x4d')],{'$or':_[_0xb5ad('0x40')](_0x18c7ee[_0xb5ad('0x47')],function(_0x4a4396){var _0x447fe7={};_0x447fe7[_0x4a4396]={'$like':'%'+_0x51c82a[_0xb5ad('0x43')][_0xb5ad('0x52')]+'%'};return _0x447fe7;})});}_0x18c7ee=_[_0xb5ad('0x4f')]({},_0x18c7ee,_0x51c82a[_0xb5ad('0x5b')]);return _0x5c8850[_0xb5ad('0xab')](_0x18c7ee);}})[_0xb5ad('0x35')](function(_0x31c317){if(_0x31c317){_0xcc4890=_0x31c317[_0xb5ad('0x48')];if(!_0x51c82a[_0xb5ad('0x43')]['hasOwnProperty'](_0xb5ad('0x4a'))){_0x18c7ee[_0xb5ad('0x2e')]=qs[_0xb5ad('0x2e')](_0x51c82a[_0xb5ad('0x43')][_0xb5ad('0x2e')]);_0x18c7ee['offset']=qs[_0xb5ad('0x30')](_0x51c82a['query'][_0xb5ad('0x30')]);}return _0x5c8850[_0xb5ad('0xab')](_0x18c7ee);}})[_0xb5ad('0x35')](function(_0x4b9404){if(_0x4b9404){return _0x4b9404?{'count':_0xcc4890,'rows':_0x4b9404}:null;}})[_0xb5ad('0x35')](respondWithResult(_0x30b84b,null))[_0xb5ad('0x28')](handleError(_0x30b84b,null));};exports[_0xb5ad('0xac')]=function(_0x4fa1fd,_0x14662a,_0x4c54cb){var _0x4c3ffb={'raw':![],'where':{}};var _0x59b116={};var _0x2a3ffe={'count':0x0,'rows':[]};return db[_0xb5ad('0x41')][_0xb5ad('0x69')]({'where':{'id':_0x4fa1fd[_0xb5ad('0x57')]['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0x14662a,null))[_0xb5ad('0x35')](function(_0x482672){if(_0x482672){_0x59b116[_0xb5ad('0x46')]=_[_0xb5ad('0x58')](db['OpenchannelInteraction']['rawAttributes']);_0x59b116[_0xb5ad('0x43')]=_['keys'](_0x4fa1fd[_0xb5ad('0x43')]);_0x59b116['filters']=_[_0xb5ad('0x45')](_0x59b116['model'],_0x59b116['query']);_0x4c3ffb[_0xb5ad('0x47')]=_[_0xb5ad('0x45')](_0x59b116[_0xb5ad('0x46')],qs[_0xb5ad('0x5a')](_0x4fa1fd[_0xb5ad('0x43')][_0xb5ad('0x5a')]));_0x4c3ffb[_0xb5ad('0x47')]=_0x4c3ffb[_0xb5ad('0x47')][_0xb5ad('0x48')]?_0x4c3ffb[_0xb5ad('0x47')]:_0x59b116[_0xb5ad('0x46')];if(!_0x4fa1fd[_0xb5ad('0x43')][_0xb5ad('0x49')](_0xb5ad('0x4a'))){_0x4c3ffb[_0xb5ad('0x2e')]=qs['limit'](_0x4fa1fd[_0xb5ad('0x43')][_0xb5ad('0x2e')]);_0x4c3ffb[_0xb5ad('0x30')]=qs[_0xb5ad('0x30')](_0x4fa1fd[_0xb5ad('0x43')][_0xb5ad('0x30')]);}_0x4c3ffb[_0xb5ad('0x4b')]=qs['sort'](_0x4fa1fd['query'][_0xb5ad('0x4c')]);_0x4c3ffb[_0xb5ad('0x4d')]=qs['filters'](_[_0xb5ad('0x4e')](_0x4fa1fd[_0xb5ad('0x43')],_0x59b116[_0xb5ad('0x44')]));_0x4c3ffb[_0xb5ad('0x4d')]['OpenchannelAccountId']=_0x482672['id'];if(_0x4fa1fd[_0xb5ad('0x43')]['filter']){_0x4c3ffb[_0xb5ad('0x4d')]=_['merge'](_0x4c3ffb[_0xb5ad('0x4d')],{'$or':_[_0xb5ad('0x40')](_0x4c3ffb[_0xb5ad('0x47')],function(_0x3987e8){var _0x54a92d={};_0x54a92d[_0x3987e8]={'$like':'%'+_0x4fa1fd[_0xb5ad('0x43')][_0xb5ad('0x52')]+'%'};return _0x54a92d;})});}_0x4c3ffb=_[_0xb5ad('0x4f')]({},_0x4c3ffb,_0x4fa1fd[_0xb5ad('0x5b')]);return db[_0xb5ad('0x8d')][_0xb5ad('0x2f')]({'where':_0x4c3ffb[_0xb5ad('0x4d')]})['then'](function(_0xbcef4d){_0x2a3ffe[_0xb5ad('0x2f')]=_0xbcef4d;if(_0x4fa1fd[_0xb5ad('0x43')][_0xb5ad('0x53')]){_0x4c3ffb[_0xb5ad('0x54')]=[{'model':db[_0xb5ad('0x70')],'as':'Contact','required':![]},{'model':db[_0xb5ad('0x9b')],'as':_0xb5ad('0xad'),'attributes':[_0xb5ad('0x3b'),_0xb5ad('0xae'),'internal'],'required':![]},{'model':db[_0xb5ad('0xaf')],'as':_0xb5ad('0xb0'),'attributes':['id',_0xb5ad('0x3b'),_0xb5ad('0xb1')],'where':_0x4fa1fd['query'][_0xb5ad('0xb2')]?{'id':_0x4fa1fd[_0xb5ad('0x43')]['tag']}:undefined,'required':_0x4fa1fd['query'][_0xb5ad('0xb2')]?!![]:![]}];}return db[_0xb5ad('0x8d')][_0xb5ad('0x55')](_0x4c3ffb);})['then'](function(_0x40f93e){_0x2a3ffe[_0xb5ad('0x56')]=_0x40f93e;return _0x2a3ffe;});}})[_0xb5ad('0x35')](respondWithFilteredResult(_0x14662a,_0x4c3ffb))[_0xb5ad('0x28')](handleError(_0x14662a,null));};exports['addAgents']=function(_0x3c57f0,_0x1b2966,_0x1de148){return db[_0xb5ad('0x41')]['find']({'where':{'id':_0x3c57f0['params']['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0x1b2966,null))[_0xb5ad('0x35')](function(_0x4fc80e){if(_0x4fc80e){return _0x4fc80e[_0xb5ad('0xb3')](_0x3c57f0['body'][_0xb5ad('0xb4')],_['omit'](_0x3c57f0[_0xb5ad('0x5e')],['ids','id'])||{})['spread'](function(_0x12a5d5){for(var _0x594f82=0x0;_0x594f82<_0x3c57f0[_0xb5ad('0x5e')][_0xb5ad('0xb4')][_0xb5ad('0x48')];_0x594f82+=0x1){socket['emit'](_0xb5ad('0xb5'),{'UserId':Number(_0x3c57f0['body'][_0xb5ad('0xb4')][_0x594f82]),'OpenchannelAccountId':Number(_0x3c57f0[_0xb5ad('0x57')]['id'])});}return _0x12a5d5;});}})[_0xb5ad('0x35')](respondWithResult(_0x1b2966,null))[_0xb5ad('0x28')](handleError(_0x1b2966,null));};exports[_0xb5ad('0xb6')]=function(_0x4a2610,_0x30af53,_0x3797b3){return db['OpenchannelAccount'][_0xb5ad('0x5c')]({'where':{'id':_0x4a2610['params']['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0x30af53,null))[_0xb5ad('0x35')](function(_0x2be714){if(_0x2be714){return _0x2be714[_0xb5ad('0xb6')](_0x4a2610[_0xb5ad('0x43')][_0xb5ad('0xb4')])['then'](function(){if(_[_0xb5ad('0xb7')](_0x4a2610[_0xb5ad('0x43')][_0xb5ad('0xb4')])){for(var _0x3b3e2e=0x0;_0x3b3e2e<_0x4a2610[_0xb5ad('0x43')][_0xb5ad('0xb4')][_0xb5ad('0x48')];_0x3b3e2e+=0x1){socket[_0xb5ad('0xb8')](_0xb5ad('0xb9'),{'UserId':Number(_0x4a2610[_0xb5ad('0x43')]['ids'][_0x3b3e2e]),'OpenchannelAccountId':Number(_0x4a2610[_0xb5ad('0x57')]['id'])});}}else{socket[_0xb5ad('0xb8')](_0xb5ad('0xb9'),{'UserId':Number(_0x4a2610[_0xb5ad('0x43')][_0xb5ad('0xb4')]),'OpenchannelAccountId':Number(_0x4a2610[_0xb5ad('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x30af53,null))['catch'](handleError(_0x30af53,null));};exports['getAgents']=function(_0x110e30,_0x3ee1e8,_0x52a536){var _0x19f074={};var _0x5e3c9d={};var _0x2698d0;var _0x4329b0;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x110e30['params']['id']}})[_0xb5ad('0x35')](handleEntityNotFound(_0x3ee1e8,null))[_0xb5ad('0x35')](function(_0x35c880){if(_0x35c880){_0x2698d0=_0x35c880;_0x5e3c9d['model']=_['keys'](db[_0xb5ad('0x9b')][_0xb5ad('0x59')]);_0x5e3c9d[_0xb5ad('0x43')]=_[_0xb5ad('0x58')](_0x110e30[_0xb5ad('0x43')]);_0x5e3c9d[_0xb5ad('0x44')]=_[_0xb5ad('0x45')](_0x5e3c9d[_0xb5ad('0x46')],_0x5e3c9d[_0xb5ad('0x43')]);_0x19f074[_0xb5ad('0x47')]=_[_0xb5ad('0x45')](_0x5e3c9d['model'],qs[_0xb5ad('0x5a')](_0x110e30['query'][_0xb5ad('0x5a')]));_0x19f074[_0xb5ad('0x47')]=_0x19f074['attributes'][_0xb5ad('0x48')]?_0x19f074[_0xb5ad('0x47')]:_0x5e3c9d[_0xb5ad('0x46')];_0x19f074['order']=qs['sort'](_0x110e30[_0xb5ad('0x43')][_0xb5ad('0x4c')]);_0x19f074[_0xb5ad('0x4d')]=qs['filters'](_[_0xb5ad('0x4e')](_0x110e30[_0xb5ad('0x43')],_0x5e3c9d[_0xb5ad('0x44')]));if(_0x110e30[_0xb5ad('0x43')][_0xb5ad('0x52')]){_0x19f074[_0xb5ad('0x4d')]=_[_0xb5ad('0x4f')](_0x19f074[_0xb5ad('0x4d')],{'$or':_[_0xb5ad('0x40')](_0x19f074['attributes'],function(_0x24cd74){var _0x115497={};_0x115497[_0x24cd74]={'$like':'%'+_0x110e30[_0xb5ad('0x43')][_0xb5ad('0x52')]+'%'};return _0x115497;})});}_0x19f074=_[_0xb5ad('0x4f')]({},_0x19f074,_0x110e30[_0xb5ad('0x5b')]);return _0x2698d0[_0xb5ad('0xba')](_0x19f074);}})['then'](function(_0x1d0d45){if(_0x1d0d45){_0x4329b0=_0x1d0d45[_0xb5ad('0x48')];if(!_0x110e30[_0xb5ad('0x43')]['hasOwnProperty']('nolimit')){_0x19f074[_0xb5ad('0x2e')]=qs[_0xb5ad('0x2e')](_0x110e30[_0xb5ad('0x43')][_0xb5ad('0x2e')]);_0x19f074['offset']=qs[_0xb5ad('0x30')](_0x110e30[_0xb5ad('0x43')][_0xb5ad('0x30')]);}return _0x2698d0['getAgents'](_0x19f074);}})[_0xb5ad('0x35')](function(_0x53d432){if(_0x53d432){return _0x53d432?{'count':_0x4329b0,'rows':_0x53d432}:null;}})[_0xb5ad('0x35')](respondWithResult(_0x3ee1e8,null))['catch'](handleError(_0x3ee1e8,null));};exports[_0xb5ad('0x3c')]=function(_0x5f336f,_0x42c128,_0x26a139){var _0x1146ca,_0x9ac50f,_0x5842ad;if(_[_0xb5ad('0x78')](_0x5f336f[_0xb5ad('0x5e')]['body'])||_0x5f336f[_0xb5ad('0x5e')][_0xb5ad('0x5e')]===''){throw new db[(_0xb5ad('0x71'))][(_0xb5ad('0x7a'))](_0xb5ad('0x7c'));}if(_['isNil'](_0x5f336f[_0xb5ad('0x5e')]['to'])){}_0x1146ca=_0x5f336f[_0xb5ad('0x5e')]['to'];return db['OpenchannelAccount'][_0xb5ad('0x69')]({'where':{'id':_0x5f336f[_0xb5ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x42c128,null))[_0xb5ad('0x35')](function(_0x576379){if(_0x576379){return db[_0xb5ad('0x41')]['find']({'where':{'id':_0x576379['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb5ad('0x70')],'as':_0xb5ad('0x82'),'where':{[_0x576379[_0xb5ad('0x7d')]]:_0x1146ca},'limit':0x1,'order':[[_0xb5ad('0x75'),'DESC']]}]}]})[_0xb5ad('0x35')](handleEntityNotFound(_0x42c128,null))[_0xb5ad('0x35')](function(_0x454884){if(_0x454884&&_0x454884[_0xb5ad('0x81')]){_0x9ac50f=_0x454884['get']({'plain':!![]});if(_0x9ac50f[_0xb5ad('0x81')]&&_0x9ac50f['List'][_0xb5ad('0x82')][_0xb5ad('0x48')]){return _0x9ac50f[_0xb5ad('0x81')]['Contacts'][0x0];}return db[_0xb5ad('0x70')][_0xb5ad('0x5d')](_[_0xb5ad('0x17')](_0x5f336f[_0xb5ad('0x5e')],{'firstName':_0x1146ca,[_0x454884[_0xb5ad('0x7d')]]:_0x1146ca,'phone':_0x1146ca,'ListId':_0x9ac50f['ListId']}));}})[_0xb5ad('0x35')](handleEntityNotFound(_0x42c128,null))[_0xb5ad('0x35')](function(_0x7ea038){if(_0x7ea038){_0x5842ad=_0x7ea038;return db[_0xb5ad('0x8d')][_0xb5ad('0x5c')]({'where':{'ContactId':_0x5842ad['id'],'closed':![],'OpenchannelAccountId':_0x9ac50f['id']}})[_0xb5ad('0x35')](function(_0x29c21c){if(_0x29c21c){return[_0x29c21c,![]];}return db[_0xb5ad('0x8d')][_0xb5ad('0x5d')]({'UserId':_0x5f336f[_0xb5ad('0x60')]['id'],'ContactId':_0x5842ad['id'],'OpenchannelAccountId':_0x9ac50f['id'],'lastMsgDirection':_0xb5ad('0xbb'),'firstMsgDirection':'out','Messages':[_[_0xb5ad('0x4f')](_0x5f336f[_0xb5ad('0x5e')],{'read':![],'body':_0x5f336f['body'][_0xb5ad('0x5e')],'OpenchannelAccountId':_0x9ac50f['id'],'UserId':_0x5f336f[_0xb5ad('0x60')]['id'],'ContactId':_0x5842ad['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xb5ad('0xbc')}]})[_0xb5ad('0x35')](function(_0x420133){return[_0x420133,!![]];});});}})[_0xb5ad('0x91')](function(_0xfaf312,_0x339456){if(_0x339456){return _0xfaf312;}return db[_0xb5ad('0x99')]['create'](_['merge'](_0x5f336f[_0xb5ad('0x5e')],{'read':![],'body':_0x5f336f[_0xb5ad('0x5e')]['body'],'OpenchannelAccountId':_0x9ac50f['id'],'OpenchannelInteractionId':_0xfaf312['id'],'UserId':_0x5f336f['user']['id'],'ContactId':_0x5842ad['id']}))[_0xb5ad('0x35')](function(_0x16860c){_0xfaf312[_0xb5ad('0xbd')][_0xb5ad('0xbc')]=[];_0xfaf312[_0xb5ad('0xbd')][_0xb5ad('0xbc')]['push'](_0x16860c['dataValues']);return _0xfaf312;});});}})[_0xb5ad('0x35')](respondWithResult(_0x42c128,null))[_0xb5ad('0x28')](handleError(_0x42c128,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 8f5fd2c..9168dea 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 _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x26f1bc,_0x263067){var _0x30e19c=function(_0x20d4c7){while(--_0x20d4c7){_0x26f1bc['push'](_0x26f1bc['shift']());}};_0x30e19c(++_0x263067);}(_0x13f6,0x124));var _0x613f=function(_0x21488b,_0x1188ef){_0x21488b=_0x21488b-0x0;var _0x4378ee=_0x13f6[_0x21488b];return _0x4378ee;};'use strict';var EventEmitter=require(_0x613f('0x0'));var OpenchannelAccount=require(_0x613f('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){OpenchannelAccountEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);OpenchannelAccountEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x54ef=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update'];(function(_0x2acfff,_0x59842f){var _0x48511c=function(_0x19013e){while(--_0x19013e){_0x2acfff['push'](_0x2acfff['shift']());}};_0x48511c(++_0x59842f);}(_0x54ef,0x112));var _0xf54e=function(_0x1ebc29,_0x14ae04){_0x1ebc29=_0x1ebc29-0x0;var _0x47077b=_0x54ef[_0x1ebc29];return _0x47077b;};'use strict';var EventEmitter=require(_0xf54e('0x0'));var OpenchannelAccount=require(_0xf54e('0x1'))['db'][_0xf54e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf54e('0x3'),'afterUpdate':_0xf54e('0x4'),'afterDestroy':_0xf54e('0x5')};function emitEvent(_0x42b9b2){return function(_0x8b6bb6,_0x431e36,_0x12d43f){OpenchannelAccountEvents['emit'](_0x42b9b2+':'+_0x8b6bb6['id'],_0x8b6bb6);OpenchannelAccountEvents['emit'](_0x42b9b2,_0x8b6bb6);_0x12d43f(null);};}for(var e in events){if(events[_0xf54e('0x6')](e)){var event=events[e];OpenchannelAccount[_0xf54e('0x7')](e,emitEvent(event));}}module[_0xf54e('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index ec76e1a..0bf5b7c 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(_0x5cd45e,_0x5c5f28){var _0x45ba2f=function(_0x469566){while(--_0x469566){_0x5cd45e['push'](_0x5cd45e['shift']());}};_0x45ba2f(++_0x5c5f28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x317f56,_0x1db5af){var _0x265c60=function(_0x3ece5f){while(--_0x3ece5f){_0x317f56['push'](_0x317f56['shift']());}};_0x265c60(++_0x1db5af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 e3a9d36..f707aef 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 _0x1339=['OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0x1339,0x1ed));var _0x9133=function(_0x4d978d,_0x425a5a){_0x4d978d=_0x4d978d-0x0;var _0x4efb21=_0x1339[_0x4d978d];return _0x4efb21;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});config['redis']=_[_0x9133('0xb')](config[_0x9133('0xc')],{'host':_0x9133('0xd'),'port':0x18eb});var socket=require(_0x9133('0xe'))(new Redis(config[_0x9133('0xc')]));require(_0x9133('0xf'))[_0x9133('0x10')](socket);function respondWithRpcPromise(_0x245134,_0x10a9e4,_0xd588c){return new BPromise(function(_0x4c4517,_0x3f9650){return client[_0x9133('0x11')](_0x245134,_0xd588c)[_0x9133('0x12')](function(_0x452481){logger[_0x9133('0x13')](_0x9133('0x14'),_0x10a9e4,'request\x20sent');logger[_0x9133('0x15')](_0x9133('0x16'),_0x10a9e4,'request\x20sent',JSON['stringify'](_0x452481));if(_0x452481[_0x9133('0x17')]){if(_0x452481['error'][_0x9133('0x18')]===0x1f4){logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481[_0x9133('0x17')][_0x9133('0x19')]);return _0x3f9650(_0x452481[_0x9133('0x17')]['message']);}logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481['error'][_0x9133('0x19')]);return _0x4c4517(_0x452481[_0x9133('0x17')][_0x9133('0x19')]);}else{logger[_0x9133('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x10a9e4,_0x9133('0x1a'));_0x4c4517(_0x452481['result'][_0x9133('0x19')]);}})['catch'](function(_0x115ee8){logger[_0x9133('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x10a9e4,_0x115ee8);_0x3f9650(_0x115ee8);});});} \ No newline at end of file +var _0x80df=['OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','request\x20sent','debug','error','code'];(function(_0x347993,_0x32d3dd){var _0x53871e=function(_0x5a1455){while(--_0x5a1455){_0x347993['push'](_0x347993['shift']());}};_0x53871e(++_0x32d3dd);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});config[_0xf80d('0xd')]=_['defaults'](config[_0xf80d('0xd')],{'host':_0xf80d('0xe'),'port':0x18eb});var socket=require(_0xf80d('0xf'))(new Redis(config[_0xf80d('0xd')]));require(_0xf80d('0x10'))[_0xf80d('0x11')](socket);function respondWithRpcPromise(_0x41595f,_0x45d290,_0x2fddc2){return new BPromise(function(_0x2ef5d1,_0x30df95){return client[_0xf80d('0x12')](_0x41595f,_0x2fddc2)[_0xf80d('0x13')](function(_0x29bd2c){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x45d290,_0xf80d('0x14'));logger[_0xf80d('0x15')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x45d290,_0xf80d('0x14'),JSON['stringify'](_0x29bd2c));if(_0x29bd2c[_0xf80d('0x16')]){if(_0x29bd2c['error'][_0xf80d('0x17')]===0x1f4){logger['error'](_0xf80d('0x18'),_0x45d290,_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);return _0x30df95(_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);}logger[_0xf80d('0x16')](_0xf80d('0x18'),_0x45d290,_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);return _0x2ef5d1(_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);}else{logger[_0xf80d('0x1a')](_0xf80d('0x18'),_0x45d290,_0xf80d('0x14'));_0x2ef5d1(_0x29bd2c[_0xf80d('0x1b')][_0xf80d('0x19')]);}})[_0xf80d('0x1c')](function(_0x124174){logger[_0xf80d('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x45d290,_0x124174);_0x30df95(_0x124174);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index eb6f601..8c77760 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 _0x55e0=['emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x57a5e5,_0x18b0d6){var _0x354012=function(_0x34d87b){while(--_0x34d87b){_0x57a5e5['push'](_0x57a5e5['shift']());}};_0x354012(++_0x18b0d6);}(_0x55e0,0xdc));var _0x055e=function(_0x14dcc9,_0x19ac97){_0x14dcc9=_0x14dcc9-0x0;var _0x410bed=_0x55e0[_0x14dcc9];return _0x410bed;};'use strict';var OpenchannelAccountEvents=require(_0x055e('0x0'));var events=[_0x055e('0x1'),_0x055e('0x2'),_0x055e('0x3')];function createListener(_0x5b82b9,_0x578882){return function(_0x3a2ee6){_0x578882[_0x055e('0x4')](_0x5b82b9,_0x3a2ee6);};}function removeListener(_0x33cd7b,_0x2773e4){return function(){OpenchannelAccountEvents[_0x055e('0x5')](_0x33cd7b,_0x2773e4);};}exports[_0x055e('0x6')]=function(_0x490ee1){for(var _0x5239f6=0x0,_0x4384ff=events['length'];_0x5239f6<_0x4384ff;_0x5239f6++){var _0x8e7824=events[_0x5239f6];var _0x3c4cf=createListener(_0x055e('0x7')+_0x8e7824,_0x490ee1);OpenchannelAccountEvents['on'](_0x8e7824,_0x3c4cf);}}; \ No newline at end of file +var _0x0b96=['./openchannelAccount.events','save','remove','register','length'];(function(_0x5b2b28,_0xfcf44e){var _0x52e491=function(_0xb9faee){while(--_0xb9faee){_0x5b2b28['push'](_0x5b2b28['shift']());}};_0x52e491(++_0xfcf44e);}(_0x0b96,0xa5));var _0x60b9=function(_0x5e961f,_0x410eac){_0x5e961f=_0x5e961f-0x0;var _0x157371=_0x0b96[_0x5e961f];return _0x157371;};'use strict';var OpenchannelAccountEvents=require(_0x60b9('0x0'));var events=[_0x60b9('0x1'),_0x60b9('0x2'),'update'];function createListener(_0xbe4f47,_0x13616a){return function(_0x23a080){_0x13616a['emit'](_0xbe4f47,_0x23a080);};}function removeListener(_0x348b51,_0x3e232a){return function(){OpenchannelAccountEvents['removeListener'](_0x348b51,_0x3e232a);};}exports[_0x60b9('0x3')]=function(_0x443326){for(var _0x40e534=0x0,_0x6f397e=events[_0x60b9('0x4')];_0x40e534<_0x6f397e;_0x40e534++){var _0x28d32f=events[_0x40e534];var _0x1e5cef=createListener('openchannelAccount:'+_0x28d32f,_0x443326);OpenchannelAccountEvents['on'](_0x28d32f,_0x1e5cef);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 96cd066..4e89c89 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 _0x1039=['show','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0x11f793,_0x581546){var _0x59b2db=function(_0x356b97){while(--_0x356b97){_0x11f793['push'](_0x11f793['shift']());}};_0x59b2db(++_0x581546);}(_0x1039,0xea));var _0x9103=function(_0x256dcd,_0x4345b9){_0x256dcd=_0x256dcd-0x0;var _0x1977de=_0x1039[_0x256dcd];return _0x1977de;};'use strict';var multer=require(_0x9103('0x0'));var util=require(_0x9103('0x1'));var path=require(_0x9103('0x2'));var timeout=require(_0x9103('0x3'));var express=require(_0x9103('0x4'));var router=express['Router']();var fs_extra=require(_0x9103('0x5'));var auth=require(_0x9103('0x6'));var interaction=require(_0x9103('0x7'));var config=require(_0x9103('0x8'));var controller=require(_0x9103('0x9'));router[_0x9103('0xa')]('/',auth[_0x9103('0xb')](),controller[_0x9103('0xc')]);router[_0x9103('0xa')]('/:id',auth[_0x9103('0xb')](),controller[_0x9103('0xd')]);router['post']('/',auth[_0x9103('0xb')](),controller[_0x9103('0xe')]);router['put'](_0x9103('0xf'),auth[_0x9103('0xb')](),controller[_0x9103('0x10')]);router[_0x9103('0x11')](_0x9103('0xf'),auth[_0x9103('0xb')](),controller['destroy']);module[_0x9103('0x12')]=router; \ No newline at end of file +var _0x13e6=['../../components/auth/service','./openchannelApplication.controller','isAuthenticated','get','/:id','put','delete','destroy','exports','util','express'];(function(_0x38ccd0,_0x5840bd){var _0x50d181=function(_0x32cdfd){while(--_0x32cdfd){_0x38ccd0['push'](_0x38ccd0['shift']());}};_0x50d181(++_0x5840bd);}(_0x13e6,0xa3));var _0x613e=function(_0x391dcf,_0x3ae1ce){_0x391dcf=_0x391dcf-0x0;var _0x5c304a=_0x13e6[_0x391dcf];return _0x5c304a;};'use strict';var multer=require('multer');var util=require(_0x613e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613e('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x613e('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x613e('0x3'));router['get']('/',auth[_0x613e('0x4')](),controller['index']);router[_0x613e('0x5')](_0x613e('0x6'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x613e('0x4')](),controller['create']);router[_0x613e('0x7')](_0x613e('0x6'),auth['isAuthenticated'](),controller['update']);router[_0x613e('0x8')](_0x613e('0x6'),auth['isAuthenticated'](),controller[_0x613e('0x9')]);module[_0x613e('0xa')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 4a36361..7e86f3c 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 _0x38cc=['noop','TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x123cee,_0x3403db){var _0x272716=function(_0x3a6c19){while(--_0x3a6c19){_0x123cee['push'](_0x123cee['shift']());}};_0x272716(++_0x3403db);}(_0x38cc,0x170));var _0xc38c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x38cc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xc38c('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xc38c('0x1')],'allowNull':![],'defaultValue':_0xc38c('0x2')},'appdata':{'type':Sequelize[_0xc38c('0x3')]()},'description':{'type':Sequelize[_0xc38c('0x1')]},'interval':{'type':Sequelize[_0xc38c('0x1')],'defaultValue':_0xc38c('0x4')}}; \ No newline at end of file +var _0x0c98=['STRING','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x492be5,_0x430854){var _0x1d4c23=function(_0x270a4a){while(--_0x270a4a){_0x492be5['push'](_0x492be5['shift']());}};_0x1d4c23(++_0x430854);}(_0x0c98,0x166));var _0x80c9=function(_0x35e6fe,_0x4fa379){_0x35e6fe=_0x35e6fe-0x0;var _0xf260e7=_0x0c98[_0x35e6fe];return _0xf260e7;};'use strict';var Sequelize=require(_0x80c9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x80c9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x80c9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x80c9('0x3')]()},'description':{'type':Sequelize[_0x80c9('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x80c9('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 8ac6370..ca29923 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 _0x4593=['json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x4593,0x15f));var _0x3459=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x4593[_0x3cae69];return _0x3128eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3459('0x0'));var zipdir=require(_0x3459('0x1'));var jsonpatch=require(_0x3459('0x2'));var rp=require(_0x3459('0x3'));var moment=require(_0x3459('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3459('0x5'));var ejs=require(_0x3459('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3459('0x7'));var squel=require(_0x3459('0x8'));var crypto=require(_0x3459('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3459('0xa'));var toCsv=require(_0x3459('0x5'));var querystring=require(_0x3459('0xb'));var Papa=require(_0x3459('0xc'));var Redis=require(_0x3459('0xd'));var authService=require(_0x3459('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3459('0xf'));var hardwareService=require(_0x3459('0x10'));var logger=require(_0x3459('0x11'))(_0x3459('0x12'));var utils=require(_0x3459('0x13'));var config=require(_0x3459('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3459('0x15'))['db'];function respondWithStatusCode(_0x3134b8,_0x35cafb){_0x35cafb=_0x35cafb||0xcc;return function(_0x9a990d){if(_0x9a990d){return _0x3134b8[_0x3459('0x16')](_0x35cafb);}return _0x3134b8[_0x3459('0x17')](_0x35cafb)['end']();};}function respondWithResult(_0x291343,_0x8a0e4f){_0x8a0e4f=_0x8a0e4f||0xc8;return function(_0x5f33cd){if(_0x5f33cd){return _0x291343['status'](_0x8a0e4f)[_0x3459('0x18')](_0x5f33cd);}};}function respondWithFilteredResult(_0x4c9e0f,_0x1c68ef){return function(_0x513fac){if(_0x513fac){var _0x14e6e6=typeof _0x1c68ef['offset']==='undefined'&&typeof _0x1c68ef[_0x3459('0x19')]===_0x3459('0x1a');var _0x5622d4=_0x513fac[_0x3459('0x1b')];var _0x110362=_0x14e6e6?0x0:_0x1c68ef[_0x3459('0x1c')];var _0x454892=_0x14e6e6?_0x513fac['count']:_0x1c68ef[_0x3459('0x1c')]+_0x1c68ef[_0x3459('0x19')];var _0x3fde1f;if(_0x454892>=_0x5622d4){_0x454892=_0x5622d4;_0x3fde1f=0xc8;}else{_0x3fde1f=0xce;}_0x4c9e0f['status'](_0x3fde1f);return _0x4c9e0f[_0x3459('0x1d')](_0x3459('0x1e'),_0x110362+'-'+_0x454892+'/'+_0x5622d4)[_0x3459('0x18')](_0x513fac);}return null;};}function patchUpdates(_0x411bda){return function(_0xfcba7){try{jsonpatch[_0x3459('0x1f')](_0xfcba7,_0x411bda,!![]);}catch(_0x2cea01){return BPromise[_0x3459('0x20')](_0x2cea01);}return _0xfcba7[_0x3459('0x21')]();};}function saveUpdates(_0x5d4ddc,_0x440324){return function(_0x659180){if(_0x659180){return _0x659180[_0x3459('0x22')](_0x5d4ddc)[_0x3459('0x23')](function(_0x2eb3b9){return _0x2eb3b9;});}return null;};}function removeEntity(_0x4c3b6d,_0x5f4016){return function(_0x4ca792){if(_0x4ca792){return _0x4ca792[_0x3459('0x24')]()[_0x3459('0x23')](function(){_0x4c3b6d[_0x3459('0x17')](0xcc)[_0x3459('0x25')]();});}};}function handleEntityNotFound(_0x4b04ab,_0x5bd9e9){return function(_0x373b52){if(!_0x373b52){_0x4b04ab[_0x3459('0x16')](0x194);}return _0x373b52;};}function handleError(_0xb73f84,_0x19b5b6){_0x19b5b6=_0x19b5b6||0x1f4;return function(_0x37ccd3){logger[_0x3459('0x26')](_0x37ccd3[_0x3459('0x27')]);if(_0x37ccd3['name']){delete _0x37ccd3[_0x3459('0x28')];}_0xb73f84[_0x3459('0x17')](_0x19b5b6)[_0x3459('0x29')](_0x37ccd3);};}exports[_0x3459('0x2a')]=function(_0x4e41bf,_0x51cf2f){var _0x1fb6cc={},_0x351c51={},_0x3f70b={'count':0x0,'rows':[]};var _0x62f9f0=_[_0x3459('0x2b')](db[_0x3459('0x2c')][_0x3459('0x2d')],function(_0x2d6154){return{'name':_0x2d6154[_0x3459('0x2e')],'type':_0x2d6154[_0x3459('0x2f')][_0x3459('0x30')]};});_0x351c51[_0x3459('0x31')]=_['map'](_0x62f9f0,_0x3459('0x28'));_0x351c51[_0x3459('0x32')]=_[_0x3459('0x33')](_0x4e41bf[_0x3459('0x32')]);_0x351c51[_0x3459('0x34')]=_[_0x3459('0x35')](_0x351c51['model'],_0x351c51[_0x3459('0x32')]);_0x1fb6cc['attributes']=_[_0x3459('0x35')](_0x351c51['model'],qs['fields'](_0x4e41bf[_0x3459('0x32')][_0x3459('0x36')]));_0x1fb6cc[_0x3459('0x37')]=_0x1fb6cc[_0x3459('0x37')][_0x3459('0x38')]?_0x1fb6cc[_0x3459('0x37')]:_0x351c51[_0x3459('0x31')];if(!_0x4e41bf[_0x3459('0x32')][_0x3459('0x39')](_0x3459('0x3a'))){_0x1fb6cc[_0x3459('0x19')]=qs['limit'](_0x4e41bf[_0x3459('0x32')][_0x3459('0x19')]);_0x1fb6cc[_0x3459('0x1c')]=qs[_0x3459('0x1c')](_0x4e41bf[_0x3459('0x32')][_0x3459('0x1c')]);}_0x1fb6cc['order']=qs[_0x3459('0x3b')](_0x4e41bf[_0x3459('0x32')][_0x3459('0x3b')]);_0x1fb6cc[_0x3459('0x3c')]=qs['filters'](_[_0x3459('0x3d')](_0x4e41bf[_0x3459('0x32')],_0x351c51[_0x3459('0x34')]),_0x62f9f0);if(_0x4e41bf[_0x3459('0x32')][_0x3459('0x3e')]){_0x1fb6cc[_0x3459('0x3c')]=_['merge'](_0x1fb6cc[_0x3459('0x3c')],{'$or':_[_0x3459('0x2b')](_0x62f9f0,function(_0x482b2b){if(_0x482b2b[_0x3459('0x2f')]!=='VIRTUAL'){var _0x54a565={};_0x54a565[_0x482b2b[_0x3459('0x28')]]={'$like':'%'+_0x4e41bf[_0x3459('0x32')][_0x3459('0x3e')]+'%'};return _0x54a565;}})});}_0x1fb6cc=_[_0x3459('0x3f')]({},_0x1fb6cc,_0x4e41bf[_0x3459('0x40')]);var _0x12572e={'where':_0x1fb6cc['where']};return db['OpenchannelApplication'][_0x3459('0x1b')](_0x12572e)[_0x3459('0x23')](function(_0x533fa6){_0x3f70b[_0x3459('0x1b')]=_0x533fa6;if(_0x4e41bf[_0x3459('0x32')][_0x3459('0x41')]){_0x1fb6cc['include']=[{'all':!![]}];}return db[_0x3459('0x2c')][_0x3459('0x42')](_0x1fb6cc);})['then'](function(_0x115646){_0x3f70b[_0x3459('0x43')]=_0x115646;return _0x3f70b;})[_0x3459('0x23')](respondWithFilteredResult(_0x51cf2f,_0x1fb6cc))['catch'](handleError(_0x51cf2f,null));};exports[_0x3459('0x44')]=function(_0x31bfcb,_0x340bb1){var _0x29610f={'raw':!![],'where':{'id':_0x31bfcb[_0x3459('0x45')]['id']}},_0x52c7d7={};_0x52c7d7[_0x3459('0x31')]=_['keys'](db[_0x3459('0x2c')]['rawAttributes']);_0x52c7d7['query']=_[_0x3459('0x33')](_0x31bfcb[_0x3459('0x32')]);_0x52c7d7['filters']=_[_0x3459('0x35')](_0x52c7d7[_0x3459('0x31')],_0x52c7d7['query']);_0x29610f['attributes']=_['intersection'](_0x52c7d7[_0x3459('0x31')],qs[_0x3459('0x36')](_0x31bfcb[_0x3459('0x32')][_0x3459('0x36')]));_0x29610f['attributes']=_0x29610f[_0x3459('0x37')][_0x3459('0x38')]?_0x29610f[_0x3459('0x37')]:_0x52c7d7[_0x3459('0x31')];if(_0x31bfcb[_0x3459('0x32')]['includeAll']){_0x29610f[_0x3459('0x46')]=[{'all':!![]}];}_0x29610f=_[_0x3459('0x3f')]({},_0x29610f,_0x31bfcb[_0x3459('0x40')]);return db[_0x3459('0x2c')][_0x3459('0x47')](_0x29610f)['then'](handleEntityNotFound(_0x340bb1,null))[_0x3459('0x23')](respondWithResult(_0x340bb1,null))[_0x3459('0x48')](handleError(_0x340bb1,null));};exports['create']=function(_0x4debb0,_0x40bfbf){return db[_0x3459('0x2c')][_0x3459('0x49')](_0x4debb0[_0x3459('0x4a')],{})[_0x3459('0x23')](respondWithResult(_0x40bfbf,0xc9))[_0x3459('0x48')](handleError(_0x40bfbf,null));};exports[_0x3459('0x22')]=function(_0x49184c,_0x397203){if(_0x49184c[_0x3459('0x4a')]['id']){delete _0x49184c['body']['id'];}return db[_0x3459('0x2c')][_0x3459('0x47')]({'where':{'id':_0x49184c[_0x3459('0x45')]['id']}})[_0x3459('0x23')](handleEntityNotFound(_0x397203,null))[_0x3459('0x23')](saveUpdates(_0x49184c[_0x3459('0x4a')],null))['then'](respondWithResult(_0x397203,null))[_0x3459('0x48')](handleError(_0x397203,null));};exports[_0x3459('0x24')]=function(_0x4bfb46,_0x4cb6c2){return db['OpenchannelApplication'][_0x3459('0x47')]({'where':{'id':_0x4bfb46[_0x3459('0x45')]['id']}})[_0x3459('0x23')](handleEntityNotFound(_0x4cb6c2,null))[_0x3459('0x23')](removeEntity(_0x4cb6c2,null))[_0x3459('0x48')](handleError(_0x4cb6c2,null));}; \ No newline at end of file +var _0xd99d=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','name','send','OpenchannelApplication','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','catch','create','body','params','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x4f9239,_0x40cac2){var _0x17bf2f=function(_0x40563a){while(--_0x40563a){_0x4f9239['push'](_0x4f9239['shift']());}};_0x17bf2f(++_0x40cac2);}(_0xd99d,0x112));var _0xdd99=function(_0x23bd91,_0x7440d4){_0x23bd91=_0x23bd91-0x0;var _0x2f846e=_0xd99d[_0x23bd91];return _0x2f846e;};'use strict';var emlformat=require(_0xdd99('0x0'));var rimraf=require(_0xdd99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd99('0x2'));var rp=require(_0xdd99('0x3'));var moment=require(_0xdd99('0x4'));var BPromise=require(_0xdd99('0x5'));var Mustache=require(_0xdd99('0x6'));var util=require(_0xdd99('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd99('0x8'));var fs=require('fs');var fs_extra=require(_0xdd99('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdd99('0xa'));var jsforce=require(_0xdd99('0xb'));var deskjs=require(_0xdd99('0xc'));var toCsv=require(_0xdd99('0xd'));var querystring=require(_0xdd99('0xe'));var Papa=require(_0xdd99('0xf'));var Redis=require(_0xdd99('0x10'));var authService=require(_0xdd99('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdd99('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd99('0x13'))(_0xdd99('0x14'));var utils=require('../../config/utils');var config=require(_0xdd99('0x15'));var licenseUtil=require(_0xdd99('0x16'));var db=require(_0xdd99('0x17'))['db'];function respondWithStatusCode(_0x2c6207,_0x3cb17b){_0x3cb17b=_0x3cb17b||0xcc;return function(_0x1d8937){if(_0x1d8937){return _0x2c6207[_0xdd99('0x18')](_0x3cb17b);}return _0x2c6207[_0xdd99('0x19')](_0x3cb17b)[_0xdd99('0x1a')]();};}function respondWithResult(_0x263f8c,_0x5d3ab){_0x5d3ab=_0x5d3ab||0xc8;return function(_0x172be7){if(_0x172be7){return _0x263f8c[_0xdd99('0x19')](_0x5d3ab)[_0xdd99('0x1b')](_0x172be7);}};}function respondWithFilteredResult(_0x391b6d,_0x2c5fbe){return function(_0xc27b49){if(_0xc27b49){var _0x3d55cf=typeof _0x2c5fbe[_0xdd99('0x1c')]==='undefined'&&typeof _0x2c5fbe[_0xdd99('0x1d')]===_0xdd99('0x1e');var _0x20a1ea=_0xc27b49[_0xdd99('0x1f')];var _0x4718da=_0x3d55cf?0x0:_0x2c5fbe['offset'];var _0xae26d9=_0x3d55cf?_0xc27b49[_0xdd99('0x1f')]:_0x2c5fbe[_0xdd99('0x1c')]+_0x2c5fbe[_0xdd99('0x1d')];var _0x418ec5;if(_0xae26d9>=_0x20a1ea){_0xae26d9=_0x20a1ea;_0x418ec5=0xc8;}else{_0x418ec5=0xce;}_0x391b6d[_0xdd99('0x19')](_0x418ec5);return _0x391b6d[_0xdd99('0x20')]('Content-Range',_0x4718da+'-'+_0xae26d9+'/'+_0x20a1ea)[_0xdd99('0x1b')](_0xc27b49);}return null;};}function patchUpdates(_0xddb20d){return function(_0x2950b7){try{jsonpatch[_0xdd99('0x21')](_0x2950b7,_0xddb20d,!![]);}catch(_0x23c3c3){return BPromise[_0xdd99('0x22')](_0x23c3c3);}return _0x2950b7['save']();};}function saveUpdates(_0x10ca0a,_0xc1ed3e){return function(_0x29f5c0){if(_0x29f5c0){return _0x29f5c0[_0xdd99('0x23')](_0x10ca0a)[_0xdd99('0x24')](function(_0x155e64){return _0x155e64;});}return null;};}function removeEntity(_0x2914d8,_0x5131ca){return function(_0x3a6f81){if(_0x3a6f81){return _0x3a6f81[_0xdd99('0x25')]()[_0xdd99('0x24')](function(){_0x2914d8[_0xdd99('0x19')](0xcc)[_0xdd99('0x1a')]();});}};}function handleEntityNotFound(_0x6131e8,_0x57f2){return function(_0x5f2e93){if(!_0x5f2e93){_0x6131e8[_0xdd99('0x18')](0x194);}return _0x5f2e93;};}function handleError(_0x7286b2,_0x3082b5){_0x3082b5=_0x3082b5||0x1f4;return function(_0x504b7c){logger[_0xdd99('0x26')](_0x504b7c['stack']);if(_0x504b7c[_0xdd99('0x27')]){delete _0x504b7c[_0xdd99('0x27')];}_0x7286b2[_0xdd99('0x19')](_0x3082b5)[_0xdd99('0x28')](_0x504b7c);};}exports['index']=function(_0x308eb2,_0x5ce836){var _0x37097b={},_0x4e5dde={},_0x891e0c={'count':0x0,'rows':[]};var _0x2bc4a3=_['map'](db[_0xdd99('0x29')][_0xdd99('0x2a')],function(_0x389610){return{'name':_0x389610[_0xdd99('0x2b')],'type':_0x389610[_0xdd99('0x2c')]['key']};});_0x4e5dde[_0xdd99('0x2d')]=_[_0xdd99('0x2e')](_0x2bc4a3,_0xdd99('0x27'));_0x4e5dde[_0xdd99('0x2f')]=_[_0xdd99('0x30')](_0x308eb2[_0xdd99('0x2f')]);_0x4e5dde[_0xdd99('0x31')]=_[_0xdd99('0x32')](_0x4e5dde[_0xdd99('0x2d')],_0x4e5dde[_0xdd99('0x2f')]);_0x37097b[_0xdd99('0x33')]=_[_0xdd99('0x32')](_0x4e5dde[_0xdd99('0x2d')],qs[_0xdd99('0x34')](_0x308eb2[_0xdd99('0x2f')][_0xdd99('0x34')]));_0x37097b[_0xdd99('0x33')]=_0x37097b[_0xdd99('0x33')][_0xdd99('0x35')]?_0x37097b[_0xdd99('0x33')]:_0x4e5dde[_0xdd99('0x2d')];if(!_0x308eb2[_0xdd99('0x2f')][_0xdd99('0x36')](_0xdd99('0x37'))){_0x37097b[_0xdd99('0x1d')]=qs[_0xdd99('0x1d')](_0x308eb2[_0xdd99('0x2f')][_0xdd99('0x1d')]);_0x37097b[_0xdd99('0x1c')]=qs['offset'](_0x308eb2[_0xdd99('0x2f')][_0xdd99('0x1c')]);}_0x37097b[_0xdd99('0x38')]=qs[_0xdd99('0x39')](_0x308eb2[_0xdd99('0x2f')][_0xdd99('0x39')]);_0x37097b[_0xdd99('0x3a')]=qs['filters'](_[_0xdd99('0x3b')](_0x308eb2[_0xdd99('0x2f')],_0x4e5dde['filters']),_0x2bc4a3);if(_0x308eb2['query'][_0xdd99('0x3c')]){_0x37097b['where']=_[_0xdd99('0x3d')](_0x37097b['where'],{'$or':_[_0xdd99('0x2e')](_0x2bc4a3,function(_0x1a8390){if(_0x1a8390[_0xdd99('0x2c')]!==_0xdd99('0x3e')){var _0x1d8e60={};_0x1d8e60[_0x1a8390['name']]={'$like':'%'+_0x308eb2['query'][_0xdd99('0x3c')]+'%'};return _0x1d8e60;}})});}_0x37097b=_['merge']({},_0x37097b,_0x308eb2['options']);var _0x504e84={'where':_0x37097b[_0xdd99('0x3a')]};return db[_0xdd99('0x29')][_0xdd99('0x1f')](_0x504e84)['then'](function(_0x6695fd){_0x891e0c[_0xdd99('0x1f')]=_0x6695fd;if(_0x308eb2[_0xdd99('0x2f')][_0xdd99('0x3f')]){_0x37097b[_0xdd99('0x40')]=[{'all':!![]}];}return db[_0xdd99('0x29')][_0xdd99('0x41')](_0x37097b);})[_0xdd99('0x24')](function(_0x1e118d){_0x891e0c[_0xdd99('0x42')]=_0x1e118d;return _0x891e0c;})[_0xdd99('0x24')](respondWithFilteredResult(_0x5ce836,_0x37097b))['catch'](handleError(_0x5ce836,null));};exports[_0xdd99('0x43')]=function(_0x21e4c4,_0x829003){var _0xe8f2f={'raw':!![],'where':{'id':_0x21e4c4['params']['id']}},_0x232b68={};_0x232b68['model']=_[_0xdd99('0x30')](db[_0xdd99('0x29')][_0xdd99('0x2a')]);_0x232b68[_0xdd99('0x2f')]=_[_0xdd99('0x30')](_0x21e4c4[_0xdd99('0x2f')]);_0x232b68[_0xdd99('0x31')]=_[_0xdd99('0x32')](_0x232b68[_0xdd99('0x2d')],_0x232b68[_0xdd99('0x2f')]);_0xe8f2f[_0xdd99('0x33')]=_[_0xdd99('0x32')](_0x232b68[_0xdd99('0x2d')],qs[_0xdd99('0x34')](_0x21e4c4['query'][_0xdd99('0x34')]));_0xe8f2f['attributes']=_0xe8f2f[_0xdd99('0x33')][_0xdd99('0x35')]?_0xe8f2f[_0xdd99('0x33')]:_0x232b68['model'];if(_0x21e4c4[_0xdd99('0x2f')][_0xdd99('0x3f')]){_0xe8f2f['include']=[{'all':!![]}];}_0xe8f2f=_[_0xdd99('0x3d')]({},_0xe8f2f,_0x21e4c4[_0xdd99('0x44')]);return db['OpenchannelApplication']['find'](_0xe8f2f)[_0xdd99('0x24')](handleEntityNotFound(_0x829003,null))[_0xdd99('0x24')](respondWithResult(_0x829003,null))[_0xdd99('0x45')](handleError(_0x829003,null));};exports['create']=function(_0x21e161,_0x5167bf){return db['OpenchannelApplication'][_0xdd99('0x46')](_0x21e161[_0xdd99('0x47')],{})[_0xdd99('0x24')](respondWithResult(_0x5167bf,0xc9))[_0xdd99('0x45')](handleError(_0x5167bf,null));};exports[_0xdd99('0x23')]=function(_0x5ab53f,_0x586504){if(_0x5ab53f[_0xdd99('0x47')]['id']){delete _0x5ab53f[_0xdd99('0x47')]['id'];}return db[_0xdd99('0x29')]['find']({'where':{'id':_0x5ab53f[_0xdd99('0x48')]['id']}})['then'](handleEntityNotFound(_0x586504,null))[_0xdd99('0x24')](saveUpdates(_0x5ab53f['body'],null))['then'](respondWithResult(_0x586504,null))['catch'](handleError(_0x586504,null));};exports[_0xdd99('0x25')]=function(_0xca8341,_0x21d9f6){return db[_0xdd99('0x29')][_0xdd99('0x49')]({'where':{'id':_0xca8341[_0xdd99('0x48')]['id']}})[_0xdd99('0x24')](handleEntityNotFound(_0x21d9f6,null))[_0xdd99('0x24')](removeEntity(_0x21d9f6,null))[_0xdd99('0x45')](handleError(_0x21d9f6,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 239add2..600cae3 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 _0xa356=['api','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x174a87,_0xec9b92){var _0x41d0ea=function(_0x5e1767){while(--_0x5e1767){_0x174a87['push'](_0x174a87['shift']());}};_0x41d0ea(++_0xec9b92);}(_0xa356,0x1dd));var _0x6a35=function(_0x15b5bd,_0x32088e){_0x15b5bd=_0x15b5bd-0x0;var _0x38459b=_0xa356[_0x15b5bd];return _0x38459b;};'use strict';var _=require(_0x6a35('0x0'));var util=require(_0x6a35('0x1'));var logger=require(_0x6a35('0x2'))(_0x6a35('0x3'));var moment=require(_0x6a35('0x4'));var BPromise=require('bluebird');var rp=require(_0x6a35('0x5'));var fs=require('fs');var path=require(_0x6a35('0x6'));var rimraf=require(_0x6a35('0x7'));var config=require(_0x6a35('0x8'));var attributes=require(_0x6a35('0x9'));module[_0x6a35('0xa')]=function(_0x35e577,_0x4277e5){return _0x35e577[_0x6a35('0xb')]('OpenchannelApplication',attributes,{'tableName':_0x6a35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a35('0xd'),'collate':_0x6a35('0xe')});}; \ No newline at end of file +var _0x6ae4=['util','../../config/logger','api','bluebird','path','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x8c849a,_0x1a2719){var _0x2fe2b4=function(_0x6a640c){while(--_0x6a640c){_0x8c849a['push'](_0x8c849a['shift']());}};_0x2fe2b4(++_0x1a2719);}(_0x6ae4,0xa7));var _0x46ae=function(_0x189474,_0x144878){_0x189474=_0x189474-0x0;var _0x310fc2=_0x6ae4[_0x189474];return _0x310fc2;};'use strict';var _=require(_0x46ae('0x0'));var util=require(_0x46ae('0x1'));var logger=require(_0x46ae('0x2'))(_0x46ae('0x3'));var moment=require('moment');var BPromise=require(_0x46ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46ae('0x5'));var rimraf=require('rimraf');var config=require(_0x46ae('0x6'));var attributes=require(_0x46ae('0x7'));module[_0x46ae('0x8')]=function(_0x426a1e,_0x559cc6){return _0x426a1e[_0x46ae('0x9')](_0x46ae('0xa'),attributes,{'tableName':_0x46ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46ae('0xc'),'collate':_0x46ae('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 49e2cbd..04625af 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 _0x4a48=['error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','update','options','raw','where','attributes','UpdateOpenchannelApplication','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x227289,_0x1010e9){var _0x10f334=function(_0x19b5bc){while(--_0x19b5bc){_0x227289['push'](_0x227289['shift']());}};_0x10f334(++_0x1010e9);}(_0x4a48,0x67));var _0x84a4=function(_0x3eba74,_0x2b61d0){_0x3eba74=_0x3eba74-0x0;var _0xdce41e=_0x4a48[_0x3eba74];return _0xdce41e;};'use strict';var _=require(_0x84a4('0x0'));var util=require(_0x84a4('0x1'));var moment=require(_0x84a4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84a4('0x3'));var db=require(_0x84a4('0x4'))['db'];var utils=require(_0x84a4('0x5'));var logger=require(_0x84a4('0x6'))(_0x84a4('0x7'));var config=require(_0x84a4('0x8'));var jayson=require(_0x84a4('0x9'));var client=jayson['client'][_0x84a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xef0a6f,_0x251673,_0x3768a6){return new BPromise(function(_0x59a4ab,_0x25a3ce){return client[_0x84a4('0xb')](_0xef0a6f,_0x3768a6)[_0x84a4('0xc')](function(_0x2cd23c){logger[_0x84a4('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x251673,'request\x20sent');logger['debug'](_0x84a4('0xe'),_0x251673,_0x84a4('0xf'),JSON[_0x84a4('0x10')](_0x2cd23c));if(_0x2cd23c[_0x84a4('0x11')]){if(_0x2cd23c['error'][_0x84a4('0x12')]===0x1f4){logger[_0x84a4('0x11')](_0x84a4('0x13'),_0x251673,_0x2cd23c[_0x84a4('0x11')][_0x84a4('0x14')]);return _0x25a3ce(_0x2cd23c[_0x84a4('0x11')]['message']);}logger[_0x84a4('0x11')](_0x84a4('0x13'),_0x251673,_0x2cd23c[_0x84a4('0x11')][_0x84a4('0x14')]);return _0x59a4ab(_0x2cd23c['error'][_0x84a4('0x14')]);}else{logger['info'](_0x84a4('0x13'),_0x251673,'request\x20sent');_0x59a4ab(_0x2cd23c[_0x84a4('0x15')][_0x84a4('0x14')]);}})[_0x84a4('0x16')](function(_0x3d71a6){logger[_0x84a4('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x251673,_0x3d71a6);_0x25a3ce(_0x3d71a6);});});}exports['UpdateOpenchannelApplication']=function(_0xdd2474){var _0x17f8db=this;return new Promise(function(_0x11270b,_0x314d0e){return db['OpenchannelApplication'][_0x84a4('0x17')](_0xdd2474['body'],{'raw':_0xdd2474[_0x84a4('0x18')]?_0xdd2474[_0x84a4('0x18')][_0x84a4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdd2474[_0x84a4('0x18')]?_0xdd2474[_0x84a4('0x18')][_0x84a4('0x1a')]||null:null,'attributes':_0xdd2474[_0x84a4('0x18')]?_0xdd2474[_0x84a4('0x18')][_0x84a4('0x1b')]||null:null,'limit':_0xdd2474[_0x84a4('0x18')]?_0xdd2474[_0x84a4('0x18')]['limit']||null:null})[_0x84a4('0xc')](function(_0x5a2c59){logger[_0x84a4('0xd')](_0x84a4('0x1c'),_0xdd2474);logger[_0x84a4('0x1d')](_0x84a4('0x1c'),_0xdd2474,JSON[_0x84a4('0x10')](_0x5a2c59));_0x11270b(_0x5a2c59);})[_0x84a4('0x16')](function(_0x393400){logger['error'](_0x84a4('0x1c'),_0x393400[_0x84a4('0x14')],_0xdd2474);_0x314d0e(_0x17f8db[_0x84a4('0x11')](0x1f4,_0x393400[_0x84a4('0x14')]));});});}; \ No newline at end of file +var _0xa991=['message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x29de46,_0x4dc36c){var _0x32ea8d=function(_0x43ad20){while(--_0x43ad20){_0x29de46['push'](_0x29de46['shift']());}};_0x32ea8d(++_0x4dc36c);}(_0xa991,0x166));var _0x1a99=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xa991[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x1a99('0x0'));var moment=require(_0x1a99('0x1'));var BPromise=require(_0x1a99('0x2'));var rs=require(_0x1a99('0x3'));var fs=require('fs');var Redis=require(_0x1a99('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a99('0x5'));var logger=require(_0x1a99('0x6'))(_0x1a99('0x7'));var config=require(_0x1a99('0x8'));var jayson=require(_0x1a99('0x9'));var client=jayson['client'][_0x1a99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x322d09,_0x261b1c,_0x443907){return new BPromise(function(_0xda63d4,_0x23887a){return client[_0x1a99('0xb')](_0x322d09,_0x443907)[_0x1a99('0xc')](function(_0xae4d87){logger[_0x1a99('0xd')](_0x1a99('0xe'),_0x261b1c,'request\x20sent');logger[_0x1a99('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x261b1c,'request\x20sent',JSON[_0x1a99('0x10')](_0xae4d87));if(_0xae4d87[_0x1a99('0x11')]){if(_0xae4d87['error'][_0x1a99('0x12')]===0x1f4){logger[_0x1a99('0x11')](_0x1a99('0xe'),_0x261b1c,_0xae4d87[_0x1a99('0x11')][_0x1a99('0x13')]);return _0x23887a(_0xae4d87['error']['message']);}logger[_0x1a99('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x261b1c,_0xae4d87[_0x1a99('0x11')]['message']);return _0xda63d4(_0xae4d87[_0x1a99('0x11')][_0x1a99('0x13')]);}else{logger[_0x1a99('0xd')](_0x1a99('0xe'),_0x261b1c,'request\x20sent');_0xda63d4(_0xae4d87[_0x1a99('0x14')]['message']);}})[_0x1a99('0x15')](function(_0x2615d9){logger[_0x1a99('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x261b1c,_0x2615d9);_0x23887a(_0x2615d9);});});}exports[_0x1a99('0x16')]=function(_0x432228){var _0x6012a6=this;return new Promise(function(_0x459910,_0x9c29a5){return db[_0x1a99('0x17')][_0x1a99('0x18')](_0x432228['body'],{'raw':_0x432228[_0x1a99('0x19')]?_0x432228[_0x1a99('0x19')][_0x1a99('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x432228[_0x1a99('0x19')]?_0x432228['options'][_0x1a99('0x1b')]||null:null,'attributes':_0x432228[_0x1a99('0x19')]?_0x432228[_0x1a99('0x19')][_0x1a99('0x1c')]||null:null,'limit':_0x432228['options']?_0x432228[_0x1a99('0x19')]['limit']||null:null})[_0x1a99('0xc')](function(_0x53a4af){logger[_0x1a99('0xd')]('UpdateOpenchannelApplication',_0x432228);logger[_0x1a99('0xf')](_0x1a99('0x16'),_0x432228,JSON[_0x1a99('0x10')](_0x53a4af));_0x459910(_0x53a4af);})[_0x1a99('0x15')](function(_0x3d3829){logger[_0x1a99('0x11')](_0x1a99('0x16'),_0x3d3829[_0x1a99('0x13')],_0x432228);_0x9c29a5(_0x6012a6[_0x1a99('0x11')](0x1f4,_0x3d3829[_0x1a99('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 68e7a8d..cd22ac7 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 _0x3aba=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','openchannel','openchannelinteraction:addtags','openchannelinteraction:update','update','delete','tracked','openchannelinteraction:destroy','removeTags'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x3aba,0x14b));var _0xa3ab=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x3aba[_0x2ed8f3];return _0x525a55;};'use strict';var multer=require(_0xa3ab('0x0'));var util=require(_0xa3ab('0x1'));var path=require('path');var timeout=require(_0xa3ab('0x2'));var express=require(_0xa3ab('0x3'));var router=express[_0xa3ab('0x4')]();var fs_extra=require(_0xa3ab('0x5'));var auth=require(_0xa3ab('0x6'));var interaction=require(_0xa3ab('0x7'));var config=require(_0xa3ab('0x8'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0xa3ab('0x9')](),controller[_0xa3ab('0xa')]);router[_0xa3ab('0xb')]('/describe',auth[_0xa3ab('0x9')](),controller[_0xa3ab('0xc')]);router['get'](_0xa3ab('0xd'),auth['isAuthenticated'](),controller[_0xa3ab('0xe')]);router[_0xa3ab('0xb')](_0xa3ab('0xf'),auth[_0xa3ab('0x9')](),controller[_0xa3ab('0x10')]);router[_0xa3ab('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0xa3ab('0x11')]);router[_0xa3ab('0x12')]('/',auth[_0xa3ab('0x9')](),controller[_0xa3ab('0x13')]);router[_0xa3ab('0x12')]('/:id/messages',auth[_0xa3ab('0x9')](),controller['addMessage']);router[_0xa3ab('0x12')](_0xa3ab('0x14'),auth[_0xa3ab('0x9')](),interaction['tracked'](_0xa3ab('0x15'),_0xa3ab('0x16')),controller['addTags']);router['put']('/:id',auth[_0xa3ab('0x9')](),interaction['tracked']('openchannel',_0xa3ab('0x17')),controller[_0xa3ab('0x18')]);router[_0xa3ab('0x19')](_0xa3ab('0xd'),auth[_0xa3ab('0x9')](),interaction[_0xa3ab('0x1a')](_0xa3ab('0x15'),_0xa3ab('0x1b')),controller['destroy']);router[_0xa3ab('0x19')](_0xa3ab('0x14'),auth[_0xa3ab('0x9')](),controller[_0xa3ab('0x1c')]);module[_0xa3ab('0x1d')]=router; \ No newline at end of file +var _0xc1b7=['/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','post','addMessage'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xc1b7,0x190));var _0x7c1b=function(_0x578e76,_0x2047bb){_0x578e76=_0x578e76-0x0;var _0x26e58b=_0xc1b7[_0x578e76];return _0x26e58b;};'use strict';var multer=require(_0x7c1b('0x0'));var util=require(_0x7c1b('0x1'));var path=require(_0x7c1b('0x2'));var timeout=require('connect-timeout');var express=require(_0x7c1b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7c1b('0x4'));var interaction=require(_0x7c1b('0x5'));var config=require(_0x7c1b('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x7c1b('0x7')]('/',auth[_0x7c1b('0x8')](),controller['index']);router['get']('/describe',auth[_0x7c1b('0x8')](),controller[_0x7c1b('0x9')]);router[_0x7c1b('0x7')](_0x7c1b('0xa'),auth[_0x7c1b('0x8')](),controller[_0x7c1b('0xb')]);router[_0x7c1b('0x7')](_0x7c1b('0xc'),auth[_0x7c1b('0x8')](),controller['getMessages']);router[_0x7c1b('0x7')](_0x7c1b('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x7c1b('0xe')]('/',auth[_0x7c1b('0x8')](),controller['create']);router[_0x7c1b('0xe')](_0x7c1b('0xc'),auth['isAuthenticated'](),controller[_0x7c1b('0xf')]);router['post'](_0x7c1b('0x10'),auth[_0x7c1b('0x8')](),interaction[_0x7c1b('0x11')](_0x7c1b('0x12'),_0x7c1b('0x13')),controller['addTags']);router[_0x7c1b('0x14')](_0x7c1b('0xa'),auth[_0x7c1b('0x8')](),interaction[_0x7c1b('0x11')](_0x7c1b('0x12'),_0x7c1b('0x15')),controller[_0x7c1b('0x16')]);router[_0x7c1b('0x17')](_0x7c1b('0xa'),auth[_0x7c1b('0x8')](),interaction[_0x7c1b('0x11')](_0x7c1b('0x12'),'openchannelinteraction:destroy'),controller[_0x7c1b('0x18')]);router[_0x7c1b('0x17')](_0x7c1b('0x10'),auth[_0x7c1b('0x8')](),controller['removeTags']);module[_0x7c1b('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4021fdf..d84999e 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 _0xd786=['STRING','out','ENUM','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x1fc8f0,_0x177b1e){var _0x4e4c07=function(_0x27516b){while(--_0x27516b){_0x1fc8f0['push'](_0x1fc8f0['shift']());}};_0x4e4c07(++_0x177b1e);}(_0xd786,0x1dc));var _0x6d78=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd786[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x6d78('0x0'));module[_0x6d78('0x1')]={'closed':{'type':Sequelize[_0x6d78('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6d78('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6d78('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6d78('0x4')]},'note':{'type':Sequelize[_0x6d78('0x4')]},'read1stAt':{'type':Sequelize[_0x6d78('0x3')]},'threadId':{'type':Sequelize[_0x6d78('0x4')]},'externalUrl':{'type':Sequelize[_0x6d78('0x4')]},'lastMsgAt':{'type':Sequelize[_0x6d78('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6d78('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6d78('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6d78('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x6d78('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6d78('0x7')]}}; \ No newline at end of file +var _0xb9e7=['BOOLEAN','DATE','STRING','out','ENUM','exports'];(function(_0x5f54d0,_0x5123ca){var _0x277122=function(_0xc14ec3){while(--_0xc14ec3){_0x5f54d0['push'](_0x5f54d0['shift']());}};_0x277122(++_0x5123ca);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xb9e7[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require('sequelize');module[_0x7b9e('0x0')]={'closed':{'type':Sequelize[_0x7b9e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b9e('0x2')]},'disposition':{'type':Sequelize[_0x7b9e('0x3')]},'secondDisposition':{'type':Sequelize[_0x7b9e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7b9e('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7b9e('0x2')]},'threadId':{'type':Sequelize[_0x7b9e('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x7b9e('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b9e('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7b9e('0x5')]('in',_0x7b9e('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7b9e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x7b9e('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 6eb3118..65b99c7 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 _0x5bcb=['undefined','count','set','Content-Range','destroy','then','sendStatus','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','query','catch','from','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','includeAll','findAll','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','User','fullname','CmContact','Contact','lastName','push','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','Public','Private','pipe','createWriteStream','basename','direction','out','System','firstName','value','renderFile','views','downloadInteraction.ejs','.pdf','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','limit'];(function(_0x124fdf,_0x5b2a07){var _0x5402db=function(_0x40dd4d){while(--_0x40dd4d){_0x124fdf['push'](_0x124fdf['shift']());}};_0x5402db(++_0x5b2a07);}(_0x5bcb,0x1da));var _0xb5bc=function(_0xd10ed7,_0x49c553){_0xd10ed7=_0xd10ed7-0x0;var _0x47d67c=_0x5bcb[_0xd10ed7];return _0x47d67c;};'use strict';var rimraf=require(_0xb5bc('0x0'));var zipdir=require('zip-dir');var moment=require(_0xb5bc('0x1'));var util=require(_0xb5bc('0x2'));var path=require('path');var ejs=require(_0xb5bc('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xb5bc('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0xb5bc('0x5'));var pdf=require(_0xb5bc('0x6'));var logger=require('../../config/logger')('api');var config=require(_0xb5bc('0x7'));var db=require(_0xb5bc('0x8'))['db'];config[_0xb5bc('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb5bc('0xa'))(new Redis(config[_0xb5bc('0x9')]));require(_0xb5bc('0xb'))[_0xb5bc('0xc')](socket);function respondWithStatusCode(_0x29d4f3,_0x228f70){_0x228f70=_0x228f70||0xcc;return function(_0x44b48d){if(_0x44b48d){return _0x29d4f3['sendStatus'](_0x228f70);}return _0x29d4f3[_0xb5bc('0xd')](_0x228f70)[_0xb5bc('0xe')]();};}function respondWithResult(_0x1c4b67,_0x3cf588){_0x3cf588=_0x3cf588||0xc8;return function(_0x537b22){if(_0x537b22){return _0x1c4b67[_0xb5bc('0xd')](_0x3cf588)[_0xb5bc('0xf')](_0x537b22);}};}function respondWithFilteredResult(_0x6bd117,_0x330c37){return function(_0x1014c5){if(_0x1014c5){var _0x2aea63=typeof _0x330c37[_0xb5bc('0x10')]==='undefined'&&typeof _0x330c37[_0xb5bc('0x11')]===_0xb5bc('0x12');var _0x3fadd6=_0x1014c5[_0xb5bc('0x13')];var _0x4a457d=_0x2aea63?0x0:_0x330c37[_0xb5bc('0x10')];var _0x2d3f64=_0x2aea63?_0x1014c5['count']:_0x330c37[_0xb5bc('0x10')]+_0x330c37[_0xb5bc('0x11')];var _0x4c116b;if(_0x2d3f64>=_0x3fadd6){_0x2d3f64=_0x3fadd6;_0x4c116b=0xc8;}else{_0x4c116b=0xce;}_0x6bd117['status'](_0x4c116b);return _0x6bd117[_0xb5bc('0x14')](_0xb5bc('0x15'),_0x4a457d+'-'+_0x2d3f64+'/'+_0x3fadd6)[_0xb5bc('0xf')](_0x1014c5);}return null;};}function saveUpdates(_0x3cc399){return function(_0x3b332f){if(_0x3b332f){return _0x3b332f['update'](_0x3cc399)['then'](function(_0x8d41a2){return _0x8d41a2;});}return null;};}function removeEntity(_0x2d3c12){return function(_0x489c95){if(_0x489c95){return _0x489c95[_0xb5bc('0x16')]()[_0xb5bc('0x17')](function(){_0x2d3c12[_0xb5bc('0xd')](0xcc)[_0xb5bc('0xe')]();});}};}function handleEntityNotFound(_0x4a66bf){return function(_0x2e4035){if(!_0x2e4035){_0x4a66bf[_0xb5bc('0x18')](0x194);}return _0x2e4035;};}function handleError(_0x1d7bd1,_0xaa49f1){_0xaa49f1=_0xaa49f1||0x1f4;return function(_0x40888f){logger['error'](_0x40888f[_0xb5bc('0x19')]);if(_0x40888f[_0xb5bc('0x1a')]){delete _0x40888f['name'];}_0x1d7bd1[_0xb5bc('0xd')](_0xaa49f1)[_0xb5bc('0x1b')](_0x40888f);};}exports[_0xb5bc('0x1c')]=function(_0x4b5e9a,_0x28e5ba){var _0x389f99={};var _0x4fafed=_[_0xb5bc('0x1d')](db[_0xb5bc('0x1e')][_0xb5bc('0x1f')],function(_0x130cb9){return{'name':_0x130cb9[_0xb5bc('0x20')],'type':_0x130cb9[_0xb5bc('0x21')]['key']};});_0x389f99=qs['getOptions'](_0x4fafed,_0x4b5e9a);return interaction['findAll']('openchannel',_0x4b5e9a[_0xb5bc('0x22')],_0x4b5e9a['user'],_0x389f99,_0x4fafed)[_0xb5bc('0x17')](respondWithFilteredResult(_0x28e5ba,_0x389f99))[_0xb5bc('0x23')](handleError(_0x28e5ba,null));};exports['show']=function(_0x2653bf,_0x1f4302){var _0x56e8ba={};if(_0x2653bf['query'][_0xb5bc('0x21')]&&_0x2653bf[_0xb5bc('0x22')][_0xb5bc('0x21')]===_0xb5bc('0x24')){_0x56e8ba[_0xb5bc('0x24')]=_0x2653bf[_0xb5bc('0x25')]['id'];}else{_0x56e8ba['id']=_0x2653bf[_0xb5bc('0x25')]['id'];}var _0xcb1698={'raw':![],'where':_0x56e8ba},_0x41cace={};_0x41cace[_0xb5bc('0x26')]=_[_0xb5bc('0x27')](db[_0xb5bc('0x1e')][_0xb5bc('0x1f')]);_0x41cace[_0xb5bc('0x22')]=_[_0xb5bc('0x27')](_0x2653bf[_0xb5bc('0x22')]);_0x41cace[_0xb5bc('0x28')]=_[_0xb5bc('0x29')](_0x41cace['model'],_0x41cace[_0xb5bc('0x22')]);_0xcb1698[_0xb5bc('0x2a')]=_['intersection'](_0x41cace[_0xb5bc('0x26')],qs[_0xb5bc('0x2b')](_0x2653bf[_0xb5bc('0x22')][_0xb5bc('0x2b')]));_0xcb1698[_0xb5bc('0x2a')]=_0xcb1698[_0xb5bc('0x2a')][_0xb5bc('0x2c')]?_0xcb1698[_0xb5bc('0x2a')]:_0x41cace[_0xb5bc('0x26')];if(_0x2653bf[_0xb5bc('0x22')]['includeAll']){_0xcb1698[_0xb5bc('0x2d')]=[{'all':!![]}];}_0xcb1698=_[_0xb5bc('0x2e')]({},_0xcb1698,_0x2653bf[_0xb5bc('0x2f')]);return db[_0xb5bc('0x1e')][_0xb5bc('0x30')](_0xcb1698)['then'](handleEntityNotFound(_0x1f4302,null))[_0xb5bc('0x17')](respondWithResult(_0x1f4302,null))[_0xb5bc('0x23')](handleError(_0x1f4302,null));};exports[_0xb5bc('0x31')]=function(_0x5df7c9,_0x2e6adb){return db[_0xb5bc('0x1e')][_0xb5bc('0x31')](_0x5df7c9['body'],{})['then'](respondWithResult(_0x2e6adb,0xc9))[_0xb5bc('0x23')](handleError(_0x2e6adb,null));};exports['update']=function(_0x6e31f,_0x4030be){if(_0x6e31f[_0xb5bc('0x32')]['id']){delete _0x6e31f[_0xb5bc('0x32')]['id'];}return db[_0xb5bc('0x1e')][_0xb5bc('0x30')]({'where':{'id':_0x6e31f[_0xb5bc('0x25')]['id']}})[_0xb5bc('0x17')](handleEntityNotFound(_0x4030be,null))['then'](saveUpdates(_0x6e31f['body'],null))[_0xb5bc('0x17')](respondWithResult(_0x4030be,null))[_0xb5bc('0x23')](handleError(_0x4030be,null));};exports[_0xb5bc('0x16')]=function(_0x3f7103,_0x3d4e4b){return db[_0xb5bc('0x1e')][_0xb5bc('0x30')]({'where':{'id':_0x3f7103[_0xb5bc('0x25')]['id']}})['then'](handleEntityNotFound(_0x3d4e4b,null))['then'](removeEntity(_0x3d4e4b,null))[_0xb5bc('0x23')](handleError(_0x3d4e4b,null));};exports[_0xb5bc('0x33')]=function(_0x2a718c,_0x137912){return db[_0xb5bc('0x1e')]['describe']()[_0xb5bc('0x17')](respondWithResult(_0x137912,null))[_0xb5bc('0x23')](handleError(_0x137912,null));};exports[_0xb5bc('0x34')]=function(_0x525fec,_0x50b951){return db[_0xb5bc('0x35')][_0xb5bc('0x30')]({'where':{'id':_0x525fec[_0xb5bc('0x25')]['id']}})[_0xb5bc('0x17')](handleEntityNotFound(_0x50b951,null))[_0xb5bc('0x17')](function(_0x515651){if(_0x515651){return _0x515651[_0xb5bc('0x34')](_0x525fec[_0xb5bc('0x32')][_0xb5bc('0x36')],_['omit'](_0x525fec[_0xb5bc('0x32')],[_0xb5bc('0x36'),'id'])||{});}})['then'](respondWithResult(_0x50b951,null))[_0xb5bc('0x23')](handleError(_0x50b951,null));};exports[_0xb5bc('0x37')]=function(_0x4ef2a5,_0x2f5cc9){var _0x412402={'raw':![],'where':{}};var _0x4bde49={};var _0x495055={'count':0x0,'rows':[]};return db[_0xb5bc('0x1e')]['findOne']({'where':{'id':_0x4ef2a5['params']['id']}})[_0xb5bc('0x17')](handleEntityNotFound(_0x2f5cc9,null))[_0xb5bc('0x17')](function(_0x4d0ab8){if(_0x4d0ab8){_0x4bde49['model']=_['keys'](db[_0xb5bc('0x35')][_0xb5bc('0x1f')]);_0x4bde49[_0xb5bc('0x22')]=_[_0xb5bc('0x27')](_0x4ef2a5['query']);_0x4bde49[_0xb5bc('0x28')]=_[_0xb5bc('0x29')](_0x4bde49[_0xb5bc('0x26')],_0x4bde49['query']);_0x412402['attributes']=_[_0xb5bc('0x29')](_0x4bde49[_0xb5bc('0x26')],qs[_0xb5bc('0x2b')](_0x4ef2a5[_0xb5bc('0x22')][_0xb5bc('0x2b')]));_0x412402[_0xb5bc('0x2a')]=_0x412402[_0xb5bc('0x2a')][_0xb5bc('0x2c')]?_0x412402['attributes']:_0x4bde49[_0xb5bc('0x26')];if(!_0x4ef2a5[_0xb5bc('0x22')]['hasOwnProperty'](_0xb5bc('0x38'))){_0x412402[_0xb5bc('0x11')]=qs['limit'](_0x4ef2a5[_0xb5bc('0x22')][_0xb5bc('0x11')]);_0x412402[_0xb5bc('0x10')]=qs['offset'](_0x4ef2a5[_0xb5bc('0x22')][_0xb5bc('0x10')]);}_0x412402[_0xb5bc('0x39')]=qs[_0xb5bc('0x3a')](_0x4ef2a5[_0xb5bc('0x22')][_0xb5bc('0x3a')]);_0x412402[_0xb5bc('0x3b')]=qs[_0xb5bc('0x28')](_[_0xb5bc('0x3c')](_0x4ef2a5[_0xb5bc('0x22')],_0x4bde49[_0xb5bc('0x28')]));_0x412402['where'][_0xb5bc('0x3d')]=_0x4d0ab8['id'];if(_0x4ef2a5[_0xb5bc('0x22')][_0xb5bc('0x3e')]){_0x412402[_0xb5bc('0x3b')]=_['merge'](_0x412402[_0xb5bc('0x3b')],{'$or':_[_0xb5bc('0x1d')](_0x412402[_0xb5bc('0x2a')],function(_0x17133f){var _0x52678e={};_0x52678e[_0x17133f]={'$like':'%'+_0x4ef2a5[_0xb5bc('0x22')][_0xb5bc('0x3e')]+'%'};return _0x52678e;})});}if(_0x4ef2a5['query'][_0xb5bc('0x3f')]){var _0x6b25e5=_0x4ef2a5[_0xb5bc('0x22')]['$gte'][_0xb5bc('0x40')](',');var _0x50fb9a={};_0x50fb9a[_0x6b25e5[0x0]]={'$gte':moment(_0x6b25e5[0x1])[_0xb5bc('0x41')]('YYYY-MM-DD\x20HH:mm:ss')};_0x412402[_0xb5bc('0x3b')]=_[_0xb5bc('0x2e')](_0x412402[_0xb5bc('0x3b')],_0x50fb9a);}_0x412402=_['merge']({},_0x412402,_0x4ef2a5['options']);return db[_0xb5bc('0x35')]['count']({'where':_0x412402['where']})['then'](function(_0x483245){_0x495055[_0xb5bc('0x13')]=_0x483245;if(_0x4ef2a5['query'][_0xb5bc('0x42')]){_0x412402[_0xb5bc('0x2d')]=[{'all':!![]}];}return db[_0xb5bc('0x35')][_0xb5bc('0x43')](_0x412402);})[_0xb5bc('0x17')](function(_0x2a9806){_0x495055[_0xb5bc('0x44')]=_0x2a9806;return _0x495055;});}})[_0xb5bc('0x17')](respondWithFilteredResult(_0x2f5cc9,_0x412402))[_0xb5bc('0x23')](handleError(_0x2f5cc9,null));};exports['addTags']=function(_0x1f7ca8,_0x25eae4){return db[_0xb5bc('0x1e')][_0xb5bc('0x30')]({'where':{'id':_0x1f7ca8[_0xb5bc('0x25')]['id']}})[_0xb5bc('0x17')](handleEntityNotFound(_0x25eae4,null))['then'](function(_0x4331e3){if(_0x4331e3){return _0x4331e3[_0xb5bc('0x45')](_0x1f7ca8['body'][_0xb5bc('0x36')],_['omit'](_0x1f7ca8[_0xb5bc('0x32')],[_0xb5bc('0x36'),'id'])||{})[_0xb5bc('0x46')](function(){return db[_0xb5bc('0x47')]['findAll']({'attributes':['id',_0xb5bc('0x1a'),_0xb5bc('0x48')],'where':{'id':_0x1f7ca8[_0xb5bc('0x32')]['ids']}});})[_0xb5bc('0x17')](function(_0x5a1d35){socket[_0xb5bc('0x49')]('openchannelInteractionTags:save',{'id':Number(_0x1f7ca8[_0xb5bc('0x25')]['id']),'tags':_0x5a1d35||[]});return{'id':Number(_0x1f7ca8[_0xb5bc('0x25')]['id']),'tags':_0x5a1d35||[]};});}})[_0xb5bc('0x17')](respondWithResult(_0x25eae4,null))['catch'](handleError(_0x25eae4,null));};exports['removeTags']=function(_0x19e858,_0x58ccf6){return db['OpenchannelInteraction']['find']({'where':{'id':_0x19e858['params']['id']}})[_0xb5bc('0x17')](handleEntityNotFound(_0x58ccf6,null))[_0xb5bc('0x17')](function(_0x381e8e){if(_0x381e8e){return _0x381e8e[_0xb5bc('0x4a')](_0x19e858['query'][_0xb5bc('0x36')]);}})[_0xb5bc('0x17')](respondWithStatusCode(_0x58ccf6,null))['catch'](handleError(_0x58ccf6,null));};exports[_0xb5bc('0x4b')]=function(_0x554b87,_0x523dfb){var _0x1aa788=moment()[_0xb5bc('0x4c')]()[_0xb5bc('0x4d')]();var _0x4e19dc=path[_0xb5bc('0x4e')](config['root'],'server',_0xb5bc('0x4f'),_0xb5bc('0x50'));var _0x29aa43=path[_0xb5bc('0x4e')](config[_0xb5bc('0x51')],_0xb5bc('0x52'),_0xb5bc('0x4f'),_0xb5bc('0x53'));var _0x326af7=path[_0xb5bc('0x4e')](_0x4e19dc,_0x1aa788);var _0x250366=util['format'](_0xb5bc('0x54'),_0x554b87['params']['id'],_0x1aa788);var _0x4a4da2=path[_0xb5bc('0x4e')](_0x4e19dc,_0x250366);var _0x3724a1=[];_0x3724a1['push']({'model':db['User'],'as':_0xb5bc('0x55'),'attributes':['id',_0xb5bc('0x56')],'raw':!![]});_0x3724a1['push']({'model':db[_0xb5bc('0x57')],'as':_0xb5bc('0x58'),'attributes':['id','firstName',_0xb5bc('0x59')],'raw':!![]});if(_0x554b87[_0xb5bc('0x22')][_0xb5bc('0x53')]){_0x3724a1[_0xb5bc('0x5a')]({'model':db[_0xb5bc('0x5b')],'as':_0xb5bc('0x5b'),'raw':!![]});}var _0x541c26=[{'model':db[_0xb5bc('0x35')],'as':_0xb5bc('0x5c'),'attributes':['id',_0xb5bc('0x32'),_0xb5bc('0x5d'),'direction',_0xb5bc('0x5e'),_0xb5bc('0x5f')],'include':_0x3724a1}];_0x541c26['push']({'model':db[_0xb5bc('0x60')],'as':_0xb5bc('0x61'),'attributes':['id',_0xb5bc('0x1a')]});_0x541c26[_0xb5bc('0x5a')]({'model':db[_0xb5bc('0x55')],'as':_0xb5bc('0x62'),'attributes':['id','fullname']});return db['OpenchannelInteraction']['find']({'where':{'id':_0x554b87[_0xb5bc('0x25')]['id']},'include':_0x541c26})[_0xb5bc('0x17')](handleEntityNotFound(_0x523dfb,null))['then'](function(_0x3e0a37){if(_0x3e0a37){var _0x3c695e=_0x3e0a37[_0xb5bc('0x63')]({'plain':!![]});fs[_0xb5bc('0x64')](_0x326af7);var _0xab3913={'channel':_0xb5bc('0x65'),'account':_0x3c695e[_0xb5bc('0x61')][_0xb5bc('0x1a')],'agent':_0x3c695e[_0xb5bc('0x62')]?_0x3c695e[_0xb5bc('0x62')][_0xb5bc('0x56')]:'N.A.','createdAt':moment(_0x3c695e[_0xb5bc('0x5d')])[_0xb5bc('0x41')](_0xb5bc('0x66'))[_0xb5bc('0x4d')](),'closedAt':_0x3c695e[_0xb5bc('0x67')]?moment(_0x3c695e[_0xb5bc('0x68')])[_0xb5bc('0x41')](_0xb5bc('0x66'))[_0xb5bc('0x4d')]():'','disposition':_0x3c695e['disposition'],'visibility':_0x3c695e[_0xb5bc('0x69')]?_0xb5bc('0x6a'):_0xb5bc('0x6b'),'messages':_(_0x3c695e[_0xb5bc('0x5c')])[_0xb5bc('0x3e')]({'secret':![]})[_0xb5bc('0x1d')](function(_0x239e53){if(_0x239e53[_0xb5bc('0x5b')]){var _0xebd3cf=path[_0xb5bc('0x4e')](_0x29aa43,_0x239e53[_0xb5bc('0x5b')]['basename']);if(fs['existsSync'](_0xebd3cf)){fs['createReadStream'](_0xebd3cf)[_0xb5bc('0x6c')](fs[_0xb5bc('0x6d')](path[_0xb5bc('0x4e')](_0x326af7,_0x239e53[_0xb5bc('0x5b')][_0xb5bc('0x6e')])));}}return{'date':moment(_0x239e53[_0xb5bc('0x5d')])[_0xb5bc('0x41')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb5bc('0x4d')](),'sender':_0x239e53[_0xb5bc('0x6f')]===_0xb5bc('0x70')?_0x239e53['User']?_0x239e53['User'][_0xb5bc('0x56')]:_0xb5bc('0x71'):_0x239e53[_0xb5bc('0x58')][_0xb5bc('0x72')]+(_0x239e53[_0xb5bc('0x58')][_0xb5bc('0x59')]?'\x20'+_0x239e53['Contact']['lastName']:''),'body':_0x239e53[_0xb5bc('0x5b')]?_0x239e53[_0xb5bc('0x5b')][_0xb5bc('0x6e')]:_0x239e53['body'],'direction':_0x239e53[_0xb5bc('0x6f')]===_0xb5bc('0x70')?'A':'C','secret':_0x239e53[_0xb5bc('0x5e')],'read':_0x239e53[_0xb5bc('0x5f')],'attachment':_0x239e53['Attachment']};})[_0xb5bc('0x73')]()};return ejs[_0xb5bc('0x74')](path[_0xb5bc('0x4e')](config['root'],'server',_0xb5bc('0x75'),_0xb5bc('0x76')),{'interaction':_0xab3913})[_0xb5bc('0x17')](function(_0x4aaa33){var _0x4e43a7=path[_0xb5bc('0x4e')](_0x326af7,'transcript-'+_0x3c695e['id']+'-'+_0x1aa788+_0xb5bc('0x77'));var _0x456565={'path':_0x4e43a7,'channel':_0xb5bc('0x65'),'interactionId':_0x3c695e['id']};return pdf['createPdfFromHTML'](_0x4aaa33,_0x456565);})[_0xb5bc('0x17')](function(){return new Promise(function(_0x27e112,_0x389320){zipdir(_0x326af7,{'saveTo':_0x4a4da2},function(_0x5019b6,_0x11add4){if(_0x5019b6)return _0x389320(_0x5019b6);return _0x27e112(_0x11add4);});})[_0xb5bc('0x17')](function(){return new Promise(function(_0x32f211,_0x25ba75){rimraf(_0x326af7,function(_0x320c75){if(_0x320c75)_0x25ba75(_0x320c75);return _0x32f211();});});})[_0xb5bc('0x17')](function(){return _0x523dfb[_0xb5bc('0x4b')](_0x4a4da2,_0x250366,function(_0x327912){if(_0x327912){logger[_0xb5bc('0x78')](_0xb5bc('0x79'),_0x327912);}else{fs[_0xb5bc('0x7a')](_0x4a4da2);}});});});}else{return _0x523dfb[_0xb5bc('0x18')](0xc8);}})[_0xb5bc('0x23')](handleError(_0x523dfb,null));}; \ No newline at end of file +var _0x58b9=['findAll','openchannel','user','catch','show','type','query','from','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','OpenchannelMessage','ids','getMessages','filters','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','join','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','read','Owner','get','mkdirSync','Openchannel','Account','toString','closedAt','disposition','threadId','Public','pipe','createWriteStream','basename','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','error','zip-dir','moment','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','offset','undefined','limit','count','set','Content-Range','json','then','sendStatus','stack','name','send','index','map','OpenchannelInteraction','fieldName','key'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x58b9,0x1cb));var _0x958b=function(_0x1555bd,_0x49a485){_0x1555bd=_0x1555bd-0x0;var _0x1dc784=_0x58b9[_0x1555bd];return _0x1dc784;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x958b('0x0'));var moment=require(_0x958b('0x1'));var util=require(_0x958b('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x958b('0x3'));var Redis=require(_0x958b('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x958b('0x5'));var pdf=require('../../components/export/pdf');var logger=require(_0x958b('0x6'))('api');var config=require(_0x958b('0x7'));var db=require(_0x958b('0x8'))['db'];config['redis']=_[_0x958b('0x9')](config[_0x958b('0xa')],{'host':_0x958b('0xb'),'port':0x18eb});var socket=require(_0x958b('0xc'))(new Redis(config[_0x958b('0xa')]));require(_0x958b('0xd'))['register'](socket);function respondWithStatusCode(_0xb81dbe,_0x29b75a){_0x29b75a=_0x29b75a||0xcc;return function(_0x2156e0){if(_0x2156e0){return _0xb81dbe['sendStatus'](_0x29b75a);}return _0xb81dbe[_0x958b('0xe')](_0x29b75a)[_0x958b('0xf')]();};}function respondWithResult(_0x2ccaf3,_0x5e08dd){_0x5e08dd=_0x5e08dd||0xc8;return function(_0x52cd77){if(_0x52cd77){return _0x2ccaf3[_0x958b('0xe')](_0x5e08dd)['json'](_0x52cd77);}};}function respondWithFilteredResult(_0x4dfc48,_0x93dd64){return function(_0x11ffd4){if(_0x11ffd4){var _0x9b86f6=typeof _0x93dd64[_0x958b('0x10')]===_0x958b('0x11')&&typeof _0x93dd64[_0x958b('0x12')]===_0x958b('0x11');var _0x2b4f7b=_0x11ffd4[_0x958b('0x13')];var _0x1a4c99=_0x9b86f6?0x0:_0x93dd64[_0x958b('0x10')];var _0x3f5c3b=_0x9b86f6?_0x11ffd4[_0x958b('0x13')]:_0x93dd64['offset']+_0x93dd64[_0x958b('0x12')];var _0x588854;if(_0x3f5c3b>=_0x2b4f7b){_0x3f5c3b=_0x2b4f7b;_0x588854=0xc8;}else{_0x588854=0xce;}_0x4dfc48[_0x958b('0xe')](_0x588854);return _0x4dfc48[_0x958b('0x14')](_0x958b('0x15'),_0x1a4c99+'-'+_0x3f5c3b+'/'+_0x2b4f7b)[_0x958b('0x16')](_0x11ffd4);}return null;};}function saveUpdates(_0x235227){return function(_0x3eccc1){if(_0x3eccc1){return _0x3eccc1['update'](_0x235227)[_0x958b('0x17')](function(_0x3dcd6e){return _0x3dcd6e;});}return null;};}function removeEntity(_0x2c8bfd){return function(_0x52c2f9){if(_0x52c2f9){return _0x52c2f9['destroy']()['then'](function(){_0x2c8bfd[_0x958b('0xe')](0xcc)[_0x958b('0xf')]();});}};}function handleEntityNotFound(_0x4365d9){return function(_0x2f5680){if(!_0x2f5680){_0x4365d9[_0x958b('0x18')](0x194);}return _0x2f5680;};}function handleError(_0x186154,_0x34c23b){_0x34c23b=_0x34c23b||0x1f4;return function(_0x102c10){logger['error'](_0x102c10[_0x958b('0x19')]);if(_0x102c10['name']){delete _0x102c10[_0x958b('0x1a')];}_0x186154[_0x958b('0xe')](_0x34c23b)[_0x958b('0x1b')](_0x102c10);};}exports[_0x958b('0x1c')]=function(_0x4ab058,_0x424679){var _0xffd848={};var _0x4362ea=_[_0x958b('0x1d')](db[_0x958b('0x1e')]['rawAttributes'],function(_0xc1005d){return{'name':_0xc1005d[_0x958b('0x1f')],'type':_0xc1005d['type'][_0x958b('0x20')]};});_0xffd848=qs['getOptions'](_0x4362ea,_0x4ab058);return interaction[_0x958b('0x21')](_0x958b('0x22'),_0x4ab058['query'],_0x4ab058[_0x958b('0x23')],_0xffd848,_0x4362ea)['then'](respondWithFilteredResult(_0x424679,_0xffd848))[_0x958b('0x24')](handleError(_0x424679,null));};exports[_0x958b('0x25')]=function(_0x3a617c,_0x136337){var _0x193b30={};if(_0x3a617c['query'][_0x958b('0x26')]&&_0x3a617c[_0x958b('0x27')][_0x958b('0x26')]===_0x958b('0x28')){_0x193b30[_0x958b('0x28')]=_0x3a617c[_0x958b('0x29')]['id'];}else{_0x193b30['id']=_0x3a617c[_0x958b('0x29')]['id'];}var _0x537e12={'raw':![],'where':_0x193b30},_0x59613b={};_0x59613b[_0x958b('0x2a')]=_[_0x958b('0x2b')](db['OpenchannelInteraction'][_0x958b('0x2c')]);_0x59613b[_0x958b('0x27')]=_['keys'](_0x3a617c[_0x958b('0x27')]);_0x59613b['filters']=_[_0x958b('0x2d')](_0x59613b[_0x958b('0x2a')],_0x59613b[_0x958b('0x27')]);_0x537e12[_0x958b('0x2e')]=_[_0x958b('0x2d')](_0x59613b['model'],qs[_0x958b('0x2f')](_0x3a617c['query']['fields']));_0x537e12[_0x958b('0x2e')]=_0x537e12[_0x958b('0x2e')][_0x958b('0x30')]?_0x537e12[_0x958b('0x2e')]:_0x59613b[_0x958b('0x2a')];if(_0x3a617c['query'][_0x958b('0x31')]){_0x537e12[_0x958b('0x32')]=[{'all':!![]}];}_0x537e12=_[_0x958b('0x33')]({},_0x537e12,_0x3a617c[_0x958b('0x34')]);return db[_0x958b('0x1e')][_0x958b('0x35')](_0x537e12)[_0x958b('0x17')](handleEntityNotFound(_0x136337,null))[_0x958b('0x17')](respondWithResult(_0x136337,null))['catch'](handleError(_0x136337,null));};exports[_0x958b('0x36')]=function(_0x19cc77,_0x4125b3){return db[_0x958b('0x1e')][_0x958b('0x36')](_0x19cc77[_0x958b('0x37')],{})[_0x958b('0x17')](respondWithResult(_0x4125b3,0xc9))['catch'](handleError(_0x4125b3,null));};exports[_0x958b('0x38')]=function(_0x3681c8,_0x7e5c29){if(_0x3681c8[_0x958b('0x37')]['id']){delete _0x3681c8[_0x958b('0x37')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x3681c8[_0x958b('0x29')]['id']}})[_0x958b('0x17')](handleEntityNotFound(_0x7e5c29,null))[_0x958b('0x17')](saveUpdates(_0x3681c8[_0x958b('0x37')],null))['then'](respondWithResult(_0x7e5c29,null))['catch'](handleError(_0x7e5c29,null));};exports['destroy']=function(_0x17e845,_0x1380e5){return db[_0x958b('0x1e')][_0x958b('0x35')]({'where':{'id':_0x17e845[_0x958b('0x29')]['id']}})[_0x958b('0x17')](handleEntityNotFound(_0x1380e5,null))['then'](removeEntity(_0x1380e5,null))[_0x958b('0x24')](handleError(_0x1380e5,null));};exports[_0x958b('0x39')]=function(_0x6ff9f0,_0x4d1478){return db['OpenchannelInteraction'][_0x958b('0x39')]()[_0x958b('0x17')](respondWithResult(_0x4d1478,null))[_0x958b('0x24')](handleError(_0x4d1478,null));};exports[_0x958b('0x3a')]=function(_0x182c7a,_0x3fb0ae){return db[_0x958b('0x3b')]['find']({'where':{'id':_0x182c7a[_0x958b('0x29')]['id']}})[_0x958b('0x17')](handleEntityNotFound(_0x3fb0ae,null))[_0x958b('0x17')](function(_0x4b263a){if(_0x4b263a){return _0x4b263a[_0x958b('0x3a')](_0x182c7a['body'][_0x958b('0x3c')],_['omit'](_0x182c7a['body'],[_0x958b('0x3c'),'id'])||{});}})[_0x958b('0x17')](respondWithResult(_0x3fb0ae,null))[_0x958b('0x24')](handleError(_0x3fb0ae,null));};exports[_0x958b('0x3d')]=function(_0x2f8da1,_0x528238){var _0x2981a6={'raw':![],'where':{}};var _0x38043b={};var _0x4abe9b={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x2f8da1[_0x958b('0x29')]['id']}})[_0x958b('0x17')](handleEntityNotFound(_0x528238,null))[_0x958b('0x17')](function(_0x307170){if(_0x307170){_0x38043b['model']=_['keys'](db[_0x958b('0x3b')][_0x958b('0x2c')]);_0x38043b[_0x958b('0x27')]=_[_0x958b('0x2b')](_0x2f8da1[_0x958b('0x27')]);_0x38043b[_0x958b('0x3e')]=_['intersection'](_0x38043b[_0x958b('0x2a')],_0x38043b[_0x958b('0x27')]);_0x2981a6['attributes']=_[_0x958b('0x2d')](_0x38043b[_0x958b('0x2a')],qs['fields'](_0x2f8da1[_0x958b('0x27')]['fields']));_0x2981a6[_0x958b('0x2e')]=_0x2981a6['attributes'][_0x958b('0x30')]?_0x2981a6[_0x958b('0x2e')]:_0x38043b['model'];if(!_0x2f8da1['query'][_0x958b('0x3f')](_0x958b('0x40'))){_0x2981a6['limit']=qs[_0x958b('0x12')](_0x2f8da1[_0x958b('0x27')][_0x958b('0x12')]);_0x2981a6[_0x958b('0x10')]=qs[_0x958b('0x10')](_0x2f8da1[_0x958b('0x27')][_0x958b('0x10')]);}_0x2981a6['order']=qs[_0x958b('0x41')](_0x2f8da1[_0x958b('0x27')][_0x958b('0x41')]);_0x2981a6[_0x958b('0x42')]=qs[_0x958b('0x3e')](_[_0x958b('0x43')](_0x2f8da1[_0x958b('0x27')],_0x38043b[_0x958b('0x3e')]));_0x2981a6['where'][_0x958b('0x44')]=_0x307170['id'];if(_0x2f8da1[_0x958b('0x27')][_0x958b('0x45')]){_0x2981a6[_0x958b('0x42')]=_[_0x958b('0x33')](_0x2981a6[_0x958b('0x42')],{'$or':_[_0x958b('0x1d')](_0x2981a6[_0x958b('0x2e')],function(_0x3c804a){var _0x179324={};_0x179324[_0x3c804a]={'$like':'%'+_0x2f8da1[_0x958b('0x27')]['filter']+'%'};return _0x179324;})});}if(_0x2f8da1[_0x958b('0x27')]['$gte']){var _0x251e17=_0x2f8da1['query'][_0x958b('0x46')][_0x958b('0x47')](',');var _0x1e86c3={};_0x1e86c3[_0x251e17[0x0]]={'$gte':moment(_0x251e17[0x1])['format'](_0x958b('0x48'))};_0x2981a6['where']=_[_0x958b('0x33')](_0x2981a6[_0x958b('0x42')],_0x1e86c3);}_0x2981a6=_[_0x958b('0x33')]({},_0x2981a6,_0x2f8da1['options']);return db['OpenchannelMessage'][_0x958b('0x13')]({'where':_0x2981a6[_0x958b('0x42')]})['then'](function(_0x1664b3){_0x4abe9b[_0x958b('0x13')]=_0x1664b3;if(_0x2f8da1[_0x958b('0x27')][_0x958b('0x31')]){_0x2981a6['include']=[{'all':!![]}];}return db[_0x958b('0x3b')][_0x958b('0x21')](_0x2981a6);})[_0x958b('0x17')](function(_0x1fb390){_0x4abe9b[_0x958b('0x49')]=_0x1fb390;return _0x4abe9b;});}})['then'](respondWithFilteredResult(_0x528238,_0x2981a6))['catch'](handleError(_0x528238,null));};exports[_0x958b('0x4a')]=function(_0x47a467,_0x12bcb9){return db[_0x958b('0x1e')][_0x958b('0x35')]({'where':{'id':_0x47a467['params']['id']}})[_0x958b('0x17')](handleEntityNotFound(_0x12bcb9,null))[_0x958b('0x17')](function(_0x4e182d){if(_0x4e182d){return _0x4e182d['setTags'](_0x47a467[_0x958b('0x37')][_0x958b('0x3c')],_['omit'](_0x47a467[_0x958b('0x37')],[_0x958b('0x3c'),'id'])||{})[_0x958b('0x4b')](function(){return db[_0x958b('0x4c')][_0x958b('0x21')]({'attributes':['id',_0x958b('0x1a'),_0x958b('0x4d')],'where':{'id':_0x47a467['body'][_0x958b('0x3c')]}});})[_0x958b('0x17')](function(_0x9f61f2){socket[_0x958b('0x4e')](_0x958b('0x4f'),{'id':Number(_0x47a467[_0x958b('0x29')]['id']),'tags':_0x9f61f2||[]});return{'id':Number(_0x47a467[_0x958b('0x29')]['id']),'tags':_0x9f61f2||[]};});}})[_0x958b('0x17')](respondWithResult(_0x12bcb9,null))['catch'](handleError(_0x12bcb9,null));};exports[_0x958b('0x50')]=function(_0x325bf8,_0x196a7e){return db[_0x958b('0x1e')][_0x958b('0x35')]({'where':{'id':_0x325bf8[_0x958b('0x29')]['id']}})[_0x958b('0x17')](handleEntityNotFound(_0x196a7e,null))[_0x958b('0x17')](function(_0x1ad515){if(_0x1ad515){return _0x1ad515[_0x958b('0x50')](_0x325bf8['query'][_0x958b('0x3c')]);}})['then'](respondWithStatusCode(_0x196a7e,null))['catch'](handleError(_0x196a7e,null));};exports[_0x958b('0x51')]=function(_0x563cc6,_0x508758){var _0x2381de=moment()[_0x958b('0x52')]()['toString']();var _0x277a30=path['join'](config[_0x958b('0x53')],_0x958b('0x54'),'files','tmp');var _0x5bb13a=path['join'](config[_0x958b('0x53')],_0x958b('0x54'),'files','attachments');var _0x33363f=path[_0x958b('0x55')](_0x277a30,_0x2381de);var _0x5112e6=util[_0x958b('0x56')](_0x958b('0x57'),_0x563cc6[_0x958b('0x29')]['id'],_0x2381de);var _0x5201ab=path[_0x958b('0x55')](_0x277a30,_0x5112e6);var _0x15fadd=[];_0x15fadd[_0x958b('0x58')]({'model':db['User'],'as':_0x958b('0x59'),'attributes':['id',_0x958b('0x5a')],'raw':!![]});_0x15fadd['push']({'model':db['CmContact'],'as':_0x958b('0x5b'),'attributes':['id',_0x958b('0x5c'),'lastName'],'raw':!![]});if(_0x563cc6[_0x958b('0x27')][_0x958b('0x5d')]){_0x15fadd['push']({'model':db[_0x958b('0x5e')],'as':_0x958b('0x5e'),'raw':!![]});}var _0x5de101=[{'model':db[_0x958b('0x3b')],'as':_0x958b('0x5f'),'attributes':['id',_0x958b('0x37'),_0x958b('0x60'),_0x958b('0x61'),_0x958b('0x62'),_0x958b('0x63')],'include':_0x15fadd}];_0x5de101[_0x958b('0x58')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x958b('0x1a')]});_0x5de101['push']({'model':db[_0x958b('0x59')],'as':_0x958b('0x64'),'attributes':['id',_0x958b('0x5a')]});return db[_0x958b('0x1e')]['find']({'where':{'id':_0x563cc6[_0x958b('0x29')]['id']},'include':_0x5de101})[_0x958b('0x17')](handleEntityNotFound(_0x508758,null))['then'](function(_0xa72bc4){if(_0xa72bc4){var _0x22cb25=_0xa72bc4[_0x958b('0x65')]({'plain':!![]});fs[_0x958b('0x66')](_0x33363f);var _0x525f02={'channel':_0x958b('0x67'),'account':_0x22cb25[_0x958b('0x68')][_0x958b('0x1a')],'agent':_0x22cb25[_0x958b('0x64')]?_0x22cb25['Owner'][_0x958b('0x5a')]:'N.A.','createdAt':moment(_0x22cb25[_0x958b('0x60')])[_0x958b('0x56')](_0x958b('0x48'))[_0x958b('0x69')](),'closedAt':_0x22cb25['closed']?moment(_0x22cb25[_0x958b('0x6a')])[_0x958b('0x56')]('YYYY-MM-DD\x20HH:mm:ss')[_0x958b('0x69')]():'','disposition':_0x22cb25[_0x958b('0x6b')],'visibility':_0x22cb25[_0x958b('0x6c')]?_0x958b('0x6d'):'Private','messages':_(_0x22cb25[_0x958b('0x5f')])['filter']({'secret':![]})[_0x958b('0x1d')](function(_0x225507){if(_0x225507[_0x958b('0x5e')]){var _0x118b41=path[_0x958b('0x55')](_0x5bb13a,_0x225507[_0x958b('0x5e')]['basename']);if(fs['existsSync'](_0x118b41)){fs['createReadStream'](_0x118b41)[_0x958b('0x6e')](fs[_0x958b('0x6f')](path[_0x958b('0x55')](_0x33363f,_0x225507[_0x958b('0x5e')][_0x958b('0x70')])));}}return{'date':moment(_0x225507[_0x958b('0x60')])[_0x958b('0x56')](_0x958b('0x48'))[_0x958b('0x69')](),'sender':_0x225507[_0x958b('0x61')]===_0x958b('0x71')?_0x225507['User']?_0x225507['User'][_0x958b('0x5a')]:_0x958b('0x72'):_0x225507[_0x958b('0x5b')][_0x958b('0x5c')]+(_0x225507[_0x958b('0x5b')]['lastName']?'\x20'+_0x225507['Contact']['lastName']:''),'body':_0x225507[_0x958b('0x5e')]?_0x225507[_0x958b('0x5e')]['basename']:_0x225507[_0x958b('0x37')],'direction':_0x225507[_0x958b('0x61')]===_0x958b('0x71')?'A':'C','secret':_0x225507['secret'],'read':_0x225507['read'],'attachment':_0x225507[_0x958b('0x5e')]};})[_0x958b('0x73')]()};return ejs[_0x958b('0x74')](path[_0x958b('0x55')](config['root'],_0x958b('0x54'),_0x958b('0x75'),_0x958b('0x76')),{'interaction':_0x525f02})['then'](function(_0x50572e){var _0x45f6be=path['join'](_0x33363f,_0x958b('0x77')+_0x22cb25['id']+'-'+_0x2381de+_0x958b('0x78'));var _0x43c3fd={'path':_0x45f6be,'channel':_0x958b('0x67'),'interactionId':_0x22cb25['id']};return pdf[_0x958b('0x79')](_0x50572e,_0x43c3fd);})[_0x958b('0x17')](function(){return new Promise(function(_0x33d62e,_0x3dac73){zipdir(_0x33363f,{'saveTo':_0x5201ab},function(_0xa55a0b,_0x5bba3f){if(_0xa55a0b)return _0x3dac73(_0xa55a0b);return _0x33d62e(_0x5bba3f);});})[_0x958b('0x17')](function(){return new Promise(function(_0x263ec8,_0x300a7e){rimraf(_0x33363f,function(_0xa5cf5a){if(_0xa5cf5a)_0x300a7e(_0xa5cf5a);return _0x263ec8();});});})[_0x958b('0x17')](function(){return _0x508758[_0x958b('0x51')](_0x5201ab,_0x5112e6,function(_0x3d0880){if(_0x3d0880){logger[_0x958b('0x7a')]('Unable\x20to\x20delete\x20zip\x20file',_0x3d0880);}else{fs['unlinkSync'](_0x5201ab);}});});});}else{return _0x508758[_0x958b('0x18')](0xc8);}})[_0x958b('0x24')](handleError(_0x508758,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index b87d496..27042a5 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 _0x157f=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x157f,0xfe));var _0xf157=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x157f[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xf157('0x0'));var OpenchannelInteraction=require(_0xf157('0x1'))['db'][_0xf157('0x2')];var OpenchannelMessage=require(_0xf157('0x1'))['db'][_0xf157('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf157('0x4')](0x0);var events={'afterCreate':_0xf157('0x5'),'afterUpdate':_0xf157('0x6'),'afterDestroy':_0xf157('0x7')};function emitEvent(_0x47c4ea){return function(_0x7ee72,_0x10e187,_0x2190b3){_0x7ee72[_0xf157('0x8')]({'attributes':['id'],'raw':!![]})[_0xf157('0x9')](function(_0x456fdf){_0x7ee72[_0xf157('0xa')](_0xf157('0xb'),_0x456fdf[_0xf157('0xc')](function(_0x143ca2){return{'id':_0x143ca2['id']};}));return OpenchannelMessage[_0xf157('0xd')]({'where':{'OpenchannelInteractionId':_0x7ee72['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf157('0x9')](function(_0x44b6eb){_0x7ee72[_0xf157('0xa')](_0xf157('0xe'),_0x44b6eb[_0xf157('0xf')]);OpenchannelInteractionEvents['emit'](_0x47c4ea+':'+_0x7ee72['id'],_0x7ee72);OpenchannelInteractionEvents[_0xf157('0x10')](_0x47c4ea,_0x7ee72);_0x2190b3(null);})[_0xf157('0x11')](_0x2190b3(null));};}for(var e in events){if(events[_0xf157('0x12')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xf157('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x04cf=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x04cf,0x139));var _0xf04c=function(_0x322d2e,_0x2b40bd){_0x322d2e=_0x322d2e-0x0;var _0x37b53f=_0x04cf[_0x322d2e];return _0x37b53f;};'use strict';var EventEmitter=require(_0xf04c('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xf04c('0x1'))['db'][_0xf04c('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf04c('0x3')](0x0);var events={'afterCreate':_0xf04c('0x4'),'afterUpdate':_0xf04c('0x5'),'afterDestroy':_0xf04c('0x6')};function emitEvent(_0x204e96){return function(_0x1a4f66,_0x4e37db,_0x6a64c7){_0x1a4f66[_0xf04c('0x7')]({'attributes':['id'],'raw':!![]})[_0xf04c('0x8')](function(_0x2ac9ef){_0x1a4f66[_0xf04c('0x9')](_0xf04c('0xa'),_0x2ac9ef[_0xf04c('0xb')](function(_0x47216c){return{'id':_0x47216c['id']};}));return OpenchannelMessage[_0xf04c('0xc')]({'where':{'OpenchannelInteractionId':_0x1a4f66['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf04c('0x8')](function(_0x1712e6){_0x1a4f66[_0xf04c('0x9')](_0xf04c('0xd'),_0x1712e6[_0xf04c('0xe')]);OpenchannelInteractionEvents['emit'](_0x204e96+':'+_0x1a4f66['id'],_0x1a4f66);OpenchannelInteractionEvents[_0xf04c('0xf')](_0x204e96,_0x1a4f66);_0x6a64c7(null);})[_0xf04c('0x10')](_0x6a64c7(null));};}for(var e in events){if(events[_0xf04c('0x11')](e)){var event=events[e];OpenchannelInteraction[_0xf04c('0x12')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 4c273f1..de24ff7 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 _0x2888=['changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x45789a,_0x1894c7){var _0x1f58e3=function(_0x29e05a){while(--_0x29e05a){_0x45789a['push'](_0x45789a['shift']());}};_0x1f58e3(++_0x1894c7);}(_0x2888,0x102));var _0x8288=function(_0x59a701,_0x2a5936){_0x59a701=_0x59a701-0x0;var _0x2ee66d=_0x2888[_0x59a701];return _0x2ee66d;};'use strict';var _=require(_0x8288('0x0'));var util=require(_0x8288('0x1'));var logger=require(_0x8288('0x2'))(_0x8288('0x3'));var moment=require(_0x8288('0x4'));var BPromise=require('bluebird');var rp=require(_0x8288('0x5'));var fs=require('fs');var path=require(_0x8288('0x6'));var rimraf=require(_0x8288('0x7'));var config=require(_0x8288('0x8'));var attributes=require(_0x8288('0x9'));module['exports']=function(_0x99cf18,_0x5bb122){return _0x99cf18[_0x8288('0xa')](_0x8288('0xb'),attributes,{'tableName':_0x8288('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8288('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5477a1,_0x11f42e,_0x327984){if(_0x5477a1[_0x8288('0xe')]('closed')){_0x5477a1['closedAt']=moment()[_0x8288('0xf')](_0x8288('0x10'));}_0x327984(null,_0x5477a1);}}});}; \ No newline at end of file +var _0x6ab5=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x6ab5,0x7c));var _0x56ab=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6ab5[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x56ab('0x0'));var util=require(_0x56ab('0x1'));var logger=require(_0x56ab('0x2'))(_0x56ab('0x3'));var moment=require(_0x56ab('0x4'));var BPromise=require('bluebird');var rp=require(_0x56ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56ab('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x56ab('0x7')]=function(_0x47dac2,_0x266efe){return _0x47dac2[_0x56ab('0x8')](_0x56ab('0x9'),attributes,{'tableName':_0x56ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x56ab('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5cfc4e,_0x5c69dc,_0x5ed2d2){if(_0x5cfc4e[_0x56ab('0xc')](_0x56ab('0xd'))){_0x5cfc4e[_0x56ab('0xe')]=moment()[_0x56ab('0xf')](_0x56ab('0x10'));}_0x5ed2d2(null,_0x5cfc4e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 12db26a..d419eff 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 _0x76a4=['debug','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','update','options','raw','where','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','socket.io-emitter','redis','register','then','info','request\x20sent'];(function(_0x185179,_0x1d791c){var _0x51588b=function(_0x83320){while(--_0x83320){_0x185179['push'](_0x185179['shift']());}};_0x51588b(++_0x1d791c);}(_0x76a4,0x175));var _0x476a=function(_0x18af2f,_0x48f3e1){_0x18af2f=_0x18af2f-0x0;var _0x207c23=_0x76a4[_0x18af2f];return _0x207c23;};'use strict';var _=require(_0x476a('0x0'));var util=require(_0x476a('0x1'));var moment=require('moment');var BPromise=require(_0x476a('0x2'));var rs=require(_0x476a('0x3'));var fs=require('fs');var Redis=require(_0x476a('0x4'));var db=require(_0x476a('0x5'))['db'];var utils=require(_0x476a('0x6'));var logger=require(_0x476a('0x7'))(_0x476a('0x8'));var config=require('../../config/environment');var jayson=require(_0x476a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x476a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x476a('0xb'))(new Redis(config[_0x476a('0xc')]));require('./openchannelInteraction.socket')[_0x476a('0xd')](socket);function respondWithRpcPromise(_0x284fe4,_0x3ac50c,_0x232dcd){return new BPromise(function(_0x14e27f,_0x290122){return client['request'](_0x284fe4,_0x232dcd)[_0x476a('0xe')](function(_0x411699){logger[_0x476a('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3ac50c,_0x476a('0x10'));logger[_0x476a('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3ac50c,_0x476a('0x10'),JSON['stringify'](_0x411699));if(_0x411699[_0x476a('0x12')]){if(_0x411699[_0x476a('0x12')][_0x476a('0x13')]===0x1f4){logger[_0x476a('0x12')](_0x476a('0x14'),_0x3ac50c,_0x411699['error']['message']);return _0x290122(_0x411699['error'][_0x476a('0x15')]);}logger[_0x476a('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3ac50c,_0x411699[_0x476a('0x12')]['message']);return _0x14e27f(_0x411699[_0x476a('0x12')][_0x476a('0x15')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x3ac50c,_0x476a('0x10'));_0x14e27f(_0x411699[_0x476a('0x16')][_0x476a('0x15')]);}})[_0x476a('0x17')](function(_0x380cc5){logger[_0x476a('0x12')](_0x476a('0x14'),_0x3ac50c,_0x380cc5);_0x290122(_0x380cc5);});});}exports[_0x476a('0x18')]=function(_0x3491cb){var _0x369018=this;return new Promise(function(_0x3533b3,_0x27582a){return db['OpenchannelInteraction'][_0x476a('0x19')](_0x3491cb['body'],{'raw':_0x3491cb[_0x476a('0x1a')]?_0x3491cb['options'][_0x476a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3491cb[_0x476a('0x1a')]?_0x3491cb['options'][_0x476a('0x1c')]||null:null,'attributes':_0x3491cb[_0x476a('0x1a')]?_0x3491cb[_0x476a('0x1a')]['attributes']||null:null,'limit':_0x3491cb[_0x476a('0x1a')]?_0x3491cb[_0x476a('0x1a')][_0x476a('0x1d')]||null:null})[_0x476a('0xe')](function(_0x16f9a3){logger[_0x476a('0xf')](_0x476a('0x18'),_0x3491cb);logger['debug'](_0x476a('0x18'),_0x3491cb,JSON[_0x476a('0x1e')](_0x16f9a3));_0x3533b3(_0x16f9a3);})['catch'](function(_0x146bb7){logger[_0x476a('0x12')](_0x476a('0x18'),_0x146bb7[_0x476a('0x15')],_0x3491cb);_0x27582a(_0x369018[_0x476a('0x12')](0x1f4,_0x146bb7[_0x476a('0x15')]));});});};exports[_0x476a('0x1f')]=function(_0x42b6dd){return new Promise(function(_0xe6dd3,_0x3140b5){return db[_0x476a('0x20')][_0x476a('0x21')]({'where':_0x42b6dd[_0x476a('0x1a')]?_0x42b6dd[_0x476a('0x1a')]['where']||null:null})[_0x476a('0xe')](function(_0x222c2b){if(_0x222c2b){return _0x222c2b[_0x476a('0x22')](_0x42b6dd[_0x476a('0x23')][_0x476a('0x24')],_[_0x476a('0x25')](_0x42b6dd[_0x476a('0x23')],[_0x476a('0x24'),'id'])||{});}})['spread'](function(_0x2c8c97){logger[_0x476a('0xf')](_0x476a('0x26'),_0x42b6dd);logger[_0x476a('0x11')](_0x476a('0x26'),_0x42b6dd,JSON[_0x476a('0x1e')](_0x2c8c97));_0xe6dd3(_0x2c8c97);})[_0x476a('0x17')](function(_0x44d13b){logger['error']('AddTags',_0x44d13b[_0x476a('0x15')],_0x42b6dd);_0x3140b5(_this[_0x476a('0x12')](0x1f4,_0x44d13b['message']));});});}; \ No newline at end of file +var _0x3987=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','attributes','limit','info','find','addTags','ids','omit','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5d2129,_0x344242){var _0x2ef362=function(_0x396280){while(--_0x396280){_0x5d2129['push'](_0x5d2129['shift']());}};_0x2ef362(++_0x344242);}(_0x3987,0x14e));var _0x7398=function(_0x45c8f5,_0x18b017){_0x45c8f5=_0x45c8f5-0x0;var _0x248f5b=_0x3987[_0x45c8f5];return _0x248f5b;};'use strict';var _=require('lodash');var util=require(_0x7398('0x0'));var moment=require(_0x7398('0x1'));var BPromise=require(_0x7398('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7398('0x3'));var db=require(_0x7398('0x4'))['db'];var utils=require(_0x7398('0x5'));var logger=require(_0x7398('0x6'))(_0x7398('0x7'));var config=require(_0x7398('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7398('0x9')]['http']({'port':0x232a});config[_0x7398('0xa')]=_[_0x7398('0xb')](config['redis'],{'host':_0x7398('0xc'),'port':0x18eb});var socket=require(_0x7398('0xd'))(new Redis(config[_0x7398('0xa')]));require(_0x7398('0xe'))['register'](socket);function respondWithRpcPromise(_0x2427ac,_0x1bb530,_0x6ea992){return new BPromise(function(_0x1916b5,_0x1c1f36){return client[_0x7398('0xf')](_0x2427ac,_0x6ea992)[_0x7398('0x10')](function(_0x3c0d56){logger['info'](_0x7398('0x11'),_0x1bb530,_0x7398('0x12'));logger[_0x7398('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1bb530,_0x7398('0x12'),JSON[_0x7398('0x14')](_0x3c0d56));if(_0x3c0d56[_0x7398('0x15')]){if(_0x3c0d56[_0x7398('0x15')][_0x7398('0x16')]===0x1f4){logger[_0x7398('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1bb530,_0x3c0d56[_0x7398('0x15')][_0x7398('0x17')]);return _0x1c1f36(_0x3c0d56[_0x7398('0x15')]['message']);}logger[_0x7398('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1bb530,_0x3c0d56[_0x7398('0x15')][_0x7398('0x17')]);return _0x1916b5(_0x3c0d56['error'][_0x7398('0x17')]);}else{logger['info'](_0x7398('0x11'),_0x1bb530,_0x7398('0x12'));_0x1916b5(_0x3c0d56['result']['message']);}})[_0x7398('0x18')](function(_0x5848b7){logger[_0x7398('0x15')](_0x7398('0x11'),_0x1bb530,_0x5848b7);_0x1c1f36(_0x5848b7);});});}exports[_0x7398('0x19')]=function(_0x515d64){var _0x1a1621=this;return new Promise(function(_0x15a938,_0x4ac72f){return db[_0x7398('0x1a')][_0x7398('0x1b')](_0x515d64[_0x7398('0x1c')],{'raw':_0x515d64[_0x7398('0x1d')]?_0x515d64[_0x7398('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x515d64[_0x7398('0x1d')]?_0x515d64[_0x7398('0x1d')]['where']||null:null,'attributes':_0x515d64[_0x7398('0x1d')]?_0x515d64[_0x7398('0x1d')][_0x7398('0x1e')]||null:null,'limit':_0x515d64[_0x7398('0x1d')]?_0x515d64[_0x7398('0x1d')][_0x7398('0x1f')]||null:null})[_0x7398('0x10')](function(_0x10fbdf){logger[_0x7398('0x20')](_0x7398('0x19'),_0x515d64);logger[_0x7398('0x13')]('UpdateOpenchannelInteraction',_0x515d64,JSON[_0x7398('0x14')](_0x10fbdf));_0x15a938(_0x10fbdf);})[_0x7398('0x18')](function(_0x26ca40){logger[_0x7398('0x15')](_0x7398('0x19'),_0x26ca40['message'],_0x515d64);_0x4ac72f(_0x1a1621[_0x7398('0x15')](0x1f4,_0x26ca40[_0x7398('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x142fc8){return new Promise(function(_0x5ec26a,_0x3b3096){return db[_0x7398('0x1a')][_0x7398('0x21')]({'where':_0x142fc8[_0x7398('0x1d')]?_0x142fc8[_0x7398('0x1d')]['where']||null:null})[_0x7398('0x10')](function(_0x4ada44){if(_0x4ada44){return _0x4ada44[_0x7398('0x22')](_0x142fc8[_0x7398('0x1c')][_0x7398('0x23')],_[_0x7398('0x24')](_0x142fc8[_0x7398('0x1c')],['ids','id'])||{});}})['spread'](function(_0x3eb4ff){logger[_0x7398('0x20')](_0x7398('0x25'),_0x142fc8);logger['debug'](_0x7398('0x25'),_0x142fc8,JSON[_0x7398('0x14')](_0x3eb4ff));_0x5ec26a(_0x3eb4ff);})['catch'](function(_0xe5ef4a){logger[_0x7398('0x15')]('AddTags',_0xe5ef4a[_0x7398('0x17')],_0x142fc8);_0x3b3096(_this[_0x7398('0x15')](0x1f4,_0xe5ef4a[_0x7398('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 929a195..f554395 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 _0x364d=['openchannelInteraction:','./openchannelInteraction.events','save','update','register','length'];(function(_0x2c031c,_0x3a5da6){var _0x297a9a=function(_0x4acfb6){while(--_0x4acfb6){_0x2c031c['push'](_0x2c031c['shift']());}};_0x297a9a(++_0x3a5da6);}(_0x364d,0xfd));var _0xd364=function(_0x178885,_0x5814d9){_0x178885=_0x178885-0x0;var _0x345695=_0x364d[_0x178885];return _0x345695;};'use strict';var OpenchannelInteractionEvents=require(_0xd364('0x0'));var events=[_0xd364('0x1'),'remove',_0xd364('0x2')];function createListener(_0x5b1e16,_0x399311){return function(_0x4defb5){_0x399311['emit'](_0x5b1e16,_0x4defb5);};}function removeListener(_0x2a099e,_0x5893cc){return function(){OpenchannelInteractionEvents['removeListener'](_0x2a099e,_0x5893cc);};}exports[_0xd364('0x3')]=function(_0x590efa){for(var _0x4fbd51=0x0,_0x3a045a=events[_0xd364('0x4')];_0x4fbd51<_0x3a045a;_0x4fbd51++){var _0x147f0c=events[_0x4fbd51];var _0x1b6825=createListener(_0xd364('0x5')+_0x147f0c,_0x590efa);OpenchannelInteractionEvents['on'](_0x147f0c,_0x1b6825);}}; \ No newline at end of file +var _0x44dc=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','remove'];(function(_0x1739e3,_0x31f4bf){var _0x238d44=function(_0x4e67f8){while(--_0x4e67f8){_0x1739e3['push'](_0x1739e3['shift']());}};_0x238d44(++_0x31f4bf);}(_0x44dc,0xfe));var _0xc44d=function(_0x235996,_0x370c7f){_0x235996=_0x235996-0x0;var _0x200c7f=_0x44dc[_0x235996];return _0x200c7f;};'use strict';var OpenchannelInteractionEvents=require(_0xc44d('0x0'));var events=['save',_0xc44d('0x1'),_0xc44d('0x2')];function createListener(_0x7bbae4,_0x1f97d7){return function(_0x24b1d0){_0x1f97d7[_0xc44d('0x3')](_0x7bbae4,_0x24b1d0);};}function removeListener(_0x38358c,_0x4f45dc){return function(){OpenchannelInteractionEvents[_0xc44d('0x4')](_0x38358c,_0x4f45dc);};}exports[_0xc44d('0x5')]=function(_0x264305){for(var _0x3295e6=0x0,_0x49231=events[_0xc44d('0x6')];_0x3295e6<_0x49231;_0x3295e6++){var _0x49309a=events[_0x3295e6];var _0xca0a40=createListener(_0xc44d('0x7')+_0x49309a,_0x264305);OpenchannelInteractionEvents['on'](_0x49309a,_0xca0a40);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ede4364..6951e9f 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x58fb9f,_0x560e16){var _0x2ee234=function(_0x188b0b){while(--_0x188b0b){_0x58fb9f['push'](_0x58fb9f['shift']());}};_0x2ee234(++_0x560e16);}(_0xe706,0xa3));var _0x6e70=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0xe706[_0x2a2166];return _0x3bcf50;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x179791,_0xd1e02f){var _0x2be9f8=function(_0x252382){while(--_0x252382){_0x179791['push'](_0x179791['shift']());}};_0x2be9f8(++_0xd1e02f);}(_0xe706,0xa3));var _0x6e70=function(_0x34ae76,_0x4cd562){_0x34ae76=_0x34ae76-0x0;var _0x5325eb=_0xe706[_0x34ae76];return _0x5325eb;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 6e9b76a..0ac815d 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 _0x4fad=['out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x2288c2,_0x217b9a){var _0xb2d86d=function(_0x33c747){while(--_0x33c747){_0x2288c2['push'](_0x2288c2['shift']());}};_0xb2d86d(++_0x217b9a);}(_0x4fad,0xcb));var _0xd4fa=function(_0x5964ca,_0x2a7f19){_0x5964ca=_0x5964ca-0x0;var _0x212464=_0x4fad[_0x5964ca];return _0x212464;};'use strict';var Sequelize=require(_0xd4fa('0x0'));module[_0xd4fa('0x1')]={'body':{'type':Sequelize[_0xd4fa('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd4fa('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd4fa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd4fa('0x4')]('in',_0xd4fa('0x5')),'defaultValue':_0xd4fa('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd4fa('0x6')]},'providerName':{'type':Sequelize[_0xd4fa('0x7')]},'providerResponse':{'type':Sequelize[_0xd4fa('0x2')]}}; \ No newline at end of file +var _0x9e63=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x3a2287,_0x377b1a){var _0x1ff91d=function(_0x42d945){while(--_0x42d945){_0x3a2287['push'](_0x3a2287['shift']());}};_0x1ff91d(++_0x377b1a);}(_0x9e63,0x65));var _0x39e6=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x9e63[_0x521929];return _0x632436;};'use strict';var Sequelize=require(_0x39e6('0x0'));module[_0x39e6('0x1')]={'body':{'type':Sequelize[_0x39e6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x39e6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x39e6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x39e6('0x4')]('in',_0x39e6('0x5')),'defaultValue':_0x39e6('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x39e6('0x6')]},'providerName':{'type':Sequelize[_0x39e6('0x7')]},'providerResponse':{'type':Sequelize[_0x39e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 27139cf..319994f 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 _0x39ed=['papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','filter','merge','options','include','length','includeAll','find','create','body','params','describe','openchannel-interactions','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','format','[OPENCHANNELMESSAGE: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','QueryTypes','SELECT','email','internal','manual','interface','channel','motionChannel','event','EventManager','RejectMessage','contact','User','fullname','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x563b5b,_0x5d5a3c){var _0x5449d1=function(_0x44f173){while(--_0x44f173){_0x563b5b['push'](_0x563b5b['shift']());}};_0x5449d1(++_0x5d5a3c);}(_0x39ed,0x155));var _0xd39e=function(_0x2b41f3,_0x44a859){_0x2b41f3=_0x2b41f3-0x0;var _0x298fff=_0x39ed[_0x2b41f3];return _0x298fff;};'use strict';var emlformat=require(_0xd39e('0x0'));var rimraf=require(_0xd39e('0x1'));var zipdir=require(_0xd39e('0x2'));var jsonpatch=require(_0xd39e('0x3'));var rp=require(_0xd39e('0x4'));var moment=require(_0xd39e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd39e('0x6'));var path=require(_0xd39e('0x7'));var sox=require(_0xd39e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd39e('0x9'));var _=require(_0xd39e('0xa'));var squel=require(_0xd39e('0xb'));var crypto=require(_0xd39e('0xc'));var jsforce=require(_0xd39e('0xd'));var deskjs=require(_0xd39e('0xe'));var toCsv=require(_0xd39e('0xf'));var querystring=require('querystring');var Papa=require(_0xd39e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd39e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd39e('0x12'));var logger=require(_0xd39e('0x13'))('api');var utils=require(_0xd39e('0x14'));var config=require(_0xd39e('0x15'));var licenseUtil=require(_0xd39e('0x16'));var db=require('../../mysqldb')['db'];config[_0xd39e('0x17')]=_[_0xd39e('0x18')](config['redis'],{'host':_0xd39e('0x19'),'port':0x18eb});var socket=require(_0xd39e('0x1a'))(new Redis(config['redis']));require(_0xd39e('0x1b'))['register'](socket);var jayson=require(_0xd39e('0x1c'));var client=jayson[_0xd39e('0x1d')][_0xd39e('0x1e')]({'port':0x232c});var client9002=jayson[_0xd39e('0x1d')][_0xd39e('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3aecf9,_0x510637,_0x156fc8,_0x373693){return new BPromise(function(_0x5ec6d9,_0x4a19af){var _0x487e89=_0x373693||client;return _0x487e89['request'](_0x3aecf9,_0x156fc8)[_0xd39e('0x1f')](function(_0xa54780){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x510637,_0xd39e('0x20'));logger[_0xd39e('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x510637,'request\x20sent',JSON[_0xd39e('0x22')](_0xa54780));if(_0xa54780[_0xd39e('0x23')]){if(_0xa54780[_0xd39e('0x23')]['code']===0x1f4){logger[_0xd39e('0x23')](_0xd39e('0x24'),_0x510637,_0xa54780[_0xd39e('0x23')]['message']);return _0x4a19af(_0xa54780['error'][_0xd39e('0x25')]);}logger[_0xd39e('0x23')](_0xd39e('0x24'),_0x510637,_0xa54780['error']['message']);return _0x5ec6d9(_0xa54780[_0xd39e('0x23')][_0xd39e('0x25')]);}else{logger[_0xd39e('0x26')](_0xd39e('0x24'),_0x510637,_0xd39e('0x20'));_0x5ec6d9(_0xa54780[_0xd39e('0x27')][_0xd39e('0x25')]);}})[_0xd39e('0x28')](function(_0x58bd51){logger[_0xd39e('0x23')](_0xd39e('0x24'),_0x510637,_0x58bd51);_0x4a19af(_0x58bd51);});});}function respondWithStatusCode(_0x49b731,_0x3776d1){_0x3776d1=_0x3776d1||0xcc;return function(_0x679dae){if(_0x679dae){return _0x49b731['sendStatus'](_0x3776d1);}return _0x49b731[_0xd39e('0x29')](_0x3776d1)[_0xd39e('0x2a')]();};}function respondWithResult(_0x17a747,_0x421ef0){_0x421ef0=_0x421ef0||0xc8;return function(_0x25002f){if(_0x25002f){return _0x17a747['status'](_0x421ef0)[_0xd39e('0x2b')](_0x25002f);}};}function respondWithFilteredResult(_0x26bb6d,_0xee0e03){return function(_0x4e0481){if(_0x4e0481){var _0x8f4f18=typeof _0xee0e03[_0xd39e('0x2c')]===_0xd39e('0x2d')&&typeof _0xee0e03[_0xd39e('0x2e')]==='undefined';var _0x1b03c0=_0x4e0481[_0xd39e('0x2f')];var _0x4984a0=_0x8f4f18?0x0:_0xee0e03[_0xd39e('0x2c')];var _0x1107b8=_0x8f4f18?_0x4e0481[_0xd39e('0x2f')]:_0xee0e03[_0xd39e('0x2c')]+_0xee0e03[_0xd39e('0x2e')];var _0x44b534;if(_0x1107b8>=_0x1b03c0){_0x1107b8=_0x1b03c0;_0x44b534=0xc8;}else{_0x44b534=0xce;}_0x26bb6d[_0xd39e('0x29')](_0x44b534);return _0x26bb6d[_0xd39e('0x30')]('Content-Range',_0x4984a0+'-'+_0x1107b8+'/'+_0x1b03c0)[_0xd39e('0x2b')](_0x4e0481);}return null;};}function patchUpdates(_0x186db0){return function(_0xfea70b){try{jsonpatch['apply'](_0xfea70b,_0x186db0,!![]);}catch(_0x217478){return BPromise[_0xd39e('0x31')](_0x217478);}return _0xfea70b['save']();};}function saveUpdates(_0xe12ce0,_0x56c4f7){return function(_0x246fe1){if(_0x246fe1){return _0x246fe1[_0xd39e('0x32')](_0xe12ce0)[_0xd39e('0x1f')](function(_0x241189){return _0x241189;});}return null;};}function removeEntity(_0x59593d,_0x54281a){return function(_0x4fc918){if(_0x4fc918){return _0x4fc918[_0xd39e('0x33')]()[_0xd39e('0x1f')](function(){_0x59593d[_0xd39e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2abd42,_0x2a613e){return function(_0x12ab4b){if(!_0x12ab4b){_0x2abd42[_0xd39e('0x34')](0x194);}return _0x12ab4b;};}function handleError(_0x218957,_0x559943){_0x559943=_0x559943||0x1f4;return function(_0x5bc93e){logger[_0xd39e('0x23')](_0x5bc93e[_0xd39e('0x35')]);if(_0x5bc93e[_0xd39e('0x36')]){delete _0x5bc93e[_0xd39e('0x36')];}_0x218957[_0xd39e('0x29')](_0x559943)['send'](_0x5bc93e);};}exports[_0xd39e('0x37')]=function(_0x584b6f,_0x331488){var _0x2b0f30={},_0x163877={},_0x39442b={'count':0x0,'rows':[]};var _0x448f8c=_[_0xd39e('0x38')](db[_0xd39e('0x39')][_0xd39e('0x3a')],function(_0x5cb68a){return{'name':_0x5cb68a[_0xd39e('0x3b')],'type':_0x5cb68a[_0xd39e('0x3c')][_0xd39e('0x3d')]};});_0x163877['model']=_[_0xd39e('0x38')](_0x448f8c,_0xd39e('0x36'));_0x163877[_0xd39e('0x3e')]=_[_0xd39e('0x3f')](_0x584b6f[_0xd39e('0x3e')]);_0x163877[_0xd39e('0x40')]=_[_0xd39e('0x41')](_0x163877['model'],_0x163877[_0xd39e('0x3e')]);_0x2b0f30[_0xd39e('0x42')]=_[_0xd39e('0x41')](_0x163877[_0xd39e('0x43')],qs[_0xd39e('0x44')](_0x584b6f[_0xd39e('0x3e')]['fields']));_0x2b0f30[_0xd39e('0x42')]=_0x2b0f30['attributes']['length']?_0x2b0f30[_0xd39e('0x42')]:_0x163877[_0xd39e('0x43')];if(!_0x584b6f[_0xd39e('0x3e')]['hasOwnProperty'](_0xd39e('0x45'))){_0x2b0f30[_0xd39e('0x2e')]=qs[_0xd39e('0x2e')](_0x584b6f[_0xd39e('0x3e')]['limit']);_0x2b0f30['offset']=qs[_0xd39e('0x2c')](_0x584b6f['query'][_0xd39e('0x2c')]);}_0x2b0f30['order']=qs[_0xd39e('0x46')](_0x584b6f[_0xd39e('0x3e')][_0xd39e('0x46')]);_0x2b0f30[_0xd39e('0x47')]=qs[_0xd39e('0x40')](_[_0xd39e('0x48')](_0x584b6f[_0xd39e('0x3e')],_0x163877[_0xd39e('0x40')]),_0x448f8c);if(_0x584b6f[_0xd39e('0x3e')][_0xd39e('0x49')]){_0x2b0f30[_0xd39e('0x47')]=_['merge'](_0x2b0f30[_0xd39e('0x47')],{'$or':_[_0xd39e('0x38')](_0x448f8c,function(_0x151a33){if(_0x151a33[_0xd39e('0x3c')]!=='VIRTUAL'){var _0x57628f={};_0x57628f[_0x151a33[_0xd39e('0x36')]]={'$like':'%'+_0x584b6f[_0xd39e('0x3e')][_0xd39e('0x49')]+'%'};return _0x57628f;}})});}_0x2b0f30=_[_0xd39e('0x4a')]({},_0x2b0f30,_0x584b6f[_0xd39e('0x4b')]);var _0x373fb3={'where':_0x2b0f30[_0xd39e('0x47')]};return db[_0xd39e('0x39')][_0xd39e('0x2f')](_0x373fb3)[_0xd39e('0x1f')](function(_0x2be7e9){_0x39442b[_0xd39e('0x2f')]=_0x2be7e9;if(_0x584b6f[_0xd39e('0x3e')]['includeAll']){_0x2b0f30[_0xd39e('0x4c')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x2b0f30);})[_0xd39e('0x1f')](function(_0x75c984){_0x39442b['rows']=_0x75c984;return _0x39442b;})['then'](respondWithFilteredResult(_0x331488,_0x2b0f30))[_0xd39e('0x28')](handleError(_0x331488,null));};exports['show']=function(_0x3b56bc,_0x488778){var _0x8b8d4b={'raw':!![],'where':{'id':_0x3b56bc['params']['id']}},_0x1b94ce={};_0x1b94ce[_0xd39e('0x43')]=_[_0xd39e('0x3f')](db['OpenchannelMessage']['rawAttributes']);_0x1b94ce[_0xd39e('0x3e')]=_['keys'](_0x3b56bc[_0xd39e('0x3e')]);_0x1b94ce['filters']=_[_0xd39e('0x41')](_0x1b94ce['model'],_0x1b94ce[_0xd39e('0x3e')]);_0x8b8d4b['attributes']=_['intersection'](_0x1b94ce[_0xd39e('0x43')],qs[_0xd39e('0x44')](_0x3b56bc[_0xd39e('0x3e')][_0xd39e('0x44')]));_0x8b8d4b[_0xd39e('0x42')]=_0x8b8d4b['attributes'][_0xd39e('0x4d')]?_0x8b8d4b[_0xd39e('0x42')]:_0x1b94ce[_0xd39e('0x43')];if(_0x3b56bc['query'][_0xd39e('0x4e')]){_0x8b8d4b[_0xd39e('0x4c')]=[{'all':!![]}];}_0x8b8d4b=_[_0xd39e('0x4a')]({},_0x8b8d4b,_0x3b56bc[_0xd39e('0x4b')]);return db[_0xd39e('0x39')][_0xd39e('0x4f')](_0x8b8d4b)['then'](handleEntityNotFound(_0x488778,null))[_0xd39e('0x1f')](respondWithResult(_0x488778,null))['catch'](handleError(_0x488778,null));};exports[_0xd39e('0x50')]=function(_0x4cedb3,_0x43dab2){return db['OpenchannelMessage']['create'](_0x4cedb3[_0xd39e('0x51')],{})[_0xd39e('0x1f')](respondWithResult(_0x43dab2,0xc9))[_0xd39e('0x28')](handleError(_0x43dab2,null));};exports[_0xd39e('0x32')]=function(_0x5866fa,_0x2c2af8){if(_0x5866fa[_0xd39e('0x51')]['id']){delete _0x5866fa[_0xd39e('0x51')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x5866fa['params']['id']}})[_0xd39e('0x1f')](handleEntityNotFound(_0x2c2af8,null))[_0xd39e('0x1f')](saveUpdates(_0x5866fa[_0xd39e('0x51')],null))[_0xd39e('0x1f')](respondWithResult(_0x2c2af8,null))[_0xd39e('0x28')](handleError(_0x2c2af8,null));};exports[_0xd39e('0x33')]=function(_0x26b80f,_0x2b5f16){return db[_0xd39e('0x39')][_0xd39e('0x4f')]({'where':{'id':_0x26b80f[_0xd39e('0x52')]['id']}})[_0xd39e('0x1f')](handleEntityNotFound(_0x2b5f16,null))[_0xd39e('0x1f')](removeEntity(_0x2b5f16,null))[_0xd39e('0x28')](handleError(_0x2b5f16,null));};exports[_0xd39e('0x53')]=function(_0x2860f7,_0x5b60f6){return db[_0xd39e('0x39')][_0xd39e('0x53')]()[_0xd39e('0x1f')](respondWithResult(_0x5b60f6,null))['catch'](handleError(_0x5b60f6,null));};var interaction_log=require(_0xd39e('0x13'))(_0xd39e('0x54'));exports[_0xd39e('0x55')]=function(_0x40cf4,_0x3eb301,_0x2c5c34){var _0x10f207={'agent':{},'channel':'openchannel'};if(_0x40cf4[_0xd39e('0x51')]['id']){delete _0x40cf4[_0xd39e('0x51')]['id'];}_0x40cf4[_0xd39e('0x51')]['read']=!![];_0x40cf4[_0xd39e('0x51')]['readAt']=moment()['format'](_0xd39e('0x56'));_0x40cf4[_0xd39e('0x51')][_0xd39e('0x57')]=_0x40cf4['body'][_0xd39e('0x57')]||_0x40cf4[_0xd39e('0x58')]['id'];_0x10f207[_0xd39e('0x59')]['id']=_0x40cf4[_0xd39e('0x51')][_0xd39e('0x57')];return db[_0xd39e('0x39')][_0xd39e('0x4f')]({'where':{'id':_0x40cf4[_0xd39e('0x52')]['id'],'UserId':null}})[_0xd39e('0x1f')](handleEntityNotFound(_0x3eb301,null))['then'](saveUpdates(_0x40cf4['body'],null))[_0xd39e('0x1f')](function(_0x197746){if(_0x197746){_0x10f207[_0xd39e('0x25')]=_0x197746[_0xd39e('0x5a')]({'plain':!![]});return db[_0xd39e('0x5b')]['find']({'where':{'id':_0x197746['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3eb301,null))['then'](function(_0x369b37){if(_0x369b37){return _0x369b37[_0xd39e('0x32')]({'UserId':_0x40cf4['body'][_0xd39e('0x57')],'read1stAt':_['isNil'](_0x369b37['read1stAt'])?moment()[_0xd39e('0x5c')](_0xd39e('0x56')):undefined});}return null;})[_0xd39e('0x1f')](function(_0x14c13e){if(_0x14c13e){_0x10f207['interaction']=_0x14c13e['get']({'plain':!![]});interaction_log[_0xd39e('0x26')](_0xd39e('0x5d'),_0x40cf4[_0xd39e('0x58')]['id'],_0x40cf4[_0xd39e('0x58')][_0xd39e('0x36')],_0x40cf4['user'][_0xd39e('0x5e')],_0x10f207[_0xd39e('0x5f')]['id'],_0x40cf4[_0xd39e('0x51')]?JSON[_0xd39e('0x22')](_0x40cf4['body']):_0xd39e('0x60'));return respondWithRpcPromise(_0xd39e('0x61'),_0xd39e('0x62'),_0x10f207);}return null;})[_0xd39e('0x1f')](function(_0x37c3c7){var _0x20816f=_0xd39e('0x63')+_0x37c3c7[_0xd39e('0x25')][_0xd39e('0x64')];return db[_0xd39e('0x65')][_0xd39e('0x3e')](_0x20816f,{'type':db[_0xd39e('0x66')][_0xd39e('0x67')][_0xd39e('0x68')],'raw':!![]})[_0xd39e('0x1f')](function(_0x37da34){return _0x37da34;});})[_0xd39e('0x1f')](function(_0x2a1ed5){if(_0x2a1ed5){_0x10f207[_0xd39e('0x25')]['contact']=_0x2a1ed5[0x0];if(!_0x40cf4['body'][_0xd39e('0x57')])return;return db['User'][_0xd39e('0x4f')]({'where':{'id':_0x40cf4['body'][_0xd39e('0x57')],'role':_0xd39e('0x59')},'attributes':['id',_0xd39e('0x36'),'fullname',_0xd39e('0x69'),_0xd39e('0x6a')],'raw':!![]});}return null;})[_0xd39e('0x1f')](function(_0xec4237){if(!_0xec4237)return null;_0x10f207[_0xd39e('0x25')][_0xd39e('0x59')]=_0xec4237;return _0x10f207;})[_0xd39e('0x1f')](function(_0x815d08){if(_0x815d08){if(_0x40cf4[_0xd39e('0x51')][_0xd39e('0x6b')]){_0x10f207[_0xd39e('0x25')][_0xd39e('0x6c')]=util[_0xd39e('0x5c')]('SIP/%s',_0x40cf4[_0xd39e('0x58')][_0xd39e('0x36')]);_0x10f207['message'][_0xd39e('0x6d')]=_0x10f207[_0xd39e('0x6d')];_0x10f207[_0xd39e('0x25')][_0xd39e('0x6e')]=_0x10f207['channel'];_0x10f207[_0xd39e('0x25')][_0xd39e('0x6f')]=_0xd39e('0x55');return respondWithRpcPromise('EventManager',_0xd39e('0x70'),{'event':'acceptmessage','message':_0x10f207[_0xd39e('0x25')]},client9002)[_0xd39e('0x1f')](function(){return _0x10f207;});}return _0x10f207;}return null;})[_0xd39e('0x1f')](respondWithResult(_0x3eb301,null))[_0xd39e('0x28')](handleError(_0x3eb301,null));};var interaction_log=require(_0xd39e('0x13'))(_0xd39e('0x54'));exports['reject']=function(_0x39b34e,_0x30ae42,_0x14cac4){var _0x4afec1={'agent':{},'channel':'openchannel'};if(_0x39b34e[_0xd39e('0x51')]['id']){delete _0x39b34e[_0xd39e('0x51')]['id'];}_0x39b34e[_0xd39e('0x51')][_0xd39e('0x57')]=_0x39b34e[_0xd39e('0x51')][_0xd39e('0x57')]||_0x39b34e[_0xd39e('0x58')]['id'];_0x4afec1[_0xd39e('0x59')]['id']=_0x39b34e['body'][_0xd39e('0x57')];return db[_0xd39e('0x39')]['find']({'where':{'id':_0x39b34e[_0xd39e('0x52')]['id'],'UserId':null}})[_0xd39e('0x1f')](handleEntityNotFound(_0x30ae42,null))[_0xd39e('0x1f')](function(_0x32cfad){if(_0x32cfad){_0x4afec1[_0xd39e('0x25')]=_0x32cfad[_0xd39e('0x5a')]({'plain':!![]});return db['OpenchannelInteraction'][_0xd39e('0x4f')]({'where':{'id':_0x32cfad['OpenchannelInteractionId']}});}return null;})[_0xd39e('0x1f')](handleEntityNotFound(_0x30ae42,null))[_0xd39e('0x1f')](function(_0x455396){if(_0x455396){_0x4afec1[_0xd39e('0x5f')]=_0x455396[_0xd39e('0x5a')]({'plain':!![]});interaction_log[_0xd39e('0x26')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39b34e[_0xd39e('0x58')]['id'],_0x39b34e[_0xd39e('0x58')][_0xd39e('0x36')],_0x39b34e['user'][_0xd39e('0x5e')],_0x4afec1[_0xd39e('0x5f')]['id'],_0x39b34e['body']?JSON[_0xd39e('0x22')](_0x39b34e[_0xd39e('0x51')]):_0xd39e('0x60'));return respondWithRpcPromise(_0xd39e('0x71'),'rejectMessage',_0x4afec1);}return null;})['then'](function(_0x5aaaa8){var _0x50f36b=_0xd39e('0x63')+_0x5aaaa8['message'][_0xd39e('0x64')];return db[_0xd39e('0x65')][_0xd39e('0x3e')](_0x50f36b,{'type':db[_0xd39e('0x66')][_0xd39e('0x67')][_0xd39e('0x68')],'raw':!![]})[_0xd39e('0x1f')](function(_0x4d7338){return _0x4d7338;});})[_0xd39e('0x1f')](function(_0x12fdd8){if(_0x12fdd8){_0x4afec1[_0xd39e('0x25')][_0xd39e('0x72')]=_0x12fdd8[0x0];if(!_0x39b34e[_0xd39e('0x51')][_0xd39e('0x57')])return;return db[_0xd39e('0x73')][_0xd39e('0x4f')]({'where':{'id':_0x39b34e[_0xd39e('0x51')][_0xd39e('0x57')],'role':'agent'},'attributes':['id',_0xd39e('0x36'),_0xd39e('0x74'),_0xd39e('0x69'),_0xd39e('0x6a')],'raw':!![]});}return null;})['then'](function(_0x3b7a5f){if(!_0x3b7a5f)return null;_0x4afec1[_0xd39e('0x25')][_0xd39e('0x59')]=_0x3b7a5f;return _0x4afec1;})[_0xd39e('0x1f')](function(_0x15875f){if(_0x15875f){_0x15875f[_0xd39e('0x25')][_0xd39e('0x6c')]=util['format'](_0xd39e('0x75'),_0x39b34e['user'][_0xd39e('0x36')]);_0x15875f[_0xd39e('0x25')][_0xd39e('0x6d')]=_0x4afec1['channel'];_0x15875f[_0xd39e('0x25')][_0xd39e('0x6e')]=_0x4afec1['channel'];_0x15875f[_0xd39e('0x25')][_0xd39e('0x6f')]=_0xd39e('0x31');respondWithRpcPromise(_0xd39e('0x70'),_0xd39e('0x70'),{'event':_0xd39e('0x76'),'message':_0x15875f[_0xd39e('0x25')]},client9002);return _0x4afec1;}return null;})['then'](respondWithResult(_0x30ae42,null))['catch'](handleError(_0x30ae42,null));}; \ No newline at end of file +var _0xe2bc=['UserId','user','agent','OpenchannelInteraction','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','sequelize','Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','OpenchannelInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','motionChannel','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','show','params','include','options','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format'];(function(_0x56c1e2,_0x1b8136){var _0x35b217=function(_0x1cc400){while(--_0x1cc400){_0x56c1e2['push'](_0x56c1e2['shift']());}};_0x35b217(++_0x1b8136);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xe2bc[_0x2112d4];return _0x434972;};'use strict';var emlformat=require(_0xce2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce2b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce2b('0x2'));var moment=require(_0xce2b('0x3'));var BPromise=require(_0xce2b('0x4'));var Mustache=require(_0xce2b('0x5'));var util=require(_0xce2b('0x6'));var path=require('path');var sox=require(_0xce2b('0x7'));var csv=require(_0xce2b('0x8'));var ejs=require(_0xce2b('0x9'));var fs=require('fs');var fs_extra=require(_0xce2b('0xa'));var _=require(_0xce2b('0xb'));var squel=require('squel');var crypto=require(_0xce2b('0xc'));var jsforce=require(_0xce2b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xce2b('0x8'));var querystring=require(_0xce2b('0xe'));var Papa=require(_0xce2b('0xf'));var Redis=require(_0xce2b('0x10'));var authService=require(_0xce2b('0x11'));var qs=require(_0xce2b('0x12'));var as=require(_0xce2b('0x13'));var hardwareService=require(_0xce2b('0x14'));var logger=require(_0xce2b('0x15'))(_0xce2b('0x16'));var utils=require('../../config/utils');var config=require(_0xce2b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xce2b('0x18'))['db'];config[_0xce2b('0x19')]=_[_0xce2b('0x1a')](config[_0xce2b('0x19')],{'host':_0xce2b('0x1b'),'port':0x18eb});var socket=require(_0xce2b('0x1c'))(new Redis(config[_0xce2b('0x19')]));require(_0xce2b('0x1d'))['register'](socket);var jayson=require(_0xce2b('0x1e'));var client=jayson[_0xce2b('0x1f')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x339e5c,_0x42c23a,_0xa163d9,_0x48c489){return new BPromise(function(_0x5558c9,_0x216c48){var _0x405bda=_0x48c489||client;return _0x405bda[_0xce2b('0x20')](_0x339e5c,_0xa163d9)[_0xce2b('0x21')](function(_0x377aa3){logger[_0xce2b('0x22')](_0xce2b('0x23'),_0x42c23a,_0xce2b('0x24'));logger[_0xce2b('0x25')](_0xce2b('0x26'),_0x42c23a,'request\x20sent',JSON[_0xce2b('0x27')](_0x377aa3));if(_0x377aa3[_0xce2b('0x28')]){if(_0x377aa3[_0xce2b('0x28')][_0xce2b('0x29')]===0x1f4){logger[_0xce2b('0x28')](_0xce2b('0x23'),_0x42c23a,_0x377aa3[_0xce2b('0x28')][_0xce2b('0x2a')]);return _0x216c48(_0x377aa3[_0xce2b('0x28')][_0xce2b('0x2a')]);}logger['error'](_0xce2b('0x23'),_0x42c23a,_0x377aa3[_0xce2b('0x28')][_0xce2b('0x2a')]);return _0x5558c9(_0x377aa3[_0xce2b('0x28')][_0xce2b('0x2a')]);}else{logger[_0xce2b('0x22')](_0xce2b('0x23'),_0x42c23a,_0xce2b('0x24'));_0x5558c9(_0x377aa3[_0xce2b('0x2b')][_0xce2b('0x2a')]);}})[_0xce2b('0x2c')](function(_0x56047c){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x42c23a,_0x56047c);_0x216c48(_0x56047c);});});}function respondWithStatusCode(_0x94eb91,_0x4df596){_0x4df596=_0x4df596||0xcc;return function(_0x350637){if(_0x350637){return _0x94eb91[_0xce2b('0x2d')](_0x4df596);}return _0x94eb91['status'](_0x4df596)[_0xce2b('0x2e')]();};}function respondWithResult(_0x217b7e,_0x5e0ab0){_0x5e0ab0=_0x5e0ab0||0xc8;return function(_0x7bebe5){if(_0x7bebe5){return _0x217b7e[_0xce2b('0x2f')](_0x5e0ab0)[_0xce2b('0x30')](_0x7bebe5);}};}function respondWithFilteredResult(_0x50a62f,_0x502fb9){return function(_0x433a89){if(_0x433a89){var _0x113a04=typeof _0x502fb9[_0xce2b('0x31')]==='undefined'&&typeof _0x502fb9['limit']===_0xce2b('0x32');var _0x2b13e5=_0x433a89[_0xce2b('0x33')];var _0x4f9615=_0x113a04?0x0:_0x502fb9[_0xce2b('0x31')];var _0x1b6a82=_0x113a04?_0x433a89[_0xce2b('0x33')]:_0x502fb9[_0xce2b('0x31')]+_0x502fb9[_0xce2b('0x34')];var _0x476d1a;if(_0x1b6a82>=_0x2b13e5){_0x1b6a82=_0x2b13e5;_0x476d1a=0xc8;}else{_0x476d1a=0xce;}_0x50a62f[_0xce2b('0x2f')](_0x476d1a);return _0x50a62f['set'](_0xce2b('0x35'),_0x4f9615+'-'+_0x1b6a82+'/'+_0x2b13e5)['json'](_0x433a89);}return null;};}function patchUpdates(_0x21a813){return function(_0x912fa3){try{jsonpatch[_0xce2b('0x36')](_0x912fa3,_0x21a813,!![]);}catch(_0xe72a6d){return BPromise[_0xce2b('0x37')](_0xe72a6d);}return _0x912fa3['save']();};}function saveUpdates(_0x208a9b,_0x2a2542){return function(_0x46dc2b){if(_0x46dc2b){return _0x46dc2b[_0xce2b('0x38')](_0x208a9b)[_0xce2b('0x21')](function(_0x25b845){return _0x25b845;});}return null;};}function removeEntity(_0x29cba2,_0x1d96a2){return function(_0x24f30e){if(_0x24f30e){return _0x24f30e[_0xce2b('0x39')]()[_0xce2b('0x21')](function(){_0x29cba2[_0xce2b('0x2f')](0xcc)[_0xce2b('0x2e')]();});}};}function handleEntityNotFound(_0x116882,_0x427e7a){return function(_0x160571){if(!_0x160571){_0x116882['sendStatus'](0x194);}return _0x160571;};}function handleError(_0x16b215,_0x48405c){_0x48405c=_0x48405c||0x1f4;return function(_0x20ce6e){logger[_0xce2b('0x28')](_0x20ce6e[_0xce2b('0x3a')]);if(_0x20ce6e[_0xce2b('0x3b')]){delete _0x20ce6e[_0xce2b('0x3b')];}_0x16b215[_0xce2b('0x2f')](_0x48405c)['send'](_0x20ce6e);};}exports[_0xce2b('0x3c')]=function(_0xef673b,_0x1cc3d5){var _0x3408a2={},_0x2c130e={},_0x40d0f8={'count':0x0,'rows':[]};var _0x585de8=_[_0xce2b('0x3d')](db[_0xce2b('0x3e')][_0xce2b('0x3f')],function(_0x30cffb){return{'name':_0x30cffb[_0xce2b('0x40')],'type':_0x30cffb[_0xce2b('0x41')]['key']};});_0x2c130e['model']=_[_0xce2b('0x3d')](_0x585de8,_0xce2b('0x3b'));_0x2c130e[_0xce2b('0x42')]=_[_0xce2b('0x43')](_0xef673b[_0xce2b('0x42')]);_0x2c130e[_0xce2b('0x44')]=_[_0xce2b('0x45')](_0x2c130e[_0xce2b('0x46')],_0x2c130e[_0xce2b('0x42')]);_0x3408a2[_0xce2b('0x47')]=_[_0xce2b('0x45')](_0x2c130e[_0xce2b('0x46')],qs[_0xce2b('0x48')](_0xef673b[_0xce2b('0x42')][_0xce2b('0x48')]));_0x3408a2['attributes']=_0x3408a2[_0xce2b('0x47')][_0xce2b('0x49')]?_0x3408a2['attributes']:_0x2c130e[_0xce2b('0x46')];if(!_0xef673b['query'][_0xce2b('0x4a')](_0xce2b('0x4b'))){_0x3408a2[_0xce2b('0x34')]=qs['limit'](_0xef673b[_0xce2b('0x42')][_0xce2b('0x34')]);_0x3408a2['offset']=qs['offset'](_0xef673b[_0xce2b('0x42')][_0xce2b('0x31')]);}_0x3408a2[_0xce2b('0x4c')]=qs[_0xce2b('0x4d')](_0xef673b[_0xce2b('0x42')]['sort']);_0x3408a2[_0xce2b('0x4e')]=qs[_0xce2b('0x44')](_[_0xce2b('0x4f')](_0xef673b[_0xce2b('0x42')],_0x2c130e[_0xce2b('0x44')]),_0x585de8);if(_0xef673b['query'][_0xce2b('0x50')]){_0x3408a2[_0xce2b('0x4e')]=_[_0xce2b('0x51')](_0x3408a2[_0xce2b('0x4e')],{'$or':_[_0xce2b('0x3d')](_0x585de8,function(_0x30d668){if(_0x30d668[_0xce2b('0x41')]!=='VIRTUAL'){var _0x52909f={};_0x52909f[_0x30d668['name']]={'$like':'%'+_0xef673b[_0xce2b('0x42')][_0xce2b('0x50')]+'%'};return _0x52909f;}})});}_0x3408a2=_[_0xce2b('0x51')]({},_0x3408a2,_0xef673b['options']);var _0x4ea31b={'where':_0x3408a2['where']};return db[_0xce2b('0x3e')][_0xce2b('0x33')](_0x4ea31b)[_0xce2b('0x21')](function(_0x5eced1){_0x40d0f8[_0xce2b('0x33')]=_0x5eced1;if(_0xef673b[_0xce2b('0x42')][_0xce2b('0x52')]){_0x3408a2['include']=[{'all':!![]}];}return db[_0xce2b('0x3e')]['findAll'](_0x3408a2);})[_0xce2b('0x21')](function(_0x39bbfc){_0x40d0f8[_0xce2b('0x53')]=_0x39bbfc;return _0x40d0f8;})['then'](respondWithFilteredResult(_0x1cc3d5,_0x3408a2))[_0xce2b('0x2c')](handleError(_0x1cc3d5,null));};exports[_0xce2b('0x54')]=function(_0xb4257,_0x224861){var _0x592b65={'raw':!![],'where':{'id':_0xb4257[_0xce2b('0x55')]['id']}},_0x32b819={};_0x32b819[_0xce2b('0x46')]=_[_0xce2b('0x43')](db[_0xce2b('0x3e')]['rawAttributes']);_0x32b819[_0xce2b('0x42')]=_[_0xce2b('0x43')](_0xb4257[_0xce2b('0x42')]);_0x32b819[_0xce2b('0x44')]=_[_0xce2b('0x45')](_0x32b819['model'],_0x32b819[_0xce2b('0x42')]);_0x592b65['attributes']=_[_0xce2b('0x45')](_0x32b819[_0xce2b('0x46')],qs['fields'](_0xb4257['query'][_0xce2b('0x48')]));_0x592b65[_0xce2b('0x47')]=_0x592b65[_0xce2b('0x47')]['length']?_0x592b65[_0xce2b('0x47')]:_0x32b819[_0xce2b('0x46')];if(_0xb4257['query'][_0xce2b('0x52')]){_0x592b65[_0xce2b('0x56')]=[{'all':!![]}];}_0x592b65=_[_0xce2b('0x51')]({},_0x592b65,_0xb4257[_0xce2b('0x57')]);return db[_0xce2b('0x3e')][_0xce2b('0x58')](_0x592b65)['then'](handleEntityNotFound(_0x224861,null))[_0xce2b('0x21')](respondWithResult(_0x224861,null))['catch'](handleError(_0x224861,null));};exports[_0xce2b('0x59')]=function(_0x2d1302,_0x2ce9f5){return db[_0xce2b('0x3e')]['create'](_0x2d1302[_0xce2b('0x5a')],{})[_0xce2b('0x21')](respondWithResult(_0x2ce9f5,0xc9))[_0xce2b('0x2c')](handleError(_0x2ce9f5,null));};exports[_0xce2b('0x38')]=function(_0x5391e6,_0x961e87){if(_0x5391e6[_0xce2b('0x5a')]['id']){delete _0x5391e6[_0xce2b('0x5a')]['id'];}return db[_0xce2b('0x3e')][_0xce2b('0x58')]({'where':{'id':_0x5391e6[_0xce2b('0x55')]['id']}})[_0xce2b('0x21')](handleEntityNotFound(_0x961e87,null))['then'](saveUpdates(_0x5391e6[_0xce2b('0x5a')],null))['then'](respondWithResult(_0x961e87,null))[_0xce2b('0x2c')](handleError(_0x961e87,null));};exports[_0xce2b('0x39')]=function(_0x2ae9ae,_0x1546ff){return db[_0xce2b('0x3e')][_0xce2b('0x58')]({'where':{'id':_0x2ae9ae[_0xce2b('0x55')]['id']}})[_0xce2b('0x21')](handleEntityNotFound(_0x1546ff,null))['then'](removeEntity(_0x1546ff,null))[_0xce2b('0x2c')](handleError(_0x1546ff,null));};exports[_0xce2b('0x5b')]=function(_0x230e22,_0x3bffd3){return db[_0xce2b('0x3e')]['describe']()[_0xce2b('0x21')](respondWithResult(_0x3bffd3,null))[_0xce2b('0x2c')](handleError(_0x3bffd3,null));};var interaction_log=require('../../config/logger')(_0xce2b('0x5c'));exports[_0xce2b('0x5d')]=function(_0xd0ed7a,_0x275b98,_0x23f0f0){var _0x893f84={'agent':{},'channel':_0xce2b('0x5e')};if(_0xd0ed7a[_0xce2b('0x5a')]['id']){delete _0xd0ed7a[_0xce2b('0x5a')]['id'];}_0xd0ed7a[_0xce2b('0x5a')][_0xce2b('0x5f')]=!![];_0xd0ed7a[_0xce2b('0x5a')][_0xce2b('0x60')]=moment()[_0xce2b('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0xd0ed7a[_0xce2b('0x5a')][_0xce2b('0x62')]=_0xd0ed7a[_0xce2b('0x5a')]['UserId']||_0xd0ed7a[_0xce2b('0x63')]['id'];_0x893f84[_0xce2b('0x64')]['id']=_0xd0ed7a['body'][_0xce2b('0x62')];return db[_0xce2b('0x3e')]['find']({'where':{'id':_0xd0ed7a[_0xce2b('0x55')]['id'],'UserId':null}})[_0xce2b('0x21')](handleEntityNotFound(_0x275b98,null))[_0xce2b('0x21')](saveUpdates(_0xd0ed7a[_0xce2b('0x5a')],null))[_0xce2b('0x21')](function(_0xdc619d){if(_0xdc619d){_0x893f84[_0xce2b('0x2a')]=_0xdc619d['get']({'plain':!![]});return db[_0xce2b('0x65')][_0xce2b('0x58')]({'where':{'id':_0xdc619d['OpenchannelInteractionId']}});}return null;})[_0xce2b('0x21')](handleEntityNotFound(_0x275b98,null))[_0xce2b('0x21')](function(_0x448521){if(_0x448521){return _0x448521[_0xce2b('0x38')]({'UserId':_0xd0ed7a['body'][_0xce2b('0x62')],'read1stAt':_[_0xce2b('0x66')](_0x448521['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x13cfda){if(_0x13cfda){_0x893f84[_0xce2b('0x67')]=_0x13cfda['get']({'plain':!![]});interaction_log['info'](_0xce2b('0x68'),_0xd0ed7a[_0xce2b('0x63')]['id'],_0xd0ed7a[_0xce2b('0x63')]['name'],_0xd0ed7a[_0xce2b('0x63')][_0xce2b('0x69')],_0x893f84['interaction']['id'],_0xd0ed7a[_0xce2b('0x5a')]?JSON[_0xce2b('0x27')](_0xd0ed7a[_0xce2b('0x5a')]):_0xce2b('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xce2b('0x6b'),_0x893f84);}return null;})[_0xce2b('0x21')](function(_0x542580){var _0x14e188='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x542580['message'][_0xce2b('0x6c')];return db[_0xce2b('0x6d')][_0xce2b('0x42')](_0x14e188,{'type':db[_0xce2b('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0xce2b('0x21')](function(_0x359d48){return _0x359d48;});})[_0xce2b('0x21')](function(_0x28338c){if(_0x28338c){_0x893f84[_0xce2b('0x2a')][_0xce2b('0x6f')]=_0x28338c[0x0];if(!_0xd0ed7a['body'][_0xce2b('0x62')])return;return db[_0xce2b('0x70')][_0xce2b('0x58')]({'where':{'id':_0xd0ed7a[_0xce2b('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0xce2b('0x3b'),'fullname',_0xce2b('0x71'),_0xce2b('0x72')],'raw':!![]});}return null;})[_0xce2b('0x21')](function(_0x559aba){if(!_0x559aba)return null;_0x893f84['message'][_0xce2b('0x64')]=_0x559aba;return _0x893f84;})[_0xce2b('0x21')](function(_0x39dc6c){if(_0x39dc6c){if(_0xd0ed7a[_0xce2b('0x5a')][_0xce2b('0x73')]){_0x893f84['message'][_0xce2b('0x74')]=util[_0xce2b('0x61')](_0xce2b('0x75'),_0xd0ed7a[_0xce2b('0x63')][_0xce2b('0x3b')]);_0x893f84[_0xce2b('0x2a')]['channel']=_0x893f84[_0xce2b('0x76')];_0x893f84['message']['motionChannel']=_0x893f84[_0xce2b('0x76')];_0x893f84[_0xce2b('0x2a')][_0xce2b('0x77')]='accept';return respondWithRpcPromise(_0xce2b('0x78'),'EventManager',{'event':_0xce2b('0x79'),'message':_0x893f84['message']},client9002)['then'](function(){return _0x893f84;});}return _0x893f84;}return null;})['then'](respondWithResult(_0x275b98,null))[_0xce2b('0x2c')](handleError(_0x275b98,null));};var interaction_log=require(_0xce2b('0x15'))('openchannel-interactions');exports['reject']=function(_0x513dc3,_0x4d8901,_0x35b9e3){var _0x12313d={'agent':{},'channel':_0xce2b('0x5e')};if(_0x513dc3['body']['id']){delete _0x513dc3[_0xce2b('0x5a')]['id'];}_0x513dc3['body'][_0xce2b('0x62')]=_0x513dc3[_0xce2b('0x5a')][_0xce2b('0x62')]||_0x513dc3['user']['id'];_0x12313d[_0xce2b('0x64')]['id']=_0x513dc3[_0xce2b('0x5a')][_0xce2b('0x62')];return db[_0xce2b('0x3e')][_0xce2b('0x58')]({'where':{'id':_0x513dc3[_0xce2b('0x55')]['id'],'UserId':null}})[_0xce2b('0x21')](handleEntityNotFound(_0x4d8901,null))[_0xce2b('0x21')](function(_0x416bf6){if(_0x416bf6){_0x12313d[_0xce2b('0x2a')]=_0x416bf6[_0xce2b('0x7a')]({'plain':!![]});return db[_0xce2b('0x65')][_0xce2b('0x58')]({'where':{'id':_0x416bf6[_0xce2b('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x4d8901,null))['then'](function(_0x959a0e){if(_0x959a0e){_0x12313d[_0xce2b('0x67')]=_0x959a0e['get']({'plain':!![]});interaction_log[_0xce2b('0x22')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x513dc3[_0xce2b('0x63')]['id'],_0x513dc3[_0xce2b('0x63')]['name'],_0x513dc3[_0xce2b('0x63')]['role'],_0x12313d[_0xce2b('0x67')]['id'],_0x513dc3[_0xce2b('0x5a')]?JSON[_0xce2b('0x27')](_0x513dc3['body']):_0xce2b('0x6a'));return respondWithRpcPromise(_0xce2b('0x7c'),_0xce2b('0x7d'),_0x12313d);}return null;})['then'](function(_0xbc41b8){var _0x291590=_0xce2b('0x7e')+_0xbc41b8[_0xce2b('0x2a')][_0xce2b('0x6c')];return db[_0xce2b('0x6d')][_0xce2b('0x42')](_0x291590,{'type':db[_0xce2b('0x6e')]['QueryTypes'][_0xce2b('0x7f')],'raw':!![]})[_0xce2b('0x21')](function(_0x14f794){return _0x14f794;});})[_0xce2b('0x21')](function(_0x472a35){if(_0x472a35){_0x12313d[_0xce2b('0x2a')]['contact']=_0x472a35[0x0];if(!_0x513dc3[_0xce2b('0x5a')][_0xce2b('0x62')])return;return db[_0xce2b('0x70')]['find']({'where':{'id':_0x513dc3[_0xce2b('0x5a')][_0xce2b('0x62')],'role':'agent'},'attributes':['id',_0xce2b('0x3b'),'fullname',_0xce2b('0x71'),_0xce2b('0x72')],'raw':!![]});}return null;})[_0xce2b('0x21')](function(_0x3fc6d3){if(!_0x3fc6d3)return null;_0x12313d[_0xce2b('0x2a')][_0xce2b('0x64')]=_0x3fc6d3;return _0x12313d;})[_0xce2b('0x21')](function(_0x356d55){if(_0x356d55){_0x356d55[_0xce2b('0x2a')][_0xce2b('0x74')]=util['format'](_0xce2b('0x75'),_0x513dc3[_0xce2b('0x63')][_0xce2b('0x3b')]);_0x356d55[_0xce2b('0x2a')]['channel']=_0x12313d[_0xce2b('0x76')];_0x356d55[_0xce2b('0x2a')][_0xce2b('0x80')]=_0x12313d['channel'];_0x356d55[_0xce2b('0x2a')][_0xce2b('0x77')]='reject';respondWithRpcPromise(_0xce2b('0x78'),_0xce2b('0x78'),{'event':_0xce2b('0x81'),'message':_0x356d55['message']},client9002);return _0x12313d;}return null;})[_0xce2b('0x21')](respondWithResult(_0x4d8901,null))['catch'](handleError(_0x4d8901,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ac300ef..cf89afe 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 _0x1575=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x20f75c,_0x1d7774){var _0xea52d9=function(_0x3f4cae){while(--_0x3f4cae){_0x20f75c['push'](_0x20f75c['shift']());}};_0xea52d9(++_0x1d7774);}(_0x1575,0x9b));var _0x5157=function(_0x2d088e,_0x4cf89f){_0x2d088e=_0x2d088e-0x0;var _0x31166c=_0x1575[_0x2d088e];return _0x31166c;};'use strict';var EventEmitter=require(_0x5157('0x0'));var OpenchannelMessage=require(_0x5157('0x1'))['db'][_0x5157('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5157('0x3')](0x0);var events={'afterCreate':_0x5157('0x4'),'afterUpdate':'update','afterDestroy':_0x5157('0x5')};function emitEvent(_0x203527){return function(_0x5c5e5d,_0x34c7a,_0x25b260){OpenchannelMessageEvents['emit'](_0x203527+':'+_0x5c5e5d['id'],_0x5c5e5d);OpenchannelMessageEvents[_0x5157('0x6')](_0x203527,_0x5c5e5d);_0x25b260(null);};}for(var e in events){if(events[_0x5157('0x7')](e)){var event=events[e];OpenchannelMessage[_0x5157('0x8')](e,emitEvent(event));}}module[_0x5157('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x6aa5=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x5ecd78,_0x1da033){var _0x144f9=function(_0x3d0171){while(--_0x3d0171){_0x5ecd78['push'](_0x5ecd78['shift']());}};_0x144f9(++_0x1da033);}(_0x6aa5,0x10d));var _0x56aa=function(_0x45dd73,_0x468f87){_0x45dd73=_0x45dd73-0x0;var _0x4ee0ed=_0x6aa5[_0x45dd73];return _0x4ee0ed;};'use strict';var EventEmitter=require(_0x56aa('0x0'));var OpenchannelMessage=require(_0x56aa('0x1'))['db'][_0x56aa('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x56aa('0x3')](0x0);var events={'afterCreate':_0x56aa('0x4'),'afterUpdate':_0x56aa('0x5'),'afterDestroy':_0x56aa('0x6')};function emitEvent(_0x2b85fb){return function(_0xd75452,_0x20c771,_0x392d12){OpenchannelMessageEvents[_0x56aa('0x7')](_0x2b85fb+':'+_0xd75452['id'],_0xd75452);OpenchannelMessageEvents[_0x56aa('0x7')](_0x2b85fb,_0xd75452);_0x392d12(null);};}for(var e in events){if(events[_0x56aa('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x56aa('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 e16fc36..79c80d7 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 _0xb24a=['info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','afterCreate','inspect','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','OpenchannelAccount','find','Interactions','Contact','keys','replyUri'];(function(_0x2fc81a,_0x5861a7){var _0x776c2a=function(_0x4582ab){while(--_0x4582ab){_0x2fc81a['push'](_0x2fc81a['shift']());}};_0x776c2a(++_0x5861a7);}(_0xb24a,0x70));var _0xab24=function(_0x54dcad,_0x554f46){_0x54dcad=_0x54dcad-0x0;var _0x537c56=_0xb24a[_0x54dcad];return _0x537c56;};'use strict';var _=require('lodash');var util=require(_0xab24('0x0'));var logger=require(_0xab24('0x1'))('api');var moment=require(_0xab24('0x2'));var BPromise=require('bluebird');var rp=require(_0xab24('0x3'));var fs=require('fs');var path=require(_0xab24('0x4'));var rimraf=require(_0xab24('0x5'));var config=require(_0xab24('0x6'));var attributes=require(_0xab24('0x7'));module[_0xab24('0x8')]=function(_0x406762,_0x4ea9d9){return _0x406762[_0xab24('0x9')](_0xab24('0xa'),attributes,{'tableName':_0xab24('0xb'),'paranoid':![],'indexes':[{'name':_0xab24('0xc'),'fields':[_0xab24('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x541a7a,_0x14d2f4,_0x5938cd){var _0x56ea65=_0x406762[_0xab24('0xe')];var _0x118cf9=_0x541a7a[_0xab24('0xf')]({'plain':!![]});if(_0x118cf9[_0xab24('0x10')][_0xab24('0x11')]()==='in'||_0x118cf9[_0xab24('0x10')]['toLowerCase']()==='out'&&!_0x118cf9[_0xab24('0x12')]&&!_['isNil'](_0x118cf9['UserId'])){_0x56ea65[_0xab24('0x13')][_0xab24('0x14')]({'where':{'id':_0x118cf9[_0xab24('0x15')]}})[_0xab24('0x16')](function(_0x3a5c9e){if(_0x3a5c9e){_0x3a5c9e[_0xab24('0x17')]({'lastMsgAt':_0x118cf9[_0xab24('0x18')],'lastMsgDirection':_0x118cf9[_0xab24('0x10')][_0xab24('0x11')]()});}})[_0xab24('0x19')](function(_0x14e826){console[_0xab24('0x1a')](_0x14e826);});}if(_0x118cf9[_0xab24('0x10')]===_0xab24('0x1b')&&!_0x118cf9['secret']){var _0x27fc29;_0x56ea65[_0xab24('0x1c')]['describe']()[_0xab24('0x16')](function(_0x565e85){return _0x56ea65[_0xab24('0x1d')][_0xab24('0x1e')]({'where':{'id':_0x118cf9['OpenchannelAccountId']},'include':[{'model':_0x56ea65[_0xab24('0x13')],'as':_0xab24('0x1f'),'where':{'id':_0x118cf9[_0xab24('0x15')]},'limit':0x1,'include':[{'model':_0x56ea65[_0xab24('0x1c')],'as':_0xab24('0x20'),'attributes':_[_0xab24('0x21')](_0x565e85)}]}]});})['then'](function(_0x4a2cde){_0x27fc29=_0x4a2cde[_0xab24('0xf')]({'plain':!![]});if(_0x27fc29&&_0x27fc29[_0xab24('0x22')]){logger[_0xab24('0x23')](_0xab24('0x24'),'afterCreate',util[_0xab24('0x25')](_0xab24('0x26'),_0x118cf9['id'],_0x27fc29[_0xab24('0x22')]));if(_0x27fc29[_0xab24('0x1f')]&&_0x27fc29[_0xab24('0x1f')]['length']){_0x118cf9[_0xab24('0x27')]=_[_0xab24('0x28')](_0x27fc29[_0xab24('0x1f')][0x0],'Contact');_0x118cf9[_0xab24('0x20')]=_0x27fc29[_0xab24('0x1f')][0x0][_0xab24('0x20')];}var _0x14d2f4={'method':_0xab24('0x29'),'uri':encodeURI(_0x27fc29[_0xab24('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x14d2f4['method']){case _0xab24('0x2a'):_0x14d2f4['qs']=_0x118cf9;break;case _0xab24('0x29'):_0x14d2f4[_0xab24('0xd')]=_0x118cf9;break;}return rp(_0x14d2f4)['then'](function(_0x55f896){logger[_0xab24('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xab24('0x25')](_0xab24('0x2b'),_0x118cf9['id'],_0x27fc29[_0xab24('0x22')]));if(_0x55f896['body'][_0xab24('0x2c')]&&_0x55f896[_0xab24('0xd')][_0xab24('0x2c')]!=_0x118cf9[_0xab24('0x27')][_0xab24('0x2c')]){return _0x56ea65[_0xab24('0x13')][_0xab24('0x17')]({'threadId':_0x55f896['body'][_0xab24('0x2c')]},{'where':{'id':_0x118cf9[_0xab24('0x27')]['id']}});}else{return;}})[_0xab24('0x16')](function(){return _0x541a7a[_0xab24('0x17')]({'read':!![]});})[_0xab24('0x19')](function(_0x203ea1){logger[_0xab24('0x1a')](_0xab24('0x24'),_0xab24('0x2d'),util[_0xab24('0x2e')](_0x203ea1,{'showHidden':![],'depth':null}));_0x5938cd();});}else{_0x5938cd();}})['finally'](function(){_0x5938cd();});}else{_0x5938cd();}}},'charset':_0xab24('0x2f'),'collate':_0xab24('0x30')});}; \ No newline at end of file +var _0xe5b2=['OpenchannelMessage,\x20%s,\x20%s','format','omit','Contact','method','GET','POST','threadId','Interaction','afterCreate','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','secret','describe','find','OpenchannelAccountId','Interactions','keys','replyUri','info'];(function(_0x11b4f6,_0x5abc0b){var _0x18b51d=function(_0x2af6de){while(--_0x2af6de){_0x11b4f6['push'](_0x11b4f6['shift']());}};_0x18b51d(++_0x5abc0b);}(_0xe5b2,0x17c));var _0x2e5b=function(_0x23288c,_0x7bcfcd){_0x23288c=_0x23288c-0x0;var _0x1305a6=_0xe5b2[_0x23288c];return _0x1305a6;};'use strict';var _=require(_0x2e5b('0x0'));var util=require(_0x2e5b('0x1'));var logger=require(_0x2e5b('0x2'))(_0x2e5b('0x3'));var moment=require(_0x2e5b('0x4'));var BPromise=require(_0x2e5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e5b('0x6'));var rimraf=require(_0x2e5b('0x7'));var config=require(_0x2e5b('0x8'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x3008a9,_0x53c104){return _0x3008a9['define'](_0x2e5b('0x9'),attributes,{'tableName':_0x2e5b('0xa'),'paranoid':![],'indexes':[{'name':_0x2e5b('0xb'),'fields':[_0x2e5b('0xc')],'type':_0x2e5b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47e0d8,_0x301d73,_0x85dd22){var _0x5995d2=_0x3008a9[_0x2e5b('0xe')];var _0x295ddf=_0x47e0d8['get']({'plain':!![]});if(_0x295ddf[_0x2e5b('0xf')][_0x2e5b('0x10')]()==='in'||_0x295ddf[_0x2e5b('0xf')][_0x2e5b('0x10')]()===_0x2e5b('0x11')&&!_0x295ddf['secret']&&!_['isNil'](_0x295ddf[_0x2e5b('0x12')])){_0x5995d2[_0x2e5b('0x13')][_0x2e5b('0x14')]({'where':{'id':_0x295ddf[_0x2e5b('0x15')]}})[_0x2e5b('0x16')](function(_0xb42c13){if(_0xb42c13){_0xb42c13[_0x2e5b('0x17')]({'lastMsgAt':_0x295ddf[_0x2e5b('0x18')],'lastMsgDirection':_0x295ddf['direction'][_0x2e5b('0x10')]()});}})[_0x2e5b('0x19')](function(_0x139b35){console['error'](_0x139b35);});}if(_0x295ddf[_0x2e5b('0xf')]==='out'&&!_0x295ddf[_0x2e5b('0x1a')]){var _0x51aadc;_0x5995d2['CmContact'][_0x2e5b('0x1b')]()[_0x2e5b('0x16')](function(_0x53f8bd){return _0x5995d2['OpenchannelAccount'][_0x2e5b('0x1c')]({'where':{'id':_0x295ddf[_0x2e5b('0x1d')]},'include':[{'model':_0x5995d2[_0x2e5b('0x13')],'as':_0x2e5b('0x1e'),'where':{'id':_0x295ddf[_0x2e5b('0x15')]},'limit':0x1,'include':[{'model':_0x5995d2['CmContact'],'as':'Contact','attributes':_[_0x2e5b('0x1f')](_0x53f8bd)}]}]});})[_0x2e5b('0x16')](function(_0x275625){_0x51aadc=_0x275625['get']({'plain':!![]});if(_0x51aadc&&_0x51aadc[_0x2e5b('0x20')]){logger[_0x2e5b('0x21')](_0x2e5b('0x22'),'afterCreate',util[_0x2e5b('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x295ddf['id'],_0x51aadc['replyUri']));if(_0x51aadc[_0x2e5b('0x1e')]&&_0x51aadc['Interactions']['length']){_0x295ddf['Interaction']=_[_0x2e5b('0x24')](_0x51aadc[_0x2e5b('0x1e')][0x0],_0x2e5b('0x25'));_0x295ddf[_0x2e5b('0x25')]=_0x51aadc[_0x2e5b('0x1e')][0x0][_0x2e5b('0x25')];}var _0x301d73={'method':'POST','uri':encodeURI(_0x51aadc[_0x2e5b('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x301d73[_0x2e5b('0x26')]){case _0x2e5b('0x27'):_0x301d73['qs']=_0x295ddf;break;case _0x2e5b('0x28'):_0x301d73['body']=_0x295ddf;break;}return rp(_0x301d73)[_0x2e5b('0x16')](function(_0x33150a){logger[_0x2e5b('0x21')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x2e5b('0x23')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x295ddf['id'],_0x51aadc[_0x2e5b('0x20')]));if(_0x33150a[_0x2e5b('0xc')]['threadId']&&_0x33150a['body'][_0x2e5b('0x29')]!=_0x295ddf[_0x2e5b('0x2a')][_0x2e5b('0x29')]){return _0x5995d2['OpenchannelInteraction']['update']({'threadId':_0x33150a['body'][_0x2e5b('0x29')]},{'where':{'id':_0x295ddf[_0x2e5b('0x2a')]['id']}});}else{return;}})['then'](function(){return _0x47e0d8[_0x2e5b('0x17')]({'read':!![]});})[_0x2e5b('0x19')](function(_0x27fe6f){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2e5b('0x2b'),util[_0x2e5b('0x2c')](_0x27fe6f,{'showHidden':![],'depth':null}));_0x85dd22();});}else{_0x85dd22();}})['finally'](function(){_0x85dd22();});}else{_0x85dd22();}}},'charset':'utf8mb4','collate':_0x2e5b('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index d4e2d46..adebfc2 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x204361,_0x292ace){var _0x4fcb7a=function(_0x3e41de){while(--_0x3e41de){_0x204361['push'](_0x204361['shift']());}};_0x4fcb7a(++_0x292ace);}(_0x7a54,0x106));var _0x47a5=function(_0xc0b304,_0x4d8b4f){_0xc0b304=_0xc0b304-0x0;var _0x4c62a5=_0x7a54[_0xc0b304];return _0x4c62a5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x41b7cf,_0x451024){var _0x2be28d=function(_0x52c69e){while(--_0x52c69e){_0x41b7cf['push'](_0x41b7cf['shift']());}};_0x2be28d(++_0x451024);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4283c0,_0xc694d5){_0x4283c0=_0x4283c0-0x0;var _0x6b47ab=_0x0b0e[_0x4283c0];return _0x6b47ab;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f47dfbc..3e88b51 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 _0x5084=['remove','update','emit','removeListener','register','length','./openchannelMessage.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5084,0xde));var _0x4508=function(_0x1723da,_0x2b7616){_0x1723da=_0x1723da-0x0;var _0x453a98=_0x5084[_0x1723da];return _0x453a98;};'use strict';var OpenchannelMessageEvents=require(_0x4508('0x0'));var events=[_0x4508('0x1'),_0x4508('0x2'),_0x4508('0x3')];function createListener(_0xaff6d3,_0x4bb8e6){return function(_0x14e13c){_0x4bb8e6[_0x4508('0x4')](_0xaff6d3,_0x14e13c);};}function removeListener(_0x42cf45,_0x565a6b){return function(){OpenchannelMessageEvents[_0x4508('0x5')](_0x42cf45,_0x565a6b);};}exports[_0x4508('0x6')]=function(_0x1f8250){for(var _0x5b8491=0x0,_0x2c8b6a=events[_0x4508('0x7')];_0x5b8491<_0x2c8b6a;_0x5b8491++){var _0x13d6d1=events[_0x5b8491];var _0xd8c555=createListener('openchannelMessage:'+_0x13d6d1,_0x1f8250);OpenchannelMessageEvents['on'](_0x13d6d1,_0xd8c555);}}; \ No newline at end of file +var _0x2428=['length','save','remove','update','emit','removeListener','register'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x2428,0xd3));var _0x8242=function(_0x4c11ac,_0x2153b8){_0x4c11ac=_0x4c11ac-0x0;var _0x36c7f0=_0x2428[_0x4c11ac];return _0x36c7f0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x8242('0x0'),_0x8242('0x1'),_0x8242('0x2')];function createListener(_0x3f0f24,_0x9528a2){return function(_0x3fea1d){_0x9528a2[_0x8242('0x3')](_0x3f0f24,_0x3fea1d);};}function removeListener(_0x29feea,_0x1ee0d4){return function(){OpenchannelMessageEvents[_0x8242('0x4')](_0x29feea,_0x1ee0d4);};}exports[_0x8242('0x5')]=function(_0x484baa){for(var _0x38153d=0x0,_0x11da5f=events[_0x8242('0x6')];_0x38153d<_0x11da5f;_0x38153d++){var _0x3712f3=events[_0x38153d];var _0x1501e8=createListener('openchannelMessage:'+_0x3712f3,_0x484baa);OpenchannelMessageEvents['on'](_0x3712f3,_0x1501e8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 23de131..cdcbe04 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 _0x3762=['update','delete','destroy','/:id/users','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','addAgents','put'];(function(_0xd1f1d4,_0x31e9e1){var _0x62aab1=function(_0x196006){while(--_0x196006){_0xd1f1d4['push'](_0xd1f1d4['shift']());}};_0x62aab1(++_0x31e9e1);}(_0x3762,0x92));var _0x2376=function(_0x3a6210,_0x4674a7){_0x3a6210=_0x3a6210-0x0;var _0xa861ba=_0x3762[_0x3a6210];return _0xa861ba;};'use strict';var multer=require(_0x2376('0x0'));var util=require(_0x2376('0x1'));var path=require(_0x2376('0x2'));var timeout=require('connect-timeout');var express=require(_0x2376('0x3'));var router=express['Router']();var fs_extra=require(_0x2376('0x4'));var auth=require(_0x2376('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2376('0x6'));router[_0x2376('0x7')]('/',auth[_0x2376('0x8')](),controller[_0x2376('0x9')]);router['get'](_0x2376('0xa'),auth[_0x2376('0x8')](),controller[_0x2376('0xb')]);router[_0x2376('0x7')]('/:id',auth[_0x2376('0x8')](),controller['show']);router[_0x2376('0x7')](_0x2376('0xc'),auth[_0x2376('0x8')](),controller[_0x2376('0xd')]);router[_0x2376('0x7')](_0x2376('0xe'),auth['isAuthenticated'](),controller[_0x2376('0xf')]);router['get']('/:id/users',auth[_0x2376('0x8')](),controller[_0x2376('0x10')]);router['post']('/',auth[_0x2376('0x8')](),controller[_0x2376('0x11')]);router[_0x2376('0x12')](_0x2376('0xe'),auth['isAuthenticated'](),controller[_0x2376('0x13')]);router['post']('/:id/users',auth[_0x2376('0x8')](),controller[_0x2376('0x14')]);router[_0x2376('0x15')]('/:id',auth[_0x2376('0x8')](),controller[_0x2376('0x16')]);router[_0x2376('0x17')]('/:id',auth[_0x2376('0x8')](),controller[_0x2376('0x18')]);router[_0x2376('0x17')](_0x2376('0xe'),auth[_0x2376('0x8')](),controller['removeTeams']);router['delete'](_0x2376('0x19'),auth[_0x2376('0x8')](),controller[_0x2376('0x1a')]);module[_0x2376('0x1b')]=router; \ No newline at end of file +var _0xa32f=['update','destroy','delete','removeTeams','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','index','/describe','isAuthenticated','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put'];(function(_0x536f4a,_0x360afe){var _0x242497=function(_0x35a7bb){while(--_0x35a7bb){_0x536f4a['push'](_0x536f4a['shift']());}};_0x242497(++_0x360afe);}(_0xa32f,0x81));var _0xfa32=function(_0xca78c8,_0x2a441f){_0xca78c8=_0xca78c8-0x0;var _0x2c0fe5=_0xa32f[_0xca78c8];return _0x2c0fe5;};'use strict';var multer=require(_0xfa32('0x0'));var util=require(_0xfa32('0x1'));var path=require(_0xfa32('0x2'));var timeout=require('connect-timeout');var express=require(_0xfa32('0x3'));var router=express[_0xfa32('0x4')]();var fs_extra=require(_0xfa32('0x5'));var auth=require(_0xfa32('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfa32('0x7'));var controller=require(_0xfa32('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa32('0x9')]);router['get'](_0xfa32('0xa'),auth[_0xfa32('0xb')](),controller['describe']);router[_0xfa32('0xc')](_0xfa32('0xd'),auth[_0xfa32('0xb')](),controller[_0xfa32('0xe')]);router['get'](_0xfa32('0xf'),auth[_0xfa32('0xb')](),controller[_0xfa32('0x10')]);router[_0xfa32('0xc')](_0xfa32('0x11'),auth[_0xfa32('0xb')](),controller[_0xfa32('0x12')]);router[_0xfa32('0xc')](_0xfa32('0x13'),auth['isAuthenticated'](),controller[_0xfa32('0x14')]);router[_0xfa32('0x15')]('/',auth[_0xfa32('0xb')](),controller[_0xfa32('0x16')]);router[_0xfa32('0x15')](_0xfa32('0x11'),auth[_0xfa32('0xb')](),controller[_0xfa32('0x17')]);router[_0xfa32('0x15')](_0xfa32('0x13'),auth[_0xfa32('0xb')](),controller[_0xfa32('0x18')]);router[_0xfa32('0x19')]('/:id',auth[_0xfa32('0xb')](),controller[_0xfa32('0x1a')]);router['delete']('/:id',auth[_0xfa32('0xb')](),controller[_0xfa32('0x1b')]);router[_0xfa32('0x1c')]('/:id/teams',auth[_0xfa32('0xb')](),controller[_0xfa32('0x1d')]);router[_0xfa32('0x1c')](_0xfa32('0x13'),auth[_0xfa32('0xb')](),controller[_0xfa32('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index cb51b8e..0117d79 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 _0xed35=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x132886,_0x1b56cb){var _0x333c46=function(_0x28aa59){while(--_0x28aa59){_0x132886['push'](_0x132886['shift']());}};_0x333c46(++_0x1b56cb);}(_0xed35,0x16c));var _0x5ed3=function(_0x5e9fcc,_0x41599b){_0x5e9fcc=_0x5e9fcc-0x0;var _0x39ef2f=_0xed35[_0x5e9fcc];return _0x39ef2f;};'use strict';var Sequelize=require(_0x5ed3('0x0'));module[_0x5ed3('0x1')]={'name':{'type':Sequelize[_0x5ed3('0x2')],'unique':_0x5ed3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5ed3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5ed3('0x5'),_0x5ed3('0x6'),_0x5ed3('0x7'))}}; \ No newline at end of file +var _0xc0e8=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x24c5d6,_0x47994b){var _0x45efb1=function(_0x1f3653){while(--_0x1f3653){_0x24c5d6['push'](_0x24c5d6['shift']());}};_0x45efb1(++_0x47994b);}(_0xc0e8,0x64));var _0x8c0e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0e8[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x8c0e('0x0'));module[_0x8c0e('0x1')]={'name':{'type':Sequelize[_0x8c0e('0x2')],'unique':_0x8c0e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8c0e('0x2')]},'timeout':{'type':Sequelize[_0x8c0e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8c0e('0x5')](_0x8c0e('0x6'),_0x8c0e('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 73ce998..5810b20 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 _0x4b4f=['QueryTypes','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','name','send','index','map','OpenchannelQueue','type','key','include','query','findAll','rows','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelQueueId','filter','User','UserId','agent','updatedAt','openchannelPause','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','toString'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x4b4f,0x183));var _0xf4b4=function(_0x1f39c9,_0x39ca18){_0x1f39c9=_0x1f39c9-0x0;var _0x5627d7=_0x4b4f[_0x1f39c9];return _0x5627d7;};'use strict';var BPromise=require(_0xf4b4('0x0'));var util=require(_0xf4b4('0x1'));var _=require('lodash');var squel=require(_0xf4b4('0x2'));var Redis=require(_0xf4b4('0x3'));var qs=require(_0xf4b4('0x4'));var logger=require(_0xf4b4('0x5'))(_0xf4b4('0x6'));var config=require(_0xf4b4('0x7'));var db=require(_0xf4b4('0x8'))['db'];config[_0xf4b4('0x9')]=_[_0xf4b4('0xa')](config[_0xf4b4('0x9')],{'host':_0xf4b4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf4b4('0x9')]));require('./openchannelQueue.socket')[_0xf4b4('0xc')](socket);function respondWithStatusCode(_0x56ba32,_0x520a41){_0x520a41=_0x520a41||0xcc;return function(_0x34292e){if(_0x34292e){return _0x56ba32[_0xf4b4('0xd')](_0x520a41);}return _0x56ba32[_0xf4b4('0xe')](_0x520a41)['end']();};}function respondWithResult(_0x4034cc,_0x34daaa){_0x34daaa=_0x34daaa||0xc8;return function(_0x4c8001){if(_0x4c8001){return _0x4034cc[_0xf4b4('0xe')](_0x34daaa)[_0xf4b4('0xf')](_0x4c8001);}};}function respondWithFilteredResult(_0x5da053,_0x11362e){return function(_0x2c2fbb){if(_0x2c2fbb){var _0x237b09=typeof _0x11362e['offset']===_0xf4b4('0x10')&&typeof _0x11362e['limit']===_0xf4b4('0x10');var _0x4ee7db=_0x2c2fbb[_0xf4b4('0x11')];var _0x6ba7f6=_0x237b09?0x0:_0x11362e[_0xf4b4('0x12')];var _0x3d7846=_0x237b09?_0x2c2fbb[_0xf4b4('0x11')]:_0x11362e[_0xf4b4('0x12')]+_0x11362e[_0xf4b4('0x13')];var _0x572b32;if(_0x3d7846>=_0x4ee7db){_0x3d7846=_0x4ee7db;_0x572b32=0xc8;}else{_0x572b32=0xce;}_0x5da053[_0xf4b4('0xe')](_0x572b32);return _0x5da053[_0xf4b4('0x14')](_0xf4b4('0x15'),_0x6ba7f6+'-'+_0x3d7846+'/'+_0x4ee7db)[_0xf4b4('0xf')](_0x2c2fbb);}return null;};}function saveUpdates(_0x303b5a){return function(_0x35af51){if(_0x35af51){return _0x35af51['update'](_0x303b5a)[_0xf4b4('0x16')](function(_0x39a1d8){return _0x39a1d8;});}return null;};}function removeEntity(_0x45e7a7){return function(_0xe2f5bb){if(_0xe2f5bb){return _0xe2f5bb[_0xf4b4('0x17')]()[_0xf4b4('0x16')](function(){var _0x311efa=_0xe2f5bb[_0xf4b4('0x18')]({'plain':!![]});var _0x33778a=_0xf4b4('0x19');return db[_0xf4b4('0x1a')]['destroy']({'where':{'type':_0x33778a,'resourceId':_0x311efa['id']}})[_0xf4b4('0x16')](function(){return _0xe2f5bb;});})[_0xf4b4('0x16')](function(){_0x45e7a7[_0xf4b4('0xe')](0xcc)[_0xf4b4('0x1b')]();});}};}function handleEntityNotFound(_0x2fb546){return function(_0x36362a){if(!_0x36362a){_0x2fb546[_0xf4b4('0xd')](0x194);}return _0x36362a;};}function handleError(_0x349df4,_0x5a660c){_0x5a660c=_0x5a660c||0x1f4;return function(_0x3bf9f7){logger[_0xf4b4('0x1c')](_0x3bf9f7['stack']);if(_0x3bf9f7[_0xf4b4('0x1d')]){delete _0x3bf9f7[_0xf4b4('0x1d')];}_0x349df4[_0xf4b4('0xe')](_0x5a660c)[_0xf4b4('0x1e')](_0x3bf9f7);};}exports[_0xf4b4('0x1f')]=function(_0x378e99,_0x21042a){var _0x50ab88={};var _0x29b89b={'count':0x0,'rows':[]};var _0x346818=_[_0xf4b4('0x20')](db[_0xf4b4('0x21')]['rawAttributes'],function(_0x287abe){return{'name':_0x287abe['fieldName'],'type':_0x287abe[_0xf4b4('0x22')][_0xf4b4('0x23')]};});_0x50ab88=qs['getOptions'](_0x346818,_0x378e99);var _0x39884c={'where':_0x50ab88['where']};return db['OpenchannelQueue'][_0xf4b4('0x11')](_0x39884c)[_0xf4b4('0x16')](function(_0x5149b9){_0x29b89b[_0xf4b4('0x11')]=_0x5149b9;_0x50ab88[_0xf4b4('0x24')]=qs[_0xf4b4('0x24')](_0x378e99[_0xf4b4('0x25')]);return db[_0xf4b4('0x21')][_0xf4b4('0x26')](_0x50ab88);})[_0xf4b4('0x16')](function(_0x38158e){_0x29b89b[_0xf4b4('0x27')]=_0x38158e;return _0x29b89b;})[_0xf4b4('0x16')](respondWithFilteredResult(_0x21042a,_0x50ab88))[_0xf4b4('0x28')](handleError(_0x21042a,null));};exports[_0xf4b4('0x29')]=function(_0x5362bf,_0x2d6430){var _0x323b56={'raw':!![],'where':{'id':_0x5362bf[_0xf4b4('0x2a')]['id']}},_0x2b2848={};_0x2b2848[_0xf4b4('0x2b')]=_[_0xf4b4('0x2c')](db['OpenchannelQueue'][_0xf4b4('0x2d')]);_0x2b2848[_0xf4b4('0x25')]=_[_0xf4b4('0x2c')](_0x5362bf[_0xf4b4('0x25')]);_0x2b2848[_0xf4b4('0x2e')]=_[_0xf4b4('0x2f')](_0x2b2848[_0xf4b4('0x2b')],_0x2b2848[_0xf4b4('0x25')]);_0x323b56[_0xf4b4('0x30')]=_[_0xf4b4('0x2f')](_0x2b2848[_0xf4b4('0x2b')],qs[_0xf4b4('0x31')](_0x5362bf[_0xf4b4('0x25')]['fields']));_0x323b56[_0xf4b4('0x30')]=_0x323b56[_0xf4b4('0x30')][_0xf4b4('0x32')]?_0x323b56['attributes']:_0x2b2848[_0xf4b4('0x2b')];if(_0x5362bf[_0xf4b4('0x25')][_0xf4b4('0x33')]){_0x323b56['include']=[{'all':!![]}];}_0x323b56=_[_0xf4b4('0x34')]({},_0x323b56,_0x5362bf[_0xf4b4('0x35')]);return db[_0xf4b4('0x21')][_0xf4b4('0x36')](_0x323b56)[_0xf4b4('0x16')](handleEntityNotFound(_0x2d6430,null))['then'](respondWithResult(_0x2d6430,null))[_0xf4b4('0x28')](handleError(_0x2d6430,null));};exports['create']=function(_0x667951,_0x3a8a03){return db['OpenchannelQueue'][_0xf4b4('0x37')](_0x667951['body'],{})[_0xf4b4('0x16')](function(_0x2cca20){var _0x30a3fa=_0x667951[_0xf4b4('0x38')][_0xf4b4('0x18')]({'plain':!![]});if(!_0x30a3fa)throw new Error(_0xf4b4('0x39'));if(_0x30a3fa[_0xf4b4('0x3a')]===_0xf4b4('0x38')){var _0x52b28e=_0x2cca20[_0xf4b4('0x18')]({'plain':!![]});var _0x9041f='OpenchannelQueues';return db[_0xf4b4('0x3b')][_0xf4b4('0x36')]({'where':{'name':_0x9041f,'userProfileId':_0x30a3fa['userProfileId']},'raw':!![]})['then'](function(_0x296514){if(_0x296514&&_0x296514[_0xf4b4('0x3c')]===0x0){return db[_0xf4b4('0x1a')][_0xf4b4('0x37')]({'name':_0x52b28e[_0xf4b4('0x1d')],'resourceId':_0x52b28e['id'],'type':_0x296514[_0xf4b4('0x1d')],'sectionId':_0x296514['id']},{})[_0xf4b4('0x16')](function(){return _0x2cca20;});}else{return _0x2cca20;}})[_0xf4b4('0x28')](function(_0x400058){logger[_0xf4b4('0x1c')](_0xf4b4('0x3d'),_0x400058);throw _0x400058;});}return _0x2cca20;})[_0xf4b4('0x16')](respondWithResult(_0x3a8a03,0xc9))[_0xf4b4('0x28')](handleError(_0x3a8a03,null));};exports[_0xf4b4('0x3e')]=function(_0x2d981e,_0x241a43){if(_0x2d981e['body']['id']){delete _0x2d981e[_0xf4b4('0x3f')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x2d981e[_0xf4b4('0x2a')]['id']}})[_0xf4b4('0x16')](handleEntityNotFound(_0x241a43,null))[_0xf4b4('0x16')](saveUpdates(_0x2d981e[_0xf4b4('0x3f')],null))[_0xf4b4('0x16')](respondWithResult(_0x241a43,null))[_0xf4b4('0x28')](handleError(_0x241a43,null));};exports[_0xf4b4('0x17')]=function(_0x5a9fee,_0x411fd2){return db['OpenchannelQueue'][_0xf4b4('0x36')]({'where':{'id':_0x5a9fee['params']['id']}})[_0xf4b4('0x16')](handleEntityNotFound(_0x411fd2,null))[_0xf4b4('0x16')](removeEntity(_0x411fd2,null))['catch'](handleError(_0x411fd2,null));};exports[_0xf4b4('0x40')]=function(_0x30b699,_0x3975bc){return db[_0xf4b4('0x21')][_0xf4b4('0x40')]()['then'](respondWithResult(_0x3975bc,null))[_0xf4b4('0x28')](handleError(_0x3975bc,null));};exports[_0xf4b4('0x41')]=function(_0x4bdbf2,_0x172d97){var _0x2a6198={'raw':!![],'where':{}},_0x40afd9={},_0x4fe0b6;return db[_0xf4b4('0x21')][_0xf4b4('0x42')]({'where':{'id':_0x4bdbf2[_0xf4b4('0x2a')]['id']}})[_0xf4b4('0x16')](handleEntityNotFound(_0x172d97,null))['then'](function(_0x368b7b){if(_0x368b7b){_0x4fe0b6=_0x368b7b[_0xf4b4('0x18')]({'plain':!![]});_0x40afd9[_0xf4b4('0x2b')]=_[_0xf4b4('0x2c')](db[_0xf4b4('0x43')][_0xf4b4('0x2d')]);_0x40afd9[_0xf4b4('0x25')]=_[_0xf4b4('0x2c')](_0x4bdbf2[_0xf4b4('0x25')]);_0x40afd9[_0xf4b4('0x2e')]=_[_0xf4b4('0x2f')](_0x40afd9['model'],_0x40afd9[_0xf4b4('0x25')]);_0x2a6198[_0xf4b4('0x30')]=_[_0xf4b4('0x2f')](_0x40afd9[_0xf4b4('0x2b')],qs[_0xf4b4('0x31')](_0x4bdbf2[_0xf4b4('0x25')][_0xf4b4('0x31')]));_0x2a6198['attributes']=_0x2a6198[_0xf4b4('0x30')][_0xf4b4('0x32')]?_0x2a6198[_0xf4b4('0x30')]:_0x40afd9[_0xf4b4('0x2b')];if(!_0x4bdbf2[_0xf4b4('0x25')][_0xf4b4('0x44')](_0xf4b4('0x45'))){_0x2a6198['limit']=qs['limit'](_0x4bdbf2[_0xf4b4('0x25')]['limit']);_0x2a6198[_0xf4b4('0x12')]=qs['offset'](_0x4bdbf2['query'][_0xf4b4('0x12')]);}_0x2a6198[_0xf4b4('0x46')]=qs[_0xf4b4('0x47')](_0x4bdbf2[_0xf4b4('0x25')]['sort']);_0x2a6198[_0xf4b4('0x48')]=qs[_0xf4b4('0x2e')](_[_0xf4b4('0x49')](_0x4bdbf2[_0xf4b4('0x25')],_0x40afd9[_0xf4b4('0x2e')]));_0x2a6198[_0xf4b4('0x48')][_0xf4b4('0x4a')]=_0x368b7b['id'];if(_0x4bdbf2[_0xf4b4('0x25')]['filter']){_0x2a6198[_0xf4b4('0x48')]=_['merge'](_0x2a6198[_0xf4b4('0x48')],{'$or':_[_0xf4b4('0x20')](_0x2a6198[_0xf4b4('0x30')],function(_0x4194eb){var _0x50498d={};_0x50498d[_0x4194eb]={'$like':'%'+_0x4bdbf2[_0xf4b4('0x25')][_0xf4b4('0x4b')]+'%'};return _0x50498d;})});}_0x2a6198=_['merge']({},_0x2a6198,_0x4bdbf2[_0xf4b4('0x35')]);return db[_0xf4b4('0x43')][_0xf4b4('0x26')](_0x2a6198);}})['then'](function(_0x415535){if(_0x415535){return db[_0xf4b4('0x4c')]['findAndCountAll']({'where':{'id':_[_0xf4b4('0x20')](_0x415535,_0xf4b4('0x4d')),'role':_0xf4b4('0x4e')},'attributes':['id','name','openchannelPause',_0xf4b4('0x4f'),'createdAt']});}})[_0xf4b4('0x16')](function(_0x3ce94e){if(_0x3ce94e){return{'count':_0x3ce94e[_0xf4b4('0x11')],'rows':_[_0xf4b4('0x20')](_0x3ce94e['rows'],function(_0x111c73){return{'membername':_0x111c73[_0xf4b4('0x1d')],'UserId':_0x111c73['id'],'queue_name':_0x4fe0b6[_0xf4b4('0x1d')],'OpenchannelQueueId':_0x4fe0b6['id'],'interface':util['format']('%s/%s','SIP',_0x111c73['name']),'penalty':0x0,'paused':_0x111c73[_0xf4b4('0x50')],'createdAt':_0x111c73[_0xf4b4('0x51')],'updatedAt':_0x111c73[_0xf4b4('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf4b4('0x16')](respondWithFilteredResult(_0x172d97,_0x2a6198))[_0xf4b4('0x28')](handleError(_0x172d97,null));};exports['getTeams']=function(_0x4fef4e,_0x4e022c){var _0x12d30b={};var _0x518d73={};var _0x54813b;var _0x470fcf;return db['OpenchannelQueue'][_0xf4b4('0x42')]({'where':{'id':_0x4fef4e[_0xf4b4('0x2a')]['id']}})[_0xf4b4('0x16')](handleEntityNotFound(_0x4e022c,null))['then'](function(_0x13a755){if(_0x13a755){_0x54813b=_0x13a755;_0x518d73[_0xf4b4('0x2b')]=_[_0xf4b4('0x2c')](db[_0xf4b4('0x52')][_0xf4b4('0x2d')]);_0x518d73[_0xf4b4('0x25')]=_[_0xf4b4('0x2c')](_0x4fef4e[_0xf4b4('0x25')]);_0x518d73[_0xf4b4('0x2e')]=_[_0xf4b4('0x2f')](_0x518d73[_0xf4b4('0x2b')],_0x518d73[_0xf4b4('0x25')]);_0x12d30b[_0xf4b4('0x30')]=_['intersection'](_0x518d73['model'],qs[_0xf4b4('0x31')](_0x4fef4e['query'][_0xf4b4('0x31')]));_0x12d30b[_0xf4b4('0x30')]=_0x12d30b[_0xf4b4('0x30')][_0xf4b4('0x32')]?_0x12d30b[_0xf4b4('0x30')]:_0x518d73['model'];_0x12d30b[_0xf4b4('0x46')]=qs[_0xf4b4('0x47')](_0x4fef4e[_0xf4b4('0x25')]['sort']);_0x12d30b['where']=qs[_0xf4b4('0x2e')](_[_0xf4b4('0x49')](_0x4fef4e[_0xf4b4('0x25')],_0x518d73[_0xf4b4('0x2e')]));if(_0x4fef4e[_0xf4b4('0x25')]['filter']){_0x12d30b[_0xf4b4('0x48')]=_[_0xf4b4('0x34')](_0x12d30b[_0xf4b4('0x48')],{'$or':_[_0xf4b4('0x20')](_0x12d30b['attributes'],function(_0x3248e0){var _0x4a1246={};_0x4a1246[_0x3248e0]={'$like':'%'+_0x4fef4e[_0xf4b4('0x25')][_0xf4b4('0x4b')]+'%'};return _0x4a1246;})});}_0x12d30b=_[_0xf4b4('0x34')]({},_0x12d30b,_0x4fef4e[_0xf4b4('0x35')]);return _0x54813b[_0xf4b4('0x53')](_0x12d30b);}})[_0xf4b4('0x16')](function(_0x37cd2b){if(_0x37cd2b){_0x470fcf=_0x37cd2b[_0xf4b4('0x32')];if(!_0x4fef4e[_0xf4b4('0x25')][_0xf4b4('0x44')](_0xf4b4('0x45'))){_0x12d30b[_0xf4b4('0x13')]=qs[_0xf4b4('0x13')](_0x4fef4e[_0xf4b4('0x25')][_0xf4b4('0x13')]);_0x12d30b[_0xf4b4('0x12')]=qs[_0xf4b4('0x12')](_0x4fef4e['query']['offset']);}return _0x54813b[_0xf4b4('0x53')](_0x12d30b);}})[_0xf4b4('0x16')](function(_0x2432c7){if(_0x2432c7){return _0x2432c7?{'count':_0x470fcf,'rows':_0x2432c7}:null;}})[_0xf4b4('0x16')](respondWithResult(_0x4e022c,null))['catch'](handleError(_0x4e022c,null));};exports[_0xf4b4('0x54')]=function(_0x3ee8f8,_0x1f0c1e){var _0x1be9a8=_0x3ee8f8[_0xf4b4('0x3f')][_0xf4b4('0x55')];return db[_0xf4b4('0x52')]['findAll']({'where':{'id':_0x1be9a8},'attributes':['id'],'include':[{'model':db[_0xf4b4('0x4c')],'as':_0xf4b4('0x56'),'attributes':['id',_0xf4b4('0x1d'),_0xf4b4('0x57'),_0xf4b4('0x58'),_0xf4b4('0x59')],'raw':!![]}]})[_0xf4b4('0x16')](function(_0x4b62c3){if(_0x4b62c3){var _0x3c24b8=_[_0xf4b4('0x5a')](_0x4b62c3,function(_0x5f1456){var _0x4c2721=_0x5f1456['get']({'plain':!![]});return _0x4c2721[_0xf4b4('0x56')];});return db[_0xf4b4('0x21')][_0xf4b4('0x36')]({'where':{'id':_0x3ee8f8[_0xf4b4('0x2a')]['id']}})[_0xf4b4('0x16')](function(_0x25c69f){return db[_0xf4b4('0x5b')][_0xf4b4('0x5c')](function(_0x42646a){return _0x25c69f['addTeams'](_0x1be9a8,{'transaction':_0x42646a})[_0xf4b4('0x16')](function(){return BPromise[_0xf4b4('0x5d')](_0x3c24b8,function(_0xcbd072){return db[_0xf4b4('0x43')]['findOrCreate']({'where':{'UserId':_0xcbd072['id'],'OpenchannelQueueId':_0x3ee8f8[_0xf4b4('0x2a')]['id']},'transaction':_0x42646a});});})[_0xf4b4('0x16')](function(){_0x3c24b8[_0xf4b4('0x5e')](function(_0x41aac4){socket[_0xf4b4('0x5f')](_0xf4b4('0x60'),{'UserId':_0x41aac4['id'],'OpenchannelQueueId':_0x25c69f['id']});});});});});}})[_0xf4b4('0x16')](respondWithStatusCode(_0x1f0c1e,null))[_0xf4b4('0x28')](handleError(_0x1f0c1e,null));};exports[_0xf4b4('0x61')]=function(_0x1ea92,_0x21136a){return db[_0xf4b4('0x52')][_0xf4b4('0x26')]({'where':{'id':_0x1ea92[_0xf4b4('0x25')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf4b4('0x4c')],'as':_0xf4b4('0x56'),'attributes':['id'],'raw':!![]}]})[_0xf4b4('0x16')](handleEntityNotFound(_0x21136a,null))['then'](function(_0x30728d){var _0x5c7ebd=_['map'](_0x30728d,'id');var _0x52e260=[];var _0x3bc3e1=[];var _0x19ab91=squel[_0xf4b4('0x62')]();_0x19ab91[_0xf4b4('0x63')](_0xf4b4('0x64'))[_0xf4b4('0x65')](_0xf4b4('0x66'),'tq')[_0xf4b4('0x67')](_0xf4b4('0x68'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xf4b4('0x69'),_0x1ea92['params']['id']);for(var _0x159fca=0x0;_0x159fca<_0x30728d[_0xf4b4('0x32')];_0x159fca+=0x1){let _0x305766=_0x30728d[_0x159fca];for(var _0x45d4fa=0x0;_0x45d4fa<_0x305766[_0xf4b4('0x56')]['length'];_0x45d4fa+=0x1){let _0x40e4f8=_0x305766[_0xf4b4('0x56')][_0x45d4fa];var _0x264707=_0x19ab91[_0xf4b4('0x6a')]();_0x264707[_0xf4b4('0x48')]('ut.UserId\x20=\x20?',_0x40e4f8['id']);_0x3bc3e1[_0xf4b4('0x6b')](db[_0xf4b4('0x5b')][_0xf4b4('0x25')](_0x264707[_0xf4b4('0x6c')](),{'type':db[_0xf4b4('0x5b')][_0xf4b4('0x6d')][_0xf4b4('0x6e')]})[_0xf4b4('0x16')](function(_0x12d888){if(_0x12d888[_0xf4b4('0x32')]===0x1){return _0x40e4f8['id'];}else{var _0x1bd938=_['every'](_[_0xf4b4('0x20')](_0x12d888,_0xf4b4('0x6f')),function(_0xbb869c){return _[_0xf4b4('0x70')](_0x5c7ebd,_0xbb869c);});if(_0x1bd938){return _0x40e4f8['id'];}}}));}}return BPromise[_0xf4b4('0x71')](_0x3bc3e1)[_0xf4b4('0x16')](function(_0x1ee161){_0x52e260=_(_0x52e260)['union'](_0x1ee161)[_0xf4b4('0x72')]()[_0xf4b4('0x73')]();return db[_0xf4b4('0x21')]['find']({'where':{'id':_0x1ea92[_0xf4b4('0x2a')]['id']}})[_0xf4b4('0x16')](function(_0x834a4c){return db[_0xf4b4('0x5b')]['transaction'](function(_0x46a6a5){return _0x834a4c[_0xf4b4('0x61')](_0x1ea92[_0xf4b4('0x25')]['ids'],{'transaction':_0x46a6a5})[_0xf4b4('0x16')](function(){if(!_[_0xf4b4('0x74')](_0x52e260)){return _0x834a4c[_0xf4b4('0x75')](_0x52e260,{'transaction':_0x46a6a5});}})[_0xf4b4('0x16')](function(){_0x52e260['forEach'](function(_0x6a68aa){socket['emit'](_0xf4b4('0x76'),{'UserId':_0x6a68aa,'OpenchannelQueueId':_0x834a4c['id']});});});});});});})[_0xf4b4('0x16')](respondWithStatusCode(_0x21136a,null))[_0xf4b4('0x28')](handleError(_0x21136a,null));};exports[_0xf4b4('0x77')]=function(_0x182491,_0x57120f){return db['OpenchannelQueue'][_0xf4b4('0x36')]({'where':{'id':_0x182491[_0xf4b4('0x2a')]['id']}})['then'](handleEntityNotFound(_0x57120f,null))['then'](function(_0x3cd495){if(_0x3cd495){return _0x3cd495[_0xf4b4('0x77')](_0x182491[_0xf4b4('0x3f')][_0xf4b4('0x55')],_[_0xf4b4('0x78')](_0x182491['body'],[_0xf4b4('0x55'),'id'])||{})[_0xf4b4('0x79')](function(_0x231804){for(var _0xb514c0=0x0;_0xb514c0<_0x182491[_0xf4b4('0x3f')]['ids'][_0xf4b4('0x32')];_0xb514c0+=0x1){socket[_0xf4b4('0x5f')](_0xf4b4('0x60'),{'UserId':Number(_0x182491[_0xf4b4('0x3f')][_0xf4b4('0x55')][_0xb514c0]),'OpenchannelQueueId':Number(_0x182491[_0xf4b4('0x2a')]['id'])});}return _0x231804;});}})[_0xf4b4('0x16')](respondWithResult(_0x57120f,null))[_0xf4b4('0x28')](handleError(_0x57120f,null));};exports[_0xf4b4('0x75')]=function(_0x1dd88d,_0x51b78c){return db[_0xf4b4('0x21')][_0xf4b4('0x36')]({'where':{'id':_0x1dd88d[_0xf4b4('0x2a')]['id']}})['then'](handleEntityNotFound(_0x51b78c,null))[_0xf4b4('0x16')](function(_0x477c43){if(_0x477c43){return _0x477c43[_0xf4b4('0x75')](_0x1dd88d[_0xf4b4('0x25')]['ids'])[_0xf4b4('0x16')](function(){if(_[_0xf4b4('0x7a')](_0x1dd88d[_0xf4b4('0x25')][_0xf4b4('0x55')])){for(var _0x31310e=0x0;_0x31310e<_0x1dd88d[_0xf4b4('0x25')][_0xf4b4('0x55')]['length'];_0x31310e+=0x1){socket['emit'](_0xf4b4('0x76'),{'UserId':Number(_0x1dd88d['query'][_0xf4b4('0x55')][_0x31310e]),'OpenchannelQueueId':Number(_0x1dd88d[_0xf4b4('0x2a')]['id'])});}}else{socket[_0xf4b4('0x5f')](_0xf4b4('0x76'),{'UserId':Number(_0x1dd88d[_0xf4b4('0x25')][_0xf4b4('0x55')]),'OpenchannelQueueId':Number(_0x1dd88d[_0xf4b4('0x2a')]['id'])});}});}})[_0xf4b4('0x16')](respondWithStatusCode(_0x51b78c,null))[_0xf4b4('0x28')](handleError(_0x51b78c,null));};exports[_0xf4b4('0x7b')]=function(_0x2a5a13,_0x2a974a){var _0x5c35ec={};var _0x2e0571={};var _0x5a9ffd;var _0x491a6b;return db[_0xf4b4('0x21')][_0xf4b4('0x42')]({'where':{'id':_0x2a5a13[_0xf4b4('0x2a')]['id']}})[_0xf4b4('0x16')](handleEntityNotFound(_0x2a974a,null))[_0xf4b4('0x16')](function(_0x268e06){if(_0x268e06){_0x5a9ffd=_0x268e06;_0x2e0571[_0xf4b4('0x2b')]=_[_0xf4b4('0x2c')](db[_0xf4b4('0x4c')][_0xf4b4('0x2d')]);_0x2e0571['query']=_[_0xf4b4('0x2c')](_0x2a5a13['query']);_0x2e0571[_0xf4b4('0x2e')]=_[_0xf4b4('0x2f')](_0x2e0571['model'],_0x2e0571[_0xf4b4('0x25')]);_0x5c35ec[_0xf4b4('0x30')]=_[_0xf4b4('0x2f')](_0x2e0571[_0xf4b4('0x2b')],qs[_0xf4b4('0x31')](_0x2a5a13['query'][_0xf4b4('0x31')]));_0x5c35ec['attributes']=_0x5c35ec['attributes'][_0xf4b4('0x32')]?_0x5c35ec['attributes']:_0x2e0571[_0xf4b4('0x2b')];_0x5c35ec[_0xf4b4('0x46')]=qs[_0xf4b4('0x47')](_0x2a5a13[_0xf4b4('0x25')][_0xf4b4('0x47')]);_0x5c35ec[_0xf4b4('0x48')]=qs[_0xf4b4('0x2e')](_[_0xf4b4('0x49')](_0x2a5a13['query'],_0x2e0571['filters']));if(_0x2a5a13[_0xf4b4('0x25')][_0xf4b4('0x4b')]){_0x5c35ec['where']=_[_0xf4b4('0x34')](_0x5c35ec[_0xf4b4('0x48')],{'$or':_[_0xf4b4('0x20')](_0x5c35ec['attributes'],function(_0x2c10f5){var _0x174ab2={};_0x174ab2[_0x2c10f5]={'$like':'%'+_0x2a5a13[_0xf4b4('0x25')]['filter']+'%'};return _0x174ab2;})});}_0x5c35ec=_[_0xf4b4('0x34')]({},_0x5c35ec,_0x2a5a13[_0xf4b4('0x35')]);return _0x5a9ffd[_0xf4b4('0x7b')](_0x5c35ec);}})[_0xf4b4('0x16')](function(_0xe2cbc){if(_0xe2cbc){_0x491a6b=_0xe2cbc['length'];if(!_0x2a5a13[_0xf4b4('0x25')][_0xf4b4('0x44')](_0xf4b4('0x45'))){_0x5c35ec['limit']=qs[_0xf4b4('0x13')](_0x2a5a13[_0xf4b4('0x25')][_0xf4b4('0x13')]);_0x5c35ec[_0xf4b4('0x12')]=qs[_0xf4b4('0x12')](_0x2a5a13[_0xf4b4('0x25')]['offset']);}return _0x5a9ffd[_0xf4b4('0x7b')](_0x5c35ec);}})[_0xf4b4('0x16')](function(_0x378278){if(_0x378278){return _0x378278?{'count':_0x491a6b,'rows':_0x378278}:null;}})[_0xf4b4('0x16')](respondWithResult(_0x2a974a,null))[_0xf4b4('0x28')](handleError(_0x2a974a,null));}; \ No newline at end of file +var _0xc552=['OpenchannelQueueId','filter','map','findAndCountAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','removeTeams','Agents','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','User','order','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','json','update','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','intersection','attributes','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','sort','pick','filters'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xc552,0x1ad));var _0x2c55=function(_0x2c699e,_0x5e9d6c){_0x2c699e=_0x2c699e-0x0;var _0x5844e3=_0xc552[_0x2c699e];return _0x5844e3;};'use strict';var BPromise=require(_0x2c55('0x0'));var util=require('util');var _=require(_0x2c55('0x1'));var squel=require('squel');var Redis=require(_0x2c55('0x2'));var qs=require(_0x2c55('0x3'));var logger=require(_0x2c55('0x4'))(_0x2c55('0x5'));var config=require(_0x2c55('0x6'));var db=require('../../mysqldb')['db'];config[_0x2c55('0x7')]=_[_0x2c55('0x8')](config[_0x2c55('0x7')],{'host':_0x2c55('0x9'),'port':0x18eb});var socket=require(_0x2c55('0xa'))(new Redis(config[_0x2c55('0x7')]));require('./openchannelQueue.socket')[_0x2c55('0xb')](socket);function respondWithStatusCode(_0x241c11,_0x181006){_0x181006=_0x181006||0xcc;return function(_0x5b2f1b){if(_0x5b2f1b){return _0x241c11[_0x2c55('0xc')](_0x181006);}return _0x241c11['status'](_0x181006)[_0x2c55('0xd')]();};}function respondWithResult(_0x36e597,_0x29981d){_0x29981d=_0x29981d||0xc8;return function(_0x1b39b6){if(_0x1b39b6){return _0x36e597[_0x2c55('0xe')](_0x29981d)['json'](_0x1b39b6);}};}function respondWithFilteredResult(_0x731362,_0x29dfa3){return function(_0x69c252){if(_0x69c252){var _0x21800c=typeof _0x29dfa3[_0x2c55('0xf')]===_0x2c55('0x10')&&typeof _0x29dfa3[_0x2c55('0x11')]===_0x2c55('0x10');var _0x2f1cf2=_0x69c252['count'];var _0x7fbd76=_0x21800c?0x0:_0x29dfa3[_0x2c55('0xf')];var _0x9555c=_0x21800c?_0x69c252[_0x2c55('0x12')]:_0x29dfa3[_0x2c55('0xf')]+_0x29dfa3[_0x2c55('0x11')];var _0x3379eb;if(_0x9555c>=_0x2f1cf2){_0x9555c=_0x2f1cf2;_0x3379eb=0xc8;}else{_0x3379eb=0xce;}_0x731362[_0x2c55('0xe')](_0x3379eb);return _0x731362['set']('Content-Range',_0x7fbd76+'-'+_0x9555c+'/'+_0x2f1cf2)[_0x2c55('0x13')](_0x69c252);}return null;};}function saveUpdates(_0x3f448d){return function(_0x3f8532){if(_0x3f8532){return _0x3f8532[_0x2c55('0x14')](_0x3f448d)[_0x2c55('0x15')](function(_0x7a4506){return _0x7a4506;});}return null;};}function removeEntity(_0x544cbb){return function(_0x399dd8){if(_0x399dd8){return _0x399dd8['destroy']()[_0x2c55('0x15')](function(){var _0x56fca1=_0x399dd8[_0x2c55('0x16')]({'plain':!![]});var _0x1f7889=_0x2c55('0x17');return db[_0x2c55('0x18')]['destroy']({'where':{'type':_0x1f7889,'resourceId':_0x56fca1['id']}})[_0x2c55('0x15')](function(){return _0x399dd8;});})['then'](function(){_0x544cbb[_0x2c55('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaf61ec){return function(_0x44e995){if(!_0x44e995){_0xaf61ec[_0x2c55('0xc')](0x194);}return _0x44e995;};}function handleError(_0xfc2a96,_0x163da1){_0x163da1=_0x163da1||0x1f4;return function(_0x24348e){logger[_0x2c55('0x19')](_0x24348e[_0x2c55('0x1a')]);if(_0x24348e[_0x2c55('0x1b')]){delete _0x24348e[_0x2c55('0x1b')];}_0xfc2a96[_0x2c55('0xe')](_0x163da1)[_0x2c55('0x1c')](_0x24348e);};}exports[_0x2c55('0x1d')]=function(_0x1d19e6,_0x3b7d7){var _0x2e0316={};var _0x79ac39={'count':0x0,'rows':[]};var _0x30c896=_['map'](db[_0x2c55('0x1e')][_0x2c55('0x1f')],function(_0x5a7aba){return{'name':_0x5a7aba['fieldName'],'type':_0x5a7aba[_0x2c55('0x20')][_0x2c55('0x21')]};});_0x2e0316=qs[_0x2c55('0x22')](_0x30c896,_0x1d19e6);var _0x2ff873={'where':_0x2e0316[_0x2c55('0x23')]};return db[_0x2c55('0x1e')]['count'](_0x2ff873)['then'](function(_0x1c5e84){_0x79ac39[_0x2c55('0x12')]=_0x1c5e84;_0x2e0316['include']=qs[_0x2c55('0x24')](_0x1d19e6[_0x2c55('0x25')]);return db[_0x2c55('0x1e')][_0x2c55('0x26')](_0x2e0316);})[_0x2c55('0x15')](function(_0x2d60e0){_0x79ac39[_0x2c55('0x27')]=_0x2d60e0;return _0x79ac39;})[_0x2c55('0x15')](respondWithFilteredResult(_0x3b7d7,_0x2e0316))[_0x2c55('0x28')](handleError(_0x3b7d7,null));};exports[_0x2c55('0x29')]=function(_0x2c6d3e,_0x519b4a){var _0xfed50e={'raw':!![],'where':{'id':_0x2c6d3e[_0x2c55('0x2a')]['id']}},_0x2db967={};_0x2db967[_0x2c55('0x2b')]=_[_0x2c55('0x2c')](db[_0x2c55('0x1e')][_0x2c55('0x1f')]);_0x2db967[_0x2c55('0x25')]=_[_0x2c55('0x2c')](_0x2c6d3e[_0x2c55('0x25')]);_0x2db967['filters']=_[_0x2c55('0x2d')](_0x2db967['model'],_0x2db967[_0x2c55('0x25')]);_0xfed50e[_0x2c55('0x2e')]=_['intersection'](_0x2db967[_0x2c55('0x2b')],qs[_0x2c55('0x2f')](_0x2c6d3e[_0x2c55('0x25')]['fields']));_0xfed50e[_0x2c55('0x2e')]=_0xfed50e[_0x2c55('0x2e')][_0x2c55('0x30')]?_0xfed50e[_0x2c55('0x2e')]:_0x2db967[_0x2c55('0x2b')];if(_0x2c6d3e[_0x2c55('0x25')]['includeAll']){_0xfed50e['include']=[{'all':!![]}];}_0xfed50e=_[_0x2c55('0x31')]({},_0xfed50e,_0x2c6d3e[_0x2c55('0x32')]);return db[_0x2c55('0x1e')][_0x2c55('0x33')](_0xfed50e)[_0x2c55('0x15')](handleEntityNotFound(_0x519b4a,null))[_0x2c55('0x15')](respondWithResult(_0x519b4a,null))[_0x2c55('0x28')](handleError(_0x519b4a,null));};exports['create']=function(_0x3a1d3d,_0x276949){return db['OpenchannelQueue'][_0x2c55('0x34')](_0x3a1d3d[_0x2c55('0x35')],{})[_0x2c55('0x15')](function(_0xd2c5df){var _0x5c3cdc=_0x3a1d3d[_0x2c55('0x36')][_0x2c55('0x16')]({'plain':!![]});if(!_0x5c3cdc)throw new Error(_0x2c55('0x37'));if(_0x5c3cdc[_0x2c55('0x38')]===_0x2c55('0x36')){var _0x2fc575=_0xd2c5df[_0x2c55('0x16')]({'plain':!![]});var _0x31ede8='OpenchannelQueues';return db[_0x2c55('0x39')]['find']({'where':{'name':_0x31ede8,'userProfileId':_0x5c3cdc[_0x2c55('0x3a')]},'raw':!![]})[_0x2c55('0x15')](function(_0xd99ea2){if(_0xd99ea2&&_0xd99ea2[_0x2c55('0x3b')]===0x0){return db[_0x2c55('0x18')][_0x2c55('0x34')]({'name':_0x2fc575['name'],'resourceId':_0x2fc575['id'],'type':_0xd99ea2[_0x2c55('0x1b')],'sectionId':_0xd99ea2['id']},{})[_0x2c55('0x15')](function(){return _0xd2c5df;});}else{return _0xd2c5df;}})[_0x2c55('0x28')](function(_0x17f072){logger[_0x2c55('0x19')](_0x2c55('0x3c'),_0x17f072);throw _0x17f072;});}return _0xd2c5df;})[_0x2c55('0x15')](respondWithResult(_0x276949,0xc9))[_0x2c55('0x28')](handleError(_0x276949,null));};exports[_0x2c55('0x14')]=function(_0x1eb786,_0x18ced8){if(_0x1eb786[_0x2c55('0x35')]['id']){delete _0x1eb786[_0x2c55('0x35')]['id'];}return db['OpenchannelQueue'][_0x2c55('0x33')]({'where':{'id':_0x1eb786[_0x2c55('0x2a')]['id']}})[_0x2c55('0x15')](handleEntityNotFound(_0x18ced8,null))[_0x2c55('0x15')](saveUpdates(_0x1eb786[_0x2c55('0x35')],null))[_0x2c55('0x15')](respondWithResult(_0x18ced8,null))[_0x2c55('0x28')](handleError(_0x18ced8,null));};exports[_0x2c55('0x3d')]=function(_0x5b20c5,_0x5b7d7c){return db[_0x2c55('0x1e')][_0x2c55('0x33')]({'where':{'id':_0x5b20c5[_0x2c55('0x2a')]['id']}})[_0x2c55('0x15')](handleEntityNotFound(_0x5b7d7c,null))[_0x2c55('0x15')](removeEntity(_0x5b7d7c,null))[_0x2c55('0x28')](handleError(_0x5b7d7c,null));};exports['describe']=function(_0x477a3f,_0x325b20){return db[_0x2c55('0x1e')][_0x2c55('0x3e')]()[_0x2c55('0x15')](respondWithResult(_0x325b20,null))[_0x2c55('0x28')](handleError(_0x325b20,null));};exports[_0x2c55('0x3f')]=function(_0x4170b0,_0x28eeeb){var _0x1a9f3f={'raw':!![],'where':{}},_0x4fbd6c={},_0x35816a;return db[_0x2c55('0x1e')][_0x2c55('0x40')]({'where':{'id':_0x4170b0[_0x2c55('0x2a')]['id']}})[_0x2c55('0x15')](handleEntityNotFound(_0x28eeeb,null))[_0x2c55('0x15')](function(_0x58220c){if(_0x58220c){_0x35816a=_0x58220c['get']({'plain':!![]});_0x4fbd6c[_0x2c55('0x2b')]=_[_0x2c55('0x2c')](db[_0x2c55('0x41')]['rawAttributes']);_0x4fbd6c[_0x2c55('0x25')]=_[_0x2c55('0x2c')](_0x4170b0[_0x2c55('0x25')]);_0x4fbd6c['filters']=_[_0x2c55('0x2d')](_0x4fbd6c[_0x2c55('0x2b')],_0x4fbd6c['query']);_0x1a9f3f[_0x2c55('0x2e')]=_[_0x2c55('0x2d')](_0x4fbd6c[_0x2c55('0x2b')],qs[_0x2c55('0x2f')](_0x4170b0['query'][_0x2c55('0x2f')]));_0x1a9f3f['attributes']=_0x1a9f3f[_0x2c55('0x2e')]['length']?_0x1a9f3f['attributes']:_0x4fbd6c['model'];if(!_0x4170b0[_0x2c55('0x25')][_0x2c55('0x42')](_0x2c55('0x43'))){_0x1a9f3f['limit']=qs[_0x2c55('0x11')](_0x4170b0[_0x2c55('0x25')][_0x2c55('0x11')]);_0x1a9f3f[_0x2c55('0xf')]=qs['offset'](_0x4170b0[_0x2c55('0x25')]['offset']);}_0x1a9f3f['order']=qs[_0x2c55('0x44')](_0x4170b0[_0x2c55('0x25')][_0x2c55('0x44')]);_0x1a9f3f['where']=qs['filters'](_[_0x2c55('0x45')](_0x4170b0[_0x2c55('0x25')],_0x4fbd6c[_0x2c55('0x46')]));_0x1a9f3f['where'][_0x2c55('0x47')]=_0x58220c['id'];if(_0x4170b0[_0x2c55('0x25')][_0x2c55('0x48')]){_0x1a9f3f[_0x2c55('0x23')]=_[_0x2c55('0x31')](_0x1a9f3f[_0x2c55('0x23')],{'$or':_[_0x2c55('0x49')](_0x1a9f3f[_0x2c55('0x2e')],function(_0x4234fa){var _0x4abbdc={};_0x4abbdc[_0x4234fa]={'$like':'%'+_0x4170b0[_0x2c55('0x25')][_0x2c55('0x48')]+'%'};return _0x4abbdc;})});}_0x1a9f3f=_[_0x2c55('0x31')]({},_0x1a9f3f,_0x4170b0[_0x2c55('0x32')]);return db['UserOpenchannelQueue'][_0x2c55('0x26')](_0x1a9f3f);}})[_0x2c55('0x15')](function(_0x294b5e){if(_0x294b5e){return db['User'][_0x2c55('0x4a')]({'where':{'id':_[_0x2c55('0x49')](_0x294b5e,_0x2c55('0x4b')),'role':'agent'},'attributes':['id',_0x2c55('0x1b'),_0x2c55('0x4c'),'updatedAt',_0x2c55('0x4d')]});}})[_0x2c55('0x15')](function(_0x36fa60){if(_0x36fa60){return{'count':_0x36fa60[_0x2c55('0x12')],'rows':_[_0x2c55('0x49')](_0x36fa60[_0x2c55('0x27')],function(_0x4f4850){return{'membername':_0x4f4850[_0x2c55('0x1b')],'UserId':_0x4f4850['id'],'queue_name':_0x35816a[_0x2c55('0x1b')],'OpenchannelQueueId':_0x35816a['id'],'interface':util[_0x2c55('0x4e')](_0x2c55('0x4f'),_0x2c55('0x50'),_0x4f4850[_0x2c55('0x1b')]),'penalty':0x0,'paused':_0x4f4850['openchannelPause'],'createdAt':_0x4f4850[_0x2c55('0x4d')],'updatedAt':_0x4f4850['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2c55('0x15')](respondWithFilteredResult(_0x28eeeb,_0x1a9f3f))[_0x2c55('0x28')](handleError(_0x28eeeb,null));};exports[_0x2c55('0x51')]=function(_0x1dbbe8,_0x2065de){var _0x123b7f={};var _0x34bf91={};var _0x4b8c61;var _0x43dacd;return db[_0x2c55('0x1e')][_0x2c55('0x40')]({'where':{'id':_0x1dbbe8['params']['id']}})['then'](handleEntityNotFound(_0x2065de,null))[_0x2c55('0x15')](function(_0xdc88ac){if(_0xdc88ac){_0x4b8c61=_0xdc88ac;_0x34bf91[_0x2c55('0x2b')]=_[_0x2c55('0x2c')](db['Team']['rawAttributes']);_0x34bf91['query']=_[_0x2c55('0x2c')](_0x1dbbe8['query']);_0x34bf91[_0x2c55('0x46')]=_[_0x2c55('0x2d')](_0x34bf91[_0x2c55('0x2b')],_0x34bf91[_0x2c55('0x25')]);_0x123b7f[_0x2c55('0x2e')]=_[_0x2c55('0x2d')](_0x34bf91[_0x2c55('0x2b')],qs['fields'](_0x1dbbe8[_0x2c55('0x25')][_0x2c55('0x2f')]));_0x123b7f[_0x2c55('0x2e')]=_0x123b7f['attributes'][_0x2c55('0x30')]?_0x123b7f[_0x2c55('0x2e')]:_0x34bf91[_0x2c55('0x2b')];_0x123b7f['order']=qs['sort'](_0x1dbbe8['query'][_0x2c55('0x44')]);_0x123b7f['where']=qs[_0x2c55('0x46')](_[_0x2c55('0x45')](_0x1dbbe8['query'],_0x34bf91['filters']));if(_0x1dbbe8[_0x2c55('0x25')][_0x2c55('0x48')]){_0x123b7f['where']=_[_0x2c55('0x31')](_0x123b7f['where'],{'$or':_[_0x2c55('0x49')](_0x123b7f[_0x2c55('0x2e')],function(_0x531944){var _0x2e00d4={};_0x2e00d4[_0x531944]={'$like':'%'+_0x1dbbe8[_0x2c55('0x25')][_0x2c55('0x48')]+'%'};return _0x2e00d4;})});}_0x123b7f=_['merge']({},_0x123b7f,_0x1dbbe8[_0x2c55('0x32')]);return _0x4b8c61[_0x2c55('0x51')](_0x123b7f);}})[_0x2c55('0x15')](function(_0x3c2159){if(_0x3c2159){_0x43dacd=_0x3c2159[_0x2c55('0x30')];if(!_0x1dbbe8[_0x2c55('0x25')]['hasOwnProperty']('nolimit')){_0x123b7f[_0x2c55('0x11')]=qs['limit'](_0x1dbbe8[_0x2c55('0x25')]['limit']);_0x123b7f[_0x2c55('0xf')]=qs[_0x2c55('0xf')](_0x1dbbe8['query'][_0x2c55('0xf')]);}return _0x4b8c61[_0x2c55('0x51')](_0x123b7f);}})[_0x2c55('0x15')](function(_0x5516b1){if(_0x5516b1){return _0x5516b1?{'count':_0x43dacd,'rows':_0x5516b1}:null;}})[_0x2c55('0x15')](respondWithResult(_0x2065de,null))[_0x2c55('0x28')](handleError(_0x2065de,null));};exports[_0x2c55('0x52')]=function(_0x48a096,_0x4f4239){var _0x394d16=_0x48a096[_0x2c55('0x35')][_0x2c55('0x53')];return db[_0x2c55('0x54')][_0x2c55('0x26')]({'where':{'id':_0x394d16},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x2c55('0x1b'),_0x2c55('0x55'),_0x2c55('0x56'),_0x2c55('0x57')],'raw':!![]}]})['then'](function(_0x4d8479){if(_0x4d8479){var _0x533236=_[_0x2c55('0x58')](_0x4d8479,function(_0x4158b0){var _0x511f08=_0x4158b0[_0x2c55('0x16')]({'plain':!![]});return _0x511f08['Agents'];});return db[_0x2c55('0x1e')][_0x2c55('0x33')]({'where':{'id':_0x48a096[_0x2c55('0x2a')]['id']}})[_0x2c55('0x15')](function(_0x2d0258){return db[_0x2c55('0x59')][_0x2c55('0x5a')](function(_0x31cb63){return _0x2d0258[_0x2c55('0x52')](_0x394d16,{'transaction':_0x31cb63})[_0x2c55('0x15')](function(){return BPromise['each'](_0x533236,function(_0x2f2a6a){return db['UserOpenchannelQueue'][_0x2c55('0x5b')]({'where':{'UserId':_0x2f2a6a['id'],'OpenchannelQueueId':_0x48a096[_0x2c55('0x2a')]['id']},'transaction':_0x31cb63});});})[_0x2c55('0x15')](function(){_0x533236['forEach'](function(_0x130a4d){socket[_0x2c55('0x5c')]('userOpenchannelQueue:save',{'UserId':_0x130a4d['id'],'OpenchannelQueueId':_0x2d0258['id']});});});});});}})[_0x2c55('0x15')](respondWithStatusCode(_0x4f4239,null))[_0x2c55('0x28')](handleError(_0x4f4239,null));};exports[_0x2c55('0x5d')]=function(_0x2cec6c,_0x3674c4){return db[_0x2c55('0x54')][_0x2c55('0x26')]({'where':{'id':_0x2cec6c[_0x2c55('0x25')][_0x2c55('0x53')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2c55('0x5e'),'attributes':['id'],'raw':!![]}]})[_0x2c55('0x15')](handleEntityNotFound(_0x3674c4,null))[_0x2c55('0x15')](function(_0x3d2858){var _0x2fb767=_[_0x2c55('0x49')](_0x3d2858,'id');var _0x276455=[];var _0x47cc13=[];var _0x55ff07=squel['select']();_0x55ff07[_0x2c55('0x5f')](_0x2c55('0x60'))[_0x2c55('0x61')]('team_has_openchannel_queues','tq')[_0x2c55('0x62')](_0x2c55('0x63'),'ut',_0x2c55('0x64'))[_0x2c55('0x23')]('OpenchannelQueueId\x20=\x20?',_0x2cec6c[_0x2c55('0x2a')]['id']);for(var _0x31a05e=0x0;_0x31a05e<_0x3d2858[_0x2c55('0x30')];_0x31a05e+=0x1){let _0x1cbb58=_0x3d2858[_0x31a05e];for(var _0x2f092c=0x0;_0x2f092c<_0x1cbb58[_0x2c55('0x5e')]['length'];_0x2f092c+=0x1){let _0x48ca87=_0x1cbb58[_0x2c55('0x5e')][_0x2f092c];var _0x12690c=_0x55ff07[_0x2c55('0x65')]();_0x12690c[_0x2c55('0x23')](_0x2c55('0x66'),_0x48ca87['id']);_0x47cc13[_0x2c55('0x67')](db[_0x2c55('0x59')]['query'](_0x12690c[_0x2c55('0x68')](),{'type':db[_0x2c55('0x59')][_0x2c55('0x69')][_0x2c55('0x6a')]})['then'](function(_0x104f2b){if(_0x104f2b[_0x2c55('0x30')]===0x1){return _0x48ca87['id'];}else{var _0x4dae02=_[_0x2c55('0x6b')](_[_0x2c55('0x49')](_0x104f2b,_0x2c55('0x6c')),function(_0x1948ae){return _[_0x2c55('0x6d')](_0x2fb767,_0x1948ae);});if(_0x4dae02){return _0x48ca87['id'];}}}));}}return BPromise[_0x2c55('0x6e')](_0x47cc13)[_0x2c55('0x15')](function(_0xd3d5a1){_0x276455=_(_0x276455)['union'](_0xd3d5a1)[_0x2c55('0x6f')]()[_0x2c55('0x70')]();return db[_0x2c55('0x1e')][_0x2c55('0x33')]({'where':{'id':_0x2cec6c[_0x2c55('0x2a')]['id']}})[_0x2c55('0x15')](function(_0x1c8ef4){return db[_0x2c55('0x59')][_0x2c55('0x5a')](function(_0x413e3d){return _0x1c8ef4[_0x2c55('0x5d')](_0x2cec6c[_0x2c55('0x25')][_0x2c55('0x53')],{'transaction':_0x413e3d})['then'](function(){if(!_[_0x2c55('0x71')](_0x276455)){return _0x1c8ef4[_0x2c55('0x72')](_0x276455,{'transaction':_0x413e3d});}})[_0x2c55('0x15')](function(){_0x276455[_0x2c55('0x73')](function(_0x23ae21){socket[_0x2c55('0x5c')]('userOpenchannelQueue:remove',{'UserId':_0x23ae21,'OpenchannelQueueId':_0x1c8ef4['id']});});});});});});})[_0x2c55('0x15')](respondWithStatusCode(_0x3674c4,null))[_0x2c55('0x28')](handleError(_0x3674c4,null));};exports[_0x2c55('0x74')]=function(_0x124a9b,_0x1a1574){return db[_0x2c55('0x1e')][_0x2c55('0x33')]({'where':{'id':_0x124a9b[_0x2c55('0x2a')]['id']}})[_0x2c55('0x15')](handleEntityNotFound(_0x1a1574,null))['then'](function(_0x4b38b0){if(_0x4b38b0){return _0x4b38b0[_0x2c55('0x74')](_0x124a9b[_0x2c55('0x35')]['ids'],_[_0x2c55('0x75')](_0x124a9b[_0x2c55('0x35')],[_0x2c55('0x53'),'id'])||{})[_0x2c55('0x76')](function(_0x9ca558){for(var _0xe73c17=0x0;_0xe73c17<_0x124a9b[_0x2c55('0x35')][_0x2c55('0x53')][_0x2c55('0x30')];_0xe73c17+=0x1){socket['emit'](_0x2c55('0x77'),{'UserId':Number(_0x124a9b[_0x2c55('0x35')][_0x2c55('0x53')][_0xe73c17]),'OpenchannelQueueId':Number(_0x124a9b[_0x2c55('0x2a')]['id'])});}return _0x9ca558;});}})['then'](respondWithResult(_0x1a1574,null))['catch'](handleError(_0x1a1574,null));};exports[_0x2c55('0x72')]=function(_0x338d7e,_0x6c638a){return db[_0x2c55('0x1e')][_0x2c55('0x33')]({'where':{'id':_0x338d7e['params']['id']}})['then'](handleEntityNotFound(_0x6c638a,null))['then'](function(_0x130b80){if(_0x130b80){return _0x130b80[_0x2c55('0x72')](_0x338d7e[_0x2c55('0x25')]['ids'])[_0x2c55('0x15')](function(){if(_[_0x2c55('0x78')](_0x338d7e['query']['ids'])){for(var _0x242bf9=0x0;_0x242bf9<_0x338d7e[_0x2c55('0x25')][_0x2c55('0x53')][_0x2c55('0x30')];_0x242bf9+=0x1){socket[_0x2c55('0x5c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x338d7e[_0x2c55('0x25')][_0x2c55('0x53')][_0x242bf9]),'OpenchannelQueueId':Number(_0x338d7e[_0x2c55('0x2a')]['id'])});}}else{socket[_0x2c55('0x5c')](_0x2c55('0x79'),{'UserId':Number(_0x338d7e[_0x2c55('0x25')]['ids']),'OpenchannelQueueId':Number(_0x338d7e[_0x2c55('0x2a')]['id'])});}});}})[_0x2c55('0x15')](respondWithStatusCode(_0x6c638a,null))[_0x2c55('0x28')](handleError(_0x6c638a,null));};exports['getAgents']=function(_0x55cae3,_0x358069){var _0x57866c={};var _0x2a69df={};var _0x9ac047;var _0x280f07;return db[_0x2c55('0x1e')]['findOne']({'where':{'id':_0x55cae3[_0x2c55('0x2a')]['id']}})[_0x2c55('0x15')](handleEntityNotFound(_0x358069,null))['then'](function(_0x3bc036){if(_0x3bc036){_0x9ac047=_0x3bc036;_0x2a69df[_0x2c55('0x2b')]=_[_0x2c55('0x2c')](db[_0x2c55('0x7a')][_0x2c55('0x1f')]);_0x2a69df[_0x2c55('0x25')]=_[_0x2c55('0x2c')](_0x55cae3[_0x2c55('0x25')]);_0x2a69df['filters']=_[_0x2c55('0x2d')](_0x2a69df[_0x2c55('0x2b')],_0x2a69df[_0x2c55('0x25')]);_0x57866c['attributes']=_['intersection'](_0x2a69df[_0x2c55('0x2b')],qs['fields'](_0x55cae3[_0x2c55('0x25')][_0x2c55('0x2f')]));_0x57866c[_0x2c55('0x2e')]=_0x57866c[_0x2c55('0x2e')]['length']?_0x57866c['attributes']:_0x2a69df[_0x2c55('0x2b')];_0x57866c[_0x2c55('0x7b')]=qs[_0x2c55('0x44')](_0x55cae3[_0x2c55('0x25')][_0x2c55('0x44')]);_0x57866c['where']=qs[_0x2c55('0x46')](_[_0x2c55('0x45')](_0x55cae3[_0x2c55('0x25')],_0x2a69df[_0x2c55('0x46')]));if(_0x55cae3['query'][_0x2c55('0x48')]){_0x57866c[_0x2c55('0x23')]=_[_0x2c55('0x31')](_0x57866c['where'],{'$or':_[_0x2c55('0x49')](_0x57866c['attributes'],function(_0x33d050){var _0x590d39={};_0x590d39[_0x33d050]={'$like':'%'+_0x55cae3[_0x2c55('0x25')][_0x2c55('0x48')]+'%'};return _0x590d39;})});}_0x57866c=_[_0x2c55('0x31')]({},_0x57866c,_0x55cae3['options']);return _0x9ac047[_0x2c55('0x7c')](_0x57866c);}})[_0x2c55('0x15')](function(_0x3b21c9){if(_0x3b21c9){_0x280f07=_0x3b21c9[_0x2c55('0x30')];if(!_0x55cae3[_0x2c55('0x25')]['hasOwnProperty'](_0x2c55('0x43'))){_0x57866c[_0x2c55('0x11')]=qs[_0x2c55('0x11')](_0x55cae3[_0x2c55('0x25')][_0x2c55('0x11')]);_0x57866c[_0x2c55('0xf')]=qs[_0x2c55('0xf')](_0x55cae3['query'][_0x2c55('0xf')]);}return _0x9ac047[_0x2c55('0x7c')](_0x57866c);}})[_0x2c55('0x15')](function(_0x14ef16){if(_0x14ef16){return _0x14ef16?{'count':_0x280f07,'rows':_0x14ef16}:null;}})['then'](respondWithResult(_0x358069,null))[_0x2c55('0x28')](handleError(_0x358069,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 23db8c9..8083d3a 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 _0x89ad=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','save'];(function(_0x357607,_0x321cdb){var _0x473cf6=function(_0x1f6a8e){while(--_0x1f6a8e){_0x357607['push'](_0x357607['shift']());}};_0x473cf6(++_0x321cdb);}(_0x89ad,0xdd));var _0xd89a=function(_0x5cb834,_0x1e3619){_0x5cb834=_0x5cb834-0x0;var _0x418cd5=_0x89ad[_0x5cb834];return _0x418cd5;};'use strict';var EventEmitter=require(_0xd89a('0x0'));var OpenchannelQueue=require(_0xd89a('0x1'))['db'][_0xd89a('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd89a('0x3'),'afterUpdate':_0xd89a('0x4'),'afterDestroy':_0xd89a('0x5')};function emitEvent(_0x3f0b8a){return function(_0x121b08,_0x5d5c67,_0x25bb22){OpenchannelQueueEvents[_0xd89a('0x6')](_0x3f0b8a+':'+_0x121b08['id'],_0x121b08);OpenchannelQueueEvents[_0xd89a('0x6')](_0x3f0b8a,_0x121b08);_0x25bb22(null);};}for(var e in events){if(events[_0xd89a('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xd89a('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x37d8=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x1ddd0,_0x15f9f4){var _0x4d86d0=function(_0x3173d7){while(--_0x3173d7){_0x1ddd0['push'](_0x1ddd0['shift']());}};_0x4d86d0(++_0x15f9f4);}(_0x37d8,0xc3));var _0x837d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x37d8[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x837d('0x0'));var OpenchannelQueue=require(_0x837d('0x1'))['db'][_0x837d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x837d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x837d('0x4'),'afterDestroy':_0x837d('0x5')};function emitEvent(_0x567d03){return function(_0x29dab1,_0x52de50,_0x4bc466){OpenchannelQueueEvents[_0x837d('0x6')](_0x567d03+':'+_0x29dab1['id'],_0x29dab1);OpenchannelQueueEvents[_0x837d('0x6')](_0x567d03,_0x29dab1);_0x4bc466(null);};}for(var e in events){if(events[_0x837d('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x837d('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6818cd4..59ff558 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 _0x18a9=['../../config/logger','api','bluebird','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x2cc8a6,_0x151896){var _0x5b6f45=function(_0xcabeb6){while(--_0xcabeb6){_0x2cc8a6['push'](_0x2cc8a6['shift']());}};_0x5b6f45(++_0x151896);}(_0x18a9,0x1ed));var _0x918a=function(_0x3c34d3,_0x586c2d){_0x3c34d3=_0x3c34d3-0x0;var _0x15bd5f=_0x18a9[_0x3c34d3];return _0x15bd5f;};'use strict';var _=require(_0x918a('0x0'));var util=require(_0x918a('0x1'));var logger=require(_0x918a('0x2'))(_0x918a('0x3'));var moment=require('moment');var BPromise=require(_0x918a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0x918a('0x5')]=function(_0x17adcf,_0x34e1d6){return _0x17adcf[_0x918a('0x6')](_0x918a('0x7'),attributes,{'tableName':_0x918a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9244=['lodash','moment','bluebird','request-promise','path','define','OpenchannelQueue','openchannel_queues'];(function(_0x30853f,_0x4aa320){var _0x3c416d=function(_0x15d3d2){while(--_0x15d3d2){_0x30853f['push'](_0x30853f['shift']());}};_0x3c416d(++_0x4aa320);}(_0x9244,0x120));var _0x4924=function(_0x3fb05b,_0x473ea3){_0x3fb05b=_0x3fb05b-0x0;var _0x36c70b=_0x9244[_0x3fb05b];return _0x36c70b;};'use strict';var _=require(_0x4924('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4924('0x1'));var BPromise=require(_0x4924('0x2'));var rp=require(_0x4924('0x3'));var fs=require('fs');var path=require(_0x4924('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x1da79d,_0x39656a){return _0x1da79d[_0x4924('0x5')](_0x4924('0x6'),attributes,{'tableName':_0x4924('0x7'),'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 5fda4ec..953c027 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 _0x5a19=['defaults','redis','localhost','socket.io-emitter','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ecb0f,_0x5581e5){var _0xaec662=function(_0x3d20f5){while(--_0x3d20f5){_0x2ecb0f['push'](_0x2ecb0f['shift']());}};_0xaec662(++_0x5581e5);}(_0x5a19,0x69));var _0x95a1=function(_0x388679,_0x502313){_0x388679=_0x388679-0x0;var _0x3392fa=_0x5a19[_0x388679];return _0x3392fa;};'use strict';var _=require(_0x95a1('0x0'));var util=require('util');var moment=require(_0x95a1('0x1'));var BPromise=require(_0x95a1('0x2'));var rs=require(_0x95a1('0x3'));var fs=require('fs');var Redis=require(_0x95a1('0x4'));var db=require(_0x95a1('0x5'))['db'];var utils=require(_0x95a1('0x6'));var logger=require(_0x95a1('0x7'))(_0x95a1('0x8'));var config=require(_0x95a1('0x9'));var jayson=require(_0x95a1('0xa'));var client=jayson[_0x95a1('0xb')]['http']({'port':0x232a});config['redis']=_[_0x95a1('0xc')](config[_0x95a1('0xd')],{'host':_0x95a1('0xe'),'port':0x18eb});var socket=require(_0x95a1('0xf'))(new Redis(config[_0x95a1('0xd')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x29b95e,_0x126fa3,_0x518abe){return new BPromise(function(_0x5ecd65,_0x39d734){return client['request'](_0x29b95e,_0x518abe)[_0x95a1('0x10')](function(_0x2037d7){logger[_0x95a1('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x126fa3,'request\x20sent');logger[_0x95a1('0x12')](_0x95a1('0x13'),_0x126fa3,_0x95a1('0x14'),JSON[_0x95a1('0x15')](_0x2037d7));if(_0x2037d7[_0x95a1('0x16')]){if(_0x2037d7[_0x95a1('0x16')]['code']===0x1f4){logger[_0x95a1('0x16')](_0x95a1('0x17'),_0x126fa3,_0x2037d7[_0x95a1('0x16')][_0x95a1('0x18')]);return _0x39d734(_0x2037d7[_0x95a1('0x16')][_0x95a1('0x18')]);}logger[_0x95a1('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x126fa3,_0x2037d7[_0x95a1('0x16')][_0x95a1('0x18')]);return _0x5ecd65(_0x2037d7[_0x95a1('0x16')]['message']);}else{logger[_0x95a1('0x11')](_0x95a1('0x17'),_0x126fa3,_0x95a1('0x14'));_0x5ecd65(_0x2037d7['result']['message']);}})[_0x95a1('0x19')](function(_0x371ff2){logger[_0x95a1('0x16')](_0x95a1('0x17'),_0x126fa3,_0x371ff2);_0x39d734(_0x371ff2);});});}exports[_0x95a1('0x1a')]=function(_0x37c516){var _0x568661=this;return new Promise(function(_0x41a260,_0x13100b){return db[_0x95a1('0x1b')][_0x95a1('0x1c')]({'raw':_0x37c516[_0x95a1('0x1d')]?_0x37c516[_0x95a1('0x1d')][_0x95a1('0x1e')]===undefined?!![]:![]:!![],'where':_0x37c516[_0x95a1('0x1d')]?_0x37c516[_0x95a1('0x1d')]['where']||null:null,'attributes':_0x37c516['options']?_0x37c516[_0x95a1('0x1d')][_0x95a1('0x1f')]||null:null,'limit':_0x37c516[_0x95a1('0x1d')]?_0x37c516[_0x95a1('0x1d')][_0x95a1('0x20')]||null:null,'include':_0x37c516[_0x95a1('0x1d')]?_0x37c516[_0x95a1('0x1d')][_0x95a1('0x21')]?_[_0x95a1('0x22')](_0x37c516[_0x95a1('0x1d')][_0x95a1('0x21')],function(_0xc969c0){return{'model':db[_0xc969c0['model']],'as':_0xc969c0['as'],'attributes':_0xc969c0[_0x95a1('0x1f')],'include':_0xc969c0[_0x95a1('0x21')]?_[_0x95a1('0x22')](_0xc969c0[_0x95a1('0x21')],function(_0x3a1689){return{'model':db[_0x3a1689[_0x95a1('0x23')]],'as':_0x3a1689['as'],'attributes':_0x3a1689[_0x95a1('0x1f')],'include':_0x3a1689[_0x95a1('0x21')]?_[_0x95a1('0x22')](_0x3a1689[_0x95a1('0x21')],function(_0x4e25da){return{'model':db[_0x4e25da[_0x95a1('0x23')]],'as':_0x4e25da['as'],'attributes':_0x4e25da[_0x95a1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x95a1('0x10')](function(_0x47b027){logger['info'](_0x95a1('0x1a'),_0x37c516);logger['debug']('GetOpenchannelQueue',_0x37c516,JSON[_0x95a1('0x15')](_0x47b027));_0x41a260(_0x47b027);})['catch'](function(_0x249807){logger[_0x95a1('0x16')]('GetOpenchannelQueue',_0x249807[_0x95a1('0x18')],_0x37c516);_0x13100b(_0x568661[_0x95a1('0x16')](0x1f4,_0x249807['message']));});});};exports['ShowOpenchannelQueue']=function(_0x2c1eb6){var _0x1eb350=this;return new Promise(function(_0x1509d8,_0x3fe560){return db['OpenchannelQueue'][_0x95a1('0x24')]({'raw':_0x2c1eb6[_0x95a1('0x1d')]?_0x2c1eb6[_0x95a1('0x1d')][_0x95a1('0x1e')]===undefined?!![]:![]:!![],'where':_0x2c1eb6[_0x95a1('0x1d')]?_0x2c1eb6[_0x95a1('0x1d')][_0x95a1('0x25')]||null:null,'attributes':_0x2c1eb6['options']?_0x2c1eb6[_0x95a1('0x1d')][_0x95a1('0x1f')]||null:null,'include':_0x2c1eb6[_0x95a1('0x1d')]?_0x2c1eb6[_0x95a1('0x1d')][_0x95a1('0x21')]?_[_0x95a1('0x22')](_0x2c1eb6['options'][_0x95a1('0x21')],function(_0xc233c9){return{'model':db[_0xc233c9[_0x95a1('0x23')]],'as':_0xc233c9['as'],'attributes':_0xc233c9[_0x95a1('0x1f')],'include':_0xc233c9['include']?_[_0x95a1('0x22')](_0xc233c9[_0x95a1('0x21')],function(_0x4b3893){return{'model':db[_0x4b3893['model']],'as':_0x4b3893['as'],'attributes':_0x4b3893[_0x95a1('0x1f')],'include':_0x4b3893['include']?_['map'](_0x4b3893[_0x95a1('0x21')],function(_0x34e5ae){return{'model':db[_0x34e5ae[_0x95a1('0x23')]],'as':_0x34e5ae['as'],'attributes':_0x34e5ae[_0x95a1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x95a1('0x10')](function(_0x2fb77d){logger['info'](_0x95a1('0x26'),_0x2c1eb6);logger['debug'](_0x95a1('0x26'),_0x2c1eb6,JSON['stringify'](_0x2fb77d));_0x1509d8(_0x2fb77d);})[_0x95a1('0x19')](function(_0x310639){logger['error'](_0x95a1('0x26'),_0x310639[_0x95a1('0x18')],_0x2c1eb6);_0x3fe560(_0x1eb350[_0x95a1('0x16')](0x1f4,_0x310639[_0x95a1('0x18')]));});});}; \ No newline at end of file +var _0x0a49=['result','catch','OpenchannelQueue','findAll','options','raw','where','limit','model','include','map','attributes','debug','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x0a49,0xdc));var _0x90a4=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x0a49[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0x90a4('0x0'));var util=require(_0x90a4('0x1'));var moment=require(_0x90a4('0x2'));var BPromise=require(_0x90a4('0x3'));var rs=require(_0x90a4('0x4'));var fs=require('fs');var Redis=require(_0x90a4('0x5'));var db=require(_0x90a4('0x6'))['db'];var utils=require(_0x90a4('0x7'));var logger=require(_0x90a4('0x8'))(_0x90a4('0x9'));var config=require('../../config/environment');var jayson=require(_0x90a4('0xa'));var client=jayson['client'][_0x90a4('0xb')]({'port':0x232a});config['redis']=_[_0x90a4('0xc')](config[_0x90a4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x90a4('0xe'))(new Redis(config[_0x90a4('0xd')]));require(_0x90a4('0xf'))[_0x90a4('0x10')](socket);function respondWithRpcPromise(_0x2e82bd,_0x5cc93a,_0x2c9733){return new BPromise(function(_0x3c1316,_0x38af45){return client['request'](_0x2e82bd,_0x2c9733)[_0x90a4('0x11')](function(_0x1bcf6d){logger[_0x90a4('0x12')](_0x90a4('0x13'),_0x5cc93a,_0x90a4('0x14'));logger['debug'](_0x90a4('0x15'),_0x5cc93a,'request\x20sent',JSON[_0x90a4('0x16')](_0x1bcf6d));if(_0x1bcf6d[_0x90a4('0x17')]){if(_0x1bcf6d[_0x90a4('0x17')][_0x90a4('0x18')]===0x1f4){logger[_0x90a4('0x17')](_0x90a4('0x13'),_0x5cc93a,_0x1bcf6d['error'][_0x90a4('0x19')]);return _0x38af45(_0x1bcf6d[_0x90a4('0x17')][_0x90a4('0x19')]);}logger[_0x90a4('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x5cc93a,_0x1bcf6d['error'][_0x90a4('0x19')]);return _0x3c1316(_0x1bcf6d[_0x90a4('0x17')][_0x90a4('0x19')]);}else{logger[_0x90a4('0x12')](_0x90a4('0x13'),_0x5cc93a,_0x90a4('0x14'));_0x3c1316(_0x1bcf6d[_0x90a4('0x1a')][_0x90a4('0x19')]);}})[_0x90a4('0x1b')](function(_0x12f440){logger[_0x90a4('0x17')](_0x90a4('0x13'),_0x5cc93a,_0x12f440);_0x38af45(_0x12f440);});});}exports['GetOpenchannelQueue']=function(_0x24dde8){var _0x12ea7e=this;return new Promise(function(_0x3f3040,_0x237c1d){return db[_0x90a4('0x1c')][_0x90a4('0x1d')]({'raw':_0x24dde8[_0x90a4('0x1e')]?_0x24dde8['options'][_0x90a4('0x1f')]===undefined?!![]:![]:!![],'where':_0x24dde8[_0x90a4('0x1e')]?_0x24dde8[_0x90a4('0x1e')][_0x90a4('0x20')]||null:null,'attributes':_0x24dde8['options']?_0x24dde8[_0x90a4('0x1e')]['attributes']||null:null,'limit':_0x24dde8[_0x90a4('0x1e')]?_0x24dde8['options'][_0x90a4('0x21')]||null:null,'include':_0x24dde8['options']?_0x24dde8[_0x90a4('0x1e')]['include']?_['map'](_0x24dde8['options']['include'],function(_0x2a4f97){return{'model':db[_0x2a4f97[_0x90a4('0x22')]],'as':_0x2a4f97['as'],'attributes':_0x2a4f97['attributes'],'include':_0x2a4f97[_0x90a4('0x23')]?_[_0x90a4('0x24')](_0x2a4f97[_0x90a4('0x23')],function(_0x2f775f){return{'model':db[_0x2f775f['model']],'as':_0x2f775f['as'],'attributes':_0x2f775f[_0x90a4('0x25')],'include':_0x2f775f['include']?_['map'](_0x2f775f[_0x90a4('0x23')],function(_0x2f0aa9){return{'model':db[_0x2f0aa9[_0x90a4('0x22')]],'as':_0x2f0aa9['as'],'attributes':_0x2f0aa9[_0x90a4('0x25')]};}):[]};}):[]};}):[]:[]})[_0x90a4('0x11')](function(_0x521121){logger[_0x90a4('0x12')]('GetOpenchannelQueue',_0x24dde8);logger[_0x90a4('0x26')]('GetOpenchannelQueue',_0x24dde8,JSON[_0x90a4('0x16')](_0x521121));_0x3f3040(_0x521121);})['catch'](function(_0x4abd68){logger[_0x90a4('0x17')]('GetOpenchannelQueue',_0x4abd68[_0x90a4('0x19')],_0x24dde8);_0x237c1d(_0x12ea7e[_0x90a4('0x17')](0x1f4,_0x4abd68['message']));});});};exports[_0x90a4('0x27')]=function(_0x1f6bfd){var _0x407293=this;return new Promise(function(_0x365ced,_0x456f8c){return db[_0x90a4('0x1c')][_0x90a4('0x28')]({'raw':_0x1f6bfd['options']?_0x1f6bfd[_0x90a4('0x1e')][_0x90a4('0x1f')]===undefined?!![]:![]:!![],'where':_0x1f6bfd[_0x90a4('0x1e')]?_0x1f6bfd['options'][_0x90a4('0x20')]||null:null,'attributes':_0x1f6bfd[_0x90a4('0x1e')]?_0x1f6bfd[_0x90a4('0x1e')][_0x90a4('0x25')]||null:null,'include':_0x1f6bfd['options']?_0x1f6bfd[_0x90a4('0x1e')][_0x90a4('0x23')]?_['map'](_0x1f6bfd[_0x90a4('0x1e')]['include'],function(_0x230c5b){return{'model':db[_0x230c5b[_0x90a4('0x22')]],'as':_0x230c5b['as'],'attributes':_0x230c5b['attributes'],'include':_0x230c5b[_0x90a4('0x23')]?_[_0x90a4('0x24')](_0x230c5b['include'],function(_0x1e0958){return{'model':db[_0x1e0958[_0x90a4('0x22')]],'as':_0x1e0958['as'],'attributes':_0x1e0958[_0x90a4('0x25')],'include':_0x1e0958[_0x90a4('0x23')]?_[_0x90a4('0x24')](_0x1e0958[_0x90a4('0x23')],function(_0x89284c){return{'model':db[_0x89284c['model']],'as':_0x89284c['as'],'attributes':_0x89284c[_0x90a4('0x25')]};}):[]};}):[]};}):[]:[]})[_0x90a4('0x11')](function(_0x3f7850){logger[_0x90a4('0x12')]('ShowOpenchannelQueue',_0x1f6bfd);logger[_0x90a4('0x26')](_0x90a4('0x27'),_0x1f6bfd,JSON[_0x90a4('0x16')](_0x3f7850));_0x365ced(_0x3f7850);})[_0x90a4('0x1b')](function(_0x47e226){logger['error']('ShowOpenchannelQueue',_0x47e226[_0x90a4('0x19')],_0x1f6bfd);_0x456f8c(_0x407293[_0x90a4('0x17')](0x1f4,_0x47e226['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index d2dc42c..9f3f907 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 _0x031d=['update','emit','removeListener','register','length','remove'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x031d,0x8f));var _0xd031=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0x031d[_0x1e081a];return _0x428209;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xd031('0x0'),_0xd031('0x1')];function createListener(_0x168d01,_0x183993){return function(_0x3d6d2c){_0x183993[_0xd031('0x2')](_0x168d01,_0x3d6d2c);};}function removeListener(_0x1d86cf,_0x3531ec){return function(){OpenchannelQueueEvents[_0xd031('0x3')](_0x1d86cf,_0x3531ec);};}exports[_0xd031('0x4')]=function(_0x162b3f){for(var _0x29fa79=0x0,_0x37f8d4=events[_0xd031('0x5')];_0x29fa79<_0x37f8d4;_0x29fa79++){var _0x407747=events[_0x29fa79];var _0x5a74f6=createListener('openchannelQueue:'+_0x407747,_0x162b3f);OpenchannelQueueEvents['on'](_0x407747,_0x5a74f6);}}; \ No newline at end of file +var _0x4d6a=['removeListener','register','length','openchannelQueue:','update','emit'];(function(_0x4e14be,_0x582681){var _0x411d69=function(_0x7efaf){while(--_0x7efaf){_0x4e14be['push'](_0x4e14be['shift']());}};_0x411d69(++_0x582681);}(_0x4d6a,0xe8));var _0xa4d6=function(_0x565afe,_0x3834a2){_0x565afe=_0x565afe-0x0;var _0x59d87a=_0x4d6a[_0x565afe];return _0x59d87a;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save','remove',_0xa4d6('0x0')];function createListener(_0x5dbdc5,_0x1f6364){return function(_0x214083){_0x1f6364[_0xa4d6('0x1')](_0x5dbdc5,_0x214083);};}function removeListener(_0x39ebf2,_0x59dab4){return function(){OpenchannelQueueEvents[_0xa4d6('0x2')](_0x39ebf2,_0x59dab4);};}exports[_0xa4d6('0x3')]=function(_0x14a6f6){for(var _0x2c660b=0x0,_0x2275e0=events[_0xa4d6('0x4')];_0x2c660b<_0x2275e0;_0x2c660b++){var _0x3427e5=events[_0x2c660b];var _0x4d0159=createListener(_0xa4d6('0x5')+_0x3427e5,_0x14a6f6);OpenchannelQueueEvents['on'](_0x3427e5,_0x4d0159);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8dd0ef4..884d7a7 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 _0x8cfa=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','create','put','update','delete'];(function(_0x4a6edd,_0x1a4557){var _0x500ae9=function(_0x4bb92d){while(--_0x4bb92d){_0x4a6edd['push'](_0x4a6edd['shift']());}};_0x500ae9(++_0x1a4557);}(_0x8cfa,0x1a4));var _0xa8cf=function(_0x537044,_0x4de18f){_0x537044=_0x537044-0x0;var _0x5ba75e=_0x8cfa[_0x537044];return _0x5ba75e;};'use strict';var multer=require('multer');var util=require(_0xa8cf('0x0'));var path=require(_0xa8cf('0x1'));var timeout=require(_0xa8cf('0x2'));var express=require(_0xa8cf('0x3'));var router=express[_0xa8cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8cf('0x5'));var interaction=require(_0xa8cf('0x6'));var config=require('../../config/environment');var controller=require(_0xa8cf('0x7'));router[_0xa8cf('0x8')]('/',auth[_0xa8cf('0x9')](),controller[_0xa8cf('0xa')]);router[_0xa8cf('0x8')]('/describe',auth[_0xa8cf('0x9')](),controller[_0xa8cf('0xb')]);router[_0xa8cf('0x8')](_0xa8cf('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa8cf('0xd')]);router[_0xa8cf('0xe')](_0xa8cf('0xc'),auth[_0xa8cf('0x9')](),controller[_0xa8cf('0xf')]);router[_0xa8cf('0x10')]('/:id',auth[_0xa8cf('0x9')](),controller[_0xa8cf('0x11')]);module[_0xa8cf('0x12')]=router; \ No newline at end of file +var _0x7c66=['/describe','/:id','show','put','update','delete','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index'];(function(_0x16fb9f,_0x3b110d){var _0x5adb35=function(_0x3832d9){while(--_0x3832d9){_0x16fb9f['push'](_0x16fb9f['shift']());}};_0x5adb35(++_0x3b110d);}(_0x7c66,0x197));var _0x67c6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7c66[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x67c6('0x0'));var path=require(_0x67c6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x67c6('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x67c6('0x3'));var config=require(_0x67c6('0x4'));var controller=require(_0x67c6('0x5'));router[_0x67c6('0x6')]('/',auth[_0x67c6('0x7')](),controller[_0x67c6('0x8')]);router[_0x67c6('0x6')](_0x67c6('0x9'),auth[_0x67c6('0x7')](),controller['describe']);router[_0x67c6('0x6')](_0x67c6('0xa'),auth[_0x67c6('0x7')](),controller[_0x67c6('0xb')]);router['post']('/',auth[_0x67c6('0x7')](),controller['create']);router[_0x67c6('0xc')]('/:id',auth[_0x67c6('0x7')](),controller[_0x67c6('0xd')]);router[_0x67c6('0xe')](_0x67c6('0xa'),auth[_0x67c6('0x7')](),controller['destroy']);module[_0x67c6('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a21b1f4..955a3a4 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 _0xb99d=['moment','exports','STRING','DATE'];(function(_0x248481,_0x32afd5){var _0x1cf886=function(_0x125f94){while(--_0x125f94){_0x248481['push'](_0x248481['shift']());}};_0x1cf886(++_0x32afd5);}(_0xb99d,0xb8));var _0xdb99=function(_0x413cce,_0x641580){_0x413cce=_0x413cce-0x0;var _0x2661a8=_0xb99d[_0x413cce];return _0x2661a8;};'use strict';var moment=require(_0xdb99('0x0'));var Sequelize=require('sequelize');module[_0xdb99('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdb99('0x2')]},'joinAt':{'type':Sequelize[_0xdb99('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xdb99('0x3')]},'exitAt':{'type':Sequelize[_0xdb99('0x3')]},'reason':{'type':Sequelize[_0xdb99('0x2')]}}; \ No newline at end of file +var _0xf692=['DATE','sequelize','exports','STRING'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0xf692,0x105));var _0x2f69=function(_0x4ae676,_0x1f3d19){_0x4ae676=_0x4ae676-0x0;var _0x2d9a1f=_0xf692[_0x4ae676];return _0x2d9a1f;};'use strict';var moment=require('moment');var Sequelize=require(_0x2f69('0x0'));module[_0x2f69('0x1')]={'uniqueid':{'type':Sequelize[_0x2f69('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2f69('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2f69('0x3')]},'exitAt':{'type':Sequelize[_0x2f69('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5d2f877..bf2fd95 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 _0x983d=['findAll','rows','show','params','includeAll','find','catch','create','body','destroy','describe','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','include'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x983d,0x1d3));var _0xd983=function(_0x40d1bf,_0x2c4ebc){_0x40d1bf=_0x40d1bf-0x0;var _0x61d3c0=_0x983d[_0x40d1bf];return _0x61d3c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd983('0x0'));var zipdir=require(_0xd983('0x1'));var jsonpatch=require(_0xd983('0x2'));var rp=require(_0xd983('0x3'));var moment=require(_0xd983('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd983('0x5'));var util=require(_0xd983('0x6'));var path=require(_0xd983('0x7'));var sox=require('sox');var csv=require(_0xd983('0x8'));var ejs=require(_0xd983('0x9'));var fs=require('fs');var fs_extra=require(_0xd983('0xa'));var _=require(_0xd983('0xb'));var squel=require(_0xd983('0xc'));var crypto=require(_0xd983('0xd'));var jsforce=require(_0xd983('0xe'));var deskjs=require(_0xd983('0xf'));var toCsv=require(_0xd983('0x8'));var querystring=require(_0xd983('0x10'));var Papa=require(_0xd983('0x11'));var Redis=require(_0xd983('0x12'));var authService=require(_0xd983('0x13'));var qs=require(_0xd983('0x14'));var as=require(_0xd983('0x15'));var hardwareService=require(_0xd983('0x16'));var logger=require(_0xd983('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd983('0x18'));var db=require(_0xd983('0x19'))['db'];function respondWithStatusCode(_0x87037d,_0x36f540){_0x36f540=_0x36f540||0xcc;return function(_0x574fb7){if(_0x574fb7){return _0x87037d[_0xd983('0x1a')](_0x36f540);}return _0x87037d[_0xd983('0x1b')](_0x36f540)['end']();};}function respondWithResult(_0x469927,_0x2a494e){_0x2a494e=_0x2a494e||0xc8;return function(_0x528031){if(_0x528031){return _0x469927[_0xd983('0x1b')](_0x2a494e)[_0xd983('0x1c')](_0x528031);}};}function respondWithFilteredResult(_0xa29ca9,_0x3f0020){return function(_0x185437){if(_0x185437){var _0x380a80=typeof _0x3f0020['offset']===_0xd983('0x1d')&&typeof _0x3f0020[_0xd983('0x1e')]===_0xd983('0x1d');var _0x2aef05=_0x185437[_0xd983('0x1f')];var _0x513bd8=_0x380a80?0x0:_0x3f0020[_0xd983('0x20')];var _0x162438=_0x380a80?_0x185437[_0xd983('0x1f')]:_0x3f0020['offset']+_0x3f0020[_0xd983('0x1e')];var _0x430c9c;if(_0x162438>=_0x2aef05){_0x162438=_0x2aef05;_0x430c9c=0xc8;}else{_0x430c9c=0xce;}_0xa29ca9[_0xd983('0x1b')](_0x430c9c);return _0xa29ca9[_0xd983('0x21')](_0xd983('0x22'),_0x513bd8+'-'+_0x162438+'/'+_0x2aef05)[_0xd983('0x1c')](_0x185437);}return null;};}function patchUpdates(_0xa9ab3c){return function(_0x320014){try{jsonpatch[_0xd983('0x23')](_0x320014,_0xa9ab3c,!![]);}catch(_0x224fc8){return BPromise[_0xd983('0x24')](_0x224fc8);}return _0x320014['save']();};}function saveUpdates(_0x76f85c,_0x5c4382){return function(_0x5b5a95){if(_0x5b5a95){return _0x5b5a95[_0xd983('0x25')](_0x76f85c)['then'](function(_0x1ae0e3){return _0x1ae0e3;});}return null;};}function removeEntity(_0x24161b,_0x471cec){return function(_0x5643f4){if(_0x5643f4){return _0x5643f4['destroy']()[_0xd983('0x26')](function(){_0x24161b[_0xd983('0x1b')](0xcc)[_0xd983('0x27')]();});}};}function handleEntityNotFound(_0x521e4d,_0x55bafa){return function(_0x291937){if(!_0x291937){_0x521e4d['sendStatus'](0x194);}return _0x291937;};}function handleError(_0x674f89,_0x2bdb6f){_0x2bdb6f=_0x2bdb6f||0x1f4;return function(_0x196e66){logger['error'](_0x196e66['stack']);if(_0x196e66[_0xd983('0x28')]){delete _0x196e66[_0xd983('0x28')];}_0x674f89['status'](_0x2bdb6f)[_0xd983('0x29')](_0x196e66);};}exports['index']=function(_0x509427,_0x5a4e55){var _0x22f567={},_0x52314d={},_0x4e3535={'count':0x0,'rows':[]};var _0x54b818=_[_0xd983('0x2a')](db[_0xd983('0x2b')][_0xd983('0x2c')],function(_0x3a3743){return{'name':_0x3a3743[_0xd983('0x2d')],'type':_0x3a3743[_0xd983('0x2e')][_0xd983('0x2f')]};});_0x52314d[_0xd983('0x30')]=_['map'](_0x54b818,'name');_0x52314d[_0xd983('0x31')]=_[_0xd983('0x32')](_0x509427[_0xd983('0x31')]);_0x52314d[_0xd983('0x33')]=_[_0xd983('0x34')](_0x52314d[_0xd983('0x30')],_0x52314d[_0xd983('0x31')]);_0x22f567[_0xd983('0x35')]=_['intersection'](_0x52314d['model'],qs[_0xd983('0x36')](_0x509427['query'][_0xd983('0x36')]));_0x22f567['attributes']=_0x22f567[_0xd983('0x35')]['length']?_0x22f567[_0xd983('0x35')]:_0x52314d['model'];if(!_0x509427[_0xd983('0x31')][_0xd983('0x37')](_0xd983('0x38'))){_0x22f567[_0xd983('0x1e')]=qs[_0xd983('0x1e')](_0x509427[_0xd983('0x31')][_0xd983('0x1e')]);_0x22f567[_0xd983('0x20')]=qs[_0xd983('0x20')](_0x509427[_0xd983('0x31')][_0xd983('0x20')]);}_0x22f567['order']=qs['sort'](_0x509427[_0xd983('0x31')][_0xd983('0x39')]);_0x22f567['where']=qs[_0xd983('0x33')](_[_0xd983('0x3a')](_0x509427[_0xd983('0x31')],_0x52314d['filters']),_0x54b818);if(_0x509427[_0xd983('0x31')]['filter']){_0x22f567['where']=_[_0xd983('0x3b')](_0x22f567[_0xd983('0x3c')],{'$or':_[_0xd983('0x2a')](_0x54b818,function(_0x164fe1){if(_0x164fe1['type']!==_0xd983('0x3d')){var _0x47ad6c={};_0x47ad6c[_0x164fe1[_0xd983('0x28')]]={'$like':'%'+_0x509427[_0xd983('0x31')][_0xd983('0x3e')]+'%'};return _0x47ad6c;}})});}_0x22f567=_[_0xd983('0x3b')]({},_0x22f567,_0x509427[_0xd983('0x3f')]);var _0x38730f={'where':_0x22f567[_0xd983('0x3c')]};return db[_0xd983('0x2b')][_0xd983('0x1f')](_0x38730f)['then'](function(_0xdfd784){_0x4e3535[_0xd983('0x1f')]=_0xdfd784;if(_0x509427[_0xd983('0x31')]['includeAll']){_0x22f567[_0xd983('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xd983('0x41')](_0x22f567);})[_0xd983('0x26')](function(_0x4a627f){_0x4e3535[_0xd983('0x42')]=_0x4a627f;return _0x4e3535;})[_0xd983('0x26')](respondWithFilteredResult(_0x5a4e55,_0x22f567))['catch'](handleError(_0x5a4e55,null));};exports[_0xd983('0x43')]=function(_0x4ea277,_0x31b67b){var _0x3d9c9b={'raw':!![],'where':{'id':_0x4ea277[_0xd983('0x44')]['id']}},_0x5a0f3c={};_0x5a0f3c[_0xd983('0x30')]=_[_0xd983('0x32')](db[_0xd983('0x2b')]['rawAttributes']);_0x5a0f3c[_0xd983('0x31')]=_[_0xd983('0x32')](_0x4ea277['query']);_0x5a0f3c[_0xd983('0x33')]=_[_0xd983('0x34')](_0x5a0f3c['model'],_0x5a0f3c[_0xd983('0x31')]);_0x3d9c9b[_0xd983('0x35')]=_['intersection'](_0x5a0f3c[_0xd983('0x30')],qs[_0xd983('0x36')](_0x4ea277[_0xd983('0x31')][_0xd983('0x36')]));_0x3d9c9b[_0xd983('0x35')]=_0x3d9c9b['attributes']['length']?_0x3d9c9b[_0xd983('0x35')]:_0x5a0f3c[_0xd983('0x30')];if(_0x4ea277[_0xd983('0x31')][_0xd983('0x45')]){_0x3d9c9b[_0xd983('0x40')]=[{'all':!![]}];}_0x3d9c9b=_[_0xd983('0x3b')]({},_0x3d9c9b,_0x4ea277['options']);return db[_0xd983('0x2b')][_0xd983('0x46')](_0x3d9c9b)['then'](handleEntityNotFound(_0x31b67b,null))[_0xd983('0x26')](respondWithResult(_0x31b67b,null))[_0xd983('0x47')](handleError(_0x31b67b,null));};exports[_0xd983('0x48')]=function(_0x4edda7,_0x5d88c2){return db['OpenchannelQueueReport']['create'](_0x4edda7[_0xd983('0x49')],{})['then'](respondWithResult(_0x5d88c2,0xc9))[_0xd983('0x47')](handleError(_0x5d88c2,null));};exports[_0xd983('0x25')]=function(_0x70eea0,_0x445caa){if(_0x70eea0[_0xd983('0x49')]['id']){delete _0x70eea0[_0xd983('0x49')]['id'];}return db[_0xd983('0x2b')][_0xd983('0x46')]({'where':{'id':_0x70eea0[_0xd983('0x44')]['id']}})[_0xd983('0x26')](handleEntityNotFound(_0x445caa,null))['then'](saveUpdates(_0x70eea0[_0xd983('0x49')],null))[_0xd983('0x26')](respondWithResult(_0x445caa,null))['catch'](handleError(_0x445caa,null));};exports[_0xd983('0x4a')]=function(_0x36cdb6,_0x45ad6c){return db[_0xd983('0x2b')]['find']({'where':{'id':_0x36cdb6[_0xd983('0x44')]['id']}})[_0xd983('0x26')](handleEntityNotFound(_0x45ad6c,null))[_0xd983('0x26')](removeEntity(_0x45ad6c,null))[_0xd983('0x47')](handleError(_0x45ad6c,null));};exports[_0xd983('0x4b')]=function(_0x4c1079,_0x891dd2){return db[_0xd983('0x2b')][_0xd983('0x4b')]()[_0xd983('0x26')](respondWithResult(_0x891dd2,null))['catch'](handleError(_0x891dd2,null));}; \ No newline at end of file +var _0xda38=['fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','count','status','set','Content-Range','reject','save','destroy','then','end','error','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','show','find','catch','create','body','update','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x127a0d,_0x2e020d){var _0x3fe7d5=function(_0x3bd7e5){while(--_0x3bd7e5){_0x127a0d['push'](_0x127a0d['shift']());}};_0x3fe7d5(++_0x2e020d);}(_0xda38,0x11e));var _0x8da3=function(_0x41b62a,_0x13d23e){_0x41b62a=_0x41b62a-0x0;var _0x429f38=_0xda38[_0x41b62a];return _0x429f38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8da3('0x0'));var zipdir=require(_0x8da3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8da3('0x2'));var moment=require(_0x8da3('0x3'));var BPromise=require(_0x8da3('0x4'));var Mustache=require('mustache');var util=require(_0x8da3('0x5'));var path=require(_0x8da3('0x6'));var sox=require(_0x8da3('0x7'));var csv=require(_0x8da3('0x8'));var ejs=require(_0x8da3('0x9'));var fs=require('fs');var fs_extra=require(_0x8da3('0xa'));var _=require(_0x8da3('0xb'));var squel=require(_0x8da3('0xc'));var crypto=require(_0x8da3('0xd'));var jsforce=require(_0x8da3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8da3('0x8'));var querystring=require(_0x8da3('0xf'));var Papa=require('papaparse');var Redis=require(_0x8da3('0x10'));var authService=require(_0x8da3('0x11'));var qs=require(_0x8da3('0x12'));var as=require(_0x8da3('0x13'));var hardwareService=require(_0x8da3('0x14'));var logger=require('../../config/logger')(_0x8da3('0x15'));var utils=require(_0x8da3('0x16'));var config=require(_0x8da3('0x17'));var licenseUtil=require(_0x8da3('0x18'));var db=require(_0x8da3('0x19'))['db'];function respondWithStatusCode(_0x3149d4,_0x1ffce2){_0x1ffce2=_0x1ffce2||0xcc;return function(_0x45aa4e){if(_0x45aa4e){return _0x3149d4[_0x8da3('0x1a')](_0x1ffce2);}return _0x3149d4['status'](_0x1ffce2)['end']();};}function respondWithResult(_0x1c24a8,_0x118069){_0x118069=_0x118069||0xc8;return function(_0x2fa8ad){if(_0x2fa8ad){return _0x1c24a8['status'](_0x118069)['json'](_0x2fa8ad);}};}function respondWithFilteredResult(_0x40d984,_0x419780){return function(_0x2fc447){if(_0x2fc447){var _0x147532=typeof _0x419780[_0x8da3('0x1b')]===_0x8da3('0x1c')&&typeof _0x419780['limit']===_0x8da3('0x1c');var _0x35641f=_0x2fc447[_0x8da3('0x1d')];var _0x3f859b=_0x147532?0x0:_0x419780[_0x8da3('0x1b')];var _0x30c5ca=_0x147532?_0x2fc447[_0x8da3('0x1d')]:_0x419780[_0x8da3('0x1b')]+_0x419780['limit'];var _0x198c4b;if(_0x30c5ca>=_0x35641f){_0x30c5ca=_0x35641f;_0x198c4b=0xc8;}else{_0x198c4b=0xce;}_0x40d984[_0x8da3('0x1e')](_0x198c4b);return _0x40d984[_0x8da3('0x1f')](_0x8da3('0x20'),_0x3f859b+'-'+_0x30c5ca+'/'+_0x35641f)['json'](_0x2fc447);}return null;};}function patchUpdates(_0x5cefed){return function(_0x241b8){try{jsonpatch['apply'](_0x241b8,_0x5cefed,!![]);}catch(_0x2fed4e){return BPromise[_0x8da3('0x21')](_0x2fed4e);}return _0x241b8[_0x8da3('0x22')]();};}function saveUpdates(_0x2bbd9f,_0x123e50){return function(_0x1298ae){if(_0x1298ae){return _0x1298ae['update'](_0x2bbd9f)['then'](function(_0x271642){return _0x271642;});}return null;};}function removeEntity(_0x435dd1,_0x16a339){return function(_0x21b20b){if(_0x21b20b){return _0x21b20b[_0x8da3('0x23')]()[_0x8da3('0x24')](function(){_0x435dd1[_0x8da3('0x1e')](0xcc)[_0x8da3('0x25')]();});}};}function handleEntityNotFound(_0x3103fc,_0x2baf5a){return function(_0x37b96a){if(!_0x37b96a){_0x3103fc[_0x8da3('0x1a')](0x194);}return _0x37b96a;};}function handleError(_0x4f3235,_0x3c4b90){_0x3c4b90=_0x3c4b90||0x1f4;return function(_0x2f3fd6){logger[_0x8da3('0x26')](_0x2f3fd6[_0x8da3('0x27')]);if(_0x2f3fd6['name']){delete _0x2f3fd6[_0x8da3('0x28')];}_0x4f3235[_0x8da3('0x1e')](_0x3c4b90)['send'](_0x2f3fd6);};}exports['index']=function(_0x2b1d25,_0x2d8082){var _0x49207f={},_0x25307c={},_0x90d76={'count':0x0,'rows':[]};var _0x362246=_[_0x8da3('0x29')](db[_0x8da3('0x2a')][_0x8da3('0x2b')],function(_0x21c631){return{'name':_0x21c631[_0x8da3('0x2c')],'type':_0x21c631[_0x8da3('0x2d')][_0x8da3('0x2e')]};});_0x25307c[_0x8da3('0x2f')]=_[_0x8da3('0x29')](_0x362246,_0x8da3('0x28'));_0x25307c[_0x8da3('0x30')]=_[_0x8da3('0x31')](_0x2b1d25[_0x8da3('0x30')]);_0x25307c['filters']=_[_0x8da3('0x32')](_0x25307c['model'],_0x25307c[_0x8da3('0x30')]);_0x49207f[_0x8da3('0x33')]=_['intersection'](_0x25307c['model'],qs[_0x8da3('0x34')](_0x2b1d25[_0x8da3('0x30')][_0x8da3('0x34')]));_0x49207f['attributes']=_0x49207f[_0x8da3('0x33')][_0x8da3('0x35')]?_0x49207f[_0x8da3('0x33')]:_0x25307c[_0x8da3('0x2f')];if(!_0x2b1d25[_0x8da3('0x30')]['hasOwnProperty'](_0x8da3('0x36'))){_0x49207f[_0x8da3('0x37')]=qs[_0x8da3('0x37')](_0x2b1d25[_0x8da3('0x30')][_0x8da3('0x37')]);_0x49207f['offset']=qs[_0x8da3('0x1b')](_0x2b1d25[_0x8da3('0x30')][_0x8da3('0x1b')]);}_0x49207f[_0x8da3('0x38')]=qs['sort'](_0x2b1d25[_0x8da3('0x30')][_0x8da3('0x39')]);_0x49207f[_0x8da3('0x3a')]=qs[_0x8da3('0x3b')](_[_0x8da3('0x3c')](_0x2b1d25[_0x8da3('0x30')],_0x25307c[_0x8da3('0x3b')]),_0x362246);if(_0x2b1d25['query'][_0x8da3('0x3d')]){_0x49207f[_0x8da3('0x3a')]=_[_0x8da3('0x3e')](_0x49207f[_0x8da3('0x3a')],{'$or':_['map'](_0x362246,function(_0x2de0b9){if(_0x2de0b9[_0x8da3('0x2d')]!=='VIRTUAL'){var _0x3dc406={};_0x3dc406[_0x2de0b9[_0x8da3('0x28')]]={'$like':'%'+_0x2b1d25[_0x8da3('0x30')][_0x8da3('0x3d')]+'%'};return _0x3dc406;}})});}_0x49207f=_['merge']({},_0x49207f,_0x2b1d25['options']);var _0xeea811={'where':_0x49207f[_0x8da3('0x3a')]};return db['OpenchannelQueueReport'][_0x8da3('0x1d')](_0xeea811)[_0x8da3('0x24')](function(_0x4cffa5){_0x90d76['count']=_0x4cffa5;if(_0x2b1d25['query'][_0x8da3('0x3f')]){_0x49207f[_0x8da3('0x40')]=[{'all':!![]}];}return db[_0x8da3('0x2a')][_0x8da3('0x41')](_0x49207f);})['then'](function(_0x3f22ff){_0x90d76['rows']=_0x3f22ff;return _0x90d76;})[_0x8da3('0x24')](respondWithFilteredResult(_0x2d8082,_0x49207f))['catch'](handleError(_0x2d8082,null));};exports[_0x8da3('0x42')]=function(_0xe5ab9f,_0x4035ec){var _0x3b4610={'raw':!![],'where':{'id':_0xe5ab9f['params']['id']}},_0x3277f1={};_0x3277f1[_0x8da3('0x2f')]=_[_0x8da3('0x31')](db[_0x8da3('0x2a')]['rawAttributes']);_0x3277f1[_0x8da3('0x30')]=_[_0x8da3('0x31')](_0xe5ab9f[_0x8da3('0x30')]);_0x3277f1[_0x8da3('0x3b')]=_[_0x8da3('0x32')](_0x3277f1[_0x8da3('0x2f')],_0x3277f1[_0x8da3('0x30')]);_0x3b4610['attributes']=_[_0x8da3('0x32')](_0x3277f1[_0x8da3('0x2f')],qs[_0x8da3('0x34')](_0xe5ab9f[_0x8da3('0x30')][_0x8da3('0x34')]));_0x3b4610[_0x8da3('0x33')]=_0x3b4610[_0x8da3('0x33')]['length']?_0x3b4610[_0x8da3('0x33')]:_0x3277f1[_0x8da3('0x2f')];if(_0xe5ab9f[_0x8da3('0x30')][_0x8da3('0x3f')]){_0x3b4610[_0x8da3('0x40')]=[{'all':!![]}];}_0x3b4610=_[_0x8da3('0x3e')]({},_0x3b4610,_0xe5ab9f['options']);return db[_0x8da3('0x2a')][_0x8da3('0x43')](_0x3b4610)[_0x8da3('0x24')](handleEntityNotFound(_0x4035ec,null))['then'](respondWithResult(_0x4035ec,null))[_0x8da3('0x44')](handleError(_0x4035ec,null));};exports['create']=function(_0x5da740,_0x49859f){return db[_0x8da3('0x2a')][_0x8da3('0x45')](_0x5da740[_0x8da3('0x46')],{})[_0x8da3('0x24')](respondWithResult(_0x49859f,0xc9))[_0x8da3('0x44')](handleError(_0x49859f,null));};exports[_0x8da3('0x47')]=function(_0x43cebb,_0x30de4d){if(_0x43cebb['body']['id']){delete _0x43cebb[_0x8da3('0x46')]['id'];}return db[_0x8da3('0x2a')][_0x8da3('0x43')]({'where':{'id':_0x43cebb[_0x8da3('0x48')]['id']}})[_0x8da3('0x24')](handleEntityNotFound(_0x30de4d,null))['then'](saveUpdates(_0x43cebb['body'],null))[_0x8da3('0x24')](respondWithResult(_0x30de4d,null))['catch'](handleError(_0x30de4d,null));};exports['destroy']=function(_0x3397a6,_0x2376df){return db[_0x8da3('0x2a')]['find']({'where':{'id':_0x3397a6[_0x8da3('0x48')]['id']}})['then'](handleEntityNotFound(_0x2376df,null))[_0x8da3('0x24')](removeEntity(_0x2376df,null))[_0x8da3('0x44')](handleError(_0x2376df,null));};exports[_0x8da3('0x49')]=function(_0x501018,_0x3fd133){return db[_0x8da3('0x2a')][_0x8da3('0x49')]()[_0x8da3('0x24')](respondWithResult(_0x3fd133,null))['catch'](handleError(_0x3fd133,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 3aa4e22..69441ce 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x46dba9,_0x24e8a6){var _0x5f36af=function(_0x5226c4){while(--_0x5226c4){_0x46dba9['push'](_0x46dba9['shift']());}};_0x5f36af(++_0x24e8a6);}(_0x1261,0x144));var _0x1126=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x1261[_0x3ea913];return _0x2b4f28;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x4331ec,_0x46b338){var _0x584582=function(_0x1dfb4a){while(--_0x1dfb4a){_0x4331ec['push'](_0x4331ec['shift']());}};_0x584582(++_0x46b338);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index b969590..492a643 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa866=['catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result'];(function(_0x2a4e5c,_0x5542e5){var _0x4198b0=function(_0x5e5c7b){while(--_0x5e5c7b){_0x2a4e5c['push'](_0x2a4e5c['shift']());}};_0x4198b0(++_0x5542e5);}(_0xa866,0x6a));var _0x6a86=function(_0x5933df,_0x41068d){_0x5933df=_0x5933df-0x0;var _0xebf784=_0xa866[_0x5933df];return _0xebf784;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['CreateOpenchannelQueueReport']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')](_0x50024d[_0x6a86('0x19')],{'raw':_0x50024d['options']?_0x50024d[_0x6a86('0x1a')][_0x6a86('0x1b')]===undefined?!![]:![]:!![]})[_0x6a86('0xc')](function(_0x262bf5){logger[_0x6a86('0xd')](_0x6a86('0x1c'),_0x50024d);logger['debug']('CreateOpenchannelQueueReport',_0x50024d,JSON['stringify'](_0x262bf5));_0x535fd9(_0x262bf5);})[_0x6a86('0x16')](function(_0x2007c7){logger[_0x6a86('0x12')](_0x6a86('0x1c'),_0x2007c7['message'],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0x2007c7[_0x6a86('0x14')]));});});};exports[_0x6a86('0x1d')]=function(_0x3f2b70){var _0x19382d=this;return new Promise(function(_0x1c41a7,_0x46f6c7){return db[_0x6a86('0x17')][_0x6a86('0x1e')](_0x3f2b70['body'],{'raw':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')]['where']||null:null,'attributes':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')][_0x6a86('0x1f')]||null:null,'limit':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['limit']||null:null})['then'](function(_0x4d8bf0){logger[_0x6a86('0xd')](_0x6a86('0x1d'),_0x3f2b70);logger[_0x6a86('0xf')]('UpdateOpenchannelQueueReport',_0x3f2b70,JSON[_0x6a86('0x11')](_0x4d8bf0));_0x1c41a7(_0x4d8bf0);})[_0x6a86('0x16')](function(_0x1bb745){logger[_0x6a86('0x12')]('UpdateOpenchannelQueueReport',_0x1bb745[_0x6a86('0x14')],_0x3f2b70);_0x46f6c7(_0x19382d['error'](0x1f4,_0x1bb745[_0x6a86('0x14')]));});});}; \ No newline at end of file +var _0x2884=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','attributes','limit','lodash','moment'];(function(_0x491dff,_0x4d4bc2){var _0x3c6c4b=function(_0x594c37){while(--_0x594c37){_0x491dff['push'](_0x491dff['shift']());}};_0x3c6c4b(++_0x4d4bc2);}(_0x2884,0x1eb));var _0x4288=function(_0x25d4e5,_0x30b67f){_0x25d4e5=_0x25d4e5-0x0;var _0x44d116=_0x2884[_0x25d4e5];return _0x44d116;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526a07,_0x3a930e,_0x5e4cfc){return new BPromise(function(_0x25023a,_0x237b02){return client['request'](_0x526a07,_0x5e4cfc)[_0x4288('0x9')](function(_0x3c8d6e){logger[_0x4288('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3a930e,'request\x20sent');logger[_0x4288('0xb')](_0x4288('0xc'),_0x3a930e,_0x4288('0xd'),JSON[_0x4288('0xe')](_0x3c8d6e));if(_0x3c8d6e[_0x4288('0xf')]){if(_0x3c8d6e[_0x4288('0xf')][_0x4288('0x10')]===0x1f4){logger['error'](_0x4288('0x11'),_0x3a930e,_0x3c8d6e[_0x4288('0xf')][_0x4288('0x12')]);return _0x237b02(_0x3c8d6e[_0x4288('0xf')]['message']);}logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x3c8d6e['error'][_0x4288('0x12')]);return _0x25023a(_0x3c8d6e['error'][_0x4288('0x12')]);}else{logger['info'](_0x4288('0x11'),_0x3a930e,_0x4288('0xd'));_0x25023a(_0x3c8d6e[_0x4288('0x13')][_0x4288('0x12')]);}})[_0x4288('0x14')](function(_0x1db33b){logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x1db33b);_0x237b02(_0x1db33b);});});}exports[_0x4288('0x15')]=function(_0x53fb81){var _0x199919=this;return new Promise(function(_0xde03f4,_0x5e6de1){return db['OpenchannelQueueReport']['create'](_0x53fb81[_0x4288('0x16')],{'raw':_0x53fb81[_0x4288('0x17')]?_0x53fb81['options'][_0x4288('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x865365){logger[_0x4288('0xa')](_0x4288('0x15'),_0x53fb81);logger['debug'](_0x4288('0x15'),_0x53fb81,JSON[_0x4288('0xe')](_0x865365));_0xde03f4(_0x865365);})[_0x4288('0x14')](function(_0x4b9cda){logger['error'](_0x4288('0x15'),_0x4b9cda[_0x4288('0x12')],_0x53fb81);_0x5e6de1(_0x199919[_0x4288('0xf')](0x1f4,_0x4b9cda[_0x4288('0x12')]));});});};exports[_0x4288('0x19')]=function(_0x292e74){var _0x500c1e=this;return new Promise(function(_0x5f0c29,_0x1ff415){return db[_0x4288('0x1a')]['update'](_0x292e74[_0x4288('0x16')],{'raw':_0x292e74['options']?_0x292e74['options'][_0x4288('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')]['where']||null:null,'attributes':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')][_0x4288('0x1b')]||null:null,'limit':_0x292e74[_0x4288('0x17')]?_0x292e74[_0x4288('0x17')][_0x4288('0x1c')]||null:null})['then'](function(_0x3a8e3e){logger[_0x4288('0xa')](_0x4288('0x19'),_0x292e74);logger[_0x4288('0xb')](_0x4288('0x19'),_0x292e74,JSON[_0x4288('0xe')](_0x3a8e3e));_0x5f0c29(_0x3a8e3e);})[_0x4288('0x14')](function(_0x5bca41){logger[_0x4288('0xf')](_0x4288('0x19'),_0x5bca41[_0x4288('0x12')],_0x292e74);_0x1ff415(_0x500c1e[_0x4288('0xf')](0x1f4,_0x5bca41[_0x4288('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index fc7e894..890e32e 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 _0x7b72=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/:id','show','put','destroy','exports','path','express','Router'];(function(_0x53000a,_0x4c01af){var _0x27c1ac=function(_0x202c05){while(--_0x202c05){_0x53000a['push'](_0x53000a['shift']());}};_0x27c1ac(++_0x4c01af);}(_0x7b72,0xbd));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x27b7('0x0'));var timeout=require('connect-timeout');var express=require(_0x27b7('0x1'));var router=express[_0x27b7('0x2')]();var fs_extra=require(_0x27b7('0x3'));var auth=require(_0x27b7('0x4'));var interaction=require(_0x27b7('0x5'));var config=require(_0x27b7('0x6'));var controller=require(_0x27b7('0x7'));router[_0x27b7('0x8')]('/',auth[_0x27b7('0x9')](),controller[_0x27b7('0xa')]);router[_0x27b7('0x8')]('/describe',auth[_0x27b7('0x9')](),controller['describe']);router[_0x27b7('0x8')](_0x27b7('0xb'),auth['isAuthenticated'](),controller[_0x27b7('0xc')]);router['post']('/',auth[_0x27b7('0x9')](),controller['create']);router[_0x27b7('0xd')]('/:id',auth[_0x27b7('0x9')](),controller['update']);router['delete'](_0x27b7('0xb'),auth[_0x27b7('0x9')](),controller[_0x27b7('0xe')]);module[_0x27b7('0xf')]=router; \ No newline at end of file +var _0x8655=['./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x81769,_0x4f010d){var _0x342ed1=function(_0x377eae){while(--_0x377eae){_0x81769['push'](_0x81769['shift']());}};_0x342ed1(++_0x4f010d);}(_0x8655,0xc9));var _0x5865=function(_0x333d49,_0x5d2e5d){_0x333d49=_0x333d49-0x0;var _0x413e07=_0x8655[_0x333d49];return _0x413e07;};'use strict';var multer=require(_0x5865('0x0'));var util=require(_0x5865('0x1'));var path=require(_0x5865('0x2'));var timeout=require('connect-timeout');var express=require(_0x5865('0x3'));var router=express[_0x5865('0x4')]();var fs_extra=require(_0x5865('0x5'));var auth=require(_0x5865('0x6'));var interaction=require(_0x5865('0x7'));var config=require(_0x5865('0x8'));var controller=require(_0x5865('0x9'));router[_0x5865('0xa')]('/',auth[_0x5865('0xb')](),controller[_0x5865('0xc')]);router[_0x5865('0xa')](_0x5865('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x5865('0xa')](_0x5865('0xe'),auth['isAuthenticated'](),controller[_0x5865('0xf')]);router[_0x5865('0x10')]('/',auth[_0x5865('0xb')](),controller[_0x5865('0x11')]);router[_0x5865('0x12')](_0x5865('0xe'),auth['isAuthenticated'](),controller[_0x5865('0x13')]);router['delete'](_0x5865('0xe'),auth['isAuthenticated'](),controller[_0x5865('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index a824761..0dbf659 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5dac21,_0x39ebc2){var _0x700935=function(_0x388be3){while(--_0x388be3){_0x5dac21['push'](_0x5dac21['shift']());}};_0x700935(++_0x39ebc2);}(_0xedd9,0xfc));var _0x9edd=function(_0x2829a2,_0x32047b){_0x2829a2=_0x2829a2-0x0;var _0x3e4b17=_0xedd9[_0x2829a2];return _0x3e4b17;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x16512e,_0x3a2ee2){var _0x394f9f=function(_0x39d7fd){while(--_0x39d7fd){_0x16512e['push'](_0x16512e['shift']());}};_0x394f9f(++_0x3a2ee2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xcb91[_0x58a4fe];return _0x697de2;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 7391158..48a6fa8 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 _0xe0c9=['apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','OpenchannelTransferReport','includeAll','include','findAll','catch','show','params','keys','intersection','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','json'];(function(_0x1dfb4f,_0x550be0){var _0x547b48=function(_0x12c345){while(--_0x12c345){_0x1dfb4f['push'](_0x1dfb4f['shift']());}};_0x547b48(++_0x550be0);}(_0xe0c9,0x199));var _0x9e0c=function(_0x45bf0f,_0x2b1117){_0x45bf0f=_0x45bf0f-0x0;var _0x4b469d=_0xe0c9[_0x45bf0f];return _0x4b469d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e0c('0x0'));var zipdir=require(_0x9e0c('0x1'));var jsonpatch=require(_0x9e0c('0x2'));var rp=require('request-promise');var moment=require(_0x9e0c('0x3'));var BPromise=require(_0x9e0c('0x4'));var Mustache=require(_0x9e0c('0x5'));var util=require(_0x9e0c('0x6'));var path=require(_0x9e0c('0x7'));var sox=require(_0x9e0c('0x8'));var csv=require(_0x9e0c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e0c('0xa'));var squel=require(_0x9e0c('0xb'));var crypto=require(_0x9e0c('0xc'));var jsforce=require(_0x9e0c('0xd'));var deskjs=require(_0x9e0c('0xe'));var toCsv=require(_0x9e0c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9e0c('0xf'));var authService=require(_0x9e0c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9e0c('0x11'));var utils=require(_0x9e0c('0x12'));var config=require(_0x9e0c('0x13'));var licenseUtil=require(_0x9e0c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35cac1,_0x8ac451){_0x8ac451=_0x8ac451||0xcc;return function(_0xacb26){if(_0xacb26){return _0x35cac1[_0x9e0c('0x15')](_0x8ac451);}return _0x35cac1[_0x9e0c('0x16')](_0x8ac451)['end']();};}function respondWithResult(_0x471159,_0x48a794){_0x48a794=_0x48a794||0xc8;return function(_0x57e415){if(_0x57e415){return _0x471159['status'](_0x48a794)['json'](_0x57e415);}};}function respondWithFilteredResult(_0x132ebc,_0x22036d){return function(_0x2dbd57){if(_0x2dbd57){var _0x1b3acb=typeof _0x22036d['offset']===_0x9e0c('0x17')&&typeof _0x22036d[_0x9e0c('0x18')]===_0x9e0c('0x17');var _0x556aae=_0x2dbd57[_0x9e0c('0x19')];var _0x35940c=_0x1b3acb?0x0:_0x22036d[_0x9e0c('0x1a')];var _0x2f0438=_0x1b3acb?_0x2dbd57['count']:_0x22036d['offset']+_0x22036d[_0x9e0c('0x18')];var _0x73714e;if(_0x2f0438>=_0x556aae){_0x2f0438=_0x556aae;_0x73714e=0xc8;}else{_0x73714e=0xce;}_0x132ebc[_0x9e0c('0x16')](_0x73714e);return _0x132ebc[_0x9e0c('0x1b')]('Content-Range',_0x35940c+'-'+_0x2f0438+'/'+_0x556aae)[_0x9e0c('0x1c')](_0x2dbd57);}return null;};}function patchUpdates(_0x55d66b){return function(_0x51b928){try{jsonpatch[_0x9e0c('0x1d')](_0x51b928,_0x55d66b,!![]);}catch(_0x3aecbe){return BPromise[_0x9e0c('0x1e')](_0x3aecbe);}return _0x51b928[_0x9e0c('0x1f')]();};}function saveUpdates(_0x1f2ea1,_0x27692e){return function(_0x34f4cd){if(_0x34f4cd){return _0x34f4cd[_0x9e0c('0x20')](_0x1f2ea1)[_0x9e0c('0x21')](function(_0xd5f2ea){return _0xd5f2ea;});}return null;};}function removeEntity(_0x875a9b,_0x3ce476){return function(_0x235ebb){if(_0x235ebb){return _0x235ebb[_0x9e0c('0x22')]()[_0x9e0c('0x21')](function(){_0x875a9b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d495b,_0x38ae4f){return function(_0x4db741){if(!_0x4db741){_0x1d495b[_0x9e0c('0x15')](0x194);}return _0x4db741;};}function handleError(_0x26bb21,_0x726685){_0x726685=_0x726685||0x1f4;return function(_0x4264d){logger[_0x9e0c('0x23')](_0x4264d[_0x9e0c('0x24')]);if(_0x4264d['name']){delete _0x4264d['name'];}_0x26bb21[_0x9e0c('0x16')](_0x726685)[_0x9e0c('0x25')](_0x4264d);};}exports[_0x9e0c('0x26')]=function(_0x9bb3ae,_0x1d6be5){var _0x5e6bfd={},_0x2103ec={},_0x11d7eb={'count':0x0,'rows':[]};var _0x1c1249=_[_0x9e0c('0x27')](db['OpenchannelTransferReport'][_0x9e0c('0x28')],function(_0x5faf53){return{'name':_0x5faf53[_0x9e0c('0x29')],'type':_0x5faf53[_0x9e0c('0x2a')][_0x9e0c('0x2b')]};});_0x2103ec[_0x9e0c('0x2c')]=_['map'](_0x1c1249,_0x9e0c('0x2d'));_0x2103ec[_0x9e0c('0x2e')]=_['keys'](_0x9bb3ae[_0x9e0c('0x2e')]);_0x2103ec[_0x9e0c('0x2f')]=_['intersection'](_0x2103ec[_0x9e0c('0x2c')],_0x2103ec['query']);_0x5e6bfd[_0x9e0c('0x30')]=_['intersection'](_0x2103ec['model'],qs[_0x9e0c('0x31')](_0x9bb3ae['query'][_0x9e0c('0x31')]));_0x5e6bfd['attributes']=_0x5e6bfd['attributes'][_0x9e0c('0x32')]?_0x5e6bfd[_0x9e0c('0x30')]:_0x2103ec['model'];if(!_0x9bb3ae[_0x9e0c('0x2e')][_0x9e0c('0x33')](_0x9e0c('0x34'))){_0x5e6bfd[_0x9e0c('0x18')]=qs['limit'](_0x9bb3ae[_0x9e0c('0x2e')][_0x9e0c('0x18')]);_0x5e6bfd[_0x9e0c('0x1a')]=qs[_0x9e0c('0x1a')](_0x9bb3ae[_0x9e0c('0x2e')][_0x9e0c('0x1a')]);}_0x5e6bfd['order']=qs['sort'](_0x9bb3ae['query'][_0x9e0c('0x35')]);_0x5e6bfd['where']=qs['filters'](_[_0x9e0c('0x36')](_0x9bb3ae['query'],_0x2103ec[_0x9e0c('0x2f')]),_0x1c1249);if(_0x9bb3ae[_0x9e0c('0x2e')][_0x9e0c('0x37')]){_0x5e6bfd[_0x9e0c('0x38')]=_[_0x9e0c('0x39')](_0x5e6bfd[_0x9e0c('0x38')],{'$or':_[_0x9e0c('0x27')](_0x1c1249,function(_0x16cf52){if(_0x16cf52[_0x9e0c('0x2a')]!==_0x9e0c('0x3a')){var _0x5b662d={};_0x5b662d[_0x16cf52['name']]={'$like':'%'+_0x9bb3ae[_0x9e0c('0x2e')][_0x9e0c('0x37')]+'%'};return _0x5b662d;}})});}_0x5e6bfd=_[_0x9e0c('0x39')]({},_0x5e6bfd,_0x9bb3ae['options']);var _0x6429ad={'where':_0x5e6bfd['where']};return db[_0x9e0c('0x3b')][_0x9e0c('0x19')](_0x6429ad)['then'](function(_0x521245){_0x11d7eb[_0x9e0c('0x19')]=_0x521245;if(_0x9bb3ae['query'][_0x9e0c('0x3c')]){_0x5e6bfd[_0x9e0c('0x3d')]=[{'all':!![]}];}return db[_0x9e0c('0x3b')][_0x9e0c('0x3e')](_0x5e6bfd);})['then'](function(_0x38d3b5){_0x11d7eb['rows']=_0x38d3b5;return _0x11d7eb;})[_0x9e0c('0x21')](respondWithFilteredResult(_0x1d6be5,_0x5e6bfd))[_0x9e0c('0x3f')](handleError(_0x1d6be5,null));};exports[_0x9e0c('0x40')]=function(_0x3bd728,_0x3a9d99){var _0x2f310a={'raw':!![],'where':{'id':_0x3bd728[_0x9e0c('0x41')]['id']}},_0x33b452={};_0x33b452[_0x9e0c('0x2c')]=_[_0x9e0c('0x42')](db[_0x9e0c('0x3b')]['rawAttributes']);_0x33b452['query']=_[_0x9e0c('0x42')](_0x3bd728[_0x9e0c('0x2e')]);_0x33b452[_0x9e0c('0x2f')]=_[_0x9e0c('0x43')](_0x33b452[_0x9e0c('0x2c')],_0x33b452['query']);_0x2f310a[_0x9e0c('0x30')]=_[_0x9e0c('0x43')](_0x33b452[_0x9e0c('0x2c')],qs['fields'](_0x3bd728['query'][_0x9e0c('0x31')]));_0x2f310a[_0x9e0c('0x30')]=_0x2f310a[_0x9e0c('0x30')]['length']?_0x2f310a['attributes']:_0x33b452[_0x9e0c('0x2c')];if(_0x3bd728[_0x9e0c('0x2e')][_0x9e0c('0x3c')]){_0x2f310a[_0x9e0c('0x3d')]=[{'all':!![]}];}_0x2f310a=_[_0x9e0c('0x39')]({},_0x2f310a,_0x3bd728[_0x9e0c('0x44')]);return db[_0x9e0c('0x3b')][_0x9e0c('0x45')](_0x2f310a)[_0x9e0c('0x21')](handleEntityNotFound(_0x3a9d99,null))['then'](respondWithResult(_0x3a9d99,null))[_0x9e0c('0x3f')](handleError(_0x3a9d99,null));};exports['create']=function(_0x19df55,_0x3ac48e){return db[_0x9e0c('0x3b')][_0x9e0c('0x46')](_0x19df55[_0x9e0c('0x47')],{})[_0x9e0c('0x21')](respondWithResult(_0x3ac48e,0xc9))[_0x9e0c('0x3f')](handleError(_0x3ac48e,null));};exports[_0x9e0c('0x20')]=function(_0x615114,_0x5f0c23){if(_0x615114[_0x9e0c('0x47')]['id']){delete _0x615114['body']['id'];}return db['OpenchannelTransferReport'][_0x9e0c('0x45')]({'where':{'id':_0x615114[_0x9e0c('0x41')]['id']}})[_0x9e0c('0x21')](handleEntityNotFound(_0x5f0c23,null))[_0x9e0c('0x21')](saveUpdates(_0x615114['body'],null))['then'](respondWithResult(_0x5f0c23,null))['catch'](handleError(_0x5f0c23,null));};exports['destroy']=function(_0x31d39a,_0xfd3cf9){return db['OpenchannelTransferReport'][_0x9e0c('0x45')]({'where':{'id':_0x31d39a[_0x9e0c('0x41')]['id']}})['then'](handleEntityNotFound(_0xfd3cf9,null))['then'](removeEntity(_0xfd3cf9,null))[_0x9e0c('0x3f')](handleError(_0xfd3cf9,null));};exports['describe']=function(_0x5b23e3,_0x2f113e){return db[_0x9e0c('0x3b')][_0x9e0c('0x48')]()[_0x9e0c('0x21')](respondWithResult(_0x2f113e,null))['catch'](handleError(_0x2f113e,null));}; \ No newline at end of file +var _0xb70f=['bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','stack','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','OpenchannelTransferReport','findAll','rows','catch','length','find','create','body','params','describe','rimraf','fast-json-patch','request-promise'];(function(_0x10b5fe,_0x8c1204){var _0x26ed80=function(_0x4b17ae){while(--_0x4b17ae){_0x10b5fe['push'](_0x10b5fe['shift']());}};_0x26ed80(++_0x8c1204);}(_0xb70f,0x87));var _0xfb70=function(_0x5b051c,_0x203b7c){_0x5b051c=_0x5b051c-0x0;var _0x458dfa=_0xb70f[_0x5b051c];return _0x458dfa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb70('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb70('0x1'));var rp=require(_0xfb70('0x2'));var moment=require('moment');var BPromise=require(_0xfb70('0x3'));var Mustache=require(_0xfb70('0x4'));var util=require('util');var path=require(_0xfb70('0x5'));var sox=require(_0xfb70('0x6'));var csv=require(_0xfb70('0x7'));var ejs=require(_0xfb70('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb70('0x9'));var squel=require(_0xfb70('0xa'));var crypto=require(_0xfb70('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfb70('0xc'));var toCsv=require(_0xfb70('0x7'));var querystring=require(_0xfb70('0xd'));var Papa=require('papaparse');var Redis=require(_0xfb70('0xe'));var authService=require(_0xfb70('0xf'));var qs=require(_0xfb70('0x10'));var as=require(_0xfb70('0x11'));var hardwareService=require(_0xfb70('0x12'));var logger=require(_0xfb70('0x13'))('api');var utils=require(_0xfb70('0x14'));var config=require(_0xfb70('0x15'));var licenseUtil=require(_0xfb70('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe6a661,_0x3e85d2){_0x3e85d2=_0x3e85d2||0xcc;return function(_0x5655c1){if(_0x5655c1){return _0xe6a661[_0xfb70('0x17')](_0x3e85d2);}return _0xe6a661[_0xfb70('0x18')](_0x3e85d2)[_0xfb70('0x19')]();};}function respondWithResult(_0x2b16dd,_0x589e93){_0x589e93=_0x589e93||0xc8;return function(_0x235d0){if(_0x235d0){return _0x2b16dd['status'](_0x589e93)['json'](_0x235d0);}};}function respondWithFilteredResult(_0x339836,_0x438e2c){return function(_0x15a96a){if(_0x15a96a){var _0x33ae03=typeof _0x438e2c[_0xfb70('0x1a')]===_0xfb70('0x1b')&&typeof _0x438e2c[_0xfb70('0x1c')]===_0xfb70('0x1b');var _0x2611ee=_0x15a96a[_0xfb70('0x1d')];var _0x432c44=_0x33ae03?0x0:_0x438e2c[_0xfb70('0x1a')];var _0x51cc0f=_0x33ae03?_0x15a96a[_0xfb70('0x1d')]:_0x438e2c['offset']+_0x438e2c[_0xfb70('0x1c')];var _0x469d8c;if(_0x51cc0f>=_0x2611ee){_0x51cc0f=_0x2611ee;_0x469d8c=0xc8;}else{_0x469d8c=0xce;}_0x339836['status'](_0x469d8c);return _0x339836['set'](_0xfb70('0x1e'),_0x432c44+'-'+_0x51cc0f+'/'+_0x2611ee)['json'](_0x15a96a);}return null;};}function patchUpdates(_0x4b24e5){return function(_0x265267){try{jsonpatch[_0xfb70('0x1f')](_0x265267,_0x4b24e5,!![]);}catch(_0x53f062){return BPromise[_0xfb70('0x20')](_0x53f062);}return _0x265267['save']();};}function saveUpdates(_0xf0ae7b,_0x4c4012){return function(_0x404916){if(_0x404916){return _0x404916[_0xfb70('0x21')](_0xf0ae7b)['then'](function(_0x2f9778){return _0x2f9778;});}return null;};}function removeEntity(_0x9391c4,_0x2321d5){return function(_0x3f7209){if(_0x3f7209){return _0x3f7209[_0xfb70('0x22')]()['then'](function(){_0x9391c4[_0xfb70('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dd1f7,_0x3c3afb){return function(_0x4eba89){if(!_0x4eba89){_0x3dd1f7['sendStatus'](0x194);}return _0x4eba89;};}function handleError(_0x54894d,_0x52992a){_0x52992a=_0x52992a||0x1f4;return function(_0x4a1852){logger['error'](_0x4a1852[_0xfb70('0x23')]);if(_0x4a1852['name']){delete _0x4a1852['name'];}_0x54894d['status'](_0x52992a)['send'](_0x4a1852);};}exports[_0xfb70('0x24')]=function(_0x245178,_0x18026b){var _0x40b110={},_0x35ee85={},_0x166f4f={'count':0x0,'rows':[]};var _0xba81e9=_['map'](db['OpenchannelTransferReport'][_0xfb70('0x25')],function(_0x281103){return{'name':_0x281103['fieldName'],'type':_0x281103[_0xfb70('0x26')][_0xfb70('0x27')]};});_0x35ee85[_0xfb70('0x28')]=_[_0xfb70('0x29')](_0xba81e9,_0xfb70('0x2a'));_0x35ee85[_0xfb70('0x2b')]=_[_0xfb70('0x2c')](_0x245178[_0xfb70('0x2b')]);_0x35ee85[_0xfb70('0x2d')]=_[_0xfb70('0x2e')](_0x35ee85[_0xfb70('0x28')],_0x35ee85[_0xfb70('0x2b')]);_0x40b110['attributes']=_['intersection'](_0x35ee85[_0xfb70('0x28')],qs[_0xfb70('0x2f')](_0x245178[_0xfb70('0x2b')][_0xfb70('0x2f')]));_0x40b110[_0xfb70('0x30')]=_0x40b110[_0xfb70('0x30')]['length']?_0x40b110[_0xfb70('0x30')]:_0x35ee85['model'];if(!_0x245178[_0xfb70('0x2b')]['hasOwnProperty'](_0xfb70('0x31'))){_0x40b110[_0xfb70('0x1c')]=qs[_0xfb70('0x1c')](_0x245178[_0xfb70('0x2b')]['limit']);_0x40b110['offset']=qs[_0xfb70('0x1a')](_0x245178[_0xfb70('0x2b')][_0xfb70('0x1a')]);}_0x40b110[_0xfb70('0x32')]=qs[_0xfb70('0x33')](_0x245178[_0xfb70('0x2b')][_0xfb70('0x33')]);_0x40b110[_0xfb70('0x34')]=qs['filters'](_['pick'](_0x245178[_0xfb70('0x2b')],_0x35ee85[_0xfb70('0x2d')]),_0xba81e9);if(_0x245178[_0xfb70('0x2b')][_0xfb70('0x35')]){_0x40b110['where']=_['merge'](_0x40b110[_0xfb70('0x34')],{'$or':_[_0xfb70('0x29')](_0xba81e9,function(_0x15cc18){if(_0x15cc18[_0xfb70('0x26')]!=='VIRTUAL'){var _0x4ef4f5={};_0x4ef4f5[_0x15cc18['name']]={'$like':'%'+_0x245178[_0xfb70('0x2b')]['filter']+'%'};return _0x4ef4f5;}})});}_0x40b110=_[_0xfb70('0x36')]({},_0x40b110,_0x245178[_0xfb70('0x37')]);var _0x2be54={'where':_0x40b110[_0xfb70('0x34')]};return db['OpenchannelTransferReport']['count'](_0x2be54)[_0xfb70('0x38')](function(_0x3b800e){_0x166f4f[_0xfb70('0x1d')]=_0x3b800e;if(_0x245178[_0xfb70('0x2b')][_0xfb70('0x39')]){_0x40b110[_0xfb70('0x3a')]=[{'all':!![]}];}return db[_0xfb70('0x3b')][_0xfb70('0x3c')](_0x40b110);})[_0xfb70('0x38')](function(_0x37aa27){_0x166f4f[_0xfb70('0x3d')]=_0x37aa27;return _0x166f4f;})[_0xfb70('0x38')](respondWithFilteredResult(_0x18026b,_0x40b110))[_0xfb70('0x3e')](handleError(_0x18026b,null));};exports['show']=function(_0x590e1e,_0x3b7d50){var _0x58b77b={'raw':!![],'where':{'id':_0x590e1e['params']['id']}},_0x24d137={};_0x24d137[_0xfb70('0x28')]=_[_0xfb70('0x2c')](db[_0xfb70('0x3b')]['rawAttributes']);_0x24d137[_0xfb70('0x2b')]=_[_0xfb70('0x2c')](_0x590e1e[_0xfb70('0x2b')]);_0x24d137[_0xfb70('0x2d')]=_['intersection'](_0x24d137[_0xfb70('0x28')],_0x24d137[_0xfb70('0x2b')]);_0x58b77b['attributes']=_['intersection'](_0x24d137[_0xfb70('0x28')],qs[_0xfb70('0x2f')](_0x590e1e[_0xfb70('0x2b')][_0xfb70('0x2f')]));_0x58b77b['attributes']=_0x58b77b[_0xfb70('0x30')][_0xfb70('0x3f')]?_0x58b77b['attributes']:_0x24d137[_0xfb70('0x28')];if(_0x590e1e[_0xfb70('0x2b')][_0xfb70('0x39')]){_0x58b77b['include']=[{'all':!![]}];}_0x58b77b=_[_0xfb70('0x36')]({},_0x58b77b,_0x590e1e[_0xfb70('0x37')]);return db[_0xfb70('0x3b')][_0xfb70('0x40')](_0x58b77b)['then'](handleEntityNotFound(_0x3b7d50,null))[_0xfb70('0x38')](respondWithResult(_0x3b7d50,null))[_0xfb70('0x3e')](handleError(_0x3b7d50,null));};exports[_0xfb70('0x41')]=function(_0x205041,_0x144fed){return db[_0xfb70('0x3b')][_0xfb70('0x41')](_0x205041['body'],{})[_0xfb70('0x38')](respondWithResult(_0x144fed,0xc9))[_0xfb70('0x3e')](handleError(_0x144fed,null));};exports[_0xfb70('0x21')]=function(_0x2cb5ab,_0x1b38b2){if(_0x2cb5ab[_0xfb70('0x42')]['id']){delete _0x2cb5ab[_0xfb70('0x42')]['id'];}return db[_0xfb70('0x3b')][_0xfb70('0x40')]({'where':{'id':_0x2cb5ab[_0xfb70('0x43')]['id']}})[_0xfb70('0x38')](handleEntityNotFound(_0x1b38b2,null))[_0xfb70('0x38')](saveUpdates(_0x2cb5ab[_0xfb70('0x42')],null))[_0xfb70('0x38')](respondWithResult(_0x1b38b2,null))[_0xfb70('0x3e')](handleError(_0x1b38b2,null));};exports['destroy']=function(_0x3c2469,_0x20e6fa){return db[_0xfb70('0x3b')][_0xfb70('0x40')]({'where':{'id':_0x3c2469[_0xfb70('0x43')]['id']}})[_0xfb70('0x38')](handleEntityNotFound(_0x20e6fa,null))[_0xfb70('0x38')](removeEntity(_0x20e6fa,null))[_0xfb70('0x3e')](handleError(_0x20e6fa,null));};exports['describe']=function(_0x199f8d,_0x1332c3){return db[_0xfb70('0x3b')][_0xfb70('0x44')]()[_0xfb70('0x38')](respondWithResult(_0x1332c3,null))['catch'](handleError(_0x1332c3,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 4d1c0e8..3fcb255 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 _0x0cd0=['../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x4be8fd,_0x2512e7){var _0xf096a9=function(_0x413b03){while(--_0x413b03){_0x4be8fd['push'](_0x4be8fd['shift']());}};_0xf096a9(++_0x2512e7);}(_0x0cd0,0x1bc));var _0x00cd=function(_0x56d51b,_0x140737){_0x56d51b=_0x56d51b-0x0;var _0x3dc788=_0x0cd0[_0x56d51b];return _0x3dc788;};'use strict';var _=require(_0x00cd('0x0'));var util=require(_0x00cd('0x1'));var logger=require(_0x00cd('0x2'))('api');var moment=require(_0x00cd('0x3'));var BPromise=require(_0x00cd('0x4'));var rp=require(_0x00cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00cd('0x6'));var config=require(_0x00cd('0x7'));var attributes=require(_0x00cd('0x8'));module[_0x00cd('0x9')]=function(_0x270b74,_0x3e3e1d){return _0x270b74['define'](_0x00cd('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe01f=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x226c34,_0x5add93){var _0x14a8f7=function(_0x5e8acb){while(--_0x5e8acb){_0x226c34['push'](_0x226c34['shift']());}};_0x14a8f7(++_0x5add93);}(_0xe01f,0x17d));var _0xfe01=function(_0x5ed2b7,_0x52d6fe){_0x5ed2b7=_0x5ed2b7-0x0;var _0x5f4693=_0xe01f[_0x5ed2b7];return _0x5f4693;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe01('0x0'))(_0xfe01('0x1'));var moment=require(_0xfe01('0x2'));var BPromise=require(_0xfe01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe01('0x4'));var rimraf=require(_0xfe01('0x5'));var config=require(_0xfe01('0x6'));var attributes=require(_0xfe01('0x7'));module[_0xfe01('0x8')]=function(_0x7816,_0x421db5){return _0x7816['define'](_0xfe01('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xfe01('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 956f38b..52c1e46 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 _0x5b20=['OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x44c490,_0x3b699a){var _0x3f78dc=function(_0x4ee75e){while(--_0x4ee75e){_0x44c490['push'](_0x44c490['shift']());}};_0x3f78dc(++_0x3b699a);}(_0x5b20,0x86));var _0x05b2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b20[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var moment=require(_0x05b2('0x2'));var BPromise=require(_0x05b2('0x3'));var rs=require(_0x05b2('0x4'));var fs=require('fs');var Redis=require(_0x05b2('0x5'));var db=require(_0x05b2('0x6'))['db'];var utils=require(_0x05b2('0x7'));var logger=require(_0x05b2('0x8'))(_0x05b2('0x9'));var config=require(_0x05b2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x05b2('0xb')][_0x05b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x541855,_0x24f11f,_0x43cd94){return new BPromise(function(_0x3be69a,_0x1b66e4){return client[_0x05b2('0xd')](_0x541855,_0x43cd94)[_0x05b2('0xe')](function(_0xfe6680){logger[_0x05b2('0xf')](_0x05b2('0x10'),_0x24f11f,_0x05b2('0x11'));logger[_0x05b2('0x12')](_0x05b2('0x13'),_0x24f11f,_0x05b2('0x11'),JSON[_0x05b2('0x14')](_0xfe6680));if(_0xfe6680[_0x05b2('0x15')]){if(_0xfe6680[_0x05b2('0x15')]['code']===0x1f4){logger[_0x05b2('0x15')](_0x05b2('0x10'),_0x24f11f,_0xfe6680[_0x05b2('0x15')][_0x05b2('0x16')]);return _0x1b66e4(_0xfe6680['error'][_0x05b2('0x16')]);}logger[_0x05b2('0x15')](_0x05b2('0x10'),_0x24f11f,_0xfe6680['error']['message']);return _0x3be69a(_0xfe6680[_0x05b2('0x15')][_0x05b2('0x16')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x24f11f,_0x05b2('0x11'));_0x3be69a(_0xfe6680[_0x05b2('0x17')][_0x05b2('0x16')]);}})[_0x05b2('0x18')](function(_0x234843){logger[_0x05b2('0x15')](_0x05b2('0x10'),_0x24f11f,_0x234843);_0x1b66e4(_0x234843);});});} \ No newline at end of file +var _0xe015=['stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x41f96e,_0x333851){var _0x48a4ac=function(_0xdad934){while(--_0xdad934){_0x41f96e['push'](_0x41f96e['shift']());}};_0x48a4ac(++_0x333851);}(_0xe015,0x13b));var _0x5e01=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe015[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e01('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e01('0x4'));var logger=require(_0x5e01('0x5'))(_0x5e01('0x6'));var config=require(_0x5e01('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5e01('0x8')][_0x5e01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de678,_0x48b05c,_0x414f73){return new BPromise(function(_0x3aeaef,_0x1420c2){return client[_0x5e01('0xa')](_0x4de678,_0x414f73)[_0x5e01('0xb')](function(_0x36bd7e){logger['info'](_0x5e01('0xc'),_0x48b05c,'request\x20sent');logger[_0x5e01('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x48b05c,_0x5e01('0xe'),JSON[_0x5e01('0xf')](_0x36bd7e));if(_0x36bd7e['error']){if(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x11')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x48b05c,_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);return _0x1420c2(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);}logger[_0x5e01('0x10')](_0x5e01('0xc'),_0x48b05c,_0x36bd7e['error'][_0x5e01('0x12')]);return _0x3aeaef(_0x36bd7e['error']['message']);}else{logger[_0x5e01('0x13')](_0x5e01('0xc'),_0x48b05c,'request\x20sent');_0x3aeaef(_0x36bd7e[_0x5e01('0x14')]['message']);}})[_0x5e01('0x15')](function(_0x5e4058){logger[_0x5e01('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x48b05c,_0x5e4058);_0x1420c2(_0x5e4058);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index b6c979c..0d1407f 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 _0x210b=['../../components/interaction/service','./pause.controller','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x48e6c9,_0x46c2fd){var _0xf3f800=function(_0x4ce308){while(--_0x4ce308){_0x48e6c9['push'](_0x48e6c9['shift']());}};_0xf3f800(++_0x46c2fd);}(_0x210b,0xfa));var _0xb210=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x210b[_0xcfd89f];return _0x59acd4;};'use strict';var multer=require('multer');var util=require(_0xb210('0x0'));var path=require(_0xb210('0x1'));var timeout=require('connect-timeout');var express=require(_0xb210('0x2'));var router=express[_0xb210('0x3')]();var fs_extra=require(_0xb210('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb210('0x5'));var config=require('../../config/environment');var controller=require(_0xb210('0x6'));router['get']('/',auth[_0xb210('0x7')](),controller[_0xb210('0x8')]);router['get'](_0xb210('0x9'),auth[_0xb210('0x7')](),controller[_0xb210('0xa')]);router[_0xb210('0xb')]('/',auth[_0xb210('0x7')](),controller[_0xb210('0xc')]);router[_0xb210('0xd')](_0xb210('0x9'),auth[_0xb210('0x7')](),controller[_0xb210('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb210('0xf')]);module[_0xb210('0x10')]=router; \ No newline at end of file +var _0xd5c4=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','post','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x533b55,_0x56172d){var _0x30149d=function(_0x36ccc6){while(--_0x36ccc6){_0x533b55['push'](_0x533b55['shift']());}};_0x30149d(++_0x56172d);}(_0xd5c4,0x12d));var _0x4d5c=function(_0x2e08a9,_0x5cf397){_0x2e08a9=_0x2e08a9-0x0;var _0x79cbb7=_0xd5c4[_0x2e08a9];return _0x79cbb7;};'use strict';var multer=require(_0x4d5c('0x0'));var util=require(_0x4d5c('0x1'));var path=require(_0x4d5c('0x2'));var timeout=require(_0x4d5c('0x3'));var express=require(_0x4d5c('0x4'));var router=express[_0x4d5c('0x5')]();var fs_extra=require(_0x4d5c('0x6'));var auth=require(_0x4d5c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4d5c('0x8'));var controller=require('./pause.controller');router[_0x4d5c('0x9')]('/',auth['isAuthenticated'](),controller[_0x4d5c('0xa')]);router[_0x4d5c('0x9')](_0x4d5c('0xb'),auth[_0x4d5c('0xc')](),controller['show']);router[_0x4d5c('0xd')]('/',auth[_0x4d5c('0xc')](),controller['create']);router[_0x4d5c('0xe')]('/:id',auth[_0x4d5c('0xc')](),controller[_0x4d5c('0xf')]);router['delete'](_0x4d5c('0xb'),auth['isAuthenticated'](),controller[_0x4d5c('0x10')]);module[_0x4d5c('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2cd31df..9dcb104 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 _0x2a69=['exports','STRING','name'];(function(_0x445d4a,_0x239cc2){var _0x21260d=function(_0x152d0a){while(--_0x152d0a){_0x445d4a['push'](_0x445d4a['shift']());}};_0x21260d(++_0x239cc2);}(_0x2a69,0xd8));var _0x92a6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2a69[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x92a6('0x0')]={'name':{'type':Sequelize[_0x92a6('0x1')],'unique':_0x92a6('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x92a6('0x1')]}}; \ No newline at end of file +var _0x7233=['STRING','name','sequelize','exports'];(function(_0x3d2e35,_0x173330){var _0x50d629=function(_0x26505f){while(--_0x26505f){_0x3d2e35['push'](_0x3d2e35['shift']());}};_0x50d629(++_0x173330);}(_0x7233,0xbe));var _0x3723=function(_0x38a923,_0x4509f7){_0x38a923=_0x38a923-0x0;var _0x444ef9=_0x7233[_0x38a923];return _0x444ef9;};'use strict';var Sequelize=require(_0x3723('0x0'));module[_0x3723('0x1')]={'name':{'type':Sequelize[_0x3723('0x2')],'unique':_0x3723('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3723('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 3a5fb75..7259895 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 _0xdb42=['key','model','keys','query','intersection','attributes','length','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','autoAssociation','params','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','get','then','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type'];(function(_0x39c7b9,_0x51b800){var _0x2fa62f=function(_0x4fbe09){while(--_0x4fbe09){_0x39c7b9['push'](_0x39c7b9['shift']());}};_0x2fa62f(++_0x51b800);}(_0xdb42,0xb0));var _0x2db4=function(_0x353337,_0x20aac5){_0x353337=_0x353337-0x0;var _0x393c33=_0xdb42[_0x353337];return _0x393c33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2db4('0x0'));var zipdir=require(_0x2db4('0x1'));var jsonpatch=require(_0x2db4('0x2'));var rp=require('request-promise');var moment=require(_0x2db4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2db4('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2db4('0x5'));var csv=require(_0x2db4('0x6'));var ejs=require(_0x2db4('0x7'));var fs=require('fs');var fs_extra=require(_0x2db4('0x8'));var _=require(_0x2db4('0x9'));var squel=require(_0x2db4('0xa'));var crypto=require(_0x2db4('0xb'));var jsforce=require(_0x2db4('0xc'));var deskjs=require(_0x2db4('0xd'));var toCsv=require(_0x2db4('0x6'));var querystring=require('querystring');var Papa=require(_0x2db4('0xe'));var Redis=require(_0x2db4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2db4('0x10'));var hardwareService=require(_0x2db4('0x11'));var logger=require('../../config/logger')(_0x2db4('0x12'));var utils=require(_0x2db4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2db4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c27ee,_0x15f1eb){_0x15f1eb=_0x15f1eb||0xcc;return function(_0x67392){if(_0x67392){return _0x1c27ee[_0x2db4('0x15')](_0x15f1eb);}return _0x1c27ee[_0x2db4('0x16')](_0x15f1eb)[_0x2db4('0x17')]();};}function respondWithResult(_0x303f6c,_0x2100ab){_0x2100ab=_0x2100ab||0xc8;return function(_0x2bffa7){if(_0x2bffa7){return _0x303f6c[_0x2db4('0x16')](_0x2100ab)[_0x2db4('0x18')](_0x2bffa7);}};}function respondWithFilteredResult(_0x50d51b,_0x2313c4){return function(_0x4824cc){if(_0x4824cc){var _0x44ab76=typeof _0x2313c4[_0x2db4('0x19')]==='undefined'&&typeof _0x2313c4[_0x2db4('0x1a')]===_0x2db4('0x1b');var _0x4f2a1b=_0x4824cc[_0x2db4('0x1c')];var _0x2edb34=_0x44ab76?0x0:_0x2313c4[_0x2db4('0x19')];var _0x468ac4=_0x44ab76?_0x4824cc[_0x2db4('0x1c')]:_0x2313c4[_0x2db4('0x19')]+_0x2313c4[_0x2db4('0x1a')];var _0xfc525e;if(_0x468ac4>=_0x4f2a1b){_0x468ac4=_0x4f2a1b;_0xfc525e=0xc8;}else{_0xfc525e=0xce;}_0x50d51b['status'](_0xfc525e);return _0x50d51b[_0x2db4('0x1d')]('Content-Range',_0x2edb34+'-'+_0x468ac4+'/'+_0x4f2a1b)['json'](_0x4824cc);}return null;};}function patchUpdates(_0x2a5cbf){return function(_0x507cb1){try{jsonpatch['apply'](_0x507cb1,_0x2a5cbf,!![]);}catch(_0x5193bf){return BPromise[_0x2db4('0x1e')](_0x5193bf);}return _0x507cb1[_0x2db4('0x1f')]();};}function saveUpdates(_0x541295,_0x395564){return function(_0x406189){if(_0x406189){return _0x406189[_0x2db4('0x20')](_0x541295)['then'](function(_0x14e832){return _0x14e832;});}return null;};}function removeEntity(_0x4ad89d,_0x38887a){return function(_0x12c2be){if(_0x12c2be){return _0x12c2be[_0x2db4('0x21')]()['then'](function(){var _0x9e9ac0=_0x12c2be[_0x2db4('0x22')]({'plain':!![]});var _0x3cf8ee='Pauses';return db['UserProfileResource'][_0x2db4('0x21')]({'where':{'type':_0x3cf8ee,'resourceId':_0x9e9ac0['id']}})[_0x2db4('0x23')](function(){return _0x12c2be;});})['then'](function(){_0x4ad89d[_0x2db4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa08900,_0x4fe57f){return function(_0x1f8808){if(!_0x1f8808){_0xa08900[_0x2db4('0x15')](0x194);}return _0x1f8808;};}function handleError(_0x4e5fff,_0x10a594){_0x10a594=_0x10a594||0x1f4;return function(_0x4196c6){logger[_0x2db4('0x24')](_0x4196c6[_0x2db4('0x25')]);if(_0x4196c6[_0x2db4('0x26')]){delete _0x4196c6[_0x2db4('0x26')];}_0x4e5fff[_0x2db4('0x16')](_0x10a594)[_0x2db4('0x27')](_0x4196c6);};}exports[_0x2db4('0x28')]=function(_0x3a484a,_0x205d99){var _0x1745b1={},_0xcd4473={},_0x539189={'count':0x0,'rows':[]};var _0x493505=_[_0x2db4('0x29')](db[_0x2db4('0x2a')][_0x2db4('0x2b')],function(_0x19bb7d){return{'name':_0x19bb7d[_0x2db4('0x2c')],'type':_0x19bb7d[_0x2db4('0x2d')][_0x2db4('0x2e')]};});_0xcd4473[_0x2db4('0x2f')]=_['map'](_0x493505,_0x2db4('0x26'));_0xcd4473['query']=_[_0x2db4('0x30')](_0x3a484a[_0x2db4('0x31')]);_0xcd4473['filters']=_[_0x2db4('0x32')](_0xcd4473[_0x2db4('0x2f')],_0xcd4473[_0x2db4('0x31')]);_0x1745b1[_0x2db4('0x33')]=_[_0x2db4('0x32')](_0xcd4473[_0x2db4('0x2f')],qs['fields'](_0x3a484a[_0x2db4('0x31')]['fields']));_0x1745b1[_0x2db4('0x33')]=_0x1745b1[_0x2db4('0x33')][_0x2db4('0x34')]?_0x1745b1[_0x2db4('0x33')]:_0xcd4473[_0x2db4('0x2f')];if(!_0x3a484a[_0x2db4('0x31')]['hasOwnProperty']('nolimit')){_0x1745b1[_0x2db4('0x1a')]=qs[_0x2db4('0x1a')](_0x3a484a[_0x2db4('0x31')][_0x2db4('0x1a')]);_0x1745b1[_0x2db4('0x19')]=qs[_0x2db4('0x19')](_0x3a484a[_0x2db4('0x31')][_0x2db4('0x19')]);}_0x1745b1['order']=qs[_0x2db4('0x35')](_0x3a484a[_0x2db4('0x31')][_0x2db4('0x35')]);_0x1745b1[_0x2db4('0x36')]=qs[_0x2db4('0x37')](_[_0x2db4('0x38')](_0x3a484a[_0x2db4('0x31')],_0xcd4473[_0x2db4('0x37')]),_0x493505);if(_0x3a484a[_0x2db4('0x31')]['filter']){_0x1745b1[_0x2db4('0x36')]=_['merge'](_0x1745b1[_0x2db4('0x36')],{'$or':_['map'](_0x493505,function(_0x21edb7){if(_0x21edb7[_0x2db4('0x2d')]!==_0x2db4('0x39')){var _0x29c276={};_0x29c276[_0x21edb7[_0x2db4('0x26')]]={'$like':'%'+_0x3a484a['query'][_0x2db4('0x3a')]+'%'};return _0x29c276;}})});}_0x1745b1=_[_0x2db4('0x3b')]({},_0x1745b1,_0x3a484a[_0x2db4('0x3c')]);var _0x1296a9={'where':_0x1745b1[_0x2db4('0x36')]};return db[_0x2db4('0x2a')][_0x2db4('0x1c')](_0x1296a9)[_0x2db4('0x23')](function(_0xc87ea){_0x539189['count']=_0xc87ea;if(_0x3a484a[_0x2db4('0x31')][_0x2db4('0x3d')]){_0x1745b1[_0x2db4('0x3e')]=[{'all':!![]}];}return db['Pause'][_0x2db4('0x3f')](_0x1745b1);})[_0x2db4('0x23')](function(_0x2df1d7){_0x539189['rows']=_0x2df1d7;return _0x539189;})['then'](respondWithFilteredResult(_0x205d99,_0x1745b1))[_0x2db4('0x40')](handleError(_0x205d99,null));};exports[_0x2db4('0x41')]=function(_0x280a02,_0x49ba6c){var _0x302b81={'raw':!![],'where':{'id':_0x280a02['params']['id']}},_0x1ab187={};_0x1ab187['model']=_[_0x2db4('0x30')](db[_0x2db4('0x2a')][_0x2db4('0x2b')]);_0x1ab187[_0x2db4('0x31')]=_[_0x2db4('0x30')](_0x280a02['query']);_0x1ab187['filters']=_[_0x2db4('0x32')](_0x1ab187['model'],_0x1ab187[_0x2db4('0x31')]);_0x302b81[_0x2db4('0x33')]=_[_0x2db4('0x32')](_0x1ab187['model'],qs['fields'](_0x280a02[_0x2db4('0x31')]['fields']));_0x302b81['attributes']=_0x302b81['attributes'][_0x2db4('0x34')]?_0x302b81[_0x2db4('0x33')]:_0x1ab187['model'];if(_0x280a02[_0x2db4('0x31')][_0x2db4('0x3d')]){_0x302b81[_0x2db4('0x3e')]=[{'all':!![]}];}_0x302b81=_['merge']({},_0x302b81,_0x280a02[_0x2db4('0x3c')]);return db[_0x2db4('0x2a')][_0x2db4('0x42')](_0x302b81)[_0x2db4('0x23')](handleEntityNotFound(_0x49ba6c,null))[_0x2db4('0x23')](respondWithResult(_0x49ba6c,null))[_0x2db4('0x40')](handleError(_0x49ba6c,null));};exports[_0x2db4('0x43')]=function(_0x349643,_0x3988a5){return db[_0x2db4('0x2a')][_0x2db4('0x43')](_0x349643[_0x2db4('0x44')],{})[_0x2db4('0x23')](function(_0x5453a3){var _0x53af9e=_0x349643['user'][_0x2db4('0x22')]({'plain':!![]});if(!_0x53af9e)throw new Error(_0x2db4('0x45'));if(_0x53af9e[_0x2db4('0x46')]==='user'){var _0x2103c7=_0x5453a3[_0x2db4('0x22')]({'plain':!![]});var _0x4a2f24=_0x2db4('0x47');return db['UserProfileSection'][_0x2db4('0x42')]({'where':{'name':_0x4a2f24,'userProfileId':_0x53af9e['userProfileId']},'raw':!![]})[_0x2db4('0x23')](function(_0xad2d9f){if(_0xad2d9f&&_0xad2d9f[_0x2db4('0x48')]===0x0){return db['UserProfileResource'][_0x2db4('0x43')]({'name':_0x2103c7[_0x2db4('0x26')],'resourceId':_0x2103c7['id'],'type':_0xad2d9f[_0x2db4('0x26')],'sectionId':_0xad2d9f['id']},{})[_0x2db4('0x23')](function(){return _0x5453a3;});}else{return _0x5453a3;}})[_0x2db4('0x40')](function(_0x1ac056){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ac056);throw _0x1ac056;});}return _0x5453a3;})[_0x2db4('0x23')](respondWithResult(_0x3988a5,0xc9))['catch'](handleError(_0x3988a5,null));};exports[_0x2db4('0x20')]=function(_0x2db69b,_0x16be3a){if(_0x2db69b[_0x2db4('0x44')]['id']){delete _0x2db69b[_0x2db4('0x44')]['id'];}return db[_0x2db4('0x2a')][_0x2db4('0x42')]({'where':{'id':_0x2db69b[_0x2db4('0x49')]['id']}})[_0x2db4('0x23')](handleEntityNotFound(_0x16be3a,null))[_0x2db4('0x23')](saveUpdates(_0x2db69b[_0x2db4('0x44')],null))[_0x2db4('0x23')](respondWithResult(_0x16be3a,null))[_0x2db4('0x40')](handleError(_0x16be3a,null));};exports[_0x2db4('0x21')]=function(_0x50ff62,_0x163b07){return db[_0x2db4('0x2a')][_0x2db4('0x42')]({'where':{'id':_0x50ff62[_0x2db4('0x49')]['id']}})['then'](handleEntityNotFound(_0x163b07,null))[_0x2db4('0x23')](removeEntity(_0x163b07,null))['catch'](handleError(_0x163b07,null));}; \ No newline at end of file +var _0x3737=['status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','Pauses','UserProfileResource','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','error','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3737,0x185));var _0x7373=function(_0x4c2ca3,_0x44288a){_0x4c2ca3=_0x4c2ca3-0x0;var _0x1af873=_0x3737[_0x4c2ca3];return _0x1af873;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7373('0x0'));var jsonpatch=require(_0x7373('0x1'));var rp=require(_0x7373('0x2'));var moment=require(_0x7373('0x3'));var BPromise=require(_0x7373('0x4'));var Mustache=require(_0x7373('0x5'));var util=require(_0x7373('0x6'));var path=require(_0x7373('0x7'));var sox=require(_0x7373('0x8'));var csv=require('to-csv');var ejs=require(_0x7373('0x9'));var fs=require('fs');var fs_extra=require(_0x7373('0xa'));var _=require(_0x7373('0xb'));var squel=require(_0x7373('0xc'));var crypto=require(_0x7373('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7373('0xe'));var toCsv=require(_0x7373('0xf'));var querystring=require(_0x7373('0x10'));var Papa=require(_0x7373('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7373('0x12'));var as=require(_0x7373('0x13'));var hardwareService=require(_0x7373('0x14'));var logger=require('../../config/logger')(_0x7373('0x15'));var utils=require(_0x7373('0x16'));var config=require(_0x7373('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7373('0x18'))['db'];function respondWithStatusCode(_0x55e792,_0x53b821){_0x53b821=_0x53b821||0xcc;return function(_0x45d66b){if(_0x45d66b){return _0x55e792['sendStatus'](_0x53b821);}return _0x55e792['status'](_0x53b821)[_0x7373('0x19')]();};}function respondWithResult(_0x1e1652,_0x433c5f){_0x433c5f=_0x433c5f||0xc8;return function(_0x309c5c){if(_0x309c5c){return _0x1e1652[_0x7373('0x1a')](_0x433c5f)['json'](_0x309c5c);}};}function respondWithFilteredResult(_0x3db6ff,_0x45d23a){return function(_0x11e6c1){if(_0x11e6c1){var _0x42dfd1=typeof _0x45d23a[_0x7373('0x1b')]===_0x7373('0x1c')&&typeof _0x45d23a[_0x7373('0x1d')]===_0x7373('0x1c');var _0x59b1e6=_0x11e6c1[_0x7373('0x1e')];var _0x4deb6e=_0x42dfd1?0x0:_0x45d23a[_0x7373('0x1b')];var _0x31a227=_0x42dfd1?_0x11e6c1[_0x7373('0x1e')]:_0x45d23a['offset']+_0x45d23a[_0x7373('0x1d')];var _0x1d3f22;if(_0x31a227>=_0x59b1e6){_0x31a227=_0x59b1e6;_0x1d3f22=0xc8;}else{_0x1d3f22=0xce;}_0x3db6ff[_0x7373('0x1a')](_0x1d3f22);return _0x3db6ff[_0x7373('0x1f')](_0x7373('0x20'),_0x4deb6e+'-'+_0x31a227+'/'+_0x59b1e6)[_0x7373('0x21')](_0x11e6c1);}return null;};}function patchUpdates(_0x185179){return function(_0xc5170a){try{jsonpatch['apply'](_0xc5170a,_0x185179,!![]);}catch(_0x191635){return BPromise[_0x7373('0x22')](_0x191635);}return _0xc5170a[_0x7373('0x23')]();};}function saveUpdates(_0x4901d5,_0x1e9aa4){return function(_0x39c260){if(_0x39c260){return _0x39c260[_0x7373('0x24')](_0x4901d5)[_0x7373('0x25')](function(_0x5bb31b){return _0x5bb31b;});}return null;};}function removeEntity(_0x2d38fd,_0x183fad){return function(_0x2568ac){if(_0x2568ac){return _0x2568ac[_0x7373('0x26')]()['then'](function(){var _0x2cdd10=_0x2568ac['get']({'plain':!![]});var _0x58def2=_0x7373('0x27');return db[_0x7373('0x28')][_0x7373('0x26')]({'where':{'type':_0x58def2,'resourceId':_0x2cdd10['id']}})[_0x7373('0x25')](function(){return _0x2568ac;});})[_0x7373('0x25')](function(){_0x2d38fd[_0x7373('0x1a')](0xcc)[_0x7373('0x19')]();});}};}function handleEntityNotFound(_0x34f8ab,_0x1a48df){return function(_0x3f850e){if(!_0x3f850e){_0x34f8ab[_0x7373('0x29')](0x194);}return _0x3f850e;};}function handleError(_0x223c19,_0x4c9d07){_0x4c9d07=_0x4c9d07||0x1f4;return function(_0x29be91){logger['error'](_0x29be91[_0x7373('0x2a')]);if(_0x29be91['name']){delete _0x29be91[_0x7373('0x2b')];}_0x223c19[_0x7373('0x1a')](_0x4c9d07)[_0x7373('0x2c')](_0x29be91);};}exports[_0x7373('0x2d')]=function(_0x275c27,_0x3621f6){var _0x117af9={},_0x458eed={},_0x3cf2fe={'count':0x0,'rows':[]};var _0x352949=_[_0x7373('0x2e')](db[_0x7373('0x2f')][_0x7373('0x30')],function(_0xae1fb6){return{'name':_0xae1fb6[_0x7373('0x31')],'type':_0xae1fb6[_0x7373('0x32')][_0x7373('0x33')]};});_0x458eed[_0x7373('0x34')]=_[_0x7373('0x2e')](_0x352949,_0x7373('0x2b'));_0x458eed[_0x7373('0x35')]=_[_0x7373('0x36')](_0x275c27['query']);_0x458eed[_0x7373('0x37')]=_[_0x7373('0x38')](_0x458eed[_0x7373('0x34')],_0x458eed[_0x7373('0x35')]);_0x117af9[_0x7373('0x39')]=_[_0x7373('0x38')](_0x458eed[_0x7373('0x34')],qs['fields'](_0x275c27[_0x7373('0x35')][_0x7373('0x3a')]));_0x117af9[_0x7373('0x39')]=_0x117af9[_0x7373('0x39')]['length']?_0x117af9['attributes']:_0x458eed[_0x7373('0x34')];if(!_0x275c27['query'][_0x7373('0x3b')](_0x7373('0x3c'))){_0x117af9[_0x7373('0x1d')]=qs[_0x7373('0x1d')](_0x275c27[_0x7373('0x35')]['limit']);_0x117af9[_0x7373('0x1b')]=qs[_0x7373('0x1b')](_0x275c27[_0x7373('0x35')][_0x7373('0x1b')]);}_0x117af9['order']=qs['sort'](_0x275c27['query']['sort']);_0x117af9[_0x7373('0x3d')]=qs[_0x7373('0x37')](_[_0x7373('0x3e')](_0x275c27[_0x7373('0x35')],_0x458eed[_0x7373('0x37')]),_0x352949);if(_0x275c27[_0x7373('0x35')]['filter']){_0x117af9[_0x7373('0x3d')]=_[_0x7373('0x3f')](_0x117af9[_0x7373('0x3d')],{'$or':_[_0x7373('0x2e')](_0x352949,function(_0xfed083){if(_0xfed083['type']!==_0x7373('0x40')){var _0x1be69a={};_0x1be69a[_0xfed083[_0x7373('0x2b')]]={'$like':'%'+_0x275c27[_0x7373('0x35')]['filter']+'%'};return _0x1be69a;}})});}_0x117af9=_[_0x7373('0x3f')]({},_0x117af9,_0x275c27['options']);var _0x5f3b3a={'where':_0x117af9[_0x7373('0x3d')]};return db[_0x7373('0x2f')]['count'](_0x5f3b3a)[_0x7373('0x25')](function(_0x46c8c8){_0x3cf2fe[_0x7373('0x1e')]=_0x46c8c8;if(_0x275c27[_0x7373('0x35')][_0x7373('0x41')]){_0x117af9[_0x7373('0x42')]=[{'all':!![]}];}return db[_0x7373('0x2f')][_0x7373('0x43')](_0x117af9);})[_0x7373('0x25')](function(_0x5cc4c1){_0x3cf2fe[_0x7373('0x44')]=_0x5cc4c1;return _0x3cf2fe;})[_0x7373('0x25')](respondWithFilteredResult(_0x3621f6,_0x117af9))[_0x7373('0x45')](handleError(_0x3621f6,null));};exports[_0x7373('0x46')]=function(_0x563e4f,_0x55090b){var _0x3ff229={'raw':!![],'where':{'id':_0x563e4f[_0x7373('0x47')]['id']}},_0xef4718={};_0xef4718[_0x7373('0x34')]=_[_0x7373('0x36')](db[_0x7373('0x2f')][_0x7373('0x30')]);_0xef4718['query']=_['keys'](_0x563e4f[_0x7373('0x35')]);_0xef4718[_0x7373('0x37')]=_['intersection'](_0xef4718[_0x7373('0x34')],_0xef4718['query']);_0x3ff229[_0x7373('0x39')]=_['intersection'](_0xef4718[_0x7373('0x34')],qs[_0x7373('0x3a')](_0x563e4f[_0x7373('0x35')][_0x7373('0x3a')]));_0x3ff229['attributes']=_0x3ff229[_0x7373('0x39')][_0x7373('0x48')]?_0x3ff229[_0x7373('0x39')]:_0xef4718['model'];if(_0x563e4f[_0x7373('0x35')][_0x7373('0x41')]){_0x3ff229[_0x7373('0x42')]=[{'all':!![]}];}_0x3ff229=_[_0x7373('0x3f')]({},_0x3ff229,_0x563e4f[_0x7373('0x49')]);return db[_0x7373('0x2f')][_0x7373('0x4a')](_0x3ff229)[_0x7373('0x25')](handleEntityNotFound(_0x55090b,null))[_0x7373('0x25')](respondWithResult(_0x55090b,null))[_0x7373('0x45')](handleError(_0x55090b,null));};exports[_0x7373('0x4b')]=function(_0x4d15f2,_0x10d58f){return db[_0x7373('0x2f')][_0x7373('0x4b')](_0x4d15f2[_0x7373('0x4c')],{})[_0x7373('0x25')](function(_0x45a6c2){var _0x59f90f=_0x4d15f2['user']['get']({'plain':!![]});if(!_0x59f90f)throw new Error(_0x7373('0x4d'));if(_0x59f90f[_0x7373('0x4e')]==='user'){var _0x2b3674=_0x45a6c2[_0x7373('0x4f')]({'plain':!![]});var _0x386062=_0x7373('0x27');return db[_0x7373('0x50')]['find']({'where':{'name':_0x386062,'userProfileId':_0x59f90f[_0x7373('0x51')]},'raw':!![]})[_0x7373('0x25')](function(_0x36939c){if(_0x36939c&&_0x36939c['autoAssociation']===0x0){return db['UserProfileResource'][_0x7373('0x4b')]({'name':_0x2b3674[_0x7373('0x2b')],'resourceId':_0x2b3674['id'],'type':_0x36939c['name'],'sectionId':_0x36939c['id']},{})[_0x7373('0x25')](function(){return _0x45a6c2;});}else{return _0x45a6c2;}})[_0x7373('0x45')](function(_0x42665b){logger[_0x7373('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42665b);throw _0x42665b;});}return _0x45a6c2;})[_0x7373('0x25')](respondWithResult(_0x10d58f,0xc9))[_0x7373('0x45')](handleError(_0x10d58f,null));};exports[_0x7373('0x24')]=function(_0x459986,_0x217872){if(_0x459986['body']['id']){delete _0x459986['body']['id'];}return db[_0x7373('0x2f')][_0x7373('0x4a')]({'where':{'id':_0x459986['params']['id']}})[_0x7373('0x25')](handleEntityNotFound(_0x217872,null))['then'](saveUpdates(_0x459986[_0x7373('0x4c')],null))['then'](respondWithResult(_0x217872,null))[_0x7373('0x45')](handleError(_0x217872,null));};exports[_0x7373('0x26')]=function(_0x29bfac,_0x147ac0){return db['Pause']['find']({'where':{'id':_0x29bfac[_0x7373('0x47')]['id']}})['then'](handleEntityNotFound(_0x147ac0,null))['then'](removeEntity(_0x147ac0,null))[_0x7373('0x45')](handleError(_0x147ac0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4224529..76fdc9c 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 _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x3db7ed,_0x569cdc){var _0x496e6c=function(_0x394a6e){while(--_0x394a6e){_0x3db7ed['push'](_0x3db7ed['shift']());}};_0x496e6c(++_0x569cdc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x5fc3[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6aa7,0x178));var _0x76aa=function(_0x1ced14,_0x542b32){_0x1ced14=_0x1ced14-0x0;var _0x48038a=_0x6aa7[_0x1ced14];return _0x48038a;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'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 c0e2eca..5819965 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xfd7137,_0x4c0c39){var _0x755914=function(_0x172fcb){while(--_0x172fcb){_0xfd7137['push'](_0xfd7137['shift']());}};_0x755914(++_0x4c0c39);}(_0x7a54,0x106));var _0x47a5=function(_0xc025a9,_0xb4fa78){_0xc025a9=_0xc025a9-0x0;var _0x57b7fd=_0x7a54[_0xc025a9];return _0x57b7fd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x5067fa,_0x429c2b){var _0x4284f7=function(_0x199d7e){while(--_0x199d7e){_0x5067fa['push'](_0x5067fa['shift']());}};_0x4284f7(++_0x429c2b);}(_0x7a54,0x106));var _0x47a5=function(_0x21cab5,_0x21e6c1){_0x21cab5=_0x21cab5-0x0;var _0x14ebb3=_0x7a54[_0x21cab5];return _0x14ebb3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index f9a38c2..d0a8ec4 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 _0x4fdb=['server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','/webhook','webhookGet','get','show','/:id/download','download','diskStorage','root'];(function(_0x425b19,_0x2dcf14){var _0x15ecab=function(_0x317d46){while(--_0x317d46){_0x425b19['push'](_0x425b19['shift']());}};_0x15ecab(++_0x2dcf14);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x25fca4,_0xca789c){_0x25fca4=_0x25fca4-0x0;var _0x45aea4=_0x4fdb[_0x25fca4];return _0x45aea4;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var fs_extra=require(_0xb4fd('0x6'));var auth=require(_0xb4fd('0x7'));var interaction=require(_0xb4fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb4fd('0x9'));router['get']('/',auth[_0xb4fd('0xa')](),controller['index']);router['get'](_0xb4fd('0xb'),controller[_0xb4fd('0xc')]);router[_0xb4fd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb4fd('0xe')]);router[_0xb4fd('0xd')](_0xb4fd('0xf'),auth['isAuthenticated'](),controller[_0xb4fd('0x10')]);var upload=multer({'storage':multer[_0xb4fd('0x11')]({'destination':function(_0x2148db,_0x23b08f,_0x306bd4){_0x306bd4(null,path['join'](config[_0xb4fd('0x12')],_0xb4fd('0x13')));},'filename':function(_0x2e8ee1,_0x120c2e,_0x5ba7e1){_0x120c2e[_0xb4fd('0x14')]=_0x120c2e[_0xb4fd('0x14')][_0xb4fd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ba7e1(null,util['format'](_0xb4fd('0x16'),path[_0xb4fd('0x17')](_0x120c2e[_0xb4fd('0x14')],path[_0xb4fd('0x18')](_0x120c2e[_0xb4fd('0x14')])),Date[_0xb4fd('0x19')](),path[_0xb4fd('0x18')](_0x120c2e['originalname'])));}})});router[_0xb4fd('0x1a')]('/',upload[_0xb4fd('0x1b')](_0xb4fd('0x1c')),controller[_0xb4fd('0x1d')]);router[_0xb4fd('0x1a')](_0xb4fd('0xb'),controller[_0xb4fd('0x1e')]);router[_0xb4fd('0x1f')](_0xb4fd('0x20'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module[_0xb4fd('0x22')]=router; \ No newline at end of file +var _0x303a=['show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook'];(function(_0x157b85,_0x299ecf){var _0x343e99=function(_0x202c94){while(--_0x202c94){_0x157b85['push'](_0x157b85['shift']());}};_0x343e99(++_0x299ecf);}(_0x303a,0x1a0));var _0xa303=function(_0x1df956,_0x2944cd){_0x1df956=_0x1df956-0x0;var _0x2eadc7=_0x303a[_0x1df956];return _0x2eadc7;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),controller['webhookGet']);router['get']('/:id',auth[_0xa303('0xa')](),controller[_0xa303('0xd')]);router['get'](_0xa303('0xe'),auth['isAuthenticated'](),controller[_0xa303('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29cd60,_0x17dfcd,_0x382cfd){_0x382cfd(null,path[_0xa303('0x10')](config['root'],_0xa303('0x11')));},'filename':function(_0x4c0169,_0xf5df1e,_0x43a054){_0xf5df1e[_0xa303('0x12')]=_0xf5df1e['originalname'][_0xa303('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43a054(null,util[_0xa303('0x14')](_0xa303('0x15'),path[_0xa303('0x16')](_0xf5df1e[_0xa303('0x12')],path[_0xa303('0x17')](_0xf5df1e[_0xa303('0x12')])),Date[_0xa303('0x18')](),path['extname'](_0xf5df1e[_0xa303('0x12')])));}})});router[_0xa303('0x19')]('/',upload[_0xa303('0x1a')](_0xa303('0x1b')),controller[_0xa303('0x1c')]);router[_0xa303('0x19')]('/webhook',controller[_0xa303('0x1d')]);router['put'](_0xa303('0x1e'),auth['isAuthenticated'](),controller[_0xa303('0x1f')]);router['delete'](_0xa303('0x1e'),auth[_0xa303('0xa')](),controller[_0xa303('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 55a4e84..63dffc7 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 _0xa2a1=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never'];(function(_0x40addd,_0xcbb2ba){var _0x5aacd8=function(_0x289daa){while(--_0x289daa){_0x40addd['push'](_0x40addd['shift']());}};_0x5aacd8(++_0xcbb2ba);}(_0xa2a1,0x16d));var _0x1a2a=function(_0x139f63,_0x172987){_0x139f63=_0x139f63-0x0;var _0x4d9cf9=_0xa2a1[_0x139f63];return _0x4d9cf9;};'use strict';var Sequelize=require(_0x1a2a('0x0'));module[_0x1a2a('0x1')]={'name':{'type':Sequelize[_0x1a2a('0x2')]},'type':{'type':Sequelize[_0x1a2a('0x3')](_0x1a2a('0x4'),_0x1a2a('0x5'))},'description':{'type':Sequelize[_0x1a2a('0x6')]},'version':{'type':Sequelize[_0x1a2a('0x6')]},'path':{'type':Sequelize[_0x1a2a('0x2')],'comment':_0x1a2a('0x7')},'active':{'type':Sequelize[_0x1a2a('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x1a2a('0x3')](_0x1a2a('0x9'),_0x1a2a('0xa'),_0x1a2a('0xb'),_0x1a2a('0xc')),'defaultValue':_0x1a2a('0xb'),'comment':_0x1a2a('0xd')},'icon':{'type':Sequelize[_0x1a2a('0x2')]},'adminUrl':{'type':Sequelize[_0x1a2a('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1a2a('0x2')]},'scriptPath':{'type':Sequelize[_0x1a2a('0x2')]}}; \ No newline at end of file +var _0x2e89=['TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script'];(function(_0x3a6d6f,_0x5ce916){var _0x358c07=function(_0x4282c2){while(--_0x4282c2){_0x3a6d6f['push'](_0x3a6d6f['shift']());}};_0x358c07(++_0x5ce916);}(_0x2e89,0x19f));var _0x92e8=function(_0x313b92,_0x48c2b5){_0x313b92=_0x313b92-0x0;var _0x421fd8=_0x2e89[_0x313b92];return _0x421fd8;};'use strict';var Sequelize=require(_0x92e8('0x0'));module[_0x92e8('0x1')]={'name':{'type':Sequelize[_0x92e8('0x2')]},'type':{'type':Sequelize[_0x92e8('0x3')]('html',_0x92e8('0x4'))},'description':{'type':Sequelize[_0x92e8('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x92e8('0x6')},'sidebar':{'type':Sequelize[_0x92e8('0x3')](_0x92e8('0x7'),_0x92e8('0x8'),_0x92e8('0x9'),_0x92e8('0xa')),'defaultValue':_0x92e8('0x9'),'comment':_0x92e8('0xb')},'icon':{'type':Sequelize[_0x92e8('0x2')]},'adminUrl':{'type':Sequelize[_0x92e8('0x2')]},'agentUrl':{'type':Sequelize[_0x92e8('0x2')]},'scriptName':{'type':Sequelize[_0x92e8('0x2')]},'scriptPath':{'type':Sequelize[_0x92e8('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 745d3d4..ed66d53 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 _0xb917=['Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','views','parameters','admin','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','http://localhost:','content-type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','Plugins','UserProfileResource','destroy','error','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','fields','find','catch','download','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','dirname','attachments/**/*','finalize','close','existsSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb917,0xf6));var _0x7b91=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb917[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7b91('0x0'));var rimraf=require(_0x7b91('0x1'));var zipdir=require(_0x7b91('0x2'));var jsonpatch=require(_0x7b91('0x3'));var rp=require(_0x7b91('0x4'));var moment=require(_0x7b91('0x5'));var BPromise=require(_0x7b91('0x6'));var Mustache=require(_0x7b91('0x7'));var util=require(_0x7b91('0x8'));var path=require('path');var sox=require(_0x7b91('0x9'));var csv=require(_0x7b91('0xa'));var ejs=require(_0x7b91('0xb'));var fs=require('fs');var fs_extra=require(_0x7b91('0xc'));var _=require(_0x7b91('0xd'));var squel=require(_0x7b91('0xe'));var crypto=require(_0x7b91('0xf'));var jsforce=require(_0x7b91('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7b91('0xa'));var querystring=require(_0x7b91('0x11'));var Papa=require(_0x7b91('0x12'));var extract=require(_0x7b91('0x13'));var rimraf=require(_0x7b91('0x1'));var archiver=require(_0x7b91('0x14'));var Redis=require(_0x7b91('0x15'));var authService=require(_0x7b91('0x16'));var qs=require(_0x7b91('0x17'));var as=require(_0x7b91('0x18'));var hardwareService=require(_0x7b91('0x19'));var logger=require('../../config/logger')(_0x7b91('0x1a'));var utils=require(_0x7b91('0x1b'));var config=require(_0x7b91('0x1c'));var licenseUtil=require(_0x7b91('0x1d'));var db=require('../../mysqldb')['db'];config[_0x7b91('0x1e')]=_[_0x7b91('0x1f')](config[_0x7b91('0x1e')],{'host':_0x7b91('0x20'),'port':0x18eb});var socket=require(_0x7b91('0x21'))(new Redis(config[_0x7b91('0x1e')]));require(_0x7b91('0x22'))['register'](socket);function respondWithStatusCode(_0x4a39e7,_0x235238){_0x235238=_0x235238||0xcc;return function(_0x4730fe){if(_0x4730fe){return _0x4a39e7[_0x7b91('0x23')](_0x235238);}return _0x4a39e7[_0x7b91('0x24')](_0x235238)[_0x7b91('0x25')]();};}function respondWithResult(_0x535fb8,_0x3477ab){_0x3477ab=_0x3477ab||0xc8;return function(_0x3d373e){if(_0x3d373e){return _0x535fb8['status'](_0x3477ab)[_0x7b91('0x26')](_0x3d373e);}};}function respondWithFilteredResult(_0x182b4a,_0x51df9f){return function(_0x1fe2d0){if(_0x1fe2d0){var _0x499966=typeof _0x51df9f[_0x7b91('0x27')]==='undefined'&&typeof _0x51df9f[_0x7b91('0x28')]==='undefined';var _0x58c283=_0x1fe2d0[_0x7b91('0x29')];var _0x20bb56=_0x499966?0x0:_0x51df9f[_0x7b91('0x27')];var _0x86b926=_0x499966?_0x1fe2d0['count']:_0x51df9f[_0x7b91('0x27')]+_0x51df9f['limit'];var _0x2f6ee1;if(_0x86b926>=_0x58c283){_0x86b926=_0x58c283;_0x2f6ee1=0xc8;}else{_0x2f6ee1=0xce;}_0x182b4a[_0x7b91('0x24')](_0x2f6ee1);return _0x182b4a[_0x7b91('0x2a')](_0x7b91('0x2b'),_0x20bb56+'-'+_0x86b926+'/'+_0x58c283)['json'](_0x1fe2d0);}return null;};}function patchUpdates(_0x3f82ef){return function(_0x425083){try{jsonpatch[_0x7b91('0x2c')](_0x425083,_0x3f82ef,!![]);}catch(_0x47adfe){return BPromise[_0x7b91('0x2d')](_0x47adfe);}return _0x425083[_0x7b91('0x2e')]();};}function saveUpdates(_0x13d784,_0x191fa4){return function(_0x367414){if(_0x367414){return _0x367414[_0x7b91('0x2f')](_0x13d784)[_0x7b91('0x30')](function(_0x3f1ba6){return _0x3f1ba6;});}return null;};}function removeEntity(_0x2ec7ec,_0x3899d7){return function(_0x20f804){if(_0x20f804){return _0x20f804['destroy']()[_0x7b91('0x30')](function(){var _0x2e0dad=_0x20f804['get']({'plain':!![]});var _0x3ef53a=_0x7b91('0x31');return db[_0x7b91('0x32')][_0x7b91('0x33')]({'where':{'type':_0x3ef53a,'resourceId':_0x2e0dad['id']}})[_0x7b91('0x30')](function(){return _0x20f804;});})[_0x7b91('0x30')](function(){_0x2ec7ec['status'](0xcc)[_0x7b91('0x25')]();});}};}function handleEntityNotFound(_0x18531c,_0x19daa9){return function(_0x5c5729){if(!_0x5c5729){_0x18531c[_0x7b91('0x23')](0x194);}return _0x5c5729;};}function handleError(_0x5c3e96,_0x357276){_0x357276=_0x357276||0x1f4;return function(_0x2b483f){logger[_0x7b91('0x34')](_0x2b483f['stack']);if(_0x2b483f[_0x7b91('0x35')]){delete _0x2b483f[_0x7b91('0x35')];}_0x5c3e96['status'](_0x357276)[_0x7b91('0x36')](_0x2b483f);};}exports[_0x7b91('0x37')]=function(_0x552e43,_0x17e081){var _0x10cc4a={},_0x170210={},_0x216629={'count':0x0,'rows':[]};var _0x54aaab=_['map'](db[_0x7b91('0x38')][_0x7b91('0x39')],function(_0xa29766){return{'name':_0xa29766[_0x7b91('0x3a')],'type':_0xa29766[_0x7b91('0x3b')][_0x7b91('0x3c')]};});_0x170210[_0x7b91('0x3d')]=_[_0x7b91('0x3e')](_0x54aaab,_0x7b91('0x35'));_0x170210['query']=_[_0x7b91('0x3f')](_0x552e43[_0x7b91('0x40')]);_0x170210[_0x7b91('0x41')]=_[_0x7b91('0x42')](_0x170210[_0x7b91('0x3d')],_0x170210['query']);_0x10cc4a[_0x7b91('0x43')]=_[_0x7b91('0x42')](_0x170210[_0x7b91('0x3d')],qs['fields'](_0x552e43['query']['fields']));_0x10cc4a[_0x7b91('0x43')]=_0x10cc4a['attributes'][_0x7b91('0x44')]?_0x10cc4a[_0x7b91('0x43')]:_0x170210['model'];if(!_0x552e43[_0x7b91('0x40')][_0x7b91('0x45')](_0x7b91('0x46'))){_0x10cc4a['limit']=qs[_0x7b91('0x28')](_0x552e43[_0x7b91('0x40')][_0x7b91('0x28')]);_0x10cc4a[_0x7b91('0x27')]=qs[_0x7b91('0x27')](_0x552e43['query'][_0x7b91('0x27')]);}_0x10cc4a[_0x7b91('0x47')]=qs[_0x7b91('0x48')](_0x552e43['query'][_0x7b91('0x48')]);_0x10cc4a[_0x7b91('0x49')]=qs[_0x7b91('0x41')](_['pick'](_0x552e43[_0x7b91('0x40')],_0x170210[_0x7b91('0x41')]),_0x54aaab);if(_0x552e43[_0x7b91('0x40')][_0x7b91('0x4a')]){_0x10cc4a[_0x7b91('0x49')]=_['merge'](_0x10cc4a[_0x7b91('0x49')],{'$or':_[_0x7b91('0x3e')](_0x54aaab,function(_0x22cf31){if(_0x22cf31[_0x7b91('0x3b')]!=='VIRTUAL'){var _0x281b58={};_0x281b58[_0x22cf31['name']]={'$like':'%'+_0x552e43['query'][_0x7b91('0x4a')]+'%'};return _0x281b58;}})});}_0x10cc4a=_[_0x7b91('0x4b')]({},_0x10cc4a,_0x552e43[_0x7b91('0x4c')]);var _0x3b39a7={'where':_0x10cc4a[_0x7b91('0x49')]};return db[_0x7b91('0x38')]['count'](_0x3b39a7)[_0x7b91('0x30')](function(_0x4f69c7){_0x216629['count']=_0x4f69c7;if(_0x552e43[_0x7b91('0x40')][_0x7b91('0x4d')]){_0x10cc4a[_0x7b91('0x4e')]=[{'all':!![]}];}return db[_0x7b91('0x38')]['findAll'](_0x10cc4a);})[_0x7b91('0x30')](function(_0x3c057f){_0x216629[_0x7b91('0x4f')]=_0x3c057f;return _0x216629;})[_0x7b91('0x30')](respondWithFilteredResult(_0x17e081,_0x10cc4a))['catch'](handleError(_0x17e081,null));};exports[_0x7b91('0x50')]=function(_0x337ea2,_0x481989){var _0x3931d6={'raw':!![],'where':{'id':_0x337ea2[_0x7b91('0x51')]['id']}},_0x458f95={};_0x458f95['model']=_[_0x7b91('0x3f')](db['Plugin']['rawAttributes']);_0x458f95[_0x7b91('0x40')]=_['keys'](_0x337ea2['query']);_0x458f95[_0x7b91('0x41')]=_[_0x7b91('0x42')](_0x458f95[_0x7b91('0x3d')],_0x458f95[_0x7b91('0x40')]);_0x3931d6[_0x7b91('0x43')]=_[_0x7b91('0x42')](_0x458f95[_0x7b91('0x3d')],qs[_0x7b91('0x52')](_0x337ea2[_0x7b91('0x40')]['fields']));_0x3931d6[_0x7b91('0x43')]=_0x3931d6['attributes'][_0x7b91('0x44')]?_0x3931d6[_0x7b91('0x43')]:_0x458f95[_0x7b91('0x3d')];if(_0x337ea2[_0x7b91('0x40')]['includeAll']){_0x3931d6['include']=[{'all':!![]}];}_0x3931d6=_[_0x7b91('0x4b')]({},_0x3931d6,_0x337ea2['options']);return db[_0x7b91('0x38')][_0x7b91('0x53')](_0x3931d6)[_0x7b91('0x30')](handleEntityNotFound(_0x481989,null))['then'](respondWithResult(_0x481989,null))[_0x7b91('0x54')](handleError(_0x481989,null));};exports[_0x7b91('0x55')]=function(_0x5b4d3c,_0x4b97c0,_0x14e133){return db[_0x7b91('0x38')][_0x7b91('0x53')]({'where':{'id':_0x5b4d3c[_0x7b91('0x51')]['id']},'attributes':[_0x7b91('0x35'),_0x7b91('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x4b97c0,null))['then'](function(_0x313904){if(_0x313904){var _0x2db8f3=path[_0x7b91('0x57')](config[_0x7b91('0x58')],_0x7b91('0x59'),util[_0x7b91('0x5a')](_0x7b91('0x5b'),path[_0x7b91('0x5c')](_0x313904[_0x7b91('0x56')])));var _0x2bb95=fs[_0x7b91('0x5d')](_0x2db8f3);var _0x3409de=archiver(_0x7b91('0x5e'),{'zlib':{'level':0x9}});_0x3409de['on']('warning',function(_0x2ccc00){if(_0x2ccc00[_0x7b91('0x5f')]===_0x7b91('0x60')){logger['error'](_0x2ccc00);}else{throw new db['Sequelize'][(_0x7b91('0x61'))](_0x7b91('0x62'));}});_0x3409de['on'](_0x7b91('0x34'),function(_0xe9dcf2){throw new db[(_0x7b91('0x63'))][(_0x7b91('0x61'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3409de['pipe'](_0x2bb95);_0x3409de[_0x7b91('0x64')]('**/*',{'cwd':path[_0x7b91('0x57')](config[_0x7b91('0x58')],'server/files/plugins',path[_0x7b91('0x65')](_0x313904[_0x7b91('0x56')])),'ignore':[path[_0x7b91('0x57')](path[_0x7b91('0x5c')](_0x313904[_0x7b91('0x56')]),'node_modules/**/*'),path[_0x7b91('0x57')](path['basename'](_0x313904[_0x7b91('0x56')]),_0x7b91('0x66'))],'nodir':!![]})[_0x7b91('0x67')]();_0x2bb95['on'](_0x7b91('0x68'),function(){if(!fs[_0x7b91('0x69')](_0x2db8f3)){throw new db[(_0x7b91('0x63'))][(_0x7b91('0x61'))](_0x7b91('0x6a'));}return _0x4b97c0[_0x7b91('0x55')](_0x2db8f3,util[_0x7b91('0x5a')](_0x7b91('0x5b'),path[_0x7b91('0x5c')](_0x313904[_0x7b91('0x56')])),function(_0x3e58d9){if(_0x3e58d9){throw new db[(_0x7b91('0x63'))][(_0x7b91('0x61'))](_0x7b91('0x6b'));}fs[_0x7b91('0x6c')](_0x2db8f3);logger['info'](_0x7b91('0x6d'));logger[_0x7b91('0x6e')](_0x7b91('0x6f'));});});}return null;})[_0x7b91('0x54')](handleError(_0x4b97c0,null));};exports['upload']=function(_0x2c5e6e,_0x1186fe,_0x3f924a){var _0xc8e0a3=path[_0x7b91('0x5c')](_0x2c5e6e[_0x7b91('0x70')][_0x7b91('0x71')],path[_0x7b91('0x72')](_0x2c5e6e[_0x7b91('0x70')]['filename']));var _0x429696=path[_0x7b91('0x57')](config[_0x7b91('0x58')],_0x7b91('0x59'),_0x2c5e6e[_0x7b91('0x70')][_0x7b91('0x71')]);var _0xb7970b=path[_0x7b91('0x57')](config[_0x7b91('0x58')],_0x7b91('0x59'),_0xc8e0a3);logger[_0x7b91('0x6e')](_0x7b91('0x73'),_0x429696);logger[_0x7b91('0x6e')]('Plugin\x20upload\x20destination:\x20%s',_0xb7970b);try{fs[_0x7b91('0x74')](_0x429696,parseInt(_0x7b91('0x75'),0x8));extract(_0x429696,{'dir':_0xb7970b},function(_0x44c4bf){if(_0x44c4bf){logger['error'](_0x44c4bf);handleError(_0x44c4bf,!![]);};var _0x170774=fs[_0x7b91('0x76')](_0xb7970b);if(_0x170774['length']>0x1){removeReferences(_0x429696,_0xb7970b);logger['error']('Invalid\x20plugin\x20structure');return _0x3f924a(new Error(_0x7b91('0x77')));}var _0x2d7ea2=fs[_0x7b91('0x78')](path['join'](_0xb7970b,_0x170774[0x0]));if(_0x2d7ea2[_0x7b91('0x79')]()){removeReferences(_0x429696,_0xb7970b);logger[_0x7b91('0x34')](_0x7b91('0x77'));return _0x3f924a(new Error(_0x7b91('0x77')));}if(_0x2d7ea2[_0x7b91('0x7a')]()){var _0x2dcfe8=fs[_0x7b91('0x76')](path[_0x7b91('0x57')](_0xb7970b,_0x170774[0x0]));if(_0x2dcfe8[_0x7b91('0x44')]===0x0){removeReferences(_0x429696,_0xb7970b);logger['error'](_0x7b91('0x77'));return _0x3f924a(new Error(_0x7b91('0x77')));}var _0x1d4ad9=_0x2dcfe8[_0x7b91('0x7b')](function(_0x27b86f){return _0x27b86f===_0x7b91('0x7c');});if(!_0x1d4ad9){return _0x3f924a(new Error(_0x7b91('0x7d')));}var _0x3cb70f=fs['readFileSync'](path[_0x7b91('0x57')](_0xb7970b,_0x170774[0x0],_0x7b91('0x7c')));var _0x1d5bf5=JSON[_0x7b91('0x7e')](_0x3cb70f);if(_0x7b91('0x7f')==typeof _0x1d5bf5['name']){return _0x3f924a(new Error(_0x7b91('0x80')));}if('undefined'==typeof _0x1d5bf5[_0x7b91('0x3b')]){return _0x3f924a(new Error(_0x7b91('0x81')));}if(_0x7b91('0x7f')==typeof _0x1d5bf5[_0x7b91('0x82')]){return _0x3f924a(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x7b91('0x7f')==typeof _0x1d5bf5['parameters']){return _0x3f924a(new Error(_0x7b91('0x83')));}if(_0x1d5bf5[_0x7b91('0x3b')]===_0x7b91('0x84')){if('undefined'==typeof _0x1d5bf5['parameters'][_0x7b91('0x85')]){return _0x3f924a(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x85')][_0x7b91('0x87')]&&'undefined'==typeof _0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x85')]['agent']){return _0x3f924a(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1d5bf5['type']==='script'){if(_0x7b91('0x7f')==typeof _0x1d5bf5['parameters'][_0x7b91('0x88')]){return _0x3f924a(new Error(_0x7b91('0x89')));}if(_0x7b91('0x7f')==typeof _0x1d5bf5['parameters'][_0x7b91('0x8a')]){return _0x3f924a(new Error(_0x7b91('0x8b')));}}else{return _0x3f924a(new Error(_0x7b91('0x8c')));}var _0x1ad6d7=_0x1d5bf5['name'];var _0x46df13=_0x1d5bf5['description'];var _0x5350ec=_0x1d5bf5[_0x7b91('0x3b')];var _0x23e4cf=_0x1d5bf5[_0x7b91('0x8d')]?_0x1d5bf5[_0x7b91('0x8d')]:_0x7b91('0x8e');var _0x39a8e5=_0x1d5bf5['icon']?_0x1d5bf5['icon']:_0x7b91('0x8f');var _0x21025d='';var _0x4139f9='';var _0x503124='';var _0x324759='';var _0x523cd2=_0x1d5bf5['version'];if(_0x5350ec===_0x7b91('0x84')){if(_0x7b91('0x7f')!=typeof _0x1d5bf5['parameters'][_0x7b91('0x85')][_0x7b91('0x87')]){var _0x5e9b0c=_0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x85')][_0x7b91('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x7b91('0x90')](_0x5e9b0c)){_0x21025d=path[_0x7b91('0x57')](_0x7b91('0x91'),_0xc8e0a3,_0x170774[0x0],_0x5e9b0c);}else{_0x21025d=_0x5e9b0c;}}else{logger['info'](_0x7b91('0x92'));}if(_0x7b91('0x7f')!=typeof _0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x85')][_0x7b91('0x93')]){var _0x532f21=_0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x85')][_0x7b91('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x7b91('0x90')](_0x532f21)){_0x4139f9=path[_0x7b91('0x57')](_0x7b91('0x91'),_0xc8e0a3,_0x170774[0x0],_0x532f21);}else{_0x4139f9=_0x532f21;}}else{logger['info'](_0x7b91('0x94'));}}else if(_0x5350ec===_0x7b91('0x95')){_0x503124=_0x1d5bf5['parameters']['scriptName'];_0x324759=_0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x8a')];if(_0x7b91('0x7f')!=typeof _0x1d5bf5[_0x7b91('0x86')]['views']){if(_0x7b91('0x7f')!=typeof _0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x85')][_0x7b91('0x87')]){var _0x5e9b0c=_0x1d5bf5[_0x7b91('0x86')]['views'][_0x7b91('0x87')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e9b0c)){_0x21025d=path[_0x7b91('0x57')](_0x7b91('0x91'),_0xc8e0a3,_0x170774[0x0],_0x5e9b0c);}else{_0x21025d=_0x5e9b0c;}}if(_0x7b91('0x7f')!=typeof _0x1d5bf5['parameters'][_0x7b91('0x85')]['agent']){var _0x532f21=_0x1d5bf5[_0x7b91('0x86')][_0x7b91('0x85')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x532f21)){_0x4139f9=path[_0x7b91('0x57')]('plugins',_0xc8e0a3,_0x170774[0x0],_0x532f21);}else{_0x4139f9=_0x532f21;}}}}var _0x4ec12d={'name':_0x1ad6d7,'description':_0x46df13,'path':path[_0x7b91('0x57')](_0xc8e0a3,_0x170774[0x0]),'type':_0x5350ec,'sidebar':_0x23e4cf,'icon':_0x39a8e5,'adminUrl':_0x21025d,'agentUrl':_0x4139f9,'scriptName':_0x503124,'scriptPath':_0x324759,'version':_0x523cd2};removeReferences(_0x429696,null);return db[_0x7b91('0x38')][_0x7b91('0x96')](_0x4ec12d)[_0x7b91('0x30')](function(_0x2e53f3){var _0x554524={'role':_0x2c5e6e[_0x7b91('0x97')][_0x7b91('0x98')],'userProfileId':_0x2c5e6e[_0x7b91('0x97')][_0x7b91('0x99')]};if(!_0x554524)throw new Error(_0x7b91('0x9a'));if(_0x554524['role']===_0x7b91('0x9b')){var _0x507d4d=_0x2e53f3['get']({'plain':!![]});return db['UserProfileSection'][_0x7b91('0x53')]({'where':{'name':_0x7b91('0x31'),'userProfileId':_0x554524[_0x7b91('0x99')]},'raw':!![]})[_0x7b91('0x30')](function(_0x288927){if(_0x288927&&_0x288927[_0x7b91('0x9c')]===0x0){return db[_0x7b91('0x32')]['create']({'name':_0x507d4d[_0x7b91('0x35')],'resourceId':_0x507d4d['id'],'type':_0x288927[_0x7b91('0x35')],'sectionId':_0x288927['id']},{})[_0x7b91('0x30')](function(){return _0x2e53f3;});}else{return _0x2e53f3;}})[_0x7b91('0x54')](function(_0x5b8eda){logger['error'](_0x7b91('0x9d'),_0x5b8eda);throw _0x5b8eda;});}return _0x2e53f3;})[_0x7b91('0x30')](respondWithResult(_0x1186fe,null))['catch'](handleError(_0x1186fe,null));}});}catch(_0x3c2e77){_0x1186fe[_0x7b91('0x24')](0x1f4)[_0x7b91('0x36')](_0x3c2e77);}};function removeReferences(_0x23512a,_0xb1a402){try{if(_0x23512a){fs[_0x7b91('0x6c')](_0x23512a);logger[_0x7b91('0x6e')](_0x7b91('0x9e'));}if(_0xb1a402){rimraf(_0xb1a402,function(){});logger[_0x7b91('0x6e')](_0x7b91('0x9f'));}}catch(_0x529c55){logger[_0x7b91('0x34')](_0x529c55);}}exports['update']=function(_0xb7fdba,_0x3ed6ee,_0x414161){return db[_0x7b91('0x38')][_0x7b91('0x53')]({'where':{'id':_0xb7fdba[_0x7b91('0x51')]['id']}})[_0x7b91('0x30')](handleEntityNotFound(_0x3ed6ee,null))['then'](saveUpdates(_0xb7fdba[_0x7b91('0x97')],null))[_0x7b91('0x30')](respondWithResult(_0x3ed6ee,null))['catch'](handleError(_0x3ed6ee,null));};exports[_0x7b91('0xa0')]=function(_0x13baa0,_0x2d8e95,_0x1b1dee){return db[_0x7b91('0x38')]['find']({'where':{'id':_0x13baa0['params']['id']}})[_0x7b91('0x30')](function(_0x35b48e){if(_0x35b48e){return _0x35b48e['destroy']();}})[_0x7b91('0x30')](function(_0x40758d){rimraf(path[_0x7b91('0x57')](config[_0x7b91('0x58')],_0x7b91('0x59'),path[_0x7b91('0x65')](_0x40758d['path'])),function(){});return _0x40758d;})[_0x7b91('0x30')](handleEntityNotFound(_0x2d8e95,null))[_0x7b91('0x30')](respondWithStatusCode(_0x2d8e95,null))[_0x7b91('0x54')](handleError(_0x2d8e95,null));};exports['webhookGet']=function(_0x4f0287,_0x2f8bc1,_0x26be3a){return BPromise[_0x7b91('0xa1')]()['then'](function(){if(!_0x4f0287['query'][_0x7b91('0x56')]){throw new Error(_0x7b91('0xa2'));}if(!_0x4f0287['query'][_0x7b91('0xa3')]){throw new Error(_0x7b91('0xa4'));}var _0x3342fe=_0x4f0287[_0x7b91('0x40')][_0x7b91('0xa5')]?_0x4f0287['query'][_0x7b91('0xa5')]+':'+_0x4f0287[_0x7b91('0x40')][_0x7b91('0xa3')]:'http://localhost:'+_0x4f0287[_0x7b91('0x40')][_0x7b91('0xa3')];var _0x5a1d90=_0x4f0287[_0x7b91('0x40')][_0x7b91('0x26')]?_0x4f0287[_0x7b91('0x40')][_0x7b91('0x26')]:!![];var _0x43df00=_0x4f0287[_0x7b91('0x40')][_0x7b91('0xa6')]?_0x4f0287[_0x7b91('0x40')][_0x7b91('0xa6')]:null;var _0x2e3aaa={'method':_0x4f0287[_0x7b91('0xa7')],'uri':util['format'](_0x7b91('0xa8'),_0x3342fe,_0x4f0287[_0x7b91('0x40')]['path']),'json':_0x5a1d90,'resolveWithFullResponse':!![],'encoding':_0x43df00,'qs':_0x4f0287['query']};if(_0x4f0287[_0x7b91('0xa9')]){_0x2e3aaa[_0x7b91('0xa9')]=_0x4f0287[_0x7b91('0xa9')];if(_0x2e3aaa[_0x7b91('0xa9')][_0x7b91('0xaa')]){delete _0x2e3aaa[_0x7b91('0xa9')][_0x7b91('0xaa')];}}if(_0x2e3aaa[_0x7b91('0xa9')]['content-type']){delete _0x2e3aaa[_0x7b91('0xa9')]['content-type'];}return rp(_0x2e3aaa);})[_0x7b91('0x30')](function(_0x298a16){if(_0x298a16){_0x2f8bc1['set'](_0x298a16['headers']);logger['info'](_0x298a16[_0x7b91('0x97')]);if(_[_0x7b91('0xab')](_0x4f0287[_0x7b91('0x40')][_0x7b91('0x56')],_0x7b91('0x55'))&&_0x298a16[_0x7b91('0xac')]==0x1f4){return _0x2f8bc1[_0x7b91('0x23')](_0x298a16[_0x7b91('0xac')]);}else{return _0x2f8bc1[_0x7b91('0x24')](_0x298a16[_0x7b91('0xac')])[_0x7b91('0x36')](_0x298a16[_0x7b91('0x97')]);}}else{return _0x2f8bc1[_0x7b91('0x23')](0xc8);}})[_0x7b91('0x54')](handleError(_0x2f8bc1,null));};exports[_0x7b91('0xad')]=function(_0x554e3b,_0x1ffda0,_0x3ebf5d){return BPromise[_0x7b91('0xa1')]()[_0x7b91('0x30')](function(){if(!_0x554e3b[_0x7b91('0x40')][_0x7b91('0x56')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x554e3b[_0x7b91('0x40')][_0x7b91('0xa3')]){throw new Error(_0x7b91('0xa4'));}var _0x30032e=_0x554e3b['query'][_0x7b91('0xa5')]?_0x554e3b[_0x7b91('0x40')][_0x7b91('0xa5')]+':'+_0x554e3b[_0x7b91('0x40')][_0x7b91('0xa3')]:_0x7b91('0xae')+_0x554e3b['query']['port'];var _0x5d67c8=_0x554e3b[_0x7b91('0x40')][_0x7b91('0x26')]?_0x554e3b[_0x7b91('0x40')][_0x7b91('0x26')]:!![];var _0x3c8d73=_0x554e3b[_0x7b91('0x40')][_0x7b91('0xa6')]?_0x554e3b['query'][_0x7b91('0xa6')]:null;var _0x41e569={'method':_0x554e3b['method'],'uri':util[_0x7b91('0x5a')]('%s%s',_0x30032e,_0x554e3b[_0x7b91('0x40')][_0x7b91('0x56')]),'json':_0x5d67c8,'resolveWithFullResponse':!![],'encoding':_0x3c8d73,'body':_0x554e3b[_0x7b91('0x97')]};if(_0x554e3b[_0x7b91('0xa9')]){_0x41e569[_0x7b91('0xa9')]=_0x554e3b[_0x7b91('0xa9')];if(_0x41e569[_0x7b91('0xa9')]['content-length']){delete _0x41e569[_0x7b91('0xa9')][_0x7b91('0xaa')];}}if(_0x41e569[_0x7b91('0xa9')]['content-type']){delete _0x41e569['headers'][_0x7b91('0xaf')];}return rp(_0x41e569);})[_0x7b91('0x30')](function(_0x43bb90){if(_0x43bb90){_0x1ffda0[_0x7b91('0x2a')](_0x43bb90[_0x7b91('0xa9')]);logger[_0x7b91('0x6e')](_0x43bb90[_0x7b91('0x97')]);return _0x1ffda0['status'](_0x43bb90[_0x7b91('0xac')])[_0x7b91('0x36')](_0x43bb90[_0x7b91('0x97')]);}else{return _0x1ffda0[_0x7b91('0x23')](0xc8);}})[_0x7b91('0x54')](handleError(_0x1ffda0,null));}; \ No newline at end of file +var _0xcdd2=['squel','jsforce','desk.js','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./plugin.socket','register','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','get','Plugins','UserProfileResource','end','error','name','index','map','Plugin','rawAttributes','key','keys','query','filters','model','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','includeAll','catch','download','find','params','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','manifest.json','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv'];(function(_0x1cff42,_0x2d0ba0){var _0x5ee0a8=function(_0x1d35db){while(--_0x1d35db){_0x1cff42['push'](_0x1cff42['shift']());}};_0x5ee0a8(++_0x2d0ba0);}(_0xcdd2,0x98));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2cdd('0x0'));var rimraf=require(_0x2cdd('0x1'));var zipdir=require(_0x2cdd('0x2'));var jsonpatch=require(_0x2cdd('0x3'));var rp=require(_0x2cdd('0x4'));var moment=require(_0x2cdd('0x5'));var BPromise=require(_0x2cdd('0x6'));var Mustache=require(_0x2cdd('0x7'));var util=require(_0x2cdd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x2cdd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2cdd('0xa'));var crypto=require('crypto');var jsforce=require(_0x2cdd('0xb'));var deskjs=require(_0x2cdd('0xc'));var toCsv=require(_0x2cdd('0x9'));var querystring=require('querystring');var Papa=require(_0x2cdd('0xd'));var extract=require(_0x2cdd('0xe'));var rimraf=require(_0x2cdd('0x1'));var archiver=require(_0x2cdd('0xf'));var Redis=require('ioredis');var authService=require(_0x2cdd('0x10'));var qs=require(_0x2cdd('0x11'));var as=require(_0x2cdd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2cdd('0x13'));var utils=require(_0x2cdd('0x14'));var config=require(_0x2cdd('0x15'));var licenseUtil=require(_0x2cdd('0x16'));var db=require(_0x2cdd('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x2cdd('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cdd('0x19')]));require(_0x2cdd('0x1a'))[_0x2cdd('0x1b')](socket);function respondWithStatusCode(_0x5bf1a2,_0x41041d){_0x41041d=_0x41041d||0xcc;return function(_0x176e46){if(_0x176e46){return _0x5bf1a2[_0x2cdd('0x1c')](_0x41041d);}return _0x5bf1a2[_0x2cdd('0x1d')](_0x41041d)['end']();};}function respondWithResult(_0xfb0f13,_0x16c982){_0x16c982=_0x16c982||0xc8;return function(_0x42c5c8){if(_0x42c5c8){return _0xfb0f13[_0x2cdd('0x1d')](_0x16c982)['json'](_0x42c5c8);}};}function respondWithFilteredResult(_0x264af9,_0x130c6f){return function(_0x2f6041){if(_0x2f6041){var _0x7e1960=typeof _0x130c6f['offset']==='undefined'&&typeof _0x130c6f[_0x2cdd('0x1e')]===_0x2cdd('0x1f');var _0x37b2e8=_0x2f6041[_0x2cdd('0x20')];var _0x4f5a93=_0x7e1960?0x0:_0x130c6f[_0x2cdd('0x21')];var _0x2fc5d9=_0x7e1960?_0x2f6041[_0x2cdd('0x20')]:_0x130c6f[_0x2cdd('0x21')]+_0x130c6f['limit'];var _0x26e1c9;if(_0x2fc5d9>=_0x37b2e8){_0x2fc5d9=_0x37b2e8;_0x26e1c9=0xc8;}else{_0x26e1c9=0xce;}_0x264af9[_0x2cdd('0x1d')](_0x26e1c9);return _0x264af9[_0x2cdd('0x22')](_0x2cdd('0x23'),_0x4f5a93+'-'+_0x2fc5d9+'/'+_0x37b2e8)[_0x2cdd('0x24')](_0x2f6041);}return null;};}function patchUpdates(_0x44858a){return function(_0x43adbd){try{jsonpatch[_0x2cdd('0x25')](_0x43adbd,_0x44858a,!![]);}catch(_0x251ce5){return BPromise[_0x2cdd('0x26')](_0x251ce5);}return _0x43adbd[_0x2cdd('0x27')]();};}function saveUpdates(_0x330785,_0x7e4c89){return function(_0x46600b){if(_0x46600b){return _0x46600b['update'](_0x330785)['then'](function(_0x1dab0b){return _0x1dab0b;});}return null;};}function removeEntity(_0x1ef7e5,_0x292386){return function(_0x20de90){if(_0x20de90){return _0x20de90[_0x2cdd('0x28')]()[_0x2cdd('0x29')](function(){var _0x90a1d3=_0x20de90[_0x2cdd('0x2a')]({'plain':!![]});var _0x3828c1=_0x2cdd('0x2b');return db[_0x2cdd('0x2c')][_0x2cdd('0x28')]({'where':{'type':_0x3828c1,'resourceId':_0x90a1d3['id']}})[_0x2cdd('0x29')](function(){return _0x20de90;});})[_0x2cdd('0x29')](function(){_0x1ef7e5[_0x2cdd('0x1d')](0xcc)[_0x2cdd('0x2d')]();});}};}function handleEntityNotFound(_0x5b9efe,_0x5df35f){return function(_0x1f5ccf){if(!_0x1f5ccf){_0x5b9efe[_0x2cdd('0x1c')](0x194);}return _0x1f5ccf;};}function handleError(_0x451cb2,_0x996b67){_0x996b67=_0x996b67||0x1f4;return function(_0x552682){logger[_0x2cdd('0x2e')](_0x552682['stack']);if(_0x552682[_0x2cdd('0x2f')]){delete _0x552682[_0x2cdd('0x2f')];}_0x451cb2[_0x2cdd('0x1d')](_0x996b67)['send'](_0x552682);};}exports[_0x2cdd('0x30')]=function(_0x4362ee,_0x3df8e6){var _0x96992c={},_0x110cd8={},_0x141018={'count':0x0,'rows':[]};var _0x28e3c9=_[_0x2cdd('0x31')](db[_0x2cdd('0x32')][_0x2cdd('0x33')],function(_0x2ea0c0){return{'name':_0x2ea0c0['fieldName'],'type':_0x2ea0c0['type'][_0x2cdd('0x34')]};});_0x110cd8['model']=_[_0x2cdd('0x31')](_0x28e3c9,_0x2cdd('0x2f'));_0x110cd8['query']=_[_0x2cdd('0x35')](_0x4362ee[_0x2cdd('0x36')]);_0x110cd8[_0x2cdd('0x37')]=_['intersection'](_0x110cd8[_0x2cdd('0x38')],_0x110cd8[_0x2cdd('0x36')]);_0x96992c[_0x2cdd('0x39')]=_[_0x2cdd('0x3a')](_0x110cd8[_0x2cdd('0x38')],qs[_0x2cdd('0x3b')](_0x4362ee[_0x2cdd('0x36')][_0x2cdd('0x3b')]));_0x96992c[_0x2cdd('0x39')]=_0x96992c['attributes'][_0x2cdd('0x3c')]?_0x96992c[_0x2cdd('0x39')]:_0x110cd8[_0x2cdd('0x38')];if(!_0x4362ee['query']['hasOwnProperty'](_0x2cdd('0x3d'))){_0x96992c['limit']=qs[_0x2cdd('0x1e')](_0x4362ee[_0x2cdd('0x36')][_0x2cdd('0x1e')]);_0x96992c[_0x2cdd('0x21')]=qs[_0x2cdd('0x21')](_0x4362ee[_0x2cdd('0x36')][_0x2cdd('0x21')]);}_0x96992c['order']=qs[_0x2cdd('0x3e')](_0x4362ee[_0x2cdd('0x36')][_0x2cdd('0x3e')]);_0x96992c[_0x2cdd('0x3f')]=qs[_0x2cdd('0x37')](_['pick'](_0x4362ee[_0x2cdd('0x36')],_0x110cd8[_0x2cdd('0x37')]),_0x28e3c9);if(_0x4362ee['query'][_0x2cdd('0x40')]){_0x96992c['where']=_[_0x2cdd('0x41')](_0x96992c[_0x2cdd('0x3f')],{'$or':_[_0x2cdd('0x31')](_0x28e3c9,function(_0x158cf6){if(_0x158cf6[_0x2cdd('0x42')]!==_0x2cdd('0x43')){var _0x488c0b={};_0x488c0b[_0x158cf6[_0x2cdd('0x2f')]]={'$like':'%'+_0x4362ee[_0x2cdd('0x36')][_0x2cdd('0x40')]+'%'};return _0x488c0b;}})});}_0x96992c=_[_0x2cdd('0x41')]({},_0x96992c,_0x4362ee[_0x2cdd('0x44')]);var _0x3c9571={'where':_0x96992c['where']};return db[_0x2cdd('0x32')]['count'](_0x3c9571)[_0x2cdd('0x29')](function(_0x3db700){_0x141018[_0x2cdd('0x20')]=_0x3db700;if(_0x4362ee['query']['includeAll']){_0x96992c[_0x2cdd('0x45')]=[{'all':!![]}];}return db[_0x2cdd('0x32')][_0x2cdd('0x46')](_0x96992c);})[_0x2cdd('0x29')](function(_0xbb8137){_0x141018[_0x2cdd('0x47')]=_0xbb8137;return _0x141018;})['then'](respondWithFilteredResult(_0x3df8e6,_0x96992c))['catch'](handleError(_0x3df8e6,null));};exports['show']=function(_0x17897b,_0x434b02){var _0x51c21c={'raw':!![],'where':{'id':_0x17897b['params']['id']}},_0x3ace47={};_0x3ace47[_0x2cdd('0x38')]=_[_0x2cdd('0x35')](db[_0x2cdd('0x32')][_0x2cdd('0x33')]);_0x3ace47[_0x2cdd('0x36')]=_['keys'](_0x17897b['query']);_0x3ace47[_0x2cdd('0x37')]=_[_0x2cdd('0x3a')](_0x3ace47[_0x2cdd('0x38')],_0x3ace47['query']);_0x51c21c['attributes']=_[_0x2cdd('0x3a')](_0x3ace47[_0x2cdd('0x38')],qs['fields'](_0x17897b[_0x2cdd('0x36')][_0x2cdd('0x3b')]));_0x51c21c[_0x2cdd('0x39')]=_0x51c21c[_0x2cdd('0x39')][_0x2cdd('0x3c')]?_0x51c21c[_0x2cdd('0x39')]:_0x3ace47[_0x2cdd('0x38')];if(_0x17897b[_0x2cdd('0x36')][_0x2cdd('0x48')]){_0x51c21c[_0x2cdd('0x45')]=[{'all':!![]}];}_0x51c21c=_['merge']({},_0x51c21c,_0x17897b[_0x2cdd('0x44')]);return db[_0x2cdd('0x32')]['find'](_0x51c21c)[_0x2cdd('0x29')](handleEntityNotFound(_0x434b02,null))['then'](respondWithResult(_0x434b02,null))[_0x2cdd('0x49')](handleError(_0x434b02,null));};exports[_0x2cdd('0x4a')]=function(_0x1104e3,_0x394583,_0x3179b4){return db[_0x2cdd('0x32')][_0x2cdd('0x4b')]({'where':{'id':_0x1104e3[_0x2cdd('0x4c')]['id']},'attributes':[_0x2cdd('0x2f'),_0x2cdd('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x394583,null))[_0x2cdd('0x29')](function(_0x1717d2){if(_0x1717d2){var _0x2b71f9=path[_0x2cdd('0x4e')](config[_0x2cdd('0x4f')],_0x2cdd('0x50'),util[_0x2cdd('0x51')](_0x2cdd('0x52'),path[_0x2cdd('0x53')](_0x1717d2[_0x2cdd('0x4d')])));var _0x51b6e1=fs[_0x2cdd('0x54')](_0x2b71f9);var _0x2d5423=archiver(_0x2cdd('0x55'),{'zlib':{'level':0x9}});_0x2d5423['on'](_0x2cdd('0x56'),function(_0x56a599){if(_0x56a599['code']==='ENOENT'){logger[_0x2cdd('0x2e')](_0x56a599);}else{throw new db[(_0x2cdd('0x57'))][(_0x2cdd('0x58'))](_0x2cdd('0x59'));}});_0x2d5423['on'](_0x2cdd('0x2e'),function(_0xd6e27f){throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2d5423['pipe'](_0x51b6e1);_0x2d5423['glob']('**/*',{'cwd':path[_0x2cdd('0x4e')](config[_0x2cdd('0x4f')],_0x2cdd('0x50'),path['dirname'](_0x1717d2[_0x2cdd('0x4d')])),'ignore':[path[_0x2cdd('0x4e')](path['basename'](_0x1717d2[_0x2cdd('0x4d')]),_0x2cdd('0x5a')),path[_0x2cdd('0x4e')](path['basename'](_0x1717d2[_0x2cdd('0x4d')]),'attachments/**/*')],'nodir':!![]})[_0x2cdd('0x5b')]();_0x51b6e1['on']('close',function(){if(!fs[_0x2cdd('0x5c')](_0x2b71f9)){throw new db[(_0x2cdd('0x57'))][(_0x2cdd('0x58'))](_0x2cdd('0x5d'));}return _0x394583[_0x2cdd('0x4a')](_0x2b71f9,util[_0x2cdd('0x51')](_0x2cdd('0x52'),path[_0x2cdd('0x53')](_0x1717d2[_0x2cdd('0x4d')])),function(_0x3a741c){if(_0x3a741c){throw new db[(_0x2cdd('0x57'))][(_0x2cdd('0x58'))](_0x2cdd('0x5e'));}fs['unlinkSync'](_0x2b71f9);logger[_0x2cdd('0x5f')](_0x2cdd('0x60'));logger['info'](_0x2cdd('0x61'));});});}return null;})[_0x2cdd('0x49')](handleError(_0x394583,null));};exports[_0x2cdd('0x62')]=function(_0x47d7db,_0x4f05fc,_0x4f1e10){var _0x5d58b9=path[_0x2cdd('0x53')](_0x47d7db[_0x2cdd('0x63')]['filename'],path['extname'](_0x47d7db[_0x2cdd('0x63')][_0x2cdd('0x64')]));var _0x45099e=path[_0x2cdd('0x4e')](config['root'],_0x2cdd('0x50'),_0x47d7db[_0x2cdd('0x63')][_0x2cdd('0x64')]);var _0x25c773=path[_0x2cdd('0x4e')](config['root'],_0x2cdd('0x50'),_0x5d58b9);logger[_0x2cdd('0x5f')]('Plugin\x20upload\x20filepath:\x20%s',_0x45099e);logger[_0x2cdd('0x5f')](_0x2cdd('0x65'),_0x25c773);try{fs['chmodSync'](_0x45099e,parseInt('0777',0x8));extract(_0x45099e,{'dir':_0x25c773},function(_0x3666c8){if(_0x3666c8){logger['error'](_0x3666c8);handleError(_0x3666c8,!![]);};var _0x5e78a1=fs['readdirSync'](_0x25c773);if(_0x5e78a1[_0x2cdd('0x3c')]>0x1){removeReferences(_0x45099e,_0x25c773);logger[_0x2cdd('0x2e')](_0x2cdd('0x66'));return _0x4f1e10(new Error('Invalid\x20plugin\x20structure'));}var _0x2dfa03=fs['lstatSync'](path[_0x2cdd('0x4e')](_0x25c773,_0x5e78a1[0x0]));if(_0x2dfa03[_0x2cdd('0x67')]()){removeReferences(_0x45099e,_0x25c773);logger[_0x2cdd('0x2e')](_0x2cdd('0x66'));return _0x4f1e10(new Error(_0x2cdd('0x66')));}if(_0x2dfa03[_0x2cdd('0x68')]()){var _0x40cf41=fs[_0x2cdd('0x69')](path[_0x2cdd('0x4e')](_0x25c773,_0x5e78a1[0x0]));if(_0x40cf41[_0x2cdd('0x3c')]===0x0){removeReferences(_0x45099e,_0x25c773);logger[_0x2cdd('0x2e')]('Invalid\x20plugin\x20structure');return _0x4f1e10(new Error('Invalid\x20plugin\x20structure'));}var _0x475906=_0x40cf41['some'](function(_0x503eb0){return _0x503eb0===_0x2cdd('0x6a');});if(!_0x475906){return _0x4f1e10(new Error('Plugin\x20manifest\x20missing'));}var _0x35d0e0=fs['readFileSync'](path[_0x2cdd('0x4e')](_0x25c773,_0x5e78a1[0x0],_0x2cdd('0x6a')));var _0x70863a=JSON['parse'](_0x35d0e0);if(_0x2cdd('0x1f')==typeof _0x70863a[_0x2cdd('0x2f')]){return _0x4f1e10(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x70863a['type']){return _0x4f1e10(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x2cdd('0x1f')==typeof _0x70863a[_0x2cdd('0x6b')]){return _0x4f1e10(new Error(_0x2cdd('0x6c')));}if(_0x2cdd('0x1f')==typeof _0x70863a['parameters']){return _0x4f1e10(new Error(_0x2cdd('0x6d')));}if(_0x70863a[_0x2cdd('0x42')]===_0x2cdd('0x6e')){if('undefined'==typeof _0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')]){return _0x4f1e10(new Error(_0x2cdd('0x71')));}if(_0x2cdd('0x1f')==typeof _0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')]['admin']&&'undefined'==typeof _0x70863a[_0x2cdd('0x6f')]['views'][_0x2cdd('0x72')]){return _0x4f1e10(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x70863a['type']===_0x2cdd('0x73')){if(_0x2cdd('0x1f')==typeof _0x70863a[_0x2cdd('0x6f')]['scriptName']){return _0x4f1e10(new Error(_0x2cdd('0x74')));}if(_0x2cdd('0x1f')==typeof _0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x75')]){return _0x4f1e10(new Error(_0x2cdd('0x76')));}}else{return _0x4f1e10(new Error(_0x2cdd('0x77')));}var _0x28ba92=_0x70863a[_0x2cdd('0x2f')];var _0x41c525=_0x70863a[_0x2cdd('0x78')];var _0x4acc42=_0x70863a[_0x2cdd('0x42')];var _0x35ec07=_0x70863a['sidebar']?_0x70863a[_0x2cdd('0x79')]:_0x2cdd('0x7a');var _0x2cf8b1=_0x70863a[_0x2cdd('0x7b')]?_0x70863a[_0x2cdd('0x7b')]:_0x2cdd('0x7c');var _0x3af737='';var _0x1fd39e='';var _0x57cffb='';var _0x517955='';var _0x5c44b4=_0x70863a[_0x2cdd('0x6b')];if(_0x4acc42===_0x2cdd('0x6e')){if('undefined'!=typeof _0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')][_0x2cdd('0x7d')]){var _0x2d01cd=_0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x2cdd('0x7e')](_0x2d01cd)){_0x3af737=path[_0x2cdd('0x4e')](_0x2cdd('0x7f'),_0x5d58b9,_0x5e78a1[0x0],_0x2d01cd);}else{_0x3af737=_0x2d01cd;}}else{logger[_0x2cdd('0x5f')](_0x2cdd('0x80'));}if(_0x2cdd('0x1f')!=typeof _0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')]['agent']){var _0x2b4ad1=_0x70863a['parameters'][_0x2cdd('0x70')][_0x2cdd('0x72')];if(!/^(f|ht)tps?:\/\//i[_0x2cdd('0x7e')](_0x2b4ad1)){_0x1fd39e=path[_0x2cdd('0x4e')](_0x2cdd('0x7f'),_0x5d58b9,_0x5e78a1[0x0],_0x2b4ad1);}else{_0x1fd39e=_0x2b4ad1;}}else{logger[_0x2cdd('0x5f')](_0x2cdd('0x81'));}}else if(_0x4acc42===_0x2cdd('0x73')){_0x57cffb=_0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x82')];_0x517955=_0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x75')];if(_0x2cdd('0x1f')!=typeof _0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')]){if(_0x2cdd('0x1f')!=typeof _0x70863a['parameters'][_0x2cdd('0x70')][_0x2cdd('0x7d')]){var _0x2d01cd=_0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')][_0x2cdd('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x2cdd('0x7e')](_0x2d01cd)){_0x3af737=path['join'](_0x2cdd('0x7f'),_0x5d58b9,_0x5e78a1[0x0],_0x2d01cd);}else{_0x3af737=_0x2d01cd;}}if('undefined'!=typeof _0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')][_0x2cdd('0x72')]){var _0x2b4ad1=_0x70863a[_0x2cdd('0x6f')][_0x2cdd('0x70')][_0x2cdd('0x72')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2b4ad1)){_0x1fd39e=path[_0x2cdd('0x4e')](_0x2cdd('0x7f'),_0x5d58b9,_0x5e78a1[0x0],_0x2b4ad1);}else{_0x1fd39e=_0x2b4ad1;}}}}var _0x45d01e={'name':_0x28ba92,'description':_0x41c525,'path':path[_0x2cdd('0x4e')](_0x5d58b9,_0x5e78a1[0x0]),'type':_0x4acc42,'sidebar':_0x35ec07,'icon':_0x2cf8b1,'adminUrl':_0x3af737,'agentUrl':_0x1fd39e,'scriptName':_0x57cffb,'scriptPath':_0x517955,'version':_0x5c44b4};removeReferences(_0x45099e,null);return db['Plugin'][_0x2cdd('0x83')](_0x45d01e)[_0x2cdd('0x29')](function(_0x48b05a){var _0x418a24={'role':_0x47d7db[_0x2cdd('0x84')][_0x2cdd('0x85')],'userProfileId':_0x47d7db[_0x2cdd('0x84')]['userProfileId']};if(!_0x418a24)throw new Error(_0x2cdd('0x86'));if(_0x418a24[_0x2cdd('0x85')]===_0x2cdd('0x87')){var _0xeb1d6c=_0x48b05a[_0x2cdd('0x2a')]({'plain':!![]});return db[_0x2cdd('0x88')][_0x2cdd('0x4b')]({'where':{'name':'Plugins','userProfileId':_0x418a24[_0x2cdd('0x89')]},'raw':!![]})[_0x2cdd('0x29')](function(_0x134a7f){if(_0x134a7f&&_0x134a7f[_0x2cdd('0x8a')]===0x0){return db['UserProfileResource']['create']({'name':_0xeb1d6c[_0x2cdd('0x2f')],'resourceId':_0xeb1d6c['id'],'type':_0x134a7f[_0x2cdd('0x2f')],'sectionId':_0x134a7f['id']},{})[_0x2cdd('0x29')](function(){return _0x48b05a;});}else{return _0x48b05a;}})[_0x2cdd('0x49')](function(_0x3a460f){logger[_0x2cdd('0x2e')](_0x2cdd('0x8b'),_0x3a460f);throw _0x3a460f;});}return _0x48b05a;})[_0x2cdd('0x29')](respondWithResult(_0x4f05fc,null))[_0x2cdd('0x49')](handleError(_0x4f05fc,null));}});}catch(_0x5baa63){_0x4f05fc[_0x2cdd('0x1d')](0x1f4)[_0x2cdd('0x8c')](_0x5baa63);}};function removeReferences(_0x500e48,_0xd4cf28){try{if(_0x500e48){fs[_0x2cdd('0x8d')](_0x500e48);logger[_0x2cdd('0x5f')](_0x2cdd('0x8e'));}if(_0xd4cf28){rimraf(_0xd4cf28,function(){});logger[_0x2cdd('0x5f')](_0x2cdd('0x8f'));}}catch(_0x3f661a){logger['error'](_0x3f661a);}}exports[_0x2cdd('0x90')]=function(_0x77324d,_0x3623e0,_0x11878b){return db[_0x2cdd('0x32')][_0x2cdd('0x4b')]({'where':{'id':_0x77324d[_0x2cdd('0x4c')]['id']}})[_0x2cdd('0x29')](handleEntityNotFound(_0x3623e0,null))[_0x2cdd('0x29')](saveUpdates(_0x77324d['body'],null))[_0x2cdd('0x29')](respondWithResult(_0x3623e0,null))['catch'](handleError(_0x3623e0,null));};exports['delete']=function(_0x47b8ad,_0x45fae6,_0x22137d){return db[_0x2cdd('0x32')][_0x2cdd('0x4b')]({'where':{'id':_0x47b8ad[_0x2cdd('0x4c')]['id']}})[_0x2cdd('0x29')](function(_0x4c2978){if(_0x4c2978){return _0x4c2978[_0x2cdd('0x28')]();}})['then'](function(_0x58d4d5){rimraf(path[_0x2cdd('0x4e')](config[_0x2cdd('0x4f')],'server/files/plugins',path[_0x2cdd('0x91')](_0x58d4d5['path'])),function(){});return _0x58d4d5;})[_0x2cdd('0x29')](handleEntityNotFound(_0x45fae6,null))[_0x2cdd('0x29')](respondWithStatusCode(_0x45fae6,null))['catch'](handleError(_0x45fae6,null));};exports[_0x2cdd('0x92')]=function(_0x3e363f,_0x4c97a8,_0x3f165b){return BPromise['resolve']()[_0x2cdd('0x29')](function(){if(!_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x4d')]){throw new Error(_0x2cdd('0x93'));}if(!_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x94')]){throw new Error(_0x2cdd('0x95'));}var _0x907da8=_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x96')]?_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x96')]+':'+_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x94')]:_0x2cdd('0x97')+_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x94')];var _0x29ac9b=_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x24')]?_0x3e363f[_0x2cdd('0x36')]['json']:!![];var _0x4c9816=_0x3e363f['query'][_0x2cdd('0x98')]?_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x98')]:null;var _0x5d1b2a={'method':_0x3e363f[_0x2cdd('0x99')],'uri':util[_0x2cdd('0x51')]('%s%s',_0x907da8,_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x4d')]),'json':_0x29ac9b,'resolveWithFullResponse':!![],'encoding':_0x4c9816,'qs':_0x3e363f[_0x2cdd('0x36')]};if(_0x3e363f['headers']){_0x5d1b2a['headers']=_0x3e363f[_0x2cdd('0x9a')];if(_0x5d1b2a[_0x2cdd('0x9a')][_0x2cdd('0x9b')]){delete _0x5d1b2a[_0x2cdd('0x9a')][_0x2cdd('0x9b')];}}if(_0x5d1b2a[_0x2cdd('0x9a')][_0x2cdd('0x9c')]){delete _0x5d1b2a[_0x2cdd('0x9a')]['content-type'];}return rp(_0x5d1b2a);})['then'](function(_0x367639){if(_0x367639){_0x4c97a8[_0x2cdd('0x22')](_0x367639[_0x2cdd('0x9a')]);logger['info'](_0x367639['body']);if(_[_0x2cdd('0x9d')](_0x3e363f[_0x2cdd('0x36')][_0x2cdd('0x4d')],_0x2cdd('0x4a'))&&_0x367639[_0x2cdd('0x9e')]==0x1f4){return _0x4c97a8['sendStatus'](_0x367639[_0x2cdd('0x9e')]);}else{return _0x4c97a8[_0x2cdd('0x1d')](_0x367639[_0x2cdd('0x9e')])[_0x2cdd('0x8c')](_0x367639[_0x2cdd('0x84')]);}}else{return _0x4c97a8[_0x2cdd('0x1c')](0xc8);}})[_0x2cdd('0x49')](handleError(_0x4c97a8,null));};exports[_0x2cdd('0x9f')]=function(_0x4d962a,_0x39070d,_0x1fac3c){return BPromise[_0x2cdd('0xa0')]()['then'](function(){if(!_0x4d962a[_0x2cdd('0x36')]['path']){throw new Error(_0x2cdd('0x93'));}if(!_0x4d962a[_0x2cdd('0x36')][_0x2cdd('0x94')]){throw new Error(_0x2cdd('0x95'));}var _0xcf46c=_0x4d962a[_0x2cdd('0x36')][_0x2cdd('0x96')]?_0x4d962a[_0x2cdd('0x36')][_0x2cdd('0x96')]+':'+_0x4d962a[_0x2cdd('0x36')][_0x2cdd('0x94')]:_0x2cdd('0x97')+_0x4d962a[_0x2cdd('0x36')]['port'];var _0x12b53d=_0x4d962a[_0x2cdd('0x36')][_0x2cdd('0x24')]?_0x4d962a[_0x2cdd('0x36')][_0x2cdd('0x24')]:!![];var _0x5ac738=_0x4d962a[_0x2cdd('0x36')]['encoding']?_0x4d962a[_0x2cdd('0x36')][_0x2cdd('0x98')]:null;var _0x426de5={'method':_0x4d962a['method'],'uri':util[_0x2cdd('0x51')](_0x2cdd('0xa1'),_0xcf46c,_0x4d962a['query'][_0x2cdd('0x4d')]),'json':_0x12b53d,'resolveWithFullResponse':!![],'encoding':_0x5ac738,'body':_0x4d962a[_0x2cdd('0x84')]};if(_0x4d962a['headers']){_0x426de5['headers']=_0x4d962a[_0x2cdd('0x9a')];if(_0x426de5[_0x2cdd('0x9a')][_0x2cdd('0x9b')]){delete _0x426de5[_0x2cdd('0x9a')][_0x2cdd('0x9b')];}}if(_0x426de5[_0x2cdd('0x9a')][_0x2cdd('0x9c')]){delete _0x426de5[_0x2cdd('0x9a')]['content-type'];}return rp(_0x426de5);})[_0x2cdd('0x29')](function(_0x4f4986){if(_0x4f4986){_0x39070d['set'](_0x4f4986[_0x2cdd('0x9a')]);logger[_0x2cdd('0x5f')](_0x4f4986[_0x2cdd('0x84')]);return _0x39070d[_0x2cdd('0x1d')](_0x4f4986[_0x2cdd('0x9e')])[_0x2cdd('0x8c')](_0x4f4986[_0x2cdd('0x84')]);}else{return _0x39070d[_0x2cdd('0x1c')](0xc8);}})[_0x2cdd('0x49')](handleError(_0x39070d,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 81f3b13..c2802ac 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 _0xfd2e=['events','Plugin','save','remove','hasOwnProperty'];(function(_0x54825e,_0x127d0e){var _0x3e07e9=function(_0x35930b){while(--_0x35930b){_0x54825e['push'](_0x54825e['shift']());}};_0x3e07e9(++_0x127d0e);}(_0xfd2e,0x6e));var _0xefd2=function(_0x27b9da,_0x224fbf){_0x27b9da=_0x27b9da-0x0;var _0x2be9b5=_0xfd2e[_0x27b9da];return _0x2be9b5;};'use strict';var EventEmitter=require(_0xefd2('0x0'));var Plugin=require('../../mysqldb')['db'][_0xefd2('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefd2('0x2'),'afterUpdate':'update','afterDestroy':_0xefd2('0x3')};function emitEvent(_0x1c75dd){return function(_0x2b6511,_0x11d644,_0x2e095c){PluginEvents['emit'](_0x1c75dd+':'+_0x2b6511['id'],_0x2b6511);PluginEvents['emit'](_0x1c75dd,_0x2b6511);_0x2e095c(null);};}for(var e in events){if(events[_0xefd2('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x0cfe=['hasOwnProperty','hook','exports','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x5eab39,_0x1cc937){var _0x31311b=function(_0xd603a4){while(--_0xd603a4){_0x5eab39['push'](_0x5eab39['shift']());}};_0x31311b(++_0x1cc937);}(_0x0cfe,0x9c));var _0xe0cf=function(_0x5f2f5d,_0x4ea309){_0x5f2f5d=_0x5f2f5d-0x0;var _0x54ed28=_0x0cfe[_0x5f2f5d];return _0x54ed28;};'use strict';var EventEmitter=require(_0xe0cf('0x0'));var Plugin=require('../../mysqldb')['db'][_0xe0cf('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xe0cf('0x2')](0x0);var events={'afterCreate':_0xe0cf('0x3'),'afterUpdate':'update','afterDestroy':_0xe0cf('0x4')};function emitEvent(_0x4999d4){return function(_0x37e782,_0x156fe0,_0x373bbf){PluginEvents[_0xe0cf('0x5')](_0x4999d4+':'+_0x37e782['id'],_0x37e782);PluginEvents['emit'](_0x4999d4,_0x37e782);_0x373bbf(null);};}for(var e in events){if(events[_0xe0cf('0x6')](e)){var event=events[e];Plugin[_0xe0cf('0x7')](e,emitEvent(event));}}module[_0xe0cf('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 46a9579..7b1dad9 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 _0xc389=['bluebird','request-promise','rimraf','define','Plugin','plugins','util','../../config/logger','api','moment'];(function(_0x5068cb,_0x50ea15){var _0x12f94d=function(_0x58d322){while(--_0x58d322){_0x5068cb['push'](_0x5068cb['shift']());}};_0x12f94d(++_0x50ea15);}(_0xc389,0x164));var _0x9c38=function(_0x5cb57e,_0x52bb88){_0x5cb57e=_0x5cb57e-0x0;var _0x4f75b4=_0xc389[_0x5cb57e];return _0x4f75b4;};'use strict';var _=require('lodash');var util=require(_0x9c38('0x0'));var logger=require(_0x9c38('0x1'))(_0x9c38('0x2'));var moment=require(_0x9c38('0x3'));var BPromise=require(_0x9c38('0x4'));var rp=require(_0x9c38('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c38('0x6'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x52fe77,_0x2ef172){return _0x52fe77[_0x9c38('0x7')](_0x9c38('0x8'),attributes,{'tableName':_0x9c38('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5870=['./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x14b9d4,_0x45e9ef){var _0x4d42c6=function(_0x5b99b7){while(--_0x5b99b7){_0x14b9d4['push'](_0x14b9d4['shift']());}};_0x4d42c6(++_0x45e9ef);}(_0x5870,0x88));var _0x0587=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x5870[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0x0587('0x0'));var util=require(_0x0587('0x1'));var logger=require(_0x0587('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0587('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0587('0x4'));var rimraf=require(_0x0587('0x5'));var config=require(_0x0587('0x6'));var attributes=require(_0x0587('0x7'));module['exports']=function(_0x5c5ff0,_0x1b4dde){return _0x5c5ff0[_0x0587('0x8')](_0x0587('0x9'),attributes,{'tableName':_0x0587('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index e9c196d..53176b3 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 _0x9153=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','message','result','Plugin','body','options','raw','CreatePlugin','catch','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9153,0xd8));var _0x3915=function(_0xa42f5d,_0x1199fb){_0xa42f5d=_0xa42f5d-0x0;var _0x35780c=_0x9153[_0xa42f5d];return _0x35780c;};'use strict';var _=require(_0x3915('0x0'));var util=require(_0x3915('0x1'));var moment=require(_0x3915('0x2'));var BPromise=require(_0x3915('0x3'));var rs=require(_0x3915('0x4'));var fs=require('fs');var Redis=require(_0x3915('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3915('0x6'));var logger=require(_0x3915('0x7'))(_0x3915('0x8'));var config=require(_0x3915('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3915('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3915('0xb')](config[_0x3915('0xc')],{'host':_0x3915('0xd'),'port':0x18eb});var socket=require(_0x3915('0xe'))(new Redis(config['redis']));require(_0x3915('0xf'))['register'](socket);function respondWithRpcPromise(_0x510897,_0x3287c3,_0x227e6c){return new BPromise(function(_0x46bdb0,_0x3f5a4a){return client[_0x3915('0x10')](_0x510897,_0x227e6c)[_0x3915('0x11')](function(_0x431067){logger[_0x3915('0x12')](_0x3915('0x13'),_0x3287c3,_0x3915('0x14'));logger['debug'](_0x3915('0x15'),_0x3287c3,_0x3915('0x14'),JSON['stringify'](_0x431067));if(_0x431067[_0x3915('0x16')]){if(_0x431067['error']['code']===0x1f4){logger[_0x3915('0x16')](_0x3915('0x13'),_0x3287c3,_0x431067[_0x3915('0x16')][_0x3915('0x17')]);return _0x3f5a4a(_0x431067['error'][_0x3915('0x17')]);}logger[_0x3915('0x16')](_0x3915('0x13'),_0x3287c3,_0x431067[_0x3915('0x16')][_0x3915('0x17')]);return _0x46bdb0(_0x431067['error'][_0x3915('0x17')]);}else{logger[_0x3915('0x12')](_0x3915('0x13'),_0x3287c3,_0x3915('0x14'));_0x46bdb0(_0x431067[_0x3915('0x18')][_0x3915('0x17')]);}})['catch'](function(_0x44c866){logger['error']('Plugin,\x20%s,\x20%s',_0x3287c3,_0x44c866);_0x3f5a4a(_0x44c866);});});}exports['CreatePlugin']=function(_0x27c8b3){var _0x42af5a=this;return new Promise(function(_0xc3e40b,_0x55e896){return db[_0x3915('0x19')]['create'](_0x27c8b3[_0x3915('0x1a')],{'raw':_0x27c8b3[_0x3915('0x1b')]?_0x27c8b3['options'][_0x3915('0x1c')]===undefined?!![]:![]:!![]})[_0x3915('0x11')](function(_0x3d2df2){logger[_0x3915('0x12')](_0x3915('0x1d'),_0x27c8b3);logger['debug'](_0x3915('0x1d'),_0x27c8b3,JSON['stringify'](_0x3d2df2));_0xc3e40b(_0x3d2df2);})[_0x3915('0x1e')](function(_0x5bdcd5){logger[_0x3915('0x16')](_0x3915('0x1d'),_0x5bdcd5[_0x3915('0x17')],_0x27c8b3);_0x55e896(_0x42af5a[_0x3915('0x16')](0x1f4,_0x5bdcd5[_0x3915('0x17')]));});});}; \ No newline at end of file +var _0xbea2=['error','code','Plugin,\x20%s,\x20%s','message','info','result','catch','CreatePlugin','options','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x1915e2,_0x51f382){var _0x550ab2=function(_0x42bc80){while(--_0x42bc80){_0x1915e2['push'](_0x1915e2['shift']());}};_0x550ab2(++_0x51f382);}(_0xbea2,0x153));var _0x2bea=function(_0x350256,_0x29e0dd){_0x350256=_0x350256-0x0;var _0x3edccf=_0xbea2[_0x350256];return _0x3edccf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2bea('0x0'));var BPromise=require(_0x2bea('0x1'));var rs=require(_0x2bea('0x2'));var fs=require('fs');var Redis=require(_0x2bea('0x3'));var db=require(_0x2bea('0x4'))['db'];var utils=require(_0x2bea('0x5'));var logger=require(_0x2bea('0x6'))(_0x2bea('0x7'));var config=require('../../config/environment');var jayson=require(_0x2bea('0x8'));var client=jayson[_0x2bea('0x9')][_0x2bea('0xa')]({'port':0x232a});config[_0x2bea('0xb')]=_[_0x2bea('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2bea('0xd'))(new Redis(config[_0x2bea('0xb')]));require(_0x2bea('0xe'))[_0x2bea('0xf')](socket);function respondWithRpcPromise(_0x3a5e0e,_0x3a66db,_0x3bfb93){return new BPromise(function(_0x246e5f,_0x3a6b68){return client[_0x2bea('0x10')](_0x3a5e0e,_0x3bfb93)[_0x2bea('0x11')](function(_0x2e15a6){logger['info']('Plugin,\x20%s,\x20%s',_0x3a66db,_0x2bea('0x12'));logger[_0x2bea('0x13')](_0x2bea('0x14'),_0x3a66db,_0x2bea('0x12'),JSON['stringify'](_0x2e15a6));if(_0x2e15a6[_0x2bea('0x15')]){if(_0x2e15a6[_0x2bea('0x15')][_0x2bea('0x16')]===0x1f4){logger['error'](_0x2bea('0x17'),_0x3a66db,_0x2e15a6[_0x2bea('0x15')][_0x2bea('0x18')]);return _0x3a6b68(_0x2e15a6[_0x2bea('0x15')][_0x2bea('0x18')]);}logger[_0x2bea('0x15')](_0x2bea('0x17'),_0x3a66db,_0x2e15a6[_0x2bea('0x15')][_0x2bea('0x18')]);return _0x246e5f(_0x2e15a6['error'][_0x2bea('0x18')]);}else{logger[_0x2bea('0x19')](_0x2bea('0x17'),_0x3a66db,'request\x20sent');_0x246e5f(_0x2e15a6[_0x2bea('0x1a')][_0x2bea('0x18')]);}})[_0x2bea('0x1b')](function(_0x126e83){logger['error'](_0x2bea('0x17'),_0x3a66db,_0x126e83);_0x3a6b68(_0x126e83);});});}exports[_0x2bea('0x1c')]=function(_0x2b06c4){var _0x197e9e=this;return new Promise(function(_0x30c811,_0x5bb087){return db['Plugin']['create'](_0x2b06c4['body'],{'raw':_0x2b06c4[_0x2bea('0x1d')]?_0x2b06c4[_0x2bea('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x2bea('0x11')](function(_0x42eafb){logger['info'](_0x2bea('0x1c'),_0x2b06c4);logger['debug'](_0x2bea('0x1c'),_0x2b06c4,JSON['stringify'](_0x42eafb));_0x30c811(_0x42eafb);})[_0x2bea('0x1b')](function(_0xc5dee9){logger[_0x2bea('0x15')](_0x2bea('0x1c'),_0xc5dee9['message'],_0x2b06c4);_0x5bb087(_0x197e9e[_0x2bea('0x15')](0x1f4,_0xc5dee9[_0x2bea('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 728e104..272f7c5 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 _0x6d27=['removeListener','plugin:','./plugin.events','remove','update','emit'];(function(_0x2f075b,_0x4a88b2){var _0x21b8bf=function(_0x15f86a){while(--_0x15f86a){_0x2f075b['push'](_0x2f075b['shift']());}};_0x21b8bf(++_0x4a88b2);}(_0x6d27,0x152));var _0x76d2=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x6d27[_0x42245d];return _0x4b211a;};'use strict';var PluginEvents=require(_0x76d2('0x0'));var events=['save',_0x76d2('0x1'),_0x76d2('0x2')];function createListener(_0x1512f2,_0x57245b){return function(_0xda25c2){_0x57245b[_0x76d2('0x3')](_0x1512f2,_0xda25c2);};}function removeListener(_0x3b23c0,_0xceae9){return function(){PluginEvents[_0x76d2('0x4')](_0x3b23c0,_0xceae9);};}exports['register']=function(_0x124901){for(var _0x1fb91a=0x0,_0x598e2e=events['length'];_0x1fb91a<_0x598e2e;_0x1fb91a++){var _0x294605=events[_0x1fb91a];var _0x2e010f=createListener(_0x76d2('0x5')+_0x294605,_0x124901);PluginEvents['on'](_0x294605,_0x2e010f);}}; \ No newline at end of file +var _0xca0c=['plugin:','./plugin.events','save','remove','update','emit','removeListener'];(function(_0x58981f,_0x29a796){var _0x381d75=function(_0x1f8208){while(--_0x1f8208){_0x58981f['push'](_0x58981f['shift']());}};_0x381d75(++_0x29a796);}(_0xca0c,0xd3));var _0xcca0=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xca0c[_0x2aec52];return _0x3b8835;};'use strict';var PluginEvents=require(_0xcca0('0x0'));var events=[_0xcca0('0x1'),_0xcca0('0x2'),_0xcca0('0x3')];function createListener(_0x48b9e4,_0x17862e){return function(_0x38831c){_0x17862e[_0xcca0('0x4')](_0x48b9e4,_0x38831c);};}function removeListener(_0x2ed2dd,_0x1b2fbc){return function(){PluginEvents[_0xcca0('0x5')](_0x2ed2dd,_0x1b2fbc);};}exports['register']=function(_0x5259c2){for(var _0x4bb807=0x0,_0x1714ab=events['length'];_0x4bb807<_0x1714ab;_0x4bb807++){var _0x2e94be=events[_0x4bb807];var _0x1fe253=createListener(_0xcca0('0x6')+_0x2e94be,_0x5259c2);PluginEvents['on'](_0x2e94be,_0x1fe253);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 695e4c4..beb1e63 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(_0x459820,_0x1b8e1d){var _0xafadeb=function(_0x248210){while(--_0x248210){_0x459820['push'](_0x459820['shift']());}};_0xafadeb(++_0x1b8e1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x4f54dc,_0x267c9a){var _0x23331b=function(_0x17588a){while(--_0x17588a){_0x4f54dc['push'](_0x4f54dc['shift']());}};_0x23331b(++_0x267c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 9159867..f9a2f0a 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 _0x3667=['lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','create','body','join','script','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','params','destroy','delete'];(function(_0x20fc86,_0x5e450a){var _0x19df9e=function(_0x229eb7){while(--_0x229eb7){_0x20fc86['push'](_0x20fc86['shift']());}};_0x19df9e(++_0x5e450a);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var pm2=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var path=require(_0x7366('0x4'));var exec=require('child_process')[_0x7366('0x5')];var BPromise=require(_0x7366('0x6'));function handleEntityNotFound(_0x4b32a7,_0x27726b){return function(_0x22bfc0){if(!_0x22bfc0){_0x4b32a7[_0x7366('0x7')](0x194);;}return _0x22bfc0;};}function respondWithResult(_0x1c0cf4,_0x101e3d){_0x101e3d=_0x101e3d||0xc8;return function(_0x589397){if(_0x589397){return _0x1c0cf4[_0x7366('0x8')](_0x101e3d)[_0x7366('0x9')](_0x589397);}return null;};}function handleError(_0x2dd32b,_0x26e9a9){_0x26e9a9=_0x26e9a9||0x1f4;return function(_0x171fe2){logger[_0x7366('0xa')](_0x171fe2[_0x7366('0xb')]);if(_0x171fe2[_0x7366('0xc')]){delete _0x171fe2[_0x7366('0xc')];}_0x2dd32b[_0x7366('0x8')](_0x26e9a9)[_0x7366('0xd')](_0x171fe2);};}function execChildProcess(){return new BPromise(function(_0x2d7e38,_0x57ea7f){exec(_0x7366('0xe'),function(_0x2694fc,_0xbcd488,_0x4718db){logger[_0x7366('0xf')](_0xbcd488);logger[_0x7366('0xf')](_0x4718db);if(_0x2694fc){logger[_0x7366('0xa')](_0x2694fc);return _0x57ea7f(_0x2694fc);}return _0x2d7e38(_0xbcd488);});});}exports[_0x7366('0x10')]=function(_0x37e47e,_0x1813b7){return pm2[_0x7366('0x11')]()[_0x7366('0x12')](function(_0x27500c){if(_0x27500c){var _0x22562f=_[_0x7366('0x13')](_0x27500c,function(_0x4dd111){return _0x4dd111[_0x7366('0xc')]===_0x7366('0x14')||_0x4dd111[_0x7366('0xc')]===_0x7366('0x15');});return{'rows':_0x22562f,'count':_0x22562f[_0x7366('0x16')]};}return null;})[_0x7366('0x12')](respondWithResult(_0x1813b7,null))[_0x7366('0x17')](handleError(_0x1813b7,null));};exports[_0x7366('0x18')]=function(_0x83e5d5,_0x41113f){return pm2[_0x7366('0x19')](_0x83e5d5['params']['id'])[_0x7366('0x12')](respondWithResult(_0x41113f,null))['then'](handleEntityNotFound(_0x41113f,null))[_0x7366('0x17')](handleError(_0x41113f,null));};exports[_0x7366('0x1a')]=function(_0x3f23cd,_0x52b43e){if(_0x3f23cd[_0x7366('0x1b')][_0x7366('0xc')]&&_0x3f23cd[_0x7366('0x1b')]['script']){var _0x16e038=path[_0x7366('0x1c')](__dirname,'../../files/plugins',_0x3f23cd[_0x7366('0x1b')][_0x7366('0x1d')]);var _0xaab659=process[_0x7366('0x1e')]();process[_0x7366('0x1f')](path[_0x7366('0x20')](_0x16e038));return execChildProcess()[_0x7366('0x12')](function(_0x22ed7e){process[_0x7366('0x1f')](_0xaab659);return pm2[_0x7366('0x21')]({'name':_0x3f23cd[_0x7366('0x1b')][_0x7366('0xc')],'script':_0x16e038});})[_0x7366('0x12')](function(_0x563b22){pm2[_0x7366('0x22')]();return _0x563b22[0x0];})['then'](respondWithResult(_0x52b43e,0xc9))[_0x7366('0x17')](handleError(_0x52b43e,null));}else{return _0x52b43e['status'](0x1f4)['send']({'message':_0x7366('0x23')});}};exports['update']=function(_0x254374,_0x4ac138){if(_0x254374[_0x7366('0x1b')]['id']){delete _0x254374[_0x7366('0x1b')]['id'];}var _0x5c37e2={'online':_0x7366('0x24'),'stopped':'stop'};if(_0x5c37e2[_0x7366('0x25')](_0x254374[_0x7366('0x1b')]['status'])){return pm2[_0x5c37e2[_0x254374[_0x7366('0x1b')]['status']]](_0x254374[_0x7366('0x26')]['id'])[_0x7366('0x12')](respondWithResult(_0x4ac138,0xc8))[_0x7366('0x17')](handleError(_0x4ac138,null));}else{return _0x4ac138[_0x7366('0x8')](0x1f4)[_0x7366('0xd')]({'message':'Unknown\x20status'});}};exports[_0x7366('0x27')]=function(_0x447807,_0x538d42){if(_0x447807['body']['id']){delete _0x447807['body']['id'];}if(_0x447807['params']['id']){return pm2[_0x7366('0x28')](_0x447807[_0x7366('0x26')]['id'])[_0x7366('0x12')](function(_0x15286a){pm2['dump']();return _0x15286a[0x0];})[_0x7366('0x12')](respondWithResult(_0x538d42,null))[_0x7366('0x17')](handleError(_0x538d42,null));}else{return _0x538d42[_0x7366('0x8')](0x1f4)[_0x7366('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xc368=['update','restart','Unknown\x20status','destroy','delete','dump','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','npm\x20install','info','index','list','then','reject','name','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path'];(function(_0x186ea1,_0x37b5f7){var _0xd256ff=function(_0x4e4b7b){while(--_0x4e4b7b){_0x186ea1['push'](_0x186ea1['shift']());}};_0xd256ff(++_0x37b5f7);}(_0xc368,0x7b));var _0x8c36=function(_0x539ca9,_0x492c15){_0x539ca9=_0x539ca9-0x0;var _0x449b23=_0xc368[_0x539ca9];return _0x449b23;};'use strict';var _=require('lodash');var pm2=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var path=require(_0x8c36('0x2'));var exec=require(_0x8c36('0x3'))[_0x8c36('0x4')];var BPromise=require(_0x8c36('0x5'));function handleEntityNotFound(_0x5d3b27,_0x3e9034){return function(_0x3bb30e){if(!_0x3bb30e){_0x5d3b27[_0x8c36('0x6')](0x194);;}return _0x3bb30e;};}function respondWithResult(_0x1d3660,_0x5ebfc1){_0x5ebfc1=_0x5ebfc1||0xc8;return function(_0x554022){if(_0x554022){return _0x1d3660[_0x8c36('0x7')](_0x5ebfc1)[_0x8c36('0x8')](_0x554022);}return null;};}function handleError(_0x3e76be,_0x26bad1){_0x26bad1=_0x26bad1||0x1f4;return function(_0x3af839){logger[_0x8c36('0x9')](_0x3af839['stack']);if(_0x3af839['name']){delete _0x3af839['name'];}_0x3e76be[_0x8c36('0x7')](_0x26bad1)[_0x8c36('0xa')](_0x3af839);};}function execChildProcess(){return new BPromise(function(_0x5132f6,_0x36cb13){exec(_0x8c36('0xb'),function(_0x1d5c61,_0xe7857e,_0x2a8e73){logger[_0x8c36('0xc')](_0xe7857e);logger[_0x8c36('0xc')](_0x2a8e73);if(_0x1d5c61){logger[_0x8c36('0x9')](_0x1d5c61);return _0x36cb13(_0x1d5c61);}return _0x5132f6(_0xe7857e);});});}exports[_0x8c36('0xd')]=function(_0x11f8fa,_0x43736d){return pm2[_0x8c36('0xe')]()[_0x8c36('0xf')](function(_0x220f18){if(_0x220f18){var _0x5dfcd5=_[_0x8c36('0x10')](_0x220f18,function(_0x5e32ad){return _0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x12')||_0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x13');});return{'rows':_0x5dfcd5,'count':_0x5dfcd5[_0x8c36('0x14')]};}return null;})[_0x8c36('0xf')](respondWithResult(_0x43736d,null))[_0x8c36('0x15')](handleError(_0x43736d,null));};exports[_0x8c36('0x16')]=function(_0x30229e,_0x49cafe){return pm2[_0x8c36('0x17')](_0x30229e[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x49cafe,null))[_0x8c36('0xf')](handleEntityNotFound(_0x49cafe,null))[_0x8c36('0x15')](handleError(_0x49cafe,null));};exports['create']=function(_0x15100f,_0x409de0){if(_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')]&&_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]){var _0xfb9763=path[_0x8c36('0x1b')](__dirname,_0x8c36('0x1c'),_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]);var _0x14ee6b=process[_0x8c36('0x1d')]();process['chdir'](path['dirname'](_0xfb9763));return execChildProcess()['then'](function(_0x55b844){process[_0x8c36('0x1e')](_0x14ee6b);return pm2[_0x8c36('0x1f')]({'name':_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')],'script':_0xfb9763});})[_0x8c36('0xf')](function(_0x27c0df){pm2['dump']();return _0x27c0df[0x0];})[_0x8c36('0xf')](respondWithResult(_0x409de0,0xc9))['catch'](handleError(_0x409de0,null));}else{return _0x409de0[_0x8c36('0x7')](0x1f4)['send']({'message':_0x8c36('0x20')});}};exports[_0x8c36('0x21')]=function(_0x271ec4,_0x1010c8){if(_0x271ec4['body']['id']){delete _0x271ec4['body']['id'];}var _0x7e7e56={'online':_0x8c36('0x22'),'stopped':'stop'};if(_0x7e7e56['hasOwnProperty'](_0x271ec4[_0x8c36('0x19')][_0x8c36('0x7')])){return pm2[_0x7e7e56[_0x271ec4['body'][_0x8c36('0x7')]]](_0x271ec4[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x1010c8,0xc8))['catch'](handleError(_0x1010c8,null));}else{return _0x1010c8['status'](0x1f4)[_0x8c36('0xa')]({'message':_0x8c36('0x23')});}};exports[_0x8c36('0x24')]=function(_0x192ce3,_0x3ae970){if(_0x192ce3[_0x8c36('0x19')]['id']){delete _0x192ce3[_0x8c36('0x19')]['id'];}if(_0x192ce3[_0x8c36('0x18')]['id']){return pm2[_0x8c36('0x25')](_0x192ce3[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](function(_0x36648e){pm2[_0x8c36('0x26')]();return _0x36648e[0x0];})[_0x8c36('0xf')](respondWithResult(_0x3ae970,null))[_0x8c36('0x15')](handleError(_0x3ae970,null));}else{return _0x3ae970[_0x8c36('0x7')](0x1f4)[_0x8c36('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index bb47bdd..86ee32a 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 _0x6ab3=['/agents','isAuthenticated','get','exports','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x6ab3,0x84));var _0x36ab=function(_0x290492,_0x18cfad){_0x290492=_0x290492-0x0;var _0x52b5bf=_0x6ab3[_0x290492];return _0x52b5bf;};'use strict';var express=require(_0x36ab('0x0'));var router=express[_0x36ab('0x1')]();var auth=require(_0x36ab('0x2'));var controller=require(_0x36ab('0x3'));router['get'](_0x36ab('0x4'),auth[_0x36ab('0x5')](),controller['getAgents']);router[_0x36ab('0x6')]('/queues',auth[_0x36ab('0x5')](),controller['getQueues']);module[_0x36ab('0x7')]=router; \ No newline at end of file +var _0x3536=['exports','express','./realtime.controller','get','isAuthenticated','getAgents','/queues'];(function(_0x4af373,_0x5e5b87){var _0x15df31=function(_0x4da41d){while(--_0x4da41d){_0x4af373['push'](_0x4af373['shift']());}};_0x15df31(++_0x5e5b87);}(_0x3536,0xf6));var _0x6353=function(_0x538bc6,_0x195110){_0x538bc6=_0x538bc6-0x0;var _0x3e9676=_0x3536[_0x538bc6];return _0x3e9676;};'use strict';var express=require(_0x6353('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x6353('0x1'));router[_0x6353('0x2')]('/agents',auth[_0x6353('0x3')](),controller[_0x6353('0x4')]);router[_0x6353('0x2')](_0x6353('0x5'),auth[_0x6353('0x3')](),controller['getQueues']);module[_0x6353('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 1f65f43..d79bbd9 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 _0x2922=['join','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','User','rawAttributes','fieldName','key','role','agent','getOptions','raw','push','sequelize','forEach','Pause','where','merge','user','Agents','online','extraQueryConditions','omit','UserProfile','getResources','findAndCountAll','rows','map','filterAgentAttributes','globalStatus','getAgentStatus','includes','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','catch','getQueues','toLowerCase','Queue','type','fields','name','dialActive','dialMethod','userProfileId','outbound','QueueCampaigns','Queues','filter','assign','getRealtimeQueues','initializeQueues','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','undefined','limit','offset','count','status','set','Content-Range','getAgents','query','globalQueueFilter','pause','*pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','validateSortParameter'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2922,0x1dd));var _0x2292=function(_0x4adbb2,_0x257580){_0x4adbb2=_0x4adbb2-0x0;var _0x724b18=_0x2922[_0x4adbb2];return _0x724b18;};'use strict';var _=require('lodash');var util=require(_0x2292('0x0'));var rta=require(_0x2292('0x1'));var rtq=require('../../components/realtime/queues');var qs=require(_0x2292('0x2'));var utils=require(_0x2292('0x3'));var db=require(_0x2292('0x4'))['db'];var APIBadRequestError=require(_0x2292('0x5'))[_0x2292('0x6')];var APIHandleError=require(_0x2292('0x5'))['handleError'];function respondWithFilteredResult(_0x585f26,_0x5577b9){return function(_0x2ac1d5){if(_0x2ac1d5){var _0x5168e8=typeof _0x5577b9['offset']===_0x2292('0x7')&&typeof _0x5577b9[_0x2292('0x8')]===_0x2292('0x7');var _0x5ec88a=_0x2ac1d5['count'];var _0x54bf44=_0x5168e8?0x0:_0x5577b9[_0x2292('0x9')];var _0x4cd285=_0x5168e8?_0x2ac1d5[_0x2292('0xa')]:_0x5577b9[_0x2292('0x9')]+_0x5577b9[_0x2292('0x8')];var _0x3b3b75;if(_0x4cd285>=_0x5ec88a){_0x4cd285=_0x5ec88a;_0x3b3b75=0xc8;}else{_0x3b3b75=0xce;}_0x585f26[_0x2292('0xb')](_0x3b3b75);return _0x585f26[_0x2292('0xc')](_0x2292('0xd'),_0x54bf44+'-'+_0x4cd285+'/'+_0x5ec88a)['json'](_0x2ac1d5);}return null;};}exports[_0x2292('0xe')]=function(_0xf7e1a0,_0x35cfa5){var _0x514437={'count':0x0,'rows':[]};var _0x515489={};var _0x128acf;var _0x49b065=utils['getChannels']();var _0x2981ee;var _0x3355bf;var _0x4e154b=_0xf7e1a0[_0x2292('0xf')][_0x2292('0x10')];var _0x360781=_0xf7e1a0['query']['globalStatusFilter'];var _0x5a0f0f=_0xf7e1a0[_0x2292('0xf')]['pauseTypeFilter'];var _0x5737d6=_0x360781===_0x2292('0x11')||_0x360781===_0x2292('0x12')?!![]:![];var _0x16d8e2=[];var _0x39d11f;var _0xdd4afe;Promise[_0x2292('0x13')]()[_0x2292('0x14')](function(){if(_0xf7e1a0[_0x2292('0xf')][_0x2292('0x15')]){if(!utils[_0x2292('0x16')](_0xf7e1a0[_0x2292('0xf')][_0x2292('0x15')])){throw new APIBadRequestError(util[_0x2292('0x17')](_0x2292('0x18'),_0xf7e1a0['query']['channel']));}_0x128acf=_0xf7e1a0[_0x2292('0xf')][_0x2292('0x15')]['toLowerCase']();}if(!_0xf7e1a0[_0x2292('0xf')][_0x2292('0x19')]||!_0xf7e1a0[_0x2292('0xf')][_0x2292('0x19')]['includes']('globalStatus')){_0xf7e1a0['query'][_0x2292('0x19')]=rta[_0x2292('0x1a')](_0xf7e1a0['query'][_0x2292('0x19')]);return;}var _0x364c6a=rta['getUpdatedSortOptions'](_0xf7e1a0[_0x2292('0xf')]['sort']);_0xf7e1a0[_0x2292('0xf')]['sort']=_0x364c6a['fields'][_0x2292('0x1b')](',');_0x39d11f=_0x364c6a['order'];})[_0x2292('0x14')](function(){if(!_0x4e154b){return[];}return rta[_0x2292('0x1c')](_0x4e154b,_0x128acf);})[_0x2292('0x14')](function(_0x45afda){_0x16d8e2=_0x45afda;return rta[_0x2292('0x1d')]();})[_0x2292('0x14')](function(_0x12a875){_0x3355bf=_0x12a875['rows'];if((!_0x360781||_0x5737d6)&&!_0x39d11f){return _0x16d8e2;}if(_0x39d11f&&!_0x360781){return rta[_0x2292('0x1e')](_0x3355bf,_0x16d8e2,_0x39d11f);}else{return rta[_0x2292('0x1f')](_0x3355bf,_0x16d8e2,_0x360781);}})[_0x2292('0x14')](function(_0x5e97d5){_0x16d8e2=_0x5e97d5;var _0x39bbe8=![];if(_0x16d8e2[_0x2292('0x20')]===0x0){if(_0x4e154b||_0x360781){_0x39bbe8=!![];}if(_0x5737d6){_0x39bbe8=![];}}if(_0x39bbe8){return _0x514437;}var _0x3c1041=_['map'](db[_0x2292('0x21')][_0x2292('0x22')],function(_0x329191){return{'name':_0x329191[_0x2292('0x23')],'type':_0x329191['type'][_0x2292('0x24')]};});_0xf7e1a0[_0x2292('0xf')][_0x2292('0x25')]=_0x2292('0x26');_0x515489=qs[_0x2292('0x27')](_0x3c1041,_0xf7e1a0);_0x515489[_0x2292('0x28')]=!![];var _0x138b2f=[];if(_0x16d8e2['length']>0x0){_0x138b2f[_0x2292('0x29')]({'id':{'$in':_0x16d8e2}});if(_0x39d11f&&!_0x360781){_0xdd4afe=[db[_0x2292('0x2a')]['literal']('FIELD(id,'+_0x16d8e2+')')];_0x515489['order']=_0xdd4afe;}}if(_0x5737d6){_0x49b065[_0x2292('0x2b')](function(_0x5ac117){var _0x5d069e=!![];if(_0x360781==='*pause'&&_0x128acf!==_0x5ac117){_0x5d069e=![];}_0x138b2f[_0x2292('0x29')]({[_0x5ac117+_0x2292('0x2c')]:_0x5d069e});});if(_0x5a0f0f){_0x138b2f[_0x2292('0x29')]({'pauseType':_0x5a0f0f});}}else if(_0x360781){_0x49b065[_0x2292('0x2b')](function(_0x2819fd){_0x138b2f[_0x2292('0x29')]({[_0x2819fd+_0x2292('0x2c')]:![]});});}_0x515489[_0x2292('0x2d')]=_[_0x2292('0x2e')](_0x515489[_0x2292('0x2d')],{'$and':_0x138b2f});if(_0xf7e1a0[_0x2292('0x2f')][_0x2292('0x25')]===_0x2292('0x2f')){var _0xc1e22={'params':{'id':_0xf7e1a0[_0x2292('0x2f')]['userProfileId']},'query':{'section':_0x2292('0x30'),'role':_0x2292('0x26'),'raw':!![],'ids':_0x16d8e2,'customSorting':_0xdd4afe}};if(_0xf7e1a0[_0x2292('0xf')][_0x2292('0x31')]){_0xc1e22[_0x2292('0xf')][_0x2292('0x31')]=!![];}if(_0x5737d6){_0xc1e22[_0x2292('0xf')][_0x2292('0x32')]=_0x138b2f;}_0xc1e22[_0x2292('0xf')]=Object['assign'](_0xc1e22[_0x2292('0xf')],_[_0x2292('0x33')](_0xf7e1a0[_0x2292('0xf')],'id'));return db[_0x2292('0x34')][_0x2292('0x35')](_0xc1e22);}return db[_0x2292('0x21')][_0x2292('0x36')](_0x515489);})[_0x2292('0x14')](function(_0x12a4cd){_0x514437[_0x2292('0xa')]=_0x12a4cd[_0x2292('0xa')];_0x2981ee=_0x12a4cd[_0x2292('0x37')];return _0x2981ee[_0x2292('0x38')](function(_0x451521){var _0x5a49e9=_['find'](_0x3355bf,['id',_0x451521['id']]);if(_0x5a49e9){var _0x4a42d1=rta[_0x2292('0x39')](_0x5a49e9);_[_0x2292('0x2e')](_0x451521,_0x4a42d1);}_0x451521[_0x2292('0x3a')]=rta[_0x2292('0x3b')](_0x451521);if(_0x451521[_0x2292('0x3a')][_0x2292('0x3c')](_0x2292('0x11'))){_0x49b065['forEach'](function(_0x5306a3){if(_0x451521[_0x5306a3+_0x2292('0x2c')]){if(_0x5306a3===_0x2292('0x3d')){if(_0x451521[_0x2292('0x3e')]!==_0x2292('0x3f')){_0x451521['voiceStatus']=_0x2292('0x11');}}else{_0x451521[_0x5306a3+_0x2292('0x40')]='pause';}}});}return _0x451521;});})[_0x2292('0x14')](function(_0x378da6){if(!_0x39d11f||_0xdd4afe){return _0x378da6;}return rta[_0x2292('0x41')](_0x378da6,_0x39d11f);})['then'](function(_0x4f6443){var _0x78ca8e=rta[_0x2292('0x42')]();_0x514437[_0x2292('0x37')]=_0x4f6443[_0x2292('0x38')](function(_0x8820ac){return _['pick'](_0x8820ac,_0x78ca8e);});return _0x514437;})[_0x2292('0x14')](respondWithFilteredResult(_0x35cfa5,_0x515489))[_0x2292('0x43')](APIHandleError(_0x35cfa5));};exports[_0x2292('0x44')]=function(_0x1ff654,_0x53eea0){var _0x347c0c={'count':0x0,'rows':[]};var _0x4069f4={};var _0x6caeb2;var _0x20bafc;var _0x211950;Promise[_0x2292('0x13')]()[_0x2292('0x14')](function(){if(_0x1ff654[_0x2292('0xf')][_0x2292('0x15')]){if(!utils[_0x2292('0x16')](_0x1ff654['query'][_0x2292('0x15')])){throw new APIBadRequestError(util[_0x2292('0x17')](_0x2292('0x18'),_0x1ff654[_0x2292('0xf')][_0x2292('0x15')]));}_0x6caeb2=_0x1ff654[_0x2292('0xf')]['channel'][_0x2292('0x45')]();}var _0x23aefb=_['startCase'](_0x6caeb2)+_0x2292('0x46');var _0x2dda47=_[_0x2292('0x38')](db[_0x23aefb][_0x2292('0x22')],function(_0x25db8c){return{'name':_0x25db8c[_0x2292('0x23')],'type':_0x25db8c[_0x2292('0x47')][_0x2292('0x24')]};});if(!_0x1ff654[_0x2292('0xf')][_0x2292('0x48')]){var _0xb916f3=['id',_0x2292('0x49')];if(_0x6caeb2===_0x2292('0x3d')){_0xb916f3[_0x2292('0x29')](_0x2292('0x47'));if(_0x1ff654[_0x2292('0xf')][_0x2292('0x47')]==='outbound'){_0xb916f3[_0x2292('0x29')]([_0x2292('0x4a'),_0x2292('0x4b')]);}}_0x1ff654['query'][_0x2292('0x48')]=_0xb916f3[_0x2292('0x1b')](',');}_0x4069f4=qs[_0x2292('0x27')](_0x2dda47,_0x1ff654);if(_0x1ff654[_0x2292('0x2f')][_0x2292('0x25')]===_0x2292('0x2f')){var _0x3d6574={'params':{'id':_0x1ff654[_0x2292('0x2f')][_0x2292('0x4c')]},'query':{'section':_0x6caeb2==='voice'&&_0x1ff654[_0x2292('0xf')][_0x2292('0x47')]===_0x2292('0x4d')?_0x2292('0x4e'):_['startCase'](_0x6caeb2)+_0x2292('0x4f'),'type':_0x1ff654[_0x2292('0xf')]['type'],'nolimit':!![],'sort':_0x2292('0x49'),'filter':_0x1ff654['query'][_0x2292('0x50')]}};_0x3d6574[_0x2292('0xf')]=Object[_0x2292('0x51')](_0x3d6574['query'],_0x1ff654[_0x2292('0xf')]);delete _0x3d6574[_0x2292('0xf')]['id'];return db[_0x2292('0x34')][_0x2292('0x35')](_0x3d6574);}return db[_0x23aefb][_0x2292('0x36')](_0x4069f4);})[_0x2292('0x14')](function(_0x55e707){_0x347c0c[_0x2292('0xa')]=_0x55e707[_0x2292('0xa')];_0x20bafc=_0x55e707[_0x2292('0x37')];return rtq[_0x2292('0x52')](_0x1ff654,_0x6caeb2);})['then'](function(_0x3f62f2){_0x211950=_0x3f62f2['rows'];return rtq[_0x2292('0x53')](_0x20bafc,_0x211950,_0x6caeb2,_0x1ff654[_0x2292('0xf')]['type']);})['then'](function(_0x300ff5){_0x347c0c[_0x2292('0x37')]=_0x300ff5;return _0x347c0c;})['then'](respondWithFilteredResult(_0x53eea0,_0x4069f4))[_0x2292('0x43')](APIHandleError(_0x53eea0));}; \ No newline at end of file +var _0xa8e9=['talking','voiceStatus','sortAgentsByStatus','getRealtimeAgentsQueryFields','catch','getQueues','resolve','startCase','Queue','rawAttributes','name','outbound','dialActive','filter','assign','getRealtimeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','status','set','Content-Range','json','getAgents','query','globalQueueFilter','pauseTypeFilter','pause','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','validateSortParameter','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','fieldName','type','key','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','*pause','Pause','where','merge','role','user','userProfileId','Agents','agent','UserProfile','getResources','findAndCountAll','find','voice'];(function(_0x45c536,_0x52a556){var _0x10e06d=function(_0x3fcca0){while(--_0x3fcca0){_0x45c536['push'](_0x45c536['shift']());}};_0x10e06d(++_0x52a556);}(_0xa8e9,0x106));var _0x9a8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa8e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9a8e('0x0'));var util=require('util');var rta=require(_0x9a8e('0x1'));var rtq=require(_0x9a8e('0x2'));var qs=require(_0x9a8e('0x3'));var utils=require(_0x9a8e('0x4'));var db=require(_0x9a8e('0x5'))['db'];var APIBadRequestError=require(_0x9a8e('0x6'))[_0x9a8e('0x7')];var APIHandleError=require('../../errors/api')[_0x9a8e('0x8')];function respondWithFilteredResult(_0x583bbb,_0x117336){return function(_0x46ecf3){if(_0x46ecf3){var _0x1254f6=typeof _0x117336[_0x9a8e('0x9')]==='undefined'&&typeof _0x117336[_0x9a8e('0xa')]===_0x9a8e('0xb');var _0x5077e6=_0x46ecf3[_0x9a8e('0xc')];var _0x5a58f8=_0x1254f6?0x0:_0x117336[_0x9a8e('0x9')];var _0x1afd5c=_0x1254f6?_0x46ecf3[_0x9a8e('0xc')]:_0x117336['offset']+_0x117336[_0x9a8e('0xa')];var _0x112a15;if(_0x1afd5c>=_0x5077e6){_0x1afd5c=_0x5077e6;_0x112a15=0xc8;}else{_0x112a15=0xce;}_0x583bbb[_0x9a8e('0xd')](_0x112a15);return _0x583bbb[_0x9a8e('0xe')](_0x9a8e('0xf'),_0x5a58f8+'-'+_0x1afd5c+'/'+_0x5077e6)[_0x9a8e('0x10')](_0x46ecf3);}return null;};}exports[_0x9a8e('0x11')]=function(_0x13b8e6,_0x5e0ee4){var _0x5057ec={'count':0x0,'rows':[]};var _0x8b8174={};var _0x217030;var _0x14e1eb=utils['getChannels']();var _0x256141;var _0x2b8f29;var _0x264748=_0x13b8e6[_0x9a8e('0x12')][_0x9a8e('0x13')];var _0x53ba36=_0x13b8e6[_0x9a8e('0x12')]['globalStatusFilter'];var _0x415df6=_0x13b8e6[_0x9a8e('0x12')][_0x9a8e('0x14')];var _0x4da605=_0x53ba36===_0x9a8e('0x15')||_0x53ba36==='*pause'?!![]:![];var _0x5d2add=[];var _0x562543;var _0x1916f9;Promise['resolve']()[_0x9a8e('0x16')](function(){if(_0x13b8e6[_0x9a8e('0x12')]['channel']){if(!utils[_0x9a8e('0x17')](_0x13b8e6[_0x9a8e('0x12')][_0x9a8e('0x18')])){throw new APIBadRequestError(util[_0x9a8e('0x19')](_0x9a8e('0x1a'),_0x13b8e6[_0x9a8e('0x12')]['channel']));}_0x217030=_0x13b8e6[_0x9a8e('0x12')]['channel']['toLowerCase']();}if(!_0x13b8e6['query'][_0x9a8e('0x1b')]||!_0x13b8e6[_0x9a8e('0x12')]['sort'][_0x9a8e('0x1c')](_0x9a8e('0x1d'))){_0x13b8e6[_0x9a8e('0x12')]['sort']=rta[_0x9a8e('0x1e')](_0x13b8e6[_0x9a8e('0x12')][_0x9a8e('0x1b')]);return;}var _0x32a482=rta['getUpdatedSortOptions'](_0x13b8e6[_0x9a8e('0x12')][_0x9a8e('0x1b')]);_0x13b8e6['query']['sort']=_0x32a482[_0x9a8e('0x1f')][_0x9a8e('0x20')](',');_0x562543=_0x32a482[_0x9a8e('0x21')];})[_0x9a8e('0x16')](function(){if(!_0x264748){return[];}return rta[_0x9a8e('0x22')](_0x264748,_0x217030);})[_0x9a8e('0x16')](function(_0x3a34c6){_0x5d2add=_0x3a34c6;return rta[_0x9a8e('0x23')]();})[_0x9a8e('0x16')](function(_0x8a279){_0x2b8f29=_0x8a279[_0x9a8e('0x24')];if((!_0x53ba36||_0x4da605)&&!_0x562543){return _0x5d2add;}if(_0x562543&&!_0x53ba36){return rta[_0x9a8e('0x25')](_0x2b8f29,_0x5d2add,_0x562543);}else{return rta[_0x9a8e('0x26')](_0x2b8f29,_0x5d2add,_0x53ba36);}})[_0x9a8e('0x16')](function(_0x4fbea3){_0x5d2add=_0x4fbea3;var _0x3efb7e=![];if(_0x5d2add[_0x9a8e('0x27')]===0x0){if(_0x264748||_0x53ba36){_0x3efb7e=!![];}if(_0x4da605){_0x3efb7e=![];}}if(_0x3efb7e){return _0x5057ec;}var _0x381a95=_[_0x9a8e('0x28')](db[_0x9a8e('0x29')]['rawAttributes'],function(_0xdefc7b){return{'name':_0xdefc7b[_0x9a8e('0x2a')],'type':_0xdefc7b[_0x9a8e('0x2b')][_0x9a8e('0x2c')]};});_0x13b8e6[_0x9a8e('0x12')]['role']='agent';_0x8b8174=qs[_0x9a8e('0x2d')](_0x381a95,_0x13b8e6);_0x8b8174[_0x9a8e('0x2e')]=!![];var _0x5e8aad=[];if(_0x5d2add[_0x9a8e('0x27')]>0x0){_0x5e8aad[_0x9a8e('0x2f')]({'id':{'$in':_0x5d2add}});if(_0x562543&&!_0x53ba36){_0x1916f9=[db[_0x9a8e('0x30')][_0x9a8e('0x31')](_0x9a8e('0x32')+_0x5d2add+')')];_0x8b8174[_0x9a8e('0x21')]=_0x1916f9;}}if(_0x4da605){_0x14e1eb[_0x9a8e('0x33')](function(_0x23a285){var _0x5bbeef=!![];if(_0x53ba36===_0x9a8e('0x34')&&_0x217030!==_0x23a285){_0x5bbeef=![];}_0x5e8aad[_0x9a8e('0x2f')]({[_0x23a285+_0x9a8e('0x35')]:_0x5bbeef});});if(_0x415df6){_0x5e8aad['push']({'pauseType':_0x415df6});}}else if(_0x53ba36){_0x14e1eb['forEach'](function(_0x3ef484){_0x5e8aad['push']({[_0x3ef484+_0x9a8e('0x35')]:![]});});}_0x8b8174[_0x9a8e('0x36')]=_[_0x9a8e('0x37')](_0x8b8174['where'],{'$and':_0x5e8aad});if(_0x13b8e6['user'][_0x9a8e('0x38')]==='user'){var _0x4936be={'params':{'id':_0x13b8e6[_0x9a8e('0x39')][_0x9a8e('0x3a')]},'query':{'section':_0x9a8e('0x3b'),'role':_0x9a8e('0x3c'),'raw':!![],'ids':_0x5d2add,'customSorting':_0x1916f9}};if(_0x13b8e6[_0x9a8e('0x12')]['online']){_0x4936be[_0x9a8e('0x12')]['online']=!![];}if(_0x4da605){_0x4936be[_0x9a8e('0x12')]['extraQueryConditions']=_0x5e8aad;}_0x4936be[_0x9a8e('0x12')]=Object['assign'](_0x4936be[_0x9a8e('0x12')],_['omit'](_0x13b8e6[_0x9a8e('0x12')],'id'));return db[_0x9a8e('0x3d')][_0x9a8e('0x3e')](_0x4936be);}return db[_0x9a8e('0x29')][_0x9a8e('0x3f')](_0x8b8174);})[_0x9a8e('0x16')](function(_0x16c2b4){_0x5057ec[_0x9a8e('0xc')]=_0x16c2b4[_0x9a8e('0xc')];_0x256141=_0x16c2b4['rows'];return _0x256141[_0x9a8e('0x28')](function(_0x3ece71){var _0x15d9d4=_[_0x9a8e('0x40')](_0x2b8f29,['id',_0x3ece71['id']]);if(_0x15d9d4){var _0x218d23=rta['filterAgentAttributes'](_0x15d9d4);_[_0x9a8e('0x37')](_0x3ece71,_0x218d23);}_0x3ece71[_0x9a8e('0x1d')]=rta['getAgentStatus'](_0x3ece71);if(_0x3ece71[_0x9a8e('0x1d')][_0x9a8e('0x1c')](_0x9a8e('0x15'))){_0x14e1eb['forEach'](function(_0x23c6ee){if(_0x3ece71[_0x23c6ee+_0x9a8e('0x35')]){if(_0x23c6ee===_0x9a8e('0x41')){if(_0x3ece71['voiceStatus']!==_0x9a8e('0x42')){_0x3ece71[_0x9a8e('0x43')]='pause';}}else{_0x3ece71[_0x23c6ee+'Status']=_0x9a8e('0x15');}}});}return _0x3ece71;});})[_0x9a8e('0x16')](function(_0x35ffcf){if(!_0x562543||_0x1916f9){return _0x35ffcf;}return rta[_0x9a8e('0x44')](_0x35ffcf,_0x562543);})[_0x9a8e('0x16')](function(_0x5de1c2){var _0x4ea80b=rta[_0x9a8e('0x45')]();_0x5057ec['rows']=_0x5de1c2[_0x9a8e('0x28')](function(_0x3dc481){return _['pick'](_0x3dc481,_0x4ea80b);});return _0x5057ec;})[_0x9a8e('0x16')](respondWithFilteredResult(_0x5e0ee4,_0x8b8174))[_0x9a8e('0x46')](APIHandleError(_0x5e0ee4));};exports[_0x9a8e('0x47')]=function(_0x546f01,_0x20ee0e){var _0x2f2c9b={'count':0x0,'rows':[]};var _0x328f7f={};var _0x39f860;var _0x1776d1;var _0x1bf186;Promise[_0x9a8e('0x48')]()[_0x9a8e('0x16')](function(){if(_0x546f01[_0x9a8e('0x12')][_0x9a8e('0x18')]){if(!utils[_0x9a8e('0x17')](_0x546f01[_0x9a8e('0x12')][_0x9a8e('0x18')])){throw new APIBadRequestError(util['format'](_0x9a8e('0x1a'),_0x546f01[_0x9a8e('0x12')]['channel']));}_0x39f860=_0x546f01[_0x9a8e('0x12')][_0x9a8e('0x18')]['toLowerCase']();}var _0x5171da=_[_0x9a8e('0x49')](_0x39f860)+_0x9a8e('0x4a');var _0x21000a=_[_0x9a8e('0x28')](db[_0x5171da][_0x9a8e('0x4b')],function(_0x1cba27){return{'name':_0x1cba27['fieldName'],'type':_0x1cba27['type'][_0x9a8e('0x2c')]};});if(!_0x546f01[_0x9a8e('0x12')]['fields']){var _0x3c1229=['id',_0x9a8e('0x4c')];if(_0x39f860===_0x9a8e('0x41')){_0x3c1229[_0x9a8e('0x2f')](_0x9a8e('0x2b'));if(_0x546f01[_0x9a8e('0x12')][_0x9a8e('0x2b')]===_0x9a8e('0x4d')){_0x3c1229['push']([_0x9a8e('0x4e'),'dialMethod']);}}_0x546f01[_0x9a8e('0x12')][_0x9a8e('0x1f')]=_0x3c1229[_0x9a8e('0x20')](',');}_0x328f7f=qs[_0x9a8e('0x2d')](_0x21000a,_0x546f01);if(_0x546f01[_0x9a8e('0x39')]['role']===_0x9a8e('0x39')){var _0x1d2eb7={'params':{'id':_0x546f01['user'][_0x9a8e('0x3a')]},'query':{'section':_0x39f860===_0x9a8e('0x41')&&_0x546f01['query'][_0x9a8e('0x2b')]==='outbound'?'QueueCampaigns':_[_0x9a8e('0x49')](_0x39f860)+'Queues','type':_0x546f01[_0x9a8e('0x12')]['type'],'nolimit':!![],'sort':_0x9a8e('0x4c'),'filter':_0x546f01[_0x9a8e('0x12')][_0x9a8e('0x4f')]}};_0x1d2eb7[_0x9a8e('0x12')]=Object[_0x9a8e('0x50')](_0x1d2eb7[_0x9a8e('0x12')],_0x546f01[_0x9a8e('0x12')]);delete _0x1d2eb7['query']['id'];return db[_0x9a8e('0x3d')][_0x9a8e('0x3e')](_0x1d2eb7);}return db[_0x5171da][_0x9a8e('0x3f')](_0x328f7f);})[_0x9a8e('0x16')](function(_0x5abd64){_0x2f2c9b[_0x9a8e('0xc')]=_0x5abd64[_0x9a8e('0xc')];_0x1776d1=_0x5abd64['rows'];return rtq[_0x9a8e('0x51')](_0x546f01,_0x39f860);})[_0x9a8e('0x16')](function(_0x238367){_0x1bf186=_0x238367['rows'];return rtq['initializeQueues'](_0x1776d1,_0x1bf186,_0x39f860,_0x546f01[_0x9a8e('0x12')][_0x9a8e('0x2b')]);})[_0x9a8e('0x16')](function(_0x4deb66){_0x2f2c9b[_0x9a8e('0x24')]=_0x4deb66;return _0x2f2c9b;})['then'](respondWithFilteredResult(_0x20ee0e,_0x328f7f))[_0x9a8e('0x46')](APIHandleError(_0x20ee0e));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3aef669..25a1f04 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x31f6ad,_0x41f09c){var _0x130bfc=function(_0x4cac06){while(--_0x4cac06){_0x31f6ad['push'](_0x31f6ad['shift']());}};_0x130bfc(++_0x41f09c);}(_0x70e0,0x17b));var _0x070e=function(_0x31cb6f,_0x5bae5a){_0x31cb6f=_0x31cb6f-0x0;var _0xa99709=_0x70e0[_0x31cb6f];return _0xa99709;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x258706,_0x42184f){var _0x3b5979=function(_0x1cee4b){while(--_0x1cee4b){_0x258706['push'](_0x258706['shift']());}};_0x3b5979(++_0x42184f);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ba844,_0x525ef5){_0x4ba844=_0x4ba844-0x0;var _0x9429d1=_0xedd9[_0x4ba844];return _0x9429d1;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 5195472..07d1d4a 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 _0x02b6=['STRING','DATE','sequelize','INTEGER'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x02b6,0xfe));var _0x602b=function(_0xd7b72c,_0x3a1e5e){_0xd7b72c=_0xd7b72c-0x0;var _0x5a9d44=_0x02b6[_0xd7b72c];return _0x5a9d44;};'use strict';var Sequelize=require(_0x602b('0x0'));module['exports']={'state':{'type':Sequelize[_0x602b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x602b('0x2')]},'scheduledat':{'type':Sequelize[_0x602b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x602b('0x3')]},'ringtime':{'type':Sequelize[_0x602b('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x602b('0x2')]},'campaigntype':{'type':Sequelize[_0x602b('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4af9=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x52db35,_0x133dad){var _0x3a6b97=function(_0x667d05){while(--_0x667d05){_0x52db35['push'](_0x52db35['shift']());}};_0x3a6b97(++_0x133dad);}(_0x4af9,0x12c));var _0x94af=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4af9[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x94af('0x0'));module[_0x94af('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x94af('0x2')]},'uniqueid':{'type':Sequelize[_0x94af('0x3')]},'starttime':{'type':Sequelize[_0x94af('0x2')]},'responsetime':{'type':Sequelize[_0x94af('0x2')]},'ringtime':{'type':Sequelize[_0x94af('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x94af('0x3')]},'campaigntype':{'type':Sequelize[_0x94af('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c533159..0421891 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 _0xba9e=['report_agent_preview','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview'];(function(_0x4d8db1,_0x141f8a){var _0x25fd9a=function(_0x244cf9){while(--_0x244cf9){_0x4d8db1['push'](_0x4d8db1['shift']());}};_0x25fd9a(++_0x141f8a);}(_0xba9e,0x1e5));var _0xeba9=function(_0x1fd139,_0x358767){_0x1fd139=_0x1fd139-0x0;var _0x354a9d=_0xba9e[_0x1fd139];return _0x354a9d;};'use strict';var _=require(_0xeba9('0x0'));var util=require('util');var logger=require(_0xeba9('0x1'))(_0xeba9('0x2'));var moment=require(_0xeba9('0x3'));var BPromise=require('bluebird');var rp=require(_0xeba9('0x4'));var fs=require('fs');var path=require(_0xeba9('0x5'));var rimraf=require('rimraf');var config=require(_0xeba9('0x6'));var attributes=require(_0xeba9('0x7'));module[_0xeba9('0x8')]=function(_0x369388,_0x50f7aa){return _0x369388['define'](_0xeba9('0x9'),attributes,{'tableName':_0xeba9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9eb5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x3a4ceb,_0x2ee2e5){var _0x289903=function(_0x303012){while(--_0x303012){_0x3a4ceb['push'](_0x3a4ceb['shift']());}};_0x289903(++_0x2ee2e5);}(_0x9eb5,0xa3));var _0x59eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9eb5[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x59eb('0x0'));var util=require(_0x59eb('0x1'));var logger=require(_0x59eb('0x2'))(_0x59eb('0x3'));var moment=require(_0x59eb('0x4'));var BPromise=require(_0x59eb('0x5'));var rp=require(_0x59eb('0x6'));var fs=require('fs');var path=require(_0x59eb('0x7'));var rimraf=require(_0x59eb('0x8'));var config=require(_0x59eb('0x9'));var attributes=require(_0x59eb('0xa'));module[_0x59eb('0xb')]=function(_0x521f27,_0x5c2f19){return _0x521f27[_0x59eb('0xc')](_0x59eb('0xd'),attributes,{'tableName':_0x59eb('0xe'),'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 f92f560..3b0a263 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 _0xb711=['stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','info','result','catch','CreateReportAgentPreview','create','body','options','raw','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3875b1,_0x47cf1a){var _0x1e9c55=function(_0xc8e89b){while(--_0xc8e89b){_0x3875b1['push'](_0x3875b1['shift']());}};_0x1e9c55(++_0x47cf1a);}(_0xb711,0x8b));var _0x1b71=function(_0x54f38a,_0x12a765){_0x54f38a=_0x54f38a-0x0;var _0x49322d=_0xb711[_0x54f38a];return _0x49322d;};'use strict';var _=require(_0x1b71('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b71('0x1'));var fs=require('fs');var Redis=require(_0x1b71('0x2'));var db=require(_0x1b71('0x3'))['db'];var utils=require(_0x1b71('0x4'));var logger=require('../../config/logger')(_0x1b71('0x5'));var config=require(_0x1b71('0x6'));var jayson=require(_0x1b71('0x7'));var client=jayson[_0x1b71('0x8')][_0x1b71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11435c,_0x3b3eef,_0xb38e12){return new BPromise(function(_0x19cfea,_0x536a24){return client['request'](_0x11435c,_0xb38e12)[_0x1b71('0xa')](function(_0x49f45a){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x3b3eef,'request\x20sent');logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3b3eef,'request\x20sent',JSON[_0x1b71('0xb')](_0x49f45a));if(_0x49f45a[_0x1b71('0xc')]){if(_0x49f45a['error'][_0x1b71('0xd')]===0x1f4){logger[_0x1b71('0xc')](_0x1b71('0xe'),_0x3b3eef,_0x49f45a['error']['message']);return _0x536a24(_0x49f45a[_0x1b71('0xc')]['message']);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3b3eef,_0x49f45a[_0x1b71('0xc')][_0x1b71('0xf')]);return _0x19cfea(_0x49f45a['error']['message']);}else{logger[_0x1b71('0x10')](_0x1b71('0xe'),_0x3b3eef,'request\x20sent');_0x19cfea(_0x49f45a[_0x1b71('0x11')][_0x1b71('0xf')]);}})[_0x1b71('0x12')](function(_0x2d8c47){logger[_0x1b71('0xc')](_0x1b71('0xe'),_0x3b3eef,_0x2d8c47);_0x536a24(_0x2d8c47);});});}exports[_0x1b71('0x13')]=function(_0x23e1d7){var _0x451a49=this;return new Promise(function(_0x3d50d1,_0x2b3b58){return db['ReportAgentPreview'][_0x1b71('0x14')](_0x23e1d7[_0x1b71('0x15')],{'raw':_0x23e1d7[_0x1b71('0x16')]?_0x23e1d7[_0x1b71('0x16')][_0x1b71('0x17')]===undefined?!![]:![]:!![]})[_0x1b71('0xa')](function(_0x3d68ac){logger[_0x1b71('0x10')](_0x1b71('0x13'),_0x23e1d7);logger[_0x1b71('0x18')](_0x1b71('0x13'),_0x23e1d7,JSON[_0x1b71('0xb')](_0x3d68ac));_0x3d50d1(_0x3d68ac);})[_0x1b71('0x12')](function(_0x273248){logger[_0x1b71('0xc')](_0x1b71('0x13'),_0x273248[_0x1b71('0xf')],_0x23e1d7);_0x2b3b58(_0x451a49[_0x1b71('0xc')](0x1f4,_0x273248[_0x1b71('0xf')]));});});}; \ No newline at end of file +var _0x10d5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x10d5,0x14b));var _0x510d=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0x10d5[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require(_0x510d('0x0'));var util=require('util');var moment=require(_0x510d('0x1'));var BPromise=require(_0x510d('0x2'));var rs=require(_0x510d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x510d('0x4'))['db'];var utils=require(_0x510d('0x5'));var logger=require(_0x510d('0x6'))(_0x510d('0x7'));var config=require(_0x510d('0x8'));var jayson=require(_0x510d('0x9'));var client=jayson['client'][_0x510d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1af875,_0x2223e0,_0x3e8523){return new BPromise(function(_0x2167d7,_0x28f8bc){return client[_0x510d('0xb')](_0x1af875,_0x3e8523)['then'](function(_0x5bfc2a){logger[_0x510d('0xc')](_0x510d('0xd'),_0x2223e0,_0x510d('0xe'));logger[_0x510d('0xf')](_0x510d('0x10'),_0x2223e0,_0x510d('0xe'),JSON[_0x510d('0x11')](_0x5bfc2a));if(_0x5bfc2a['error']){if(_0x5bfc2a[_0x510d('0x12')][_0x510d('0x13')]===0x1f4){logger[_0x510d('0x12')](_0x510d('0xd'),_0x2223e0,_0x5bfc2a[_0x510d('0x12')]['message']);return _0x28f8bc(_0x5bfc2a['error']['message']);}logger[_0x510d('0x12')](_0x510d('0xd'),_0x2223e0,_0x5bfc2a[_0x510d('0x12')][_0x510d('0x14')]);return _0x2167d7(_0x5bfc2a[_0x510d('0x12')][_0x510d('0x14')]);}else{logger[_0x510d('0xc')](_0x510d('0xd'),_0x2223e0,_0x510d('0xe'));_0x2167d7(_0x5bfc2a[_0x510d('0x15')][_0x510d('0x14')]);}})[_0x510d('0x16')](function(_0x333ed1){logger[_0x510d('0x12')](_0x510d('0xd'),_0x2223e0,_0x333ed1);_0x28f8bc(_0x333ed1);});});}exports[_0x510d('0x17')]=function(_0x3e1cc7){var _0x2bd1c3=this;return new Promise(function(_0x2a1c24,_0x39262a){return db[_0x510d('0x18')][_0x510d('0x19')](_0x3e1cc7[_0x510d('0x1a')],{'raw':_0x3e1cc7[_0x510d('0x1b')]?_0x3e1cc7['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1a9dac){logger['info'](_0x510d('0x17'),_0x3e1cc7);logger[_0x510d('0xf')](_0x510d('0x17'),_0x3e1cc7,JSON['stringify'](_0x1a9dac));_0x2a1c24(_0x1a9dac);})[_0x510d('0x16')](function(_0x3b33d7){logger[_0x510d('0x12')](_0x510d('0x17'),_0x3b33d7[_0x510d('0x14')],_0x3e1cc7);_0x39262a(_0x2bd1c3['error'](0x1f4,_0x3b33d7['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 98f831e..5057c1d 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 _0xcf2b=['/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','Router','../../components/auth/service','./rpc.controller','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0xcf2b,0x77));var _0xbcf2=function(_0x3c3698,_0xa0bf08){_0x3c3698=_0x3c3698-0x0;var _0x4e6637=_0xcf2b[_0x3c3698];return _0x4e6637;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require('express');var router=express[_0xbcf2('0x0')]();var auth=require(_0xbcf2('0x1'));var controller=require(_0xbcf2('0x2'));router['get']('/voice/channels',auth[_0xbcf2('0x3')](),controller['voiceChannels']);router['get'](_0xbcf2('0x4'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x5')]);router[_0xbcf2('0x6')](_0xbcf2('0x7'),auth[_0xbcf2('0x3')](),controller['voiceChannelStopMixMonitor']);router[_0xbcf2('0x6')](_0xbcf2('0x8'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x9')]);router[_0xbcf2('0x6')](_0xbcf2('0xa'),auth[_0xbcf2('0x3')](),controller['chatQueues']);router[_0xbcf2('0x6')](_0xbcf2('0xb'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0xc')]);router[_0xbcf2('0x6')](_0xbcf2('0xd'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0xe')]);router[_0xbcf2('0x6')]('/openchannel/queues',auth[_0xbcf2('0x3')](),controller[_0xbcf2('0xf')]);router['get'](_0xbcf2('0x10'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x11')]);router[_0xbcf2('0x6')](_0xbcf2('0x12'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x13')]);router[_0xbcf2('0x6')](_0xbcf2('0x14'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x15')]);router[_0xbcf2('0x6')](_0xbcf2('0x16'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x17')]);router[_0xbcf2('0x6')](_0xbcf2('0x18'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x19')]);router[_0xbcf2('0x6')](_0xbcf2('0x1a'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x1b')]);router[_0xbcf2('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xbcf2('0x6')](_0xbcf2('0x1c'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x1d')]);router[_0xbcf2('0x6')](_0xbcf2('0x1e'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x1f')]);router[_0xbcf2('0x20')](_0xbcf2('0x1e'),auth[_0xbcf2('0x3')](),controller['updateVoiceQueue']);router[_0xbcf2('0x6')](_0xbcf2('0x21'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x22')]);router['get'](_0xbcf2('0x23'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x24')]);router[_0xbcf2('0x6')](_0xbcf2('0x25'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x26')]);router['put'](_0xbcf2('0x27'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x28')]);router[_0xbcf2('0x6')]('/telephones',auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x29')]);router[_0xbcf2('0x6')](_0xbcf2('0x2a'),auth[_0xbcf2('0x3')](),controller['trunks']);router[_0xbcf2('0x6')](_0xbcf2('0x2b'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x2c')]);router[_0xbcf2('0x6')](_0xbcf2('0x2d'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x2e')]);router[_0xbcf2('0x6')](_0xbcf2('0x2f'),auth['isAuthenticated'](),controller[_0xbcf2('0x30')]);router['get']('/mail/queues/waitinginteractions',auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x31')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x32')]);router[_0xbcf2('0x6')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xbcf2('0x33')]);router[_0xbcf2('0x6')](_0xbcf2('0x34'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x35')]);router[_0xbcf2('0x6')](_0xbcf2('0x36'),auth[_0xbcf2('0x3')](),controller['whatsappQueuesWaitingInteractions']);router['get']('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xbcf2('0x37')]);router['post'](_0xbcf2('0x38'),auth[_0xbcf2('0x3')](),controller['queueNotify'](_0xbcf2('0x39')));router[_0xbcf2('0x6')](_0xbcf2('0x3a'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x3b')]);router[_0xbcf2('0x3c')](_0xbcf2('0x3d'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x3e')](_0xbcf2('0x3f')));router['get'](_0xbcf2('0x40'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x41')]);router[_0xbcf2('0x3c')](_0xbcf2('0x42'),auth['isAuthenticated'](),controller['queueNotify'](_0xbcf2('0x43')));router[_0xbcf2('0x6')](_0xbcf2('0x44'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x45')]);router[_0xbcf2('0x3c')]('/openchannel/queues/:id/notify',auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x3e')](_0xbcf2('0x46')));router[_0xbcf2('0x6')](_0xbcf2('0x47'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x48')]);router[_0xbcf2('0x3c')](_0xbcf2('0x49'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x3e')]('sms'));router[_0xbcf2('0x3c')](_0xbcf2('0x4a'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x3e')](_0xbcf2('0x4b')));router['get'](_0xbcf2('0x4c'),auth[_0xbcf2('0x3')](),controller['showSmsQueues']);router[_0xbcf2('0x6')](_0xbcf2('0x4d'),auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x4e')]);router[_0xbcf2('0x3c')]('/agents/:id/notify',auth[_0xbcf2('0x3')](),controller[_0xbcf2('0x4f')]);module[_0xbcf2('0x50')]=router; \ No newline at end of file +var _0x153c=['/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','/mail/queues','/mail/accounts','/openchannel/queues','/sms/queues'];(function(_0x3f8ae3,_0x60d330){var _0x36ce85=function(_0x546d9b){while(--_0x546d9b){_0x3f8ae3['push'](_0x3f8ae3['shift']());}};_0x36ce85(++_0x60d330);}(_0x153c,0x8c));var _0xc153=function(_0x2d1103,_0xaf32b2){_0x2d1103=_0x2d1103-0x0;var _0x18d4c5=_0x153c[_0x2d1103];return _0x18d4c5;};'use strict';var multer=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var path=require(_0xc153('0x2'));var express=require(_0xc153('0x3'));var router=express['Router']();var auth=require(_0xc153('0x4'));var controller=require(_0xc153('0x5'));router[_0xc153('0x6')](_0xc153('0x7'),auth[_0xc153('0x8')](),controller[_0xc153('0x9')]);router[_0xc153('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xc153('0x8')](),controller[_0xc153('0xa')]);router[_0xc153('0x6')](_0xc153('0xb'),auth[_0xc153('0x8')](),controller['voiceChannelStopMixMonitor']);router['get']('/voice/queues',auth[_0xc153('0x8')](),controller[_0xc153('0xc')]);router[_0xc153('0x6')](_0xc153('0xd'),auth[_0xc153('0x8')](),controller['chatQueues']);router['get'](_0xc153('0xe'),auth[_0xc153('0x8')](),controller['mailQueues']);router[_0xc153('0x6')](_0xc153('0xf'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0xc153('0x6')](_0xc153('0x10'),auth[_0xc153('0x8')](),controller['openchannelQueues']);router[_0xc153('0x6')](_0xc153('0x11'),auth[_0xc153('0x8')](),controller['smsQueues']);router[_0xc153('0x6')](_0xc153('0x12'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0xc153('0x6')](_0xc153('0x13'),auth[_0xc153('0x8')](),controller[_0xc153('0x14')]);router[_0xc153('0x6')](_0xc153('0x15'),auth[_0xc153('0x8')](),controller[_0xc153('0x16')]);router['get'](_0xc153('0x17'),auth[_0xc153('0x8')](),controller[_0xc153('0x18')]);router['get'](_0xc153('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0xc153('0x6')](_0xc153('0x1a'),auth[_0xc153('0x8')](),controller[_0xc153('0x1b')]);router[_0xc153('0x6')](_0xc153('0x1c'),auth['isAuthenticated'](),controller[_0xc153('0x1d')]);router['get'](_0xc153('0x1e'),auth[_0xc153('0x8')](),controller[_0xc153('0x1f')]);router[_0xc153('0x20')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xc153('0x21')]);router['get'](_0xc153('0x22'),auth[_0xc153('0x8')](),controller[_0xc153('0x23')]);router[_0xc153('0x6')]('/outbound/channels',auth[_0xc153('0x8')](),controller[_0xc153('0x24')]);router[_0xc153('0x6')](_0xc153('0x25'),auth[_0xc153('0x8')](),controller[_0xc153('0x26')]);router['put'](_0xc153('0x27'),auth['isAuthenticated'](),controller[_0xc153('0x28')]);router[_0xc153('0x6')]('/telephones',auth[_0xc153('0x8')](),controller[_0xc153('0x29')]);router['get'](_0xc153('0x2a'),auth[_0xc153('0x8')](),controller[_0xc153('0x2b')]);router['get'](_0xc153('0x2c'),auth[_0xc153('0x8')](),controller[_0xc153('0x2d')]);router['get'](_0xc153('0x2e'),auth[_0xc153('0x8')](),controller[_0xc153('0x2f')]);router[_0xc153('0x6')]('/chat/queues/waitinginteractions',auth[_0xc153('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0xc153('0x6')]('/mail/queues/waitinginteractions',auth[_0xc153('0x8')](),controller[_0xc153('0x30')]);router['get'](_0xc153('0x31'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xc153('0x6')](_0xc153('0x32'),auth[_0xc153('0x8')](),controller[_0xc153('0x33')]);router[_0xc153('0x6')]('/sms/queues/waitinginteractions',auth[_0xc153('0x8')](),controller[_0xc153('0x34')]);router[_0xc153('0x6')](_0xc153('0x35'),auth[_0xc153('0x8')](),controller[_0xc153('0x36')]);router[_0xc153('0x6')](_0xc153('0x37'),auth[_0xc153('0x8')](),controller[_0xc153('0x38')]);router['post']('/mail/queues/:id/notify',auth[_0xc153('0x8')](),controller['queueNotify'](_0xc153('0x39')));router[_0xc153('0x6')](_0xc153('0x3a'),auth['isAuthenticated'](),controller[_0xc153('0x3b')]);router[_0xc153('0x3c')](_0xc153('0x3d'),auth[_0xc153('0x8')](),controller[_0xc153('0x3e')](_0xc153('0x3f')));router[_0xc153('0x6')](_0xc153('0x40'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0xc153('0x3c')](_0xc153('0x41'),auth[_0xc153('0x8')](),controller[_0xc153('0x3e')](_0xc153('0x42')));router[_0xc153('0x6')]('/fax/queues/:id',auth[_0xc153('0x8')](),controller[_0xc153('0x43')]);router[_0xc153('0x3c')]('/openchannel/queues/:id/notify',auth[_0xc153('0x8')](),controller[_0xc153('0x3e')](_0xc153('0x44')));router['get']('/openchannel/queues/:id',auth['isAuthenticated'](),controller['showOpenchannelQueues']);router['post'](_0xc153('0x45'),auth['isAuthenticated'](),controller[_0xc153('0x3e')](_0xc153('0x46')));router[_0xc153('0x3c')](_0xc153('0x47'),auth[_0xc153('0x8')](),controller[_0xc153('0x3e')](_0xc153('0x48')));router[_0xc153('0x6')](_0xc153('0x49'),auth[_0xc153('0x8')](),controller[_0xc153('0x4a')]);router[_0xc153('0x6')](_0xc153('0x4b'),auth['isAuthenticated'](),controller[_0xc153('0x4c')]);router[_0xc153('0x3c')](_0xc153('0x4d'),auth[_0xc153('0x8')](),controller[_0xc153('0x4e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index d4bfb80..58f1009 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 _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x4c7d27,_0x569cc1){var _0x39b471=function(_0x24258a){while(--_0x24258a){_0x4c7d27['push'](_0x4c7d27['shift']());}};_0x39b471(++_0x569cc1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x226d85,_0xab59f9){var _0x581612=function(_0x52f61e){while(--_0x52f61e){_0x226d85['push'](_0x226d85['shift']());}};_0x581612(++_0xab59f9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 1587d34..3e9da70 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 _0xb721=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','index','/:id','isAuthenticated','/:id/run','run','post','create','exports','multer','path'];(function(_0x5b94ca,_0x518ff4){var _0x3a2d17=function(_0x5d3e31){while(--_0x5d3e31){_0x5b94ca['push'](_0x5b94ca['shift']());}};_0x3a2d17(++_0x518ff4);}(_0xb721,0x154));var _0x1b72=function(_0x1a9b94,_0x4d763e){_0x1a9b94=_0x1a9b94-0x0;var _0x379102=_0xb721[_0x1a9b94];return _0x379102;};'use strict';var multer=require(_0x1b72('0x0'));var util=require('util');var path=require(_0x1b72('0x1'));var timeout=require(_0x1b72('0x2'));var express=require(_0x1b72('0x3'));var router=express[_0x1b72('0x4')]();var fs_extra=require(_0x1b72('0x5'));var auth=require(_0x1b72('0x6'));var interaction=require(_0x1b72('0x7'));var config=require('../../config/environment');var controller=require(_0x1b72('0x8'));router[_0x1b72('0x9')]('/',auth['isAuthenticated'](),controller[_0x1b72('0xa')]);router['get'](_0x1b72('0xb'),auth[_0x1b72('0xc')](),controller['show']);router[_0x1b72('0x9')](_0x1b72('0xd'),auth[_0x1b72('0xc')](),controller[_0x1b72('0xe')]);router[_0x1b72('0xf')]('/',auth[_0x1b72('0xc')](),controller[_0x1b72('0x10')]);router['put'](_0x1b72('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1b72('0xb'),auth[_0x1b72('0xc')](),controller['destroy']);module[_0x1b72('0x11')]=router; \ No newline at end of file +var _0x7fcf=['show','/:id/run','run','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x7fcf,0x1a3));var _0xf7fc=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7fcf[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require('multer');var util=require(_0xf7fc('0x0'));var path=require(_0xf7fc('0x1'));var timeout=require(_0xf7fc('0x2'));var express=require(_0xf7fc('0x3'));var router=express[_0xf7fc('0x4')]();var fs_extra=require(_0xf7fc('0x5'));var auth=require(_0xf7fc('0x6'));var interaction=require(_0xf7fc('0x7'));var config=require(_0xf7fc('0x8'));var controller=require(_0xf7fc('0x9'));router[_0xf7fc('0xa')]('/',auth[_0xf7fc('0xb')](),controller[_0xf7fc('0xc')]);router['get']('/:id',auth[_0xf7fc('0xb')](),controller[_0xf7fc('0xd')]);router[_0xf7fc('0xa')](_0xf7fc('0xe'),auth[_0xf7fc('0xb')](),controller[_0xf7fc('0xf')]);router[_0xf7fc('0x10')]('/',auth[_0xf7fc('0xb')](),controller[_0xf7fc('0x11')]);router[_0xf7fc('0x12')](_0xf7fc('0x13'),auth[_0xf7fc('0xb')](),controller[_0xf7fc('0x14')]);router[_0xf7fc('0x15')]('/:id',auth[_0xf7fc('0xb')](),controller[_0xf7fc('0x16')]);module[_0xf7fc('0x17')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 1155216..83c63d8 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 _0x5631=['default','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','pdf','xlsx','csv'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x5631,0x154));var _0x1563=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x5631[_0x5519a9];return _0x32f2cc;};'use strict';var Sequelize=require(_0x1563('0x0'));module[_0x1563('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1563('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1563('0x2')],'allowNull':![],'defaultValue':_0x1563('0x3')},'startAt':{'type':Sequelize[_0x1563('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1563('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1563('0x6')](_0x1563('0x7'),_0x1563('0x8'),_0x1563('0x9'),_0x1563('0xa'),_0x1563('0xb'),_0x1563('0xc'),_0x1563('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x1563('0x6')]('csv',_0x1563('0xe'),_0x1563('0xf')),'allowNull':![],'defaultValue':_0x1563('0x10')},'type':{'type':Sequelize[_0x1563('0x6')]('custom',_0x1563('0x11')),'allowNull':![],'defaultValue':_0x1563('0x12')},'sendMail':{'type':Sequelize[_0x1563('0x13')],'defaultValue':![]},'email':{'type':Sequelize[_0x1563('0x2')]},'cc':{'type':Sequelize[_0x1563('0x14')]},'bcc':{'type':Sequelize[_0x1563('0x14')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe003=['weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months'];(function(_0x267d29,_0x27f1fe){var _0x4cd7c9=function(_0x4526d4){while(--_0x4526d4){_0x267d29['push'](_0x267d29['shift']());}};_0x4cd7c9(++_0x27f1fe);}(_0xe003,0x1ea));var _0x3e00=function(_0x3c02fb,_0x1f55ff){_0x3c02fb=_0x3c02fb-0x0;var _0x14a55f=_0xe003[_0x3c02fb];return _0x14a55f;};'use strict';var Sequelize=require(_0x3e00('0x0'));module[_0x3e00('0x1')]={'name':{'type':Sequelize[_0x3e00('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3e00('0x2')]},'active':{'type':Sequelize[_0x3e00('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3e00('0x2')],'allowNull':![],'defaultValue':_0x3e00('0x4')},'startAt':{'type':Sequelize[_0x3e00('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3e00('0x6')](_0x3e00('0x7'),_0x3e00('0x8'),_0x3e00('0x9'),_0x3e00('0xa'),_0x3e00('0xb'),_0x3e00('0xc'),_0x3e00('0xd')),'allowNull':![],'defaultValue':_0x3e00('0xb')},'output':{'type':Sequelize[_0x3e00('0x6')](_0x3e00('0xe'),_0x3e00('0xf'),_0x3e00('0x10')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x3e00('0x6')](_0x3e00('0x11'),_0x3e00('0x12')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x3e00('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x3e00('0x13')]},'bcc':{'type':Sequelize[_0x3e00('0x13')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6b5edb8..3a29b97 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 _0x52b0=['set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','rimraf','zip-dir','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x37f12d,_0x431996){var _0x43f0b7=function(_0x50adda){while(--_0x50adda){_0x37f12d['push'](_0x37f12d['shift']());}};_0x43f0b7(++_0x431996);}(_0x52b0,0x89));var _0x052b=function(_0x427350,_0x2d5577){_0x427350=_0x427350-0x0;var _0x529c78=_0x52b0[_0x427350];return _0x529c78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x052b('0x0'));var zipdir=require(_0x052b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x052b('0x2'));var BPromise=require(_0x052b('0x3'));var Mustache=require(_0x052b('0x4'));var util=require(_0x052b('0x5'));var path=require(_0x052b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x052b('0x7'));var _=require(_0x052b('0x8'));var squel=require('squel');var crypto=require(_0x052b('0x9'));var jsforce=require(_0x052b('0xa'));var deskjs=require(_0x052b('0xb'));var toCsv=require(_0x052b('0xc'));var querystring=require(_0x052b('0xd'));var Papa=require(_0x052b('0xe'));var Redis=require(_0x052b('0xf'));var authService=require(_0x052b('0x10'));var qs=require(_0x052b('0x11'));var as=require(_0x052b('0x12'));var hardwareService=require(_0x052b('0x13'));var logger=require(_0x052b('0x14'))(_0x052b('0x15'));var utils=require(_0x052b('0x16'));var config=require(_0x052b('0x17'));var licenseUtil=require(_0x052b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x542543,_0x547aec){_0x547aec=_0x547aec||0xcc;return function(_0xa625f3){if(_0xa625f3){return _0x542543[_0x052b('0x19')](_0x547aec);}return _0x542543[_0x052b('0x1a')](_0x547aec)[_0x052b('0x1b')]();};}function respondWithResult(_0x3a0562,_0x2ea50b){_0x2ea50b=_0x2ea50b||0xc8;return function(_0x2ed467){if(_0x2ed467){return _0x3a0562[_0x052b('0x1a')](_0x2ea50b)[_0x052b('0x1c')](_0x2ed467);}};}function respondWithFilteredResult(_0xe91585,_0x2fa5e6){return function(_0x437839){if(_0x437839){var _0x511c48=typeof _0x2fa5e6['offset']===_0x052b('0x1d')&&typeof _0x2fa5e6[_0x052b('0x1e')]===_0x052b('0x1d');var _0x23ed56=_0x437839[_0x052b('0x1f')];var _0x58e65a=_0x511c48?0x0:_0x2fa5e6['offset'];var _0x2fdb55=_0x511c48?_0x437839[_0x052b('0x1f')]:_0x2fa5e6[_0x052b('0x20')]+_0x2fa5e6['limit'];var _0x544903;if(_0x2fdb55>=_0x23ed56){_0x2fdb55=_0x23ed56;_0x544903=0xc8;}else{_0x544903=0xce;}_0xe91585['status'](_0x544903);return _0xe91585[_0x052b('0x21')](_0x052b('0x22'),_0x58e65a+'-'+_0x2fdb55+'/'+_0x23ed56)[_0x052b('0x1c')](_0x437839);}return null;};}function patchUpdates(_0x594ca8){return function(_0x4b1d09){try{jsonpatch[_0x052b('0x23')](_0x4b1d09,_0x594ca8,!![]);}catch(_0x446ff9){return BPromise['reject'](_0x446ff9);}return _0x4b1d09[_0x052b('0x24')]();};}function saveUpdates(_0x4ffaa6,_0x55efe1){return function(_0x7946a2){if(_0x7946a2){return _0x7946a2[_0x052b('0x25')](_0x4ffaa6)[_0x052b('0x26')](function(_0x14c22a){return _0x14c22a;});}return null;};}function removeEntity(_0x346010,_0xaba0bf){return function(_0x469ab0){if(_0x469ab0){return _0x469ab0[_0x052b('0x27')]()['then'](function(){var _0x382bb9=_0x469ab0[_0x052b('0x28')]({'plain':!![]});var _0x399d4f='Scheduler';return db['UserProfileResource'][_0x052b('0x27')]({'where':{'type':_0x399d4f,'resourceId':_0x382bb9['id']}})[_0x052b('0x26')](function(){return _0x469ab0;});})[_0x052b('0x26')](function(){_0x346010['status'](0xcc)[_0x052b('0x1b')]();});}};}function handleEntityNotFound(_0x39ff44,_0x20e633){return function(_0x182d50){if(!_0x182d50){_0x39ff44[_0x052b('0x19')](0x194);}return _0x182d50;};}function handleError(_0x4f6eb6,_0x1c9e59){_0x1c9e59=_0x1c9e59||0x1f4;return function(_0x12565e){logger[_0x052b('0x29')](_0x12565e[_0x052b('0x2a')]);if(_0x12565e[_0x052b('0x2b')]){delete _0x12565e[_0x052b('0x2b')];}_0x4f6eb6['status'](_0x1c9e59)[_0x052b('0x2c')](_0x12565e);};}exports[_0x052b('0x2d')]=function(_0x1ec3b7,_0x21178e){var _0x21d46c={},_0x2d624f={},_0x14b324={'count':0x0,'rows':[]};var _0x29c557=_[_0x052b('0x2e')](db[_0x052b('0x2f')][_0x052b('0x30')],function(_0x735fcc){return{'name':_0x735fcc[_0x052b('0x31')],'type':_0x735fcc['type'][_0x052b('0x32')]};});_0x2d624f[_0x052b('0x33')]=_[_0x052b('0x2e')](_0x29c557,'name');_0x2d624f[_0x052b('0x34')]=_[_0x052b('0x35')](_0x1ec3b7[_0x052b('0x34')]);_0x2d624f[_0x052b('0x36')]=_['intersection'](_0x2d624f[_0x052b('0x33')],_0x2d624f[_0x052b('0x34')]);_0x21d46c[_0x052b('0x37')]=_[_0x052b('0x38')](_0x2d624f[_0x052b('0x33')],qs[_0x052b('0x39')](_0x1ec3b7[_0x052b('0x34')][_0x052b('0x39')]));_0x21d46c[_0x052b('0x37')]=_0x21d46c[_0x052b('0x37')][_0x052b('0x3a')]?_0x21d46c[_0x052b('0x37')]:_0x2d624f[_0x052b('0x33')];if(!_0x1ec3b7['query'][_0x052b('0x3b')](_0x052b('0x3c'))){_0x21d46c[_0x052b('0x1e')]=qs[_0x052b('0x1e')](_0x1ec3b7[_0x052b('0x34')]['limit']);_0x21d46c[_0x052b('0x20')]=qs[_0x052b('0x20')](_0x1ec3b7['query'][_0x052b('0x20')]);}_0x21d46c[_0x052b('0x3d')]=qs['sort'](_0x1ec3b7['query'][_0x052b('0x3e')]);_0x21d46c[_0x052b('0x3f')]=qs[_0x052b('0x36')](_['pick'](_0x1ec3b7[_0x052b('0x34')],_0x2d624f['filters']),_0x29c557);if(_0x1ec3b7['query'][_0x052b('0x40')]){_0x21d46c[_0x052b('0x3f')]=_['merge'](_0x21d46c[_0x052b('0x3f')],{'$or':_['map'](_0x29c557,function(_0x470ea6){if(_0x470ea6[_0x052b('0x41')]!==_0x052b('0x42')){var _0x1b4e7a={};_0x1b4e7a[_0x470ea6['name']]={'$like':'%'+_0x1ec3b7['query'][_0x052b('0x40')]+'%'};return _0x1b4e7a;}})});}_0x21d46c=_[_0x052b('0x43')]({},_0x21d46c,_0x1ec3b7[_0x052b('0x44')]);var _0x4c0d05={'where':_0x21d46c['where']};return db[_0x052b('0x2f')][_0x052b('0x1f')](_0x4c0d05)['then'](function(_0x34397c){_0x14b324[_0x052b('0x1f')]=_0x34397c;if(_0x1ec3b7['query'][_0x052b('0x45')]){_0x21d46c[_0x052b('0x46')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x21d46c);})[_0x052b('0x26')](function(_0x1b012e){_0x14b324['rows']=_0x1b012e;return _0x14b324;})['then'](respondWithFilteredResult(_0x21178e,_0x21d46c))[_0x052b('0x47')](handleError(_0x21178e,null));};exports[_0x052b('0x48')]=function(_0x2b8b7c,_0x52cb0b){var _0x212052={'raw':![],'where':{'id':_0x2b8b7c[_0x052b('0x49')]['id']}},_0x21e088={};_0x21e088['model']=_[_0x052b('0x35')](db[_0x052b('0x2f')][_0x052b('0x30')]);_0x21e088[_0x052b('0x34')]=_[_0x052b('0x35')](_0x2b8b7c[_0x052b('0x34')]);_0x21e088[_0x052b('0x36')]=_[_0x052b('0x38')](_0x21e088[_0x052b('0x33')],_0x21e088[_0x052b('0x34')]);_0x212052[_0x052b('0x37')]=_[_0x052b('0x38')](_0x21e088[_0x052b('0x33')],qs['fields'](_0x2b8b7c[_0x052b('0x34')]['fields']));_0x212052['attributes']=_0x212052[_0x052b('0x37')][_0x052b('0x3a')]?_0x212052[_0x052b('0x37')]:_0x21e088['model'];if(_0x2b8b7c['query'][_0x052b('0x45')]){_0x212052[_0x052b('0x46')]=[{'all':!![]}];}_0x212052=_['merge']({},_0x212052,_0x2b8b7c[_0x052b('0x44')]);return db[_0x052b('0x2f')][_0x052b('0x4a')](_0x212052)[_0x052b('0x26')](handleEntityNotFound(_0x52cb0b,null))['then'](respondWithResult(_0x52cb0b,null))[_0x052b('0x47')](handleError(_0x52cb0b,null));};exports[_0x052b('0x4b')]=function(_0x19d011,_0x9f5b69){return db['Schedule'][_0x052b('0x4b')](_0x19d011[_0x052b('0x4c')],{})['then'](function(_0x3628ad){var _0x4a9ac6=_0x19d011[_0x052b('0x4d')][_0x052b('0x28')]({'plain':!![]});if(!_0x4a9ac6)throw new Error(_0x052b('0x4e'));if(_0x4a9ac6[_0x052b('0x4f')]==='user'){var _0x4e44fb=_0x3628ad[_0x052b('0x28')]({'plain':!![]});var _0x3f2c2a=_0x052b('0x50');return db[_0x052b('0x51')][_0x052b('0x4a')]({'where':{'name':_0x3f2c2a,'userProfileId':_0x4a9ac6['userProfileId']},'raw':!![]})[_0x052b('0x26')](function(_0x43a944){if(_0x43a944&&_0x43a944[_0x052b('0x52')]===0x0){return db['UserProfileResource'][_0x052b('0x4b')]({'name':_0x4e44fb['name'],'resourceId':_0x4e44fb['id'],'type':_0x43a944[_0x052b('0x2b')],'sectionId':_0x43a944['id']},{})[_0x052b('0x26')](function(){return _0x3628ad;});}else{return _0x3628ad;}})[_0x052b('0x47')](function(_0x545126){logger[_0x052b('0x29')](_0x052b('0x53'),_0x545126);throw _0x545126;});}return _0x3628ad;})[_0x052b('0x26')](respondWithResult(_0x9f5b69,0xc9))[_0x052b('0x47')](handleError(_0x9f5b69,null));};exports[_0x052b('0x25')]=function(_0x305dce,_0x45ccb5){if(_0x305dce[_0x052b('0x4c')]['id']){delete _0x305dce[_0x052b('0x4c')]['id'];}return db[_0x052b('0x2f')][_0x052b('0x4a')]({'where':{'id':_0x305dce[_0x052b('0x49')]['id']}})['then'](handleEntityNotFound(_0x45ccb5,null))['then'](saveUpdates(_0x305dce[_0x052b('0x4c')],null))['then'](respondWithResult(_0x45ccb5,null))[_0x052b('0x47')](handleError(_0x45ccb5,null));};exports['destroy']=function(_0x59ad26,_0xc85468){return db[_0x052b('0x2f')][_0x052b('0x4a')]({'where':{'id':_0x59ad26[_0x052b('0x49')]['id']}})[_0x052b('0x26')](handleEntityNotFound(_0xc85468,null))[_0x052b('0x26')](removeEntity(_0xc85468,null))[_0x052b('0x47')](handleError(_0xc85468,null));};exports[_0x052b('0x54')]=function(_0x4f6e91,_0x1ae78f,_0x3ac969){var _0x2c0baa=require('../../config/schedule');return db[_0x052b('0x2f')][_0x052b('0x4a')]({'where':{'id':_0x4f6e91[_0x052b('0x49')]['id']},'raw':!![]})[_0x052b('0x26')](handleEntityNotFound(_0x1ae78f,null))[_0x052b('0x26')](function(){_0x2c0baa['run'](_0x4f6e91[_0x052b('0x49')]['id']);})[_0x052b('0x26')](respondWithStatusCode(_0x1ae78f,null))[_0x052b('0x47')](handleError(_0x1ae78f,null));}; \ No newline at end of file +var _0x94cb=['count','status','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','send','index','map','Schedule','rawAttributes','fieldName','type','name','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','find','run','../../config/schedule','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','offset','undefined','limit'];(function(_0x116309,_0x5bd0f4){var _0x2ac01f=function(_0x29c3f9){while(--_0x29c3f9){_0x116309['push'](_0x116309['shift']());}};_0x2ac01f(++_0x5bd0f4);}(_0x94cb,0x86));var _0xb94c=function(_0x5001a4,_0x40c316){_0x5001a4=_0x5001a4-0x0;var _0x58aa97=_0x94cb[_0x5001a4];return _0x58aa97;};'use strict';var emlformat=require(_0xb94c('0x0'));var rimraf=require(_0xb94c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb94c('0x2'));var rp=require('request-promise');var moment=require(_0xb94c('0x3'));var BPromise=require(_0xb94c('0x4'));var Mustache=require(_0xb94c('0x5'));var util=require(_0xb94c('0x6'));var path=require(_0xb94c('0x7'));var sox=require(_0xb94c('0x8'));var csv=require(_0xb94c('0x9'));var ejs=require(_0xb94c('0xa'));var fs=require('fs');var fs_extra=require(_0xb94c('0xb'));var _=require(_0xb94c('0xc'));var squel=require(_0xb94c('0xd'));var crypto=require('crypto');var jsforce=require(_0xb94c('0xe'));var deskjs=require(_0xb94c('0xf'));var toCsv=require(_0xb94c('0x9'));var querystring=require('querystring');var Papa=require(_0xb94c('0x10'));var Redis=require('ioredis');var authService=require(_0xb94c('0x11'));var qs=require(_0xb94c('0x12'));var as=require(_0xb94c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb94c('0x14'))(_0xb94c('0x15'));var utils=require(_0xb94c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xde3881,_0x48750b){_0x48750b=_0x48750b||0xcc;return function(_0x48d794){if(_0x48d794){return _0xde3881[_0xb94c('0x17')](_0x48750b);}return _0xde3881['status'](_0x48750b)[_0xb94c('0x18')]();};}function respondWithResult(_0x22e373,_0x39697d){_0x39697d=_0x39697d||0xc8;return function(_0x5d4a44){if(_0x5d4a44){return _0x22e373['status'](_0x39697d)['json'](_0x5d4a44);}};}function respondWithFilteredResult(_0x501b69,_0x185d2a){return function(_0x37f8e5){if(_0x37f8e5){var _0x206fc7=typeof _0x185d2a[_0xb94c('0x19')]===_0xb94c('0x1a')&&typeof _0x185d2a[_0xb94c('0x1b')]===_0xb94c('0x1a');var _0x16f4e4=_0x37f8e5['count'];var _0x48f48b=_0x206fc7?0x0:_0x185d2a[_0xb94c('0x19')];var _0x304827=_0x206fc7?_0x37f8e5[_0xb94c('0x1c')]:_0x185d2a[_0xb94c('0x19')]+_0x185d2a[_0xb94c('0x1b')];var _0xd4c522;if(_0x304827>=_0x16f4e4){_0x304827=_0x16f4e4;_0xd4c522=0xc8;}else{_0xd4c522=0xce;}_0x501b69[_0xb94c('0x1d')](_0xd4c522);return _0x501b69['set'](_0xb94c('0x1e'),_0x48f48b+'-'+_0x304827+'/'+_0x16f4e4)['json'](_0x37f8e5);}return null;};}function patchUpdates(_0x230616){return function(_0xa2289f){try{jsonpatch[_0xb94c('0x1f')](_0xa2289f,_0x230616,!![]);}catch(_0x1a5162){return BPromise[_0xb94c('0x20')](_0x1a5162);}return _0xa2289f[_0xb94c('0x21')]();};}function saveUpdates(_0x1021ce,_0x5350da){return function(_0x193266){if(_0x193266){return _0x193266[_0xb94c('0x22')](_0x1021ce)[_0xb94c('0x23')](function(_0x2c5c76){return _0x2c5c76;});}return null;};}function removeEntity(_0x306010,_0xb5793d){return function(_0x392ea8){if(_0x392ea8){return _0x392ea8[_0xb94c('0x24')]()['then'](function(){var _0x48b1fe=_0x392ea8[_0xb94c('0x25')]({'plain':!![]});var _0xc6e652=_0xb94c('0x26');return db[_0xb94c('0x27')]['destroy']({'where':{'type':_0xc6e652,'resourceId':_0x48b1fe['id']}})[_0xb94c('0x23')](function(){return _0x392ea8;});})[_0xb94c('0x23')](function(){_0x306010[_0xb94c('0x1d')](0xcc)[_0xb94c('0x18')]();});}};}function handleEntityNotFound(_0x3e11cd,_0xb95b32){return function(_0x3e4ae7){if(!_0x3e4ae7){_0x3e11cd[_0xb94c('0x17')](0x194);}return _0x3e4ae7;};}function handleError(_0x1a8329,_0x1d919b){_0x1d919b=_0x1d919b||0x1f4;return function(_0xcb1a4b){logger[_0xb94c('0x28')](_0xcb1a4b[_0xb94c('0x29')]);if(_0xcb1a4b['name']){delete _0xcb1a4b['name'];}_0x1a8329[_0xb94c('0x1d')](_0x1d919b)[_0xb94c('0x2a')](_0xcb1a4b);};}exports[_0xb94c('0x2b')]=function(_0x4cd501,_0x370398){var _0x3cf8ea={},_0x161bad={},_0x18462e={'count':0x0,'rows':[]};var _0x164f3f=_[_0xb94c('0x2c')](db[_0xb94c('0x2d')][_0xb94c('0x2e')],function(_0x129445){return{'name':_0x129445[_0xb94c('0x2f')],'type':_0x129445[_0xb94c('0x30')]['key']};});_0x161bad['model']=_['map'](_0x164f3f,_0xb94c('0x31'));_0x161bad[_0xb94c('0x32')]=_[_0xb94c('0x33')](_0x4cd501[_0xb94c('0x32')]);_0x161bad['filters']=_[_0xb94c('0x34')](_0x161bad[_0xb94c('0x35')],_0x161bad[_0xb94c('0x32')]);_0x3cf8ea[_0xb94c('0x36')]=_[_0xb94c('0x34')](_0x161bad[_0xb94c('0x35')],qs[_0xb94c('0x37')](_0x4cd501[_0xb94c('0x32')][_0xb94c('0x37')]));_0x3cf8ea[_0xb94c('0x36')]=_0x3cf8ea[_0xb94c('0x36')][_0xb94c('0x38')]?_0x3cf8ea['attributes']:_0x161bad[_0xb94c('0x35')];if(!_0x4cd501[_0xb94c('0x32')]['hasOwnProperty']('nolimit')){_0x3cf8ea[_0xb94c('0x1b')]=qs[_0xb94c('0x1b')](_0x4cd501[_0xb94c('0x32')][_0xb94c('0x1b')]);_0x3cf8ea['offset']=qs[_0xb94c('0x19')](_0x4cd501['query'][_0xb94c('0x19')]);}_0x3cf8ea[_0xb94c('0x39')]=qs['sort'](_0x4cd501[_0xb94c('0x32')][_0xb94c('0x3a')]);_0x3cf8ea[_0xb94c('0x3b')]=qs[_0xb94c('0x3c')](_[_0xb94c('0x3d')](_0x4cd501['query'],_0x161bad[_0xb94c('0x3c')]),_0x164f3f);if(_0x4cd501['query'][_0xb94c('0x3e')]){_0x3cf8ea[_0xb94c('0x3b')]=_['merge'](_0x3cf8ea[_0xb94c('0x3b')],{'$or':_['map'](_0x164f3f,function(_0x1abc48){if(_0x1abc48[_0xb94c('0x30')]!=='VIRTUAL'){var _0x78c195={};_0x78c195[_0x1abc48[_0xb94c('0x31')]]={'$like':'%'+_0x4cd501['query'][_0xb94c('0x3e')]+'%'};return _0x78c195;}})});}_0x3cf8ea=_[_0xb94c('0x3f')]({},_0x3cf8ea,_0x4cd501[_0xb94c('0x40')]);var _0x59d613={'where':_0x3cf8ea['where']};return db[_0xb94c('0x2d')][_0xb94c('0x1c')](_0x59d613)[_0xb94c('0x23')](function(_0x3d91db){_0x18462e[_0xb94c('0x1c')]=_0x3d91db;if(_0x4cd501['query'][_0xb94c('0x41')]){_0x3cf8ea[_0xb94c('0x42')]=[{'all':!![]}];}return db[_0xb94c('0x2d')]['findAll'](_0x3cf8ea);})[_0xb94c('0x23')](function(_0x5de6b3){_0x18462e[_0xb94c('0x43')]=_0x5de6b3;return _0x18462e;})['then'](respondWithFilteredResult(_0x370398,_0x3cf8ea))[_0xb94c('0x44')](handleError(_0x370398,null));};exports[_0xb94c('0x45')]=function(_0x2ab049,_0x2c1ece){var _0x3a7b18={'raw':![],'where':{'id':_0x2ab049[_0xb94c('0x46')]['id']}},_0x4639bf={};_0x4639bf[_0xb94c('0x35')]=_[_0xb94c('0x33')](db[_0xb94c('0x2d')][_0xb94c('0x2e')]);_0x4639bf['query']=_[_0xb94c('0x33')](_0x2ab049[_0xb94c('0x32')]);_0x4639bf[_0xb94c('0x3c')]=_[_0xb94c('0x34')](_0x4639bf['model'],_0x4639bf[_0xb94c('0x32')]);_0x3a7b18['attributes']=_[_0xb94c('0x34')](_0x4639bf['model'],qs[_0xb94c('0x37')](_0x2ab049[_0xb94c('0x32')][_0xb94c('0x37')]));_0x3a7b18[_0xb94c('0x36')]=_0x3a7b18[_0xb94c('0x36')][_0xb94c('0x38')]?_0x3a7b18[_0xb94c('0x36')]:_0x4639bf['model'];if(_0x2ab049[_0xb94c('0x32')]['includeAll']){_0x3a7b18[_0xb94c('0x42')]=[{'all':!![]}];}_0x3a7b18=_['merge']({},_0x3a7b18,_0x2ab049['options']);return db[_0xb94c('0x2d')]['find'](_0x3a7b18)[_0xb94c('0x23')](handleEntityNotFound(_0x2c1ece,null))['then'](respondWithResult(_0x2c1ece,null))[_0xb94c('0x44')](handleError(_0x2c1ece,null));};exports[_0xb94c('0x47')]=function(_0xc014fa,_0x2bc986){return db['Schedule'][_0xb94c('0x47')](_0xc014fa[_0xb94c('0x48')],{})[_0xb94c('0x23')](function(_0x481b0f){var _0xbe0c71=_0xc014fa[_0xb94c('0x49')][_0xb94c('0x25')]({'plain':!![]});if(!_0xbe0c71)throw new Error(_0xb94c('0x4a'));if(_0xbe0c71[_0xb94c('0x4b')]==='user'){var _0x205b86=_0x481b0f['get']({'plain':!![]});var _0x63c71c=_0xb94c('0x26');return db[_0xb94c('0x4c')]['find']({'where':{'name':_0x63c71c,'userProfileId':_0xbe0c71['userProfileId']},'raw':!![]})[_0xb94c('0x23')](function(_0x36964d){if(_0x36964d&&_0x36964d[_0xb94c('0x4d')]===0x0){return db[_0xb94c('0x27')][_0xb94c('0x47')]({'name':_0x205b86[_0xb94c('0x31')],'resourceId':_0x205b86['id'],'type':_0x36964d[_0xb94c('0x31')],'sectionId':_0x36964d['id']},{})['then'](function(){return _0x481b0f;});}else{return _0x481b0f;}})[_0xb94c('0x44')](function(_0x4f966a){logger[_0xb94c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f966a);throw _0x4f966a;});}return _0x481b0f;})[_0xb94c('0x23')](respondWithResult(_0x2bc986,0xc9))['catch'](handleError(_0x2bc986,null));};exports[_0xb94c('0x22')]=function(_0x45bf01,_0x1a35cb){if(_0x45bf01['body']['id']){delete _0x45bf01[_0xb94c('0x48')]['id'];}return db['Schedule'][_0xb94c('0x4e')]({'where':{'id':_0x45bf01[_0xb94c('0x46')]['id']}})[_0xb94c('0x23')](handleEntityNotFound(_0x1a35cb,null))[_0xb94c('0x23')](saveUpdates(_0x45bf01[_0xb94c('0x48')],null))[_0xb94c('0x23')](respondWithResult(_0x1a35cb,null))[_0xb94c('0x44')](handleError(_0x1a35cb,null));};exports[_0xb94c('0x24')]=function(_0x198d90,_0x5ece23){return db['Schedule'][_0xb94c('0x4e')]({'where':{'id':_0x198d90[_0xb94c('0x46')]['id']}})[_0xb94c('0x23')](handleEntityNotFound(_0x5ece23,null))[_0xb94c('0x23')](removeEntity(_0x5ece23,null))['catch'](handleError(_0x5ece23,null));};exports[_0xb94c('0x4f')]=function(_0x4c2cc5,_0x385df9,_0x533a24){var _0x110f59=require(_0xb94c('0x50'));return db[_0xb94c('0x2d')]['find']({'where':{'id':_0x4c2cc5[_0xb94c('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x385df9,null))[_0xb94c('0x23')](function(){_0x110f59['run'](_0x4c2cc5['params']['id']);})[_0xb94c('0x23')](respondWithStatusCode(_0x385df9,null))[_0xb94c('0x44')](handleError(_0x385df9,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 07d7a8b..636bec4 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 _0x8cb6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0xb5926,_0x470b9e){var _0x5d1a18=function(_0x37afc1){while(--_0x37afc1){_0xb5926['push'](_0xb5926['shift']());}};_0x5d1a18(++_0x470b9e);}(_0x8cb6,0x1a4));var _0x68cb=function(_0x5832be,_0x382b95){_0x5832be=_0x5832be-0x0;var _0x5d0088=_0x8cb6[_0x5832be];return _0x5d0088;};'use strict';var _=require(_0x68cb('0x0'));var util=require(_0x68cb('0x1'));var logger=require(_0x68cb('0x2'))(_0x68cb('0x3'));var moment=require(_0x68cb('0x4'));var BPromise=require(_0x68cb('0x5'));var rp=require(_0x68cb('0x6'));var fs=require('fs');var path=require(_0x68cb('0x7'));var rimraf=require(_0x68cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x68cb('0x9'));module[_0x68cb('0xa')]=function(_0x1afc79,_0x1219c2){return _0x1afc79[_0x68cb('0xb')](_0x68cb('0xc'),attributes,{'tableName':_0x68cb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72c9=['path','./schedule.attributes','exports','define','Schedule','lodash','util','request-promise'];(function(_0x43b849,_0x1fccf4){var _0x5e4d44=function(_0x2f3c76){while(--_0x2f3c76){_0x43b849['push'](_0x43b849['shift']());}};_0x5e4d44(++_0x1fccf4);}(_0x72c9,0x6d));var _0x972c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x972c('0x0'));var util=require(_0x972c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x972c('0x2'));var fs=require('fs');var path=require(_0x972c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x972c('0x4'));module[_0x972c('0x5')]=function(_0xa1b6cc,_0x56abc2){return _0xa1b6cc[_0x972c('0x6')](_0x972c('0x7'),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 e3b50af..91b4cae 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 _0xe1ca=['info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x229b99,_0xb6a166){var _0x13e10c=function(_0x166e54){while(--_0x166e54){_0x229b99['push'](_0x229b99['shift']());}};_0x13e10c(++_0xb6a166);}(_0xe1ca,0x9d));var _0xae1c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1ca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xae1c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xae1c('0x1'));var rs=require(_0xae1c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae1c('0x3'));var logger=require(_0xae1c('0x4'))('rpc');var config=require(_0xae1c('0x5'));var jayson=require(_0xae1c('0x6'));var client=jayson[_0xae1c('0x7')][_0xae1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1596ac,_0x5a46c2,_0x1c9bfd){return new BPromise(function(_0x5581ce,_0x1230b7){return client[_0xae1c('0x9')](_0x1596ac,_0x1c9bfd)[_0xae1c('0xa')](function(_0x41bbc8){logger[_0xae1c('0xb')]('Schedule,\x20%s,\x20%s',_0x5a46c2,_0xae1c('0xc'));logger[_0xae1c('0xd')](_0xae1c('0xe'),_0x5a46c2,_0xae1c('0xc'),JSON[_0xae1c('0xf')](_0x41bbc8));if(_0x41bbc8[_0xae1c('0x10')]){if(_0x41bbc8[_0xae1c('0x10')]['code']===0x1f4){logger[_0xae1c('0x10')](_0xae1c('0x11'),_0x5a46c2,_0x41bbc8[_0xae1c('0x10')][_0xae1c('0x12')]);return _0x1230b7(_0x41bbc8[_0xae1c('0x10')][_0xae1c('0x12')]);}logger[_0xae1c('0x10')](_0xae1c('0x11'),_0x5a46c2,_0x41bbc8[_0xae1c('0x10')][_0xae1c('0x12')]);return _0x5581ce(_0x41bbc8[_0xae1c('0x10')][_0xae1c('0x12')]);}else{logger[_0xae1c('0xb')](_0xae1c('0x11'),_0x5a46c2,_0xae1c('0xc'));_0x5581ce(_0x41bbc8[_0xae1c('0x13')][_0xae1c('0x12')]);}})[_0xae1c('0x14')](function(_0x3a7af2){logger['error'](_0xae1c('0x11'),_0x5a46c2,_0x3a7af2);_0x1230b7(_0x3a7af2);});});} \ No newline at end of file +var _0x121b=['../../config/logger','rpc','jayson/promise','http','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xefb4e,_0xe56689){var _0x36c78c=function(_0x158fe3){while(--_0x158fe3){_0xefb4e['push'](_0xefb4e['shift']());}};_0x36c78c(++_0xe56689);}(_0x121b,0x8d));var _0xb121=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x121b[_0x30a31e];return _0x170879;};'use strict';var _=require(_0xb121('0x0'));var util=require(_0xb121('0x1'));var moment=require('moment');var BPromise=require(_0xb121('0x2'));var rs=require(_0xb121('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb121('0x4'))['db'];var utils=require(_0xb121('0x5'));var logger=require(_0xb121('0x6'))(_0xb121('0x7'));var config=require('../../config/environment');var jayson=require(_0xb121('0x8'));var client=jayson['client'][_0xb121('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf842,_0x1d6427,_0x4316b3){return new BPromise(function(_0xff7e63,_0x5e76ed){return client['request'](_0x3bf842,_0x4316b3)['then'](function(_0x54315b){logger['info']('Schedule,\x20%s,\x20%s',_0x1d6427,_0xb121('0xa'));logger[_0xb121('0xb')](_0xb121('0xc'),_0x1d6427,'request\x20sent',JSON[_0xb121('0xd')](_0x54315b));if(_0x54315b[_0xb121('0xe')]){if(_0x54315b[_0xb121('0xe')][_0xb121('0xf')]===0x1f4){logger[_0xb121('0xe')](_0xb121('0x10'),_0x1d6427,_0x54315b['error'][_0xb121('0x11')]);return _0x5e76ed(_0x54315b['error'][_0xb121('0x11')]);}logger[_0xb121('0xe')](_0xb121('0x10'),_0x1d6427,_0x54315b['error'][_0xb121('0x11')]);return _0xff7e63(_0x54315b[_0xb121('0xe')][_0xb121('0x11')]);}else{logger[_0xb121('0x12')](_0xb121('0x10'),_0x1d6427,'request\x20sent');_0xff7e63(_0x54315b[_0xb121('0x13')]['message']);}})[_0xb121('0x14')](function(_0x243c3f){logger[_0xb121('0xe')](_0xb121('0x10'),_0x1d6427,_0x243c3f);_0x5e76ed(_0x243c3f);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ca0bb56..0168b81 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 _0xea0e=['../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0xea0e,0xf7));var _0xeea0=function(_0x1de340,_0x566300){_0x1de340=_0x1de340-0x0;var _0x1ff29e=_0xea0e[_0x1de340];return _0x1ff29e;};'use strict';var multer=require(_0xeea0('0x0'));var util=require(_0xeea0('0x1'));var path=require(_0xeea0('0x2'));var timeout=require(_0xeea0('0x3'));var express=require('express');var router=express[_0xeea0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xeea0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeea0('0x6'));var controller=require(_0xeea0('0x7'));router[_0xeea0('0x8')]('/',auth[_0xeea0('0x9')](),controller[_0xeea0('0xa')]);router[_0xeea0('0x8')](_0xeea0('0xb'),auth[_0xeea0('0x9')](),controller[_0xeea0('0xc')]);router[_0xeea0('0x8')]('/:id',auth[_0xeea0('0x9')](),controller[_0xeea0('0xd')]);router['get'](_0xeea0('0xe'),auth[_0xeea0('0x9')](),controller[_0xeea0('0xf')]);router[_0xeea0('0x10')]('/',auth[_0xeea0('0x9')](),controller[_0xeea0('0x11')]);router['put'](_0xeea0('0x12'),auth[_0xeea0('0x9')](),controller[_0xeea0('0x13')]);router[_0xeea0('0x14')](_0xeea0('0x12'),auth[_0xeea0('0x9')](),controller[_0xeea0('0x15')]);module[_0xeea0('0x16')]=router; \ No newline at end of file +var _0x072e=['show','/:id/download','download','post','create','put','update','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','index','get','describe','isAuthenticated'];(function(_0x4a5642,_0x18c3f9){var _0x4ecc72=function(_0x589939){while(--_0x589939){_0x4a5642['push'](_0x4a5642['shift']());}};_0x4ecc72(++_0x18c3f9);}(_0x072e,0x1c4));var _0xe072=function(_0x4a3dfd,_0x503f71){_0x4a3dfd=_0x4a3dfd-0x0;var _0xe85690=_0x072e[_0x4a3dfd];return _0xe85690;};'use strict';var multer=require(_0xe072('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe072('0x1'));var express=require(_0xe072('0x2'));var router=express[_0xe072('0x3')]();var fs_extra=require(_0xe072('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe072('0x5'));var controller=require('./screenRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe072('0x6')]);router[_0xe072('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xe072('0x8')]);router[_0xe072('0x7')]('/:id',auth[_0xe072('0x9')](),controller[_0xe072('0xa')]);router[_0xe072('0x7')](_0xe072('0xb'),auth[_0xe072('0x9')](),controller[_0xe072('0xc')]);router[_0xe072('0xd')]('/',auth[_0xe072('0x9')](),controller[_0xe072('0xe')]);router[_0xe072('0xf')]('/:id',auth[_0xe072('0x9')](),controller[_0xe072('0x10')]);router[_0xe072('0x11')](_0xe072('0x12'),auth[_0xe072('0x9')](),controller[_0xe072('0x13')]);module[_0xe072('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 362214c..5548951 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 _0xab54=['setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','value','STRING','replace'];(function(_0x321ccf,_0x2e780d){var _0x3a9a2a=function(_0x3291c2){while(--_0x3291c2){_0x321ccf['push'](_0x321ccf['shift']());}};_0x3a9a2a(++_0x2e780d);}(_0xab54,0x115));var _0x4ab5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab54[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4ab5('0x0'));var path=require(_0x4ab5('0x1'));var config=require(_0x4ab5('0x2'));module[_0x4ab5('0x3')]={'format':{'type':Sequelize[_0x4ab5('0x4')],'get':function(){return this['getDataValue'](_0x4ab5('0x5'))?path['extname'](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x4ab5('0x6')]},'channel':{'type':Sequelize[_0x4ab5('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x2c39fe){var _0x5c8c61=_0x2c39fe[_0x4ab5('0x7')](/\\/g,'/');this[_0x4ab5('0x8')](_0x4ab5('0x5'),_0x5c8c61);}},'rating':{'type':Sequelize[_0x4ab5('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x58e6a7){this['setDataValue'](_0x4ab5('0xa'),moment()[_0x4ab5('0xb')](_0x58e6a7,'ms'));this['setDataValue'](_0x4ab5('0xc'),moment());this[_0x4ab5('0x8')]('duration',_0x58e6a7);}},'startedAt':{'type':Sequelize[_0x4ab5('0xd')],'get':function(){return moment(this[_0x4ab5('0xe')](_0x4ab5('0xa')))[_0x4ab5('0xf')](_0x4ab5('0x10'))[_0x4ab5('0x11')]();}},'closedAt':{'type':Sequelize[_0x4ab5('0xd')],'get':function(){return moment(this[_0x4ab5('0xe')](_0x4ab5('0xc')))[_0x4ab5('0xf')](_0x4ab5('0x10'))[_0x4ab5('0x11')]();}},'createdAt':{'type':Sequelize[_0x4ab5('0xd')],'get':function(){return moment(this[_0x4ab5('0xe')]('createdAt'))[_0x4ab5('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x4ab5('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x4ab5('0x12')))[_0x4ab5('0xf')](_0x4ab5('0x10'))[_0x4ab5('0x11')]();}}}; \ No newline at end of file +var _0xd232=['setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','STRING','replace','value','INTEGER'];(function(_0x5edce3,_0x58b01b){var _0x255295=function(_0x5c3ad8){while(--_0x5c3ad8){_0x5edce3['push'](_0x5edce3['shift']());}};_0x255295(++_0x58b01b);}(_0xd232,0x74));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2d23('0x0'));var moment=require('moment');var path=require(_0x2d23('0x1'));var config=require(_0x2d23('0x2'));module[_0x2d23('0x3')]={'format':{'type':Sequelize[_0x2d23('0x4')],'get':function(){return this[_0x2d23('0x5')]('value')?path['extname'](this[_0x2d23('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2d23('0x6')]},'value':{'type':Sequelize[_0x2d23('0x6')],'set':function(_0x15c735){var _0x53ac18=_0x15c735[_0x2d23('0x7')](/\\/g,'/');this['setDataValue'](_0x2d23('0x8'),_0x53ac18);}},'rating':{'type':Sequelize[_0x2d23('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2d23('0x9')],'set':function(_0x7847cb){this[_0x2d23('0xa')](_0x2d23('0xb'),moment()[_0x2d23('0xc')](_0x7847cb,'ms'));this['setDataValue'](_0x2d23('0xd'),moment());this[_0x2d23('0xa')](_0x2d23('0xe'),_0x7847cb);}},'startedAt':{'type':Sequelize[_0x2d23('0xf')],'get':function(){return moment(this[_0x2d23('0x5')](_0x2d23('0xb')))[_0x2d23('0x10')](_0x2d23('0x11'))[_0x2d23('0x12')]();}},'closedAt':{'type':Sequelize[_0x2d23('0xf')],'get':function(){return moment(this[_0x2d23('0x5')](_0x2d23('0xd')))['format'](_0x2d23('0x11'))[_0x2d23('0x12')]();}},'createdAt':{'type':Sequelize[_0x2d23('0xf')],'get':function(){return moment(this[_0x2d23('0x5')](_0x2d23('0x13')))['format'](_0x2d23('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x2d23('0xf')],'get':function(){return moment(this['getDataValue'](_0x2d23('0x14')))[_0x2d23('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 7386894..542fca1 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 _0xd0bb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x1d1da3,_0x387863){_0x1d1da3=_0x1d1da3-0x0;var _0x4ea3b1=_0xd0bb[_0x1d1da3];return _0x4ea3b1;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(!_0x4fe9ed){_0xfd9f82[_0xbd0b('0x17')](0x194);}return _0x4fe9ed;};}function handleError(_0x1b46a3,_0x33b752){_0x33b752=_0x33b752||0x1f4;return function(_0x1b5a00){logger[_0xbd0b('0x26')](_0x1b5a00[_0xbd0b('0x27')]);if(_0x1b5a00['name']){delete _0x1b5a00[_0xbd0b('0x28')];}_0x1b46a3[_0xbd0b('0x18')](_0x33b752)[_0xbd0b('0x29')](_0x1b5a00);};}exports['index']=function(_0x4dfe76,_0x2187a5){var _0x684b09={},_0x14e5a3={},_0xf4ba04={'count':0x0,'rows':[]};var _0x4e2149=_[_0xbd0b('0x2a')](db[_0xbd0b('0x2b')]['rawAttributes'],function(_0x45f7d6){return{'name':_0x45f7d6[_0xbd0b('0x2c')],'type':_0x45f7d6['type']['key']};});_0x14e5a3[_0xbd0b('0x2d')]=_[_0xbd0b('0x2e')](_['map'](_0x4e2149,_0xbd0b('0x28')),[_0xbd0b('0x2f')]);_0x14e5a3[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x4dfe76[_0xbd0b('0x30')]);_0x14e5a3[_0xbd0b('0x32')]=_['intersection'](_0x14e5a3[_0xbd0b('0x2d')],_0x14e5a3[_0xbd0b('0x30')]);_0x684b09[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x14e5a3[_0xbd0b('0x2d')],qs[_0xbd0b('0x35')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x684b09[_0xbd0b('0x33')]=_0x684b09[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x684b09[_0xbd0b('0x33')]:_0x14e5a3[_0xbd0b('0x2d')];if(!_0x4dfe76[_0xbd0b('0x30')]['hasOwnProperty'](_0xbd0b('0x37'))){_0x684b09[_0xbd0b('0x1d')]=qs['limit'](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1d')]);_0x684b09[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1a')]);}_0x684b09['order']=qs[_0xbd0b('0x38')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x38')]);_0x684b09[_0xbd0b('0x39')]=qs[_0xbd0b('0x32')](_['pick'](_0x4dfe76['query'],_0x14e5a3[_0xbd0b('0x32')]),_0x4e2149);if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]){_0x684b09[_0xbd0b('0x39')]=_['merge'](_0x684b09['where'],{'$or':_[_0xbd0b('0x2a')](_0x4e2149,function(_0x4d8237){if(_0x4d8237[_0xbd0b('0x3b')]!==_0xbd0b('0x3c')){var _0x3f34dc={};_0x3f34dc[_0x4d8237[_0xbd0b('0x28')]]={'$like':'%'+_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]+'%'};return _0x3f34dc;}})});}_0x684b09=_[_0xbd0b('0x3d')]({},_0x684b09,_0x4dfe76[_0xbd0b('0x3e')]);var _0x2acc9f={'where':_0x684b09[_0xbd0b('0x39')]};return db[_0xbd0b('0x2b')][_0xbd0b('0x1c')](_0x2acc9f)[_0xbd0b('0x24')](function(_0x425c8a){_0xf4ba04[_0xbd0b('0x1c')]=_0x425c8a;if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x684b09[_0xbd0b('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xbd0b('0x41')](_0x684b09);})[_0xbd0b('0x24')](function(_0x89b5ea){_0xf4ba04[_0xbd0b('0x42')]=_0x89b5ea;return _0xf4ba04;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x2187a5,_0x684b09))[_0xbd0b('0x43')](handleError(_0x2187a5,null));};exports[_0xbd0b('0x44')]=function(_0x1b4497,_0x2a1a1d){var _0x4d72f={'raw':![],'where':{'id':_0x1b4497[_0xbd0b('0x45')]['id']}},_0xa252a2={};_0xa252a2['model']=_[_0xbd0b('0x31')](db['ScreenRecording']['rawAttributes']);_0xa252a2[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x1b4497[_0xbd0b('0x30')]);_0xa252a2['filters']=_[_0xbd0b('0x34')](_0xa252a2[_0xbd0b('0x2d')],_0xa252a2[_0xbd0b('0x30')]);_0x4d72f[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0xa252a2['model'],qs[_0xbd0b('0x35')](_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x4d72f[_0xbd0b('0x33')]=_0x4d72f[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x4d72f['attributes']:_0xa252a2[_0xbd0b('0x2d')];if(_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x4d72f[_0xbd0b('0x40')]=[{'all':!![]}];}_0x4d72f=_[_0xbd0b('0x3d')]({},_0x4d72f,_0x1b4497[_0xbd0b('0x3e')]);return db[_0xbd0b('0x2b')][_0xbd0b('0x46')](_0x4d72f)[_0xbd0b('0x24')](handleEntityNotFound(_0x2a1a1d,null))[_0xbd0b('0x24')](respondWithResult(_0x2a1a1d,null))[_0xbd0b('0x43')](handleError(_0x2a1a1d,null));};exports[_0xbd0b('0x47')]=function(_0x222ee1,_0x30f77e){return db[_0xbd0b('0x2b')][_0xbd0b('0x47')](_0x222ee1[_0xbd0b('0x48')],{})[_0xbd0b('0x24')](respondWithResult(_0x30f77e,0xc9))[_0xbd0b('0x43')](handleError(_0x30f77e,null));};exports[_0xbd0b('0x23')]=function(_0x3cfb52,_0xbd64e2){if(_0x3cfb52[_0xbd0b('0x48')]['id']){delete _0x3cfb52['body']['id'];}delete _0x3cfb52[_0xbd0b('0x48')][_0xbd0b('0x49')];delete _0x3cfb52['body']['createdAt'];delete _0x3cfb52['body'][_0xbd0b('0x4a')];delete _0x3cfb52['body'][_0xbd0b('0x4b')];return db[_0xbd0b('0x2b')][_0xbd0b('0x46')]({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd64e2,null))[_0xbd0b('0x24')](saveUpdates(_0x3cfb52['body'],null))[_0xbd0b('0x24')](respondWithResult(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x80d89a,_0x22f741){return db[_0xbd0b('0x2b')][_0xbd0b('0x4c')]()[_0xbd0b('0x24')](respondWithResult(_0x22f741,null))[_0xbd0b('0x43')](handleError(_0x22f741,null));};exports[_0xbd0b('0x4d')]=function(_0x2a7252,_0x4cc013,_0x48a78c){var _0x2d13fd=require(_0xbd0b('0x4e'));var _0x5094bd=![];var _0x514985={};if(_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]&&_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]==='uniqueid'){_0x514985[_0xbd0b('0x4f')]=_0x2a7252[_0xbd0b('0x45')]['id'];}else{_0x514985['id']=_0x2a7252[_0xbd0b('0x45')]['id'];}return db[_0xbd0b('0x2b')]['find']({'where':_0x514985,'attributes':['id',_0xbd0b('0x4b')],'raw':!![]})[_0xbd0b('0x24')](handleEntityNotFound(_0x4cc013,null))['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],_0xbd0b('0x52'),_0x122a19[_0xbd0b('0x4b')]);var _0x3a526a=util[_0xbd0b('0x2f')]('%s.cypher',_0x1ea443);if(fs[_0xbd0b('0x53')](_0x3a526a)){_0x5094bd=!![];return _0x2d13fd[_0xbd0b('0x54')](_0x3a526a,_0x1ea443,config[_0xbd0b('0x55')][_0xbd0b('0x56')])[_0xbd0b('0x24')](function(){return _0x122a19;});}return _0x122a19;}})[_0xbd0b('0x24')](function(_0x49b7a6){if(_0x49b7a6){var _0x570648=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x49b7a6[_0xbd0b('0x4b')]);if(!fs[_0xbd0b('0x53')](_0x570648)){throw new db[(_0xbd0b('0x57'))][(_0xbd0b('0x58'))](_0xbd0b('0x59'));}if(_0x49b7a6['filename']){return _0x4cc013[_0xbd0b('0x4d')](_0x570648,_0x49b7a6[_0xbd0b('0x5a')]+path[_0xbd0b('0x5b')](_0x570648),function(){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}else{return _0x4cc013[_0xbd0b('0x4d')](_0x570648,function(_0xa08f72){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}}})[_0xbd0b('0x43')](function(_0x429534){if(_0x429534[_0xbd0b('0x5d')]===_0xbd0b('0x59')){_0x4cc013[_0xbd0b('0x18')](0x194)[_0xbd0b('0x29')](_0xbd0b('0x5e'));}else{return handleError(_0x4cc013,null);}});};exports[_0xbd0b('0x25')]=function(_0x1fefd5,_0x1e0beb){return db['ScreenRecording'][_0xbd0b('0x46')]({'where':{'id':_0x1fefd5[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x24')](function(_0x2c935c){if(_['isNil'](_0x2c935c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2c935c;})[_0xbd0b('0x24')](function(_0x45c6b5){var _0x4317f0=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x45c6b5[_0xbd0b('0x4b')]);logger['info'](_0xbd0b('0x5f'),_0x4317f0);if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs[_0xbd0b('0x53')](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbd0b('0x63')](_0x4317f0);}_0x4317f0=_0x4317f0+_0xbd0b('0x64');if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs['existsSync'](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+_0xbd0b('0x65'));fs[_0xbd0b('0x63')](_0x4317f0);}return _0x45c6b5;})[_0xbd0b('0x24')](function(_0x4df3df){if(!_0x4df3df)throw new InternalError();return _0x4df3df['destroy']();})[_0xbd0b('0x24')](function(){_0x1e0beb['status'](0xcc)[_0xbd0b('0x19')]();})[_0xbd0b('0x43')](handleError(_0x1e0beb,null));}; \ No newline at end of file +var _0xe5b3=['info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','keys','intersection','attributes','fields','query','length','nolimit','order','where','filters','filter','merge','options','include','findAll','rows','catch','show','create','body','duration','createdAt','closedAt','value','find','params','describe','download','uniqueid','join','%s.cypher','existsSync','root','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','send','Not\x20found','destroy','Entity\x20not\x20found'];(function(_0x340fb2,_0x528c2f){var _0x4624e2=function(_0x2a9fd6){while(--_0x2a9fd6){_0x340fb2['push'](_0x340fb2['shift']());}};_0x4624e2(++_0x528c2f);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1d88db,_0x26213f){_0x1d88db=_0x1d88db-0x0;var _0x1df256=_0xe5b3[_0x1d88db];return _0x1df256;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(!_0x42d7e9){_0x41b684[_0x3e5b('0x19')](0x194);}return _0x42d7e9;};}function handleError(_0x3bb749,_0x26c7f2){_0x26c7f2=_0x26c7f2||0x1f4;return function(_0x160e87){logger[_0x3e5b('0x28')](_0x160e87['stack']);if(_0x160e87[_0x3e5b('0x29')]){delete _0x160e87['name'];}_0x3bb749[_0x3e5b('0x1b')](_0x26c7f2)['send'](_0x160e87);};}exports[_0x3e5b('0x2a')]=function(_0x1f6473,_0x1296ec){var _0x475b39={},_0x10d2ed={},_0x3cfaf6={'count':0x0,'rows':[]};var _0x307091=_[_0x3e5b('0x2b')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')],function(_0x1e1565){return{'name':_0x1e1565['fieldName'],'type':_0x1e1565[_0x3e5b('0x2e')][_0x3e5b('0x2f')]};});_0x10d2ed[_0x3e5b('0x30')]=_[_0x3e5b('0x31')](_[_0x3e5b('0x2b')](_0x307091,_0x3e5b('0x29')),[_0x3e5b('0x32')]);_0x10d2ed['query']=_[_0x3e5b('0x33')](_0x1f6473['query']);_0x10d2ed['filters']=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],_0x10d2ed['query']);_0x475b39[_0x3e5b('0x35')]=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x475b39[_0x3e5b('0x35')]=_0x475b39[_0x3e5b('0x35')][_0x3e5b('0x38')]?_0x475b39[_0x3e5b('0x35')]:_0x10d2ed[_0x3e5b('0x30')];if(!_0x1f6473[_0x3e5b('0x37')]['hasOwnProperty'](_0x3e5b('0x39'))){_0x475b39[_0x3e5b('0x1e')]=qs['limit'](_0x1f6473['query'][_0x3e5b('0x1e')]);_0x475b39['offset']=qs[_0x3e5b('0x20')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x20')]);}_0x475b39[_0x3e5b('0x3a')]=qs['sort'](_0x1f6473[_0x3e5b('0x37')]['sort']);_0x475b39[_0x3e5b('0x3b')]=qs['filters'](_['pick'](_0x1f6473['query'],_0x10d2ed[_0x3e5b('0x3c')]),_0x307091);if(_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x3d')]){_0x475b39[_0x3e5b('0x3b')]=_[_0x3e5b('0x3e')](_0x475b39[_0x3e5b('0x3b')],{'$or':_['map'](_0x307091,function(_0x5d0c59){if(_0x5d0c59['type']!=='VIRTUAL'){var _0x5f0271={};_0x5f0271[_0x5d0c59['name']]={'$like':'%'+_0x1f6473['query'][_0x3e5b('0x3d')]+'%'};return _0x5f0271;}})});}_0x475b39=_[_0x3e5b('0x3e')]({},_0x475b39,_0x1f6473[_0x3e5b('0x3f')]);var _0x1aafd5={'where':_0x475b39[_0x3e5b('0x3b')]};return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')](_0x1aafd5)[_0x3e5b('0x27')](function(_0x222d0f){_0x3cfaf6[_0x3e5b('0x1f')]=_0x222d0f;if(_0x1f6473[_0x3e5b('0x37')]['includeAll']){_0x475b39[_0x3e5b('0x40')]=[{'all':!![]}];}return db[_0x3e5b('0x2c')][_0x3e5b('0x41')](_0x475b39);})[_0x3e5b('0x27')](function(_0xa262e0){_0x3cfaf6[_0x3e5b('0x42')]=_0xa262e0;return _0x3cfaf6;})[_0x3e5b('0x27')](respondWithFilteredResult(_0x1296ec,_0x475b39))[_0x3e5b('0x43')](handleError(_0x1296ec,null));};exports[_0x3e5b('0x44')]=function(_0x39da3f,_0x13c8d5){var _0x559056={'raw':![],'where':{'id':_0x39da3f['params']['id']}},_0x598ab4={};_0x598ab4['model']=_[_0x3e5b('0x33')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')]);_0x598ab4[_0x3e5b('0x37')]=_[_0x3e5b('0x33')](_0x39da3f[_0x3e5b('0x37')]);_0x598ab4[_0x3e5b('0x3c')]=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],_0x598ab4[_0x3e5b('0x37')]);_0x559056['attributes']=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x39da3f[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x559056['attributes']=_0x559056['attributes']['length']?_0x559056[_0x3e5b('0x35')]:_0x598ab4[_0x3e5b('0x30')];if(_0x39da3f[_0x3e5b('0x37')]['includeAll']){_0x559056['include']=[{'all':!![]}];}_0x559056=_[_0x3e5b('0x3e')]({},_0x559056,_0x39da3f[_0x3e5b('0x3f')]);return db[_0x3e5b('0x2c')]['find'](_0x559056)['then'](handleEntityNotFound(_0x13c8d5,null))[_0x3e5b('0x27')](respondWithResult(_0x13c8d5,null))['catch'](handleError(_0x13c8d5,null));};exports[_0x3e5b('0x45')]=function(_0x3379a1,_0x3f5835){return db[_0x3e5b('0x2c')][_0x3e5b('0x45')](_0x3379a1[_0x3e5b('0x46')],{})[_0x3e5b('0x27')](respondWithResult(_0x3f5835,0xc9))[_0x3e5b('0x43')](handleError(_0x3f5835,null));};exports[_0x3e5b('0x26')]=function(_0x4a2ae1,_0x223185){if(_0x4a2ae1['body']['id']){delete _0x4a2ae1[_0x3e5b('0x46')]['id'];}delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x47')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x48')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x49')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x4a')];return db[_0x3e5b('0x2c')][_0x3e5b('0x4b')]({'where':{'id':_0x4a2ae1[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x223185,null))['then'](saveUpdates(_0x4a2ae1[_0x3e5b('0x46')],null))[_0x3e5b('0x27')](respondWithResult(_0x223185,null))[_0x3e5b('0x43')](handleError(_0x223185,null));};exports[_0x3e5b('0x4d')]=function(_0x16c9f9,_0x2cecd3){return db['ScreenRecording'][_0x3e5b('0x4d')]()[_0x3e5b('0x27')](respondWithResult(_0x2cecd3,null))[_0x3e5b('0x43')](handleError(_0x2cecd3,null));};exports[_0x3e5b('0x4e')]=function(_0x3f8646,_0x449d0f,_0x216600){var _0x437430=require('../../components/encryptor');var _0x1e6403=![];var _0x5e702f={};if(_0x3f8646['query'][_0x3e5b('0x2e')]&&_0x3f8646['query'][_0x3e5b('0x2e')]===_0x3e5b('0x4f')){_0x5e702f[_0x3e5b('0x4f')]=_0x3f8646[_0x3e5b('0x4c')]['id'];}else{_0x5e702f['id']=_0x3f8646['params']['id'];}return db['ScreenRecording']['find']({'where':_0x5e702f,'attributes':['id','value'],'raw':!![]})[_0x3e5b('0x27')](handleEntityNotFound(_0x449d0f,null))[_0x3e5b('0x27')](function(_0x1ea02a){if(_0x1ea02a){var _0x4149c8=path[_0x3e5b('0x50')](config['root'],'server/files/screen_recordings',_0x1ea02a[_0x3e5b('0x4a')]);var _0x1b0b32=util[_0x3e5b('0x32')](_0x3e5b('0x51'),_0x4149c8);if(fs[_0x3e5b('0x52')](_0x1b0b32)){_0x1e6403=!![];return _0x437430['decryptFile'](_0x1b0b32,_0x4149c8,config['secrets']['recording'])['then'](function(){return _0x1ea02a;});}return _0x1ea02a;}})[_0x3e5b('0x27')](function(_0x3e3115){if(_0x3e3115){var _0x3088d4=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x3e3115[_0x3e5b('0x4a')]);if(!fs[_0x3e5b('0x52')](_0x3088d4)){throw new db['Sequelize'][(_0x3e5b('0x55'))](_0x3e5b('0x56'));}if(_0x3e3115[_0x3e5b('0x57')]){return _0x449d0f[_0x3e5b('0x4e')](_0x3088d4,_0x3e3115[_0x3e5b('0x57')]+path['extname'](_0x3088d4),function(){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}else{return _0x449d0f['download'](_0x3088d4,function(_0x45ca16){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}}})['catch'](function(_0x4a7d8e){if(_0x4a7d8e['message']===_0x3e5b('0x56')){_0x449d0f['status'](0x194)[_0x3e5b('0x59')](_0x3e5b('0x5a'));}else{return handleError(_0x449d0f,null);}});};exports[_0x3e5b('0x5b')]=function(_0x40197c,_0x14f187){return db['ScreenRecording']['find']({'where':{'id':_0x40197c[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](function(_0x3f7f71){if(_['isNil'](_0x3f7f71)){throw new ReferenceError(_0x3e5b('0x5c'));}return _0x3f7f71;})[_0x3e5b('0x27')](function(_0x32a42f){var _0x1c9526=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x32a42f[_0x3e5b('0x4a')]);logger[_0x3e5b('0x5d')](_0x3e5b('0x5e'),_0x1c9526);if(!_[_0x3e5b('0x5f')](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger[_0x3e5b('0x5d')](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs[_0x3e5b('0x62')](_0x1c9526);}_0x1c9526=_0x1c9526+_0x3e5b('0x63');if(!_['isNil'](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger['info'](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs['unlinkSync'](_0x1c9526);}return _0x32a42f;})['then'](function(_0x4f67d1){if(!_0x4f67d1)throw new InternalError();return _0x4f67d1[_0x3e5b('0x5b')]();})[_0x3e5b('0x27')](function(){_0x14f187['status'](0xcc)[_0x3e5b('0x1a')]();})[_0x3e5b('0x43')](handleError(_0x14f187,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 4bef5a6..127a36d 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 _0xb9f2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash','util','../../config/logger','api'];(function(_0x180659,_0xa1b1c4){var _0x224761=function(_0xe29201){while(--_0xe29201){_0x180659['push'](_0x180659['shift']());}};_0x224761(++_0xa1b1c4);}(_0xb9f2,0x119));var _0x2b9f=function(_0x381c63,_0x1beaa0){_0x381c63=_0x381c63-0x0;var _0x8a9389=_0xb9f2[_0x381c63];return _0x8a9389;};'use strict';var _=require(_0x2b9f('0x0'));var util=require(_0x2b9f('0x1'));var logger=require(_0x2b9f('0x2'))(_0x2b9f('0x3'));var moment=require(_0x2b9f('0x4'));var BPromise=require(_0x2b9f('0x5'));var rp=require(_0x2b9f('0x6'));var fs=require('fs');var path=require(_0x2b9f('0x7'));var rimraf=require(_0x2b9f('0x8'));var config=require(_0x2b9f('0x9'));var attributes=require(_0x2b9f('0xa'));module[_0x2b9f('0xb')]=function(_0x3302d7,_0x4d7ced){return _0x3302d7[_0x2b9f('0xc')]('ScreenRecording',attributes,{'tableName':_0x2b9f('0xd'),'paranoid':![],'indexes':[{'name':_0x2b9f('0xe'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0954=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api'];(function(_0x45346a,_0x3cb093){var _0x3536bb=function(_0x31c9ef){while(--_0x31c9ef){_0x45346a['push'](_0x45346a['shift']());}};_0x3536bb(++_0x3cb093);}(_0x0954,0xdd));var _0x4095=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x0954[_0x1a72b8];return _0x39f72d;};'use strict';var _=require(_0x4095('0x0'));var util=require(_0x4095('0x1'));var logger=require(_0x4095('0x2'))(_0x4095('0x3'));var moment=require(_0x4095('0x4'));var BPromise=require(_0x4095('0x5'));var rp=require(_0x4095('0x6'));var fs=require('fs');var path=require(_0x4095('0x7'));var rimraf=require(_0x4095('0x8'));var config=require(_0x4095('0x9'));var attributes=require('./screenRecording.attributes');module[_0x4095('0xa')]=function(_0x523284,_0x90228f){return _0x523284[_0x4095('0xb')](_0x4095('0xc'),attributes,{'tableName':_0x4095('0xd'),'paranoid':![],'indexes':[{'name':_0x4095('0xe'),'fields':[_0x4095('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 45707df..7f690f6 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 _0xf73a=['catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x309408,_0x9b92d8){var _0x1cf56b=function(_0x5543d1){while(--_0x5543d1){_0x309408['push'](_0x309408['shift']());}};_0x1cf56b(++_0x9b92d8);}(_0xf73a,0x166));var _0xaf73=function(_0x12f01a,_0x5a8227){_0x12f01a=_0x12f01a-0x0;var _0x521c28=_0xf73a[_0x12f01a];return _0x521c28;};'use strict';var _=require('lodash');var util=require(_0xaf73('0x0'));var moment=require(_0xaf73('0x1'));var BPromise=require('bluebird');var rs=require(_0xaf73('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf73('0x3'))['db'];var utils=require(_0xaf73('0x4'));var logger=require('../../config/logger')(_0xaf73('0x5'));var config=require(_0xaf73('0x6'));var jayson=require(_0xaf73('0x7'));var client=jayson[_0xaf73('0x8')][_0xaf73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143ba6,_0x4bd4ec,_0x8cd2c7){return new BPromise(function(_0x4e9794,_0x5476c4){return client[_0xaf73('0xa')](_0x143ba6,_0x8cd2c7)[_0xaf73('0xb')](function(_0x386ae0){logger['info'](_0xaf73('0xc'),_0x4bd4ec,'request\x20sent');logger[_0xaf73('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x4bd4ec,_0xaf73('0xe'),JSON[_0xaf73('0xf')](_0x386ae0));if(_0x386ae0[_0xaf73('0x10')]){if(_0x386ae0[_0xaf73('0x10')][_0xaf73('0x11')]===0x1f4){logger[_0xaf73('0x10')](_0xaf73('0xc'),_0x4bd4ec,_0x386ae0[_0xaf73('0x10')]['message']);return _0x5476c4(_0x386ae0['error']['message']);}logger[_0xaf73('0x10')](_0xaf73('0xc'),_0x4bd4ec,_0x386ae0[_0xaf73('0x10')][_0xaf73('0x12')]);return _0x4e9794(_0x386ae0[_0xaf73('0x10')][_0xaf73('0x12')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x4bd4ec,_0xaf73('0xe'));_0x4e9794(_0x386ae0[_0xaf73('0x13')][_0xaf73('0x12')]);}})[_0xaf73('0x14')](function(_0x312418){logger[_0xaf73('0x10')](_0xaf73('0xc'),_0x4bd4ec,_0x312418);_0x5476c4(_0x312418);});});} \ No newline at end of file +var _0x803e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0x803e,0x17d));var _0xe803=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0x803e[_0x4147ff];return _0x1e71e6;};'use strict';var _=require(_0xe803('0x0'));var util=require(_0xe803('0x1'));var moment=require(_0xe803('0x2'));var BPromise=require(_0xe803('0x3'));var rs=require(_0xe803('0x4'));var fs=require('fs');var Redis=require(_0xe803('0x5'));var db=require(_0xe803('0x6'))['db'];var utils=require(_0xe803('0x7'));var logger=require('../../config/logger')(_0xe803('0x8'));var config=require(_0xe803('0x9'));var jayson=require(_0xe803('0xa'));var client=jayson[_0xe803('0xb')][_0xe803('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e8f2d,_0x1db591,_0x4420a1){return new BPromise(function(_0x3761e6,_0x2454c3){return client['request'](_0x2e8f2d,_0x4420a1)['then'](function(_0x5c9e17){logger[_0xe803('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x1db591,_0xe803('0xe'));logger[_0xe803('0xf')](_0xe803('0x10'),_0x1db591,_0xe803('0xe'),JSON[_0xe803('0x11')](_0x5c9e17));if(_0x5c9e17[_0xe803('0x12')]){if(_0x5c9e17[_0xe803('0x12')][_0xe803('0x13')]===0x1f4){logger['error'](_0xe803('0x14'),_0x1db591,_0x5c9e17[_0xe803('0x12')][_0xe803('0x15')]);return _0x2454c3(_0x5c9e17[_0xe803('0x12')][_0xe803('0x15')]);}logger[_0xe803('0x12')](_0xe803('0x14'),_0x1db591,_0x5c9e17[_0xe803('0x12')]['message']);return _0x3761e6(_0x5c9e17[_0xe803('0x12')]['message']);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x1db591,_0xe803('0xe'));_0x3761e6(_0x5c9e17[_0xe803('0x16')]['message']);}})[_0xe803('0x17')](function(_0x5e3c93){logger['error'](_0xe803('0x14'),_0x1db591,_0x5e3c93);_0x2454c3(_0x5e3c93);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9c2cb28..8b1f9e5 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 _0xfae6=['format','logo','extname','originalname','post','single','file','server/files/images/logos/','logologin','addLogoLogin','%s%s','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x20ab38,_0x4bf6f2){var _0x1c489e=function(_0x26c915){while(--_0x26c915){_0x20ab38['push'](_0x20ab38['shift']());}};_0x1c489e(++_0x4bf6f2);}(_0xfae6,0x138));var _0x6fae=function(_0x153449,_0x1e1a30){_0x153449=_0x153449-0x0;var _0x503edb=_0xfae6[_0x153449];return _0x503edb;};'use strict';var multer=require(_0x6fae('0x0'));var util=require(_0x6fae('0x1'));var path=require(_0x6fae('0x2'));var timeout=require(_0x6fae('0x3'));var express=require(_0x6fae('0x4'));var router=express['Router']();var fs_extra=require(_0x6fae('0x5'));var auth=require(_0x6fae('0x6'));var interaction=require(_0x6fae('0x7'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x6fae('0x8')]('/',auth[_0x6fae('0x9')](),controller[_0x6fae('0xa')]);router[_0x6fae('0x8')](_0x6fae('0xb'),controller['getDate']);router['get'](_0x6fae('0xc'),controller[_0x6fae('0xd')]);router['get'](_0x6fae('0xe'),controller[_0x6fae('0xf')]);router[_0x6fae('0x8')](_0x6fae('0x10'),controller[_0x6fae('0x11')]);router[_0x6fae('0x8')]('/:id/gdpr',controller['gdpr']);router[_0x6fae('0x8')](_0x6fae('0x12'),controller['getPreferred']);router[_0x6fae('0x8')](_0x6fae('0x13'),controller[_0x6fae('0x14')]);var upload=multer({'storage':multer[_0x6fae('0x15')]({'destination':function(_0x39169c,_0x4703e3,_0x2a0ec4){_0x2a0ec4(null,path[_0x6fae('0x16')](config[_0x6fae('0x17')],'server/files/images/logos/'));},'filename':function(_0xc5d922,_0x285bf4,_0x1a4020){_0x1a4020(null,util[_0x6fae('0x18')]('%s%s',_0x6fae('0x19'),path[_0x6fae('0x1a')](_0x285bf4[_0x6fae('0x1b')])));}})});router[_0x6fae('0x1c')](_0x6fae('0xe'),upload[_0x6fae('0x1d')](_0x6fae('0x1e')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf912bb,_0x2eaafc,_0x4b9e55){_0x4b9e55(null,path[_0x6fae('0x16')](config[_0x6fae('0x17')],_0x6fae('0x1f')));},'filename':function(_0x3cc1e0,_0x344c4e,_0x5d5537){_0x5d5537(null,util['format']('%s%s',_0x6fae('0x20'),path[_0x6fae('0x1a')](_0x344c4e[_0x6fae('0x1b')])));}})});router[_0x6fae('0x1c')](_0x6fae('0x10'),upload[_0x6fae('0x1d')](_0x6fae('0x1e')),controller[_0x6fae('0x21')]);var upload=multer({'storage':multer[_0x6fae('0x15')]({'destination':function(_0x5b71c1,_0x5c208b,_0x1dc31f){_0x1dc31f(null,path[_0x6fae('0x16')](config['root'],_0x6fae('0x1f')));},'filename':function(_0x500772,_0x3b7fa0,_0x12bf82){_0x12bf82(null,util[_0x6fae('0x18')](_0x6fae('0x22'),_0x6fae('0x23'),path['extname'](_0x3b7fa0[_0x6fae('0x1b')])));}})});router[_0x6fae('0x1c')](_0x6fae('0x12'),upload['single'](_0x6fae('0x1e')),controller[_0x6fae('0x24')]);var upload=multer({'storage':multer[_0x6fae('0x15')]({'destination':function(_0x101ca7,_0x3fa933,_0x52011d){_0x52011d(null,path['join'](config[_0x6fae('0x17')],_0x6fae('0x1f')));},'filename':function(_0x5293b9,_0x4a7174,_0x579243){_0x579243(null,util['format'](_0x6fae('0x22'),_0x6fae('0x25'),path[_0x6fae('0x1a')](_0x4a7174['originalname'])));}})});router[_0x6fae('0x1c')](_0x6fae('0x13'),upload[_0x6fae('0x1d')]('file'),controller[_0x6fae('0x26')]);router[_0x6fae('0x27')](_0x6fae('0xc'),auth['isAuthenticated'](),controller[_0x6fae('0x28')]);module[_0x6fae('0x29')]=router; \ No newline at end of file +var _0x6d16=['addLogo','diskStorage','%s%s','logologin','post','addLogoLogin','root','preferred','/:id/preferred','addPreferred','favicon','extname','addFavicon','put','isAuthenticated','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','getPreferred','join','server/files/images/logos/','format','logo','originalname','single','file'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d16,0x1a5));var _0x66d1=function(_0x26c178,_0x2dd96e){_0x26c178=_0x26c178-0x0;var _0x35a015=_0x6d16[_0x26c178];return _0x35a015;};'use strict';var multer=require(_0x66d1('0x0'));var util=require(_0x66d1('0x1'));var path=require(_0x66d1('0x2'));var timeout=require(_0x66d1('0x3'));var express=require(_0x66d1('0x4'));var router=express['Router']();var fs_extra=require(_0x66d1('0x5'));var auth=require(_0x66d1('0x6'));var interaction=require(_0x66d1('0x7'));var config=require(_0x66d1('0x8'));var controller=require(_0x66d1('0x9'));router[_0x66d1('0xa')]('/',auth['isAuthenticated'](),controller[_0x66d1('0xb')]);router[_0x66d1('0xa')](_0x66d1('0xc'),controller[_0x66d1('0xd')]);router[_0x66d1('0xa')](_0x66d1('0xe'),controller[_0x66d1('0xf')]);router['get'](_0x66d1('0x10'),controller[_0x66d1('0x11')]);router['get'](_0x66d1('0x12'),controller['getLogoLogin']);router[_0x66d1('0xa')](_0x66d1('0x13'),controller[_0x66d1('0x14')]);router[_0x66d1('0xa')]('/:id/preferred',controller[_0x66d1('0x15')]);router[_0x66d1('0xa')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37630c,_0xb05036,_0x364980){_0x364980(null,path[_0x66d1('0x16')](config['root'],_0x66d1('0x17')));},'filename':function(_0x181054,_0x3dda10,_0x20026e){_0x20026e(null,util[_0x66d1('0x18')]('%s%s',_0x66d1('0x19'),path['extname'](_0x3dda10[_0x66d1('0x1a')])));}})});router['post'](_0x66d1('0x10'),upload[_0x66d1('0x1b')](_0x66d1('0x1c')),controller[_0x66d1('0x1d')]);var upload=multer({'storage':multer[_0x66d1('0x1e')]({'destination':function(_0x3bbc12,_0x4f8396,_0x50bf22){_0x50bf22(null,path[_0x66d1('0x16')](config['root'],_0x66d1('0x17')));},'filename':function(_0x28c911,_0x37cf6f,_0x3ec117){_0x3ec117(null,util[_0x66d1('0x18')](_0x66d1('0x1f'),_0x66d1('0x20'),path['extname'](_0x37cf6f[_0x66d1('0x1a')])));}})});router[_0x66d1('0x21')](_0x66d1('0x12'),upload[_0x66d1('0x1b')](_0x66d1('0x1c')),controller[_0x66d1('0x22')]);var upload=multer({'storage':multer[_0x66d1('0x1e')]({'destination':function(_0x431180,_0x39fd61,_0x4ea91e){_0x4ea91e(null,path[_0x66d1('0x16')](config[_0x66d1('0x23')],'server/files/images/logos/'));},'filename':function(_0x2a2013,_0x5ac3ae,_0x324c81){_0x324c81(null,util[_0x66d1('0x18')](_0x66d1('0x1f'),_0x66d1('0x24'),path['extname'](_0x5ac3ae[_0x66d1('0x1a')])));}})});router[_0x66d1('0x21')](_0x66d1('0x25'),upload[_0x66d1('0x1b')](_0x66d1('0x1c')),controller[_0x66d1('0x26')]);var upload=multer({'storage':multer[_0x66d1('0x1e')]({'destination':function(_0x665ad1,_0x2b3526,_0x1ee10d){_0x1ee10d(null,path[_0x66d1('0x16')](config[_0x66d1('0x23')],'server/files/images/logos/'));},'filename':function(_0x38a43a,_0x12ec1b,_0x715599){_0x715599(null,util[_0x66d1('0x18')]('%s%s',_0x66d1('0x27'),path[_0x66d1('0x28')](_0x12ec1b[_0x66d1('0x1a')])));}})});router['post']('/:id/favicon',upload[_0x66d1('0x1b')]('file'),controller[_0x66d1('0x29')]);router[_0x66d1('0x2a')](_0x66d1('0xe'),auth[_0x66d1('0x2b')](),controller[_0x66d1('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 3513ed9..15cea10 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 _0xae4b=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','min_mailbox','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0xd85a3a,_0x12a9d2){var _0x3bee06=function(_0x42c465){while(--_0x42c465){_0xd85a3a['push'](_0xd85a3a['shift']());}};_0x3bee06(++_0x12a9d2);}(_0xae4b,0x18e));var _0xbae4=function(_0x352cec,_0x9b459f){_0x352cec=_0x352cec-0x0;var _0x333d77=_0xae4b[_0x352cec];return _0x333d77;};'use strict';var Sequelize=require(_0xbae4('0x0'));module[_0xbae4('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xbae4('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xbae4('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xbae4('0x4')],'defaultValue':_0xbae4('0x5')},'logo':{'type':Sequelize[_0xbae4('0x4')]},'defaultLogo':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xbae4('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xbae4('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xbae4('0x4')]},'turnaddr':{'type':Sequelize[_0xbae4('0x4')]},'turnusername':{'type':Sequelize[_0xbae4('0x4')]},'turnpassword':{'type':Sequelize[_0xbae4('0x4')]},'pageTitle':{'type':Sequelize[_0xbae4('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xbae4('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xbae4('0x4')],'defaultValue':_0xbae4('0x7')},'enableEmailPreview':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xbae4('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xbae4('0x4')]},'defaultFavicon':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xbae4('0x4')]},'sentiment':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xbae4('0x3')]},'sentimentRegion':{'type':Sequelize[_0xbae4('0x4')]},'language':{'type':Sequelize[_0xbae4('0x4')]},'bucket':{'type':Sequelize[_0xbae4('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xbae4('0x3')](0x2)[_0xbae4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xbae4('0x3')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xbae4('0x3')](0x2)[_0xbae4('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xbae4('0x3')](0x2)[_0xbae4('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xbae4('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xbae4('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5f08=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0xa6f19d,_0x1b7c4d){var _0x2627f3=function(_0x4b80cf){while(--_0x4b80cf){_0xa6f19d['push'](_0xa6f19d['shift']());}};_0x2627f3(++_0x1b7c4d);}(_0x5f08,0x155));var _0x85f0=function(_0x1539ea,_0x539bdd){_0x1539ea=_0x1539ea-0x0;var _0x4aaad6=_0x5f08[_0x1539ea];return _0x4aaad6;};'use strict';var Sequelize=require(_0x85f0('0x0'));module[_0x85f0('0x1')]={'min_internal':{'type':Sequelize[_0x85f0('0x2')](0xb),'unique':_0x85f0('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x85f0('0x2')](0xb),'unique':_0x85f0('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x85f0('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x85f0('0x5')],'defaultValue':_0x85f0('0x6')},'logo':{'type':Sequelize[_0x85f0('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x85f0('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x85f0('0x5')]},'turnaddr':{'type':Sequelize[_0x85f0('0x5')]},'turnusername':{'type':Sequelize[_0x85f0('0x5')]},'turnpassword':{'type':Sequelize[_0x85f0('0x5')]},'pageTitle':{'type':Sequelize[_0x85f0('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x85f0('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x85f0('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x85f0('0x5')],'defaultValue':_0x85f0('0x9')},'chatTimeout':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x85f0('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x85f0('0x5')]},'defaultFavicon':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x85f0('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x85f0('0x2')]},'sentimentRegion':{'type':Sequelize[_0x85f0('0x5')]},'language':{'type':Sequelize[_0x85f0('0x5')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x85f0('0x2')](0x2)[_0x85f0('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x85f0('0x2')](0x2)[_0x85f0('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x85f0('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x85f0('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 027e0d0..c67e751 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 _0xaa0b=['map','Setting','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','upperFirst','custom','default_logo.svg','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0xaa0b,0x1b1));var _0xbaa0=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xaa0b[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0xbaa0('0x0'));var rimraf=require(_0xbaa0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbaa0('0x2'));var rp=require(_0xbaa0('0x3'));var moment=require(_0xbaa0('0x4'));var BPromise=require(_0xbaa0('0x5'));var Mustache=require('mustache');var util=require(_0xbaa0('0x6'));var path=require(_0xbaa0('0x7'));var sox=require(_0xbaa0('0x8'));var csv=require(_0xbaa0('0x9'));var ejs=require(_0xbaa0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaa0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbaa0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbaa0('0x9'));var querystring=require('querystring');var Papa=require(_0xbaa0('0xd'));var Redis=require(_0xbaa0('0xe'));var authService=require(_0xbaa0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbaa0('0x10'))(_0xbaa0('0x11'));var utils=require(_0xbaa0('0x12'));var config=require(_0xbaa0('0x13'));var licenseUtil=require(_0xbaa0('0x14'));var db=require(_0xbaa0('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xbaa0('0x16')][_0xbaa0('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x59d008,_0x520433,_0x5bb732,_0x3d5d2f){return new BPromise(function(_0x757dd,_0x415bad){var _0x1514a8=_0x3d5d2f||client;return _0x1514a8['request'](_0x59d008,_0x5bb732)[_0xbaa0('0x18')](function(_0x27ac47){logger[_0xbaa0('0x19')](_0xbaa0('0x1a'),_0x520433,_0xbaa0('0x1b'));logger[_0xbaa0('0x1c')](_0xbaa0('0x1d'),_0x520433,_0xbaa0('0x1b'),JSON['stringify'](_0x27ac47));if(_0x27ac47[_0xbaa0('0x1e')]){if(_0x27ac47[_0xbaa0('0x1e')]['code']===0x1f4){logger[_0xbaa0('0x1e')](_0xbaa0('0x1a'),_0x520433,_0x27ac47[_0xbaa0('0x1e')][_0xbaa0('0x1f')]);return _0x415bad(_0x27ac47[_0xbaa0('0x1e')][_0xbaa0('0x1f')]);}logger[_0xbaa0('0x1e')]('Setting,\x20%s,\x20%s',_0x520433,_0x27ac47[_0xbaa0('0x1e')]['message']);return _0x757dd(_0x27ac47['error']['message']);}else{logger[_0xbaa0('0x19')](_0xbaa0('0x1a'),_0x520433,_0xbaa0('0x1b'));_0x757dd(_0x27ac47['result'][_0xbaa0('0x1f')]);}})[_0xbaa0('0x20')](function(_0x1abc26){logger[_0xbaa0('0x1e')](_0xbaa0('0x1a'),_0x520433,_0x1abc26);_0x415bad(_0x1abc26);});});}function respondWithStatusCode(_0x18bd1d,_0x4c5273){_0x4c5273=_0x4c5273||0xcc;return function(_0x4660cc){if(_0x4660cc){return _0x18bd1d[_0xbaa0('0x21')](_0x4c5273);}return _0x18bd1d[_0xbaa0('0x22')](_0x4c5273)[_0xbaa0('0x23')]();};}function respondWithResult(_0x53af0e,_0x32a212){_0x32a212=_0x32a212||0xc8;return function(_0x2d0296){if(_0x2d0296){return _0x53af0e['status'](_0x32a212)[_0xbaa0('0x24')](_0x2d0296);}};}function respondWithFilteredResult(_0x90686c,_0x3945a5){return function(_0x38a73f){if(_0x38a73f){var _0x5511b2=typeof _0x3945a5[_0xbaa0('0x25')]===_0xbaa0('0x26')&&typeof _0x3945a5[_0xbaa0('0x27')]===_0xbaa0('0x26');var _0x3fb767=_0x38a73f[_0xbaa0('0x28')];var _0x34629f=_0x5511b2?0x0:_0x3945a5['offset'];var _0x1254bc=_0x5511b2?_0x38a73f[_0xbaa0('0x28')]:_0x3945a5[_0xbaa0('0x25')]+_0x3945a5[_0xbaa0('0x27')];var _0x16a2a7;if(_0x1254bc>=_0x3fb767){_0x1254bc=_0x3fb767;_0x16a2a7=0xc8;}else{_0x16a2a7=0xce;}_0x90686c[_0xbaa0('0x22')](_0x16a2a7);return _0x90686c[_0xbaa0('0x29')](_0xbaa0('0x2a'),_0x34629f+'-'+_0x1254bc+'/'+_0x3fb767)[_0xbaa0('0x24')](_0x38a73f);}return null;};}function patchUpdates(_0x11acde){return function(_0x28ecf0){try{jsonpatch[_0xbaa0('0x2b')](_0x28ecf0,_0x11acde,!![]);}catch(_0x24afc9){return BPromise[_0xbaa0('0x2c')](_0x24afc9);}return _0x28ecf0[_0xbaa0('0x2d')]();};}function saveUpdates(_0x1dc128,_0x4034db){return function(_0x18a224){if(_0x18a224){return _0x18a224[_0xbaa0('0x2e')](_0x1dc128)[_0xbaa0('0x18')](function(_0x1d3e18){return _0x1d3e18;});}return null;};}function removeEntity(_0x2f1eb3,_0x3271cc){return function(_0x2b9cc6){if(_0x2b9cc6){return _0x2b9cc6['destroy']()[_0xbaa0('0x18')](function(){_0x2f1eb3[_0xbaa0('0x22')](0xcc)[_0xbaa0('0x23')]();});}};}function handleEntityNotFound(_0x22d7a8,_0x13524f){return function(_0xbc1315){if(!_0xbc1315){_0x22d7a8['sendStatus'](0x194);}return _0xbc1315;};}function handleError(_0x51f0c6,_0x59ae7d){_0x59ae7d=_0x59ae7d||0x1f4;return function(_0x4de842){logger[_0xbaa0('0x1e')](_0x4de842[_0xbaa0('0x2f')]);if(_0x4de842[_0xbaa0('0x30')]){delete _0x4de842[_0xbaa0('0x30')];}_0x51f0c6[_0xbaa0('0x22')](_0x59ae7d)[_0xbaa0('0x31')](_0x4de842);};}exports[_0xbaa0('0x32')]=function(_0x2205d7,_0x4312cc){var _0xeb86da={},_0x12dc15={},_0x61fb23={'count':0x0,'rows':[]};var _0x4b2892=_[_0xbaa0('0x33')](db[_0xbaa0('0x34')][_0xbaa0('0x35')],function(_0x59a6dd){return{'name':_0x59a6dd[_0xbaa0('0x36')],'type':_0x59a6dd[_0xbaa0('0x37')]['key']};});_0x12dc15['model']=_[_0xbaa0('0x33')](_0x4b2892,'name');_0x12dc15[_0xbaa0('0x38')]=_[_0xbaa0('0x39')](_0x2205d7['query']);_0x12dc15[_0xbaa0('0x3a')]=_[_0xbaa0('0x3b')](_0x12dc15[_0xbaa0('0x3c')],_0x12dc15[_0xbaa0('0x38')]);_0xeb86da[_0xbaa0('0x3d')]=_[_0xbaa0('0x3b')](_0x12dc15[_0xbaa0('0x3c')],qs[_0xbaa0('0x3e')](_0x2205d7[_0xbaa0('0x38')][_0xbaa0('0x3e')]));_0xeb86da[_0xbaa0('0x3d')]=_0xeb86da[_0xbaa0('0x3d')][_0xbaa0('0x3f')]?_0xeb86da[_0xbaa0('0x3d')]:_0x12dc15[_0xbaa0('0x3c')];if(!_0x2205d7[_0xbaa0('0x38')][_0xbaa0('0x40')](_0xbaa0('0x41'))){_0xeb86da[_0xbaa0('0x27')]=qs[_0xbaa0('0x27')](_0x2205d7[_0xbaa0('0x38')][_0xbaa0('0x27')]);_0xeb86da[_0xbaa0('0x25')]=qs[_0xbaa0('0x25')](_0x2205d7['query']['offset']);}_0xeb86da[_0xbaa0('0x42')]=qs[_0xbaa0('0x43')](_0x2205d7[_0xbaa0('0x38')]['sort']);_0xeb86da[_0xbaa0('0x44')]=qs[_0xbaa0('0x3a')](_['pick'](_0x2205d7[_0xbaa0('0x38')],_0x12dc15['filters']),_0x4b2892);if(_0x2205d7[_0xbaa0('0x38')][_0xbaa0('0x45')]){_0xeb86da['where']=_['merge'](_0xeb86da[_0xbaa0('0x44')],{'$or':_[_0xbaa0('0x33')](_0x4b2892,function(_0x141c9f){if(_0x141c9f[_0xbaa0('0x37')]!==_0xbaa0('0x46')){var _0x5e5668={};_0x5e5668[_0x141c9f[_0xbaa0('0x30')]]={'$like':'%'+_0x2205d7['query'][_0xbaa0('0x45')]+'%'};return _0x5e5668;}})});}_0xeb86da=_[_0xbaa0('0x47')]({},_0xeb86da,_0x2205d7[_0xbaa0('0x48')]);var _0x12d9b9={'where':_0xeb86da[_0xbaa0('0x44')]};return db[_0xbaa0('0x34')][_0xbaa0('0x28')](_0x12d9b9)[_0xbaa0('0x18')](function(_0x50a950){_0x61fb23[_0xbaa0('0x28')]=_0x50a950;if(_0x2205d7[_0xbaa0('0x38')][_0xbaa0('0x49')]){_0xeb86da[_0xbaa0('0x4a')]=[{'all':!![]}];}return db[_0xbaa0('0x34')][_0xbaa0('0x4b')](_0xeb86da);})[_0xbaa0('0x18')](function(_0x2365b6){_0x61fb23[_0xbaa0('0x4c')]=_0x2365b6;return _0x61fb23;})[_0xbaa0('0x18')](respondWithFilteredResult(_0x4312cc,_0xeb86da))[_0xbaa0('0x20')](handleError(_0x4312cc,null));};exports[_0xbaa0('0x4d')]=function(_0x272d2e,_0x1ff354){var _0x24ab82={'raw':![],'where':{'id':_0x272d2e[_0xbaa0('0x4e')]['id']}},_0x153e7a={};_0x153e7a[_0xbaa0('0x3c')]=_[_0xbaa0('0x39')](db[_0xbaa0('0x34')][_0xbaa0('0x35')]);_0x153e7a[_0xbaa0('0x38')]=_['keys'](_0x272d2e['query']);_0x153e7a[_0xbaa0('0x3a')]=_[_0xbaa0('0x3b')](_0x153e7a['model'],_0x153e7a[_0xbaa0('0x38')]);_0x24ab82[_0xbaa0('0x3d')]=_[_0xbaa0('0x3b')](_0x153e7a[_0xbaa0('0x3c')],qs[_0xbaa0('0x3e')](_0x272d2e[_0xbaa0('0x38')][_0xbaa0('0x3e')]));_0x24ab82['attributes']=_0x24ab82['attributes'][_0xbaa0('0x3f')]?_0x24ab82[_0xbaa0('0x3d')]:_0x153e7a[_0xbaa0('0x3c')];if(_0x272d2e[_0xbaa0('0x38')][_0xbaa0('0x49')]){_0x24ab82[_0xbaa0('0x4a')]=[{'all':!![]}];}_0x24ab82=_[_0xbaa0('0x47')]({},_0x24ab82,_0x272d2e[_0xbaa0('0x48')]);return db['Setting'][_0xbaa0('0x4f')](_0x24ab82)['then'](handleEntityNotFound(_0x1ff354,null))[_0xbaa0('0x18')](respondWithResult(_0x1ff354,null))[_0xbaa0('0x20')](handleError(_0x1ff354,null));};exports['update']=function(_0x4ed175,_0xd97ae7){if(_0x4ed175[_0xbaa0('0x50')]['id']){delete _0x4ed175[_0xbaa0('0x50')]['id'];}return db['Setting'][_0xbaa0('0x4f')]({'where':{'id':_0x4ed175[_0xbaa0('0x4e')]['id']}})[_0xbaa0('0x18')](handleEntityNotFound(_0xd97ae7,null))[_0xbaa0('0x18')](saveUpdates(_0x4ed175[_0xbaa0('0x50')],null))[_0xbaa0('0x18')](respondWithResult(_0xd97ae7,null))[_0xbaa0('0x20')](handleError(_0xd97ae7,null));};exports[_0xbaa0('0x51')]=function(_0x48271d,_0x5d309d,_0x12dce2){if(_0x48271d[_0xbaa0('0x52')]&&_0x48271d[_0xbaa0('0x52')][_0xbaa0('0x53')]){_0x48271d['body'][_0xbaa0('0x54')]=_0x48271d['file'][_0xbaa0('0x53')];}return db[_0xbaa0('0x34')][_0xbaa0('0x4f')]({'where':{'id':_0x48271d['params']['id']}})[_0xbaa0('0x18')](handleEntityNotFound(_0x5d309d,null))[_0xbaa0('0x18')](saveUpdates(_0x48271d[_0xbaa0('0x50')],null))['then'](respondWithResult(_0x5d309d,null))[_0xbaa0('0x20')](handleError(_0x5d309d,null));};exports[_0xbaa0('0x55')]=function(_0x273210,_0x1c6170,_0x22b17c){if(_0x273210[_0xbaa0('0x52')]&&_0x273210['file'][_0xbaa0('0x53')]){_0x273210['body'][_0xbaa0('0x56')]=_0x273210[_0xbaa0('0x52')]['filename'];}return db['Setting'][_0xbaa0('0x4f')]({'where':{'id':_0x273210[_0xbaa0('0x4e')]['id']}})[_0xbaa0('0x18')](handleEntityNotFound(_0x1c6170,null))[_0xbaa0('0x18')](saveUpdates(_0x273210[_0xbaa0('0x50')],null))[_0xbaa0('0x18')](respondWithResult(_0x1c6170,null))['catch'](handleError(_0x1c6170,null));};var utilLicense=require(_0xbaa0('0x14'));exports['getLogo']=function(_0x6cb3d,_0x3a7dfc,_0x432c30){var _0x2b8ca2=_0xbaa0('0x57');var _0x2dc7c9={'custom':![]};return utilLicense[_0xbaa0('0x58')]()['then'](function(_0x67e7f1){if(_0x67e7f1){_0x2dc7c9=_0x67e7f1;}return db[_0xbaa0('0x34')][_0xbaa0('0x4f')]({'where':{'id':_0x6cb3d[_0xbaa0('0x4e')]['id']},'attributes':[_0xbaa0('0x54'),_0xbaa0('0x56'),_0xbaa0('0x59'),_0xbaa0('0x5a'),'defaultLogo',_0xbaa0('0x5b'),_0xbaa0('0x5c'),_0xbaa0('0x5d')],'raw':!![]});})[_0xbaa0('0x18')](handleEntityNotFound(_0x3a7dfc,null))[_0xbaa0('0x18')](function(_0x364a93){if(_0x364a93){var _0x20de74=_0x364a93[_0xbaa0('0x54')]&&fs[_0xbaa0('0x5e')](path['join'](config[_0xbaa0('0x5f')],_0x2b8ca2,_[_0xbaa0('0x60')](_0x364a93['logo'])))?path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x2b8ca2,_[_0xbaa0('0x60')](_0x364a93[_0xbaa0('0x54')])):path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x2b8ca2,_['toLower']('default_logo.svg'));var _0x13e325='default'+_[_0xbaa0('0x62')](_0xbaa0('0x54'));if(_0x364a93[_0x13e325]||!_0x2dc7c9[_0xbaa0('0x63')]){_0x20de74=path['join'](config['root'],_0x2b8ca2,_[_0xbaa0('0x60')](_0xbaa0('0x64')));}if(!fs[_0xbaa0('0x5e')](_0x20de74)){throw new db['Sequelize'][(_0xbaa0('0x65'))](_[_0xbaa0('0x62')](_0xbaa0('0x54'))+_0xbaa0('0x66'));}return _0x3a7dfc[_0xbaa0('0x67')](_0x20de74);}})[_0xbaa0('0x20')](handleError(_0x3a7dfc,null));};var utilLicense=require(_0xbaa0('0x14'));exports[_0xbaa0('0x68')]=function(_0x1b48c6,_0x36e93a,_0x178a1c){var _0x52e47d=_0xbaa0('0x57');var _0x576437={'custom':![]};return utilLicense[_0xbaa0('0x58')]()[_0xbaa0('0x18')](function(_0x2ba0e3){if(_0x2ba0e3){_0x576437=_0x2ba0e3;}return db[_0xbaa0('0x34')]['find']({'where':{'id':_0x1b48c6[_0xbaa0('0x4e')]['id']},'attributes':[_0xbaa0('0x54'),_0xbaa0('0x56'),_0xbaa0('0x59'),_0xbaa0('0x5a'),_0xbaa0('0x69'),_0xbaa0('0x5b'),_0xbaa0('0x5c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x36e93a,null))[_0xbaa0('0x18')](function(_0x53b936){if(_0x53b936){var _0x2805f0=_0x53b936[_0xbaa0('0x56')]&&fs[_0xbaa0('0x5e')](path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x52e47d,_[_0xbaa0('0x60')](_0x53b936[_0xbaa0('0x56')])))?path['join'](config[_0xbaa0('0x5f')],_0x52e47d,_[_0xbaa0('0x60')](_0x53b936[_0xbaa0('0x56')])):path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x52e47d,_[_0xbaa0('0x60')](_0xbaa0('0x6a')));var _0xa4e031='default'+_[_0xbaa0('0x62')](_0xbaa0('0x56'));if(_0x53b936[_0xa4e031]||!_0x576437['custom']){_0x2805f0=path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x52e47d,_[_0xbaa0('0x60')](_0xbaa0('0x6a')));}if(!fs[_0xbaa0('0x5e')](_0x2805f0)){throw new db[(_0xbaa0('0x6b'))][(_0xbaa0('0x65'))](_[_0xbaa0('0x62')](_0xbaa0('0x56'))+_0xbaa0('0x66'));}return _0x36e93a[_0xbaa0('0x67')](_0x2805f0);}})['catch'](handleError(_0x36e93a,null));};exports[_0xbaa0('0x6c')]=function(_0x596264,_0x4f3630){return db[_0xbaa0('0x34')]['find']({'where':{'id':_0x596264[_0xbaa0('0x4e')]['id']},'attributes':[_0xbaa0('0x6d')]})[_0xbaa0('0x18')](respondWithResult(_0x4f3630,null))[_0xbaa0('0x20')](handleError(_0x4f3630,null));};exports[_0xbaa0('0x6e')]=function(_0x531468,_0x18edac,_0x4d83b8){if(_0x531468[_0xbaa0('0x52')]&&_0x531468[_0xbaa0('0x52')]['filename']){_0x531468[_0xbaa0('0x50')]['preferred']=_0x531468[_0xbaa0('0x52')][_0xbaa0('0x53')];}return db['Setting'][_0xbaa0('0x4f')]({'where':{'id':_0x531468[_0xbaa0('0x4e')]['id']}})[_0xbaa0('0x18')](handleEntityNotFound(_0x18edac,null))[_0xbaa0('0x18')](saveUpdates(_0x531468['body'],null))[_0xbaa0('0x18')](respondWithResult(_0x18edac,null))['catch'](handleError(_0x18edac,null));};var utilLicense=require(_0xbaa0('0x14'));exports[_0xbaa0('0x6f')]=function(_0x65d26a,_0x3b9cd4,_0x403ff8){var _0x34605c='server/files/images/logos';var _0x7474db={'custom':![]};return utilLicense['getLicense']()[_0xbaa0('0x18')](function(_0x138c6b){if(_0x138c6b){_0x7474db=_0x138c6b;}return db[_0xbaa0('0x34')]['find']({'where':{'id':_0x65d26a[_0xbaa0('0x4e')]['id']},'attributes':[_0xbaa0('0x54'),'loginLogo',_0xbaa0('0x59'),_0xbaa0('0x5a'),_0xbaa0('0x69'),_0xbaa0('0x5b'),_0xbaa0('0x5c'),_0xbaa0('0x5d')],'raw':!![]});})[_0xbaa0('0x18')](handleEntityNotFound(_0x3b9cd4,null))[_0xbaa0('0x18')](function(_0x1f1f57){if(_0x1f1f57){var _0x52ca77=_0x1f1f57['preferred']&&fs[_0xbaa0('0x5e')](path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x34605c,_[_0xbaa0('0x60')](_0x1f1f57['preferred'])))?path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x34605c,_[_0xbaa0('0x60')](_0x1f1f57[_0xbaa0('0x59')])):path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0x34605c,_['toLower'](_0xbaa0('0x70')));var _0xbaaa24='default'+_['upperFirst']('preferred');if(_0x1f1f57[_0xbaaa24]||!_0x7474db[_0xbaa0('0x63')]||!_0x7474db[_0xbaa0('0x59')]){_0x52ca77=path['join'](config[_0xbaa0('0x5f')],_0x34605c,_[_0xbaa0('0x60')](_0xbaa0('0x70')));}if(!fs[_0xbaa0('0x5e')](_0x52ca77)){throw new db[(_0xbaa0('0x6b'))]['ValidationError'](_[_0xbaa0('0x62')](_0xbaa0('0x59'))+'\x20not\x20found');}return _0x3b9cd4[_0xbaa0('0x67')](_0x52ca77);}})['catch'](handleError(_0x3b9cd4,null));};exports[_0xbaa0('0x71')]=function(_0x48275a,_0x42dd0f,_0x5b4cd8){if(_0x48275a[_0xbaa0('0x52')]&&_0x48275a[_0xbaa0('0x52')]['filename']){_0x48275a[_0xbaa0('0x50')][_0xbaa0('0x5a')]=_0x48275a['file']['filename'];}return db[_0xbaa0('0x34')][_0xbaa0('0x4f')]({'where':{'id':_0x48275a[_0xbaa0('0x4e')]['id']}})['then'](handleEntityNotFound(_0x42dd0f,null))['then'](saveUpdates(_0x48275a[_0xbaa0('0x50')],null))[_0xbaa0('0x18')](respondWithResult(_0x42dd0f,null))[_0xbaa0('0x20')](handleError(_0x42dd0f,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x173568,_0x4521ba,_0xcb4f55){var _0xf6b105=_0xbaa0('0x57');var _0x3fdef6={'custom':![]};return utilLicense[_0xbaa0('0x58')]()[_0xbaa0('0x18')](function(_0x338e5d){if(_0x338e5d){_0x3fdef6=_0x338e5d;}return db[_0xbaa0('0x34')][_0xbaa0('0x4f')]({'where':{'id':_0x173568[_0xbaa0('0x4e')]['id']},'attributes':[_0xbaa0('0x54'),_0xbaa0('0x56'),_0xbaa0('0x59'),'favicon',_0xbaa0('0x69'),_0xbaa0('0x5b'),_0xbaa0('0x5c'),_0xbaa0('0x5d')],'raw':!![]});})[_0xbaa0('0x18')](handleEntityNotFound(_0x4521ba,null))['then'](function(_0x463149){if(_0x463149){var _0x19ade9=_0x463149[_0xbaa0('0x5a')]&&fs[_0xbaa0('0x5e')](path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0xf6b105,_[_0xbaa0('0x60')](_0x463149[_0xbaa0('0x5a')])))?path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0xf6b105,_['toLower'](_0x463149['favicon'])):path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0xf6b105,_['toLower']('default_favicon.ico'));var _0x263980=_0xbaa0('0x72')+_[_0xbaa0('0x62')](_0xbaa0('0x5a'));if(_0x463149[_0x263980]||!_0x3fdef6['custom']){_0x19ade9=path[_0xbaa0('0x61')](config[_0xbaa0('0x5f')],_0xf6b105,_[_0xbaa0('0x60')](_0xbaa0('0x73')));}if(!fs[_0xbaa0('0x5e')](_0x19ade9)){throw new db[(_0xbaa0('0x6b'))][(_0xbaa0('0x65'))](_[_0xbaa0('0x62')](_0xbaa0('0x5a'))+_0xbaa0('0x66'));}return _0x4521ba[_0xbaa0('0x67')](_0x19ade9);}})[_0xbaa0('0x20')](handleError(_0x4521ba,null));};exports[_0xbaa0('0x74')]=function(_0x3a9355,_0xd37b44){var _0x309236={'offset':moment()[_0xbaa0('0x75')]()};_0x309236[_0xbaa0('0x76')]=moment()[_0xbaa0('0x75')](_0x309236[_0xbaa0('0x25')])[_0xbaa0('0x77')](_0xbaa0('0x78'));return _0xd37b44['status'](0xc8)[_0xbaa0('0x31')](_0x309236);}; \ No newline at end of file +var _0x9374=['type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','includeAll','include','findAll','rows','show','rawAttributes','options','find','body','addLogo','file','filename','logo','params','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','upperFirst','custom','default_logo.svg','Sequelize','\x20not\x20found','download','default_loginLogo.svg','default','gdpr','securePassword','getPreferred','default_preferred.png','ValidationError','getFavicon','defaultLoginLogo','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','name','send','map','Setting'];(function(_0x338d6b,_0x21ceb5){var _0x20bf75=function(_0x7f8e3d){while(--_0x7f8e3d){_0x338d6b['push'](_0x338d6b['shift']());}};_0x20bf75(++_0x21ceb5);}(_0x9374,0x1ac));var _0x4937=function(_0x57b501,_0x5b583d){_0x57b501=_0x57b501-0x0;var _0x261cb1=_0x9374[_0x57b501];return _0x261cb1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4937('0x0'));var zipdir=require(_0x4937('0x1'));var jsonpatch=require(_0x4937('0x2'));var rp=require('request-promise');var moment=require(_0x4937('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4937('0x4'));var util=require(_0x4937('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4937('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4937('0x7'));var _=require(_0x4937('0x8'));var squel=require(_0x4937('0x9'));var crypto=require(_0x4937('0xa'));var jsforce=require(_0x4937('0xb'));var deskjs=require(_0x4937('0xc'));var toCsv=require(_0x4937('0x6'));var querystring=require(_0x4937('0xd'));var Papa=require(_0x4937('0xe'));var Redis=require(_0x4937('0xf'));var authService=require(_0x4937('0x10'));var qs=require(_0x4937('0x11'));var as=require(_0x4937('0x12'));var hardwareService=require(_0x4937('0x13'));var logger=require('../../config/logger')(_0x4937('0x14'));var utils=require(_0x4937('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4937('0x16'));var db=require(_0x4937('0x17'))['db'];var jayson=require(_0x4937('0x18'));var client=jayson[_0x4937('0x19')][_0x4937('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5c952c,_0xc300b5,_0x26f6e2,_0x4df872){return new BPromise(function(_0x408d51,_0x35b91c){var _0x3dc234=_0x4df872||client;return _0x3dc234[_0x4937('0x1b')](_0x5c952c,_0x26f6e2)['then'](function(_0x142c46){logger[_0x4937('0x1c')](_0x4937('0x1d'),_0xc300b5,'request\x20sent');logger[_0x4937('0x1e')](_0x4937('0x1f'),_0xc300b5,_0x4937('0x20'),JSON[_0x4937('0x21')](_0x142c46));if(_0x142c46['error']){if(_0x142c46['error']['code']===0x1f4){logger[_0x4937('0x22')](_0x4937('0x1d'),_0xc300b5,_0x142c46[_0x4937('0x22')][_0x4937('0x23')]);return _0x35b91c(_0x142c46[_0x4937('0x22')][_0x4937('0x23')]);}logger['error']('Setting,\x20%s,\x20%s',_0xc300b5,_0x142c46[_0x4937('0x22')]['message']);return _0x408d51(_0x142c46['error'][_0x4937('0x23')]);}else{logger[_0x4937('0x1c')](_0x4937('0x1d'),_0xc300b5,'request\x20sent');_0x408d51(_0x142c46[_0x4937('0x24')]['message']);}})[_0x4937('0x25')](function(_0xc49f14){logger[_0x4937('0x22')](_0x4937('0x1d'),_0xc300b5,_0xc49f14);_0x35b91c(_0xc49f14);});});}function respondWithStatusCode(_0x2927ed,_0x2df48c){_0x2df48c=_0x2df48c||0xcc;return function(_0x59899a){if(_0x59899a){return _0x2927ed[_0x4937('0x26')](_0x2df48c);}return _0x2927ed[_0x4937('0x27')](_0x2df48c)[_0x4937('0x28')]();};}function respondWithResult(_0x334896,_0x807e61){_0x807e61=_0x807e61||0xc8;return function(_0x441046){if(_0x441046){return _0x334896[_0x4937('0x27')](_0x807e61)[_0x4937('0x29')](_0x441046);}};}function respondWithFilteredResult(_0x4cbdf0,_0x37dea6){return function(_0x356ab5){if(_0x356ab5){var _0x122c8f=typeof _0x37dea6[_0x4937('0x2a')]===_0x4937('0x2b')&&typeof _0x37dea6[_0x4937('0x2c')]===_0x4937('0x2b');var _0x46c3db=_0x356ab5['count'];var _0x24b95d=_0x122c8f?0x0:_0x37dea6['offset'];var _0x50dafc=_0x122c8f?_0x356ab5[_0x4937('0x2d')]:_0x37dea6['offset']+_0x37dea6[_0x4937('0x2c')];var _0x3e64c4;if(_0x50dafc>=_0x46c3db){_0x50dafc=_0x46c3db;_0x3e64c4=0xc8;}else{_0x3e64c4=0xce;}_0x4cbdf0[_0x4937('0x27')](_0x3e64c4);return _0x4cbdf0[_0x4937('0x2e')](_0x4937('0x2f'),_0x24b95d+'-'+_0x50dafc+'/'+_0x46c3db)['json'](_0x356ab5);}return null;};}function patchUpdates(_0x92b6fd){return function(_0x2e7753){try{jsonpatch['apply'](_0x2e7753,_0x92b6fd,!![]);}catch(_0x2959a0){return BPromise['reject'](_0x2959a0);}return _0x2e7753[_0x4937('0x30')]();};}function saveUpdates(_0x23a622,_0x5491f5){return function(_0x201b43){if(_0x201b43){return _0x201b43[_0x4937('0x31')](_0x23a622)['then'](function(_0x42b847){return _0x42b847;});}return null;};}function removeEntity(_0x55eee1,_0x5a1597){return function(_0x3bb1c1){if(_0x3bb1c1){return _0x3bb1c1[_0x4937('0x32')]()[_0x4937('0x33')](function(){_0x55eee1[_0x4937('0x27')](0xcc)[_0x4937('0x28')]();});}};}function handleEntityNotFound(_0xb687b,_0x1efddf){return function(_0x2d8568){if(!_0x2d8568){_0xb687b[_0x4937('0x26')](0x194);}return _0x2d8568;};}function handleError(_0x436b1b,_0x991399){_0x991399=_0x991399||0x1f4;return function(_0x5999b5){logger[_0x4937('0x22')](_0x5999b5['stack']);if(_0x5999b5[_0x4937('0x34')]){delete _0x5999b5[_0x4937('0x34')];}_0x436b1b['status'](_0x991399)[_0x4937('0x35')](_0x5999b5);};}exports['index']=function(_0x53f7bb,_0x759309){var _0x1313cd={},_0x57e01f={},_0x58fba={'count':0x0,'rows':[]};var _0x3c85e0=_[_0x4937('0x36')](db[_0x4937('0x37')]['rawAttributes'],function(_0x2d8271){return{'name':_0x2d8271['fieldName'],'type':_0x2d8271[_0x4937('0x38')][_0x4937('0x39')]};});_0x57e01f['model']=_[_0x4937('0x36')](_0x3c85e0,_0x4937('0x34'));_0x57e01f[_0x4937('0x3a')]=_[_0x4937('0x3b')](_0x53f7bb[_0x4937('0x3a')]);_0x57e01f['filters']=_[_0x4937('0x3c')](_0x57e01f[_0x4937('0x3d')],_0x57e01f[_0x4937('0x3a')]);_0x1313cd[_0x4937('0x3e')]=_[_0x4937('0x3c')](_0x57e01f[_0x4937('0x3d')],qs[_0x4937('0x3f')](_0x53f7bb[_0x4937('0x3a')][_0x4937('0x3f')]));_0x1313cd[_0x4937('0x3e')]=_0x1313cd[_0x4937('0x3e')][_0x4937('0x40')]?_0x1313cd[_0x4937('0x3e')]:_0x57e01f[_0x4937('0x3d')];if(!_0x53f7bb[_0x4937('0x3a')][_0x4937('0x41')](_0x4937('0x42'))){_0x1313cd[_0x4937('0x2c')]=qs['limit'](_0x53f7bb[_0x4937('0x3a')][_0x4937('0x2c')]);_0x1313cd['offset']=qs[_0x4937('0x2a')](_0x53f7bb['query'][_0x4937('0x2a')]);}_0x1313cd['order']=qs['sort'](_0x53f7bb[_0x4937('0x3a')][_0x4937('0x43')]);_0x1313cd['where']=qs[_0x4937('0x44')](_['pick'](_0x53f7bb['query'],_0x57e01f['filters']),_0x3c85e0);if(_0x53f7bb[_0x4937('0x3a')][_0x4937('0x45')]){_0x1313cd[_0x4937('0x46')]=_['merge'](_0x1313cd[_0x4937('0x46')],{'$or':_['map'](_0x3c85e0,function(_0x690095){if(_0x690095['type']!=='VIRTUAL'){var _0x3a6598={};_0x3a6598[_0x690095['name']]={'$like':'%'+_0x53f7bb['query']['filter']+'%'};return _0x3a6598;}})});}_0x1313cd=_[_0x4937('0x47')]({},_0x1313cd,_0x53f7bb['options']);var _0x56b0f7={'where':_0x1313cd['where']};return db[_0x4937('0x37')][_0x4937('0x2d')](_0x56b0f7)[_0x4937('0x33')](function(_0x367f4b){_0x58fba[_0x4937('0x2d')]=_0x367f4b;if(_0x53f7bb['query'][_0x4937('0x48')]){_0x1313cd[_0x4937('0x49')]=[{'all':!![]}];}return db[_0x4937('0x37')][_0x4937('0x4a')](_0x1313cd);})[_0x4937('0x33')](function(_0x507171){_0x58fba[_0x4937('0x4b')]=_0x507171;return _0x58fba;})[_0x4937('0x33')](respondWithFilteredResult(_0x759309,_0x1313cd))[_0x4937('0x25')](handleError(_0x759309,null));};exports[_0x4937('0x4c')]=function(_0x8e7ded,_0x59e50f){var _0x46feb1={'raw':![],'where':{'id':_0x8e7ded['params']['id']}},_0x5d40c8={};_0x5d40c8[_0x4937('0x3d')]=_['keys'](db[_0x4937('0x37')][_0x4937('0x4d')]);_0x5d40c8[_0x4937('0x3a')]=_[_0x4937('0x3b')](_0x8e7ded[_0x4937('0x3a')]);_0x5d40c8[_0x4937('0x44')]=_[_0x4937('0x3c')](_0x5d40c8[_0x4937('0x3d')],_0x5d40c8[_0x4937('0x3a')]);_0x46feb1['attributes']=_[_0x4937('0x3c')](_0x5d40c8[_0x4937('0x3d')],qs[_0x4937('0x3f')](_0x8e7ded['query'][_0x4937('0x3f')]));_0x46feb1[_0x4937('0x3e')]=_0x46feb1[_0x4937('0x3e')]['length']?_0x46feb1[_0x4937('0x3e')]:_0x5d40c8[_0x4937('0x3d')];if(_0x8e7ded[_0x4937('0x3a')]['includeAll']){_0x46feb1[_0x4937('0x49')]=[{'all':!![]}];}_0x46feb1=_[_0x4937('0x47')]({},_0x46feb1,_0x8e7ded[_0x4937('0x4e')]);return db[_0x4937('0x37')][_0x4937('0x4f')](_0x46feb1)[_0x4937('0x33')](handleEntityNotFound(_0x59e50f,null))[_0x4937('0x33')](respondWithResult(_0x59e50f,null))[_0x4937('0x25')](handleError(_0x59e50f,null));};exports[_0x4937('0x31')]=function(_0x2b07e2,_0x6291ce){if(_0x2b07e2[_0x4937('0x50')]['id']){delete _0x2b07e2['body']['id'];}return db[_0x4937('0x37')][_0x4937('0x4f')]({'where':{'id':_0x2b07e2['params']['id']}})[_0x4937('0x33')](handleEntityNotFound(_0x6291ce,null))['then'](saveUpdates(_0x2b07e2[_0x4937('0x50')],null))[_0x4937('0x33')](respondWithResult(_0x6291ce,null))[_0x4937('0x25')](handleError(_0x6291ce,null));};exports[_0x4937('0x51')]=function(_0x327be2,_0x2b2a61,_0x15e782){if(_0x327be2['file']&&_0x327be2[_0x4937('0x52')][_0x4937('0x53')]){_0x327be2[_0x4937('0x50')][_0x4937('0x54')]=_0x327be2[_0x4937('0x52')]['filename'];}return db[_0x4937('0x37')][_0x4937('0x4f')]({'where':{'id':_0x327be2[_0x4937('0x55')]['id']}})[_0x4937('0x33')](handleEntityNotFound(_0x2b2a61,null))[_0x4937('0x33')](saveUpdates(_0x327be2[_0x4937('0x50')],null))['then'](respondWithResult(_0x2b2a61,null))[_0x4937('0x25')](handleError(_0x2b2a61,null));};exports[_0x4937('0x56')]=function(_0x15a1d8,_0x46a859,_0x31438e){if(_0x15a1d8[_0x4937('0x52')]&&_0x15a1d8['file']['filename']){_0x15a1d8['body']['loginLogo']=_0x15a1d8[_0x4937('0x52')][_0x4937('0x53')];}return db[_0x4937('0x37')]['find']({'where':{'id':_0x15a1d8[_0x4937('0x55')]['id']}})[_0x4937('0x33')](handleEntityNotFound(_0x46a859,null))[_0x4937('0x33')](saveUpdates(_0x15a1d8[_0x4937('0x50')],null))['then'](respondWithResult(_0x46a859,null))[_0x4937('0x25')](handleError(_0x46a859,null));};var utilLicense=require(_0x4937('0x16'));exports[_0x4937('0x57')]=function(_0xacdb67,_0x50c48a,_0x5a8899){var _0x57e412=_0x4937('0x58');var _0x410b59={'custom':![]};return utilLicense[_0x4937('0x59')]()['then'](function(_0x28e1f6){if(_0x28e1f6){_0x410b59=_0x28e1f6;}return db[_0x4937('0x37')][_0x4937('0x4f')]({'where':{'id':_0xacdb67['params']['id']},'attributes':['logo',_0x4937('0x5a'),_0x4937('0x5b'),_0x4937('0x5c'),_0x4937('0x5d'),'defaultLoginLogo',_0x4937('0x5e'),_0x4937('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x50c48a,null))[_0x4937('0x33')](function(_0xeb2c2b){if(_0xeb2c2b){var _0x3eebda=_0xeb2c2b[_0x4937('0x54')]&&fs[_0x4937('0x60')](path[_0x4937('0x61')](config[_0x4937('0x62')],_0x57e412,_[_0x4937('0x63')](_0xeb2c2b[_0x4937('0x54')])))?path['join'](config[_0x4937('0x62')],_0x57e412,_[_0x4937('0x63')](_0xeb2c2b[_0x4937('0x54')])):path[_0x4937('0x61')](config[_0x4937('0x62')],_0x57e412,_[_0x4937('0x63')]('default_logo.svg'));var _0x4101f7='default'+_[_0x4937('0x64')]('logo');if(_0xeb2c2b[_0x4101f7]||!_0x410b59[_0x4937('0x65')]){_0x3eebda=path[_0x4937('0x61')](config['root'],_0x57e412,_['toLower'](_0x4937('0x66')));}if(!fs[_0x4937('0x60')](_0x3eebda)){throw new db[(_0x4937('0x67'))]['ValidationError'](_[_0x4937('0x64')](_0x4937('0x54'))+_0x4937('0x68'));}return _0x50c48a[_0x4937('0x69')](_0x3eebda);}})[_0x4937('0x25')](handleError(_0x50c48a,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0xa94698,_0x1c6d05,_0x3db932){var _0x51782c=_0x4937('0x58');var _0x313c20={'custom':![]};return utilLicense['getLicense']()[_0x4937('0x33')](function(_0x300127){if(_0x300127){_0x313c20=_0x300127;}return db[_0x4937('0x37')][_0x4937('0x4f')]({'where':{'id':_0xa94698[_0x4937('0x55')]['id']},'attributes':[_0x4937('0x54'),_0x4937('0x5a'),'preferred',_0x4937('0x5c'),_0x4937('0x5d'),'defaultLoginLogo',_0x4937('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x4937('0x33')](handleEntityNotFound(_0x1c6d05,null))['then'](function(_0x4e13bd){if(_0x4e13bd){var _0x5d0418=_0x4e13bd['loginLogo']&&fs[_0x4937('0x60')](path['join'](config[_0x4937('0x62')],_0x51782c,_[_0x4937('0x63')](_0x4e13bd[_0x4937('0x5a')])))?path[_0x4937('0x61')](config[_0x4937('0x62')],_0x51782c,_[_0x4937('0x63')](_0x4e13bd[_0x4937('0x5a')])):path['join'](config[_0x4937('0x62')],_0x51782c,_[_0x4937('0x63')](_0x4937('0x6a')));var _0x46d15d=_0x4937('0x6b')+_[_0x4937('0x64')]('loginLogo');if(_0x4e13bd[_0x46d15d]||!_0x313c20[_0x4937('0x65')]){_0x5d0418=path[_0x4937('0x61')](config[_0x4937('0x62')],_0x51782c,_[_0x4937('0x63')](_0x4937('0x6a')));}if(!fs[_0x4937('0x60')](_0x5d0418)){throw new db[(_0x4937('0x67'))]['ValidationError'](_[_0x4937('0x64')](_0x4937('0x5a'))+_0x4937('0x68'));}return _0x1c6d05[_0x4937('0x69')](_0x5d0418);}})[_0x4937('0x25')](handleError(_0x1c6d05,null));};exports[_0x4937('0x6c')]=function(_0x2b25a1,_0x2f20fe){return db[_0x4937('0x37')][_0x4937('0x4f')]({'where':{'id':_0x2b25a1['params']['id']},'attributes':[_0x4937('0x6d')]})[_0x4937('0x33')](respondWithResult(_0x2f20fe,null))[_0x4937('0x25')](handleError(_0x2f20fe,null));};exports['addPreferred']=function(_0x22958a,_0x112cd3,_0x5a9126){if(_0x22958a[_0x4937('0x52')]&&_0x22958a[_0x4937('0x52')][_0x4937('0x53')]){_0x22958a[_0x4937('0x50')]['preferred']=_0x22958a['file'][_0x4937('0x53')];}return db[_0x4937('0x37')][_0x4937('0x4f')]({'where':{'id':_0x22958a[_0x4937('0x55')]['id']}})[_0x4937('0x33')](handleEntityNotFound(_0x112cd3,null))['then'](saveUpdates(_0x22958a[_0x4937('0x50')],null))[_0x4937('0x33')](respondWithResult(_0x112cd3,null))[_0x4937('0x25')](handleError(_0x112cd3,null));};var utilLicense=require('../../config/license/util');exports[_0x4937('0x6e')]=function(_0x77e931,_0x52be05,_0x20e33f){var _0x52c65a=_0x4937('0x58');var _0x612d15={'custom':![]};return utilLicense[_0x4937('0x59')]()['then'](function(_0x4c2e1a){if(_0x4c2e1a){_0x612d15=_0x4c2e1a;}return db['Setting'][_0x4937('0x4f')]({'where':{'id':_0x77e931[_0x4937('0x55')]['id']},'attributes':[_0x4937('0x54'),'loginLogo',_0x4937('0x5b'),_0x4937('0x5c'),_0x4937('0x5d'),'defaultLoginLogo',_0x4937('0x5e'),_0x4937('0x5f')],'raw':!![]});})[_0x4937('0x33')](handleEntityNotFound(_0x52be05,null))[_0x4937('0x33')](function(_0x3f0b52){if(_0x3f0b52){var _0x1ee706=_0x3f0b52[_0x4937('0x5b')]&&fs['existsSync'](path[_0x4937('0x61')](config[_0x4937('0x62')],_0x52c65a,_[_0x4937('0x63')](_0x3f0b52[_0x4937('0x5b')])))?path[_0x4937('0x61')](config[_0x4937('0x62')],_0x52c65a,_['toLower'](_0x3f0b52[_0x4937('0x5b')])):path['join'](config[_0x4937('0x62')],_0x52c65a,_['toLower'](_0x4937('0x6f')));var _0x158e9b='default'+_[_0x4937('0x64')]('preferred');if(_0x3f0b52[_0x158e9b]||!_0x612d15['custom']||!_0x612d15['preferred']){_0x1ee706=path[_0x4937('0x61')](config[_0x4937('0x62')],_0x52c65a,_[_0x4937('0x63')](_0x4937('0x6f')));}if(!fs['existsSync'](_0x1ee706)){throw new db[(_0x4937('0x67'))][(_0x4937('0x70'))](_[_0x4937('0x64')](_0x4937('0x5b'))+_0x4937('0x68'));}return _0x52be05[_0x4937('0x69')](_0x1ee706);}})[_0x4937('0x25')](handleError(_0x52be05,null));};exports['addFavicon']=function(_0x1ea417,_0x347e3c,_0x565cab){if(_0x1ea417[_0x4937('0x52')]&&_0x1ea417[_0x4937('0x52')][_0x4937('0x53')]){_0x1ea417[_0x4937('0x50')][_0x4937('0x5c')]=_0x1ea417[_0x4937('0x52')]['filename'];}return db[_0x4937('0x37')]['find']({'where':{'id':_0x1ea417[_0x4937('0x55')]['id']}})[_0x4937('0x33')](handleEntityNotFound(_0x347e3c,null))[_0x4937('0x33')](saveUpdates(_0x1ea417[_0x4937('0x50')],null))[_0x4937('0x33')](respondWithResult(_0x347e3c,null))[_0x4937('0x25')](handleError(_0x347e3c,null));};var utilLicense=require(_0x4937('0x16'));exports[_0x4937('0x71')]=function(_0x73243e,_0x5800b0,_0x4b2b53){var _0x2e6487=_0x4937('0x58');var _0x2380f7={'custom':![]};return utilLicense['getLicense']()[_0x4937('0x33')](function(_0x5398ee){if(_0x5398ee){_0x2380f7=_0x5398ee;}return db['Setting'][_0x4937('0x4f')]({'where':{'id':_0x73243e[_0x4937('0x55')]['id']},'attributes':['logo',_0x4937('0x5a'),_0x4937('0x5b'),_0x4937('0x5c'),'defaultLogo',_0x4937('0x72'),_0x4937('0x5e'),_0x4937('0x5f')],'raw':!![]});})[_0x4937('0x33')](handleEntityNotFound(_0x5800b0,null))['then'](function(_0x1c1f64){if(_0x1c1f64){var _0x3886a0=_0x1c1f64[_0x4937('0x5c')]&&fs[_0x4937('0x60')](path[_0x4937('0x61')](config[_0x4937('0x62')],_0x2e6487,_[_0x4937('0x63')](_0x1c1f64['favicon'])))?path[_0x4937('0x61')](config[_0x4937('0x62')],_0x2e6487,_[_0x4937('0x63')](_0x1c1f64[_0x4937('0x5c')])):path[_0x4937('0x61')](config[_0x4937('0x62')],_0x2e6487,_[_0x4937('0x63')](_0x4937('0x73')));var _0x2ada94=_0x4937('0x6b')+_[_0x4937('0x64')](_0x4937('0x5c'));if(_0x1c1f64[_0x2ada94]||!_0x2380f7[_0x4937('0x65')]){_0x3886a0=path[_0x4937('0x61')](config['root'],_0x2e6487,_[_0x4937('0x63')](_0x4937('0x73')));}if(!fs[_0x4937('0x60')](_0x3886a0)){throw new db[(_0x4937('0x67'))]['ValidationError'](_['upperFirst'](_0x4937('0x5c'))+_0x4937('0x68'));}return _0x5800b0[_0x4937('0x69')](_0x3886a0);}})[_0x4937('0x25')](handleError(_0x5800b0,null));};exports[_0x4937('0x74')]=function(_0x43fc90,_0x2205af){var _0x21a9fa={'offset':moment()[_0x4937('0x75')]()};_0x21a9fa[_0x4937('0x76')]=moment()['utcOffset'](_0x21a9fa[_0x4937('0x2a')])[_0x4937('0x77')](_0x4937('0x78'));return _0x2205af['status'](0xc8)[_0x4937('0x35')](_0x21a9fa);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8e3c4fb..e526245 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0xfbc3dc,_0x3a7830){var _0x48c818=function(_0x5e3a9b){while(--_0x5e3a9b){_0xfbc3dc['push'](_0xfbc3dc['shift']());}};_0x48c818(++_0x3a7830);}(_0x008c,0x188));var _0xc008=function(_0x383c94,_0x2c7402){_0x383c94=_0x383c94-0x0;var _0x149b61=_0x008c[_0x383c94];return _0x149b61;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0x55ca,0x126));var _0xa55c=function(_0x70fd53,_0x2a95a6){_0x70fd53=_0x70fd53-0x0;var _0x4b71c5=_0x55ca[_0x70fd53];return _0x4b71c5;};'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')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'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 b5ff60c..536d8f3 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 _0xdffe=['request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','attributes','include','map','model','info','ShowSetting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x56735a,_0x311842){var _0x1a6231=function(_0x391cb2){while(--_0x391cb2){_0x56735a['push'](_0x56735a['shift']());}};_0x1a6231(++_0x311842);}(_0xdffe,0x16a));var _0xedff=function(_0x11de83,_0x49e1c1){_0x11de83=_0x11de83-0x0;var _0x45bdb0=_0xdffe[_0x11de83];return _0x45bdb0;};'use strict';var _=require('lodash');var util=require(_0xedff('0x0'));var moment=require(_0xedff('0x1'));var BPromise=require(_0xedff('0x2'));var rs=require(_0xedff('0x3'));var fs=require('fs');var Redis=require(_0xedff('0x4'));var db=require(_0xedff('0x5'))['db'];var utils=require(_0xedff('0x6'));var logger=require(_0xedff('0x7'))(_0xedff('0x8'));var config=require(_0xedff('0x9'));var jayson=require(_0xedff('0xa'));var client=jayson[_0xedff('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x417c44,_0x147879,_0xfb3f27){return new BPromise(function(_0x4b2019,_0x5c51e4){return client[_0xedff('0xc')](_0x417c44,_0xfb3f27)[_0xedff('0xd')](function(_0x390ed1){logger['info'](_0xedff('0xe'),_0x147879,_0xedff('0xf'));logger[_0xedff('0x10')](_0xedff('0x11'),_0x147879,_0xedff('0xf'),JSON[_0xedff('0x12')](_0x390ed1));if(_0x390ed1[_0xedff('0x13')]){if(_0x390ed1[_0xedff('0x13')][_0xedff('0x14')]===0x1f4){logger[_0xedff('0x13')](_0xedff('0xe'),_0x147879,_0x390ed1['error']['message']);return _0x5c51e4(_0x390ed1['error'][_0xedff('0x15')]);}logger['error'](_0xedff('0xe'),_0x147879,_0x390ed1[_0xedff('0x13')][_0xedff('0x15')]);return _0x4b2019(_0x390ed1[_0xedff('0x13')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x147879,_0xedff('0xf'));_0x4b2019(_0x390ed1[_0xedff('0x16')][_0xedff('0x15')]);}})[_0xedff('0x17')](function(_0x4e4d91){logger[_0xedff('0x13')](_0xedff('0xe'),_0x147879,_0x4e4d91);_0x5c51e4(_0x4e4d91);});});}exports['ShowSetting']=function(_0x1038fd){var _0x2f2319=this;return new Promise(function(_0x10a989,_0x29a548){return db['Setting'][_0xedff('0x18')]({'raw':_0x1038fd[_0xedff('0x19')]?_0x1038fd[_0xedff('0x19')][_0xedff('0x1a')]===undefined?!![]:![]:!![],'where':_0x1038fd[_0xedff('0x19')]?_0x1038fd[_0xedff('0x19')][_0xedff('0x1b')]||null:null,'attributes':_0x1038fd[_0xedff('0x19')]?_0x1038fd[_0xedff('0x19')][_0xedff('0x1c')]||null:null,'include':_0x1038fd[_0xedff('0x19')]?_0x1038fd['options'][_0xedff('0x1d')]?_[_0xedff('0x1e')](_0x1038fd[_0xedff('0x19')][_0xedff('0x1d')],function(_0x2363f5){return{'model':db[_0x2363f5[_0xedff('0x1f')]],'as':_0x2363f5['as'],'attributes':_0x2363f5[_0xedff('0x1c')],'include':_0x2363f5[_0xedff('0x1d')]?_['map'](_0x2363f5[_0xedff('0x1d')],function(_0x3c6837){return{'model':db[_0x3c6837[_0xedff('0x1f')]],'as':_0x3c6837['as'],'attributes':_0x3c6837['attributes'],'include':_0x3c6837[_0xedff('0x1d')]?_[_0xedff('0x1e')](_0x3c6837[_0xedff('0x1d')],function(_0xee2d8e){return{'model':db[_0xee2d8e[_0xedff('0x1f')]],'as':_0xee2d8e['as'],'attributes':_0xee2d8e[_0xedff('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xedff('0xd')](function(_0x3345a6){logger[_0xedff('0x20')](_0xedff('0x21'),_0x1038fd);logger['debug']('ShowSetting',_0x1038fd,JSON['stringify'](_0x3345a6));_0x10a989(_0x3345a6);})['catch'](function(_0x5502e8){logger[_0xedff('0x13')](_0xedff('0x21'),_0x5502e8[_0xedff('0x15')],_0x1038fd);_0x29a548(_0x2f2319[_0xedff('0x13')](0x1f4,_0x5502e8['message']));});});}; \ No newline at end of file +var _0x69df=['ShowSetting','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','find','options','raw','attributes','include','map','model'];(function(_0x47da41,_0x27fa34){var _0x52cdc=function(_0x5d14f7){while(--_0x5d14f7){_0x47da41['push'](_0x47da41['shift']());}};_0x52cdc(++_0x27fa34);}(_0x69df,0xc8));var _0xf69d=function(_0x35a240,_0x5a8c71){_0x35a240=_0x35a240-0x0;var _0x3e8a29=_0x69df[_0x35a240];return _0x3e8a29;};'use strict';var _=require('lodash');var util=require(_0xf69d('0x0'));var moment=require(_0xf69d('0x1'));var BPromise=require('bluebird');var rs=require(_0xf69d('0x2'));var fs=require('fs');var Redis=require(_0xf69d('0x3'));var db=require(_0xf69d('0x4'))['db'];var utils=require(_0xf69d('0x5'));var logger=require(_0xf69d('0x6'))(_0xf69d('0x7'));var config=require(_0xf69d('0x8'));var jayson=require(_0xf69d('0x9'));var client=jayson[_0xf69d('0xa')][_0xf69d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5aa001,_0xa0ab49,_0x5badbf){return new BPromise(function(_0x101880,_0x469728){return client[_0xf69d('0xc')](_0x5aa001,_0x5badbf)[_0xf69d('0xd')](function(_0x5d2031){logger['info']('Setting,\x20%s,\x20%s',_0xa0ab49,_0xf69d('0xe'));logger[_0xf69d('0xf')](_0xf69d('0x10'),_0xa0ab49,_0xf69d('0xe'),JSON['stringify'](_0x5d2031));if(_0x5d2031[_0xf69d('0x11')]){if(_0x5d2031[_0xf69d('0x11')][_0xf69d('0x12')]===0x1f4){logger[_0xf69d('0x11')](_0xf69d('0x13'),_0xa0ab49,_0x5d2031[_0xf69d('0x11')][_0xf69d('0x14')]);return _0x469728(_0x5d2031['error'][_0xf69d('0x14')]);}logger[_0xf69d('0x11')](_0xf69d('0x13'),_0xa0ab49,_0x5d2031[_0xf69d('0x11')][_0xf69d('0x14')]);return _0x101880(_0x5d2031[_0xf69d('0x11')][_0xf69d('0x14')]);}else{logger[_0xf69d('0x15')](_0xf69d('0x13'),_0xa0ab49,'request\x20sent');_0x101880(_0x5d2031[_0xf69d('0x16')][_0xf69d('0x14')]);}})[_0xf69d('0x17')](function(_0x3422a1){logger[_0xf69d('0x11')](_0xf69d('0x13'),_0xa0ab49,_0x3422a1);_0x469728(_0x3422a1);});});}exports['ShowSetting']=function(_0x297877){var _0x1bf339=this;return new Promise(function(_0x404673,_0x186381){return db['Setting'][_0xf69d('0x18')]({'raw':_0x297877['options']?_0x297877[_0xf69d('0x19')][_0xf69d('0x1a')]===undefined?!![]:![]:!![],'where':_0x297877['options']?_0x297877[_0xf69d('0x19')]['where']||null:null,'attributes':_0x297877['options']?_0x297877[_0xf69d('0x19')][_0xf69d('0x1b')]||null:null,'include':_0x297877[_0xf69d('0x19')]?_0x297877[_0xf69d('0x19')][_0xf69d('0x1c')]?_[_0xf69d('0x1d')](_0x297877[_0xf69d('0x19')][_0xf69d('0x1c')],function(_0x510d52){return{'model':db[_0x510d52[_0xf69d('0x1e')]],'as':_0x510d52['as'],'attributes':_0x510d52[_0xf69d('0x1b')],'include':_0x510d52[_0xf69d('0x1c')]?_[_0xf69d('0x1d')](_0x510d52['include'],function(_0x19687c){return{'model':db[_0x19687c[_0xf69d('0x1e')]],'as':_0x19687c['as'],'attributes':_0x19687c[_0xf69d('0x1b')],'include':_0x19687c[_0xf69d('0x1c')]?_[_0xf69d('0x1d')](_0x19687c[_0xf69d('0x1c')],function(_0x56f332){return{'model':db[_0x56f332['model']],'as':_0x56f332['as'],'attributes':_0x56f332[_0xf69d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf69d('0xd')](function(_0x3f1c10){logger['info'](_0xf69d('0x1f'),_0x297877);logger['debug'](_0xf69d('0x1f'),_0x297877,JSON[_0xf69d('0x20')](_0x3f1c10));_0x404673(_0x3f1c10);})[_0xf69d('0x17')](function(_0x30e4b4){logger[_0xf69d('0x11')](_0xf69d('0x1f'),_0x30e4b4[_0xf69d('0x14')],_0x297877);_0x186381(_0x1bf339[_0xf69d('0x11')](0x1f4,_0x30e4b4[_0xf69d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index f4ca32d..08ea7bc 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(_0x404458,_0x320912){var _0x5313c9=function(_0x495af9){while(--_0x495af9){_0x404458['push'](_0x404458['shift']());}};_0x5313c9(++_0x320912);}(_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('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 _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(_0xecf14c,_0x25eb68){var _0x328c11=function(_0x5e4eae){while(--_0x5e4eae){_0xecf14c['push'](_0xecf14c['shift']());}};_0x328c11(++_0x25eb68);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',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 diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index cfb7c8b..dc60854 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 _0x6ef3=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','skebby','connectel','plivo','clickatell','bandwidth','infobip','intelepeer','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x318dbf,_0x5a8009){var _0x21b92e=function(_0x36eda4){while(--_0x36eda4){_0x318dbf['push'](_0x318dbf['shift']());}};_0x21b92e(++_0x5a8009);}(_0x6ef3,0x15b));var _0x36ef=function(_0x38a26d,_0x19ba99){_0x38a26d=_0x38a26d-0x0;var _0xd90c30=_0x6ef3[_0x38a26d];return _0xd90c30;};'use strict';var Sequelize=require(_0x36ef('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x36ef('0x1')],'unique':_0x36ef('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x36ef('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x36ef('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x36ef('0x3')]();}},'phone':{'type':Sequelize[_0x36ef('0x1')]},'type':{'type':Sequelize[_0x36ef('0x4')]('twilio',_0x36ef('0x5'),_0x36ef('0x6'),'clicksend',_0x36ef('0x7'),_0x36ef('0x8'),_0x36ef('0x9'),'csc',_0x36ef('0xa'),_0x36ef('0xb'))},'accountSid':{'type':Sequelize[_0x36ef('0x1')]},'authId':{'type':Sequelize[_0x36ef('0x1')]},'authToken':{'type':Sequelize[_0x36ef('0x1')]},'smsMethod':{'type':Sequelize[_0x36ef('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x36ef('0x1')]},'password':{'type':Sequelize[_0x36ef('0x1')]},'apiKey':{'type':Sequelize[_0x36ef('0x1')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x36ef('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x36ef('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x36ef('0xc');}},'notificationSound':{'type':Sequelize[_0x36ef('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x36ef('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x36ef('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x36ef('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x36ef('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x36ef('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x36ef('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x36ef('0xe')],'comment':_0x36ef('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x36ef('0x10'),'set':function(_0x22f9db){if(!_0x22f9db)this[_0x36ef('0x11')](_0x36ef('0x12'),null);this[_0x36ef('0x11')](_0x36ef('0x13'),_0x22f9db);}}}; \ No newline at end of file +var _0x65c4=['skebby','connectel','clicksend','plivo','bandwidth','csc','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x65c4,0x9c));var _0x465c=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x65c4[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x465c('0x0'));module[_0x465c('0x1')]={'name':{'type':Sequelize[_0x465c('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x465c('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x465c('0x2')],'defaultValue':function(){return rs[_0x465c('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio',_0x465c('0x4'),_0x465c('0x5'),_0x465c('0x6'),_0x465c('0x7'),'clickatell',_0x465c('0x8'),_0x465c('0x9'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x465c('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x465c('0xa')]('SI','TI','GP')},'username':{'type':Sequelize[_0x465c('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x465c('0x2')]},'accountId':{'type':Sequelize[_0x465c('0x2')]},'senderString':{'type':Sequelize[_0x465c('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x465c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x465c('0xb')],'defaultValue':function(){return _0x465c('0xc');}},'notificationSound':{'type':Sequelize[_0x465c('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x465c('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x465c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x465c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x465c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x465c('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x465c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x465c('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x465c('0xe')],'comment':_0x465c('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x465c('0xd')],'defaultValue':![],'comment':_0x465c('0x10'),'set':function(_0x572203){if(!_0x572203)this[_0x465c('0x11')](_0x465c('0x12'),null);this['setDataValue'](_0x465c('0x13'),_0x572203);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 86c7d61..0fb2ddd 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 _0xdb11=['DELIVERED','groupName','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','http','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','offset','undefined','count','Content-Range','json','save','update','then','destroy','get','SmsAccounts','end','stack','name','index','SmsAccount','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','mandatoryDispositionPause','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Pause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','pick','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','Body','MessageSid','skebby','from','sender','text','messageId','message_id','plivo','From','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','SmsQueue','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','options','getInteractions','Contact','Owner','fullname','Tag','color','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','inspect','skebby_dispatch_id','connectel','statusInt','requestid','clicksend','status_code'];(function(_0x5a9055,_0x48668d){var _0x24a9ae=function(_0x9c8b6c){while(--_0x9c8b6c){_0x5a9055['push'](_0x5a9055['shift']());}};_0x24a9ae(++_0x48668d);}(_0xdb11,0x1f1));var _0x1db1=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xdb11[_0x18abd2];return _0x1dcad6;};'use strict';var emlformat=require(_0x1db1('0x0'));var rimraf=require(_0x1db1('0x1'));var zipdir=require(_0x1db1('0x2'));var jsonpatch=require(_0x1db1('0x3'));var rp=require(_0x1db1('0x4'));var moment=require('moment');var BPromise=require(_0x1db1('0x5'));var Mustache=require(_0x1db1('0x6'));var util=require('util');var path=require(_0x1db1('0x7'));var sox=require(_0x1db1('0x8'));var csv=require(_0x1db1('0x9'));var ejs=require(_0x1db1('0xa'));var fs=require('fs');var fs_extra=require(_0x1db1('0xb'));var _=require(_0x1db1('0xc'));var squel=require(_0x1db1('0xd'));var crypto=require(_0x1db1('0xe'));var jsforce=require(_0x1db1('0xf'));var deskjs=require(_0x1db1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1db1('0x11'));var Papa=require(_0x1db1('0x12'));var Redis=require(_0x1db1('0x13'));var authService=require(_0x1db1('0x14'));var qs=require(_0x1db1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1db1('0x16'))(_0x1db1('0x17'));var utils=require(_0x1db1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1db1('0x19'));var db=require(_0x1db1('0x1a'))['db'];config[_0x1db1('0x1b')]=_[_0x1db1('0x1c')](config[_0x1db1('0x1b')],{'host':_0x1db1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1db1('0x1e'))[_0x1db1('0x1f')](socket);var jayson=require(_0x1db1('0x20'));var client=jayson['client'][_0x1db1('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x4456a5,_0x3293b7,_0x2f6894,_0x450afb){return new BPromise(function(_0x2b43dc,_0x171739){var _0x2a0894=_0x450afb||client;return _0x2a0894[_0x1db1('0x22')](_0x4456a5,_0x2f6894)['then'](function(_0x42d7d6){logger['info'](_0x1db1('0x23'),_0x3293b7,_0x1db1('0x24'));logger[_0x1db1('0x25')](_0x1db1('0x26'),_0x3293b7,_0x1db1('0x24'),JSON[_0x1db1('0x27')](_0x42d7d6));if(_0x42d7d6['error']){if(_0x42d7d6[_0x1db1('0x28')][_0x1db1('0x29')]===0x1f4){logger['error'](_0x1db1('0x23'),_0x3293b7,_0x42d7d6[_0x1db1('0x28')][_0x1db1('0x2a')]);return _0x171739(_0x42d7d6[_0x1db1('0x28')][_0x1db1('0x2a')]);}logger[_0x1db1('0x28')](_0x1db1('0x23'),_0x3293b7,_0x42d7d6[_0x1db1('0x28')][_0x1db1('0x2a')]);return _0x2b43dc(_0x42d7d6[_0x1db1('0x28')]['message']);}else{logger[_0x1db1('0x2b')](_0x1db1('0x23'),_0x3293b7,_0x1db1('0x24'));_0x2b43dc(_0x42d7d6[_0x1db1('0x2c')][_0x1db1('0x2a')]);}})[_0x1db1('0x2d')](function(_0x5942b0){logger[_0x1db1('0x28')]('SmsAccount,\x20%s,\x20%s',_0x3293b7,_0x5942b0);_0x171739(_0x5942b0);});});}function respondWithStatusCode(_0x233872,_0x57e128){_0x57e128=_0x57e128||0xcc;return function(_0x1f257b){if(_0x1f257b){return _0x233872[_0x1db1('0x2e')](_0x57e128);}return _0x233872[_0x1db1('0x2f')](_0x57e128)['end']();};}function respondWithResult(_0x1c0fc0,_0x296ef3){_0x296ef3=_0x296ef3||0xc8;return function(_0x378f1){if(_0x378f1){return _0x1c0fc0[_0x1db1('0x2f')](_0x296ef3)['json'](_0x378f1);}};}function respondWithFilteredResult(_0x390434,_0x27002a){return function(_0x507d47){if(_0x507d47){var _0x511b6f=typeof _0x27002a[_0x1db1('0x30')]===_0x1db1('0x31')&&typeof _0x27002a['limit']===_0x1db1('0x31');var _0x5195b0=_0x507d47[_0x1db1('0x32')];var _0x1daaf0=_0x511b6f?0x0:_0x27002a[_0x1db1('0x30')];var _0x31fee6=_0x511b6f?_0x507d47['count']:_0x27002a[_0x1db1('0x30')]+_0x27002a['limit'];var _0x3de064;if(_0x31fee6>=_0x5195b0){_0x31fee6=_0x5195b0;_0x3de064=0xc8;}else{_0x3de064=0xce;}_0x390434['status'](_0x3de064);return _0x390434['set'](_0x1db1('0x33'),_0x1daaf0+'-'+_0x31fee6+'/'+_0x5195b0)[_0x1db1('0x34')](_0x507d47);}return null;};}function patchUpdates(_0x492736){return function(_0xf28c9c){try{jsonpatch['apply'](_0xf28c9c,_0x492736,!![]);}catch(_0x1876d3){return BPromise['reject'](_0x1876d3);}return _0xf28c9c[_0x1db1('0x35')]();};}function saveUpdates(_0x4db244,_0x1153e9){return function(_0x1b9527){if(_0x1b9527){return _0x1b9527[_0x1db1('0x36')](_0x4db244)[_0x1db1('0x37')](function(_0x569c7b){return _0x569c7b;});}return null;};}function removeEntity(_0x499a16,_0x117ab9){return function(_0x42248a){if(_0x42248a){return _0x42248a[_0x1db1('0x38')]()[_0x1db1('0x37')](function(){var _0x5ca601=_0x42248a[_0x1db1('0x39')]({'plain':!![]});var _0x1f93e2=_0x1db1('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x1f93e2,'resourceId':_0x5ca601['id']}})[_0x1db1('0x37')](function(){return _0x42248a;});})[_0x1db1('0x37')](function(){_0x499a16[_0x1db1('0x2f')](0xcc)[_0x1db1('0x3b')]();});}};}function handleEntityNotFound(_0x5cdf82,_0x372143){return function(_0x234337){if(!_0x234337){_0x5cdf82['sendStatus'](0x194);}return _0x234337;};}function handleError(_0x2c8d0c,_0x5262b3){_0x5262b3=_0x5262b3||0x1f4;return function(_0x2312ea){logger['error'](_0x2312ea[_0x1db1('0x3c')]);if(_0x2312ea[_0x1db1('0x3d')]){delete _0x2312ea['name'];}_0x2c8d0c[_0x1db1('0x2f')](_0x5262b3)['send'](_0x2312ea);};}exports[_0x1db1('0x3e')]=function(_0x5490fd,_0x4b450a){var _0x358b84={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4d0afa={},_0x5d1971={'count':0x0,'rows':[]};var _0x5d2e02=_['map'](db[_0x1db1('0x3f')][_0x1db1('0x40')],function(_0x3f3616){return{'name':_0x3f3616[_0x1db1('0x41')],'type':_0x3f3616[_0x1db1('0x42')][_0x1db1('0x43')]};});_0x4d0afa[_0x1db1('0x44')]=_[_0x1db1('0x45')](_0x5d2e02,_0x1db1('0x3d'));_0x4d0afa['query']=_[_0x1db1('0x46')](_0x5490fd[_0x1db1('0x47')]);_0x4d0afa['filters']=_[_0x1db1('0x48')](_0x4d0afa[_0x1db1('0x44')],_0x4d0afa[_0x1db1('0x47')]);_0x358b84['attributes']=_['intersection'](_0x4d0afa[_0x1db1('0x44')],qs[_0x1db1('0x49')](_0x5490fd['query'][_0x1db1('0x49')]));_0x358b84['attributes']=_0x358b84['attributes'][_0x1db1('0x4a')]?_0x358b84[_0x1db1('0x4b')]:_0x4d0afa[_0x1db1('0x44')];if(!_0x5490fd[_0x1db1('0x47')][_0x1db1('0x4c')](_0x1db1('0x4d'))){_0x358b84[_0x1db1('0x4e')]=qs[_0x1db1('0x4e')](_0x5490fd[_0x1db1('0x47')][_0x1db1('0x4e')]);_0x358b84[_0x1db1('0x30')]=qs[_0x1db1('0x30')](_0x5490fd[_0x1db1('0x47')]['offset']);}_0x358b84['order']=qs[_0x1db1('0x4f')](_0x5490fd[_0x1db1('0x47')][_0x1db1('0x4f')]);_0x358b84[_0x1db1('0x50')]=qs[_0x1db1('0x51')](_['pick'](_0x5490fd['query'],_0x4d0afa['filters']),_0x5d2e02);if(_0x5490fd[_0x1db1('0x47')][_0x1db1('0x52')]){_0x358b84[_0x1db1('0x50')]=_['merge'](_0x358b84['where'],{'$or':_[_0x1db1('0x45')](_0x5d2e02,function(_0x3ab183){if(_0x3ab183['type']!==_0x1db1('0x53')){var _0x5cb16e={};_0x5cb16e[_0x3ab183[_0x1db1('0x3d')]]={'$like':'%'+_0x5490fd['query'][_0x1db1('0x52')]+'%'};return _0x5cb16e;}})});}_0x358b84=_[_0x1db1('0x54')]({},_0x358b84,_0x5490fd['options']);var _0x38a969={'where':_0x358b84[_0x1db1('0x50')]};return db['SmsAccount'][_0x1db1('0x32')](_0x38a969)['then'](function(_0x456f2a){_0x5d1971[_0x1db1('0x32')]=_0x456f2a;if(_0x5490fd[_0x1db1('0x47')][_0x1db1('0x55')]){_0x358b84['include']=[{'all':!![]}];}return db[_0x1db1('0x3f')][_0x1db1('0x56')](_0x358b84);})[_0x1db1('0x37')](function(_0x4e3daf){_0x5d1971[_0x1db1('0x57')]=_0x4e3daf;return _0x5d1971;})[_0x1db1('0x37')](respondWithFilteredResult(_0x4b450a,_0x358b84))[_0x1db1('0x2d')](handleError(_0x4b450a,null));};exports[_0x1db1('0x58')]=function(_0x3b8f6c,_0x57a5df){var _0x1935dc={'raw':![],'where':{'id':_0x3b8f6c[_0x1db1('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x1db1('0x5a')}]},_0x39ca63={};_0x39ca63[_0x1db1('0x44')]=_[_0x1db1('0x46')](db['SmsAccount'][_0x1db1('0x40')]);_0x39ca63['query']=_['keys'](_0x3b8f6c[_0x1db1('0x47')]);_0x39ca63[_0x1db1('0x51')]=_[_0x1db1('0x48')](_0x39ca63['model'],_0x39ca63[_0x1db1('0x47')]);_0x1935dc['attributes']=_[_0x1db1('0x48')](_0x39ca63[_0x1db1('0x44')],qs['fields'](_0x3b8f6c['query'][_0x1db1('0x49')]));_0x1935dc[_0x1db1('0x4b')]=_0x1935dc['attributes'][_0x1db1('0x4a')]?_0x1935dc[_0x1db1('0x4b')]:_0x39ca63[_0x1db1('0x44')];if(_0x3b8f6c[_0x1db1('0x47')][_0x1db1('0x55')]){_0x1935dc[_0x1db1('0x5b')]=[{'all':!![]}];}_0x1935dc=_[_0x1db1('0x54')]({},_0x1935dc,_0x3b8f6c['options']);return db[_0x1db1('0x3f')]['find'](_0x1935dc)['then'](handleEntityNotFound(_0x57a5df,null))['then'](respondWithResult(_0x57a5df,null))[_0x1db1('0x2d')](handleError(_0x57a5df,null));};exports[_0x1db1('0x5c')]=function(_0xe94bb7,_0x590b56){return db[_0x1db1('0x3f')]['create'](_0xe94bb7[_0x1db1('0x5d')],{})['then'](function(_0xa54a5){var _0x1c052a=_0xe94bb7[_0x1db1('0x5e')][_0x1db1('0x39')]({'plain':!![]});if(!_0x1c052a)throw new Error(_0x1db1('0x5f'));if(_0x1c052a['role']===_0x1db1('0x5e')){var _0x11cacd=_0xa54a5['get']({'plain':!![]});var _0x51d30b=_0x1db1('0x3a');return db[_0x1db1('0x60')][_0x1db1('0x61')]({'where':{'name':_0x51d30b,'userProfileId':_0x1c052a[_0x1db1('0x62')]},'raw':!![]})[_0x1db1('0x37')](function(_0x4bb24e){if(_0x4bb24e&&_0x4bb24e[_0x1db1('0x63')]===0x0){return db[_0x1db1('0x64')][_0x1db1('0x5c')]({'name':_0x11cacd[_0x1db1('0x3d')],'resourceId':_0x11cacd['id'],'type':_0x4bb24e[_0x1db1('0x3d')],'sectionId':_0x4bb24e['id']},{})[_0x1db1('0x37')](function(){return _0xa54a5;});}else{return _0xa54a5;}})[_0x1db1('0x2d')](function(_0x19286d){logger[_0x1db1('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19286d);throw _0x19286d;});}return _0xa54a5;})['then'](respondWithResult(_0x590b56,0xc9))[_0x1db1('0x2d')](handleError(_0x590b56,null));};exports['update']=function(_0x26e005,_0x3fc0e1){if(_0x26e005['body']['id']){delete _0x26e005[_0x1db1('0x5d')]['id'];}return db['SmsAccount'][_0x1db1('0x61')]({'where':{'id':_0x26e005[_0x1db1('0x59')]['id']},'include':[{'model':db[_0x1db1('0x65')],'as':_0x1db1('0x5a')}]})['then'](handleEntityNotFound(_0x3fc0e1,null))[_0x1db1('0x37')](saveUpdates(_0x26e005[_0x1db1('0x5d')],null))['then'](respondWithResult(_0x3fc0e1,null))[_0x1db1('0x2d')](handleError(_0x3fc0e1,null));};exports[_0x1db1('0x38')]=function(_0x4f809f,_0xbc9d59){return db[_0x1db1('0x3f')][_0x1db1('0x61')]({'where':{'id':_0x4f809f[_0x1db1('0x59')]['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0xbc9d59,null))[_0x1db1('0x37')](removeEntity(_0xbc9d59,null))['catch'](handleError(_0xbc9d59,null));};exports[_0x1db1('0x66')]=function(_0x3a4365,_0x58996e){return db[_0x1db1('0x3f')][_0x1db1('0x66')]()[_0x1db1('0x37')](respondWithResult(_0x58996e,null))['catch'](handleError(_0x58996e,null));};exports[_0x1db1('0x67')]=function(_0x275a27,_0xd61626,_0x2c568d){if(_0x275a27[_0x1db1('0x5d')]['id']){delete _0x275a27['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x275a27[_0x1db1('0x59')]['id']}})['then'](handleEntityNotFound(_0xd61626,null))[_0x1db1('0x37')](function(_0x1d4dbb){if(_0x1d4dbb){_0x275a27[_0x1db1('0x5d')][_0x1db1('0x68')]=_0x1d4dbb['id'];return db[_0x1db1('0x69')][_0x1db1('0x5c')](_0x275a27[_0x1db1('0x5d')]);}})[_0x1db1('0x37')](respondWithResult(_0xd61626,null))[_0x1db1('0x2d')](handleError(_0xd61626,null));};exports[_0x1db1('0x6a')]=function(_0x36222d,_0xe2bbcd,_0x4965d8){var _0x2b1586={'raw':![],'where':{}};var _0x136983={};var _0x4ff25e={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x36222d[_0x1db1('0x59')]['id']}})['then'](handleEntityNotFound(_0xe2bbcd,null))[_0x1db1('0x37')](function(_0x2d85af){if(_0x2d85af){_0x136983[_0x1db1('0x44')]=_['keys'](db[_0x1db1('0x69')]['rawAttributes']);_0x136983['query']=_[_0x1db1('0x46')](_0x36222d[_0x1db1('0x47')]);_0x136983[_0x1db1('0x51')]=_[_0x1db1('0x48')](_0x136983[_0x1db1('0x44')],_0x136983[_0x1db1('0x47')]);_0x2b1586[_0x1db1('0x4b')]=_[_0x1db1('0x48')](_0x136983[_0x1db1('0x44')],qs['fields'](_0x36222d['query'][_0x1db1('0x49')]));_0x2b1586[_0x1db1('0x4b')]=_0x2b1586[_0x1db1('0x4b')]['length']?_0x2b1586[_0x1db1('0x4b')]:_0x136983[_0x1db1('0x44')];if(!_0x36222d[_0x1db1('0x47')][_0x1db1('0x4c')](_0x1db1('0x4d'))){_0x2b1586['limit']=qs[_0x1db1('0x4e')](_0x36222d[_0x1db1('0x47')][_0x1db1('0x4e')]);_0x2b1586['offset']=qs[_0x1db1('0x30')](_0x36222d['query'][_0x1db1('0x30')]);}_0x2b1586[_0x1db1('0x6b')]=qs[_0x1db1('0x4f')](_0x36222d[_0x1db1('0x47')][_0x1db1('0x4f')]);_0x2b1586[_0x1db1('0x50')]=qs[_0x1db1('0x51')](_['pick'](_0x36222d['query'],_0x136983['filters']));_0x2b1586['where'][_0x1db1('0x68')]=_0x2d85af['id'];if(_0x36222d[_0x1db1('0x47')][_0x1db1('0x52')]){_0x2b1586[_0x1db1('0x50')]=_[_0x1db1('0x54')](_0x2b1586['where'],{'$or':_[_0x1db1('0x45')](_0x2b1586['attributes'],function(_0x535cc1){var _0x4c01fd={};_0x4c01fd[_0x535cc1]={'$like':'%'+_0x36222d['query'][_0x1db1('0x52')]+'%'};return _0x4c01fd;})});}_0x2b1586=_[_0x1db1('0x54')]({},_0x2b1586,_0x36222d['options']);return db[_0x1db1('0x69')][_0x1db1('0x32')]({'where':_0x2b1586[_0x1db1('0x50')]})[_0x1db1('0x37')](function(_0x2a1b6f){_0x4ff25e[_0x1db1('0x32')]=_0x2a1b6f;if(_0x36222d[_0x1db1('0x47')][_0x1db1('0x55')]){_0x2b1586[_0x1db1('0x5b')]=[{'all':!![]}];}return db[_0x1db1('0x69')]['findAll'](_0x2b1586);})['then'](function(_0x4e7a93){_0x4ff25e[_0x1db1('0x57')]=_0x4e7a93;return _0x4ff25e;});}})[_0x1db1('0x37')](respondWithFilteredResult(_0xe2bbcd,_0x2b1586))['catch'](handleError(_0xe2bbcd,null));};exports[_0x1db1('0x6c')]=function(_0x58581e,_0x543462,_0x3e6632){return db[_0x1db1('0x3f')][_0x1db1('0x61')]({'where':{'id':_0x58581e[_0x1db1('0x59')]['id']}})['then'](handleEntityNotFound(_0x543462,null))[_0x1db1('0x37')](function(_0x2628d2){if(_0x2628d2){return _0x2628d2[_0x1db1('0x6c')](_0x58581e['query'][_0x1db1('0x6d')]);}})[_0x1db1('0x37')](respondWithStatusCode(_0x543462,null))[_0x1db1('0x2d')](handleError(_0x543462,null));};exports[_0x1db1('0x6e')]=function(_0x41f44c,_0x2dfb36,_0x3a6627){if(_0x41f44c[_0x1db1('0x5d')]['id']){delete _0x41f44c['body']['id'];}return db[_0x1db1('0x3f')][_0x1db1('0x61')]({'where':{'id':_0x41f44c[_0x1db1('0x59')]['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x2dfb36,null))[_0x1db1('0x37')](function(_0x226a6c){if(_0x226a6c){_0x41f44c[_0x1db1('0x5d')][_0x1db1('0x68')]=_0x226a6c['id'];return db[_0x1db1('0x6f')][_0x1db1('0x5c')](_0x41f44c['body']);}})[_0x1db1('0x37')](respondWithResult(_0x2dfb36,null))['catch'](handleError(_0x2dfb36,null));};exports[_0x1db1('0x70')]=function(_0x577c70,_0x155b3d,_0x57af6d){var _0x57e1ed={'raw':![],'where':{}};var _0x321b65={};var _0x4db4fc={'count':0x0,'rows':[]};return db[_0x1db1('0x3f')][_0x1db1('0x71')]({'where':{'id':_0x577c70['params']['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x155b3d,null))['then'](function(_0x4678ce){if(_0x4678ce){_0x321b65[_0x1db1('0x44')]=_['keys'](db[_0x1db1('0x6f')][_0x1db1('0x40')]);_0x321b65[_0x1db1('0x47')]=_[_0x1db1('0x46')](_0x577c70[_0x1db1('0x47')]);_0x321b65['filters']=_[_0x1db1('0x48')](_0x321b65[_0x1db1('0x44')],_0x321b65['query']);_0x57e1ed[_0x1db1('0x4b')]=_[_0x1db1('0x48')](_0x321b65['model'],qs[_0x1db1('0x49')](_0x577c70['query'][_0x1db1('0x49')]));_0x57e1ed[_0x1db1('0x4b')]=_0x57e1ed['attributes'][_0x1db1('0x4a')]?_0x57e1ed[_0x1db1('0x4b')]:_0x321b65[_0x1db1('0x44')];if(!_0x577c70[_0x1db1('0x47')][_0x1db1('0x4c')]('nolimit')){_0x57e1ed['limit']=qs[_0x1db1('0x4e')](_0x577c70['query'][_0x1db1('0x4e')]);_0x57e1ed[_0x1db1('0x30')]=qs[_0x1db1('0x30')](_0x577c70[_0x1db1('0x47')][_0x1db1('0x30')]);}_0x57e1ed[_0x1db1('0x6b')]=qs[_0x1db1('0x4f')](_0x577c70['query'][_0x1db1('0x4f')]);_0x57e1ed[_0x1db1('0x50')]=qs[_0x1db1('0x51')](_[_0x1db1('0x72')](_0x577c70[_0x1db1('0x47')],_0x321b65['filters']));_0x57e1ed['where'][_0x1db1('0x68')]=_0x4678ce['id'];if(_0x577c70[_0x1db1('0x47')][_0x1db1('0x52')]){_0x57e1ed[_0x1db1('0x50')]=_[_0x1db1('0x54')](_0x57e1ed[_0x1db1('0x50')],{'$or':_[_0x1db1('0x45')](_0x57e1ed[_0x1db1('0x4b')],function(_0x450ca6){var _0x203cfe={};_0x203cfe[_0x450ca6]={'$like':'%'+_0x577c70[_0x1db1('0x47')]['filter']+'%'};return _0x203cfe;})});}_0x57e1ed=_['merge']({},_0x57e1ed,_0x577c70['options']);return db[_0x1db1('0x6f')][_0x1db1('0x32')]({'where':_0x57e1ed[_0x1db1('0x50')]})['then'](function(_0x2579af){_0x4db4fc[_0x1db1('0x32')]=_0x2579af;if(_0x577c70[_0x1db1('0x47')][_0x1db1('0x55')]){_0x57e1ed[_0x1db1('0x5b')]=[{'all':!![]}];}return db[_0x1db1('0x6f')][_0x1db1('0x56')](_0x57e1ed);})[_0x1db1('0x37')](function(_0x465ab9){_0x4db4fc[_0x1db1('0x57')]=_0x465ab9;return _0x4db4fc;});}})[_0x1db1('0x37')](respondWithFilteredResult(_0x155b3d,_0x57e1ed))[_0x1db1('0x2d')](handleError(_0x155b3d,null));};exports['removeAnswers']=function(_0x3128d3,_0x1c03d5,_0x4fcd61){return db[_0x1db1('0x3f')][_0x1db1('0x61')]({'where':{'id':_0x3128d3['params']['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x1c03d5,null))[_0x1db1('0x37')](function(_0x3f44fc){if(_0x3f44fc){return _0x3f44fc['removeAnswers'](_0x3128d3['query'][_0x1db1('0x6d')]);}})[_0x1db1('0x37')](respondWithStatusCode(_0x1c03d5,null))['catch'](handleError(_0x1c03d5,null));};exports[_0x1db1('0x73')]=function(_0x2b3f1b,_0xd14a72,_0x2eba23){var _0x5c05a9={'channel':_0x1db1('0x74')};var _0x2bbe94=[];var _0x4b4e39=[];var _0x18ec41={};return db['SmsAccount'][_0x1db1('0x61')]({'where':{'id':_0x2b3f1b[_0x1db1('0x59')]['id']},'include':[{'model':db[_0x1db1('0x75')],'as':_0x1db1('0x76')}]})[_0x1db1('0x37')](handleEntityNotFound(_0xd14a72,null))[_0x1db1('0x37')](function(_0x1faf25){_0x5c05a9[_0x1db1('0x77')]=_0x1faf25;_0x5c05a9[_0x1db1('0x78')]=_[_0x1db1('0x79')](_0x1faf25[_0x1db1('0x76')],[_0x1db1('0x7a')],['asc']);if(_0x5c05a9[_0x1db1('0x77')]['Applications']){delete _0x5c05a9['account'][_0x1db1('0x76')];}return db[_0x1db1('0x7b')][_0x1db1('0x66')]();})['then'](function(_0x463767){if(!_0x463767){throw new db[(_0x1db1('0x7c'))][(_0x1db1('0x7d'))](_0x1db1('0x7e'));}_0x2bbe94=_['difference'](_['keys'](_0x463767),[_0x1db1('0x7f'),_0x1db1('0x80')]);_0x4b4e39=_[_0x1db1('0x81')](_['keys'](_0x463767),[_0x1db1('0x7f'),_0x1db1('0x80'),_0x1db1('0x82'),_0x1db1('0x83')]);_0x5c05a9['body']={'mapKey':_0x1db1('0x84')};if(_0x5c05a9[_0x1db1('0x77')]['type']){switch(_0x5c05a9[_0x1db1('0x77')][_0x1db1('0x42')]){case'twilio':_0x5c05a9[_0x1db1('0x5d')]['from']=_0x2b3f1b[_0x1db1('0x5d')]['From'];_0x5c05a9['body']['body']=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x85')];_0x5c05a9[_0x1db1('0x5d')]['messageId']=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x86')];break;case _0x1db1('0x87'):_0x5c05a9['body'][_0x1db1('0x88')]='+'+_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x89')];_0x5c05a9['body'][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x8a')];break;case'connectel':_0x5c05a9['body']['from']=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x88')];_0x5c05a9['body'][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x2a')];break;case'clicksend':_0x5c05a9['body'][_0x1db1('0x88')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x88')];_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')]['body'];_0x5c05a9['body'][_0x1db1('0x8b')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x8c')];break;case _0x1db1('0x8d'):_0x5c05a9['body'][_0x1db1('0x88')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x8e')];_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')]['Text'];_0x5c05a9['body']['messageId']=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x8f')];break;case _0x1db1('0x90'):_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x88')]='+'+_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x91')][0x0][_0x1db1('0x88')];_0x5c05a9['body'][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')]['results'][0x0][_0x1db1('0x8a')];_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x8b')]=_0x2b3f1b[_0x1db1('0x5d')]['results'][0x0][_0x1db1('0x8b')];break;case _0x1db1('0x92'):_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x88')]=_0x2b3f1b[_0x1db1('0x5d')]['originatingAddress'];_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x93')]['message'];break;case _0x1db1('0x94'):_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x88')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x95')];_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x8a')];_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x8b')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x96')];break;case _0x1db1('0x97'):_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x8b')]=_0x2b3f1b[_0x1db1('0x5d')][0x0][_0x1db1('0x2a')]['id'];_0x5c05a9['body'][_0x1db1('0x88')]=_0x2b3f1b[_0x1db1('0x5d')][0x0][_0x1db1('0x2a')]['from'];_0x5c05a9[_0x1db1('0x5d')]['body']=_0x2b3f1b[_0x1db1('0x5d')][0x0][_0x1db1('0x2a')][_0x1db1('0x8a')];break;case _0x1db1('0x98'):_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x88')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x88')];_0x5c05a9['body'][_0x1db1('0x5d')]=_0x2b3f1b[_0x1db1('0x5d')][_0x1db1('0x2a')];_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x8b')]=_0x2b3f1b['body']['refid'];break;}}if(_0x5c05a9[_0x1db1('0x5d')]['id']){delete _0x5c05a9[_0x1db1('0x5d')]['id'];}if(_[_0x1db1('0x99')](_0x5c05a9['body'][_0x1db1('0x88')])){throw new db[(_0x1db1('0x7c'))]['ValidationError'](_0x1db1('0x9a'));}if(_[_0x1db1('0x99')](_0x5c05a9[_0x1db1('0x5d')]['body'])||_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x5d')]===''){throw new db['Sequelize'][(_0x1db1('0x7d'))](_0x1db1('0x9b'));}if(_[_0x1db1('0x99')](_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x9c')])){throw new db[(_0x1db1('0x7c'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b4e39);}if(!_['includes'](_0x4b4e39,_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x9c')])){throw new db[(_0x1db1('0x7c'))][(_0x1db1('0x7d'))](_0x1db1('0x9d')+_0x4b4e39);}_0x18ec41[_0x5c05a9['body'][_0x1db1('0x9c')]]=_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x88')];return db[_0x1db1('0x9e')][_0x1db1('0x61')]({'where':{'id':_0x5c05a9[_0x1db1('0x77')][_0x1db1('0x83')]},'include':[{'model':db[_0x1db1('0x7b')],'as':_0x1db1('0x9f'),'where':_0x18ec41,'limit':0x1,'order':[['updatedAt',_0x1db1('0xa0')]]}]});})[_0x1db1('0x37')](handleEntityNotFound(_0xd14a72,null))[_0x1db1('0x37')](function(_0x464dce){if(_0x464dce){_0x5c05a9[_0x1db1('0xa1')]=_[_0x1db1('0xa2')](_0x464dce,[_0x1db1('0x9f')]);if(_0x464dce[_0x1db1('0x9f')]['length']){return _0x464dce['Contacts'][0x0];}var _0x597f77=_['defaults'](_0x5c05a9[_0x1db1('0x5d')],{'firstName':_0x5c05a9['body'][_0x1db1('0x88')],'ListId':_0x464dce['id']});_0x597f77[_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x9c')]]=_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x88')];return db[_0x1db1('0x7b')]['create'](_0x597f77,{'fields':_0x2bbe94,'raw':!![]});}})[_0x1db1('0x37')](handleEntityNotFound(_0xd14a72,null))[_0x1db1('0x37')](function(_0x479de0){if(_0x479de0){_0x5c05a9[_0x1db1('0xa3')]=_0x479de0;var _0x310b14={'ContactId':_0x479de0['id'],'phone':_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x88')],'SmsAccountId':_0x2b3f1b[_0x1db1('0x59')]['id']};var _0x59b5e1={'ContactId':_0x479de0['id'],'SmsAccountId':_0x2b3f1b[_0x1db1('0x59')]['id'],'closed':![]};return db[_0x1db1('0xa4')][_0x1db1('0x61')]({'where':_0x59b5e1})['then'](function(_0x29e67a){if(_0x29e67a){return[_0x29e67a,![]];}return db[_0x1db1('0xa4')][_0x1db1('0x5c')](_0x310b14)[_0x1db1('0x37')](function(_0x460bff){return[_0x460bff,!![]];});});}})[_0x1db1('0xa5')](function(_0x43448f,_0x11ae8c){_0x5c05a9[_0x1db1('0xa6')]=_0x43448f[_0x1db1('0x39')]({'plain':!![]});_0x5c05a9['interaction'][_0x1db1('0xa7')]=![];if(_0x11ae8c){if(_0x5c05a9[_0x1db1('0x77')][_0x1db1('0xa8')]){_0x5c05a9[_0x1db1('0x78')]['push']({'id':0x0,'priority':_0x5c05a9[_0x1db1('0x78')][_0x1db1('0x4a')]+0x1,'app':_0x1db1('0xa9'),'appdata':'unmanaged','interval':_0x1db1('0xaa')});}_0x5c05a9['interaction'][_0x1db1('0xa7')]=!![];}return db[_0x1db1('0xab')][_0x1db1('0x5c')]({'phone':_0x5c05a9[_0x1db1('0x5d')]['from'],'messageId':_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0x8b')],'body':_0x5c05a9['body'][_0x1db1('0x5d')],'SmsAccountId':_0x2b3f1b[_0x1db1('0x59')]['id'],'SmsInteractionId':_0x43448f['id'],'direction':'in','ContactId':_0x43448f[_0x1db1('0xac')],'AttachmentId':_0x5c05a9[_0x1db1('0x5d')][_0x1db1('0xad')]});})[_0x1db1('0x37')](function(_0x225b4c){_0x5c05a9[_0x1db1('0x2a')]=_0x225b4c;if(!_0x5c05a9[_0x1db1('0xa6')][_0x1db1('0xae')])return;return db[_0x1db1('0xaf')][_0x1db1('0x61')]({'attributes':['id',_0x1db1('0x3d')],'where':{'id':_0x5c05a9['interaction'][_0x1db1('0xae')]}});})['then'](function(_0x534660){if(_0x534660){_0x5c05a9[_0x1db1('0x78')][_0x1db1('0xb0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x534660[_0x1db1('0x3d')]+','+(_0x5c05a9[_0x1db1('0x77')][_0x1db1('0xb1')]||0xa),'interval':'*,*,*,*'});}if(!_0x5c05a9[_0x1db1('0xa6')][_0x1db1('0xb2')])return;return db[_0x1db1('0xb3')][_0x1db1('0x61')]({'attributes':['id',_0x1db1('0x3d')],'where':{'id':_0x5c05a9[_0x1db1('0xa6')][_0x1db1('0xb2')]}});})['then'](function(_0x5b4cb5){if(_0x5b4cb5){_0x5c05a9[_0x1db1('0x78')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5b4cb5[_0x1db1('0x3d')]+','+(_0x5c05a9[_0x1db1('0x77')]['waitForTheAssignedQueue']||0x12c),'interval':_0x1db1('0xaa')});}return respondWithRpcPromise(_0x1db1('0xb4'),_0x1db1('0xb5'),_0x5c05a9);})[_0x1db1('0x37')](function(_0x30e02b){if(_0x30e02b){var _0x5064a3=0xc8;var _0x5b7906=_0x1db1('0xb6');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5b7906,_0x5064a3,_0x1db1('0xb7'));logger['debug'](_0x1db1('0xb8'),_0x5b7906,_0x5064a3,_0x1db1('0xb7'),JSON[_0x1db1('0x27')](_0x30e02b));if(_0x5c05a9[_0x1db1('0x77')][_0x1db1('0x42')]===_0x1db1('0xb9')){return _0xd14a72[_0x1db1('0x2f')](_0x5064a3)[_0x1db1('0xba')](_0x1db1('0xbb'),_0x1db1('0xbc'))[_0x1db1('0xbd')](_0x1db1('0xbe'));}else{return _0xd14a72[_0x1db1('0x2f')](_0x5064a3)[_0x1db1('0x34')](_0x30e02b);}}})['catch'](handleError(_0xd14a72,null));};exports[_0x1db1('0xbf')]=function(_0x42c21f,_0x56caba){var _0xf29eb0=_0x42c21f[_0x1db1('0x59')]['id'];var _0x57bfbd=_0x42c21f[_0x1db1('0x5d')];var _0x22b945=0xc8;var _0x25d2a9=null;return db[_0x1db1('0xc0')][_0x1db1('0xc1')]({'isolationLevel':db[_0x1db1('0xc0')][_0x1db1('0xc2')][_0x1db1('0xc3')][_0x1db1('0xc4')]},function(_0x20cac0){return db[_0x1db1('0x3f')][_0x1db1('0x71')]({'where':{'id':_0xf29eb0},'transaction':_0x20cac0})['then'](function(_0x244f25){if(_0x244f25){return db[_0x1db1('0x75')][_0x1db1('0x38')]({'where':{'SmsAccountId':_0xf29eb0},'transaction':_0x20cac0})[_0x1db1('0x37')](function(){var _0xef26ff=_[_0x1db1('0x45')](_0x57bfbd,function(_0x1816e0){_0x1816e0[_0x1db1('0x68')]=_0xf29eb0;return _0x1816e0;});return db[_0x1db1('0x75')][_0x1db1('0xc5')](_0xef26ff,{'transaction':_0x20cac0});});}else{_0x22b945=0x194;_0x25d2a9=[];}});})[_0x1db1('0x37')](function(){if(_0x22b945!==0x194){return db[_0x1db1('0x75')][_0x1db1('0xc6')]({'where':{'SmsAccountId':_0xf29eb0},'order':_0x1db1('0x7a')})[_0x1db1('0x37')](function(_0x2774ee){_0x25d2a9=_0x2774ee;});}})[_0x1db1('0x2d')](function(_0x567040){_0x22b945=0x1f4;logger[_0x1db1('0x28')](_0x567040[_0x1db1('0x3c')]);if(_0x567040[_0x1db1('0x3d')]){delete _0x567040[_0x1db1('0x3d')];}_0x25d2a9=_0x567040;})['finally'](function(){if(_0x25d2a9===null){_0x56caba[_0x1db1('0x2e')](_0x22b945);}else{if(_0x22b945===0x1f4){_0x56caba[_0x1db1('0x2f')](_0x22b945)[_0x1db1('0xbd')](_0x25d2a9);}else{_0x56caba['status'](_0x22b945)[_0x1db1('0x34')](_0x25d2a9);}}});};exports[_0x1db1('0xc7')]=function(_0x3aff44,_0x27cd12,_0x2917f9){var _0x1bcb2c={};var _0x5b18b8={};var _0x59d56a;var _0x1abe2a;return db['SmsAccount'][_0x1db1('0x71')]({'where':{'id':_0x3aff44[_0x1db1('0x59')]['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x27cd12,null))[_0x1db1('0x37')](function(_0x5bc0bd){if(_0x5bc0bd){_0x59d56a=_0x5bc0bd;_0x5b18b8[_0x1db1('0x44')]=_['keys'](db[_0x1db1('0x75')][_0x1db1('0x40')]);_0x5b18b8[_0x1db1('0x47')]=_[_0x1db1('0x46')](_0x3aff44[_0x1db1('0x47')]);_0x5b18b8[_0x1db1('0x51')]=_[_0x1db1('0x48')](_0x5b18b8[_0x1db1('0x44')],_0x5b18b8['query']);_0x1bcb2c[_0x1db1('0x4b')]=_[_0x1db1('0x48')](_0x5b18b8[_0x1db1('0x44')],qs['fields'](_0x3aff44['query'][_0x1db1('0x49')]));_0x1bcb2c[_0x1db1('0x4b')]=_0x1bcb2c[_0x1db1('0x4b')][_0x1db1('0x4a')]?_0x1bcb2c[_0x1db1('0x4b')]:_0x5b18b8['model'];_0x1bcb2c[_0x1db1('0x6b')]=qs[_0x1db1('0x4f')](_0x3aff44[_0x1db1('0x47')][_0x1db1('0x4f')]);_0x1bcb2c[_0x1db1('0x50')]=qs[_0x1db1('0x51')](_[_0x1db1('0x72')](_0x3aff44[_0x1db1('0x47')],_0x5b18b8[_0x1db1('0x51')]));if(_0x3aff44[_0x1db1('0x47')][_0x1db1('0x52')]){_0x1bcb2c[_0x1db1('0x50')]=_['merge'](_0x1bcb2c['where'],{'$or':_[_0x1db1('0x45')](_0x1bcb2c['attributes'],function(_0x56786f){var _0x506ad2={};_0x506ad2[_0x56786f]={'$like':'%'+_0x3aff44[_0x1db1('0x47')]['filter']+'%'};return _0x506ad2;})});}_0x1bcb2c=_[_0x1db1('0x54')]({},_0x1bcb2c,_0x3aff44[_0x1db1('0xc8')]);return _0x59d56a[_0x1db1('0xc7')](_0x1bcb2c);}})[_0x1db1('0x37')](function(_0x8dabc8){if(_0x8dabc8){_0x1abe2a=_0x8dabc8[_0x1db1('0x4a')];if(!_0x3aff44[_0x1db1('0x47')][_0x1db1('0x4c')](_0x1db1('0x4d'))){_0x1bcb2c[_0x1db1('0x4e')]=qs[_0x1db1('0x4e')](_0x3aff44[_0x1db1('0x47')][_0x1db1('0x4e')]);_0x1bcb2c['offset']=qs[_0x1db1('0x30')](_0x3aff44[_0x1db1('0x47')][_0x1db1('0x30')]);}return _0x59d56a[_0x1db1('0xc7')](_0x1bcb2c);}})[_0x1db1('0x37')](function(_0x31ef3f){if(_0x31ef3f){return _0x31ef3f?{'count':_0x1abe2a,'rows':_0x31ef3f}:null;}})[_0x1db1('0x37')](respondWithResult(_0x27cd12,null))[_0x1db1('0x2d')](handleError(_0x27cd12,null));};exports[_0x1db1('0xc9')]=function(_0x1775cc,_0x576601,_0x41559f){var _0x1f47d8={'raw':![],'where':{}};var _0x18d338={};var _0x1663d3={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1db1('0x71')]({'where':{'id':_0x1775cc['params']['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x576601,null))[_0x1db1('0x37')](function(_0xbd01bd){if(_0xbd01bd){_0x18d338['model']=_[_0x1db1('0x46')](db[_0x1db1('0xa4')]['rawAttributes']);_0x18d338[_0x1db1('0x47')]=_[_0x1db1('0x46')](_0x1775cc['query']);_0x18d338[_0x1db1('0x51')]=_[_0x1db1('0x48')](_0x18d338[_0x1db1('0x44')],_0x18d338[_0x1db1('0x47')]);_0x1f47d8[_0x1db1('0x4b')]=_[_0x1db1('0x48')](_0x18d338[_0x1db1('0x44')],qs[_0x1db1('0x49')](_0x1775cc[_0x1db1('0x47')]['fields']));_0x1f47d8[_0x1db1('0x4b')]=_0x1f47d8[_0x1db1('0x4b')][_0x1db1('0x4a')]?_0x1f47d8[_0x1db1('0x4b')]:_0x18d338['model'];if(!_0x1775cc[_0x1db1('0x47')][_0x1db1('0x4c')]('nolimit')){_0x1f47d8[_0x1db1('0x4e')]=qs[_0x1db1('0x4e')](_0x1775cc[_0x1db1('0x47')][_0x1db1('0x4e')]);_0x1f47d8['offset']=qs['offset'](_0x1775cc['query']['offset']);}_0x1f47d8['order']=qs[_0x1db1('0x4f')](_0x1775cc['query']['sort']);_0x1f47d8[_0x1db1('0x50')]=qs[_0x1db1('0x51')](_[_0x1db1('0x72')](_0x1775cc['query'],_0x18d338[_0x1db1('0x51')]));_0x1f47d8[_0x1db1('0x50')]['SmsAccountId']=_0xbd01bd['id'];if(_0x1775cc[_0x1db1('0x47')][_0x1db1('0x52')]){_0x1f47d8[_0x1db1('0x50')]=_[_0x1db1('0x54')](_0x1f47d8[_0x1db1('0x50')],{'$or':_['map'](_0x1f47d8['attributes'],function(_0x19e5c1){var _0xcb283c={};_0xcb283c[_0x19e5c1]={'$like':'%'+_0x1775cc[_0x1db1('0x47')][_0x1db1('0x52')]+'%'};return _0xcb283c;})});}_0x1f47d8=_[_0x1db1('0x54')]({},_0x1f47d8,_0x1775cc[_0x1db1('0xc8')]);return db[_0x1db1('0xa4')][_0x1db1('0x32')]({'where':_0x1f47d8['where']})[_0x1db1('0x37')](function(_0x578a3b){_0x1663d3[_0x1db1('0x32')]=_0x578a3b;if(_0x1775cc[_0x1db1('0x47')][_0x1db1('0x55')]){_0x1f47d8[_0x1db1('0x5b')]=[{'model':db[_0x1db1('0x7b')],'as':_0x1db1('0xca'),'required':![]},{'model':db[_0x1db1('0xaf')],'as':_0x1db1('0xcb'),'attributes':['name',_0x1db1('0xcc'),'internal'],'required':![]},{'model':db[_0x1db1('0xcd')],'as':'Tags','attributes':['id',_0x1db1('0x3d'),_0x1db1('0xce')],'where':_0x1775cc[_0x1db1('0x47')][_0x1db1('0xcf')]?{'id':_0x1775cc['query'][_0x1db1('0xcf')]}:undefined,'required':_0x1775cc[_0x1db1('0x47')][_0x1db1('0xcf')]?!![]:![]}];}return db[_0x1db1('0xa4')][_0x1db1('0x56')](_0x1f47d8);})[_0x1db1('0x37')](function(_0x50c7a0){_0x1663d3[_0x1db1('0x57')]=_0x50c7a0;return _0x1663d3;});}})['then'](respondWithFilteredResult(_0x576601,_0x1f47d8))['catch'](handleError(_0x576601,null));};exports['send']=function(_0x4fa91d,_0x3f8de0,_0x654517){var _0x6df188,_0x3fef0c,_0x4b7b06;if(_['isNil'](_0x4fa91d['body'][_0x1db1('0x5d')])||_0x4fa91d[_0x1db1('0x5d')][_0x1db1('0x5d')]===''){throw new db[(_0x1db1('0x7c'))][(_0x1db1('0x7d'))](_0x1db1('0x9b'));}if(_[_0x1db1('0x99')](_0x4fa91d[_0x1db1('0x5d')]['to'])){throw new db[(_0x1db1('0x7c'))][(_0x1db1('0x7d'))](_0x1db1('0xd0'));}_0x6df188=_0x4fa91d['body']['to'];return db[_0x1db1('0x3f')][_0x1db1('0x61')]({'where':{'id':_0x4fa91d[_0x1db1('0x59')]['id']},'include':[{'model':db[_0x1db1('0x9e')],'as':_0x1db1('0xd1'),'include':[{'model':db[_0x1db1('0x7b')],'as':_0x1db1('0x9f'),'where':{'mobile':_0x6df188},'limit':0x1,'order':[[_0x1db1('0x80'),_0x1db1('0xa0')]]}]}]})[_0x1db1('0x37')](handleEntityNotFound(_0x3f8de0,null))['then'](function(_0x2dd74b){if(_0x2dd74b&&_0x2dd74b[_0x1db1('0xd1')]){_0x3fef0c=_0x2dd74b['get']({'plain':!![]});if(_0x3fef0c[_0x1db1('0xd1')]&&_0x3fef0c[_0x1db1('0xd1')][_0x1db1('0x9f')][_0x1db1('0x4a')]){return _0x3fef0c[_0x1db1('0xd1')]['Contacts'][0x0];}return db[_0x1db1('0x7b')][_0x1db1('0x5c')](_[_0x1db1('0x1c')](_0x4fa91d[_0x1db1('0x5d')],{'firstName':_0x6df188,'mobile':_0x6df188,'phone':_0x6df188,'ListId':_0x3fef0c['ListId']}));}})[_0x1db1('0x37')](handleEntityNotFound(_0x3f8de0,null))[_0x1db1('0x37')](function(_0xe97b87){if(_0xe97b87){_0x4b7b06=_0xe97b87;return db['SmsInteraction'][_0x1db1('0x61')]({'where':{'ContactId':_0x4b7b06['id'],'closed':![],'SmsAccountId':_0x3fef0c['id']}})['then'](function(_0x28185e){if(_0x28185e){return[_0x28185e,![]];}return db[_0x1db1('0xa4')][_0x1db1('0x5c')]({'UserId':_0x4fa91d[_0x1db1('0x5e')]['id'],'ContactId':_0x4b7b06['id'],'SmsAccountId':_0x3fef0c['id'],'phone':_0x6df188,'firstMsgDirection':_0x1db1('0xd2'),'Messages':[_[_0x1db1('0x54')](_0x4fa91d[_0x1db1('0x5d')],{'read':![],'body':_0x4fa91d[_0x1db1('0x5d')][_0x1db1('0x5d')],'phone':_0x6df188,'SmsAccountId':_0x3fef0c['id'],'UserId':_0x4fa91d[_0x1db1('0x5e')]['id'],'ContactId':_0x4b7b06['id']})]},{'include':[{'model':db[_0x1db1('0xab')],'as':'Messages'}]})[_0x1db1('0x37')](function(_0x486581){return[_0x486581,!![]];});});}})[_0x1db1('0xa5')](function(_0x57b163,_0x4ac188){if(_0x4ac188){return _0x57b163;}return db['SmsMessage']['create'](_['merge'](_0x4fa91d[_0x1db1('0x5d')],{'read':![],'body':_0x4fa91d[_0x1db1('0x5d')][_0x1db1('0x5d')],'phone':_0x6df188,'SmsAccountId':_0x3fef0c['id'],'SmsInteractionId':_0x57b163['id'],'UserId':_0x4fa91d[_0x1db1('0x5e')]['id'],'ContactId':_0x4b7b06['id']}))[_0x1db1('0x37')](function(_0x1f9730){_0x57b163[_0x1db1('0xd3')][_0x1db1('0xd4')]=[];_0x57b163['dataValues'][_0x1db1('0xd4')]['push'](_0x1f9730['dataValues']);return _0x57b163;});})[_0x1db1('0x37')](respondWithResult(_0x3f8de0,null))[_0x1db1('0x2d')](handleError(_0x3f8de0,null));};exports[_0x1db1('0x2f')]=function(_0x1937d7,_0x3af387,_0x24b838){if(_0x1937d7[_0x1db1('0x5d')]['id']){delete _0x1937d7['body']['id'];}var _0x49eadb,_0x2c4b95,_0x242b5c;return db['SmsAccount'][_0x1db1('0x61')]({'where':{'id':_0x1937d7['params']['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x3af387,null))[_0x1db1('0x37')](function(_0x33a8c7){if(_0x33a8c7){_0x242b5c=_0x33a8c7;logger[_0x1db1('0x25')](_0x1db1('0x26'),_0x1db1('0x2f'),'received\x20delivery\x20report\x20from',_0x33a8c7[_0x1db1('0x42')],util[_0x1db1('0xd5')](_0x1937d7[_0x1db1('0x5d')],{'showHidden':![],'depth':null}));switch(_0x33a8c7[_0x1db1('0x42')]){case'skebby':if(_0x1937d7['body'][_0x1db1('0xd6')]&&_0x1937d7[_0x1db1('0x5d')][_0x1db1('0x2f')]){_0x2c4b95=_0x1937d7['body'][_0x1db1('0x2f')];return db[_0x1db1('0xab')][_0x1db1('0x61')]({'where':{'messageId':_0x1937d7['body'][_0x1db1('0xd6')]}});}break;case _0x1db1('0xd7'):if(_0x1937d7[_0x1db1('0x5d')]['requestid']&&_0x1937d7[_0x1db1('0x5d')][_0x1db1('0xd8')]){_0x2c4b95=_0x1937d7['body']['statusInt'];return db[_0x1db1('0xab')][_0x1db1('0x61')]({'where':{'messageId':_0x1937d7[_0x1db1('0x5d')][_0x1db1('0xd9')]}});}break;case _0x1db1('0xda'):if(_0x1937d7[_0x1db1('0x5d')]['message_id']&&_0x1937d7['body'][_0x1db1('0xdb')]){_0x2c4b95=_0x1937d7['body'][_0x1db1('0xdb')];return db[_0x1db1('0xab')][_0x1db1('0x61')]({'where':{'messageId':_0x1937d7[_0x1db1('0x5d')]['message_id']}});}break;case _0x1db1('0x90'):var _0x2a7296=_0x1937d7[_0x1db1('0x5d')][_0x1db1('0x91')][0x0];if(_0x2a7296[_0x1db1('0x8b')]&&_0x2a7296[_0x1db1('0x2f')]['groupName']===_0x1db1('0xdc')){_0x2c4b95=_0x2a7296[_0x1db1('0x2f')][_0x1db1('0xdd')];return db['SmsMessage']['find']({'where':{'messageId':_0x2a7296[_0x1db1('0x8b')]}});}break;case _0x1db1('0x94'):if(_0x1937d7[_0x1db1('0x5d')][_0x1db1('0x8b')]&&_0x1937d7[_0x1db1('0x5d')]['status']){_0x2c4b95=_0x1937d7['body']['status'];return db[_0x1db1('0xab')]['find']({'where':{'messageId':_0x1937d7['body'][_0x1db1('0x8b')]}});}break;case _0x1db1('0x97'):if(_0x1937d7[_0x1db1('0x5d')][0x0][_0x1db1('0x2a')]['id']){_0x2c4b95=_0x1937d7[_0x1db1('0x5d')][0x0][_0x1db1('0x42')];return db['SmsMessage'][_0x1db1('0x61')]({'where':{'messageId':_0x1937d7[_0x1db1('0x5d')][0x0]['message']['id']}});}break;case _0x1db1('0x98'):if(_0x1937d7[_0x1db1('0x5d')][_0x1db1('0xde')]&&_0x1937d7[_0x1db1('0x5d')][_0x1db1('0x2f')]){_0x2c4b95=_0x1937d7[_0x1db1('0x5d')][_0x1db1('0x2f')];return db[_0x1db1('0xab')][_0x1db1('0x61')]({'where':{'messageId':_0x1937d7[_0x1db1('0x5d')][_0x1db1('0xde')]}});}break;}}})[_0x1db1('0x37')](handleEntityNotFound(_0x3af387,null))[_0x1db1('0x37')](function(_0x13cfc9){if(_0x13cfc9){_0x49eadb=_0x13cfc9;switch(_0x242b5c[_0x1db1('0x42')]){case _0x1db1('0x87'):if(_0x2c4b95==='DELIVERED'){return _0x49eadb[_0x1db1('0x36')]({'read':!![]});}else{logger[_0x1db1('0x28')](_0x1db1('0x26'),_0x1db1('0x2f'),_0x1db1('0x87'),util[_0x1db1('0xd5')](_0x1937d7[_0x1db1('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1db1('0xd7'):if(_0x2c4b95==='1'){return _0x49eadb[_0x1db1('0x36')]({'read':!![]});}else{logger[_0x1db1('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1db1('0x2f'),_0x1db1('0x87'),util[_0x1db1('0xd5')](_0x1937d7[_0x1db1('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1db1('0xda'):if(!_0x1937d7[_0x1db1('0x5d')][_0x1db1('0xdf')]&&_0x2c4b95>=0xc8&&_0x2c4b95<=0xce){return _0x49eadb['update']({'read':!![]});}else{logger[_0x1db1('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1db1('0x2f'),_0x1db1('0xda'),util[_0x1db1('0xd5')](_0x1937d7[_0x1db1('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1db1('0x90'):var _0x350df6=_0x1937d7[_0x1db1('0x5d')]['results'][0x0];if(_0x350df6['status'][_0x1db1('0xdd')]===_0x1db1('0xdc')){return _0x49eadb['update']({'read':!![]});}else{logger[_0x1db1('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1db1('0x2f'),_0x1db1('0x90'),util[_0x1db1('0xd5')](_0x1937d7[_0x1db1('0x5d')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2c4b95==_0x1db1('0xe0')||_0x2c4b95==_0x1db1('0xe1')){return _0x49eadb[_0x1db1('0x36')]({'read':!![]});}else{logger[_0x1db1('0x28')](_0x1db1('0x26'),_0x1db1('0x2f'),'clickatell',util['inspect'](_0x1937d7['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x2c4b95=='message-delivered'){return _0x49eadb[_0x1db1('0x36')]({'read':!![]});}else{logger['error'](_0x1db1('0x26'),'status',_0x1db1('0x97'),util[_0x1db1('0xd5')](_0x1937d7[_0x1db1('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x1db1('0x98'):if(_0x2c4b95===_0x1db1('0xe2')||_0x2c4b95===_0x1db1('0xe3')){return _0x49eadb[_0x1db1('0x36')]({'read':!![]});}else{logger[_0x1db1('0x28')](_0x1db1('0x26'),_0x1db1('0x2f'),_0x1db1('0x98'),util[_0x1db1('0xd5')](_0x1937d7[_0x1db1('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x49eadb;}})[_0x1db1('0x37')](respondWithResult(_0x3af387,null))[_0x1db1('0x2d')](handleError(_0x3af387,null));};exports[_0x1db1('0xe4')]=function(_0x746636,_0x45cb8a,_0x4002f9){var _0x492cb1,_0x5c9df6,_0x3bf451;return db[_0x1db1('0x3f')][_0x1db1('0x61')]({'where':{'id':_0x746636[_0x1db1('0x59')]['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x45cb8a,null))[_0x1db1('0x37')](function(_0xb75eac){if(_0xb75eac){_0x3bf451=_0xb75eac;logger[_0x1db1('0x25')](_0x1db1('0x26'),_0x1db1('0x2f'),_0x1db1('0xe5'),_0xb75eac[_0x1db1('0x42')],util[_0x1db1('0xd5')](_0x746636[_0x1db1('0x47')],{'showHidden':![],'depth':null}));switch(_0xb75eac[_0x1db1('0x42')]){case _0x1db1('0x92'):if(_0x746636[_0x1db1('0x47')][_0x1db1('0xe6')]&&_0x746636[_0x1db1('0x47')]['state']){_0x5c9df6=_0x746636['query'][_0x1db1('0xe7')];return db[_0x1db1('0xab')][_0x1db1('0x61')]({'where':{'messageId':_0x746636['query']['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x45cb8a,null))[_0x1db1('0x37')](function(_0x296ab4){if(_0x296ab4){_0x492cb1=_0x296ab4;switch(_0x3bf451[_0x1db1('0x42')]){case _0x1db1('0x92'):if(_0x5c9df6==='2'||_0x5c9df6==='6'){return _0x492cb1['update']({'read':!![]});}else{logger[_0x1db1('0x28')](_0x1db1('0x26'),_0x1db1('0x2f'),_0x1db1('0x92'),util[_0x1db1('0xd5')](_0x746636['query'],{'showHidden':![],'depth':null}));};break;}return _0x492cb1;}})[_0x1db1('0x37')](respondWithResult(_0x45cb8a,null))[_0x1db1('0x2d')](handleError(_0x45cb8a,null));};exports[_0x1db1('0xe8')]=function(_0xa3cc01,_0x5a65b1,_0x20cafe){return db['SmsAccount']['find']({'where':{'id':_0xa3cc01[_0x1db1('0x59')]['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x5a65b1,null))[_0x1db1('0x37')](function(_0x2265b2){if(_0x2265b2){return _0x2265b2[_0x1db1('0xe8')](_0xa3cc01['body']['ids'],_[_0x1db1('0xa2')](_0xa3cc01[_0x1db1('0x5d')],[_0x1db1('0x6d'),'id'])||{})[_0x1db1('0xa5')](function(_0x1a6d2b){for(var _0x4925ae=0x0;_0x4925ae<_0xa3cc01[_0x1db1('0x5d')][_0x1db1('0x6d')][_0x1db1('0x4a')];_0x4925ae+=0x1){socket[_0x1db1('0xe9')](_0x1db1('0xea'),{'UserId':Number(_0xa3cc01[_0x1db1('0x5d')][_0x1db1('0x6d')][_0x4925ae]),'SmsAccountId':Number(_0xa3cc01[_0x1db1('0x59')]['id'])});}return _0x1a6d2b;});}})['then'](respondWithResult(_0x5a65b1,null))[_0x1db1('0x2d')](handleError(_0x5a65b1,null));};exports[_0x1db1('0xeb')]=function(_0x55df6f,_0x357adf,_0x199a39){return db[_0x1db1('0x3f')][_0x1db1('0x61')]({'where':{'id':_0x55df6f['params']['id']}})['then'](handleEntityNotFound(_0x357adf,null))[_0x1db1('0x37')](function(_0x259cae){if(_0x259cae){return _0x259cae['removeAgents'](_0x55df6f['query'][_0x1db1('0x6d')])['then'](function(){if(_[_0x1db1('0xec')](_0x55df6f[_0x1db1('0x47')][_0x1db1('0x6d')])){for(var _0x2bc6b8=0x0;_0x2bc6b8<_0x55df6f[_0x1db1('0x47')]['ids'][_0x1db1('0x4a')];_0x2bc6b8+=0x1){socket['emit'](_0x1db1('0xed'),{'UserId':Number(_0x55df6f[_0x1db1('0x47')][_0x1db1('0x6d')][_0x2bc6b8]),'SmsAccountId':Number(_0x55df6f[_0x1db1('0x59')]['id'])});}}else{socket[_0x1db1('0xe9')]('userSmsAccount:remove',{'UserId':Number(_0x55df6f[_0x1db1('0x47')][_0x1db1('0x6d')]),'SmsAccountId':Number(_0x55df6f['params']['id'])});}});}})[_0x1db1('0x37')](respondWithStatusCode(_0x357adf,null))['catch'](handleError(_0x357adf,null));};exports[_0x1db1('0xee')]=function(_0xfcde3f,_0x58478e,_0x7a916e){var _0x58f6b3={};var _0x63a00d={};var _0x29c1c4;var _0x178a8;return db[_0x1db1('0x3f')][_0x1db1('0x71')]({'where':{'id':_0xfcde3f[_0x1db1('0x59')]['id']}})[_0x1db1('0x37')](handleEntityNotFound(_0x58478e,null))[_0x1db1('0x37')](function(_0x569879){if(_0x569879){_0x29c1c4=_0x569879;_0x63a00d[_0x1db1('0x44')]=_['keys'](db[_0x1db1('0xaf')][_0x1db1('0x40')]);_0x63a00d['query']=_[_0x1db1('0x46')](_0xfcde3f[_0x1db1('0x47')]);_0x63a00d['filters']=_['intersection'](_0x63a00d[_0x1db1('0x44')],_0x63a00d[_0x1db1('0x47')]);_0x58f6b3[_0x1db1('0x4b')]=_[_0x1db1('0x48')](_0x63a00d[_0x1db1('0x44')],qs['fields'](_0xfcde3f[_0x1db1('0x47')][_0x1db1('0x49')]));_0x58f6b3[_0x1db1('0x4b')]=_0x58f6b3['attributes'][_0x1db1('0x4a')]?_0x58f6b3[_0x1db1('0x4b')]:_0x63a00d['model'];_0x58f6b3['order']=qs[_0x1db1('0x4f')](_0xfcde3f[_0x1db1('0x47')][_0x1db1('0x4f')]);_0x58f6b3[_0x1db1('0x50')]=qs[_0x1db1('0x51')](_[_0x1db1('0x72')](_0xfcde3f[_0x1db1('0x47')],_0x63a00d[_0x1db1('0x51')]));if(_0xfcde3f[_0x1db1('0x47')][_0x1db1('0x52')]){_0x58f6b3['where']=_[_0x1db1('0x54')](_0x58f6b3[_0x1db1('0x50')],{'$or':_[_0x1db1('0x45')](_0x58f6b3['attributes'],function(_0x450675){var _0x16c179={};_0x16c179[_0x450675]={'$like':'%'+_0xfcde3f[_0x1db1('0x47')][_0x1db1('0x52')]+'%'};return _0x16c179;})});}_0x58f6b3=_[_0x1db1('0x54')]({},_0x58f6b3,_0xfcde3f['options']);return _0x29c1c4['getAgents'](_0x58f6b3);}})['then'](function(_0x8c8d52){if(_0x8c8d52){_0x178a8=_0x8c8d52[_0x1db1('0x4a')];if(!_0xfcde3f[_0x1db1('0x47')][_0x1db1('0x4c')](_0x1db1('0x4d'))){_0x58f6b3[_0x1db1('0x4e')]=qs['limit'](_0xfcde3f[_0x1db1('0x47')][_0x1db1('0x4e')]);_0x58f6b3[_0x1db1('0x30')]=qs[_0x1db1('0x30')](_0xfcde3f[_0x1db1('0x47')][_0x1db1('0x30')]);}return _0x29c1c4[_0x1db1('0xee')](_0x58f6b3);}})['then'](function(_0x55789b){if(_0x55789b){return _0x55789b?{'count':_0x178a8,'rows':_0x55789b}:null;}})[_0x1db1('0x37')](respondWithResult(_0x58478e,null))['catch'](handleError(_0x58478e,null));}; \ No newline at end of file +var _0x9220=['SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','requestid','status_code','infobip','groupName','redif','clicksend','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','User','eml-format','rimraf','request-promise','moment','bluebird','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','http','request','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','name','send','index','Pause','SmsAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','intersection','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','skebby','text','connectel','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','clickatell','fromNumber','bandwidth','intelepeer','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found'];(function(_0x4b3806,_0x444766){var _0x188174=function(_0x3d71ca){while(--_0x3d71ca){_0x4b3806['push'](_0x4b3806['shift']());}};_0x188174(++_0x444766);}(_0x9220,0x124));var _0x0922=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x9220[_0x35da42];return _0x370035;};'use strict';var emlformat=require(_0x0922('0x0'));var rimraf=require(_0x0922('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0922('0x2'));var moment=require(_0x0922('0x3'));var BPromise=require(_0x0922('0x4'));var Mustache=require(_0x0922('0x5'));var util=require(_0x0922('0x6'));var path=require(_0x0922('0x7'));var sox=require(_0x0922('0x8'));var csv=require(_0x0922('0x9'));var ejs=require(_0x0922('0xa'));var fs=require('fs');var fs_extra=require(_0x0922('0xb'));var _=require(_0x0922('0xc'));var squel=require(_0x0922('0xd'));var crypto=require(_0x0922('0xe'));var jsforce=require(_0x0922('0xf'));var deskjs=require(_0x0922('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0922('0x11'));var Papa=require(_0x0922('0x12'));var Redis=require('ioredis');var authService=require(_0x0922('0x13'));var qs=require(_0x0922('0x14'));var as=require(_0x0922('0x15'));var hardwareService=require(_0x0922('0x16'));var logger=require(_0x0922('0x17'))(_0x0922('0x18'));var utils=require(_0x0922('0x19'));var config=require(_0x0922('0x1a'));var licenseUtil=require(_0x0922('0x1b'));var db=require(_0x0922('0x1c'))['db'];config[_0x0922('0x1d')]=_[_0x0922('0x1e')](config['redis'],{'host':_0x0922('0x1f'),'port':0x18eb});var socket=require(_0x0922('0x20'))(new Redis(config[_0x0922('0x1d')]));require('./smsAccount.socket')[_0x0922('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0922('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x446fa8,_0x3666dc,_0x1b2ac4,_0xbbd8b){return new BPromise(function(_0x3af627,_0x375cab){var _0x1ba1a4=_0xbbd8b||client;return _0x1ba1a4[_0x0922('0x23')](_0x446fa8,_0x1b2ac4)['then'](function(_0x1b0113){logger[_0x0922('0x24')]('SmsAccount,\x20%s,\x20%s',_0x3666dc,'request\x20sent');logger[_0x0922('0x25')](_0x0922('0x26'),_0x3666dc,'request\x20sent',JSON['stringify'](_0x1b0113));if(_0x1b0113[_0x0922('0x27')]){if(_0x1b0113[_0x0922('0x27')][_0x0922('0x28')]===0x1f4){logger[_0x0922('0x27')](_0x0922('0x29'),_0x3666dc,_0x1b0113[_0x0922('0x27')][_0x0922('0x2a')]);return _0x375cab(_0x1b0113[_0x0922('0x27')]['message']);}logger[_0x0922('0x27')](_0x0922('0x29'),_0x3666dc,_0x1b0113['error'][_0x0922('0x2a')]);return _0x3af627(_0x1b0113[_0x0922('0x27')][_0x0922('0x2a')]);}else{logger[_0x0922('0x24')](_0x0922('0x29'),_0x3666dc,'request\x20sent');_0x3af627(_0x1b0113[_0x0922('0x2b')][_0x0922('0x2a')]);}})[_0x0922('0x2c')](function(_0x163d9e){logger[_0x0922('0x27')](_0x0922('0x29'),_0x3666dc,_0x163d9e);_0x375cab(_0x163d9e);});});}function respondWithStatusCode(_0x255e4d,_0x4f7bdb){_0x4f7bdb=_0x4f7bdb||0xcc;return function(_0x50d137){if(_0x50d137){return _0x255e4d[_0x0922('0x2d')](_0x4f7bdb);}return _0x255e4d['status'](_0x4f7bdb)[_0x0922('0x2e')]();};}function respondWithResult(_0x336fb7,_0x361f14){_0x361f14=_0x361f14||0xc8;return function(_0x167d16){if(_0x167d16){return _0x336fb7['status'](_0x361f14)[_0x0922('0x2f')](_0x167d16);}};}function respondWithFilteredResult(_0x47a8d4,_0x50ae98){return function(_0x5a1e95){if(_0x5a1e95){var _0x4b20a4=typeof _0x50ae98[_0x0922('0x30')]===_0x0922('0x31')&&typeof _0x50ae98[_0x0922('0x32')]===_0x0922('0x31');var _0xdc2811=_0x5a1e95['count'];var _0x5752f0=_0x4b20a4?0x0:_0x50ae98[_0x0922('0x30')];var _0x35e646=_0x4b20a4?_0x5a1e95[_0x0922('0x33')]:_0x50ae98[_0x0922('0x30')]+_0x50ae98['limit'];var _0x5b091d;if(_0x35e646>=_0xdc2811){_0x35e646=_0xdc2811;_0x5b091d=0xc8;}else{_0x5b091d=0xce;}_0x47a8d4[_0x0922('0x34')](_0x5b091d);return _0x47a8d4['set'](_0x0922('0x35'),_0x5752f0+'-'+_0x35e646+'/'+_0xdc2811)[_0x0922('0x2f')](_0x5a1e95);}return null;};}function patchUpdates(_0x280eb8){return function(_0x20f95d){try{jsonpatch[_0x0922('0x36')](_0x20f95d,_0x280eb8,!![]);}catch(_0x30ed09){return BPromise[_0x0922('0x37')](_0x30ed09);}return _0x20f95d['save']();};}function saveUpdates(_0x5847f6,_0x1b602e){return function(_0x2f3fd8){if(_0x2f3fd8){return _0x2f3fd8[_0x0922('0x38')](_0x5847f6)[_0x0922('0x39')](function(_0xfd6edd){return _0xfd6edd;});}return null;};}function removeEntity(_0x3f8302,_0x498505){return function(_0x5791ae){if(_0x5791ae){return _0x5791ae[_0x0922('0x3a')]()[_0x0922('0x39')](function(){var _0xa26003=_0x5791ae[_0x0922('0x3b')]({'plain':!![]});var _0x54ee15=_0x0922('0x3c');return db[_0x0922('0x3d')][_0x0922('0x3a')]({'where':{'type':_0x54ee15,'resourceId':_0xa26003['id']}})[_0x0922('0x39')](function(){return _0x5791ae;});})[_0x0922('0x39')](function(){_0x3f8302[_0x0922('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233910,_0x256f5a){return function(_0x42e6ba){if(!_0x42e6ba){_0x233910[_0x0922('0x2d')](0x194);}return _0x42e6ba;};}function handleError(_0x366a41,_0x377529){_0x377529=_0x377529||0x1f4;return function(_0x3ed00b){logger[_0x0922('0x27')](_0x3ed00b['stack']);if(_0x3ed00b['name']){delete _0x3ed00b[_0x0922('0x3e')];}_0x366a41[_0x0922('0x34')](_0x377529)[_0x0922('0x3f')](_0x3ed00b);};}exports[_0x0922('0x40')]=function(_0x4074df,_0x2ab91f){var _0x5b5243={'include':[{'model':db[_0x0922('0x41')],'as':'mandatoryDispositionPause'}]},_0x53f3ff={},_0x97e649={'count':0x0,'rows':[]};var _0x5ac36d=_['map'](db[_0x0922('0x42')][_0x0922('0x43')],function(_0x5aa14c){return{'name':_0x5aa14c[_0x0922('0x44')],'type':_0x5aa14c[_0x0922('0x45')][_0x0922('0x46')]};});_0x53f3ff['model']=_[_0x0922('0x47')](_0x5ac36d,_0x0922('0x3e'));_0x53f3ff[_0x0922('0x48')]=_[_0x0922('0x49')](_0x4074df['query']);_0x53f3ff[_0x0922('0x4a')]=_['intersection'](_0x53f3ff[_0x0922('0x4b')],_0x53f3ff['query']);_0x5b5243[_0x0922('0x4c')]=_['intersection'](_0x53f3ff['model'],qs['fields'](_0x4074df['query'][_0x0922('0x4d')]));_0x5b5243['attributes']=_0x5b5243[_0x0922('0x4c')][_0x0922('0x4e')]?_0x5b5243['attributes']:_0x53f3ff[_0x0922('0x4b')];if(!_0x4074df[_0x0922('0x48')][_0x0922('0x4f')]('nolimit')){_0x5b5243[_0x0922('0x32')]=qs[_0x0922('0x32')](_0x4074df[_0x0922('0x48')][_0x0922('0x32')]);_0x5b5243[_0x0922('0x30')]=qs[_0x0922('0x30')](_0x4074df['query']['offset']);}_0x5b5243[_0x0922('0x50')]=qs[_0x0922('0x51')](_0x4074df[_0x0922('0x48')][_0x0922('0x51')]);_0x5b5243['where']=qs[_0x0922('0x4a')](_[_0x0922('0x52')](_0x4074df['query'],_0x53f3ff[_0x0922('0x4a')]),_0x5ac36d);if(_0x4074df[_0x0922('0x48')][_0x0922('0x53')]){_0x5b5243[_0x0922('0x54')]=_['merge'](_0x5b5243[_0x0922('0x54')],{'$or':_[_0x0922('0x47')](_0x5ac36d,function(_0x817f49){if(_0x817f49[_0x0922('0x45')]!==_0x0922('0x55')){var _0x149f64={};_0x149f64[_0x817f49[_0x0922('0x3e')]]={'$like':'%'+_0x4074df[_0x0922('0x48')]['filter']+'%'};return _0x149f64;}})});}_0x5b5243=_[_0x0922('0x56')]({},_0x5b5243,_0x4074df[_0x0922('0x57')]);var _0xc4744c={'where':_0x5b5243['where']};return db[_0x0922('0x42')][_0x0922('0x33')](_0xc4744c)[_0x0922('0x39')](function(_0x4061fc){_0x97e649['count']=_0x4061fc;if(_0x4074df[_0x0922('0x48')][_0x0922('0x58')]){_0x5b5243[_0x0922('0x59')]=[{'all':!![]}];}return db[_0x0922('0x42')][_0x0922('0x5a')](_0x5b5243);})[_0x0922('0x39')](function(_0x544692){_0x97e649[_0x0922('0x5b')]=_0x544692;return _0x97e649;})['then'](respondWithFilteredResult(_0x2ab91f,_0x5b5243))['catch'](handleError(_0x2ab91f,null));};exports[_0x0922('0x5c')]=function(_0x22c0b1,_0x4256c7){var _0xf356e={'raw':![],'where':{'id':_0x22c0b1[_0x0922('0x5d')]['id']},'include':[{'model':db[_0x0922('0x41')],'as':_0x0922('0x5e')}]},_0x23ea63={};_0x23ea63[_0x0922('0x4b')]=_['keys'](db[_0x0922('0x42')][_0x0922('0x43')]);_0x23ea63[_0x0922('0x48')]=_[_0x0922('0x49')](_0x22c0b1[_0x0922('0x48')]);_0x23ea63[_0x0922('0x4a')]=_[_0x0922('0x5f')](_0x23ea63[_0x0922('0x4b')],_0x23ea63[_0x0922('0x48')]);_0xf356e[_0x0922('0x4c')]=_[_0x0922('0x5f')](_0x23ea63['model'],qs[_0x0922('0x4d')](_0x22c0b1[_0x0922('0x48')]['fields']));_0xf356e['attributes']=_0xf356e[_0x0922('0x4c')]['length']?_0xf356e[_0x0922('0x4c')]:_0x23ea63[_0x0922('0x4b')];if(_0x22c0b1[_0x0922('0x48')][_0x0922('0x58')]){_0xf356e['include']=[{'all':!![]}];}_0xf356e=_[_0x0922('0x56')]({},_0xf356e,_0x22c0b1['options']);return db[_0x0922('0x42')][_0x0922('0x60')](_0xf356e)[_0x0922('0x39')](handleEntityNotFound(_0x4256c7,null))[_0x0922('0x39')](respondWithResult(_0x4256c7,null))[_0x0922('0x2c')](handleError(_0x4256c7,null));};exports[_0x0922('0x61')]=function(_0x46ff2d,_0xb6cd60){return db[_0x0922('0x42')][_0x0922('0x61')](_0x46ff2d[_0x0922('0x62')],{})['then'](function(_0x5e24d7){var _0x2858d5=_0x46ff2d[_0x0922('0x63')][_0x0922('0x3b')]({'plain':!![]});if(!_0x2858d5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2858d5[_0x0922('0x64')]===_0x0922('0x63')){var _0x157cc5=_0x5e24d7['get']({'plain':!![]});var _0x3f43ad=_0x0922('0x3c');return db[_0x0922('0x65')][_0x0922('0x60')]({'where':{'name':_0x3f43ad,'userProfileId':_0x2858d5[_0x0922('0x66')]},'raw':!![]})['then'](function(_0x59ca70){if(_0x59ca70&&_0x59ca70['autoAssociation']===0x0){return db[_0x0922('0x3d')][_0x0922('0x61')]({'name':_0x157cc5[_0x0922('0x3e')],'resourceId':_0x157cc5['id'],'type':_0x59ca70['name'],'sectionId':_0x59ca70['id']},{})['then'](function(){return _0x5e24d7;});}else{return _0x5e24d7;}})['catch'](function(_0x20deb4){logger[_0x0922('0x27')](_0x0922('0x67'),_0x20deb4);throw _0x20deb4;});}return _0x5e24d7;})[_0x0922('0x39')](respondWithResult(_0xb6cd60,0xc9))[_0x0922('0x2c')](handleError(_0xb6cd60,null));};exports[_0x0922('0x38')]=function(_0x5096f4,_0x149abe){if(_0x5096f4[_0x0922('0x62')]['id']){delete _0x5096f4[_0x0922('0x62')]['id'];}return db[_0x0922('0x42')][_0x0922('0x60')]({'where':{'id':_0x5096f4[_0x0922('0x5d')]['id']},'include':[{'model':db[_0x0922('0x41')],'as':_0x0922('0x5e')}]})[_0x0922('0x39')](handleEntityNotFound(_0x149abe,null))[_0x0922('0x39')](saveUpdates(_0x5096f4[_0x0922('0x62')],null))[_0x0922('0x39')](respondWithResult(_0x149abe,null))[_0x0922('0x2c')](handleError(_0x149abe,null));};exports[_0x0922('0x3a')]=function(_0x43231c,_0x112ba1){return db[_0x0922('0x42')][_0x0922('0x60')]({'where':{'id':_0x43231c['params']['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x112ba1,null))['then'](removeEntity(_0x112ba1,null))[_0x0922('0x2c')](handleError(_0x112ba1,null));};exports[_0x0922('0x68')]=function(_0x5dc6b6,_0xb90f39){return db[_0x0922('0x42')][_0x0922('0x68')]()[_0x0922('0x39')](respondWithResult(_0xb90f39,null))[_0x0922('0x2c')](handleError(_0xb90f39,null));};exports[_0x0922('0x69')]=function(_0x2b1318,_0x39a6dc,_0xbc4000){if(_0x2b1318[_0x0922('0x62')]['id']){delete _0x2b1318[_0x0922('0x62')]['id'];}return db[_0x0922('0x42')]['find']({'where':{'id':_0x2b1318[_0x0922('0x5d')]['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x39a6dc,null))[_0x0922('0x39')](function(_0x3a4f4b){if(_0x3a4f4b){_0x2b1318[_0x0922('0x62')][_0x0922('0x6a')]=_0x3a4f4b['id'];return db[_0x0922('0x6b')]['create'](_0x2b1318[_0x0922('0x62')]);}})[_0x0922('0x39')](respondWithResult(_0x39a6dc,null))[_0x0922('0x2c')](handleError(_0x39a6dc,null));};exports[_0x0922('0x6c')]=function(_0x3a5ac4,_0x52d7db,_0x3dadb7){var _0x56fefc={'raw':![],'where':{}};var _0x239441={};var _0x46b8dc={'count':0x0,'rows':[]};return db[_0x0922('0x42')][_0x0922('0x6d')]({'where':{'id':_0x3a5ac4[_0x0922('0x5d')]['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x52d7db,null))[_0x0922('0x39')](function(_0x36ad7a){if(_0x36ad7a){_0x239441[_0x0922('0x4b')]=_['keys'](db[_0x0922('0x6b')][_0x0922('0x43')]);_0x239441['query']=_[_0x0922('0x49')](_0x3a5ac4[_0x0922('0x48')]);_0x239441['filters']=_[_0x0922('0x5f')](_0x239441[_0x0922('0x4b')],_0x239441['query']);_0x56fefc[_0x0922('0x4c')]=_['intersection'](_0x239441[_0x0922('0x4b')],qs[_0x0922('0x4d')](_0x3a5ac4['query'][_0x0922('0x4d')]));_0x56fefc['attributes']=_0x56fefc['attributes'][_0x0922('0x4e')]?_0x56fefc[_0x0922('0x4c')]:_0x239441['model'];if(!_0x3a5ac4[_0x0922('0x48')][_0x0922('0x4f')](_0x0922('0x6e'))){_0x56fefc[_0x0922('0x32')]=qs[_0x0922('0x32')](_0x3a5ac4[_0x0922('0x48')][_0x0922('0x32')]);_0x56fefc[_0x0922('0x30')]=qs[_0x0922('0x30')](_0x3a5ac4['query'][_0x0922('0x30')]);}_0x56fefc['order']=qs[_0x0922('0x51')](_0x3a5ac4[_0x0922('0x48')][_0x0922('0x51')]);_0x56fefc[_0x0922('0x54')]=qs[_0x0922('0x4a')](_[_0x0922('0x52')](_0x3a5ac4[_0x0922('0x48')],_0x239441[_0x0922('0x4a')]));_0x56fefc[_0x0922('0x54')][_0x0922('0x6a')]=_0x36ad7a['id'];if(_0x3a5ac4['query'][_0x0922('0x53')]){_0x56fefc['where']=_[_0x0922('0x56')](_0x56fefc[_0x0922('0x54')],{'$or':_[_0x0922('0x47')](_0x56fefc['attributes'],function(_0x1b1612){var _0x2272ba={};_0x2272ba[_0x1b1612]={'$like':'%'+_0x3a5ac4[_0x0922('0x48')][_0x0922('0x53')]+'%'};return _0x2272ba;})});}_0x56fefc=_[_0x0922('0x56')]({},_0x56fefc,_0x3a5ac4[_0x0922('0x57')]);return db['Disposition'][_0x0922('0x33')]({'where':_0x56fefc['where']})[_0x0922('0x39')](function(_0x5484ac){_0x46b8dc[_0x0922('0x33')]=_0x5484ac;if(_0x3a5ac4[_0x0922('0x48')][_0x0922('0x58')]){_0x56fefc[_0x0922('0x59')]=[{'all':!![]}];}return db[_0x0922('0x6b')][_0x0922('0x5a')](_0x56fefc);})[_0x0922('0x39')](function(_0x337df3){_0x46b8dc['rows']=_0x337df3;return _0x46b8dc;});}})[_0x0922('0x39')](respondWithFilteredResult(_0x52d7db,_0x56fefc))['catch'](handleError(_0x52d7db,null));};exports[_0x0922('0x6f')]=function(_0x4f7ab1,_0x3991e3,_0x4b3e3c){return db[_0x0922('0x42')][_0x0922('0x60')]({'where':{'id':_0x4f7ab1['params']['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x3991e3,null))[_0x0922('0x39')](function(_0x3eb308){if(_0x3eb308){return _0x3eb308[_0x0922('0x6f')](_0x4f7ab1[_0x0922('0x48')]['ids']);}})[_0x0922('0x39')](respondWithStatusCode(_0x3991e3,null))['catch'](handleError(_0x3991e3,null));};exports[_0x0922('0x70')]=function(_0x4859d1,_0x2ce3d5,_0x2a9239){if(_0x4859d1[_0x0922('0x62')]['id']){delete _0x4859d1[_0x0922('0x62')]['id'];}return db[_0x0922('0x42')]['find']({'where':{'id':_0x4859d1['params']['id']}})['then'](handleEntityNotFound(_0x2ce3d5,null))[_0x0922('0x39')](function(_0x4a2625){if(_0x4a2625){_0x4859d1[_0x0922('0x62')][_0x0922('0x6a')]=_0x4a2625['id'];return db['CannedAnswer'][_0x0922('0x61')](_0x4859d1['body']);}})['then'](respondWithResult(_0x2ce3d5,null))['catch'](handleError(_0x2ce3d5,null));};exports[_0x0922('0x71')]=function(_0x72e312,_0x489378,_0x221aa9){var _0x541bad={'raw':![],'where':{}};var _0x23324e={};var _0x2659e3={'count':0x0,'rows':[]};return db[_0x0922('0x42')][_0x0922('0x6d')]({'where':{'id':_0x72e312['params']['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x489378,null))[_0x0922('0x39')](function(_0x513fa4){if(_0x513fa4){_0x23324e[_0x0922('0x4b')]=_[_0x0922('0x49')](db['CannedAnswer'][_0x0922('0x43')]);_0x23324e[_0x0922('0x48')]=_[_0x0922('0x49')](_0x72e312[_0x0922('0x48')]);_0x23324e[_0x0922('0x4a')]=_[_0x0922('0x5f')](_0x23324e[_0x0922('0x4b')],_0x23324e[_0x0922('0x48')]);_0x541bad[_0x0922('0x4c')]=_[_0x0922('0x5f')](_0x23324e[_0x0922('0x4b')],qs['fields'](_0x72e312['query'][_0x0922('0x4d')]));_0x541bad[_0x0922('0x4c')]=_0x541bad[_0x0922('0x4c')][_0x0922('0x4e')]?_0x541bad[_0x0922('0x4c')]:_0x23324e[_0x0922('0x4b')];if(!_0x72e312[_0x0922('0x48')]['hasOwnProperty'](_0x0922('0x6e'))){_0x541bad['limit']=qs[_0x0922('0x32')](_0x72e312[_0x0922('0x48')][_0x0922('0x32')]);_0x541bad[_0x0922('0x30')]=qs[_0x0922('0x30')](_0x72e312['query']['offset']);}_0x541bad['order']=qs['sort'](_0x72e312[_0x0922('0x48')]['sort']);_0x541bad[_0x0922('0x54')]=qs[_0x0922('0x4a')](_[_0x0922('0x52')](_0x72e312[_0x0922('0x48')],_0x23324e[_0x0922('0x4a')]));_0x541bad[_0x0922('0x54')][_0x0922('0x6a')]=_0x513fa4['id'];if(_0x72e312[_0x0922('0x48')][_0x0922('0x53')]){_0x541bad[_0x0922('0x54')]=_['merge'](_0x541bad[_0x0922('0x54')],{'$or':_['map'](_0x541bad[_0x0922('0x4c')],function(_0x17109d){var _0x407325={};_0x407325[_0x17109d]={'$like':'%'+_0x72e312[_0x0922('0x48')]['filter']+'%'};return _0x407325;})});}_0x541bad=_['merge']({},_0x541bad,_0x72e312['options']);return db[_0x0922('0x72')][_0x0922('0x33')]({'where':_0x541bad[_0x0922('0x54')]})['then'](function(_0x1cd2f5){_0x2659e3['count']=_0x1cd2f5;if(_0x72e312['query'][_0x0922('0x58')]){_0x541bad[_0x0922('0x59')]=[{'all':!![]}];}return db[_0x0922('0x72')][_0x0922('0x5a')](_0x541bad);})[_0x0922('0x39')](function(_0x50d9eb){_0x2659e3[_0x0922('0x5b')]=_0x50d9eb;return _0x2659e3;});}})[_0x0922('0x39')](respondWithFilteredResult(_0x489378,_0x541bad))[_0x0922('0x2c')](handleError(_0x489378,null));};exports[_0x0922('0x73')]=function(_0x3e0dbe,_0xb40727,_0x50be0b){return db[_0x0922('0x42')][_0x0922('0x60')]({'where':{'id':_0x3e0dbe['params']['id']}})[_0x0922('0x39')](handleEntityNotFound(_0xb40727,null))[_0x0922('0x39')](function(_0x20a5c9){if(_0x20a5c9){return _0x20a5c9[_0x0922('0x73')](_0x3e0dbe[_0x0922('0x48')][_0x0922('0x74')]);}})[_0x0922('0x39')](respondWithStatusCode(_0xb40727,null))['catch'](handleError(_0xb40727,null));};exports[_0x0922('0x75')]=function(_0x206da7,_0x251850,_0x44e412){var _0x2ea9b7={'channel':_0x0922('0x76')};var _0x59911a=[];var _0x37341f=[];var _0x533588={};return db['SmsAccount'][_0x0922('0x60')]({'where':{'id':_0x206da7[_0x0922('0x5d')]['id']},'include':[{'model':db[_0x0922('0x77')],'as':_0x0922('0x78')}]})[_0x0922('0x39')](handleEntityNotFound(_0x251850,null))['then'](function(_0x23247c){_0x2ea9b7[_0x0922('0x79')]=_0x23247c;_0x2ea9b7[_0x0922('0x7a')]=_[_0x0922('0x7b')](_0x23247c['Applications'],[_0x0922('0x7c')],[_0x0922('0x7d')]);if(_0x2ea9b7[_0x0922('0x79')][_0x0922('0x78')]){delete _0x2ea9b7[_0x0922('0x79')][_0x0922('0x78')];}return db[_0x0922('0x7e')][_0x0922('0x68')]();})[_0x0922('0x39')](function(_0xf3d2a4){if(!_0xf3d2a4){throw new db[(_0x0922('0x7f'))]['ValidationError'](_0x0922('0x80'));}_0x59911a=_[_0x0922('0x81')](_[_0x0922('0x49')](_0xf3d2a4),[_0x0922('0x82'),_0x0922('0x83')]);_0x37341f=_[_0x0922('0x81')](_[_0x0922('0x49')](_0xf3d2a4),[_0x0922('0x82'),_0x0922('0x83'),_0x0922('0x84'),'ListId']);_0x2ea9b7[_0x0922('0x62')]={'mapKey':_0x0922('0x85')};if(_0x2ea9b7[_0x0922('0x79')]['type']){switch(_0x2ea9b7[_0x0922('0x79')][_0x0922('0x45')]){case _0x0922('0x86'):_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')]=_0x206da7[_0x0922('0x62')][_0x0922('0x88')];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')]=_0x206da7[_0x0922('0x62')][_0x0922('0x89')];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x8a')]=_0x206da7[_0x0922('0x62')]['MessageSid'];break;case _0x0922('0x8b'):_0x2ea9b7[_0x0922('0x62')]['from']='+'+_0x206da7[_0x0922('0x62')]['sender'];_0x2ea9b7['body'][_0x0922('0x62')]=_0x206da7[_0x0922('0x62')][_0x0922('0x8c')];break;case _0x0922('0x8d'):_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')]=_0x206da7[_0x0922('0x62')][_0x0922('0x87')];_0x2ea9b7[_0x0922('0x62')]['body']=_0x206da7['body']['message'];break;case'clicksend':_0x2ea9b7['body']['from']=_0x206da7[_0x0922('0x62')][_0x0922('0x87')];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')]=_0x206da7[_0x0922('0x62')]['body'];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x8a')]=_0x206da7[_0x0922('0x62')][_0x0922('0x8e')];break;case _0x0922('0x8f'):_0x2ea9b7[_0x0922('0x62')]['from']=_0x206da7[_0x0922('0x62')]['From'];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')]=_0x206da7[_0x0922('0x62')][_0x0922('0x90')];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x8a')]=_0x206da7[_0x0922('0x62')][_0x0922('0x91')];break;case'infobip':_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')]='+'+_0x206da7[_0x0922('0x62')][_0x0922('0x92')][0x0]['from'];_0x2ea9b7['body']['body']=_0x206da7[_0x0922('0x62')]['results'][0x0][_0x0922('0x8c')];_0x2ea9b7[_0x0922('0x62')]['messageId']=_0x206da7[_0x0922('0x62')]['results'][0x0][_0x0922('0x8a')];break;case _0x0922('0x93'):_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')]=_0x206da7[_0x0922('0x62')][_0x0922('0x94')];_0x2ea9b7[_0x0922('0x62')]['body']=_0x206da7['body']['segmentedMessage'][_0x0922('0x2a')];break;case _0x0922('0x95'):_0x2ea9b7[_0x0922('0x62')]['from']=_0x206da7[_0x0922('0x62')][_0x0922('0x96')];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')]=_0x206da7['body'][_0x0922('0x8c')];_0x2ea9b7[_0x0922('0x62')]['messageId']=_0x206da7[_0x0922('0x62')]['replyMessageId'];break;case _0x0922('0x97'):_0x2ea9b7['body'][_0x0922('0x8a')]=_0x206da7[_0x0922('0x62')][0x0][_0x0922('0x2a')]['id'];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')]=_0x206da7[_0x0922('0x62')][0x0][_0x0922('0x2a')][_0x0922('0x87')];_0x2ea9b7['body'][_0x0922('0x62')]=_0x206da7[_0x0922('0x62')][0x0][_0x0922('0x2a')][_0x0922('0x8c')];break;case _0x0922('0x98'):_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')]=_0x206da7[_0x0922('0x62')]['from'];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')]=_0x206da7[_0x0922('0x62')][_0x0922('0x2a')];_0x2ea9b7[_0x0922('0x62')][_0x0922('0x8a')]=_0x206da7['body']['refid'];break;}}if(_0x2ea9b7[_0x0922('0x62')]['id']){delete _0x2ea9b7[_0x0922('0x62')]['id'];}if(_[_0x0922('0x99')](_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')])){throw new db[(_0x0922('0x7f'))][(_0x0922('0x9a'))](_0x0922('0x9b'));}if(_[_0x0922('0x99')](_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')])||_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')]===''){throw new db[(_0x0922('0x7f'))][(_0x0922('0x9a'))](_0x0922('0x9c'));}if(_[_0x0922('0x99')](_0x2ea9b7[_0x0922('0x62')][_0x0922('0x9d')])){throw new db[(_0x0922('0x7f'))][(_0x0922('0x9a'))](_0x0922('0x9e')+_0x37341f);}if(!_['includes'](_0x37341f,_0x2ea9b7[_0x0922('0x62')][_0x0922('0x9d')])){throw new db['Sequelize'][(_0x0922('0x9a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x37341f);}_0x533588[_0x2ea9b7[_0x0922('0x62')][_0x0922('0x9d')]]=_0x2ea9b7['body']['from'];return db[_0x0922('0x9f')][_0x0922('0x60')]({'where':{'id':_0x2ea9b7['account'][_0x0922('0xa0')]},'include':[{'model':db[_0x0922('0x7e')],'as':_0x0922('0xa1'),'where':_0x533588,'limit':0x1,'order':[[_0x0922('0x83'),_0x0922('0xa2')]]}]});})[_0x0922('0x39')](handleEntityNotFound(_0x251850,null))[_0x0922('0x39')](function(_0x7ca63){if(_0x7ca63){_0x2ea9b7[_0x0922('0xa3')]=_[_0x0922('0xa4')](_0x7ca63,['Contacts']);if(_0x7ca63[_0x0922('0xa1')]['length']){return _0x7ca63[_0x0922('0xa1')][0x0];}var _0x2493e2=_[_0x0922('0x1e')](_0x2ea9b7[_0x0922('0x62')],{'firstName':_0x2ea9b7[_0x0922('0x62')]['from'],'ListId':_0x7ca63['id']});_0x2493e2[_0x2ea9b7[_0x0922('0x62')][_0x0922('0x9d')]]=_0x2ea9b7['body']['from'];return db['CmContact']['create'](_0x2493e2,{'fields':_0x59911a,'raw':!![]});}})['then'](handleEntityNotFound(_0x251850,null))[_0x0922('0x39')](function(_0x1e5792){if(_0x1e5792){_0x2ea9b7[_0x0922('0xa5')]=_0x1e5792;var _0x1eccff={'ContactId':_0x1e5792['id'],'phone':_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')],'SmsAccountId':_0x206da7[_0x0922('0x5d')]['id']};var _0x309e3c={'ContactId':_0x1e5792['id'],'SmsAccountId':_0x206da7['params']['id'],'closed':![]};return db['SmsInteraction'][_0x0922('0x60')]({'where':_0x309e3c})['then'](function(_0x48f646){if(_0x48f646){return[_0x48f646,![]];}return db[_0x0922('0xa6')][_0x0922('0x61')](_0x1eccff)[_0x0922('0x39')](function(_0x51b80b){return[_0x51b80b,!![]];});});}})[_0x0922('0xa7')](function(_0x52e671,_0x45d8bb){_0x2ea9b7[_0x0922('0xa8')]=_0x52e671[_0x0922('0x3b')]({'plain':!![]});_0x2ea9b7[_0x0922('0xa8')]['created']=![];if(_0x45d8bb){if(_0x2ea9b7[_0x0922('0x79')][_0x0922('0xa9')]){_0x2ea9b7['applications'][_0x0922('0xaa')]({'id':0x0,'priority':_0x2ea9b7[_0x0922('0x7a')][_0x0922('0x4e')]+0x1,'app':_0x0922('0xab'),'appdata':_0x0922('0xac'),'interval':_0x0922('0xad')});}_0x2ea9b7[_0x0922('0xa8')][_0x0922('0xae')]=!![];}return db[_0x0922('0xaf')][_0x0922('0x61')]({'phone':_0x2ea9b7[_0x0922('0x62')][_0x0922('0x87')],'messageId':_0x2ea9b7[_0x0922('0x62')][_0x0922('0x8a')],'body':_0x2ea9b7[_0x0922('0x62')][_0x0922('0x62')],'SmsAccountId':_0x206da7['params']['id'],'SmsInteractionId':_0x52e671['id'],'direction':'in','ContactId':_0x52e671['ContactId'],'AttachmentId':_0x2ea9b7[_0x0922('0x62')][_0x0922('0xb0')]});})['then'](function(_0x5f50c1){_0x2ea9b7['message']=_0x5f50c1;if(!_0x2ea9b7[_0x0922('0xa8')]['UserId'])return;return db['User']['find']({'attributes':['id',_0x0922('0x3e')],'where':{'id':_0x2ea9b7[_0x0922('0xa8')][_0x0922('0xb1')]}});})['then'](function(_0x480f4){if(_0x480f4){_0x2ea9b7[_0x0922('0x7a')][_0x0922('0xb2')]({'id':0x0,'priority':0x0,'app':_0x0922('0xb3'),'appdata':_0x480f4['name']+','+(_0x2ea9b7[_0x0922('0x79')][_0x0922('0xb4')]||0xa),'interval':'*,*,*,*'});}if(!_0x2ea9b7['interaction'][_0x0922('0xb5')])return;return db['SmsQueue'][_0x0922('0x60')]({'attributes':['id','name'],'where':{'id':_0x2ea9b7[_0x0922('0xa8')]['queueId']}});})[_0x0922('0x39')](function(_0x260e70){if(_0x260e70){_0x2ea9b7[_0x0922('0x7a')][_0x0922('0xb2')]({'id':0x0,'priority':0x1,'app':_0x0922('0xb6'),'appdata':_0x260e70[_0x0922('0x3e')]+','+(_0x2ea9b7[_0x0922('0x79')][_0x0922('0xb7')]||0x12c),'interval':_0x0922('0xad')});}return respondWithRpcPromise(_0x0922('0xb8'),_0x0922('0xb9'),_0x2ea9b7);})[_0x0922('0x39')](function(_0x4e03b9){if(_0x4e03b9){var _0x162c87=0xc8;var _0x44bd9a=_0x0922('0xba');logger[_0x0922('0x24')](_0x0922('0x26'),_0x44bd9a,_0x162c87,_0x0922('0xbb'));logger['debug'](_0x0922('0xbc'),_0x44bd9a,_0x162c87,_0x0922('0xbb'),JSON['stringify'](_0x4e03b9));if(_0x2ea9b7['account'][_0x0922('0x45')]===_0x0922('0x86')){return _0x251850[_0x0922('0x34')](_0x162c87)[_0x0922('0xbd')](_0x0922('0xbe'),_0x0922('0xbf'))[_0x0922('0x3f')](_0x0922('0xc0'));}else{return _0x251850[_0x0922('0x34')](_0x162c87)[_0x0922('0x2f')](_0x4e03b9);}}})[_0x0922('0x2c')](handleError(_0x251850,null));};exports['addApplications']=function(_0x34463a,_0x136046){var _0x79212c=_0x34463a[_0x0922('0x5d')]['id'];var _0x336b9e=_0x34463a[_0x0922('0x62')];var _0x48bbfc=0xc8;var _0x2dd921=null;return db[_0x0922('0xc1')]['transaction']({'isolationLevel':db[_0x0922('0xc1')][_0x0922('0xc2')][_0x0922('0xc3')][_0x0922('0xc4')]},function(_0x435a5b){return db['SmsAccount']['findOne']({'where':{'id':_0x79212c},'transaction':_0x435a5b})[_0x0922('0x39')](function(_0x16bdc2){if(_0x16bdc2){return db[_0x0922('0x77')][_0x0922('0x3a')]({'where':{'SmsAccountId':_0x79212c},'transaction':_0x435a5b})[_0x0922('0x39')](function(){var _0x57811f=_[_0x0922('0x47')](_0x336b9e,function(_0x419072){_0x419072[_0x0922('0x6a')]=_0x79212c;return _0x419072;});return db[_0x0922('0x77')]['bulkCreate'](_0x57811f,{'transaction':_0x435a5b});});}else{_0x48bbfc=0x194;_0x2dd921=[];}});})[_0x0922('0x39')](function(){if(_0x48bbfc!==0x194){return db['SmsApplication'][_0x0922('0xc5')]({'where':{'SmsAccountId':_0x79212c},'order':_0x0922('0x7c')})[_0x0922('0x39')](function(_0x48db43){_0x2dd921=_0x48db43;});}})['catch'](function(_0x184728){_0x48bbfc=0x1f4;logger[_0x0922('0x27')](_0x184728[_0x0922('0xc6')]);if(_0x184728[_0x0922('0x3e')]){delete _0x184728[_0x0922('0x3e')];}_0x2dd921=_0x184728;})[_0x0922('0xc7')](function(){if(_0x2dd921===null){_0x136046['sendStatus'](_0x48bbfc);}else{if(_0x48bbfc===0x1f4){_0x136046[_0x0922('0x34')](_0x48bbfc)[_0x0922('0x3f')](_0x2dd921);}else{_0x136046[_0x0922('0x34')](_0x48bbfc)['json'](_0x2dd921);}}});};exports[_0x0922('0xc8')]=function(_0x561d9b,_0x543836,_0x491900){var _0x1eedc0={};var _0x1853f4={};var _0xed30aa;var _0x54b892;return db['SmsAccount'][_0x0922('0x6d')]({'where':{'id':_0x561d9b[_0x0922('0x5d')]['id']}})['then'](handleEntityNotFound(_0x543836,null))[_0x0922('0x39')](function(_0x6bd4f5){if(_0x6bd4f5){_0xed30aa=_0x6bd4f5;_0x1853f4[_0x0922('0x4b')]=_[_0x0922('0x49')](db[_0x0922('0x77')][_0x0922('0x43')]);_0x1853f4[_0x0922('0x48')]=_[_0x0922('0x49')](_0x561d9b[_0x0922('0x48')]);_0x1853f4['filters']=_['intersection'](_0x1853f4['model'],_0x1853f4['query']);_0x1eedc0[_0x0922('0x4c')]=_[_0x0922('0x5f')](_0x1853f4[_0x0922('0x4b')],qs[_0x0922('0x4d')](_0x561d9b[_0x0922('0x48')][_0x0922('0x4d')]));_0x1eedc0[_0x0922('0x4c')]=_0x1eedc0[_0x0922('0x4c')]['length']?_0x1eedc0['attributes']:_0x1853f4[_0x0922('0x4b')];_0x1eedc0[_0x0922('0x50')]=qs[_0x0922('0x51')](_0x561d9b[_0x0922('0x48')][_0x0922('0x51')]);_0x1eedc0[_0x0922('0x54')]=qs[_0x0922('0x4a')](_[_0x0922('0x52')](_0x561d9b[_0x0922('0x48')],_0x1853f4['filters']));if(_0x561d9b[_0x0922('0x48')][_0x0922('0x53')]){_0x1eedc0[_0x0922('0x54')]=_[_0x0922('0x56')](_0x1eedc0[_0x0922('0x54')],{'$or':_['map'](_0x1eedc0[_0x0922('0x4c')],function(_0x33f1bd){var _0x156040={};_0x156040[_0x33f1bd]={'$like':'%'+_0x561d9b[_0x0922('0x48')][_0x0922('0x53')]+'%'};return _0x156040;})});}_0x1eedc0=_[_0x0922('0x56')]({},_0x1eedc0,_0x561d9b[_0x0922('0x57')]);return _0xed30aa[_0x0922('0xc8')](_0x1eedc0);}})[_0x0922('0x39')](function(_0x536a91){if(_0x536a91){_0x54b892=_0x536a91[_0x0922('0x4e')];if(!_0x561d9b['query'][_0x0922('0x4f')](_0x0922('0x6e'))){_0x1eedc0['limit']=qs['limit'](_0x561d9b[_0x0922('0x48')]['limit']);_0x1eedc0[_0x0922('0x30')]=qs[_0x0922('0x30')](_0x561d9b[_0x0922('0x48')][_0x0922('0x30')]);}return _0xed30aa['getApplications'](_0x1eedc0);}})[_0x0922('0x39')](function(_0x1cf11f){if(_0x1cf11f){return _0x1cf11f?{'count':_0x54b892,'rows':_0x1cf11f}:null;}})['then'](respondWithResult(_0x543836,null))['catch'](handleError(_0x543836,null));};exports['getInteractions']=function(_0x461387,_0x233cc2,_0x7f355a){var _0x4e2c5c={'raw':![],'where':{}};var _0x366a7b={};var _0x36f2e5={'count':0x0,'rows':[]};return db[_0x0922('0x42')][_0x0922('0x6d')]({'where':{'id':_0x461387[_0x0922('0x5d')]['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x233cc2,null))[_0x0922('0x39')](function(_0x5be180){if(_0x5be180){_0x366a7b[_0x0922('0x4b')]=_['keys'](db[_0x0922('0xa6')][_0x0922('0x43')]);_0x366a7b[_0x0922('0x48')]=_[_0x0922('0x49')](_0x461387[_0x0922('0x48')]);_0x366a7b[_0x0922('0x4a')]=_[_0x0922('0x5f')](_0x366a7b['model'],_0x366a7b['query']);_0x4e2c5c[_0x0922('0x4c')]=_[_0x0922('0x5f')](_0x366a7b[_0x0922('0x4b')],qs[_0x0922('0x4d')](_0x461387[_0x0922('0x48')][_0x0922('0x4d')]));_0x4e2c5c[_0x0922('0x4c')]=_0x4e2c5c[_0x0922('0x4c')][_0x0922('0x4e')]?_0x4e2c5c['attributes']:_0x366a7b[_0x0922('0x4b')];if(!_0x461387['query']['hasOwnProperty']('nolimit')){_0x4e2c5c[_0x0922('0x32')]=qs['limit'](_0x461387[_0x0922('0x48')]['limit']);_0x4e2c5c[_0x0922('0x30')]=qs[_0x0922('0x30')](_0x461387[_0x0922('0x48')][_0x0922('0x30')]);}_0x4e2c5c[_0x0922('0x50')]=qs[_0x0922('0x51')](_0x461387[_0x0922('0x48')]['sort']);_0x4e2c5c['where']=qs['filters'](_[_0x0922('0x52')](_0x461387['query'],_0x366a7b[_0x0922('0x4a')]));_0x4e2c5c[_0x0922('0x54')][_0x0922('0x6a')]=_0x5be180['id'];if(_0x461387[_0x0922('0x48')]['filter']){_0x4e2c5c['where']=_[_0x0922('0x56')](_0x4e2c5c[_0x0922('0x54')],{'$or':_[_0x0922('0x47')](_0x4e2c5c['attributes'],function(_0x367d0b){var _0x4ed7ed={};_0x4ed7ed[_0x367d0b]={'$like':'%'+_0x461387[_0x0922('0x48')][_0x0922('0x53')]+'%'};return _0x4ed7ed;})});}_0x4e2c5c=_['merge']({},_0x4e2c5c,_0x461387[_0x0922('0x57')]);return db[_0x0922('0xa6')][_0x0922('0x33')]({'where':_0x4e2c5c[_0x0922('0x54')]})[_0x0922('0x39')](function(_0x441e59){_0x36f2e5['count']=_0x441e59;if(_0x461387['query'][_0x0922('0x58')]){_0x4e2c5c[_0x0922('0x59')]=[{'model':db[_0x0922('0x7e')],'as':_0x0922('0xc9'),'required':![]},{'model':db['User'],'as':_0x0922('0xca'),'attributes':[_0x0922('0x3e'),_0x0922('0xcb'),'internal'],'required':![]},{'model':db[_0x0922('0xcc')],'as':_0x0922('0xcd'),'attributes':['id',_0x0922('0x3e'),_0x0922('0xce')],'where':_0x461387[_0x0922('0x48')][_0x0922('0xcf')]?{'id':_0x461387['query']['tag']}:undefined,'required':_0x461387[_0x0922('0x48')][_0x0922('0xcf')]?!![]:![]}];}return db[_0x0922('0xa6')][_0x0922('0x5a')](_0x4e2c5c);})[_0x0922('0x39')](function(_0x5d8dba){_0x36f2e5['rows']=_0x5d8dba;return _0x36f2e5;});}})[_0x0922('0x39')](respondWithFilteredResult(_0x233cc2,_0x4e2c5c))[_0x0922('0x2c')](handleError(_0x233cc2,null));};exports['send']=function(_0x5d5900,_0x631fbf,_0x32ac64){var _0x535b11,_0x27e907,_0x48c6c7;if(_[_0x0922('0x99')](_0x5d5900['body'][_0x0922('0x62')])||_0x5d5900[_0x0922('0x62')][_0x0922('0x62')]===''){throw new db[(_0x0922('0x7f'))]['ValidationError'](_0x0922('0x9c'));}if(_[_0x0922('0x99')](_0x5d5900[_0x0922('0x62')]['to'])){throw new db[(_0x0922('0x7f'))][(_0x0922('0x9a'))](_0x0922('0xd0'));}_0x535b11=_0x5d5900[_0x0922('0x62')]['to'];return db[_0x0922('0x42')][_0x0922('0x60')]({'where':{'id':_0x5d5900[_0x0922('0x5d')]['id']},'include':[{'model':db[_0x0922('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x535b11},'limit':0x1,'order':[[_0x0922('0x83'),_0x0922('0xa2')]]}]}]})[_0x0922('0x39')](handleEntityNotFound(_0x631fbf,null))[_0x0922('0x39')](function(_0x14bd2f){if(_0x14bd2f&&_0x14bd2f[_0x0922('0xd1')]){_0x27e907=_0x14bd2f[_0x0922('0x3b')]({'plain':!![]});if(_0x27e907[_0x0922('0xd1')]&&_0x27e907[_0x0922('0xd1')][_0x0922('0xa1')]['length']){return _0x27e907[_0x0922('0xd1')][_0x0922('0xa1')][0x0];}return db['CmContact'][_0x0922('0x61')](_['defaults'](_0x5d5900[_0x0922('0x62')],{'firstName':_0x535b11,'mobile':_0x535b11,'phone':_0x535b11,'ListId':_0x27e907['ListId']}));}})[_0x0922('0x39')](handleEntityNotFound(_0x631fbf,null))[_0x0922('0x39')](function(_0x371c35){if(_0x371c35){_0x48c6c7=_0x371c35;return db['SmsInteraction'][_0x0922('0x60')]({'where':{'ContactId':_0x48c6c7['id'],'closed':![],'SmsAccountId':_0x27e907['id']}})[_0x0922('0x39')](function(_0x3681cb){if(_0x3681cb){return[_0x3681cb,![]];}return db[_0x0922('0xa6')]['create']({'UserId':_0x5d5900['user']['id'],'ContactId':_0x48c6c7['id'],'SmsAccountId':_0x27e907['id'],'phone':_0x535b11,'firstMsgDirection':_0x0922('0xd2'),'Messages':[_[_0x0922('0x56')](_0x5d5900[_0x0922('0x62')],{'read':![],'body':_0x5d5900[_0x0922('0x62')][_0x0922('0x62')],'phone':_0x535b11,'SmsAccountId':_0x27e907['id'],'UserId':_0x5d5900[_0x0922('0x63')]['id'],'ContactId':_0x48c6c7['id']})]},{'include':[{'model':db[_0x0922('0xaf')],'as':_0x0922('0xd3')}]})[_0x0922('0x39')](function(_0x498ea7){return[_0x498ea7,!![]];});});}})[_0x0922('0xa7')](function(_0x3c0a88,_0x25c681){if(_0x25c681){return _0x3c0a88;}return db['SmsMessage'][_0x0922('0x61')](_[_0x0922('0x56')](_0x5d5900['body'],{'read':![],'body':_0x5d5900[_0x0922('0x62')][_0x0922('0x62')],'phone':_0x535b11,'SmsAccountId':_0x27e907['id'],'SmsInteractionId':_0x3c0a88['id'],'UserId':_0x5d5900[_0x0922('0x63')]['id'],'ContactId':_0x48c6c7['id']}))[_0x0922('0x39')](function(_0x990076){_0x3c0a88[_0x0922('0xd4')][_0x0922('0xd3')]=[];_0x3c0a88[_0x0922('0xd4')]['Messages'][_0x0922('0xaa')](_0x990076[_0x0922('0xd4')]);return _0x3c0a88;});})[_0x0922('0x39')](respondWithResult(_0x631fbf,null))[_0x0922('0x2c')](handleError(_0x631fbf,null));};exports[_0x0922('0x34')]=function(_0x21b7f4,_0x4f3038,_0x572741){if(_0x21b7f4[_0x0922('0x62')]['id']){delete _0x21b7f4[_0x0922('0x62')]['id'];}var _0x3873fa,_0x5ce19f,_0x3b1368;return db[_0x0922('0x42')]['find']({'where':{'id':_0x21b7f4[_0x0922('0x5d')]['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x4f3038,null))[_0x0922('0x39')](function(_0x5207f9){if(_0x5207f9){_0x3b1368=_0x5207f9;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0922('0x34'),'received\x20delivery\x20report\x20from',_0x5207f9[_0x0922('0x45')],util[_0x0922('0xd5')](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));switch(_0x5207f9[_0x0922('0x45')]){case _0x0922('0x8b'):if(_0x21b7f4['body'][_0x0922('0xd6')]&&_0x21b7f4[_0x0922('0x62')]['status']){_0x5ce19f=_0x21b7f4[_0x0922('0x62')][_0x0922('0x34')];return db['SmsMessage'][_0x0922('0x60')]({'where':{'messageId':_0x21b7f4[_0x0922('0x62')][_0x0922('0xd6')]}});}break;case _0x0922('0x8d'):if(_0x21b7f4[_0x0922('0x62')]['requestid']&&_0x21b7f4[_0x0922('0x62')][_0x0922('0xd7')]){_0x5ce19f=_0x21b7f4[_0x0922('0x62')]['statusInt'];return db[_0x0922('0xaf')][_0x0922('0x60')]({'where':{'messageId':_0x21b7f4['body'][_0x0922('0xd8')]}});}break;case'clicksend':if(_0x21b7f4[_0x0922('0x62')]['message_id']&&_0x21b7f4['body'][_0x0922('0xd9')]){_0x5ce19f=_0x21b7f4[_0x0922('0x62')][_0x0922('0xd9')];return db[_0x0922('0xaf')][_0x0922('0x60')]({'where':{'messageId':_0x21b7f4['body'][_0x0922('0x8e')]}});}break;case _0x0922('0xda'):var _0xbcf60=_0x21b7f4[_0x0922('0x62')]['results'][0x0];if(_0xbcf60['messageId']&&_0xbcf60[_0x0922('0x34')][_0x0922('0xdb')]==='DELIVERED'){_0x5ce19f=_0xbcf60[_0x0922('0x34')][_0x0922('0xdb')];return db['SmsMessage'][_0x0922('0x60')]({'where':{'messageId':_0xbcf60['messageId']}});}break;case _0x0922('0x95'):if(_0x21b7f4[_0x0922('0x62')][_0x0922('0x8a')]&&_0x21b7f4[_0x0922('0x62')][_0x0922('0x34')]){_0x5ce19f=_0x21b7f4[_0x0922('0x62')]['status'];return db[_0x0922('0xaf')][_0x0922('0x60')]({'where':{'messageId':_0x21b7f4[_0x0922('0x62')][_0x0922('0x8a')]}});}break;case _0x0922('0x97'):if(_0x21b7f4[_0x0922('0x62')][0x0][_0x0922('0x2a')]['id']){_0x5ce19f=_0x21b7f4[_0x0922('0x62')][0x0][_0x0922('0x45')];return db['SmsMessage'][_0x0922('0x60')]({'where':{'messageId':_0x21b7f4['body'][0x0][_0x0922('0x2a')]['id']}});}break;case _0x0922('0x98'):if(_0x21b7f4[_0x0922('0x62')]['redif']&&_0x21b7f4[_0x0922('0x62')][_0x0922('0x34')]){_0x5ce19f=_0x21b7f4['body']['status'];return db[_0x0922('0xaf')]['find']({'where':{'messageId':_0x21b7f4[_0x0922('0x62')][_0x0922('0xdc')]}});}break;}}})[_0x0922('0x39')](handleEntityNotFound(_0x4f3038,null))[_0x0922('0x39')](function(_0x4e451a){if(_0x4e451a){_0x3873fa=_0x4e451a;switch(_0x3b1368[_0x0922('0x45')]){case _0x0922('0x8b'):if(_0x5ce19f==='DELIVERED'){return _0x3873fa[_0x0922('0x38')]({'read':!![]});}else{logger[_0x0922('0x27')](_0x0922('0x26'),_0x0922('0x34'),_0x0922('0x8b'),util[_0x0922('0xd5')](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0922('0x8d'):if(_0x5ce19f==='1'){return _0x3873fa[_0x0922('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0922('0x8b'),util[_0x0922('0xd5')](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0922('0xdd'):if(!_0x21b7f4[_0x0922('0x62')][_0x0922('0xde')]&&_0x5ce19f>=0xc8&&_0x5ce19f<=0xce){return _0x3873fa[_0x0922('0x38')]({'read':!![]});}else{logger[_0x0922('0x27')](_0x0922('0x26'),'status',_0x0922('0xdd'),util[_0x0922('0xd5')](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0922('0xda'):var _0x287eda=_0x21b7f4[_0x0922('0x62')]['results'][0x0];if(_0x287eda[_0x0922('0x34')][_0x0922('0xdb')]===_0x0922('0xdf')){return _0x3873fa['update']({'read':!![]});}else{logger[_0x0922('0x27')](_0x0922('0x26'),_0x0922('0x34'),'infobip',util['inspect'](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0922('0x95'):if(_0x5ce19f==_0x0922('0xe0')||_0x5ce19f==_0x0922('0xe1')){return _0x3873fa['update']({'read':!![]});}else{logger[_0x0922('0x27')](_0x0922('0x26'),'status',_0x0922('0x95'),util['inspect'](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0922('0x97'):if(_0x5ce19f==_0x0922('0xe2')){return _0x3873fa[_0x0922('0x38')]({'read':!![]});}else{logger['error'](_0x0922('0x26'),_0x0922('0x34'),_0x0922('0x97'),util[_0x0922('0xd5')](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));}break;case _0x0922('0x98'):if(_0x5ce19f===_0x0922('0xe3')||_0x5ce19f===_0x0922('0xe4')){return _0x3873fa[_0x0922('0x38')]({'read':!![]});}else{logger[_0x0922('0x27')](_0x0922('0x26'),_0x0922('0x34'),_0x0922('0x98'),util[_0x0922('0xd5')](_0x21b7f4[_0x0922('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x3873fa;}})[_0x0922('0x39')](respondWithResult(_0x4f3038,null))[_0x0922('0x2c')](handleError(_0x4f3038,null));};exports[_0x0922('0xe5')]=function(_0x476014,_0x4341c6,_0x31179f){var _0x357fdc,_0xa7593b,_0x197a22;return db[_0x0922('0x42')][_0x0922('0x60')]({'where':{'id':_0x476014[_0x0922('0x5d')]['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x4341c6,null))['then'](function(_0x350c09){if(_0x350c09){_0x197a22=_0x350c09;logger[_0x0922('0x25')](_0x0922('0x26'),_0x0922('0x34'),'received\x20delivery\x20report\x20from',_0x350c09[_0x0922('0x45')],util[_0x0922('0xd5')](_0x476014['query'],{'showHidden':![],'depth':null}));switch(_0x350c09[_0x0922('0x45')]){case _0x0922('0x93'):if(_0x476014[_0x0922('0x48')][_0x0922('0xe6')]&&_0x476014[_0x0922('0x48')][_0x0922('0xe7')]){_0xa7593b=_0x476014[_0x0922('0x48')][_0x0922('0xe7')];return db[_0x0922('0xaf')][_0x0922('0x60')]({'where':{'messageId':_0x476014[_0x0922('0x48')][_0x0922('0xe6')]}});}break;}}})[_0x0922('0x39')](handleEntityNotFound(_0x4341c6,null))[_0x0922('0x39')](function(_0x5010cb){if(_0x5010cb){_0x357fdc=_0x5010cb;switch(_0x197a22['type']){case _0x0922('0x93'):if(_0xa7593b==='2'||_0xa7593b==='6'){return _0x357fdc[_0x0922('0x38')]({'read':!![]});}else{logger[_0x0922('0x27')](_0x0922('0x26'),_0x0922('0x34'),_0x0922('0x93'),util[_0x0922('0xd5')](_0x476014['query'],{'showHidden':![],'depth':null}));};break;}return _0x357fdc;}})['then'](respondWithResult(_0x4341c6,null))[_0x0922('0x2c')](handleError(_0x4341c6,null));};exports['addAgents']=function(_0x58c43f,_0x4fb818,_0x217cba){return db['SmsAccount']['find']({'where':{'id':_0x58c43f[_0x0922('0x5d')]['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x4fb818,null))[_0x0922('0x39')](function(_0x50fd96){if(_0x50fd96){return _0x50fd96[_0x0922('0xe8')](_0x58c43f[_0x0922('0x62')]['ids'],_[_0x0922('0xa4')](_0x58c43f[_0x0922('0x62')],[_0x0922('0x74'),'id'])||{})[_0x0922('0xa7')](function(_0x5e531c){for(var _0x2e8ede=0x0;_0x2e8ede<_0x58c43f[_0x0922('0x62')]['ids'][_0x0922('0x4e')];_0x2e8ede+=0x1){socket[_0x0922('0xe9')](_0x0922('0xea'),{'UserId':Number(_0x58c43f[_0x0922('0x62')][_0x0922('0x74')][_0x2e8ede]),'SmsAccountId':Number(_0x58c43f['params']['id'])});}return _0x5e531c;});}})[_0x0922('0x39')](respondWithResult(_0x4fb818,null))[_0x0922('0x2c')](handleError(_0x4fb818,null));};exports[_0x0922('0xeb')]=function(_0x5059fd,_0x5e32a9,_0xec7712){return db[_0x0922('0x42')][_0x0922('0x60')]({'where':{'id':_0x5059fd['params']['id']}})['then'](handleEntityNotFound(_0x5e32a9,null))[_0x0922('0x39')](function(_0x1aeabe){if(_0x1aeabe){return _0x1aeabe[_0x0922('0xeb')](_0x5059fd[_0x0922('0x48')][_0x0922('0x74')])[_0x0922('0x39')](function(){if(_[_0x0922('0xec')](_0x5059fd[_0x0922('0x48')][_0x0922('0x74')])){for(var _0x19ed64=0x0;_0x19ed64<_0x5059fd[_0x0922('0x48')][_0x0922('0x74')][_0x0922('0x4e')];_0x19ed64+=0x1){socket[_0x0922('0xe9')]('userSmsAccount:remove',{'UserId':Number(_0x5059fd['query'][_0x0922('0x74')][_0x19ed64]),'SmsAccountId':Number(_0x5059fd['params']['id'])});}}else{socket[_0x0922('0xe9')](_0x0922('0xed'),{'UserId':Number(_0x5059fd[_0x0922('0x48')][_0x0922('0x74')]),'SmsAccountId':Number(_0x5059fd[_0x0922('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x5e32a9,null))[_0x0922('0x2c')](handleError(_0x5e32a9,null));};exports[_0x0922('0xee')]=function(_0x13f793,_0x324190,_0x39f463){var _0x4c2677={};var _0x4cccc8={};var _0x20dadd;var _0x3a807b;return db[_0x0922('0x42')][_0x0922('0x6d')]({'where':{'id':_0x13f793['params']['id']}})[_0x0922('0x39')](handleEntityNotFound(_0x324190,null))[_0x0922('0x39')](function(_0x3ce505){if(_0x3ce505){_0x20dadd=_0x3ce505;_0x4cccc8[_0x0922('0x4b')]=_[_0x0922('0x49')](db[_0x0922('0xef')][_0x0922('0x43')]);_0x4cccc8['query']=_[_0x0922('0x49')](_0x13f793[_0x0922('0x48')]);_0x4cccc8['filters']=_[_0x0922('0x5f')](_0x4cccc8[_0x0922('0x4b')],_0x4cccc8[_0x0922('0x48')]);_0x4c2677['attributes']=_[_0x0922('0x5f')](_0x4cccc8['model'],qs[_0x0922('0x4d')](_0x13f793[_0x0922('0x48')][_0x0922('0x4d')]));_0x4c2677[_0x0922('0x4c')]=_0x4c2677[_0x0922('0x4c')]['length']?_0x4c2677[_0x0922('0x4c')]:_0x4cccc8[_0x0922('0x4b')];_0x4c2677['order']=qs[_0x0922('0x51')](_0x13f793[_0x0922('0x48')]['sort']);_0x4c2677['where']=qs[_0x0922('0x4a')](_['pick'](_0x13f793[_0x0922('0x48')],_0x4cccc8[_0x0922('0x4a')]));if(_0x13f793[_0x0922('0x48')]['filter']){_0x4c2677[_0x0922('0x54')]=_[_0x0922('0x56')](_0x4c2677[_0x0922('0x54')],{'$or':_[_0x0922('0x47')](_0x4c2677['attributes'],function(_0xa63baf){var _0x5667ba={};_0x5667ba[_0xa63baf]={'$like':'%'+_0x13f793[_0x0922('0x48')][_0x0922('0x53')]+'%'};return _0x5667ba;})});}_0x4c2677=_[_0x0922('0x56')]({},_0x4c2677,_0x13f793[_0x0922('0x57')]);return _0x20dadd[_0x0922('0xee')](_0x4c2677);}})[_0x0922('0x39')](function(_0x3d28cf){if(_0x3d28cf){_0x3a807b=_0x3d28cf[_0x0922('0x4e')];if(!_0x13f793['query'][_0x0922('0x4f')]('nolimit')){_0x4c2677['limit']=qs['limit'](_0x13f793[_0x0922('0x48')][_0x0922('0x32')]);_0x4c2677['offset']=qs[_0x0922('0x30')](_0x13f793[_0x0922('0x48')][_0x0922('0x30')]);}return _0x20dadd[_0x0922('0xee')](_0x4c2677);}})[_0x0922('0x39')](function(_0xa1644f){if(_0xa1644f){return _0xa1644f?{'count':_0x3a807b,'rows':_0xa1644f}:null;}})['then'](respondWithResult(_0x324190,null))[_0x0922('0x2c')](handleError(_0x324190,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index db29b8b..535a20f 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 _0xb921=['hasOwnProperty','exports','events','SmsAccount','save','update','emit'];(function(_0x3e4539,_0x3811e0){var _0x18469c=function(_0x1f619b){while(--_0x1f619b){_0x3e4539['push'](_0x3e4539['shift']());}};_0x18469c(++_0x3811e0);}(_0xb921,0xb8));var _0x1b92=function(_0x155e04,_0x28cd61){_0x155e04=_0x155e04-0x0;var _0x4590d0=_0xb921[_0x155e04];return _0x4590d0;};'use strict';var EventEmitter=require(_0x1b92('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x1b92('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1b92('0x2'),'afterUpdate':_0x1b92('0x3'),'afterDestroy':'remove'};function emitEvent(_0x51c7c7){return function(_0x4afd47,_0x26c3ba,_0x32483f){SmsAccountEvents[_0x1b92('0x4')](_0x51c7c7+':'+_0x4afd47['id'],_0x4afd47);SmsAccountEvents['emit'](_0x51c7c7,_0x4afd47);_0x32483f(null);};}for(var e in events){if(events[_0x1b92('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x1b92('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0xa099=['exports','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x39c012,_0x397c30){var _0x139ce5=function(_0x1e0759){while(--_0x1e0759){_0x39c012['push'](_0x39c012['shift']());}};_0x139ce5(++_0x397c30);}(_0xa099,0x69));var _0x9a09=function(_0x2b6c6d,_0x419c5c){_0x2b6c6d=_0x2b6c6d-0x0;var _0x3c889f=_0xa099[_0x2b6c6d];return _0x3c889f;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9a09('0x0')](0x0);var events={'afterCreate':_0x9a09('0x1'),'afterUpdate':_0x9a09('0x2'),'afterDestroy':_0x9a09('0x3')};function emitEvent(_0x38c674){return function(_0x31f6e2,_0x36aed9,_0x4796e6){SmsAccountEvents[_0x9a09('0x4')](_0x38c674+':'+_0x31f6e2['id'],_0x31f6e2);SmsAccountEvents[_0x9a09('0x4')](_0x38c674,_0x31f6e2);_0x4796e6(null);};}for(var e in events){if(events[_0x9a09('0x5')](e)){var event=events[e];SmsAccount[_0x9a09('0x6')](e,emitEvent(event));}}module[_0x9a09('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 78f1801..88dba01 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 _0x5816=['../../config/logger','api','bluebird','path','../../config/environment','exports','SmsAccount','sms_accounts','util'];(function(_0x359f5f,_0x505e79){var _0x2b5611=function(_0x36bab0){while(--_0x36bab0){_0x359f5f['push'](_0x359f5f['shift']());}};_0x2b5611(++_0x505e79);}(_0x5816,0xa1));var _0x6581=function(_0x465b18,_0x2bc166){_0x465b18=_0x465b18-0x0;var _0x5d8f8d=_0x5816[_0x465b18];return _0x5d8f8d;};'use strict';var _=require('lodash');var util=require(_0x6581('0x0'));var logger=require(_0x6581('0x1'))(_0x6581('0x2'));var moment=require('moment');var BPromise=require(_0x6581('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6581('0x4'));var rimraf=require('rimraf');var config=require(_0x6581('0x5'));var attributes=require('./smsAccount.attributes');module[_0x6581('0x6')]=function(_0xb96474,_0x3c5651){return _0xb96474['define'](_0x6581('0x7'),attributes,{'tableName':_0x6581('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c10=['exports','sms_accounts','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c10,0xc8));var _0x02c1=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x2c10[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x02c1('0x0'))(_0x02c1('0x1'));var moment=require('moment');var BPromise=require(_0x02c1('0x2'));var rp=require(_0x02c1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02c1('0x4'));var config=require(_0x02c1('0x5'));var attributes=require(_0x02c1('0x6'));module[_0x02c1('0x7')]=function(_0x255086,_0x16f9a3){return _0x255086['define']('SmsAccount',attributes,{'tableName':_0x02c1('0x8'),'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 b05da80..8b35f03 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 _0x3224=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','include','model','lodash','util','randomstring'];(function(_0x3cc6bb,_0x3f6595){var _0x44d861=function(_0x270b7a){while(--_0x270b7a){_0x3cc6bb['push'](_0x3cc6bb['shift']());}};_0x44d861(++_0x3f6595);}(_0x3224,0x100));var _0x4322=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x3224[_0x49aa7d];return _0xdd0d26;};'use strict';var _=require(_0x4322('0x0'));var util=require(_0x4322('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4322('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4322('0x3'))['db'];var utils=require(_0x4322('0x4'));var logger=require(_0x4322('0x5'))(_0x4322('0x6'));var config=require(_0x4322('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4322('0x8')][_0x4322('0x9')]({'port':0x232a});config[_0x4322('0xa')]=_[_0x4322('0xb')](config['redis'],{'host':_0x4322('0xc'),'port':0x18eb});var socket=require(_0x4322('0xd'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x17ba8b,_0x17b722,_0x5bcf06){return new BPromise(function(_0x23c262,_0x1a774c){return client[_0x4322('0xe')](_0x17ba8b,_0x5bcf06)[_0x4322('0xf')](function(_0x4e6760){logger[_0x4322('0x10')](_0x4322('0x11'),_0x17b722,_0x4322('0x12'));logger[_0x4322('0x13')](_0x4322('0x14'),_0x17b722,_0x4322('0x12'),JSON[_0x4322('0x15')](_0x4e6760));if(_0x4e6760['error']){if(_0x4e6760['error'][_0x4322('0x16')]===0x1f4){logger['error'](_0x4322('0x11'),_0x17b722,_0x4e6760[_0x4322('0x17')][_0x4322('0x18')]);return _0x1a774c(_0x4e6760[_0x4322('0x17')][_0x4322('0x18')]);}logger[_0x4322('0x17')]('SmsAccount,\x20%s,\x20%s',_0x17b722,_0x4e6760['error'][_0x4322('0x18')]);return _0x23c262(_0x4e6760[_0x4322('0x17')]['message']);}else{logger['info'](_0x4322('0x11'),_0x17b722,_0x4322('0x12'));_0x23c262(_0x4e6760[_0x4322('0x19')][_0x4322('0x18')]);}})[_0x4322('0x1a')](function(_0xae163d){logger['error']('SmsAccount,\x20%s,\x20%s',_0x17b722,_0xae163d);_0x1a774c(_0xae163d);});});}exports[_0x4322('0x1b')]=function(_0x2546f2){var _0x2d4cfa=this;return new Promise(function(_0x8dd17e,_0x324725){return db[_0x4322('0x1c')][_0x4322('0x1d')]({'raw':_0x2546f2[_0x4322('0x1e')]?_0x2546f2[_0x4322('0x1e')][_0x4322('0x1f')]===undefined?!![]:![]:!![],'where':_0x2546f2[_0x4322('0x1e')]?_0x2546f2[_0x4322('0x1e')][_0x4322('0x20')]||null:null,'attributes':_0x2546f2[_0x4322('0x1e')]?_0x2546f2[_0x4322('0x1e')][_0x4322('0x21')]||null:null,'include':_0x2546f2['options']?_0x2546f2[_0x4322('0x1e')]['include']?_[_0x4322('0x22')](_0x2546f2[_0x4322('0x1e')][_0x4322('0x23')],function(_0x37c13){return{'model':db[_0x37c13[_0x4322('0x24')]],'as':_0x37c13['as'],'attributes':_0x37c13[_0x4322('0x21')],'include':_0x37c13[_0x4322('0x23')]?_[_0x4322('0x22')](_0x37c13[_0x4322('0x23')],function(_0x5d0e20){return{'model':db[_0x5d0e20['model']],'as':_0x5d0e20['as'],'attributes':_0x5d0e20[_0x4322('0x21')],'include':_0x5d0e20['include']?_['map'](_0x5d0e20['include'],function(_0x10022b){return{'model':db[_0x10022b[_0x4322('0x24')]],'as':_0x10022b['as'],'attributes':_0x10022b[_0x4322('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4322('0xf')](function(_0x38061d){logger[_0x4322('0x10')](_0x4322('0x1b'),_0x2546f2);logger[_0x4322('0x13')](_0x4322('0x1b'),_0x2546f2,JSON['stringify'](_0x38061d));_0x8dd17e(_0x38061d);})[_0x4322('0x1a')](function(_0x3aac52){logger[_0x4322('0x17')](_0x4322('0x1b'),_0x3aac52[_0x4322('0x18')],_0x2546f2);_0x324725(_0x2d4cfa[_0x4322('0x17')](0x1f4,_0x3aac52[_0x4322('0x18')]));});});}; \ No newline at end of file +var _0x2621=['info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','raw','options','attributes','include','map','model','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket'];(function(_0x336119,_0x500c63){var _0x1b3399=function(_0x1a9d31){while(--_0x1a9d31){_0x336119['push'](_0x336119['shift']());}};_0x1b3399(++_0x500c63);}(_0x2621,0xa1));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1262('0x0'));var moment=require('moment');var BPromise=require(_0x1262('0x1'));var rs=require(_0x1262('0x2'));var fs=require('fs');var Redis=require(_0x1262('0x3'));var db=require(_0x1262('0x4'))['db'];var utils=require(_0x1262('0x5'));var logger=require(_0x1262('0x6'))(_0x1262('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1262('0x8')][_0x1262('0x9')]({'port':0x232a});config[_0x1262('0xa')]=_[_0x1262('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1262('0xc'))(new Redis(config[_0x1262('0xa')]));require(_0x1262('0xd'))['register'](socket);function respondWithRpcPromise(_0x78c8fe,_0x3ad6ac,_0x1c2fa9){return new BPromise(function(_0x34b7fa,_0x2f5fb0){return client['request'](_0x78c8fe,_0x1c2fa9)['then'](function(_0x32689b){logger[_0x1262('0xe')](_0x1262('0xf'),_0x3ad6ac,_0x1262('0x10'));logger[_0x1262('0x11')](_0x1262('0x12'),_0x3ad6ac,_0x1262('0x10'),JSON[_0x1262('0x13')](_0x32689b));if(_0x32689b['error']){if(_0x32689b[_0x1262('0x14')][_0x1262('0x15')]===0x1f4){logger[_0x1262('0x14')]('SmsAccount,\x20%s,\x20%s',_0x3ad6ac,_0x32689b[_0x1262('0x14')][_0x1262('0x16')]);return _0x2f5fb0(_0x32689b[_0x1262('0x14')][_0x1262('0x16')]);}logger['error'](_0x1262('0xf'),_0x3ad6ac,_0x32689b['error']['message']);return _0x34b7fa(_0x32689b[_0x1262('0x14')][_0x1262('0x16')]);}else{logger[_0x1262('0xe')](_0x1262('0xf'),_0x3ad6ac,'request\x20sent');_0x34b7fa(_0x32689b[_0x1262('0x17')][_0x1262('0x16')]);}})[_0x1262('0x18')](function(_0x2ff146){logger[_0x1262('0x14')](_0x1262('0xf'),_0x3ad6ac,_0x2ff146);_0x2f5fb0(_0x2ff146);});});}exports[_0x1262('0x19')]=function(_0xac9547){var _0x3573f4=this;return new Promise(function(_0x4d9ce5,_0x30af4e){return db[_0x1262('0x1a')][_0x1262('0x1b')]({'raw':_0xac9547['options']?_0xac9547['options'][_0x1262('0x1c')]===undefined?!![]:![]:!![],'where':_0xac9547['options']?_0xac9547['options']['where']||null:null,'attributes':_0xac9547[_0x1262('0x1d')]?_0xac9547[_0x1262('0x1d')][_0x1262('0x1e')]||null:null,'include':_0xac9547[_0x1262('0x1d')]?_0xac9547[_0x1262('0x1d')][_0x1262('0x1f')]?_[_0x1262('0x20')](_0xac9547[_0x1262('0x1d')][_0x1262('0x1f')],function(_0x328dd4){return{'model':db[_0x328dd4[_0x1262('0x21')]],'as':_0x328dd4['as'],'attributes':_0x328dd4[_0x1262('0x1e')],'include':_0x328dd4[_0x1262('0x1f')]?_[_0x1262('0x20')](_0x328dd4[_0x1262('0x1f')],function(_0x24a381){return{'model':db[_0x24a381[_0x1262('0x21')]],'as':_0x24a381['as'],'attributes':_0x24a381[_0x1262('0x1e')],'include':_0x24a381[_0x1262('0x1f')]?_[_0x1262('0x20')](_0x24a381[_0x1262('0x1f')],function(_0x4c32ba){return{'model':db[_0x4c32ba['model']],'as':_0x4c32ba['as'],'attributes':_0x4c32ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x1262('0x22')](function(_0x296099){logger[_0x1262('0xe')]('ShowSmsAccount',_0xac9547);logger[_0x1262('0x11')](_0x1262('0x19'),_0xac9547,JSON[_0x1262('0x13')](_0x296099));_0x4d9ce5(_0x296099);})[_0x1262('0x18')](function(_0x1e433f){logger[_0x1262('0x14')](_0x1262('0x19'),_0x1e433f['message'],_0xac9547);_0x30af4e(_0x3573f4['error'](0x1f4,_0x1e433f[_0x1262('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d54a9d4..cbcc55a 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 0042c8a..33c47ce 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f9edb,_0x120d6d){var _0x4074d9=function(_0xbf109){while(--_0xbf109){_0x1f9edb['push'](_0x1f9edb['shift']());}};_0x4074d9(++_0x120d6d);}(_0x34e8,0x12c));var _0x834e=function(_0x5cbfc4,_0x53f02f){_0x5cbfc4=_0x5cbfc4-0x0;var _0x4157d8=_0x34e8[_0x5cbfc4];return _0x4157d8;};'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('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x5e6a45,_0x1ef926){var _0x9ab3de=function(_0x528e50){while(--_0x528e50){_0x5e6a45['push'](_0x5e6a45['shift']());}};_0x9ab3de(++_0x1ef926);}(_0x008c,0x188));var _0xc008=function(_0x1146f7,_0x475356){_0x1146f7=_0x1146f7-0x0;var _0x2e5725=_0x008c[_0x1146f7];return _0x2e5725;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 430f20c..eb75a9a 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 _0xcef5=['TEXT','*,*,*,*','sequelize','STRING'];(function(_0x5d829d,_0x14680a){var _0x25a70f=function(_0x51e77c){while(--_0x51e77c){_0x5d829d['push'](_0x5d829d['shift']());}};_0x25a70f(++_0x14680a);}(_0xcef5,0x1c6));var _0x5cef=function(_0x4f61b9,_0x839784){_0x4f61b9=_0x4f61b9-0x0;var _0x3b37a1=_0xcef5[_0x4f61b9];return _0x3b37a1;};'use strict';var Sequelize=require(_0x5cef('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5cef('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5cef('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5cef('0x3')}}; \ No newline at end of file +var _0x1d31=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1d31,0x94));var _0x11d3=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x1d31[_0x1c34e7];return _0x378cb1;};'use strict';var Sequelize=require(_0x11d3('0x0'));module[_0x11d3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x11d3('0x2')],'allowNull':![],'defaultValue':_0x11d3('0x3')},'appdata':{'type':Sequelize[_0x11d3('0x4')]()},'description':{'type':Sequelize[_0x11d3('0x2')]},'interval':{'type':Sequelize[_0x11d3('0x2')],'defaultValue':_0x11d3('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a6c0218..4d6fa8b 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 _0x1d29=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','end','error','stack','name','map','SmsApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x2a3dc2,_0x5af766){var _0x44515c=function(_0x11db29){while(--_0x11db29){_0x2a3dc2['push'](_0x2a3dc2['shift']());}};_0x44515c(++_0x5af766);}(_0x1d29,0x16e));var _0x91d2=function(_0x9cda45,_0xb96ab0){_0x9cda45=_0x9cda45-0x0;var _0x45a8e5=_0x1d29[_0x9cda45];return _0x45a8e5;};'use strict';var emlformat=require(_0x91d2('0x0'));var rimraf=require(_0x91d2('0x1'));var zipdir=require(_0x91d2('0x2'));var jsonpatch=require(_0x91d2('0x3'));var rp=require(_0x91d2('0x4'));var moment=require(_0x91d2('0x5'));var BPromise=require(_0x91d2('0x6'));var Mustache=require(_0x91d2('0x7'));var util=require(_0x91d2('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x91d2('0x9'));var ejs=require(_0x91d2('0xa'));var fs=require('fs');var fs_extra=require(_0x91d2('0xb'));var _=require(_0x91d2('0xc'));var squel=require(_0x91d2('0xd'));var crypto=require(_0x91d2('0xe'));var jsforce=require(_0x91d2('0xf'));var deskjs=require(_0x91d2('0x10'));var toCsv=require(_0x91d2('0x9'));var querystring=require(_0x91d2('0x11'));var Papa=require('papaparse');var Redis=require(_0x91d2('0x12'));var authService=require(_0x91d2('0x13'));var qs=require(_0x91d2('0x14'));var as=require(_0x91d2('0x15'));var hardwareService=require(_0x91d2('0x16'));var logger=require(_0x91d2('0x17'))(_0x91d2('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x91d2('0x19'))['db'];function respondWithStatusCode(_0x48f5d5,_0x4b489d){_0x4b489d=_0x4b489d||0xcc;return function(_0x2c07fd){if(_0x2c07fd){return _0x48f5d5[_0x91d2('0x1a')](_0x4b489d);}return _0x48f5d5[_0x91d2('0x1b')](_0x4b489d)['end']();};}function respondWithResult(_0x3cb0b8,_0x51bf0f){_0x51bf0f=_0x51bf0f||0xc8;return function(_0x413e11){if(_0x413e11){return _0x3cb0b8[_0x91d2('0x1b')](_0x51bf0f)['json'](_0x413e11);}};}function respondWithFilteredResult(_0x3c568b,_0x8370cc){return function(_0x4adef8){if(_0x4adef8){var _0x1db1ca=typeof _0x8370cc['offset']===_0x91d2('0x1c')&&typeof _0x8370cc[_0x91d2('0x1d')]===_0x91d2('0x1c');var _0x1357ca=_0x4adef8[_0x91d2('0x1e')];var _0x3df36f=_0x1db1ca?0x0:_0x8370cc[_0x91d2('0x1f')];var _0x5326dc=_0x1db1ca?_0x4adef8['count']:_0x8370cc[_0x91d2('0x1f')]+_0x8370cc[_0x91d2('0x1d')];var _0x505ce8;if(_0x5326dc>=_0x1357ca){_0x5326dc=_0x1357ca;_0x505ce8=0xc8;}else{_0x505ce8=0xce;}_0x3c568b[_0x91d2('0x1b')](_0x505ce8);return _0x3c568b[_0x91d2('0x20')](_0x91d2('0x21'),_0x3df36f+'-'+_0x5326dc+'/'+_0x1357ca)[_0x91d2('0x22')](_0x4adef8);}return null;};}function patchUpdates(_0x3d1b46){return function(_0xb14056){try{jsonpatch['apply'](_0xb14056,_0x3d1b46,!![]);}catch(_0x90b2a){return BPromise[_0x91d2('0x23')](_0x90b2a);}return _0xb14056[_0x91d2('0x24')]();};}function saveUpdates(_0x419fdc,_0x5df362){return function(_0x531ede){if(_0x531ede){return _0x531ede[_0x91d2('0x25')](_0x419fdc)['then'](function(_0x4b2b07){return _0x4b2b07;});}return null;};}function removeEntity(_0xda831e,_0x5c4408){return function(_0x4f8936){if(_0x4f8936){return _0x4f8936['destroy']()[_0x91d2('0x26')](function(){_0xda831e[_0x91d2('0x1b')](0xcc)[_0x91d2('0x27')]();});}};}function handleEntityNotFound(_0x73645f,_0x43bda1){return function(_0x51badc){if(!_0x51badc){_0x73645f['sendStatus'](0x194);}return _0x51badc;};}function handleError(_0x19120f,_0x4dc61e){_0x4dc61e=_0x4dc61e||0x1f4;return function(_0x3bb9c4){logger[_0x91d2('0x28')](_0x3bb9c4[_0x91d2('0x29')]);if(_0x3bb9c4['name']){delete _0x3bb9c4[_0x91d2('0x2a')];}_0x19120f[_0x91d2('0x1b')](_0x4dc61e)['send'](_0x3bb9c4);};}exports['index']=function(_0x4aaacf,_0x490670){var _0x5f03a1={},_0x3834ac={},_0x230a4a={'count':0x0,'rows':[]};var _0xb84f91=_[_0x91d2('0x2b')](db[_0x91d2('0x2c')][_0x91d2('0x2d')],function(_0x5582e8){return{'name':_0x5582e8[_0x91d2('0x2e')],'type':_0x5582e8['type'][_0x91d2('0x2f')]};});_0x3834ac['model']=_['map'](_0xb84f91,_0x91d2('0x2a'));_0x3834ac[_0x91d2('0x30')]=_[_0x91d2('0x31')](_0x4aaacf[_0x91d2('0x30')]);_0x3834ac[_0x91d2('0x32')]=_[_0x91d2('0x33')](_0x3834ac[_0x91d2('0x34')],_0x3834ac[_0x91d2('0x30')]);_0x5f03a1[_0x91d2('0x35')]=_[_0x91d2('0x33')](_0x3834ac['model'],qs[_0x91d2('0x36')](_0x4aaacf[_0x91d2('0x30')]['fields']));_0x5f03a1['attributes']=_0x5f03a1['attributes']['length']?_0x5f03a1['attributes']:_0x3834ac[_0x91d2('0x34')];if(!_0x4aaacf[_0x91d2('0x30')][_0x91d2('0x37')](_0x91d2('0x38'))){_0x5f03a1[_0x91d2('0x1d')]=qs['limit'](_0x4aaacf[_0x91d2('0x30')][_0x91d2('0x1d')]);_0x5f03a1[_0x91d2('0x1f')]=qs[_0x91d2('0x1f')](_0x4aaacf['query'][_0x91d2('0x1f')]);}_0x5f03a1[_0x91d2('0x39')]=qs[_0x91d2('0x3a')](_0x4aaacf[_0x91d2('0x30')]['sort']);_0x5f03a1[_0x91d2('0x3b')]=qs['filters'](_[_0x91d2('0x3c')](_0x4aaacf[_0x91d2('0x30')],_0x3834ac['filters']),_0xb84f91);if(_0x4aaacf['query'][_0x91d2('0x3d')]){_0x5f03a1[_0x91d2('0x3b')]=_[_0x91d2('0x3e')](_0x5f03a1['where'],{'$or':_[_0x91d2('0x2b')](_0xb84f91,function(_0x34a1ab){if(_0x34a1ab[_0x91d2('0x3f')]!==_0x91d2('0x40')){var _0x19fa20={};_0x19fa20[_0x34a1ab[_0x91d2('0x2a')]]={'$like':'%'+_0x4aaacf[_0x91d2('0x30')][_0x91d2('0x3d')]+'%'};return _0x19fa20;}})});}_0x5f03a1=_[_0x91d2('0x3e')]({},_0x5f03a1,_0x4aaacf[_0x91d2('0x41')]);var _0x5f2b00={'where':_0x5f03a1['where']};return db[_0x91d2('0x2c')][_0x91d2('0x1e')](_0x5f2b00)[_0x91d2('0x26')](function(_0x5401da){_0x230a4a[_0x91d2('0x1e')]=_0x5401da;if(_0x4aaacf[_0x91d2('0x30')]['includeAll']){_0x5f03a1[_0x91d2('0x42')]=[{'all':!![]}];}return db[_0x91d2('0x2c')][_0x91d2('0x43')](_0x5f03a1);})[_0x91d2('0x26')](function(_0x34c5f5){_0x230a4a[_0x91d2('0x44')]=_0x34c5f5;return _0x230a4a;})[_0x91d2('0x26')](respondWithFilteredResult(_0x490670,_0x5f03a1))[_0x91d2('0x45')](handleError(_0x490670,null));};exports[_0x91d2('0x46')]=function(_0x15a592,_0x1a7983){var _0xa12022={'raw':!![],'where':{'id':_0x15a592[_0x91d2('0x47')]['id']}},_0x29d500={};_0x29d500[_0x91d2('0x34')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x29d500['query']=_[_0x91d2('0x31')](_0x15a592[_0x91d2('0x30')]);_0x29d500[_0x91d2('0x32')]=_[_0x91d2('0x33')](_0x29d500[_0x91d2('0x34')],_0x29d500['query']);_0xa12022['attributes']=_['intersection'](_0x29d500[_0x91d2('0x34')],qs[_0x91d2('0x36')](_0x15a592[_0x91d2('0x30')][_0x91d2('0x36')]));_0xa12022[_0x91d2('0x35')]=_0xa12022[_0x91d2('0x35')][_0x91d2('0x48')]?_0xa12022[_0x91d2('0x35')]:_0x29d500[_0x91d2('0x34')];if(_0x15a592[_0x91d2('0x30')][_0x91d2('0x49')]){_0xa12022['include']=[{'all':!![]}];}_0xa12022=_[_0x91d2('0x3e')]({},_0xa12022,_0x15a592['options']);return db['SmsApplication'][_0x91d2('0x4a')](_0xa12022)[_0x91d2('0x26')](handleEntityNotFound(_0x1a7983,null))[_0x91d2('0x26')](respondWithResult(_0x1a7983,null))['catch'](handleError(_0x1a7983,null));};exports['create']=function(_0x841624,_0x24485f){return db[_0x91d2('0x2c')]['create'](_0x841624[_0x91d2('0x4b')],{})[_0x91d2('0x26')](respondWithResult(_0x24485f,0xc9))[_0x91d2('0x45')](handleError(_0x24485f,null));};exports['update']=function(_0x3cd6c5,_0xc39fb9){if(_0x3cd6c5[_0x91d2('0x4b')]['id']){delete _0x3cd6c5[_0x91d2('0x4b')]['id'];}return db[_0x91d2('0x2c')][_0x91d2('0x4a')]({'where':{'id':_0x3cd6c5[_0x91d2('0x47')]['id']}})[_0x91d2('0x26')](handleEntityNotFound(_0xc39fb9,null))[_0x91d2('0x26')](saveUpdates(_0x3cd6c5['body'],null))['then'](respondWithResult(_0xc39fb9,null))[_0x91d2('0x45')](handleError(_0xc39fb9,null));};exports[_0x91d2('0x4c')]=function(_0x3a3a2,_0x21d26d){return db[_0x91d2('0x2c')][_0x91d2('0x4a')]({'where':{'id':_0x3a3a2['params']['id']}})[_0x91d2('0x26')](handleEntityNotFound(_0x21d26d,null))[_0x91d2('0x26')](removeEntity(_0x21d26d,null))[_0x91d2('0x45')](handleError(_0x21d26d,null));}; \ No newline at end of file +var _0x5892=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','sendStatus','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','SmsApplication','includeAll','include','rows','show','params','find','catch','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5892,0x7c));var _0x2589=function(_0x10a1d1,_0x295159){_0x10a1d1=_0x10a1d1-0x0;var _0x10b75f=_0x5892[_0x10a1d1];return _0x10b75f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2589('0x0'));var zipdir=require(_0x2589('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2589('0x2'));var moment=require(_0x2589('0x3'));var BPromise=require(_0x2589('0x4'));var Mustache=require(_0x2589('0x5'));var util=require('util');var path=require(_0x2589('0x6'));var sox=require('sox');var csv=require(_0x2589('0x7'));var ejs=require(_0x2589('0x8'));var fs=require('fs');var fs_extra=require(_0x2589('0x9'));var _=require(_0x2589('0xa'));var squel=require('squel');var crypto=require(_0x2589('0xb'));var jsforce=require(_0x2589('0xc'));var deskjs=require(_0x2589('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2589('0xe'));var Redis=require(_0x2589('0xf'));var authService=require(_0x2589('0x10'));var qs=require(_0x2589('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2589('0x12'));var logger=require(_0x2589('0x13'))(_0x2589('0x14'));var utils=require(_0x2589('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2589('0x16'))['db'];function respondWithStatusCode(_0x4d1d61,_0xf9c4ca){_0xf9c4ca=_0xf9c4ca||0xcc;return function(_0x5416b1){if(_0x5416b1){return _0x4d1d61['sendStatus'](_0xf9c4ca);}return _0x4d1d61[_0x2589('0x17')](_0xf9c4ca)[_0x2589('0x18')]();};}function respondWithResult(_0x2d156a,_0x406aed){_0x406aed=_0x406aed||0xc8;return function(_0x1053d5){if(_0x1053d5){return _0x2d156a['status'](_0x406aed)[_0x2589('0x19')](_0x1053d5);}};}function respondWithFilteredResult(_0x1fdea6,_0x27eb26){return function(_0x5a5bc6){if(_0x5a5bc6){var _0x1cc1e7=typeof _0x27eb26[_0x2589('0x1a')]===_0x2589('0x1b')&&typeof _0x27eb26[_0x2589('0x1c')]===_0x2589('0x1b');var _0x3c2d37=_0x5a5bc6[_0x2589('0x1d')];var _0x1211f6=_0x1cc1e7?0x0:_0x27eb26[_0x2589('0x1a')];var _0x508a3f=_0x1cc1e7?_0x5a5bc6['count']:_0x27eb26[_0x2589('0x1a')]+_0x27eb26[_0x2589('0x1c')];var _0x1f6b8a;if(_0x508a3f>=_0x3c2d37){_0x508a3f=_0x3c2d37;_0x1f6b8a=0xc8;}else{_0x1f6b8a=0xce;}_0x1fdea6[_0x2589('0x17')](_0x1f6b8a);return _0x1fdea6[_0x2589('0x1e')](_0x2589('0x1f'),_0x1211f6+'-'+_0x508a3f+'/'+_0x3c2d37)[_0x2589('0x19')](_0x5a5bc6);}return null;};}function patchUpdates(_0x595f8c){return function(_0x2634aa){try{jsonpatch['apply'](_0x2634aa,_0x595f8c,!![]);}catch(_0x4e4c99){return BPromise['reject'](_0x4e4c99);}return _0x2634aa[_0x2589('0x20')]();};}function saveUpdates(_0x3f8ec1,_0x1eae53){return function(_0x40fa39){if(_0x40fa39){return _0x40fa39['update'](_0x3f8ec1)['then'](function(_0x541b82){return _0x541b82;});}return null;};}function removeEntity(_0xce93dc,_0x212bb0){return function(_0x5568c2){if(_0x5568c2){return _0x5568c2[_0x2589('0x21')]()[_0x2589('0x22')](function(){_0xce93dc[_0x2589('0x17')](0xcc)[_0x2589('0x18')]();});}};}function handleEntityNotFound(_0xbea667,_0xd5e669){return function(_0x4785cb){if(!_0x4785cb){_0xbea667[_0x2589('0x23')](0x194);}return _0x4785cb;};}function handleError(_0x4a3e14,_0x41506a){_0x41506a=_0x41506a||0x1f4;return function(_0x1bd8d6){logger['error'](_0x1bd8d6['stack']);if(_0x1bd8d6[_0x2589('0x24')]){delete _0x1bd8d6[_0x2589('0x24')];}_0x4a3e14[_0x2589('0x17')](_0x41506a)[_0x2589('0x25')](_0x1bd8d6);};}exports[_0x2589('0x26')]=function(_0x176486,_0x14d67b){var _0x4b57de={},_0x9fd714={},_0x7c4b09={'count':0x0,'rows':[]};var _0x5bc981=_[_0x2589('0x27')](db['SmsApplication'][_0x2589('0x28')],function(_0x170fab){return{'name':_0x170fab[_0x2589('0x29')],'type':_0x170fab['type'][_0x2589('0x2a')]};});_0x9fd714['model']=_[_0x2589('0x27')](_0x5bc981,'name');_0x9fd714[_0x2589('0x2b')]=_[_0x2589('0x2c')](_0x176486[_0x2589('0x2b')]);_0x9fd714['filters']=_['intersection'](_0x9fd714[_0x2589('0x2d')],_0x9fd714[_0x2589('0x2b')]);_0x4b57de[_0x2589('0x2e')]=_[_0x2589('0x2f')](_0x9fd714[_0x2589('0x2d')],qs[_0x2589('0x30')](_0x176486[_0x2589('0x2b')][_0x2589('0x30')]));_0x4b57de['attributes']=_0x4b57de['attributes'][_0x2589('0x31')]?_0x4b57de[_0x2589('0x2e')]:_0x9fd714[_0x2589('0x2d')];if(!_0x176486[_0x2589('0x2b')][_0x2589('0x32')](_0x2589('0x33'))){_0x4b57de['limit']=qs[_0x2589('0x1c')](_0x176486[_0x2589('0x2b')][_0x2589('0x1c')]);_0x4b57de[_0x2589('0x1a')]=qs[_0x2589('0x1a')](_0x176486[_0x2589('0x2b')][_0x2589('0x1a')]);}_0x4b57de['order']=qs[_0x2589('0x34')](_0x176486[_0x2589('0x2b')][_0x2589('0x34')]);_0x4b57de[_0x2589('0x35')]=qs[_0x2589('0x36')](_[_0x2589('0x37')](_0x176486[_0x2589('0x2b')],_0x9fd714[_0x2589('0x36')]),_0x5bc981);if(_0x176486[_0x2589('0x2b')][_0x2589('0x38')]){_0x4b57de[_0x2589('0x35')]=_[_0x2589('0x39')](_0x4b57de['where'],{'$or':_[_0x2589('0x27')](_0x5bc981,function(_0xa0836a){if(_0xa0836a[_0x2589('0x3a')]!==_0x2589('0x3b')){var _0x5922af={};_0x5922af[_0xa0836a['name']]={'$like':'%'+_0x176486[_0x2589('0x2b')][_0x2589('0x38')]+'%'};return _0x5922af;}})});}_0x4b57de=_[_0x2589('0x39')]({},_0x4b57de,_0x176486['options']);var _0x1017ca={'where':_0x4b57de[_0x2589('0x35')]};return db[_0x2589('0x3c')][_0x2589('0x1d')](_0x1017ca)[_0x2589('0x22')](function(_0x3269e0){_0x7c4b09['count']=_0x3269e0;if(_0x176486[_0x2589('0x2b')][_0x2589('0x3d')]){_0x4b57de[_0x2589('0x3e')]=[{'all':!![]}];}return db[_0x2589('0x3c')]['findAll'](_0x4b57de);})[_0x2589('0x22')](function(_0x4be4b9){_0x7c4b09[_0x2589('0x3f')]=_0x4be4b9;return _0x7c4b09;})[_0x2589('0x22')](respondWithFilteredResult(_0x14d67b,_0x4b57de))['catch'](handleError(_0x14d67b,null));};exports[_0x2589('0x40')]=function(_0x214212,_0x2bb1d6){var _0x2a916b={'raw':!![],'where':{'id':_0x214212[_0x2589('0x41')]['id']}},_0x3f9b39={};_0x3f9b39['model']=_[_0x2589('0x2c')](db['SmsApplication'][_0x2589('0x28')]);_0x3f9b39[_0x2589('0x2b')]=_['keys'](_0x214212[_0x2589('0x2b')]);_0x3f9b39['filters']=_[_0x2589('0x2f')](_0x3f9b39[_0x2589('0x2d')],_0x3f9b39[_0x2589('0x2b')]);_0x2a916b[_0x2589('0x2e')]=_['intersection'](_0x3f9b39[_0x2589('0x2d')],qs[_0x2589('0x30')](_0x214212[_0x2589('0x2b')][_0x2589('0x30')]));_0x2a916b[_0x2589('0x2e')]=_0x2a916b[_0x2589('0x2e')][_0x2589('0x31')]?_0x2a916b[_0x2589('0x2e')]:_0x3f9b39[_0x2589('0x2d')];if(_0x214212[_0x2589('0x2b')][_0x2589('0x3d')]){_0x2a916b[_0x2589('0x3e')]=[{'all':!![]}];}_0x2a916b=_[_0x2589('0x39')]({},_0x2a916b,_0x214212['options']);return db[_0x2589('0x3c')][_0x2589('0x42')](_0x2a916b)['then'](handleEntityNotFound(_0x2bb1d6,null))[_0x2589('0x22')](respondWithResult(_0x2bb1d6,null))[_0x2589('0x43')](handleError(_0x2bb1d6,null));};exports[_0x2589('0x44')]=function(_0x350c6d,_0xca5902){return db['SmsApplication'][_0x2589('0x44')](_0x350c6d[_0x2589('0x45')],{})[_0x2589('0x22')](respondWithResult(_0xca5902,0xc9))[_0x2589('0x43')](handleError(_0xca5902,null));};exports['update']=function(_0x2667f6,_0x2a1416){if(_0x2667f6[_0x2589('0x45')]['id']){delete _0x2667f6[_0x2589('0x45')]['id'];}return db[_0x2589('0x3c')][_0x2589('0x42')]({'where':{'id':_0x2667f6[_0x2589('0x41')]['id']}})[_0x2589('0x22')](handleEntityNotFound(_0x2a1416,null))['then'](saveUpdates(_0x2667f6[_0x2589('0x45')],null))['then'](respondWithResult(_0x2a1416,null))[_0x2589('0x43')](handleError(_0x2a1416,null));};exports[_0x2589('0x21')]=function(_0x3fa3db,_0x4961a9){return db[_0x2589('0x3c')][_0x2589('0x42')]({'where':{'id':_0x3fa3db[_0x2589('0x41')]['id']}})[_0x2589('0x22')](handleEntityNotFound(_0x4961a9,null))['then'](removeEntity(_0x4961a9,null))[_0x2589('0x43')](handleError(_0x4961a9,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 162ccca..b2232d2 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 _0x3a57=['exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsApplication.attributes'];(function(_0x38c773,_0x199a45){var _0x196e46=function(_0x51e23e){while(--_0x51e23e){_0x38c773['push'](_0x38c773['shift']());}};_0x196e46(++_0x199a45);}(_0x3a57,0xaf));var _0x73a5=function(_0x3508b6,_0xb0cff3){_0x3508b6=_0x3508b6-0x0;var _0x2bc9de=_0x3a57[_0x3508b6];return _0x2bc9de;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73a5('0x0'))(_0x73a5('0x1'));var moment=require(_0x73a5('0x2'));var BPromise=require(_0x73a5('0x3'));var rp=require(_0x73a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73a5('0x5'));var config=require('../../config/environment');var attributes=require(_0x73a5('0x6'));module[_0x73a5('0x7')]=function(_0x5c7981,_0x28f3b7){return _0x5c7981[_0x73a5('0x8')](_0x73a5('0x9'),attributes,{'tableName':_0x73a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x73a5('0xb'),'collate':_0x73a5('0xc')});}; \ No newline at end of file +var _0xe362=['bluebird','request-promise','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xe362,0x194));var _0x2e36=function(_0x1af8a0,_0x2a705d){_0x1af8a0=_0x1af8a0-0x0;var _0x2d5046=_0xe362[_0x1af8a0];return _0x2d5046;};'use strict';var _=require(_0x2e36('0x0'));var util=require('util');var logger=require(_0x2e36('0x1'))(_0x2e36('0x2'));var moment=require('moment');var BPromise=require(_0x2e36('0x3'));var rp=require(_0x2e36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e36('0x5'));module[_0x2e36('0x6')]=function(_0xd73be1,_0x23db8b){return _0xd73be1[_0x2e36('0x7')](_0x2e36('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e36('0x9'),'collate':_0x2e36('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 325b2c1..7a692a2 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 _0x3e94=['rpc','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x15a306,_0xb3968c){var _0x5d4f1b=function(_0x369035){while(--_0x369035){_0x15a306['push'](_0x15a306['shift']());}};_0x5d4f1b(++_0xb3968c);}(_0x3e94,0x67));var _0x43e9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x3e94[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require('moment');var BPromise=require(_0x43e9('0x2'));var rs=require(_0x43e9('0x3'));var fs=require('fs');var Redis=require(_0x43e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e9('0x5'));var logger=require(_0x43e9('0x6'))(_0x43e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x43e9('0x8'));var client=jayson['client'][_0x43e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b35f1,_0x1183a0,_0x2989fe){return new BPromise(function(_0x287aaf,_0x510ee7){return client[_0x43e9('0xa')](_0x4b35f1,_0x2989fe)[_0x43e9('0xb')](function(_0x43d6e8){logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));logger[_0x43e9('0xf')](_0x43e9('0x10'),_0x1183a0,_0x43e9('0xe'),JSON['stringify'](_0x43d6e8));if(_0x43d6e8[_0x43e9('0x11')]){if(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x12')]===0x1f4){logger['error'](_0x43e9('0xd'),_0x1183a0,_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);return _0x510ee7(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x1183a0,_0x43d6e8[_0x43e9('0x11')]['message']);return _0x287aaf(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}else{logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));_0x287aaf(_0x43d6e8[_0x43e9('0x14')][_0x43e9('0x13')]);}})[_0x43e9('0x15')](function(_0x3f7164){logger[_0x43e9('0x11')](_0x43e9('0xd'),_0x1183a0,_0x3f7164);_0x510ee7(_0x3f7164);});});} \ No newline at end of file +var _0xd786=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5ebcfc,_0x2c1394){var _0x17c562=function(_0x134110){while(--_0x134110){_0x5ebcfc['push'](_0x5ebcfc['shift']());}};_0x17c562(++_0x2c1394);}(_0xd786,0x1dc));var _0x6d78=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xd786[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d78('0x4'));var db=require(_0x6d78('0x5'))['db'];var utils=require(_0x6d78('0x6'));var logger=require(_0x6d78('0x7'))(_0x6d78('0x8'));var config=require(_0x6d78('0x9'));var jayson=require(_0x6d78('0xa'));var client=jayson['client'][_0x6d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e9e5,_0x5c3f38,_0x44db98){return new BPromise(function(_0x33b85e,_0x10f58a){return client[_0x6d78('0xc')](_0x30e9e5,_0x44db98)['then'](function(_0x3198b6){logger[_0x6d78('0xd')](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');logger[_0x6d78('0xf')](_0x6d78('0x10'),_0x5c3f38,_0x6d78('0x11'),JSON[_0x6d78('0x12')](_0x3198b6));if(_0x3198b6[_0x6d78('0x13')]){if(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x14')]===0x1f4){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x10f58a(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x15')]);}logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x33b85e(_0x3198b6['error'][_0x6d78('0x15')]);}else{logger['info'](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');_0x33b85e(_0x3198b6[_0x6d78('0x16')]['message']);}})[_0x6d78('0x17')](function(_0x378c59){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x378c59);_0x10f58a(_0x378c59);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 65316f8..906e533 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 _0x14a0=['/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','/describe','describe','getMessages'];(function(_0x2444f6,_0x39d0a4){var _0x339075=function(_0x537bb2){while(--_0x537bb2){_0x2444f6['push'](_0x2444f6['shift']());}};_0x339075(++_0x39d0a4);}(_0x14a0,0x8e));var _0x014a=function(_0x29d172,_0x130406){_0x29d172=_0x29d172-0x0;var _0xf0fbea=_0x14a0[_0x29d172];return _0xf0fbea;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['download']);router[_0x014a('0xe')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0xe')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0xe')](_0x014a('0x12'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),'smsinteraction:addtags'),controller[_0x014a('0x15')]);router[_0x014a('0x16')]('/:id',auth[_0x014a('0x9')](),interaction[_0x014a('0x13')]('sms',_0x014a('0x17')),controller[_0x014a('0x18')]);router[_0x014a('0x19')](_0x014a('0x1a'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),_0x014a('0x1b')),controller[_0x014a('0x1c')]);router[_0x014a('0x19')](_0x014a('0x12'),auth[_0x014a('0x9')](),controller[_0x014a('0x1d')]);module[_0x014a('0x1e')]=router; \ No newline at end of file +var _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0xd584f6,_0x34cfe6){var _0x5ec250=function(_0x331e17){while(--_0x331e17){_0xd584f6['push'](_0xd584f6['shift']());}};_0x5ec250(++_0x34cfe6);}(_0x7708,0x188));var _0x8770=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x7708[_0x545a3a];return _0x5a5493;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 40278e4..d9fe9fd 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 _0x215d=['exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize'];(function(_0x3a35ec,_0x42babf){var _0x44842d=function(_0x1bf3ec){while(--_0x1bf3ec){_0x3a35ec['push'](_0x3a35ec['shift']());}};_0x44842d(++_0x42babf);}(_0x215d,0x187));var _0xd215=function(_0x6fec6f,_0x82e152){_0x6fec6f=_0x6fec6f-0x0;var _0x5e0ce5=_0x215d[_0x6fec6f];return _0x5e0ce5;};'use strict';var Sequelize=require(_0xd215('0x0'));var moment=require('moment');module[_0xd215('0x1')]={'closed':{'type':Sequelize[_0xd215('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd215('0x3')]},'disposition':{'type':Sequelize[_0xd215('0x4')]},'secondDisposition':{'type':Sequelize[_0xd215('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd215('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd215('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xd215('0x5')]('in',_0xd215('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd215('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd215('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd215('0x7')]}}; \ No newline at end of file +var _0x8710=['sequelize','moment','BOOLEAN','DATE','STRING','out','ENUM','INTEGER'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8710,0x68));var _0x0871=function(_0x500458,_0x562944){_0x500458=_0x500458-0x0;var _0x3c4e96=_0x8710[_0x500458];return _0x3c4e96;};'use strict';var Sequelize=require(_0x0871('0x0'));var moment=require(_0x0871('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0871('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0871('0x3')]},'disposition':{'type':Sequelize[_0x0871('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0871('0x4')]},'note':{'type':Sequelize[_0x0871('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0871('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0871('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0871('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0871('0x6')]('in',_0x0871('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0871('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0871('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 8711af2..b2815bc 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 _0xd112=['moment','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','undefined','limit','offset','Content-Range','json','update','then','destroy','error','name','send','index','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','omit','findOne','SmsMessage','hasOwnProperty','nolimit','sort','where','SmsInteractionId','filter','map','$gte','split','count','rows','addTags','setTags','ids','spread','Tag','color','removeTags','download','unix','toString','join','root','files','tmp','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','Account','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','rimraf'];(function(_0x25bf68,_0x175021){var _0x503c5f=function(_0x34dca0){while(--_0x34dca0){_0x25bf68['push'](_0x25bf68['shift']());}};_0x503c5f(++_0x175021);}(_0xd112,0x76));var _0x2d11=function(_0x4572c7,_0x49785c){_0x4572c7=_0x4572c7-0x0;var _0x573aa1=_0xd112[_0x4572c7];return _0x573aa1;};'use strict';var rimraf=require(_0x2d11('0x0'));var zipdir=require('zip-dir');var moment=require(_0x2d11('0x1'));var BPromise=require('bluebird');var util=require(_0x2d11('0x2'));var path=require(_0x2d11('0x3'));var ejs=require(_0x2d11('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x2d11('0x5'));var qs=require(_0x2d11('0x6'));var pdf=require(_0x2d11('0x7'));var logger=require(_0x2d11('0x8'))(_0x2d11('0x9'));var config=require(_0x2d11('0xa'));var db=require(_0x2d11('0xb'))['db'];config['redis']=_[_0x2d11('0xc')](config[_0x2d11('0xd')],{'host':_0x2d11('0xe'),'port':0x18eb});var socket=require(_0x2d11('0xf'))(new Redis(config['redis']));require(_0x2d11('0x10'))[_0x2d11('0x11')](socket);function respondWithStatusCode(_0x420dd5,_0xbc2b0b){_0xbc2b0b=_0xbc2b0b||0xcc;return function(_0x180596){if(_0x180596){return _0x420dd5[_0x2d11('0x12')](_0xbc2b0b);}return _0x420dd5[_0x2d11('0x13')](_0xbc2b0b)[_0x2d11('0x14')]();};}function respondWithResult(_0x3dedd6,_0x103888){_0x103888=_0x103888||0xc8;return function(_0x94a2e5){if(_0x94a2e5){return _0x3dedd6[_0x2d11('0x13')](_0x103888)['json'](_0x94a2e5);}};}function respondWithFilteredResult(_0x4da8f6,_0x17d1b4){return function(_0x370a5c){if(_0x370a5c){var _0x6f422b=typeof _0x17d1b4['offset']===_0x2d11('0x15')&&typeof _0x17d1b4[_0x2d11('0x16')]==='undefined';var _0x539d91=_0x370a5c['count'];var _0x100259=_0x6f422b?0x0:_0x17d1b4[_0x2d11('0x17')];var _0x2feef3=_0x6f422b?_0x370a5c['count']:_0x17d1b4[_0x2d11('0x17')]+_0x17d1b4['limit'];var _0x31fb46;if(_0x2feef3>=_0x539d91){_0x2feef3=_0x539d91;_0x31fb46=0xc8;}else{_0x31fb46=0xce;}_0x4da8f6[_0x2d11('0x13')](_0x31fb46);return _0x4da8f6['set'](_0x2d11('0x18'),_0x100259+'-'+_0x2feef3+'/'+_0x539d91)[_0x2d11('0x19')](_0x370a5c);}return null;};}function saveUpdates(_0x4d7754){return function(_0x4270dd){if(_0x4270dd){return _0x4270dd[_0x2d11('0x1a')](_0x4d7754)[_0x2d11('0x1b')](function(_0xf822b6){return _0xf822b6;});}return null;};}function removeEntity(_0x292688){return function(_0x5eb60c){if(_0x5eb60c){return _0x5eb60c[_0x2d11('0x1c')]()[_0x2d11('0x1b')](function(){_0x292688[_0x2d11('0x13')](0xcc)[_0x2d11('0x14')]();});}};}function handleEntityNotFound(_0x4bfc75){return function(_0x3a2916){if(!_0x3a2916){_0x4bfc75[_0x2d11('0x12')](0x194);}return _0x3a2916;};}function handleError(_0x17c01c,_0x12ec1c){_0x12ec1c=_0x12ec1c||0x1f4;return function(_0x3a3ac2){logger[_0x2d11('0x1d')](_0x3a3ac2['stack']);if(_0x3a3ac2['name']){delete _0x3a3ac2[_0x2d11('0x1e')];}_0x17c01c['status'](_0x12ec1c)[_0x2d11('0x1f')](_0x3a3ac2);};}exports[_0x2d11('0x20')]=function(_0x231b24,_0x29c180){var _0x2f367d={};var _0x3e6914=_['map'](db[_0x2d11('0x21')][_0x2d11('0x22')],function(_0x279556){return{'name':_0x279556[_0x2d11('0x23')],'type':_0x279556[_0x2d11('0x24')]['key']};});_0x2f367d=qs[_0x2d11('0x25')](_0x3e6914,_0x231b24);return interaction[_0x2d11('0x26')](_0x2d11('0x27'),_0x231b24[_0x2d11('0x28')],_0x231b24[_0x2d11('0x29')],_0x2f367d,_0x3e6914)[_0x2d11('0x1b')](respondWithFilteredResult(_0x29c180,_0x2f367d))[_0x2d11('0x2a')](handleError(_0x29c180,null));};exports[_0x2d11('0x2b')]=function(_0x30b20e,_0x48c630){var _0x13ab1b={'raw':![],'where':{'id':_0x30b20e[_0x2d11('0x2c')]['id']}},_0x235faa={};_0x235faa[_0x2d11('0x2d')]=_['keys'](db['SmsInteraction'][_0x2d11('0x22')]);_0x235faa[_0x2d11('0x28')]=_[_0x2d11('0x2e')](_0x30b20e['query']);_0x235faa[_0x2d11('0x2f')]=_[_0x2d11('0x30')](_0x235faa['model'],_0x235faa[_0x2d11('0x28')]);_0x13ab1b[_0x2d11('0x31')]=_[_0x2d11('0x30')](_0x235faa[_0x2d11('0x2d')],qs[_0x2d11('0x32')](_0x30b20e[_0x2d11('0x28')]['fields']));_0x13ab1b[_0x2d11('0x31')]=_0x13ab1b['attributes'][_0x2d11('0x33')]?_0x13ab1b[_0x2d11('0x31')]:_0x235faa['model'];if(_0x30b20e[_0x2d11('0x28')][_0x2d11('0x34')]){_0x13ab1b[_0x2d11('0x35')]=[{'all':!![]}];}_0x13ab1b=_[_0x2d11('0x36')]({},_0x13ab1b,_0x30b20e[_0x2d11('0x37')]);return db['SmsInteraction'][_0x2d11('0x38')](_0x13ab1b)[_0x2d11('0x1b')](handleEntityNotFound(_0x48c630,null))[_0x2d11('0x1b')](respondWithResult(_0x48c630,null))['catch'](handleError(_0x48c630,null));};exports[_0x2d11('0x39')]=function(_0x2aeee4,_0x166141){return db[_0x2d11('0x21')]['create'](_0x2aeee4[_0x2d11('0x3a')],{})[_0x2d11('0x1b')](respondWithResult(_0x166141,0xc9))['catch'](handleError(_0x166141,null));};exports['update']=function(_0x465a19,_0x567a35){if(_0x465a19[_0x2d11('0x3a')]['id']){delete _0x465a19['body']['id'];}return db['SmsInteraction'][_0x2d11('0x38')]({'where':{'id':_0x465a19['params']['id']}})[_0x2d11('0x1b')](handleEntityNotFound(_0x567a35,null))['then'](saveUpdates(_0x465a19[_0x2d11('0x3a')],null))['then'](respondWithResult(_0x567a35,null))[_0x2d11('0x2a')](handleError(_0x567a35,null));};exports['destroy']=function(_0x111a19,_0x420550){return db[_0x2d11('0x21')][_0x2d11('0x38')]({'where':{'id':_0x111a19[_0x2d11('0x2c')]['id']}})[_0x2d11('0x1b')](handleEntityNotFound(_0x420550,null))[_0x2d11('0x1b')](removeEntity(_0x420550,null))['catch'](handleError(_0x420550,null));};exports[_0x2d11('0x3b')]=function(_0x58c714,_0xd1ad50){return db[_0x2d11('0x21')]['describe']()[_0x2d11('0x1b')](respondWithResult(_0xd1ad50,null))['catch'](handleError(_0xd1ad50,null));};exports[_0x2d11('0x3c')]=function(_0x4257f2,_0x24b25d){return db['SmsMessage'][_0x2d11('0x38')]({'where':{'id':_0x4257f2[_0x2d11('0x2c')]['id']}})[_0x2d11('0x1b')](handleEntityNotFound(_0x24b25d,null))[_0x2d11('0x1b')](function(_0x275038){if(_0x275038){return _0x275038[_0x2d11('0x3c')](_0x4257f2[_0x2d11('0x3a')]['ids'],_[_0x2d11('0x3d')](_0x4257f2[_0x2d11('0x3a')],['ids','id'])||{});}})[_0x2d11('0x1b')](respondWithResult(_0x24b25d,null))[_0x2d11('0x2a')](handleError(_0x24b25d,null));};exports['getMessages']=function(_0x20a80a,_0x1c52dc){var _0x2426d0={'raw':![],'where':{}};var _0x33336d={};var _0x5c95a9={'count':0x0,'rows':[]};return db[_0x2d11('0x21')][_0x2d11('0x3e')]({'where':{'id':_0x20a80a['params']['id']}})['then'](handleEntityNotFound(_0x1c52dc,null))[_0x2d11('0x1b')](function(_0x106544){if(_0x106544){_0x33336d[_0x2d11('0x2d')]=_['keys'](db[_0x2d11('0x3f')][_0x2d11('0x22')]);_0x33336d[_0x2d11('0x28')]=_[_0x2d11('0x2e')](_0x20a80a[_0x2d11('0x28')]);_0x33336d[_0x2d11('0x2f')]=_[_0x2d11('0x30')](_0x33336d[_0x2d11('0x2d')],_0x33336d[_0x2d11('0x28')]);_0x2426d0[_0x2d11('0x31')]=_[_0x2d11('0x30')](_0x33336d[_0x2d11('0x2d')],qs[_0x2d11('0x32')](_0x20a80a['query'][_0x2d11('0x32')]));_0x2426d0[_0x2d11('0x31')]=_0x2426d0[_0x2d11('0x31')][_0x2d11('0x33')]?_0x2426d0[_0x2d11('0x31')]:_0x33336d[_0x2d11('0x2d')];if(!_0x20a80a[_0x2d11('0x28')][_0x2d11('0x40')](_0x2d11('0x41'))){_0x2426d0['limit']=qs[_0x2d11('0x16')](_0x20a80a[_0x2d11('0x28')][_0x2d11('0x16')]);_0x2426d0[_0x2d11('0x17')]=qs[_0x2d11('0x17')](_0x20a80a[_0x2d11('0x28')][_0x2d11('0x17')]);}_0x2426d0['order']=qs['sort'](_0x20a80a[_0x2d11('0x28')][_0x2d11('0x42')]);_0x2426d0[_0x2d11('0x43')]=qs[_0x2d11('0x2f')](_['pick'](_0x20a80a[_0x2d11('0x28')],_0x33336d['filters']));_0x2426d0['where'][_0x2d11('0x44')]=_0x106544['id'];if(_0x20a80a['query'][_0x2d11('0x45')]){_0x2426d0['where']=_[_0x2d11('0x36')](_0x2426d0[_0x2d11('0x43')],{'$or':_[_0x2d11('0x46')](_0x2426d0[_0x2d11('0x31')],function(_0x17001f){var _0x3a394e={};_0x3a394e[_0x17001f]={'$like':'%'+_0x20a80a[_0x2d11('0x28')]['filter']+'%'};return _0x3a394e;})});}if(_0x20a80a[_0x2d11('0x28')][_0x2d11('0x47')]){var _0x2655cd=_0x20a80a[_0x2d11('0x28')][_0x2d11('0x47')][_0x2d11('0x48')](',');var _0x32552a={};_0x32552a[_0x2655cd[0x0]]={'$gte':moment(_0x2655cd[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2426d0['where']=_[_0x2d11('0x36')](_0x2426d0[_0x2d11('0x43')],_0x32552a);}_0x2426d0=_[_0x2d11('0x36')]({},_0x2426d0,_0x20a80a[_0x2d11('0x37')]);return db[_0x2d11('0x3f')][_0x2d11('0x49')]({'where':_0x2426d0[_0x2d11('0x43')]})[_0x2d11('0x1b')](function(_0x214ea9){_0x5c95a9[_0x2d11('0x49')]=_0x214ea9;if(_0x20a80a[_0x2d11('0x28')]['includeAll']){_0x2426d0[_0x2d11('0x35')]=[{'all':!![]}];}return db[_0x2d11('0x3f')][_0x2d11('0x26')](_0x2426d0);})['then'](function(_0x542438){_0x5c95a9[_0x2d11('0x4a')]=_0x542438;return _0x5c95a9;});}})['then'](respondWithFilteredResult(_0x1c52dc,_0x2426d0))[_0x2d11('0x2a')](handleError(_0x1c52dc,null));};exports[_0x2d11('0x4b')]=function(_0x1bd087,_0x378349){return db[_0x2d11('0x21')][_0x2d11('0x38')]({'where':{'id':_0x1bd087[_0x2d11('0x2c')]['id']}})['then'](handleEntityNotFound(_0x378349,null))[_0x2d11('0x1b')](function(_0x4326bd){if(_0x4326bd){return _0x4326bd[_0x2d11('0x4c')](_0x1bd087[_0x2d11('0x3a')][_0x2d11('0x4d')],_['omit'](_0x1bd087['body'],[_0x2d11('0x4d'),'id'])||{})[_0x2d11('0x4e')](function(){return db[_0x2d11('0x4f')][_0x2d11('0x26')]({'attributes':['id',_0x2d11('0x1e'),_0x2d11('0x50')],'where':{'id':_0x1bd087['body'][_0x2d11('0x4d')]}});})[_0x2d11('0x1b')](function(_0x502e42){socket['emit']('smsInteractionTags:save',{'id':Number(_0x1bd087[_0x2d11('0x2c')]['id']),'tags':_0x502e42||[]});return{'id':Number(_0x1bd087['params']['id']),'tags':_0x502e42||[]};});}})[_0x2d11('0x1b')](respondWithResult(_0x378349,null))[_0x2d11('0x2a')](handleError(_0x378349,null));};exports[_0x2d11('0x51')]=function(_0x1951bb,_0x1dedc3){return db[_0x2d11('0x21')][_0x2d11('0x38')]({'where':{'id':_0x1951bb['params']['id']}})[_0x2d11('0x1b')](handleEntityNotFound(_0x1dedc3,null))[_0x2d11('0x1b')](function(_0x3435e9){if(_0x3435e9){return _0x3435e9['removeTags'](_0x1951bb[_0x2d11('0x28')][_0x2d11('0x4d')]);}})[_0x2d11('0x1b')](respondWithStatusCode(_0x1dedc3,null))['catch'](handleError(_0x1dedc3,null));};exports[_0x2d11('0x52')]=function(_0x27589c,_0x4c956b){var _0x32c10b=moment()[_0x2d11('0x53')]()[_0x2d11('0x54')]();var _0x1acbbd=path[_0x2d11('0x55')](config[_0x2d11('0x56')],'server',_0x2d11('0x57'),_0x2d11('0x58'));var _0x2e9e74=path[_0x2d11('0x55')](_0x1acbbd,_0x32c10b);var _0x4abbf5=util[_0x2d11('0x59')](_0x2d11('0x5a'),_0x27589c[_0x2d11('0x2c')]['id'],_0x32c10b);var _0x4a8ead=path['join'](_0x1acbbd,_0x4abbf5);var _0x2c9549=[];_0x2c9549[_0x2d11('0x5b')]({'model':db[_0x2d11('0x5c')],'as':_0x2d11('0x5c'),'attributes':['id',_0x2d11('0x5d')],'raw':!![]});_0x2c9549[_0x2d11('0x5b')]({'model':db[_0x2d11('0x5e')],'as':_0x2d11('0x5f'),'attributes':['id',_0x2d11('0x60'),_0x2d11('0x61')],'raw':!![]});var _0x9101f7=[{'model':db[_0x2d11('0x3f')],'as':_0x2d11('0x62'),'attributes':['id',_0x2d11('0x3a'),_0x2d11('0x63'),_0x2d11('0x64'),_0x2d11('0x65'),_0x2d11('0x66')],'include':_0x2c9549}];_0x9101f7['push']({'model':db['SmsAccount'],'as':_0x2d11('0x67'),'attributes':['id',_0x2d11('0x1e')]});_0x9101f7[_0x2d11('0x5b')]({'model':db[_0x2d11('0x5c')],'as':'Owner','attributes':['id',_0x2d11('0x5d')]});return db['SmsInteraction'][_0x2d11('0x38')]({'where':{'id':_0x27589c[_0x2d11('0x2c')]['id']},'include':_0x9101f7})[_0x2d11('0x1b')](handleEntityNotFound(_0x4c956b,null))['then'](function(_0x3e02fd){if(_0x3e02fd){var _0x1e1f8d=_0x3e02fd[_0x2d11('0x68')]({'plain':!![]});fs[_0x2d11('0x69')](_0x2e9e74);var _0x2c1163={'channel':'Sms','account':_0x1e1f8d[_0x2d11('0x67')][_0x2d11('0x1e')],'agent':_0x1e1f8d['Owner']?_0x1e1f8d['Owner']['fullname']:_0x2d11('0x6a'),'createdAt':moment(_0x1e1f8d[_0x2d11('0x63')])[_0x2d11('0x59')](_0x2d11('0x6b'))[_0x2d11('0x54')](),'closedAt':_0x1e1f8d[_0x2d11('0x6c')]?moment(_0x1e1f8d['closedAt'])[_0x2d11('0x59')](_0x2d11('0x6b'))[_0x2d11('0x54')]():'','disposition':_0x1e1f8d[_0x2d11('0x6d')],'messages':_(_0x1e1f8d[_0x2d11('0x62')])[_0x2d11('0x45')]({'secret':![]})[_0x2d11('0x46')](function(_0x33518b){return{'date':moment(_0x33518b[_0x2d11('0x63')])[_0x2d11('0x59')](_0x2d11('0x6b'))[_0x2d11('0x54')](),'sender':_0x33518b['direction']===_0x2d11('0x6e')?_0x33518b['User']?_0x33518b[_0x2d11('0x5c')][_0x2d11('0x5d')]:_0x2d11('0x6f'):_0x33518b[_0x2d11('0x5f')]['firstName']+(_0x33518b['Contact'][_0x2d11('0x61')]?'\x20'+_0x33518b[_0x2d11('0x5f')]['lastName']:''),'body':_0x33518b[_0x2d11('0x3a')],'direction':_0x33518b[_0x2d11('0x64')]===_0x2d11('0x6e')?'A':'C','secret':_0x33518b['secret'],'read':_0x33518b[_0x2d11('0x66')]};})['value']()};return ejs[_0x2d11('0x70')](path[_0x2d11('0x55')](config[_0x2d11('0x56')],'server',_0x2d11('0x71'),_0x2d11('0x72')),{'interaction':_0x2c1163})['then'](function(_0x4b6cfa){var _0x14bd4d=path[_0x2d11('0x55')](_0x2e9e74,'transcript-'+_0x1e1f8d['id']+'-'+_0x32c10b+_0x2d11('0x73'));var _0x157156={'path':_0x14bd4d,'channel':'Sms','interactionId':_0x1e1f8d['id']};return pdf[_0x2d11('0x74')](_0x4b6cfa,_0x157156);})[_0x2d11('0x1b')](function(){return new BPromise(function(_0x4ed041,_0x4bc749){zipdir(_0x2e9e74,{'saveTo':_0x4a8ead},function(_0x4096a3,_0x2bcf6d){if(_0x4096a3)return _0x4bc749(_0x4096a3);return _0x4ed041(_0x2bcf6d);});})[_0x2d11('0x1b')](function(){return new BPromise(function(_0x4364e4,_0x5c2c79){rimraf(_0x2e9e74,function(_0x4c8dbf){if(_0x4c8dbf)_0x5c2c79(_0x4c8dbf);return _0x4364e4();});});})[_0x2d11('0x1b')](function(){return _0x4c956b[_0x2d11('0x52')](_0x4a8ead,_0x4abbf5,function(_0x1efb8a){if(_0x1efb8a){console[_0x2d11('0x75')](_0x2d11('0x76'),_0x1efb8a);}else{fs['unlinkSync'](_0x4a8ead);}});});});}else{return _0x4c956b['sendStatus'](0xc8);}})['catch'](handleError(_0x4c956b,null));}; \ No newline at end of file +var _0xc3fc=['SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','files','transcript-%d-%s.zip','push','User','Contact','lastName','direction','read','SmsAccount','Account','Owner','fullname','mkdirSync','Sms','N.A.','createdAt','closedAt','disposition','Messages','System','firstName','out','secret','value','renderFile','server','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./smsInteraction.socket','end','status','json','offset','undefined','limit','count','set','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','model','keys','fields','attributes','length','include','merge','options','SmsInteraction','find','create','body','params','describe','addMessage','SmsMessage','ids','omit','getMessages','filters','nolimit','order','pick','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3fc,0x123));var _0xcc3f=function(_0x4865ce,_0x1e4225){_0x4865ce=_0x4865ce-0x0;var _0x3eceb5=_0xc3fc[_0x4865ce];return _0x3eceb5;};'use strict';var rimraf=require(_0xcc3f('0x0'));var zipdir=require(_0xcc3f('0x1'));var moment=require(_0xcc3f('0x2'));var BPromise=require(_0xcc3f('0x3'));var util=require(_0xcc3f('0x4'));var path=require(_0xcc3f('0x5'));var ejs=require(_0xcc3f('0x6'));var fs=require('fs');var _=require(_0xcc3f('0x7'));var Redis=require('ioredis');var interaction=require(_0xcc3f('0x8'));var qs=require(_0xcc3f('0x9'));var pdf=require(_0xcc3f('0xa'));var logger=require(_0xcc3f('0xb'))(_0xcc3f('0xc'));var config=require(_0xcc3f('0xd'));var db=require(_0xcc3f('0xe'))['db'];config['redis']=_[_0xcc3f('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcc3f('0x10'))(new Redis(config[_0xcc3f('0x11')]));require(_0xcc3f('0x12'))['register'](socket);function respondWithStatusCode(_0x2f4fdc,_0x524ccc){_0x524ccc=_0x524ccc||0xcc;return function(_0x37b2d2){if(_0x37b2d2){return _0x2f4fdc['sendStatus'](_0x524ccc);}return _0x2f4fdc['status'](_0x524ccc)[_0xcc3f('0x13')]();};}function respondWithResult(_0x208f4c,_0x88a296){_0x88a296=_0x88a296||0xc8;return function(_0x498bf1){if(_0x498bf1){return _0x208f4c[_0xcc3f('0x14')](_0x88a296)[_0xcc3f('0x15')](_0x498bf1);}};}function respondWithFilteredResult(_0x225926,_0x32e2fb){return function(_0xe208c1){if(_0xe208c1){var _0x5ca66a=typeof _0x32e2fb[_0xcc3f('0x16')]===_0xcc3f('0x17')&&typeof _0x32e2fb[_0xcc3f('0x18')]===_0xcc3f('0x17');var _0x5e3868=_0xe208c1[_0xcc3f('0x19')];var _0x46bea5=_0x5ca66a?0x0:_0x32e2fb['offset'];var _0x174faf=_0x5ca66a?_0xe208c1[_0xcc3f('0x19')]:_0x32e2fb[_0xcc3f('0x16')]+_0x32e2fb['limit'];var _0x590bb0;if(_0x174faf>=_0x5e3868){_0x174faf=_0x5e3868;_0x590bb0=0xc8;}else{_0x590bb0=0xce;}_0x225926[_0xcc3f('0x14')](_0x590bb0);return _0x225926[_0xcc3f('0x1a')]('Content-Range',_0x46bea5+'-'+_0x174faf+'/'+_0x5e3868)[_0xcc3f('0x15')](_0xe208c1);}return null;};}function saveUpdates(_0x2a10b9){return function(_0x386f2d){if(_0x386f2d){return _0x386f2d[_0xcc3f('0x1b')](_0x2a10b9)[_0xcc3f('0x1c')](function(_0x5de793){return _0x5de793;});}return null;};}function removeEntity(_0xf15e53){return function(_0x36f808){if(_0x36f808){return _0x36f808[_0xcc3f('0x1d')]()[_0xcc3f('0x1c')](function(){_0xf15e53[_0xcc3f('0x14')](0xcc)[_0xcc3f('0x13')]();});}};}function handleEntityNotFound(_0xe70cc7){return function(_0x1f2a88){if(!_0x1f2a88){_0xe70cc7[_0xcc3f('0x1e')](0x194);}return _0x1f2a88;};}function handleError(_0x5f14e6,_0x584770){_0x584770=_0x584770||0x1f4;return function(_0x3d8713){logger[_0xcc3f('0x1f')](_0x3d8713[_0xcc3f('0x20')]);if(_0x3d8713[_0xcc3f('0x21')]){delete _0x3d8713[_0xcc3f('0x21')];}_0x5f14e6[_0xcc3f('0x14')](_0x584770)[_0xcc3f('0x22')](_0x3d8713);};}exports[_0xcc3f('0x23')]=function(_0x38be46,_0x47a14c){var _0x20b99a={};var _0x37ee6f=_[_0xcc3f('0x24')](db['SmsInteraction'][_0xcc3f('0x25')],function(_0x41478f){return{'name':_0x41478f[_0xcc3f('0x26')],'type':_0x41478f[_0xcc3f('0x27')][_0xcc3f('0x28')]};});_0x20b99a=qs[_0xcc3f('0x29')](_0x37ee6f,_0x38be46);return interaction[_0xcc3f('0x2a')](_0xcc3f('0x2b'),_0x38be46[_0xcc3f('0x2c')],_0x38be46[_0xcc3f('0x2d')],_0x20b99a,_0x37ee6f)['then'](respondWithFilteredResult(_0x47a14c,_0x20b99a))[_0xcc3f('0x2e')](handleError(_0x47a14c,null));};exports[_0xcc3f('0x2f')]=function(_0x172ba0,_0x45827c){var _0x500dd4={'raw':![],'where':{'id':_0x172ba0['params']['id']}},_0x3edfee={};_0x3edfee[_0xcc3f('0x30')]=_[_0xcc3f('0x31')](db['SmsInteraction'][_0xcc3f('0x25')]);_0x3edfee[_0xcc3f('0x2c')]=_['keys'](_0x172ba0[_0xcc3f('0x2c')]);_0x3edfee['filters']=_['intersection'](_0x3edfee[_0xcc3f('0x30')],_0x3edfee[_0xcc3f('0x2c')]);_0x500dd4['attributes']=_['intersection'](_0x3edfee[_0xcc3f('0x30')],qs['fields'](_0x172ba0['query'][_0xcc3f('0x32')]));_0x500dd4[_0xcc3f('0x33')]=_0x500dd4[_0xcc3f('0x33')][_0xcc3f('0x34')]?_0x500dd4['attributes']:_0x3edfee[_0xcc3f('0x30')];if(_0x172ba0[_0xcc3f('0x2c')]['includeAll']){_0x500dd4[_0xcc3f('0x35')]=[{'all':!![]}];}_0x500dd4=_[_0xcc3f('0x36')]({},_0x500dd4,_0x172ba0[_0xcc3f('0x37')]);return db[_0xcc3f('0x38')][_0xcc3f('0x39')](_0x500dd4)[_0xcc3f('0x1c')](handleEntityNotFound(_0x45827c,null))['then'](respondWithResult(_0x45827c,null))[_0xcc3f('0x2e')](handleError(_0x45827c,null));};exports[_0xcc3f('0x3a')]=function(_0x2d1393,_0x1d89b8){return db[_0xcc3f('0x38')][_0xcc3f('0x3a')](_0x2d1393[_0xcc3f('0x3b')],{})['then'](respondWithResult(_0x1d89b8,0xc9))[_0xcc3f('0x2e')](handleError(_0x1d89b8,null));};exports[_0xcc3f('0x1b')]=function(_0xff35a9,_0x39db03){if(_0xff35a9[_0xcc3f('0x3b')]['id']){delete _0xff35a9['body']['id'];}return db[_0xcc3f('0x38')][_0xcc3f('0x39')]({'where':{'id':_0xff35a9[_0xcc3f('0x3c')]['id']}})[_0xcc3f('0x1c')](handleEntityNotFound(_0x39db03,null))['then'](saveUpdates(_0xff35a9[_0xcc3f('0x3b')],null))[_0xcc3f('0x1c')](respondWithResult(_0x39db03,null))[_0xcc3f('0x2e')](handleError(_0x39db03,null));};exports['destroy']=function(_0xade93d,_0x53b0a9){return db[_0xcc3f('0x38')]['find']({'where':{'id':_0xade93d[_0xcc3f('0x3c')]['id']}})[_0xcc3f('0x1c')](handleEntityNotFound(_0x53b0a9,null))['then'](removeEntity(_0x53b0a9,null))['catch'](handleError(_0x53b0a9,null));};exports[_0xcc3f('0x3d')]=function(_0x427671,_0x186ee8){return db[_0xcc3f('0x38')][_0xcc3f('0x3d')]()[_0xcc3f('0x1c')](respondWithResult(_0x186ee8,null))[_0xcc3f('0x2e')](handleError(_0x186ee8,null));};exports[_0xcc3f('0x3e')]=function(_0x32bac0,_0x4afccb){return db[_0xcc3f('0x3f')][_0xcc3f('0x39')]({'where':{'id':_0x32bac0['params']['id']}})[_0xcc3f('0x1c')](handleEntityNotFound(_0x4afccb,null))[_0xcc3f('0x1c')](function(_0x164f5c){if(_0x164f5c){return _0x164f5c[_0xcc3f('0x3e')](_0x32bac0[_0xcc3f('0x3b')][_0xcc3f('0x40')],_[_0xcc3f('0x41')](_0x32bac0[_0xcc3f('0x3b')],[_0xcc3f('0x40'),'id'])||{});}})[_0xcc3f('0x1c')](respondWithResult(_0x4afccb,null))[_0xcc3f('0x2e')](handleError(_0x4afccb,null));};exports[_0xcc3f('0x42')]=function(_0x1ffe06,_0x4458dd){var _0x299bfb={'raw':![],'where':{}};var _0x589fb7={};var _0x354020={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x1ffe06['params']['id']}})['then'](handleEntityNotFound(_0x4458dd,null))[_0xcc3f('0x1c')](function(_0x5a1072){if(_0x5a1072){_0x589fb7[_0xcc3f('0x30')]=_['keys'](db[_0xcc3f('0x3f')][_0xcc3f('0x25')]);_0x589fb7[_0xcc3f('0x2c')]=_[_0xcc3f('0x31')](_0x1ffe06[_0xcc3f('0x2c')]);_0x589fb7[_0xcc3f('0x43')]=_['intersection'](_0x589fb7[_0xcc3f('0x30')],_0x589fb7[_0xcc3f('0x2c')]);_0x299bfb[_0xcc3f('0x33')]=_['intersection'](_0x589fb7[_0xcc3f('0x30')],qs[_0xcc3f('0x32')](_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x32')]));_0x299bfb[_0xcc3f('0x33')]=_0x299bfb[_0xcc3f('0x33')][_0xcc3f('0x34')]?_0x299bfb[_0xcc3f('0x33')]:_0x589fb7[_0xcc3f('0x30')];if(!_0x1ffe06[_0xcc3f('0x2c')]['hasOwnProperty'](_0xcc3f('0x44'))){_0x299bfb[_0xcc3f('0x18')]=qs['limit'](_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x18')]);_0x299bfb[_0xcc3f('0x16')]=qs['offset'](_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x16')]);}_0x299bfb[_0xcc3f('0x45')]=qs['sort'](_0x1ffe06['query']['sort']);_0x299bfb['where']=qs[_0xcc3f('0x43')](_[_0xcc3f('0x46')](_0x1ffe06[_0xcc3f('0x2c')],_0x589fb7[_0xcc3f('0x43')]));_0x299bfb[_0xcc3f('0x47')][_0xcc3f('0x48')]=_0x5a1072['id'];if(_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x49')]){_0x299bfb[_0xcc3f('0x47')]=_['merge'](_0x299bfb[_0xcc3f('0x47')],{'$or':_[_0xcc3f('0x24')](_0x299bfb['attributes'],function(_0x212e5f){var _0x597207={};_0x597207[_0x212e5f]={'$like':'%'+_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x49')]+'%'};return _0x597207;})});}if(_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x4a')]){var _0x1cd569=_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x4a')]['split'](',');var _0x267faf={};_0x267faf[_0x1cd569[0x0]]={'$gte':moment(_0x1cd569[0x1])[_0xcc3f('0x4b')](_0xcc3f('0x4c'))};_0x299bfb[_0xcc3f('0x47')]=_[_0xcc3f('0x36')](_0x299bfb['where'],_0x267faf);}_0x299bfb=_[_0xcc3f('0x36')]({},_0x299bfb,_0x1ffe06[_0xcc3f('0x37')]);return db['SmsMessage']['count']({'where':_0x299bfb[_0xcc3f('0x47')]})[_0xcc3f('0x1c')](function(_0x24c34d){_0x354020[_0xcc3f('0x19')]=_0x24c34d;if(_0x1ffe06[_0xcc3f('0x2c')][_0xcc3f('0x4d')]){_0x299bfb[_0xcc3f('0x35')]=[{'all':!![]}];}return db['SmsMessage'][_0xcc3f('0x2a')](_0x299bfb);})[_0xcc3f('0x1c')](function(_0x4aba18){_0x354020[_0xcc3f('0x4e')]=_0x4aba18;return _0x354020;});}})['then'](respondWithFilteredResult(_0x4458dd,_0x299bfb))[_0xcc3f('0x2e')](handleError(_0x4458dd,null));};exports['addTags']=function(_0x53d86d,_0x3b0811){return db[_0xcc3f('0x38')][_0xcc3f('0x39')]({'where':{'id':_0x53d86d[_0xcc3f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3b0811,null))[_0xcc3f('0x1c')](function(_0x1849ac){if(_0x1849ac){return _0x1849ac[_0xcc3f('0x4f')](_0x53d86d['body'][_0xcc3f('0x40')],_[_0xcc3f('0x41')](_0x53d86d[_0xcc3f('0x3b')],[_0xcc3f('0x40'),'id'])||{})[_0xcc3f('0x50')](function(){return db[_0xcc3f('0x51')][_0xcc3f('0x2a')]({'attributes':['id',_0xcc3f('0x21'),_0xcc3f('0x52')],'where':{'id':_0x53d86d[_0xcc3f('0x3b')][_0xcc3f('0x40')]}});})[_0xcc3f('0x1c')](function(_0x274775){socket[_0xcc3f('0x53')]('smsInteractionTags:save',{'id':Number(_0x53d86d[_0xcc3f('0x3c')]['id']),'tags':_0x274775||[]});return{'id':Number(_0x53d86d[_0xcc3f('0x3c')]['id']),'tags':_0x274775||[]};});}})[_0xcc3f('0x1c')](respondWithResult(_0x3b0811,null))[_0xcc3f('0x2e')](handleError(_0x3b0811,null));};exports['removeTags']=function(_0x3908be,_0x2165ac){return db[_0xcc3f('0x38')]['find']({'where':{'id':_0x3908be[_0xcc3f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2165ac,null))[_0xcc3f('0x1c')](function(_0x41bf69){if(_0x41bf69){return _0x41bf69[_0xcc3f('0x54')](_0x3908be[_0xcc3f('0x2c')]['ids']);}})['then'](respondWithStatusCode(_0x2165ac,null))[_0xcc3f('0x2e')](handleError(_0x2165ac,null));};exports[_0xcc3f('0x55')]=function(_0x287658,_0x90c979){var _0x115795=moment()[_0xcc3f('0x56')]()[_0xcc3f('0x57')]();var _0x2008e8=path[_0xcc3f('0x58')](config[_0xcc3f('0x59')],'server',_0xcc3f('0x5a'),'tmp');var _0x19c9d9=path[_0xcc3f('0x58')](_0x2008e8,_0x115795);var _0x1e30d9=util['format'](_0xcc3f('0x5b'),_0x287658['params']['id'],_0x115795);var _0x3a2041=path[_0xcc3f('0x58')](_0x2008e8,_0x1e30d9);var _0x5aa947=[];_0x5aa947[_0xcc3f('0x5c')]({'model':db[_0xcc3f('0x5d')],'as':_0xcc3f('0x5d'),'attributes':['id','fullname'],'raw':!![]});_0x5aa947[_0xcc3f('0x5c')]({'model':db['CmContact'],'as':_0xcc3f('0x5e'),'attributes':['id','firstName',_0xcc3f('0x5f')],'raw':!![]});var _0x30f9ba=[{'model':db[_0xcc3f('0x3f')],'as':'Messages','attributes':['id',_0xcc3f('0x3b'),'createdAt',_0xcc3f('0x60'),'secret',_0xcc3f('0x61')],'include':_0x5aa947}];_0x30f9ba[_0xcc3f('0x5c')]({'model':db[_0xcc3f('0x62')],'as':_0xcc3f('0x63'),'attributes':['id',_0xcc3f('0x21')]});_0x30f9ba['push']({'model':db['User'],'as':_0xcc3f('0x64'),'attributes':['id',_0xcc3f('0x65')]});return db[_0xcc3f('0x38')][_0xcc3f('0x39')]({'where':{'id':_0x287658[_0xcc3f('0x3c')]['id']},'include':_0x30f9ba})[_0xcc3f('0x1c')](handleEntityNotFound(_0x90c979,null))['then'](function(_0x18a46a){if(_0x18a46a){var _0x5326f6=_0x18a46a['get']({'plain':!![]});fs[_0xcc3f('0x66')](_0x19c9d9);var _0xf93676={'channel':_0xcc3f('0x67'),'account':_0x5326f6[_0xcc3f('0x63')][_0xcc3f('0x21')],'agent':_0x5326f6['Owner']?_0x5326f6[_0xcc3f('0x64')][_0xcc3f('0x65')]:_0xcc3f('0x68'),'createdAt':moment(_0x5326f6[_0xcc3f('0x69')])[_0xcc3f('0x4b')](_0xcc3f('0x4c'))[_0xcc3f('0x57')](),'closedAt':_0x5326f6['closed']?moment(_0x5326f6[_0xcc3f('0x6a')])[_0xcc3f('0x4b')](_0xcc3f('0x4c'))[_0xcc3f('0x57')]():'','disposition':_0x5326f6[_0xcc3f('0x6b')],'messages':_(_0x5326f6[_0xcc3f('0x6c')])[_0xcc3f('0x49')]({'secret':![]})['map'](function(_0x560ad6){return{'date':moment(_0x560ad6['createdAt'])[_0xcc3f('0x4b')](_0xcc3f('0x4c'))[_0xcc3f('0x57')](),'sender':_0x560ad6[_0xcc3f('0x60')]==='out'?_0x560ad6[_0xcc3f('0x5d')]?_0x560ad6[_0xcc3f('0x5d')][_0xcc3f('0x65')]:_0xcc3f('0x6d'):_0x560ad6[_0xcc3f('0x5e')][_0xcc3f('0x6e')]+(_0x560ad6['Contact'][_0xcc3f('0x5f')]?'\x20'+_0x560ad6[_0xcc3f('0x5e')][_0xcc3f('0x5f')]:''),'body':_0x560ad6[_0xcc3f('0x3b')],'direction':_0x560ad6[_0xcc3f('0x60')]===_0xcc3f('0x6f')?'A':'C','secret':_0x560ad6[_0xcc3f('0x70')],'read':_0x560ad6['read']};})[_0xcc3f('0x71')]()};return ejs[_0xcc3f('0x72')](path[_0xcc3f('0x58')](config['root'],_0xcc3f('0x73'),'views','downloadInteraction.ejs'),{'interaction':_0xf93676})[_0xcc3f('0x1c')](function(_0x518df1){var _0x24fed6=path[_0xcc3f('0x58')](_0x19c9d9,_0xcc3f('0x74')+_0x5326f6['id']+'-'+_0x115795+_0xcc3f('0x75'));var _0x5285ec={'path':_0x24fed6,'channel':_0xcc3f('0x67'),'interactionId':_0x5326f6['id']};return pdf[_0xcc3f('0x76')](_0x518df1,_0x5285ec);})[_0xcc3f('0x1c')](function(){return new BPromise(function(_0x6bc886,_0x4d7eb2){zipdir(_0x19c9d9,{'saveTo':_0x3a2041},function(_0x37eff9,_0x55a5f5){if(_0x37eff9)return _0x4d7eb2(_0x37eff9);return _0x6bc886(_0x55a5f5);});})[_0xcc3f('0x1c')](function(){return new BPromise(function(_0x13e92c,_0x56acbb){rimraf(_0x19c9d9,function(_0x1da0bc){if(_0x1da0bc)_0x56acbb(_0x1da0bc);return _0x13e92c();});});})[_0xcc3f('0x1c')](function(){return _0x90c979[_0xcc3f('0x55')](_0x3a2041,_0x1e30d9,function(_0x11fa06){if(_0x11fa06){console[_0xcc3f('0x77')]('err',_0x11fa06);}else{fs[_0xcc3f('0x78')](_0x3a2041);}});});});}else{return _0x90c979[_0xcc3f('0x1e')](0xc8);}})[_0xcc3f('0x2e')](handleError(_0x90c979,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f916dfe..238c3de 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 _0xf61e=['exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x4df592,_0x4cd928){var _0x1cd705=function(_0x3d77cb){while(--_0x3d77cb){_0x4df592['push'](_0x4df592['shift']());}};_0x1cd705(++_0x4cd928);}(_0xf61e,0x191));var _0xef61=function(_0x48e7ea,_0x3290b5){_0x48e7ea=_0x48e7ea-0x0;var _0x3ece3d=_0xf61e[_0x48e7ea];return _0x3ece3d;};'use strict';var EventEmitter=require(_0xef61('0x0'));var SmsInteraction=require(_0xef61('0x1'))['db'][_0xef61('0x2')];var SmsMessage=require(_0xef61('0x1'))['db'][_0xef61('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xef61('0x4')](0x0);var events={'afterCreate':_0xef61('0x5'),'afterUpdate':_0xef61('0x6'),'afterDestroy':_0xef61('0x7')};function emitEvent(_0x14122a){return function(_0x239fa9,_0x45a18d,_0x5b00b2){_0x239fa9[_0xef61('0x8')]({'attributes':['id'],'raw':!![]})[_0xef61('0x9')](function(_0x4f0cc5){_0x239fa9[_0xef61('0xa')](_0xef61('0xb'),_0x4f0cc5[_0xef61('0xc')](function(_0x4dba00){return{'id':_0x4dba00['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x239fa9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xef61('0x9')](function(_0x2e28c7){_0x239fa9[_0xef61('0xa')](_0xef61('0xd'),_0x2e28c7[_0xef61('0xe')]);SmsInteractionEvents[_0xef61('0xf')](_0x14122a+':'+_0x239fa9['id'],_0x239fa9);SmsInteractionEvents[_0xef61('0xf')](_0x14122a,_0x239fa9);_0x5b00b2(null);})[_0xef61('0x10')](_0x5b00b2(null));};}for(var e in events){if(events[_0xef61('0x11')](e)){var event=events[e];SmsInteraction[_0xef61('0x12')](e,emitEvent(event));}}module[_0xef61('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0xab40=['remove','then','setDataValue','Users','unreadMessages','length','emit','catch','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x386f6b,_0xc1fa64){var _0x814a0d=function(_0x1b27ca){while(--_0x1b27ca){_0x386f6b['push'](_0x386f6b['shift']());}};_0x814a0d(++_0xc1fa64);}(_0xab40,0xcd));var _0x0ab4=function(_0x4dc069,_0x1774bb){_0x4dc069=_0x4dc069-0x0;var _0x328093=_0xab40[_0x4dc069];return _0x328093;};'use strict';var EventEmitter=require(_0x0ab4('0x0'));var SmsInteraction=require(_0x0ab4('0x1'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0ab4('0x2')](0x0);var events={'afterCreate':_0x0ab4('0x3'),'afterUpdate':_0x0ab4('0x4'),'afterDestroy':_0x0ab4('0x5')};function emitEvent(_0x14634a){return function(_0x57fac1,_0x5f01aa,_0x28b17a){_0x57fac1['getUsers']({'attributes':['id'],'raw':!![]})[_0x0ab4('0x6')](function(_0x46d16a){_0x57fac1[_0x0ab4('0x7')](_0x0ab4('0x8'),_0x46d16a['map'](function(_0x55263d){return{'id':_0x55263d['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x57fac1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ab4('0x6')](function(_0x30e726){_0x57fac1[_0x0ab4('0x7')](_0x0ab4('0x9'),_0x30e726[_0x0ab4('0xa')]);SmsInteractionEvents[_0x0ab4('0xb')](_0x14634a+':'+_0x57fac1['id'],_0x57fac1);SmsInteractionEvents[_0x0ab4('0xb')](_0x14634a,_0x57fac1);_0x28b17a(null);})[_0x0ab4('0xc')](_0x28b17a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x0ab4('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index de89e42..b6a34f5 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 _0xaf95=['bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x46ce9d,_0xa564b0){var _0x1639c4=function(_0x1f59a2){while(--_0x1f59a2){_0x46ce9d['push'](_0x46ce9d['shift']());}};_0x1639c4(++_0xa564b0);}(_0xaf95,0x177));var _0x5af9=function(_0x6d0b17,_0x221ac0){_0x6d0b17=_0x6d0b17-0x0;var _0x1ee7f3=_0xaf95[_0x6d0b17];return _0x1ee7f3;};'use strict';var _=require(_0x5af9('0x0'));var util=require(_0x5af9('0x1'));var logger=require(_0x5af9('0x2'))(_0x5af9('0x3'));var moment=require(_0x5af9('0x4'));var BPromise=require(_0x5af9('0x5'));var rp=require(_0x5af9('0x6'));var fs=require('fs');var path=require(_0x5af9('0x7'));var rimraf=require(_0x5af9('0x8'));var config=require(_0x5af9('0x9'));var attributes=require(_0x5af9('0xa'));module[_0x5af9('0xb')]=function(_0x3cfbd5,_0x2b845f){return _0x3cfbd5[_0x5af9('0xc')]('SmsInteraction',attributes,{'tableName':_0x5af9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x393959,_0x53f799,_0x7062ea){if(_0x393959[_0x5af9('0xe')](_0x5af9('0xf'))){_0x393959[_0x5af9('0x10')]=moment()[_0x5af9('0x11')](_0x5af9('0x12'));}_0x7062ea(null,_0x393959);}}});}; \ No newline at end of file +var _0x52ef=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x52ef,0xde));var _0xf52e=function(_0x186a56,_0x42f472){_0x186a56=_0x186a56-0x0;var _0x516e86=_0x52ef[_0x186a56];return _0x516e86;};'use strict';var _=require(_0xf52e('0x0'));var util=require(_0xf52e('0x1'));var logger=require(_0xf52e('0x2'))(_0xf52e('0x3'));var moment=require(_0xf52e('0x4'));var BPromise=require(_0xf52e('0x5'));var rp=require(_0xf52e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf52e('0x7'));var attributes=require(_0xf52e('0x8'));module['exports']=function(_0x2ddb22,_0x4f07e2){return _0x2ddb22['define'](_0xf52e('0x9'),attributes,{'tableName':_0xf52e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14a45a,_0x250998,_0x325736){if(_0x14a45a[_0xf52e('0xb')]('closed')){_0x14a45a[_0xf52e('0xc')]=moment()['format'](_0xf52e('0xd'));}_0x325736(null,_0x14a45a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index ee703b0..3128abf 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 _0x3de7=['error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','info','AddTagsToSmsInteraction','find','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','redis','socket.io-emitter','./smsInteraction.socket','register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1296c9,_0x17b2de){var _0x170dd5=function(_0x46121d){while(--_0x46121d){_0x1296c9['push'](_0x1296c9['shift']());}};_0x170dd5(++_0x17b2de);}(_0x3de7,0x7b));var _0x73de=function(_0x26297c,_0x25e593){_0x26297c=_0x26297c-0x0;var _0x47c4c1=_0x3de7[_0x26297c];return _0x47c4c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73de('0x0'));var BPromise=require(_0x73de('0x1'));var rs=require(_0x73de('0x2'));var fs=require('fs');var Redis=require(_0x73de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x73de('0x4'));var logger=require(_0x73de('0x5'))(_0x73de('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x73de('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x73de('0x8'))(new Redis(config['redis']));require(_0x73de('0x9'))[_0x73de('0xa')](socket);function respondWithRpcPromise(_0x5416e9,_0x515b51,_0x461de1){return new BPromise(function(_0x1dae52,_0x328668){return client['request'](_0x5416e9,_0x461de1)[_0x73de('0xb')](function(_0x22735f){logger['info'](_0x73de('0xc'),_0x515b51,_0x73de('0xd'));logger[_0x73de('0xe')](_0x73de('0xf'),_0x515b51,_0x73de('0xd'),JSON[_0x73de('0x10')](_0x22735f));if(_0x22735f[_0x73de('0x11')]){if(_0x22735f[_0x73de('0x11')]['code']===0x1f4){logger['error'](_0x73de('0xc'),_0x515b51,_0x22735f[_0x73de('0x11')][_0x73de('0x12')]);return _0x328668(_0x22735f[_0x73de('0x11')][_0x73de('0x12')]);}logger[_0x73de('0x11')](_0x73de('0xc'),_0x515b51,_0x22735f[_0x73de('0x11')]['message']);return _0x1dae52(_0x22735f[_0x73de('0x11')][_0x73de('0x12')]);}else{logger['info'](_0x73de('0xc'),_0x515b51,_0x73de('0xd'));_0x1dae52(_0x22735f[_0x73de('0x13')]['message']);}})[_0x73de('0x14')](function(_0xaf7fc8){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x515b51,_0xaf7fc8);_0x328668(_0xaf7fc8);});});}exports[_0x73de('0x15')]=function(_0x27bd86){var _0x8c2d07=this;return new Promise(function(_0x3506d6,_0x2f6d3e){return db[_0x73de('0x16')]['update'](_0x27bd86[_0x73de('0x17')],{'raw':_0x27bd86[_0x73de('0x18')]?_0x27bd86['options'][_0x73de('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27bd86[_0x73de('0x18')]?_0x27bd86[_0x73de('0x18')][_0x73de('0x1a')]||null:null,'attributes':_0x27bd86[_0x73de('0x18')]?_0x27bd86['options'][_0x73de('0x1b')]||null:null,'limit':_0x27bd86[_0x73de('0x18')]?_0x27bd86[_0x73de('0x18')][_0x73de('0x1c')]||null:null})[_0x73de('0xb')](function(_0x58d466){logger[_0x73de('0x1d')](_0x73de('0x15'),_0x27bd86);logger['debug']('UpdateSmsInteraction',_0x27bd86,JSON[_0x73de('0x10')](_0x58d466));_0x3506d6(_0x58d466);})[_0x73de('0x14')](function(_0x39afcf){logger[_0x73de('0x11')](_0x73de('0x15'),_0x39afcf[_0x73de('0x12')],_0x27bd86);_0x2f6d3e(_0x8c2d07[_0x73de('0x11')](0x1f4,_0x39afcf['message']));});});};exports[_0x73de('0x1e')]=function(_0x3bb6f3){return new Promise(function(_0x3d6a2e,_0x186a01){return db[_0x73de('0x16')][_0x73de('0x1f')]({'where':_0x3bb6f3[_0x73de('0x18')]?_0x3bb6f3[_0x73de('0x18')][_0x73de('0x1a')]||null:null})[_0x73de('0xb')](function(_0x31fca2){if(_0x31fca2){return _0x31fca2['addTags'](_0x3bb6f3[_0x73de('0x17')]['ids'],_['omit'](_0x3bb6f3[_0x73de('0x17')],[_0x73de('0x20'),'id'])||{});}})[_0x73de('0x21')](function(_0x137bc1){logger[_0x73de('0x1d')](_0x73de('0x22'),_0x3bb6f3);logger['debug']('AddTags',_0x3bb6f3,JSON['stringify'](_0x137bc1));_0x3d6a2e(_0x137bc1);})[_0x73de('0x14')](function(_0x4437ff){logger[_0x73de('0x11')](_0x73de('0x22'),_0x4437ff[_0x73de('0x12')],_0x3bb6f3);_0x186a01(_this[_0x73de('0x11')](0x1f4,_0x4437ff['message']));});});}; \ No newline at end of file +var _0x2974=['message','info','catch','SmsInteraction','update','options','raw','attributes','limit','then','UpdateSmsInteraction','AddTagsToSmsInteraction','find','where','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x2974,0x6a));var _0x4297=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x2974[_0x34a8c8];return _0x1fe6e5;};'use strict';var _=require(_0x4297('0x0'));var util=require(_0x4297('0x1'));var moment=require(_0x4297('0x2'));var BPromise=require(_0x4297('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4297('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4297('0x5'));var logger=require(_0x4297('0x6'))(_0x4297('0x7'));var config=require(_0x4297('0x8'));var jayson=require(_0x4297('0x9'));var client=jayson[_0x4297('0xa')][_0x4297('0xb')]({'port':0x232a});config['redis']=_[_0x4297('0xc')](config[_0x4297('0xd')],{'host':_0x4297('0xe'),'port':0x18eb});var socket=require(_0x4297('0xf'))(new Redis(config['redis']));require(_0x4297('0x10'))['register'](socket);function respondWithRpcPromise(_0x999382,_0x2ab4cf,_0x4d3db6){return new BPromise(function(_0x37b084,_0x4f7a40){return client['request'](_0x999382,_0x4d3db6)['then'](function(_0x29b04d){logger['info'](_0x4297('0x11'),_0x2ab4cf,_0x4297('0x12'));logger[_0x4297('0x13')](_0x4297('0x14'),_0x2ab4cf,_0x4297('0x12'),JSON[_0x4297('0x15')](_0x29b04d));if(_0x29b04d[_0x4297('0x16')]){if(_0x29b04d[_0x4297('0x16')]['code']===0x1f4){logger[_0x4297('0x16')](_0x4297('0x11'),_0x2ab4cf,_0x29b04d[_0x4297('0x16')][_0x4297('0x17')]);return _0x4f7a40(_0x29b04d['error'][_0x4297('0x17')]);}logger[_0x4297('0x16')](_0x4297('0x11'),_0x2ab4cf,_0x29b04d[_0x4297('0x16')][_0x4297('0x17')]);return _0x37b084(_0x29b04d[_0x4297('0x16')][_0x4297('0x17')]);}else{logger[_0x4297('0x18')](_0x4297('0x11'),_0x2ab4cf,_0x4297('0x12'));_0x37b084(_0x29b04d['result'][_0x4297('0x17')]);}})[_0x4297('0x19')](function(_0x3ee8d7){logger['error'](_0x4297('0x11'),_0x2ab4cf,_0x3ee8d7);_0x4f7a40(_0x3ee8d7);});});}exports['UpdateSmsInteraction']=function(_0x4d7b1c){var _0x3aa3b0=this;return new Promise(function(_0x35d6f8,_0x51a3f0){return db[_0x4297('0x1a')][_0x4297('0x1b')](_0x4d7b1c['body'],{'raw':_0x4d7b1c[_0x4297('0x1c')]?_0x4d7b1c[_0x4297('0x1c')][_0x4297('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d7b1c[_0x4297('0x1c')]?_0x4d7b1c[_0x4297('0x1c')]['where']||null:null,'attributes':_0x4d7b1c[_0x4297('0x1c')]?_0x4d7b1c[_0x4297('0x1c')][_0x4297('0x1e')]||null:null,'limit':_0x4d7b1c['options']?_0x4d7b1c['options'][_0x4297('0x1f')]||null:null})[_0x4297('0x20')](function(_0x5d3dce){logger['info'](_0x4297('0x21'),_0x4d7b1c);logger[_0x4297('0x13')](_0x4297('0x21'),_0x4d7b1c,JSON['stringify'](_0x5d3dce));_0x35d6f8(_0x5d3dce);})['catch'](function(_0x381858){logger[_0x4297('0x16')]('UpdateSmsInteraction',_0x381858[_0x4297('0x17')],_0x4d7b1c);_0x51a3f0(_0x3aa3b0[_0x4297('0x16')](0x1f4,_0x381858[_0x4297('0x17')]));});});};exports[_0x4297('0x22')]=function(_0x47c0fb){return new Promise(function(_0x1bedd6,_0xaa2a){return db['SmsInteraction'][_0x4297('0x23')]({'where':_0x47c0fb[_0x4297('0x1c')]?_0x47c0fb[_0x4297('0x1c')][_0x4297('0x24')]||null:null})[_0x4297('0x20')](function(_0x396bce){if(_0x396bce){return _0x396bce[_0x4297('0x25')](_0x47c0fb['body'][_0x4297('0x26')],_[_0x4297('0x27')](_0x47c0fb[_0x4297('0x28')],[_0x4297('0x26'),'id'])||{});}})[_0x4297('0x29')](function(_0x5275ae){logger[_0x4297('0x18')](_0x4297('0x2a'),_0x47c0fb);logger[_0x4297('0x13')](_0x4297('0x2a'),_0x47c0fb,JSON[_0x4297('0x15')](_0x5275ae));_0x1bedd6(_0x5275ae);})[_0x4297('0x19')](function(_0x6c6fd9){logger[_0x4297('0x16')]('AddTags',_0x6c6fd9[_0x4297('0x17')],_0x47c0fb);_0xaa2a(_this['error'](0x1f4,_0x6c6fd9[_0x4297('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 2526863..e165c2c 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 _0x38b5=['./smsInteraction.events','save','remove','update','removeListener','length'];(function(_0x51eb02,_0x51b7d6){var _0x2d90a5=function(_0x49a187){while(--_0x49a187){_0x51eb02['push'](_0x51eb02['shift']());}};_0x2d90a5(++_0x51b7d6);}(_0x38b5,0x1a4));var _0x538b=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0x38b5[_0x967959];return _0x5c4489;};'use strict';var SmsInteractionEvents=require(_0x538b('0x0'));var events=[_0x538b('0x1'),_0x538b('0x2'),_0x538b('0x3')];function createListener(_0x3546b3,_0x3722a7){return function(_0x54ad24){_0x3722a7['emit'](_0x3546b3,_0x54ad24);};}function removeListener(_0x19652f,_0x2a450c){return function(){SmsInteractionEvents[_0x538b('0x4')](_0x19652f,_0x2a450c);};}exports['register']=function(_0x32dc72){for(var _0x545f95=0x0,_0x3930ee=events[_0x538b('0x5')];_0x545f95<_0x3930ee;_0x545f95++){var _0x397415=events[_0x545f95];var _0x3a7dd7=createListener('smsInteraction:'+_0x397415,_0x32dc72);SmsInteractionEvents['on'](_0x397415,_0x3a7dd7);}}; \ No newline at end of file +var _0x317c=['remove','emit','removeListener','register','smsInteraction:','./smsInteraction.events','save'];(function(_0x5dc97a,_0x53c33e){var _0x1e6e05=function(_0x46c0d9){while(--_0x46c0d9){_0x5dc97a['push'](_0x5dc97a['shift']());}};_0x1e6e05(++_0x53c33e);}(_0x317c,0x1a9));var _0xc317=function(_0x3fb9d0,_0x1b4a64){_0x3fb9d0=_0x3fb9d0-0x0;var _0x395a61=_0x317c[_0x3fb9d0];return _0x395a61;};'use strict';var SmsInteractionEvents=require(_0xc317('0x0'));var events=[_0xc317('0x1'),_0xc317('0x2'),'update'];function createListener(_0x40d941,_0x40736b){return function(_0x157b61){_0x40736b[_0xc317('0x3')](_0x40d941,_0x157b61);};}function removeListener(_0x5f55d5,_0x2468a4){return function(){SmsInteractionEvents[_0xc317('0x4')](_0x5f55d5,_0x2468a4);};}exports[_0xc317('0x5')]=function(_0x1444e9){for(var _0x5ea979=0x0,_0x107e67=events['length'];_0x5ea979<_0x107e67;_0x5ea979++){var _0x3ee30a=events[_0x5ea979];var _0x1b4acf=createListener(_0xc317('0x6')+_0x3ee30a,_0x1444e9);SmsInteractionEvents['on'](_0x3ee30a,_0x1b4acf);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index ad1cc60..d908830 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 _0x90ad=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','/describe','describe','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x12849e,_0x3f9cce){var _0xaec77b=function(_0x35ccb4){while(--_0x35ccb4){_0x12849e['push'](_0x12849e['shift']());}};_0xaec77b(++_0x3f9cce);}(_0x90ad,0x195));var _0xd90a=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x90ad[_0x2c0dc0];return _0x4c0990;};'use strict';var multer=require(_0xd90a('0x0'));var util=require(_0xd90a('0x1'));var path=require(_0xd90a('0x2'));var timeout=require(_0xd90a('0x3'));var express=require(_0xd90a('0x4'));var router=express['Router']();var fs_extra=require(_0xd90a('0x5'));var auth=require(_0xd90a('0x6'));var interaction=require(_0xd90a('0x7'));var config=require('../../config/environment');var controller=require(_0xd90a('0x8'));router['get']('/',auth[_0xd90a('0x9')](),controller[_0xd90a('0xa')]);router['get'](_0xd90a('0xb'),auth[_0xd90a('0x9')](),controller[_0xd90a('0xc')]);router['get']('/:id',auth[_0xd90a('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0xd90a('0xd')](_0xd90a('0xe'),_0xd90a('0xf')),controller[_0xd90a('0x10')]);router['post'](_0xd90a('0x11'),controller[_0xd90a('0x12')]);router[_0xd90a('0x13')](_0xd90a('0x14'),auth[_0xd90a('0x9')](),controller[_0xd90a('0x15')]);router[_0xd90a('0x13')](_0xd90a('0x16'),auth[_0xd90a('0x9')](),controller[_0xd90a('0x17')]);router['put'](_0xd90a('0x18'),auth[_0xd90a('0x9')](),controller[_0xd90a('0x19')]);router[_0xd90a('0x1a')](_0xd90a('0x14'),auth[_0xd90a('0x9')](),controller[_0xd90a('0x1b')]);module[_0xd90a('0x1c')]=router; \ No newline at end of file +var _0xeb83=['sms','smsmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked'];(function(_0x3daec5,_0x36b941){var _0x357bf3=function(_0x556a77){while(--_0x556a77){_0x3daec5['push'](_0x3daec5['shift']());}};_0x357bf3(++_0x36b941);}(_0xeb83,0xad));var _0x3eb8=function(_0x4f69b5,_0x170d14){_0x4f69b5=_0x4f69b5-0x0;var _0x299181=_0xeb83[_0x4f69b5];return _0x299181;};'use strict';var multer=require(_0x3eb8('0x0'));var util=require(_0x3eb8('0x1'));var path=require(_0x3eb8('0x2'));var timeout=require(_0x3eb8('0x3'));var express=require('express');var router=express[_0x3eb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3eb8('0x5'));var interaction=require(_0x3eb8('0x6'));var config=require(_0x3eb8('0x7'));var controller=require(_0x3eb8('0x8'));router[_0x3eb8('0x9')]('/',auth[_0x3eb8('0xa')](),controller[_0x3eb8('0xb')]);router[_0x3eb8('0x9')]('/describe',auth[_0x3eb8('0xa')](),controller[_0x3eb8('0xc')]);router[_0x3eb8('0x9')](_0x3eb8('0xd'),auth[_0x3eb8('0xa')](),controller['show']);router[_0x3eb8('0xe')]('/',auth[_0x3eb8('0xa')](),interaction[_0x3eb8('0xf')](_0x3eb8('0x10'),_0x3eb8('0x11')),controller[_0x3eb8('0x12')]);router[_0x3eb8('0xe')]('/:id/status',controller[_0x3eb8('0x13')]);router[_0x3eb8('0x14')](_0x3eb8('0xd'),auth[_0x3eb8('0xa')](),controller[_0x3eb8('0x15')]);router[_0x3eb8('0x14')](_0x3eb8('0x16'),auth[_0x3eb8('0xa')](),controller[_0x3eb8('0x17')]);router[_0x3eb8('0x14')](_0x3eb8('0x18'),auth['isAuthenticated'](),controller[_0x3eb8('0x19')]);router['delete'](_0x3eb8('0xd'),auth['isAuthenticated'](),controller[_0x3eb8('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 4ff4344..e255ba3 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 _0xcc62=['ENUM','out','STRING','sequelize','TEXT','BOOLEAN'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xcc62,0x10b));var _0x2cc6=function(_0x9311f8,_0x526261){_0x9311f8=_0x9311f8-0x0;var _0x40894b=_0xcc62[_0x9311f8];return _0x40894b;};'use strict';var Sequelize=require(_0x2cc6('0x0'));module['exports']={'body':{'type':Sequelize[_0x2cc6('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2cc6('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2cc6('0x3')]('in','out'),'defaultValue':_0x2cc6('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x2cc6('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x2cc6('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2cc6('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa03c=['STRING','DATE','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x37539d,_0x1b2924){var _0x1bc044=function(_0x1370c5){while(--_0x1370c5){_0x37539d['push'](_0x37539d['shift']());}};_0x1bc044(++_0x1b2924);}(_0xa03c,0x16a));var _0xca03=function(_0x4b128a,_0x5c2588){_0x4b128a=_0x4b128a-0x0;var _0x382d3c=_0xa03c[_0x4b128a];return _0x382d3c;};'use strict';var Sequelize=require('sequelize');module[_0xca03('0x0')]={'body':{'type':Sequelize[_0xca03('0x1')](_0xca03('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xca03('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xca03('0x4')]('in',_0xca03('0x5')),'defaultValue':_0xca03('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xca03('0x6')](0xbe)},'phone':{'type':Sequelize[_0xca03('0x6')]},'readAt':{'type':Sequelize[_0xca03('0x7')]},'secret':{'type':Sequelize[_0xca03('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xca03('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 691d0e2..336ca3d 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 _0xf1d4=['findAll','rows','fields','length','find','create','body','params','destroy','describe','../../config/logger','readAt','format','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','sms-interactions','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','rejectmessage','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','request','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','end','offset','undefined','count','set','json','reject','save','update','then','sendStatus','stack','name','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','options','includeAll','include'];(function(_0x479d88,_0x193fa7){var _0x469923=function(_0x544155){while(--_0x544155){_0x479d88['push'](_0x479d88['shift']());}};_0x469923(++_0x193fa7);}(_0xf1d4,0x158));var _0x4f1d=function(_0x5e1e42,_0x5359e9){_0x5e1e42=_0x5e1e42-0x0;var _0x33aa70=_0xf1d4[_0x5e1e42];return _0x33aa70;};'use strict';var emlformat=require(_0x4f1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f1d('0x2'));var moment=require(_0x4f1d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4f1d('0x4'));var util=require(_0x4f1d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4f1d('0x6'));var ejs=require(_0x4f1d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f1d('0x8'));var squel=require(_0x4f1d('0x9'));var crypto=require(_0x4f1d('0xa'));var jsforce=require(_0x4f1d('0xb'));var deskjs=require(_0x4f1d('0xc'));var toCsv=require(_0x4f1d('0x6'));var querystring=require(_0x4f1d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4f1d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4f1d('0xf'));var hardwareService=require(_0x4f1d('0x10'));var logger=require('../../config/logger')(_0x4f1d('0x11'));var utils=require(_0x4f1d('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f1d('0x13'))['db'];config['redis']=_[_0x4f1d('0x14')](config[_0x4f1d('0x15')],{'host':_0x4f1d('0x16'),'port':0x18eb});var socket=require(_0x4f1d('0x17'))(new Redis(config[_0x4f1d('0x15')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x4f1d('0x18'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x4f1d('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5081e3,_0x46aa61,_0x590ba4,_0x3e9e79){return new BPromise(function(_0x53a39f,_0x2e8bc7){var _0x85a4b5=_0x3e9e79||client;return _0x85a4b5[_0x4f1d('0x1a')](_0x5081e3,_0x590ba4)['then'](function(_0x1d418b){logger[_0x4f1d('0x1b')](_0x4f1d('0x1c'),_0x46aa61,'request\x20sent');logger[_0x4f1d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x46aa61,_0x4f1d('0x1e'),JSON['stringify'](_0x1d418b));if(_0x1d418b[_0x4f1d('0x1f')]){if(_0x1d418b['error'][_0x4f1d('0x20')]===0x1f4){logger[_0x4f1d('0x1f')](_0x4f1d('0x1c'),_0x46aa61,_0x1d418b[_0x4f1d('0x1f')][_0x4f1d('0x21')]);return _0x2e8bc7(_0x1d418b[_0x4f1d('0x1f')]['message']);}logger[_0x4f1d('0x1f')](_0x4f1d('0x1c'),_0x46aa61,_0x1d418b[_0x4f1d('0x1f')][_0x4f1d('0x21')]);return _0x53a39f(_0x1d418b['error'][_0x4f1d('0x21')]);}else{logger[_0x4f1d('0x1b')]('SmsMessage,\x20%s,\x20%s',_0x46aa61,_0x4f1d('0x1e'));_0x53a39f(_0x1d418b[_0x4f1d('0x22')][_0x4f1d('0x21')]);}})[_0x4f1d('0x23')](function(_0x3fd3dc){logger[_0x4f1d('0x1f')]('SmsMessage,\x20%s,\x20%s',_0x46aa61,_0x3fd3dc);_0x2e8bc7(_0x3fd3dc);});});}function respondWithStatusCode(_0x21bdad,_0x22a201){_0x22a201=_0x22a201||0xcc;return function(_0x4f7431){if(_0x4f7431){return _0x21bdad['sendStatus'](_0x22a201);}return _0x21bdad[_0x4f1d('0x24')](_0x22a201)[_0x4f1d('0x25')]();};}function respondWithResult(_0x14a8bf,_0x114673){_0x114673=_0x114673||0xc8;return function(_0x4d43ca){if(_0x4d43ca){return _0x14a8bf[_0x4f1d('0x24')](_0x114673)['json'](_0x4d43ca);}};}function respondWithFilteredResult(_0x50625d,_0x4525eb){return function(_0xce9adf){if(_0xce9adf){var _0x4eabb0=typeof _0x4525eb[_0x4f1d('0x26')]==='undefined'&&typeof _0x4525eb['limit']===_0x4f1d('0x27');var _0x7894a6=_0xce9adf[_0x4f1d('0x28')];var _0x456618=_0x4eabb0?0x0:_0x4525eb[_0x4f1d('0x26')];var _0x446865=_0x4eabb0?_0xce9adf[_0x4f1d('0x28')]:_0x4525eb[_0x4f1d('0x26')]+_0x4525eb['limit'];var _0x2505ae;if(_0x446865>=_0x7894a6){_0x446865=_0x7894a6;_0x2505ae=0xc8;}else{_0x2505ae=0xce;}_0x50625d[_0x4f1d('0x24')](_0x2505ae);return _0x50625d[_0x4f1d('0x29')]('Content-Range',_0x456618+'-'+_0x446865+'/'+_0x7894a6)[_0x4f1d('0x2a')](_0xce9adf);}return null;};}function patchUpdates(_0x2614b2){return function(_0x498898){try{jsonpatch['apply'](_0x498898,_0x2614b2,!![]);}catch(_0x33e45e){return BPromise[_0x4f1d('0x2b')](_0x33e45e);}return _0x498898[_0x4f1d('0x2c')]();};}function saveUpdates(_0x4a3f37,_0x23008b){return function(_0x2f84a1){if(_0x2f84a1){return _0x2f84a1[_0x4f1d('0x2d')](_0x4a3f37)[_0x4f1d('0x2e')](function(_0x468186){return _0x468186;});}return null;};}function removeEntity(_0x5cf370,_0x964dfd){return function(_0x5ce2ef){if(_0x5ce2ef){return _0x5ce2ef['destroy']()[_0x4f1d('0x2e')](function(){_0x5cf370[_0x4f1d('0x24')](0xcc)[_0x4f1d('0x25')]();});}};}function handleEntityNotFound(_0x311fad,_0x467c9b){return function(_0x510adb){if(!_0x510adb){_0x311fad[_0x4f1d('0x2f')](0x194);}return _0x510adb;};}function handleError(_0x56d88a,_0xbed0ea){_0xbed0ea=_0xbed0ea||0x1f4;return function(_0x31dd93){logger[_0x4f1d('0x1f')](_0x31dd93[_0x4f1d('0x30')]);if(_0x31dd93[_0x4f1d('0x31')]){delete _0x31dd93[_0x4f1d('0x31')];}_0x56d88a[_0x4f1d('0x24')](_0xbed0ea)['send'](_0x31dd93);};}exports['index']=function(_0x4e3da6,_0x214869){var _0xb78f8d={},_0x1f1f5b={},_0x126c7d={'count':0x0,'rows':[]};var _0x534384=_[_0x4f1d('0x32')](db[_0x4f1d('0x33')][_0x4f1d('0x34')],function(_0x57622b){return{'name':_0x57622b[_0x4f1d('0x35')],'type':_0x57622b[_0x4f1d('0x36')][_0x4f1d('0x37')]};});_0x1f1f5b[_0x4f1d('0x38')]=_['map'](_0x534384,'name');_0x1f1f5b['query']=_[_0x4f1d('0x39')](_0x4e3da6[_0x4f1d('0x3a')]);_0x1f1f5b['filters']=_['intersection'](_0x1f1f5b[_0x4f1d('0x38')],_0x1f1f5b[_0x4f1d('0x3a')]);_0xb78f8d[_0x4f1d('0x3b')]=_[_0x4f1d('0x3c')](_0x1f1f5b[_0x4f1d('0x38')],qs['fields'](_0x4e3da6[_0x4f1d('0x3a')]['fields']));_0xb78f8d['attributes']=_0xb78f8d[_0x4f1d('0x3b')]['length']?_0xb78f8d[_0x4f1d('0x3b')]:_0x1f1f5b[_0x4f1d('0x38')];if(!_0x4e3da6[_0x4f1d('0x3a')][_0x4f1d('0x3d')](_0x4f1d('0x3e'))){_0xb78f8d[_0x4f1d('0x3f')]=qs['limit'](_0x4e3da6['query'][_0x4f1d('0x3f')]);_0xb78f8d[_0x4f1d('0x26')]=qs[_0x4f1d('0x26')](_0x4e3da6[_0x4f1d('0x3a')][_0x4f1d('0x26')]);}_0xb78f8d[_0x4f1d('0x40')]=qs[_0x4f1d('0x41')](_0x4e3da6['query'][_0x4f1d('0x41')]);_0xb78f8d[_0x4f1d('0x42')]=qs[_0x4f1d('0x43')](_[_0x4f1d('0x44')](_0x4e3da6[_0x4f1d('0x3a')],_0x1f1f5b[_0x4f1d('0x43')]),_0x534384);if(_0x4e3da6[_0x4f1d('0x3a')]['filter']){_0xb78f8d[_0x4f1d('0x42')]=_[_0x4f1d('0x45')](_0xb78f8d[_0x4f1d('0x42')],{'$or':_[_0x4f1d('0x32')](_0x534384,function(_0xb9c0e2){if(_0xb9c0e2[_0x4f1d('0x36')]!=='VIRTUAL'){var _0x33167a={};_0x33167a[_0xb9c0e2['name']]={'$like':'%'+_0x4e3da6[_0x4f1d('0x3a')]['filter']+'%'};return _0x33167a;}})});}_0xb78f8d=_['merge']({},_0xb78f8d,_0x4e3da6[_0x4f1d('0x46')]);var _0x431327={'where':_0xb78f8d[_0x4f1d('0x42')]};return db[_0x4f1d('0x33')][_0x4f1d('0x28')](_0x431327)[_0x4f1d('0x2e')](function(_0x44013a){_0x126c7d[_0x4f1d('0x28')]=_0x44013a;if(_0x4e3da6[_0x4f1d('0x3a')][_0x4f1d('0x47')]){_0xb78f8d[_0x4f1d('0x48')]=[{'all':!![]}];}return db[_0x4f1d('0x33')][_0x4f1d('0x49')](_0xb78f8d);})['then'](function(_0x4bb00f){_0x126c7d[_0x4f1d('0x4a')]=_0x4bb00f;return _0x126c7d;})[_0x4f1d('0x2e')](respondWithFilteredResult(_0x214869,_0xb78f8d))[_0x4f1d('0x23')](handleError(_0x214869,null));};exports['show']=function(_0x6a5568,_0x2ab294){var _0x971fdb={'raw':!![],'where':{'id':_0x6a5568['params']['id']}},_0x32d1f3={};_0x32d1f3[_0x4f1d('0x38')]=_[_0x4f1d('0x39')](db[_0x4f1d('0x33')][_0x4f1d('0x34')]);_0x32d1f3[_0x4f1d('0x3a')]=_['keys'](_0x6a5568[_0x4f1d('0x3a')]);_0x32d1f3[_0x4f1d('0x43')]=_[_0x4f1d('0x3c')](_0x32d1f3[_0x4f1d('0x38')],_0x32d1f3[_0x4f1d('0x3a')]);_0x971fdb[_0x4f1d('0x3b')]=_['intersection'](_0x32d1f3[_0x4f1d('0x38')],qs[_0x4f1d('0x4b')](_0x6a5568[_0x4f1d('0x3a')][_0x4f1d('0x4b')]));_0x971fdb['attributes']=_0x971fdb[_0x4f1d('0x3b')][_0x4f1d('0x4c')]?_0x971fdb[_0x4f1d('0x3b')]:_0x32d1f3[_0x4f1d('0x38')];if(_0x6a5568['query'][_0x4f1d('0x47')]){_0x971fdb[_0x4f1d('0x48')]=[{'all':!![]}];}_0x971fdb=_[_0x4f1d('0x45')]({},_0x971fdb,_0x6a5568[_0x4f1d('0x46')]);return db[_0x4f1d('0x33')][_0x4f1d('0x4d')](_0x971fdb)[_0x4f1d('0x2e')](handleEntityNotFound(_0x2ab294,null))[_0x4f1d('0x2e')](respondWithResult(_0x2ab294,null))['catch'](handleError(_0x2ab294,null));};exports[_0x4f1d('0x4e')]=function(_0x5a3aa1,_0x54a69e){return db[_0x4f1d('0x33')][_0x4f1d('0x4e')](_0x5a3aa1['body'],{})[_0x4f1d('0x2e')](respondWithResult(_0x54a69e,0xc9))[_0x4f1d('0x23')](handleError(_0x54a69e,null));};exports[_0x4f1d('0x2d')]=function(_0x57f9ef,_0x138030){if(_0x57f9ef[_0x4f1d('0x4f')]['id']){delete _0x57f9ef[_0x4f1d('0x4f')]['id'];}return db[_0x4f1d('0x33')][_0x4f1d('0x4d')]({'where':{'id':_0x57f9ef[_0x4f1d('0x50')]['id']}})['then'](handleEntityNotFound(_0x138030,null))['then'](saveUpdates(_0x57f9ef[_0x4f1d('0x4f')],null))['then'](respondWithResult(_0x138030,null))[_0x4f1d('0x23')](handleError(_0x138030,null));};exports[_0x4f1d('0x51')]=function(_0x4fadeb,_0x28f9e6){return db['SmsMessage'][_0x4f1d('0x4d')]({'where':{'id':_0x4fadeb['params']['id']}})['then'](handleEntityNotFound(_0x28f9e6,null))[_0x4f1d('0x2e')](removeEntity(_0x28f9e6,null))[_0x4f1d('0x23')](handleError(_0x28f9e6,null));};exports[_0x4f1d('0x52')]=function(_0x3453d3,_0x24bf61){return db[_0x4f1d('0x33')]['describe']()['then'](respondWithResult(_0x24bf61,null))[_0x4f1d('0x23')](handleError(_0x24bf61,null));};var interaction_log=require(_0x4f1d('0x53'))('sms-interactions');exports['accept']=function(_0x591b3d,_0x3fb623,_0x1db90c){var _0x5574b5={'agent':{},'channel':'sms'};if(_0x591b3d[_0x4f1d('0x4f')]['id']){delete _0x591b3d[_0x4f1d('0x4f')]['id'];}_0x591b3d['body']['read']=!![];_0x591b3d[_0x4f1d('0x4f')][_0x4f1d('0x54')]=moment()[_0x4f1d('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x591b3d['body'][_0x4f1d('0x56')]=_0x591b3d[_0x4f1d('0x4f')]['UserId']||_0x591b3d['user']['id'];_0x5574b5[_0x4f1d('0x57')]['id']=_0x591b3d[_0x4f1d('0x4f')][_0x4f1d('0x56')];return db[_0x4f1d('0x33')]['find']({'where':{'id':_0x591b3d[_0x4f1d('0x50')]['id'],'UserId':null}})[_0x4f1d('0x2e')](handleEntityNotFound(_0x3fb623,null))['then'](saveUpdates(_0x591b3d[_0x4f1d('0x4f')],null))[_0x4f1d('0x2e')](function(_0xea4681){if(_0xea4681){_0x5574b5['message']=_0xea4681[_0x4f1d('0x58')]({'plain':!![]});return db[_0x4f1d('0x59')]['find']({'where':{'id':_0xea4681[_0x4f1d('0x5a')]}});}return null;})[_0x4f1d('0x2e')](handleEntityNotFound(_0x3fb623,null))[_0x4f1d('0x2e')](function(_0x33330b){if(_0x33330b){return _0x33330b['update']({'UserId':_0x591b3d[_0x4f1d('0x4f')][_0x4f1d('0x56')],'read1stAt':_[_0x4f1d('0x5b')](_0x33330b[_0x4f1d('0x5c')])?moment()[_0x4f1d('0x55')](_0x4f1d('0x5d')):undefined});}return null;})[_0x4f1d('0x2e')](function(_0x5a36ff){if(_0x5a36ff){_0x5574b5[_0x4f1d('0x5e')]=_0x5a36ff[_0x4f1d('0x58')]({'plain':!![]});interaction_log[_0x4f1d('0x1b')](_0x4f1d('0x5f'),_0x591b3d[_0x4f1d('0x60')]['id'],_0x591b3d['user'][_0x4f1d('0x31')],_0x591b3d['user'][_0x4f1d('0x61')],_0x5574b5[_0x4f1d('0x5e')]['id'],_0x591b3d[_0x4f1d('0x4f')]?JSON[_0x4f1d('0x62')](_0x591b3d[_0x4f1d('0x4f')]):_0x4f1d('0x63'));return respondWithRpcPromise(_0x4f1d('0x64'),_0x4f1d('0x65'),_0x5574b5);}return null;})[_0x4f1d('0x2e')](function(_0x2a3676){var _0x46d9ae=_0x4f1d('0x66')+_0x2a3676[_0x4f1d('0x21')][_0x4f1d('0x67')];return db[_0x4f1d('0x68')][_0x4f1d('0x3a')](_0x46d9ae,{'type':db['Sequelize'][_0x4f1d('0x69')]['SELECT'],'raw':!![]})[_0x4f1d('0x2e')](function(_0x52f860){return _0x52f860;});})['then'](function(_0x9b7184){if(_0x9b7184){_0x5574b5[_0x4f1d('0x21')]['contact']=_0x9b7184[0x0];if(!_0x591b3d[_0x4f1d('0x4f')][_0x4f1d('0x56')])return;return db['User'][_0x4f1d('0x4d')]({'where':{'id':_0x591b3d['body'][_0x4f1d('0x56')],'role':_0x4f1d('0x57')},'attributes':['id',_0x4f1d('0x31'),_0x4f1d('0x6a'),_0x4f1d('0x6b'),_0x4f1d('0x6c')],'raw':!![]});}return null;})[_0x4f1d('0x2e')](function(_0x3c7d8a){if(!_0x3c7d8a)return null;_0x5574b5[_0x4f1d('0x21')][_0x4f1d('0x57')]=_0x3c7d8a;return _0x5574b5;})[_0x4f1d('0x2e')](function(_0x1d1d5c){if(_0x1d1d5c){if(_0x591b3d[_0x4f1d('0x4f')][_0x4f1d('0x6d')]){_0x5574b5[_0x4f1d('0x21')][_0x4f1d('0x6e')]=util['format'](_0x4f1d('0x6f'),_0x591b3d[_0x4f1d('0x60')][_0x4f1d('0x31')]);_0x5574b5[_0x4f1d('0x21')]['channel']=_0x5574b5['channel'];_0x5574b5[_0x4f1d('0x21')]['motionChannel']=_0x5574b5[_0x4f1d('0x70')];_0x5574b5[_0x4f1d('0x21')]['event']='accept';return respondWithRpcPromise(_0x4f1d('0x71'),_0x4f1d('0x71'),{'event':'acceptmessage','message':_0x5574b5[_0x4f1d('0x21')]},client9002)[_0x4f1d('0x2e')](function(){return _0x5574b5;});}return _0x5574b5;}return null;})[_0x4f1d('0x2e')](respondWithResult(_0x3fb623,null))[_0x4f1d('0x23')](handleError(_0x3fb623,null));};var interaction_log=require('../../config/logger')(_0x4f1d('0x72'));exports['reject']=function(_0x2b0cb6,_0x356872,_0x3beb96){var _0x1755d8={'agent':{},'channel':_0x4f1d('0x73')};if(_0x2b0cb6[_0x4f1d('0x4f')]['id']){delete _0x2b0cb6[_0x4f1d('0x4f')]['id'];}_0x2b0cb6[_0x4f1d('0x4f')][_0x4f1d('0x56')]=_0x2b0cb6[_0x4f1d('0x4f')][_0x4f1d('0x56')]||_0x2b0cb6[_0x4f1d('0x60')]['id'];_0x1755d8['agent']['id']=_0x2b0cb6[_0x4f1d('0x4f')][_0x4f1d('0x56')];return db['SmsMessage']['find']({'where':{'id':_0x2b0cb6[_0x4f1d('0x50')]['id'],'UserId':null}})[_0x4f1d('0x2e')](handleEntityNotFound(_0x356872,null))[_0x4f1d('0x2e')](function(_0x3b6fcd){if(_0x3b6fcd){_0x1755d8[_0x4f1d('0x21')]=_0x3b6fcd[_0x4f1d('0x58')]({'plain':!![]});return db['SmsInteraction'][_0x4f1d('0x4d')]({'where':{'id':_0x3b6fcd[_0x4f1d('0x5a')]}});}return null;})[_0x4f1d('0x2e')](handleEntityNotFound(_0x356872,null))[_0x4f1d('0x2e')](function(_0x14688d){if(_0x14688d){_0x1755d8[_0x4f1d('0x5e')]=_0x14688d[_0x4f1d('0x58')]({'plain':!![]});interaction_log[_0x4f1d('0x1b')](_0x4f1d('0x74'),_0x2b0cb6[_0x4f1d('0x60')]['id'],_0x2b0cb6[_0x4f1d('0x60')][_0x4f1d('0x31')],_0x2b0cb6['user'][_0x4f1d('0x61')],_0x1755d8[_0x4f1d('0x5e')]['id'],_0x2b0cb6['body']?JSON[_0x4f1d('0x62')](_0x2b0cb6[_0x4f1d('0x4f')]):'null');return respondWithRpcPromise(_0x4f1d('0x75'),_0x4f1d('0x76'),_0x1755d8);}return null;})[_0x4f1d('0x2e')](function(_0x55aac4){var _0xe3aa30='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55aac4[_0x4f1d('0x21')][_0x4f1d('0x67')];return db[_0x4f1d('0x68')][_0x4f1d('0x3a')](_0xe3aa30,{'type':db[_0x4f1d('0x77')][_0x4f1d('0x69')]['SELECT'],'raw':!![]})[_0x4f1d('0x2e')](function(_0xe33cbb){return _0xe33cbb;});})[_0x4f1d('0x2e')](function(_0x4d0b05){if(_0x4d0b05){_0x1755d8[_0x4f1d('0x21')][_0x4f1d('0x78')]=_0x4d0b05[0x0];if(!_0x2b0cb6[_0x4f1d('0x4f')]['UserId'])return;return db['User'][_0x4f1d('0x4d')]({'where':{'id':_0x2b0cb6[_0x4f1d('0x4f')]['UserId'],'role':_0x4f1d('0x57')},'attributes':['id',_0x4f1d('0x31'),_0x4f1d('0x6a'),_0x4f1d('0x6b'),_0x4f1d('0x6c')],'raw':!![]});}return null;})[_0x4f1d('0x2e')](function(_0x2facf6){if(!_0x2facf6)return null;_0x1755d8['message'][_0x4f1d('0x57')]=_0x2facf6;return _0x1755d8;})[_0x4f1d('0x2e')](function(_0x16124a){if(_0x16124a){_0x16124a[_0x4f1d('0x21')][_0x4f1d('0x6e')]=util[_0x4f1d('0x55')](_0x4f1d('0x6f'),_0x2b0cb6['user'][_0x4f1d('0x31')]);_0x16124a[_0x4f1d('0x21')]['channel']=_0x1755d8['channel'];_0x16124a[_0x4f1d('0x21')]['motionChannel']=_0x1755d8[_0x4f1d('0x70')];_0x16124a[_0x4f1d('0x21')]['event']=_0x4f1d('0x2b');respondWithRpcPromise('EventManager',_0x4f1d('0x71'),{'event':_0x4f1d('0x79'),'message':_0x16124a[_0x4f1d('0x21')]},client9002);return _0x1755d8;}return null;})['then'](respondWithResult(_0x356872,null))[_0x4f1d('0x23')](handleError(_0x356872,null));};exports[_0x4f1d('0x24')]=function(_0x2e9ad0,_0x11eae1,_0x3516c4){if(_0x2e9ad0[_0x4f1d('0x4f')]['id']){delete _0x2e9ad0[_0x4f1d('0x4f')]['id'];}var _0x39f0c4;return db['SmsMessage'][_0x4f1d('0x4d')]({'where':{'id':_0x2e9ad0[_0x4f1d('0x50')]['id']}})[_0x4f1d('0x2e')](handleEntityNotFound(_0x11eae1,null))[_0x4f1d('0x2e')](function(_0x21e701){if(_0x21e701){_0x39f0c4=_0x21e701;return db['SmsAccount']['find']({'where':{'id':_0x21e701[_0x4f1d('0x7a')]}});}})['then'](handleEntityNotFound(_0x11eae1,null))[_0x4f1d('0x2e')](function(_0xc68a3c){if(_0xc68a3c){logger[_0x4f1d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f1d('0x24'),'received\x20delivery\x20report\x20from',_0xc68a3c[_0x4f1d('0x36')],util[_0x4f1d('0x7b')](_0x2e9ad0[_0x4f1d('0x4f')],{'showHidden':![],'depth':null}));switch(_0xc68a3c['type']){case'twilio':if(_0x2e9ad0['body'][_0x4f1d('0x7c')]&&_0x2e9ad0['body'][_0x4f1d('0x7c')]===_0x39f0c4[_0x4f1d('0x7d')]){return _0x39f0c4[_0x4f1d('0x2d')]({'read':!![]});}else{logger['error'](_0x4f1d('0x7e'),_0x4f1d('0x24'),_0x4f1d('0x7f'),util[_0x4f1d('0x7b')](_0x2e9ad0['body'],{'showHidden':![],'depth':null}));}break;case _0x4f1d('0x80'):if(_0x2e9ad0[_0x4f1d('0x4f')][_0x4f1d('0x81')]&&_0x2e9ad0[_0x4f1d('0x4f')][_0x4f1d('0x81')]===_0x39f0c4[_0x4f1d('0x7d')]&&_[_0x4f1d('0x82')]([_0x4f1d('0x83'),_0x4f1d('0x84')],_0x2e9ad0[_0x4f1d('0x4f')][_0x4f1d('0x85')])>=0x0){return _0x39f0c4[_0x4f1d('0x2d')]({'read':!![]});}else{logger['error'](_0x4f1d('0x7e'),_0x4f1d('0x24'),_0x4f1d('0x86'),util[_0x4f1d('0x7b')](_0x2e9ad0['body'],{'showHidden':![],'depth':null}));}break;case _0x4f1d('0x87'):var _0x285ed8=_0x2e9ad0['body'][_0x4f1d('0x88')][0x0];if(_0x285ed8['status'][_0x4f1d('0x89')]===_0x4f1d('0x8a')){return _0x39f0c4[_0x4f1d('0x2d')]({'read':!![]});}else{logger[_0x4f1d('0x1f')](_0x4f1d('0x7e'),_0x4f1d('0x24'),'infobip',util[_0x4f1d('0x7b')](_0x2e9ad0[_0x4f1d('0x4f')],{'showHidden':![],'depth':null}));}break;}return _0x39f0c4;}})[_0x4f1d('0x2e')](respondWithResult(_0x11eae1,null))[_0x4f1d('0x23')](handleError(_0x11eae1,null));}; \ No newline at end of file +var _0xfa94=['Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsMessage','findAll','show','params','rawAttributes','body','find','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteraction','SmsInteractionId','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','reject','rejectmessage','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','DELIVERED','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count'];(function(_0x1d7466,_0x161771){var _0x3ebbb6=function(_0x2044f6){while(--_0x2044f6){_0x1d7466['push'](_0x1d7466['shift']());}};_0x3ebbb6(++_0x161771);}(_0xfa94,0xef));var _0x4fa9=function(_0x51b80a,_0x355fe3){_0x51b80a=_0x51b80a-0x0;var _0x22fdf0=_0xfa94[_0x51b80a];return _0x22fdf0;};'use strict';var emlformat=require(_0x4fa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4fa9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4fa9('0x2'));var moment=require(_0x4fa9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4fa9('0x4'));var util=require(_0x4fa9('0x5'));var path=require(_0x4fa9('0x6'));var sox=require(_0x4fa9('0x7'));var csv=require(_0x4fa9('0x8'));var ejs=require(_0x4fa9('0x9'));var fs=require('fs');var fs_extra=require(_0x4fa9('0xa'));var _=require('lodash');var squel=require(_0x4fa9('0xb'));var crypto=require(_0x4fa9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4fa9('0x8'));var querystring=require('querystring');var Papa=require(_0x4fa9('0xd'));var Redis=require(_0x4fa9('0xe'));var authService=require(_0x4fa9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4fa9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fa9('0x11'))(_0x4fa9('0x12'));var utils=require('../../config/utils');var config=require(_0x4fa9('0x13'));var licenseUtil=require(_0x4fa9('0x14'));var db=require(_0x4fa9('0x15'))['db'];config['redis']=_[_0x4fa9('0x16')](config['redis'],{'host':_0x4fa9('0x17'),'port':0x18eb});var socket=require(_0x4fa9('0x18'))(new Redis(config['redis']));require(_0x4fa9('0x19'))[_0x4fa9('0x1a')](socket);var jayson=require(_0x4fa9('0x1b'));var client=jayson[_0x4fa9('0x1c')][_0x4fa9('0x1d')]({'port':0x232c});var client9002=jayson[_0x4fa9('0x1c')][_0x4fa9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2c28be,_0x328770,_0x4ef6d8,_0x19ea1b){return new BPromise(function(_0x1a1117,_0x4c164f){var _0x56cf7d=_0x19ea1b||client;return _0x56cf7d[_0x4fa9('0x1e')](_0x2c28be,_0x4ef6d8)['then'](function(_0x2fe920){logger[_0x4fa9('0x1f')]('SmsMessage,\x20%s,\x20%s',_0x328770,_0x4fa9('0x20'));logger['debug'](_0x4fa9('0x21'),_0x328770,_0x4fa9('0x20'),JSON[_0x4fa9('0x22')](_0x2fe920));if(_0x2fe920[_0x4fa9('0x23')]){if(_0x2fe920[_0x4fa9('0x23')]['code']===0x1f4){logger[_0x4fa9('0x23')](_0x4fa9('0x24'),_0x328770,_0x2fe920[_0x4fa9('0x23')]['message']);return _0x4c164f(_0x2fe920[_0x4fa9('0x23')][_0x4fa9('0x25')]);}logger[_0x4fa9('0x23')](_0x4fa9('0x24'),_0x328770,_0x2fe920[_0x4fa9('0x23')][_0x4fa9('0x25')]);return _0x1a1117(_0x2fe920[_0x4fa9('0x23')][_0x4fa9('0x25')]);}else{logger[_0x4fa9('0x1f')](_0x4fa9('0x24'),_0x328770,_0x4fa9('0x20'));_0x1a1117(_0x2fe920[_0x4fa9('0x26')][_0x4fa9('0x25')]);}})[_0x4fa9('0x27')](function(_0x1d00c9){logger[_0x4fa9('0x23')](_0x4fa9('0x24'),_0x328770,_0x1d00c9);_0x4c164f(_0x1d00c9);});});}function respondWithStatusCode(_0x1e5836,_0x1fe8ba){_0x1fe8ba=_0x1fe8ba||0xcc;return function(_0x31a3fb){if(_0x31a3fb){return _0x1e5836['sendStatus'](_0x1fe8ba);}return _0x1e5836[_0x4fa9('0x28')](_0x1fe8ba)[_0x4fa9('0x29')]();};}function respondWithResult(_0x12f169,_0xdeffbf){_0xdeffbf=_0xdeffbf||0xc8;return function(_0x9bc956){if(_0x9bc956){return _0x12f169[_0x4fa9('0x28')](_0xdeffbf)[_0x4fa9('0x2a')](_0x9bc956);}};}function respondWithFilteredResult(_0x5545b9,_0x384d4e){return function(_0x1185df){if(_0x1185df){var _0x13cf76=typeof _0x384d4e[_0x4fa9('0x2b')]===_0x4fa9('0x2c')&&typeof _0x384d4e[_0x4fa9('0x2d')]===_0x4fa9('0x2c');var _0x2f7d40=_0x1185df[_0x4fa9('0x2e')];var _0x472173=_0x13cf76?0x0:_0x384d4e[_0x4fa9('0x2b')];var _0x8aae26=_0x13cf76?_0x1185df[_0x4fa9('0x2e')]:_0x384d4e[_0x4fa9('0x2b')]+_0x384d4e[_0x4fa9('0x2d')];var _0x1fa94e;if(_0x8aae26>=_0x2f7d40){_0x8aae26=_0x2f7d40;_0x1fa94e=0xc8;}else{_0x1fa94e=0xce;}_0x5545b9[_0x4fa9('0x28')](_0x1fa94e);return _0x5545b9['set'](_0x4fa9('0x2f'),_0x472173+'-'+_0x8aae26+'/'+_0x2f7d40)[_0x4fa9('0x2a')](_0x1185df);}return null;};}function patchUpdates(_0x224297){return function(_0x96945){try{jsonpatch[_0x4fa9('0x30')](_0x96945,_0x224297,!![]);}catch(_0x357bd3){return BPromise['reject'](_0x357bd3);}return _0x96945[_0x4fa9('0x31')]();};}function saveUpdates(_0x2fe7d3,_0x3f8846){return function(_0x515ba3){if(_0x515ba3){return _0x515ba3[_0x4fa9('0x32')](_0x2fe7d3)['then'](function(_0x5813be){return _0x5813be;});}return null;};}function removeEntity(_0xa8e93e,_0x591844){return function(_0x3d5739){if(_0x3d5739){return _0x3d5739[_0x4fa9('0x33')]()[_0x4fa9('0x34')](function(){_0xa8e93e[_0x4fa9('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa0533f,_0x3449bb){return function(_0x3e1e6a){if(!_0x3e1e6a){_0xa0533f['sendStatus'](0x194);}return _0x3e1e6a;};}function handleError(_0xb56ddd,_0x450f06){_0x450f06=_0x450f06||0x1f4;return function(_0x30557e){logger[_0x4fa9('0x23')](_0x30557e[_0x4fa9('0x35')]);if(_0x30557e[_0x4fa9('0x36')]){delete _0x30557e[_0x4fa9('0x36')];}_0xb56ddd[_0x4fa9('0x28')](_0x450f06)[_0x4fa9('0x37')](_0x30557e);};}exports[_0x4fa9('0x38')]=function(_0x2781d5,_0x828dc1){var _0x581aaa={},_0x4022fd={},_0x4cf490={'count':0x0,'rows':[]};var _0x5c89c5=_[_0x4fa9('0x39')](db['SmsMessage']['rawAttributes'],function(_0x4b05a6){return{'name':_0x4b05a6[_0x4fa9('0x3a')],'type':_0x4b05a6[_0x4fa9('0x3b')]['key']};});_0x4022fd[_0x4fa9('0x3c')]=_['map'](_0x5c89c5,'name');_0x4022fd[_0x4fa9('0x3d')]=_[_0x4fa9('0x3e')](_0x2781d5[_0x4fa9('0x3d')]);_0x4022fd[_0x4fa9('0x3f')]=_[_0x4fa9('0x40')](_0x4022fd[_0x4fa9('0x3c')],_0x4022fd[_0x4fa9('0x3d')]);_0x581aaa['attributes']=_['intersection'](_0x4022fd[_0x4fa9('0x3c')],qs['fields'](_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x41')]));_0x581aaa[_0x4fa9('0x42')]=_0x581aaa[_0x4fa9('0x42')]['length']?_0x581aaa[_0x4fa9('0x42')]:_0x4022fd['model'];if(!_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x43')](_0x4fa9('0x44'))){_0x581aaa[_0x4fa9('0x2d')]=qs[_0x4fa9('0x2d')](_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x2d')]);_0x581aaa[_0x4fa9('0x2b')]=qs['offset'](_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x2b')]);}_0x581aaa[_0x4fa9('0x45')]=qs['sort'](_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x46')]);_0x581aaa[_0x4fa9('0x47')]=qs[_0x4fa9('0x3f')](_[_0x4fa9('0x48')](_0x2781d5[_0x4fa9('0x3d')],_0x4022fd[_0x4fa9('0x3f')]),_0x5c89c5);if(_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x49')]){_0x581aaa[_0x4fa9('0x47')]=_[_0x4fa9('0x4a')](_0x581aaa[_0x4fa9('0x47')],{'$or':_['map'](_0x5c89c5,function(_0x7addd3){if(_0x7addd3[_0x4fa9('0x3b')]!==_0x4fa9('0x4b')){var _0x168da7={};_0x168da7[_0x7addd3[_0x4fa9('0x36')]]={'$like':'%'+_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x49')]+'%'};return _0x168da7;}})});}_0x581aaa=_[_0x4fa9('0x4a')]({},_0x581aaa,_0x2781d5[_0x4fa9('0x4c')]);var _0x1261e9={'where':_0x581aaa[_0x4fa9('0x47')]};return db['SmsMessage']['count'](_0x1261e9)[_0x4fa9('0x34')](function(_0x53113e){_0x4cf490[_0x4fa9('0x2e')]=_0x53113e;if(_0x2781d5[_0x4fa9('0x3d')][_0x4fa9('0x4d')]){_0x581aaa[_0x4fa9('0x4e')]=[{'all':!![]}];}return db[_0x4fa9('0x4f')][_0x4fa9('0x50')](_0x581aaa);})['then'](function(_0x569123){_0x4cf490['rows']=_0x569123;return _0x4cf490;})[_0x4fa9('0x34')](respondWithFilteredResult(_0x828dc1,_0x581aaa))['catch'](handleError(_0x828dc1,null));};exports[_0x4fa9('0x51')]=function(_0x374c4b,_0x2cc580){var _0x12a746={'raw':!![],'where':{'id':_0x374c4b[_0x4fa9('0x52')]['id']}},_0x5c1b21={};_0x5c1b21[_0x4fa9('0x3c')]=_['keys'](db[_0x4fa9('0x4f')][_0x4fa9('0x53')]);_0x5c1b21[_0x4fa9('0x3d')]=_[_0x4fa9('0x3e')](_0x374c4b[_0x4fa9('0x3d')]);_0x5c1b21[_0x4fa9('0x3f')]=_['intersection'](_0x5c1b21['model'],_0x5c1b21[_0x4fa9('0x3d')]);_0x12a746['attributes']=_[_0x4fa9('0x40')](_0x5c1b21[_0x4fa9('0x3c')],qs[_0x4fa9('0x41')](_0x374c4b[_0x4fa9('0x3d')][_0x4fa9('0x41')]));_0x12a746[_0x4fa9('0x42')]=_0x12a746[_0x4fa9('0x42')]['length']?_0x12a746[_0x4fa9('0x42')]:_0x5c1b21['model'];if(_0x374c4b[_0x4fa9('0x3d')][_0x4fa9('0x4d')]){_0x12a746[_0x4fa9('0x4e')]=[{'all':!![]}];}_0x12a746=_[_0x4fa9('0x4a')]({},_0x12a746,_0x374c4b[_0x4fa9('0x4c')]);return db[_0x4fa9('0x4f')]['find'](_0x12a746)['then'](handleEntityNotFound(_0x2cc580,null))['then'](respondWithResult(_0x2cc580,null))[_0x4fa9('0x27')](handleError(_0x2cc580,null));};exports['create']=function(_0x153776,_0x7aaf3c){return db[_0x4fa9('0x4f')]['create'](_0x153776['body'],{})['then'](respondWithResult(_0x7aaf3c,0xc9))['catch'](handleError(_0x7aaf3c,null));};exports[_0x4fa9('0x32')]=function(_0x4e75d3,_0xfbf320){if(_0x4e75d3['body']['id']){delete _0x4e75d3[_0x4fa9('0x54')]['id'];}return db[_0x4fa9('0x4f')][_0x4fa9('0x55')]({'where':{'id':_0x4e75d3[_0x4fa9('0x52')]['id']}})[_0x4fa9('0x34')](handleEntityNotFound(_0xfbf320,null))[_0x4fa9('0x34')](saveUpdates(_0x4e75d3[_0x4fa9('0x54')],null))[_0x4fa9('0x34')](respondWithResult(_0xfbf320,null))[_0x4fa9('0x27')](handleError(_0xfbf320,null));};exports[_0x4fa9('0x33')]=function(_0x366f69,_0x304a69){return db['SmsMessage'][_0x4fa9('0x55')]({'where':{'id':_0x366f69[_0x4fa9('0x52')]['id']}})[_0x4fa9('0x34')](handleEntityNotFound(_0x304a69,null))[_0x4fa9('0x34')](removeEntity(_0x304a69,null))[_0x4fa9('0x27')](handleError(_0x304a69,null));};exports['describe']=function(_0x55bf91,_0x108bdc){return db[_0x4fa9('0x4f')][_0x4fa9('0x56')]()[_0x4fa9('0x34')](respondWithResult(_0x108bdc,null))[_0x4fa9('0x27')](handleError(_0x108bdc,null));};var interaction_log=require(_0x4fa9('0x11'))('sms-interactions');exports[_0x4fa9('0x57')]=function(_0x22a1f3,_0x41466f,_0x9e8bc0){var _0x3512a4={'agent':{},'channel':'sms'};if(_0x22a1f3[_0x4fa9('0x54')]['id']){delete _0x22a1f3[_0x4fa9('0x54')]['id'];}_0x22a1f3[_0x4fa9('0x54')][_0x4fa9('0x58')]=!![];_0x22a1f3['body'][_0x4fa9('0x59')]=moment()[_0x4fa9('0x5a')](_0x4fa9('0x5b'));_0x22a1f3[_0x4fa9('0x54')][_0x4fa9('0x5c')]=_0x22a1f3[_0x4fa9('0x54')]['UserId']||_0x22a1f3[_0x4fa9('0x5d')]['id'];_0x3512a4['agent']['id']=_0x22a1f3[_0x4fa9('0x54')][_0x4fa9('0x5c')];return db[_0x4fa9('0x4f')][_0x4fa9('0x55')]({'where':{'id':_0x22a1f3['params']['id'],'UserId':null}})[_0x4fa9('0x34')](handleEntityNotFound(_0x41466f,null))[_0x4fa9('0x34')](saveUpdates(_0x22a1f3[_0x4fa9('0x54')],null))[_0x4fa9('0x34')](function(_0x58158e){if(_0x58158e){_0x3512a4[_0x4fa9('0x25')]=_0x58158e['get']({'plain':!![]});return db[_0x4fa9('0x5e')][_0x4fa9('0x55')]({'where':{'id':_0x58158e[_0x4fa9('0x5f')]}});}return null;})[_0x4fa9('0x34')](handleEntityNotFound(_0x41466f,null))[_0x4fa9('0x34')](function(_0x121d50){if(_0x121d50){return _0x121d50[_0x4fa9('0x32')]({'UserId':_0x22a1f3[_0x4fa9('0x54')][_0x4fa9('0x5c')],'read1stAt':_['isNil'](_0x121d50[_0x4fa9('0x60')])?moment()['format'](_0x4fa9('0x5b')):undefined});}return null;})['then'](function(_0x277b27){if(_0x277b27){_0x3512a4[_0x4fa9('0x61')]=_0x277b27[_0x4fa9('0x62')]({'plain':!![]});interaction_log[_0x4fa9('0x1f')](_0x4fa9('0x63'),_0x22a1f3[_0x4fa9('0x5d')]['id'],_0x22a1f3[_0x4fa9('0x5d')][_0x4fa9('0x36')],_0x22a1f3[_0x4fa9('0x5d')][_0x4fa9('0x64')],_0x3512a4[_0x4fa9('0x61')]['id'],_0x22a1f3[_0x4fa9('0x54')]?JSON[_0x4fa9('0x22')](_0x22a1f3[_0x4fa9('0x54')]):_0x4fa9('0x65'));return respondWithRpcPromise(_0x4fa9('0x66'),_0x4fa9('0x67'),_0x3512a4);}return null;})[_0x4fa9('0x34')](function(_0x2c7b7){var _0x105d74=_0x4fa9('0x68')+_0x2c7b7[_0x4fa9('0x25')][_0x4fa9('0x69')];return db[_0x4fa9('0x6a')][_0x4fa9('0x3d')](_0x105d74,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x5bdfbf){return _0x5bdfbf;});})['then'](function(_0x444039){if(_0x444039){_0x3512a4[_0x4fa9('0x25')][_0x4fa9('0x6b')]=_0x444039[0x0];if(!_0x22a1f3[_0x4fa9('0x54')]['UserId'])return;return db[_0x4fa9('0x6c')][_0x4fa9('0x55')]({'where':{'id':_0x22a1f3[_0x4fa9('0x54')]['UserId'],'role':_0x4fa9('0x6d')},'attributes':['id',_0x4fa9('0x36'),_0x4fa9('0x6e'),_0x4fa9('0x6f'),_0x4fa9('0x70')],'raw':!![]});}return null;})[_0x4fa9('0x34')](function(_0x47bd03){if(!_0x47bd03)return null;_0x3512a4[_0x4fa9('0x25')]['agent']=_0x47bd03;return _0x3512a4;})[_0x4fa9('0x34')](function(_0x1817a8){if(_0x1817a8){if(_0x22a1f3['body'][_0x4fa9('0x71')]){_0x3512a4[_0x4fa9('0x25')][_0x4fa9('0x72')]=util['format']('SIP/%s',_0x22a1f3[_0x4fa9('0x5d')][_0x4fa9('0x36')]);_0x3512a4[_0x4fa9('0x25')][_0x4fa9('0x73')]=_0x3512a4['channel'];_0x3512a4[_0x4fa9('0x25')][_0x4fa9('0x74')]=_0x3512a4[_0x4fa9('0x73')];_0x3512a4['message'][_0x4fa9('0x75')]=_0x4fa9('0x57');return respondWithRpcPromise(_0x4fa9('0x76'),'EventManager',{'event':_0x4fa9('0x77'),'message':_0x3512a4['message']},client9002)[_0x4fa9('0x34')](function(){return _0x3512a4;});}return _0x3512a4;}return null;})[_0x4fa9('0x34')](respondWithResult(_0x41466f,null))[_0x4fa9('0x27')](handleError(_0x41466f,null));};var interaction_log=require(_0x4fa9('0x11'))(_0x4fa9('0x78'));exports['reject']=function(_0x5c9806,_0x45f169,_0x3cae67){var _0xaf03dc={'agent':{},'channel':_0x4fa9('0x79')};if(_0x5c9806[_0x4fa9('0x54')]['id']){delete _0x5c9806['body']['id'];}_0x5c9806['body'][_0x4fa9('0x5c')]=_0x5c9806[_0x4fa9('0x54')][_0x4fa9('0x5c')]||_0x5c9806[_0x4fa9('0x5d')]['id'];_0xaf03dc[_0x4fa9('0x6d')]['id']=_0x5c9806[_0x4fa9('0x54')]['UserId'];return db[_0x4fa9('0x4f')][_0x4fa9('0x55')]({'where':{'id':_0x5c9806[_0x4fa9('0x52')]['id'],'UserId':null}})[_0x4fa9('0x34')](handleEntityNotFound(_0x45f169,null))[_0x4fa9('0x34')](function(_0x1ffa0b){if(_0x1ffa0b){_0xaf03dc[_0x4fa9('0x25')]=_0x1ffa0b[_0x4fa9('0x62')]({'plain':!![]});return db[_0x4fa9('0x5e')][_0x4fa9('0x55')]({'where':{'id':_0x1ffa0b[_0x4fa9('0x5f')]}});}return null;})[_0x4fa9('0x34')](handleEntityNotFound(_0x45f169,null))[_0x4fa9('0x34')](function(_0x2713db){if(_0x2713db){_0xaf03dc[_0x4fa9('0x61')]=_0x2713db[_0x4fa9('0x62')]({'plain':!![]});interaction_log[_0x4fa9('0x1f')](_0x4fa9('0x7a'),_0x5c9806['user']['id'],_0x5c9806['user'][_0x4fa9('0x36')],_0x5c9806[_0x4fa9('0x5d')][_0x4fa9('0x64')],_0xaf03dc[_0x4fa9('0x61')]['id'],_0x5c9806[_0x4fa9('0x54')]?JSON[_0x4fa9('0x22')](_0x5c9806[_0x4fa9('0x54')]):_0x4fa9('0x65'));return respondWithRpcPromise(_0x4fa9('0x7b'),_0x4fa9('0x7c'),_0xaf03dc);}return null;})[_0x4fa9('0x34')](function(_0x424f7a){var _0x124c5e=_0x4fa9('0x68')+_0x424f7a['message'][_0x4fa9('0x69')];return db[_0x4fa9('0x6a')][_0x4fa9('0x3d')](_0x124c5e,{'type':db[_0x4fa9('0x7d')]['QueryTypes'][_0x4fa9('0x7e')],'raw':!![]})[_0x4fa9('0x34')](function(_0x21e41d){return _0x21e41d;});})[_0x4fa9('0x34')](function(_0x4135c6){if(_0x4135c6){_0xaf03dc[_0x4fa9('0x25')][_0x4fa9('0x6b')]=_0x4135c6[0x0];if(!_0x5c9806[_0x4fa9('0x54')]['UserId'])return;return db[_0x4fa9('0x6c')]['find']({'where':{'id':_0x5c9806[_0x4fa9('0x54')][_0x4fa9('0x5c')],'role':_0x4fa9('0x6d')},'attributes':['id',_0x4fa9('0x36'),_0x4fa9('0x6e'),_0x4fa9('0x6f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3d5b2c){if(!_0x3d5b2c)return null;_0xaf03dc[_0x4fa9('0x25')][_0x4fa9('0x6d')]=_0x3d5b2c;return _0xaf03dc;})[_0x4fa9('0x34')](function(_0x554154){if(_0x554154){_0x554154[_0x4fa9('0x25')][_0x4fa9('0x72')]=util[_0x4fa9('0x5a')]('SIP/%s',_0x5c9806[_0x4fa9('0x5d')][_0x4fa9('0x36')]);_0x554154[_0x4fa9('0x25')][_0x4fa9('0x73')]=_0xaf03dc['channel'];_0x554154[_0x4fa9('0x25')]['motionChannel']=_0xaf03dc['channel'];_0x554154[_0x4fa9('0x25')][_0x4fa9('0x75')]=_0x4fa9('0x7f');respondWithRpcPromise('EventManager',_0x4fa9('0x76'),{'event':_0x4fa9('0x80'),'message':_0x554154[_0x4fa9('0x25')]},client9002);return _0xaf03dc;}return null;})[_0x4fa9('0x34')](respondWithResult(_0x45f169,null))[_0x4fa9('0x27')](handleError(_0x45f169,null));};exports[_0x4fa9('0x28')]=function(_0x3e7e5c,_0x9a59be,_0x5f445c){if(_0x3e7e5c[_0x4fa9('0x54')]['id']){delete _0x3e7e5c[_0x4fa9('0x54')]['id'];}var _0x3867c0;return db[_0x4fa9('0x4f')]['find']({'where':{'id':_0x3e7e5c[_0x4fa9('0x52')]['id']}})['then'](handleEntityNotFound(_0x9a59be,null))[_0x4fa9('0x34')](function(_0x18e6f6){if(_0x18e6f6){_0x3867c0=_0x18e6f6;return db['SmsAccount'][_0x4fa9('0x55')]({'where':{'id':_0x18e6f6[_0x4fa9('0x81')]}});}})[_0x4fa9('0x34')](handleEntityNotFound(_0x9a59be,null))['then'](function(_0x44015d){if(_0x44015d){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fa9('0x28'),'received\x20delivery\x20report\x20from',_0x44015d[_0x4fa9('0x3b')],util[_0x4fa9('0x82')](_0x3e7e5c[_0x4fa9('0x54')],{'showHidden':![],'depth':null}));switch(_0x44015d[_0x4fa9('0x3b')]){case _0x4fa9('0x83'):if(_0x3e7e5c[_0x4fa9('0x54')][_0x4fa9('0x84')]&&_0x3e7e5c[_0x4fa9('0x54')][_0x4fa9('0x84')]===_0x3867c0[_0x4fa9('0x85')]){return _0x3867c0[_0x4fa9('0x32')]({'read':!![]});}else{logger[_0x4fa9('0x23')](_0x4fa9('0x86'),_0x4fa9('0x28'),_0x4fa9('0x83'),util[_0x4fa9('0x82')](_0x3e7e5c['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3e7e5c[_0x4fa9('0x54')][_0x4fa9('0x87')]&&_0x3e7e5c[_0x4fa9('0x54')][_0x4fa9('0x87')]===_0x3867c0[_0x4fa9('0x85')]&&_[_0x4fa9('0x88')]([_0x4fa9('0x89'),_0x4fa9('0x8a')],_0x3e7e5c[_0x4fa9('0x54')][_0x4fa9('0x8b')])>=0x0){return _0x3867c0[_0x4fa9('0x32')]({'read':!![]});}else{logger[_0x4fa9('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4fa9('0x8c'),util[_0x4fa9('0x82')](_0x3e7e5c[_0x4fa9('0x54')],{'showHidden':![],'depth':null}));}break;case _0x4fa9('0x8d'):var _0x381361=_0x3e7e5c[_0x4fa9('0x54')]['results'][0x0];if(_0x381361[_0x4fa9('0x28')]['groupName']===_0x4fa9('0x8e')){return _0x3867c0[_0x4fa9('0x32')]({'read':!![]});}else{logger[_0x4fa9('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4fa9('0x28'),'infobip',util[_0x4fa9('0x82')](_0x3e7e5c[_0x4fa9('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x3867c0;}})[_0x4fa9('0x34')](respondWithResult(_0x9a59be,null))[_0x4fa9('0x27')](handleError(_0x9a59be,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 7498ea6..b906a19 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 _0x4ece=['hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5131bb,_0x1bcd9c){var _0x1a497b=function(_0x740767){while(--_0x740767){_0x5131bb['push'](_0x5131bb['shift']());}};_0x1a497b(++_0x1bcd9c);}(_0x4ece,0xd3));var _0xe4ec=function(_0x309b5e,_0x440f7f){_0x309b5e=_0x309b5e-0x0;var _0x4ef921=_0x4ece[_0x309b5e];return _0x4ef921;};'use strict';var EventEmitter=require(_0xe4ec('0x0'));var SmsMessage=require(_0xe4ec('0x1'))['db'][_0xe4ec('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe4ec('0x3')](0x0);var events={'afterCreate':_0xe4ec('0x4'),'afterUpdate':_0xe4ec('0x5'),'afterDestroy':_0xe4ec('0x6')};function emitEvent(_0x177aa8){return function(_0xf20967,_0x2c2723,_0x5bbf26){SmsMessageEvents[_0xe4ec('0x7')](_0x177aa8+':'+_0xf20967['id'],_0xf20967);SmsMessageEvents[_0xe4ec('0x7')](_0x177aa8,_0xf20967);_0x5bbf26(null);};}for(var e in events){if(events[_0xe4ec('0x8')](e)){var event=events[e];SmsMessage[_0xe4ec('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xf2ac=['update','emit','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xf2ac,0x1bb));var _0xcf2a=function(_0x1008cf,_0x123a27){_0x1008cf=_0x1008cf-0x0;var _0x490202=_0xf2ac[_0x1008cf];return _0x490202;};'use strict';var EventEmitter=require(_0xcf2a('0x0'));var SmsMessage=require(_0xcf2a('0x1'))['db'][_0xcf2a('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xcf2a('0x3')](0x0);var events={'afterCreate':_0xcf2a('0x4'),'afterUpdate':_0xcf2a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2f5d96){return function(_0x2943c4,_0x52993e,_0x5bc810){SmsMessageEvents[_0xcf2a('0x6')](_0x2f5d96+':'+_0x2943c4['id'],_0x2943c4);SmsMessageEvents[_0xcf2a('0x6')](_0x2f5d96,_0x2943c4);_0x5bc810(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xcf2a('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 2dcb7f6..6cc75c4 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 _0x422d=['application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','createHash','md5','digest','hex','signature=','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','then','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','clicksend','username','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced'];(function(_0x451f88,_0x5c061a){var _0x2cc2b7=function(_0x5bb6ce){while(--_0x5bb6ce){_0x451f88['push'](_0x451f88['shift']());}};_0x2cc2b7(++_0x5c061a);}(_0x422d,0x11a));var _0xd422=function(_0xa1a8ff,_0x405d8b){_0xa1a8ff=_0xa1a8ff-0x0;var _0x439f93=_0x422d[_0xa1a8ff];return _0x439f93;};'use strict';var _=require(_0xd422('0x0'));var util=require('util');var logger=require(_0xd422('0x1'))('api');var moment=require(_0xd422('0x2'));var BPromise=require('bluebird');var rp=require(_0xd422('0x3'));var fs=require('fs');var path=require(_0xd422('0x4'));var rimraf=require(_0xd422('0x5'));var config=require(_0xd422('0x6'));var attributes=require('./smsMessage.attributes');module[_0xd422('0x7')]=function(_0x3eee12,_0x320fe2){return _0x3eee12[_0xd422('0x8')](_0xd422('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd422('0xa'),'fields':[_0xd422('0xa')]},{'name':'fti_sms_messages','fields':[_0xd422('0xb')],'type':_0xd422('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a3923,_0x11907d,_0xc3cb01){var _0x43c988=_0x3eee12[_0xd422('0xd')];var _0x4d818a=_0x5a3923[_0xd422('0xe')]({'plain':!![]});if(_0x4d818a[_0xd422('0xf')][_0xd422('0x10')]()==='in'||_0x4d818a[_0xd422('0xf')]['toLowerCase']()===_0xd422('0x11')&&!_0x4d818a[_0xd422('0x12')]&&!_[_0xd422('0x13')](_0x4d818a[_0xd422('0x14')])&&!_[_0xd422('0x13')](_0x4d818a['SmsInteractionId'])){_0x43c988[_0xd422('0x15')][_0xd422('0x16')]({'where':{'id':_0x4d818a[_0xd422('0x17')]}})['then'](function(_0x5d91e1){if(_0x5d91e1){_0x5d91e1[_0xd422('0x18')]({'lastMsgAt':_0x4d818a[_0xd422('0x19')],'lastMsgDirection':_0x4d818a[_0xd422('0xf')][_0xd422('0x10')]()});}})[_0xd422('0x1a')](function(_0x1f364f){console[_0xd422('0x1b')](_0x1f364f);});}if(_0x4d818a['direction']==='out'&&!_0x4d818a['secret']){var _0x471431;_0x43c988['SmsAccount']['find']({'where':{'id':_0x4d818a['SmsAccountId']},'raw':!![]})['then'](function(_0x47317b){_0x471431=_0x47317b;if(_0x471431&&_0x471431[_0xd422('0x1c')]){switch(_0x471431[_0xd422('0x1c')]){case _0xd422('0x1d'):var _0x5206b2=require(_0xd422('0x1d'));if(_0x471431[_0xd422('0x1e')]&&_0x471431[_0xd422('0x1f')]&&_0x471431['phone']){var _0x1d929c=new _0x5206b2(_0x471431['accountSid'],_0x471431[_0xd422('0x1f')]);_0x1d929c[_0xd422('0x20')][_0xd422('0x21')]({'body':_0x4d818a[_0xd422('0xb')],'to':_0x4d818a[_0xd422('0x22')],'from':_0x471431[_0xd422('0x22')],'statusCallback':_0x471431[_0xd422('0x23')]+_0xd422('0x24')+_0x4d818a['id']+_0xd422('0x25')+_0x471431[_0xd422('0x26')]})[_0xd422('0x27')](function(_0x124e56){if(_0x124e56[_0xd422('0x28')]){return _0x5a3923['update']({'messageId':_0x124e56[_0xd422('0x28')]});}})[_0xd422('0x1a')](function(_0x27de9f){logger[_0xd422('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),_0xd422('0x1d'),util[_0xd422('0x2a')](_0x27de9f,{'showHidden':![],'depth':null}));});}else{logger[_0xd422('0x1b')](_0xd422('0x2b'),'afterCreate',_0xd422('0x1d'),_0xd422('0x2c'));}break;case _0xd422('0x2d'):var _0x4f373d='https://api.skebby.it/API/v1.0/REST/';if(_0x471431['username']&&_0x471431[_0xd422('0x2e')]){var _0x14224f={'recipient':[_0x4d818a[_0xd422('0x22')]],'message':_0x4d818a[_0xd422('0xb')],'message_type':_0x471431[_0xd422('0x2f')]};if(_0x471431[_0xd422('0x2f')]&&_0x471431[_0xd422('0x2f')]!=='SI'){_0x14224f[_0xd422('0x30')]=_0x471431[_0xd422('0x22')];}var _0x30b744={'url':_0x4f373d+_0xd422('0x31')+_0x471431['username']+_0xd422('0x32')+_0x471431[_0xd422('0x2e')],'method':_0xd422('0x33')};rp(_0x30b744)[_0xd422('0x27')](function(_0xe8efe0){var _0x4626e2=_0xe8efe0[_0xd422('0x34')](';');var _0x4d429c={'user_key':_0x4626e2[0x0],'session_key':_0x4626e2[0x1]};_0x30b744={'url':_0x4f373d+_0xd422('0x35'),'method':_0xd422('0x36'),'headers':{'user_key':_0x4d429c[_0xd422('0x37')],'Session_key':_0x4d429c[_0xd422('0x38')]},'json':!![],'body':_0x14224f};return rp(_0x30b744);})[_0xd422('0x27')](function(_0x26d0ea){if(_0x26d0ea[_0xd422('0x39')]>=0x1){var _0x163300={'messageId':_0x26d0ea[_0xd422('0x3a')]};if(_0x471431[_0xd422('0x2f')]!=='GP'||!_0x471431['deliveryReport']){_0x163300[_0xd422('0x3b')]=!![];}return _0x5a3923['update'](_0x163300);}else{return logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x2d'),util['inspect'](_0x26d0ea,{'showHidden':![],'depth':null}));}})[_0xd422('0x1a')](function(_0x3b3f66){return logger['error'](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x2d'),util[_0xd422('0x2a')](_0x3b3f66,{'showHidden':![],'depth':null}));});}else{logger[_0xd422('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xd422('0x3c'):if(_0x471431[_0xd422('0x1f')]){var _0x24fe65={'recipient':_0x4d818a[_0xd422('0x22')],'message':_0x4d818a['body'],'sender':_0x471431['senderString']||_0x471431['phone'],'authorization':_0x471431[_0xd422('0x1f')]};var _0x11907d={'method':_0xd422('0x36'),'uri':_0xd422('0x3d'),'body':_0x24fe65,'json':!![]};rp(_0x11907d)['then'](function(_0x4614b0){var _0xfc0fd2={'messageId':_0x4614b0[_0xd422('0x3e')]};if(!_0x471431[_0xd422('0x3f')]){_0xfc0fd2[_0xd422('0x3b')]=!![];}return _0x5a3923[_0xd422('0x18')](_0xfc0fd2);})[_0xd422('0x1a')](function(_0x57f873){logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x3c'),util['inspect'](_0x57f873,{'showHidden':![],'depth':null}));});}else{logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0xd422('0x40'):if(_0x471431[_0xd422('0x41')]&&_0x471431[_0xd422('0x2e')]){var _0x24fe65={'messages':[{'source':'xCALLY\x20Motion','to':_0x4d818a[_0xd422('0x22')],'body':_0x4d818a[_0xd422('0xb')],'from':_0x471431[_0xd422('0x42')]||_0x471431['phone']}]};var _0x5a9fa1=util[_0xd422('0x43')](_0xd422('0x44'),_0x471431['username'],_0x471431['password']);var _0x11907d={'method':_0xd422('0x36'),'uri':_0xd422('0x45'),'body':_0x24fe65,'headers':{'Authorization':util[_0xd422('0x43')](_0xd422('0x46'),new Buffer(_0x5a9fa1)['toString'](_0xd422('0x47')))},'json':!![]};rp(_0x11907d)['then'](function(_0x38624b){if(_0x38624b[_0xd422('0x48')]>=0xc8&&_0x38624b['http_code']<=0xce){if(_0x38624b[_0xd422('0x49')]&&_0x38624b[_0xd422('0x49')][_0xd422('0x4a')]>0x0){var _0x420794=_[_0xd422('0x4b')](_0x38624b[_0xd422('0x49')][_0xd422('0x20')]);var _0x3826fb={'messageId':_0x420794[_0xd422('0x4c')]};if(!_0x471431['deliveryReport']){_0x3826fb[_0xd422('0x3b')]=!![];}return _0x5a3923[_0xd422('0x18')](_0x3826fb);}else{logger['error'](_0xd422('0x2b'),'afterCreate','clickSend',util['inspect'](_0x38624b,{'showHidden':![],'depth':null}));}}else{logger[_0xd422('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd422('0x4d'),util['inspect'](_0x38624b,{'showHidden':![],'depth':null}));}})[_0xd422('0x1a')](function(_0x5041bb){logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x4d'),util[_0xd422('0x2a')](_0x5041bb,{'showHidden':![],'depth':null}));});}else{logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x4d'),_0xd422('0x4e'));}break;case _0xd422('0x4f'):if(_0x471431[_0xd422('0x50')]&&_0x471431[_0xd422('0x1f')]){var _0x24fe65={'dst':_0x4d818a[_0xd422('0x22')],'text':_0x4d818a[_0xd422('0xb')],'src':_0x471431[_0xd422('0x42')]||_0x471431[_0xd422('0x22')],'url':_0x471431[_0xd422('0x23')]+_0xd422('0x24')+_0x4d818a['id']+_0xd422('0x25')+_0x471431['token']};var _0x5a9fa1=util['format'](_0xd422('0x44'),_0x471431['authId'],_0x471431[_0xd422('0x1f')]);var _0x11907d={'method':'POST','uri':util[_0xd422('0x43')](_0xd422('0x51'),_0x471431[_0xd422('0x50')]),'body':_0x24fe65,'headers':{'Authorization':util[_0xd422('0x43')]('Basic\x20%s',new Buffer(_0x5a9fa1)[_0xd422('0x52')](_0xd422('0x47')))},'json':!![]};rp(_0x11907d)['then'](function(_0x3a9cca){var _0xacda3c={'messageId':_0x3a9cca[_0xd422('0x53')][0x0]};return _0x5a3923[_0xd422('0x18')](_0xacda3c);})[_0xd422('0x1a')](function(_0x470716){logger[_0xd422('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),_0xd422('0x4f'),util[_0xd422('0x2a')](_0x470716,{'showHidden':![],'depth':null}));});}else{logger[_0xd422('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x471431[_0xd422('0x41')]&&_0x471431[_0xd422('0x2e')]){if(_0x471431[_0xd422('0x54')]){var _0x45cda8={'method':_0xd422('0x36'),'uri':_0x471431['baseUrl']+_0xd422('0x55'),'body':{'username':_0x471431[_0xd422('0x41')],'password':_0x471431['password']},'json':!![]};return rp(_0x45cda8)['then'](function(_0x2ac1ed){var _0x5eb394={'method':'POST','uri':_0x471431['baseUrl']+_0xd422('0x56'),'body':{'messages':[{'from':_0x471431['phone'],'destinations':[{'to':_0x4d818a['phone']}],'text':_0x4d818a[_0xd422('0xb')],'notifyUrl':_0x471431['remote']+_0xd422('0x24')+_0x4d818a['id']+_0xd422('0x25')+_0x471431[_0xd422('0x26')],'notifyContentType':_0xd422('0x57'),'callbackData':_0x471431[_0xd422('0x22')]+';'+_0x4d818a[_0xd422('0xb')]}]},'headers':{'Authorization':_0xd422('0x58')+_0x2ac1ed[_0xd422('0x26')]},'json':!![]};return rp(_0x5eb394)[_0xd422('0x27')](function(_0x19ceff){if(_0x19ceff[_0xd422('0x20')]){var _0x58f35e={'messageId':_0x19ceff[_0xd422('0x20')][0x0]['messageId']};if(!_0x471431[_0xd422('0x3f')]){_0x58f35e[_0xd422('0x3b')]=!![];}return _0x5a3923[_0xd422('0x18')](_0x58f35e);}else{return logger[_0xd422('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),'infobip',util['inspect'](_0x19ceff,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x590082){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util[_0xd422('0x2a')](_0x590082,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x59'),_0xd422('0x5a'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),_0xd422('0x59'),_0xd422('0x4e'));}break;case'csc':var _0x34d073=require(_0xd422('0x5b'));if(_0x471431[_0xd422('0x5c')]){var _0x3dfab0={};_0x3dfab0[_0xd422('0x5d')]=_0x471431[_0xd422('0x41')];_0x3dfab0['phone']=_0x4d818a['phone'];_0x3dfab0['sender']=_0x471431['phone'];_0x3dfab0[_0xd422('0x5e')]=_0x4d818a[_0xd422('0xb')];_0x3dfab0[_0xd422('0x5f')]=+new Date();var _0x32249a='';var _0x67bd9e='';var _0xa52299=Object[_0xd422('0x60')](_0x3dfab0);_0xa52299[_0xd422('0x61')]();for(var _0x5cfa34=0x0;_0x5cfa34<_0xa52299['length'];_0x5cfa34++){if(_0x32249a!=''){_0x32249a+='&';}_0x32249a+=_0xa52299[_0x5cfa34]+'='+encodeURIComponent(_0x3dfab0[_0xa52299[_0x5cfa34]]);_0x67bd9e+=_0x3dfab0[_0xa52299[_0x5cfa34]];}_0x67bd9e+=_0x471431[_0xd422('0x5c')];_0x67bd9e=_0x34d073[_0xd422('0x62')](_0xd422('0x63'))[_0xd422('0x18')](_0x67bd9e)[_0xd422('0x64')](_0xd422('0x65'));if(_0x32249a!==''){_0x32249a+='&';}_0x32249a+=_0xd422('0x66')+_0x67bd9e;var _0x30b744={'method':_0xd422('0x33'),'uri':_0x471431[_0xd422('0x54')]+'/external/get/send.php?'+_0x32249a,'json':!![]};return rp(_0x30b744)[_0xd422('0x27')](function(_0x396730){var _0x5b4046=Object[_0xd422('0x60')](_0x396730);if(_0x396730[_0x5b4046[0x0]]['error']&&parseInt(_0x396730[_0x5b4046[0x0]][_0xd422('0x1b')])===0x0){var _0x541fdc={'messageId':_0x396730[_0x5b4046[0x0]][_0xd422('0x67')]};if(!_0x471431[_0xd422('0x3f')]){_0x541fdc[_0xd422('0x3b')]=!![];}return _0x5a3923['update'](_0x541fdc);}else{return logger[_0xd422('0x1b')](_0xd422('0x2b'),'afterCreate',_0xd422('0x68'),util[_0xd422('0x2a')](_0x396730['error'],{'showHidden':![],'depth':null}));}})[_0xd422('0x1a')](function(_0x51f376){return logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x68'),util[_0xd422('0x2a')](_0x51f376,{'showHidden':![],'depth':null}));});}else{logger[_0xd422('0x1b')](_0xd422('0x2b'),'afterCreate',_0xd422('0x68'),_0xd422('0x69'));}break;case _0xd422('0x6a'):if(_0x471431[_0xd422('0x5c')]){var _0xe723f9={'method':_0xd422('0x36'),'uri':_0xd422('0x6b'),'headers':{'Authorization':_0x471431[_0xd422('0x5c')]},'body':{'content':_0x4d818a[_0xd422('0xb')],'to':[_0x4d818a[_0xd422('0x22')]],'from':_0x471431[_0xd422('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0xd422('0x6c')},'json':!![]};rp(_0xe723f9)[_0xd422('0x27')](function(_0x107a12){if(!_0x107a12[_0xd422('0x1b')]){var _0x17568c={'messageId':_0x107a12[_0xd422('0x20')][0x0]['apiMessageId']};if(!_0x471431[_0xd422('0x3f')]){_0x17568c[_0xd422('0x3b')]=!![];}return _0x5a3923[_0xd422('0x18')](_0x17568c);}else{return logger[_0xd422('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),_0xd422('0x6a'),util[_0xd422('0x2a')](_0x107a12[_0xd422('0x1b')],{'showHidden':![],'depth':null}));}})[_0xd422('0x1a')](function(_0x33d792){return logger[_0xd422('0x1b')](_0xd422('0x2b'),'afterCreate',_0xd422('0x6a'),util[_0xd422('0x2a')](_0x33d792,{'showHidden':![],'depth':null}));});}else{logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x6a'),_0xd422('0x69'));}break;case _0xd422('0x6d'):if(_0x471431[_0xd422('0x41')]&&_0x471431[_0xd422('0x2e')]){var _0x5a9fa1=util[_0xd422('0x43')](_0xd422('0x44'),_0x471431[_0xd422('0x41')],_0x471431[_0xd422('0x2e')]);var _0x11907d={'method':_0xd422('0x36'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x471431[_0xd422('0x6e')]+_0xd422('0x6f'),'body':{'to':[_0x4d818a[_0xd422('0x22')]],'text':_0x4d818a[_0xd422('0xb')],'from':_0x471431[_0xd422('0x22')],'applicationId':_0x471431[_0xd422('0x70')]},'headers':{'Authorization':util['format'](_0xd422('0x46'),new Buffer(_0x5a9fa1)['toString'](_0xd422('0x47')))},'json':!![]};rp(_0x11907d)['then'](function(_0x58fbb6){if(_0x58fbb6['id']){var _0x472e0f={'messageId':_0x58fbb6['id']};return _0x5a3923[_0xd422('0x18')](_0x472e0f);}else{logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x6d'),util[_0xd422('0x2a')](_0x58fbb6,{'showHidden':![],'depth':null}));}})[_0xd422('0x1a')](function(_0x490407){logger['error'](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x6d'),util['inspect'](_0x490407,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd422('0x71'):if(_0x471431[_0xd422('0x5c')]){var _0x42989c={};var _0x30b744={'method':_0xd422('0x36'),'uri':_0xd422('0x72'),'headers':{'Authorization':_0xd422('0x73')+_0x471431[_0xd422('0x5c')],'Content-Type':_0xd422('0x57')},'body':{'from':_0x471431[_0xd422('0x22')],'to':_0x4d818a[_0xd422('0x22')],'text':_0x4d818a[_0xd422('0xb')]},'json':!![]};return rp(_0x30b744)[_0xd422('0x27')](function(_0x315b80){if(_0x315b80[_0xd422('0x74')]==0xca){_0x42989c[_0xd422('0x75')]=_0x315b80;var _0x1428cc={'method':_0xd422('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xd422('0x73')+_0x471431[_0xd422('0x5c')],'Content-Type':_0xd422('0x57')},'body':{'refid':_0x42989c[_0xd422('0x75')][_0xd422('0x76')]},'json':!![]};return rp(_0x1428cc)['then'](function(_0xb504f5){_0x42989c[_0xd422('0x77')]=_0xb504f5;var _0x26a8b9={'messageId':_0x42989c[_0xd422('0x75')][_0xd422('0x76')],'read':!![]};return _0x5a3923[_0xd422('0x18')](_0x26a8b9);});}else{return logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),_0xd422('0x71'),util[_0xd422('0x2a')](_0x315b80,{'showHidden':![],'depth':null}));}})[_0xd422('0x1a')](function(_0x4acfbf){return logger[_0xd422('0x1b')](_0xd422('0x2b'),_0xd422('0x29'),'intelepeer',util[_0xd422('0x2a')](_0x4acfbf,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd422('0x29'),_0xd422('0x71'),'Token\x20not\x20received');}break;}}})[_0xd422('0x78')](function(){_0xc3cb01();});}else{_0xc3cb01();}}},'charset':_0xd422('0x79'),'collate':_0xd422('0x7a')});}; \ No newline at end of file +var _0x603d=['message_uuid','baseUrl','/auth/1/session','application/json','messages','infobip','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','sender','text','sort','createHash','md5','digest','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','bandwidth','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','out','secret','UserId','isNil','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','phone','accountSid','authToken','remote','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','split','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','error','connectel','senderString','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/'];(function(_0x3309f8,_0x13fedc){var _0x27c632=function(_0x27d982){while(--_0x27d982){_0x3309f8['push'](_0x3309f8['shift']());}};_0x27c632(++_0x13fedc);}(_0x603d,0x17c));var _0xd603=function(_0x496943,_0x1f1af6){_0x496943=_0x496943-0x0;var _0x75a62f=_0x603d[_0x496943];return _0x75a62f;};'use strict';var _=require(_0xd603('0x0'));var util=require(_0xd603('0x1'));var logger=require(_0xd603('0x2'))(_0xd603('0x3'));var moment=require(_0xd603('0x4'));var BPromise=require(_0xd603('0x5'));var rp=require(_0xd603('0x6'));var fs=require('fs');var path=require(_0xd603('0x7'));var rimraf=require(_0xd603('0x8'));var config=require(_0xd603('0x9'));var attributes=require('./smsMessage.attributes');module[_0xd603('0xa')]=function(_0x5c98fb,_0x597ac7){return _0x5c98fb[_0xd603('0xb')](_0xd603('0xc'),attributes,{'tableName':_0xd603('0xd'),'paranoid':![],'indexes':[{'name':_0xd603('0xe'),'fields':[_0xd603('0xe')]},{'name':_0xd603('0xf'),'fields':[_0xd603('0x10')],'type':_0xd603('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x340a12,_0x37b1cd,_0x26489c){var _0x4d30f8=_0x5c98fb[_0xd603('0x12')];var _0x710e2a=_0x340a12['get']({'plain':!![]});if(_0x710e2a[_0xd603('0x13')]['toLowerCase']()==='in'||_0x710e2a[_0xd603('0x13')]['toLowerCase']()===_0xd603('0x14')&&!_0x710e2a[_0xd603('0x15')]&&!_['isNil'](_0x710e2a[_0xd603('0x16')])&&!_[_0xd603('0x17')](_0x710e2a['SmsInteractionId'])){_0x4d30f8['SmsInteraction']['findOne']({'where':{'id':_0x710e2a[_0xd603('0x18')]}})[_0xd603('0x19')](function(_0x1bb839){if(_0x1bb839){_0x1bb839[_0xd603('0x1a')]({'lastMsgAt':_0x710e2a[_0xd603('0x1b')],'lastMsgDirection':_0x710e2a[_0xd603('0x13')]['toLowerCase']()});}})[_0xd603('0x1c')](function(_0x423901){console['error'](_0x423901);});}if(_0x710e2a['direction']===_0xd603('0x14')&&!_0x710e2a['secret']){var _0x31925a;_0x4d30f8[_0xd603('0x1d')][_0xd603('0x1e')]({'where':{'id':_0x710e2a[_0xd603('0x1f')]},'raw':!![]})[_0xd603('0x19')](function(_0x143d89){_0x31925a=_0x143d89;if(_0x31925a&&_0x31925a[_0xd603('0x20')]){switch(_0x31925a['type']){case _0xd603('0x21'):var _0x28929a=require(_0xd603('0x21'));if(_0x31925a['accountSid']&&_0x31925a['authToken']&&_0x31925a[_0xd603('0x22')]){var _0x45aa6d=new _0x28929a(_0x31925a[_0xd603('0x23')],_0x31925a[_0xd603('0x24')]);_0x45aa6d['messages']['create']({'body':_0x710e2a['body'],'to':_0x710e2a[_0xd603('0x22')],'from':_0x31925a['phone'],'statusCallback':_0x31925a[_0xd603('0x25')]+'/api/sms/messages/'+_0x710e2a['id']+_0xd603('0x26')+_0x31925a[_0xd603('0x27')]})[_0xd603('0x19')](function(_0x55faec){if(_0x55faec[_0xd603('0x28')]){return _0x340a12[_0xd603('0x1a')]({'messageId':_0x55faec['sid']});}})[_0xd603('0x1c')](function(_0xfd4e1){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd603('0x29'),_0xd603('0x21'),util[_0xd603('0x2a')](_0xfd4e1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x21'),_0xd603('0x2c'));}break;case _0xd603('0x2d'):var _0x2ba7d8=_0xd603('0x2e');if(_0x31925a[_0xd603('0x2f')]&&_0x31925a[_0xd603('0x30')]){var _0x30dfc3={'recipient':[_0x710e2a[_0xd603('0x22')]],'message':_0x710e2a[_0xd603('0x10')],'message_type':_0x31925a['smsMethod']};if(_0x31925a['smsMethod']&&_0x31925a[_0xd603('0x31')]!=='SI'){_0x30dfc3['sender']=_0x31925a[_0xd603('0x22')];}var _0x332fca={'url':_0x2ba7d8+_0xd603('0x32')+_0x31925a[_0xd603('0x2f')]+_0xd603('0x33')+_0x31925a['password'],'method':'GET'};rp(_0x332fca)['then'](function(_0x17d6ba){var _0x2d0254=_0x17d6ba[_0xd603('0x34')](';');var _0x360bc3={'user_key':_0x2d0254[0x0],'session_key':_0x2d0254[0x1]};_0x332fca={'url':_0x2ba7d8+'sms','method':_0xd603('0x35'),'headers':{'user_key':_0x360bc3[_0xd603('0x36')],'Session_key':_0x360bc3[_0xd603('0x37')]},'json':!![],'body':_0x30dfc3};return rp(_0x332fca);})['then'](function(_0x50efea){if(_0x50efea[_0xd603('0x38')]>=0x1){var _0x375e49={'messageId':_0x50efea[_0xd603('0x39')]};if(_0x31925a[_0xd603('0x31')]!=='GP'||!_0x31925a[_0xd603('0x3a')]){_0x375e49[_0xd603('0x3b')]=!![];}return _0x340a12[_0xd603('0x1a')](_0x375e49);}else{return logger['error'](_0xd603('0x2b'),'afterCreate',_0xd603('0x2d'),util[_0xd603('0x2a')](_0x50efea,{'showHidden':![],'depth':null}));}})[_0xd603('0x1c')](function(_0x69796d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd603('0x29'),_0xd603('0x2d'),util[_0xd603('0x2a')](_0x69796d,{'showHidden':![],'depth':null}));});}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xd603('0x3d'):if(_0x31925a['authToken']){var _0x1da9e6={'recipient':_0x710e2a['phone'],'message':_0x710e2a['body'],'sender':_0x31925a[_0xd603('0x3e')]||_0x31925a[_0xd603('0x22')],'authorization':_0x31925a['authToken']};var _0x37b1cd={'method':_0xd603('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1da9e6,'json':!![]};rp(_0x37b1cd)['then'](function(_0x3613d8){var _0xa409a9={'messageId':_0x3613d8['requestid']};if(!_0x31925a[_0xd603('0x3a')]){_0xa409a9['read']=!![];}return _0x340a12[_0xd603('0x1a')](_0xa409a9);})['catch'](function(_0x7a586c){logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x3d'),util[_0xd603('0x2a')](_0x7a586c,{'showHidden':![],'depth':null}));});}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x3d'),_0xd603('0x3f'));}break;case'clicksend':if(_0x31925a[_0xd603('0x2f')]&&_0x31925a[_0xd603('0x30')]){var _0x1da9e6={'messages':[{'source':_0xd603('0x40'),'to':_0x710e2a[_0xd603('0x22')],'body':_0x710e2a[_0xd603('0x10')],'from':_0x31925a[_0xd603('0x3e')]||_0x31925a[_0xd603('0x22')]}]};var _0x20f602=util[_0xd603('0x41')](_0xd603('0x42'),_0x31925a['username'],_0x31925a[_0xd603('0x30')]);var _0x37b1cd={'method':_0xd603('0x35'),'uri':_0xd603('0x43'),'body':_0x1da9e6,'headers':{'Authorization':util['format'](_0xd603('0x44'),new Buffer(_0x20f602)[_0xd603('0x45')](_0xd603('0x46')))},'json':!![]};rp(_0x37b1cd)['then'](function(_0x19fd47){if(_0x19fd47['http_code']>=0xc8&&_0x19fd47[_0xd603('0x47')]<=0xce){if(_0x19fd47[_0xd603('0x48')]&&_0x19fd47['data'][_0xd603('0x49')]>0x0){var _0x228cbc=_[_0xd603('0x4a')](_0x19fd47[_0xd603('0x48')]['messages']);var _0x2d0b42={'messageId':_0x228cbc[_0xd603('0x4b')]};if(!_0x31925a[_0xd603('0x3a')]){_0x2d0b42[_0xd603('0x3b')]=!![];}return _0x340a12['update'](_0x2d0b42);}else{logger[_0xd603('0x3c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd603('0x4c'),util['inspect'](_0x19fd47,{'showHidden':![],'depth':null}));}}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x4c'),util['inspect'](_0x19fd47,{'showHidden':![],'depth':null}));}})[_0xd603('0x1c')](function(_0x3e0f10){logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x4c'),util['inspect'](_0x3e0f10,{'showHidden':![],'depth':null}));});}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xd603('0x4d'):if(_0x31925a[_0xd603('0x4e')]&&_0x31925a[_0xd603('0x24')]){var _0x1da9e6={'dst':_0x710e2a[_0xd603('0x22')],'text':_0x710e2a[_0xd603('0x10')],'src':_0x31925a[_0xd603('0x3e')]||_0x31925a[_0xd603('0x22')],'url':_0x31925a[_0xd603('0x25')]+_0xd603('0x4f')+_0x710e2a['id']+_0xd603('0x26')+_0x31925a['token']};var _0x20f602=util[_0xd603('0x41')](_0xd603('0x42'),_0x31925a[_0xd603('0x4e')],_0x31925a[_0xd603('0x24')]);var _0x37b1cd={'method':_0xd603('0x35'),'uri':util[_0xd603('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x31925a[_0xd603('0x4e')]),'body':_0x1da9e6,'headers':{'Authorization':util[_0xd603('0x41')]('Basic\x20%s',new Buffer(_0x20f602)[_0xd603('0x45')]('base64'))},'json':!![]};rp(_0x37b1cd)[_0xd603('0x19')](function(_0x2b2e5b){var _0x19eda1={'messageId':_0x2b2e5b[_0xd603('0x50')][0x0]};return _0x340a12[_0xd603('0x1a')](_0x19eda1);})[_0xd603('0x1c')](function(_0xc1e226){logger[_0xd603('0x3c')](_0xd603('0x2b'),'afterCreate','plivo',util['inspect'](_0xc1e226,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd603('0x2b'),'afterCreate',_0xd603('0x4d'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x31925a[_0xd603('0x2f')]&&_0x31925a['password']){if(_0x31925a['baseUrl']){var _0x2ca169={'method':_0xd603('0x35'),'uri':_0x31925a[_0xd603('0x51')]+_0xd603('0x52'),'body':{'username':_0x31925a['username'],'password':_0x31925a[_0xd603('0x30')]},'json':!![]};return rp(_0x2ca169)[_0xd603('0x19')](function(_0x2f3ec9){var _0x30c9e0={'method':_0xd603('0x35'),'uri':_0x31925a[_0xd603('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x31925a['phone'],'destinations':[{'to':_0x710e2a[_0xd603('0x22')]}],'text':_0x710e2a[_0xd603('0x10')],'notifyUrl':_0x31925a[_0xd603('0x25')]+'/api/sms/messages/'+_0x710e2a['id']+'/status?token='+_0x31925a[_0xd603('0x27')],'notifyContentType':_0xd603('0x53'),'callbackData':_0x31925a[_0xd603('0x22')]+';'+_0x710e2a['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x2f3ec9[_0xd603('0x27')]},'json':!![]};return rp(_0x30c9e0)[_0xd603('0x19')](function(_0x223bc3){if(_0x223bc3[_0xd603('0x54')]){var _0x2432c1={'messageId':_0x223bc3[_0xd603('0x54')][0x0][_0xd603('0xe')]};if(!_0x31925a[_0xd603('0x3a')]){_0x2432c1['read']=!![];}return _0x340a12[_0xd603('0x1a')](_0x2432c1);}else{return logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x55'),util[_0xd603('0x2a')](_0x223bc3,{'showHidden':![],'depth':null}));}});})[_0xd603('0x1c')](function(_0x4ed226){return logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x55'),util[_0xd603('0x2a')](_0x4ed226,{'showHidden':![],'depth':null}));});}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x55'),_0xd603('0x56'));}break;case _0xd603('0x57'):var _0x36ad81=require(_0xd603('0x58'));if(_0x31925a[_0xd603('0x59')]){var _0x1ddbc8={};_0x1ddbc8['login']=_0x31925a[_0xd603('0x2f')];_0x1ddbc8[_0xd603('0x22')]=_0x710e2a['phone'];_0x1ddbc8[_0xd603('0x5a')]=_0x31925a[_0xd603('0x22')];_0x1ddbc8[_0xd603('0x5b')]=_0x710e2a[_0xd603('0x10')];_0x1ddbc8['timestamp']=+new Date();var _0x4f4ee6='';var _0x48f0f4='';var _0x3d750e=Object['keys'](_0x1ddbc8);_0x3d750e[_0xd603('0x5c')]();for(var _0x32de82=0x0;_0x32de82<_0x3d750e['length'];_0x32de82++){if(_0x4f4ee6!=''){_0x4f4ee6+='&';}_0x4f4ee6+=_0x3d750e[_0x32de82]+'='+encodeURIComponent(_0x1ddbc8[_0x3d750e[_0x32de82]]);_0x48f0f4+=_0x1ddbc8[_0x3d750e[_0x32de82]];}_0x48f0f4+=_0x31925a[_0xd603('0x59')];_0x48f0f4=_0x36ad81[_0xd603('0x5d')](_0xd603('0x5e'))[_0xd603('0x1a')](_0x48f0f4)[_0xd603('0x5f')]('hex');if(_0x4f4ee6!==''){_0x4f4ee6+='&';}_0x4f4ee6+=_0xd603('0x60')+_0x48f0f4;var _0x332fca={'method':'GET','uri':_0x31925a[_0xd603('0x51')]+_0xd603('0x61')+_0x4f4ee6,'json':!![]};return rp(_0x332fca)[_0xd603('0x19')](function(_0x13369e){var _0x5d34c4=Object[_0xd603('0x62')](_0x13369e);if(_0x13369e[_0x5d34c4[0x0]][_0xd603('0x3c')]&&parseInt(_0x13369e[_0x5d34c4[0x0]]['error'])===0x0){var _0x16d4e8={'messageId':_0x13369e[_0x5d34c4[0x0]][_0xd603('0x63')]};if(!_0x31925a[_0xd603('0x3a')]){_0x16d4e8['read']=!![];}return _0x340a12[_0xd603('0x1a')](_0x16d4e8);}else{return logger['error'](_0xd603('0x2b'),'afterCreate',_0xd603('0x57'),util[_0xd603('0x2a')](_0x13369e[_0xd603('0x3c')],{'showHidden':![],'depth':null}));}})[_0xd603('0x1c')](function(_0x35c1c7){return logger['error'](_0xd603('0x2b'),_0xd603('0x29'),'csc',util[_0xd603('0x2a')](_0x35c1c7,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd603('0x57'),_0xd603('0x64'));}break;case _0xd603('0x65'):if(_0x31925a['apiKey']){var _0x12e589={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x31925a[_0xd603('0x59')]},'body':{'content':_0x710e2a[_0xd603('0x10')],'to':[_0x710e2a['phone']],'from':_0x31925a[_0xd603('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0xd603('0x66')},'json':!![]};rp(_0x12e589)['then'](function(_0x2801e7){if(!_0x2801e7[_0xd603('0x3c')]){var _0x587edf={'messageId':_0x2801e7[_0xd603('0x54')][0x0]['apiMessageId']};if(!_0x31925a['deliveryReport']){_0x587edf[_0xd603('0x3b')]=!![];}return _0x340a12[_0xd603('0x1a')](_0x587edf);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd603('0x29'),'clickatell',util[_0xd603('0x2a')](_0x2801e7[_0xd603('0x3c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3d7528){return logger['error'](_0xd603('0x2b'),_0xd603('0x29'),'clickatell',util[_0xd603('0x2a')](_0x3d7528,{'showHidden':![],'depth':null}));});}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),'afterCreate',_0xd603('0x65'),_0xd603('0x64'));}break;case _0xd603('0x67'):if(_0x31925a[_0xd603('0x2f')]&&_0x31925a[_0xd603('0x30')]){var _0x20f602=util[_0xd603('0x41')](_0xd603('0x42'),_0x31925a[_0xd603('0x2f')],_0x31925a['password']);var _0x37b1cd={'method':_0xd603('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x31925a['accountId']+_0xd603('0x68'),'body':{'to':[_0x710e2a[_0xd603('0x22')]],'text':_0x710e2a[_0xd603('0x10')],'from':_0x31925a['phone'],'applicationId':_0x31925a[_0xd603('0x69')]},'headers':{'Authorization':util[_0xd603('0x41')](_0xd603('0x44'),new Buffer(_0x20f602)[_0xd603('0x45')](_0xd603('0x46')))},'json':!![]};rp(_0x37b1cd)['then'](function(_0x57c1c2){if(_0x57c1c2['id']){var _0x1fa384={'messageId':_0x57c1c2['id']};return _0x340a12[_0xd603('0x1a')](_0x1fa384);}else{logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),'bandwidth',util[_0xd603('0x2a')](_0x57c1c2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2c28e9){logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x67'),util[_0xd603('0x2a')](_0x2c28e9,{'showHidden':![],'depth':null}));});}else{logger[_0xd603('0x3c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd603('0x29'),_0xd603('0x67'),_0xd603('0x56'));}break;case _0xd603('0x6a'):if(_0x31925a[_0xd603('0x59')]){var _0x3662ca={};var _0x332fca={'method':_0xd603('0x35'),'uri':_0xd603('0x6b'),'headers':{'Authorization':_0xd603('0x6c')+_0x31925a[_0xd603('0x59')],'Content-Type':'application/json'},'body':{'from':_0x31925a['phone'],'to':_0x710e2a[_0xd603('0x22')],'text':_0x710e2a['body']},'json':!![]};return rp(_0x332fca)[_0xd603('0x19')](function(_0x5def62){if(_0x5def62[_0xd603('0x6d')]==0xca){_0x3662ca[_0xd603('0x6e')]=_0x5def62;var _0x32d7e0={'method':'POST','uri':_0xd603('0x6f'),'headers':{'Authorization':_0xd603('0x6c')+_0x31925a['apiKey'],'Content-Type':_0xd603('0x53')},'body':{'refid':_0x3662ca['message'][_0xd603('0x70')]},'json':!![]};return rp(_0x32d7e0)[_0xd603('0x19')](function(_0x86fd67){_0x3662ca[_0xd603('0x71')]=_0x86fd67;var _0x2505f3={'messageId':_0x3662ca['message'][_0xd603('0x70')],'read':!![]};return _0x340a12[_0xd603('0x1a')](_0x2505f3);});}else{return logger[_0xd603('0x3c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd603('0x29'),'intelepeer',util[_0xd603('0x2a')](_0x5def62,{'showHidden':![],'depth':null}));}})[_0xd603('0x1c')](function(_0x23bf1a){return logger[_0xd603('0x3c')](_0xd603('0x2b'),_0xd603('0x29'),_0xd603('0x6a'),util[_0xd603('0x2a')](_0x23bf1a,{'showHidden':![],'depth':null}));});}else{return logger[_0xd603('0x3c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd603('0x6a'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x26489c();});}else{_0x26489c();}}},'charset':_0xd603('0x72'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index d83695a..32a98e1 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 _0x44ac=['options','raw','then','CreateSmsMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsMessage','create','body'];(function(_0x471e0b,_0x26cd81){var _0x1fa8be=function(_0x1b2e3a){while(--_0x1b2e3a){_0x471e0b['push'](_0x471e0b['shift']());}};_0x1fa8be(++_0x26cd81);}(_0x44ac,0x1e4));var _0xc44a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x44ac[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xc44a('0x0'));var util=require('util');var moment=require(_0xc44a('0x1'));var BPromise=require(_0xc44a('0x2'));var rs=require(_0xc44a('0x3'));var fs=require('fs');var Redis=require(_0xc44a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc44a('0x5'))('rpc');var config=require(_0xc44a('0x6'));var jayson=require(_0xc44a('0x7'));var client=jayson[_0xc44a('0x8')][_0xc44a('0x9')]({'port':0x232a});config[_0xc44a('0xa')]=_[_0xc44a('0xb')](config[_0xc44a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc44a('0xc'))(new Redis(config['redis']));require(_0xc44a('0xd'))[_0xc44a('0xe')](socket);function respondWithRpcPromise(_0x411c4c,_0x28eb70,_0x1b33ee){return new BPromise(function(_0x6d0a8c,_0x37ef4d){return client[_0xc44a('0xf')](_0x411c4c,_0x1b33ee)['then'](function(_0x486333){logger[_0xc44a('0x10')](_0xc44a('0x11'),_0x28eb70,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x28eb70,_0xc44a('0x12'),JSON[_0xc44a('0x13')](_0x486333));if(_0x486333[_0xc44a('0x14')]){if(_0x486333[_0xc44a('0x14')][_0xc44a('0x15')]===0x1f4){logger[_0xc44a('0x14')]('SmsMessage,\x20%s,\x20%s',_0x28eb70,_0x486333['error'][_0xc44a('0x16')]);return _0x37ef4d(_0x486333[_0xc44a('0x14')][_0xc44a('0x16')]);}logger[_0xc44a('0x14')]('SmsMessage,\x20%s,\x20%s',_0x28eb70,_0x486333[_0xc44a('0x14')][_0xc44a('0x16')]);return _0x6d0a8c(_0x486333[_0xc44a('0x14')][_0xc44a('0x16')]);}else{logger[_0xc44a('0x10')](_0xc44a('0x11'),_0x28eb70,_0xc44a('0x12'));_0x6d0a8c(_0x486333[_0xc44a('0x17')][_0xc44a('0x16')]);}})[_0xc44a('0x18')](function(_0x27f22d){logger['error'](_0xc44a('0x11'),_0x28eb70,_0x27f22d);_0x37ef4d(_0x27f22d);});});}exports['CreateSmsMessage']=function(_0x14b3c3){var _0x53c73b=this;return new Promise(function(_0x2e69e3,_0x55158b){return db[_0xc44a('0x19')][_0xc44a('0x1a')](_0x14b3c3[_0xc44a('0x1b')],{'raw':_0x14b3c3[_0xc44a('0x1c')]?_0x14b3c3[_0xc44a('0x1c')][_0xc44a('0x1d')]===undefined?!![]:![]:!![]})[_0xc44a('0x1e')](function(_0x14e4c7){logger[_0xc44a('0x10')](_0xc44a('0x1f'),_0x14b3c3);logger['debug']('CreateSmsMessage',_0x14b3c3,JSON[_0xc44a('0x13')](_0x14e4c7));_0x2e69e3(_0x14e4c7);})[_0xc44a('0x18')](function(_0x319f5d){logger[_0xc44a('0x14')]('CreateSmsMessage',_0x319f5d[_0xc44a('0x16')],_0x14b3c3);_0x55158b(_0x53c73b[_0xc44a('0x14')](0x1f4,_0x319f5d[_0xc44a('0x16')]));});});}; \ No newline at end of file +var _0x51ab=['SmsMessage','create','body','options','then','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateSmsMessage'];(function(_0x5e6238,_0x5eeccd){var _0x1dfd46=function(_0x5ce5f7){while(--_0x5ce5f7){_0x5e6238['push'](_0x5e6238['shift']());}};_0x1dfd46(++_0x5eeccd);}(_0x51ab,0x1d6));var _0xb51a=function(_0x43225e,_0x630e6c){_0x43225e=_0x43225e-0x0;var _0x519bc8=_0x51ab[_0x43225e];return _0x519bc8;};'use strict';var _=require('lodash');var util=require(_0xb51a('0x0'));var moment=require('moment');var BPromise=require(_0xb51a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb51a('0x2'));var db=require(_0xb51a('0x3'))['db'];var utils=require(_0xb51a('0x4'));var logger=require(_0xb51a('0x5'))(_0xb51a('0x6'));var config=require(_0xb51a('0x7'));var jayson=require(_0xb51a('0x8'));var client=jayson[_0xb51a('0x9')]['http']({'port':0x232a});config['redis']=_[_0xb51a('0xa')](config[_0xb51a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb51a('0xb')]));require(_0xb51a('0xc'))['register'](socket);function respondWithRpcPromise(_0x1f9552,_0x55c725,_0x2a06f5){return new BPromise(function(_0x455e71,_0x375d0d){return client[_0xb51a('0xd')](_0x1f9552,_0x2a06f5)['then'](function(_0xd4f8dc){logger[_0xb51a('0xe')](_0xb51a('0xf'),_0x55c725,_0xb51a('0x10'));logger[_0xb51a('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x55c725,_0xb51a('0x10'),JSON[_0xb51a('0x12')](_0xd4f8dc));if(_0xd4f8dc[_0xb51a('0x13')]){if(_0xd4f8dc[_0xb51a('0x13')]['code']===0x1f4){logger[_0xb51a('0x13')](_0xb51a('0xf'),_0x55c725,_0xd4f8dc[_0xb51a('0x13')][_0xb51a('0x14')]);return _0x375d0d(_0xd4f8dc[_0xb51a('0x13')][_0xb51a('0x14')]);}logger['error'](_0xb51a('0xf'),_0x55c725,_0xd4f8dc['error'][_0xb51a('0x14')]);return _0x455e71(_0xd4f8dc[_0xb51a('0x13')][_0xb51a('0x14')]);}else{logger[_0xb51a('0xe')](_0xb51a('0xf'),_0x55c725,_0xb51a('0x10'));_0x455e71(_0xd4f8dc[_0xb51a('0x15')][_0xb51a('0x14')]);}})['catch'](function(_0x5917ce){logger['error'](_0xb51a('0xf'),_0x55c725,_0x5917ce);_0x375d0d(_0x5917ce);});});}exports[_0xb51a('0x16')]=function(_0x2af6bb){var _0x2820b8=this;return new Promise(function(_0x43301e,_0x563b94){return db[_0xb51a('0x17')][_0xb51a('0x18')](_0x2af6bb[_0xb51a('0x19')],{'raw':_0x2af6bb['options']?_0x2af6bb[_0xb51a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xb51a('0x1b')](function(_0x4c4a60){logger['info'](_0xb51a('0x16'),_0x2af6bb);logger['debug'](_0xb51a('0x16'),_0x2af6bb,JSON[_0xb51a('0x12')](_0x4c4a60));_0x43301e(_0x4c4a60);})[_0xb51a('0x1c')](function(_0x3b6de7){logger[_0xb51a('0x13')]('CreateSmsMessage',_0x3b6de7[_0xb51a('0x14')],_0x2af6bb);_0x563b94(_0x2820b8['error'](0x1f4,_0x3b6de7[_0xb51a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4683925..ed8b1a8 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 _0x48fd=['./smsMessage.events','save','remove','removeListener','register'];(function(_0x3a7edd,_0xbc5870){var _0x2623ff=function(_0xca2839){while(--_0xca2839){_0x3a7edd['push'](_0x3a7edd['shift']());}};_0x2623ff(++_0xbc5870);}(_0x48fd,0x87));var _0xd48f=function(_0x4a5231,_0x470bca){_0x4a5231=_0x4a5231-0x0;var _0x456b65=_0x48fd[_0x4a5231];return _0x456b65;};'use strict';var SmsMessageEvents=require(_0xd48f('0x0'));var events=[_0xd48f('0x1'),_0xd48f('0x2'),'update'];function createListener(_0x2fdcce,_0x29cc11){return function(_0x5d9317){_0x29cc11['emit'](_0x2fdcce,_0x5d9317);};}function removeListener(_0x408aae,_0x5c6537){return function(){SmsMessageEvents[_0xd48f('0x3')](_0x408aae,_0x5c6537);};}exports[_0xd48f('0x4')]=function(_0x5cb37a){for(var _0x25eb67=0x0,_0x584f2b=events['length'];_0x25eb67<_0x584f2b;_0x25eb67++){var _0x2964c3=events[_0x25eb67];var _0x496f92=createListener('smsMessage:'+_0x2964c3,_0x5cb37a);SmsMessageEvents['on'](_0x2964c3,_0x496f92);}}; \ No newline at end of file +var _0xba9d=['removeListener','register','./smsMessage.events','save','remove','update','emit'];(function(_0x18405f,_0x3ed101){var _0x3a86da=function(_0x6abead){while(--_0x6abead){_0x18405f['push'](_0x18405f['shift']());}};_0x3a86da(++_0x3ed101);}(_0xba9d,0x17c));var _0xdba9=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xba9d[_0x4792c8];return _0x35edb1;};'use strict';var SmsMessageEvents=require(_0xdba9('0x0'));var events=[_0xdba9('0x1'),_0xdba9('0x2'),_0xdba9('0x3')];function createListener(_0x5c0305,_0x2854e4){return function(_0x1dca2b){_0x2854e4[_0xdba9('0x4')](_0x5c0305,_0x1dca2b);};}function removeListener(_0x1f2b25,_0x39c222){return function(){SmsMessageEvents[_0xdba9('0x5')](_0x1f2b25,_0x39c222);};}exports[_0xdba9('0x6')]=function(_0x2f9752){for(var _0x57af0b=0x0,_0x4dc88e=events['length'];_0x57af0b<_0x4dc88e;_0x57af0b++){var _0x4afd65=events[_0x57af0b];var _0x3d34c2=createListener('smsMessage:'+_0x4afd65,_0x2f9752);SmsMessageEvents['on'](_0x4afd65,_0x3d34c2);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5db1a71..a9bcfbe 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 _0x60ff=['getAgents','post','create','addAgents','put','delete','/:id/teams','removeAgents','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','getMembers','getTeams','/:id/users'];(function(_0xbfbcea,_0x5a1521){var _0x103fed=function(_0x1fea97){while(--_0x1fea97){_0xbfbcea['push'](_0xbfbcea['shift']());}};_0x103fed(++_0x5a1521);}(_0x60ff,0x1ec));var _0xf60f=function(_0x1d9a67,_0x48c709){_0x1d9a67=_0x1d9a67-0x0;var _0x2712b1=_0x60ff[_0x1d9a67];return _0x2712b1;};'use strict';var multer=require(_0xf60f('0x0'));var util=require(_0xf60f('0x1'));var path=require('path');var timeout=require(_0xf60f('0x2'));var express=require('express');var router=express[_0xf60f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf60f('0x4'));var interaction=require(_0xf60f('0x5'));var config=require(_0xf60f('0x6'));var controller=require('./smsQueue.controller');router[_0xf60f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf60f('0x7')]('/describe',auth[_0xf60f('0x8')](),controller[_0xf60f('0x9')]);router[_0xf60f('0x7')](_0xf60f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xf60f('0x7')]('/:id/members',auth[_0xf60f('0x8')](),controller[_0xf60f('0xb')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xf60f('0xc')]);router[_0xf60f('0x7')](_0xf60f('0xd'),auth[_0xf60f('0x8')](),controller[_0xf60f('0xe')]);router[_0xf60f('0xf')]('/',auth[_0xf60f('0x8')](),controller[_0xf60f('0x10')]);router[_0xf60f('0xf')]('/:id/teams',auth[_0xf60f('0x8')](),controller['addTeams']);router[_0xf60f('0xf')](_0xf60f('0xd'),auth['isAuthenticated'](),controller[_0xf60f('0x11')]);router[_0xf60f('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf60f('0x13')](_0xf60f('0xa'),auth[_0xf60f('0x8')](),controller['destroy']);router[_0xf60f('0x13')](_0xf60f('0x14'),auth[_0xf60f('0x8')](),controller['removeTeams']);router[_0xf60f('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xf60f('0x15')]);module[_0xf60f('0x16')]=router; \ No newline at end of file +var _0x1088=['destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id/members','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','/:id'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x1088,0x1f4));var _0x8108=function(_0x5eb70f,_0x15e9ee){_0x5eb70f=_0x5eb70f-0x0;var _0x14090c=_0x1088[_0x5eb70f];return _0x14090c;};'use strict';var multer=require(_0x8108('0x0'));var util=require(_0x8108('0x1'));var path=require(_0x8108('0x2'));var timeout=require(_0x8108('0x3'));var express=require(_0x8108('0x4'));var router=express[_0x8108('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8108('0x6'));var interaction=require(_0x8108('0x7'));var config=require(_0x8108('0x8'));var controller=require(_0x8108('0x9'));router[_0x8108('0xa')]('/',auth['isAuthenticated'](),controller[_0x8108('0xb')]);router[_0x8108('0xa')](_0x8108('0xc'),auth[_0x8108('0xd')](),controller[_0x8108('0xe')]);router[_0x8108('0xa')]('/:id',auth[_0x8108('0xd')](),controller['show']);router[_0x8108('0xa')](_0x8108('0xf'),auth[_0x8108('0xd')](),controller['getMembers']);router[_0x8108('0xa')]('/:id/teams',auth[_0x8108('0xd')](),controller['getTeams']);router[_0x8108('0xa')](_0x8108('0x10'),auth[_0x8108('0xd')](),controller[_0x8108('0x11')]);router[_0x8108('0x12')]('/',auth[_0x8108('0xd')](),controller[_0x8108('0x13')]);router[_0x8108('0x12')](_0x8108('0x14'),auth['isAuthenticated'](),controller[_0x8108('0x15')]);router['post']('/:id/users',auth[_0x8108('0xd')](),controller[_0x8108('0x16')]);router[_0x8108('0x17')]('/:id',auth[_0x8108('0xd')](),controller[_0x8108('0x18')]);router[_0x8108('0x19')](_0x8108('0x1a'),auth['isAuthenticated'](),controller[_0x8108('0x1b')]);router[_0x8108('0x19')](_0x8108('0x14'),auth['isAuthenticated'](),controller[_0x8108('0x1c')]);router[_0x8108('0x19')]('/:id/users',auth[_0x8108('0xd')](),controller[_0x8108('0x1d')]);module[_0x8108('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 7494b60..f79a3f3 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 _0xcda3=['exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0xf6bb7d,_0x8af4f5){var _0x132764=function(_0x4f6309){while(--_0x4f6309){_0xf6bb7d['push'](_0xf6bb7d['shift']());}};_0x132764(++_0x8af4f5);}(_0xcda3,0x1ce));var _0x3cda=function(_0x438685,_0x4ec0c0){_0x438685=_0x438685-0x0;var _0x41cca2=_0xcda3[_0x438685];return _0x41cca2;};'use strict';var Sequelize=require('sequelize');module[_0x3cda('0x0')]={'name':{'type':Sequelize[_0x3cda('0x1')],'unique':_0x3cda('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3cda('0x1')]},'timeout':{'type':Sequelize[_0x3cda('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3cda('0x4')]('rrmemory',_0x3cda('0x5'),_0x3cda('0x6'))}}; \ No newline at end of file +var _0x0362=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x0362,0xfa));var _0x2036=function(_0x57bda0,_0x66c699){_0x57bda0=_0x57bda0-0x0;var _0x199f64=_0x0362[_0x57bda0];return _0x199f64;};'use strict';var Sequelize=require(_0x2036('0x0'));module[_0x2036('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2036('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2036('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2036('0x4')](_0x2036('0x5'),_0x2036('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 50fb9c7..ced056d 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 _0x2ef3=['intersection','attributes','model','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','describe','getMembers','findOne','UserSmsQueue','filters','hasOwnProperty','order','sort','pick','SmsQueueId','filter','User','findAndCountAll','agent','updatedAt','createdAt','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','flatMap','each','findOrCreate','removeTeams','Agents','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','TeamId','union','compact','value','transaction','isEmpty','emit','addAgents','spread','userSmsQueue:save','removeAgents','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','get','SmsQueues','UserProfileResource','name','map','SmsQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys'];(function(_0x4b189d,_0xeb32c){var _0x2dd116=function(_0x224775){while(--_0x224775){_0x4b189d['push'](_0x4b189d['shift']());}};_0x2dd116(++_0xeb32c);}(_0x2ef3,0xba));var _0x32ef=function(_0x471539,_0x1ed4d6){_0x471539=_0x471539-0x0;var _0x2c587f=_0x2ef3[_0x471539];return _0x2c587f;};'use strict';var BPromise=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));var squel=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var qs=require(_0x32ef('0x5'));var logger=require('../../config/logger')(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x8')]=_[_0x32ef('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x32ef('0xa'))(new Redis(config[_0x32ef('0x8')]));require(_0x32ef('0xb'))[_0x32ef('0xc')](socket);function respondWithStatusCode(_0x234863,_0x298066){_0x298066=_0x298066||0xcc;return function(_0x2484a0){if(_0x2484a0){return _0x234863[_0x32ef('0xd')](_0x298066);}return _0x234863[_0x32ef('0xe')](_0x298066)[_0x32ef('0xf')]();};}function respondWithResult(_0x56eb42,_0x5780e9){_0x5780e9=_0x5780e9||0xc8;return function(_0x401d0b){if(_0x401d0b){return _0x56eb42[_0x32ef('0xe')](_0x5780e9)[_0x32ef('0x10')](_0x401d0b);}};}function respondWithFilteredResult(_0x1499c2,_0x5af651){return function(_0x193714){if(_0x193714){var _0x5afcc2=typeof _0x5af651[_0x32ef('0x11')]==='undefined'&&typeof _0x5af651[_0x32ef('0x12')]===_0x32ef('0x13');var _0x5c3eb9=_0x193714['count'];var _0x19ce1=_0x5afcc2?0x0:_0x5af651['offset'];var _0x326fce=_0x5afcc2?_0x193714[_0x32ef('0x14')]:_0x5af651[_0x32ef('0x11')]+_0x5af651[_0x32ef('0x12')];var _0x57aff1;if(_0x326fce>=_0x5c3eb9){_0x326fce=_0x5c3eb9;_0x57aff1=0xc8;}else{_0x57aff1=0xce;}_0x1499c2['status'](_0x57aff1);return _0x1499c2['set'](_0x32ef('0x15'),_0x19ce1+'-'+_0x326fce+'/'+_0x5c3eb9)[_0x32ef('0x10')](_0x193714);}return null;};}function saveUpdates(_0xb5aed2){return function(_0x53a5ca){if(_0x53a5ca){return _0x53a5ca['update'](_0xb5aed2)[_0x32ef('0x16')](function(_0x1a9476){return _0x1a9476;});}return null;};}function removeEntity(_0x286bfb){return function(_0x57863c){if(_0x57863c){return _0x57863c[_0x32ef('0x17')]()[_0x32ef('0x16')](function(){var _0x4f4c98=_0x57863c[_0x32ef('0x18')]({'plain':!![]});var _0x314ef1=_0x32ef('0x19');return db[_0x32ef('0x1a')][_0x32ef('0x17')]({'where':{'type':_0x314ef1,'resourceId':_0x4f4c98['id']}})[_0x32ef('0x16')](function(){return _0x57863c;});})['then'](function(){_0x286bfb[_0x32ef('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309866){return function(_0x3a20ca){if(!_0x3a20ca){_0x309866['sendStatus'](0x194);}return _0x3a20ca;};}function handleError(_0x1af371,_0x97780){_0x97780=_0x97780||0x1f4;return function(_0x5e8898){logger['error'](_0x5e8898['stack']);if(_0x5e8898[_0x32ef('0x1b')]){delete _0x5e8898[_0x32ef('0x1b')];}_0x1af371[_0x32ef('0xe')](_0x97780)['send'](_0x5e8898);};}exports['index']=function(_0x19ea6,_0x4d584b){var _0x51a412={};var _0x278495={'count':0x0,'rows':[]};var _0x14d4b3=_[_0x32ef('0x1c')](db[_0x32ef('0x1d')][_0x32ef('0x1e')],function(_0x234175){return{'name':_0x234175[_0x32ef('0x1f')],'type':_0x234175[_0x32ef('0x20')][_0x32ef('0x21')]};});_0x51a412=qs[_0x32ef('0x22')](_0x14d4b3,_0x19ea6);var _0x1335e2={'where':_0x51a412[_0x32ef('0x23')]};return db['SmsQueue'][_0x32ef('0x14')](_0x1335e2)[_0x32ef('0x16')](function(_0x5a04cd){_0x278495[_0x32ef('0x14')]=_0x5a04cd;_0x51a412[_0x32ef('0x24')]=qs[_0x32ef('0x24')](_0x19ea6[_0x32ef('0x25')]);return db['SmsQueue'][_0x32ef('0x26')](_0x51a412);})[_0x32ef('0x16')](function(_0x31dbc3){_0x278495[_0x32ef('0x27')]=_0x31dbc3;return _0x278495;})[_0x32ef('0x16')](respondWithFilteredResult(_0x4d584b,_0x51a412))[_0x32ef('0x28')](handleError(_0x4d584b,null));};exports[_0x32ef('0x29')]=function(_0x575f3e,_0x36ac37){var _0x537214={'raw':!![],'where':{'id':_0x575f3e[_0x32ef('0x2a')]['id']}},_0x38bf73={};_0x38bf73['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x1d')][_0x32ef('0x1e')]);_0x38bf73[_0x32ef('0x25')]=_[_0x32ef('0x2b')](_0x575f3e['query']);_0x38bf73['filters']=_[_0x32ef('0x2c')](_0x38bf73['model'],_0x38bf73[_0x32ef('0x25')]);_0x537214[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x38bf73[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x575f3e[_0x32ef('0x25')]['fields']));_0x537214['attributes']=_0x537214['attributes'][_0x32ef('0x30')]?_0x537214[_0x32ef('0x2d')]:_0x38bf73[_0x32ef('0x2e')];if(_0x575f3e['query']['includeAll']){_0x537214[_0x32ef('0x24')]=[{'all':!![]}];}_0x537214=_[_0x32ef('0x31')]({},_0x537214,_0x575f3e[_0x32ef('0x32')]);return db['SmsQueue']['find'](_0x537214)[_0x32ef('0x16')](handleEntityNotFound(_0x36ac37,null))[_0x32ef('0x16')](respondWithResult(_0x36ac37,null))[_0x32ef('0x28')](handleError(_0x36ac37,null));};exports[_0x32ef('0x33')]=function(_0x3a7c49,_0x211c79){return db[_0x32ef('0x1d')][_0x32ef('0x33')](_0x3a7c49[_0x32ef('0x34')],{})['then'](function(_0x3a4a99){var _0x36e374=_0x3a7c49[_0x32ef('0x35')]['get']({'plain':!![]});if(!_0x36e374)throw new Error(_0x32ef('0x36'));if(_0x36e374[_0x32ef('0x37')]===_0x32ef('0x35')){var _0x393a89=_0x3a4a99[_0x32ef('0x18')]({'plain':!![]});var _0x33a0fb=_0x32ef('0x19');return db[_0x32ef('0x38')][_0x32ef('0x39')]({'where':{'name':_0x33a0fb,'userProfileId':_0x36e374[_0x32ef('0x3a')]},'raw':!![]})[_0x32ef('0x16')](function(_0x4615b4){if(_0x4615b4&&_0x4615b4['autoAssociation']===0x0){return db[_0x32ef('0x1a')][_0x32ef('0x33')]({'name':_0x393a89[_0x32ef('0x1b')],'resourceId':_0x393a89['id'],'type':_0x4615b4[_0x32ef('0x1b')],'sectionId':_0x4615b4['id']},{})[_0x32ef('0x16')](function(){return _0x3a4a99;});}else{return _0x3a4a99;}})[_0x32ef('0x28')](function(_0x3c0e44){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c0e44);throw _0x3c0e44;});}return _0x3a4a99;})[_0x32ef('0x16')](respondWithResult(_0x211c79,0xc9))[_0x32ef('0x28')](handleError(_0x211c79,null));};exports[_0x32ef('0x3b')]=function(_0x765c63,_0x5dca14){if(_0x765c63[_0x32ef('0x34')]['id']){delete _0x765c63[_0x32ef('0x34')]['id'];}return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0x765c63['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x16')](saveUpdates(_0x765c63[_0x32ef('0x34')],null))[_0x32ef('0x16')](respondWithResult(_0x5dca14,null))[_0x32ef('0x28')](handleError(_0x5dca14,null));};exports[_0x32ef('0x17')]=function(_0x321ef7,_0x3d35a1){return db[_0x32ef('0x1d')][_0x32ef('0x39')]({'where':{'id':_0x321ef7['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x3d35a1,null))['then'](removeEntity(_0x3d35a1,null))[_0x32ef('0x28')](handleError(_0x3d35a1,null));};exports[_0x32ef('0x3c')]=function(_0x2dd94f,_0x4d8393){return db[_0x32ef('0x1d')][_0x32ef('0x3c')]()[_0x32ef('0x16')](respondWithResult(_0x4d8393,null))[_0x32ef('0x28')](handleError(_0x4d8393,null));};exports[_0x32ef('0x3d')]=function(_0x40bf12,_0x12c9e6){var _0x47dbe1={'raw':!![],'where':{}},_0x5cb6fc={},_0x36252c;return db[_0x32ef('0x1d')][_0x32ef('0x3e')]({'where':{'id':_0x40bf12[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x12c9e6,null))[_0x32ef('0x16')](function(_0x44ad11){if(_0x44ad11){_0x36252c=_0x44ad11[_0x32ef('0x18')]({'plain':!![]});_0x5cb6fc[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x3f')][_0x32ef('0x1e')]);_0x5cb6fc[_0x32ef('0x25')]=_['keys'](_0x40bf12[_0x32ef('0x25')]);_0x5cb6fc[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],_0x5cb6fc[_0x32ef('0x25')]);_0x47dbe1[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x47dbe1[_0x32ef('0x2d')]=_0x47dbe1[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x47dbe1[_0x32ef('0x2d')]:_0x5cb6fc[_0x32ef('0x2e')];if(!_0x40bf12[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x47dbe1['limit']=qs[_0x32ef('0x12')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x12')]);_0x47dbe1[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x11')]);}_0x47dbe1[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x43')]);_0x47dbe1['where']=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x40bf12[_0x32ef('0x25')],_0x5cb6fc[_0x32ef('0x40')]));_0x47dbe1[_0x32ef('0x23')][_0x32ef('0x45')]=_0x44ad11['id'];if(_0x40bf12['query'][_0x32ef('0x46')]){_0x47dbe1[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x47dbe1['where'],{'$or':_[_0x32ef('0x1c')](_0x47dbe1['attributes'],function(_0x2ee3dd){var _0xbe35b={};_0xbe35b[_0x2ee3dd]={'$like':'%'+_0x40bf12['query'][_0x32ef('0x46')]+'%'};return _0xbe35b;})});}_0x47dbe1=_['merge']({},_0x47dbe1,_0x40bf12[_0x32ef('0x32')]);return db[_0x32ef('0x3f')][_0x32ef('0x26')](_0x47dbe1);}})[_0x32ef('0x16')](function(_0x2c7bee){if(_0x2c7bee){return db[_0x32ef('0x47')][_0x32ef('0x48')]({'where':{'id':_['map'](_0x2c7bee,'UserId'),'role':_0x32ef('0x49')},'attributes':['id','name','smsPause',_0x32ef('0x4a'),_0x32ef('0x4b')]});}})[_0x32ef('0x16')](function(_0x6aae59){if(_0x6aae59){return{'count':_0x6aae59[_0x32ef('0x14')],'rows':_[_0x32ef('0x1c')](_0x6aae59[_0x32ef('0x27')],function(_0x4249c3){return{'membername':_0x4249c3[_0x32ef('0x1b')],'UserId':_0x4249c3['id'],'queue_name':_0x36252c[_0x32ef('0x1b')],'SmsQueueId':_0x36252c['id'],'interface':util['format']('%s/%s',_0x32ef('0x4c'),_0x4249c3[_0x32ef('0x1b')]),'penalty':0x0,'paused':_0x4249c3['smsPause'],'createdAt':_0x4249c3[_0x32ef('0x4b')],'updatedAt':_0x4249c3[_0x32ef('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x32ef('0x16')](respondWithFilteredResult(_0x12c9e6,_0x47dbe1))['catch'](handleError(_0x12c9e6,null));};exports[_0x32ef('0x4d')]=function(_0x3c31d0,_0x20dcc5){var _0x52dfe0={};var _0x5e6030={};var _0x13ea1a;var _0x47d8bf;return db[_0x32ef('0x1d')]['findOne']({'where':{'id':_0x3c31d0['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x20dcc5,null))[_0x32ef('0x16')](function(_0x10cb37){if(_0x10cb37){_0x13ea1a=_0x10cb37;_0x5e6030['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x4e')][_0x32ef('0x1e')]);_0x5e6030['query']=_[_0x32ef('0x2b')](_0x3c31d0[_0x32ef('0x25')]);_0x5e6030['filters']=_['intersection'](_0x5e6030[_0x32ef('0x2e')],_0x5e6030[_0x32ef('0x25')]);_0x52dfe0[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5e6030[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x3c31d0['query'][_0x32ef('0x2f')]));_0x52dfe0[_0x32ef('0x2d')]=_0x52dfe0[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x52dfe0[_0x32ef('0x2d')]:_0x5e6030[_0x32ef('0x2e')];_0x52dfe0[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x3c31d0[_0x32ef('0x25')]['sort']);_0x52dfe0[_0x32ef('0x23')]=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x3c31d0[_0x32ef('0x25')],_0x5e6030[_0x32ef('0x40')]));if(_0x3c31d0['query']['filter']){_0x52dfe0[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x52dfe0[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x52dfe0[_0x32ef('0x2d')],function(_0x526fb1){var _0x3372d9={};_0x3372d9[_0x526fb1]={'$like':'%'+_0x3c31d0['query'][_0x32ef('0x46')]+'%'};return _0x3372d9;})});}_0x52dfe0=_[_0x32ef('0x31')]({},_0x52dfe0,_0x3c31d0['options']);return _0x13ea1a['getTeams'](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x1538d0){if(_0x1538d0){_0x47d8bf=_0x1538d0[_0x32ef('0x30')];if(!_0x3c31d0['query']['hasOwnProperty'](_0x32ef('0x4f'))){_0x52dfe0[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x3c31d0[_0x32ef('0x25')]['limit']);_0x52dfe0[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x3c31d0[_0x32ef('0x25')][_0x32ef('0x11')]);}return _0x13ea1a[_0x32ef('0x4d')](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x43b176){if(_0x43b176){return _0x43b176?{'count':_0x47d8bf,'rows':_0x43b176}:null;}})[_0x32ef('0x16')](respondWithResult(_0x20dcc5,null))[_0x32ef('0x28')](handleError(_0x20dcc5,null));};exports[_0x32ef('0x50')]=function(_0x132d9f,_0x3978cb){var _0x52b32f=_0x132d9f['body'][_0x32ef('0x51')];return db[_0x32ef('0x4e')]['findAll']({'where':{'id':_0x52b32f},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':'Agents','attributes':['id',_0x32ef('0x1b'),_0x32ef('0x52'),_0x32ef('0x53'),'interface'],'raw':!![]}]})[_0x32ef('0x16')](function(_0x4978a6){if(_0x4978a6){var _0x141fec=_[_0x32ef('0x54')](_0x4978a6,function(_0x47e3cc){var _0x4c70e0=_0x47e3cc[_0x32ef('0x18')]({'plain':!![]});return _0x4c70e0['Agents'];});return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x132d9f[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](function(_0x1adcb8){return db['sequelize']['transaction'](function(_0x4f1b94){return _0x1adcb8[_0x32ef('0x50')](_0x52b32f,{'transaction':_0x4f1b94})['then'](function(){return BPromise[_0x32ef('0x55')](_0x141fec,function(_0x13a374){return db[_0x32ef('0x3f')][_0x32ef('0x56')]({'where':{'UserId':_0x13a374['id'],'SmsQueueId':_0x132d9f[_0x32ef('0x2a')]['id']},'transaction':_0x4f1b94});});})[_0x32ef('0x16')](function(){_0x141fec['forEach'](function(_0x3d9245){socket['emit']('userSmsQueue:save',{'UserId':_0x3d9245['id'],'SmsQueueId':_0x1adcb8['id']});});});});});}})[_0x32ef('0x16')](respondWithStatusCode(_0x3978cb,null))['catch'](handleError(_0x3978cb,null));};exports[_0x32ef('0x57')]=function(_0x313798,_0x4d64ec){return db[_0x32ef('0x4e')][_0x32ef('0x26')]({'where':{'id':_0x313798[_0x32ef('0x25')][_0x32ef('0x51')]},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':_0x32ef('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d64ec,null))['then'](function(_0x35b10d){var _0x5e0b55=_[_0x32ef('0x1c')](_0x35b10d,'id');var _0x266688=[];var _0x114d8e=[];var _0x1782a5=squel[_0x32ef('0x59')]();_0x1782a5[_0x32ef('0x5a')]('tq.TeamId')[_0x32ef('0x5b')](_0x32ef('0x5c'),'tq')[_0x32ef('0x5d')](_0x32ef('0x5e'),'ut',_0x32ef('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x313798[_0x32ef('0x2a')]['id']);for(var _0x904a4f=0x0;_0x904a4f<_0x35b10d['length'];_0x904a4f+=0x1){let _0x211fb1=_0x35b10d[_0x904a4f];for(var _0x2e333d=0x0;_0x2e333d<_0x211fb1[_0x32ef('0x58')][_0x32ef('0x30')];_0x2e333d+=0x1){let _0xc3664d=_0x211fb1[_0x32ef('0x58')][_0x2e333d];var _0xfb4845=_0x1782a5[_0x32ef('0x60')]();_0xfb4845[_0x32ef('0x23')]('ut.UserId\x20=\x20?',_0xc3664d['id']);_0x114d8e[_0x32ef('0x61')](db[_0x32ef('0x62')]['query'](_0xfb4845[_0x32ef('0x63')](),{'type':db['sequelize'][_0x32ef('0x64')]['SELECT']})[_0x32ef('0x16')](function(_0x39300f){if(_0x39300f[_0x32ef('0x30')]===0x1){return _0xc3664d['id'];}else{var _0x3e000c=_['every'](_[_0x32ef('0x1c')](_0x39300f,_0x32ef('0x65')),function(_0x31f99f){return _['includes'](_0x5e0b55,_0x31f99f);});if(_0x3e000c){return _0xc3664d['id'];}}}));}}return BPromise['all'](_0x114d8e)['then'](function(_0x1aff33){_0x266688=_(_0x266688)[_0x32ef('0x66')](_0x1aff33)[_0x32ef('0x67')]()[_0x32ef('0x68')]();return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x313798[_0x32ef('0x2a')]['id']}})['then'](function(_0x471de6){return db[_0x32ef('0x62')][_0x32ef('0x69')](function(_0x4baa7a){return _0x471de6[_0x32ef('0x57')](_0x313798[_0x32ef('0x25')][_0x32ef('0x51')],{'transaction':_0x4baa7a})[_0x32ef('0x16')](function(){if(!_[_0x32ef('0x6a')](_0x266688)){return _0x471de6['removeAgents'](_0x266688,{'transaction':_0x4baa7a});}})[_0x32ef('0x16')](function(){_0x266688['forEach'](function(_0x4f0433){socket[_0x32ef('0x6b')]('userSmsQueue:remove',{'UserId':_0x4f0433,'SmsQueueId':_0x471de6['id']});});});});});});})['then'](respondWithStatusCode(_0x4d64ec,null))[_0x32ef('0x28')](handleError(_0x4d64ec,null));};exports[_0x32ef('0x6c')]=function(_0xf6bc02,_0x3b9896){return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0xf6bc02['params']['id']}})['then'](handleEntityNotFound(_0x3b9896,null))[_0x32ef('0x16')](function(_0x56aede){if(_0x56aede){return _0x56aede[_0x32ef('0x6c')](_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')],_['omit'](_0xf6bc02['body'],[_0x32ef('0x51'),'id'])||{})[_0x32ef('0x6d')](function(_0x2c4a3c){for(var _0x3741f8=0x0;_0x3741f8<_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x32ef('0x30')];_0x3741f8+=0x1){socket['emit'](_0x32ef('0x6e'),{'UserId':Number(_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x3741f8]),'SmsQueueId':Number(_0xf6bc02[_0x32ef('0x2a')]['id'])});}return _0x2c4a3c;});}})['then'](respondWithResult(_0x3b9896,null))['catch'](handleError(_0x3b9896,null));};exports[_0x32ef('0x6f')]=function(_0x5eb320,_0x116951){return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x5eb320['params']['id']}})['then'](handleEntityNotFound(_0x116951,null))[_0x32ef('0x16')](function(_0x33f6c3){if(_0x33f6c3){return _0x33f6c3[_0x32ef('0x6f')](_0x5eb320[_0x32ef('0x25')]['ids'])[_0x32ef('0x16')](function(){if(_[_0x32ef('0x70')](_0x5eb320[_0x32ef('0x25')]['ids'])){for(var _0x2895ad=0x0;_0x2895ad<_0x5eb320['query'][_0x32ef('0x51')][_0x32ef('0x30')];_0x2895ad+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')][_0x2895ad]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}}else{socket[_0x32ef('0x6b')](_0x32ef('0x71'),{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}});}})[_0x32ef('0x16')](respondWithStatusCode(_0x116951,null))['catch'](handleError(_0x116951,null));};exports[_0x32ef('0x72')]=function(_0x583290,_0x22d657){var _0x7e47b9={};var _0x1d9d57={};var _0x18cf5d;var _0x102f2f;return db['SmsQueue'][_0x32ef('0x3e')]({'where':{'id':_0x583290[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x22d657,null))[_0x32ef('0x16')](function(_0x1db74d){if(_0x1db74d){_0x18cf5d=_0x1db74d;_0x1d9d57[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x47')][_0x32ef('0x1e')]);_0x1d9d57['query']=_['keys'](_0x583290['query']);_0x1d9d57[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x1d9d57['model'],_0x1d9d57[_0x32ef('0x25')]);_0x7e47b9['attributes']=_[_0x32ef('0x2c')](_0x1d9d57['model'],qs['fields'](_0x583290[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x7e47b9[_0x32ef('0x2d')]=_0x7e47b9[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x7e47b9['attributes']:_0x1d9d57[_0x32ef('0x2e')];_0x7e47b9['order']=qs[_0x32ef('0x43')](_0x583290['query']['sort']);_0x7e47b9['where']=qs['filters'](_['pick'](_0x583290[_0x32ef('0x25')],_0x1d9d57[_0x32ef('0x40')]));if(_0x583290['query'][_0x32ef('0x46')]){_0x7e47b9[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x7e47b9[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x7e47b9[_0x32ef('0x2d')],function(_0x59f0aa){var _0x2ac861={};_0x2ac861[_0x59f0aa]={'$like':'%'+_0x583290['query'][_0x32ef('0x46')]+'%'};return _0x2ac861;})});}_0x7e47b9=_[_0x32ef('0x31')]({},_0x7e47b9,_0x583290['options']);return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})['then'](function(_0x4557b0){if(_0x4557b0){_0x102f2f=_0x4557b0[_0x32ef('0x30')];if(!_0x583290[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x7e47b9[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x583290[_0x32ef('0x25')][_0x32ef('0x12')]);_0x7e47b9['offset']=qs[_0x32ef('0x11')](_0x583290['query'][_0x32ef('0x11')]);}return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})[_0x32ef('0x16')](function(_0x28ef17){if(_0x28ef17){return _0x28ef17?{'count':_0x102f2f,'rows':_0x28ef17}:null;}})[_0x32ef('0x16')](respondWithResult(_0x22d657,null))[_0x32ef('0x28')](handleError(_0x22d657,null));}; \ No newline at end of file +var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0xadb5,0xad));var _0x5adb=function(_0x116fdf,_0x780dd8){_0x116fdf=_0x116fdf-0x0;var _0x4e45b9=_0xadb5[_0x116fdf];return _0x4e45b9;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index fa59f72..a64a833 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 _0x12b5=['../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','exports','events'];(function(_0x55d58c,_0x2bb1a1){var _0x4a22de=function(_0xd82d2e){while(--_0xd82d2e){_0x55d58c['push'](_0x55d58c['shift']());}};_0x4a22de(++_0x2bb1a1);}(_0x12b5,0xff));var _0x512b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12b5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x512b('0x0'));var SmsQueue=require(_0x512b('0x1'))['db'][_0x512b('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x512b('0x3')](0x0);var events={'afterCreate':_0x512b('0x4'),'afterUpdate':_0x512b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x127213){return function(_0x3e8155,_0xf64163,_0x1a6c80){SmsQueueEvents[_0x512b('0x6')](_0x127213+':'+_0x3e8155['id'],_0x3e8155);SmsQueueEvents[_0x512b('0x6')](_0x127213,_0x3e8155);_0x1a6c80(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x512b('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x1531=['emit','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1531,0x92));var _0x1153=function(_0x199896,_0x2aeb21){_0x199896=_0x199896-0x0;var _0x15faa3=_0x1531[_0x199896];return _0x15faa3;};'use strict';var EventEmitter=require(_0x1153('0x0'));var SmsQueue=require(_0x1153('0x1'))['db'][_0x1153('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1153('0x3')](0x0);var events={'afterCreate':_0x1153('0x4'),'afterUpdate':'update','afterDestroy':_0x1153('0x5')};function emitEvent(_0x72c04c){return function(_0x53b9ae,_0x1a9046,_0x3862f8){SmsQueueEvents['emit'](_0x72c04c+':'+_0x53b9ae['id'],_0x53b9ae);SmsQueueEvents[_0x1153('0x6')](_0x72c04c,_0x53b9ae);_0x3862f8(null);};}for(var e in events){if(events[_0x1153('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 1cf7493..d2d4f26 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 _0x64d0=['bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','../../config/logger'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x64d0,0x11e));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x064d('0x0'));var util=require('util');var logger=require(_0x064d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x064d('0x2'));var rp=require(_0x064d('0x3'));var fs=require('fs');var path=require(_0x064d('0x4'));var rimraf=require(_0x064d('0x5'));var config=require(_0x064d('0x6'));var attributes=require(_0x064d('0x7'));module[_0x064d('0x8')]=function(_0x3838e7,_0x3d37fa){return _0x3838e7[_0x064d('0x9')](_0x064d('0xa'),attributes,{'tableName':_0x064d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x865a=['./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x3b3971,_0x3a62d7){var _0xbcd3dc=function(_0x2ee7fc){while(--_0x2ee7fc){_0x3b3971['push'](_0x3b3971['shift']());}};_0xbcd3dc(++_0x3a62d7);}(_0x865a,0x16d));var _0xa865=function(_0x1c3785,_0x28d73c){_0x1c3785=_0x1c3785-0x0;var _0x2aedbe=_0x865a[_0x1c3785];return _0x2aedbe;};'use strict';var _=require(_0xa865('0x0'));var util=require(_0xa865('0x1'));var logger=require('../../config/logger')(_0xa865('0x2'));var moment=require(_0xa865('0x3'));var BPromise=require(_0xa865('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa865('0x5'));var rimraf=require(_0xa865('0x6'));var config=require('../../config/environment');var attributes=require(_0xa865('0x7'));module[_0xa865('0x8')]=function(_0x2c1e41,_0xf3a283){return _0x2c1e41[_0xa865('0x9')](_0xa865('0xa'),attributes,{'tableName':_0xa865('0xb'),'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 d9df9e4..bf83d61 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 _0xbf95=['SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','attributes','limit','include','model','map','GetSmsQueue','ShowSmsQueue','SmsQueue','find','where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsQueue.socket','register','request','then','request\x20sent','debug'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0xbf95,0x68));var _0x5bf9=function(_0x5c861d,_0xed9768){_0x5c861d=_0x5c861d-0x0;var _0x42eac5=_0xbf95[_0x5c861d];return _0x42eac5;};'use strict';var _=require(_0x5bf9('0x0'));var util=require('util');var moment=require(_0x5bf9('0x1'));var BPromise=require(_0x5bf9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bf9('0x3'));var db=require(_0x5bf9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bf9('0x5'))(_0x5bf9('0x6'));var config=require(_0x5bf9('0x7'));var jayson=require(_0x5bf9('0x8'));var client=jayson[_0x5bf9('0x9')][_0x5bf9('0xa')]({'port':0x232a});config[_0x5bf9('0xb')]=_[_0x5bf9('0xc')](config[_0x5bf9('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bf9('0xb')]));require(_0x5bf9('0xd'))[_0x5bf9('0xe')](socket);function respondWithRpcPromise(_0x479b71,_0x1e7598,_0x1a5baa){return new BPromise(function(_0x546186,_0x3263c3){return client[_0x5bf9('0xf')](_0x479b71,_0x1a5baa)[_0x5bf9('0x10')](function(_0x14b59a){logger['info']('SmsQueue,\x20%s,\x20%s',_0x1e7598,_0x5bf9('0x11'));logger[_0x5bf9('0x12')](_0x5bf9('0x13'),_0x1e7598,_0x5bf9('0x11'),JSON[_0x5bf9('0x14')](_0x14b59a));if(_0x14b59a[_0x5bf9('0x15')]){if(_0x14b59a['error'][_0x5bf9('0x16')]===0x1f4){logger[_0x5bf9('0x15')](_0x5bf9('0x17'),_0x1e7598,_0x14b59a['error']['message']);return _0x3263c3(_0x14b59a[_0x5bf9('0x15')][_0x5bf9('0x18')]);}logger[_0x5bf9('0x15')]('SmsQueue,\x20%s,\x20%s',_0x1e7598,_0x14b59a[_0x5bf9('0x15')][_0x5bf9('0x18')]);return _0x546186(_0x14b59a['error'][_0x5bf9('0x18')]);}else{logger[_0x5bf9('0x19')](_0x5bf9('0x17'),_0x1e7598,_0x5bf9('0x11'));_0x546186(_0x14b59a[_0x5bf9('0x1a')][_0x5bf9('0x18')]);}})[_0x5bf9('0x1b')](function(_0x1ecdce){logger['error'](_0x5bf9('0x17'),_0x1e7598,_0x1ecdce);_0x3263c3(_0x1ecdce);});});}exports['GetSmsQueue']=function(_0x1408ce){var _0x44292c=this;return new Promise(function(_0x2f3b9c,_0xf955d9){return db['SmsQueue'][_0x5bf9('0x1c')]({'raw':_0x1408ce[_0x5bf9('0x1d')]?_0x1408ce[_0x5bf9('0x1d')][_0x5bf9('0x1e')]===undefined?!![]:![]:!![],'where':_0x1408ce['options']?_0x1408ce[_0x5bf9('0x1d')]['where']||null:null,'attributes':_0x1408ce[_0x5bf9('0x1d')]?_0x1408ce['options'][_0x5bf9('0x1f')]||null:null,'limit':_0x1408ce['options']?_0x1408ce['options'][_0x5bf9('0x20')]||null:null,'include':_0x1408ce[_0x5bf9('0x1d')]?_0x1408ce[_0x5bf9('0x1d')][_0x5bf9('0x21')]?_['map'](_0x1408ce['options'][_0x5bf9('0x21')],function(_0x2be179){return{'model':db[_0x2be179['model']],'as':_0x2be179['as'],'attributes':_0x2be179[_0x5bf9('0x1f')],'include':_0x2be179[_0x5bf9('0x21')]?_['map'](_0x2be179[_0x5bf9('0x21')],function(_0x46249f){return{'model':db[_0x46249f[_0x5bf9('0x22')]],'as':_0x46249f['as'],'attributes':_0x46249f[_0x5bf9('0x1f')],'include':_0x46249f[_0x5bf9('0x21')]?_[_0x5bf9('0x23')](_0x46249f[_0x5bf9('0x21')],function(_0x14f3b5){return{'model':db[_0x14f3b5[_0x5bf9('0x22')]],'as':_0x14f3b5['as'],'attributes':_0x14f3b5['attributes']};}):[]};}):[]};}):[]:[]})[_0x5bf9('0x10')](function(_0x3e47ea){logger['info'](_0x5bf9('0x24'),_0x1408ce);logger[_0x5bf9('0x12')]('GetSmsQueue',_0x1408ce,JSON['stringify'](_0x3e47ea));_0x2f3b9c(_0x3e47ea);})[_0x5bf9('0x1b')](function(_0x52c95a){logger[_0x5bf9('0x15')](_0x5bf9('0x24'),_0x52c95a['message'],_0x1408ce);_0xf955d9(_0x44292c[_0x5bf9('0x15')](0x1f4,_0x52c95a[_0x5bf9('0x18')]));});});};exports[_0x5bf9('0x25')]=function(_0x3b8cdd){var _0x35130a=this;return new Promise(function(_0x446770,_0x5d4e74){return db[_0x5bf9('0x26')][_0x5bf9('0x27')]({'raw':_0x3b8cdd[_0x5bf9('0x1d')]?_0x3b8cdd[_0x5bf9('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3b8cdd[_0x5bf9('0x1d')]?_0x3b8cdd['options'][_0x5bf9('0x28')]||null:null,'attributes':_0x3b8cdd[_0x5bf9('0x1d')]?_0x3b8cdd[_0x5bf9('0x1d')]['attributes']||null:null,'include':_0x3b8cdd[_0x5bf9('0x1d')]?_0x3b8cdd['options'][_0x5bf9('0x21')]?_['map'](_0x3b8cdd[_0x5bf9('0x1d')][_0x5bf9('0x21')],function(_0x4bf42d){return{'model':db[_0x4bf42d[_0x5bf9('0x22')]],'as':_0x4bf42d['as'],'attributes':_0x4bf42d['attributes'],'include':_0x4bf42d['include']?_[_0x5bf9('0x23')](_0x4bf42d['include'],function(_0x5c3c9b){return{'model':db[_0x5c3c9b[_0x5bf9('0x22')]],'as':_0x5c3c9b['as'],'attributes':_0x5c3c9b[_0x5bf9('0x1f')],'include':_0x5c3c9b[_0x5bf9('0x21')]?_[_0x5bf9('0x23')](_0x5c3c9b[_0x5bf9('0x21')],function(_0x2092a7){return{'model':db[_0x2092a7['model']],'as':_0x2092a7['as'],'attributes':_0x2092a7[_0x5bf9('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c1351){logger[_0x5bf9('0x19')](_0x5bf9('0x25'),_0x3b8cdd);logger[_0x5bf9('0x12')](_0x5bf9('0x25'),_0x3b8cdd,JSON[_0x5bf9('0x14')](_0x3c1351));_0x446770(_0x3c1351);})[_0x5bf9('0x1b')](function(_0x3a16b8){logger['error']('ShowSmsQueue',_0x3a16b8[_0x5bf9('0x18')],_0x3b8cdd);_0x5d4e74(_0x35130a[_0x5bf9('0x15')](0x1f4,_0x3a16b8[_0x5bf9('0x18')]));});});}; \ No newline at end of file +var _0x50e7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsQueue.socket','request','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','raw','options','attributes','limit','map','include','model','info','GetSmsQueue','ShowSmsQueue','SmsQueue','find','where','lodash','util','moment'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x50e7,0xf3));var _0x750e=function(_0x4253b1,_0x29d93f){_0x4253b1=_0x4253b1-0x0;var _0x57870f=_0x50e7[_0x4253b1];return _0x57870f;};'use strict';var _=require(_0x750e('0x0'));var util=require(_0x750e('0x1'));var moment=require(_0x750e('0x2'));var BPromise=require(_0x750e('0x3'));var rs=require(_0x750e('0x4'));var fs=require('fs');var Redis=require(_0x750e('0x5'));var db=require(_0x750e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x750e('0x7'))(_0x750e('0x8'));var config=require(_0x750e('0x9'));var jayson=require(_0x750e('0xa'));var client=jayson['client'][_0x750e('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x750e('0xc')],{'host':_0x750e('0xd'),'port':0x18eb});var socket=require(_0x750e('0xe'))(new Redis(config[_0x750e('0xc')]));require(_0x750e('0xf'))['register'](socket);function respondWithRpcPromise(_0x950226,_0x265218,_0x13c556){return new BPromise(function(_0x14e3e9,_0x3399b7){return client[_0x750e('0x10')](_0x950226,_0x13c556)[_0x750e('0x11')](function(_0x5750f2){logger['info']('SmsQueue,\x20%s,\x20%s',_0x265218,'request\x20sent');logger[_0x750e('0x12')](_0x750e('0x13'),_0x265218,'request\x20sent',JSON[_0x750e('0x14')](_0x5750f2));if(_0x5750f2[_0x750e('0x15')]){if(_0x5750f2[_0x750e('0x15')][_0x750e('0x16')]===0x1f4){logger[_0x750e('0x15')](_0x750e('0x17'),_0x265218,_0x5750f2[_0x750e('0x15')]['message']);return _0x3399b7(_0x5750f2[_0x750e('0x15')][_0x750e('0x18')]);}logger['error'](_0x750e('0x17'),_0x265218,_0x5750f2['error'][_0x750e('0x18')]);return _0x14e3e9(_0x5750f2[_0x750e('0x15')][_0x750e('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x265218,_0x750e('0x19'));_0x14e3e9(_0x5750f2[_0x750e('0x1a')][_0x750e('0x18')]);}})[_0x750e('0x1b')](function(_0x4c6032){logger[_0x750e('0x15')](_0x750e('0x17'),_0x265218,_0x4c6032);_0x3399b7(_0x4c6032);});});}exports['GetSmsQueue']=function(_0x1ef3fd){var _0x163563=this;return new Promise(function(_0x2e9c30,_0x2cddea){return db['SmsQueue']['findAll']({'raw':_0x1ef3fd['options']?_0x1ef3fd['options'][_0x750e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ef3fd[_0x750e('0x1d')]?_0x1ef3fd[_0x750e('0x1d')]['where']||null:null,'attributes':_0x1ef3fd[_0x750e('0x1d')]?_0x1ef3fd[_0x750e('0x1d')][_0x750e('0x1e')]||null:null,'limit':_0x1ef3fd[_0x750e('0x1d')]?_0x1ef3fd[_0x750e('0x1d')][_0x750e('0x1f')]||null:null,'include':_0x1ef3fd[_0x750e('0x1d')]?_0x1ef3fd['options']['include']?_[_0x750e('0x20')](_0x1ef3fd[_0x750e('0x1d')][_0x750e('0x21')],function(_0x476296){return{'model':db[_0x476296[_0x750e('0x22')]],'as':_0x476296['as'],'attributes':_0x476296[_0x750e('0x1e')],'include':_0x476296[_0x750e('0x21')]?_[_0x750e('0x20')](_0x476296['include'],function(_0x677fa3){return{'model':db[_0x677fa3[_0x750e('0x22')]],'as':_0x677fa3['as'],'attributes':_0x677fa3['attributes'],'include':_0x677fa3['include']?_[_0x750e('0x20')](_0x677fa3[_0x750e('0x21')],function(_0x5f3a78){return{'model':db[_0x5f3a78[_0x750e('0x22')]],'as':_0x5f3a78['as'],'attributes':_0x5f3a78[_0x750e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x750e('0x11')](function(_0x5ac614){logger[_0x750e('0x23')](_0x750e('0x24'),_0x1ef3fd);logger[_0x750e('0x12')](_0x750e('0x24'),_0x1ef3fd,JSON[_0x750e('0x14')](_0x5ac614));_0x2e9c30(_0x5ac614);})['catch'](function(_0x4b88b9){logger[_0x750e('0x15')](_0x750e('0x24'),_0x4b88b9[_0x750e('0x18')],_0x1ef3fd);_0x2cddea(_0x163563[_0x750e('0x15')](0x1f4,_0x4b88b9['message']));});});};exports[_0x750e('0x25')]=function(_0x208b5f){var _0x496096=this;return new Promise(function(_0x3d1ae3,_0x1941c0){return db[_0x750e('0x26')][_0x750e('0x27')]({'raw':_0x208b5f[_0x750e('0x1d')]?_0x208b5f[_0x750e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x208b5f['options']?_0x208b5f[_0x750e('0x1d')][_0x750e('0x28')]||null:null,'attributes':_0x208b5f[_0x750e('0x1d')]?_0x208b5f[_0x750e('0x1d')][_0x750e('0x1e')]||null:null,'include':_0x208b5f['options']?_0x208b5f[_0x750e('0x1d')]['include']?_['map'](_0x208b5f[_0x750e('0x1d')][_0x750e('0x21')],function(_0x171be9){return{'model':db[_0x171be9['model']],'as':_0x171be9['as'],'attributes':_0x171be9[_0x750e('0x1e')],'include':_0x171be9[_0x750e('0x21')]?_[_0x750e('0x20')](_0x171be9['include'],function(_0x1512a8){return{'model':db[_0x1512a8[_0x750e('0x22')]],'as':_0x1512a8['as'],'attributes':_0x1512a8[_0x750e('0x1e')],'include':_0x1512a8[_0x750e('0x21')]?_[_0x750e('0x20')](_0x1512a8[_0x750e('0x21')],function(_0x5ee9ec){return{'model':db[_0x5ee9ec['model']],'as':_0x5ee9ec['as'],'attributes':_0x5ee9ec[_0x750e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x750e('0x11')](function(_0x3a216a){logger[_0x750e('0x23')](_0x750e('0x25'),_0x208b5f);logger[_0x750e('0x12')]('ShowSmsQueue',_0x208b5f,JSON[_0x750e('0x14')](_0x3a216a));_0x3d1ae3(_0x3a216a);})[_0x750e('0x1b')](function(_0x1de27a){logger[_0x750e('0x15')](_0x750e('0x25'),_0x1de27a[_0x750e('0x18')],_0x208b5f);_0x1941c0(_0x496096[_0x750e('0x15')](0x1f4,_0x1de27a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 82863d9..f3681cf 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 _0x8436=['save','remove','update','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x11d78d,_0x365ac8){var _0xc9e72a=function(_0x13ca12){while(--_0x13ca12){_0x11d78d['push'](_0x11d78d['shift']());}};_0xc9e72a(++_0x365ac8);}(_0x8436,0x107));var _0x6843=function(_0x443295,_0x150f4c){_0x443295=_0x443295-0x0;var _0x52d00c=_0x8436[_0x443295];return _0x52d00c;};'use strict';var SmsQueueEvents=require(_0x6843('0x0'));var events=[_0x6843('0x1'),_0x6843('0x2'),_0x6843('0x3')];function createListener(_0x47cb05,_0x3c552a){return function(_0x32fb34){_0x3c552a['emit'](_0x47cb05,_0x32fb34);};}function removeListener(_0x3b7b7c,_0x49ad16){return function(){SmsQueueEvents[_0x6843('0x4')](_0x3b7b7c,_0x49ad16);};}exports[_0x6843('0x5')]=function(_0x62f062){for(var _0x272a55=0x0,_0x43902c=events[_0x6843('0x6')];_0x272a55<_0x43902c;_0x272a55++){var _0x1f54af=events[_0x272a55];var _0x16ebd2=createListener(_0x6843('0x7')+_0x1f54af,_0x62f062);SmsQueueEvents['on'](_0x1f54af,_0x16ebd2);}}; \ No newline at end of file +var _0x5cc4=['./smsQueue.events','save','emit','removeListener','length'];(function(_0x2c8e0f,_0x40a015){var _0x2095b0=function(_0x5a40a7){while(--_0x5a40a7){_0x2c8e0f['push'](_0x2c8e0f['shift']());}};_0x2095b0(++_0x40a015);}(_0x5cc4,0x109));var _0x45cc=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x5cc4[_0xa28b1a];return _0x4c9b78;};'use strict';var SmsQueueEvents=require(_0x45cc('0x0'));var events=[_0x45cc('0x1'),'remove','update'];function createListener(_0x2885b6,_0x4081f8){return function(_0x151597){_0x4081f8[_0x45cc('0x2')](_0x2885b6,_0x151597);};}function removeListener(_0x3a53b3,_0x758897){return function(){SmsQueueEvents[_0x45cc('0x3')](_0x3a53b3,_0x758897);};}exports['register']=function(_0x243b1a){for(var _0x557bbe=0x0,_0x4170f1=events[_0x45cc('0x4')];_0x557bbe<_0x4170f1;_0x557bbe++){var _0x2fcebe=events[_0x557bbe];var _0x4475b1=createListener('smsQueue:'+_0x2fcebe,_0x243b1a);SmsQueueEvents['on'](_0x2fcebe,_0x4475b1);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 5819038..759b02b 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 _0x9e78=['./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5712c9,_0x3a6be3){var _0x3a4202=function(_0x19cb1d){while(--_0x19cb1d){_0x5712c9['push'](_0x5712c9['shift']());}};_0x3a4202(++_0x3a6be3);}(_0x9e78,0x14e));var _0x89e7=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x9e78[_0x3ce2c4];return _0x4047c1;};'use strict';var multer=require(_0x89e7('0x0'));var util=require('util');var path=require(_0x89e7('0x1'));var timeout=require(_0x89e7('0x2'));var express=require(_0x89e7('0x3'));var router=express['Router']();var fs_extra=require(_0x89e7('0x4'));var auth=require(_0x89e7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x89e7('0x6'));router[_0x89e7('0x7')]('/',auth['isAuthenticated'](),controller[_0x89e7('0x8')]);router[_0x89e7('0x7')](_0x89e7('0x9'),auth[_0x89e7('0xa')](),controller[_0x89e7('0xb')]);router[_0x89e7('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x89e7('0xc')]);router[_0x89e7('0xd')]('/',auth[_0x89e7('0xa')](),controller['create']);router[_0x89e7('0xe')](_0x89e7('0xf'),auth[_0x89e7('0xa')](),controller[_0x89e7('0x10')]);router[_0x89e7('0x11')](_0x89e7('0xf'),auth[_0x89e7('0xa')](),controller[_0x89e7('0x12')]);module[_0x89e7('0x13')]=router; \ No newline at end of file +var _0xbf16=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','destroy'];(function(_0x272fa1,_0x51f993){var _0x34c959=function(_0x1609db){while(--_0x1609db){_0x272fa1['push'](_0x272fa1['shift']());}};_0x34c959(++_0x51f993);}(_0xbf16,0x73));var _0x6bf1=function(_0x734df4,_0x3fc92a){_0x734df4=_0x734df4-0x0;var _0x16a855=_0xbf16[_0x734df4];return _0x16a855;};'use strict';var multer=require(_0x6bf1('0x0'));var util=require(_0x6bf1('0x1'));var path=require(_0x6bf1('0x2'));var timeout=require('connect-timeout');var express=require(_0x6bf1('0x3'));var router=express['Router']();var fs_extra=require(_0x6bf1('0x4'));var auth=require(_0x6bf1('0x5'));var interaction=require(_0x6bf1('0x6'));var config=require(_0x6bf1('0x7'));var controller=require(_0x6bf1('0x8'));router['get']('/',auth[_0x6bf1('0x9')](),controller[_0x6bf1('0xa')]);router[_0x6bf1('0xb')](_0x6bf1('0xc'),auth[_0x6bf1('0x9')](),controller['describe']);router[_0x6bf1('0xb')](_0x6bf1('0xd'),auth[_0x6bf1('0x9')](),controller[_0x6bf1('0xe')]);router[_0x6bf1('0xf')]('/',auth[_0x6bf1('0x9')](),controller[_0x6bf1('0x10')]);router['put'](_0x6bf1('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6bf1('0xd'),auth[_0x6bf1('0x9')](),controller[_0x6bf1('0x11')]);module[_0x6bf1('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 1104b39..42eed98 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 _0x666b=['DATE','moment','sequelize','exports','STRING'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x666b,0x1b9));var _0xb666=function(_0x52975d,_0x127968){_0x52975d=_0x52975d-0x0;var _0x3baabc=_0x666b[_0x52975d];return _0x3baabc;};'use strict';var moment=require(_0xb666('0x0'));var Sequelize=require(_0xb666('0x1'));module[_0xb666('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb666('0x3')]},'joinAt':{'type':Sequelize[_0xb666('0x4')]},'leaveAt':{'type':Sequelize[_0xb666('0x4')]},'acceptAt':{'type':Sequelize[_0xb666('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7c53=['DATE','moment','STRING'];(function(_0x5f02bf,_0x2b4ad7){var _0x52a087=function(_0x1f61e4){while(--_0x1f61e4){_0x5f02bf['push'](_0x5f02bf['shift']());}};_0x52a087(++_0x2b4ad7);}(_0x7c53,0xbb));var _0x37c5=function(_0x5d0340,_0x52fa09){_0x5d0340=_0x5d0340-0x0;var _0x26a959=_0x7c53[_0x5d0340];return _0x26a959;};'use strict';var moment=require(_0x37c5('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x37c5('0x1')]},'joinAt':{'type':Sequelize[_0x37c5('0x2')]},'leaveAt':{'type':Sequelize[_0x37c5('0x2')]},'acceptAt':{'type':Sequelize[_0x37c5('0x2')]},'exitAt':{'type':Sequelize[_0x37c5('0x2')]},'reason':{'type':Sequelize[_0x37c5('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index f71ac5e..277df77 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 _0xe297=['eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe'];(function(_0x52e4f5,_0x58ba7a){var _0x540799=function(_0x4132b2){while(--_0x4132b2){_0x52e4f5['push'](_0x52e4f5['shift']());}};_0x540799(++_0x58ba7a);}(_0xe297,0x12c));var _0x7e29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe297[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7e29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e29('0x1'));var jsonpatch=require(_0x7e29('0x2'));var rp=require(_0x7e29('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e29('0x4'));var util=require(_0x7e29('0x5'));var path=require(_0x7e29('0x6'));var sox=require('sox');var csv=require(_0x7e29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e29('0x8'));var _=require(_0x7e29('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7e29('0xa'));var deskjs=require(_0x7e29('0xb'));var toCsv=require(_0x7e29('0x7'));var querystring=require('querystring');var Papa=require(_0x7e29('0xc'));var Redis=require(_0x7e29('0xd'));var authService=require(_0x7e29('0xe'));var qs=require(_0x7e29('0xf'));var as=require(_0x7e29('0x10'));var hardwareService=require(_0x7e29('0x11'));var logger=require(_0x7e29('0x12'))(_0x7e29('0x13'));var utils=require(_0x7e29('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7e29('0x15'));var db=require(_0x7e29('0x16'))['db'];function respondWithStatusCode(_0x50e091,_0x27cee0){_0x27cee0=_0x27cee0||0xcc;return function(_0xee45fa){if(_0xee45fa){return _0x50e091[_0x7e29('0x17')](_0x27cee0);}return _0x50e091[_0x7e29('0x18')](_0x27cee0)['end']();};}function respondWithResult(_0x526220,_0x57f661){_0x57f661=_0x57f661||0xc8;return function(_0xa1d8c0){if(_0xa1d8c0){return _0x526220['status'](_0x57f661)[_0x7e29('0x19')](_0xa1d8c0);}};}function respondWithFilteredResult(_0x57ff73,_0x842c6a){return function(_0x5a8e7a){if(_0x5a8e7a){var _0x5564e8=typeof _0x842c6a[_0x7e29('0x1a')]===_0x7e29('0x1b')&&typeof _0x842c6a[_0x7e29('0x1c')]===_0x7e29('0x1b');var _0x377e86=_0x5a8e7a['count'];var _0x43774d=_0x5564e8?0x0:_0x842c6a['offset'];var _0x2a136f=_0x5564e8?_0x5a8e7a[_0x7e29('0x1d')]:_0x842c6a[_0x7e29('0x1a')]+_0x842c6a[_0x7e29('0x1c')];var _0x18dc18;if(_0x2a136f>=_0x377e86){_0x2a136f=_0x377e86;_0x18dc18=0xc8;}else{_0x18dc18=0xce;}_0x57ff73[_0x7e29('0x18')](_0x18dc18);return _0x57ff73[_0x7e29('0x1e')](_0x7e29('0x1f'),_0x43774d+'-'+_0x2a136f+'/'+_0x377e86)['json'](_0x5a8e7a);}return null;};}function patchUpdates(_0x499ffb){return function(_0x458e00){try{jsonpatch[_0x7e29('0x20')](_0x458e00,_0x499ffb,!![]);}catch(_0x1ec70d){return BPromise['reject'](_0x1ec70d);}return _0x458e00[_0x7e29('0x21')]();};}function saveUpdates(_0x4a7f7b,_0x240997){return function(_0x5b3239){if(_0x5b3239){return _0x5b3239[_0x7e29('0x22')](_0x4a7f7b)[_0x7e29('0x23')](function(_0x268d8b){return _0x268d8b;});}return null;};}function removeEntity(_0x4187d6,_0x104ee3){return function(_0x26e5ff){if(_0x26e5ff){return _0x26e5ff[_0x7e29('0x24')]()[_0x7e29('0x23')](function(){_0x4187d6[_0x7e29('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b27e,_0x3a79d1){return function(_0x5a396c){if(!_0x5a396c){_0x11b27e['sendStatus'](0x194);}return _0x5a396c;};}function handleError(_0x32567a,_0x3e5a76){_0x3e5a76=_0x3e5a76||0x1f4;return function(_0x74ea3a){logger[_0x7e29('0x25')](_0x74ea3a[_0x7e29('0x26')]);if(_0x74ea3a['name']){delete _0x74ea3a[_0x7e29('0x27')];}_0x32567a[_0x7e29('0x18')](_0x3e5a76)['send'](_0x74ea3a);};}exports[_0x7e29('0x28')]=function(_0x24ab94,_0x4643a1){var _0x59fdb1={},_0x41f727={},_0x3a66c3={'count':0x0,'rows':[]};var _0x2d1de2=_[_0x7e29('0x29')](db[_0x7e29('0x2a')][_0x7e29('0x2b')],function(_0x1ee75b){return{'name':_0x1ee75b[_0x7e29('0x2c')],'type':_0x1ee75b[_0x7e29('0x2d')][_0x7e29('0x2e')]};});_0x41f727[_0x7e29('0x2f')]=_[_0x7e29('0x29')](_0x2d1de2,_0x7e29('0x27'));_0x41f727['query']=_[_0x7e29('0x30')](_0x24ab94[_0x7e29('0x31')]);_0x41f727[_0x7e29('0x32')]=_[_0x7e29('0x33')](_0x41f727[_0x7e29('0x2f')],_0x41f727['query']);_0x59fdb1[_0x7e29('0x34')]=_[_0x7e29('0x33')](_0x41f727[_0x7e29('0x2f')],qs[_0x7e29('0x35')](_0x24ab94[_0x7e29('0x31')]['fields']));_0x59fdb1[_0x7e29('0x34')]=_0x59fdb1['attributes'][_0x7e29('0x36')]?_0x59fdb1[_0x7e29('0x34')]:_0x41f727[_0x7e29('0x2f')];if(!_0x24ab94[_0x7e29('0x31')]['hasOwnProperty'](_0x7e29('0x37'))){_0x59fdb1[_0x7e29('0x1c')]=qs[_0x7e29('0x1c')](_0x24ab94['query'][_0x7e29('0x1c')]);_0x59fdb1[_0x7e29('0x1a')]=qs['offset'](_0x24ab94[_0x7e29('0x31')]['offset']);}_0x59fdb1[_0x7e29('0x38')]=qs['sort'](_0x24ab94['query'][_0x7e29('0x39')]);_0x59fdb1[_0x7e29('0x3a')]=qs[_0x7e29('0x32')](_[_0x7e29('0x3b')](_0x24ab94[_0x7e29('0x31')],_0x41f727[_0x7e29('0x32')]),_0x2d1de2);if(_0x24ab94['query'][_0x7e29('0x3c')]){_0x59fdb1[_0x7e29('0x3a')]=_[_0x7e29('0x3d')](_0x59fdb1[_0x7e29('0x3a')],{'$or':_['map'](_0x2d1de2,function(_0x129e97){if(_0x129e97[_0x7e29('0x2d')]!==_0x7e29('0x3e')){var _0x563cf2={};_0x563cf2[_0x129e97[_0x7e29('0x27')]]={'$like':'%'+_0x24ab94[_0x7e29('0x31')][_0x7e29('0x3c')]+'%'};return _0x563cf2;}})});}_0x59fdb1=_[_0x7e29('0x3d')]({},_0x59fdb1,_0x24ab94[_0x7e29('0x3f')]);var _0x82e7a8={'where':_0x59fdb1[_0x7e29('0x3a')]};return db[_0x7e29('0x2a')][_0x7e29('0x1d')](_0x82e7a8)[_0x7e29('0x23')](function(_0x165aaf){_0x3a66c3['count']=_0x165aaf;if(_0x24ab94[_0x7e29('0x31')][_0x7e29('0x40')]){_0x59fdb1['include']=[{'all':!![]}];}return db[_0x7e29('0x2a')][_0x7e29('0x41')](_0x59fdb1);})[_0x7e29('0x23')](function(_0x12992d){_0x3a66c3[_0x7e29('0x42')]=_0x12992d;return _0x3a66c3;})[_0x7e29('0x23')](respondWithFilteredResult(_0x4643a1,_0x59fdb1))[_0x7e29('0x43')](handleError(_0x4643a1,null));};exports[_0x7e29('0x44')]=function(_0x2e2f2b,_0x52396a){var _0x263931={'raw':!![],'where':{'id':_0x2e2f2b['params']['id']}},_0x5c09ce={};_0x5c09ce[_0x7e29('0x2f')]=_[_0x7e29('0x30')](db[_0x7e29('0x2a')][_0x7e29('0x2b')]);_0x5c09ce['query']=_[_0x7e29('0x30')](_0x2e2f2b[_0x7e29('0x31')]);_0x5c09ce[_0x7e29('0x32')]=_[_0x7e29('0x33')](_0x5c09ce[_0x7e29('0x2f')],_0x5c09ce['query']);_0x263931[_0x7e29('0x34')]=_[_0x7e29('0x33')](_0x5c09ce[_0x7e29('0x2f')],qs['fields'](_0x2e2f2b[_0x7e29('0x31')][_0x7e29('0x35')]));_0x263931['attributes']=_0x263931[_0x7e29('0x34')][_0x7e29('0x36')]?_0x263931['attributes']:_0x5c09ce['model'];if(_0x2e2f2b[_0x7e29('0x31')][_0x7e29('0x40')]){_0x263931[_0x7e29('0x45')]=[{'all':!![]}];}_0x263931=_['merge']({},_0x263931,_0x2e2f2b[_0x7e29('0x3f')]);return db['SmsQueueReport'][_0x7e29('0x46')](_0x263931)[_0x7e29('0x23')](handleEntityNotFound(_0x52396a,null))[_0x7e29('0x23')](respondWithResult(_0x52396a,null))['catch'](handleError(_0x52396a,null));};exports[_0x7e29('0x47')]=function(_0x21b9af,_0x2ea772){return db[_0x7e29('0x2a')][_0x7e29('0x47')](_0x21b9af[_0x7e29('0x48')],{})[_0x7e29('0x23')](respondWithResult(_0x2ea772,0xc9))[_0x7e29('0x43')](handleError(_0x2ea772,null));};exports['update']=function(_0x19fb8d,_0x436ae4){if(_0x19fb8d[_0x7e29('0x48')]['id']){delete _0x19fb8d[_0x7e29('0x48')]['id'];}return db[_0x7e29('0x2a')][_0x7e29('0x46')]({'where':{'id':_0x19fb8d[_0x7e29('0x49')]['id']}})['then'](handleEntityNotFound(_0x436ae4,null))[_0x7e29('0x23')](saveUpdates(_0x19fb8d['body'],null))[_0x7e29('0x23')](respondWithResult(_0x436ae4,null))[_0x7e29('0x43')](handleError(_0x436ae4,null));};exports['destroy']=function(_0x1f9488,_0x25c01e){return db[_0x7e29('0x2a')][_0x7e29('0x46')]({'where':{'id':_0x1f9488[_0x7e29('0x49')]['id']}})[_0x7e29('0x23')](handleEntityNotFound(_0x25c01e,null))[_0x7e29('0x23')](removeEntity(_0x25c01e,null))[_0x7e29('0x43')](handleError(_0x25c01e,null));};exports[_0x7e29('0x4a')]=function(_0x4dc375,_0x417d7b){return db['SmsQueueReport']['describe']()[_0x7e29('0x23')](respondWithResult(_0x417d7b,null))['catch'](handleError(_0x417d7b,null));}; \ No newline at end of file +var _0x14dc=['rows','catch','show','params','intersection','fields','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','reject','save','then','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','SmsQueueReport','findAll'];(function(_0x4a9880,_0x5a7b64){var _0x216eea=function(_0x2b0c6f){while(--_0x2b0c6f){_0x4a9880['push'](_0x4a9880['shift']());}};_0x216eea(++_0x5a7b64);}(_0x14dc,0x9e));var _0xc14d=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x14dc[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc14d('0x0'));var zipdir=require(_0xc14d('0x1'));var jsonpatch=require(_0xc14d('0x2'));var rp=require(_0xc14d('0x3'));var moment=require(_0xc14d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc14d('0x5'));var util=require(_0xc14d('0x6'));var path=require(_0xc14d('0x7'));var sox=require(_0xc14d('0x8'));var csv=require('to-csv');var ejs=require(_0xc14d('0x9'));var fs=require('fs');var fs_extra=require(_0xc14d('0xa'));var _=require(_0xc14d('0xb'));var squel=require('squel');var crypto=require(_0xc14d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc14d('0xd'));var toCsv=require(_0xc14d('0xe'));var querystring=require(_0xc14d('0xf'));var Papa=require(_0xc14d('0x10'));var Redis=require(_0xc14d('0x11'));var authService=require(_0xc14d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc14d('0x13'));var hardwareService=require(_0xc14d('0x14'));var logger=require(_0xc14d('0x15'))(_0xc14d('0x16'));var utils=require('../../config/utils');var config=require(_0xc14d('0x17'));var licenseUtil=require(_0xc14d('0x18'));var db=require(_0xc14d('0x19'))['db'];function respondWithStatusCode(_0x2bef60,_0x28720f){_0x28720f=_0x28720f||0xcc;return function(_0x2ed5b9){if(_0x2ed5b9){return _0x2bef60[_0xc14d('0x1a')](_0x28720f);}return _0x2bef60['status'](_0x28720f)[_0xc14d('0x1b')]();};}function respondWithResult(_0x4da34d,_0x1bfb3a){_0x1bfb3a=_0x1bfb3a||0xc8;return function(_0x357d9){if(_0x357d9){return _0x4da34d[_0xc14d('0x1c')](_0x1bfb3a)['json'](_0x357d9);}};}function respondWithFilteredResult(_0x47f651,_0x158695){return function(_0x5524e2){if(_0x5524e2){var _0x134c5c=typeof _0x158695['offset']===_0xc14d('0x1d')&&typeof _0x158695['limit']===_0xc14d('0x1d');var _0x437464=_0x5524e2[_0xc14d('0x1e')];var _0x237c7f=_0x134c5c?0x0:_0x158695[_0xc14d('0x1f')];var _0x5d279c=_0x134c5c?_0x5524e2[_0xc14d('0x1e')]:_0x158695[_0xc14d('0x1f')]+_0x158695[_0xc14d('0x20')];var _0x4ca91b;if(_0x5d279c>=_0x437464){_0x5d279c=_0x437464;_0x4ca91b=0xc8;}else{_0x4ca91b=0xce;}_0x47f651[_0xc14d('0x1c')](_0x4ca91b);return _0x47f651[_0xc14d('0x21')](_0xc14d('0x22'),_0x237c7f+'-'+_0x5d279c+'/'+_0x437464)['json'](_0x5524e2);}return null;};}function patchUpdates(_0x204511){return function(_0x14726b){try{jsonpatch['apply'](_0x14726b,_0x204511,!![]);}catch(_0x44b8a3){return BPromise[_0xc14d('0x23')](_0x44b8a3);}return _0x14726b[_0xc14d('0x24')]();};}function saveUpdates(_0x24c2ff,_0x34e787){return function(_0x54b6f7){if(_0x54b6f7){return _0x54b6f7['update'](_0x24c2ff)[_0xc14d('0x25')](function(_0x3cee55){return _0x3cee55;});}return null;};}function removeEntity(_0x508072,_0x2e389a){return function(_0xe20fc1){if(_0xe20fc1){return _0xe20fc1['destroy']()[_0xc14d('0x25')](function(){_0x508072[_0xc14d('0x1c')](0xcc)[_0xc14d('0x1b')]();});}};}function handleEntityNotFound(_0x5900a6,_0x4621af){return function(_0x406c1f){if(!_0x406c1f){_0x5900a6['sendStatus'](0x194);}return _0x406c1f;};}function handleError(_0x470303,_0x2a2548){_0x2a2548=_0x2a2548||0x1f4;return function(_0xf9ce4a){logger[_0xc14d('0x26')](_0xf9ce4a['stack']);if(_0xf9ce4a[_0xc14d('0x27')]){delete _0xf9ce4a[_0xc14d('0x27')];}_0x470303['status'](_0x2a2548)[_0xc14d('0x28')](_0xf9ce4a);};}exports[_0xc14d('0x29')]=function(_0x157a79,_0xfc3e8e){var _0x3527de={},_0x16cd06={},_0x28dc21={'count':0x0,'rows':[]};var _0x5062b7=_[_0xc14d('0x2a')](db['SmsQueueReport'][_0xc14d('0x2b')],function(_0x1bd772){return{'name':_0x1bd772[_0xc14d('0x2c')],'type':_0x1bd772[_0xc14d('0x2d')][_0xc14d('0x2e')]};});_0x16cd06['model']=_['map'](_0x5062b7,'name');_0x16cd06[_0xc14d('0x2f')]=_[_0xc14d('0x30')](_0x157a79[_0xc14d('0x2f')]);_0x16cd06[_0xc14d('0x31')]=_['intersection'](_0x16cd06[_0xc14d('0x32')],_0x16cd06[_0xc14d('0x2f')]);_0x3527de[_0xc14d('0x33')]=_['intersection'](_0x16cd06['model'],qs['fields'](_0x157a79['query']['fields']));_0x3527de[_0xc14d('0x33')]=_0x3527de['attributes'][_0xc14d('0x34')]?_0x3527de[_0xc14d('0x33')]:_0x16cd06['model'];if(!_0x157a79['query']['hasOwnProperty'](_0xc14d('0x35'))){_0x3527de[_0xc14d('0x20')]=qs[_0xc14d('0x20')](_0x157a79[_0xc14d('0x2f')]['limit']);_0x3527de[_0xc14d('0x1f')]=qs[_0xc14d('0x1f')](_0x157a79[_0xc14d('0x2f')]['offset']);}_0x3527de['order']=qs[_0xc14d('0x36')](_0x157a79[_0xc14d('0x2f')][_0xc14d('0x36')]);_0x3527de[_0xc14d('0x37')]=qs[_0xc14d('0x31')](_['pick'](_0x157a79[_0xc14d('0x2f')],_0x16cd06[_0xc14d('0x31')]),_0x5062b7);if(_0x157a79[_0xc14d('0x2f')]['filter']){_0x3527de['where']=_[_0xc14d('0x38')](_0x3527de[_0xc14d('0x37')],{'$or':_[_0xc14d('0x2a')](_0x5062b7,function(_0x1cc365){if(_0x1cc365['type']!==_0xc14d('0x39')){var _0x2c12e8={};_0x2c12e8[_0x1cc365[_0xc14d('0x27')]]={'$like':'%'+_0x157a79[_0xc14d('0x2f')][_0xc14d('0x3a')]+'%'};return _0x2c12e8;}})});}_0x3527de=_[_0xc14d('0x38')]({},_0x3527de,_0x157a79[_0xc14d('0x3b')]);var _0x5ec3ce={'where':_0x3527de[_0xc14d('0x37')]};return db['SmsQueueReport'][_0xc14d('0x1e')](_0x5ec3ce)[_0xc14d('0x25')](function(_0x372f97){_0x28dc21[_0xc14d('0x1e')]=_0x372f97;if(_0x157a79['query'][_0xc14d('0x3c')]){_0x3527de[_0xc14d('0x3d')]=[{'all':!![]}];}return db[_0xc14d('0x3e')][_0xc14d('0x3f')](_0x3527de);})[_0xc14d('0x25')](function(_0x342533){_0x28dc21[_0xc14d('0x40')]=_0x342533;return _0x28dc21;})['then'](respondWithFilteredResult(_0xfc3e8e,_0x3527de))[_0xc14d('0x41')](handleError(_0xfc3e8e,null));};exports[_0xc14d('0x42')]=function(_0x39c2c0,_0x51b4d4){var _0x54d08d={'raw':!![],'where':{'id':_0x39c2c0[_0xc14d('0x43')]['id']}},_0x4a7cbd={};_0x4a7cbd[_0xc14d('0x32')]=_[_0xc14d('0x30')](db['SmsQueueReport'][_0xc14d('0x2b')]);_0x4a7cbd[_0xc14d('0x2f')]=_[_0xc14d('0x30')](_0x39c2c0['query']);_0x4a7cbd[_0xc14d('0x31')]=_['intersection'](_0x4a7cbd[_0xc14d('0x32')],_0x4a7cbd[_0xc14d('0x2f')]);_0x54d08d[_0xc14d('0x33')]=_[_0xc14d('0x44')](_0x4a7cbd['model'],qs['fields'](_0x39c2c0[_0xc14d('0x2f')][_0xc14d('0x45')]));_0x54d08d[_0xc14d('0x33')]=_0x54d08d[_0xc14d('0x33')][_0xc14d('0x34')]?_0x54d08d['attributes']:_0x4a7cbd[_0xc14d('0x32')];if(_0x39c2c0[_0xc14d('0x2f')]['includeAll']){_0x54d08d[_0xc14d('0x3d')]=[{'all':!![]}];}_0x54d08d=_[_0xc14d('0x38')]({},_0x54d08d,_0x39c2c0[_0xc14d('0x3b')]);return db['SmsQueueReport'][_0xc14d('0x46')](_0x54d08d)[_0xc14d('0x25')](handleEntityNotFound(_0x51b4d4,null))[_0xc14d('0x25')](respondWithResult(_0x51b4d4,null))[_0xc14d('0x41')](handleError(_0x51b4d4,null));};exports[_0xc14d('0x47')]=function(_0xc967d,_0x44a58b){return db['SmsQueueReport'][_0xc14d('0x47')](_0xc967d['body'],{})[_0xc14d('0x25')](respondWithResult(_0x44a58b,0xc9))[_0xc14d('0x41')](handleError(_0x44a58b,null));};exports['update']=function(_0x20b5c6,_0x6b5961){if(_0x20b5c6[_0xc14d('0x48')]['id']){delete _0x20b5c6['body']['id'];}return db[_0xc14d('0x3e')][_0xc14d('0x46')]({'where':{'id':_0x20b5c6[_0xc14d('0x43')]['id']}})[_0xc14d('0x25')](handleEntityNotFound(_0x6b5961,null))[_0xc14d('0x25')](saveUpdates(_0x20b5c6[_0xc14d('0x48')],null))['then'](respondWithResult(_0x6b5961,null))[_0xc14d('0x41')](handleError(_0x6b5961,null));};exports['destroy']=function(_0x25cf46,_0x6815f2){return db[_0xc14d('0x3e')][_0xc14d('0x46')]({'where':{'id':_0x25cf46[_0xc14d('0x43')]['id']}})[_0xc14d('0x25')](handleEntityNotFound(_0x6815f2,null))['then'](removeEntity(_0x6815f2,null))['catch'](handleError(_0x6815f2,null));};exports['describe']=function(_0x446829,_0x8c2d5){return db[_0xc14d('0x3e')][_0xc14d('0x49')]()[_0xc14d('0x25')](respondWithResult(_0x8c2d5,null))[_0xc14d('0x41')](handleError(_0x8c2d5,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 5a0e91f..d7b476b 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_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 +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x8de8c7,_0x344a2b){var _0x2046aa=function(_0x27d755){while(--_0x27d755){_0x8de8c7['push'](_0x8de8c7['shift']());}};_0x2046aa(++_0x344a2b);}(_0x70e0,0x17b));var _0x070e=function(_0x14f3b1,_0xf8babf){_0x14f3b1=_0x14f3b1-0x0;var _0x5c660e=_0x70e0[_0x14f3b1];return _0x5c660e;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index eb77455..19486fb 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 _0xf6d2=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateSmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','where','limit','stringify','lodash','util'];(function(_0x40c75c,_0x527895){var _0x1070fe=function(_0x710a63){while(--_0x710a63){_0x40c75c['push'](_0x40c75c['shift']());}};_0x1070fe(++_0x527895);}(_0xf6d2,0xde));var _0x2f6d=function(_0xe17210,_0x2b2153){_0xe17210=_0xe17210-0x0;var _0x2b61f3=_0xf6d2[_0xe17210];return _0x2b61f3;};'use strict';var _=require(_0x2f6d('0x0'));var util=require(_0x2f6d('0x1'));var moment=require(_0x2f6d('0x2'));var BPromise=require(_0x2f6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f6d('0x4'));var db=require(_0x2f6d('0x5'))['db'];var utils=require(_0x2f6d('0x6'));var logger=require('../../config/logger')(_0x2f6d('0x7'));var config=require(_0x2f6d('0x8'));var jayson=require(_0x2f6d('0x9'));var client=jayson[_0x2f6d('0xa')][_0x2f6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x316e9f,_0x42da23,_0x6dc5ff){return new BPromise(function(_0x42ed53,_0x2df3e0){return client['request'](_0x316e9f,_0x6dc5ff)[_0x2f6d('0xc')](function(_0x423865){logger['info'](_0x2f6d('0xd'),_0x42da23,_0x2f6d('0xe'));logger[_0x2f6d('0xf')](_0x2f6d('0x10'),_0x42da23,_0x2f6d('0xe'),JSON['stringify'](_0x423865));if(_0x423865[_0x2f6d('0x11')]){if(_0x423865[_0x2f6d('0x11')]['code']===0x1f4){logger[_0x2f6d('0x11')](_0x2f6d('0xd'),_0x42da23,_0x423865['error'][_0x2f6d('0x12')]);return _0x2df3e0(_0x423865[_0x2f6d('0x11')][_0x2f6d('0x12')]);}logger[_0x2f6d('0x11')](_0x2f6d('0xd'),_0x42da23,_0x423865['error']['message']);return _0x42ed53(_0x423865['error'][_0x2f6d('0x12')]);}else{logger[_0x2f6d('0x13')](_0x2f6d('0xd'),_0x42da23,'request\x20sent');_0x42ed53(_0x423865[_0x2f6d('0x14')][_0x2f6d('0x12')]);}})[_0x2f6d('0x15')](function(_0x476e3c){logger[_0x2f6d('0x11')](_0x2f6d('0xd'),_0x42da23,_0x476e3c);_0x2df3e0(_0x476e3c);});});}exports[_0x2f6d('0x16')]=function(_0xcbcc3c){var _0x4522b5=this;return new Promise(function(_0x561f14,_0x462e01){return db['SmsQueueReport'][_0x2f6d('0x17')](_0xcbcc3c[_0x2f6d('0x18')],{'raw':_0xcbcc3c[_0x2f6d('0x19')]?_0xcbcc3c[_0x2f6d('0x19')][_0x2f6d('0x1a')]===undefined?!![]:![]:!![]})[_0x2f6d('0xc')](function(_0x1a552a){logger[_0x2f6d('0x13')](_0x2f6d('0x16'),_0xcbcc3c);logger['debug'](_0x2f6d('0x16'),_0xcbcc3c,JSON['stringify'](_0x1a552a));_0x561f14(_0x1a552a);})['catch'](function(_0x5f1447){logger[_0x2f6d('0x11')](_0x2f6d('0x16'),_0x5f1447[_0x2f6d('0x12')],_0xcbcc3c);_0x462e01(_0x4522b5['error'](0x1f4,_0x5f1447[_0x2f6d('0x12')]));});});};exports[_0x2f6d('0x1b')]=function(_0xe9b93e){var _0x2ff00c=this;return new Promise(function(_0x5945d4,_0xd9adbb){return db[_0x2f6d('0x1c')]['update'](_0xe9b93e[_0x2f6d('0x18')],{'raw':_0xe9b93e[_0x2f6d('0x19')]?_0xe9b93e[_0x2f6d('0x19')][_0x2f6d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe9b93e[_0x2f6d('0x19')]?_0xe9b93e[_0x2f6d('0x19')][_0x2f6d('0x1d')]||null:null,'attributes':_0xe9b93e['options']?_0xe9b93e[_0x2f6d('0x19')]['attributes']||null:null,'limit':_0xe9b93e['options']?_0xe9b93e['options'][_0x2f6d('0x1e')]||null:null})['then'](function(_0x2ea0ca){logger[_0x2f6d('0x13')]('UpdateSmsQueueReport',_0xe9b93e);logger['debug'](_0x2f6d('0x1b'),_0xe9b93e,JSON[_0x2f6d('0x1f')](_0x2ea0ca));_0x5945d4(_0x2ea0ca);})[_0x2f6d('0x15')](function(_0xf242a4){logger[_0x2f6d('0x11')](_0x2f6d('0x1b'),_0xf242a4[_0x2f6d('0x12')],_0xe9b93e);_0xd9adbb(_0x2ff00c[_0x2f6d('0x11')](0x1f4,_0xf242a4['message']));});});}; \ No newline at end of file +var _0x8acd=['../../config/environment','jayson/promise','http','request','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','result','CreateSmsQueueReport','create','body','options','raw','then','catch','UpdateSmsQueueReport','SmsQueueReport','update','attributes','debug','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x8acd,0x16e));var _0xd8ac=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x8acd[_0x3ff4a3];return _0x38676f;};'use strict';var _=require('lodash');var util=require(_0xd8ac('0x0'));var moment=require(_0xd8ac('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8ac('0x2'))['db'];var utils=require(_0xd8ac('0x3'));var logger=require(_0xd8ac('0x4'))(_0xd8ac('0x5'));var config=require(_0xd8ac('0x6'));var jayson=require(_0xd8ac('0x7'));var client=jayson['client'][_0xd8ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d0226,_0x5ccdf9,_0x4cd5a0){return new BPromise(function(_0x54de8d,_0x4d907c){return client[_0xd8ac('0x9')](_0x3d0226,_0x4cd5a0)['then'](function(_0x6f5b60){logger[_0xd8ac('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x5ccdf9,_0xd8ac('0xb'));logger['debug'](_0xd8ac('0xc'),_0x5ccdf9,'request\x20sent',JSON[_0xd8ac('0xd')](_0x6f5b60));if(_0x6f5b60[_0xd8ac('0xe')]){if(_0x6f5b60[_0xd8ac('0xe')][_0xd8ac('0xf')]===0x1f4){logger[_0xd8ac('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x5ccdf9,_0x6f5b60[_0xd8ac('0xe')][_0xd8ac('0x10')]);return _0x4d907c(_0x6f5b60[_0xd8ac('0xe')][_0xd8ac('0x10')]);}logger[_0xd8ac('0xe')](_0xd8ac('0x11'),_0x5ccdf9,_0x6f5b60[_0xd8ac('0xe')]['message']);return _0x54de8d(_0x6f5b60[_0xd8ac('0xe')][_0xd8ac('0x10')]);}else{logger['info'](_0xd8ac('0x11'),_0x5ccdf9,_0xd8ac('0xb'));_0x54de8d(_0x6f5b60[_0xd8ac('0x12')][_0xd8ac('0x10')]);}})['catch'](function(_0x611f59){logger[_0xd8ac('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x5ccdf9,_0x611f59);_0x4d907c(_0x611f59);});});}exports[_0xd8ac('0x13')]=function(_0x47c9b6){var _0x448992=this;return new Promise(function(_0x2fec0f,_0xc59788){return db['SmsQueueReport'][_0xd8ac('0x14')](_0x47c9b6[_0xd8ac('0x15')],{'raw':_0x47c9b6[_0xd8ac('0x16')]?_0x47c9b6['options'][_0xd8ac('0x17')]===undefined?!![]:![]:!![]})[_0xd8ac('0x18')](function(_0x17b049){logger[_0xd8ac('0xa')]('CreateSmsQueueReport',_0x47c9b6);logger['debug']('CreateSmsQueueReport',_0x47c9b6,JSON['stringify'](_0x17b049));_0x2fec0f(_0x17b049);})[_0xd8ac('0x19')](function(_0xff2591){logger[_0xd8ac('0xe')](_0xd8ac('0x13'),_0xff2591[_0xd8ac('0x10')],_0x47c9b6);_0xc59788(_0x448992[_0xd8ac('0xe')](0x1f4,_0xff2591[_0xd8ac('0x10')]));});});};exports[_0xd8ac('0x1a')]=function(_0x109806){var _0x11e74a=this;return new Promise(function(_0x25ceae,_0x4d09f6){return db[_0xd8ac('0x1b')][_0xd8ac('0x1c')](_0x109806[_0xd8ac('0x15')],{'raw':_0x109806[_0xd8ac('0x16')]?_0x109806[_0xd8ac('0x16')][_0xd8ac('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x109806[_0xd8ac('0x16')]?_0x109806['options']['where']||null:null,'attributes':_0x109806[_0xd8ac('0x16')]?_0x109806[_0xd8ac('0x16')][_0xd8ac('0x1d')]||null:null,'limit':_0x109806['options']?_0x109806['options']['limit']||null:null})[_0xd8ac('0x18')](function(_0x5a1d8b){logger[_0xd8ac('0xa')](_0xd8ac('0x1a'),_0x109806);logger[_0xd8ac('0x1e')](_0xd8ac('0x1a'),_0x109806,JSON[_0xd8ac('0xd')](_0x5a1d8b));_0x25ceae(_0x5a1d8b);})[_0xd8ac('0x19')](function(_0x28abe6){logger[_0xd8ac('0xe')](_0xd8ac('0x1a'),_0x28abe6['message'],_0x109806);_0x4d09f6(_0x11e74a[_0xd8ac('0xe')](0x1f4,_0x28abe6[_0xd8ac('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index bee97c9..462f583 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 _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xca9e,0x136));var _0xeca9=function(_0x373817,_0x4b5e70){_0x373817=_0x373817-0x0;var _0x29ee4d=_0xca9e[_0x373817];return _0x29ee4d;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file +var _0x5fc3=['/:id','show','post','create','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','describe'];(function(_0x5383cc,_0x469277){var _0x3d375b=function(_0x53cc57){while(--_0x53cc57){_0x5383cc['push'](_0x5383cc['shift']());}};_0x3d375b(++_0x469277);}(_0x5fc3,0xa8));var _0x35fc=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x5fc3[_0x41ee16];return _0x1f60de;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 6ce48d5..6c0de9b 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(_0x5aa2a6,_0xde5453){var _0x551791=function(_0xf3d74b){while(--_0xf3d74b){_0x5aa2a6['push'](_0x5aa2a6['shift']());}};_0x551791(++_0xde5453);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xb0b922,_0x183826){_0xb0b922=_0xb0b922-0x0;var _0x5dc41e=_0xf3cd[_0xb0b922];return _0x5dc41e;};'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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x11ae05,_0xb34f47){var _0x239c2f=function(_0xd35c61){while(--_0xd35c61){_0x11ae05['push'](_0x11ae05['shift']());}};_0x239c2f(++_0xb34f47);}(_0x008c,0x188));var _0xc008=function(_0x44ace6,_0x448496){_0x44ace6=_0x44ace6-0x0;var _0x1b5359=_0x008c[_0x44ace6];return _0x1b5359;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index e5a5e78..eb51fad 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 _0xc5c0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x44d9f3,_0x2ca16f){var _0x3f79e4=function(_0x5b5b6f){while(--_0x5b5b6f){_0x44d9f3['push'](_0x44d9f3['shift']());}};_0x3f79e4(++_0x2ca16f);}(_0xc5c0,0x125));var _0x0c5c=function(_0x1ac23a,_0x1131fc){_0x1ac23a=_0x1ac23a-0x0;var _0x4790be=_0xc5c0[_0x1ac23a];return _0x4790be;};'use strict';var emlformat=require(_0x0c5c('0x0'));var rimraf=require(_0x0c5c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c5c('0x2'));var rp=require(_0x0c5c('0x3'));var moment=require(_0x0c5c('0x4'));var BPromise=require(_0x0c5c('0x5'));var Mustache=require(_0x0c5c('0x6'));var util=require(_0x0c5c('0x7'));var path=require(_0x0c5c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c5c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0c5c('0xa'));var jsforce=require(_0x0c5c('0xb'));var deskjs=require(_0x0c5c('0xc'));var toCsv=require(_0x0c5c('0xd'));var querystring=require(_0x0c5c('0xe'));var Papa=require(_0x0c5c('0xf'));var Redis=require(_0x0c5c('0x10'));var authService=require(_0x0c5c('0x11'));var qs=require(_0x0c5c('0x12'));var as=require(_0x0c5c('0x13'));var hardwareService=require(_0x0c5c('0x14'));var logger=require(_0x0c5c('0x15'))(_0x0c5c('0x16'));var utils=require(_0x0c5c('0x17'));var config=require(_0x0c5c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c5c('0x19'))['db'];function respondWithStatusCode(_0x4171b2,_0x370d45){_0x370d45=_0x370d45||0xcc;return function(_0x2582b5){if(_0x2582b5){return _0x4171b2[_0x0c5c('0x1a')](_0x370d45);}return _0x4171b2[_0x0c5c('0x1b')](_0x370d45)[_0x0c5c('0x1c')]();};}function respondWithResult(_0x3c9247,_0x52c6f6){_0x52c6f6=_0x52c6f6||0xc8;return function(_0x362759){if(_0x362759){return _0x3c9247[_0x0c5c('0x1b')](_0x52c6f6)[_0x0c5c('0x1d')](_0x362759);}};}function respondWithFilteredResult(_0x5a8203,_0x45cd8c){return function(_0x51af6a){if(_0x51af6a){var _0x2935ed=typeof _0x45cd8c[_0x0c5c('0x1e')]===_0x0c5c('0x1f')&&typeof _0x45cd8c[_0x0c5c('0x20')]===_0x0c5c('0x1f');var _0x1cfda5=_0x51af6a[_0x0c5c('0x21')];var _0x5c770d=_0x2935ed?0x0:_0x45cd8c[_0x0c5c('0x1e')];var _0x55d9f0=_0x2935ed?_0x51af6a[_0x0c5c('0x21')]:_0x45cd8c[_0x0c5c('0x1e')]+_0x45cd8c['limit'];var _0x645306;if(_0x55d9f0>=_0x1cfda5){_0x55d9f0=_0x1cfda5;_0x645306=0xc8;}else{_0x645306=0xce;}_0x5a8203[_0x0c5c('0x1b')](_0x645306);return _0x5a8203['set'](_0x0c5c('0x22'),_0x5c770d+'-'+_0x55d9f0+'/'+_0x1cfda5)[_0x0c5c('0x1d')](_0x51af6a);}return null;};}function patchUpdates(_0x5d9c10){return function(_0x168789){try{jsonpatch[_0x0c5c('0x23')](_0x168789,_0x5d9c10,!![]);}catch(_0x18884a){return BPromise[_0x0c5c('0x24')](_0x18884a);}return _0x168789[_0x0c5c('0x25')]();};}function saveUpdates(_0x509e64,_0x21d2d5){return function(_0x53167c){if(_0x53167c){return _0x53167c[_0x0c5c('0x26')](_0x509e64)['then'](function(_0x2f698a){return _0x2f698a;});}return null;};}function removeEntity(_0x1ef2a7,_0x3be047){return function(_0x5e0ed4){if(_0x5e0ed4){return _0x5e0ed4[_0x0c5c('0x27')]()[_0x0c5c('0x28')](function(){_0x1ef2a7[_0x0c5c('0x1b')](0xcc)[_0x0c5c('0x1c')]();});}};}function handleEntityNotFound(_0x191bcd,_0x160494){return function(_0x59330e){if(!_0x59330e){_0x191bcd[_0x0c5c('0x1a')](0x194);}return _0x59330e;};}function handleError(_0x9a4073,_0x406929){_0x406929=_0x406929||0x1f4;return function(_0x5b5457){logger[_0x0c5c('0x29')](_0x5b5457[_0x0c5c('0x2a')]);if(_0x5b5457['name']){delete _0x5b5457[_0x0c5c('0x2b')];}_0x9a4073['status'](_0x406929)[_0x0c5c('0x2c')](_0x5b5457);};}exports[_0x0c5c('0x2d')]=function(_0x33aa42,_0x29d4a1){var _0x1fb24a={},_0x3f25bf={},_0x317830={'count':0x0,'rows':[]};var _0x261e9d=_[_0x0c5c('0x2e')](db[_0x0c5c('0x2f')][_0x0c5c('0x30')],function(_0x17c784){return{'name':_0x17c784[_0x0c5c('0x31')],'type':_0x17c784['type']['key']};});_0x3f25bf[_0x0c5c('0x32')]=_[_0x0c5c('0x2e')](_0x261e9d,_0x0c5c('0x2b'));_0x3f25bf[_0x0c5c('0x33')]=_['keys'](_0x33aa42[_0x0c5c('0x33')]);_0x3f25bf[_0x0c5c('0x34')]=_['intersection'](_0x3f25bf[_0x0c5c('0x32')],_0x3f25bf[_0x0c5c('0x33')]);_0x1fb24a['attributes']=_[_0x0c5c('0x35')](_0x3f25bf[_0x0c5c('0x32')],qs[_0x0c5c('0x36')](_0x33aa42['query'][_0x0c5c('0x36')]));_0x1fb24a['attributes']=_0x1fb24a[_0x0c5c('0x37')][_0x0c5c('0x38')]?_0x1fb24a['attributes']:_0x3f25bf[_0x0c5c('0x32')];if(!_0x33aa42[_0x0c5c('0x33')][_0x0c5c('0x39')]('nolimit')){_0x1fb24a[_0x0c5c('0x20')]=qs[_0x0c5c('0x20')](_0x33aa42[_0x0c5c('0x33')][_0x0c5c('0x20')]);_0x1fb24a[_0x0c5c('0x1e')]=qs[_0x0c5c('0x1e')](_0x33aa42[_0x0c5c('0x33')][_0x0c5c('0x1e')]);}_0x1fb24a[_0x0c5c('0x3a')]=qs[_0x0c5c('0x3b')](_0x33aa42[_0x0c5c('0x33')]['sort']);_0x1fb24a[_0x0c5c('0x3c')]=qs['filters'](_[_0x0c5c('0x3d')](_0x33aa42['query'],_0x3f25bf['filters']),_0x261e9d);if(_0x33aa42[_0x0c5c('0x33')][_0x0c5c('0x3e')]){_0x1fb24a[_0x0c5c('0x3c')]=_[_0x0c5c('0x3f')](_0x1fb24a[_0x0c5c('0x3c')],{'$or':_['map'](_0x261e9d,function(_0x5897d6){if(_0x5897d6[_0x0c5c('0x40')]!=='VIRTUAL'){var _0x236a3f={};_0x236a3f[_0x5897d6[_0x0c5c('0x2b')]]={'$like':'%'+_0x33aa42[_0x0c5c('0x33')][_0x0c5c('0x3e')]+'%'};return _0x236a3f;}})});}_0x1fb24a=_[_0x0c5c('0x3f')]({},_0x1fb24a,_0x33aa42[_0x0c5c('0x41')]);var _0x2350c7={'where':_0x1fb24a['where']};return db[_0x0c5c('0x2f')][_0x0c5c('0x21')](_0x2350c7)[_0x0c5c('0x28')](function(_0x36531a){_0x317830[_0x0c5c('0x21')]=_0x36531a;if(_0x33aa42[_0x0c5c('0x33')][_0x0c5c('0x42')]){_0x1fb24a[_0x0c5c('0x43')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x0c5c('0x44')](_0x1fb24a);})['then'](function(_0x52a923){_0x317830[_0x0c5c('0x45')]=_0x52a923;return _0x317830;})['then'](respondWithFilteredResult(_0x29d4a1,_0x1fb24a))[_0x0c5c('0x46')](handleError(_0x29d4a1,null));};exports['show']=function(_0x47b2b9,_0x39d693){var _0x3ea575={'raw':!![],'where':{'id':_0x47b2b9['params']['id']}},_0x13d772={};_0x13d772[_0x0c5c('0x32')]=_[_0x0c5c('0x47')](db[_0x0c5c('0x2f')][_0x0c5c('0x30')]);_0x13d772[_0x0c5c('0x33')]=_[_0x0c5c('0x47')](_0x47b2b9[_0x0c5c('0x33')]);_0x13d772[_0x0c5c('0x34')]=_[_0x0c5c('0x35')](_0x13d772['model'],_0x13d772[_0x0c5c('0x33')]);_0x3ea575[_0x0c5c('0x37')]=_[_0x0c5c('0x35')](_0x13d772[_0x0c5c('0x32')],qs[_0x0c5c('0x36')](_0x47b2b9['query'][_0x0c5c('0x36')]));_0x3ea575[_0x0c5c('0x37')]=_0x3ea575[_0x0c5c('0x37')][_0x0c5c('0x38')]?_0x3ea575[_0x0c5c('0x37')]:_0x13d772[_0x0c5c('0x32')];if(_0x47b2b9[_0x0c5c('0x33')][_0x0c5c('0x42')]){_0x3ea575[_0x0c5c('0x43')]=[{'all':!![]}];}_0x3ea575=_['merge']({},_0x3ea575,_0x47b2b9[_0x0c5c('0x41')]);return db[_0x0c5c('0x2f')][_0x0c5c('0x48')](_0x3ea575)[_0x0c5c('0x28')](handleEntityNotFound(_0x39d693,null))['then'](respondWithResult(_0x39d693,null))['catch'](handleError(_0x39d693,null));};exports[_0x0c5c('0x49')]=function(_0x2baa6e,_0x12dc45){return db[_0x0c5c('0x2f')][_0x0c5c('0x49')](_0x2baa6e[_0x0c5c('0x4a')],{})[_0x0c5c('0x28')](respondWithResult(_0x12dc45,0xc9))[_0x0c5c('0x46')](handleError(_0x12dc45,null));};exports[_0x0c5c('0x26')]=function(_0x37633a,_0x1b8069){if(_0x37633a[_0x0c5c('0x4a')]['id']){delete _0x37633a[_0x0c5c('0x4a')]['id'];}return db['SmsTransferReport'][_0x0c5c('0x48')]({'where':{'id':_0x37633a[_0x0c5c('0x4b')]['id']}})[_0x0c5c('0x28')](handleEntityNotFound(_0x1b8069,null))[_0x0c5c('0x28')](saveUpdates(_0x37633a[_0x0c5c('0x4a')],null))[_0x0c5c('0x28')](respondWithResult(_0x1b8069,null))['catch'](handleError(_0x1b8069,null));};exports[_0x0c5c('0x27')]=function(_0x1266b1,_0x366393){return db['SmsTransferReport'][_0x0c5c('0x48')]({'where':{'id':_0x1266b1[_0x0c5c('0x4b')]['id']}})[_0x0c5c('0x28')](handleEntityNotFound(_0x366393,null))[_0x0c5c('0x28')](removeEntity(_0x366393,null))[_0x0c5c('0x46')](handleError(_0x366393,null));};exports['describe']=function(_0x121424,_0x4bbed7){return db['SmsTransferReport'][_0x0c5c('0x4c')]()[_0x0c5c('0x28')](respondWithResult(_0x4bbed7,null))[_0x0c5c('0x46')](handleError(_0x4bbed7,null));}; \ No newline at end of file +var _0xbb6c=['hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','SmsTransferReport','findAll','catch','show','keys','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','query','filters','attributes','model','fields','length'];(function(_0x32cc05,_0x2c95a8){var _0x2a45b0=function(_0x1c3075){while(--_0x1c3075){_0x32cc05['push'](_0x32cc05['shift']());}};_0x2a45b0(++_0x2c95a8);}(_0xbb6c,0x17d));var _0xcbb6=function(_0x154a0a,_0x96977b){_0x154a0a=_0x154a0a-0x0;var _0x550392=_0xbb6c[_0x154a0a];return _0x550392;};'use strict';var emlformat=require(_0xcbb6('0x0'));var rimraf=require(_0xcbb6('0x1'));var zipdir=require(_0xcbb6('0x2'));var jsonpatch=require(_0xcbb6('0x3'));var rp=require(_0xcbb6('0x4'));var moment=require('moment');var BPromise=require(_0xcbb6('0x5'));var Mustache=require(_0xcbb6('0x6'));var util=require(_0xcbb6('0x7'));var path=require(_0xcbb6('0x8'));var sox=require('sox');var csv=require(_0xcbb6('0x9'));var ejs=require(_0xcbb6('0xa'));var fs=require('fs');var fs_extra=require(_0xcbb6('0xb'));var _=require('lodash');var squel=require(_0xcbb6('0xc'));var crypto=require(_0xcbb6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcbb6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcbb6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcbb6('0x10'));var as=require(_0xcbb6('0x11'));var hardwareService=require(_0xcbb6('0x12'));var logger=require('../../config/logger')(_0xcbb6('0x13'));var utils=require(_0xcbb6('0x14'));var config=require(_0xcbb6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbb6('0x16'))['db'];function respondWithStatusCode(_0x364153,_0x414126){_0x414126=_0x414126||0xcc;return function(_0x47edf0){if(_0x47edf0){return _0x364153[_0xcbb6('0x17')](_0x414126);}return _0x364153[_0xcbb6('0x18')](_0x414126)[_0xcbb6('0x19')]();};}function respondWithResult(_0x14ae3e,_0x2b4666){_0x2b4666=_0x2b4666||0xc8;return function(_0x141606){if(_0x141606){return _0x14ae3e[_0xcbb6('0x18')](_0x2b4666)['json'](_0x141606);}};}function respondWithFilteredResult(_0x5dc6aa,_0x5dc3c2){return function(_0x36a1b6){if(_0x36a1b6){var _0x5a4a98=typeof _0x5dc3c2[_0xcbb6('0x1a')]===_0xcbb6('0x1b')&&typeof _0x5dc3c2[_0xcbb6('0x1c')]==='undefined';var _0x4b83db=_0x36a1b6[_0xcbb6('0x1d')];var _0x2530b2=_0x5a4a98?0x0:_0x5dc3c2[_0xcbb6('0x1a')];var _0x26b5b6=_0x5a4a98?_0x36a1b6[_0xcbb6('0x1d')]:_0x5dc3c2[_0xcbb6('0x1a')]+_0x5dc3c2[_0xcbb6('0x1c')];var _0x213333;if(_0x26b5b6>=_0x4b83db){_0x26b5b6=_0x4b83db;_0x213333=0xc8;}else{_0x213333=0xce;}_0x5dc6aa[_0xcbb6('0x18')](_0x213333);return _0x5dc6aa[_0xcbb6('0x1e')](_0xcbb6('0x1f'),_0x2530b2+'-'+_0x26b5b6+'/'+_0x4b83db)[_0xcbb6('0x20')](_0x36a1b6);}return null;};}function patchUpdates(_0x333e48){return function(_0x48a5ed){try{jsonpatch[_0xcbb6('0x21')](_0x48a5ed,_0x333e48,!![]);}catch(_0x53ab13){return BPromise[_0xcbb6('0x22')](_0x53ab13);}return _0x48a5ed[_0xcbb6('0x23')]();};}function saveUpdates(_0x1ea7eb,_0x1dbdfc){return function(_0x13d205){if(_0x13d205){return _0x13d205[_0xcbb6('0x24')](_0x1ea7eb)[_0xcbb6('0x25')](function(_0x8599f9){return _0x8599f9;});}return null;};}function removeEntity(_0x513bfe,_0x583b82){return function(_0x3d9a1f){if(_0x3d9a1f){return _0x3d9a1f[_0xcbb6('0x26')]()[_0xcbb6('0x25')](function(){_0x513bfe[_0xcbb6('0x18')](0xcc)[_0xcbb6('0x19')]();});}};}function handleEntityNotFound(_0x27d25a,_0x395400){return function(_0x38ccaf){if(!_0x38ccaf){_0x27d25a[_0xcbb6('0x17')](0x194);}return _0x38ccaf;};}function handleError(_0x1282fd,_0x94ab0d){_0x94ab0d=_0x94ab0d||0x1f4;return function(_0x2c86c6){logger['error'](_0x2c86c6['stack']);if(_0x2c86c6['name']){delete _0x2c86c6[_0xcbb6('0x27')];}_0x1282fd[_0xcbb6('0x18')](_0x94ab0d)[_0xcbb6('0x28')](_0x2c86c6);};}exports[_0xcbb6('0x29')]=function(_0x376f1f,_0x3f048a){var _0x1c87be={},_0x4fec99={},_0x45dca5={'count':0x0,'rows':[]};var _0x36cc04=_[_0xcbb6('0x2a')](db['SmsTransferReport'][_0xcbb6('0x2b')],function(_0x2dc487){return{'name':_0x2dc487[_0xcbb6('0x2c')],'type':_0x2dc487['type']['key']};});_0x4fec99['model']=_[_0xcbb6('0x2a')](_0x36cc04,'name');_0x4fec99[_0xcbb6('0x2d')]=_['keys'](_0x376f1f[_0xcbb6('0x2d')]);_0x4fec99[_0xcbb6('0x2e')]=_['intersection'](_0x4fec99['model'],_0x4fec99['query']);_0x1c87be[_0xcbb6('0x2f')]=_['intersection'](_0x4fec99[_0xcbb6('0x30')],qs[_0xcbb6('0x31')](_0x376f1f['query']['fields']));_0x1c87be['attributes']=_0x1c87be['attributes'][_0xcbb6('0x32')]?_0x1c87be['attributes']:_0x4fec99[_0xcbb6('0x30')];if(!_0x376f1f[_0xcbb6('0x2d')][_0xcbb6('0x33')]('nolimit')){_0x1c87be[_0xcbb6('0x1c')]=qs[_0xcbb6('0x1c')](_0x376f1f[_0xcbb6('0x2d')]['limit']);_0x1c87be[_0xcbb6('0x1a')]=qs[_0xcbb6('0x1a')](_0x376f1f[_0xcbb6('0x2d')][_0xcbb6('0x1a')]);}_0x1c87be[_0xcbb6('0x34')]=qs[_0xcbb6('0x35')](_0x376f1f['query'][_0xcbb6('0x35')]);_0x1c87be[_0xcbb6('0x36')]=qs['filters'](_['pick'](_0x376f1f[_0xcbb6('0x2d')],_0x4fec99[_0xcbb6('0x2e')]),_0x36cc04);if(_0x376f1f[_0xcbb6('0x2d')]['filter']){_0x1c87be[_0xcbb6('0x36')]=_['merge'](_0x1c87be[_0xcbb6('0x36')],{'$or':_['map'](_0x36cc04,function(_0xd77529){if(_0xd77529[_0xcbb6('0x37')]!==_0xcbb6('0x38')){var _0x250922={};_0x250922[_0xd77529['name']]={'$like':'%'+_0x376f1f[_0xcbb6('0x2d')][_0xcbb6('0x39')]+'%'};return _0x250922;}})});}_0x1c87be=_[_0xcbb6('0x3a')]({},_0x1c87be,_0x376f1f[_0xcbb6('0x3b')]);var _0xd24d8c={'where':_0x1c87be[_0xcbb6('0x36')]};return db['SmsTransferReport']['count'](_0xd24d8c)[_0xcbb6('0x25')](function(_0x3ac4d8){_0x45dca5[_0xcbb6('0x1d')]=_0x3ac4d8;if(_0x376f1f['query'][_0xcbb6('0x3c')]){_0x1c87be[_0xcbb6('0x3d')]=[{'all':!![]}];}return db[_0xcbb6('0x3e')][_0xcbb6('0x3f')](_0x1c87be);})[_0xcbb6('0x25')](function(_0x348f35){_0x45dca5['rows']=_0x348f35;return _0x45dca5;})[_0xcbb6('0x25')](respondWithFilteredResult(_0x3f048a,_0x1c87be))[_0xcbb6('0x40')](handleError(_0x3f048a,null));};exports[_0xcbb6('0x41')]=function(_0x1f74c2,_0x20decb){var _0x57a73b={'raw':!![],'where':{'id':_0x1f74c2['params']['id']}},_0x539fce={};_0x539fce[_0xcbb6('0x30')]=_[_0xcbb6('0x42')](db['SmsTransferReport'][_0xcbb6('0x2b')]);_0x539fce[_0xcbb6('0x2d')]=_[_0xcbb6('0x42')](_0x1f74c2[_0xcbb6('0x2d')]);_0x539fce[_0xcbb6('0x2e')]=_[_0xcbb6('0x43')](_0x539fce[_0xcbb6('0x30')],_0x539fce[_0xcbb6('0x2d')]);_0x57a73b['attributes']=_[_0xcbb6('0x43')](_0x539fce[_0xcbb6('0x30')],qs[_0xcbb6('0x31')](_0x1f74c2['query'][_0xcbb6('0x31')]));_0x57a73b[_0xcbb6('0x2f')]=_0x57a73b[_0xcbb6('0x2f')][_0xcbb6('0x32')]?_0x57a73b[_0xcbb6('0x2f')]:_0x539fce[_0xcbb6('0x30')];if(_0x1f74c2[_0xcbb6('0x2d')]['includeAll']){_0x57a73b[_0xcbb6('0x3d')]=[{'all':!![]}];}_0x57a73b=_['merge']({},_0x57a73b,_0x1f74c2[_0xcbb6('0x3b')]);return db[_0xcbb6('0x3e')][_0xcbb6('0x44')](_0x57a73b)[_0xcbb6('0x25')](handleEntityNotFound(_0x20decb,null))[_0xcbb6('0x25')](respondWithResult(_0x20decb,null))['catch'](handleError(_0x20decb,null));};exports[_0xcbb6('0x45')]=function(_0x4277d5,_0xb8de23){return db['SmsTransferReport'][_0xcbb6('0x45')](_0x4277d5[_0xcbb6('0x46')],{})[_0xcbb6('0x25')](respondWithResult(_0xb8de23,0xc9))['catch'](handleError(_0xb8de23,null));};exports[_0xcbb6('0x24')]=function(_0x29f856,_0x44e5c9){if(_0x29f856[_0xcbb6('0x46')]['id']){delete _0x29f856[_0xcbb6('0x46')]['id'];}return db['SmsTransferReport'][_0xcbb6('0x44')]({'where':{'id':_0x29f856['params']['id']}})[_0xcbb6('0x25')](handleEntityNotFound(_0x44e5c9,null))[_0xcbb6('0x25')](saveUpdates(_0x29f856[_0xcbb6('0x46')],null))[_0xcbb6('0x25')](respondWithResult(_0x44e5c9,null))[_0xcbb6('0x40')](handleError(_0x44e5c9,null));};exports['destroy']=function(_0x1984ab,_0x1c9880){return db['SmsTransferReport']['find']({'where':{'id':_0x1984ab['params']['id']}})[_0xcbb6('0x25')](handleEntityNotFound(_0x1c9880,null))[_0xcbb6('0x25')](removeEntity(_0x1c9880,null))['catch'](handleError(_0x1c9880,null));};exports[_0xcbb6('0x47')]=function(_0x4e75bd,_0x33983f){return db[_0xcbb6('0x3e')][_0xcbb6('0x47')]()['then'](respondWithResult(_0x33983f,null))[_0xcbb6('0x40')](handleError(_0x33983f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 8b0c25e..bdb87b2 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 _0x4e09=['bluebird','path','rimraf','../../config/environment','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x5765bb,_0x45998c){var _0x452a60=function(_0x23d107){while(--_0x23d107){_0x5765bb['push'](_0x5765bb['shift']());}};_0x452a60(++_0x45998c);}(_0x4e09,0x19e));var _0x94e0=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4e09[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x94e0('0x0'));var util=require(_0x94e0('0x1'));var logger=require(_0x94e0('0x2'))('api');var moment=require(_0x94e0('0x3'));var BPromise=require(_0x94e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94e0('0x5'));var rimraf=require(_0x94e0('0x6'));var config=require(_0x94e0('0x7'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x223c25,_0xf6c33d){return _0x223c25[_0x94e0('0x8')]('SmsTransferReport',attributes,{'tableName':_0x94e0('0x9'),'paranoid':![],'indexes':[{'name':_0x94e0('0xa'),'fields':[_0x94e0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x209f=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer'];(function(_0x5aa129,_0x12f873){var _0x72a385=function(_0x1bc9d4){while(--_0x1bc9d4){_0x5aa129['push'](_0x5aa129['shift']());}};_0x72a385(++_0x12f873);}(_0x209f,0x199));var _0xf209=function(_0x4328eb,_0x4a9f29){_0x4328eb=_0x4328eb-0x0;var _0x475aa9=_0x209f[_0x4328eb];return _0x475aa9;};'use strict';var _=require(_0xf209('0x0'));var util=require('util');var logger=require(_0xf209('0x1'))(_0xf209('0x2'));var moment=require('moment');var BPromise=require(_0xf209('0x3'));var rp=require(_0xf209('0x4'));var fs=require('fs');var path=require(_0xf209('0x5'));var rimraf=require('rimraf');var config=require(_0xf209('0x6'));var attributes=require(_0xf209('0x7'));module[_0xf209('0x8')]=function(_0x24b4e2,_0x46c481){return _0x24b4e2['define'](_0xf209('0x9'),attributes,{'tableName':_0xf209('0xa'),'paranoid':![],'indexes':[{'name':_0xf209('0xb'),'fields':[_0xf209('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index de37aa1..6a70257 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 _0x6bdc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','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);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x2c72dd,_0x1ee098){_0x2c72dd=_0x2c72dd-0x0;var _0x386272=_0x6bdc[_0x2c72dd];return _0x386272;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var moment=require(_0xc6bd('0x2'));var BPromise=require(_0xc6bd('0x3'));var rs=require(_0xc6bd('0x4'));var fs=require('fs');var Redis=require(_0xc6bd('0x5'));var db=require(_0xc6bd('0x6'))['db'];var utils=require(_0xc6bd('0x7'));var logger=require(_0xc6bd('0x8'))(_0xc6bd('0x9'));var config=require('../../config/environment');var jayson=require(_0xc6bd('0xa'));var client=jayson[_0xc6bd('0xb')][_0xc6bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f5327,_0x2c1c68,_0x8bd379){return new BPromise(function(_0x5ca385,_0x374067){return client[_0xc6bd('0xd')](_0x3f5327,_0x8bd379)[_0xc6bd('0xe')](function(_0x5e92e8){logger['info'](_0xc6bd('0xf'),_0x2c1c68,'request\x20sent');logger[_0xc6bd('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2c1c68,_0xc6bd('0x11'),JSON[_0xc6bd('0x12')](_0x5e92e8));if(_0x5e92e8[_0xc6bd('0x13')]){if(_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x14')]===0x1f4){logger[_0xc6bd('0x13')](_0xc6bd('0xf'),_0x2c1c68,_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x15')]);return _0x374067(_0x5e92e8[_0xc6bd('0x13')][_0xc6bd('0x15')]);}logger[_0xc6bd('0x13')](_0xc6bd('0xf'),_0x2c1c68,_0x5e92e8[_0xc6bd('0x13')]['message']);return _0x5ca385(_0x5e92e8[_0xc6bd('0x13')]['message']);}else{logger['info'](_0xc6bd('0xf'),_0x2c1c68,_0xc6bd('0x11'));_0x5ca385(_0x5e92e8[_0xc6bd('0x16')][_0xc6bd('0x15')]);}})[_0xc6bd('0x17')](function(_0x5795bc){logger['error'](_0xc6bd('0xf'),_0x2c1c68,_0x5795bc);_0x374067(_0x5795bc);});});} \ No newline at end of file +var _0xab29=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x418b73,_0x56c3b3){var _0xbafcc0=function(_0x44cc54){while(--_0x44cc54){_0x418b73['push'](_0x418b73['shift']());}};_0xbafcc0(++_0x56c3b3);}(_0xab29,0x145));var _0x9ab2=function(_0x5dae66,_0x1c27b4){_0x5dae66=_0x5dae66-0x0;var _0x26a36c=_0xab29[_0x5dae66];return _0x26a36c;};'use strict';var _=require(_0x9ab2('0x0'));var util=require(_0x9ab2('0x1'));var moment=require(_0x9ab2('0x2'));var BPromise=require(_0x9ab2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ab2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ab2('0x5'));var logger=require(_0x9ab2('0x6'))(_0x9ab2('0x7'));var config=require(_0x9ab2('0x8'));var jayson=require(_0x9ab2('0x9'));var client=jayson['client'][_0x9ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3739c8,_0x42d544,_0x3c73e5){return new BPromise(function(_0x3a3553,_0x564109){return client[_0x9ab2('0xb')](_0x3739c8,_0x3c73e5)[_0x9ab2('0xc')](function(_0x398547){logger[_0x9ab2('0xd')](_0x9ab2('0xe'),_0x42d544,_0x9ab2('0xf'));logger[_0x9ab2('0x10')](_0x9ab2('0x11'),_0x42d544,_0x9ab2('0xf'),JSON['stringify'](_0x398547));if(_0x398547[_0x9ab2('0x12')]){if(_0x398547[_0x9ab2('0x12')]['code']===0x1f4){logger['error'](_0x9ab2('0xe'),_0x42d544,_0x398547[_0x9ab2('0x12')][_0x9ab2('0x13')]);return _0x564109(_0x398547['error'][_0x9ab2('0x13')]);}logger[_0x9ab2('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x42d544,_0x398547[_0x9ab2('0x12')][_0x9ab2('0x13')]);return _0x3a3553(_0x398547[_0x9ab2('0x12')][_0x9ab2('0x13')]);}else{logger[_0x9ab2('0xd')](_0x9ab2('0xe'),_0x42d544,_0x9ab2('0xf'));_0x3a3553(_0x398547[_0x9ab2('0x14')]['message']);}})[_0x9ab2('0x15')](function(_0x273e07){logger[_0x9ab2('0x12')](_0x9ab2('0xe'),_0x42d544,_0x273e07);_0x564109(_0x273e07);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 98af7a8..b2cb6ae 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 _0x08d5=['index','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','extname','post','single','file','put','update','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x08d5,0xbc));var _0x508d=function(_0x3d4277,_0x33b44a){_0x3d4277=_0x3d4277-0x0;var _0x49a998=_0x08d5[_0x3d4277];return _0x49a998;};'use strict';var multer=require(_0x508d('0x0'));var util=require(_0x508d('0x1'));var path=require('path');var timeout=require(_0x508d('0x2'));var express=require(_0x508d('0x3'));var router=express[_0x508d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x508d('0x5'));var config=require(_0x508d('0x6'));var controller=require(_0x508d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x508d('0x8')]);router[_0x508d('0x9')](_0x508d('0xa'),auth[_0x508d('0xb')](),controller[_0x508d('0xc')]);router[_0x508d('0x9')](_0x508d('0xd'),auth['isAuthenticated'](),controller[_0x508d('0xe')]);var upload=multer({'storage':multer[_0x508d('0xf')]({'destination':function(_0x10ac6c,_0x3ad49f,_0xa21342){_0xa21342(null,path[_0x508d('0x10')](config[_0x508d('0x11')],_0x508d('0x12')));},'filename':function(_0x2474c5,_0x490169,_0x40140f){_0x490169[_0x508d('0x13')]=_0x490169[_0x508d('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40140f(null,util[_0x508d('0x14')]('%s-%s%s',path['basename'](_0x490169[_0x508d('0x13')],path['extname'](_0x490169['originalname'])),Date['now'](),path[_0x508d('0x15')](_0x490169[_0x508d('0x13')])));}})});router[_0x508d('0x16')]('/',upload[_0x508d('0x17')](_0x508d('0x18')),controller['create']);router[_0x508d('0x19')](_0x508d('0xa'),auth[_0x508d('0xb')](),controller[_0x508d('0x1a')]);router['delete'](_0x508d('0xa'),auth[_0x508d('0xb')](),controller[_0x508d('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xc7dd=['basename','extname','post','single','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format'];(function(_0x3f61c8,_0x2efc30){var _0x585252=function(_0x446021){while(--_0x446021){_0x3f61c8['push'](_0x3f61c8['shift']());}};_0x585252(++_0x2efc30);}(_0xc7dd,0x7c));var _0xdc7d=function(_0x108db1,_0x89896d){_0x108db1=_0x108db1-0x0;var _0x16848d=_0xc7dd[_0x108db1];return _0x16848d;};'use strict';var multer=require(_0xdc7d('0x0'));var util=require(_0xdc7d('0x1'));var path=require(_0xdc7d('0x2'));var timeout=require(_0xdc7d('0x3'));var express=require('express');var router=express[_0xdc7d('0x4')]();var fs_extra=require(_0xdc7d('0x5'));var auth=require(_0xdc7d('0x6'));var interaction=require(_0xdc7d('0x7'));var config=require(_0xdc7d('0x8'));var controller=require(_0xdc7d('0x9'));router[_0xdc7d('0xa')]('/',auth[_0xdc7d('0xb')](),controller[_0xdc7d('0xc')]);router[_0xdc7d('0xa')]('/:id',auth[_0xdc7d('0xb')](),controller[_0xdc7d('0xd')]);router[_0xdc7d('0xa')]('/:id/download',auth[_0xdc7d('0xb')](),controller['download']);var upload=multer({'storage':multer[_0xdc7d('0xe')]({'destination':function(_0x330aa7,_0x316292,_0x1646c9){_0x1646c9(null,path[_0xdc7d('0xf')](config[_0xdc7d('0x10')],_0xdc7d('0x11')));},'filename':function(_0xd15631,_0x40af19,_0x35c75a){_0x40af19[_0xdc7d('0x12')]=_0x40af19['originalname'][_0xdc7d('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x35c75a(null,util[_0xdc7d('0x14')]('%s-%s%s',path[_0xdc7d('0x15')](_0x40af19[_0xdc7d('0x12')],path[_0xdc7d('0x16')](_0x40af19['originalname'])),Date['now'](),path['extname'](_0x40af19['originalname'])));}})});router[_0xdc7d('0x17')]('/',upload[_0xdc7d('0x18')]('file'),controller['create']);router['put'](_0xdc7d('0x19'),auth[_0xdc7d('0xb')](),controller[_0xdc7d('0x1a')]);router['delete'](_0xdc7d('0x19'),auth[_0xdc7d('0xb')](),controller[_0xdc7d('0x1b')]);module[_0xdc7d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 818f695..86dc434 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 _0xe9c7=['sequelize','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x5cd0f0,_0x318f8a){var _0x41fa3e=function(_0x53ad5d){while(--_0x53ad5d){_0x5cd0f0['push'](_0x5cd0f0['shift']());}};_0x41fa3e(++_0x318f8a);}(_0xe9c7,0xe6));var _0x7e9c=function(_0x455de5,_0x17346a){_0x455de5=_0x455de5-0x0;var _0x3091d7=_0xe9c7[_0x455de5];return _0x3091d7;};'use strict';var Sequelize=require(_0x7e9c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x7e9c('0x1')]},'display_name':{'type':Sequelize[_0x7e9c('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x7e9c('0x1')]},'original_format':{'type':Sequelize[_0x7e9c('0x1')]},'original_duration':{'type':Sequelize[_0x7e9c('0x2')]},'original_sampleCount':{'type':Sequelize[_0x7e9c('0x3')]},'original_channelCount':{'type':Sequelize[_0x7e9c('0x4')]},'original_bitRate':{'type':Sequelize[_0x7e9c('0x3')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x7e9c('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x7e9c('0x3')]},'converted_channelCount':{'type':Sequelize[_0x7e9c('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x7e9c('0x4')]}}; \ No newline at end of file +var _0xc7dd=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0xf74631,_0x4df45e){var _0x52d1bc=function(_0xad4e03){while(--_0xad4e03){_0xf74631['push'](_0xf74631['shift']());}};_0x52d1bc(++_0x4df45e);}(_0xc7dd,0x1e6));var _0xdc7d=function(_0x279841,_0x4e9e3b){_0x279841=_0x279841-0x0;var _0x4d3a9f=_0xc7dd[_0x279841];return _0x4d3a9f;};'use strict';var Sequelize=require(_0xdc7d('0x0'));module[_0xdc7d('0x1')]={'name':{'type':Sequelize[_0xdc7d('0x2')],'unique':_0xdc7d('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xdc7d('0x2')]},'display_name':{'type':Sequelize[_0xdc7d('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xdc7d('0x2')]},'original_format':{'type':Sequelize[_0xdc7d('0x2')]},'original_duration':{'type':Sequelize[_0xdc7d('0x4')]},'original_sampleCount':{'type':Sequelize[_0xdc7d('0x5')]},'original_channelCount':{'type':Sequelize[_0xdc7d('0x6')]},'original_bitRate':{'type':Sequelize[_0xdc7d('0x5')]},'original_sampleRate':{'type':Sequelize[_0xdc7d('0x6')]},'converted_format':{'type':Sequelize[_0xdc7d('0x2')]},'converted_duration':{'type':Sequelize[_0xdc7d('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xdc7d('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xdc7d('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0c83df9..41cf58f 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 _0xc271=['description','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','count','limit','set','Content-Range','reject','update','destroy','then','Sounds','UserProfileResource','error','stack','name','index','map','Sound','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','join','format','create','originalname','basename','file','filename','extname','substring','server/files/sounds/original','%s.%s','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','send','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_sampleRate','0777','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x309eaa,_0x46b31){var _0x3fad14=function(_0x388c86){while(--_0x388c86){_0x309eaa['push'](_0x309eaa['shift']());}};_0x3fad14(++_0x46b31);}(_0xc271,0xf4));var _0x1c27=function(_0xeb67f3,_0x631617){_0xeb67f3=_0xeb67f3-0x0;var _0x193a08=_0xc271[_0xeb67f3];return _0x193a08;};'use strict';var emlformat=require(_0x1c27('0x0'));var rimraf=require(_0x1c27('0x1'));var zipdir=require(_0x1c27('0x2'));var jsonpatch=require(_0x1c27('0x3'));var rp=require(_0x1c27('0x4'));var moment=require(_0x1c27('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1c27('0x6'));var util=require('util');var path=require(_0x1c27('0x7'));var sox=require('sox');var csv=require(_0x1c27('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c27('0x9'));var _=require(_0x1c27('0xa'));var squel=require(_0x1c27('0xb'));var crypto=require('crypto');var jsforce=require(_0x1c27('0xc'));var deskjs=require(_0x1c27('0xd'));var toCsv=require(_0x1c27('0x8'));var querystring=require(_0x1c27('0xe'));var Papa=require('papaparse');var Redis=require(_0x1c27('0xf'));var authService=require(_0x1c27('0x10'));var qs=require(_0x1c27('0x11'));var as=require(_0x1c27('0x12'));var hardwareService=require(_0x1c27('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1c27('0x14'));var config=require(_0x1c27('0x15'));var licenseUtil=require(_0x1c27('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b0197,_0xcd7e21){_0xcd7e21=_0xcd7e21||0xcc;return function(_0x4f19f6){if(_0x4f19f6){return _0x4b0197['sendStatus'](_0xcd7e21);}return _0x4b0197[_0x1c27('0x17')](_0xcd7e21)[_0x1c27('0x18')]();};}function respondWithResult(_0x225f11,_0x103560){_0x103560=_0x103560||0xc8;return function(_0x3cdf51){if(_0x3cdf51){return _0x225f11[_0x1c27('0x17')](_0x103560)[_0x1c27('0x19')](_0x3cdf51);}};}function respondWithFilteredResult(_0x4b3bd6,_0x2ed6a3){return function(_0x2d5939){if(_0x2d5939){var _0x517b05=typeof _0x2ed6a3[_0x1c27('0x1a')]==='undefined'&&typeof _0x2ed6a3['limit']==='undefined';var _0x516fd7=_0x2d5939[_0x1c27('0x1b')];var _0x3372b6=_0x517b05?0x0:_0x2ed6a3[_0x1c27('0x1a')];var _0x47cd77=_0x517b05?_0x2d5939['count']:_0x2ed6a3[_0x1c27('0x1a')]+_0x2ed6a3[_0x1c27('0x1c')];var _0x33c0bf;if(_0x47cd77>=_0x516fd7){_0x47cd77=_0x516fd7;_0x33c0bf=0xc8;}else{_0x33c0bf=0xce;}_0x4b3bd6[_0x1c27('0x17')](_0x33c0bf);return _0x4b3bd6[_0x1c27('0x1d')](_0x1c27('0x1e'),_0x3372b6+'-'+_0x47cd77+'/'+_0x516fd7)[_0x1c27('0x19')](_0x2d5939);}return null;};}function patchUpdates(_0x27827a){return function(_0x4b2e58){try{jsonpatch['apply'](_0x4b2e58,_0x27827a,!![]);}catch(_0x42ca9b){return BPromise[_0x1c27('0x1f')](_0x42ca9b);}return _0x4b2e58['save']();};}function saveUpdates(_0x24cbb5,_0x3d65ad){return function(_0x15f942){if(_0x15f942){return _0x15f942[_0x1c27('0x20')](_0x24cbb5)['then'](function(_0x201f8e){return _0x201f8e;});}return null;};}function removeEntity(_0x5876e6,_0x249dfa){return function(_0x3d3b97){if(_0x3d3b97){return _0x3d3b97[_0x1c27('0x21')]()[_0x1c27('0x22')](function(){var _0x1e7739=_0x3d3b97['get']({'plain':!![]});var _0x2cdd3c=_0x1c27('0x23');return db[_0x1c27('0x24')][_0x1c27('0x21')]({'where':{'type':_0x2cdd3c,'resourceId':_0x1e7739['id']}})[_0x1c27('0x22')](function(){return _0x3d3b97;});})[_0x1c27('0x22')](function(){_0x5876e6[_0x1c27('0x17')](0xcc)[_0x1c27('0x18')]();});}};}function handleEntityNotFound(_0x54af15,_0x5bf3a5){return function(_0x3e3b50){if(!_0x3e3b50){_0x54af15['sendStatus'](0x194);}return _0x3e3b50;};}function handleError(_0x35e1a7,_0x294a94){_0x294a94=_0x294a94||0x1f4;return function(_0x530b04){logger[_0x1c27('0x25')](_0x530b04[_0x1c27('0x26')]);if(_0x530b04[_0x1c27('0x27')]){delete _0x530b04[_0x1c27('0x27')];}_0x35e1a7[_0x1c27('0x17')](_0x294a94)['send'](_0x530b04);};}exports[_0x1c27('0x28')]=function(_0x50b6c5,_0x396d8e){var _0x132533={},_0x2441bd={},_0x3415fd={'count':0x0,'rows':[]};var _0x5a96f5=_[_0x1c27('0x29')](db[_0x1c27('0x2a')][_0x1c27('0x2b')],function(_0x57f6d3){return{'name':_0x57f6d3['fieldName'],'type':_0x57f6d3[_0x1c27('0x2c')][_0x1c27('0x2d')]};});_0x2441bd['model']=_[_0x1c27('0x29')](_0x5a96f5,_0x1c27('0x27'));_0x2441bd['query']=_[_0x1c27('0x2e')](_0x50b6c5[_0x1c27('0x2f')]);_0x2441bd[_0x1c27('0x30')]=_[_0x1c27('0x31')](_0x2441bd[_0x1c27('0x32')],_0x2441bd[_0x1c27('0x2f')]);_0x132533[_0x1c27('0x33')]=_['intersection'](_0x2441bd['model'],qs[_0x1c27('0x34')](_0x50b6c5['query'][_0x1c27('0x34')]));_0x132533[_0x1c27('0x33')]=_0x132533[_0x1c27('0x33')][_0x1c27('0x35')]?_0x132533[_0x1c27('0x33')]:_0x2441bd[_0x1c27('0x32')];if(!_0x50b6c5[_0x1c27('0x2f')][_0x1c27('0x36')](_0x1c27('0x37'))){_0x132533['limit']=qs['limit'](_0x50b6c5[_0x1c27('0x2f')][_0x1c27('0x1c')]);_0x132533[_0x1c27('0x1a')]=qs[_0x1c27('0x1a')](_0x50b6c5['query']['offset']);}_0x132533[_0x1c27('0x38')]=qs['sort'](_0x50b6c5[_0x1c27('0x2f')]['sort']);_0x132533[_0x1c27('0x39')]=qs[_0x1c27('0x30')](_[_0x1c27('0x3a')](_0x50b6c5[_0x1c27('0x2f')],_0x2441bd['filters']),_0x5a96f5);if(_0x50b6c5['query'][_0x1c27('0x3b')]){_0x132533[_0x1c27('0x39')]=_[_0x1c27('0x3c')](_0x132533[_0x1c27('0x39')],{'$or':_[_0x1c27('0x29')](_0x5a96f5,function(_0x4ef088){if(_0x4ef088[_0x1c27('0x2c')]!==_0x1c27('0x3d')){var _0x391135={};_0x391135[_0x4ef088[_0x1c27('0x27')]]={'$like':'%'+_0x50b6c5[_0x1c27('0x2f')][_0x1c27('0x3b')]+'%'};return _0x391135;}})});}_0x132533=_[_0x1c27('0x3c')]({},_0x132533,_0x50b6c5['options']);var _0x2f2551={'where':_0x132533[_0x1c27('0x39')]};return db['Sound'][_0x1c27('0x1b')](_0x2f2551)[_0x1c27('0x22')](function(_0x360550){_0x3415fd[_0x1c27('0x1b')]=_0x360550;if(_0x50b6c5[_0x1c27('0x2f')]['includeAll']){_0x132533[_0x1c27('0x3e')]=[{'all':!![]}];}return db[_0x1c27('0x2a')][_0x1c27('0x3f')](_0x132533);})[_0x1c27('0x22')](function(_0x2716c6){_0x3415fd[_0x1c27('0x40')]=_0x2716c6;return _0x3415fd;})['then'](respondWithFilteredResult(_0x396d8e,_0x132533))[_0x1c27('0x41')](handleError(_0x396d8e,null));};exports[_0x1c27('0x42')]=function(_0x4b3e17,_0x51ecb1){var _0x1d97e5={'raw':!![],'where':{'id':_0x4b3e17[_0x1c27('0x43')]['id']}},_0x1f4241={};_0x1f4241[_0x1c27('0x32')]=_[_0x1c27('0x2e')](db[_0x1c27('0x2a')]['rawAttributes']);_0x1f4241[_0x1c27('0x2f')]=_[_0x1c27('0x2e')](_0x4b3e17[_0x1c27('0x2f')]);_0x1f4241['filters']=_[_0x1c27('0x31')](_0x1f4241[_0x1c27('0x32')],_0x1f4241[_0x1c27('0x2f')]);_0x1d97e5[_0x1c27('0x33')]=_[_0x1c27('0x31')](_0x1f4241['model'],qs['fields'](_0x4b3e17[_0x1c27('0x2f')]['fields']));_0x1d97e5[_0x1c27('0x33')]=_0x1d97e5[_0x1c27('0x33')][_0x1c27('0x35')]?_0x1d97e5[_0x1c27('0x33')]:_0x1f4241['model'];if(_0x4b3e17['query'][_0x1c27('0x44')]){_0x1d97e5['include']=[{'all':!![]}];}_0x1d97e5=_[_0x1c27('0x3c')]({},_0x1d97e5,_0x4b3e17[_0x1c27('0x45')]);return db[_0x1c27('0x2a')][_0x1c27('0x46')](_0x1d97e5)[_0x1c27('0x22')](handleEntityNotFound(_0x51ecb1,null))[_0x1c27('0x22')](respondWithResult(_0x51ecb1,null))['catch'](handleError(_0x51ecb1,null));};exports[_0x1c27('0x47')]=function(_0x4e1fcc,_0x282787,_0x56e12f){return db[_0x1c27('0x2a')][_0x1c27('0x46')]({'where':{'id':_0x4e1fcc['params']['id']},'attributes':['name',_0x1c27('0x48'),_0x1c27('0x49')],'raw':!![]})[_0x1c27('0x22')](handleEntityNotFound(_0x282787,null))[_0x1c27('0x22')](function(_0x340a52){if(_0x340a52){if(!fs[_0x1c27('0x4a')](path['join'](config[_0x1c27('0x4b')],_0x1c27('0x4c'),_0x340a52[_0x1c27('0x48')]+'.'+_0x340a52[_0x1c27('0x49')]))){throw new db[(_0x1c27('0x4d'))]['ValidationError'](_0x1c27('0x4e'));}return _0x282787[_0x1c27('0x47')](path[_0x1c27('0x4f')](config[_0x1c27('0x4b')],_0x1c27('0x4c'),util[_0x1c27('0x50')]('%s.%s',_0x340a52[_0x1c27('0x48')],_0x340a52[_0x1c27('0x49')])),util['format']('%s.%s',_0x340a52[_0x1c27('0x27')],_0x340a52[_0x1c27('0x49')]));}return null;})[_0x1c27('0x41')](handleError(_0x282787,null));};exports[_0x1c27('0x51')]=function(_0xef518,_0x771a2,_0x1a8b5a){var _0x553fff={'name':path['basename'](_0xef518['file'][_0x1c27('0x52')],path['extname'](_0xef518['file'][_0x1c27('0x52')])),'save_name':path[_0x1c27('0x53')](_0xef518['file']['filename'],path['extname'](_0xef518[_0x1c27('0x54')][_0x1c27('0x55')])),'original_format':path[_0x1c27('0x56')](_0xef518[_0x1c27('0x54')]['originalname'])[_0x1c27('0x57')](0x1),'converted_format':'wav'};var _0x516488=path['join'](config[_0x1c27('0x4b')],_0x1c27('0x58'),_0xef518[_0x1c27('0x54')][_0x1c27('0x55')]);var _0x295ab4=path['join'](config[_0x1c27('0x4b')],_0x1c27('0x4c'),util['format'](_0x1c27('0x59'),path[_0x1c27('0x53')](_0xef518[_0x1c27('0x54')][_0x1c27('0x55')],path['extname'](_0xef518[_0x1c27('0x54')][_0x1c27('0x55')])),_0x553fff['converted_format']));logger['info'](_0x1c27('0x5a'),_0x516488);logger[_0x1c27('0x5b')](_0x1c27('0x5c'),_0x295ab4);try{fs[_0x1c27('0x5d')](_0x516488,parseInt('0777',0x8));var _0x2c632d=sox[_0x1c27('0x5e')](_0x516488,_0x295ab4,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2c632d['on'](_0x1c27('0x25'),function(_0x4ef1db){fs['unlinkSync'](_0x516488);_0x771a2[_0x1c27('0x17')](0x1f4)[_0x1c27('0x5f')](_0x4ef1db);});_0x2c632d['on'](_0x1c27('0x60'),function(_0x4a0a72){_0x553fff[_0x1c27('0x61')]=isNaN(_0x4a0a72[_0x1c27('0x62')])?null:_0x4a0a72[_0x1c27('0x62')]*0x3e8;_0x553fff[_0x1c27('0x63')]=isNaN(_0x4a0a72[_0x1c27('0x64')])?null:_0x4a0a72[_0x1c27('0x64')];_0x553fff['original_channelCount']=isNaN(_0x4a0a72[_0x1c27('0x65')])?null:_0x4a0a72[_0x1c27('0x65')];_0x553fff['original_bitRate']=isNaN(_0x4a0a72[_0x1c27('0x66')])?null:_0x4a0a72[_0x1c27('0x66')];_0x553fff[_0x1c27('0x67')]=isNaN(_0x4a0a72[_0x1c27('0x68')])?null:_0x4a0a72[_0x1c27('0x68')];});_0x2c632d['on'](_0x1c27('0x69'),function(_0x32cd8e){_0x553fff['converted_duration']=isNaN(_0x32cd8e[_0x1c27('0x62')])?null:_0x32cd8e[_0x1c27('0x62')]*0x3e8;_0x553fff[_0x1c27('0x6a')]=isNaN(_0x32cd8e['sampleCount'])?null:_0x32cd8e[_0x1c27('0x64')];_0x553fff[_0x1c27('0x6b')]=isNaN(_0x32cd8e[_0x1c27('0x65')])?null:_0x32cd8e['channelCount'];_0x553fff['converted_bitRate']=isNaN(_0x32cd8e[_0x1c27('0x66')])?null:_0x32cd8e['bitRate'];_0x553fff[_0x1c27('0x6c')]=isNaN(_0x32cd8e[_0x1c27('0x68')])?null:_0x32cd8e[_0x1c27('0x68')];});_0x2c632d['on']('end',function(){fs['chmodSync'](_0x295ab4,parseInt(_0x1c27('0x6d'),0x8));return db[_0x1c27('0x2a')]['create'](_0x553fff)[_0x1c27('0x22')](function(_0x59abd8){var _0x6dbc9d={'role':_0xef518['body'][_0x1c27('0x6e')],'userProfileId':_0xef518['body']['userProfileId']};if(!_0x6dbc9d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6dbc9d[_0x1c27('0x6e')]===_0x1c27('0x6f')){var _0x58da7e=_0x59abd8['get']({'plain':!![]});return db[_0x1c27('0x70')][_0x1c27('0x46')]({'where':{'name':_0x1c27('0x23'),'userProfileId':_0x6dbc9d['userProfileId']},'raw':!![]})[_0x1c27('0x22')](function(_0x29517d){if(_0x29517d&&_0x29517d[_0x1c27('0x71')]===0x0){return db[_0x1c27('0x24')][_0x1c27('0x51')]({'name':_0x58da7e[_0x1c27('0x27')],'resourceId':_0x58da7e['id'],'type':_0x29517d[_0x1c27('0x27')],'sectionId':_0x29517d['id']},{})['then'](function(){return _0x59abd8;});}else{return _0x59abd8;}})[_0x1c27('0x41')](function(_0x3d9f08){logger[_0x1c27('0x25')](_0x1c27('0x72'),_0x3d9f08);throw _0x3d9f08;});}return _0x59abd8;})['then'](respondWithResult(_0x771a2,null))[_0x1c27('0x41')](handleError(_0x771a2,null));});_0x2c632d['start']();}catch(_0xaae71){_0x771a2[_0x1c27('0x17')](0x1f4)[_0x1c27('0x5f')](_0xaae71);}};exports[_0x1c27('0x20')]=function(_0x1e8b6c,_0x25c392,_0x54d655){return db['Sound'][_0x1c27('0x46')]({'where':{'id':_0x1e8b6c[_0x1c27('0x43')]['id']}})[_0x1c27('0x22')](handleEntityNotFound(_0x25c392,null))[_0x1c27('0x22')](saveUpdates(_[_0x1c27('0x3a')](_0x1e8b6c[_0x1c27('0x73')],[_0x1c27('0x27'),_0x1c27('0x74')]),null))[_0x1c27('0x22')](respondWithResult(_0x25c392,null))[_0x1c27('0x41')](handleError(_0x25c392,null));};exports[_0x1c27('0x75')]=function(_0xe75051,_0x7f58c4,_0x1bc9c5){return db[_0x1c27('0x2a')][_0x1c27('0x46')]({'where':{'id':_0xe75051['params']['id']}})[_0x1c27('0x22')](function(_0x43b561){if(_0x43b561){return _0x43b561[_0x1c27('0x21')]();}})[_0x1c27('0x22')](function(_0x552e69){var _0x1be0ec=path['join'](config['root'],_0x1c27('0x58'),util['format'](_0x1c27('0x59'),_0x552e69['save_name'],_0x552e69[_0x1c27('0x76')]));var _0x168a11=path[_0x1c27('0x4f')](config['root'],_0x1c27('0x4c'),util[_0x1c27('0x50')](_0x1c27('0x59'),_0x552e69[_0x1c27('0x48')],_0x552e69['converted_format']));fs[_0x1c27('0x77')](_0x1be0ec);fs[_0x1c27('0x77')](_0x168a11);return _0x552e69;})[_0x1c27('0x22')](function(_0x381f31){if(_0x381f31){return _0x7f58c4['status'](0xcc)[_0x1c27('0x18')]();}})[_0x1c27('0x22')](handleEntityNotFound(_0x7f58c4,null))[_0x1c27('0x41')](handleError(_0x7f58c4,null));}; \ No newline at end of file +var _0xecad=['index','Sound','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','existsSync','join','root','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','download','format','save_name','create','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','error','start','description','delete','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','update','then','destroy','Sounds','UserProfileResource','stack','name','send'];(function(_0x51e516,_0x5a0fc0){var _0xa0e42=function(_0x55f619){while(--_0x55f619){_0x51e516['push'](_0x51e516['shift']());}};_0xa0e42(++_0x5a0fc0);}(_0xecad,0x1d7));var _0xdeca=function(_0x28b930,_0x19b05f){_0x28b930=_0x28b930-0x0;var _0x112256=_0xecad[_0x28b930];return _0x112256;};'use strict';var emlformat=require(_0xdeca('0x0'));var rimraf=require(_0xdeca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdeca('0x2'));var rp=require(_0xdeca('0x3'));var moment=require(_0xdeca('0x4'));var BPromise=require(_0xdeca('0x5'));var Mustache=require(_0xdeca('0x6'));var util=require(_0xdeca('0x7'));var path=require(_0xdeca('0x8'));var sox=require(_0xdeca('0x9'));var csv=require(_0xdeca('0xa'));var ejs=require(_0xdeca('0xb'));var fs=require('fs');var fs_extra=require(_0xdeca('0xc'));var _=require(_0xdeca('0xd'));var squel=require(_0xdeca('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdeca('0xf'));var toCsv=require(_0xdeca('0xa'));var querystring=require(_0xdeca('0x10'));var Papa=require(_0xdeca('0x11'));var Redis=require(_0xdeca('0x12'));var authService=require(_0xdeca('0x13'));var qs=require(_0xdeca('0x14'));var as=require(_0xdeca('0x15'));var hardwareService=require(_0xdeca('0x16'));var logger=require('../../config/logger')(_0xdeca('0x17'));var utils=require(_0xdeca('0x18'));var config=require(_0xdeca('0x19'));var licenseUtil=require(_0xdeca('0x1a'));var db=require(_0xdeca('0x1b'))['db'];function respondWithStatusCode(_0x4c88fe,_0x38ef01){_0x38ef01=_0x38ef01||0xcc;return function(_0x3c9a70){if(_0x3c9a70){return _0x4c88fe[_0xdeca('0x1c')](_0x38ef01);}return _0x4c88fe[_0xdeca('0x1d')](_0x38ef01)[_0xdeca('0x1e')]();};}function respondWithResult(_0x20bc47,_0x38a9eb){_0x38a9eb=_0x38a9eb||0xc8;return function(_0x4c94b2){if(_0x4c94b2){return _0x20bc47[_0xdeca('0x1d')](_0x38a9eb)[_0xdeca('0x1f')](_0x4c94b2);}};}function respondWithFilteredResult(_0x14a1cf,_0x2cea37){return function(_0x2c86b8){if(_0x2c86b8){var _0x1da331=typeof _0x2cea37[_0xdeca('0x20')]===_0xdeca('0x21')&&typeof _0x2cea37['limit']===_0xdeca('0x21');var _0x473a0b=_0x2c86b8[_0xdeca('0x22')];var _0x258285=_0x1da331?0x0:_0x2cea37['offset'];var _0x49be8a=_0x1da331?_0x2c86b8[_0xdeca('0x22')]:_0x2cea37[_0xdeca('0x20')]+_0x2cea37['limit'];var _0x255b43;if(_0x49be8a>=_0x473a0b){_0x49be8a=_0x473a0b;_0x255b43=0xc8;}else{_0x255b43=0xce;}_0x14a1cf[_0xdeca('0x1d')](_0x255b43);return _0x14a1cf['set'](_0xdeca('0x23'),_0x258285+'-'+_0x49be8a+'/'+_0x473a0b)[_0xdeca('0x1f')](_0x2c86b8);}return null;};}function patchUpdates(_0x21c95f){return function(_0x2b9409){try{jsonpatch['apply'](_0x2b9409,_0x21c95f,!![]);}catch(_0x57c5c3){return BPromise[_0xdeca('0x24')](_0x57c5c3);}return _0x2b9409['save']();};}function saveUpdates(_0x5c07ed,_0x296398){return function(_0x32d8b6){if(_0x32d8b6){return _0x32d8b6[_0xdeca('0x25')](_0x5c07ed)[_0xdeca('0x26')](function(_0x586cff){return _0x586cff;});}return null;};}function removeEntity(_0x2dcf45,_0x4247ac){return function(_0x5ac832){if(_0x5ac832){return _0x5ac832[_0xdeca('0x27')]()['then'](function(){var _0xbab6e6=_0x5ac832['get']({'plain':!![]});var _0x4fe497=_0xdeca('0x28');return db[_0xdeca('0x29')][_0xdeca('0x27')]({'where':{'type':_0x4fe497,'resourceId':_0xbab6e6['id']}})[_0xdeca('0x26')](function(){return _0x5ac832;});})['then'](function(){_0x2dcf45[_0xdeca('0x1d')](0xcc)[_0xdeca('0x1e')]();});}};}function handleEntityNotFound(_0x16a57f,_0x29006f){return function(_0x2b413e){if(!_0x2b413e){_0x16a57f[_0xdeca('0x1c')](0x194);}return _0x2b413e;};}function handleError(_0x22f9a8,_0x317c70){_0x317c70=_0x317c70||0x1f4;return function(_0x1915d2){logger['error'](_0x1915d2[_0xdeca('0x2a')]);if(_0x1915d2[_0xdeca('0x2b')]){delete _0x1915d2['name'];}_0x22f9a8['status'](_0x317c70)[_0xdeca('0x2c')](_0x1915d2);};}exports[_0xdeca('0x2d')]=function(_0xbfe910,_0x4dc0a6){var _0xe74bd2={},_0x370fda={},_0x26a3af={'count':0x0,'rows':[]};var _0x2d04e3=_['map'](db[_0xdeca('0x2e')]['rawAttributes'],function(_0x11ba03){return{'name':_0x11ba03[_0xdeca('0x2f')],'type':_0x11ba03['type'][_0xdeca('0x30')]};});_0x370fda[_0xdeca('0x31')]=_['map'](_0x2d04e3,_0xdeca('0x2b'));_0x370fda[_0xdeca('0x32')]=_[_0xdeca('0x33')](_0xbfe910[_0xdeca('0x32')]);_0x370fda[_0xdeca('0x34')]=_[_0xdeca('0x35')](_0x370fda[_0xdeca('0x31')],_0x370fda[_0xdeca('0x32')]);_0xe74bd2[_0xdeca('0x36')]=_[_0xdeca('0x35')](_0x370fda[_0xdeca('0x31')],qs[_0xdeca('0x37')](_0xbfe910['query'][_0xdeca('0x37')]));_0xe74bd2[_0xdeca('0x36')]=_0xe74bd2['attributes'][_0xdeca('0x38')]?_0xe74bd2[_0xdeca('0x36')]:_0x370fda[_0xdeca('0x31')];if(!_0xbfe910[_0xdeca('0x32')][_0xdeca('0x39')](_0xdeca('0x3a'))){_0xe74bd2[_0xdeca('0x3b')]=qs[_0xdeca('0x3b')](_0xbfe910[_0xdeca('0x32')][_0xdeca('0x3b')]);_0xe74bd2['offset']=qs[_0xdeca('0x20')](_0xbfe910[_0xdeca('0x32')]['offset']);}_0xe74bd2[_0xdeca('0x3c')]=qs[_0xdeca('0x3d')](_0xbfe910[_0xdeca('0x32')][_0xdeca('0x3d')]);_0xe74bd2[_0xdeca('0x3e')]=qs['filters'](_[_0xdeca('0x3f')](_0xbfe910[_0xdeca('0x32')],_0x370fda['filters']),_0x2d04e3);if(_0xbfe910[_0xdeca('0x32')][_0xdeca('0x40')]){_0xe74bd2[_0xdeca('0x3e')]=_[_0xdeca('0x41')](_0xe74bd2[_0xdeca('0x3e')],{'$or':_[_0xdeca('0x42')](_0x2d04e3,function(_0x5f4516){if(_0x5f4516[_0xdeca('0x43')]!==_0xdeca('0x44')){var _0x238051={};_0x238051[_0x5f4516[_0xdeca('0x2b')]]={'$like':'%'+_0xbfe910[_0xdeca('0x32')][_0xdeca('0x40')]+'%'};return _0x238051;}})});}_0xe74bd2=_[_0xdeca('0x41')]({},_0xe74bd2,_0xbfe910['options']);var _0x2b39f7={'where':_0xe74bd2[_0xdeca('0x3e')]};return db[_0xdeca('0x2e')]['count'](_0x2b39f7)['then'](function(_0x5c9eb2){_0x26a3af['count']=_0x5c9eb2;if(_0xbfe910[_0xdeca('0x32')][_0xdeca('0x45')]){_0xe74bd2['include']=[{'all':!![]}];}return db[_0xdeca('0x2e')][_0xdeca('0x46')](_0xe74bd2);})[_0xdeca('0x26')](function(_0x4773ba){_0x26a3af['rows']=_0x4773ba;return _0x26a3af;})[_0xdeca('0x26')](respondWithFilteredResult(_0x4dc0a6,_0xe74bd2))[_0xdeca('0x47')](handleError(_0x4dc0a6,null));};exports[_0xdeca('0x48')]=function(_0x58ee25,_0x56f8a4){var _0x21600f={'raw':!![],'where':{'id':_0x58ee25[_0xdeca('0x49')]['id']}},_0x21e522={};_0x21e522[_0xdeca('0x31')]=_[_0xdeca('0x33')](db['Sound'][_0xdeca('0x4a')]);_0x21e522['query']=_[_0xdeca('0x33')](_0x58ee25['query']);_0x21e522[_0xdeca('0x34')]=_['intersection'](_0x21e522['model'],_0x21e522[_0xdeca('0x32')]);_0x21600f[_0xdeca('0x36')]=_['intersection'](_0x21e522[_0xdeca('0x31')],qs[_0xdeca('0x37')](_0x58ee25['query']['fields']));_0x21600f[_0xdeca('0x36')]=_0x21600f[_0xdeca('0x36')][_0xdeca('0x38')]?_0x21600f['attributes']:_0x21e522[_0xdeca('0x31')];if(_0x58ee25[_0xdeca('0x32')][_0xdeca('0x45')]){_0x21600f[_0xdeca('0x4b')]=[{'all':!![]}];}_0x21600f=_['merge']({},_0x21600f,_0x58ee25[_0xdeca('0x4c')]);return db[_0xdeca('0x2e')][_0xdeca('0x4d')](_0x21600f)[_0xdeca('0x26')](handleEntityNotFound(_0x56f8a4,null))[_0xdeca('0x26')](respondWithResult(_0x56f8a4,null))[_0xdeca('0x47')](handleError(_0x56f8a4,null));};exports['download']=function(_0x476f01,_0x15ab5b,_0x17d653){return db['Sound'][_0xdeca('0x4d')]({'where':{'id':_0x476f01['params']['id']},'attributes':[_0xdeca('0x2b'),'save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x15ab5b,null))[_0xdeca('0x26')](function(_0x5882ec){if(_0x5882ec){if(!fs[_0xdeca('0x4e')](path[_0xdeca('0x4f')](config[_0xdeca('0x50')],_0xdeca('0x51'),_0x5882ec['save_name']+'.'+_0x5882ec[_0xdeca('0x52')]))){throw new db['Sequelize'][(_0xdeca('0x53'))](_0xdeca('0x54'));}return _0x15ab5b[_0xdeca('0x55')](path['join'](config['root'],'server/files/sounds/converted',util[_0xdeca('0x56')]('%s.%s',_0x5882ec[_0xdeca('0x57')],_0x5882ec[_0xdeca('0x52')])),util[_0xdeca('0x56')]('%s.%s',_0x5882ec[_0xdeca('0x2b')],_0x5882ec[_0xdeca('0x52')]));}return null;})['catch'](handleError(_0x15ab5b,null));};exports[_0xdeca('0x58')]=function(_0x5abfce,_0x57a8d3,_0x5c1c4d){var _0x354291={'name':path[_0xdeca('0x59')](_0x5abfce[_0xdeca('0x5a')]['originalname'],path['extname'](_0x5abfce['file'][_0xdeca('0x5b')])),'save_name':path['basename'](_0x5abfce[_0xdeca('0x5a')][_0xdeca('0x5c')],path[_0xdeca('0x5d')](_0x5abfce[_0xdeca('0x5a')][_0xdeca('0x5c')])),'original_format':path[_0xdeca('0x5d')](_0x5abfce[_0xdeca('0x5a')][_0xdeca('0x5b')])[_0xdeca('0x5e')](0x1),'converted_format':_0xdeca('0x5f')};var _0x2d889f=path[_0xdeca('0x4f')](config[_0xdeca('0x50')],_0xdeca('0x60'),_0x5abfce[_0xdeca('0x5a')]['filename']);var _0x242033=path['join'](config[_0xdeca('0x50')],_0xdeca('0x51'),util[_0xdeca('0x56')](_0xdeca('0x61'),path['basename'](_0x5abfce[_0xdeca('0x5a')]['filename'],path[_0xdeca('0x5d')](_0x5abfce['file']['filename'])),_0x354291[_0xdeca('0x52')]));logger[_0xdeca('0x62')](_0xdeca('0x63'),_0x2d889f);logger[_0xdeca('0x62')]('Sound\x20upload\x20destination:\x20%s',_0x242033);try{fs[_0xdeca('0x64')](_0x2d889f,parseInt('0777',0x8));var _0x52b1fe=sox[_0xdeca('0x65')](_0x2d889f,_0x242033,{'sampleRate':0x1f40,'format':_0xdeca('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x52b1fe['on']('error',function(_0x5cb02c){fs['unlinkSync'](_0x2d889f);_0x57a8d3[_0xdeca('0x1d')](0x1f4)[_0xdeca('0x2c')](_0x5cb02c);});_0x52b1fe['on'](_0xdeca('0x66'),function(_0x172f49){_0x354291[_0xdeca('0x67')]=isNaN(_0x172f49['duration'])?null:_0x172f49[_0xdeca('0x68')]*0x3e8;_0x354291[_0xdeca('0x69')]=isNaN(_0x172f49[_0xdeca('0x6a')])?null:_0x172f49[_0xdeca('0x6a')];_0x354291[_0xdeca('0x6b')]=isNaN(_0x172f49[_0xdeca('0x6c')])?null:_0x172f49[_0xdeca('0x6c')];_0x354291[_0xdeca('0x6d')]=isNaN(_0x172f49[_0xdeca('0x6e')])?null:_0x172f49[_0xdeca('0x6e')];_0x354291[_0xdeca('0x6f')]=isNaN(_0x172f49[_0xdeca('0x70')])?null:_0x172f49[_0xdeca('0x70')];});_0x52b1fe['on']('dest',function(_0x19040f){_0x354291[_0xdeca('0x71')]=isNaN(_0x19040f[_0xdeca('0x68')])?null:_0x19040f['duration']*0x3e8;_0x354291[_0xdeca('0x72')]=isNaN(_0x19040f[_0xdeca('0x6a')])?null:_0x19040f['sampleCount'];_0x354291['converted_channelCount']=isNaN(_0x19040f[_0xdeca('0x6c')])?null:_0x19040f[_0xdeca('0x6c')];_0x354291[_0xdeca('0x73')]=isNaN(_0x19040f[_0xdeca('0x6e')])?null:_0x19040f[_0xdeca('0x6e')];_0x354291[_0xdeca('0x74')]=isNaN(_0x19040f[_0xdeca('0x70')])?null:_0x19040f[_0xdeca('0x70')];});_0x52b1fe['on']('end',function(){fs[_0xdeca('0x64')](_0x242033,parseInt(_0xdeca('0x75'),0x8));return db[_0xdeca('0x2e')][_0xdeca('0x58')](_0x354291)['then'](function(_0x4b5f6e){var _0x14b4f5={'role':_0x5abfce[_0xdeca('0x76')][_0xdeca('0x77')],'userProfileId':_0x5abfce[_0xdeca('0x76')][_0xdeca('0x78')]};if(!_0x14b4f5)throw new Error(_0xdeca('0x79'));if(_0x14b4f5[_0xdeca('0x77')]==='user'){var _0x4e9075=_0x4b5f6e[_0xdeca('0x7a')]({'plain':!![]});return db[_0xdeca('0x7b')][_0xdeca('0x4d')]({'where':{'name':'Sounds','userProfileId':_0x14b4f5[_0xdeca('0x78')]},'raw':!![]})[_0xdeca('0x26')](function(_0xb5db5c){if(_0xb5db5c&&_0xb5db5c['autoAssociation']===0x0){return db[_0xdeca('0x29')][_0xdeca('0x58')]({'name':_0x4e9075[_0xdeca('0x2b')],'resourceId':_0x4e9075['id'],'type':_0xb5db5c['name'],'sectionId':_0xb5db5c['id']},{})[_0xdeca('0x26')](function(){return _0x4b5f6e;});}else{return _0x4b5f6e;}})[_0xdeca('0x47')](function(_0x1880b1){logger[_0xdeca('0x7c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1880b1);throw _0x1880b1;});}return _0x4b5f6e;})['then'](respondWithResult(_0x57a8d3,null))[_0xdeca('0x47')](handleError(_0x57a8d3,null));});_0x52b1fe[_0xdeca('0x7d')]();}catch(_0x12108a){_0x57a8d3[_0xdeca('0x1d')](0x1f4)[_0xdeca('0x2c')](_0x12108a);}};exports[_0xdeca('0x25')]=function(_0x5d03eb,_0x47865b,_0x39af76){return db[_0xdeca('0x2e')][_0xdeca('0x4d')]({'where':{'id':_0x5d03eb['params']['id']}})['then'](handleEntityNotFound(_0x47865b,null))[_0xdeca('0x26')](saveUpdates(_[_0xdeca('0x3f')](_0x5d03eb[_0xdeca('0x76')],[_0xdeca('0x2b'),_0xdeca('0x7e')]),null))[_0xdeca('0x26')](respondWithResult(_0x47865b,null))[_0xdeca('0x47')](handleError(_0x47865b,null));};exports[_0xdeca('0x7f')]=function(_0x11d811,_0x346356,_0x59282c){return db[_0xdeca('0x2e')][_0xdeca('0x4d')]({'where':{'id':_0x11d811['params']['id']}})[_0xdeca('0x26')](function(_0x2df8fd){if(_0x2df8fd){return _0x2df8fd['destroy']();}})[_0xdeca('0x26')](function(_0x2a0920){var _0x224221=path[_0xdeca('0x4f')](config[_0xdeca('0x50')],'server/files/sounds/original',util[_0xdeca('0x56')](_0xdeca('0x61'),_0x2a0920['save_name'],_0x2a0920['original_format']));var _0x48ecd3=path[_0xdeca('0x4f')](config['root'],_0xdeca('0x51'),util[_0xdeca('0x56')]('%s.%s',_0x2a0920['save_name'],_0x2a0920[_0xdeca('0x52')]));fs['unlinkSync'](_0x224221);fs[_0xdeca('0x80')](_0x48ecd3);return _0x2a0920;})[_0xdeca('0x26')](function(_0x2d6304){if(_0x2d6304){return _0x346356['status'](0xcc)[_0xdeca('0x1e')]();}})['then'](handleEntityNotFound(_0x346356,null))['catch'](handleError(_0x346356,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index df8b0da..795ef16 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 _0xe358=['bluebird','request-promise','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment'];(function(_0x3c6cd5,_0x46bbfd){var _0x3b46d8=function(_0x30772e){while(--_0x30772e){_0x3c6cd5['push'](_0x3c6cd5['shift']());}};_0x3b46d8(++_0x46bbfd);}(_0xe358,0xcb));var _0x8e35=function(_0x8261bb,_0x48e718){_0x8261bb=_0x8261bb-0x0;var _0x530867=_0xe358[_0x8261bb];return _0x530867;};'use strict';var _=require(_0x8e35('0x0'));var util=require(_0x8e35('0x1'));var logger=require(_0x8e35('0x2'))(_0x8e35('0x3'));var moment=require(_0x8e35('0x4'));var BPromise=require(_0x8e35('0x5'));var rp=require(_0x8e35('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e35('0x7'));var attributes=require(_0x8e35('0x8'));module[_0x8e35('0x9')]=function(_0x2e85f1,_0x1f526c){return _0x2e85f1[_0x8e35('0xa')](_0x8e35('0xb'),attributes,{'tableName':_0x8e35('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8868=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8868,0x174));var _0x8886=function(_0x9c79ac,_0x258be5){_0x9c79ac=_0x9c79ac-0x0;var _0x22351d=_0x8868[_0x9c79ac];return _0x22351d;};'use strict';var _=require(_0x8886('0x0'));var util=require('util');var logger=require(_0x8886('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8886('0x2'));var rp=require(_0x8886('0x3'));var fs=require('fs');var path=require(_0x8886('0x4'));var rimraf=require(_0x8886('0x5'));var config=require(_0x8886('0x6'));var attributes=require(_0x8886('0x7'));module[_0x8886('0x8')]=function(_0x1744d0,_0x57e36a){return _0x1744d0[_0x8886('0x9')](_0x8886('0xa'),attributes,{'tableName':_0x8886('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 1e0004d..6f30d60 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 _0x2916=['error','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','find','options','where','attributes','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify'];(function(_0xf3b8c4,_0x54fea8){var _0x1d8f01=function(_0x375616){while(--_0x375616){_0xf3b8c4['push'](_0xf3b8c4['shift']());}};_0x1d8f01(++_0x54fea8);}(_0x2916,0x81));var _0x6291=function(_0x1c29b3,_0x442dd4){_0x1c29b3=_0x1c29b3-0x0;var _0x6485da=_0x2916[_0x1c29b3];return _0x6485da;};'use strict';var _=require(_0x6291('0x0'));var util=require(_0x6291('0x1'));var moment=require(_0x6291('0x2'));var BPromise=require(_0x6291('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6291('0x4'));var db=require(_0x6291('0x5'))['db'];var utils=require(_0x6291('0x6'));var logger=require('../../config/logger')(_0x6291('0x7'));var config=require('../../config/environment');var jayson=require(_0x6291('0x8'));var client=jayson[_0x6291('0x9')][_0x6291('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cc769,_0x2c8dcd,_0x40c011){return new BPromise(function(_0x53f5f9,_0x1a055a){return client[_0x6291('0xb')](_0x4cc769,_0x40c011)[_0x6291('0xc')](function(_0x5d5509){logger[_0x6291('0xd')]('Sound,\x20%s,\x20%s',_0x2c8dcd,_0x6291('0xe'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x2c8dcd,'request\x20sent',JSON[_0x6291('0xf')](_0x5d5509));if(_0x5d5509[_0x6291('0x10')]){if(_0x5d5509[_0x6291('0x10')]['code']===0x1f4){logger[_0x6291('0x10')](_0x6291('0x11'),_0x2c8dcd,_0x5d5509[_0x6291('0x10')]['message']);return _0x1a055a(_0x5d5509[_0x6291('0x10')][_0x6291('0x12')]);}logger[_0x6291('0x10')]('Sound,\x20%s,\x20%s',_0x2c8dcd,_0x5d5509[_0x6291('0x10')][_0x6291('0x12')]);return _0x53f5f9(_0x5d5509[_0x6291('0x10')][_0x6291('0x12')]);}else{logger['info'](_0x6291('0x11'),_0x2c8dcd,_0x6291('0xe'));_0x53f5f9(_0x5d5509[_0x6291('0x13')]['message']);}})[_0x6291('0x14')](function(_0xe9691c){logger['error'](_0x6291('0x11'),_0x2c8dcd,_0xe9691c);_0x1a055a(_0xe9691c);});});}exports[_0x6291('0x15')]=function(_0x40bb5e){var _0x5d0bcf=this;return new Promise(function(_0x508ec5,_0x2928e7){return db['Sound'][_0x6291('0x16')]({'raw':_0x40bb5e[_0x6291('0x17')]?_0x40bb5e[_0x6291('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x40bb5e[_0x6291('0x17')]?_0x40bb5e[_0x6291('0x17')][_0x6291('0x18')]||null:null,'attributes':_0x40bb5e[_0x6291('0x17')]?_0x40bb5e[_0x6291('0x17')][_0x6291('0x19')]||null:null,'include':_0x40bb5e[_0x6291('0x17')]?_0x40bb5e[_0x6291('0x17')][_0x6291('0x1a')]?_['map'](_0x40bb5e['options'][_0x6291('0x1a')],function(_0x1d6781){return{'model':db[_0x1d6781[_0x6291('0x1b')]],'as':_0x1d6781['as'],'attributes':_0x1d6781['attributes'],'include':_0x1d6781[_0x6291('0x1a')]?_[_0x6291('0x1c')](_0x1d6781[_0x6291('0x1a')],function(_0x245116){return{'model':db[_0x245116[_0x6291('0x1b')]],'as':_0x245116['as'],'attributes':_0x245116['attributes'],'include':_0x245116[_0x6291('0x1a')]?_[_0x6291('0x1c')](_0x245116['include'],function(_0x31f6ff){return{'model':db[_0x31f6ff[_0x6291('0x1b')]],'as':_0x31f6ff['as'],'attributes':_0x31f6ff[_0x6291('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4098){logger['info'](_0x6291('0x15'),_0x40bb5e);logger['debug']('ShowSound',_0x40bb5e,JSON['stringify'](_0x4f4098));_0x508ec5(_0x4f4098);})[_0x6291('0x14')](function(_0x3d5a71){logger[_0x6291('0x10')](_0x6291('0x15'),_0x3d5a71[_0x6291('0x12')],_0x40bb5e);_0x2928e7(_0x5d0bcf[_0x6291('0x10')](0x1f4,_0x3d5a71[_0x6291('0x12')]));});});}; \ No newline at end of file +var _0x4194=['message','result','catch','ShowSound','Sound','find','options','where','attributes','include','model','map','then','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','Sound,\x20%s,\x20%s'];(function(_0x2a09e8,_0x26113a){var _0x26a215=function(_0x296a31){while(--_0x296a31){_0x2a09e8['push'](_0x2a09e8['shift']());}};_0x26a215(++_0x26113a);}(_0x4194,0x1c0));var _0x4419=function(_0x43cf8f,_0x1c436c){_0x43cf8f=_0x43cf8f-0x0;var _0x928a69=_0x4194[_0x43cf8f];return _0x928a69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4419('0x0'));var BPromise=require('bluebird');var rs=require(_0x4419('0x1'));var fs=require('fs');var Redis=require(_0x4419('0x2'));var db=require(_0x4419('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4419('0x4'))('rpc');var config=require(_0x4419('0x5'));var jayson=require(_0x4419('0x6'));var client=jayson[_0x4419('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a7ded,_0x53be1e,_0x43b9f9){return new BPromise(function(_0x4e9e1f,_0x14645a){return client[_0x4419('0x8')](_0x1a7ded,_0x43b9f9)['then'](function(_0x398f2c){logger[_0x4419('0x9')]('Sound,\x20%s,\x20%s',_0x53be1e,_0x4419('0xa'));logger[_0x4419('0xb')]('Sound,\x20%s,\x20%s,\x20%s',_0x53be1e,_0x4419('0xa'),JSON[_0x4419('0xc')](_0x398f2c));if(_0x398f2c[_0x4419('0xd')]){if(_0x398f2c[_0x4419('0xd')][_0x4419('0xe')]===0x1f4){logger[_0x4419('0xd')](_0x4419('0xf'),_0x53be1e,_0x398f2c[_0x4419('0xd')][_0x4419('0x10')]);return _0x14645a(_0x398f2c[_0x4419('0xd')]['message']);}logger[_0x4419('0xd')](_0x4419('0xf'),_0x53be1e,_0x398f2c[_0x4419('0xd')][_0x4419('0x10')]);return _0x4e9e1f(_0x398f2c[_0x4419('0xd')][_0x4419('0x10')]);}else{logger[_0x4419('0x9')](_0x4419('0xf'),_0x53be1e,_0x4419('0xa'));_0x4e9e1f(_0x398f2c[_0x4419('0x11')][_0x4419('0x10')]);}})[_0x4419('0x12')](function(_0x29badb){logger[_0x4419('0xd')](_0x4419('0xf'),_0x53be1e,_0x29badb);_0x14645a(_0x29badb);});});}exports[_0x4419('0x13')]=function(_0x1e7314){var _0x10a15b=this;return new Promise(function(_0x1f4fe2,_0x341ec1){return db[_0x4419('0x14')][_0x4419('0x15')]({'raw':_0x1e7314[_0x4419('0x16')]?_0x1e7314[_0x4419('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1e7314[_0x4419('0x16')]?_0x1e7314['options'][_0x4419('0x17')]||null:null,'attributes':_0x1e7314['options']?_0x1e7314[_0x4419('0x16')][_0x4419('0x18')]||null:null,'include':_0x1e7314['options']?_0x1e7314[_0x4419('0x16')][_0x4419('0x19')]?_['map'](_0x1e7314['options'][_0x4419('0x19')],function(_0x4a6e7f){return{'model':db[_0x4a6e7f[_0x4419('0x1a')]],'as':_0x4a6e7f['as'],'attributes':_0x4a6e7f[_0x4419('0x18')],'include':_0x4a6e7f[_0x4419('0x19')]?_[_0x4419('0x1b')](_0x4a6e7f[_0x4419('0x19')],function(_0x38bc03){return{'model':db[_0x38bc03[_0x4419('0x1a')]],'as':_0x38bc03['as'],'attributes':_0x38bc03[_0x4419('0x18')],'include':_0x38bc03['include']?_[_0x4419('0x1b')](_0x38bc03['include'],function(_0x557db3){return{'model':db[_0x557db3[_0x4419('0x1a')]],'as':_0x557db3['as'],'attributes':_0x557db3['attributes']};}):[]};}):[]};}):[]:[]})[_0x4419('0x1c')](function(_0x58c353){logger[_0x4419('0x9')](_0x4419('0x13'),_0x1e7314);logger[_0x4419('0xb')](_0x4419('0x13'),_0x1e7314,JSON['stringify'](_0x58c353));_0x1f4fe2(_0x58c353);})[_0x4419('0x12')](function(_0xa2c1e4){logger['error'](_0x4419('0x13'),_0xa2c1e4[_0x4419('0x10')],_0x1e7314);_0x341ec1(_0x10a15b[_0x4419('0xd')](0x1f4,_0xa2c1e4[_0x4419('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 810202d..7da3a93 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x59591b,_0x354045){var _0x576642=function(_0x12d1ce){while(--_0x12d1ce){_0x59591b['push'](_0x59591b['shift']());}};_0x576642(++_0x354045);}(_0xda2d,0x102));var _0xdda2=function(_0x3ea78e,_0x4d2f1e){_0x3ea78e=_0x3ea78e-0x0;var _0x3f0153=_0xda2d[_0x3ea78e];return _0x3f0153;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=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(_0xfc48f7,_0x31e67f){var _0x2a07ae=function(_0x58a489){while(--_0x58a489){_0xfc48f7['push'](_0xfc48f7['shift']());}};_0x2a07ae(++_0x31e67f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x398d85,_0x2465d7){_0x398d85=_0x398d85-0x0;var _0x33c2bb=_0x5eb8[_0x398d85];return _0x33c2bb;};'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 fb0eeaf..cde3bb0 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 _0xf7be=['ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x25ede0,_0x29dc39){var _0x16fc37=function(_0x13e4d1){while(--_0x13e4d1){_0x25ede0['push'](_0x25ede0['shift']());}};_0x16fc37(++_0x29dc39);}(_0xf7be,0xa4));var _0xef7b=function(_0x529e40,_0x48d6e6){_0x529e40=_0x529e40-0x0;var _0x22aecb=_0xf7be[_0x529e40];return _0x22aecb;};'use strict';var Sequelize=require(_0xef7b('0x0'));module[_0xef7b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xef7b('0x2')](_0xef7b('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xef7b('0x4')]('in','out'),'defaultValue':_0xef7b('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xef7b('0x6')]},'providerResponse':{'type':Sequelize[_0xef7b('0x2')]}}; \ No newline at end of file +var _0xeba8=['ENUM','out','STRING','TEXT','sequelize','medium'];(function(_0x14e1e1,_0x3ea41a){var _0x394310=function(_0x3959c9){while(--_0x3959c9){_0x14e1e1['push'](_0x14e1e1['shift']());}};_0x394310(++_0x3ea41a);}(_0xeba8,0x196));var _0x8eba=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0xeba8[_0x479509];return _0x382da8;};'use strict';var Sequelize=require(_0x8eba('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x8eba('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0x8eba('0x2')]('in',_0x8eba('0x3')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x8eba('0x4')]},'providerResponse':{'type':Sequelize[_0x8eba('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c9b59ec..0530377 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 _0x74ae=['ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','map','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','SquareMessage','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x5871f9,_0x28ccb7){var _0x8fd1c0=function(_0x510060){while(--_0x510060){_0x5871f9['push'](_0x5871f9['shift']());}};_0x8fd1c0(++_0x28ccb7);}(_0x74ae,0xc5));var _0xe74a=function(_0x5bd953,_0x307788){_0x5bd953=_0x5bd953-0x0;var _0x4ac021=_0x74ae[_0x5bd953];return _0x4ac021;};'use strict';var emlformat=require(_0xe74a('0x0'));var rimraf=require(_0xe74a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe74a('0x2'));var rp=require(_0xe74a('0x3'));var moment=require('moment');var BPromise=require(_0xe74a('0x4'));var Mustache=require(_0xe74a('0x5'));var util=require(_0xe74a('0x6'));var path=require(_0xe74a('0x7'));var sox=require(_0xe74a('0x8'));var csv=require(_0xe74a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe74a('0xa'));var _=require(_0xe74a('0xb'));var squel=require(_0xe74a('0xc'));var crypto=require(_0xe74a('0xd'));var jsforce=require(_0xe74a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe74a('0x9'));var querystring=require(_0xe74a('0xf'));var Papa=require('papaparse');var Redis=require(_0xe74a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe74a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe74a('0x12'));var logger=require('../../config/logger')(_0xe74a('0x13'));var utils=require('../../config/utils');var config=require(_0xe74a('0x14'));var licenseUtil=require(_0xe74a('0x15'));var db=require(_0xe74a('0x16'))['db'];function respondWithStatusCode(_0x4cb157,_0x4dac3f){_0x4dac3f=_0x4dac3f||0xcc;return function(_0x2b793d){if(_0x2b793d){return _0x4cb157[_0xe74a('0x17')](_0x4dac3f);}return _0x4cb157['status'](_0x4dac3f)['end']();};}function respondWithResult(_0x3c1c55,_0x4e7480){_0x4e7480=_0x4e7480||0xc8;return function(_0x4ee3a2){if(_0x4ee3a2){return _0x3c1c55[_0xe74a('0x18')](_0x4e7480)['json'](_0x4ee3a2);}};}function respondWithFilteredResult(_0x4dd5fa,_0x188130){return function(_0x527177){if(_0x527177){var _0x2fe47a=typeof _0x188130['offset']===_0xe74a('0x19')&&typeof _0x188130[_0xe74a('0x1a')]===_0xe74a('0x19');var _0x257281=_0x527177[_0xe74a('0x1b')];var _0x1ba9f=_0x2fe47a?0x0:_0x188130[_0xe74a('0x1c')];var _0x3eabdf=_0x2fe47a?_0x527177[_0xe74a('0x1b')]:_0x188130[_0xe74a('0x1c')]+_0x188130[_0xe74a('0x1a')];var _0x200c33;if(_0x3eabdf>=_0x257281){_0x3eabdf=_0x257281;_0x200c33=0xc8;}else{_0x200c33=0xce;}_0x4dd5fa[_0xe74a('0x18')](_0x200c33);return _0x4dd5fa[_0xe74a('0x1d')](_0xe74a('0x1e'),_0x1ba9f+'-'+_0x3eabdf+'/'+_0x257281)[_0xe74a('0x1f')](_0x527177);}return null;};}function patchUpdates(_0x44939e){return function(_0x337305){try{jsonpatch[_0xe74a('0x20')](_0x337305,_0x44939e,!![]);}catch(_0x2455ec){return BPromise[_0xe74a('0x21')](_0x2455ec);}return _0x337305[_0xe74a('0x22')]();};}function saveUpdates(_0xa09077,_0x5df418){return function(_0x5eec8d){if(_0x5eec8d){return _0x5eec8d[_0xe74a('0x23')](_0xa09077)[_0xe74a('0x24')](function(_0x4be78a){return _0x4be78a;});}return null;};}function removeEntity(_0x5c4703,_0x468352){return function(_0x37126b){if(_0x37126b){return _0x37126b[_0xe74a('0x25')]()['then'](function(){_0x5c4703[_0xe74a('0x18')](0xcc)[_0xe74a('0x26')]();});}};}function handleEntityNotFound(_0x2c997c,_0x34e739){return function(_0x7432d1){if(!_0x7432d1){_0x2c997c[_0xe74a('0x17')](0x194);}return _0x7432d1;};}function handleError(_0x261e69,_0x44e556){_0x44e556=_0x44e556||0x1f4;return function(_0x3124b9){logger[_0xe74a('0x27')](_0x3124b9['stack']);if(_0x3124b9[_0xe74a('0x28')]){delete _0x3124b9[_0xe74a('0x28')];}_0x261e69[_0xe74a('0x18')](_0x44e556)['send'](_0x3124b9);};}exports['index']=function(_0x2aa601,_0x1badd4){var _0x2f6533={},_0x4fa228={},_0x39b069={'count':0x0,'rows':[]};var _0x38d66c=_[_0xe74a('0x29')](db['SquareMessage'][_0xe74a('0x2a')],function(_0x119fe3){return{'name':_0x119fe3[_0xe74a('0x2b')],'type':_0x119fe3[_0xe74a('0x2c')]['key']};});_0x4fa228['model']=_[_0xe74a('0x29')](_0x38d66c,'name');_0x4fa228[_0xe74a('0x2d')]=_[_0xe74a('0x2e')](_0x2aa601[_0xe74a('0x2d')]);_0x4fa228['filters']=_[_0xe74a('0x2f')](_0x4fa228[_0xe74a('0x30')],_0x4fa228[_0xe74a('0x2d')]);_0x2f6533['attributes']=_[_0xe74a('0x2f')](_0x4fa228[_0xe74a('0x30')],qs[_0xe74a('0x31')](_0x2aa601[_0xe74a('0x2d')][_0xe74a('0x31')]));_0x2f6533[_0xe74a('0x32')]=_0x2f6533[_0xe74a('0x32')][_0xe74a('0x33')]?_0x2f6533[_0xe74a('0x32')]:_0x4fa228[_0xe74a('0x30')];if(!_0x2aa601[_0xe74a('0x2d')][_0xe74a('0x34')](_0xe74a('0x35'))){_0x2f6533[_0xe74a('0x1a')]=qs['limit'](_0x2aa601[_0xe74a('0x2d')][_0xe74a('0x1a')]);_0x2f6533['offset']=qs[_0xe74a('0x1c')](_0x2aa601[_0xe74a('0x2d')]['offset']);}_0x2f6533[_0xe74a('0x36')]=qs['sort'](_0x2aa601[_0xe74a('0x2d')][_0xe74a('0x37')]);_0x2f6533[_0xe74a('0x38')]=qs[_0xe74a('0x39')](_['pick'](_0x2aa601[_0xe74a('0x2d')],_0x4fa228[_0xe74a('0x39')]),_0x38d66c);if(_0x2aa601[_0xe74a('0x2d')][_0xe74a('0x3a')]){_0x2f6533[_0xe74a('0x38')]=_[_0xe74a('0x3b')](_0x2f6533[_0xe74a('0x38')],{'$or':_[_0xe74a('0x29')](_0x38d66c,function(_0x335ae5){if(_0x335ae5[_0xe74a('0x2c')]!==_0xe74a('0x3c')){var _0x3671a6={};_0x3671a6[_0x335ae5['name']]={'$like':'%'+_0x2aa601[_0xe74a('0x2d')][_0xe74a('0x3a')]+'%'};return _0x3671a6;}})});}_0x2f6533=_[_0xe74a('0x3b')]({},_0x2f6533,_0x2aa601['options']);var _0x6787ca={'where':_0x2f6533['where']};return db[_0xe74a('0x3d')][_0xe74a('0x1b')](_0x6787ca)[_0xe74a('0x24')](function(_0x160c64){_0x39b069['count']=_0x160c64;if(_0x2aa601[_0xe74a('0x2d')]['includeAll']){_0x2f6533['include']=[{'all':!![]}];}return db['SquareMessage'][_0xe74a('0x3e')](_0x2f6533);})[_0xe74a('0x24')](function(_0xa5b751){_0x39b069[_0xe74a('0x3f')]=_0xa5b751;return _0x39b069;})['then'](respondWithFilteredResult(_0x1badd4,_0x2f6533))[_0xe74a('0x40')](handleError(_0x1badd4,null));};exports[_0xe74a('0x41')]=function(_0x47b4dd,_0x356975){var _0x2ad836={'raw':!![],'where':{'id':_0x47b4dd[_0xe74a('0x42')]['id']}},_0x579778={};_0x579778[_0xe74a('0x30')]=_[_0xe74a('0x2e')](db[_0xe74a('0x3d')][_0xe74a('0x2a')]);_0x579778['query']=_[_0xe74a('0x2e')](_0x47b4dd['query']);_0x579778[_0xe74a('0x39')]=_[_0xe74a('0x2f')](_0x579778['model'],_0x579778[_0xe74a('0x2d')]);_0x2ad836[_0xe74a('0x32')]=_['intersection'](_0x579778[_0xe74a('0x30')],qs[_0xe74a('0x31')](_0x47b4dd[_0xe74a('0x2d')][_0xe74a('0x31')]));_0x2ad836[_0xe74a('0x32')]=_0x2ad836['attributes'][_0xe74a('0x33')]?_0x2ad836[_0xe74a('0x32')]:_0x579778[_0xe74a('0x30')];if(_0x47b4dd[_0xe74a('0x2d')]['includeAll']){_0x2ad836[_0xe74a('0x43')]=[{'all':!![]}];}_0x2ad836=_[_0xe74a('0x3b')]({},_0x2ad836,_0x47b4dd['options']);return db[_0xe74a('0x3d')]['find'](_0x2ad836)[_0xe74a('0x24')](handleEntityNotFound(_0x356975,null))['then'](respondWithResult(_0x356975,null))[_0xe74a('0x40')](handleError(_0x356975,null));};exports[_0xe74a('0x44')]=function(_0x2bed06,_0xe60d73){return db['SquareMessage']['create'](_0x2bed06[_0xe74a('0x45')],{})[_0xe74a('0x24')](respondWithResult(_0xe60d73,0xc9))['catch'](handleError(_0xe60d73,null));};exports[_0xe74a('0x23')]=function(_0x400bb9,_0x890360){if(_0x400bb9[_0xe74a('0x45')]['id']){delete _0x400bb9[_0xe74a('0x45')]['id'];}return db['SquareMessage'][_0xe74a('0x46')]({'where':{'id':_0x400bb9['params']['id']}})[_0xe74a('0x24')](handleEntityNotFound(_0x890360,null))[_0xe74a('0x24')](saveUpdates(_0x400bb9['body'],null))[_0xe74a('0x24')](respondWithResult(_0x890360,null))[_0xe74a('0x40')](handleError(_0x890360,null));};exports[_0xe74a('0x25')]=function(_0xdf195b,_0x44c6b2){return db['SquareMessage'][_0xe74a('0x46')]({'where':{'id':_0xdf195b[_0xe74a('0x42')]['id']}})[_0xe74a('0x24')](handleEntityNotFound(_0x44c6b2,null))[_0xe74a('0x24')](removeEntity(_0x44c6b2,null))[_0xe74a('0x40')](handleError(_0x44c6b2,null));}; \ No newline at end of file +var _0x66ce=['params','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x66ce,0x96));var _0xe66c=function(_0x2aacba,_0x46b6f0){_0x2aacba=_0x2aacba-0x0;var _0x3e2814=_0x66ce[_0x2aacba];return _0x3e2814;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe66c('0x0'));var zipdir=require(_0xe66c('0x1'));var jsonpatch=require(_0xe66c('0x2'));var rp=require('request-promise');var moment=require(_0xe66c('0x3'));var BPromise=require(_0xe66c('0x4'));var Mustache=require('mustache');var util=require(_0xe66c('0x5'));var path=require(_0xe66c('0x6'));var sox=require(_0xe66c('0x7'));var csv=require(_0xe66c('0x8'));var ejs=require(_0xe66c('0x9'));var fs=require('fs');var fs_extra=require(_0xe66c('0xa'));var _=require(_0xe66c('0xb'));var squel=require(_0xe66c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe66c('0xd'));var toCsv=require(_0xe66c('0x8'));var querystring=require(_0xe66c('0xe'));var Papa=require(_0xe66c('0xf'));var Redis=require('ioredis');var authService=require(_0xe66c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe66c('0x11'));var logger=require(_0xe66c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe66c('0x13'));var licenseUtil=require(_0xe66c('0x14'));var db=require(_0xe66c('0x15'))['db'];function respondWithStatusCode(_0x5d40ca,_0x1cb726){_0x1cb726=_0x1cb726||0xcc;return function(_0x3a2113){if(_0x3a2113){return _0x5d40ca[_0xe66c('0x16')](_0x1cb726);}return _0x5d40ca[_0xe66c('0x17')](_0x1cb726)[_0xe66c('0x18')]();};}function respondWithResult(_0x280669,_0x51bc64){_0x51bc64=_0x51bc64||0xc8;return function(_0x351649){if(_0x351649){return _0x280669[_0xe66c('0x17')](_0x51bc64)[_0xe66c('0x19')](_0x351649);}};}function respondWithFilteredResult(_0x4e0b08,_0x14d9a3){return function(_0x35b169){if(_0x35b169){var _0x3fbf45=typeof _0x14d9a3[_0xe66c('0x1a')]===_0xe66c('0x1b')&&typeof _0x14d9a3['limit']===_0xe66c('0x1b');var _0x3b274b=_0x35b169[_0xe66c('0x1c')];var _0x577e6e=_0x3fbf45?0x0:_0x14d9a3[_0xe66c('0x1a')];var _0x5dfaab=_0x3fbf45?_0x35b169['count']:_0x14d9a3[_0xe66c('0x1a')]+_0x14d9a3[_0xe66c('0x1d')];var _0x2d81ea;if(_0x5dfaab>=_0x3b274b){_0x5dfaab=_0x3b274b;_0x2d81ea=0xc8;}else{_0x2d81ea=0xce;}_0x4e0b08['status'](_0x2d81ea);return _0x4e0b08[_0xe66c('0x1e')](_0xe66c('0x1f'),_0x577e6e+'-'+_0x5dfaab+'/'+_0x3b274b)['json'](_0x35b169);}return null;};}function patchUpdates(_0x343762){return function(_0x335dcb){try{jsonpatch[_0xe66c('0x20')](_0x335dcb,_0x343762,!![]);}catch(_0x1babaa){return BPromise[_0xe66c('0x21')](_0x1babaa);}return _0x335dcb[_0xe66c('0x22')]();};}function saveUpdates(_0x48c54d,_0x59634e){return function(_0x29bbe8){if(_0x29bbe8){return _0x29bbe8[_0xe66c('0x23')](_0x48c54d)['then'](function(_0x1b2603){return _0x1b2603;});}return null;};}function removeEntity(_0x150e18,_0x1e0f23){return function(_0x253060){if(_0x253060){return _0x253060['destroy']()[_0xe66c('0x24')](function(){_0x150e18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4452f4,_0x2ee35c){return function(_0x165474){if(!_0x165474){_0x4452f4[_0xe66c('0x16')](0x194);}return _0x165474;};}function handleError(_0x59cb0f,_0x2342bb){_0x2342bb=_0x2342bb||0x1f4;return function(_0x170d21){logger['error'](_0x170d21[_0xe66c('0x25')]);if(_0x170d21['name']){delete _0x170d21[_0xe66c('0x26')];}_0x59cb0f[_0xe66c('0x17')](_0x2342bb)[_0xe66c('0x27')](_0x170d21);};}exports['index']=function(_0x22122d,_0x1f1199){var _0x5cffe2={},_0x3927ba={},_0x4c5c4b={'count':0x0,'rows':[]};var _0x57d58a=_[_0xe66c('0x28')](db[_0xe66c('0x29')][_0xe66c('0x2a')],function(_0x5555fe){return{'name':_0x5555fe[_0xe66c('0x2b')],'type':_0x5555fe[_0xe66c('0x2c')][_0xe66c('0x2d')]};});_0x3927ba['model']=_[_0xe66c('0x28')](_0x57d58a,_0xe66c('0x26'));_0x3927ba[_0xe66c('0x2e')]=_[_0xe66c('0x2f')](_0x22122d[_0xe66c('0x2e')]);_0x3927ba[_0xe66c('0x30')]=_[_0xe66c('0x31')](_0x3927ba[_0xe66c('0x32')],_0x3927ba['query']);_0x5cffe2[_0xe66c('0x33')]=_[_0xe66c('0x31')](_0x3927ba[_0xe66c('0x32')],qs[_0xe66c('0x34')](_0x22122d[_0xe66c('0x2e')][_0xe66c('0x34')]));_0x5cffe2[_0xe66c('0x33')]=_0x5cffe2['attributes'][_0xe66c('0x35')]?_0x5cffe2['attributes']:_0x3927ba[_0xe66c('0x32')];if(!_0x22122d[_0xe66c('0x2e')][_0xe66c('0x36')]('nolimit')){_0x5cffe2[_0xe66c('0x1d')]=qs['limit'](_0x22122d[_0xe66c('0x2e')][_0xe66c('0x1d')]);_0x5cffe2['offset']=qs[_0xe66c('0x1a')](_0x22122d[_0xe66c('0x2e')]['offset']);}_0x5cffe2[_0xe66c('0x37')]=qs[_0xe66c('0x38')](_0x22122d[_0xe66c('0x2e')][_0xe66c('0x38')]);_0x5cffe2['where']=qs[_0xe66c('0x30')](_[_0xe66c('0x39')](_0x22122d[_0xe66c('0x2e')],_0x3927ba['filters']),_0x57d58a);if(_0x22122d[_0xe66c('0x2e')][_0xe66c('0x3a')]){_0x5cffe2['where']=_[_0xe66c('0x3b')](_0x5cffe2[_0xe66c('0x3c')],{'$or':_[_0xe66c('0x28')](_0x57d58a,function(_0x57566c){if(_0x57566c[_0xe66c('0x2c')]!==_0xe66c('0x3d')){var _0xce972b={};_0xce972b[_0x57566c[_0xe66c('0x26')]]={'$like':'%'+_0x22122d[_0xe66c('0x2e')][_0xe66c('0x3a')]+'%'};return _0xce972b;}})});}_0x5cffe2=_[_0xe66c('0x3b')]({},_0x5cffe2,_0x22122d[_0xe66c('0x3e')]);var _0x451a2e={'where':_0x5cffe2[_0xe66c('0x3c')]};return db[_0xe66c('0x29')]['count'](_0x451a2e)[_0xe66c('0x24')](function(_0x11efa9){_0x4c5c4b[_0xe66c('0x1c')]=_0x11efa9;if(_0x22122d[_0xe66c('0x2e')][_0xe66c('0x3f')]){_0x5cffe2[_0xe66c('0x40')]=[{'all':!![]}];}return db[_0xe66c('0x29')][_0xe66c('0x41')](_0x5cffe2);})[_0xe66c('0x24')](function(_0x551735){_0x4c5c4b[_0xe66c('0x42')]=_0x551735;return _0x4c5c4b;})[_0xe66c('0x24')](respondWithFilteredResult(_0x1f1199,_0x5cffe2))['catch'](handleError(_0x1f1199,null));};exports[_0xe66c('0x43')]=function(_0x1193c8,_0x4ba8c3){var _0x1c0eca={'raw':!![],'where':{'id':_0x1193c8['params']['id']}},_0xb5acd0={};_0xb5acd0['model']=_[_0xe66c('0x2f')](db[_0xe66c('0x29')][_0xe66c('0x2a')]);_0xb5acd0[_0xe66c('0x2e')]=_['keys'](_0x1193c8[_0xe66c('0x2e')]);_0xb5acd0[_0xe66c('0x30')]=_[_0xe66c('0x31')](_0xb5acd0[_0xe66c('0x32')],_0xb5acd0[_0xe66c('0x2e')]);_0x1c0eca[_0xe66c('0x33')]=_[_0xe66c('0x31')](_0xb5acd0[_0xe66c('0x32')],qs[_0xe66c('0x34')](_0x1193c8[_0xe66c('0x2e')][_0xe66c('0x34')]));_0x1c0eca['attributes']=_0x1c0eca[_0xe66c('0x33')]['length']?_0x1c0eca['attributes']:_0xb5acd0[_0xe66c('0x32')];if(_0x1193c8[_0xe66c('0x2e')][_0xe66c('0x3f')]){_0x1c0eca['include']=[{'all':!![]}];}_0x1c0eca=_['merge']({},_0x1c0eca,_0x1193c8['options']);return db['SquareMessage'][_0xe66c('0x44')](_0x1c0eca)[_0xe66c('0x24')](handleEntityNotFound(_0x4ba8c3,null))['then'](respondWithResult(_0x4ba8c3,null))[_0xe66c('0x45')](handleError(_0x4ba8c3,null));};exports[_0xe66c('0x46')]=function(_0x1ab6ad,_0x4d779d){return db[_0xe66c('0x29')][_0xe66c('0x46')](_0x1ab6ad[_0xe66c('0x47')],{})['then'](respondWithResult(_0x4d779d,0xc9))[_0xe66c('0x45')](handleError(_0x4d779d,null));};exports['update']=function(_0x56fb2c,_0xa23c86){if(_0x56fb2c['body']['id']){delete _0x56fb2c[_0xe66c('0x47')]['id'];}return db['SquareMessage'][_0xe66c('0x44')]({'where':{'id':_0x56fb2c[_0xe66c('0x48')]['id']}})[_0xe66c('0x24')](handleEntityNotFound(_0xa23c86,null))[_0xe66c('0x24')](saveUpdates(_0x56fb2c[_0xe66c('0x47')],null))[_0xe66c('0x24')](respondWithResult(_0xa23c86,null))[_0xe66c('0x45')](handleError(_0xa23c86,null));};exports[_0xe66c('0x49')]=function(_0x36365c,_0x12ee86){return db[_0xe66c('0x29')][_0xe66c('0x44')]({'where':{'id':_0x36365c[_0xe66c('0x48')]['id']}})[_0xe66c('0x24')](handleEntityNotFound(_0x12ee86,null))[_0xe66c('0x24')](removeEntity(_0x12ee86,null))[_0xe66c('0x45')](handleError(_0x12ee86,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index bb1cf27..6756293 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 _0x3756=['SquareMessage','square_messages','lodash','../../config/logger','moment','request-promise','path','./squareMessage.attributes','define'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0x3756,0x14f));var _0x6375=function(_0x4affcc,_0xfa2c5b){_0x4affcc=_0x4affcc-0x0;var _0x1776b5=_0x3756[_0x4affcc];return _0x1776b5;};'use strict';var _=require(_0x6375('0x0'));var util=require('util');var logger=require(_0x6375('0x1'))('api');var moment=require(_0x6375('0x2'));var BPromise=require('bluebird');var rp=require(_0x6375('0x3'));var fs=require('fs');var path=require(_0x6375('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6375('0x5'));module['exports']=function(_0x147dd4,_0x1f8832){return _0x147dd4[_0x6375('0x6')](_0x6375('0x7'),attributes,{'tableName':_0x6375('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4f0=['./squareMessage.attributes','SquareMessage','square_messages','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x554f96,_0x2c4b24){var _0x324056=function(_0x33802c){while(--_0x33802c){_0x554f96['push'](_0x554f96['shift']());}};_0x324056(++_0x2c4b24);}(_0xb4f0,0xf3));var _0x0b4f=function(_0x4fa166,_0x58b7fb){_0x4fa166=_0x4fa166-0x0;var _0x5dd974=_0xb4f0[_0x4fa166];return _0x5dd974;};'use strict';var _=require(_0x0b4f('0x0'));var util=require(_0x0b4f('0x1'));var logger=require(_0x0b4f('0x2'))('api');var moment=require(_0x0b4f('0x3'));var BPromise=require(_0x0b4f('0x4'));var rp=require(_0x0b4f('0x5'));var fs=require('fs');var path=require(_0x0b4f('0x6'));var rimraf=require(_0x0b4f('0x7'));var config=require(_0x0b4f('0x8'));var attributes=require(_0x0b4f('0x9'));module['exports']=function(_0x110330,_0x45c420){return _0x110330['define'](_0x0b4f('0xa'),attributes,{'tableName':_0x0b4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index bec146b..4b23b9d 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 _0xdbf1=['stringify','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5bab5e,_0xf263ef){var _0x3f885a=function(_0x1750c6){while(--_0x1750c6){_0x5bab5e['push'](_0x5bab5e['shift']());}};_0x3f885a(++_0xf263ef);}(_0xdbf1,0xed));var _0x1dbf=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xdbf1[_0x342700];return _0x53406f;};'use strict';var _=require(_0x1dbf('0x0'));var util=require(_0x1dbf('0x1'));var moment=require('moment');var BPromise=require(_0x1dbf('0x2'));var rs=require(_0x1dbf('0x3'));var fs=require('fs');var Redis=require(_0x1dbf('0x4'));var db=require(_0x1dbf('0x5'))['db'];var utils=require(_0x1dbf('0x6'));var logger=require('../../config/logger')(_0x1dbf('0x7'));var config=require(_0x1dbf('0x8'));var jayson=require(_0x1dbf('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3bdef1,_0x593a99,_0x680371){return new BPromise(function(_0x149d14,_0x52f56a){return client['request'](_0x3bdef1,_0x680371)[_0x1dbf('0xa')](function(_0x2e67ab){logger['info'](_0x1dbf('0xb'),_0x593a99,_0x1dbf('0xc'));logger[_0x1dbf('0xd')](_0x1dbf('0xe'),_0x593a99,_0x1dbf('0xc'),JSON[_0x1dbf('0xf')](_0x2e67ab));if(_0x2e67ab[_0x1dbf('0x10')]){if(_0x2e67ab[_0x1dbf('0x10')][_0x1dbf('0x11')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x593a99,_0x2e67ab[_0x1dbf('0x10')][_0x1dbf('0x12')]);return _0x52f56a(_0x2e67ab[_0x1dbf('0x10')][_0x1dbf('0x12')]);}logger[_0x1dbf('0x10')](_0x1dbf('0xb'),_0x593a99,_0x2e67ab['error']['message']);return _0x149d14(_0x2e67ab[_0x1dbf('0x10')][_0x1dbf('0x12')]);}else{logger[_0x1dbf('0x13')](_0x1dbf('0xb'),_0x593a99,'request\x20sent');_0x149d14(_0x2e67ab[_0x1dbf('0x14')][_0x1dbf('0x12')]);}})[_0x1dbf('0x15')](function(_0x5bf7e6){logger[_0x1dbf('0x10')](_0x1dbf('0xb'),_0x593a99,_0x5bf7e6);_0x52f56a(_0x5bf7e6);});});}exports[_0x1dbf('0x16')]=function(_0x1e4ffe){var _0x231f18=this;return new Promise(function(_0x2c7aec,_0x462ee5){return db[_0x1dbf('0x17')][_0x1dbf('0x18')](_0x1e4ffe[_0x1dbf('0x19')],{'raw':_0x1e4ffe['options']?_0x1e4ffe[_0x1dbf('0x1a')][_0x1dbf('0x1b')]===undefined?!![]:![]:!![]})[_0x1dbf('0xa')](function(_0x5ffb19){logger[_0x1dbf('0x13')]('CreateSquareMessage',_0x1e4ffe);logger[_0x1dbf('0xd')](_0x1dbf('0x16'),_0x1e4ffe,JSON['stringify'](_0x5ffb19));_0x2c7aec(_0x5ffb19);})[_0x1dbf('0x15')](function(_0x30e7d4){logger[_0x1dbf('0x10')](_0x1dbf('0x16'),_0x30e7d4[_0x1dbf('0x12')],_0x1e4ffe);_0x462ee5(_0x231f18[_0x1dbf('0x10')](0x1f4,_0x30e7d4[_0x1dbf('0x12')]));});});}; \ No newline at end of file +var _0x7126=['then','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','SquareMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSquareMessage','SquareMessage','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2b698c,_0x5bbdd5){var _0x535317=function(_0x2e76c0){while(--_0x2e76c0){_0x2b698c['push'](_0x2b698c['shift']());}};_0x535317(++_0x5bbdd5);}(_0x7126,0x139));var _0x6712=function(_0x119b7b,_0xfb6fef){_0x119b7b=_0x119b7b-0x0;var _0x2ef385=_0x7126[_0x119b7b];return _0x2ef385;};'use strict';var _=require(_0x6712('0x0'));var util=require('util');var moment=require(_0x6712('0x1'));var BPromise=require(_0x6712('0x2'));var rs=require(_0x6712('0x3'));var fs=require('fs');var Redis=require(_0x6712('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6712('0x5'));var logger=require(_0x6712('0x6'))(_0x6712('0x7'));var config=require('../../config/environment');var jayson=require(_0x6712('0x8'));var client=jayson[_0x6712('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58173f,_0x5c2da0,_0x250ff7){return new BPromise(function(_0xf37823,_0x43c108){return client[_0x6712('0xa')](_0x58173f,_0x250ff7)[_0x6712('0xb')](function(_0x1f4d6e){logger[_0x6712('0xc')]('SquareMessage,\x20%s,\x20%s',_0x5c2da0,'request\x20sent');logger[_0x6712('0xd')](_0x6712('0xe'),_0x5c2da0,'request\x20sent',JSON['stringify'](_0x1f4d6e));if(_0x1f4d6e['error']){if(_0x1f4d6e[_0x6712('0xf')]['code']===0x1f4){logger[_0x6712('0xf')](_0x6712('0x10'),_0x5c2da0,_0x1f4d6e[_0x6712('0xf')][_0x6712('0x11')]);return _0x43c108(_0x1f4d6e[_0x6712('0xf')][_0x6712('0x11')]);}logger['error'](_0x6712('0x10'),_0x5c2da0,_0x1f4d6e[_0x6712('0xf')][_0x6712('0x11')]);return _0xf37823(_0x1f4d6e[_0x6712('0xf')][_0x6712('0x11')]);}else{logger['info'](_0x6712('0x10'),_0x5c2da0,_0x6712('0x12'));_0xf37823(_0x1f4d6e[_0x6712('0x13')][_0x6712('0x11')]);}})[_0x6712('0x14')](function(_0x256965){logger[_0x6712('0xf')]('SquareMessage,\x20%s,\x20%s',_0x5c2da0,_0x256965);_0x43c108(_0x256965);});});}exports[_0x6712('0x15')]=function(_0x5d502c){var _0x96f26a=this;return new Promise(function(_0x4bbe67,_0x416cb9){return db[_0x6712('0x16')]['create'](_0x5d502c[_0x6712('0x17')],{'raw':_0x5d502c['options']?_0x5d502c[_0x6712('0x18')][_0x6712('0x19')]===undefined?!![]:![]:!![]})[_0x6712('0xb')](function(_0x3f1c8d){logger[_0x6712('0xc')](_0x6712('0x15'),_0x5d502c);logger[_0x6712('0xd')](_0x6712('0x15'),_0x5d502c,JSON[_0x6712('0x1a')](_0x3f1c8d));_0x4bbe67(_0x3f1c8d);})['catch'](function(_0x2bf31a){logger['error'](_0x6712('0x15'),_0x2bf31a[_0x6712('0x11')],_0x5d502c);_0x416cb9(_0x96f26a[_0x6712('0xf')](0x1f4,_0x2bf31a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 5079ad3..d44a500 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 _0x30eb=['fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','/:id/test','15s','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x2eb6d0,_0x4880f1){var _0x43c041=function(_0x10fa5d){while(--_0x10fa5d){_0x2eb6d0['push'](_0x2eb6d0['shift']());}};_0x43c041(++_0x4880f1);}(_0x30eb,0x7f));var _0xb30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30eb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xb30e('0x0'));var path=require(_0xb30e('0x1'));var timeout=require(_0xb30e('0x2'));var express=require(_0xb30e('0x3'));var router=express[_0xb30e('0x4')]();var fs_extra=require(_0xb30e('0x5'));var auth=require(_0xb30e('0x6'));var interaction=require(_0xb30e('0x7'));var config=require('../../config/environment');var controller=require(_0xb30e('0x8'));router['get']('/',auth[_0xb30e('0x9')](),controller[_0xb30e('0xa')]);router[_0xb30e('0xb')](_0xb30e('0xc'),auth[_0xb30e('0x9')](),controller[_0xb30e('0xd')]);router[_0xb30e('0xb')](_0xb30e('0xe'),auth['isAuthenticated'](),timeout(_0xb30e('0xf')),controller['test']);router[_0xb30e('0x10')]('/',auth[_0xb30e('0x9')](),controller['create']);router[_0xb30e('0x11')](_0xb30e('0xc'),auth[_0xb30e('0x9')](),controller[_0xb30e('0x12')]);router[_0xb30e('0x13')]('/:id',auth[_0xb30e('0x9')](),controller[_0xb30e('0x14')]);module[_0xb30e('0x15')]=router; \ No newline at end of file +var _0xdc00=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create','put','delete','destroy','exports','multer','util'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xdc00,0x76));var _0x0dc0=function(_0x342e46,_0x228c84){_0x342e46=_0x342e46-0x0;var _0x38f4e6=_0xdc00[_0x342e46];return _0x38f4e6;};'use strict';var multer=require(_0x0dc0('0x0'));var util=require(_0x0dc0('0x1'));var path=require(_0x0dc0('0x2'));var timeout=require(_0x0dc0('0x3'));var express=require(_0x0dc0('0x4'));var router=express[_0x0dc0('0x5')]();var fs_extra=require(_0x0dc0('0x6'));var auth=require(_0x0dc0('0x7'));var interaction=require(_0x0dc0('0x8'));var config=require(_0x0dc0('0x9'));var controller=require(_0x0dc0('0xa'));router[_0x0dc0('0xb')]('/',auth[_0x0dc0('0xc')](),controller[_0x0dc0('0xd')]);router['get'](_0x0dc0('0xe'),auth[_0x0dc0('0xc')](),controller[_0x0dc0('0xf')]);router[_0x0dc0('0xb')]('/:id/test',auth[_0x0dc0('0xc')](),timeout(_0x0dc0('0x10')),controller[_0x0dc0('0x11')]);router[_0x0dc0('0x12')]('/',auth[_0x0dc0('0xc')](),controller[_0x0dc0('0x13')]);router[_0x0dc0('0x14')](_0x0dc0('0xe'),auth[_0x0dc0('0xc')](),controller['update']);router[_0x0dc0('0x15')]('/:id',auth[_0x0dc0('0xc')](),controller[_0x0dc0('0x16')]);module[_0x0dc0('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e6b076a..d3390b1 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 _0x97ee=['exports','STRING','name'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0x97ee,0x198));var _0xe97e=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x97ee[_0x4ce028];return _0x583d0c;};'use strict';var Sequelize=require('sequelize');module[_0xe97e('0x0')]={'name':{'type':Sequelize[_0xe97e('0x1')],'unique':_0xe97e('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe97e('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe30a=['exports','STRING','name','sequelize'];(function(_0x2c3e87,_0x2fe07b){var _0x1f7070=function(_0x1e1736){while(--_0x1e1736){_0x2c3e87['push'](_0x2c3e87['shift']());}};_0x1f7070(++_0x2fe07b);}(_0xe30a,0x1af));var _0xae30=function(_0x5975f2,_0x1f8a8c){_0x5975f2=_0x5975f2-0x0;var _0x5cc65f=_0xe30a[_0x5975f2];return _0x5cc65f;};'use strict';var Sequelize=require(_0xae30('0x0'));module[_0xae30('0x1')]={'name':{'type':Sequelize[_0xae30('0x2')],'unique':_0xae30('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xae30('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 102c714..1bdb6e1 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 _0xd710=['show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','name','send','map','SquareOdbc','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x253daf,_0x6fe93b){var _0x2932ae=function(_0x4488b5){while(--_0x4488b5){_0x253daf['push'](_0x253daf['shift']());}};_0x2932ae(++_0x6fe93b);}(_0xd710,0x171));var _0x0d71=function(_0x1cbd2e,_0x1af575){_0x1cbd2e=_0x1cbd2e-0x0;var _0x36aa24=_0xd710[_0x1cbd2e];return _0x36aa24;};'use strict';var emlformat=require(_0x0d71('0x0'));var rimraf=require(_0x0d71('0x1'));var zipdir=require(_0x0d71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d71('0x3'));var moment=require(_0x0d71('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0d71('0x5'));var util=require(_0x0d71('0x6'));var path=require(_0x0d71('0x7'));var sox=require(_0x0d71('0x8'));var csv=require(_0x0d71('0x9'));var ejs=require(_0x0d71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d71('0xb'));var squel=require(_0x0d71('0xc'));var crypto=require(_0x0d71('0xd'));var jsforce=require(_0x0d71('0xe'));var deskjs=require(_0x0d71('0xf'));var toCsv=require(_0x0d71('0x9'));var querystring=require(_0x0d71('0x10'));var Papa=require(_0x0d71('0x11'));var Redis=require('ioredis');var authService=require(_0x0d71('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0d71('0x13'));var hardwareService=require(_0x0d71('0x14'));var logger=require(_0x0d71('0x15'))(_0x0d71('0x16'));var utils=require('../../config/utils');var config=require(_0x0d71('0x17'));var licenseUtil=require(_0x0d71('0x18'));var db=require(_0x0d71('0x19'))['db'];function respondWithStatusCode(_0x249697,_0x2e768e){_0x2e768e=_0x2e768e||0xcc;return function(_0x1507bd){if(_0x1507bd){return _0x249697[_0x0d71('0x1a')](_0x2e768e);}return _0x249697['status'](_0x2e768e)[_0x0d71('0x1b')]();};}function respondWithResult(_0xd07a7d,_0x1b9ef6){_0x1b9ef6=_0x1b9ef6||0xc8;return function(_0x2211b7){if(_0x2211b7){return _0xd07a7d[_0x0d71('0x1c')](_0x1b9ef6)['json'](_0x2211b7);}};}function respondWithFilteredResult(_0x54e1fc,_0x31577b){return function(_0x7ea392){if(_0x7ea392){var _0x453cec=typeof _0x31577b[_0x0d71('0x1d')]===_0x0d71('0x1e')&&typeof _0x31577b[_0x0d71('0x1f')]==='undefined';var _0x5af129=_0x7ea392[_0x0d71('0x20')];var _0x5a2b6a=_0x453cec?0x0:_0x31577b[_0x0d71('0x1d')];var _0x1774aa=_0x453cec?_0x7ea392[_0x0d71('0x20')]:_0x31577b[_0x0d71('0x1d')]+_0x31577b[_0x0d71('0x1f')];var _0x1c836e;if(_0x1774aa>=_0x5af129){_0x1774aa=_0x5af129;_0x1c836e=0xc8;}else{_0x1c836e=0xce;}_0x54e1fc[_0x0d71('0x1c')](_0x1c836e);return _0x54e1fc[_0x0d71('0x21')]('Content-Range',_0x5a2b6a+'-'+_0x1774aa+'/'+_0x5af129)[_0x0d71('0x22')](_0x7ea392);}return null;};}function patchUpdates(_0x10282a){return function(_0x1da922){try{jsonpatch[_0x0d71('0x23')](_0x1da922,_0x10282a,!![]);}catch(_0x1c7c60){return BPromise[_0x0d71('0x24')](_0x1c7c60);}return _0x1da922[_0x0d71('0x25')]();};}function saveUpdates(_0x49429d,_0x431a70){return function(_0x2a84ee){if(_0x2a84ee){return _0x2a84ee[_0x0d71('0x26')](_0x49429d)[_0x0d71('0x27')](function(_0x4507a3){return _0x4507a3;});}return null;};}function removeEntity(_0x9c7ad5,_0xdb9169){return function(_0x425648){if(_0x425648){return _0x425648[_0x0d71('0x28')]()[_0x0d71('0x27')](function(){var _0x44ca5b=_0x425648[_0x0d71('0x29')]({'plain':!![]});var _0x5bfc1c=_0x0d71('0x2a');return db[_0x0d71('0x2b')][_0x0d71('0x28')]({'where':{'type':_0x5bfc1c,'resourceId':_0x44ca5b['id']}})[_0x0d71('0x27')](function(){return _0x425648;});})[_0x0d71('0x27')](function(){_0x9c7ad5[_0x0d71('0x1c')](0xcc)[_0x0d71('0x1b')]();});}};}function handleEntityNotFound(_0x5f5d7d,_0x5c88a8){return function(_0xb90812){if(!_0xb90812){_0x5f5d7d[_0x0d71('0x1a')](0x194);}return _0xb90812;};}function handleError(_0x3f250b,_0x5ef9b4){_0x5ef9b4=_0x5ef9b4||0x1f4;return function(_0x24bfab){logger['error'](_0x24bfab['stack']);if(_0x24bfab[_0x0d71('0x2c')]){delete _0x24bfab[_0x0d71('0x2c')];}_0x3f250b[_0x0d71('0x1c')](_0x5ef9b4)[_0x0d71('0x2d')](_0x24bfab);};}exports['index']=function(_0x3c9e1a,_0x3d6079){var _0x33881b={},_0x2e2e4c={},_0xbc97f4={'count':0x0,'rows':[]};var _0x5c5c97=_[_0x0d71('0x2e')](db[_0x0d71('0x2f')]['rawAttributes'],function(_0x29dd98){return{'name':_0x29dd98[_0x0d71('0x30')],'type':_0x29dd98[_0x0d71('0x31')][_0x0d71('0x32')]};});_0x2e2e4c[_0x0d71('0x33')]=_[_0x0d71('0x2e')](_0x5c5c97,'name');_0x2e2e4c['query']=_[_0x0d71('0x34')](_0x3c9e1a[_0x0d71('0x35')]);_0x2e2e4c['filters']=_[_0x0d71('0x36')](_0x2e2e4c[_0x0d71('0x33')],_0x2e2e4c[_0x0d71('0x35')]);_0x33881b[_0x0d71('0x37')]=_[_0x0d71('0x36')](_0x2e2e4c[_0x0d71('0x33')],qs[_0x0d71('0x38')](_0x3c9e1a[_0x0d71('0x35')][_0x0d71('0x38')]));_0x33881b[_0x0d71('0x37')]=_0x33881b[_0x0d71('0x37')][_0x0d71('0x39')]?_0x33881b[_0x0d71('0x37')]:_0x2e2e4c[_0x0d71('0x33')];if(!_0x3c9e1a[_0x0d71('0x35')]['hasOwnProperty'](_0x0d71('0x3a'))){_0x33881b[_0x0d71('0x1f')]=qs[_0x0d71('0x1f')](_0x3c9e1a['query']['limit']);_0x33881b['offset']=qs[_0x0d71('0x1d')](_0x3c9e1a[_0x0d71('0x35')][_0x0d71('0x1d')]);}_0x33881b['order']=qs[_0x0d71('0x3b')](_0x3c9e1a['query'][_0x0d71('0x3b')]);_0x33881b[_0x0d71('0x3c')]=qs['filters'](_[_0x0d71('0x3d')](_0x3c9e1a[_0x0d71('0x35')],_0x2e2e4c[_0x0d71('0x3e')]),_0x5c5c97);if(_0x3c9e1a['query'][_0x0d71('0x3f')]){_0x33881b[_0x0d71('0x3c')]=_[_0x0d71('0x40')](_0x33881b[_0x0d71('0x3c')],{'$or':_['map'](_0x5c5c97,function(_0x3768f1){if(_0x3768f1[_0x0d71('0x31')]!==_0x0d71('0x41')){var _0x1a1250={};_0x1a1250[_0x3768f1[_0x0d71('0x2c')]]={'$like':'%'+_0x3c9e1a['query'][_0x0d71('0x3f')]+'%'};return _0x1a1250;}})});}_0x33881b=_[_0x0d71('0x40')]({},_0x33881b,_0x3c9e1a[_0x0d71('0x42')]);var _0x474307={'where':_0x33881b[_0x0d71('0x3c')]};return db[_0x0d71('0x2f')][_0x0d71('0x20')](_0x474307)[_0x0d71('0x27')](function(_0x4af127){_0xbc97f4[_0x0d71('0x20')]=_0x4af127;if(_0x3c9e1a[_0x0d71('0x35')]['includeAll']){_0x33881b[_0x0d71('0x43')]=[{'all':!![]}];}return db[_0x0d71('0x2f')][_0x0d71('0x44')](_0x33881b);})[_0x0d71('0x27')](function(_0x44d17d){_0xbc97f4[_0x0d71('0x45')]=_0x44d17d;return _0xbc97f4;})[_0x0d71('0x27')](respondWithFilteredResult(_0x3d6079,_0x33881b))[_0x0d71('0x46')](handleError(_0x3d6079,null));};exports[_0x0d71('0x47')]=function(_0x3dd476,_0x20424f){var _0x3cf688={'raw':!![],'where':{'id':_0x3dd476[_0x0d71('0x48')]['id']}},_0xbd7ff={};_0xbd7ff[_0x0d71('0x33')]=_[_0x0d71('0x34')](db[_0x0d71('0x2f')][_0x0d71('0x49')]);_0xbd7ff[_0x0d71('0x35')]=_['keys'](_0x3dd476['query']);_0xbd7ff[_0x0d71('0x3e')]=_[_0x0d71('0x36')](_0xbd7ff[_0x0d71('0x33')],_0xbd7ff[_0x0d71('0x35')]);_0x3cf688[_0x0d71('0x37')]=_[_0x0d71('0x36')](_0xbd7ff['model'],qs[_0x0d71('0x38')](_0x3dd476[_0x0d71('0x35')][_0x0d71('0x38')]));_0x3cf688[_0x0d71('0x37')]=_0x3cf688[_0x0d71('0x37')]['length']?_0x3cf688['attributes']:_0xbd7ff[_0x0d71('0x33')];if(_0x3dd476[_0x0d71('0x35')]['includeAll']){_0x3cf688['include']=[{'all':!![]}];}_0x3cf688=_[_0x0d71('0x40')]({},_0x3cf688,_0x3dd476[_0x0d71('0x42')]);return db[_0x0d71('0x2f')][_0x0d71('0x4a')](_0x3cf688)[_0x0d71('0x27')](handleEntityNotFound(_0x20424f,null))[_0x0d71('0x27')](respondWithResult(_0x20424f,null))['catch'](handleError(_0x20424f,null));};exports[_0x0d71('0x4b')]=function(_0x5389b0,_0x40d6a0){return db[_0x0d71('0x2f')][_0x0d71('0x4b')](_0x5389b0[_0x0d71('0x4c')],{})['then'](function(_0x2565bf){var _0x3b130d=_0x5389b0['user'][_0x0d71('0x29')]({'plain':!![]});if(!_0x3b130d)throw new Error(_0x0d71('0x4d'));if(_0x3b130d[_0x0d71('0x4e')]===_0x0d71('0x4f')){var _0x246731=_0x2565bf[_0x0d71('0x29')]({'plain':!![]});var _0x250e6b=_0x0d71('0x2a');return db[_0x0d71('0x50')]['find']({'where':{'name':_0x250e6b,'userProfileId':_0x3b130d['userProfileId']},'raw':!![]})['then'](function(_0x37d107){if(_0x37d107&&_0x37d107[_0x0d71('0x51')]===0x0){return db[_0x0d71('0x2b')][_0x0d71('0x4b')]({'name':_0x246731['name'],'resourceId':_0x246731['id'],'type':_0x37d107[_0x0d71('0x2c')],'sectionId':_0x37d107['id']},{})['then'](function(){return _0x2565bf;});}else{return _0x2565bf;}})[_0x0d71('0x46')](function(_0x7a021d){logger[_0x0d71('0x52')](_0x0d71('0x53'),_0x7a021d);throw _0x7a021d;});}return _0x2565bf;})[_0x0d71('0x27')](respondWithResult(_0x40d6a0,0xc9))[_0x0d71('0x46')](handleError(_0x40d6a0,null));};exports[_0x0d71('0x26')]=function(_0x3245e0,_0x2f1ac7){if(_0x3245e0['body']['id']){delete _0x3245e0[_0x0d71('0x4c')]['id'];}return db['SquareOdbc'][_0x0d71('0x4a')]({'where':{'id':_0x3245e0[_0x0d71('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f1ac7,null))[_0x0d71('0x27')](saveUpdates(_0x3245e0[_0x0d71('0x4c')],null))[_0x0d71('0x27')](respondWithResult(_0x2f1ac7,null))[_0x0d71('0x46')](handleError(_0x2f1ac7,null));};exports[_0x0d71('0x28')]=function(_0x2155dd,_0x40bbec){return db[_0x0d71('0x2f')][_0x0d71('0x4a')]({'where':{'id':_0x2155dd[_0x0d71('0x48')]['id']}})['then'](handleEntityNotFound(_0x40bbec,null))[_0x0d71('0x27')](removeEntity(_0x40bbec,null))['catch'](handleError(_0x40bbec,null));};exports[_0x0d71('0x54')]=function(_0x1a893f,_0x233520,_0x1dc5ad){var _0x163cde;return db[_0x0d71('0x2f')][_0x0d71('0x4a')]({'where':{'id':_0x1a893f[_0x0d71('0x48')]['id']},'attributes':['id',_0x0d71('0x55')]})[_0x0d71('0x27')](handleEntityNotFound(_0x233520,null))[_0x0d71('0x27')](function(_0x523f14){if(_0x523f14){var _0x22f001=require(_0x0d71('0x56'))();_0x22f001['openSync'](_0x523f14['dsn']);_0x22f001[_0x0d71('0x57')]();return _0x523f14;}})[_0x0d71('0x27')](respondWithResult(_0x233520,null))['catch'](handleError(_0x233520,null));}; \ No newline at end of file +var _0xa7b4=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','get','ODBC','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','SquareOdbc','includeAll','findAll','rows','catch','show','params','include','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','find','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir'];(function(_0x17e3c7,_0x1cfc59){var _0x4e0af9=function(_0x19ae5b){while(--_0x19ae5b){_0x17e3c7['push'](_0x17e3c7['shift']());}};_0x4e0af9(++_0x1cfc59);}(_0xa7b4,0x10c));var _0x4a7b=function(_0x2d7484,_0x1b8083){_0x2d7484=_0x2d7484-0x0;var _0x8d13bc=_0xa7b4[_0x2d7484];return _0x8d13bc;};'use strict';var emlformat=require(_0x4a7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a7b('0x1'));var jsonpatch=require(_0x4a7b('0x2'));var rp=require(_0x4a7b('0x3'));var moment=require(_0x4a7b('0x4'));var BPromise=require(_0x4a7b('0x5'));var Mustache=require(_0x4a7b('0x6'));var util=require(_0x4a7b('0x7'));var path=require(_0x4a7b('0x8'));var sox=require(_0x4a7b('0x9'));var csv=require(_0x4a7b('0xa'));var ejs=require(_0x4a7b('0xb'));var fs=require('fs');var fs_extra=require(_0x4a7b('0xc'));var _=require(_0x4a7b('0xd'));var squel=require(_0x4a7b('0xe'));var crypto=require(_0x4a7b('0xf'));var jsforce=require(_0x4a7b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4a7b('0xa'));var querystring=require(_0x4a7b('0x11'));var Papa=require('papaparse');var Redis=require(_0x4a7b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4a7b('0x13'));var as=require(_0x4a7b('0x14'));var hardwareService=require(_0x4a7b('0x15'));var logger=require('../../config/logger')(_0x4a7b('0x16'));var utils=require('../../config/utils');var config=require(_0x4a7b('0x17'));var licenseUtil=require(_0x4a7b('0x18'));var db=require(_0x4a7b('0x19'))['db'];function respondWithStatusCode(_0x529f97,_0x3a2a52){_0x3a2a52=_0x3a2a52||0xcc;return function(_0x4738ba){if(_0x4738ba){return _0x529f97[_0x4a7b('0x1a')](_0x3a2a52);}return _0x529f97[_0x4a7b('0x1b')](_0x3a2a52)['end']();};}function respondWithResult(_0x128753,_0x81a051){_0x81a051=_0x81a051||0xc8;return function(_0x517702){if(_0x517702){return _0x128753[_0x4a7b('0x1b')](_0x81a051)[_0x4a7b('0x1c')](_0x517702);}};}function respondWithFilteredResult(_0x5f3c6e,_0x458831){return function(_0x32d3e6){if(_0x32d3e6){var _0x1928ab=typeof _0x458831[_0x4a7b('0x1d')]==='undefined'&&typeof _0x458831['limit']===_0x4a7b('0x1e');var _0x553a75=_0x32d3e6[_0x4a7b('0x1f')];var _0x5c3d45=_0x1928ab?0x0:_0x458831[_0x4a7b('0x1d')];var _0x5097f7=_0x1928ab?_0x32d3e6[_0x4a7b('0x1f')]:_0x458831[_0x4a7b('0x1d')]+_0x458831[_0x4a7b('0x20')];var _0xc5d5e6;if(_0x5097f7>=_0x553a75){_0x5097f7=_0x553a75;_0xc5d5e6=0xc8;}else{_0xc5d5e6=0xce;}_0x5f3c6e[_0x4a7b('0x1b')](_0xc5d5e6);return _0x5f3c6e[_0x4a7b('0x21')](_0x4a7b('0x22'),_0x5c3d45+'-'+_0x5097f7+'/'+_0x553a75)[_0x4a7b('0x1c')](_0x32d3e6);}return null;};}function patchUpdates(_0x5b233c){return function(_0x2d589c){try{jsonpatch['apply'](_0x2d589c,_0x5b233c,!![]);}catch(_0x3f70ee){return BPromise[_0x4a7b('0x23')](_0x3f70ee);}return _0x2d589c['save']();};}function saveUpdates(_0x6ce7bc,_0x523a69){return function(_0x626ec3){if(_0x626ec3){return _0x626ec3['update'](_0x6ce7bc)[_0x4a7b('0x24')](function(_0x1b6dc1){return _0x1b6dc1;});}return null;};}function removeEntity(_0x42e507,_0x1ffa01){return function(_0x53ca5c){if(_0x53ca5c){return _0x53ca5c[_0x4a7b('0x25')]()[_0x4a7b('0x24')](function(){var _0x3a8836=_0x53ca5c[_0x4a7b('0x26')]({'plain':!![]});var _0x20d5ff=_0x4a7b('0x27');return db['UserProfileResource'][_0x4a7b('0x25')]({'where':{'type':_0x20d5ff,'resourceId':_0x3a8836['id']}})['then'](function(){return _0x53ca5c;});})[_0x4a7b('0x24')](function(){_0x42e507['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x328d1f,_0x1ad572){return function(_0x552e1e){if(!_0x552e1e){_0x328d1f['sendStatus'](0x194);}return _0x552e1e;};}function handleError(_0x53a00,_0xd5e37e){_0xd5e37e=_0xd5e37e||0x1f4;return function(_0x1dc66a){logger[_0x4a7b('0x28')](_0x1dc66a[_0x4a7b('0x29')]);if(_0x1dc66a['name']){delete _0x1dc66a[_0x4a7b('0x2a')];}_0x53a00[_0x4a7b('0x1b')](_0xd5e37e)[_0x4a7b('0x2b')](_0x1dc66a);};}exports[_0x4a7b('0x2c')]=function(_0x5b49f8,_0x12e136){var _0x493f60={},_0x544ede={},_0x179321={'count':0x0,'rows':[]};var _0x449298=_['map'](db['SquareOdbc'][_0x4a7b('0x2d')],function(_0x30cacb){return{'name':_0x30cacb['fieldName'],'type':_0x30cacb[_0x4a7b('0x2e')][_0x4a7b('0x2f')]};});_0x544ede[_0x4a7b('0x30')]=_[_0x4a7b('0x31')](_0x449298,_0x4a7b('0x2a'));_0x544ede[_0x4a7b('0x32')]=_[_0x4a7b('0x33')](_0x5b49f8[_0x4a7b('0x32')]);_0x544ede['filters']=_[_0x4a7b('0x34')](_0x544ede[_0x4a7b('0x30')],_0x544ede[_0x4a7b('0x32')]);_0x493f60[_0x4a7b('0x35')]=_[_0x4a7b('0x34')](_0x544ede[_0x4a7b('0x30')],qs[_0x4a7b('0x36')](_0x5b49f8[_0x4a7b('0x32')][_0x4a7b('0x36')]));_0x493f60[_0x4a7b('0x35')]=_0x493f60[_0x4a7b('0x35')][_0x4a7b('0x37')]?_0x493f60[_0x4a7b('0x35')]:_0x544ede[_0x4a7b('0x30')];if(!_0x5b49f8['query'][_0x4a7b('0x38')](_0x4a7b('0x39'))){_0x493f60['limit']=qs[_0x4a7b('0x20')](_0x5b49f8['query'][_0x4a7b('0x20')]);_0x493f60[_0x4a7b('0x1d')]=qs[_0x4a7b('0x1d')](_0x5b49f8[_0x4a7b('0x32')][_0x4a7b('0x1d')]);}_0x493f60['order']=qs[_0x4a7b('0x3a')](_0x5b49f8[_0x4a7b('0x32')][_0x4a7b('0x3a')]);_0x493f60[_0x4a7b('0x3b')]=qs[_0x4a7b('0x3c')](_[_0x4a7b('0x3d')](_0x5b49f8['query'],_0x544ede[_0x4a7b('0x3c')]),_0x449298);if(_0x5b49f8[_0x4a7b('0x32')][_0x4a7b('0x3e')]){_0x493f60['where']=_['merge'](_0x493f60[_0x4a7b('0x3b')],{'$or':_[_0x4a7b('0x31')](_0x449298,function(_0xb54420){if(_0xb54420['type']!==_0x4a7b('0x3f')){var _0x14a0f7={};_0x14a0f7[_0xb54420[_0x4a7b('0x2a')]]={'$like':'%'+_0x5b49f8[_0x4a7b('0x32')]['filter']+'%'};return _0x14a0f7;}})});}_0x493f60=_[_0x4a7b('0x40')]({},_0x493f60,_0x5b49f8[_0x4a7b('0x41')]);var _0x5cd6f6={'where':_0x493f60['where']};return db[_0x4a7b('0x42')][_0x4a7b('0x1f')](_0x5cd6f6)[_0x4a7b('0x24')](function(_0x3e30c2){_0x179321['count']=_0x3e30c2;if(_0x5b49f8[_0x4a7b('0x32')][_0x4a7b('0x43')]){_0x493f60['include']=[{'all':!![]}];}return db[_0x4a7b('0x42')][_0x4a7b('0x44')](_0x493f60);})[_0x4a7b('0x24')](function(_0x59760e){_0x179321[_0x4a7b('0x45')]=_0x59760e;return _0x179321;})[_0x4a7b('0x24')](respondWithFilteredResult(_0x12e136,_0x493f60))[_0x4a7b('0x46')](handleError(_0x12e136,null));};exports[_0x4a7b('0x47')]=function(_0x142dcf,_0x151621){var _0xa4b87b={'raw':!![],'where':{'id':_0x142dcf[_0x4a7b('0x48')]['id']}},_0x323878={};_0x323878[_0x4a7b('0x30')]=_[_0x4a7b('0x33')](db[_0x4a7b('0x42')][_0x4a7b('0x2d')]);_0x323878[_0x4a7b('0x32')]=_['keys'](_0x142dcf['query']);_0x323878[_0x4a7b('0x3c')]=_[_0x4a7b('0x34')](_0x323878['model'],_0x323878[_0x4a7b('0x32')]);_0xa4b87b[_0x4a7b('0x35')]=_[_0x4a7b('0x34')](_0x323878[_0x4a7b('0x30')],qs[_0x4a7b('0x36')](_0x142dcf[_0x4a7b('0x32')][_0x4a7b('0x36')]));_0xa4b87b[_0x4a7b('0x35')]=_0xa4b87b[_0x4a7b('0x35')][_0x4a7b('0x37')]?_0xa4b87b[_0x4a7b('0x35')]:_0x323878[_0x4a7b('0x30')];if(_0x142dcf[_0x4a7b('0x32')]['includeAll']){_0xa4b87b[_0x4a7b('0x49')]=[{'all':!![]}];}_0xa4b87b=_[_0x4a7b('0x40')]({},_0xa4b87b,_0x142dcf['options']);return db['SquareOdbc']['find'](_0xa4b87b)[_0x4a7b('0x24')](handleEntityNotFound(_0x151621,null))[_0x4a7b('0x24')](respondWithResult(_0x151621,null))[_0x4a7b('0x46')](handleError(_0x151621,null));};exports['create']=function(_0x337b62,_0x4b98cb){return db['SquareOdbc'][_0x4a7b('0x4a')](_0x337b62['body'],{})[_0x4a7b('0x24')](function(_0x58986e){var _0x79a813=_0x337b62[_0x4a7b('0x4b')]['get']({'plain':!![]});if(!_0x79a813)throw new Error(_0x4a7b('0x4c'));if(_0x79a813[_0x4a7b('0x4d')]===_0x4a7b('0x4b')){var _0x179e8c=_0x58986e[_0x4a7b('0x26')]({'plain':!![]});var _0xa370c4=_0x4a7b('0x27');return db[_0x4a7b('0x4e')]['find']({'where':{'name':_0xa370c4,'userProfileId':_0x79a813[_0x4a7b('0x4f')]},'raw':!![]})[_0x4a7b('0x24')](function(_0x13ff12){if(_0x13ff12&&_0x13ff12[_0x4a7b('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x179e8c[_0x4a7b('0x2a')],'resourceId':_0x179e8c['id'],'type':_0x13ff12['name'],'sectionId':_0x13ff12['id']},{})[_0x4a7b('0x24')](function(){return _0x58986e;});}else{return _0x58986e;}})[_0x4a7b('0x46')](function(_0x5263cb){logger['error'](_0x4a7b('0x51'),_0x5263cb);throw _0x5263cb;});}return _0x58986e;})[_0x4a7b('0x24')](respondWithResult(_0x4b98cb,0xc9))['catch'](handleError(_0x4b98cb,null));};exports[_0x4a7b('0x52')]=function(_0x1aa1c5,_0x2218a7){if(_0x1aa1c5[_0x4a7b('0x53')]['id']){delete _0x1aa1c5[_0x4a7b('0x53')]['id'];}return db['SquareOdbc'][_0x4a7b('0x54')]({'where':{'id':_0x1aa1c5[_0x4a7b('0x48')]['id']}})[_0x4a7b('0x24')](handleEntityNotFound(_0x2218a7,null))[_0x4a7b('0x24')](saveUpdates(_0x1aa1c5[_0x4a7b('0x53')],null))['then'](respondWithResult(_0x2218a7,null))[_0x4a7b('0x46')](handleError(_0x2218a7,null));};exports[_0x4a7b('0x25')]=function(_0x2b215b,_0x54d2f7){return db['SquareOdbc'][_0x4a7b('0x54')]({'where':{'id':_0x2b215b[_0x4a7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x54d2f7,null))['then'](removeEntity(_0x54d2f7,null))[_0x4a7b('0x46')](handleError(_0x54d2f7,null));};exports[_0x4a7b('0x55')]=function(_0x95f81e,_0x47053d,_0x40b4e6){var _0x232df9;return db[_0x4a7b('0x42')][_0x4a7b('0x54')]({'where':{'id':_0x95f81e[_0x4a7b('0x48')]['id']},'attributes':['id','dsn']})[_0x4a7b('0x24')](handleEntityNotFound(_0x47053d,null))[_0x4a7b('0x24')](function(_0x12eedc){if(_0x12eedc){var _0x3c2a42=require(_0x4a7b('0x56'))();_0x3c2a42[_0x4a7b('0x57')](_0x12eedc[_0x4a7b('0x58')]);_0x3c2a42[_0x4a7b('0x59')]();return _0x12eedc;}})[_0x4a7b('0x24')](respondWithResult(_0x47053d,null))[_0x4a7b('0x46')](handleError(_0x47053d,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e6fcda3..1ad326d 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 _0x56c4=['bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','../../config/logger','api','moment'];(function(_0x15385d,_0x155bb5){var _0x14612f=function(_0x59550c){while(--_0x59550c){_0x15385d['push'](_0x15385d['shift']());}};_0x14612f(++_0x155bb5);}(_0x56c4,0x1b9));var _0x456c=function(_0x20006a,_0x30e3a9){_0x20006a=_0x20006a-0x0;var _0x5e26ac=_0x56c4[_0x20006a];return _0x5e26ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x456c('0x0'))(_0x456c('0x1'));var moment=require(_0x456c('0x2'));var BPromise=require(_0x456c('0x3'));var rp=require(_0x456c('0x4'));var fs=require('fs');var path=require(_0x456c('0x5'));var rimraf=require('rimraf');var config=require(_0x456c('0x6'));var attributes=require(_0x456c('0x7'));module[_0x456c('0x8')]=function(_0xadf41c,_0x3fec55){return _0xadf41c[_0x456c('0x9')](_0x456c('0xa'),attributes,{'tableName':_0x456c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ad4=['lodash','util','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc'];(function(_0x3031a2,_0x4acf71){var _0x457f96=function(_0x1003f1){while(--_0x1003f1){_0x3031a2['push'](_0x3031a2['shift']());}};_0x457f96(++_0x4acf71);}(_0x2ad4,0xbd));var _0x42ad=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x2ad4[_0x170772];return _0x3ef69c;};'use strict';var _=require(_0x42ad('0x0'));var util=require(_0x42ad('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x42ad('0x2'));var fs=require('fs');var path=require(_0x42ad('0x3'));var rimraf=require(_0x42ad('0x4'));var config=require(_0x42ad('0x5'));var attributes=require(_0x42ad('0x6'));module['exports']=function(_0x247410,_0x1c30c8){return _0x247410[_0x42ad('0x7')](_0x42ad('0x8'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index d40bb82..060be5c 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 _0x84c9=['request\x20sent','stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x341a8d,_0x319696){var _0x3b598d=function(_0x187e7e){while(--_0x187e7e){_0x341a8d['push'](_0x341a8d['shift']());}};_0x3b598d(++_0x319696);}(_0x84c9,0x70));var _0x984c=function(_0xc1bc0a,_0x1b2ecf){_0xc1bc0a=_0xc1bc0a-0x0;var _0x5638a2=_0x84c9[_0xc1bc0a];return _0x5638a2;};'use strict';var _=require(_0x984c('0x0'));var util=require(_0x984c('0x1'));var moment=require(_0x984c('0x2'));var BPromise=require('bluebird');var rs=require(_0x984c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x984c('0x4'))['db'];var utils=require(_0x984c('0x5'));var logger=require(_0x984c('0x6'))(_0x984c('0x7'));var config=require(_0x984c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x984c('0x9')][_0x984c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7b24da,_0x4c26ca,_0x58b53a){return new BPromise(function(_0x398564,_0x4ef01d){return client[_0x984c('0xb')](_0x7b24da,_0x58b53a)[_0x984c('0xc')](function(_0x5ec823){logger[_0x984c('0xd')](_0x984c('0xe'),_0x4c26ca,'request\x20sent');logger['debug'](_0x984c('0xf'),_0x4c26ca,_0x984c('0x10'),JSON[_0x984c('0x11')](_0x5ec823));if(_0x5ec823['error']){if(_0x5ec823[_0x984c('0x12')][_0x984c('0x13')]===0x1f4){logger[_0x984c('0x12')](_0x984c('0xe'),_0x4c26ca,_0x5ec823['error'][_0x984c('0x14')]);return _0x4ef01d(_0x5ec823[_0x984c('0x12')][_0x984c('0x14')]);}logger[_0x984c('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x4c26ca,_0x5ec823['error']['message']);return _0x398564(_0x5ec823[_0x984c('0x12')]['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4c26ca,'request\x20sent');_0x398564(_0x5ec823['result'][_0x984c('0x14')]);}})[_0x984c('0x15')](function(_0x121711){logger[_0x984c('0x12')](_0x984c('0xe'),_0x4c26ca,_0x121711);_0x4ef01d(_0x121711);});});}exports[_0x984c('0x16')]=function(_0x322e9e){var _0x5061f3=this;return new Promise(function(_0x2a10c3,_0x7d8940){return db[_0x984c('0x17')][_0x984c('0x18')]({'raw':_0x322e9e[_0x984c('0x19')]?_0x322e9e[_0x984c('0x19')][_0x984c('0x1a')]===undefined?!![]:![]:!![],'where':_0x322e9e[_0x984c('0x19')]?_0x322e9e[_0x984c('0x19')][_0x984c('0x1b')]||null:null,'attributes':_0x322e9e[_0x984c('0x19')]?_0x322e9e[_0x984c('0x19')]['attributes']||null:null,'include':_0x322e9e[_0x984c('0x19')]?_0x322e9e[_0x984c('0x19')][_0x984c('0x1c')]?_[_0x984c('0x1d')](_0x322e9e[_0x984c('0x19')][_0x984c('0x1c')],function(_0x290b9c){return{'model':db[_0x290b9c[_0x984c('0x1e')]],'as':_0x290b9c['as'],'attributes':_0x290b9c[_0x984c('0x1f')],'include':_0x290b9c[_0x984c('0x1c')]?_['map'](_0x290b9c[_0x984c('0x1c')],function(_0x5213d6){return{'model':db[_0x5213d6[_0x984c('0x1e')]],'as':_0x5213d6['as'],'attributes':_0x5213d6[_0x984c('0x1f')],'include':_0x5213d6[_0x984c('0x1c')]?_['map'](_0x5213d6[_0x984c('0x1c')],function(_0x33c7cd){return{'model':db[_0x33c7cd['model']],'as':_0x33c7cd['as'],'attributes':_0x33c7cd[_0x984c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x984c('0xc')](function(_0x39f477){logger[_0x984c('0xd')](_0x984c('0x16'),_0x322e9e);logger['debug'](_0x984c('0x16'),_0x322e9e,JSON[_0x984c('0x11')](_0x39f477));_0x2a10c3(_0x39f477);})[_0x984c('0x15')](function(_0x5463db){logger[_0x984c('0x12')](_0x984c('0x16'),_0x5463db['message'],_0x322e9e);_0x7d8940(_0x5061f3[_0x984c('0x12')](0x1f4,_0x5463db[_0x984c('0x14')]));});});}; \ No newline at end of file +var _0x1f0d=['ioredis','../../mysqldb','../../config/logger','jayson/promise','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring'];(function(_0xace3cd,_0x4a514f){var _0x1829ff=function(_0xe46cf2){while(--_0xe46cf2){_0xace3cd['push'](_0xace3cd['shift']());}};_0x1829ff(++_0x4a514f);}(_0x1f0d,0xb5));var _0xd1f0=function(_0x1ad958,_0x1f7646){_0x1ad958=_0x1ad958-0x0;var _0x35be80=_0x1f0d[_0x1ad958];return _0x35be80;};'use strict';var _=require(_0xd1f0('0x0'));var util=require(_0xd1f0('0x1'));var moment=require(_0xd1f0('0x2'));var BPromise=require(_0xd1f0('0x3'));var rs=require(_0xd1f0('0x4'));var fs=require('fs');var Redis=require(_0xd1f0('0x5'));var db=require(_0xd1f0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1f0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd1f0('0x8'));var client=jayson['client'][_0xd1f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3536c9,_0x13fe11,_0x34f36c){return new BPromise(function(_0x5c5514,_0x5a3f96){return client['request'](_0x3536c9,_0x34f36c)[_0xd1f0('0xa')](function(_0x73d22d){logger[_0xd1f0('0xb')](_0xd1f0('0xc'),_0x13fe11,_0xd1f0('0xd'));logger[_0xd1f0('0xe')](_0xd1f0('0xf'),_0x13fe11,_0xd1f0('0xd'),JSON[_0xd1f0('0x10')](_0x73d22d));if(_0x73d22d['error']){if(_0x73d22d[_0xd1f0('0x11')][_0xd1f0('0x12')]===0x1f4){logger['error'](_0xd1f0('0xc'),_0x13fe11,_0x73d22d[_0xd1f0('0x11')]['message']);return _0x5a3f96(_0x73d22d[_0xd1f0('0x11')][_0xd1f0('0x13')]);}logger[_0xd1f0('0x11')](_0xd1f0('0xc'),_0x13fe11,_0x73d22d['error'][_0xd1f0('0x13')]);return _0x5c5514(_0x73d22d['error'][_0xd1f0('0x13')]);}else{logger[_0xd1f0('0xb')](_0xd1f0('0xc'),_0x13fe11,'request\x20sent');_0x5c5514(_0x73d22d[_0xd1f0('0x14')]['message']);}})[_0xd1f0('0x15')](function(_0x1821e4){logger[_0xd1f0('0x11')](_0xd1f0('0xc'),_0x13fe11,_0x1821e4);_0x5a3f96(_0x1821e4);});});}exports[_0xd1f0('0x16')]=function(_0xc2b9bc){var _0x2c58f4=this;return new Promise(function(_0x4611c6,_0x4b1f58){return db['SquareOdbc'][_0xd1f0('0x17')]({'raw':_0xc2b9bc[_0xd1f0('0x18')]?_0xc2b9bc['options'][_0xd1f0('0x19')]===undefined?!![]:![]:!![],'where':_0xc2b9bc[_0xd1f0('0x18')]?_0xc2b9bc['options'][_0xd1f0('0x1a')]||null:null,'attributes':_0xc2b9bc[_0xd1f0('0x18')]?_0xc2b9bc[_0xd1f0('0x18')]['attributes']||null:null,'include':_0xc2b9bc[_0xd1f0('0x18')]?_0xc2b9bc[_0xd1f0('0x18')][_0xd1f0('0x1b')]?_[_0xd1f0('0x1c')](_0xc2b9bc[_0xd1f0('0x18')]['include'],function(_0x4065df){return{'model':db[_0x4065df[_0xd1f0('0x1d')]],'as':_0x4065df['as'],'attributes':_0x4065df[_0xd1f0('0x1e')],'include':_0x4065df[_0xd1f0('0x1b')]?_[_0xd1f0('0x1c')](_0x4065df[_0xd1f0('0x1b')],function(_0x4b058e){return{'model':db[_0x4b058e[_0xd1f0('0x1d')]],'as':_0x4b058e['as'],'attributes':_0x4b058e[_0xd1f0('0x1e')],'include':_0x4b058e['include']?_[_0xd1f0('0x1c')](_0x4b058e['include'],function(_0xb33ab9){return{'model':db[_0xb33ab9['model']],'as':_0xb33ab9['as'],'attributes':_0xb33ab9[_0xd1f0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd1f0('0xa')](function(_0x5c45b1){logger['info'](_0xd1f0('0x16'),_0xc2b9bc);logger[_0xd1f0('0xe')]('ShowSquareOdbc',_0xc2b9bc,JSON[_0xd1f0('0x10')](_0x5c45b1));_0x4611c6(_0x5c45b1);})[_0xd1f0('0x15')](function(_0x56b1f3){logger[_0xd1f0('0x11')]('ShowSquareOdbc',_0x56b1f3[_0xd1f0('0x13')],_0xc2b9bc);_0x4b1f58(_0x2c58f4[_0xd1f0('0x11')](0x1f4,_0x56b1f3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index b530ed2..a3e2792 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 _0x7e93=['../../components/interaction/service','./squareProject.controller','index','get','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x51cdd8,_0x47cf92){var _0x1aa5c1=function(_0x5d4318){while(--_0x5d4318){_0x51cdd8['push'](_0x51cdd8['shift']());}};_0x1aa5c1(++_0x47cf92);}(_0x7e93,0xa1));var _0x37e9=function(_0x5281d6,_0x396979){_0x5281d6=_0x5281d6-0x0;var _0x106bb7=_0x7e93[_0x5281d6];return _0x106bb7;};'use strict';var multer=require(_0x37e9('0x0'));var util=require('util');var path=require(_0x37e9('0x1'));var timeout=require(_0x37e9('0x2'));var express=require(_0x37e9('0x3'));var router=express[_0x37e9('0x4')]();var fs_extra=require(_0x37e9('0x5'));var auth=require(_0x37e9('0x6'));var interaction=require(_0x37e9('0x7'));var config=require('../../config/environment');var controller=require(_0x37e9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x37e9('0x9')]);router[_0x37e9('0xa')](_0x37e9('0xb'),auth['isAuthenticated'](),controller[_0x37e9('0xc')]);router[_0x37e9('0xd')]('/',auth[_0x37e9('0xe')](),controller[_0x37e9('0xf')]);router[_0x37e9('0x10')](_0x37e9('0xb'),auth[_0x37e9('0xe')](),controller[_0x37e9('0x11')]);router[_0x37e9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x37e9('0x13')]);module[_0x37e9('0x14')]=router; \ No newline at end of file +var _0xa76f=['update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id'];(function(_0xab1438,_0x200d4e){var _0x56cf49=function(_0x5e5ed1){while(--_0x5e5ed1){_0xab1438['push'](_0xab1438['shift']());}};_0x56cf49(++_0x200d4e);}(_0xa76f,0x179));var _0xfa76=function(_0x5db291,_0x436956){_0x5db291=_0x5db291-0x0;var _0x54a80e=_0xa76f[_0x5db291];return _0x54a80e;};'use strict';var multer=require('multer');var util=require(_0xfa76('0x0'));var path=require(_0xfa76('0x1'));var timeout=require(_0xfa76('0x2'));var express=require(_0xfa76('0x3'));var router=express[_0xfa76('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa76('0x5'));var interaction=require(_0xfa76('0x6'));var config=require(_0xfa76('0x7'));var controller=require('./squareProject.controller');router[_0xfa76('0x8')]('/',auth[_0xfa76('0x9')](),controller['index']);router[_0xfa76('0x8')]('/:id',auth[_0xfa76('0x9')](),controller[_0xfa76('0xa')]);router['post']('/',auth[_0xfa76('0x9')](),controller[_0xfa76('0xb')]);router[_0xfa76('0xc')](_0xfa76('0xd'),auth['isAuthenticated'](),controller[_0xfa76('0xe')]);router[_0xfa76('0xf')](_0xfa76('0xd'),auth[_0xfa76('0x9')](),controller['destroy']);module[_0xfa76('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3f0d687..29a87d4 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 _0x9092=['preproduction','utf8','production','toString','DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue'];(function(_0x3fbc26,_0x430c6e){var _0x4a3496=function(_0x210170){while(--_0x210170){_0x3fbc26['push'](_0x3fbc26['shift']());}};_0x4a3496(++_0x430c6e);}(_0x9092,0x95));var _0x2909=function(_0xdfc34a,_0x103d33){_0xdfc34a=_0xdfc34a-0x0;var _0x1d895d=_0x9092[_0xdfc34a];return _0x1d895d;};'use strict';var Sequelize=require(_0x2909('0x0'));module[_0x2909('0x1')]={'name':{'type':Sequelize[_0x2909('0x2')],'unique':_0x2909('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2909('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x2909('0x4')](_0x2909('0x5')),'get':function(){if(this[_0x2909('0x6')]('preproduction')){return this['getDataValue'](_0x2909('0x7'))['toString'](_0x2909('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x2909('0x6')](_0x2909('0x9'))){return this[_0x2909('0x6')]('production')[_0x2909('0xa')](_0x2909('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x2909('0xb')]}}; \ No newline at end of file +var _0xa707=['STRING','name','TEXT','long','getDataValue','preproduction','toString','utf8','BLOB','production','DATE','sequelize','exports'];(function(_0x549d16,_0x4d069a){var _0x344ccc=function(_0x1d992a){while(--_0x1d992a){_0x549d16['push'](_0x549d16['shift']());}};_0x344ccc(++_0x4d069a);}(_0xa707,0x136));var _0x7a70=function(_0x3f2e37,_0x2cc862){_0x3f2e37=_0x3f2e37-0x0;var _0x417930=_0xa707[_0x3f2e37];return _0x417930;};'use strict';var Sequelize=require(_0x7a70('0x0'));module[_0x7a70('0x1')]={'name':{'type':Sequelize[_0x7a70('0x2')],'unique':_0x7a70('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7a70('0x2')]},'notes':{'type':Sequelize[_0x7a70('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x7a70('0x5')),'get':function(){if(this[_0x7a70('0x6')](_0x7a70('0x7'))){return this[_0x7a70('0x6')](_0x7a70('0x7'))[_0x7a70('0x8')](_0x7a70('0x9'));}}},'production':{'type':Sequelize[_0x7a70('0xa')]('long'),'get':function(){if(this[_0x7a70('0x6')](_0x7a70('0xb'))){return this['getDataValue'](_0x7a70('0xb'))[_0x7a70('0x8')]('utf8');}}},'savedAt':{'type':Sequelize[_0x7a70('0xc')]},'publishedAt':{'type':Sequelize[_0x7a70('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 9ce0f68..3a366a2 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 _0x51ef=['show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','production','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','limit','undefined','count','set','Content-Range','json','destroy','then','UserProfileResource','publish','agi','stringify','end','sendStatus','error','name','index','SquareProject','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x51ef,0x1f1));var _0xf51e=function(_0x1dee6b,_0x469604){_0x1dee6b=_0x1dee6b-0x0;var _0x1c77d3=_0x51ef[_0x1dee6b];return _0x1c77d3;};'use strict';var _=require(_0xf51e('0x0'));var Redis=require(_0xf51e('0x1'));var qs=require(_0xf51e('0x2'));var logger=require('../../config/logger')(_0xf51e('0x3'));var config=require('../../config/environment');var db=require(_0xf51e('0x4'))['db'];config[_0xf51e('0x5')]=_[_0xf51e('0x6')](config[_0xf51e('0x5')],{'host':_0xf51e('0x7'),'port':0x18eb});var socket=require(_0xf51e('0x8'))(new Redis(config[_0xf51e('0x5')]));require(_0xf51e('0x9'))[_0xf51e('0xa')](socket);function respondWithResult(_0x2a0701,_0x46b943){_0x46b943=_0x46b943||0xc8;return function(_0x3bb5ad){if(_0x3bb5ad){return _0x2a0701[_0xf51e('0xb')](_0x46b943)['json'](_0x3bb5ad);}};}function respondWithFilteredResult(_0x541a21,_0x5a4f35){return function(_0xf1f0db){if(_0xf1f0db){var _0x3560a9=typeof _0x5a4f35[_0xf51e('0xc')]==='undefined'&&typeof _0x5a4f35[_0xf51e('0xd')]===_0xf51e('0xe');var _0x493954=_0xf1f0db[_0xf51e('0xf')];var _0x1b3894=_0x3560a9?0x0:_0x5a4f35['offset'];var _0x3cb96d=_0x3560a9?_0xf1f0db['count']:_0x5a4f35[_0xf51e('0xc')]+_0x5a4f35[_0xf51e('0xd')];var _0x516ee8;if(_0x3cb96d>=_0x493954){_0x3cb96d=_0x493954;_0x516ee8=0xc8;}else{_0x516ee8=0xce;}_0x541a21['status'](_0x516ee8);return _0x541a21[_0xf51e('0x10')](_0xf51e('0x11'),_0x1b3894+'-'+_0x3cb96d+'/'+_0x493954)[_0xf51e('0x12')](_0xf1f0db);}return null;};}function saveUpdates(_0x140169){return function(_0x174df8){if(_0x174df8){return _0x174df8['update'](_0x140169)['then'](function(_0x5d43d2){return _0x5d43d2;});}return null;};}function removeEntity(_0x417017){return function(_0x54d4c2){if(_0x54d4c2){return _0x54d4c2[_0xf51e('0x13')]()[_0xf51e('0x14')](function(){var _0x485b40=_0x54d4c2['get']({'plain':!![]});var _0x317282='SquareProjects';return db[_0xf51e('0x15')]['destroy']({'where':{'type':_0x317282,'resourceId':_0x485b40['id']}})[_0xf51e('0x14')](function(){return _0x54d4c2;});})[_0xf51e('0x14')](function(){var _0x2d45cb=new Redis(config[_0xf51e('0x5')]);_0x2d45cb[_0xf51e('0x16')](_0xf51e('0x17'),JSON[_0xf51e('0x18')]({'id':_0x54d4c2['id'],'deleted':!![]}));})[_0xf51e('0x14')](function(){_0x417017[_0xf51e('0xb')](0xcc)[_0xf51e('0x19')]();});}};}function handleEntityNotFound(_0x1a7b66){return function(_0x486040){if(!_0x486040){_0x1a7b66[_0xf51e('0x1a')](0x194);}return _0x486040;};}function handleError(_0x3f3d99,_0x3ba200){_0x3ba200=_0x3ba200||0x1f4;return function(_0x3a1d35){logger[_0xf51e('0x1b')](_0x3a1d35['stack']);if(_0x3a1d35[_0xf51e('0x1c')]){delete _0x3a1d35['name'];}_0x3f3d99['status'](_0x3ba200)['send'](_0x3a1d35);};}exports[_0xf51e('0x1d')]=function(_0x2efac2,_0x5d844d){var _0x3ee72e={},_0x30fad9={},_0x2dc4c2={'count':0x0,'rows':[]};var _0x56c382=_['map'](db[_0xf51e('0x1e')][_0xf51e('0x1f')],function(_0x945f3c){return{'name':_0x945f3c[_0xf51e('0x20')],'type':_0x945f3c['type']['key']};});_0x30fad9[_0xf51e('0x21')]=_[_0xf51e('0x22')](_0x56c382,'name');_0x30fad9[_0xf51e('0x23')]=_[_0xf51e('0x24')](_0x2efac2['query']);_0x30fad9[_0xf51e('0x25')]=_[_0xf51e('0x26')](_0x30fad9[_0xf51e('0x21')],_0x30fad9[_0xf51e('0x23')]);_0x3ee72e[_0xf51e('0x27')]=_[_0xf51e('0x26')](_0x30fad9['model'],qs[_0xf51e('0x28')](_0x2efac2[_0xf51e('0x23')][_0xf51e('0x28')]));_0x3ee72e[_0xf51e('0x27')]=_0x3ee72e[_0xf51e('0x27')][_0xf51e('0x29')]?_0x3ee72e[_0xf51e('0x27')]:_0x30fad9[_0xf51e('0x21')];if(!_0x2efac2['query'][_0xf51e('0x2a')](_0xf51e('0x2b'))){_0x3ee72e[_0xf51e('0xd')]=qs['limit'](_0x2efac2[_0xf51e('0x23')][_0xf51e('0xd')]);_0x3ee72e[_0xf51e('0xc')]=qs['offset'](_0x2efac2['query'][_0xf51e('0xc')]);}_0x3ee72e['order']=qs['sort'](_0x2efac2[_0xf51e('0x23')][_0xf51e('0x2c')]);_0x3ee72e['where']=qs[_0xf51e('0x25')](_[_0xf51e('0x2d')](_0x2efac2[_0xf51e('0x23')],_0x30fad9['filters']),_0x56c382);if(_0x2efac2[_0xf51e('0x23')][_0xf51e('0x2e')]){_0x3ee72e[_0xf51e('0x2f')]=_['merge'](_0x3ee72e[_0xf51e('0x2f')],{'$or':_['map'](_0x56c382,function(_0x1f1ea4){if(_0x1f1ea4['type']!==_0xf51e('0x30')){var _0x2900e0={};_0x2900e0[_0x1f1ea4[_0xf51e('0x1c')]]={'$like':'%'+_0x2efac2[_0xf51e('0x23')][_0xf51e('0x2e')]+'%'};return _0x2900e0;}})});}_0x3ee72e=_[_0xf51e('0x31')]({},_0x3ee72e,_0x2efac2['options']);var _0xb6cb5d={'where':_0x3ee72e[_0xf51e('0x2f')]};return db[_0xf51e('0x1e')]['count'](_0xb6cb5d)[_0xf51e('0x14')](function(_0x11689c){_0x2dc4c2[_0xf51e('0xf')]=_0x11689c;if(_0x2efac2[_0xf51e('0x23')][_0xf51e('0x32')]){_0x3ee72e[_0xf51e('0x33')]=[{'all':!![]}];}return db[_0xf51e('0x1e')][_0xf51e('0x34')](_0x3ee72e);})['then'](function(_0x434b19){_0x2dc4c2[_0xf51e('0x35')]=_0x434b19;return _0x2dc4c2;})[_0xf51e('0x14')](respondWithFilteredResult(_0x5d844d,_0x3ee72e))[_0xf51e('0x36')](handleError(_0x5d844d,null));};exports[_0xf51e('0x37')]=function(_0x4c3978,_0x3a56a5){var _0x5a6ba4={'raw':![],'where':{'id':_0x4c3978[_0xf51e('0x38')]['id']}},_0x4acc91={};_0x4acc91[_0xf51e('0x21')]=_[_0xf51e('0x24')](db[_0xf51e('0x1e')][_0xf51e('0x1f')]);_0x4acc91[_0xf51e('0x23')]=_[_0xf51e('0x24')](_0x4c3978[_0xf51e('0x23')]);_0x4acc91[_0xf51e('0x25')]=_[_0xf51e('0x26')](_0x4acc91['model'],_0x4acc91[_0xf51e('0x23')]);_0x5a6ba4[_0xf51e('0x27')]=_[_0xf51e('0x26')](_0x4acc91['model'],qs[_0xf51e('0x28')](_0x4c3978[_0xf51e('0x23')][_0xf51e('0x28')]));_0x5a6ba4[_0xf51e('0x27')]=_0x5a6ba4['attributes'][_0xf51e('0x29')]?_0x5a6ba4[_0xf51e('0x27')]:_0x4acc91[_0xf51e('0x21')];if(_0x4c3978['query'][_0xf51e('0x32')]){_0x5a6ba4[_0xf51e('0x33')]=[{'all':!![]}];}_0x5a6ba4=_[_0xf51e('0x31')]({},_0x5a6ba4,_0x4c3978[_0xf51e('0x39')]);return db[_0xf51e('0x1e')]['find'](_0x5a6ba4)[_0xf51e('0x14')](handleEntityNotFound(_0x3a56a5,null))[_0xf51e('0x14')](respondWithResult(_0x3a56a5,null))[_0xf51e('0x36')](handleError(_0x3a56a5,null));};exports[_0xf51e('0x3a')]=function(_0x17a89c,_0x7b1c37){return db[_0xf51e('0x1e')][_0xf51e('0x3a')](_0x17a89c['body'],{})['then'](function(_0x4eb93c){var _0x3dd117=_0x17a89c[_0xf51e('0x3b')][_0xf51e('0x3c')]({'plain':!![]});if(!_0x3dd117)throw new Error(_0xf51e('0x3d'));if(_0x3dd117[_0xf51e('0x3e')]==='user'){var _0x46c90a=_0x4eb93c[_0xf51e('0x3c')]({'plain':!![]});var _0x534cda=_0xf51e('0x3f');return db['UserProfileSection']['find']({'where':{'name':_0x534cda,'userProfileId':_0x3dd117[_0xf51e('0x40')]},'raw':!![]})[_0xf51e('0x14')](function(_0xfa14d4){if(_0xfa14d4&&_0xfa14d4['autoAssociation']===0x0){return db[_0xf51e('0x15')][_0xf51e('0x3a')]({'name':_0x46c90a[_0xf51e('0x1c')],'resourceId':_0x46c90a['id'],'type':_0xfa14d4['name'],'sectionId':_0xfa14d4['id']},{})['then'](function(){return _0x4eb93c;});}else{return _0x4eb93c;}})['catch'](function(_0x496f7a){logger[_0xf51e('0x1b')](_0xf51e('0x41'),_0x496f7a);throw _0x496f7a;});}return _0x4eb93c;})[_0xf51e('0x14')](respondWithResult(_0x7b1c37,0xc9))[_0xf51e('0x36')](handleError(_0x7b1c37,null));};exports['update']=function(_0x3353b1,_0x5b77c1){if(_0x3353b1['body']['id']){delete _0x3353b1[_0xf51e('0x42')]['id'];}return db[_0xf51e('0x1e')][_0xf51e('0x43')]({'where':{'id':_0x3353b1[_0xf51e('0x38')]['id']}})['then'](handleEntityNotFound(_0x5b77c1,null))[_0xf51e('0x14')](saveUpdates(_0x3353b1[_0xf51e('0x42')],null))[_0xf51e('0x14')](function(_0x2d8d0c){if(!_0x2d8d0c)return;var _0x1fe9e3=_0x2d8d0c[_0xf51e('0x3c')]({'plain':!![]});return _0x1fe9e3;})[_0xf51e('0x14')](function(_0x1b2733){var _0x47769f=new Redis(config['redis']);_0x47769f['publish'](_0xf51e('0x17'),JSON['stringify'](_[_0xf51e('0x2d')](_0x1b2733,['id',_0xf51e('0x1c'),_0xf51e('0x44')])));return _0x1b2733;})[_0xf51e('0x14')](respondWithResult(_0x5b77c1,null))['catch'](handleError(_0x5b77c1,null));};exports[_0xf51e('0x13')]=function(_0x5008c7,_0x3c5531){return db[_0xf51e('0x1e')][_0xf51e('0x43')]({'where':{'id':_0x5008c7[_0xf51e('0x38')]['id']}})[_0xf51e('0x14')](handleEntityNotFound(_0x3c5531,null))[_0xf51e('0x14')](removeEntity(_0x3c5531,null))[_0xf51e('0x36')](handleError(_0x3c5531,null));}; \ No newline at end of file +var _0x9fb0=['length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','production','lodash','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','stack','name','index','map','SquareProject','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x5d29ad,_0xfcd534){var _0x4c29e8=function(_0x17ad30){while(--_0x17ad30){_0x5d29ad['push'](_0x5d29ad['shift']());}};_0x4c29e8(++_0xfcd534);}(_0x9fb0,0x1b9));var _0x09fb=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x9fb0[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x09fb('0x0'));var Redis=require(_0x09fb('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x09fb('0x2'))('api');var config=require(_0x09fb('0x3'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x09fb('0x4')](config[_0x09fb('0x5')],{'host':_0x09fb('0x6'),'port':0x18eb});var socket=require(_0x09fb('0x7'))(new Redis(config[_0x09fb('0x5')]));require(_0x09fb('0x8'))[_0x09fb('0x9')](socket);function respondWithResult(_0x5e078e,_0x4c26b3){_0x4c26b3=_0x4c26b3||0xc8;return function(_0x3c0b27){if(_0x3c0b27){return _0x5e078e[_0x09fb('0xa')](_0x4c26b3)[_0x09fb('0xb')](_0x3c0b27);}};}function respondWithFilteredResult(_0x327a0e,_0x399ccc){return function(_0x526641){if(_0x526641){var _0x5d4595=typeof _0x399ccc['offset']===_0x09fb('0xc')&&typeof _0x399ccc[_0x09fb('0xd')]==='undefined';var _0x327e17=_0x526641['count'];var _0x4861af=_0x5d4595?0x0:_0x399ccc['offset'];var _0x1c920e=_0x5d4595?_0x526641[_0x09fb('0xe')]:_0x399ccc[_0x09fb('0xf')]+_0x399ccc[_0x09fb('0xd')];var _0x5bc658;if(_0x1c920e>=_0x327e17){_0x1c920e=_0x327e17;_0x5bc658=0xc8;}else{_0x5bc658=0xce;}_0x327a0e[_0x09fb('0xa')](_0x5bc658);return _0x327a0e[_0x09fb('0x10')](_0x09fb('0x11'),_0x4861af+'-'+_0x1c920e+'/'+_0x327e17)[_0x09fb('0xb')](_0x526641);}return null;};}function saveUpdates(_0x18d347){return function(_0x5ded37){if(_0x5ded37){return _0x5ded37['update'](_0x18d347)[_0x09fb('0x12')](function(_0x310fb1){return _0x310fb1;});}return null;};}function removeEntity(_0x3eb28d){return function(_0x20b882){if(_0x20b882){return _0x20b882[_0x09fb('0x13')]()['then'](function(){var _0x27aace=_0x20b882[_0x09fb('0x14')]({'plain':!![]});var _0x4f57fc=_0x09fb('0x15');return db[_0x09fb('0x16')]['destroy']({'where':{'type':_0x4f57fc,'resourceId':_0x27aace['id']}})['then'](function(){return _0x20b882;});})[_0x09fb('0x12')](function(){var _0x4dc078=new Redis(config[_0x09fb('0x5')]);_0x4dc078[_0x09fb('0x17')](_0x09fb('0x18'),JSON[_0x09fb('0x19')]({'id':_0x20b882['id'],'deleted':!![]}));})[_0x09fb('0x12')](function(){_0x3eb28d['status'](0xcc)[_0x09fb('0x1a')]();});}};}function handleEntityNotFound(_0x389a94){return function(_0x280138){if(!_0x280138){_0x389a94['sendStatus'](0x194);}return _0x280138;};}function handleError(_0x1bd567,_0x19fe81){_0x19fe81=_0x19fe81||0x1f4;return function(_0x4a5277){logger['error'](_0x4a5277[_0x09fb('0x1b')]);if(_0x4a5277[_0x09fb('0x1c')]){delete _0x4a5277[_0x09fb('0x1c')];}_0x1bd567['status'](_0x19fe81)['send'](_0x4a5277);};}exports[_0x09fb('0x1d')]=function(_0x163f9e,_0x4370f4){var _0xb7110c={},_0x4c5579={},_0x116513={'count':0x0,'rows':[]};var _0x5dd217=_[_0x09fb('0x1e')](db[_0x09fb('0x1f')][_0x09fb('0x20')],function(_0x3a2b61){return{'name':_0x3a2b61['fieldName'],'type':_0x3a2b61[_0x09fb('0x21')][_0x09fb('0x22')]};});_0x4c5579[_0x09fb('0x23')]=_[_0x09fb('0x1e')](_0x5dd217,_0x09fb('0x1c'));_0x4c5579[_0x09fb('0x24')]=_[_0x09fb('0x25')](_0x163f9e['query']);_0x4c5579[_0x09fb('0x26')]=_[_0x09fb('0x27')](_0x4c5579[_0x09fb('0x23')],_0x4c5579['query']);_0xb7110c[_0x09fb('0x28')]=_[_0x09fb('0x27')](_0x4c5579['model'],qs[_0x09fb('0x29')](_0x163f9e['query'][_0x09fb('0x29')]));_0xb7110c[_0x09fb('0x28')]=_0xb7110c[_0x09fb('0x28')][_0x09fb('0x2a')]?_0xb7110c[_0x09fb('0x28')]:_0x4c5579[_0x09fb('0x23')];if(!_0x163f9e[_0x09fb('0x24')]['hasOwnProperty'](_0x09fb('0x2b'))){_0xb7110c[_0x09fb('0xd')]=qs[_0x09fb('0xd')](_0x163f9e[_0x09fb('0x24')]['limit']);_0xb7110c[_0x09fb('0xf')]=qs[_0x09fb('0xf')](_0x163f9e[_0x09fb('0x24')]['offset']);}_0xb7110c['order']=qs[_0x09fb('0x2c')](_0x163f9e[_0x09fb('0x24')]['sort']);_0xb7110c[_0x09fb('0x2d')]=qs[_0x09fb('0x26')](_[_0x09fb('0x2e')](_0x163f9e['query'],_0x4c5579[_0x09fb('0x26')]),_0x5dd217);if(_0x163f9e[_0x09fb('0x24')][_0x09fb('0x2f')]){_0xb7110c[_0x09fb('0x2d')]=_[_0x09fb('0x30')](_0xb7110c['where'],{'$or':_[_0x09fb('0x1e')](_0x5dd217,function(_0x16dfb9){if(_0x16dfb9[_0x09fb('0x21')]!==_0x09fb('0x31')){var _0x310f6d={};_0x310f6d[_0x16dfb9[_0x09fb('0x1c')]]={'$like':'%'+_0x163f9e[_0x09fb('0x24')]['filter']+'%'};return _0x310f6d;}})});}_0xb7110c=_[_0x09fb('0x30')]({},_0xb7110c,_0x163f9e[_0x09fb('0x32')]);var _0x1c5210={'where':_0xb7110c[_0x09fb('0x2d')]};return db[_0x09fb('0x1f')][_0x09fb('0xe')](_0x1c5210)[_0x09fb('0x12')](function(_0xff3102){_0x116513[_0x09fb('0xe')]=_0xff3102;if(_0x163f9e[_0x09fb('0x24')][_0x09fb('0x33')]){_0xb7110c[_0x09fb('0x34')]=[{'all':!![]}];}return db[_0x09fb('0x1f')][_0x09fb('0x35')](_0xb7110c);})[_0x09fb('0x12')](function(_0x37f328){_0x116513[_0x09fb('0x36')]=_0x37f328;return _0x116513;})[_0x09fb('0x12')](respondWithFilteredResult(_0x4370f4,_0xb7110c))[_0x09fb('0x37')](handleError(_0x4370f4,null));};exports[_0x09fb('0x38')]=function(_0x11aaf4,_0x53fa4a){var _0x183b11={'raw':![],'where':{'id':_0x11aaf4[_0x09fb('0x39')]['id']}},_0x53b883={};_0x53b883[_0x09fb('0x23')]=_[_0x09fb('0x25')](db[_0x09fb('0x1f')][_0x09fb('0x20')]);_0x53b883[_0x09fb('0x24')]=_['keys'](_0x11aaf4[_0x09fb('0x24')]);_0x53b883[_0x09fb('0x26')]=_[_0x09fb('0x27')](_0x53b883['model'],_0x53b883[_0x09fb('0x24')]);_0x183b11['attributes']=_[_0x09fb('0x27')](_0x53b883[_0x09fb('0x23')],qs[_0x09fb('0x29')](_0x11aaf4[_0x09fb('0x24')][_0x09fb('0x29')]));_0x183b11['attributes']=_0x183b11[_0x09fb('0x28')][_0x09fb('0x2a')]?_0x183b11['attributes']:_0x53b883[_0x09fb('0x23')];if(_0x11aaf4['query'][_0x09fb('0x33')]){_0x183b11[_0x09fb('0x34')]=[{'all':!![]}];}_0x183b11=_[_0x09fb('0x30')]({},_0x183b11,_0x11aaf4['options']);return db[_0x09fb('0x1f')][_0x09fb('0x3a')](_0x183b11)['then'](handleEntityNotFound(_0x53fa4a,null))[_0x09fb('0x12')](respondWithResult(_0x53fa4a,null))[_0x09fb('0x37')](handleError(_0x53fa4a,null));};exports[_0x09fb('0x3b')]=function(_0x83251,_0x1eae11){return db[_0x09fb('0x1f')][_0x09fb('0x3b')](_0x83251[_0x09fb('0x3c')],{})['then'](function(_0x155592){var _0x1ad15d=_0x83251[_0x09fb('0x3d')][_0x09fb('0x14')]({'plain':!![]});if(!_0x1ad15d)throw new Error(_0x09fb('0x3e'));if(_0x1ad15d['role']===_0x09fb('0x3d')){var _0x1b975a=_0x155592[_0x09fb('0x14')]({'plain':!![]});var _0x347288=_0x09fb('0x15');return db[_0x09fb('0x3f')][_0x09fb('0x3a')]({'where':{'name':_0x347288,'userProfileId':_0x1ad15d[_0x09fb('0x40')]},'raw':!![]})[_0x09fb('0x12')](function(_0x150ddd){if(_0x150ddd&&_0x150ddd[_0x09fb('0x41')]===0x0){return db[_0x09fb('0x16')][_0x09fb('0x3b')]({'name':_0x1b975a['name'],'resourceId':_0x1b975a['id'],'type':_0x150ddd[_0x09fb('0x1c')],'sectionId':_0x150ddd['id']},{})[_0x09fb('0x12')](function(){return _0x155592;});}else{return _0x155592;}})['catch'](function(_0x3054ff){logger['error'](_0x09fb('0x42'),_0x3054ff);throw _0x3054ff;});}return _0x155592;})[_0x09fb('0x12')](respondWithResult(_0x1eae11,0xc9))[_0x09fb('0x37')](handleError(_0x1eae11,null));};exports[_0x09fb('0x43')]=function(_0x4564ca,_0x271701){if(_0x4564ca[_0x09fb('0x3c')]['id']){delete _0x4564ca[_0x09fb('0x3c')]['id'];}return db[_0x09fb('0x1f')][_0x09fb('0x3a')]({'where':{'id':_0x4564ca['params']['id']}})[_0x09fb('0x12')](handleEntityNotFound(_0x271701,null))['then'](saveUpdates(_0x4564ca[_0x09fb('0x3c')],null))[_0x09fb('0x12')](function(_0x356794){if(!_0x356794)return;var _0x1334eb=_0x356794['get']({'plain':!![]});return _0x1334eb;})[_0x09fb('0x12')](function(_0x586554){var _0x6b4753=new Redis(config[_0x09fb('0x5')]);_0x6b4753[_0x09fb('0x17')]('agi',JSON[_0x09fb('0x19')](_['pick'](_0x586554,['id',_0x09fb('0x1c'),_0x09fb('0x44')])));return _0x586554;})[_0x09fb('0x12')](respondWithResult(_0x271701,null))['catch'](handleError(_0x271701,null));};exports[_0x09fb('0x13')]=function(_0x54a51a,_0x126043){return db[_0x09fb('0x1f')][_0x09fb('0x3a')]({'where':{'id':_0x54a51a[_0x09fb('0x39')]['id']}})['then'](handleEntityNotFound(_0x126043,null))[_0x09fb('0x12')](removeEntity(_0x126043,null))['catch'](handleError(_0x126043,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 80ee795..1eed1b6 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 _0xdd75=['SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x466186,_0x59ec76){var _0x795885=function(_0x2b8b5d){while(--_0x2b8b5d){_0x466186['push'](_0x466186['shift']());}};_0x795885(++_0x59ec76);}(_0xdd75,0x1dc));var _0x5dd7=function(_0x4ce15c,_0x1bbcbd){_0x4ce15c=_0x4ce15c-0x0;var _0x5ee259=_0xdd75[_0x4ce15c];return _0x5ee259;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x5dd7('0x0'))['db'][_0x5dd7('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5dd7('0x2')](0x0);var events={'afterCreate':_0x5dd7('0x3'),'afterUpdate':'update','afterDestroy':_0x5dd7('0x4')};function emitEvent(_0x38acbb){return function(_0x22cfb1,_0x3413c8,_0x18bf9a){SquareProjectEvents[_0x5dd7('0x5')](_0x38acbb+':'+_0x22cfb1['id'],_0x22cfb1);SquareProjectEvents[_0x5dd7('0x5')](_0x38acbb,_0x22cfb1);_0x18bf9a(null);};}for(var e in events){if(events[_0x5dd7('0x6')](e)){var event=events[e];SquareProject[_0x5dd7('0x7')](e,emitEvent(event));}}module[_0x5dd7('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xc1fc=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1fc,0x164));var _0xcc1f=function(_0x3d83f4,_0x4e5b3d){_0x3d83f4=_0x3d83f4-0x0;var _0x687304=_0xc1fc[_0x3d83f4];return _0x687304;};'use strict';var EventEmitter=require(_0xcc1f('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcc1f('0x1')](0x0);var events={'afterCreate':_0xcc1f('0x2'),'afterUpdate':'update','afterDestroy':_0xcc1f('0x3')};function emitEvent(_0x79bdfe){return function(_0x2cb6c7,_0x230a33,_0x5879eb){SquareProjectEvents['emit'](_0x79bdfe+':'+_0x2cb6c7['id'],_0x2cb6c7);SquareProjectEvents[_0xcc1f('0x4')](_0x79bdfe,_0x2cb6c7);_0x5879eb(null);};}for(var e in events){if(events[_0xcc1f('0x5')](e)){var event=events[e];SquareProject[_0xcc1f('0x6')](e,emitEvent(event));}}module[_0xcc1f('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 07d21e6..b1b5594 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 _0xfb1d=['changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','bluebird','rimraf','SquareProject','square_projects'];(function(_0x52ece1,_0x425dc5){var _0x329205=function(_0xf76c47){while(--_0xf76c47){_0x52ece1['push'](_0x52ece1['shift']());}};_0x329205(++_0x425dc5);}(_0xfb1d,0x1c6));var _0xdfb1=function(_0x3b7747,_0x5fdfed){_0x3b7747=_0x3b7747-0x0;var _0x924528=_0xfb1d[_0x3b7747];return _0x924528;};'use strict';var _=require(_0xdfb1('0x0'));var util=require(_0xdfb1('0x1'));var logger=require(_0xdfb1('0x2'))('api');var moment=require(_0xdfb1('0x3'));var BPromise=require(_0xdfb1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdfb1('0x5'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x424213,_0x347a40){return _0x424213['define'](_0xdfb1('0x6'),attributes,{'tableName':_0xdfb1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26d0e1,_0x535515,_0x1a80ce){if(_0x26d0e1[_0xdfb1('0x8')](_0xdfb1('0x9'))){_0x26d0e1['savedAt']=moment()[_0xdfb1('0xa')](_0xdfb1('0xb'));}if(_0x26d0e1[_0xdfb1('0x8')](_0xdfb1('0xc'))){_0x26d0e1[_0xdfb1('0xd')]=moment()[_0xdfb1('0xa')](_0xdfb1('0xb'));}_0x1a80ce(null,_0x26d0e1);}}});}; \ No newline at end of file +var _0xd480=['../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction','savedAt','format','production','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4cdcdc,_0x34eac7){var _0x4704ce=function(_0x1de4ed){while(--_0x1de4ed){_0x4cdcdc['push'](_0x4cdcdc['shift']());}};_0x4704ce(++_0x34eac7);}(_0xd480,0x114));var _0x0d48=function(_0x16ef3f,_0x539505){_0x16ef3f=_0x16ef3f-0x0;var _0x294ff2=_0xd480[_0x16ef3f];return _0x294ff2;};'use strict';var _=require(_0x0d48('0x0'));var util=require(_0x0d48('0x1'));var logger=require(_0x0d48('0x2'))(_0x0d48('0x3'));var moment=require(_0x0d48('0x4'));var BPromise=require(_0x0d48('0x5'));var rp=require(_0x0d48('0x6'));var fs=require('fs');var path=require(_0x0d48('0x7'));var rimraf=require(_0x0d48('0x8'));var config=require(_0x0d48('0x9'));var attributes=require(_0x0d48('0xa'));module['exports']=function(_0x3ea92c,_0x1996f7){return _0x3ea92c[_0x0d48('0xb')](_0x0d48('0xc'),attributes,{'tableName':_0x0d48('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b3cf0,_0x2654e9,_0x4b5c07){if(_0x3b3cf0[_0x0d48('0xe')](_0x0d48('0xf'))){_0x3b3cf0[_0x0d48('0x10')]=moment()[_0x0d48('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3b3cf0[_0x0d48('0xe')](_0x0d48('0x12'))){_0x3b3cf0['publishedAt']=moment()[_0x0d48('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b5c07(null,_0x3b3cf0);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 48527ad..094c6ca 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 _0x494f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','limit','include','map','model','attributes','info','debug','error','message','ShowSquareProject','where','then','catch','lodash'];(function(_0x1731cb,_0xa8248a){var _0x4ae85d=function(_0x591872){while(--_0x591872){_0x1731cb['push'](_0x1731cb['shift']());}};_0x4ae85d(++_0xa8248a);}(_0x494f,0x133));var _0xf494=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x494f[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0xf494('0x0'));var Redis=require(_0xf494('0x1'));var db=require(_0xf494('0x2'))['db'];var logger=require(_0xf494('0x3'))(_0xf494('0x4'));var config=require(_0xf494('0x5'));config[_0xf494('0x6')]=_[_0xf494('0x7')](config['redis'],{'host':_0xf494('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf494('0x9'))['register'](socket);exports[_0xf494('0xa')]=function(_0x34e20c){var _0x464c8e=this;return new Promise(function(_0x2bf396,_0x1e1253){return db[_0xf494('0xb')][_0xf494('0xc')]({'raw':_0x34e20c['options']?_0x34e20c[_0xf494('0xd')][_0xf494('0xe')]===undefined?!![]:![]:!![],'where':_0x34e20c['options']?_0x34e20c['options']['where']||null:null,'attributes':_0x34e20c[_0xf494('0xd')]?_0x34e20c['options']['attributes']||null:null,'limit':_0x34e20c['options']?_0x34e20c[_0xf494('0xd')][_0xf494('0xf')]||null:null,'include':_0x34e20c[_0xf494('0xd')]?_0x34e20c[_0xf494('0xd')][_0xf494('0x10')]?_[_0xf494('0x11')](_0x34e20c[_0xf494('0xd')][_0xf494('0x10')],function(_0x319a14){return{'model':db[_0x319a14[_0xf494('0x12')]],'as':_0x319a14['as'],'attributes':_0x319a14[_0xf494('0x13')],'include':_0x319a14[_0xf494('0x10')]?_['map'](_0x319a14[_0xf494('0x10')],function(_0x1b4f7e){return{'model':db[_0x1b4f7e['model']],'as':_0x1b4f7e['as'],'attributes':_0x1b4f7e[_0xf494('0x13')],'include':_0x1b4f7e[_0xf494('0x10')]?_['map'](_0x1b4f7e[_0xf494('0x10')],function(_0x1f056a){return{'model':db[_0x1f056a[_0xf494('0x12')]],'as':_0x1f056a['as'],'attributes':_0x1f056a[_0xf494('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd8f022){logger[_0xf494('0x14')]('GetSquareProjects',_0x34e20c);logger[_0xf494('0x15')](_0xf494('0xa'),_0x34e20c,JSON['stringify'](_0xd8f022));_0x2bf396(_0xd8f022);})['catch'](function(_0x4977d3){logger[_0xf494('0x16')]('GetSquareProjects',_0x4977d3[_0xf494('0x17')],_0x34e20c);_0x1e1253(_0x464c8e['error'](0x1f4,_0x4977d3[_0xf494('0x17')]));});});};exports[_0xf494('0x18')]=function(_0xb8e33a){var _0x1db114=this;return new Promise(function(_0x4bdac3,_0x15f5a4){return db['SquareProject']['find']({'raw':_0xb8e33a['options']?_0xb8e33a[_0xf494('0xd')][_0xf494('0xe')]===undefined?!![]:![]:!![],'where':_0xb8e33a[_0xf494('0xd')]?_0xb8e33a[_0xf494('0xd')][_0xf494('0x19')]||null:null,'attributes':_0xb8e33a['options']?_0xb8e33a[_0xf494('0xd')][_0xf494('0x13')]||null:null,'include':_0xb8e33a[_0xf494('0xd')]?_0xb8e33a['options'][_0xf494('0x10')]?_[_0xf494('0x11')](_0xb8e33a['options'][_0xf494('0x10')],function(_0x4bcd96){return{'model':db[_0x4bcd96[_0xf494('0x12')]],'as':_0x4bcd96['as'],'attributes':_0x4bcd96[_0xf494('0x13')],'include':_0x4bcd96['include']?_[_0xf494('0x11')](_0x4bcd96[_0xf494('0x10')],function(_0x26d549){return{'model':db[_0x26d549[_0xf494('0x12')]],'as':_0x26d549['as'],'attributes':_0x26d549[_0xf494('0x13')],'include':_0x26d549[_0xf494('0x10')]?_[_0xf494('0x11')](_0x26d549[_0xf494('0x10')],function(_0x38108e){return{'model':db[_0x38108e[_0xf494('0x12')]],'as':_0x38108e['as'],'attributes':_0x38108e[_0xf494('0x13')]};}):[]};}):[]};}):[]:[]})[_0xf494('0x1a')](function(_0x5c0e7a){logger[_0xf494('0x14')](_0xf494('0x18'),_0xb8e33a);logger[_0xf494('0x15')]('ShowSquareProject',_0xb8e33a,JSON['stringify'](_0x5c0e7a));_0x4bdac3(_0x5c0e7a);})[_0xf494('0x1b')](function(_0x3f3a24){logger[_0xf494('0x16')](_0xf494('0x18'),_0x3f3a24[_0xf494('0x17')],_0xb8e33a);_0x15f5a4(_0x1db114[_0xf494('0x16')](0x1f4,_0x3f3a24['message']));});});}; \ No newline at end of file +var _0xa6c8=['ShowSquareProject','then','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','stringify','catch','error','message'];(function(_0x3a0685,_0x248c35){var _0x2edf3d=function(_0x3fb7c6){while(--_0x3fb7c6){_0x3a0685['push'](_0x3a0685['shift']());}};_0x2edf3d(++_0x248c35);}(_0xa6c8,0x15e));var _0x8a6c=function(_0x19e74d,_0x4d08b4){_0x19e74d=_0x19e74d-0x0;var _0x5e1b8a=_0xa6c8[_0x19e74d];return _0x5e1b8a;};'use strict';var _=require('lodash');var Redis=require(_0x8a6c('0x0'));var db=require(_0x8a6c('0x1'))['db'];var logger=require(_0x8a6c('0x2'))(_0x8a6c('0x3'));var config=require('../../config/environment');config[_0x8a6c('0x4')]=_[_0x8a6c('0x5')](config[_0x8a6c('0x4')],{'host':_0x8a6c('0x6'),'port':0x18eb});var socket=require(_0x8a6c('0x7'))(new Redis(config[_0x8a6c('0x4')]));require(_0x8a6c('0x8'))[_0x8a6c('0x9')](socket);exports[_0x8a6c('0xa')]=function(_0x30cbbf){var _0x42dfb3=this;return new Promise(function(_0xe95825,_0x19eccb){return db[_0x8a6c('0xb')][_0x8a6c('0xc')]({'raw':_0x30cbbf[_0x8a6c('0xd')]?_0x30cbbf[_0x8a6c('0xd')][_0x8a6c('0xe')]===undefined?!![]:![]:!![],'where':_0x30cbbf['options']?_0x30cbbf['options'][_0x8a6c('0xf')]||null:null,'attributes':_0x30cbbf[_0x8a6c('0xd')]?_0x30cbbf[_0x8a6c('0xd')][_0x8a6c('0x10')]||null:null,'limit':_0x30cbbf[_0x8a6c('0xd')]?_0x30cbbf[_0x8a6c('0xd')][_0x8a6c('0x11')]||null:null,'include':_0x30cbbf['options']?_0x30cbbf[_0x8a6c('0xd')][_0x8a6c('0x12')]?_[_0x8a6c('0x13')](_0x30cbbf['options'][_0x8a6c('0x12')],function(_0x2138a7){return{'model':db[_0x2138a7[_0x8a6c('0x14')]],'as':_0x2138a7['as'],'attributes':_0x2138a7[_0x8a6c('0x10')],'include':_0x2138a7[_0x8a6c('0x12')]?_[_0x8a6c('0x13')](_0x2138a7[_0x8a6c('0x12')],function(_0x1e6e9c){return{'model':db[_0x1e6e9c[_0x8a6c('0x14')]],'as':_0x1e6e9c['as'],'attributes':_0x1e6e9c[_0x8a6c('0x10')],'include':_0x1e6e9c[_0x8a6c('0x12')]?_[_0x8a6c('0x13')](_0x1e6e9c[_0x8a6c('0x12')],function(_0xf116d8){return{'model':db[_0xf116d8[_0x8a6c('0x14')]],'as':_0xf116d8['as'],'attributes':_0xf116d8[_0x8a6c('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdc9f62){logger[_0x8a6c('0x15')](_0x8a6c('0xa'),_0x30cbbf);logger[_0x8a6c('0x16')](_0x8a6c('0xa'),_0x30cbbf,JSON[_0x8a6c('0x17')](_0xdc9f62));_0xe95825(_0xdc9f62);})[_0x8a6c('0x18')](function(_0x3ec9cf){logger[_0x8a6c('0x19')](_0x8a6c('0xa'),_0x3ec9cf[_0x8a6c('0x1a')],_0x30cbbf);_0x19eccb(_0x42dfb3[_0x8a6c('0x19')](0x1f4,_0x3ec9cf[_0x8a6c('0x1a')]));});});};exports[_0x8a6c('0x1b')]=function(_0x2356ba){var _0x14c804=this;return new Promise(function(_0x43c7b1,_0x232c67){return db[_0x8a6c('0xb')]['find']({'raw':_0x2356ba['options']?_0x2356ba['options'][_0x8a6c('0xe')]===undefined?!![]:![]:!![],'where':_0x2356ba[_0x8a6c('0xd')]?_0x2356ba['options']['where']||null:null,'attributes':_0x2356ba[_0x8a6c('0xd')]?_0x2356ba[_0x8a6c('0xd')][_0x8a6c('0x10')]||null:null,'include':_0x2356ba[_0x8a6c('0xd')]?_0x2356ba['options']['include']?_[_0x8a6c('0x13')](_0x2356ba[_0x8a6c('0xd')][_0x8a6c('0x12')],function(_0x54d8d1){return{'model':db[_0x54d8d1[_0x8a6c('0x14')]],'as':_0x54d8d1['as'],'attributes':_0x54d8d1[_0x8a6c('0x10')],'include':_0x54d8d1[_0x8a6c('0x12')]?_[_0x8a6c('0x13')](_0x54d8d1['include'],function(_0x205d3c){return{'model':db[_0x205d3c[_0x8a6c('0x14')]],'as':_0x205d3c['as'],'attributes':_0x205d3c[_0x8a6c('0x10')],'include':_0x205d3c[_0x8a6c('0x12')]?_[_0x8a6c('0x13')](_0x205d3c['include'],function(_0x451898){return{'model':db[_0x451898[_0x8a6c('0x14')]],'as':_0x451898['as'],'attributes':_0x451898[_0x8a6c('0x10')]};}):[]};}):[]};}):[]:[]})[_0x8a6c('0x1c')](function(_0x588fe0){logger[_0x8a6c('0x15')](_0x8a6c('0x1b'),_0x2356ba);logger[_0x8a6c('0x16')](_0x8a6c('0x1b'),_0x2356ba,JSON[_0x8a6c('0x17')](_0x588fe0));_0x43c7b1(_0x588fe0);})['catch'](function(_0x5288aa){logger[_0x8a6c('0x19')](_0x8a6c('0x1b'),_0x5288aa[_0x8a6c('0x1a')],_0x2356ba);_0x232c67(_0x14c804[_0x8a6c('0x19')](0x1f4,_0x5288aa[_0x8a6c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index fc78002..fd4f665 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 _0x3be0=['length','squareProject:','save','remove','update'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x3be0,0x11a));var _0x03be=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x3be0[_0x45f951];return _0x24756c;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x03be('0x0'),_0x03be('0x1'),_0x03be('0x2')];function createListener(_0x3e666f,_0x557d12){return function(_0x15d76c){_0x557d12['emit'](_0x3e666f,_0x15d76c);};}function removeListener(_0x1a34ec,_0x3d9aab){return function(){SquareProjectEvents['removeListener'](_0x1a34ec,_0x3d9aab);};}exports['register']=function(_0x9f423b){for(var _0x2c741d=0x0,_0x584093=events[_0x03be('0x3')];_0x2c741d<_0x584093;_0x2c741d++){var _0x3186a3=events[_0x2c741d];var _0x2604a0=createListener(_0x03be('0x4')+_0x3186a3,_0x9f423b);SquareProjectEvents['on'](_0x3186a3,_0x2604a0);}}; \ No newline at end of file +var _0x1d9d=['emit','removeListener','register','length','./squareProject.events','save','remove','update'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x1d9d,0x7c));var _0xd1d9=function(_0x380f7d,_0x524122){_0x380f7d=_0x380f7d-0x0;var _0xcb1a7b=_0x1d9d[_0x380f7d];return _0xcb1a7b;};'use strict';var SquareProjectEvents=require(_0xd1d9('0x0'));var events=[_0xd1d9('0x1'),_0xd1d9('0x2'),_0xd1d9('0x3')];function createListener(_0x498f41,_0x4993a2){return function(_0x3c4747){_0x4993a2[_0xd1d9('0x4')](_0x498f41,_0x3c4747);};}function removeListener(_0x3fdd64,_0x1b41ed){return function(){SquareProjectEvents[_0xd1d9('0x5')](_0x3fdd64,_0x1b41ed);};}exports[_0xd1d9('0x6')]=function(_0x2d227f){for(var _0x1240a1=0x0,_0x316350=events[_0xd1d9('0x7')];_0x1240a1<_0x316350;_0x1240a1++){var _0x260d29=events[_0x1240a1];var _0x37c8e1=createListener('squareProject:'+_0x260d29,_0x2d227f);SquareProjectEvents['on'](_0x260d29,_0x37c8e1);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 78f0e9b..e29217e 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x11668f,_0xf43a60){var _0x221b66=function(_0x464b20){while(--_0x464b20){_0x11668f['push'](_0x11668f['shift']());}};_0x221b66(++_0xf43a60);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x27e850,_0x43ce4d){var _0x4f89a7=function(_0x518a47){while(--_0x518a47){_0x27e850['push'](_0x27e850['shift']());}};_0x4f89a7(++_0x43ce4d);}(_0x4975,0x86));var _0x5497=function(_0x39158,_0x2b13c3){_0x39158=_0x39158-0x0;var _0x56cebd=_0x4975[_0x39158];return _0x56cebd;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 58b1fac..51bf667 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 _0x9957=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x177a87,_0x33ce68){var _0x43cd09=function(_0x2e2771){while(--_0x2e2771){_0x177a87['push'](_0x177a87['shift']());}};_0x43cd09(++_0x33ce68);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7995('0x2')]},'extension':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7995('0x2')]},'saveName':{'type':Sequelize[_0x7995('0x2')]},'filename':{'type':Sequelize[_0x7995('0x2')]},'savePath':{'type':Sequelize[_0x7995('0x2')]},'format':{'type':Sequelize[_0x7995('0x3')],'get':function(){var _0x326741='';var _0x4996ca=this[_0x7995('0x4')](_0x7995('0x5'));if(_0x4996ca){_0x326741=_0x4996ca['substring'](_0x4996ca[_0x7995('0x6')]('.'));}return _0x326741;}}}; \ No newline at end of file +var _0x5fd1=['STRING','VIRTUAL','getDataValue','savePath','substring','sequelize'];(function(_0x3a1eb6,_0x2f8574){var _0x5e886d=function(_0x46b98a){while(--_0x46b98a){_0x3a1eb6['push'](_0x3a1eb6['shift']());}};_0x5e886d(++_0x2f8574);}(_0x5fd1,0x155));var _0x15fd=function(_0x2a2e1e,_0x36d23e){_0x2a2e1e=_0x2a2e1e-0x0;var _0x2cf50a=_0x5fd1[_0x2a2e1e];return _0x2cf50a;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x15fd('0x1')]},'callerid':{'type':Sequelize[_0x15fd('0x1')]},'calleridname':{'type':Sequelize[_0x15fd('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x15fd('0x1')]},'accountcode':{'type':Sequelize[_0x15fd('0x1')]},'dnid':{'type':Sequelize[_0x15fd('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x15fd('0x1')]},'filename':{'type':Sequelize[_0x15fd('0x1')]},'savePath':{'type':Sequelize[_0x15fd('0x1')]},'format':{'type':Sequelize[_0x15fd('0x2')],'get':function(){var _0x225728='';var _0x534e63=this[_0x15fd('0x3')](_0x15fd('0x4'));if(_0x534e63){_0x225728=_0x534e63[_0x15fd('0x5')](_0x534e63['lastIndexOf']('.'));}return _0x225728;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2625f6f..8a853b1 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 _0x2984=['include','findAll','rows','catch','show','options','find','create','body','params','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','download','extname','unlink','message','send','Not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2984,0x82));var _0x4298=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x2984[_0x2265da];return _0x430c2b;};'use strict';var emlformat=require(_0x4298('0x0'));var rimraf=require(_0x4298('0x1'));var zipdir=require(_0x4298('0x2'));var jsonpatch=require(_0x4298('0x3'));var rp=require(_0x4298('0x4'));var moment=require('moment');var BPromise=require(_0x4298('0x5'));var Mustache=require(_0x4298('0x6'));var util=require('util');var path=require(_0x4298('0x7'));var sox=require(_0x4298('0x8'));var csv=require(_0x4298('0x9'));var ejs=require(_0x4298('0xa'));var fs=require('fs');var fs_extra=require(_0x4298('0xb'));var _=require(_0x4298('0xc'));var squel=require('squel');var crypto=require(_0x4298('0xd'));var jsforce=require(_0x4298('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4298('0x9'));var querystring=require(_0x4298('0xf'));var Papa=require(_0x4298('0x10'));var Redis=require('ioredis');var authService=require(_0x4298('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4298('0x12'));var hardwareService=require(_0x4298('0x13'));var logger=require(_0x4298('0x14'))(_0x4298('0x15'));var utils=require(_0x4298('0x16'));var config=require(_0x4298('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c7d2b,_0x3f98bd){_0x3f98bd=_0x3f98bd||0xcc;return function(_0x15efce){if(_0x15efce){return _0x5c7d2b[_0x4298('0x18')](_0x3f98bd);}return _0x5c7d2b[_0x4298('0x19')](_0x3f98bd)['end']();};}function respondWithResult(_0x595d8e,_0x2a7a1e){_0x2a7a1e=_0x2a7a1e||0xc8;return function(_0xb15e8b){if(_0xb15e8b){return _0x595d8e[_0x4298('0x19')](_0x2a7a1e)[_0x4298('0x1a')](_0xb15e8b);}};}function respondWithFilteredResult(_0x1a4bac,_0x32a5b0){return function(_0x5d0ff9){if(_0x5d0ff9){var _0x34261b=typeof _0x32a5b0[_0x4298('0x1b')]===_0x4298('0x1c')&&typeof _0x32a5b0['limit']===_0x4298('0x1c');var _0x3e2335=_0x5d0ff9[_0x4298('0x1d')];var _0xcc7fbc=_0x34261b?0x0:_0x32a5b0['offset'];var _0x11c810=_0x34261b?_0x5d0ff9[_0x4298('0x1d')]:_0x32a5b0[_0x4298('0x1b')]+_0x32a5b0[_0x4298('0x1e')];var _0x4cd666;if(_0x11c810>=_0x3e2335){_0x11c810=_0x3e2335;_0x4cd666=0xc8;}else{_0x4cd666=0xce;}_0x1a4bac[_0x4298('0x19')](_0x4cd666);return _0x1a4bac[_0x4298('0x1f')]('Content-Range',_0xcc7fbc+'-'+_0x11c810+'/'+_0x3e2335)[_0x4298('0x1a')](_0x5d0ff9);}return null;};}function patchUpdates(_0x1a41cc){return function(_0x3ad551){try{jsonpatch[_0x4298('0x20')](_0x3ad551,_0x1a41cc,!![]);}catch(_0x910c0){return BPromise[_0x4298('0x21')](_0x910c0);}return _0x3ad551[_0x4298('0x22')]();};}function saveUpdates(_0x217fcc,_0xfa8180){return function(_0x1138f5){if(_0x1138f5){return _0x1138f5[_0x4298('0x23')](_0x217fcc)[_0x4298('0x24')](function(_0x2cd4a8){return _0x2cd4a8;});}return null;};}function removeEntity(_0x6a8565,_0x4f8972){return function(_0x4dc119){if(_0x4dc119){return _0x4dc119[_0x4298('0x25')]()[_0x4298('0x24')](function(){_0x6a8565[_0x4298('0x19')](0xcc)[_0x4298('0x26')]();});}};}function handleEntityNotFound(_0x224605,_0x16912d){return function(_0x9c1a0e){if(!_0x9c1a0e){_0x224605[_0x4298('0x18')](0x194);}return _0x9c1a0e;};}function handleError(_0x4a0062,_0x257bae){_0x257bae=_0x257bae||0x1f4;return function(_0x31872f){logger[_0x4298('0x27')](_0x31872f[_0x4298('0x28')]);if(_0x31872f[_0x4298('0x29')]){delete _0x31872f['name'];}_0x4a0062[_0x4298('0x19')](_0x257bae)['send'](_0x31872f);};}exports[_0x4298('0x2a')]=function(_0x276ce2,_0x433da1){var _0x2f7689={},_0x46fe20={},_0x56427f={'count':0x0,'rows':[]};var _0x39d9a2=_['map'](db[_0x4298('0x2b')][_0x4298('0x2c')],function(_0x2930a8){return{'name':_0x2930a8[_0x4298('0x2d')],'type':_0x2930a8[_0x4298('0x2e')][_0x4298('0x2f')]};});_0x46fe20[_0x4298('0x30')]=_[_0x4298('0x31')](_0x39d9a2,_0x4298('0x29'));_0x46fe20[_0x4298('0x32')]=_[_0x4298('0x33')](_0x276ce2[_0x4298('0x32')]);_0x46fe20[_0x4298('0x34')]=_[_0x4298('0x35')](_0x46fe20[_0x4298('0x30')],_0x46fe20[_0x4298('0x32')]);_0x2f7689[_0x4298('0x36')]=_[_0x4298('0x35')](_0x46fe20[_0x4298('0x30')],qs['fields'](_0x276ce2[_0x4298('0x32')][_0x4298('0x37')]));_0x2f7689[_0x4298('0x36')]=_0x2f7689[_0x4298('0x36')][_0x4298('0x38')]?_0x2f7689[_0x4298('0x36')]:_0x46fe20[_0x4298('0x30')];if(!_0x276ce2['query']['hasOwnProperty'](_0x4298('0x39'))){_0x2f7689[_0x4298('0x1e')]=qs[_0x4298('0x1e')](_0x276ce2[_0x4298('0x32')][_0x4298('0x1e')]);_0x2f7689[_0x4298('0x1b')]=qs[_0x4298('0x1b')](_0x276ce2[_0x4298('0x32')][_0x4298('0x1b')]);}_0x2f7689[_0x4298('0x3a')]=qs[_0x4298('0x3b')](_0x276ce2['query'][_0x4298('0x3b')]);_0x2f7689[_0x4298('0x3c')]=qs[_0x4298('0x34')](_[_0x4298('0x3d')](_0x276ce2[_0x4298('0x32')],_0x46fe20['filters']),_0x39d9a2);if(_0x276ce2[_0x4298('0x32')]['filter']){_0x2f7689[_0x4298('0x3c')]=_[_0x4298('0x3e')](_0x2f7689[_0x4298('0x3c')],{'$or':_[_0x4298('0x31')](_0x39d9a2,function(_0x54789e){if(_0x54789e[_0x4298('0x2e')]!==_0x4298('0x3f')){var _0x25e339={};_0x25e339[_0x54789e[_0x4298('0x29')]]={'$like':'%'+_0x276ce2['query']['filter']+'%'};return _0x25e339;}})});}_0x2f7689=_[_0x4298('0x3e')]({},_0x2f7689,_0x276ce2['options']);var _0x5f1fd3={'where':_0x2f7689[_0x4298('0x3c')]};return db[_0x4298('0x2b')][_0x4298('0x1d')](_0x5f1fd3)[_0x4298('0x24')](function(_0x439f22){_0x56427f[_0x4298('0x1d')]=_0x439f22;if(_0x276ce2[_0x4298('0x32')]['includeAll']){_0x2f7689[_0x4298('0x40')]=[{'all':!![]}];}return db[_0x4298('0x2b')][_0x4298('0x41')](_0x2f7689);})['then'](function(_0x3513f1){_0x56427f[_0x4298('0x42')]=_0x3513f1;return _0x56427f;})['then'](respondWithFilteredResult(_0x433da1,_0x2f7689))[_0x4298('0x43')](handleError(_0x433da1,null));};exports[_0x4298('0x44')]=function(_0x16d918,_0x5a2163){var _0x25096f={'raw':!![],'where':{'id':_0x16d918['params']['id']}},_0x311fc7={};_0x311fc7[_0x4298('0x30')]=_[_0x4298('0x33')](db[_0x4298('0x2b')]['rawAttributes']);_0x311fc7[_0x4298('0x32')]=_['keys'](_0x16d918['query']);_0x311fc7[_0x4298('0x34')]=_[_0x4298('0x35')](_0x311fc7[_0x4298('0x30')],_0x311fc7[_0x4298('0x32')]);_0x25096f[_0x4298('0x36')]=_[_0x4298('0x35')](_0x311fc7['model'],qs['fields'](_0x16d918[_0x4298('0x32')]['fields']));_0x25096f[_0x4298('0x36')]=_0x25096f[_0x4298('0x36')][_0x4298('0x38')]?_0x25096f[_0x4298('0x36')]:_0x311fc7[_0x4298('0x30')];if(_0x16d918['query']['includeAll']){_0x25096f[_0x4298('0x40')]=[{'all':!![]}];}_0x25096f=_[_0x4298('0x3e')]({},_0x25096f,_0x16d918[_0x4298('0x45')]);return db[_0x4298('0x2b')][_0x4298('0x46')](_0x25096f)['then'](handleEntityNotFound(_0x5a2163,null))['then'](respondWithResult(_0x5a2163,null))[_0x4298('0x43')](handleError(_0x5a2163,null));};exports[_0x4298('0x47')]=function(_0x9c1764,_0x5051e0){return db['SquareRecording'][_0x4298('0x47')](_0x9c1764[_0x4298('0x48')],{})[_0x4298('0x24')](respondWithResult(_0x5051e0,0xc9))[_0x4298('0x43')](handleError(_0x5051e0,null));};exports['update']=function(_0x5bdc0b,_0x2b063e){if(_0x5bdc0b[_0x4298('0x48')]['id']){delete _0x5bdc0b[_0x4298('0x48')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x5bdc0b[_0x4298('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b063e,null))[_0x4298('0x24')](saveUpdates(_0x5bdc0b['body'],null))[_0x4298('0x24')](respondWithResult(_0x2b063e,null))[_0x4298('0x43')](handleError(_0x2b063e,null));};exports['download']=function(_0x4992e1,_0x40ff3d,_0x50d1d6){var _0x3cd6c6=require('../../components/encryptor');var _0x28c2c4=![];var _0x23040d={};if(_0x4992e1['query'][_0x4298('0x2e')]&&_0x4992e1[_0x4298('0x32')]['type']===_0x4298('0x4a')){_0x23040d[_0x4298('0x4a')]=_0x4992e1['params']['id'];}else{_0x23040d['id']=_0x4992e1[_0x4298('0x49')]['id'];}return db[_0x4298('0x2b')][_0x4298('0x46')]({'where':_0x23040d,'attributes':['id',_0x4298('0x4b'),_0x4298('0x4c')],'raw':!![]})[_0x4298('0x24')](handleEntityNotFound(_0x40ff3d,null))[_0x4298('0x24')](function(_0x2cb889){if(_0x2cb889){var _0x5e0891=_0x2cb889[_0x4298('0x4b')];var _0x5c3e06=util[_0x4298('0x4d')](_0x4298('0x4e'),_0x5e0891);if(fs[_0x4298('0x4f')](_0x5c3e06)){_0x28c2c4=!![];return _0x3cd6c6[_0x4298('0x50')](_0x5c3e06,_0x5e0891,config[_0x4298('0x51')][_0x4298('0x52')])[_0x4298('0x24')](function(){return _0x2cb889;});}return _0x2cb889;}})[_0x4298('0x24')](function(_0x32fe5c){if(_0x32fe5c){var _0x1d5e50=_0x32fe5c[_0x4298('0x4b')];if(!fs['existsSync'](_0x1d5e50)){throw new db[(_0x4298('0x53'))]['ValidationError'](_0x4298('0x54'));}if(_0x32fe5c[_0x4298('0x4c')]){return _0x40ff3d[_0x4298('0x55')](_0x1d5e50,_0x32fe5c['filename']+path[_0x4298('0x56')](_0x1d5e50),function(){if(_0x28c2c4){fs[_0x4298('0x57')](_0x1d5e50);}});}else{return _0x40ff3d['download'](_0x1d5e50,function(_0x4187e2){if(_0x28c2c4){fs[_0x4298('0x57')](_0x1d5e50);}});}}})[_0x4298('0x43')](function(_0x10384f){if(_0x10384f[_0x4298('0x58')]===_0x4298('0x54')){_0x40ff3d[_0x4298('0x19')](0x194)[_0x4298('0x59')](_0x4298('0x5a'));}else{return handleError(_0x40ff3d,null);}});};exports[_0x4298('0x25')]=function(_0x3ba28d,_0x5966d7){return db[_0x4298('0x2b')][_0x4298('0x46')]({'where':{'id':_0x3ba28d[_0x4298('0x49')]['id']}})[_0x4298('0x24')](function(_0x932bda){if(_['isNil'](_0x932bda)){throw new ReferenceError('Entity\x20not\x20found');}return _0x932bda;})[_0x4298('0x24')](function(_0x33fac6){var _0x75c748=_0x33fac6[_0x4298('0x4b')];logger[_0x4298('0x5b')]('cancellazione\x20fisica\x20documento\x20%s',_0x75c748);if(!_['isNil'](_0x33fac6[_0x4298('0x4b')])&&fs[_0x4298('0x4f')](_0x75c748)){logger[_0x4298('0x5b')](_0x4298('0x5c')+_0x75c748+_0x4298('0x5d'));fs[_0x4298('0x5e')](_0x75c748);}_0x75c748=_0x75c748+_0x4298('0x5f');if(!_[_0x4298('0x60')](_0x33fac6[_0x4298('0x4b')])&&fs['existsSync'](_0x75c748)){logger[_0x4298('0x5b')](_0x4298('0x5c')+_0x75c748+_0x4298('0x5d'));fs['unlinkSync'](_0x75c748);}return _0x33fac6;})[_0x4298('0x24')](function(_0x1b4564){if(!_0x1b4564)throw new InternalError();return _0x1b4564[_0x4298('0x25')]();})[_0x4298('0x24')](function(){_0x5966d7['status'](0xcc)[_0x4298('0x26')]();})['catch'](handleError(_0x5966d7,null));}; \ No newline at end of file +var _0xd121=['Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','recording','ValidationError','unlink','message','SquareRecording\x20not\x20found'];(function(_0x57bbd7,_0x5ada0d){var _0x476213=function(_0x416a01){while(--_0x416a01){_0x57bbd7['push'](_0x57bbd7['shift']());}};_0x476213(++_0x5ada0d);}(_0xd121,0x1ed));var _0x1d12=function(_0x171a70,_0x583c66){_0x171a70=_0x171a70-0x0;var _0x31026c=_0xd121[_0x171a70];return _0x31026c;};'use strict';var emlformat=require(_0x1d12('0x0'));var rimraf=require(_0x1d12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d12('0x2'));var rp=require(_0x1d12('0x3'));var moment=require(_0x1d12('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1d12('0x5'));var util=require(_0x1d12('0x6'));var path=require(_0x1d12('0x7'));var sox=require(_0x1d12('0x8'));var csv=require(_0x1d12('0x9'));var ejs=require(_0x1d12('0xa'));var fs=require('fs');var fs_extra=require(_0x1d12('0xb'));var _=require(_0x1d12('0xc'));var squel=require(_0x1d12('0xd'));var crypto=require(_0x1d12('0xe'));var jsforce=require(_0x1d12('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1d12('0x9'));var querystring=require(_0x1d12('0x10'));var Papa=require(_0x1d12('0x11'));var Redis=require(_0x1d12('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1d12('0x13'));var as=require(_0x1d12('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d12('0x15'))(_0x1d12('0x16'));var utils=require('../../config/utils');var config=require(_0x1d12('0x17'));var licenseUtil=require(_0x1d12('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3b95,_0x316df3){_0x316df3=_0x316df3||0xcc;return function(_0x156ec1){if(_0x156ec1){return _0x5b3b95['sendStatus'](_0x316df3);}return _0x5b3b95[_0x1d12('0x19')](_0x316df3)['end']();};}function respondWithResult(_0x3a99ec,_0x40f34d){_0x40f34d=_0x40f34d||0xc8;return function(_0x4e2f35){if(_0x4e2f35){return _0x3a99ec['status'](_0x40f34d)['json'](_0x4e2f35);}};}function respondWithFilteredResult(_0x365fed,_0x3ea8b3){return function(_0x13e6c1){if(_0x13e6c1){var _0x1c3759=typeof _0x3ea8b3[_0x1d12('0x1a')]===_0x1d12('0x1b')&&typeof _0x3ea8b3[_0x1d12('0x1c')]==='undefined';var _0x31e338=_0x13e6c1[_0x1d12('0x1d')];var _0x5e4db6=_0x1c3759?0x0:_0x3ea8b3[_0x1d12('0x1a')];var _0x31c2f4=_0x1c3759?_0x13e6c1[_0x1d12('0x1d')]:_0x3ea8b3[_0x1d12('0x1a')]+_0x3ea8b3['limit'];var _0x275a43;if(_0x31c2f4>=_0x31e338){_0x31c2f4=_0x31e338;_0x275a43=0xc8;}else{_0x275a43=0xce;}_0x365fed[_0x1d12('0x19')](_0x275a43);return _0x365fed[_0x1d12('0x1e')]('Content-Range',_0x5e4db6+'-'+_0x31c2f4+'/'+_0x31e338)[_0x1d12('0x1f')](_0x13e6c1);}return null;};}function patchUpdates(_0x2480ff){return function(_0x559f76){try{jsonpatch[_0x1d12('0x20')](_0x559f76,_0x2480ff,!![]);}catch(_0x159e0e){return BPromise[_0x1d12('0x21')](_0x159e0e);}return _0x559f76[_0x1d12('0x22')]();};}function saveUpdates(_0x39dfe5,_0x326c7a){return function(_0x2a158a){if(_0x2a158a){return _0x2a158a[_0x1d12('0x23')](_0x39dfe5)['then'](function(_0x26b720){return _0x26b720;});}return null;};}function removeEntity(_0x1ce01c,_0x411d06){return function(_0x5d1eb5){if(_0x5d1eb5){return _0x5d1eb5[_0x1d12('0x24')]()[_0x1d12('0x25')](function(){_0x1ce01c[_0x1d12('0x19')](0xcc)[_0x1d12('0x26')]();});}};}function handleEntityNotFound(_0x19673b,_0x49f423){return function(_0x5413da){if(!_0x5413da){_0x19673b[_0x1d12('0x27')](0x194);}return _0x5413da;};}function handleError(_0x2b6a13,_0x19c011){_0x19c011=_0x19c011||0x1f4;return function(_0x48dbf9){logger[_0x1d12('0x28')](_0x48dbf9[_0x1d12('0x29')]);if(_0x48dbf9[_0x1d12('0x2a')]){delete _0x48dbf9[_0x1d12('0x2a')];}_0x2b6a13[_0x1d12('0x19')](_0x19c011)[_0x1d12('0x2b')](_0x48dbf9);};}exports[_0x1d12('0x2c')]=function(_0x1cbaf6,_0x523c93){var _0x372c96={},_0x2b1dbf={},_0x59e98a={'count':0x0,'rows':[]};var _0x14cd14=_[_0x1d12('0x2d')](db[_0x1d12('0x2e')][_0x1d12('0x2f')],function(_0x6884bd){return{'name':_0x6884bd['fieldName'],'type':_0x6884bd[_0x1d12('0x30')][_0x1d12('0x31')]};});_0x2b1dbf[_0x1d12('0x32')]=_[_0x1d12('0x2d')](_0x14cd14,_0x1d12('0x2a'));_0x2b1dbf['query']=_[_0x1d12('0x33')](_0x1cbaf6[_0x1d12('0x34')]);_0x2b1dbf[_0x1d12('0x35')]=_['intersection'](_0x2b1dbf[_0x1d12('0x32')],_0x2b1dbf['query']);_0x372c96[_0x1d12('0x36')]=_[_0x1d12('0x37')](_0x2b1dbf[_0x1d12('0x32')],qs[_0x1d12('0x38')](_0x1cbaf6['query'][_0x1d12('0x38')]));_0x372c96[_0x1d12('0x36')]=_0x372c96[_0x1d12('0x36')][_0x1d12('0x39')]?_0x372c96[_0x1d12('0x36')]:_0x2b1dbf[_0x1d12('0x32')];if(!_0x1cbaf6[_0x1d12('0x34')][_0x1d12('0x3a')](_0x1d12('0x3b'))){_0x372c96[_0x1d12('0x1c')]=qs[_0x1d12('0x1c')](_0x1cbaf6[_0x1d12('0x34')][_0x1d12('0x1c')]);_0x372c96[_0x1d12('0x1a')]=qs[_0x1d12('0x1a')](_0x1cbaf6['query']['offset']);}_0x372c96['order']=qs[_0x1d12('0x3c')](_0x1cbaf6[_0x1d12('0x34')]['sort']);_0x372c96['where']=qs['filters'](_[_0x1d12('0x3d')](_0x1cbaf6[_0x1d12('0x34')],_0x2b1dbf[_0x1d12('0x35')]),_0x14cd14);if(_0x1cbaf6[_0x1d12('0x34')][_0x1d12('0x3e')]){_0x372c96['where']=_[_0x1d12('0x3f')](_0x372c96['where'],{'$or':_[_0x1d12('0x2d')](_0x14cd14,function(_0x250eb7){if(_0x250eb7[_0x1d12('0x30')]!==_0x1d12('0x40')){var _0x433430={};_0x433430[_0x250eb7[_0x1d12('0x2a')]]={'$like':'%'+_0x1cbaf6['query']['filter']+'%'};return _0x433430;}})});}_0x372c96=_[_0x1d12('0x3f')]({},_0x372c96,_0x1cbaf6[_0x1d12('0x41')]);var _0x28989d={'where':_0x372c96['where']};return db[_0x1d12('0x2e')][_0x1d12('0x1d')](_0x28989d)[_0x1d12('0x25')](function(_0x5ee4ed){_0x59e98a[_0x1d12('0x1d')]=_0x5ee4ed;if(_0x1cbaf6[_0x1d12('0x34')]['includeAll']){_0x372c96['include']=[{'all':!![]}];}return db[_0x1d12('0x2e')][_0x1d12('0x42')](_0x372c96);})[_0x1d12('0x25')](function(_0x3bb99e){_0x59e98a[_0x1d12('0x43')]=_0x3bb99e;return _0x59e98a;})['then'](respondWithFilteredResult(_0x523c93,_0x372c96))['catch'](handleError(_0x523c93,null));};exports[_0x1d12('0x44')]=function(_0x46dae0,_0xe8dedd){var _0xce988={'raw':!![],'where':{'id':_0x46dae0[_0x1d12('0x45')]['id']}},_0x185be0={};_0x185be0[_0x1d12('0x32')]=_[_0x1d12('0x33')](db[_0x1d12('0x2e')][_0x1d12('0x2f')]);_0x185be0[_0x1d12('0x34')]=_[_0x1d12('0x33')](_0x46dae0[_0x1d12('0x34')]);_0x185be0[_0x1d12('0x35')]=_[_0x1d12('0x37')](_0x185be0[_0x1d12('0x32')],_0x185be0[_0x1d12('0x34')]);_0xce988[_0x1d12('0x36')]=_[_0x1d12('0x37')](_0x185be0[_0x1d12('0x32')],qs[_0x1d12('0x38')](_0x46dae0[_0x1d12('0x34')][_0x1d12('0x38')]));_0xce988['attributes']=_0xce988[_0x1d12('0x36')][_0x1d12('0x39')]?_0xce988[_0x1d12('0x36')]:_0x185be0[_0x1d12('0x32')];if(_0x46dae0[_0x1d12('0x34')][_0x1d12('0x46')]){_0xce988[_0x1d12('0x47')]=[{'all':!![]}];}_0xce988=_[_0x1d12('0x3f')]({},_0xce988,_0x46dae0[_0x1d12('0x41')]);return db[_0x1d12('0x2e')][_0x1d12('0x48')](_0xce988)[_0x1d12('0x25')](handleEntityNotFound(_0xe8dedd,null))['then'](respondWithResult(_0xe8dedd,null))[_0x1d12('0x49')](handleError(_0xe8dedd,null));};exports[_0x1d12('0x4a')]=function(_0x350ea8,_0x549cd7){return db['SquareRecording']['create'](_0x350ea8[_0x1d12('0x4b')],{})[_0x1d12('0x25')](respondWithResult(_0x549cd7,0xc9))['catch'](handleError(_0x549cd7,null));};exports[_0x1d12('0x23')]=function(_0x444ec1,_0x2049da){if(_0x444ec1[_0x1d12('0x4b')]['id']){delete _0x444ec1[_0x1d12('0x4b')]['id'];}return db[_0x1d12('0x2e')]['find']({'where':{'id':_0x444ec1[_0x1d12('0x45')]['id']}})['then'](handleEntityNotFound(_0x2049da,null))[_0x1d12('0x25')](saveUpdates(_0x444ec1[_0x1d12('0x4b')],null))[_0x1d12('0x25')](respondWithResult(_0x2049da,null))[_0x1d12('0x49')](handleError(_0x2049da,null));};exports[_0x1d12('0x4c')]=function(_0x212e47,_0xe4ede7,_0x5ae930){var _0x599f0d=require(_0x1d12('0x4d'));var _0x4cfec7=![];var _0x2627bf={};if(_0x212e47[_0x1d12('0x34')][_0x1d12('0x30')]&&_0x212e47['query']['type']===_0x1d12('0x4e')){_0x2627bf['uniqueid']=_0x212e47['params']['id'];}else{_0x2627bf['id']=_0x212e47[_0x1d12('0x45')]['id'];}return db['SquareRecording'][_0x1d12('0x48')]({'where':_0x2627bf,'attributes':['id',_0x1d12('0x4f'),_0x1d12('0x50')],'raw':!![]})[_0x1d12('0x25')](handleEntityNotFound(_0xe4ede7,null))['then'](function(_0x5516b4){if(_0x5516b4){var _0x12c134=_0x5516b4[_0x1d12('0x4f')];var _0x55a070=util[_0x1d12('0x51')](_0x1d12('0x52'),_0x12c134);if(fs[_0x1d12('0x53')](_0x55a070)){_0x4cfec7=!![];return _0x599f0d['decryptFile'](_0x55a070,_0x12c134,config['secrets'][_0x1d12('0x54')])['then'](function(){return _0x5516b4;});}return _0x5516b4;}})['then'](function(_0x5b2c15){if(_0x5b2c15){var _0x1470b8=_0x5b2c15[_0x1d12('0x4f')];if(!fs[_0x1d12('0x53')](_0x1470b8)){throw new db['Sequelize'][(_0x1d12('0x55'))]('SquareRecording\x20not\x20found');}if(_0x5b2c15['filename']){return _0xe4ede7[_0x1d12('0x4c')](_0x1470b8,_0x5b2c15[_0x1d12('0x50')]+path['extname'](_0x1470b8),function(){if(_0x4cfec7){fs[_0x1d12('0x56')](_0x1470b8);}});}else{return _0xe4ede7[_0x1d12('0x4c')](_0x1470b8,function(_0x38c605){if(_0x4cfec7){fs[_0x1d12('0x56')](_0x1470b8);}});}}})[_0x1d12('0x49')](function(_0x16243b){if(_0x16243b[_0x1d12('0x57')]===_0x1d12('0x58')){_0xe4ede7[_0x1d12('0x19')](0x194)['send'](_0x1d12('0x59'));}else{return handleError(_0xe4ede7,null);}});};exports['destroy']=function(_0x569dc1,_0x48845b){return db['SquareRecording']['find']({'where':{'id':_0x569dc1[_0x1d12('0x45')]['id']}})[_0x1d12('0x25')](function(_0x82a70f){if(_[_0x1d12('0x5a')](_0x82a70f)){throw new ReferenceError(_0x1d12('0x5b'));}return _0x82a70f;})[_0x1d12('0x25')](function(_0xb7b9a4){var _0xf135d2=_0xb7b9a4['savePath'];logger['info'](_0x1d12('0x5c'),_0xf135d2);if(!_[_0x1d12('0x5a')](_0xb7b9a4[_0x1d12('0x4f')])&&fs[_0x1d12('0x53')](_0xf135d2)){logger[_0x1d12('0x5d')](_0x1d12('0x5e')+_0xf135d2+_0x1d12('0x5f'));fs['unlinkSync'](_0xf135d2);}_0xf135d2=_0xf135d2+'.cypher';if(!_[_0x1d12('0x5a')](_0xb7b9a4[_0x1d12('0x4f')])&&fs[_0x1d12('0x53')](_0xf135d2)){logger[_0x1d12('0x5d')](_0x1d12('0x5e')+_0xf135d2+_0x1d12('0x5f'));fs[_0x1d12('0x60')](_0xf135d2);}return _0xb7b9a4;})[_0x1d12('0x25')](function(_0x6fafad){if(!_0x6fafad)throw new InternalError();return _0x6fafad['destroy']();})[_0x1d12('0x25')](function(){_0x48845b[_0x1d12('0x19')](0xcc)[_0x1d12('0x26')]();})[_0x1d12('0x49')](handleError(_0x48845b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index a3ac267..2354251 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 _0xa7db=['./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa7db,0xbf));var _0xba7d=function(_0x448d13,_0x89c97){_0x448d13=_0x448d13-0x0;var _0xf6c8c9=_0xa7db[_0x448d13];return _0xf6c8c9;};'use strict';var _=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var logger=require(_0xba7d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba7d('0x3'));var fs=require('fs');var path=require(_0xba7d('0x4'));var rimraf=require(_0xba7d('0x5'));var config=require(_0xba7d('0x6'));var attributes=require(_0xba7d('0x7'));module['exports']=function(_0x2f6d8d,_0x257384){return _0x2f6d8d[_0xba7d('0x8')](_0xba7d('0x9'),attributes,{'tableName':_0xba7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d04=['../../config/environment','./squareRecording.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4489f2,_0x1f9128){var _0x5cc527=function(_0x44201f){while(--_0x44201f){_0x4489f2['push'](_0x4489f2['shift']());}};_0x5cc527(++_0x1f9128);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));module[_0x43d0('0xa')]=function(_0x617bf,_0x5e284f){return _0x617bf['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 13ea02a..9e76fee 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 _0xebcd=['catch','SquareRecording','create','options','raw','CreateSquareRecording','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3d2cd0,_0x31d4a9){var _0x47b219=function(_0x4687d0){while(--_0x4687d0){_0x3d2cd0['push'](_0x3d2cd0['shift']());}};_0x47b219(++_0x31d4a9);}(_0xebcd,0x18c));var _0xdebc=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0xebcd[_0x49cb71];return _0x3a50fd;};'use strict';var _=require(_0xdebc('0x0'));var util=require('util');var moment=require(_0xdebc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdebc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdebc('0x3'));var logger=require('../../config/logger')(_0xdebc('0x4'));var config=require(_0xdebc('0x5'));var jayson=require(_0xdebc('0x6'));var client=jayson[_0xdebc('0x7')][_0xdebc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x435862,_0x54956e,_0x1c94c3){return new BPromise(function(_0x51129e,_0x5a862b){return client[_0xdebc('0x9')](_0x435862,_0x1c94c3)[_0xdebc('0xa')](function(_0x4ce9ba){logger[_0xdebc('0xb')](_0xdebc('0xc'),_0x54956e,_0xdebc('0xd'));logger[_0xdebc('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x54956e,'request\x20sent',JSON[_0xdebc('0xf')](_0x4ce9ba));if(_0x4ce9ba[_0xdebc('0x10')]){if(_0x4ce9ba[_0xdebc('0x10')][_0xdebc('0x11')]===0x1f4){logger[_0xdebc('0x10')](_0xdebc('0xc'),_0x54956e,_0x4ce9ba[_0xdebc('0x10')][_0xdebc('0x12')]);return _0x5a862b(_0x4ce9ba[_0xdebc('0x10')][_0xdebc('0x12')]);}logger[_0xdebc('0x10')](_0xdebc('0xc'),_0x54956e,_0x4ce9ba[_0xdebc('0x10')][_0xdebc('0x12')]);return _0x51129e(_0x4ce9ba[_0xdebc('0x10')][_0xdebc('0x12')]);}else{logger[_0xdebc('0xb')](_0xdebc('0xc'),_0x54956e,_0xdebc('0xd'));_0x51129e(_0x4ce9ba[_0xdebc('0x13')][_0xdebc('0x12')]);}})[_0xdebc('0x14')](function(_0x388c7b){logger[_0xdebc('0x10')](_0xdebc('0xc'),_0x54956e,_0x388c7b);_0x5a862b(_0x388c7b);});});}exports['CreateSquareRecording']=function(_0x4d8635){var _0x431b09=this;return new Promise(function(_0x57405c,_0x3e9526){return db[_0xdebc('0x15')][_0xdebc('0x16')](_0x4d8635['body'],{'raw':_0x4d8635[_0xdebc('0x17')]?_0x4d8635[_0xdebc('0x17')][_0xdebc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x13c349){logger['info'](_0xdebc('0x19'),_0x4d8635);logger['debug']('CreateSquareRecording',_0x4d8635,JSON[_0xdebc('0xf')](_0x13c349));_0x57405c(_0x13c349);})[_0xdebc('0x14')](function(_0x3d2f9a){logger[_0xdebc('0x10')]('CreateSquareRecording',_0x3d2f9a[_0xdebc('0x12')],_0x4d8635);_0x3e9526(_0x431b09[_0xdebc('0x10')](0x1f4,_0x3d2f9a[_0xdebc('0x12')]));});});}; \ No newline at end of file +var _0x67f8=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3f04e5,_0x4457eb){var _0x261e65=function(_0x30764c){while(--_0x30764c){_0x3f04e5['push'](_0x3f04e5['shift']());}};_0x261e65(++_0x4457eb);}(_0x67f8,0x88));var _0x867f=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x67f8[_0x1098db];return _0x14f090;};'use strict';var _=require(_0x867f('0x0'));var util=require(_0x867f('0x1'));var moment=require('moment');var BPromise=require(_0x867f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x867f('0x3'));var db=require(_0x867f('0x4'))['db'];var utils=require(_0x867f('0x5'));var logger=require('../../config/logger')(_0x867f('0x6'));var config=require(_0x867f('0x7'));var jayson=require(_0x867f('0x8'));var client=jayson[_0x867f('0x9')][_0x867f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ef311,_0x2af7eb,_0x4b3d10){return new BPromise(function(_0x2f6cec,_0x24071d){return client[_0x867f('0xb')](_0x3ef311,_0x4b3d10)[_0x867f('0xc')](function(_0x482c69){logger[_0x867f('0xd')](_0x867f('0xe'),_0x2af7eb,_0x867f('0xf'));logger[_0x867f('0x10')](_0x867f('0x11'),_0x2af7eb,_0x867f('0xf'),JSON['stringify'](_0x482c69));if(_0x482c69[_0x867f('0x12')]){if(_0x482c69['error'][_0x867f('0x13')]===0x1f4){logger[_0x867f('0x12')](_0x867f('0xe'),_0x2af7eb,_0x482c69[_0x867f('0x12')][_0x867f('0x14')]);return _0x24071d(_0x482c69[_0x867f('0x12')][_0x867f('0x14')]);}logger[_0x867f('0x12')](_0x867f('0xe'),_0x2af7eb,_0x482c69['error'][_0x867f('0x14')]);return _0x2f6cec(_0x482c69[_0x867f('0x12')][_0x867f('0x14')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x2af7eb,_0x867f('0xf'));_0x2f6cec(_0x482c69[_0x867f('0x15')][_0x867f('0x14')]);}})[_0x867f('0x16')](function(_0x1b808f){logger['error'](_0x867f('0xe'),_0x2af7eb,_0x1b808f);_0x24071d(_0x1b808f);});});}exports[_0x867f('0x17')]=function(_0x9e22b4){var _0xd0b0b5=this;return new Promise(function(_0x115a9d,_0x377f16){return db[_0x867f('0x18')][_0x867f('0x19')](_0x9e22b4[_0x867f('0x1a')],{'raw':_0x9e22b4[_0x867f('0x1b')]?_0x9e22b4[_0x867f('0x1b')][_0x867f('0x1c')]===undefined?!![]:![]:!![]})[_0x867f('0xc')](function(_0x26a144){logger['info'](_0x867f('0x17'),_0x9e22b4);logger[_0x867f('0x10')](_0x867f('0x17'),_0x9e22b4,JSON[_0x867f('0x1d')](_0x26a144));_0x115a9d(_0x26a144);})[_0x867f('0x16')](function(_0x23f07a){logger[_0x867f('0x12')](_0x867f('0x17'),_0x23f07a[_0x867f('0x14')],_0x9e22b4);_0x377f16(_0xd0b0b5[_0x867f('0x12')](0x1f4,_0x23f07a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 1493d18..543b99f 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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2df94b,_0x2ec2ad){var _0xecf896=function(_0x4f6708){while(--_0x4f6708){_0x2df94b['push'](_0x2df94b['shift']());}};_0xecf896(++_0x2ec2ad);}(_0xb10b,0x12a));var _0xbb10=function(_0x18fb4c,_0x578f22){_0x18fb4c=_0x18fb4c-0x0;var _0x4a75b3=_0xb10b[_0x18fb4c];return _0x4a75b3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _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(_0x5266b9,_0x30e19d){var _0x5afd8c=function(_0x2d91f7){while(--_0x2d91f7){_0x5266b9['push'](_0x5266b9['shift']());}};_0x5afd8c(++_0x30e19d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'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 24806af..a341c90 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 _0xc0fd=['DATE','sequelize','STRING'];(function(_0x13ef5c,_0x5a920c){var _0x7fab14=function(_0x17cc5a){while(--_0x17cc5a){_0x13ef5c['push'](_0x13ef5c['shift']());}};_0x7fab14(++_0x5a920c);}(_0xc0fd,0x1c6));var _0xdc0f=function(_0x181d19,_0x46822d){_0x181d19=_0x181d19-0x0;var _0x227c31=_0xc0fd[_0x181d19];return _0x227c31;};'use strict';var Sequelize=require(_0xdc0f('0x0'));module['exports']={'network':{'type':Sequelize[_0xdc0f('0x1')]},'network_script':{'type':Sequelize[_0xdc0f('0x1')]},'request':{'type':Sequelize[_0xdc0f('0x1')]},'channel':{'type':Sequelize[_0xdc0f('0x1')]},'language':{'type':Sequelize[_0xdc0f('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdc0f('0x1')]},'version':{'type':Sequelize[_0xdc0f('0x1')]},'callerid':{'type':Sequelize[_0xdc0f('0x1')]},'calleridname':{'type':Sequelize[_0xdc0f('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xdc0f('0x1')]},'callington':{'type':Sequelize[_0xdc0f('0x1')]},'callingtns':{'type':Sequelize[_0xdc0f('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xdc0f('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xdc0f('0x1')]},'priority':{'type':Sequelize[_0xdc0f('0x1')]},'enhanced':{'type':Sequelize[_0xdc0f('0x1')]},'accountcode':{'type':Sequelize[_0xdc0f('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xdc0f('0x1')]},'joinAt':{'type':Sequelize[_0xdc0f('0x2')]},'leaveAt':{'type':Sequelize[_0xdc0f('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6054=['BOOLEAN','sequelize','STRING'];(function(_0x2612fa,_0x5e9828){var _0x4aef66=function(_0x1c6ad3){while(--_0x1c6ad3){_0x2612fa['push'](_0x2612fa['shift']());}};_0x4aef66(++_0x5e9828);}(_0x6054,0x127));var _0x4605=function(_0xbbbeae,_0x4a414a){_0xbbbeae=_0xbbbeae-0x0;var _0x1cb9c9=_0x6054[_0xbbbeae];return _0x1cb9c9;};'use strict';var Sequelize=require(_0x4605('0x0'));module['exports']={'network':{'type':Sequelize[_0x4605('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x4605('0x1')]},'channel':{'type':Sequelize[_0x4605('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4605('0x1')]},'version':{'type':Sequelize[_0x4605('0x1')]},'callerid':{'type':Sequelize[_0x4605('0x1')]},'calleridname':{'type':Sequelize[_0x4605('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x4605('0x1')]},'callington':{'type':Sequelize[_0x4605('0x1')]},'callingtns':{'type':Sequelize[_0x4605('0x1')]},'dnid':{'type':Sequelize[_0x4605('0x1')]},'rdnis':{'type':Sequelize[_0x4605('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4605('0x1')]},'priority':{'type':Sequelize[_0x4605('0x1')]},'enhanced':{'type':Sequelize[_0x4605('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x4605('0x1')]},'project_name':{'type':Sequelize[_0x4605('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x4605('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 19dd571..7b7035b 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 _0x7f26=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','name','index','SquareReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','include','rows','catch','show','fields','merge','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x4f0464,_0x26f314){var _0xc4fd1=function(_0xe6c3e1){while(--_0xe6c3e1){_0x4f0464['push'](_0x4f0464['shift']());}};_0xc4fd1(++_0x26f314);}(_0x7f26,0x86));var _0x67f2=function(_0xbb35b2,_0x327e3d){_0xbb35b2=_0xbb35b2-0x0;var _0x4c1b79=_0x7f26[_0xbb35b2];return _0x4c1b79;};'use strict';var emlformat=require(_0x67f2('0x0'));var rimraf=require(_0x67f2('0x1'));var zipdir=require(_0x67f2('0x2'));var jsonpatch=require(_0x67f2('0x3'));var rp=require(_0x67f2('0x4'));var moment=require(_0x67f2('0x5'));var BPromise=require(_0x67f2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x67f2('0x7'));var sox=require(_0x67f2('0x8'));var csv=require(_0x67f2('0x9'));var ejs=require(_0x67f2('0xa'));var fs=require('fs');var fs_extra=require(_0x67f2('0xb'));var _=require(_0x67f2('0xc'));var squel=require(_0x67f2('0xd'));var crypto=require('crypto');var jsforce=require(_0x67f2('0xe'));var deskjs=require(_0x67f2('0xf'));var toCsv=require(_0x67f2('0x9'));var querystring=require(_0x67f2('0x10'));var Papa=require('papaparse');var Redis=require(_0x67f2('0x11'));var authService=require(_0x67f2('0x12'));var qs=require(_0x67f2('0x13'));var as=require(_0x67f2('0x14'));var hardwareService=require(_0x67f2('0x15'));var logger=require(_0x67f2('0x16'))(_0x67f2('0x17'));var utils=require(_0x67f2('0x18'));var config=require(_0x67f2('0x19'));var licenseUtil=require(_0x67f2('0x1a'));var db=require(_0x67f2('0x1b'))['db'];function respondWithStatusCode(_0x39fc30,_0x2f30a4){_0x2f30a4=_0x2f30a4||0xcc;return function(_0x1ad578){if(_0x1ad578){return _0x39fc30[_0x67f2('0x1c')](_0x2f30a4);}return _0x39fc30[_0x67f2('0x1d')](_0x2f30a4)[_0x67f2('0x1e')]();};}function respondWithResult(_0x2ccd5e,_0x54622d){_0x54622d=_0x54622d||0xc8;return function(_0x1868af){if(_0x1868af){return _0x2ccd5e[_0x67f2('0x1d')](_0x54622d)[_0x67f2('0x1f')](_0x1868af);}};}function respondWithFilteredResult(_0x409e81,_0x3988e4){return function(_0x331297){if(_0x331297){var _0x174c85=typeof _0x3988e4[_0x67f2('0x20')]===_0x67f2('0x21')&&typeof _0x3988e4[_0x67f2('0x22')]===_0x67f2('0x21');var _0x23e950=_0x331297['count'];var _0x29f36b=_0x174c85?0x0:_0x3988e4[_0x67f2('0x20')];var _0x24bac9=_0x174c85?_0x331297[_0x67f2('0x23')]:_0x3988e4['offset']+_0x3988e4['limit'];var _0x1a8b89;if(_0x24bac9>=_0x23e950){_0x24bac9=_0x23e950;_0x1a8b89=0xc8;}else{_0x1a8b89=0xce;}_0x409e81[_0x67f2('0x1d')](_0x1a8b89);return _0x409e81[_0x67f2('0x24')]('Content-Range',_0x29f36b+'-'+_0x24bac9+'/'+_0x23e950)[_0x67f2('0x1f')](_0x331297);}return null;};}function patchUpdates(_0x1b8dd6){return function(_0x1b6d32){try{jsonpatch[_0x67f2('0x25')](_0x1b6d32,_0x1b8dd6,!![]);}catch(_0x34c3c7){return BPromise['reject'](_0x34c3c7);}return _0x1b6d32[_0x67f2('0x26')]();};}function saveUpdates(_0x76643b,_0x2adffe){return function(_0x585c94){if(_0x585c94){return _0x585c94['update'](_0x76643b)[_0x67f2('0x27')](function(_0x175045){return _0x175045;});}return null;};}function removeEntity(_0x328bec,_0x30667c){return function(_0x1badfa){if(_0x1badfa){return _0x1badfa[_0x67f2('0x28')]()[_0x67f2('0x27')](function(){_0x328bec[_0x67f2('0x1d')](0xcc)[_0x67f2('0x1e')]();});}};}function handleEntityNotFound(_0x46c0c9,_0x10f183){return function(_0x5ab0fd){if(!_0x5ab0fd){_0x46c0c9[_0x67f2('0x1c')](0x194);}return _0x5ab0fd;};}function handleError(_0x4f5cf,_0x1488a3){_0x1488a3=_0x1488a3||0x1f4;return function(_0xce18dd){logger[_0x67f2('0x29')](_0xce18dd['stack']);if(_0xce18dd['name']){delete _0xce18dd[_0x67f2('0x2a')];}_0x4f5cf[_0x67f2('0x1d')](_0x1488a3)['send'](_0xce18dd);};}exports[_0x67f2('0x2b')]=function(_0x43ae6f,_0x3f7d05){var _0xcde194={},_0x41ce47={},_0x42900e={'count':0x0,'rows':[]};var _0x366981=_['map'](db[_0x67f2('0x2c')][_0x67f2('0x2d')],function(_0x467048){return{'name':_0x467048['fieldName'],'type':_0x467048[_0x67f2('0x2e')][_0x67f2('0x2f')]};});_0x41ce47[_0x67f2('0x30')]=_[_0x67f2('0x31')](_0x366981,_0x67f2('0x2a'));_0x41ce47[_0x67f2('0x32')]=_[_0x67f2('0x33')](_0x43ae6f[_0x67f2('0x32')]);_0x41ce47[_0x67f2('0x34')]=_[_0x67f2('0x35')](_0x41ce47[_0x67f2('0x30')],_0x41ce47['query']);_0xcde194[_0x67f2('0x36')]=_[_0x67f2('0x35')](_0x41ce47[_0x67f2('0x30')],qs['fields'](_0x43ae6f[_0x67f2('0x32')]['fields']));_0xcde194[_0x67f2('0x36')]=_0xcde194['attributes'][_0x67f2('0x37')]?_0xcde194[_0x67f2('0x36')]:_0x41ce47[_0x67f2('0x30')];if(!_0x43ae6f[_0x67f2('0x32')][_0x67f2('0x38')](_0x67f2('0x39'))){_0xcde194[_0x67f2('0x22')]=qs[_0x67f2('0x22')](_0x43ae6f[_0x67f2('0x32')][_0x67f2('0x22')]);_0xcde194[_0x67f2('0x20')]=qs[_0x67f2('0x20')](_0x43ae6f[_0x67f2('0x32')]['offset']);}_0xcde194['order']=qs[_0x67f2('0x3a')](_0x43ae6f[_0x67f2('0x32')][_0x67f2('0x3a')]);_0xcde194[_0x67f2('0x3b')]=qs[_0x67f2('0x34')](_[_0x67f2('0x3c')](_0x43ae6f[_0x67f2('0x32')],_0x41ce47[_0x67f2('0x34')]),_0x366981);if(_0x43ae6f[_0x67f2('0x32')]['filter']){_0xcde194[_0x67f2('0x3b')]=_['merge'](_0xcde194[_0x67f2('0x3b')],{'$or':_['map'](_0x366981,function(_0x4fe8e9){if(_0x4fe8e9[_0x67f2('0x2e')]!=='VIRTUAL'){var _0x3d1641={};_0x3d1641[_0x4fe8e9[_0x67f2('0x2a')]]={'$like':'%'+_0x43ae6f[_0x67f2('0x32')][_0x67f2('0x3d')]+'%'};return _0x3d1641;}})});}_0xcde194=_['merge']({},_0xcde194,_0x43ae6f[_0x67f2('0x3e')]);var _0x4d323a={'where':_0xcde194[_0x67f2('0x3b')]};return db[_0x67f2('0x2c')][_0x67f2('0x23')](_0x4d323a)[_0x67f2('0x27')](function(_0x2eec47){_0x42900e['count']=_0x2eec47;if(_0x43ae6f[_0x67f2('0x32')]['includeAll']){_0xcde194[_0x67f2('0x3f')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0xcde194);})[_0x67f2('0x27')](function(_0x57836a){_0x42900e[_0x67f2('0x40')]=_0x57836a;return _0x42900e;})['then'](respondWithFilteredResult(_0x3f7d05,_0xcde194))[_0x67f2('0x41')](handleError(_0x3f7d05,null));};exports[_0x67f2('0x42')]=function(_0x1533d8,_0x1dad48){var _0x50b88a={'raw':!![],'where':{'id':_0x1533d8['params']['id']}},_0x2a5894={};_0x2a5894['model']=_['keys'](db[_0x67f2('0x2c')][_0x67f2('0x2d')]);_0x2a5894[_0x67f2('0x32')]=_['keys'](_0x1533d8[_0x67f2('0x32')]);_0x2a5894[_0x67f2('0x34')]=_[_0x67f2('0x35')](_0x2a5894[_0x67f2('0x30')],_0x2a5894[_0x67f2('0x32')]);_0x50b88a[_0x67f2('0x36')]=_[_0x67f2('0x35')](_0x2a5894['model'],qs[_0x67f2('0x43')](_0x1533d8[_0x67f2('0x32')][_0x67f2('0x43')]));_0x50b88a['attributes']=_0x50b88a[_0x67f2('0x36')][_0x67f2('0x37')]?_0x50b88a['attributes']:_0x2a5894[_0x67f2('0x30')];if(_0x1533d8[_0x67f2('0x32')]['includeAll']){_0x50b88a[_0x67f2('0x3f')]=[{'all':!![]}];}_0x50b88a=_[_0x67f2('0x44')]({},_0x50b88a,_0x1533d8[_0x67f2('0x3e')]);return db['SquareReport'][_0x67f2('0x45')](_0x50b88a)['then'](handleEntityNotFound(_0x1dad48,null))[_0x67f2('0x27')](respondWithResult(_0x1dad48,null))[_0x67f2('0x41')](handleError(_0x1dad48,null));};exports['create']=function(_0xf978ac,_0x30167d){return db['SquareReport'][_0x67f2('0x46')](_0xf978ac[_0x67f2('0x47')],{})['then'](respondWithResult(_0x30167d,0xc9))[_0x67f2('0x41')](handleError(_0x30167d,null));};exports[_0x67f2('0x48')]=function(_0x57a3ab,_0x3f96be){if(_0x57a3ab[_0x67f2('0x47')]['id']){delete _0x57a3ab[_0x67f2('0x47')]['id'];}return db['SquareReport'][_0x67f2('0x45')]({'where':{'id':_0x57a3ab[_0x67f2('0x49')]['id']}})[_0x67f2('0x27')](handleEntityNotFound(_0x3f96be,null))['then'](saveUpdates(_0x57a3ab[_0x67f2('0x47')],null))[_0x67f2('0x27')](respondWithResult(_0x3f96be,null))[_0x67f2('0x41')](handleError(_0x3f96be,null));};exports[_0x67f2('0x28')]=function(_0x1035f8,_0x359404){return db['SquareReport'][_0x67f2('0x45')]({'where':{'id':_0x1035f8['params']['id']}})[_0x67f2('0x27')](handleEntityNotFound(_0x359404,null))['then'](removeEntity(_0x359404,null))[_0x67f2('0x41')](handleError(_0x359404,null));};exports[_0x67f2('0x4a')]=function(_0x1e6549,_0x20a2e7){return db[_0x67f2('0x2c')][_0x67f2('0x4a')]()[_0x67f2('0x27')](respondWithResult(_0x20a2e7,null))[_0x67f2('0x41')](handleError(_0x20a2e7,null));}; \ No newline at end of file +var _0xb600=['includeAll','include','findAll','rows','catch','show','create','update','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','apply','reject','then','destroy','end','error','stack','name','send','index','SquareReport','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options'];(function(_0x31ac1e,_0x1fadac){var _0x279cae=function(_0x34d637){while(--_0x34d637){_0x31ac1e['push'](_0x31ac1e['shift']());}};_0x279cae(++_0x1fadac);}(_0xb600,0x1ce));var _0x0b60=function(_0x23c550,_0x7e41c4){_0x23c550=_0x23c550-0x0;var _0x5635b1=_0xb600[_0x23c550];return _0x5635b1;};'use strict';var emlformat=require(_0x0b60('0x0'));var rimraf=require(_0x0b60('0x1'));var zipdir=require(_0x0b60('0x2'));var jsonpatch=require(_0x0b60('0x3'));var rp=require(_0x0b60('0x4'));var moment=require(_0x0b60('0x5'));var BPromise=require(_0x0b60('0x6'));var Mustache=require(_0x0b60('0x7'));var util=require('util');var path=require(_0x0b60('0x8'));var sox=require(_0x0b60('0x9'));var csv=require('to-csv');var ejs=require(_0x0b60('0xa'));var fs=require('fs');var fs_extra=require(_0x0b60('0xb'));var _=require('lodash');var squel=require(_0x0b60('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0b60('0xd'));var toCsv=require(_0x0b60('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0b60('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0b60('0x10'));var as=require(_0x0b60('0x11'));var hardwareService=require(_0x0b60('0x12'));var logger=require(_0x0b60('0x13'))(_0x0b60('0x14'));var utils=require('../../config/utils');var config=require(_0x0b60('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b60('0x16'))['db'];function respondWithStatusCode(_0x5d87fe,_0x1f3dd4){_0x1f3dd4=_0x1f3dd4||0xcc;return function(_0x1f120e){if(_0x1f120e){return _0x5d87fe[_0x0b60('0x17')](_0x1f3dd4);}return _0x5d87fe['status'](_0x1f3dd4)['end']();};}function respondWithResult(_0x1ddfae,_0x2a785f){_0x2a785f=_0x2a785f||0xc8;return function(_0x595451){if(_0x595451){return _0x1ddfae['status'](_0x2a785f)[_0x0b60('0x18')](_0x595451);}};}function respondWithFilteredResult(_0x4d2cec,_0x50d217){return function(_0x3c90d7){if(_0x3c90d7){var _0x2393e4=typeof _0x50d217['offset']===_0x0b60('0x19')&&typeof _0x50d217[_0x0b60('0x1a')]===_0x0b60('0x19');var _0x74e8ad=_0x3c90d7[_0x0b60('0x1b')];var _0x1f7dae=_0x2393e4?0x0:_0x50d217[_0x0b60('0x1c')];var _0x861bbf=_0x2393e4?_0x3c90d7['count']:_0x50d217[_0x0b60('0x1c')]+_0x50d217[_0x0b60('0x1a')];var _0x3d5524;if(_0x861bbf>=_0x74e8ad){_0x861bbf=_0x74e8ad;_0x3d5524=0xc8;}else{_0x3d5524=0xce;}_0x4d2cec[_0x0b60('0x1d')](_0x3d5524);return _0x4d2cec[_0x0b60('0x1e')]('Content-Range',_0x1f7dae+'-'+_0x861bbf+'/'+_0x74e8ad)[_0x0b60('0x18')](_0x3c90d7);}return null;};}function patchUpdates(_0x139c1f){return function(_0xe16567){try{jsonpatch[_0x0b60('0x1f')](_0xe16567,_0x139c1f,!![]);}catch(_0x3db8c9){return BPromise[_0x0b60('0x20')](_0x3db8c9);}return _0xe16567['save']();};}function saveUpdates(_0x30b89a,_0x2f0fbc){return function(_0x145984){if(_0x145984){return _0x145984['update'](_0x30b89a)[_0x0b60('0x21')](function(_0x48663c){return _0x48663c;});}return null;};}function removeEntity(_0x23ec37,_0x15a773){return function(_0x2d56ee){if(_0x2d56ee){return _0x2d56ee[_0x0b60('0x22')]()['then'](function(){_0x23ec37['status'](0xcc)[_0x0b60('0x23')]();});}};}function handleEntityNotFound(_0x555c51,_0x2d4542){return function(_0x433b87){if(!_0x433b87){_0x555c51[_0x0b60('0x17')](0x194);}return _0x433b87;};}function handleError(_0x39c417,_0x3dfff1){_0x3dfff1=_0x3dfff1||0x1f4;return function(_0x5447f6){logger[_0x0b60('0x24')](_0x5447f6[_0x0b60('0x25')]);if(_0x5447f6['name']){delete _0x5447f6[_0x0b60('0x26')];}_0x39c417[_0x0b60('0x1d')](_0x3dfff1)[_0x0b60('0x27')](_0x5447f6);};}exports[_0x0b60('0x28')]=function(_0x3acb2b,_0x636ec4){var _0x1447b6={},_0x5ed987={},_0x1c9c21={'count':0x0,'rows':[]};var _0x2d52f5=_['map'](db[_0x0b60('0x29')][_0x0b60('0x2a')],function(_0x4f68b6){return{'name':_0x4f68b6['fieldName'],'type':_0x4f68b6[_0x0b60('0x2b')][_0x0b60('0x2c')]};});_0x5ed987[_0x0b60('0x2d')]=_[_0x0b60('0x2e')](_0x2d52f5,_0x0b60('0x26'));_0x5ed987[_0x0b60('0x2f')]=_[_0x0b60('0x30')](_0x3acb2b['query']);_0x5ed987['filters']=_['intersection'](_0x5ed987['model'],_0x5ed987[_0x0b60('0x2f')]);_0x1447b6[_0x0b60('0x31')]=_[_0x0b60('0x32')](_0x5ed987[_0x0b60('0x2d')],qs['fields'](_0x3acb2b[_0x0b60('0x2f')][_0x0b60('0x33')]));_0x1447b6['attributes']=_0x1447b6[_0x0b60('0x31')][_0x0b60('0x34')]?_0x1447b6[_0x0b60('0x31')]:_0x5ed987[_0x0b60('0x2d')];if(!_0x3acb2b['query'][_0x0b60('0x35')](_0x0b60('0x36'))){_0x1447b6[_0x0b60('0x1a')]=qs['limit'](_0x3acb2b['query']['limit']);_0x1447b6[_0x0b60('0x1c')]=qs[_0x0b60('0x1c')](_0x3acb2b[_0x0b60('0x2f')][_0x0b60('0x1c')]);}_0x1447b6[_0x0b60('0x37')]=qs[_0x0b60('0x38')](_0x3acb2b[_0x0b60('0x2f')][_0x0b60('0x38')]);_0x1447b6[_0x0b60('0x39')]=qs[_0x0b60('0x3a')](_[_0x0b60('0x3b')](_0x3acb2b[_0x0b60('0x2f')],_0x5ed987[_0x0b60('0x3a')]),_0x2d52f5);if(_0x3acb2b[_0x0b60('0x2f')]['filter']){_0x1447b6[_0x0b60('0x39')]=_[_0x0b60('0x3c')](_0x1447b6[_0x0b60('0x39')],{'$or':_['map'](_0x2d52f5,function(_0x495ec6){if(_0x495ec6[_0x0b60('0x2b')]!==_0x0b60('0x3d')){var _0x329595={};_0x329595[_0x495ec6[_0x0b60('0x26')]]={'$like':'%'+_0x3acb2b[_0x0b60('0x2f')]['filter']+'%'};return _0x329595;}})});}_0x1447b6=_[_0x0b60('0x3c')]({},_0x1447b6,_0x3acb2b[_0x0b60('0x3e')]);var _0x2637d0={'where':_0x1447b6['where']};return db['SquareReport']['count'](_0x2637d0)[_0x0b60('0x21')](function(_0x44e3a6){_0x1c9c21['count']=_0x44e3a6;if(_0x3acb2b[_0x0b60('0x2f')][_0x0b60('0x3f')]){_0x1447b6[_0x0b60('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0x0b60('0x41')](_0x1447b6);})['then'](function(_0x2c9291){_0x1c9c21[_0x0b60('0x42')]=_0x2c9291;return _0x1c9c21;})[_0x0b60('0x21')](respondWithFilteredResult(_0x636ec4,_0x1447b6))[_0x0b60('0x43')](handleError(_0x636ec4,null));};exports[_0x0b60('0x44')]=function(_0x510dae,_0x3424a8){var _0x3a06c5={'raw':!![],'where':{'id':_0x510dae['params']['id']}},_0x14c541={};_0x14c541[_0x0b60('0x2d')]=_[_0x0b60('0x30')](db['SquareReport'][_0x0b60('0x2a')]);_0x14c541[_0x0b60('0x2f')]=_[_0x0b60('0x30')](_0x510dae[_0x0b60('0x2f')]);_0x14c541[_0x0b60('0x3a')]=_[_0x0b60('0x32')](_0x14c541[_0x0b60('0x2d')],_0x14c541[_0x0b60('0x2f')]);_0x3a06c5[_0x0b60('0x31')]=_['intersection'](_0x14c541[_0x0b60('0x2d')],qs[_0x0b60('0x33')](_0x510dae[_0x0b60('0x2f')][_0x0b60('0x33')]));_0x3a06c5[_0x0b60('0x31')]=_0x3a06c5[_0x0b60('0x31')][_0x0b60('0x34')]?_0x3a06c5[_0x0b60('0x31')]:_0x14c541[_0x0b60('0x2d')];if(_0x510dae[_0x0b60('0x2f')][_0x0b60('0x3f')]){_0x3a06c5[_0x0b60('0x40')]=[{'all':!![]}];}_0x3a06c5=_[_0x0b60('0x3c')]({},_0x3a06c5,_0x510dae[_0x0b60('0x3e')]);return db[_0x0b60('0x29')]['find'](_0x3a06c5)['then'](handleEntityNotFound(_0x3424a8,null))['then'](respondWithResult(_0x3424a8,null))['catch'](handleError(_0x3424a8,null));};exports[_0x0b60('0x45')]=function(_0x549101,_0x4a1a01){return db[_0x0b60('0x29')]['create'](_0x549101['body'],{})[_0x0b60('0x21')](respondWithResult(_0x4a1a01,0xc9))[_0x0b60('0x43')](handleError(_0x4a1a01,null));};exports[_0x0b60('0x46')]=function(_0x43e2f1,_0x485b27){if(_0x43e2f1[_0x0b60('0x47')]['id']){delete _0x43e2f1[_0x0b60('0x47')]['id'];}return db[_0x0b60('0x29')][_0x0b60('0x48')]({'where':{'id':_0x43e2f1['params']['id']}})['then'](handleEntityNotFound(_0x485b27,null))[_0x0b60('0x21')](saveUpdates(_0x43e2f1[_0x0b60('0x47')],null))[_0x0b60('0x21')](respondWithResult(_0x485b27,null))[_0x0b60('0x43')](handleError(_0x485b27,null));};exports[_0x0b60('0x22')]=function(_0x485218,_0x583c39){return db[_0x0b60('0x29')][_0x0b60('0x48')]({'where':{'id':_0x485218[_0x0b60('0x49')]['id']}})[_0x0b60('0x21')](handleEntityNotFound(_0x583c39,null))['then'](removeEntity(_0x583c39,null))[_0x0b60('0x43')](handleError(_0x583c39,null));};exports['describe']=function(_0x4dc54d,_0x5d028d){return db['SquareReport'][_0x0b60('0x4a')]()['then'](respondWithResult(_0x5d028d,null))[_0x0b60('0x43')](handleError(_0x5d028d,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index de8b0b0..fdf91a1 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 _0x4632=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x37cfb6,_0x225c6d){var _0x1d0a82=function(_0x5ac426){while(--_0x5ac426){_0x37cfb6['push'](_0x37cfb6['shift']());}};_0x1d0a82(++_0x225c6d);}(_0x4632,0x1b2));var _0x2463=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4632[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x2463('0x0'));var util=require(_0x2463('0x1'));var logger=require(_0x2463('0x2'))('api');var moment=require(_0x2463('0x3'));var BPromise=require(_0x2463('0x4'));var rp=require(_0x2463('0x5'));var fs=require('fs');var path=require(_0x2463('0x6'));var rimraf=require('rimraf');var config=require(_0x2463('0x7'));var attributes=require(_0x2463('0x8'));module[_0x2463('0x9')]=function(_0x480c26,_0x25fe4d){return _0x480c26[_0x2463('0xa')](_0x2463('0xb'),attributes,{'tableName':_0x2463('0xc'),'paranoid':![],'indexes':[{'name':_0x2463('0xd'),'fields':[_0x2463('0xe'),_0x2463('0xf')]},{'name':_0x2463('0x10'),'fields':[_0x2463('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafae=['leaveAt','lodash','../../config/logger','api','moment','../../config/environment','./squareReport.attributes','report_square','uniqueid','project_name'];(function(_0x568a7f,_0x1afcc9){var _0x41b7f1=function(_0x26788f){while(--_0x26788f){_0x568a7f['push'](_0x568a7f['shift']());}};_0x41b7f1(++_0x1afcc9);}(_0xafae,0x15f));var _0xeafa=function(_0x27d2bf,_0x27ec74){_0x27d2bf=_0x27d2bf-0x0;var _0x5498a=_0xafae[_0x27d2bf];return _0x5498a;};'use strict';var _=require(_0xeafa('0x0'));var util=require('util');var logger=require(_0xeafa('0x1'))(_0xeafa('0x2'));var moment=require(_0xeafa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeafa('0x4'));var attributes=require(_0xeafa('0x5'));module['exports']=function(_0x2c9430,_0x4a63b3){return _0x2c9430['define']('SquareReport',attributes,{'tableName':_0xeafa('0x6'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xeafa('0x7'),_0xeafa('0x8')]},{'name':'leaveAt','fields':[_0xeafa('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index fa8c702..cac8834 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 _0x66c9=['CreateSquareReport','SquareReport','options','raw','debug','update','body','where','attributes','UpdateSquareReport','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0x66c9,0x154));var _0x966c=function(_0x5b9e0f,_0x19ffa6){_0x5b9e0f=_0x5b9e0f-0x0;var _0x3352f1=_0x66c9[_0x5b9e0f];return _0x3352f1;};'use strict';var _=require(_0x966c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x966c('0x1'));var rs=require(_0x966c('0x2'));var fs=require('fs');var Redis=require(_0x966c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x966c('0x4'));var logger=require('../../config/logger')(_0x966c('0x5'));var config=require(_0x966c('0x6'));var jayson=require(_0x966c('0x7'));var client=jayson[_0x966c('0x8')][_0x966c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b59e7,_0x1bed47,_0x23c845){return new BPromise(function(_0x1d5b42,_0x5c03a4){return client['request'](_0x2b59e7,_0x23c845)[_0x966c('0xa')](function(_0x5d65a9){logger[_0x966c('0xb')](_0x966c('0xc'),_0x1bed47,'request\x20sent');logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x1bed47,_0x966c('0xd'),JSON[_0x966c('0xe')](_0x5d65a9));if(_0x5d65a9[_0x966c('0xf')]){if(_0x5d65a9[_0x966c('0xf')][_0x966c('0x10')]===0x1f4){logger[_0x966c('0xf')]('SquareReport,\x20%s,\x20%s',_0x1bed47,_0x5d65a9['error']['message']);return _0x5c03a4(_0x5d65a9[_0x966c('0xf')][_0x966c('0x11')]);}logger[_0x966c('0xf')]('SquareReport,\x20%s,\x20%s',_0x1bed47,_0x5d65a9[_0x966c('0xf')]['message']);return _0x1d5b42(_0x5d65a9[_0x966c('0xf')][_0x966c('0x11')]);}else{logger[_0x966c('0xb')]('SquareReport,\x20%s,\x20%s',_0x1bed47,_0x966c('0xd'));_0x1d5b42(_0x5d65a9[_0x966c('0x12')]['message']);}})[_0x966c('0x13')](function(_0x3b8a4c){logger['error'](_0x966c('0xc'),_0x1bed47,_0x3b8a4c);_0x5c03a4(_0x3b8a4c);});});}exports[_0x966c('0x14')]=function(_0x1a323c){var _0x5d29dc=this;return new Promise(function(_0x3385db,_0x57f108){return db[_0x966c('0x15')]['create'](_0x1a323c['body'],{'raw':_0x1a323c[_0x966c('0x16')]?_0x1a323c['options'][_0x966c('0x17')]===undefined?!![]:![]:!![]})[_0x966c('0xa')](function(_0x4590ce){logger[_0x966c('0xb')](_0x966c('0x14'),_0x1a323c);logger[_0x966c('0x18')](_0x966c('0x14'),_0x1a323c,JSON[_0x966c('0xe')](_0x4590ce));_0x3385db(_0x4590ce);})[_0x966c('0x13')](function(_0x4d897b){logger[_0x966c('0xf')](_0x966c('0x14'),_0x4d897b[_0x966c('0x11')],_0x1a323c);_0x57f108(_0x5d29dc['error'](0x1f4,_0x4d897b[_0x966c('0x11')]));});});};exports['UpdateSquareReport']=function(_0x184ac3){var _0x39cdb1=this;return new Promise(function(_0x3aeb27,_0x1d1052){return db[_0x966c('0x15')][_0x966c('0x19')](_0x184ac3[_0x966c('0x1a')],{'raw':_0x184ac3[_0x966c('0x16')]?_0x184ac3[_0x966c('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x184ac3[_0x966c('0x16')]?_0x184ac3[_0x966c('0x16')][_0x966c('0x1b')]||null:null,'attributes':_0x184ac3['options']?_0x184ac3[_0x966c('0x16')][_0x966c('0x1c')]||null:null,'limit':_0x184ac3[_0x966c('0x16')]?_0x184ac3[_0x966c('0x16')]['limit']||null:null})[_0x966c('0xa')](function(_0x35edc6){logger[_0x966c('0xb')](_0x966c('0x1d'),_0x184ac3);logger[_0x966c('0x18')](_0x966c('0x1d'),_0x184ac3,JSON[_0x966c('0xe')](_0x35edc6));_0x3aeb27(_0x35edc6);})['catch'](function(_0x5d65dc){logger['error'](_0x966c('0x1d'),_0x5d65dc[_0x966c('0x11')],_0x184ac3);_0x1d1052(_0x39cdb1['error'](0x1f4,_0x5d65dc[_0x966c('0x11')]));});});}; \ No newline at end of file +var _0x9048=['stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','options','raw','debug','CreateSquareReport','SquareReport','update','body','where','attributes','limit','UpdateSquareReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0xe1766f,_0x1f7aba){var _0x446b80=function(_0x595c52){while(--_0x595c52){_0xe1766f['push'](_0xe1766f['shift']());}};_0x446b80(++_0x1f7aba);}(_0x9048,0x1aa));var _0x8904=function(_0x48af9a,_0x51340f){_0x48af9a=_0x48af9a-0x0;var _0x360d54=_0x9048[_0x48af9a];return _0x360d54;};'use strict';var _=require('lodash');var util=require(_0x8904('0x0'));var moment=require(_0x8904('0x1'));var BPromise=require(_0x8904('0x2'));var rs=require(_0x8904('0x3'));var fs=require('fs');var Redis=require(_0x8904('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8904('0x5'));var logger=require(_0x8904('0x6'))(_0x8904('0x7'));var config=require(_0x8904('0x8'));var jayson=require(_0x8904('0x9'));var client=jayson[_0x8904('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x851720,_0x31cd96,_0x540ce2){return new BPromise(function(_0x3bc3d7,_0x161e99){return client[_0x8904('0xb')](_0x851720,_0x540ce2)[_0x8904('0xc')](function(_0x470eb8){logger[_0x8904('0xd')]('SquareReport,\x20%s,\x20%s',_0x31cd96,_0x8904('0xe'));logger['debug'](_0x8904('0xf'),_0x31cd96,'request\x20sent',JSON[_0x8904('0x10')](_0x470eb8));if(_0x470eb8[_0x8904('0x11')]){if(_0x470eb8[_0x8904('0x11')][_0x8904('0x12')]===0x1f4){logger['error'](_0x8904('0x13'),_0x31cd96,_0x470eb8['error']['message']);return _0x161e99(_0x470eb8[_0x8904('0x11')][_0x8904('0x14')]);}logger[_0x8904('0x11')](_0x8904('0x13'),_0x31cd96,_0x470eb8['error'][_0x8904('0x14')]);return _0x3bc3d7(_0x470eb8[_0x8904('0x11')][_0x8904('0x14')]);}else{logger[_0x8904('0xd')](_0x8904('0x13'),_0x31cd96,_0x8904('0xe'));_0x3bc3d7(_0x470eb8[_0x8904('0x15')]['message']);}})[_0x8904('0x16')](function(_0x48dea3){logger[_0x8904('0x11')](_0x8904('0x13'),_0x31cd96,_0x48dea3);_0x161e99(_0x48dea3);});});}exports['CreateSquareReport']=function(_0x9fc8b){var _0x5353d8=this;return new Promise(function(_0x5efa0a,_0x448cc5){return db['SquareReport']['create'](_0x9fc8b['body'],{'raw':_0x9fc8b[_0x8904('0x17')]?_0x9fc8b[_0x8904('0x17')][_0x8904('0x18')]===undefined?!![]:![]:!![]})[_0x8904('0xc')](function(_0x5b978e){logger['info']('CreateSquareReport',_0x9fc8b);logger[_0x8904('0x19')](_0x8904('0x1a'),_0x9fc8b,JSON[_0x8904('0x10')](_0x5b978e));_0x5efa0a(_0x5b978e);})[_0x8904('0x16')](function(_0x497ac4){logger[_0x8904('0x11')](_0x8904('0x1a'),_0x497ac4[_0x8904('0x14')],_0x9fc8b);_0x448cc5(_0x5353d8[_0x8904('0x11')](0x1f4,_0x497ac4['message']));});});};exports['UpdateSquareReport']=function(_0x5effc0){var _0x597448=this;return new Promise(function(_0x4447f8,_0x3bde7e){return db[_0x8904('0x1b')][_0x8904('0x1c')](_0x5effc0[_0x8904('0x1d')],{'raw':_0x5effc0[_0x8904('0x17')]?_0x5effc0[_0x8904('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5effc0[_0x8904('0x17')]?_0x5effc0['options'][_0x8904('0x1e')]||null:null,'attributes':_0x5effc0[_0x8904('0x17')]?_0x5effc0['options'][_0x8904('0x1f')]||null:null,'limit':_0x5effc0['options']?_0x5effc0['options'][_0x8904('0x20')]||null:null})['then'](function(_0x3fd75c){logger[_0x8904('0xd')](_0x8904('0x21'),_0x5effc0);logger[_0x8904('0x19')](_0x8904('0x21'),_0x5effc0,JSON['stringify'](_0x3fd75c));_0x4447f8(_0x3fd75c);})[_0x8904('0x16')](function(_0x496d4e){logger[_0x8904('0x11')](_0x8904('0x21'),_0x496d4e[_0x8904('0x14')],_0x5effc0);_0x3bde7e(_0x597448[_0x8904('0x11')](0x1f4,_0x496d4e[_0x8904('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 873ef83..8923a83 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 _0x5d53=['put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','show','post'];(function(_0x2c8c8e,_0xe47e23){var _0x3456fe=function(_0x59df5e){while(--_0x59df5e){_0x2c8c8e['push'](_0x2c8c8e['shift']());}};_0x3456fe(++_0xe47e23);}(_0x5d53,0x6a));var _0x35d5=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0x5d53[_0x10d670];return _0x20d6f8;};'use strict';var multer=require(_0x35d5('0x0'));var util=require(_0x35d5('0x1'));var path=require(_0x35d5('0x2'));var timeout=require('connect-timeout');var express=require(_0x35d5('0x3'));var router=express[_0x35d5('0x4')]();var fs_extra=require(_0x35d5('0x5'));var auth=require(_0x35d5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35d5('0x7'));var controller=require(_0x35d5('0x8'));router[_0x35d5('0x9')]('/',auth[_0x35d5('0xa')](),controller['index']);router[_0x35d5('0x9')](_0x35d5('0xb'),auth[_0x35d5('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x35d5('0xc')]);router[_0x35d5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x35d5('0xe')]('/:id',auth[_0x35d5('0xa')](),controller[_0x35d5('0xf')]);router[_0x35d5('0x10')](_0x35d5('0x11'),auth[_0x35d5('0xa')](),controller[_0x35d5('0x12')]);module[_0x35d5('0x13')]=router; \ No newline at end of file +var _0xfcf0=['/describe','describe','/:id','show','create','put','update','exports','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index'];(function(_0x4bf477,_0x4f5579){var _0x11c973=function(_0x39bb1d){while(--_0x39bb1d){_0x4bf477['push'](_0x4bf477['shift']());}};_0x11c973(++_0x4f5579);}(_0xfcf0,0xa8));var _0x0fcf=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0xfcf0[_0x1aeda2];return _0x32dc6d;};'use strict';var multer=require('multer');var util=require(_0x0fcf('0x0'));var path=require(_0x0fcf('0x1'));var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0fcf('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x0fcf('0x5')]('/',auth[_0x0fcf('0x6')](),controller[_0x0fcf('0x7')]);router['get'](_0x0fcf('0x8'),auth[_0x0fcf('0x6')](),controller[_0x0fcf('0x9')]);router[_0x0fcf('0x5')](_0x0fcf('0xa'),auth[_0x0fcf('0x6')](),controller[_0x0fcf('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0fcf('0xc')]);router[_0x0fcf('0xd')]('/:id',auth[_0x0fcf('0x6')](),controller[_0x0fcf('0xe')]);router['delete'](_0x0fcf('0xa'),auth[_0x0fcf('0x6')](),controller['destroy']);module[_0x0fcf('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 6db9183..0151ef9 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 _0x3c2f=['exports','STRING','TEXT','sequelize'];(function(_0x26aee4,_0x530ead){var _0x2e1048=function(_0x2e92db){while(--_0x2e92db){_0x26aee4['push'](_0x26aee4['shift']());}};_0x2e1048(++_0x530ead);}(_0x3c2f,0xf3));var _0xf3c2=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x3c2f[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xf3c2('0x0'));module[_0xf3c2('0x1')]={'uniqueid':{'type':Sequelize[_0xf3c2('0x2')]},'node':{'type':Sequelize[_0xf3c2('0x2')]},'application':{'type':Sequelize[_0xf3c2('0x2')]},'data':{'type':Sequelize[_0xf3c2('0x3')]},'project_name':{'type':Sequelize[_0xf3c2('0x2')]},'callerid':{'type':Sequelize[_0xf3c2('0x2')]}}; \ No newline at end of file +var _0x39a2=['STRING','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x39a2,0x6a));var _0x239a=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x39a2[_0x4347ec];return _0x4c8314;};'use strict';var Sequelize=require(_0x239a('0x0'));module[_0x239a('0x1')]={'uniqueid':{'type':Sequelize[_0x239a('0x2')]},'node':{'type':Sequelize[_0x239a('0x2')]},'application':{'type':Sequelize[_0x239a('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x239a('0x2')]},'callerid':{'type':Sequelize[_0x239a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b9e6b91..b9e1495 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 _0xfafd=['filter','where','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xfafd,0x140));var _0xdfaf=function(_0x52efde,_0x110e4c){_0x52efde=_0x52efde-0x0;var _0x5cb4e5=_0xfafd[_0x52efde];return _0x5cb4e5;};'use strict';var emlformat=require(_0xdfaf('0x0'));var rimraf=require(_0xdfaf('0x1'));var zipdir=require(_0xdfaf('0x2'));var jsonpatch=require(_0xdfaf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdfaf('0x4'));var Mustache=require(_0xdfaf('0x5'));var util=require(_0xdfaf('0x6'));var path=require('path');var sox=require(_0xdfaf('0x7'));var csv=require(_0xdfaf('0x8'));var ejs=require(_0xdfaf('0x9'));var fs=require('fs');var fs_extra=require(_0xdfaf('0xa'));var _=require('lodash');var squel=require(_0xdfaf('0xb'));var crypto=require(_0xdfaf('0xc'));var jsforce=require(_0xdfaf('0xd'));var deskjs=require(_0xdfaf('0xe'));var toCsv=require(_0xdfaf('0x8'));var querystring=require('querystring');var Papa=require(_0xdfaf('0xf'));var Redis=require('ioredis');var authService=require(_0xdfaf('0x10'));var qs=require(_0xdfaf('0x11'));var as=require(_0xdfaf('0x12'));var hardwareService=require(_0xdfaf('0x13'));var logger=require(_0xdfaf('0x14'))(_0xdfaf('0x15'));var utils=require(_0xdfaf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfaf('0x17'));var db=require(_0xdfaf('0x18'))['db'];function respondWithStatusCode(_0x33f969,_0x4a60a3){_0x4a60a3=_0x4a60a3||0xcc;return function(_0x334618){if(_0x334618){return _0x33f969[_0xdfaf('0x19')](_0x4a60a3);}return _0x33f969[_0xdfaf('0x1a')](_0x4a60a3)[_0xdfaf('0x1b')]();};}function respondWithResult(_0x1b842e,_0x30ef4b){_0x30ef4b=_0x30ef4b||0xc8;return function(_0xd5bbbe){if(_0xd5bbbe){return _0x1b842e[_0xdfaf('0x1a')](_0x30ef4b)[_0xdfaf('0x1c')](_0xd5bbbe);}};}function respondWithFilteredResult(_0x3b45b4,_0x1bff86){return function(_0xcb92ce){if(_0xcb92ce){var _0x45511c=typeof _0x1bff86[_0xdfaf('0x1d')]===_0xdfaf('0x1e')&&typeof _0x1bff86[_0xdfaf('0x1f')]===_0xdfaf('0x1e');var _0x52f7e1=_0xcb92ce[_0xdfaf('0x20')];var _0x296917=_0x45511c?0x0:_0x1bff86[_0xdfaf('0x1d')];var _0x524a0a=_0x45511c?_0xcb92ce['count']:_0x1bff86[_0xdfaf('0x1d')]+_0x1bff86['limit'];var _0x30f759;if(_0x524a0a>=_0x52f7e1){_0x524a0a=_0x52f7e1;_0x30f759=0xc8;}else{_0x30f759=0xce;}_0x3b45b4[_0xdfaf('0x1a')](_0x30f759);return _0x3b45b4[_0xdfaf('0x21')]('Content-Range',_0x296917+'-'+_0x524a0a+'/'+_0x52f7e1)[_0xdfaf('0x1c')](_0xcb92ce);}return null;};}function patchUpdates(_0x12b29e){return function(_0x16f29c){try{jsonpatch[_0xdfaf('0x22')](_0x16f29c,_0x12b29e,!![]);}catch(_0x157ad0){return BPromise[_0xdfaf('0x23')](_0x157ad0);}return _0x16f29c['save']();};}function saveUpdates(_0x3ef095,_0x59a442){return function(_0x2d82e1){if(_0x2d82e1){return _0x2d82e1[_0xdfaf('0x24')](_0x3ef095)[_0xdfaf('0x25')](function(_0x393b61){return _0x393b61;});}return null;};}function removeEntity(_0x388e05,_0x1f86f3){return function(_0x251144){if(_0x251144){return _0x251144['destroy']()[_0xdfaf('0x25')](function(){_0x388e05[_0xdfaf('0x1a')](0xcc)[_0xdfaf('0x1b')]();});}};}function handleEntityNotFound(_0x497a6a,_0x10cf80){return function(_0x55bc96){if(!_0x55bc96){_0x497a6a['sendStatus'](0x194);}return _0x55bc96;};}function handleError(_0x389a95,_0x3966d8){_0x3966d8=_0x3966d8||0x1f4;return function(_0x445190){logger[_0xdfaf('0x26')](_0x445190['stack']);if(_0x445190[_0xdfaf('0x27')]){delete _0x445190[_0xdfaf('0x27')];}_0x389a95[_0xdfaf('0x1a')](_0x3966d8)[_0xdfaf('0x28')](_0x445190);};}exports[_0xdfaf('0x29')]=function(_0x6bd495,_0x922007){var _0x26e86e={},_0x1f32d0={},_0x14a291={'count':0x0,'rows':[]};var _0x3ded9f=_[_0xdfaf('0x2a')](db[_0xdfaf('0x2b')][_0xdfaf('0x2c')],function(_0x44522c){return{'name':_0x44522c[_0xdfaf('0x2d')],'type':_0x44522c[_0xdfaf('0x2e')][_0xdfaf('0x2f')]};});_0x1f32d0['model']=_[_0xdfaf('0x2a')](_0x3ded9f,_0xdfaf('0x27'));_0x1f32d0['query']=_[_0xdfaf('0x30')](_0x6bd495[_0xdfaf('0x31')]);_0x1f32d0['filters']=_[_0xdfaf('0x32')](_0x1f32d0[_0xdfaf('0x33')],_0x1f32d0['query']);_0x26e86e[_0xdfaf('0x34')]=_[_0xdfaf('0x32')](_0x1f32d0['model'],qs[_0xdfaf('0x35')](_0x6bd495[_0xdfaf('0x31')][_0xdfaf('0x35')]));_0x26e86e[_0xdfaf('0x34')]=_0x26e86e[_0xdfaf('0x34')][_0xdfaf('0x36')]?_0x26e86e[_0xdfaf('0x34')]:_0x1f32d0['model'];if(!_0x6bd495['query'][_0xdfaf('0x37')](_0xdfaf('0x38'))){_0x26e86e[_0xdfaf('0x1f')]=qs[_0xdfaf('0x1f')](_0x6bd495[_0xdfaf('0x31')][_0xdfaf('0x1f')]);_0x26e86e[_0xdfaf('0x1d')]=qs[_0xdfaf('0x1d')](_0x6bd495[_0xdfaf('0x31')]['offset']);}_0x26e86e[_0xdfaf('0x39')]=qs['sort'](_0x6bd495[_0xdfaf('0x31')]['sort']);_0x26e86e['where']=qs[_0xdfaf('0x3a')](_[_0xdfaf('0x3b')](_0x6bd495[_0xdfaf('0x31')],_0x1f32d0[_0xdfaf('0x3a')]),_0x3ded9f);if(_0x6bd495[_0xdfaf('0x31')][_0xdfaf('0x3c')]){_0x26e86e[_0xdfaf('0x3d')]=_[_0xdfaf('0x3e')](_0x26e86e[_0xdfaf('0x3d')],{'$or':_[_0xdfaf('0x2a')](_0x3ded9f,function(_0x3d6d41){if(_0x3d6d41[_0xdfaf('0x2e')]!=='VIRTUAL'){var _0x4c61df={};_0x4c61df[_0x3d6d41[_0xdfaf('0x27')]]={'$like':'%'+_0x6bd495[_0xdfaf('0x31')][_0xdfaf('0x3c')]+'%'};return _0x4c61df;}})});}_0x26e86e=_[_0xdfaf('0x3e')]({},_0x26e86e,_0x6bd495[_0xdfaf('0x3f')]);var _0x3e3d95={'where':_0x26e86e[_0xdfaf('0x3d')]};return db[_0xdfaf('0x2b')]['count'](_0x3e3d95)[_0xdfaf('0x25')](function(_0x26fe75){_0x14a291[_0xdfaf('0x20')]=_0x26fe75;if(_0x6bd495[_0xdfaf('0x31')][_0xdfaf('0x40')]){_0x26e86e[_0xdfaf('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xdfaf('0x42')](_0x26e86e);})[_0xdfaf('0x25')](function(_0x28e2bc){_0x14a291[_0xdfaf('0x43')]=_0x28e2bc;return _0x14a291;})[_0xdfaf('0x25')](respondWithFilteredResult(_0x922007,_0x26e86e))[_0xdfaf('0x44')](handleError(_0x922007,null));};exports[_0xdfaf('0x45')]=function(_0x592975,_0x2019e3){var _0x39f506={'raw':!![],'where':{'id':_0x592975['params']['id']}},_0x376555={};_0x376555['model']=_[_0xdfaf('0x30')](db['SquareDetailsReport']['rawAttributes']);_0x376555['query']=_[_0xdfaf('0x30')](_0x592975[_0xdfaf('0x31')]);_0x376555[_0xdfaf('0x3a')]=_['intersection'](_0x376555[_0xdfaf('0x33')],_0x376555['query']);_0x39f506[_0xdfaf('0x34')]=_[_0xdfaf('0x32')](_0x376555[_0xdfaf('0x33')],qs[_0xdfaf('0x35')](_0x592975[_0xdfaf('0x31')][_0xdfaf('0x35')]));_0x39f506[_0xdfaf('0x34')]=_0x39f506[_0xdfaf('0x34')]['length']?_0x39f506['attributes']:_0x376555[_0xdfaf('0x33')];if(_0x592975[_0xdfaf('0x31')][_0xdfaf('0x40')]){_0x39f506[_0xdfaf('0x41')]=[{'all':!![]}];}_0x39f506=_[_0xdfaf('0x3e')]({},_0x39f506,_0x592975[_0xdfaf('0x3f')]);return db['SquareDetailsReport'][_0xdfaf('0x46')](_0x39f506)[_0xdfaf('0x25')](handleEntityNotFound(_0x2019e3,null))[_0xdfaf('0x25')](respondWithResult(_0x2019e3,null))['catch'](handleError(_0x2019e3,null));};exports[_0xdfaf('0x47')]=function(_0x2ca58c,_0x4079e7){return db[_0xdfaf('0x2b')]['create'](_0x2ca58c[_0xdfaf('0x48')],{})[_0xdfaf('0x25')](respondWithResult(_0x4079e7,0xc9))[_0xdfaf('0x44')](handleError(_0x4079e7,null));};exports['update']=function(_0x2bcf4e,_0x385c0b){if(_0x2bcf4e['body']['id']){delete _0x2bcf4e['body']['id'];}return db[_0xdfaf('0x2b')][_0xdfaf('0x46')]({'where':{'id':_0x2bcf4e[_0xdfaf('0x49')]['id']}})[_0xdfaf('0x25')](handleEntityNotFound(_0x385c0b,null))['then'](saveUpdates(_0x2bcf4e['body'],null))[_0xdfaf('0x25')](respondWithResult(_0x385c0b,null))[_0xdfaf('0x44')](handleError(_0x385c0b,null));};exports[_0xdfaf('0x4a')]=function(_0x2c69b0,_0x48d89a){return db[_0xdfaf('0x2b')]['find']({'where':{'id':_0x2c69b0[_0xdfaf('0x49')]['id']}})[_0xdfaf('0x25')](handleEntityNotFound(_0x48d89a,null))[_0xdfaf('0x25')](removeEntity(_0x48d89a,null))[_0xdfaf('0x44')](handleError(_0x48d89a,null));};exports['describe']=function(_0x54e109,_0xc74400){return db[_0xdfaf('0x2b')][_0xdfaf('0x4b')]()[_0xdfaf('0x25')](respondWithResult(_0xc74400,null))[_0xdfaf('0x44')](handleError(_0xc74400,null));}; \ No newline at end of file +var _0x9bb8=['send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','destroy','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','stack','name'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0x9bb8,0x1da));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89bb('0x0'));var zipdir=require(_0x89bb('0x1'));var jsonpatch=require(_0x89bb('0x2'));var rp=require(_0x89bb('0x3'));var moment=require('moment');var BPromise=require(_0x89bb('0x4'));var Mustache=require(_0x89bb('0x5'));var util=require(_0x89bb('0x6'));var path=require(_0x89bb('0x7'));var sox=require(_0x89bb('0x8'));var csv=require(_0x89bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89bb('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x89bb('0xb'));var toCsv=require(_0x89bb('0x9'));var querystring=require(_0x89bb('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x89bb('0xd'));var qs=require(_0x89bb('0xe'));var as=require(_0x89bb('0xf'));var hardwareService=require(_0x89bb('0x10'));var logger=require('../../config/logger')(_0x89bb('0x11'));var utils=require(_0x89bb('0x12'));var config=require(_0x89bb('0x13'));var licenseUtil=require(_0x89bb('0x14'));var db=require(_0x89bb('0x15'))['db'];function respondWithStatusCode(_0x1fe10e,_0x32411c){_0x32411c=_0x32411c||0xcc;return function(_0x754aa7){if(_0x754aa7){return _0x1fe10e[_0x89bb('0x16')](_0x32411c);}return _0x1fe10e['status'](_0x32411c)[_0x89bb('0x17')]();};}function respondWithResult(_0x2eaa28,_0x3bc426){_0x3bc426=_0x3bc426||0xc8;return function(_0x59e8e2){if(_0x59e8e2){return _0x2eaa28[_0x89bb('0x18')](_0x3bc426)[_0x89bb('0x19')](_0x59e8e2);}};}function respondWithFilteredResult(_0x1ac32e,_0x205535){return function(_0x480fac){if(_0x480fac){var _0x34ad2c=typeof _0x205535[_0x89bb('0x1a')]==='undefined'&&typeof _0x205535['limit']===_0x89bb('0x1b');var _0x42c961=_0x480fac['count'];var _0x3461de=_0x34ad2c?0x0:_0x205535['offset'];var _0x1cc237=_0x34ad2c?_0x480fac[_0x89bb('0x1c')]:_0x205535[_0x89bb('0x1a')]+_0x205535[_0x89bb('0x1d')];var _0x1364e4;if(_0x1cc237>=_0x42c961){_0x1cc237=_0x42c961;_0x1364e4=0xc8;}else{_0x1364e4=0xce;}_0x1ac32e[_0x89bb('0x18')](_0x1364e4);return _0x1ac32e[_0x89bb('0x1e')](_0x89bb('0x1f'),_0x3461de+'-'+_0x1cc237+'/'+_0x42c961)[_0x89bb('0x19')](_0x480fac);}return null;};}function patchUpdates(_0x41dc0b){return function(_0x84a6ef){try{jsonpatch[_0x89bb('0x20')](_0x84a6ef,_0x41dc0b,!![]);}catch(_0x2de294){return BPromise['reject'](_0x2de294);}return _0x84a6ef[_0x89bb('0x21')]();};}function saveUpdates(_0xb3bc4b,_0x30ae82){return function(_0x2f5a97){if(_0x2f5a97){return _0x2f5a97['update'](_0xb3bc4b)['then'](function(_0x3ee5c4){return _0x3ee5c4;});}return null;};}function removeEntity(_0x577c71,_0x1313e2){return function(_0x1ef7e6){if(_0x1ef7e6){return _0x1ef7e6['destroy']()[_0x89bb('0x22')](function(){_0x577c71['status'](0xcc)[_0x89bb('0x17')]();});}};}function handleEntityNotFound(_0x1cd147,_0x6bf574){return function(_0x21b4e0){if(!_0x21b4e0){_0x1cd147[_0x89bb('0x16')](0x194);}return _0x21b4e0;};}function handleError(_0x4f8a9d,_0x46e487){_0x46e487=_0x46e487||0x1f4;return function(_0x2b4467){logger['error'](_0x2b4467[_0x89bb('0x23')]);if(_0x2b4467[_0x89bb('0x24')]){delete _0x2b4467[_0x89bb('0x24')];}_0x4f8a9d[_0x89bb('0x18')](_0x46e487)[_0x89bb('0x25')](_0x2b4467);};}exports[_0x89bb('0x26')]=function(_0x265e17,_0x5713ca){var _0x2acaa1={},_0x446f2d={},_0xbc20e7={'count':0x0,'rows':[]};var _0x291aa0=_[_0x89bb('0x27')](db[_0x89bb('0x28')][_0x89bb('0x29')],function(_0x1bca10){return{'name':_0x1bca10[_0x89bb('0x2a')],'type':_0x1bca10[_0x89bb('0x2b')][_0x89bb('0x2c')]};});_0x446f2d[_0x89bb('0x2d')]=_[_0x89bb('0x27')](_0x291aa0,_0x89bb('0x24'));_0x446f2d[_0x89bb('0x2e')]=_[_0x89bb('0x2f')](_0x265e17[_0x89bb('0x2e')]);_0x446f2d[_0x89bb('0x30')]=_[_0x89bb('0x31')](_0x446f2d[_0x89bb('0x2d')],_0x446f2d[_0x89bb('0x2e')]);_0x2acaa1['attributes']=_['intersection'](_0x446f2d[_0x89bb('0x2d')],qs[_0x89bb('0x32')](_0x265e17['query']['fields']));_0x2acaa1[_0x89bb('0x33')]=_0x2acaa1['attributes'][_0x89bb('0x34')]?_0x2acaa1['attributes']:_0x446f2d[_0x89bb('0x2d')];if(!_0x265e17[_0x89bb('0x2e')][_0x89bb('0x35')](_0x89bb('0x36'))){_0x2acaa1[_0x89bb('0x1d')]=qs[_0x89bb('0x1d')](_0x265e17[_0x89bb('0x2e')][_0x89bb('0x1d')]);_0x2acaa1['offset']=qs['offset'](_0x265e17[_0x89bb('0x2e')][_0x89bb('0x1a')]);}_0x2acaa1[_0x89bb('0x37')]=qs['sort'](_0x265e17[_0x89bb('0x2e')][_0x89bb('0x38')]);_0x2acaa1[_0x89bb('0x39')]=qs['filters'](_['pick'](_0x265e17[_0x89bb('0x2e')],_0x446f2d[_0x89bb('0x30')]),_0x291aa0);if(_0x265e17[_0x89bb('0x2e')]['filter']){_0x2acaa1[_0x89bb('0x39')]=_[_0x89bb('0x3a')](_0x2acaa1[_0x89bb('0x39')],{'$or':_[_0x89bb('0x27')](_0x291aa0,function(_0x5cc295){if(_0x5cc295[_0x89bb('0x2b')]!=='VIRTUAL'){var _0x528f2e={};_0x528f2e[_0x5cc295[_0x89bb('0x24')]]={'$like':'%'+_0x265e17[_0x89bb('0x2e')]['filter']+'%'};return _0x528f2e;}})});}_0x2acaa1=_[_0x89bb('0x3a')]({},_0x2acaa1,_0x265e17[_0x89bb('0x3b')]);var _0x5ba543={'where':_0x2acaa1[_0x89bb('0x39')]};return db[_0x89bb('0x28')]['count'](_0x5ba543)[_0x89bb('0x22')](function(_0x4af820){_0xbc20e7['count']=_0x4af820;if(_0x265e17[_0x89bb('0x2e')][_0x89bb('0x3c')]){_0x2acaa1[_0x89bb('0x3d')]=[{'all':!![]}];}return db[_0x89bb('0x28')][_0x89bb('0x3e')](_0x2acaa1);})[_0x89bb('0x22')](function(_0x476a78){_0xbc20e7[_0x89bb('0x3f')]=_0x476a78;return _0xbc20e7;})[_0x89bb('0x22')](respondWithFilteredResult(_0x5713ca,_0x2acaa1))[_0x89bb('0x40')](handleError(_0x5713ca,null));};exports[_0x89bb('0x41')]=function(_0x27ee7f,_0x5a54ba){var _0x432691={'raw':!![],'where':{'id':_0x27ee7f['params']['id']}},_0x10172d={};_0x10172d[_0x89bb('0x2d')]=_[_0x89bb('0x2f')](db[_0x89bb('0x28')]['rawAttributes']);_0x10172d[_0x89bb('0x2e')]=_[_0x89bb('0x2f')](_0x27ee7f['query']);_0x10172d[_0x89bb('0x30')]=_[_0x89bb('0x31')](_0x10172d[_0x89bb('0x2d')],_0x10172d[_0x89bb('0x2e')]);_0x432691[_0x89bb('0x33')]=_[_0x89bb('0x31')](_0x10172d[_0x89bb('0x2d')],qs['fields'](_0x27ee7f['query'][_0x89bb('0x32')]));_0x432691['attributes']=_0x432691[_0x89bb('0x33')][_0x89bb('0x34')]?_0x432691[_0x89bb('0x33')]:_0x10172d[_0x89bb('0x2d')];if(_0x27ee7f[_0x89bb('0x2e')][_0x89bb('0x3c')]){_0x432691[_0x89bb('0x3d')]=[{'all':!![]}];}_0x432691=_[_0x89bb('0x3a')]({},_0x432691,_0x27ee7f[_0x89bb('0x3b')]);return db[_0x89bb('0x28')][_0x89bb('0x42')](_0x432691)['then'](handleEntityNotFound(_0x5a54ba,null))['then'](respondWithResult(_0x5a54ba,null))[_0x89bb('0x40')](handleError(_0x5a54ba,null));};exports[_0x89bb('0x43')]=function(_0x7b8658,_0x2b34d3){return db['SquareDetailsReport'][_0x89bb('0x43')](_0x7b8658[_0x89bb('0x44')],{})[_0x89bb('0x22')](respondWithResult(_0x2b34d3,0xc9))[_0x89bb('0x40')](handleError(_0x2b34d3,null));};exports[_0x89bb('0x45')]=function(_0x273f79,_0x58b6f8){if(_0x273f79['body']['id']){delete _0x273f79['body']['id'];}return db[_0x89bb('0x28')][_0x89bb('0x42')]({'where':{'id':_0x273f79['params']['id']}})[_0x89bb('0x22')](handleEntityNotFound(_0x58b6f8,null))['then'](saveUpdates(_0x273f79['body'],null))[_0x89bb('0x22')](respondWithResult(_0x58b6f8,null))['catch'](handleError(_0x58b6f8,null));};exports[_0x89bb('0x46')]=function(_0x2ed9d,_0x3cedd3){return db[_0x89bb('0x28')]['find']({'where':{'id':_0x2ed9d[_0x89bb('0x47')]['id']}})['then'](handleEntityNotFound(_0x3cedd3,null))[_0x89bb('0x22')](removeEntity(_0x3cedd3,null))[_0x89bb('0x40')](handleError(_0x3cedd3,null));};exports[_0x89bb('0x48')]=function(_0x1cc29e,_0x2592b3){return db[_0x89bb('0x28')][_0x89bb('0x48')]()['then'](respondWithResult(_0x2592b3,null))[_0x89bb('0x40')](handleError(_0x2592b3,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 2798429..fda2e06 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 _0x7e73=['bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment'];(function(_0x177cfa,_0x463c2c){var _0x4ae48b=function(_0x438671){while(--_0x438671){_0x177cfa['push'](_0x177cfa['shift']());}};_0x4ae48b(++_0x463c2c);}(_0x7e73,0x110));var _0x37e7=function(_0x46d244,_0x3b0277){_0x46d244=_0x46d244-0x0;var _0x7a3adc=_0x7e73[_0x46d244];return _0x7a3adc;};'use strict';var _=require('lodash');var util=require(_0x37e7('0x0'));var logger=require(_0x37e7('0x1'))(_0x37e7('0x2'));var moment=require(_0x37e7('0x3'));var BPromise=require(_0x37e7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37e7('0x5'));var rimraf=require(_0x37e7('0x6'));var config=require(_0x37e7('0x7'));var attributes=require(_0x37e7('0x8'));module['exports']=function(_0x4b1466,_0x5c0e9a){return _0x4b1466[_0x37e7('0x9')](_0x37e7('0xa'),attributes,{'tableName':_0x37e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe90=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','define'];(function(_0x166856,_0x27876a){var _0x52665a=function(_0x3697d8){while(--_0x3697d8){_0x166856['push'](_0x166856['shift']());}};_0x52665a(++_0x27876a);}(_0xfe90,0x156));var _0x0fe9=function(_0x53f207,_0x3870fd){_0x53f207=_0x53f207-0x0;var _0x45f1e0=_0xfe90[_0x53f207];return _0x45f1e0;};'use strict';var _=require(_0x0fe9('0x0'));var util=require(_0x0fe9('0x1'));var logger=require(_0x0fe9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0fe9('0x3'));var fs=require('fs');var path=require(_0x0fe9('0x4'));var rimraf=require(_0x0fe9('0x5'));var config=require(_0x0fe9('0x6'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x453cfd,_0x41778f){return _0x453cfd[_0x0fe9('0x7')](_0x0fe9('0x8'),attributes,{'tableName':_0x0fe9('0x9'),'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 55bfe14..c6d74cd 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 _0x32b6=['request','then','debug','request\x20sent','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','info','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x32b6,0x1d1));var _0x632b=function(_0x32734f,_0x5becb6){_0x32734f=_0x32734f-0x0;var _0x3867c9=_0x32b6[_0x32734f];return _0x3867c9;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x116f62){logger['info']('CreateSquareDetailsReport',_0x3bb27f);logger[_0x632b('0xd')]('CreateSquareDetailsReport',_0x3bb27f,JSON[_0x632b('0xf')](_0x116f62));_0x51c894(_0x116f62);})[_0x632b('0x1b')](function(_0x2a6833){logger['error'](_0x632b('0x15'),_0x2a6833[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472['error'](0x1f4,_0x2a6833[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0xfef3=['../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x39a07e,_0x1a621d){var _0x52465f=function(_0x4f7fd2){while(--_0x4f7fd2){_0x39a07e['push'](_0x39a07e['shift']());}};_0x52465f(++_0x1a621d);}(_0xfef3,0x118));var _0x3fef=function(_0x5a950d,_0x41fc9b){_0x5a950d=_0x5a950d-0x0;var _0x31c239=_0xfef3[_0x5a950d];return _0x31c239;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var moment=require(_0x3fef('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fef('0x2'));var fs=require('fs');var Redis=require(_0x3fef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('rpc');var config=require(_0x3fef('0x6'));var jayson=require(_0x3fef('0x7'));var client=jayson['client'][_0x3fef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5b72,_0x800850,_0x33e00a){return new BPromise(function(_0x1fffc5,_0x41960c){return client[_0x3fef('0x9')](_0x5f5b72,_0x33e00a)[_0x3fef('0xa')](function(_0x31c30f){logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));logger[_0x3fef('0xe')](_0x3fef('0xf'),_0x800850,'request\x20sent',JSON[_0x3fef('0x10')](_0x31c30f));if(_0x31c30f[_0x3fef('0x11')]){if(_0x31c30f[_0x3fef('0x11')]['code']===0x1f4){logger[_0x3fef('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x41960c(_0x31c30f[_0x3fef('0x11')]['message']);}logger[_0x3fef('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x1fffc5(_0x31c30f['error'][_0x3fef('0x12')]);}else{logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));_0x1fffc5(_0x31c30f[_0x3fef('0x13')][_0x3fef('0x12')]);}})['catch'](function(_0x1cbdbb){logger[_0x3fef('0x11')](_0x3fef('0xc'),_0x800850,_0x1cbdbb);_0x41960c(_0x1cbdbb);});});}exports[_0x3fef('0x14')]=function(_0x1613ad){var _0xaa0ae3=this;return new Promise(function(_0x53d993,_0x36669d){return db[_0x3fef('0x15')]['create'](_0x1613ad[_0x3fef('0x16')],{'raw':_0x1613ad[_0x3fef('0x17')]?_0x1613ad[_0x3fef('0x17')][_0x3fef('0x18')]===undefined?!![]:![]:!![]})[_0x3fef('0xa')](function(_0x2b5226){logger[_0x3fef('0xb')](_0x3fef('0x14'),_0x1613ad);logger[_0x3fef('0xe')](_0x3fef('0x14'),_0x1613ad,JSON[_0x3fef('0x10')](_0x2b5226));_0x53d993(_0x2b5226);})[_0x3fef('0x19')](function(_0x2eb578){logger[_0x3fef('0x11')](_0x3fef('0x14'),_0x2eb578['message'],_0x1613ad);_0x36669d(_0xaa0ae3['error'](0x1f4,_0x2eb578['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index fb84d36..81cfd65 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 _0xe1cf=['./system.controller','isAuthenticated','/process/:pid/kill','exports','../../components/auth/service'];(function(_0x3d67f5,_0x45379f){var _0x225ce9=function(_0x20d731){while(--_0x20d731){_0x3d67f5['push'](_0x3d67f5['shift']());}};_0x225ce9(++_0x45379f);}(_0xe1cf,0xcc));var _0xfe1c=function(_0x42008b,_0x35f54f){_0x42008b=_0x42008b-0x0;var _0x34f22e=_0xe1cf[_0x42008b];return _0x34f22e;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xfe1c('0x0'));var controller=require(_0xfe1c('0x1'));router['get']('/',auth[_0xfe1c('0x2')](),controller['index']);router['get'](_0xfe1c('0x3'),auth['isAuthenticated'](),controller['killProcess']);module[_0xfe1c('0x4')]=router; \ No newline at end of file +var _0xae0a=['isAuthenticated','index','/process/:pid/kill','killProcess','express','Router','./system.controller','get'];(function(_0xe42532,_0x114875){var _0x40290e=function(_0x38b4ee){while(--_0x38b4ee){_0xe42532['push'](_0xe42532['shift']());}};_0x40290e(++_0x114875);}(_0xae0a,0xac));var _0xaae0=function(_0x1a5540,_0x5327d1){_0x1a5540=_0x1a5540-0x0;var _0x4c4f7d=_0xae0a[_0x1a5540];return _0x4c4f7d;};'use strict';var express=require(_0xaae0('0x0'));var router=express[_0xaae0('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xaae0('0x2'));router[_0xaae0('0x3')]('/',auth[_0xaae0('0x4')](),controller[_0xaae0('0x5')]);router[_0xaae0('0x3')](_0xaae0('0x6'),auth['isAuthenticated'](),controller[_0xaae0('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 889e08e..ccc794e 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 _0x8abe=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','split','length','indexOf','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','exec','../../config/logger','util','bluebird','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8abe,0x127));var _0xe8ab=function(_0x2dcf6e,_0x1e971f){_0x2dcf6e=_0x2dcf6e-0x0;var _0x5c9d78=_0x8abe[_0x2dcf6e];return _0x5c9d78;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xe8ab('0x0')];var logger=require(_0xe8ab('0x1'))('api');var util=require(_0xe8ab('0x2'));var BPromise=require(_0xe8ab('0x3'));var _=require(_0xe8ab('0x4'));function handleError(_0x4ad03b,_0x629bdd,_0x314b4d){_0x629bdd=_0x629bdd||0x1f4;return function(_0x240d44){logger[_0xe8ab('0x5')](_0xe8ab('0x6'),_0x314b4d,_0x629bdd,util[_0xe8ab('0x7')](_0x240d44,{'showHidden':![],'depth':null}));delete _0x240d44['name'];_0x4ad03b[_0xe8ab('0x8')](_0x629bdd)[_0xe8ab('0x9')](_0x240d44);};}exports[_0xe8ab('0xa')]=function(_0x47cca1,_0x5b2c75){return info[_0xe8ab('0xb')]()[_0xe8ab('0xc')](function(_0x3590aa){return _0x5b2c75['status'](0xc8)[_0xe8ab('0xd')](_0x3590aa);})[_0xe8ab('0xe')](function(_0x20418d){return _0x5b2c75['status'](0x1f4)[_0xe8ab('0xd')](_0x20418d);});};exports[_0xe8ab('0xf')]=function(_0x369c1c,_0x907c8f){var _0x497c41=[_0xe8ab('0x10')];return new BPromise(function(_0xaedf01,_0x3d41ba){return exec(util[_0xe8ab('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x369c1c[_0xe8ab('0x12')][_0xe8ab('0x13')]),function(_0x117b22,_0x233f4d,_0xf2e113){if(_0x117b22){return _0x3d41ba(_0x117b22);}return _0xaedf01(_0x233f4d);});})[_0xe8ab('0xc')](function(_0x112613){var _0x552bb5=![];var _0x5f4a61=_0x112613[_0xe8ab('0x14')](/\n/);for(var _0x593269=0x0,_0x17540c=_0x497c41[_0xe8ab('0x15')];_0x593269<_0x17540c,_0x552bb5===![];_0x593269+=0x1){if(_0x112613[_0xe8ab('0x16')](_0x497c41[_0x593269])>=0x0){_0x552bb5=!![];}}if(!_0x552bb5){throw new Error(util[_0xe8ab('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x369c1c[_0xe8ab('0x12')][_0xe8ab('0x13')]));}process['kill'](_0x369c1c['params'][_0xe8ab('0x13')],_0xe8ab('0x17'));return _0x907c8f[_0xe8ab('0x8')](0xc8)[_0xe8ab('0xd')]({'message':util[_0xe8ab('0x11')](_0xe8ab('0x18'),_0x369c1c['params'][_0xe8ab('0x13')])});})[_0xe8ab('0xe')](handleError(_0x907c8f,null,_0xe8ab('0xf')));}; \ No newline at end of file +var _0xd15e=['format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','error','index','getAllData','then','status','json','killProcess','components/import/cm','params','pid','split','length','kill','SIGINT'];(function(_0x337a14,_0x45cd24){var _0x1b874c=function(_0xb59c66){while(--_0xb59c66){_0x337a14['push'](_0x337a14['shift']());}};_0x1b874c(++_0x45cd24);}(_0xd15e,0x1a5));var _0xed15=function(_0x461647,_0x5f4200){_0x461647=_0x461647-0x0;var _0x15bc50=_0xd15e[_0x461647];return _0x15bc50;};'use strict';var info=require(_0xed15('0x0'));var exec=require(_0xed15('0x1'))[_0xed15('0x2')];var logger=require(_0xed15('0x3'))(_0xed15('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x37c4da,_0x599876,_0x73782){_0x599876=_0x599876||0x1f4;return function(_0x510256){logger[_0xed15('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x73782,_0x599876,util['inspect'](_0x510256,{'showHidden':![],'depth':null}));delete _0x510256['name'];_0x37c4da['status'](_0x599876)['send'](_0x510256);};}exports[_0xed15('0x6')]=function(_0x54992a,_0x12a992){return info[_0xed15('0x7')]()[_0xed15('0x8')](function(_0x419119){return _0x12a992[_0xed15('0x9')](0xc8)[_0xed15('0xa')](_0x419119);})['catch'](function(_0x46e177){return _0x12a992[_0xed15('0x9')](0x1f4)[_0xed15('0xa')](_0x46e177);});};exports[_0xed15('0xb')]=function(_0x1dc4b9,_0x41b74a){var _0x315088=[_0xed15('0xc')];return new BPromise(function(_0x46aea2,_0x1a21a6){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1dc4b9[_0xed15('0xd')][_0xed15('0xe')]),function(_0x1a9921,_0x1a7009,_0x33eec2){if(_0x1a9921){return _0x1a21a6(_0x1a9921);}return _0x46aea2(_0x1a7009);});})[_0xed15('0x8')](function(_0x11070f){var _0x44f206=![];var _0x1427b2=_0x11070f[_0xed15('0xf')](/\n/);for(var _0x4ff3ca=0x0,_0x989510=_0x315088[_0xed15('0x10')];_0x4ff3ca<_0x989510,_0x44f206===![];_0x4ff3ca+=0x1){if(_0x11070f['indexOf'](_0x315088[_0x4ff3ca])>=0x0){_0x44f206=!![];}}if(!_0x44f206){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1dc4b9[_0xed15('0xd')][_0xed15('0xe')]));}process[_0xed15('0x11')](_0x1dc4b9[_0xed15('0xd')][_0xed15('0xe')],_0xed15('0x12'));return _0x41b74a[_0xed15('0x9')](0xc8)[_0xed15('0xa')]({'message':util[_0xed15('0x13')](_0xed15('0x14'),_0x1dc4b9[_0xed15('0xd')][_0xed15('0xe')])});})[_0xed15('0x15')](handleError(_0x41b74a,null,_0xed15('0xb')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 3371753..821f60c 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 _0xfd28=['show','put','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x17615e,_0x483a49){var _0xa4c97e=function(_0x24ecf7){while(--_0x24ecf7){_0x17615e['push'](_0x17615e['shift']());}};_0xa4c97e(++_0x483a49);}(_0xfd28,0x148));var _0x8fd2=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xfd28[_0x2064e5];return _0x21a233;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xe')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0xf')]);module[_0x8fd2('0x10')]=router; \ No newline at end of file +var _0xd2ea=['./tag.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x8ea3c3,_0xe3fffc){var _0x149898=function(_0xad569e){while(--_0xad569e){_0x8ea3c3['push'](_0x8ea3c3['shift']());}};_0x149898(++_0xe3fffc);}(_0xd2ea,0x15f));var _0xad2e=function(_0x561199,_0x112512){_0x561199=_0x561199-0x0;var _0x3fbe3c=_0xd2ea[_0x561199];return _0x3fbe3c;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),auth[_0xad2e('0xb')](),controller['describe']);router[_0xad2e('0xa')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router['post']('/',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0x11')]);router['delete'](_0xad2e('0xd'),auth[_0xad2e('0xb')](),controller[_0xad2e('0x12')]);module[_0xad2e('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index eb6adb8..3ae5b15 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 _0x0bb4=['exports','name','STRING','#0091EA','sequelize'];(function(_0x2bbdc0,_0x1b1fe4){var _0x21409a=function(_0x4f6f7c){while(--_0x4f6f7c){_0x2bbdc0['push'](_0x2bbdc0['shift']());}};_0x21409a(++_0x1b1fe4);}(_0x0bb4,0x77));var _0x40bb=function(_0x17a71f,_0x31beb9){_0x17a71f=_0x17a71f-0x0;var _0x3178f7=_0x0bb4[_0x17a71f];return _0x3178f7;};'use strict';var Sequelize=require(_0x40bb('0x0'));module[_0x40bb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x40bb('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x40bb('0x3')],'defaultValue':_0x40bb('0x4')},'description':{'type':Sequelize[_0x40bb('0x3')]}}; \ No newline at end of file +var _0xe511=['#0091EA','STRING','sequelize','exports','name'];(function(_0x385799,_0x2be19b){var _0x3734fc=function(_0x4e50f9){while(--_0x4e50f9){_0x385799['push'](_0x385799['shift']());}};_0x3734fc(++_0x2be19b);}(_0xe511,0x16f));var _0x1e51=function(_0x34d703,_0xb42f05){_0x34d703=_0x34d703-0x0;var _0x39f780=_0xe511[_0x34d703];return _0x39f780;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1e51('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x1e51('0x3')},'description':{'type':Sequelize[_0x1e51('0x4')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index dbf88c7..63d42ca 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 _0x45cb=['count','set','Content-Range','reject','update','then','destroy','Tags','sendStatus','name','send','map','Tag','rawAttributes','fieldName','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x45cb,0x126));var _0xb45c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x45cb[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb45c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb45c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb45c('0x2'));var BPromise=require(_0xb45c('0x3'));var Mustache=require(_0xb45c('0x4'));var util=require(_0xb45c('0x5'));var path=require(_0xb45c('0x6'));var sox=require(_0xb45c('0x7'));var csv=require(_0xb45c('0x8'));var ejs=require(_0xb45c('0x9'));var fs=require('fs');var fs_extra=require(_0xb45c('0xa'));var _=require(_0xb45c('0xb'));var squel=require(_0xb45c('0xc'));var crypto=require('crypto');var jsforce=require(_0xb45c('0xd'));var deskjs=require(_0xb45c('0xe'));var toCsv=require(_0xb45c('0x8'));var querystring=require(_0xb45c('0xf'));var Papa=require(_0xb45c('0x10'));var Redis=require(_0xb45c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb45c('0x12'));var as=require(_0xb45c('0x13'));var hardwareService=require(_0xb45c('0x14'));var logger=require(_0xb45c('0x15'))(_0xb45c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb45c('0x17'));var db=require(_0xb45c('0x18'))['db'];function respondWithStatusCode(_0xe85640,_0x20fd56){_0x20fd56=_0x20fd56||0xcc;return function(_0x3f8fbb){if(_0x3f8fbb){return _0xe85640['sendStatus'](_0x20fd56);}return _0xe85640[_0xb45c('0x19')](_0x20fd56)[_0xb45c('0x1a')]();};}function respondWithResult(_0x166d01,_0x4762ac){_0x4762ac=_0x4762ac||0xc8;return function(_0x5c7eb8){if(_0x5c7eb8){return _0x166d01[_0xb45c('0x19')](_0x4762ac)[_0xb45c('0x1b')](_0x5c7eb8);}};}function respondWithFilteredResult(_0x552455,_0x556876){return function(_0x309ba9){if(_0x309ba9){var _0x102db5=typeof _0x556876['offset']===_0xb45c('0x1c')&&typeof _0x556876[_0xb45c('0x1d')]==='undefined';var _0x2cc0f8=_0x309ba9[_0xb45c('0x1e')];var _0x51a747=_0x102db5?0x0:_0x556876['offset'];var _0x5457e4=_0x102db5?_0x309ba9[_0xb45c('0x1e')]:_0x556876['offset']+_0x556876[_0xb45c('0x1d')];var _0x7f2870;if(_0x5457e4>=_0x2cc0f8){_0x5457e4=_0x2cc0f8;_0x7f2870=0xc8;}else{_0x7f2870=0xce;}_0x552455[_0xb45c('0x19')](_0x7f2870);return _0x552455[_0xb45c('0x1f')](_0xb45c('0x20'),_0x51a747+'-'+_0x5457e4+'/'+_0x2cc0f8)['json'](_0x309ba9);}return null;};}function patchUpdates(_0x3390fc){return function(_0x21e00e){try{jsonpatch['apply'](_0x21e00e,_0x3390fc,!![]);}catch(_0x2b0ef6){return BPromise[_0xb45c('0x21')](_0x2b0ef6);}return _0x21e00e['save']();};}function saveUpdates(_0x193123,_0x5960e3){return function(_0xaadef8){if(_0xaadef8){return _0xaadef8[_0xb45c('0x22')](_0x193123)[_0xb45c('0x23')](function(_0x552100){return _0x552100;});}return null;};}function removeEntity(_0x5dae6f,_0x554c50){return function(_0x43fa1e){if(_0x43fa1e){return _0x43fa1e[_0xb45c('0x24')]()['then'](function(){var _0x3f4603=_0x43fa1e['get']({'plain':!![]});var _0xcdde38=_0xb45c('0x25');return db['UserProfileResource'][_0xb45c('0x24')]({'where':{'type':_0xcdde38,'resourceId':_0x3f4603['id']}})['then'](function(){return _0x43fa1e;});})[_0xb45c('0x23')](function(){_0x5dae6f[_0xb45c('0x19')](0xcc)[_0xb45c('0x1a')]();});}};}function handleEntityNotFound(_0x402b28,_0x520cd5){return function(_0x5c1fdb){if(!_0x5c1fdb){_0x402b28[_0xb45c('0x26')](0x194);}return _0x5c1fdb;};}function handleError(_0x25c9c9,_0x4b9908){_0x4b9908=_0x4b9908||0x1f4;return function(_0x5aff1f){logger['error'](_0x5aff1f['stack']);if(_0x5aff1f[_0xb45c('0x27')]){delete _0x5aff1f[_0xb45c('0x27')];}_0x25c9c9['status'](_0x4b9908)[_0xb45c('0x28')](_0x5aff1f);};}exports['index']=function(_0x567a4b,_0x319bf7){var _0x249cbc={},_0x2497d5={},_0x5ea0cb={'count':0x0,'rows':[]};var _0xfe2385=_[_0xb45c('0x29')](db[_0xb45c('0x2a')][_0xb45c('0x2b')],function(_0x44baa6){return{'name':_0x44baa6[_0xb45c('0x2c')],'type':_0x44baa6['type']['key']};});_0x2497d5['model']=_[_0xb45c('0x29')](_0xfe2385,_0xb45c('0x27'));_0x2497d5[_0xb45c('0x2d')]=_[_0xb45c('0x2e')](_0x567a4b['query']);_0x2497d5[_0xb45c('0x2f')]=_['intersection'](_0x2497d5['model'],_0x2497d5[_0xb45c('0x2d')]);_0x249cbc[_0xb45c('0x30')]=_[_0xb45c('0x31')](_0x2497d5['model'],qs['fields'](_0x567a4b['query'][_0xb45c('0x32')]));_0x249cbc[_0xb45c('0x30')]=_0x249cbc[_0xb45c('0x30')][_0xb45c('0x33')]?_0x249cbc['attributes']:_0x2497d5[_0xb45c('0x34')];if(!_0x567a4b[_0xb45c('0x2d')][_0xb45c('0x35')](_0xb45c('0x36'))){_0x249cbc['limit']=qs[_0xb45c('0x1d')](_0x567a4b[_0xb45c('0x2d')]['limit']);_0x249cbc[_0xb45c('0x37')]=qs['offset'](_0x567a4b[_0xb45c('0x2d')]['offset']);}_0x249cbc[_0xb45c('0x38')]=qs[_0xb45c('0x39')](_0x567a4b[_0xb45c('0x2d')]['sort']);_0x249cbc[_0xb45c('0x3a')]=qs[_0xb45c('0x2f')](_['pick'](_0x567a4b[_0xb45c('0x2d')],_0x2497d5[_0xb45c('0x2f')]),_0xfe2385);if(_0x567a4b['query'][_0xb45c('0x3b')]){_0x249cbc[_0xb45c('0x3a')]=_[_0xb45c('0x3c')](_0x249cbc[_0xb45c('0x3a')],{'$or':_[_0xb45c('0x29')](_0xfe2385,function(_0x4b40b0){if(_0x4b40b0[_0xb45c('0x3d')]!==_0xb45c('0x3e')){var _0x25ce5f={};_0x25ce5f[_0x4b40b0[_0xb45c('0x27')]]={'$like':'%'+_0x567a4b[_0xb45c('0x2d')][_0xb45c('0x3b')]+'%'};return _0x25ce5f;}})});}_0x249cbc=_[_0xb45c('0x3c')]({},_0x249cbc,_0x567a4b[_0xb45c('0x3f')]);var _0x4f091e={'where':_0x249cbc[_0xb45c('0x3a')]};return db[_0xb45c('0x2a')][_0xb45c('0x1e')](_0x4f091e)['then'](function(_0x10703b){_0x5ea0cb[_0xb45c('0x1e')]=_0x10703b;if(_0x567a4b[_0xb45c('0x2d')]['includeAll']){_0x249cbc['include']=[{'all':!![]}];}return db[_0xb45c('0x2a')][_0xb45c('0x40')](_0x249cbc);})['then'](function(_0x45567a){_0x5ea0cb[_0xb45c('0x41')]=_0x45567a;return _0x5ea0cb;})[_0xb45c('0x23')](respondWithFilteredResult(_0x319bf7,_0x249cbc))[_0xb45c('0x42')](handleError(_0x319bf7,null));};exports['show']=function(_0x2a5ea1,_0x160823){var _0x59bfdc={'raw':!![],'where':{'id':_0x2a5ea1['params']['id']}},_0xfd23c2={};_0xfd23c2[_0xb45c('0x34')]=_[_0xb45c('0x2e')](db[_0xb45c('0x2a')][_0xb45c('0x2b')]);_0xfd23c2['query']=_[_0xb45c('0x2e')](_0x2a5ea1['query']);_0xfd23c2['filters']=_[_0xb45c('0x31')](_0xfd23c2[_0xb45c('0x34')],_0xfd23c2[_0xb45c('0x2d')]);_0x59bfdc[_0xb45c('0x30')]=_[_0xb45c('0x31')](_0xfd23c2[_0xb45c('0x34')],qs[_0xb45c('0x32')](_0x2a5ea1[_0xb45c('0x2d')][_0xb45c('0x32')]));_0x59bfdc[_0xb45c('0x30')]=_0x59bfdc[_0xb45c('0x30')][_0xb45c('0x33')]?_0x59bfdc[_0xb45c('0x30')]:_0xfd23c2[_0xb45c('0x34')];if(_0x2a5ea1['query']['includeAll']){_0x59bfdc[_0xb45c('0x43')]=[{'all':!![]}];}_0x59bfdc=_['merge']({},_0x59bfdc,_0x2a5ea1[_0xb45c('0x3f')]);return db[_0xb45c('0x2a')][_0xb45c('0x44')](_0x59bfdc)['then'](handleEntityNotFound(_0x160823,null))[_0xb45c('0x23')](respondWithResult(_0x160823,null))[_0xb45c('0x42')](handleError(_0x160823,null));};exports[_0xb45c('0x45')]=function(_0x3e2797,_0x266313){return db[_0xb45c('0x2a')][_0xb45c('0x45')](_0x3e2797[_0xb45c('0x46')],{})[_0xb45c('0x23')](function(_0x5d0030){var _0x2e8325=_0x3e2797['user']['get']({'plain':!![]});if(!_0x2e8325)throw new Error(_0xb45c('0x47'));if(_0x2e8325[_0xb45c('0x48')]===_0xb45c('0x49')){var _0x1e7136=_0x5d0030['get']({'plain':!![]});var _0x31c0c8='Tags';return db['UserProfileSection'][_0xb45c('0x44')]({'where':{'name':_0x31c0c8,'userProfileId':_0x2e8325[_0xb45c('0x4a')]},'raw':!![]})[_0xb45c('0x23')](function(_0x3fea4d){if(_0x3fea4d&&_0x3fea4d[_0xb45c('0x4b')]===0x0){return db[_0xb45c('0x4c')][_0xb45c('0x45')]({'name':_0x1e7136[_0xb45c('0x27')],'resourceId':_0x1e7136['id'],'type':_0x3fea4d['name'],'sectionId':_0x3fea4d['id']},{})[_0xb45c('0x23')](function(){return _0x5d0030;});}else{return _0x5d0030;}})['catch'](function(_0x125222){logger[_0xb45c('0x4d')](_0xb45c('0x4e'),_0x125222);throw _0x125222;});}return _0x5d0030;})[_0xb45c('0x23')](respondWithResult(_0x266313,0xc9))[_0xb45c('0x42')](handleError(_0x266313,null));};exports[_0xb45c('0x22')]=function(_0x594f65,_0x3e00ce){if(_0x594f65[_0xb45c('0x46')]['id']){delete _0x594f65[_0xb45c('0x46')]['id'];}return db['Tag']['find']({'where':{'id':_0x594f65[_0xb45c('0x4f')]['id']}})[_0xb45c('0x23')](handleEntityNotFound(_0x3e00ce,null))[_0xb45c('0x23')](saveUpdates(_0x594f65['body'],null))[_0xb45c('0x23')](respondWithResult(_0x3e00ce,null))[_0xb45c('0x42')](handleError(_0x3e00ce,null));};exports['destroy']=function(_0x43a7ad,_0xe6b70d){return db[_0xb45c('0x2a')][_0xb45c('0x44')]({'where':{'id':_0x43a7ad[_0xb45c('0x4f')]['id']}})[_0xb45c('0x23')](handleEntityNotFound(_0xe6b70d,null))['then'](removeEntity(_0xe6b70d,null))['catch'](handleError(_0xe6b70d,null));};exports[_0xb45c('0x50')]=function(_0x2f157f,_0x1432ce){return db[_0xb45c('0x2a')][_0xb45c('0x50')]()['then'](respondWithResult(_0x1432ce,null))['catch'](handleError(_0x1432ce,null));}; \ No newline at end of file +var _0x120e=['limit','count','reject','save','update','then','get','Tags','UserProfileResource','destroy','end','name','index','map','Tag','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x3779eb,_0xc19002){var _0x50423a=function(_0x16e841){while(--_0x16e841){_0x3779eb['push'](_0x3779eb['shift']());}};_0x50423a(++_0xc19002);}(_0x120e,0x17a));var _0xe120=function(_0x594a64,_0x1e24be){_0x594a64=_0x594a64-0x0;var _0x370f84=_0x120e[_0x594a64];return _0x370f84;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe120('0x0'));var jsonpatch=require(_0xe120('0x1'));var rp=require('request-promise');var moment=require(_0xe120('0x2'));var BPromise=require(_0xe120('0x3'));var Mustache=require(_0xe120('0x4'));var util=require(_0xe120('0x5'));var path=require(_0xe120('0x6'));var sox=require(_0xe120('0x7'));var csv=require(_0xe120('0x8'));var ejs=require(_0xe120('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe120('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe120('0xb'));var deskjs=require(_0xe120('0xc'));var toCsv=require(_0xe120('0x8'));var querystring=require(_0xe120('0xd'));var Papa=require('papaparse');var Redis=require(_0xe120('0xe'));var authService=require(_0xe120('0xf'));var qs=require(_0xe120('0x10'));var as=require(_0xe120('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe120('0x12'))(_0xe120('0x13'));var utils=require('../../config/utils');var config=require(_0xe120('0x14'));var licenseUtil=require(_0xe120('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x427f58,_0x2957ba){_0x2957ba=_0x2957ba||0xcc;return function(_0x2a98ab){if(_0x2a98ab){return _0x427f58[_0xe120('0x16')](_0x2957ba);}return _0x427f58[_0xe120('0x17')](_0x2957ba)['end']();};}function respondWithResult(_0x134b28,_0x2eb234){_0x2eb234=_0x2eb234||0xc8;return function(_0x2e4041){if(_0x2e4041){return _0x134b28[_0xe120('0x17')](_0x2eb234)[_0xe120('0x18')](_0x2e4041);}};}function respondWithFilteredResult(_0x103627,_0x1ca44c){return function(_0x360141){if(_0x360141){var _0x318093=typeof _0x1ca44c[_0xe120('0x19')]===_0xe120('0x1a')&&typeof _0x1ca44c[_0xe120('0x1b')]==='undefined';var _0x53d0a1=_0x360141[_0xe120('0x1c')];var _0x3eb48c=_0x318093?0x0:_0x1ca44c[_0xe120('0x19')];var _0x415517=_0x318093?_0x360141[_0xe120('0x1c')]:_0x1ca44c[_0xe120('0x19')]+_0x1ca44c[_0xe120('0x1b')];var _0x546e4d;if(_0x415517>=_0x53d0a1){_0x415517=_0x53d0a1;_0x546e4d=0xc8;}else{_0x546e4d=0xce;}_0x103627[_0xe120('0x17')](_0x546e4d);return _0x103627['set']('Content-Range',_0x3eb48c+'-'+_0x415517+'/'+_0x53d0a1)[_0xe120('0x18')](_0x360141);}return null;};}function patchUpdates(_0x8d61b6){return function(_0x2b1756){try{jsonpatch['apply'](_0x2b1756,_0x8d61b6,!![]);}catch(_0x23d7e5){return BPromise[_0xe120('0x1d')](_0x23d7e5);}return _0x2b1756[_0xe120('0x1e')]();};}function saveUpdates(_0x159c08,_0x1de4ab){return function(_0x3f7d5e){if(_0x3f7d5e){return _0x3f7d5e[_0xe120('0x1f')](_0x159c08)[_0xe120('0x20')](function(_0xcefc57){return _0xcefc57;});}return null;};}function removeEntity(_0x7993a1,_0x46cb7b){return function(_0x2e38f3){if(_0x2e38f3){return _0x2e38f3['destroy']()['then'](function(){var _0x5707f0=_0x2e38f3[_0xe120('0x21')]({'plain':!![]});var _0x279dd1=_0xe120('0x22');return db[_0xe120('0x23')][_0xe120('0x24')]({'where':{'type':_0x279dd1,'resourceId':_0x5707f0['id']}})[_0xe120('0x20')](function(){return _0x2e38f3;});})[_0xe120('0x20')](function(){_0x7993a1[_0xe120('0x17')](0xcc)[_0xe120('0x25')]();});}};}function handleEntityNotFound(_0x831228,_0x4aa1e5){return function(_0x2eab49){if(!_0x2eab49){_0x831228[_0xe120('0x16')](0x194);}return _0x2eab49;};}function handleError(_0x1ec5e0,_0x1c3265){_0x1c3265=_0x1c3265||0x1f4;return function(_0x13b101){logger['error'](_0x13b101['stack']);if(_0x13b101[_0xe120('0x26')]){delete _0x13b101[_0xe120('0x26')];}_0x1ec5e0[_0xe120('0x17')](_0x1c3265)['send'](_0x13b101);};}exports[_0xe120('0x27')]=function(_0x220406,_0x3088bb){var _0x164fa4={},_0x56471f={},_0x336ce={'count':0x0,'rows':[]};var _0x334b45=_[_0xe120('0x28')](db[_0xe120('0x29')]['rawAttributes'],function(_0x1d5b90){return{'name':_0x1d5b90[_0xe120('0x2a')],'type':_0x1d5b90['type'][_0xe120('0x2b')]};});_0x56471f[_0xe120('0x2c')]=_[_0xe120('0x28')](_0x334b45,_0xe120('0x26'));_0x56471f[_0xe120('0x2d')]=_['keys'](_0x220406[_0xe120('0x2d')]);_0x56471f[_0xe120('0x2e')]=_[_0xe120('0x2f')](_0x56471f[_0xe120('0x2c')],_0x56471f[_0xe120('0x2d')]);_0x164fa4[_0xe120('0x30')]=_[_0xe120('0x2f')](_0x56471f['model'],qs[_0xe120('0x31')](_0x220406[_0xe120('0x2d')][_0xe120('0x31')]));_0x164fa4[_0xe120('0x30')]=_0x164fa4[_0xe120('0x30')]['length']?_0x164fa4['attributes']:_0x56471f[_0xe120('0x2c')];if(!_0x220406[_0xe120('0x2d')][_0xe120('0x32')](_0xe120('0x33'))){_0x164fa4[_0xe120('0x1b')]=qs['limit'](_0x220406[_0xe120('0x2d')][_0xe120('0x1b')]);_0x164fa4['offset']=qs['offset'](_0x220406['query'][_0xe120('0x19')]);}_0x164fa4[_0xe120('0x34')]=qs[_0xe120('0x35')](_0x220406[_0xe120('0x2d')][_0xe120('0x35')]);_0x164fa4[_0xe120('0x36')]=qs[_0xe120('0x2e')](_[_0xe120('0x37')](_0x220406[_0xe120('0x2d')],_0x56471f[_0xe120('0x2e')]),_0x334b45);if(_0x220406[_0xe120('0x2d')][_0xe120('0x38')]){_0x164fa4[_0xe120('0x36')]=_[_0xe120('0x39')](_0x164fa4[_0xe120('0x36')],{'$or':_['map'](_0x334b45,function(_0x108327){if(_0x108327[_0xe120('0x3a')]!==_0xe120('0x3b')){var _0x591d5f={};_0x591d5f[_0x108327[_0xe120('0x26')]]={'$like':'%'+_0x220406[_0xe120('0x2d')]['filter']+'%'};return _0x591d5f;}})});}_0x164fa4=_['merge']({},_0x164fa4,_0x220406['options']);var _0x27a00e={'where':_0x164fa4[_0xe120('0x36')]};return db[_0xe120('0x29')]['count'](_0x27a00e)[_0xe120('0x20')](function(_0x2bc224){_0x336ce[_0xe120('0x1c')]=_0x2bc224;if(_0x220406[_0xe120('0x2d')][_0xe120('0x3c')]){_0x164fa4[_0xe120('0x3d')]=[{'all':!![]}];}return db[_0xe120('0x29')][_0xe120('0x3e')](_0x164fa4);})['then'](function(_0x42ee54){_0x336ce[_0xe120('0x3f')]=_0x42ee54;return _0x336ce;})[_0xe120('0x20')](respondWithFilteredResult(_0x3088bb,_0x164fa4))[_0xe120('0x40')](handleError(_0x3088bb,null));};exports['show']=function(_0x5cbd02,_0x40e1f8){var _0x33dc9f={'raw':!![],'where':{'id':_0x5cbd02[_0xe120('0x41')]['id']}},_0x4adaa0={};_0x4adaa0[_0xe120('0x2c')]=_[_0xe120('0x42')](db[_0xe120('0x29')][_0xe120('0x43')]);_0x4adaa0[_0xe120('0x2d')]=_[_0xe120('0x42')](_0x5cbd02[_0xe120('0x2d')]);_0x4adaa0[_0xe120('0x2e')]=_[_0xe120('0x2f')](_0x4adaa0[_0xe120('0x2c')],_0x4adaa0[_0xe120('0x2d')]);_0x33dc9f[_0xe120('0x30')]=_[_0xe120('0x2f')](_0x4adaa0[_0xe120('0x2c')],qs[_0xe120('0x31')](_0x5cbd02['query']['fields']));_0x33dc9f[_0xe120('0x30')]=_0x33dc9f['attributes'][_0xe120('0x44')]?_0x33dc9f[_0xe120('0x30')]:_0x4adaa0[_0xe120('0x2c')];if(_0x5cbd02[_0xe120('0x2d')]['includeAll']){_0x33dc9f[_0xe120('0x3d')]=[{'all':!![]}];}_0x33dc9f=_[_0xe120('0x39')]({},_0x33dc9f,_0x5cbd02[_0xe120('0x45')]);return db[_0xe120('0x29')][_0xe120('0x46')](_0x33dc9f)[_0xe120('0x20')](handleEntityNotFound(_0x40e1f8,null))[_0xe120('0x20')](respondWithResult(_0x40e1f8,null))[_0xe120('0x40')](handleError(_0x40e1f8,null));};exports['create']=function(_0x50761c,_0x40a7a4){return db[_0xe120('0x29')][_0xe120('0x47')](_0x50761c['body'],{})['then'](function(_0x37fa0c){var _0x538135=_0x50761c[_0xe120('0x48')][_0xe120('0x21')]({'plain':!![]});if(!_0x538135)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x538135[_0xe120('0x49')]===_0xe120('0x48')){var _0xddfe0d=_0x37fa0c[_0xe120('0x21')]({'plain':!![]});var _0x13d387=_0xe120('0x22');return db[_0xe120('0x4a')][_0xe120('0x46')]({'where':{'name':_0x13d387,'userProfileId':_0x538135[_0xe120('0x4b')]},'raw':!![]})[_0xe120('0x20')](function(_0x5e3820){if(_0x5e3820&&_0x5e3820[_0xe120('0x4c')]===0x0){return db[_0xe120('0x23')][_0xe120('0x47')]({'name':_0xddfe0d['name'],'resourceId':_0xddfe0d['id'],'type':_0x5e3820[_0xe120('0x26')],'sectionId':_0x5e3820['id']},{})[_0xe120('0x20')](function(){return _0x37fa0c;});}else{return _0x37fa0c;}})[_0xe120('0x40')](function(_0x34ff32){logger[_0xe120('0x4d')](_0xe120('0x4e'),_0x34ff32);throw _0x34ff32;});}return _0x37fa0c;})['then'](respondWithResult(_0x40a7a4,0xc9))['catch'](handleError(_0x40a7a4,null));};exports[_0xe120('0x1f')]=function(_0x2549bb,_0x22d5a1){if(_0x2549bb['body']['id']){delete _0x2549bb[_0xe120('0x4f')]['id'];}return db['Tag'][_0xe120('0x46')]({'where':{'id':_0x2549bb[_0xe120('0x41')]['id']}})[_0xe120('0x20')](handleEntityNotFound(_0x22d5a1,null))[_0xe120('0x20')](saveUpdates(_0x2549bb['body'],null))[_0xe120('0x20')](respondWithResult(_0x22d5a1,null))['catch'](handleError(_0x22d5a1,null));};exports[_0xe120('0x24')]=function(_0x43805f,_0x198cc3){return db['Tag'][_0xe120('0x46')]({'where':{'id':_0x43805f['params']['id']}})[_0xe120('0x20')](handleEntityNotFound(_0x198cc3,null))['then'](removeEntity(_0x198cc3,null))[_0xe120('0x40')](handleError(_0x198cc3,null));};exports[_0xe120('0x50')]=function(_0x14330e,_0x5844ba){return db[_0xe120('0x29')][_0xe120('0x50')]()[_0xe120('0x20')](respondWithResult(_0x5844ba,null))[_0xe120('0x40')](handleError(_0x5844ba,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 5375fa2..5e25304 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 _0x13f7=['tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x44fc36,_0x7595c6){var _0x54c8ff=function(_0x2d9d5b){while(--_0x2d9d5b){_0x44fc36['push'](_0x44fc36['shift']());}};_0x54c8ff(++_0x7595c6);}(_0x13f7,0x151));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x713f('0x0'));var util=require('util');var logger=require(_0x713f('0x1'))(_0x713f('0x2'));var moment=require(_0x713f('0x3'));var BPromise=require(_0x713f('0x4'));var rp=require(_0x713f('0x5'));var fs=require('fs');var path=require(_0x713f('0x6'));var rimraf=require(_0x713f('0x7'));var config=require(_0x713f('0x8'));var attributes=require(_0x713f('0x9'));module[_0x713f('0xa')]=function(_0x5edb62,_0x391700){return _0x5edb62['define']('Tag',attributes,{'tableName':_0x713f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbac4=['../../config/environment','exports','define','tools_tags','lodash','util','../../config/logger','api','moment','rimraf'];(function(_0x1b73b2,_0x5c9a9a){var _0x494fbf=function(_0x8d7c88){while(--_0x8d7c88){_0x1b73b2['push'](_0x1b73b2['shift']());}};_0x494fbf(++_0x5c9a9a);}(_0xbac4,0x1b2));var _0x4bac=function(_0x34dc1a,_0x41a261){_0x34dc1a=_0x34dc1a-0x0;var _0x217a76=_0xbac4[_0x34dc1a];return _0x217a76;};'use strict';var _=require(_0x4bac('0x0'));var util=require(_0x4bac('0x1'));var logger=require(_0x4bac('0x2'))(_0x4bac('0x3'));var moment=require(_0x4bac('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4bac('0x5'));var config=require(_0x4bac('0x6'));var attributes=require('./tag.attributes');module[_0x4bac('0x7')]=function(_0x5b0b4b,_0x464a38){return _0x5b0b4b[_0x4bac('0x8')]('Tag',attributes,{'tableName':_0x4bac('0x9'),'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 332a277..38b79b0 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 _0xd6d6=['Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xc680ea,_0x24b877){var _0xe88f13=function(_0x1b21c9){while(--_0x1b21c9){_0xc680ea['push'](_0xc680ea['shift']());}};_0xe88f13(++_0x24b877);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xa035b2,_0x4e494a){_0xa035b2=_0xa035b2-0x0;var _0x1e7b45=_0xd6d6[_0xa035b2];return _0x1e7b45;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('Tag,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});} \ No newline at end of file +var _0x4ea3=['Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x4ea3,0x70));var _0x34ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4ea3[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('Tag,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index fb89510..bf49e8c 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 6b8f0e6..18707d4 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 _0xe706=['STRING','sequelize','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe706,0xa3));var _0x6e70=function(_0x11262c,_0x20d80b){_0x11262c=_0x11262c-0x0;var _0x23977b=_0xe706[_0x11262c];return _0x23977b;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'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 a7dd04f..4555998 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 _0x7663=['findOne','channel','Queue','capitalize','toLowerCase','Queues','addQueues','isValidChannel','ValidationError','Unknown\x20channel','ids','remove','isArray','Voice','Chat','Mail','Sms','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','spread','removeAgents','Fax','Whatsapp','Queue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','user','get','role','Teams','UserProfileSection','userProfileId','error','destroy','params','sequelize','transaction','Sequelize','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','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','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','sendStatus','UserProfileResource'];(function(_0x45ff81,_0x3cb624){var _0x1abf39=function(_0x118836){while(--_0x118836){_0x45ff81['push'](_0x45ff81['shift']());}};_0x1abf39(++_0x3cb624);}(_0x7663,0x156));var _0x3766=function(_0x5066ac,_0x4d28b1){_0x5066ac=_0x5066ac-0x0;var _0x1bc8d9=_0x7663[_0x5066ac];return _0x1bc8d9;};'use strict';var emlformat=require(_0x3766('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3766('0x1'));var jsonpatch=require(_0x3766('0x2'));var rp=require('request-promise');var moment=require(_0x3766('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3766('0x4'));var util=require('util');var path=require(_0x3766('0x5'));var sox=require(_0x3766('0x6'));var csv=require('to-csv');var ejs=require(_0x3766('0x7'));var fs=require('fs');var fs_extra=require(_0x3766('0x8'));var _=require(_0x3766('0x9'));var squel=require(_0x3766('0xa'));var crypto=require(_0x3766('0xb'));var jsforce=require(_0x3766('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3766('0xd'));var Redis=require(_0x3766('0xe'));var authService=require(_0x3766('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3766('0x10'));var hardwareService=require(_0x3766('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x3766('0x12'));var config=require(_0x3766('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3766('0x14'))['db'];config[_0x3766('0x15')]=_[_0x3766('0x16')](config[_0x3766('0x15')],{'host':_0x3766('0x17'),'port':0x18eb});var socket=require(_0x3766('0x18'))(new Redis(config[_0x3766('0x15')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x4678cc,_0x40393b){_0x40393b=_0x40393b||0xcc;return function(_0x27360d){if(_0x27360d){return _0x4678cc['sendStatus'](_0x40393b);}return _0x4678cc['status'](_0x40393b)[_0x3766('0x19')]();};}function respondWithResult(_0x355e3e,_0x3add24){_0x3add24=_0x3add24||0xc8;return function(_0x187ffe){if(_0x187ffe){return _0x355e3e[_0x3766('0x1a')](_0x3add24)['json'](_0x187ffe);}};}function respondWithFilteredResult(_0x59a28d,_0x3706a1){return function(_0x51d602){if(_0x51d602){var _0x22ba85=typeof _0x3706a1[_0x3766('0x1b')]===_0x3766('0x1c')&&typeof _0x3706a1[_0x3766('0x1d')]===_0x3766('0x1c');var _0x2e6734=_0x51d602[_0x3766('0x1e')];var _0x59ea8b=_0x22ba85?0x0:_0x3706a1['offset'];var _0x1ab098=_0x22ba85?_0x51d602[_0x3766('0x1e')]:_0x3706a1[_0x3766('0x1b')]+_0x3706a1[_0x3766('0x1d')];var _0x2eecbf;if(_0x1ab098>=_0x2e6734){_0x1ab098=_0x2e6734;_0x2eecbf=0xc8;}else{_0x2eecbf=0xce;}_0x59a28d[_0x3766('0x1a')](_0x2eecbf);return _0x59a28d[_0x3766('0x1f')]('Content-Range',_0x59ea8b+'-'+_0x1ab098+'/'+_0x2e6734)['json'](_0x51d602);}return null;};}function patchUpdates(_0x2c5b11){return function(_0x518c01){try{jsonpatch[_0x3766('0x20')](_0x518c01,_0x2c5b11,!![]);}catch(_0x467ce6){return BPromise[_0x3766('0x21')](_0x467ce6);}return _0x518c01[_0x3766('0x22')]();};}function saveUpdates(_0x2caa9e,_0x567628){return function(_0x2b6920){if(_0x2b6920){return _0x2b6920[_0x3766('0x23')](_0x2caa9e)[_0x3766('0x24')](function(_0x3b7173){return _0x3b7173;});}return null;};}function handleEntityNotFound(_0x4286f4,_0x47bab9){return function(_0x223d16){if(!_0x223d16){_0x4286f4['sendStatus'](0x194);}return _0x223d16;};}function handleError(_0x1bbe05,_0x17424d){_0x17424d=_0x17424d||0x1f4;return function(_0x102ba5){logger['error'](_0x102ba5[_0x3766('0x25')]);if(_0x102ba5['name']){delete _0x102ba5[_0x3766('0x26')];}_0x1bbe05['status'](_0x17424d)[_0x3766('0x27')](_0x102ba5);};}exports[_0x3766('0x28')]=function(_0x5ec500,_0x2a3716){var _0xc0530a={},_0x28f022={},_0xf83131={'count':0x0,'rows':[]};var _0x19e805=_[_0x3766('0x29')](db[_0x3766('0x2a')][_0x3766('0x2b')],function(_0xa64e4b){return{'name':_0xa64e4b[_0x3766('0x2c')],'type':_0xa64e4b[_0x3766('0x2d')]['key']};});_0x28f022[_0x3766('0x2e')]=_[_0x3766('0x29')](_0x19e805,_0x3766('0x26'));_0x28f022[_0x3766('0x2f')]=_[_0x3766('0x30')](_0x5ec500[_0x3766('0x2f')]);_0x28f022[_0x3766('0x31')]=_[_0x3766('0x32')](_0x28f022[_0x3766('0x2e')],_0x28f022[_0x3766('0x2f')]);_0xc0530a[_0x3766('0x33')]=_['intersection'](_0x28f022['model'],qs[_0x3766('0x34')](_0x5ec500[_0x3766('0x2f')][_0x3766('0x34')]));_0xc0530a['attributes']=_0xc0530a['attributes'][_0x3766('0x35')]?_0xc0530a[_0x3766('0x33')]:_0x28f022[_0x3766('0x2e')];if(!_0x5ec500[_0x3766('0x2f')][_0x3766('0x36')](_0x3766('0x37'))){_0xc0530a[_0x3766('0x1d')]=qs[_0x3766('0x1d')](_0x5ec500[_0x3766('0x2f')]['limit']);_0xc0530a[_0x3766('0x1b')]=qs['offset'](_0x5ec500[_0x3766('0x2f')][_0x3766('0x1b')]);}_0xc0530a[_0x3766('0x38')]=qs[_0x3766('0x39')](_0x5ec500[_0x3766('0x2f')][_0x3766('0x39')]);_0xc0530a['where']=qs['filters'](_[_0x3766('0x3a')](_0x5ec500[_0x3766('0x2f')],_0x28f022[_0x3766('0x31')]),_0x19e805);if(_0x5ec500[_0x3766('0x2f')][_0x3766('0x3b')]){_0xc0530a[_0x3766('0x3c')]=_[_0x3766('0x3d')](_0xc0530a[_0x3766('0x3c')],{'$or':_[_0x3766('0x29')](_0x19e805,function(_0x7ceed){if(_0x7ceed[_0x3766('0x2d')]!==_0x3766('0x3e')){var _0x2561ae={};_0x2561ae[_0x7ceed[_0x3766('0x26')]]={'$like':'%'+_0x5ec500[_0x3766('0x2f')][_0x3766('0x3b')]+'%'};return _0x2561ae;}})});}_0xc0530a=_[_0x3766('0x3d')]({},_0xc0530a,_0x5ec500['options']);var _0x2ec186={'where':_0xc0530a[_0x3766('0x3c')]};return db[_0x3766('0x2a')][_0x3766('0x1e')](_0x2ec186)['then'](function(_0x3107db){_0xf83131[_0x3766('0x1e')]=_0x3107db;if(_0x5ec500[_0x3766('0x2f')][_0x3766('0x3f')]){_0xc0530a[_0x3766('0x40')]=[{'all':!![]}];}return db[_0x3766('0x2a')][_0x3766('0x41')](_0xc0530a);})[_0x3766('0x24')](function(_0x7b2dca){_0xf83131[_0x3766('0x42')]=_0x7b2dca;return _0xf83131;})[_0x3766('0x24')](respondWithFilteredResult(_0x2a3716,_0xc0530a))[_0x3766('0x43')](handleError(_0x2a3716,null));};exports['show']=function(_0x4cc5f9,_0x1dec36){var _0x20e4ff={'raw':![],'where':{'id':_0x4cc5f9['params']['id']}},_0x45bc82={};_0x45bc82[_0x3766('0x2e')]=_[_0x3766('0x30')](db['Team'][_0x3766('0x2b')]);_0x45bc82[_0x3766('0x2f')]=_[_0x3766('0x30')](_0x4cc5f9[_0x3766('0x2f')]);_0x45bc82[_0x3766('0x31')]=_['intersection'](_0x45bc82['model'],_0x45bc82[_0x3766('0x2f')]);_0x20e4ff[_0x3766('0x33')]=_[_0x3766('0x32')](_0x45bc82[_0x3766('0x2e')],qs['fields'](_0x4cc5f9[_0x3766('0x2f')][_0x3766('0x34')]));_0x20e4ff[_0x3766('0x33')]=_0x20e4ff[_0x3766('0x33')][_0x3766('0x35')]?_0x20e4ff[_0x3766('0x33')]:_0x45bc82[_0x3766('0x2e')];if(_0x4cc5f9[_0x3766('0x2f')][_0x3766('0x3f')]){_0x20e4ff[_0x3766('0x40')]=[{'all':!![]}];}_0x20e4ff=_[_0x3766('0x3d')]({},_0x20e4ff,_0x4cc5f9[_0x3766('0x44')]);return db[_0x3766('0x2a')][_0x3766('0x45')](_0x20e4ff)[_0x3766('0x24')](handleEntityNotFound(_0x1dec36,null))['then'](respondWithResult(_0x1dec36,null))[_0x3766('0x43')](handleError(_0x1dec36,null));};exports[_0x3766('0x46')]=function(_0x40909d,_0x4decb4){return db['Team'][_0x3766('0x46')](_0x40909d[_0x3766('0x47')],{})[_0x3766('0x24')](function(_0x3fcc4e){var _0x353103=_0x40909d[_0x3766('0x48')][_0x3766('0x49')]({'plain':!![]});if(!_0x353103)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x353103[_0x3766('0x4a')]===_0x3766('0x48')){var _0x4f974b=_0x3fcc4e[_0x3766('0x49')]({'plain':!![]});var _0x2890b1=_0x3766('0x4b');return db[_0x3766('0x4c')]['find']({'where':{'name':_0x2890b1,'userProfileId':_0x353103[_0x3766('0x4d')]},'raw':!![]})['then'](function(_0x3c09e9){if(_0x3c09e9&&_0x3c09e9['autoAssociation']===0x0){return db['UserProfileResource'][_0x3766('0x46')]({'name':_0x4f974b[_0x3766('0x26')],'resourceId':_0x4f974b['id'],'type':_0x3c09e9[_0x3766('0x26')],'sectionId':_0x3c09e9['id']},{})[_0x3766('0x24')](function(){return _0x3fcc4e;});}else{return _0x3fcc4e;}})[_0x3766('0x43')](function(_0x332d79){logger[_0x3766('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x332d79);throw _0x332d79;});}return _0x3fcc4e;})[_0x3766('0x24')](respondWithResult(_0x4decb4,0xc9))['catch'](handleError(_0x4decb4,null));};exports['update']=function(_0x6a0fd2,_0x415c12){if(_0x6a0fd2[_0x3766('0x47')]['id']){delete _0x6a0fd2[_0x3766('0x47')]['id'];}return db['Team']['find']({'where':{'id':_0x6a0fd2['params']['id']}})['then'](handleEntityNotFound(_0x415c12,null))[_0x3766('0x24')](saveUpdates(_0x6a0fd2['body'],null))[_0x3766('0x24')](respondWithResult(_0x415c12,null))['catch'](handleError(_0x415c12,null));};exports[_0x3766('0x4f')]=function(_0x5f5d4c,_0xa87da9){var _0x3de5f1=_0x5f5d4c[_0x3766('0x50')]['id'];var _0x893d37=[];return db[_0x3766('0x51')][_0x3766('0x52')](function(_0x4aa07b){var _0x58fea0='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x3de5f1;return db[_0x3766('0x51')][_0x3766('0x2f')](_0x58fea0,{'type':db[_0x3766('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4aa07b})[_0x3766('0x24')](function(_0x50c470){_0x893d37=_['map'](_0x50c470,function(_0x177813){return Number(_0x177813[_0x3766('0x54')]);});})[_0x3766('0x24')](function(){var _0x2fc6ae=_0x3766('0x55')+_0x3de5f1;return db[_0x3766('0x51')][_0x3766('0x2f')](_0x2fc6ae,{'type':db['Sequelize'][_0x3766('0x56')][_0x3766('0x57')],'raw':!![],'transaction':_0x4aa07b});})[_0x3766('0x24')](function(_0x496f4f){var _0x581d95=_['map'](_0x496f4f,function(_0x42f542){return Number(_0x42f542[_0x3766('0x58')]);});return db[_0x3766('0x59')]['destroy']({'where':{'UserId':{'$in':_0x893d37},'VoiceQueueId':{'$in':_0x581d95}},'transaction':_0x4aa07b});})[_0x3766('0x24')](function(){var _0x25da72=_0x3766('0x5a')+_0x3de5f1;return db[_0x3766('0x51')][_0x3766('0x2f')](_0x25da72,{'type':db[_0x3766('0x53')]['QueryTypes'][_0x3766('0x57')],'raw':!![],'transaction':_0x4aa07b});})[_0x3766('0x24')](function(_0x14adc4){var _0x57d201=_[_0x3766('0x29')](_0x14adc4,function(_0x4f08c3){return Number(_0x4f08c3[_0x3766('0x5b')]);});return db['UserMailQueue'][_0x3766('0x4f')]({'where':{'UserId':{'$in':_0x893d37},'MailQueueId':{'$in':_0x57d201}},'transaction':_0x4aa07b});})[_0x3766('0x24')](function(){var _0x3ab451=_0x3766('0x5c')+_0x3de5f1;return db['sequelize'][_0x3766('0x2f')](_0x3ab451,{'type':db['Sequelize'][_0x3766('0x56')][_0x3766('0x57')],'raw':!![],'transaction':_0x4aa07b});})['then'](function(_0x3c24e2){var _0x1ba5c0=_[_0x3766('0x29')](_0x3c24e2,function(_0x21c522){return Number(_0x21c522[_0x3766('0x5d')]);});return db[_0x3766('0x5e')][_0x3766('0x4f')]({'where':{'UserId':{'$in':_0x893d37},'SmsQueueId':{'$in':_0x1ba5c0}},'transaction':_0x4aa07b});})['then'](function(){var _0x52a26b=_0x3766('0x5f')+_0x3de5f1;return db[_0x3766('0x51')]['query'](_0x52a26b,{'type':db[_0x3766('0x53')][_0x3766('0x56')][_0x3766('0x57')],'raw':!![],'transaction':_0x4aa07b});})[_0x3766('0x24')](function(_0x39c5a3){var _0x128fcf=_[_0x3766('0x29')](_0x39c5a3,function(_0x548c8c){return Number(_0x548c8c[_0x3766('0x60')]);});return db[_0x3766('0x61')][_0x3766('0x4f')]({'where':{'UserId':{'$in':_0x893d37},'ChatQueueId':{'$in':_0x128fcf}},'transaction':_0x4aa07b});})[_0x3766('0x24')](function(){var _0x262a5f='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3de5f1;return db[_0x3766('0x51')][_0x3766('0x2f')](_0x262a5f,{'type':db['Sequelize'][_0x3766('0x56')][_0x3766('0x57')],'raw':!![],'transaction':_0x4aa07b});})[_0x3766('0x24')](function(_0x1ec2a9){var _0x3599a6=_['map'](_0x1ec2a9,function(_0x31268c){return Number(_0x31268c[_0x3766('0x62')]);});return db[_0x3766('0x63')][_0x3766('0x4f')]({'where':{'UserId':{'$in':_0x893d37},'FaxQueueId':{'$in':_0x3599a6}},'transaction':_0x4aa07b});})['then'](function(){var _0x2d6903=_0x3766('0x64')+_0x3de5f1;return db[_0x3766('0x51')][_0x3766('0x2f')](_0x2d6903,{'type':db[_0x3766('0x53')][_0x3766('0x56')][_0x3766('0x57')],'raw':!![],'transaction':_0x4aa07b});})[_0x3766('0x24')](function(_0x3d390f){var _0x185f03=_[_0x3766('0x29')](_0x3d390f,function(_0x17932b){return Number(_0x17932b[_0x3766('0x65')]);});return db['UserOpenchannelQueue'][_0x3766('0x4f')]({'where':{'UserId':{'$in':_0x893d37},'OpenchannelQueueId':{'$in':_0x185f03}},'transaction':_0x4aa07b});})['then'](function(){var _0x244406='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3de5f1;return db['sequelize'][_0x3766('0x2f')](_0x244406,{'type':db[_0x3766('0x53')][_0x3766('0x56')][_0x3766('0x57')],'raw':!![],'transaction':_0x4aa07b});})[_0x3766('0x24')](function(_0x1b4ff7){var _0x1c2c1d=_[_0x3766('0x29')](_0x1b4ff7,function(_0x4a5f75){return Number(_0x4a5f75[_0x3766('0x66')]);});return db['UserWhatsappQueue'][_0x3766('0x4f')]({'where':{'UserId':{'$in':_0x893d37},'WhatsappQueueId':{'$in':_0x1c2c1d}},'transaction':_0x4aa07b});})[_0x3766('0x24')](function(){return db[_0x3766('0x67')][_0x3766('0x45')]({'where':{'TeamId':_0x3de5f1}});})[_0x3766('0x24')](function(_0x1309e7){if(_0x1309e7===null){return;}return db[_0x3766('0x68')][_0x3766('0x4f')]({'where':{'UserId':{'$in':_0x893d37},'VoicePrefixId':_0x1309e7[_0x3766('0x69')]},'transaction':_0x4aa07b});})[_0x3766('0x24')](function(){return db[_0x3766('0x2a')]['destroy']({'where':{'id':_0x3de5f1},'cascade':!![],'transaction':_0x4aa07b});})[_0x3766('0x24')](function(_0x551839){if(_0x551839===0x0){_0xa87da9[_0x3766('0x6a')](0x194);}else{return db[_0x3766('0x6b')][_0x3766('0x4f')]({'where':{'type':_0x3766('0x4b'),'resourceId':_0x3de5f1},'cascade':!![],'transaction':_0x4aa07b})[_0x3766('0x24')](function(){_0xa87da9[_0x3766('0x1a')](0xcc)['end']();});}})[_0x3766('0x43')](function(_0x9dbea){_0xa87da9['status'](0x1f4)['send'](_0x9dbea);});});};exports['getQueues']=function(_0x3d359f,_0x56208d,_0x4ddcae){return db[_0x3766('0x2a')][_0x3766('0x6c')]({'where':{'id':_0x3d359f[_0x3766('0x50')]['id']}})[_0x3766('0x24')](handleEntityNotFound(_0x56208d,null))['then'](function(_0x5a6cca){if(!_0x3d359f[_0x3766('0x2f')][_0x3766('0x6d')]||!utils['isValidChannel'](_0x3d359f[_0x3766('0x2f')][_0x3766('0x6d')])){throw new db[(_0x3766('0x53'))]['ValidationError']('Unknown\x20channel');}var _0x25fd72={};var _0x313f88={};_0x313f88[_0x3766('0x2e')]=_['keys'](db[_['capitalize'](_0x3d359f[_0x3766('0x2f')][_0x3766('0x6d')]['toLowerCase']())+_0x3766('0x6e')][_0x3766('0x2b')]);_0x313f88[_0x3766('0x2f')]=_[_0x3766('0x30')](_0x3d359f[_0x3766('0x2f')]);_0x313f88[_0x3766('0x31')]=_[_0x3766('0x32')](_0x313f88[_0x3766('0x2e')],_0x313f88['query']);_0x25fd72['attributes']=_[_0x3766('0x32')](_0x313f88[_0x3766('0x2e')],qs[_0x3766('0x34')](_0x3d359f[_0x3766('0x2f')][_0x3766('0x34')]));_0x25fd72[_0x3766('0x33')]=_0x25fd72[_0x3766('0x33')]['length']?_0x25fd72[_0x3766('0x33')]:_0x313f88[_0x3766('0x2e')];_0x25fd72[_0x3766('0x1d')]=qs['limit'](_0x3d359f[_0x3766('0x2f')][_0x3766('0x1d')]);_0x25fd72[_0x3766('0x1b')]=qs[_0x3766('0x1b')](_0x3d359f[_0x3766('0x2f')][_0x3766('0x1b')]);_0x25fd72['order']=qs[_0x3766('0x39')](_0x3d359f[_0x3766('0x2f')][_0x3766('0x39')]);_0x25fd72[_0x3766('0x3c')]=qs['filters'](_[_0x3766('0x3a')](_0x3d359f[_0x3766('0x2f')],_0x313f88[_0x3766('0x31')]));_0x25fd72=_['merge']({},_0x25fd72,_0x3d359f[_0x3766('0x44')]);return _0x5a6cca['get'+_[_0x3766('0x6f')](_0x3d359f[_0x3766('0x2f')][_0x3766('0x6d')][_0x3766('0x70')]())+_0x3766('0x71')](_0x25fd72);})[_0x3766('0x24')](respondWithResult(_0x56208d,null))[_0x3766('0x43')](handleError(_0x56208d,null));};exports[_0x3766('0x72')]=function(_0x106c4c,_0x55b9b4,_0x1000c2){return db['Team'][_0x3766('0x6c')]({'where':{'id':_0x106c4c[_0x3766('0x50')]['id']}})[_0x3766('0x24')](function(_0x3eebb1){if(_0x3eebb1){if(!_0x106c4c[_0x3766('0x47')]['channel']||!utils[_0x3766('0x73')](_0x106c4c[_0x3766('0x47')]['channel'])){throw new db[(_0x3766('0x53'))][(_0x3766('0x74'))](_0x3766('0x75'));}return _0x3eebb1['add'+_[_0x3766('0x6f')](_0x106c4c['body']['channel'][_0x3766('0x70')]())+_0x3766('0x71')](_0x106c4c['body'][_0x3766('0x76')]);}return null;})[_0x3766('0x24')](handleEntityNotFound(_0x55b9b4,null))[_0x3766('0x24')](respondWithStatusCode(_0x55b9b4,null))['catch'](handleError(_0x55b9b4,null));};exports['removeQueues']=function(_0x522cf6,_0x207984,_0x3d41b6){return db[_0x3766('0x2a')][_0x3766('0x6c')]({'where':{'id':_0x522cf6[_0x3766('0x50')]['id']}})['then'](function(_0x433611){if(_0x433611){if(!_0x522cf6[_0x3766('0x2f')]['channel']||!utils[_0x3766('0x73')](_0x522cf6['query'][_0x3766('0x6d')])){throw new db['Sequelize'][(_0x3766('0x74'))]('Unknown\x20channel');}return _0x433611[_0x3766('0x77')+_[_0x3766('0x6f')](_0x522cf6[_0x3766('0x2f')][_0x3766('0x6d')][_0x3766('0x70')]())+_0x3766('0x71')](_0x522cf6[_0x3766('0x2f')][_0x3766('0x76')]);}return null;})['then'](handleEntityNotFound(_0x207984,null))['then'](respondWithStatusCode(_0x207984,null))['catch'](handleError(_0x207984,null));};exports['addAgents']=function(_0x129bef,_0x1a140e){var _0x3b0e38=_[_0x3766('0x78')](_0x129bef['body'][_0x3766('0x76')])?_0x129bef[_0x3766('0x47')][_0x3766('0x76')]:[_0x129bef['body'][_0x3766('0x76')]];var _0x119f56=_0x129bef[_0x3766('0x50')]['id'];return db[_0x3766('0x2a')][_0x3766('0x45')]({'where':{'id':_0x119f56}})[_0x3766('0x24')](handleEntityNotFound(_0x1a140e,null))[_0x3766('0x24')](function(_0x4eb32c){if(_0x4eb32c){var _0x39d6e9=[_0x3766('0x79'),_0x3766('0x7a'),_0x3766('0x7b'),_0x3766('0x7c'),'Fax',_0x3766('0x7d'),'Whatsapp'];return db[_0x3766('0x51')][_0x3766('0x52')](function(_0x5f459f){var _0x113761=_[_0x3766('0x29')](_0x39d6e9,function(_0x3ba4f0){var _0x32c74c={'attributes':['id',_0x3766('0x26')]};if(_0x3ba4f0===_0x3766('0x79')){_0x32c74c[_0x3766('0x7e')]={'attributes':[_0x3766('0x7f')]};}return _0x4eb32c[_0x3766('0x49')+_0x3ba4f0+_0x3766('0x71')](_0x32c74c)[_0x3766('0x24')](function(_0x3fa39e){var _0xde6e4=_[_0x3766('0x29')](_0x3fa39e,function(_0xeaa393){var _0x520157=_[_0x3766('0x29')](_0x3b0e38,function(_0x4c93a7){var _0x166466={'where':{'UserId':_0x4c93a7,[_0x3ba4f0+_0x3766('0x80')]:_0xeaa393['id']},'transaction':_0x5f459f};if(_0x3ba4f0===_0x3766('0x79')){_0x166466[_0x3766('0x16')]={'penalty':_0xeaa393[_0x3766('0x81')][_0x3766('0x7f')]};}return db[_0x3766('0x82')+_0x3ba4f0+'Queue'][_0x3766('0x83')](_0x166466)[_0x3766('0x24')](function(){socket[_0x3766('0x84')](_0x3766('0x48')+_0x3ba4f0+_0x3766('0x85'),{'UserId':_0x4c93a7,[_0x3ba4f0+_0x3766('0x80')]:_0xeaa393['id']});if(_0x3ba4f0!=='Voice'){return;}return db[_0x3766('0x82')][_0x3766('0x41')]({'where':{'id':_0x3b0e38,'online':0x1},'attributes':['id',_0x3766('0x26'),_0x3766('0x86'),_0x3766('0x87'),_0x3766('0x88')],'raw':!![]})[_0x3766('0x24')](function(_0x1bae60){var _0x2485fe=_[_0x3766('0x29')](_0x1bae60,function(_0x37287d){return db[_0x3766('0x89')][_0x3766('0x8a')]({'membername':_0x37287d[_0x3766('0x26')],'UserId':_0x37287d['id'],'queue_name':_0xeaa393[_0x3766('0x26')],'VoiceQueueId':_0xeaa393['id'],'interface':_[_0x3766('0x8b')](_0x37287d[_0x3766('0x88')])?util[_0x3766('0x8c')](_0x3766('0x8d'),_0x37287d[_0x3766('0x26')]):_0x37287d['interface'],'paused':_0x37287d[_0x3766('0x87')]||![],'penalty':_0xeaa393[_0x3766('0x81')]['penalty']},{'transaction':_0x5f459f});});return Promise[_0x3766('0x8e')](_0x2485fe);});});});return Promise[_0x3766('0x8e')](_0x520157);});return Promise[_0x3766('0x8e')](_0xde6e4);})['then'](function(){return db[_0x3766('0x67')][_0x3766('0x6c')]({'where':{'teamId':_0x119f56}})['then'](function(_0x29fe05){if(_0x29fe05){var _0xa220d1=_[_0x3766('0x29')](_0x3b0e38,function(_0xf7a7e7){db[_0x3766('0x68')]['upsert']({'UserId':_0xf7a7e7,'VoicePrefixId':_0x29fe05[_0x3766('0x69')]});});return Promise[_0x3766('0x8e')](_0xa220d1);}});});});return Promise['all'](_0x113761)[_0x3766('0x24')](function(){return _0x4eb32c[_0x3766('0x8f')](_0x3b0e38,{'transaction':_0x5f459f})[_0x3766('0x90')](function(_0x25c1bd){return _0x25c1bd;});});});}})[_0x3766('0x24')](respondWithResult(_0x1a140e,null))[_0x3766('0x43')](handleError(_0x1a140e,null));};exports[_0x3766('0x91')]=function(_0x373632,_0x540235){var _0x67a661=_[_0x3766('0x78')](_0x373632[_0x3766('0x2f')]['ids'])?_0x373632[_0x3766('0x2f')]['ids']:[_0x373632[_0x3766('0x2f')][_0x3766('0x76')]];var _0x48484f=_0x373632['params']['id'];return db[_0x3766('0x2a')][_0x3766('0x45')]({'where':{'id':_0x48484f}})['then'](handleEntityNotFound(_0x540235,null))[_0x3766('0x24')](function(_0xb75918){if(_0xb75918){var _0x2770cb=[_0x3766('0x79'),_0x3766('0x7a'),_0x3766('0x7b'),_0x3766('0x7c'),_0x3766('0x92'),'Openchannel',_0x3766('0x93')];return db[_0x3766('0x51')][_0x3766('0x52')](function(_0x51e5a9){var _0x3bc065=_[_0x3766('0x29')](_0x2770cb,function(_0x234ccc){var _0x38473b={'attributes':['id','name']};return _0xb75918['get'+_0x234ccc+_0x3766('0x71')](_0x38473b)[_0x3766('0x24')](function(_0x347134){var _0x3cea5b=_[_0x3766('0x29')](_0x347134,function(_0x570170){return _0x570170[_0x3766('0x91')](_0x67a661,{'transaction':_0x51e5a9})['then'](function(){var _0x42943e=_[_0x3766('0x29')](_0x67a661,function(_0x17d63b){socket['emit'](_0x3766('0x48')+_0x234ccc+_0x3766('0x94'),{'UserId':Number(_0x17d63b),[_0x234ccc+_0x3766('0x80')]:_0x570170['id']});if(_0x234ccc!==_0x3766('0x79')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x570170['id'],'UserId':_0x17d63b},'transaction':_0x51e5a9});});return Promise['all'](_0x42943e);});});return Promise[_0x3766('0x8e')](_0x3cea5b);});});return Promise[_0x3766('0x8e')](_0x3bc065)['then'](function(){return _0xb75918[_0x3766('0x91')](_0x67a661,{'transaction':_0x51e5a9});})['then'](function(){return db[_0x3766('0x67')]['findOne']({'where':{'teamId':_0x48484f}})[_0x3766('0x24')](function(_0x2362ba){if(_0x2362ba){var _0x52fa07=_['map'](_0x67a661,function(_0x234d1b){db[_0x3766('0x68')]['destroy']({'where':{'UserId':_0x234d1b,'VoicePrefixId':_0x2362ba[_0x3766('0x69')]}});});return Promise[_0x3766('0x8e')](_0x52fa07);}});});});}})[_0x3766('0x24')](respondWithStatusCode(_0x540235,null))[_0x3766('0x43')](handleError(_0x540235,null));};exports[_0x3766('0x95')]=function(_0x2a6d24,_0x394d80,_0x1eca36){var _0x4531bc={};var _0x5e18c9={};var _0xa56add;var _0x40076e;return db[_0x3766('0x2a')][_0x3766('0x6c')]({'where':{'id':_0x2a6d24[_0x3766('0x50')]['id']}})[_0x3766('0x24')](handleEntityNotFound(_0x394d80,null))[_0x3766('0x24')](function(_0x270fd7){if(_0x270fd7){_0xa56add=_0x270fd7;_0x5e18c9['model']=_['keys'](db['User'][_0x3766('0x2b')]);_0x5e18c9[_0x3766('0x2f')]=_[_0x3766('0x30')](_0x2a6d24['query']);_0x5e18c9[_0x3766('0x31')]=_[_0x3766('0x32')](_0x5e18c9[_0x3766('0x2e')],_0x5e18c9[_0x3766('0x2f')]);_0x4531bc[_0x3766('0x33')]=_[_0x3766('0x32')](_0x5e18c9[_0x3766('0x2e')],qs[_0x3766('0x34')](_0x2a6d24[_0x3766('0x2f')][_0x3766('0x34')]));_0x4531bc[_0x3766('0x33')]=_0x4531bc[_0x3766('0x33')][_0x3766('0x35')]?_0x4531bc[_0x3766('0x33')]:_0x5e18c9[_0x3766('0x2e')];_0x4531bc[_0x3766('0x38')]=qs['sort'](_0x2a6d24['query'][_0x3766('0x39')]);_0x4531bc[_0x3766('0x3c')]=qs[_0x3766('0x31')](_[_0x3766('0x3a')](_0x2a6d24['query'],_0x5e18c9['filters']));if(_0x2a6d24['query']['filter']){_0x4531bc['where']=_['merge'](_0x4531bc[_0x3766('0x3c')],{'$or':_['map'](_0x4531bc[_0x3766('0x33')],function(_0x590dbf){var _0x4fa9ea={};_0x4fa9ea[_0x590dbf]={'$like':'%'+_0x2a6d24['query']['filter']+'%'};return _0x4fa9ea;})});}_0x4531bc=_[_0x3766('0x3d')]({},_0x4531bc,_0x2a6d24[_0x3766('0x44')]);return _0xa56add[_0x3766('0x95')](_0x4531bc);}})[_0x3766('0x24')](function(_0x39130d){if(_0x39130d){_0x40076e=_0x39130d[_0x3766('0x35')];if(!_0x2a6d24[_0x3766('0x2f')][_0x3766('0x36')](_0x3766('0x37'))){_0x4531bc[_0x3766('0x1d')]=qs[_0x3766('0x1d')](_0x2a6d24[_0x3766('0x2f')][_0x3766('0x1d')]);_0x4531bc[_0x3766('0x1b')]=qs[_0x3766('0x1b')](_0x2a6d24[_0x3766('0x2f')][_0x3766('0x1b')]);}return _0xa56add['getAgents'](_0x4531bc);}})[_0x3766('0x24')](function(_0x2ca949){if(_0x2ca949){return _0x2ca949?{'count':_0x40076e,'rows':_0x2ca949}:null;}})[_0x3766('0x24')](respondWithResult(_0x394d80,null))[_0x3766('0x43')](handleError(_0x394d80,null));}; \ No newline at end of file +var _0xb8b1=['request-promise','moment','bluebird','mustache','path','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','../../mysqldb','redis','localhost','./team.socket','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','Team','then','includeAll','include','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','end','send','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','add','ids','removeQueues','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','through','penalty','defaults','User','findOrCreate','emit','Queue:save','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','TeamVoiceQueue','all','UserVoicePrefix','spread','removeAgents','QueueId','VoicePrefixId','getAgents','filter','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x33fa2a,_0x245c7e){var _0x5ba0b6=function(_0x5a768d){while(--_0x5a768d){_0x33fa2a['push'](_0x33fa2a['shift']());}};_0x5ba0b6(++_0x245c7e);}(_0xb8b1,0x1ca));var _0x1b8b=function(_0x355e8e,_0x4313f0){_0x355e8e=_0x355e8e-0x0;var _0x52cb43=_0xb8b1[_0x355e8e];return _0x52cb43;};'use strict';var emlformat=require(_0x1b8b('0x0'));var rimraf=require(_0x1b8b('0x1'));var zipdir=require(_0x1b8b('0x2'));var jsonpatch=require(_0x1b8b('0x3'));var rp=require(_0x1b8b('0x4'));var moment=require(_0x1b8b('0x5'));var BPromise=require(_0x1b8b('0x6'));var Mustache=require(_0x1b8b('0x7'));var util=require('util');var path=require(_0x1b8b('0x8'));var sox=require('sox');var csv=require(_0x1b8b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b8b('0xa'));var _=require(_0x1b8b('0xb'));var squel=require(_0x1b8b('0xc'));var crypto=require(_0x1b8b('0xd'));var jsforce=require(_0x1b8b('0xe'));var deskjs=require(_0x1b8b('0xf'));var toCsv=require(_0x1b8b('0x9'));var querystring=require(_0x1b8b('0x10'));var Papa=require(_0x1b8b('0x11'));var Redis=require(_0x1b8b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1b8b('0x13'));var as=require(_0x1b8b('0x14'));var hardwareService=require(_0x1b8b('0x15'));var logger=require(_0x1b8b('0x16'))('api');var utils=require(_0x1b8b('0x17'));var config=require(_0x1b8b('0x18'));var licenseUtil=require(_0x1b8b('0x19'));var db=require(_0x1b8b('0x1a'))['db'];config[_0x1b8b('0x1b')]=_['defaults'](config[_0x1b8b('0x1b')],{'host':_0x1b8b('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b8b('0x1b')]));require(_0x1b8b('0x1d'))['register'](socket);function respondWithStatusCode(_0x34b3fd,_0x6214ba){_0x6214ba=_0x6214ba||0xcc;return function(_0x57fa5d){if(_0x57fa5d){return _0x34b3fd[_0x1b8b('0x1e')](_0x6214ba);}return _0x34b3fd[_0x1b8b('0x1f')](_0x6214ba)['end']();};}function respondWithResult(_0x1072b1,_0xf7b7ab){_0xf7b7ab=_0xf7b7ab||0xc8;return function(_0x4bfff7){if(_0x4bfff7){return _0x1072b1[_0x1b8b('0x1f')](_0xf7b7ab)[_0x1b8b('0x20')](_0x4bfff7);}};}function respondWithFilteredResult(_0x5a4877,_0xe7cee){return function(_0x1d4abb){if(_0x1d4abb){var _0x4a17ae=typeof _0xe7cee[_0x1b8b('0x21')]==='undefined'&&typeof _0xe7cee[_0x1b8b('0x22')]==='undefined';var _0x29c3e2=_0x1d4abb[_0x1b8b('0x23')];var _0x56f3f8=_0x4a17ae?0x0:_0xe7cee[_0x1b8b('0x21')];var _0xcdd02f=_0x4a17ae?_0x1d4abb[_0x1b8b('0x23')]:_0xe7cee[_0x1b8b('0x21')]+_0xe7cee[_0x1b8b('0x22')];var _0x33dc4a;if(_0xcdd02f>=_0x29c3e2){_0xcdd02f=_0x29c3e2;_0x33dc4a=0xc8;}else{_0x33dc4a=0xce;}_0x5a4877[_0x1b8b('0x1f')](_0x33dc4a);return _0x5a4877[_0x1b8b('0x24')]('Content-Range',_0x56f3f8+'-'+_0xcdd02f+'/'+_0x29c3e2)[_0x1b8b('0x20')](_0x1d4abb);}return null;};}function patchUpdates(_0x1b6d50){return function(_0x1f6f19){try{jsonpatch[_0x1b8b('0x25')](_0x1f6f19,_0x1b6d50,!![]);}catch(_0x5edd64){return BPromise[_0x1b8b('0x26')](_0x5edd64);}return _0x1f6f19[_0x1b8b('0x27')]();};}function saveUpdates(_0x52d9dd,_0xc2e8ba){return function(_0x45648e){if(_0x45648e){return _0x45648e[_0x1b8b('0x28')](_0x52d9dd)['then'](function(_0x299981){return _0x299981;});}return null;};}function handleEntityNotFound(_0x115d68,_0x2e4c8e){return function(_0x43bb4a){if(!_0x43bb4a){_0x115d68[_0x1b8b('0x1e')](0x194);}return _0x43bb4a;};}function handleError(_0x24a761,_0x5cb7f8){_0x5cb7f8=_0x5cb7f8||0x1f4;return function(_0x31f762){logger[_0x1b8b('0x29')](_0x31f762[_0x1b8b('0x2a')]);if(_0x31f762[_0x1b8b('0x2b')]){delete _0x31f762['name'];}_0x24a761[_0x1b8b('0x1f')](_0x5cb7f8)['send'](_0x31f762);};}exports[_0x1b8b('0x2c')]=function(_0x232530,_0x41bb0d){var _0x115760={},_0x4a3072={},_0x505119={'count':0x0,'rows':[]};var _0x5a8e34=_[_0x1b8b('0x2d')](db['Team'][_0x1b8b('0x2e')],function(_0x3ebf6e){return{'name':_0x3ebf6e['fieldName'],'type':_0x3ebf6e[_0x1b8b('0x2f')][_0x1b8b('0x30')]};});_0x4a3072[_0x1b8b('0x31')]=_['map'](_0x5a8e34,'name');_0x4a3072['query']=_['keys'](_0x232530[_0x1b8b('0x32')]);_0x4a3072[_0x1b8b('0x33')]=_[_0x1b8b('0x34')](_0x4a3072[_0x1b8b('0x31')],_0x4a3072[_0x1b8b('0x32')]);_0x115760[_0x1b8b('0x35')]=_[_0x1b8b('0x34')](_0x4a3072[_0x1b8b('0x31')],qs['fields'](_0x232530['query'][_0x1b8b('0x36')]));_0x115760['attributes']=_0x115760[_0x1b8b('0x35')][_0x1b8b('0x37')]?_0x115760[_0x1b8b('0x35')]:_0x4a3072[_0x1b8b('0x31')];if(!_0x232530[_0x1b8b('0x32')][_0x1b8b('0x38')](_0x1b8b('0x39'))){_0x115760['limit']=qs[_0x1b8b('0x22')](_0x232530[_0x1b8b('0x32')]['limit']);_0x115760['offset']=qs[_0x1b8b('0x21')](_0x232530[_0x1b8b('0x32')][_0x1b8b('0x21')]);}_0x115760[_0x1b8b('0x3a')]=qs[_0x1b8b('0x3b')](_0x232530[_0x1b8b('0x32')][_0x1b8b('0x3b')]);_0x115760[_0x1b8b('0x3c')]=qs[_0x1b8b('0x33')](_[_0x1b8b('0x3d')](_0x232530[_0x1b8b('0x32')],_0x4a3072[_0x1b8b('0x33')]),_0x5a8e34);if(_0x232530[_0x1b8b('0x32')]['filter']){_0x115760[_0x1b8b('0x3c')]=_[_0x1b8b('0x3e')](_0x115760[_0x1b8b('0x3c')],{'$or':_[_0x1b8b('0x2d')](_0x5a8e34,function(_0x3a6a6d){if(_0x3a6a6d[_0x1b8b('0x2f')]!==_0x1b8b('0x3f')){var _0x2c612e={};_0x2c612e[_0x3a6a6d[_0x1b8b('0x2b')]]={'$like':'%'+_0x232530['query']['filter']+'%'};return _0x2c612e;}})});}_0x115760=_[_0x1b8b('0x3e')]({},_0x115760,_0x232530['options']);var _0x19443d={'where':_0x115760['where']};return db[_0x1b8b('0x40')]['count'](_0x19443d)[_0x1b8b('0x41')](function(_0x5dbf2c){_0x505119['count']=_0x5dbf2c;if(_0x232530[_0x1b8b('0x32')][_0x1b8b('0x42')]){_0x115760[_0x1b8b('0x43')]=[{'all':!![]}];}return db[_0x1b8b('0x40')]['findAll'](_0x115760);})[_0x1b8b('0x41')](function(_0x3ec53c){_0x505119[_0x1b8b('0x44')]=_0x3ec53c;return _0x505119;})[_0x1b8b('0x41')](respondWithFilteredResult(_0x41bb0d,_0x115760))[_0x1b8b('0x45')](handleError(_0x41bb0d,null));};exports[_0x1b8b('0x46')]=function(_0x10ae07,_0x22bd80){var _0x1cfc05={'raw':![],'where':{'id':_0x10ae07[_0x1b8b('0x47')]['id']}},_0x1a2a36={};_0x1a2a36[_0x1b8b('0x31')]=_[_0x1b8b('0x48')](db['Team']['rawAttributes']);_0x1a2a36[_0x1b8b('0x32')]=_[_0x1b8b('0x48')](_0x10ae07[_0x1b8b('0x32')]);_0x1a2a36['filters']=_[_0x1b8b('0x34')](_0x1a2a36[_0x1b8b('0x31')],_0x1a2a36[_0x1b8b('0x32')]);_0x1cfc05[_0x1b8b('0x35')]=_[_0x1b8b('0x34')](_0x1a2a36['model'],qs[_0x1b8b('0x36')](_0x10ae07[_0x1b8b('0x32')]['fields']));_0x1cfc05['attributes']=_0x1cfc05[_0x1b8b('0x35')][_0x1b8b('0x37')]?_0x1cfc05[_0x1b8b('0x35')]:_0x1a2a36[_0x1b8b('0x31')];if(_0x10ae07[_0x1b8b('0x32')][_0x1b8b('0x42')]){_0x1cfc05[_0x1b8b('0x43')]=[{'all':!![]}];}_0x1cfc05=_[_0x1b8b('0x3e')]({},_0x1cfc05,_0x10ae07[_0x1b8b('0x49')]);return db[_0x1b8b('0x40')][_0x1b8b('0x4a')](_0x1cfc05)[_0x1b8b('0x41')](handleEntityNotFound(_0x22bd80,null))[_0x1b8b('0x41')](respondWithResult(_0x22bd80,null))[_0x1b8b('0x45')](handleError(_0x22bd80,null));};exports[_0x1b8b('0x4b')]=function(_0x3ecfb7,_0x259237){return db['Team'][_0x1b8b('0x4b')](_0x3ecfb7[_0x1b8b('0x4c')],{})['then'](function(_0x4582bc){var _0x495335=_0x3ecfb7[_0x1b8b('0x4d')]['get']({'plain':!![]});if(!_0x495335)throw new Error(_0x1b8b('0x4e'));if(_0x495335[_0x1b8b('0x4f')]===_0x1b8b('0x4d')){var _0x3b416b=_0x4582bc[_0x1b8b('0x50')]({'plain':!![]});var _0x539b32=_0x1b8b('0x51');return db['UserProfileSection'][_0x1b8b('0x4a')]({'where':{'name':_0x539b32,'userProfileId':_0x495335[_0x1b8b('0x52')]},'raw':!![]})[_0x1b8b('0x41')](function(_0x5cbac7){if(_0x5cbac7&&_0x5cbac7[_0x1b8b('0x53')]===0x0){return db[_0x1b8b('0x54')]['create']({'name':_0x3b416b[_0x1b8b('0x2b')],'resourceId':_0x3b416b['id'],'type':_0x5cbac7['name'],'sectionId':_0x5cbac7['id']},{})[_0x1b8b('0x41')](function(){return _0x4582bc;});}else{return _0x4582bc;}})['catch'](function(_0x17f0d5){logger[_0x1b8b('0x29')](_0x1b8b('0x55'),_0x17f0d5);throw _0x17f0d5;});}return _0x4582bc;})[_0x1b8b('0x41')](respondWithResult(_0x259237,0xc9))[_0x1b8b('0x45')](handleError(_0x259237,null));};exports[_0x1b8b('0x28')]=function(_0x508910,_0x360154){if(_0x508910[_0x1b8b('0x4c')]['id']){delete _0x508910[_0x1b8b('0x4c')]['id'];}return db[_0x1b8b('0x40')][_0x1b8b('0x4a')]({'where':{'id':_0x508910['params']['id']}})[_0x1b8b('0x41')](handleEntityNotFound(_0x360154,null))[_0x1b8b('0x41')](saveUpdates(_0x508910[_0x1b8b('0x4c')],null))['then'](respondWithResult(_0x360154,null))[_0x1b8b('0x45')](handleError(_0x360154,null));};exports['destroy']=function(_0x18d641,_0x1842a1){var _0xfd94a0=_0x18d641[_0x1b8b('0x47')]['id'];var _0x529e99=[];return db['sequelize'][_0x1b8b('0x56')](function(_0x10bf40){var _0x56fbd6=_0x1b8b('0x57')+_0xfd94a0;return db[_0x1b8b('0x58')]['query'](_0x56fbd6,{'type':db[_0x1b8b('0x59')][_0x1b8b('0x5a')][_0x1b8b('0x5b')],'raw':!![],'transaction':_0x10bf40})[_0x1b8b('0x41')](function(_0x469bab){_0x529e99=_[_0x1b8b('0x2d')](_0x469bab,function(_0x5c6697){return Number(_0x5c6697['UserId']);});})['then'](function(){var _0x152d73=_0x1b8b('0x5c')+_0xfd94a0;return db[_0x1b8b('0x58')][_0x1b8b('0x32')](_0x152d73,{'type':db[_0x1b8b('0x59')][_0x1b8b('0x5a')][_0x1b8b('0x5b')],'raw':!![],'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(_0x5ebe35){var _0x3b5a1c=_['map'](_0x5ebe35,function(_0xcb83f0){return Number(_0xcb83f0[_0x1b8b('0x5d')]);});return db['UserVoiceQueue'][_0x1b8b('0x5e')]({'where':{'UserId':{'$in':_0x529e99},'VoiceQueueId':{'$in':_0x3b5a1c}},'transaction':_0x10bf40});})['then'](function(){var _0x3f713e=_0x1b8b('0x5f')+_0xfd94a0;return db[_0x1b8b('0x58')][_0x1b8b('0x32')](_0x3f713e,{'type':db[_0x1b8b('0x59')][_0x1b8b('0x5a')][_0x1b8b('0x5b')],'raw':!![],'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(_0x3757e9){var _0xff3d2a=_['map'](_0x3757e9,function(_0x49a3b0){return Number(_0x49a3b0[_0x1b8b('0x60')]);});return db[_0x1b8b('0x61')][_0x1b8b('0x5e')]({'where':{'UserId':{'$in':_0x529e99},'MailQueueId':{'$in':_0xff3d2a}},'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(){var _0x38cc18='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0xfd94a0;return db['sequelize']['query'](_0x38cc18,{'type':db['Sequelize'][_0x1b8b('0x5a')][_0x1b8b('0x5b')],'raw':!![],'transaction':_0x10bf40});})['then'](function(_0x4e6435){var _0x48970b=_[_0x1b8b('0x2d')](_0x4e6435,function(_0x549340){return Number(_0x549340['SmsQueueId']);});return db[_0x1b8b('0x62')][_0x1b8b('0x5e')]({'where':{'UserId':{'$in':_0x529e99},'SmsQueueId':{'$in':_0x48970b}},'transaction':_0x10bf40});})['then'](function(){var _0x23682f=_0x1b8b('0x63')+_0xfd94a0;return db[_0x1b8b('0x58')][_0x1b8b('0x32')](_0x23682f,{'type':db[_0x1b8b('0x59')][_0x1b8b('0x5a')]['SELECT'],'raw':!![],'transaction':_0x10bf40});})['then'](function(_0x5acfb5){var _0x811a11=_[_0x1b8b('0x2d')](_0x5acfb5,function(_0x254140){return Number(_0x254140['ChatQueueId']);});return db['UserChatQueue'][_0x1b8b('0x5e')]({'where':{'UserId':{'$in':_0x529e99},'ChatQueueId':{'$in':_0x811a11}},'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(){var _0x5a5e52=_0x1b8b('0x64')+_0xfd94a0;return db[_0x1b8b('0x58')]['query'](_0x5a5e52,{'type':db['Sequelize']['QueryTypes'][_0x1b8b('0x5b')],'raw':!![],'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(_0x1672fb){var _0x1695c3=_['map'](_0x1672fb,function(_0x1de9b1){return Number(_0x1de9b1['FaxQueueId']);});return db[_0x1b8b('0x65')][_0x1b8b('0x5e')]({'where':{'UserId':{'$in':_0x529e99},'FaxQueueId':{'$in':_0x1695c3}},'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(){var _0x286c96=_0x1b8b('0x66')+_0xfd94a0;return db[_0x1b8b('0x58')][_0x1b8b('0x32')](_0x286c96,{'type':db[_0x1b8b('0x59')][_0x1b8b('0x5a')][_0x1b8b('0x5b')],'raw':!![],'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(_0x3e9b00){var _0x317ce3=_[_0x1b8b('0x2d')](_0x3e9b00,function(_0x56c703){return Number(_0x56c703[_0x1b8b('0x67')]);});return db[_0x1b8b('0x68')]['destroy']({'where':{'UserId':{'$in':_0x529e99},'OpenchannelQueueId':{'$in':_0x317ce3}},'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(){var _0x36e67c='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0xfd94a0;return db[_0x1b8b('0x58')][_0x1b8b('0x32')](_0x36e67c,{'type':db['Sequelize'][_0x1b8b('0x5a')][_0x1b8b('0x5b')],'raw':!![],'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(_0x22c795){var _0x249301=_['map'](_0x22c795,function(_0x3243b2){return Number(_0x3243b2[_0x1b8b('0x69')]);});return db[_0x1b8b('0x6a')][_0x1b8b('0x5e')]({'where':{'UserId':{'$in':_0x529e99},'WhatsappQueueId':{'$in':_0x249301}},'transaction':_0x10bf40});})['then'](function(){return db[_0x1b8b('0x6b')][_0x1b8b('0x4a')]({'where':{'TeamId':_0xfd94a0}});})[_0x1b8b('0x41')](function(_0x584a21){if(_0x584a21===null){return;}return db['UserVoicePrefix'][_0x1b8b('0x5e')]({'where':{'UserId':{'$in':_0x529e99},'VoicePrefixId':_0x584a21['VoicePrefixId']},'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(){return db[_0x1b8b('0x40')][_0x1b8b('0x5e')]({'where':{'id':_0xfd94a0},'cascade':!![],'transaction':_0x10bf40});})[_0x1b8b('0x41')](function(_0x462b4d){if(_0x462b4d===0x0){_0x1842a1[_0x1b8b('0x1e')](0x194);}else{return db[_0x1b8b('0x54')][_0x1b8b('0x5e')]({'where':{'type':'Teams','resourceId':_0xfd94a0},'cascade':!![],'transaction':_0x10bf40})[_0x1b8b('0x41')](function(){_0x1842a1[_0x1b8b('0x1f')](0xcc)[_0x1b8b('0x6c')]();});}})[_0x1b8b('0x45')](function(_0x1c6474){_0x1842a1[_0x1b8b('0x1f')](0x1f4)[_0x1b8b('0x6d')](_0x1c6474);});});};exports[_0x1b8b('0x6e')]=function(_0x3fece7,_0x445312,_0x4875ad){return db[_0x1b8b('0x40')][_0x1b8b('0x6f')]({'where':{'id':_0x3fece7[_0x1b8b('0x47')]['id']}})[_0x1b8b('0x41')](handleEntityNotFound(_0x445312,null))['then'](function(_0x492cf2){if(!_0x3fece7[_0x1b8b('0x32')][_0x1b8b('0x70')]||!utils[_0x1b8b('0x71')](_0x3fece7[_0x1b8b('0x32')]['channel'])){throw new db[(_0x1b8b('0x59'))][(_0x1b8b('0x72'))](_0x1b8b('0x73'));}var _0x55e2ad={};var _0x10e92f={};_0x10e92f[_0x1b8b('0x31')]=_[_0x1b8b('0x48')](db[_[_0x1b8b('0x74')](_0x3fece7[_0x1b8b('0x32')][_0x1b8b('0x70')][_0x1b8b('0x75')]())+_0x1b8b('0x76')][_0x1b8b('0x2e')]);_0x10e92f[_0x1b8b('0x32')]=_[_0x1b8b('0x48')](_0x3fece7[_0x1b8b('0x32')]);_0x10e92f[_0x1b8b('0x33')]=_[_0x1b8b('0x34')](_0x10e92f['model'],_0x10e92f[_0x1b8b('0x32')]);_0x55e2ad['attributes']=_[_0x1b8b('0x34')](_0x10e92f[_0x1b8b('0x31')],qs[_0x1b8b('0x36')](_0x3fece7[_0x1b8b('0x32')]['fields']));_0x55e2ad[_0x1b8b('0x35')]=_0x55e2ad['attributes'][_0x1b8b('0x37')]?_0x55e2ad[_0x1b8b('0x35')]:_0x10e92f[_0x1b8b('0x31')];_0x55e2ad[_0x1b8b('0x22')]=qs[_0x1b8b('0x22')](_0x3fece7['query'][_0x1b8b('0x22')]);_0x55e2ad[_0x1b8b('0x21')]=qs[_0x1b8b('0x21')](_0x3fece7['query'][_0x1b8b('0x21')]);_0x55e2ad[_0x1b8b('0x3a')]=qs['sort'](_0x3fece7[_0x1b8b('0x32')]['sort']);_0x55e2ad[_0x1b8b('0x3c')]=qs[_0x1b8b('0x33')](_[_0x1b8b('0x3d')](_0x3fece7['query'],_0x10e92f[_0x1b8b('0x33')]));_0x55e2ad=_[_0x1b8b('0x3e')]({},_0x55e2ad,_0x3fece7[_0x1b8b('0x49')]);return _0x492cf2['get'+_['capitalize'](_0x3fece7[_0x1b8b('0x32')][_0x1b8b('0x70')][_0x1b8b('0x75')]())+_0x1b8b('0x77')](_0x55e2ad);})['then'](respondWithResult(_0x445312,null))['catch'](handleError(_0x445312,null));};exports['addQueues']=function(_0x23f22b,_0x4b48ad,_0x4f9b00){return db[_0x1b8b('0x40')][_0x1b8b('0x6f')]({'where':{'id':_0x23f22b[_0x1b8b('0x47')]['id']}})[_0x1b8b('0x41')](function(_0x21a5d6){if(_0x21a5d6){if(!_0x23f22b[_0x1b8b('0x4c')]['channel']||!utils[_0x1b8b('0x71')](_0x23f22b[_0x1b8b('0x4c')][_0x1b8b('0x70')])){throw new db[(_0x1b8b('0x59'))]['ValidationError'](_0x1b8b('0x73'));}return _0x21a5d6[_0x1b8b('0x78')+_['capitalize'](_0x23f22b[_0x1b8b('0x4c')][_0x1b8b('0x70')][_0x1b8b('0x75')]())+_0x1b8b('0x77')](_0x23f22b['body'][_0x1b8b('0x79')]);}return null;})['then'](handleEntityNotFound(_0x4b48ad,null))['then'](respondWithStatusCode(_0x4b48ad,null))[_0x1b8b('0x45')](handleError(_0x4b48ad,null));};exports[_0x1b8b('0x7a')]=function(_0x37d6ae,_0x312972,_0x50657d){return db['Team'][_0x1b8b('0x6f')]({'where':{'id':_0x37d6ae['params']['id']}})[_0x1b8b('0x41')](function(_0x465deb){if(_0x465deb){if(!_0x37d6ae[_0x1b8b('0x32')][_0x1b8b('0x70')]||!utils['isValidChannel'](_0x37d6ae[_0x1b8b('0x32')][_0x1b8b('0x70')])){throw new db['Sequelize']['ValidationError'](_0x1b8b('0x73'));}return _0x465deb['remove'+_[_0x1b8b('0x74')](_0x37d6ae[_0x1b8b('0x32')][_0x1b8b('0x70')][_0x1b8b('0x75')]())+'Queues'](_0x37d6ae['query'][_0x1b8b('0x79')]);}return null;})[_0x1b8b('0x41')](handleEntityNotFound(_0x312972,null))[_0x1b8b('0x41')](respondWithStatusCode(_0x312972,null))['catch'](handleError(_0x312972,null));};exports[_0x1b8b('0x7b')]=function(_0x25cbb8,_0x34bb82){var _0x2e3a3b=_[_0x1b8b('0x7c')](_0x25cbb8[_0x1b8b('0x4c')][_0x1b8b('0x79')])?_0x25cbb8[_0x1b8b('0x4c')][_0x1b8b('0x79')]:[_0x25cbb8[_0x1b8b('0x4c')]['ids']];var _0x360a25=_0x25cbb8['params']['id'];return db[_0x1b8b('0x40')][_0x1b8b('0x4a')]({'where':{'id':_0x360a25}})['then'](handleEntityNotFound(_0x34bb82,null))[_0x1b8b('0x41')](function(_0xdb046e){if(_0xdb046e){var _0x18c010=[_0x1b8b('0x7d'),_0x1b8b('0x7e'),'Mail',_0x1b8b('0x7f'),_0x1b8b('0x80'),_0x1b8b('0x81'),_0x1b8b('0x82')];return db['sequelize'][_0x1b8b('0x56')](function(_0x478833){var _0x50bce9=_[_0x1b8b('0x2d')](_0x18c010,function(_0x45a1f2){var _0x48cfcd={'attributes':['id','name']};if(_0x45a1f2===_0x1b8b('0x7d')){_0x48cfcd[_0x1b8b('0x83')]={'attributes':[_0x1b8b('0x84')]};}return _0xdb046e[_0x1b8b('0x50')+_0x45a1f2+_0x1b8b('0x77')](_0x48cfcd)[_0x1b8b('0x41')](function(_0x39ab06){var _0x35de06=_[_0x1b8b('0x2d')](_0x39ab06,function(_0x276e82){var _0x44945f=_['map'](_0x2e3a3b,function(_0x59fbbd){var _0x41d464={'where':{'UserId':_0x59fbbd,[_0x45a1f2+'QueueId']:_0x276e82['id']},'transaction':_0x478833};if(_0x45a1f2===_0x1b8b('0x7d')){_0x41d464[_0x1b8b('0x85')]={'penalty':_0x276e82['TeamVoiceQueue'][_0x1b8b('0x84')]};}return db[_0x1b8b('0x86')+_0x45a1f2+_0x1b8b('0x76')][_0x1b8b('0x87')](_0x41d464)[_0x1b8b('0x41')](function(){socket[_0x1b8b('0x88')](_0x1b8b('0x4d')+_0x45a1f2+_0x1b8b('0x89'),{'UserId':_0x59fbbd,[_0x45a1f2+'QueueId']:_0x276e82['id']});if(_0x45a1f2!==_0x1b8b('0x7d')){return;}return db[_0x1b8b('0x86')]['findAll']({'where':{'id':_0x2e3a3b,'online':0x1},'attributes':['id',_0x1b8b('0x2b'),'online',_0x1b8b('0x8a'),_0x1b8b('0x8b')],'raw':!![]})[_0x1b8b('0x41')](function(_0x5629b6){var _0x43d06b=_[_0x1b8b('0x2d')](_0x5629b6,function(_0x442607){return db[_0x1b8b('0x8c')][_0x1b8b('0x8d')]({'membername':_0x442607[_0x1b8b('0x2b')],'UserId':_0x442607['id'],'queue_name':_0x276e82[_0x1b8b('0x2b')],'VoiceQueueId':_0x276e82['id'],'interface':_[_0x1b8b('0x8e')](_0x442607[_0x1b8b('0x8b')])?util[_0x1b8b('0x8f')](_0x1b8b('0x90'),_0x442607[_0x1b8b('0x2b')]):_0x442607[_0x1b8b('0x8b')],'paused':_0x442607[_0x1b8b('0x8a')]||![],'penalty':_0x276e82[_0x1b8b('0x91')][_0x1b8b('0x84')]},{'transaction':_0x478833});});return Promise[_0x1b8b('0x92')](_0x43d06b);});});});return Promise[_0x1b8b('0x92')](_0x44945f);});return Promise[_0x1b8b('0x92')](_0x35de06);})[_0x1b8b('0x41')](function(){return db[_0x1b8b('0x6b')][_0x1b8b('0x6f')]({'where':{'teamId':_0x360a25}})[_0x1b8b('0x41')](function(_0x471648){if(_0x471648){var _0x2c3666=_[_0x1b8b('0x2d')](_0x2e3a3b,function(_0x16d6ab){db[_0x1b8b('0x93')]['upsert']({'UserId':_0x16d6ab,'VoicePrefixId':_0x471648['VoicePrefixId']});});return Promise[_0x1b8b('0x92')](_0x2c3666);}});});});return Promise[_0x1b8b('0x92')](_0x50bce9)[_0x1b8b('0x41')](function(){return _0xdb046e[_0x1b8b('0x7b')](_0x2e3a3b,{'transaction':_0x478833})[_0x1b8b('0x94')](function(_0x154251){return _0x154251;});});});}})[_0x1b8b('0x41')](respondWithResult(_0x34bb82,null))[_0x1b8b('0x45')](handleError(_0x34bb82,null));};exports[_0x1b8b('0x95')]=function(_0x3a30e8,_0x45b067){var _0x1cb3f3=_[_0x1b8b('0x7c')](_0x3a30e8['query'][_0x1b8b('0x79')])?_0x3a30e8[_0x1b8b('0x32')][_0x1b8b('0x79')]:[_0x3a30e8[_0x1b8b('0x32')][_0x1b8b('0x79')]];var _0x3adc22=_0x3a30e8['params']['id'];return db['Team'][_0x1b8b('0x4a')]({'where':{'id':_0x3adc22}})['then'](handleEntityNotFound(_0x45b067,null))[_0x1b8b('0x41')](function(_0x3abfd8){if(_0x3abfd8){var _0x4d10e6=[_0x1b8b('0x7d'),_0x1b8b('0x7e'),'Mail',_0x1b8b('0x7f'),'Fax',_0x1b8b('0x81'),_0x1b8b('0x82')];return db[_0x1b8b('0x58')][_0x1b8b('0x56')](function(_0x593b27){var _0x2ef657=_[_0x1b8b('0x2d')](_0x4d10e6,function(_0x415a3e){var _0x26455f={'attributes':['id',_0x1b8b('0x2b')]};return _0x3abfd8['get'+_0x415a3e+_0x1b8b('0x77')](_0x26455f)[_0x1b8b('0x41')](function(_0x561cad){var _0x11ae2c=_[_0x1b8b('0x2d')](_0x561cad,function(_0x16abca){return _0x16abca[_0x1b8b('0x95')](_0x1cb3f3,{'transaction':_0x593b27})[_0x1b8b('0x41')](function(){var _0x460e44=_[_0x1b8b('0x2d')](_0x1cb3f3,function(_0x2a23cc){socket['emit']('user'+_0x415a3e+'Queue:remove',{'UserId':Number(_0x2a23cc),[_0x415a3e+_0x1b8b('0x96')]:_0x16abca['id']});if(_0x415a3e!==_0x1b8b('0x7d')){return;}return db[_0x1b8b('0x8c')][_0x1b8b('0x5e')]({'where':{'VoiceQueueId':_0x16abca['id'],'UserId':_0x2a23cc},'transaction':_0x593b27});});return Promise['all'](_0x460e44);});});return Promise['all'](_0x11ae2c);});});return Promise[_0x1b8b('0x92')](_0x2ef657)[_0x1b8b('0x41')](function(){return _0x3abfd8[_0x1b8b('0x95')](_0x1cb3f3,{'transaction':_0x593b27});})['then'](function(){return db[_0x1b8b('0x6b')][_0x1b8b('0x6f')]({'where':{'teamId':_0x3adc22}})['then'](function(_0x4fdebc){if(_0x4fdebc){var _0x148f92=_['map'](_0x1cb3f3,function(_0x138bf4){db[_0x1b8b('0x93')][_0x1b8b('0x5e')]({'where':{'UserId':_0x138bf4,'VoicePrefixId':_0x4fdebc[_0x1b8b('0x97')]}});});return Promise['all'](_0x148f92);}});});});}})[_0x1b8b('0x41')](respondWithStatusCode(_0x45b067,null))['catch'](handleError(_0x45b067,null));};exports[_0x1b8b('0x98')]=function(_0x17692a,_0x15521d,_0x49e8e){var _0x1b0c48={};var _0x58a42c={};var _0x39640d;var _0x5ef1db;return db[_0x1b8b('0x40')][_0x1b8b('0x6f')]({'where':{'id':_0x17692a[_0x1b8b('0x47')]['id']}})[_0x1b8b('0x41')](handleEntityNotFound(_0x15521d,null))['then'](function(_0x5e6bb0){if(_0x5e6bb0){_0x39640d=_0x5e6bb0;_0x58a42c[_0x1b8b('0x31')]=_[_0x1b8b('0x48')](db[_0x1b8b('0x86')][_0x1b8b('0x2e')]);_0x58a42c[_0x1b8b('0x32')]=_['keys'](_0x17692a[_0x1b8b('0x32')]);_0x58a42c['filters']=_[_0x1b8b('0x34')](_0x58a42c[_0x1b8b('0x31')],_0x58a42c[_0x1b8b('0x32')]);_0x1b0c48[_0x1b8b('0x35')]=_['intersection'](_0x58a42c[_0x1b8b('0x31')],qs['fields'](_0x17692a[_0x1b8b('0x32')][_0x1b8b('0x36')]));_0x1b0c48[_0x1b8b('0x35')]=_0x1b0c48[_0x1b8b('0x35')][_0x1b8b('0x37')]?_0x1b0c48[_0x1b8b('0x35')]:_0x58a42c[_0x1b8b('0x31')];_0x1b0c48[_0x1b8b('0x3a')]=qs[_0x1b8b('0x3b')](_0x17692a['query'][_0x1b8b('0x3b')]);_0x1b0c48[_0x1b8b('0x3c')]=qs[_0x1b8b('0x33')](_['pick'](_0x17692a[_0x1b8b('0x32')],_0x58a42c['filters']));if(_0x17692a[_0x1b8b('0x32')][_0x1b8b('0x99')]){_0x1b0c48['where']=_[_0x1b8b('0x3e')](_0x1b0c48[_0x1b8b('0x3c')],{'$or':_[_0x1b8b('0x2d')](_0x1b0c48[_0x1b8b('0x35')],function(_0x9ef952){var _0x3f19bf={};_0x3f19bf[_0x9ef952]={'$like':'%'+_0x17692a[_0x1b8b('0x32')]['filter']+'%'};return _0x3f19bf;})});}_0x1b0c48=_[_0x1b8b('0x3e')]({},_0x1b0c48,_0x17692a[_0x1b8b('0x49')]);return _0x39640d[_0x1b8b('0x98')](_0x1b0c48);}})[_0x1b8b('0x41')](function(_0x479f1e){if(_0x479f1e){_0x5ef1db=_0x479f1e['length'];if(!_0x17692a['query']['hasOwnProperty'](_0x1b8b('0x39'))){_0x1b0c48[_0x1b8b('0x22')]=qs[_0x1b8b('0x22')](_0x17692a[_0x1b8b('0x32')][_0x1b8b('0x22')]);_0x1b0c48['offset']=qs[_0x1b8b('0x21')](_0x17692a[_0x1b8b('0x32')][_0x1b8b('0x21')]);}return _0x39640d[_0x1b8b('0x98')](_0x1b0c48);}})[_0x1b8b('0x41')](function(_0xb6798){if(_0xb6798){return _0xb6798?{'count':_0x5ef1db,'rows':_0xb6798}:null;}})[_0x1b8b('0x41')](respondWithResult(_0x15521d,null))['catch'](handleError(_0x15521d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 2c4860d..c432ba0 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 _0xbb43=['events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x53677f,_0x511bb3){var _0x4a13a0=function(_0x3d7022){while(--_0x3d7022){_0x53677f['push'](_0x53677f['shift']());}};_0x4a13a0(++_0x511bb3);}(_0xbb43,0x190));var _0x3bb4=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0xbb43[_0x5c6ceb];return _0x28821b;};'use strict';var EventEmitter=require(_0x3bb4('0x0'));var Team=require(_0x3bb4('0x1'))['db'][_0x3bb4('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x3bb4('0x3')](0x0);var events={'afterCreate':_0x3bb4('0x4'),'afterUpdate':_0x3bb4('0x5'),'afterDestroy':_0x3bb4('0x6')};function emitEvent(_0x59e8be){return function(_0x2552e7,_0x55d225,_0x5d5747){TeamEvents['emit'](_0x59e8be+':'+_0x2552e7['id'],_0x2552e7);TeamEvents[_0x3bb4('0x7')](_0x59e8be,_0x2552e7);_0x5d5747(null);};}for(var e in events){if(events[_0x3bb4('0x8')](e)){var event=events[e];Team[_0x3bb4('0x9')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x7270=['hook','events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x595581,_0x350e03){var _0x1a57d0=function(_0x35d6e0){while(--_0x35d6e0){_0x595581['push'](_0x595581['shift']());}};_0x1a57d0(++_0x350e03);}(_0x7270,0xb5));var _0x0727=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x7270[_0x19dd7a];return _0x3feb6a;};'use strict';var EventEmitter=require(_0x0727('0x0'));var Team=require(_0x0727('0x1'))['db'][_0x0727('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x0727('0x3')](0x0);var events={'afterCreate':_0x0727('0x4'),'afterUpdate':'update','afterDestroy':_0x0727('0x5')};function emitEvent(_0x2ce81d){return function(_0x3d42fa,_0x44c8a9,_0x4c0a33){TeamEvents[_0x0727('0x6')](_0x2ce81d+':'+_0x3d42fa['id'],_0x3d42fa);TeamEvents[_0x0727('0x6')](_0x2ce81d,_0x3d42fa);_0x4c0a33(null);};}for(var e in events){if(events[_0x0727('0x7')](e)){var event=events[e];Team[_0x0727('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index a926084..3e4baef 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 _0xc1f8=['all','lodash','./team.attributes','get','Queues','setDataValue','channel','catch','define','teams','Chat','Fax','Sms','Voice','Whatsapp','resolve','then','map'];(function(_0x5046f0,_0x143f3c){var _0x423c81=function(_0xb2bc31){while(--_0xb2bc31){_0x5046f0['push'](_0x5046f0['shift']());}};_0x423c81(++_0x143f3c);}(_0xc1f8,0x1b1));var _0x8c1f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc1f8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c1f('0x0'));var attributes=require(_0x8c1f('0x1'));function getQueuesByChannel(_0x504cf4,_0xba3d5b){var _0x3f3748=_0x8c1f('0x2')+_0xba3d5b+_0x8c1f('0x3');return _0x504cf4[_0x3f3748]()['then'](function(_0x5bfba6){return _['map'](_0x5bfba6,function(_0x51b9b0){_0x51b9b0[_0x8c1f('0x4')](_0x8c1f('0x5'),_0xba3d5b);return _0x51b9b0;});})[_0x8c1f('0x6')](function(_0xefec56){throw _0xefec56;});}module['exports']=function(_0x1cf42e){return _0x1cf42e[_0x8c1f('0x7')]('Team',attributes,{'tableName':_0x8c1f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4d448f=this;var _0xcee0c3=[_0x8c1f('0x9'),_0x8c1f('0xa'),'Mail','Openchannel',_0x8c1f('0xb'),_0x8c1f('0xc'),_0x8c1f('0xd')];return Promise[_0x8c1f('0xe')]()[_0x8c1f('0xf')](function(){var _0x42c2ef=_[_0x8c1f('0x10')](_0xcee0c3,function(_0x34e84c){return getQueuesByChannel(_0x4d448f,_0x34e84c);});return Promise[_0x8c1f('0x11')](_0x42c2ef);})[_0x8c1f('0x6')](function(_0x2442fc){throw _0x2442fc;});}}});}; \ No newline at end of file +var _0x82bd=['Voice','Whatsapp','resolve','all','lodash','get','Queues','then','map','setDataValue','channel','catch','exports','define','Team','teams','Fax','Mail','Openchannel','Sms'];(function(_0x1dc3eb,_0x2106a5){var _0x3ed430=function(_0x43fa70){while(--_0x43fa70){_0x1dc3eb['push'](_0x1dc3eb['shift']());}};_0x3ed430(++_0x2106a5);}(_0x82bd,0x108));var _0xd82b=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0x82bd[_0x452968];return _0xb6f9ae;};'use strict';var _=require(_0xd82b('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x307976,_0x1cc3c5){var _0x512b40=_0xd82b('0x1')+_0x1cc3c5+_0xd82b('0x2');return _0x307976[_0x512b40]()[_0xd82b('0x3')](function(_0x2c698e){return _[_0xd82b('0x4')](_0x2c698e,function(_0x36b5e){_0x36b5e[_0xd82b('0x5')](_0xd82b('0x6'),_0x1cc3c5);return _0x36b5e;});})[_0xd82b('0x7')](function(_0x1fa0ea){throw _0x1fa0ea;});}module[_0xd82b('0x8')]=function(_0x23edae){return _0x23edae[_0xd82b('0x9')](_0xd82b('0xa'),attributes,{'tableName':_0xd82b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x26a692=this;var _0x15d94f=['Chat',_0xd82b('0xc'),_0xd82b('0xd'),_0xd82b('0xe'),_0xd82b('0xf'),_0xd82b('0x10'),_0xd82b('0x11')];return Promise[_0xd82b('0x12')]()[_0xd82b('0x3')](function(){var _0x5b132f=_[_0xd82b('0x4')](_0x15d94f,function(_0x230a26){return getQueuesByChannel(_0x26a692,_0x230a26);});return Promise[_0xd82b('0x13')](_0x5b132f);})['catch'](function(_0x4986a6){throw _0x4986a6;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 20d19c5..265e295 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 _0xa9bb=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x47638d,_0x2c6518){var _0x42ccbb=function(_0xecd2c){while(--_0xecd2c){_0x47638d['push'](_0x47638d['shift']());}};_0x42ccbb(++_0x2c6518);}(_0xa9bb,0x192));var _0xba9b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa9bb[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xba9b('0x0'));var util=require(_0xba9b('0x1'));var moment=require(_0xba9b('0x2'));var BPromise=require(_0xba9b('0x3'));var rs=require(_0xba9b('0x4'));var fs=require('fs');var Redis=require(_0xba9b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xba9b('0x6'));var logger=require(_0xba9b('0x7'))('rpc');var config=require(_0xba9b('0x8'));var jayson=require(_0xba9b('0x9'));var client=jayson['client'][_0xba9b('0xa')]({'port':0x232a});config[_0xba9b('0xb')]=_[_0xba9b('0xc')](config[_0xba9b('0xb')],{'host':_0xba9b('0xd'),'port':0x18eb});var socket=require(_0xba9b('0xe'))(new Redis(config[_0xba9b('0xb')]));require(_0xba9b('0xf'))[_0xba9b('0x10')](socket);function respondWithRpcPromise(_0x7f7f93,_0x107282,_0x52a695){return new BPromise(function(_0x55ec63,_0x2ac841){return client[_0xba9b('0x11')](_0x7f7f93,_0x52a695)[_0xba9b('0x12')](function(_0x431137){logger[_0xba9b('0x13')](_0xba9b('0x14'),_0x107282,_0xba9b('0x15'));logger[_0xba9b('0x16')](_0xba9b('0x17'),_0x107282,'request\x20sent',JSON[_0xba9b('0x18')](_0x431137));if(_0x431137[_0xba9b('0x19')]){if(_0x431137['error'][_0xba9b('0x1a')]===0x1f4){logger['error'](_0xba9b('0x14'),_0x107282,_0x431137[_0xba9b('0x19')][_0xba9b('0x1b')]);return _0x2ac841(_0x431137['error'][_0xba9b('0x1b')]);}logger[_0xba9b('0x19')](_0xba9b('0x14'),_0x107282,_0x431137[_0xba9b('0x19')][_0xba9b('0x1b')]);return _0x55ec63(_0x431137[_0xba9b('0x19')][_0xba9b('0x1b')]);}else{logger['info'](_0xba9b('0x14'),_0x107282,_0xba9b('0x15'));_0x55ec63(_0x431137['result'][_0xba9b('0x1b')]);}})[_0xba9b('0x1c')](function(_0x3d372f){logger[_0xba9b('0x19')](_0xba9b('0x14'),_0x107282,_0x3d372f);_0x2ac841(_0x3d372f);});});} \ No newline at end of file +var _0x4aa3=['socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4aa3,0x185));var _0x34aa=function(_0x4e4c7d,_0x552f7a){_0x4e4c7d=_0x4e4c7d-0x0;var _0x19488d=_0x4aa3[_0x4e4c7d];return _0x19488d;};'use strict';var _=require(_0x34aa('0x0'));var util=require(_0x34aa('0x1'));var moment=require(_0x34aa('0x2'));var BPromise=require(_0x34aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34aa('0x4'));var db=require(_0x34aa('0x5'))['db'];var utils=require(_0x34aa('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34aa('0x7'));var client=jayson[_0x34aa('0x8')][_0x34aa('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x34aa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x34aa('0xb'))(new Redis(config[_0x34aa('0xa')]));require(_0x34aa('0xc'))['register'](socket);function respondWithRpcPromise(_0x5183fc,_0x457194,_0x158a6f){return new BPromise(function(_0x277e0d,_0xae910c){return client[_0x34aa('0xd')](_0x5183fc,_0x158a6f)[_0x34aa('0xe')](function(_0x2ea6bf){logger[_0x34aa('0xf')](_0x34aa('0x10'),_0x457194,_0x34aa('0x11'));logger[_0x34aa('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x457194,_0x34aa('0x11'),JSON[_0x34aa('0x13')](_0x2ea6bf));if(_0x2ea6bf[_0x34aa('0x14')]){if(_0x2ea6bf[_0x34aa('0x14')][_0x34aa('0x15')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x457194,_0x2ea6bf[_0x34aa('0x14')]['message']);return _0xae910c(_0x2ea6bf[_0x34aa('0x14')]['message']);}logger[_0x34aa('0x14')](_0x34aa('0x10'),_0x457194,_0x2ea6bf[_0x34aa('0x14')]['message']);return _0x277e0d(_0x2ea6bf[_0x34aa('0x14')][_0x34aa('0x16')]);}else{logger[_0x34aa('0xf')]('Team,\x20%s,\x20%s',_0x457194,_0x34aa('0x11'));_0x277e0d(_0x2ea6bf[_0x34aa('0x17')][_0x34aa('0x16')]);}})[_0x34aa('0x18')](function(_0x2db00c){logger[_0x34aa('0x14')](_0x34aa('0x10'),_0x457194,_0x2db00c);_0xae910c(_0x2db00c);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index d8e5505..8e7f636 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 _0xd87e=['save','update','emit','removeListener','length','team:','./team.events'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0xd87e,0x1bf));var _0xed87=function(_0x3ddd29,_0x26f096){_0x3ddd29=_0x3ddd29-0x0;var _0x34cb20=_0xd87e[_0x3ddd29];return _0x34cb20;};'use strict';var TeamEvents=require(_0xed87('0x0'));var events=[_0xed87('0x1'),'remove',_0xed87('0x2')];function createListener(_0x189fdd,_0x16509b){return function(_0x5901be){_0x16509b[_0xed87('0x3')](_0x189fdd,_0x5901be);};}function removeListener(_0x5e960f,_0x11a5d9){return function(){TeamEvents[_0xed87('0x4')](_0x5e960f,_0x11a5d9);};}exports['register']=function(_0x17adfe){for(var _0x589fb9=0x0,_0x5da793=events[_0xed87('0x5')];_0x589fb9<_0x5da793;_0x589fb9++){var _0x42fef6=events[_0x589fb9];var _0x33e1c1=createListener(_0xed87('0x6')+_0x42fef6,_0x17adfe);TeamEvents['on'](_0x42fef6,_0x33e1c1);}}; \ No newline at end of file +var _0xa4ec=['update','removeListener','register','./team.events','remove'];(function(_0x3bafe6,_0x3432b7){var _0x30bc43=function(_0x1e8389){while(--_0x1e8389){_0x3bafe6['push'](_0x3bafe6['shift']());}};_0x30bc43(++_0x3432b7);}(_0xa4ec,0x193));var _0xca4e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa4ec[_0x4bfac3];return _0x15f0f2;};'use strict';var TeamEvents=require(_0xca4e('0x0'));var events=['save',_0xca4e('0x1'),_0xca4e('0x2')];function createListener(_0x458ecd,_0x2b6fc1){return function(_0x247d55){_0x2b6fc1['emit'](_0x458ecd,_0x247d55);};}function removeListener(_0x53e88e,_0xbaccbf){return function(){TeamEvents[_0xca4e('0x3')](_0x53e88e,_0xbaccbf);};}exports[_0xca4e('0x4')]=function(_0x5887c7){for(var _0x38a60c=0x0,_0x51e53b=events['length'];_0x38a60c<_0x51e53b;_0x38a60c++){var _0x3ed096=events[_0x38a60c];var _0x2cf874=createListener('team:'+_0x3ed096,_0x5887c7);TeamEvents['on'](_0x3ed096,_0x2cf874);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 4d7382c..4f74790 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 _0xcbdd=['sequelize','INTEGER'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0xcbdd,0xec));var _0xdcbd=function(_0x3eb169,_0x26495b){_0x3eb169=_0x3eb169-0x0;var _0x16ee99=_0xcbdd[_0x3eb169];return _0x16ee99;};'use strict';var Sequelize=require(_0xdcbd('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xdcbd('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xdcbd('0x1')]}}; \ No newline at end of file +var _0x5044=['exports','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5044,0xc8));var _0x4504=function(_0x57e1ab,_0x4d8553){_0x57e1ab=_0x57e1ab-0x0;var _0x5bde0e=_0x5044[_0x57e1ab];return _0x5bde0e;};'use strict';var Sequelize=require('sequelize');module[_0x4504('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x4504('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 803999a..6d59f3a 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 _0xfbac=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','util'];(function(_0x33fc57,_0xdd2591){var _0xf701ca=function(_0x4a38b9){while(--_0x4a38b9){_0x33fc57['push'](_0x33fc57['shift']());}};_0xf701ca(++_0xdd2591);}(_0xfbac,0x167));var _0xcfba=function(_0x1915ad,_0x3626dd){_0x1915ad=_0x1915ad-0x0;var _0x1e01a4=_0xfbac[_0x1915ad];return _0x1e01a4;};'use strict';var _=require('lodash');var util=require(_0xcfba('0x0'));var logger=require(_0xcfba('0x1'))(_0xcfba('0x2'));var moment=require(_0xcfba('0x3'));var BPromise=require(_0xcfba('0x4'));var rp=require(_0xcfba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcfba('0x6'));var attributes=require(_0xcfba('0x7'));module['exports']=function(_0x4eec09,_0x3bb3af){return _0x4eec09['define'](_0xcfba('0x8'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02f7=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x02f7,0x1d3));var _0x702f=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0x02f7[_0x231a47];return _0x48d7c9;};'use strict';var _=require(_0x702f('0x0'));var util=require(_0x702f('0x1'));var logger=require(_0x702f('0x2'))('api');var moment=require(_0x702f('0x3'));var BPromise=require(_0x702f('0x4'));var rp=require(_0x702f('0x5'));var fs=require('fs');var path=require(_0x702f('0x6'));var rimraf=require(_0x702f('0x7'));var config=require(_0x702f('0x8'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x449ba1,_0x4ff1d2){return _0x449ba1[_0x702f('0x9')](_0x702f('0xa'),attributes,{'tableName':_0x702f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 40f3a4f..d96af69 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(_0x53991f,_0x431062){var _0x3be065=function(_0x848487){while(--_0x848487){_0x53991f['push'](_0x53991f['shift']());}};_0x3be065(++_0x431062);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x179742,_0xf9f6f5){var _0x5cfd2e=function(_0x589a66){while(--_0x589a66){_0x179742['push'](_0x179742['shift']());}};_0x5cfd2e(++_0xf9f6f5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xcb91[_0x257a28];return _0x13bccc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 4279f8a..fa16404 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 _0x0f6e=['INTEGER','sequelize','exports'];(function(_0x592fbb,_0x3ddc10){var _0x341bcc=function(_0x3ca456){while(--_0x3ca456){_0x592fbb['push'](_0x592fbb['shift']());}};_0x341bcc(++_0x3ddc10);}(_0x0f6e,0x70));var _0xe0f6=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0x0f6e[_0x3f8a03];return _0x147fb2;};'use strict';var Sequelize=require(_0xe0f6('0x0'));module[_0xe0f6('0x1')]={'penalty':{'type':Sequelize[_0xe0f6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4509=['exports','INTEGER','sequelize'];(function(_0x4ccf96,_0x34978e){var _0xd103b7=function(_0x55736b){while(--_0x55736b){_0x4ccf96['push'](_0x4ccf96['shift']());}};_0xd103b7(++_0x34978e);}(_0x4509,0xd7));var _0x9450=function(_0x222a7f,_0x4a2e7c){_0x222a7f=_0x222a7f-0x0;var _0x4caf1e=_0x4509[_0x222a7f];return _0x4caf1e;};'use strict';var Sequelize=require(_0x9450('0x0'));module[_0x9450('0x1')]={'penalty':{'type':Sequelize[_0x9450('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index dbafc68..9e9372b 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 _0x24cd=['util','api','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0x52a7f1,_0x3a16bd){var _0x337926=function(_0x2d0114){while(--_0x2d0114){_0x52a7f1['push'](_0x52a7f1['shift']());}};_0x337926(++_0x3a16bd);}(_0x24cd,0x83));var _0xd24c=function(_0x19a113,_0x2e71b3){_0x19a113=_0x19a113-0x0;var _0x1c36d3=_0x24cd[_0x19a113];return _0x1c36d3;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var logger=require('../../config/logger')(_0xd24c('0x2'));var moment=require('moment');var BPromise=require(_0xd24c('0x3'));var rp=require(_0xd24c('0x4'));var fs=require('fs');var path=require(_0xd24c('0x5'));var rimraf=require('rimraf');var config=require(_0xd24c('0x6'));var attributes=require(_0xd24c('0x7'));module['exports']=function(_0x1c30fc,_0x2721be){return _0x1c30fc[_0xd24c('0x8')](_0xd24c('0x9'),attributes,{'tableName':_0xd24c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f88=['team_has_voice_queues','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0x128106,_0x496835){var _0x18246f=function(_0x12ddf1){while(--_0x12ddf1){_0x128106['push'](_0x128106['shift']());}};_0x18246f(++_0x496835);}(_0x4f88,0xf3));var _0x84f8=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0x4f88[_0xf363f0];return _0x55a386;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var logger=require('../../config/logger')(_0x84f8('0x2'));var moment=require(_0x84f8('0x3'));var BPromise=require(_0x84f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x84f8('0x5'));var config=require(_0x84f8('0x6'));var attributes=require(_0x84f8('0x7'));module[_0x84f8('0x8')]=function(_0x79dcec,_0x1ac0c8){return _0x79dcec['define'](_0x84f8('0x9'),attributes,{'tableName':_0x84f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index e5e455c..35cf753 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 _0x17da=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5acaea,_0x442cb0){var _0x509dfa=function(_0x58a5d8){while(--_0x58a5d8){_0x5acaea['push'](_0x5acaea['shift']());}};_0x509dfa(++_0x442cb0);}(_0x17da,0x18a));var _0xa17d=function(_0x12f89a,_0x3e0e5e){_0x12f89a=_0x12f89a-0x0;var _0x4e4716=_0x17da[_0x12f89a];return _0x4e4716;};'use strict';var _=require(_0xa17d('0x0'));var util=require(_0xa17d('0x1'));var moment=require(_0xa17d('0x2'));var BPromise=require(_0xa17d('0x3'));var rs=require(_0xa17d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa17d('0x5'))['db'];var utils=require(_0xa17d('0x6'));var logger=require(_0xa17d('0x7'))(_0xa17d('0x8'));var config=require('../../config/environment');var jayson=require(_0xa17d('0x9'));var client=jayson[_0xa17d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43a5d2,_0x4d960d,_0x4ae0e7){return new BPromise(function(_0x3ac4af,_0x3badbc){return client[_0xa17d('0xb')](_0x43a5d2,_0x4ae0e7)['then'](function(_0x537581){logger['info'](_0xa17d('0xc'),_0x4d960d,'request\x20sent');logger[_0xa17d('0xd')](_0xa17d('0xe'),_0x4d960d,'request\x20sent',JSON[_0xa17d('0xf')](_0x537581));if(_0x537581[_0xa17d('0x10')]){if(_0x537581[_0xa17d('0x10')]['code']===0x1f4){logger[_0xa17d('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4d960d,_0x537581['error']['message']);return _0x3badbc(_0x537581[_0xa17d('0x10')]['message']);}logger[_0xa17d('0x10')](_0xa17d('0xc'),_0x4d960d,_0x537581[_0xa17d('0x10')][_0xa17d('0x11')]);return _0x3ac4af(_0x537581[_0xa17d('0x10')][_0xa17d('0x11')]);}else{logger[_0xa17d('0x12')](_0xa17d('0xc'),_0x4d960d,'request\x20sent');_0x3ac4af(_0x537581[_0xa17d('0x13')]['message']);}})[_0xa17d('0x14')](function(_0x15fc0b){logger[_0xa17d('0x10')](_0xa17d('0xc'),_0x4d960d,_0x15fc0b);_0x3badbc(_0x15fc0b);});});} \ No newline at end of file +var _0x0194=['message','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x14438a,_0x53d627){var _0x1d16a5=function(_0xaae2bf){while(--_0xaae2bf){_0x14438a['push'](_0x14438a['shift']());}};_0x1d16a5(++_0x53d627);}(_0x0194,0xf1));var _0x4019=function(_0x56bb87,_0x294440){_0x56bb87=_0x56bb87-0x0;var _0xb7431c=_0x0194[_0x56bb87];return _0xb7431c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4019('0x0'));var BPromise=require(_0x4019('0x1'));var rs=require(_0x4019('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4019('0x3'))['db'];var utils=require(_0x4019('0x4'));var logger=require(_0x4019('0x5'))(_0x4019('0x6'));var config=require(_0x4019('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4019('0x8')][_0x4019('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b47b6,_0x45b6d8,_0x5c4015){return new BPromise(function(_0x173f77,_0x598c33){return client[_0x4019('0xa')](_0x3b47b6,_0x5c4015)[_0x4019('0xb')](function(_0x2e09be){logger[_0x4019('0xc')](_0x4019('0xd'),_0x45b6d8,'request\x20sent');logger['debug'](_0x4019('0xe'),_0x45b6d8,_0x4019('0xf'),JSON[_0x4019('0x10')](_0x2e09be));if(_0x2e09be['error']){if(_0x2e09be['error'][_0x4019('0x11')]===0x1f4){logger[_0x4019('0x12')](_0x4019('0xd'),_0x45b6d8,_0x2e09be['error'][_0x4019('0x13')]);return _0x598c33(_0x2e09be[_0x4019('0x12')]['message']);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x45b6d8,_0x2e09be[_0x4019('0x12')][_0x4019('0x13')]);return _0x173f77(_0x2e09be[_0x4019('0x12')]['message']);}else{logger[_0x4019('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x45b6d8,_0x4019('0xf'));_0x173f77(_0x2e09be['result']['message']);}})['catch'](function(_0x5f0371){logger[_0x4019('0x12')](_0x4019('0xd'),_0x45b6d8,_0x5f0371);_0x598c33(_0x5f0371);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ce23698..996764b 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 _0x04d5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','post','isAuthenticated','create','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x13a5e2,_0x4e2d46){var _0x42c586=function(_0x935b12){while(--_0x935b12){_0x13a5e2['push'](_0x13a5e2['shift']());}};_0x42c586(++_0x4e2d46);}(_0x04d5,0xe1));var _0x504d=function(_0x135b22,_0x426ccc){_0x135b22=_0x135b22-0x0;var _0x494911=_0x04d5[_0x135b22];return _0x494911;};'use strict';var multer=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var path=require('path');var timeout=require(_0x504d('0x2'));var express=require(_0x504d('0x3'));var router=express[_0x504d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x504d('0x5'));var interaction=require(_0x504d('0x6'));var config=require(_0x504d('0x7'));var controller=require(_0x504d('0x8'));router[_0x504d('0x9')]('/',auth['isAuthenticated'](),controller[_0x504d('0xa')]);router[_0x504d('0x9')](_0x504d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x504d('0xc')]('/',auth[_0x504d('0xd')](),controller[_0x504d('0xe')]);router['put'](_0x504d('0xb'),auth[_0x504d('0xd')](),controller[_0x504d('0xf')]);router[_0x504d('0x10')]('/:id',auth[_0x504d('0xd')](),controller[_0x504d('0x11')]);module[_0x504d('0x12')]=router; \ No newline at end of file +var _0xde1a=['show','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x285f48,_0x47e06c){var _0x5d6380=function(_0x55f799){while(--_0x55f799){_0x285f48['push'](_0x285f48['shift']());}};_0x5d6380(++_0x47e06c);}(_0xde1a,0xfd));var _0xade1=function(_0x5a7f2f,_0x34a31f){_0x5a7f2f=_0x5a7f2f-0x0;var _0xdf5f38=_0xde1a[_0x5a7f2f];return _0xdf5f38;};'use strict';var multer=require('multer');var util=require(_0xade1('0x0'));var path=require(_0xade1('0x1'));var timeout=require(_0xade1('0x2'));var express=require(_0xade1('0x3'));var router=express[_0xade1('0x4')]();var fs_extra=require(_0xade1('0x5'));var auth=require(_0xade1('0x6'));var interaction=require(_0xade1('0x7'));var config=require('../../config/environment');var controller=require(_0xade1('0x8'));router[_0xade1('0x9')]('/',auth[_0xade1('0xa')](),controller[_0xade1('0xb')]);router[_0xade1('0x9')](_0xade1('0xc'),auth['isAuthenticated'](),controller[_0xade1('0xd')]);router[_0xade1('0xe')]('/',auth[_0xade1('0xa')](),controller[_0xade1('0xf')]);router[_0xade1('0x10')](_0xade1('0xc'),auth[_0xade1('0xa')](),controller[_0xade1('0x11')]);router['delete'](_0xade1('0xc'),auth[_0xade1('0xa')](),controller['destroy']);module[_0xade1('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 816c208..8e4f194 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 _0x010c=['exports','STRING','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x010c,0x12f));var _0xc010=function(_0xa15b3e,_0x4e5569){_0xa15b3e=_0xa15b3e-0x0;var _0x69d15a=_0x010c[_0xa15b3e];return _0x69d15a;};'use strict';var Sequelize=require('sequelize');module[_0xc010('0x0')]={'name':{'type':Sequelize[_0xc010('0x1')]},'description':{'type':Sequelize[_0xc010('0x1')]},'html':{'type':Sequelize[_0xc010('0x2')]}}; \ No newline at end of file +var _0x3f30=['STRING','exports'];(function(_0x452e51,_0x13043b){var _0x537a6f=function(_0x1ea36b){while(--_0x1ea36b){_0x452e51['push'](_0x452e51['shift']());}};_0x537a6f(++_0x13043b);}(_0x3f30,0x1c7));var _0x03f3=function(_0x5d8a5d,_0x16a8e2){_0x5d8a5d=_0x5d8a5d-0x0;var _0x38df6b=_0x3f30[_0x5d8a5d];return _0x38df6b;};'use strict';var Sequelize=require('sequelize');module[_0x03f3('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x03f3('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 371672f..6afab69 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 _0xd3bb=['status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Templates','UserProfileResource','name','send','index','Template','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','where','merge','type','filter','options','includeAll','include','findAll','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x329905,_0x13c144){var _0x3aa42=function(_0x2fac43){while(--_0x2fac43){_0x329905['push'](_0x329905['shift']());}};_0x3aa42(++_0x13c144);}(_0xd3bb,0xc4));var _0xbd3b=function(_0x1bfe99,_0x4656fd){_0x1bfe99=_0x1bfe99-0x0;var _0x149f9a=_0xd3bb[_0x1bfe99];return _0x149f9a;};'use strict';var emlformat=require(_0xbd3b('0x0'));var rimraf=require(_0xbd3b('0x1'));var zipdir=require(_0xbd3b('0x2'));var jsonpatch=require(_0xbd3b('0x3'));var rp=require(_0xbd3b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd3b('0x5'));var util=require('util');var path=require(_0xbd3b('0x6'));var sox=require(_0xbd3b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd3b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbd3b('0x9'));var deskjs=require(_0xbd3b('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbd3b('0xb'));var Papa=require(_0xbd3b('0xc'));var Redis=require(_0xbd3b('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbd3b('0xe'));var hardwareService=require(_0xbd3b('0xf'));var logger=require(_0xbd3b('0x10'))('api');var utils=require(_0xbd3b('0x11'));var config=require(_0xbd3b('0x12'));var licenseUtil=require(_0xbd3b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1cd8,_0x2217e4){_0x2217e4=_0x2217e4||0xcc;return function(_0xba159e){if(_0xba159e){return _0x2b1cd8['sendStatus'](_0x2217e4);}return _0x2b1cd8[_0xbd3b('0x14')](_0x2217e4)[_0xbd3b('0x15')]();};}function respondWithResult(_0x497aa9,_0x1d1daf){_0x1d1daf=_0x1d1daf||0xc8;return function(_0x539001){if(_0x539001){return _0x497aa9[_0xbd3b('0x14')](_0x1d1daf)[_0xbd3b('0x16')](_0x539001);}};}function respondWithFilteredResult(_0x2ef85c,_0x57b396){return function(_0x204116){if(_0x204116){var _0x38f8e3=typeof _0x57b396[_0xbd3b('0x17')]==='undefined'&&typeof _0x57b396[_0xbd3b('0x18')]==='undefined';var _0x5634e4=_0x204116['count'];var _0x57a25c=_0x38f8e3?0x0:_0x57b396[_0xbd3b('0x17')];var _0x48f4e6=_0x38f8e3?_0x204116[_0xbd3b('0x19')]:_0x57b396[_0xbd3b('0x17')]+_0x57b396['limit'];var _0x1781f5;if(_0x48f4e6>=_0x5634e4){_0x48f4e6=_0x5634e4;_0x1781f5=0xc8;}else{_0x1781f5=0xce;}_0x2ef85c[_0xbd3b('0x14')](_0x1781f5);return _0x2ef85c[_0xbd3b('0x1a')](_0xbd3b('0x1b'),_0x57a25c+'-'+_0x48f4e6+'/'+_0x5634e4)['json'](_0x204116);}return null;};}function patchUpdates(_0x1d20be){return function(_0x259746){try{jsonpatch[_0xbd3b('0x1c')](_0x259746,_0x1d20be,!![]);}catch(_0x413d6c){return BPromise[_0xbd3b('0x1d')](_0x413d6c);}return _0x259746['save']();};}function saveUpdates(_0x57c204,_0x5251da){return function(_0x59e193){if(_0x59e193){return _0x59e193[_0xbd3b('0x1e')](_0x57c204)['then'](function(_0x3ae756){return _0x3ae756;});}return null;};}function removeEntity(_0x5967a8,_0x47a148){return function(_0x2f8880){if(_0x2f8880){return _0x2f8880[_0xbd3b('0x1f')]()[_0xbd3b('0x20')](function(){var _0x20bed4=_0x2f8880[_0xbd3b('0x21')]({'plain':!![]});var _0x302c2c=_0xbd3b('0x22');return db[_0xbd3b('0x23')]['destroy']({'where':{'type':_0x302c2c,'resourceId':_0x20bed4['id']}})[_0xbd3b('0x20')](function(){return _0x2f8880;});})['then'](function(){_0x5967a8[_0xbd3b('0x14')](0xcc)[_0xbd3b('0x15')]();});}};}function handleEntityNotFound(_0x22eb37,_0x191cd3){return function(_0x3d2f74){if(!_0x3d2f74){_0x22eb37['sendStatus'](0x194);}return _0x3d2f74;};}function handleError(_0x51912e,_0x73f792){_0x73f792=_0x73f792||0x1f4;return function(_0x31a23e){logger['error'](_0x31a23e['stack']);if(_0x31a23e[_0xbd3b('0x24')]){delete _0x31a23e['name'];}_0x51912e[_0xbd3b('0x14')](_0x73f792)[_0xbd3b('0x25')](_0x31a23e);};}exports[_0xbd3b('0x26')]=function(_0x3e4c93,_0x4d1f00){var _0x4fd29d={},_0x6d1ab2={},_0x19e0ae={'count':0x0,'rows':[]};var _0x29abb5=_['map'](db[_0xbd3b('0x27')][_0xbd3b('0x28')],function(_0x5b215b){return{'name':_0x5b215b[_0xbd3b('0x29')],'type':_0x5b215b['type'][_0xbd3b('0x2a')]};});_0x6d1ab2['model']=_[_0xbd3b('0x2b')](_0x29abb5,_0xbd3b('0x24'));_0x6d1ab2[_0xbd3b('0x2c')]=_[_0xbd3b('0x2d')](_0x3e4c93['query']);_0x6d1ab2[_0xbd3b('0x2e')]=_[_0xbd3b('0x2f')](_0x6d1ab2['model'],_0x6d1ab2[_0xbd3b('0x2c')]);_0x4fd29d[_0xbd3b('0x30')]=_[_0xbd3b('0x2f')](_0x6d1ab2['model'],qs[_0xbd3b('0x31')](_0x3e4c93[_0xbd3b('0x2c')][_0xbd3b('0x31')]));_0x4fd29d[_0xbd3b('0x30')]=_0x4fd29d['attributes'][_0xbd3b('0x32')]?_0x4fd29d[_0xbd3b('0x30')]:_0x6d1ab2[_0xbd3b('0x33')];if(!_0x3e4c93[_0xbd3b('0x2c')][_0xbd3b('0x34')]('nolimit')){_0x4fd29d['limit']=qs[_0xbd3b('0x18')](_0x3e4c93['query'][_0xbd3b('0x18')]);_0x4fd29d[_0xbd3b('0x17')]=qs[_0xbd3b('0x17')](_0x3e4c93[_0xbd3b('0x2c')][_0xbd3b('0x17')]);}_0x4fd29d[_0xbd3b('0x35')]=qs['sort'](_0x3e4c93[_0xbd3b('0x2c')]['sort']);_0x4fd29d['where']=qs[_0xbd3b('0x2e')](_['pick'](_0x3e4c93[_0xbd3b('0x2c')],_0x6d1ab2[_0xbd3b('0x2e')]),_0x29abb5);if(_0x3e4c93[_0xbd3b('0x2c')]['filter']){_0x4fd29d[_0xbd3b('0x36')]=_[_0xbd3b('0x37')](_0x4fd29d[_0xbd3b('0x36')],{'$or':_[_0xbd3b('0x2b')](_0x29abb5,function(_0x3f9e14){if(_0x3f9e14[_0xbd3b('0x38')]!=='VIRTUAL'){var _0x259846={};_0x259846[_0x3f9e14['name']]={'$like':'%'+_0x3e4c93['query'][_0xbd3b('0x39')]+'%'};return _0x259846;}})});}_0x4fd29d=_[_0xbd3b('0x37')]({},_0x4fd29d,_0x3e4c93[_0xbd3b('0x3a')]);var _0x14dab6={'where':_0x4fd29d[_0xbd3b('0x36')]};return db['Template'][_0xbd3b('0x19')](_0x14dab6)[_0xbd3b('0x20')](function(_0x5a05cf){_0x19e0ae[_0xbd3b('0x19')]=_0x5a05cf;if(_0x3e4c93[_0xbd3b('0x2c')][_0xbd3b('0x3b')]){_0x4fd29d[_0xbd3b('0x3c')]=[{'all':!![]}];}return db[_0xbd3b('0x27')][_0xbd3b('0x3d')](_0x4fd29d);})[_0xbd3b('0x20')](function(_0xc1da41){_0x19e0ae['rows']=_0xc1da41;return _0x19e0ae;})[_0xbd3b('0x20')](respondWithFilteredResult(_0x4d1f00,_0x4fd29d))[_0xbd3b('0x3e')](handleError(_0x4d1f00,null));};exports[_0xbd3b('0x3f')]=function(_0x3807ea,_0x7364cc){var _0x100f7d={'raw':!![],'where':{'id':_0x3807ea['params']['id']}},_0x4b3973={};_0x4b3973[_0xbd3b('0x33')]=_[_0xbd3b('0x2d')](db[_0xbd3b('0x27')][_0xbd3b('0x28')]);_0x4b3973[_0xbd3b('0x2c')]=_[_0xbd3b('0x2d')](_0x3807ea[_0xbd3b('0x2c')]);_0x4b3973[_0xbd3b('0x2e')]=_[_0xbd3b('0x2f')](_0x4b3973[_0xbd3b('0x33')],_0x4b3973[_0xbd3b('0x2c')]);_0x100f7d[_0xbd3b('0x30')]=_[_0xbd3b('0x2f')](_0x4b3973['model'],qs[_0xbd3b('0x31')](_0x3807ea[_0xbd3b('0x2c')][_0xbd3b('0x31')]));_0x100f7d[_0xbd3b('0x30')]=_0x100f7d[_0xbd3b('0x30')][_0xbd3b('0x32')]?_0x100f7d[_0xbd3b('0x30')]:_0x4b3973[_0xbd3b('0x33')];if(_0x3807ea['query'][_0xbd3b('0x3b')]){_0x100f7d['include']=[{'all':!![]}];}_0x100f7d=_[_0xbd3b('0x37')]({},_0x100f7d,_0x3807ea[_0xbd3b('0x3a')]);return db[_0xbd3b('0x27')]['find'](_0x100f7d)[_0xbd3b('0x20')](handleEntityNotFound(_0x7364cc,null))[_0xbd3b('0x20')](respondWithResult(_0x7364cc,null))['catch'](handleError(_0x7364cc,null));};exports[_0xbd3b('0x40')]=function(_0x45cb12,_0x1ab2c6){return db[_0xbd3b('0x27')][_0xbd3b('0x40')](_0x45cb12['body'],{})[_0xbd3b('0x20')](function(_0x474e64){var _0x5ec221=_0x45cb12[_0xbd3b('0x41')]['get']({'plain':!![]});if(!_0x5ec221)throw new Error(_0xbd3b('0x42'));if(_0x5ec221['role']===_0xbd3b('0x41')){var _0xb2c294=_0x474e64['get']({'plain':!![]});var _0x120931=_0xbd3b('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x120931,'userProfileId':_0x5ec221[_0xbd3b('0x43')]},'raw':!![]})[_0xbd3b('0x20')](function(_0x1eb553){if(_0x1eb553&&_0x1eb553[_0xbd3b('0x44')]===0x0){return db['UserProfileResource'][_0xbd3b('0x40')]({'name':_0xb2c294[_0xbd3b('0x24')],'resourceId':_0xb2c294['id'],'type':_0x1eb553[_0xbd3b('0x24')],'sectionId':_0x1eb553['id']},{})[_0xbd3b('0x20')](function(){return _0x474e64;});}else{return _0x474e64;}})[_0xbd3b('0x3e')](function(_0x2c0d05){logger['error'](_0xbd3b('0x45'),_0x2c0d05);throw _0x2c0d05;});}return _0x474e64;})[_0xbd3b('0x20')](respondWithResult(_0x1ab2c6,0xc9))['catch'](handleError(_0x1ab2c6,null));};exports[_0xbd3b('0x1e')]=function(_0x57709a,_0x4ecc87){if(_0x57709a[_0xbd3b('0x46')]['id']){delete _0x57709a[_0xbd3b('0x46')]['id'];}return db['Template']['find']({'where':{'id':_0x57709a['params']['id']}})[_0xbd3b('0x20')](handleEntityNotFound(_0x4ecc87,null))[_0xbd3b('0x20')](saveUpdates(_0x57709a[_0xbd3b('0x46')],null))[_0xbd3b('0x20')](respondWithResult(_0x4ecc87,null))[_0xbd3b('0x3e')](handleError(_0x4ecc87,null));};exports[_0xbd3b('0x1f')]=function(_0x178711,_0x329e34){return db[_0xbd3b('0x27')][_0xbd3b('0x47')]({'where':{'id':_0x178711['params']['id']}})[_0xbd3b('0x20')](handleEntityNotFound(_0x329e34,null))[_0xbd3b('0x20')](removeEntity(_0x329e34,null))[_0xbd3b('0x3e')](handleError(_0x329e34,null));}; \ No newline at end of file +var _0x9d67=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','get','Templates','UserProfileResource','destroy','error','name','send','index','map','Template','type','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0x9d67,0x1c3));var _0x79d6=function(_0x977279,_0x143359){_0x977279=_0x977279-0x0;var _0x455979=_0x9d67[_0x977279];return _0x455979;};'use strict';var emlformat=require(_0x79d6('0x0'));var rimraf=require(_0x79d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79d6('0x2'));var rp=require(_0x79d6('0x3'));var moment=require('moment');var BPromise=require(_0x79d6('0x4'));var Mustache=require(_0x79d6('0x5'));var util=require(_0x79d6('0x6'));var path=require(_0x79d6('0x7'));var sox=require(_0x79d6('0x8'));var csv=require(_0x79d6('0x9'));var ejs=require(_0x79d6('0xa'));var fs=require('fs');var fs_extra=require(_0x79d6('0xb'));var _=require(_0x79d6('0xc'));var squel=require(_0x79d6('0xd'));var crypto=require(_0x79d6('0xe'));var jsforce=require(_0x79d6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x79d6('0x9'));var querystring=require('querystring');var Papa=require(_0x79d6('0x10'));var Redis=require(_0x79d6('0x11'));var authService=require(_0x79d6('0x12'));var qs=require(_0x79d6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79d6('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x79d6('0x15'));var licenseUtil=require(_0x79d6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e18dc,_0x40dfc4){_0x40dfc4=_0x40dfc4||0xcc;return function(_0x31d18b){if(_0x31d18b){return _0x3e18dc[_0x79d6('0x17')](_0x40dfc4);}return _0x3e18dc[_0x79d6('0x18')](_0x40dfc4)['end']();};}function respondWithResult(_0x5a4a16,_0x424861){_0x424861=_0x424861||0xc8;return function(_0x26bd96){if(_0x26bd96){return _0x5a4a16[_0x79d6('0x18')](_0x424861)['json'](_0x26bd96);}};}function respondWithFilteredResult(_0x544f12,_0x409e35){return function(_0x2880dc){if(_0x2880dc){var _0x113024=typeof _0x409e35[_0x79d6('0x19')]==='undefined'&&typeof _0x409e35[_0x79d6('0x1a')]==='undefined';var _0x291dbc=_0x2880dc[_0x79d6('0x1b')];var _0x243d45=_0x113024?0x0:_0x409e35[_0x79d6('0x19')];var _0x48b016=_0x113024?_0x2880dc[_0x79d6('0x1b')]:_0x409e35['offset']+_0x409e35[_0x79d6('0x1a')];var _0x255951;if(_0x48b016>=_0x291dbc){_0x48b016=_0x291dbc;_0x255951=0xc8;}else{_0x255951=0xce;}_0x544f12['status'](_0x255951);return _0x544f12[_0x79d6('0x1c')](_0x79d6('0x1d'),_0x243d45+'-'+_0x48b016+'/'+_0x291dbc)[_0x79d6('0x1e')](_0x2880dc);}return null;};}function patchUpdates(_0x25f5d1){return function(_0x36ae29){try{jsonpatch['apply'](_0x36ae29,_0x25f5d1,!![]);}catch(_0x1043e8){return BPromise[_0x79d6('0x1f')](_0x1043e8);}return _0x36ae29[_0x79d6('0x20')]();};}function saveUpdates(_0x4d1b0a,_0x122ac2){return function(_0x2ee1c4){if(_0x2ee1c4){return _0x2ee1c4[_0x79d6('0x21')](_0x4d1b0a)[_0x79d6('0x22')](function(_0xe0628){return _0xe0628;});}return null;};}function removeEntity(_0x414950,_0x3ec428){return function(_0x53d7b8){if(_0x53d7b8){return _0x53d7b8['destroy']()[_0x79d6('0x22')](function(){var _0x46be31=_0x53d7b8[_0x79d6('0x23')]({'plain':!![]});var _0x107de4=_0x79d6('0x24');return db[_0x79d6('0x25')][_0x79d6('0x26')]({'where':{'type':_0x107de4,'resourceId':_0x46be31['id']}})[_0x79d6('0x22')](function(){return _0x53d7b8;});})[_0x79d6('0x22')](function(){_0x414950[_0x79d6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11dafd,_0x2a593e){return function(_0x36837f){if(!_0x36837f){_0x11dafd[_0x79d6('0x17')](0x194);}return _0x36837f;};}function handleError(_0x2a5119,_0x38dd44){_0x38dd44=_0x38dd44||0x1f4;return function(_0x5a949c){logger[_0x79d6('0x27')](_0x5a949c['stack']);if(_0x5a949c['name']){delete _0x5a949c[_0x79d6('0x28')];}_0x2a5119[_0x79d6('0x18')](_0x38dd44)[_0x79d6('0x29')](_0x5a949c);};}exports[_0x79d6('0x2a')]=function(_0x5d3e23,_0x541936){var _0x118b39={},_0x503207={},_0x4015f3={'count':0x0,'rows':[]};var _0x198ccc=_[_0x79d6('0x2b')](db[_0x79d6('0x2c')]['rawAttributes'],function(_0x200fa7){return{'name':_0x200fa7['fieldName'],'type':_0x200fa7[_0x79d6('0x2d')]['key']};});_0x503207['model']=_[_0x79d6('0x2b')](_0x198ccc,_0x79d6('0x28'));_0x503207[_0x79d6('0x2e')]=_[_0x79d6('0x2f')](_0x5d3e23[_0x79d6('0x2e')]);_0x503207[_0x79d6('0x30')]=_[_0x79d6('0x31')](_0x503207['model'],_0x503207['query']);_0x118b39[_0x79d6('0x32')]=_['intersection'](_0x503207['model'],qs['fields'](_0x5d3e23[_0x79d6('0x2e')][_0x79d6('0x33')]));_0x118b39[_0x79d6('0x32')]=_0x118b39['attributes'][_0x79d6('0x34')]?_0x118b39[_0x79d6('0x32')]:_0x503207[_0x79d6('0x35')];if(!_0x5d3e23['query']['hasOwnProperty'](_0x79d6('0x36'))){_0x118b39[_0x79d6('0x1a')]=qs[_0x79d6('0x1a')](_0x5d3e23[_0x79d6('0x2e')][_0x79d6('0x1a')]);_0x118b39[_0x79d6('0x19')]=qs['offset'](_0x5d3e23[_0x79d6('0x2e')][_0x79d6('0x19')]);}_0x118b39[_0x79d6('0x37')]=qs['sort'](_0x5d3e23['query'][_0x79d6('0x38')]);_0x118b39[_0x79d6('0x39')]=qs[_0x79d6('0x30')](_[_0x79d6('0x3a')](_0x5d3e23[_0x79d6('0x2e')],_0x503207['filters']),_0x198ccc);if(_0x5d3e23[_0x79d6('0x2e')][_0x79d6('0x3b')]){_0x118b39['where']=_['merge'](_0x118b39[_0x79d6('0x39')],{'$or':_[_0x79d6('0x2b')](_0x198ccc,function(_0x469c60){if(_0x469c60['type']!=='VIRTUAL'){var _0x23950b={};_0x23950b[_0x469c60[_0x79d6('0x28')]]={'$like':'%'+_0x5d3e23['query']['filter']+'%'};return _0x23950b;}})});}_0x118b39=_[_0x79d6('0x3c')]({},_0x118b39,_0x5d3e23[_0x79d6('0x3d')]);var _0x483e72={'where':_0x118b39[_0x79d6('0x39')]};return db[_0x79d6('0x2c')][_0x79d6('0x1b')](_0x483e72)[_0x79d6('0x22')](function(_0x3c447d){_0x4015f3[_0x79d6('0x1b')]=_0x3c447d;if(_0x5d3e23[_0x79d6('0x2e')][_0x79d6('0x3e')]){_0x118b39[_0x79d6('0x3f')]=[{'all':!![]}];}return db[_0x79d6('0x2c')][_0x79d6('0x40')](_0x118b39);})[_0x79d6('0x22')](function(_0x1ea1a1){_0x4015f3[_0x79d6('0x41')]=_0x1ea1a1;return _0x4015f3;})['then'](respondWithFilteredResult(_0x541936,_0x118b39))[_0x79d6('0x42')](handleError(_0x541936,null));};exports[_0x79d6('0x43')]=function(_0x42a828,_0x14e021){var _0x5a3f9c={'raw':!![],'where':{'id':_0x42a828['params']['id']}},_0x1c4ab3={};_0x1c4ab3[_0x79d6('0x35')]=_[_0x79d6('0x2f')](db['Template'][_0x79d6('0x44')]);_0x1c4ab3[_0x79d6('0x2e')]=_['keys'](_0x42a828['query']);_0x1c4ab3[_0x79d6('0x30')]=_['intersection'](_0x1c4ab3[_0x79d6('0x35')],_0x1c4ab3['query']);_0x5a3f9c[_0x79d6('0x32')]=_[_0x79d6('0x31')](_0x1c4ab3[_0x79d6('0x35')],qs[_0x79d6('0x33')](_0x42a828['query'][_0x79d6('0x33')]));_0x5a3f9c['attributes']=_0x5a3f9c[_0x79d6('0x32')][_0x79d6('0x34')]?_0x5a3f9c[_0x79d6('0x32')]:_0x1c4ab3[_0x79d6('0x35')];if(_0x42a828[_0x79d6('0x2e')][_0x79d6('0x3e')]){_0x5a3f9c['include']=[{'all':!![]}];}_0x5a3f9c=_[_0x79d6('0x3c')]({},_0x5a3f9c,_0x42a828[_0x79d6('0x3d')]);return db[_0x79d6('0x2c')][_0x79d6('0x45')](_0x5a3f9c)['then'](handleEntityNotFound(_0x14e021,null))[_0x79d6('0x22')](respondWithResult(_0x14e021,null))[_0x79d6('0x42')](handleError(_0x14e021,null));};exports[_0x79d6('0x46')]=function(_0xd54c3a,_0x2b5cc6){return db['Template']['create'](_0xd54c3a[_0x79d6('0x47')],{})[_0x79d6('0x22')](function(_0x4b00f0){var _0x4adcd3=_0xd54c3a[_0x79d6('0x48')][_0x79d6('0x23')]({'plain':!![]});if(!_0x4adcd3)throw new Error(_0x79d6('0x49'));if(_0x4adcd3['role']==='user'){var _0x29989b=_0x4b00f0[_0x79d6('0x23')]({'plain':!![]});var _0x3e84a6='Templates';return db[_0x79d6('0x4a')][_0x79d6('0x45')]({'where':{'name':_0x3e84a6,'userProfileId':_0x4adcd3[_0x79d6('0x4b')]},'raw':!![]})[_0x79d6('0x22')](function(_0x3ff558){if(_0x3ff558&&_0x3ff558[_0x79d6('0x4c')]===0x0){return db['UserProfileResource'][_0x79d6('0x46')]({'name':_0x29989b['name'],'resourceId':_0x29989b['id'],'type':_0x3ff558[_0x79d6('0x28')],'sectionId':_0x3ff558['id']},{})[_0x79d6('0x22')](function(){return _0x4b00f0;});}else{return _0x4b00f0;}})['catch'](function(_0x3dca3e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dca3e);throw _0x3dca3e;});}return _0x4b00f0;})['then'](respondWithResult(_0x2b5cc6,0xc9))[_0x79d6('0x42')](handleError(_0x2b5cc6,null));};exports[_0x79d6('0x21')]=function(_0x42ea77,_0x5c08a5){if(_0x42ea77[_0x79d6('0x47')]['id']){delete _0x42ea77['body']['id'];}return db['Template']['find']({'where':{'id':_0x42ea77[_0x79d6('0x4d')]['id']}})[_0x79d6('0x22')](handleEntityNotFound(_0x5c08a5,null))['then'](saveUpdates(_0x42ea77[_0x79d6('0x47')],null))['then'](respondWithResult(_0x5c08a5,null))[_0x79d6('0x42')](handleError(_0x5c08a5,null));};exports[_0x79d6('0x26')]=function(_0x41a144,_0xb48cdc){return db[_0x79d6('0x2c')][_0x79d6('0x45')]({'where':{'id':_0x41a144['params']['id']}})['then'](handleEntityNotFound(_0xb48cdc,null))['then'](removeEntity(_0xb48cdc,null))[_0x79d6('0x42')](handleError(_0xb48cdc,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 9f41ca0..1e11c59 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 _0xa9fb=['path','rimraf','../../config/environment','./template.attributes','tools_templates','lodash','util','api','bluebird','request-promise'];(function(_0xeea013,_0x3332c8){var _0x555d2e=function(_0x3b3797){while(--_0x3b3797){_0xeea013['push'](_0xeea013['shift']());}};_0x555d2e(++_0x3332c8);}(_0xa9fb,0x1b3));var _0xba9f=function(_0x25100c,_0x582cdd){_0x25100c=_0x25100c-0x0;var _0x2ff451=_0xa9fb[_0x25100c];return _0x2ff451;};'use strict';var _=require(_0xba9f('0x0'));var util=require(_0xba9f('0x1'));var logger=require('../../config/logger')(_0xba9f('0x2'));var moment=require('moment');var BPromise=require(_0xba9f('0x3'));var rp=require(_0xba9f('0x4'));var fs=require('fs');var path=require(_0xba9f('0x5'));var rimraf=require(_0xba9f('0x6'));var config=require(_0xba9f('0x7'));var attributes=require(_0xba9f('0x8'));module['exports']=function(_0x1d3729,_0x273b6c){return _0x1d3729['define']('Template',attributes,{'tableName':_0xba9f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5efa=['exports','define','Template','lodash','util','api','bluebird','rimraf','../../config/environment','./template.attributes'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x5efa,0x1c5));var _0xa5ef=function(_0x3f5dba,_0x49e23d){_0x3f5dba=_0x3f5dba-0x0;var _0x273d14=_0x5efa[_0x3f5dba];return _0x273d14;};'use strict';var _=require(_0xa5ef('0x0'));var util=require(_0xa5ef('0x1'));var logger=require('../../config/logger')(_0xa5ef('0x2'));var moment=require('moment');var BPromise=require(_0xa5ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa5ef('0x4'));var config=require(_0xa5ef('0x5'));var attributes=require(_0xa5ef('0x6'));module[_0xa5ef('0x7')]=function(_0x35896f,_0x4f50c9){return _0x35896f[_0xa5ef('0x8')](_0xa5ef('0x9'),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 aa88855..9181a1a 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 _0xf7f5=['../../config/environment','jayson/promise','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','map','include','model','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xf7f5,0x7d));var _0x5f7f=function(_0x5d3cc1,_0x164096){_0x5d3cc1=_0x5d3cc1-0x0;var _0x1581a7=_0xf7f5[_0x5d3cc1];return _0x1581a7;};'use strict';var _=require(_0x5f7f('0x0'));var util=require('util');var moment=require(_0x5f7f('0x1'));var BPromise=require(_0x5f7f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f7f('0x4'));var logger=require(_0x5f7f('0x5'))(_0x5f7f('0x6'));var config=require(_0x5f7f('0x7'));var jayson=require(_0x5f7f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4950bd,_0x3e65e2,_0x290bdb){return new BPromise(function(_0x52fe6f,_0x22e27d){return client[_0x5f7f('0x9')](_0x4950bd,_0x290bdb)[_0x5f7f('0xa')](function(_0x37b5a9){logger[_0x5f7f('0xb')](_0x5f7f('0xc'),_0x3e65e2,'request\x20sent');logger[_0x5f7f('0xd')](_0x5f7f('0xe'),_0x3e65e2,_0x5f7f('0xf'),JSON[_0x5f7f('0x10')](_0x37b5a9));if(_0x37b5a9[_0x5f7f('0x11')]){if(_0x37b5a9[_0x5f7f('0x11')][_0x5f7f('0x12')]===0x1f4){logger[_0x5f7f('0x11')](_0x5f7f('0xc'),_0x3e65e2,_0x37b5a9[_0x5f7f('0x11')][_0x5f7f('0x13')]);return _0x22e27d(_0x37b5a9[_0x5f7f('0x11')][_0x5f7f('0x13')]);}logger[_0x5f7f('0x11')](_0x5f7f('0xc'),_0x3e65e2,_0x37b5a9['error']['message']);return _0x52fe6f(_0x37b5a9[_0x5f7f('0x11')][_0x5f7f('0x13')]);}else{logger[_0x5f7f('0xb')]('Template,\x20%s,\x20%s',_0x3e65e2,'request\x20sent');_0x52fe6f(_0x37b5a9[_0x5f7f('0x14')][_0x5f7f('0x13')]);}})[_0x5f7f('0x15')](function(_0x4a8dc1){logger['error'](_0x5f7f('0xc'),_0x3e65e2,_0x4a8dc1);_0x22e27d(_0x4a8dc1);});});}exports[_0x5f7f('0x16')]=function(_0x47105a){var _0x559f49=this;return new Promise(function(_0x35f3a3,_0x4bd8fe){return db[_0x5f7f('0x17')][_0x5f7f('0x18')]({'raw':_0x47105a['options']?_0x47105a[_0x5f7f('0x19')][_0x5f7f('0x1a')]===undefined?!![]:![]:!![],'where':_0x47105a['options']?_0x47105a[_0x5f7f('0x19')][_0x5f7f('0x1b')]||null:null,'attributes':_0x47105a['options']?_0x47105a[_0x5f7f('0x19')][_0x5f7f('0x1c')]||null:null,'limit':_0x47105a[_0x5f7f('0x19')]?_0x47105a[_0x5f7f('0x19')][_0x5f7f('0x1d')]||null:null,'include':_0x47105a['options']?_0x47105a[_0x5f7f('0x19')]['include']?_[_0x5f7f('0x1e')](_0x47105a[_0x5f7f('0x19')][_0x5f7f('0x1f')],function(_0x2e48be){return{'model':db[_0x2e48be[_0x5f7f('0x20')]],'as':_0x2e48be['as'],'attributes':_0x2e48be['attributes'],'include':_0x2e48be[_0x5f7f('0x1f')]?_[_0x5f7f('0x1e')](_0x2e48be[_0x5f7f('0x1f')],function(_0x1e9c5d){return{'model':db[_0x1e9c5d[_0x5f7f('0x20')]],'as':_0x1e9c5d['as'],'attributes':_0x1e9c5d[_0x5f7f('0x1c')],'include':_0x1e9c5d[_0x5f7f('0x1f')]?_[_0x5f7f('0x1e')](_0x1e9c5d[_0x5f7f('0x1f')],function(_0x211fa8){return{'model':db[_0x211fa8['model']],'as':_0x211fa8['as'],'attributes':_0x211fa8['attributes']};}):[]};}):[]};}):[]:[]})[_0x5f7f('0xa')](function(_0x26b663){logger[_0x5f7f('0xb')](_0x5f7f('0x16'),_0x47105a);logger[_0x5f7f('0xd')](_0x5f7f('0x16'),_0x47105a,JSON['stringify'](_0x26b663));_0x35f3a3(_0x26b663);})['catch'](function(_0x56231d){logger['error'](_0x5f7f('0x16'),_0x56231d[_0x5f7f('0x13')],_0x47105a);_0x4bd8fe(_0x559f49[_0x5f7f('0x11')](0x1f4,_0x56231d[_0x5f7f('0x13')]));});});}; \ No newline at end of file +var _0x5047=['message','Template','findAll','options','raw','where','attributes','limit','include','model','map','then','GetTemplate','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s'];(function(_0x39157f,_0x3d8c1e){var _0x1ae4e2=function(_0x3429af){while(--_0x3429af){_0x39157f['push'](_0x39157f['shift']());}};_0x1ae4e2(++_0x3d8c1e);}(_0x5047,0xe0));var _0x7504=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x5047[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0x7504('0x0'));var util=require(_0x7504('0x1'));var moment=require(_0x7504('0x2'));var BPromise=require(_0x7504('0x3'));var rs=require(_0x7504('0x4'));var fs=require('fs');var Redis=require(_0x7504('0x5'));var db=require(_0x7504('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7504('0x7'))(_0x7504('0x8'));var config=require(_0x7504('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7504('0xa')][_0x7504('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e9c6,_0x3ca695,_0x239cbc){return new BPromise(function(_0xc165a5,_0x2c1591){return client[_0x7504('0xc')](_0x27e9c6,_0x239cbc)['then'](function(_0x276f6b){logger[_0x7504('0xd')]('Template,\x20%s,\x20%s',_0x3ca695,_0x7504('0xe'));logger[_0x7504('0xf')](_0x7504('0x10'),_0x3ca695,_0x7504('0xe'),JSON[_0x7504('0x11')](_0x276f6b));if(_0x276f6b[_0x7504('0x12')]){if(_0x276f6b[_0x7504('0x12')][_0x7504('0x13')]===0x1f4){logger[_0x7504('0x12')](_0x7504('0x14'),_0x3ca695,_0x276f6b[_0x7504('0x12')]['message']);return _0x2c1591(_0x276f6b[_0x7504('0x12')][_0x7504('0x15')]);}logger[_0x7504('0x12')](_0x7504('0x14'),_0x3ca695,_0x276f6b['error'][_0x7504('0x15')]);return _0xc165a5(_0x276f6b[_0x7504('0x12')][_0x7504('0x15')]);}else{logger[_0x7504('0xd')]('Template,\x20%s,\x20%s',_0x3ca695,_0x7504('0xe'));_0xc165a5(_0x276f6b['result']['message']);}})['catch'](function(_0x2665b4){logger[_0x7504('0x12')]('Template,\x20%s,\x20%s',_0x3ca695,_0x2665b4);_0x2c1591(_0x2665b4);});});}exports['GetTemplate']=function(_0x5f886f){var _0x1408a0=this;return new Promise(function(_0x1b211b,_0x3a8eb0){return db[_0x7504('0x16')][_0x7504('0x17')]({'raw':_0x5f886f[_0x7504('0x18')]?_0x5f886f[_0x7504('0x18')][_0x7504('0x19')]===undefined?!![]:![]:!![],'where':_0x5f886f[_0x7504('0x18')]?_0x5f886f[_0x7504('0x18')][_0x7504('0x1a')]||null:null,'attributes':_0x5f886f[_0x7504('0x18')]?_0x5f886f[_0x7504('0x18')][_0x7504('0x1b')]||null:null,'limit':_0x5f886f[_0x7504('0x18')]?_0x5f886f['options'][_0x7504('0x1c')]||null:null,'include':_0x5f886f[_0x7504('0x18')]?_0x5f886f[_0x7504('0x18')][_0x7504('0x1d')]?_['map'](_0x5f886f[_0x7504('0x18')][_0x7504('0x1d')],function(_0x2b587f){return{'model':db[_0x2b587f[_0x7504('0x1e')]],'as':_0x2b587f['as'],'attributes':_0x2b587f[_0x7504('0x1b')],'include':_0x2b587f[_0x7504('0x1d')]?_[_0x7504('0x1f')](_0x2b587f[_0x7504('0x1d')],function(_0x5ec420){return{'model':db[_0x5ec420[_0x7504('0x1e')]],'as':_0x5ec420['as'],'attributes':_0x5ec420[_0x7504('0x1b')],'include':_0x5ec420['include']?_[_0x7504('0x1f')](_0x5ec420[_0x7504('0x1d')],function(_0x37c083){return{'model':db[_0x37c083['model']],'as':_0x37c083['as'],'attributes':_0x37c083['attributes']};}):[]};}):[]};}):[]:[]})[_0x7504('0x20')](function(_0x3265e7){logger['info'](_0x7504('0x21'),_0x5f886f);logger['debug'](_0x7504('0x21'),_0x5f886f,JSON[_0x7504('0x11')](_0x3265e7));_0x1b211b(_0x3265e7);})[_0x7504('0x22')](function(_0x373af4){logger['error'](_0x7504('0x21'),_0x373af4[_0x7504('0x15')],_0x5f886f);_0x3a8eb0(_0x1408a0['error'](0x1f4,_0x373af4[_0x7504('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 50320c1..43be9f2 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 _0xd12a=['isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAnyCondition','put','update','delete','destroy','exports','util','connect-timeout','fs-extra','../../config/environment','./trigger.controller','get','index','/:id'];(function(_0x357a32,_0x3f469a){var _0x24c956=function(_0x2c25f2){while(--_0x2c25f2){_0x357a32['push'](_0x357a32['shift']());}};_0x24c956(++_0x3f469a);}(_0xd12a,0x1f2));var _0xad12=function(_0x244a0c,_0x126dde){_0x244a0c=_0x244a0c-0x0;var _0x1d64a0=_0xd12a[_0x244a0c];return _0x1d64a0;};'use strict';var multer=require('multer');var util=require(_0xad12('0x0'));var path=require('path');var timeout=require(_0xad12('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xad12('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xad12('0x3'));var controller=require(_0xad12('0x4'));router[_0xad12('0x5')]('/',auth['isAuthenticated'](),controller[_0xad12('0x6')]);router[_0xad12('0x5')](_0xad12('0x7'),auth[_0xad12('0x8')](),controller['show']);router[_0xad12('0x5')](_0xad12('0x9'),auth['isAuthenticated'](),controller[_0xad12('0xa')]);router[_0xad12('0x5')](_0xad12('0xb'),auth[_0xad12('0x8')](),controller['getAnyConditions']);router[_0xad12('0x5')](_0xad12('0xc'),auth[_0xad12('0x8')](),controller[_0xad12('0xd')]);router[_0xad12('0xe')]('/',auth[_0xad12('0x8')](),controller[_0xad12('0xf')]);router[_0xad12('0xe')](_0xad12('0x9'),auth[_0xad12('0x8')](),controller['addAllCondition']);router['post'](_0xad12('0xb'),auth[_0xad12('0x8')](),controller[_0xad12('0x10')]);router[_0xad12('0xe')](_0xad12('0xc'),auth[_0xad12('0x8')](),controller['addAction']);router[_0xad12('0x11')](_0xad12('0x7'),auth['isAuthenticated'](),controller[_0xad12('0x12')]);router[_0xad12('0x13')](_0xad12('0x7'),auth[_0xad12('0x8')](),controller[_0xad12('0x14')]);module[_0xad12('0x15')]=router; \ No newline at end of file +var _0xc20c=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/any_conditions','getAnyConditions','getActions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction','put'];(function(_0x3a8d06,_0xc5596f){var _0x3c1015=function(_0x1888a5){while(--_0x1888a5){_0x3a8d06['push'](_0x3a8d06['shift']());}};_0x3c1015(++_0xc5596f);}(_0xc20c,0x139));var _0xcc20=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0xc20c[_0x2e0443];return _0x52d450;};'use strict';var multer=require(_0xcc20('0x0'));var util=require(_0xcc20('0x1'));var path=require(_0xcc20('0x2'));var timeout=require(_0xcc20('0x3'));var express=require(_0xcc20('0x4'));var router=express[_0xcc20('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcc20('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcc20('0x7'));var controller=require('./trigger.controller');router[_0xcc20('0x8')]('/',auth[_0xcc20('0x9')](),controller[_0xcc20('0xa')]);router[_0xcc20('0x8')]('/:id',auth[_0xcc20('0x9')](),controller[_0xcc20('0xb')]);router[_0xcc20('0x8')]('/:id/all_conditions',auth[_0xcc20('0x9')](),controller['getAllConditions']);router[_0xcc20('0x8')](_0xcc20('0xc'),auth[_0xcc20('0x9')](),controller[_0xcc20('0xd')]);router['get']('/:id/actions',auth[_0xcc20('0x9')](),controller[_0xcc20('0xe')]);router[_0xcc20('0xf')]('/',auth[_0xcc20('0x9')](),controller[_0xcc20('0x10')]);router[_0xcc20('0xf')](_0xcc20('0x11'),auth['isAuthenticated'](),controller[_0xcc20('0x12')]);router[_0xcc20('0xf')]('/:id/any_conditions',auth[_0xcc20('0x9')](),controller[_0xcc20('0x13')]);router[_0xcc20('0xf')](_0xcc20('0x14'),auth[_0xcc20('0x9')](),controller[_0xcc20('0x15')]);router[_0xcc20('0x16')](_0xcc20('0x17'),auth[_0xcc20('0x9')](),controller[_0xcc20('0x18')]);router[_0xcc20('0x19')](_0xcc20('0x17'),auth[_0xcc20('0x9')](),controller[_0xcc20('0x1a')]);module[_0xcc20('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 5643384..e79cee7 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 _0x6ae3=['sequelize','exports','STRING','BOOLEAN'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x6ae3,0xe8));var _0x36ae=function(_0x4536a7,_0x2782d4){_0x4536a7=_0x4536a7-0x0;var _0x514a27=_0x6ae3[_0x4536a7];return _0x514a27;};'use strict';var Sequelize=require(_0x36ae('0x0'));module[_0x36ae('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x36ae('0x2')]},'description':{'type':Sequelize[_0x36ae('0x2')]},'status':{'type':Sequelize[_0x36ae('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2ffc=['STRING','BOOLEAN'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x2ffc,0xc4));var _0xc2ff=function(_0x199906,_0x4b2987){_0x199906=_0x199906-0x0;var _0x10722c=_0x2ffc[_0x199906];return _0x10722c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc2ff('0x0')]},'channel':{'type':Sequelize[_0xc2ff('0x0')]},'description':{'type':Sequelize[_0xc2ff('0x0')]},'status':{'type':Sequelize[_0xc2ff('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index ad745ac..a383411 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 _0x0576=['send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','nolimit','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','Triggers','then','end','error','stack','name'];(function(_0x181945,_0x180cb8){var _0x3a129c=function(_0x4d3bef){while(--_0x4d3bef){_0x181945['push'](_0x181945['shift']());}};_0x3a129c(++_0x180cb8);}(_0x0576,0xf9));var _0x6057=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0576[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x6057('0x0'));var rimraf=require(_0x6057('0x1'));var zipdir=require(_0x6057('0x2'));var jsonpatch=require(_0x6057('0x3'));var rp=require(_0x6057('0x4'));var moment=require(_0x6057('0x5'));var BPromise=require(_0x6057('0x6'));var Mustache=require(_0x6057('0x7'));var util=require('util');var path=require(_0x6057('0x8'));var sox=require(_0x6057('0x9'));var csv=require(_0x6057('0xa'));var ejs=require(_0x6057('0xb'));var fs=require('fs');var fs_extra=require(_0x6057('0xc'));var _=require('lodash');var squel=require(_0x6057('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6057('0xa'));var querystring=require(_0x6057('0xe'));var Papa=require(_0x6057('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6057('0x10'));var as=require(_0x6057('0x11'));var hardwareService=require(_0x6057('0x12'));var logger=require(_0x6057('0x13'))(_0x6057('0x14'));var utils=require(_0x6057('0x15'));var config=require(_0x6057('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x372a7d,_0xee7a6a){_0xee7a6a=_0xee7a6a||0xcc;return function(_0x2aca19){if(_0x2aca19){return _0x372a7d[_0x6057('0x17')](_0xee7a6a);}return _0x372a7d[_0x6057('0x18')](_0xee7a6a)['end']();};}function respondWithResult(_0x225cd5,_0x1482a5){_0x1482a5=_0x1482a5||0xc8;return function(_0x15762f){if(_0x15762f){return _0x225cd5['status'](_0x1482a5)[_0x6057('0x19')](_0x15762f);}};}function respondWithFilteredResult(_0x5ed61a,_0x5ed39e){return function(_0x18018b){if(_0x18018b){var _0x59987a=typeof _0x5ed39e[_0x6057('0x1a')]===_0x6057('0x1b')&&typeof _0x5ed39e[_0x6057('0x1c')]===_0x6057('0x1b');var _0x53744b=_0x18018b[_0x6057('0x1d')];var _0x5127bd=_0x59987a?0x0:_0x5ed39e[_0x6057('0x1a')];var _0x11c837=_0x59987a?_0x18018b[_0x6057('0x1d')]:_0x5ed39e[_0x6057('0x1a')]+_0x5ed39e['limit'];var _0x19b015;if(_0x11c837>=_0x53744b){_0x11c837=_0x53744b;_0x19b015=0xc8;}else{_0x19b015=0xce;}_0x5ed61a[_0x6057('0x18')](_0x19b015);return _0x5ed61a[_0x6057('0x1e')](_0x6057('0x1f'),_0x5127bd+'-'+_0x11c837+'/'+_0x53744b)[_0x6057('0x19')](_0x18018b);}return null;};}function patchUpdates(_0x224802){return function(_0x3559c4){try{jsonpatch['apply'](_0x3559c4,_0x224802,!![]);}catch(_0x12ee25){return BPromise[_0x6057('0x20')](_0x12ee25);}return _0x3559c4['save']();};}function saveUpdates(_0x4dbd05,_0x2d5edd){return function(_0x1b2978){if(_0x1b2978){return _0x1b2978[_0x6057('0x21')](_0x4dbd05)['then'](function(_0x54c878){return _0x54c878;});}return null;};}function removeEntity(_0x373f95,_0x48c4a2){return function(_0x21cb2e){if(_0x21cb2e){return _0x21cb2e[_0x6057('0x22')]()['then'](function(){var _0x3e1f4e=_0x21cb2e[_0x6057('0x23')]({'plain':!![]});var _0x3eae60=_0x6057('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x3eae60,'resourceId':_0x3e1f4e['id']}})[_0x6057('0x25')](function(){return _0x21cb2e;});})[_0x6057('0x25')](function(){_0x373f95[_0x6057('0x18')](0xcc)[_0x6057('0x26')]();});}};}function handleEntityNotFound(_0x1eaa08,_0x44f3aa){return function(_0x4eb8fc){if(!_0x4eb8fc){_0x1eaa08[_0x6057('0x17')](0x194);}return _0x4eb8fc;};}function handleError(_0x460c12,_0x532b12){_0x532b12=_0x532b12||0x1f4;return function(_0x3b1e79){logger[_0x6057('0x27')](_0x3b1e79[_0x6057('0x28')]);if(_0x3b1e79[_0x6057('0x29')]){delete _0x3b1e79[_0x6057('0x29')];}_0x460c12[_0x6057('0x18')](_0x532b12)[_0x6057('0x2a')](_0x3b1e79);};}exports[_0x6057('0x2b')]=function(_0xfecb21,_0x27ae94){var _0x54e57b={},_0x5e3f28={},_0x2176e0={'count':0x0,'rows':[]};var _0x54aed0=_[_0x6057('0x2c')](db['Trigger'][_0x6057('0x2d')],function(_0x577509){return{'name':_0x577509[_0x6057('0x2e')],'type':_0x577509[_0x6057('0x2f')][_0x6057('0x30')]};});_0x5e3f28[_0x6057('0x31')]=_[_0x6057('0x2c')](_0x54aed0,_0x6057('0x29'));_0x5e3f28[_0x6057('0x32')]=_[_0x6057('0x33')](_0xfecb21['query']);_0x5e3f28[_0x6057('0x34')]=_[_0x6057('0x35')](_0x5e3f28[_0x6057('0x31')],_0x5e3f28['query']);_0x54e57b['attributes']=_[_0x6057('0x35')](_0x5e3f28['model'],qs[_0x6057('0x36')](_0xfecb21[_0x6057('0x32')][_0x6057('0x36')]));_0x54e57b[_0x6057('0x37')]=_0x54e57b[_0x6057('0x37')][_0x6057('0x38')]?_0x54e57b['attributes']:_0x5e3f28['model'];if(!_0xfecb21[_0x6057('0x32')][_0x6057('0x39')]('nolimit')){_0x54e57b[_0x6057('0x1c')]=qs[_0x6057('0x1c')](_0xfecb21[_0x6057('0x32')][_0x6057('0x1c')]);_0x54e57b[_0x6057('0x1a')]=qs[_0x6057('0x1a')](_0xfecb21['query'][_0x6057('0x1a')]);}_0x54e57b[_0x6057('0x3a')]=qs[_0x6057('0x3b')](_0xfecb21['query'][_0x6057('0x3b')]);_0x54e57b[_0x6057('0x3c')]=qs[_0x6057('0x34')](_[_0x6057('0x3d')](_0xfecb21[_0x6057('0x32')],_0x5e3f28[_0x6057('0x34')]),_0x54aed0);if(_0xfecb21[_0x6057('0x32')][_0x6057('0x3e')]){_0x54e57b['where']=_[_0x6057('0x3f')](_0x54e57b[_0x6057('0x3c')],{'$or':_[_0x6057('0x2c')](_0x54aed0,function(_0x4135e4){if(_0x4135e4[_0x6057('0x2f')]!==_0x6057('0x40')){var _0x234adc={};_0x234adc[_0x4135e4[_0x6057('0x29')]]={'$like':'%'+_0xfecb21[_0x6057('0x32')][_0x6057('0x3e')]+'%'};return _0x234adc;}})});}_0x54e57b=_[_0x6057('0x3f')]({},_0x54e57b,_0xfecb21[_0x6057('0x41')]);var _0x19b3c0={'where':_0x54e57b['where']};return db[_0x6057('0x42')]['count'](_0x19b3c0)[_0x6057('0x25')](function(_0x2feca3){_0x2176e0[_0x6057('0x1d')]=_0x2feca3;if(_0xfecb21['query']['includeAll']){_0x54e57b[_0x6057('0x43')]=[{'all':!![]}];}return db[_0x6057('0x42')][_0x6057('0x44')](_0x54e57b);})[_0x6057('0x25')](function(_0x5853cd){_0x2176e0[_0x6057('0x45')]=_0x5853cd;return _0x2176e0;})[_0x6057('0x25')](respondWithFilteredResult(_0x27ae94,_0x54e57b))[_0x6057('0x46')](handleError(_0x27ae94,null));};exports[_0x6057('0x47')]=function(_0xa02b8c,_0x3bc7c4){var _0x14136f={'raw':![],'where':{'id':_0xa02b8c[_0x6057('0x48')]['id']}},_0x5e6597={};_0x5e6597[_0x6057('0x31')]=_['keys'](db[_0x6057('0x42')][_0x6057('0x2d')]);_0x5e6597[_0x6057('0x32')]=_[_0x6057('0x33')](_0xa02b8c[_0x6057('0x32')]);_0x5e6597[_0x6057('0x34')]=_['intersection'](_0x5e6597[_0x6057('0x31')],_0x5e6597['query']);_0x14136f[_0x6057('0x37')]=_[_0x6057('0x35')](_0x5e6597['model'],qs[_0x6057('0x36')](_0xa02b8c['query']['fields']));_0x14136f['attributes']=_0x14136f[_0x6057('0x37')][_0x6057('0x38')]?_0x14136f[_0x6057('0x37')]:_0x5e6597['model'];if(_0xa02b8c[_0x6057('0x32')][_0x6057('0x49')]){_0x14136f['include']=[{'all':!![]}];}_0x14136f=_[_0x6057('0x3f')]({},_0x14136f,_0xa02b8c[_0x6057('0x41')]);return db[_0x6057('0x42')][_0x6057('0x4a')](_0x14136f)[_0x6057('0x25')](handleEntityNotFound(_0x3bc7c4,null))[_0x6057('0x25')](respondWithResult(_0x3bc7c4,null))['catch'](handleError(_0x3bc7c4,null));};exports[_0x6057('0x4b')]=function(_0x4bed32,_0x371d3e){return db[_0x6057('0x42')][_0x6057('0x4b')](_0x4bed32['body'],{})['then'](function(_0x69a461){var _0x556241=_0x4bed32[_0x6057('0x4c')][_0x6057('0x23')]({'plain':!![]});if(!_0x556241)throw new Error(_0x6057('0x4d'));if(_0x556241[_0x6057('0x4e')]===_0x6057('0x4c')){var _0x141bd2=_0x69a461['get']({'plain':!![]});var _0x40eed6=_0x6057('0x24');return db[_0x6057('0x4f')][_0x6057('0x4a')]({'where':{'name':_0x40eed6,'userProfileId':_0x556241[_0x6057('0x50')]},'raw':!![]})[_0x6057('0x25')](function(_0x5e5611){if(_0x5e5611&&_0x5e5611[_0x6057('0x51')]===0x0){return db[_0x6057('0x52')]['create']({'name':_0x141bd2[_0x6057('0x29')],'resourceId':_0x141bd2['id'],'type':_0x5e5611[_0x6057('0x29')],'sectionId':_0x5e5611['id']},{})['then'](function(){return _0x69a461;});}else{return _0x69a461;}})[_0x6057('0x46')](function(_0x11c004){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11c004);throw _0x11c004;});}return _0x69a461;})[_0x6057('0x25')](respondWithResult(_0x371d3e,0xc9))[_0x6057('0x46')](handleError(_0x371d3e,null));};exports[_0x6057('0x21')]=function(_0x38c2f1,_0x5d8916){if(_0x38c2f1[_0x6057('0x53')]['id']){delete _0x38c2f1[_0x6057('0x53')]['id'];}return db[_0x6057('0x42')][_0x6057('0x4a')]({'where':{'id':_0x38c2f1[_0x6057('0x48')]['id']}})[_0x6057('0x25')](handleEntityNotFound(_0x5d8916,null))['then'](saveUpdates(_0x38c2f1[_0x6057('0x53')],null))['then'](respondWithResult(_0x5d8916,null))['catch'](handleError(_0x5d8916,null));};exports[_0x6057('0x22')]=function(_0x1ba086,_0x1bf4a6){return db[_0x6057('0x42')][_0x6057('0x4a')]({'where':{'id':_0x1ba086[_0x6057('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bf4a6,null))[_0x6057('0x25')](removeEntity(_0x1bf4a6,null))[_0x6057('0x46')](handleError(_0x1bf4a6,null));};exports[_0x6057('0x54')]=function(_0x2310eb,_0x5d6d10,_0x371487){if(_0x2310eb[_0x6057('0x53')]['id']){delete _0x2310eb[_0x6057('0x53')]['id'];}return db['Trigger'][_0x6057('0x4a')]({'where':{'id':_0x2310eb[_0x6057('0x48')]['id']}})[_0x6057('0x25')](handleEntityNotFound(_0x5d6d10,null))[_0x6057('0x25')](function(_0x5b315e){if(_0x5b315e){_0x2310eb[_0x6057('0x53')][_0x6057('0x55')]=_0x5b315e['id'];return db[_0x6057('0x56')][_0x6057('0x4b')](_0x2310eb['body']);}})[_0x6057('0x25')](respondWithResult(_0x5d6d10,null))['catch'](handleError(_0x5d6d10,null));};exports[_0x6057('0x57')]=function(_0x510dde,_0x3ae8e5,_0x319f9c){if(_0x510dde[_0x6057('0x53')]['id']){delete _0x510dde[_0x6057('0x53')]['id'];}return db[_0x6057('0x42')]['find']({'where':{'id':_0x510dde[_0x6057('0x48')]['id']}})[_0x6057('0x25')](handleEntityNotFound(_0x3ae8e5,null))[_0x6057('0x25')](function(_0x3c6f1b){if(_0x3c6f1b){_0x510dde['body'][_0x6057('0x58')]=_0x3c6f1b['id'];return db[_0x6057('0x56')][_0x6057('0x4b')](_0x510dde[_0x6057('0x53')]);}})[_0x6057('0x25')](respondWithResult(_0x3ae8e5,null))[_0x6057('0x46')](handleError(_0x3ae8e5,null));};exports[_0x6057('0x59')]=function(_0x26adf7,_0x38a6e2,_0x3b7113){var _0x3a275a={};var _0x1a4b93={};var _0xe831e6;var _0x375883;return db[_0x6057('0x42')][_0x6057('0x5a')]({'where':{'id':_0x26adf7[_0x6057('0x48')]['id']}})[_0x6057('0x25')](handleEntityNotFound(_0x38a6e2,null))[_0x6057('0x25')](function(_0x1dd014){if(_0x1dd014){_0xe831e6=_0x1dd014;_0x1a4b93[_0x6057('0x31')]=_['keys'](db[_0x6057('0x56')][_0x6057('0x2d')]);_0x1a4b93[_0x6057('0x32')]=_[_0x6057('0x33')](_0x26adf7[_0x6057('0x32')]);_0x1a4b93[_0x6057('0x34')]=_[_0x6057('0x35')](_0x1a4b93[_0x6057('0x31')],_0x1a4b93[_0x6057('0x32')]);_0x3a275a['attributes']=_[_0x6057('0x35')](_0x1a4b93[_0x6057('0x31')],qs[_0x6057('0x36')](_0x26adf7[_0x6057('0x32')][_0x6057('0x36')]));_0x3a275a[_0x6057('0x37')]=_0x3a275a[_0x6057('0x37')]['length']?_0x3a275a[_0x6057('0x37')]:_0x1a4b93[_0x6057('0x31')];_0x3a275a[_0x6057('0x3a')]=qs[_0x6057('0x3b')](_0x26adf7['query'][_0x6057('0x3b')]);_0x3a275a[_0x6057('0x3c')]=qs['filters'](_[_0x6057('0x3d')](_0x26adf7['query'],_0x1a4b93[_0x6057('0x34')]));if(_0x26adf7[_0x6057('0x32')][_0x6057('0x3e')]){_0x3a275a[_0x6057('0x3c')]=_[_0x6057('0x3f')](_0x3a275a[_0x6057('0x3c')],{'$or':_[_0x6057('0x2c')](_0x3a275a[_0x6057('0x37')],function(_0x33eb6b){var _0x28f550={};_0x28f550[_0x33eb6b]={'$like':'%'+_0x26adf7[_0x6057('0x32')]['filter']+'%'};return _0x28f550;})});}_0x3a275a=_[_0x6057('0x3f')]({},_0x3a275a,_0x26adf7[_0x6057('0x41')]);return _0xe831e6[_0x6057('0x59')](_0x3a275a);}})[_0x6057('0x25')](function(_0x496c84){if(_0x496c84){_0x375883=_0x496c84[_0x6057('0x38')];if(!_0x26adf7[_0x6057('0x32')][_0x6057('0x39')](_0x6057('0x5b'))){_0x3a275a[_0x6057('0x1c')]=qs['limit'](_0x26adf7['query'][_0x6057('0x1c')]);_0x3a275a['offset']=qs[_0x6057('0x1a')](_0x26adf7['query'][_0x6057('0x1a')]);}return _0xe831e6[_0x6057('0x59')](_0x3a275a);}})[_0x6057('0x25')](function(_0x581c10){if(_0x581c10){return _0x581c10?{'count':_0x375883,'rows':_0x581c10}:null;}})[_0x6057('0x25')](respondWithResult(_0x38a6e2,null))[_0x6057('0x46')](handleError(_0x38a6e2,null));};exports['getAnyConditions']=function(_0x2f19c2,_0x10d8b7,_0x597ea5){var _0x5817b4={};var _0x3ce1ad={};var _0x33fe12;var _0x3bb732;return db['Trigger']['findOne']({'where':{'id':_0x2f19c2['params']['id']}})[_0x6057('0x25')](handleEntityNotFound(_0x10d8b7,null))[_0x6057('0x25')](function(_0x2c37a6){if(_0x2c37a6){_0x33fe12=_0x2c37a6;_0x3ce1ad[_0x6057('0x31')]=_[_0x6057('0x33')](db['Condition'][_0x6057('0x2d')]);_0x3ce1ad['query']=_[_0x6057('0x33')](_0x2f19c2['query']);_0x3ce1ad[_0x6057('0x34')]=_[_0x6057('0x35')](_0x3ce1ad[_0x6057('0x31')],_0x3ce1ad[_0x6057('0x32')]);_0x5817b4[_0x6057('0x37')]=_[_0x6057('0x35')](_0x3ce1ad[_0x6057('0x31')],qs['fields'](_0x2f19c2[_0x6057('0x32')][_0x6057('0x36')]));_0x5817b4[_0x6057('0x37')]=_0x5817b4[_0x6057('0x37')]['length']?_0x5817b4[_0x6057('0x37')]:_0x3ce1ad[_0x6057('0x31')];_0x5817b4['order']=qs['sort'](_0x2f19c2[_0x6057('0x32')]['sort']);_0x5817b4[_0x6057('0x3c')]=qs['filters'](_[_0x6057('0x3d')](_0x2f19c2[_0x6057('0x32')],_0x3ce1ad['filters']));if(_0x2f19c2[_0x6057('0x32')][_0x6057('0x3e')]){_0x5817b4[_0x6057('0x3c')]=_[_0x6057('0x3f')](_0x5817b4[_0x6057('0x3c')],{'$or':_['map'](_0x5817b4[_0x6057('0x37')],function(_0x4d94a1){var _0x5728a2={};_0x5728a2[_0x4d94a1]={'$like':'%'+_0x2f19c2[_0x6057('0x32')][_0x6057('0x3e')]+'%'};return _0x5728a2;})});}_0x5817b4=_[_0x6057('0x3f')]({},_0x5817b4,_0x2f19c2[_0x6057('0x41')]);return _0x33fe12[_0x6057('0x5c')](_0x5817b4);}})['then'](function(_0x58e7cd){if(_0x58e7cd){_0x3bb732=_0x58e7cd[_0x6057('0x38')];if(!_0x2f19c2[_0x6057('0x32')][_0x6057('0x39')](_0x6057('0x5b'))){_0x5817b4[_0x6057('0x1c')]=qs['limit'](_0x2f19c2['query'][_0x6057('0x1c')]);_0x5817b4['offset']=qs[_0x6057('0x1a')](_0x2f19c2[_0x6057('0x32')][_0x6057('0x1a')]);}return _0x33fe12[_0x6057('0x5c')](_0x5817b4);}})[_0x6057('0x25')](function(_0x2085ec){if(_0x2085ec){return _0x2085ec?{'count':_0x3bb732,'rows':_0x2085ec}:null;}})['then'](respondWithResult(_0x10d8b7,null))[_0x6057('0x46')](handleError(_0x10d8b7,null));};exports[_0x6057('0x5d')]=function(_0xe126f4,_0x10c01c,_0x4d16cb){if(_0xe126f4[_0x6057('0x53')]['id']){delete _0xe126f4['body']['id'];}return db[_0x6057('0x42')][_0x6057('0x4a')]({'where':{'id':_0xe126f4[_0x6057('0x48')]['id']}})[_0x6057('0x25')](handleEntityNotFound(_0x10c01c,null))[_0x6057('0x25')](function(_0x1924ef){if(_0x1924ef){_0xe126f4[_0x6057('0x53')][_0x6057('0x5e')]=_0x1924ef['id'];return db['Action'][_0x6057('0x4b')](_0xe126f4[_0x6057('0x53')]);}})['then'](respondWithResult(_0x10c01c,null))['catch'](handleError(_0x10c01c,null));};exports[_0x6057('0x5f')]=function(_0x509851,_0x525259,_0x3eb25e){var _0x340c8d={};var _0x3950e4={};var _0x1db1fb;var _0x4dcda7;return db[_0x6057('0x42')][_0x6057('0x5a')]({'where':{'id':_0x509851[_0x6057('0x48')]['id']}})[_0x6057('0x25')](handleEntityNotFound(_0x525259,null))['then'](function(_0x4e91dc){if(_0x4e91dc){_0x1db1fb=_0x4e91dc;_0x3950e4[_0x6057('0x31')]=_[_0x6057('0x33')](db[_0x6057('0x60')][_0x6057('0x2d')]);_0x3950e4[_0x6057('0x32')]=_[_0x6057('0x33')](_0x509851['query']);_0x3950e4[_0x6057('0x34')]=_[_0x6057('0x35')](_0x3950e4[_0x6057('0x31')],_0x3950e4['query']);_0x340c8d[_0x6057('0x37')]=_['intersection'](_0x3950e4['model'],qs[_0x6057('0x36')](_0x509851['query']['fields']));_0x340c8d['attributes']=_0x340c8d['attributes'][_0x6057('0x38')]?_0x340c8d[_0x6057('0x37')]:_0x3950e4[_0x6057('0x31')];_0x340c8d[_0x6057('0x3a')]=qs[_0x6057('0x3b')](_0x509851['query'][_0x6057('0x3b')]);_0x340c8d['where']=qs['filters'](_[_0x6057('0x3d')](_0x509851['query'],_0x3950e4[_0x6057('0x34')]));if(_0x509851['query'][_0x6057('0x3e')]){_0x340c8d[_0x6057('0x3c')]=_[_0x6057('0x3f')](_0x340c8d[_0x6057('0x3c')],{'$or':_[_0x6057('0x2c')](_0x340c8d[_0x6057('0x37')],function(_0x165c10){var _0x5186af={};_0x5186af[_0x165c10]={'$like':'%'+_0x509851[_0x6057('0x32')][_0x6057('0x3e')]+'%'};return _0x5186af;})});}_0x340c8d=_['merge']({},_0x340c8d,_0x509851[_0x6057('0x41')]);return _0x1db1fb[_0x6057('0x5f')](_0x340c8d);}})['then'](function(_0x304245){if(_0x304245){_0x4dcda7=_0x304245[_0x6057('0x38')];if(!_0x509851[_0x6057('0x32')][_0x6057('0x39')](_0x6057('0x5b'))){_0x340c8d['limit']=qs[_0x6057('0x1c')](_0x509851['query'][_0x6057('0x1c')]);_0x340c8d[_0x6057('0x1a')]=qs[_0x6057('0x1a')](_0x509851[_0x6057('0x32')][_0x6057('0x1a')]);}return _0x1db1fb[_0x6057('0x5f')](_0x340c8d);}})[_0x6057('0x25')](function(_0x398b35){if(_0x398b35){return _0x398b35?{'count':_0x4dcda7,'rows':_0x398b35}:null;}})[_0x6057('0x25')](respondWithResult(_0x525259,null))[_0x6057('0x46')](handleError(_0x525259,null));}; \ No newline at end of file +var _0xb56c=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','map','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Trigger','findAll','rows','catch','show','params','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','findOne','options','getAllConditions','rawAttributes','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format'];(function(_0x347862,_0x339566){var _0x2ec88b=function(_0x290bdc){while(--_0x290bdc){_0x347862['push'](_0x347862['shift']());}};_0x2ec88b(++_0x339566);}(_0xb56c,0x18b));var _0xcb56=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0xb56c[_0x119280];return _0x481797;};'use strict';var emlformat=require(_0xcb56('0x0'));var rimraf=require(_0xcb56('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb56('0x2'));var rp=require(_0xcb56('0x3'));var moment=require(_0xcb56('0x4'));var BPromise=require(_0xcb56('0x5'));var Mustache=require(_0xcb56('0x6'));var util=require(_0xcb56('0x7'));var path=require(_0xcb56('0x8'));var sox=require(_0xcb56('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb56('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb56('0xb'));var jsforce=require(_0xcb56('0xc'));var deskjs=require(_0xcb56('0xd'));var toCsv=require(_0xcb56('0xe'));var querystring=require(_0xcb56('0xf'));var Papa=require(_0xcb56('0x10'));var Redis=require(_0xcb56('0x11'));var authService=require(_0xcb56('0x12'));var qs=require(_0xcb56('0x13'));var as=require(_0xcb56('0x14'));var hardwareService=require(_0xcb56('0x15'));var logger=require(_0xcb56('0x16'))(_0xcb56('0x17'));var utils=require(_0xcb56('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcb56('0x19'));var db=require(_0xcb56('0x1a'))['db'];function respondWithStatusCode(_0x34768a,_0x5d38b8){_0x5d38b8=_0x5d38b8||0xcc;return function(_0x204c2e){if(_0x204c2e){return _0x34768a[_0xcb56('0x1b')](_0x5d38b8);}return _0x34768a[_0xcb56('0x1c')](_0x5d38b8)[_0xcb56('0x1d')]();};}function respondWithResult(_0x5af1c9,_0x4ea246){_0x4ea246=_0x4ea246||0xc8;return function(_0x4daee8){if(_0x4daee8){return _0x5af1c9[_0xcb56('0x1c')](_0x4ea246)['json'](_0x4daee8);}};}function respondWithFilteredResult(_0x402491,_0x44fedb){return function(_0x59fd86){if(_0x59fd86){var _0x78e4ad=typeof _0x44fedb[_0xcb56('0x1e')]===_0xcb56('0x1f')&&typeof _0x44fedb['limit']===_0xcb56('0x1f');var _0x233a5e=_0x59fd86[_0xcb56('0x20')];var _0x5f55f0=_0x78e4ad?0x0:_0x44fedb[_0xcb56('0x1e')];var _0x2c8f5d=_0x78e4ad?_0x59fd86[_0xcb56('0x20')]:_0x44fedb[_0xcb56('0x1e')]+_0x44fedb[_0xcb56('0x21')];var _0x5eedf4;if(_0x2c8f5d>=_0x233a5e){_0x2c8f5d=_0x233a5e;_0x5eedf4=0xc8;}else{_0x5eedf4=0xce;}_0x402491[_0xcb56('0x1c')](_0x5eedf4);return _0x402491[_0xcb56('0x22')](_0xcb56('0x23'),_0x5f55f0+'-'+_0x2c8f5d+'/'+_0x233a5e)[_0xcb56('0x24')](_0x59fd86);}return null;};}function patchUpdates(_0x251941){return function(_0x4518ba){try{jsonpatch[_0xcb56('0x25')](_0x4518ba,_0x251941,!![]);}catch(_0x247799){return BPromise[_0xcb56('0x26')](_0x247799);}return _0x4518ba['save']();};}function saveUpdates(_0x424930,_0x1675f9){return function(_0x3d6237){if(_0x3d6237){return _0x3d6237[_0xcb56('0x27')](_0x424930)[_0xcb56('0x28')](function(_0x3324f5){return _0x3324f5;});}return null;};}function removeEntity(_0x4e79a1,_0x5b04cf){return function(_0x29de6f){if(_0x29de6f){return _0x29de6f[_0xcb56('0x29')]()[_0xcb56('0x28')](function(){var _0x41eada=_0x29de6f[_0xcb56('0x2a')]({'plain':!![]});var _0x48655c=_0xcb56('0x2b');return db[_0xcb56('0x2c')][_0xcb56('0x29')]({'where':{'type':_0x48655c,'resourceId':_0x41eada['id']}})[_0xcb56('0x28')](function(){return _0x29de6f;});})[_0xcb56('0x28')](function(){_0x4e79a1['status'](0xcc)[_0xcb56('0x1d')]();});}};}function handleEntityNotFound(_0x504955,_0x103b12){return function(_0x281b8c){if(!_0x281b8c){_0x504955[_0xcb56('0x1b')](0x194);}return _0x281b8c;};}function handleError(_0x40d5e7,_0xfadf99){_0xfadf99=_0xfadf99||0x1f4;return function(_0x4b572a){logger[_0xcb56('0x2d')](_0x4b572a[_0xcb56('0x2e')]);if(_0x4b572a[_0xcb56('0x2f')]){delete _0x4b572a[_0xcb56('0x2f')];}_0x40d5e7[_0xcb56('0x1c')](_0xfadf99)['send'](_0x4b572a);};}exports['index']=function(_0xe22b79,_0x300ae3){var _0x1efce3={},_0x381e8e={},_0x440be9={'count':0x0,'rows':[]};var _0x5652d6=_[_0xcb56('0x30')](db['Trigger']['rawAttributes'],function(_0x2b17c7){return{'name':_0x2b17c7[_0xcb56('0x31')],'type':_0x2b17c7[_0xcb56('0x32')][_0xcb56('0x33')]};});_0x381e8e['model']=_[_0xcb56('0x30')](_0x5652d6,'name');_0x381e8e['query']=_[_0xcb56('0x34')](_0xe22b79[_0xcb56('0x35')]);_0x381e8e[_0xcb56('0x36')]=_[_0xcb56('0x37')](_0x381e8e[_0xcb56('0x38')],_0x381e8e[_0xcb56('0x35')]);_0x1efce3['attributes']=_[_0xcb56('0x37')](_0x381e8e[_0xcb56('0x38')],qs['fields'](_0xe22b79[_0xcb56('0x35')][_0xcb56('0x39')]));_0x1efce3[_0xcb56('0x3a')]=_0x1efce3[_0xcb56('0x3a')][_0xcb56('0x3b')]?_0x1efce3['attributes']:_0x381e8e[_0xcb56('0x38')];if(!_0xe22b79[_0xcb56('0x35')][_0xcb56('0x3c')](_0xcb56('0x3d'))){_0x1efce3[_0xcb56('0x21')]=qs[_0xcb56('0x21')](_0xe22b79[_0xcb56('0x35')][_0xcb56('0x21')]);_0x1efce3['offset']=qs[_0xcb56('0x1e')](_0xe22b79[_0xcb56('0x35')][_0xcb56('0x1e')]);}_0x1efce3[_0xcb56('0x3e')]=qs[_0xcb56('0x3f')](_0xe22b79['query'][_0xcb56('0x3f')]);_0x1efce3[_0xcb56('0x40')]=qs[_0xcb56('0x36')](_[_0xcb56('0x41')](_0xe22b79[_0xcb56('0x35')],_0x381e8e[_0xcb56('0x36')]),_0x5652d6);if(_0xe22b79['query'][_0xcb56('0x42')]){_0x1efce3[_0xcb56('0x40')]=_[_0xcb56('0x43')](_0x1efce3[_0xcb56('0x40')],{'$or':_[_0xcb56('0x30')](_0x5652d6,function(_0x387bad){if(_0x387bad[_0xcb56('0x32')]!==_0xcb56('0x44')){var _0x16f12f={};_0x16f12f[_0x387bad[_0xcb56('0x2f')]]={'$like':'%'+_0xe22b79['query'][_0xcb56('0x42')]+'%'};return _0x16f12f;}})});}_0x1efce3=_[_0xcb56('0x43')]({},_0x1efce3,_0xe22b79['options']);var _0x3eee2b={'where':_0x1efce3[_0xcb56('0x40')]};return db[_0xcb56('0x45')][_0xcb56('0x20')](_0x3eee2b)['then'](function(_0x568735){_0x440be9[_0xcb56('0x20')]=_0x568735;if(_0xe22b79[_0xcb56('0x35')]['includeAll']){_0x1efce3['include']=[{'all':!![]}];}return db['Trigger'][_0xcb56('0x46')](_0x1efce3);})[_0xcb56('0x28')](function(_0x5a10b6){_0x440be9[_0xcb56('0x47')]=_0x5a10b6;return _0x440be9;})['then'](respondWithFilteredResult(_0x300ae3,_0x1efce3))[_0xcb56('0x48')](handleError(_0x300ae3,null));};exports[_0xcb56('0x49')]=function(_0xa81008,_0x17912c){var _0x2f5daa={'raw':![],'where':{'id':_0xa81008[_0xcb56('0x4a')]['id']}},_0x21b479={};_0x21b479[_0xcb56('0x38')]=_[_0xcb56('0x34')](db[_0xcb56('0x45')]['rawAttributes']);_0x21b479[_0xcb56('0x35')]=_[_0xcb56('0x34')](_0xa81008['query']);_0x21b479['filters']=_[_0xcb56('0x37')](_0x21b479['model'],_0x21b479['query']);_0x2f5daa['attributes']=_['intersection'](_0x21b479['model'],qs[_0xcb56('0x39')](_0xa81008[_0xcb56('0x35')]['fields']));_0x2f5daa[_0xcb56('0x3a')]=_0x2f5daa[_0xcb56('0x3a')][_0xcb56('0x3b')]?_0x2f5daa[_0xcb56('0x3a')]:_0x21b479[_0xcb56('0x38')];if(_0xa81008[_0xcb56('0x35')][_0xcb56('0x4b')]){_0x2f5daa[_0xcb56('0x4c')]=[{'all':!![]}];}_0x2f5daa=_[_0xcb56('0x43')]({},_0x2f5daa,_0xa81008['options']);return db[_0xcb56('0x45')]['find'](_0x2f5daa)[_0xcb56('0x28')](handleEntityNotFound(_0x17912c,null))[_0xcb56('0x28')](respondWithResult(_0x17912c,null))[_0xcb56('0x48')](handleError(_0x17912c,null));};exports[_0xcb56('0x4d')]=function(_0x229b9f,_0x49494c){return db[_0xcb56('0x45')]['create'](_0x229b9f['body'],{})[_0xcb56('0x28')](function(_0x228faf){var _0x20057b=_0x229b9f[_0xcb56('0x4e')][_0xcb56('0x2a')]({'plain':!![]});if(!_0x20057b)throw new Error(_0xcb56('0x4f'));if(_0x20057b[_0xcb56('0x50')]===_0xcb56('0x4e')){var _0x43dff5=_0x228faf[_0xcb56('0x2a')]({'plain':!![]});var _0x567a5b=_0xcb56('0x2b');return db[_0xcb56('0x51')][_0xcb56('0x52')]({'where':{'name':_0x567a5b,'userProfileId':_0x20057b[_0xcb56('0x53')]},'raw':!![]})[_0xcb56('0x28')](function(_0x47935b){if(_0x47935b&&_0x47935b[_0xcb56('0x54')]===0x0){return db[_0xcb56('0x2c')]['create']({'name':_0x43dff5['name'],'resourceId':_0x43dff5['id'],'type':_0x47935b['name'],'sectionId':_0x47935b['id']},{})[_0xcb56('0x28')](function(){return _0x228faf;});}else{return _0x228faf;}})[_0xcb56('0x48')](function(_0x263a24){logger['error'](_0xcb56('0x55'),_0x263a24);throw _0x263a24;});}return _0x228faf;})[_0xcb56('0x28')](respondWithResult(_0x49494c,0xc9))[_0xcb56('0x48')](handleError(_0x49494c,null));};exports[_0xcb56('0x27')]=function(_0x3436af,_0x27caf4){if(_0x3436af[_0xcb56('0x56')]['id']){delete _0x3436af[_0xcb56('0x56')]['id'];}return db[_0xcb56('0x45')][_0xcb56('0x52')]({'where':{'id':_0x3436af['params']['id']}})[_0xcb56('0x28')](handleEntityNotFound(_0x27caf4,null))['then'](saveUpdates(_0x3436af[_0xcb56('0x56')],null))[_0xcb56('0x28')](respondWithResult(_0x27caf4,null))[_0xcb56('0x48')](handleError(_0x27caf4,null));};exports['destroy']=function(_0x407233,_0x3b6c16){return db[_0xcb56('0x45')]['find']({'where':{'id':_0x407233[_0xcb56('0x4a')]['id']}})[_0xcb56('0x28')](handleEntityNotFound(_0x3b6c16,null))['then'](removeEntity(_0x3b6c16,null))[_0xcb56('0x48')](handleError(_0x3b6c16,null));};exports[_0xcb56('0x57')]=function(_0x5d0a38,_0xa71eac,_0x8c5cbf){if(_0x5d0a38[_0xcb56('0x56')]['id']){delete _0x5d0a38[_0xcb56('0x56')]['id'];}return db[_0xcb56('0x45')][_0xcb56('0x52')]({'where':{'id':_0x5d0a38[_0xcb56('0x4a')]['id']}})[_0xcb56('0x28')](handleEntityNotFound(_0xa71eac,null))[_0xcb56('0x28')](function(_0x524474){if(_0x524474){_0x5d0a38['body'][_0xcb56('0x58')]=_0x524474['id'];return db[_0xcb56('0x59')][_0xcb56('0x4d')](_0x5d0a38[_0xcb56('0x56')]);}})[_0xcb56('0x28')](respondWithResult(_0xa71eac,null))['catch'](handleError(_0xa71eac,null));};exports['addAnyCondition']=function(_0x199f37,_0x206ed3,_0x384bdd){if(_0x199f37[_0xcb56('0x56')]['id']){delete _0x199f37[_0xcb56('0x56')]['id'];}return db[_0xcb56('0x45')]['find']({'where':{'id':_0x199f37[_0xcb56('0x4a')]['id']}})['then'](handleEntityNotFound(_0x206ed3,null))[_0xcb56('0x28')](function(_0x1f1798){if(_0x1f1798){_0x199f37[_0xcb56('0x56')]['TriggerAnyId']=_0x1f1798['id'];return db['Condition'][_0xcb56('0x4d')](_0x199f37[_0xcb56('0x56')]);}})[_0xcb56('0x28')](respondWithResult(_0x206ed3,null))[_0xcb56('0x48')](handleError(_0x206ed3,null));};exports['getAllConditions']=function(_0x4404b1,_0x44cd94,_0x25a234){var _0x27306a={};var _0x48e580={};var _0x4486c9;var _0x439679;return db[_0xcb56('0x45')][_0xcb56('0x5a')]({'where':{'id':_0x4404b1[_0xcb56('0x4a')]['id']}})[_0xcb56('0x28')](handleEntityNotFound(_0x44cd94,null))[_0xcb56('0x28')](function(_0x3a5cb9){if(_0x3a5cb9){_0x4486c9=_0x3a5cb9;_0x48e580[_0xcb56('0x38')]=_[_0xcb56('0x34')](db['Condition']['rawAttributes']);_0x48e580['query']=_[_0xcb56('0x34')](_0x4404b1[_0xcb56('0x35')]);_0x48e580[_0xcb56('0x36')]=_[_0xcb56('0x37')](_0x48e580[_0xcb56('0x38')],_0x48e580[_0xcb56('0x35')]);_0x27306a['attributes']=_[_0xcb56('0x37')](_0x48e580[_0xcb56('0x38')],qs[_0xcb56('0x39')](_0x4404b1[_0xcb56('0x35')][_0xcb56('0x39')]));_0x27306a[_0xcb56('0x3a')]=_0x27306a[_0xcb56('0x3a')][_0xcb56('0x3b')]?_0x27306a['attributes']:_0x48e580['model'];_0x27306a['order']=qs[_0xcb56('0x3f')](_0x4404b1[_0xcb56('0x35')]['sort']);_0x27306a[_0xcb56('0x40')]=qs[_0xcb56('0x36')](_[_0xcb56('0x41')](_0x4404b1[_0xcb56('0x35')],_0x48e580[_0xcb56('0x36')]));if(_0x4404b1[_0xcb56('0x35')][_0xcb56('0x42')]){_0x27306a[_0xcb56('0x40')]=_['merge'](_0x27306a[_0xcb56('0x40')],{'$or':_['map'](_0x27306a[_0xcb56('0x3a')],function(_0x2fa01c){var _0x5e70a1={};_0x5e70a1[_0x2fa01c]={'$like':'%'+_0x4404b1[_0xcb56('0x35')][_0xcb56('0x42')]+'%'};return _0x5e70a1;})});}_0x27306a=_[_0xcb56('0x43')]({},_0x27306a,_0x4404b1[_0xcb56('0x5b')]);return _0x4486c9[_0xcb56('0x5c')](_0x27306a);}})['then'](function(_0x4ecb10){if(_0x4ecb10){_0x439679=_0x4ecb10['length'];if(!_0x4404b1[_0xcb56('0x35')][_0xcb56('0x3c')]('nolimit')){_0x27306a[_0xcb56('0x21')]=qs['limit'](_0x4404b1['query'][_0xcb56('0x21')]);_0x27306a['offset']=qs[_0xcb56('0x1e')](_0x4404b1[_0xcb56('0x35')][_0xcb56('0x1e')]);}return _0x4486c9[_0xcb56('0x5c')](_0x27306a);}})[_0xcb56('0x28')](function(_0x4c20b0){if(_0x4c20b0){return _0x4c20b0?{'count':_0x439679,'rows':_0x4c20b0}:null;}})[_0xcb56('0x28')](respondWithResult(_0x44cd94,null))['catch'](handleError(_0x44cd94,null));};exports['getAnyConditions']=function(_0x75ba52,_0x32c6ed,_0x29f8b3){var _0xcc96d7={};var _0x4014db={};var _0x1482a4;var _0x537633;return db[_0xcb56('0x45')][_0xcb56('0x5a')]({'where':{'id':_0x75ba52[_0xcb56('0x4a')]['id']}})[_0xcb56('0x28')](handleEntityNotFound(_0x32c6ed,null))[_0xcb56('0x28')](function(_0x2c92b8){if(_0x2c92b8){_0x1482a4=_0x2c92b8;_0x4014db[_0xcb56('0x38')]=_[_0xcb56('0x34')](db[_0xcb56('0x59')][_0xcb56('0x5d')]);_0x4014db[_0xcb56('0x35')]=_[_0xcb56('0x34')](_0x75ba52[_0xcb56('0x35')]);_0x4014db[_0xcb56('0x36')]=_['intersection'](_0x4014db[_0xcb56('0x38')],_0x4014db['query']);_0xcc96d7[_0xcb56('0x3a')]=_['intersection'](_0x4014db['model'],qs[_0xcb56('0x39')](_0x75ba52[_0xcb56('0x35')]['fields']));_0xcc96d7['attributes']=_0xcc96d7['attributes'][_0xcb56('0x3b')]?_0xcc96d7[_0xcb56('0x3a')]:_0x4014db[_0xcb56('0x38')];_0xcc96d7[_0xcb56('0x3e')]=qs[_0xcb56('0x3f')](_0x75ba52['query'][_0xcb56('0x3f')]);_0xcc96d7[_0xcb56('0x40')]=qs[_0xcb56('0x36')](_[_0xcb56('0x41')](_0x75ba52[_0xcb56('0x35')],_0x4014db[_0xcb56('0x36')]));if(_0x75ba52[_0xcb56('0x35')]['filter']){_0xcc96d7['where']=_['merge'](_0xcc96d7[_0xcb56('0x40')],{'$or':_['map'](_0xcc96d7[_0xcb56('0x3a')],function(_0x17b767){var _0x7fb64a={};_0x7fb64a[_0x17b767]={'$like':'%'+_0x75ba52[_0xcb56('0x35')][_0xcb56('0x42')]+'%'};return _0x7fb64a;})});}_0xcc96d7=_[_0xcb56('0x43')]({},_0xcc96d7,_0x75ba52[_0xcb56('0x5b')]);return _0x1482a4[_0xcb56('0x5e')](_0xcc96d7);}})[_0xcb56('0x28')](function(_0x526742){if(_0x526742){_0x537633=_0x526742[_0xcb56('0x3b')];if(!_0x75ba52[_0xcb56('0x35')][_0xcb56('0x3c')]('nolimit')){_0xcc96d7[_0xcb56('0x21')]=qs[_0xcb56('0x21')](_0x75ba52[_0xcb56('0x35')]['limit']);_0xcc96d7[_0xcb56('0x1e')]=qs[_0xcb56('0x1e')](_0x75ba52[_0xcb56('0x35')][_0xcb56('0x1e')]);}return _0x1482a4[_0xcb56('0x5e')](_0xcc96d7);}})['then'](function(_0x201235){if(_0x201235){return _0x201235?{'count':_0x537633,'rows':_0x201235}:null;}})[_0xcb56('0x28')](respondWithResult(_0x32c6ed,null))['catch'](handleError(_0x32c6ed,null));};exports[_0xcb56('0x5f')]=function(_0x359038,_0x4703e2,_0x392d40){if(_0x359038[_0xcb56('0x56')]['id']){delete _0x359038[_0xcb56('0x56')]['id'];}return db[_0xcb56('0x45')][_0xcb56('0x52')]({'where':{'id':_0x359038[_0xcb56('0x4a')]['id']}})[_0xcb56('0x28')](handleEntityNotFound(_0x4703e2,null))[_0xcb56('0x28')](function(_0x21e87f){if(_0x21e87f){_0x359038[_0xcb56('0x56')][_0xcb56('0x60')]=_0x21e87f['id'];return db[_0xcb56('0x61')][_0xcb56('0x4d')](_0x359038[_0xcb56('0x56')]);}})['then'](respondWithResult(_0x4703e2,null))[_0xcb56('0x48')](handleError(_0x4703e2,null));};exports['getActions']=function(_0x3d93c2,_0x4752bd,_0x45ba50){var _0x4f0fb4={};var _0x167141={};var _0x4f1527;var _0x455f10;return db[_0xcb56('0x45')]['findOne']({'where':{'id':_0x3d93c2[_0xcb56('0x4a')]['id']}})[_0xcb56('0x28')](handleEntityNotFound(_0x4752bd,null))[_0xcb56('0x28')](function(_0x7b3dbb){if(_0x7b3dbb){_0x4f1527=_0x7b3dbb;_0x167141[_0xcb56('0x38')]=_[_0xcb56('0x34')](db[_0xcb56('0x61')][_0xcb56('0x5d')]);_0x167141[_0xcb56('0x35')]=_[_0xcb56('0x34')](_0x3d93c2['query']);_0x167141[_0xcb56('0x36')]=_[_0xcb56('0x37')](_0x167141[_0xcb56('0x38')],_0x167141[_0xcb56('0x35')]);_0x4f0fb4[_0xcb56('0x3a')]=_[_0xcb56('0x37')](_0x167141[_0xcb56('0x38')],qs[_0xcb56('0x39')](_0x3d93c2[_0xcb56('0x35')][_0xcb56('0x39')]));_0x4f0fb4[_0xcb56('0x3a')]=_0x4f0fb4['attributes']['length']?_0x4f0fb4[_0xcb56('0x3a')]:_0x167141['model'];_0x4f0fb4[_0xcb56('0x3e')]=qs[_0xcb56('0x3f')](_0x3d93c2['query'][_0xcb56('0x3f')]);_0x4f0fb4['where']=qs[_0xcb56('0x36')](_[_0xcb56('0x41')](_0x3d93c2[_0xcb56('0x35')],_0x167141[_0xcb56('0x36')]));if(_0x3d93c2[_0xcb56('0x35')][_0xcb56('0x42')]){_0x4f0fb4['where']=_[_0xcb56('0x43')](_0x4f0fb4[_0xcb56('0x40')],{'$or':_[_0xcb56('0x30')](_0x4f0fb4['attributes'],function(_0x981e88){var _0x4a7041={};_0x4a7041[_0x981e88]={'$like':'%'+_0x3d93c2[_0xcb56('0x35')][_0xcb56('0x42')]+'%'};return _0x4a7041;})});}_0x4f0fb4=_[_0xcb56('0x43')]({},_0x4f0fb4,_0x3d93c2[_0xcb56('0x5b')]);return _0x4f1527['getActions'](_0x4f0fb4);}})[_0xcb56('0x28')](function(_0x39ce6f){if(_0x39ce6f){_0x455f10=_0x39ce6f[_0xcb56('0x3b')];if(!_0x3d93c2[_0xcb56('0x35')]['hasOwnProperty'](_0xcb56('0x3d'))){_0x4f0fb4[_0xcb56('0x21')]=qs[_0xcb56('0x21')](_0x3d93c2[_0xcb56('0x35')][_0xcb56('0x21')]);_0x4f0fb4['offset']=qs[_0xcb56('0x1e')](_0x3d93c2[_0xcb56('0x35')][_0xcb56('0x1e')]);}return _0x4f1527[_0xcb56('0x62')](_0x4f0fb4);}})[_0xcb56('0x28')](function(_0x9e93ee){if(_0x9e93ee){return _0x9e93ee?{'count':_0x455f10,'rows':_0x9e93ee}:null;}})['then'](respondWithResult(_0x4752bd,null))[_0xcb56('0x48')](handleError(_0x4752bd,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f848568..f2d1f17 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(_0x3a5455,_0x7c9dc3){var _0x4f561f=function(_0xa17827){while(--_0xa17827){_0x3a5455['push'](_0x3a5455['shift']());}};_0x4f561f(++_0x7c9dc3);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xeb5d[_0x57b54c];return _0x59cc19;};'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 _0x62da=['moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','../../config/logger','api'];(function(_0x4b1643,_0x270da2){var _0x412a67=function(_0xb36e99){while(--_0xb36e99){_0x4b1643['push'](_0x4b1643['shift']());}};_0x412a67(++_0x270da2);}(_0x62da,0xc0));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa62d('0x0'));var util=require('util');var logger=require(_0xa62d('0x1'))(_0xa62d('0x2'));var moment=require(_0xa62d('0x3'));var BPromise=require(_0xa62d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa62d('0x5'));var rimraf=require(_0xa62d('0x6'));var config=require(_0xa62d('0x7'));var attributes=require(_0xa62d('0x8'));module[_0xa62d('0x9')]=function(_0x46f662,_0xab1efb){return _0x46f662[_0xa62d('0xa')](_0xa62d('0xb'),attributes,{'tableName':_0xa62d('0xc'),'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 3cc06e9..459f6eb 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 _0x2d3f=['request\x20sent','error','code','message','info','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrigger','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s'];(function(_0x5a1897,_0x207b70){var _0x119caf=function(_0x14b211){while(--_0x14b211){_0x5a1897['push'](_0x5a1897['shift']());}};_0x119caf(++_0x207b70);}(_0x2d3f,0x13c));var _0xf2d3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2d3f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf2d3('0x0'));var util=require(_0xf2d3('0x1'));var moment=require(_0xf2d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2d3('0x4'))['db'];var utils=require(_0xf2d3('0x5'));var logger=require(_0xf2d3('0x6'))(_0xf2d3('0x7'));var config=require(_0xf2d3('0x8'));var jayson=require(_0xf2d3('0x9'));var client=jayson[_0xf2d3('0xa')][_0xf2d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f7a94,_0x2c75eb,_0x30361d){return new BPromise(function(_0x327952,_0x5d810b){return client[_0xf2d3('0xc')](_0x3f7a94,_0x30361d)[_0xf2d3('0xd')](function(_0x197aa9){logger['info'](_0xf2d3('0xe'),_0x2c75eb,'request\x20sent');logger[_0xf2d3('0xf')](_0xf2d3('0x10'),_0x2c75eb,_0xf2d3('0x11'),JSON['stringify'](_0x197aa9));if(_0x197aa9[_0xf2d3('0x12')]){if(_0x197aa9['error'][_0xf2d3('0x13')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x2c75eb,_0x197aa9[_0xf2d3('0x12')][_0xf2d3('0x14')]);return _0x5d810b(_0x197aa9[_0xf2d3('0x12')]['message']);}logger[_0xf2d3('0x12')](_0xf2d3('0xe'),_0x2c75eb,_0x197aa9[_0xf2d3('0x12')][_0xf2d3('0x14')]);return _0x327952(_0x197aa9['error']['message']);}else{logger[_0xf2d3('0x15')]('Trigger,\x20%s,\x20%s',_0x2c75eb,'request\x20sent');_0x327952(_0x197aa9[_0xf2d3('0x16')][_0xf2d3('0x14')]);}})['catch'](function(_0x338829){logger['error'](_0xf2d3('0xe'),_0x2c75eb,_0x338829);_0x5d810b(_0x338829);});});}exports[_0xf2d3('0x17')]=function(_0x1e3366){var _0x1b8885=this;return new Promise(function(_0x22c4d0,_0x180ef1){return db[_0xf2d3('0x18')][_0xf2d3('0x19')]({'raw':_0x1e3366['options']?_0x1e3366[_0xf2d3('0x1a')][_0xf2d3('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e3366[_0xf2d3('0x1a')]?_0x1e3366[_0xf2d3('0x1a')][_0xf2d3('0x1c')]||null:null,'attributes':_0x1e3366[_0xf2d3('0x1a')]?_0x1e3366[_0xf2d3('0x1a')][_0xf2d3('0x1d')]||null:null,'limit':_0x1e3366[_0xf2d3('0x1a')]?_0x1e3366[_0xf2d3('0x1a')][_0xf2d3('0x1e')]||null:null,'include':_0x1e3366[_0xf2d3('0x1a')]?_0x1e3366['options'][_0xf2d3('0x1f')]?_[_0xf2d3('0x20')](_0x1e3366[_0xf2d3('0x1a')]['include'],function(_0x5b369d){return{'model':db[_0x5b369d[_0xf2d3('0x21')]],'as':_0x5b369d['as'],'attributes':_0x5b369d[_0xf2d3('0x1d')],'include':_0x5b369d['include']?_[_0xf2d3('0x20')](_0x5b369d[_0xf2d3('0x1f')],function(_0x568acf){return{'model':db[_0x568acf[_0xf2d3('0x21')]],'as':_0x568acf['as'],'attributes':_0x568acf[_0xf2d3('0x1d')],'include':_0x568acf[_0xf2d3('0x1f')]?_[_0xf2d3('0x20')](_0x568acf['include'],function(_0x14ec22){return{'model':db[_0x14ec22[_0xf2d3('0x21')]],'as':_0x14ec22['as'],'attributes':_0x14ec22['attributes']};}):[]};}):[]};}):[]:[]})[_0xf2d3('0xd')](function(_0x3e4fde){logger[_0xf2d3('0x15')](_0xf2d3('0x17'),_0x1e3366);logger[_0xf2d3('0xf')]('GetTrigger',_0x1e3366,JSON[_0xf2d3('0x22')](_0x3e4fde));_0x22c4d0(_0x3e4fde);})['catch'](function(_0x2b5605){logger['error'](_0xf2d3('0x17'),_0x2b5605[_0xf2d3('0x14')],_0x1e3366);_0x180ef1(_0x1b8885[_0xf2d3('0x12')](0x1f4,_0x2b5605[_0xf2d3('0x14')]));});});};exports['ShowTrigger']=function(_0x2ca7c0){var _0x551292=this;return new Promise(function(_0x2c5548,_0xe5725c){return db[_0xf2d3('0x18')]['find']({'raw':_0x2ca7c0['options']?_0x2ca7c0['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ca7c0[_0xf2d3('0x1a')]?_0x2ca7c0['options'][_0xf2d3('0x1c')]||null:null,'attributes':_0x2ca7c0[_0xf2d3('0x1a')]?_0x2ca7c0['options'][_0xf2d3('0x1d')]||null:null,'include':_0x2ca7c0['options']?_0x2ca7c0['options']['include']?_[_0xf2d3('0x20')](_0x2ca7c0[_0xf2d3('0x1a')][_0xf2d3('0x1f')],function(_0x37d672){return{'model':db[_0x37d672[_0xf2d3('0x21')]],'as':_0x37d672['as'],'attributes':_0x37d672[_0xf2d3('0x1d')],'include':_0x37d672[_0xf2d3('0x1f')]?_[_0xf2d3('0x20')](_0x37d672[_0xf2d3('0x1f')],function(_0x2da592){return{'model':db[_0x2da592[_0xf2d3('0x21')]],'as':_0x2da592['as'],'attributes':_0x2da592[_0xf2d3('0x1d')],'include':_0x2da592['include']?_['map'](_0x2da592[_0xf2d3('0x1f')],function(_0x5f816b){return{'model':db[_0x5f816b[_0xf2d3('0x21')]],'as':_0x5f816b['as'],'attributes':_0x5f816b[_0xf2d3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x428fad){logger[_0xf2d3('0x15')](_0xf2d3('0x23'),_0x2ca7c0);logger[_0xf2d3('0xf')](_0xf2d3('0x23'),_0x2ca7c0,JSON['stringify'](_0x428fad));_0x2c5548(_0x428fad);})[_0xf2d3('0x24')](function(_0x5e229c){logger['error']('ShowTrigger',_0x5e229c['message'],_0x2ca7c0);_0xe5725c(_0x551292[_0xf2d3('0x12')](0x1f4,_0x5e229c['message']));});});}; \ No newline at end of file +var _0x9af2=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','include','map','model','ShowTrigger'];(function(_0x340756,_0xad31ae){var _0x2ef745=function(_0x59ffde){while(--_0x59ffde){_0x340756['push'](_0x340756['shift']());}};_0x2ef745(++_0xad31ae);}(_0x9af2,0x84));var _0x29af=function(_0x4fe2c6,_0x27be92){_0x4fe2c6=_0x4fe2c6-0x0;var _0x5c574a=_0x9af2[_0x4fe2c6];return _0x5c574a;};'use strict';var _=require(_0x29af('0x0'));var util=require(_0x29af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29af('0x2'));var fs=require('fs');var Redis=require(_0x29af('0x3'));var db=require(_0x29af('0x4'))['db'];var utils=require(_0x29af('0x5'));var logger=require(_0x29af('0x6'))('rpc');var config=require(_0x29af('0x7'));var jayson=require(_0x29af('0x8'));var client=jayson[_0x29af('0x9')][_0x29af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa2c6d8,_0x5c3d25,_0x1a6a6c){return new BPromise(function(_0x266d9,_0x51c6f1){return client[_0x29af('0xb')](_0xa2c6d8,_0x1a6a6c)[_0x29af('0xc')](function(_0x3bd8d4){logger[_0x29af('0xd')](_0x29af('0xe'),_0x5c3d25,'request\x20sent');logger[_0x29af('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x5c3d25,'request\x20sent',JSON[_0x29af('0x10')](_0x3bd8d4));if(_0x3bd8d4['error']){if(_0x3bd8d4[_0x29af('0x11')]['code']===0x1f4){logger[_0x29af('0x11')]('Trigger,\x20%s,\x20%s',_0x5c3d25,_0x3bd8d4['error'][_0x29af('0x12')]);return _0x51c6f1(_0x3bd8d4[_0x29af('0x11')][_0x29af('0x12')]);}logger[_0x29af('0x11')]('Trigger,\x20%s,\x20%s',_0x5c3d25,_0x3bd8d4[_0x29af('0x11')]['message']);return _0x266d9(_0x3bd8d4[_0x29af('0x11')]['message']);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x5c3d25,_0x29af('0x13'));_0x266d9(_0x3bd8d4[_0x29af('0x14')][_0x29af('0x12')]);}})[_0x29af('0x15')](function(_0x47a347){logger[_0x29af('0x11')](_0x29af('0xe'),_0x5c3d25,_0x47a347);_0x51c6f1(_0x47a347);});});}exports[_0x29af('0x16')]=function(_0x1d712e){var _0x23dd6e=this;return new Promise(function(_0x5815b4,_0x1a3894){return db[_0x29af('0x17')][_0x29af('0x18')]({'raw':_0x1d712e[_0x29af('0x19')]?_0x1d712e[_0x29af('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1d712e[_0x29af('0x19')]?_0x1d712e[_0x29af('0x19')][_0x29af('0x1a')]||null:null,'attributes':_0x1d712e['options']?_0x1d712e[_0x29af('0x19')][_0x29af('0x1b')]||null:null,'limit':_0x1d712e['options']?_0x1d712e['options'][_0x29af('0x1c')]||null:null,'include':_0x1d712e['options']?_0x1d712e[_0x29af('0x19')][_0x29af('0x1d')]?_[_0x29af('0x1e')](_0x1d712e[_0x29af('0x19')]['include'],function(_0x62f089){return{'model':db[_0x62f089[_0x29af('0x1f')]],'as':_0x62f089['as'],'attributes':_0x62f089['attributes'],'include':_0x62f089[_0x29af('0x1d')]?_['map'](_0x62f089[_0x29af('0x1d')],function(_0x11c65f){return{'model':db[_0x11c65f[_0x29af('0x1f')]],'as':_0x11c65f['as'],'attributes':_0x11c65f[_0x29af('0x1b')],'include':_0x11c65f['include']?_[_0x29af('0x1e')](_0x11c65f['include'],function(_0x3b64e7){return{'model':db[_0x3b64e7[_0x29af('0x1f')]],'as':_0x3b64e7['as'],'attributes':_0x3b64e7[_0x29af('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x29af('0xc')](function(_0x29bffd){logger['info'](_0x29af('0x16'),_0x1d712e);logger[_0x29af('0xf')](_0x29af('0x16'),_0x1d712e,JSON[_0x29af('0x10')](_0x29bffd));_0x5815b4(_0x29bffd);})[_0x29af('0x15')](function(_0x475fe5){logger[_0x29af('0x11')](_0x29af('0x16'),_0x475fe5['message'],_0x1d712e);_0x1a3894(_0x23dd6e['error'](0x1f4,_0x475fe5['message']));});});};exports[_0x29af('0x20')]=function(_0x27f793){var _0xdd68ee=this;return new Promise(function(_0x582368,_0x466dea){return db[_0x29af('0x17')]['find']({'raw':_0x27f793[_0x29af('0x19')]?_0x27f793[_0x29af('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x27f793['options']?_0x27f793[_0x29af('0x19')][_0x29af('0x1a')]||null:null,'attributes':_0x27f793[_0x29af('0x19')]?_0x27f793['options']['attributes']||null:null,'include':_0x27f793[_0x29af('0x19')]?_0x27f793[_0x29af('0x19')]['include']?_[_0x29af('0x1e')](_0x27f793['options'][_0x29af('0x1d')],function(_0x1b246f){return{'model':db[_0x1b246f[_0x29af('0x1f')]],'as':_0x1b246f['as'],'attributes':_0x1b246f['attributes'],'include':_0x1b246f['include']?_[_0x29af('0x1e')](_0x1b246f['include'],function(_0x38dbc9){return{'model':db[_0x38dbc9['model']],'as':_0x38dbc9['as'],'attributes':_0x38dbc9['attributes'],'include':_0x38dbc9[_0x29af('0x1d')]?_[_0x29af('0x1e')](_0x38dbc9[_0x29af('0x1d')],function(_0x3d9400){return{'model':db[_0x3d9400[_0x29af('0x1f')]],'as':_0x3d9400['as'],'attributes':_0x3d9400[_0x29af('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x29af('0xc')](function(_0x3aeb38){logger['info'](_0x29af('0x20'),_0x27f793);logger[_0x29af('0xf')](_0x29af('0x20'),_0x27f793,JSON[_0x29af('0x10')](_0x3aeb38));_0x582368(_0x3aeb38);})[_0x29af('0x15')](function(_0x28a4af){logger[_0x29af('0x11')]('ShowTrigger',_0x28a4af[_0x29af('0x12')],_0x27f793);_0x466dea(_0xdd68ee[_0x29af('0x11')](0x1f4,_0x28a4af[_0x29af('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ffc6b4f..230201a 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 _0xde7d=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','post','isAuthenticated','clone','create','/:id','update','delete'];(function(_0x196f76,_0x22cafb){var _0x13ca7d=function(_0x31ca29){while(--_0x31ca29){_0x196f76['push'](_0x196f76['shift']());}};_0x13ca7d(++_0x22cafb);}(_0xde7d,0x140));var _0xdde7=function(_0x503bb9,_0x36802c){_0x503bb9=_0x503bb9-0x0;var _0x50c7e0=_0xde7d[_0x503bb9];return _0x50c7e0;};'use strict';var multer=require(_0xdde7('0x0'));var util=require('util');var path=require(_0xdde7('0x1'));var timeout=require(_0xdde7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdde7('0x3'));var auth=require(_0xdde7('0x4'));var interaction=require(_0xdde7('0x5'));var config=require(_0xdde7('0x6'));var controller=require(_0xdde7('0x7'));router[_0xdde7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdde7('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdde7('0x9')]('/:id/clone',auth[_0xdde7('0xa')](),controller[_0xdde7('0xb')]);router[_0xdde7('0x9')]('/',auth[_0xdde7('0xa')](),controller[_0xdde7('0xc')]);router['put'](_0xdde7('0xd'),auth[_0xdde7('0xa')](),controller[_0xdde7('0xe')]);router[_0xdde7('0xf')](_0xdde7('0xd'),auth[_0xdde7('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe371=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','/:id/clone','clone','put','update','destroy','util'];(function(_0x293521,_0x452878){var _0x2db60d=function(_0x11c55c){while(--_0x11c55c){_0x293521['push'](_0x293521['shift']());}};_0x2db60d(++_0x452878);}(_0xe371,0xff));var _0x1e37=function(_0x25fa9c,_0x872939){_0x25fa9c=_0x25fa9c-0x0;var _0x4a3cb6=_0xe371[_0x25fa9c];return _0x4a3cb6;};'use strict';var multer=require('multer');var util=require(_0x1e37('0x0'));var path=require('path');var timeout=require(_0x1e37('0x1'));var express=require(_0x1e37('0x2'));var router=express[_0x1e37('0x3')]();var fs_extra=require(_0x1e37('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e37('0x5'));var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0x1e37('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e37('0x6')](_0x1e37('0x7'),auth[_0x1e37('0x8')](),controller[_0x1e37('0x9')]);router[_0x1e37('0xa')](_0x1e37('0xb'),auth[_0x1e37('0x8')](),controller[_0x1e37('0xc')]);router[_0x1e37('0xa')]('/',auth[_0x1e37('0x8')](),controller['create']);router[_0x1e37('0xd')]('/:id',auth[_0x1e37('0x8')](),controller[_0x1e37('0xe')]);router['delete']('/:id',auth[_0x1e37('0x8')](),controller[_0x1e37('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 0918bc9..73baef6 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 _0x7566=['dynamic','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','active','passive','actpass'];(function(_0x3ba7f9,_0x21082d){var _0x3a5a12=function(_0x7f3e5e){while(--_0x7f3e5e){_0x3ba7f9['push'](_0x3ba7f9['shift']());}};_0x3a5a12(++_0x21082d);}(_0x7566,0x1ce));var _0x6756=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x7566[_0x4d2993];return _0x427374;};'use strict';var Sequelize=require(_0x6756('0x0'));module[_0x6756('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6756('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x4'),'user',_0x6756('0x5')),'allowNull':![],'defaultValue':_0x6756('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x6'),_0x6756('0x7'),'ALLOWED_FAILED_SCREEN',_0x6756('0x8'),_0x6756('0x9'),_0x6756('0xa'),_0x6756('0xb'),_0x6756('0xc'))},'deny':{'type':Sequelize[_0x6756('0xd')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x6756('0xd')]},'remotesecret':{'type':Sequelize[_0x6756('0xd')]},'transport':{'type':Sequelize[_0x6756('0xd')],'defaultValue':'udp','set':function(_0x3d2f75){this[_0x6756('0xe')]('transport',_0x3d2f75?_0x3d2f75[_0x6756('0xf')](','):null);},'get':function(){return this[_0x6756('0x10')](_0x6756('0x11'))?this[_0x6756('0x10')](_0x6756('0x11'))['split'](','):null;},'comment':_0x6756('0x12')},'dtmfmode':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x13'),_0x6756('0x14'),_0x6756('0x15'),_0x6756('0x16'),_0x6756('0x17')),'defaultValue':_0x6756('0x13')},'directmedia':{'type':Sequelize[_0x6756('0x3')]('yes','no',_0x6756('0x18'),_0x6756('0x19'),_0x6756('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6756('0xd')]},'directmediadeny':{'type':Sequelize[_0x6756('0xd')]},'nat':{'type':Sequelize[_0x6756('0xd')],'defaultValue':_0x6756('0x1c'),'set':function(_0x1b2dc8){this[_0x6756('0xe')](_0x6756('0x1d'),_0x1b2dc8?_0x1b2dc8[_0x6756('0xf')](','):null);},'get':function(){return this[_0x6756('0x10')](_0x6756('0x1d'))?this['getDataValue'](_0x6756('0x1d'))[_0x6756('0x1e')](','):null;},'comment':_0x6756('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x6756('0xd')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6756('0xd')]},'language':{'type':Sequelize[_0x6756('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6756('0xd')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6756('0xd')],'defaultValue':_0x6756('0x20')},'allow':{'type':Sequelize[_0x6756('0xd')],'allowNull':![],'defaultValue':_0x6756('0x21'),'set':function(_0x22fa38){this[_0x6756('0xe')]('allow',_0x22fa38?_0x22fa38[_0x6756('0xf')](';'):_0x6756('0x21'));},'get':function(){return this[_0x6756('0x10')](_0x6756('0x22'))?this[_0x6756('0x10')](_0x6756('0x22'))[_0x6756('0x1e')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x6756('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0xf7834d){this['setDataValue'](_0x6756('0x23'),_0xf7834d?_0xf7834d[_0x6756('0xf')](','):null);},'get':function(){return this[_0x6756('0x10')](_0x6756('0x23'))?this[_0x6756('0x10')](_0x6756('0x23'))[_0x6756('0x1e')](','):null;},'comment':_0x6756('0x24')},'trustrpid':{'type':Sequelize[_0x6756('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no',_0x6756('0x25'))},'promiscredir':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x6756('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x6756('0x26')](0xb)},'setvar':{'type':Sequelize[_0x6756('0xd')]},'callerid':{'type':Sequelize[_0x6756('0xd')],'defaultValue':_0x6756('0x27')},'amaflags':{'type':Sequelize[_0x6756('0xd')]},'callcounter':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x6756('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x6756('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0x6756('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x6756('0xd')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x6756('0xd')]},'session_timers':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x28'),_0x6756('0x29'),_0x6756('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x6756('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x6756('0x2b'),_0x6756('0x2c')),'defaultValue':_0x6756('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x6756('0xd')]},'regexten':{'type':Sequelize[_0x6756('0xd')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x6756('0xd')]},'port':{'type':Sequelize[_0x6756('0x26')](0x5)},'qualify':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no'),'defaultValue':_0x6756('0x1b')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x6756('0xd')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6756('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6756('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6756('0xd')]},'callbackextension':{'type':Sequelize[_0x6756('0xd')]},'timert1':{'type':Sequelize[_0x6756('0x26')](0xb)},'timerb':{'type':Sequelize[_0x6756('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x6756('0xd')]},'contactacl':{'type':Sequelize[_0x6756('0xd')]},'unsolicited_mailbox':{'type':Sequelize[_0x6756('0xd')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x6756('0x26')](0xb)},'encryption':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x6756('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6756('0xd')]},'dtlsprivatekey':{'type':Sequelize[_0x6756('0xd')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x6756('0xd')]},'dtlscapath':{'type':Sequelize[_0x6756('0xd')]},'dtlssetup':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x2d'),_0x6756('0x2e'),_0x6756('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6756('0xd')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6756('0xd')]},'recordofffeature':{'type':Sequelize[_0x6756('0xd')]},'call_limit':{'type':Sequelize[_0x6756('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x6756('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x6756('0xd')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x6756('0xd')]},'parkinglot':{'type':Sequelize[_0x6756('0xd')]},'description':{'type':Sequelize[_0x6756('0xd')]},'host':{'type':Sequelize[_0x6756('0xd')],'defaultValue':_0x6756('0x30')},'canreinvite':{'type':Sequelize[_0x6756('0x3')](_0x6756('0x1b'),'no','nonat','update',_0x6756('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x6756('0xd')]},'active':{'type':Sequelize[_0x6756('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6756('0xd')],'defaultValue':'no'}}; \ No newline at end of file +var _0x20a3=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure'];(function(_0x4987e3,_0x516cf9){var _0x2985ef=function(_0x22ee54){while(--_0x22ee54){_0x4987e3['push'](_0x4987e3['shift']());}};_0x2985ef(++_0x516cf9);}(_0x20a3,0xeb));var _0x320a=function(_0x19415f,_0x3bc6a1){_0x19415f=_0x19415f-0x0;var _0x1d8c10=_0x20a3[_0x19415f];return _0x1d8c10;};'use strict';var Sequelize=require('sequelize');module[_0x320a('0x0')]={'name':{'type':Sequelize[_0x320a('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x3'),_0x320a('0x4'),_0x320a('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x320a('0x1')],'allowNull':![],'defaultValue':_0x320a('0x6')},'callingpres':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x7'),_0x320a('0x8'),'ALLOWED_FAILED_SCREEN',_0x320a('0x9'),_0x320a('0xa'),_0x320a('0xb'),_0x320a('0xc'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x320a('0x1')]},'secret':{'type':Sequelize[_0x320a('0x1')]},'md5secret':{'type':Sequelize[_0x320a('0x1')]},'remotesecret':{'type':Sequelize[_0x320a('0x1')]},'transport':{'type':Sequelize[_0x320a('0x1')],'defaultValue':_0x320a('0xd'),'set':function(_0xe3df19){this[_0x320a('0xe')](_0x320a('0xf'),_0xe3df19?_0xe3df19[_0x320a('0x10')](','):null);},'get':function(){return this[_0x320a('0x11')](_0x320a('0xf'))?this[_0x320a('0x11')](_0x320a('0xf'))[_0x320a('0x12')](','):null;},'comment':_0x320a('0x13')},'dtmfmode':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x14'),_0x320a('0x15'),_0x320a('0x16'),'inband',_0x320a('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no','nonat',_0x320a('0x19'),_0x320a('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x320a('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x320a('0x1b'),'set':function(_0x16b33e){this[_0x320a('0xe')](_0x320a('0x1c'),_0x16b33e?_0x16b33e[_0x320a('0x10')](','):null);},'get':function(){return this[_0x320a('0x11')]('nat')?this['getDataValue']('nat')[_0x320a('0x12')](','):null;},'comment':_0x320a('0x1d')},'callgroup':{'type':Sequelize[_0x320a('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x320a('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x320a('0x1')]},'language':{'type':Sequelize[_0x320a('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x320a('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x320a('0x1')],'defaultValue':_0x320a('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x320a('0x1f'),'set':function(_0x270a04){this[_0x320a('0xe')]('allow',_0x270a04?_0x270a04[_0x320a('0x10')](';'):_0x320a('0x1f'));},'get':function(){return this['getDataValue'](_0x320a('0x20'))?this[_0x320a('0x11')](_0x320a('0x20'))[_0x320a('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'insecure':{'type':Sequelize[_0x320a('0x1')],'defaultValue':_0x320a('0x21'),'set':function(_0x16bbbb){this[_0x320a('0xe')](_0x320a('0x22'),_0x16bbbb?_0x16bbbb[_0x320a('0x10')](','):null);},'get':function(){return this[_0x320a('0x11')](_0x320a('0x22'))?this['getDataValue'](_0x320a('0x22'))[_0x320a('0x12')](','):null;},'comment':_0x320a('0x23')},'trustrpid':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x320a('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no',_0x320a('0x24'))},'promiscredir':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x320a('0x1')]},'callerid':{'type':Sequelize[_0x320a('0x1')],'defaultValue':_0x320a('0x25')},'amaflags':{'type':Sequelize[_0x320a('0x1')]},'callcounter':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x320a('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x320a('0x1')]},'template':{'type':Sequelize[_0x320a('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x320a('0x18'),'no',_0x320a('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x320a('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'mailbox':{'type':Sequelize[_0x320a('0x1')]},'session_timers':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x28'),_0x320a('0x29'),_0x320a('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x320a('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x2b'),_0x320a('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x320a('0x1')]},'regexten':{'type':Sequelize[_0x320a('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x320a('0x1')]},'port':{'type':Sequelize[_0x320a('0x26')](0x5)},'qualify':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no'),'defaultValue':_0x320a('0x18')},'keepalive':{'type':Sequelize[_0x320a('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x320a('0x1')]},'defaultuser':{'type':Sequelize[_0x320a('0x1')]},'rtptimeout':{'type':Sequelize[_0x320a('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x320a('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no',_0x320a('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x320a('0x1')]},'callbackextension':{'type':Sequelize[_0x320a('0x1')]},'timert1':{'type':Sequelize[_0x320a('0x26')](0xb)},'timerb':{'type':Sequelize[_0x320a('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x320a('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x320a('0x1')]},'contactdeny':{'type':Sequelize[_0x320a('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x320a('0x1')]},'use_q850_reason':{'type':Sequelize[_0x320a('0x1')]},'maxforwards':{'type':Sequelize[_0x320a('0x26')](0xb)},'encryption':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x320a('0x2')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x320a('0x2')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x320a('0x18'),'no',_0x320a('0x2e'),_0x320a('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x320a('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x320a('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x320a('0x1')]},'dtlscafile':{'type':Sequelize[_0x320a('0x1')]},'dtlscapath':{'type':Sequelize[_0x320a('0x1')]},'dtlssetup':{'type':Sequelize[_0x320a('0x2')]('active',_0x320a('0x30'),_0x320a('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x320a('0x1')]},'usereqphone':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x320a('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no')},'vmexten':{'type':Sequelize[_0x320a('0x1')]},'mohinterpret':{'type':Sequelize[_0x320a('0x1')]},'mohsuggest':{'type':Sequelize[_0x320a('0x1')]},'parkinglot':{'type':Sequelize[_0x320a('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x320a('0x1')],'defaultValue':_0x320a('0x32')},'canreinvite':{'type':Sequelize[_0x320a('0x2')](_0x320a('0x18'),'no',_0x320a('0x33'),_0x320a('0x19'),_0x320a('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x320a('0x1')]},'otherFields':{'type':Sequelize[_0x320a('0x1')]},'active':{'type':Sequelize[_0x320a('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x320a('0x1')],'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 be3083a..d9dec26 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 _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','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','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x584921,_0x5ef6bb){var _0x1bb74e=function(_0x27e133){while(--_0x27e133){_0x584921['push'](_0x584921['shift']());}};_0x1bb74e(++_0x5ef6bb);}(_0x425d,0x1e0));var _0xd425=function(_0xdfeec5,_0x6a548c){_0xdfeec5=_0xdfeec5-0x0;var _0x446388=_0x425d[_0xdfeec5];return _0x446388;};'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'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file +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(_0x224c38,_0x4eb599){var _0xe297ac=function(_0x284d15){while(--_0x284d15){_0x224c38['push'](_0x224c38['shift']());}};_0xe297ac(++_0x4eb599);}(_0x54ef,0x112));var _0xf54e=function(_0x275363,_0x3c51ba){_0x275363=_0x275363-0x0;var _0x5e23a2=_0x54ef[_0x275363];return _0x5e23a2;};'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 diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 6452317..50c69df 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 _0x7bd5=['moment','bluebird','path','rimraf','../../config/environment','exports','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0x7bd5,0x158));var _0x57bd=function(_0x41352d,_0x24639e){_0x41352d=_0x41352d-0x0;var _0x49ba84=_0x7bd5[_0x41352d];return _0x49ba84;};'use strict';var _=require(_0x57bd('0x0'));var util=require(_0x57bd('0x1'));var logger=require(_0x57bd('0x2'))(_0x57bd('0x3'));var moment=require(_0x57bd('0x4'));var BPromise=require(_0x57bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57bd('0x6'));var rimraf=require(_0x57bd('0x7'));var config=require(_0x57bd('0x8'));var attributes=require('./trunk.attributes');module[_0x57bd('0x9')]=function(_0x566fe2,_0x48ddcc){return _0x566fe2['define'](_0x57bd('0xa'),attributes,{'tableName':_0x57bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0a=['../../config/environment','./trunk.attributes','Trunk','tools_trunks','lodash','../../config/logger','moment','rimraf'];(function(_0x353f08,_0x1510ac){var _0x2b90bd=function(_0x4ac5a8){while(--_0x4ac5a8){_0x353f08['push'](_0x353f08['shift']());}};_0x2b90bd(++_0x1510ac);}(_0x0b0a,0x15c));var _0xa0b0=function(_0x1ed4ee,_0x5f0730){_0x1ed4ee=_0x1ed4ee-0x0;var _0x4eabc9=_0x0b0a[_0x1ed4ee];return _0x4eabc9;};'use strict';var _=require(_0xa0b0('0x0'));var util=require('util');var logger=require(_0xa0b0('0x1'))('api');var moment=require(_0xa0b0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa0b0('0x3'));var config=require(_0xa0b0('0x4'));var attributes=require(_0xa0b0('0x5'));module['exports']=function(_0xc64588,_0x51d012){return _0xc64588['define'](_0xa0b0('0x6'),attributes,{'tableName':_0xa0b0('0x7'),'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 1b314f0..bdebe05 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 _0xe697=['findAll','options','raw','attributes','limit','include','map','model','GetTrunk','catch','ShowTrunk','Trunk','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xe697,0xe0));var _0x7e69=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0xe697[_0xbebf50];return _0xce1496;};'use strict';var _=require(_0x7e69('0x0'));var util=require(_0x7e69('0x1'));var moment=require('moment');var BPromise=require(_0x7e69('0x2'));var rs=require(_0x7e69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e69('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e69('0x5'))('rpc');var config=require(_0x7e69('0x6'));var jayson=require(_0x7e69('0x7'));var client=jayson['client'][_0x7e69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d15ec,_0x119a19,_0x1f8b9b){return new BPromise(function(_0x5824cb,_0x1e19ec){return client[_0x7e69('0x9')](_0x2d15ec,_0x1f8b9b)[_0x7e69('0xa')](function(_0x3ce30e){logger[_0x7e69('0xb')]('Trunk,\x20%s,\x20%s',_0x119a19,'request\x20sent');logger[_0x7e69('0xc')](_0x7e69('0xd'),_0x119a19,_0x7e69('0xe'),JSON[_0x7e69('0xf')](_0x3ce30e));if(_0x3ce30e[_0x7e69('0x10')]){if(_0x3ce30e[_0x7e69('0x10')][_0x7e69('0x11')]===0x1f4){logger[_0x7e69('0x10')](_0x7e69('0x12'),_0x119a19,_0x3ce30e[_0x7e69('0x10')]['message']);return _0x1e19ec(_0x3ce30e['error']['message']);}logger[_0x7e69('0x10')]('Trunk,\x20%s,\x20%s',_0x119a19,_0x3ce30e['error'][_0x7e69('0x13')]);return _0x5824cb(_0x3ce30e[_0x7e69('0x10')]['message']);}else{logger['info'](_0x7e69('0x12'),_0x119a19,_0x7e69('0xe'));_0x5824cb(_0x3ce30e[_0x7e69('0x14')]['message']);}})['catch'](function(_0x316365){logger[_0x7e69('0x10')](_0x7e69('0x12'),_0x119a19,_0x316365);_0x1e19ec(_0x316365);});});}exports['GetTrunk']=function(_0x4ec1de){var _0x36181=this;return new Promise(function(_0x26ae00,_0x32683b){return db['Trunk'][_0x7e69('0x15')]({'raw':_0x4ec1de[_0x7e69('0x16')]?_0x4ec1de[_0x7e69('0x16')][_0x7e69('0x17')]===undefined?!![]:![]:!![],'where':_0x4ec1de[_0x7e69('0x16')]?_0x4ec1de[_0x7e69('0x16')]['where']||null:null,'attributes':_0x4ec1de[_0x7e69('0x16')]?_0x4ec1de[_0x7e69('0x16')][_0x7e69('0x18')]||null:null,'limit':_0x4ec1de[_0x7e69('0x16')]?_0x4ec1de['options'][_0x7e69('0x19')]||null:null,'include':_0x4ec1de[_0x7e69('0x16')]?_0x4ec1de[_0x7e69('0x16')][_0x7e69('0x1a')]?_[_0x7e69('0x1b')](_0x4ec1de[_0x7e69('0x16')][_0x7e69('0x1a')],function(_0x37425a){return{'model':db[_0x37425a[_0x7e69('0x1c')]],'as':_0x37425a['as'],'attributes':_0x37425a[_0x7e69('0x18')],'include':_0x37425a['include']?_[_0x7e69('0x1b')](_0x37425a[_0x7e69('0x1a')],function(_0x4258e3){return{'model':db[_0x4258e3[_0x7e69('0x1c')]],'as':_0x4258e3['as'],'attributes':_0x4258e3['attributes'],'include':_0x4258e3[_0x7e69('0x1a')]?_[_0x7e69('0x1b')](_0x4258e3['include'],function(_0x4d9b0b){return{'model':db[_0x4d9b0b[_0x7e69('0x1c')]],'as':_0x4d9b0b['as'],'attributes':_0x4d9b0b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e69('0xa')](function(_0x3c314c){logger[_0x7e69('0xb')](_0x7e69('0x1d'),_0x4ec1de);logger[_0x7e69('0xc')](_0x7e69('0x1d'),_0x4ec1de,JSON[_0x7e69('0xf')](_0x3c314c));_0x26ae00(_0x3c314c);})[_0x7e69('0x1e')](function(_0xec20dd){logger['error'](_0x7e69('0x1d'),_0xec20dd['message'],_0x4ec1de);_0x32683b(_0x36181[_0x7e69('0x10')](0x1f4,_0xec20dd[_0x7e69('0x13')]));});});};exports[_0x7e69('0x1f')]=function(_0x34d415){var _0x28a6ad=this;return new Promise(function(_0x2b108d,_0x13105e){return db[_0x7e69('0x20')][_0x7e69('0x21')]({'raw':_0x34d415[_0x7e69('0x16')]?_0x34d415[_0x7e69('0x16')][_0x7e69('0x17')]===undefined?!![]:![]:!![],'where':_0x34d415[_0x7e69('0x16')]?_0x34d415[_0x7e69('0x16')][_0x7e69('0x22')]||null:null,'attributes':_0x34d415[_0x7e69('0x16')]?_0x34d415[_0x7e69('0x16')][_0x7e69('0x18')]||null:null,'include':_0x34d415['options']?_0x34d415[_0x7e69('0x16')][_0x7e69('0x1a')]?_[_0x7e69('0x1b')](_0x34d415[_0x7e69('0x16')][_0x7e69('0x1a')],function(_0x1b7958){return{'model':db[_0x1b7958[_0x7e69('0x1c')]],'as':_0x1b7958['as'],'attributes':_0x1b7958['attributes'],'include':_0x1b7958[_0x7e69('0x1a')]?_[_0x7e69('0x1b')](_0x1b7958[_0x7e69('0x1a')],function(_0x232e5e){return{'model':db[_0x232e5e[_0x7e69('0x1c')]],'as':_0x232e5e['as'],'attributes':_0x232e5e['attributes'],'include':_0x232e5e['include']?_['map'](_0x232e5e[_0x7e69('0x1a')],function(_0x49d14e){return{'model':db[_0x49d14e[_0x7e69('0x1c')]],'as':_0x49d14e['as'],'attributes':_0x49d14e[_0x7e69('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7e69('0xa')](function(_0x2a42fe){logger['info'](_0x7e69('0x1f'),_0x34d415);logger[_0x7e69('0xc')](_0x7e69('0x1f'),_0x34d415,JSON[_0x7e69('0xf')](_0x2a42fe));_0x2b108d(_0x2a42fe);})['catch'](function(_0x39cf95){logger[_0x7e69('0x10')](_0x7e69('0x1f'),_0x39cf95[_0x7e69('0x13')],_0x34d415);_0x13105e(_0x28a6ad[_0x7e69('0x10')](0x1f4,_0x39cf95[_0x7e69('0x13')]));});});}; \ No newline at end of file +var _0x7710=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','model','attributes','map','find','ShowTrunk','util','bluebird'];(function(_0x9293db,_0xf7671){var _0x2adc2f=function(_0x1a2fdc){while(--_0x1a2fdc){_0x9293db['push'](_0x9293db['shift']());}};_0x2adc2f(++_0xf7671);}(_0x7710,0x130));var _0x0771=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0x7710[_0x5a905e];return _0x4124d6;};'use strict';var _=require('lodash');var util=require(_0x0771('0x0'));var moment=require('moment');var BPromise=require(_0x0771('0x1'));var rs=require(_0x0771('0x2'));var fs=require('fs');var Redis=require(_0x0771('0x3'));var db=require(_0x0771('0x4'))['db'];var utils=require(_0x0771('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0771('0x6'));var client=jayson[_0x0771('0x7')][_0x0771('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x589f48,_0x457220,_0x498827){return new BPromise(function(_0x2d3745,_0x2e2a90){return client[_0x0771('0x9')](_0x589f48,_0x498827)[_0x0771('0xa')](function(_0x2ac9be){logger['info'](_0x0771('0xb'),_0x457220,_0x0771('0xc'));logger[_0x0771('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0x457220,_0x0771('0xc'),JSON[_0x0771('0xe')](_0x2ac9be));if(_0x2ac9be[_0x0771('0xf')]){if(_0x2ac9be[_0x0771('0xf')][_0x0771('0x10')]===0x1f4){logger['error'](_0x0771('0xb'),_0x457220,_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);return _0x2e2a90(_0x2ac9be['error'][_0x0771('0x11')]);}logger[_0x0771('0xf')](_0x0771('0xb'),_0x457220,_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);return _0x2d3745(_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);}else{logger[_0x0771('0x12')](_0x0771('0xb'),_0x457220,_0x0771('0xc'));_0x2d3745(_0x2ac9be[_0x0771('0x13')]['message']);}})[_0x0771('0x14')](function(_0x4dae8a){logger['error'](_0x0771('0xb'),_0x457220,_0x4dae8a);_0x2e2a90(_0x4dae8a);});});}exports[_0x0771('0x15')]=function(_0x2527e6){var _0x2c58da=this;return new Promise(function(_0x59b1eb,_0x1eef5b){return db[_0x0771('0x16')][_0x0771('0x17')]({'raw':_0x2527e6[_0x0771('0x18')]?_0x2527e6[_0x0771('0x18')][_0x0771('0x19')]===undefined?!![]:![]:!![],'where':_0x2527e6[_0x0771('0x18')]?_0x2527e6[_0x0771('0x18')][_0x0771('0x1a')]||null:null,'attributes':_0x2527e6[_0x0771('0x18')]?_0x2527e6[_0x0771('0x18')]['attributes']||null:null,'limit':_0x2527e6['options']?_0x2527e6['options'][_0x0771('0x1b')]||null:null,'include':_0x2527e6[_0x0771('0x18')]?_0x2527e6[_0x0771('0x18')]['include']?_['map'](_0x2527e6['options'][_0x0771('0x1c')],function(_0x1b813a){return{'model':db[_0x1b813a[_0x0771('0x1d')]],'as':_0x1b813a['as'],'attributes':_0x1b813a[_0x0771('0x1e')],'include':_0x1b813a[_0x0771('0x1c')]?_[_0x0771('0x1f')](_0x1b813a[_0x0771('0x1c')],function(_0x21f1a3){return{'model':db[_0x21f1a3[_0x0771('0x1d')]],'as':_0x21f1a3['as'],'attributes':_0x21f1a3['attributes'],'include':_0x21f1a3[_0x0771('0x1c')]?_[_0x0771('0x1f')](_0x21f1a3[_0x0771('0x1c')],function(_0xd17279){return{'model':db[_0xd17279[_0x0771('0x1d')]],'as':_0xd17279['as'],'attributes':_0xd17279['attributes']};}):[]};}):[]};}):[]:[]})[_0x0771('0xa')](function(_0x144e97){logger[_0x0771('0x12')](_0x0771('0x15'),_0x2527e6);logger[_0x0771('0xd')](_0x0771('0x15'),_0x2527e6,JSON['stringify'](_0x144e97));_0x59b1eb(_0x144e97);})[_0x0771('0x14')](function(_0x5da54f){logger['error']('GetTrunk',_0x5da54f[_0x0771('0x11')],_0x2527e6);_0x1eef5b(_0x2c58da[_0x0771('0xf')](0x1f4,_0x5da54f[_0x0771('0x11')]));});});};exports['ShowTrunk']=function(_0x28e358){var _0x286524=this;return new Promise(function(_0x483f8b,_0x48239c){return db[_0x0771('0x16')][_0x0771('0x20')]({'raw':_0x28e358[_0x0771('0x18')]?_0x28e358[_0x0771('0x18')][_0x0771('0x19')]===undefined?!![]:![]:!![],'where':_0x28e358['options']?_0x28e358[_0x0771('0x18')][_0x0771('0x1a')]||null:null,'attributes':_0x28e358[_0x0771('0x18')]?_0x28e358['options'][_0x0771('0x1e')]||null:null,'include':_0x28e358['options']?_0x28e358[_0x0771('0x18')][_0x0771('0x1c')]?_[_0x0771('0x1f')](_0x28e358[_0x0771('0x18')]['include'],function(_0xe940c3){return{'model':db[_0xe940c3[_0x0771('0x1d')]],'as':_0xe940c3['as'],'attributes':_0xe940c3[_0x0771('0x1e')],'include':_0xe940c3[_0x0771('0x1c')]?_['map'](_0xe940c3[_0x0771('0x1c')],function(_0x1499ee){return{'model':db[_0x1499ee[_0x0771('0x1d')]],'as':_0x1499ee['as'],'attributes':_0x1499ee[_0x0771('0x1e')],'include':_0x1499ee['include']?_[_0x0771('0x1f')](_0x1499ee['include'],function(_0x474357){return{'model':db[_0x474357[_0x0771('0x1d')]],'as':_0x474357['as'],'attributes':_0x474357['attributes']};}):[]};}):[]};}):[]:[]})[_0x0771('0xa')](function(_0x2819b9){logger[_0x0771('0x12')](_0x0771('0x21'),_0x28e358);logger['debug'](_0x0771('0x21'),_0x28e358,JSON[_0x0771('0xe')](_0x2819b9));_0x483f8b(_0x2819b9);})['catch'](function(_0x122c4b){logger[_0x0771('0xf')]('ShowTrunk',_0x122c4b[_0x0771('0x11')],_0x28e358);_0x48239c(_0x286524[_0x0771('0xf')](0x1f4,_0x122c4b[_0x0771('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index d172803..76a62af 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 _0x41f7=['put','isAuthenticated','Router','../../components/auth/service'];(function(_0x42d645,_0x61c13f){var _0x448a1=function(_0x285d12){while(--_0x285d12){_0x42d645['push'](_0x42d645['shift']());}};_0x448a1(++_0x61c13f);}(_0x41f7,0x1ca));var _0x741f=function(_0x3adad3,_0x5e0761){_0x3adad3=_0x3adad3-0x0;var _0x588043=_0x41f7[_0x3adad3];return _0x588043;};'use strict';var express=require('express');var router=express[_0x741f('0x0')]();var auth=require(_0x741f('0x1'));var controller=require('./user-setting.controller');router[_0x741f('0x2')]('/:id',auth[_0x741f('0x3')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x6dda=['./user-setting.controller','put','isAuthenticated','exports','../../components/auth/service'];(function(_0x44d287,_0x4e69da){var _0x442554=function(_0x5c0951){while(--_0x5c0951){_0x44d287['push'](_0x44d287['shift']());}};_0x442554(++_0x4e69da);}(_0x6dda,0x10d));var _0xa6dd=function(_0x11d5d7,_0xc0e94d){_0x11d5d7=_0x11d5d7-0x0;var _0x3731aa=_0x6dda[_0x11d5d7];return _0x3731aa;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa6dd('0x0'));var controller=require(_0xa6dd('0x1'));router[_0xa6dd('0x2')]('/:id',auth[_0xa6dd('0x3')](),controller['update']);module[_0xa6dd('0x4')]=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 f230750..14d8878 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 _0x8642=['TEXT','DATE','INTEGER','warning','debug','ENUM','error','BOOLEAN'];(function(_0x2ab324,_0x49fbac){var _0x427c10=function(_0x4674c2){while(--_0x4674c2){_0x2ab324['push'](_0x2ab324['shift']());}};_0x427c10(++_0x49fbac);}(_0x8642,0x163));var _0x2864=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x8642[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error',_0x2864('0x0'),'info',_0x2864('0x1')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x2864('0x2')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x2864('0x3'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x2864('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x2864('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x2864('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x2864('0x7')],'unique':'UserId'}}; \ No newline at end of file +var _0xfc04=['sequelize','warning','info','debug','exports','ENUM','error','BOOLEAN','TEXT','INTEGER','UserId'];(function(_0x533d50,_0xc01bcd){var _0x249aba=function(_0x1dc9c8){while(--_0x1dc9c8){_0x533d50['push'](_0x533d50['shift']());}};_0x249aba(++_0xc01bcd);}(_0xfc04,0x6e));var _0x4fc0=function(_0x8a2f13,_0x37bad0){_0x8a2f13=_0x8a2f13-0x0;var _0x2243ea=_0xfc04[_0x8a2f13];return _0x2243ea;};'use strict';var Sequelize=require(_0x4fc0('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x4fc0('0x1'),_0x4fc0('0x2'),_0x4fc0('0x3')];module[_0x4fc0('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x4fc0('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4fc0('0x6'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4fc0('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4fc0('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x4fc0('0x9')],'unique':_0x4fc0('0xa')}}; \ 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 62be1a4..1f50b75 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 _0xf7f3=['update','then','sendStatus','error','name','status','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','./user-setting.socket','register','defaults','localhost'];(function(_0x3a91fa,_0x7972a3){var _0xa885b9=function(_0x423efa){while(--_0x423efa){_0x3a91fa['push'](_0x3a91fa['shift']());}};_0xa885b9(++_0x7972a3);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x534084,_0x17a7c3){_0x534084=_0x534084-0x0;var _0x1420fb=_0xf7f3[_0x534084];return _0x1420fb;};'use strict';var _=require(_0x3f7f('0x0'));var Redis=require(_0x3f7f('0x1'));var logger=require(_0x3f7f('0x2'))(_0x3f7f('0x3'));var config=require(_0x3f7f('0x4'));var db=require(_0x3f7f('0x5'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f7f('0x6'))[_0x3f7f('0x7')](socket);config['redis']=_[_0x3f7f('0x8')](config['redis'],{'host':_0x3f7f('0x9'),'port':0x18eb});function respondWithResult(_0x57b834,_0x5d6e4d){_0x5d6e4d=_0x5d6e4d||0xc8;return function(_0x5cac86){if(_0x5cac86){return _0x57b834['status'](_0x5d6e4d)['json'](_0x5cac86);}};}function saveUpdates(_0x221238){return function(_0x1b2408){if(_0x1b2408){return _0x1b2408[_0x3f7f('0xa')](_0x221238)[_0x3f7f('0xb')](function(_0x32a80f){return _0x32a80f;});}return null;};}function handleEntityNotFound(_0x38af7e){return function(_0x2bfcfa){if(!_0x2bfcfa){_0x38af7e[_0x3f7f('0xc')](0x194);}return _0x2bfcfa;};}function handleError(_0x55f192,_0x5d6a4e){_0x5d6a4e=_0x5d6a4e||0x1f4;return function(_0x395f8a){logger[_0x3f7f('0xd')](_0x395f8a['stack']);if(_0x395f8a['name']){delete _0x395f8a[_0x3f7f('0xe')];}_0x55f192[_0x3f7f('0xf')](_0x5d6a4e)['send'](_0x395f8a);};}exports[_0x3f7f('0xa')]=function(_0x30b064,_0x1aa642){if(_0x30b064['user'][_0x3f7f('0x10')]!==_0x3f7f('0x11'))throw new Error(_0x3f7f('0x12'));if(isNaN(Number(_0x30b064[_0x3f7f('0x13')]['id'])))throw new Error(_0x3f7f('0x14'));return db['UserSetting'][_0x3f7f('0x15')]({'where':{'id':_0x30b064['params']['id']}})[_0x3f7f('0xb')](handleEntityNotFound(_0x1aa642,null))[_0x3f7f('0xb')](saveUpdates(_0x30b064['body'],null))[_0x3f7f('0xb')](respondWithResult(_0x1aa642,null))['catch'](handleError(_0x1aa642,null));}; \ No newline at end of file +var _0xcea5=['name','send','update','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults','status','json','then','sendStatus','stack'];(function(_0x4c667c,_0x26e15d){var _0x19a2df=function(_0xd3d6c2){while(--_0xd3d6c2){_0x4c667c['push'](_0x4c667c['shift']());}};_0x19a2df(++_0x26e15d);}(_0xcea5,0xed));var _0x5cea=function(_0x11ae7f,_0x44ea49){_0x11ae7f=_0x11ae7f-0x0;var _0x588113=_0xcea5[_0x11ae7f];return _0x588113;};'use strict';var _=require(_0x5cea('0x0'));var Redis=require(_0x5cea('0x1'));var logger=require(_0x5cea('0x2'))(_0x5cea('0x3'));var config=require(_0x5cea('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x5cea('0x5'))(new Redis(config[_0x5cea('0x6')]));require(_0x5cea('0x7'))[_0x5cea('0x8')](socket);config['redis']=_[_0x5cea('0x9')](config[_0x5cea('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x49db13,_0x59f337){_0x59f337=_0x59f337||0xc8;return function(_0x502d95){if(_0x502d95){return _0x49db13[_0x5cea('0xa')](_0x59f337)[_0x5cea('0xb')](_0x502d95);}};}function saveUpdates(_0x4dd30e){return function(_0x429558){if(_0x429558){return _0x429558['update'](_0x4dd30e)[_0x5cea('0xc')](function(_0x177986){return _0x177986;});}return null;};}function handleEntityNotFound(_0x1c9e9f){return function(_0x23b85f){if(!_0x23b85f){_0x1c9e9f[_0x5cea('0xd')](0x194);}return _0x23b85f;};}function handleError(_0x130ed3,_0x21ecc9){_0x21ecc9=_0x21ecc9||0x1f4;return function(_0x9f846){logger['error'](_0x9f846[_0x5cea('0xe')]);if(_0x9f846[_0x5cea('0xf')]){delete _0x9f846[_0x5cea('0xf')];}_0x130ed3[_0x5cea('0xa')](_0x21ecc9)[_0x5cea('0x10')](_0x9f846);};}exports[_0x5cea('0x11')]=function(_0x2d0965,_0x349ca8){if(_0x2d0965[_0x5cea('0x12')][_0x5cea('0x13')]!==_0x5cea('0x14'))throw new Error(_0x5cea('0x15'));if(isNaN(Number(_0x2d0965[_0x5cea('0x16')]['id'])))throw new Error(_0x5cea('0x17'));return db[_0x5cea('0x18')][_0x5cea('0x19')]({'where':{'id':_0x2d0965[_0x5cea('0x16')]['id']}})[_0x5cea('0xc')](handleEntityNotFound(_0x349ca8,null))[_0x5cea('0xc')](saveUpdates(_0x2d0965[_0x5cea('0x1a')],null))[_0x5cea('0xc')](respondWithResult(_0x349ca8,null))[_0x5cea('0x1b')](handleError(_0x349ca8,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 e7d10c1..1e02454 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 _0xc6ec=['hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','update','remove','emit'];(function(_0x3fcc79,_0x4d5313){var _0x353112=function(_0x1c3492){while(--_0x1c3492){_0x3fcc79['push'](_0x3fcc79['shift']());}};_0x353112(++_0x4d5313);}(_0xc6ec,0x92));var _0xcc6e=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0xc6ec[_0x209bbf];return _0x592d4b;};'use strict';var EventEmitter=require(_0xcc6e('0x0'));var UserSetting=require(_0xcc6e('0x1'))['db'][_0xcc6e('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xcc6e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcc6e('0x4'),'afterDestroy':_0xcc6e('0x5')};function emitEvent(_0x48aa4b){return function(_0x548854,_0x38d6f3,_0x46aa94){UserSettingEvents[_0xcc6e('0x6')](_0x48aa4b+':'+_0x548854['id'],_0x548854);UserSettingEvents[_0xcc6e('0x6')](_0x48aa4b,_0x548854);_0x46aa94(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xcc6e('0x7')](e,emitEvent(event));}}module[_0xcc6e('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x95bd=['events','../../mysqldb','UserSetting','setMaxListeners','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95bd,0xf0));var _0xd95b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x95bd[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xd95b('0x0'));var UserSetting=require(_0xd95b('0x1'))['db'][_0xd95b('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xd95b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd95b('0x4')};function emitEvent(_0x312e50){return function(_0x3656f3,_0x87474d,_0xa16347){UserSettingEvents[_0xd95b('0x5')](_0x312e50+':'+_0x3656f3['id'],_0x3656f3);UserSettingEvents[_0xd95b('0x5')](_0x312e50,_0x3656f3);_0xa16347(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xd95b('0x6')](e,emitEvent(event));}}module[_0xd95b('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 2379af9..757a9de 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 _0x9e5e=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x212780,_0x10a04a){var _0x18666c=function(_0x5b9847){while(--_0x5b9847){_0x212780['push'](_0x212780['shift']());}};_0x18666c(++_0x10a04a);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9e5e[_0x4e676e];return _0x336a3c;};'use strict';var attributes=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]=function(_0x5a229a){return _0x5a229a[_0xe9e5('0x2')](_0xe9e5('0x3'),attributes,{'tableName':_0xe9e5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c9784){if(!_0x4c9784[_0xe9e5('0x5')])_0x4c9784['clientSideLoggingEnabledSince']=null;else if(_0x4c9784[_0xe9e5('0x6')]===null)_0x4c9784[_0xe9e5('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x38d0=['define','user_settings','clientSideLoggingEnabledSince','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x38d0,0x123));var _0x038d=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x38d0[_0x1694f5];return _0x5b4321;};'use strict';var attributes=require('./user-setting.attributes');module[_0x038d('0x0')]=function(_0x327d9d){return _0x327d9d[_0x038d('0x1')]('UserSetting',attributes,{'tableName':_0x038d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27db0a){if(!_0x27db0a['clientSideLoggingEnabled'])_0x27db0a['clientSideLoggingEnabledSince']=null;else if(_0x27db0a[_0x038d('0x3')]===null)_0x27db0a['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 d796a3a..b57cf1b 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 _0x9d1c=['update','emit','user-setting:update','UserId','register','length','user-setting:','save','remove'];(function(_0x612629,_0x5bf409){var _0x2c6e7c=function(_0x2f7d55){while(--_0x2f7d55){_0x612629['push'](_0x612629['shift']());}};_0x2c6e7c(++_0x5bf409);}(_0x9d1c,0x10c));var _0xc9d1=function(_0x4e69e7,_0x538e17){_0x4e69e7=_0x4e69e7-0x0;var _0x182498=_0x9d1c[_0x4e69e7];return _0x182498;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xc9d1('0x0'),_0xc9d1('0x1'),_0xc9d1('0x2')];function createListener(_0x996f5,_0x4e3c1c){return function(_0x560fa6){_0x4e3c1c[_0xc9d1('0x3')](_0x996f5,_0x560fa6);if(_0x996f5===_0xc9d1('0x4')){_0x4e3c1c[_0xc9d1('0x3')]('user-setting:update:user-'+_0x560fa6[_0xc9d1('0x5')],_0x560fa6);}};}exports[_0xc9d1('0x6')]=function(_0x8330e){for(var _0x11ab3d=0x0,_0xadbc9a=events[_0xc9d1('0x7')];_0x11ab3d<_0xadbc9a;_0x11ab3d++){var _0x23d069=events[_0x11ab3d];var _0x565f41=createListener(_0xc9d1('0x8')+_0x23d069,_0x8330e);UserSettingEvents['on'](_0x23d069,_0x565f41);}}; \ No newline at end of file +var _0xb945=['register','user-setting:','./user-setting.events','save','remove','UserId'];(function(_0x15f30f,_0x2fcb37){var _0x5717ed=function(_0x28437e){while(--_0x28437e){_0x15f30f['push'](_0x15f30f['shift']());}};_0x5717ed(++_0x2fcb37);}(_0xb945,0x1ca));var _0x5b94=function(_0x31de34,_0x3a0e9d){_0x31de34=_0x31de34-0x0;var _0x24722d=_0xb945[_0x31de34];return _0x24722d;};'use strict';var UserSettingEvents=require(_0x5b94('0x0'));var events=[_0x5b94('0x1'),_0x5b94('0x2'),'update'];function createListener(_0x26e87c,_0x4c7cf3){return function(_0x3ba98b){_0x4c7cf3['emit'](_0x26e87c,_0x3ba98b);if(_0x26e87c==='user-setting:update'){_0x4c7cf3['emit']('user-setting:update:user-'+_0x3ba98b[_0x5b94('0x3')],_0x3ba98b);}};}exports[_0x5b94('0x4')]=function(_0x2ed8c8){for(var _0x3dc8da=0x0,_0x2779a3=events['length'];_0x3dc8da<_0x2779a3;_0x3dc8da++){var _0x48bb89=events[_0x3dc8da];var _0x501f1f=createListener(_0x5b94('0x5')+_0x48bb89,_0x2ed8c8);UserSettingEvents['on'](_0x48bb89,_0x501f1f);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index eac8139..0051f3d 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 _0xd201=['format','%s-%s','now','single','file','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addChatWebsites','createApiKey','put','/:id/password','delete','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeApiKey','/:id/messengerSoundNotification','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','diskStorage','join','root','server/files/images/'];(function(_0x41d5f0,_0x37b3c7){var _0x3dd65b=function(_0x3596ea){while(--_0x3596ea){_0x41d5f0['push'](_0x41d5f0['shift']());}};_0x3dd65b(++_0x37b3c7);}(_0xd201,0x17a));var _0x1d20=function(_0x465533,_0x56ab66){_0x465533=_0x465533-0x0;var _0x49489b=_0xd201[_0x465533];return _0x49489b;};'use strict';var multer=require('multer');var util=require(_0x1d20('0x0'));var path=require(_0x1d20('0x1'));var timeout=require('connect-timeout');var express=require(_0x1d20('0x2'));var router=express[_0x1d20('0x3')]();var fs_extra=require(_0x1d20('0x4'));var auth=require(_0x1d20('0x5'));var interaction=require(_0x1d20('0x6'));var config=require(_0x1d20('0x7'));var controller=require(_0x1d20('0x8'));router[_0x1d20('0x9')]('/',auth['isAuthenticated'](),controller[_0x1d20('0xa')]);router[_0x1d20('0x9')](_0x1d20('0xb'),auth[_0x1d20('0xc')](),controller[_0x1d20('0xd')]);router[_0x1d20('0x9')](_0x1d20('0xe'),auth[_0x1d20('0xc')](),controller[_0x1d20('0xf')]);router[_0x1d20('0x9')](_0x1d20('0x10'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x11')]);router[_0x1d20('0x9')](_0x1d20('0x12'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x13')]);router[_0x1d20('0x9')](_0x1d20('0x14'),controller['getAvatar']);router[_0x1d20('0x9')](_0x1d20('0x15'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x16')]);router['get'](_0x1d20('0x17'),auth['isAuthenticated'](),controller[_0x1d20('0x18')]);router[_0x1d20('0x9')]('/:id/queues',auth[_0x1d20('0xc')](),controller[_0x1d20('0x19')]);router['get'](_0x1d20('0x1a'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x1b')]);router[_0x1d20('0x9')](_0x1d20('0x1c'),auth[_0x1d20('0xc')](),controller['getGroups']);router['get']('/:id/recordings',auth[_0x1d20('0xc')](),controller[_0x1d20('0x1d')]);router[_0x1d20('0x9')](_0x1d20('0x1e'),auth[_0x1d20('0xc')](),controller['getScreenRecordings']);router[_0x1d20('0x9')](_0x1d20('0x1f'),auth[_0x1d20('0xc')](),controller['getChatInteractions']);router[_0x1d20('0x9')](_0x1d20('0x20'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x21')]);router[_0x1d20('0x9')](_0x1d20('0x22'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x23')]);router[_0x1d20('0x9')](_0x1d20('0x24'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x25')]);router[_0x1d20('0x9')](_0x1d20('0x26'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x27')]);router['get'](_0x1d20('0x28'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x29')]);router[_0x1d20('0x9')](_0x1d20('0x2a'),auth[_0x1d20('0xc')](),controller['getTeams']);router[_0x1d20('0x9')](_0x1d20('0x2b'),auth[_0x1d20('0xc')](),controller['getLists']);router['get'](_0x1d20('0x2c'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x2d')]);router[_0x1d20('0x9')](_0x1d20('0x2e'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x2f')]);router[_0x1d20('0x9')](_0x1d20('0x30'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x31')]);router[_0x1d20('0x9')](_0x1d20('0x32'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x33')]);router[_0x1d20('0x9')]('/:id/openchannel_accounts',auth[_0x1d20('0xc')](),controller[_0x1d20('0x34')]);router[_0x1d20('0x9')](_0x1d20('0x35'),auth[_0x1d20('0xc')](),controller['getSmsAccounts']);router[_0x1d20('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x1d20('0x36')]);router['get'](_0x1d20('0x37'),auth['isAuthenticated'](),controller[_0x1d20('0x38')]);router[_0x1d20('0x9')](_0x1d20('0x39'),auth[_0x1d20('0xc')](),controller['getScheduledCalls']);router['get'](_0x1d20('0x3a'),auth['isAuthenticated'](),controller[_0x1d20('0x3b')]);router[_0x1d20('0x3c')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x1d20('0x3d')]);router[_0x1d20('0x3c')]('/',auth[_0x1d20('0xc')](),controller[_0x1d20('0x3e')]);router[_0x1d20('0x3c')](_0x1d20('0x3f'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x40')]);router[_0x1d20('0x3c')](_0x1d20('0x41'),auth[_0x1d20('0xc')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1d20('0x42')]({'destination':function(_0x749e3f,_0x17dd07,_0x3a7da4){_0x3a7da4(null,path[_0x1d20('0x43')](config[_0x1d20('0x44')],_0x1d20('0x45')));},'filename':function(_0x528cd2,_0x31a077,_0x3e2992){_0x3e2992(null,util[_0x1d20('0x46')](_0x1d20('0x47'),Date[_0x1d20('0x48')](),_0x31a077['originalname']));}})});router[_0x1d20('0x3c')](_0x1d20('0x14'),upload[_0x1d20('0x49')](_0x1d20('0x4a')),controller['addAvatar']);router[_0x1d20('0x3c')](_0x1d20('0x4b'),auth['isAuthenticated'](),controller['login']);router[_0x1d20('0x3c')](_0x1d20('0x4c'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x4d')]);router[_0x1d20('0x3c')](_0x1d20('0x4e'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x4f')]);router[_0x1d20('0x3c')](_0x1d20('0x50'),auth['isAuthenticated'](),controller[_0x1d20('0x51')]);router['post']('/:id/teams',auth[_0x1d20('0xc')](),controller[_0x1d20('0x52')]);router[_0x1d20('0x3c')](_0x1d20('0x53'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x54')]);router[_0x1d20('0x3c')](_0x1d20('0x55'),auth['isAuthenticated'](),controller[_0x1d20('0x56')]);router[_0x1d20('0x3c')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x1d20('0x3c')](_0x1d20('0x57'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x58')]);router[_0x1d20('0x3c')](_0x1d20('0x59'),auth[_0x1d20('0xc')](),controller['addOpenchannelInteractions']);router[_0x1d20('0x3c')](_0x1d20('0x5a'),auth[_0x1d20('0xc')](),controller['addWhatsappInteractions']);router['post'](_0x1d20('0x30'),auth[_0x1d20('0xc')](),controller['addFaxAccounts']);router[_0x1d20('0x3c')](_0x1d20('0x32'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x5b')]);router[_0x1d20('0x3c')](_0x1d20('0x5c'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x5d')]);router[_0x1d20('0x3c')]('/:id/sms_accounts',auth[_0x1d20('0xc')](),controller['addSmsAccounts']);router[_0x1d20('0x3c')]('/:id/chat_websites',auth[_0x1d20('0xc')](),controller[_0x1d20('0x5e')]);router[_0x1d20('0x3c')](_0x1d20('0x37'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router['post'](_0x1d20('0x3a'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x5f')]);router[_0x1d20('0x60')](_0x1d20('0x12'),auth[_0x1d20('0xc')](),controller['update']);router[_0x1d20('0x60')](_0x1d20('0x61'),auth[_0x1d20('0xc')](),controller['changePassword']);router[_0x1d20('0x62')]('/:id/queues',auth[_0x1d20('0xc')](),controller['removeQueues']);router[_0x1d20('0x62')](_0x1d20('0x2a'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x63')]);router[_0x1d20('0x62')]('/:id',auth[_0x1d20('0xc')](),controller[_0x1d20('0x64')]);router['delete'](_0x1d20('0x53'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x65')]);router[_0x1d20('0x62')]('/:id/mail_interactions',auth[_0x1d20('0xc')](),controller['removeMailInteractions']);router[_0x1d20('0x62')](_0x1d20('0x66'),auth[_0x1d20('0xc')](),controller['removeFaxInteractions']);router[_0x1d20('0x62')](_0x1d20('0x57'),auth[_0x1d20('0xc')](),controller['removeSmsInteractions']);router[_0x1d20('0x62')](_0x1d20('0x59'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x67')]);router[_0x1d20('0x62')](_0x1d20('0x5a'),auth[_0x1d20('0xc')](),controller['removeWhatsappInteractions']);router['delete'](_0x1d20('0x30'),auth['isAuthenticated'](),controller[_0x1d20('0x68')]);router[_0x1d20('0x62')](_0x1d20('0x32'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x69')]);router['delete']('/:id/openchannel_accounts',auth[_0x1d20('0xc')](),controller[_0x1d20('0x6a')]);router[_0x1d20('0x62')]('/:id/sms_accounts',auth[_0x1d20('0xc')](),controller[_0x1d20('0x6b')]);router[_0x1d20('0x62')](_0x1d20('0x6c'),auth[_0x1d20('0xc')](),controller['removeChatWebsites']);router[_0x1d20('0x62')]('/:id/whatsapp_accounts',auth[_0x1d20('0xc')](),controller['removeWhatsappAccounts']);router['delete'](_0x1d20('0x3a'),auth[_0x1d20('0xc')](),controller[_0x1d20('0x6d')]);router['post'](_0x1d20('0x6e'),auth[_0x1d20('0xc')](),controller['messengerSoundNotification']);module[_0x1d20('0x6f')]=router; \ No newline at end of file +var _0xb24d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','post','addContacts','create','/create_many','bulkCreate','addQueues','join','root','format','%s-%s','now','originalname','addAvatar','/:id/login','login','logout','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','util','path','connect-timeout','express'];(function(_0x5482f1,_0x8d7cac){var _0x1847bf=function(_0x4a7e1d){while(--_0x4a7e1d){_0x5482f1['push'](_0x5482f1['shift']());}};_0x1847bf(++_0x8d7cac);}(_0xb24d,0x1b4));var _0xdb24=function(_0x5e2803,_0x289436){_0x5e2803=_0x5e2803-0x0;var _0xb63d7c=_0xb24d[_0x5e2803];return _0xb63d7c;};'use strict';var multer=require('multer');var util=require(_0xdb24('0x0'));var path=require(_0xdb24('0x1'));var timeout=require(_0xdb24('0x2'));var express=require(_0xdb24('0x3'));var router=express['Router']();var fs_extra=require(_0xdb24('0x4'));var auth=require(_0xdb24('0x5'));var interaction=require(_0xdb24('0x6'));var config=require(_0xdb24('0x7'));var controller=require(_0xdb24('0x8'));router[_0xdb24('0x9')]('/',auth[_0xdb24('0xa')](),controller[_0xdb24('0xb')]);router[_0xdb24('0x9')](_0xdb24('0xc'),auth[_0xdb24('0xa')](),controller['describe']);router[_0xdb24('0x9')](_0xdb24('0xd'),auth[_0xdb24('0xa')](),controller['whoami']);router[_0xdb24('0x9')](_0xdb24('0xe'),auth['isAuthenticated'](),controller['getPresence']);router['get'](_0xdb24('0xf'),auth['isAuthenticated'](),controller[_0xdb24('0x10')]);router['get'](_0xdb24('0x11'),controller[_0xdb24('0x12')]);router['get'](_0xdb24('0x13'),auth['isAuthenticated'](),controller['getOpenTabs']);router['get'](_0xdb24('0x14'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x15')]);router[_0xdb24('0x9')](_0xdb24('0x16'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x17')]);router[_0xdb24('0x9')](_0xdb24('0x18'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x19')]);router['get'](_0xdb24('0x1a'),auth['isAuthenticated'](),controller[_0xdb24('0x1b')]);router[_0xdb24('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0xdb24('0x9')]('/:id/screen_recordings',auth[_0xdb24('0xa')](),controller[_0xdb24('0x1c')]);router[_0xdb24('0x9')](_0xdb24('0x1d'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x1e')]);router[_0xdb24('0x9')](_0xdb24('0x1f'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x20')]);router['get'](_0xdb24('0x21'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x22')]);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0xdb24('0x9')]('/:id/fax/interactions',auth[_0xdb24('0xa')](),controller[_0xdb24('0x23')]);router['get'](_0xdb24('0x24'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x25')]);router[_0xdb24('0x9')](_0xdb24('0x26'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x27')]);router[_0xdb24('0x9')]('/:id/lists',auth[_0xdb24('0xa')](),controller[_0xdb24('0x28')]);router['get'](_0xdb24('0x29'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x2a')]);router['get'](_0xdb24('0x2b'),auth['isAuthenticated'](),controller[_0xdb24('0x2c')]);router['get'](_0xdb24('0x2d'),auth[_0xdb24('0xa')](),controller['getFaxAccounts']);router['get'](_0xdb24('0x2e'),auth[_0xdb24('0xa')](),controller['getMailAccounts']);router['get'](_0xdb24('0x2f'),auth['isAuthenticated'](),controller[_0xdb24('0x30')]);router[_0xdb24('0x9')](_0xdb24('0x31'),auth[_0xdb24('0xa')](),controller['getSmsAccounts']);router[_0xdb24('0x9')](_0xdb24('0x32'),auth[_0xdb24('0xa')](),controller['getChatWebsites']);router['get'](_0xdb24('0x33'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x34')]);router[_0xdb24('0x9')](_0xdb24('0x35'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xdb24('0x9')]('/:id/api_key',auth[_0xdb24('0xa')](),controller['getApiKey']);router[_0xdb24('0x36')](_0xdb24('0x14'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x37')]);router['post']('/',auth[_0xdb24('0xa')](),controller[_0xdb24('0x38')]);router[_0xdb24('0x36')](_0xdb24('0x39'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x3a')]);router['post'](_0xdb24('0x16'),auth['isAuthenticated'](),controller[_0xdb24('0x3b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ac0fc,_0x31dca9,_0x346232){_0x346232(null,path[_0xdb24('0x3c')](config[_0xdb24('0x3d')],'server/files/images/'));},'filename':function(_0x1f8b47,_0x44e7ff,_0x2d069e){_0x2d069e(null,util[_0xdb24('0x3e')](_0xdb24('0x3f'),Date[_0xdb24('0x40')](),_0x44e7ff[_0xdb24('0x41')]));}})});router[_0xdb24('0x36')](_0xdb24('0x11'),upload['single']('file'),controller[_0xdb24('0x42')]);router['post'](_0xdb24('0x43'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x44')]);router[_0xdb24('0x36')]('/:id/logout',auth[_0xdb24('0xa')](),controller[_0xdb24('0x45')]);router[_0xdb24('0x36')]('/:id/pause',auth[_0xdb24('0xa')](),controller[_0xdb24('0x46')]);router[_0xdb24('0x36')](_0xdb24('0x47'),auth['isAuthenticated'](),controller[_0xdb24('0x48')]);router[_0xdb24('0x36')](_0xdb24('0x26'),auth['isAuthenticated'](),controller['addTeams']);router[_0xdb24('0x36')](_0xdb24('0x49'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x4a')]);router[_0xdb24('0x36')](_0xdb24('0x4b'),auth['isAuthenticated'](),controller[_0xdb24('0x4c')]);router['post']('/:id/fax_interactions',auth[_0xdb24('0xa')](),controller[_0xdb24('0x4d')]);router[_0xdb24('0x36')](_0xdb24('0x4e'),auth['isAuthenticated'](),controller[_0xdb24('0x4f')]);router['post']('/:id/openchannel_interactions',auth[_0xdb24('0xa')](),controller['addOpenchannelInteractions']);router[_0xdb24('0x36')](_0xdb24('0x50'),auth['isAuthenticated'](),controller[_0xdb24('0x51')]);router[_0xdb24('0x36')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xdb24('0x52')]);router[_0xdb24('0x36')](_0xdb24('0x2e'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x53')]);router[_0xdb24('0x36')](_0xdb24('0x2f'),auth[_0xdb24('0xa')](),controller['addOpenchannelAccounts']);router[_0xdb24('0x36')](_0xdb24('0x31'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x54')]);router[_0xdb24('0x36')]('/:id/chat_websites',auth[_0xdb24('0xa')](),controller[_0xdb24('0x55')]);router[_0xdb24('0x36')](_0xdb24('0x33'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x56')]);router['post'](_0xdb24('0x57'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x58')]);router[_0xdb24('0x59')](_0xdb24('0xf'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x5a')]);router[_0xdb24('0x59')](_0xdb24('0x5b'),auth['isAuthenticated'](),controller[_0xdb24('0x5c')]);router[_0xdb24('0x5d')]('/:id/queues',auth[_0xdb24('0xa')](),controller['removeQueues']);router[_0xdb24('0x5d')](_0xdb24('0x26'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x5e')]);router[_0xdb24('0x5d')]('/:id',auth[_0xdb24('0xa')](),controller['destroy']);router[_0xdb24('0x5d')](_0xdb24('0x49'),auth['isAuthenticated'](),controller[_0xdb24('0x5f')]);router[_0xdb24('0x5d')](_0xdb24('0x4b'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x60')]);router[_0xdb24('0x5d')](_0xdb24('0x61'),auth[_0xdb24('0xa')](),controller['removeFaxInteractions']);router['delete'](_0xdb24('0x4e'),auth['isAuthenticated'](),controller[_0xdb24('0x62')]);router[_0xdb24('0x5d')](_0xdb24('0x63'),auth[_0xdb24('0xa')](),controller['removeOpenchannelInteractions']);router[_0xdb24('0x5d')](_0xdb24('0x50'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x64')]);router[_0xdb24('0x5d')](_0xdb24('0x2d'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x65')]);router[_0xdb24('0x5d')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xdb24('0x66')]);router[_0xdb24('0x5d')](_0xdb24('0x2f'),auth[_0xdb24('0xa')](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth[_0xdb24('0xa')](),controller[_0xdb24('0x67')]);router[_0xdb24('0x5d')](_0xdb24('0x32'),auth[_0xdb24('0xa')](),controller[_0xdb24('0x68')]);router[_0xdb24('0x5d')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xdb24('0x69')]);router[_0xdb24('0x5d')]('/:id/api_key',auth[_0xdb24('0xa')](),controller[_0xdb24('0x6a')]);router[_0xdb24('0x36')](_0xdb24('0x6b'),auth['isAuthenticated'](),controller[_0xdb24('0x6c')]);module[_0xdb24('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 11f495c..56a53e4 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 _0xf484=['from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','getDataValue','split','info','shortinfo','inband','auto','nonat','update','yes','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','get','isArray','wss','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','encryption','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','map','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer'];(function(_0x344e42,_0x31c2cf){var _0x3d6b58=function(_0x260db9){while(--_0x260db9){_0x344e42['push'](_0x344e42['shift']());}};_0x3d6b58(++_0x31c2cf);}(_0xf484,0x149));var _0x4f48=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf484[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4f48('0x0'));var util=require(_0x4f48('0x1'));var _=require('lodash');module[_0x4f48('0x2')]={'name':{'type':Sequelize[_0x4f48('0x3')],'allowNull':![],'unique':_0x4f48('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4f1d13){this['setDataValue'](_0x4f48('0x4'),_0x4f1d13);this[_0x4f48('0x5')](_0x4f48('0x6'),_0x4f1d13);},'comment':_0x4f48('0x7')},'fullname':{'type':Sequelize[_0x4f48('0x3')],'allowNull':![],'set':function(_0xafeac3){this[_0x4f48('0x5')](_0x4f48('0x8'),_0xafeac3);this['setDataValue'](_0x4f48('0x9'),util['format'](_0x4f48('0xa'),_0xafeac3,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0x4f48('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4a3db1){if(_0x4a3db1){this[_0x4f48('0x5')]('email',_0x4a3db1[_0x4f48('0xb')]());}}},'role':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0xd'),_0x4f48('0xe'),_0x4f48('0xf'),_0x4f48('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x4f48('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x4f48('0x3')],'defaultValue':_0x4f48('0x11')},'internal':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':![],'unique':_0x4f48('0x13'),'set':function(_0x5e5211){this[_0x4f48('0x5')](_0x4f48('0x13'),_0x5e5211);this['setDataValue'](_0x4f48('0x14'),_0x5e5211);this[_0x4f48('0x5')](_0x4f48('0x9'),util['format'](_0x4f48('0xa'),this['getDataValue'](_0x4f48('0x8')),_0x5e5211));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4f48('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x4f48('0x3')]},'zipcode':{'type':Sequelize[_0x4f48('0x3')]},'userpic':{'type':Sequelize[_0x4f48('0x3')]},'city':{'type':Sequelize[_0x4f48('0x3')]},'country':{'type':Sequelize[_0x4f48('0x3')]},'online':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x4f48('0x16')]},'voicePause':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4f48('0x3')],'defaultValue':_0x4f48('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x4f48('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![],'defaultValue':_0x4f48('0x18')},'ipaddr':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x4f48('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x19'),_0x4f48('0xe'),_0x4f48('0x1a')),'allowNull':!![],'defaultValue':_0x4f48('0x19')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4f48('0x1b')},'callingpres':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x1c'),'ALLOWED_PASSED_SCREEN',_0x4f48('0x1d'),_0x4f48('0x1e'),_0x4f48('0x1f'),_0x4f48('0x20'),_0x4f48('0x21'),_0x4f48('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![],'defaultValue':_0x4f48('0x23'),'set':function(_0x20145b){this[_0x4f48('0x5')](_0x4f48('0x24'),_0x20145b?_0x20145b['join'](','):null);},'get':function(){return this[_0x4f48('0x25')](_0x4f48('0x24'))?this[_0x4f48('0x25')](_0x4f48('0x24'))[_0x4f48('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x4f48('0xc')]('rfc2833',_0x4f48('0x27'),_0x4f48('0x28'),_0x4f48('0x29'),_0x4f48('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x4f48('0xc')]('yes','no',_0x4f48('0x2b'),_0x4f48('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![],'defaultValue':_0x4f48('0x2e'),'set':function(_0x2d4cbf){this[_0x4f48('0x5')](_0x4f48('0x2f'),_0x2d4cbf?_0x2d4cbf[_0x4f48('0x30')](','):null);},'get':function(){return this['getDataValue'](_0x4f48('0x2f'))?this['getDataValue'](_0x4f48('0x2f'))['split'](','):null;},'comment':_0x4f48('0x31')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x4f48('0x3')]},'pickupgroup':{'type':Sequelize[_0x4f48('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4f48('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4f48('0x32')},'allow':{'type':Sequelize[_0x4f48('0x3')],'allowNull':![],'defaultValue':_0x4f48('0x33'),'set':function(_0x357f1e){this[_0x4f48('0x5')](_0x4f48('0x34'),_0x357f1e?_0x357f1e[_0x4f48('0x30')](';'):_0x4f48('0x33'));},'get':function(){return this[_0x4f48('0x25')](_0x4f48('0x34'))?this[_0x4f48('0x25')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![],'set':function(_0x34e072){this['setDataValue']('insecure',_0x34e072?_0x34e072[_0x4f48('0x30')](','):null);},'get':function(){return this[_0x4f48('0x25')]('insecure')?this[_0x4f48('0x25')]('insecure')[_0x4f48('0x26')](','):null;},'comment':_0x4f48('0x35')},'trustrpid':{'type':Sequelize['ENUM'](_0x4f48('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4f48('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no',_0x4f48('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![],'defaultValue':_0x4f48('0x37')},'amaflags':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x4f48('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x4f48('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no',_0x4f48('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x4f48('0xc')]('accept',_0x4f48('0x39'),_0x4f48('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x4f48('0xc')]('uac','uas'),'allowNull':!![],'defaultValue':_0x4f48('0x3b')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x4f48('0x2d')},'keepalive':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x4f48('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x4f48('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x4f48('0xc')]('yes','no',_0x4f48('0x3c'),_0x4f48('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x3e'),_0x4f48('0x3f'),_0x4f48('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x4f48('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x4f48('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x4f48('0x2d'),'no','nonat','update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x4f48('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x4f48('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x18feff){this['setDataValue']('showWebBar',_0x18feff);var _0x5da110=this[_0x4f48('0x41')]({'plain':!![]});switch(_0x18feff){case 0x0:case 0x1:var _0x4c2327=_0x5da110['transport']?_[_0x4f48('0x42')](_0x5da110[_0x4f48('0x24')])?_0x5da110['transport'][_0x4f48('0x30')]():_0x5da110[_0x4f48('0x24')]:_0x4f48('0x23');if(_0x4c2327===_0x4f48('0x43')){_0x4c2327='udp';}this[_0x4f48('0x5')]('transport',_0x4c2327);this[_0x4f48('0x5')]('encryption','no');this[_0x4f48('0x5')](_0x4f48('0x44'),null);this[_0x4f48('0x5')](_0x4f48('0x45'),null);this[_0x4f48('0x5')](_0x4f48('0x46'),null);this[_0x4f48('0x5')](_0x4f48('0x47'),null);this['setDataValue'](_0x4f48('0x48'),null);this[_0x4f48('0x5')](_0x4f48('0x49'),null);this[_0x4f48('0x5')](_0x4f48('0x4a'),null);this[_0x4f48('0x5')](_0x4f48('0x4b'),null);this[_0x4f48('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x4f48('0x24'),'wss');this[_0x4f48('0x5')](_0x4f48('0x4c'),_0x4f48('0x2d'));this[_0x4f48('0x5')](_0x4f48('0x44'),'yes');this['setDataValue'](_0x4f48('0x45'),_0x4f48('0x2d'));this[_0x4f48('0x5')](_0x4f48('0x46'),_0x4f48('0x2d'));this['setDataValue'](_0x4f48('0x47'),'yes');this[_0x4f48('0x5')](_0x4f48('0x48'),'no');this[_0x4f48('0x5')]('dtlssetup',_0x4f48('0x40'));this[_0x4f48('0x5')](_0x4f48('0x4a'),_0x5da110[_0x4f48('0x4a')]||_0x4f48('0x4d'));this['setDataValue'](_0x4f48('0x4b'),_0x5da110[_0x4f48('0x4b')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x4f48('0x4e'),_0x4f48('0x2d'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a08d4){this[_0x4f48('0x5')](_0x4f48('0x4f'),_0x1a08d4?_0x1a08d4[_0x4f48('0x30')](','):[]);},'get':function(){return this[_0x4f48('0x25')](_0x4f48('0x4f'))?_[_0x4f48('0x50')](this[_0x4f48('0x25')](_0x4f48('0x4f'))['split'](','),function(_0x5c67b8){return parseInt(_0x5c67b8,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x4f48('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x4f48('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x4f48('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x4f48('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4f48('0xc')](_0x4f48('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x4f48('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4f48('0x25')](_0x4f48('0x51'))?this[_0x4f48('0x25')](_0x4f48('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x4f48('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x4f48('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![],'set':function(_0x29cf81){if(typeof _0x29cf81==='string'){var _0x3b0994=_0x29cf81==='1'?!![]:_0x29cf81==='0'?![]:_0x29cf81===_0x4f48('0x52')?!![]:_0x29cf81===_0x4f48('0x53')?![]:![];this[_0x4f48('0x5')](_0x4f48('0x54'),_0x3b0994);}else{this[_0x4f48('0x5')]('screenrecording',_0x29cf81);}}},'blocked':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![],'set':function(_0x5b66ba){this[_0x4f48('0x5')](_0x4f48('0x55'),_0x5b66ba);if(_0x5b66ba===!![]){this['setDataValue']('blockedAt',moment());this[_0x4f48('0x5')](_0x4f48('0x56'),0x0);}else{this['setDataValue'](_0x4f48('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x4f48('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x4f48('0x12')](0x5)[_0x4f48('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x4f48('0x12')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x4f48('0x15')],'defaultValue':![]}}; \ No newline at end of file +var _0x3ec6=['The\x20name\x20of\x20the\x20user','fullname','callerid','getDataValue','internal','email','ENUM','admin','agent','telephone','local','accountcode','format','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','TEXT','showWebBar','get','isArray','udp','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','exports','STRING','name','setDataValue','defaultuser'];(function(_0x5436ac,_0x320210){var _0x314b37=function(_0x3e85fd){while(--_0x3e85fd){_0x5436ac['push'](_0x5436ac['shift']());}};_0x314b37(++_0x320210);}(_0x3ec6,0xb3));var _0x63ec=function(_0x1a5f33,_0x3ea978){_0x1a5f33=_0x1a5f33-0x0;var _0xf552c2=_0x3ec6[_0x1a5f33];return _0xf552c2;};'use strict';var Sequelize=require(_0x63ec('0x0'));var moment=require(_0x63ec('0x1'));var util=require('util');var _=require('lodash');module[_0x63ec('0x2')]={'name':{'type':Sequelize[_0x63ec('0x3')],'allowNull':![],'unique':_0x63ec('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2246f6){this[_0x63ec('0x5')]('name',_0x2246f6);this[_0x63ec('0x5')](_0x63ec('0x6'),_0x2246f6);},'comment':_0x63ec('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3acef2){this['setDataValue'](_0x63ec('0x8'),_0x3acef2);this['setDataValue'](_0x63ec('0x9'),util['format']('\x22%s\x22\x20<%s>',_0x3acef2,this[_0x63ec('0xa')](_0x63ec('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x63ec('0x3')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x51ddda){if(_0x51ddda){this[_0x63ec('0x5')](_0x63ec('0xc'),_0x51ddda['toLowerCase']());}}},'role':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0xe'),'user',_0x63ec('0xf'),_0x63ec('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x63ec('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x63ec('0x3')],'defaultValue':_0x63ec('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x63ec('0xb'),'set':function(_0x57348b){this['setDataValue'](_0x63ec('0xb'),_0x57348b);this['setDataValue'](_0x63ec('0x12'),_0x57348b);this['setDataValue'](_0x63ec('0x9'),util[_0x63ec('0x13')](_0x63ec('0x14'),this['getDataValue'](_0x63ec('0x8')),_0x57348b));}},'salt':{'type':Sequelize[_0x63ec('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x63ec('0x3')]},'address':{'type':Sequelize[_0x63ec('0x3')]},'zipcode':{'type':Sequelize[_0x63ec('0x3')]},'userpic':{'type':Sequelize[_0x63ec('0x3')]},'city':{'type':Sequelize[_0x63ec('0x3')]},'country':{'type':Sequelize[_0x63ec('0x3')]},'online':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x63ec('0x16')]},'voicePause':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x63ec('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x63ec('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x63ec('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![],'defaultValue':_0x63ec('0x19')},'ipaddr':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x63ec('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x63ec('0xd')]('friend',_0x63ec('0x1a'),_0x63ec('0x1b')),'allowNull':!![],'defaultValue':_0x63ec('0x1c')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x1d'),_0x63ec('0x1e'),_0x63ec('0x1f'),'ALLOWED',_0x63ec('0x20'),'PROHIB_PASSED_SCREEN',_0x63ec('0x21'),_0x63ec('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x53cf56){this[_0x63ec('0x5')](_0x63ec('0x23'),_0x53cf56?_0x53cf56[_0x63ec('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x63ec('0x23'))?this[_0x63ec('0xa')](_0x63ec('0x23'))[_0x63ec('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x63ec('0x26'),_0x63ec('0x27'),_0x63ec('0x28'),_0x63ec('0x29'),_0x63ec('0x2a')),'allowNull':!![],'defaultValue':_0x63ec('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no',_0x63ec('0x2c'),'update',_0x63ec('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![],'defaultValue':_0x63ec('0x2e'),'set':function(_0x3addcc){this[_0x63ec('0x5')](_0x63ec('0x2f'),_0x3addcc?_0x3addcc[_0x63ec('0x24')](','):null);},'get':function(){return this[_0x63ec('0xa')]('nat')?this[_0x63ec('0xa')]('nat')[_0x63ec('0x25')](','):null;},'comment':_0x63ec('0x30')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x63ec('0x3')]},'pickupgroup':{'type':Sequelize[_0x63ec('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x63ec('0x3')]},'language':{'type':Sequelize[_0x63ec('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x63ec('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x63ec('0x31')},'allow':{'type':Sequelize[_0x63ec('0x3')],'allowNull':![],'defaultValue':_0x63ec('0x32'),'set':function(_0x3f9ea0){this[_0x63ec('0x5')](_0x63ec('0x33'),_0x3f9ea0?_0x3f9ea0[_0x63ec('0x24')](';'):_0x63ec('0x32'));},'get':function(){return this[_0x63ec('0xa')](_0x63ec('0x33'))?this[_0x63ec('0xa')](_0x63ec('0x33'))['split'](';'):null;},'comment':_0x63ec('0x34')},'autoframing':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![],'set':function(_0x372ec1){this[_0x63ec('0x5')]('insecure',_0x372ec1?_0x372ec1[_0x63ec('0x24')](','):null);},'get':function(){return this[_0x63ec('0xa')](_0x63ec('0x35'))?this[_0x63ec('0xa')](_0x63ec('0x35'))[_0x63ec('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x63ec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x63ec('0xd')]('yes','no',_0x63ec('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x63ec('0xd')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x63ec('0x37')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x63ec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x63ec('0x2b')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x63ec('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no',_0x63ec('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x63ec('0xd')]('accept',_0x63ec('0x39'),_0x63ec('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x3b'),_0x63ec('0x3c')),'allowNull':!![],'defaultValue':_0x63ec('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x63ec('0x2b')},'keepalive':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x63ec('0xd')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no',_0x63ec('0x3d'),_0x63ec('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x3f'),_0x63ec('0x40'),_0x63ec('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x63ec('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x63ec('0xd')](_0x63ec('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x63ec('0x2b'),'no',_0x63ec('0x2c'),_0x63ec('0x42'),_0x63ec('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x63ec('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x63ec('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x63ec('0x44')]},'showWebBar':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0,'set':function(_0x4db64a){this[_0x63ec('0x5')](_0x63ec('0x45'),_0x4db64a);var _0x4fc200=this[_0x63ec('0x46')]({'plain':!![]});switch(_0x4db64a){case 0x0:case 0x1:var _0x3a6029=_0x4fc200[_0x63ec('0x23')]?_[_0x63ec('0x47')](_0x4fc200[_0x63ec('0x23')])?_0x4fc200[_0x63ec('0x23')][_0x63ec('0x24')]():_0x4fc200[_0x63ec('0x23')]:_0x63ec('0x48');if(_0x3a6029==='wss'){_0x3a6029=_0x63ec('0x48');}this[_0x63ec('0x5')](_0x63ec('0x23'),_0x3a6029);this['setDataValue'](_0x63ec('0x49'),'no');this['setDataValue']('avpf',null);this[_0x63ec('0x5')](_0x63ec('0x4a'),null);this[_0x63ec('0x5')](_0x63ec('0x4b'),null);this[_0x63ec('0x5')](_0x63ec('0x4c'),null);this[_0x63ec('0x5')](_0x63ec('0x4d'),null);this[_0x63ec('0x5')](_0x63ec('0x4e'),null);this[_0x63ec('0x5')](_0x63ec('0x4f'),null);this[_0x63ec('0x5')](_0x63ec('0x50'),null);this['setDataValue'](_0x63ec('0x51'),'no');break;case 0x2:this[_0x63ec('0x5')](_0x63ec('0x23'),'wss');this['setDataValue']('encryption',_0x63ec('0x2b'));this[_0x63ec('0x5')]('avpf',_0x63ec('0x2b'));this['setDataValue'](_0x63ec('0x4a'),_0x63ec('0x2b'));this[_0x63ec('0x5')](_0x63ec('0x4b'),_0x63ec('0x2b'));this[_0x63ec('0x5')]('dtlsenable',_0x63ec('0x2b'));this['setDataValue'](_0x63ec('0x4d'),'no');this[_0x63ec('0x5')](_0x63ec('0x4e'),_0x63ec('0x41'));this[_0x63ec('0x5')](_0x63ec('0x4f'),_0x4fc200[_0x63ec('0x4f')]||'/etc/pki/tls/certs/motion.crt');this[_0x63ec('0x5')]('dtlsprivatekey',_0x4fc200[_0x63ec('0x50')]||'/etc/pki/tls/private/motion.key');this[_0x63ec('0x5')](_0x63ec('0x51'),_0x63ec('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0x63ec('0x44')],'set':function(_0x510d42){this[_0x63ec('0x5')](_0x63ec('0x52'),_0x510d42?_0x510d42[_0x63ec('0x24')](','):[]);},'get':function(){return this[_0x63ec('0xa')](_0x63ec('0x52'))?_[_0x63ec('0x53')](this['getDataValue'](_0x63ec('0x52'))['split'](','),function(_0x2fb2b0){return parseInt(_0x2fb2b0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x63ec('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x63ec('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x63ec('0xd')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x63ec('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x63ec('0xa')](_0x63ec('0x54'))?this[_0x63ec('0xa')](_0x63ec('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x63ec('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![],'set':function(_0x57f87d){if(typeof _0x57f87d===_0x63ec('0x55')){var _0x441abd=_0x57f87d==='1'?!![]:_0x57f87d==='0'?![]:_0x57f87d===_0x63ec('0x56')?!![]:_0x57f87d===_0x63ec('0x57')?![]:![];this[_0x63ec('0x5')](_0x63ec('0x58'),_0x441abd);}else{this['setDataValue'](_0x63ec('0x58'),_0x57f87d);}}},'blocked':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![],'set':function(_0x12db77){this['setDataValue'](_0x63ec('0x59'),_0x12db77);if(_0x12db77===!![]){this[_0x63ec('0x5')]('blockedAt',moment());this[_0x63ec('0x5')](_0x63ec('0x5a'),0x0);}else{this[_0x63ec('0x5')](_0x63ec('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0x63ec('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x63ec('0x18')](0x5)[_0x63ec('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x63ec('0x18')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x63ec('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index d2ebbaa..0a64d80 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 _0x18c1=['Tag','color','tag','getQueues','model','keys','rawAttributes','filters','intersection','fields','order','sort','pick','merge','options','Queue','Unknown\x20role','hasOwnProperty','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','LOGININPAUSE','logout','pause','QueuePause','PAUSE','updateAttributes','type','DEFAULT\x20PAUSE','bulkCreate','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','online','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','resolve','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','spread','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','Contact','dialActive','getApiKey','token','createApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','unknown','ringing','teams','queues','VoiceQueue','inbound','flatten','toString','lower','col','asc','desc','substring','uniqBy','orderBy','getRealtimeAgents','voiceStatus','unavailable','busy','slice','charAt','QueryTypes','SELECT','select','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','APIForbiddenrror','handleError','socket.io-emitter','./user.socket','register','redis','localhost','http','sendStatus','status','end','json','offset','limit','count','Content-Range','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','filter','ignore','map','value','includes','name','stack','send','User','fieldName','key','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','getOptions','where','query','includeAll','include','userSetting','true','attributes','push','findAll','openTabs','rows','length','chat','dataValues','sms','fax','whatsapp','UserSetting','openchannel','body','find','params','describe','addContacts','omit','ids','Setting','findById','securePassword','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','from','voicemail','mailbox','VoiceMail','password','permissions','102','103','113','110','104','106','107','108','109','100','114','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','telephone','isEmpty','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','updatePasswordsHistory','addQueues','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','QueueId','Queue:save','voice','interface','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','channel','remove','isArray','Queue:remove','addAvatar','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','root','server/files/images/','CHAT','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','CmList','List'];(function(_0x4a6c41,_0x2f508b){var _0x249f6a=function(_0x1204a4){while(--_0x1204a4){_0x4a6c41['push'](_0x4a6c41['shift']());}};_0x249f6a(++_0x2f508b);}(_0x18c1,0xcd));var _0x118c=function(_0x2fdd77,_0x4b4589){_0x2fdd77=_0x2fdd77-0x0;var _0x1d1dd9=_0x18c1[_0x2fdd77];return _0x1d1dd9;};'use strict';var moment=require(_0x118c('0x0'));var util=require('util');var path=require(_0x118c('0x1'));var fs=require('fs');var _=require(_0x118c('0x2'));var squel=require(_0x118c('0x3'));var Redis=require('ioredis');var jayson=require(_0x118c('0x4'));var authService=require(_0x118c('0x5'));var contacts=require(_0x118c('0x6'));var qs=require(_0x118c('0x7'));var rta=require(_0x118c('0x8'));var logger=require(_0x118c('0x9'))(_0x118c('0xa'));var utils=require(_0x118c('0xb'));var config=require(_0x118c('0xc'));var licenseUtil=require(_0x118c('0xd'));var APIBadRequestError=require(_0x118c('0xe'))[_0x118c('0xf')];var APINotFoundError=require(_0x118c('0xe'))[_0x118c('0x10')];var APIForbiddenError=require('../../errors/api')[_0x118c('0x11')];var APIHandleError=require('../../errors/api')[_0x118c('0x12')];var db=require('../../mysqldb')['db'];var socket=require(_0x118c('0x13'))(new Redis(config['redis']));require(_0x118c('0x14'))[_0x118c('0x15')](socket);config[_0x118c('0x16')]=_['defaults'](config[_0x118c('0x16')],{'host':_0x118c('0x17'),'port':0x18eb});var amiClient=jayson['client'][_0x118c('0x18')]({'port':0x232a});var values;function respondWithStatusCode(_0x202c91,_0x4b6779){_0x4b6779=_0x4b6779||0xcc;return function(_0x3d8c8c){if(_0x3d8c8c){return _0x202c91[_0x118c('0x19')](_0x4b6779);}return _0x202c91[_0x118c('0x1a')](_0x4b6779)[_0x118c('0x1b')]();};}function respondWithResult(_0x278b92,_0x5407bc){_0x5407bc=_0x5407bc||0xc8;return function(_0x563d9f){if(_0x563d9f){return _0x278b92[_0x118c('0x1a')](_0x5407bc)[_0x118c('0x1c')](_0x563d9f);}};}function respondWithFilteredResult(_0x23a186,_0x2596c4){return function(_0x2d077f){if(_0x2d077f){var _0x3bdf56=typeof _0x2596c4[_0x118c('0x1d')]==='undefined'&&typeof _0x2596c4[_0x118c('0x1e')]==='undefined';var _0x1acc1e=_0x2d077f['count'];var _0xfa8c=_0x3bdf56?0x0:_0x2596c4[_0x118c('0x1d')];var _0x3fe668=_0x3bdf56?_0x2d077f[_0x118c('0x1f')]:_0x2596c4[_0x118c('0x1d')]+_0x2596c4[_0x118c('0x1e')];var _0x1f10ac;if(_0x3fe668>=_0x1acc1e){_0x3fe668=_0x1acc1e;_0x1f10ac=0xc8;}else{_0x1f10ac=0xce;}_0x23a186['status'](_0x1f10ac);return _0x23a186['set'](_0x118c('0x20'),_0xfa8c+'-'+_0x3fe668+'/'+_0x1acc1e)[_0x118c('0x1c')](_0x2d077f);}return null;};}function respondWithRpcPromise(_0x1b351e,_0x1eddc1,_0x3b2875,_0x749d6c){return new Promise(function(_0x260c80,_0x142916){var _0x192095=_0x749d6c||amiClient;return _0x192095[_0x118c('0x21')](_0x1b351e,_0x3b2875)[_0x118c('0x22')](function(_0x200490){logger[_0x118c('0x23')](_0x118c('0x24'),_0x1eddc1,_0x118c('0x25'));logger[_0x118c('0x26')](_0x118c('0x27'),_0x1eddc1,_0x118c('0x25'),JSON['stringify'](_0x200490));if(_0x200490['error']){if(_0x200490['error'][_0x118c('0x28')]===0x1f4){logger['error'](_0x118c('0x24'),_0x1eddc1,_0x200490[_0x118c('0x29')][_0x118c('0x2a')]);return _0x142916(_0x200490[_0x118c('0x29')][_0x118c('0x2a')]);}logger[_0x118c('0x29')](_0x118c('0x24'),_0x1eddc1,_0x200490[_0x118c('0x29')][_0x118c('0x2a')]);return _0x260c80(_0x200490[_0x118c('0x29')][_0x118c('0x2a')]);}else{logger[_0x118c('0x23')](_0x118c('0x24'),_0x1eddc1,_0x118c('0x25'));_0x260c80(_0x200490[_0x118c('0x2b')][_0x118c('0x2a')]);}})[_0x118c('0x2c')](function(_0x1ac33e){logger[_0x118c('0x29')](_0x118c('0x24'),_0x1eddc1,_0x1ac33e);_0x142916(_0x1ac33e);});});}function saveUpdates(_0x267355){return function(_0x5d7df7){if(_0x5d7df7){return _0x5d7df7[_0x118c('0x2d')](_0x267355)['then'](function(_0x12d4b3){if(_0x12d4b3[_0x118c('0x2e')]===_0x118c('0x2f')){socket[_0x118c('0x30')](_0x118c('0x31')+_0x12d4b3['id'],_0x12d4b3);}return _0x12d4b3;});}return null;};}function removeEntity(_0x33bc07,_0x4854ca){return function(_0x6b46a){if(_0x6b46a){return _0x6b46a[_0x118c('0x32')]({'transaction':_0x4854ca})[_0x118c('0x22')](function(){var _0x513fc9=_0x6b46a[_0x118c('0x33')]({'plain':!![]});if(_0x513fc9['role']===_0x118c('0x34'))return;var _0x58536a=[{'name':_0x118c('0x35'),'value':_0x118c('0x36'),'ignore':!![]},{'name':_0x118c('0x37'),'value':_0x118c('0x2f'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x267e65=_(_0x58536a)[_0x118c('0x38')](_0x118c('0x39'))[_0x118c('0x3a')](_0x118c('0x3b'))[_0x118c('0x3b')]();if(_[_0x118c('0x3c')](_0x267e65,_0x513fc9[_0x118c('0x2e')])){return;}var _0x4fe4a2=_['find'](_0x58536a,[_0x118c('0x3b'),_0x513fc9[_0x118c('0x2e')]])[_0x118c('0x3d')];return db['UserProfileResource'][_0x118c('0x32')]({'where':{'type':_0x4fe4a2,'resourceId':_0x513fc9['id']},'transaction':_0x4854ca})['then'](function(){return _0x6b46a;});})['then'](function(){_0x33bc07[_0x118c('0x1a')](0xcc)[_0x118c('0x1b')]();});}};}function handleEntityNotFound(_0x11ffba){return function(_0x1b3ee5){if(!_0x1b3ee5){_0x11ffba[_0x118c('0x19')](0x194);}return _0x1b3ee5;};}function handleError(_0x248a0d,_0x5cbda3){_0x5cbda3=_0x5cbda3||0x1f4;return function(_0x569650){logger['error'](_0x569650[_0x118c('0x3e')]);if(_0x569650['name']){delete _0x569650[_0x118c('0x3d')];}_0x248a0d[_0x118c('0x1a')](_0x5cbda3)[_0x118c('0x3f')](_0x569650);};}function getUserAttributes(){return _(db[_0x118c('0x40')]['rawAttributes'])[_0x118c('0x3a')](function(_0x2a78a1){return{'name':_0x2a78a1[_0x118c('0x41')],'type':_0x2a78a1['type'][_0x118c('0x42')]};})['filter'](function(_0x566b64){return!['password',_0x118c('0x43'),_0x118c('0x44'),_0x118c('0x45'),_0x118c('0x46'),_0x118c('0x47')][_0x118c('0x3c')](_0x566b64['name']);})['value']();}exports[_0x118c('0x48')]=function(_0x561814,_0x3d9129){var _0xc53cf8={},_0x453659={'count':0x0,'rows':[]};var _0x17cf15=getUserAttributes();_0xc53cf8=qs[_0x118c('0x49')](_0x17cf15,_0x561814);var _0x5f354e={'where':_0xc53cf8[_0x118c('0x4a')]};return db[_0x118c('0x40')]['count'](_0x5f354e)['then'](function(_0x501fcf){_0x453659[_0x118c('0x1f')]=_0x501fcf;if(_0x561814[_0x118c('0x4b')][_0x118c('0x4c')]){_0xc53cf8[_0x118c('0x4d')]=[{'all':!![]}];}if(_0x561814[_0x118c('0x4b')][_0x118c('0x4e')]===_0x118c('0x4f')){_0xc53cf8[_0x118c('0x4d')]=[{'model':db['UserSetting'],'as':_0x118c('0x4e')}];}if(!_[_0x118c('0x3c')](_0xc53cf8['attributes'],'id')){_0xc53cf8[_0x118c('0x50')][_0x118c('0x51')]('id');}return db['User'][_0x118c('0x52')](_0xc53cf8);})['then'](function(_0x9d1713){_0x453659['rows']=_0x9d1713;if(_0x561814[_0x118c('0x4b')][_0x118c('0x53')]===_0x118c('0x4f')){var _0x2d79ae=[];for(var _0x2ee0c6=0x0;_0x2ee0c6<_0x453659[_0x118c('0x54')][_0x118c('0x55')];_0x2ee0c6++){_0x2d79ae[_0x118c('0x51')](get_open_tabs(_0x118c('0x56'),_0x453659['rows'][_0x2ee0c6][_0x118c('0x57')]));_0x2d79ae['push'](get_open_tabs(_0x118c('0x58'),_0x453659[_0x118c('0x54')][_0x2ee0c6][_0x118c('0x57')]));_0x2d79ae[_0x118c('0x51')](get_open_tabs(_0x118c('0x59'),_0x453659[_0x118c('0x54')][_0x2ee0c6][_0x118c('0x57')]));_0x2d79ae['push'](get_open_tabs('mail',_0x453659['rows'][_0x2ee0c6][_0x118c('0x57')]));_0x2d79ae[_0x118c('0x51')](get_open_tabs('openchannel',_0x453659[_0x118c('0x54')][_0x2ee0c6][_0x118c('0x57')]));_0x2d79ae['push'](get_open_tabs(_0x118c('0x5a'),_0x453659['rows'][_0x2ee0c6][_0x118c('0x57')]));}return Promise['all'](_0x2d79ae)[_0x118c('0x22')](function(){return _0x453659;});}else{return _0x453659;}})[_0x118c('0x22')](respondWithFilteredResult(_0x3d9129,_0xc53cf8))[_0x118c('0x2c')](handleError(_0x3d9129,null));};exports['show']=function(_0x227d93,_0x42c3fa){var _0x3f29b1=getUserAttributes();_0x227d93[_0x118c('0x4b')]['id']=_0x227d93['params']['id'];var _0x424cc0=qs[_0x118c('0x49')](_0x3f29b1,_0x227d93);if(_0x227d93[_0x118c('0x4b')][_0x118c('0x4c')]){_0x424cc0[_0x118c('0x4d')]=[{'all':!![]}];}if(_0x227d93[_0x118c('0x4b')]['userSetting']==='true'){_0x424cc0[_0x118c('0x4d')]=[{'model':db[_0x118c('0x5b')],'as':_0x118c('0x4e')}];}_0x424cc0=_['merge']({},_0x424cc0,_0x227d93['options']);if(!_[_0x118c('0x3c')](_0x424cc0[_0x118c('0x50')],'id')){_0x424cc0[_0x118c('0x50')][_0x118c('0x51')]('id');}return db['User']['find'](_0x424cc0)[_0x118c('0x22')](handleEntityNotFound(_0x42c3fa,null))[_0x118c('0x22')](function(_0x26d5ac){var _0x226184=[];values=_0x26d5ac;if(_0x227d93['query'][_0x118c('0x53')]==='true'){_0x226184[_0x118c('0x51')](get_open_tabs('chat',_0x26d5ac[_0x118c('0x57')]));_0x226184[_0x118c('0x51')](get_open_tabs(_0x118c('0x58'),_0x26d5ac[_0x118c('0x57')]));_0x226184[_0x118c('0x51')](get_open_tabs(_0x118c('0x5c'),_0x26d5ac[_0x118c('0x57')]));_0x226184[_0x118c('0x51')](get_open_tabs('whatsapp',_0x26d5ac[_0x118c('0x57')]));_0x226184[_0x118c('0x51')](get_open_tabs('fax',_0x26d5ac[_0x118c('0x57')]));_0x226184[_0x118c('0x51')](get_open_tabs('mail',_0x26d5ac['dataValues']));return Promise['all'](_0x226184);}else{return values;}})['then'](function(){return values;})[_0x118c('0x22')](respondWithResult(_0x42c3fa,null))['catch'](handleError(_0x42c3fa,null));};exports['update']=function(_0x4fde81,_0x138563){if(_0x4fde81[_0x118c('0x5d')]['id']){delete _0x4fde81['body']['id'];}delete _0x4fde81[_0x118c('0x5d')]['role'];return db[_0x118c('0x40')][_0x118c('0x5e')]({'where':{'id':_0x4fde81[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x138563,null))[_0x118c('0x22')](saveUpdates(_0x4fde81[_0x118c('0x5d')],null))['then'](respondWithResult(_0x138563,null))['catch'](handleError(_0x138563,null));};exports[_0x118c('0x60')]=function(_0x51230f,_0x42e734){return db[_0x118c('0x40')][_0x118c('0x60')]()[_0x118c('0x22')](respondWithResult(_0x42e734,null))['catch'](handleError(_0x42e734,null));};exports[_0x118c('0x61')]=function(_0x1c4bf5,_0x2e7db5){return db[_0x118c('0x40')]['find']({'where':{'id':_0x1c4bf5[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x2e7db5,null))[_0x118c('0x22')](function(_0x173958){if(_0x173958){return _0x173958[_0x118c('0x61')](_0x1c4bf5[_0x118c('0x5d')]['ids'],_[_0x118c('0x62')](_0x1c4bf5[_0x118c('0x5d')],[_0x118c('0x63'),'id'])||{});}})[_0x118c('0x22')](respondWithResult(_0x2e7db5,null))['catch'](handleError(_0x2e7db5,null));};function validateUser(_0x315604){return new Promise(function(_0x392602,_0x2797ca){if(_0x315604['internal'])return _0x392602(_0x315604);return db[_0x118c('0x64')][_0x118c('0x65')](0x1)[_0x118c('0x22')](function(_0x3bb494){if(_0x3bb494[_0x118c('0x66')])authService['validatePasswordPattern'](_0x315604['password']);db[_0x118c('0x40')]['max'](_0x118c('0x67'))[_0x118c('0x22')](function(_0x21e4af){if(_[_0x118c('0x68')](_0x21e4af)){_0x315604[_0x118c('0x67')]=_0x3bb494[_0x118c('0x69')]||0x1;return;}if(_[_0x118c('0x68')](_0x3bb494['min_internal'])||_0x3bb494[_0x118c('0x69')]===_0x21e4af){_0x315604[_0x118c('0x67')]=_0x21e4af+0x1;return;}if(_0x3bb494[_0x118c('0x69')]>_0x21e4af){_0x315604['internal']=_0x3bb494[_0x118c('0x69')];return;}return db[_0x118c('0x6a')][_0x118c('0x4b')](_0x118c('0x6b'),{'type':db[_0x118c('0x6a')]['QueryTypes']['SELECT']})['then'](function(_0x527abd){if(_0x527abd&&_0x527abd[_0x118c('0x55')]){for(var _0x35f084=0x0,_0xa39aaa=_0x527abd[_0x118c('0x55')];_0x35f084<_0xa39aaa&&_[_0x118c('0x68')](_0x315604[_0x118c('0x67')]);_0x35f084++){if(_0x3bb494['min_internal']<=_0x527abd[_0x35f084]['from']){_0x315604['internal']=_0x527abd[_0x35f084]['from'];}else if(_0x3bb494[_0x118c('0x69')]>_0x527abd[_0x35f084][_0x118c('0x6c')]&&_0x3bb494[_0x118c('0x69')]<=_0x527abd[_0x35f084]['to']){_0x315604[_0x118c('0x67')]=_0x3bb494['min_internal'];}}}if(_[_0x118c('0x68')](_0x315604['internal'])){_0x315604[_0x118c('0x67')]=_0x21e4af+0x1;}return _0x392602(_0x315604);});});})['catch'](function(_0x43f4d7){_0x2797ca(_0x43f4d7);});});}function updateUser(_0x42136d){return new Promise(function(_0x37111a,_0x1ed5cd){try{if(_0x42136d[_0x118c('0x6d')]){_0x42136d[_0x118c('0x6e')]=_0x42136d[_0x118c('0x67')];_0x42136d[_0x118c('0x6f')]={'mailbox':_0x42136d[_0x118c('0x67')],'password':_0x42136d[_0x118c('0x70')],'fullname':_0x42136d['fullname'],'email':_0x42136d['email']};}if(_0x42136d[_0x118c('0x2e')]===_0x118c('0x2f')){if(!_0x42136d[_0x118c('0x71')])_0x42136d[_0x118c('0x71')]=['101',_0x118c('0x72'),_0x118c('0x73'),_0x118c('0x74'),_0x118c('0x75'),_0x118c('0x76'),'105',_0x118c('0x77'),_0x118c('0x78'),_0x118c('0x79'),_0x118c('0x7a'),_0x118c('0x7b'),'111',_0x118c('0x7c'),'115'];}_0x37111a(_0x42136d);}catch(_0x4f2e35){_0x1ed5cd(_0x4f2e35);}});}exports[_0x118c('0x7d')]=function(_0x591216,_0x2f580e){if(_0x591216[_0x118c('0x36')]['role']===_0x118c('0x2f'))throw new Error(_0x118c('0x7e'));if(_0x591216[_0x118c('0x5d')][_0x118c('0x2e')]==='user'&&_0x591216['user'][_0x118c('0x2e')]!==_0x118c('0x34')){throw new Error(_0x118c('0x7f'));}if(_0x591216[_0x118c('0x5d')][_0x118c('0x2e')]===_0x118c('0x34')&&_0x591216[_0x118c('0x36')][_0x118c('0x2e')]!==_0x118c('0x34')){throw new Error(_0x118c('0x80'));}return licenseUtil[_0x118c('0x81')]([_0x591216['body']])['then'](function(){return validateUser(_0x591216[_0x118c('0x5d')]);})[_0x118c('0x22')](function(_0x5d9891){return updateUser(_0x5d9891)['then'](function(_0x5a42d2){if(_0x5a42d2['role']===_0x118c('0x34')){_0x5a42d2[_0x118c('0x82')]=_0x591216[_0x118c('0x36')][_0x118c('0x82')];delete _0x5a42d2[_0x118c('0x83')];}return _0x5a42d2;});})[_0x118c('0x22')](function(_0x2a61c0){return db[_0x118c('0x40')]['create'](_0x2a61c0,{'include':[{'model':db['VoiceMail'],'as':_0x118c('0x6f')}]});})[_0x118c('0x22')](function(_0xb5be79){if(_0x591216[_0x118c('0x5d')][_0x118c('0x2e')]==='user')return _0xb5be79;if(_0x591216[_0x118c('0x36')][_0x118c('0x2e')]!==_0x118c('0x36'))return _0xb5be79;return db[_0x118c('0x84')]['find']({'where':{'name':_0xb5be79[_0x118c('0x2e')]===_0x118c('0x2f')?'Agents':_0x118c('0x85'),'userProfileId':_0x591216[_0x118c('0x36')][_0x118c('0x83')]},'raw':!![]})[_0x118c('0x22')](function(_0x4b24c7){if(!_0x4b24c7||_0x4b24c7[_0x118c('0x86')]!=0x0)return _0xb5be79;return db['UserProfileResource']['create']({'name':_0xb5be79[_0x118c('0x3d')],'resourceId':_0xb5be79['id'],'type':_0x4b24c7[_0x118c('0x3d')],'sectionId':_0x4b24c7['id']},{})[_0x118c('0x22')](function(){return _0xb5be79;});})[_0x118c('0x2c')](function(_0x243c14){logger[_0x118c('0x29')](_0x118c('0x87'),_0x243c14);throw _0x243c14;});})[_0x118c('0x22')](respondWithResult(_0x2f580e,0xc9))[_0x118c('0x2c')](handleError(_0x2f580e,null));};exports['bulkCreate']=function(_0x4b4e1e,_0x494c41){var _0xdca1a9=_0x4b4e1e[_0x118c('0x5d')];var _0x19185c=[];if(_0x4b4e1e[_0x118c('0x36')][_0x118c('0x2e')]==='agent')throw new Error(_0x118c('0x7e'));if(_[_0x118c('0x88')](_0xdca1a9,[_0x118c('0x2e'),_0x118c('0x36')])&&_0x4b4e1e[_0x118c('0x36')][_0x118c('0x2e')]!==_0x118c('0x34')){throw new Error(_0x118c('0x7f'));}if(_[_0x118c('0x88')](_0xdca1a9,[_0x118c('0x2e'),_0x118c('0x34')])&&_0x4b4e1e['user'][_0x118c('0x2e')]!=='admin'){throw new Error(_0x118c('0x89'));}return licenseUtil[_0x118c('0x81')](_0xdca1a9)[_0x118c('0x22')](function(){return validateUser(_0xdca1a9[0x0]);})['then'](function(){for(var _0x42f434=0x1;_0x42f434<_0xdca1a9['length'];_0x42f434++){var _0x431772=_0xdca1a9[_0x42f434-0x1]['internal'];if(!_0xdca1a9[_0x42f434][_0x118c('0x67')])_0xdca1a9[_0x42f434][_0x118c('0x67')]=_0x431772+0x1;_0x19185c['push'](validateUser(_0xdca1a9[_0x42f434]));}return Promise['all'](_0x19185c);})[_0x118c('0x22')](function(){_0x19185c=[];for(var _0x3fceb7=0x0;_0x3fceb7<_0xdca1a9[_0x118c('0x55')];_0x3fceb7++){_0x19185c[_0x118c('0x51')](updateUser(_0xdca1a9[_0x3fceb7]));}return Promise[_0x118c('0x8a')](_0x19185c);})[_0x118c('0x22')](function(){_0x19185c=_0xdca1a9[_0x118c('0x3a')](function(_0x363c01){return db['User'][_0x118c('0x7d')](_0x363c01,{'include':[{'model':db[_0x118c('0x6f')],'as':'VoiceMail'}]})['then'](function(_0x555034){_0x363c01['id']=_0x555034['id'];return _0x363c01;});});return Promise['all'](_0x19185c);})[_0x118c('0x22')](function(_0x2bcec4){if(_0x4b4e1e[_0x118c('0x5d')]['role']===_0x118c('0x36'))return _0x2bcec4;if(_0x4b4e1e[_0x118c('0x36')]['role']!=='user')return _0x2bcec4;var _0x554fdc=_[_0x118c('0x88')](_0x2bcec4,function(_0x3bfffd){return _0x3bfffd[_0x118c('0x2e')]===_0x118c('0x2f')||_0x3bfffd['role']===_0x118c('0x8b');});if(!_0x554fdc)return _0x2bcec4;return db['UserProfileSection'][_0x118c('0x52')]({'where':{'name':{'$or':[_0x118c('0x37'),_0x118c('0x85')]},'userProfileId':_0x4b4e1e[_0x118c('0x36')][_0x118c('0x83')]},'raw':!![]})[_0x118c('0x22')](function(_0x20e66e){if(_[_0x118c('0x8c')](_0x20e66e)||!_['some'](_0x20e66e,[_0x118c('0x86'),0x0]))return _0x2bcec4;_0x19185c=[];var _0x593f14=_(_0x20e66e)['map'](function(_0x110500){if(_0x110500[_0x118c('0x86')]===0x1)return;return _0x110500[_0x118c('0x3d')]==='Agents'?'agent':_0x118c('0x8b');})['compact']()[_0x118c('0x3b')]();for(var _0x5da634=0x0;_0x5da634<_0x2bcec4[_0x118c('0x55')];_0x5da634++){if(!_[_0x118c('0x3c')](_0x593f14,_0x2bcec4[_0x5da634][_0x118c('0x2e')]))return;var _0x193ee4=_0x2bcec4[_0x5da634][_0x118c('0x2e')]===_0x118c('0x2f')?_0x118c('0x37'):_0x118c('0x85');_0x19185c[_0x118c('0x51')](db['UserProfileResource'][_0x118c('0x7d')]({'name':_0x2bcec4[_0x5da634][_0x118c('0x3d')],'resourceId':_0x2bcec4[_0x5da634]['id'],'type':_0x193ee4,'sectionId':_['find'](_0x20e66e,[_0x118c('0x3d'),_0x193ee4])['id']},{}));}return Promise[_0x118c('0x8a')](_0x19185c);});})[_0x118c('0x22')](respondWithResult(_0x494c41,0xc9))['catch'](handleError(_0x494c41,null));};exports[_0x118c('0x8d')]=function(_0x219335,_0x2a47ae){if(_0x219335[_0x118c('0x5d')]['id']){delete _0x219335[_0x118c('0x5d')]['id'];}return db[_0x118c('0x40')][_0x118c('0x5e')]({'where':{'id':_0x219335['params']['id']}})[_0x118c('0x22')](function(_0x387efd){if(!_0x387efd)return null;if(_0x387efd['id']===_0x219335[_0x118c('0x36')]['id']){if(!_0x219335[_0x118c('0x5d')][_0x118c('0x8e')]||!_0x219335[_0x118c('0x5d')][_0x118c('0x8f')]){throw new db['Sequelize'][(_0x118c('0x90'))](_0x118c('0x91'));}if(!_0x387efd[_0x118c('0x92')](_0x219335[_0x118c('0x5d')]['oldPassword'])){throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))](_0x118c('0x94'));}if(_0x219335[_0x118c('0x5d')][_0x118c('0x8e')]===_0x219335[_0x118c('0x5d')][_0x118c('0x8f')]){throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))](_0x118c('0x95'));}}else if(_0x219335[_0x118c('0x36')][_0x118c('0x2e')]===_0x118c('0x34')){if(!_0x219335[_0x118c('0x5d')][_0x118c('0x8f')]){throw new db['Sequelize'][(_0x118c('0x90'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x219335[_0x118c('0x36')]['role']===_0x118c('0x36')){if(!_0x219335[_0x118c('0x5d')][_0x118c('0x8f')]){throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))](_0x118c('0x96'));}if(_0x387efd[_0x118c('0x2e')]!==_0x118c('0x2f')){throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))](_0x118c('0x7e'));}}else{throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))]('Unauthorized');}return _0x387efd;})[_0x118c('0x22')](handleEntityNotFound(_0x2a47ae,null))[_0x118c('0x22')](function(_0x30282c){return db[_0x118c('0x64')][_0x118c('0x97')]({'attributes':['id',_0x118c('0x66'),_0x118c('0x98'),_0x118c('0x99')]})['then'](function(_0x5ddab2){if(_0x5ddab2[_0x118c('0x66')])authService[_0x118c('0x9a')](_0x219335['body'][_0x118c('0x8f')]);if(!_0x5ddab2['enforcePasswordHistory']||!_0x30282c[_0x118c('0x44')])return _0x30282c;authService[_0x118c('0x9b')](_0x219335[_0x118c('0x5d')][_0x118c('0x8f')],_0x30282c[_0x118c('0x44')],_0x5ddab2['passwordHistoryLimit']);return _0x30282c;})[_0x118c('0x22')](saveUpdates({'password':_0x219335[_0x118c('0x5d')]['newPassword'],'passwordResetAt':_0x219335[_0x118c('0x36')]['id']==_0x219335[_0x118c('0x5f')]['id']?moment():null,'previousPasswords':authService[_0x118c('0x9c')](_0x219335[_0x118c('0x5d')][_0x118c('0x8f')],_0x30282c[_0x118c('0x44')])},null));})[_0x118c('0x22')](respondWithResult(_0x2a47ae,null))['catch'](handleError(_0x2a47ae,null));};exports[_0x118c('0x9d')]=function(_0x1b866f,_0x26e966){var _0x2cd8f9=_0x1b866f[_0x118c('0x5d')]['channel'];return db[_0x118c('0x40')]['find']({'where':{'id':_0x1b866f[_0x118c('0x5f')]['id']},'attributes':['id','name',_0x118c('0x2e'),'online',_0x118c('0x9e'),_0x118c('0x9f'),'interface']})['then'](handleEntityNotFound(_0x26e966,null))['then'](function(_0x5ece1a){if(_0x5ece1a){if(!utils[_0x118c('0xa0')](_0x2cd8f9)){throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))](_0x118c('0xa1'));}return _0x5ece1a[_0x118c('0xa2')+_[_0x118c('0xa3')](_0x2cd8f9[_0x118c('0xa4')]())+_0x118c('0xa5')](_0x1b866f[_0x118c('0x5d')]['ids'],{'penalty':_0x1b866f['body']['penalty']||0x0})['spread'](function(_0x514f07){for(var _0x5692fd=0x0;_0x5692fd<_0x1b866f['body'][_0x118c('0x63')][_0x118c('0x55')];_0x5692fd+=0x1){var _0x654965={'UserId':Number(_0x1b866f[_0x118c('0x5f')]['id'])};_0x654965[_[_0x118c('0xa3')](_0x2cd8f9[_0x118c('0xa4')]())+_0x118c('0xa6')]=Number(_0x1b866f[_0x118c('0x5d')][_0x118c('0x63')][_0x5692fd]);socket[_0x118c('0x30')](_0x118c('0x36')+_[_0x118c('0xa3')](_0x2cd8f9['toLowerCase']())+_0x118c('0xa7'),_0x654965);}return _0x514f07;})[_0x118c('0x22')](function(){if(_0x2cd8f9===_0x118c('0xa8')){return db['VoiceQueue'][_0x118c('0x52')]({'where':{'id':_0x1b866f['body']['ids']||[]},'raw':!![],'attributes':['id',_0x118c('0x3d')]});}})[_0x118c('0x22')](function(_0x49100a){var _0x1ab5d7=_0x5ece1a[_0x118c('0x33')]({'plain':!![]});var _0x490e7f=[];if(_0x2cd8f9===_0x118c('0xa8')&&_0x1ab5d7[_0x118c('0x2e')]==='agent'&&_0x1ab5d7['online']){for(let _0x283b25=0x0;_0x283b25<_0x49100a[_0x118c('0x55')];_0x283b25+=0x1){_0x490e7f[_0x118c('0x51')]({'membername':_0x1ab5d7[_0x118c('0x3d')],'UserId':_0x1ab5d7['id'],'queue_name':_0x49100a[_0x283b25][_0x118c('0x3d')],'VoiceQueueId':_0x49100a[_0x283b25]['id'],'interface':_[_0x118c('0x68')](_0x1ab5d7[_0x118c('0xa9')])?util[_0x118c('0xaa')](_0x118c('0xab'),_0x1ab5d7['name']):_0x1ab5d7[_0x118c('0xa9')],'paused':_0x1ab5d7[_0x118c('0x9f')]||![],'penalty':_0x1b866f[_0x118c('0x5d')][_0x118c('0xac')]||0x0});}return Promise[_0x118c('0x8a')](_0x490e7f[_0x118c('0x3a')](function(_0x7283e1){return db[_0x118c('0xad')][_0x118c('0xae')](_0x7283e1);}));}return _0x5ece1a;});}})['then'](respondWithStatusCode(_0x26e966,null))[_0x118c('0x2c')](handleError(_0x26e966,null));};exports['removeQueues']=function(_0x6f9b36,_0x5648da){var _0x5c3f48,_0x5d114a;return db[_0x118c('0x40')][_0x118c('0x5e')]({'where':{'id':_0x6f9b36[_0x118c('0x5f')]['id']},'attributes':['id',_0x118c('0x3d'),_0x118c('0x2e')]})[_0x118c('0x22')](handleEntityNotFound(_0x5648da,null))[_0x118c('0x22')](function(_0x1454b6){if(_0x1454b6){_0x5c3f48=_0x1454b6;if(!_0x6f9b36[_0x118c('0x4b')][_0x118c('0xaf')]||!utils['isValidChannel'](_0x6f9b36['query'][_0x118c('0xaf')])){throw new db['Sequelize'][(_0x118c('0x90'))]('Unknown\x20channel');}return _0x1454b6[_0x118c('0xb0')+_['capitalize'](_0x6f9b36['query']['channel']['toLowerCase']())+_0x118c('0xa5')](_0x6f9b36[_0x118c('0x4b')]['ids']);}})[_0x118c('0x22')](function(_0x31b469){if(_[_0x118c('0xb1')](_0x6f9b36[_0x118c('0x4b')][_0x118c('0x63')])){for(var _0x525ba3=0x0;_0x525ba3<_0x6f9b36['query'][_0x118c('0x63')][_0x118c('0x55')];_0x525ba3+=0x1){_0x5d114a={'UserId':Number(_0x6f9b36['params']['id'])};_0x5d114a[_['capitalize'](_0x6f9b36['query']['channel'][_0x118c('0xa4')]())+_0x118c('0xa6')]=Number(_0x6f9b36[_0x118c('0x4b')][_0x118c('0x63')][_0x525ba3]);socket[_0x118c('0x30')]('user'+_[_0x118c('0xa3')](_0x6f9b36[_0x118c('0x4b')][_0x118c('0xaf')][_0x118c('0xa4')]())+_0x118c('0xb2'),_0x5d114a);}}else{_0x5d114a={'UserId':Number(_0x6f9b36['params']['id'])};_0x5d114a[_[_0x118c('0xa3')](_0x6f9b36[_0x118c('0x4b')][_0x118c('0xaf')]['toLowerCase']())+_0x118c('0xa6')]=Number(_0x6f9b36[_0x118c('0x4b')]['ids']);socket[_0x118c('0x30')]('user'+_['capitalize'](_0x6f9b36[_0x118c('0x4b')][_0x118c('0xaf')][_0x118c('0xa4')]())+_0x118c('0xb2'),_0x5d114a);}return _0x31b469;})[_0x118c('0x22')](function(){if(_0x6f9b36[_0x118c('0x4b')][_0x118c('0xaf')]==='voice'){return db[_0x118c('0xad')][_0x118c('0x32')]({'where':{'UserId':_0x6f9b36[_0x118c('0x5f')]['id'],'VoiceQueueId':_0x6f9b36[_0x118c('0x4b')][_0x118c('0x63')]},'individualHooks':!![]})[_0x118c('0x22')](function(){return _0x5c3f48;});}return _0x5c3f48;})[_0x118c('0x22')](respondWithStatusCode(_0x5648da,null))[_0x118c('0x2c')](handleError(_0x5648da,null));};exports[_0x118c('0xb3')]=function(_0x4bef14,_0x54362c){_0x4bef14['body']['userpic']=_0x4bef14[_0x118c('0xb4')][_0x118c('0xb5')];return db[_0x118c('0x40')][_0x118c('0x5e')]({'where':{'id':_0x4bef14[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x54362c,null))['then'](saveUpdates(_0x4bef14[_0x118c('0x5d')],null))[_0x118c('0x22')](respondWithResult(_0x54362c,null))['catch'](handleError(_0x54362c,null));};exports[_0x118c('0xb6')]=function(_0x4f67d1,_0x53b699){var _0x5bde59=path[_0x118c('0xb7')](config['root'],_0x118c('0xb8'));return db[_0x118c('0x40')][_0x118c('0x5e')]({'where':{'id':_0x4f67d1[_0x118c('0x5f')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x53b699,null))[_0x118c('0x22')](function(_0x3387be){if(_0x3387be){if(_['isNil'](_0x3387be[_0x118c('0xb9')])){return _0x53b699[_0x118c('0xba')](_0x5bde59);}else{if(!fs['existsSync'](path[_0x118c('0xb7')](config[_0x118c('0xbb')],_0x118c('0xbc'),_0x3387be[_0x118c('0xb9')]))){return _0x53b699['download'](_0x5bde59);}return _0x53b699[_0x118c('0xba')](path[_0x118c('0xb7')](config[_0x118c('0xbb')],_0x118c('0xbc'),_0x3387be['userpic']));}}})['catch'](handleError(_0x53b699,null));};exports['getOpenTabs']=function(_0x561d3b,_0x4ddfda){return db[_0x118c('0x40')]['find']({'where':{'id':_0x561d3b[_0x118c('0x5f')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4ddfda,null))[_0x118c('0x22')](function(_0x3058fe){var _0x3f46cf=[];values=_0x3058fe[_0x118c('0x57')];_0x3f46cf[_0x118c('0x51')](get_open_tabs(_0x118c('0x56'),_0x3058fe[_0x118c('0x57')]));_0x3f46cf[_0x118c('0x51')](get_open_tabs(_0x118c('0x58'),_0x3058fe[_0x118c('0x57')]));_0x3f46cf[_0x118c('0x51')](get_open_tabs(_0x118c('0x5c'),_0x3058fe[_0x118c('0x57')]));_0x3f46cf['push'](get_open_tabs(_0x118c('0x5a'),_0x3058fe[_0x118c('0x57')]));_0x3f46cf['push'](get_open_tabs('fax',_0x3058fe['dataValues']));_0x3f46cf[_0x118c('0x51')](get_open_tabs('mail',_0x3058fe[_0x118c('0x57')]));return Promise[_0x118c('0x8a')](_0x3f46cf);})['then'](function(_0x5eaadb){if(_0x5eaadb){var _0x3f1995=_[_0x118c('0x3a')](values['ChatOpenTabs'],function(_0x8d24b5){return{'channel':_0x118c('0xbd'),'id':_0x8d24b5['id'],'createdAt':_0x8d24b5[_0x118c('0xbe')]};});var _0xdd4814=_[_0x118c('0x3a')](values['FaxOpenTabs'],function(_0x50ac07){return{'channel':'FAX','id':_0x50ac07['id'],'createdAt':_0x50ac07[_0x118c('0xbe')]};});var _0x2ecf72=_['map'](values[_0x118c('0xbf')],function(_0x28d549){return{'channel':_0x118c('0xc0'),'id':_0x28d549['id'],'createdAt':_0x28d549[_0x118c('0xbe')]};});var _0x1a283e=_[_0x118c('0x3a')](values[_0x118c('0xc1')],function(_0x50ef02){return{'channel':'MAIL','id':_0x50ef02['id'],'createdAt':_0x50ef02[_0x118c('0xbe')]};});var _0x4c4be1=_['map'](values['SmsOpenTabs'],function(_0x1149f8){return{'channel':_0x118c('0xc2'),'id':_0x1149f8['id'],'createdAt':_0x1149f8['createdAt']};});var _0x4e243a=_[_0x118c('0x3a')](values[_0x118c('0xc3')],function(_0x48c042){return{'channel':_0x118c('0xc4'),'id':_0x48c042['id'],'createdAt':_0x48c042['createdAt']};});var _0x5ace96=_[_0x118c('0xc5')](_0x3f1995,_0xdd4814,_0x2ecf72,_0x1a283e,_0x4c4be1,_0x4e243a);var _0x4b8c03={'count':_0x5ace96[_0x118c('0x55')],'rows':_0x5ace96};return _0x4b8c03;}else return null;})[_0x118c('0x22')](respondWithResult(_0x4ddfda,null))[_0x118c('0x2c')](handleError(_0x4ddfda,null));};exports[_0x118c('0xc6')]=function(_0x30c301,_0x233f2a){var _0x21a035={};return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x30c301[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](function(_0x45a562){if(!_0x45a562){throw new APINotFoundError(util[_0x118c('0xaa')](_0x118c('0xc7'),_0x30c301[_0x118c('0x5f')]['id']));}return contacts[_0x118c('0x60')]();})[_0x118c('0x22')](function(_0x161926){_0x30c301['query']['User']=_0x30c301[_0x118c('0x5f')]['id'];_0x21a035=qs['getOptions'](_0x161926,_0x30c301);if(_0x30c301[_0x118c('0x4b')]['hasOwnProperty'](_0x118c('0x4c'))){_0x21a035[_0x118c('0x4d')]=[{'model':db[_0x118c('0xc8')],'as':_0x118c('0xc9'),'required':![]},{'model':db[_0x118c('0xca')],'as':'Tags','attributes':['id','name',_0x118c('0xcb')],'where':_0x30c301[_0x118c('0x4b')][_0x118c('0xcc')]?{'id':_0x30c301[_0x118c('0x4b')][_0x118c('0xcc')]}:undefined,'required':_0x30c301[_0x118c('0x4b')][_0x118c('0xcc')]?!![]:![]}];}return contacts['findAll'](_0x30c301['query'],_0x30c301[_0x118c('0x36')],_0x21a035,_0x161926);})[_0x118c('0x22')](respondWithFilteredResult(_0x233f2a,_0x21a035))[_0x118c('0x2c')](APIHandleError(_0x233f2a));};exports[_0x118c('0xcd')]=function(_0x3a378d,_0x1897eb){var _0x59327d;var _0x39c57e={};var _0x1d8609;return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x3a378d['params']['id']},'attributes':['id','name',_0x118c('0x2e')]})[_0x118c('0x22')](handleEntityNotFound(_0x1897eb,null))[_0x118c('0x22')](function(_0x303009){if(!utils[_0x118c('0xa0')](_0x3a378d['query'][_0x118c('0xaf')])){throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))](_0x118c('0xa1'));}_0x59327d=_0x303009;var _0x52e2ee={};_0x52e2ee[_0x118c('0xce')]=_[_0x118c('0xcf')](db[_[_0x118c('0xa3')](_0x3a378d[_0x118c('0x4b')][_0x118c('0xaf')])+'Queue'][_0x118c('0xd0')]);_0x52e2ee[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0x3a378d[_0x118c('0x4b')]);_0x52e2ee[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x52e2ee[_0x118c('0xce')],_0x52e2ee[_0x118c('0x4b')]);_0x39c57e[_0x118c('0x50')]=_['intersection'](_0x52e2ee[_0x118c('0xce')],qs['fields'](_0x3a378d[_0x118c('0x4b')][_0x118c('0xd3')]));_0x39c57e['attributes']=_0x39c57e[_0x118c('0x50')]['length']?_0x39c57e[_0x118c('0x50')]:_0x52e2ee[_0x118c('0xce')];_0x39c57e[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x3a378d['query'][_0x118c('0xd5')]);_0x39c57e['where']=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x3a378d[_0x118c('0x4b')],_0x52e2ee[_0x118c('0xd1')]));if(_0x3a378d[_0x118c('0x4b')]['filter']){_0x39c57e[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x39c57e[_0x118c('0x4a')],{'$or':_['map'](_0x39c57e['attributes'],function(_0x14d578){var _0x3db93a={};_0x3db93a[_0x14d578]={'$like':'%'+_0x3a378d[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x3db93a;})});}_0x39c57e=_[_0x118c('0xd7')]({},_0x39c57e,_0x3a378d[_0x118c('0xd8')]);switch(_0x59327d[_0x118c('0x2e')]){case _0x118c('0x34'):return db[_[_0x118c('0xa3')](_0x3a378d[_0x118c('0x4b')][_0x118c('0xaf')])+_0x118c('0xd9')][_0x118c('0x52')](_0x39c57e);case _0x118c('0x36'):case'agent':return _0x59327d[_0x118c('0x33')+_[_0x118c('0xa3')](_0x3a378d[_0x118c('0x4b')][_0x118c('0xaf')])+_0x118c('0xa5')](_0x39c57e);default:throw new db[(_0x118c('0x93'))][(_0x118c('0x90'))](_0x118c('0xda'));}})['then'](function(_0x4d88be){_0x1d8609=_0x4d88be['length'];if(!_0x3a378d[_0x118c('0x4b')][_0x118c('0xdb')](_0x118c('0xdc'))){_0x39c57e[_0x118c('0x1e')]=qs['limit'](_0x3a378d[_0x118c('0x4b')][_0x118c('0x1e')]);_0x39c57e[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0x3a378d[_0x118c('0x4b')][_0x118c('0x1d')]);}switch(_0x59327d[_0x118c('0x2e')]){case _0x118c('0x34'):return db[_[_0x118c('0xa3')](_0x3a378d[_0x118c('0x4b')][_0x118c('0xaf')])+'Queue'][_0x118c('0x52')](_0x39c57e);case _0x118c('0x36'):case _0x118c('0x2f'):return _0x59327d[_0x118c('0x33')+_['capitalize'](_0x3a378d['query'][_0x118c('0xaf')])+'Queues'](_0x39c57e);}})[_0x118c('0x22')](function(_0x4abd1f){return{'count':_0x1d8609,'rows':_0x4abd1f};})['then'](respondWithResult(_0x1897eb,null))['catch'](handleError(_0x1897eb,null));};exports[_0x118c('0xdd')]=function(_0xd3a82e,_0xcd7cda){var _0x2b58f5={};var _0x523201={};var _0x370da3;var _0x4e0598;return db['User'][_0x118c('0x97')]({'where':{'id':_0xd3a82e[_0x118c('0x5f')]['id']}})['then'](handleEntityNotFound(_0xcd7cda,null))['then'](function(_0x1abd2e){if(_0x1abd2e){_0x370da3=_0x1abd2e;_0x523201[_0x118c('0xce')]=_[_0x118c('0xcf')](db[_0x118c('0xad')][_0x118c('0xd0')]);_0x523201[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0xd3a82e['query']);_0x523201[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x523201[_0x118c('0xce')],_0x523201[_0x118c('0x4b')]);_0x2b58f5['attributes']=_[_0x118c('0xd2')](_0x523201[_0x118c('0xce')],qs[_0x118c('0xd3')](_0xd3a82e[_0x118c('0x4b')][_0x118c('0xd3')]));_0x2b58f5['attributes']=_0x2b58f5[_0x118c('0x50')][_0x118c('0x55')]?_0x2b58f5[_0x118c('0x50')]:_0x523201[_0x118c('0xce')];_0x2b58f5[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0xd3a82e['query']['sort']);_0x2b58f5[_0x118c('0x4a')]=qs['filters'](_[_0x118c('0xd6')](_0xd3a82e[_0x118c('0x4b')],_0x523201[_0x118c('0xd1')]));if(_0xd3a82e[_0x118c('0x4b')][_0x118c('0x38')]){_0x2b58f5['where']=_[_0x118c('0xd7')](_0x2b58f5['where'],{'$or':_['map'](_0x2b58f5[_0x118c('0x50')],function(_0x3fce2d){var _0x58591e={};_0x58591e[_0x3fce2d]={'$like':'%'+_0xd3a82e[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x58591e;})});}_0x2b58f5=_[_0x118c('0xd7')]({},_0x2b58f5,_0xd3a82e[_0x118c('0xd8')]);return _0x370da3['getVoiceQueuesRt'](_0x2b58f5);}})[_0x118c('0x22')](function(_0x31b0d1){if(_0x31b0d1){_0x4e0598=_0x31b0d1[_0x118c('0x55')];if(!_0xd3a82e[_0x118c('0x4b')]['hasOwnProperty'](_0x118c('0xdc'))){_0x2b58f5['limit']=qs[_0x118c('0x1e')](_0xd3a82e[_0x118c('0x4b')]['limit']);_0x2b58f5[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0xd3a82e[_0x118c('0x4b')][_0x118c('0x1d')]);}return _0x370da3[_0x118c('0xdd')](_0x2b58f5);}})[_0x118c('0x22')](function(_0x422a4c){if(_0x422a4c){return _0x422a4c?{'count':_0x4e0598,'rows':_0x422a4c}:null;}})[_0x118c('0x22')](respondWithResult(_0xcd7cda,null))['catch'](handleError(_0xcd7cda,null));};exports[_0x118c('0xde')]=function(_0x406c73,_0x44abaa){var _0x38ffea={};var _0x552a27={};var _0x54abc6;var _0x470592;return db['User'][_0x118c('0x97')]({'where':{'id':_0x406c73[_0x118c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x44abaa,null))[_0x118c('0x22')](function(_0x5613ce){if(_0x5613ce){_0x54abc6=_0x5613ce;_0x552a27[_0x118c('0xce')]=_[_0x118c('0xcf')](db[_0x118c('0xdf')]['rawAttributes']);_0x552a27['query']=_['keys'](_0x406c73['query']);_0x552a27['filters']=_['intersection'](_0x552a27[_0x118c('0xce')],_0x552a27[_0x118c('0x4b')]);_0x38ffea[_0x118c('0x50')]=_['intersection'](_0x552a27[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x406c73[_0x118c('0x4b')][_0x118c('0xd3')]));_0x38ffea[_0x118c('0x50')]=_0x38ffea[_0x118c('0x50')][_0x118c('0x55')]?_0x38ffea['attributes']:_0x552a27[_0x118c('0xce')];_0x38ffea[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x406c73[_0x118c('0x4b')][_0x118c('0xd5')]);_0x38ffea[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x406c73[_0x118c('0x4b')],_0x552a27[_0x118c('0xd1')]));if(_0x406c73[_0x118c('0x4b')]['filter']){_0x38ffea[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x38ffea[_0x118c('0x4a')],{'$or':_['map'](_0x38ffea['attributes'],function(_0x43eb1b){var _0x575e1b={};_0x575e1b[_0x43eb1b]={'$like':'%'+_0x406c73[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x575e1b;})});}_0x38ffea=_[_0x118c('0xd7')]({},_0x38ffea,_0x406c73[_0x118c('0xd8')]);return _0x54abc6['getGroups'](_0x38ffea);}})[_0x118c('0x22')](function(_0x207608){if(_0x207608){_0x470592=_0x207608[_0x118c('0x55')];if(!_0x406c73['query'][_0x118c('0xdb')](_0x118c('0xdc'))){_0x38ffea['limit']=qs[_0x118c('0x1e')](_0x406c73[_0x118c('0x4b')]['limit']);_0x38ffea[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0x406c73[_0x118c('0x4b')][_0x118c('0x1d')]);}return _0x54abc6['getGroups'](_0x38ffea);}})['then'](function(_0x198f32){if(_0x198f32){return _0x198f32?{'count':_0x470592,'rows':_0x198f32}:null;}})[_0x118c('0x22')](respondWithResult(_0x44abaa,null))[_0x118c('0x2c')](handleError(_0x44abaa,null));};exports['getRecordings']=function(_0x2710bc,_0x4d642a){var _0x4fd1e6={'raw':!![],'where':{}};var _0x3ce4b6={};var _0x5940a8={'count':0x0,'rows':[]};return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x2710bc[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x4d642a,null))[_0x118c('0x22')](function(_0x3efbb8){if(_0x3efbb8){_0x3ce4b6['model']=_['keys'](db[_0x118c('0xe0')]['rawAttributes']);_0x3ce4b6[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0x2710bc['query']);_0x3ce4b6['filters']=_[_0x118c('0xd2')](_0x3ce4b6['model'],_0x3ce4b6['query']);_0x4fd1e6[_0x118c('0x50')]=_['intersection'](_0x3ce4b6[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x2710bc[_0x118c('0x4b')]['fields']));_0x4fd1e6[_0x118c('0x50')]=_0x4fd1e6[_0x118c('0x50')]['length']?_0x4fd1e6[_0x118c('0x50')]:_0x3ce4b6[_0x118c('0xce')];if(!_0x2710bc[_0x118c('0x4b')][_0x118c('0xdb')]('nolimit')){_0x4fd1e6['limit']=qs[_0x118c('0x1e')](_0x2710bc[_0x118c('0x4b')]['limit']);_0x4fd1e6[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0x2710bc[_0x118c('0x4b')][_0x118c('0x1d')]);}_0x4fd1e6['order']=qs['sort'](_0x2710bc[_0x118c('0x4b')][_0x118c('0xd5')]);_0x4fd1e6[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x2710bc[_0x118c('0x4b')],_0x3ce4b6[_0x118c('0xd1')]));_0x4fd1e6['where'][_0x118c('0xe1')]=_0x3efbb8['id'];if(_0x2710bc[_0x118c('0x4b')][_0x118c('0x38')]){_0x4fd1e6[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x4fd1e6[_0x118c('0x4a')],{'$or':_[_0x118c('0x3a')](_0x4fd1e6[_0x118c('0x50')],function(_0x16cc49){var _0xe2a83d={};_0xe2a83d[_0x16cc49]={'$like':'%'+_0x2710bc[_0x118c('0x4b')]['filter']+'%'};return _0xe2a83d;})});}_0x4fd1e6=_[_0x118c('0xd7')]({},_0x4fd1e6,_0x2710bc[_0x118c('0xd8')]);return db[_0x118c('0xe0')]['count']({'where':_0x4fd1e6[_0x118c('0x4a')]})[_0x118c('0x22')](function(_0x535093){_0x5940a8[_0x118c('0x1f')]=_0x535093;if(_0x2710bc[_0x118c('0x4b')][_0x118c('0x4c')]){_0x4fd1e6[_0x118c('0x4d')]=[{'all':!![]}];}return db['VoiceRecording'][_0x118c('0x52')](_0x4fd1e6);})['then'](function(_0x58878e){_0x5940a8[_0x118c('0x54')]=_0x58878e;return _0x5940a8;});}})[_0x118c('0x22')](respondWithFilteredResult(_0x4d642a,_0x4fd1e6))[_0x118c('0x2c')](handleError(_0x4d642a,null));};exports[_0x118c('0xe2')]=function(_0x1eff84,_0x3376be){var _0x35f9e={'raw':!![],'where':{}};var _0x2a7d3a={};var _0x207eb6={'count':0x0,'rows':[]};return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x1eff84[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x3376be,null))['then'](function(_0x2a2d9d){if(_0x2a2d9d){_0x2a7d3a[_0x118c('0xce')]=_['keys'](db['ScreenRecording'][_0x118c('0xd0')]);_0x2a7d3a[_0x118c('0x4b')]=_['keys'](_0x1eff84[_0x118c('0x4b')]);_0x2a7d3a['filters']=_[_0x118c('0xd2')](_0x2a7d3a[_0x118c('0xce')],_0x2a7d3a[_0x118c('0x4b')]);_0x35f9e[_0x118c('0x50')]=_[_0x118c('0xd2')](_0x2a7d3a[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x1eff84['query'][_0x118c('0xd3')]));_0x35f9e[_0x118c('0x50')]=_0x35f9e[_0x118c('0x50')]['length']?_0x35f9e[_0x118c('0x50')]:_0x2a7d3a['model'];if(!_0x1eff84['query'][_0x118c('0xdb')]('nolimit')){_0x35f9e[_0x118c('0x1e')]=qs[_0x118c('0x1e')](_0x1eff84[_0x118c('0x4b')]['limit']);_0x35f9e['offset']=qs[_0x118c('0x1d')](_0x1eff84[_0x118c('0x4b')][_0x118c('0x1d')]);}_0x35f9e['order']=qs[_0x118c('0xd5')](_0x1eff84[_0x118c('0x4b')]['sort']);_0x35f9e[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x1eff84[_0x118c('0x4b')],_0x2a7d3a['filters']));_0x35f9e[_0x118c('0x4a')][_0x118c('0xe1')]=_0x2a2d9d['id'];if(_0x1eff84[_0x118c('0x4b')][_0x118c('0x38')]){_0x35f9e['where']=_[_0x118c('0xd7')](_0x35f9e[_0x118c('0x4a')],{'$or':_[_0x118c('0x3a')](_0x35f9e[_0x118c('0x50')],function(_0x2842f3){var _0x246242={};_0x246242[_0x2842f3]={'$like':'%'+_0x1eff84[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x246242;})});}_0x35f9e=_[_0x118c('0xd7')]({},_0x35f9e,_0x1eff84[_0x118c('0xd8')]);return db[_0x118c('0xe3')][_0x118c('0x1f')]({'where':_0x35f9e[_0x118c('0x4a')]})['then'](function(_0x219617){_0x207eb6['count']=_0x219617;if(_0x1eff84['query'][_0x118c('0x4c')]){_0x35f9e[_0x118c('0x4d')]=[{'all':!![]}];}return db[_0x118c('0xe3')][_0x118c('0x52')](_0x35f9e);})[_0x118c('0x22')](function(_0x417d3a){_0x207eb6[_0x118c('0x54')]=_0x417d3a;return _0x207eb6;});}})[_0x118c('0x22')](respondWithFilteredResult(_0x3376be,_0x35f9e))['catch'](handleError(_0x3376be,null));};exports[_0x118c('0xe4')]=function(_0x59550d,_0x373506){var _0x5b358f={};var _0x1753bf={};var _0x58a91b;var _0x104b57;return db['User'][_0x118c('0x97')]({'where':{'id':_0x59550d[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x373506,null))[_0x118c('0x22')](function(_0x22ddd1){if(_0x22ddd1){_0x58a91b=_0x22ddd1;_0x1753bf[_0x118c('0xce')]=_[_0x118c('0xcf')](db['ChatInteraction'][_0x118c('0xd0')]);_0x1753bf[_0x118c('0x4b')]=_['keys'](_0x59550d[_0x118c('0x4b')]);_0x1753bf[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x1753bf[_0x118c('0xce')],_0x1753bf[_0x118c('0x4b')]);_0x5b358f[_0x118c('0x50')]=_[_0x118c('0xd2')](_0x1753bf[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x59550d[_0x118c('0x4b')][_0x118c('0xd3')]));_0x5b358f[_0x118c('0x50')]=_0x5b358f[_0x118c('0x50')]['length']?_0x5b358f['attributes']:_0x1753bf[_0x118c('0xce')];_0x5b358f[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x59550d['query']['sort']);_0x5b358f[_0x118c('0x4a')]=qs['filters'](_[_0x118c('0xd6')](_0x59550d['query'],_0x1753bf['filters']));if(_0x59550d[_0x118c('0x4b')][_0x118c('0x38')]){_0x5b358f[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x5b358f[_0x118c('0x4a')],{'$or':_[_0x118c('0x3a')](_0x5b358f[_0x118c('0x50')],function(_0x14b55f){var _0x3ee00a={};_0x3ee00a[_0x14b55f]={'$like':'%'+_0x59550d[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x3ee00a;})});}_0x5b358f=_[_0x118c('0xd7')]({},_0x5b358f,_0x59550d[_0x118c('0xd8')]);return _0x58a91b[_0x118c('0xe4')](_0x5b358f);}})[_0x118c('0x22')](function(_0x5772a0){if(_0x5772a0){_0x104b57=_0x5772a0[_0x118c('0x55')];if(!_0x59550d[_0x118c('0x4b')][_0x118c('0xdb')](_0x118c('0xdc'))){_0x5b358f['limit']=qs['limit'](_0x59550d[_0x118c('0x4b')][_0x118c('0x1e')]);_0x5b358f[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0x59550d[_0x118c('0x4b')][_0x118c('0x1d')]);}return _0x58a91b[_0x118c('0xe4')](_0x5b358f);}})[_0x118c('0x22')](function(_0x5f2ae5){if(_0x5f2ae5){return _0x5f2ae5?{'count':_0x104b57,'rows':_0x5f2ae5}:null;}})[_0x118c('0x22')](respondWithResult(_0x373506,null))['catch'](handleError(_0x373506,null));};exports[_0x118c('0xe5')]=function(_0x4eed8b,_0x310d2a){var _0x40783f={};var _0x500b84={};var _0x1db3ed;var _0x9df7ca;return db['User'][_0x118c('0x97')]({'where':{'id':_0x4eed8b['params']['id']}})['then'](handleEntityNotFound(_0x310d2a,null))[_0x118c('0x22')](function(_0x572ddf){if(_0x572ddf){_0x1db3ed=_0x572ddf;_0x500b84[_0x118c('0xce')]=_[_0x118c('0xcf')](db['OpenchannelInteraction'][_0x118c('0xd0')]);_0x500b84['query']=_[_0x118c('0xcf')](_0x4eed8b[_0x118c('0x4b')]);_0x500b84[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x500b84[_0x118c('0xce')],_0x500b84['query']);_0x40783f['attributes']=_[_0x118c('0xd2')](_0x500b84[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x4eed8b[_0x118c('0x4b')][_0x118c('0xd3')]));_0x40783f[_0x118c('0x50')]=_0x40783f[_0x118c('0x50')]['length']?_0x40783f[_0x118c('0x50')]:_0x500b84[_0x118c('0xce')];_0x40783f[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x4eed8b['query'][_0x118c('0xd5')]);_0x40783f[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x4eed8b['query'],_0x500b84[_0x118c('0xd1')]));if(_0x4eed8b[_0x118c('0x4b')][_0x118c('0x38')]){_0x40783f[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x40783f[_0x118c('0x4a')],{'$or':_[_0x118c('0x3a')](_0x40783f[_0x118c('0x50')],function(_0x550be2){var _0x8f9512={};_0x8f9512[_0x550be2]={'$like':'%'+_0x4eed8b[_0x118c('0x4b')]['filter']+'%'};return _0x8f9512;})});}_0x40783f=_['merge']({},_0x40783f,_0x4eed8b[_0x118c('0xd8')]);return _0x1db3ed[_0x118c('0xe5')](_0x40783f);}})[_0x118c('0x22')](function(_0x35c271){if(_0x35c271){_0x9df7ca=_0x35c271['length'];if(!_0x4eed8b[_0x118c('0x4b')]['hasOwnProperty'](_0x118c('0xdc'))){_0x40783f[_0x118c('0x1e')]=qs[_0x118c('0x1e')](_0x4eed8b[_0x118c('0x4b')]['limit']);_0x40783f[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0x4eed8b[_0x118c('0x4b')][_0x118c('0x1d')]);}return _0x1db3ed[_0x118c('0xe5')](_0x40783f);}})[_0x118c('0x22')](function(_0xdc651e){if(_0xdc651e){return _0xdc651e?{'count':_0x9df7ca,'rows':_0xdc651e}:null;}})[_0x118c('0x22')](respondWithResult(_0x310d2a,null))['catch'](handleError(_0x310d2a,null));};exports[_0x118c('0xe6')]=function(_0x232d83,_0x4ee74d){var _0x4a0926={'raw':!![],'where':{}};var _0x410e9d={};var _0x467d13={'count':0x0,'rows':[]};return db['User'][_0x118c('0x97')]({'where':{'id':_0x232d83['params']['id']}})['then'](handleEntityNotFound(_0x4ee74d,null))['then'](function(_0x5bfbc3){if(_0x5bfbc3){_0x410e9d[_0x118c('0xce')]=_['keys'](db[_0x118c('0xe7')][_0x118c('0xd0')]);_0x410e9d[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0x232d83[_0x118c('0x4b')]);_0x410e9d[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x410e9d[_0x118c('0xce')],_0x410e9d[_0x118c('0x4b')]);_0x4a0926[_0x118c('0x50')]=_[_0x118c('0xd2')](_0x410e9d[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x232d83[_0x118c('0x4b')]['fields']));_0x4a0926[_0x118c('0x50')]=_0x4a0926['attributes'][_0x118c('0x55')]?_0x4a0926[_0x118c('0x50')]:_0x410e9d['model'];if(!_0x232d83[_0x118c('0x4b')][_0x118c('0xdb')](_0x118c('0xdc'))){_0x4a0926[_0x118c('0x1e')]=qs[_0x118c('0x1e')](_0x232d83[_0x118c('0x4b')][_0x118c('0x1e')]);_0x4a0926['offset']=qs[_0x118c('0x1d')](_0x232d83[_0x118c('0x4b')][_0x118c('0x1d')]);}_0x4a0926['order']=qs[_0x118c('0xd5')](_0x232d83[_0x118c('0x4b')]['sort']);_0x4a0926[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_['pick'](_0x232d83[_0x118c('0x4b')],_0x410e9d[_0x118c('0xd1')]));_0x4a0926['where'][_0x118c('0xe1')]=_0x5bfbc3['id'];if(_0x232d83[_0x118c('0x4b')][_0x118c('0x38')]){_0x4a0926[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x4a0926[_0x118c('0x4a')],{'$or':_['map'](_0x4a0926['attributes'],function(_0x21f55f){var _0x1ffea7={};_0x1ffea7[_0x21f55f]={'$like':'%'+_0x232d83[_0x118c('0x4b')]['filter']+'%'};return _0x1ffea7;})});}_0x4a0926=_['merge']({},_0x4a0926,_0x232d83['options']);return db[_0x118c('0xe7')][_0x118c('0x1f')]({'where':_0x4a0926[_0x118c('0x4a')]})[_0x118c('0x22')](function(_0x437b54){_0x467d13[_0x118c('0x1f')]=_0x437b54;if(_0x232d83['query']['includeAll']){_0x4a0926[_0x118c('0x4d')]=[{'all':!![]}];}return db['MailInteraction'][_0x118c('0x52')](_0x4a0926);})[_0x118c('0x22')](function(_0x7763ea){_0x467d13['rows']=_0x7763ea;return _0x467d13;});}})['then'](respondWithFilteredResult(_0x4ee74d,_0x4a0926))[_0x118c('0x2c')](handleError(_0x4ee74d,null));};exports['getSmsInteractions']=function(_0x5e12c4,_0x1e7a4b){var _0x328bb8={};var _0x31419d={};var _0x4d036c;var _0xa70ea1;return db['User'][_0x118c('0x97')]({'where':{'id':_0x5e12c4[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x1e7a4b,null))[_0x118c('0x22')](function(_0x28e299){if(_0x28e299){_0x4d036c=_0x28e299;_0x31419d[_0x118c('0xce')]=_['keys'](db[_0x118c('0xe8')][_0x118c('0xd0')]);_0x31419d['query']=_['keys'](_0x5e12c4['query']);_0x31419d[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x31419d[_0x118c('0xce')],_0x31419d[_0x118c('0x4b')]);_0x328bb8[_0x118c('0x50')]=_[_0x118c('0xd2')](_0x31419d[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x5e12c4[_0x118c('0x4b')]['fields']));_0x328bb8['attributes']=_0x328bb8['attributes']['length']?_0x328bb8[_0x118c('0x50')]:_0x31419d['model'];_0x328bb8[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x5e12c4[_0x118c('0x4b')][_0x118c('0xd5')]);_0x328bb8[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x5e12c4[_0x118c('0x4b')],_0x31419d['filters']));if(_0x5e12c4['query'][_0x118c('0x38')]){_0x328bb8[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x328bb8['where'],{'$or':_[_0x118c('0x3a')](_0x328bb8['attributes'],function(_0x4f610f){var _0x5446a7={};_0x5446a7[_0x4f610f]={'$like':'%'+_0x5e12c4['query'][_0x118c('0x38')]+'%'};return _0x5446a7;})});}_0x328bb8=_['merge']({},_0x328bb8,_0x5e12c4[_0x118c('0xd8')]);return _0x4d036c['getSmsInteractions'](_0x328bb8);}})[_0x118c('0x22')](function(_0x5b8db3){if(_0x5b8db3){_0xa70ea1=_0x5b8db3[_0x118c('0x55')];if(!_0x5e12c4[_0x118c('0x4b')]['hasOwnProperty'](_0x118c('0xdc'))){_0x328bb8['limit']=qs[_0x118c('0x1e')](_0x5e12c4[_0x118c('0x4b')][_0x118c('0x1e')]);_0x328bb8[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0x5e12c4[_0x118c('0x4b')][_0x118c('0x1d')]);}return _0x4d036c[_0x118c('0xe9')](_0x328bb8);}})[_0x118c('0x22')](function(_0x4b966f){if(_0x4b966f){return _0x4b966f?{'count':_0xa70ea1,'rows':_0x4b966f}:null;}})['then'](respondWithResult(_0x1e7a4b,null))[_0x118c('0x2c')](handleError(_0x1e7a4b,null));};exports[_0x118c('0xea')]=function(_0x108f8f,_0x5e708c){var _0x485c31={};var _0x5b11fa={};var _0x8dfab8;var _0x45ced7;return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x108f8f[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x5e708c,null))[_0x118c('0x22')](function(_0x413c2f){if(_0x413c2f){_0x8dfab8=_0x413c2f;_0x5b11fa[_0x118c('0xce')]=_['keys'](db['FaxInteraction'][_0x118c('0xd0')]);_0x5b11fa[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0x108f8f[_0x118c('0x4b')]);_0x5b11fa[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x5b11fa[_0x118c('0xce')],_0x5b11fa[_0x118c('0x4b')]);_0x485c31['attributes']=_[_0x118c('0xd2')](_0x5b11fa[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x108f8f[_0x118c('0x4b')]['fields']));_0x485c31['attributes']=_0x485c31[_0x118c('0x50')][_0x118c('0x55')]?_0x485c31[_0x118c('0x50')]:_0x5b11fa[_0x118c('0xce')];_0x485c31[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x108f8f['query']['sort']);_0x485c31[_0x118c('0x4a')]=qs['filters'](_[_0x118c('0xd6')](_0x108f8f['query'],_0x5b11fa[_0x118c('0xd1')]));if(_0x108f8f[_0x118c('0x4b')][_0x118c('0x38')]){_0x485c31['where']=_[_0x118c('0xd7')](_0x485c31['where'],{'$or':_[_0x118c('0x3a')](_0x485c31[_0x118c('0x50')],function(_0x431a17){var _0x2304bf={};_0x2304bf[_0x431a17]={'$like':'%'+_0x108f8f[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x2304bf;})});}_0x485c31=_[_0x118c('0xd7')]({},_0x485c31,_0x108f8f[_0x118c('0xd8')]);return _0x8dfab8[_0x118c('0xea')](_0x485c31);}})[_0x118c('0x22')](function(_0x5d6e3f){if(_0x5d6e3f){_0x45ced7=_0x5d6e3f[_0x118c('0x55')];if(!_0x108f8f[_0x118c('0x4b')]['hasOwnProperty'](_0x118c('0xdc'))){_0x485c31['limit']=qs[_0x118c('0x1e')](_0x108f8f['query'][_0x118c('0x1e')]);_0x485c31['offset']=qs[_0x118c('0x1d')](_0x108f8f[_0x118c('0x4b')][_0x118c('0x1d')]);}return _0x8dfab8[_0x118c('0xea')](_0x485c31);}})[_0x118c('0x22')](function(_0xd17044){if(_0xd17044){return _0xd17044?{'count':_0x45ced7,'rows':_0xd17044}:null;}})[_0x118c('0x22')](respondWithResult(_0x5e708c,null))[_0x118c('0x2c')](handleError(_0x5e708c,null));};exports[_0x118c('0xeb')]=function(_0x3a5b7f,_0x42f731){var _0x367360={};var _0x254550={};var _0x17ac96;var _0xb8169;return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x3a5b7f[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x42f731,null))['then'](function(_0x76ee7f){if(_0x76ee7f){_0x17ac96=_0x76ee7f;_0x254550[_0x118c('0xce')]=_[_0x118c('0xcf')](db[_0x118c('0xec')][_0x118c('0xd0')]);_0x254550['query']=_[_0x118c('0xcf')](_0x3a5b7f[_0x118c('0x4b')]);_0x254550[_0x118c('0xd1')]=_['intersection'](_0x254550[_0x118c('0xce')],_0x254550[_0x118c('0x4b')]);_0x367360['attributes']=_['intersection'](_0x254550[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x3a5b7f['query'][_0x118c('0xd3')]));_0x367360['attributes']=_0x367360[_0x118c('0x50')][_0x118c('0x55')]?_0x367360[_0x118c('0x50')]:_0x254550[_0x118c('0xce')];_0x367360[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x3a5b7f[_0x118c('0x4b')][_0x118c('0xd5')]);_0x367360[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x3a5b7f[_0x118c('0x4b')],_0x254550['filters']));if(_0x3a5b7f[_0x118c('0x4b')]['filter']){_0x367360[_0x118c('0x4a')]=_[_0x118c('0xd7')](_0x367360[_0x118c('0x4a')],{'$or':_[_0x118c('0x3a')](_0x367360[_0x118c('0x50')],function(_0x3feac5){var _0x44b251={};_0x44b251[_0x3feac5]={'$like':'%'+_0x3a5b7f[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x44b251;})});}_0x367360=_['merge']({},_0x367360,_0x3a5b7f[_0x118c('0xd8')]);return _0x17ac96[_0x118c('0xeb')](_0x367360);}})[_0x118c('0x22')](function(_0x15d92a){if(_0x15d92a){_0xb8169=_0x15d92a[_0x118c('0x55')];if(!_0x3a5b7f[_0x118c('0x4b')][_0x118c('0xdb')](_0x118c('0xdc'))){_0x367360['limit']=qs['limit'](_0x3a5b7f['query']['limit']);_0x367360[_0x118c('0x1d')]=qs['offset'](_0x3a5b7f[_0x118c('0x4b')][_0x118c('0x1d')]);}return _0x17ac96[_0x118c('0xeb')](_0x367360);}})[_0x118c('0x22')](function(_0x57ec60){if(_0x57ec60){return _0x57ec60?{'count':_0xb8169,'rows':_0x57ec60}:null;}})[_0x118c('0x22')](respondWithResult(_0x42f731,null))['catch'](handleError(_0x42f731,null));};exports[_0x118c('0xed')]=function(_0x37e67b,_0x444211,_0x4741c9){var _0x59624f;var _0x3c3c1c;var _0x406bf3;var _0x18ab5b=!_['isNil'](_0x37e67b[_0x118c('0x5f')]['id'])?_0x37e67b[_0x118c('0x5f')]['id']:!_['isNil'](_0x37e67b['user']['id'])?_0x37e67b[_0x118c('0x36')]['id']:null;return db[_0x118c('0x40')][_0x118c('0x5e')]({'where':{'id':_0x18ab5b,'role':{'$or':[_0x118c('0x34'),'user',_0x118c('0x2f')]}},'attributes':['id',_0x118c('0x3d'),'phone',_0x118c('0xee'),_0x118c('0x2e'),_0x118c('0x67'),'loginInPause']})[_0x118c('0x22')](function(_0x5481e5){if(_0x5481e5){if(_0x5481e5['role']===_0x118c('0x2f')){_0x59624f=_0x5481e5;if(_0x37e67b['body'][_0x118c('0xa9')]){_0x406bf3=util[_0x118c('0xaa')]('LOCAL/%s@from-sip/n',_0x59624f[_0x37e67b['body']['interface']]);}else if(_0x37e67b[_0x118c('0x5d')][_0x118c('0xef')]){_0x406bf3=util[_0x118c('0xaa')](_0x118c('0xab'),_0x37e67b[_0x118c('0x5d')]['intrf']);}else{_0x406bf3=util[_0x118c('0xaa')]('SIP/%s',_0x59624f[_0x118c('0x3d')]);}socket['to'](util[_0x118c('0xaa')](_0x118c('0xf0'),_0x59624f[_0x118c('0x3d')]))[_0x118c('0x30')](_0x118c('0xf1'),{'user':{'id':_0x59624f['id'],'name':_0x59624f['name']},'ip':_0x37e67b[_0x118c('0xf2')][_0x118c('0xf3')]||_0x37e67b['connection'][_0x118c('0xf4')]||_0x37e67b['socket'][_0x118c('0xf4')]||_0x37e67b[_0x118c('0xf5')]['socket']['remoteAddress']});return db[_0x118c('0xad')][_0x118c('0x32')]({'where':{'membername':_0x59624f['name']},'individualHooks':!![]});}}else{throw new db[(_0x118c('0x93'))]['ValidationError'](_0x118c('0xf6'));}})[_0x118c('0x22')](function(){if(_0x59624f){return _0x59624f[_0x118c('0xf7')]({'raw':!![]});}})[_0x118c('0x22')](function(_0x26369b){if(_0x59624f){if(_0x26369b){_0x3c3c1c=_0x26369b;if(_0x3c3c1c['length']){var _0x2ec382=_0x3c3c1c[_0x118c('0x3a')](function(_0x10b6c5){var _0x3707b1={'membername':_0x59624f[_0x118c('0x3d')],'UserId':_0x59624f['id'],'queue_name':_0x10b6c5[_0x118c('0x3d')],'VoiceQueueId':_0x10b6c5['id'],'interface':_0x406bf3,'paused':_0x59624f[_0x118c('0x9e')]||![],'penalty':_0x10b6c5[_0x118c('0xf8')]||0x0};return db[_0x118c('0xad')][_0x118c('0xae')](_0x3707b1);});return Promise[_0x118c('0x8a')](_0x2ec382);}}}})[_0x118c('0x22')](function(){if(_0x59624f){return db[_0x118c('0xf9')][_0x118c('0x52')]({'where':{'membername':_0x59624f[_0x118c('0x3d')],'exitAt':null}});}})[_0x118c('0x22')](function(_0x555c6d){if(_0x59624f){var _0xa882dd=[];_0x555c6d[_0x118c('0xfa')](function(_0x160cd3){_0xa882dd['push'](_0x160cd3['update']({'exitAt':moment()[_0x118c('0xaa')](_0x118c('0xfb'))}));});return Promise[_0x118c('0x8a')](_0xa882dd);}})[_0x118c('0x22')](function(){if(_0x59624f){var _0x343b07=[];var _0x29dbd6=[];var _0x75914c=utils[_0x118c('0xfc')]();var _0x37ab61={'membername':_0x59624f[_0x118c('0x3d')],'interface':_0x406bf3,'enterAt':moment()[_0x118c('0xaa')](_0x118c('0xfb')),'role':_0x59624f['role'],'internal':_0x59624f[_0x118c('0x67')]};_0x75914c['forEach'](function(_0x201837){_0x343b07[_0x118c('0x51')](_[_0x118c('0xd7')]({'channel':_0x201837,'type':_0x118c('0xfd'),'data1':_0x37e67b['body']['device'],'data2':_0x406bf3},_0x37ab61));if(_0x59624f[_0x118c('0x9e')]){_0x29dbd6[_0x118c('0x51')](_[_0x118c('0xd7')]({'channel':_0x201837,'type':'PAUSE','data1':_0x118c('0xfe')},_0x37ab61));}});return db['MemberReport']['bulkCreate'](_0x343b07['concat'](_0x29dbd6),{'individualHooks':!![]});}})['then'](function(){if(_0x59624f){return _0x59624f[_0x118c('0x2d')]({'online':!![],'lastLoginAt':moment()['format'](_0x118c('0xfb')),'voicePause':_0x59624f[_0x118c('0x9e')]||![],'mailPause':_0x59624f['loginInPause']||![],'chatPause':_0x59624f[_0x118c('0x9e')]||![],'faxPause':_0x59624f['loginInPause']||![],'smsPause':_0x59624f[_0x118c('0x9e')]||![],'openchannelPause':_0x59624f[_0x118c('0x9e')]||![],'whatsappPause':_0x59624f[_0x118c('0x9e')]||![],'pauseType':_0x59624f['loginInPause']?_0x118c('0xfe'):null,'interface':_0x406bf3,'lastPauseAt':moment()['format'](_0x118c('0xfb'))});}})[_0x118c('0x22')](function(_0x5ad67c){if(_0x37e67b['isMiddleware']){return _0x4741c9();}else{return Promise['resolve'](_0x5ad67c)[_0x118c('0x22')](respondWithResult(_0x444211,null));}})[_0x118c('0x2c')](handleError(_0x444211,null));};exports[_0x118c('0xff')]=function(_0x3f1f6e,_0x374bd7){var _0x7c0f0e;return db[_0x118c('0x40')]['find']({'where':{'id':_0x3f1f6e[_0x118c('0x5f')]['id'],'role':_0x118c('0x2f')},'attributes':['id',_0x118c('0x3d'),_0x118c('0x2e')]})[_0x118c('0x22')](handleEntityNotFound(_0x374bd7,null))[_0x118c('0x22')](function(_0x314c39){if(_0x314c39){_0x7c0f0e=_0x314c39;return db['UserVoiceQueueRt'][_0x118c('0x32')]({'where':{'membername':_0x7c0f0e[_0x118c('0x3d')]},'individualHooks':!![]});}})[_0x118c('0x22')](function(){return db[_0x118c('0xf9')]['findAll']({'where':{'membername':_0x7c0f0e[_0x118c('0x3d')],'exitAt':null}});})['then'](function(_0x365b56){var _0x136449=[];_0x365b56['forEach'](function(_0x537548){_0x136449[_0x118c('0x51')](_0x537548['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x118c('0x8a')](_0x136449);})[_0x118c('0x22')](function(){return _0x7c0f0e[_0x118c('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x118c('0x22')](respondWithResult(_0x374bd7,null))['catch'](handleError(_0x374bd7,null));};exports[_0x118c('0x100')]=function(_0x17ab79,_0x3c05a2){var _0x54bcf3;return db[_0x118c('0xad')]['update']({'paused':0x1},{'where':{'UserId':_0x17ab79[_0x118c('0x5f')]['id']},'individualHooks':!![]})[_0x118c('0x22')](function(){return db['User'][_0x118c('0x5e')]({'where':{'id':_0x17ab79[_0x118c('0x5f')]['id'],'role':_0x118c('0x2f')},'attributes':['id',_0x118c('0x3d'),_0x118c('0x2e'),'internal','interface','online']});})['then'](handleEntityNotFound(_0x3c05a2,null))[_0x118c('0x22')](function(_0x4ea227){if(_0x4ea227){_0x54bcf3=_0x4ea227;return respondWithRpcPromise(_0x118c('0x101'),'pause',{'id':_0x54bcf3['id'],'name':_0x54bcf3[_0x118c('0x3d')],'pause':!![]});}})[_0x118c('0x22')](function(){if(_0x54bcf3){return db['MemberReport'][_0x118c('0x52')]({'where':{'membername':_0x54bcf3[_0x118c('0x3d')],'type':_0x118c('0x102'),'exitAt':null}});}})[_0x118c('0x22')](function(_0x50168b){if(_0x50168b['length']){var _0x45ff2a=moment()[_0x118c('0xaa')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2b1b44=0x0,_0x55ce72=_0x50168b[_0x118c('0x55')];_0x2b1b44<_0x55ce72;_0x2b1b44++){_0x50168b[_0x2b1b44][_0x118c('0x103')]({'exitAt':_0x45ff2a});}}})[_0x118c('0x22')](function(){var _0x3ccee5=[];var _0x18a460=utils[_0x118c('0xfc')]();_0x18a460[_0x118c('0xfa')](function(_0x2bd984){_0x3ccee5[_0x118c('0x51')]({'channel':_0x2bd984,'membername':_0x54bcf3[_0x118c('0x3d')],'interface':_[_0x118c('0x68')](_0x54bcf3['interface'])?util[_0x118c('0xaa')]('SIP/%s',_0x54bcf3[_0x118c('0x3d')]):_0x54bcf3[_0x118c('0xa9')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x17ab79[_0x118c('0x5d')][_0x118c('0x104')]||_0x118c('0x105'),'role':_0x54bcf3['role'],'internal':_0x54bcf3[_0x118c('0x67')]});});return db['MemberReport'][_0x118c('0x106')](_0x3ccee5,{'individualHooks':!![]});})[_0x118c('0x22')](function(){return _0x54bcf3['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x17ab79[_0x118c('0x5d')][_0x118c('0x104')]||_0x118c('0x105'),'lastPauseAt':moment()[_0x118c('0xaa')](_0x118c('0xfb'))});})[_0x118c('0x22')](respondWithResult(_0x3c05a2,null))['catch'](handleError(_0x3c05a2,null));};exports[_0x118c('0x107')]=function(_0x1c6d3c,_0x3632bf){if(_0x1c6d3c[_0x118c('0x5d')][_0x118c('0xaf')]&&!utils['isValidChannel'](_0x1c6d3c[_0x118c('0x5d')]['channel'])){throw new APIBadRequestError(util[_0x118c('0xaa')](_0x118c('0x108'),_0x1c6d3c[_0x118c('0x5d')][_0x118c('0xaf')]));}return db[_0x118c('0x40')][_0x118c('0x5e')]({'where':{'id':_0x1c6d3c['params']['id']},'attributes':['id',_0x118c('0x3d'),_0x118c('0x2e'),_0x118c('0x67'),'interface',_0x118c('0x109'),_0x118c('0x9f'),_0x118c('0x10a'),_0x118c('0x10b'),'faxPause',_0x118c('0x10c'),_0x118c('0x10d'),_0x118c('0x10e'),_0x118c('0x10f'),_0x118c('0x110')]})['then'](function(_0x321bc7){if(!_0x321bc7){throw new APINotFoundError(util[_0x118c('0xaa')](_0x118c('0xc7'),_0x1c6d3c[_0x118c('0x5f')]['id']));}return _0x321bc7[_0x118c('0x107')](_0x1c6d3c['body'][_0x118c('0xaf')]);})[_0x118c('0x22')](respondWithResult(_0x3632bf,null))[_0x118c('0x2c')](APIHandleError(_0x3632bf));};exports[_0x118c('0x111')]=function(_0x481343,_0x2c20d3){var _0x14472c={};var _0x3b2588={};var _0x252a06;var _0x201a83;return db['User']['findOne']({'where':{'id':_0x481343[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x2c20d3,null))[_0x118c('0x22')](function(_0x505c85){if(_0x505c85){_0x252a06=_0x505c85;_0x3b2588[_0x118c('0xce')]=_[_0x118c('0xcf')](db[_0x118c('0x112')][_0x118c('0xd0')]);_0x3b2588[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0x481343['query']);_0x3b2588[_0x118c('0xd1')]=_['intersection'](_0x3b2588[_0x118c('0xce')],_0x3b2588[_0x118c('0x4b')]);_0x14472c[_0x118c('0x50')]=_[_0x118c('0xd2')](_0x3b2588['model'],qs[_0x118c('0xd3')](_0x481343[_0x118c('0x4b')]['fields']));_0x14472c[_0x118c('0x50')]=_0x14472c[_0x118c('0x50')][_0x118c('0x55')]?_0x14472c[_0x118c('0x50')]:_0x3b2588['model'];_0x14472c['order']=qs[_0x118c('0xd5')](_0x481343['query'][_0x118c('0xd5')]);_0x14472c['where']=qs['filters'](_[_0x118c('0xd6')](_0x481343[_0x118c('0x4b')],_0x3b2588['filters']));if(_0x481343[_0x118c('0x4b')][_0x118c('0x38')]){_0x14472c[_0x118c('0x4a')]=_['merge'](_0x14472c[_0x118c('0x4a')],{'$or':_['map'](_0x14472c['attributes'],function(_0x14710b){var _0x34768e={};_0x34768e[_0x14710b]={'$like':'%'+_0x481343[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x34768e;})});}_0x14472c=_[_0x118c('0xd7')]({},_0x14472c,_0x481343[_0x118c('0xd8')]);return _0x252a06['getTeams'](_0x14472c);}})[_0x118c('0x22')](function(_0x1d0702){if(_0x1d0702){_0x201a83=_0x1d0702[_0x118c('0x55')];if(!_0x481343[_0x118c('0x4b')][_0x118c('0xdb')](_0x118c('0xdc'))){_0x14472c[_0x118c('0x1e')]=qs[_0x118c('0x1e')](_0x481343[_0x118c('0x4b')][_0x118c('0x1e')]);_0x14472c['offset']=qs[_0x118c('0x1d')](_0x481343[_0x118c('0x4b')]['offset']);}return _0x252a06['getTeams'](_0x14472c);}})[_0x118c('0x22')](function(_0x3c9008){if(_0x3c9008){return _0x3c9008?{'count':_0x201a83,'rows':_0x3c9008}:null;}})[_0x118c('0x22')](respondWithResult(_0x2c20d3,null))[_0x118c('0x2c')](handleError(_0x2c20d3,null));};exports[_0x118c('0x113')]=function(_0x384234,_0x3947e2){var _0x38abf4=_0x384234['params']['id'];var _0x2cd479=_0x384234[_0x118c('0x5d')]?_0x384234[_0x118c('0x5d')][_0x118c('0x63')]:null;var _0x44c136=[];return Promise['resolve']()[_0x118c('0x22')](function(){if(!_0x2cd479)throw new APIBadRequestError(_0x118c('0x114'));})[_0x118c('0x22')](function(){return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x38abf4}});})[_0x118c('0x22')](function(_0x2e3b78){if(!_0x2e3b78)throw new APINotFoundError(util[_0x118c('0xaa')]('User\x20with\x20id\x20%s\x20not\x20found',_0x384234[_0x118c('0x5f')]['id']));return db[_0x118c('0x6a')][_0x118c('0x115')](function(_0x5536ff){return _0x2e3b78[_0x118c('0x113')](_0x2cd479,{'transaction':_0x5536ff})[_0x118c('0x22')](function(){return db[_0x118c('0x112')][_0x118c('0x52')]({'where':{'id':{'$in':_0x2cd479}}});})[_0x118c('0x22')](function(_0x3d7929){var _0x286969=_[_0x118c('0x3a')](_0x3d7929,function(_0x5412ce){return _0x5412ce[_0x118c('0x116')]();});return Promise['all'](_0x286969);})['then'](function(_0x5be830){_0x44c136=_[_0x118c('0x117')](_0x5be830);var _0x5c3adb=_[_0x118c('0x3a')](_0x44c136,function(_0x2fe6c6){return _0x2fe6c6['addAgent'](_0x2e3b78['id'],{'transaction':_0x5536ff});});return Promise[_0x118c('0x8a')](_0x5c3adb);})[_0x118c('0x22')](function(){if(!_0x2e3b78[_0x118c('0x109')])return;var _0x4a94d8=_['filter'](_0x44c136,function(_0x57fe5a){return _0x57fe5a[_0x118c('0x118')](_0x118c('0xaf'))===_0x118c('0x119');});var _0x5dfc24=_['map'](_0x4a94d8,function(_0x27a68e){return db[_0x118c('0xad')][_0x118c('0xae')]({'membername':_0x2e3b78[_0x118c('0x3d')],'UserId':_0x2e3b78['id'],'queue_name':_0x27a68e[_0x118c('0x3d')],'VoiceQueueId':_0x27a68e['id'],'interface':_[_0x118c('0x68')](_0x2e3b78[_0x118c('0xa9')])?util[_0x118c('0xaa')](_0x118c('0xab'),_0x2e3b78[_0x118c('0x3d')]):_0x2e3b78[_0x118c('0xa9')],'paused':_0x2e3b78[_0x118c('0x9f')]||![],'penalty':_0x2e3b78['penalty']},{'transaction':_0x5536ff});});return Promise[_0x118c('0x8a')](_0x5dfc24);})['then'](function(){return db[_0x118c('0x11a')][_0x118c('0x52')]({'where':{'teamId':{'$in':_0x2cd479}}});})[_0x118c('0x22')](function(_0x51dfd5){var _0x3de49d=_[_0x118c('0x3a')](_0x51dfd5,function(_0x27e024){return db[_0x118c('0x11b')][_0x118c('0x7d')]({'UserId':_0x2e3b78['id'],'VoicePrefixId':_0x27e024[_0x118c('0x11c')]},{'transaction':_0x5536ff});});return Promise[_0x118c('0x8a')](_0x3de49d);});});})[_0x118c('0x22')](function(){for(var _0x2c0ff0=0x0;_0x2c0ff0<_0x44c136['length'];_0x2c0ff0++){var _0x47c466=_0x44c136[_0x2c0ff0][_0x118c('0x118')](_0x118c('0xaf'));var _0x569c27=_0x47c466+_0x118c('0xa6');socket[_0x118c('0x30')](_0x118c('0x36')+_0x47c466+'Queue:save',{'UserId':_0x38abf4,['queueField']:_0x44c136[_0x2c0ff0]['id']});}})[_0x118c('0x22')](respondWithStatusCode(_0x3947e2,null))[_0x118c('0x2c')](APIHandleError(_0x3947e2));};exports['removeTeams']=function(_0x53dd20,_0x52da0b){var _0x1111e5=_0x53dd20[_0x118c('0x5f')]['id'];var _0x387600=null;if(_0x53dd20[_0x118c('0x4b')]['ids']){_0x387600=_['isArray'](_0x53dd20[_0x118c('0x4b')][_0x118c('0x63')])?_0x53dd20[_0x118c('0x4b')]['ids']:[_0x53dd20[_0x118c('0x4b')][_0x118c('0x63')]];}var _0x5320d8=[];return Promise[_0x118c('0x11d')]()[_0x118c('0x22')](function(){if(!_0x387600)throw new APIBadRequestError(_0x118c('0x11e'));})[_0x118c('0x22')](function(){return db[_0x118c('0x40')][_0x118c('0x97')]({'where':{'id':_0x1111e5}});})[_0x118c('0x22')](function(_0x2d89fb){if(!_0x2d89fb)throw new APINotFoundError(util[_0x118c('0xaa')]('User\x20with\x20id\x20%s\x20not\x20found',_0x53dd20[_0x118c('0x5f')]['id']));return db[_0x118c('0x6a')][_0x118c('0x115')](function(_0x51d749){return _0x2d89fb[_0x118c('0x11f')](_0x387600,{'transaction':_0x51d749})[_0x118c('0x22')](function(){return db[_0x118c('0x112')][_0x118c('0x52')]({'where':{'id':{'$in':_0x387600}}});})[_0x118c('0x22')](function(_0x43ec3d){var _0x55f207=_[_0x118c('0x3a')](_0x43ec3d,function(_0x550cfc){return _0x550cfc[_0x118c('0x116')]();});return Promise[_0x118c('0x8a')](_0x55f207);})['then'](function(_0x5cf91f){_0x5320d8=_[_0x118c('0x117')](_0x5cf91f);var _0x578a73=_[_0x118c('0x3a')](_0x5320d8,function(_0x2aab8c){return _0x2aab8c[_0x118c('0x120')](_0x2d89fb['id'],{'transaction':_0x51d749});});return Promise[_0x118c('0x8a')](_0x578a73);})[_0x118c('0x22')](function(){if(!_0x2d89fb[_0x118c('0x109')])return;var _0xf3e849=_['filter'](_0x5320d8,function(_0x1cd948){return _0x1cd948[_0x118c('0x118')](_0x118c('0xaf'))===_0x118c('0x119');});var _0x30fcbc=_[_0x118c('0x3a')](_0xf3e849,function(_0x10f917){return db['UserVoiceQueueRt'][_0x118c('0x32')]({'where':{'VoiceQueueId':_0x10f917['id'],'UserId':_0x2d89fb['id']},'transaction':_0x51d749});});return Promise[_0x118c('0x8a')](_0x30fcbc);})[_0x118c('0x22')](function(){return db[_0x118c('0x11a')][_0x118c('0x52')]({'where':{'teamId':{'$in':_0x387600}}});})[_0x118c('0x22')](function(_0x3a36fa){var _0x2cf25c=_[_0x118c('0x3a')](_0x3a36fa,function(_0x52e4b6){return db[_0x118c('0x11b')]['destroy']({'where':{'UserId':_0x2d89fb['id'],'VoicePrefixId':_0x52e4b6['VoicePrefixId']}},{'transaction':_0x51d749});});return Promise[_0x118c('0x8a')](_0x2cf25c);});});})[_0x118c('0x22')](function(){for(var _0x1daea0=0x0;_0x1daea0<_0x5320d8[_0x118c('0x55')];_0x1daea0++){var _0x28fe06=_0x5320d8[_0x1daea0]['getDataValue'](_0x118c('0xaf'));var _0x3b8481=_0x28fe06+_0x118c('0xa6');socket[_0x118c('0x30')]('user'+_0x28fe06+_0x118c('0xb2'),{'UserId':_0x1111e5,['queueField']:_0x5320d8[_0x1daea0]['id']});}})[_0x118c('0x22')](respondWithStatusCode(_0x52da0b,null))[_0x118c('0x2c')](APIHandleError(_0x52da0b));};exports[_0x118c('0x121')]=function(_0x4cb9b9,_0x66f493){var _0xf6dbc6={};var _0x295bfc={};var _0x177eee;var _0x1b4321;return db['User'][_0x118c('0x97')]({'where':{'id':_0x4cb9b9['params']['id']}})[_0x118c('0x22')](handleEntityNotFound(_0x66f493,null))['then'](function(_0x3320ee){if(_0x3320ee){_0x177eee=_0x3320ee;_0x295bfc[_0x118c('0xce')]=_['keys'](db[_0x118c('0xc8')]['rawAttributes']);_0x295bfc[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0x4cb9b9[_0x118c('0x4b')]);_0x295bfc[_0x118c('0xd1')]=_['intersection'](_0x295bfc[_0x118c('0xce')],_0x295bfc['query']);_0xf6dbc6['attributes']=_[_0x118c('0xd2')](_0x295bfc[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x4cb9b9[_0x118c('0x4b')]['fields']));_0xf6dbc6[_0x118c('0x50')]=_0xf6dbc6[_0x118c('0x50')]['length']?_0xf6dbc6[_0x118c('0x50')]:_0x295bfc['model'];_0xf6dbc6[_0x118c('0xd4')]=qs['sort'](_0x4cb9b9[_0x118c('0x4b')]['sort']);_0xf6dbc6[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_['pick'](_0x4cb9b9[_0x118c('0x4b')],_0x295bfc[_0x118c('0xd1')]));if(_0x4cb9b9[_0x118c('0x4b')][_0x118c('0x38')]){_0xf6dbc6[_0x118c('0x4a')]=_['merge'](_0xf6dbc6[_0x118c('0x4a')],{'$or':_['map'](_0xf6dbc6[_0x118c('0x50')],function(_0x10b34e){var _0x4cd906={};_0x4cd906[_0x10b34e]={'$like':'%'+_0x4cb9b9[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x4cd906;})});}_0xf6dbc6=_[_0x118c('0xd7')]({},_0xf6dbc6,_0x4cb9b9[_0x118c('0xd8')]);return _0x177eee['getLists'](_0xf6dbc6);}})[_0x118c('0x22')](function(_0x1fcf1a){if(_0x1fcf1a){_0x1b4321=_0x1fcf1a[_0x118c('0x55')];if(!_0x4cb9b9['query'][_0x118c('0xdb')](_0x118c('0xdc'))){_0xf6dbc6[_0x118c('0x1e')]=qs[_0x118c('0x1e')](_0x4cb9b9['query'][_0x118c('0x1e')]);_0xf6dbc6[_0x118c('0x1d')]=qs[_0x118c('0x1d')](_0x4cb9b9[_0x118c('0x4b')]['offset']);}return _0x177eee[_0x118c('0x121')](_0xf6dbc6);}})[_0x118c('0x22')](function(_0x5ec49f){if(_0x5ec49f){return _0x5ec49f?{'count':_0x1b4321,'rows':_0x5ec49f}:null;}})[_0x118c('0x22')](respondWithResult(_0x66f493,null))['catch'](handleError(_0x66f493,null));};exports[_0x118c('0x122')]=function(_0x33557c,_0xe31c70){var _0x1c04e4={};var _0x3517ed={};var _0x899f0b;return db[_0x118c('0x40')]['findOne']({'where':{'id':_0x33557c[_0x118c('0x5f')]['id']}})[_0x118c('0x22')](handleEntityNotFound(_0xe31c70,null))['then'](function(_0xef2050){if(_0xef2050){_0x899f0b=_0xef2050;_0x3517ed[_0x118c('0xce')]=_[_0x118c('0xcf')](db['User'][_0x118c('0xd0')]);_0x3517ed[_0x118c('0x4b')]=_[_0x118c('0xcf')](_0x33557c['query']);_0x3517ed[_0x118c('0xd1')]=_[_0x118c('0xd2')](_0x3517ed[_0x118c('0xce')],_0x3517ed[_0x118c('0x4b')]);_0x1c04e4['attributes']=_[_0x118c('0xd2')](_0x3517ed[_0x118c('0xce')],qs[_0x118c('0xd3')](_0x33557c[_0x118c('0x4b')]['fields']));_0x1c04e4[_0x118c('0x50')]=_0x1c04e4[_0x118c('0x50')][_0x118c('0x55')]?_0x1c04e4[_0x118c('0x50')]:_0x3517ed[_0x118c('0xce')];_0x1c04e4[_0x118c('0xd4')]=qs[_0x118c('0xd5')](_0x33557c[_0x118c('0x4b')][_0x118c('0xd5')]);_0x1c04e4[_0x118c('0x4a')]=qs[_0x118c('0xd1')](_[_0x118c('0xd6')](_0x33557c[_0x118c('0x4b')],_0x3517ed[_0x118c('0xd1')]));if(_0x33557c['query'][_0x118c('0x38')]){_0x1c04e4['where']=_[_0x118c('0xd7')](_0x1c04e4['where'],{'$or':_[_0x118c('0x3a')](_0x1c04e4['attributes'],function(_0x55d027){var _0x21853a={};_0x21853a[_0x55d027]={'$like':'%'+_0x33557c[_0x118c('0x4b')][_0x118c('0x38')]+'%'};return _0x21853a;})});}_0x1c04e4[_0x118c('0xce')]=db[_0x118c('0x40')];_0x1c04e4['as']=_0x118c('0x37');_0x1c04e4=_[_0x118c('0xd7')]({},_0x1c04e4,_0x33557c[_0x118c('0xd8')]);return _0x899f0b[_0x118c('0xf7')]({'include':[_0x1c04e4]});}})['then'](function(_0x18f50d){if(_0x18f50d){var _0xdf6c38={},_0x447e3f=[];for(var _0x2752bc=0x0;_0x2752bc<_0x18f50d[_0x118c('0x55')];_0x2752bc+=0x1){for(var _0x597c59=0x0,_0x3b7da8;_0x597c59<_0x18f50d[_0x2752bc][_0x118c('0x37')][_0x118c('0x55')];_0x597c59+=0x1){_0x3b7da8=_0x18f50d[_0x2752bc]['Agents'][_0x597c59][_0x118c('0x33')]({'plain':!![]});_0xdf6c38[_0x3b7da8['id']]=_0x3b7da8;}}_0xdf6c38=_[_0x118c('0x123')](_0xdf6c38);for(var _0x471dd3=qs[_0x118c('0x1d')](_0x33557c[_0x118c('0x4b')][_0x118c('0x1d')]);_0x471dd3<_0xdf6c38[_0x118c('0x55')]&&_0x447e3f[_0x118c('0x55')]=_0x47eb95){_0x72d454=_0x47eb95;_0x45afef=0xc8;}else{_0x45afef=0xce;}_0x4ebc31['status'](_0x45afef);return _0x4ebc31[_0x1080('0x1f')]('Content-Range',_0x3f9993+'-'+_0x72d454+'/'+_0x47eb95)['json'](_0x214593);}return null;};}function respondWithRpcPromise(_0x56b137,_0x27287d,_0x1f9be1,_0x1bb1be){return new Promise(function(_0x2301a9,_0x17ce37){var _0x271e15=_0x1bb1be||amiClient;return _0x271e15['request'](_0x56b137,_0x1f9be1)[_0x1080('0x20')](function(_0x2d3e83){logger[_0x1080('0x21')]('User,\x20%s,\x20%s',_0x27287d,_0x1080('0x22'));logger['debug'](_0x1080('0x23'),_0x27287d,'request\x20sent',JSON[_0x1080('0x24')](_0x2d3e83));if(_0x2d3e83[_0x1080('0x25')]){if(_0x2d3e83[_0x1080('0x25')]['code']===0x1f4){logger[_0x1080('0x25')](_0x1080('0x26'),_0x27287d,_0x2d3e83[_0x1080('0x25')][_0x1080('0x27')]);return _0x17ce37(_0x2d3e83[_0x1080('0x25')]['message']);}logger['error'](_0x1080('0x26'),_0x27287d,_0x2d3e83['error'][_0x1080('0x27')]);return _0x2301a9(_0x2d3e83[_0x1080('0x25')][_0x1080('0x27')]);}else{logger['info'](_0x1080('0x26'),_0x27287d,_0x1080('0x22'));_0x2301a9(_0x2d3e83[_0x1080('0x28')][_0x1080('0x27')]);}})['catch'](function(_0x199353){logger[_0x1080('0x25')](_0x1080('0x26'),_0x27287d,_0x199353);_0x17ce37(_0x199353);});});}function saveUpdates(_0xd1b9c5){return function(_0x207306){if(_0x207306){return _0x207306[_0x1080('0x29')](_0xd1b9c5)[_0x1080('0x20')](function(_0xf087b){if(_0xf087b[_0x1080('0x2a')]==='agent'){socket[_0x1080('0x2b')]('userNotification:recalc:'+_0xf087b['id'],_0xf087b);}return _0xf087b;});}return null;};}function removeEntity(_0x2948c6,_0x47d94e){return function(_0x4a81a6){if(_0x4a81a6){return _0x4a81a6['destroy']({'transaction':_0x47d94e})[_0x1080('0x20')](function(){var _0x3f7382=_0x4a81a6[_0x1080('0x2c')]({'plain':!![]});if(_0x3f7382[_0x1080('0x2a')]==='admin')return;var _0x21f2ea=[{'name':_0x1080('0x2d'),'value':_0x1080('0x2e'),'ignore':!![]},{'name':_0x1080('0x2f'),'value':_0x1080('0x30'),'ignore':![]},{'name':_0x1080('0x31'),'value':'telephone','ignore':![]}];var _0x16e025=_(_0x21f2ea)[_0x1080('0x32')](_0x1080('0x33'))[_0x1080('0x34')](_0x1080('0x35'))[_0x1080('0x35')]();if(_[_0x1080('0x36')](_0x16e025,_0x3f7382['role'])){return;}var _0x5b0282=_[_0x1080('0x37')](_0x21f2ea,[_0x1080('0x35'),_0x3f7382[_0x1080('0x2a')]])[_0x1080('0x38')];return db[_0x1080('0x39')]['destroy']({'where':{'type':_0x5b0282,'resourceId':_0x3f7382['id']},'transaction':_0x47d94e})[_0x1080('0x20')](function(){return _0x4a81a6;});})[_0x1080('0x20')](function(){_0x2948c6[_0x1080('0x18')](0xcc)[_0x1080('0x19')]();});}};}function handleEntityNotFound(_0x163d4b){return function(_0x5ee9bf){if(!_0x5ee9bf){_0x163d4b[_0x1080('0x3a')](0x194);}return _0x5ee9bf;};}function handleError(_0x494b35,_0x3e0e75){_0x3e0e75=_0x3e0e75||0x1f4;return function(_0x57c74c){logger[_0x1080('0x25')](_0x57c74c[_0x1080('0x3b')]);if(_0x57c74c['name']){delete _0x57c74c[_0x1080('0x38')];}_0x494b35[_0x1080('0x18')](_0x3e0e75)['send'](_0x57c74c);};}function getUserAttributes(){return _(db[_0x1080('0x3c')]['rawAttributes'])['map'](function(_0x1481da){return{'name':_0x1481da[_0x1080('0x3d')],'type':_0x1481da[_0x1080('0x3e')][_0x1080('0x3f')]};})['filter'](function(_0x3d440f){return![_0x1080('0x40'),_0x1080('0x41'),_0x1080('0x42'),'resetPasswordToken',_0x1080('0x43'),_0x1080('0x44')][_0x1080('0x36')](_0x3d440f['name']);})[_0x1080('0x35')]();}exports['index']=function(_0x1a5603,_0x945370){var _0x4b5552={},_0xcc8221={'count':0x0,'rows':[]};var _0x4e2357=getUserAttributes();_0x4b5552=qs['getOptions'](_0x4e2357,_0x1a5603);var _0x1b33c1={'where':_0x4b5552['where']};return db[_0x1080('0x3c')][_0x1080('0x1e')](_0x1b33c1)['then'](function(_0xc385bc){_0xcc8221[_0x1080('0x1e')]=_0xc385bc;if(_0x1a5603['query'][_0x1080('0x45')]){_0x4b5552[_0x1080('0x46')]=[{'all':!![]}];}if(_0x1a5603[_0x1080('0x47')]['userSetting']===_0x1080('0x48')){_0x4b5552[_0x1080('0x46')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0x1080('0x36')](_0x4b5552[_0x1080('0x49')],'id')){_0x4b5552[_0x1080('0x49')][_0x1080('0x4a')]('id');}return db[_0x1080('0x3c')][_0x1080('0x4b')](_0x4b5552);})[_0x1080('0x20')](function(_0x48ce99){_0xcc8221[_0x1080('0x4c')]=_0x48ce99;if(_0x1a5603[_0x1080('0x47')][_0x1080('0x4d')]===_0x1080('0x48')){var _0x168316=[];for(var _0x125196=0x0;_0x125196<_0xcc8221['rows'][_0x1080('0x4e')];_0x125196++){_0x168316[_0x1080('0x4a')](get_open_tabs(_0x1080('0x4f'),_0xcc8221[_0x1080('0x4c')][_0x125196][_0x1080('0x50')]));_0x168316[_0x1080('0x4a')](get_open_tabs('sms',_0xcc8221[_0x1080('0x4c')][_0x125196][_0x1080('0x50')]));_0x168316[_0x1080('0x4a')](get_open_tabs(_0x1080('0x51'),_0xcc8221[_0x1080('0x4c')][_0x125196][_0x1080('0x50')]));_0x168316['push'](get_open_tabs(_0x1080('0x52'),_0xcc8221['rows'][_0x125196][_0x1080('0x50')]));_0x168316[_0x1080('0x4a')](get_open_tabs(_0x1080('0x53'),_0xcc8221[_0x1080('0x4c')][_0x125196]['dataValues']));_0x168316[_0x1080('0x4a')](get_open_tabs(_0x1080('0x54'),_0xcc8221['rows'][_0x125196][_0x1080('0x50')]));}return Promise[_0x1080('0x55')](_0x168316)[_0x1080('0x20')](function(){return _0xcc8221;});}else{return _0xcc8221;}})[_0x1080('0x20')](respondWithFilteredResult(_0x945370,_0x4b5552))['catch'](handleError(_0x945370,null));};exports[_0x1080('0x56')]=function(_0x3ba042,_0x4f03da){var _0x2b4e56=getUserAttributes();_0x3ba042['query']['id']=_0x3ba042[_0x1080('0x57')]['id'];var _0x591af8=qs[_0x1080('0x58')](_0x2b4e56,_0x3ba042);if(_0x3ba042[_0x1080('0x47')][_0x1080('0x45')]){_0x591af8[_0x1080('0x46')]=[{'all':!![]}];}if(_0x3ba042[_0x1080('0x47')][_0x1080('0x59')]==='true'){_0x591af8['include']=[{'model':db[_0x1080('0x5a')],'as':_0x1080('0x59')}];}_0x591af8=_[_0x1080('0x5b')]({},_0x591af8,_0x3ba042[_0x1080('0x5c')]);if(!_['includes'](_0x591af8[_0x1080('0x49')],'id')){_0x591af8['attributes'][_0x1080('0x4a')]('id');}return db[_0x1080('0x3c')]['find'](_0x591af8)[_0x1080('0x20')](handleEntityNotFound(_0x4f03da,null))[_0x1080('0x20')](function(_0x38c991){var _0x573962=[];values=_0x38c991;if(_0x3ba042['query'][_0x1080('0x4d')]===_0x1080('0x48')){_0x573962[_0x1080('0x4a')](get_open_tabs('chat',_0x38c991['dataValues']));_0x573962[_0x1080('0x4a')](get_open_tabs('sms',_0x38c991['dataValues']));_0x573962[_0x1080('0x4a')](get_open_tabs(_0x1080('0x53'),_0x38c991['dataValues']));_0x573962[_0x1080('0x4a')](get_open_tabs(_0x1080('0x54'),_0x38c991[_0x1080('0x50')]));_0x573962['push'](get_open_tabs('fax',_0x38c991[_0x1080('0x50')]));_0x573962['push'](get_open_tabs(_0x1080('0x52'),_0x38c991[_0x1080('0x50')]));return Promise[_0x1080('0x55')](_0x573962);}else{return values;}})[_0x1080('0x20')](function(){return values;})[_0x1080('0x20')](respondWithResult(_0x4f03da,null))['catch'](handleError(_0x4f03da,null));};exports['update']=function(_0x6d4918,_0x55f105){if(_0x6d4918['body']['id']){delete _0x6d4918[_0x1080('0x5d')]['id'];}delete _0x6d4918[_0x1080('0x5d')][_0x1080('0x2a')];return db[_0x1080('0x3c')][_0x1080('0x37')]({'where':{'id':_0x6d4918[_0x1080('0x57')]['id']}})['then'](handleEntityNotFound(_0x55f105,null))[_0x1080('0x20')](saveUpdates(_0x6d4918[_0x1080('0x5d')],null))[_0x1080('0x20')](respondWithResult(_0x55f105,null))['catch'](handleError(_0x55f105,null));};exports[_0x1080('0x5e')]=function(_0x139293,_0x1c2c78){return db['User'][_0x1080('0x5e')]()[_0x1080('0x20')](respondWithResult(_0x1c2c78,null))['catch'](handleError(_0x1c2c78,null));};exports[_0x1080('0x5f')]=function(_0x340bf2,_0x3d6adc){return db[_0x1080('0x3c')]['find']({'where':{'id':_0x340bf2['params']['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x3d6adc,null))[_0x1080('0x20')](function(_0x54da32){if(_0x54da32){return _0x54da32['addContacts'](_0x340bf2[_0x1080('0x5d')][_0x1080('0x60')],_[_0x1080('0x61')](_0x340bf2[_0x1080('0x5d')],['ids','id'])||{});}})[_0x1080('0x20')](respondWithResult(_0x3d6adc,null))[_0x1080('0x62')](handleError(_0x3d6adc,null));};function validateUser(_0x44a3d7){return new Promise(function(_0x36b859,_0x3fe610){if(_0x44a3d7[_0x1080('0x63')])return _0x36b859(_0x44a3d7);return db['Setting'][_0x1080('0x64')](0x1)['then'](function(_0x3dc72e){if(_0x3dc72e[_0x1080('0x65')])authService[_0x1080('0x66')](_0x44a3d7[_0x1080('0x40')]);db['User']['max']('internal')['then'](function(_0x6253e6){if(_[_0x1080('0x67')](_0x6253e6)){_0x44a3d7[_0x1080('0x63')]=_0x3dc72e['min_internal']||0x1;return;}if(_[_0x1080('0x67')](_0x3dc72e[_0x1080('0x68')])||_0x3dc72e[_0x1080('0x68')]===_0x6253e6){_0x44a3d7[_0x1080('0x63')]=_0x6253e6+0x1;return;}if(_0x3dc72e[_0x1080('0x68')]>_0x6253e6){_0x44a3d7[_0x1080('0x63')]=_0x3dc72e['min_internal'];return;}return db['sequelize'][_0x1080('0x47')](_0x1080('0x69'),{'type':db[_0x1080('0x6a')][_0x1080('0x6b')][_0x1080('0x6c')]})[_0x1080('0x20')](function(_0x2ec141){if(_0x2ec141&&_0x2ec141[_0x1080('0x4e')]){for(var _0x30c280=0x0,_0x142cff=_0x2ec141['length'];_0x30c280<_0x142cff&&_[_0x1080('0x67')](_0x44a3d7[_0x1080('0x63')]);_0x30c280++){if(_0x3dc72e[_0x1080('0x68')]<=_0x2ec141[_0x30c280][_0x1080('0x6d')]){_0x44a3d7[_0x1080('0x63')]=_0x2ec141[_0x30c280][_0x1080('0x6d')];}else if(_0x3dc72e[_0x1080('0x68')]>_0x2ec141[_0x30c280]['from']&&_0x3dc72e[_0x1080('0x68')]<=_0x2ec141[_0x30c280]['to']){_0x44a3d7[_0x1080('0x63')]=_0x3dc72e[_0x1080('0x68')];}}}if(_[_0x1080('0x67')](_0x44a3d7[_0x1080('0x63')])){_0x44a3d7[_0x1080('0x63')]=_0x6253e6+0x1;}return _0x36b859(_0x44a3d7);});});})[_0x1080('0x62')](function(_0x555ba5){_0x3fe610(_0x555ba5);});});}function updateUser(_0x999f99){return new Promise(function(_0x9bdfb0,_0x2cd541){try{if(_0x999f99[_0x1080('0x6e')]){_0x999f99[_0x1080('0x6f')]=_0x999f99[_0x1080('0x63')];_0x999f99[_0x1080('0x70')]={'mailbox':_0x999f99[_0x1080('0x63')],'password':_0x999f99[_0x1080('0x40')],'fullname':_0x999f99['fullname'],'email':_0x999f99['email']};}if(_0x999f99['role']===_0x1080('0x30')){if(!_0x999f99[_0x1080('0x71')])_0x999f99['permissions']=[_0x1080('0x72'),_0x1080('0x73'),_0x1080('0x74'),'113',_0x1080('0x75'),_0x1080('0x76'),_0x1080('0x77'),_0x1080('0x78'),_0x1080('0x79'),_0x1080('0x7a'),_0x1080('0x7b'),_0x1080('0x7c'),_0x1080('0x7d'),_0x1080('0x7e'),_0x1080('0x7f')];}_0x9bdfb0(_0x999f99);}catch(_0x595c8b){_0x2cd541(_0x595c8b);}});}exports[_0x1080('0x80')]=function(_0x3e4d00,_0x325625){if(_0x3e4d00['user'][_0x1080('0x2a')]==='agent')throw new Error(_0x1080('0x81'));if(_0x3e4d00[_0x1080('0x5d')][_0x1080('0x2a')]===_0x1080('0x2e')&&_0x3e4d00[_0x1080('0x2e')]['role']!=='admin'){throw new Error(_0x1080('0x82'));}if(_0x3e4d00['body'][_0x1080('0x2a')]==='admin'&&_0x3e4d00[_0x1080('0x2e')][_0x1080('0x2a')]!==_0x1080('0x83')){throw new Error(_0x1080('0x84'));}return licenseUtil[_0x1080('0x85')]([_0x3e4d00[_0x1080('0x5d')]])[_0x1080('0x20')](function(){return validateUser(_0x3e4d00[_0x1080('0x5d')]);})[_0x1080('0x20')](function(_0x583df8){return updateUser(_0x583df8)['then'](function(_0x4f8de6){if(_0x4f8de6['role']==='admin'){_0x4f8de6['settingsEnabled']=_0x3e4d00[_0x1080('0x2e')][_0x1080('0x86')];delete _0x4f8de6[_0x1080('0x87')];}return _0x4f8de6;});})[_0x1080('0x20')](function(_0x1b424e){return db[_0x1080('0x3c')][_0x1080('0x80')](_0x1b424e,{'include':[{'model':db[_0x1080('0x70')],'as':'VoiceMail'}]});})[_0x1080('0x20')](function(_0x4bc3d9){if(_0x3e4d00[_0x1080('0x5d')][_0x1080('0x2a')]===_0x1080('0x2e'))return _0x4bc3d9;if(_0x3e4d00[_0x1080('0x2e')]['role']!==_0x1080('0x2e'))return _0x4bc3d9;return db[_0x1080('0x88')][_0x1080('0x37')]({'where':{'name':_0x4bc3d9[_0x1080('0x2a')]==='agent'?_0x1080('0x2f'):_0x1080('0x31'),'userProfileId':_0x3e4d00[_0x1080('0x2e')][_0x1080('0x87')]},'raw':!![]})[_0x1080('0x20')](function(_0x432cca){if(!_0x432cca||_0x432cca[_0x1080('0x89')]!=0x0)return _0x4bc3d9;return db[_0x1080('0x39')]['create']({'name':_0x4bc3d9[_0x1080('0x38')],'resourceId':_0x4bc3d9['id'],'type':_0x432cca[_0x1080('0x38')],'sectionId':_0x432cca['id']},{})['then'](function(){return _0x4bc3d9;});})['catch'](function(_0xc88ee){logger[_0x1080('0x25')](_0x1080('0x8a'),_0xc88ee);throw _0xc88ee;});})['then'](respondWithResult(_0x325625,0xc9))[_0x1080('0x62')](handleError(_0x325625,null));};exports[_0x1080('0x8b')]=function(_0x32df7c,_0x1ca0c7){var _0x1b0841=_0x32df7c[_0x1080('0x5d')];var _0x2bf67=[];if(_0x32df7c[_0x1080('0x2e')]['role']===_0x1080('0x30'))throw new Error(_0x1080('0x81'));if(_[_0x1080('0x8c')](_0x1b0841,[_0x1080('0x2a'),_0x1080('0x2e')])&&_0x32df7c[_0x1080('0x2e')][_0x1080('0x2a')]!==_0x1080('0x83')){throw new Error(_0x1080('0x82'));}if(_[_0x1080('0x8c')](_0x1b0841,[_0x1080('0x2a'),_0x1080('0x83')])&&_0x32df7c[_0x1080('0x2e')]['role']!=='admin'){throw new Error(_0x1080('0x8d'));}return licenseUtil['checkUserLimits'](_0x1b0841)[_0x1080('0x20')](function(){return validateUser(_0x1b0841[0x0]);})[_0x1080('0x20')](function(){for(var _0x5185b0=0x1;_0x5185b0<_0x1b0841['length'];_0x5185b0++){var _0xa2c434=_0x1b0841[_0x5185b0-0x1][_0x1080('0x63')];if(!_0x1b0841[_0x5185b0][_0x1080('0x63')])_0x1b0841[_0x5185b0]['internal']=_0xa2c434+0x1;_0x2bf67[_0x1080('0x4a')](validateUser(_0x1b0841[_0x5185b0]));}return Promise['all'](_0x2bf67);})[_0x1080('0x20')](function(){_0x2bf67=[];for(var _0x559229=0x0;_0x559229<_0x1b0841[_0x1080('0x4e')];_0x559229++){_0x2bf67['push'](updateUser(_0x1b0841[_0x559229]));}return Promise[_0x1080('0x55')](_0x2bf67);})[_0x1080('0x20')](function(){_0x2bf67=_0x1b0841[_0x1080('0x34')](function(_0x19fb4f){return db[_0x1080('0x3c')]['create'](_0x19fb4f,{'include':[{'model':db[_0x1080('0x70')],'as':_0x1080('0x70')}]})['then'](function(_0x53f664){_0x19fb4f['id']=_0x53f664['id'];return _0x19fb4f;});});return Promise['all'](_0x2bf67);})[_0x1080('0x20')](function(_0x5af789){if(_0x32df7c['body']['role']===_0x1080('0x2e'))return _0x5af789;if(_0x32df7c[_0x1080('0x2e')][_0x1080('0x2a')]!==_0x1080('0x2e'))return _0x5af789;var _0xface21=_['some'](_0x5af789,function(_0x24836e){return _0x24836e['role']===_0x1080('0x30')||_0x24836e[_0x1080('0x2a')]===_0x1080('0x8e');});if(!_0xface21)return _0x5af789;return db[_0x1080('0x88')][_0x1080('0x4b')]({'where':{'name':{'$or':[_0x1080('0x2f'),'Telephones']},'userProfileId':_0x32df7c[_0x1080('0x2e')]['userProfileId']},'raw':!![]})[_0x1080('0x20')](function(_0x13c7ee){if(_[_0x1080('0x8f')](_0x13c7ee)||!_[_0x1080('0x8c')](_0x13c7ee,['autoAssociation',0x0]))return _0x5af789;_0x2bf67=[];var _0x2fa933=_(_0x13c7ee)[_0x1080('0x34')](function(_0x556a6b){if(_0x556a6b[_0x1080('0x89')]===0x1)return;return _0x556a6b[_0x1080('0x38')]==='Agents'?'agent':_0x1080('0x8e');})['compact']()['value']();for(var _0x143949=0x0;_0x143949<_0x5af789['length'];_0x143949++){if(!_['includes'](_0x2fa933,_0x5af789[_0x143949][_0x1080('0x2a')]))return;var _0xfbacef=_0x5af789[_0x143949][_0x1080('0x2a')]===_0x1080('0x30')?_0x1080('0x2f'):_0x1080('0x31');_0x2bf67[_0x1080('0x4a')](db[_0x1080('0x39')][_0x1080('0x80')]({'name':_0x5af789[_0x143949][_0x1080('0x38')],'resourceId':_0x5af789[_0x143949]['id'],'type':_0xfbacef,'sectionId':_['find'](_0x13c7ee,[_0x1080('0x38'),_0xfbacef])['id']},{}));}return Promise[_0x1080('0x55')](_0x2bf67);});})['then'](respondWithResult(_0x1ca0c7,0xc9))[_0x1080('0x62')](handleError(_0x1ca0c7,null));};exports[_0x1080('0x90')]=function(_0x1ff8b2,_0x4a6eab){if(_0x1ff8b2['body']['id']){delete _0x1ff8b2[_0x1080('0x5d')]['id'];}return db[_0x1080('0x3c')]['find']({'where':{'id':_0x1ff8b2['params']['id']}})[_0x1080('0x20')](function(_0xbae2ea){if(!_0xbae2ea)return null;if(_0xbae2ea['id']===_0x1ff8b2[_0x1080('0x2e')]['id']){if(!_0x1ff8b2['body'][_0x1080('0x91')]||!_0x1ff8b2['body'][_0x1080('0x92')]){throw new db[(_0x1080('0x93'))]['ValidationError'](_0x1080('0x94'));}if(!_0xbae2ea['authenticate'](_0x1ff8b2[_0x1080('0x5d')][_0x1080('0x91')])){throw new db[(_0x1080('0x93'))][(_0x1080('0x95'))](_0x1080('0x96'));}if(_0x1ff8b2[_0x1080('0x5d')][_0x1080('0x91')]===_0x1ff8b2['body']['newPassword']){throw new db['Sequelize'][(_0x1080('0x95'))](_0x1080('0x97'));}}else if(_0x1ff8b2['user'][_0x1080('0x2a')]===_0x1080('0x83')){if(!_0x1ff8b2[_0x1080('0x5d')]['newPassword']){throw new db[(_0x1080('0x93'))][(_0x1080('0x95'))](_0x1080('0x98'));}}else if(_0x1ff8b2[_0x1080('0x2e')][_0x1080('0x2a')]===_0x1080('0x2e')){if(!_0x1ff8b2[_0x1080('0x5d')][_0x1080('0x92')]){throw new db['Sequelize'][(_0x1080('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0xbae2ea[_0x1080('0x2a')]!=='agent'){throw new db[(_0x1080('0x93'))][(_0x1080('0x95'))](_0x1080('0x81'));}}else{throw new db[(_0x1080('0x93'))]['ValidationError'](_0x1080('0x81'));}return _0xbae2ea;})[_0x1080('0x20')](handleEntityNotFound(_0x4a6eab,null))['then'](function(_0x5b546a){return db[_0x1080('0x99')][_0x1080('0x9a')]({'attributes':['id',_0x1080('0x65'),_0x1080('0x9b'),_0x1080('0x9c')]})[_0x1080('0x20')](function(_0x1a2b3a){if(_0x1a2b3a[_0x1080('0x65')])authService[_0x1080('0x66')](_0x1ff8b2[_0x1080('0x5d')]['newPassword']);if(!_0x1a2b3a['enforcePasswordHistory']||!_0x5b546a[_0x1080('0x42')])return _0x5b546a;authService[_0x1080('0x9d')](_0x1ff8b2['body'][_0x1080('0x92')],_0x5b546a[_0x1080('0x42')],_0x1a2b3a['passwordHistoryLimit']);return _0x5b546a;})[_0x1080('0x20')](saveUpdates({'password':_0x1ff8b2[_0x1080('0x5d')][_0x1080('0x92')],'passwordResetAt':_0x1ff8b2[_0x1080('0x2e')]['id']==_0x1ff8b2[_0x1080('0x57')]['id']?moment():null,'previousPasswords':authService[_0x1080('0x9e')](_0x1ff8b2[_0x1080('0x5d')]['newPassword'],_0x5b546a[_0x1080('0x42')])},null));})[_0x1080('0x20')](respondWithResult(_0x4a6eab,null))['catch'](handleError(_0x4a6eab,null));};exports[_0x1080('0x9f')]=function(_0x23b2e8,_0x189f30){var _0x1b6b9f=_0x23b2e8['body']['channel'];return db[_0x1080('0x3c')][_0x1080('0x37')]({'where':{'id':_0x23b2e8['params']['id']},'attributes':['id','name',_0x1080('0x2a'),'online',_0x1080('0xa0'),_0x1080('0xa1'),_0x1080('0xa2')]})[_0x1080('0x20')](handleEntityNotFound(_0x189f30,null))[_0x1080('0x20')](function(_0x47366a){if(_0x47366a){if(!utils['isValidChannel'](_0x1b6b9f)){throw new db['Sequelize'][(_0x1080('0x95'))](_0x1080('0xa3'));}return _0x47366a[_0x1080('0xa4')+_['capitalize'](_0x1b6b9f['toLowerCase']())+_0x1080('0xa5')](_0x23b2e8['body'][_0x1080('0x60')],{'penalty':_0x23b2e8[_0x1080('0x5d')]['penalty']||0x0})[_0x1080('0xa6')](function(_0x1eabf8){for(var _0x320e3f=0x0;_0x320e3f<_0x23b2e8[_0x1080('0x5d')][_0x1080('0x60')]['length'];_0x320e3f+=0x1){var _0x106d43={'UserId':Number(_0x23b2e8[_0x1080('0x57')]['id'])};_0x106d43[_[_0x1080('0xa7')](_0x1b6b9f[_0x1080('0xa8')]())+_0x1080('0xa9')]=Number(_0x23b2e8[_0x1080('0x5d')][_0x1080('0x60')][_0x320e3f]);socket[_0x1080('0x2b')]('user'+_[_0x1080('0xa7')](_0x1b6b9f[_0x1080('0xa8')]())+_0x1080('0xaa'),_0x106d43);}return _0x1eabf8;})[_0x1080('0x20')](function(){if(_0x1b6b9f===_0x1080('0xab')){return db[_0x1080('0xac')][_0x1080('0x4b')]({'where':{'id':_0x23b2e8[_0x1080('0x5d')][_0x1080('0x60')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x1080('0x20')](function(_0x5d41df){var _0x406a45=_0x47366a['get']({'plain':!![]});var _0x27cdbb=[];if(_0x1b6b9f===_0x1080('0xab')&&_0x406a45[_0x1080('0x2a')]===_0x1080('0x30')&&_0x406a45['online']){for(let _0xe37bbe=0x0;_0xe37bbe<_0x5d41df[_0x1080('0x4e')];_0xe37bbe+=0x1){_0x27cdbb[_0x1080('0x4a')]({'membername':_0x406a45[_0x1080('0x38')],'UserId':_0x406a45['id'],'queue_name':_0x5d41df[_0xe37bbe][_0x1080('0x38')],'VoiceQueueId':_0x5d41df[_0xe37bbe]['id'],'interface':_[_0x1080('0x67')](_0x406a45[_0x1080('0xa2')])?util[_0x1080('0xad')](_0x1080('0xae'),_0x406a45['name']):_0x406a45[_0x1080('0xa2')],'paused':_0x406a45[_0x1080('0xa1')]||![],'penalty':_0x23b2e8[_0x1080('0x5d')]['penalty']||0x0});}return Promise['all'](_0x27cdbb[_0x1080('0x34')](function(_0x4730cb){return db[_0x1080('0xaf')][_0x1080('0xb0')](_0x4730cb);}));}return _0x47366a;});}})[_0x1080('0x20')](respondWithStatusCode(_0x189f30,null))[_0x1080('0x62')](handleError(_0x189f30,null));};exports[_0x1080('0xb1')]=function(_0x40d72a,_0x40ea0c){var _0x2011bf,_0x425973;return db[_0x1080('0x3c')][_0x1080('0x37')]({'where':{'id':_0x40d72a[_0x1080('0x57')]['id']},'attributes':['id','name',_0x1080('0x2a')]})[_0x1080('0x20')](handleEntityNotFound(_0x40ea0c,null))['then'](function(_0x26a509){if(_0x26a509){_0x2011bf=_0x26a509;if(!_0x40d72a[_0x1080('0x47')][_0x1080('0xb2')]||!utils[_0x1080('0xb3')](_0x40d72a[_0x1080('0x47')]['channel'])){throw new db[(_0x1080('0x93'))][(_0x1080('0x95'))](_0x1080('0xa3'));}return _0x26a509['remove'+_[_0x1080('0xa7')](_0x40d72a['query'][_0x1080('0xb2')]['toLowerCase']())+'Queues'](_0x40d72a[_0x1080('0x47')][_0x1080('0x60')]);}})[_0x1080('0x20')](function(_0x1ddfae){if(_[_0x1080('0xb4')](_0x40d72a[_0x1080('0x47')][_0x1080('0x60')])){for(var _0x193b22=0x0;_0x193b22<_0x40d72a[_0x1080('0x47')]['ids'][_0x1080('0x4e')];_0x193b22+=0x1){_0x425973={'UserId':Number(_0x40d72a[_0x1080('0x57')]['id'])};_0x425973[_[_0x1080('0xa7')](_0x40d72a[_0x1080('0x47')][_0x1080('0xb2')][_0x1080('0xa8')]())+_0x1080('0xa9')]=Number(_0x40d72a[_0x1080('0x47')][_0x1080('0x60')][_0x193b22]);socket[_0x1080('0x2b')](_0x1080('0x2e')+_[_0x1080('0xa7')](_0x40d72a[_0x1080('0x47')]['channel'][_0x1080('0xa8')]())+'Queue:remove',_0x425973);}}else{_0x425973={'UserId':Number(_0x40d72a[_0x1080('0x57')]['id'])};_0x425973[_['capitalize'](_0x40d72a[_0x1080('0x47')]['channel'][_0x1080('0xa8')]())+'QueueId']=Number(_0x40d72a['query'][_0x1080('0x60')]);socket[_0x1080('0x2b')](_0x1080('0x2e')+_[_0x1080('0xa7')](_0x40d72a[_0x1080('0x47')]['channel']['toLowerCase']())+_0x1080('0xb5'),_0x425973);}return _0x1ddfae;})[_0x1080('0x20')](function(){if(_0x40d72a[_0x1080('0x47')][_0x1080('0xb2')]==='voice'){return db['UserVoiceQueueRt'][_0x1080('0xb6')]({'where':{'UserId':_0x40d72a['params']['id'],'VoiceQueueId':_0x40d72a[_0x1080('0x47')]['ids']},'individualHooks':!![]})[_0x1080('0x20')](function(){return _0x2011bf;});}return _0x2011bf;})['then'](respondWithStatusCode(_0x40ea0c,null))['catch'](handleError(_0x40ea0c,null));};exports['addAvatar']=function(_0x443318,_0x4920cd){_0x443318['body'][_0x1080('0xb7')]=_0x443318[_0x1080('0xb8')][_0x1080('0xb9')];return db['User']['find']({'where':{'id':_0x443318[_0x1080('0x57')]['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x4920cd,null))[_0x1080('0x20')](saveUpdates(_0x443318[_0x1080('0x5d')],null))[_0x1080('0x20')](respondWithResult(_0x4920cd,null))['catch'](handleError(_0x4920cd,null));};exports[_0x1080('0xba')]=function(_0x21ba70,_0x1ec91a){var _0x44cb75=path[_0x1080('0xbb')](config[_0x1080('0xbc')],_0x1080('0xbd'));return db[_0x1080('0x3c')][_0x1080('0x37')]({'where':{'id':_0x21ba70[_0x1080('0x57')]['id']},'attributes':['id',_0x1080('0xb7')],'raw':!![]})['then'](handleEntityNotFound(_0x1ec91a,null))['then'](function(_0x493376){if(_0x493376){if(_[_0x1080('0x67')](_0x493376[_0x1080('0xb7')])){return _0x1ec91a['download'](_0x44cb75);}else{if(!fs['existsSync'](path['join'](config['root'],'server/files/images/',_0x493376[_0x1080('0xb7')]))){return _0x1ec91a[_0x1080('0xbe')](_0x44cb75);}return _0x1ec91a[_0x1080('0xbe')](path['join'](config[_0x1080('0xbc')],_0x1080('0xbf'),_0x493376[_0x1080('0xb7')]));}}})[_0x1080('0x62')](handleError(_0x1ec91a,null));};exports[_0x1080('0xc0')]=function(_0x1ef604,_0x2cb5b6){return db[_0x1080('0x3c')]['find']({'where':{'id':_0x1ef604['params']['id']},'attributes':['id']})[_0x1080('0x20')](handleEntityNotFound(_0x2cb5b6,null))['then'](function(_0xfed3f8){var _0xf2427e=[];values=_0xfed3f8['dataValues'];_0xf2427e[_0x1080('0x4a')](get_open_tabs('chat',_0xfed3f8['dataValues']));_0xf2427e[_0x1080('0x4a')](get_open_tabs(_0x1080('0xc1'),_0xfed3f8['dataValues']));_0xf2427e['push'](get_open_tabs(_0x1080('0x53'),_0xfed3f8[_0x1080('0x50')]));_0xf2427e[_0x1080('0x4a')](get_open_tabs(_0x1080('0x54'),_0xfed3f8[_0x1080('0x50')]));_0xf2427e[_0x1080('0x4a')](get_open_tabs(_0x1080('0x51'),_0xfed3f8[_0x1080('0x50')]));_0xf2427e[_0x1080('0x4a')](get_open_tabs('mail',_0xfed3f8['dataValues']));return Promise[_0x1080('0x55')](_0xf2427e);})[_0x1080('0x20')](function(_0x3d4a11){if(_0x3d4a11){var _0x32ea2b=_[_0x1080('0x34')](values['ChatOpenTabs'],function(_0x5b722f){return{'channel':_0x1080('0xc2'),'id':_0x5b722f['id'],'createdAt':_0x5b722f[_0x1080('0xc3')]};});var _0x183653=_[_0x1080('0x34')](values[_0x1080('0xc4')],function(_0x54bd14){return{'channel':'FAX','id':_0x54bd14['id'],'createdAt':_0x54bd14[_0x1080('0xc3')]};});var _0x43c352=_['map'](values[_0x1080('0xc5')],function(_0x24a1b3){return{'channel':_0x1080('0xc6'),'id':_0x24a1b3['id'],'createdAt':_0x24a1b3[_0x1080('0xc3')]};});var _0x12f68c=_[_0x1080('0x34')](values[_0x1080('0xc7')],function(_0x45b57a){return{'channel':_0x1080('0xc8'),'id':_0x45b57a['id'],'createdAt':_0x45b57a[_0x1080('0xc3')]};});var _0x5aedff=_[_0x1080('0x34')](values[_0x1080('0xc9')],function(_0x4f5be4){return{'channel':_0x1080('0xca'),'id':_0x4f5be4['id'],'createdAt':_0x4f5be4['createdAt']};});var _0x31b4cf=_[_0x1080('0x34')](values['WhatsappOpenTabs'],function(_0x22e291){return{'channel':_0x1080('0xcb'),'id':_0x22e291['id'],'createdAt':_0x22e291['createdAt']};});var _0x8bc41a=_[_0x1080('0xcc')](_0x32ea2b,_0x183653,_0x43c352,_0x12f68c,_0x5aedff,_0x31b4cf);var _0x173cf8={'count':_0x8bc41a['length'],'rows':_0x8bc41a};return _0x173cf8;}else return null;})['then'](respondWithResult(_0x2cb5b6,null))[_0x1080('0x62')](handleError(_0x2cb5b6,null));};exports[_0x1080('0xcd')]=function(_0x29b718,_0xced221){var _0x419423={};return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x29b718[_0x1080('0x57')]['id']}})['then'](function(_0x264b5b){if(!_0x264b5b){throw new APINotFoundError(util[_0x1080('0xad')](_0x1080('0xce'),_0x29b718['params']['id']));}return contacts[_0x1080('0x5e')]();})[_0x1080('0x20')](function(_0x3e3f6f){_0x29b718['query'][_0x1080('0x3c')]=_0x29b718['params']['id'];_0x419423=qs['getOptions'](_0x3e3f6f,_0x29b718);if(_0x29b718[_0x1080('0x47')][_0x1080('0xcf')](_0x1080('0x45'))){_0x419423[_0x1080('0x46')]=[{'model':db[_0x1080('0xd0')],'as':_0x1080('0xd1'),'required':![]},{'model':db['Tag'],'as':_0x1080('0xd2'),'attributes':['id','name','color'],'where':_0x29b718[_0x1080('0x47')]['tag']?{'id':_0x29b718['query'][_0x1080('0xd3')]}:undefined,'required':_0x29b718[_0x1080('0x47')][_0x1080('0xd3')]?!![]:![]}];}return contacts['findAll'](_0x29b718['query'],_0x29b718[_0x1080('0x2e')],_0x419423,_0x3e3f6f);})[_0x1080('0x20')](respondWithFilteredResult(_0xced221,_0x419423))[_0x1080('0x62')](APIHandleError(_0xced221));};exports[_0x1080('0xd4')]=function(_0x42159d,_0x5ced4f){var _0x503d99;var _0x2946b6={};var _0x3940f0;return db[_0x1080('0x3c')]['findOne']({'where':{'id':_0x42159d['params']['id']},'attributes':['id',_0x1080('0x38'),_0x1080('0x2a')]})['then'](handleEntityNotFound(_0x5ced4f,null))[_0x1080('0x20')](function(_0x1a1554){if(!utils['isValidChannel'](_0x42159d[_0x1080('0x47')][_0x1080('0xb2')])){throw new db[(_0x1080('0x93'))][(_0x1080('0x95'))](_0x1080('0xa3'));}_0x503d99=_0x1a1554;var _0x497c4a={};_0x497c4a[_0x1080('0xd5')]=_[_0x1080('0xd6')](db[_['capitalize'](_0x42159d['query'][_0x1080('0xb2')])+'Queue'][_0x1080('0xd7')]);_0x497c4a[_0x1080('0x47')]=_['keys'](_0x42159d[_0x1080('0x47')]);_0x497c4a[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x497c4a[_0x1080('0xd5')],_0x497c4a[_0x1080('0x47')]);_0x2946b6[_0x1080('0x49')]=_['intersection'](_0x497c4a[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x42159d['query'][_0x1080('0xda')]));_0x2946b6[_0x1080('0x49')]=_0x2946b6['attributes'][_0x1080('0x4e')]?_0x2946b6[_0x1080('0x49')]:_0x497c4a[_0x1080('0xd5')];_0x2946b6[_0x1080('0xdb')]=qs[_0x1080('0xdc')](_0x42159d[_0x1080('0x47')]['sort']);_0x2946b6[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_[_0x1080('0xde')](_0x42159d[_0x1080('0x47')],_0x497c4a['filters']));if(_0x42159d[_0x1080('0x47')][_0x1080('0x32')]){_0x2946b6[_0x1080('0xdd')]=_[_0x1080('0x5b')](_0x2946b6[_0x1080('0xdd')],{'$or':_[_0x1080('0x34')](_0x2946b6['attributes'],function(_0x2febe4){var _0x458c5c={};_0x458c5c[_0x2febe4]={'$like':'%'+_0x42159d['query'][_0x1080('0x32')]+'%'};return _0x458c5c;})});}_0x2946b6=_['merge']({},_0x2946b6,_0x42159d[_0x1080('0x5c')]);switch(_0x503d99[_0x1080('0x2a')]){case _0x1080('0x83'):return db[_[_0x1080('0xa7')](_0x42159d[_0x1080('0x47')][_0x1080('0xb2')])+_0x1080('0xdf')][_0x1080('0x4b')](_0x2946b6);case'user':case'agent':return _0x503d99['get'+_['capitalize'](_0x42159d['query'][_0x1080('0xb2')])+_0x1080('0xa5')](_0x2946b6);default:throw new db['Sequelize'][(_0x1080('0x95'))](_0x1080('0xe0'));}})[_0x1080('0x20')](function(_0x33801b){_0x3940f0=_0x33801b[_0x1080('0x4e')];if(!_0x42159d['query'][_0x1080('0xcf')](_0x1080('0xe1'))){_0x2946b6['limit']=qs['limit'](_0x42159d['query'][_0x1080('0x1d')]);_0x2946b6[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x42159d['query']['offset']);}switch(_0x503d99['role']){case'admin':return db[_['capitalize'](_0x42159d[_0x1080('0x47')][_0x1080('0xb2')])+_0x1080('0xdf')][_0x1080('0x4b')](_0x2946b6);case'user':case _0x1080('0x30'):return _0x503d99['get'+_['capitalize'](_0x42159d[_0x1080('0x47')][_0x1080('0xb2')])+_0x1080('0xa5')](_0x2946b6);}})[_0x1080('0x20')](function(_0x25d05a){return{'count':_0x3940f0,'rows':_0x25d05a};})[_0x1080('0x20')](respondWithResult(_0x5ced4f,null))['catch'](handleError(_0x5ced4f,null));};exports[_0x1080('0xe2')]=function(_0x366cf4,_0x5bae82){var _0x183634={};var _0x321b5e={};var _0x1f6b87;var _0x4639aa;return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x366cf4[_0x1080('0x57')]['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x5bae82,null))[_0x1080('0x20')](function(_0x1330f1){if(_0x1330f1){_0x1f6b87=_0x1330f1;_0x321b5e['model']=_[_0x1080('0xd6')](db['UserVoiceQueueRt'][_0x1080('0xd7')]);_0x321b5e['query']=_[_0x1080('0xd6')](_0x366cf4[_0x1080('0x47')]);_0x321b5e[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x321b5e[_0x1080('0xd5')],_0x321b5e[_0x1080('0x47')]);_0x183634[_0x1080('0x49')]=_[_0x1080('0xd9')](_0x321b5e[_0x1080('0xd5')],qs['fields'](_0x366cf4[_0x1080('0x47')][_0x1080('0xda')]));_0x183634[_0x1080('0x49')]=_0x183634[_0x1080('0x49')][_0x1080('0x4e')]?_0x183634['attributes']:_0x321b5e[_0x1080('0xd5')];_0x183634[_0x1080('0xdb')]=qs[_0x1080('0xdc')](_0x366cf4['query']['sort']);_0x183634[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_[_0x1080('0xde')](_0x366cf4[_0x1080('0x47')],_0x321b5e[_0x1080('0xd8')]));if(_0x366cf4[_0x1080('0x47')][_0x1080('0x32')]){_0x183634[_0x1080('0xdd')]=_['merge'](_0x183634['where'],{'$or':_[_0x1080('0x34')](_0x183634[_0x1080('0x49')],function(_0x59b33e){var _0xac2934={};_0xac2934[_0x59b33e]={'$like':'%'+_0x366cf4[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0xac2934;})});}_0x183634=_[_0x1080('0x5b')]({},_0x183634,_0x366cf4['options']);return _0x1f6b87['getVoiceQueuesRt'](_0x183634);}})[_0x1080('0x20')](function(_0x5db82c){if(_0x5db82c){_0x4639aa=_0x5db82c[_0x1080('0x4e')];if(!_0x366cf4[_0x1080('0x47')][_0x1080('0xcf')]('nolimit')){_0x183634[_0x1080('0x1d')]=qs[_0x1080('0x1d')](_0x366cf4['query'][_0x1080('0x1d')]);_0x183634['offset']=qs[_0x1080('0x1b')](_0x366cf4[_0x1080('0x47')][_0x1080('0x1b')]);}return _0x1f6b87[_0x1080('0xe2')](_0x183634);}})['then'](function(_0x539e00){if(_0x539e00){return _0x539e00?{'count':_0x4639aa,'rows':_0x539e00}:null;}})[_0x1080('0x20')](respondWithResult(_0x5bae82,null))[_0x1080('0x62')](handleError(_0x5bae82,null));};exports['getGroups']=function(_0x3c4808,_0x5e74b9){var _0x53f83d={};var _0x2f9747={};var _0x31f6c5;var _0x21d988;return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x3c4808[_0x1080('0x57')]['id']}})['then'](handleEntityNotFound(_0x5e74b9,null))[_0x1080('0x20')](function(_0x185c9b){if(_0x185c9b){_0x31f6c5=_0x185c9b;_0x2f9747[_0x1080('0xd5')]=_[_0x1080('0xd6')](db['ChatGroup'][_0x1080('0xd7')]);_0x2f9747[_0x1080('0x47')]=_[_0x1080('0xd6')](_0x3c4808[_0x1080('0x47')]);_0x2f9747[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x2f9747[_0x1080('0xd5')],_0x2f9747[_0x1080('0x47')]);_0x53f83d[_0x1080('0x49')]=_[_0x1080('0xd9')](_0x2f9747[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x3c4808[_0x1080('0x47')][_0x1080('0xda')]));_0x53f83d[_0x1080('0x49')]=_0x53f83d[_0x1080('0x49')][_0x1080('0x4e')]?_0x53f83d[_0x1080('0x49')]:_0x2f9747['model'];_0x53f83d[_0x1080('0xdb')]=qs['sort'](_0x3c4808[_0x1080('0x47')][_0x1080('0xdc')]);_0x53f83d[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_[_0x1080('0xde')](_0x3c4808['query'],_0x2f9747[_0x1080('0xd8')]));if(_0x3c4808[_0x1080('0x47')][_0x1080('0x32')]){_0x53f83d['where']=_[_0x1080('0x5b')](_0x53f83d[_0x1080('0xdd')],{'$or':_[_0x1080('0x34')](_0x53f83d[_0x1080('0x49')],function(_0x28751b){var _0x1d9a4f={};_0x1d9a4f[_0x28751b]={'$like':'%'+_0x3c4808['query'][_0x1080('0x32')]+'%'};return _0x1d9a4f;})});}_0x53f83d=_[_0x1080('0x5b')]({},_0x53f83d,_0x3c4808['options']);return _0x31f6c5[_0x1080('0xe3')](_0x53f83d);}})[_0x1080('0x20')](function(_0x4eabf3){if(_0x4eabf3){_0x21d988=_0x4eabf3['length'];if(!_0x3c4808[_0x1080('0x47')][_0x1080('0xcf')](_0x1080('0xe1'))){_0x53f83d['limit']=qs[_0x1080('0x1d')](_0x3c4808[_0x1080('0x47')][_0x1080('0x1d')]);_0x53f83d[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x3c4808[_0x1080('0x47')][_0x1080('0x1b')]);}return _0x31f6c5['getGroups'](_0x53f83d);}})[_0x1080('0x20')](function(_0x1d0064){if(_0x1d0064){return _0x1d0064?{'count':_0x21d988,'rows':_0x1d0064}:null;}})[_0x1080('0x20')](respondWithResult(_0x5e74b9,null))['catch'](handleError(_0x5e74b9,null));};exports['getRecordings']=function(_0x59a1d5,_0x33f7d7){var _0x173ae8={'raw':!![],'where':{}};var _0x12c25b={};var _0x4f6869={'count':0x0,'rows':[]};return db[_0x1080('0x3c')]['findOne']({'where':{'id':_0x59a1d5[_0x1080('0x57')]['id']}})['then'](handleEntityNotFound(_0x33f7d7,null))['then'](function(_0x34301a){if(_0x34301a){_0x12c25b[_0x1080('0xd5')]=_[_0x1080('0xd6')](db[_0x1080('0xe4')]['rawAttributes']);_0x12c25b[_0x1080('0x47')]=_[_0x1080('0xd6')](_0x59a1d5[_0x1080('0x47')]);_0x12c25b['filters']=_[_0x1080('0xd9')](_0x12c25b[_0x1080('0xd5')],_0x12c25b['query']);_0x173ae8['attributes']=_[_0x1080('0xd9')](_0x12c25b[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x59a1d5[_0x1080('0x47')][_0x1080('0xda')]));_0x173ae8['attributes']=_0x173ae8[_0x1080('0x49')][_0x1080('0x4e')]?_0x173ae8[_0x1080('0x49')]:_0x12c25b[_0x1080('0xd5')];if(!_0x59a1d5[_0x1080('0x47')][_0x1080('0xcf')]('nolimit')){_0x173ae8['limit']=qs['limit'](_0x59a1d5[_0x1080('0x47')][_0x1080('0x1d')]);_0x173ae8[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x59a1d5[_0x1080('0x47')][_0x1080('0x1b')]);}_0x173ae8[_0x1080('0xdb')]=qs[_0x1080('0xdc')](_0x59a1d5['query'][_0x1080('0xdc')]);_0x173ae8[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_[_0x1080('0xde')](_0x59a1d5[_0x1080('0x47')],_0x12c25b[_0x1080('0xd8')]));_0x173ae8[_0x1080('0xdd')][_0x1080('0xe5')]=_0x34301a['id'];if(_0x59a1d5[_0x1080('0x47')][_0x1080('0x32')]){_0x173ae8[_0x1080('0xdd')]=_['merge'](_0x173ae8[_0x1080('0xdd')],{'$or':_['map'](_0x173ae8['attributes'],function(_0x5e3ce9){var _0x397615={};_0x397615[_0x5e3ce9]={'$like':'%'+_0x59a1d5[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0x397615;})});}_0x173ae8=_[_0x1080('0x5b')]({},_0x173ae8,_0x59a1d5['options']);return db[_0x1080('0xe4')]['count']({'where':_0x173ae8[_0x1080('0xdd')]})[_0x1080('0x20')](function(_0x64d40f){_0x4f6869[_0x1080('0x1e')]=_0x64d40f;if(_0x59a1d5[_0x1080('0x47')]['includeAll']){_0x173ae8[_0x1080('0x46')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x173ae8);})[_0x1080('0x20')](function(_0x59e57f){_0x4f6869[_0x1080('0x4c')]=_0x59e57f;return _0x4f6869;});}})[_0x1080('0x20')](respondWithFilteredResult(_0x33f7d7,_0x173ae8))[_0x1080('0x62')](handleError(_0x33f7d7,null));};exports[_0x1080('0xe6')]=function(_0x5034d4,_0x30e5e8){var _0x25cd23={'raw':!![],'where':{}};var _0x353d20={};var _0x63b7d2={'count':0x0,'rows':[]};return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x5034d4[_0x1080('0x57')]['id']}})['then'](handleEntityNotFound(_0x30e5e8,null))['then'](function(_0x4ffe53){if(_0x4ffe53){_0x353d20[_0x1080('0xd5')]=_[_0x1080('0xd6')](db[_0x1080('0xe7')][_0x1080('0xd7')]);_0x353d20['query']=_[_0x1080('0xd6')](_0x5034d4[_0x1080('0x47')]);_0x353d20['filters']=_[_0x1080('0xd9')](_0x353d20[_0x1080('0xd5')],_0x353d20[_0x1080('0x47')]);_0x25cd23[_0x1080('0x49')]=_[_0x1080('0xd9')](_0x353d20[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x5034d4[_0x1080('0x47')]['fields']));_0x25cd23[_0x1080('0x49')]=_0x25cd23[_0x1080('0x49')][_0x1080('0x4e')]?_0x25cd23['attributes']:_0x353d20['model'];if(!_0x5034d4[_0x1080('0x47')][_0x1080('0xcf')]('nolimit')){_0x25cd23['limit']=qs[_0x1080('0x1d')](_0x5034d4[_0x1080('0x47')][_0x1080('0x1d')]);_0x25cd23[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x5034d4[_0x1080('0x47')]['offset']);}_0x25cd23['order']=qs[_0x1080('0xdc')](_0x5034d4['query']['sort']);_0x25cd23[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_[_0x1080('0xde')](_0x5034d4[_0x1080('0x47')],_0x353d20['filters']));_0x25cd23[_0x1080('0xdd')][_0x1080('0xe5')]=_0x4ffe53['id'];if(_0x5034d4[_0x1080('0x47')][_0x1080('0x32')]){_0x25cd23[_0x1080('0xdd')]=_[_0x1080('0x5b')](_0x25cd23[_0x1080('0xdd')],{'$or':_['map'](_0x25cd23[_0x1080('0x49')],function(_0x408f44){var _0x4cdd1d={};_0x4cdd1d[_0x408f44]={'$like':'%'+_0x5034d4[_0x1080('0x47')]['filter']+'%'};return _0x4cdd1d;})});}_0x25cd23=_['merge']({},_0x25cd23,_0x5034d4[_0x1080('0x5c')]);return db['ScreenRecording']['count']({'where':_0x25cd23['where']})[_0x1080('0x20')](function(_0x58ffdd){_0x63b7d2[_0x1080('0x1e')]=_0x58ffdd;if(_0x5034d4[_0x1080('0x47')][_0x1080('0x45')]){_0x25cd23[_0x1080('0x46')]=[{'all':!![]}];}return db[_0x1080('0xe7')]['findAll'](_0x25cd23);})[_0x1080('0x20')](function(_0x5b6b1a){_0x63b7d2['rows']=_0x5b6b1a;return _0x63b7d2;});}})[_0x1080('0x20')](respondWithFilteredResult(_0x30e5e8,_0x25cd23))[_0x1080('0x62')](handleError(_0x30e5e8,null));};exports[_0x1080('0xe8')]=function(_0x2c9583,_0x3d0cfc){var _0x5d2247={};var _0x347df6={};var _0x4e8d2a;var _0x2320f5;return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x2c9583[_0x1080('0x57')]['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x3d0cfc,null))[_0x1080('0x20')](function(_0x5cffe0){if(_0x5cffe0){_0x4e8d2a=_0x5cffe0;_0x347df6['model']=_[_0x1080('0xd6')](db[_0x1080('0xe9')][_0x1080('0xd7')]);_0x347df6[_0x1080('0x47')]=_[_0x1080('0xd6')](_0x2c9583[_0x1080('0x47')]);_0x347df6[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x347df6[_0x1080('0xd5')],_0x347df6['query']);_0x5d2247['attributes']=_[_0x1080('0xd9')](_0x347df6[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x2c9583[_0x1080('0x47')][_0x1080('0xda')]));_0x5d2247['attributes']=_0x5d2247[_0x1080('0x49')]['length']?_0x5d2247[_0x1080('0x49')]:_0x347df6[_0x1080('0xd5')];_0x5d2247[_0x1080('0xdb')]=qs[_0x1080('0xdc')](_0x2c9583[_0x1080('0x47')][_0x1080('0xdc')]);_0x5d2247[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_['pick'](_0x2c9583[_0x1080('0x47')],_0x347df6[_0x1080('0xd8')]));if(_0x2c9583['query'][_0x1080('0x32')]){_0x5d2247[_0x1080('0xdd')]=_['merge'](_0x5d2247[_0x1080('0xdd')],{'$or':_[_0x1080('0x34')](_0x5d2247['attributes'],function(_0x4ff76d){var _0x9bee51={};_0x9bee51[_0x4ff76d]={'$like':'%'+_0x2c9583[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0x9bee51;})});}_0x5d2247=_['merge']({},_0x5d2247,_0x2c9583['options']);return _0x4e8d2a[_0x1080('0xe8')](_0x5d2247);}})['then'](function(_0x5342aa){if(_0x5342aa){_0x2320f5=_0x5342aa[_0x1080('0x4e')];if(!_0x2c9583[_0x1080('0x47')][_0x1080('0xcf')]('nolimit')){_0x5d2247[_0x1080('0x1d')]=qs[_0x1080('0x1d')](_0x2c9583[_0x1080('0x47')]['limit']);_0x5d2247[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x2c9583[_0x1080('0x47')]['offset']);}return _0x4e8d2a[_0x1080('0xe8')](_0x5d2247);}})['then'](function(_0xa81d6e){if(_0xa81d6e){return _0xa81d6e?{'count':_0x2320f5,'rows':_0xa81d6e}:null;}})[_0x1080('0x20')](respondWithResult(_0x3d0cfc,null))['catch'](handleError(_0x3d0cfc,null));};exports[_0x1080('0xea')]=function(_0x495fa3,_0x8a1436){var _0x8b61d4={};var _0x17e6f3={};var _0xe4ce9b;var _0x5112fb;return db['User'][_0x1080('0x9a')]({'where':{'id':_0x495fa3['params']['id']}})['then'](handleEntityNotFound(_0x8a1436,null))['then'](function(_0x5a0d53){if(_0x5a0d53){_0xe4ce9b=_0x5a0d53;_0x17e6f3[_0x1080('0xd5')]=_[_0x1080('0xd6')](db['OpenchannelInteraction'][_0x1080('0xd7')]);_0x17e6f3[_0x1080('0x47')]=_[_0x1080('0xd6')](_0x495fa3[_0x1080('0x47')]);_0x17e6f3['filters']=_[_0x1080('0xd9')](_0x17e6f3['model'],_0x17e6f3[_0x1080('0x47')]);_0x8b61d4['attributes']=_['intersection'](_0x17e6f3[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x495fa3['query'][_0x1080('0xda')]));_0x8b61d4[_0x1080('0x49')]=_0x8b61d4[_0x1080('0x49')]['length']?_0x8b61d4[_0x1080('0x49')]:_0x17e6f3[_0x1080('0xd5')];_0x8b61d4[_0x1080('0xdb')]=qs[_0x1080('0xdc')](_0x495fa3[_0x1080('0x47')][_0x1080('0xdc')]);_0x8b61d4[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_['pick'](_0x495fa3[_0x1080('0x47')],_0x17e6f3[_0x1080('0xd8')]));if(_0x495fa3[_0x1080('0x47')]['filter']){_0x8b61d4[_0x1080('0xdd')]=_[_0x1080('0x5b')](_0x8b61d4['where'],{'$or':_[_0x1080('0x34')](_0x8b61d4[_0x1080('0x49')],function(_0x8a69){var _0x2f55f8={};_0x2f55f8[_0x8a69]={'$like':'%'+_0x495fa3[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0x2f55f8;})});}_0x8b61d4=_[_0x1080('0x5b')]({},_0x8b61d4,_0x495fa3[_0x1080('0x5c')]);return _0xe4ce9b[_0x1080('0xea')](_0x8b61d4);}})['then'](function(_0x139bde){if(_0x139bde){_0x5112fb=_0x139bde[_0x1080('0x4e')];if(!_0x495fa3[_0x1080('0x47')]['hasOwnProperty'](_0x1080('0xe1'))){_0x8b61d4['limit']=qs['limit'](_0x495fa3['query'][_0x1080('0x1d')]);_0x8b61d4[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x495fa3[_0x1080('0x47')][_0x1080('0x1b')]);}return _0xe4ce9b[_0x1080('0xea')](_0x8b61d4);}})[_0x1080('0x20')](function(_0x2e0d06){if(_0x2e0d06){return _0x2e0d06?{'count':_0x5112fb,'rows':_0x2e0d06}:null;}})['then'](respondWithResult(_0x8a1436,null))['catch'](handleError(_0x8a1436,null));};exports[_0x1080('0xeb')]=function(_0x44b669,_0x5c9139){var _0x226fb3={'raw':!![],'where':{}};var _0x292f91={};var _0x3d98de={'count':0x0,'rows':[]};return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x44b669['params']['id']}})['then'](handleEntityNotFound(_0x5c9139,null))[_0x1080('0x20')](function(_0x11cf7a){if(_0x11cf7a){_0x292f91[_0x1080('0xd5')]=_[_0x1080('0xd6')](db['MailInteraction'][_0x1080('0xd7')]);_0x292f91[_0x1080('0x47')]=_[_0x1080('0xd6')](_0x44b669['query']);_0x292f91[_0x1080('0xd8')]=_['intersection'](_0x292f91['model'],_0x292f91['query']);_0x226fb3[_0x1080('0x49')]=_[_0x1080('0xd9')](_0x292f91['model'],qs[_0x1080('0xda')](_0x44b669[_0x1080('0x47')]['fields']));_0x226fb3[_0x1080('0x49')]=_0x226fb3[_0x1080('0x49')][_0x1080('0x4e')]?_0x226fb3['attributes']:_0x292f91[_0x1080('0xd5')];if(!_0x44b669[_0x1080('0x47')]['hasOwnProperty']('nolimit')){_0x226fb3['limit']=qs['limit'](_0x44b669[_0x1080('0x47')]['limit']);_0x226fb3[_0x1080('0x1b')]=qs['offset'](_0x44b669['query'][_0x1080('0x1b')]);}_0x226fb3[_0x1080('0xdb')]=qs['sort'](_0x44b669[_0x1080('0x47')][_0x1080('0xdc')]);_0x226fb3['where']=qs['filters'](_['pick'](_0x44b669[_0x1080('0x47')],_0x292f91[_0x1080('0xd8')]));_0x226fb3[_0x1080('0xdd')][_0x1080('0xe5')]=_0x11cf7a['id'];if(_0x44b669[_0x1080('0x47')][_0x1080('0x32')]){_0x226fb3[_0x1080('0xdd')]=_[_0x1080('0x5b')](_0x226fb3[_0x1080('0xdd')],{'$or':_[_0x1080('0x34')](_0x226fb3['attributes'],function(_0x4a8ab7){var _0x1f7b02={};_0x1f7b02[_0x4a8ab7]={'$like':'%'+_0x44b669[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0x1f7b02;})});}_0x226fb3=_[_0x1080('0x5b')]({},_0x226fb3,_0x44b669['options']);return db[_0x1080('0xec')]['count']({'where':_0x226fb3[_0x1080('0xdd')]})['then'](function(_0x43e875){_0x3d98de[_0x1080('0x1e')]=_0x43e875;if(_0x44b669[_0x1080('0x47')]['includeAll']){_0x226fb3[_0x1080('0x46')]=[{'all':!![]}];}return db[_0x1080('0xec')][_0x1080('0x4b')](_0x226fb3);})[_0x1080('0x20')](function(_0x5bf0c4){_0x3d98de[_0x1080('0x4c')]=_0x5bf0c4;return _0x3d98de;});}})['then'](respondWithFilteredResult(_0x5c9139,_0x226fb3))[_0x1080('0x62')](handleError(_0x5c9139,null));};exports[_0x1080('0xed')]=function(_0x2249da,_0x116bbf){var _0x8fc6cc={};var _0x3bd0a2={};var _0x529801;var _0x52b4b2;return db['User'][_0x1080('0x9a')]({'where':{'id':_0x2249da[_0x1080('0x57')]['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x116bbf,null))[_0x1080('0x20')](function(_0x2e317e){if(_0x2e317e){_0x529801=_0x2e317e;_0x3bd0a2[_0x1080('0xd5')]=_[_0x1080('0xd6')](db['SmsInteraction']['rawAttributes']);_0x3bd0a2['query']=_[_0x1080('0xd6')](_0x2249da[_0x1080('0x47')]);_0x3bd0a2[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x3bd0a2[_0x1080('0xd5')],_0x3bd0a2[_0x1080('0x47')]);_0x8fc6cc[_0x1080('0x49')]=_[_0x1080('0xd9')](_0x3bd0a2['model'],qs[_0x1080('0xda')](_0x2249da[_0x1080('0x47')][_0x1080('0xda')]));_0x8fc6cc[_0x1080('0x49')]=_0x8fc6cc[_0x1080('0x49')]['length']?_0x8fc6cc[_0x1080('0x49')]:_0x3bd0a2[_0x1080('0xd5')];_0x8fc6cc[_0x1080('0xdb')]=qs['sort'](_0x2249da[_0x1080('0x47')][_0x1080('0xdc')]);_0x8fc6cc[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_['pick'](_0x2249da[_0x1080('0x47')],_0x3bd0a2[_0x1080('0xd8')]));if(_0x2249da[_0x1080('0x47')][_0x1080('0x32')]){_0x8fc6cc[_0x1080('0xdd')]=_[_0x1080('0x5b')](_0x8fc6cc[_0x1080('0xdd')],{'$or':_['map'](_0x8fc6cc[_0x1080('0x49')],function(_0x5db64b){var _0xe1819a={};_0xe1819a[_0x5db64b]={'$like':'%'+_0x2249da[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0xe1819a;})});}_0x8fc6cc=_[_0x1080('0x5b')]({},_0x8fc6cc,_0x2249da[_0x1080('0x5c')]);return _0x529801[_0x1080('0xed')](_0x8fc6cc);}})[_0x1080('0x20')](function(_0x4adc0d){if(_0x4adc0d){_0x52b4b2=_0x4adc0d[_0x1080('0x4e')];if(!_0x2249da[_0x1080('0x47')][_0x1080('0xcf')](_0x1080('0xe1'))){_0x8fc6cc[_0x1080('0x1d')]=qs[_0x1080('0x1d')](_0x2249da[_0x1080('0x47')][_0x1080('0x1d')]);_0x8fc6cc[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x2249da['query'][_0x1080('0x1b')]);}return _0x529801[_0x1080('0xed')](_0x8fc6cc);}})[_0x1080('0x20')](function(_0x4351a9){if(_0x4351a9){return _0x4351a9?{'count':_0x52b4b2,'rows':_0x4351a9}:null;}})[_0x1080('0x20')](respondWithResult(_0x116bbf,null))[_0x1080('0x62')](handleError(_0x116bbf,null));};exports[_0x1080('0xee')]=function(_0x25ac61,_0x380b12){var _0x5ae161={};var _0x48d7a8={};var _0x5a2811;var _0x4275f5;return db['User'][_0x1080('0x9a')]({'where':{'id':_0x25ac61['params']['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x380b12,null))[_0x1080('0x20')](function(_0x4eeec8){if(_0x4eeec8){_0x5a2811=_0x4eeec8;_0x48d7a8[_0x1080('0xd5')]=_[_0x1080('0xd6')](db['FaxInteraction'][_0x1080('0xd7')]);_0x48d7a8[_0x1080('0x47')]=_['keys'](_0x25ac61[_0x1080('0x47')]);_0x48d7a8[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x48d7a8['model'],_0x48d7a8[_0x1080('0x47')]);_0x5ae161['attributes']=_['intersection'](_0x48d7a8[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x25ac61[_0x1080('0x47')]['fields']));_0x5ae161[_0x1080('0x49')]=_0x5ae161[_0x1080('0x49')][_0x1080('0x4e')]?_0x5ae161[_0x1080('0x49')]:_0x48d7a8[_0x1080('0xd5')];_0x5ae161['order']=qs[_0x1080('0xdc')](_0x25ac61['query']['sort']);_0x5ae161['where']=qs[_0x1080('0xd8')](_['pick'](_0x25ac61[_0x1080('0x47')],_0x48d7a8[_0x1080('0xd8')]));if(_0x25ac61['query'][_0x1080('0x32')]){_0x5ae161[_0x1080('0xdd')]=_[_0x1080('0x5b')](_0x5ae161[_0x1080('0xdd')],{'$or':_[_0x1080('0x34')](_0x5ae161['attributes'],function(_0x1b517e){var _0xcdc60b={};_0xcdc60b[_0x1b517e]={'$like':'%'+_0x25ac61['query'][_0x1080('0x32')]+'%'};return _0xcdc60b;})});}_0x5ae161=_[_0x1080('0x5b')]({},_0x5ae161,_0x25ac61[_0x1080('0x5c')]);return _0x5a2811[_0x1080('0xee')](_0x5ae161);}})[_0x1080('0x20')](function(_0x5801a0){if(_0x5801a0){_0x4275f5=_0x5801a0[_0x1080('0x4e')];if(!_0x25ac61[_0x1080('0x47')][_0x1080('0xcf')](_0x1080('0xe1'))){_0x5ae161[_0x1080('0x1d')]=qs[_0x1080('0x1d')](_0x25ac61[_0x1080('0x47')]['limit']);_0x5ae161['offset']=qs[_0x1080('0x1b')](_0x25ac61['query'][_0x1080('0x1b')]);}return _0x5a2811['getFaxInteractions'](_0x5ae161);}})[_0x1080('0x20')](function(_0x12e324){if(_0x12e324){return _0x12e324?{'count':_0x4275f5,'rows':_0x12e324}:null;}})[_0x1080('0x20')](respondWithResult(_0x380b12,null))[_0x1080('0x62')](handleError(_0x380b12,null));};exports[_0x1080('0xef')]=function(_0x1938c8,_0xc06486){var _0x48358c={};var _0x4a06a3={};var _0x18d3ed;var _0x381653;return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x1938c8[_0x1080('0x57')]['id']}})[_0x1080('0x20')](handleEntityNotFound(_0xc06486,null))['then'](function(_0x41a797){if(_0x41a797){_0x18d3ed=_0x41a797;_0x4a06a3[_0x1080('0xd5')]=_['keys'](db[_0x1080('0xf0')][_0x1080('0xd7')]);_0x4a06a3[_0x1080('0x47')]=_[_0x1080('0xd6')](_0x1938c8[_0x1080('0x47')]);_0x4a06a3[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x4a06a3[_0x1080('0xd5')],_0x4a06a3['query']);_0x48358c[_0x1080('0x49')]=_[_0x1080('0xd9')](_0x4a06a3[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x1938c8['query'][_0x1080('0xda')]));_0x48358c['attributes']=_0x48358c[_0x1080('0x49')]['length']?_0x48358c[_0x1080('0x49')]:_0x4a06a3[_0x1080('0xd5')];_0x48358c['order']=qs[_0x1080('0xdc')](_0x1938c8[_0x1080('0x47')][_0x1080('0xdc')]);_0x48358c[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_[_0x1080('0xde')](_0x1938c8['query'],_0x4a06a3[_0x1080('0xd8')]));if(_0x1938c8['query']['filter']){_0x48358c[_0x1080('0xdd')]=_['merge'](_0x48358c['where'],{'$or':_[_0x1080('0x34')](_0x48358c[_0x1080('0x49')],function(_0xf77e81){var _0x73f569={};_0x73f569[_0xf77e81]={'$like':'%'+_0x1938c8['query'][_0x1080('0x32')]+'%'};return _0x73f569;})});}_0x48358c=_['merge']({},_0x48358c,_0x1938c8['options']);return _0x18d3ed[_0x1080('0xef')](_0x48358c);}})[_0x1080('0x20')](function(_0x39d4ab){if(_0x39d4ab){_0x381653=_0x39d4ab[_0x1080('0x4e')];if(!_0x1938c8[_0x1080('0x47')][_0x1080('0xcf')](_0x1080('0xe1'))){_0x48358c[_0x1080('0x1d')]=qs['limit'](_0x1938c8[_0x1080('0x47')]['limit']);_0x48358c[_0x1080('0x1b')]=qs[_0x1080('0x1b')](_0x1938c8[_0x1080('0x47')]['offset']);}return _0x18d3ed[_0x1080('0xef')](_0x48358c);}})[_0x1080('0x20')](function(_0x54734a){if(_0x54734a){return _0x54734a?{'count':_0x381653,'rows':_0x54734a}:null;}})[_0x1080('0x20')](respondWithResult(_0xc06486,null))[_0x1080('0x62')](handleError(_0xc06486,null));};exports['login']=function(_0x2b27ce,_0xbe091a,_0x1f44a9){var _0x342206;var _0x5ac30a;var _0x5cb575;var _0xea9360=!_['isNil'](_0x2b27ce[_0x1080('0x57')]['id'])?_0x2b27ce[_0x1080('0x57')]['id']:!_[_0x1080('0x67')](_0x2b27ce['user']['id'])?_0x2b27ce[_0x1080('0x2e')]['id']:null;return db[_0x1080('0x3c')][_0x1080('0x37')]({'where':{'id':_0xea9360,'role':{'$or':['admin',_0x1080('0x2e'),_0x1080('0x30')]}},'attributes':['id',_0x1080('0x38'),'phone',_0x1080('0xf1'),_0x1080('0x2a'),_0x1080('0x63'),'loginInPause']})[_0x1080('0x20')](function(_0x7e773e){if(_0x7e773e){if(_0x7e773e['role']===_0x1080('0x30')){_0x342206=_0x7e773e;if(_0x2b27ce[_0x1080('0x5d')][_0x1080('0xa2')]){_0x5cb575=util[_0x1080('0xad')](_0x1080('0xf2'),_0x342206[_0x2b27ce[_0x1080('0x5d')][_0x1080('0xa2')]]);}else if(_0x2b27ce[_0x1080('0x5d')]['intrf']){_0x5cb575=util['format'](_0x1080('0xae'),_0x2b27ce['body'][_0x1080('0xf3')]);}else{_0x5cb575=util[_0x1080('0xad')](_0x1080('0xae'),_0x342206['name']);}socket['to'](util['format']('user:%s',_0x342206[_0x1080('0x38')]))[_0x1080('0x2b')]('user:forcelogout',{'user':{'id':_0x342206['id'],'name':_0x342206[_0x1080('0x38')]},'ip':_0x2b27ce[_0x1080('0xf4')][_0x1080('0xf5')]||_0x2b27ce[_0x1080('0xf6')][_0x1080('0xf7')]||_0x2b27ce[_0x1080('0xf8')]['remoteAddress']||_0x2b27ce[_0x1080('0xf6')]['socket'][_0x1080('0xf7')]});return db[_0x1080('0xaf')][_0x1080('0xb6')]({'where':{'membername':_0x342206[_0x1080('0x38')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0x1080('0xf9'));}})['then'](function(){if(_0x342206){return _0x342206[_0x1080('0xfa')]({'raw':!![]});}})[_0x1080('0x20')](function(_0x2de81b){if(_0x342206){if(_0x2de81b){_0x5ac30a=_0x2de81b;if(_0x5ac30a[_0x1080('0x4e')]){var _0x439581=_0x5ac30a[_0x1080('0x34')](function(_0xd5e571){var _0xffcd8e={'membername':_0x342206[_0x1080('0x38')],'UserId':_0x342206['id'],'queue_name':_0xd5e571[_0x1080('0x38')],'VoiceQueueId':_0xd5e571['id'],'interface':_0x5cb575,'paused':_0x342206[_0x1080('0xa0')]||![],'penalty':_0xd5e571['UserVoiceQueue.penalty']||0x0};return db[_0x1080('0xaf')][_0x1080('0xb0')](_0xffcd8e);});return Promise[_0x1080('0x55')](_0x439581);}}}})[_0x1080('0x20')](function(){if(_0x342206){return db[_0x1080('0xfb')][_0x1080('0x4b')]({'where':{'membername':_0x342206['name'],'exitAt':null}});}})[_0x1080('0x20')](function(_0xd0a1d3){if(_0x342206){var _0x5b8193=[];_0xd0a1d3[_0x1080('0xfc')](function(_0xccd8d8){_0x5b8193[_0x1080('0x4a')](_0xccd8d8[_0x1080('0x29')]({'exitAt':moment()['format'](_0x1080('0xfd'))}));});return Promise[_0x1080('0x55')](_0x5b8193);}})[_0x1080('0x20')](function(){if(_0x342206){var _0x12671e=[];var _0x1fb166=[];var _0x2a7b00=utils[_0x1080('0xfe')]();var _0x30abd4={'membername':_0x342206[_0x1080('0x38')],'interface':_0x5cb575,'enterAt':moment()['format'](_0x1080('0xfd')),'role':_0x342206[_0x1080('0x2a')],'internal':_0x342206[_0x1080('0x63')]};_0x2a7b00[_0x1080('0xfc')](function(_0x2a3aec){_0x12671e['push'](_[_0x1080('0x5b')]({'channel':_0x2a3aec,'type':_0x1080('0xff'),'data1':_0x2b27ce[_0x1080('0x5d')][_0x1080('0x100')],'data2':_0x5cb575},_0x30abd4));if(_0x342206['loginInPause']){_0x1fb166[_0x1080('0x4a')](_[_0x1080('0x5b')]({'channel':_0x2a3aec,'type':'PAUSE','data1':'LOGININPAUSE'},_0x30abd4));}});return db[_0x1080('0xfb')][_0x1080('0x8b')](_0x12671e[_0x1080('0xcc')](_0x1fb166),{'individualHooks':!![]});}})[_0x1080('0x20')](function(){if(_0x342206){return _0x342206['update']({'online':!![],'lastLoginAt':moment()[_0x1080('0xad')](_0x1080('0xfd')),'voicePause':_0x342206[_0x1080('0xa0')]||![],'mailPause':_0x342206['loginInPause']||![],'chatPause':_0x342206[_0x1080('0xa0')]||![],'faxPause':_0x342206[_0x1080('0xa0')]||![],'smsPause':_0x342206[_0x1080('0xa0')]||![],'openchannelPause':_0x342206[_0x1080('0xa0')]||![],'whatsappPause':_0x342206[_0x1080('0xa0')]||![],'pauseType':_0x342206[_0x1080('0xa0')]?_0x1080('0x101'):null,'interface':_0x5cb575,'lastPauseAt':moment()[_0x1080('0xad')](_0x1080('0xfd'))});}})['then'](function(_0x42939e){if(_0x2b27ce[_0x1080('0x102')]){return _0x1f44a9();}else{return Promise['resolve'](_0x42939e)[_0x1080('0x20')](respondWithResult(_0xbe091a,null));}})[_0x1080('0x62')](handleError(_0xbe091a,null));};exports[_0x1080('0x103')]=function(_0xbd7101,_0x5d902c){var _0x3a651e;return db[_0x1080('0x3c')]['find']({'where':{'id':_0xbd7101['params']['id'],'role':_0x1080('0x30')},'attributes':['id','name',_0x1080('0x2a')]})['then'](handleEntityNotFound(_0x5d902c,null))[_0x1080('0x20')](function(_0x42c29b){if(_0x42c29b){_0x3a651e=_0x42c29b;return db['UserVoiceQueueRt'][_0x1080('0xb6')]({'where':{'membername':_0x3a651e[_0x1080('0x38')]},'individualHooks':!![]});}})[_0x1080('0x20')](function(){return db[_0x1080('0xfb')][_0x1080('0x4b')]({'where':{'membername':_0x3a651e[_0x1080('0x38')],'exitAt':null}});})[_0x1080('0x20')](function(_0xcd8bc0){var _0x3e92bd=[];_0xcd8bc0[_0x1080('0xfc')](function(_0x2ad79d){_0x3e92bd[_0x1080('0x4a')](_0x2ad79d['update']({'exitAt':moment()[_0x1080('0xad')](_0x1080('0xfd'))}));});return Promise[_0x1080('0x55')](_0x3e92bd);})[_0x1080('0x20')](function(){return _0x3a651e[_0x1080('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x1080('0x20')](respondWithResult(_0x5d902c,null))[_0x1080('0x62')](handleError(_0x5d902c,null));};exports[_0x1080('0x104')]=function(_0x55ade2,_0x5537b5){var _0x5c2c14;return db[_0x1080('0xaf')][_0x1080('0x29')]({'paused':0x1},{'where':{'UserId':_0x55ade2[_0x1080('0x57')]['id']},'individualHooks':!![]})[_0x1080('0x20')](function(){return db[_0x1080('0x3c')][_0x1080('0x37')]({'where':{'id':_0x55ade2[_0x1080('0x57')]['id'],'role':_0x1080('0x30')},'attributes':['id',_0x1080('0x38'),'role',_0x1080('0x63'),_0x1080('0xa2'),_0x1080('0x105')]});})['then'](handleEntityNotFound(_0x5537b5,null))[_0x1080('0x20')](function(_0x410467){if(_0x410467){_0x5c2c14=_0x410467;return respondWithRpcPromise(_0x1080('0x106'),_0x1080('0x104'),{'id':_0x5c2c14['id'],'name':_0x5c2c14['name'],'pause':!![]});}})['then'](function(){if(_0x5c2c14){return db[_0x1080('0xfb')][_0x1080('0x4b')]({'where':{'membername':_0x5c2c14[_0x1080('0x38')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x453fa5){if(_0x453fa5[_0x1080('0x4e')]){var _0x189cb9=moment()[_0x1080('0xad')](_0x1080('0xfd'));for(var _0x5acfc8=0x0,_0xa29a00=_0x453fa5['length'];_0x5acfc8<_0xa29a00;_0x5acfc8++){_0x453fa5[_0x5acfc8]['updateAttributes']({'exitAt':_0x189cb9});}}})[_0x1080('0x20')](function(){var _0x364bf6=[];var _0x1e6536=utils[_0x1080('0xfe')]();_0x1e6536['forEach'](function(_0x28cdad){_0x364bf6[_0x1080('0x4a')]({'channel':_0x28cdad,'membername':_0x5c2c14[_0x1080('0x38')],'interface':_[_0x1080('0x67')](_0x5c2c14['interface'])?util[_0x1080('0xad')](_0x1080('0xae'),_0x5c2c14[_0x1080('0x38')]):_0x5c2c14['interface'],'type':_0x1080('0x107'),'enterAt':moment()[_0x1080('0xad')](_0x1080('0xfd')),'data1':_0x55ade2[_0x1080('0x5d')]['type']||_0x1080('0x108'),'role':_0x5c2c14['role'],'internal':_0x5c2c14[_0x1080('0x63')]});});return db[_0x1080('0xfb')][_0x1080('0x8b')](_0x364bf6,{'individualHooks':!![]});})[_0x1080('0x20')](function(){return _0x5c2c14[_0x1080('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x55ade2[_0x1080('0x5d')][_0x1080('0x3e')]||_0x1080('0x108'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x5537b5,null))[_0x1080('0x62')](handleError(_0x5537b5,null));};exports[_0x1080('0x109')]=function(_0xe92178,_0x10c1bc){if(_0xe92178[_0x1080('0x5d')][_0x1080('0xb2')]&&!utils[_0x1080('0xb3')](_0xe92178['body']['channel'])){throw new APIBadRequestError(util[_0x1080('0xad')](_0x1080('0x10a'),_0xe92178[_0x1080('0x5d')][_0x1080('0xb2')]));}return db[_0x1080('0x3c')]['find']({'where':{'id':_0xe92178[_0x1080('0x57')]['id']},'attributes':['id',_0x1080('0x38'),_0x1080('0x2a'),_0x1080('0x63'),_0x1080('0xa2'),_0x1080('0x105'),_0x1080('0xa1'),_0x1080('0x10b'),_0x1080('0x10c'),_0x1080('0x10d'),_0x1080('0x10e'),_0x1080('0x10f'),_0x1080('0x110'),_0x1080('0x111'),_0x1080('0x112')]})[_0x1080('0x20')](function(_0x1afb06){if(!_0x1afb06){throw new APINotFoundError(util[_0x1080('0xad')](_0x1080('0xce'),_0xe92178[_0x1080('0x57')]['id']));}return _0x1afb06['unpause'](_0xe92178[_0x1080('0x5d')][_0x1080('0xb2')]);})['then'](respondWithResult(_0x10c1bc,null))[_0x1080('0x62')](APIHandleError(_0x10c1bc));};exports[_0x1080('0x113')]=function(_0x19cf62,_0x197315){var _0x3929f5={};var _0x33100c={};var _0x42be3e;var _0x582e86;return db['User'][_0x1080('0x9a')]({'where':{'id':_0x19cf62[_0x1080('0x57')]['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x197315,null))[_0x1080('0x20')](function(_0x3b5783){if(_0x3b5783){_0x42be3e=_0x3b5783;_0x33100c[_0x1080('0xd5')]=_[_0x1080('0xd6')](db[_0x1080('0x114')][_0x1080('0xd7')]);_0x33100c['query']=_[_0x1080('0xd6')](_0x19cf62[_0x1080('0x47')]);_0x33100c[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x33100c[_0x1080('0xd5')],_0x33100c[_0x1080('0x47')]);_0x3929f5['attributes']=_[_0x1080('0xd9')](_0x33100c[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x19cf62['query'][_0x1080('0xda')]));_0x3929f5[_0x1080('0x49')]=_0x3929f5['attributes'][_0x1080('0x4e')]?_0x3929f5[_0x1080('0x49')]:_0x33100c[_0x1080('0xd5')];_0x3929f5['order']=qs[_0x1080('0xdc')](_0x19cf62[_0x1080('0x47')][_0x1080('0xdc')]);_0x3929f5[_0x1080('0xdd')]=qs[_0x1080('0xd8')](_[_0x1080('0xde')](_0x19cf62[_0x1080('0x47')],_0x33100c[_0x1080('0xd8')]));if(_0x19cf62[_0x1080('0x47')][_0x1080('0x32')]){_0x3929f5['where']=_['merge'](_0x3929f5['where'],{'$or':_[_0x1080('0x34')](_0x3929f5[_0x1080('0x49')],function(_0x267239){var _0x5012f4={};_0x5012f4[_0x267239]={'$like':'%'+_0x19cf62['query'][_0x1080('0x32')]+'%'};return _0x5012f4;})});}_0x3929f5=_[_0x1080('0x5b')]({},_0x3929f5,_0x19cf62[_0x1080('0x5c')]);return _0x42be3e[_0x1080('0x113')](_0x3929f5);}})[_0x1080('0x20')](function(_0x25bf30){if(_0x25bf30){_0x582e86=_0x25bf30['length'];if(!_0x19cf62[_0x1080('0x47')]['hasOwnProperty']('nolimit')){_0x3929f5[_0x1080('0x1d')]=qs[_0x1080('0x1d')](_0x19cf62[_0x1080('0x47')][_0x1080('0x1d')]);_0x3929f5['offset']=qs[_0x1080('0x1b')](_0x19cf62['query'][_0x1080('0x1b')]);}return _0x42be3e['getTeams'](_0x3929f5);}})[_0x1080('0x20')](function(_0x2a3034){if(_0x2a3034){return _0x2a3034?{'count':_0x582e86,'rows':_0x2a3034}:null;}})[_0x1080('0x20')](respondWithResult(_0x197315,null))[_0x1080('0x62')](handleError(_0x197315,null));};exports[_0x1080('0x115')]=function(_0x2acb46,_0x5cc5d0){var _0x2ea890=_0x2acb46['params']['id'];var _0x3752e2=_0x2acb46['body']?_0x2acb46['body'][_0x1080('0x60')]:null;var _0xcbe835=[];return Promise[_0x1080('0x116')]()[_0x1080('0x20')](function(){if(!_0x3752e2)throw new APIBadRequestError(_0x1080('0x117'));})['then'](function(){return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x2ea890}});})['then'](function(_0x5e5756){if(!_0x5e5756)throw new APINotFoundError(util[_0x1080('0xad')](_0x1080('0xce'),_0x2acb46[_0x1080('0x57')]['id']));return db['sequelize']['transaction'](function(_0x12861f){return _0x5e5756['addTeams'](_0x3752e2,{'transaction':_0x12861f})[_0x1080('0x20')](function(){return db[_0x1080('0x114')][_0x1080('0x4b')]({'where':{'id':{'$in':_0x3752e2}}});})[_0x1080('0x20')](function(_0x518c93){var _0x4dddbb=_[_0x1080('0x34')](_0x518c93,function(_0x30fe7f){return _0x30fe7f[_0x1080('0x118')]();});return Promise[_0x1080('0x55')](_0x4dddbb);})[_0x1080('0x20')](function(_0x454687){_0xcbe835=_[_0x1080('0x119')](_0x454687);var _0x1b8bc4=_['map'](_0xcbe835,function(_0x4564e2){return _0x4564e2[_0x1080('0x11a')](_0x5e5756['id'],{'transaction':_0x12861f});});return Promise['all'](_0x1b8bc4);})[_0x1080('0x20')](function(){if(!_0x5e5756['online'])return;var _0x247174=_[_0x1080('0x32')](_0xcbe835,function(_0x2ec200){return _0x2ec200[_0x1080('0x11b')]('channel')===_0x1080('0x11c');});var _0x2bfe71=_[_0x1080('0x34')](_0x247174,function(_0x200b1b){return db['UserVoiceQueueRt'][_0x1080('0xb0')]({'membername':_0x5e5756[_0x1080('0x38')],'UserId':_0x5e5756['id'],'queue_name':_0x200b1b[_0x1080('0x38')],'VoiceQueueId':_0x200b1b['id'],'interface':_['isNil'](_0x5e5756[_0x1080('0xa2')])?util[_0x1080('0xad')](_0x1080('0xae'),_0x5e5756['name']):_0x5e5756[_0x1080('0xa2')],'paused':_0x5e5756['voicePause']||![],'penalty':_0x5e5756['penalty']},{'transaction':_0x12861f});});return Promise[_0x1080('0x55')](_0x2bfe71);})['then'](function(){return db[_0x1080('0x11d')][_0x1080('0x4b')]({'where':{'teamId':{'$in':_0x3752e2}}});})[_0x1080('0x20')](function(_0x1169b2){var _0x44649c=_[_0x1080('0x34')](_0x1169b2,function(_0xfc4ebc){return db['UserVoicePrefix'][_0x1080('0x80')]({'UserId':_0x5e5756['id'],'VoicePrefixId':_0xfc4ebc[_0x1080('0x11e')]},{'transaction':_0x12861f});});return Promise[_0x1080('0x55')](_0x44649c);});});})[_0x1080('0x20')](function(){for(var _0x549bb0=0x0;_0x549bb0<_0xcbe835[_0x1080('0x4e')];_0x549bb0++){var _0x235b70=_0xcbe835[_0x549bb0]['getDataValue'](_0x1080('0xb2'));var _0x1131c2=_0x235b70+_0x1080('0xa9');socket['emit'](_0x1080('0x2e')+_0x235b70+_0x1080('0xaa'),{'UserId':_0x2ea890,['queueField']:_0xcbe835[_0x549bb0]['id']});}})[_0x1080('0x20')](respondWithStatusCode(_0x5cc5d0,null))[_0x1080('0x62')](APIHandleError(_0x5cc5d0));};exports[_0x1080('0x11f')]=function(_0x43067e,_0x288fc1){var _0x31847a=_0x43067e[_0x1080('0x57')]['id'];var _0x1387f8=null;if(_0x43067e['query'][_0x1080('0x60')]){_0x1387f8=_[_0x1080('0xb4')](_0x43067e['query'][_0x1080('0x60')])?_0x43067e[_0x1080('0x47')]['ids']:[_0x43067e[_0x1080('0x47')][_0x1080('0x60')]];}var _0x5118bd=[];return Promise[_0x1080('0x116')]()[_0x1080('0x20')](function(){if(!_0x1387f8)throw new APIBadRequestError(_0x1080('0x120'));})[_0x1080('0x20')](function(){return db[_0x1080('0x3c')][_0x1080('0x9a')]({'where':{'id':_0x31847a}});})['then'](function(_0x510772){if(!_0x510772)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x43067e[_0x1080('0x57')]['id']));return db['sequelize']['transaction'](function(_0x1022c0){return _0x510772[_0x1080('0x11f')](_0x1387f8,{'transaction':_0x1022c0})[_0x1080('0x20')](function(){return db[_0x1080('0x114')][_0x1080('0x4b')]({'where':{'id':{'$in':_0x1387f8}}});})[_0x1080('0x20')](function(_0x34d7c6){var _0x57ea41=_[_0x1080('0x34')](_0x34d7c6,function(_0x46c62e){return _0x46c62e[_0x1080('0x118')]();});return Promise[_0x1080('0x55')](_0x57ea41);})[_0x1080('0x20')](function(_0x409a45){_0x5118bd=_['flattenDeep'](_0x409a45);var _0x23dd94=_['map'](_0x5118bd,function(_0x5bad2f){return _0x5bad2f[_0x1080('0x121')](_0x510772['id'],{'transaction':_0x1022c0});});return Promise['all'](_0x23dd94);})[_0x1080('0x20')](function(){if(!_0x510772['online'])return;var _0xc3c62c=_[_0x1080('0x32')](_0x5118bd,function(_0x595492){return _0x595492['getDataValue'](_0x1080('0xb2'))===_0x1080('0x11c');});var _0x4b7b2e=_[_0x1080('0x34')](_0xc3c62c,function(_0x30c8eb){return db[_0x1080('0xaf')]['destroy']({'where':{'VoiceQueueId':_0x30c8eb['id'],'UserId':_0x510772['id']},'transaction':_0x1022c0});});return Promise['all'](_0x4b7b2e);})[_0x1080('0x20')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x1387f8}}});})['then'](function(_0x49019d){var _0x8ac51=_[_0x1080('0x34')](_0x49019d,function(_0x4aedf0){return db[_0x1080('0x122')][_0x1080('0xb6')]({'where':{'UserId':_0x510772['id'],'VoicePrefixId':_0x4aedf0[_0x1080('0x11e')]}},{'transaction':_0x1022c0});});return Promise[_0x1080('0x55')](_0x8ac51);});});})[_0x1080('0x20')](function(){for(var _0x199766=0x0;_0x199766<_0x5118bd['length'];_0x199766++){var _0x131ddb=_0x5118bd[_0x199766][_0x1080('0x11b')](_0x1080('0xb2'));var _0x1ccb0e=_0x131ddb+_0x1080('0xa9');socket[_0x1080('0x2b')](_0x1080('0x2e')+_0x131ddb+_0x1080('0xb5'),{'UserId':_0x31847a,['queueField']:_0x5118bd[_0x199766]['id']});}})[_0x1080('0x20')](respondWithStatusCode(_0x288fc1,null))['catch'](APIHandleError(_0x288fc1));};exports[_0x1080('0x123')]=function(_0x55b152,_0x22301b){var _0x2e5030={};var _0x4fae65={};var _0x61ecf7;var _0x230ed7;return db['User'][_0x1080('0x9a')]({'where':{'id':_0x55b152[_0x1080('0x57')]['id']}})['then'](handleEntityNotFound(_0x22301b,null))['then'](function(_0x18c9a7){if(_0x18c9a7){_0x61ecf7=_0x18c9a7;_0x4fae65[_0x1080('0xd5')]=_[_0x1080('0xd6')](db[_0x1080('0xd0')][_0x1080('0xd7')]);_0x4fae65['query']=_[_0x1080('0xd6')](_0x55b152['query']);_0x4fae65[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x4fae65[_0x1080('0xd5')],_0x4fae65[_0x1080('0x47')]);_0x2e5030[_0x1080('0x49')]=_[_0x1080('0xd9')](_0x4fae65[_0x1080('0xd5')],qs['fields'](_0x55b152[_0x1080('0x47')][_0x1080('0xda')]));_0x2e5030[_0x1080('0x49')]=_0x2e5030[_0x1080('0x49')][_0x1080('0x4e')]?_0x2e5030[_0x1080('0x49')]:_0x4fae65[_0x1080('0xd5')];_0x2e5030[_0x1080('0xdb')]=qs['sort'](_0x55b152[_0x1080('0x47')][_0x1080('0xdc')]);_0x2e5030['where']=qs['filters'](_[_0x1080('0xde')](_0x55b152[_0x1080('0x47')],_0x4fae65[_0x1080('0xd8')]));if(_0x55b152[_0x1080('0x47')][_0x1080('0x32')]){_0x2e5030[_0x1080('0xdd')]=_['merge'](_0x2e5030[_0x1080('0xdd')],{'$or':_[_0x1080('0x34')](_0x2e5030[_0x1080('0x49')],function(_0x548a46){var _0x207d31={};_0x207d31[_0x548a46]={'$like':'%'+_0x55b152[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0x207d31;})});}_0x2e5030=_[_0x1080('0x5b')]({},_0x2e5030,_0x55b152['options']);return _0x61ecf7[_0x1080('0x123')](_0x2e5030);}})[_0x1080('0x20')](function(_0x4538e7){if(_0x4538e7){_0x230ed7=_0x4538e7[_0x1080('0x4e')];if(!_0x55b152[_0x1080('0x47')][_0x1080('0xcf')](_0x1080('0xe1'))){_0x2e5030[_0x1080('0x1d')]=qs[_0x1080('0x1d')](_0x55b152[_0x1080('0x47')][_0x1080('0x1d')]);_0x2e5030['offset']=qs[_0x1080('0x1b')](_0x55b152['query'][_0x1080('0x1b')]);}return _0x61ecf7['getLists'](_0x2e5030);}})['then'](function(_0xbd679e){if(_0xbd679e){return _0xbd679e?{'count':_0x230ed7,'rows':_0xbd679e}:null;}})[_0x1080('0x20')](respondWithResult(_0x22301b,null))[_0x1080('0x62')](handleError(_0x22301b,null));};exports[_0x1080('0x124')]=function(_0x5e9801,_0x1de242){var _0x45ad44={};var _0x211484={};var _0x359c7d;return db['User'][_0x1080('0x9a')]({'where':{'id':_0x5e9801['params']['id']}})[_0x1080('0x20')](handleEntityNotFound(_0x1de242,null))[_0x1080('0x20')](function(_0x517a4f){if(_0x517a4f){_0x359c7d=_0x517a4f;_0x211484[_0x1080('0xd5')]=_[_0x1080('0xd6')](db[_0x1080('0x3c')][_0x1080('0xd7')]);_0x211484[_0x1080('0x47')]=_[_0x1080('0xd6')](_0x5e9801[_0x1080('0x47')]);_0x211484[_0x1080('0xd8')]=_[_0x1080('0xd9')](_0x211484['model'],_0x211484[_0x1080('0x47')]);_0x45ad44['attributes']=_[_0x1080('0xd9')](_0x211484[_0x1080('0xd5')],qs[_0x1080('0xda')](_0x5e9801['query'][_0x1080('0xda')]));_0x45ad44[_0x1080('0x49')]=_0x45ad44[_0x1080('0x49')][_0x1080('0x4e')]?_0x45ad44[_0x1080('0x49')]:_0x211484[_0x1080('0xd5')];_0x45ad44[_0x1080('0xdb')]=qs[_0x1080('0xdc')](_0x5e9801['query'][_0x1080('0xdc')]);_0x45ad44['where']=qs[_0x1080('0xd8')](_['pick'](_0x5e9801['query'],_0x211484[_0x1080('0xd8')]));if(_0x5e9801['query'][_0x1080('0x32')]){_0x45ad44[_0x1080('0xdd')]=_['merge'](_0x45ad44[_0x1080('0xdd')],{'$or':_[_0x1080('0x34')](_0x45ad44['attributes'],function(_0x44bcce){var _0x31f292={};_0x31f292[_0x44bcce]={'$like':'%'+_0x5e9801[_0x1080('0x47')][_0x1080('0x32')]+'%'};return _0x31f292;})});}_0x45ad44[_0x1080('0xd5')]=db[_0x1080('0x3c')];_0x45ad44['as']=_0x1080('0x2f');_0x45ad44=_[_0x1080('0x5b')]({},_0x45ad44,_0x5e9801[_0x1080('0x5c')]);return _0x359c7d['getVoiceQueues']({'include':[_0x45ad44]});}})[_0x1080('0x20')](function(_0x2a4ee5){if(_0x2a4ee5){var _0x2c8199={},_0x339be8=[];for(var _0x5ae308=0x0;_0x5ae308<_0x2a4ee5[_0x1080('0x4e')];_0x5ae308+=0x1){for(var _0x2af400=0x0,_0x1d9f60;_0x2af400<_0x2a4ee5[_0x5ae308]['Agents'][_0x1080('0x4e')];_0x2af400+=0x1){_0x1d9f60=_0x2a4ee5[_0x5ae308][_0x1080('0x2f')][_0x2af400][_0x1080('0x2c')]({'plain':!![]});_0x2c8199[_0x1d9f60['id']]=_0x1d9f60;}}_0x2c8199=_[_0x1080('0x125')](_0x2c8199);for(var _0x17b011=qs[_0x1080('0x1b')](_0x5e9801['query'][_0x1080('0x1b')]);_0x17b011<_0x2c8199[_0x1080('0x4e')]&&_0x339be8['length']=_0x29ae2a[_0xbae0('0x49')]){throw new Error(_0xbae0('0x4a'));}})[_0xbae0('0x11')](function(){if(_0x2a09a0){return db[_0xbae0('0x24')][_0xbae0('0x41')]({'where':{'membername':_0x2a09a0[_0xbae0('0x1d')]},'individualHooks':!![]});}})[_0xbae0('0x11')](function(){if(_0x2a09a0){return _0x2a09a0[_0xbae0('0x4b')]({'raw':!![]});}})[_0xbae0('0x11')](function(_0x18b58e){if(_0x2a09a0){if(_0x18b58e){var _0x5cda97=[];_0x46ab0e=_0x18b58e;if(_0x46ab0e[_0xbae0('0x27')]){for(var _0x1a8074=0x0;_0x1a8074<_0x46ab0e['length'];_0x1a8074++){_0x5cda97['push'](db[_0xbae0('0x24')][_0xbae0('0x4c')]({'membername':_0x2a09a0[_0xbae0('0x1d')],'UserId':_0x2a09a0['id'],'queue_name':_0x46ab0e[_0x1a8074][_0xbae0('0x1d')],'VoiceQueueId':_0x46ab0e[_0x1a8074]['id'],'interface':_0x5f18ca,'paused':_0x2a09a0['loginInPause']||![],'penalty':_0x46ab0e[_0x1a8074][_0xbae0('0x4d')]||0x0}));}return BPromise[_0xbae0('0x43')](_0x5cda97);}}}})[_0xbae0('0x11')](function(){if(_0x2a09a0){return db[_0xbae0('0x30')][_0xbae0('0xa')]({'where':{'membername':_0x2a09a0[_0xbae0('0x1d')],'exitAt':null}});}})[_0xbae0('0x11')](function(_0x3c9e7c){if(_0x2a09a0){if(_0x3c9e7c&&_0x3c9e7c[_0xbae0('0x27')]){var _0x4bf5d3=[];_0x3c9e7c[_0xbae0('0x2b')](function(_0x2a87dc){_0x4bf5d3[_0xbae0('0x42')](_0x2a87dc[_0xbae0('0x25')]({'exitAt':moment()[_0xbae0('0x21')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xbae0('0x43')](_0x4bf5d3);}}})[_0xbae0('0x11')](function(){if(_0x2a09a0){var _0x38e955=[];var _0x191575=[];var _0x5521b6=utils[_0xbae0('0x2a')]();var _0x220f99={'membername':_0x2a09a0[_0xbae0('0x1d')],'interface':_0x5f18ca,'enterAt':moment()[_0xbae0('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2a09a0[_0xbae0('0x1e')],'internal':_0x2a09a0[_0xbae0('0x1f')]};_0x5521b6[_0xbae0('0x2b')](function(_0x1e2793){_0x38e955[_0xbae0('0x42')](_[_0xbae0('0x4e')]({'channel':_0x1e2793,'type':'LOGIN','data1':_0xbae0('0x4f'),'data2':_0x5f18ca},_0x220f99));if(_0x2a09a0['loginInPause']){_0x191575[_0xbae0('0x42')](_[_0xbae0('0x4e')]({'channel':_0x1e2793,'type':'PAUSE','data1':'LOGININPAUSE'},_0x220f99));}});return db[_0xbae0('0x30')]['bulkCreate'](_0x38e955[_0xbae0('0x50')](_0x191575),{'individualHooks':!![]});}})[_0xbae0('0x11')](function(){if(_0x2a09a0){return _0x2a09a0[_0xbae0('0x25')]({'online':!![],'lastLoginAt':moment()[_0xbae0('0x21')](_0xbae0('0x28')),'voicePause':_0x2a09a0[_0xbae0('0x45')]||![],'mailPause':_0x2a09a0[_0xbae0('0x45')]||![],'chatPause':_0x2a09a0[_0xbae0('0x45')]||![],'faxPause':_0x2a09a0[_0xbae0('0x45')]||![],'smsPause':_0x2a09a0[_0xbae0('0x45')]||![],'openchannelPause':_0x2a09a0['loginInPause']||![],'pauseType':_0x2a09a0[_0xbae0('0x45')]?_0xbae0('0x51'):null,'lastPauseAt':moment()[_0xbae0('0x21')](_0xbae0('0x28')),'interface':_0x5f18ca});}})['then'](function(_0x3b60ca){_0x27aee1(_0x3b60ca);})['catch'](function(_0x123214){_0xff7df4(_0x587db8[_0xbae0('0x18')](0x1f4,_0x123214['message']));});});}; \ No newline at end of file +var _0x82a0=['push','isNil','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','role','bulkCreate','update','type','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','system','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','agent','../../config/license/util','getLicense','upsert','UserVoiceQueue.penalty','merge','LOGIN','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./user.socket','register','findAll','options','raw','where','attributes','include','map','model','then','info','GetUser','debug','stringify','catch','message','error','ShowUser','User','find','name','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','MemberReport','PAUSE','length','updateAttributes','getChannels','forEach'];(function(_0x46325d,_0x5e91d0){var _0x2d5033=function(_0x51a384){while(--_0x51a384){_0x46325d['push'](_0x46325d['shift']());}};_0x2d5033(++_0x5e91d0);}(_0x82a0,0x1ba));var _0x082a=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x82a0[_0x510b98];return _0x45e775;};'use strict';var _=require(_0x082a('0x0'));var util=require('util');var moment=require(_0x082a('0x1'));var BPromise=require(_0x082a('0x2'));var Redis=require('ioredis');var db=require(_0x082a('0x3'))['db'];var utils=require(_0x082a('0x4'));var logger=require(_0x082a('0x5'))('rpc');var config=require(_0x082a('0x6'));config[_0x082a('0x7')]=_['defaults'](config['redis'],{'host':_0x082a('0x8'),'port':0x18eb});var socket=require(_0x082a('0x9'))(new Redis(config[_0x082a('0x7')]));require(_0x082a('0xa'))[_0x082a('0xb')](socket);exports['GetUser']=function(_0x6a7d){var _0x153b2c=this;return new Promise(function(_0x40aae6,_0xc805a9){return db['User'][_0x082a('0xc')]({'raw':_0x6a7d[_0x082a('0xd')]?_0x6a7d[_0x082a('0xd')][_0x082a('0xe')]===undefined?!![]:![]:!![],'where':_0x6a7d['options']?_0x6a7d[_0x082a('0xd')][_0x082a('0xf')]||null:null,'attributes':_0x6a7d[_0x082a('0xd')]?_0x6a7d['options'][_0x082a('0x10')]||null:null,'limit':_0x6a7d['options']?_0x6a7d[_0x082a('0xd')]['limit']||null:null,'include':_0x6a7d[_0x082a('0xd')]?_0x6a7d[_0x082a('0xd')][_0x082a('0x11')]?_[_0x082a('0x12')](_0x6a7d[_0x082a('0xd')][_0x082a('0x11')],function(_0x1eb129){return{'model':db[_0x1eb129[_0x082a('0x13')]],'as':_0x1eb129['as'],'attributes':_0x1eb129[_0x082a('0x10')],'include':_0x1eb129[_0x082a('0x11')]?_['map'](_0x1eb129[_0x082a('0x11')],function(_0x1d1e6a){return{'model':db[_0x1d1e6a[_0x082a('0x13')]],'as':_0x1d1e6a['as'],'attributes':_0x1d1e6a[_0x082a('0x10')],'include':_0x1d1e6a[_0x082a('0x11')]?_[_0x082a('0x12')](_0x1d1e6a[_0x082a('0x11')],function(_0x3577ff){return{'model':db[_0x3577ff[_0x082a('0x13')]],'as':_0x3577ff['as'],'attributes':_0x3577ff[_0x082a('0x10')]};}):[]};}):[]};}):[]:[]})[_0x082a('0x14')](function(_0x42ba4e){logger[_0x082a('0x15')](_0x082a('0x16'),_0x6a7d);logger[_0x082a('0x17')]('GetUser',_0x6a7d,JSON[_0x082a('0x18')](_0x42ba4e));_0x40aae6(_0x42ba4e);})[_0x082a('0x19')](function(_0x2b1dab){logger['error'](_0x082a('0x16'),_0x2b1dab[_0x082a('0x1a')],_0x6a7d);_0xc805a9(_0x153b2c[_0x082a('0x1b')](0x1f4,_0x2b1dab[_0x082a('0x1a')]));});});};exports[_0x082a('0x1c')]=function(_0x21e3fb){var _0x18bcc0=this;return new Promise(function(_0x17288e,_0x15b0a0){return db[_0x082a('0x1d')][_0x082a('0x1e')]({'raw':_0x21e3fb[_0x082a('0xd')]?_0x21e3fb['options'][_0x082a('0xe')]===undefined?!![]:![]:!![],'where':_0x21e3fb[_0x082a('0xd')]?_0x21e3fb[_0x082a('0xd')][_0x082a('0xf')]||null:null,'attributes':_0x21e3fb[_0x082a('0xd')]?_0x21e3fb[_0x082a('0xd')][_0x082a('0x10')]||null:null,'include':_0x21e3fb[_0x082a('0xd')]?_0x21e3fb[_0x082a('0xd')][_0x082a('0x11')]?_[_0x082a('0x12')](_0x21e3fb[_0x082a('0xd')][_0x082a('0x11')],function(_0x1e1fe2){return{'model':db[_0x1e1fe2[_0x082a('0x13')]],'as':_0x1e1fe2['as'],'attributes':_0x1e1fe2['attributes'],'include':_0x1e1fe2[_0x082a('0x11')]?_[_0x082a('0x12')](_0x1e1fe2[_0x082a('0x11')],function(_0x4e04fd){return{'model':db[_0x4e04fd['model']],'as':_0x4e04fd['as'],'attributes':_0x4e04fd[_0x082a('0x10')],'include':_0x4e04fd[_0x082a('0x11')]?_[_0x082a('0x12')](_0x4e04fd[_0x082a('0x11')],function(_0x22e4b0){return{'model':db[_0x22e4b0['model']],'as':_0x22e4b0['as'],'attributes':_0x22e4b0[_0x082a('0x10')]};}):[]};}):[]};}):[]:[]})[_0x082a('0x14')](function(_0x38bc9f){logger[_0x082a('0x15')]('ShowUser',_0x21e3fb);logger[_0x082a('0x17')]('ShowUser',_0x21e3fb,JSON[_0x082a('0x18')](_0x38bc9f));_0x17288e(_0x38bc9f);})[_0x082a('0x19')](function(_0x36ea72){logger[_0x082a('0x1b')](_0x082a('0x1c'),_0x36ea72[_0x082a('0x1a')],_0x21e3fb);_0x15b0a0(_0x18bcc0[_0x082a('0x1b')](0x1f4,_0x36ea72['message']));});});};exports['PauseUser']=function(_0x434a70){var _0x30fd86;return db[_0x082a('0x1d')][_0x082a('0x1e')]({'where':_0x434a70['options'][_0x082a('0xf')]||{},'attributes':['id',_0x082a('0x1f'),'role',_0x082a('0x20'),_0x082a('0x21')]})[_0x082a('0x14')](function(_0x4b59f5){if(!_0x4b59f5){throw new Error(util[_0x082a('0x22')](_0x082a('0x23'),_0x434a70[_0x082a('0x24')]['id']));}_0x30fd86=_0x4b59f5;return db[_0x082a('0x25')]['update']({'paused':0x1},{'where':{'UserId':_0x30fd86['id']},'individualHooks':!![]});})[_0x082a('0x14')](function(){return db[_0x082a('0x26')][_0x082a('0xc')]({'where':{'membername':_0x30fd86[_0x082a('0x1f')],'type':_0x082a('0x27'),'exitAt':null}});})[_0x082a('0x14')](function(_0x322f26){if(_0x322f26&&_0x322f26[_0x082a('0x28')]){var _0x5999de=moment()[_0x082a('0x22')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x19197b=0x0,_0x1c5f6f=_0x322f26[_0x082a('0x28')];_0x19197b<_0x1c5f6f;_0x19197b++){_0x322f26[_0x19197b][_0x082a('0x29')]({'exitAt':_0x5999de});}}})[_0x082a('0x14')](function(){var _0x34eeb8=[];var _0x48ac83=utils[_0x082a('0x2a')]();_0x48ac83[_0x082a('0x2b')](function(_0x3c4138){_0x34eeb8[_0x082a('0x2c')]({'channel':_0x3c4138,'membername':_0x30fd86[_0x082a('0x1f')],'interface':_[_0x082a('0x2d')](_0x30fd86[_0x082a('0x21')])?util['format'](_0x082a('0x2e'),_0x30fd86[_0x082a('0x1f')]):_0x30fd86[_0x082a('0x21')],'type':'PAUSE','enterAt':moment()['format'](_0x082a('0x2f')),'data1':_0x434a70[_0x082a('0x30')]['type']||'DEFAULT\x20PAUSE','role':_0x30fd86[_0x082a('0x31')],'internal':_0x30fd86['internal'],'uniqueid':_0x434a70[_0x082a('0x30')]['uniqueid']||null});});return db['MemberReport'][_0x082a('0x32')](_0x34eeb8,{'individualHooks':!![]});})[_0x082a('0x14')](function(){return _0x30fd86[_0x082a('0x33')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x434a70[_0x082a('0x30')][_0x082a('0x34')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x082a('0x22')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x082a('0x19')](function(_0x39c657){throw _0x39c657;});};exports[_0x082a('0x35')]=function(_0x15ef6f){return Promise[_0x082a('0x36')]()[_0x082a('0x14')](function(){if(_0x15ef6f['body']['channel']&&!utils['isValidChannel'](_0x15ef6f[_0x082a('0x30')][_0x082a('0x37')])){throw new Error(util['format'](_0x082a('0x38'),_0x15ef6f[_0x082a('0x30')]['channel']));}return db[_0x082a('0x1d')][_0x082a('0x39')]({'where':_0x15ef6f[_0x082a('0xd')][_0x082a('0xf')]||{},'attributes':['id',_0x082a('0x1f'),_0x082a('0x31'),_0x082a('0x20'),_0x082a('0x21'),_0x082a('0x3a'),'voicePause',_0x082a('0x3b'),_0x082a('0x3c'),'faxPause',_0x082a('0x3d'),_0x082a('0x3e'),_0x082a('0x3f'),_0x082a('0x40'),_0x082a('0x41')]});})['then'](function(_0x5043ec){if(!_0x5043ec){throw new Error(util[_0x082a('0x22')]('User\x20with\x20id\x20%s\x20not\x20found',_0x15ef6f[_0x082a('0x24')]['id']));}return _0x5043ec[_0x082a('0x42')](_0x15ef6f['body']['channel'],_0x082a('0x43'));})[_0x082a('0x19')](function(_0x289e3d){throw _0x289e3d;});};exports[_0x082a('0x44')]=function(_0x3d7186){var _0x1db68d=this;return new Promise(function(_0x31e397,_0x44b99c){var _0x3ad274;return db[_0x082a('0x1d')][_0x082a('0x39')]({'where':_0x3d7186[_0x082a('0xd')][_0x082a('0xf')]||{},'attributes':['id',_0x082a('0x1f')]})[_0x082a('0x14')](function(_0x5029fb){if(_0x5029fb){_0x3ad274=_0x5029fb;return db[_0x082a('0x25')][_0x082a('0x45')]({'where':{'membername':_0x3ad274[_0x082a('0x1f')]},'individualHooks':!![]});}})[_0x082a('0x14')](function(){if(_0x3ad274){return db[_0x082a('0x26')][_0x082a('0xc')]({'where':{'membername':_0x3ad274[_0x082a('0x1f')],'exitAt':null}});}})[_0x082a('0x14')](function(_0x225a79){if(_0x3ad274){if(_0x225a79&&_0x225a79['length']){var _0x1d6bb5=[];_0x225a79[_0x082a('0x2b')](function(_0x7a6925){_0x1d6bb5[_0x082a('0x2c')](_0x7a6925['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x1d6bb5);}}})['then'](function(){if(_0x3ad274){return _0x3ad274[_0x082a('0x33')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x082a('0x14')](function(_0x47404b){_0x31e397(_0x47404b);})[_0x082a('0x19')](function(_0x22ae35){_0x44b99c(_0x1db68d[_0x082a('0x1b')](0x1f4,_0x22ae35[_0x082a('0x1a')]));});});};exports[_0x082a('0x46')]=function(_0x13401d){var _0x5b70a6=this;return new Promise(function(_0x421fe7,_0x48389f){var _0x521854;var _0x5dbc6b;var _0x34b028;var _0x47a5e6;return db[_0x082a('0x1d')][_0x082a('0x39')]({'where':_0x13401d[_0x082a('0xd')][_0x082a('0xf')]||{},'attributes':['id',_0x082a('0x1f'),_0x082a('0x31'),_0x082a('0x47'),_0x082a('0x48'),_0x082a('0x20'),_0x082a('0x49'),_0x082a('0x21')]})['then'](function(_0x31fbb1){if(_0x31fbb1){_0x521854=_0x31fbb1;_0x47a5e6=_0x13401d[_0x082a('0x30')][_0x082a('0x21')]?_0x13401d[_0x082a('0x30')][_0x082a('0x21')]:util[_0x082a('0x22')]('SIP/%s',_0x521854[_0x082a('0x1f')]);return db[_0x082a('0x1d')]['count']({'where':{'role':_0x082a('0x4a'),'online':!![],'id':{'$ne':_0x521854['id']}}});}})['then'](function(_0x220508){if(_0x220508){_0x34b028=_0x220508;return require(_0x082a('0x4b'))[_0x082a('0x4c')]();}})[_0x082a('0x14')](function(_0xa19e86){if(_0xa19e86&&_0xa19e86['agents']&&_0x34b028>=_0xa19e86['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x082a('0x14')](function(){if(_0x521854){return db[_0x082a('0x25')][_0x082a('0x45')]({'where':{'membername':_0x521854[_0x082a('0x1f')]},'individualHooks':!![]});}})[_0x082a('0x14')](function(){if(_0x521854){return _0x521854['getVoiceQueues']({'raw':!![]});}})[_0x082a('0x14')](function(_0x365121){if(_0x521854){if(_0x365121){var _0x50b30a=[];_0x5dbc6b=_0x365121;if(_0x5dbc6b[_0x082a('0x28')]){for(var _0x547e09=0x0;_0x547e09<_0x5dbc6b['length'];_0x547e09++){_0x50b30a[_0x082a('0x2c')](db['UserVoiceQueueRt'][_0x082a('0x4d')]({'membername':_0x521854[_0x082a('0x1f')],'UserId':_0x521854['id'],'queue_name':_0x5dbc6b[_0x547e09]['name'],'VoiceQueueId':_0x5dbc6b[_0x547e09]['id'],'interface':_0x47a5e6,'paused':_0x521854[_0x082a('0x49')]||![],'penalty':_0x5dbc6b[_0x547e09][_0x082a('0x4e')]||0x0}));}return BPromise['all'](_0x50b30a);}}}})['then'](function(){if(_0x521854){return db['MemberReport']['findAll']({'where':{'membername':_0x521854[_0x082a('0x1f')],'exitAt':null}});}})[_0x082a('0x14')](function(_0x2763a4){if(_0x521854){if(_0x2763a4&&_0x2763a4[_0x082a('0x28')]){var _0x4accc4=[];_0x2763a4[_0x082a('0x2b')](function(_0x1dd129){_0x4accc4[_0x082a('0x2c')](_0x1dd129[_0x082a('0x33')]({'exitAt':moment()[_0x082a('0x22')](_0x082a('0x2f'))}));});return BPromise['all'](_0x4accc4);}}})[_0x082a('0x14')](function(){if(_0x521854){var _0x429ab8=[];var _0x3a1d8a=[];var _0x75b942=utils['getChannels']();var _0x34fab3={'membername':_0x521854['name'],'interface':_0x47a5e6,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x521854[_0x082a('0x31')],'internal':_0x521854[_0x082a('0x20')]};_0x75b942[_0x082a('0x2b')](function(_0x512902){_0x429ab8[_0x082a('0x2c')](_[_0x082a('0x4f')]({'channel':_0x512902,'type':_0x082a('0x50'),'data1':'callysquare','data2':_0x47a5e6},_0x34fab3));if(_0x521854[_0x082a('0x49')]){_0x3a1d8a[_0x082a('0x2c')](_[_0x082a('0x4f')]({'channel':_0x512902,'type':_0x082a('0x27'),'data1':'LOGININPAUSE'},_0x34fab3));}});return db[_0x082a('0x26')]['bulkCreate'](_0x429ab8['concat'](_0x3a1d8a),{'individualHooks':!![]});}})[_0x082a('0x14')](function(){if(_0x521854){return _0x521854[_0x082a('0x33')]({'online':!![],'lastLoginAt':moment()['format'](_0x082a('0x2f')),'voicePause':_0x521854['loginInPause']||![],'mailPause':_0x521854[_0x082a('0x49')]||![],'chatPause':_0x521854[_0x082a('0x49')]||![],'faxPause':_0x521854[_0x082a('0x49')]||![],'smsPause':_0x521854['loginInPause']||![],'openchannelPause':_0x521854[_0x082a('0x49')]||![],'pauseType':_0x521854['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x082a('0x22')](_0x082a('0x2f')),'interface':_0x47a5e6});}})[_0x082a('0x14')](function(_0x38704c){_0x421fe7(_0x38704c);})[_0x082a('0x19')](function(_0x611e2f){_0x48389f(_0x5b70a6[_0x082a('0x1b')](0x1f4,_0x611e2f[_0x082a('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 223dd19..a35a556 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 _0xb6bd=['update','emit','removeListener','register','./user.events','save'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0xb6bd,0x13c));var _0xdb6b=function(_0x274cef,_0x1c529d){_0x274cef=_0x274cef-0x0;var _0x3bf81a=_0xb6bd[_0x274cef];return _0x3bf81a;};'use strict';var UserEvents=require(_0xdb6b('0x0'));var events=[_0xdb6b('0x1'),'remove',_0xdb6b('0x2')];function createListener(_0x55cb03,_0x1cea8b){return function(_0x2418c8){_0x1cea8b[_0xdb6b('0x3')](_0x55cb03,_0x2418c8);};}function removeListener(_0x1ae9f8,_0x4b887d){return function(){UserEvents[_0xdb6b('0x4')](_0x1ae9f8,_0x4b887d);};}exports[_0xdb6b('0x5')]=function(_0x1ad4cf){for(var _0x830c41=0x0,_0x106ea3=events['length'];_0x830c41<_0x106ea3;_0x830c41++){var _0x4600ae=events[_0x830c41];var _0x303751=createListener('user:'+_0x4600ae,_0x1ad4cf);UserEvents['on'](_0x4600ae,_0x303751);}}; \ No newline at end of file +var _0x6fa5=['remove','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6fa5,0x1e6));var _0x56fa=function(_0x1cb030,_0x1da8bd){_0x1cb030=_0x1cb030-0x0;var _0x580b58=_0x6fa5[_0x1cb030];return _0x580b58;};'use strict';var UserEvents=require(_0x56fa('0x0'));var events=[_0x56fa('0x1'),_0x56fa('0x2'),'update'];function createListener(_0x23b8df,_0x294bac){return function(_0x4fc0a9){_0x294bac[_0x56fa('0x3')](_0x23b8df,_0x4fc0a9);};}function removeListener(_0x247457,_0x20ff82){return function(){UserEvents[_0x56fa('0x4')](_0x247457,_0x20ff82);};}exports[_0x56fa('0x5')]=function(_0xf1e92){for(var _0x598434=0x0,_0x13ef51=events[_0x56fa('0x6')];_0x598434<_0x13ef51;_0x598434++){var _0xf76f05=events[_0x598434];var _0x2c30a9=createListener(_0x56fa('0x7')+_0xf76f05,_0xf1e92);UserEvents['on'](_0xf76f05,_0x2c30a9);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 3694f42..970a959 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x275720,_0x2310a9){var _0x80fcaa=function(_0xa8e40a){while(--_0xa8e40a){_0x275720['push'](_0x275720['shift']());}};_0x80fcaa(++_0x2310a9);}(_0xedd9,0xfc));var _0x9edd=function(_0x2992cb,_0x102ca6){_0x2992cb=_0x2992cb-0x0;var _0x499699=_0xedd9[_0x2992cb];return _0x499699;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x48e7ae,_0x3f5e94){var _0x3814ee=function(_0x1030e3){while(--_0x1030e3){_0x48e7ae['push'](_0x48e7ae['shift']());}};_0x3814ee(++_0x3f5e94);}(_0x70e0,0x17b));var _0x070e=function(_0x296e4f,_0x51e184){_0x296e4f=_0x296e4f-0x0;var _0x1f3d17=_0x70e0[_0x296e4f];return _0x1f3d17;};'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 9006424..54b6465 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x15d2=['exports'];(function(_0x3a05c4,_0x4cf0dd){var _0x4060f4=function(_0x4bc467){while(--_0x4bc467){_0x3a05c4['push'](_0x3a05c4['shift']());}};_0x4060f4(++_0x4cf0dd);}(_0x15d2,0x163));var _0x215d=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x15d2[_0x4c9380];return _0x49a523;};'use strict';var Sequelize=require('sequelize');module[_0x215d('0x0')]={'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 8749849..b76e1f3 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 _0x90ee=['../../config/environment','UserChatQueue','user_has_chat_queues','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x90ee,0x1f2));var _0xe90e=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0x90ee[_0x151418];return _0x40e29a;};'use strict';var _=require('lodash');var util=require(_0xe90e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe90e('0x1'));var BPromise=require(_0xe90e('0x2'));var rp=require(_0xe90e('0x3'));var fs=require('fs');var path=require(_0xe90e('0x4'));var rimraf=require(_0xe90e('0x5'));var config=require(_0xe90e('0x6'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x1fb498,_0x7dca4){return _0x1fb498['define'](_0xe90e('0x7'),attributes,{'tableName':_0xe90e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['./userChatQueue.attributes','define','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x32a516,_0x2ed82f){var _0x4aab13=function(_0x622480){while(--_0x622480){_0x32a516['push'](_0x32a516['shift']());}};_0x4aab13(++_0x2ed82f);}(_0xadb5,0x8e));var _0x5adb=function(_0x4087a8,_0x279380){_0x4087a8=_0x4087a8-0x0;var _0x3da8d9=_0xadb5[_0x4087a8];return _0x3da8d9;};'use strict';var _=require(_0x5adb('0x0'));var util=require(_0x5adb('0x1'));var logger=require('../../config/logger')(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require(_0x5adb('0x4'));var rp=require(_0x5adb('0x5'));var fs=require('fs');var path=require(_0x5adb('0x6'));var rimraf=require('rimraf');var config=require(_0x5adb('0x7'));var attributes=require(_0x5adb('0x8'));module['exports']=function(_0x13f32f,_0xe8786){return _0x13f32f[_0x5adb('0x9')]('UserChatQueue',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 9dbc396..3a41314 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 _0x848a=['info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0x848a,0x66));var _0xa848=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x848a[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0xa848('0x0'));var util=require(_0xa848('0x1'));var moment=require('moment');var BPromise=require(_0xa848('0x2'));var rs=require(_0xa848('0x3'));var fs=require('fs');var Redis=require(_0xa848('0x4'));var db=require(_0xa848('0x5'))['db'];var utils=require(_0xa848('0x6'));var logger=require(_0xa848('0x7'))(_0xa848('0x8'));var config=require(_0xa848('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa848('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd93f31,_0x308bf9,_0x469469){return new BPromise(function(_0x5742f2,_0x4fdbab){return client[_0xa848('0xb')](_0xd93f31,_0x469469)[_0xa848('0xc')](function(_0x14d832){logger[_0xa848('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x308bf9,_0xa848('0xe'));logger[_0xa848('0xf')](_0xa848('0x10'),_0x308bf9,_0xa848('0xe'),JSON[_0xa848('0x11')](_0x14d832));if(_0x14d832['error']){if(_0x14d832[_0xa848('0x12')]['code']===0x1f4){logger[_0xa848('0x12')](_0xa848('0x13'),_0x308bf9,_0x14d832[_0xa848('0x12')][_0xa848('0x14')]);return _0x4fdbab(_0x14d832[_0xa848('0x12')][_0xa848('0x14')]);}logger[_0xa848('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x308bf9,_0x14d832['error']['message']);return _0x5742f2(_0x14d832[_0xa848('0x12')]['message']);}else{logger['info'](_0xa848('0x13'),_0x308bf9,_0xa848('0xe'));_0x5742f2(_0x14d832[_0xa848('0x15')][_0xa848('0x14')]);}})[_0xa848('0x16')](function(_0x1cf0b9){logger[_0xa848('0x12')](_0xa848('0x13'),_0x308bf9,_0x1cf0b9);_0x4fdbab(_0x1cf0b9);});});} \ No newline at end of file +var _0x9384=['request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message'];(function(_0x327322,_0x585e5e){var _0x1b6f8f=function(_0x449855){while(--_0x449855){_0x327322['push'](_0x327322['shift']());}};_0x1b6f8f(++_0x585e5e);}(_0x9384,0x16a));var _0x4938=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x9384[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x4938('0x0'));var util=require(_0x4938('0x1'));var moment=require(_0x4938('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4938('0x3'));var db=require(_0x4938('0x4'))['db'];var utils=require(_0x4938('0x5'));var logger=require(_0x4938('0x6'))(_0x4938('0x7'));var config=require(_0x4938('0x8'));var jayson=require(_0x4938('0x9'));var client=jayson[_0x4938('0xa')][_0x4938('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b5c7f,_0x3b5d2c,_0x43c37a){return new BPromise(function(_0x19797b,_0x37c54a){return client[_0x4938('0xc')](_0x4b5c7f,_0x43c37a)[_0x4938('0xd')](function(_0x3823aa){logger[_0x4938('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x3b5d2c,'request\x20sent');logger[_0x4938('0xf')](_0x4938('0x10'),_0x3b5d2c,'request\x20sent',JSON[_0x4938('0x11')](_0x3823aa));if(_0x3823aa[_0x4938('0x12')]){if(_0x3823aa['error'][_0x4938('0x13')]===0x1f4){logger[_0x4938('0x12')](_0x4938('0x14'),_0x3b5d2c,_0x3823aa[_0x4938('0x12')][_0x4938('0x15')]);return _0x37c54a(_0x3823aa[_0x4938('0x12')][_0x4938('0x15')]);}logger[_0x4938('0x12')](_0x4938('0x14'),_0x3b5d2c,_0x3823aa['error'][_0x4938('0x15')]);return _0x19797b(_0x3823aa[_0x4938('0x12')][_0x4938('0x15')]);}else{logger[_0x4938('0xe')](_0x4938('0x14'),_0x3b5d2c,_0x4938('0x16'));_0x19797b(_0x3823aa['result']['message']);}})[_0x4938('0x17')](function(_0x3f2469){logger[_0x4938('0x12')](_0x4938('0x14'),_0x3b5d2c,_0x3f2469);_0x37c54a(_0x3f2469);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 8b9a894..596d688 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3b2dce,_0x439b8b){var _0x51ff0d=function(_0x49a398){while(--_0x49a398){_0x3b2dce['push'](_0x3b2dce['shift']());}};_0x51ff0d(++_0x439b8b);}(_0x70e0,0x17b));var _0x070e=function(_0x5a97df,_0x52beb0){_0x5a97df=_0x5a97df-0x0;var _0x1a9944=_0x70e0[_0x5a97df];return _0x1a9944;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4b73cc,_0x5a9372){var _0x3cf5aa=function(_0x210b39){while(--_0x210b39){_0x4b73cc['push'](_0x4b73cc['shift']());}};_0x3cf5aa(++_0x5a9372);}(_0xedd9,0xfc));var _0x9edd=function(_0x17dac0,_0x182df7){_0x17dac0=_0x17dac0-0x0;var _0x497770=_0xedd9[_0x17dac0];return _0x497770;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 20c9a72..1b1c61a 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 _0x4791=['sequelize','exports','INTEGER','STRING'];(function(_0x4eb747,_0x2a8d80){var _0x166652=function(_0x57854c){while(--_0x57854c){_0x4eb747['push'](_0x4eb747['shift']());}};_0x166652(++_0x2a8d80);}(_0x4791,0x13c));var _0x1479=function(_0x385467,_0x298239){_0x385467=_0x385467-0x0;var _0x5ed67e=_0x4791[_0x385467];return _0x5ed67e;};'use strict';var Sequelize=require(_0x1479('0x0'));module[_0x1479('0x1')]={'penalty':{'type':Sequelize[_0x1479('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1479('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1479('0x3')]}}; \ No newline at end of file +var _0x70a2=['exports','INTEGER','STRING','sequelize'];(function(_0x4301c7,_0x34373b){var _0x167782=function(_0x5e9ede){while(--_0x5e9ede){_0x4301c7['push'](_0x4301c7['shift']());}};_0x167782(++_0x34373b);}(_0x70a2,0xc3));var _0x270a=function(_0x32ee35,_0x1c6db0){_0x32ee35=_0x32ee35-0x0;var _0x395daa=_0x70a2[_0x32ee35];return _0x395daa;};'use strict';var Sequelize=require(_0x270a('0x0'));module[_0x270a('0x1')]={'penalty':{'type':Sequelize[_0x270a('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x270a('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x270a('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 7352f23..90db6a8 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 _0x6b35=['user_has_fax_queues','util','api','moment','rimraf','exports','define','UserFaxQueue'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6b35,0x161));var _0x56b3=function(_0x538cb7,_0xf3509b){_0x538cb7=_0x538cb7-0x0;var _0x35d7e8=_0x6b35[_0x538cb7];return _0x35d7e8;};'use strict';var _=require('lodash');var util=require(_0x56b3('0x0'));var logger=require('../../config/logger')(_0x56b3('0x1'));var moment=require(_0x56b3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x56b3('0x3'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x56b3('0x4')]=function(_0x2bbcf0,_0x1e06dd){return _0x2bbcf0[_0x56b3('0x5')](_0x56b3('0x6'),attributes,{'tableName':_0x56b3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06a5=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./userFaxQueue.attributes','exports','user_has_fax_queues','lodash'];(function(_0x3f463f,_0x1be0db){var _0xb342b2=function(_0x1ca7b5){while(--_0x1ca7b5){_0x3f463f['push'](_0x3f463f['shift']());}};_0xb342b2(++_0x1be0db);}(_0x06a5,0xdb));var _0x506a=function(_0x220268,_0x4da70e){_0x220268=_0x220268-0x0;var _0x4f6e56=_0x06a5[_0x220268];return _0x4f6e56;};'use strict';var _=require(_0x506a('0x0'));var util=require(_0x506a('0x1'));var logger=require(_0x506a('0x2'))(_0x506a('0x3'));var moment=require(_0x506a('0x4'));var BPromise=require(_0x506a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x506a('0x6'));var config=require(_0x506a('0x7'));var attributes=require(_0x506a('0x8'));module[_0x506a('0x9')]=function(_0x56f21c,_0x1b6779){return _0x56f21c['define']('UserFaxQueue',attributes,{'tableName':_0x506a('0xa'),'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 a93d1bf..1baea2d 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 _0xb787=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x2d4409,_0x533550){var _0x43d0e9=function(_0x5dcc90){while(--_0x5dcc90){_0x2d4409['push'](_0x2d4409['shift']());}};_0x43d0e9(++_0x533550);}(_0xb787,0x70));var _0x7b78=function(_0x8603fe,_0x116ec8){_0x8603fe=_0x8603fe-0x0;var _0x5b8057=_0xb787[_0x8603fe];return _0x5b8057;};'use strict';var _=require(_0x7b78('0x0'));var util=require(_0x7b78('0x1'));var moment=require(_0x7b78('0x2'));var BPromise=require(_0x7b78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b78('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b78('0x5'));var logger=require(_0x7b78('0x6'))(_0x7b78('0x7'));var config=require(_0x7b78('0x8'));var jayson=require(_0x7b78('0x9'));var client=jayson[_0x7b78('0xa')][_0x7b78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41bdc2,_0x433316,_0x43246c){return new BPromise(function(_0x5bfcde,_0x154b61){return client[_0x7b78('0xc')](_0x41bdc2,_0x43246c)['then'](function(_0x423388){logger[_0x7b78('0xd')](_0x7b78('0xe'),_0x433316,'request\x20sent');logger['debug'](_0x7b78('0xf'),_0x433316,_0x7b78('0x10'),JSON[_0x7b78('0x11')](_0x423388));if(_0x423388['error']){if(_0x423388[_0x7b78('0x12')][_0x7b78('0x13')]===0x1f4){logger[_0x7b78('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x433316,_0x423388[_0x7b78('0x12')][_0x7b78('0x14')]);return _0x154b61(_0x423388['error'][_0x7b78('0x14')]);}logger['error'](_0x7b78('0xe'),_0x433316,_0x423388[_0x7b78('0x12')][_0x7b78('0x14')]);return _0x5bfcde(_0x423388[_0x7b78('0x12')]['message']);}else{logger['info'](_0x7b78('0xe'),_0x433316,_0x7b78('0x10'));_0x5bfcde(_0x423388[_0x7b78('0x15')][_0x7b78('0x14')]);}})[_0x7b78('0x16')](function(_0x19e969){logger[_0x7b78('0x12')](_0x7b78('0xe'),_0x433316,_0x19e969);_0x154b61(_0x19e969);});});} \ No newline at end of file +var _0xb0aa=['error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xb0aa,0x9d));var _0xab0a=function(_0x358b00,_0x2ee0fc){_0x358b00=_0x358b00-0x0;var _0x44799b=_0xb0aa[_0x358b00];return _0x44799b;};'use strict';var _=require(_0xab0a('0x0'));var util=require(_0xab0a('0x1'));var moment=require(_0xab0a('0x2'));var BPromise=require('bluebird');var rs=require(_0xab0a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab0a('0x4'));var logger=require('../../config/logger')(_0xab0a('0x5'));var config=require(_0xab0a('0x6'));var jayson=require(_0xab0a('0x7'));var client=jayson['client'][_0xab0a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cb285,_0x5e1a90,_0x233a47){return new BPromise(function(_0x40bcaa,_0x5ab879){return client[_0xab0a('0x9')](_0x4cb285,_0x233a47)['then'](function(_0x337c0d){logger[_0xab0a('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x5e1a90,'request\x20sent');logger['debug'](_0xab0a('0xb'),_0x5e1a90,_0xab0a('0xc'),JSON[_0xab0a('0xd')](_0x337c0d));if(_0x337c0d[_0xab0a('0xe')]){if(_0x337c0d[_0xab0a('0xe')]['code']===0x1f4){logger[_0xab0a('0xe')](_0xab0a('0xf'),_0x5e1a90,_0x337c0d['error']['message']);return _0x5ab879(_0x337c0d['error'][_0xab0a('0x10')]);}logger[_0xab0a('0xe')](_0xab0a('0xf'),_0x5e1a90,_0x337c0d[_0xab0a('0xe')][_0xab0a('0x10')]);return _0x40bcaa(_0x337c0d['error'][_0xab0a('0x10')]);}else{logger[_0xab0a('0xa')](_0xab0a('0xf'),_0x5e1a90,'request\x20sent');_0x40bcaa(_0x337c0d[_0xab0a('0x11')][_0xab0a('0x10')]);}})[_0xab0a('0x12')](function(_0x20a79f){logger[_0xab0a('0xe')](_0xab0a('0xf'),_0x5e1a90,_0x20a79f);_0x5ab879(_0x20a79f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 93b5ca9..c3bec06 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x45acdb,_0x220bf2){var _0x3bbadd=function(_0x2a7903){while(--_0x2a7903){_0x45acdb['push'](_0x45acdb['shift']());}};_0x3bbadd(++_0x220bf2);}(_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'));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(_0x2df609,_0x4d07a0){var _0x3140a6=function(_0x304b1b){while(--_0x304b1b){_0x2df609['push'](_0x2df609['shift']());}};_0x3140a6(++_0x4d07a0);}(_0x70e0,0x17b));var _0x070e=function(_0x54d81a,_0x37d25b){_0x54d81a=_0x54d81a-0x0;var _0xa468be=_0x70e0[_0x54d81a];return _0xa468be;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index a2946e4..dd53e69 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 _0x26ae=['INTEGER','sequelize','exports'];(function(_0x3ca1f8,_0x4afa33){var _0x94fb6b=function(_0x10c639){while(--_0x10c639){_0x3ca1f8['push'](_0x3ca1f8['shift']());}};_0x94fb6b(++_0x4afa33);}(_0x26ae,0x73));var _0xe26a=function(_0x4dff3e,_0x1a1a7){_0x4dff3e=_0x4dff3e-0x0;var _0x41bb60=_0x26ae[_0x4dff3e];return _0x41bb60;};'use strict';var Sequelize=require(_0xe26a('0x0'));module[_0xe26a('0x1')]={'penalty':{'type':Sequelize[_0xe26a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc1bf=['INTEGER','sequelize','exports'];(function(_0x20e227,_0x1b74c7){var _0xc62185=function(_0x14df33){while(--_0x14df33){_0x20e227['push'](_0x20e227['shift']());}};_0xc62185(++_0x1b74c7);}(_0xc1bf,0x79));var _0xfc1b=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xc1bf[_0x2ca9d4];return _0x258956;};'use strict';var Sequelize=require(_0xfc1b('0x0'));module[_0xfc1b('0x1')]={'penalty':{'type':Sequelize[_0xfc1b('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 663fb61..d66e8f3 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 _0xcaa5=['./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x14f70f,_0xd28b8e){var _0x124d8d=function(_0x50f689){while(--_0x50f689){_0x14f70f['push'](_0x14f70f['shift']());}};_0x124d8d(++_0xd28b8e);}(_0xcaa5,0x162));var _0x5caa=function(_0x52d303,_0x26f460){_0x52d303=_0x52d303-0x0;var _0x42d1c6=_0xcaa5[_0x52d303];return _0x42d1c6;};'use strict';var _=require(_0x5caa('0x0'));var util=require(_0x5caa('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5caa('0x2'));var rp=require(_0x5caa('0x3'));var fs=require('fs');var path=require(_0x5caa('0x4'));var rimraf=require(_0x5caa('0x5'));var config=require('../../config/environment');var attributes=require(_0x5caa('0x6'));module[_0x5caa('0x7')]=function(_0x4e18d7,_0x5791c7){return _0x4e18d7['define'](_0x5caa('0x8'),attributes,{'tableName':_0x5caa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x324c=['user_has_mail_queues','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','UserMailQueue'];(function(_0x46a099,_0x4aa8e2){var _0x5a2b30=function(_0x3c0e79){while(--_0x3c0e79){_0x46a099['push'](_0x46a099['shift']());}};_0x5a2b30(++_0x4aa8e2);}(_0x324c,0x1ae));var _0xc324=function(_0x55bae5,_0x1a55f0){_0x55bae5=_0x55bae5-0x0;var _0x274fc3=_0x324c[_0x55bae5];return _0x274fc3;};'use strict';var _=require(_0xc324('0x0'));var util=require(_0xc324('0x1'));var logger=require(_0xc324('0x2'))('api');var moment=require(_0xc324('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc324('0x4'));var rimraf=require(_0xc324('0x5'));var config=require(_0xc324('0x6'));var attributes=require('./userMailQueue.attributes');module[_0xc324('0x7')]=function(_0x4e1976,_0x37ba6a){return _0x4e1976[_0xc324('0x8')](_0xc324('0x9'),attributes,{'tableName':_0xc324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index fb034cc..3950b30 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(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x1cb9,0x14e));var _0x91cb=function(_0x36979e,_0x5bafc2){_0x36979e=_0x36979e-0x0;var _0x3cbc6b=_0x1cb9[_0x36979e];return _0x3cbc6b;};'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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4d585e,_0x31afc5){var _0x1a3b23=function(_0x4816e0){while(--_0x4816e0){_0x4d585e['push'](_0x4d585e['shift']());}};_0x1a3b23(++_0x31afc5);}(_0x34e8,0x12c));var _0x834e=function(_0x15b628,_0x2ee992){_0x15b628=_0x15b628-0x0;var _0x23f8a2=_0x34e8[_0x15b628];return _0x23f8a2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 9b7435f..3f5e48f 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 _0xca21=['./userNotification.controller','post','sendUserNotification','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5875df,_0x385219){var _0x1b3a38=function(_0x48f3bc){while(--_0x48f3bc){_0x5875df['push'](_0x5875df['shift']());}};_0x1b3a38(++_0x385219);}(_0xca21,0xae));var _0x1ca2=function(_0x18415c,_0x219740){_0x18415c=_0x18415c-0x0;var _0x2d207f=_0xca21[_0x18415c];return _0x2d207f;};'use strict';var multer=require('multer');var util=require(_0x1ca2('0x0'));var path=require('path');var timeout=require(_0x1ca2('0x1'));var express=require(_0x1ca2('0x2'));var router=express[_0x1ca2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1ca2('0x4'));var interaction=require(_0x1ca2('0x5'));var config=require('../../config/environment');var controller=require(_0x1ca2('0x6'));router[_0x1ca2('0x7')]('/',auth['isAuthenticated'](),controller[_0x1ca2('0x8')]);module['exports']=router; \ No newline at end of file +var _0x8dc6=['util','path','express','Router','fs-extra','../../config/environment','./userNotification.controller','isAuthenticated','exports','multer'];(function(_0x1eb5da,_0x1974ec){var _0x579a2f=function(_0x502c14){while(--_0x502c14){_0x1eb5da['push'](_0x1eb5da['shift']());}};_0x579a2f(++_0x1974ec);}(_0x8dc6,0x1ad));var _0x68dc=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x8dc6[_0x237546];return _0x233e29;};'use strict';var multer=require(_0x68dc('0x0'));var util=require(_0x68dc('0x1'));var path=require(_0x68dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x68dc('0x3'));var router=express[_0x68dc('0x4')]();var fs_extra=require(_0x68dc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x68dc('0x6'));var controller=require(_0x68dc('0x7'));router['post']('/',auth[_0x68dc('0x8')](),controller['sendUserNotification']);module[_0x68dc('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3d04799..0f6aa66 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 _0x18d8=['BOOLEAN','STRING'];(function(_0x1631a0,_0xb2411b){var _0x814543=function(_0x95759c){while(--_0x95759c){_0x1631a0['push'](_0x1631a0['shift']());}};_0x814543(++_0xb2411b);}(_0x18d8,0x69));var _0x818d=function(_0x4c1ee3,_0x24a22f){_0x4c1ee3=_0x4c1ee3-0x0;var _0x2ac914=_0x18d8[_0x4c1ee3];return _0x2ac914;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x818d('0x0')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x818d('0x0')]},'beep':{'type':Sequelize[_0x818d('0x1')]}}; \ No newline at end of file +var _0x8176=['STRING','BOOLEAN','TEXT'];(function(_0x1691d8,_0x596352){var _0xd1d4f=function(_0x4af084){while(--_0x4af084){_0x1691d8['push'](_0x1691d8['shift']());}};_0xd1d4f(++_0x596352);}(_0x8176,0xb0));var _0x6817=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8176[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x6817('0x0')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x6817('0x0')]},'recipientsDescription':{'type':Sequelize[_0x6817('0x1')]},'beep':{'type':Sequelize[_0x6817('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index bec2e86..a311768 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 _0x57b5=['user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','join','sequelize','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x57b5,0x14c));var _0x557b=function(_0x3d89ce,_0x5d5e4b){_0x3d89ce=_0x3d89ce-0x0;var _0x494a2e=_0x57b5[_0x3d89ce];return _0x494a2e;};'use strict';var emlformat=require(_0x557b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x557b('0x1'));var jsonpatch=require(_0x557b('0x2'));var rp=require('request-promise');var moment=require(_0x557b('0x3'));var BPromise=require(_0x557b('0x4'));var Mustache=require(_0x557b('0x5'));var util=require(_0x557b('0x6'));var path=require(_0x557b('0x7'));var sox=require(_0x557b('0x8'));var csv=require('to-csv');var ejs=require(_0x557b('0x9'));var fs=require('fs');var fs_extra=require(_0x557b('0xa'));var _=require(_0x557b('0xb'));var squel=require(_0x557b('0xc'));var crypto=require(_0x557b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x557b('0xe'));var querystring=require('querystring');var Papa=require(_0x557b('0xf'));var Redis=require('ioredis');var authService=require(_0x557b('0x10'));var qs=require(_0x557b('0x11'));var as=require(_0x557b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x557b('0x13'))(_0x557b('0x14'));var utils=require(_0x557b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x557b('0x16'));var db=require(_0x557b('0x17'))['db'];config[_0x557b('0x18')]=_['defaults'](config[_0x557b('0x18')],{'host':_0x557b('0x19'),'port':0x18eb});var socket=require(_0x557b('0x1a'))(new Redis(config['redis']));require('./userNotification.socket')[_0x557b('0x1b')](socket);function respondWithStatusCode(_0x2c9d94,_0x311ce7){_0x311ce7=_0x311ce7||0xcc;return function(_0x8d28d2){if(_0x8d28d2){return _0x2c9d94['sendStatus'](_0x311ce7);}return _0x2c9d94[_0x557b('0x1c')](_0x311ce7)[_0x557b('0x1d')]();};}function respondWithResult(_0x291fa1,_0x3be161){_0x3be161=_0x3be161||0xc8;return function(_0x2ce66b){if(_0x2ce66b){return _0x291fa1[_0x557b('0x1c')](_0x3be161)[_0x557b('0x1e')](_0x2ce66b);}};}function respondWithFilteredResult(_0xc5e5c2,_0x28251f){return function(_0x1ff48c){if(_0x1ff48c){var _0x34018c=typeof _0x28251f[_0x557b('0x1f')]===_0x557b('0x20')&&typeof _0x28251f[_0x557b('0x21')]===_0x557b('0x20');var _0x21f7ae=_0x1ff48c[_0x557b('0x22')];var _0x261c75=_0x34018c?0x0:_0x28251f[_0x557b('0x1f')];var _0xdb9db1=_0x34018c?_0x1ff48c['count']:_0x28251f[_0x557b('0x1f')]+_0x28251f[_0x557b('0x21')];var _0x2f6424;if(_0xdb9db1>=_0x21f7ae){_0xdb9db1=_0x21f7ae;_0x2f6424=0xc8;}else{_0x2f6424=0xce;}_0xc5e5c2[_0x557b('0x1c')](_0x2f6424);return _0xc5e5c2['set'](_0x557b('0x23'),_0x261c75+'-'+_0xdb9db1+'/'+_0x21f7ae)['json'](_0x1ff48c);}return null;};}function patchUpdates(_0x7afa0f){return function(_0x3e05f1){try{jsonpatch[_0x557b('0x24')](_0x3e05f1,_0x7afa0f,!![]);}catch(_0x152ab8){return BPromise[_0x557b('0x25')](_0x152ab8);}return _0x3e05f1['save']();};}function saveUpdates(_0x564268,_0x4cbba0){return function(_0x50cff2){if(_0x50cff2){return _0x50cff2[_0x557b('0x26')](_0x564268)[_0x557b('0x27')](function(_0x2ff8c1){return _0x2ff8c1;});}return null;};}function removeEntity(_0xcc7d21,_0x2de53a){return function(_0x5adb6a){if(_0x5adb6a){return _0x5adb6a['destroy']()['then'](function(){_0xcc7d21[_0x557b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8514,_0xa693ad){return function(_0x5d50a2){if(!_0x5d50a2){_0x4d8514[_0x557b('0x28')](0x194);}return _0x5d50a2;};}function handleError(_0x43dc82,_0xdc7b88){_0xdc7b88=_0xdc7b88||0x1f4;return function(_0x5206a7){logger['error'](_0x5206a7[_0x557b('0x29')]);if(_0x5206a7[_0x557b('0x2a')]){delete _0x5206a7[_0x557b('0x2a')];}_0x43dc82[_0x557b('0x1c')](_0xdc7b88)[_0x557b('0x2b')](_0x5206a7);};}exports['sendUserNotification']=function(_0x47c733,_0x702c18,_0x35991d){if(!_0x47c733[_0x557b('0x2c')][_0x557b('0x2d')](_0x557b('0x2e'))&&!_0x47c733[_0x557b('0x2c')][_0x557b('0x2d')](_0x557b('0x2f'))){throw new db['Sequelize'][(_0x557b('0x30'))](_0x557b('0x31'));}else{if(_0x47c733[_0x557b('0x2c')][_0x557b('0x2d')](_0x557b('0x2f'))&&!_0x47c733[_0x557b('0x2c')][_0x557b('0x2d')](_0x557b('0x32'))){throw new db[(_0x557b('0x33'))][(_0x557b('0x30'))](_0x557b('0x34'));}if(!_0x47c733[_0x557b('0x2c')]['hasOwnProperty'](_0x557b('0x35'))){throw new db[(_0x557b('0x33'))][(_0x557b('0x30'))](_0x557b('0x36'));}else{try{var _0x2c3fdc=JSON['parse'](_0x47c733[_0x557b('0x2c')]['recipients']);}catch(_0x44f715){logger[_0x557b('0x37')](_0x44f715);throw new db['Sequelize']['ValidationError'](_0x557b('0x38'));}var _0xb129ee=[_0x557b('0x39'),_0x557b('0x3a'),_0x557b('0x3b'),_0x557b('0x3c'),_0x557b('0x3d'),_0x557b('0x3e'),_0x557b('0x3f'),'team',_0x557b('0x40')];if(_[_0x557b('0x41')](_0x2c3fdc,function(_0x395608){return!_['includes'](_0xb129ee,_0x395608[_0x557b('0x42')][_0x557b('0x43')]());})){throw new db[(_0x557b('0x33'))][(_0x557b('0x30'))](_0x557b('0x44'));}}}var _0x3fd415={};_0x3fd415[_0x557b('0x45')]=_0x47c733['body'][_0x557b('0x2d')](_0x557b('0x45'))?_0x47c733[_0x557b('0x2c')][_0x557b('0x45')]:_0x47c733[_0x557b('0x40')][_0x557b('0x46')];_0x3fd415['recipientsDescription']=_[_0x557b('0x47')](_0x47c733[_0x557b('0x2c')]['recipientsDescription'])?null:_0x47c733['body'][_0x557b('0x48')];_0x3fd415[_0x557b('0x49')]=_0x47c733[_0x557b('0x2c')][_0x557b('0x49')]||![];_0x3fd415[_0x557b('0x4a')]=_0x47c733[_0x557b('0x40')]['id'];return getContent(_0x47c733[_0x557b('0x2c')])[_0x557b('0x27')](function(_0x1ddea2){_0x3fd415[_0x557b('0x2c')]=_0x1ddea2;return getRecipients(_0x2c3fdc);})['then'](function(_0x585725){_0x3fd415['recipientsId']=_['sortBy'](_0x585725)[_0x557b('0x4b')](',');return db[_0x557b('0x4c')][_0x557b('0x4d')](function(_0x6d781c){return db[_0x557b('0x4e')][_0x557b('0x4f')](_0x3fd415,{'raw':!![],'transaction':_0x6d781c})[_0x557b('0x27')](function(_0x34c584){var _0x278982={'sender':_0x3fd415[_0x557b('0x45')],'description':_0x3fd415[_0x557b('0x48')],'content':_0x3fd415['body'],'beep':_0x3fd415[_0x557b('0x49')]};_0x585725['forEach'](function(_0x3f9207){_0x278982[_0x557b('0x50')]=_0x3f9207;socket[_0x557b('0x51')](_0x557b('0x52'),_0x278982);});return _0x34c584;});});})[_0x557b('0x27')](respondWithResult(_0x702c18,0xc9))[_0x557b('0x53')](handleError(_0x702c18,null));};function getContent(_0xa21ecc){return new BPromise(function(_0x4af473,_0xd8f88f){if(_0xa21ecc['text']){_0x4af473(_0xa21ecc[_0x557b('0x2e')]);return;}return db['Template'][_0x557b('0x54')]({'attributes':[_0x557b('0x55')],'where':{'id':_0xa21ecc[_0x557b('0x2f')]},'raw':!![]})[_0x557b('0x27')](function(_0x5e6eac){if(!_0x5e6eac)throw new db['Sequelize'][(_0x557b('0x30'))](_0x557b('0x56'));var _0x1486fd=Mustache[_0x557b('0x57')](_0x5e6eac[_0x557b('0x55')],_0xa21ecc[_0x557b('0x32')]);_0x4af473(_0x1486fd);})[_0x557b('0x53')](function(_0x5d8d38){_0xd8f88f(_0x5d8d38);});});}function getRecipients(_0x54437e){return new BPromise(function(_0x12e77b,_0x51bfde){var _0x1f5937=[];var _0x7d28e6=[];_0x54437e[_0x557b('0x58')](function(_0x4d4104){var _0x2ae0fc=_['startCase'](_0x4d4104[_0x557b('0x42')][_0x557b('0x43')]());if(_0x2ae0fc===_0x557b('0x59')){_0x1f5937=_[_0x557b('0x5a')](_0x1f5937,_0x4d4104[_0x557b('0x5b')]);}else{if(_['includes'](_0x2ae0fc,_0x557b('0x5c')))_0x2ae0fc=_0x2ae0fc[_0x557b('0x5d')](_0x557b('0x5c'),_0x557b('0x5e'));_0x4d4104['ids'][_0x557b('0x58')](function(_0x312975){_0x7d28e6[_0x557b('0x5f')](getAgents(_0x2ae0fc,_0x312975));});}});return BPromise[_0x557b('0x60')](_0x7d28e6)['then'](function(_0xfa74d9){_0x1f5937=_['union'](_0x1f5937,_[_0x557b('0x61')](_0xfa74d9));_0x12e77b(_0x1f5937);})['catch'](function(_0x20dcd7){_0x51bfde(_0x20dcd7);});});}function getAgents(_0x42b50f,_0x3ce104){return new BPromise(function(_0x23a25b,_0x4854dc){return db[_0x42b50f][_0x557b('0x54')]({'where':{'id':_0x3ce104}})[_0x557b('0x27')](function(_0xa919d0){return _0xa919d0[_0x557b('0x62')]({'attributes':['id'],'raw':!![]})[_0x557b('0x27')](function(_0x3592a7){var _0x44486e=_['map'](_0x3592a7,'id');_0x23a25b(_0x44486e);});})[_0x557b('0x53')](function(_0x27967a){_0x4854dc(_0x27967a);});});} \ No newline at end of file +var _0xcd1d=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','create','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','model','User','union','ids','replace','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xcd1d,0x177));var _0xdcd1=function(_0x10a367,_0x3adb87){_0x10a367=_0x10a367-0x0;var _0x16cb49=_0xcd1d[_0x10a367];return _0x16cb49;};'use strict';var emlformat=require(_0xdcd1('0x0'));var rimraf=require(_0xdcd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdcd1('0x2'));var rp=require(_0xdcd1('0x3'));var moment=require('moment');var BPromise=require(_0xdcd1('0x4'));var Mustache=require(_0xdcd1('0x5'));var util=require(_0xdcd1('0x6'));var path=require(_0xdcd1('0x7'));var sox=require(_0xdcd1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdcd1('0x9'));var _=require(_0xdcd1('0xa'));var squel=require('squel');var crypto=require(_0xdcd1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdcd1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdcd1('0xd'));var Papa=require(_0xdcd1('0xe'));var Redis=require(_0xdcd1('0xf'));var authService=require(_0xdcd1('0x10'));var qs=require(_0xdcd1('0x11'));var as=require(_0xdcd1('0x12'));var hardwareService=require(_0xdcd1('0x13'));var logger=require(_0xdcd1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdcd1('0x15'));var licenseUtil=require(_0xdcd1('0x16'));var db=require(_0xdcd1('0x17'))['db'];config[_0xdcd1('0x18')]=_[_0xdcd1('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdcd1('0x1a'))(new Redis(config['redis']));require(_0xdcd1('0x1b'))[_0xdcd1('0x1c')](socket);function respondWithStatusCode(_0xc565d5,_0x5d28e8){_0x5d28e8=_0x5d28e8||0xcc;return function(_0x418691){if(_0x418691){return _0xc565d5['sendStatus'](_0x5d28e8);}return _0xc565d5[_0xdcd1('0x1d')](_0x5d28e8)[_0xdcd1('0x1e')]();};}function respondWithResult(_0x8e3aa1,_0x225b2f){_0x225b2f=_0x225b2f||0xc8;return function(_0x5b3cc6){if(_0x5b3cc6){return _0x8e3aa1[_0xdcd1('0x1d')](_0x225b2f)[_0xdcd1('0x1f')](_0x5b3cc6);}};}function respondWithFilteredResult(_0x58b808,_0x8d4616){return function(_0x2f7202){if(_0x2f7202){var _0x42bd0e=typeof _0x8d4616['offset']===_0xdcd1('0x20')&&typeof _0x8d4616[_0xdcd1('0x21')]==='undefined';var _0x3e16d9=_0x2f7202['count'];var _0x3d8ad8=_0x42bd0e?0x0:_0x8d4616[_0xdcd1('0x22')];var _0x26456b=_0x42bd0e?_0x2f7202['count']:_0x8d4616['offset']+_0x8d4616[_0xdcd1('0x21')];var _0x519597;if(_0x26456b>=_0x3e16d9){_0x26456b=_0x3e16d9;_0x519597=0xc8;}else{_0x519597=0xce;}_0x58b808[_0xdcd1('0x1d')](_0x519597);return _0x58b808[_0xdcd1('0x23')](_0xdcd1('0x24'),_0x3d8ad8+'-'+_0x26456b+'/'+_0x3e16d9)[_0xdcd1('0x1f')](_0x2f7202);}return null;};}function patchUpdates(_0x4612c9){return function(_0x200102){try{jsonpatch[_0xdcd1('0x25')](_0x200102,_0x4612c9,!![]);}catch(_0x2f2520){return BPromise[_0xdcd1('0x26')](_0x2f2520);}return _0x200102[_0xdcd1('0x27')]();};}function saveUpdates(_0x1c3ed4,_0x47cfc3){return function(_0x1c2028){if(_0x1c2028){return _0x1c2028[_0xdcd1('0x28')](_0x1c3ed4)[_0xdcd1('0x29')](function(_0x35507a){return _0x35507a;});}return null;};}function removeEntity(_0x5d7b94,_0x2b7471){return function(_0x213422){if(_0x213422){return _0x213422['destroy']()['then'](function(){_0x5d7b94[_0xdcd1('0x1d')](0xcc)[_0xdcd1('0x1e')]();});}};}function handleEntityNotFound(_0x10514d,_0x439219){return function(_0x5f5ad2){if(!_0x5f5ad2){_0x10514d['sendStatus'](0x194);}return _0x5f5ad2;};}function handleError(_0x24dbde,_0x32d341){_0x32d341=_0x32d341||0x1f4;return function(_0xde73f8){logger[_0xdcd1('0x2a')](_0xde73f8[_0xdcd1('0x2b')]);if(_0xde73f8[_0xdcd1('0x2c')]){delete _0xde73f8['name'];}_0x24dbde[_0xdcd1('0x1d')](_0x32d341)['send'](_0xde73f8);};}exports[_0xdcd1('0x2d')]=function(_0x17a761,_0x3c9b95,_0x3b7eb6){if(!_0x17a761[_0xdcd1('0x2e')][_0xdcd1('0x2f')]('text')&&!_0x17a761[_0xdcd1('0x2e')][_0xdcd1('0x2f')](_0xdcd1('0x30'))){throw new db[(_0xdcd1('0x31'))][(_0xdcd1('0x32'))](_0xdcd1('0x33'));}else{if(_0x17a761[_0xdcd1('0x2e')][_0xdcd1('0x2f')]('TemplateId')&&!_0x17a761[_0xdcd1('0x2e')][_0xdcd1('0x2f')](_0xdcd1('0x34'))){throw new db[(_0xdcd1('0x31'))][(_0xdcd1('0x32'))](_0xdcd1('0x35'));}if(!_0x17a761[_0xdcd1('0x2e')][_0xdcd1('0x2f')]('recipients')){throw new db[(_0xdcd1('0x31'))][(_0xdcd1('0x32'))](_0xdcd1('0x36'));}else{try{var _0x4a21ff=JSON[_0xdcd1('0x37')](_0x17a761[_0xdcd1('0x2e')]['recipients']);}catch(_0x258e9c){logger[_0xdcd1('0x2a')](_0x258e9c);throw new db[(_0xdcd1('0x31'))]['ValidationError'](_0xdcd1('0x38'));}var _0x5d4cb5=[_0xdcd1('0x39'),_0xdcd1('0x3a'),'mailqueue',_0xdcd1('0x3b'),_0xdcd1('0x3c'),_0xdcd1('0x3d'),_0xdcd1('0x3e'),'team',_0xdcd1('0x3f')];if(_[_0xdcd1('0x40')](_0x4a21ff,function(_0x2e7766){return!_[_0xdcd1('0x41')](_0x5d4cb5,_0x2e7766['model'][_0xdcd1('0x42')]());})){throw new db['Sequelize'][(_0xdcd1('0x32'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x348ee1={};_0x348ee1[_0xdcd1('0x43')]=_0x17a761['body'][_0xdcd1('0x2f')](_0xdcd1('0x43'))?_0x17a761[_0xdcd1('0x2e')][_0xdcd1('0x43')]:_0x17a761['user'][_0xdcd1('0x44')];_0x348ee1[_0xdcd1('0x45')]=_[_0xdcd1('0x46')](_0x17a761['body']['recipientsDescription'])?null:_0x17a761[_0xdcd1('0x2e')]['recipientsDescription'];_0x348ee1[_0xdcd1('0x47')]=_0x17a761[_0xdcd1('0x2e')][_0xdcd1('0x47')]||![];_0x348ee1[_0xdcd1('0x48')]=_0x17a761[_0xdcd1('0x3f')]['id'];return getContent(_0x17a761[_0xdcd1('0x2e')])[_0xdcd1('0x29')](function(_0x4f83d2){_0x348ee1[_0xdcd1('0x2e')]=_0x4f83d2;return getRecipients(_0x4a21ff);})['then'](function(_0x456dc6){_0x348ee1[_0xdcd1('0x49')]=_['sortBy'](_0x456dc6)[_0xdcd1('0x4a')](',');return db[_0xdcd1('0x4b')]['transaction'](function(_0x23f925){return db['UserNotification'][_0xdcd1('0x4c')](_0x348ee1,{'raw':!![],'transaction':_0x23f925})[_0xdcd1('0x29')](function(_0xf17bd6){var _0x4a992f={'sender':_0x348ee1[_0xdcd1('0x43')],'description':_0x348ee1[_0xdcd1('0x45')],'content':_0x348ee1[_0xdcd1('0x2e')],'beep':_0x348ee1[_0xdcd1('0x47')]};_0x456dc6[_0xdcd1('0x4d')](function(_0x45cf2a){_0x4a992f[_0xdcd1('0x4e')]=_0x45cf2a;socket[_0xdcd1('0x4f')](_0xdcd1('0x50'),_0x4a992f);});return _0xf17bd6;});});})[_0xdcd1('0x29')](respondWithResult(_0x3c9b95,0xc9))[_0xdcd1('0x51')](handleError(_0x3c9b95,null));};function getContent(_0x3f33b0){return new BPromise(function(_0xb56304,_0x563844){if(_0x3f33b0[_0xdcd1('0x52')]){_0xb56304(_0x3f33b0[_0xdcd1('0x52')]);return;}return db[_0xdcd1('0x53')][_0xdcd1('0x54')]({'attributes':[_0xdcd1('0x55')],'where':{'id':_0x3f33b0[_0xdcd1('0x30')]},'raw':!![]})[_0xdcd1('0x29')](function(_0x24468d){if(!_0x24468d)throw new db['Sequelize'][(_0xdcd1('0x32'))](_0xdcd1('0x56'));var _0x13f4a4=Mustache['render'](_0x24468d[_0xdcd1('0x55')],_0x3f33b0['view']);_0xb56304(_0x13f4a4);})[_0xdcd1('0x51')](function(_0x2d2314){_0x563844(_0x2d2314);});});}function getRecipients(_0x46af07){return new BPromise(function(_0x5742b7,_0x3bcef5){var _0x3a9f31=[];var _0x2bf808=[];_0x46af07[_0xdcd1('0x4d')](function(_0x5c093f){var _0x342f0d=_['startCase'](_0x5c093f[_0xdcd1('0x57')][_0xdcd1('0x42')]());if(_0x342f0d===_0xdcd1('0x58')){_0x3a9f31=_[_0xdcd1('0x59')](_0x3a9f31,_0x5c093f[_0xdcd1('0x5a')]);}else{if(_['includes'](_0x342f0d,'queue'))_0x342f0d=_0x342f0d[_0xdcd1('0x5b')](_0xdcd1('0x5c'),_0xdcd1('0x5d'));_0x5c093f[_0xdcd1('0x5a')][_0xdcd1('0x4d')](function(_0x182184){_0x2bf808[_0xdcd1('0x5e')](getAgents(_0x342f0d,_0x182184));});}});return BPromise[_0xdcd1('0x5f')](_0x2bf808)[_0xdcd1('0x29')](function(_0x5db89f){_0x3a9f31=_[_0xdcd1('0x59')](_0x3a9f31,_[_0xdcd1('0x60')](_0x5db89f));_0x5742b7(_0x3a9f31);})[_0xdcd1('0x51')](function(_0x3d7b28){_0x3bcef5(_0x3d7b28);});});}function getAgents(_0x12b68a,_0x1a4682){return new BPromise(function(_0x26e5f2,_0x5ec3ce){return db[_0x12b68a][_0xdcd1('0x54')]({'where':{'id':_0x1a4682}})[_0xdcd1('0x29')](function(_0x43f6bf){return _0x43f6bf[_0xdcd1('0x61')]({'attributes':['id'],'raw':!![]})[_0xdcd1('0x29')](function(_0x3e84de){var _0x3e4b1d=_[_0xdcd1('0x62')](_0x3e84de,'id');_0x26e5f2(_0x3e4b1d);});})[_0xdcd1('0x51')](function(_0x50905f){_0x5ec3ce(_0x50905f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 592c99d..9b05a95 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 _0xe164=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification'];(function(_0x2c9993,_0x1275b5){var _0x4ff8f1=function(_0x1ec249){while(--_0x1ec249){_0x2c9993['push'](_0x2c9993['shift']());}};_0x4ff8f1(++_0x1275b5);}(_0xe164,0xcf));var _0x4e16=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe164[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x4e16('0x0'));var UserNotification=require(_0x4e16('0x1'))['db'][_0x4e16('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4e16('0x3')](0x0);var events={'afterCreate':_0x4e16('0x4'),'afterUpdate':_0x4e16('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3efa18){return function(_0x4cd905,_0x52b41f,_0x92051e){UserNotificationEvents['emit'](_0x3efa18+':'+_0x4cd905['id'],_0x4cd905);UserNotificationEvents[_0x4e16('0x6')](_0x3efa18,_0x4cd905);_0x92051e(null);};}for(var e in events){if(events[_0x4e16('0x7')](e)){var event=events[e];UserNotification[_0x4e16('0x8')](e,emitEvent(event));}}module[_0x4e16('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xe26b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification'];(function(_0x56250d,_0x25a6b8){var _0x13e85e=function(_0x1664fd){while(--_0x1664fd){_0x56250d['push'](_0x56250d['shift']());}};_0x13e85e(++_0x25a6b8);}(_0xe26b,0x11f));var _0xbe26=function(_0x9b993d,_0x16efcc){_0x9b993d=_0x9b993d-0x0;var _0x2c30fb=_0xe26b[_0x9b993d];return _0x2c30fb;};'use strict';var EventEmitter=require(_0xbe26('0x0'));var UserNotification=require(_0xbe26('0x1'))['db'][_0xbe26('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xbe26('0x3')](0x0);var events={'afterCreate':_0xbe26('0x4'),'afterUpdate':_0xbe26('0x5'),'afterDestroy':_0xbe26('0x6')};function emitEvent(_0x374308){return function(_0x41e944,_0x4213e5,_0x181f70){UserNotificationEvents[_0xbe26('0x7')](_0x374308+':'+_0x41e944['id'],_0x41e944);UserNotificationEvents[_0xbe26('0x7')](_0x374308,_0x41e944);_0x181f70(null);};}for(var e in events){if(events[_0xbe26('0x8')](e)){var event=events[e];UserNotification[_0xbe26('0x9')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index f12f3ca..c16d2a4 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 _0x76cd=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2e7c1b,_0x232f79){var _0x42f565=function(_0x31ee5a){while(--_0x31ee5a){_0x2e7c1b['push'](_0x2e7c1b['shift']());}};_0x42f565(++_0x232f79);}(_0x76cd,0x1da));var _0xd76c=function(_0xac4d13,_0x52ad6b){_0xac4d13=_0xac4d13-0x0;var _0x1a7814=_0x76cd[_0xac4d13];return _0x1a7814;};'use strict';var _=require(_0xd76c('0x0'));var util=require(_0xd76c('0x1'));var logger=require(_0xd76c('0x2'))('api');var moment=require(_0xd76c('0x3'));var BPromise=require(_0xd76c('0x4'));var rp=require(_0xd76c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd76c('0x6'));var config=require(_0xd76c('0x7'));var attributes=require(_0xd76c('0x8'));module['exports']=function(_0x2a9247,_0x41f1dc){return _0x2a9247[_0xd76c('0x9')](_0xd76c('0xa'),attributes,{'tableName':_0xd76c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd76c('0xc'),'collate':_0xd76c('0xd')});}; \ No newline at end of file +var _0xa612=['UserNotification','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa612,0x10d));var _0x2a61=function(_0x2b5147,_0xedb2dd){_0x2b5147=_0x2b5147-0x0;var _0x58eff5=_0xa612[_0x2b5147];return _0x58eff5;};'use strict';var _=require('lodash');var util=require(_0x2a61('0x0'));var logger=require(_0x2a61('0x1'))(_0x2a61('0x2'));var moment=require(_0x2a61('0x3'));var BPromise=require(_0x2a61('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a61('0x5'));var rimraf=require(_0x2a61('0x6'));var config=require(_0x2a61('0x7'));var attributes=require(_0x2a61('0x8'));module[_0x2a61('0x9')]=function(_0x5827cf,_0x515c13){return _0x5827cf[_0x2a61('0xa')](_0x2a61('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a61('0xc'),'collate':_0x2a61('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index e2a60a8..8cc1f30 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 _0x1824=['UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','./userNotification.socket','register','request','then','info'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x1824,0x166));var _0x4182=function(_0x494b28,_0x440d79){_0x494b28=_0x494b28-0x0;var _0x158556=_0x1824[_0x494b28];return _0x158556;};'use strict';var _=require(_0x4182('0x0'));var util=require(_0x4182('0x1'));var moment=require(_0x4182('0x2'));var BPromise=require(_0x4182('0x3'));var rs=require(_0x4182('0x4'));var fs=require('fs');var Redis=require(_0x4182('0x5'));var db=require(_0x4182('0x6'))['db'];var utils=require(_0x4182('0x7'));var logger=require(_0x4182('0x8'))(_0x4182('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4182('0xa')]({'port':0x232a});config[_0x4182('0xb')]=_[_0x4182('0xc')](config[_0x4182('0xb')],{'host':_0x4182('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4182('0xb')]));require(_0x4182('0xe'))[_0x4182('0xf')](socket);function respondWithRpcPromise(_0x3da426,_0x1b5517,_0x9f7e58){return new BPromise(function(_0x4003f6,_0x59412c){return client[_0x4182('0x10')](_0x3da426,_0x9f7e58)[_0x4182('0x11')](function(_0x594bdb){logger[_0x4182('0x12')](_0x4182('0x13'),_0x1b5517,'request\x20sent');logger[_0x4182('0x14')](_0x4182('0x15'),_0x1b5517,_0x4182('0x16'),JSON[_0x4182('0x17')](_0x594bdb));if(_0x594bdb[_0x4182('0x18')]){if(_0x594bdb[_0x4182('0x18')][_0x4182('0x19')]===0x1f4){logger['error'](_0x4182('0x13'),_0x1b5517,_0x594bdb['error'][_0x4182('0x1a')]);return _0x59412c(_0x594bdb[_0x4182('0x18')][_0x4182('0x1a')]);}logger[_0x4182('0x18')]('UserNotification,\x20%s,\x20%s',_0x1b5517,_0x594bdb[_0x4182('0x18')][_0x4182('0x1a')]);return _0x4003f6(_0x594bdb['error'][_0x4182('0x1a')]);}else{logger[_0x4182('0x12')](_0x4182('0x13'),_0x1b5517,_0x4182('0x16'));_0x4003f6(_0x594bdb[_0x4182('0x1b')][_0x4182('0x1a')]);}})[_0x4182('0x1c')](function(_0x24a5f5){logger['error'](_0x4182('0x13'),_0x1b5517,_0x24a5f5);_0x59412c(_0x24a5f5);});});} \ No newline at end of file +var _0xb7e9=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','result'];(function(_0x33517d,_0x291343){var _0x1d0964=function(_0x52c10c){while(--_0x52c10c){_0x33517d['push'](_0x33517d['shift']());}};_0x1d0964(++_0x291343);}(_0xb7e9,0x1dd));var _0x9b7e=function(_0x5a6e7b,_0x3dabdc){_0x5a6e7b=_0x5a6e7b-0x0;var _0x5bef75=_0xb7e9[_0x5a6e7b];return _0x5bef75;};'use strict';var _=require(_0x9b7e('0x0'));var util=require(_0x9b7e('0x1'));var moment=require(_0x9b7e('0x2'));var BPromise=require(_0x9b7e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b7e('0x4'));var db=require(_0x9b7e('0x5'))['db'];var utils=require(_0x9b7e('0x6'));var logger=require(_0x9b7e('0x7'))(_0x9b7e('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b7e('0x9'));var client=jayson['client'][_0x9b7e('0xa')]({'port':0x232a});config['redis']=_[_0x9b7e('0xb')](config[_0x9b7e('0xc')],{'host':_0x9b7e('0xd'),'port':0x18eb});var socket=require(_0x9b7e('0xe'))(new Redis(config[_0x9b7e('0xc')]));require(_0x9b7e('0xf'))[_0x9b7e('0x10')](socket);function respondWithRpcPromise(_0x68dc74,_0x2c5b17,_0x5ab7d9){return new BPromise(function(_0x537ae9,_0x446e04){return client[_0x9b7e('0x11')](_0x68dc74,_0x5ab7d9)['then'](function(_0x6e4388){logger[_0x9b7e('0x12')]('UserNotification,\x20%s,\x20%s',_0x2c5b17,_0x9b7e('0x13'));logger[_0x9b7e('0x14')](_0x9b7e('0x15'),_0x2c5b17,'request\x20sent',JSON['stringify'](_0x6e4388));if(_0x6e4388[_0x9b7e('0x16')]){if(_0x6e4388[_0x9b7e('0x16')][_0x9b7e('0x17')]===0x1f4){logger[_0x9b7e('0x16')](_0x9b7e('0x18'),_0x2c5b17,_0x6e4388['error'][_0x9b7e('0x19')]);return _0x446e04(_0x6e4388[_0x9b7e('0x16')]['message']);}logger[_0x9b7e('0x16')](_0x9b7e('0x18'),_0x2c5b17,_0x6e4388['error'][_0x9b7e('0x19')]);return _0x537ae9(_0x6e4388[_0x9b7e('0x16')][_0x9b7e('0x19')]);}else{logger[_0x9b7e('0x12')](_0x9b7e('0x18'),_0x2c5b17,'request\x20sent');_0x537ae9(_0x6e4388[_0x9b7e('0x1a')]['message']);}})[_0x9b7e('0x1b')](function(_0x40cb5b){logger[_0x9b7e('0x16')](_0x9b7e('0x18'),_0x2c5b17,_0x40cb5b);_0x446e04(_0x40cb5b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 0d14ad6..917a760 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 _0xecba=['emit','register','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0xecba,0x1ec));var _0xaecb=function(_0x586bcb,_0x40a935){_0x586bcb=_0x586bcb-0x0;var _0x32ca44=_0xecba[_0x586bcb];return _0x32ca44;};'use strict';var UserNotificationEvents=require(_0xaecb('0x0'));var events=[_0xaecb('0x1'),_0xaecb('0x2'),_0xaecb('0x3')];function createListener(_0xa6938d,_0x245dca){return function(_0x7b7d05){_0x245dca[_0xaecb('0x4')](_0xa6938d,_0x7b7d05);};}function removeListener(_0x1e1fa8,_0x5366ce){return function(){UserNotificationEvents['removeListener'](_0x1e1fa8,_0x5366ce);};}exports[_0xaecb('0x5')]=function(_0x24f6e4){for(var _0x445473=0x0,_0x137db0=events[_0xaecb('0x6')];_0x445473<_0x137db0;_0x445473++){var _0x344697=events[_0x445473];var _0x487708=createListener(_0xaecb('0x7')+_0x344697,_0x24f6e4);UserNotificationEvents['on'](_0x344697,_0x487708);}}; \ No newline at end of file +var _0xcef3=['remove','update','removeListener','length','userNotification:','./userNotification.events'];(function(_0x280820,_0xce9bc7){var _0x474787=function(_0x3d224e){while(--_0x3d224e){_0x280820['push'](_0x280820['shift']());}};_0x474787(++_0xce9bc7);}(_0xcef3,0xd7));var _0x3cef=function(_0x220ef3,_0x409fe4){_0x220ef3=_0x220ef3-0x0;var _0x4c6ab9=_0xcef3[_0x220ef3];return _0x4c6ab9;};'use strict';var UserNotificationEvents=require(_0x3cef('0x0'));var events=['save',_0x3cef('0x1'),_0x3cef('0x2')];function createListener(_0x5d0b97,_0x3c7782){return function(_0x38fa86){_0x3c7782['emit'](_0x5d0b97,_0x38fa86);};}function removeListener(_0x2d4fb6,_0x499420){return function(){UserNotificationEvents[_0x3cef('0x3')](_0x2d4fb6,_0x499420);};}exports['register']=function(_0x38c241){for(var _0x5aede7=0x0,_0x3fa124=events[_0x3cef('0x4')];_0x5aede7<_0x3fa124;_0x5aede7++){var _0x451a5d=events[_0x5aede7];var _0x4f7dad=createListener(_0x3cef('0x5')+_0x451a5d,_0x38c241);UserNotificationEvents['on'](_0x451a5d,_0x4f7dad);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index e58eb20..a2c1d42 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2aa91d,_0x1b4ef5){var _0x204079=function(_0x1b6e86){while(--_0x1b6e86){_0x2aa91d['push'](_0x2aa91d['shift']());}};_0x204079(++_0x1b4ef5);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e35a9,_0x312ec6){var _0x1298af=function(_0xa497f5){while(--_0xa497f5){_0x1e35a9['push'](_0x1e35a9['shift']());}};_0x1298af(++_0x312ec6);}(_0x70e0,0x17b));var _0x070e=function(_0x1a5c7f,_0x41dcc2){_0x1a5c7f=_0x1a5c7f-0x0;var _0x2823d6=_0x70e0[_0x1a5c7f];return _0x2823d6;};'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 0c1626d..39c3944 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 _0x3770=['INTEGER','sequelize','exports'];(function(_0x13b905,_0x58a608){var _0x82e4c8=function(_0x59dc3f){while(--_0x59dc3f){_0x13b905['push'](_0x13b905['shift']());}};_0x82e4c8(++_0x58a608);}(_0x3770,0x13c));var _0x0377=function(_0x14e53e,_0x326803){_0x14e53e=_0x14e53e-0x0;var _0x2b69aa=_0x3770[_0x14e53e];return _0x2b69aa;};'use strict';var Sequelize=require(_0x0377('0x0'));module[_0x0377('0x1')]={'penalty':{'type':Sequelize[_0x0377('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc986=['exports','INTEGER','sequelize'];(function(_0x179351,_0x5b98c8){var _0x429dba=function(_0x4863da){while(--_0x4863da){_0x179351['push'](_0x179351['shift']());}};_0x429dba(++_0x5b98c8);}(_0xc986,0xce));var _0x6c98=function(_0x2bfe4a,_0x56489a){_0x2bfe4a=_0x2bfe4a-0x0;var _0x4ce1ed=_0xc986[_0x2bfe4a];return _0x4ce1ed;};'use strict';var Sequelize=require(_0x6c98('0x0'));module[_0x6c98('0x1')]={'penalty':{'type':Sequelize[_0x6c98('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 7fa6cb8..c0a3933 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 _0xf665=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment'];(function(_0x32db2d,_0xf2d6fc){var _0x28d9a9=function(_0x1f4548){while(--_0x1f4548){_0x32db2d['push'](_0x32db2d['shift']());}};_0x28d9a9(++_0xf2d6fc);}(_0xf665,0xf3));var _0x5f66=function(_0x1aec02,_0x3a7f22){_0x1aec02=_0x1aec02-0x0;var _0x10a837=_0xf665[_0x1aec02];return _0x10a837;};'use strict';var _=require(_0x5f66('0x0'));var util=require('util');var logger=require(_0x5f66('0x1'))(_0x5f66('0x2'));var moment=require(_0x5f66('0x3'));var BPromise=require(_0x5f66('0x4'));var rp=require(_0x5f66('0x5'));var fs=require('fs');var path=require(_0x5f66('0x6'));var rimraf=require(_0x5f66('0x7'));var config=require(_0x5f66('0x8'));var attributes=require(_0x5f66('0x9'));module['exports']=function(_0xa2dc72,_0x39cef1){return _0xa2dc72[_0x5f66('0xa')](_0x5f66('0xb'),attributes,{'tableName':_0x5f66('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf23b=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4ace4c,_0x164078){var _0x40a84e=function(_0x398ba6){while(--_0x398ba6){_0x4ace4c['push'](_0x4ace4c['shift']());}};_0x40a84e(++_0x164078);}(_0xf23b,0x19a));var _0xbf23=function(_0x52afd3,_0x318610){_0x52afd3=_0x52afd3-0x0;var _0x3c4920=_0xf23b[_0x52afd3];return _0x3c4920;};'use strict';var _=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var logger=require('../../config/logger')(_0xbf23('0x2'));var moment=require(_0xbf23('0x3'));var BPromise=require(_0xbf23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf23('0x5'));var rimraf=require(_0xbf23('0x6'));var config=require(_0xbf23('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x389336,_0x237a8a){return _0x389336[_0xbf23('0x8')](_0xbf23('0x9'),attributes,{'tableName':_0xbf23('0xa'),'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 6ae84f1..ff91c22 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 _0xee55=['client','http','request','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e1fa9,_0x3cbb49){var _0x4b4911=function(_0x3e033c){while(--_0x3e033c){_0x2e1fa9['push'](_0x2e1fa9['shift']());}};_0x4b4911(++_0x3cbb49);}(_0xee55,0x76));var _0x5ee5=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xee55[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x5ee5('0x0'));var util=require(_0x5ee5('0x1'));var moment=require(_0x5ee5('0x2'));var BPromise=require(_0x5ee5('0x3'));var rs=require(_0x5ee5('0x4'));var fs=require('fs');var Redis=require(_0x5ee5('0x5'));var db=require(_0x5ee5('0x6'))['db'];var utils=require(_0x5ee5('0x7'));var logger=require(_0x5ee5('0x8'))(_0x5ee5('0x9'));var config=require(_0x5ee5('0xa'));var jayson=require(_0x5ee5('0xb'));var client=jayson[_0x5ee5('0xc')][_0x5ee5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x473bc8,_0x54c565,_0x39160c){return new BPromise(function(_0x2fd13d,_0x30f245){return client[_0x5ee5('0xe')](_0x473bc8,_0x39160c)['then'](function(_0x584659){logger[_0x5ee5('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x54c565,'request\x20sent');logger[_0x5ee5('0x10')](_0x5ee5('0x11'),_0x54c565,_0x5ee5('0x12'),JSON[_0x5ee5('0x13')](_0x584659));if(_0x584659[_0x5ee5('0x14')]){if(_0x584659['error'][_0x5ee5('0x15')]===0x1f4){logger[_0x5ee5('0x14')](_0x5ee5('0x16'),_0x54c565,_0x584659[_0x5ee5('0x14')][_0x5ee5('0x17')]);return _0x30f245(_0x584659['error'][_0x5ee5('0x17')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x54c565,_0x584659[_0x5ee5('0x14')][_0x5ee5('0x17')]);return _0x2fd13d(_0x584659['error']['message']);}else{logger[_0x5ee5('0xf')](_0x5ee5('0x16'),_0x54c565,_0x5ee5('0x12'));_0x2fd13d(_0x584659[_0x5ee5('0x18')][_0x5ee5('0x17')]);}})[_0x5ee5('0x19')](function(_0x31da97){logger[_0x5ee5('0x14')](_0x5ee5('0x16'),_0x54c565,_0x31da97);_0x30f245(_0x31da97);});});} \ No newline at end of file +var _0xd6a7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xd6a7,0x1b1));var _0x7d6a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd6a7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x7d6a('0x0'));var moment=require(_0x7d6a('0x1'));var BPromise=require(_0x7d6a('0x2'));var rs=require(_0x7d6a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d6a('0x4'))['db'];var utils=require(_0x7d6a('0x5'));var logger=require(_0x7d6a('0x6'))(_0x7d6a('0x7'));var config=require(_0x7d6a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d6a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57697b,_0x62c66a,_0x4364db){return new BPromise(function(_0x32da03,_0x40d37b){return client['request'](_0x57697b,_0x4364db)['then'](function(_0x2a079a){logger['info'](_0x7d6a('0xa'),_0x62c66a,_0x7d6a('0xb'));logger[_0x7d6a('0xc')](_0x7d6a('0xd'),_0x62c66a,_0x7d6a('0xb'),JSON[_0x7d6a('0xe')](_0x2a079a));if(_0x2a079a[_0x7d6a('0xf')]){if(_0x2a079a[_0x7d6a('0xf')][_0x7d6a('0x10')]===0x1f4){logger[_0x7d6a('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x62c66a,_0x2a079a[_0x7d6a('0xf')][_0x7d6a('0x11')]);return _0x40d37b(_0x2a079a[_0x7d6a('0xf')][_0x7d6a('0x11')]);}logger['error'](_0x7d6a('0xa'),_0x62c66a,_0x2a079a[_0x7d6a('0xf')][_0x7d6a('0x11')]);return _0x32da03(_0x2a079a[_0x7d6a('0xf')][_0x7d6a('0x11')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x62c66a,_0x7d6a('0xb'));_0x32da03(_0x2a079a[_0x7d6a('0x12')][_0x7d6a('0x11')]);}})['catch'](function(_0x1af6da){logger['error'](_0x7d6a('0xa'),_0x62c66a,_0x1af6da);_0x40d37b(_0x1af6da);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index d7a70f4..0704525 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 _0x47f1=['/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','update','delete','destroy','removeResources','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections'];(function(_0x36f82a,_0x4ec395){var _0x495067=function(_0x2ede56){while(--_0x2ede56){_0x36f82a['push'](_0x36f82a['shift']());}};_0x495067(++_0x4ec395);}(_0x47f1,0xae));var _0x147f=function(_0x17138f,_0x399008){_0x17138f=_0x17138f-0x0;var _0x58ec0=_0x47f1[_0x17138f];return _0x58ec0;};'use strict';var multer=require('multer');var util=require(_0x147f('0x0'));var path=require('path');var timeout=require(_0x147f('0x1'));var express=require(_0x147f('0x2'));var router=express[_0x147f('0x3')]();var fs_extra=require(_0x147f('0x4'));var auth=require(_0x147f('0x5'));var interaction=require(_0x147f('0x6'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x147f('0x7')]('/',auth[_0x147f('0x8')](),controller[_0x147f('0x9')]);router[_0x147f('0x7')](_0x147f('0xa'),auth[_0x147f('0x8')](),controller['describe']);router[_0x147f('0x7')](_0x147f('0xb'),auth[_0x147f('0x8')](),controller[_0x147f('0xc')]);router[_0x147f('0x7')](_0x147f('0xd'),auth[_0x147f('0x8')](),controller[_0x147f('0xe')]);router['get'](_0x147f('0xf'),auth[_0x147f('0x8')](),controller[_0x147f('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x147f('0x11')]);router[_0x147f('0x12')](_0x147f('0x13'),auth[_0x147f('0x8')](),controller[_0x147f('0x14')]);router[_0x147f('0x12')]('/:id/sections',auth[_0x147f('0x8')](),controller[_0x147f('0x15')]);router['post'](_0x147f('0xf'),auth[_0x147f('0x8')](),controller[_0x147f('0x16')]);router['put'](_0x147f('0xb'),auth[_0x147f('0x8')](),controller[_0x147f('0x17')]);router[_0x147f('0x18')](_0x147f('0xb'),auth[_0x147f('0x8')](),controller[_0x147f('0x19')]);router['delete'](_0x147f('0xd'),auth['isAuthenticated'](),controller['removeSections']);router[_0x147f('0x18')](_0x147f('0xf'),auth[_0x147f('0x8')](),controller[_0x147f('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x655d=['show','getSections','/:id/resources','getResources','post','create','/:id/clone','/:id/sections','addResources','put','update','delete','destroy','removeSections','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x5a92ad,_0x2219a6){var _0x2466f8=function(_0x4ad04e){while(--_0x4ad04e){_0x5a92ad['push'](_0x5a92ad['shift']());}};_0x2466f8(++_0x2219a6);}(_0x655d,0x13b));var _0xd655=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x655d[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xd655('0x0'));var util=require(_0xd655('0x1'));var path=require(_0xd655('0x2'));var timeout=require(_0xd655('0x3'));var express=require(_0xd655('0x4'));var router=express[_0xd655('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd655('0x6'));var interaction=require(_0xd655('0x7'));var config=require('../../config/environment');var controller=require(_0xd655('0x8'));router['get']('/',auth[_0xd655('0x9')](),controller[_0xd655('0xa')]);router[_0xd655('0xb')](_0xd655('0xc'),auth[_0xd655('0x9')](),controller[_0xd655('0xd')]);router[_0xd655('0xb')](_0xd655('0xe'),auth[_0xd655('0x9')](),controller[_0xd655('0xf')]);router[_0xd655('0xb')]('/:id/sections',auth[_0xd655('0x9')](),controller[_0xd655('0x10')]);router[_0xd655('0xb')](_0xd655('0x11'),auth['isAuthenticated'](),controller[_0xd655('0x12')]);router[_0xd655('0x13')]('/',auth[_0xd655('0x9')](),controller[_0xd655('0x14')]);router[_0xd655('0x13')](_0xd655('0x15'),auth['isAuthenticated'](),controller['clone']);router['post'](_0xd655('0x16'),auth[_0xd655('0x9')](),controller['addSections']);router[_0xd655('0x13')]('/:id/resources',auth[_0xd655('0x9')](),controller[_0xd655('0x17')]);router[_0xd655('0x18')](_0xd655('0xe'),auth[_0xd655('0x9')](),controller[_0xd655('0x19')]);router[_0xd655('0x1a')]('/:id',auth[_0xd655('0x9')](),controller[_0xd655('0x1b')]);router[_0xd655('0x1a')](_0xd655('0x16'),auth[_0xd655('0x9')](),controller[_0xd655('0x1c')]);router['delete'](_0xd655('0x11'),auth[_0xd655('0x9')](),controller['removeResources']);module[_0xd655('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 649e5c7..941136e 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 _0x7b3f=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN'];(function(_0x5096bb,_0x5b728e){var _0x1a8092=function(_0x381e2e){while(--_0x381e2e){_0x5096bb['push'](_0x5096bb['shift']());}};_0x1a8092(++_0x5b728e);}(_0x7b3f,0x1f0));var _0xf7b3=function(_0x158208,_0x286b47){_0x158208=_0x158208-0x0;var _0x3cc831=_0x7b3f[_0x158208];return _0x3cc831;};'use strict';var Sequelize=require('sequelize');module[_0xf7b3('0x0')]={'name':{'type':Sequelize[_0xf7b3('0x1')],'allowNull':![],'unique':_0xf7b3('0x2')},'crudPermissions':{'type':Sequelize[_0xf7b3('0x1')],'set':function(_0x271208){this[_0xf7b3('0x3')](_0xf7b3('0x4'),_0x271208?_0x271208[_0xf7b3('0x5')](''):[]);},'get':function(){return this[_0xf7b3('0x6')](_0xf7b3('0x4'))?this['getDataValue'](_0xf7b3('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf7b3('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf7b3('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf7b3('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf7b3('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf7b3('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6e5e=['split','BOOLEAN','sequelize','exports','setDataValue','crudPermissions','join','getDataValue'];(function(_0x1195f4,_0x1750d1){var _0x400a33=function(_0x1fd0ed){while(--_0x1fd0ed){_0x1195f4['push'](_0x1195f4['shift']());}};_0x400a33(++_0x1750d1);}(_0x6e5e,0xca));var _0xe6e5=function(_0x5ee4f4,_0x58b6a3){_0x5ee4f4=_0x5ee4f4-0x0;var _0x18b866=_0x6e5e[_0x5ee4f4];return _0x18b866;};'use strict';var Sequelize=require(_0xe6e5('0x0'));module[_0xe6e5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5797bf){this[_0xe6e5('0x2')](_0xe6e5('0x3'),_0x5797bf?_0x5797bf[_0xe6e5('0x4')](''):[]);},'get':function(){return this[_0xe6e5('0x5')](_0xe6e5('0x3'))?this['getDataValue']('crudPermissions')[_0xe6e5('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xe6e5('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xe6e5('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe6e5('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xe6e5('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe6e5('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xe6e5('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe6e5('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index b608a9c..e4072af 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 _0x759b=['find','create','body','catch','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','userProfileId','Resources','UserProfileResource','describe','addSections','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./userProfile.socket','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','params','length','includeAll','options'];(function(_0x1c7feb,_0x57744f){var _0x377f87=function(_0x584b24){while(--_0x584b24){_0x1c7feb['push'](_0x1c7feb['shift']());}};_0x377f87(++_0x57744f);}(_0x759b,0x198));var _0xb759=function(_0x10d4b2,_0x52fb84){_0x10d4b2=_0x10d4b2-0x0;var _0x3fc805=_0x759b[_0x10d4b2];return _0x3fc805;};'use strict';var emlformat=require(_0xb759('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb759('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb759('0x2'));var moment=require(_0xb759('0x3'));var BPromise=require(_0xb759('0x4'));var Mustache=require(_0xb759('0x5'));var util=require(_0xb759('0x6'));var path=require(_0xb759('0x7'));var sox=require(_0xb759('0x8'));var csv=require(_0xb759('0x9'));var ejs=require(_0xb759('0xa'));var fs=require('fs');var fs_extra=require(_0xb759('0xb'));var _=require(_0xb759('0xc'));var squel=require(_0xb759('0xd'));var crypto=require(_0xb759('0xe'));var jsforce=require(_0xb759('0xf'));var deskjs=require(_0xb759('0x10'));var toCsv=require(_0xb759('0x9'));var querystring=require(_0xb759('0x11'));var Papa=require(_0xb759('0x12'));var Redis=require(_0xb759('0x13'));var authService=require(_0xb759('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb759('0x15'));var hardwareService=require(_0xb759('0x16'));var logger=require(_0xb759('0x17'))(_0xb759('0x18'));var utils=require(_0xb759('0x19'));var config=require(_0xb759('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb759('0x1b'))['db'];config['redis']=_[_0xb759('0x1c')](config[_0xb759('0x1d')],{'host':_0xb759('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb759('0x1d')]));require(_0xb759('0x1f'))['register'](socket);function respondWithStatusCode(_0x58704d,_0x5c5e43){_0x5c5e43=_0x5c5e43||0xcc;return function(_0x3258ca){if(_0x3258ca){return _0x58704d[_0xb759('0x20')](_0x5c5e43);}return _0x58704d[_0xb759('0x21')](_0x5c5e43)[_0xb759('0x22')]();};}function respondWithResult(_0x493017,_0x38636b){_0x38636b=_0x38636b||0xc8;return function(_0x493b65){if(_0x493b65){return _0x493017['status'](_0x38636b)[_0xb759('0x23')](_0x493b65);}};}function respondWithFilteredResult(_0x4e13d0,_0x165429){return function(_0x38ecb1){if(_0x38ecb1){var _0x1e917c=typeof _0x165429['offset']===_0xb759('0x24')&&typeof _0x165429['limit']===_0xb759('0x24');var _0x50e92d=_0x38ecb1[_0xb759('0x25')];var _0x587190=_0x1e917c?0x0:_0x165429['offset'];var _0x21916f=_0x1e917c?_0x38ecb1['count']:_0x165429[_0xb759('0x26')]+_0x165429[_0xb759('0x27')];var _0x244278;if(_0x21916f>=_0x50e92d){_0x21916f=_0x50e92d;_0x244278=0xc8;}else{_0x244278=0xce;}_0x4e13d0[_0xb759('0x21')](_0x244278);return _0x4e13d0[_0xb759('0x28')](_0xb759('0x29'),_0x587190+'-'+_0x21916f+'/'+_0x50e92d)[_0xb759('0x23')](_0x38ecb1);}return null;};}function patchUpdates(_0x136f89){return function(_0x457a8f){try{jsonpatch[_0xb759('0x2a')](_0x457a8f,_0x136f89,!![]);}catch(_0x251da6){return BPromise[_0xb759('0x2b')](_0x251da6);}return _0x457a8f[_0xb759('0x2c')]();};}function saveUpdates(_0x3499f7,_0x532804){return function(_0x202e9b){if(_0x202e9b){return _0x202e9b[_0xb759('0x2d')](_0x3499f7)['then'](function(_0x5d8522){return _0x5d8522;});}return null;};}function removeEntity(_0x1bb131,_0x257c15){return function(_0x19ea50){if(_0x19ea50){return _0x19ea50[_0xb759('0x2e')]()[_0xb759('0x2f')](function(){_0x1bb131[_0xb759('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5077a8,_0x5ad152){return function(_0x1fd2e6){if(!_0x1fd2e6){_0x5077a8['sendStatus'](0x194);}return _0x1fd2e6;};}function handleError(_0x495d80,_0x2ac51c){_0x2ac51c=_0x2ac51c||0x1f4;return function(_0x266bfd){logger[_0xb759('0x30')](_0x266bfd[_0xb759('0x31')]);if(_0x266bfd['name']){delete _0x266bfd[_0xb759('0x32')];}_0x495d80[_0xb759('0x21')](_0x2ac51c)[_0xb759('0x33')](_0x266bfd);};}exports[_0xb759('0x34')]=function(_0x39a39a,_0x165aed){var _0x267371={},_0x6ddf5c={},_0xa2bf24={'count':0x0,'rows':[]};var _0x1c1a44=_[_0xb759('0x35')](db[_0xb759('0x36')][_0xb759('0x37')],function(_0x414c13){return{'name':_0x414c13[_0xb759('0x38')],'type':_0x414c13[_0xb759('0x39')][_0xb759('0x3a')]};});_0x6ddf5c[_0xb759('0x3b')]=_[_0xb759('0x35')](_0x1c1a44,_0xb759('0x32'));_0x6ddf5c['query']=_[_0xb759('0x3c')](_0x39a39a['query']);_0x6ddf5c[_0xb759('0x3d')]=_['intersection'](_0x6ddf5c['model'],_0x6ddf5c[_0xb759('0x3e')]);_0x267371[_0xb759('0x3f')]=_[_0xb759('0x40')](_0x6ddf5c['model'],qs[_0xb759('0x41')](_0x39a39a[_0xb759('0x3e')][_0xb759('0x41')]));_0x267371['attributes']=_0x267371[_0xb759('0x3f')]['length']?_0x267371[_0xb759('0x3f')]:_0x6ddf5c[_0xb759('0x3b')];if(!_0x39a39a[_0xb759('0x3e')]['hasOwnProperty']('nolimit')){_0x267371[_0xb759('0x27')]=qs['limit'](_0x39a39a[_0xb759('0x3e')][_0xb759('0x27')]);_0x267371['offset']=qs[_0xb759('0x26')](_0x39a39a[_0xb759('0x3e')][_0xb759('0x26')]);}_0x267371['order']=qs[_0xb759('0x42')](_0x39a39a[_0xb759('0x3e')][_0xb759('0x42')]);_0x267371[_0xb759('0x43')]=qs[_0xb759('0x3d')](_[_0xb759('0x44')](_0x39a39a[_0xb759('0x3e')],_0x6ddf5c[_0xb759('0x3d')]),_0x1c1a44);if(_0x39a39a[_0xb759('0x3e')]['filter']){_0x267371[_0xb759('0x43')]=_[_0xb759('0x45')](_0x267371[_0xb759('0x43')],{'$or':_[_0xb759('0x35')](_0x1c1a44,function(_0x34c044){if(_0x34c044[_0xb759('0x39')]!==_0xb759('0x46')){var _0x6851ba={};_0x6851ba[_0x34c044[_0xb759('0x32')]]={'$like':'%'+_0x39a39a[_0xb759('0x3e')][_0xb759('0x47')]+'%'};return _0x6851ba;}})});}_0x267371=_[_0xb759('0x45')]({},_0x267371,_0x39a39a['options']);var _0x3482a4={'where':_0x267371[_0xb759('0x43')]};return db[_0xb759('0x36')][_0xb759('0x25')](_0x3482a4)['then'](function(_0x37d5d8){_0xa2bf24['count']=_0x37d5d8;if(_0x39a39a[_0xb759('0x3e')]['includeAll']){_0x267371[_0xb759('0x48')]=[{'all':!![]}];}return db[_0xb759('0x36')][_0xb759('0x49')](_0x267371);})[_0xb759('0x2f')](function(_0x14617c){_0xa2bf24[_0xb759('0x4a')]=_0x14617c;return _0xa2bf24;})['then'](respondWithFilteredResult(_0x165aed,_0x267371))['catch'](handleError(_0x165aed,null));};exports[_0xb759('0x4b')]=function(_0x30e54c,_0x522e29){var _0x5ea81c={'raw':![],'where':{'id':_0x30e54c[_0xb759('0x4c')]['id']}},_0x188ec5={};_0x188ec5[_0xb759('0x3b')]=_['keys'](db[_0xb759('0x36')]['rawAttributes']);_0x188ec5[_0xb759('0x3e')]=_['keys'](_0x30e54c['query']);_0x188ec5[_0xb759('0x3d')]=_[_0xb759('0x40')](_0x188ec5['model'],_0x188ec5[_0xb759('0x3e')]);_0x5ea81c['attributes']=_['intersection'](_0x188ec5[_0xb759('0x3b')],qs[_0xb759('0x41')](_0x30e54c[_0xb759('0x3e')][_0xb759('0x41')]));_0x5ea81c['attributes']=_0x5ea81c['attributes'][_0xb759('0x4d')]?_0x5ea81c[_0xb759('0x3f')]:_0x188ec5[_0xb759('0x3b')];if(_0x30e54c[_0xb759('0x3e')][_0xb759('0x4e')]){_0x5ea81c[_0xb759('0x48')]=[{'all':!![]}];}_0x5ea81c=_[_0xb759('0x45')]({},_0x5ea81c,_0x30e54c[_0xb759('0x4f')]);return db[_0xb759('0x36')][_0xb759('0x50')](_0x5ea81c)['then'](handleEntityNotFound(_0x522e29,null))['then'](respondWithResult(_0x522e29,null))['catch'](handleError(_0x522e29,null));};exports[_0xb759('0x51')]=function(_0x12e7a7,_0x3f1bcb){return db['UserProfile'][_0xb759('0x51')](_0x12e7a7[_0xb759('0x52')],{})[_0xb759('0x2f')](respondWithResult(_0x3f1bcb,0xc9))[_0xb759('0x53')](handleError(_0x3f1bcb,null));};exports[_0xb759('0x54')]=function(_0x3981d5,_0xf08bc5){var _0x3440ba={'where':{'id':_0x3981d5[_0xb759('0x4c')]['id']}},_0x23b797={};_0x23b797[_0xb759('0x3b')]=_[_0xb759('0x3c')](db[_0xb759('0x36')]['rawAttributes']);_0x3440ba['attributes']=_['intersection'](_0x23b797[_0xb759('0x3b')],qs[_0xb759('0x41')](_0x3981d5['query'][_0xb759('0x41')]));_0x3440ba['attributes']=_0x3440ba['attributes']['length']?_0x3440ba[_0xb759('0x3f')]:_0x23b797[_0xb759('0x3b')];if(_0x3981d5[_0xb759('0x3e')][_0xb759('0x4e')]){_0x3440ba[_0xb759('0x48')]=[{'all':!![]}];}_0x3440ba=_[_0xb759('0x45')]({},_0x3440ba,_0x3981d5[_0xb759('0x4f')]);return db[_0xb759('0x36')]['find'](_0x3440ba)[_0xb759('0x2f')](handleEntityNotFound(_0xf08bc5,null))[_0xb759('0x2f')](function(_0x5c4137){if(_0x5c4137){var _0x5ce6fa=_0x5c4137[_0xb759('0x55')]({'plain':!![]});_0x5ce6fa=qs[_0xb759('0x56')](_0x5ce6fa,['id',_0xb759('0x57'),_0xb759('0x58'),_0xb759('0x59')]);_0x3981d5[_0xb759('0x52')]=_[_0xb759('0x56')](_0x3981d5[_0xb759('0x52')],['id',_0xb759('0x57'),'updatedAt']);return db[_0xb759('0x5a')][_0xb759('0x5b')](function(_0x5e2826){return db['UserProfile'][_0xb759('0x51')](_[_0xb759('0x45')](_0x5ce6fa,_0x3981d5[_0xb759('0x52')]),{'include':_0x3981d5[_0xb759('0x3e')][_0xb759('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x5e2826})[_0xb759('0x2f')](function(_0x24ffc4){var _0x30d29c=_0x24ffc4[_0xb759('0x55')]({'plain':!![]});return db[_0xb759('0x5c')][_0xb759('0x49')]({'where':{'userProfileId':_0x3981d5[_0xb759('0x4c')]['id']},'raw':!![]})[_0xb759('0x2f')](function(_0xed2c90){if(_0xed2c90){return BPromise[_0xb759('0x5d')](_0xed2c90,function(_0x3121b6){return new BPromise(function(_0x5093c6,_0x40d2f7){if(_0x3121b6[_0xb759('0x5e')]===null||_0x3121b6[_0xb759('0x5e')]===0x1)_0x5093c6(null);return db['UserProfileResource'][_0xb759('0x49')]({'where':{'sectionId':_0x3121b6['id']},'raw':!![]})[_0xb759('0x2f')](function(_0x1ed7ba){var _0x43a3b7=_['map'](_0x1ed7ba,function(_0x2072a9){return qs[_0xb759('0x56')](_0x2072a9,['id',_0xb759('0x57'),'updatedAt','sectionId']);});_0x5093c6(_0x43a3b7);})['catch'](function(_0x102459){_0x40d2f7(_0x102459);});})[_0xb759('0x2f')](function(_0x187cb7){var _0x1efa78=qs[_0xb759('0x56')](_0x3121b6,['id',_0xb759('0x57'),_0xb759('0x58')]);_0x1efa78[_0xb759('0x5f')]=_0x30d29c['id'];if(_0x187cb7)_0x1efa78[_0xb759('0x60')]=_0x187cb7;return _0x1efa78;})['then'](function(_0x4e70c5){return db[_0xb759('0x5c')]['create'](_0x4e70c5,{'include':[{'model':db[_0xb759('0x61')],'as':_0xb759('0x60')}],'raw':!![],'transaction':_0x5e2826});});})[_0xb759('0x2f')](function(){return _0x30d29c;});}});});});}})[_0xb759('0x2f')](respondWithResult(_0xf08bc5,0xc9))[_0xb759('0x53')](handleError(_0xf08bc5,null));};exports[_0xb759('0x2d')]=function(_0x104f27,_0x20dc05){if(_0x104f27[_0xb759('0x52')]['id']){delete _0x104f27[_0xb759('0x52')]['id'];}return db[_0xb759('0x36')][_0xb759('0x50')]({'where':{'id':_0x104f27[_0xb759('0x4c')]['id']}})[_0xb759('0x2f')](handleEntityNotFound(_0x20dc05,null))[_0xb759('0x2f')](saveUpdates(_0x104f27[_0xb759('0x52')],null))['then'](respondWithResult(_0x20dc05,null))[_0xb759('0x53')](handleError(_0x20dc05,null));};exports[_0xb759('0x2e')]=function(_0x5d5e76,_0xd0e8d8){return db[_0xb759('0x36')][_0xb759('0x50')]({'where':{'id':_0x5d5e76['params']['id']}})[_0xb759('0x2f')](handleEntityNotFound(_0xd0e8d8,null))[_0xb759('0x2f')](removeEntity(_0xd0e8d8,null))['catch'](handleError(_0xd0e8d8,null));};exports[_0xb759('0x62')]=function(_0xfb0a45,_0x4d0794){return db[_0xb759('0x36')][_0xb759('0x62')]()[_0xb759('0x2f')](respondWithResult(_0x4d0794,null))[_0xb759('0x53')](handleError(_0x4d0794,null));};exports[_0xb759('0x63')]=function(_0x39e12e,_0x5191d5){var _0xc07761=_0x39e12e['body'];return db[_0xb759('0x36')]['find']({'where':{'id':_0x39e12e[_0xb759('0x4c')]['id']}})[_0xb759('0x2f')](handleEntityNotFound(_0x5191d5,null))[_0xb759('0x2f')](function(_0x270a26){if(_0x270a26){return db['sequelize'][_0xb759('0x5b')](function(_0x47b34f){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x39e12e[_0xb759('0x4c')]['id'],'sectionId':_['map'](_0xc07761,function(_0x2e8bf5){return _0x2e8bf5[_0xb759('0x64')];})},'transaction':_0x47b34f})['then'](function(){var _0x44f800=_['map'](_0xc07761,function(_0x575c24){_0x575c24['userProfileId']=_0x39e12e[_0xb759('0x4c')]['id'];return _0x575c24;});var _0x3a8dd4=[];return BPromise[_0xb759('0x5d')](_0x44f800,function(_0x3c8af4){return db['UserProfileSection'][_0xb759('0x51')](_0x3c8af4,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x47b34f})['then'](function(_0x12552d){_0x3a8dd4[_0xb759('0x65')](_0x12552d[_0xb759('0x55')]({'plain':!![]}));});})[_0xb759('0x2f')](function(){return _0x3a8dd4;});});});}})[_0xb759('0x2f')](function(_0x4b57b6){return _0x4b57b6;})[_0xb759('0x2f')](respondWithResult(_0x5191d5,null))[_0xb759('0x53')](handleError(_0x5191d5,null));};exports[_0xb759('0x66')]=function(_0x387818,_0xd46e99){var _0x10d03a;return db[_0xb759('0x36')][_0xb759('0x50')]({'where':{'id':_0x387818[_0xb759('0x4c')]['id']},'attributes':['id',_0xb759('0x32')]})[_0xb759('0x2f')](handleEntityNotFound(_0xd46e99,null))[_0xb759('0x2f')](function(_0x2ecce8){if(_0x2ecce8){_0x10d03a=_0x2ecce8;return db[_0xb759('0x5c')][_0xb759('0x2e')]({'where':{'userProfileId':_0x387818['params']['id'],'sectionId':_0x387818[_0xb759('0x3e')][_0xb759('0x67')]}});}})[_0xb759('0x2f')](function(){return _0x10d03a;})['then'](respondWithStatusCode(_0xd46e99,null))[_0xb759('0x53')](handleError(_0xd46e99,null));};exports[_0xb759('0x68')]=function(_0x5b18f0,_0x377bd2){var _0x47b9c3=[];var _0x1ea321=[];return db[_0xb759('0x5c')][_0xb759('0x49')]({'where':{'userProfileId':_0x5b18f0['params']['id']},'raw':!![]})[_0xb759('0x2f')](function(_0x4aa17f){_0x47b9c3=_[_0xb759('0x47')](_0x4aa17f,function(_0x4954b4){return _0x4954b4[_0xb759('0x69')]===0x1||_[_0xb759('0x6a')]([0x3eb,0x709],_0x4954b4[_0xb759('0x64')]);});if(!_[_0xb759('0x6b')](_0x47b9c3)){return _[_0xb759('0x35')](_0x47b9c3,function(_0xe83810){return _0xe83810[_0xb759('0x64')];});}else{return;}})[_0xb759('0x2f')](function(_0x13172d){if(_0x13172d)_0x1ea321=_0x13172d;if(_[_0xb759('0x6a')](_0x1ea321,0x64)){var _0x36d28d=_['find'](_0x47b9c3,{'sectionId':0x64});return hasDefaultDashboard(_0x36d28d)['then'](function(_0x56b04e){return _[_0xb759('0x35')](_0x47b9c3,function(_0x511ef9){if(_0x511ef9[_0xb759('0x64')]===0x64){_0x511ef9['subsections']=_0x56b04e;}return _0x511ef9;});});}else{return;}})[_0xb759('0x2f')](function(_0x5b095a){if(_0x5b095a)_0x47b9c3=_0x5b095a;if(_[_0xb759('0x6a')](_0x1ea321,0x3eb)){var _0x5d7d5a=_[_0xb759('0x50')](_0x47b9c3,{'sectionId':0x3eb});return getCustomDashboards(_0x5d7d5a)['then'](function(_0x581efd){return _[_0xb759('0x35')](_0x47b9c3,function(_0x32dc5c){if(_0x5d7d5a['enabled']){if(_0x32dc5c['sectionId']===0x3eb){_0x32dc5c[_0xb759('0x6c')]=_0x581efd;}}else{if(_0x32dc5c[_0xb759('0x64')]===0x64){if(!_0x32dc5c[_0xb759('0x6c')]){_0x32dc5c[_0xb759('0x6c')]=[];}_0x32dc5c[_0xb759('0x6c')]=_0x32dc5c['subsections'][_0xb759('0x6d')](_0x581efd);}}return _0x32dc5c;});});}else{return;}})[_0xb759('0x2f')](function(_0x1c7a59){if(_0x1c7a59)_0x47b9c3=_0x1c7a59;if(_[_0xb759('0x6a')](_0x1ea321,0x709)){var _0x13fadb=_[_0xb759('0x50')](_0x47b9c3,{'sectionId':0x709});return getPlugins(_0x13fadb)['then'](function(_0x133e35){if(_0x13fadb[_0xb759('0x69')]){return _['map'](_0x47b9c3,function(_0x493ab2){if(_0x493ab2[_0xb759('0x64')]===0x709){_0x493ab2[_0xb759('0x6c')]=_0x133e35;}return _0x493ab2;});}else{var _0x35f441={'sectionId':0x76c,'enabled':0x1,'subsections':_0x133e35};var _0x24e0b9=_[_0xb759('0x35')](_0x47b9c3);_0x24e0b9[_0xb759('0x65')](_0x35f441);return _0x24e0b9;}});}else{return;}})[_0xb759('0x2f')](function(_0x247d6d){if(_0x247d6d)_0x47b9c3=_0x247d6d;return _[_0xb759('0x47')](_0x47b9c3,[_0xb759('0x69'),0x1]);})[_0xb759('0x2f')](respondWithResult(_0x377bd2,null))[_0xb759('0x53')](handleError(_0x377bd2,null));};function hasDefaultDashboard(_0x42408d){var _0x214557=[0x65];return new BPromise(function(_0x4c0425,_0x464dd4){try{if(_0x42408d[_0xb759('0x5e')]){_0x4c0425(_0x214557);}else{return db[_0xb759('0x61')][_0xb759('0x6e')]({'where':{'sectionId':_0x42408d['id']},'raw':!![]})[_0xb759('0x2f')](function(_0x47a5f7){_0x47a5f7?_0x4c0425(_0x214557):_0x4c0425();});}}catch(_0x1887cd){_0x464dd4(_0x1887cd);}});}function getCustomDashboards(_0x3624e6){var _0xaca5e8=[];return new BPromise(function(_0x37077d,_0x4c258e){try{if(_0x3624e6[_0xb759('0x5e')]){return db[_0xb759('0x6f')]['findAll']({'raw':!![]})[_0xb759('0x2f')](function(_0x35cd54){_0x35cd54['forEach'](function(_0x1f61a3){_0xaca5e8[_0xb759('0x65')](_0x1f61a3['id']+0x1869f);});_0x37077d(_0xaca5e8);});}else{return db['UserProfileResource'][_0xb759('0x49')]({'where':{'sectionId':_0x3624e6['id']},'raw':!![]})['then'](function(_0xe303db){_0xe303db[_0xb759('0x70')](function(_0x1cb05e){_0xaca5e8['push'](_0x1cb05e[_0xb759('0x71')]+0x1869f);});_0x37077d(_0xaca5e8);});}}catch(_0x174048){_0x4c258e(_0x174048);}});}function getPlugins(_0x370fa0){var _0x22e1f3=[];return new BPromise(function(_0x4ed731,_0x328c70){try{if(_0x370fa0[_0xb759('0x5e')]){return db[_0xb759('0x72')][_0xb759('0x49')]({'raw':!![]})[_0xb759('0x2f')](function(_0x50432a){_0x50432a[_0xb759('0x70')](function(_0x1fd1a6){_0x22e1f3['push'](_0x1fd1a6['id']+0x15b38);});_0x4ed731(_0x22e1f3);});}else{return db[_0xb759('0x61')][_0xb759('0x49')]({'where':{'sectionId':_0x370fa0['id']},'raw':!![]})['then'](function(_0x504b8d){_0x504b8d[_0xb759('0x70')](function(_0x941fef){_0x22e1f3[_0xb759('0x65')](_0x941fef[_0xb759('0x71')]+0x15b38);});_0x4ed731(_0x22e1f3);});}}catch(_0x2931e4){_0x328c70(_0x2931e4);}});}exports['addResources']=function(_0x50e2dc,_0x3944ba){return db[_0xb759('0x36')]['find']({'where':{'id':_0x50e2dc[_0xb759('0x4c')]['id']}})[_0xb759('0x2f')](handleEntityNotFound(_0x3944ba,null))[_0xb759('0x2f')](function(_0x2bd3bf){if(_0x2bd3bf){return db[_0xb759('0x5a')][_0xb759('0x5b')](function(_0x3fe0e1){return db[_0xb759('0x5c')]['findAll']({'where':{'userProfileId':_0x50e2dc[_0xb759('0x4c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xe90b25){if(_0xe90b25){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x50e2dc['params']['id'],'id':_[_0xb759('0x35')](_0xe90b25,function(_0x421b62){return _0x421b62['id'];})},'transaction':_0x3fe0e1});}})['then'](function(_0x5046a5){var _0x506783=_[_0xb759('0x35')](_0x50e2dc['body'],function(_0x2915d1){_0x2915d1[_0xb759('0x5f')]=_0x50e2dc['params']['id'];return _0x2915d1;});return db[_0xb759('0x5c')]['bulkCreate'](_0x506783,{'raw':!![],'transaction':_0x3fe0e1});})[_0xb759('0x2f')](function(_0x38a9e9){var _0x165afa=_['filter'](_[_0xb759('0x35')](_0x38a9e9,function(_0x2fafe0){return _0x2fafe0[_0xb759('0x55')]({'plain':!![]});}),{'includeAll':![]});if(_0x165afa){return db[_0xb759('0x5c')][_0xb759('0x49')]({'where':{'userProfileId':_0x50e2dc['params']['id'],'sectionId':_['map'](_0x165afa,function(_0x155a30){return _0x155a30['sectionId'];})},'attributes':['id',_0xb759('0x64')],'raw':!![]})['then'](function(_0x5945fc){var _0x6fd0cf=_[_0xb759('0x35')](_0x50e2dc['body'],function(_0x120e9f){_0x120e9f[_0xb759('0x5f')]=_0x50e2dc['params']['id'];return _0x120e9f;});return db[_0xb759('0x61')][_0xb759('0x73')](_0x6fd0cf,{'raw':!![],'transaction':_0x3fe0e1});});}})[_0xb759('0x53')](handleError(_0x3944ba,null));});}})[_0xb759('0x2f')](function(_0x259313){var _0x2246ca=_[_0xb759('0x35')](_0x259313,function(_0x32fff8){return _0x32fff8[_0xb759('0x55')]({'plain':!![]});});})[_0xb759('0x2f')](respondWithResult(_0x3944ba,null))[_0xb759('0x53')](handleError(_0x3944ba,null));};exports[_0xb759('0x74')]=function(_0x6f0416,_0x378ffe,_0x4a2372){return db['UserProfile'][_0xb759('0x50')]({'where':{'id':_0x6f0416['params']['id']}})[_0xb759('0x2f')](handleEntityNotFound(_0x378ffe,null))[_0xb759('0x2f')](function(_0x4fa53f){if(_0x4fa53f){return _0x4fa53f['removeResources'](_0x6f0416[_0xb759('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x378ffe,null))[_0xb759('0x53')](handleError(_0x378ffe,null));};exports[_0xb759('0x75')]=function(_0x26050a,_0x5c6198){var _0x3c4c52={};if(!_0x26050a['query'][_0xb759('0x76')])throw new Error(_0xb759('0x77'));if(!_0x26050a[_0xb759('0x3e')][_0xb759('0x78')]('nolimit')){_0x3c4c52[_0xb759('0x27')]=qs['limit'](_0x26050a[_0xb759('0x3e')][_0xb759('0x27')]);_0x3c4c52[_0xb759('0x26')]=qs[_0xb759('0x26')](_0x26050a[_0xb759('0x3e')][_0xb759('0x26')]);}return db[_0xb759('0x36')]['find']({'where':{'id':_0x26050a[_0xb759('0x4c')]['id']}})[_0xb759('0x2f')](function(_0x3fb734){if(!_0x3fb734)throw new Error(_0xb759('0x79')+_0x26050a[_0xb759('0x4c')]['id']);return db[_0xb759('0x36')][_0xb759('0x75')](_0x26050a);})[_0xb759('0x2f')](respondWithFilteredResult(_0x5c6198,_0x3c4c52))[_0xb759('0x53')](handleError(_0x5c6198,null));}; \ No newline at end of file +var _0x0fcf=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','UserProfileResource','sectionId','Resources','update','describe','userProfileId','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','autoAssociation','Dashboard','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3b8d0f,_0x8545c0){var _0xc167c0=function(_0x8da2c5){while(--_0x8da2c5){_0x3b8d0f['push'](_0x3b8d0f['shift']());}};_0xc167c0(++_0x8545c0);}(_0x0fcf,0xdb));var _0xf0fc=function(_0x20151a,_0x165aee){_0x20151a=_0x20151a-0x0;var _0x174b1e=_0x0fcf[_0x20151a];return _0x174b1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0fc('0x0'));var jsonpatch=require(_0xf0fc('0x1'));var rp=require(_0xf0fc('0x2'));var moment=require(_0xf0fc('0x3'));var BPromise=require(_0xf0fc('0x4'));var Mustache=require('mustache');var util=require(_0xf0fc('0x5'));var path=require(_0xf0fc('0x6'));var sox=require(_0xf0fc('0x7'));var csv=require('to-csv');var ejs=require(_0xf0fc('0x8'));var fs=require('fs');var fs_extra=require(_0xf0fc('0x9'));var _=require(_0xf0fc('0xa'));var squel=require(_0xf0fc('0xb'));var crypto=require(_0xf0fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf0fc('0xd'));var toCsv=require(_0xf0fc('0xe'));var querystring=require(_0xf0fc('0xf'));var Papa=require(_0xf0fc('0x10'));var Redis=require(_0xf0fc('0x11'));var authService=require(_0xf0fc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf0fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0fc('0x14'))(_0xf0fc('0x15'));var utils=require(_0xf0fc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf0fc('0x17'));var db=require(_0xf0fc('0x18'))['db'];config[_0xf0fc('0x19')]=_[_0xf0fc('0x1a')](config['redis'],{'host':_0xf0fc('0x1b'),'port':0x18eb});var socket=require(_0xf0fc('0x1c'))(new Redis(config[_0xf0fc('0x19')]));require(_0xf0fc('0x1d'))[_0xf0fc('0x1e')](socket);function respondWithStatusCode(_0x955f62,_0x30f671){_0x30f671=_0x30f671||0xcc;return function(_0x222a9a){if(_0x222a9a){return _0x955f62[_0xf0fc('0x1f')](_0x30f671);}return _0x955f62[_0xf0fc('0x20')](_0x30f671)[_0xf0fc('0x21')]();};}function respondWithResult(_0x564f4d,_0x167d6c){_0x167d6c=_0x167d6c||0xc8;return function(_0x3170ad){if(_0x3170ad){return _0x564f4d[_0xf0fc('0x20')](_0x167d6c)[_0xf0fc('0x22')](_0x3170ad);}};}function respondWithFilteredResult(_0x5871bb,_0x42501d){return function(_0xb462c){if(_0xb462c){var _0x5bd474=typeof _0x42501d[_0xf0fc('0x23')]===_0xf0fc('0x24')&&typeof _0x42501d[_0xf0fc('0x25')]===_0xf0fc('0x24');var _0x55dc6c=_0xb462c['count'];var _0x33dd25=_0x5bd474?0x0:_0x42501d['offset'];var _0x2e98b9=_0x5bd474?_0xb462c['count']:_0x42501d[_0xf0fc('0x23')]+_0x42501d[_0xf0fc('0x25')];var _0x9f559a;if(_0x2e98b9>=_0x55dc6c){_0x2e98b9=_0x55dc6c;_0x9f559a=0xc8;}else{_0x9f559a=0xce;}_0x5871bb['status'](_0x9f559a);return _0x5871bb[_0xf0fc('0x26')]('Content-Range',_0x33dd25+'-'+_0x2e98b9+'/'+_0x55dc6c)[_0xf0fc('0x22')](_0xb462c);}return null;};}function patchUpdates(_0x340e77){return function(_0x114f41){try{jsonpatch['apply'](_0x114f41,_0x340e77,!![]);}catch(_0x1939d7){return BPromise[_0xf0fc('0x27')](_0x1939d7);}return _0x114f41[_0xf0fc('0x28')]();};}function saveUpdates(_0x31feae,_0x2fadfb){return function(_0x1549d6){if(_0x1549d6){return _0x1549d6['update'](_0x31feae)[_0xf0fc('0x29')](function(_0x2d1508){return _0x2d1508;});}return null;};}function removeEntity(_0x5b6bdb,_0x5a6ffb){return function(_0x2bfaf9){if(_0x2bfaf9){return _0x2bfaf9[_0xf0fc('0x2a')]()['then'](function(){_0x5b6bdb['status'](0xcc)[_0xf0fc('0x21')]();});}};}function handleEntityNotFound(_0x18485c,_0x189bd4){return function(_0x5a2465){if(!_0x5a2465){_0x18485c[_0xf0fc('0x1f')](0x194);}return _0x5a2465;};}function handleError(_0x58bacc,_0x129ca5){_0x129ca5=_0x129ca5||0x1f4;return function(_0x4489f9){logger[_0xf0fc('0x2b')](_0x4489f9[_0xf0fc('0x2c')]);if(_0x4489f9[_0xf0fc('0x2d')]){delete _0x4489f9[_0xf0fc('0x2d')];}_0x58bacc[_0xf0fc('0x20')](_0x129ca5)[_0xf0fc('0x2e')](_0x4489f9);};}exports[_0xf0fc('0x2f')]=function(_0x232fe4,_0x23434e){var _0x224df4={},_0x2d46d3={},_0x39f1cf={'count':0x0,'rows':[]};var _0x5e0005=_[_0xf0fc('0x30')](db[_0xf0fc('0x31')][_0xf0fc('0x32')],function(_0x6afd5a){return{'name':_0x6afd5a['fieldName'],'type':_0x6afd5a[_0xf0fc('0x33')][_0xf0fc('0x34')]};});_0x2d46d3[_0xf0fc('0x35')]=_['map'](_0x5e0005,_0xf0fc('0x2d'));_0x2d46d3['query']=_[_0xf0fc('0x36')](_0x232fe4['query']);_0x2d46d3[_0xf0fc('0x37')]=_[_0xf0fc('0x38')](_0x2d46d3[_0xf0fc('0x35')],_0x2d46d3[_0xf0fc('0x39')]);_0x224df4[_0xf0fc('0x3a')]=_[_0xf0fc('0x38')](_0x2d46d3['model'],qs[_0xf0fc('0x3b')](_0x232fe4[_0xf0fc('0x39')][_0xf0fc('0x3b')]));_0x224df4[_0xf0fc('0x3a')]=_0x224df4[_0xf0fc('0x3a')][_0xf0fc('0x3c')]?_0x224df4['attributes']:_0x2d46d3[_0xf0fc('0x35')];if(!_0x232fe4[_0xf0fc('0x39')][_0xf0fc('0x3d')](_0xf0fc('0x3e'))){_0x224df4[_0xf0fc('0x25')]=qs[_0xf0fc('0x25')](_0x232fe4[_0xf0fc('0x39')]['limit']);_0x224df4[_0xf0fc('0x23')]=qs[_0xf0fc('0x23')](_0x232fe4['query']['offset']);}_0x224df4['order']=qs['sort'](_0x232fe4[_0xf0fc('0x39')][_0xf0fc('0x3f')]);_0x224df4[_0xf0fc('0x40')]=qs['filters'](_[_0xf0fc('0x41')](_0x232fe4[_0xf0fc('0x39')],_0x2d46d3['filters']),_0x5e0005);if(_0x232fe4[_0xf0fc('0x39')][_0xf0fc('0x42')]){_0x224df4[_0xf0fc('0x40')]=_[_0xf0fc('0x43')](_0x224df4[_0xf0fc('0x40')],{'$or':_[_0xf0fc('0x30')](_0x5e0005,function(_0x1b870d){if(_0x1b870d[_0xf0fc('0x33')]!==_0xf0fc('0x44')){var _0x80cb2c={};_0x80cb2c[_0x1b870d['name']]={'$like':'%'+_0x232fe4[_0xf0fc('0x39')][_0xf0fc('0x42')]+'%'};return _0x80cb2c;}})});}_0x224df4=_[_0xf0fc('0x43')]({},_0x224df4,_0x232fe4[_0xf0fc('0x45')]);var _0xffd5bf={'where':_0x224df4[_0xf0fc('0x40')]};return db['UserProfile'][_0xf0fc('0x46')](_0xffd5bf)[_0xf0fc('0x29')](function(_0x5c2beb){_0x39f1cf[_0xf0fc('0x46')]=_0x5c2beb;if(_0x232fe4['query'][_0xf0fc('0x47')]){_0x224df4[_0xf0fc('0x48')]=[{'all':!![]}];}return db['UserProfile'][_0xf0fc('0x49')](_0x224df4);})[_0xf0fc('0x29')](function(_0xeaa1d4){_0x39f1cf[_0xf0fc('0x4a')]=_0xeaa1d4;return _0x39f1cf;})[_0xf0fc('0x29')](respondWithFilteredResult(_0x23434e,_0x224df4))['catch'](handleError(_0x23434e,null));};exports[_0xf0fc('0x4b')]=function(_0x418798,_0x32d8cf){var _0x1ad8ee={'raw':![],'where':{'id':_0x418798[_0xf0fc('0x4c')]['id']}},_0x5f291c={};_0x5f291c[_0xf0fc('0x35')]=_['keys'](db[_0xf0fc('0x31')][_0xf0fc('0x32')]);_0x5f291c[_0xf0fc('0x39')]=_[_0xf0fc('0x36')](_0x418798[_0xf0fc('0x39')]);_0x5f291c[_0xf0fc('0x37')]=_[_0xf0fc('0x38')](_0x5f291c[_0xf0fc('0x35')],_0x5f291c['query']);_0x1ad8ee[_0xf0fc('0x3a')]=_[_0xf0fc('0x38')](_0x5f291c[_0xf0fc('0x35')],qs['fields'](_0x418798[_0xf0fc('0x39')][_0xf0fc('0x3b')]));_0x1ad8ee[_0xf0fc('0x3a')]=_0x1ad8ee[_0xf0fc('0x3a')][_0xf0fc('0x3c')]?_0x1ad8ee[_0xf0fc('0x3a')]:_0x5f291c[_0xf0fc('0x35')];if(_0x418798[_0xf0fc('0x39')]['includeAll']){_0x1ad8ee[_0xf0fc('0x48')]=[{'all':!![]}];}_0x1ad8ee=_[_0xf0fc('0x43')]({},_0x1ad8ee,_0x418798[_0xf0fc('0x45')]);return db[_0xf0fc('0x31')]['find'](_0x1ad8ee)[_0xf0fc('0x29')](handleEntityNotFound(_0x32d8cf,null))['then'](respondWithResult(_0x32d8cf,null))[_0xf0fc('0x4d')](handleError(_0x32d8cf,null));};exports[_0xf0fc('0x4e')]=function(_0x1367f1,_0x433ee6){return db[_0xf0fc('0x31')][_0xf0fc('0x4e')](_0x1367f1[_0xf0fc('0x4f')],{})['then'](respondWithResult(_0x433ee6,0xc9))[_0xf0fc('0x4d')](handleError(_0x433ee6,null));};exports[_0xf0fc('0x50')]=function(_0x5341ad,_0x140597){var _0x1f24f9={'where':{'id':_0x5341ad[_0xf0fc('0x4c')]['id']}},_0x1125d2={};_0x1125d2['model']=_['keys'](db[_0xf0fc('0x31')][_0xf0fc('0x32')]);_0x1f24f9[_0xf0fc('0x3a')]=_['intersection'](_0x1125d2['model'],qs[_0xf0fc('0x3b')](_0x5341ad[_0xf0fc('0x39')][_0xf0fc('0x3b')]));_0x1f24f9[_0xf0fc('0x3a')]=_0x1f24f9[_0xf0fc('0x3a')]['length']?_0x1f24f9[_0xf0fc('0x3a')]:_0x1125d2['model'];if(_0x5341ad['query'][_0xf0fc('0x47')]){_0x1f24f9[_0xf0fc('0x48')]=[{'all':!![]}];}_0x1f24f9=_[_0xf0fc('0x43')]({},_0x1f24f9,_0x5341ad[_0xf0fc('0x45')]);return db['UserProfile'][_0xf0fc('0x51')](_0x1f24f9)[_0xf0fc('0x29')](handleEntityNotFound(_0x140597,null))[_0xf0fc('0x29')](function(_0x16c4dc){if(_0x16c4dc){var _0x3c3600=_0x16c4dc[_0xf0fc('0x52')]({'plain':!![]});_0x3c3600=qs[_0xf0fc('0x53')](_0x3c3600,['id',_0xf0fc('0x54'),_0xf0fc('0x55'),_0xf0fc('0x56')]);_0x5341ad[_0xf0fc('0x4f')]=_['omit'](_0x5341ad[_0xf0fc('0x4f')],['id',_0xf0fc('0x54'),_0xf0fc('0x55')]);return db[_0xf0fc('0x57')][_0xf0fc('0x58')](function(_0x306c19){return db[_0xf0fc('0x31')][_0xf0fc('0x4e')](_['merge'](_0x3c3600,_0x5341ad[_0xf0fc('0x4f')]),{'include':_0x5341ad['query'][_0xf0fc('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x306c19})[_0xf0fc('0x29')](function(_0x1f7566){var _0x48c11a=_0x1f7566['get']({'plain':!![]});return db[_0xf0fc('0x59')][_0xf0fc('0x49')]({'where':{'userProfileId':_0x5341ad[_0xf0fc('0x4c')]['id']},'raw':!![]})['then'](function(_0x17bd28){if(_0x17bd28){return BPromise[_0xf0fc('0x5a')](_0x17bd28,function(_0x3be9d7){return new BPromise(function(_0x8316a8,_0x3c4d09){if(_0x3be9d7['autoAssociation']===null||_0x3be9d7['autoAssociation']===0x1)_0x8316a8(null);return db[_0xf0fc('0x5b')]['findAll']({'where':{'sectionId':_0x3be9d7['id']},'raw':!![]})[_0xf0fc('0x29')](function(_0x166935){var _0x5a0b5e=_[_0xf0fc('0x30')](_0x166935,function(_0x494b85){return qs[_0xf0fc('0x53')](_0x494b85,['id','createdAt','updatedAt',_0xf0fc('0x5c')]);});_0x8316a8(_0x5a0b5e);})[_0xf0fc('0x4d')](function(_0x1f5985){_0x3c4d09(_0x1f5985);});})[_0xf0fc('0x29')](function(_0x9cd7f0){var _0x2aab21=qs[_0xf0fc('0x53')](_0x3be9d7,['id',_0xf0fc('0x54'),_0xf0fc('0x55')]);_0x2aab21['userProfileId']=_0x48c11a['id'];if(_0x9cd7f0)_0x2aab21['Resources']=_0x9cd7f0;return _0x2aab21;})['then'](function(_0x1f78d8){return db[_0xf0fc('0x59')]['create'](_0x1f78d8,{'include':[{'model':db[_0xf0fc('0x5b')],'as':_0xf0fc('0x5d')}],'raw':!![],'transaction':_0x306c19});});})[_0xf0fc('0x29')](function(){return _0x48c11a;});}});});});}})[_0xf0fc('0x29')](respondWithResult(_0x140597,0xc9))['catch'](handleError(_0x140597,null));};exports[_0xf0fc('0x5e')]=function(_0xa951c3,_0x42a96f){if(_0xa951c3[_0xf0fc('0x4f')]['id']){delete _0xa951c3[_0xf0fc('0x4f')]['id'];}return db[_0xf0fc('0x31')][_0xf0fc('0x51')]({'where':{'id':_0xa951c3[_0xf0fc('0x4c')]['id']}})[_0xf0fc('0x29')](handleEntityNotFound(_0x42a96f,null))['then'](saveUpdates(_0xa951c3[_0xf0fc('0x4f')],null))['then'](respondWithResult(_0x42a96f,null))[_0xf0fc('0x4d')](handleError(_0x42a96f,null));};exports[_0xf0fc('0x2a')]=function(_0xbbad,_0x4821e1){return db[_0xf0fc('0x31')]['find']({'where':{'id':_0xbbad[_0xf0fc('0x4c')]['id']}})[_0xf0fc('0x29')](handleEntityNotFound(_0x4821e1,null))['then'](removeEntity(_0x4821e1,null))[_0xf0fc('0x4d')](handleError(_0x4821e1,null));};exports['describe']=function(_0x2d42a4,_0x4a21bf){return db[_0xf0fc('0x31')][_0xf0fc('0x5f')]()[_0xf0fc('0x29')](respondWithResult(_0x4a21bf,null))['catch'](handleError(_0x4a21bf,null));};exports['addSections']=function(_0x461f13,_0x4f35ec){var _0x21e5ed=_0x461f13['body'];return db[_0xf0fc('0x31')][_0xf0fc('0x51')]({'where':{'id':_0x461f13[_0xf0fc('0x4c')]['id']}})[_0xf0fc('0x29')](handleEntityNotFound(_0x4f35ec,null))[_0xf0fc('0x29')](function(_0x171197){if(_0x171197){return db[_0xf0fc('0x57')][_0xf0fc('0x58')](function(_0x39c6bd){return db['UserProfileSection'][_0xf0fc('0x2a')]({'where':{'userProfileId':_0x461f13[_0xf0fc('0x4c')]['id'],'sectionId':_['map'](_0x21e5ed,function(_0x5a5690){return _0x5a5690['sectionId'];})},'transaction':_0x39c6bd})[_0xf0fc('0x29')](function(){var _0x370254=_[_0xf0fc('0x30')](_0x21e5ed,function(_0x1992e7){_0x1992e7[_0xf0fc('0x60')]=_0x461f13[_0xf0fc('0x4c')]['id'];return _0x1992e7;});var _0x506832=[];return BPromise['each'](_0x370254,function(_0x168653){return db[_0xf0fc('0x59')][_0xf0fc('0x4e')](_0x168653,{'include':[{'model':db['UserProfileResource'],'as':_0xf0fc('0x5d')}],'raw':!![],'transaction':_0x39c6bd})[_0xf0fc('0x29')](function(_0x40dc89){_0x506832[_0xf0fc('0x61')](_0x40dc89[_0xf0fc('0x52')]({'plain':!![]}));});})[_0xf0fc('0x29')](function(){return _0x506832;});});});}})[_0xf0fc('0x29')](function(_0x5cafb8){return _0x5cafb8;})[_0xf0fc('0x29')](respondWithResult(_0x4f35ec,null))[_0xf0fc('0x4d')](handleError(_0x4f35ec,null));};exports[_0xf0fc('0x62')]=function(_0x50da94,_0x34495a){var _0x5c8fe7;return db[_0xf0fc('0x31')][_0xf0fc('0x51')]({'where':{'id':_0x50da94['params']['id']},'attributes':['id','name']})[_0xf0fc('0x29')](handleEntityNotFound(_0x34495a,null))[_0xf0fc('0x29')](function(_0x5bce9e){if(_0x5bce9e){_0x5c8fe7=_0x5bce9e;return db['UserProfileSection'][_0xf0fc('0x2a')]({'where':{'userProfileId':_0x50da94[_0xf0fc('0x4c')]['id'],'sectionId':_0x50da94[_0xf0fc('0x39')][_0xf0fc('0x63')]}});}})['then'](function(){return _0x5c8fe7;})[_0xf0fc('0x29')](respondWithStatusCode(_0x34495a,null))[_0xf0fc('0x4d')](handleError(_0x34495a,null));};exports['getSections']=function(_0x3edd4e,_0x41ae74){var _0x253be4=[];var _0x1503a5=[];return db[_0xf0fc('0x59')]['findAll']({'where':{'userProfileId':_0x3edd4e[_0xf0fc('0x4c')]['id']},'raw':!![]})['then'](function(_0x1fe929){_0x253be4=_[_0xf0fc('0x42')](_0x1fe929,function(_0x3091aa){return _0x3091aa[_0xf0fc('0x64')]===0x1||_[_0xf0fc('0x65')]([0x3eb,0x709],_0x3091aa[_0xf0fc('0x5c')]);});if(!_[_0xf0fc('0x66')](_0x253be4)){return _[_0xf0fc('0x30')](_0x253be4,function(_0x52d44f){return _0x52d44f['sectionId'];});}else{return;}})[_0xf0fc('0x29')](function(_0x3e0bd6){if(_0x3e0bd6)_0x1503a5=_0x3e0bd6;if(_[_0xf0fc('0x65')](_0x1503a5,0x64)){var _0x51d964=_['find'](_0x253be4,{'sectionId':0x64});return hasDefaultDashboard(_0x51d964)[_0xf0fc('0x29')](function(_0x45e92a){return _[_0xf0fc('0x30')](_0x253be4,function(_0xb803d5){if(_0xb803d5[_0xf0fc('0x5c')]===0x64){_0xb803d5[_0xf0fc('0x67')]=_0x45e92a;}return _0xb803d5;});});}else{return;}})['then'](function(_0x41ba76){if(_0x41ba76)_0x253be4=_0x41ba76;if(_[_0xf0fc('0x65')](_0x1503a5,0x3eb)){var _0x473afb=_['find'](_0x253be4,{'sectionId':0x3eb});return getCustomDashboards(_0x473afb)[_0xf0fc('0x29')](function(_0x4938d3){return _[_0xf0fc('0x30')](_0x253be4,function(_0x156bac){if(_0x473afb['enabled']){if(_0x156bac[_0xf0fc('0x5c')]===0x3eb){_0x156bac[_0xf0fc('0x67')]=_0x4938d3;}}else{if(_0x156bac[_0xf0fc('0x5c')]===0x64){if(!_0x156bac['subsections']){_0x156bac[_0xf0fc('0x67')]=[];}_0x156bac[_0xf0fc('0x67')]=_0x156bac['subsections'][_0xf0fc('0x68')](_0x4938d3);}}return _0x156bac;});});}else{return;}})[_0xf0fc('0x29')](function(_0x516110){if(_0x516110)_0x253be4=_0x516110;if(_[_0xf0fc('0x65')](_0x1503a5,0x709)){var _0x2e1802=_[_0xf0fc('0x51')](_0x253be4,{'sectionId':0x709});return getPlugins(_0x2e1802)[_0xf0fc('0x29')](function(_0x51a82c){if(_0x2e1802[_0xf0fc('0x64')]){return _['map'](_0x253be4,function(_0x1eae9d){if(_0x1eae9d[_0xf0fc('0x5c')]===0x709){_0x1eae9d[_0xf0fc('0x67')]=_0x51a82c;}return _0x1eae9d;});}else{var _0xe95e4b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x51a82c};var _0x8b7fdf=_[_0xf0fc('0x30')](_0x253be4);_0x8b7fdf[_0xf0fc('0x61')](_0xe95e4b);return _0x8b7fdf;}});}else{return;}})[_0xf0fc('0x29')](function(_0x347944){if(_0x347944)_0x253be4=_0x347944;return _['filter'](_0x253be4,[_0xf0fc('0x64'),0x1]);})[_0xf0fc('0x29')](respondWithResult(_0x41ae74,null))[_0xf0fc('0x4d')](handleError(_0x41ae74,null));};function hasDefaultDashboard(_0x2b833f){var _0x31ca7c=[0x65];return new BPromise(function(_0x57472d,_0x23ef1f){try{if(_0x2b833f['autoAssociation']){_0x57472d(_0x31ca7c);}else{return db[_0xf0fc('0x5b')]['findOne']({'where':{'sectionId':_0x2b833f['id']},'raw':!![]})[_0xf0fc('0x29')](function(_0x286474){_0x286474?_0x57472d(_0x31ca7c):_0x57472d();});}}catch(_0x2879e1){_0x23ef1f(_0x2879e1);}});}function getCustomDashboards(_0x54288e){var _0x1ce4e1=[];return new BPromise(function(_0x49b3da,_0x2ae10c){try{if(_0x54288e[_0xf0fc('0x69')]){return db[_0xf0fc('0x6a')][_0xf0fc('0x49')]({'raw':!![]})['then'](function(_0xe1010f){_0xe1010f['forEach'](function(_0xd684d){_0x1ce4e1[_0xf0fc('0x61')](_0xd684d['id']+0x1869f);});_0x49b3da(_0x1ce4e1);});}else{return db[_0xf0fc('0x5b')]['findAll']({'where':{'sectionId':_0x54288e['id']},'raw':!![]})[_0xf0fc('0x29')](function(_0x57b088){_0x57b088[_0xf0fc('0x6b')](function(_0x5c8e56){_0x1ce4e1['push'](_0x5c8e56['resourceId']+0x1869f);});_0x49b3da(_0x1ce4e1);});}}catch(_0x1dbe52){_0x2ae10c(_0x1dbe52);}});}function getPlugins(_0x2cf611){var _0x2e5aa1=[];return new BPromise(function(_0x51ea73,_0x270661){try{if(_0x2cf611[_0xf0fc('0x69')]){return db[_0xf0fc('0x6c')]['findAll']({'raw':!![]})['then'](function(_0x53c936){_0x53c936[_0xf0fc('0x6b')](function(_0x1290b8){_0x2e5aa1[_0xf0fc('0x61')](_0x1290b8['id']+0x15b38);});_0x51ea73(_0x2e5aa1);});}else{return db[_0xf0fc('0x5b')][_0xf0fc('0x49')]({'where':{'sectionId':_0x2cf611['id']},'raw':!![]})[_0xf0fc('0x29')](function(_0x55c118){_0x55c118[_0xf0fc('0x6b')](function(_0xe01592){_0x2e5aa1[_0xf0fc('0x61')](_0xe01592[_0xf0fc('0x6d')]+0x15b38);});_0x51ea73(_0x2e5aa1);});}}catch(_0x52ec20){_0x270661(_0x52ec20);}});}exports['addResources']=function(_0x551138,_0x5e625d){return db[_0xf0fc('0x31')][_0xf0fc('0x51')]({'where':{'id':_0x551138['params']['id']}})['then'](handleEntityNotFound(_0x5e625d,null))[_0xf0fc('0x29')](function(_0x5f27d2){if(_0x5f27d2){return db[_0xf0fc('0x57')][_0xf0fc('0x58')](function(_0x2038c8){return db[_0xf0fc('0x59')][_0xf0fc('0x49')]({'where':{'userProfileId':_0x551138[_0xf0fc('0x4c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x10be82){if(_0x10be82){return db[_0xf0fc('0x59')][_0xf0fc('0x2a')]({'where':{'userProfileId':_0x551138[_0xf0fc('0x4c')]['id'],'id':_[_0xf0fc('0x30')](_0x10be82,function(_0x2532eb){return _0x2532eb['id'];})},'transaction':_0x2038c8});}})[_0xf0fc('0x29')](function(_0x181ec9){var _0x3a9921=_['map'](_0x551138[_0xf0fc('0x4f')],function(_0x4a6c51){_0x4a6c51[_0xf0fc('0x60')]=_0x551138['params']['id'];return _0x4a6c51;});return db['UserProfileSection'][_0xf0fc('0x6e')](_0x3a9921,{'raw':!![],'transaction':_0x2038c8});})[_0xf0fc('0x29')](function(_0x3debfb){var _0x2e2265=_[_0xf0fc('0x42')](_[_0xf0fc('0x30')](_0x3debfb,function(_0x26bab6){return _0x26bab6['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2e2265){return db[_0xf0fc('0x59')][_0xf0fc('0x49')]({'where':{'userProfileId':_0x551138['params']['id'],'sectionId':_[_0xf0fc('0x30')](_0x2e2265,function(_0x6ed236){return _0x6ed236['sectionId'];})},'attributes':['id',_0xf0fc('0x5c')],'raw':!![]})['then'](function(_0x40e302){var _0x21273c=_[_0xf0fc('0x30')](_0x551138[_0xf0fc('0x4f')],function(_0x1dcc3b){_0x1dcc3b[_0xf0fc('0x60')]=_0x551138['params']['id'];return _0x1dcc3b;});return db[_0xf0fc('0x5b')]['bulkCreate'](_0x21273c,{'raw':!![],'transaction':_0x2038c8});});}})[_0xf0fc('0x4d')](handleError(_0x5e625d,null));});}})[_0xf0fc('0x29')](function(_0x177558){var _0x2a526c=_[_0xf0fc('0x30')](_0x177558,function(_0x38ca73){return _0x38ca73[_0xf0fc('0x52')]({'plain':!![]});});})[_0xf0fc('0x29')](respondWithResult(_0x5e625d,null))['catch'](handleError(_0x5e625d,null));};exports[_0xf0fc('0x6f')]=function(_0x2104c9,_0x1fbd7f,_0x4d5dd1){return db[_0xf0fc('0x31')]['find']({'where':{'id':_0x2104c9[_0xf0fc('0x4c')]['id']}})[_0xf0fc('0x29')](handleEntityNotFound(_0x1fbd7f,null))[_0xf0fc('0x29')](function(_0x1f76fe){if(_0x1f76fe){return _0x1f76fe['removeResources'](_0x2104c9[_0xf0fc('0x39')][_0xf0fc('0x63')]);}})[_0xf0fc('0x29')](respondWithStatusCode(_0x1fbd7f,null))[_0xf0fc('0x4d')](handleError(_0x1fbd7f,null));};exports[_0xf0fc('0x70')]=function(_0x300937,_0x1c6897){var _0x37931e={};if(!_0x300937[_0xf0fc('0x39')][_0xf0fc('0x71')])throw new Error(_0xf0fc('0x72'));if(!_0x300937[_0xf0fc('0x39')][_0xf0fc('0x3d')](_0xf0fc('0x3e'))){_0x37931e[_0xf0fc('0x25')]=qs['limit'](_0x300937[_0xf0fc('0x39')]['limit']);_0x37931e[_0xf0fc('0x23')]=qs[_0xf0fc('0x23')](_0x300937[_0xf0fc('0x39')]['offset']);}return db['UserProfile']['find']({'where':{'id':_0x300937['params']['id']}})[_0xf0fc('0x29')](function(_0x1c9c39){if(!_0x1c9c39)throw new Error(_0xf0fc('0x73')+_0x300937[_0xf0fc('0x4c')]['id']);return db[_0xf0fc('0x31')]['getResources'](_0x300937);})[_0xf0fc('0x29')](respondWithFilteredResult(_0x1c6897,_0x37931e))[_0xf0fc('0x4d')](handleError(_0x1c6897,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 40e1145..5ba9f27 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 _0xa809=['save','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa809,0x1f3));var _0x9a80=function(_0x329eef,_0x1d6364){_0x329eef=_0x329eef-0x0;var _0x5a1b7f=_0xa809[_0x329eef];return _0x5a1b7f;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x9a80('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a80('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5e516a){return function(_0x2b07d5,_0x1f3715,_0x183098){UserProfileEvents[_0x9a80('0x2')](_0x5e516a+':'+_0x2b07d5['id'],_0x2b07d5);UserProfileEvents['emit'](_0x5e516a,_0x2b07d5);_0x183098(null);};}for(var e in events){if(events[_0x9a80('0x3')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9a80('0x4')]=UserProfileEvents; \ No newline at end of file +var _0xa064=['hasOwnProperty','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','emit'];(function(_0x4fdddd,_0xab3dbe){var _0x3883f2=function(_0x390de7){while(--_0x390de7){_0x4fdddd['push'](_0x4fdddd['shift']());}};_0x3883f2(++_0xab3dbe);}(_0xa064,0x192));var _0x4a06=function(_0x45af22,_0x15e0c7){_0x45af22=_0x45af22-0x0;var _0x2dc472=_0xa064[_0x45af22];return _0x2dc472;};'use strict';var EventEmitter=require(_0x4a06('0x0'));var UserProfile=require(_0x4a06('0x1'))['db'][_0x4a06('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4a06('0x3')](0x0);var events={'afterCreate':_0x4a06('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e300a){return function(_0x4add79,_0x390fdc,_0x475a0d){UserProfileEvents['emit'](_0x2e300a+':'+_0x4add79['id'],_0x4add79);UserProfileEvents[_0x4a06('0x5')](_0x2e300a,_0x4add79);_0x475a0d(null);};}for(var e in events){if(events[_0x4a06('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x4a06('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 3368f84..299fac9 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 _0x6167=['resolve','UserProfileResource','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','SquareOdbc','squarerecordings','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','CmContact','Lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','agent','role','telephone','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','users','telephones','Users','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','where','sequelize','query','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','params','all','filter','ignore','isEmpty','union','push','autoAssociation','rawAttributes','keys','filters','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','intersection','customSorting','extraQueryConditions','includeAll','include','Tags','tag','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','models','findAll','then','map','catch','field','value','model'];(function(_0xd6e44c,_0x2269be){var _0x492082=function(_0x399b5d){while(--_0x399b5d){_0xd6e44c['push'](_0xd6e44c['shift']());}};_0x492082(++_0x2269be);}(_0x6167,0x178));var _0x7616=function(_0x52aba6,_0x5e2eee){_0x52aba6=_0x52aba6-0x0;var _0x5c11e6=_0x6167[_0x52aba6];return _0x5c11e6;};'use strict';var _=require(_0x7616('0x0'));var attributes=require(_0x7616('0x1'));var squel=require('squel');module['exports']=function(_0x4df0e2){var _0x313a7d=_0x4df0e2[_0x7616('0x2')];function _0x5bec00(_0x1273b7,_0x1c7301){return new Promise(function(_0x5baee7,_0xad9580){if(!_0x1c7301)return _0x5baee7(null);var _0x5bf63d=_0x1c7301['filter']?{[_0x1c7301['filter']['field']]:_0x1c7301['filter']['value']}:undefined;return _0x313a7d[_0x1273b7][_0x7616('0x3')]({'where':_0x5bf63d,'raw':!![]})[_0x7616('0x4')](function(_0x2965ff){_0x1c7301['associatedResources']=_[_0x7616('0x5')](_0x2965ff,'id');_0x5baee7(_0x1c7301);})[_0x7616('0x6')](function(_0x4e3831){_0xad9580(_0x4e3831);});});}function _0x30cab9(_0xb2c242,_0x17c904){return new Promise(function(_0x377926,_0xc40006){var _0xdacbfd=_0xb2c242['filter']?{[_0xb2c242['filter'][_0x7616('0x7')]]:_0xb2c242['filter'][_0x7616('0x8')]}:undefined;return _0x313a7d[_0xb2c242[_0x7616('0x9')]][_0x7616('0x3')]({'where':_0xdacbfd,'raw':!![]})['then'](function(_0x414c6c){_0x17c904['associatedResources']=_[_0x7616('0x5')](_0x414c6c,function(_0x5e8953){return _0x5e8953['name'];});_0x377926(_0x17c904);})[_0x7616('0x6')](function(_0x44ca1e){_0xc40006(_0x44ca1e);});});}function _0x41f792(_0x3d3d85,_0x5a21ae,_0x2b18b1){if(!_0x5a21ae)return Promise[_0x7616('0xa')](null);return new Promise(function(_0x46125f,_0x3a94e0){return _0x313a7d[_0x7616('0xb')]['findAll']({'where':{'sectionId':_0x5a21ae['id']},'raw':!![]})[_0x7616('0x4')](function(_0x293620){if(_0x3d3d85[_0x7616('0x7')]&&_0x3d3d85[_0x7616('0x7')]!=='id'){_0x5a21ae[_0x7616('0xc')]=_['map'](_0x293620,function(_0x578975){return _0x578975[_0x3d3d85[_0x7616('0x7')]];});}else{if(_0x2b18b1===_0x7616('0xd')){_0x5a21ae[_0x7616('0xc')]=_['map'](_0x293620,function(_0x58bc96){return{'id':_0x58bc96[_0x7616('0xe')],'type':_0x58bc96[_0x7616('0xf')]};});}else{_0x5a21ae[_0x7616('0xc')]=_[_0x7616('0x5')](_0x293620,function(_0x292d7e){return _0x292d7e['resourceId'];});}}_0x46125f(_0x5a21ae);})[_0x7616('0x6')](function(_0x21c996){_0x3a94e0(_0x21c996);});});}function _0x3ea99c(_0x10567f,_0x50409d){var _0x54ff5a={'parentSections':[]};switch(_0x10567f[_0x7616('0x10')]()){case'squareprojects':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x12');break;case'odbc':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x13');break;case _0x7616('0x14'):_0x54ff5a[_0x7616('0x11')]='SquareRecording';_0x54ff5a[_0x7616('0x15')]=[{'name':_0x7616('0x16'),'field':_0x7616('0x17'),'foreignKey':_0x7616('0x18')}];break;case _0x7616('0x19'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x1a');break;case'contacts':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x1b');_0x54ff5a['parentSections']=[{'name':_0x7616('0x1c'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x1d');break;case _0x7616('0x1e'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x1f');break;case _0x7616('0x20'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x21');break;case _0x7616('0x22'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x23');break;case _0x7616('0x24'):_0x54ff5a[_0x7616('0x11')]='ChatWebsite';break;case'faxqueues':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x25');break;case _0x7616('0x26'):_0x54ff5a['childModel']=_0x7616('0x27');break;case'inboundroutes':case _0x7616('0x28'):case _0x7616('0x29'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x2a');break;case'contexts':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x2b');break;case _0x7616('0x2c'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x2d');break;case'voicerecordings':_0x54ff5a['childModel']=_0x7616('0x2e');_0x54ff5a[_0x7616('0x15')]=[{'name':_0x7616('0x2f'),'field':'name','foreignKey':_0x7616('0x30'),'model':_0x7616('0x31'),'filter':{'field':'role','value':[_0x7616('0x32')]}},{'name':'Telephones','field':_0x7616('0x17'),'foreignKey':'membername','model':_0x7616('0x31'),'filter':{'field':_0x7616('0x33'),'value':[_0x7616('0x34')]}},{'name':_0x7616('0x35'),'field':_0x7616('0x17'),'foreignKey':_0x7616('0x36'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0x7616('0x37'),'field':_0x7616('0x17'),'foreignKey':'queue','model':_0x7616('0x38'),'filter':{'field':_0x7616('0xf'),'value':[_0x7616('0x39')]}}];break;case'musiconholds':_0x54ff5a['childModel']=_0x7616('0x3a');break;case _0x7616('0x3b'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x3c');break;case _0x7616('0x3d'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x3e');break;case _0x7616('0x3f'):_0x54ff5a[_0x7616('0x11')]='Campaign';break;case'mailqueues':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x40');break;case _0x7616('0x41'):_0x54ff5a['childModel']='MailAccount';break;case _0x7616('0x42'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x43');break;case'openchannelqueues':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x44');break;case _0x7616('0x45'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x46');break;case _0x7616('0x47'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x48');break;case'smsaccounts':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x49');break;case _0x7616('0x4a'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x4b');break;case'whatsappaccounts':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x4c');break;case _0x7616('0x4d'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x4e');break;case'voicequeues':case'queuecampaigns':_0x54ff5a[_0x7616('0x11')]='VoiceQueue';if(_0x50409d){_0x54ff5a[_0x7616('0x15')]=[{'name':_0x7616('0x35')},{'name':'QueueCampaigns'}];}break;case _0x7616('0x4f'):case'agents':case _0x7616('0x50'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x31');if(_0x50409d){_0x54ff5a[_0x7616('0x15')]=[{'name':_0x7616('0x51'),'filter':{'field':_0x7616('0x33'),'value':['admin',_0x7616('0x52')]},'ignore':!![]},{'name':'Agents'},{'name':_0x7616('0x53')}];}break;case _0x7616('0x54'):_0x54ff5a['childModel']=_0x7616('0x55');break;case _0x7616('0x56'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x57');break;case _0x7616('0x58'):_0x54ff5a[_0x7616('0x11')]='FreshdeskAccount';break;case _0x7616('0x59'):_0x54ff5a['childModel']='SugarcrmAccount';break;case _0x7616('0x5a'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x5b');break;case _0x7616('0x5c'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x5d');break;case _0x7616('0x5e'):_0x54ff5a[_0x7616('0x11')]='User';break;case _0x7616('0x5f'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x60');break;case _0x7616('0x61'):_0x54ff5a[_0x7616('0x11')]='Disposition';break;case'customdashboards':_0x54ff5a['childModel']=_0x7616('0x62');break;case _0x7616('0x63'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x64');break;case _0x7616('0x65'):_0x54ff5a['childModel']=_0x7616('0x66');break;case _0x7616('0x67'):_0x54ff5a[_0x7616('0x11')]='Schedule';break;case _0x7616('0x68'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x69');break;case'tags':_0x54ff5a[_0x7616('0x11')]=_0x7616('0x6a');break;case _0x7616('0x6b'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x6c');break;case _0x7616('0x6d'):_0x54ff5a['childModel']=_0x7616('0x6e');break;case _0x7616('0x6f'):_0x54ff5a['childModel']=_0x7616('0x70');break;case _0x7616('0x71'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x72');break;case _0x7616('0x73'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x74');break;case _0x7616('0x75'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0xd');_0x54ff5a[_0x7616('0x15')]=[{'name':_0x7616('0x76'),'field':'id','foreignKey':_0x7616('0x77')}];break;case _0x7616('0x78'):_0x54ff5a[_0x7616('0x11')]=_0x7616('0x79');break;}return _0x54ff5a;}function _0x55c48a(_0x4eec43,_0x2a2ae8){var _0x4b6ff4=_0x4eec43[_0x7616('0x7a')](0x0)[_0x7616('0x7b')]()+_0x4eec43['slice'](0x1);var _0x112cb6={'type':_0x313a7d['Sequelize'][_0x7616('0x7c')][_0x7616('0x7d')],'raw':!![]};return new Promise(function(_0x40254d,_0x5b72e3){var _0x2b4521=squel[_0x7616('0x7e')]()['field'](_0x7616('0x7f')+_0x4b6ff4+_0x7616('0x80'),'id')[_0x7616('0x7')](_0x7616('0x81'))['from'](_0x7616('0x82')+_0x4eec43+'_interactions','ui')[_0x7616('0x83')]('ui.UserId\x20=\x20?',_0x2a2ae8['id']);return _0x313a7d[_0x7616('0x84')][_0x7616('0x85')](_0x2b4521['toString'](),_0x112cb6)[_0x7616('0x4')](function(_0x5a973f){_0x2a2ae8[_0x4b6ff4+_0x7616('0x86')]=_0x5a973f;_0x40254d(_0x5a973f);})[_0x7616('0x6')](function(_0x499f08){_0x5b72e3(_0x499f08);});});}return _0x4df0e2['define'](_0x7616('0x87'),attributes,{'tableName':_0x7616('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3a5da5){var _0x1024be=require(_0x7616('0x89'));var _0x2f3d62={'raw':_0x3a5da5[_0x7616('0x85')][_0x7616('0x8a')],'where':{}};var _0x822cc7={};var _0x15566c={'count':0x0,'rows':[]};var _0x3888ae=_0x3a5da5[_0x7616('0x85')][_0x7616('0x8b')];var _0x1dc4fa=_0x3a5da5[_0x7616('0x85')][_0x7616('0x8c')]||![];var _0x23f15a=_0x3ea99c(_0x3888ae,_0x1dc4fa);if(!_0x23f15a[_0x7616('0x11')])throw new Error(_0x7616('0x8d')+_0x3888ae+'\x27');var _0x20bfe0=[{'name':_0x3888ae}];if(!_['isEmpty'](_0x23f15a[_0x7616('0x15')]))_0x20bfe0=_0x23f15a[_0x7616('0x15')];var _0x30d9df=[];for(var _0x2e3d72=0x0;_0x2e3d72<_0x20bfe0[_0x7616('0x8e')];_0x2e3d72++){_0x30d9df['push'](_0x313a7d[_0x7616('0x8f')][_0x7616('0x90')]({'where':{'userProfileId':_0x3a5da5[_0x7616('0x91')]['id'],'name':_0x20bfe0[_0x2e3d72][_0x7616('0x17')]},'raw':!![]}));}return Promise[_0x7616('0x92')](_0x30d9df)[_0x7616('0x4')](function(_0x17b37d){var _0x2353bb=_[_0x7616('0x93')](_0x17b37d,function(_0x1bc8ab){return _0x1bc8ab?_0x1bc8ab:undefined;});var _0x21f214=_['filter'](_0x20bfe0,[_0x7616('0x94'),!![]]);var _0x37ace4=_[_0x7616('0x95')](_0x2353bb)&&_[_0x7616('0x95')](_0x21f214)?null:_[_0x7616('0x96')](_0x21f214,_0x2353bb);if(!_0x37ace4)return null;var _0x10f3ef=[];for(var _0x18094d=0x0;_0x18094d<_0x37ace4[_0x7616('0x8e')];_0x18094d++){var _0x1c16c1=_['find'](_0x20bfe0,function(_0x35f9d2){return _0x37ace4[_0x18094d]?_0x35f9d2[_0x7616('0x17')]===_0x37ace4[_0x18094d][_0x7616('0x17')]:null;});if(_0x1c16c1){if(_0x37ace4[_0x18094d][_0x7616('0x94')]){_0x10f3ef[_0x7616('0x97')](_0x5bec00(_0x23f15a[_0x7616('0x11')],_0x37ace4[_0x18094d]));}else{if(!_0x37ace4[_0x18094d][_0x7616('0x98')]){_0x10f3ef['push'](_0x41f792(_0x1c16c1,_0x37ace4[_0x18094d],_0x23f15a[_0x7616('0x11')]));}else{if(_0x1c16c1[_0x7616('0x9')]){_0x10f3ef[_0x7616('0x97')](_0x30cab9(_0x1c16c1,_0x37ace4[_0x18094d]));}}}}}return Promise['all'](_0x10f3ef);})[_0x7616('0x4')](function(_0x31c2ff){var _0x2caf35=_0x31c2ff;var _0x28ddfb=null;if(_0x2caf35){_0x28ddfb=_0x2caf35[_0x7616('0x8e')]===0x1?_0x2caf35[0x0]:null;}if(!_0x28ddfb&&!_0x2caf35)return _0x15566c;var _0x54461c=_0x313a7d[_0x23f15a[_0x7616('0x11')]][_0x7616('0x99')];_0x822cc7[_0x7616('0x9')]=_[_0x7616('0x9a')](_0x54461c);_0x822cc7[_0x7616('0x85')]=_[_0x7616('0x9a')](_0x3a5da5[_0x7616('0x85')]);_0x822cc7[_0x7616('0x9b')]=_['intersection'](_0x822cc7['model'],_0x822cc7[_0x7616('0x85')]);_0x2f3d62['attributes']=_['intersection'](_0x822cc7[_0x7616('0x9')],_0x1024be['fields'](_0x3a5da5[_0x7616('0x85')][_0x7616('0x9c')]));_0x2f3d62['attributes']=_0x2f3d62['attributes'][_0x7616('0x8e')]?_0x2f3d62['attributes']:_0x822cc7[_0x7616('0x9')];if(!_0x3a5da5[_0x7616('0x85')][_0x7616('0x9d')](_0x7616('0x9e'))){_0x2f3d62['limit']=_0x1024be[_0x7616('0x9f')](_0x3a5da5[_0x7616('0x85')][_0x7616('0x9f')]);_0x2f3d62[_0x7616('0xa0')]=_0x1024be[_0x7616('0xa0')](_0x3a5da5[_0x7616('0x85')][_0x7616('0xa0')]);}_0x2f3d62[_0x7616('0xa1')]=_0x1024be[_0x7616('0xa2')](_0x3a5da5['query'][_0x7616('0xa2')]);_0x2f3d62[_0x7616('0x83')]=_0x1024be[_0x7616('0x9b')](_['pick'](_0x3a5da5['query'],_0x822cc7[_0x7616('0x9b')]));if(_0x3a5da5[_0x7616('0x85')][_0x7616('0x93')]){_0x2f3d62[_0x7616('0x83')]=_[_0x7616('0xa3')](_0x2f3d62[_0x7616('0x83')],{'$or':_[_0x7616('0x5')](_0x54461c,function(_0x5d9031){if(_0x5d9031[_0x7616('0xf')][_0x7616('0xa4')]!==_0x7616('0xa5')){var _0x245043={};_0x245043[_0x5d9031[_0x7616('0x7')]]={'$like':'%'+_0x3a5da5[_0x7616('0x85')][_0x7616('0x93')]+'%'};return _0x245043;}})});}var _0xb577f8=[];var _0x12c6f4=null;var _0x82e713={};if(_0x28ddfb){_0x12c6f4=_[_0x7616('0x90')](_0x20bfe0,[_0x7616('0x17'),_0x28ddfb['name']]);if(_0x12c6f4['field']){_0x82e713={};if(_0x23f15a[_0x7616('0x11')]===_0x7616('0xd')){_0x82e713[_0x12c6f4[_0x7616('0xa6')]]=_[_0x7616('0x5')](_0x28ddfb[_0x7616('0xc')],'id');}else{_0x82e713[_0x12c6f4[_0x7616('0xa6')]]=_0x28ddfb[_0x7616('0xc')];}_0xb577f8[_0x7616('0x97')](_0x82e713);}else{_0x2f3d62[_0x7616('0x83')]['id']=_0x28ddfb[_0x7616('0xc')];}}else{for(var _0x18e85d=0x0;_0x18e85d<_0x2caf35[_0x7616('0x8e')];_0x18e85d++){_0x12c6f4=_[_0x7616('0x90')](_0x20bfe0,['name',_0x2caf35[_0x18e85d][_0x7616('0x17')]]);if(_0x12c6f4['field']){_0x82e713={};_0x82e713[_0x12c6f4[_0x7616('0xa6')]]=_0x2caf35[_0x18e85d][_0x7616('0xc')];_0xb577f8[_0x7616('0x97')](_0x82e713);}else{if(!_0x2f3d62[_0x7616('0x83')]['id'])_0x2f3d62[_0x7616('0x83')]['id']=[];_0x2caf35[_0x18e85d]['associatedResources'][_0x7616('0xa7')](function(_0x3aaa16){_0x2f3d62[_0x7616('0x83')]['id'][_0x7616('0x97')](_0x3aaa16);});}}}if(!_['isEmpty'](_0xb577f8)){_0x2f3d62[_0x7616('0x83')]=_[_0x7616('0xa3')](_0x2f3d62['where'],{'$and':{'$or':_0xb577f8}});}_0x2f3d62=_[_0x7616('0xa3')]({},_0x2f3d62,_0x3a5da5[_0x7616('0xa8')]);if(_0x28ddfb&&!_0x28ddfb['autoAssociation']&&_0x23f15a['childModel']==='AnalyticExtractedReport'){if(_0x3a5da5['query']['includeAll']){_0x2f3d62['include']=[{'all':!![]}];}return _0x313a7d[_0x23f15a['childModel']][_0x7616('0x3')](_0x2f3d62)['then'](function(_0x35108f){var _0x36fa42=[];_0x35108f[_0x7616('0xa7')](function(_0x106866){var _0xf64dce;switch(_0x106866[_0x7616('0xa9')]){case _0x7616('0xaa'):_0xf64dce=_['find'](_0x28ddfb[_0x7616('0xc')],function(_0xdf9b45){return _0xdf9b45['id']===_0x106866[_0x7616('0x77')]&&_0xdf9b45[_0x7616('0xf')]===_0x7616('0xab');});break;case _0x7616('0xac'):_0xf64dce=_[_0x7616('0x90')](_0x28ddfb[_0x7616('0xc')],function(_0x1e7d4e){return _0x1e7d4e['id']===_0x106866[_0x7616('0x77')]&&_0x1e7d4e['type']===_0x7616('0xad');});break;}if(_0xf64dce)_0x36fa42[_0x7616('0x97')](_0x106866);});_0x15566c[_0x7616('0xae')]=_0x36fa42[_0x7616('0x8e')];_0x15566c[_0x7616('0xaf')]=_0x36fa42;return _0x15566c;});}else{if(!_[_0x7616('0x95')](_0x3a5da5[_0x7616('0x85')][_0x7616('0xb0')])){_0x2f3d62[_0x7616('0x83')]['id']=_0x2f3d62['where']['id']?_[_0x7616('0xb1')](_0x2f3d62['where']['id'],_0x3a5da5[_0x7616('0x85')][_0x7616('0xb0')]):_0x3a5da5[_0x7616('0x85')]['ids'];if(_0x3a5da5[_0x7616('0x85')][_0x7616('0xb2')]){_0x2f3d62[_0x7616('0xa1')]=_0x3a5da5['query'][_0x7616('0xb2')];}}if(_0x3a5da5['query'][_0x7616('0xb3')]){_0x2f3d62[_0x7616('0x83')]=_[_0x7616('0xa3')](_0x2f3d62[_0x7616('0x83')],{'$and':_0x3a5da5[_0x7616('0x85')][_0x7616('0xb3')]});}return _0x313a7d[_0x23f15a['childModel']][_0x7616('0xae')]({'where':_0x2f3d62[_0x7616('0x83')]})['then'](function(_0x53c764){_0x15566c[_0x7616('0xae')]=_0x53c764;if(_0x3a5da5[_0x7616('0x85')][_0x7616('0xb4')]){if(_0x23f15a['childModel']===_0x7616('0x1b')){_0x2f3d62[_0x7616('0xb5')]=[{'model':_0x313a7d['Tag'],'as':_0x7616('0xb6'),'attributes':['id','name','color'],'required':_0x3a5da5['query']['tag']?!![]:![]},{'model':_0x313a7d['Tag'],'as':'ThroughTags','attributes':['id',_0x7616('0x17'),'color'],'through':_0x3a5da5[_0x7616('0x85')][_0x7616('0xb7')]?{'attributes':[],'where':{'TagId':_0x3a5da5[_0x7616('0x85')][_0x7616('0xb7')]||undefined}}:{},'required':_0x3a5da5[_0x7616('0x85')]['tag']?!![]:![]}];}else{_0x2f3d62[_0x7616('0xb5')]=[{'all':!![]}];}}return _0x313a7d[_0x23f15a[_0x7616('0x11')]][_0x7616('0x3')](_0x2f3d62);})[_0x7616('0x4')](function(_0x378005){_0x15566c[_0x7616('0xaf')]=_0x378005;if(_0x3888ae===_0x7616('0x2f')&&_0x3a5da5[_0x7616('0x85')][_0x7616('0xb8')]===_0x7616('0xb9')){var _0x2cfa34=[];for(var _0x1b4f85=0x0;_0x1b4f85<_0x15566c[_0x7616('0xaf')][_0x7616('0x8e')];_0x1b4f85++){_0x2cfa34[_0x7616('0x97')](_0x55c48a(_0x7616('0xba'),_0x15566c[_0x7616('0xaf')][_0x1b4f85]['dataValues']));_0x2cfa34['push'](_0x55c48a(_0x7616('0xbb'),_0x15566c[_0x7616('0xaf')][_0x1b4f85][_0x7616('0xbc')]));_0x2cfa34['push'](_0x55c48a(_0x7616('0xbd'),_0x15566c['rows'][_0x1b4f85][_0x7616('0xbc')]));_0x2cfa34[_0x7616('0x97')](_0x55c48a(_0x7616('0xbe'),_0x15566c[_0x7616('0xaf')][_0x1b4f85][_0x7616('0xbc')]));_0x2cfa34['push'](_0x55c48a(_0x7616('0xbf'),_0x15566c['rows'][_0x1b4f85][_0x7616('0xbc')]));_0x2cfa34['push'](_0x55c48a(_0x7616('0xc0'),_0x15566c['rows'][_0x1b4f85][_0x7616('0xbc')]));}return Promise['all'](_0x2cfa34)['then'](function(){return _0x15566c;});}return _0x15566c;});}});}}});}; \ No newline at end of file +var _0xdb2b=['all','ignore','union','push','autoAssociation','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','merge','VIRTUAL','foreignKey','forEach','options','reportType','default','DefaultReports','custom','CustomReports','ids','customSorting','extraQueryConditions','count','include','Tags','color','tag','rows','openTabs','true','chat','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','squel','exports','models','filter','field','value','then','associatedResources','map','model','findAll','name','catch','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','SquareProject','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','voicemails','voicerecordings','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','type','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','teams','voicequeues','QueueCampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','zohoaccounts','ZohoAccount','cannedanswers','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','define','UserProfile','user_profiles','raw','section','mergeResources','isEmpty','length','find','params'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xdb2b,0xea));var _0xbdb2=function(_0x239f2e,_0x4c5c60){_0x239f2e=_0x239f2e-0x0;var _0x17dcf6=_0xdb2b[_0x239f2e];return _0x17dcf6;};'use strict';var _=require('lodash');var attributes=require(_0xbdb2('0x0'));var squel=require(_0xbdb2('0x1'));module[_0xbdb2('0x2')]=function(_0xca3a05){var _0x555c4f=_0xca3a05[_0xbdb2('0x3')];function _0x5e111f(_0x2ef3aa,_0x5abdf7){return new Promise(function(_0x4715f5,_0x1097a6){if(!_0x5abdf7)return _0x4715f5(null);var _0x1d479d=_0x5abdf7[_0xbdb2('0x4')]?{[_0x5abdf7[_0xbdb2('0x4')][_0xbdb2('0x5')]]:_0x5abdf7[_0xbdb2('0x4')][_0xbdb2('0x6')]}:undefined;return _0x555c4f[_0x2ef3aa]['findAll']({'where':_0x1d479d,'raw':!![]})[_0xbdb2('0x7')](function(_0x2dc225){_0x5abdf7[_0xbdb2('0x8')]=_[_0xbdb2('0x9')](_0x2dc225,'id');_0x4715f5(_0x5abdf7);})['catch'](function(_0x4a85d4){_0x1097a6(_0x4a85d4);});});}function _0x4453e4(_0x542f0a,_0x38afac){return new Promise(function(_0x4f017e,_0x1c2528){var _0x5c444e=_0x542f0a[_0xbdb2('0x4')]?{[_0x542f0a[_0xbdb2('0x4')][_0xbdb2('0x5')]]:_0x542f0a['filter'][_0xbdb2('0x6')]}:undefined;return _0x555c4f[_0x542f0a[_0xbdb2('0xa')]][_0xbdb2('0xb')]({'where':_0x5c444e,'raw':!![]})[_0xbdb2('0x7')](function(_0x5a12d1){_0x38afac[_0xbdb2('0x8')]=_[_0xbdb2('0x9')](_0x5a12d1,function(_0x2eaf4d){return _0x2eaf4d[_0xbdb2('0xc')];});_0x4f017e(_0x38afac);})[_0xbdb2('0xd')](function(_0x111693){_0x1c2528(_0x111693);});});}function _0x346a15(_0x353117,_0x356147,_0x5bd483){if(!_0x356147)return Promise[_0xbdb2('0xe')](null);return new Promise(function(_0x4826b8,_0x37fa8e){return _0x555c4f['UserProfileResource'][_0xbdb2('0xb')]({'where':{'sectionId':_0x356147['id']},'raw':!![]})['then'](function(_0x37cc42){if(_0x353117['field']&&_0x353117[_0xbdb2('0x5')]!=='id'){_0x356147[_0xbdb2('0x8')]=_[_0xbdb2('0x9')](_0x37cc42,function(_0x13a885){return _0x13a885[_0x353117[_0xbdb2('0x5')]];});}else{if(_0x5bd483===_0xbdb2('0xf')){_0x356147[_0xbdb2('0x8')]=_[_0xbdb2('0x9')](_0x37cc42,function(_0x23ce42){return{'id':_0x23ce42[_0xbdb2('0x10')],'type':_0x23ce42['type']};});}else{_0x356147[_0xbdb2('0x8')]=_[_0xbdb2('0x9')](_0x37cc42,function(_0xb4668c){return _0xb4668c['resourceId'];});}}_0x4826b8(_0x356147);})['catch'](function(_0x492998){_0x37fa8e(_0x492998);});});}function _0x38342b(_0x54f3aa,_0x98d6e2){var _0x5e9bb8={'parentSections':[]};switch(_0x54f3aa[_0xbdb2('0x11')]()){case _0xbdb2('0x12'):_0x5e9bb8['childModel']=_0xbdb2('0x13');break;case'odbc':_0x5e9bb8[_0xbdb2('0x14')]='SquareOdbc';break;case _0xbdb2('0x15'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x16');_0x5e9bb8[_0xbdb2('0x17')]=[{'name':_0xbdb2('0x18'),'field':_0xbdb2('0xc'),'foreignKey':_0xbdb2('0x19')}];break;case'projects':_0x5e9bb8['childModel']=_0xbdb2('0x1a');break;case _0xbdb2('0x1b'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x1c');_0x5e9bb8[_0xbdb2('0x17')]=[{'name':_0xbdb2('0x1d'),'field':'id','foreignKey':_0xbdb2('0x1e')}];break;case'lists':_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x1f');break;case'companies':_0x5e9bb8['childModel']=_0xbdb2('0x20');break;case _0xbdb2('0x21'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x22');break;case _0xbdb2('0x23'):_0x5e9bb8[_0xbdb2('0x14')]='ChatQueue';break;case _0xbdb2('0x24'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x25');break;case'faxqueues':_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x26');break;case _0xbdb2('0x27'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x28');break;case _0xbdb2('0x29'):case'internalroutes':case _0xbdb2('0x2a'):_0x5e9bb8[_0xbdb2('0x14')]='VoiceExtension';break;case _0xbdb2('0x2b'):_0x5e9bb8['childModel']='VoiceContext';break;case _0xbdb2('0x2c'):_0x5e9bb8['childModel']='VoiceMail';break;case _0xbdb2('0x2d'):_0x5e9bb8['childModel']='VoiceRecording';_0x5e9bb8['parentSections']=[{'name':'Agents','field':_0xbdb2('0xc'),'foreignKey':_0xbdb2('0x2e'),'model':'User','filter':{'field':_0xbdb2('0x2f'),'value':[_0xbdb2('0x30')]}},{'name':_0xbdb2('0x31'),'field':'name','foreignKey':'membername','model':_0xbdb2('0x32'),'filter':{'field':_0xbdb2('0x2f'),'value':[_0xbdb2('0x33')]}},{'name':_0xbdb2('0x34'),'field':_0xbdb2('0xc'),'foreignKey':_0xbdb2('0x35'),'model':_0xbdb2('0x36'),'filter':{'field':'type','value':[_0xbdb2('0x37')]}},{'name':'QueueCampaigns','field':_0xbdb2('0xc'),'foreignKey':_0xbdb2('0x35'),'model':_0xbdb2('0x36'),'filter':{'field':_0xbdb2('0x38'),'value':['outbound']}}];break;case _0xbdb2('0x39'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x3a');break;case'chanspies':_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x3b');break;case _0xbdb2('0x3c'):_0x5e9bb8[_0xbdb2('0x14')]='VoicePrefix';break;case'ivrcampaigns':_0x5e9bb8['childModel']=_0xbdb2('0x3d');break;case _0xbdb2('0x3e'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x3f');break;case _0xbdb2('0x40'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x41');break;case _0xbdb2('0x42'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x43');break;case _0xbdb2('0x44'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x45');break;case _0xbdb2('0x46'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x47');break;case _0xbdb2('0x48'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x49');break;case _0xbdb2('0x4a'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x4b');break;case'whatsappqueues':_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x4c');break;case _0xbdb2('0x4d'):_0x5e9bb8[_0xbdb2('0x14')]='WhatsappAccount';break;case _0xbdb2('0x4e'):_0x5e9bb8[_0xbdb2('0x14')]='Team';break;case _0xbdb2('0x4f'):case'queuecampaigns':_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x36');if(_0x98d6e2){_0x5e9bb8[_0xbdb2('0x17')]=[{'name':'VoiceQueues'},{'name':_0xbdb2('0x50')}];}break;case _0xbdb2('0x51'):case _0xbdb2('0x52'):case _0xbdb2('0x53'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x32');if(_0x98d6e2){_0x5e9bb8[_0xbdb2('0x17')]=[{'name':_0xbdb2('0x54'),'filter':{'field':'role','value':[_0xbdb2('0x55'),_0xbdb2('0x56')]},'ignore':!![]},{'name':_0xbdb2('0x57')},{'name':_0xbdb2('0x31')}];}break;case _0xbdb2('0x58'):_0x5e9bb8['childModel']='ZendeskAccount';break;case _0xbdb2('0x59'):_0x5e9bb8['childModel']=_0xbdb2('0x5a');break;case _0xbdb2('0x5b'):_0x5e9bb8['childModel']=_0xbdb2('0x5c');break;case _0xbdb2('0x5d'):_0x5e9bb8[_0xbdb2('0x14')]='SugarcrmAccount';break;case'deskaccounts':_0x5e9bb8[_0xbdb2('0x14')]='DeskAccount';break;case _0xbdb2('0x5e'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x5f');break;case'vtigeraccounts':_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x32');break;case _0xbdb2('0x60'):_0x5e9bb8[_0xbdb2('0x14')]='CannedAnswer';break;case _0xbdb2('0x61'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x62');break;case _0xbdb2('0x63'):_0x5e9bb8[_0xbdb2('0x14')]='Dashboard';break;case _0xbdb2('0x64'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x65');break;case _0xbdb2('0x66'):_0x5e9bb8['childModel']=_0xbdb2('0x67');break;case _0xbdb2('0x68'):_0x5e9bb8['childModel']=_0xbdb2('0x69');break;case _0xbdb2('0x6a'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x6b');break;case _0xbdb2('0x6c'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x6d');break;case _0xbdb2('0x6e'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x6f');break;case _0xbdb2('0x70'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x71');break;case _0xbdb2('0x72'):_0x5e9bb8['childModel']='Trunk';break;case _0xbdb2('0x73'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x74');break;case _0xbdb2('0x75'):_0x5e9bb8[_0xbdb2('0x14')]=_0xbdb2('0x76');break;case _0xbdb2('0x77'):_0x5e9bb8[_0xbdb2('0x14')]='AnalyticExtractedReport';_0x5e9bb8[_0xbdb2('0x17')]=[{'name':_0xbdb2('0x78'),'field':'id','foreignKey':_0xbdb2('0x79')}];break;case'metrics':_0x5e9bb8['childModel']='AnalyticMetric';break;}return _0x5e9bb8;}function _0x58fbad(_0x5a6944,_0x55428f){var _0x948e52=_0x5a6944[_0xbdb2('0x7a')](0x0)[_0xbdb2('0x7b')]()+_0x5a6944[_0xbdb2('0x7c')](0x1);var _0x2e2027={'type':_0x555c4f[_0xbdb2('0x7d')]['QueryTypes'][_0xbdb2('0x7e')],'raw':!![]};return new Promise(function(_0x31c15b,_0x42ba31){var _0x3b3c5b=squel[_0xbdb2('0x7f')]()[_0xbdb2('0x5')](_0xbdb2('0x80')+_0x948e52+_0xbdb2('0x81'),'id')[_0xbdb2('0x5')](_0xbdb2('0x82'))[_0xbdb2('0x83')](_0xbdb2('0x84')+_0x5a6944+_0xbdb2('0x85'),'ui')[_0xbdb2('0x86')]('ui.UserId\x20=\x20?',_0x55428f['id']);return _0x555c4f[_0xbdb2('0x87')][_0xbdb2('0x88')](_0x3b3c5b[_0xbdb2('0x89')](),_0x2e2027)['then'](function(_0x530d84){_0x55428f[_0x948e52+'OpenTabs']=_0x530d84;_0x31c15b(_0x530d84);})[_0xbdb2('0xd')](function(_0xb3d62){_0x42ba31(_0xb3d62);});});}return _0xca3a05[_0xbdb2('0x8a')](_0xbdb2('0x8b'),attributes,{'tableName':_0xbdb2('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x43e263){var _0x566661=require('../../components/parsers/qs');var _0x5ae803={'raw':_0x43e263[_0xbdb2('0x88')][_0xbdb2('0x8d')],'where':{}};var _0x26a159={};var _0x5865e8={'count':0x0,'rows':[]};var _0x4a31b0=_0x43e263[_0xbdb2('0x88')][_0xbdb2('0x8e')];var _0x5640c2=_0x43e263[_0xbdb2('0x88')][_0xbdb2('0x8f')]||![];var _0x1fe71b=_0x38342b(_0x4a31b0,_0x5640c2);if(!_0x1fe71b['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x4a31b0+'\x27');var _0x5a6657=[{'name':_0x4a31b0}];if(!_[_0xbdb2('0x90')](_0x1fe71b[_0xbdb2('0x17')]))_0x5a6657=_0x1fe71b[_0xbdb2('0x17')];var _0x532a04=[];for(var _0x39cb1f=0x0;_0x39cb1f<_0x5a6657[_0xbdb2('0x91')];_0x39cb1f++){_0x532a04['push'](_0x555c4f['UserProfileSection'][_0xbdb2('0x92')]({'where':{'userProfileId':_0x43e263[_0xbdb2('0x93')]['id'],'name':_0x5a6657[_0x39cb1f]['name']},'raw':!![]}));}return Promise[_0xbdb2('0x94')](_0x532a04)['then'](function(_0x4ba005){var _0x450d8e=_['filter'](_0x4ba005,function(_0x191c99){return _0x191c99?_0x191c99:undefined;});var _0x2c6301=_['filter'](_0x5a6657,[_0xbdb2('0x95'),!![]]);var _0x4c8679=_[_0xbdb2('0x90')](_0x450d8e)&&_[_0xbdb2('0x90')](_0x2c6301)?null:_[_0xbdb2('0x96')](_0x2c6301,_0x450d8e);if(!_0x4c8679)return null;var _0x36677d=[];for(var _0x5d1fea=0x0;_0x5d1fea<_0x4c8679[_0xbdb2('0x91')];_0x5d1fea++){var _0x3d8882=_['find'](_0x5a6657,function(_0x451dce){return _0x4c8679[_0x5d1fea]?_0x451dce[_0xbdb2('0xc')]===_0x4c8679[_0x5d1fea][_0xbdb2('0xc')]:null;});if(_0x3d8882){if(_0x4c8679[_0x5d1fea][_0xbdb2('0x95')]){_0x36677d[_0xbdb2('0x97')](_0x5e111f(_0x1fe71b[_0xbdb2('0x14')],_0x4c8679[_0x5d1fea]));}else{if(!_0x4c8679[_0x5d1fea][_0xbdb2('0x98')]){_0x36677d[_0xbdb2('0x97')](_0x346a15(_0x3d8882,_0x4c8679[_0x5d1fea],_0x1fe71b['childModel']));}else{if(_0x3d8882[_0xbdb2('0xa')]){_0x36677d[_0xbdb2('0x97')](_0x4453e4(_0x3d8882,_0x4c8679[_0x5d1fea]));}}}}}return Promise['all'](_0x36677d);})[_0xbdb2('0x7')](function(_0x4d3a9b){var _0x1984b2=_0x4d3a9b;var _0x1e66d7=null;if(_0x1984b2){_0x1e66d7=_0x1984b2['length']===0x1?_0x1984b2[0x0]:null;}if(!_0x1e66d7&&!_0x1984b2)return _0x5865e8;var _0xbfae84=_0x555c4f[_0x1fe71b[_0xbdb2('0x14')]]['rawAttributes'];_0x26a159[_0xbdb2('0xa')]=_[_0xbdb2('0x99')](_0xbfae84);_0x26a159[_0xbdb2('0x88')]=_[_0xbdb2('0x99')](_0x43e263[_0xbdb2('0x88')]);_0x26a159['filters']=_[_0xbdb2('0x9a')](_0x26a159[_0xbdb2('0xa')],_0x26a159[_0xbdb2('0x88')]);_0x5ae803[_0xbdb2('0x9b')]=_['intersection'](_0x26a159[_0xbdb2('0xa')],_0x566661[_0xbdb2('0x9c')](_0x43e263[_0xbdb2('0x88')][_0xbdb2('0x9c')]));_0x5ae803['attributes']=_0x5ae803['attributes']['length']?_0x5ae803[_0xbdb2('0x9b')]:_0x26a159[_0xbdb2('0xa')];if(!_0x43e263[_0xbdb2('0x88')][_0xbdb2('0x9d')](_0xbdb2('0x9e'))){_0x5ae803[_0xbdb2('0x9f')]=_0x566661[_0xbdb2('0x9f')](_0x43e263['query']['limit']);_0x5ae803['offset']=_0x566661[_0xbdb2('0xa0')](_0x43e263[_0xbdb2('0x88')]['offset']);}_0x5ae803[_0xbdb2('0xa1')]=_0x566661[_0xbdb2('0xa2')](_0x43e263[_0xbdb2('0x88')][_0xbdb2('0xa2')]);_0x5ae803[_0xbdb2('0x86')]=_0x566661[_0xbdb2('0xa3')](_['pick'](_0x43e263['query'],_0x26a159['filters']));if(_0x43e263[_0xbdb2('0x88')][_0xbdb2('0x4')]){_0x5ae803[_0xbdb2('0x86')]=_[_0xbdb2('0xa4')](_0x5ae803[_0xbdb2('0x86')],{'$or':_[_0xbdb2('0x9')](_0xbfae84,function(_0x23105c){if(_0x23105c[_0xbdb2('0x38')]['key']!==_0xbdb2('0xa5')){var _0x3d660d={};_0x3d660d[_0x23105c[_0xbdb2('0x5')]]={'$like':'%'+_0x43e263[_0xbdb2('0x88')]['filter']+'%'};return _0x3d660d;}})});}var _0x570777=[];var _0x15a622=null;var _0x43fde9={};if(_0x1e66d7){_0x15a622=_[_0xbdb2('0x92')](_0x5a6657,[_0xbdb2('0xc'),_0x1e66d7['name']]);if(_0x15a622[_0xbdb2('0x5')]){_0x43fde9={};if(_0x1fe71b['childModel']===_0xbdb2('0xf')){_0x43fde9[_0x15a622[_0xbdb2('0xa6')]]=_[_0xbdb2('0x9')](_0x1e66d7[_0xbdb2('0x8')],'id');}else{_0x43fde9[_0x15a622[_0xbdb2('0xa6')]]=_0x1e66d7['associatedResources'];}_0x570777['push'](_0x43fde9);}else{_0x5ae803[_0xbdb2('0x86')]['id']=_0x1e66d7[_0xbdb2('0x8')];}}else{for(var _0x34f629=0x0;_0x34f629<_0x1984b2[_0xbdb2('0x91')];_0x34f629++){_0x15a622=_[_0xbdb2('0x92')](_0x5a6657,[_0xbdb2('0xc'),_0x1984b2[_0x34f629][_0xbdb2('0xc')]]);if(_0x15a622[_0xbdb2('0x5')]){_0x43fde9={};_0x43fde9[_0x15a622[_0xbdb2('0xa6')]]=_0x1984b2[_0x34f629][_0xbdb2('0x8')];_0x570777[_0xbdb2('0x97')](_0x43fde9);}else{if(!_0x5ae803[_0xbdb2('0x86')]['id'])_0x5ae803[_0xbdb2('0x86')]['id']=[];_0x1984b2[_0x34f629][_0xbdb2('0x8')][_0xbdb2('0xa7')](function(_0x25e405){_0x5ae803[_0xbdb2('0x86')]['id'][_0xbdb2('0x97')](_0x25e405);});}}}if(!_[_0xbdb2('0x90')](_0x570777)){_0x5ae803['where']=_['merge'](_0x5ae803['where'],{'$and':{'$or':_0x570777}});}_0x5ae803=_[_0xbdb2('0xa4')]({},_0x5ae803,_0x43e263[_0xbdb2('0xa8')]);if(_0x1e66d7&&!_0x1e66d7[_0xbdb2('0x98')]&&_0x1fe71b[_0xbdb2('0x14')]===_0xbdb2('0xf')){if(_0x43e263[_0xbdb2('0x88')]['includeAll']){_0x5ae803['include']=[{'all':!![]}];}return _0x555c4f[_0x1fe71b[_0xbdb2('0x14')]][_0xbdb2('0xb')](_0x5ae803)[_0xbdb2('0x7')](function(_0x1491b3){var _0x370caf=[];_0x1491b3['forEach'](function(_0x41f4b3){var _0x414910;switch(_0x41f4b3[_0xbdb2('0xa9')]){case _0xbdb2('0xaa'):_0x414910=_['find'](_0x1e66d7[_0xbdb2('0x8')],function(_0xcafa84){return _0xcafa84['id']===_0x41f4b3[_0xbdb2('0x79')]&&_0xcafa84['type']===_0xbdb2('0xab');});break;case _0xbdb2('0xac'):_0x414910=_[_0xbdb2('0x92')](_0x1e66d7['associatedResources'],function(_0x331a0d){return _0x331a0d['id']===_0x41f4b3[_0xbdb2('0x79')]&&_0x331a0d[_0xbdb2('0x38')]===_0xbdb2('0xad');});break;}if(_0x414910)_0x370caf['push'](_0x41f4b3);});_0x5865e8['count']=_0x370caf[_0xbdb2('0x91')];_0x5865e8['rows']=_0x370caf;return _0x5865e8;});}else{if(!_[_0xbdb2('0x90')](_0x43e263[_0xbdb2('0x88')][_0xbdb2('0xae')])){_0x5ae803[_0xbdb2('0x86')]['id']=_0x5ae803[_0xbdb2('0x86')]['id']?_[_0xbdb2('0x9a')](_0x5ae803['where']['id'],_0x43e263[_0xbdb2('0x88')][_0xbdb2('0xae')]):_0x43e263['query']['ids'];if(_0x43e263['query'][_0xbdb2('0xaf')]){_0x5ae803[_0xbdb2('0xa1')]=_0x43e263[_0xbdb2('0x88')]['customSorting'];}}if(_0x43e263[_0xbdb2('0x88')]['extraQueryConditions']){_0x5ae803[_0xbdb2('0x86')]=_[_0xbdb2('0xa4')](_0x5ae803[_0xbdb2('0x86')],{'$and':_0x43e263[_0xbdb2('0x88')][_0xbdb2('0xb0')]});}return _0x555c4f[_0x1fe71b[_0xbdb2('0x14')]][_0xbdb2('0xb1')]({'where':_0x5ae803['where']})['then'](function(_0x2095dd){_0x5865e8['count']=_0x2095dd;if(_0x43e263['query']['includeAll']){if(_0x1fe71b['childModel']===_0xbdb2('0x1c')){_0x5ae803[_0xbdb2('0xb2')]=[{'model':_0x555c4f[_0xbdb2('0x6d')],'as':_0xbdb2('0xb3'),'attributes':['id',_0xbdb2('0xc'),_0xbdb2('0xb4')],'required':_0x43e263['query'][_0xbdb2('0xb5')]?!![]:![]},{'model':_0x555c4f[_0xbdb2('0x6d')],'as':'ThroughTags','attributes':['id',_0xbdb2('0xc'),_0xbdb2('0xb4')],'through':_0x43e263[_0xbdb2('0x88')][_0xbdb2('0xb5')]?{'attributes':[],'where':{'TagId':_0x43e263[_0xbdb2('0x88')][_0xbdb2('0xb5')]||undefined}}:{},'required':_0x43e263[_0xbdb2('0x88')]['tag']?!![]:![]}];}else{_0x5ae803[_0xbdb2('0xb2')]=[{'all':!![]}];}}return _0x555c4f[_0x1fe71b[_0xbdb2('0x14')]]['findAll'](_0x5ae803);})[_0xbdb2('0x7')](function(_0x3905ec){_0x5865e8[_0xbdb2('0xb6')]=_0x3905ec;if(_0x4a31b0===_0xbdb2('0x57')&&_0x43e263[_0xbdb2('0x88')][_0xbdb2('0xb7')]===_0xbdb2('0xb8')){var _0x70f40e=[];for(var _0x2a1f8b=0x0;_0x2a1f8b<_0x5865e8[_0xbdb2('0xb6')][_0xbdb2('0x91')];_0x2a1f8b++){_0x70f40e[_0xbdb2('0x97')](_0x58fbad(_0xbdb2('0xb9'),_0x5865e8[_0xbdb2('0xb6')][_0x2a1f8b]['dataValues']));_0x70f40e[_0xbdb2('0x97')](_0x58fbad('sms',_0x5865e8[_0xbdb2('0xb6')][_0x2a1f8b][_0xbdb2('0xba')]));_0x70f40e[_0xbdb2('0x97')](_0x58fbad(_0xbdb2('0xbb'),_0x5865e8[_0xbdb2('0xb6')][_0x2a1f8b]['dataValues']));_0x70f40e[_0xbdb2('0x97')](_0x58fbad(_0xbdb2('0xbc'),_0x5865e8['rows'][_0x2a1f8b][_0xbdb2('0xba')]));_0x70f40e[_0xbdb2('0x97')](_0x58fbad(_0xbdb2('0xbd'),_0x5865e8[_0xbdb2('0xb6')][_0x2a1f8b][_0xbdb2('0xba')]));_0x70f40e[_0xbdb2('0x97')](_0x58fbad(_0xbdb2('0xbe'),_0x5865e8[_0xbdb2('0xb6')][_0x2a1f8b]['dataValues']));}return Promise[_0xbdb2('0x94')](_0x70f40e)[_0xbdb2('0x7')](function(){return _0x5865e8;});}return _0x5865e8;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 18b2c17..4256dff 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 _0xde46=['moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xde46,0x14e));var _0x6de4=function(_0x12cb49,_0x19f696){_0x12cb49=_0x12cb49-0x0;var _0x5ba8ad=_0xde46[_0x12cb49];return _0x5ba8ad;};'use strict';var _=require(_0x6de4('0x0'));var util=require(_0x6de4('0x1'));var moment=require(_0x6de4('0x2'));var BPromise=require(_0x6de4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6de4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6de4('0x5'))(_0x6de4('0x6'));var config=require(_0x6de4('0x7'));var jayson=require(_0x6de4('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6de4('0x9')]=_['defaults'](config[_0x6de4('0x9')],{'host':_0x6de4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6de4('0x9')]));require(_0x6de4('0xb'))[_0x6de4('0xc')](socket);function respondWithRpcPromise(_0x2f2d2a,_0x20a86c,_0x10a00c){return new BPromise(function(_0xffe1ea,_0x3b2c5b){return client[_0x6de4('0xd')](_0x2f2d2a,_0x10a00c)[_0x6de4('0xe')](function(_0x1554b6){logger['info'](_0x6de4('0xf'),_0x20a86c,_0x6de4('0x10'));logger[_0x6de4('0x11')](_0x6de4('0x12'),_0x20a86c,_0x6de4('0x10'),JSON[_0x6de4('0x13')](_0x1554b6));if(_0x1554b6[_0x6de4('0x14')]){if(_0x1554b6[_0x6de4('0x14')]['code']===0x1f4){logger[_0x6de4('0x14')]('UserProfile,\x20%s,\x20%s',_0x20a86c,_0x1554b6[_0x6de4('0x14')][_0x6de4('0x15')]);return _0x3b2c5b(_0x1554b6[_0x6de4('0x14')]['message']);}logger[_0x6de4('0x14')](_0x6de4('0xf'),_0x20a86c,_0x1554b6[_0x6de4('0x14')][_0x6de4('0x15')]);return _0xffe1ea(_0x1554b6['error'][_0x6de4('0x15')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x20a86c,_0x6de4('0x10'));_0xffe1ea(_0x1554b6[_0x6de4('0x16')][_0x6de4('0x15')]);}})[_0x6de4('0x17')](function(_0xe8af1a){logger[_0x6de4('0x14')](_0x6de4('0xf'),_0x20a86c,_0xe8af1a);_0x3b2c5b(_0xe8af1a);});});} \ No newline at end of file +var _0xfba8=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x424cca,_0x54d428){var _0xabe8fa=function(_0x102290){while(--_0x102290){_0x424cca['push'](_0x424cca['shift']());}};_0xabe8fa(++_0x54d428);}(_0xfba8,0x1d6));var _0x8fba=function(_0x461c30,_0x2e809a){_0x461c30=_0x461c30-0x0;var _0x40ab1c=_0xfba8[_0x461c30];return _0x40ab1c;};'use strict';var _=require(_0x8fba('0x0'));var util=require(_0x8fba('0x1'));var moment=require(_0x8fba('0x2'));var BPromise=require(_0x8fba('0x3'));var rs=require(_0x8fba('0x4'));var fs=require('fs');var Redis=require(_0x8fba('0x5'));var db=require(_0x8fba('0x6'))['db'];var utils=require(_0x8fba('0x7'));var logger=require(_0x8fba('0x8'))('rpc');var config=require(_0x8fba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8fba('0xa')][_0x8fba('0xb')]({'port':0x232a});config[_0x8fba('0xc')]=_[_0x8fba('0xd')](config[_0x8fba('0xc')],{'host':_0x8fba('0xe'),'port':0x18eb});var socket=require(_0x8fba('0xf'))(new Redis(config['redis']));require(_0x8fba('0x10'))['register'](socket);function respondWithRpcPromise(_0x352eda,_0x228103,_0x3816fc){return new BPromise(function(_0x139921,_0x47dda0){return client[_0x8fba('0x11')](_0x352eda,_0x3816fc)[_0x8fba('0x12')](function(_0x526513){logger[_0x8fba('0x13')](_0x8fba('0x14'),_0x228103,'request\x20sent');logger['debug'](_0x8fba('0x15'),_0x228103,'request\x20sent',JSON[_0x8fba('0x16')](_0x526513));if(_0x526513[_0x8fba('0x17')]){if(_0x526513[_0x8fba('0x17')][_0x8fba('0x18')]===0x1f4){logger[_0x8fba('0x17')](_0x8fba('0x14'),_0x228103,_0x526513['error']['message']);return _0x47dda0(_0x526513[_0x8fba('0x17')][_0x8fba('0x19')]);}logger[_0x8fba('0x17')](_0x8fba('0x14'),_0x228103,_0x526513[_0x8fba('0x17')][_0x8fba('0x19')]);return _0x139921(_0x526513['error'][_0x8fba('0x19')]);}else{logger[_0x8fba('0x13')](_0x8fba('0x14'),_0x228103,_0x8fba('0x1a'));_0x139921(_0x526513[_0x8fba('0x1b')][_0x8fba('0x19')]);}})[_0x8fba('0x1c')](function(_0x1e9cf9){logger['error'](_0x8fba('0x14'),_0x228103,_0x1e9cf9);_0x47dda0(_0x1e9cf9);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index ba479a5..81ee685 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 _0x5d43=['length','./userProfile.events','save','update','emit','removeListener','register'];(function(_0x1c199c,_0x592ae0){var _0x47772a=function(_0x1939ef){while(--_0x1939ef){_0x1c199c['push'](_0x1c199c['shift']());}};_0x47772a(++_0x592ae0);}(_0x5d43,0x119));var _0x35d4=function(_0x2aad8e,_0x6341cd){_0x2aad8e=_0x2aad8e-0x0;var _0x32218b=_0x5d43[_0x2aad8e];return _0x32218b;};'use strict';var UserProfileEvents=require(_0x35d4('0x0'));var events=[_0x35d4('0x1'),'remove',_0x35d4('0x2')];function createListener(_0x50e0f1,_0x663443){return function(_0x18a039){_0x663443[_0x35d4('0x3')](_0x50e0f1,_0x18a039);};}function removeListener(_0x5e9349,_0x177588){return function(){UserProfileEvents[_0x35d4('0x4')](_0x5e9349,_0x177588);};}exports[_0x35d4('0x5')]=function(_0x324b69){for(var _0x366ae9=0x0,_0x414ba9=events[_0x35d4('0x6')];_0x366ae9<_0x414ba9;_0x366ae9++){var _0x454ed4=events[_0x366ae9];var _0x19ee44=createListener('userProfile:'+_0x454ed4,_0x324b69);UserProfileEvents['on'](_0x454ed4,_0x19ee44);}}; \ No newline at end of file +var _0x3187=['emit','removeListener','register','length','./userProfile.events','save','remove'];(function(_0xdfc87d,_0x28e1a5){var _0x4e2a5e=function(_0x55f2f7){while(--_0x55f2f7){_0xdfc87d['push'](_0xdfc87d['shift']());}};_0x4e2a5e(++_0x28e1a5);}(_0x3187,0x1c4));var _0x7318=function(_0x5a08ef,_0x9caee2){_0x5a08ef=_0x5a08ef-0x0;var _0x37ed82=_0x3187[_0x5a08ef];return _0x37ed82;};'use strict';var UserProfileEvents=require(_0x7318('0x0'));var events=[_0x7318('0x1'),_0x7318('0x2'),'update'];function createListener(_0x111fd8,_0xc70fe0){return function(_0x4c63e4){_0xc70fe0[_0x7318('0x3')](_0x111fd8,_0x4c63e4);};}function removeListener(_0x49f1da,_0x13d8f6){return function(){UserProfileEvents[_0x7318('0x4')](_0x49f1da,_0x13d8f6);};}exports[_0x7318('0x5')]=function(_0xd0e0da){for(var _0x428019=0x0,_0x153acb=events[_0x7318('0x6')];_0x428019<_0x153acb;_0x428019++){var _0x5ba41c=events[_0x428019];var _0x4765fd=createListener('userProfile:'+_0x5ba41c,_0xd0e0da);UserProfileEvents['on'](_0x5ba41c,_0x4765fd);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 14b3e7e..c8de2ab 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 _0x0ac2=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x363492,_0x3fd79a){var _0x47dc66=function(_0x1bef47){while(--_0x1bef47){_0x363492['push'](_0x363492['shift']());}};_0x47dc66(++_0x3fd79a);}(_0x0ac2,0x12b));var _0x20ac=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0ac2[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x20ac('0x0'));var util=require('util');var path=require(_0x20ac('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20ac('0x2')]();var fs_extra=require(_0x20ac('0x3'));var auth=require(_0x20ac('0x4'));var interaction=require(_0x20ac('0x5'));var config=require(_0x20ac('0x6'));var controller=require(_0x20ac('0x7'));router[_0x20ac('0x8')]('/',auth['isAuthenticated'](),controller[_0x20ac('0x9')]);router[_0x20ac('0x8')](_0x20ac('0xa'),auth[_0x20ac('0xb')](),controller[_0x20ac('0xc')]);router[_0x20ac('0x8')](_0x20ac('0xd'),auth[_0x20ac('0xb')](),controller[_0x20ac('0xe')]);router[_0x20ac('0xf')]('/',auth[_0x20ac('0xb')](),controller[_0x20ac('0x10')]);router['put'](_0x20ac('0xd'),auth['isAuthenticated'](),controller[_0x20ac('0x11')]);router[_0x20ac('0x12')](_0x20ac('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x31fb=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0x31fb,0x1cf));var _0xb31f=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x31fb[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0xb31f('0x0'));var util=require(_0xb31f('0x1'));var path=require(_0xb31f('0x2'));var timeout=require(_0xb31f('0x3'));var express=require(_0xb31f('0x4'));var router=express[_0xb31f('0x5')]();var fs_extra=require(_0xb31f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb31f('0x7'));var config=require(_0xb31f('0x8'));var controller=require(_0xb31f('0x9'));router['get']('/',auth[_0xb31f('0xa')](),controller[_0xb31f('0xb')]);router[_0xb31f('0xc')](_0xb31f('0xd'),auth[_0xb31f('0xa')](),controller[_0xb31f('0xe')]);router[_0xb31f('0xc')](_0xb31f('0xf'),auth[_0xb31f('0xa')](),controller[_0xb31f('0x10')]);router[_0xb31f('0x11')]('/',auth[_0xb31f('0xa')](),controller[_0xb31f('0x12')]);router[_0xb31f('0x13')](_0xb31f('0xf'),auth['isAuthenticated'](),controller[_0xb31f('0x14')]);router[_0xb31f('0x15')](_0xb31f('0xf'),auth[_0xb31f('0xa')](),controller[_0xb31f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index bd772d0..11e6143 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 _0x0417=['sequelize','exports','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0417,0x17d));var _0x7041=function(_0x20d13b,_0x343bea){_0x20d13b=_0x20d13b-0x0;var _0x268e1a=_0x0417[_0x20d13b];return _0x268e1a;};'use strict';var Sequelize=require(_0x7041('0x0'));module[_0x7041('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x7041('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6967=['sequelize','exports','STRING'];(function(_0x1bd73b,_0x3de91e){var _0x15490=function(_0x5bce5d){while(--_0x5bce5d){_0x1bd73b['push'](_0x1bd73b['shift']());}};_0x15490(++_0x3de91e);}(_0x6967,0x78));var _0x7696=function(_0x1d0bc5,_0x2f6d77){_0x1d0bc5=_0x1d0bc5-0x0;var _0x2124cc=_0x6967[_0x1d0bc5];return _0x2124cc;};'use strict';var Sequelize=require(_0x7696('0x0'));module[_0x7696('0x1')]={'name':{'type':Sequelize[_0x7696('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x7696('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 0ba18b9..c37bab0 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 _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3767a8,_0x58a80e){var _0x36b1d7=function(_0x3bcf4b){while(--_0x3bcf4b){_0x3767a8['push'](_0x3767a8['shift']());}};_0x36b1d7(++_0x58a80e);}(_0x4975,0x86));var _0x5497=function(_0x456b8e,_0x5d955f){_0x456b8e=_0x456b8e-0x0;var _0x1189fc=_0x4975[_0x456b8e];return _0x1189fc;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file +var _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x140fd6,_0x5d8037){var _0x16a6ad=function(_0x5adbf7){while(--_0x5adbf7){_0x140fd6['push'](_0x140fd6['shift']());}};_0x16a6ad(++_0x5d8037);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2053f1,_0x46e45d){_0x2053f1=_0x2053f1-0x0;var _0x4d80d2=_0x5f2f[_0x2053f1];return _0x4d80d2;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4c06568..1dff911 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 _0x41b4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0xf9ac86,_0x55ee59){var _0x441c03=function(_0x311534){while(--_0x311534){_0xf9ac86['push'](_0xf9ac86['shift']());}};_0x441c03(++_0x55ee59);}(_0x41b4,0x150));var _0x441b=function(_0x1f8921,_0x38bd21){_0x1f8921=_0x1f8921-0x0;var _0x2c2f34=_0x41b4[_0x1f8921];return _0x2c2f34;};'use strict';var _=require(_0x441b('0x0'));var util=require(_0x441b('0x1'));var logger=require(_0x441b('0x2'))(_0x441b('0x3'));var moment=require(_0x441b('0x4'));var BPromise=require(_0x441b('0x5'));var rp=require(_0x441b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x441b('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x4f85ce,_0x578790){return _0x4f85ce['define'](_0x441b('0x8'),attributes,{'tableName':_0x441b('0x9'),'paranoid':![],'indexes':[{'name':_0x441b('0xa'),'fields':[_0x441b('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7ec=['define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x2cc3ba,_0x348627){var _0x48b125=function(_0x7f409){while(--_0x7f409){_0x2cc3ba['push'](_0x2cc3ba['shift']());}};_0x48b125(++_0x348627);}(_0xc7ec,0x1b6));var _0xcc7e=function(_0x484e74,_0x4e62bd){_0x484e74=_0x484e74-0x0;var _0x2874fa=_0xc7ec[_0x484e74];return _0x2874fa;};'use strict';var _=require(_0xcc7e('0x0'));var util=require(_0xcc7e('0x1'));var logger=require('../../config/logger')(_0xcc7e('0x2'));var moment=require('moment');var BPromise=require(_0xcc7e('0x3'));var rp=require(_0xcc7e('0x4'));var fs=require('fs');var path=require(_0xcc7e('0x5'));var rimraf=require(_0xcc7e('0x6'));var config=require(_0xcc7e('0x7'));var attributes=require(_0xcc7e('0x8'));module[_0xcc7e('0x9')]=function(_0x406f10,_0x198c71){return _0x406f10[_0xcc7e('0xa')](_0xcc7e('0xb'),attributes,{'tableName':_0xcc7e('0xc'),'paranoid':![],'indexes':[{'name':_0xcc7e('0xd'),'fields':[_0xcc7e('0xe'),_0xcc7e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 59ca009..d47f057 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 _0xa118=['request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1feee3,_0x34af40){var _0x6225e6=function(_0x3d8aee){while(--_0x3d8aee){_0x1feee3['push'](_0x1feee3['shift']());}};_0x6225e6(++_0x34af40);}(_0xa118,0x90));var _0x8a11=function(_0x272eb7,_0x35b9d4){_0x272eb7=_0x272eb7-0x0;var _0x1cbc08=_0xa118[_0x272eb7];return _0x1cbc08;};'use strict';var _=require(_0x8a11('0x0'));var util=require(_0x8a11('0x1'));var moment=require('moment');var BPromise=require(_0x8a11('0x2'));var rs=require(_0x8a11('0x3'));var fs=require('fs');var Redis=require(_0x8a11('0x4'));var db=require(_0x8a11('0x5'))['db'];var utils=require(_0x8a11('0x6'));var logger=require(_0x8a11('0x7'))(_0x8a11('0x8'));var config=require(_0x8a11('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32a02a,_0x444f6b,_0x2a598b){return new BPromise(function(_0x11df6b,_0x35265d){return client[_0x8a11('0xa')](_0x32a02a,_0x2a598b)[_0x8a11('0xb')](function(_0x3ae59a){logger[_0x8a11('0xc')](_0x8a11('0xd'),_0x444f6b,_0x8a11('0xe'));logger[_0x8a11('0xf')](_0x8a11('0x10'),_0x444f6b,_0x8a11('0xe'),JSON[_0x8a11('0x11')](_0x3ae59a));if(_0x3ae59a[_0x8a11('0x12')]){if(_0x3ae59a[_0x8a11('0x12')][_0x8a11('0x13')]===0x1f4){logger['error'](_0x8a11('0xd'),_0x444f6b,_0x3ae59a[_0x8a11('0x12')][_0x8a11('0x14')]);return _0x35265d(_0x3ae59a[_0x8a11('0x12')][_0x8a11('0x14')]);}logger[_0x8a11('0x12')](_0x8a11('0xd'),_0x444f6b,_0x3ae59a[_0x8a11('0x12')]['message']);return _0x11df6b(_0x3ae59a[_0x8a11('0x12')][_0x8a11('0x14')]);}else{logger[_0x8a11('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x444f6b,'request\x20sent');_0x11df6b(_0x3ae59a['result'][_0x8a11('0x14')]);}})[_0x8a11('0x15')](function(_0x3a7237){logger[_0x8a11('0x12')](_0x8a11('0xd'),_0x444f6b,_0x3a7237);_0x35265d(_0x3a7237);});});} \ No newline at end of file +var _0x6079=['request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','UserProfileResource,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6079,0x181));var _0x9607=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x6079[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x9607('0x0'));var util=require(_0x9607('0x1'));var moment=require(_0x9607('0x2'));var BPromise=require(_0x9607('0x3'));var rs=require(_0x9607('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9607('0x5'))['db'];var utils=require(_0x9607('0x6'));var logger=require('../../config/logger')(_0x9607('0x7'));var config=require(_0x9607('0x8'));var jayson=require(_0x9607('0x9'));var client=jayson[_0x9607('0xa')][_0x9607('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5f69,_0x513676,_0x23b04a){return new BPromise(function(_0x5d07ea,_0x51739a){return client[_0x9607('0xc')](_0x4f5f69,_0x23b04a)['then'](function(_0x314d7a){logger['info'](_0x9607('0xd'),_0x513676,_0x9607('0xe'));logger[_0x9607('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x513676,_0x9607('0xe'),JSON[_0x9607('0x10')](_0x314d7a));if(_0x314d7a[_0x9607('0x11')]){if(_0x314d7a[_0x9607('0x11')]['code']===0x1f4){logger[_0x9607('0x11')](_0x9607('0xd'),_0x513676,_0x314d7a['error'][_0x9607('0x12')]);return _0x51739a(_0x314d7a[_0x9607('0x11')][_0x9607('0x12')]);}logger[_0x9607('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x513676,_0x314d7a[_0x9607('0x11')]['message']);return _0x5d07ea(_0x314d7a[_0x9607('0x11')][_0x9607('0x12')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x513676,'request\x20sent');_0x5d07ea(_0x314d7a['result'][_0x9607('0x12')]);}})['catch'](function(_0x376a9e){logger[_0x9607('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x513676,_0x376a9e);_0x51739a(_0x376a9e);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 8f8ed53..6f22ef3 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 _0x3843=['describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','index','get','/describe','isAuthenticated'];(function(_0x3a1c29,_0x2fc0aa){var _0x2437cf=function(_0x58b47b){while(--_0x58b47b){_0x3a1c29['push'](_0x3a1c29['shift']());}};_0x2437cf(++_0x2fc0aa);}(_0x3843,0x8d));var _0x3384=function(_0xdab9d4,_0x3a5250){_0xdab9d4=_0xdab9d4-0x0;var _0x58f235=_0x3843[_0xdab9d4];return _0x58f235;};'use strict';var multer=require(_0x3384('0x0'));var util=require(_0x3384('0x1'));var path=require('path');var timeout=require(_0x3384('0x2'));var express=require('express');var router=express[_0x3384('0x3')]();var fs_extra=require(_0x3384('0x4'));var auth=require(_0x3384('0x5'));var interaction=require(_0x3384('0x6'));var config=require(_0x3384('0x7'));var controller=require(_0x3384('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3384('0x9')]);router[_0x3384('0xa')](_0x3384('0xb'),auth[_0x3384('0xc')](),controller[_0x3384('0xd')]);router[_0x3384('0xa')](_0x3384('0xe'),auth[_0x3384('0xc')](),controller[_0x3384('0xf')]);router[_0x3384('0x10')]('/',auth[_0x3384('0xc')](),controller[_0x3384('0x11')]);router[_0x3384('0x12')](_0x3384('0xe'),auth[_0x3384('0xc')](),controller[_0x3384('0x13')]);router['delete'](_0x3384('0xe'),auth['isAuthenticated'](),controller[_0x3384('0x14')]);module[_0x3384('0x15')]=router; \ No newline at end of file +var _0x3feb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x13023b,_0x51328e){var _0x458326=function(_0x24d4cf){while(--_0x24d4cf){_0x13023b['push'](_0x13023b['shift']());}};_0x458326(++_0x51328e);}(_0x3feb,0x19f));var _0xb3fe=function(_0x1432d3,_0x5f1988){_0x1432d3=_0x1432d3-0x0;var _0x582360=_0x3feb[_0x1432d3];return _0x582360;};'use strict';var multer=require(_0xb3fe('0x0'));var util=require(_0xb3fe('0x1'));var path=require(_0xb3fe('0x2'));var timeout=require(_0xb3fe('0x3'));var express=require(_0xb3fe('0x4'));var router=express[_0xb3fe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb3fe('0x6'));var interaction=require(_0xb3fe('0x7'));var config=require(_0xb3fe('0x8'));var controller=require(_0xb3fe('0x9'));router[_0xb3fe('0xa')]('/',auth[_0xb3fe('0xb')](),controller[_0xb3fe('0xc')]);router[_0xb3fe('0xa')](_0xb3fe('0xd'),auth[_0xb3fe('0xb')](),controller['describe']);router[_0xb3fe('0xa')](_0xb3fe('0xe'),auth[_0xb3fe('0xb')](),controller[_0xb3fe('0xf')]);router[_0xb3fe('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb3fe('0x11')]('/:id',auth[_0xb3fe('0xb')](),controller[_0xb3fe('0x12')]);router['delete'](_0xb3fe('0xe'),auth[_0xb3fe('0xb')](),controller[_0xb3fe('0x13')]);module[_0xb3fe('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 2fbd43a..5f4001f 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 _0x5b12=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions'];(function(_0x48abbe,_0x9ac0dd){var _0x56b3ad=function(_0x45a28a){while(--_0x45a28a){_0x48abbe['push'](_0x48abbe['shift']());}};_0x56b3ad(++_0x9ac0dd);}(_0x5b12,0xa3));var _0x25b1=function(_0x3fbc3d,_0x330322){_0x3fbc3d=_0x3fbc3d-0x0;var _0x4bf366=_0x5b12[_0x3fbc3d];return _0x4bf366;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x25b1('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x25b1('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x25b1('0x2')],'set':function(_0x47995b){this[_0x25b1('0x5')]('crudPermissions',_0x47995b?_0x47995b['join'](''):[]);},'get':function(){return this[_0x25b1('0x6')]('crudPermissions')?this['getDataValue'](_0x25b1('0x7'))[_0x25b1('0x8')](''):[];}}}; \ No newline at end of file +var _0xe605=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x403b2b,_0x3e9c25){var _0x5ef7ff=function(_0xe865b8){while(--_0xe865b8){_0x403b2b['push'](_0x403b2b['shift']());}};_0x5ef7ff(++_0x3e9c25);}(_0xe605,0x92));var _0x5e60=function(_0x579be2,_0x31f3e8){_0x579be2=_0x579be2-0x0;var _0x2a81fd=_0xe605[_0x579be2];return _0x2a81fd;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x5e60('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5e60('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5e60('0x2')],'set':function(_0xfe1f64){this[_0x5e60('0x5')](_0x5e60('0x6'),_0xfe1f64?_0xfe1f64[_0x5e60('0x7')](''):[]);},'get':function(){return this[_0x5e60('0x8')](_0x5e60('0x6'))?this[_0x5e60('0x8')]('crudPermissions')[_0x5e60('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c5a17ee..21a0873 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 _0x1ea5=['request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileSection','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','zip-dir'];(function(_0x1a8624,_0x5c8035){var _0x2d96fe=function(_0x30e6bb){while(--_0x30e6bb){_0x1a8624['push'](_0x1a8624['shift']());}};_0x2d96fe(++_0x5c8035);}(_0x1ea5,0xd4));var _0x51ea=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x1ea5[_0x4c7b20];return _0x4872bd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51ea('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51ea('0x1'));var moment=require(_0x51ea('0x2'));var BPromise=require(_0x51ea('0x3'));var Mustache=require(_0x51ea('0x4'));var util=require(_0x51ea('0x5'));var path=require('path');var sox=require(_0x51ea('0x6'));var csv=require(_0x51ea('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51ea('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51ea('0x9'));var deskjs=require(_0x51ea('0xa'));var toCsv=require(_0x51ea('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x51ea('0xb'));var authService=require(_0x51ea('0xc'));var qs=require(_0x51ea('0xd'));var as=require(_0x51ea('0xe'));var hardwareService=require(_0x51ea('0xf'));var logger=require(_0x51ea('0x10'))(_0x51ea('0x11'));var utils=require(_0x51ea('0x12'));var config=require(_0x51ea('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x51ea('0x14'))['db'];function respondWithStatusCode(_0x9e4af2,_0x286d69){_0x286d69=_0x286d69||0xcc;return function(_0x386479){if(_0x386479){return _0x9e4af2[_0x51ea('0x15')](_0x286d69);}return _0x9e4af2[_0x51ea('0x16')](_0x286d69)['end']();};}function respondWithResult(_0x555f38,_0xffcf0c){_0xffcf0c=_0xffcf0c||0xc8;return function(_0x4b97c5){if(_0x4b97c5){return _0x555f38[_0x51ea('0x16')](_0xffcf0c)[_0x51ea('0x17')](_0x4b97c5);}};}function respondWithFilteredResult(_0xc6f81e,_0x229e7b){return function(_0xa2a3ba){if(_0xa2a3ba){var _0x298e93=typeof _0x229e7b[_0x51ea('0x18')]===_0x51ea('0x19')&&typeof _0x229e7b[_0x51ea('0x1a')]===_0x51ea('0x19');var _0x38655e=_0xa2a3ba[_0x51ea('0x1b')];var _0x4f2af1=_0x298e93?0x0:_0x229e7b[_0x51ea('0x18')];var _0x318a70=_0x298e93?_0xa2a3ba['count']:_0x229e7b[_0x51ea('0x18')]+_0x229e7b[_0x51ea('0x1a')];var _0x5c5f9a;if(_0x318a70>=_0x38655e){_0x318a70=_0x38655e;_0x5c5f9a=0xc8;}else{_0x5c5f9a=0xce;}_0xc6f81e['status'](_0x5c5f9a);return _0xc6f81e[_0x51ea('0x1c')](_0x51ea('0x1d'),_0x4f2af1+'-'+_0x318a70+'/'+_0x38655e)[_0x51ea('0x17')](_0xa2a3ba);}return null;};}function patchUpdates(_0x39a42e){return function(_0x1b4543){try{jsonpatch['apply'](_0x1b4543,_0x39a42e,!![]);}catch(_0x4ff089){return BPromise[_0x51ea('0x1e')](_0x4ff089);}return _0x1b4543[_0x51ea('0x1f')]();};}function saveUpdates(_0xaa453,_0x3c5a02){return function(_0x219912){if(_0x219912){return _0x219912[_0x51ea('0x20')](_0xaa453)[_0x51ea('0x21')](function(_0x12e73b){return _0x12e73b;});}return null;};}function removeEntity(_0x184384,_0x39912f){return function(_0x74fe91){if(_0x74fe91){return _0x74fe91[_0x51ea('0x22')]()[_0x51ea('0x21')](function(){_0x184384[_0x51ea('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2689,_0x5883de){return function(_0x2c5b5e){if(!_0x2c5b5e){_0x5b2689['sendStatus'](0x194);}return _0x2c5b5e;};}function handleError(_0x1f446b,_0x46d2fe){_0x46d2fe=_0x46d2fe||0x1f4;return function(_0x2b8441){logger[_0x51ea('0x23')](_0x2b8441[_0x51ea('0x24')]);if(_0x2b8441[_0x51ea('0x25')]){delete _0x2b8441[_0x51ea('0x25')];}_0x1f446b[_0x51ea('0x16')](_0x46d2fe)[_0x51ea('0x26')](_0x2b8441);};}exports['index']=function(_0x2ab0a0,_0x317315){var _0x1edbdf={},_0x484a82={},_0x496883={'count':0x0,'rows':[]};var _0x50f08d=_[_0x51ea('0x27')](db[_0x51ea('0x28')]['rawAttributes'],function(_0x4899dc){return{'name':_0x4899dc[_0x51ea('0x29')],'type':_0x4899dc[_0x51ea('0x2a')][_0x51ea('0x2b')]};});_0x484a82[_0x51ea('0x2c')]=_[_0x51ea('0x27')](_0x50f08d,_0x51ea('0x25'));_0x484a82['query']=_[_0x51ea('0x2d')](_0x2ab0a0[_0x51ea('0x2e')]);_0x484a82[_0x51ea('0x2f')]=_[_0x51ea('0x30')](_0x484a82[_0x51ea('0x2c')],_0x484a82[_0x51ea('0x2e')]);_0x1edbdf[_0x51ea('0x31')]=_[_0x51ea('0x30')](_0x484a82[_0x51ea('0x2c')],qs[_0x51ea('0x32')](_0x2ab0a0['query']['fields']));_0x1edbdf[_0x51ea('0x31')]=_0x1edbdf[_0x51ea('0x31')][_0x51ea('0x33')]?_0x1edbdf['attributes']:_0x484a82[_0x51ea('0x2c')];if(!_0x2ab0a0[_0x51ea('0x2e')]['hasOwnProperty']('nolimit')){_0x1edbdf['limit']=qs[_0x51ea('0x1a')](_0x2ab0a0[_0x51ea('0x2e')][_0x51ea('0x1a')]);_0x1edbdf[_0x51ea('0x18')]=qs[_0x51ea('0x18')](_0x2ab0a0['query'][_0x51ea('0x18')]);}_0x1edbdf[_0x51ea('0x34')]=qs[_0x51ea('0x35')](_0x2ab0a0['query'][_0x51ea('0x35')]);_0x1edbdf[_0x51ea('0x36')]=qs['filters'](_[_0x51ea('0x37')](_0x2ab0a0[_0x51ea('0x2e')],_0x484a82['filters']),_0x50f08d);if(_0x2ab0a0[_0x51ea('0x2e')][_0x51ea('0x38')]){_0x1edbdf[_0x51ea('0x36')]=_[_0x51ea('0x39')](_0x1edbdf[_0x51ea('0x36')],{'$or':_['map'](_0x50f08d,function(_0x35e1ad){if(_0x35e1ad[_0x51ea('0x2a')]!==_0x51ea('0x3a')){var _0x2b68db={};_0x2b68db[_0x35e1ad[_0x51ea('0x25')]]={'$like':'%'+_0x2ab0a0[_0x51ea('0x2e')]['filter']+'%'};return _0x2b68db;}})});}_0x1edbdf=_[_0x51ea('0x39')]({},_0x1edbdf,_0x2ab0a0[_0x51ea('0x3b')]);var _0x41ef6f={'where':_0x1edbdf[_0x51ea('0x36')]};return db[_0x51ea('0x28')][_0x51ea('0x1b')](_0x41ef6f)['then'](function(_0x49ed4d){_0x496883[_0x51ea('0x1b')]=_0x49ed4d;if(_0x2ab0a0['query'][_0x51ea('0x3c')]){_0x1edbdf[_0x51ea('0x3d')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x1edbdf);})[_0x51ea('0x21')](function(_0x24b3da){_0x496883[_0x51ea('0x3e')]=_0x24b3da;return _0x496883;})[_0x51ea('0x21')](respondWithFilteredResult(_0x317315,_0x1edbdf))[_0x51ea('0x3f')](handleError(_0x317315,null));};exports[_0x51ea('0x40')]=function(_0x3fd2fa,_0x21936a){var _0x58b61f={'raw':![],'where':{'id':_0x3fd2fa[_0x51ea('0x41')]['id']}},_0x150112={};_0x150112['model']=_[_0x51ea('0x2d')](db[_0x51ea('0x28')][_0x51ea('0x42')]);_0x150112[_0x51ea('0x2e')]=_[_0x51ea('0x2d')](_0x3fd2fa[_0x51ea('0x2e')]);_0x150112[_0x51ea('0x2f')]=_[_0x51ea('0x30')](_0x150112[_0x51ea('0x2c')],_0x150112[_0x51ea('0x2e')]);_0x58b61f[_0x51ea('0x31')]=_['intersection'](_0x150112[_0x51ea('0x2c')],qs[_0x51ea('0x32')](_0x3fd2fa[_0x51ea('0x2e')]['fields']));_0x58b61f[_0x51ea('0x31')]=_0x58b61f[_0x51ea('0x31')][_0x51ea('0x33')]?_0x58b61f['attributes']:_0x150112[_0x51ea('0x2c')];if(_0x3fd2fa[_0x51ea('0x2e')][_0x51ea('0x3c')]){_0x58b61f[_0x51ea('0x3d')]=[{'all':!![]}];}_0x58b61f=_[_0x51ea('0x39')]({},_0x58b61f,_0x3fd2fa[_0x51ea('0x3b')]);return db['UserProfileSection'][_0x51ea('0x43')](_0x58b61f)[_0x51ea('0x21')](handleEntityNotFound(_0x21936a,null))[_0x51ea('0x21')](respondWithResult(_0x21936a,null))['catch'](handleError(_0x21936a,null));};exports[_0x51ea('0x44')]=function(_0x4b6723,_0x10f233){return db[_0x51ea('0x28')][_0x51ea('0x44')](_0x4b6723[_0x51ea('0x45')],{})[_0x51ea('0x21')](respondWithResult(_0x10f233,0xc9))[_0x51ea('0x3f')](handleError(_0x10f233,null));};exports['update']=function(_0x42a70a,_0x251b04){if(_0x42a70a[_0x51ea('0x45')]['id']){delete _0x42a70a[_0x51ea('0x45')]['id'];}return db[_0x51ea('0x28')][_0x51ea('0x43')]({'where':{'id':_0x42a70a['params']['id']}})[_0x51ea('0x21')](handleEntityNotFound(_0x251b04,null))[_0x51ea('0x21')](saveUpdates(_0x42a70a[_0x51ea('0x45')],null))['then'](respondWithResult(_0x251b04,null))['catch'](handleError(_0x251b04,null));};exports[_0x51ea('0x22')]=function(_0x3f9a14,_0x27e0f8){return db['UserProfileSection'][_0x51ea('0x43')]({'where':{'id':_0x3f9a14[_0x51ea('0x41')]['id']}})[_0x51ea('0x21')](handleEntityNotFound(_0x27e0f8,null))[_0x51ea('0x21')](removeEntity(_0x27e0f8,null))[_0x51ea('0x3f')](handleError(_0x27e0f8,null));};exports[_0x51ea('0x46')]=function(_0x584c83,_0x2e9c72){return db[_0x51ea('0x28')]['describe']()[_0x51ea('0x21')](respondWithResult(_0x2e9c72,null))[_0x51ea('0x3f')](handleError(_0x2e9c72,null));}; \ No newline at end of file +var _0xdb86=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','type','options','where','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb86,0xd3));var _0x6db8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb86[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6db8('0x0'));var rimraf=require(_0x6db8('0x1'));var zipdir=require(_0x6db8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6db8('0x3'));var moment=require(_0x6db8('0x4'));var BPromise=require(_0x6db8('0x5'));var Mustache=require('mustache');var util=require(_0x6db8('0x6'));var path=require(_0x6db8('0x7'));var sox=require(_0x6db8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6db8('0x9'));var _=require(_0x6db8('0xa'));var squel=require(_0x6db8('0xb'));var crypto=require(_0x6db8('0xc'));var jsforce=require(_0x6db8('0xd'));var deskjs=require(_0x6db8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6db8('0xf'));var Papa=require(_0x6db8('0x10'));var Redis=require(_0x6db8('0x11'));var authService=require(_0x6db8('0x12'));var qs=require(_0x6db8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6db8('0x14'));var logger=require(_0x6db8('0x15'))(_0x6db8('0x16'));var utils=require(_0x6db8('0x17'));var config=require(_0x6db8('0x18'));var licenseUtil=require(_0x6db8('0x19'));var db=require(_0x6db8('0x1a'))['db'];function respondWithStatusCode(_0x123559,_0x548587){_0x548587=_0x548587||0xcc;return function(_0x1f63e0){if(_0x1f63e0){return _0x123559[_0x6db8('0x1b')](_0x548587);}return _0x123559['status'](_0x548587)[_0x6db8('0x1c')]();};}function respondWithResult(_0x416c96,_0x2c6683){_0x2c6683=_0x2c6683||0xc8;return function(_0x2203ef){if(_0x2203ef){return _0x416c96['status'](_0x2c6683)['json'](_0x2203ef);}};}function respondWithFilteredResult(_0x2b0ba9,_0x2c8cc4){return function(_0x3805b6){if(_0x3805b6){var _0x37b53b=typeof _0x2c8cc4[_0x6db8('0x1d')]===_0x6db8('0x1e')&&typeof _0x2c8cc4[_0x6db8('0x1f')]==='undefined';var _0x55a0c2=_0x3805b6[_0x6db8('0x20')];var _0x5837c5=_0x37b53b?0x0:_0x2c8cc4[_0x6db8('0x1d')];var _0x42530f=_0x37b53b?_0x3805b6[_0x6db8('0x20')]:_0x2c8cc4[_0x6db8('0x1d')]+_0x2c8cc4[_0x6db8('0x1f')];var _0x5c2085;if(_0x42530f>=_0x55a0c2){_0x42530f=_0x55a0c2;_0x5c2085=0xc8;}else{_0x5c2085=0xce;}_0x2b0ba9[_0x6db8('0x21')](_0x5c2085);return _0x2b0ba9[_0x6db8('0x22')]('Content-Range',_0x5837c5+'-'+_0x42530f+'/'+_0x55a0c2)[_0x6db8('0x23')](_0x3805b6);}return null;};}function patchUpdates(_0x98b343){return function(_0x5e83b0){try{jsonpatch[_0x6db8('0x24')](_0x5e83b0,_0x98b343,!![]);}catch(_0x2b02ef){return BPromise[_0x6db8('0x25')](_0x2b02ef);}return _0x5e83b0[_0x6db8('0x26')]();};}function saveUpdates(_0x1aad43,_0xb8f86b){return function(_0x57dcff){if(_0x57dcff){return _0x57dcff[_0x6db8('0x27')](_0x1aad43)[_0x6db8('0x28')](function(_0xccbce8){return _0xccbce8;});}return null;};}function removeEntity(_0x19a434,_0x24d72a){return function(_0x49259c){if(_0x49259c){return _0x49259c[_0x6db8('0x29')]()[_0x6db8('0x28')](function(){_0x19a434['status'](0xcc)[_0x6db8('0x1c')]();});}};}function handleEntityNotFound(_0x335f4f,_0x187cdc){return function(_0x3687dc){if(!_0x3687dc){_0x335f4f[_0x6db8('0x1b')](0x194);}return _0x3687dc;};}function handleError(_0x77d05b,_0x40d661){_0x40d661=_0x40d661||0x1f4;return function(_0xf3031f){logger[_0x6db8('0x2a')](_0xf3031f[_0x6db8('0x2b')]);if(_0xf3031f[_0x6db8('0x2c')]){delete _0xf3031f['name'];}_0x77d05b[_0x6db8('0x21')](_0x40d661)[_0x6db8('0x2d')](_0xf3031f);};}exports[_0x6db8('0x2e')]=function(_0x48bf90,_0x2b6a0d){var _0x4b7419={},_0x271613={},_0x157819={'count':0x0,'rows':[]};var _0x48c54f=_[_0x6db8('0x2f')](db[_0x6db8('0x30')][_0x6db8('0x31')],function(_0xd5b27c){return{'name':_0xd5b27c['fieldName'],'type':_0xd5b27c['type'][_0x6db8('0x32')]};});_0x271613['model']=_['map'](_0x48c54f,'name');_0x271613[_0x6db8('0x33')]=_['keys'](_0x48bf90[_0x6db8('0x33')]);_0x271613[_0x6db8('0x34')]=_[_0x6db8('0x35')](_0x271613[_0x6db8('0x36')],_0x271613[_0x6db8('0x33')]);_0x4b7419[_0x6db8('0x37')]=_['intersection'](_0x271613[_0x6db8('0x36')],qs[_0x6db8('0x38')](_0x48bf90[_0x6db8('0x33')][_0x6db8('0x38')]));_0x4b7419[_0x6db8('0x37')]=_0x4b7419[_0x6db8('0x37')][_0x6db8('0x39')]?_0x4b7419[_0x6db8('0x37')]:_0x271613['model'];if(!_0x48bf90[_0x6db8('0x33')][_0x6db8('0x3a')](_0x6db8('0x3b'))){_0x4b7419[_0x6db8('0x1f')]=qs[_0x6db8('0x1f')](_0x48bf90[_0x6db8('0x33')]['limit']);_0x4b7419[_0x6db8('0x1d')]=qs[_0x6db8('0x1d')](_0x48bf90[_0x6db8('0x33')][_0x6db8('0x1d')]);}_0x4b7419['order']=qs[_0x6db8('0x3c')](_0x48bf90[_0x6db8('0x33')][_0x6db8('0x3c')]);_0x4b7419['where']=qs[_0x6db8('0x34')](_[_0x6db8('0x3d')](_0x48bf90[_0x6db8('0x33')],_0x271613[_0x6db8('0x34')]),_0x48c54f);if(_0x48bf90[_0x6db8('0x33')][_0x6db8('0x3e')]){_0x4b7419['where']=_[_0x6db8('0x3f')](_0x4b7419['where'],{'$or':_[_0x6db8('0x2f')](_0x48c54f,function(_0x4aea01){if(_0x4aea01[_0x6db8('0x40')]!=='VIRTUAL'){var _0x39df76={};_0x39df76[_0x4aea01[_0x6db8('0x2c')]]={'$like':'%'+_0x48bf90[_0x6db8('0x33')][_0x6db8('0x3e')]+'%'};return _0x39df76;}})});}_0x4b7419=_[_0x6db8('0x3f')]({},_0x4b7419,_0x48bf90[_0x6db8('0x41')]);var _0x2572f5={'where':_0x4b7419[_0x6db8('0x42')]};return db[_0x6db8('0x30')]['count'](_0x2572f5)[_0x6db8('0x28')](function(_0x3c1d3a){_0x157819[_0x6db8('0x20')]=_0x3c1d3a;if(_0x48bf90[_0x6db8('0x33')][_0x6db8('0x43')]){_0x4b7419[_0x6db8('0x44')]=[{'all':!![]}];}return db[_0x6db8('0x30')]['findAll'](_0x4b7419);})[_0x6db8('0x28')](function(_0x2b32ad){_0x157819[_0x6db8('0x45')]=_0x2b32ad;return _0x157819;})[_0x6db8('0x28')](respondWithFilteredResult(_0x2b6a0d,_0x4b7419))[_0x6db8('0x46')](handleError(_0x2b6a0d,null));};exports[_0x6db8('0x47')]=function(_0x37a47f,_0x44c6cf){var _0x4793c1={'raw':![],'where':{'id':_0x37a47f[_0x6db8('0x48')]['id']}},_0x19eda3={};_0x19eda3[_0x6db8('0x36')]=_['keys'](db[_0x6db8('0x30')][_0x6db8('0x31')]);_0x19eda3[_0x6db8('0x33')]=_[_0x6db8('0x49')](_0x37a47f[_0x6db8('0x33')]);_0x19eda3[_0x6db8('0x34')]=_[_0x6db8('0x35')](_0x19eda3[_0x6db8('0x36')],_0x19eda3[_0x6db8('0x33')]);_0x4793c1['attributes']=_['intersection'](_0x19eda3[_0x6db8('0x36')],qs[_0x6db8('0x38')](_0x37a47f[_0x6db8('0x33')][_0x6db8('0x38')]));_0x4793c1[_0x6db8('0x37')]=_0x4793c1[_0x6db8('0x37')][_0x6db8('0x39')]?_0x4793c1[_0x6db8('0x37')]:_0x19eda3[_0x6db8('0x36')];if(_0x37a47f[_0x6db8('0x33')]['includeAll']){_0x4793c1[_0x6db8('0x44')]=[{'all':!![]}];}_0x4793c1=_['merge']({},_0x4793c1,_0x37a47f[_0x6db8('0x41')]);return db['UserProfileSection'][_0x6db8('0x4a')](_0x4793c1)[_0x6db8('0x28')](handleEntityNotFound(_0x44c6cf,null))[_0x6db8('0x28')](respondWithResult(_0x44c6cf,null))[_0x6db8('0x46')](handleError(_0x44c6cf,null));};exports[_0x6db8('0x4b')]=function(_0x31c584,_0x1921d4){return db[_0x6db8('0x30')][_0x6db8('0x4b')](_0x31c584[_0x6db8('0x4c')],{})[_0x6db8('0x28')](respondWithResult(_0x1921d4,0xc9))[_0x6db8('0x46')](handleError(_0x1921d4,null));};exports['update']=function(_0x45280f,_0xdc709e){if(_0x45280f['body']['id']){delete _0x45280f[_0x6db8('0x4c')]['id'];}return db[_0x6db8('0x30')][_0x6db8('0x4a')]({'where':{'id':_0x45280f[_0x6db8('0x48')]['id']}})[_0x6db8('0x28')](handleEntityNotFound(_0xdc709e,null))[_0x6db8('0x28')](saveUpdates(_0x45280f[_0x6db8('0x4c')],null))['then'](respondWithResult(_0xdc709e,null))[_0x6db8('0x46')](handleError(_0xdc709e,null));};exports[_0x6db8('0x29')]=function(_0x36f205,_0x28eb55){return db[_0x6db8('0x30')][_0x6db8('0x4a')]({'where':{'id':_0x36f205['params']['id']}})['then'](handleEntityNotFound(_0x28eb55,null))[_0x6db8('0x28')](removeEntity(_0x28eb55,null))[_0x6db8('0x46')](handleError(_0x28eb55,null));};exports[_0x6db8('0x4d')]=function(_0x677fd0,_0x4f3c57){return db[_0x6db8('0x30')]['describe']()[_0x6db8('0x28')](respondWithResult(_0x4f3c57,null))[_0x6db8('0x46')](handleError(_0x4f3c57,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 630d25c..89616cf 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 _0x8945=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','compositeIndex','sectionId','userProfileId','util'];(function(_0x40737a,_0x424056){var _0x35c127=function(_0x44feb0){while(--_0x44feb0){_0x40737a['push'](_0x40737a['shift']());}};_0x35c127(++_0x424056);}(_0x8945,0x12b));var _0x5894=function(_0x3ae4b8,_0x53fffc){_0x3ae4b8=_0x3ae4b8-0x0;var _0x4bfddc=_0x8945[_0x3ae4b8];return _0x4bfddc;};'use strict';var _=require('lodash');var util=require(_0x5894('0x0'));var logger=require(_0x5894('0x1'))(_0x5894('0x2'));var moment=require(_0x5894('0x3'));var BPromise=require(_0x5894('0x4'));var rp=require(_0x5894('0x5'));var fs=require('fs');var path=require(_0x5894('0x6'));var rimraf=require(_0x5894('0x7'));var config=require(_0x5894('0x8'));var attributes=require(_0x5894('0x9'));module['exports']=function(_0x71d30a,_0x3c082e){return _0x71d30a[_0x5894('0xa')](_0x5894('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x5894('0xc'),'fields':[_0x5894('0xd'),_0x5894('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f80=['userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x8f80,0xa6));var _0x08f8=function(_0x54485b,_0x8f1d43){_0x54485b=_0x54485b-0x0;var _0x284ba9=_0x8f80[_0x54485b];return _0x284ba9;};'use strict';var _=require(_0x08f8('0x0'));var util=require(_0x08f8('0x1'));var logger=require(_0x08f8('0x2'))(_0x08f8('0x3'));var moment=require('moment');var BPromise=require(_0x08f8('0x4'));var rp=require(_0x08f8('0x5'));var fs=require('fs');var path=require(_0x08f8('0x6'));var rimraf=require(_0x08f8('0x7'));var config=require('../../config/environment');var attributes=require(_0x08f8('0x8'));module[_0x08f8('0x9')]=function(_0x5a23c5,_0x53f829){return _0x5a23c5[_0x08f8('0xa')](_0x08f8('0xb'),attributes,{'tableName':_0x08f8('0xc'),'paranoid':![],'indexes':[{'name':_0x08f8('0xd'),'fields':['sectionId',_0x08f8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 8424c62..9602d81 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 _0xa8f5=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s'];(function(_0x1ad3ca,_0xe0a0c2){var _0x2cd02a=function(_0xbecd21){while(--_0xbecd21){_0x1ad3ca['push'](_0x1ad3ca['shift']());}};_0x2cd02a(++_0xe0a0c2);}(_0xa8f5,0xb1));var _0x5a8f=function(_0x339c23,_0x541ff6){_0x339c23=_0x339c23-0x0;var _0x5bf134=_0xa8f5[_0x339c23];return _0x5bf134;};'use strict';var _=require(_0x5a8f('0x0'));var util=require(_0x5a8f('0x1'));var moment=require('moment');var BPromise=require(_0x5a8f('0x2'));var rs=require(_0x5a8f('0x3'));var fs=require('fs');var Redis=require(_0x5a8f('0x4'));var db=require(_0x5a8f('0x5'))['db'];var utils=require(_0x5a8f('0x6'));var logger=require(_0x5a8f('0x7'))(_0x5a8f('0x8'));var config=require(_0x5a8f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5a8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c0c45,_0x24e00c,_0x317cb7){return new BPromise(function(_0x2ba0de,_0x1b8e07){return client[_0x5a8f('0xb')](_0x5c0c45,_0x317cb7)[_0x5a8f('0xc')](function(_0x2c8174){logger[_0x5a8f('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x24e00c,_0x5a8f('0xe'));logger['debug'](_0x5a8f('0xf'),_0x24e00c,_0x5a8f('0xe'),JSON[_0x5a8f('0x10')](_0x2c8174));if(_0x2c8174[_0x5a8f('0x11')]){if(_0x2c8174[_0x5a8f('0x11')][_0x5a8f('0x12')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x24e00c,_0x2c8174[_0x5a8f('0x11')]['message']);return _0x1b8e07(_0x2c8174[_0x5a8f('0x11')][_0x5a8f('0x13')]);}logger[_0x5a8f('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x24e00c,_0x2c8174['error'][_0x5a8f('0x13')]);return _0x2ba0de(_0x2c8174[_0x5a8f('0x11')][_0x5a8f('0x13')]);}else{logger[_0x5a8f('0xd')](_0x5a8f('0x14'),_0x24e00c,'request\x20sent');_0x2ba0de(_0x2c8174[_0x5a8f('0x15')][_0x5a8f('0x13')]);}})['catch'](function(_0xe71c7d){logger['error'](_0x5a8f('0x14'),_0x24e00c,_0xe71c7d);_0x1b8e07(_0xe71c7d);});});} \ No newline at end of file +var _0xfa9e=['../../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','catch','lodash','moment','randomstring'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfa9e,0xad));var _0xefa9=function(_0xfef374,_0x35bf34){_0xfef374=_0xfef374-0x0;var _0xa0ef74=_0xfa9e[_0xfef374];return _0xa0ef74;};'use strict';var _=require(_0xefa9('0x0'));var util=require('util');var moment=require(_0xefa9('0x1'));var BPromise=require('bluebird');var rs=require(_0xefa9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xefa9('0x3'));var logger=require(_0xefa9('0x4'))(_0xefa9('0x5'));var config=require(_0xefa9('0x6'));var jayson=require(_0xefa9('0x7'));var client=jayson[_0xefa9('0x8')][_0xefa9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xae770c,_0x4e941e,_0x3b555a){return new BPromise(function(_0x5a5583,_0x59b36e){return client[_0xefa9('0xa')](_0xae770c,_0x3b555a)[_0xefa9('0xb')](function(_0x9b9586){logger[_0xefa9('0xc')](_0xefa9('0xd'),_0x4e941e,_0xefa9('0xe'));logger[_0xefa9('0xf')](_0xefa9('0x10'),_0x4e941e,_0xefa9('0xe'),JSON[_0xefa9('0x11')](_0x9b9586));if(_0x9b9586[_0xefa9('0x12')]){if(_0x9b9586[_0xefa9('0x12')][_0xefa9('0x13')]===0x1f4){logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x9b9586[_0xefa9('0x12')][_0xefa9('0x14')]);return _0x59b36e(_0x9b9586['error'][_0xefa9('0x14')]);}logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x9b9586[_0xefa9('0x12')]['message']);return _0x5a5583(_0x9b9586['error'][_0xefa9('0x14')]);}else{logger['info'](_0xefa9('0xd'),_0x4e941e,_0xefa9('0xe'));_0x5a5583(_0x9b9586['result'][_0xefa9('0x14')]);}})[_0xefa9('0x15')](function(_0x1f50dd){logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x1f50dd);_0x59b36e(_0x1f50dd);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index b128129..2cfe267 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x143620,_0x2738da){var _0x24fcec=function(_0x4ce62c){while(--_0x4ce62c){_0x143620['push'](_0x143620['shift']());}};_0x24fcec(++_0x2738da);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e9b4245..aa8c952 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 _0xee10=['sequelize','INTEGER'];(function(_0x202b04,_0x3f067d){var _0x21a9b4=function(_0x5b3c7b){while(--_0x5b3c7b){_0x202b04['push'](_0x202b04['shift']());}};_0x21a9b4(++_0x3f067d);}(_0xee10,0x66));var _0x0ee1=function(_0x4183ea,_0xeb7bb3){_0x4183ea=_0x4183ea-0x0;var _0x3873e4=_0xee10[_0x4183ea];return _0x3873e4;};'use strict';var Sequelize=require(_0x0ee1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0ee1('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf9f4=['exports','INTEGER','sequelize'];(function(_0x525c62,_0x5a5412){var _0x37d701=function(_0x21675d){while(--_0x21675d){_0x525c62['push'](_0x525c62['shift']());}};_0x37d701(++_0x5a5412);}(_0xf9f4,0x1be));var _0x4f9f=function(_0xff22ad,_0x1a5193){_0xff22ad=_0xff22ad-0x0;var _0x2d7273=_0xf9f4[_0xff22ad];return _0x2d7273;};'use strict';var Sequelize=require(_0x4f9f('0x0'));module[_0x4f9f('0x1')]={'penalty':{'type':Sequelize[_0x4f9f('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 9f5840a..a81cb96 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 _0x553a=['bluebird','rimraf','exports','define','UserSmsQueue','user_has_sms_queues','util','api','moment'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x553a,0x192));var _0xa553=function(_0x843880,_0x1516d1){_0x843880=_0x843880-0x0;var _0x49943f=_0x553a[_0x843880];return _0x49943f;};'use strict';var _=require('lodash');var util=require(_0xa553('0x0'));var logger=require('../../config/logger')(_0xa553('0x1'));var moment=require(_0xa553('0x2'));var BPromise=require(_0xa553('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa553('0x4'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xa553('0x5')]=function(_0x53190d,_0x5ddf5e){return _0x53190d[_0xa553('0x6')](_0xa553('0x7'),attributes,{'tableName':_0xa553('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bd3=['exports','define','UserSmsQueue','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x9a6637,_0x44a610){var _0x3f91da=function(_0x268ca9){while(--_0x268ca9){_0x9a6637['push'](_0x9a6637['shift']());}};_0x3f91da(++_0x44a610);}(_0x4bd3,0x174));var _0x34bd=function(_0x4eb3ef,_0x2f2b2d){_0x4eb3ef=_0x4eb3ef-0x0;var _0x5949d1=_0x4bd3[_0x4eb3ef];return _0x5949d1;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./userSmsQueue.attributes');module[_0x34bd('0x6')]=function(_0x2a15a2,_0x5c2a7a){return _0x2a15a2[_0x34bd('0x7')](_0x34bd('0x8'),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 4eb6698..44f1f64 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 _0xb465=['jayson/promise','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x38223f,_0x3a0dfc){var _0x3e3fab=function(_0x2b40d0){while(--_0x2b40d0){_0x38223f['push'](_0x38223f['shift']());}};_0x3e3fab(++_0x3a0dfc);}(_0xb465,0x139));var _0x5b46=function(_0x47440d,_0x3efe09){_0x47440d=_0x47440d-0x0;var _0x36ceea=_0xb465[_0x47440d];return _0x36ceea;};'use strict';var _=require(_0x5b46('0x0'));var util=require('util');var moment=require(_0x5b46('0x1'));var BPromise=require(_0x5b46('0x2'));var rs=require(_0x5b46('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b46('0x4'))['db'];var utils=require(_0x5b46('0x5'));var logger=require(_0x5b46('0x6'))(_0x5b46('0x7'));var config=require(_0x5b46('0x8'));var jayson=require(_0x5b46('0x9'));var client=jayson['client'][_0x5b46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41d5d7,_0x58ba38,_0x1f64d1){return new BPromise(function(_0x4c8b93,_0xeb54f4){return client[_0x5b46('0xb')](_0x41d5d7,_0x1f64d1)['then'](function(_0x14606b){logger['info'](_0x5b46('0xc'),_0x58ba38,_0x5b46('0xd'));logger[_0x5b46('0xe')](_0x5b46('0xf'),_0x58ba38,_0x5b46('0xd'),JSON[_0x5b46('0x10')](_0x14606b));if(_0x14606b[_0x5b46('0x11')]){if(_0x14606b['error'][_0x5b46('0x12')]===0x1f4){logger['error'](_0x5b46('0xc'),_0x58ba38,_0x14606b[_0x5b46('0x11')][_0x5b46('0x13')]);return _0xeb54f4(_0x14606b[_0x5b46('0x11')][_0x5b46('0x13')]);}logger[_0x5b46('0x11')](_0x5b46('0xc'),_0x58ba38,_0x14606b[_0x5b46('0x11')][_0x5b46('0x13')]);return _0x4c8b93(_0x14606b[_0x5b46('0x11')][_0x5b46('0x13')]);}else{logger[_0x5b46('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x58ba38,'request\x20sent');_0x4c8b93(_0x14606b[_0x5b46('0x15')][_0x5b46('0x13')]);}})[_0x5b46('0x16')](function(_0x50d46b){logger[_0x5b46('0x11')](_0x5b46('0xc'),_0x58ba38,_0x50d46b);_0xeb54f4(_0x50d46b);});});} \ No newline at end of file +var _0x80d9=['jayson/promise','http','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x459392,_0x3dd5dc){var _0x445bc9=function(_0x4b577c){while(--_0x4b577c){_0x459392['push'](_0x459392['shift']());}};_0x445bc9(++_0x3dd5dc);}(_0x80d9,0x108));var _0x980d=function(_0x1a171,_0x11e700){_0x1a171=_0x1a171-0x0;var _0x1ce9ec=_0x80d9[_0x1a171];return _0x1ce9ec;};'use strict';var _=require('lodash');var util=require(_0x980d('0x0'));var moment=require(_0x980d('0x1'));var BPromise=require(_0x980d('0x2'));var rs=require(_0x980d('0x3'));var fs=require('fs');var Redis=require(_0x980d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x980d('0x5'));var logger=require(_0x980d('0x6'))(_0x980d('0x7'));var config=require(_0x980d('0x8'));var jayson=require(_0x980d('0x9'));var client=jayson['client'][_0x980d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42f13e,_0x1b6d25,_0x3b6b20){return new BPromise(function(_0x245343,_0x1c842d){return client['request'](_0x42f13e,_0x3b6b20)['then'](function(_0x363d29){logger[_0x980d('0xb')](_0x980d('0xc'),_0x1b6d25,_0x980d('0xd'));logger[_0x980d('0xe')](_0x980d('0xf'),_0x1b6d25,_0x980d('0xd'),JSON['stringify'](_0x363d29));if(_0x363d29['error']){if(_0x363d29[_0x980d('0x10')][_0x980d('0x11')]===0x1f4){logger[_0x980d('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x1b6d25,_0x363d29['error']['message']);return _0x1c842d(_0x363d29[_0x980d('0x10')]['message']);}logger[_0x980d('0x10')](_0x980d('0xc'),_0x1b6d25,_0x363d29[_0x980d('0x10')][_0x980d('0x12')]);return _0x245343(_0x363d29[_0x980d('0x10')]['message']);}else{logger[_0x980d('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x1b6d25,_0x980d('0xd'));_0x245343(_0x363d29[_0x980d('0x13')]['message']);}})[_0x980d('0x14')](function(_0x44c0ab){logger[_0x980d('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x1b6d25,_0x44c0ab);_0x1c842d(_0x44c0ab);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index b0c538a..5e3c609 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 _0x9edd=['sequelize','exports','INTEGER'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x9edd,0x171));var _0xd9ed=function(_0x3f9940,_0x3eefd7){_0x3f9940=_0x3f9940-0x0;var _0x5d4441=_0x9edd[_0x3f9940];return _0x5d4441;};'use strict';var Sequelize=require(_0xd9ed('0x0'));module[_0xd9ed('0x1')]={'UserId':{'type':Sequelize[_0xd9ed('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd9ed('0x2')]}}; \ No newline at end of file +var _0xf58b=['INTEGER','exports'];(function(_0x1c431d,_0xc80c68){var _0x5a80f7=function(_0x3a54e0){while(--_0x3a54e0){_0x1c431d['push'](_0x1c431d['shift']());}};_0x5a80f7(++_0xc80c68);}(_0xf58b,0xd5));var _0xbf58=function(_0x4ec3ab,_0x50a5de){_0x4ec3ab=_0x4ec3ab-0x0;var _0x229613=_0xf58b[_0x4ec3ab];return _0x229613;};'use strict';var Sequelize=require('sequelize');module[_0xbf58('0x0')]={'UserId':{'type':Sequelize[_0xbf58('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xbf58('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index bf31daf..ef614df 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(_0x5e9234,_0x36189d){var _0x2f971e=function(_0x458b84){while(--_0x458b84){_0x5e9234['push'](_0x5e9234['shift']());}};_0x2f971e(++_0x36189d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x428f4e,_0x383b66){var _0x1a6607=function(_0x38d1ce){while(--_0x38d1ce){_0x428f4e['push'](_0x428f4e['shift']());}};_0x1a6607(++_0x383b66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 742c212..1dce587 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4fb95a,_0x213c61){var _0x158438=function(_0x5137f6){while(--_0x5137f6){_0x4fb95a['push'](_0x4fb95a['shift']());}};_0x158438(++_0x213c61);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0xcb91[_0x3f2d02];return _0x54092b;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1fb78e,_0x57d489){var _0x43a1cd=function(_0x5cbb2b){while(--_0x5cbb2b){_0x1fb78e['push'](_0x1fb78e['shift']());}};_0x43a1cd(++_0x57d489);}(_0x70e0,0x17b));var _0x070e=function(_0x132765,_0xe507c3){_0x132765=_0x132765-0x0;var _0x1d02a5=_0x70e0[_0x132765];return _0x1d02a5;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 04ee42c..533552e 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 _0xee5e=['INTEGER'];(function(_0xd143f8,_0xd48028){var _0x43a25e=function(_0x3d5bf5){while(--_0x3d5bf5){_0xd143f8['push'](_0xd143f8['shift']());}};_0x43a25e(++_0xd48028);}(_0xee5e,0x181));var _0xeee5=function(_0x58664a,_0x3a99d3){_0x58664a=_0x58664a-0x0;var _0x1075c8=_0xee5e[_0x58664a];return _0x1075c8;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xeee5('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x46e1=['exports','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x46e1,0x155));var _0x146e=function(_0x307f3f,_0x58ac30){_0x307f3f=_0x307f3f-0x0;var _0x5dc183=_0x46e1[_0x307f3f];return _0x5dc183;};'use strict';var Sequelize=require(_0x146e('0x0'));module[_0x146e('0x1')]={'penalty':{'type':Sequelize[_0x146e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index f587259..1c57342 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 _0x1b17=['request-promise','rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x1b17,0x1be));var _0x71b1=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x1b17[_0x351509];return _0x4e9861;};'use strict';var _=require(_0x71b1('0x0'));var util=require(_0x71b1('0x1'));var logger=require(_0x71b1('0x2'))('api');var moment=require(_0x71b1('0x3'));var BPromise=require(_0x71b1('0x4'));var rp=require(_0x71b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71b1('0x6'));var config=require(_0x71b1('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x71b1('0x8')]=function(_0x69eb4f,_0x976518){return _0x69eb4f['define'](_0x71b1('0x9'),attributes,{'tableName':_0x71b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d19=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x4ca949,_0x4299be){var _0x1d0352=function(_0x34cc89){while(--_0x34cc89){_0x4ca949['push'](_0x4ca949['shift']());}};_0x1d0352(++_0x4299be);}(_0x2d19,0x110));var _0x92d1=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x2d19[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x92d1('0x0'));var util=require(_0x92d1('0x1'));var logger=require(_0x92d1('0x2'))(_0x92d1('0x3'));var moment=require('moment');var BPromise=require(_0x92d1('0x4'));var rp=require(_0x92d1('0x5'));var fs=require('fs');var path=require(_0x92d1('0x6'));var rimraf=require(_0x92d1('0x7'));var config=require(_0x92d1('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x92d1('0x9')]=function(_0x247f4a,_0x42bcb7){return _0x247f4a[_0x92d1('0xa')](_0x92d1('0xb'),attributes,{'tableName':'user_has_voice_queues','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 6eff6fe..9814238 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 _0x9714=['error','message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x4b91f3,_0x549a38){var _0x9a2e3e=function(_0xd1cddc){while(--_0xd1cddc){_0x4b91f3['push'](_0x4b91f3['shift']());}};_0x9a2e3e(++_0x549a38);}(_0x9714,0x9e));var _0x4971=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x9714[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x4971('0x0'));var util=require('util');var moment=require(_0x4971('0x1'));var BPromise=require(_0x4971('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4971('0x3'));var logger=require(_0x4971('0x4'))(_0x4971('0x5'));var config=require(_0x4971('0x6'));var jayson=require(_0x4971('0x7'));var client=jayson[_0x4971('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc9f6b,_0x211900,_0x589dc9){return new BPromise(function(_0x5587e3,_0x216df8){return client[_0x4971('0x9')](_0xc9f6b,_0x589dc9)[_0x4971('0xa')](function(_0x192f18){logger[_0x4971('0xb')](_0x4971('0xc'),_0x211900,_0x4971('0xd'));logger[_0x4971('0xe')](_0x4971('0xf'),_0x211900,_0x4971('0xd'),JSON[_0x4971('0x10')](_0x192f18));if(_0x192f18['error']){if(_0x192f18['error'][_0x4971('0x11')]===0x1f4){logger[_0x4971('0x12')](_0x4971('0xc'),_0x211900,_0x192f18[_0x4971('0x12')]['message']);return _0x216df8(_0x192f18[_0x4971('0x12')][_0x4971('0x13')]);}logger['error'](_0x4971('0xc'),_0x211900,_0x192f18[_0x4971('0x12')][_0x4971('0x13')]);return _0x5587e3(_0x192f18['error'][_0x4971('0x13')]);}else{logger[_0x4971('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x211900,_0x4971('0xd'));_0x5587e3(_0x192f18[_0x4971('0x14')][_0x4971('0x13')]);}})[_0x4971('0x15')](function(_0x2a8037){logger[_0x4971('0x12')](_0x4971('0xc'),_0x211900,_0x2a8037);_0x216df8(_0x2a8037);});});} \ No newline at end of file +var _0xd8eb=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0xd8eb,0xe5));var _0xbd8e=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xd8eb[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0xbd8e('0x0'));var util=require(_0xbd8e('0x1'));var moment=require(_0xbd8e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd8e('0x3'));var db=require(_0xbd8e('0x4'))['db'];var utils=require(_0xbd8e('0x5'));var logger=require(_0xbd8e('0x6'))(_0xbd8e('0x7'));var config=require(_0xbd8e('0x8'));var jayson=require(_0xbd8e('0x9'));var client=jayson[_0xbd8e('0xa')][_0xbd8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121df1,_0x1d74ab,_0x597fdf){return new BPromise(function(_0x40acfb,_0x46b391){return client['request'](_0x121df1,_0x597fdf)[_0xbd8e('0xc')](function(_0x5197ae){logger[_0xbd8e('0xd')](_0xbd8e('0xe'),_0x1d74ab,'request\x20sent');logger[_0xbd8e('0xf')](_0xbd8e('0x10'),_0x1d74ab,'request\x20sent',JSON[_0xbd8e('0x11')](_0x5197ae));if(_0x5197ae['error']){if(_0x5197ae[_0xbd8e('0x12')]['code']===0x1f4){logger[_0xbd8e('0x12')](_0xbd8e('0xe'),_0x1d74ab,_0x5197ae[_0xbd8e('0x12')][_0xbd8e('0x13')]);return _0x46b391(_0x5197ae[_0xbd8e('0x12')][_0xbd8e('0x13')]);}logger[_0xbd8e('0x12')](_0xbd8e('0xe'),_0x1d74ab,_0x5197ae[_0xbd8e('0x12')][_0xbd8e('0x13')]);return _0x40acfb(_0x5197ae[_0xbd8e('0x12')]['message']);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x1d74ab,'request\x20sent');_0x40acfb(_0x5197ae[_0xbd8e('0x14')]['message']);}})['catch'](function(_0x510b52){logger[_0xbd8e('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x1d74ab,_0x510b52);_0x46b391(_0x510b52);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 31ded93..88d7b3a 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4375bf,_0x768a61){var _0x28b84b=function(_0x23e688){while(--_0x23e688){_0x4375bf['push'](_0x4375bf['shift']());}};_0x28b84b(++_0x768a61);}(_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(_0x272f04,_0x2506f8){var _0x4ffc59=function(_0x5454b2){while(--_0x5454b2){_0x272f04['push'](_0x272f04['shift']());}};_0x4ffc59(++_0x2506f8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e2e114e..885eb4b 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 _0x1340=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x15f910,_0x509727){var _0x55b1cb=function(_0x4c1912){while(--_0x4c1912){_0x15f910['push'](_0x15f910['shift']());}};_0x55b1cb(++_0x509727);}(_0x1340,0x74));var _0x0134=function(_0x4bec3f,_0x4af915){_0x4bec3f=_0x4bec3f-0x0;var _0x42ac43=_0x1340[_0x4bec3f];return _0x42ac43;};'use strict';var Sequelize=require('sequelize');module[_0x0134('0x0')]={'uniqueid':{'type':Sequelize[_0x0134('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0134('0x2')},'membername':{'type':Sequelize[_0x0134('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x0134('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0134('0x3')],'allowNull':![],'unique':_0x0134('0x4'),'comment':_0x0134('0x2')},'VoiceQueueId':{'type':Sequelize[_0x0134('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x0134('0x3')],'allowNull':![],'unique':_0x0134('0x4'),'comment':_0x0134('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x0134('0x2')},'paused':{'type':Sequelize[_0x0134('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x108d=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1b7e6d,_0x3a7c68){var _0x422553=function(_0x14ce0e){while(--_0x14ce0e){_0x1b7e6d['push'](_0x1b7e6d['shift']());}};_0x422553(++_0x3a7c68);}(_0x108d,0x7e));var _0xd108=function(_0x5ae720,_0x3cc0a7){_0x5ae720=_0x5ae720-0x0;var _0x39a46d=_0x108d[_0x5ae720];return _0x39a46d;};'use strict';var Sequelize=require(_0xd108('0x0'));module[_0xd108('0x1')]={'uniqueid':{'type':Sequelize[_0xd108('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd108('0x3')},'membername':{'type':Sequelize[_0xd108('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xd108('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd108('0x4')],'allowNull':![],'unique':_0xd108('0x5'),'comment':_0xd108('0x3')},'VoiceQueueId':{'type':Sequelize[_0xd108('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd108('0x5'),'comment':_0xd108('0x3')},'penalty':{'type':Sequelize[_0xd108('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xd108('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 6811b9e..63f6f93 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 _0xa794=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x12cb32,_0x16ecb0){var _0x1679a2=function(_0x2ea133){while(--_0x2ea133){_0x12cb32['push'](_0x12cb32['shift']());}};_0x1679a2(++_0x16ecb0);}(_0xa794,0xfe));var _0x4a79=function(_0x2f876a,_0x411cb0){_0x2f876a=_0x2f876a-0x0;var _0xeceb68=_0xa794[_0x2f876a];return _0xeceb68;};'use strict';var EventEmitter=require(_0x4a79('0x0'));var UserVoiceQueueRt=require(_0x4a79('0x1'))['db'][_0x4a79('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4a79('0x3')](0x0);var events={'afterCreate':_0x4a79('0x4'),'afterUpdate':_0x4a79('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50a972){return function(_0x20110b,_0x45e3dd,_0x1de7fb){UserVoiceQueueRtEvents['emit'](_0x50a972+':'+_0x20110b['id'],_0x20110b);UserVoiceQueueRtEvents[_0x4a79('0x6')](_0x50a972,_0x20110b);_0x1de7fb(null);};}for(var e in events){if(events[_0x4a79('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x4a79('0x8')](e,emitEvent(event));}}module[_0x4a79('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xaf24=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x1ac562,_0x270a2d){var _0x483610=function(_0x1eb389){while(--_0x1eb389){_0x1ac562['push'](_0x1ac562['shift']());}};_0x483610(++_0x270a2d);}(_0xaf24,0x1ca));var _0x4af2=function(_0x408649,_0x41c48e){_0x408649=_0x408649-0x0;var _0x4144aa=_0xaf24[_0x408649];return _0x4144aa;};'use strict';var EventEmitter=require(_0x4af2('0x0'));var UserVoiceQueueRt=require(_0x4af2('0x1'))['db'][_0x4af2('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4af2('0x3')](0x0);var events={'afterCreate':_0x4af2('0x4'),'afterUpdate':_0x4af2('0x5'),'afterDestroy':_0x4af2('0x6')};function emitEvent(_0x2275b8){return function(_0x2b85ca,_0x11c2cd,_0x3e3a53){UserVoiceQueueRtEvents[_0x4af2('0x7')](_0x2275b8+':'+_0x2b85ca['id'],_0x2b85ca);UserVoiceQueueRtEvents[_0x4af2('0x7')](_0x2275b8,_0x2b85ca);_0x3e3a53(null);};}for(var e in events){if(events[_0x4af2('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x4af2('0x9')](e,emitEvent(event));}}module[_0x4af2('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 59cfbb7..b20e780 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 _0xb848=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','moment','bluebird','request-promise','path'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0xb848,0x11b));var _0x8b84=function(_0x532607,_0x1a44af){_0x532607=_0x532607-0x0;var _0x5093b0=_0xb848[_0x532607];return _0x5093b0;};'use strict';var _=require(_0x8b84('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8b84('0x1'));var BPromise=require(_0x8b84('0x2'));var rp=require(_0x8b84('0x3'));var fs=require('fs');var path=require(_0x8b84('0x4'));var rimraf=require(_0x8b84('0x5'));var config=require(_0x8b84('0x6'));var attributes=require(_0x8b84('0x7'));module[_0x8b84('0x8')]=function(_0x4d7884,_0x3b59f3){return _0x4d7884[_0x8b84('0x9')](_0x8b84('0xa'),attributes,{'tableName':_0x8b84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0681=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api'];(function(_0x173eff,_0x55a7d0){var _0x119fbd=function(_0x31a223){while(--_0x31a223){_0x173eff['push'](_0x173eff['shift']());}};_0x119fbd(++_0x55a7d0);}(_0x0681,0x175));var _0x1068=function(_0x1a3447,_0x3fddfd){_0x1a3447=_0x1a3447-0x0;var _0x33cff5=_0x0681[_0x1a3447];return _0x33cff5;};'use strict';var _=require(_0x1068('0x0'));var util=require(_0x1068('0x1'));var logger=require(_0x1068('0x2'))(_0x1068('0x3'));var moment=require('moment');var BPromise=require(_0x1068('0x4'));var rp=require(_0x1068('0x5'));var fs=require('fs');var path=require(_0x1068('0x6'));var rimraf=require(_0x1068('0x7'));var config=require(_0x1068('0x8'));var attributes=require(_0x1068('0x9'));module[_0x1068('0xa')]=function(_0x367152,_0xb6f248){return _0x367152[_0x1068('0xb')](_0x1068('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 4b174d7..5f287aa 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 _0xbd73=['socket.io-emitter','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x4bdea0,_0x3a3e49){var _0x182ad0=function(_0x2a68e2){while(--_0x2a68e2){_0x4bdea0['push'](_0x4bdea0['shift']());}};_0x182ad0(++_0x3a3e49);}(_0xbd73,0x103));var _0x3bd7=function(_0x3ee414,_0x39e0a6){_0x3ee414=_0x3ee414-0x0;var _0xcdc9da=_0xbd73[_0x3ee414];return _0xcdc9da;};'use strict';var _=require(_0x3bd7('0x0'));var util=require(_0x3bd7('0x1'));var moment=require('moment');var BPromise=require(_0x3bd7('0x2'));var rs=require(_0x3bd7('0x3'));var fs=require('fs');var Redis=require(_0x3bd7('0x4'));var db=require(_0x3bd7('0x5'))['db'];var utils=require(_0x3bd7('0x6'));var logger=require('../../config/logger')(_0x3bd7('0x7'));var config=require(_0x3bd7('0x8'));var jayson=require(_0x3bd7('0x9'));var client=jayson[_0x3bd7('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3bd7('0xb')](config[_0x3bd7('0xc')],{'host':_0x3bd7('0xd'),'port':0x18eb});var socket=require(_0x3bd7('0xe'))(new Redis(config[_0x3bd7('0xc')]));require(_0x3bd7('0xf'))[_0x3bd7('0x10')](socket);function respondWithRpcPromise(_0x27508e,_0x5028a9,_0x180b7e){return new BPromise(function(_0x5ebb6f,_0x37e8de){return client[_0x3bd7('0x11')](_0x27508e,_0x180b7e)['then'](function(_0x298b9c){logger['info'](_0x3bd7('0x12'),_0x5028a9,_0x3bd7('0x13'));logger[_0x3bd7('0x14')](_0x3bd7('0x15'),_0x5028a9,_0x3bd7('0x13'),JSON[_0x3bd7('0x16')](_0x298b9c));if(_0x298b9c['error']){if(_0x298b9c[_0x3bd7('0x17')][_0x3bd7('0x18')]===0x1f4){logger[_0x3bd7('0x17')](_0x3bd7('0x12'),_0x5028a9,_0x298b9c[_0x3bd7('0x17')][_0x3bd7('0x19')]);return _0x37e8de(_0x298b9c['error'][_0x3bd7('0x19')]);}logger['error'](_0x3bd7('0x12'),_0x5028a9,_0x298b9c[_0x3bd7('0x17')][_0x3bd7('0x19')]);return _0x5ebb6f(_0x298b9c[_0x3bd7('0x17')][_0x3bd7('0x19')]);}else{logger[_0x3bd7('0x1a')](_0x3bd7('0x12'),_0x5028a9,_0x3bd7('0x13'));_0x5ebb6f(_0x298b9c[_0x3bd7('0x1b')][_0x3bd7('0x19')]);}})[_0x3bd7('0x1c')](function(_0x5bfff1){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5028a9,_0x5bfff1);_0x37e8de(_0x5bfff1);});});}exports[_0x3bd7('0x1d')]=function(_0x4f4e4b){var _0x4f9e2c=this;return new Promise(function(_0x2d2265,_0x3df505){return db[_0x3bd7('0x1e')][_0x3bd7('0x1f')]({'raw':_0x4f4e4b[_0x3bd7('0x20')]?_0x4f4e4b['options'][_0x3bd7('0x21')]===undefined?!![]:![]:!![],'where':_0x4f4e4b[_0x3bd7('0x20')]?_0x4f4e4b[_0x3bd7('0x20')]['where']||null:null,'attributes':[[db[_0x3bd7('0x22')]['fn'](_0x3bd7('0x23'),db['sequelize']['fn']('IF',db[_0x3bd7('0x22')][_0x3bd7('0x24')](_0x3bd7('0x25')))),_0x3bd7('0x26')]]})['then'](function(_0x42aca3){logger['info'](_0x3bd7('0x1d'),_0x4f4e4b);logger['debug'](_0x3bd7('0x1d'),_0x4f4e4b,JSON[_0x3bd7('0x16')](_0x42aca3));_0x2d2265(_0x42aca3);})[_0x3bd7('0x1c')](function(_0x52b290){logger[_0x3bd7('0x17')](_0x3bd7('0x1d'),_0x52b290[_0x3bd7('0x19')],_0x4f4e4b);_0x3df505(_0x4f9e2c['error'](0x1f4,_0x52b290[_0x3bd7('0x19')]));});});}; \ No newline at end of file +var _0xa4c5=['redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x59a50f,_0xdf3d4a){var _0x25192e=function(_0x21e656){while(--_0x21e656){_0x59a50f['push'](_0x59a50f['shift']());}};_0x25192e(++_0xdf3d4a);}(_0xa4c5,0x114));var _0x5a4c=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa4c5[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x5a4c('0x0'));var util=require(_0x5a4c('0x1'));var moment=require(_0x5a4c('0x2'));var BPromise=require(_0x5a4c('0x3'));var rs=require(_0x5a4c('0x4'));var fs=require('fs');var Redis=require(_0x5a4c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5a4c('0x6'))('rpc');var config=require(_0x5a4c('0x7'));var jayson=require(_0x5a4c('0x8'));var client=jayson[_0x5a4c('0x9')][_0x5a4c('0xa')]({'port':0x232a});config['redis']=_[_0x5a4c('0xb')](config[_0x5a4c('0xc')],{'host':_0x5a4c('0xd'),'port':0x18eb});var socket=require(_0x5a4c('0xe'))(new Redis(config['redis']));require(_0x5a4c('0xf'))['register'](socket);function respondWithRpcPromise(_0x43ffd0,_0x5a0cb1,_0x20aef){return new BPromise(function(_0x12fa6c,_0x303843){return client['request'](_0x43ffd0,_0x20aef)[_0x5a4c('0x10')](function(_0xb9b0d6){logger[_0x5a4c('0x11')](_0x5a4c('0x12'),_0x5a0cb1,_0x5a4c('0x13'));logger[_0x5a4c('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5a0cb1,_0x5a4c('0x13'),JSON[_0x5a4c('0x15')](_0xb9b0d6));if(_0xb9b0d6[_0x5a4c('0x16')]){if(_0xb9b0d6['error'][_0x5a4c('0x17')]===0x1f4){logger[_0x5a4c('0x16')](_0x5a4c('0x12'),_0x5a0cb1,_0xb9b0d6[_0x5a4c('0x16')][_0x5a4c('0x18')]);return _0x303843(_0xb9b0d6[_0x5a4c('0x16')][_0x5a4c('0x18')]);}logger[_0x5a4c('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5a0cb1,_0xb9b0d6[_0x5a4c('0x16')][_0x5a4c('0x18')]);return _0x12fa6c(_0xb9b0d6[_0x5a4c('0x16')][_0x5a4c('0x18')]);}else{logger[_0x5a4c('0x11')](_0x5a4c('0x12'),_0x5a0cb1,_0x5a4c('0x13'));_0x12fa6c(_0xb9b0d6[_0x5a4c('0x19')][_0x5a4c('0x18')]);}})['catch'](function(_0x62a6bc){logger['error'](_0x5a4c('0x12'),_0x5a0cb1,_0x62a6bc);_0x303843(_0x62a6bc);});});}exports[_0x5a4c('0x1a')]=function(_0x33a138){var _0x784023=this;return new Promise(function(_0x12a01d,_0x3b1c10){return db[_0x5a4c('0x1b')]['findAll']({'raw':_0x33a138[_0x5a4c('0x1c')]?_0x33a138[_0x5a4c('0x1c')][_0x5a4c('0x1d')]===undefined?!![]:![]:!![],'where':_0x33a138[_0x5a4c('0x1c')]?_0x33a138[_0x5a4c('0x1c')]['where']||null:null,'attributes':[[db[_0x5a4c('0x1e')]['fn'](_0x5a4c('0x1f'),db[_0x5a4c('0x1e')]['fn']('IF',db[_0x5a4c('0x1e')][_0x5a4c('0x20')](_0x5a4c('0x21')))),_0x5a4c('0x22')]]})[_0x5a4c('0x10')](function(_0x2ced7a){logger[_0x5a4c('0x11')](_0x5a4c('0x1a'),_0x33a138);logger[_0x5a4c('0x14')](_0x5a4c('0x1a'),_0x33a138,JSON['stringify'](_0x2ced7a));_0x12a01d(_0x2ced7a);})[_0x5a4c('0x23')](function(_0x55ac7f){logger[_0x5a4c('0x16')](_0x5a4c('0x1a'),_0x55ac7f[_0x5a4c('0x18')],_0x33a138);_0x3b1c10(_0x784023['error'](0x1f4,_0x55ac7f[_0x5a4c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index a4c29c8..5d190b0 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 _0x1574=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x58c513,_0x15deec){var _0x4da4c4=function(_0x112a83){while(--_0x112a83){_0x58c513['push'](_0x58c513['shift']());}};_0x4da4c4(++_0x15deec);}(_0x1574,0x148));var _0x4157=function(_0x36abde,_0x2f47d4){_0x36abde=_0x36abde-0x0;var _0x3b84fc=_0x1574[_0x36abde];return _0x3b84fc;};'use strict';var UserVoiceQueueRtEvents=require(_0x4157('0x0'));var events=[_0x4157('0x1'),_0x4157('0x2'),_0x4157('0x3')];function createListener(_0x56ee53,_0x31fa4d){return function(_0x3bdabb){_0x31fa4d[_0x4157('0x4')](_0x56ee53,_0x3bdabb);};}function removeListener(_0x1759d6,_0x2f0766){return function(){UserVoiceQueueRtEvents[_0x4157('0x5')](_0x1759d6,_0x2f0766);};}exports[_0x4157('0x6')]=function(_0x43c6dc){for(var _0xbd0cf7=0x0,_0x1ece73=events[_0x4157('0x7')];_0xbd0cf7<_0x1ece73;_0xbd0cf7++){var _0x213c67=events[_0xbd0cf7];var _0x17a9ec=createListener(_0x4157('0x8')+_0x213c67,_0x43c6dc);UserVoiceQueueRtEvents['on'](_0x213c67,_0x17a9ec);}}; \ No newline at end of file +var _0x66c7=['remove','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x4e2111,_0x1d5493){var _0x1b4556=function(_0x2bd9ee){while(--_0x2bd9ee){_0x4e2111['push'](_0x4e2111['shift']());}};_0x1b4556(++_0x1d5493);}(_0x66c7,0x15c));var _0x766c=function(_0x47da96,_0x2ab4ff){_0x47da96=_0x47da96-0x0;var _0x4a8b27=_0x66c7[_0x47da96];return _0x4a8b27;};'use strict';var UserVoiceQueueRtEvents=require(_0x766c('0x0'));var events=[_0x766c('0x1'),_0x766c('0x2'),'update'];function createListener(_0x507a68,_0x47351a){return function(_0x23b678){_0x47351a[_0x766c('0x3')](_0x507a68,_0x23b678);};}function removeListener(_0x1b2a8e,_0x2b4c75){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1b2a8e,_0x2b4c75);};}exports[_0x766c('0x4')]=function(_0x80d91d){for(var _0x6f94c3=0x0,_0xb0b5f7=events[_0x766c('0x5')];_0x6f94c3<_0xb0b5f7;_0x6f94c3++){var _0x3c4683=events[_0x6f94c3];var _0x22a524=createListener(_0x766c('0x6')+_0x3c4683,_0x80d91d);UserVoiceQueueRtEvents['on'](_0x3c4683,_0x22a524);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index c07b349..0bb3e4b 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4750ca,_0x5d50e1){var _0x52b854=function(_0x42a79c){while(--_0x42a79c){_0x4750ca['push'](_0x4750ca['shift']());}};_0x52b854(++_0x5d50e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xcb91[_0xd09668];return _0x68726;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x570e92,_0x55cebd){var _0x3298ff=function(_0x37f59c){while(--_0x37f59c){_0x570e92['push'](_0x570e92['shift']());}};_0x3298ff(++_0x55cebd);}(_0xe706,0xa3));var _0x6e70=function(_0x114e6a,_0x3dc9d2){_0x114e6a=_0x114e6a-0x0;var _0x423189=_0xe706[_0x114e6a];return _0x423189;};'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 f3d8386..46f53e9 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 _0xe049=['exports','INTEGER','sequelize'];(function(_0x56ec7e,_0x3e5d1e){var _0x44619f=function(_0x41df52){while(--_0x41df52){_0x56ec7e['push'](_0x56ec7e['shift']());}};_0x44619f(++_0x3e5d1e);}(_0xe049,0x1f1));var _0x9e04=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe049[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x9e04('0x0'));module[_0x9e04('0x1')]={'penalty':{'type':Sequelize[_0x9e04('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a5c=['INTEGER','sequelize'];(function(_0x283ec2,_0x4d1c02){var _0xdc5b57=function(_0x4f812c){while(--_0x4f812c){_0x283ec2['push'](_0x283ec2['shift']());}};_0xdc5b57(++_0x4d1c02);}(_0x0a5c,0x97));var _0xc0a5=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x0a5c[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0xc0a5('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc0a5('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 6c81876..249fdd7 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 _0x3529=['user_has_whatsapp_queues','lodash','moment','request-promise','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3529,0x157));var _0x9352=function(_0x2dee2f,_0x19572f){_0x2dee2f=_0x2dee2f-0x0;var _0x327c18=_0x3529[_0x2dee2f];return _0x327c18;};'use strict';var _=require(_0x9352('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9352('0x1'));var BPromise=require('bluebird');var rp=require(_0x9352('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x9352('0x3')]=function(_0xc35ee0,_0x309913){return _0xc35ee0[_0x9352('0x4')]('UserWhatsappQueue',attributes,{'tableName':_0x9352('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb12b=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define'];(function(_0x179ec1,_0x1d7f3f){var _0x27e3e4=function(_0x22924a){while(--_0x22924a){_0x179ec1['push'](_0x179ec1['shift']());}};_0x27e3e4(++_0x1d7f3f);}(_0xb12b,0x176));var _0xbb12=function(_0x321b0a,_0xf1e0f7){_0x321b0a=_0x321b0a-0x0;var _0x4bd989=_0xb12b[_0x321b0a];return _0x4bd989;};'use strict';var _=require('lodash');var util=require(_0xbb12('0x0'));var logger=require('../../config/logger')(_0xbb12('0x1'));var moment=require(_0xbb12('0x2'));var BPromise=require(_0xbb12('0x3'));var rp=require(_0xbb12('0x4'));var fs=require('fs');var path=require(_0xbb12('0x5'));var rimraf=require(_0xbb12('0x6'));var config=require(_0xbb12('0x7'));var attributes=require(_0xbb12('0x8'));module['exports']=function(_0x2b6056,_0xf3df86){return _0x2b6056[_0xbb12('0x9')](_0xbb12('0xa'),attributes,{'tableName':_0xbb12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index b1c93f3..1d5ef43 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 _0x700a=['../../config/utils','rpc','jayson/promise','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb'];(function(_0x36f6bb,_0x317dfc){var _0x3b5f87=function(_0x2839d7){while(--_0x2839d7){_0x36f6bb['push'](_0x36f6bb['shift']());}};_0x3b5f87(++_0x317dfc);}(_0x700a,0x107));var _0xa700=function(_0x54dbe2,_0x26b44e){_0x54dbe2=_0x54dbe2-0x0;var _0x57bde7=_0x700a[_0x54dbe2];return _0x57bde7;};'use strict';var _=require('lodash');var util=require(_0xa700('0x0'));var moment=require('moment');var BPromise=require(_0xa700('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa700('0x2'))['db'];var utils=require(_0xa700('0x3'));var logger=require('../../config/logger')(_0xa700('0x4'));var config=require('../../config/environment');var jayson=require(_0xa700('0x5'));var client=jayson['client'][_0xa700('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x434c97,_0xedc1dc,_0x57e776){return new BPromise(function(_0x3932fe,_0x3b95dd){return client[_0xa700('0x7')](_0x434c97,_0x57e776)['then'](function(_0x45312e){logger[_0xa700('0x8')](_0xa700('0x9'),_0xedc1dc,'request\x20sent');logger[_0xa700('0xa')](_0xa700('0xb'),_0xedc1dc,_0xa700('0xc'),JSON[_0xa700('0xd')](_0x45312e));if(_0x45312e[_0xa700('0xe')]){if(_0x45312e['error'][_0xa700('0xf')]===0x1f4){logger[_0xa700('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xedc1dc,_0x45312e[_0xa700('0xe')]['message']);return _0x3b95dd(_0x45312e['error'][_0xa700('0x10')]);}logger['error'](_0xa700('0x9'),_0xedc1dc,_0x45312e['error']['message']);return _0x3932fe(_0x45312e['error']['message']);}else{logger[_0xa700('0x8')](_0xa700('0x9'),_0xedc1dc,'request\x20sent');_0x3932fe(_0x45312e[_0xa700('0x11')][_0xa700('0x10')]);}})[_0xa700('0x12')](function(_0x584a2f){logger[_0xa700('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xedc1dc,_0x584a2f);_0x3b95dd(_0x584a2f);});});} \ No newline at end of file +var _0xd735=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x10d7b3,_0x2cbf68){var _0x5744da=function(_0x3464c9){while(--_0x3464c9){_0x10d7b3['push'](_0x10d7b3['shift']());}};_0x5744da(++_0x2cbf68);}(_0xd735,0x7a));var _0x5d73=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd735[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x5d73('0x0'));var util=require(_0x5d73('0x1'));var moment=require(_0x5d73('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d73('0x3'));var fs=require('fs');var Redis=require(_0x5d73('0x4'));var db=require(_0x5d73('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d73('0x6'))('rpc');var config=require(_0x5d73('0x7'));var jayson=require(_0x5d73('0x8'));var client=jayson[_0x5d73('0x9')][_0x5d73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54cd4c,_0x54c7ef,_0x55e082){return new BPromise(function(_0x583f2f,_0x4fa15a){return client[_0x5d73('0xb')](_0x54cd4c,_0x55e082)['then'](function(_0x5b4800){logger[_0x5d73('0xc')](_0x5d73('0xd'),_0x54c7ef,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x54c7ef,_0x5d73('0xe'),JSON[_0x5d73('0xf')](_0x5b4800));if(_0x5b4800['error']){if(_0x5b4800[_0x5d73('0x10')][_0x5d73('0x11')]===0x1f4){logger[_0x5d73('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x54c7ef,_0x5b4800[_0x5d73('0x10')][_0x5d73('0x12')]);return _0x4fa15a(_0x5b4800[_0x5d73('0x10')]['message']);}logger['error'](_0x5d73('0xd'),_0x54c7ef,_0x5b4800['error'][_0x5d73('0x12')]);return _0x583f2f(_0x5b4800[_0x5d73('0x10')][_0x5d73('0x12')]);}else{logger[_0x5d73('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x54c7ef,_0x5d73('0xe'));_0x583f2f(_0x5b4800['result']['message']);}})[_0x5d73('0x13')](function(_0x3cf970){logger[_0x5d73('0x10')](_0x5d73('0xd'),_0x54c7ef,_0x3cf970);_0x4fa15a(_0x3cf970);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index c3867ac..61eddb2 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 _0x6f7f=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','post','create','destroy'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x6f7f,0x177));var _0xf6f7=function(_0x4616ac,_0x83f691){_0x4616ac=_0x4616ac-0x0;var _0x30af31=_0x6f7f[_0x4616ac];return _0x30af31;};'use strict';var multer=require('multer');var util=require(_0xf6f7('0x0'));var path=require(_0xf6f7('0x1'));var timeout=require(_0xf6f7('0x2'));var express=require(_0xf6f7('0x3'));var router=express[_0xf6f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf6f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf6f7('0x6'));var controller=require(_0xf6f7('0x7'));router[_0xf6f7('0x8')]('/',auth['isAuthenticated'](),controller[_0xf6f7('0x9')]);router['get'](_0xf6f7('0xa'),auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xc')]);router[_0xf6f7('0xd')]('/',auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xe')]);router['put'](_0xf6f7('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf6f7('0xa'),auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xf')]);module[_0xf6f7('0x10')]=router; \ No newline at end of file +var _0xc737=['get','/:id','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x26a798,_0x21e0e8){var _0x57f332=function(_0x4ef5dc){while(--_0x4ef5dc){_0x26a798['push'](_0x26a798['shift']());}};_0x57f332(++_0x21e0e8);}(_0xc737,0x8e));var _0x7c73=function(_0x4bbdb5,_0x2f09d1){_0x4bbdb5=_0x4bbdb5-0x0;var _0x1916b7=_0xc737[_0x4bbdb5];return _0x1916b7;};'use strict';var multer=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var path=require('path');var timeout=require(_0x7c73('0x2'));var express=require(_0x7c73('0x3'));var router=express[_0x7c73('0x4')]();var fs_extra=require(_0x7c73('0x5'));var auth=require(_0x7c73('0x6'));var interaction=require(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var controller=require('./variable.controller');router['get']('/',auth[_0x7c73('0x9')](),controller[_0x7c73('0xa')]);router[_0x7c73('0xb')](_0x7c73('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7c73('0xd')](_0x7c73('0xc'),auth[_0x7c73('0x9')](),controller[_0x7c73('0xe')]);router['delete'](_0x7c73('0xc'),auth['isAuthenticated'](),controller[_0x7c73('0xf')]);module[_0x7c73('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 556d69b..c84f25e 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 _0x64f0=['name','STRING','sequelize'];(function(_0x26f7d5,_0x2fad0f){var _0x29d177=function(_0x40f87e){while(--_0x40f87e){_0x26f7d5['push'](_0x26f7d5['shift']());}};_0x29d177(++_0x2fad0f);}(_0x64f0,0x1a0));var _0x064f=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0x64f0[_0x20fdc1];return _0x25397c;};'use strict';var Sequelize=require(_0x064f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x064f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x064f('0x2')]}}; \ No newline at end of file +var _0xabc7=['exports','STRING','name','sequelize'];(function(_0x5c054b,_0x5b1324){var _0x3f0093=function(_0x302092){while(--_0x302092){_0x5c054b['push'](_0x5c054b['shift']());}};_0x3f0093(++_0x5b1324);}(_0xabc7,0x77));var _0x7abc=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xabc7[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x7abc('0x0'));module[_0x7abc('0x1')]={'name':{'type':Sequelize[_0x7abc('0x2')],'unique':_0x7abc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7abc('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c88863b..c702788 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 _0xe98a=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','index','map','Variable','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','rawAttributes','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','params'];(function(_0x1c96c4,_0x5288c4){var _0x5bb03b=function(_0x119cb2){while(--_0x119cb2){_0x1c96c4['push'](_0x1c96c4['shift']());}};_0x5bb03b(++_0x5288c4);}(_0xe98a,0xa4));var _0xae98=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xe98a[_0x243217];return _0x478029;};'use strict';var emlformat=require(_0xae98('0x0'));var rimraf=require(_0xae98('0x1'));var zipdir=require(_0xae98('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae98('0x3'));var moment=require(_0xae98('0x4'));var BPromise=require(_0xae98('0x5'));var Mustache=require(_0xae98('0x6'));var util=require('util');var path=require(_0xae98('0x7'));var sox=require(_0xae98('0x8'));var csv=require('to-csv');var ejs=require(_0xae98('0x9'));var fs=require('fs');var fs_extra=require(_0xae98('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xae98('0xb'));var jsforce=require(_0xae98('0xc'));var deskjs=require(_0xae98('0xd'));var toCsv=require('to-csv');var querystring=require(_0xae98('0xe'));var Papa=require(_0xae98('0xf'));var Redis=require(_0xae98('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xae98('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae98('0x12'))(_0xae98('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xae98('0x14'));var db=require(_0xae98('0x15'))['db'];function respondWithStatusCode(_0x34dc67,_0x4c93fa){_0x4c93fa=_0x4c93fa||0xcc;return function(_0x2ee4c9){if(_0x2ee4c9){return _0x34dc67[_0xae98('0x16')](_0x4c93fa);}return _0x34dc67[_0xae98('0x17')](_0x4c93fa)[_0xae98('0x18')]();};}function respondWithResult(_0x1ad0a8,_0xdbfcd1){_0xdbfcd1=_0xdbfcd1||0xc8;return function(_0x34b9ad){if(_0x34b9ad){return _0x1ad0a8[_0xae98('0x17')](_0xdbfcd1)['json'](_0x34b9ad);}};}function respondWithFilteredResult(_0x5b0583,_0x772abb){return function(_0x500273){if(_0x500273){var _0x39dc26=typeof _0x772abb['offset']===_0xae98('0x19')&&typeof _0x772abb[_0xae98('0x1a')]==='undefined';var _0x395dc9=_0x500273[_0xae98('0x1b')];var _0x58cf30=_0x39dc26?0x0:_0x772abb['offset'];var _0x3bd788=_0x39dc26?_0x500273[_0xae98('0x1b')]:_0x772abb[_0xae98('0x1c')]+_0x772abb[_0xae98('0x1a')];var _0x38b133;if(_0x3bd788>=_0x395dc9){_0x3bd788=_0x395dc9;_0x38b133=0xc8;}else{_0x38b133=0xce;}_0x5b0583[_0xae98('0x17')](_0x38b133);return _0x5b0583[_0xae98('0x1d')](_0xae98('0x1e'),_0x58cf30+'-'+_0x3bd788+'/'+_0x395dc9)[_0xae98('0x1f')](_0x500273);}return null;};}function patchUpdates(_0x5e9e4d){return function(_0x3d14a6){try{jsonpatch[_0xae98('0x20')](_0x3d14a6,_0x5e9e4d,!![]);}catch(_0x14d22f){return BPromise[_0xae98('0x21')](_0x14d22f);}return _0x3d14a6[_0xae98('0x22')]();};}function saveUpdates(_0x4f227a,_0x422575){return function(_0x4a51c1){if(_0x4a51c1){return _0x4a51c1[_0xae98('0x23')](_0x4f227a)[_0xae98('0x24')](function(_0x2c450d){return _0x2c450d;});}return null;};}function removeEntity(_0x45b654,_0x541c7f){return function(_0x2090a3){if(_0x2090a3){return _0x2090a3[_0xae98('0x25')]()[_0xae98('0x24')](function(){var _0x481ed6=_0x2090a3[_0xae98('0x26')]({'plain':!![]});var _0xd267c2=_0xae98('0x27');return db[_0xae98('0x28')][_0xae98('0x25')]({'where':{'type':_0xd267c2,'resourceId':_0x481ed6['id']}})[_0xae98('0x24')](function(){return _0x2090a3;});})[_0xae98('0x24')](function(){_0x45b654[_0xae98('0x17')](0xcc)[_0xae98('0x18')]();});}};}function handleEntityNotFound(_0x405ca0,_0x487a12){return function(_0x2bb637){if(!_0x2bb637){_0x405ca0['sendStatus'](0x194);}return _0x2bb637;};}function handleError(_0x4d5f92,_0x2a5686){_0x2a5686=_0x2a5686||0x1f4;return function(_0x19a677){logger['error'](_0x19a677[_0xae98('0x29')]);if(_0x19a677[_0xae98('0x2a')]){delete _0x19a677[_0xae98('0x2a')];}_0x4d5f92[_0xae98('0x17')](_0x2a5686)['send'](_0x19a677);};}exports[_0xae98('0x2b')]=function(_0x1b256e,_0x334d4d){var _0x22a989={},_0x17f345={},_0x21da13={'count':0x0,'rows':[]};var _0x247b93=_[_0xae98('0x2c')](db[_0xae98('0x2d')]['rawAttributes'],function(_0x30bcca){return{'name':_0x30bcca[_0xae98('0x2e')],'type':_0x30bcca[_0xae98('0x2f')][_0xae98('0x30')]};});_0x17f345[_0xae98('0x31')]=_[_0xae98('0x2c')](_0x247b93,_0xae98('0x2a'));_0x17f345['query']=_[_0xae98('0x32')](_0x1b256e[_0xae98('0x33')]);_0x17f345['filters']=_['intersection'](_0x17f345[_0xae98('0x31')],_0x17f345[_0xae98('0x33')]);_0x22a989['attributes']=_[_0xae98('0x34')](_0x17f345[_0xae98('0x31')],qs[_0xae98('0x35')](_0x1b256e[_0xae98('0x33')][_0xae98('0x35')]));_0x22a989[_0xae98('0x36')]=_0x22a989[_0xae98('0x36')][_0xae98('0x37')]?_0x22a989[_0xae98('0x36')]:_0x17f345[_0xae98('0x31')];if(!_0x1b256e[_0xae98('0x33')][_0xae98('0x38')](_0xae98('0x39'))){_0x22a989[_0xae98('0x1a')]=qs['limit'](_0x1b256e[_0xae98('0x33')][_0xae98('0x1a')]);_0x22a989['offset']=qs[_0xae98('0x1c')](_0x1b256e[_0xae98('0x33')][_0xae98('0x1c')]);}_0x22a989[_0xae98('0x3a')]=qs[_0xae98('0x3b')](_0x1b256e[_0xae98('0x33')][_0xae98('0x3b')]);_0x22a989[_0xae98('0x3c')]=qs[_0xae98('0x3d')](_[_0xae98('0x3e')](_0x1b256e[_0xae98('0x33')],_0x17f345['filters']),_0x247b93);if(_0x1b256e['query'][_0xae98('0x3f')]){_0x22a989[_0xae98('0x3c')]=_[_0xae98('0x40')](_0x22a989['where'],{'$or':_[_0xae98('0x2c')](_0x247b93,function(_0x51ab55){if(_0x51ab55['type']!==_0xae98('0x41')){var _0x305554={};_0x305554[_0x51ab55['name']]={'$like':'%'+_0x1b256e['query']['filter']+'%'};return _0x305554;}})});}_0x22a989=_['merge']({},_0x22a989,_0x1b256e['options']);var _0x361e34={'where':_0x22a989[_0xae98('0x3c')]};return db[_0xae98('0x2d')][_0xae98('0x1b')](_0x361e34)['then'](function(_0x3c1578){_0x21da13[_0xae98('0x1b')]=_0x3c1578;if(_0x1b256e[_0xae98('0x33')]['includeAll']){_0x22a989[_0xae98('0x42')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x22a989);})[_0xae98('0x24')](function(_0x363b15){_0x21da13[_0xae98('0x43')]=_0x363b15;return _0x21da13;})[_0xae98('0x24')](respondWithFilteredResult(_0x334d4d,_0x22a989))[_0xae98('0x44')](handleError(_0x334d4d,null));};exports['show']=function(_0xeb2dee,_0x153b0f){var _0x4b556e={'raw':!![],'where':{'id':_0xeb2dee['params']['id']}},_0x176a92={};_0x176a92[_0xae98('0x31')]=_['keys'](db[_0xae98('0x2d')][_0xae98('0x45')]);_0x176a92[_0xae98('0x33')]=_[_0xae98('0x32')](_0xeb2dee[_0xae98('0x33')]);_0x176a92[_0xae98('0x3d')]=_[_0xae98('0x34')](_0x176a92['model'],_0x176a92[_0xae98('0x33')]);_0x4b556e['attributes']=_[_0xae98('0x34')](_0x176a92['model'],qs[_0xae98('0x35')](_0xeb2dee[_0xae98('0x33')]['fields']));_0x4b556e[_0xae98('0x36')]=_0x4b556e['attributes'][_0xae98('0x37')]?_0x4b556e['attributes']:_0x176a92[_0xae98('0x31')];if(_0xeb2dee[_0xae98('0x33')][_0xae98('0x46')]){_0x4b556e[_0xae98('0x42')]=[{'all':!![]}];}_0x4b556e=_[_0xae98('0x40')]({},_0x4b556e,_0xeb2dee[_0xae98('0x47')]);return db[_0xae98('0x2d')][_0xae98('0x48')](_0x4b556e)[_0xae98('0x24')](handleEntityNotFound(_0x153b0f,null))['then'](respondWithResult(_0x153b0f,null))[_0xae98('0x44')](handleError(_0x153b0f,null));};exports['create']=function(_0x14fcfb,_0x134f1c){return db[_0xae98('0x2d')][_0xae98('0x49')](_0x14fcfb[_0xae98('0x4a')],{})[_0xae98('0x24')](function(_0xb28964){var _0x3aff28=_0x14fcfb['user']['get']({'plain':!![]});if(!_0x3aff28)throw new Error(_0xae98('0x4b'));if(_0x3aff28['role']===_0xae98('0x4c')){var _0x57bd14=_0xb28964[_0xae98('0x26')]({'plain':!![]});var _0x4733dc=_0xae98('0x27');return db[_0xae98('0x4d')][_0xae98('0x48')]({'where':{'name':_0x4733dc,'userProfileId':_0x3aff28[_0xae98('0x4e')]},'raw':!![]})[_0xae98('0x24')](function(_0x5b3691){if(_0x5b3691&&_0x5b3691[_0xae98('0x4f')]===0x0){return db[_0xae98('0x28')][_0xae98('0x49')]({'name':_0x57bd14['name'],'resourceId':_0x57bd14['id'],'type':_0x5b3691[_0xae98('0x2a')],'sectionId':_0x5b3691['id']},{})[_0xae98('0x24')](function(){return _0xb28964;});}else{return _0xb28964;}})['catch'](function(_0x2d5f82){logger[_0xae98('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d5f82);throw _0x2d5f82;});}return _0xb28964;})[_0xae98('0x24')](respondWithResult(_0x134f1c,0xc9))[_0xae98('0x44')](handleError(_0x134f1c,null));};exports['update']=function(_0x1feb79,_0xed0902){if(_0x1feb79[_0xae98('0x4a')]['id']){delete _0x1feb79[_0xae98('0x4a')]['id'];}return db[_0xae98('0x2d')][_0xae98('0x48')]({'where':{'id':_0x1feb79['params']['id']}})[_0xae98('0x24')](handleEntityNotFound(_0xed0902,null))['then'](saveUpdates(_0x1feb79['body'],null))[_0xae98('0x24')](respondWithResult(_0xed0902,null))[_0xae98('0x44')](handleError(_0xed0902,null));};exports[_0xae98('0x25')]=function(_0x567688,_0x30248d){return db['Variable'][_0xae98('0x48')]({'where':{'id':_0x567688[_0xae98('0x51')]['id']}})[_0xae98('0x24')](handleEntityNotFound(_0x30248d,null))[_0xae98('0x24')](removeEntity(_0x30248d,null))[_0xae98('0x44')](handleError(_0x30248d,null));}; \ No newline at end of file +var _0x4c8f=['type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','map','Variable','rawAttributes'];(function(_0x32d7f8,_0x462797){var _0x59c636=function(_0x392668){while(--_0x392668){_0x32d7f8['push'](_0x32d7f8['shift']());}};_0x59c636(++_0x462797);}(_0x4c8f,0x11e));var _0xf4c8=function(_0x5df87c,_0x509bb1){_0x5df87c=_0x5df87c-0x0;var _0x59eba6=_0x4c8f[_0x5df87c];return _0x59eba6;};'use strict';var emlformat=require(_0xf4c8('0x0'));var rimraf=require(_0xf4c8('0x1'));var zipdir=require(_0xf4c8('0x2'));var jsonpatch=require(_0xf4c8('0x3'));var rp=require(_0xf4c8('0x4'));var moment=require(_0xf4c8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf4c8('0x6'));var path=require(_0xf4c8('0x7'));var sox=require(_0xf4c8('0x8'));var csv=require('to-csv');var ejs=require(_0xf4c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4c8('0xa'));var squel=require(_0xf4c8('0xb'));var crypto=require(_0xf4c8('0xc'));var jsforce=require(_0xf4c8('0xd'));var deskjs=require(_0xf4c8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf4c8('0xf'));var Redis=require(_0xf4c8('0x10'));var authService=require(_0xf4c8('0x11'));var qs=require(_0xf4c8('0x12'));var as=require(_0xf4c8('0x13'));var hardwareService=require(_0xf4c8('0x14'));var logger=require(_0xf4c8('0x15'))(_0xf4c8('0x16'));var utils=require('../../config/utils');var config=require(_0xf4c8('0x17'));var licenseUtil=require(_0xf4c8('0x18'));var db=require(_0xf4c8('0x19'))['db'];function respondWithStatusCode(_0xf6a0ca,_0x40f34d){_0x40f34d=_0x40f34d||0xcc;return function(_0x82152b){if(_0x82152b){return _0xf6a0ca[_0xf4c8('0x1a')](_0x40f34d);}return _0xf6a0ca[_0xf4c8('0x1b')](_0x40f34d)[_0xf4c8('0x1c')]();};}function respondWithResult(_0x41ef7b,_0x3233f7){_0x3233f7=_0x3233f7||0xc8;return function(_0x44a373){if(_0x44a373){return _0x41ef7b[_0xf4c8('0x1b')](_0x3233f7)[_0xf4c8('0x1d')](_0x44a373);}};}function respondWithFilteredResult(_0x46fbd4,_0x2a8ef6){return function(_0x316276){if(_0x316276){var _0xb33eab=typeof _0x2a8ef6[_0xf4c8('0x1e')]===_0xf4c8('0x1f')&&typeof _0x2a8ef6['limit']===_0xf4c8('0x1f');var _0x3cf41e=_0x316276[_0xf4c8('0x20')];var _0x4172d9=_0xb33eab?0x0:_0x2a8ef6[_0xf4c8('0x1e')];var _0x5496ea=_0xb33eab?_0x316276[_0xf4c8('0x20')]:_0x2a8ef6[_0xf4c8('0x1e')]+_0x2a8ef6['limit'];var _0x37954c;if(_0x5496ea>=_0x3cf41e){_0x5496ea=_0x3cf41e;_0x37954c=0xc8;}else{_0x37954c=0xce;}_0x46fbd4[_0xf4c8('0x1b')](_0x37954c);return _0x46fbd4[_0xf4c8('0x21')](_0xf4c8('0x22'),_0x4172d9+'-'+_0x5496ea+'/'+_0x3cf41e)[_0xf4c8('0x1d')](_0x316276);}return null;};}function patchUpdates(_0x114e5b){return function(_0xa62939){try{jsonpatch[_0xf4c8('0x23')](_0xa62939,_0x114e5b,!![]);}catch(_0x2acf53){return BPromise['reject'](_0x2acf53);}return _0xa62939[_0xf4c8('0x24')]();};}function saveUpdates(_0x511772,_0x4fadfa){return function(_0x490c18){if(_0x490c18){return _0x490c18[_0xf4c8('0x25')](_0x511772)[_0xf4c8('0x26')](function(_0xe71125){return _0xe71125;});}return null;};}function removeEntity(_0x4140db,_0x27172d){return function(_0x12d797){if(_0x12d797){return _0x12d797[_0xf4c8('0x27')]()['then'](function(){var _0x5de3ed=_0x12d797[_0xf4c8('0x28')]({'plain':!![]});var _0x3c327f=_0xf4c8('0x29');return db[_0xf4c8('0x2a')]['destroy']({'where':{'type':_0x3c327f,'resourceId':_0x5de3ed['id']}})['then'](function(){return _0x12d797;});})[_0xf4c8('0x26')](function(){_0x4140db[_0xf4c8('0x1b')](0xcc)[_0xf4c8('0x1c')]();});}};}function handleEntityNotFound(_0x4ab853,_0x4f5c93){return function(_0x2afbcc){if(!_0x2afbcc){_0x4ab853[_0xf4c8('0x1a')](0x194);}return _0x2afbcc;};}function handleError(_0x17b2dd,_0x56c541){_0x56c541=_0x56c541||0x1f4;return function(_0x1ee595){logger['error'](_0x1ee595[_0xf4c8('0x2b')]);if(_0x1ee595['name']){delete _0x1ee595[_0xf4c8('0x2c')];}_0x17b2dd[_0xf4c8('0x1b')](_0x56c541)[_0xf4c8('0x2d')](_0x1ee595);};}exports[_0xf4c8('0x2e')]=function(_0x4916a0,_0xd013ed){var _0x40f32e={},_0x239187={},_0x497f9d={'count':0x0,'rows':[]};var _0x21b2ca=_[_0xf4c8('0x2f')](db[_0xf4c8('0x30')][_0xf4c8('0x31')],function(_0xd6dcc9){return{'name':_0xd6dcc9['fieldName'],'type':_0xd6dcc9[_0xf4c8('0x32')]['key']};});_0x239187[_0xf4c8('0x33')]=_[_0xf4c8('0x2f')](_0x21b2ca,_0xf4c8('0x2c'));_0x239187[_0xf4c8('0x34')]=_['keys'](_0x4916a0[_0xf4c8('0x34')]);_0x239187[_0xf4c8('0x35')]=_['intersection'](_0x239187[_0xf4c8('0x33')],_0x239187[_0xf4c8('0x34')]);_0x40f32e[_0xf4c8('0x36')]=_[_0xf4c8('0x37')](_0x239187[_0xf4c8('0x33')],qs[_0xf4c8('0x38')](_0x4916a0['query'][_0xf4c8('0x38')]));_0x40f32e[_0xf4c8('0x36')]=_0x40f32e[_0xf4c8('0x36')][_0xf4c8('0x39')]?_0x40f32e[_0xf4c8('0x36')]:_0x239187[_0xf4c8('0x33')];if(!_0x4916a0[_0xf4c8('0x34')][_0xf4c8('0x3a')]('nolimit')){_0x40f32e[_0xf4c8('0x3b')]=qs[_0xf4c8('0x3b')](_0x4916a0[_0xf4c8('0x34')]['limit']);_0x40f32e[_0xf4c8('0x1e')]=qs[_0xf4c8('0x1e')](_0x4916a0[_0xf4c8('0x34')][_0xf4c8('0x1e')]);}_0x40f32e['order']=qs[_0xf4c8('0x3c')](_0x4916a0[_0xf4c8('0x34')]['sort']);_0x40f32e['where']=qs['filters'](_['pick'](_0x4916a0[_0xf4c8('0x34')],_0x239187[_0xf4c8('0x35')]),_0x21b2ca);if(_0x4916a0[_0xf4c8('0x34')][_0xf4c8('0x3d')]){_0x40f32e[_0xf4c8('0x3e')]=_[_0xf4c8('0x3f')](_0x40f32e[_0xf4c8('0x3e')],{'$or':_['map'](_0x21b2ca,function(_0x14bc3f){if(_0x14bc3f[_0xf4c8('0x32')]!==_0xf4c8('0x40')){var _0x5d099e={};_0x5d099e[_0x14bc3f[_0xf4c8('0x2c')]]={'$like':'%'+_0x4916a0[_0xf4c8('0x34')][_0xf4c8('0x3d')]+'%'};return _0x5d099e;}})});}_0x40f32e=_[_0xf4c8('0x3f')]({},_0x40f32e,_0x4916a0[_0xf4c8('0x41')]);var _0xbe2d3e={'where':_0x40f32e[_0xf4c8('0x3e')]};return db[_0xf4c8('0x30')][_0xf4c8('0x20')](_0xbe2d3e)[_0xf4c8('0x26')](function(_0x529c8e){_0x497f9d['count']=_0x529c8e;if(_0x4916a0[_0xf4c8('0x34')]['includeAll']){_0x40f32e['include']=[{'all':!![]}];}return db[_0xf4c8('0x30')][_0xf4c8('0x42')](_0x40f32e);})[_0xf4c8('0x26')](function(_0xccb5bc){_0x497f9d[_0xf4c8('0x43')]=_0xccb5bc;return _0x497f9d;})['then'](respondWithFilteredResult(_0xd013ed,_0x40f32e))['catch'](handleError(_0xd013ed,null));};exports[_0xf4c8('0x44')]=function(_0x4342ff,_0x14f87e){var _0x47a323={'raw':!![],'where':{'id':_0x4342ff[_0xf4c8('0x45')]['id']}},_0x2d942d={};_0x2d942d[_0xf4c8('0x33')]=_[_0xf4c8('0x46')](db['Variable'][_0xf4c8('0x31')]);_0x2d942d['query']=_[_0xf4c8('0x46')](_0x4342ff[_0xf4c8('0x34')]);_0x2d942d[_0xf4c8('0x35')]=_[_0xf4c8('0x37')](_0x2d942d['model'],_0x2d942d[_0xf4c8('0x34')]);_0x47a323['attributes']=_['intersection'](_0x2d942d[_0xf4c8('0x33')],qs[_0xf4c8('0x38')](_0x4342ff[_0xf4c8('0x34')][_0xf4c8('0x38')]));_0x47a323[_0xf4c8('0x36')]=_0x47a323[_0xf4c8('0x36')][_0xf4c8('0x39')]?_0x47a323[_0xf4c8('0x36')]:_0x2d942d[_0xf4c8('0x33')];if(_0x4342ff['query']['includeAll']){_0x47a323[_0xf4c8('0x47')]=[{'all':!![]}];}_0x47a323=_[_0xf4c8('0x3f')]({},_0x47a323,_0x4342ff[_0xf4c8('0x41')]);return db[_0xf4c8('0x30')][_0xf4c8('0x48')](_0x47a323)[_0xf4c8('0x26')](handleEntityNotFound(_0x14f87e,null))[_0xf4c8('0x26')](respondWithResult(_0x14f87e,null))[_0xf4c8('0x49')](handleError(_0x14f87e,null));};exports[_0xf4c8('0x4a')]=function(_0x5f4afe,_0x2cc1da){return db[_0xf4c8('0x30')][_0xf4c8('0x4a')](_0x5f4afe[_0xf4c8('0x4b')],{})['then'](function(_0x14ab5b){var _0x5620ed=_0x5f4afe[_0xf4c8('0x4c')]['get']({'plain':!![]});if(!_0x5620ed)throw new Error(_0xf4c8('0x4d'));if(_0x5620ed[_0xf4c8('0x4e')]===_0xf4c8('0x4c')){var _0x23430e=_0x14ab5b[_0xf4c8('0x28')]({'plain':!![]});var _0xe4b7a8=_0xf4c8('0x29');return db[_0xf4c8('0x4f')]['find']({'where':{'name':_0xe4b7a8,'userProfileId':_0x5620ed[_0xf4c8('0x50')]},'raw':!![]})['then'](function(_0x59b9ee){if(_0x59b9ee&&_0x59b9ee[_0xf4c8('0x51')]===0x0){return db[_0xf4c8('0x2a')][_0xf4c8('0x4a')]({'name':_0x23430e[_0xf4c8('0x2c')],'resourceId':_0x23430e['id'],'type':_0x59b9ee[_0xf4c8('0x2c')],'sectionId':_0x59b9ee['id']},{})[_0xf4c8('0x26')](function(){return _0x14ab5b;});}else{return _0x14ab5b;}})[_0xf4c8('0x49')](function(_0x6007ca){logger[_0xf4c8('0x52')](_0xf4c8('0x53'),_0x6007ca);throw _0x6007ca;});}return _0x14ab5b;})[_0xf4c8('0x26')](respondWithResult(_0x2cc1da,0xc9))['catch'](handleError(_0x2cc1da,null));};exports[_0xf4c8('0x25')]=function(_0x10000b,_0x547434){if(_0x10000b[_0xf4c8('0x4b')]['id']){delete _0x10000b['body']['id'];}return db['Variable'][_0xf4c8('0x48')]({'where':{'id':_0x10000b[_0xf4c8('0x45')]['id']}})[_0xf4c8('0x26')](handleEntityNotFound(_0x547434,null))[_0xf4c8('0x26')](saveUpdates(_0x10000b['body'],null))[_0xf4c8('0x26')](respondWithResult(_0x547434,null))['catch'](handleError(_0x547434,null));};exports['destroy']=function(_0x3332ee,_0x209206){return db[_0xf4c8('0x30')][_0xf4c8('0x48')]({'where':{'id':_0x3332ee[_0xf4c8('0x45')]['id']}})['then'](handleEntityNotFound(_0x209206,null))['then'](removeEntity(_0x209206,null))[_0xf4c8('0x49')](handleError(_0x209206,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a8c82a2..d4a1407 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 _0x5603=['Variable','tools_variables','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','define'];(function(_0x3735f8,_0x33205e){var _0x5db65b=function(_0x1a97dd){while(--_0x1a97dd){_0x3735f8['push'](_0x3735f8['shift']());}};_0x5db65b(++_0x33205e);}(_0x5603,0xec));var _0x3560=function(_0x1b4b15,_0x23a2a4){_0x1b4b15=_0x1b4b15-0x0;var _0x596ead=_0x5603[_0x1b4b15];return _0x596ead;};'use strict';var _=require(_0x3560('0x0'));var util=require(_0x3560('0x1'));var logger=require(_0x3560('0x2'))(_0x3560('0x3'));var moment=require(_0x3560('0x4'));var BPromise=require('bluebird');var rp=require(_0x3560('0x5'));var fs=require('fs');var path=require(_0x3560('0x6'));var rimraf=require(_0x3560('0x7'));var config=require(_0x3560('0x8'));var attributes=require(_0x3560('0x9'));module['exports']=function(_0xb1844a,_0x4d407f){return _0xb1844a[_0x3560('0xa')](_0x3560('0xb'),attributes,{'tableName':_0x3560('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4a3=['lodash','util','bluebird','request-promise','../../config/environment'];(function(_0x2e307f,_0x4a3d95){var _0x15a267=function(_0x431c64){while(--_0x431c64){_0x2e307f['push'](_0x2e307f['shift']());}};_0x15a267(++_0x4a3d95);}(_0xa4a3,0xf5));var _0x3a4a=function(_0x4427a0,_0x39edb4){_0x4427a0=_0x4427a0-0x0;var _0x2a9ccf=_0xa4a3[_0x4427a0];return _0x2a9ccf;};'use strict';var _=require(_0x3a4a('0x0'));var util=require(_0x3a4a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3a4a('0x2'));var rp=require(_0x3a4a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a4a('0x4'));var attributes=require('./variable.attributes');module['exports']=function(_0x4f3f9e,_0x4e9313){return _0x4f3f9e['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 3c56c0b..6919e14 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x5d7ff4,_0x1384c1){var _0x3edd41=function(_0x5b7216){while(--_0x5b7216){_0x5d7ff4['push'](_0x5d7ff4['shift']());}};_0x3edd41(++_0x1384c1);}(_0x3e74,0x175));var _0x43e7=function(_0x4a012a,_0x2c6792){_0x4a012a=_0x4a012a-0x0;var _0x4cbb37=_0x3e74[_0x4a012a];return _0x4cbb37;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xa41a,0x6b));var _0xaa41=function(_0x5b58df,_0x1dcb97){_0x5b58df=_0x5b58df-0x0;var _0x6015ee=_0xa41a[_0x5b58df];return _0x6015ee;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index c9f3eac..2fbf7a1 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 _0xa9ab=['migrations','exports','express','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','/migrations'];(function(_0x4950ba,_0x334b35){var _0x42037c=function(_0xf78b8f){while(--_0xf78b8f){_0x4950ba['push'](_0x4950ba['shift']());}};_0x42037c(++_0x334b35);}(_0xa9ab,0x152));var _0xba9a=function(_0x3dc8f9,_0x3965e5){_0x3dc8f9=_0x3dc8f9-0x0;var _0x54e06a=_0xa9ab[_0x3dc8f9];return _0x54e06a;};'use strict';var express=require(_0xba9a('0x0'));var router=express[_0xba9a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xba9a('0x2'));router[_0xba9a('0x3')]('/',controller[_0xba9a('0x4')]);router[_0xba9a('0x3')](_0xba9a('0x5'),auth[_0xba9a('0x6')](),auth[_0xba9a('0x7')](),controller[_0xba9a('0x8')]);router['get']('/reset',auth[_0xba9a('0x6')](),auth[_0xba9a('0x7')](),controller[_0xba9a('0x9')]);router[_0xba9a('0x3')](_0xba9a('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xba9a('0xb')]);router[_0xba9a('0x3')](_0xba9a('0xc'),auth[_0xba9a('0x6')](),controller['restart']);router[_0xba9a('0x3')](_0xba9a('0xd'),controller[_0xba9a('0xe')]);module[_0xba9a('0xf')]=router; \ No newline at end of file +var _0xd05e=['migrations','exports','express','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','/migrations'];(function(_0x4a045c,_0xc59fba){var _0x23fb5b=function(_0x89b1e7){while(--_0x89b1e7){_0x4a045c['push'](_0x4a045c['shift']());}};_0x23fb5b(++_0xc59fba);}(_0xd05e,0xa2));var _0xed05=function(_0x145e54,_0x2571b5){_0x145e54=_0x145e54-0x0;var _0x3c4c42=_0xd05e[_0x145e54];return _0x3c4c42;};'use strict';var express=require(_0xed05('0x0'));var router=express[_0xed05('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xed05('0x2'));router[_0xed05('0x3')]('/',controller[_0xed05('0x4')]);router['get'](_0xed05('0x5'),auth[_0xed05('0x6')](),auth[_0xed05('0x7')](),controller['fetch']);router['get'](_0xed05('0x8'),auth[_0xed05('0x6')](),auth[_0xed05('0x7')](),controller[_0xed05('0x9')]);router[_0xed05('0x3')](_0xed05('0xa'),auth[_0xed05('0x6')](),auth[_0xed05('0x7')](),controller[_0xed05('0xb')]);router[_0xed05('0x3')](_0xed05('0xc'),auth[_0xed05('0x6')](),controller['restart']);router['get'](_0xed05('0xd'),controller[_0xed05('0xe')]);module[_0xed05('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e2df01d..442d32a 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 _0xcae4=['FETCH_HEAD','info','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','migrations','length','replace','.js','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','error','git\x20fetch\x20origin\x20master','reset','--hard'];(function(_0x317ffb,_0x492cd3){var _0x2fec30=function(_0x4b28ff){while(--_0x4b28ff){_0x317ffb['push'](_0x317ffb['shift']());}};_0x2fec30(++_0x492cd3);}(_0xcae4,0xea));var _0x4cae=function(_0x2016d4,_0x156c10){_0x2016d4=_0x2016d4-0x0;var _0x231d7f=_0xcae4[_0x2016d4];return _0x231d7f;};'use strict';var Umzug=require(_0x4cae('0x0'));var path=require(_0x4cae('0x1'));var fs=require('fs');var _=require(_0x4cae('0x2'));var pkginfo=require(_0x4cae('0x3'))(module,_0x4cae('0x4'));var compareVersions=require(_0x4cae('0x5'));var exec=require(_0x4cae('0x6'))['exec'];var db=require(_0x4cae('0x7'))['db'];var config=require(_0x4cae('0x8'));var pm2=require(_0x4cae('0x9'));var logger=require('../../config/logger')(_0x4cae('0xa'));var git=require('simple-git')(config[_0x4cae('0xb')]);exports[_0x4cae('0xc')]=function(_0x4f9b43,_0x253d52){var _0x3ec2f4={'current':module[_0x4cae('0xd')][_0x4cae('0x4')],'phonebar':0x2};if(_0x4f9b43[_0x4cae('0xe')]&&_0x4f9b43['query'][_0x4cae('0xf')]){return git[_0x4cae('0x10')]()[_0x4cae('0x11')](function(_0x11e446,_0x10ab7f){_0x3ec2f4[_0x4cae('0xf')]=(_0x11e446?module[_0x4cae('0xd')][_0x4cae('0x4')]:_0x10ab7f[_0x4cae('0xf')])||_0x4cae('0x12');return _0x253d52[_0x4cae('0x13')](0xc8)[_0x4cae('0x14')](_0x3ec2f4);});}else{return _0x253d52[_0x4cae('0x13')](0xc8)[_0x4cae('0x14')](_0x3ec2f4);}};exports[_0x4cae('0x10')]=function(_0x5985f0,_0x16c145){return git['fetch']([_0x4cae('0x15'),'master'],function(_0x3a9a88){if(_0x3a9a88){logger[_0x4cae('0x16')](_0x3a9a88);return _0x16c145[_0x4cae('0x13')](0x1f4)[_0x4cae('0x14')](_0x3a9a88);}logger['info']('git\x20fetch');return _0x16c145[_0x4cae('0x13')](0xc8)[_0x4cae('0x14')]({'output':_0x4cae('0x17')});});};exports[_0x4cae('0x18')]=function(_0x265e23,_0x2ca9db){return git[_0x4cae('0x18')]([_0x4cae('0x19'),_0x4cae('0x1a')],function(_0x50af7a){if(_0x50af7a){logger[_0x4cae('0x16')](_0x50af7a);return _0x2ca9db[_0x4cae('0x13')](0x1f4)['json'](_0x50af7a);}logger[_0x4cae('0x1b')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2ca9db[_0x4cae('0x13')](0xc8)[_0x4cae('0x14')]({'output':_0x4cae('0x1c')});});};exports[_0x4cae('0x1d')]=function(_0x3f56b9,_0x3cf168){exec('npm\x20install\x20--production',function(_0x430982,_0x12994b,_0x6d9e4e){logger[_0x4cae('0x1b')](_0x12994b);logger[_0x4cae('0x1b')](_0x6d9e4e);if(_0x430982){logger[_0x4cae('0x16')](_0x430982);return _0x3cf168[_0x4cae('0x13')](0x1f4)[_0x4cae('0x14')](_0x430982);}return _0x3cf168[_0x4cae('0x13')](0xc8)[_0x4cae('0x14')]({'output':_0x12994b});});};exports[_0x4cae('0x1e')]=function(_0x533f1f,_0x518748){return pm2[_0x4cae('0x1e')](_0x4cae('0x1f'))[_0x4cae('0x20')](function(_0x2dc599){logger[_0x4cae('0x1b')](_0x4cae('0x21'),_0x2dc599);return _0x518748[_0x4cae('0x13')](0xc8)[_0x4cae('0x14')]({'output':_0x4cae('0x22')});})[_0x4cae('0x23')](function(_0x5e3f10){logger[_0x4cae('0x16')](_0x5e3f10);return _0x518748[_0x4cae('0x13')](0x1f4)[_0x4cae('0x14')](_0x5e3f10);});};exports['migrations']=function(_0x371dfd,_0x4f61a9){var _0x55a92c=fs['readdirSync'](path[_0x4cae('0x24')](config[_0x4cae('0xb')],'server',_0x4cae('0x25')));var _0x57b59c=[];for(var _0xefae9d=0x0;_0xefae9d<_0x55a92c[_0x4cae('0x26')];_0xefae9d++){var _0x5846bb=_0x55a92c[_0xefae9d][_0x4cae('0x27')](_0x4cae('0x28'),'');if(compareVersions(module[_0x4cae('0xd')][_0x4cae('0x4')],_0x5846bb)===-0x1){_0x57b59c[_0x4cae('0x29')](_0x5846bb);}}if(_0x57b59c[_0x4cae('0x26')]){var _0x28d3f8=_0x57b59c[_0x4cae('0x2a')](compareVersions);var _0x11dbc0=new Umzug({'storage':_0x4cae('0x2b'),'storageOptions':{'model':db[_0x4cae('0x2c')],'modelName':_0x4cae('0x2c'),'columnName':_0x4cae('0x4')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x4cae('0x2b')][_0x4cae('0x2d')],function(){throw new Error(_0x4cae('0x2e'));}],'path':path['join'](config[_0x4cae('0xb')],_0x4cae('0x2f'),_0x4cae('0x25')),'pattern':/\.js$/}});_0x11dbc0['up']({'migrations':_['map'](_0x28d3f8,function(_0x75694c){return _0x75694c+_0x4cae('0x28');})})[_0x4cae('0x20')](function(){return _0x4f61a9[_0x4cae('0x13')](0xc8)['json']({'output':_0x4cae('0x30')+module[_0x4cae('0xd')][_0x4cae('0x4')]+_0x4cae('0x31')+_[_0x4cae('0x32')](_0x28d3f8),'migrations':_[_0x4cae('0x24')](_0x28d3f8)});})[_0x4cae('0x23')](function(_0x48d796){if(_0x48d796 instanceof db[_0x4cae('0x2b')]['UniqueConstraintError']){return _0x4f61a9['status'](0xc8)[_0x4cae('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x4f61a9[_0x4cae('0x13')](0x1f4)[_0x4cae('0x14')](_0x48d796);}});}else{return _0x4f61a9['status'](0xc8)[_0x4cae('0x14')]({'output':_0x4cae('0x33')});}}; \ No newline at end of file +var _0x7d2c=['FETCH_HEAD','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','.js','push','length','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','version','query','fetch','tags','latest','2.0.0','status','origin','master','json','info','git\x20fetch','reset','--hard'];(function(_0x405c97,_0x3a9aeb){var _0x4bba8f=function(_0x354926){while(--_0x354926){_0x405c97['push'](_0x405c97['shift']());}};_0x4bba8f(++_0x3a9aeb);}(_0x7d2c,0x82));var _0xc7d2=function(_0x1e2a97,_0x156023){_0x1e2a97=_0x1e2a97-0x0;var _0xd6dcf0=_0x7d2c[_0x1e2a97];return _0xd6dcf0;};'use strict';var Umzug=require(_0xc7d2('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xc7d2('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require(_0xc7d2('0x2'))[_0xc7d2('0x3')];var db=require(_0xc7d2('0x4'))['db'];var config=require(_0xc7d2('0x5'));var pm2=require(_0xc7d2('0x6'));var logger=require(_0xc7d2('0x7'))(_0xc7d2('0x8'));var git=require(_0xc7d2('0x9'))(config[_0xc7d2('0xa')]);exports['index']=function(_0x318690,_0x5609f0){var _0x1d4f45={'current':module[_0xc7d2('0xb')][_0xc7d2('0xc')],'phonebar':0x2};if(_0x318690[_0xc7d2('0xd')]&&_0x318690['query']['latest']){return git[_0xc7d2('0xe')]()[_0xc7d2('0xf')](function(_0xc49532,_0x372972){_0x1d4f45['latest']=(_0xc49532?module[_0xc7d2('0xb')][_0xc7d2('0xc')]:_0x372972[_0xc7d2('0x10')])||_0xc7d2('0x11');return _0x5609f0[_0xc7d2('0x12')](0xc8)['json'](_0x1d4f45);});}else{return _0x5609f0[_0xc7d2('0x12')](0xc8)['json'](_0x1d4f45);}};exports[_0xc7d2('0xe')]=function(_0xf5a90a,_0x1b4bd5){return git[_0xc7d2('0xe')]([_0xc7d2('0x13'),_0xc7d2('0x14')],function(_0x46ccb6){if(_0x46ccb6){logger['error'](_0x46ccb6);return _0x1b4bd5[_0xc7d2('0x12')](0x1f4)[_0xc7d2('0x15')](_0x46ccb6);}logger[_0xc7d2('0x16')](_0xc7d2('0x17'));return _0x1b4bd5[_0xc7d2('0x12')](0xc8)[_0xc7d2('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x3135ee,_0x1fa2b0){return git[_0xc7d2('0x18')]([_0xc7d2('0x19'),_0xc7d2('0x1a')],function(_0x18582a){if(_0x18582a){logger[_0xc7d2('0x1b')](_0x18582a);return _0x1fa2b0[_0xc7d2('0x12')](0x1f4)[_0xc7d2('0x15')](_0x18582a);}logger[_0xc7d2('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1fa2b0['status'](0xc8)[_0xc7d2('0x15')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x280ec4,_0x67dea3){exec('npm\x20install\x20--production',function(_0x5889eb,_0x5975f4,_0x133e1a){logger[_0xc7d2('0x16')](_0x5975f4);logger[_0xc7d2('0x16')](_0x133e1a);if(_0x5889eb){logger[_0xc7d2('0x1b')](_0x5889eb);return _0x67dea3[_0xc7d2('0x12')](0x1f4)[_0xc7d2('0x15')](_0x5889eb);}return _0x67dea3[_0xc7d2('0x12')](0xc8)[_0xc7d2('0x15')]({'output':_0x5975f4});});};exports[_0xc7d2('0x1c')]=function(_0xf26c0,_0x213898){return pm2[_0xc7d2('0x1c')](_0xc7d2('0x1d'))[_0xc7d2('0x1e')](function(_0x828596){logger['info'](_0xc7d2('0x1f'),_0x828596);return _0x213898['status'](0xc8)[_0xc7d2('0x15')]({'output':_0xc7d2('0x20')});})[_0xc7d2('0x21')](function(_0x378efe){logger[_0xc7d2('0x1b')](_0x378efe);return _0x213898[_0xc7d2('0x12')](0x1f4)[_0xc7d2('0x15')](_0x378efe);});};exports['migrations']=function(_0xb4cfa2,_0x42a540){var _0x26c729=fs[_0xc7d2('0x22')](path[_0xc7d2('0x23')](config[_0xc7d2('0xa')],_0xc7d2('0x24'),_0xc7d2('0x25')));var _0x41a60b=[];for(var _0x5f3ebc=0x0;_0x5f3ebc<_0x26c729['length'];_0x5f3ebc++){var _0x3e68a6=_0x26c729[_0x5f3ebc]['replace'](_0xc7d2('0x26'),'');if(compareVersions(module['exports'][_0xc7d2('0xc')],_0x3e68a6)===-0x1){_0x41a60b[_0xc7d2('0x27')](_0x3e68a6);}}if(_0x41a60b[_0xc7d2('0x28')]){var _0x300606=_0x41a60b[_0xc7d2('0x29')](compareVersions);var _0x58e723=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xc7d2('0x2a')],'modelName':_0xc7d2('0x2a'),'columnName':'version'},'migrations':{'params':[db[_0xc7d2('0x2b')][_0xc7d2('0x2c')](),db[_0xc7d2('0x2b')][_0xc7d2('0x2d')],function(){throw new Error(_0xc7d2('0x2e'));}],'path':path['join'](config[_0xc7d2('0xa')],'server',_0xc7d2('0x25')),'pattern':/\.js$/}});_0x58e723['up']({'migrations':_['map'](_0x300606,function(_0x211ed7){return _0x211ed7+_0xc7d2('0x26');})})[_0xc7d2('0x1e')](function(){return _0x42a540[_0xc7d2('0x12')](0xc8)[_0xc7d2('0x15')]({'output':_0xc7d2('0x2f')+module[_0xc7d2('0xb')][_0xc7d2('0xc')]+_0xc7d2('0x30')+_[_0xc7d2('0x31')](_0x300606),'migrations':_[_0xc7d2('0x23')](_0x300606)});})['catch'](function(_0x259645){if(_0x259645 instanceof db[_0xc7d2('0x2b')][_0xc7d2('0x32')]){return _0x42a540[_0xc7d2('0x12')](0xc8)['json']({'output':_0xc7d2('0x33')});}else{return _0x42a540['status'](0x1f4)[_0xc7d2('0x15')](_0x259645);}});}else{return _0x42a540[_0xc7d2('0x12')](0xc8)[_0xc7d2('0x15')]({'output':_0xc7d2('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 39a481b..70fa860 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 _0xed44=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','describe','isAuthenticated','show','post','create','put','/:id'];(function(_0x1a660d,_0x182bba){var _0x3c1a19=function(_0x49f149){while(--_0x49f149){_0x1a660d['push'](_0x1a660d['shift']());}};_0x3c1a19(++_0x182bba);}(_0xed44,0x1f2));var _0x4ed4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xed44[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x4ed4('0x0'));var path=require(_0x4ed4('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ed4('0x2'));var router=express[_0x4ed4('0x3')]();var fs_extra=require(_0x4ed4('0x4'));var auth=require(_0x4ed4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4ed4('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x4ed4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ed4('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x4ed4('0x8')]);router[_0x4ed4('0x7')]('/:id',auth[_0x4ed4('0x9')](),controller[_0x4ed4('0xa')]);router[_0x4ed4('0xb')]('/',auth[_0x4ed4('0x9')](),controller[_0x4ed4('0xc')]);router[_0x4ed4('0xd')](_0x4ed4('0xe'),auth[_0x4ed4('0x9')](),controller[_0x4ed4('0xf')]);router[_0x4ed4('0x10')](_0x4ed4('0xe'),auth[_0x4ed4('0x9')](),controller[_0x4ed4('0x11')]);module[_0x4ed4('0x12')]=router; \ No newline at end of file +var _0xe218=['show','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xe218,0xef));var _0x8e21=function(_0x4552ea,_0x5c6323){_0x4552ea=_0x4552ea-0x0;var _0x45499a=_0xe218[_0x4552ea];return _0x45499a;};'use strict';var multer=require(_0x8e21('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8e21('0x1'));var express=require(_0x8e21('0x2'));var router=express[_0x8e21('0x3')]();var fs_extra=require(_0x8e21('0x4'));var auth=require(_0x8e21('0x5'));var interaction=require(_0x8e21('0x6'));var config=require('../../config/environment');var controller=require(_0x8e21('0x7'));router[_0x8e21('0x8')]('/',auth[_0x8e21('0x9')](),controller[_0x8e21('0xa')]);router[_0x8e21('0x8')](_0x8e21('0xb'),auth[_0x8e21('0x9')](),controller[_0x8e21('0xc')]);router[_0x8e21('0x8')]('/:id',auth[_0x8e21('0x9')](),controller[_0x8e21('0xd')]);router[_0x8e21('0xe')]('/',auth[_0x8e21('0x9')](),controller['create']);router[_0x8e21('0xf')](_0x8e21('0x10'),auth[_0x8e21('0x9')](),controller[_0x8e21('0x11')]);router[_0x8e21('0x12')]('/:id',auth[_0x8e21('0x9')](),controller[_0x8e21('0x13')]);module[_0x8e21('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index cf02605..4f361fb 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 _0x02ce=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x45fb76,_0x35fd5d){var _0x338556=function(_0x526a58){while(--_0x526a58){_0x45fb76['push'](_0x45fb76['shift']());}};_0x338556(++_0x35fd5d);}(_0x02ce,0x1ac));var _0xe02c=function(_0x24c57e,_0x37b71e){_0x24c57e=_0x24c57e-0x0;var _0x1bf46b=_0x02ce[_0x24c57e];return _0x1bf46b;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'type':{'type':Sequelize[_0xe02c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe02c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe02c('0x2')]},'interface':{'type':Sequelize[_0xe02c('0x2')]},'membername':{'type':Sequelize[_0xe02c('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe02c('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe02c('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xe02c('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xe02c('0x3')]},'agentdumpAt':{'type':Sequelize[_0xe02c('0x3')]},'holdtime':{'type':Sequelize[_0xe02c('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe02c('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe02c('0x4')]},'agentacw':{'type':Sequelize[_0xe02c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe02c('0x4')]},'reason':{'type':Sequelize[_0xe02c('0x2')]},'lastevent':{'type':Sequelize[_0xe02c('0x2')]},'channel':{'type':Sequelize[_0xe02c('0x2')]},'channelstate':{'type':Sequelize[_0xe02c('0x4')]},'channelstatedesc':{'type':Sequelize[_0xe02c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe02c('0x2')]},'connectedlinename':{'type':Sequelize[_0xe02c('0x2')]},'language':{'type':Sequelize[_0xe02c('0x2')]},'accountcode':{'type':Sequelize[_0xe02c('0x2')]},'context':{'type':Sequelize[_0xe02c('0x2')]},'exten':{'type':Sequelize[_0xe02c('0x2')]},'priority':{'type':Sequelize[_0xe02c('0x2')]},'destchannel':{'type':Sequelize[_0xe02c('0x2')]},'destchannelstate':{'type':Sequelize[_0xe02c('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe02c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe02c('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe02c('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe02c('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xe02c('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe02c('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xe02c('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe02c('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xe02c('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe02c('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x753c=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x21c48,_0x49ac0a){var _0x1f2cea=function(_0x51a5eb){while(--_0x51a5eb){_0x21c48['push'](_0x21c48['shift']());}};_0x1f2cea(++_0x49ac0a);}(_0x753c,0x96));var _0xc753=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x753c[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0xc753('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc753('0x1')]},'calleridnum':{'type':Sequelize[_0xc753('0x1')]},'calleridname':{'type':Sequelize[_0xc753('0x1')]},'queue':{'type':Sequelize[_0xc753('0x1')]},'interface':{'type':Sequelize[_0xc753('0x1')]},'membername':{'type':Sequelize[_0xc753('0x1')]},'agentcalledAt':{'type':Sequelize[_0xc753('0x2')]},'agentconnectAt':{'type':Sequelize[_0xc753('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xc753('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xc753('0x2')]},'agentdumpAt':{'type':Sequelize[_0xc753('0x2')]},'holdtime':{'type':Sequelize[_0xc753('0x3')]},'agentcomplete':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc753('0x3')]},'agentacw':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc753('0x3')]},'reason':{'type':Sequelize[_0xc753('0x1')]},'lastevent':{'type':Sequelize[_0xc753('0x1')]},'channel':{'type':Sequelize[_0xc753('0x1')]},'channelstate':{'type':Sequelize[_0xc753('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc753('0x1')]},'connectedlinenum':{'type':Sequelize[_0xc753('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc753('0x1')]},'accountcode':{'type':Sequelize[_0xc753('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xc753('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xc753('0x1')]},'destchannelstate':{'type':Sequelize[_0xc753('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xc753('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc753('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xc753('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xc753('0x1')]},'destcontext':{'type':Sequelize[_0xc753('0x1')]},'destexten':{'type':Sequelize[_0xc753('0x1')]},'destpriority':{'type':Sequelize[_0xc753('0x1')]},'destuniqueid':{'type':Sequelize[_0xc753('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xc753('0x1')]},'transfer':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc753('0x1')],'comment':_0xc753('0x5')},'transferexten':{'type':Sequelize[_0xc753('0x1')]},'transferuniqueid':{'type':Sequelize[_0xc753('0x1')]},'agententerreason':{'type':Sequelize[_0xc753('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 1f4966a..5ed9602 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 873e8de..113fda8 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 _0xd13e=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0xd13e,0x193));var _0xed13=function(_0x26476e,_0x521e74){_0x26476e=_0x26476e-0x0;var _0x1aea62=_0xd13e[_0x26476e];return _0x1aea62;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var logger=require(_0xed13('0x2'))(_0xed13('0x3'));var moment=require('moment');var BPromise=require(_0xed13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed13('0x5'));var rimraf=require('rimraf');var config=require(_0xed13('0x6'));var attributes=require(_0xed13('0x7'));module['exports']=function(_0x50de44,_0x5142bd){return _0x50de44[_0xed13('0x8')](_0xed13('0x9'),attributes,{'tableName':_0xed13('0xa'),'paranoid':![],'indexes':[{'fields':[_0xed13('0xb'),_0xed13('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x097c=['bluebird','request-promise','path','../../config/environment','exports','define','report_agent','lodash','util','../../config/logger','moment'];(function(_0x74fb6b,_0x4a5e61){var _0x2520da=function(_0x5c63f7){while(--_0x5c63f7){_0x74fb6b['push'](_0x74fb6b['shift']());}};_0x2520da(++_0x4a5e61);}(_0x097c,0x1d5));var _0xc097=function(_0x1b92e9,_0x53f2e1){_0x1b92e9=_0x1b92e9-0x0;var _0x3eb03d=_0x097c[_0x1b92e9];return _0x3eb03d;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var logger=require(_0xc097('0x2'))('api');var moment=require(_0xc097('0x3'));var BPromise=require(_0xc097('0x4'));var rp=require(_0xc097('0x5'));var fs=require('fs');var path=require(_0xc097('0x6'));var rimraf=require('rimraf');var config=require(_0xc097('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0xc097('0x8')]=function(_0x3c9603,_0x31bc9a){return _0x3c9603[_0xc097('0x9')]('VoiceAgentReport',attributes,{'tableName':_0xc097('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid','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 97c4c48..1515fe0 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 _0x1545=['debug','UpdateVoiceAgentReport','VoiceAgentReport','update','options','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','body'];(function(_0x468206,_0x2514ca){var _0x3e4378=function(_0xb00a19){while(--_0xb00a19){_0x468206['push'](_0x468206['shift']());}};_0x3e4378(++_0x2514ca);}(_0x1545,0x144));var _0x5154=function(_0x2fc130,_0x1e4dc0){_0x2fc130=_0x2fc130-0x0;var _0xd5a6d1=_0x1545[_0x2fc130];return _0xd5a6d1;};'use strict';var _=require('lodash');var util=require(_0x5154('0x0'));var moment=require(_0x5154('0x1'));var BPromise=require(_0x5154('0x2'));var rs=require(_0x5154('0x3'));var fs=require('fs');var Redis=require(_0x5154('0x4'));var db=require(_0x5154('0x5'))['db'];var utils=require(_0x5154('0x6'));var logger=require(_0x5154('0x7'))(_0x5154('0x8'));var config=require(_0x5154('0x9'));var jayson=require(_0x5154('0xa'));var client=jayson['client'][_0x5154('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14c3c9,_0x5fcbec,_0x5434ed){return new BPromise(function(_0x3e7e88,_0x319546){return client[_0x5154('0xc')](_0x14c3c9,_0x5434ed)[_0x5154('0xd')](function(_0x2ca59c){logger[_0x5154('0xe')](_0x5154('0xf'),_0x5fcbec,_0x5154('0x10'));logger['debug'](_0x5154('0x11'),_0x5fcbec,'request\x20sent',JSON[_0x5154('0x12')](_0x2ca59c));if(_0x2ca59c[_0x5154('0x13')]){if(_0x2ca59c[_0x5154('0x13')][_0x5154('0x14')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x5fcbec,_0x2ca59c[_0x5154('0x13')][_0x5154('0x15')]);return _0x319546(_0x2ca59c['error'][_0x5154('0x15')]);}logger[_0x5154('0x13')](_0x5154('0xf'),_0x5fcbec,_0x2ca59c['error'][_0x5154('0x15')]);return _0x3e7e88(_0x2ca59c[_0x5154('0x13')][_0x5154('0x15')]);}else{logger[_0x5154('0xe')](_0x5154('0xf'),_0x5fcbec,_0x5154('0x10'));_0x3e7e88(_0x2ca59c[_0x5154('0x16')][_0x5154('0x15')]);}})[_0x5154('0x17')](function(_0xe1067a){logger['error'](_0x5154('0xf'),_0x5fcbec,_0xe1067a);_0x319546(_0xe1067a);});});}exports[_0x5154('0x18')]=function(_0x1db751){var _0x352225=this;return new Promise(function(_0x444109,_0x354e06){return db['VoiceAgentReport']['create'](_0x1db751[_0x5154('0x19')],{'raw':_0x1db751['options']?_0x1db751['options']['raw']===undefined?!![]:![]:!![]})[_0x5154('0xd')](function(_0x784190){logger[_0x5154('0xe')]('CreateVoiceAgentReport',_0x1db751);logger[_0x5154('0x1a')]('CreateVoiceAgentReport',_0x1db751,JSON['stringify'](_0x784190));_0x444109(_0x784190);})[_0x5154('0x17')](function(_0xa2d5c4){logger[_0x5154('0x13')](_0x5154('0x18'),_0xa2d5c4[_0x5154('0x15')],_0x1db751);_0x354e06(_0x352225[_0x5154('0x13')](0x1f4,_0xa2d5c4[_0x5154('0x15')]));});});};exports[_0x5154('0x1b')]=function(_0x3b3b37){var _0x1e4701=this;return new Promise(function(_0x4d87f5,_0x2efb7b){return db[_0x5154('0x1c')][_0x5154('0x1d')](_0x3b3b37[_0x5154('0x19')],{'raw':_0x3b3b37[_0x5154('0x1e')]?_0x3b3b37[_0x5154('0x1e')][_0x5154('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b3b37[_0x5154('0x1e')]?_0x3b3b37[_0x5154('0x1e')][_0x5154('0x20')]||null:null,'attributes':_0x3b3b37[_0x5154('0x1e')]?_0x3b3b37[_0x5154('0x1e')][_0x5154('0x21')]||null:null,'limit':_0x3b3b37[_0x5154('0x1e')]?_0x3b3b37[_0x5154('0x1e')][_0x5154('0x22')]||null:null})[_0x5154('0xd')](function(_0x37f3d4){logger[_0x5154('0xe')]('UpdateVoiceAgentReport',_0x3b3b37);logger[_0x5154('0x1a')](_0x5154('0x1b'),_0x3b3b37,JSON['stringify'](_0x37f3d4));_0x4d87f5(_0x37f3d4);})[_0x5154('0x17')](function(_0x5e834a){logger[_0x5154('0x13')](_0x5154('0x1b'),_0x5e834a[_0x5154('0x15')],_0x3b3b37);_0x2efb7b(_0x1e4701[_0x5154('0x13')](0x1f4,_0x5e834a[_0x5154('0x15')]));});});}; \ No newline at end of file +var _0x9f0d=['lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','UpdateVoiceAgentReport','options','raw','where','limit','then'];(function(_0x35e84b,_0x454479){var _0x4fb29e=function(_0x551707){while(--_0x551707){_0x35e84b['push'](_0x35e84b['shift']());}};_0x4fb29e(++_0x454479);}(_0x9f0d,0x186));var _0xd9f0=function(_0x2557ad,_0x825cdb){_0x2557ad=_0x2557ad-0x0;var _0x45b8c6=_0x9f0d[_0x2557ad];return _0x45b8c6;};'use strict';var _=require(_0xd9f0('0x0'));var util=require(_0xd9f0('0x1'));var moment=require(_0xd9f0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9f0('0x3'))['db'];var utils=require(_0xd9f0('0x4'));var logger=require(_0xd9f0('0x5'))(_0xd9f0('0x6'));var config=require(_0xd9f0('0x7'));var jayson=require(_0xd9f0('0x8'));var client=jayson['client'][_0xd9f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d3bb1,_0x4ed1a9,_0x5e54ee){return new BPromise(function(_0x35123c,_0x24ea7d){return client[_0xd9f0('0xa')](_0x2d3bb1,_0x5e54ee)['then'](function(_0x34fc9c){logger[_0xd9f0('0xb')](_0xd9f0('0xc'),_0x4ed1a9,_0xd9f0('0xd'));logger[_0xd9f0('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x4ed1a9,'request\x20sent',JSON[_0xd9f0('0xf')](_0x34fc9c));if(_0x34fc9c['error']){if(_0x34fc9c['error'][_0xd9f0('0x10')]===0x1f4){logger[_0xd9f0('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x4ed1a9,_0x34fc9c['error'][_0xd9f0('0x12')]);return _0x24ea7d(_0x34fc9c[_0xd9f0('0x11')]['message']);}logger['error'](_0xd9f0('0xc'),_0x4ed1a9,_0x34fc9c[_0xd9f0('0x11')][_0xd9f0('0x12')]);return _0x35123c(_0x34fc9c[_0xd9f0('0x11')]['message']);}else{logger[_0xd9f0('0xb')](_0xd9f0('0xc'),_0x4ed1a9,_0xd9f0('0xd'));_0x35123c(_0x34fc9c['result'][_0xd9f0('0x12')]);}})[_0xd9f0('0x13')](function(_0x81c688){logger[_0xd9f0('0x11')](_0xd9f0('0xc'),_0x4ed1a9,_0x81c688);_0x24ea7d(_0x81c688);});});}exports[_0xd9f0('0x14')]=function(_0x54e41d){var _0x17e574=this;return new Promise(function(_0x214948,_0x2d0da1){return db[_0xd9f0('0x15')][_0xd9f0('0x16')](_0x54e41d[_0xd9f0('0x17')],{'raw':_0x54e41d['options']?_0x54e41d['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x56e85c){logger[_0xd9f0('0xb')](_0xd9f0('0x14'),_0x54e41d);logger['debug'](_0xd9f0('0x14'),_0x54e41d,JSON[_0xd9f0('0xf')](_0x56e85c));_0x214948(_0x56e85c);})[_0xd9f0('0x13')](function(_0x15c994){logger[_0xd9f0('0x11')](_0xd9f0('0x14'),_0x15c994[_0xd9f0('0x12')],_0x54e41d);_0x2d0da1(_0x17e574[_0xd9f0('0x11')](0x1f4,_0x15c994[_0xd9f0('0x12')]));});});};exports[_0xd9f0('0x18')]=function(_0xcc99a6){var _0x627bd9=this;return new Promise(function(_0x126fef,_0xa6c0f2){return db[_0xd9f0('0x15')]['update'](_0xcc99a6[_0xd9f0('0x17')],{'raw':_0xcc99a6[_0xd9f0('0x19')]?_0xcc99a6[_0xd9f0('0x19')][_0xd9f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcc99a6[_0xd9f0('0x19')]?_0xcc99a6[_0xd9f0('0x19')][_0xd9f0('0x1b')]||null:null,'attributes':_0xcc99a6[_0xd9f0('0x19')]?_0xcc99a6[_0xd9f0('0x19')]['attributes']||null:null,'limit':_0xcc99a6[_0xd9f0('0x19')]?_0xcc99a6[_0xd9f0('0x19')][_0xd9f0('0x1c')]||null:null})[_0xd9f0('0x1d')](function(_0x122ff0){logger[_0xd9f0('0xb')](_0xd9f0('0x18'),_0xcc99a6);logger[_0xd9f0('0xe')](_0xd9f0('0x18'),_0xcc99a6,JSON[_0xd9f0('0xf')](_0x122ff0));_0x126fef(_0x122ff0);})[_0xd9f0('0x13')](function(_0x55b871){logger[_0xd9f0('0x11')](_0xd9f0('0x18'),_0x55b871['message'],_0xcc99a6);_0xa6c0f2(_0x627bd9[_0xd9f0('0x11')](0x1f4,_0x55b871[_0xd9f0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index cefe5de..f96264b 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 _0x0281=['create','update','/with-retry/:id','updateWithRetry','delete','exports','express','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x129015,_0x586c48){var _0x137f96=function(_0x27daa7){while(--_0x27daa7){_0x129015['push'](_0x129015['shift']());}};_0x137f96(++_0x586c48);}(_0x0281,0xe3));var _0x1028=function(_0x22512,_0x4e772c){_0x22512=_0x22512-0x0;var _0x429609=_0x0281[_0x22512];return _0x429609;};'use strict';var express=require(_0x1028('0x0'));var router=express[_0x1028('0x1')]();var auth=require(_0x1028('0x2'));var controller=require(_0x1028('0x3'));router[_0x1028('0x4')]('/',auth[_0x1028('0x5')](),controller[_0x1028('0x6')]);router[_0x1028('0x4')](_0x1028('0x7'),auth[_0x1028('0x5')](),controller['describe']);router[_0x1028('0x4')](_0x1028('0x8'),auth[_0x1028('0x5')](),controller[_0x1028('0x9')]);router[_0x1028('0xa')]('/',auth[_0x1028('0x5')](),controller[_0x1028('0xb')]);router['put'](_0x1028('0x8'),auth[_0x1028('0x5')](),controller[_0x1028('0xc')]);router['put'](_0x1028('0xd'),auth['isAuthenticated'](),controller[_0x1028('0xe')]);router[_0x1028('0xf')](_0x1028('0x8'),auth[_0x1028('0x5')](),controller['destroy']);module[_0x1028('0x10')]=router; \ No newline at end of file +var _0x06a8=['/:id','show','post','create','put','update','updateWithRetry','destroy','express','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe'];(function(_0x33603a,_0x1a717a){var _0x4cf0ad=function(_0x2232f6){while(--_0x2232f6){_0x33603a['push'](_0x33603a['shift']());}};_0x4cf0ad(++_0x1a717a);}(_0x06a8,0x1a8));var _0x806a=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x06a8[_0x616290];return _0x453879;};'use strict';var express=require(_0x806a('0x0'));var router=express[_0x806a('0x1')]();var auth=require(_0x806a('0x2'));var controller=require(_0x806a('0x3'));router[_0x806a('0x4')]('/',auth[_0x806a('0x5')](),controller[_0x806a('0x6')]);router[_0x806a('0x4')](_0x806a('0x7'),auth[_0x806a('0x5')](),controller['describe']);router['get'](_0x806a('0x8'),auth['isAuthenticated'](),controller[_0x806a('0x9')]);router[_0x806a('0xa')]('/',auth['isAuthenticated'](),controller[_0x806a('0xb')]);router[_0x806a('0xc')](_0x806a('0x8'),auth[_0x806a('0x5')](),controller[_0x806a('0xd')]);router[_0x806a('0xc')]('/with-retry/:id',auth[_0x806a('0x5')](),controller[_0x806a('0xe')]);router['delete'](_0x806a('0x8'),auth[_0x806a('0x5')](),controller[_0x806a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a25bd51..c8a55a7 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 _0x8066=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound-fax'];(function(_0x115d41,_0x44266a){var _0x248902=function(_0x5e8f2c){while(--_0x5e8f2c){_0x115d41['push'](_0x115d41['shift']());}};_0x248902(++_0x44266a);}(_0x8066,0x192));var _0x6806=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x8066[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x6806('0x0'));module[_0x6806('0x1')]={'uniqueid':{'type':Sequelize[_0x6806('0x2')]},'type':{'type':Sequelize[_0x6806('0x3')](_0x6806('0x4'),'internal','outbound','inbound-fax',_0x6806('0x5'),'dialer')},'tag':{'type':Sequelize[_0x6806('0x2')]},'accountcode':{'type':Sequelize[_0x6806('0x2')]},'source':{'type':Sequelize[_0x6806('0x2')]},'destination':{'type':Sequelize[_0x6806('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6806('0x2')]},'destinationchannel':{'type':Sequelize[_0x6806('0x2')]},'lastapplication':{'type':Sequelize[_0x6806('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x6806('0x6')]},'systemanswertime':{'type':Sequelize[_0x6806('0x6')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6806('0x6')]},'duration':{'type':Sequelize[_0x6806('0x7')]},'billableseconds':{'type':Sequelize[_0x6806('0x7')]},'mohtime':{'type':Sequelize[_0x6806('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x6806('0x2')]},'userfield':{'type':Sequelize[_0x6806('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6806('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x6806('0x2')]}}; \ No newline at end of file +var _0x4255=['dialer','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4255,0x1bb));var _0x5425=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x4255[_0x51c819];return _0x15c5d2;};'use strict';var Sequelize=require(_0x5425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5425('0x1')]},'type':{'type':Sequelize[_0x5425('0x2')](_0x5425('0x3'),_0x5425('0x4'),'outbound',_0x5425('0x5'),_0x5425('0x6'),_0x5425('0x7'))},'tag':{'type':Sequelize[_0x5425('0x1')]},'accountcode':{'type':Sequelize[_0x5425('0x1')]},'source':{'type':Sequelize[_0x5425('0x1')]},'destination':{'type':Sequelize[_0x5425('0x1')]},'destinationcontext':{'type':Sequelize[_0x5425('0x1')]},'callerid':{'type':Sequelize[_0x5425('0x1')]},'channel':{'type':Sequelize[_0x5425('0x1')]},'destinationchannel':{'type':Sequelize[_0x5425('0x1')]},'lastapplication':{'type':Sequelize[_0x5425('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x5425('0x8')]},'systemanswertime':{'type':Sequelize[_0x5425('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5425('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5425('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x5425('0x1')]},'userfield':{'type':Sequelize[_0x5425('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x5425('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5425('0x1')]},'prefix':{'type':Sequelize[_0x5425('0x1')]},'routeid':{'type':Sequelize[_0x5425('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index cdb4b08..5314aae 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 _0x7c7f=['query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','fullname','alias','User','findAll','rows','show','params','includeAll','include','find','catch','body','describe','uniqueid','updateWithRetry','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','promise-retry','offset','undefined','limit','count','status','set','json','update','then','destroy','end','stack','name','index','VoiceCallReport','rawAttributes','fieldName','type','key','map'];(function(_0x24f10d,_0x226a4c){var _0xd85f94=function(_0x3871a1){while(--_0x3871a1){_0x24f10d['push'](_0x24f10d['shift']());}};_0xd85f94(++_0x226a4c);}(_0x7c7f,0x1ae));var _0xf7c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7c7f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf7c7('0x0'));var qs=require(_0xf7c7('0x1'));var logger=require(_0xf7c7('0x2'))(_0xf7c7('0x3'));var db=require(_0xf7c7('0x4'))['db'];const promiseRetry=require(_0xf7c7('0x5'));function respondWithResult(_0x3e441f,_0x159113){_0x159113=_0x159113||0xc8;return function(_0x3e04f1){if(_0x3e04f1){return _0x3e441f['status'](_0x159113)['json'](_0x3e04f1);}};}function respondWithFilteredResult(_0xbe2954,_0x1877ad){return function(_0x2046e7){if(_0x2046e7){var _0x4b979d=typeof _0x1877ad[_0xf7c7('0x6')]===_0xf7c7('0x7')&&typeof _0x1877ad[_0xf7c7('0x8')]===_0xf7c7('0x7');var _0x8e8931=_0x2046e7[_0xf7c7('0x9')];var _0x4ced70=_0x4b979d?0x0:_0x1877ad[_0xf7c7('0x6')];var _0x329b9a=_0x4b979d?_0x2046e7[_0xf7c7('0x9')]:_0x1877ad['offset']+_0x1877ad[_0xf7c7('0x8')];var _0x24a2b0;if(_0x329b9a>=_0x8e8931){_0x329b9a=_0x8e8931;_0x24a2b0=0xc8;}else{_0x24a2b0=0xce;}_0xbe2954[_0xf7c7('0xa')](_0x24a2b0);return _0xbe2954[_0xf7c7('0xb')]('Content-Range',_0x4ced70+'-'+_0x329b9a+'/'+_0x8e8931)[_0xf7c7('0xc')](_0x2046e7);}return null;};}function saveUpdates(_0x27d381){return function(_0x3da94f){if(_0x3da94f){return _0x3da94f[_0xf7c7('0xd')](_0x27d381)[_0xf7c7('0xe')](function(_0x46cf4e){return _0x46cf4e;});}return null;};}function removeEntity(_0x55129f){return function(_0x20338f){if(_0x20338f){return _0x20338f[_0xf7c7('0xf')]()[_0xf7c7('0xe')](function(){_0x55129f[_0xf7c7('0xa')](0xcc)[_0xf7c7('0x10')]();});}};}function handleEntityNotFound(_0x15549d){return function(_0x4637e6){if(!_0x4637e6){_0x15549d['sendStatus'](0x194);}return _0x4637e6;};}function handleError(_0x1f209f,_0x532c99){_0x532c99=_0x532c99||0x1f4;return function(_0x2d3d34){logger['error'](_0x2d3d34[_0xf7c7('0x11')]);if(_0x2d3d34[_0xf7c7('0x12')]){delete _0x2d3d34[_0xf7c7('0x12')];}_0x1f209f['status'](_0x532c99)['send'](_0x2d3d34);};}exports[_0xf7c7('0x13')]=function(_0x910ab4,_0x4c95ac){var _0x454e5b={},_0x184982={},_0x4f298f={'count':0x0,'rows':[]};var _0xdc06bc=_['map'](db[_0xf7c7('0x14')][_0xf7c7('0x15')],function(_0x122f1d){return{'name':_0x122f1d[_0xf7c7('0x16')],'type':_0x122f1d[_0xf7c7('0x17')][_0xf7c7('0x18')]};});_0x184982['model']=_[_0xf7c7('0x19')](_0xdc06bc,_0xf7c7('0x12'));_0x184982[_0xf7c7('0x1a')]=_[_0xf7c7('0x1b')](_0x910ab4[_0xf7c7('0x1a')]);_0x184982['filters']=_[_0xf7c7('0x1c')](_0x184982[_0xf7c7('0x1d')],_0x184982[_0xf7c7('0x1a')]);_0x454e5b['attributes']=_[_0xf7c7('0x1c')](_0x184982[_0xf7c7('0x1d')],qs[_0xf7c7('0x1e')](_0x910ab4[_0xf7c7('0x1a')][_0xf7c7('0x1e')]));_0x454e5b['attributes']=_0x454e5b[_0xf7c7('0x1f')][_0xf7c7('0x20')]?_0x454e5b[_0xf7c7('0x1f')]:_0x184982[_0xf7c7('0x1d')];if(!_0x910ab4[_0xf7c7('0x1a')][_0xf7c7('0x21')]('nolimit')){_0x454e5b[_0xf7c7('0x8')]=qs[_0xf7c7('0x8')](_0x910ab4[_0xf7c7('0x1a')]['limit']);_0x454e5b['offset']=qs[_0xf7c7('0x6')](_0x910ab4['query'][_0xf7c7('0x6')]);}_0x454e5b[_0xf7c7('0x22')]=qs['sort'](_0x910ab4[_0xf7c7('0x1a')][_0xf7c7('0x23')]);_0x454e5b[_0xf7c7('0x24')]=qs['filters'](_[_0xf7c7('0x25')](_0x910ab4['query'],_0x184982[_0xf7c7('0x26')]),_0xdc06bc);if(_0x910ab4['query'][_0xf7c7('0x27')]){_0x454e5b[_0xf7c7('0x24')]=_[_0xf7c7('0x28')](_0x454e5b['where'],{'$or':_['map'](_0xdc06bc,function(_0x2f8d3b){if(_0x2f8d3b[_0xf7c7('0x17')]!=='VIRTUAL'){var _0x23ac85={};_0x23ac85[_0x2f8d3b['name']]={'$like':'%'+_0x910ab4[_0xf7c7('0x1a')][_0xf7c7('0x27')]+'%'};return _0x23ac85;}})});}_0x454e5b=_[_0xf7c7('0x28')]({},_0x454e5b,_0x910ab4[_0xf7c7('0x29')]);var _0x3ad183={'where':_0x454e5b['where']};return db[_0xf7c7('0x14')][_0xf7c7('0x9')](_0x3ad183)[_0xf7c7('0xe')](function(_0x23fb65){_0x4f298f[_0xf7c7('0x9')]=_0x23fb65;if(_0x910ab4['query']['includeAll']){_0x454e5b['include']=[{'attributes':['id',_0xf7c7('0x12'),_0xf7c7('0x2a'),_0xf7c7('0x2b')],'model':db[_0xf7c7('0x2c')],'as':_0xf7c7('0x2c')}];}return db[_0xf7c7('0x14')][_0xf7c7('0x2d')](_0x454e5b);})[_0xf7c7('0xe')](function(_0x142efb){_0x4f298f[_0xf7c7('0x2e')]=_0x142efb;return _0x4f298f;})[_0xf7c7('0xe')](respondWithFilteredResult(_0x4c95ac,_0x454e5b))['catch'](handleError(_0x4c95ac,null));};exports[_0xf7c7('0x2f')]=function(_0x8b379f,_0xdcdd7c){var _0x559ea9={'raw':!![],'where':{'id':_0x8b379f[_0xf7c7('0x30')]['id']}},_0x5eca5d={};_0x5eca5d[_0xf7c7('0x1d')]=_[_0xf7c7('0x1b')](db[_0xf7c7('0x14')][_0xf7c7('0x15')]);_0x5eca5d[_0xf7c7('0x1a')]=_[_0xf7c7('0x1b')](_0x8b379f['query']);_0x5eca5d[_0xf7c7('0x26')]=_['intersection'](_0x5eca5d[_0xf7c7('0x1d')],_0x5eca5d['query']);_0x559ea9[_0xf7c7('0x1f')]=_['intersection'](_0x5eca5d[_0xf7c7('0x1d')],qs['fields'](_0x8b379f[_0xf7c7('0x1a')][_0xf7c7('0x1e')]));_0x559ea9[_0xf7c7('0x1f')]=_0x559ea9[_0xf7c7('0x1f')][_0xf7c7('0x20')]?_0x559ea9['attributes']:_0x5eca5d[_0xf7c7('0x1d')];if(_0x8b379f['query'][_0xf7c7('0x31')]){_0x559ea9[_0xf7c7('0x32')]=[{'all':!![]}];}_0x559ea9=_[_0xf7c7('0x28')]({},_0x559ea9,_0x8b379f[_0xf7c7('0x29')]);return db['VoiceCallReport'][_0xf7c7('0x33')](_0x559ea9)[_0xf7c7('0xe')](handleEntityNotFound(_0xdcdd7c,null))['then'](respondWithResult(_0xdcdd7c,null))[_0xf7c7('0x34')](handleError(_0xdcdd7c,null));};exports['create']=function(_0xe89823,_0x2b1965){return db[_0xf7c7('0x14')]['create'](_0xe89823[_0xf7c7('0x35')],{})['then'](respondWithResult(_0x2b1965,0xc9))[_0xf7c7('0x34')](handleError(_0x2b1965,null));};exports[_0xf7c7('0xf')]=function(_0x2ccd80,_0x4efe73){return db[_0xf7c7('0x14')][_0xf7c7('0x33')]({'where':{'id':_0x2ccd80[_0xf7c7('0x30')]['id']}})[_0xf7c7('0xe')](handleEntityNotFound(_0x4efe73,null))[_0xf7c7('0xe')](removeEntity(_0x4efe73,null))['catch'](handleError(_0x4efe73,null));};exports[_0xf7c7('0x36')]=function(_0x473e38,_0x387449){return db['VoiceCallReport']['describe']()[_0xf7c7('0xe')](respondWithResult(_0x387449,null))[_0xf7c7('0x34')](handleError(_0x387449,null));};function findForUpdate(_0x1f3e24){return db[_0xf7c7('0x14')][_0xf7c7('0x33')]({'where':{'uniqueid':_0x1f3e24[_0xf7c7('0x30')]['id'],'UserId':{'$or':[null,_0x1f3e24['user']['id']]}}});}exports[_0xf7c7('0xd')]=function(_0x347e87,_0x57d605){if(_0x347e87[_0xf7c7('0x35')][_0xf7c7('0x37')]){delete _0x347e87[_0xf7c7('0x35')][_0xf7c7('0x37')];}return findForUpdate(_0x347e87)[_0xf7c7('0xe')](handleEntityNotFound(_0x57d605,null))[_0xf7c7('0xe')](saveUpdates(_0x347e87[_0xf7c7('0x35')],null))[_0xf7c7('0xe')](respondWithResult(_0x57d605,null))[_0xf7c7('0x34')](handleError(_0x57d605,null));};exports[_0xf7c7('0x38')]=function(_0x223868,_0x529314){if(_0x223868['body']['uniqueid']){delete _0x223868[_0xf7c7('0x35')][_0xf7c7('0x37')];}promiseRetry(function(_0x1c7b02){return findForUpdate(_0x223868)[_0xf7c7('0xe')](function(_0x13d4dd){if(_0x13d4dd!==null){return _0x13d4dd;}else{_0x1c7b02(new Error('No\x20such\x20report'));}});},{'retries':0x4,'minTimeout':0xfa})[_0xf7c7('0xe')](function(_0x2de3f0){return _0x2de3f0[_0xf7c7('0xd')](_0x223868[_0xf7c7('0x35')])[_0xf7c7('0xe')](function(_0xa42c83){return respondWithResult(_0x529314)(_0xa42c83);});},handleEntityNotFound(_0x529314));}; \ No newline at end of file +var _0xf864=['findAll','rows','catch','show','params','options','find','create','body','describe','user','uniqueid','updateWithRetry','No\x20such\x20report','../../components/parsers/qs','api','../../mysqldb','promise-retry','status','offset','undefined','count','limit','set','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceCallReport','includeAll','include','User'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0xf864,0x1de));var _0x4f86=function(_0x5728a7,_0x176a7f){_0x5728a7=_0x5728a7-0x0;var _0x19f897=_0xf864[_0x5728a7];return _0x19f897;};'use strict';var _=require('lodash');var qs=require(_0x4f86('0x0'));var logger=require('../../config/logger')(_0x4f86('0x1'));var db=require(_0x4f86('0x2'))['db'];const promiseRetry=require(_0x4f86('0x3'));function respondWithResult(_0x31e2c9,_0x39d168){_0x39d168=_0x39d168||0xc8;return function(_0x420eb3){if(_0x420eb3){return _0x31e2c9[_0x4f86('0x4')](_0x39d168)['json'](_0x420eb3);}};}function respondWithFilteredResult(_0x2977ce,_0x3facfb){return function(_0x43207f){if(_0x43207f){var _0x2bdfe1=typeof _0x3facfb[_0x4f86('0x5')]==='undefined'&&typeof _0x3facfb['limit']===_0x4f86('0x6');var _0x5db98d=_0x43207f['count'];var _0x5ebbf9=_0x2bdfe1?0x0:_0x3facfb[_0x4f86('0x5')];var _0x49005f=_0x2bdfe1?_0x43207f[_0x4f86('0x7')]:_0x3facfb[_0x4f86('0x5')]+_0x3facfb[_0x4f86('0x8')];var _0x413064;if(_0x49005f>=_0x5db98d){_0x49005f=_0x5db98d;_0x413064=0xc8;}else{_0x413064=0xce;}_0x2977ce['status'](_0x413064);return _0x2977ce[_0x4f86('0x9')]('Content-Range',_0x5ebbf9+'-'+_0x49005f+'/'+_0x5db98d)[_0x4f86('0xa')](_0x43207f);}return null;};}function saveUpdates(_0x396ca1){return function(_0x479013){if(_0x479013){return _0x479013[_0x4f86('0xb')](_0x396ca1)[_0x4f86('0xc')](function(_0x41d2c9){return _0x41d2c9;});}return null;};}function removeEntity(_0x3ee474){return function(_0x58dd77){if(_0x58dd77){return _0x58dd77[_0x4f86('0xd')]()[_0x4f86('0xc')](function(){_0x3ee474[_0x4f86('0x4')](0xcc)[_0x4f86('0xe')]();});}};}function handleEntityNotFound(_0x1be485){return function(_0x1f788){if(!_0x1f788){_0x1be485[_0x4f86('0xf')](0x194);}return _0x1f788;};}function handleError(_0x2c2c1b,_0x435253){_0x435253=_0x435253||0x1f4;return function(_0x4714d6){logger[_0x4f86('0x10')](_0x4714d6[_0x4f86('0x11')]);if(_0x4714d6['name']){delete _0x4714d6[_0x4f86('0x12')];}_0x2c2c1b[_0x4f86('0x4')](_0x435253)[_0x4f86('0x13')](_0x4714d6);};}exports[_0x4f86('0x14')]=function(_0x287988,_0x4006b0){var _0x13377c={},_0x1141a4={},_0x1be46e={'count':0x0,'rows':[]};var _0x2457c4=_[_0x4f86('0x15')](db['VoiceCallReport'][_0x4f86('0x16')],function(_0x4396c9){return{'name':_0x4396c9['fieldName'],'type':_0x4396c9['type'][_0x4f86('0x17')]};});_0x1141a4['model']=_[_0x4f86('0x15')](_0x2457c4,_0x4f86('0x12'));_0x1141a4[_0x4f86('0x18')]=_[_0x4f86('0x19')](_0x287988[_0x4f86('0x18')]);_0x1141a4[_0x4f86('0x1a')]=_['intersection'](_0x1141a4[_0x4f86('0x1b')],_0x1141a4[_0x4f86('0x18')]);_0x13377c[_0x4f86('0x1c')]=_[_0x4f86('0x1d')](_0x1141a4[_0x4f86('0x1b')],qs[_0x4f86('0x1e')](_0x287988['query'][_0x4f86('0x1e')]));_0x13377c[_0x4f86('0x1c')]=_0x13377c['attributes'][_0x4f86('0x1f')]?_0x13377c[_0x4f86('0x1c')]:_0x1141a4[_0x4f86('0x1b')];if(!_0x287988[_0x4f86('0x18')][_0x4f86('0x20')](_0x4f86('0x21'))){_0x13377c[_0x4f86('0x8')]=qs['limit'](_0x287988[_0x4f86('0x18')][_0x4f86('0x8')]);_0x13377c[_0x4f86('0x5')]=qs[_0x4f86('0x5')](_0x287988['query'][_0x4f86('0x5')]);}_0x13377c[_0x4f86('0x22')]=qs[_0x4f86('0x23')](_0x287988[_0x4f86('0x18')][_0x4f86('0x23')]);_0x13377c[_0x4f86('0x24')]=qs[_0x4f86('0x1a')](_['pick'](_0x287988[_0x4f86('0x18')],_0x1141a4[_0x4f86('0x1a')]),_0x2457c4);if(_0x287988['query'][_0x4f86('0x25')]){_0x13377c['where']=_[_0x4f86('0x26')](_0x13377c[_0x4f86('0x24')],{'$or':_['map'](_0x2457c4,function(_0x50551f){if(_0x50551f['type']!==_0x4f86('0x27')){var _0x5a3f61={};_0x5a3f61[_0x50551f[_0x4f86('0x12')]]={'$like':'%'+_0x287988[_0x4f86('0x18')][_0x4f86('0x25')]+'%'};return _0x5a3f61;}})});}_0x13377c=_[_0x4f86('0x26')]({},_0x13377c,_0x287988['options']);var _0x5cc0e3={'where':_0x13377c['where']};return db[_0x4f86('0x28')][_0x4f86('0x7')](_0x5cc0e3)[_0x4f86('0xc')](function(_0x30e32c){_0x1be46e['count']=_0x30e32c;if(_0x287988[_0x4f86('0x18')][_0x4f86('0x29')]){_0x13377c[_0x4f86('0x2a')]=[{'attributes':['id',_0x4f86('0x12'),'fullname','alias'],'model':db[_0x4f86('0x2b')],'as':_0x4f86('0x2b')}];}return db[_0x4f86('0x28')][_0x4f86('0x2c')](_0x13377c);})[_0x4f86('0xc')](function(_0x133e78){_0x1be46e[_0x4f86('0x2d')]=_0x133e78;return _0x1be46e;})[_0x4f86('0xc')](respondWithFilteredResult(_0x4006b0,_0x13377c))[_0x4f86('0x2e')](handleError(_0x4006b0,null));};exports[_0x4f86('0x2f')]=function(_0x2024f2,_0x27aecf){var _0x2fc4dd={'raw':!![],'where':{'id':_0x2024f2[_0x4f86('0x30')]['id']}},_0x286da8={};_0x286da8[_0x4f86('0x1b')]=_[_0x4f86('0x19')](db[_0x4f86('0x28')][_0x4f86('0x16')]);_0x286da8[_0x4f86('0x18')]=_[_0x4f86('0x19')](_0x2024f2[_0x4f86('0x18')]);_0x286da8[_0x4f86('0x1a')]=_[_0x4f86('0x1d')](_0x286da8[_0x4f86('0x1b')],_0x286da8[_0x4f86('0x18')]);_0x2fc4dd['attributes']=_[_0x4f86('0x1d')](_0x286da8[_0x4f86('0x1b')],qs[_0x4f86('0x1e')](_0x2024f2[_0x4f86('0x18')]['fields']));_0x2fc4dd['attributes']=_0x2fc4dd[_0x4f86('0x1c')][_0x4f86('0x1f')]?_0x2fc4dd[_0x4f86('0x1c')]:_0x286da8[_0x4f86('0x1b')];if(_0x2024f2[_0x4f86('0x18')][_0x4f86('0x29')]){_0x2fc4dd[_0x4f86('0x2a')]=[{'all':!![]}];}_0x2fc4dd=_[_0x4f86('0x26')]({},_0x2fc4dd,_0x2024f2[_0x4f86('0x31')]);return db['VoiceCallReport'][_0x4f86('0x32')](_0x2fc4dd)['then'](handleEntityNotFound(_0x27aecf,null))[_0x4f86('0xc')](respondWithResult(_0x27aecf,null))[_0x4f86('0x2e')](handleError(_0x27aecf,null));};exports[_0x4f86('0x33')]=function(_0x2b0e3d,_0x1e103e){return db[_0x4f86('0x28')][_0x4f86('0x33')](_0x2b0e3d[_0x4f86('0x34')],{})[_0x4f86('0xc')](respondWithResult(_0x1e103e,0xc9))[_0x4f86('0x2e')](handleError(_0x1e103e,null));};exports[_0x4f86('0xd')]=function(_0x12d90b,_0x431b83){return db[_0x4f86('0x28')][_0x4f86('0x32')]({'where':{'id':_0x12d90b[_0x4f86('0x30')]['id']}})[_0x4f86('0xc')](handleEntityNotFound(_0x431b83,null))[_0x4f86('0xc')](removeEntity(_0x431b83,null))['catch'](handleError(_0x431b83,null));};exports['describe']=function(_0x2905b8,_0x53cecc){return db['VoiceCallReport'][_0x4f86('0x35')]()[_0x4f86('0xc')](respondWithResult(_0x53cecc,null))[_0x4f86('0x2e')](handleError(_0x53cecc,null));};function findForUpdate(_0x18e4a0){return db[_0x4f86('0x28')][_0x4f86('0x32')]({'where':{'uniqueid':_0x18e4a0['params']['id'],'UserId':{'$or':[null,_0x18e4a0[_0x4f86('0x36')]['id']]}}});}exports['update']=function(_0x22c62b,_0x341147){if(_0x22c62b[_0x4f86('0x34')][_0x4f86('0x37')]){delete _0x22c62b[_0x4f86('0x34')]['uniqueid'];}return findForUpdate(_0x22c62b)[_0x4f86('0xc')](handleEntityNotFound(_0x341147,null))[_0x4f86('0xc')](saveUpdates(_0x22c62b[_0x4f86('0x34')],null))['then'](respondWithResult(_0x341147,null))[_0x4f86('0x2e')](handleError(_0x341147,null));};exports[_0x4f86('0x38')]=function(_0x41fca2,_0x2848c2){if(_0x41fca2[_0x4f86('0x34')][_0x4f86('0x37')]){delete _0x41fca2[_0x4f86('0x34')]['uniqueid'];}promiseRetry(function(_0x537576){return findForUpdate(_0x41fca2)['then'](function(_0xbeb93c){if(_0xbeb93c!==null){return _0xbeb93c;}else{_0x537576(new Error(_0x4f86('0x39')));}});},{'retries':0x4,'minTimeout':0xfa})[_0x4f86('0xc')](function(_0x336e57){return _0x336e57[_0x4f86('0xb')](_0x41fca2['body'])[_0x4f86('0xc')](function(_0x28513a){return respondWithResult(_0x2848c2)(_0x28513a);});},handleEntityNotFound(_0x2848c2));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a5207e7..e2ed7d2 100644 --- a/server/api/voiceCallReport/voiceCallReport.model.js +++ b/server/api/voiceCallReport/voiceCallReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ea8=['api','moment','request-promise','path','rimraf','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x5941a3,_0x358c94){var _0x127e7a=function(_0x24152f){while(--_0x24152f){_0x5941a3['push'](_0x5941a3['shift']());}};_0x127e7a(++_0x358c94);}(_0x7ea8,0x1d1));var _0x87ea=function(_0xd57719,_0x25e43c){_0xd57719=_0xd57719-0x0;var _0xf05cb1=_0x7ea8[_0xd57719];return _0xf05cb1;};'use strict';var _=require(_0x87ea('0x0'));var util=require(_0x87ea('0x1'));var logger=require(_0x87ea('0x2'))(_0x87ea('0x3'));var moment=require(_0x87ea('0x4'));var BPromise=require('bluebird');var rp=require(_0x87ea('0x5'));var fs=require('fs');var path=require(_0x87ea('0x6'));var rimraf=require(_0x87ea('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x87ea('0x8')]=function(_0x1927e0,_0x70dccf){return _0x1927e0[_0x87ea('0x9')](_0x87ea('0xa'),attributes,{'tableName':_0x87ea('0xb'),'paranoid':![],'indexes':[{'fields':[_0x87ea('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3351=['uniqueid','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x3351,0x175));var _0x1335=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x3351[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x1335('0x0'));var util=require(_0x1335('0x1'));var logger=require(_0x1335('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1335('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1335('0x4'));var config=require(_0x1335('0x5'));var attributes=require(_0x1335('0x6'));module[_0x1335('0x7')]=function(_0x426763,_0x79f9e8){return _0x426763[_0x1335('0x8')](_0x1335('0x9'),attributes,{'tableName':_0x1335('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1335('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 8b10d3c..be8747b 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 _0xac81=['UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0xac81,0x16a));var _0x1ac8=function(_0x1cca33,_0x2be37d){_0x1cca33=_0x1cca33-0x0;var _0x305532=_0xac81[_0x1cca33];return _0x305532;};'use strict';var _=require(_0x1ac8('0x0'));var util=require(_0x1ac8('0x1'));var moment=require('moment');var BPromise=require(_0x1ac8('0x2'));var rs=require(_0x1ac8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ac8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac8('0x5'))(_0x1ac8('0x6'));var config=require(_0x1ac8('0x7'));var jayson=require(_0x1ac8('0x8'));var client=jayson[_0x1ac8('0x9')][_0x1ac8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a9f5,_0x5c7073,_0x44f330){return new BPromise(function(_0x2063ad,_0x48bc3a){return client[_0x1ac8('0xb')](_0x49a9f5,_0x44f330)[_0x1ac8('0xc')](function(_0x2f4b9f){logger[_0x1ac8('0xd')](_0x1ac8('0xe'),_0x5c7073,'request\x20sent');logger[_0x1ac8('0xf')](_0x1ac8('0x10'),_0x5c7073,_0x1ac8('0x11'),JSON[_0x1ac8('0x12')](_0x2f4b9f));if(_0x2f4b9f[_0x1ac8('0x13')]){if(_0x2f4b9f['error'][_0x1ac8('0x14')]===0x1f4){logger[_0x1ac8('0x13')](_0x1ac8('0xe'),_0x5c7073,_0x2f4b9f[_0x1ac8('0x13')][_0x1ac8('0x15')]);return _0x48bc3a(_0x2f4b9f[_0x1ac8('0x13')][_0x1ac8('0x15')]);}logger[_0x1ac8('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x5c7073,_0x2f4b9f[_0x1ac8('0x13')][_0x1ac8('0x15')]);return _0x2063ad(_0x2f4b9f[_0x1ac8('0x13')][_0x1ac8('0x15')]);}else{logger[_0x1ac8('0xd')](_0x1ac8('0xe'),_0x5c7073,_0x1ac8('0x11'));_0x2063ad(_0x2f4b9f[_0x1ac8('0x16')]['message']);}})[_0x1ac8('0x17')](function(_0x4a1553){logger[_0x1ac8('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x5c7073,_0x4a1553);_0x48bc3a(_0x4a1553);});});}exports['GetVoiceCallReport']=function(_0x462195){var _0x464bfb=this;return new Promise(function(_0x51c3fe,_0x571400){return db[_0x1ac8('0x18')][_0x1ac8('0x19')]({'raw':_0x462195[_0x1ac8('0x1a')]?_0x462195['options'][_0x1ac8('0x1b')]===undefined?!![]:![]:!![],'where':_0x462195[_0x1ac8('0x1a')]?_0x462195['options'][_0x1ac8('0x1c')]||null:null,'attributes':_0x462195['options']?_0x462195['options'][_0x1ac8('0x1d')]||null:null,'limit':_0x462195['options']?_0x462195['options'][_0x1ac8('0x1e')]||null:null,'include':_0x462195[_0x1ac8('0x1a')]?_0x462195[_0x1ac8('0x1a')][_0x1ac8('0x1f')]?_[_0x1ac8('0x20')](_0x462195[_0x1ac8('0x1a')][_0x1ac8('0x1f')],function(_0x4b24bd){return{'model':db[_0x4b24bd[_0x1ac8('0x21')]],'as':_0x4b24bd['as'],'attributes':_0x4b24bd[_0x1ac8('0x1d')],'include':_0x4b24bd[_0x1ac8('0x1f')]?_[_0x1ac8('0x20')](_0x4b24bd['include'],function(_0x382d45){return{'model':db[_0x382d45[_0x1ac8('0x21')]],'as':_0x382d45['as'],'attributes':_0x382d45[_0x1ac8('0x1d')],'include':_0x382d45[_0x1ac8('0x1f')]?_[_0x1ac8('0x20')](_0x382d45['include'],function(_0x1abca9){return{'model':db[_0x1abca9[_0x1ac8('0x21')]],'as':_0x1abca9['as'],'attributes':_0x1abca9['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ac8('0xc')](function(_0x5b4e86){logger['info'](_0x1ac8('0x22'),_0x462195);logger[_0x1ac8('0xf')](_0x1ac8('0x22'),_0x462195,JSON[_0x1ac8('0x12')](_0x5b4e86));_0x51c3fe(_0x5b4e86);})[_0x1ac8('0x17')](function(_0x179ded){logger[_0x1ac8('0x13')](_0x1ac8('0x22'),_0x179ded['message'],_0x462195);_0x571400(_0x464bfb[_0x1ac8('0x13')](0x1f4,_0x179ded['message']));});});};exports[_0x1ac8('0x23')]=function(_0x2aa66c){var _0x520086=this;return new Promise(function(_0x292178,_0x230bcb){return db[_0x1ac8('0x18')][_0x1ac8('0x24')](_0x2aa66c[_0x1ac8('0x25')],{'raw':_0x2aa66c[_0x1ac8('0x1a')]?_0x2aa66c[_0x1ac8('0x1a')][_0x1ac8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x42af16){logger['info']('CreateVoiceCallReport',_0x2aa66c);logger[_0x1ac8('0xf')](_0x1ac8('0x23'),_0x2aa66c,JSON[_0x1ac8('0x12')](_0x42af16));_0x292178(_0x42af16);})['catch'](function(_0x280d95){logger[_0x1ac8('0x13')]('CreateVoiceCallReport',_0x280d95[_0x1ac8('0x15')],_0x2aa66c);_0x230bcb(_0x520086[_0x1ac8('0x13')](0x1f4,_0x280d95[_0x1ac8('0x15')]));});});};exports[_0x1ac8('0x26')]=function(_0x54efa8){var _0x28bf3d=this;return new Promise(function(_0x1fc4bc,_0xbd9870){return db[_0x1ac8('0x18')][_0x1ac8('0x27')](_0x54efa8[_0x1ac8('0x25')],{'raw':_0x54efa8[_0x1ac8('0x1a')]?_0x54efa8['options'][_0x1ac8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54efa8[_0x1ac8('0x1a')]?_0x54efa8[_0x1ac8('0x1a')]['where']||null:null,'attributes':_0x54efa8[_0x1ac8('0x1a')]?_0x54efa8[_0x1ac8('0x1a')][_0x1ac8('0x1d')]||null:null,'limit':_0x54efa8[_0x1ac8('0x1a')]?_0x54efa8[_0x1ac8('0x1a')][_0x1ac8('0x1e')]||null:null})[_0x1ac8('0xc')](function(_0x8075f4){logger['info'](_0x1ac8('0x26'),_0x54efa8);logger[_0x1ac8('0xf')]('UpdateVoiceCallReport',_0x54efa8,JSON[_0x1ac8('0x12')](_0x8075f4));_0x1fc4bc(_0x8075f4);})['catch'](function(_0x3d366d){logger[_0x1ac8('0x13')]('UpdateVoiceCallReport',_0x3d366d[_0x1ac8('0x15')],_0x54efa8);_0xbd9870(_0x28bf3d['error'](0x1f4,_0x3d366d['message']));});});}; \ No newline at end of file +var _0x5c5f=['options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','findAll'];(function(_0x55f1a1,_0xd540c4){var _0x5f3028=function(_0x5b20a9){while(--_0x5b20a9){_0x55f1a1['push'](_0x55f1a1['shift']());}};_0x5f3028(++_0xd540c4);}(_0x5c5f,0xa6));var _0xf5c5=function(_0x188d60,_0x40f3e1){_0x188d60=_0x188d60-0x0;var _0x4ca0da=_0x5c5f[_0x188d60];return _0x4ca0da;};'use strict';var _=require(_0xf5c5('0x0'));var util=require(_0xf5c5('0x1'));var moment=require('moment');var BPromise=require(_0xf5c5('0x2'));var rs=require(_0xf5c5('0x3'));var fs=require('fs');var Redis=require(_0xf5c5('0x4'));var db=require(_0xf5c5('0x5'))['db'];var utils=require(_0xf5c5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf5c5('0x8')][_0xf5c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ee169,_0x60022,_0x42cd27){return new BPromise(function(_0x129f7c,_0x7b8b80){return client[_0xf5c5('0xa')](_0x4ee169,_0x42cd27)[_0xf5c5('0xb')](function(_0x39750d){logger[_0xf5c5('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x60022,'request\x20sent');logger[_0xf5c5('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x60022,_0xf5c5('0xe'),JSON[_0xf5c5('0xf')](_0x39750d));if(_0x39750d[_0xf5c5('0x10')]){if(_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x11')]===0x1f4){logger['error'](_0xf5c5('0x12'),_0x60022,_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x13')]);return _0x7b8b80(_0x39750d[_0xf5c5('0x10')]['message']);}logger[_0xf5c5('0x10')](_0xf5c5('0x12'),_0x60022,_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x13')]);return _0x129f7c(_0x39750d[_0xf5c5('0x10')][_0xf5c5('0x13')]);}else{logger[_0xf5c5('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x60022,_0xf5c5('0xe'));_0x129f7c(_0x39750d[_0xf5c5('0x14')][_0xf5c5('0x13')]);}})[_0xf5c5('0x15')](function(_0x2cb7f8){logger[_0xf5c5('0x10')](_0xf5c5('0x12'),_0x60022,_0x2cb7f8);_0x7b8b80(_0x2cb7f8);});});}exports['GetVoiceCallReport']=function(_0x420128){var _0x5b82de=this;return new Promise(function(_0x158592,_0x54e900){return db[_0xf5c5('0x16')][_0xf5c5('0x17')]({'raw':_0x420128[_0xf5c5('0x18')]?_0x420128[_0xf5c5('0x18')][_0xf5c5('0x19')]===undefined?!![]:![]:!![],'where':_0x420128[_0xf5c5('0x18')]?_0x420128['options'][_0xf5c5('0x1a')]||null:null,'attributes':_0x420128[_0xf5c5('0x18')]?_0x420128[_0xf5c5('0x18')][_0xf5c5('0x1b')]||null:null,'limit':_0x420128[_0xf5c5('0x18')]?_0x420128['options'][_0xf5c5('0x1c')]||null:null,'include':_0x420128[_0xf5c5('0x18')]?_0x420128[_0xf5c5('0x18')]['include']?_['map'](_0x420128['options'][_0xf5c5('0x1d')],function(_0x740b9f){return{'model':db[_0x740b9f['model']],'as':_0x740b9f['as'],'attributes':_0x740b9f[_0xf5c5('0x1b')],'include':_0x740b9f[_0xf5c5('0x1d')]?_[_0xf5c5('0x1e')](_0x740b9f['include'],function(_0x511af6){return{'model':db[_0x511af6[_0xf5c5('0x1f')]],'as':_0x511af6['as'],'attributes':_0x511af6[_0xf5c5('0x1b')],'include':_0x511af6['include']?_[_0xf5c5('0x1e')](_0x511af6[_0xf5c5('0x1d')],function(_0x2f18da){return{'model':db[_0x2f18da[_0xf5c5('0x1f')]],'as':_0x2f18da['as'],'attributes':_0x2f18da[_0xf5c5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x100a1e){logger['info'](_0xf5c5('0x20'),_0x420128);logger[_0xf5c5('0xd')](_0xf5c5('0x20'),_0x420128,JSON['stringify'](_0x100a1e));_0x158592(_0x100a1e);})['catch'](function(_0x192e09){logger['error'](_0xf5c5('0x20'),_0x192e09[_0xf5c5('0x13')],_0x420128);_0x54e900(_0x5b82de['error'](0x1f4,_0x192e09[_0xf5c5('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x52eda8){var _0x4702fe=this;return new Promise(function(_0x84036,_0x213daf){return db['VoiceCallReport'][_0xf5c5('0x21')](_0x52eda8[_0xf5c5('0x22')],{'raw':_0x52eda8[_0xf5c5('0x18')]?_0x52eda8[_0xf5c5('0x18')][_0xf5c5('0x19')]===undefined?!![]:![]:!![]})[_0xf5c5('0xb')](function(_0x2db201){logger[_0xf5c5('0xc')](_0xf5c5('0x23'),_0x52eda8);logger[_0xf5c5('0xd')](_0xf5c5('0x23'),_0x52eda8,JSON[_0xf5c5('0xf')](_0x2db201));_0x84036(_0x2db201);})['catch'](function(_0x55415b){logger[_0xf5c5('0x10')]('CreateVoiceCallReport',_0x55415b[_0xf5c5('0x13')],_0x52eda8);_0x213daf(_0x4702fe[_0xf5c5('0x10')](0x1f4,_0x55415b['message']));});});};exports[_0xf5c5('0x24')]=function(_0x3e9f8f){var _0x691c9e=this;return new Promise(function(_0xc66617,_0x4a404c){return db[_0xf5c5('0x16')][_0xf5c5('0x25')](_0x3e9f8f[_0xf5c5('0x22')],{'raw':_0x3e9f8f['options']?_0x3e9f8f[_0xf5c5('0x18')][_0xf5c5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e9f8f['options']?_0x3e9f8f[_0xf5c5('0x18')]['where']||null:null,'attributes':_0x3e9f8f['options']?_0x3e9f8f[_0xf5c5('0x18')]['attributes']||null:null,'limit':_0x3e9f8f['options']?_0x3e9f8f[_0xf5c5('0x18')]['limit']||null:null})['then'](function(_0x308f4e){logger['info'](_0xf5c5('0x24'),_0x3e9f8f);logger[_0xf5c5('0xd')](_0xf5c5('0x24'),_0x3e9f8f,JSON[_0xf5c5('0xf')](_0x308f4e));_0xc66617(_0x308f4e);})[_0xf5c5('0x15')](function(_0x5c4511){logger[_0xf5c5('0x10')]('UpdateVoiceCallReport',_0x5c4511[_0xf5c5('0x13')],_0x3e9f8f);_0x4a404c(_0x691c9e[_0xf5c5('0x10')](0x1f4,_0x5c4511[_0xf5c5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1b8a557..5107b7d 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 _0x1bbf=['index','get','/:id','show','create','put','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x1bbf,0xa8));var _0xf1bb=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x1bbf[_0x6e1239];return _0x418150;};'use strict';var multer=require('multer');var util=require(_0xf1bb('0x0'));var path=require(_0xf1bb('0x1'));var timeout=require(_0xf1bb('0x2'));var express=require(_0xf1bb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf1bb('0x4'));var interaction=require(_0xf1bb('0x5'));var config=require('../../config/environment');var controller=require(_0xf1bb('0x6'));router['get']('/',auth[_0xf1bb('0x7')](),controller[_0xf1bb('0x8')]);router[_0xf1bb('0x9')](_0xf1bb('0xa'),auth[_0xf1bb('0x7')](),controller[_0xf1bb('0xb')]);router['post']('/',auth[_0xf1bb('0x7')](),controller[_0xf1bb('0xc')]);router[_0xf1bb('0xd')]('/:id',auth[_0xf1bb('0x7')](),controller['update']);router[_0xf1bb('0xe')](_0xf1bb('0xa'),auth[_0xf1bb('0x7')](),controller['destroy']);module[_0xf1bb('0xf')]=router; \ No newline at end of file +var _0x35b5=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x29fb7c,_0xbc227e){var _0x26c29b=function(_0x1b9907){while(--_0x1b9907){_0x29fb7c['push'](_0x29fb7c['shift']());}};_0x26c29b(++_0xbc227e);}(_0x35b5,0x15f));var _0x535b=function(_0x86fbc6,_0x31d9d3){_0x86fbc6=_0x86fbc6-0x0;var _0x48487b=_0x35b5[_0x86fbc6];return _0x48487b;};'use strict';var multer=require(_0x535b('0x0'));var util=require('util');var path=require(_0x535b('0x1'));var timeout=require(_0x535b('0x2'));var express=require(_0x535b('0x3'));var router=express['Router']();var fs_extra=require(_0x535b('0x4'));var auth=require(_0x535b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x535b('0x6'));var controller=require(_0x535b('0x7'));router[_0x535b('0x8')]('/',auth[_0x535b('0x9')](),controller[_0x535b('0xa')]);router[_0x535b('0x8')](_0x535b('0xb'),auth[_0x535b('0x9')](),controller[_0x535b('0xc')]);router[_0x535b('0xd')]('/',auth[_0x535b('0x9')](),controller[_0x535b('0xe')]);router[_0x535b('0xf')](_0x535b('0xb'),auth[_0x535b('0x9')](),controller[_0x535b('0x10')]);router[_0x535b('0x11')](_0x535b('0xb'),auth['isAuthenticated'](),controller[_0x535b('0x12')]);module[_0x535b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 609dc12..e9bd531 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 _0x04fb=['options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x4e918e,_0x425713){var _0x14c813=function(_0x16aa93){while(--_0x16aa93){_0x4e918e['push'](_0x4e918e['shift']());}};_0x14c813(++_0x425713);}(_0x04fb,0xc1));var _0xb04f=function(_0x39d98a,_0x543abc){_0x39d98a=_0x39d98a-0x0;var _0x47bc9f=_0x04fb[_0x39d98a];return _0x47bc9f;};'use strict';var Sequelize=require(_0xb04f('0x0'));module[_0xb04f('0x1')]={'name':{'type':Sequelize[_0xb04f('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xb04f('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xb04f('0x2')],'set':function(_0x5558e4){this[_0xb04f('0x4')](_0xb04f('0x5'),_0x5558e4?_0x5558e4['join'](''):[]);},'get':function(){return this[_0xb04f('0x6')]('options')?this[_0xb04f('0x6')](_0xb04f('0x5'))[_0xb04f('0x7')](''):[];}},'auth':{'type':Sequelize[_0xb04f('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xb04f('0x2')]},'record':{'type':Sequelize[_0xb04f('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb04f('0x2')]},'description':{'type':Sequelize[_0xb04f('0x2')]}}; \ No newline at end of file +var _0x8eb3=['join','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue','options'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x8eb3,0x1c6));var _0x38eb=function(_0x174008,_0x567386){_0x174008=_0x174008-0x0;var _0x120e15=_0x8eb3[_0x174008];return _0x120e15;};'use strict';var Sequelize=require('sequelize');module[_0x38eb('0x0')]={'name':{'type':Sequelize[_0x38eb('0x1')]},'prefix':{'type':Sequelize[_0x38eb('0x1')],'unique':_0x38eb('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x38eb('0x1')],'set':function(_0x33d0d2){this[_0x38eb('0x3')](_0x38eb('0x4'),_0x33d0d2?_0x33d0d2[_0x38eb('0x5')](''):[]);},'get':function(){return this[_0x38eb('0x6')](_0x38eb('0x4'))?this[_0x38eb('0x6')](_0x38eb('0x4'))[_0x38eb('0x7')](''):[];}},'auth':{'type':Sequelize[_0x38eb('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x38eb('0x1')]},'record':{'type':Sequelize[_0x38eb('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x38eb('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 1d93d9d..09058c0 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 _0x2116=['includeAll','include','findAll','catch','show','keys','fields','options','find','create','body','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','get','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VoiceChanSpy'];(function(_0x38c6ca,_0x27152b){var _0x361e63=function(_0x216df1){while(--_0x216df1){_0x38c6ca['push'](_0x38c6ca['shift']());}};_0x361e63(++_0x27152b);}(_0x2116,0x67));var _0x6211=function(_0x368e3c,_0x2c226e){_0x368e3c=_0x368e3c-0x0;var _0x1950d5=_0x2116[_0x368e3c];return _0x1950d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6211('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6211('0x1'));var rp=require(_0x6211('0x2'));var moment=require(_0x6211('0x3'));var BPromise=require(_0x6211('0x4'));var Mustache=require('mustache');var util=require(_0x6211('0x5'));var path=require(_0x6211('0x6'));var sox=require(_0x6211('0x7'));var csv=require(_0x6211('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6211('0x9'));var _=require('lodash');var squel=require(_0x6211('0xa'));var crypto=require(_0x6211('0xb'));var jsforce=require(_0x6211('0xc'));var deskjs=require(_0x6211('0xd'));var toCsv=require(_0x6211('0x8'));var querystring=require(_0x6211('0xe'));var Papa=require(_0x6211('0xf'));var Redis=require('ioredis');var authService=require(_0x6211('0x10'));var qs=require(_0x6211('0x11'));var as=require(_0x6211('0x12'));var hardwareService=require(_0x6211('0x13'));var logger=require(_0x6211('0x14'))(_0x6211('0x15'));var utils=require(_0x6211('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6211('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337362,_0x6661a7){_0x6661a7=_0x6661a7||0xcc;return function(_0x22963d){if(_0x22963d){return _0x337362['sendStatus'](_0x6661a7);}return _0x337362[_0x6211('0x18')](_0x6661a7)[_0x6211('0x19')]();};}function respondWithResult(_0x1a27a2,_0x509faa){_0x509faa=_0x509faa||0xc8;return function(_0x54a303){if(_0x54a303){return _0x1a27a2[_0x6211('0x18')](_0x509faa)[_0x6211('0x1a')](_0x54a303);}};}function respondWithFilteredResult(_0x23f8d2,_0xf69c79){return function(_0xa23863){if(_0xa23863){var _0x15adb6=typeof _0xf69c79[_0x6211('0x1b')]===_0x6211('0x1c')&&typeof _0xf69c79['limit']===_0x6211('0x1c');var _0x432c18=_0xa23863[_0x6211('0x1d')];var _0x2ccbb0=_0x15adb6?0x0:_0xf69c79[_0x6211('0x1b')];var _0x14c051=_0x15adb6?_0xa23863[_0x6211('0x1d')]:_0xf69c79['offset']+_0xf69c79[_0x6211('0x1e')];var _0x1528e6;if(_0x14c051>=_0x432c18){_0x14c051=_0x432c18;_0x1528e6=0xc8;}else{_0x1528e6=0xce;}_0x23f8d2['status'](_0x1528e6);return _0x23f8d2[_0x6211('0x1f')](_0x6211('0x20'),_0x2ccbb0+'-'+_0x14c051+'/'+_0x432c18)[_0x6211('0x1a')](_0xa23863);}return null;};}function patchUpdates(_0x30d6a5){return function(_0x4d99bc){try{jsonpatch['apply'](_0x4d99bc,_0x30d6a5,!![]);}catch(_0x4252d3){return BPromise[_0x6211('0x21')](_0x4252d3);}return _0x4d99bc['save']();};}function saveUpdates(_0x52eb53,_0x15ca00){return function(_0x1e6a53){if(_0x1e6a53){return _0x1e6a53[_0x6211('0x22')](_0x52eb53)[_0x6211('0x23')](function(_0x5b50cd){return _0x5b50cd;});}return null;};}function removeEntity(_0x2c1c0a,_0x311054){return function(_0x16fb0c){if(_0x16fb0c){return _0x16fb0c['destroy']()[_0x6211('0x23')](function(){var _0x279069=_0x16fb0c[_0x6211('0x24')]({'plain':!![]});var _0x4a13f8='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x4a13f8,'resourceId':_0x279069['id']}})['then'](function(){return _0x16fb0c;});})[_0x6211('0x23')](function(){_0x2c1c0a[_0x6211('0x18')](0xcc)[_0x6211('0x19')]();});}};}function handleEntityNotFound(_0x2d6265,_0x3049c7){return function(_0x301b3d){if(!_0x301b3d){_0x2d6265[_0x6211('0x25')](0x194);}return _0x301b3d;};}function handleError(_0x42fca1,_0x148740){_0x148740=_0x148740||0x1f4;return function(_0x19a369){logger[_0x6211('0x26')](_0x19a369[_0x6211('0x27')]);if(_0x19a369[_0x6211('0x28')]){delete _0x19a369[_0x6211('0x28')];}_0x42fca1[_0x6211('0x18')](_0x148740)[_0x6211('0x29')](_0x19a369);};}exports[_0x6211('0x2a')]=function(_0x55fe29,_0x276a30){var _0x44404a={},_0x18553c={},_0x4cd58b={'count':0x0,'rows':[]};var _0x54ad08=_[_0x6211('0x2b')](db['VoiceChanSpy'][_0x6211('0x2c')],function(_0x253bb3){return{'name':_0x253bb3[_0x6211('0x2d')],'type':_0x253bb3['type'][_0x6211('0x2e')]};});_0x18553c[_0x6211('0x2f')]=_[_0x6211('0x2b')](_0x54ad08,_0x6211('0x28'));_0x18553c[_0x6211('0x30')]=_['keys'](_0x55fe29['query']);_0x18553c[_0x6211('0x31')]=_['intersection'](_0x18553c['model'],_0x18553c['query']);_0x44404a[_0x6211('0x32')]=_[_0x6211('0x33')](_0x18553c[_0x6211('0x2f')],qs['fields'](_0x55fe29[_0x6211('0x30')]['fields']));_0x44404a[_0x6211('0x32')]=_0x44404a[_0x6211('0x32')][_0x6211('0x34')]?_0x44404a['attributes']:_0x18553c[_0x6211('0x2f')];if(!_0x55fe29[_0x6211('0x30')][_0x6211('0x35')](_0x6211('0x36'))){_0x44404a[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x55fe29[_0x6211('0x30')][_0x6211('0x1e')]);_0x44404a['offset']=qs[_0x6211('0x1b')](_0x55fe29[_0x6211('0x30')][_0x6211('0x1b')]);}_0x44404a[_0x6211('0x37')]=qs[_0x6211('0x38')](_0x55fe29['query'][_0x6211('0x38')]);_0x44404a[_0x6211('0x39')]=qs[_0x6211('0x31')](_[_0x6211('0x3a')](_0x55fe29['query'],_0x18553c[_0x6211('0x31')]),_0x54ad08);if(_0x55fe29[_0x6211('0x30')][_0x6211('0x3b')]){_0x44404a[_0x6211('0x39')]=_[_0x6211('0x3c')](_0x44404a[_0x6211('0x39')],{'$or':_[_0x6211('0x2b')](_0x54ad08,function(_0x4fb7e8){if(_0x4fb7e8[_0x6211('0x3d')]!=='VIRTUAL'){var _0x5013f0={};_0x5013f0[_0x4fb7e8[_0x6211('0x28')]]={'$like':'%'+_0x55fe29['query'][_0x6211('0x3b')]+'%'};return _0x5013f0;}})});}_0x44404a=_[_0x6211('0x3c')]({},_0x44404a,_0x55fe29['options']);var _0x4e8ba8={'where':_0x44404a['where']};return db[_0x6211('0x3e')][_0x6211('0x1d')](_0x4e8ba8)[_0x6211('0x23')](function(_0x5972d4){_0x4cd58b[_0x6211('0x1d')]=_0x5972d4;if(_0x55fe29[_0x6211('0x30')][_0x6211('0x3f')]){_0x44404a[_0x6211('0x40')]=[{'all':!![]}];}return db[_0x6211('0x3e')][_0x6211('0x41')](_0x44404a);})[_0x6211('0x23')](function(_0x371956){_0x4cd58b['rows']=_0x371956;return _0x4cd58b;})['then'](respondWithFilteredResult(_0x276a30,_0x44404a))[_0x6211('0x42')](handleError(_0x276a30,null));};exports[_0x6211('0x43')]=function(_0x2400f1,_0x455d90){var _0x16db53={'raw':![],'where':{'id':_0x2400f1['params']['id']}},_0x2c7ffb={};_0x2c7ffb[_0x6211('0x2f')]=_[_0x6211('0x44')](db[_0x6211('0x3e')][_0x6211('0x2c')]);_0x2c7ffb[_0x6211('0x30')]=_['keys'](_0x2400f1[_0x6211('0x30')]);_0x2c7ffb['filters']=_[_0x6211('0x33')](_0x2c7ffb['model'],_0x2c7ffb[_0x6211('0x30')]);_0x16db53[_0x6211('0x32')]=_['intersection'](_0x2c7ffb[_0x6211('0x2f')],qs[_0x6211('0x45')](_0x2400f1[_0x6211('0x30')]['fields']));_0x16db53[_0x6211('0x32')]=_0x16db53['attributes'][_0x6211('0x34')]?_0x16db53['attributes']:_0x2c7ffb[_0x6211('0x2f')];if(_0x2400f1['query'][_0x6211('0x3f')]){_0x16db53[_0x6211('0x40')]=[{'all':!![]}];}_0x16db53=_[_0x6211('0x3c')]({},_0x16db53,_0x2400f1[_0x6211('0x46')]);return db[_0x6211('0x3e')][_0x6211('0x47')](_0x16db53)[_0x6211('0x23')](handleEntityNotFound(_0x455d90,null))[_0x6211('0x23')](respondWithResult(_0x455d90,null))[_0x6211('0x42')](handleError(_0x455d90,null));};exports[_0x6211('0x48')]=function(_0x501c6d,_0x2bc4ae){return db[_0x6211('0x3e')][_0x6211('0x48')](_0x501c6d[_0x6211('0x49')],{})['then'](function(_0x27c5a9){var _0xee45fb=_0x501c6d['user'][_0x6211('0x24')]({'plain':!![]});if(!_0xee45fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xee45fb['role']===_0x6211('0x4a')){var _0x25d2c8=_0x27c5a9['get']({'plain':!![]});var _0xa0485a=_0x6211('0x4b');return db[_0x6211('0x4c')][_0x6211('0x47')]({'where':{'name':_0xa0485a,'userProfileId':_0xee45fb[_0x6211('0x4d')]},'raw':!![]})['then'](function(_0x92aa60){if(_0x92aa60&&_0x92aa60[_0x6211('0x4e')]===0x0){return db[_0x6211('0x4f')]['create']({'name':_0x25d2c8[_0x6211('0x28')],'resourceId':_0x25d2c8['id'],'type':_0x92aa60['name'],'sectionId':_0x92aa60['id']},{})[_0x6211('0x23')](function(){return _0x27c5a9;});}else{return _0x27c5a9;}})[_0x6211('0x42')](function(_0x4b1d8e){logger[_0x6211('0x26')](_0x6211('0x50'),_0x4b1d8e);throw _0x4b1d8e;});}return _0x27c5a9;})['then'](respondWithResult(_0x2bc4ae,0xc9))[_0x6211('0x42')](handleError(_0x2bc4ae,null));};exports[_0x6211('0x22')]=function(_0x41c86a,_0x39536a){if(_0x41c86a['body']['id']){delete _0x41c86a[_0x6211('0x49')]['id'];}return db[_0x6211('0x3e')][_0x6211('0x47')]({'where':{'id':_0x41c86a[_0x6211('0x51')]['id']}})[_0x6211('0x23')](handleEntityNotFound(_0x39536a,null))[_0x6211('0x23')](saveUpdates(_0x41c86a[_0x6211('0x49')],null))[_0x6211('0x23')](respondWithResult(_0x39536a,null))['catch'](handleError(_0x39536a,null));};exports[_0x6211('0x52')]=function(_0x32e539,_0x48ea42){return db['VoiceChanSpy'][_0x6211('0x47')]({'where':{'id':_0x32e539[_0x6211('0x51')]['id']}})[_0x6211('0x23')](handleEntityNotFound(_0x48ea42,null))['then'](removeEntity(_0x48ea42,null))[_0x6211('0x42')](handleError(_0x48ea42,null));}; \ No newline at end of file +var _0x92f0=['destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','options','VoiceChanSpy','include','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','then'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x92f0,0x10d));var _0x092f=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x92f0[_0x2ff238];return _0x204a56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x092f('0x0'));var zipdir=require(_0x092f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x092f('0x2'));var moment=require(_0x092f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x092f('0x4'));var path=require(_0x092f('0x5'));var sox=require(_0x092f('0x6'));var csv=require(_0x092f('0x7'));var ejs=require(_0x092f('0x8'));var fs=require('fs');var fs_extra=require(_0x092f('0x9'));var _=require('lodash');var squel=require(_0x092f('0xa'));var crypto=require('crypto');var jsforce=require(_0x092f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x092f('0x7'));var querystring=require('querystring');var Papa=require(_0x092f('0xc'));var Redis=require('ioredis');var authService=require(_0x092f('0xd'));var qs=require(_0x092f('0xe'));var as=require(_0x092f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x092f('0x10'))(_0x092f('0x11'));var utils=require(_0x092f('0x12'));var config=require(_0x092f('0x13'));var licenseUtil=require(_0x092f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e4f79,_0x3e9305){_0x3e9305=_0x3e9305||0xcc;return function(_0x5c6d22){if(_0x5c6d22){return _0x3e4f79[_0x092f('0x15')](_0x3e9305);}return _0x3e4f79[_0x092f('0x16')](_0x3e9305)[_0x092f('0x17')]();};}function respondWithResult(_0x3df148,_0x954956){_0x954956=_0x954956||0xc8;return function(_0x3b1f34){if(_0x3b1f34){return _0x3df148[_0x092f('0x16')](_0x954956)[_0x092f('0x18')](_0x3b1f34);}};}function respondWithFilteredResult(_0x4e4d0f,_0x352456){return function(_0x346c68){if(_0x346c68){var _0x33b0c0=typeof _0x352456[_0x092f('0x19')]==='undefined'&&typeof _0x352456['limit']===_0x092f('0x1a');var _0x103cae=_0x346c68[_0x092f('0x1b')];var _0x3dcdee=_0x33b0c0?0x0:_0x352456[_0x092f('0x19')];var _0x56fdab=_0x33b0c0?_0x346c68['count']:_0x352456[_0x092f('0x19')]+_0x352456[_0x092f('0x1c')];var _0x2c4f47;if(_0x56fdab>=_0x103cae){_0x56fdab=_0x103cae;_0x2c4f47=0xc8;}else{_0x2c4f47=0xce;}_0x4e4d0f[_0x092f('0x16')](_0x2c4f47);return _0x4e4d0f[_0x092f('0x1d')]('Content-Range',_0x3dcdee+'-'+_0x56fdab+'/'+_0x103cae)[_0x092f('0x18')](_0x346c68);}return null;};}function patchUpdates(_0x4a7114){return function(_0x5e600a){try{jsonpatch['apply'](_0x5e600a,_0x4a7114,!![]);}catch(_0xa467fa){return BPromise['reject'](_0xa467fa);}return _0x5e600a['save']();};}function saveUpdates(_0x139e9a,_0x2cbf68){return function(_0xcd0039){if(_0xcd0039){return _0xcd0039['update'](_0x139e9a)[_0x092f('0x1e')](function(_0x5aa915){return _0x5aa915;});}return null;};}function removeEntity(_0x2757c3,_0x1528c0){return function(_0x9efe68){if(_0x9efe68){return _0x9efe68[_0x092f('0x1f')]()[_0x092f('0x1e')](function(){var _0xc1eb8d=_0x9efe68[_0x092f('0x20')]({'plain':!![]});var _0x2932c2=_0x092f('0x21');return db[_0x092f('0x22')][_0x092f('0x1f')]({'where':{'type':_0x2932c2,'resourceId':_0xc1eb8d['id']}})[_0x092f('0x1e')](function(){return _0x9efe68;});})[_0x092f('0x1e')](function(){_0x2757c3[_0x092f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0524,_0x459140){return function(_0x58a5a7){if(!_0x58a5a7){_0x2c0524[_0x092f('0x15')](0x194);}return _0x58a5a7;};}function handleError(_0x598e69,_0x4dd349){_0x4dd349=_0x4dd349||0x1f4;return function(_0xea4c6){logger[_0x092f('0x23')](_0xea4c6[_0x092f('0x24')]);if(_0xea4c6[_0x092f('0x25')]){delete _0xea4c6['name'];}_0x598e69[_0x092f('0x16')](_0x4dd349)['send'](_0xea4c6);};}exports[_0x092f('0x26')]=function(_0x3434d8,_0x372327){var _0x2eeb50={},_0x26a525={},_0x3f8351={'count':0x0,'rows':[]};var _0x5bc613=_['map'](db['VoiceChanSpy'][_0x092f('0x27')],function(_0x57ec44){return{'name':_0x57ec44[_0x092f('0x28')],'type':_0x57ec44['type'][_0x092f('0x29')]};});_0x26a525[_0x092f('0x2a')]=_['map'](_0x5bc613,_0x092f('0x25'));_0x26a525['query']=_[_0x092f('0x2b')](_0x3434d8[_0x092f('0x2c')]);_0x26a525[_0x092f('0x2d')]=_[_0x092f('0x2e')](_0x26a525[_0x092f('0x2a')],_0x26a525[_0x092f('0x2c')]);_0x2eeb50['attributes']=_[_0x092f('0x2e')](_0x26a525[_0x092f('0x2a')],qs[_0x092f('0x2f')](_0x3434d8[_0x092f('0x2c')]['fields']));_0x2eeb50[_0x092f('0x30')]=_0x2eeb50[_0x092f('0x30')][_0x092f('0x31')]?_0x2eeb50['attributes']:_0x26a525[_0x092f('0x2a')];if(!_0x3434d8[_0x092f('0x2c')][_0x092f('0x32')](_0x092f('0x33'))){_0x2eeb50[_0x092f('0x1c')]=qs[_0x092f('0x1c')](_0x3434d8[_0x092f('0x2c')][_0x092f('0x1c')]);_0x2eeb50['offset']=qs['offset'](_0x3434d8[_0x092f('0x2c')]['offset']);}_0x2eeb50[_0x092f('0x34')]=qs[_0x092f('0x35')](_0x3434d8[_0x092f('0x2c')][_0x092f('0x35')]);_0x2eeb50[_0x092f('0x36')]=qs[_0x092f('0x2d')](_['pick'](_0x3434d8[_0x092f('0x2c')],_0x26a525[_0x092f('0x2d')]),_0x5bc613);if(_0x3434d8[_0x092f('0x2c')][_0x092f('0x37')]){_0x2eeb50[_0x092f('0x36')]=_[_0x092f('0x38')](_0x2eeb50[_0x092f('0x36')],{'$or':_[_0x092f('0x39')](_0x5bc613,function(_0x7619f){if(_0x7619f[_0x092f('0x3a')]!=='VIRTUAL'){var _0x2fa6cf={};_0x2fa6cf[_0x7619f['name']]={'$like':'%'+_0x3434d8['query']['filter']+'%'};return _0x2fa6cf;}})});}_0x2eeb50=_[_0x092f('0x38')]({},_0x2eeb50,_0x3434d8[_0x092f('0x3b')]);var _0x428c3e={'where':_0x2eeb50[_0x092f('0x36')]};return db[_0x092f('0x3c')][_0x092f('0x1b')](_0x428c3e)[_0x092f('0x1e')](function(_0x4e2704){_0x3f8351['count']=_0x4e2704;if(_0x3434d8[_0x092f('0x2c')]['includeAll']){_0x2eeb50[_0x092f('0x3d')]=[{'all':!![]}];}return db[_0x092f('0x3c')]['findAll'](_0x2eeb50);})[_0x092f('0x1e')](function(_0x1e8f5c){_0x3f8351[_0x092f('0x3e')]=_0x1e8f5c;return _0x3f8351;})[_0x092f('0x1e')](respondWithFilteredResult(_0x372327,_0x2eeb50))[_0x092f('0x3f')](handleError(_0x372327,null));};exports[_0x092f('0x40')]=function(_0x35d9ee,_0x22d596){var _0x554a5f={'raw':![],'where':{'id':_0x35d9ee[_0x092f('0x41')]['id']}},_0x4601b3={};_0x4601b3[_0x092f('0x2a')]=_[_0x092f('0x2b')](db[_0x092f('0x3c')][_0x092f('0x27')]);_0x4601b3['query']=_[_0x092f('0x2b')](_0x35d9ee['query']);_0x4601b3[_0x092f('0x2d')]=_[_0x092f('0x2e')](_0x4601b3[_0x092f('0x2a')],_0x4601b3[_0x092f('0x2c')]);_0x554a5f[_0x092f('0x30')]=_['intersection'](_0x4601b3[_0x092f('0x2a')],qs['fields'](_0x35d9ee[_0x092f('0x2c')][_0x092f('0x2f')]));_0x554a5f[_0x092f('0x30')]=_0x554a5f[_0x092f('0x30')]['length']?_0x554a5f['attributes']:_0x4601b3[_0x092f('0x2a')];if(_0x35d9ee['query'][_0x092f('0x42')]){_0x554a5f[_0x092f('0x3d')]=[{'all':!![]}];}_0x554a5f=_['merge']({},_0x554a5f,_0x35d9ee[_0x092f('0x3b')]);return db[_0x092f('0x3c')][_0x092f('0x43')](_0x554a5f)[_0x092f('0x1e')](handleEntityNotFound(_0x22d596,null))[_0x092f('0x1e')](respondWithResult(_0x22d596,null))[_0x092f('0x3f')](handleError(_0x22d596,null));};exports['create']=function(_0x2f927a,_0xaf3701){return db[_0x092f('0x3c')][_0x092f('0x44')](_0x2f927a[_0x092f('0x45')],{})['then'](function(_0x544af1){var _0x15b795=_0x2f927a[_0x092f('0x46')][_0x092f('0x20')]({'plain':!![]});if(!_0x15b795)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b795[_0x092f('0x47')]===_0x092f('0x46')){var _0x19bb9a=_0x544af1[_0x092f('0x20')]({'plain':!![]});var _0x13f3c4=_0x092f('0x21');return db[_0x092f('0x48')]['find']({'where':{'name':_0x13f3c4,'userProfileId':_0x15b795[_0x092f('0x49')]},'raw':!![]})[_0x092f('0x1e')](function(_0x1027f1){if(_0x1027f1&&_0x1027f1[_0x092f('0x4a')]===0x0){return db[_0x092f('0x22')][_0x092f('0x44')]({'name':_0x19bb9a[_0x092f('0x25')],'resourceId':_0x19bb9a['id'],'type':_0x1027f1['name'],'sectionId':_0x1027f1['id']},{})[_0x092f('0x1e')](function(){return _0x544af1;});}else{return _0x544af1;}})[_0x092f('0x3f')](function(_0x18f1d){logger[_0x092f('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18f1d);throw _0x18f1d;});}return _0x544af1;})[_0x092f('0x1e')](respondWithResult(_0xaf3701,0xc9))[_0x092f('0x3f')](handleError(_0xaf3701,null));};exports['update']=function(_0xf44cf8,_0x493481){if(_0xf44cf8[_0x092f('0x45')]['id']){delete _0xf44cf8[_0x092f('0x45')]['id'];}return db[_0x092f('0x3c')]['find']({'where':{'id':_0xf44cf8['params']['id']}})[_0x092f('0x1e')](handleEntityNotFound(_0x493481,null))[_0x092f('0x1e')](saveUpdates(_0xf44cf8[_0x092f('0x45')],null))[_0x092f('0x1e')](respondWithResult(_0x493481,null))[_0x092f('0x3f')](handleError(_0x493481,null));};exports[_0x092f('0x1f')]=function(_0x4dc623,_0x4003ed){return db[_0x092f('0x3c')][_0x092f('0x43')]({'where':{'id':_0x4dc623['params']['id']}})['then'](handleEntityNotFound(_0x4003ed,null))[_0x092f('0x1e')](removeEntity(_0x4003ed,null))['catch'](handleError(_0x4003ed,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 58cfa6e..9cad9a4 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 _0x25a1=['options','join','StopMixMonitor','length','internal','name','concat','findAll','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy'];(function(_0xfbd396,_0x8eb96b){var _0x3b8490=function(_0x58180a){while(--_0x58180a){_0xfbd396['push'](_0xfbd396['shift']());}};_0x3b8490(++_0x8eb96b);}(_0x25a1,0x1da));var _0x125a=function(_0x4f595a,_0x122192){_0x4f595a=_0x4f595a-0x0;var _0x13d60c=_0x25a1[_0x4f595a];return _0x13d60c;};'use strict';var _=require(_0x125a('0x0'));var util=require('util');var BPromise=require(_0x125a('0x1'));var attributes=require(_0x125a('0x2'));var getUserApplications=function(_0x40e787,_0x1b6ec9,_0x1f8000){var _0x567af6=0x1;var _0xdf41ed=[];var _0x57218f={'context':_0x1b6ec9['context']||_0x125a('0x3'),'exten':util['format'](_0x125a('0x4'),_0x40e787[_0x125a('0x5')],_0x1f8000),'type':_0x125a('0x6'),'isApp':![],'ChanSpyId':_0x40e787['id'],'UserId':_0x1b6ec9['id']};_0xdf41ed[_0x125a('0x7')](_[_0x125a('0x8')]({'app':_0x125a('0x9'),'appdata':util[_0x125a('0xa')](_0x125a('0xb'),_0x125a('0xc')),'priority':_0x567af6++},_0x57218f));if(_0x40e787[_0x125a('0xd')]){_0xdf41ed[_0x125a('0x7')](_[_0x125a('0x8')]({'app':_0x125a('0xe'),'appdata':util[_0x125a('0xa')]('${UNIQUEID}.%s,a',_0x40e787[_0x125a('0xf')]),'priority':_0x567af6++},_0x57218f));}if(_0x40e787[_0x125a('0x10')]){_0xdf41ed['push'](_[_0x125a('0x8')]({'app':_0x125a('0x11'),'appdata':_0x40e787[_0x125a('0x12')],'priority':_0x567af6++},_0x57218f));}_0xdf41ed[_0x125a('0x7')](_[_0x125a('0x8')]({'app':_0x125a('0x13'),'appdata':util['format']('SIP/%s,%s',_0x1b6ec9['name'],_0x40e787[_0x125a('0x14')]?_0x40e787[_0x125a('0x14')][_0x125a('0x15')](''):''),'priority':_0x567af6++},_0x57218f));if(_0x40e787['record']){_0xdf41ed['push'](_['merge']({'app':_0x125a('0x16'),'priority':_0x567af6++},_0x57218f));}return _0xdf41ed;};var getChanSpyApplications=function(_0x21b93b,_0x33e817){var _0x4246d5=[];for(var _0x488fcb=0x0,_0x5b0c80=0x1;_0x488fcb<_0x33e817[_0x125a('0x17')];_0x488fcb++,_0x5b0c80=0x1){_0x4246d5=_0x4246d5['concat'](getUserApplications(_0x21b93b,_0x33e817[_0x488fcb],_0x33e817[_0x488fcb][_0x125a('0x18')]));if(_0x33e817[_0x488fcb][_0x125a('0x18')]!=_0x33e817[_0x488fcb][_0x125a('0x19')]){_0x4246d5=_0x4246d5[_0x125a('0x1a')](getUserApplications(_0x21b93b,_0x33e817[_0x488fcb],_0x33e817[_0x488fcb][_0x125a('0x19')]));}}return _0x4246d5;};var getChanSpyPromise=function(_0x3d9042,_0x1583cd){return new BPromise(function(_0x1b72cc,_0x144563){return _0x3d9042['User'][_0x125a('0x1b')]({'attributes':['id',_0x125a('0x19'),_0x125a('0x18')],'where':{'role':_0x125a('0x1c'),'chanspy':!![]},'raw':!![]})[_0x125a('0x1d')](function(_0x38b07b){if(_0x38b07b){return _0x1b72cc(getChanSpyApplications(_0x1583cd,_0x38b07b));}return _0x1b72cc([]);})[_0x125a('0x1e')](function(_0x1bebf5){_0x144563(_0x1bebf5);});});};module['exports']=function(_0x419c70,_0x3efbce){var _0xe72534=_0x419c70[_0x125a('0x1f')];return _0x419c70[_0x125a('0x20')](_0x125a('0x21'),attributes,{'tableName':_0x125a('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xfcd8c6,_0x58e9dd,_0x5a18ce){return getChanSpyPromise(_0xe72534,_0xfcd8c6)['then'](function(_0x50fff2){if(_0x50fff2&&_0x50fff2['length']){return _0xe72534['VoiceExtension']['bulkCreate'](_0x50fff2);}})['then'](function(){_0x5a18ce();})[_0x125a('0x1e')](function(_0x5ae376){_0x5a18ce(_0x5ae376);});},'afterUpdate':function(_0x1feecd,_0x10bafd,_0x3a3595){return _0xe72534[_0x125a('0x23')][_0x125a('0x24')]({'where':{'ChanSpyId':_0x1feecd['id']}})[_0x125a('0x1d')](function(){return getChanSpyPromise(_0xe72534,_0x1feecd);})[_0x125a('0x1d')](function(_0x4cc2b2){if(_0x4cc2b2&&_0x4cc2b2['length']){return _0xe72534[_0x125a('0x23')][_0x125a('0x25')](_0x4cc2b2);}})[_0x125a('0x1d')](function(){_0x3a3595();})[_0x125a('0x1e')](function(_0x32fb2a){_0x3a3595(_0x32fb2a);});},'afterDestroy':function(_0x85e3d7,_0x2b5baa,_0xecdeb7){return _0xe72534['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x85e3d7['id']}})[_0x125a('0x1d')](function(){_0xecdeb7();})[_0x125a('0x1e')](function(_0x2d2726){_0xecdeb7(_0x2d2726);});}}});}; \ No newline at end of file +var _0xfa09=['bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','record','push','MixMonitor','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','join','length','concat','internal','name','User','then','catch','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy'];(function(_0x425887,_0xa17add){var _0x442bc3=function(_0x2e2a56){while(--_0x2e2a56){_0x425887['push'](_0x425887['shift']());}};_0x442bc3(++_0xa17add);}(_0xfa09,0x1a0));var _0x9fa0=function(_0x1cb2b5,_0x165363){_0x1cb2b5=_0x1cb2b5-0x0;var _0x38ec61=_0xfa09[_0x1cb2b5];return _0x38ec61;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x9fa0('0x0'));var attributes=require(_0x9fa0('0x1'));var getUserApplications=function(_0x646c47,_0x162ae2,_0x59ad24){var _0x44abbf=0x1;var _0x340d9b=[];var _0x229ae1={'context':_0x162ae2['context']||_0x9fa0('0x2'),'exten':util[_0x9fa0('0x3')](_0x9fa0('0x4'),_0x646c47[_0x9fa0('0x5')],_0x59ad24),'type':_0x9fa0('0x6'),'isApp':![],'ChanSpyId':_0x646c47['id'],'UserId':_0x162ae2['id']};_0x340d9b['push'](_[_0x9fa0('0x7')]({'app':_0x9fa0('0x8'),'appdata':util['format'](_0x9fa0('0x9'),'chanspy'),'priority':_0x44abbf++},_0x229ae1));if(_0x646c47[_0x9fa0('0xa')]){_0x340d9b[_0x9fa0('0xb')](_[_0x9fa0('0x7')]({'app':_0x9fa0('0xc'),'appdata':util[_0x9fa0('0x3')]('${UNIQUEID}.%s,a',_0x646c47[_0x9fa0('0xd')]),'priority':_0x44abbf++},_0x229ae1));}if(_0x646c47['auth']){_0x340d9b[_0x9fa0('0xb')](_[_0x9fa0('0x7')]({'app':_0x9fa0('0xe'),'appdata':_0x646c47[_0x9fa0('0xf')],'priority':_0x44abbf++},_0x229ae1));}_0x340d9b[_0x9fa0('0xb')](_['merge']({'app':_0x9fa0('0x10'),'appdata':util[_0x9fa0('0x3')](_0x9fa0('0x11'),_0x162ae2['name'],_0x646c47['options']?_0x646c47['options'][_0x9fa0('0x12')](''):''),'priority':_0x44abbf++},_0x229ae1));if(_0x646c47['record']){_0x340d9b[_0x9fa0('0xb')](_[_0x9fa0('0x7')]({'app':'StopMixMonitor','priority':_0x44abbf++},_0x229ae1));}return _0x340d9b;};var getChanSpyApplications=function(_0xbea2fb,_0x3d4999){var _0x474633=[];for(var _0x4bb7b0=0x0,_0x492b5f=0x1;_0x4bb7b0<_0x3d4999[_0x9fa0('0x13')];_0x4bb7b0++,_0x492b5f=0x1){_0x474633=_0x474633[_0x9fa0('0x14')](getUserApplications(_0xbea2fb,_0x3d4999[_0x4bb7b0],_0x3d4999[_0x4bb7b0][_0x9fa0('0x15')]));if(_0x3d4999[_0x4bb7b0][_0x9fa0('0x15')]!=_0x3d4999[_0x4bb7b0][_0x9fa0('0x16')]){_0x474633=_0x474633[_0x9fa0('0x14')](getUserApplications(_0xbea2fb,_0x3d4999[_0x4bb7b0],_0x3d4999[_0x4bb7b0][_0x9fa0('0x16')]));}}return _0x474633;};var getChanSpyPromise=function(_0x1e6cf4,_0x5dc844){return new BPromise(function(_0x3ee658,_0xd332ac){return _0x1e6cf4[_0x9fa0('0x17')]['findAll']({'attributes':['id','name',_0x9fa0('0x15')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x9fa0('0x18')](function(_0x3275ce){if(_0x3275ce){return _0x3ee658(getChanSpyApplications(_0x5dc844,_0x3275ce));}return _0x3ee658([]);})[_0x9fa0('0x19')](function(_0x137912){_0xd332ac(_0x137912);});});};module['exports']=function(_0x1b0241,_0x28706f){var _0x2971ed=_0x1b0241['models'];return _0x1b0241[_0x9fa0('0x1a')](_0x9fa0('0x1b'),attributes,{'tableName':_0x9fa0('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d9e75,_0x34626b,_0x47d8e8){return getChanSpyPromise(_0x2971ed,_0x1d9e75)['then'](function(_0x3ba49b){if(_0x3ba49b&&_0x3ba49b[_0x9fa0('0x13')]){return _0x2971ed[_0x9fa0('0x1d')][_0x9fa0('0x1e')](_0x3ba49b);}})[_0x9fa0('0x18')](function(){_0x47d8e8();})[_0x9fa0('0x19')](function(_0x5e7e0d){_0x47d8e8(_0x5e7e0d);});},'afterUpdate':function(_0x26d46b,_0x4c64b5,_0x52aae3){return _0x2971ed[_0x9fa0('0x1d')][_0x9fa0('0x1f')]({'where':{'ChanSpyId':_0x26d46b['id']}})['then'](function(){return getChanSpyPromise(_0x2971ed,_0x26d46b);})[_0x9fa0('0x18')](function(_0x421cfe){if(_0x421cfe&&_0x421cfe[_0x9fa0('0x13')]){return _0x2971ed[_0x9fa0('0x1d')][_0x9fa0('0x1e')](_0x421cfe);}})['then'](function(){_0x52aae3();})[_0x9fa0('0x19')](function(_0x309e7d){_0x52aae3(_0x309e7d);});},'afterDestroy':function(_0x25b61e,_0x477387,_0x5f4721){return _0x2971ed[_0x9fa0('0x1d')][_0x9fa0('0x1f')]({'where':{'ChanSpyId':_0x25b61e['id']}})[_0x9fa0('0x18')](function(){_0x5f4721();})['catch'](function(_0x5e573d){_0x5f4721(_0x5e573d);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 7dedaed..e51e867 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 _0x0647=['info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x140ef8,_0x4a9e12){var _0x296f58=function(_0x443494){while(--_0x443494){_0x140ef8['push'](_0x140ef8['shift']());}};_0x296f58(++_0x4a9e12);}(_0x0647,0xd0));var _0x7064=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x0647[_0x145b3c];return _0x1b6e36;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var moment=require(_0x7064('0x1'));var BPromise=require(_0x7064('0x2'));var rs=require(_0x7064('0x3'));var fs=require('fs');var Redis=require(_0x7064('0x4'));var db=require(_0x7064('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7064('0x6'));var config=require(_0x7064('0x7'));var jayson=require(_0x7064('0x8'));var client=jayson[_0x7064('0x9')][_0x7064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1101e4,_0x58186b,_0x536336){return new BPromise(function(_0x1c85b1,_0x39b7e3){return client[_0x7064('0xb')](_0x1101e4,_0x536336)['then'](function(_0x38c195){logger[_0x7064('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x58186b,_0x7064('0xd'));logger[_0x7064('0xe')](_0x7064('0xf'),_0x58186b,'request\x20sent',JSON[_0x7064('0x10')](_0x38c195));if(_0x38c195[_0x7064('0x11')]){if(_0x38c195[_0x7064('0x11')][_0x7064('0x12')]===0x1f4){logger['error'](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);return _0x39b7e3(_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);}logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')]['message']);return _0x1c85b1(_0x38c195['error']['message']);}else{logger[_0x7064('0xc')](_0x7064('0x13'),_0x58186b,_0x7064('0xd'));_0x1c85b1(_0x38c195['result'][_0x7064('0x14')]);}})[_0x7064('0x15')](function(_0x5bb1cc){logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x5bb1cc);_0x39b7e3(_0x5bb1cc);});});} \ No newline at end of file +var _0x13f6=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0x13f6,0x124));var _0x613f=function(_0x3ee695,_0x3adb56){_0x3ee695=_0x3ee695-0x0;var _0x5eeeec=_0x13f6[_0x3ee695];return _0x5eeeec;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index da07225..ed8b625 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 _0xbc0c=['get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x3536d0,_0x403160){var _0xa8b664=function(_0x4d7afe){while(--_0x4d7afe){_0x3536d0['push'](_0x3536d0['shift']());}};_0xa8b664(++_0x403160);}(_0xbc0c,0x171));var _0xcbc0=function(_0x28a653,_0xcd7f78){_0x28a653=_0x28a653-0x0;var _0x980e01=_0xbc0c[_0x28a653];return _0x980e01;};'use strict';var multer=require(_0xcbc0('0x0'));var util=require(_0xcbc0('0x1'));var path=require(_0xcbc0('0x2'));var timeout=require(_0xcbc0('0x3'));var express=require(_0xcbc0('0x4'));var router=express[_0xcbc0('0x5')]();var fs_extra=require(_0xcbc0('0x6'));var auth=require(_0xcbc0('0x7'));var interaction=require(_0xcbc0('0x8'));var config=require(_0xcbc0('0x9'));var controller=require(_0xcbc0('0xa'));router[_0xcbc0('0xb')]('/',auth[_0xcbc0('0xc')](),controller[_0xcbc0('0xd')]);router[_0xcbc0('0xb')](_0xcbc0('0xe'),auth[_0xcbc0('0xc')](),controller[_0xcbc0('0xf')]);router[_0xcbc0('0x10')]('/',auth[_0xcbc0('0xc')](),controller[_0xcbc0('0x11')]);router[_0xcbc0('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xcbc0('0xe'),auth[_0xcbc0('0xc')](),controller['destroy']);module[_0xcbc0('0x13')]=router; \ No newline at end of file +var _0x5bf6=['index','/:id','show','create','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x5ed024,_0x20fcac){var _0x529b32=function(_0x373b27){while(--_0x373b27){_0x5ed024['push'](_0x5ed024['shift']());}};_0x529b32(++_0x20fcac);}(_0x5bf6,0x1b7));var _0x65bf=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0x5bf6[_0x54b062];return _0x255e41;};'use strict';var multer=require(_0x65bf('0x0'));var util=require('util');var path=require(_0x65bf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x65bf('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x65bf('0x3'));var interaction=require(_0x65bf('0x4'));var config=require(_0x65bf('0x5'));var controller=require(_0x65bf('0x6'));router[_0x65bf('0x7')]('/',auth[_0x65bf('0x8')](),controller[_0x65bf('0x9')]);router['get'](_0x65bf('0xa'),auth[_0x65bf('0x8')](),controller[_0x65bf('0xb')]);router['post']('/',auth[_0x65bf('0x8')](),controller[_0x65bf('0xc')]);router['put']('/:id',auth[_0x65bf('0x8')](),controller['update']);router['delete'](_0x65bf('0xa'),auth[_0x65bf('0x8')](),controller['destroy']);module[_0x65bf('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 52babbf..1c391f8 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 _0xa403=['name','sequelize'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xa403,0xe1));var _0x3a40=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xa403[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x3a40('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3a40('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcbc2=['sequelize','exports','STRING','name'];(function(_0x4a8f4b,_0x2e5c36){var _0x58a9ef=function(_0x56f19f){while(--_0x56f19f){_0x4a8f4b['push'](_0x4a8f4b['shift']());}};_0x58a9ef(++_0x2e5c36);}(_0xcbc2,0x100));var _0x2cbc=function(_0x53468a,_0x286986){_0x53468a=_0x53468a-0x0;var _0x205efd=_0xcbc2[_0x53468a];return _0x205efd;};'use strict';var Sequelize=require(_0x2cbc('0x0'));module[_0x2cbc('0x1')]={'name':{'type':Sequelize[_0x2cbc('0x2')],'unique':_0x2cbc('0x3')},'description':{'type':Sequelize[_0x2cbc('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index fd164d6..5d6b3ef 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 _0x638a=['update','body','findAll','writeFileSync','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','Contexts','UserProfileResource','destroy','name','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','includeAll','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x53a34c,_0x25cffd){var _0x3dda74=function(_0x559ccd){while(--_0x559ccd){_0x53a34c['push'](_0x53a34c['shift']());}};_0x3dda74(++_0x25cffd);}(_0x638a,0x6e));var _0xa638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa638('0x0'));var rimraf=require(_0xa638('0x1'));var zipdir=require(_0xa638('0x2'));var jsonpatch=require(_0xa638('0x3'));var rp=require('request-promise');var moment=require(_0xa638('0x4'));var BPromise=require(_0xa638('0x5'));var Mustache=require(_0xa638('0x6'));var util=require(_0xa638('0x7'));var path=require(_0xa638('0x8'));var sox=require(_0xa638('0x9'));var csv=require(_0xa638('0xa'));var ejs=require(_0xa638('0xb'));var fs=require('fs');var fs_extra=require(_0xa638('0xc'));var _=require(_0xa638('0xd'));var squel=require(_0xa638('0xe'));var crypto=require('crypto');var jsforce=require(_0xa638('0xf'));var deskjs=require(_0xa638('0x10'));var toCsv=require(_0xa638('0xa'));var querystring=require('querystring');var Papa=require(_0xa638('0x11'));var Redis=require(_0xa638('0x12'));var authService=require(_0xa638('0x13'));var qs=require(_0xa638('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa638('0x15'));var logger=require('../../config/logger')(_0xa638('0x16'));var utils=require(_0xa638('0x17'));var config=require(_0xa638('0x18'));var licenseUtil=require(_0xa638('0x19'));var db=require(_0xa638('0x1a'))['db'];var jayson=require(_0xa638('0x1b'));var client=jayson[_0xa638('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56a013,_0x12b376,_0x2656d4,_0x14a824){return new BPromise(function(_0x595109,_0x115540){var _0x14e903=_0x14a824||client;return _0x14e903['request'](_0x56a013,_0x2656d4)[_0xa638('0x1d')](function(_0x3b168a){logger[_0xa638('0x1e')](_0xa638('0x1f'),_0x12b376,_0xa638('0x20'));logger['debug'](_0xa638('0x21'),_0x12b376,_0xa638('0x20'),JSON[_0xa638('0x22')](_0x3b168a));if(_0x3b168a['error']){if(_0x3b168a[_0xa638('0x23')]['code']===0x1f4){logger[_0xa638('0x23')](_0xa638('0x1f'),_0x12b376,_0x3b168a[_0xa638('0x23')]['message']);return _0x115540(_0x3b168a[_0xa638('0x23')][_0xa638('0x24')]);}logger[_0xa638('0x23')](_0xa638('0x1f'),_0x12b376,_0x3b168a['error']['message']);return _0x595109(_0x3b168a['error'][_0xa638('0x24')]);}else{logger[_0xa638('0x1e')](_0xa638('0x1f'),_0x12b376,_0xa638('0x20'));_0x595109(_0x3b168a['result'][_0xa638('0x24')]);}})[_0xa638('0x25')](function(_0x4ac02a){logger[_0xa638('0x23')]('VoiceContext,\x20%s,\x20%s',_0x12b376,_0x4ac02a);_0x115540(_0x4ac02a);});});}function respondWithStatusCode(_0x3ac4da,_0x59b6e9){_0x59b6e9=_0x59b6e9||0xcc;return function(_0x37cbe3){if(_0x37cbe3){return _0x3ac4da[_0xa638('0x26')](_0x59b6e9);}return _0x3ac4da[_0xa638('0x27')](_0x59b6e9)[_0xa638('0x28')]();};}function respondWithResult(_0x25fab3,_0x4d5560){_0x4d5560=_0x4d5560||0xc8;return function(_0x62dd1d){if(_0x62dd1d){return _0x25fab3[_0xa638('0x27')](_0x4d5560)[_0xa638('0x29')](_0x62dd1d);}};}function respondWithFilteredResult(_0x2cac14,_0x1ac449){return function(_0x9d0d82){if(_0x9d0d82){var _0x69def5=typeof _0x1ac449[_0xa638('0x2a')]===_0xa638('0x2b')&&typeof _0x1ac449[_0xa638('0x2c')]===_0xa638('0x2b');var _0x5d982b=_0x9d0d82[_0xa638('0x2d')];var _0x7217db=_0x69def5?0x0:_0x1ac449[_0xa638('0x2a')];var _0x485ce6=_0x69def5?_0x9d0d82[_0xa638('0x2d')]:_0x1ac449[_0xa638('0x2a')]+_0x1ac449[_0xa638('0x2c')];var _0x56a3ea;if(_0x485ce6>=_0x5d982b){_0x485ce6=_0x5d982b;_0x56a3ea=0xc8;}else{_0x56a3ea=0xce;}_0x2cac14[_0xa638('0x27')](_0x56a3ea);return _0x2cac14[_0xa638('0x2e')](_0xa638('0x2f'),_0x7217db+'-'+_0x485ce6+'/'+_0x5d982b)[_0xa638('0x29')](_0x9d0d82);}return null;};}function patchUpdates(_0x279ac){return function(_0x219fc7){try{jsonpatch[_0xa638('0x30')](_0x219fc7,_0x279ac,!![]);}catch(_0x2de14b){return BPromise[_0xa638('0x31')](_0x2de14b);}return _0x219fc7[_0xa638('0x32')]();};}function saveUpdates(_0x2c3610,_0x3e840f){return function(_0x1b93be){if(_0x1b93be){return _0x1b93be['update'](_0x2c3610)[_0xa638('0x1d')](function(_0x455325){return _0x455325;});}return null;};}function removeEntity(_0x2638d7,_0x49851a){return function(_0x529934){if(_0x529934){return _0x529934['destroy']()[_0xa638('0x1d')](function(){var _0x445afb=_0x529934['get']({'plain':!![]});var _0x467c3d=_0xa638('0x33');return db[_0xa638('0x34')][_0xa638('0x35')]({'where':{'type':_0x467c3d,'resourceId':_0x445afb['id']}})['then'](function(){return _0x529934;});})['then'](function(){_0x2638d7[_0xa638('0x27')](0xcc)[_0xa638('0x28')]();});}};}function handleEntityNotFound(_0x2c05e4,_0x58d8c8){return function(_0x53497a){if(!_0x53497a){_0x2c05e4['sendStatus'](0x194);}return _0x53497a;};}function handleError(_0x103100,_0x1ab9e7){_0x1ab9e7=_0x1ab9e7||0x1f4;return function(_0x3dab09){logger[_0xa638('0x23')](_0x3dab09['stack']);if(_0x3dab09['name']){delete _0x3dab09[_0xa638('0x36')];}_0x103100[_0xa638('0x27')](_0x1ab9e7)['send'](_0x3dab09);};}exports['index']=function(_0x4b5b9c,_0x2742b5){var _0x5f1d60={},_0x10f48a={},_0x3f629d={'count':0x0,'rows':[]};var _0x1d06b0=_['map'](db[_0xa638('0x37')][_0xa638('0x38')],function(_0x5cd07e){return{'name':_0x5cd07e[_0xa638('0x39')],'type':_0x5cd07e[_0xa638('0x3a')][_0xa638('0x3b')]};});_0x10f48a[_0xa638('0x3c')]=_[_0xa638('0x3d')](_0x1d06b0,'name');_0x10f48a[_0xa638('0x3e')]=_[_0xa638('0x3f')](_0x4b5b9c[_0xa638('0x3e')]);_0x10f48a[_0xa638('0x40')]=_['intersection'](_0x10f48a[_0xa638('0x3c')],_0x10f48a[_0xa638('0x3e')]);_0x5f1d60[_0xa638('0x41')]=_[_0xa638('0x42')](_0x10f48a['model'],qs[_0xa638('0x43')](_0x4b5b9c[_0xa638('0x3e')][_0xa638('0x43')]));_0x5f1d60[_0xa638('0x41')]=_0x5f1d60[_0xa638('0x41')][_0xa638('0x44')]?_0x5f1d60['attributes']:_0x10f48a[_0xa638('0x3c')];if(!_0x4b5b9c['query'][_0xa638('0x45')](_0xa638('0x46'))){_0x5f1d60['limit']=qs[_0xa638('0x2c')](_0x4b5b9c[_0xa638('0x3e')][_0xa638('0x2c')]);_0x5f1d60[_0xa638('0x2a')]=qs[_0xa638('0x2a')](_0x4b5b9c[_0xa638('0x3e')][_0xa638('0x2a')]);}_0x5f1d60[_0xa638('0x47')]=qs[_0xa638('0x48')](_0x4b5b9c[_0xa638('0x3e')][_0xa638('0x48')]);_0x5f1d60[_0xa638('0x49')]=qs[_0xa638('0x40')](_[_0xa638('0x4a')](_0x4b5b9c['query'],_0x10f48a[_0xa638('0x40')]),_0x1d06b0);if(_0x4b5b9c[_0xa638('0x3e')][_0xa638('0x4b')]){_0x5f1d60[_0xa638('0x49')]=_[_0xa638('0x4c')](_0x5f1d60[_0xa638('0x49')],{'$or':_[_0xa638('0x3d')](_0x1d06b0,function(_0x184465){if(_0x184465['type']!=='VIRTUAL'){var _0x3348bf={};_0x3348bf[_0x184465['name']]={'$like':'%'+_0x4b5b9c[_0xa638('0x3e')][_0xa638('0x4b')]+'%'};return _0x3348bf;}})});}_0x5f1d60=_[_0xa638('0x4c')]({},_0x5f1d60,_0x4b5b9c[_0xa638('0x4d')]);var _0x4c9369={'where':_0x5f1d60['where']};return db[_0xa638('0x37')][_0xa638('0x2d')](_0x4c9369)[_0xa638('0x1d')](function(_0x507d2a){_0x3f629d[_0xa638('0x2d')]=_0x507d2a;if(_0x4b5b9c[_0xa638('0x3e')]['includeAll']){_0x5f1d60[_0xa638('0x4e')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x5f1d60);})['then'](function(_0x328951){_0x3f629d[_0xa638('0x4f')]=_0x328951;return _0x3f629d;})[_0xa638('0x1d')](respondWithFilteredResult(_0x2742b5,_0x5f1d60))[_0xa638('0x25')](handleError(_0x2742b5,null));};exports[_0xa638('0x50')]=function(_0x527a43,_0x58a7fe){var _0x321b7c={'raw':![],'where':{'id':_0x527a43['params']['id']}},_0x39161d={};_0x39161d[_0xa638('0x3c')]=_[_0xa638('0x3f')](db[_0xa638('0x37')][_0xa638('0x38')]);_0x39161d[_0xa638('0x3e')]=_[_0xa638('0x3f')](_0x527a43['query']);_0x39161d['filters']=_[_0xa638('0x42')](_0x39161d[_0xa638('0x3c')],_0x39161d[_0xa638('0x3e')]);_0x321b7c[_0xa638('0x41')]=_[_0xa638('0x42')](_0x39161d[_0xa638('0x3c')],qs[_0xa638('0x43')](_0x527a43[_0xa638('0x3e')][_0xa638('0x43')]));_0x321b7c['attributes']=_0x321b7c['attributes'][_0xa638('0x44')]?_0x321b7c[_0xa638('0x41')]:_0x39161d[_0xa638('0x3c')];if(_0x527a43['query'][_0xa638('0x51')]){_0x321b7c[_0xa638('0x4e')]=[{'all':!![]}];}_0x321b7c=_[_0xa638('0x4c')]({},_0x321b7c,_0x527a43[_0xa638('0x4d')]);return db[_0xa638('0x37')][_0xa638('0x52')](_0x321b7c)['then'](handleEntityNotFound(_0x58a7fe,null))[_0xa638('0x1d')](respondWithResult(_0x58a7fe,null))['catch'](handleError(_0x58a7fe,null));};exports[_0xa638('0x53')]=function(_0xc449d9,_0x11b207,_0x448c64){var _0x41c69a;return db[_0xa638('0x37')]['create'](_0xc449d9['body'],{'raw':!![]})[_0xa638('0x1d')](function(_0x28aec0){_0x41c69a=_0x28aec0;return db[_0xa638('0x37')]['findAll']({'raw':!![]});})['then'](function(_0x3465c7){var _0x1ff9b3=fs[_0xa638('0x54')](path[_0xa638('0x55')](config[_0xa638('0x56')],_0xa638('0x57')),_0xa638('0x58'));var _0x187cf9=ejs[_0xa638('0x59')](_0x1ff9b3,{'contexts':_0x3465c7||[]});fs['writeFileSync'](_0xa638('0x5a'),_0x187cf9);})['then'](function(){return respondWithRpcPromise(_0xa638('0x5b'),_0xa638('0x53'),{'module':_0xa638('0x5c')});})['then'](function(){var _0x14f535=_0xc449d9[_0xa638('0x5d')][_0xa638('0x5e')]({'plain':!![]});if(!_0x14f535)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14f535[_0xa638('0x5f')]===_0xa638('0x5d')){var _0x1ba787=_0x41c69a[_0xa638('0x5e')]({'plain':!![]});return db[_0xa638('0x60')]['find']({'where':{'name':_0xa638('0x33'),'userProfileId':_0x14f535[_0xa638('0x61')]},'raw':!![]})[_0xa638('0x1d')](function(_0x3f1c4f){if(_0x3f1c4f&&_0x3f1c4f[_0xa638('0x62')]===0x0){return db['UserProfileResource'][_0xa638('0x53')]({'name':_0x1ba787[_0xa638('0x36')],'resourceId':_0x1ba787['id'],'type':_0x3f1c4f[_0xa638('0x36')],'sectionId':_0x3f1c4f['id']},{})[_0xa638('0x1d')](function(){return _0x41c69a;});}else{return _0x41c69a;}})[_0xa638('0x25')](function(_0x39ed38){logger[_0xa638('0x23')](_0xa638('0x63'),_0x39ed38);throw _0x39ed38;});}return _0x41c69a;})[_0xa638('0x1d')](respondWithResult(_0x11b207,0xc9))[_0xa638('0x25')](handleError(_0x11b207,null));};exports[_0xa638('0x64')]=function(_0xbc972c,_0x5ea1fb,_0x51e5cb){var _0x19f0e7;return db['VoiceContext'][_0xa638('0x52')]({'where':{'id':_0xbc972c['params']['id']}})['then'](handleEntityNotFound(_0x5ea1fb,null))[_0xa638('0x1d')](saveUpdates(_0xbc972c[_0xa638('0x65')],null))[_0xa638('0x1d')](function(_0x4470da){if(_0x4470da){_0x19f0e7=_0x4470da;return db[_0xa638('0x37')][_0xa638('0x66')]({'raw':!![]});}})['then'](function(_0x2ce68f){var _0xa6a961=fs[_0xa638('0x54')](path[_0xa638('0x55')](config['root'],'server/files/templates/context.ejs'),_0xa638('0x58'));var _0x55ee6c=ejs[_0xa638('0x59')](_0xa6a961,{'contexts':_0x2ce68f||[]});fs[_0xa638('0x67')](_0xa638('0x5a'),_0x55ee6c);})[_0xa638('0x1d')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xa638('0x5c')});})[_0xa638('0x1d')](function(){return _0x19f0e7;})['then'](respondWithResult(_0x5ea1fb,null))[_0xa638('0x25')](handleError(_0x5ea1fb,null));};exports[_0xa638('0x35')]=function(_0x18b30e,_0x301c0d,_0x2a06ac){var _0x56df2b;return db['VoiceContext'][_0xa638('0x52')]({'where':{'id':_0x18b30e[_0xa638('0x68')]['id']}})['then'](handleEntityNotFound(_0x301c0d,null))[_0xa638('0x1d')](removeEntity(_0x301c0d,null))[_0xa638('0x1d')](function(){return db[_0xa638('0x37')][_0xa638('0x66')]({'raw':!![]});})[_0xa638('0x1d')](function(_0x40ef12){var _0x12fef6=fs['readFileSync'](path['join'](config[_0xa638('0x56')],'server/files/templates/context.ejs'),_0xa638('0x58'));var _0x6f264c=ejs[_0xa638('0x59')](_0x12fef6,{'contexts':_0x40ef12});fs[_0xa638('0x67')](_0xa638('0x5a'),_0x6f264c);return respondWithRpcPromise(_0xa638('0x5b'),'destroy',{'module':_0xa638('0x5c')});})[_0xa638('0x25')](handleError(_0x301c0d,null));}; \ No newline at end of file +var _0x218e=['root','readFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','stack','name','send','map','VoiceContext','rawAttributes','fieldName','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','show','params','intersection','find','catch','create','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','join'];(function(_0x11487e,_0x2695cd){var _0x3bb686=function(_0x3029de){while(--_0x3029de){_0x11487e['push'](_0x11487e['shift']());}};_0x3bb686(++_0x2695cd);}(_0x218e,0x6b));var _0xe218=function(_0x12892c,_0x1cf853){_0x12892c=_0x12892c-0x0;var _0x59db19=_0x218e[_0x12892c];return _0x59db19;};'use strict';var emlformat=require(_0xe218('0x0'));var rimraf=require(_0xe218('0x1'));var zipdir=require(_0xe218('0x2'));var jsonpatch=require(_0xe218('0x3'));var rp=require(_0xe218('0x4'));var moment=require('moment');var BPromise=require(_0xe218('0x5'));var Mustache=require(_0xe218('0x6'));var util=require(_0xe218('0x7'));var path=require(_0xe218('0x8'));var sox=require(_0xe218('0x9'));var csv=require('to-csv');var ejs=require(_0xe218('0xa'));var fs=require('fs');var fs_extra=require(_0xe218('0xb'));var _=require(_0xe218('0xc'));var squel=require(_0xe218('0xd'));var crypto=require(_0xe218('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe218('0xf'));var toCsv=require(_0xe218('0x10'));var querystring=require('querystring');var Papa=require(_0xe218('0x11'));var Redis=require(_0xe218('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe218('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe218('0x14'));var logger=require(_0xe218('0x15'))(_0xe218('0x16'));var utils=require(_0xe218('0x17'));var config=require(_0xe218('0x18'));var licenseUtil=require(_0xe218('0x19'));var db=require(_0xe218('0x1a'))['db'];var jayson=require(_0xe218('0x1b'));var client=jayson[_0xe218('0x1c')][_0xe218('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1aaef0,_0x132701,_0x86b58,_0x118bf8){return new BPromise(function(_0x4500d9,_0x25d929){var _0x399667=_0x118bf8||client;return _0x399667[_0xe218('0x1e')](_0x1aaef0,_0x86b58)['then'](function(_0x358c26){logger[_0xe218('0x1f')](_0xe218('0x20'),_0x132701,_0xe218('0x21'));logger[_0xe218('0x22')](_0xe218('0x23'),_0x132701,_0xe218('0x21'),JSON[_0xe218('0x24')](_0x358c26));if(_0x358c26['error']){if(_0x358c26[_0xe218('0x25')]['code']===0x1f4){logger[_0xe218('0x25')](_0xe218('0x20'),_0x132701,_0x358c26[_0xe218('0x25')]['message']);return _0x25d929(_0x358c26[_0xe218('0x25')][_0xe218('0x26')]);}logger[_0xe218('0x25')](_0xe218('0x20'),_0x132701,_0x358c26[_0xe218('0x25')][_0xe218('0x26')]);return _0x4500d9(_0x358c26[_0xe218('0x25')]['message']);}else{logger[_0xe218('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x132701,'request\x20sent');_0x4500d9(_0x358c26['result'][_0xe218('0x26')]);}})['catch'](function(_0x56f702){logger[_0xe218('0x25')]('VoiceContext,\x20%s,\x20%s',_0x132701,_0x56f702);_0x25d929(_0x56f702);});});}function respondWithStatusCode(_0x223200,_0x236354){_0x236354=_0x236354||0xcc;return function(_0x15582d){if(_0x15582d){return _0x223200[_0xe218('0x27')](_0x236354);}return _0x223200[_0xe218('0x28')](_0x236354)['end']();};}function respondWithResult(_0x1ec524,_0x594262){_0x594262=_0x594262||0xc8;return function(_0x1c205e){if(_0x1c205e){return _0x1ec524[_0xe218('0x28')](_0x594262)[_0xe218('0x29')](_0x1c205e);}};}function respondWithFilteredResult(_0x2d361b,_0x18a6db){return function(_0x2cb22d){if(_0x2cb22d){var _0x461173=typeof _0x18a6db['offset']===_0xe218('0x2a')&&typeof _0x18a6db['limit']===_0xe218('0x2a');var _0x44cf03=_0x2cb22d['count'];var _0x3bac84=_0x461173?0x0:_0x18a6db[_0xe218('0x2b')];var _0x1533d9=_0x461173?_0x2cb22d[_0xe218('0x2c')]:_0x18a6db[_0xe218('0x2b')]+_0x18a6db[_0xe218('0x2d')];var _0x50e0fa;if(_0x1533d9>=_0x44cf03){_0x1533d9=_0x44cf03;_0x50e0fa=0xc8;}else{_0x50e0fa=0xce;}_0x2d361b[_0xe218('0x28')](_0x50e0fa);return _0x2d361b[_0xe218('0x2e')](_0xe218('0x2f'),_0x3bac84+'-'+_0x1533d9+'/'+_0x44cf03)[_0xe218('0x29')](_0x2cb22d);}return null;};}function patchUpdates(_0x193a0b){return function(_0x4b0ccb){try{jsonpatch[_0xe218('0x30')](_0x4b0ccb,_0x193a0b,!![]);}catch(_0x308819){return BPromise[_0xe218('0x31')](_0x308819);}return _0x4b0ccb[_0xe218('0x32')]();};}function saveUpdates(_0xe34a17,_0x1182c1){return function(_0x462513){if(_0x462513){return _0x462513['update'](_0xe34a17)[_0xe218('0x33')](function(_0x27dd85){return _0x27dd85;});}return null;};}function removeEntity(_0x17cfe0,_0x22c692){return function(_0x5c2a11){if(_0x5c2a11){return _0x5c2a11[_0xe218('0x34')]()[_0xe218('0x33')](function(){var _0xb3c207=_0x5c2a11[_0xe218('0x35')]({'plain':!![]});var _0x1bd0da='Contexts';return db[_0xe218('0x36')]['destroy']({'where':{'type':_0x1bd0da,'resourceId':_0xb3c207['id']}})[_0xe218('0x33')](function(){return _0x5c2a11;});})[_0xe218('0x33')](function(){_0x17cfe0[_0xe218('0x28')](0xcc)[_0xe218('0x37')]();});}};}function handleEntityNotFound(_0x573603,_0x284371){return function(_0x4048a7){if(!_0x4048a7){_0x573603['sendStatus'](0x194);}return _0x4048a7;};}function handleError(_0x734e5f,_0xece016){_0xece016=_0xece016||0x1f4;return function(_0x548281){logger['error'](_0x548281[_0xe218('0x38')]);if(_0x548281[_0xe218('0x39')]){delete _0x548281[_0xe218('0x39')];}_0x734e5f[_0xe218('0x28')](_0xece016)[_0xe218('0x3a')](_0x548281);};}exports['index']=function(_0x9bad37,_0xcd3801){var _0x1755f5={},_0x1eab56={},_0x5f3961={'count':0x0,'rows':[]};var _0x41f6f8=_[_0xe218('0x3b')](db[_0xe218('0x3c')][_0xe218('0x3d')],function(_0x415e47){return{'name':_0x415e47[_0xe218('0x3e')],'type':_0x415e47['type']['key']};});_0x1eab56[_0xe218('0x3f')]=_['map'](_0x41f6f8,_0xe218('0x39'));_0x1eab56[_0xe218('0x40')]=_[_0xe218('0x41')](_0x9bad37[_0xe218('0x40')]);_0x1eab56['filters']=_['intersection'](_0x1eab56['model'],_0x1eab56['query']);_0x1755f5[_0xe218('0x42')]=_['intersection'](_0x1eab56[_0xe218('0x3f')],qs[_0xe218('0x43')](_0x9bad37[_0xe218('0x40')][_0xe218('0x43')]));_0x1755f5[_0xe218('0x42')]=_0x1755f5[_0xe218('0x42')][_0xe218('0x44')]?_0x1755f5[_0xe218('0x42')]:_0x1eab56[_0xe218('0x3f')];if(!_0x9bad37[_0xe218('0x40')][_0xe218('0x45')](_0xe218('0x46'))){_0x1755f5[_0xe218('0x2d')]=qs[_0xe218('0x2d')](_0x9bad37[_0xe218('0x40')][_0xe218('0x2d')]);_0x1755f5[_0xe218('0x2b')]=qs[_0xe218('0x2b')](_0x9bad37[_0xe218('0x40')][_0xe218('0x2b')]);}_0x1755f5['order']=qs[_0xe218('0x47')](_0x9bad37[_0xe218('0x40')][_0xe218('0x47')]);_0x1755f5[_0xe218('0x48')]=qs[_0xe218('0x49')](_[_0xe218('0x4a')](_0x9bad37[_0xe218('0x40')],_0x1eab56[_0xe218('0x49')]),_0x41f6f8);if(_0x9bad37['query'][_0xe218('0x4b')]){_0x1755f5[_0xe218('0x48')]=_[_0xe218('0x4c')](_0x1755f5['where'],{'$or':_['map'](_0x41f6f8,function(_0x379bed){if(_0x379bed[_0xe218('0x4d')]!=='VIRTUAL'){var _0x4c0586={};_0x4c0586[_0x379bed[_0xe218('0x39')]]={'$like':'%'+_0x9bad37[_0xe218('0x40')]['filter']+'%'};return _0x4c0586;}})});}_0x1755f5=_[_0xe218('0x4c')]({},_0x1755f5,_0x9bad37['options']);var _0x3c0590={'where':_0x1755f5[_0xe218('0x48')]};return db[_0xe218('0x3c')][_0xe218('0x2c')](_0x3c0590)[_0xe218('0x33')](function(_0x5ab30d){_0x5f3961['count']=_0x5ab30d;if(_0x9bad37['query'][_0xe218('0x4e')]){_0x1755f5[_0xe218('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0xe218('0x50')](_0x1755f5);})['then'](function(_0x51fad6){_0x5f3961['rows']=_0x51fad6;return _0x5f3961;})[_0xe218('0x33')](respondWithFilteredResult(_0xcd3801,_0x1755f5))['catch'](handleError(_0xcd3801,null));};exports[_0xe218('0x51')]=function(_0x4fc3f9,_0x35be07){var _0x9d74bf={'raw':![],'where':{'id':_0x4fc3f9[_0xe218('0x52')]['id']}},_0xd52c6e={};_0xd52c6e[_0xe218('0x3f')]=_[_0xe218('0x41')](db[_0xe218('0x3c')][_0xe218('0x3d')]);_0xd52c6e[_0xe218('0x40')]=_[_0xe218('0x41')](_0x4fc3f9[_0xe218('0x40')]);_0xd52c6e[_0xe218('0x49')]=_[_0xe218('0x53')](_0xd52c6e[_0xe218('0x3f')],_0xd52c6e[_0xe218('0x40')]);_0x9d74bf[_0xe218('0x42')]=_['intersection'](_0xd52c6e[_0xe218('0x3f')],qs[_0xe218('0x43')](_0x4fc3f9['query'][_0xe218('0x43')]));_0x9d74bf[_0xe218('0x42')]=_0x9d74bf[_0xe218('0x42')][_0xe218('0x44')]?_0x9d74bf[_0xe218('0x42')]:_0xd52c6e[_0xe218('0x3f')];if(_0x4fc3f9[_0xe218('0x40')][_0xe218('0x4e')]){_0x9d74bf['include']=[{'all':!![]}];}_0x9d74bf=_[_0xe218('0x4c')]({},_0x9d74bf,_0x4fc3f9['options']);return db['VoiceContext'][_0xe218('0x54')](_0x9d74bf)['then'](handleEntityNotFound(_0x35be07,null))[_0xe218('0x33')](respondWithResult(_0x35be07,null))[_0xe218('0x55')](handleError(_0x35be07,null));};exports[_0xe218('0x56')]=function(_0x232020,_0x3d78e7,_0x263aa7){var _0x56000d;return db['VoiceContext'][_0xe218('0x56')](_0x232020['body'],{'raw':!![]})['then'](function(_0x5be7c4){_0x56000d=_0x5be7c4;return db['VoiceContext'][_0xe218('0x50')]({'raw':!![]});})[_0xe218('0x33')](function(_0x56c2b5){var _0x25184d=fs['readFileSync'](path['join'](config['root'],_0xe218('0x57')),_0xe218('0x58'));var _0xe84a40=ejs[_0xe218('0x59')](_0x25184d,{'contexts':_0x56c2b5||[]});fs[_0xe218('0x5a')](_0xe218('0x5b'),_0xe84a40);})[_0xe218('0x33')](function(){return respondWithRpcPromise(_0xe218('0x5c'),_0xe218('0x56'),{'module':_0xe218('0x5d')});})[_0xe218('0x33')](function(){var _0x2bb64b=_0x232020[_0xe218('0x5e')][_0xe218('0x35')]({'plain':!![]});if(!_0x2bb64b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bb64b['role']===_0xe218('0x5e')){var _0x449534=_0x56000d['get']({'plain':!![]});return db[_0xe218('0x5f')][_0xe218('0x54')]({'where':{'name':_0xe218('0x60'),'userProfileId':_0x2bb64b[_0xe218('0x61')]},'raw':!![]})['then'](function(_0x5ef5c8){if(_0x5ef5c8&&_0x5ef5c8[_0xe218('0x62')]===0x0){return db['UserProfileResource'][_0xe218('0x56')]({'name':_0x449534[_0xe218('0x39')],'resourceId':_0x449534['id'],'type':_0x5ef5c8[_0xe218('0x39')],'sectionId':_0x5ef5c8['id']},{})['then'](function(){return _0x56000d;});}else{return _0x56000d;}})['catch'](function(_0x47778f){logger[_0xe218('0x25')](_0xe218('0x63'),_0x47778f);throw _0x47778f;});}return _0x56000d;})['then'](respondWithResult(_0x3d78e7,0xc9))[_0xe218('0x55')](handleError(_0x3d78e7,null));};exports[_0xe218('0x64')]=function(_0x5de711,_0x53de91,_0x278212){var _0xdbd90a;return db[_0xe218('0x3c')][_0xe218('0x54')]({'where':{'id':_0x5de711[_0xe218('0x52')]['id']}})[_0xe218('0x33')](handleEntityNotFound(_0x53de91,null))[_0xe218('0x33')](saveUpdates(_0x5de711[_0xe218('0x65')],null))['then'](function(_0x1c7046){if(_0x1c7046){_0xdbd90a=_0x1c7046;return db[_0xe218('0x3c')][_0xe218('0x50')]({'raw':!![]});}})[_0xe218('0x33')](function(_0x2995d3){var _0x5d20e4=fs['readFileSync'](path[_0xe218('0x66')](config[_0xe218('0x67')],'server/files/templates/context.ejs'),_0xe218('0x58'));var _0x19eaeb=ejs['render'](_0x5d20e4,{'contexts':_0x2995d3||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x19eaeb);})['then'](function(){return respondWithRpcPromise('Reload',_0xe218('0x64'),{'module':_0xe218('0x5d')});})[_0xe218('0x33')](function(){return _0xdbd90a;})['then'](respondWithResult(_0x53de91,null))['catch'](handleError(_0x53de91,null));};exports[_0xe218('0x34')]=function(_0x418b7a,_0x2abc88,_0xe3706f){var _0x36ef67;return db[_0xe218('0x3c')][_0xe218('0x54')]({'where':{'id':_0x418b7a[_0xe218('0x52')]['id']}})[_0xe218('0x33')](handleEntityNotFound(_0x2abc88,null))[_0xe218('0x33')](removeEntity(_0x2abc88,null))[_0xe218('0x33')](function(){return db[_0xe218('0x3c')][_0xe218('0x50')]({'raw':!![]});})[_0xe218('0x33')](function(_0x49f2ac){var _0x2bbb1d=fs[_0xe218('0x68')](path[_0xe218('0x66')](config[_0xe218('0x67')],'server/files/templates/context.ejs'),_0xe218('0x58'));var _0x1d9d13=ejs[_0xe218('0x59')](_0x2bbb1d,{'contexts':_0x49f2ac});fs[_0xe218('0x5a')](_0xe218('0x5b'),_0x1d9d13);return respondWithRpcPromise('Reload',_0xe218('0x34'),{'module':'chan_sip.so'});})[_0xe218('0x55')](handleError(_0x2abc88,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 6934819..b5507cd 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 _0x6bc0=['define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x272b57,_0x56cc34){var _0x44322a=function(_0x24782b){while(--_0x24782b){_0x272b57['push'](_0x272b57['shift']());}};_0x44322a(++_0x56cc34);}(_0x6bc0,0xc7));var _0x06bc=function(_0xedd03d,_0x46c3ab){_0xedd03d=_0xedd03d-0x0;var _0x2311bc=_0x6bc0[_0xedd03d];return _0x2311bc;};'use strict';var _=require(_0x06bc('0x0'));var util=require('util');var logger=require(_0x06bc('0x1'))(_0x06bc('0x2'));var moment=require(_0x06bc('0x3'));var BPromise=require(_0x06bc('0x4'));var rp=require(_0x06bc('0x5'));var fs=require('fs');var path=require(_0x06bc('0x6'));var rimraf=require(_0x06bc('0x7'));var config=require(_0x06bc('0x8'));var attributes=require(_0x06bc('0x9'));module[_0x06bc('0xa')]=function(_0x5a635f,_0x484f6c){return _0x5a635f[_0x06bc('0xb')](_0x06bc('0xc'),attributes,{'tableName':_0x06bc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f71=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceContext','lodash','util','../../config/logger','api'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x3f71,0x10d));var _0x13f7=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0x3f71[_0x3b231a];return _0x18d67a;};'use strict';var _=require(_0x13f7('0x0'));var util=require(_0x13f7('0x1'));var logger=require(_0x13f7('0x2'))(_0x13f7('0x3'));var moment=require(_0x13f7('0x4'));var BPromise=require(_0x13f7('0x5'));var rp=require(_0x13f7('0x6'));var fs=require('fs');var path=require(_0x13f7('0x7'));var rimraf=require(_0x13f7('0x8'));var config=require(_0x13f7('0x9'));var attributes=require('./voiceContext.attributes');module[_0x13f7('0xa')]=function(_0x534379,_0x1aa89f){return _0x534379[_0x13f7('0xb')](_0x13f7('0xc'),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 2b9d5b5..f0b2358 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 _0x2b84=['jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x96be88,_0x2c01a4){var _0x1c14c0=function(_0x20aeff){while(--_0x20aeff){_0x96be88['push'](_0x96be88['shift']());}};_0x1c14c0(++_0x2c01a4);}(_0x2b84,0x1ed));var _0x42b8=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x2b84[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x42b8('0x0'));var util=require(_0x42b8('0x1'));var moment=require('moment');var BPromise=require(_0x42b8('0x2'));var rs=require(_0x42b8('0x3'));var fs=require('fs');var Redis=require(_0x42b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x42b8('0x5'));var logger=require('../../config/logger')(_0x42b8('0x6'));var config=require('../../config/environment');var jayson=require(_0x42b8('0x7'));var client=jayson[_0x42b8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a040d,_0x399f8e,_0x23459e){return new BPromise(function(_0x1c6323,_0x38de8a){return client[_0x42b8('0x9')](_0x4a040d,_0x23459e)['then'](function(_0x381f1a){logger[_0x42b8('0xa')](_0x42b8('0xb'),_0x399f8e,_0x42b8('0xc'));logger[_0x42b8('0xd')](_0x42b8('0xe'),_0x399f8e,_0x42b8('0xc'),JSON[_0x42b8('0xf')](_0x381f1a));if(_0x381f1a['error']){if(_0x381f1a['error'][_0x42b8('0x10')]===0x1f4){logger[_0x42b8('0x11')]('VoiceContext,\x20%s,\x20%s',_0x399f8e,_0x381f1a[_0x42b8('0x11')]['message']);return _0x38de8a(_0x381f1a['error'][_0x42b8('0x12')]);}logger[_0x42b8('0x11')](_0x42b8('0xb'),_0x399f8e,_0x381f1a[_0x42b8('0x11')][_0x42b8('0x12')]);return _0x1c6323(_0x381f1a['error'][_0x42b8('0x12')]);}else{logger['info'](_0x42b8('0xb'),_0x399f8e,'request\x20sent');_0x1c6323(_0x381f1a['result'][_0x42b8('0x12')]);}})[_0x42b8('0x13')](function(_0x2d1706){logger[_0x42b8('0x11')](_0x42b8('0xb'),_0x399f8e,_0x2d1706);_0x38de8a(_0x2d1706);});});} \ No newline at end of file +var _0xd757=['VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xd757,0x1e5));var _0x7d75=function(_0x223ee2,_0x161d58){_0x223ee2=_0x223ee2-0x0;var _0xf60060=_0xd757[_0x223ee2];return _0xf60060;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var moment=require(_0x7d75('0x2'));var BPromise=require(_0x7d75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d75('0x4'))['db'];var utils=require(_0x7d75('0x5'));var logger=require('../../config/logger')(_0x7d75('0x6'));var config=require(_0x7d75('0x7'));var jayson=require(_0x7d75('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x108c0d,_0x3fde33,_0x1cf272){return new BPromise(function(_0x276fb0,_0x4030ee){return client[_0x7d75('0x9')](_0x108c0d,_0x1cf272)[_0x7d75('0xa')](function(_0x3720c7){logger[_0x7d75('0xb')](_0x7d75('0xc'),_0x3fde33,_0x7d75('0xd'));logger[_0x7d75('0xe')](_0x7d75('0xf'),_0x3fde33,'request\x20sent',JSON['stringify'](_0x3720c7));if(_0x3720c7[_0x7d75('0x10')]){if(_0x3720c7[_0x7d75('0x10')][_0x7d75('0x11')]===0x1f4){logger['error'](_0x7d75('0xc'),_0x3fde33,_0x3720c7[_0x7d75('0x10')]['message']);return _0x4030ee(_0x3720c7[_0x7d75('0x10')][_0x7d75('0x12')]);}logger[_0x7d75('0x10')](_0x7d75('0xc'),_0x3fde33,_0x3720c7[_0x7d75('0x10')][_0x7d75('0x12')]);return _0x276fb0(_0x3720c7['error'][_0x7d75('0x12')]);}else{logger[_0x7d75('0xb')](_0x7d75('0xc'),_0x3fde33,_0x7d75('0xd'));_0x276fb0(_0x3720c7[_0x7d75('0x13')][_0x7d75('0x12')]);}})['catch'](function(_0x15ba5f){logger['error'](_0x7d75('0xc'),_0x3fde33,_0x15ba5f);_0x4030ee(_0x15ba5f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 3f0b540..e2d466a 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 _0xece2=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x414c93,_0x486641){var _0x2115e5=function(_0x3c2e9e){while(--_0x3c2e9e){_0x414c93['push'](_0x414c93['shift']());}};_0x2115e5(++_0x486641);}(_0xece2,0x1cd));var _0x2ece=function(_0x1ee08c,_0x595bf8){_0x1ee08c=_0x1ee08c-0x0;var _0x2369a=_0xece2[_0x1ee08c];return _0x2369a;};'use strict';var multer=require(_0x2ece('0x0'));var util=require(_0x2ece('0x1'));var path=require(_0x2ece('0x2'));var timeout=require(_0x2ece('0x3'));var express=require('express');var router=express[_0x2ece('0x4')]();var fs_extra=require(_0x2ece('0x5'));var auth=require(_0x2ece('0x6'));var interaction=require(_0x2ece('0x7'));var config=require(_0x2ece('0x8'));var controller=require(_0x2ece('0x9'));router['get']('/',auth[_0x2ece('0xa')](),controller['index']);router[_0x2ece('0xb')](_0x2ece('0xc'),auth[_0x2ece('0xa')](),controller[_0x2ece('0xd')]);router['get'](_0x2ece('0xe'),auth[_0x2ece('0xa')](),controller[_0x2ece('0xf')]);router['post']('/',auth[_0x2ece('0xa')](),controller[_0x2ece('0x10')]);router['put'](_0x2ece('0xe'),auth[_0x2ece('0xa')](),controller[_0x2ece('0x11')]);router[_0x2ece('0x12')](_0x2ece('0xe'),auth[_0x2ece('0xa')](),controller[_0x2ece('0x13')]);module[_0x2ece('0x14')]=router; \ No newline at end of file +var _0x2645=['get','show','post','create','put','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','describe'];(function(_0x2ed80c,_0x5d31a0){var _0x5d3ac6=function(_0x5f080d){while(--_0x5f080d){_0x2ed80c['push'](_0x2ed80c['shift']());}};_0x5d3ac6(++_0x5d31a0);}(_0x2645,0x1c1));var _0x5264=function(_0x52a9b5,_0xc7c7b2){_0x52a9b5=_0x52a9b5-0x0;var _0x441cfc=_0x2645[_0x52a9b5];return _0x441cfc;};'use strict';var multer=require('multer');var util=require(_0x5264('0x0'));var path=require(_0x5264('0x1'));var timeout=require(_0x5264('0x2'));var express=require(_0x5264('0x3'));var router=express[_0x5264('0x4')]();var fs_extra=require(_0x5264('0x5'));var auth=require(_0x5264('0x6'));var interaction=require(_0x5264('0x7'));var config=require(_0x5264('0x8'));var controller=require(_0x5264('0x9'));router['get']('/',auth[_0x5264('0xa')](),controller[_0x5264('0xb')]);router['get']('/describe',auth[_0x5264('0xa')](),controller[_0x5264('0xc')]);router[_0x5264('0xd')]('/:id',auth[_0x5264('0xa')](),controller[_0x5264('0xe')]);router[_0x5264('0xf')]('/',auth['isAuthenticated'](),controller[_0x5264('0x10')]);router[_0x5264('0x11')]('/:id',auth[_0x5264('0xa')](),controller[_0x5264('0x12')]);router[_0x5264('0x13')](_0x5264('0x14'),auth['isAuthenticated'](),controller[_0x5264('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 8d8ccb8..48b1b89 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 _0x4b84=['INTEGER','STRING','DATE','called,connect,complete','sequelize','exports'];(function(_0x494299,_0x11bd86){var _0x435505=function(_0x29a2b1){while(--_0x29a2b1){_0x494299['push'](_0x494299['shift']());}};_0x435505(++_0x11bd86);}(_0x4b84,0x1cc));var _0x44b8=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x4b84[_0x496333];return _0x44256e;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x44b8('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinename':{'type':Sequelize[_0x44b8('0x3')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x44b8('0x3')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x44b8('0x3')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x44b8('0x3')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x44b8('0x3')]},'destcalleridname':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x44b8('0x3')]},'destaccountcode':{'type':Sequelize[_0x44b8('0x3')]},'destcontext':{'type':Sequelize[_0x44b8('0x3')]},'destexten':{'type':Sequelize[_0x44b8('0x3')]},'destpriority':{'type':Sequelize[_0x44b8('0x2')]},'destuniqueid':{'type':Sequelize[_0x44b8('0x3')]},'destlinkedid':{'type':Sequelize[_0x44b8('0x3')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x44b8('0x3')]},'starttime':{'type':Sequelize[_0x44b8('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x44b8('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x44b8('0x5')},'routeId':{'type':Sequelize[_0x44b8('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x44b8('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6f0d=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x55d905,_0x59fe89){var _0x2e504b=function(_0x238758){while(--_0x238758){_0x55d905['push'](_0x55d905['shift']());}};_0x2e504b(++_0x59fe89);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x382cfb,_0x235f8a){_0x382cfb=_0x382cfb-0x0;var _0x11303d=_0x6f0d[_0x382cfb];return _0x11303d;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'privilege':{'type':Sequelize[_0xd6f0('0x1')]},'channel':{'type':Sequelize[_0xd6f0('0x1')]},'channelstate':{'type':Sequelize[_0xd6f0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'calleridname':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'language':{'type':Sequelize[_0xd6f0('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd6f0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd6f0('0x2')]},'uniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'linkedid':{'type':Sequelize[_0xd6f0('0x1')]},'destchannel':{'type':Sequelize[_0xd6f0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'destcalleridname':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'destlanguage':{'type':Sequelize[_0xd6f0('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd6f0('0x1')]},'destexten':{'type':Sequelize[_0xd6f0('0x1')]},'destpriority':{'type':Sequelize[_0xd6f0('0x2')]},'destuniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xd6f0('0x1')]},'dialstatus':{'type':Sequelize[_0xd6f0('0x1')]},'starttime':{'type':Sequelize[_0xd6f0('0x3')]},'answertime':{'type':Sequelize[_0xd6f0('0x3')]},'endtime':{'type':Sequelize[_0xd6f0('0x3')]},'lastevent':{'type':Sequelize[_0xd6f0('0x1')],'comment':_0xd6f0('0x4')},'routeId':{'type':Sequelize[_0xd6f0('0x2')]},'duration':{'type':Sequelize[_0xd6f0('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd6f0('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index f7c65f8..647ce1a 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 _0x550d=['zip-dir','request-promise','moment','mustache','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','length','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','find','create','body','params'];(function(_0x175e91,_0x5d7678){var _0x3f15c8=function(_0x3f5f1c){while(--_0x3f5f1c){_0x175e91['push'](_0x175e91['shift']());}};_0x3f15c8(++_0x5d7678);}(_0x550d,0x10c));var _0xd550=function(_0x3b831e,_0x1b25ad){_0x3b831e=_0x3b831e-0x0;var _0x12a7ec=_0x550d[_0x3b831e];return _0x12a7ec;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd550('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd550('0x1'));var moment=require(_0xd550('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd550('0x3'));var util=require('util');var path=require(_0xd550('0x4'));var sox=require('sox');var csv=require(_0xd550('0x5'));var ejs=require(_0xd550('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd550('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xd550('0x8'));var toCsv=require(_0xd550('0x5'));var querystring=require(_0xd550('0x9'));var Papa=require(_0xd550('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd550('0xb'));var as=require(_0xd550('0xc'));var hardwareService=require(_0xd550('0xd'));var logger=require(_0xd550('0xe'))(_0xd550('0xf'));var utils=require(_0xd550('0x10'));var config=require(_0xd550('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x421a70,_0x1a7406){_0x1a7406=_0x1a7406||0xcc;return function(_0x33014f){if(_0x33014f){return _0x421a70['sendStatus'](_0x1a7406);}return _0x421a70[_0xd550('0x12')](_0x1a7406)[_0xd550('0x13')]();};}function respondWithResult(_0x9196e8,_0x4fa691){_0x4fa691=_0x4fa691||0xc8;return function(_0x24bb57){if(_0x24bb57){return _0x9196e8['status'](_0x4fa691)['json'](_0x24bb57);}};}function respondWithFilteredResult(_0x4ed8df,_0x14b90e){return function(_0xf4d52c){if(_0xf4d52c){var _0x29c9ed=typeof _0x14b90e[_0xd550('0x14')]===_0xd550('0x15')&&typeof _0x14b90e[_0xd550('0x16')]===_0xd550('0x15');var _0x4b2bdf=_0xf4d52c[_0xd550('0x17')];var _0x378681=_0x29c9ed?0x0:_0x14b90e['offset'];var _0x19c3a7=_0x29c9ed?_0xf4d52c[_0xd550('0x17')]:_0x14b90e['offset']+_0x14b90e[_0xd550('0x16')];var _0x5d8148;if(_0x19c3a7>=_0x4b2bdf){_0x19c3a7=_0x4b2bdf;_0x5d8148=0xc8;}else{_0x5d8148=0xce;}_0x4ed8df[_0xd550('0x12')](_0x5d8148);return _0x4ed8df[_0xd550('0x18')](_0xd550('0x19'),_0x378681+'-'+_0x19c3a7+'/'+_0x4b2bdf)[_0xd550('0x1a')](_0xf4d52c);}return null;};}function patchUpdates(_0x199fa6){return function(_0x2ed926){try{jsonpatch[_0xd550('0x1b')](_0x2ed926,_0x199fa6,!![]);}catch(_0x533457){return BPromise[_0xd550('0x1c')](_0x533457);}return _0x2ed926['save']();};}function saveUpdates(_0x29be3f,_0x19bae6){return function(_0xc448c7){if(_0xc448c7){return _0xc448c7[_0xd550('0x1d')](_0x29be3f)[_0xd550('0x1e')](function(_0x16a06a){return _0x16a06a;});}return null;};}function removeEntity(_0x3d042c,_0x5d3111){return function(_0x587fb3){if(_0x587fb3){return _0x587fb3[_0xd550('0x1f')]()[_0xd550('0x1e')](function(){_0x3d042c['status'](0xcc)[_0xd550('0x13')]();});}};}function handleEntityNotFound(_0x16474f,_0x504326){return function(_0x2b4e23){if(!_0x2b4e23){_0x16474f[_0xd550('0x20')](0x194);}return _0x2b4e23;};}function handleError(_0x55c53e,_0x468668){_0x468668=_0x468668||0x1f4;return function(_0x1815f9){logger[_0xd550('0x21')](_0x1815f9['stack']);if(_0x1815f9['name']){delete _0x1815f9['name'];}_0x55c53e[_0xd550('0x12')](_0x468668)[_0xd550('0x22')](_0x1815f9);};}exports[_0xd550('0x23')]=function(_0x25d80f,_0x86a545){var _0x25b990={},_0x2f2042={},_0x4bd037={'count':0x0,'rows':[]};var _0x4e7b72=_[_0xd550('0x24')](db[_0xd550('0x25')][_0xd550('0x26')],function(_0x45cd74){return{'name':_0x45cd74[_0xd550('0x27')],'type':_0x45cd74[_0xd550('0x28')]['key']};});_0x2f2042['model']=_[_0xd550('0x24')](_0x4e7b72,_0xd550('0x29'));_0x2f2042[_0xd550('0x2a')]=_[_0xd550('0x2b')](_0x25d80f['query']);_0x2f2042[_0xd550('0x2c')]=_[_0xd550('0x2d')](_0x2f2042[_0xd550('0x2e')],_0x2f2042['query']);_0x25b990[_0xd550('0x2f')]=_['intersection'](_0x2f2042[_0xd550('0x2e')],qs['fields'](_0x25d80f['query']['fields']));_0x25b990[_0xd550('0x2f')]=_0x25b990[_0xd550('0x2f')][_0xd550('0x30')]?_0x25b990[_0xd550('0x2f')]:_0x2f2042[_0xd550('0x2e')];if(!_0x25d80f[_0xd550('0x2a')]['hasOwnProperty']('nolimit')){_0x25b990[_0xd550('0x16')]=qs['limit'](_0x25d80f[_0xd550('0x2a')][_0xd550('0x16')]);_0x25b990[_0xd550('0x14')]=qs[_0xd550('0x14')](_0x25d80f[_0xd550('0x2a')][_0xd550('0x14')]);}_0x25b990[_0xd550('0x31')]=qs['sort'](_0x25d80f[_0xd550('0x2a')]['sort']);_0x25b990[_0xd550('0x32')]=qs['filters'](_[_0xd550('0x33')](_0x25d80f[_0xd550('0x2a')],_0x2f2042['filters']),_0x4e7b72);if(_0x25d80f[_0xd550('0x2a')][_0xd550('0x34')]){_0x25b990['where']=_[_0xd550('0x35')](_0x25b990[_0xd550('0x32')],{'$or':_[_0xd550('0x24')](_0x4e7b72,function(_0xe74ebe){if(_0xe74ebe['type']!==_0xd550('0x36')){var _0x5ce94={};_0x5ce94[_0xe74ebe[_0xd550('0x29')]]={'$like':'%'+_0x25d80f[_0xd550('0x2a')]['filter']+'%'};return _0x5ce94;}})});}_0x25b990=_[_0xd550('0x35')]({},_0x25b990,_0x25d80f[_0xd550('0x37')]);var _0x121592={'where':_0x25b990['where']};return db['VoiceDialReport']['count'](_0x121592)[_0xd550('0x1e')](function(_0x3a7152){_0x4bd037[_0xd550('0x17')]=_0x3a7152;if(_0x25d80f[_0xd550('0x2a')][_0xd550('0x38')]){_0x25b990[_0xd550('0x39')]=[{'all':!![]}];}return db[_0xd550('0x25')][_0xd550('0x3a')](_0x25b990);})['then'](function(_0x4fe715){_0x4bd037[_0xd550('0x3b')]=_0x4fe715;return _0x4bd037;})[_0xd550('0x1e')](respondWithFilteredResult(_0x86a545,_0x25b990))[_0xd550('0x3c')](handleError(_0x86a545,null));};exports[_0xd550('0x3d')]=function(_0x23868e,_0x276110){var _0x255c0d={'raw':!![],'where':{'id':_0x23868e['params']['id']}},_0x1e03c4={};_0x1e03c4[_0xd550('0x2e')]=_[_0xd550('0x2b')](db['VoiceDialReport']['rawAttributes']);_0x1e03c4[_0xd550('0x2a')]=_[_0xd550('0x2b')](_0x23868e['query']);_0x1e03c4[_0xd550('0x2c')]=_[_0xd550('0x2d')](_0x1e03c4[_0xd550('0x2e')],_0x1e03c4[_0xd550('0x2a')]);_0x255c0d[_0xd550('0x2f')]=_['intersection'](_0x1e03c4[_0xd550('0x2e')],qs[_0xd550('0x3e')](_0x23868e[_0xd550('0x2a')][_0xd550('0x3e')]));_0x255c0d['attributes']=_0x255c0d['attributes'][_0xd550('0x30')]?_0x255c0d[_0xd550('0x2f')]:_0x1e03c4[_0xd550('0x2e')];if(_0x23868e[_0xd550('0x2a')]['includeAll']){_0x255c0d[_0xd550('0x39')]=[{'all':!![]}];}_0x255c0d=_['merge']({},_0x255c0d,_0x23868e['options']);return db[_0xd550('0x25')][_0xd550('0x3f')](_0x255c0d)[_0xd550('0x1e')](handleEntityNotFound(_0x276110,null))['then'](respondWithResult(_0x276110,null))[_0xd550('0x3c')](handleError(_0x276110,null));};exports['create']=function(_0x32c12c,_0x2c2cf1){return db[_0xd550('0x25')][_0xd550('0x40')](_0x32c12c[_0xd550('0x41')],{})[_0xd550('0x1e')](respondWithResult(_0x2c2cf1,0xc9))[_0xd550('0x3c')](handleError(_0x2c2cf1,null));};exports['update']=function(_0x2366e5,_0x363faf){if(_0x2366e5[_0xd550('0x41')]['id']){delete _0x2366e5[_0xd550('0x41')]['id'];}return db[_0xd550('0x25')][_0xd550('0x3f')]({'where':{'id':_0x2366e5['params']['id']}})[_0xd550('0x1e')](handleEntityNotFound(_0x363faf,null))[_0xd550('0x1e')](saveUpdates(_0x2366e5['body'],null))[_0xd550('0x1e')](respondWithResult(_0x363faf,null))[_0xd550('0x3c')](handleError(_0x363faf,null));};exports['destroy']=function(_0x1c6432,_0x5c9584){return db[_0xd550('0x25')][_0xd550('0x3f')]({'where':{'id':_0x1c6432[_0xd550('0x42')]['id']}})[_0xd550('0x1e')](handleEntityNotFound(_0x5c9584,null))[_0xd550('0x1e')](removeEntity(_0x5c9584,null))[_0xd550('0x3c')](handleError(_0x5c9584,null));};exports['describe']=function(_0x555556,_0x349cf6){return db[_0xd550('0x25')]['describe']()[_0xd550('0x1e')](respondWithResult(_0x349cf6,null))[_0xd550('0x3c')](handleError(_0x349cf6,null));}; \ No newline at end of file +var _0xd207=['model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceDialReport','findAll','rows','catch','show','fields','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','error','stack','name','rawAttributes','key'];(function(_0x18b890,_0x216f8b){var _0x4d2ebb=function(_0x5870fa){while(--_0x5870fa){_0x18b890['push'](_0x18b890['shift']());}};_0x4d2ebb(++_0x216f8b);}(_0xd207,0x6d));var _0x7d20=function(_0x5a4633,_0xb8ff54){_0x5a4633=_0x5a4633-0x0;var _0x2c6173=_0xd207[_0x5a4633];return _0x2c6173;};'use strict';var emlformat=require(_0x7d20('0x0'));var rimraf=require(_0x7d20('0x1'));var zipdir=require(_0x7d20('0x2'));var jsonpatch=require(_0x7d20('0x3'));var rp=require('request-promise');var moment=require(_0x7d20('0x4'));var BPromise=require(_0x7d20('0x5'));var Mustache=require(_0x7d20('0x6'));var util=require(_0x7d20('0x7'));var path=require(_0x7d20('0x8'));var sox=require(_0x7d20('0x9'));var csv=require(_0x7d20('0xa'));var ejs=require(_0x7d20('0xb'));var fs=require('fs');var fs_extra=require(_0x7d20('0xc'));var _=require(_0x7d20('0xd'));var squel=require(_0x7d20('0xe'));var crypto=require(_0x7d20('0xf'));var jsforce=require(_0x7d20('0x10'));var deskjs=require(_0x7d20('0x11'));var toCsv=require(_0x7d20('0xa'));var querystring=require(_0x7d20('0x12'));var Papa=require(_0x7d20('0x13'));var Redis=require('ioredis');var authService=require(_0x7d20('0x14'));var qs=require(_0x7d20('0x15'));var as=require(_0x7d20('0x16'));var hardwareService=require(_0x7d20('0x17'));var logger=require(_0x7d20('0x18'))(_0x7d20('0x19'));var utils=require(_0x7d20('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x7d20('0x1b'));var db=require(_0x7d20('0x1c'))['db'];function respondWithStatusCode(_0x5f36c5,_0x1456f1){_0x1456f1=_0x1456f1||0xcc;return function(_0xd2dad){if(_0xd2dad){return _0x5f36c5[_0x7d20('0x1d')](_0x1456f1);}return _0x5f36c5[_0x7d20('0x1e')](_0x1456f1)[_0x7d20('0x1f')]();};}function respondWithResult(_0x1ec2ea,_0x108c61){_0x108c61=_0x108c61||0xc8;return function(_0x5299e3){if(_0x5299e3){return _0x1ec2ea[_0x7d20('0x1e')](_0x108c61)[_0x7d20('0x20')](_0x5299e3);}};}function respondWithFilteredResult(_0x75b5ee,_0x28a69f){return function(_0xc0b142){if(_0xc0b142){var _0x5aacf3=typeof _0x28a69f[_0x7d20('0x21')]==='undefined'&&typeof _0x28a69f[_0x7d20('0x22')]===_0x7d20('0x23');var _0xda0e85=_0xc0b142[_0x7d20('0x24')];var _0x40560f=_0x5aacf3?0x0:_0x28a69f[_0x7d20('0x21')];var _0x3898b9=_0x5aacf3?_0xc0b142[_0x7d20('0x24')]:_0x28a69f['offset']+_0x28a69f['limit'];var _0x309356;if(_0x3898b9>=_0xda0e85){_0x3898b9=_0xda0e85;_0x309356=0xc8;}else{_0x309356=0xce;}_0x75b5ee[_0x7d20('0x1e')](_0x309356);return _0x75b5ee[_0x7d20('0x25')]('Content-Range',_0x40560f+'-'+_0x3898b9+'/'+_0xda0e85)[_0x7d20('0x20')](_0xc0b142);}return null;};}function patchUpdates(_0x48eae8){return function(_0x40895a){try{jsonpatch[_0x7d20('0x26')](_0x40895a,_0x48eae8,!![]);}catch(_0x2beaa1){return BPromise[_0x7d20('0x27')](_0x2beaa1);}return _0x40895a['save']();};}function saveUpdates(_0x383096,_0x508d90){return function(_0x2fd221){if(_0x2fd221){return _0x2fd221['update'](_0x383096)[_0x7d20('0x28')](function(_0xf523ff){return _0xf523ff;});}return null;};}function removeEntity(_0x369b19,_0x4b892c){return function(_0x1487fa){if(_0x1487fa){return _0x1487fa[_0x7d20('0x29')]()[_0x7d20('0x28')](function(){_0x369b19[_0x7d20('0x1e')](0xcc)[_0x7d20('0x1f')]();});}};}function handleEntityNotFound(_0x1d2d94,_0x4e7335){return function(_0x2c43cb){if(!_0x2c43cb){_0x1d2d94[_0x7d20('0x1d')](0x194);}return _0x2c43cb;};}function handleError(_0x50a74d,_0x2e451f){_0x2e451f=_0x2e451f||0x1f4;return function(_0x37a101){logger[_0x7d20('0x2a')](_0x37a101[_0x7d20('0x2b')]);if(_0x37a101[_0x7d20('0x2c')]){delete _0x37a101[_0x7d20('0x2c')];}_0x50a74d[_0x7d20('0x1e')](_0x2e451f)['send'](_0x37a101);};}exports['index']=function(_0x419ca3,_0x945dfd){var _0xfda16a={},_0x37661f={},_0x36f645={'count':0x0,'rows':[]};var _0x1c3d79=_['map'](db['VoiceDialReport'][_0x7d20('0x2d')],function(_0x277c66){return{'name':_0x277c66['fieldName'],'type':_0x277c66['type'][_0x7d20('0x2e')]};});_0x37661f[_0x7d20('0x2f')]=_[_0x7d20('0x30')](_0x1c3d79,'name');_0x37661f[_0x7d20('0x31')]=_[_0x7d20('0x32')](_0x419ca3['query']);_0x37661f[_0x7d20('0x33')]=_[_0x7d20('0x34')](_0x37661f[_0x7d20('0x2f')],_0x37661f[_0x7d20('0x31')]);_0xfda16a[_0x7d20('0x35')]=_[_0x7d20('0x34')](_0x37661f[_0x7d20('0x2f')],qs['fields'](_0x419ca3[_0x7d20('0x31')]['fields']));_0xfda16a[_0x7d20('0x35')]=_0xfda16a[_0x7d20('0x35')][_0x7d20('0x36')]?_0xfda16a[_0x7d20('0x35')]:_0x37661f[_0x7d20('0x2f')];if(!_0x419ca3[_0x7d20('0x31')][_0x7d20('0x37')](_0x7d20('0x38'))){_0xfda16a['limit']=qs[_0x7d20('0x22')](_0x419ca3[_0x7d20('0x31')][_0x7d20('0x22')]);_0xfda16a[_0x7d20('0x21')]=qs[_0x7d20('0x21')](_0x419ca3[_0x7d20('0x31')]['offset']);}_0xfda16a[_0x7d20('0x39')]=qs[_0x7d20('0x3a')](_0x419ca3[_0x7d20('0x31')]['sort']);_0xfda16a[_0x7d20('0x3b')]=qs[_0x7d20('0x33')](_[_0x7d20('0x3c')](_0x419ca3[_0x7d20('0x31')],_0x37661f[_0x7d20('0x33')]),_0x1c3d79);if(_0x419ca3[_0x7d20('0x31')][_0x7d20('0x3d')]){_0xfda16a[_0x7d20('0x3b')]=_[_0x7d20('0x3e')](_0xfda16a[_0x7d20('0x3b')],{'$or':_[_0x7d20('0x30')](_0x1c3d79,function(_0x54d2b9){if(_0x54d2b9[_0x7d20('0x3f')]!==_0x7d20('0x40')){var _0x9250c2={};_0x9250c2[_0x54d2b9[_0x7d20('0x2c')]]={'$like':'%'+_0x419ca3[_0x7d20('0x31')]['filter']+'%'};return _0x9250c2;}})});}_0xfda16a=_['merge']({},_0xfda16a,_0x419ca3[_0x7d20('0x41')]);var _0x1cdb81={'where':_0xfda16a[_0x7d20('0x3b')]};return db[_0x7d20('0x42')][_0x7d20('0x24')](_0x1cdb81)[_0x7d20('0x28')](function(_0x3dbeca){_0x36f645[_0x7d20('0x24')]=_0x3dbeca;if(_0x419ca3[_0x7d20('0x31')]['includeAll']){_0xfda16a['include']=[{'all':!![]}];}return db[_0x7d20('0x42')][_0x7d20('0x43')](_0xfda16a);})[_0x7d20('0x28')](function(_0x1a776d){_0x36f645[_0x7d20('0x44')]=_0x1a776d;return _0x36f645;})['then'](respondWithFilteredResult(_0x945dfd,_0xfda16a))[_0x7d20('0x45')](handleError(_0x945dfd,null));};exports[_0x7d20('0x46')]=function(_0x3b3528,_0x1226d3){var _0x34c684={'raw':!![],'where':{'id':_0x3b3528['params']['id']}},_0x32c193={};_0x32c193['model']=_['keys'](db[_0x7d20('0x42')][_0x7d20('0x2d')]);_0x32c193[_0x7d20('0x31')]=_['keys'](_0x3b3528[_0x7d20('0x31')]);_0x32c193[_0x7d20('0x33')]=_['intersection'](_0x32c193[_0x7d20('0x2f')],_0x32c193[_0x7d20('0x31')]);_0x34c684[_0x7d20('0x35')]=_['intersection'](_0x32c193[_0x7d20('0x2f')],qs[_0x7d20('0x47')](_0x3b3528['query']['fields']));_0x34c684[_0x7d20('0x35')]=_0x34c684['attributes'][_0x7d20('0x36')]?_0x34c684['attributes']:_0x32c193['model'];if(_0x3b3528['query']['includeAll']){_0x34c684[_0x7d20('0x48')]=[{'all':!![]}];}_0x34c684=_[_0x7d20('0x3e')]({},_0x34c684,_0x3b3528[_0x7d20('0x41')]);return db[_0x7d20('0x42')]['find'](_0x34c684)[_0x7d20('0x28')](handleEntityNotFound(_0x1226d3,null))[_0x7d20('0x28')](respondWithResult(_0x1226d3,null))['catch'](handleError(_0x1226d3,null));};exports[_0x7d20('0x49')]=function(_0x2874fd,_0x2a3d6f){return db[_0x7d20('0x42')]['create'](_0x2874fd[_0x7d20('0x4a')],{})[_0x7d20('0x28')](respondWithResult(_0x2a3d6f,0xc9))[_0x7d20('0x45')](handleError(_0x2a3d6f,null));};exports['update']=function(_0x405c1c,_0x246eca){if(_0x405c1c[_0x7d20('0x4a')]['id']){delete _0x405c1c[_0x7d20('0x4a')]['id'];}return db[_0x7d20('0x42')]['find']({'where':{'id':_0x405c1c['params']['id']}})[_0x7d20('0x28')](handleEntityNotFound(_0x246eca,null))['then'](saveUpdates(_0x405c1c['body'],null))[_0x7d20('0x28')](respondWithResult(_0x246eca,null))[_0x7d20('0x45')](handleError(_0x246eca,null));};exports[_0x7d20('0x29')]=function(_0x14571c,_0x1305ae){return db[_0x7d20('0x42')][_0x7d20('0x4b')]({'where':{'id':_0x14571c[_0x7d20('0x4c')]['id']}})[_0x7d20('0x28')](handleEntityNotFound(_0x1305ae,null))[_0x7d20('0x28')](removeEntity(_0x1305ae,null))[_0x7d20('0x45')](handleError(_0x1305ae,null));};exports[_0x7d20('0x4d')]=function(_0x5a4b25,_0x168017){return db[_0x7d20('0x42')]['describe']()[_0x7d20('0x28')](respondWithResult(_0x168017,null))['catch'](handleError(_0x168017,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index b8169d9..4bc5801 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 _0xdb26=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial'];(function(_0x4b3474,_0xf900bb){var _0x4a6327=function(_0x1d5e99){while(--_0x1d5e99){_0x4b3474['push'](_0x4b3474['shift']());}};_0x4a6327(++_0xf900bb);}(_0xdb26,0xb7));var _0x6db2=function(_0x40b09f,_0x161f4f){_0x40b09f=_0x40b09f-0x0;var _0x3dbee2=_0xdb26[_0x40b09f];return _0x3dbee2;};'use strict';var _=require(_0x6db2('0x0'));var util=require('util');var logger=require(_0x6db2('0x1'))(_0x6db2('0x2'));var moment=require(_0x6db2('0x3'));var BPromise=require(_0x6db2('0x4'));var rp=require(_0x6db2('0x5'));var fs=require('fs');var path=require(_0x6db2('0x6'));var rimraf=require(_0x6db2('0x7'));var config=require(_0x6db2('0x8'));var attributes=require(_0x6db2('0x9'));module['exports']=function(_0x57fcee,_0x592245){return _0x57fcee[_0x6db2('0xa')](_0x6db2('0xb'),attributes,{'tableName':_0x6db2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6db2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7fd=['../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','moment','request-promise','path'];(function(_0x5161fc,_0x37c5f6){var _0x38490b=function(_0x49ebd8){while(--_0x49ebd8){_0x5161fc['push'](_0x5161fc['shift']());}};_0x38490b(++_0x37c5f6);}(_0xf7fd,0xe2));var _0xdf7f=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xf7fd[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xdf7f('0x0'));var util=require('util');var logger=require(_0xdf7f('0x1'))('api');var moment=require(_0xdf7f('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf7f('0x3'));var fs=require('fs');var path=require(_0xdf7f('0x4'));var rimraf=require('rimraf');var config=require(_0xdf7f('0x5'));var attributes=require(_0xdf7f('0x6'));module[_0xdf7f('0x7')]=function(_0x33e8f5,_0x1e3955){return _0x33e8f5['define'](_0xdf7f('0x8'),attributes,{'tableName':_0xdf7f('0x9'),'paranoid':![],'indexes':[{'fields':[_0xdf7f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 1e3c3f1..0618fdc 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 _0x8491=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','update','attributes','limit','UpdateVoiceDialReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x460205,_0x525d49){var _0x25c99e=function(_0x31738d){while(--_0x31738d){_0x460205['push'](_0x460205['shift']());}};_0x25c99e(++_0x525d49);}(_0x8491,0xcb));var _0x1849=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x8491[_0x24f31b];return _0x488401;};'use strict';var _=require('lodash');var util=require(_0x1849('0x0'));var moment=require(_0x1849('0x1'));var BPromise=require(_0x1849('0x2'));var rs=require(_0x1849('0x3'));var fs=require('fs');var Redis=require(_0x1849('0x4'));var db=require(_0x1849('0x5'))['db'];var utils=require(_0x1849('0x6'));var logger=require(_0x1849('0x7'))(_0x1849('0x8'));var config=require('../../config/environment');var jayson=require(_0x1849('0x9'));var client=jayson[_0x1849('0xa')][_0x1849('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c876c,_0x3a641e,_0x4a98a7){return new BPromise(function(_0x5633a1,_0x3b85ca){return client[_0x1849('0xc')](_0x4c876c,_0x4a98a7)[_0x1849('0xd')](function(_0x25ec90){logger[_0x1849('0xe')](_0x1849('0xf'),_0x3a641e,'request\x20sent');logger[_0x1849('0x10')](_0x1849('0x11'),_0x3a641e,_0x1849('0x12'),JSON[_0x1849('0x13')](_0x25ec90));if(_0x25ec90[_0x1849('0x14')]){if(_0x25ec90[_0x1849('0x14')][_0x1849('0x15')]===0x1f4){logger['error'](_0x1849('0xf'),_0x3a641e,_0x25ec90[_0x1849('0x14')][_0x1849('0x16')]);return _0x3b85ca(_0x25ec90[_0x1849('0x14')][_0x1849('0x16')]);}logger[_0x1849('0x14')](_0x1849('0xf'),_0x3a641e,_0x25ec90[_0x1849('0x14')]['message']);return _0x5633a1(_0x25ec90[_0x1849('0x14')][_0x1849('0x16')]);}else{logger[_0x1849('0xe')](_0x1849('0xf'),_0x3a641e,_0x1849('0x12'));_0x5633a1(_0x25ec90[_0x1849('0x17')][_0x1849('0x16')]);}})[_0x1849('0x18')](function(_0x39e13d){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x3a641e,_0x39e13d);_0x3b85ca(_0x39e13d);});});}exports[_0x1849('0x19')]=function(_0x24dba7){var _0x35ed16=this;return new Promise(function(_0xf253a3,_0x4f2f7a){return db[_0x1849('0x1a')][_0x1849('0x1b')](_0x24dba7[_0x1849('0x1c')],{'raw':_0x24dba7[_0x1849('0x1d')]?_0x24dba7[_0x1849('0x1d')][_0x1849('0x1e')]===undefined?!![]:![]:!![]})[_0x1849('0xd')](function(_0x96a360){logger[_0x1849('0xe')](_0x1849('0x19'),_0x24dba7);logger[_0x1849('0x10')](_0x1849('0x19'),_0x24dba7,JSON['stringify'](_0x96a360));_0xf253a3(_0x96a360);})[_0x1849('0x18')](function(_0x143adc){logger[_0x1849('0x14')]('CreateVoiceDialReport',_0x143adc[_0x1849('0x16')],_0x24dba7);_0x4f2f7a(_0x35ed16['error'](0x1f4,_0x143adc['message']));});});};exports['UpdateVoiceDialReport']=function(_0x31f8a1){var _0xa7c6eb=this;return new Promise(function(_0x7b285b,_0x4aa360){return db[_0x1849('0x1a')][_0x1849('0x1f')](_0x31f8a1[_0x1849('0x1c')],{'raw':_0x31f8a1[_0x1849('0x1d')]?_0x31f8a1[_0x1849('0x1d')][_0x1849('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31f8a1[_0x1849('0x1d')]?_0x31f8a1[_0x1849('0x1d')]['where']||null:null,'attributes':_0x31f8a1[_0x1849('0x1d')]?_0x31f8a1[_0x1849('0x1d')][_0x1849('0x20')]||null:null,'limit':_0x31f8a1[_0x1849('0x1d')]?_0x31f8a1['options'][_0x1849('0x21')]||null:null})['then'](function(_0x1a0664){logger[_0x1849('0xe')]('UpdateVoiceDialReport',_0x31f8a1);logger[_0x1849('0x10')](_0x1849('0x22'),_0x31f8a1,JSON[_0x1849('0x13')](_0x1a0664));_0x7b285b(_0x1a0664);})['catch'](function(_0x37ff50){logger['error']('UpdateVoiceDialReport',_0x37ff50[_0x1849('0x16')],_0x31f8a1);_0x4aa360(_0xa7c6eb[_0x1849('0x14')](0x1f4,_0x37ff50[_0x1849('0x16')]));});});}; \ No newline at end of file +var _0x5d49=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','VoiceDialReport','update','where','attributes','UpdateVoiceDialReport'];(function(_0x3b9bb5,_0x2e7fd7){var _0x4a5343=function(_0x28976f){while(--_0x28976f){_0x3b9bb5['push'](_0x3b9bb5['shift']());}};_0x4a5343(++_0x2e7fd7);}(_0x5d49,0x1e0));var _0x95d4=function(_0x3242f1,_0x32eaf8){_0x3242f1=_0x3242f1-0x0;var _0xd4be32=_0x5d49[_0x3242f1];return _0xd4be32;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x95d4('0x0'));var BPromise=require(_0x95d4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95d4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x95d4('0x3'));var logger=require(_0x95d4('0x4'))(_0x95d4('0x5'));var config=require(_0x95d4('0x6'));var jayson=require(_0x95d4('0x7'));var client=jayson[_0x95d4('0x8')][_0x95d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26867e,_0x359088,_0xd5d769){return new BPromise(function(_0x17a78a,_0x2894dd){return client[_0x95d4('0xa')](_0x26867e,_0xd5d769)[_0x95d4('0xb')](function(_0x1bb0e9){logger[_0x95d4('0xc')](_0x95d4('0xd'),_0x359088,_0x95d4('0xe'));logger[_0x95d4('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x359088,_0x95d4('0xe'),JSON[_0x95d4('0x10')](_0x1bb0e9));if(_0x1bb0e9[_0x95d4('0x11')]){if(_0x1bb0e9[_0x95d4('0x11')][_0x95d4('0x12')]===0x1f4){logger[_0x95d4('0x11')](_0x95d4('0xd'),_0x359088,_0x1bb0e9[_0x95d4('0x11')][_0x95d4('0x13')]);return _0x2894dd(_0x1bb0e9[_0x95d4('0x11')][_0x95d4('0x13')]);}logger[_0x95d4('0x11')](_0x95d4('0xd'),_0x359088,_0x1bb0e9['error']['message']);return _0x17a78a(_0x1bb0e9[_0x95d4('0x11')][_0x95d4('0x13')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x359088,_0x95d4('0xe'));_0x17a78a(_0x1bb0e9[_0x95d4('0x14')][_0x95d4('0x13')]);}})[_0x95d4('0x15')](function(_0x292e51){logger[_0x95d4('0x11')](_0x95d4('0xd'),_0x359088,_0x292e51);_0x2894dd(_0x292e51);});});}exports[_0x95d4('0x16')]=function(_0x3740f6){var _0x4f4a51=this;return new Promise(function(_0x4eeccd,_0xf0f4d9){return db['VoiceDialReport'][_0x95d4('0x17')](_0x3740f6[_0x95d4('0x18')],{'raw':_0x3740f6[_0x95d4('0x19')]?_0x3740f6[_0x95d4('0x19')][_0x95d4('0x1a')]===undefined?!![]:![]:!![]})[_0x95d4('0xb')](function(_0x469bc3){logger['info']('CreateVoiceDialReport',_0x3740f6);logger[_0x95d4('0xf')]('CreateVoiceDialReport',_0x3740f6,JSON[_0x95d4('0x10')](_0x469bc3));_0x4eeccd(_0x469bc3);})[_0x95d4('0x15')](function(_0x392ff9){logger[_0x95d4('0x11')](_0x95d4('0x16'),_0x392ff9[_0x95d4('0x13')],_0x3740f6);_0xf0f4d9(_0x4f4a51[_0x95d4('0x11')](0x1f4,_0x392ff9['message']));});});};exports['UpdateVoiceDialReport']=function(_0x8e19cb){var _0x3447ae=this;return new Promise(function(_0x35dc8d,_0x17d66c){return db[_0x95d4('0x1b')][_0x95d4('0x1c')](_0x8e19cb[_0x95d4('0x18')],{'raw':_0x8e19cb[_0x95d4('0x19')]?_0x8e19cb[_0x95d4('0x19')][_0x95d4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8e19cb[_0x95d4('0x19')]?_0x8e19cb[_0x95d4('0x19')][_0x95d4('0x1d')]||null:null,'attributes':_0x8e19cb[_0x95d4('0x19')]?_0x8e19cb[_0x95d4('0x19')][_0x95d4('0x1e')]||null:null,'limit':_0x8e19cb[_0x95d4('0x19')]?_0x8e19cb[_0x95d4('0x19')]['limit']||null:null})[_0x95d4('0xb')](function(_0x5b1b14){logger['info'](_0x95d4('0x1f'),_0x8e19cb);logger[_0x95d4('0xf')]('UpdateVoiceDialReport',_0x8e19cb,JSON['stringify'](_0x5b1b14));_0x35dc8d(_0x5b1b14);})['catch'](function(_0x21633f){logger['error'](_0x95d4('0x1f'),_0x21633f[_0x95d4('0x13')],_0x8e19cb);_0x17d66c(_0x3447ae[_0x95d4('0x11')](0x1f4,_0x21633f[_0x95d4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 55a9218..7239da5 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 _0xcc50=['show','create','post','addApplications','put','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id'];(function(_0x8e6852,_0x52454){var _0x2522bc=function(_0x4834c5){while(--_0x4834c5){_0x8e6852['push'](_0x8e6852['shift']());}};_0x2522bc(++_0x52454);}(_0xcc50,0x11e));var _0x0cc5=function(_0x4c39f5,_0x109684){_0x4c39f5=_0x4c39f5-0x0;var _0x1db24f=_0xcc50[_0x4c39f5];return _0x1db24f;};'use strict';var multer=require(_0x0cc5('0x0'));var util=require(_0x0cc5('0x1'));var path=require('path');var timeout=require(_0x0cc5('0x2'));var express=require(_0x0cc5('0x3'));var router=express[_0x0cc5('0x4')]();var fs_extra=require(_0x0cc5('0x5'));var auth=require(_0x0cc5('0x6'));var interaction=require(_0x0cc5('0x7'));var config=require(_0x0cc5('0x8'));var controller=require(_0x0cc5('0x9'));router['get']('/',auth[_0x0cc5('0xa')](),controller[_0x0cc5('0xb')]);router[_0x0cc5('0xc')](_0x0cc5('0xd'),auth[_0x0cc5('0xa')](),controller[_0x0cc5('0xe')]);router['post']('/',auth[_0x0cc5('0xa')](),controller[_0x0cc5('0xf')]);router[_0x0cc5('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0cc5('0x11')]);router[_0x0cc5('0x12')](_0x0cc5('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0cc5('0xd'),auth['isAuthenticated'](),controller[_0x0cc5('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4f6a=['destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','./voiceExtension.controller','index','/:id','isAuthenticated','show','post','create','/:id/applications','update','delete'];(function(_0x3980dc,_0x58fe92){var _0x40c85a=function(_0x5187cc){while(--_0x5187cc){_0x3980dc['push'](_0x3980dc['shift']());}};_0x40c85a(++_0x58fe92);}(_0x4f6a,0x1f2));var _0xa4f6=function(_0x5285a2,_0x1949c0){_0x5285a2=_0x5285a2-0x0;var _0x4222dc=_0x4f6a[_0x5285a2];return _0x4222dc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa4f6('0x0'));var express=require(_0xa4f6('0x1'));var router=express['Router']();var fs_extra=require(_0xa4f6('0x2'));var auth=require(_0xa4f6('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa4f6('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xa4f6('0x5')]);router['get'](_0xa4f6('0x6'),auth[_0xa4f6('0x7')](),controller[_0xa4f6('0x8')]);router[_0xa4f6('0x9')]('/',auth['isAuthenticated'](),controller[_0xa4f6('0xa')]);router[_0xa4f6('0x9')](_0xa4f6('0xb'),auth[_0xa4f6('0x7')](),controller['addApplications']);router['put'](_0xa4f6('0x6'),auth['isAuthenticated'](),controller[_0xa4f6('0xc')]);router[_0xa4f6('0xd')]('/:id',auth[_0xa4f6('0x7')](),controller[_0xa4f6('0xe')]);module[_0xa4f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 9c488a9..6a86c22 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 _0xb7e7=['BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','STRING','NoOp','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0x134867,_0x5e6aed){var _0x2c9ea5=function(_0x171f7a){while(--_0x171f7a){_0x134867['push'](_0x134867['shift']());}};_0x2c9ea5(++_0x5e6aed);}(_0xb7e7,0x121));var _0x7b7e=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xb7e7[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'context':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x2')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x7b7e('0x3'),_0x7b7e('0x4'),_0x7b7e('0x5'),'inbound-fax',_0x7b7e('0x6'),_0x7b7e('0x7'),_0x7b7e('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x7b7e('0x1')]},'interval':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x9')},'IntervalId':{'type':Sequelize[_0x7b7e('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x7b7e('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7b7e('0xa')]},'recordingFormat':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0xc')},'answer':{'type':Sequelize[_0x7b7e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7b7e('0xd')],'get':function(){return this[_0x7b7e('0xe')]('exten');}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x43244c,_0xa2a77f){var _0x34babb=function(_0x4f7818){while(--_0x4f7818){_0x43244c['push'](_0x43244c['shift']());}};_0x34babb(++_0xa2a77f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 0b5a249..76e706b 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 _0xf0ea=['socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','type','UserProfileResource','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','exten','concat','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','internal','UserProfileSection','userProfileId','autoAssociation','update','context','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x33bb6f,_0x8516dd){var _0x29f99a=function(_0x1412f6){while(--_0x1412f6){_0x33bb6f['push'](_0x33bb6f['shift']());}};_0x29f99a(++_0x8516dd);}(_0xf0ea,0x17f));var _0xaf0e=function(_0x5d6754,_0x1acdc1){_0x5d6754=_0x5d6754-0x0;var _0x469103=_0xf0ea[_0x5d6754];return _0x469103;};'use strict';var _=require(_0xaf0e('0x0'));var Redis=require(_0xaf0e('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xaf0e('0x2'))(_0xaf0e('0x3'));var config=require(_0xaf0e('0x4'));var db=require(_0xaf0e('0x5'))['db'];config[_0xaf0e('0x6')]=_[_0xaf0e('0x7')](config['redis'],{'host':_0xaf0e('0x8'),'port':0x18eb});var socket=require(_0xaf0e('0x9'))(new Redis(config[_0xaf0e('0x6')]));require('./voiceExtension.socket')[_0xaf0e('0xa')](socket);function respondWithStatusCode(_0x5f1644,_0x37fbd3){_0x37fbd3=_0x37fbd3||0xcc;return function(_0x243c9d){if(_0x243c9d){return _0x5f1644[_0xaf0e('0xb')](_0x37fbd3);}return _0x5f1644[_0xaf0e('0xc')](_0x37fbd3)[_0xaf0e('0xd')]();};}function respondWithResult(_0x4f3434,_0xc03e49){_0xc03e49=_0xc03e49||0xc8;return function(_0x2cdae0){if(_0x2cdae0){return _0x4f3434[_0xaf0e('0xc')](_0xc03e49)['json'](_0x2cdae0);}};}function respondWithFilteredResult(_0x44950a,_0x2e78d8){return function(_0x6c1171){if(_0x6c1171){var _0x42e329=typeof _0x2e78d8[_0xaf0e('0xe')]===_0xaf0e('0xf')&&typeof _0x2e78d8[_0xaf0e('0x10')]===_0xaf0e('0xf');var _0x3c629d=_0x6c1171['count'];var _0x28725b=_0x42e329?0x0:_0x2e78d8[_0xaf0e('0xe')];var _0x11a6ac=_0x42e329?_0x6c1171[_0xaf0e('0x11')]:_0x2e78d8[_0xaf0e('0xe')]+_0x2e78d8[_0xaf0e('0x10')];var _0x44a780;if(_0x11a6ac>=_0x3c629d){_0x11a6ac=_0x3c629d;_0x44a780=0xc8;}else{_0x44a780=0xce;}_0x44950a[_0xaf0e('0xc')](_0x44a780);return _0x44950a[_0xaf0e('0x12')](_0xaf0e('0x13'),_0x28725b+'-'+_0x11a6ac+'/'+_0x3c629d)[_0xaf0e('0x14')](_0x6c1171);}return null;};}function removeEntity(_0x1ce7a7){return function(_0x4efc62){if(_0x4efc62){return _0x4efc62[_0xaf0e('0x15')]()[_0xaf0e('0x16')](function(){var _0x546f92=_0x4efc62[_0xaf0e('0x17')]({'plain':!![]});var _0x59d968=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0xaf0e('0x18'),'value':_0xaf0e('0x19'),'ignore':![]},{'name':_0xaf0e('0x1a'),'value':'internal','ignore':![]}];var _0x244612=_(_0x59d968)[_0xaf0e('0x1b')](_0xaf0e('0x1c'))[_0xaf0e('0x1d')](_0xaf0e('0x1e'))[_0xaf0e('0x1e')]();if(_[_0xaf0e('0x1f')](_0x244612,_0x546f92[_0xaf0e('0x20')])){return;}var _0x40e7c3=_['find'](_0x59d968,['value',_0x546f92[_0xaf0e('0x20')]])['name'];return db[_0xaf0e('0x21')][_0xaf0e('0x15')]({'where':{'type':_0x40e7c3,'resourceId':_0x546f92['id']}})[_0xaf0e('0x16')](function(){return _0x4efc62;});})[_0xaf0e('0x16')](function(){_0x1ce7a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd14fce){return function(_0x5535c5){if(!_0x5535c5){_0xd14fce['sendStatus'](0x194);}return _0x5535c5;};}function handleError(_0x1323d2,_0x4439b7){_0x4439b7=_0x4439b7||0x1f4;return function(_0x44d502){logger[_0xaf0e('0x22')](_0x44d502[_0xaf0e('0x23')]);if(_0x44d502[_0xaf0e('0x24')]){delete _0x44d502[_0xaf0e('0x24')];}_0x1323d2[_0xaf0e('0xc')](_0x4439b7)[_0xaf0e('0x25')](_0x44d502);};}exports[_0xaf0e('0x26')]=function(_0x2d8e7d,_0x19d2bb){var _0x5e404e={},_0x1b8fba={},_0xd5f045={'count':0x0,'rows':[]};var _0x3a1d3a=_[_0xaf0e('0x1d')](db[_0xaf0e('0x27')][_0xaf0e('0x28')],function(_0x37cfec){return{'name':_0x37cfec[_0xaf0e('0x29')],'type':_0x37cfec[_0xaf0e('0x20')]['key']};});_0x1b8fba[_0xaf0e('0x2a')]=_[_0xaf0e('0x1d')](_0x3a1d3a,_0xaf0e('0x24'));_0x1b8fba[_0xaf0e('0x2b')]=_[_0xaf0e('0x2c')](_0x2d8e7d[_0xaf0e('0x2b')]);_0x1b8fba[_0xaf0e('0x2d')]=_[_0xaf0e('0x2e')](_0x1b8fba[_0xaf0e('0x2a')],_0x1b8fba['query']);_0x5e404e[_0xaf0e('0x2f')]=_[_0xaf0e('0x2e')](_0x1b8fba[_0xaf0e('0x2a')],qs[_0xaf0e('0x30')](_0x2d8e7d[_0xaf0e('0x2b')]['fields']));_0x5e404e[_0xaf0e('0x2f')]=_0x5e404e[_0xaf0e('0x2f')][_0xaf0e('0x31')]?_0x5e404e['attributes']:_0x1b8fba[_0xaf0e('0x2a')];if(!_0x2d8e7d[_0xaf0e('0x2b')][_0xaf0e('0x32')](_0xaf0e('0x33'))){_0x5e404e['limit']=qs[_0xaf0e('0x10')](_0x2d8e7d[_0xaf0e('0x2b')]['limit']);_0x5e404e[_0xaf0e('0xe')]=qs[_0xaf0e('0xe')](_0x2d8e7d[_0xaf0e('0x2b')][_0xaf0e('0xe')]);}_0x5e404e[_0xaf0e('0x34')]=qs[_0xaf0e('0x35')](_0x2d8e7d[_0xaf0e('0x2b')][_0xaf0e('0x35')]);_0x5e404e[_0xaf0e('0x36')]=qs[_0xaf0e('0x2d')](_[_0xaf0e('0x37')](_0x2d8e7d['query'],_0x1b8fba['filters']),_0x3a1d3a);if(_0x2d8e7d[_0xaf0e('0x2b')]['filter']){_0x5e404e[_0xaf0e('0x36')]=_[_0xaf0e('0x38')](_0x5e404e[_0xaf0e('0x36')],{'$or':_[_0xaf0e('0x1d')](_0x3a1d3a,function(_0x52f9da){if(_0x52f9da[_0xaf0e('0x20')]!==_0xaf0e('0x39')){var _0x440e2e={};_0x440e2e[_0x52f9da[_0xaf0e('0x24')]]={'$like':'%'+_0x2d8e7d[_0xaf0e('0x2b')][_0xaf0e('0x1b')]+'%'};return _0x440e2e;}})});}_0x5e404e=_[_0xaf0e('0x38')]({},_0x5e404e,_0x2d8e7d[_0xaf0e('0x3a')]);var _0x30cc6f={'where':_0x5e404e[_0xaf0e('0x36')]};return db['VoiceExtension']['count'](_0x30cc6f)[_0xaf0e('0x16')](function(_0x2a0032){_0xd5f045[_0xaf0e('0x11')]=_0x2a0032;if(_0x2d8e7d['query'][_0xaf0e('0x3b')]){_0x5e404e[_0xaf0e('0x3c')]=[{'all':!![]}];}return db[_0xaf0e('0x27')][_0xaf0e('0x3d')](_0x5e404e);})[_0xaf0e('0x16')](function(_0xfdfcb7){_0xd5f045[_0xaf0e('0x3e')]=_0xfdfcb7;return _0xd5f045;})[_0xaf0e('0x16')](respondWithFilteredResult(_0x19d2bb,_0x5e404e))[_0xaf0e('0x3f')](handleError(_0x19d2bb,null));};exports[_0xaf0e('0x40')]=function(_0x304587,_0x250bdd){var _0x46eee3={'raw':![],'where':{'id':_0x304587[_0xaf0e('0x41')]['id']}},_0x28eabc={};_0x28eabc['model']=_[_0xaf0e('0x2c')](db['VoiceExtension'][_0xaf0e('0x28')]);_0x28eabc[_0xaf0e('0x2b')]=_['keys'](_0x304587[_0xaf0e('0x2b')]);_0x28eabc[_0xaf0e('0x2d')]=_['intersection'](_0x28eabc[_0xaf0e('0x2a')],_0x28eabc['query']);_0x46eee3[_0xaf0e('0x2f')]=_[_0xaf0e('0x2e')](_0x28eabc[_0xaf0e('0x2a')],qs[_0xaf0e('0x30')](_0x304587['query'][_0xaf0e('0x30')]));_0x46eee3['attributes']=_0x46eee3[_0xaf0e('0x2f')]['length']?_0x46eee3[_0xaf0e('0x2f')]:_0x28eabc[_0xaf0e('0x2a')];if(_0x304587['query'][_0xaf0e('0x3b')]){_0x46eee3[_0xaf0e('0x3c')]=[{'all':!![]}];}_0x46eee3=_[_0xaf0e('0x38')]({},_0x46eee3,_0x304587['options']);return db[_0xaf0e('0x27')][_0xaf0e('0x42')](_0x46eee3)[_0xaf0e('0x16')](handleEntityNotFound(_0x250bdd,null))[_0xaf0e('0x16')](respondWithResult(_0x250bdd,null))[_0xaf0e('0x3f')](handleError(_0x250bdd,null));};exports[_0xaf0e('0x15')]=function(_0x21bc83,_0x1e2bf2){return db[_0xaf0e('0x27')][_0xaf0e('0x42')]({'where':{'id':_0x21bc83[_0xaf0e('0x41')]['id']}})[_0xaf0e('0x16')](handleEntityNotFound(_0x1e2bf2,null))['then'](removeEntity(_0x1e2bf2,null))[_0xaf0e('0x3f')](handleError(_0x1e2bf2,null));};exports['create']=function(_0x5f11b6,_0x464d0e){if(_0x5f11b6[_0xaf0e('0x43')]['type']===_0xaf0e('0x19')&&!_['startsWith'](_0x5f11b6[_0xaf0e('0x43')][_0xaf0e('0x44')],'_')){_0x5f11b6[_0xaf0e('0x43')]['exten']='_'[_0xaf0e('0x45')](_0x5f11b6[_0xaf0e('0x43')][_0xaf0e('0x44')]);}return db['VoiceExtension'][_0xaf0e('0x46')](_0x5f11b6['body'],{'raw':![]})[_0xaf0e('0x16')](function(_0x5dcc88){var _0xc2f9e9=_0x5f11b6['user'][_0xaf0e('0x17')]({'plain':!![]});if(!_0xc2f9e9)throw new Error(_0xaf0e('0x47'));if(_0xc2f9e9[_0xaf0e('0x48')]===_0xaf0e('0x49')){var _0x4356a1=_0x5dcc88[_0xaf0e('0x17')]({'plain':!![]});var _0x28759b=[{'name':'InboundRoutes','value':_0xaf0e('0x4a')},{'name':_0xaf0e('0x18'),'value':_0xaf0e('0x19')},{'name':_0xaf0e('0x1a'),'value':_0xaf0e('0x4b')}];var _0xca2cd0=_[_0xaf0e('0x42')](_0x28759b,[_0xaf0e('0x1e'),_0x4356a1['type']])['name'];return db[_0xaf0e('0x4c')]['find']({'where':{'name':_0xca2cd0,'userProfileId':_0xc2f9e9[_0xaf0e('0x4d')]},'raw':!![]})[_0xaf0e('0x16')](function(_0x222a74){if(_0x222a74&&_0x222a74[_0xaf0e('0x4e')]===0x0){return db['UserProfileResource'][_0xaf0e('0x46')]({'name':_0x4356a1[_0xaf0e('0x24')],'resourceId':_0x4356a1['id'],'type':_0x222a74[_0xaf0e('0x24')],'sectionId':_0x222a74['id']},{})['then'](function(){return _0x5dcc88;});}else{return _0x5dcc88;}})[_0xaf0e('0x3f')](function(_0x20a9c5){logger[_0xaf0e('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20a9c5);throw _0x20a9c5;});}return _0x5dcc88;})[_0xaf0e('0x16')](respondWithResult(_0x464d0e,0xc9))[_0xaf0e('0x3f')](handleError(_0x464d0e,null));};exports[_0xaf0e('0x4f')]=function(_0x462b78,_0x183a9a){if(_0x462b78['body']['id']){delete _0x462b78[_0xaf0e('0x43')]['id'];}return db[_0xaf0e('0x27')][_0xaf0e('0x42')]({'where':{'id':_0x462b78[_0xaf0e('0x41')]['id']}})[_0xaf0e('0x16')](handleEntityNotFound(_0x183a9a,null))[_0xaf0e('0x16')](function(_0x17a54a){if(_0x17a54a){return db[_0xaf0e('0x27')][_0xaf0e('0x4f')](_[_0xaf0e('0x37')](_0x462b78[_0xaf0e('0x43')],[_0xaf0e('0x44'),_0xaf0e('0x50'),'description',_0xaf0e('0x51'),'cutdigits',_0xaf0e('0x52'),_0xaf0e('0x53')]),{'where':{'context':_0x17a54a[_0xaf0e('0x50')],'exten':_0x17a54a['exten']},'individualHooks':!![]})[_0xaf0e('0x16')](function(_0x957f2d){return _0x957f2d;});}return null;})[_0xaf0e('0x16')](respondWithStatusCode(_0x183a9a,null))['catch'](handleError(_0x183a9a,null));};exports[_0xaf0e('0x54')]=function(_0x23e825,_0x5cd688){var _0x1aa198=_0x23e825[_0xaf0e('0x41')]['id'];var _0x3b0104=_0x23e825['body'];var _0x37d4e2=0xc8;var _0xfda654=null;return db[_0xaf0e('0x55')][_0xaf0e('0x56')]({'isolationLevel':db['sequelize'][_0xaf0e('0x57')][_0xaf0e('0x58')][_0xaf0e('0x59')]},function(_0x3c66ed){return db[_0xaf0e('0x27')][_0xaf0e('0x5a')]({'where':{'id':_0x1aa198},'transaction':_0x3c66ed})[_0xaf0e('0x16')](function(_0x2e67ea){if(_0x2e67ea){return db[_0xaf0e('0x27')][_0xaf0e('0x15')]({'where':{'VoiceExtensionId':_0x1aa198},'transaction':_0x3c66ed})[_0xaf0e('0x16')](function(){var _0x3ad28c=_[_0xaf0e('0x1d')](_0x3b0104,function(_0x4fc771){_0x4fc771[_0xaf0e('0x5b')]=_0x1aa198;_0x4fc771[_0xaf0e('0x5c')]=!![];return _0x4fc771;});return _0x2e67ea[_0xaf0e('0x5d')](_0x3ad28c);})['then'](function(_0x48adaf){return db['VoiceExtension'][_0xaf0e('0x5e')](_0x48adaf,{'transaction':_0x3c66ed});});}else{_0x37d4e2=0x194;_0xfda654=[];}});})[_0xaf0e('0x16')](function(){if(_0x37d4e2!==0x194){return db['VoiceExtension'][_0xaf0e('0x5f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1aa198},'order':_0xaf0e('0x60')})[_0xaf0e('0x16')](function(_0x518310){_0xfda654=_0x518310;});}})['catch'](function(_0x268237){_0x37d4e2=0x1f4;logger[_0xaf0e('0x22')](_0x268237[_0xaf0e('0x23')]);if(_0x268237[_0xaf0e('0x24')]){delete _0x268237['name'];}_0xfda654=_0x268237;})[_0xaf0e('0x61')](function(){if(_0xfda654===null){_0x5cd688[_0xaf0e('0xb')](_0x37d4e2);}else{if(_0x37d4e2===0x1f4){_0x5cd688[_0xaf0e('0xc')](_0x37d4e2)[_0xaf0e('0x25')](_0xfda654);}else{_0x5cd688[_0xaf0e('0xc')](_0x37d4e2)['json'](_0xfda654);}}});}; \ No newline at end of file +var _0x88fd=['then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','sendStatus','stack','index','VoiceExtension','rawAttributes','fieldName','key','query','intersection','model','fields','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll','catch','keys','options','params','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','context','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findOne','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy'];(function(_0x5bd4fc,_0x2f9cdf){var _0x4aa866=function(_0x5dc561){while(--_0x5dc561){_0x5bd4fc['push'](_0x5bd4fc['shift']());}};_0x4aa866(++_0x2f9cdf);}(_0x88fd,0x1b6));var _0xd88f=function(_0x3d1f75,_0x22e887){_0x3d1f75=_0x3d1f75-0x0;var _0x36b5d1=_0x88fd[_0x3d1f75];return _0x36b5d1;};'use strict';var _=require(_0xd88f('0x0'));var Redis=require(_0xd88f('0x1'));var qs=require(_0xd88f('0x2'));var logger=require(_0xd88f('0x3'))(_0xd88f('0x4'));var config=require(_0xd88f('0x5'));var db=require(_0xd88f('0x6'))['db'];config[_0xd88f('0x7')]=_[_0xd88f('0x8')](config[_0xd88f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xd88f('0x9'))(new Redis(config[_0xd88f('0x7')]));require(_0xd88f('0xa'))[_0xd88f('0xb')](socket);function respondWithStatusCode(_0x3932c1,_0x972f3d){_0x972f3d=_0x972f3d||0xcc;return function(_0x3ecd8f){if(_0x3ecd8f){return _0x3932c1['sendStatus'](_0x972f3d);}return _0x3932c1[_0xd88f('0xc')](_0x972f3d)[_0xd88f('0xd')]();};}function respondWithResult(_0x216fae,_0x18ae98){_0x18ae98=_0x18ae98||0xc8;return function(_0x244822){if(_0x244822){return _0x216fae['status'](_0x18ae98)[_0xd88f('0xe')](_0x244822);}};}function respondWithFilteredResult(_0x562be8,_0x500051){return function(_0x39dc90){if(_0x39dc90){var _0x2c6771=typeof _0x500051['offset']===_0xd88f('0xf')&&typeof _0x500051[_0xd88f('0x10')]==='undefined';var _0x3bc682=_0x39dc90['count'];var _0x5b1510=_0x2c6771?0x0:_0x500051['offset'];var _0x5e2ec6=_0x2c6771?_0x39dc90[_0xd88f('0x11')]:_0x500051[_0xd88f('0x12')]+_0x500051['limit'];var _0x115c88;if(_0x5e2ec6>=_0x3bc682){_0x5e2ec6=_0x3bc682;_0x115c88=0xc8;}else{_0x115c88=0xce;}_0x562be8['status'](_0x115c88);return _0x562be8[_0xd88f('0x13')](_0xd88f('0x14'),_0x5b1510+'-'+_0x5e2ec6+'/'+_0x3bc682)[_0xd88f('0xe')](_0x39dc90);}return null;};}function removeEntity(_0x10c84f){return function(_0x3cf624){if(_0x3cf624){return _0x3cf624[_0xd88f('0x15')]()[_0xd88f('0x16')](function(){var _0x4b8f52=_0x3cf624[_0xd88f('0x17')]({'plain':!![]});var _0x29a3c9=[{'name':_0xd88f('0x18'),'value':_0xd88f('0x19'),'ignore':![]},{'name':_0xd88f('0x1a'),'value':'outbound','ignore':![]},{'name':_0xd88f('0x1b'),'value':_0xd88f('0x1c'),'ignore':![]}];var _0x6dd838=_(_0x29a3c9)[_0xd88f('0x1d')](_0xd88f('0x1e'))[_0xd88f('0x1f')](_0xd88f('0x20'))[_0xd88f('0x20')]();if(_[_0xd88f('0x21')](_0x6dd838,_0x4b8f52[_0xd88f('0x22')])){return;}var _0x3527ba=_[_0xd88f('0x23')](_0x29a3c9,[_0xd88f('0x20'),_0x4b8f52['type']])[_0xd88f('0x24')];return db[_0xd88f('0x25')][_0xd88f('0x15')]({'where':{'type':_0x3527ba,'resourceId':_0x4b8f52['id']}})[_0xd88f('0x16')](function(){return _0x3cf624;});})['then'](function(){_0x10c84f[_0xd88f('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25504f){return function(_0x4ec074){if(!_0x4ec074){_0x25504f[_0xd88f('0x26')](0x194);}return _0x4ec074;};}function handleError(_0x3e1598,_0x3ef369){_0x3ef369=_0x3ef369||0x1f4;return function(_0xc77a23){logger['error'](_0xc77a23[_0xd88f('0x27')]);if(_0xc77a23[_0xd88f('0x24')]){delete _0xc77a23[_0xd88f('0x24')];}_0x3e1598[_0xd88f('0xc')](_0x3ef369)['send'](_0xc77a23);};}exports[_0xd88f('0x28')]=function(_0x29bbca,_0x3ee53b){var _0x4f0b9f={},_0x3a3fa6={},_0x545e46={'count':0x0,'rows':[]};var _0x41eafd=_[_0xd88f('0x1f')](db[_0xd88f('0x29')][_0xd88f('0x2a')],function(_0x403730){return{'name':_0x403730[_0xd88f('0x2b')],'type':_0x403730['type'][_0xd88f('0x2c')]};});_0x3a3fa6['model']=_[_0xd88f('0x1f')](_0x41eafd,_0xd88f('0x24'));_0x3a3fa6[_0xd88f('0x2d')]=_['keys'](_0x29bbca[_0xd88f('0x2d')]);_0x3a3fa6['filters']=_[_0xd88f('0x2e')](_0x3a3fa6[_0xd88f('0x2f')],_0x3a3fa6[_0xd88f('0x2d')]);_0x4f0b9f['attributes']=_[_0xd88f('0x2e')](_0x3a3fa6[_0xd88f('0x2f')],qs[_0xd88f('0x30')](_0x29bbca[_0xd88f('0x2d')]['fields']));_0x4f0b9f[_0xd88f('0x31')]=_0x4f0b9f[_0xd88f('0x31')][_0xd88f('0x32')]?_0x4f0b9f[_0xd88f('0x31')]:_0x3a3fa6[_0xd88f('0x2f')];if(!_0x29bbca[_0xd88f('0x2d')]['hasOwnProperty']('nolimit')){_0x4f0b9f[_0xd88f('0x10')]=qs[_0xd88f('0x10')](_0x29bbca[_0xd88f('0x2d')][_0xd88f('0x10')]);_0x4f0b9f[_0xd88f('0x12')]=qs['offset'](_0x29bbca[_0xd88f('0x2d')][_0xd88f('0x12')]);}_0x4f0b9f[_0xd88f('0x33')]=qs[_0xd88f('0x34')](_0x29bbca['query'][_0xd88f('0x34')]);_0x4f0b9f[_0xd88f('0x35')]=qs[_0xd88f('0x36')](_[_0xd88f('0x37')](_0x29bbca['query'],_0x3a3fa6[_0xd88f('0x36')]),_0x41eafd);if(_0x29bbca['query'][_0xd88f('0x1d')]){_0x4f0b9f[_0xd88f('0x35')]=_[_0xd88f('0x38')](_0x4f0b9f[_0xd88f('0x35')],{'$or':_[_0xd88f('0x1f')](_0x41eafd,function(_0x5a11ba){if(_0x5a11ba['type']!==_0xd88f('0x39')){var _0x18f2db={};_0x18f2db[_0x5a11ba[_0xd88f('0x24')]]={'$like':'%'+_0x29bbca[_0xd88f('0x2d')][_0xd88f('0x1d')]+'%'};return _0x18f2db;}})});}_0x4f0b9f=_['merge']({},_0x4f0b9f,_0x29bbca['options']);var _0x4ef0b2={'where':_0x4f0b9f['where']};return db[_0xd88f('0x29')][_0xd88f('0x11')](_0x4ef0b2)['then'](function(_0x3c76db){_0x545e46['count']=_0x3c76db;if(_0x29bbca[_0xd88f('0x2d')][_0xd88f('0x3a')]){_0x4f0b9f[_0xd88f('0x3b')]=[{'all':!![]}];}return db[_0xd88f('0x29')][_0xd88f('0x3c')](_0x4f0b9f);})['then'](function(_0x315951){_0x545e46['rows']=_0x315951;return _0x545e46;})[_0xd88f('0x16')](respondWithFilteredResult(_0x3ee53b,_0x4f0b9f))[_0xd88f('0x3d')](handleError(_0x3ee53b,null));};exports['show']=function(_0x2212aa,_0x5bc092){var _0x5e0816={'raw':![],'where':{'id':_0x2212aa['params']['id']}},_0x2ed9fc={};_0x2ed9fc[_0xd88f('0x2f')]=_[_0xd88f('0x3e')](db[_0xd88f('0x29')]['rawAttributes']);_0x2ed9fc[_0xd88f('0x2d')]=_['keys'](_0x2212aa[_0xd88f('0x2d')]);_0x2ed9fc['filters']=_[_0xd88f('0x2e')](_0x2ed9fc[_0xd88f('0x2f')],_0x2ed9fc['query']);_0x5e0816[_0xd88f('0x31')]=_['intersection'](_0x2ed9fc[_0xd88f('0x2f')],qs[_0xd88f('0x30')](_0x2212aa[_0xd88f('0x2d')][_0xd88f('0x30')]));_0x5e0816['attributes']=_0x5e0816[_0xd88f('0x31')][_0xd88f('0x32')]?_0x5e0816[_0xd88f('0x31')]:_0x2ed9fc['model'];if(_0x2212aa[_0xd88f('0x2d')]['includeAll']){_0x5e0816[_0xd88f('0x3b')]=[{'all':!![]}];}_0x5e0816=_['merge']({},_0x5e0816,_0x2212aa[_0xd88f('0x3f')]);return db[_0xd88f('0x29')]['find'](_0x5e0816)[_0xd88f('0x16')](handleEntityNotFound(_0x5bc092,null))[_0xd88f('0x16')](respondWithResult(_0x5bc092,null))[_0xd88f('0x3d')](handleError(_0x5bc092,null));};exports[_0xd88f('0x15')]=function(_0x4c460e,_0x33110f){return db[_0xd88f('0x29')]['find']({'where':{'id':_0x4c460e[_0xd88f('0x40')]['id']}})[_0xd88f('0x16')](handleEntityNotFound(_0x33110f,null))[_0xd88f('0x16')](removeEntity(_0x33110f,null))['catch'](handleError(_0x33110f,null));};exports['create']=function(_0x5ee081,_0x3f25ff){if(_0x5ee081[_0xd88f('0x41')][_0xd88f('0x22')]==='outbound'&&!_[_0xd88f('0x42')](_0x5ee081['body'][_0xd88f('0x43')],'_')){_0x5ee081['body']['exten']='_'[_0xd88f('0x44')](_0x5ee081['body'][_0xd88f('0x43')]);}return db[_0xd88f('0x29')][_0xd88f('0x45')](_0x5ee081[_0xd88f('0x41')],{'raw':![]})[_0xd88f('0x16')](function(_0x43330a){var _0x42b97a=_0x5ee081[_0xd88f('0x46')][_0xd88f('0x17')]({'plain':!![]});if(!_0x42b97a)throw new Error(_0xd88f('0x47'));if(_0x42b97a[_0xd88f('0x48')]==='user'){var _0x4fa603=_0x43330a['get']({'plain':!![]});var _0x3ea30d=[{'name':_0xd88f('0x18'),'value':'inbound'},{'name':_0xd88f('0x1a'),'value':'outbound'},{'name':_0xd88f('0x1b'),'value':_0xd88f('0x1c')}];var _0x2517d3=_[_0xd88f('0x23')](_0x3ea30d,[_0xd88f('0x20'),_0x4fa603['type']])[_0xd88f('0x24')];return db[_0xd88f('0x49')][_0xd88f('0x23')]({'where':{'name':_0x2517d3,'userProfileId':_0x42b97a[_0xd88f('0x4a')]},'raw':!![]})[_0xd88f('0x16')](function(_0x4daed5){if(_0x4daed5&&_0x4daed5[_0xd88f('0x4b')]===0x0){return db['UserProfileResource'][_0xd88f('0x45')]({'name':_0x4fa603[_0xd88f('0x24')],'resourceId':_0x4fa603['id'],'type':_0x4daed5['name'],'sectionId':_0x4daed5['id']},{})['then'](function(){return _0x43330a;});}else{return _0x43330a;}})[_0xd88f('0x3d')](function(_0x31f762){logger[_0xd88f('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31f762);throw _0x31f762;});}return _0x43330a;})[_0xd88f('0x16')](respondWithResult(_0x3f25ff,0xc9))['catch'](handleError(_0x3f25ff,null));};exports['update']=function(_0x256ea7,_0x3ac0af){if(_0x256ea7['body']['id']){delete _0x256ea7[_0xd88f('0x41')]['id'];}return db[_0xd88f('0x29')]['find']({'where':{'id':_0x256ea7[_0xd88f('0x40')]['id']}})[_0xd88f('0x16')](handleEntityNotFound(_0x3ac0af,null))[_0xd88f('0x16')](function(_0x69027){if(_0x69027){return db[_0xd88f('0x29')][_0xd88f('0x4d')](_[_0xd88f('0x37')](_0x256ea7['body'],[_0xd88f('0x43'),_0xd88f('0x4e'),'description',_0xd88f('0x4f'),'cutdigits',_0xd88f('0x50'),_0xd88f('0x51')]),{'where':{'context':_0x69027[_0xd88f('0x4e')],'exten':_0x69027[_0xd88f('0x43')]},'individualHooks':!![]})[_0xd88f('0x16')](function(_0x60ce0e){return _0x60ce0e;});}return null;})[_0xd88f('0x16')](respondWithStatusCode(_0x3ac0af,null))['catch'](handleError(_0x3ac0af,null));};exports[_0xd88f('0x52')]=function(_0x5b110f,_0x568189){var _0x54778d=_0x5b110f['params']['id'];var _0x3fadd7=_0x5b110f[_0xd88f('0x41')];var _0x3ffa9f=0xc8;var _0x3358d6=null;return db[_0xd88f('0x53')]['transaction']({'isolationLevel':db[_0xd88f('0x53')][_0xd88f('0x54')][_0xd88f('0x55')]['READ_COMMITTED']},function(_0x571c6f){return db['VoiceExtension'][_0xd88f('0x56')]({'where':{'id':_0x54778d},'transaction':_0x571c6f})[_0xd88f('0x16')](function(_0x590664){if(_0x590664){return db[_0xd88f('0x29')]['destroy']({'where':{'VoiceExtensionId':_0x54778d},'transaction':_0x571c6f})[_0xd88f('0x16')](function(){var _0x5050a4=_[_0xd88f('0x1f')](_0x3fadd7,function(_0x48b6dc){_0x48b6dc['VoiceExtensionId']=_0x54778d;_0x48b6dc[_0xd88f('0x57')]=!![];return _0x48b6dc;});return _0x590664['createRouting'](_0x5050a4);})[_0xd88f('0x16')](function(_0x343a02){return db[_0xd88f('0x29')]['bulkCreate'](_0x343a02,{'transaction':_0x571c6f});});}else{_0x3ffa9f=0x194;_0x3358d6=[];}});})[_0xd88f('0x16')](function(){if(_0x3ffa9f!==0x194){return db['VoiceExtension'][_0xd88f('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x54778d},'order':_0xd88f('0x59')})[_0xd88f('0x16')](function(_0x427a77){_0x3358d6=_0x427a77;});}})[_0xd88f('0x3d')](function(_0x5c54d2){_0x3ffa9f=0x1f4;logger[_0xd88f('0x4c')](_0x5c54d2[_0xd88f('0x27')]);if(_0x5c54d2[_0xd88f('0x24')]){delete _0x5c54d2[_0xd88f('0x24')];}_0x3358d6=_0x5c54d2;})[_0xd88f('0x5a')](function(){if(_0x3358d6===null){_0x568189['sendStatus'](_0x3ffa9f);}else{if(_0x3ffa9f===0x1f4){_0x568189[_0xd88f('0xc')](_0x3ffa9f)[_0xd88f('0x5b')](_0x3358d6);}else{_0x568189[_0xd88f('0xc')](_0x3ffa9f)['json'](_0x3358d6);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 5132889..6288061 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 _0xb4fb=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1ccdb0,_0x8903c6){var _0x3e2a18=function(_0xa57b50){while(--_0xa57b50){_0x1ccdb0['push'](_0x1ccdb0['shift']());}};_0x3e2a18(++_0x8903c6);}(_0xb4fb,0xb4));var _0xbb4f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb4fb[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xbb4f('0x0'));var VoiceExtension=require(_0xbb4f('0x1'))['db'][_0xbb4f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xbb4f('0x3')](0x0);var events={'afterCreate':_0xbb4f('0x4'),'afterUpdate':_0xbb4f('0x5'),'afterDestroy':_0xbb4f('0x6')};function emitEvent(_0x38ad34){return function(_0x5bccb9,_0x51b7a6,_0x45285e){VoiceExtensionEvents['emit'](_0x38ad34+':'+_0x5bccb9['id'],_0x5bccb9);VoiceExtensionEvents[_0xbb4f('0x7')](_0x38ad34,_0x5bccb9);_0x45285e(null);};}for(var e in events){if(events[_0xbb4f('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xbb4f('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x79d4=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2093e1,_0x9ecd1d){var _0x5a8f2b=function(_0x4b7d99){while(--_0x4b7d99){_0x2093e1['push'](_0x2093e1['shift']());}};_0x5a8f2b(++_0x9ecd1d);}(_0x79d4,0xd0));var _0x479d=function(_0x2a2ef3,_0x25cbea){_0x2a2ef3=_0x2a2ef3-0x0;var _0x50c9e4=_0x79d4[_0x2a2ef3];return _0x50c9e4;};'use strict';var EventEmitter=require(_0x479d('0x0'));var VoiceExtension=require(_0x479d('0x1'))['db'][_0x479d('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x479d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x479d('0x4'),'afterDestroy':_0x479d('0x5')};function emitEvent(_0x379571){return function(_0x52372d,_0x25a9c5,_0xff5a6a){VoiceExtensionEvents['emit'](_0x379571+':'+_0x52372d['id'],_0x52372d);VoiceExtensionEvents[_0x479d('0x6')](_0x379571,_0x52372d);_0xff5a6a(null);};}for(var e in events){if(events[_0x479d('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x479d('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 093052e..b524a1e 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 _0x4c37=['models','type','Set','CDR(type)=','exten','inbound','push','CDR(routeid)=','context','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','length','param','split','phone','prefix','${EXTEN}','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports'];(function(_0x2e7abe,_0x52dbac){var _0x539aeb=function(_0x2646a0){while(--_0x2646a0){_0x2e7abe['push'](_0x2e7abe['shift']());}};_0x539aeb(++_0x52dbac);}(_0x4c37,0x192));var _0x74c3=function(_0x54aa64,_0x1c9fa9){_0x54aa64=_0x54aa64-0x0;var _0x52442b=_0x4c37[_0x54aa64];return _0x52442b;};'use strict';var _=require(_0x74c3('0x0'));var attributes=require(_0x74c3('0x1'));module[_0x74c3('0x2')]=function(_0x8f2c4){var _0x16964e=_0x8f2c4[_0x74c3('0x3')];function _0x54c77f(_0x58b19f){var _0x1cd54a=0x2;var _0x2ce3b2=[{'type':_0x58b19f[_0x74c3('0x4')],'app':_0x74c3('0x5'),'appdata':_0x74c3('0x6')+_0x58b19f['type'],'context':_0x58b19f['context'],'exten':_0x58b19f[_0x74c3('0x7')],'priority':_0x1cd54a++,'VoiceExtensionId':_0x58b19f['id']}];if(_0x58b19f['type']===_0x74c3('0x8')){_0x2ce3b2[_0x74c3('0x9')]({'type':'inbound','app':'Set','appdata':_0x74c3('0xa')+_0x58b19f['id'],'context':_0x58b19f[_0x74c3('0xb')],'exten':_0x58b19f[_0x74c3('0x7')],'priority':_0x1cd54a++,'VoiceExtensionId':_0x58b19f['id']});}_0x2ce3b2[_0x74c3('0x9')]({'type':_0x58b19f[_0x74c3('0x4')],'app':_0x74c3('0x5'),'appdata':_0x74c3('0xc'),'context':_0x58b19f[_0x74c3('0xb')],'exten':_0x58b19f['exten'],'priority':_0x1cd54a++,'VoiceExtensionId':_0x58b19f['id']},{'type':_0x58b19f[_0x74c3('0x4')],'app':_0x74c3('0x5'),'appdata':_0x74c3('0xd'),'context':_0x58b19f[_0x74c3('0xb')],'exten':_0x58b19f['exten'],'priority':_0x1cd54a++,'VoiceExtensionId':_0x58b19f['id']},{'type':_0x58b19f[_0x74c3('0x4')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x58b19f[_0x74c3('0xb')],'exten':_0x58b19f['exten'],'priority':_0x1cd54a++,'VoiceExtensionId':_0x58b19f['id']});return _0x2ce3b2;}function _0x2f0822(_0x14ec8d){var _0x2879e6=0x2;var _0x50519b=[{'type':_0x74c3('0xe'),'app':_0x74c3('0x5'),'appdata':_0x74c3('0xf'),'context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':_0x74c3('0xe'),'app':_0x74c3('0x5'),'appdata':'CDR(destination)='+(_0x14ec8d[_0x74c3('0x10')]?_0x74c3('0x11')+_0x14ec8d[_0x74c3('0x10')]+'}':'${EXTEN}'),'context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d['exten'],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':_0x74c3('0xe'),'app':_0x74c3('0x5'),'appdata':_0x74c3('0xa')+_0x14ec8d['id'],'context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':_0x74c3('0xe'),'app':_0x74c3('0x12'),'appdata':_0x74c3('0x13')+(_0x2879e6+0x2)+'):Goto('+(_0x2879e6+0x1)+')','context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':'outbound','app':'Set','appdata':_0x14ec8d['cutdigits']?_0x74c3('0x14')+_0x14ec8d[_0x74c3('0x10')]+'}':_0x74c3('0x15'),'context':_0x14ec8d['context'],'exten':_0x14ec8d['exten'],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':'outbound','app':_0x74c3('0x5'),'appdata':_0x74c3('0xc'),'context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':'outbound','app':_0x74c3('0x5'),'appdata':_0x74c3('0xd'),'context':_0x14ec8d['context'],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':_0x74c3('0xe'),'app':_0x74c3('0x5'),'appdata':_0x74c3('0x16'),'context':_0x14ec8d['context'],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':_0x74c3('0xe'),'app':_0x74c3('0x5'),'appdata':_0x74c3('0x17')+_0x14ec8d['id'],'context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d['exten'],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']}];if(_0x14ec8d['hasOwnProperty'](_0x74c3('0x18'))&&_0x14ec8d['recordingFormat']!=='none'){_0x50519b[_0x74c3('0x9')]({'type':'outbound','app':'Set','appdata':_0x74c3('0x19'),'context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']},{'type':'outbound','app':'Set','appdata':_0x74c3('0x1a')+_0x14ec8d[_0x74c3('0x18')]||_0x74c3('0x1b'),'context':_0x14ec8d[_0x74c3('0xb')],'exten':_0x14ec8d[_0x74c3('0x7')],'priority':_0x2879e6++,'VoiceExtensionId':_0x14ec8d['id']});}return _0x50519b;}function _0x44cb18(_0x227e23,_0x355547){var _0xcdac0b=[{'name':_0x74c3('0x1c'),'param':0x0},{'name':_0x74c3('0x1d'),'param':0x1},{'name':'options','param':0x2},{'name':_0x74c3('0x1e'),'param':0x3}];var _0x20da28={};var _0xff7830=_0x355547['split'](',');var _0x259603=[];for(var _0x128cd1=0x0;_0x128cd1<_0xcdac0b[_0x74c3('0x1f')];_0x128cd1++){switch(_0xcdac0b[_0x128cd1]['name']){case _0x74c3('0x1c'):_0x20da28[_0x74c3('0x1c')]=_0xff7830[_0xcdac0b[_0x128cd1][_0x74c3('0x20')]][_0x74c3('0x21')]('/')[0x1];_0x20da28[_0x74c3('0x22')]=_0xff7830[_0xcdac0b[_0x128cd1][_0x74c3('0x20')]]['split']('/')[0x2];_0x20da28[_0x74c3('0x23')]=_0x20da28[_0x74c3('0x22')]?_0x20da28[_0x74c3('0x22')][_0x74c3('0x21')]('$')[0x0]:undefined;_0x20da28['phone']=_0x227e23['cutdigits']?(_0x20da28[_0x74c3('0x23')]||'')+_0x74c3('0x11')+_0x227e23[_0x74c3('0x10')]+'}':(_0x20da28['prefix']||'')+_0x74c3('0x24');_0x259603[_0xcdac0b[_0x128cd1][_0x74c3('0x20')]]=[_0x74c3('0x25'),_0x20da28[_0x74c3('0x1c')],_0x20da28[_0x74c3('0x22')]][_0x74c3('0x26')]('/');break;case _0x74c3('0x27'):_0x20da28[_0x74c3('0x27')]=_0xff7830[_0xcdac0b[_0x128cd1][_0x74c3('0x20')]];if(_0x227e23[_0x74c3('0x18')]!==_0x74c3('0x28')){if(_0x20da28[_0x74c3('0x27')][_0x74c3('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x20da28[_0x74c3('0x27')]+=_0x74c3('0x2a');}}else{_0x20da28[_0x74c3('0x27')]=_0x20da28[_0x74c3('0x27')][_0x74c3('0x2b')]('U(xcally-mixmonitor-context)','');}_0x259603[_0xcdac0b[_0x128cd1][_0x74c3('0x20')]]=_0x20da28[_0x74c3('0x27')];break;default:_0x259603[_0xcdac0b[_0x128cd1][_0x74c3('0x20')]]=_0xff7830[_0xcdac0b[_0x128cd1][_0x74c3('0x20')]];}}return _0x259603[_0x74c3('0x26')](',');}function _0xe0068d(_0x22d5ae,_0x54ade1,_0x2d9250){return new Promise(function(_0x5e2e73,_0x23c901){var _0x5707a0=[];if(_['isEmpty'](_0x54ade1))return _0x5e2e73(_0x5707a0);_0x16964e[_0x74c3('0x2c')][_0x74c3('0x2d')]({'attributes':['id',_0x74c3('0x2e'),_0x74c3('0x2f')],'raw':!![]})[_0x74c3('0x30')](function(_0x377c72){for(var _0x43ec7e=0x0,_0x134c9a=0x0;_0x43ec7e<_0x54ade1[_0x74c3('0x1f')];_0x43ec7e++,_0x134c9a=0x0){var _0x1c00c5=_0x54ade1[_0x43ec7e];var _0x1cbaeb=[];var _0x6b773a=[];delete _0x1c00c5['id'];if(_0x1c00c5[_0x74c3('0x2e')]!=='*,*,*,*'){_0x1c00c5[_0x74c3('0x31')]=[_0x1c00c5[_0x74c3('0x2e')]];}else{_0x1c00c5[_0x74c3('0x31')]=_0x1c00c5['IntervalId']?_[_0x74c3('0x32')](_[_0x74c3('0x33')](_0x377c72,{'IntervalId':_0x1c00c5[_0x74c3('0x2f')]}),_0x74c3('0x2e')):[];}_0x1c00c5[_0x74c3('0xb')]=_0x22d5ae[_0x74c3('0xb')];_0x1c00c5[_0x74c3('0x7')]=_0x22d5ae[_0x74c3('0x7')];if(_0x1c00c5[_0x74c3('0x4')])_0x1c00c5[_0x74c3('0x4')]=_0x1c00c5[_0x74c3('0x4')][_0x74c3('0x34')]();if(_0x22d5ae[_0x74c3('0x4')]===_0x74c3('0xe')){if(_0x1c00c5[_0x74c3('0x35')](_0x74c3('0x36'))&&_0x1c00c5[_0x74c3('0x36')]&&_0x1c00c5['tag']!=='--'){_0x1cbaeb['push']({'type':_0x1c00c5[_0x74c3('0x4')][_0x74c3('0x34')](),'app':_0x74c3('0x5'),'appdata':_0x74c3('0x37')+_0x1c00c5[_0x74c3('0x36')],'context':_0x22d5ae[_0x74c3('0xb')],'exten':_0x22d5ae[_0x74c3('0x7')],'priority':_0x1c00c5['intervals'][_0x74c3('0x1f')]+_0x2d9250+_0x134c9a++,'VoiceExtensionId':_0x22d5ae['id']});}_0x1cbaeb[_0x74c3('0x9')]({'type':_0x1c00c5[_0x74c3('0x4')][_0x74c3('0x34')](),'app':'ExecIf','appdata':_0x74c3('0x38')+(_0x1c00c5['callerID']?_0x74c3('0x39')+_0x1c00c5['callerID']+')':_0x74c3('0x3a')),'context':_0x22d5ae['context'],'exten':_0x22d5ae[_0x74c3('0x7')],'priority':_0x1c00c5[_0x74c3('0x31')][_0x74c3('0x1f')]+_0x2d9250+_0x134c9a++,'VoiceExtensionId':_0x22d5ae['id']});}else{if(_0x1c00c5[_0x74c3('0x35')](_0x74c3('0x3b'))){if([_0x74c3('0x3c'),_0x74c3('0x3d')]['includes'](_0x1c00c5[_0x74c3('0x3e')][_0x74c3('0x34')]())&&_0x1c00c5[_0x74c3('0x3f')]!==_0x74c3('0x40')){if(_0x1c00c5[_0x74c3('0x3b')]){_0x1cbaeb[_0x74c3('0x9')]({'type':_0x1c00c5[_0x74c3('0x4')]['toLowerCase'](),'app':_0x74c3('0x12'),'appdata':_0x74c3('0x41'),'context':_0x22d5ae['context'],'exten':_0x22d5ae[_0x74c3('0x7')],'priority':_0x1c00c5[_0x74c3('0x31')][_0x74c3('0x1f')]+_0x2d9250+_0x134c9a++,'VoiceExtensionId':_0x22d5ae['id']});_0x1cbaeb[_0x74c3('0x9')]({'type':_0x1c00c5['type'][_0x74c3('0x34')](),'app':_0x74c3('0x5'),'appdata':_0x74c3('0x42'),'context':_0x22d5ae['context'],'exten':_0x22d5ae[_0x74c3('0x7')],'priority':_0x1c00c5[_0x74c3('0x31')][_0x74c3('0x1f')]+_0x2d9250+_0x134c9a++,'VoiceExtensionId':_0x22d5ae['id']});}else{_0x1cbaeb['push']({'type':_0x1c00c5[_0x74c3('0x4')][_0x74c3('0x34')](),'app':_0x74c3('0x12'),'appdata':_0x74c3('0x43'),'context':_0x22d5ae[_0x74c3('0xb')],'exten':_0x22d5ae[_0x74c3('0x7')],'priority':_0x1c00c5[_0x74c3('0x31')][_0x74c3('0x1f')]+_0x2d9250+_0x134c9a++,'VoiceExtensionId':_0x22d5ae['id']});_0x1cbaeb[_0x74c3('0x9')]({'type':_0x1c00c5[_0x74c3('0x4')][_0x74c3('0x34')](),'app':_0x74c3('0x5'),'appdata':_0x74c3('0x44'),'context':_0x22d5ae[_0x74c3('0xb')],'exten':_0x22d5ae[_0x74c3('0x7')],'priority':_0x1c00c5['intervals']['length']+_0x2d9250+_0x134c9a++,'VoiceExtensionId':_0x22d5ae['id']});}}}}for(var _0x21e31f=0x0;_0x21e31f<_0x1c00c5[_0x74c3('0x31')]['length'];_0x21e31f++){var _0xf55594=_0x2d9250+_0x1c00c5[_0x74c3('0x31')]['length'];var _0x473f1a=_0x21e31f===_0x1c00c5[_0x74c3('0x31')][_0x74c3('0x1f')]-0x1?_0x2d9250+_0x1cbaeb[_0x74c3('0x1f')]+_0x6b773a['length']+0x2:_0x2d9250+_0x21e31f+0x1;_0x1cbaeb['splice'](_0x21e31f,0x0,{'type':_0x22d5ae[_0x74c3('0x4')],'app':_0x74c3('0x45'),'appdata':_0x1c00c5[_0x74c3('0x31')][_0x21e31f]+'?'+_0x22d5ae[_0x74c3('0xb')]+_0x74c3('0x46')+_0xf55594+':'+_0x22d5ae[_0x74c3('0xb')]+_0x74c3('0x46')+_0x473f1a,'exten':_0x22d5ae[_0x74c3('0x7')],'context':_0x22d5ae['context'],'priority':_0x2d9250+_0x21e31f,'VoiceExtensionId':_0x22d5ae['id']});}if(_0x1c00c5[_0x74c3('0x3f')]===_0x74c3('0x47')){_0x1c00c5['appdata']=_0x44cb18(_0x22d5ae,_0x1c00c5[_0x74c3('0x48')]);}if(_0x1c00c5[_0x74c3('0x3f')]==='agi'){_0x1cbaeb[_0x74c3('0x9')]({'type':_0x1c00c5['type']['toLowerCase'](),'app':_0x74c3('0x5'),'appdata':_0x74c3('0x49'),'context':_0x22d5ae[_0x74c3('0xb')],'exten':_0x22d5ae['exten'],'priority':_0x1c00c5[_0x74c3('0x31')][_0x74c3('0x1f')]+_0x2d9250+_0x134c9a++,'VoiceExtensionId':_0x22d5ae['id']});}_0x1c00c5[_0x74c3('0x4a')]=_0x1cbaeb[_0x74c3('0x1f')]?_[_0x74c3('0x4b')](_0x1cbaeb)[_0x74c3('0x4a')]+0x1:_0x2d9250;_0x5707a0=_[_0x74c3('0x4c')](_0x5707a0,_0x1cbaeb,[_0x1c00c5],_0x6b773a);_0x2d9250=_[_0x74c3('0x4b')](_0x5707a0)[_0x74c3('0x4a')]+0x1;}return _0x5e2e73(_0x5707a0);})[_0x74c3('0x4d')](function(_0x15d413){_0x23c901(_0x15d413);});});}return _0x8f2c4['define'](_0x74c3('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x40a4d4){var _0x34a8a3=this[_0x74c3('0x4f')]({'plain':!![]});var _0x4b2559=_0x34a8a3[_0x74c3('0x4')]===_0x74c3('0xe')?_0x2f0822(_0x34a8a3):_0x54c77f(_0x34a8a3);return _0xe0068d(_0x34a8a3,_0x40a4d4,_[_0x74c3('0x4b')](_0x4b2559)[_0x74c3('0x4a')]+0x1)[_0x74c3('0x30')](function(_0x26a799){var _0x58c9a8=_['concat'](_0x4b2559,_0x26a799);_0x58c9a8[_0x74c3('0x9')]({'type':_0x34a8a3[_0x74c3('0x4')],'app':_0x74c3('0x50'),'exten':_0x34a8a3['exten'],'context':_0x34a8a3[_0x74c3('0xb')],'priority':_['last'](_0x58c9a8)['priority']+0x1,'VoiceExtensionId':_0x34a8a3['id']});return _0x58c9a8;});}}});}; \ No newline at end of file +var _0x4d40=['options','url','split','length','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','then','interval','map','filter','tag','toLowerCase','CDR(tag)=','intervals','Set(CALLERID(all)=','callerID','answer','playback','includes','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','agi','priority','concat','last','catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','inbound','push','CDR(routeid)=','exten','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4d40,0x7a));var _0x04d4=function(_0x21c80a,_0x275d41){_0x21c80a=_0x21c80a-0x0;var _0x4a7719=_0x4d40[_0x21c80a];return _0x4a7719;};'use strict';var _=require(_0x04d4('0x0'));var attributes=require(_0x04d4('0x1'));module[_0x04d4('0x2')]=function(_0x24a549){var _0x2d62d6=_0x24a549[_0x04d4('0x3')];function _0x435b13(_0x11bb01){var _0x4f0cae=0x2;var _0x16d338=[{'type':_0x11bb01[_0x04d4('0x4')],'app':_0x04d4('0x5'),'appdata':'CDR(type)='+_0x11bb01[_0x04d4('0x4')],'context':_0x11bb01[_0x04d4('0x6')],'exten':_0x11bb01['exten'],'priority':_0x4f0cae++,'VoiceExtensionId':_0x11bb01['id']}];if(_0x11bb01[_0x04d4('0x4')]===_0x04d4('0x7')){_0x16d338[_0x04d4('0x8')]({'type':_0x04d4('0x7'),'app':'Set','appdata':_0x04d4('0x9')+_0x11bb01['id'],'context':_0x11bb01[_0x04d4('0x6')],'exten':_0x11bb01[_0x04d4('0xa')],'priority':_0x4f0cae++,'VoiceExtensionId':_0x11bb01['id']});}_0x16d338['push']({'type':_0x11bb01[_0x04d4('0x4')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x11bb01['context'],'exten':_0x11bb01[_0x04d4('0xa')],'priority':_0x4f0cae++,'VoiceExtensionId':_0x11bb01['id']},{'type':_0x11bb01[_0x04d4('0x4')],'app':_0x04d4('0x5'),'appdata':_0x04d4('0xb'),'context':_0x11bb01['context'],'exten':_0x11bb01[_0x04d4('0xa')],'priority':_0x4f0cae++,'VoiceExtensionId':_0x11bb01['id']},{'type':_0x11bb01['type'],'app':_0x04d4('0x5'),'appdata':_0x04d4('0xc'),'context':_0x11bb01['context'],'exten':_0x11bb01[_0x04d4('0xa')],'priority':_0x4f0cae++,'VoiceExtensionId':_0x11bb01['id']});return _0x16d338;}function _0x5d65dd(_0x487b05){var _0x2e017c=0x2;var _0x29537d=[{'type':_0x04d4('0xd'),'app':_0x04d4('0x5'),'appdata':_0x04d4('0xe'),'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05['exten'],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':_0x04d4('0xd'),'app':_0x04d4('0x5'),'appdata':_0x04d4('0xf')+(_0x487b05[_0x04d4('0x10')]?_0x04d4('0x11')+_0x487b05[_0x04d4('0x10')]+'}':_0x04d4('0x12')),'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05[_0x04d4('0xa')],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':'outbound','app':'Set','appdata':_0x04d4('0x9')+_0x487b05['id'],'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05[_0x04d4('0xa')],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':_0x04d4('0xd'),'app':_0x04d4('0x13'),'appdata':_0x04d4('0x14')+(_0x2e017c+0x2)+_0x04d4('0x15')+(_0x2e017c+0x1)+')','context':_0x487b05['context'],'exten':_0x487b05[_0x04d4('0xa')],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':_0x04d4('0xd'),'app':_0x04d4('0x5'),'appdata':_0x487b05[_0x04d4('0x10')]?_0x04d4('0x16')+_0x487b05[_0x04d4('0x10')]+'}':_0x04d4('0x17'),'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05[_0x04d4('0xa')],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':'outbound','app':_0x04d4('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x487b05['context'],'exten':_0x487b05['exten'],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':'outbound','app':_0x04d4('0x5'),'appdata':_0x04d4('0xb'),'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05['exten'],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':'outbound','app':_0x04d4('0x5'),'appdata':_0x04d4('0xc'),'context':_0x487b05['context'],'exten':_0x487b05[_0x04d4('0xa')],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':_0x04d4('0xd'),'app':_0x04d4('0x5'),'appdata':'outboundrouteid='+_0x487b05['id'],'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05[_0x04d4('0xa')],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']}];if(_0x487b05[_0x04d4('0x18')]('recordingFormat')&&_0x487b05[_0x04d4('0x19')]!==_0x04d4('0x1a')){_0x29537d[_0x04d4('0x8')]({'type':_0x04d4('0xd'),'app':'Set','appdata':_0x04d4('0x1b'),'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05[_0x04d4('0xa')],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']},{'type':'outbound','app':_0x04d4('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x487b05[_0x04d4('0x19')]||_0x04d4('0x1c'),'context':_0x487b05[_0x04d4('0x6')],'exten':_0x487b05['exten'],'priority':_0x2e017c++,'VoiceExtensionId':_0x487b05['id']});}return _0x29537d;}function _0x33355e(_0x32cbdc,_0x17a4c6){var _0x3c6b6a=[{'name':_0x04d4('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x04d4('0x1e'),'param':0x2},{'name':_0x04d4('0x1f'),'param':0x3}];var _0x22c969={};var _0xc17e4f=_0x17a4c6[_0x04d4('0x20')](',');var _0x182ea4=[];for(var _0x83e474=0x0;_0x83e474<_0x3c6b6a[_0x04d4('0x21')];_0x83e474++){switch(_0x3c6b6a[_0x83e474]['name']){case'trunk':_0x22c969[_0x04d4('0x1d')]=_0xc17e4f[_0x3c6b6a[_0x83e474][_0x04d4('0x22')]][_0x04d4('0x20')]('/')[0x1];_0x22c969[_0x04d4('0x23')]=_0xc17e4f[_0x3c6b6a[_0x83e474][_0x04d4('0x22')]][_0x04d4('0x20')]('/')[0x2];_0x22c969[_0x04d4('0x24')]=_0x22c969[_0x04d4('0x23')]?_0x22c969['phone']['split']('$')[0x0]:undefined;_0x22c969[_0x04d4('0x23')]=_0x32cbdc[_0x04d4('0x10')]?(_0x22c969[_0x04d4('0x24')]||'')+'${EXTEN:'+_0x32cbdc[_0x04d4('0x10')]+'}':(_0x22c969[_0x04d4('0x24')]||'')+_0x04d4('0x12');_0x182ea4[_0x3c6b6a[_0x83e474]['param']]=['SIP',_0x22c969[_0x04d4('0x1d')],_0x22c969[_0x04d4('0x23')]][_0x04d4('0x25')]('/');break;case _0x04d4('0x1e'):_0x22c969[_0x04d4('0x1e')]=_0xc17e4f[_0x3c6b6a[_0x83e474]['param']];if(_0x32cbdc[_0x04d4('0x19')]!==_0x04d4('0x1a')){if(_0x22c969['options'][_0x04d4('0x26')]('U(xcally-mixmonitor-context)')<0x0){_0x22c969[_0x04d4('0x1e')]+=_0x04d4('0x27');}}else{_0x22c969[_0x04d4('0x1e')]=_0x22c969[_0x04d4('0x1e')][_0x04d4('0x28')]('U(xcally-mixmonitor-context)','');}_0x182ea4[_0x3c6b6a[_0x83e474][_0x04d4('0x22')]]=_0x22c969[_0x04d4('0x1e')];break;default:_0x182ea4[_0x3c6b6a[_0x83e474][_0x04d4('0x22')]]=_0xc17e4f[_0x3c6b6a[_0x83e474][_0x04d4('0x22')]];}}return _0x182ea4['join'](',');}function _0x253612(_0x3ca25a,_0x27f38f,_0x48f50f){return new Promise(function(_0x481083,_0x1fed6d){var _0x4d5d7d=[];if(_[_0x04d4('0x29')](_0x27f38f))return _0x481083(_0x4d5d7d);_0x2d62d6[_0x04d4('0x2a')][_0x04d4('0x2b')]({'attributes':['id','interval',_0x04d4('0x2c')],'raw':!![]})[_0x04d4('0x2d')](function(_0x47a55a){for(var _0x11f0a2=0x0,_0x3ca28f=0x0;_0x11f0a2<_0x27f38f[_0x04d4('0x21')];_0x11f0a2++,_0x3ca28f=0x0){var _0x1309bc=_0x27f38f[_0x11f0a2];var _0xca2a4f=[];var _0x234df1=[];delete _0x1309bc['id'];if(_0x1309bc[_0x04d4('0x2e')]!=='*,*,*,*'){_0x1309bc['intervals']=[_0x1309bc[_0x04d4('0x2e')]];}else{_0x1309bc['intervals']=_0x1309bc[_0x04d4('0x2c')]?_[_0x04d4('0x2f')](_[_0x04d4('0x30')](_0x47a55a,{'IntervalId':_0x1309bc[_0x04d4('0x2c')]}),_0x04d4('0x2e')):[];}_0x1309bc[_0x04d4('0x6')]=_0x3ca25a[_0x04d4('0x6')];_0x1309bc[_0x04d4('0xa')]=_0x3ca25a[_0x04d4('0xa')];if(_0x1309bc[_0x04d4('0x4')])_0x1309bc[_0x04d4('0x4')]=_0x1309bc[_0x04d4('0x4')]['toLowerCase']();if(_0x3ca25a['type']===_0x04d4('0xd')){if(_0x1309bc[_0x04d4('0x18')](_0x04d4('0x31'))&&_0x1309bc[_0x04d4('0x31')]&&_0x1309bc[_0x04d4('0x31')]!=='--'){_0xca2a4f[_0x04d4('0x8')]({'type':_0x1309bc[_0x04d4('0x4')][_0x04d4('0x32')](),'app':_0x04d4('0x5'),'appdata':_0x04d4('0x33')+_0x1309bc[_0x04d4('0x31')],'context':_0x3ca25a['context'],'exten':_0x3ca25a['exten'],'priority':_0x1309bc[_0x04d4('0x34')][_0x04d4('0x21')]+_0x48f50f+_0x3ca28f++,'VoiceExtensionId':_0x3ca25a['id']});}_0xca2a4f[_0x04d4('0x8')]({'type':_0x1309bc[_0x04d4('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1309bc['callerID']?_0x04d4('0x35')+_0x1309bc[_0x04d4('0x36')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3ca25a[_0x04d4('0x6')],'exten':_0x3ca25a['exten'],'priority':_0x1309bc[_0x04d4('0x34')][_0x04d4('0x21')]+_0x48f50f+_0x3ca28f++,'VoiceExtensionId':_0x3ca25a['id']});}else{if(_0x1309bc['hasOwnProperty'](_0x04d4('0x37'))){if(['queue',_0x04d4('0x38')][_0x04d4('0x39')](_0x1309bc['app']['toLowerCase']())&&_0x1309bc['appType']!=='custom'){if(_0x1309bc[_0x04d4('0x37')]){_0xca2a4f[_0x04d4('0x8')]({'type':_0x1309bc[_0x04d4('0x4')][_0x04d4('0x32')](),'app':_0x04d4('0x13'),'appdata':_0x04d4('0x3a'),'context':_0x3ca25a[_0x04d4('0x6')],'exten':_0x3ca25a[_0x04d4('0xa')],'priority':_0x1309bc[_0x04d4('0x34')][_0x04d4('0x21')]+_0x48f50f+_0x3ca28f++,'VoiceExtensionId':_0x3ca25a['id']});_0xca2a4f[_0x04d4('0x8')]({'type':_0x1309bc[_0x04d4('0x4')][_0x04d4('0x32')](),'app':_0x04d4('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3ca25a[_0x04d4('0x6')],'exten':_0x3ca25a['exten'],'priority':_0x1309bc[_0x04d4('0x34')]['length']+_0x48f50f+_0x3ca28f++,'VoiceExtensionId':_0x3ca25a['id']});}else{_0xca2a4f[_0x04d4('0x8')]({'type':_0x1309bc[_0x04d4('0x4')][_0x04d4('0x32')](),'app':_0x04d4('0x13'),'appdata':_0x04d4('0x3b'),'context':_0x3ca25a[_0x04d4('0x6')],'exten':_0x3ca25a[_0x04d4('0xa')],'priority':_0x1309bc[_0x04d4('0x34')]['length']+_0x48f50f+_0x3ca28f++,'VoiceExtensionId':_0x3ca25a['id']});_0xca2a4f[_0x04d4('0x8')]({'type':_0x1309bc[_0x04d4('0x4')][_0x04d4('0x32')](),'app':_0x04d4('0x5'),'appdata':_0x04d4('0x3c'),'context':_0x3ca25a[_0x04d4('0x6')],'exten':_0x3ca25a['exten'],'priority':_0x1309bc[_0x04d4('0x34')]['length']+_0x48f50f+_0x3ca28f++,'VoiceExtensionId':_0x3ca25a['id']});}}}}for(var _0x10e1ed=0x0;_0x10e1ed<_0x1309bc[_0x04d4('0x34')][_0x04d4('0x21')];_0x10e1ed++){var _0x5df35f=_0x48f50f+_0x1309bc[_0x04d4('0x34')]['length'];var _0x38a56c=_0x10e1ed===_0x1309bc[_0x04d4('0x34')][_0x04d4('0x21')]-0x1?_0x48f50f+_0xca2a4f[_0x04d4('0x21')]+_0x234df1['length']+0x2:_0x48f50f+_0x10e1ed+0x1;_0xca2a4f[_0x04d4('0x3d')](_0x10e1ed,0x0,{'type':_0x3ca25a[_0x04d4('0x4')],'app':_0x04d4('0x3e'),'appdata':_0x1309bc['intervals'][_0x10e1ed]+'?'+_0x3ca25a['context']+',${EXTEN},'+_0x5df35f+':'+_0x3ca25a[_0x04d4('0x6')]+_0x04d4('0x3f')+_0x38a56c,'exten':_0x3ca25a[_0x04d4('0xa')],'context':_0x3ca25a[_0x04d4('0x6')],'priority':_0x48f50f+_0x10e1ed,'VoiceExtensionId':_0x3ca25a['id']});}if(_0x1309bc[_0x04d4('0x40')]===_0x04d4('0x41')){_0x1309bc[_0x04d4('0x42')]=_0x33355e(_0x3ca25a,_0x1309bc[_0x04d4('0x42')]);}if(_0x1309bc[_0x04d4('0x40')]===_0x04d4('0x43')){_0xca2a4f['push']({'type':_0x1309bc['type'][_0x04d4('0x32')](),'app':_0x04d4('0x5'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x3ca25a[_0x04d4('0x6')],'exten':_0x3ca25a[_0x04d4('0xa')],'priority':_0x1309bc[_0x04d4('0x34')]['length']+_0x48f50f+_0x3ca28f++,'VoiceExtensionId':_0x3ca25a['id']});}_0x1309bc[_0x04d4('0x44')]=_0xca2a4f[_0x04d4('0x21')]?_['last'](_0xca2a4f)[_0x04d4('0x44')]+0x1:_0x48f50f;_0x4d5d7d=_[_0x04d4('0x45')](_0x4d5d7d,_0xca2a4f,[_0x1309bc],_0x234df1);_0x48f50f=_[_0x04d4('0x46')](_0x4d5d7d)[_0x04d4('0x44')]+0x1;}return _0x481083(_0x4d5d7d);})[_0x04d4('0x47')](function(_0x353882){_0x1fed6d(_0x353882);});});}return _0x24a549[_0x04d4('0x48')](_0x04d4('0x49'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x422c4e){var _0x454a06=this[_0x04d4('0x4a')]({'plain':!![]});var _0x4750e5=_0x454a06[_0x04d4('0x4')]===_0x04d4('0xd')?_0x5d65dd(_0x454a06):_0x435b13(_0x454a06);return _0x253612(_0x454a06,_0x422c4e,_[_0x04d4('0x46')](_0x4750e5)[_0x04d4('0x44')]+0x1)[_0x04d4('0x2d')](function(_0x55d16c){var _0x278d43=_[_0x04d4('0x45')](_0x4750e5,_0x55d16c);_0x278d43['push']({'type':_0x454a06['type'],'app':_0x04d4('0x4b'),'exten':_0x454a06[_0x04d4('0xa')],'context':_0x454a06[_0x04d4('0x6')],'priority':_['last'](_0x278d43)[_0x04d4('0x44')]+0x1,'VoiceExtensionId':_0x454a06['id']});return _0x278d43;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index de73970..ebe5294 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 _0x1298=['request\x20sent','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','where','attributes','map','include','model','then','GetVoiceExtension','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0x239bfa,_0x5b871d){var _0x2a7002=function(_0x2a58b0){while(--_0x2a58b0){_0x239bfa['push'](_0x239bfa['shift']());}};_0x2a7002(++_0x5b871d);}(_0x1298,0x19e));var _0x8129=function(_0x47423e,_0xfaa9b){_0x47423e=_0x47423e-0x0;var _0x1cc932=_0x1298[_0x47423e];return _0x1cc932;};'use strict';var _=require('lodash');var util=require(_0x8129('0x0'));var moment=require('moment');var BPromise=require(_0x8129('0x1'));var rs=require(_0x8129('0x2'));var fs=require('fs');var Redis=require(_0x8129('0x3'));var db=require(_0x8129('0x4'))['db'];var utils=require(_0x8129('0x5'));var logger=require(_0x8129('0x6'))(_0x8129('0x7'));var config=require('../../config/environment');var jayson=require(_0x8129('0x8'));var client=jayson[_0x8129('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8129('0xa')](config[_0x8129('0xb')],{'host':_0x8129('0xc'),'port':0x18eb});var socket=require(_0x8129('0xd'))(new Redis(config[_0x8129('0xb')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x5a64a4,_0x50b960,_0x2f27a7){return new BPromise(function(_0x2fe2b6,_0x4cfa1d){return client[_0x8129('0xe')](_0x5a64a4,_0x2f27a7)['then'](function(_0x511313){logger[_0x8129('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x50b960,'request\x20sent');logger[_0x8129('0x10')](_0x8129('0x11'),_0x50b960,_0x8129('0x12'),JSON[_0x8129('0x13')](_0x511313));if(_0x511313[_0x8129('0x14')]){if(_0x511313[_0x8129('0x14')]['code']===0x1f4){logger['error'](_0x8129('0x15'),_0x50b960,_0x511313['error'][_0x8129('0x16')]);return _0x4cfa1d(_0x511313['error'][_0x8129('0x16')]);}logger[_0x8129('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x50b960,_0x511313[_0x8129('0x14')]['message']);return _0x2fe2b6(_0x511313[_0x8129('0x14')][_0x8129('0x16')]);}else{logger[_0x8129('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x50b960,_0x8129('0x12'));_0x2fe2b6(_0x511313[_0x8129('0x17')][_0x8129('0x16')]);}})[_0x8129('0x18')](function(_0x3050b4){logger[_0x8129('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x50b960,_0x3050b4);_0x4cfa1d(_0x3050b4);});});}exports['GetVoiceExtension']=function(_0x1ac697){var _0x4b96a6=this;return new Promise(function(_0x22c68d,_0x1b419c){return db[_0x8129('0x19')][_0x8129('0x1a')]({'raw':_0x1ac697[_0x8129('0x1b')]?_0x1ac697[_0x8129('0x1b')][_0x8129('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ac697[_0x8129('0x1b')]?_0x1ac697[_0x8129('0x1b')][_0x8129('0x1d')]||null:null,'attributes':_0x1ac697['options']?_0x1ac697[_0x8129('0x1b')][_0x8129('0x1e')]||null:null,'limit':_0x1ac697[_0x8129('0x1b')]?_0x1ac697[_0x8129('0x1b')]['limit']||null:null,'include':_0x1ac697[_0x8129('0x1b')]?_0x1ac697[_0x8129('0x1b')]['include']?_[_0x8129('0x1f')](_0x1ac697['options'][_0x8129('0x20')],function(_0x3b6e8e){return{'model':db[_0x3b6e8e[_0x8129('0x21')]],'as':_0x3b6e8e['as'],'attributes':_0x3b6e8e['attributes'],'include':_0x3b6e8e[_0x8129('0x20')]?_[_0x8129('0x1f')](_0x3b6e8e[_0x8129('0x20')],function(_0x4b57f0){return{'model':db[_0x4b57f0['model']],'as':_0x4b57f0['as'],'attributes':_0x4b57f0[_0x8129('0x1e')],'include':_0x4b57f0[_0x8129('0x20')]?_['map'](_0x4b57f0[_0x8129('0x20')],function(_0x467162){return{'model':db[_0x467162['model']],'as':_0x467162['as'],'attributes':_0x467162[_0x8129('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8129('0x22')](function(_0x4a956f){logger[_0x8129('0xf')](_0x8129('0x23'),_0x1ac697);logger[_0x8129('0x10')](_0x8129('0x23'),_0x1ac697,JSON[_0x8129('0x13')](_0x4a956f));_0x22c68d(_0x4a956f);})[_0x8129('0x18')](function(_0x3708e3){logger[_0x8129('0x14')](_0x8129('0x23'),_0x3708e3[_0x8129('0x16')],_0x1ac697);_0x1b419c(_0x4b96a6[_0x8129('0x14')](0x1f4,_0x3708e3['message']));});});}; \ No newline at end of file +var _0x9973=['VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','include','model','map','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./voiceExtension.socket','register','request','then','info'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x9973,0x157));var _0x3997=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9973[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x3997('0x0'));var moment=require(_0x3997('0x1'));var BPromise=require('bluebird');var rs=require(_0x3997('0x2'));var fs=require('fs');var Redis=require(_0x3997('0x3'));var db=require(_0x3997('0x4'))['db'];var utils=require(_0x3997('0x5'));var logger=require(_0x3997('0x6'))(_0x3997('0x7'));var config=require(_0x3997('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3997('0x9')]({'port':0x232a});config[_0x3997('0xa')]=_[_0x3997('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3997('0xa')]));require(_0x3997('0xc'))[_0x3997('0xd')](socket);function respondWithRpcPromise(_0xaa5f42,_0x96da4b,_0x2290df){return new BPromise(function(_0x6ec837,_0x1d166e){return client[_0x3997('0xe')](_0xaa5f42,_0x2290df)[_0x3997('0xf')](function(_0x140b13){logger[_0x3997('0x10')](_0x3997('0x11'),_0x96da4b,_0x3997('0x12'));logger[_0x3997('0x13')](_0x3997('0x14'),_0x96da4b,_0x3997('0x12'),JSON[_0x3997('0x15')](_0x140b13));if(_0x140b13[_0x3997('0x16')]){if(_0x140b13[_0x3997('0x16')][_0x3997('0x17')]===0x1f4){logger[_0x3997('0x16')](_0x3997('0x11'),_0x96da4b,_0x140b13['error'][_0x3997('0x18')]);return _0x1d166e(_0x140b13[_0x3997('0x16')][_0x3997('0x18')]);}logger[_0x3997('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x96da4b,_0x140b13[_0x3997('0x16')][_0x3997('0x18')]);return _0x6ec837(_0x140b13['error']['message']);}else{logger[_0x3997('0x10')](_0x3997('0x11'),_0x96da4b,'request\x20sent');_0x6ec837(_0x140b13[_0x3997('0x19')][_0x3997('0x18')]);}})[_0x3997('0x1a')](function(_0x122130){logger[_0x3997('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x96da4b,_0x122130);_0x1d166e(_0x122130);});});}exports[_0x3997('0x1b')]=function(_0x3631ef){var _0x16cb82=this;return new Promise(function(_0x541832,_0x20caab){return db[_0x3997('0x1c')]['findAll']({'raw':_0x3631ef[_0x3997('0x1d')]?_0x3631ef[_0x3997('0x1d')][_0x3997('0x1e')]===undefined?!![]:![]:!![],'where':_0x3631ef['options']?_0x3631ef['options'][_0x3997('0x1f')]||null:null,'attributes':_0x3631ef[_0x3997('0x1d')]?_0x3631ef[_0x3997('0x1d')][_0x3997('0x20')]||null:null,'limit':_0x3631ef['options']?_0x3631ef[_0x3997('0x1d')]['limit']||null:null,'include':_0x3631ef['options']?_0x3631ef[_0x3997('0x1d')][_0x3997('0x21')]?_['map'](_0x3631ef['options'][_0x3997('0x21')],function(_0xe3e7b6){return{'model':db[_0xe3e7b6[_0x3997('0x22')]],'as':_0xe3e7b6['as'],'attributes':_0xe3e7b6['attributes'],'include':_0xe3e7b6['include']?_['map'](_0xe3e7b6[_0x3997('0x21')],function(_0x124022){return{'model':db[_0x124022[_0x3997('0x22')]],'as':_0x124022['as'],'attributes':_0x124022[_0x3997('0x20')],'include':_0x124022[_0x3997('0x21')]?_[_0x3997('0x23')](_0x124022['include'],function(_0x5ad688){return{'model':db[_0x5ad688[_0x3997('0x22')]],'as':_0x5ad688['as'],'attributes':_0x5ad688[_0x3997('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cec57){logger[_0x3997('0x10')](_0x3997('0x1b'),_0x3631ef);logger[_0x3997('0x13')](_0x3997('0x1b'),_0x3631ef,JSON[_0x3997('0x15')](_0x2cec57));_0x541832(_0x2cec57);})['catch'](function(_0x24fdf2){logger[_0x3997('0x16')](_0x3997('0x1b'),_0x24fdf2[_0x3997('0x18')],_0x3631ef);_0x20caab(_0x16cb82[_0x3997('0x16')](0x1f4,_0x24fdf2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 6630c02..47f3d12 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x1a8d45,_0x3b7c68){var _0x58f047=function(_0x5ada74){while(--_0x5ada74){_0x1a8d45['push'](_0x1a8d45['shift']());}};_0x58f047(++_0x3b7c68);}(_0x326f,0xd1));var _0xf326=function(_0x440e21,_0x16d31b){_0x440e21=_0x440e21-0x0;var _0x12cfb1=_0x326f[_0x440e21];return _0x12cfb1;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x51593c,_0x5780bf){var _0x5b8a5a=function(_0x3db017){while(--_0x3db017){_0x51593c['push'](_0x51593c['shift']());}};_0x5b8a5a(++_0x5780bf);}(_0xf494,0x1c6));var _0x4f49=function(_0x574c8d,_0xfb6ce0){_0x574c8d=_0x574c8d-0x0;var _0x5a263f=_0xf494[_0x574c8d];return _0x5a263f;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 5ca3f9d..de024a3 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 _0x68b3=['index','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5e503b,_0x3c6023){var _0x472bf2=function(_0x5beabd){while(--_0x5beabd){_0x5e503b['push'](_0x5e503b['shift']());}};_0x472bf2(++_0x3c6023);}(_0x68b3,0x1d8));var _0x368b=function(_0x6b445e,_0x2c634c){_0x6b445e=_0x6b445e-0x0;var _0x4e299b=_0x68b3[_0x6b445e];return _0x4e299b;};'use strict';var multer=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var path=require(_0x368b('0x2'));var timeout=require(_0x368b('0x3'));var express=require(_0x368b('0x4'));var router=express['Router']();var fs_extra=require(_0x368b('0x5'));var auth=require(_0x368b('0x6'));var interaction=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var controller=require('./voiceMail.controller');router[_0x368b('0x9')]('/',auth[_0x368b('0xa')](),controller[_0x368b('0xb')]);router[_0x368b('0x9')](_0x368b('0xc'),auth[_0x368b('0xa')](),controller[_0x368b('0xd')]);router[_0x368b('0x9')](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0xf')]);router['post']('/',auth[_0x368b('0xa')](),controller[_0x368b('0x10')]);router[_0x368b('0x11')]('/:id',auth[_0x368b('0xa')](),controller[_0x368b('0x12')]);router[_0x368b('0x13')]('/:id',auth[_0x368b('0xa')](),controller[_0x368b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6a55=['isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','express','../../components/auth/service','../../config/environment','get'];(function(_0x29f82c,_0x5a6380){var _0x58a330=function(_0x1a4e82){while(--_0x1a4e82){_0x29f82c['push'](_0x29f82c['shift']());}};_0x58a330(++_0x5a6380);}(_0x6a55,0xdb));var _0x56a5=function(_0x14490c,_0x50e8ab){_0x14490c=_0x14490c-0x0;var _0x2f6825=_0x6a55[_0x14490c];return _0x2f6825;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x56a5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x56a5('0x3'));var controller=require('./voiceMail.controller');router[_0x56a5('0x4')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x6')]);router[_0x56a5('0x4')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x4')]('/:id/messages',auth[_0x56a5('0x5')](),controller[_0x56a5('0x9')]);router[_0x56a5('0xa')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0xb')]);router[_0x56a5('0xc')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xd')]);router['delete']('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0xe')]);module[_0x56a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 631a45d..18d4fff 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 _0x5811=['STRING','from-voicemail','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','exports'];(function(_0x173bf4,_0x267601){var _0x2ddb68=function(_0x4d6293){while(--_0x4d6293){_0x173bf4['push'](_0x173bf4['shift']());}};_0x2ddb68(++_0x267601);}(_0x5811,0x1bf));var _0x1581=function(_0x56acd3,_0x1b1121){_0x56acd3=_0x56acd3-0x0;var _0x1bfeb9=_0x5811[_0x56acd3];return _0x1bfeb9;};'use strict';var Sequelize=require('sequelize');module[_0x1581('0x0')]={'customer_id':{'type':Sequelize[_0x1581('0x1')]},'context':{'type':Sequelize[_0x1581('0x1')],'defaultValue':_0x1581('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x1581('0x1')]},'fullname':{'type':Sequelize[_0x1581('0x1')]},'email':{'type':Sequelize[_0x1581('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4749d1){this[_0x1581('0x3')](_0x1581('0x4'),typeof _0x4749d1===_0x1581('0x5')&&_0x4749d1[_0x1581('0x6')]()?_0x4749d1[_0x1581('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x1581('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x1581('0x7')](_0x1581('0x8'),'no'),'defaultValue':_0x1581('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1581('0x7')](_0x1581('0x8'),'no'),'defaultValue':_0x1581('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x1581('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x1581('0x7')](_0x1581('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1581('0x7')](_0x1581('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x1581('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1581('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x1581('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1581('0x7')](_0x1581('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x1581('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x1581('0x7')](_0x1581('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x1581('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1581('0x7')](_0x1581('0x8'),'no'),'defaultValue':_0x1581('0x8'),'allowNull':![]},'stamp':{'type':_0x1581('0xa')},'emailsubject':{'type':Sequelize[_0x1581('0x1')]},'emailbody':{'type':Sequelize[_0x1581('0x1')]},'maxsecs':{'type':Sequelize[_0x1581('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1581('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1581('0xc')],'get':function(){return this[_0x1581('0xd')](_0x1581('0xe'))+'\x20-\x20'+this['getDataValue'](_0x1581('0xf'));}}}; \ No newline at end of file +var _0x32a9=['ENUM','TINYINT(4)','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','string','trim','central','yes'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x32a9,0x9d));var _0x932a=function(_0xabbfc7,_0x33d449){_0xabbfc7=_0xabbfc7-0x0;var _0x2a2a62=_0x32a9[_0xabbfc7];return _0x2a2a62;};'use strict';var Sequelize=require('sequelize');module[_0x932a('0x0')]={'customer_id':{'type':Sequelize[_0x932a('0x1')]},'context':{'type':Sequelize[_0x932a('0x1')],'defaultValue':_0x932a('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x932a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x932a('0x3')},'password':{'type':Sequelize[_0x932a('0x1')]},'fullname':{'type':Sequelize[_0x932a('0x1')]},'email':{'type':Sequelize[_0x932a('0x1')],'validate':{'isEmail':!![]},'set':function(_0x8ddd55){this['setDataValue']('email',typeof _0x8ddd55===_0x932a('0x4')&&_0x8ddd55[_0x932a('0x5')]()?_0x8ddd55[_0x932a('0x5')]():null);}},'pager':{'type':Sequelize[_0x932a('0x1')]},'tz':{'type':Sequelize[_0x932a('0x1')],'defaultValue':_0x932a('0x6')},'attach':{'type':Sequelize['ENUM'](_0x932a('0x7'),'no'),'defaultValue':_0x932a('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x932a('0x8')](_0x932a('0x7'),'no'),'defaultValue':_0x932a('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x932a('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x932a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x932a('0x8')](_0x932a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x932a('0x8')](_0x932a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x932a('0x8')](_0x932a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x932a('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x932a('0x8')](_0x932a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x932a('0x8')](_0x932a('0x7'),'no'),'defaultValue':_0x932a('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x932a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x932a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x932a('0x8')](_0x932a('0x7'),'no'),'defaultValue':_0x932a('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x932a('0x1')]},'emailbody':{'type':Sequelize[_0x932a('0x1')]},'maxsecs':{'type':Sequelize[_0x932a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x932a('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x932a('0xb')],'get':function(){return this['getDataValue'](_0x932a('0xc'))+'\x20-\x20'+this[_0x932a('0xd')](_0x932a('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index bb0cd3f..1605acb 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 _0xe5b5=['stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','filter','where','merge','options','VoiceMail','includeAll','include','findAll','catch','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMessages','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe5b5[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310f71,_0x18434e){_0x18434e=_0x18434e||0xcc;return function(_0x4559a0){if(_0x4559a0){return _0x310f71[_0x5e5b('0x1b')](_0x18434e);}return _0x310f71[_0x5e5b('0x1c')](_0x18434e)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x2e331d,_0x49edd0){_0x49edd0=_0x49edd0||0xc8;return function(_0x2b37fa){if(_0x2b37fa){return _0x2e331d[_0x5e5b('0x1c')](_0x49edd0)['json'](_0x2b37fa);}};}function respondWithFilteredResult(_0x227417,_0x578c14){return function(_0x4e9509){if(_0x4e9509){var _0x13a1cb=typeof _0x578c14[_0x5e5b('0x1e')]===_0x5e5b('0x1f')&&typeof _0x578c14['limit']===_0x5e5b('0x1f');var _0x4d490c=_0x4e9509[_0x5e5b('0x20')];var _0x45a091=_0x13a1cb?0x0:_0x578c14['offset'];var _0xe5aa6b=_0x13a1cb?_0x4e9509[_0x5e5b('0x20')]:_0x578c14[_0x5e5b('0x1e')]+_0x578c14['limit'];var _0x2bf0b7;if(_0xe5aa6b>=_0x4d490c){_0xe5aa6b=_0x4d490c;_0x2bf0b7=0xc8;}else{_0x2bf0b7=0xce;}_0x227417[_0x5e5b('0x1c')](_0x2bf0b7);return _0x227417['set'](_0x5e5b('0x21'),_0x45a091+'-'+_0xe5aa6b+'/'+_0x4d490c)[_0x5e5b('0x22')](_0x4e9509);}return null;};}function patchUpdates(_0x3c488e){return function(_0x2d8252){try{jsonpatch[_0x5e5b('0x23')](_0x2d8252,_0x3c488e,!![]);}catch(_0x33d61b){return BPromise[_0x5e5b('0x24')](_0x33d61b);}return _0x2d8252[_0x5e5b('0x25')]();};}function saveUpdates(_0x4a78e3,_0x512e46){return function(_0x256a00){if(_0x256a00){return _0x256a00[_0x5e5b('0x26')](_0x4a78e3)[_0x5e5b('0x27')](function(_0xe1c268){return _0xe1c268;});}return null;};}function removeEntity(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(_0x135c6c){return _0x135c6c[_0x5e5b('0x28')]()[_0x5e5b('0x27')](function(){var _0x26bc02=_0x135c6c[_0x5e5b('0x29')]({'plain':!![]});var _0x4da321=_0x5e5b('0x2a');return db[_0x5e5b('0x2b')][_0x5e5b('0x28')]({'where':{'type':_0x4da321,'resourceId':_0x26bc02['id']}})['then'](function(){return _0x135c6c;});})[_0x5e5b('0x27')](function(){_0x2e38ed[_0x5e5b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ff91,_0x21c74b){return function(_0x39ce16){if(!_0x39ce16){_0x13ff91[_0x5e5b('0x1b')](0x194);}return _0x39ce16;};}function handleError(_0x31af09,_0x250fbd){_0x250fbd=_0x250fbd||0x1f4;return function(_0x2cb695){logger[_0x5e5b('0x2c')](_0x2cb695[_0x5e5b('0x2d')]);if(_0x2cb695[_0x5e5b('0x2e')]){delete _0x2cb695[_0x5e5b('0x2e')];}_0x31af09[_0x5e5b('0x1c')](_0x250fbd)['send'](_0x2cb695);};}exports['index']=function(_0x365f6f,_0x289f54){var _0xb68419={},_0x3dcdab={},_0x12f1ee={'count':0x0,'rows':[]};var _0x4b9be8=_[_0x5e5b('0x2f')](db['VoiceMail'][_0x5e5b('0x30')],function(_0x384d8f){return{'name':_0x384d8f[_0x5e5b('0x31')],'type':_0x384d8f[_0x5e5b('0x32')]['key']};});_0x3dcdab[_0x5e5b('0x33')]=_[_0x5e5b('0x2f')](_0x4b9be8,'name');_0x3dcdab[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x365f6f[_0x5e5b('0x34')]);_0x3dcdab[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x3dcdab[_0x5e5b('0x33')],_0x3dcdab[_0x5e5b('0x34')]);_0xb68419[_0x5e5b('0x38')]=_['intersection'](_0x3dcdab[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x39')]));_0xb68419[_0x5e5b('0x38')]=_0xb68419[_0x5e5b('0x38')]['length']?_0xb68419['attributes']:_0x3dcdab[_0x5e5b('0x33')];if(!_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0xb68419[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0xb68419['offset']=qs[_0x5e5b('0x1e')](_0x365f6f[_0x5e5b('0x34')]['offset']);}_0xb68419['order']=qs[_0x5e5b('0x3c')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3c')]);_0xb68419['where']=qs[_0x5e5b('0x36')](_['pick'](_0x365f6f['query'],_0x3dcdab[_0x5e5b('0x36')]),_0x4b9be8);if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0xb68419[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0xb68419[_0x5e5b('0x3e')],{'$or':_[_0x5e5b('0x2f')](_0x4b9be8,function(_0x14ac35){if(_0x14ac35[_0x5e5b('0x32')]!=='VIRTUAL'){var _0x1f1907={};_0x1f1907[_0x14ac35[_0x5e5b('0x2e')]]={'$like':'%'+_0x365f6f['query'][_0x5e5b('0x3d')]+'%'};return _0x1f1907;}})});}_0xb68419=_['merge']({},_0xb68419,_0x365f6f[_0x5e5b('0x40')]);var _0x14b152={'where':_0xb68419[_0x5e5b('0x3e')]};return db[_0x5e5b('0x41')][_0x5e5b('0x20')](_0x14b152)[_0x5e5b('0x27')](function(_0x371550){_0x12f1ee[_0x5e5b('0x20')]=_0x371550;if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0xb68419[_0x5e5b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x5e5b('0x44')](_0xb68419);})[_0x5e5b('0x27')](function(_0x46fec9){_0x12f1ee['rows']=_0x46fec9;return _0x12f1ee;})[_0x5e5b('0x27')](respondWithFilteredResult(_0x289f54,_0xb68419))[_0x5e5b('0x45')](handleError(_0x289f54,null));};exports['show']=function(_0x6672d9,_0x44b7be){var _0x5d3135={'raw':!![],'where':{'id':_0x6672d9['params']['id']}},_0x257bb7={};_0x257bb7['model']=_['keys'](db[_0x5e5b('0x41')]['rawAttributes']);_0x257bb7[_0x5e5b('0x34')]=_['keys'](_0x6672d9[_0x5e5b('0x34')]);_0x257bb7[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x257bb7[_0x5e5b('0x33')],_0x257bb7[_0x5e5b('0x34')]);_0x5d3135[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x257bb7['model'],qs['fields'](_0x6672d9[_0x5e5b('0x34')]['fields']));_0x5d3135['attributes']=_0x5d3135['attributes'][_0x5e5b('0x46')]?_0x5d3135['attributes']:_0x257bb7[_0x5e5b('0x33')];if(_0x6672d9[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0x5d3135[_0x5e5b('0x43')]=[{'all':!![]}];}_0x5d3135=_[_0x5e5b('0x3f')]({},_0x5d3135,_0x6672d9[_0x5e5b('0x40')]);return db['VoiceMail'][_0x5e5b('0x47')](_0x5d3135)[_0x5e5b('0x27')](handleEntityNotFound(_0x44b7be,null))['then'](respondWithResult(_0x44b7be,null))[_0x5e5b('0x45')](handleError(_0x44b7be,null));};exports['create']=function(_0x41e4b3,_0x36d8fa){return db[_0x5e5b('0x41')][_0x5e5b('0x48')](_0x41e4b3['body'],{})[_0x5e5b('0x27')](function(_0x1c4efe){var _0x4f4ea3=_0x41e4b3[_0x5e5b('0x49')][_0x5e5b('0x29')]({'plain':!![]});if(!_0x4f4ea3)throw new Error(_0x5e5b('0x4a'));if(_0x4f4ea3[_0x5e5b('0x4b')]===_0x5e5b('0x49')){var _0x5ae8d0=_0x1c4efe['get']({'plain':!![]});var _0x690f8c=_0x5e5b('0x2a');return db['UserProfileSection'][_0x5e5b('0x47')]({'where':{'name':_0x690f8c,'userProfileId':_0x4f4ea3[_0x5e5b('0x4c')]},'raw':!![]})[_0x5e5b('0x27')](function(_0x5a9eae){if(_0x5a9eae&&_0x5a9eae[_0x5e5b('0x4d')]===0x0){return db[_0x5e5b('0x2b')][_0x5e5b('0x48')]({'name':_0x5ae8d0['name'],'resourceId':_0x5ae8d0['id'],'type':_0x5a9eae[_0x5e5b('0x2e')],'sectionId':_0x5a9eae['id']},{})[_0x5e5b('0x27')](function(){return _0x1c4efe;});}else{return _0x1c4efe;}})[_0x5e5b('0x45')](function(_0x4a4e0f){logger['error'](_0x5e5b('0x4e'),_0x4a4e0f);throw _0x4a4e0f;});}return _0x1c4efe;})['then'](respondWithResult(_0x36d8fa,0xc9))['catch'](handleError(_0x36d8fa,null));};exports[_0x5e5b('0x26')]=function(_0x13eee9,_0x4774ee){if(_0x13eee9['body']['id']){delete _0x13eee9[_0x5e5b('0x4f')]['id'];}return db[_0x5e5b('0x41')][_0x5e5b('0x47')]({'where':{'id':_0x13eee9[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x4774ee,null))[_0x5e5b('0x27')](saveUpdates(_0x13eee9['body'],null))['then'](respondWithResult(_0x4774ee,null))[_0x5e5b('0x45')](handleError(_0x4774ee,null));};exports[_0x5e5b('0x28')]=function(_0x1cc741,_0x357e55){return db['VoiceMail'][_0x5e5b('0x47')]({'where':{'id':_0x1cc741['params']['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x357e55,null))[_0x5e5b('0x27')](removeEntity(_0x357e55,null))[_0x5e5b('0x45')](handleError(_0x357e55,null));};exports[_0x5e5b('0x51')]=function(_0x2d17b0,_0x30b010,_0x275930){return db[_0x5e5b('0x41')]['findOne']({'where':{'id':_0x2d17b0[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x30b010,null))[_0x5e5b('0x27')](function(_0x1aea38){var _0x129026;var _0x5543eb={},_0x2ccee2={};_0x2ccee2[_0x5e5b('0x33')]=_[_0x5e5b('0x35')](db[_0x5e5b('0x52')][_0x5e5b('0x30')]);_0x2ccee2['query']=_[_0x5e5b('0x35')](_0x2d17b0['query']);_0x2ccee2[_0x5e5b('0x36')]=_['intersection'](_0x2ccee2[_0x5e5b('0x33')],_0x2ccee2[_0x5e5b('0x34')]);_0x5543eb[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x2ccee2[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x2d17b0['query'][_0x5e5b('0x39')]));_0x5543eb[_0x5e5b('0x38')]=_0x5543eb[_0x5e5b('0x38')][_0x5e5b('0x46')]?_0x5543eb['attributes']:_0x2ccee2['model'];if(!_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0x5543eb[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0x5543eb[_0x5e5b('0x1e')]=qs['offset'](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x1e')]);}_0x5543eb['order']=qs['sort'](_0x2d17b0['query'][_0x5e5b('0x3c')]);_0x5543eb[_0x5e5b('0x3e')]=qs[_0x5e5b('0x36')](_[_0x5e5b('0x53')](_0x2d17b0[_0x5e5b('0x34')],_0x2ccee2['filters']));if(_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0x5543eb['where']=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'$or':_['map'](_0x5543eb[_0x5e5b('0x38')],function(_0x4fa0db){var _0x454026={};_0x454026[_0x4fa0db]={'$like':'%'+_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]+'%'};return _0x454026;})});}_0x5543eb[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'mailboxuser':_0x1aea38[_0x5e5b('0x54')]});_0x5543eb=_[_0x5e5b('0x3f')]({},_0x5543eb,_0x2d17b0[_0x5e5b('0x40')]);return db[_0x5e5b('0x52')][_0x5e5b('0x55')](_0x5543eb)[_0x5e5b('0x27')](respondWithFilteredResult(_0x30b010,_0x5543eb));})[_0x5e5b('0x45')](handleError(_0x30b010,null));}; \ No newline at end of file +var _0x1be1=['set','Content-Range','apply','reject','save','update','then','get','Voicemails','destroy','sendStatus','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','include','findAll','rows','show','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','length','mailbox','findAndCountAll','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count'];(function(_0x338859,_0x2f4d49){var _0x5583a7=function(_0xd7cf15){while(--_0xd7cf15){_0x338859['push'](_0x338859['shift']());}};_0x5583a7(++_0x2f4d49);}(_0x1be1,0x192));var _0x11be=function(_0x386906,_0x44268d){_0x386906=_0x386906-0x0;var _0x537f09=_0x1be1[_0x386906];return _0x537f09;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];function respondWithStatusCode(_0x4b36c8,_0x3ff31f){_0x3ff31f=_0x3ff31f||0xcc;return function(_0x2dad05){if(_0x2dad05){return _0x4b36c8['sendStatus'](_0x3ff31f);}return _0x4b36c8[_0x11be('0x17')](_0x3ff31f)['end']();};}function respondWithResult(_0x49228e,_0x569842){_0x569842=_0x569842||0xc8;return function(_0x4b6e7e){if(_0x4b6e7e){return _0x49228e['status'](_0x569842)['json'](_0x4b6e7e);}};}function respondWithFilteredResult(_0x588871,_0x2280e2){return function(_0x52bbef){if(_0x52bbef){var _0x31047c=typeof _0x2280e2[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x2280e2[_0x11be('0x1a')]==='undefined';var _0x2ed725=_0x52bbef[_0x11be('0x1b')];var _0x56ab61=_0x31047c?0x0:_0x2280e2[_0x11be('0x18')];var _0xc3263c=_0x31047c?_0x52bbef[_0x11be('0x1b')]:_0x2280e2['offset']+_0x2280e2['limit'];var _0x141391;if(_0xc3263c>=_0x2ed725){_0xc3263c=_0x2ed725;_0x141391=0xc8;}else{_0x141391=0xce;}_0x588871[_0x11be('0x17')](_0x141391);return _0x588871[_0x11be('0x1c')](_0x11be('0x1d'),_0x56ab61+'-'+_0xc3263c+'/'+_0x2ed725)['json'](_0x52bbef);}return null;};}function patchUpdates(_0x12a5bd){return function(_0x45136f){try{jsonpatch[_0x11be('0x1e')](_0x45136f,_0x12a5bd,!![]);}catch(_0x452315){return BPromise[_0x11be('0x1f')](_0x452315);}return _0x45136f[_0x11be('0x20')]();};}function saveUpdates(_0xa944ac,_0x17678d){return function(_0x3aea14){if(_0x3aea14){return _0x3aea14[_0x11be('0x21')](_0xa944ac)['then'](function(_0xfe3737){return _0xfe3737;});}return null;};}function removeEntity(_0x46b7c2,_0x2fe43c){return function(_0x5d1690){if(_0x5d1690){return _0x5d1690['destroy']()[_0x11be('0x22')](function(){var _0x10ce04=_0x5d1690[_0x11be('0x23')]({'plain':!![]});var _0x4cb27f=_0x11be('0x24');return db['UserProfileResource'][_0x11be('0x25')]({'where':{'type':_0x4cb27f,'resourceId':_0x10ce04['id']}})['then'](function(){return _0x5d1690;});})[_0x11be('0x22')](function(){_0x46b7c2[_0x11be('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48029b,_0x28b3a0){return function(_0x1d3b5c){if(!_0x1d3b5c){_0x48029b[_0x11be('0x26')](0x194);}return _0x1d3b5c;};}function handleError(_0x30427b,_0x17c67f){_0x17c67f=_0x17c67f||0x1f4;return function(_0xf5a6ac){logger[_0x11be('0x27')](_0xf5a6ac[_0x11be('0x28')]);if(_0xf5a6ac['name']){delete _0xf5a6ac[_0x11be('0x29')];}_0x30427b['status'](_0x17c67f)[_0x11be('0x2a')](_0xf5a6ac);};}exports[_0x11be('0x2b')]=function(_0x510476,_0x584d4c){var _0x49fd5c={},_0x265fc9={},_0x5e8f9a={'count':0x0,'rows':[]};var _0x66316d=_[_0x11be('0x2c')](db[_0x11be('0x2d')][_0x11be('0x2e')],function(_0x25e214){return{'name':_0x25e214[_0x11be('0x2f')],'type':_0x25e214['type'][_0x11be('0x30')]};});_0x265fc9[_0x11be('0x31')]=_[_0x11be('0x2c')](_0x66316d,_0x11be('0x29'));_0x265fc9[_0x11be('0x32')]=_[_0x11be('0x33')](_0x510476['query']);_0x265fc9[_0x11be('0x34')]=_[_0x11be('0x35')](_0x265fc9[_0x11be('0x31')],_0x265fc9[_0x11be('0x32')]);_0x49fd5c[_0x11be('0x36')]=_['intersection'](_0x265fc9[_0x11be('0x31')],qs[_0x11be('0x37')](_0x510476[_0x11be('0x32')]['fields']));_0x49fd5c[_0x11be('0x36')]=_0x49fd5c['attributes']['length']?_0x49fd5c['attributes']:_0x265fc9['model'];if(!_0x510476[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x49fd5c['limit']=qs[_0x11be('0x1a')](_0x510476[_0x11be('0x32')]['limit']);_0x49fd5c[_0x11be('0x18')]=qs['offset'](_0x510476[_0x11be('0x32')]['offset']);}_0x49fd5c[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x510476[_0x11be('0x32')][_0x11be('0x3b')]);_0x49fd5c['where']=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x510476[_0x11be('0x32')],_0x265fc9[_0x11be('0x34')]),_0x66316d);if(_0x510476['query'][_0x11be('0x3d')]){_0x49fd5c[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x49fd5c[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x66316d,function(_0x1b1aac){if(_0x1b1aac[_0x11be('0x40')]!=='VIRTUAL'){var _0x2618f5={};_0x2618f5[_0x1b1aac[_0x11be('0x29')]]={'$like':'%'+_0x510476['query'][_0x11be('0x3d')]+'%'};return _0x2618f5;}})});}_0x49fd5c=_[_0x11be('0x3f')]({},_0x49fd5c,_0x510476['options']);var _0x30b67a={'where':_0x49fd5c['where']};return db[_0x11be('0x2d')]['count'](_0x30b67a)[_0x11be('0x22')](function(_0x30be21){_0x5e8f9a['count']=_0x30be21;if(_0x510476[_0x11be('0x32')]['includeAll']){_0x49fd5c[_0x11be('0x41')]=[{'all':!![]}];}return db[_0x11be('0x2d')][_0x11be('0x42')](_0x49fd5c);})[_0x11be('0x22')](function(_0x2b847a){_0x5e8f9a[_0x11be('0x43')]=_0x2b847a;return _0x5e8f9a;})[_0x11be('0x22')](respondWithFilteredResult(_0x584d4c,_0x49fd5c))['catch'](handleError(_0x584d4c,null));};exports[_0x11be('0x44')]=function(_0x18cddf,_0x9610a1){var _0x317e2d={'raw':!![],'where':{'id':_0x18cddf['params']['id']}},_0x589ac4={};_0x589ac4['model']=_[_0x11be('0x33')](db['VoiceMail'][_0x11be('0x2e')]);_0x589ac4['query']=_[_0x11be('0x33')](_0x18cddf[_0x11be('0x32')]);_0x589ac4[_0x11be('0x34')]=_[_0x11be('0x35')](_0x589ac4[_0x11be('0x31')],_0x589ac4[_0x11be('0x32')]);_0x317e2d[_0x11be('0x36')]=_['intersection'](_0x589ac4[_0x11be('0x31')],qs['fields'](_0x18cddf[_0x11be('0x32')][_0x11be('0x37')]));_0x317e2d[_0x11be('0x36')]=_0x317e2d['attributes']['length']?_0x317e2d['attributes']:_0x589ac4[_0x11be('0x31')];if(_0x18cddf[_0x11be('0x32')]['includeAll']){_0x317e2d['include']=[{'all':!![]}];}_0x317e2d=_['merge']({},_0x317e2d,_0x18cddf[_0x11be('0x45')]);return db[_0x11be('0x2d')][_0x11be('0x46')](_0x317e2d)[_0x11be('0x22')](handleEntityNotFound(_0x9610a1,null))[_0x11be('0x22')](respondWithResult(_0x9610a1,null))[_0x11be('0x47')](handleError(_0x9610a1,null));};exports[_0x11be('0x48')]=function(_0x3f2070,_0x2ce110){return db[_0x11be('0x2d')][_0x11be('0x48')](_0x3f2070['body'],{})[_0x11be('0x22')](function(_0x29f82f){var _0x534ee7=_0x3f2070['user']['get']({'plain':!![]});if(!_0x534ee7)throw new Error(_0x11be('0x49'));if(_0x534ee7['role']===_0x11be('0x4a')){var _0x1c1626=_0x29f82f[_0x11be('0x23')]({'plain':!![]});var _0x1fb48d=_0x11be('0x24');return db[_0x11be('0x4b')][_0x11be('0x46')]({'where':{'name':_0x1fb48d,'userProfileId':_0x534ee7[_0x11be('0x4c')]},'raw':!![]})[_0x11be('0x22')](function(_0x4c873a){if(_0x4c873a&&_0x4c873a[_0x11be('0x4d')]===0x0){return db['UserProfileResource'][_0x11be('0x48')]({'name':_0x1c1626[_0x11be('0x29')],'resourceId':_0x1c1626['id'],'type':_0x4c873a['name'],'sectionId':_0x4c873a['id']},{})[_0x11be('0x22')](function(){return _0x29f82f;});}else{return _0x29f82f;}})[_0x11be('0x47')](function(_0x4c0e37){logger[_0x11be('0x27')](_0x11be('0x4e'),_0x4c0e37);throw _0x4c0e37;});}return _0x29f82f;})['then'](respondWithResult(_0x2ce110,0xc9))['catch'](handleError(_0x2ce110,null));};exports[_0x11be('0x21')]=function(_0x2886ac,_0x50eeab){if(_0x2886ac['body']['id']){delete _0x2886ac[_0x11be('0x4f')]['id'];}return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x2886ac['params']['id']}})['then'](handleEntityNotFound(_0x50eeab,null))['then'](saveUpdates(_0x2886ac[_0x11be('0x4f')],null))[_0x11be('0x22')](respondWithResult(_0x50eeab,null))[_0x11be('0x47')](handleError(_0x50eeab,null));};exports['destroy']=function(_0x4db963,_0x33409c){return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x4db963[_0x11be('0x50')]['id']}})['then'](handleEntityNotFound(_0x33409c,null))[_0x11be('0x22')](removeEntity(_0x33409c,null))['catch'](handleError(_0x33409c,null));};exports['getMessages']=function(_0x568f20,_0x5aa6bf,_0x1a43df){return db[_0x11be('0x2d')][_0x11be('0x51')]({'where':{'id':_0x568f20[_0x11be('0x50')]['id']}})[_0x11be('0x22')](handleEntityNotFound(_0x5aa6bf,null))[_0x11be('0x22')](function(_0xb97604){var _0x55e79d;var _0x54e52a={},_0x7c1ee5={};_0x7c1ee5[_0x11be('0x31')]=_[_0x11be('0x33')](db[_0x11be('0x52')][_0x11be('0x2e')]);_0x7c1ee5[_0x11be('0x32')]=_[_0x11be('0x33')](_0x568f20[_0x11be('0x32')]);_0x7c1ee5[_0x11be('0x34')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],_0x7c1ee5[_0x11be('0x32')]);_0x54e52a[_0x11be('0x36')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],qs[_0x11be('0x37')](_0x568f20['query']['fields']));_0x54e52a[_0x11be('0x36')]=_0x54e52a[_0x11be('0x36')][_0x11be('0x53')]?_0x54e52a[_0x11be('0x36')]:_0x7c1ee5['model'];if(!_0x568f20[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x54e52a[_0x11be('0x1a')]=qs[_0x11be('0x1a')](_0x568f20[_0x11be('0x32')][_0x11be('0x1a')]);_0x54e52a[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x568f20['query']['offset']);}_0x54e52a[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x568f20['query'][_0x11be('0x3b')]);_0x54e52a[_0x11be('0x3e')]=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x568f20[_0x11be('0x32')],_0x7c1ee5[_0x11be('0x34')]));if(_0x568f20[_0x11be('0x32')]['filter']){_0x54e52a['where']=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x54e52a['attributes'],function(_0x82c02c){var _0x422696={};_0x422696[_0x82c02c]={'$like':'%'+_0x568f20[_0x11be('0x32')][_0x11be('0x3d')]+'%'};return _0x422696;})});}_0x54e52a[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'mailboxuser':_0xb97604[_0x11be('0x54')]});_0x54e52a=_[_0x11be('0x3f')]({},_0x54e52a,_0x568f20[_0x11be('0x45')]);return db[_0x11be('0x52')][_0x11be('0x55')](_0x54e52a)[_0x11be('0x22')](respondWithFilteredResult(_0x5aa6bf,_0x54e52a));})[_0x11be('0x47')](handleError(_0x5aa6bf,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3bb7f54..a9af431 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 _0x06fe=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util'];(function(_0xf60abf,_0x4727f5){var _0xf0a853=function(_0x9536){while(--_0x9536){_0xf60abf['push'](_0xf60abf['shift']());}};_0xf0a853(++_0x4727f5);}(_0x06fe,0xec));var _0xe06f=function(_0xc051b2,_0x3d6d9d){_0xc051b2=_0xc051b2-0x0;var _0x599dc2=_0x06fe[_0xc051b2];return _0x599dc2;};'use strict';var _=require(_0xe06f('0x0'));var util=require(_0xe06f('0x1'));var logger=require(_0xe06f('0x2'))(_0xe06f('0x3'));var moment=require('moment');var BPromise=require(_0xe06f('0x4'));var rp=require(_0xe06f('0x5'));var fs=require('fs');var path=require(_0xe06f('0x6'));var rimraf=require(_0xe06f('0x7'));var config=require(_0xe06f('0x8'));var attributes=require(_0xe06f('0x9'));module[_0xe06f('0xa')]=function(_0xc0e1c5,_0x3e9afb){return _0xc0e1c5[_0xe06f('0xb')](_0xe06f('0xc'),attributes,{'tableName':_0xe06f('0xd'),'paranoid':![],'indexes':[{'name':_0xe06f('0xe'),'fields':[_0xe06f('0xf'),_0xe06f('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc612=['voice_voicemail','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4776cf,_0x3321b0){var _0x42eaa7=function(_0x45dadc){while(--_0x45dadc){_0x4776cf['push'](_0x4776cf['shift']());}};_0x42eaa7(++_0x3321b0);}(_0xc612,0x1e2));var _0x2c61=function(_0x1e2a75,_0x43f28d){_0x1e2a75=_0x1e2a75-0x0;var _0x509036=_0xc612[_0x1e2a75];return _0x509036;};'use strict';var _=require(_0x2c61('0x0'));var util=require(_0x2c61('0x1'));var logger=require(_0x2c61('0x2'))(_0x2c61('0x3'));var moment=require(_0x2c61('0x4'));var BPromise=require(_0x2c61('0x5'));var rp=require(_0x2c61('0x6'));var fs=require('fs');var path=require(_0x2c61('0x7'));var rimraf=require(_0x2c61('0x8'));var config=require(_0x2c61('0x9'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x4ac43a,_0x5a4bca){return _0x4ac43a['define']('VoiceMail',attributes,{'tableName':_0x2c61('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x2c61('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index d475594..be2b7a2 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 _0x0b7f=['client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x46b864,_0x1c7076){var _0x40ca16=function(_0x532886){while(--_0x532886){_0x46b864['push'](_0x46b864['shift']());}};_0x40ca16(++_0x1c7076);}(_0x0b7f,0x91));var _0xf0b7=function(_0x9572ff,_0x188aba){_0x9572ff=_0x9572ff-0x0;var _0x398c8a=_0x0b7f[_0x9572ff];return _0x398c8a;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var moment=require('moment');var BPromise=require(_0xf0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0b7('0x3'));var db=require(_0xf0b7('0x4'))['db'];var utils=require(_0xf0b7('0x5'));var logger=require(_0xf0b7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf0b7('0x7')][_0xf0b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b849e,_0x24c0f4,_0x323d47){return new BPromise(function(_0x47d7ae,_0x2a7b2b){return client['request'](_0x2b849e,_0x323d47)[_0xf0b7('0x9')](function(_0x223632){logger[_0xf0b7('0xa')](_0xf0b7('0xb'),_0x24c0f4,_0xf0b7('0xc'));logger[_0xf0b7('0xd')](_0xf0b7('0xe'),_0x24c0f4,'request\x20sent',JSON[_0xf0b7('0xf')](_0x223632));if(_0x223632['error']){if(_0x223632[_0xf0b7('0x10')]['code']===0x1f4){logger[_0xf0b7('0x10')](_0xf0b7('0xb'),_0x24c0f4,_0x223632[_0xf0b7('0x10')][_0xf0b7('0x11')]);return _0x2a7b2b(_0x223632[_0xf0b7('0x10')][_0xf0b7('0x11')]);}logger[_0xf0b7('0x10')](_0xf0b7('0xb'),_0x24c0f4,_0x223632[_0xf0b7('0x10')][_0xf0b7('0x11')]);return _0x47d7ae(_0x223632[_0xf0b7('0x10')][_0xf0b7('0x11')]);}else{logger[_0xf0b7('0xa')](_0xf0b7('0xb'),_0x24c0f4,_0xf0b7('0xc'));_0x47d7ae(_0x223632[_0xf0b7('0x12')][_0xf0b7('0x11')]);}})['catch'](function(_0xbbb66d){logger[_0xf0b7('0x10')](_0xf0b7('0xb'),_0x24c0f4,_0xbbb66d);_0x2a7b2b(_0xbbb66d);});});} \ No newline at end of file +var _0x173e=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2d96e2,_0x5a5ada){var _0x547a05=function(_0x227e5a){while(--_0x227e5a){_0x2d96e2['push'](_0x2d96e2['shift']());}};_0x547a05(++_0x5a5ada);}(_0x173e,0xae));var _0xe173=function(_0x1b9200,_0x1ba6bf){_0x1b9200=_0x1b9200-0x0;var _0x15d841=_0x173e[_0x1b9200];return _0x15d841;};'use strict';var _=require('lodash');var util=require(_0xe173('0x0'));var moment=require(_0xe173('0x1'));var BPromise=require(_0xe173('0x2'));var rs=require(_0xe173('0x3'));var fs=require('fs');var Redis=require(_0xe173('0x4'));var db=require(_0xe173('0x5'))['db'];var utils=require(_0xe173('0x6'));var logger=require(_0xe173('0x7'))(_0xe173('0x8'));var config=require(_0xe173('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ddc13,_0x5d8d51,_0xcde3e9){return new BPromise(function(_0x108643,_0xfb9434){return client['request'](_0x1ddc13,_0xcde3e9)['then'](function(_0x3146d0){logger['info'](_0xe173('0xa'),_0x5d8d51,_0xe173('0xb'));logger[_0xe173('0xc')](_0xe173('0xd'),_0x5d8d51,_0xe173('0xb'),JSON[_0xe173('0xe')](_0x3146d0));if(_0x3146d0[_0xe173('0xf')]){if(_0x3146d0[_0xe173('0xf')][_0xe173('0x10')]===0x1f4){logger[_0xe173('0xf')](_0xe173('0xa'),_0x5d8d51,_0x3146d0[_0xe173('0xf')][_0xe173('0x11')]);return _0xfb9434(_0x3146d0[_0xe173('0xf')]['message']);}logger[_0xe173('0xf')]('VoiceMail,\x20%s,\x20%s',_0x5d8d51,_0x3146d0[_0xe173('0xf')][_0xe173('0x11')]);return _0x108643(_0x3146d0[_0xe173('0xf')][_0xe173('0x11')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x5d8d51,_0xe173('0xb'));_0x108643(_0x3146d0['result'][_0xe173('0x11')]);}})[_0xe173('0x12')](function(_0x1e9b25){logger[_0xe173('0xf')](_0xe173('0xa'),_0x5d8d51,_0x1e9b25);_0xfb9434(_0x1e9b25);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 918f2e6..2fd48ea 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 _0xfc7a=['delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','post','put','update'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xfc7a,0x10c));var _0xafc7=function(_0x13211b,_0x3050c2){_0x13211b=_0x13211b-0x0;var _0x4adb44=_0xfc7a[_0x13211b];return _0x4adb44;};'use strict';var multer=require('multer');var util=require(_0xafc7('0x0'));var path=require(_0xafc7('0x1'));var timeout=require('connect-timeout');var express=require(_0xafc7('0x2'));var router=express[_0xafc7('0x3')]();var fs_extra=require(_0xafc7('0x4'));var auth=require(_0xafc7('0x5'));var interaction=require(_0xafc7('0x6'));var config=require(_0xafc7('0x7'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0xafc7('0x8')](),controller[_0xafc7('0x9')]);router[_0xafc7('0xa')](_0xafc7('0xb'),auth[_0xafc7('0x8')](),controller[_0xafc7('0xc')]);router['get'](_0xafc7('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xafc7('0xe')]('/',auth[_0xafc7('0x8')](),controller['create']);router[_0xafc7('0xf')]('/:id',auth[_0xafc7('0x8')](),controller[_0xafc7('0x10')]);router[_0xafc7('0x11')](_0xafc7('0xb'),auth['isAuthenticated'](),controller[_0xafc7('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6c1b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','path','connect-timeout','express','Router'];(function(_0x5bd6ac,_0x1a1eac){var _0x5b8e82=function(_0x59bcbd){while(--_0x59bcbd){_0x5bd6ac['push'](_0x5bd6ac['shift']());}};_0x5b8e82(++_0x1a1eac);}(_0x6c1b,0x152));var _0xb6c1=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0x6c1b[_0x21ecc8];return _0x510c1d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb6c1('0x0'));var timeout=require(_0xb6c1('0x1'));var express=require(_0xb6c1('0x2'));var router=express[_0xb6c1('0x3')]();var fs_extra=require(_0xb6c1('0x4'));var auth=require(_0xb6c1('0x5'));var interaction=require(_0xb6c1('0x6'));var config=require(_0xb6c1('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xb6c1('0x8')]('/',auth[_0xb6c1('0x9')](),controller['index']);router[_0xb6c1('0x8')](_0xb6c1('0xa'),auth[_0xb6c1('0x9')](),controller[_0xb6c1('0xb')]);router[_0xb6c1('0x8')](_0xb6c1('0xc'),auth['isAuthenticated'](),controller[_0xb6c1('0xd')]);router[_0xb6c1('0xe')]('/',auth[_0xb6c1('0x9')](),controller[_0xb6c1('0xf')]);router[_0xb6c1('0x10')]('/:id',auth[_0xb6c1('0x9')](),controller[_0xb6c1('0x11')]);router[_0xb6c1('0x12')](_0xb6c1('0xa'),auth['isAuthenticated'](),controller['destroy']);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 46d4db2..236a283 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 _0xb67d=['long','TIMESTAMP','literal','exports','VIRTUAL','INTEGER','STRING','BLOB'];(function(_0x543bc5,_0x34c1f4){var _0x39b538=function(_0x8c5a0){while(--_0x8c5a0){_0x543bc5['push'](_0x543bc5['shift']());}};_0x39b538(++_0x34c1f4);}(_0xb67d,0xdb));var _0xdb67=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb67d[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xdb67('0x0')]={'name':{'type':Sequelize[_0xdb67('0x1')],'get':function(_0x201ef5){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xdb67('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xdb67('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xdb67('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xdb67('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xdb67('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xdb67('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xdb67('0x4')](_0xdb67('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xdb67('0x6'),'defaultValue':Sequelize[_0xdb67('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x8915=['BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8915,0xdc));var _0x5891=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x8915[_0x52f1e6];return _0x21f104;};'use strict';var Sequelize=require(_0x5891('0x0'));module['exports']={'name':{'type':Sequelize[_0x5891('0x1')],'get':function(_0x1054b0){return this[_0x5891('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x5891('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x5891('0x5')](_0x5891('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5891('0x4')],'defaultValue':''},'stamp':{'type':_0x5891('0x7'),'defaultValue':Sequelize['literal'](_0x5891('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 1b2d391..3835038 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 _0x843a=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','differenceBy','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','download','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','.wav\x22','recording','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x2b3e1c,_0xc434b2){var _0x316f38=function(_0x4be538){while(--_0x4be538){_0x2b3e1c['push'](_0x2b3e1c['shift']());}};_0x316f38(++_0xc434b2);}(_0x843a,0x101));var _0xa843=function(_0x3428c7,_0xd73f31){_0x3428c7=_0x3428c7-0x0;var _0x22cefb=_0x843a[_0x3428c7];return _0x22cefb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa843('0x0'));var zipdir=require(_0xa843('0x1'));var jsonpatch=require(_0xa843('0x2'));var rp=require(_0xa843('0x3'));var moment=require(_0xa843('0x4'));var BPromise=require(_0xa843('0x5'));var Mustache=require(_0xa843('0x6'));var util=require('util');var path=require(_0xa843('0x7'));var sox=require('sox');var csv=require(_0xa843('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa843('0x9'));var _=require(_0xa843('0xa'));var squel=require(_0xa843('0xb'));var crypto=require(_0xa843('0xc'));var jsforce=require(_0xa843('0xd'));var deskjs=require(_0xa843('0xe'));var toCsv=require(_0xa843('0x8'));var querystring=require(_0xa843('0xf'));var Papa=require(_0xa843('0x10'));var Redis=require(_0xa843('0x11'));var authService=require(_0xa843('0x12'));var qs=require(_0xa843('0x13'));var as=require(_0xa843('0x14'));var hardwareService=require(_0xa843('0x15'));var logger=require(_0xa843('0x16'))(_0xa843('0x17'));var utils=require(_0xa843('0x18'));var config=require(_0xa843('0x19'));var licenseUtil=require(_0xa843('0x1a'));var db=require(_0xa843('0x1b'))['db'];function respondWithStatusCode(_0x463a5b,_0x15c9c6){_0x15c9c6=_0x15c9c6||0xcc;return function(_0x2aef1d){if(_0x2aef1d){return _0x463a5b[_0xa843('0x1c')](_0x15c9c6);}return _0x463a5b[_0xa843('0x1d')](_0x15c9c6)[_0xa843('0x1e')]();};}function respondWithResult(_0x345e61,_0xe211f){_0xe211f=_0xe211f||0xc8;return function(_0x56c17b){if(_0x56c17b){return _0x345e61[_0xa843('0x1d')](_0xe211f)[_0xa843('0x1f')](_0x56c17b);}};}function respondWithFilteredResult(_0x304869,_0x91bf8a){return function(_0x9771d5){if(_0x9771d5){var _0x18b6d2=typeof _0x91bf8a[_0xa843('0x20')]==='undefined'&&typeof _0x91bf8a[_0xa843('0x21')]===_0xa843('0x22');var _0x55cfde=_0x9771d5[_0xa843('0x23')];var _0x265635=_0x18b6d2?0x0:_0x91bf8a[_0xa843('0x20')];var _0x298a4f=_0x18b6d2?_0x9771d5[_0xa843('0x23')]:_0x91bf8a[_0xa843('0x20')]+_0x91bf8a[_0xa843('0x21')];var _0x213f12;if(_0x298a4f>=_0x55cfde){_0x298a4f=_0x55cfde;_0x213f12=0xc8;}else{_0x213f12=0xce;}_0x304869[_0xa843('0x1d')](_0x213f12);return _0x304869[_0xa843('0x24')]('Content-Range',_0x265635+'-'+_0x298a4f+'/'+_0x55cfde)['json'](_0x9771d5);}return null;};}function patchUpdates(_0x34f76e){return function(_0x3e0939){try{jsonpatch[_0xa843('0x25')](_0x3e0939,_0x34f76e,!![]);}catch(_0x1ee9fa){return BPromise[_0xa843('0x26')](_0x1ee9fa);}return _0x3e0939[_0xa843('0x27')]();};}function saveUpdates(_0x25d92e,_0x158179){return function(_0x28adcb){if(_0x28adcb){return _0x28adcb[_0xa843('0x28')](_0x25d92e)[_0xa843('0x29')](function(_0x570c9c){return _0x570c9c;});}return null;};}function removeEntity(_0x5a09cd,_0x5456c0){return function(_0x4cbb1d){if(_0x4cbb1d){return _0x4cbb1d[_0xa843('0x2a')]()['then'](function(){_0x5a09cd[_0xa843('0x1d')](0xcc)[_0xa843('0x1e')]();});}};}function handleEntityNotFound(_0xa15b0a,_0x2707bb){return function(_0x563d24){if(!_0x563d24){_0xa15b0a[_0xa843('0x1c')](0x194);}return _0x563d24;};}function handleError(_0x49b396,_0x58a12b){_0x58a12b=_0x58a12b||0x1f4;return function(_0xcbf8e7){logger[_0xa843('0x2b')](_0xcbf8e7[_0xa843('0x2c')]);if(_0xcbf8e7[_0xa843('0x2d')]){delete _0xcbf8e7[_0xa843('0x2d')];}_0x49b396[_0xa843('0x1d')](_0x58a12b)[_0xa843('0x2e')](_0xcbf8e7);};}exports[_0xa843('0x2f')]=function(_0x1a4d7a,_0x20f2ee){var _0x4b65bd={},_0x64a640={},_0x91a35d={'count':0x0,'rows':[]};var _0x59fe26=_[_0xa843('0x30')](db[_0xa843('0x31')]['rawAttributes'],function(_0x9c205f){return{'name':_0x9c205f[_0xa843('0x32')],'type':_0x9c205f[_0xa843('0x33')][_0xa843('0x34')]};});_0x64a640['model']=_[_0xa843('0x35')](_[_0xa843('0x30')](_0x59fe26,'name'),[_0xa843('0x2d')]);_0x64a640[_0xa843('0x36')]=_[_0xa843('0x37')](_0x1a4d7a['query']);_0x64a640['filters']=_['intersection'](_0x64a640[_0xa843('0x38')],_0x64a640['query']);_0x4b65bd[_0xa843('0x39')]=_[_0xa843('0x3a')](_0x64a640['model'],qs[_0xa843('0x3b')](_0x1a4d7a[_0xa843('0x36')]['fields']));_0x4b65bd[_0xa843('0x39')]=_0x4b65bd[_0xa843('0x39')][_0xa843('0x3c')]?_0x4b65bd[_0xa843('0x39')]:_0x64a640[_0xa843('0x38')];if(!_0x1a4d7a[_0xa843('0x36')][_0xa843('0x3d')]('nolimit')){_0x4b65bd[_0xa843('0x21')]=qs[_0xa843('0x21')](_0x1a4d7a[_0xa843('0x36')]['limit']);_0x4b65bd[_0xa843('0x20')]=qs['offset'](_0x1a4d7a[_0xa843('0x36')]['offset']);}_0x4b65bd['order']=qs[_0xa843('0x3e')](_0x1a4d7a['query'][_0xa843('0x3e')]);_0x4b65bd[_0xa843('0x3f')]=qs[_0xa843('0x40')](_[_0xa843('0x41')](_0x1a4d7a[_0xa843('0x36')],_0x64a640[_0xa843('0x40')]),_0x59fe26);if(_0x1a4d7a[_0xa843('0x36')][_0xa843('0x42')]){_0x4b65bd[_0xa843('0x3f')]=_[_0xa843('0x43')](_0x4b65bd[_0xa843('0x3f')],{'$or':_[_0xa843('0x30')](_0x59fe26,function(_0x630203){if(_0x630203[_0xa843('0x33')]!==_0xa843('0x44')){var _0x1e573d={};_0x1e573d[_0x630203[_0xa843('0x2d')]]={'$like':'%'+_0x1a4d7a['query'][_0xa843('0x42')]+'%'};return _0x1e573d;}})});}_0x4b65bd=_['merge']({},_0x4b65bd,_0x1a4d7a[_0xa843('0x45')]);var _0x3a7930={'where':_0x4b65bd[_0xa843('0x3f')]};return db[_0xa843('0x31')][_0xa843('0x23')](_0x3a7930)[_0xa843('0x29')](function(_0x4570ed){_0x91a35d[_0xa843('0x23')]=_0x4570ed;if(_0x1a4d7a['query'][_0xa843('0x46')]){_0x4b65bd[_0xa843('0x47')]=[{'all':!![]}];}return db[_0xa843('0x31')][_0xa843('0x48')](_0x4b65bd);})[_0xa843('0x29')](function(_0x7cd3ef){_0x91a35d[_0xa843('0x49')]=_0x7cd3ef;return _0x91a35d;})['then'](respondWithFilteredResult(_0x20f2ee,_0x4b65bd))[_0xa843('0x4a')](handleError(_0x20f2ee,null));};exports[_0xa843('0x4b')]=function(_0x412541,_0x5e8334){var _0x157e27={'raw':!![],'where':{'id':_0x412541[_0xa843('0x4c')]['id']}},_0x5bbb15={};_0x5bbb15[_0xa843('0x38')]=_['keys'](db[_0xa843('0x31')][_0xa843('0x4d')]);_0x5bbb15[_0xa843('0x36')]=_['keys'](_0x412541[_0xa843('0x36')]);_0x5bbb15['filters']=_[_0xa843('0x3a')](_0x5bbb15[_0xa843('0x38')],_0x5bbb15['query']);_0x157e27[_0xa843('0x39')]=_[_0xa843('0x3a')](_0x5bbb15[_0xa843('0x38')],qs['fields'](_0x412541[_0xa843('0x36')][_0xa843('0x3b')]));_0x157e27[_0xa843('0x39')]=_0x157e27[_0xa843('0x39')][_0xa843('0x3c')]?_0x157e27[_0xa843('0x39')]:_0x5bbb15[_0xa843('0x38')];if(_0x412541[_0xa843('0x36')]['includeAll']){_0x157e27[_0xa843('0x47')]=[{'all':!![]}];}_0x157e27=_[_0xa843('0x43')]({},_0x157e27,_0x412541[_0xa843('0x45')]);return db['VoiceMailMessage'][_0xa843('0x4e')](_0x157e27)[_0xa843('0x29')](handleEntityNotFound(_0x5e8334,null))[_0xa843('0x29')](respondWithResult(_0x5e8334,null))['catch'](handleError(_0x5e8334,null));};exports[_0xa843('0x4f')]=function(_0x53cceb,_0x13638f){return db[_0xa843('0x31')][_0xa843('0x4f')](_0x53cceb['body'],{})[_0xa843('0x29')](respondWithResult(_0x13638f,0xc9))[_0xa843('0x4a')](handleError(_0x13638f,null));};exports[_0xa843('0x28')]=function(_0x566170,_0x18096a){if(_0x566170[_0xa843('0x50')]['id']){delete _0x566170['body']['id'];}return db[_0xa843('0x31')][_0xa843('0x4e')]({'where':{'id':_0x566170[_0xa843('0x4c')]['id']}})[_0xa843('0x29')](handleEntityNotFound(_0x18096a,null))['then'](saveUpdates(_0x566170[_0xa843('0x50')],null))['then'](respondWithResult(_0x18096a,null))[_0xa843('0x4a')](handleError(_0x18096a,null));};exports[_0xa843('0x2a')]=function(_0x4f1956,_0x22841f){return db[_0xa843('0x31')][_0xa843('0x4e')]({'where':{'id':_0x4f1956[_0xa843('0x4c')]['id']}})[_0xa843('0x29')](handleEntityNotFound(_0x22841f,null))[_0xa843('0x29')](removeEntity(_0x22841f,null))['catch'](handleError(_0x22841f,null));};exports[_0xa843('0x51')]=function(_0x45c291,_0x382b05,_0x1ec4b5){return db[_0xa843('0x31')][_0xa843('0x4e')]({'where':{'id':_0x45c291[_0xa843('0x4c')]['id']},'attributes':['id','recording',_0xa843('0x52')]})[_0xa843('0x29')](handleEntityNotFound(_0x382b05,null))['then'](function(_0x4264a8){if(_0x4264a8){if(!_0x4264a8['recording']){throw new db[(_0xa843('0x53'))][(_0xa843('0x54'))](_0xa843('0x55'));}var _0x32c447={'Content-Type':_0xa843('0x56'),'Content-Disposition':'attachment'};if(_0x4264a8[_0xa843('0x52')]){_0x32c447[_0xa843('0x57')]='attachment;\x20filename=\x22'+_0x4264a8['msg_id']+_0xa843('0x58');}_0x382b05['set'](_0x32c447);return _0x382b05[_0xa843('0x2e')](new Buffer(_0x4264a8[_0xa843('0x59')]));}})[_0xa843('0x4a')](handleError(_0x382b05,null));}; \ No newline at end of file +var _0x7732=['key','model','differenceBy','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','recording','msg_id','Sequelize','ValidationError','audio/wav','Content-Disposition','.wav\x22','set','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack','name','VoiceMailMessage','fieldName','type'];(function(_0x2d4c66,_0x92b73b){var _0x8eeedf=function(_0x1c2000){while(--_0x1c2000){_0x2d4c66['push'](_0x2d4c66['shift']());}};_0x8eeedf(++_0x92b73b);}(_0x7732,0x11d));var _0x2773=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x7732[_0x59b439];return _0x521ea3;};'use strict';var emlformat=require(_0x2773('0x0'));var rimraf=require(_0x2773('0x1'));var zipdir=require(_0x2773('0x2'));var jsonpatch=require(_0x2773('0x3'));var rp=require('request-promise');var moment=require(_0x2773('0x4'));var BPromise=require(_0x2773('0x5'));var Mustache=require('mustache');var util=require(_0x2773('0x6'));var path=require(_0x2773('0x7'));var sox=require(_0x2773('0x8'));var csv=require(_0x2773('0x9'));var ejs=require(_0x2773('0xa'));var fs=require('fs');var fs_extra=require(_0x2773('0xb'));var _=require(_0x2773('0xc'));var squel=require(_0x2773('0xd'));var crypto=require(_0x2773('0xe'));var jsforce=require(_0x2773('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2773('0x9'));var querystring=require(_0x2773('0x10'));var Papa=require(_0x2773('0x11'));var Redis=require(_0x2773('0x12'));var authService=require(_0x2773('0x13'));var qs=require(_0x2773('0x14'));var as=require(_0x2773('0x15'));var hardwareService=require(_0x2773('0x16'));var logger=require('../../config/logger')(_0x2773('0x17'));var utils=require(_0x2773('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2773('0x19'));var db=require(_0x2773('0x1a'))['db'];function respondWithStatusCode(_0xf54503,_0x371e6b){_0x371e6b=_0x371e6b||0xcc;return function(_0x2a66f7){if(_0x2a66f7){return _0xf54503['sendStatus'](_0x371e6b);}return _0xf54503['status'](_0x371e6b)['end']();};}function respondWithResult(_0x1541f9,_0x383e58){_0x383e58=_0x383e58||0xc8;return function(_0xcbc5a8){if(_0xcbc5a8){return _0x1541f9[_0x2773('0x1b')](_0x383e58)[_0x2773('0x1c')](_0xcbc5a8);}};}function respondWithFilteredResult(_0x1770a7,_0x23c5b0){return function(_0x4dae7f){if(_0x4dae7f){var _0x37159a=typeof _0x23c5b0['offset']===_0x2773('0x1d')&&typeof _0x23c5b0[_0x2773('0x1e')]==='undefined';var _0x2778b6=_0x4dae7f['count'];var _0xb43b07=_0x37159a?0x0:_0x23c5b0['offset'];var _0x11a1ec=_0x37159a?_0x4dae7f[_0x2773('0x1f')]:_0x23c5b0[_0x2773('0x20')]+_0x23c5b0[_0x2773('0x1e')];var _0x3d4aff;if(_0x11a1ec>=_0x2778b6){_0x11a1ec=_0x2778b6;_0x3d4aff=0xc8;}else{_0x3d4aff=0xce;}_0x1770a7[_0x2773('0x1b')](_0x3d4aff);return _0x1770a7['set'](_0x2773('0x21'),_0xb43b07+'-'+_0x11a1ec+'/'+_0x2778b6)['json'](_0x4dae7f);}return null;};}function patchUpdates(_0x1b3500){return function(_0x337f3c){try{jsonpatch[_0x2773('0x22')](_0x337f3c,_0x1b3500,!![]);}catch(_0x5688a5){return BPromise['reject'](_0x5688a5);}return _0x337f3c[_0x2773('0x23')]();};}function saveUpdates(_0x289928,_0x30d33a){return function(_0x3f9a90){if(_0x3f9a90){return _0x3f9a90[_0x2773('0x24')](_0x289928)['then'](function(_0x23346f){return _0x23346f;});}return null;};}function removeEntity(_0xd0954f,_0xcd31e2){return function(_0x48899e){if(_0x48899e){return _0x48899e[_0x2773('0x25')]()[_0x2773('0x26')](function(){_0xd0954f['status'](0xcc)[_0x2773('0x27')]();});}};}function handleEntityNotFound(_0x28876a,_0x5aa853){return function(_0x344160){if(!_0x344160){_0x28876a[_0x2773('0x28')](0x194);}return _0x344160;};}function handleError(_0x47e027,_0x3ca669){_0x3ca669=_0x3ca669||0x1f4;return function(_0x6f9a96){logger[_0x2773('0x29')](_0x6f9a96[_0x2773('0x2a')]);if(_0x6f9a96[_0x2773('0x2b')]){delete _0x6f9a96[_0x2773('0x2b')];}_0x47e027[_0x2773('0x1b')](_0x3ca669)['send'](_0x6f9a96);};}exports['index']=function(_0x1c2325,_0x18bda4){var _0x45a2dc={},_0x53aeae={},_0x109b9d={'count':0x0,'rows':[]};var _0x10348e=_['map'](db[_0x2773('0x2c')]['rawAttributes'],function(_0x152433){return{'name':_0x152433[_0x2773('0x2d')],'type':_0x152433[_0x2773('0x2e')][_0x2773('0x2f')]};});_0x53aeae[_0x2773('0x30')]=_[_0x2773('0x31')](_[_0x2773('0x32')](_0x10348e,_0x2773('0x2b')),[_0x2773('0x2b')]);_0x53aeae[_0x2773('0x33')]=_['keys'](_0x1c2325[_0x2773('0x33')]);_0x53aeae[_0x2773('0x34')]=_[_0x2773('0x35')](_0x53aeae[_0x2773('0x30')],_0x53aeae[_0x2773('0x33')]);_0x45a2dc[_0x2773('0x36')]=_[_0x2773('0x35')](_0x53aeae[_0x2773('0x30')],qs['fields'](_0x1c2325[_0x2773('0x33')]['fields']));_0x45a2dc[_0x2773('0x36')]=_0x45a2dc[_0x2773('0x36')][_0x2773('0x37')]?_0x45a2dc[_0x2773('0x36')]:_0x53aeae[_0x2773('0x30')];if(!_0x1c2325[_0x2773('0x33')][_0x2773('0x38')](_0x2773('0x39'))){_0x45a2dc[_0x2773('0x1e')]=qs['limit'](_0x1c2325[_0x2773('0x33')][_0x2773('0x1e')]);_0x45a2dc[_0x2773('0x20')]=qs[_0x2773('0x20')](_0x1c2325[_0x2773('0x33')][_0x2773('0x20')]);}_0x45a2dc[_0x2773('0x3a')]=qs[_0x2773('0x3b')](_0x1c2325['query'][_0x2773('0x3b')]);_0x45a2dc['where']=qs['filters'](_['pick'](_0x1c2325[_0x2773('0x33')],_0x53aeae['filters']),_0x10348e);if(_0x1c2325[_0x2773('0x33')]['filter']){_0x45a2dc[_0x2773('0x3c')]=_[_0x2773('0x3d')](_0x45a2dc['where'],{'$or':_[_0x2773('0x32')](_0x10348e,function(_0x24ba88){if(_0x24ba88['type']!==_0x2773('0x3e')){var _0x41352f={};_0x41352f[_0x24ba88[_0x2773('0x2b')]]={'$like':'%'+_0x1c2325[_0x2773('0x33')]['filter']+'%'};return _0x41352f;}})});}_0x45a2dc=_[_0x2773('0x3d')]({},_0x45a2dc,_0x1c2325[_0x2773('0x3f')]);var _0xc8db64={'where':_0x45a2dc[_0x2773('0x3c')]};return db['VoiceMailMessage']['count'](_0xc8db64)[_0x2773('0x26')](function(_0x4f021e){_0x109b9d[_0x2773('0x1f')]=_0x4f021e;if(_0x1c2325[_0x2773('0x33')][_0x2773('0x40')]){_0x45a2dc[_0x2773('0x41')]=[{'all':!![]}];}return db[_0x2773('0x2c')][_0x2773('0x42')](_0x45a2dc);})[_0x2773('0x26')](function(_0x4f6459){_0x109b9d['rows']=_0x4f6459;return _0x109b9d;})[_0x2773('0x26')](respondWithFilteredResult(_0x18bda4,_0x45a2dc))[_0x2773('0x43')](handleError(_0x18bda4,null));};exports['show']=function(_0x274f46,_0x5d5436){var _0x667ad7={'raw':!![],'where':{'id':_0x274f46[_0x2773('0x44')]['id']}},_0x368751={};_0x368751[_0x2773('0x30')]=_[_0x2773('0x45')](db[_0x2773('0x2c')][_0x2773('0x46')]);_0x368751['query']=_[_0x2773('0x45')](_0x274f46[_0x2773('0x33')]);_0x368751[_0x2773('0x34')]=_[_0x2773('0x35')](_0x368751[_0x2773('0x30')],_0x368751[_0x2773('0x33')]);_0x667ad7[_0x2773('0x36')]=_['intersection'](_0x368751[_0x2773('0x30')],qs['fields'](_0x274f46[_0x2773('0x33')]['fields']));_0x667ad7[_0x2773('0x36')]=_0x667ad7[_0x2773('0x36')]['length']?_0x667ad7[_0x2773('0x36')]:_0x368751[_0x2773('0x30')];if(_0x274f46[_0x2773('0x33')][_0x2773('0x40')]){_0x667ad7['include']=[{'all':!![]}];}_0x667ad7=_[_0x2773('0x3d')]({},_0x667ad7,_0x274f46[_0x2773('0x3f')]);return db[_0x2773('0x2c')][_0x2773('0x47')](_0x667ad7)[_0x2773('0x26')](handleEntityNotFound(_0x5d5436,null))[_0x2773('0x26')](respondWithResult(_0x5d5436,null))[_0x2773('0x43')](handleError(_0x5d5436,null));};exports[_0x2773('0x48')]=function(_0x297dc4,_0x58bcb6){return db['VoiceMailMessage']['create'](_0x297dc4[_0x2773('0x49')],{})[_0x2773('0x26')](respondWithResult(_0x58bcb6,0xc9))['catch'](handleError(_0x58bcb6,null));};exports[_0x2773('0x24')]=function(_0x1af667,_0x3d65fd){if(_0x1af667[_0x2773('0x49')]['id']){delete _0x1af667[_0x2773('0x49')]['id'];}return db[_0x2773('0x2c')][_0x2773('0x47')]({'where':{'id':_0x1af667[_0x2773('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d65fd,null))[_0x2773('0x26')](saveUpdates(_0x1af667[_0x2773('0x49')],null))[_0x2773('0x26')](respondWithResult(_0x3d65fd,null))[_0x2773('0x43')](handleError(_0x3d65fd,null));};exports[_0x2773('0x25')]=function(_0x64829c,_0x4e6410){return db['VoiceMailMessage'][_0x2773('0x47')]({'where':{'id':_0x64829c[_0x2773('0x44')]['id']}})[_0x2773('0x26')](handleEntityNotFound(_0x4e6410,null))[_0x2773('0x26')](removeEntity(_0x4e6410,null))[_0x2773('0x43')](handleError(_0x4e6410,null));};exports['download']=function(_0x2776aa,_0x2dbbd3,_0x50075d){return db[_0x2773('0x2c')]['find']({'where':{'id':_0x2776aa[_0x2773('0x44')]['id']},'attributes':['id',_0x2773('0x4a'),_0x2773('0x4b')]})[_0x2773('0x26')](handleEntityNotFound(_0x2dbbd3,null))['then'](function(_0x29f879){if(_0x29f879){if(!_0x29f879[_0x2773('0x4a')]){throw new db[(_0x2773('0x4c'))][(_0x2773('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x1dd1cf={'Content-Type':_0x2773('0x4e'),'Content-Disposition':'attachment'};if(_0x29f879[_0x2773('0x4b')]){_0x1dd1cf[_0x2773('0x4f')]='attachment;\x20filename=\x22'+_0x29f879[_0x2773('0x4b')]+_0x2773('0x50');}_0x2dbbd3[_0x2773('0x51')](_0x1dd1cf);return _0x2dbbd3[_0x2773('0x52')](new Buffer(_0x29f879[_0x2773('0x4a')]));}})[_0x2773('0x43')](handleError(_0x2dbbd3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 48d311b..e10602b 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 _0x0c8e=['path','rimraf','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x0c8e,0xbd));var _0xe0c8=function(_0x125e64,_0x5153a8){_0x125e64=_0x125e64-0x0;var _0x26baa4=_0x0c8e[_0x125e64];return _0x26baa4;};'use strict';var _=require(_0xe0c8('0x0'));var util=require(_0xe0c8('0x1'));var logger=require(_0xe0c8('0x2'))(_0xe0c8('0x3'));var moment=require(_0xe0c8('0x4'));var BPromise=require(_0xe0c8('0x5'));var rp=require(_0xe0c8('0x6'));var fs=require('fs');var path=require(_0xe0c8('0x7'));var rimraf=require(_0xe0c8('0x8'));var config=require('../../config/environment');var attributes=require(_0xe0c8('0x9'));module[_0xe0c8('0xa')]=function(_0x5d1439,_0x107a40){return _0x5d1439['define'](_0xe0c8('0xb'),attributes,{'tableName':_0xe0c8('0xc'),'paranoid':![],'indexes':[{'name':_0xe0c8('0xd'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x0881=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x59e62a,_0x24befb){var _0x283057=function(_0x30166d){while(--_0x30166d){_0x59e62a['push'](_0x59e62a['shift']());}};_0x283057(++_0x24befb);}(_0x0881,0xe9));var _0x1088=function(_0xd13171,_0xc54453){_0xd13171=_0xd13171-0x0;var _0x452bd0=_0x0881[_0xd13171];return _0x452bd0;};'use strict';var _=require(_0x1088('0x0'));var util=require('util');var logger=require(_0x1088('0x1'))(_0x1088('0x2'));var moment=require('moment');var BPromise=require(_0x1088('0x3'));var rp=require(_0x1088('0x4'));var fs=require('fs');var path=require(_0x1088('0x5'));var rimraf=require(_0x1088('0x6'));var config=require(_0x1088('0x7'));var attributes=require(_0x1088('0x8'));module['exports']=function(_0x397546,_0x522c64){return _0x397546[_0x1088('0x9')](_0x1088('0xa'),attributes,{'tableName':_0x1088('0xb'),'paranoid':![],'indexes':[{'name':_0x1088('0xc'),'fields':[_0x1088('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 1464e16..7d5fd95 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 _0xae2e=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x3416e1,_0x9eaf1f){var _0x40801b=function(_0x282184){while(--_0x282184){_0x3416e1['push'](_0x3416e1['shift']());}};_0x40801b(++_0x9eaf1f);}(_0xae2e,0xdf));var _0xeae2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xae2e[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xeae2('0x0'));var util=require(_0xeae2('0x1'));var moment=require(_0xeae2('0x2'));var BPromise=require(_0xeae2('0x3'));var rs=require(_0xeae2('0x4'));var fs=require('fs');var Redis=require(_0xeae2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeae2('0x6'))('rpc');var config=require(_0xeae2('0x7'));var jayson=require(_0xeae2('0x8'));var client=jayson[_0xeae2('0x9')][_0xeae2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30022d,_0x28044a,_0x5a6d56){return new BPromise(function(_0x4d6ed2,_0x4601a3){return client[_0xeae2('0xb')](_0x30022d,_0x5a6d56)[_0xeae2('0xc')](function(_0x404266){logger['info'](_0xeae2('0xd'),_0x28044a,_0xeae2('0xe'));logger[_0xeae2('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x28044a,_0xeae2('0xe'),JSON[_0xeae2('0x10')](_0x404266));if(_0x404266[_0xeae2('0x11')]){if(_0x404266[_0xeae2('0x11')]['code']===0x1f4){logger[_0xeae2('0x11')](_0xeae2('0xd'),_0x28044a,_0x404266['error'][_0xeae2('0x12')]);return _0x4601a3(_0x404266[_0xeae2('0x11')][_0xeae2('0x12')]);}logger[_0xeae2('0x11')](_0xeae2('0xd'),_0x28044a,_0x404266['error']['message']);return _0x4d6ed2(_0x404266[_0xeae2('0x11')][_0xeae2('0x12')]);}else{logger[_0xeae2('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x28044a,_0xeae2('0xe'));_0x4d6ed2(_0x404266[_0xeae2('0x14')][_0xeae2('0x12')]);}})[_0xeae2('0x15')](function(_0xf9e397){logger[_0xeae2('0x11')](_0xeae2('0xd'),_0x28044a,_0xf9e397);_0x4601a3(_0xf9e397);});});} \ No newline at end of file +var _0x9fbc=['stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x9fbc,0x12d));var _0xc9fb=function(_0x46b057,_0x25aa56){_0x46b057=_0x46b057-0x0;var _0x25cf84=_0x9fbc[_0x46b057];return _0x25cf84;};'use strict';var _=require(_0xc9fb('0x0'));var util=require(_0xc9fb('0x1'));var moment=require(_0xc9fb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9fb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9fb('0x4'));var logger=require(_0xc9fb('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9fb('0x6'));var client=jayson[_0xc9fb('0x7')][_0xc9fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1247b6,_0x24fd46,_0x15b1bd){return new BPromise(function(_0x3fdb51,_0x37c0f2){return client[_0xc9fb('0x9')](_0x1247b6,_0x15b1bd)['then'](function(_0x2702c1){logger['info'](_0xc9fb('0xa'),_0x24fd46,_0xc9fb('0xb'));logger[_0xc9fb('0xc')](_0xc9fb('0xd'),_0x24fd46,_0xc9fb('0xb'),JSON[_0xc9fb('0xe')](_0x2702c1));if(_0x2702c1['error']){if(_0x2702c1[_0xc9fb('0xf')][_0xc9fb('0x10')]===0x1f4){logger[_0xc9fb('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x24fd46,_0x2702c1[_0xc9fb('0xf')]['message']);return _0x37c0f2(_0x2702c1['error'][_0xc9fb('0x11')]);}logger[_0xc9fb('0xf')](_0xc9fb('0xa'),_0x24fd46,_0x2702c1[_0xc9fb('0xf')][_0xc9fb('0x11')]);return _0x3fdb51(_0x2702c1[_0xc9fb('0xf')][_0xc9fb('0x11')]);}else{logger[_0xc9fb('0x12')](_0xc9fb('0xa'),_0x24fd46,_0xc9fb('0xb'));_0x3fdb51(_0x2702c1[_0xc9fb('0x13')][_0xc9fb('0x11')]);}})[_0xc9fb('0x14')](function(_0x32cefc){logger[_0xc9fb('0xf')](_0xc9fb('0xa'),_0x24fd46,_0x32cefc);_0x37c0f2(_0x32cefc);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index daf43a2..9af8f1e 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 _0xfc0d=['/:id/sounds','put','delete','destroy','removeSound','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','show','getSounds','post','create'];(function(_0x4618da,_0x27c024){var _0xede04a=function(_0x2bdf4c){while(--_0x2bdf4c){_0x4618da['push'](_0x4618da['shift']());}};_0xede04a(++_0x27c024);}(_0xfc0d,0x155));var _0xdfc0=function(_0x478c66,_0x14f892){_0x478c66=_0x478c66-0x0;var _0x2656ed=_0xfc0d[_0x478c66];return _0x2656ed;};'use strict';var multer=require(_0xdfc0('0x0'));var util=require(_0xdfc0('0x1'));var path=require(_0xdfc0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdfc0('0x3')]();var fs_extra=require(_0xdfc0('0x4'));var auth=require(_0xdfc0('0x5'));var interaction=require(_0xdfc0('0x6'));var config=require('../../config/environment');var controller=require(_0xdfc0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xdfc0('0x8')]);router[_0xdfc0('0x9')](_0xdfc0('0xa'),auth[_0xdfc0('0xb')](),controller[_0xdfc0('0xc')]);router[_0xdfc0('0x9')]('/:id/sounds',auth['isAuthenticated'](),controller[_0xdfc0('0xd')]);router[_0xdfc0('0xe')]('/',auth[_0xdfc0('0xb')](),controller[_0xdfc0('0xf')]);router[_0xdfc0('0xe')](_0xdfc0('0x10'),auth[_0xdfc0('0xb')](),controller['addSound']);router[_0xdfc0('0x11')](_0xdfc0('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xdfc0('0x12')](_0xdfc0('0xa'),auth[_0xdfc0('0xb')](),controller[_0xdfc0('0x13')]);router[_0xdfc0('0x12')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0xdfc0('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc713=['put','update','delete','destroy','removeSound','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create'];(function(_0x430448,_0x4345ca){var _0x34b552=function(_0xda7823){while(--_0xda7823){_0x430448['push'](_0x430448['shift']());}};_0x34b552(++_0x4345ca);}(_0xc713,0xd4));var _0x3c71=function(_0xbf3852,_0x4077dc){_0xbf3852=_0xbf3852-0x0;var _0x3000c5=_0xc713[_0xbf3852];return _0x3000c5;};'use strict';var multer=require(_0x3c71('0x0'));var util=require(_0x3c71('0x1'));var path=require(_0x3c71('0x2'));var timeout=require(_0x3c71('0x3'));var express=require('express');var router=express[_0x3c71('0x4')]();var fs_extra=require(_0x3c71('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c71('0x6'));var config=require(_0x3c71('0x7'));var controller=require(_0x3c71('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3c71('0x9')]);router[_0x3c71('0xa')](_0x3c71('0xb'),auth[_0x3c71('0xc')](),controller[_0x3c71('0xd')]);router[_0x3c71('0xa')](_0x3c71('0xe'),auth[_0x3c71('0xc')](),controller[_0x3c71('0xf')]);router[_0x3c71('0x10')]('/',auth[_0x3c71('0xc')](),controller[_0x3c71('0x11')]);router[_0x3c71('0x10')](_0x3c71('0xe'),auth[_0x3c71('0xc')](),controller['addSound']);router[_0x3c71('0x12')](_0x3c71('0xb'),auth[_0x3c71('0xc')](),controller[_0x3c71('0x13')]);router[_0x3c71('0x14')](_0x3c71('0xb'),auth['isAuthenticated'](),controller[_0x3c71('0x15')]);router['delete']('/:id/sounds/:id2',auth[_0x3c71('0xc')](),controller[_0x3c71('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 74e0343..17cfb4e 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 _0x65db=['files','mp3nb','quietmp3nb','quietmp3','mp3','BOOLEAN','exports','STRING','name','ENUM','custom'];(function(_0x14a2aa,_0x248941){var _0x46895b=function(_0x15d023){while(--_0x15d023){_0x14a2aa['push'](_0x14a2aa['shift']());}};_0x46895b(++_0x248941);}(_0x65db,0x7f));var _0xb65d=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x65db[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require('sequelize');module[_0xb65d('0x0')]={'name':{'type':Sequelize[_0xb65d('0x1')],'allowNull':![],'unique':_0xb65d('0x2')},'mode':{'type':Sequelize[_0xb65d('0x3')](_0xb65d('0x4'),_0xb65d('0x5'),_0xb65d('0x6'),_0xb65d('0x7'),_0xb65d('0x8'),_0xb65d('0x9')),'allowNull':!![],'defaultValue':_0xb65d('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xb65d('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb65d('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb65d('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xb65d('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xb65d('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x74e4=['exports','STRING','ENUM','custom','quietmp3nb','quietmp3','files','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x2c60f4,_0x17f87a){var _0x374f5a=function(_0x36ce83){while(--_0x36ce83){_0x2c60f4['push'](_0x2c60f4['shift']());}};_0x374f5a(++_0x17f87a);}(_0x74e4,0xe5));var _0x474e=function(_0x1205e5,_0x520f20){_0x1205e5=_0x1205e5-0x0;var _0x31a342=_0x74e4[_0x1205e5];return _0x31a342;};'use strict';var Sequelize=require(_0x474e('0x0'));module[_0x474e('0x1')]={'name':{'type':Sequelize[_0x474e('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x474e('0x3')](_0x474e('0x4'),'files','mp3nb',_0x474e('0x5'),_0x474e('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x474e('0x7')},'directory':{'type':Sequelize[_0x474e('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x474e('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x474e('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x474e('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x474e('0x2')],'allowNull':!![]},'stamp':{'type':_0x474e('0x8')},'defaultEntry':{'type':Sequelize[_0x474e('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 fe2445d..f05b9aa 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 _0x17b0=['nolimit','sort','pick','filter','where','merge','VIRTUAL','options','VoiceMusicOnHold','count','includeAll','include','findAll','rows','catch','params','find','body','create','sequelize','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','readdirSync','forEach','unlinkSync','join','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','order','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','get','MusicOnHolds','UserProfileResource','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x17b0,0x19b));var _0x017b=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x17b0[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x017b('0x0'));var rimraf=require(_0x017b('0x1'));var zipdir=require(_0x017b('0x2'));var jsonpatch=require(_0x017b('0x3'));var rp=require(_0x017b('0x4'));var moment=require(_0x017b('0x5'));var BPromise=require(_0x017b('0x6'));var Mustache=require('mustache');var util=require(_0x017b('0x7'));var path=require('path');var sox=require(_0x017b('0x8'));var csv=require(_0x017b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x017b('0xa'));var _=require(_0x017b('0xb'));var squel=require(_0x017b('0xc'));var crypto=require('crypto');var jsforce=require(_0x017b('0xd'));var deskjs=require(_0x017b('0xe'));var toCsv=require(_0x017b('0x9'));var querystring=require(_0x017b('0xf'));var Papa=require(_0x017b('0x10'));var Redis=require(_0x017b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x017b('0x12'));var hardwareService=require(_0x017b('0x13'));var logger=require(_0x017b('0x14'))(_0x017b('0x15'));var utils=require(_0x017b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x017b('0x17'));var db=require(_0x017b('0x18'))['db'];function respondWithStatusCode(_0x3a3852,_0x2bb98b){_0x2bb98b=_0x2bb98b||0xcc;return function(_0x5a49c8){if(_0x5a49c8){return _0x3a3852['sendStatus'](_0x2bb98b);}return _0x3a3852[_0x017b('0x19')](_0x2bb98b)[_0x017b('0x1a')]();};}function respondWithResult(_0x2c5c8e,_0x2ade62){_0x2ade62=_0x2ade62||0xc8;return function(_0x5209ad){if(_0x5209ad){return _0x2c5c8e[_0x017b('0x19')](_0x2ade62)[_0x017b('0x1b')](_0x5209ad);}};}function respondWithFilteredResult(_0x1853cb,_0x19de23){return function(_0xf9d054){if(_0xf9d054){var _0x26da65=typeof _0x19de23[_0x017b('0x1c')]===_0x017b('0x1d')&&typeof _0x19de23[_0x017b('0x1e')]===_0x017b('0x1d');var _0x260078=_0xf9d054['count'];var _0x548d0e=_0x26da65?0x0:_0x19de23[_0x017b('0x1c')];var _0x174108=_0x26da65?_0xf9d054['count']:_0x19de23[_0x017b('0x1c')]+_0x19de23[_0x017b('0x1e')];var _0x165b1c;if(_0x174108>=_0x260078){_0x174108=_0x260078;_0x165b1c=0xc8;}else{_0x165b1c=0xce;}_0x1853cb[_0x017b('0x19')](_0x165b1c);return _0x1853cb[_0x017b('0x1f')](_0x017b('0x20'),_0x548d0e+'-'+_0x174108+'/'+_0x260078)[_0x017b('0x1b')](_0xf9d054);}return null;};}function patchUpdates(_0x3b7c9a){return function(_0x37f363){try{jsonpatch[_0x017b('0x21')](_0x37f363,_0x3b7c9a,!![]);}catch(_0x52e381){return BPromise[_0x017b('0x22')](_0x52e381);}return _0x37f363[_0x017b('0x23')]();};}function saveUpdates(_0x3c04c7,_0x1172de){return function(_0x462a5d){if(_0x462a5d){return _0x462a5d[_0x017b('0x24')](_0x3c04c7)['then'](function(_0x5816f4){return _0x5816f4;});}return null;};}function removeEntity(_0xaf2051,_0x370c25){return function(_0x36c02c){if(_0x36c02c){return _0x36c02c[_0x017b('0x25')]()['then'](function(){var _0x5cd470=_0x36c02c[_0x017b('0x26')]({'plain':!![]});var _0x1843fd=_0x017b('0x27');return db[_0x017b('0x28')]['destroy']({'where':{'type':_0x1843fd,'resourceId':_0x5cd470['id']}})['then'](function(){return _0x36c02c;});})[_0x017b('0x29')](function(){_0xaf2051[_0x017b('0x19')](0xcc)[_0x017b('0x1a')]();});}};}function handleEntityNotFound(_0x4bf49c,_0x90df3c){return function(_0x337e93){if(!_0x337e93){_0x4bf49c[_0x017b('0x2a')](0x194);}return _0x337e93;};}function handleError(_0x1a25a6,_0x200885){_0x200885=_0x200885||0x1f4;return function(_0x281f38){logger[_0x017b('0x2b')](_0x281f38['stack']);if(_0x281f38[_0x017b('0x2c')]){delete _0x281f38['name'];}_0x1a25a6[_0x017b('0x19')](_0x200885)[_0x017b('0x2d')](_0x281f38);};}exports[_0x017b('0x2e')]=function(_0x2b25c7,_0x1eed4c){var _0x2b7455={},_0x23cc34={},_0x6f2c37={'count':0x0,'rows':[]};var _0x3d60ad=_[_0x017b('0x2f')](db['VoiceMusicOnHold'][_0x017b('0x30')],function(_0x3d6a30){return{'name':_0x3d6a30[_0x017b('0x31')],'type':_0x3d6a30[_0x017b('0x32')][_0x017b('0x33')]};});_0x23cc34['model']=_[_0x017b('0x2f')](_0x3d60ad,_0x017b('0x2c'));_0x23cc34[_0x017b('0x34')]=_[_0x017b('0x35')](_0x2b25c7[_0x017b('0x34')]);_0x23cc34[_0x017b('0x36')]=_[_0x017b('0x37')](_0x23cc34[_0x017b('0x38')],_0x23cc34[_0x017b('0x34')]);_0x2b7455[_0x017b('0x39')]=_[_0x017b('0x37')](_0x23cc34['model'],qs[_0x017b('0x3a')](_0x2b25c7[_0x017b('0x34')][_0x017b('0x3a')]));_0x2b7455[_0x017b('0x39')]=_0x2b7455[_0x017b('0x39')][_0x017b('0x3b')]?_0x2b7455['attributes']:_0x23cc34[_0x017b('0x38')];if(!_0x2b25c7[_0x017b('0x34')][_0x017b('0x3c')](_0x017b('0x3d'))){_0x2b7455[_0x017b('0x1e')]=qs[_0x017b('0x1e')](_0x2b25c7[_0x017b('0x34')]['limit']);_0x2b7455[_0x017b('0x1c')]=qs[_0x017b('0x1c')](_0x2b25c7[_0x017b('0x34')][_0x017b('0x1c')]);}_0x2b7455['order']=qs[_0x017b('0x3e')](_0x2b25c7[_0x017b('0x34')][_0x017b('0x3e')]);delete _0x2b25c7[_0x017b('0x34')][_0x017b('0x3e')];_0x2b7455['where']=qs[_0x017b('0x36')](_[_0x017b('0x3f')](_0x2b25c7[_0x017b('0x34')],_0x23cc34['filters']),_0x3d60ad);if(_0x2b25c7[_0x017b('0x34')][_0x017b('0x40')]){_0x2b7455[_0x017b('0x41')]=_[_0x017b('0x42')](_0x2b7455[_0x017b('0x41')],{'$or':_['map'](_0x3d60ad,function(_0x348911){if(_0x348911['type']!==_0x017b('0x43')){var _0xb7a9df={};_0xb7a9df[_0x348911[_0x017b('0x2c')]]={'$like':'%'+_0x2b25c7[_0x017b('0x34')][_0x017b('0x40')]+'%'};return _0xb7a9df;}})});}_0x2b7455=_[_0x017b('0x42')]({},_0x2b7455,_0x2b25c7[_0x017b('0x44')]);var _0x275929={'where':_0x2b7455[_0x017b('0x41')]};return db[_0x017b('0x45')][_0x017b('0x46')](_0x275929)[_0x017b('0x29')](function(_0x17292d){_0x6f2c37[_0x017b('0x46')]=_0x17292d;if(_0x2b25c7[_0x017b('0x34')][_0x017b('0x47')]){_0x2b7455[_0x017b('0x48')]=[{'all':!![]}];}return db[_0x017b('0x45')][_0x017b('0x49')](_0x2b7455);})[_0x017b('0x29')](function(_0x244d27){_0x6f2c37[_0x017b('0x4a')]=_0x244d27;return _0x6f2c37;})['then'](respondWithFilteredResult(_0x1eed4c,_0x2b7455))[_0x017b('0x4b')](handleError(_0x1eed4c,null));};exports['show']=function(_0x39ec0e,_0x1ffb43){var _0x33fc26={'raw':![],'where':{'id':_0x39ec0e[_0x017b('0x4c')]['id']}},_0x45c459={};_0x45c459['model']=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x45c459['query']=_[_0x017b('0x35')](_0x39ec0e[_0x017b('0x34')]);_0x45c459[_0x017b('0x36')]=_[_0x017b('0x37')](_0x45c459[_0x017b('0x38')],_0x45c459[_0x017b('0x34')]);_0x33fc26['attributes']=_[_0x017b('0x37')](_0x45c459[_0x017b('0x38')],qs['fields'](_0x39ec0e[_0x017b('0x34')][_0x017b('0x3a')]));_0x33fc26[_0x017b('0x39')]=_0x33fc26[_0x017b('0x39')][_0x017b('0x3b')]?_0x33fc26['attributes']:_0x45c459[_0x017b('0x38')];if(_0x39ec0e[_0x017b('0x34')][_0x017b('0x47')]){_0x33fc26[_0x017b('0x48')]=[{'all':!![]}];}_0x33fc26=_['merge']({},_0x33fc26,_0x39ec0e['options']);return db[_0x017b('0x45')][_0x017b('0x4d')](_0x33fc26)[_0x017b('0x29')](handleEntityNotFound(_0x1ffb43,null))['then'](respondWithResult(_0x1ffb43,null))[_0x017b('0x4b')](handleError(_0x1ffb43,null));};exports[_0x017b('0x24')]=function(_0xa2f2cd,_0x1bbd9f){if(_0xa2f2cd[_0x017b('0x4e')]['id']){delete _0xa2f2cd[_0x017b('0x4e')]['id'];}return db[_0x017b('0x45')]['find']({'where':{'id':_0xa2f2cd['params']['id']}})[_0x017b('0x29')](handleEntityNotFound(_0x1bbd9f,null))['then'](saveUpdates(_0xa2f2cd[_0x017b('0x4e')],null))['then'](respondWithResult(_0x1bbd9f,null))[_0x017b('0x4b')](handleError(_0x1bbd9f,null));};exports[_0x017b('0x4f')]=function(_0x5ea15f,_0x5b33ea,_0x213573){return db[_0x017b('0x50')][_0x017b('0x51')](function(_0x5d2772){if(_0x5ea15f[_0x017b('0x4e')][_0x017b('0x52')]===_0x017b('0x53')){_0x5ea15f[_0x017b('0x4e')][_0x017b('0x54')]=path['join'](config[_0x017b('0x55')],_0x017b('0x56'),_0x5ea15f[_0x017b('0x4e')][_0x017b('0x2c')]);}return db['VoiceMusicOnHold'][_0x017b('0x4f')](_0x5ea15f[_0x017b('0x4e')],{'transaction':_0x5d2772})['then'](function(_0x5d1283){if(_0x5ea15f[_0x017b('0x4e')]['mode']==='files'){fs[_0x017b('0x57')](_0x5d1283[_0x017b('0x54')],parseInt(_0x017b('0x58'),0x8));}var _0x115f5b=_0x5ea15f[_0x017b('0x59')][_0x017b('0x26')]({'plain':!![]});if(!_0x115f5b)throw new Error(_0x017b('0x5a'));if(_0x115f5b[_0x017b('0x5b')]==='user'){var _0xbbff75=_0x5d1283[_0x017b('0x26')]({'plain':!![]});return db[_0x017b('0x5c')][_0x017b('0x4d')]({'where':{'name':_0x017b('0x27'),'userProfileId':_0x115f5b[_0x017b('0x5d')]},'raw':!![]})[_0x017b('0x29')](function(_0x4b7b81){if(_0x4b7b81&&_0x4b7b81[_0x017b('0x5e')]===0x0){return db[_0x017b('0x28')][_0x017b('0x4f')]({'name':_0xbbff75[_0x017b('0x2c')],'resourceId':_0xbbff75['id'],'type':_0x4b7b81[_0x017b('0x2c')],'sectionId':_0x4b7b81['id']},{})[_0x017b('0x29')](function(){return _0x5d1283;});}else{return _0x5d1283;}})[_0x017b('0x4b')](function(_0x28b3be){logger[_0x017b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28b3be);});}return _0x5d1283;});})['then'](respondWithResult(_0x5b33ea,0xc9))['catch'](handleError(_0x5b33ea,null));};exports[_0x017b('0x25')]=function(_0x574804,_0x536722,_0x5b9110){var _0x18bcf5;return db[_0x017b('0x45')]['find']({'where':{'id':_0x574804['params']['id']}})[_0x017b('0x29')](function(_0x3abee6){if(_0x3abee6){return db['sequelize'][_0x017b('0x51')](function(_0x4d9611){return _0x3abee6[_0x017b('0x25')]({'transaction':_0x4d9611,'raw':!![]})[_0x017b('0x29')](function(_0x5b5ab0){if(_0x5b5ab0[_0x017b('0x54')]){fs[_0x017b('0x5f')](_0x5b5ab0['directory'])[_0x017b('0x60')](function(_0x3ff81c){fs[_0x017b('0x61')](path[_0x017b('0x62')](_0x5b5ab0[_0x017b('0x54')],_0x3ff81c));});fs['rmdirSync'](_0x5b5ab0[_0x017b('0x54')]);}return _0x5b5ab0;});})['catch'](function(_0x512540){throw new db[(_0x017b('0x63'))][(_0x017b('0x64'))](_0x512540[_0x017b('0x65')]);});}})[_0x017b('0x29')](handleEntityNotFound(_0x536722,null))['then'](removeEntity(_0x536722,null))[_0x017b('0x4b')](handleError(_0x536722,null));};exports['addSound']=function(_0x20c59a,_0x45d497,_0x3c6663){return db[_0x017b('0x50')][_0x017b('0x51')](function(_0x23e127){var _0x352334;return db[_0x017b('0x45')]['find']({'where':{'id':_0x20c59a[_0x017b('0x4c')]['id']}})[_0x017b('0x29')](function(_0x449a1c){if(_0x449a1c){_0x352334=_0x449a1c;return _0x449a1c[_0x017b('0x66')](_0x20c59a[_0x017b('0x4e')]['id'],{'transaction':_0x23e127});}})[_0x017b('0x29')](function(_0x3bf7e6){if(_0x3bf7e6){return db[_0x017b('0x67')][_0x017b('0x68')]({'where':{'id':_0x20c59a[_0x017b('0x4e')]['id']},'attributes':['id',_0x017b('0x2c'),_0x017b('0x69'),_0x017b('0x6a'),_0x017b('0x6b')],'raw':!![]});}})['then'](function(_0x432f40){if(_0x432f40){var _0x3d7460=path[_0x017b('0x62')](config[_0x017b('0x55')],_0x017b('0x6c'),util[_0x017b('0x6d')](_0x017b('0x6e'),path[_0x017b('0x6f')](_0x432f40[_0x017b('0x69')],path[_0x017b('0x70')](_0x432f40[_0x017b('0x69')])),_0x432f40['converted_format']));var _0x411731=path[_0x017b('0x62')](config[_0x017b('0x55')],_0x017b('0x56'),_0x352334[_0x017b('0x2c')],util[_0x017b('0x6d')](_0x017b('0x6e'),_0x432f40['name'],_0x432f40['converted_format']));fs[_0x017b('0x71')](_0x3d7460,_0x411731);return _0x432f40;}})[_0x017b('0x4b')](function(_0x59f966){throw new db['Sequelize']['ValidationError'](_0x59f966['message']);});})[_0x017b('0x29')](handleEntityNotFound(_0x45d497,null))['then'](respondWithResult(_0x45d497,0xc9))[_0x017b('0x4b')](handleError(_0x45d497,null));};exports[_0x017b('0x72')]=function(_0x2a03e6,_0x648ece,_0x5d20a5){return db[_0x017b('0x50')][_0x017b('0x51')](function(_0x525ea2){var _0x254af4;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x2a03e6['params']['id']}})[_0x017b('0x29')](handleEntityNotFound(_0x648ece,null))[_0x017b('0x29')](function(_0x2397ca){if(_0x2397ca){_0x254af4=_0x2397ca;return _0x2397ca[_0x017b('0x72')](_0x2a03e6['params'][_0x017b('0x73')]);}})[_0x017b('0x29')](function(_0x433860){if(_0x433860){return db[_0x017b('0x67')][_0x017b('0x68')]({'where':{'id':_0x2a03e6[_0x017b('0x4c')][_0x017b('0x73')]},'attributes':['id','name',_0x017b('0x69'),_0x017b('0x6a'),_0x017b('0x6b')],'raw':!![]});}})[_0x017b('0x29')](function(_0x587caf){if(_0x587caf){fs[_0x017b('0x61')](path[_0x017b('0x62')](_0x254af4[_0x017b('0x54')],util[_0x017b('0x6d')](_0x017b('0x6e'),_0x587caf['name'],_0x587caf[_0x017b('0x6a')])));return _0x587caf;}})[_0x017b('0x4b')](function(_0x5e6a39){throw new db[(_0x017b('0x63'))][(_0x017b('0x64'))](_0x5e6a39[_0x017b('0x65')]);});})[_0x017b('0x29')](handleEntityNotFound(_0x648ece,null))[_0x017b('0x29')](respondWithStatusCode(_0x648ece,0xcc))[_0x017b('0x4b')](handleError(_0x648ece,null));};exports['getSounds']=function(_0x3421d4,_0x50db34,_0x416844){var _0x24c55d={};var _0x6f25cb={};var _0x3e7518;var _0x4c5c0f;return db['VoiceMusicOnHold'][_0x017b('0x68')]({'where':{'id':_0x3421d4[_0x017b('0x4c')]['id']}})[_0x017b('0x29')](handleEntityNotFound(_0x50db34,null))['then'](function(_0x759be1){if(_0x759be1){_0x3e7518=_0x759be1;_0x6f25cb[_0x017b('0x38')]=_[_0x017b('0x35')](db[_0x017b('0x67')][_0x017b('0x30')]);_0x6f25cb[_0x017b('0x34')]=_[_0x017b('0x35')](_0x3421d4[_0x017b('0x34')]);_0x6f25cb[_0x017b('0x36')]=_['intersection'](_0x6f25cb['model'],_0x6f25cb[_0x017b('0x34')]);_0x24c55d['attributes']=_[_0x017b('0x37')](_0x6f25cb[_0x017b('0x38')],qs[_0x017b('0x3a')](_0x3421d4[_0x017b('0x34')][_0x017b('0x3a')]));_0x24c55d[_0x017b('0x39')]=_0x24c55d[_0x017b('0x39')][_0x017b('0x3b')]?_0x24c55d[_0x017b('0x39')]:_0x6f25cb[_0x017b('0x38')];_0x24c55d[_0x017b('0x74')]=qs[_0x017b('0x3e')](_0x3421d4[_0x017b('0x34')][_0x017b('0x3e')]);_0x24c55d[_0x017b('0x41')]=qs[_0x017b('0x36')](_['pick'](_0x3421d4[_0x017b('0x34')],_0x6f25cb[_0x017b('0x36')]));if(_0x3421d4[_0x017b('0x34')][_0x017b('0x40')]){_0x24c55d[_0x017b('0x41')]=_[_0x017b('0x42')](_0x24c55d[_0x017b('0x41')],{'$or':_[_0x017b('0x2f')](_0x24c55d[_0x017b('0x39')],function(_0x2ce6e7){var _0x3179b2={};_0x3179b2[_0x2ce6e7]={'$like':'%'+_0x3421d4[_0x017b('0x34')][_0x017b('0x40')]+'%'};return _0x3179b2;})});}_0x24c55d=_[_0x017b('0x42')]({},_0x24c55d,_0x3421d4['options']);return _0x3e7518[_0x017b('0x75')](_0x24c55d);}})['then'](function(_0x30a5d9){if(_0x30a5d9){_0x4c5c0f=_0x30a5d9[_0x017b('0x3b')];if(!_0x3421d4['query'][_0x017b('0x3c')](_0x017b('0x3d'))){_0x24c55d['limit']=qs[_0x017b('0x1e')](_0x3421d4[_0x017b('0x34')]['limit']);_0x24c55d[_0x017b('0x1c')]=qs['offset'](_0x3421d4[_0x017b('0x34')]['offset']);}return _0x3e7518[_0x017b('0x75')](_0x24c55d);}})[_0x017b('0x29')](function(_0x3c2b9d){if(_0x3c2b9d){return _0x3c2b9d?{'count':_0x4c5c0f,'rows':_0x3c2b9d}:null;}})[_0x017b('0x29')](respondWithResult(_0x50db34,null))[_0x017b('0x4b')](handleError(_0x50db34,null));}; \ No newline at end of file +var _0xf6b3=['update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','options','includeAll','include','VoiceMusicOnHold','findAll','rows','find','catch','body','params','sequelize','directory','server/files/moh','create','files','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','MusicOnHolds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','basename','join','ValidationError','removeSound','%s.%s','getSounds','filter','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x355c03,_0x1cf673){var _0x4833ac=function(_0x4300e1){while(--_0x4300e1){_0x355c03['push'](_0x355c03['shift']());}};_0x4833ac(++_0x1cf673);}(_0xf6b3,0xba));var _0x3f6b=function(_0x233724,_0x563069){_0x233724=_0x233724-0x0;var _0x498a3d=_0xf6b3[_0x233724];return _0x498a3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f6b('0x0'));var zipdir=require(_0x3f6b('0x1'));var jsonpatch=require(_0x3f6b('0x2'));var rp=require(_0x3f6b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3f6b('0x4'));var util=require(_0x3f6b('0x5'));var path=require('path');var sox=require(_0x3f6b('0x6'));var csv=require('to-csv');var ejs=require(_0x3f6b('0x7'));var fs=require('fs');var fs_extra=require(_0x3f6b('0x8'));var _=require(_0x3f6b('0x9'));var squel=require(_0x3f6b('0xa'));var crypto=require(_0x3f6b('0xb'));var jsforce=require(_0x3f6b('0xc'));var deskjs=require(_0x3f6b('0xd'));var toCsv=require(_0x3f6b('0xe'));var querystring=require(_0x3f6b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3f6b('0x10'));var qs=require(_0x3f6b('0x11'));var as=require(_0x3f6b('0x12'));var hardwareService=require(_0x3f6b('0x13'));var logger=require(_0x3f6b('0x14'))(_0x3f6b('0x15'));var utils=require('../../config/utils');var config=require(_0x3f6b('0x16'));var licenseUtil=require(_0x3f6b('0x17'));var db=require(_0x3f6b('0x18'))['db'];function respondWithStatusCode(_0x5ccb95,_0x170726){_0x170726=_0x170726||0xcc;return function(_0x4d2066){if(_0x4d2066){return _0x5ccb95[_0x3f6b('0x19')](_0x170726);}return _0x5ccb95[_0x3f6b('0x1a')](_0x170726)['end']();};}function respondWithResult(_0x401c70,_0x32fa67){_0x32fa67=_0x32fa67||0xc8;return function(_0x1aac03){if(_0x1aac03){return _0x401c70[_0x3f6b('0x1a')](_0x32fa67)[_0x3f6b('0x1b')](_0x1aac03);}};}function respondWithFilteredResult(_0x37a1e8,_0x10dfbd){return function(_0x429d3c){if(_0x429d3c){var _0x265232=typeof _0x10dfbd[_0x3f6b('0x1c')]===_0x3f6b('0x1d')&&typeof _0x10dfbd[_0x3f6b('0x1e')]==='undefined';var _0x3d34d9=_0x429d3c[_0x3f6b('0x1f')];var _0x503426=_0x265232?0x0:_0x10dfbd[_0x3f6b('0x1c')];var _0x1c0c0c=_0x265232?_0x429d3c[_0x3f6b('0x1f')]:_0x10dfbd[_0x3f6b('0x1c')]+_0x10dfbd[_0x3f6b('0x1e')];var _0x3715a7;if(_0x1c0c0c>=_0x3d34d9){_0x1c0c0c=_0x3d34d9;_0x3715a7=0xc8;}else{_0x3715a7=0xce;}_0x37a1e8[_0x3f6b('0x1a')](_0x3715a7);return _0x37a1e8[_0x3f6b('0x20')](_0x3f6b('0x21'),_0x503426+'-'+_0x1c0c0c+'/'+_0x3d34d9)[_0x3f6b('0x1b')](_0x429d3c);}return null;};}function patchUpdates(_0x52fb71){return function(_0x186807){try{jsonpatch[_0x3f6b('0x22')](_0x186807,_0x52fb71,!![]);}catch(_0x5c54fe){return BPromise[_0x3f6b('0x23')](_0x5c54fe);}return _0x186807['save']();};}function saveUpdates(_0x29f44d,_0x510613){return function(_0x573d33){if(_0x573d33){return _0x573d33[_0x3f6b('0x24')](_0x29f44d)[_0x3f6b('0x25')](function(_0x8123c8){return _0x8123c8;});}return null;};}function removeEntity(_0x5aa567,_0x9bbf08){return function(_0x5c3f32){if(_0x5c3f32){return _0x5c3f32[_0x3f6b('0x26')]()[_0x3f6b('0x25')](function(){var _0x263793=_0x5c3f32[_0x3f6b('0x27')]({'plain':!![]});var _0x5ea1d9='MusicOnHolds';return db[_0x3f6b('0x28')][_0x3f6b('0x26')]({'where':{'type':_0x5ea1d9,'resourceId':_0x263793['id']}})[_0x3f6b('0x25')](function(){return _0x5c3f32;});})['then'](function(){_0x5aa567[_0x3f6b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58996a,_0x3ce365){return function(_0x1736e2){if(!_0x1736e2){_0x58996a[_0x3f6b('0x19')](0x194);}return _0x1736e2;};}function handleError(_0x751fb4,_0x519922){_0x519922=_0x519922||0x1f4;return function(_0x391ac9){logger[_0x3f6b('0x29')](_0x391ac9[_0x3f6b('0x2a')]);if(_0x391ac9[_0x3f6b('0x2b')]){delete _0x391ac9[_0x3f6b('0x2b')];}_0x751fb4[_0x3f6b('0x1a')](_0x519922)[_0x3f6b('0x2c')](_0x391ac9);};}exports[_0x3f6b('0x2d')]=function(_0x4b42c4,_0x4770e1){var _0x56ce53={},_0x29ec62={},_0x560c0d={'count':0x0,'rows':[]};var _0x4c05dd=_[_0x3f6b('0x2e')](db['VoiceMusicOnHold'][_0x3f6b('0x2f')],function(_0x59195c){return{'name':_0x59195c[_0x3f6b('0x30')],'type':_0x59195c['type']['key']};});_0x29ec62[_0x3f6b('0x31')]=_['map'](_0x4c05dd,'name');_0x29ec62[_0x3f6b('0x32')]=_[_0x3f6b('0x33')](_0x4b42c4[_0x3f6b('0x32')]);_0x29ec62[_0x3f6b('0x34')]=_[_0x3f6b('0x35')](_0x29ec62[_0x3f6b('0x31')],_0x29ec62[_0x3f6b('0x32')]);_0x56ce53[_0x3f6b('0x36')]=_[_0x3f6b('0x35')](_0x29ec62[_0x3f6b('0x31')],qs['fields'](_0x4b42c4[_0x3f6b('0x32')][_0x3f6b('0x37')]));_0x56ce53[_0x3f6b('0x36')]=_0x56ce53['attributes'][_0x3f6b('0x38')]?_0x56ce53[_0x3f6b('0x36')]:_0x29ec62['model'];if(!_0x4b42c4['query'][_0x3f6b('0x39')](_0x3f6b('0x3a'))){_0x56ce53[_0x3f6b('0x1e')]=qs[_0x3f6b('0x1e')](_0x4b42c4[_0x3f6b('0x32')]['limit']);_0x56ce53[_0x3f6b('0x1c')]=qs['offset'](_0x4b42c4[_0x3f6b('0x32')][_0x3f6b('0x1c')]);}_0x56ce53[_0x3f6b('0x3b')]=qs['sort'](_0x4b42c4[_0x3f6b('0x32')][_0x3f6b('0x3c')]);delete _0x4b42c4[_0x3f6b('0x32')][_0x3f6b('0x3c')];_0x56ce53[_0x3f6b('0x3d')]=qs[_0x3f6b('0x34')](_['pick'](_0x4b42c4[_0x3f6b('0x32')],_0x29ec62[_0x3f6b('0x34')]),_0x4c05dd);if(_0x4b42c4[_0x3f6b('0x32')]['filter']){_0x56ce53[_0x3f6b('0x3d')]=_['merge'](_0x56ce53[_0x3f6b('0x3d')],{'$or':_[_0x3f6b('0x2e')](_0x4c05dd,function(_0x10e683){if(_0x10e683[_0x3f6b('0x3e')]!==_0x3f6b('0x3f')){var _0x4d41f1={};_0x4d41f1[_0x10e683['name']]={'$like':'%'+_0x4b42c4[_0x3f6b('0x32')]['filter']+'%'};return _0x4d41f1;}})});}_0x56ce53=_[_0x3f6b('0x40')]({},_0x56ce53,_0x4b42c4[_0x3f6b('0x41')]);var _0x4ca3da={'where':_0x56ce53[_0x3f6b('0x3d')]};return db['VoiceMusicOnHold'][_0x3f6b('0x1f')](_0x4ca3da)[_0x3f6b('0x25')](function(_0x2e75aa){_0x560c0d[_0x3f6b('0x1f')]=_0x2e75aa;if(_0x4b42c4[_0x3f6b('0x32')][_0x3f6b('0x42')]){_0x56ce53[_0x3f6b('0x43')]=[{'all':!![]}];}return db[_0x3f6b('0x44')][_0x3f6b('0x45')](_0x56ce53);})[_0x3f6b('0x25')](function(_0x112cc6){_0x560c0d[_0x3f6b('0x46')]=_0x112cc6;return _0x560c0d;})[_0x3f6b('0x25')](respondWithFilteredResult(_0x4770e1,_0x56ce53))['catch'](handleError(_0x4770e1,null));};exports['show']=function(_0x3f2e8d,_0x32353f){var _0x27384b={'raw':![],'where':{'id':_0x3f2e8d['params']['id']}},_0x3fe584={};_0x3fe584[_0x3f6b('0x31')]=_[_0x3f6b('0x33')](db[_0x3f6b('0x44')][_0x3f6b('0x2f')]);_0x3fe584[_0x3f6b('0x32')]=_[_0x3f6b('0x33')](_0x3f2e8d[_0x3f6b('0x32')]);_0x3fe584[_0x3f6b('0x34')]=_[_0x3f6b('0x35')](_0x3fe584[_0x3f6b('0x31')],_0x3fe584[_0x3f6b('0x32')]);_0x27384b['attributes']=_[_0x3f6b('0x35')](_0x3fe584[_0x3f6b('0x31')],qs[_0x3f6b('0x37')](_0x3f2e8d['query'][_0x3f6b('0x37')]));_0x27384b[_0x3f6b('0x36')]=_0x27384b['attributes'][_0x3f6b('0x38')]?_0x27384b[_0x3f6b('0x36')]:_0x3fe584[_0x3f6b('0x31')];if(_0x3f2e8d[_0x3f6b('0x32')][_0x3f6b('0x42')]){_0x27384b[_0x3f6b('0x43')]=[{'all':!![]}];}_0x27384b=_[_0x3f6b('0x40')]({},_0x27384b,_0x3f2e8d[_0x3f6b('0x41')]);return db[_0x3f6b('0x44')][_0x3f6b('0x47')](_0x27384b)[_0x3f6b('0x25')](handleEntityNotFound(_0x32353f,null))[_0x3f6b('0x25')](respondWithResult(_0x32353f,null))[_0x3f6b('0x48')](handleError(_0x32353f,null));};exports['update']=function(_0x3a161f,_0x39e83f){if(_0x3a161f[_0x3f6b('0x49')]['id']){delete _0x3a161f[_0x3f6b('0x49')]['id'];}return db[_0x3f6b('0x44')][_0x3f6b('0x47')]({'where':{'id':_0x3a161f[_0x3f6b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39e83f,null))[_0x3f6b('0x25')](saveUpdates(_0x3a161f['body'],null))['then'](respondWithResult(_0x39e83f,null))[_0x3f6b('0x48')](handleError(_0x39e83f,null));};exports['create']=function(_0x118175,_0x2d157c,_0x36a99d){return db[_0x3f6b('0x4b')]['transaction'](function(_0xaa8eef){if(_0x118175['body']['mode']==='files'){_0x118175[_0x3f6b('0x49')][_0x3f6b('0x4c')]=path['join'](config['root'],_0x3f6b('0x4d'),_0x118175[_0x3f6b('0x49')]['name']);}return db[_0x3f6b('0x44')][_0x3f6b('0x4e')](_0x118175['body'],{'transaction':_0xaa8eef})[_0x3f6b('0x25')](function(_0x2ab220){if(_0x118175['body']['mode']===_0x3f6b('0x4f')){fs['mkdirSync'](_0x2ab220[_0x3f6b('0x4c')],parseInt(_0x3f6b('0x50'),0x8));}var _0x22a626=_0x118175['user'][_0x3f6b('0x27')]({'plain':!![]});if(!_0x22a626)throw new Error(_0x3f6b('0x51'));if(_0x22a626[_0x3f6b('0x52')]===_0x3f6b('0x53')){var _0x199f90=_0x2ab220[_0x3f6b('0x27')]({'plain':!![]});return db[_0x3f6b('0x54')]['find']({'where':{'name':_0x3f6b('0x55'),'userProfileId':_0x22a626['userProfileId']},'raw':!![]})['then'](function(_0x21fe0b){if(_0x21fe0b&&_0x21fe0b[_0x3f6b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x199f90[_0x3f6b('0x2b')],'resourceId':_0x199f90['id'],'type':_0x21fe0b[_0x3f6b('0x2b')],'sectionId':_0x21fe0b['id']},{})[_0x3f6b('0x25')](function(){return _0x2ab220;});}else{return _0x2ab220;}})['catch'](function(_0x3b9ec3){logger[_0x3f6b('0x29')](_0x3f6b('0x57'),_0x3b9ec3);});}return _0x2ab220;});})['then'](respondWithResult(_0x2d157c,0xc9))['catch'](handleError(_0x2d157c,null));};exports[_0x3f6b('0x26')]=function(_0x36b6f5,_0x326942,_0x2c503c){var _0x3623a5;return db[_0x3f6b('0x44')][_0x3f6b('0x47')]({'where':{'id':_0x36b6f5[_0x3f6b('0x4a')]['id']}})[_0x3f6b('0x25')](function(_0x108435){if(_0x108435){return db[_0x3f6b('0x4b')][_0x3f6b('0x58')](function(_0x5442d4){return _0x108435[_0x3f6b('0x26')]({'transaction':_0x5442d4,'raw':!![]})[_0x3f6b('0x25')](function(_0x3b60cd){if(_0x3b60cd['directory']){fs[_0x3f6b('0x59')](_0x3b60cd[_0x3f6b('0x4c')])[_0x3f6b('0x5a')](function(_0x4c54b7){fs[_0x3f6b('0x5b')](path['join'](_0x3b60cd[_0x3f6b('0x4c')],_0x4c54b7));});fs[_0x3f6b('0x5c')](_0x3b60cd['directory']);}return _0x3b60cd;});})['catch'](function(_0x4aa8a6){throw new db[(_0x3f6b('0x5d'))]['ValidationError'](_0x4aa8a6[_0x3f6b('0x5e')]);});}})[_0x3f6b('0x25')](handleEntityNotFound(_0x326942,null))['then'](removeEntity(_0x326942,null))[_0x3f6b('0x48')](handleError(_0x326942,null));};exports[_0x3f6b('0x5f')]=function(_0x1f3fc1,_0x4ccd6d,_0x4ee66c){return db['sequelize'][_0x3f6b('0x58')](function(_0x431273){var _0x4a4440;return db[_0x3f6b('0x44')][_0x3f6b('0x47')]({'where':{'id':_0x1f3fc1['params']['id']}})[_0x3f6b('0x25')](function(_0x5a89ab){if(_0x5a89ab){_0x4a4440=_0x5a89ab;return _0x5a89ab[_0x3f6b('0x5f')](_0x1f3fc1['body']['id'],{'transaction':_0x431273});}})[_0x3f6b('0x25')](function(_0x1cb4f8){if(_0x1cb4f8){return db[_0x3f6b('0x60')][_0x3f6b('0x61')]({'where':{'id':_0x1f3fc1[_0x3f6b('0x49')]['id']},'attributes':['id',_0x3f6b('0x2b'),_0x3f6b('0x62'),_0x3f6b('0x63'),_0x3f6b('0x64')],'raw':!![]});}})[_0x3f6b('0x25')](function(_0x4f64b3){if(_0x4f64b3){var _0xe941ff=path['join'](config[_0x3f6b('0x65')],_0x3f6b('0x66'),util[_0x3f6b('0x67')]('%s.%s',path[_0x3f6b('0x68')](_0x4f64b3[_0x3f6b('0x62')],path['extname'](_0x4f64b3[_0x3f6b('0x62')])),_0x4f64b3[_0x3f6b('0x63')]));var _0x52bb3d=path[_0x3f6b('0x69')](config['root'],_0x3f6b('0x4d'),_0x4a4440['name'],util[_0x3f6b('0x67')]('%s.%s',_0x4f64b3[_0x3f6b('0x2b')],_0x4f64b3[_0x3f6b('0x63')]));fs['symlinkSync'](_0xe941ff,_0x52bb3d);return _0x4f64b3;}})[_0x3f6b('0x48')](function(_0x12cbbb){throw new db[(_0x3f6b('0x5d'))][(_0x3f6b('0x6a'))](_0x12cbbb[_0x3f6b('0x5e')]);});})[_0x3f6b('0x25')](handleEntityNotFound(_0x4ccd6d,null))[_0x3f6b('0x25')](respondWithResult(_0x4ccd6d,0xc9))[_0x3f6b('0x48')](handleError(_0x4ccd6d,null));};exports[_0x3f6b('0x6b')]=function(_0x3b3d1f,_0x4fdeb7,_0x16ebd9){return db[_0x3f6b('0x4b')]['transaction'](function(_0x100fef){var _0xd646cf;return db[_0x3f6b('0x44')]['findOne']({'where':{'id':_0x3b3d1f['params']['id']}})[_0x3f6b('0x25')](handleEntityNotFound(_0x4fdeb7,null))[_0x3f6b('0x25')](function(_0x44effb){if(_0x44effb){_0xd646cf=_0x44effb;return _0x44effb['removeSound'](_0x3b3d1f[_0x3f6b('0x4a')]['id2']);}})[_0x3f6b('0x25')](function(_0x22b438){if(_0x22b438){return db[_0x3f6b('0x60')][_0x3f6b('0x61')]({'where':{'id':_0x3b3d1f[_0x3f6b('0x4a')]['id2']},'attributes':['id','name',_0x3f6b('0x62'),_0x3f6b('0x63'),_0x3f6b('0x64')],'raw':!![]});}})[_0x3f6b('0x25')](function(_0x26005c){if(_0x26005c){fs[_0x3f6b('0x5b')](path[_0x3f6b('0x69')](_0xd646cf[_0x3f6b('0x4c')],util[_0x3f6b('0x67')](_0x3f6b('0x6c'),_0x26005c[_0x3f6b('0x2b')],_0x26005c[_0x3f6b('0x63')])));return _0x26005c;}})[_0x3f6b('0x48')](function(_0x3b522d){throw new db[(_0x3f6b('0x5d'))][(_0x3f6b('0x6a'))](_0x3b522d['message']);});})[_0x3f6b('0x25')](handleEntityNotFound(_0x4fdeb7,null))['then'](respondWithStatusCode(_0x4fdeb7,0xcc))[_0x3f6b('0x48')](handleError(_0x4fdeb7,null));};exports[_0x3f6b('0x6d')]=function(_0x1ed20d,_0x4b2b46,_0xff06d0){var _0x2b50c3={};var _0x24dd26={};var _0x13dd1c;var _0x50a58e;return db[_0x3f6b('0x44')][_0x3f6b('0x61')]({'where':{'id':_0x1ed20d['params']['id']}})[_0x3f6b('0x25')](handleEntityNotFound(_0x4b2b46,null))[_0x3f6b('0x25')](function(_0x42c0f6){if(_0x42c0f6){_0x13dd1c=_0x42c0f6;_0x24dd26[_0x3f6b('0x31')]=_[_0x3f6b('0x33')](db[_0x3f6b('0x60')][_0x3f6b('0x2f')]);_0x24dd26['query']=_[_0x3f6b('0x33')](_0x1ed20d[_0x3f6b('0x32')]);_0x24dd26['filters']=_['intersection'](_0x24dd26[_0x3f6b('0x31')],_0x24dd26['query']);_0x2b50c3[_0x3f6b('0x36')]=_['intersection'](_0x24dd26['model'],qs[_0x3f6b('0x37')](_0x1ed20d[_0x3f6b('0x32')][_0x3f6b('0x37')]));_0x2b50c3[_0x3f6b('0x36')]=_0x2b50c3[_0x3f6b('0x36')][_0x3f6b('0x38')]?_0x2b50c3[_0x3f6b('0x36')]:_0x24dd26['model'];_0x2b50c3[_0x3f6b('0x3b')]=qs[_0x3f6b('0x3c')](_0x1ed20d[_0x3f6b('0x32')][_0x3f6b('0x3c')]);_0x2b50c3['where']=qs[_0x3f6b('0x34')](_['pick'](_0x1ed20d['query'],_0x24dd26[_0x3f6b('0x34')]));if(_0x1ed20d[_0x3f6b('0x32')][_0x3f6b('0x6e')]){_0x2b50c3[_0x3f6b('0x3d')]=_[_0x3f6b('0x40')](_0x2b50c3[_0x3f6b('0x3d')],{'$or':_['map'](_0x2b50c3[_0x3f6b('0x36')],function(_0x198ddb){var _0x5b0ccd={};_0x5b0ccd[_0x198ddb]={'$like':'%'+_0x1ed20d['query']['filter']+'%'};return _0x5b0ccd;})});}_0x2b50c3=_[_0x3f6b('0x40')]({},_0x2b50c3,_0x1ed20d[_0x3f6b('0x41')]);return _0x13dd1c['getSounds'](_0x2b50c3);}})[_0x3f6b('0x25')](function(_0x184196){if(_0x184196){_0x50a58e=_0x184196[_0x3f6b('0x38')];if(!_0x1ed20d[_0x3f6b('0x32')]['hasOwnProperty']('nolimit')){_0x2b50c3[_0x3f6b('0x1e')]=qs[_0x3f6b('0x1e')](_0x1ed20d[_0x3f6b('0x32')][_0x3f6b('0x1e')]);_0x2b50c3['offset']=qs['offset'](_0x1ed20d[_0x3f6b('0x32')][_0x3f6b('0x1c')]);}return _0x13dd1c['getSounds'](_0x2b50c3);}})[_0x3f6b('0x25')](function(_0x338527){if(_0x338527){return _0x338527?{'count':_0x50a58e,'rows':_0x338527}:null;}})['then'](respondWithResult(_0x4b2b46,null))[_0x3f6b('0x48')](handleError(_0x4b2b46,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 76fc715..4049838 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 _0x556a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x1bc5a3,_0x3b9487){var _0x207f3d=function(_0x2e389d){while(--_0x2e389d){_0x1bc5a3['push'](_0x1bc5a3['shift']());}};_0x207f3d(++_0x3b9487);}(_0x556a,0x66));var _0xa556=function(_0x4ec95f,_0x466921){_0x4ec95f=_0x4ec95f-0x0;var _0x37c866=_0x556a[_0x4ec95f];return _0x37c866;};'use strict';var _=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var logger=require('../../config/logger')(_0xa556('0x2'));var moment=require(_0xa556('0x3'));var BPromise=require(_0xa556('0x4'));var rp=require(_0xa556('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa556('0x6'));var config=require(_0xa556('0x7'));var attributes=require(_0xa556('0x8'));module[_0xa556('0x9')]=function(_0x51a83b,_0x2be1b7){return _0x51a83b[_0xa556('0xa')](_0xa556('0xb'),attributes,{'tableName':_0xa556('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0468=['path','../../config/environment','exports','define','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x343ed8,_0x585e54){var _0x7969eb=function(_0x4abe3b){while(--_0x4abe3b){_0x343ed8['push'](_0x343ed8['shift']());}};_0x7969eb(++_0x585e54);}(_0x0468,0x1a9));var _0x8046=function(_0x17fa1b,_0x5f28db){_0x17fa1b=_0x17fa1b-0x0;var _0x4979e8=_0x0468[_0x17fa1b];return _0x4979e8;};'use strict';var _=require(_0x8046('0x0'));var util=require(_0x8046('0x1'));var logger=require(_0x8046('0x2'))(_0x8046('0x3'));var moment=require(_0x8046('0x4'));var BPromise=require(_0x8046('0x5'));var rp=require(_0x8046('0x6'));var fs=require('fs');var path=require(_0x8046('0x7'));var rimraf=require('rimraf');var config=require(_0x8046('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x8046('0x9')]=function(_0x1b9ebf,_0x2a1305){return _0x1b9ebf[_0x8046('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x8046('0xb'),'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 8d17a13..c72b212 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x605a55,_0x3f5fe6){var _0x30c7fe=function(_0x593947){while(--_0x593947){_0x605a55['push'](_0x605a55['shift']());}};_0x30c7fe(++_0x3f5fe6);}(_0xedd9,0xfc));var _0x9edd=function(_0x526281,_0x8ad7d9){_0x526281=_0x526281-0x0;var _0x38fe96=_0xedd9[_0x526281];return _0x38fe96;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x189c1f,_0x527767){var _0x54b4a6=function(_0x5481e8){while(--_0x5481e8){_0x189c1f['push'](_0x189c1f['shift']());}};_0x54b4a6(++_0x527767);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index c972af2..a449dc8 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 _0xb27d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','index','/describe','isAuthenticated','describe','get','/:id','/:id/users','getAgents','/:id/teams','post','create','addAgents','addTeams','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path'];(function(_0x3072e2,_0x648a09){var _0x42c45b=function(_0x2ddff5){while(--_0x2ddff5){_0x3072e2['push'](_0x3072e2['shift']());}};_0x42c45b(++_0x648a09);}(_0xb27d,0xe5));var _0xdb27=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xb27d[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0xdb27('0x0'));var util=require(_0xdb27('0x1'));var path=require(_0xdb27('0x2'));var timeout=require(_0xdb27('0x3'));var express=require('express');var router=express[_0xdb27('0x4')]();var fs_extra=require(_0xdb27('0x5'));var auth=require(_0xdb27('0x6'));var interaction=require(_0xdb27('0x7'));var config=require(_0xdb27('0x8'));var controller=require(_0xdb27('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdb27('0xa')]);router['get'](_0xdb27('0xb'),auth[_0xdb27('0xc')](),controller[_0xdb27('0xd')]);router[_0xdb27('0xe')](_0xdb27('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0xdb27('0x10'),auth[_0xdb27('0xc')](),controller[_0xdb27('0x11')]);router['get'](_0xdb27('0x12'),auth[_0xdb27('0xc')](),controller['getTeams']);router[_0xdb27('0x13')]('/',auth[_0xdb27('0xc')](),controller[_0xdb27('0x14')]);router[_0xdb27('0x13')](_0xdb27('0x10'),auth[_0xdb27('0xc')](),controller[_0xdb27('0x15')]);router[_0xdb27('0x13')]('/:id/teams',auth[_0xdb27('0xc')](),controller[_0xdb27('0x16')]);router['put']('/:id',auth[_0xdb27('0xc')](),controller[_0xdb27('0x17')]);router[_0xdb27('0x18')](_0xdb27('0xf'),auth['isAuthenticated'](),controller[_0xdb27('0x19')]);router[_0xdb27('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xdb27('0x1a')]);router[_0xdb27('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0xdb27('0x1b')]);module[_0xdb27('0x1c')]=router; \ No newline at end of file +var _0xa5fd=['describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','addAgents','addTeams','update','delete','destroy','removeAgents','removeTeams','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x4a363f,_0x36480a){var _0x391de0=function(_0x55a220){while(--_0x55a220){_0x4a363f['push'](_0x4a363f['shift']());}};_0x391de0(++_0x36480a);}(_0xa5fd,0x90));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xda5f('0x0'));var util=require('util');var path=require(_0xda5f('0x1'));var timeout=require(_0xda5f('0x2'));var express=require(_0xda5f('0x3'));var router=express['Router']();var fs_extra=require(_0xda5f('0x4'));var auth=require(_0xda5f('0x5'));var interaction=require(_0xda5f('0x6'));var config=require(_0xda5f('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0xda5f('0x8')](),controller[_0xda5f('0x9')]);router[_0xda5f('0xa')](_0xda5f('0xb'),auth[_0xda5f('0x8')](),controller[_0xda5f('0xc')]);router['get'](_0xda5f('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xda5f('0xe'),auth['isAuthenticated'](),controller[_0xda5f('0xf')]);router[_0xda5f('0xa')](_0xda5f('0x10'),auth['isAuthenticated'](),controller[_0xda5f('0x11')]);router[_0xda5f('0x12')]('/',auth[_0xda5f('0x8')](),controller['create']);router['post'](_0xda5f('0xe'),auth[_0xda5f('0x8')](),controller[_0xda5f('0x13')]);router[_0xda5f('0x12')]('/:id/teams',auth[_0xda5f('0x8')](),controller[_0xda5f('0x14')]);router['put'](_0xda5f('0xd'),auth[_0xda5f('0x8')](),controller[_0xda5f('0x15')]);router[_0xda5f('0x16')](_0xda5f('0xd'),auth[_0xda5f('0x8')](),controller[_0xda5f('0x17')]);router[_0xda5f('0x16')](_0xda5f('0xe'),auth[_0xda5f('0x8')](),controller[_0xda5f('0x18')]);router[_0xda5f('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xda5f('0x19')]);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 9112e9c..4e9a1a0 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 _0xc34a=['exports','STRING','VIRTUAL','system-','name','INTEGER'];(function(_0x384e80,_0x5ac6c2){var _0x128d4e=function(_0x26f0b2){while(--_0x26f0b2){_0x384e80['push'](_0x384e80['shift']());}};_0x128d4e(++_0x5ac6c2);}(_0xc34a,0xfc));var _0xac34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xac34('0x0')]={'name':{'type':Sequelize[_0xac34('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xac34('0x2')],'get':function(_0x885911){return _0xac34('0x3')+this['getDataValue'](_0xac34('0x4'))+'-';}},'description':{'type':Sequelize[_0xac34('0x1')]},'callerIdAll':{'type':Sequelize[_0xac34('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xac34('0x5')]}}; \ No newline at end of file +var _0x0df1=['getDataValue','STRING','sequelize','exports','name','VIRTUAL','system-'];(function(_0x57ebf7,_0x38f43b){var _0x199719=function(_0x562475){while(--_0x562475){_0x57ebf7['push'](_0x57ebf7['shift']());}};_0x199719(++_0x38f43b);}(_0x0df1,0xc6));var _0x10df=function(_0x177d0e,_0xcfb1b9){_0x177d0e=_0x177d0e-0x0;var _0x152ce7=_0x0df1[_0x177d0e];return _0x152ce7;};'use strict';var Sequelize=require(_0x10df('0x0'));module[_0x10df('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x10df('0x2')},'prefix':{'type':Sequelize[_0x10df('0x3')],'get':function(_0x35e0bb){return _0x10df('0x4')+this[_0x10df('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x10df('0x6')]},'callerIdAll':{'type':Sequelize[_0x10df('0x6')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2066531..fd568bb 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 _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8603,0x190));var _0x3860=function(_0x56dd58,_0xb1287d){_0x56dd58=_0x56dd58-0x0;var _0x103e75=_0x8603[_0x56dd58];return _0x103e75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file +var _0x2032=['sequelize','body','VoiceExtension','user','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','charAt','system-','transaction','findById','ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','sort','nolimit','Team','getTeams','addTeams','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','findOrCreate','forEach','userVoicePrefix:save','removeTeams','User','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','sendStatus','status','end','offset','limit','count','set','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','describe','create'];(function(_0x326adb,_0x498980){var _0x98d4e9=function(_0x3ded4f){while(--_0x3ded4f){_0x326adb['push'](_0x326adb['shift']());}};_0x98d4e9(++_0x498980);}(_0x2032,0xd9));var _0x2203=function(_0x4700ee,_0x329723){_0x4700ee=_0x4700ee-0x0;var _0xd1f3da=_0x2032[_0x4700ee];return _0xd1f3da;};'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'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2203('0x18')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x21a3af,_0x472265){_0x472265=_0x472265||0xcc;return function(_0x1c1ead){if(_0x1c1ead){return _0x21a3af[_0x2203('0x19')](_0x472265);}return _0x21a3af[_0x2203('0x1a')](_0x472265)[_0x2203('0x1b')]();};}function respondWithResult(_0x2c36e6,_0x2c085c){_0x2c085c=_0x2c085c||0xc8;return function(_0xdf9d0b){if(_0xdf9d0b){return _0x2c36e6[_0x2203('0x1a')](_0x2c085c)['json'](_0xdf9d0b);}};}function respondWithFilteredResult(_0x280eda,_0x2ee127){return function(_0x4893ff){if(_0x4893ff){var _0x3f9ef6=typeof _0x2ee127[_0x2203('0x1c')]==='undefined'&&typeof _0x2ee127[_0x2203('0x1d')]==='undefined';var _0x2904ba=_0x4893ff[_0x2203('0x1e')];var _0x3c8c34=_0x3f9ef6?0x0:_0x2ee127[_0x2203('0x1c')];var _0x15cb1a=_0x3f9ef6?_0x4893ff[_0x2203('0x1e')]:_0x2ee127['offset']+_0x2ee127[_0x2203('0x1d')];var _0x50822b;if(_0x15cb1a>=_0x2904ba){_0x15cb1a=_0x2904ba;_0x50822b=0xc8;}else{_0x50822b=0xce;}_0x280eda['status'](_0x50822b);return _0x280eda[_0x2203('0x1f')]('Content-Range',_0x3c8c34+'-'+_0x15cb1a+'/'+_0x2904ba)[_0x2203('0x20')](_0x4893ff);}return null;};}function patchUpdates(_0x5bfe61){return function(_0x5d4c4e){try{jsonpatch[_0x2203('0x21')](_0x5d4c4e,_0x5bfe61,!![]);}catch(_0x5e29cd){return BPromise['reject'](_0x5e29cd);}return _0x5d4c4e[_0x2203('0x22')]();};}function saveUpdates(_0x2718f5,_0x21f930){return function(_0xfd0970){if(_0xfd0970){return _0xfd0970[_0x2203('0x23')](_0x2718f5)[_0x2203('0x24')](function(_0x49c12){return _0x49c12;});}return null;};}function removeEntity(_0x250349,_0x576378){return function(_0x143f41){if(_0x143f41){return _0x143f41[_0x2203('0x25')]()[_0x2203('0x24')](function(){var _0x5f11bf=_0x143f41[_0x2203('0x26')]({'plain':!![]});var _0x1cec17='VoicePrefixes';return db[_0x2203('0x27')][_0x2203('0x25')]({'where':{'type':_0x1cec17,'resourceId':_0x5f11bf['id']}})[_0x2203('0x24')](function(){return _0x143f41;});})[_0x2203('0x24')](function(){_0x250349[_0x2203('0x1a')](0xcc)[_0x2203('0x1b')]();});}};}function handleEntityNotFound(_0x9c53f,_0x5a95c1){return function(_0x34b8ba){if(!_0x34b8ba){_0x9c53f[_0x2203('0x19')](0x194);}return _0x34b8ba;};}function handleError(_0x406ce9,_0x74f035){_0x74f035=_0x74f035||0x1f4;return function(_0x52a426){logger[_0x2203('0x28')](_0x52a426[_0x2203('0x29')]);if(_0x52a426[_0x2203('0x2a')]){delete _0x52a426[_0x2203('0x2a')];}_0x406ce9['status'](_0x74f035)[_0x2203('0x2b')](_0x52a426);};}exports[_0x2203('0x2c')]=function(_0x5e6560,_0x5c0157){var _0x1d5f74={},_0x52fafc={},_0x58b44d={'count':0x0,'rows':[]};var _0x125dfc=_[_0x2203('0x2d')](db[_0x2203('0x2e')][_0x2203('0x2f')],function(_0xf2801d){return{'name':_0xf2801d['fieldName'],'type':_0xf2801d[_0x2203('0x30')][_0x2203('0x31')]};});_0x52fafc['model']=_[_0x2203('0x2d')](_0x125dfc,_0x2203('0x2a'));_0x52fafc[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5e6560[_0x2203('0x32')]);_0x52fafc[_0x2203('0x34')]=_[_0x2203('0x35')](_0x52fafc[_0x2203('0x36')],_0x52fafc[_0x2203('0x32')]);_0x1d5f74['attributes']=_[_0x2203('0x35')](_0x52fafc[_0x2203('0x36')],qs['fields'](_0x5e6560['query'][_0x2203('0x37')]));_0x1d5f74['attributes']=_0x1d5f74[_0x2203('0x38')][_0x2203('0x39')]?_0x1d5f74[_0x2203('0x38')]:_0x52fafc['model'];if(!_0x5e6560['query'][_0x2203('0x3a')]('nolimit')){_0x1d5f74[_0x2203('0x1d')]=qs['limit'](_0x5e6560[_0x2203('0x32')]['limit']);_0x1d5f74[_0x2203('0x1c')]=qs[_0x2203('0x1c')](_0x5e6560[_0x2203('0x32')][_0x2203('0x1c')]);}_0x1d5f74[_0x2203('0x3b')]=qs['sort'](_0x5e6560['query']['sort']);_0x1d5f74[_0x2203('0x3c')]=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0x5e6560[_0x2203('0x32')],_0x52fafc[_0x2203('0x34')]),_0x125dfc);if(_0x5e6560[_0x2203('0x32')][_0x2203('0x3e')]){_0x1d5f74['where']=_[_0x2203('0x3f')](_0x1d5f74[_0x2203('0x3c')],{'$or':_[_0x2203('0x2d')](_0x125dfc,function(_0x26be74){if(_0x26be74['type']!=='VIRTUAL'){var _0x3ddfe0={};_0x3ddfe0[_0x26be74['name']]={'$like':'%'+_0x5e6560[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x3ddfe0;}})});}_0x1d5f74=_[_0x2203('0x3f')]({},_0x1d5f74,_0x5e6560['options']);var _0x5bba52={'where':_0x1d5f74[_0x2203('0x3c')]};return db[_0x2203('0x2e')][_0x2203('0x1e')](_0x5bba52)[_0x2203('0x24')](function(_0x372709){_0x58b44d[_0x2203('0x1e')]=_0x372709;if(_0x5e6560['query'][_0x2203('0x40')]){_0x1d5f74[_0x2203('0x41')]=[{'all':!![]}];}return db[_0x2203('0x2e')][_0x2203('0x42')](_0x1d5f74);})[_0x2203('0x24')](function(_0x36b99f){_0x58b44d[_0x2203('0x43')]=_0x36b99f;return _0x58b44d;})[_0x2203('0x24')](respondWithFilteredResult(_0x5c0157,_0x1d5f74))[_0x2203('0x44')](handleError(_0x5c0157,null));};exports[_0x2203('0x45')]=function(_0x595281,_0x2e2ca5){var _0x24e773={'raw':![],'where':{'id':_0x595281[_0x2203('0x46')]['id']}},_0x4aab80={};_0x4aab80['model']=_['keys'](db[_0x2203('0x2e')]['rawAttributes']);_0x4aab80[_0x2203('0x32')]=_[_0x2203('0x33')](_0x595281[_0x2203('0x32')]);_0x4aab80[_0x2203('0x34')]=_['intersection'](_0x4aab80[_0x2203('0x36')],_0x4aab80[_0x2203('0x32')]);_0x24e773['attributes']=_[_0x2203('0x35')](_0x4aab80[_0x2203('0x36')],qs[_0x2203('0x37')](_0x595281[_0x2203('0x32')]['fields']));_0x24e773['attributes']=_0x24e773[_0x2203('0x38')]['length']?_0x24e773['attributes']:_0x4aab80[_0x2203('0x36')];if(_0x595281[_0x2203('0x32')][_0x2203('0x40')]){_0x24e773['include']=[{'all':!![]}];}_0x24e773=_['merge']({},_0x24e773,_0x595281[_0x2203('0x47')]);return db[_0x2203('0x2e')][_0x2203('0x48')](_0x24e773)[_0x2203('0x24')](handleEntityNotFound(_0x2e2ca5,null))[_0x2203('0x24')](respondWithResult(_0x2e2ca5,null))[_0x2203('0x44')](handleError(_0x2e2ca5,null));};exports['destroy']=function(_0x747dce,_0x557659){return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x747dce[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x557659,null))['then'](removeEntity(_0x557659,null))['catch'](handleError(_0x557659,null));};exports[_0x2203('0x49')]=function(_0x1f772d,_0x126aad){return db[_0x2203('0x2e')]['describe']()['then'](respondWithResult(_0x126aad,null))['catch'](handleError(_0x126aad,null));};exports[_0x2203('0x4a')]=function(_0x1c2734,_0x57b891){var _0x7f61df;return db[_0x2203('0x4b')]['transaction'](function(_0x32b1db){return db[_0x2203('0x2e')][_0x2203('0x4a')](_0x1c2734[_0x2203('0x4c')],{'transaction':_0x32b1db})['then'](function(_0x120db1){_0x7f61df=_0x120db1['get']({'plain':!![]});return db[_0x2203('0x4d')][_0x2203('0x48')]({'where':{'id':_0x7f61df['VoiceExtensionId']},'raw':!![]})[_0x2203('0x24')](function(_0x8d089e){return createVoicePrefixExtensions(_0x7f61df,_0x8d089e,_0x32b1db);});});})[_0x2203('0x24')](function(){var _0x378132=_0x1c2734[_0x2203('0x4e')][_0x2203('0x26')]({'plain':!![]});if(!_0x378132)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x378132['role']===_0x2203('0x4e')){var _0x524356=_0x7f61df;return db['UserProfileSection'][_0x2203('0x48')]({'where':{'name':_0x2203('0x4f'),'userProfileId':_0x378132[_0x2203('0x50')]},'raw':!![]})['then'](function(_0x213c24){if(_0x213c24&&_0x213c24['autoAssociation']===0x0){return db['UserProfileResource'][_0x2203('0x4a')]({'name':_0x524356['name'],'resourceId':_0x524356['id'],'type':_0x213c24['name'],'sectionId':_0x213c24['id']},{})['then'](function(){return _0x7f61df;});}else{return _0x7f61df;}})[_0x2203('0x44')](function(_0x31256b){logger[_0x2203('0x28')](_0x2203('0x51'),_0x31256b);throw _0x31256b;});}return _0x7f61df;})[_0x2203('0x24')](respondWithResult(_0x57b891,null))[_0x2203('0x44')](handleError(_0x57b891,null));};function Extension(_0x2baea2,_0x91f70c,_0x36b5fb,_0x216641){this[_0x2203('0x52')]=_0x2203('0x53');this['exten']=_0x2baea2;this['app']=_0x36b5fb;this[_0x2203('0x30')]=_0x2203('0x54');this[_0x2203('0x55')]=_0x2203('0x56');this[_0x2203('0x57')]=_0x91f70c;this[_0x2203('0x58')]=_0x216641;}function createVoicePrefixExtensions(_0x4f8b8e,_0x5486f9,_0xb49120){return new BPromise(function(_0x34358e,_0x21ee59){var _0x1e6d21=new Extension(formatPrefixName(_0x4f8b8e[_0x2203('0x59')]),0x1,_0x2203('0x5a'),_0x2203('0x5b'));_0x1e6d21[_0x2203('0x5c')]=_0x4f8b8e['id'];return db[_0x2203('0x4d')][_0x2203('0x4a')](_0x1e6d21,{'transaction':_0xb49120})[_0x2203('0x24')](function(_0x48bed1){var _0x1ea97a=_0x48bed1[_0x2203('0x26')]({'plain':!![]});var _0x3ce9f5=_[_0x2203('0x2d')](addVoicePrefixExtensions(_0x4f8b8e,_0x5486f9),function(_0x41a938){_0x41a938[_0x2203('0x5d')]=_0x1ea97a['id'];_0x41a938[_0x2203('0x5c')]=_0x4f8b8e['id'];return _0x41a938;});return db[_0x2203('0x4d')][_0x2203('0x5e')](_0x3ce9f5,{'transaction':_0xb49120})[_0x2203('0x24')](function(_0x49e795){if(!_0x49e795){return _0x21ee59(_0x2203('0x5f'));}else{return _0x34358e(_0x49e795);}})[_0x2203('0x44')](function(_0x24179a){return _0x21ee59(_0x24179a);});});;});};function addVoicePrefixExtensions(_0xc193b7,_0x34e820){var _0x1e44c=[];var _0x1068bc=formatPrefixName(_0xc193b7[_0x2203('0x59')]);_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x2,'Set',_0x2203('0x61')+_0xc193b7[_0x2203('0x2a')]));if(_0xc193b7[_0x2203('0x62')]){_0x1e44c['push'](new Extension(_0x1068bc,0x3,_0x2203('0x63'),_0x2203('0x64')+_0xc193b7[_0x2203('0x62')]));}else{_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x3,_0x2203('0x5a'),'No\x20callerid\x20available'));}_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x4,_0x2203('0x65'),_0x34e820[_0x2203('0x52')]+','+'${EXTEN:'+(0x8+_0xc193b7['name']['length'])+'}'+','+0x1));return _0x1e44c;}function formatPrefixName(_0x485e5b){var _0x595814='_';for(var _0x418d48=0x0;_0x418d48<_0x485e5b[_0x2203('0x39')];_0x418d48++){if(_0x485e5b[_0x2203('0x66')](_0x418d48)=='-'){_0x595814+=_0x485e5b[_0x2203('0x66')](_0x418d48);}else{_0x595814+='['+_0x485e5b[_0x2203('0x66')](_0x418d48)+']';}}_0x595814+='.';return _0x595814;}exports[_0x2203('0x23')]=function(_0x3f7926,_0x44bea0,_0x56dcbe){var _0x500860=_0x3f7926[_0x2203('0x4c')];_0x500860[_0x2203('0x59')]=_0x2203('0x67')+_0x500860[_0x2203('0x2a')]+'-';return db[_0x2203('0x4b')][_0x2203('0x68')](function(_0x45cc3a){return db[_0x2203('0x2e')][_0x2203('0x23')](_0x500860,{'where':{'id':_0x500860['id']},'transaction':_0x45cc3a})[_0x2203('0x24')](function(){return db[_0x2203('0x4d')][_0x2203('0x25')]({'where':{'VoicePrefixId':_0x500860['id']},'transaction':_0x45cc3a})[_0x2203('0x24')](function(){return db[_0x2203('0x4d')][_0x2203('0x48')]({'where':{'id':_0x500860[_0x2203('0x5d')]},'raw':!![]})[_0x2203('0x24')](function(_0x173ac1){return createVoicePrefixExtensions(_0x500860,_0x173ac1,_0x45cc3a);});});});})[_0x2203('0x24')](function(){return db['VoicePrefix'][_0x2203('0x69')](_0x500860['id']);})['then'](respondWithResult(_0x44bea0,null))[_0x2203('0x44')](handleError(_0x44bea0,null));};exports['addAgents']=function(_0x5ba500,_0xf71e7e,_0x269649){return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x5ba500[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0xf71e7e,null))[_0x2203('0x24')](function(_0x4e9a01){if(_0x4e9a01){return _0x4e9a01['addAgents'](_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')],_[_0x2203('0x6b')](_0x5ba500['body'],['ids','id'])||{})['spread'](function(_0xdff006){for(var _0x2d26ba=0x0;_0x2d26ba<_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')]['length'];_0x2d26ba+=0x1){socket[_0x2203('0x6c')]('userVoicePrefix:save',{'UserId':Number(_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')][_0x2d26ba]),'VoicePrefixId':Number(_0x5ba500[_0x2203('0x46')]['id'])});}return _0xdff006;});}})[_0x2203('0x24')](respondWithResult(_0xf71e7e,null))[_0x2203('0x44')](handleError(_0xf71e7e,null));};exports['removeAgents']=function(_0x4592fa,_0x247f26,_0x18663f){return db['VoicePrefix'][_0x2203('0x48')]({'where':{'id':_0x4592fa[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x247f26,null))[_0x2203('0x24')](function(_0x1c65f9){if(_0x1c65f9){return _0x1c65f9[_0x2203('0x6d')](_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')])[_0x2203('0x24')](function(){if(_[_0x2203('0x6e')](_0x4592fa[_0x2203('0x32')]['ids'])){for(var _0x1adfa6=0x0;_0x1adfa6<_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')][_0x2203('0x39')];_0x1adfa6+=0x1){socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':Number(_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')][_0x1adfa6]),'VoicePrefixId':Number(_0x4592fa[_0x2203('0x46')]['id'])});}}else{socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':Number(_0x4592fa[_0x2203('0x32')]['ids']),'VoicePrefixId':Number(_0x4592fa['params']['id'])});}});}})[_0x2203('0x24')](respondWithStatusCode(_0x247f26,null))[_0x2203('0x44')](handleError(_0x247f26,null));};exports[_0x2203('0x70')]=function(_0xb6863b,_0x42dce6,_0x4fd029){var _0x16e518={};var _0x3cb792={};var _0x4e539b;var _0x511689;return db['VoicePrefix']['findOne']({'where':{'id':_0xb6863b['params']['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x42dce6,null))[_0x2203('0x24')](function(_0x437095){if(_0x437095){_0x4e539b=_0x437095;_0x3cb792['model']=_['keys'](db['User'][_0x2203('0x2f')]);_0x3cb792[_0x2203('0x32')]=_[_0x2203('0x33')](_0xb6863b[_0x2203('0x32')]);_0x3cb792[_0x2203('0x34')]=_[_0x2203('0x35')](_0x3cb792[_0x2203('0x36')],_0x3cb792['query']);_0x16e518[_0x2203('0x38')]=_[_0x2203('0x35')](_0x3cb792[_0x2203('0x36')],qs[_0x2203('0x37')](_0xb6863b[_0x2203('0x32')][_0x2203('0x37')]));_0x16e518[_0x2203('0x38')]=_0x16e518['attributes'][_0x2203('0x39')]?_0x16e518['attributes']:_0x3cb792['model'];_0x16e518[_0x2203('0x3b')]=qs['sort'](_0xb6863b[_0x2203('0x32')][_0x2203('0x71')]);_0x16e518['where']=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0xb6863b[_0x2203('0x32')],_0x3cb792[_0x2203('0x34')]));if(_0xb6863b[_0x2203('0x32')][_0x2203('0x3e')]){_0x16e518['where']=_[_0x2203('0x3f')](_0x16e518[_0x2203('0x3c')],{'$or':_['map'](_0x16e518['attributes'],function(_0x377176){var _0x3fe71b={};_0x3fe71b[_0x377176]={'$like':'%'+_0xb6863b[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x3fe71b;})});}_0x16e518=_[_0x2203('0x3f')]({},_0x16e518,_0xb6863b[_0x2203('0x47')]);return _0x4e539b[_0x2203('0x70')](_0x16e518);}})[_0x2203('0x24')](function(_0x4749df){if(_0x4749df){_0x511689=_0x4749df[_0x2203('0x39')];if(!_0xb6863b[_0x2203('0x32')][_0x2203('0x3a')](_0x2203('0x72'))){_0x16e518[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0xb6863b[_0x2203('0x32')]['limit']);_0x16e518['offset']=qs[_0x2203('0x1c')](_0xb6863b[_0x2203('0x32')]['offset']);}return _0x4e539b[_0x2203('0x70')](_0x16e518);}})[_0x2203('0x24')](function(_0x5b5e95){if(_0x5b5e95){return _0x5b5e95?{'count':_0x511689,'rows':_0x5b5e95}:null;}})[_0x2203('0x24')](respondWithResult(_0x42dce6,null))[_0x2203('0x44')](handleError(_0x42dce6,null));};exports['getTeams']=function(_0x21f357,_0x10c65a,_0x541639){var _0x318f3f={};var _0x1c4b57={};var _0x3cfe3f;var _0x1596f7;return db['VoicePrefix']['findOne']({'where':{'id':_0x21f357[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x10c65a,null))[_0x2203('0x24')](function(_0x4ff77f){if(_0x4ff77f){_0x3cfe3f=_0x4ff77f;_0x1c4b57['model']=_[_0x2203('0x33')](db[_0x2203('0x73')][_0x2203('0x2f')]);_0x1c4b57['query']=_['keys'](_0x21f357[_0x2203('0x32')]);_0x1c4b57[_0x2203('0x34')]=_['intersection'](_0x1c4b57[_0x2203('0x36')],_0x1c4b57[_0x2203('0x32')]);_0x318f3f['attributes']=_[_0x2203('0x35')](_0x1c4b57['model'],qs[_0x2203('0x37')](_0x21f357['query']['fields']));_0x318f3f['attributes']=_0x318f3f[_0x2203('0x38')][_0x2203('0x39')]?_0x318f3f['attributes']:_0x1c4b57[_0x2203('0x36')];_0x318f3f[_0x2203('0x3b')]=qs[_0x2203('0x71')](_0x21f357['query'][_0x2203('0x71')]);_0x318f3f['where']=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0x21f357['query'],_0x1c4b57[_0x2203('0x34')]));if(_0x21f357[_0x2203('0x32')]['filter']){_0x318f3f[_0x2203('0x3c')]=_[_0x2203('0x3f')](_0x318f3f[_0x2203('0x3c')],{'$or':_[_0x2203('0x2d')](_0x318f3f[_0x2203('0x38')],function(_0x5d73a7){var _0x2ba7d3={};_0x2ba7d3[_0x5d73a7]={'$like':'%'+_0x21f357[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x2ba7d3;})});}_0x318f3f=_[_0x2203('0x3f')]({},_0x318f3f,_0x21f357[_0x2203('0x47')]);return _0x3cfe3f[_0x2203('0x74')](_0x318f3f);}})['then'](function(_0x29b41b){if(_0x29b41b){_0x1596f7=_0x29b41b[_0x2203('0x39')];if(!_0x21f357['query'][_0x2203('0x3a')]('nolimit')){_0x318f3f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x21f357[_0x2203('0x32')]['limit']);_0x318f3f[_0x2203('0x1c')]=qs[_0x2203('0x1c')](_0x21f357[_0x2203('0x32')][_0x2203('0x1c')]);}return _0x3cfe3f[_0x2203('0x74')](_0x318f3f);}})[_0x2203('0x24')](function(_0x1ccf09){if(_0x1ccf09){return _0x1ccf09?{'count':_0x1596f7,'rows':_0x1ccf09}:null;}})['then'](respondWithResult(_0x10c65a,null))['catch'](handleError(_0x10c65a,null));};exports[_0x2203('0x75')]=function(_0x41eb4c,_0x25996c,_0x4e1f55){var _0x2188d4=_0x41eb4c[_0x2203('0x4c')][_0x2203('0x6a')];var _0x500604;return db[_0x2203('0x73')][_0x2203('0x42')]({'where':{'id':_0x2188d4},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2203('0x76'),'attributes':['id','name',_0x2203('0x77'),_0x2203('0x78'),'interface'],'raw':!![]}]})[_0x2203('0x24')](function(_0x9586e1){if(_0x9586e1){_0x500604=_0x9586e1;var _0x266d7e=_[_0x2203('0x79')](_0x9586e1,function(_0x34a160){var _0x36ab7f=_0x34a160[_0x2203('0x26')]({'plain':!![]});return _0x36ab7f[_0x2203('0x76')];});return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x41eb4c[_0x2203('0x46')]['id']}})[_0x2203('0x24')](function(_0x4e7ba1){return db[_0x2203('0x4b')]['transaction'](function(_0x114e07){return _0x4e7ba1[_0x2203('0x75')](_0x2188d4,{'transaction':_0x114e07})[_0x2203('0x24')](function(){return BPromise[_0x2203('0x7a')](_0x500604,function(_0x145a72){return db[_0x2203('0x7b')][_0x2203('0x7c')]({'TeamId':_0x145a72['id'],'VoicePrefixId':_0x41eb4c[_0x2203('0x46')]['id']},{'transaction':_0x114e07});});})[_0x2203('0x24')](function(){return BPromise[_0x2203('0x7a')](_0x266d7e,function(_0x62843c){return db['UserVoicePrefix'][_0x2203('0x7d')]({'where':{'UserId':_0x62843c['id'],'VoicePrefixId':_0x41eb4c['params']['id']},'transaction':_0x114e07});});})[_0x2203('0x24')](function(){_0x266d7e[_0x2203('0x7e')](function(_0x6b8ea4){socket['emit'](_0x2203('0x7f'),{'UserId':_0x6b8ea4['id'],'VoicePrefixId':_0x4e7ba1['id']});});});});});}})[_0x2203('0x24')](respondWithStatusCode(_0x25996c,null))[_0x2203('0x44')](handleError(_0x25996c,null));};exports[_0x2203('0x80')]=function(_0x4316ae,_0x5c1138,_0x389f7f){return db['Team'][_0x2203('0x42')]({'where':{'id':_0x4316ae[_0x2203('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2203('0x81')],'as':_0x2203('0x76'),'attributes':['id'],'raw':!![]}]})[_0x2203('0x24')](handleEntityNotFound(_0x5c1138,null))[_0x2203('0x24')](function(_0x56c2cb){var _0x12179d=_['map'](_0x56c2cb,'id');var _0x55e083=[];var _0x4055eb=[];var _0x95b45a=squel[_0x2203('0x82')]();_0x95b45a[_0x2203('0x83')](_0x2203('0x84'))[_0x2203('0x85')](_0x2203('0x86'),'tq')['join'](_0x2203('0x87'),'ut',_0x2203('0x88'))[_0x2203('0x3c')]('VoicePrefixId\x20=\x20?',_0x4316ae['params']['id']);for(var _0x4d6ece=0x0;_0x4d6ece<_0x56c2cb[_0x2203('0x39')];_0x4d6ece+=0x1){let _0x46b5e6=_0x56c2cb[_0x4d6ece];for(var _0x3dba31=0x0;_0x3dba31<_0x46b5e6[_0x2203('0x76')]['length'];_0x3dba31+=0x1){let _0x238e6f=_0x46b5e6[_0x2203('0x76')][_0x3dba31];var _0x46146e=_0x95b45a[_0x2203('0x89')]();_0x46146e['where']('ut.UserId\x20=\x20?',_0x238e6f['id']);_0x4055eb[_0x2203('0x60')](db[_0x2203('0x4b')][_0x2203('0x32')](_0x46146e['toString'](),{'type':db[_0x2203('0x4b')][_0x2203('0x8a')][_0x2203('0x8b')]})[_0x2203('0x24')](function(_0x263130){if(_0x263130[_0x2203('0x39')]===0x1){return _0x238e6f['id'];}else{var _0xbee79c=_['every'](_[_0x2203('0x2d')](_0x263130,_0x2203('0x8c')),function(_0x131332){return _[_0x2203('0x8d')](_0x12179d,_0x131332);});if(_0xbee79c){return _0x238e6f['id'];}}}));}}return BPromise[_0x2203('0x8e')](_0x4055eb)[_0x2203('0x24')](function(_0x2d9004){_0x55e083=_(_0x55e083)[_0x2203('0x8f')](_0x2d9004)[_0x2203('0x90')]()['value']();return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x4316ae[_0x2203('0x46')]['id']}})[_0x2203('0x24')](function(_0x547eb9){return db[_0x2203('0x4b')][_0x2203('0x68')](function(_0x1022ef){return _0x547eb9[_0x2203('0x80')](_0x4316ae[_0x2203('0x32')][_0x2203('0x6a')],{'transaction':_0x1022ef})[_0x2203('0x24')](function(){if(!_[_0x2203('0x91')](_0x55e083)){return _0x547eb9[_0x2203('0x6d')](_0x55e083,{'transaction':_0x1022ef});}})['then'](function(){_0x55e083['forEach'](function(_0x225ea1){socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':_0x225ea1,'VoicePrefixId':_0x547eb9['id']});});});});});});})[_0x2203('0x24')](respondWithStatusCode(_0x5c1138,null))['catch'](handleError(_0x5c1138,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index e10a793..dafac6c 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 _0xfa77=['emit','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x4b97c3,_0x49e7e9){var _0x485045=function(_0x287c8a){while(--_0x287c8a){_0x4b97c3['push'](_0x4b97c3['shift']());}};_0x485045(++_0x49e7e9);}(_0xfa77,0x133));var _0x7fa7=function(_0x2d7a61,_0x256493){_0x2d7a61=_0x2d7a61-0x0;var _0x510928=_0xfa77[_0x2d7a61];return _0x510928;};'use strict';var EventEmitter=require(_0x7fa7('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7fa7('0x1')](0x0);var events={'afterCreate':_0x7fa7('0x2'),'afterUpdate':_0x7fa7('0x3'),'afterDestroy':_0x7fa7('0x4')};function emitEvent(_0x1308f9){return function(_0x2b01a5,_0x46e5e3,_0x2c1f85){VoicePrefixEvents[_0x7fa7('0x5')](_0x1308f9+':'+_0x2b01a5['id'],_0x2b01a5);VoicePrefixEvents['emit'](_0x1308f9,_0x2b01a5);_0x2c1f85(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x7fa7('0x6')](e,emitEvent(event));}}module[_0x7fa7('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x0fe9=['../../mysqldb','VoicePrefix','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5f3f99,_0x1de87d){var _0x531aa3=function(_0x3fd360){while(--_0x3fd360){_0x5f3f99['push'](_0x5f3f99['shift']());}};_0x531aa3(++_0x1de87d);}(_0x0fe9,0x157));var _0x90fe=function(_0x52f521,_0xc591f5){_0x52f521=_0x52f521-0x0;var _0x4d2f52=_0x0fe9[_0x52f521];return _0x4d2f52;};'use strict';var EventEmitter=require(_0x90fe('0x0'));var VoicePrefix=require(_0x90fe('0x1'))['db'][_0x90fe('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x90fe('0x3')};function emitEvent(_0x1fea78){return function(_0x223022,_0x44ac56,_0xceb666){VoicePrefixEvents[_0x90fe('0x4')](_0x1fea78+':'+_0x223022['id'],_0x223022);VoicePrefixEvents[_0x90fe('0x4')](_0x1fea78,_0x223022);_0xceb666(null);};}for(var e in events){if(events[_0x90fe('0x5')](e)){var event=events[e];VoicePrefix[_0x90fe('0x6')](e,emitEvent(event));}}module[_0x90fe('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index bfa95ad..ec688e6 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 _0x915b=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes'];(function(_0x4ca88f,_0xbd5b23){var _0x4bd853=function(_0xac771f){while(--_0xac771f){_0x4ca88f['push'](_0x4ca88f['shift']());}};_0x4bd853(++_0xbd5b23);}(_0x915b,0xfd));var _0xb915=function(_0x3a4eb0,_0x47488c){_0x3a4eb0=_0x3a4eb0-0x0;var _0x47335b=_0x915b[_0x3a4eb0];return _0x47335b;};'use strict';var _=require(_0xb915('0x0'));var util=require(_0xb915('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb915('0x2'));var BPromise=require('bluebird');var rp=require(_0xb915('0x3'));var fs=require('fs');var path=require(_0xb915('0x4'));var rimraf=require(_0xb915('0x5'));var config=require(_0xb915('0x6'));var attributes=require(_0xb915('0x7'));module['exports']=function(_0x456ac3,_0x144b4d){return _0x456ac3[_0xb915('0x8')](_0xb915('0x9'),attributes,{'tableName':_0xb915('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc711=['voice_prefixes','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x1f06e5,_0x189c32){var _0x3e61f9=function(_0x1ec9a8){while(--_0x1ec9a8){_0x1f06e5['push'](_0x1f06e5['shift']());}};_0x3e61f9(++_0x189c32);}(_0xc711,0x114));var _0x1c71=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xc711[_0x22c684];return _0x39fcbb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c71('0x0'))('api');var moment=require(_0x1c71('0x1'));var BPromise=require(_0x1c71('0x2'));var rp=require(_0x1c71('0x3'));var fs=require('fs');var path=require(_0x1c71('0x4'));var rimraf=require('rimraf');var config=require(_0x1c71('0x5'));var attributes=require(_0x1c71('0x6'));module[_0x1c71('0x7')]=function(_0x4e85d7,_0x112b31){return _0x4e85d7[_0x1c71('0x8')](_0x1c71('0x9'),attributes,{'tableName':_0x1c71('0xa'),'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 bca7a1d..f612bf8 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 _0x1410=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x1410,0x130));var _0x0141=function(_0x763b64,_0x291bdf){_0x763b64=_0x763b64-0x0;var _0x1e6b5e=_0x1410[_0x763b64];return _0x1e6b5e;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0141('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0141('0x5'));var logger=require('../../config/logger')(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});config[_0x0141('0xb')]=_[_0x0141('0xc')](config[_0x0141('0xb')],{'host':_0x0141('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0141('0xb')]));require(_0x0141('0xe'))[_0x0141('0xf')](socket);function respondWithRpcPromise(_0x3465f2,_0x1b6b66,_0x1798ae){return new BPromise(function(_0x3f5e8f,_0x5f368f){return client['request'](_0x3465f2,_0x1798ae)[_0x0141('0x10')](function(_0x3b7718){logger[_0x0141('0x11')](_0x0141('0x12'),_0x1b6b66,'request\x20sent');logger['debug'](_0x0141('0x13'),_0x1b6b66,_0x0141('0x14'),JSON['stringify'](_0x3b7718));if(_0x3b7718[_0x0141('0x15')]){if(_0x3b7718[_0x0141('0x15')][_0x0141('0x16')]===0x1f4){logger[_0x0141('0x15')](_0x0141('0x12'),_0x1b6b66,_0x3b7718['error'][_0x0141('0x17')]);return _0x5f368f(_0x3b7718['error'][_0x0141('0x17')]);}logger[_0x0141('0x15')](_0x0141('0x12'),_0x1b6b66,_0x3b7718[_0x0141('0x15')][_0x0141('0x17')]);return _0x3f5e8f(_0x3b7718[_0x0141('0x15')]['message']);}else{logger['info'](_0x0141('0x12'),_0x1b6b66,_0x0141('0x14'));_0x3f5e8f(_0x3b7718['result'][_0x0141('0x17')]);}})[_0x0141('0x18')](function(_0x8beed8){logger[_0x0141('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x1b6b66,_0x8beed8);_0x5f368f(_0x8beed8);});});} \ No newline at end of file +var _0x649f=['request','then','info','VoicePrefix,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x15419f,_0x30daff){var _0x1bae26=function(_0x3a0b18){while(--_0x3a0b18){_0x15419f['push'](_0x15419f['shift']());}};_0x1bae26(++_0x30daff);}(_0x649f,0x93));var _0xf649=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x649f[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var moment=require(_0xf649('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf649('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf649('0x4'));var logger=require(_0xf649('0x5'))(_0xf649('0x6'));var config=require(_0xf649('0x7'));var jayson=require(_0xf649('0x8'));var client=jayson[_0xf649('0x9')][_0xf649('0xa')]({'port':0x232a});config[_0xf649('0xb')]=_['defaults'](config['redis'],{'host':_0xf649('0xc'),'port':0x18eb});var socket=require(_0xf649('0xd'))(new Redis(config[_0xf649('0xb')]));require('./voicePrefix.socket')[_0xf649('0xe')](socket);function respondWithRpcPromise(_0x2a278c,_0x38d583,_0x4061a2){return new BPromise(function(_0x5abb8f,_0x7f5eda){return client[_0xf649('0xf')](_0x2a278c,_0x4061a2)[_0xf649('0x10')](function(_0xe5a71c){logger[_0xf649('0x11')](_0xf649('0x12'),_0x38d583,'request\x20sent');logger[_0xf649('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x38d583,'request\x20sent',JSON[_0xf649('0x14')](_0xe5a71c));if(_0xe5a71c[_0xf649('0x15')]){if(_0xe5a71c[_0xf649('0x15')][_0xf649('0x16')]===0x1f4){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x7f5eda(_0xe5a71c['error'][_0xf649('0x17')]);}logger[_0xf649('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x5abb8f(_0xe5a71c[_0xf649('0x15')]['message']);}else{logger['info'](_0xf649('0x12'),_0x38d583,_0xf649('0x18'));_0x5abb8f(_0xe5a71c[_0xf649('0x19')][_0xf649('0x17')]);}})[_0xf649('0x1a')](function(_0x2d956d){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0x2d956d);_0x7f5eda(_0x2d956d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2144e20..e71431c 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 _0x652b=['length','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x652b,0x68));var _0xb652=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x652b[_0x4c7b20];return _0x4872bd;};'use strict';var VoicePrefixEvents=require(_0xb652('0x0'));var events=[_0xb652('0x1'),_0xb652('0x2'),'update'];function createListener(_0x4070c6,_0x4a11b5){return function(_0x5b10a1){_0x4a11b5[_0xb652('0x3')](_0x4070c6,_0x5b10a1);};}function removeListener(_0x1dd99b,_0x1c8fb4){return function(){VoicePrefixEvents['removeListener'](_0x1dd99b,_0x1c8fb4);};}exports['register']=function(_0x43f467){for(var _0x491ce7=0x0,_0x58d168=events[_0xb652('0x4')];_0x491ce7<_0x58d168;_0x491ce7++){var _0x5c0245=events[_0x491ce7];var _0x2b82fd=createListener(_0xb652('0x5')+_0x5c0245,_0x43f467);VoicePrefixEvents['on'](_0x5c0245,_0x2b82fd);}}; \ No newline at end of file +var _0x847d=['length','voicePrefix:','save','remove','update','emit','removeListener','register'];(function(_0x100253,_0x1ad89e){var _0x5a49d7=function(_0x311e2a){while(--_0x311e2a){_0x100253['push'](_0x100253['shift']());}};_0x5a49d7(++_0x1ad89e);}(_0x847d,0x14a));var _0xd847=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x847d[_0x40a825];return _0x273a54;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xd847('0x0'),_0xd847('0x1'),_0xd847('0x2')];function createListener(_0x4f2500,_0x202b1c){return function(_0x4a85d8){_0x202b1c[_0xd847('0x3')](_0x4f2500,_0x4a85d8);};}function removeListener(_0x18051f,_0x5258c0){return function(){VoicePrefixEvents[_0xd847('0x4')](_0x18051f,_0x5258c0);};}exports[_0xd847('0x5')]=function(_0x375a88){for(var _0x13d8d4=0x0,_0x5f3349=events[_0xd847('0x6')];_0x13d8d4<_0x5f3349;_0x13d8d4++){var _0x19fdb5=events[_0x13d8d4];var _0x2bb22b=createListener(_0xd847('0x7')+_0x19fdb5,_0x375a88);VoicePrefixEvents['on'](_0x19fdb5,_0x2bb22b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 54bf047..b9406be 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3d61c6,_0x4571e6){var _0x47e0df=function(_0x25adfd){while(--_0x25adfd){_0x3d61c6['push'](_0x3d61c6['shift']());}};_0x47e0df(++_0x4571e6);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c5835,_0x20431a){_0x1c5835=_0x1c5835-0x0;var _0x558ebf=_0xb10b[_0x1c5835];return _0x558ebf;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x259a35,_0x44ba98){var _0x462543=function(_0x5262d4){while(--_0x5262d4){_0x259a35['push'](_0x259a35['shift']());}};_0x462543(++_0x44ba98);}(_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/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 451b477..b3ee63d 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 _0x01f5=['#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','#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)','#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','sequelize','name','ENUM','inbound','STRING','default','leastrecent','fewestcalls','random','linear','wrandom','ringall','setDataValue','strategy','getDataValue','type','dialMethod','outbound','booked','rrmemory','roundrobin','includes','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x01f5,0x15b));var _0x501f=function(_0x47e010,_0x311bae){_0x47e010=_0x47e010-0x0;var _0x4b005e=_0x01f5[_0x47e010];return _0x4b005e;};'use strict';var Sequelize=require(_0x501f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x501f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x501f('0x3')},'musiconhold':{'type':Sequelize[_0x501f('0x4')],'defaultValue':_0x501f('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x501f('0x2')]('rr','ringall',_0x501f('0x6'),_0x501f('0x7'),_0x501f('0x8'),'rrmemory',_0x501f('0x9'),_0x501f('0xa'),'rrordered'),'allowNull':![],'defaultValue':_0x501f('0xb'),'set':function(_0x27c017){this[_0x501f('0xc')](_0x501f('0xd'),_0x27c017?_0x27c017:'rrmemory');},'get':function(){var _0xf86d14=this[_0x501f('0xe')](_0x501f('0xf'));var _0x23937b=this[_0x501f('0xe')](_0x501f('0x10'));var _0x363f4d=this['getDataValue'](_0x501f('0xd'));if(_0xf86d14===_0x501f('0x11')){if(_0x23937b==='preview'){return null;}if(_0x23937b===_0x501f('0x12')&&![_0x501f('0x13'),_0x501f('0x14')][_0x501f('0x15')](_0x363f4d)){this['setDataValue'](_0x501f('0xd'),_0x501f('0x13'));}}return _0x363f4d;}},'servicelevel':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x501f('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x17'),'no'),'defaultValue':_0x501f('0x17')},'autopause':{'type':Sequelize['ENUM'](_0x501f('0x17'),'no',_0x501f('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x501f('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x501f('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x501f('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x501f('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x501f('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x501f('0x17'),'no'),'defaultValue':_0x501f('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x501f('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x501f('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x501f('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x501f('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x501f('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x501f('0x4')]},'queue_youarenext':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x501f('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x501f('0x4')]},'queue_quantity1':{'type':Sequelize[_0x501f('0x4')]},'queue_quantity2':{'type':Sequelize[_0x501f('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x501f('0x4')]},'queue_less_than':{'type':Sequelize[_0x501f('0x4')]},'periodic_announce':{'type':Sequelize[_0x501f('0x19')],'set':function(_0x24b0a8){this['setDataValue'](_0x501f('0x1a'),_0x24b0a8?_0x24b0a8[_0x501f('0x1b')](','):[]);},'get':function(){return this[_0x501f('0xe')](_0x501f('0x1a'))?this[_0x501f('0xe')]('periodic_announce')[_0x501f('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x501f('0x4')],'defaultValue':_0x501f('0x17'),'set':function(_0xeb116b){this[_0x501f('0xc')]('joinempty',_0xeb116b?_0xeb116b['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x501f('0x1d'))?this[_0x501f('0xe')](_0x501f('0x1d'))[_0x501f('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x501f('0x4')],'defaultValue':'no','set':function(_0x5d1388){this[_0x501f('0xc')](_0x501f('0x1e'),_0x5d1388?_0x5d1388[_0x501f('0x1b')](','):undefined);},'get':function(){return this[_0x501f('0xe')](_0x501f('0x1e'))?this[_0x501f('0xe')]('leavewhenempty')[_0x501f('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x501f('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x501f('0x4')]},'description':{'type':Sequelize[_0x501f('0x4')]},'acw':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':0x0,'set':function(_0x3595a8){this[_0x501f('0xc')]('acw',_0x3595a8);if(_0x3595a8){if(this[_0x501f('0xe')](_0x501f('0x20'))<0x2){this[_0x501f('0xc')](_0x501f('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x501f('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':0x0,'comment':_0x501f('0x21')},'dialMethod':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x22'),_0x501f('0x23'),_0x501f('0x24'),_0x501f('0x25'),_0x501f('0x12')),'defaultValue':_0x501f('0x23'),'comment':_0x501f('0x26')},'dialLimitChannel':{'type':Sequelize[_0x501f('0x16')](0x4)[_0x501f('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x501f('0x28')},'dialLimitQueue':{'type':Sequelize[_0x501f('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x501f('0x29')},'dialPowerLevel':{'type':Sequelize[_0x501f('0x2a')](0x2)[_0x501f('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x2b'),_0x501f('0x2c')),'defaultValue':_0x501f('0x2c'),'comment':_0x501f('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x501f('0x2a')](0x2)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x501f('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x501f('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x501f('0x4')],'defaultValue':_0x501f('0x2f'),'comment':_0x501f('0x30')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x31')},'dialQueueProject':{'type':Sequelize[_0x501f('0x4')],'comment':_0x501f('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x501f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x501f('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x501f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x501f('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x3,'comment':_0x501f('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x501f('0x16')](0x5)[_0x501f('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x501f('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x501f('0x39')},'dialTimezone':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x501f('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x501f('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x501f('0x3a'),'never','onlyIfOpen'),'defaultValue':_0x501f('0x3a')},'dialAMDActive':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':0x0,'comment':_0x501f('0x3b')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x501f('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x501f('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x501f('0x16')](0x9)[_0x501f('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x501f('0x16')](0x9)[_0x501f('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x501f('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x501f('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x501f('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x501f('0x16')](0x9)[_0x501f('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x501f('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x501f('0x16')](0x9)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x501f('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x501f('0x16')](0x5)[_0x501f('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x501f('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x501f('0x16')](0x9)[_0x501f('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x501f('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x501f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':0x0,'comment':_0x501f('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x501f('0x2')](_0x501f('0x43'),_0x501f('0x44')),'defaultValue':_0x501f('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x501f('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x501f('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x501f('0x16')](0x5)[_0x501f('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x501f('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x501f('0x16')](0x5)[_0x501f('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x501f('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x501f('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x501f('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x501f('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x501f('0x16')](0x5)[_0x501f('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x501f('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x501f('0x16')],'allowNull':!![],'comment':_0x501f('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':![],'comment':_0x501f('0x4e'),'set':function(_0x1cec10){if(!_0x1cec10)this[_0x501f('0xc')](_0x501f('0x4f'),null);this['setDataValue']('mandatoryDisposition',_0x1cec10);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x501f('0x16')](0x3)[_0x501f('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x501f('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x501f('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x501f('0x16')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0db3=['rrordered','setDataValue','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','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\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','ENUM','outbound','inbound','default','STRING','ringall','fewestcalls','rrmemory','linear','wrandom'];(function(_0x1954ae,_0x368fea){var _0x2334d4=function(_0x2c5ef7){while(--_0x2c5ef7){_0x1954ae['push'](_0x1954ae['shift']());}};_0x2334d4(++_0x368fea);}(_0x0db3,0x8c));var _0x30db=function(_0x5517d0,_0x5d250d){_0x5517d0=_0x5517d0-0x0;var _0xfc52f3=_0x0db3[_0x5517d0];return _0xfc52f3;};'use strict';var Sequelize=require('sequelize');module[_0x30db('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x30db('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x30db('0x2')]('inbound',_0x30db('0x3')),'allowNull':![],'defaultValue':_0x30db('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x30db('0x5')},'announce':{'type':Sequelize[_0x30db('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x30db('0x2')]('rr',_0x30db('0x7'),'leastrecent',_0x30db('0x8'),'random',_0x30db('0x9'),_0x30db('0xa'),_0x30db('0xb'),_0x30db('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x55e8d0){this[_0x30db('0xd')]('strategy',_0x55e8d0?_0x55e8d0:'rrmemory');},'get':function(){var _0x520c4f=this[_0x30db('0xe')](_0x30db('0xf'));var _0x5ac831=this[_0x30db('0xe')](_0x30db('0x10'));var _0xbef902=this[_0x30db('0xe')]('strategy');if(_0x520c4f==='outbound'){if(_0x5ac831===_0x30db('0x11')){return null;}if(_0x5ac831===_0x30db('0x12')&&!['rrmemory',_0x30db('0x13')][_0x30db('0x14')](_0xbef902)){this[_0x30db('0xd')]('strategy',_0x30db('0x9'));}}return _0xbef902;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x30db('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x30db('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x30db('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x30db('0x6')]},'weight':{'type':Sequelize[_0x30db('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x30db('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':_0x30db('0x16')},'autopause':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x30db('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x30db('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x30db('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x30db('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x30db('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x30db('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x30db('0x2')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x30db('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x30db('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x30db('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x30db('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x30db('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x30db('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x30db('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x30db('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x30db('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x30db('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x30db('0x6')]},'queue_quantity1':{'type':Sequelize[_0x30db('0x6')]},'queue_quantity2':{'type':Sequelize[_0x30db('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x30db('0x6')]},'queue_less_than':{'type':Sequelize[_0x30db('0x6')]},'periodic_announce':{'type':Sequelize[_0x30db('0x17')],'set':function(_0x56bbe5){this[_0x30db('0xd')](_0x30db('0x18'),_0x56bbe5?_0x56bbe5['join'](','):[]);},'get':function(){return this[_0x30db('0xe')]('periodic_announce')?this['getDataValue'](_0x30db('0x18'))[_0x30db('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x30db('0x6')],'defaultValue':_0x30db('0x16'),'set':function(_0x5df95a){this[_0x30db('0xd')](_0x30db('0x1a'),_0x5df95a?_0x5df95a[_0x30db('0x1b')](','):undefined);},'get':function(){return this[_0x30db('0xe')](_0x30db('0x1a'))?this['getDataValue'](_0x30db('0x1a'))[_0x30db('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x30db('0x6')],'defaultValue':'no','set':function(_0x1fdfda){this['setDataValue'](_0x30db('0x1c'),_0x1fdfda?_0x1fdfda['join'](','):undefined);},'get':function(){return this[_0x30db('0xe')](_0x30db('0x1c'))?this[_0x30db('0xe')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x30db('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x30db('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x30db('0x6')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':0x0,'set':function(_0x22ac53){this['setDataValue'](_0x30db('0x1e'),_0x22ac53);if(_0x22ac53){if(this[_0x30db('0xe')](_0x30db('0x1f'))<0x2){this[_0x30db('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x30db('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':0x0,'comment':_0x30db('0x20')},'dialMethod':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x11'),_0x30db('0x21'),_0x30db('0x22'),_0x30db('0x23'),_0x30db('0x12')),'defaultValue':_0x30db('0x21'),'comment':_0x30db('0x24')},'dialLimitChannel':{'type':Sequelize[_0x30db('0x15')](0x4)[_0x30db('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x30db('0x26')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x30db('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x30db('0x2')]('agentBusyFactor','dropRate'),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x30db('0x26')](0x2)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x30db('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0x30db('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x30db('0x29')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x30db('0x6')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x30db('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x30db('0x6')],'defaultValue':'tTxX','comment':_0x30db('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0x30db('0x15')](0x3)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30db('0x2b')},'dialQueueProject':{'type':Sequelize[_0x30db('0x6')],'comment':_0x30db('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0x30db('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30db('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x30db('0x15')](0x5)[_0x30db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30db('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x30db('0x15')](0x3)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x30db('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30db('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x30db('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x30db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30db('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x30db('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x30db('0x32')},'dialTimezone':{'type':Sequelize[_0x30db('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x30db('0x6')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x30db('0x33'),_0x30db('0x34'),_0x30db('0x35')),'defaultValue':_0x30db('0x33')},'dialAMDActive':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':0x0,'comment':_0x30db('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x30db('0x15')](0x9)[_0x30db('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x30db('0x37')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x30db('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x30db('0x15')](0x9)[_0x30db('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x30db('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x30db('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x30db('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x30db('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x30db('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x30db('0x15')](0x9)[_0x30db('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x30db('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x30db('0x15')](0x9)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x30db('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x30db('0x15')](0x5)[_0x30db('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x30db('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x30db('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x30db('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x30db('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x30db('0x2')](_0x30db('0x40'),_0x30db('0x41')),'defaultValue':_0x30db('0x40')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x30db('0x2c')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x30db('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x30db('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30db('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x30db('0x15')](0x5)[_0x30db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x30db('0x15')](0x3)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30db('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0x30db('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x30db('0x15')](0x3)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30db('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x30db('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x30db('0x15')](0x3)[_0x30db('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30db('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0x30db('0x15')](0x5)[_0x30db('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x30db('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30db('0x46')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x30db('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30db('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x30db('0x15')],'allowNull':!![],'comment':_0x30db('0x48')},'mandatoryDisposition':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':![],'comment':_0x30db('0x49'),'set':function(_0x2463f9){if(!_0x2463f9)this[_0x30db('0xd')](_0x30db('0x4a'),null);this['setDataValue'](_0x30db('0x4b'),_0x2463f9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x30db('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x30db('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x30db('0x15')](0x3)[_0x30db('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x30db('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 a443110..9b6b876 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 _0xe14b=['QueueCampaigns','outbound','filter','map','value','type','find','name','end','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','autoAssociation','UserProfileResource','clone','merge','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','hasOwnProperty','nolimit','order','sort','pick','VoiceQueueId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','online','interface','flatMap','penalty','sequelize','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','voicePause','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','squel','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','inbound'];(function(_0x39a2c2,_0x28c76e){var _0x13912c=function(_0x4b2561){while(--_0x4b2561){_0x39a2c2['push'](_0x39a2c2['shift']());}};_0x13912c(++_0x28c76e);}(_0xe14b,0x93));var _0xbe14=function(_0x3699ab,_0x43cb42){_0x3699ab=_0x3699ab-0x0;var _0x50f9f4=_0xe14b[_0x3699ab];return _0x50f9f4;};'use strict';var moment=require(_0xbe14('0x0'));var BPromise=require(_0xbe14('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0xbe14('0x2'));var Redis=require(_0xbe14('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xbe14('0x4'))('api');var config=require('../../config/environment');var db=require(_0xbe14('0x5'))['db'];config[_0xbe14('0x6')]=_[_0xbe14('0x7')](config[_0xbe14('0x6')],{'host':_0xbe14('0x8'),'port':0x18eb});var socket=require(_0xbe14('0x9'))(new Redis(config[_0xbe14('0x6')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x496063,_0x30c355){_0x30c355=_0x30c355||0xcc;return function(_0x6fceff){if(_0x6fceff){return _0x496063[_0xbe14('0xa')](_0x30c355);}return _0x496063[_0xbe14('0xb')](_0x30c355)['end']();};}function respondWithResult(_0x5b9fc6,_0x113243){_0x113243=_0x113243||0xc8;return function(_0x3f70cb){if(_0x3f70cb){return _0x5b9fc6['status'](_0x113243)[_0xbe14('0xc')](_0x3f70cb);}};}function respondWithFilteredResult(_0x35aa19,_0x886a5e){return function(_0x3d38c2){if(_0x3d38c2){var _0x27792f=typeof _0x886a5e[_0xbe14('0xd')]===_0xbe14('0xe')&&typeof _0x886a5e[_0xbe14('0xf')]===_0xbe14('0xe');var _0xa2cf72=_0x3d38c2[_0xbe14('0x10')];var _0x33fd54=_0x27792f?0x0:_0x886a5e[_0xbe14('0xd')];var _0x530538=_0x27792f?_0x3d38c2['count']:_0x886a5e[_0xbe14('0xd')]+_0x886a5e[_0xbe14('0xf')];var _0xf4ac9;if(_0x530538>=_0xa2cf72){_0x530538=_0xa2cf72;_0xf4ac9=0xc8;}else{_0xf4ac9=0xce;}_0x35aa19[_0xbe14('0xb')](_0xf4ac9);return _0x35aa19['set'](_0xbe14('0x11'),_0x33fd54+'-'+_0x530538+'/'+_0xa2cf72)[_0xbe14('0xc')](_0x3d38c2);}return null;};}function saveUpdates(_0xfd7b8f){return function(_0x123ede){if(_0x123ede){return _0x123ede[_0xbe14('0x12')](_0xfd7b8f)[_0xbe14('0x13')](function(_0x17ae86){return _0x17ae86;});}return null;};}function removeEntity(_0x5ea1f8){return function(_0x137ee5){if(_0x137ee5){return _0x137ee5[_0xbe14('0x14')]()[_0xbe14('0x13')](function(){var _0x433459=_0x137ee5[_0xbe14('0x15')]({'plain':!![]});var _0x37e4c1=[{'name':'VoiceQueues','value':_0xbe14('0x16'),'ignore':![]},{'name':_0xbe14('0x17'),'value':_0xbe14('0x18'),'ignore':![]}];var _0xc12977=_(_0x37e4c1)[_0xbe14('0x19')]('ignore')[_0xbe14('0x1a')]('value')[_0xbe14('0x1b')]();if(_['includes'](_0xc12977,_0x433459[_0xbe14('0x1c')])){return;}var _0x4a25fa=_[_0xbe14('0x1d')](_0x37e4c1,[_0xbe14('0x1b'),_0x433459['type']])[_0xbe14('0x1e')];return db['UserProfileResource'][_0xbe14('0x14')]({'where':{'type':_0x4a25fa,'resourceId':_0x433459['id']}})['then'](function(){return _0x137ee5;});})[_0xbe14('0x13')](function(){_0x5ea1f8[_0xbe14('0xb')](0xcc)[_0xbe14('0x1f')]();});}};}function handleEntityNotFound(_0x39cc81){return function(_0x15ef02){if(!_0x15ef02){_0x39cc81[_0xbe14('0xa')](0x194);}return _0x15ef02;};}function handleError(_0x55d001,_0x1822e0){_0x1822e0=_0x1822e0||0x1f4;return function(_0x1ba46a){logger[_0xbe14('0x20')](_0x1ba46a[_0xbe14('0x21')]);if(_0x1ba46a['name']){delete _0x1ba46a[_0xbe14('0x1e')];}_0x55d001[_0xbe14('0xb')](_0x1822e0)['send'](_0x1ba46a);};}exports[_0xbe14('0x22')]=function(_0x3b3e84,_0x1c7cc7){var _0x19252f={};var _0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x1a')](db[_0xbe14('0x23')][_0xbe14('0x24')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x25')],'type':_0x16a159[_0xbe14('0x1c')][_0xbe14('0x26')]};});_0x19252f=qs[_0xbe14('0x27')](_0x36d4b2,_0x3b3e84);var _0x223f7a={'where':_0x19252f[_0xbe14('0x28')]};return db[_0xbe14('0x23')][_0xbe14('0x10')](_0x223f7a)[_0xbe14('0x13')](function(_0x14e7c4){_0x34d648['count']=_0x14e7c4;_0x19252f[_0xbe14('0x29')]=qs['include'](_0x3b3e84['query']);return db[_0xbe14('0x23')]['findAll'](_0x19252f);})[_0xbe14('0x13')](function(_0x345b0){_0x34d648['rows']=_0x345b0;return _0x34d648;})['then'](respondWithFilteredResult(_0x1c7cc7,_0x19252f))['catch'](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x2a')]=function(_0xa3d24,_0x5f27b6){var _0x46c570={'raw':![],'where':{'id':_0xa3d24[_0xbe14('0x2b')]['id']}},_0x1faf3e={};_0x1faf3e[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['VoiceQueue']['rawAttributes']);_0x1faf3e[_0xbe14('0x2e')]=_['keys'](_0xa3d24['query']);_0x1faf3e['filters']=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],_0x1faf3e[_0xbe14('0x2e')]);_0x46c570[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x46c570[_0xbe14('0x30')]=_0x46c570[_0xbe14('0x30')][_0xbe14('0x32')]?_0x46c570['attributes']:_0x1faf3e['model'];if(_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x46c570[_0xbe14('0x29')]=[{'all':!![]}];}_0x46c570=_['merge']({},_0x46c570,_0xa3d24[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x46c570)[_0xbe14('0x13')](handleEntityNotFound(_0x5f27b6,null))[_0xbe14('0x13')](respondWithResult(_0x5f27b6,null))[_0xbe14('0x35')](handleError(_0x5f27b6,null));};exports[_0xbe14('0x36')]=function(_0x128843,_0x1b2608){return db['VoiceQueue'][_0xbe14('0x36')](_0x128843[_0xbe14('0x37')],{})[_0xbe14('0x13')](function(_0x1b3118){var _0x3287b9=_0x128843[_0xbe14('0x38')]['get']({'plain':!![]});if(!_0x3287b9)throw new Error(_0xbe14('0x39'));if(_0x3287b9[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x36263c=_0x1b3118['get']({'plain':!![]});var _0x4bfa96=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x5d5318=_[_0xbe14('0x1d')](_0x4bfa96,['value',_0x36263c['type']])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x5d5318,'userProfileId':_0x3287b9['userProfileId']},'raw':!![]})['then'](function(_0x5aaa4f){if(_0x5aaa4f&&_0x5aaa4f[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x36263c['name'],'resourceId':_0x36263c['id'],'type':_0x5aaa4f[_0xbe14('0x1e')],'sectionId':_0x5aaa4f['id']},{})[_0xbe14('0x13')](function(){return _0x1b3118;});}else{return _0x1b3118;}})[_0xbe14('0x35')](function(_0x3ab0f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab0f6);throw _0x3ab0f6;});}return _0x1b3118;})[_0xbe14('0x13')](respondWithResult(_0x1b2608,0xc9))[_0xbe14('0x35')](handleError(_0x1b2608,null));};exports[_0xbe14('0x3f')]=function(_0xb2b285,_0x2550dc){var _0x4f2d95={'where':{'id':_0xb2b285[_0xbe14('0x2b')]['id']}},_0x51023a={};_0x51023a[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x23')]['rawAttributes']);_0x4f2d95[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x51023a['model'],qs[_0xbe14('0x31')](_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x4f2d95[_0xbe14('0x30')]=_0x4f2d95['attributes']['length']?_0x4f2d95[_0xbe14('0x30')]:_0x51023a[_0xbe14('0x2c')];if(_0xb2b285['query']['includeAll']){_0x4f2d95[_0xbe14('0x29')]=[{'all':!![]}];}_0x4f2d95=_[_0xbe14('0x40')]({},_0x4f2d95,_0xb2b285[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x4f2d95)[_0xbe14('0x13')](handleEntityNotFound(_0x2550dc,null))[_0xbe14('0x13')](function(_0x5a4068){if(_0x5a4068){var _0xf32e93=_0x5a4068[_0xbe14('0x15')]({'plain':!![]});_0xf32e93=qs[_0xbe14('0x41')](_0xf32e93,['id',_0xbe14('0x42'),_0xbe14('0x43')]);_0xb2b285['body']=_[_0xbe14('0x41')](_0xb2b285[_0xbe14('0x37')],['id',_0xbe14('0x42'),_0xbe14('0x43')]);return db[_0xbe14('0x23')][_0xbe14('0x36')](_['merge'](_0xf32e93,_0xb2b285['body']),{'include':_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x33')]?[{'all':!![]}]:undefined})[_0xbe14('0x13')](function(_0x48554a){var _0x497b00=_0xb2b285[_0xbe14('0x38')][_0xbe14('0x15')]({'plain':!![]});if(!_0x497b00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x497b00[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x50c2a0=_0x48554a[_0xbe14('0x15')]({'plain':!![]});var _0x4a40d2=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x435c8d=_[_0xbe14('0x1d')](_0x4a40d2,['value',_0x50c2a0[_0xbe14('0x1c')]])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x435c8d,'userProfileId':_0x497b00[_0xbe14('0x44')]},'raw':!![]})['then'](function(_0x42a346){if(_0x42a346&&_0x42a346[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x50c2a0[_0xbe14('0x1e')],'resourceId':_0x50c2a0['id'],'type':_0x42a346[_0xbe14('0x1e')],'sectionId':_0x42a346['id']},{})[_0xbe14('0x13')](function(){return _0x48554a;});}else{return _0x48554a;}})['catch'](function(_0x72c875){logger[_0xbe14('0x20')](_0xbe14('0x45'),_0x72c875);throw _0x72c875;});}return _0x48554a;});}})[_0xbe14('0x13')](respondWithResult(_0x2550dc,0xc9))[_0xbe14('0x35')](handleError(_0x2550dc,null));};exports[_0xbe14('0x12')]=function(_0xd8f78f,_0x32df3c){if(_0xd8f78f[_0xbe14('0x37')]['id']){delete _0xd8f78f[_0xbe14('0x37')]['id'];}return db[_0xbe14('0x23')]['find']({'where':{'id':_0xd8f78f['params']['id']}})['then'](handleEntityNotFound(_0x32df3c,null))[_0xbe14('0x13')](saveUpdates(_0xd8f78f[_0xbe14('0x37')],null))[_0xbe14('0x13')](respondWithResult(_0x32df3c,null))[_0xbe14('0x35')](handleError(_0x32df3c,null));};exports[_0xbe14('0x14')]=function(_0x66ddf,_0x16ee48){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x66ddf[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x16ee48,null))[_0xbe14('0x13')](removeEntity(_0x16ee48,null))[_0xbe14('0x35')](handleError(_0x16ee48,null));};exports[_0xbe14('0x46')]=function(_0x1c831a,_0xcef8e3){var _0x179077={'raw':![],'where':{}};var _0x2225d9={};var _0x29761b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x1c831a[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xcef8e3,null))[_0xbe14('0x13')](function(_0x46b49c){if(_0x46b49c){_0x2225d9[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x47')][_0xbe14('0x24')]);_0x2225d9[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x1c831a['query']);_0x2225d9[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x2225d9[_0xbe14('0x2c')],_0x2225d9[_0xbe14('0x2e')]);_0x179077[_0xbe14('0x30')]=_['intersection'](_0x2225d9[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x179077[_0xbe14('0x30')]=_0x179077['attributes'][_0xbe14('0x32')]?_0x179077[_0xbe14('0x30')]:_0x2225d9[_0xbe14('0x2c')];if(!_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x179077[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x1c831a['query'][_0xbe14('0xf')]);_0x179077[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x179077[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x1c831a['query']['sort']);_0x179077[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x1c831a[_0xbe14('0x2e')],_0x2225d9[_0xbe14('0x48')]));_0x179077[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x46b49c['id'];if(_0x1c831a[_0xbe14('0x2e')]['filter']){_0x179077['where']=_[_0xbe14('0x40')](_0x179077[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x179077['attributes'],function(_0x76e91e){var _0x16bca1={};_0x16bca1[_0x76e91e]={'$like':'%'+_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x16bca1;})});}_0x179077=_[_0xbe14('0x40')]({},_0x179077,_0x1c831a[_0xbe14('0x34')]);return db[_0xbe14('0x47')]['count']({'where':_0x179077[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x3baa26){_0x29761b[_0xbe14('0x10')]=_0x3baa26;if(_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x179077[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopper'][_0xbe14('0x4f')](_0x179077);})[_0xbe14('0x13')](function(_0x3cd17e){_0x29761b[_0xbe14('0x50')]=_0x3cd17e;return _0x29761b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0xcef8e3,_0x179077))[_0xbe14('0x35')](handleError(_0xcef8e3,null));};exports[_0xbe14('0x51')]=function(_0xd756b2,_0x5d064e){var _0x1e5ce1={'raw':!![],'where':{}};var _0x401968={};var _0x362999={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0xd756b2[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5d064e,null))[_0xbe14('0x13')](function(_0x175213){if(_0x175213){_0x401968[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperHistory'][_0xbe14('0x24')]);_0x401968[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0xd756b2[_0xbe14('0x2e')]);_0x401968[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x401968[_0xbe14('0x2c')],_0x401968['query']);_0x1e5ce1[_0xbe14('0x30')]=_['intersection'](_0x401968[_0xbe14('0x2c')],qs['fields'](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e5ce1[_0xbe14('0x30')]=_0x1e5ce1['attributes'][_0xbe14('0x32')]?_0x1e5ce1[_0xbe14('0x30')]:_0x401968[_0xbe14('0x2c')];if(!_0xd756b2['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e5ce1[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0xd756b2['query'][_0xbe14('0xf')]);_0x1e5ce1[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x1e5ce1[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0xd756b2['query'][_0xbe14('0x4c')]);_0x1e5ce1[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0xd756b2[_0xbe14('0x2e')],_0x401968[_0xbe14('0x48')]));_0x1e5ce1[_0xbe14('0x28')]['VoiceQueueId']=_0x175213['id'];if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e5ce1['where']=_[_0xbe14('0x40')](_0x1e5ce1['where'],{'$or':_[_0xbe14('0x1a')](_0x1e5ce1[_0xbe14('0x30')],function(_0x4dfa19){var _0x55d729={};_0x55d729[_0x4dfa19]={'$like':'%'+_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x55d729;})});}_0x1e5ce1=_[_0xbe14('0x40')]({},_0x1e5ce1,_0xd756b2['options']);return db[_0xbe14('0x53')][_0xbe14('0x10')]({'where':_0x1e5ce1[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x5ee624){_0x362999['count']=_0x5ee624;if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x1e5ce1[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x53')][_0xbe14('0x4f')](_0x1e5ce1);})[_0xbe14('0x13')](function(_0x139aab){_0x362999['rows']=_0x139aab;return _0x362999;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x5d064e,_0x1e5ce1))['catch'](handleError(_0x5d064e,null));};exports[_0xbe14('0x54')]=function(_0x3a01bb,_0x8d47f2){var _0x2382c4={'raw':!![],'where':{}};var _0x55a3ae={};var _0x1e160b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3a01bb['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x8d47f2,null))[_0xbe14('0x13')](function(_0x4090bc){if(_0x4090bc){_0x55a3ae[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x55')][_0xbe14('0x24')]);_0x55a3ae[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x3a01bb[_0xbe14('0x2e')]);_0x55a3ae[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],_0x55a3ae[_0xbe14('0x2e')]);_0x2382c4[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x2382c4['attributes']=_0x2382c4[_0xbe14('0x30')]['length']?_0x2382c4[_0xbe14('0x30')]:_0x55a3ae[_0xbe14('0x2c')];if(!_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x2382c4['limit']=qs['limit'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x2382c4[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x3a01bb['query'][_0xbe14('0xd')]);}_0x2382c4[_0xbe14('0x4b')]=qs['sort'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x2382c4[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x3a01bb[_0xbe14('0x2e')],_0x55a3ae['filters']));_0x2382c4['where'][_0xbe14('0x4e')]=_0x4090bc['id'];if(_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x2382c4[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x2382c4['where'],{'$or':_[_0xbe14('0x1a')](_0x2382c4[_0xbe14('0x30')],function(_0x5dc793){var _0x4e35ed={};_0x4e35ed[_0x5dc793]={'$like':'%'+_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x4e35ed;})});}_0x2382c4=_['merge']({},_0x2382c4,_0x3a01bb[_0xbe14('0x34')]);return db['CmHopperFinal'][_0xbe14('0x10')]({'where':_0x2382c4['where']})[_0xbe14('0x13')](function(_0x5d4431){_0x1e160b[_0xbe14('0x10')]=_0x5d4431;if(_0x3a01bb['query'][_0xbe14('0x33')]){_0x2382c4[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2382c4);})[_0xbe14('0x13')](function(_0x4db7e8){_0x1e160b['rows']=_0x4db7e8;return _0x1e160b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x8d47f2,_0x2382c4))[_0xbe14('0x35')](handleError(_0x8d47f2,null));};exports[_0xbe14('0x56')]=function(_0x11c341,_0x1a780a){var _0x313a87={'raw':!![],'where':{}};var _0x30d2b0={};var _0x57ad22={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x11c341[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1a780a,null))['then'](function(_0x26372a){if(_0x26372a){_0x30d2b0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperBlack'][_0xbe14('0x24')]);_0x30d2b0[_0xbe14('0x2e')]=_['keys'](_0x11c341[_0xbe14('0x2e')]);_0x30d2b0['filters']=_[_0xbe14('0x2f')](_0x30d2b0[_0xbe14('0x2c')],_0x30d2b0[_0xbe14('0x2e')]);_0x313a87['attributes']=_[_0xbe14('0x2f')](_0x30d2b0['model'],qs[_0xbe14('0x31')](_0x11c341['query']['fields']));_0x313a87[_0xbe14('0x30')]=_0x313a87['attributes'][_0xbe14('0x32')]?_0x313a87['attributes']:_0x30d2b0[_0xbe14('0x2c')];if(!_0x11c341[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x313a87[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x313a87[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x313a87[_0xbe14('0x4b')]=qs['sort'](_0x11c341[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x313a87[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x11c341['query'],_0x30d2b0['filters']));_0x313a87[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x26372a['id'];if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x313a87[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x313a87[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x313a87[_0xbe14('0x30')],function(_0x26e7a7){var _0x761b3d={};_0x761b3d[_0x26e7a7]={'$like':'%'+_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x761b3d;})});}_0x313a87=_[_0xbe14('0x40')]({},_0x313a87,_0x11c341[_0xbe14('0x34')]);return db[_0xbe14('0x57')][_0xbe14('0x10')]({'where':_0x313a87[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x28a1e9){_0x57ad22[_0xbe14('0x10')]=_0x28a1e9;if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x313a87[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x57')]['findAll'](_0x313a87);})[_0xbe14('0x13')](function(_0x3303a4){_0x57ad22[_0xbe14('0x50')]=_0x3303a4;return _0x57ad22;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x1a780a,_0x313a87))[_0xbe14('0x35')](handleError(_0x1a780a,null));};exports[_0xbe14('0x58')]=function(_0x52b75d,_0x5b161c){var _0x165b7a={};var _0x4a44e0={};var _0x3730d1;var _0x4babba;return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x52b75d[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x5b161c,null))[_0xbe14('0x13')](function(_0x12498f){if(_0x12498f){_0x3730d1=_0x12498f;_0x4a44e0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x59')][_0xbe14('0x24')]);_0x4a44e0[_0xbe14('0x2e')]=_['keys'](_0x52b75d[_0xbe14('0x2e')]);_0x4a44e0[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x4a44e0[_0xbe14('0x2c')],_0x4a44e0['query']);_0x165b7a[_0xbe14('0x30')]=_['intersection'](_0x4a44e0[_0xbe14('0x2c')],qs['fields'](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x165b7a[_0xbe14('0x30')]=_0x165b7a['attributes'][_0xbe14('0x32')]?_0x165b7a['attributes']:_0x4a44e0[_0xbe14('0x2c')];_0x165b7a[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x165b7a[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x52b75d[_0xbe14('0x2e')],_0x4a44e0['filters']));if(_0x52b75d[_0xbe14('0x2e')]['filter']){_0x165b7a[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x165b7a[_0xbe14('0x28')],{'$or':_['map'](_0x165b7a[_0xbe14('0x30')],function(_0x1c5fbc){var _0x219403={};_0x219403[_0x1c5fbc]={'$like':'%'+_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x219403;})});}_0x165b7a=_['merge']({},_0x165b7a,_0x52b75d['options']);return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})['then'](function(_0x16b1c8){if(_0x16b1c8){_0x4babba=_0x16b1c8[_0xbe14('0x32')];if(!_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x165b7a[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x52b75d['query'][_0xbe14('0xf')]);_0x165b7a[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x52b75d[_0xbe14('0x2e')]['offset']);}return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})[_0xbe14('0x13')](function(_0x37aff6){if(_0x37aff6){return _0x37aff6?{'count':_0x4babba,'rows':_0x37aff6}:null;}})[_0xbe14('0x13')](respondWithResult(_0x5b161c,null))[_0xbe14('0x35')](handleError(_0x5b161c,null));};exports[_0xbe14('0x5a')]=function(_0x208fae,_0x310d42){var _0x9c229f=_0x208fae[_0xbe14('0x37')]['teams'];var _0xdb5515=_[_0xbe14('0x1a')](_0x9c229f,'id');return db[_0xbe14('0x59')][_0xbe14('0x4f')]({'where':{'id':_0xdb5515},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbe14('0x5b'),'attributes':['id',_0xbe14('0x1e'),_0xbe14('0x5c'),'voicePause',_0xbe14('0x5d')],'raw':!![]}]})[_0xbe14('0x13')](function(_0x1ec868){if(_0x1ec868){var _0x1a7321=_[_0xbe14('0x5e')](_0x1ec868,function(_0x2306f6){var _0x426189=_0x2306f6['get']({'plain':!![]});_0x426189[_0xbe14('0x5b')]['forEach'](function(_0x24d528){_0x24d528[_0xbe14('0x5f')]=_[_0xbe14('0x1d')](_0x9c229f,{'id':_0x426189['id']})[_0xbe14('0x5f')];});return _0x426189[_0xbe14('0x5b')];});return db['VoiceQueue']['find']({'where':{'id':_0x208fae[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(_0x29a892){return db[_0xbe14('0x60')]['transaction'](function(_0x46a251){return _0x29a892[_0xbe14('0x5a')](_0xdb5515,{'transaction':_0x46a251})[_0xbe14('0x13')](function(){return BPromise['each'](_0x9c229f,function(_0xe69b0e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xe69b0e['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id'],'penalty':_0xe69b0e[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_0x1a7321,function(_0x3ea9c2){return db[_0xbe14('0x61')]['findOrCreate']({'where':{'UserId':_0x3ea9c2['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id']},'defaults':{'penalty':_0x3ea9c2[_0xbe14('0x5f')]},'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_[_0xbe14('0x19')](_0x1a7321,{'online':!![]}),function(_0x1e2559){return db[_0xbe14('0x62')][_0xbe14('0x63')]({'membername':_0x1e2559[_0xbe14('0x1e')],'UserId':_0x1e2559['id'],'queue_name':_0x29a892['name'],'VoiceQueueId':_0x29a892['id'],'interface':_[_0xbe14('0x64')](_0x1e2559[_0xbe14('0x5d')])?util[_0xbe14('0x65')]('SIP/%s',_0x1e2559[_0xbe14('0x1e')]):_0x1e2559[_0xbe14('0x5d')],'paused':_0x1e2559[_0xbe14('0x66')]||![],'penalty':_0x1e2559[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){_0x1a7321[_0xbe14('0x67')](function(_0x1b22a0){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':_0x1b22a0['id'],'VoiceQueueId':_0x29a892['id']});});});});});}})[_0xbe14('0x13')](respondWithStatusCode(_0x310d42,null))[_0xbe14('0x35')](handleError(_0x310d42,null));};exports['removeTeams']=function(_0xf549ec,_0x2c3647){return db[_0xbe14('0x59')]['findAll']({'where':{'id':_0xf549ec[_0xbe14('0x2e')][_0xbe14('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbe14('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbe14('0x13')](handleEntityNotFound(_0x2c3647,null))['then'](function(_0x2d4b18){var _0xcd8cf6=_['map'](_0x2d4b18,'id');var _0x269e5a=[];var _0x4c7e2b=[];var _0x587f58=squel[_0xbe14('0x6c')]();_0x587f58[_0xbe14('0x6d')](_0xbe14('0x6e'))[_0xbe14('0x6f')](_0xbe14('0x70'),'tq')[_0xbe14('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbe14('0x28')](_0xbe14('0x72'),_0xf549ec[_0xbe14('0x2b')]['id']);for(var _0x3c23fc=0x0;_0x3c23fc<_0x2d4b18['length'];_0x3c23fc+=0x1){let _0x1d5333=_0x2d4b18[_0x3c23fc];for(var _0x4cb29c=0x0;_0x4cb29c<_0x1d5333[_0xbe14('0x5b')][_0xbe14('0x32')];_0x4cb29c+=0x1){let _0x5270b2=_0x1d5333[_0xbe14('0x5b')][_0x4cb29c];var _0x273df5=_0x587f58[_0xbe14('0x3f')]();_0x273df5[_0xbe14('0x28')](_0xbe14('0x73'),_0x5270b2['id']);_0x4c7e2b[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x273df5[_0xbe14('0x75')](),{'type':db[_0xbe14('0x60')][_0xbe14('0x76')][_0xbe14('0x77')]})['then'](function(_0x20f196){if(_0x20f196[_0xbe14('0x32')]===0x1){return _0x5270b2['id'];}else{var _0x1eb33b=_[_0xbe14('0x78')](_['map'](_0x20f196,_0xbe14('0x79')),function(_0xede1c1){return _['includes'](_0xcd8cf6,_0xede1c1);});if(_0x1eb33b){return _0x5270b2['id'];}}}));}}return BPromise[_0xbe14('0x7a')](_0x4c7e2b)[_0xbe14('0x13')](function(_0x11085c){_0x269e5a=_(_0x269e5a)['union'](_0x11085c)[_0xbe14('0x7b')]()[_0xbe14('0x1b')]();return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0xf549ec[_0xbe14('0x2b')]['id']}})['then'](function(_0x23208d){return db[_0xbe14('0x60')][_0xbe14('0x7c')](function(_0x3f7732){return _0x23208d[_0xbe14('0x7d')](_0xf549ec['query'][_0xbe14('0x6a')],{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){if(!_[_0xbe14('0x7e')](_0x269e5a)){return _0x23208d[_0xbe14('0x7f')](_0x269e5a,{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0xf549ec[_0xbe14('0x2b')]['id'],'UserId':_0x269e5a},'transaction':_0x3f7732});});}})['then'](function(){_0x269e5a['forEach'](function(_0x129ef6){socket[_0xbe14('0x68')](_0xbe14('0x80'),{'UserId':_0x129ef6,'VoiceQueueId':_0x23208d['id']});});});});});});})[_0xbe14('0x13')](respondWithStatusCode(_0x2c3647,null))[_0xbe14('0x35')](handleError(_0x2c3647,null));};exports['addAgents']=function(_0x15c93c,_0xf6ff8){var _0x3eaabe,_0x1ea11a;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x15c93c[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xf6ff8,null))['then'](function(_0xf6da38){if(_0xf6da38){_0x1ea11a=_0xf6da38;return _0xf6da38[_0xbe14('0x81')](_0x15c93c['body']['ids'],_[_0xbe14('0x41')](_0x15c93c['body'],[_0xbe14('0x6a'),'id'])||{})[_0xbe14('0x82')](function(_0x776e93){for(var _0x3f5ca3=0x0;_0x3f5ca3<_0x15c93c[_0xbe14('0x37')]['ids'][_0xbe14('0x32')];_0x3f5ca3+=0x1){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':Number(_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')][_0x3f5ca3]),'VoiceQueueId':Number(_0x15c93c[_0xbe14('0x2b')]['id'])});}return _0x776e93;});}})['then'](function(_0x4eea48){_0x3eaabe=_0x4eea48||[];if(_0x1ea11a){return db[_0xbe14('0x6b')]['findAll']({'where':{'id':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')]},'attributes':['id',_0xbe14('0x1e'),'online',_0xbe14('0x66'),_0xbe14('0x5d')],'raw':!![]});}})[_0xbe14('0x13')](function(_0x1ad15d){if(!_[_0xbe14('0x7e')](_0x1ad15d)){var _0x2e5106=[];for(var _0x156fb3=0x0;_0x156fb3<_0x1ad15d['length'];_0x156fb3++){if(_0x1ad15d[_0x156fb3][_0xbe14('0x5c')]){_0x2e5106['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x1ad15d[_0x156fb3]['name'],'UserId':_0x1ad15d[_0x156fb3]['id'],'queue_name':_0x1ea11a[_0xbe14('0x1e')],'VoiceQueueId':_0x1ea11a['id'],'interface':_[_0xbe14('0x64')](_0x1ad15d[_0x156fb3]['interface'])?util[_0xbe14('0x65')]('SIP/%s',_0x1ad15d[_0x156fb3][_0xbe14('0x1e')]):_0x1ad15d[_0x156fb3]['interface'],'paused':_0x1ad15d[_0x156fb3][_0xbe14('0x66')]||![],'penalty':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x5f')]||0x0}));}}return BPromise[_0xbe14('0x7a')](_0x2e5106);}})[_0xbe14('0x13')](function(){return _0x3eaabe;})['then'](respondWithResult(_0xf6ff8,null))[_0xbe14('0x35')](handleError(_0xf6ff8,null));};exports[_0xbe14('0x7f')]=function(_0x3aaa54,_0x413893){return db['VoiceQueue']['find']({'where':{'id':_0x3aaa54['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x413893,null))[_0xbe14('0x13')](function(_0x3826cf){if(_0x3826cf){return _0x3826cf[_0xbe14('0x7f')](_0x3aaa54[_0xbe14('0x2e')]['ids'])['then'](function(){if(_[_0xbe14('0x83')](_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')])){for(var _0x26092b=0x0;_0x26092b<_0x3aaa54[_0xbe14('0x2e')]['ids'][_0xbe14('0x32')];_0x26092b+=0x1){socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')][_0x26092b]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}}else{socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}});}})['then'](function(_0x44c341){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0x3aaa54['params']['id'],'UserId':_0x3aaa54['query'][_0xbe14('0x6a')]}})[_0xbe14('0x13')](function(){return _0x44c341;});})[_0xbe14('0x13')](respondWithStatusCode(_0x413893,null))['catch'](handleError(_0x413893,null));};exports[_0xbe14('0x84')]=function(_0x2f0d14,_0x180e61){var _0x952322={};var _0x3ae00b={};var _0x41962a;var _0x4ebf01;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x2f0d14[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x180e61,null))[_0xbe14('0x13')](function(_0x5f28dd){if(_0x5f28dd){_0x41962a=_0x5f28dd;_0x3ae00b['model']=_[_0xbe14('0x2d')](db['User'][_0xbe14('0x24')]);_0x3ae00b['query']=_[_0xbe14('0x2d')](_0x2f0d14[_0xbe14('0x2e')]);_0x3ae00b[_0xbe14('0x48')]=_['intersection'](_0x3ae00b[_0xbe14('0x2c')],_0x3ae00b[_0xbe14('0x2e')]);_0x952322[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x3ae00b[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x952322[_0xbe14('0x30')]=_0x952322[_0xbe14('0x30')]['length']?_0x952322[_0xbe14('0x30')]:_0x3ae00b[_0xbe14('0x2c')];_0x952322[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x952322[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x2f0d14[_0xbe14('0x2e')],_0x3ae00b[_0xbe14('0x48')]));if(_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x952322[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x952322['where'],{'$or':_['map'](_0x952322['attributes'],function(_0x598ccc){var _0x446b3f={};_0x446b3f[_0x598ccc]={'$like':'%'+_0x2f0d14[_0xbe14('0x2e')]['filter']+'%'};return _0x446b3f;})});}_0x952322=_[_0xbe14('0x40')]({},_0x952322,_0x2f0d14['options']);return _0x41962a[_0xbe14('0x84')](_0x952322);}})[_0xbe14('0x13')](function(_0x111ff0){if(_0x111ff0){_0x4ebf01=_0x111ff0[_0xbe14('0x32')];if(!_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x952322[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x952322[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x41962a[_0xbe14('0x84')](_0x952322);}})['then'](function(_0x2eb5e6){if(_0x2eb5e6){return _0x2eb5e6?{'count':_0x4ebf01,'rows':_0x2eb5e6}:null;}})['then'](respondWithResult(_0x180e61,null))[_0xbe14('0x35')](handleError(_0x180e61,null));};exports['getMembers']=function(_0x49cddc,_0x3bdbf7){var _0x19a1ae={};var _0x167dee={};var _0x4f6252;var _0x4536b9;return db['VoiceQueue'][_0xbe14('0x52')]({'where':{'id':_0x49cddc['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3bdbf7,null))[_0xbe14('0x13')](function(_0x21f14e){if(_0x21f14e){_0x4f6252=_0x21f14e;_0x167dee[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x62')]['rawAttributes']);_0x167dee[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x49cddc['query']);_0x167dee['filters']=_['intersection'](_0x167dee[_0xbe14('0x2c')],_0x167dee[_0xbe14('0x2e')]);_0x19a1ae[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x167dee[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x49cddc[_0xbe14('0x2e')]['fields']));_0x19a1ae[_0xbe14('0x30')]=_0x19a1ae[_0xbe14('0x30')][_0xbe14('0x32')]?_0x19a1ae['attributes']:_0x167dee[_0xbe14('0x2c')];_0x19a1ae[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x49cddc['query']['sort']);_0x19a1ae[_0xbe14('0x28')]=qs['filters'](_[_0xbe14('0x4d')](_0x49cddc[_0xbe14('0x2e')],_0x167dee[_0xbe14('0x48')]));if(_0x49cddc[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x19a1ae[_0xbe14('0x28')]=_['merge'](_0x19a1ae[_0xbe14('0x28')],{'$or':_['map'](_0x19a1ae[_0xbe14('0x30')],function(_0x2d0568){var _0x26bb56={};_0x26bb56[_0x2d0568]={'$like':'%'+_0x49cddc['query'][_0xbe14('0x19')]+'%'};return _0x26bb56;})});}_0x19a1ae=_[_0xbe14('0x40')]({},_0x19a1ae,_0x49cddc['options']);return _0x4f6252['getMembers'](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x3d9061){if(_0x3d9061){_0x4536b9=_0x3d9061[_0xbe14('0x32')];if(!_0x49cddc['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x19a1ae['limit']=qs['limit'](_0x49cddc['query']['limit']);_0x19a1ae[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x49cddc['query']['offset']);}return _0x4f6252[_0xbe14('0x85')](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x1046a0){return _0x1046a0?{'count':_0x4536b9,'rows':_0x1046a0}:null;})['then'](respondWithResult(_0x3bdbf7,null))[_0xbe14('0x35')](handleError(_0x3bdbf7,null));};exports[_0xbe14('0x86')]=function(_0x3933c7,_0x416c65){var _0x56f870={};var _0x28b3c4={};var _0x6fe862;var _0x5f4675;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3933c7[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x416c65,null))[_0xbe14('0x13')](function(_0x4c4ab9){if(_0x4c4ab9){_0x6fe862=_0x4c4ab9;_0x28b3c4['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x87')][_0xbe14('0x24')]);_0x28b3c4[_0xbe14('0x2e')]=_['keys'](_0x3933c7[_0xbe14('0x2e')]);_0x28b3c4[_0xbe14('0x48')]=_['intersection'](_0x28b3c4[_0xbe14('0x2c')],_0x28b3c4['query']);_0x56f870[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x28b3c4['model'],qs[_0xbe14('0x31')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x56f870[_0xbe14('0x30')]=_0x56f870[_0xbe14('0x30')][_0xbe14('0x32')]?_0x56f870[_0xbe14('0x30')]:_0x28b3c4[_0xbe14('0x2c')];_0x56f870['order']=qs[_0xbe14('0x4c')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x56f870['where']=qs['filters'](_['pick'](_0x3933c7[_0xbe14('0x2e')],_0x28b3c4[_0xbe14('0x48')]));if(_0x3933c7[_0xbe14('0x2e')]['filter']){_0x56f870['where']=_[_0xbe14('0x40')](_0x56f870[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x56f870[_0xbe14('0x30')],function(_0x2ac6c0){var _0x3d381e={};_0x3d381e[_0x2ac6c0]={'$like':'%'+_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x3d381e;})});}_0x56f870=_[_0xbe14('0x40')]({},_0x56f870,_0x3933c7['options']);return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2ca4de){if(_0x2ca4de){_0x5f4675=_0x2ca4de[_0xbe14('0x32')];if(!_0x3933c7[_0xbe14('0x2e')]['hasOwnProperty'](_0xbe14('0x4a'))){_0x56f870['limit']=qs['limit'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x56f870['offset']=qs['offset'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2e7c31){if(_0x2e7c31){return _0x2e7c31?{'count':_0x5f4675,'rows':_0x2e7c31}:null;}})['then'](respondWithResult(_0x416c65,null))['catch'](handleError(_0x416c65,null));};exports[_0xbe14('0x88')]=function(_0x4b07fc,_0x76e84){var _0x3f687f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4f4b69,_0x43d760;return db['VoiceQueue'][_0xbe14('0x1d')]({'where':{'id':_0x4b07fc[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x76e84,null))[_0xbe14('0x13')](function(_0x30657c){if(_0x30657c){_0x43d760=_0x30657c;return _0x30657c[_0xbe14('0x88')](_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x6a')],_['omit'](_0x4b07fc[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0xd97d02){var _0x15082b;_0x4f4b69=_0xd97d02||[];var _0x5d15c7=[];if(_0xd97d02){for(var _0x66b6a7=0x0;_0x66b6a7<_0xd97d02[_0xbe14('0x32')];_0x66b6a7+=0x1){var _0x4dfe2c=_0xd97d02[_0x66b6a7][_0xbe14('0x15')]({'plain':!![]});_0x43d760['dialCheckDuplicateType']=_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]?_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]:_0x43d760[_0xbe14('0x89')];switch(_0x43d760[_0xbe14('0x89')]){case'always':_0x15082b=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x96'))[_0xbe14('0x6f')](_0xbe14('0x97'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id']['toString']()))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x98'))[_0xbe14('0x6f')]('cm_hopper')[_0xbe14('0x28')](_0xbe14('0x72'),_0x4b07fc[_0xbe14('0x2b')]['id']['toString']())))[_0xbe14('0x75')]();break;case _0xbe14('0x99'):_0x15082b=squel['insert']()[_0xbe14('0x8b')]('cm_hopper')[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),'ListId','VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x4b07fc[_0xbe14('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))['where'](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x98'))[_0xbe14('0x6f')](_0xbe14('0x8c'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id'][_0xbe14('0x75')]())))['toString']();break;default:_0x15082b=squel['insert']()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')](['phone',_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))['field']('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c['CmListId'][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),'VoiceQueueId')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')[_0xbe14('0x28')](_0xbe14('0x9b'))['where'](_0xbe14('0x93'),_0x4dfe2c[_0xbe14('0x92')]['toString']())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();}_0x5d15c7['push'](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x15082b));}return BPromise[_0xbe14('0x7a')](_0x5d15c7);}})[_0xbe14('0x13')](function(){var _0x4bc564=[];var _0x19e7ce=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x9c'))[_0xbe14('0x8d')]([_0xbe14('0x9d'),_0xbe14('0x8e'),_0xbe14('0x9e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()['field']('h.id')[_0xbe14('0x6d')](_0xbe14('0x9f'))['field'](_0xbe14('0xa0'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27','createdAt')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0xa1'),'ci')[_0xbe14('0x71')](_0xbe14('0x8c'),'h','h.ContactId=ci.CmContactId')['where'](_0xbe14('0xa2'),_0x3f687f)['where'](_0xbe14('0xa3'),_0xbe14('0xa4')))['toString']();_0x4bc564[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x19e7ce));return BPromise[_0xbe14('0x7a')](_0x4bc564);})[_0xbe14('0x13')](function(){return _0x4f4b69;})[_0xbe14('0x13')](respondWithResult(_0x76e84,null))[_0xbe14('0x35')](handleError(_0x76e84,null));};exports['removeLists']=function(_0x4ceca6,_0x23f4a3){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x23f4a3,null))[_0xbe14('0x13')](function(_0x2fe8b0){if(_0x2fe8b0){return _0x2fe8b0[_0xbe14('0xa5')](_0x4ceca6['query'][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x186284){if(_0x186284){return db['CmHopper'][_0xbe14('0x14')]({'where':{'ListId':_0x4ceca6[_0xbe14('0x2e')][_0xbe14('0x6a')],'VoiceQueueId':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(){return _0x186284;});}})['then'](respondWithStatusCode(_0x23f4a3,null))[_0xbe14('0x35')](handleError(_0x23f4a3,null));};exports[_0xbe14('0xa6')]=function(_0x4c9319,_0x1173f0){var _0x1e0c81={};var _0x5349a7={};var _0x5e3819;var _0x28c5fe;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x4c9319['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1173f0,null))[_0xbe14('0x13')](function(_0x59434a){if(_0x59434a){_0x5e3819=_0x59434a;_0x5349a7[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x87')]['rawAttributes']);_0x5349a7[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x4c9319[_0xbe14('0x2e')]);_0x5349a7[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x5349a7[_0xbe14('0x2c')],_0x5349a7[_0xbe14('0x2e')]);_0x1e0c81[_0xbe14('0x30')]=_['intersection'](_0x5349a7[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e0c81[_0xbe14('0x30')]=_0x1e0c81['attributes'][_0xbe14('0x32')]?_0x1e0c81[_0xbe14('0x30')]:_0x5349a7[_0xbe14('0x2c')];_0x1e0c81[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x4c9319[_0xbe14('0x2e')]['sort']);_0x1e0c81['where']=qs['filters'](_[_0xbe14('0x4d')](_0x4c9319[_0xbe14('0x2e')],_0x5349a7['filters']));if(_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e0c81[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x1e0c81['where'],{'$or':_[_0xbe14('0x1a')](_0x1e0c81[_0xbe14('0x30')],function(_0x52bbc1){var _0x2797ef={};_0x2797ef[_0x52bbc1]={'$like':'%'+_0x4c9319['query']['filter']+'%'};return _0x2797ef;})});}_0x1e0c81=_[_0xbe14('0x40')]({},_0x1e0c81,_0x4c9319[_0xbe14('0x34')]);return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})[_0xbe14('0x13')](function(_0x47bba1){if(_0x47bba1){_0x28c5fe=_0x47bba1[_0xbe14('0x32')];if(!_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e0c81['limit']=qs[_0xbe14('0xf')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x1e0c81[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})['then'](function(_0x2592ab){if(_0x2592ab){return _0x2592ab?{'count':_0x28c5fe,'rows':_0x2592ab}:null;}})[_0xbe14('0x13')](respondWithResult(_0x1173f0,null))['catch'](handleError(_0x1173f0,null));};exports['addBlackLists']=function(_0x6a0f29,_0x3d04b9){var _0x21f793;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x6a0f29[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3d04b9,null))[_0xbe14('0x13')](function(_0x37e5e8){if(_0x37e5e8){return _0x37e5e8['addBlackLists'](_0x6a0f29[_0xbe14('0x37')][_0xbe14('0x6a')],_[_0xbe14('0x41')](_0x6a0f29[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0x14cec7){var _0x524603;_0x21f793=_0x14cec7||[];var _0x38d720=[];if(_0x14cec7){for(var _0x379446=0x0;_0x379446<_0x14cec7[_0xbe14('0x32')];_0x379446+=0x1){var _0x1489c9=_0x14cec7[_0x379446][_0xbe14('0x15')]({'plain':!![]});_0x524603=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0xa7'))['fromQuery']([_0xbe14('0x8e'),_0xbe14('0x90'),_0xbe14('0x91'),'VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x6a0f29['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')](_0xbe14('0xa8'),_0xbe14('0x42'))[_0xbe14('0x6d')](_0xbe14('0xa8'),'updatedAt')[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();_0x38d720[_0xbe14('0x74')](db['sequelize'][_0xbe14('0x2e')](_0x524603));}return BPromise[_0xbe14('0x7a')](_0x38d720);}})['then'](function(){return _0x21f793;})['then'](respondWithResult(_0x3d04b9,null))[_0xbe14('0x35')](handleError(_0x3d04b9,null));};exports[_0xbe14('0xa9')]=function(_0x7533c3,_0x3ec670){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x7533c3[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3ec670,null))['then'](function(_0x3ee9e2){if(_0x3ee9e2){return _0x3ee9e2['removeBlackLists'](_0x7533c3[_0xbe14('0x2e')][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x1d343a){if(_0x1d343a){return db[_0xbe14('0x57')][_0xbe14('0x14')]({'where':{'ListId':_0x7533c3['query']['ids'],'VoiceQueueId':_0x7533c3['params']['id']}})['then'](function(){return _0x1d343a;});}})['then'](respondWithStatusCode(_0x3ec670,null))[_0xbe14('0x35')](handleError(_0x3ec670,null));}; \ No newline at end of file +var _0xa41a=['createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','filters','nolimit','order','sort','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','inbound','QueueCampaigns','filter','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','rawAttributes','key','where','include','VoiceQueue','findAll','rows','catch','params','model','query','keys','attributes','intersection','fields','length','merge','options','create','body','user','role','VoiceQueues','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit'];(function(_0x197767,_0x5cd129){var _0xc51080=function(_0x293b62){while(--_0x293b62){_0x197767['push'](_0x197767['shift']());}};_0xc51080(++_0x5cd129);}(_0xa41a,0x6b));var _0xaa41=function(_0x46b502,_0x383aa4){_0x46b502=_0x46b502-0x0;var _0x390a8=_0xa41a[_0x46b502];return _0x390a8;};'use strict';var moment=require(_0xaa41('0x0'));var BPromise=require(_0xaa41('0x1'));var util=require('util');var _=require(_0xaa41('0x2'));var squel=require(_0xaa41('0x3'));var Redis=require(_0xaa41('0x4'));var qs=require(_0xaa41('0x5'));var logger=require(_0xaa41('0x6'))(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var db=require(_0xaa41('0x9'))['db'];config['redis']=_[_0xaa41('0xa')](config[_0xaa41('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xb')]));require(_0xaa41('0xc'))['register'](socket);function respondWithStatusCode(_0x31df43,_0x33f66b){_0x33f66b=_0x33f66b||0xcc;return function(_0x409dab){if(_0x409dab){return _0x31df43[_0xaa41('0xd')](_0x33f66b);}return _0x31df43[_0xaa41('0xe')](_0x33f66b)[_0xaa41('0xf')]();};}function respondWithResult(_0x806f08,_0x423a19){_0x423a19=_0x423a19||0xc8;return function(_0x1c291e){if(_0x1c291e){return _0x806f08['status'](_0x423a19)[_0xaa41('0x10')](_0x1c291e);}};}function respondWithFilteredResult(_0x10cda9,_0x524cab){return function(_0x54827c){if(_0x54827c){var _0x1d0a54=typeof _0x524cab['offset']===_0xaa41('0x11')&&typeof _0x524cab[_0xaa41('0x12')]===_0xaa41('0x11');var _0x889d44=_0x54827c[_0xaa41('0x13')];var _0x4eaf81=_0x1d0a54?0x0:_0x524cab[_0xaa41('0x14')];var _0x178170=_0x1d0a54?_0x54827c[_0xaa41('0x13')]:_0x524cab[_0xaa41('0x14')]+_0x524cab[_0xaa41('0x12')];var _0x2005ae;if(_0x178170>=_0x889d44){_0x178170=_0x889d44;_0x2005ae=0xc8;}else{_0x2005ae=0xce;}_0x10cda9[_0xaa41('0xe')](_0x2005ae);return _0x10cda9['set'](_0xaa41('0x15'),_0x4eaf81+'-'+_0x178170+'/'+_0x889d44)[_0xaa41('0x10')](_0x54827c);}return null;};}function saveUpdates(_0x4210fa){return function(_0x391b01){if(_0x391b01){return _0x391b01[_0xaa41('0x16')](_0x4210fa)[_0xaa41('0x17')](function(_0x29efe5){return _0x29efe5;});}return null;};}function removeEntity(_0x46e6d3){return function(_0x150ddf){if(_0x150ddf){return _0x150ddf['destroy']()['then'](function(){var _0x1f502a=_0x150ddf[_0xaa41('0x18')]({'plain':!![]});var _0x35c753=[{'name':'VoiceQueues','value':_0xaa41('0x19'),'ignore':![]},{'name':_0xaa41('0x1a'),'value':'outbound','ignore':![]}];var _0x513c61=_(_0x35c753)[_0xaa41('0x1b')]('ignore')[_0xaa41('0x1c')](_0xaa41('0x1d'))[_0xaa41('0x1d')]();if(_[_0xaa41('0x1e')](_0x513c61,_0x1f502a[_0xaa41('0x1f')])){return;}var _0x4eb01f=_[_0xaa41('0x20')](_0x35c753,[_0xaa41('0x1d'),_0x1f502a[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x22')][_0xaa41('0x23')]({'where':{'type':_0x4eb01f,'resourceId':_0x1f502a['id']}})['then'](function(){return _0x150ddf;});})['then'](function(){_0x46e6d3[_0xaa41('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493a10){return function(_0x12e362){if(!_0x12e362){_0x493a10['sendStatus'](0x194);}return _0x12e362;};}function handleError(_0x536bed,_0x2d0ac0){_0x2d0ac0=_0x2d0ac0||0x1f4;return function(_0x9c8c21){logger[_0xaa41('0x24')](_0x9c8c21[_0xaa41('0x25')]);if(_0x9c8c21[_0xaa41('0x21')]){delete _0x9c8c21[_0xaa41('0x21')];}_0x536bed['status'](_0x2d0ac0)[_0xaa41('0x26')](_0x9c8c21);};}exports[_0xaa41('0x27')]=function(_0x63c18c,_0x9a16e3){var _0x1d8c2b={};var _0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x1c')](db['VoiceQueue'][_0xaa41('0x28')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x1f')][_0xaa41('0x29')]};});_0x1d8c2b=qs['getOptions'](_0x30f88e,_0x63c18c);var _0x392b5d={'where':_0x1d8c2b[_0xaa41('0x2a')]};return db['VoiceQueue']['count'](_0x392b5d)['then'](function(_0x1cf3da){_0x4466a3[_0xaa41('0x13')]=_0x1cf3da;_0x1d8c2b[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x63c18c['query']);return db[_0xaa41('0x2c')][_0xaa41('0x2d')](_0x1d8c2b);})[_0xaa41('0x17')](function(_0x4de770){_0x4466a3[_0xaa41('0x2e')]=_0x4de770;return _0x4466a3;})[_0xaa41('0x17')](respondWithFilteredResult(_0x9a16e3,_0x1d8c2b))[_0xaa41('0x2f')](handleError(_0x9a16e3,null));};exports['show']=function(_0x252c62,_0x374117){var _0x57fe1d={'raw':![],'where':{'id':_0x252c62[_0xaa41('0x30')]['id']}},_0x23eb50={};_0x23eb50[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x2c')]['rawAttributes']);_0x23eb50[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x252c62[_0xaa41('0x32')]);_0x23eb50['filters']=_['intersection'](_0x23eb50['model'],_0x23eb50[_0xaa41('0x32')]);_0x57fe1d[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x23eb50[_0xaa41('0x31')],qs['fields'](_0x252c62['query'][_0xaa41('0x36')]));_0x57fe1d[_0xaa41('0x34')]=_0x57fe1d[_0xaa41('0x34')][_0xaa41('0x37')]?_0x57fe1d[_0xaa41('0x34')]:_0x23eb50[_0xaa41('0x31')];if(_0x252c62[_0xaa41('0x32')]['includeAll']){_0x57fe1d[_0xaa41('0x2b')]=[{'all':!![]}];}_0x57fe1d=_[_0xaa41('0x38')]({},_0x57fe1d,_0x252c62[_0xaa41('0x39')]);return db[_0xaa41('0x2c')]['find'](_0x57fe1d)['then'](handleEntityNotFound(_0x374117,null))[_0xaa41('0x17')](respondWithResult(_0x374117,null))[_0xaa41('0x2f')](handleError(_0x374117,null));};exports['create']=function(_0x4101ab,_0x563687){return db[_0xaa41('0x2c')][_0xaa41('0x3a')](_0x4101ab[_0xaa41('0x3b')],{})[_0xaa41('0x17')](function(_0x3e6cac){var _0x12ba1a=_0x4101ab[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x12ba1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ba1a[_0xaa41('0x3d')]===_0xaa41('0x3c')){var _0x35c685=_0x3e6cac[_0xaa41('0x18')]({'plain':!![]});var _0xc84fb8=[{'name':_0xaa41('0x3e'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0x4f9086=_[_0xaa41('0x20')](_0xc84fb8,[_0xaa41('0x1d'),_0x35c685[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x40')][_0xaa41('0x20')]({'where':{'name':_0x4f9086,'userProfileId':_0x12ba1a[_0xaa41('0x41')]},'raw':!![]})['then'](function(_0x124992){if(_0x124992&&_0x124992['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x3a')]({'name':_0x35c685['name'],'resourceId':_0x35c685['id'],'type':_0x124992['name'],'sectionId':_0x124992['id']},{})['then'](function(){return _0x3e6cac;});}else{return _0x3e6cac;}})[_0xaa41('0x2f')](function(_0x525b09){logger[_0xaa41('0x24')](_0xaa41('0x42'),_0x525b09);throw _0x525b09;});}return _0x3e6cac;})['then'](respondWithResult(_0x563687,0xc9))['catch'](handleError(_0x563687,null));};exports[_0xaa41('0x43')]=function(_0x1b7b97,_0x1bb973){var _0x2af8ba={'where':{'id':_0x1b7b97[_0xaa41('0x30')]['id']}},_0x3fe1a9={};_0x3fe1a9[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x2c')]['rawAttributes']);_0x2af8ba[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x3fe1a9[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x36')]));_0x2af8ba['attributes']=_0x2af8ba[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2af8ba[_0xaa41('0x34')]:_0x3fe1a9[_0xaa41('0x31')];if(_0x1b7b97['query'][_0xaa41('0x44')]){_0x2af8ba['include']=[{'all':!![]}];}_0x2af8ba=_['merge']({},_0x2af8ba,_0x1b7b97[_0xaa41('0x39')]);return db[_0xaa41('0x2c')][_0xaa41('0x20')](_0x2af8ba)['then'](handleEntityNotFound(_0x1bb973,null))[_0xaa41('0x17')](function(_0x3e1a73){if(_0x3e1a73){var _0x853ccb=_0x3e1a73['get']({'plain':!![]});_0x853ccb=qs[_0xaa41('0x45')](_0x853ccb,['id',_0xaa41('0x46'),_0xaa41('0x47')]);_0x1b7b97[_0xaa41('0x3b')]=_[_0xaa41('0x45')](_0x1b7b97[_0xaa41('0x3b')],['id',_0xaa41('0x46'),_0xaa41('0x47')]);return db['VoiceQueue'][_0xaa41('0x3a')](_['merge'](_0x853ccb,_0x1b7b97['body']),{'include':_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x44')]?[{'all':!![]}]:undefined})[_0xaa41('0x17')](function(_0x11f7d9){var _0x14aab0=_0x1b7b97[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x14aab0)throw new Error(_0xaa41('0x48'));if(_0x14aab0['role']===_0xaa41('0x3c')){var _0x14b0f0=_0x11f7d9[_0xaa41('0x18')]({'plain':!![]});var _0x4f9e92=[{'name':_0xaa41('0x3e'),'value':_0xaa41('0x19')},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0xd36d1a=_[_0xaa41('0x20')](_0x4f9e92,['value',_0x14b0f0[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db['UserProfileSection']['find']({'where':{'name':_0xd36d1a,'userProfileId':_0x14aab0[_0xaa41('0x41')]},'raw':!![]})[_0xaa41('0x17')](function(_0x3a29d2){if(_0x3a29d2&&_0x3a29d2['autoAssociation']===0x0){return db[_0xaa41('0x22')][_0xaa41('0x3a')]({'name':_0x14b0f0[_0xaa41('0x21')],'resourceId':_0x14b0f0['id'],'type':_0x3a29d2[_0xaa41('0x21')],'sectionId':_0x3a29d2['id']},{})[_0xaa41('0x17')](function(){return _0x11f7d9;});}else{return _0x11f7d9;}})['catch'](function(_0x2ae70c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ae70c);throw _0x2ae70c;});}return _0x11f7d9;});}})[_0xaa41('0x17')](respondWithResult(_0x1bb973,0xc9))['catch'](handleError(_0x1bb973,null));};exports[_0xaa41('0x16')]=function(_0xbbf261,_0x169ddf){if(_0xbbf261['body']['id']){delete _0xbbf261[_0xaa41('0x3b')]['id'];}return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0xbbf261[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x169ddf,null))[_0xaa41('0x17')](saveUpdates(_0xbbf261[_0xaa41('0x3b')],null))[_0xaa41('0x17')](respondWithResult(_0x169ddf,null))[_0xaa41('0x2f')](handleError(_0x169ddf,null));};exports['destroy']=function(_0x35a09e,_0x40cdfc){return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x35a09e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x40cdfc,null))[_0xaa41('0x17')](removeEntity(_0x40cdfc,null))[_0xaa41('0x2f')](handleError(_0x40cdfc,null));};exports[_0xaa41('0x49')]=function(_0xfbe748,_0x320ce7){var _0x5ea056={'raw':![],'where':{}};var _0x55a85c={};var _0x5cb34d={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xfbe748['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x320ce7,null))['then'](function(_0x576e6e){if(_0x576e6e){_0x55a85c[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x4a')][_0xaa41('0x28')]);_0x55a85c['query']=_[_0xaa41('0x33')](_0xfbe748[_0xaa41('0x32')]);_0x55a85c[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],_0x55a85c[_0xaa41('0x32')]);_0x5ea056[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],qs['fields'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5ea056['attributes']=_0x5ea056['attributes']['length']?_0x5ea056[_0xaa41('0x34')]:_0x55a85c['model'];if(!_0xfbe748[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x5ea056[_0xaa41('0x12')]=qs['limit'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5ea056[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xfbe748['query']['offset']);}_0x5ea056[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfbe748['query']['sort']);_0x5ea056[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfbe748[_0xaa41('0x32')],_0x55a85c[_0xaa41('0x4b')]));_0x5ea056['where'][_0xaa41('0x50')]=_0x576e6e['id'];if(_0xfbe748['query']['filter']){_0x5ea056['where']=_[_0xaa41('0x38')](_0x5ea056[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5ea056['attributes'],function(_0x229297){var _0x2adf93={};_0x2adf93[_0x229297]={'$like':'%'+_0xfbe748[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x2adf93;})});}_0x5ea056=_[_0xaa41('0x38')]({},_0x5ea056,_0xfbe748[_0xaa41('0x39')]);return db[_0xaa41('0x4a')]['count']({'where':_0x5ea056[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x40b47c){_0x5cb34d[_0xaa41('0x13')]=_0x40b47c;if(_0xfbe748['query'][_0xaa41('0x44')]){_0x5ea056['include']=[{'all':!![]}];}return db[_0xaa41('0x4a')][_0xaa41('0x2d')](_0x5ea056);})[_0xaa41('0x17')](function(_0x143ef0){_0x5cb34d['rows']=_0x143ef0;return _0x5cb34d;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x320ce7,_0x5ea056))[_0xaa41('0x2f')](handleError(_0x320ce7,null));};exports[_0xaa41('0x51')]=function(_0x304aad,_0x59052d){var _0x140d78={'raw':!![],'where':{}};var _0x50197b={};var _0x55d380={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x304aad[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x59052d,null))[_0xaa41('0x17')](function(_0x582d79){if(_0x582d79){_0x50197b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x52')][_0xaa41('0x28')]);_0x50197b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x304aad[_0xaa41('0x32')]);_0x50197b['filters']=_[_0xaa41('0x35')](_0x50197b[_0xaa41('0x31')],_0x50197b[_0xaa41('0x32')]);_0x140d78['attributes']=_['intersection'](_0x50197b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x304aad['query'][_0xaa41('0x36')]));_0x140d78[_0xaa41('0x34')]=_0x140d78['attributes'][_0xaa41('0x37')]?_0x140d78[_0xaa41('0x34')]:_0x50197b[_0xaa41('0x31')];if(!_0x304aad[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x140d78[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x304aad['query']['limit']);_0x140d78[_0xaa41('0x14')]=qs['offset'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x140d78[_0xaa41('0x4d')]=qs['sort'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x140d78[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x304aad[_0xaa41('0x32')],_0x50197b['filters']));_0x140d78[_0xaa41('0x2a')]['VoiceQueueId']=_0x582d79['id'];if(_0x304aad['query'][_0xaa41('0x1b')]){_0x140d78[_0xaa41('0x2a')]=_['merge'](_0x140d78['where'],{'$or':_[_0xaa41('0x1c')](_0x140d78[_0xaa41('0x34')],function(_0x3c189d){var _0x447183={};_0x447183[_0x3c189d]={'$like':'%'+_0x304aad['query'][_0xaa41('0x1b')]+'%'};return _0x447183;})});}_0x140d78=_[_0xaa41('0x38')]({},_0x140d78,_0x304aad[_0xaa41('0x39')]);return db['CmHopperHistory'][_0xaa41('0x13')]({'where':_0x140d78[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x5697b6){_0x55d380[_0xaa41('0x13')]=_0x5697b6;if(_0x304aad['query']['includeAll']){_0x140d78[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x52')]['findAll'](_0x140d78);})[_0xaa41('0x17')](function(_0x9e8ebb){_0x55d380[_0xaa41('0x2e')]=_0x9e8ebb;return _0x55d380;});}})['then'](respondWithFilteredResult(_0x59052d,_0x140d78))[_0xaa41('0x2f')](handleError(_0x59052d,null));};exports[_0xaa41('0x54')]=function(_0x1a2deb,_0x16dcac){var _0x38f5d0={'raw':!![],'where':{}};var _0x4e087d={};var _0x24eb2e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x1a2deb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x16dcac,null))[_0xaa41('0x17')](function(_0x33ec81){if(_0x33ec81){_0x4e087d[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x56')][_0xaa41('0x28')]);_0x4e087d[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x1a2deb['query']);_0x4e087d[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x4e087d['model'],_0x4e087d[_0xaa41('0x32')]);_0x38f5d0['attributes']=_[_0xaa41('0x35')](_0x4e087d[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x36')]));_0x38f5d0[_0xaa41('0x34')]=_0x38f5d0[_0xaa41('0x34')]['length']?_0x38f5d0[_0xaa41('0x34')]:_0x4e087d[_0xaa41('0x31')];if(!_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x38f5d0[_0xaa41('0x12')]=qs['limit'](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x12')]);_0x38f5d0[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x1a2deb[_0xaa41('0x32')]['offset']);}_0x38f5d0[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x1a2deb['query'][_0xaa41('0x4e')]);_0x38f5d0[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x1a2deb[_0xaa41('0x32')],_0x4e087d[_0xaa41('0x4b')]));_0x38f5d0[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x33ec81['id'];if(_0x1a2deb['query'][_0xaa41('0x1b')]){_0x38f5d0[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x38f5d0[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x38f5d0[_0xaa41('0x34')],function(_0x5489be){var _0x56f5ff={};_0x56f5ff[_0x5489be]={'$like':'%'+_0x1a2deb['query'][_0xaa41('0x1b')]+'%'};return _0x56f5ff;})});}_0x38f5d0=_[_0xaa41('0x38')]({},_0x38f5d0,_0x1a2deb['options']);return db[_0xaa41('0x56')][_0xaa41('0x13')]({'where':_0x38f5d0['where']})[_0xaa41('0x17')](function(_0x1da898){_0x24eb2e[_0xaa41('0x13')]=_0x1da898;if(_0x1a2deb[_0xaa41('0x32')]['includeAll']){_0x38f5d0[_0xaa41('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xaa41('0x2d')](_0x38f5d0);})[_0xaa41('0x17')](function(_0x374873){_0x24eb2e[_0xaa41('0x2e')]=_0x374873;return _0x24eb2e;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x16dcac,_0x38f5d0))[_0xaa41('0x2f')](handleError(_0x16dcac,null));};exports[_0xaa41('0x57')]=function(_0x27363e,_0x25cac8){var _0x5381d5={'raw':!![],'where':{}};var _0x276013={};var _0x3135c3={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x27363e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25cac8,null))[_0xaa41('0x17')](function(_0x408d95){if(_0x408d95){_0x276013[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x58')][_0xaa41('0x28')]);_0x276013[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x27363e[_0xaa41('0x32')]);_0x276013['filters']=_[_0xaa41('0x35')](_0x276013[_0xaa41('0x31')],_0x276013[_0xaa41('0x32')]);_0x5381d5[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x276013['model'],qs['fields'](_0x27363e[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5381d5['attributes']=_0x5381d5[_0xaa41('0x34')][_0xaa41('0x37')]?_0x5381d5['attributes']:_0x276013['model'];if(!_0x27363e['query'][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x5381d5[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5381d5[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x5381d5[_0xaa41('0x4d')]=qs['sort'](_0x27363e['query'][_0xaa41('0x4e')]);_0x5381d5[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x27363e['query'],_0x276013[_0xaa41('0x4b')]));_0x5381d5[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x408d95['id'];if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x5381d5[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x5381d5[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5381d5['attributes'],function(_0x56bd21){var _0x56661a={};_0x56661a[_0x56bd21]={'$like':'%'+_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x56661a;})});}_0x5381d5=_['merge']({},_0x5381d5,_0x27363e['options']);return db[_0xaa41('0x58')][_0xaa41('0x13')]({'where':_0x5381d5['where']})['then'](function(_0xf651b7){_0x3135c3['count']=_0xf651b7;if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x44')]){_0x5381d5[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x58')][_0xaa41('0x2d')](_0x5381d5);})[_0xaa41('0x17')](function(_0x211455){_0x3135c3[_0xaa41('0x2e')]=_0x211455;return _0x3135c3;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x25cac8,_0x5381d5))['catch'](handleError(_0x25cac8,null));};exports['getTeams']=function(_0x38884d,_0x25d938){var _0x337655={};var _0x415705={};var _0x3efb43;var _0xae746;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x38884d[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25d938,null))[_0xaa41('0x17')](function(_0x17442e){if(_0x17442e){_0x3efb43=_0x17442e;_0x415705[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x59')]['rawAttributes']);_0x415705[_0xaa41('0x32')]=_['keys'](_0x38884d[_0xaa41('0x32')]);_0x415705[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],_0x415705[_0xaa41('0x32')]);_0x337655[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],qs['fields'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x36')]));_0x337655[_0xaa41('0x34')]=_0x337655[_0xaa41('0x34')][_0xaa41('0x37')]?_0x337655[_0xaa41('0x34')]:_0x415705[_0xaa41('0x31')];_0x337655[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x38884d[_0xaa41('0x32')]['sort']);_0x337655['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x38884d[_0xaa41('0x32')],_0x415705[_0xaa41('0x4b')]));if(_0x38884d[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x337655[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x337655[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x337655['attributes'],function(_0x49b468){var _0x17018e={};_0x17018e[_0x49b468]={'$like':'%'+_0x38884d[_0xaa41('0x32')]['filter']+'%'};return _0x17018e;})});}_0x337655=_[_0xaa41('0x38')]({},_0x337655,_0x38884d['options']);return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x50e03d){if(_0x50e03d){_0xae746=_0x50e03d['length'];if(!_0x38884d[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x337655['limit']=qs['limit'](_0x38884d[_0xaa41('0x32')]['limit']);_0x337655[_0xaa41('0x14')]=qs['offset'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x182b0b){if(_0x182b0b){return _0x182b0b?{'count':_0xae746,'rows':_0x182b0b}:null;}})[_0xaa41('0x17')](respondWithResult(_0x25d938,null))[_0xaa41('0x2f')](handleError(_0x25d938,null));};exports['addTeams']=function(_0x4363b5,_0x1fa1f5){var _0x50883c=_0x4363b5[_0xaa41('0x3b')][_0xaa41('0x5b')];var _0x1c3d7f=_[_0xaa41('0x1c')](_0x50883c,'id');return db['Team'][_0xaa41('0x2d')]({'where':{'id':_0x1c3d7f},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]}]})[_0xaa41('0x17')](function(_0xe2574a){if(_0xe2574a){var _0x4d83ce=_['flatMap'](_0xe2574a,function(_0x214ebe){var _0x2df75c=_0x214ebe[_0xaa41('0x18')]({'plain':!![]});_0x2df75c[_0xaa41('0x5d')][_0xaa41('0x61')](function(_0x401586){_0x401586['penalty']=_[_0xaa41('0x20')](_0x50883c,{'id':_0x2df75c['id']})[_0xaa41('0x62')];});return _0x2df75c[_0xaa41('0x5d')];});return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x4363b5[_0xaa41('0x30')]['id']}})['then'](function(_0xe8076e){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4cf0c5){return _0xe8076e[_0xaa41('0x65')](_0x1c3d7f,{'transaction':_0x4cf0c5})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x50883c,function(_0x255e76){return db[_0xaa41('0x67')][_0xaa41('0x68')]({'TeamId':_0x255e76['id'],'VoiceQueueId':_0x4363b5[_0xaa41('0x30')]['id'],'penalty':_0x255e76[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x4d83ce,function(_0x19a42c){return db[_0xaa41('0x69')][_0xaa41('0x6a')]({'where':{'UserId':_0x19a42c['id'],'VoiceQueueId':_0x4363b5['params']['id']},'defaults':{'penalty':_0x19a42c['penalty']},'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_[_0xaa41('0x1b')](_0x4d83ce,{'online':!![]}),function(_0x2c4595){return db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x2c4595[_0xaa41('0x21')],'UserId':_0x2c4595['id'],'queue_name':_0xe8076e['name'],'VoiceQueueId':_0xe8076e['id'],'interface':_[_0xaa41('0x6c')](_0x2c4595[_0xaa41('0x60')])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x2c4595[_0xaa41('0x21')]):_0x2c4595[_0xaa41('0x60')],'paused':_0x2c4595[_0xaa41('0x5f')]||![],'penalty':_0x2c4595[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){_0x4d83ce[_0xaa41('0x61')](function(_0x3f2dbb){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':_0x3f2dbb['id'],'VoiceQueueId':_0xe8076e['id']});});});});});}})[_0xaa41('0x17')](respondWithStatusCode(_0x1fa1f5,null))[_0xaa41('0x2f')](handleError(_0x1fa1f5,null));};exports['removeTeams']=function(_0x33f008,_0x1489fe){return db[_0xaa41('0x59')][_0xaa41('0x2d')]({'where':{'id':_0x33f008['query'][_0xaa41('0x70')]},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id'],'raw':!![]}]})[_0xaa41('0x17')](handleEntityNotFound(_0x1489fe,null))[_0xaa41('0x17')](function(_0x4baae3){var _0xc59a12=_['map'](_0x4baae3,'id');var _0x50a526=[];var _0x3dd3fa=[];var _0x552493=squel['select']();_0x552493[_0xaa41('0x71')](_0xaa41('0x72'))[_0xaa41('0x73')]('team_has_voice_queues','tq')[_0xaa41('0x74')](_0xaa41('0x75'),'ut',_0xaa41('0x76'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x33f008[_0xaa41('0x30')]['id']);for(var _0x29d34a=0x0;_0x29d34a<_0x4baae3[_0xaa41('0x37')];_0x29d34a+=0x1){let _0x48e2cf=_0x4baae3[_0x29d34a];for(var _0x410d6e=0x0;_0x410d6e<_0x48e2cf[_0xaa41('0x5d')][_0xaa41('0x37')];_0x410d6e+=0x1){let _0x3361f5=_0x48e2cf[_0xaa41('0x5d')][_0x410d6e];var _0x4f1bcb=_0x552493['clone']();_0x4f1bcb[_0xaa41('0x2a')](_0xaa41('0x78'),_0x3361f5['id']);_0x3dd3fa[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x4f1bcb[_0xaa41('0x7a')](),{'type':db['sequelize'][_0xaa41('0x7b')][_0xaa41('0x7c')]})['then'](function(_0x40f4ce){if(_0x40f4ce[_0xaa41('0x37')]===0x1){return _0x3361f5['id'];}else{var _0x95300a=_[_0xaa41('0x7d')](_[_0xaa41('0x1c')](_0x40f4ce,_0xaa41('0x7e')),function(_0x1926bd){return _['includes'](_0xc59a12,_0x1926bd);});if(_0x95300a){return _0x3361f5['id'];}}}));}}return BPromise[_0xaa41('0x7f')](_0x3dd3fa)[_0xaa41('0x17')](function(_0x5404cd){_0x50a526=_(_0x50a526)[_0xaa41('0x80')](_0x5404cd)[_0xaa41('0x81')]()[_0xaa41('0x1d')]();return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x33f008[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(_0x339537){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4b84bc){return _0x339537[_0xaa41('0x82')](_0x33f008[_0xaa41('0x32')]['ids'],{'transaction':_0x4b84bc})['then'](function(){if(!_[_0xaa41('0x83')](_0x50a526)){return _0x339537[_0xaa41('0x84')](_0x50a526,{'transaction':_0x4b84bc})[_0xaa41('0x17')](function(){return db[_0xaa41('0x6b')][_0xaa41('0x23')]({'where':{'VoiceQueueId':_0x33f008[_0xaa41('0x30')]['id'],'UserId':_0x50a526},'transaction':_0x4b84bc});});}})['then'](function(){_0x50a526['forEach'](function(_0x395323){socket[_0xaa41('0x6f')]('userVoiceQueue:remove',{'UserId':_0x395323,'VoiceQueueId':_0x339537['id']});});});});});});})['then'](respondWithStatusCode(_0x1489fe,null))[_0xaa41('0x2f')](handleError(_0x1489fe,null));};exports[_0xaa41('0x85')]=function(_0x2fe50f,_0x520b50){var _0x50122d,_0x1d609e;return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2fe50f['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x520b50,null))[_0xaa41('0x17')](function(_0x5a0791){if(_0x5a0791){_0x1d609e=_0x5a0791;return _0x5a0791['addAgents'](_0x2fe50f[_0xaa41('0x3b')]['ids'],_[_0xaa41('0x45')](_0x2fe50f[_0xaa41('0x3b')],[_0xaa41('0x70'),'id'])||{})[_0xaa41('0x86')](function(_0x1d7c2e){for(var _0xdc0493=0x0;_0xdc0493<_0x2fe50f[_0xaa41('0x3b')]['ids'][_0xaa41('0x37')];_0xdc0493+=0x1){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':Number(_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')][_0xdc0493]),'VoiceQueueId':Number(_0x2fe50f[_0xaa41('0x30')]['id'])});}return _0x1d7c2e;});}})[_0xaa41('0x17')](function(_0x2af16e){_0x50122d=_0x2af16e||[];if(_0x1d609e){return db[_0xaa41('0x5c')]['findAll']({'where':{'id':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')]},'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]});}})[_0xaa41('0x17')](function(_0x5083ff){if(!_[_0xaa41('0x83')](_0x5083ff)){var _0x3c4e89=[];for(var _0x415acc=0x0;_0x415acc<_0x5083ff['length'];_0x415acc++){if(_0x5083ff[_0x415acc]['online']){_0x3c4e89['push'](db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x5083ff[_0x415acc][_0xaa41('0x21')],'UserId':_0x5083ff[_0x415acc]['id'],'queue_name':_0x1d609e[_0xaa41('0x21')],'VoiceQueueId':_0x1d609e['id'],'interface':_[_0xaa41('0x6c')](_0x5083ff[_0x415acc]['interface'])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x5083ff[_0x415acc][_0xaa41('0x21')]):_0x5083ff[_0x415acc][_0xaa41('0x60')],'paused':_0x5083ff[_0x415acc][_0xaa41('0x5f')]||![],'penalty':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x62')]||0x0}));}}return BPromise['all'](_0x3c4e89);}})[_0xaa41('0x17')](function(){return _0x50122d;})[_0xaa41('0x17')](respondWithResult(_0x520b50,null))[_0xaa41('0x2f')](handleError(_0x520b50,null));};exports['removeAgents']=function(_0x16a173,_0x53a519){return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x16a173['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x53a519,null))[_0xaa41('0x17')](function(_0x366705){if(_0x366705){return _0x366705[_0xaa41('0x84')](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])[_0xaa41('0x17')](function(){if(_['isArray'](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])){for(var _0x3ee9e3=0x0;_0x3ee9e3<_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0xaa41('0x37')];_0x3ee9e3+=0x1){socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0x3ee9e3]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}}else{socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}});}})['then'](function(_0x29b27e){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x16a173['params']['id'],'UserId':_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]}})['then'](function(){return _0x29b27e;});})[_0xaa41('0x17')](respondWithStatusCode(_0x53a519,null))[_0xaa41('0x2f')](handleError(_0x53a519,null));};exports[_0xaa41('0x88')]=function(_0x15bb60,_0x232732){var _0x34d857={};var _0x239f1b={};var _0x445925;var _0x1e8591;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x15bb60[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x232732,null))[_0xaa41('0x17')](function(_0x7bae82){if(_0x7bae82){_0x445925=_0x7bae82;_0x239f1b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['User'][_0xaa41('0x28')]);_0x239f1b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x15bb60[_0xaa41('0x32')]);_0x239f1b['filters']=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],_0x239f1b['query']);_0x34d857[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x36')]));_0x34d857[_0xaa41('0x34')]=_0x34d857[_0xaa41('0x34')][_0xaa41('0x37')]?_0x34d857[_0xaa41('0x34')]:_0x239f1b['model'];_0x34d857[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x34d857[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_['pick'](_0x15bb60[_0xaa41('0x32')],_0x239f1b['filters']));if(_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x34d857[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x34d857[_0xaa41('0x2a')],{'$or':_['map'](_0x34d857[_0xaa41('0x34')],function(_0x345002){var _0x5f39b4={};_0x5f39b4[_0x345002]={'$like':'%'+_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x5f39b4;})});}_0x34d857=_[_0xaa41('0x38')]({},_0x34d857,_0x15bb60[_0xaa41('0x39')]);return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0x38b3be){if(_0x38b3be){_0x1e8591=_0x38b3be[_0xaa41('0x37')];if(!_0x15bb60[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x34d857[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x15bb60[_0xaa41('0x32')]['limit']);_0x34d857['offset']=qs[_0xaa41('0x14')](_0x15bb60['query']['offset']);}return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0xa4dbd3){if(_0xa4dbd3){return _0xa4dbd3?{'count':_0x1e8591,'rows':_0xa4dbd3}:null;}})[_0xaa41('0x17')](respondWithResult(_0x232732,null))['catch'](handleError(_0x232732,null));};exports['getMembers']=function(_0xa63e60,_0xf4f13f){var _0xef0e44={};var _0x46d37f={};var _0x6a6081;var _0x5e3bb2;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0xa63e60['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0xf4f13f,null))[_0xaa41('0x17')](function(_0x4b4a4a){if(_0x4b4a4a){_0x6a6081=_0x4b4a4a;_0x46d37f[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['UserVoiceQueueRt'][_0xaa41('0x28')]);_0x46d37f[_0xaa41('0x32')]=_['keys'](_0xa63e60[_0xaa41('0x32')]);_0x46d37f['filters']=_['intersection'](_0x46d37f[_0xaa41('0x31')],_0x46d37f[_0xaa41('0x32')]);_0xef0e44[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x46d37f[_0xaa41('0x31')],qs['fields'](_0xa63e60[_0xaa41('0x32')]['fields']));_0xef0e44['attributes']=_0xef0e44[_0xaa41('0x34')][_0xaa41('0x37')]?_0xef0e44[_0xaa41('0x34')]:_0x46d37f[_0xaa41('0x31')];_0xef0e44[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xa63e60[_0xaa41('0x32')]['sort']);_0xef0e44[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xa63e60[_0xaa41('0x32')],_0x46d37f[_0xaa41('0x4b')]));if(_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0xef0e44[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0xef0e44[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0xef0e44[_0xaa41('0x34')],function(_0x5a2ba0){var _0x4fc7d6={};_0x4fc7d6[_0x5a2ba0]={'$like':'%'+_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x4fc7d6;})});}_0xef0e44=_[_0xaa41('0x38')]({},_0xef0e44,_0xa63e60['options']);return _0x6a6081[_0xaa41('0x89')](_0xef0e44);}})[_0xaa41('0x17')](function(_0x15bc15){if(_0x15bc15){_0x5e3bb2=_0x15bc15[_0xaa41('0x37')];if(!_0xa63e60[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0xef0e44[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x12')]);_0xef0e44[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x6a6081['getMembers'](_0xef0e44);}})[_0xaa41('0x17')](function(_0x28c109){return _0x28c109?{'count':_0x5e3bb2,'rows':_0x28c109}:null;})[_0xaa41('0x17')](respondWithResult(_0xf4f13f,null))['catch'](handleError(_0xf4f13f,null));};exports[_0xaa41('0x8a')]=function(_0xfc1e24,_0x35c48f){var _0x2b0bf9={};var _0x21c0c6={};var _0x1138d0;var _0x394987;return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0xfc1e24[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x35c48f,null))[_0xaa41('0x17')](function(_0x2fc4b1){if(_0x2fc4b1){_0x1138d0=_0x2fc4b1;_0x21c0c6[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x8b')]['rawAttributes']);_0x21c0c6[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0xfc1e24[_0xaa41('0x32')]);_0x21c0c6[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],_0x21c0c6[_0xaa41('0x32')]);_0x2b0bf9[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0xfc1e24[_0xaa41('0x32')]['fields']));_0x2b0bf9['attributes']=_0x2b0bf9[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2b0bf9[_0xaa41('0x34')]:_0x21c0c6[_0xaa41('0x31')];_0x2b0bf9[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfc1e24['query'][_0xaa41('0x4e')]);_0x2b0bf9['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfc1e24[_0xaa41('0x32')],_0x21c0c6[_0xaa41('0x4b')]));if(_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x2b0bf9['where']=_['merge'](_0x2b0bf9[_0xaa41('0x2a')],{'$or':_['map'](_0x2b0bf9[_0xaa41('0x34')],function(_0x3f8296){var _0x438fcf={};_0x438fcf[_0x3f8296]={'$like':'%'+_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x438fcf;})});}_0x2b0bf9=_[_0xaa41('0x38')]({},_0x2b0bf9,_0xfc1e24[_0xaa41('0x39')]);return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x2667bd){if(_0x2667bd){_0x394987=_0x2667bd[_0xaa41('0x37')];if(!_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x2b0bf9['limit']=qs[_0xaa41('0x12')](_0xfc1e24['query'][_0xaa41('0x12')]);_0x2b0bf9['offset']=qs[_0xaa41('0x14')](_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x3dafc6){if(_0x3dafc6){return _0x3dafc6?{'count':_0x394987,'rows':_0x3dafc6}:null;}})[_0xaa41('0x17')](respondWithResult(_0x35c48f,null))['catch'](handleError(_0x35c48f,null));};exports[_0xaa41('0x8c')]=function(_0x533f4b,_0x47ca9d){var _0xd1f9ba=moment()[_0xaa41('0x6d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2c4930,_0x1285ed;return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x533f4b[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x47ca9d,null))['then'](function(_0x3ecde6){if(_0x3ecde6){_0x1285ed=_0x3ecde6;return _0x3ecde6['addLists'](_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x533f4b[_0xaa41('0x3b')],['ids','id'])||{});}return null;})[_0xaa41('0x86')](function(_0x32a07e){var _0x2b8b73;_0x2c4930=_0x32a07e||[];var _0x49e4a5=[];if(_0x32a07e){for(var _0xda8e73=0x0;_0xda8e73<_0x32a07e[_0xaa41('0x37')];_0xda8e73+=0x1){var _0x25f5ba=_0x32a07e[_0xda8e73][_0xaa41('0x18')]({'plain':!![]});_0x1285ed[_0xaa41('0x8d')]=_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x8d')]?_0x533f4b[_0xaa41('0x3b')]['dialCheckDuplicateType']:_0x1285ed[_0xaa41('0x8d')];switch(_0x1285ed['dialCheckDuplicateType']){case _0xaa41('0x8e'):_0x2b8b73=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0x91'))[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),'ListId')[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')]['toString']())[_0xaa41('0x2a')](_0xaa41('0x9b'))['where'](_0xaa41('0x9c'),squel['select']()[_0xaa41('0x71')](_0xaa41('0x9d'))[_0xaa41('0x73')](_0xaa41('0x9e'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]()))[_0xaa41('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xaa41('0x71')](_0xaa41('0x9f'))['from'](_0xaa41('0x91'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x533f4b['params']['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;case _0xaa41('0xa0'):_0x2b8b73=squel['insert']()[_0xaa41('0x90')](_0xaa41('0x91'))['fromQuery'](['phone',_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),'createdAt',_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))['field']('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27','createdAt')[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')]('deletedAt\x20IS\x20NULL')[_0xaa41('0x2a')]('ListId\x20=\x20?',_0x25f5ba[_0xaa41('0x98')]['toString']())['where'](_0xaa41('0x9b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xaa41('0x97')]()[_0xaa41('0x71')](_0xaa41('0x9f'))[_0xaa41('0x73')](_0xaa41('0x91'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;default:_0x2b8b73=squel['insert']()[_0xaa41('0x90')]('cm_hopper')[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),'ListId','VoiceQueueId',_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')]['toString'](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))['from'](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))[_0xaa41('0x7a')]();}_0x49e4a5[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x2b8b73));}return BPromise[_0xaa41('0x7f')](_0x49e4a5);}})['then'](function(){var _0x58f009=[];var _0x405eba=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')]('cm_hopper_additional_phones')[_0xaa41('0x92')]([_0xaa41('0xa2'),_0xaa41('0x93'),_0xaa41('0xa3'),_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()[_0xaa41('0x71')](_0xaa41('0xa4'))[_0xaa41('0x71')](_0xaa41('0xa5'))['field'](_0xaa41('0xa6'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27','updatedAt')[_0xaa41('0x73')](_0xaa41('0xa7'),'ci')[_0xaa41('0x74')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0xaa41('0x2a')](_0xaa41('0xa8'),_0xd1f9ba)[_0xaa41('0x2a')](_0xaa41('0xa9'),_0xaa41('0xaa')))[_0xaa41('0x7a')]();_0x58f009['push'](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x405eba));return BPromise[_0xaa41('0x7f')](_0x58f009);})[_0xaa41('0x17')](function(){return _0x2c4930;})[_0xaa41('0x17')](respondWithResult(_0x47ca9d,null))[_0xaa41('0x2f')](handleError(_0x47ca9d,null));};exports[_0xaa41('0xab')]=function(_0x718a84,_0x151c5f){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x718a84['params']['id']}})['then'](handleEntityNotFound(_0x151c5f,null))[_0xaa41('0x17')](function(_0x293a1d){if(_0x293a1d){return _0x293a1d['removeLists'](_0x718a84[_0xaa41('0x32')][_0xaa41('0x70')]);}})['then'](function(_0x490a6c){if(_0x490a6c){return db[_0xaa41('0x4a')][_0xaa41('0x23')]({'where':{'ListId':_0x718a84[_0xaa41('0x32')]['ids'],'VoiceQueueId':_0x718a84[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x490a6c;});}})['then'](respondWithStatusCode(_0x151c5f,null))[_0xaa41('0x2f')](handleError(_0x151c5f,null));};exports[_0xaa41('0xac')]=function(_0x536cdb,_0x431b75){var _0x18499f={};var _0x49cbd7={};var _0x515f91;var _0x4b5953;return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x536cdb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x431b75,null))[_0xaa41('0x17')](function(_0x4ca8f7){if(_0x4ca8f7){_0x515f91=_0x4ca8f7;_0x49cbd7['model']=_[_0xaa41('0x33')](db['CmList'][_0xaa41('0x28')]);_0x49cbd7[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x536cdb[_0xaa41('0x32')]);_0x49cbd7['filters']=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],_0x49cbd7[_0xaa41('0x32')]);_0x18499f[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x536cdb[_0xaa41('0x32')]['fields']));_0x18499f['attributes']=_0x18499f[_0xaa41('0x34')][_0xaa41('0x37')]?_0x18499f[_0xaa41('0x34')]:_0x49cbd7[_0xaa41('0x31')];_0x18499f[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x536cdb[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x18499f[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x536cdb[_0xaa41('0x32')],_0x49cbd7[_0xaa41('0x4b')]));if(_0x536cdb['query'][_0xaa41('0x1b')]){_0x18499f[_0xaa41('0x2a')]=_['merge'](_0x18499f[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x18499f[_0xaa41('0x34')],function(_0x5cd79d){var _0x558583={};_0x558583[_0x5cd79d]={'$like':'%'+_0x536cdb[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x558583;})});}_0x18499f=_['merge']({},_0x18499f,_0x536cdb['options']);return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x117841){if(_0x117841){_0x4b5953=_0x117841[_0xaa41('0x37')];if(!_0x536cdb[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x18499f[_0xaa41('0x12')]=qs['limit'](_0x536cdb['query'][_0xaa41('0x12')]);_0x18499f[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x536cdb[_0xaa41('0x32')]['offset']);}return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x1be3c1){if(_0x1be3c1){return _0x1be3c1?{'count':_0x4b5953,'rows':_0x1be3c1}:null;}})[_0xaa41('0x17')](respondWithResult(_0x431b75,null))[_0xaa41('0x2f')](handleError(_0x431b75,null));};exports[_0xaa41('0xad')]=function(_0x42ae0c,_0x4fa4ca){var _0x1e41b5;return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x42ae0c[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4fa4ca,null))[_0xaa41('0x17')](function(_0x135f31){if(_0x135f31){return _0x135f31[_0xaa41('0xad')](_0x42ae0c[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x42ae0c['body'],[_0xaa41('0x70'),'id'])||{});}return null;})['spread'](function(_0x5eac30){var _0x3e28b7;_0x1e41b5=_0x5eac30||[];var _0x1ac854=[];if(_0x5eac30){for(var _0x187bf9=0x0;_0x187bf9<_0x5eac30['length'];_0x187bf9+=0x1){var _0x50fa22=_0x5eac30[_0x187bf9][_0xaa41('0x18')]({'plain':!![]});_0x3e28b7=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0xae'))['fromQuery']([_0xaa41('0x93'),'ContactId',_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),'updatedAt'],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x50fa22['CmListId'][_0xaa41('0x7a')](),'ListId')['field'](_0x42ae0c['params']['id'][_0xaa41('0x7a')](),'VoiceQueueId')[_0xaa41('0x71')]('NOW()','createdAt')[_0xaa41('0x71')](_0xaa41('0xaf'),_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))[_0xaa41('0x2a')](_0xaa41('0x9a'),_0x50fa22['CmListId'][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))['toString']();_0x1ac854[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x3e28b7));}return BPromise['all'](_0x1ac854);}})[_0xaa41('0x17')](function(){return _0x1e41b5;})[_0xaa41('0x17')](respondWithResult(_0x4fa4ca,null))['catch'](handleError(_0x4fa4ca,null));};exports[_0xaa41('0xb0')]=function(_0x2edb93,_0x4e34c2){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4e34c2,null))[_0xaa41('0x17')](function(_0x17b359){if(_0x17b359){return _0x17b359['removeBlackLists'](_0x2edb93['query']['ids']);}})['then'](function(_0x5b820b){if(_0x5b820b){return db[_0xaa41('0x58')][_0xaa41('0x23')]({'where':{'ListId':_0x2edb93[_0xaa41('0x32')][_0xaa41('0x70')],'VoiceQueueId':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x5b820b;});}})[_0xaa41('0x17')](respondWithStatusCode(_0x4e34c2,null))[_0xaa41('0x2f')](handleError(_0x4e34c2,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0953750..6fd8f13 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 _0x7f93=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x626207,_0x278147){var _0x5e26d3=function(_0x56c40e){while(--_0x56c40e){_0x626207['push'](_0x626207['shift']());}};_0x5e26d3(++_0x278147);}(_0x7f93,0x114));var _0x37f9=function(_0x471049,_0x532341){_0x471049=_0x471049-0x0;var _0x234ae6=_0x7f93[_0x471049];return _0x234ae6;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x37f9('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x37f9('0x1')](0x0);var events={'afterCreate':_0x37f9('0x2'),'afterUpdate':_0x37f9('0x3'),'afterDestroy':_0x37f9('0x4')};function emitEvent(_0x3614ad){return function(_0x5b637c,_0x86d1a8,_0x213bdb){VoiceQueueEvents[_0x37f9('0x5')](_0x3614ad+':'+_0x5b637c['id'],_0x5b637c);VoiceQueueEvents['emit'](_0x3614ad,_0x5b637c);_0x213bdb(null);};}for(var e in events){if(events[_0x37f9('0x6')](e)){var event=events[e];VoiceQueue[_0x37f9('0x7')](e,emitEvent(event));}}module[_0x37f9('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x8600=['hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','remove','emit'];(function(_0x2f2e0e,_0x21a555){var _0xe1467c=function(_0x59e5b1){while(--_0x59e5b1){_0x2f2e0e['push'](_0x2f2e0e['shift']());}};_0xe1467c(++_0x21a555);}(_0x8600,0x96));var _0x0860=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x8600[_0x17928f];return _0x500b63;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x0860('0x0'))['db'][_0x0860('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0860('0x2')};function emitEvent(_0x2c3a69){return function(_0x3a99d0,_0x4c9146,_0x5b727b){VoiceQueueEvents[_0x0860('0x3')](_0x2c3a69+':'+_0x3a99d0['id'],_0x3a99d0);VoiceQueueEvents[_0x0860('0x3')](_0x2c3a69,_0x3a99d0);_0x5b727b(null);};}for(var e in events){if(events[_0x0860('0x4')](e)){var event=events[e];VoiceQueue[_0x0860('0x5')](e,emitEvent(event));}}module[_0x0860('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 3ba406b..88ba3a8 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x19454e,_0x34df45){var _0x9675b0=function(_0x1abc49){while(--_0x1abc49){_0x19454e['push'](_0x19454e['shift']());}};_0x9675b0(++_0x34df45);}(_0x34e8,0x12c));var _0x834e=function(_0x330a44,_0x337308){_0x330a44=_0x330a44-0x0;var _0xbf84ce=_0x34e8[_0x330a44];return _0xbf84ce;};'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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x157c81,_0x2c0224){var _0x1bfb12=function(_0x4b5c5b){while(--_0x4b5c5b){_0x157c81['push'](_0x157c81['shift']());}};_0x1bfb12(++_0x2c0224);}(_0x3e74,0x175));var _0x43e7=function(_0x9509c0,_0x1a9188){_0x9509c0=_0x9509c0-0x0;var _0x5b3660=_0x3e74[_0x9509c0];return _0x5b3660;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 154afa8..79b9f93 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 _0x2aa9=['include','map','model','attributes','ShowVoiceQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','limit'];(function(_0x2e6006,_0x314c29){var _0x701665=function(_0x219014){while(--_0x219014){_0x2e6006['push'](_0x2e6006['shift']());}};_0x701665(++_0x314c29);}(_0x2aa9,0x118));var _0x92aa=function(_0x5bc154,_0x34ff78){_0x5bc154=_0x5bc154-0x0;var _0x538e20=_0x2aa9[_0x5bc154];return _0x538e20;};'use strict';var _=require(_0x92aa('0x0'));var util=require(_0x92aa('0x1'));var moment=require(_0x92aa('0x2'));var BPromise=require(_0x92aa('0x3'));var rs=require(_0x92aa('0x4'));var fs=require('fs');var Redis=require(_0x92aa('0x5'));var db=require(_0x92aa('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x92aa('0x7'));var jayson=require(_0x92aa('0x8'));var client=jayson[_0x92aa('0x9')]['http']({'port':0x232a});config[_0x92aa('0xa')]=_['defaults'](config[_0x92aa('0xa')],{'host':_0x92aa('0xb'),'port':0x18eb});var socket=require(_0x92aa('0xc'))(new Redis(config[_0x92aa('0xa')]));require(_0x92aa('0xd'))[_0x92aa('0xe')](socket);function respondWithRpcPromise(_0x4b066b,_0x3bc63f,_0x19048b){return new BPromise(function(_0x20f185,_0xe3e503){return client[_0x92aa('0xf')](_0x4b066b,_0x19048b)[_0x92aa('0x10')](function(_0x2ef941){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x3bc63f,_0x92aa('0x11'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3bc63f,'request\x20sent',JSON[_0x92aa('0x12')](_0x2ef941));if(_0x2ef941[_0x92aa('0x13')]){if(_0x2ef941[_0x92aa('0x13')][_0x92aa('0x14')]===0x1f4){logger[_0x92aa('0x13')](_0x92aa('0x15'),_0x3bc63f,_0x2ef941[_0x92aa('0x13')][_0x92aa('0x16')]);return _0xe3e503(_0x2ef941[_0x92aa('0x13')][_0x92aa('0x16')]);}logger[_0x92aa('0x13')](_0x92aa('0x15'),_0x3bc63f,_0x2ef941[_0x92aa('0x13')]['message']);return _0x20f185(_0x2ef941['error'][_0x92aa('0x16')]);}else{logger[_0x92aa('0x17')](_0x92aa('0x15'),_0x3bc63f,_0x92aa('0x11'));_0x20f185(_0x2ef941[_0x92aa('0x18')][_0x92aa('0x16')]);}})[_0x92aa('0x19')](function(_0x1b8f45){logger[_0x92aa('0x13')](_0x92aa('0x15'),_0x3bc63f,_0x1b8f45);_0xe3e503(_0x1b8f45);});});}exports[_0x92aa('0x1a')]=function(_0x2ce705){var _0x160a49=this;return new Promise(function(_0x16153b,_0x25b5c9){return db[_0x92aa('0x1b')]['findAll']({'raw':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705['options'][_0x92aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ce705['options']?_0x2ce705[_0x92aa('0x1c')][_0x92aa('0x1e')]||null:null,'attributes':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705[_0x92aa('0x1c')]['attributes']||null:null,'limit':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705[_0x92aa('0x1c')][_0x92aa('0x1f')]||null:null,'include':_0x2ce705[_0x92aa('0x1c')]?_0x2ce705[_0x92aa('0x1c')][_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x2ce705['options']['include'],function(_0x1be0ad){return{'model':db[_0x1be0ad[_0x92aa('0x22')]],'as':_0x1be0ad['as'],'attributes':_0x1be0ad['attributes'],'include':_0x1be0ad[_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x1be0ad[_0x92aa('0x20')],function(_0x237bcf){return{'model':db[_0x237bcf[_0x92aa('0x22')]],'as':_0x237bcf['as'],'attributes':_0x237bcf['attributes'],'include':_0x237bcf[_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x237bcf[_0x92aa('0x20')],function(_0x1eebaa){return{'model':db[_0x1eebaa[_0x92aa('0x22')]],'as':_0x1eebaa['as'],'attributes':_0x1eebaa[_0x92aa('0x23')]};}):[]};}):[]};}):[]:[]})[_0x92aa('0x10')](function(_0x5bf10e){logger['info'](_0x92aa('0x1a'),_0x2ce705);logger['debug'](_0x92aa('0x1a'),_0x2ce705,JSON[_0x92aa('0x12')](_0x5bf10e));_0x16153b(_0x5bf10e);})[_0x92aa('0x19')](function(_0x1d0744){logger[_0x92aa('0x13')](_0x92aa('0x1a'),_0x1d0744['message'],_0x2ce705);_0x25b5c9(_0x160a49['error'](0x1f4,_0x1d0744['message']));});});};exports[_0x92aa('0x24')]=function(_0x1eb7b9){var _0x4aef8d=this;return new Promise(function(_0x21cb43,_0xa7b7eb){return db[_0x92aa('0x1b')][_0x92aa('0x25')]({'raw':_0x1eb7b9[_0x92aa('0x1c')]?_0x1eb7b9[_0x92aa('0x1c')][_0x92aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x1eb7b9[_0x92aa('0x1c')]?_0x1eb7b9[_0x92aa('0x1c')][_0x92aa('0x1e')]||null:null,'attributes':_0x1eb7b9['options']?_0x1eb7b9[_0x92aa('0x1c')][_0x92aa('0x23')]||null:null,'include':_0x1eb7b9['options']?_0x1eb7b9[_0x92aa('0x1c')]['include']?_[_0x92aa('0x21')](_0x1eb7b9['options']['include'],function(_0x56e0ef){return{'model':db[_0x56e0ef['model']],'as':_0x56e0ef['as'],'attributes':_0x56e0ef[_0x92aa('0x23')],'include':_0x56e0ef[_0x92aa('0x20')]?_[_0x92aa('0x21')](_0x56e0ef[_0x92aa('0x20')],function(_0x31e9c1){return{'model':db[_0x31e9c1[_0x92aa('0x22')]],'as':_0x31e9c1['as'],'attributes':_0x31e9c1[_0x92aa('0x23')],'include':_0x31e9c1[_0x92aa('0x20')]?_['map'](_0x31e9c1[_0x92aa('0x20')],function(_0x1f5e37){return{'model':db[_0x1f5e37[_0x92aa('0x22')]],'as':_0x1f5e37['as'],'attributes':_0x1f5e37[_0x92aa('0x23')]};}):[]};}):[]};}):[]:[]})[_0x92aa('0x10')](function(_0x5e36e4){logger[_0x92aa('0x17')](_0x92aa('0x24'),_0x1eb7b9);logger[_0x92aa('0x26')]('ShowVoiceQueue',_0x1eb7b9,JSON['stringify'](_0x5e36e4));_0x21cb43(_0x5e36e4);})['catch'](function(_0x3673f0){logger[_0x92aa('0x13')](_0x92aa('0x24'),_0x3673f0['message'],_0x1eb7b9);_0xa7b7eb(_0x4aef8d['error'](0x1f4,_0x3673f0['message']));});});}; \ No newline at end of file +var _0x4122=['raw','where','attributes','limit','include','map','model','catch','ShowVoiceQueue','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueue','VoiceQueue','findAll','options'];(function(_0x242769,_0x1e0718){var _0x5aca75=function(_0x44bb28){while(--_0x44bb28){_0x242769['push'](_0x242769['shift']());}};_0x5aca75(++_0x1e0718);}(_0x4122,0x1b7));var _0x2412=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4122[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x2412('0x0'));var util=require('util');var moment=require(_0x2412('0x1'));var BPromise=require('bluebird');var rs=require(_0x2412('0x2'));var fs=require('fs');var Redis=require(_0x2412('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2412('0x4'));var logger=require(_0x2412('0x5'))('rpc');var config=require(_0x2412('0x6'));var jayson=require(_0x2412('0x7'));var client=jayson['client'][_0x2412('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2412('0x9')],{'host':_0x2412('0xa'),'port':0x18eb});var socket=require(_0x2412('0xb'))(new Redis(config[_0x2412('0x9')]));require(_0x2412('0xc'))[_0x2412('0xd')](socket);function respondWithRpcPromise(_0x5745d1,_0xe7ac2,_0x32f8cf){return new BPromise(function(_0x4da13b,_0xfe9b72){return client['request'](_0x5745d1,_0x32f8cf)[_0x2412('0xe')](function(_0x36d2cd){logger['info'](_0x2412('0xf'),_0xe7ac2,_0x2412('0x10'));logger[_0x2412('0x11')](_0x2412('0x12'),_0xe7ac2,_0x2412('0x10'),JSON[_0x2412('0x13')](_0x36d2cd));if(_0x36d2cd['error']){if(_0x36d2cd[_0x2412('0x14')][_0x2412('0x15')]===0x1f4){logger[_0x2412('0x14')](_0x2412('0xf'),_0xe7ac2,_0x36d2cd[_0x2412('0x14')][_0x2412('0x16')]);return _0xfe9b72(_0x36d2cd[_0x2412('0x14')][_0x2412('0x16')]);}logger[_0x2412('0x14')]('VoiceQueue,\x20%s,\x20%s',_0xe7ac2,_0x36d2cd[_0x2412('0x14')]['message']);return _0x4da13b(_0x36d2cd[_0x2412('0x14')]['message']);}else{logger[_0x2412('0x17')](_0x2412('0xf'),_0xe7ac2,_0x2412('0x10'));_0x4da13b(_0x36d2cd[_0x2412('0x18')][_0x2412('0x16')]);}})['catch'](function(_0x13c4e6){logger['error'](_0x2412('0xf'),_0xe7ac2,_0x13c4e6);_0xfe9b72(_0x13c4e6);});});}exports[_0x2412('0x19')]=function(_0x4448ed){var _0x370d61=this;return new Promise(function(_0xf75029,_0x361a38){return db[_0x2412('0x1a')][_0x2412('0x1b')]({'raw':_0x4448ed[_0x2412('0x1c')]?_0x4448ed[_0x2412('0x1c')][_0x2412('0x1d')]===undefined?!![]:![]:!![],'where':_0x4448ed['options']?_0x4448ed['options'][_0x2412('0x1e')]||null:null,'attributes':_0x4448ed[_0x2412('0x1c')]?_0x4448ed[_0x2412('0x1c')][_0x2412('0x1f')]||null:null,'limit':_0x4448ed['options']?_0x4448ed[_0x2412('0x1c')][_0x2412('0x20')]||null:null,'include':_0x4448ed[_0x2412('0x1c')]?_0x4448ed['options'][_0x2412('0x21')]?_[_0x2412('0x22')](_0x4448ed[_0x2412('0x1c')][_0x2412('0x21')],function(_0x2e30a2){return{'model':db[_0x2e30a2[_0x2412('0x23')]],'as':_0x2e30a2['as'],'attributes':_0x2e30a2[_0x2412('0x1f')],'include':_0x2e30a2[_0x2412('0x21')]?_[_0x2412('0x22')](_0x2e30a2[_0x2412('0x21')],function(_0x306d9e){return{'model':db[_0x306d9e[_0x2412('0x23')]],'as':_0x306d9e['as'],'attributes':_0x306d9e[_0x2412('0x1f')],'include':_0x306d9e['include']?_[_0x2412('0x22')](_0x306d9e[_0x2412('0x21')],function(_0x3149f9){return{'model':db[_0x3149f9[_0x2412('0x23')]],'as':_0x3149f9['as'],'attributes':_0x3149f9[_0x2412('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2412('0xe')](function(_0x2b08b2){logger[_0x2412('0x17')]('GetVoiceQueue',_0x4448ed);logger['debug'](_0x2412('0x19'),_0x4448ed,JSON[_0x2412('0x13')](_0x2b08b2));_0xf75029(_0x2b08b2);})[_0x2412('0x24')](function(_0x1dfed1){logger['error'](_0x2412('0x19'),_0x1dfed1[_0x2412('0x16')],_0x4448ed);_0x361a38(_0x370d61['error'](0x1f4,_0x1dfed1[_0x2412('0x16')]));});});};exports[_0x2412('0x25')]=function(_0x5775f6){var _0x5e12ab=this;return new Promise(function(_0x2e7396,_0x4f548f){return db[_0x2412('0x1a')][_0x2412('0x26')]({'raw':_0x5775f6[_0x2412('0x1c')]?_0x5775f6['options'][_0x2412('0x1d')]===undefined?!![]:![]:!![],'where':_0x5775f6[_0x2412('0x1c')]?_0x5775f6[_0x2412('0x1c')]['where']||null:null,'attributes':_0x5775f6[_0x2412('0x1c')]?_0x5775f6[_0x2412('0x1c')][_0x2412('0x1f')]||null:null,'include':_0x5775f6[_0x2412('0x1c')]?_0x5775f6[_0x2412('0x1c')][_0x2412('0x21')]?_[_0x2412('0x22')](_0x5775f6[_0x2412('0x1c')][_0x2412('0x21')],function(_0x2c9036){return{'model':db[_0x2c9036[_0x2412('0x23')]],'as':_0x2c9036['as'],'attributes':_0x2c9036[_0x2412('0x1f')],'include':_0x2c9036[_0x2412('0x21')]?_[_0x2412('0x22')](_0x2c9036[_0x2412('0x21')],function(_0x5c6670){return{'model':db[_0x5c6670[_0x2412('0x23')]],'as':_0x5c6670['as'],'attributes':_0x5c6670['attributes'],'include':_0x5c6670[_0x2412('0x21')]?_[_0x2412('0x22')](_0x5c6670[_0x2412('0x21')],function(_0x36d317){return{'model':db[_0x36d317['model']],'as':_0x36d317['as'],'attributes':_0x36d317['attributes']};}):[]};}):[]};}):[]:[]})[_0x2412('0xe')](function(_0x3c5c02){logger['info'](_0x2412('0x25'),_0x5775f6);logger[_0x2412('0x11')]('ShowVoiceQueue',_0x5775f6,JSON['stringify'](_0x3c5c02));_0x2e7396(_0x3c5c02);})[_0x2412('0x24')](function(_0x525ba7){logger['error']('ShowVoiceQueue',_0x525ba7[_0x2412('0x16')],_0x5775f6);_0x4f548f(_0x5e12ab['error'](0x1f4,_0x525ba7[_0x2412('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1d0e183..7d60227 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 _0x4a75=['emit','removeListener','register','voiceQueue:','save','remove'];(function(_0x37df26,_0x5157ed){var _0x3d5961=function(_0x310150){while(--_0x310150){_0x37df26['push'](_0x37df26['shift']());}};_0x3d5961(++_0x5157ed);}(_0x4a75,0x112));var _0x54a7=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x4a75[_0x324012];return _0x435cf2;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x54a7('0x0'),_0x54a7('0x1'),'update'];function createListener(_0x399fce,_0xd37ae4){return function(_0x4632a7){_0xd37ae4[_0x54a7('0x2')](_0x399fce,_0x4632a7);};}function removeListener(_0x1b99bb,_0x260c2b){return function(){VoiceQueueEvents[_0x54a7('0x3')](_0x1b99bb,_0x260c2b);};}exports[_0x54a7('0x4')]=function(_0x3f7562){for(var _0x3bf5eb=0x0,_0x45313f=events['length'];_0x3bf5eb<_0x45313f;_0x3bf5eb++){var _0x1116a3=events[_0x3bf5eb];var _0x5861f9=createListener(_0x54a7('0x5')+_0x1116a3,_0x3f7562);VoiceQueueEvents['on'](_0x1116a3,_0x5861f9);}}; \ No newline at end of file +var _0x0f17=['emit','register','length','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x28fef1,_0x3b0dd2){var _0x533507=function(_0x206ae7){while(--_0x206ae7){_0x28fef1['push'](_0x28fef1['shift']());}};_0x533507(++_0x3b0dd2);}(_0x0f17,0xf2));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0x70f1('0x0'));var events=['save',_0x70f1('0x1'),_0x70f1('0x2')];function createListener(_0xef8f29,_0x7518a8){return function(_0x34d4bf){_0x7518a8[_0x70f1('0x3')](_0xef8f29,_0x34d4bf);};}function removeListener(_0x147116,_0x104c1d){return function(){VoiceQueueEvents['removeListener'](_0x147116,_0x104c1d);};}exports[_0x70f1('0x4')]=function(_0x2f4592){for(var _0x21fd9f=0x0,_0x151ffc=events[_0x70f1('0x5')];_0x21fd9f<_0x151ffc;_0x21fd9f++){var _0xaf869d=events[_0x21fd9f];var _0x226e8a=createListener(_0x70f1('0x6')+_0xaf869d,_0x2f4592);VoiceQueueEvents['on'](_0xaf869d,_0x226e8a);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 753a127..3a3f57d 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 _0x08ca=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get','/describe','isAuthenticated','describe','show','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x3b1746,_0x11b868){var _0x163fb7=function(_0x3bab2c){while(--_0x3bab2c){_0x3b1746['push'](_0x3b1746['shift']());}};_0x163fb7(++_0x11b868);}(_0x08ca,0x168));var _0xa08c=function(_0xf02b3f,_0x4aaf47){_0xf02b3f=_0xf02b3f-0x0;var _0x51d908=_0x08ca[_0xf02b3f];return _0x51d908;};'use strict';var multer=require(_0xa08c('0x0'));var util=require(_0xa08c('0x1'));var path=require(_0xa08c('0x2'));var timeout=require(_0xa08c('0x3'));var express=require(_0xa08c('0x4'));var router=express['Router']();var fs_extra=require(_0xa08c('0x5'));var auth=require(_0xa08c('0x6'));var interaction=require(_0xa08c('0x7'));var config=require(_0xa08c('0x8'));var controller=require(_0xa08c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa08c('0xa')]);router[_0xa08c('0xb')](_0xa08c('0xc'),auth[_0xa08c('0xd')](),controller[_0xa08c('0xe')]);router[_0xa08c('0xb')]('/index',auth[_0xa08c('0xd')](),controller['getVoiceQueuesReport']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa08c('0xf')]);router[_0xa08c('0x10')]('/',auth['isAuthenticated'](),controller[_0xa08c('0x11')]);router[_0xa08c('0x12')]('/:id',auth[_0xa08c('0xd')](),controller[_0xa08c('0x13')]);router[_0xa08c('0x14')](_0xa08c('0x15'),auth[_0xa08c('0xd')](),controller[_0xa08c('0x16')]);module[_0xa08c('0x17')]=router; \ No newline at end of file +var _0xa473=['put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','getVoiceQueuesReport','show','post'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0xa473,0xf5));var _0x3a47=function(_0x482b91,_0x430804){_0x482b91=_0x482b91-0x0;var _0x2591da=_0xa473[_0x482b91];return _0x2591da;};'use strict';var multer=require(_0x3a47('0x0'));var util=require('util');var path=require(_0x3a47('0x1'));var timeout=require(_0x3a47('0x2'));var express=require('express');var router=express[_0x3a47('0x3')]();var fs_extra=require(_0x3a47('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3a47('0x5'));var config=require(_0x3a47('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x3a47('0x7')]('/',auth['isAuthenticated'](),controller[_0x3a47('0x8')]);router['get'](_0x3a47('0x9'),auth[_0x3a47('0xa')](),controller[_0x3a47('0xb')]);router['get']('/index',auth[_0x3a47('0xa')](),controller[_0x3a47('0xc')]);router[_0x3a47('0x7')]('/:id',auth[_0x3a47('0xa')](),controller[_0x3a47('0xd')]);router[_0x3a47('0xe')]('/',auth[_0x3a47('0xa')](),controller['create']);router[_0x3a47('0xf')](_0x3a47('0x10'),auth[_0x3a47('0xa')](),controller[_0x3a47('0x11')]);router['delete']('/:id',auth[_0x3a47('0xa')](),controller[_0x3a47('0x12')]);module[_0x3a47('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 42e5d5e..cdd84ac 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 _0x543e=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x50f15a,_0x4b2465){var _0x150cd6=function(_0x193e5d){while(--_0x193e5d){_0x50f15a['push'](_0x50f15a['shift']());}};_0x150cd6(++_0x4b2465);}(_0x543e,0x1b1));var _0xe543=function(_0x5340fb,_0x53d5a2){_0x5340fb=_0x5340fb-0x0;var _0x35701e=_0x543e[_0x5340fb];return _0x35701e;};'use strict';var Sequelize=require(_0xe543('0x0'));var moment=require(_0xe543('0x1'));module[_0xe543('0x2')]={'type':{'type':Sequelize[_0xe543('0x3')]},'uniqueid':{'type':Sequelize[_0xe543('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe543('0x3')]},'queue':{'type':Sequelize[_0xe543('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x589229){var _0x537a53=moment(_0x589229);var _0x1c34c3=moment(this['getDataValue'](_0xe543('0x4')))[_0xe543('0x5')](_0xe543('0x6'));var _0xffcaf5=_0x537a53[_0xe543('0x7')](_0x1c34c3,_0xe543('0x8'));this[_0xe543('0x9')](_0xe543('0xa'),_0x589229);this['setDataValue'](_0xe543('0xb'),_0xffcaf5||null);}},'position':{'type':Sequelize[_0xe543('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xe543('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe543('0xe')]},'queuecallercomplete':{'type':Sequelize[_0xe543('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe543('0xe')]},'queuecallerexit':{'type':Sequelize[_0xe543('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe543('0xe')]},'queuecallerexitreason':{'type':Sequelize[_0xe543('0x3')],'comment':_0xe543('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe543('0x3')]},'accountcode':{'type':Sequelize[_0xe543('0x3')]},'context':{'type':Sequelize[_0xe543('0x3')]},'exten':{'type':Sequelize[_0xe543('0x3')]},'priority':{'type':Sequelize[_0xe543('0x3')]},'holdtime':{'type':Sequelize[_0xe543('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe543('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe543('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xe543('0x10')},'transferexten':{'type':Sequelize[_0xe543('0x3')]},'transferuniqueid':{'type':Sequelize[_0xe543('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xe543('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xe543('0x3')]}}; \ No newline at end of file +var _0x7ba1=['getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE'];(function(_0x1dfe43,_0x157872){var _0x5bad11=function(_0x58fdb4){while(--_0x58fdb4){_0x1dfe43['push'](_0x1dfe43['shift']());}};_0x5bad11(++_0x157872);}(_0x7ba1,0x65));var _0x17ba=function(_0x1c9fb8,_0x5d54f3){_0x1c9fb8=_0x1c9fb8-0x0;var _0x411597=_0x7ba1[_0x1c9fb8];return _0x411597;};'use strict';var Sequelize=require(_0x17ba('0x0'));var moment=require(_0x17ba('0x1'));module['exports']={'type':{'type':Sequelize[_0x17ba('0x2')]},'uniqueid':{'type':Sequelize[_0x17ba('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x17ba('0x2')]},'queue':{'type':Sequelize[_0x17ba('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x17ba('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x17ba('0x3')],'set':function(_0x3968ac){var _0x44b0d6=moment(_0x3968ac);var _0x3c6129=moment(this[_0x17ba('0x4')](_0x17ba('0x5')))[_0x17ba('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x10330b=_0x44b0d6[_0x17ba('0x7')](_0x3c6129,_0x17ba('0x8'));this[_0x17ba('0x9')](_0x17ba('0xa'),_0x3968ac);this[_0x17ba('0x9')](_0x17ba('0xb'),_0x10330b||null);}},'position':{'type':Sequelize[_0x17ba('0xc')]},'count':{'type':Sequelize[_0x17ba('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x17ba('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x17ba('0x3')]},'queuecallerexit':{'type':Sequelize[_0x17ba('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x17ba('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x17ba('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x17ba('0x2')]},'connectedlinenum':{'type':Sequelize[_0x17ba('0x2')]},'connectedlinename':{'type':Sequelize[_0x17ba('0x2')]},'accountcode':{'type':Sequelize[_0x17ba('0x2')]},'context':{'type':Sequelize[_0x17ba('0x2')]},'exten':{'type':Sequelize[_0x17ba('0x2')]},'priority':{'type':Sequelize[_0x17ba('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x17ba('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x17ba('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x17ba('0x2')]},'transfer':{'type':Sequelize[_0x17ba('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x17ba('0x2')],'comment':_0x17ba('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x17ba('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x17ba('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x17ba('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x17ba('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 27911e7..ea34836 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 _0xc00c=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','name','send','index','VoiceQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','options','find','create','body','catch','update','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch'];(function(_0x4fb76a,_0x280733){var _0x58eead=function(_0x153858){while(--_0x153858){_0x4fb76a['push'](_0x4fb76a['shift']());}};_0x58eead(++_0x280733);}(_0xc00c,0x18d));var _0xcc00=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xc00c[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0xcc00('0x0'));var rimraf=require(_0xcc00('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc00('0x2'));var rp=require('request-promise');var moment=require(_0xcc00('0x3'));var BPromise=require(_0xcc00('0x4'));var Mustache=require(_0xcc00('0x5'));var util=require('util');var path=require(_0xcc00('0x6'));var sox=require(_0xcc00('0x7'));var csv=require('to-csv');var ejs=require(_0xcc00('0x8'));var fs=require('fs');var fs_extra=require(_0xcc00('0x9'));var _=require(_0xcc00('0xa'));var squel=require(_0xcc00('0xb'));var crypto=require(_0xcc00('0xc'));var jsforce=require(_0xcc00('0xd'));var deskjs=require(_0xcc00('0xe'));var toCsv=require(_0xcc00('0xf'));var querystring=require(_0xcc00('0x10'));var Papa=require('papaparse');var Redis=require(_0xcc00('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcc00('0x12'));var as=require(_0xcc00('0x13'));var hardwareService=require(_0xcc00('0x14'));var logger=require(_0xcc00('0x15'))(_0xcc00('0x16'));var utils=require(_0xcc00('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc00('0x18'))['db'];config[_0xcc00('0x19')]=_['defaults'](config[_0xcc00('0x19')],{'host':_0xcc00('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc00('0x1b'))[_0xcc00('0x1c')](socket);function respondWithStatusCode(_0x5a52bd,_0x333c8c){_0x333c8c=_0x333c8c||0xcc;return function(_0x403363){if(_0x403363){return _0x5a52bd[_0xcc00('0x1d')](_0x333c8c);}return _0x5a52bd[_0xcc00('0x1e')](_0x333c8c)[_0xcc00('0x1f')]();};}function respondWithResult(_0x6b6bcd,_0x5cd843){_0x5cd843=_0x5cd843||0xc8;return function(_0x41d87e){if(_0x41d87e){return _0x6b6bcd['status'](_0x5cd843)[_0xcc00('0x20')](_0x41d87e);}};}function respondWithFilteredResult(_0x4302fc,_0x3ff0b0){return function(_0xd2d9be){if(_0xd2d9be){var _0x4bd6fb=typeof _0x3ff0b0[_0xcc00('0x21')]==='undefined'&&typeof _0x3ff0b0[_0xcc00('0x22')]===_0xcc00('0x23');var _0x1ad74c=_0xd2d9be['count'];var _0x32f4bc=_0x4bd6fb?0x0:_0x3ff0b0['offset'];var _0x508cea=_0x4bd6fb?_0xd2d9be[_0xcc00('0x24')]:_0x3ff0b0[_0xcc00('0x21')]+_0x3ff0b0[_0xcc00('0x22')];var _0x650015;if(_0x508cea>=_0x1ad74c){_0x508cea=_0x1ad74c;_0x650015=0xc8;}else{_0x650015=0xce;}_0x4302fc[_0xcc00('0x1e')](_0x650015);return _0x4302fc[_0xcc00('0x25')]('Content-Range',_0x32f4bc+'-'+_0x508cea+'/'+_0x1ad74c)[_0xcc00('0x20')](_0xd2d9be);}return null;};}function patchUpdates(_0x4ffa06){return function(_0x29d397){try{jsonpatch[_0xcc00('0x26')](_0x29d397,_0x4ffa06,!![]);}catch(_0xf495a2){return BPromise[_0xcc00('0x27')](_0xf495a2);}return _0x29d397[_0xcc00('0x28')]();};}function saveUpdates(_0x4fd9da,_0x3f5269){return function(_0x1f4b35){if(_0x1f4b35){return _0x1f4b35['update'](_0x4fd9da)[_0xcc00('0x29')](function(_0x3f3627){return _0x3f3627;});}return null;};}function removeEntity(_0x503515,_0x4b7fed){return function(_0xc200ff){if(_0xc200ff){return _0xc200ff[_0xcc00('0x2a')]()[_0xcc00('0x29')](function(){_0x503515[_0xcc00('0x1e')](0xcc)[_0xcc00('0x1f')]();});}};}function handleEntityNotFound(_0x2c51ac,_0x4b7690){return function(_0x59af94){if(!_0x59af94){_0x2c51ac['sendStatus'](0x194);}return _0x59af94;};}function handleError(_0xd3bbf5,_0x120f4d){_0x120f4d=_0x120f4d||0x1f4;return function(_0x14eef0){logger[_0xcc00('0x2b')](_0x14eef0['stack']);if(_0x14eef0[_0xcc00('0x2c')]){delete _0x14eef0[_0xcc00('0x2c')];}_0xd3bbf5[_0xcc00('0x1e')](_0x120f4d)[_0xcc00('0x2d')](_0x14eef0);};}exports[_0xcc00('0x2e')]=function(_0x47a4ee,_0x352d47){var _0x368cde={},_0x8178ba={},_0x2805bb={'count':0x0,'rows':[]};var _0x3aef2c=_['map'](db[_0xcc00('0x2f')][_0xcc00('0x30')],function(_0x204017){return{'name':_0x204017[_0xcc00('0x31')],'type':_0x204017['type'][_0xcc00('0x32')]};});_0x8178ba[_0xcc00('0x33')]=_[_0xcc00('0x34')](_0x3aef2c,'name');_0x8178ba[_0xcc00('0x35')]=_[_0xcc00('0x36')](_0x47a4ee[_0xcc00('0x35')]);_0x8178ba[_0xcc00('0x37')]=_[_0xcc00('0x38')](_0x8178ba['model'],_0x8178ba[_0xcc00('0x35')]);_0x368cde[_0xcc00('0x39')]=_['intersection'](_0x8178ba[_0xcc00('0x33')],qs[_0xcc00('0x3a')](_0x47a4ee[_0xcc00('0x35')][_0xcc00('0x3a')]));_0x368cde[_0xcc00('0x39')]=_0x368cde[_0xcc00('0x39')][_0xcc00('0x3b')]?_0x368cde[_0xcc00('0x39')]:_0x8178ba[_0xcc00('0x33')];if(!_0x47a4ee[_0xcc00('0x35')]['hasOwnProperty']('nolimit')){_0x368cde[_0xcc00('0x22')]=qs[_0xcc00('0x22')](_0x47a4ee[_0xcc00('0x35')][_0xcc00('0x22')]);_0x368cde[_0xcc00('0x21')]=qs[_0xcc00('0x21')](_0x47a4ee[_0xcc00('0x35')][_0xcc00('0x21')]);}_0x368cde[_0xcc00('0x3c')]=qs[_0xcc00('0x3d')](_0x47a4ee[_0xcc00('0x35')]['sort']);_0x368cde[_0xcc00('0x3e')]=qs[_0xcc00('0x37')](_['pick'](_0x47a4ee['query'],_0x8178ba['filters']),_0x3aef2c);if(_0x47a4ee[_0xcc00('0x35')][_0xcc00('0x3f')]){_0x368cde[_0xcc00('0x3e')]=_[_0xcc00('0x40')](_0x368cde[_0xcc00('0x3e')],{'$or':_[_0xcc00('0x34')](_0x3aef2c,function(_0x531875){if(_0x531875[_0xcc00('0x41')]!==_0xcc00('0x42')){var _0x35ddeb={};_0x35ddeb[_0x531875[_0xcc00('0x2c')]]={'$like':'%'+_0x47a4ee['query'][_0xcc00('0x3f')]+'%'};return _0x35ddeb;}})});}_0x368cde=_['merge']({},_0x368cde,_0x47a4ee['options']);var _0x44ec6f={'where':_0x368cde[_0xcc00('0x3e')]};return db['VoiceQueueReport']['count'](_0x44ec6f)['then'](function(_0x32c805){_0x2805bb[_0xcc00('0x24')]=_0x32c805;if(_0x47a4ee[_0xcc00('0x35')][_0xcc00('0x43')]){_0x368cde[_0xcc00('0x44')]=[{'all':!![]}];}return db[_0xcc00('0x2f')]['findAll'](_0x368cde);})[_0xcc00('0x29')](function(_0x50df4c){_0x2805bb[_0xcc00('0x45')]=_0x50df4c;return _0x2805bb;})[_0xcc00('0x29')](respondWithFilteredResult(_0x352d47,_0x368cde))['catch'](handleError(_0x352d47,null));};exports[_0xcc00('0x46')]=function(_0x45b8ec,_0x2d82fe){var _0x250f70={'raw':![],'where':{'id':_0x45b8ec[_0xcc00('0x47')]['id']}},_0x1f51d3={};_0x1f51d3[_0xcc00('0x33')]=_[_0xcc00('0x36')](db[_0xcc00('0x2f')][_0xcc00('0x30')]);_0x1f51d3[_0xcc00('0x35')]=_[_0xcc00('0x36')](_0x45b8ec[_0xcc00('0x35')]);_0x1f51d3[_0xcc00('0x37')]=_[_0xcc00('0x38')](_0x1f51d3['model'],_0x1f51d3[_0xcc00('0x35')]);_0x250f70['attributes']=_[_0xcc00('0x38')](_0x1f51d3[_0xcc00('0x33')],qs[_0xcc00('0x3a')](_0x45b8ec[_0xcc00('0x35')][_0xcc00('0x3a')]));_0x250f70[_0xcc00('0x39')]=_0x250f70[_0xcc00('0x39')][_0xcc00('0x3b')]?_0x250f70[_0xcc00('0x39')]:_0x1f51d3[_0xcc00('0x33')];if(_0x45b8ec['query'][_0xcc00('0x43')]){_0x250f70[_0xcc00('0x44')]=[{'all':!![]}];}_0x250f70=_['merge']({},_0x250f70,_0x45b8ec[_0xcc00('0x48')]);return db[_0xcc00('0x2f')][_0xcc00('0x49')](_0x250f70)['then'](handleEntityNotFound(_0x2d82fe,null))[_0xcc00('0x29')](respondWithResult(_0x2d82fe,null))['catch'](handleError(_0x2d82fe,null));};exports[_0xcc00('0x4a')]=function(_0x4637c3,_0x348a71){return db['VoiceQueueReport'][_0xcc00('0x4a')](_0x4637c3[_0xcc00('0x4b')],{})[_0xcc00('0x29')](respondWithResult(_0x348a71,0xc9))[_0xcc00('0x4c')](handleError(_0x348a71,null));};exports[_0xcc00('0x4d')]=function(_0x29d399,_0x27731c){if(_0x29d399[_0xcc00('0x4b')]['id']){delete _0x29d399['body']['id'];}return db[_0xcc00('0x2f')][_0xcc00('0x49')]({'where':{'id':_0x29d399[_0xcc00('0x47')]['id']}})['then'](handleEntityNotFound(_0x27731c,null))[_0xcc00('0x29')](saveUpdates(_0x29d399[_0xcc00('0x4b')],null))['then'](respondWithResult(_0x27731c,null))[_0xcc00('0x4c')](handleError(_0x27731c,null));};exports[_0xcc00('0x2a')]=function(_0x40a5dd,_0x3888cd){return db[_0xcc00('0x2f')]['find']({'where':{'id':_0x40a5dd[_0xcc00('0x47')]['id']}})[_0xcc00('0x29')](handleEntityNotFound(_0x3888cd,null))[_0xcc00('0x29')](removeEntity(_0x3888cd,null))[_0xcc00('0x4c')](handleError(_0x3888cd,null));};exports['describe']=function(_0x3ba88b,_0x190e9a){return db[_0xcc00('0x2f')][_0xcc00('0x4e')]()[_0xcc00('0x29')](respondWithResult(_0x190e9a,null))[_0xcc00('0x4c')](handleError(_0x190e9a,null));};exports[_0xcc00('0x4f')]=function(_0x4beebc,_0x2a89a9){var _0x18e9d2={},_0x15d899={},_0x146da0={'count':0x0,'rows':[]};_0x15d899[_0xcc00('0x33')]=_[_0xcc00('0x36')](db[_0xcc00('0x2f')][_0xcc00('0x30')]);_0x15d899[_0xcc00('0x35')]=_[_0xcc00('0x36')](_0x4beebc['query']);_0x15d899[_0xcc00('0x37')]=_[_0xcc00('0x38')](_0x15d899[_0xcc00('0x33')],_0x15d899['query']);_0x18e9d2['attributes']=_[_0xcc00('0x38')](_0x15d899[_0xcc00('0x33')],qs['fields'](_0x4beebc[_0xcc00('0x35')][_0xcc00('0x3a')]));_0x18e9d2[_0xcc00('0x39')]=_0x18e9d2[_0xcc00('0x39')][_0xcc00('0x3b')]?_0x18e9d2[_0xcc00('0x39')]:_0x15d899[_0xcc00('0x33')];if(!_0x4beebc['query']['hasOwnProperty']('nolimit')){_0x18e9d2[_0xcc00('0x22')]=qs[_0xcc00('0x22')](_0x4beebc[_0xcc00('0x35')][_0xcc00('0x22')]);_0x18e9d2[_0xcc00('0x21')]=qs['offset'](_0x4beebc[_0xcc00('0x35')]['offset']);}_0x18e9d2['order']=qs[_0xcc00('0x3d')](_0x4beebc['query'][_0xcc00('0x3d')]);_0x18e9d2[_0xcc00('0x3e')]=qs[_0xcc00('0x37')](_['pick'](_0x4beebc[_0xcc00('0x35')],_0x15d899['filters']));if(_0x4beebc[_0xcc00('0x35')]['filter']){_0x18e9d2['where']=_[_0xcc00('0x40')](_0x18e9d2[_0xcc00('0x3e')],{'$or':_['map'](_0x18e9d2[_0xcc00('0x39')],function(_0x2037c0){var _0x28acf3={};_0x28acf3[_0x2037c0]={'$like':'%'+_0x4beebc[_0xcc00('0x35')][_0xcc00('0x3f')]+'%'};return _0x28acf3;})});}_0x18e9d2=_[_0xcc00('0x40')]({},_0x18e9d2,_0x4beebc[_0xcc00('0x48')]);var _0x5ec944={'where':_0x18e9d2[_0xcc00('0x3e')]};return db[_0xcc00('0x2f')]['count'](_0x5ec944)[_0xcc00('0x29')](function(_0x4dc605){_0x146da0[_0xcc00('0x24')]=_0x4dc605;if(_0x4beebc[_0xcc00('0x35')][_0xcc00('0x43')]){_0x18e9d2[_0xcc00('0x44')]=[{'all':!![]}];}return db[_0xcc00('0x2f')]['findAll'](_0x18e9d2);})[_0xcc00('0x29')](function(_0x4a5545){_0x146da0[_0xcc00('0x45')]=_0x4a5545;return _0x146da0;})[_0xcc00('0x29')](respondWithFilteredResult(_0x2a89a9,_0x18e9d2,_0xcc00('0x4f')))[_0xcc00('0x4c')](handleError(_0x2a89a9,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x9efb=['describe','getVoiceQueuesReport','filter','includeAll','rows','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voiceQueueReport.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','index','map','VoiceQueueReport','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','findAll','rawAttributes','length','include','options','find','catch','create','body','update','params'];(function(_0x4f46ea,_0x14911b){var _0x2d5ea3=function(_0xce1e4b){while(--_0xce1e4b){_0x4f46ea['push'](_0x4f46ea['shift']());}};_0x2d5ea3(++_0x14911b);}(_0x9efb,0x1ae));var _0xb9ef=function(_0x39c782,_0x1a1b13){_0x39c782=_0x39c782-0x0;var _0x2febbb=_0x9efb[_0x39c782];return _0x2febbb;};'use strict';var emlformat=require(_0xb9ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9ef('0x1'));var jsonpatch=require(_0xb9ef('0x2'));var rp=require('request-promise');var moment=require(_0xb9ef('0x3'));var BPromise=require(_0xb9ef('0x4'));var Mustache=require(_0xb9ef('0x5'));var util=require(_0xb9ef('0x6'));var path=require(_0xb9ef('0x7'));var sox=require(_0xb9ef('0x8'));var csv=require(_0xb9ef('0x9'));var ejs=require(_0xb9ef('0xa'));var fs=require('fs');var fs_extra=require(_0xb9ef('0xb'));var _=require(_0xb9ef('0xc'));var squel=require(_0xb9ef('0xd'));var crypto=require(_0xb9ef('0xe'));var jsforce=require(_0xb9ef('0xf'));var deskjs=require(_0xb9ef('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb9ef('0x11'));var Papa=require(_0xb9ef('0x12'));var Redis=require(_0xb9ef('0x13'));var authService=require(_0xb9ef('0x14'));var qs=require(_0xb9ef('0x15'));var as=require(_0xb9ef('0x16'));var hardwareService=require(_0xb9ef('0x17'));var logger=require(_0xb9ef('0x18'))('api');var utils=require(_0xb9ef('0x19'));var config=require(_0xb9ef('0x1a'));var licenseUtil=require(_0xb9ef('0x1b'));var db=require('../../mysqldb')['db'];config[_0xb9ef('0x1c')]=_['defaults'](config[_0xb9ef('0x1c')],{'host':_0xb9ef('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9ef('0x1c')]));require(_0xb9ef('0x1e'))[_0xb9ef('0x1f')](socket);function respondWithStatusCode(_0x307d65,_0x1a23af){_0x1a23af=_0x1a23af||0xcc;return function(_0x3ab8da){if(_0x3ab8da){return _0x307d65['sendStatus'](_0x1a23af);}return _0x307d65[_0xb9ef('0x20')](_0x1a23af)[_0xb9ef('0x21')]();};}function respondWithResult(_0x531b9c,_0xbfc196){_0xbfc196=_0xbfc196||0xc8;return function(_0x8af622){if(_0x8af622){return _0x531b9c[_0xb9ef('0x20')](_0xbfc196)[_0xb9ef('0x22')](_0x8af622);}};}function respondWithFilteredResult(_0x2ac762,_0x193265){return function(_0x5eda52){if(_0x5eda52){var _0x4e656e=typeof _0x193265[_0xb9ef('0x23')]===_0xb9ef('0x24')&&typeof _0x193265['limit']===_0xb9ef('0x24');var _0x11ff56=_0x5eda52['count'];var _0x2f8782=_0x4e656e?0x0:_0x193265[_0xb9ef('0x23')];var _0xb57b62=_0x4e656e?_0x5eda52[_0xb9ef('0x25')]:_0x193265[_0xb9ef('0x23')]+_0x193265[_0xb9ef('0x26')];var _0x3ab01a;if(_0xb57b62>=_0x11ff56){_0xb57b62=_0x11ff56;_0x3ab01a=0xc8;}else{_0x3ab01a=0xce;}_0x2ac762[_0xb9ef('0x20')](_0x3ab01a);return _0x2ac762[_0xb9ef('0x27')](_0xb9ef('0x28'),_0x2f8782+'-'+_0xb57b62+'/'+_0x11ff56)[_0xb9ef('0x22')](_0x5eda52);}return null;};}function patchUpdates(_0x13607d){return function(_0x3dd8d3){try{jsonpatch[_0xb9ef('0x29')](_0x3dd8d3,_0x13607d,!![]);}catch(_0x42c5f4){return BPromise[_0xb9ef('0x2a')](_0x42c5f4);}return _0x3dd8d3[_0xb9ef('0x2b')]();};}function saveUpdates(_0x3a7a37,_0x11e8b4){return function(_0x383c03){if(_0x383c03){return _0x383c03['update'](_0x3a7a37)['then'](function(_0x5acc16){return _0x5acc16;});}return null;};}function removeEntity(_0x55966f,_0x24a86a){return function(_0x175e28){if(_0x175e28){return _0x175e28[_0xb9ef('0x2c')]()[_0xb9ef('0x2d')](function(){_0x55966f[_0xb9ef('0x20')](0xcc)[_0xb9ef('0x21')]();});}};}function handleEntityNotFound(_0x2ab7a3,_0x358b14){return function(_0x42f93c){if(!_0x42f93c){_0x2ab7a3[_0xb9ef('0x2e')](0x194);}return _0x42f93c;};}function handleError(_0x3afa48,_0x5f198d){_0x5f198d=_0x5f198d||0x1f4;return function(_0x3dcc6e){logger[_0xb9ef('0x2f')](_0x3dcc6e['stack']);if(_0x3dcc6e[_0xb9ef('0x30')]){delete _0x3dcc6e[_0xb9ef('0x30')];}_0x3afa48[_0xb9ef('0x20')](_0x5f198d)['send'](_0x3dcc6e);};}exports[_0xb9ef('0x31')]=function(_0x20d564,_0x13f96d){var _0x295b0d={},_0x35d1e1={},_0x221b01={'count':0x0,'rows':[]};var _0x5e6e4d=_[_0xb9ef('0x32')](db[_0xb9ef('0x33')]['rawAttributes'],function(_0x26e5c2){return{'name':_0x26e5c2['fieldName'],'type':_0x26e5c2['type'][_0xb9ef('0x34')]};});_0x35d1e1[_0xb9ef('0x35')]=_['map'](_0x5e6e4d,_0xb9ef('0x30'));_0x35d1e1[_0xb9ef('0x36')]=_[_0xb9ef('0x37')](_0x20d564['query']);_0x35d1e1[_0xb9ef('0x38')]=_['intersection'](_0x35d1e1[_0xb9ef('0x35')],_0x35d1e1[_0xb9ef('0x36')]);_0x295b0d[_0xb9ef('0x39')]=_[_0xb9ef('0x3a')](_0x35d1e1['model'],qs['fields'](_0x20d564['query'][_0xb9ef('0x3b')]));_0x295b0d['attributes']=_0x295b0d[_0xb9ef('0x39')]['length']?_0x295b0d[_0xb9ef('0x39')]:_0x35d1e1['model'];if(!_0x20d564['query'][_0xb9ef('0x3c')](_0xb9ef('0x3d'))){_0x295b0d['limit']=qs[_0xb9ef('0x26')](_0x20d564[_0xb9ef('0x36')]['limit']);_0x295b0d[_0xb9ef('0x23')]=qs[_0xb9ef('0x23')](_0x20d564['query']['offset']);}_0x295b0d[_0xb9ef('0x3e')]=qs[_0xb9ef('0x3f')](_0x20d564[_0xb9ef('0x36')][_0xb9ef('0x3f')]);_0x295b0d[_0xb9ef('0x40')]=qs['filters'](_[_0xb9ef('0x41')](_0x20d564['query'],_0x35d1e1[_0xb9ef('0x38')]),_0x5e6e4d);if(_0x20d564['query']['filter']){_0x295b0d[_0xb9ef('0x40')]=_[_0xb9ef('0x42')](_0x295b0d[_0xb9ef('0x40')],{'$or':_[_0xb9ef('0x32')](_0x5e6e4d,function(_0x238d79){if(_0x238d79[_0xb9ef('0x43')]!==_0xb9ef('0x44')){var _0x23e8ce={};_0x23e8ce[_0x238d79[_0xb9ef('0x30')]]={'$like':'%'+_0x20d564['query']['filter']+'%'};return _0x23e8ce;}})});}_0x295b0d=_[_0xb9ef('0x42')]({},_0x295b0d,_0x20d564['options']);var _0x2062d6={'where':_0x295b0d[_0xb9ef('0x40')]};return db[_0xb9ef('0x33')]['count'](_0x2062d6)['then'](function(_0x2fe9a5){_0x221b01[_0xb9ef('0x25')]=_0x2fe9a5;if(_0x20d564[_0xb9ef('0x36')]['includeAll']){_0x295b0d['include']=[{'all':!![]}];}return db[_0xb9ef('0x33')][_0xb9ef('0x45')](_0x295b0d);})[_0xb9ef('0x2d')](function(_0x34454d){_0x221b01['rows']=_0x34454d;return _0x221b01;})[_0xb9ef('0x2d')](respondWithFilteredResult(_0x13f96d,_0x295b0d))['catch'](handleError(_0x13f96d,null));};exports['show']=function(_0x26084f,_0x18da70){var _0x4b3f6c={'raw':![],'where':{'id':_0x26084f['params']['id']}},_0x3d34f8={};_0x3d34f8[_0xb9ef('0x35')]=_[_0xb9ef('0x37')](db[_0xb9ef('0x33')][_0xb9ef('0x46')]);_0x3d34f8[_0xb9ef('0x36')]=_[_0xb9ef('0x37')](_0x26084f[_0xb9ef('0x36')]);_0x3d34f8[_0xb9ef('0x38')]=_[_0xb9ef('0x3a')](_0x3d34f8['model'],_0x3d34f8[_0xb9ef('0x36')]);_0x4b3f6c[_0xb9ef('0x39')]=_[_0xb9ef('0x3a')](_0x3d34f8[_0xb9ef('0x35')],qs['fields'](_0x26084f[_0xb9ef('0x36')][_0xb9ef('0x3b')]));_0x4b3f6c[_0xb9ef('0x39')]=_0x4b3f6c[_0xb9ef('0x39')][_0xb9ef('0x47')]?_0x4b3f6c[_0xb9ef('0x39')]:_0x3d34f8[_0xb9ef('0x35')];if(_0x26084f['query']['includeAll']){_0x4b3f6c[_0xb9ef('0x48')]=[{'all':!![]}];}_0x4b3f6c=_[_0xb9ef('0x42')]({},_0x4b3f6c,_0x26084f[_0xb9ef('0x49')]);return db[_0xb9ef('0x33')][_0xb9ef('0x4a')](_0x4b3f6c)['then'](handleEntityNotFound(_0x18da70,null))['then'](respondWithResult(_0x18da70,null))[_0xb9ef('0x4b')](handleError(_0x18da70,null));};exports[_0xb9ef('0x4c')]=function(_0x5ea16b,_0x3639d9){return db[_0xb9ef('0x33')][_0xb9ef('0x4c')](_0x5ea16b[_0xb9ef('0x4d')],{})[_0xb9ef('0x2d')](respondWithResult(_0x3639d9,0xc9))[_0xb9ef('0x4b')](handleError(_0x3639d9,null));};exports[_0xb9ef('0x4e')]=function(_0x563637,_0x3b8005){if(_0x563637['body']['id']){delete _0x563637['body']['id'];}return db['VoiceQueueReport'][_0xb9ef('0x4a')]({'where':{'id':_0x563637[_0xb9ef('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3b8005,null))[_0xb9ef('0x2d')](saveUpdates(_0x563637[_0xb9ef('0x4d')],null))[_0xb9ef('0x2d')](respondWithResult(_0x3b8005,null))['catch'](handleError(_0x3b8005,null));};exports['destroy']=function(_0x37d230,_0x2340ed){return db['VoiceQueueReport'][_0xb9ef('0x4a')]({'where':{'id':_0x37d230[_0xb9ef('0x4f')]['id']}})[_0xb9ef('0x2d')](handleEntityNotFound(_0x2340ed,null))[_0xb9ef('0x2d')](removeEntity(_0x2340ed,null))[_0xb9ef('0x4b')](handleError(_0x2340ed,null));};exports[_0xb9ef('0x50')]=function(_0x2c83f5,_0x560a30){return db[_0xb9ef('0x33')][_0xb9ef('0x50')]()[_0xb9ef('0x2d')](respondWithResult(_0x560a30,null))[_0xb9ef('0x4b')](handleError(_0x560a30,null));};exports[_0xb9ef('0x51')]=function(_0x5ad04e,_0x369efc){var _0x56870d={},_0x586181={},_0x4cebed={'count':0x0,'rows':[]};_0x586181[_0xb9ef('0x35')]=_[_0xb9ef('0x37')](db['VoiceQueueReport'][_0xb9ef('0x46')]);_0x586181['query']=_[_0xb9ef('0x37')](_0x5ad04e['query']);_0x586181[_0xb9ef('0x38')]=_['intersection'](_0x586181[_0xb9ef('0x35')],_0x586181['query']);_0x56870d[_0xb9ef('0x39')]=_[_0xb9ef('0x3a')](_0x586181['model'],qs[_0xb9ef('0x3b')](_0x5ad04e[_0xb9ef('0x36')][_0xb9ef('0x3b')]));_0x56870d[_0xb9ef('0x39')]=_0x56870d['attributes'][_0xb9ef('0x47')]?_0x56870d[_0xb9ef('0x39')]:_0x586181[_0xb9ef('0x35')];if(!_0x5ad04e[_0xb9ef('0x36')][_0xb9ef('0x3c')](_0xb9ef('0x3d'))){_0x56870d[_0xb9ef('0x26')]=qs[_0xb9ef('0x26')](_0x5ad04e[_0xb9ef('0x36')]['limit']);_0x56870d[_0xb9ef('0x23')]=qs[_0xb9ef('0x23')](_0x5ad04e[_0xb9ef('0x36')]['offset']);}_0x56870d['order']=qs['sort'](_0x5ad04e['query'][_0xb9ef('0x3f')]);_0x56870d[_0xb9ef('0x40')]=qs[_0xb9ef('0x38')](_['pick'](_0x5ad04e['query'],_0x586181[_0xb9ef('0x38')]));if(_0x5ad04e[_0xb9ef('0x36')][_0xb9ef('0x52')]){_0x56870d[_0xb9ef('0x40')]=_[_0xb9ef('0x42')](_0x56870d[_0xb9ef('0x40')],{'$or':_[_0xb9ef('0x32')](_0x56870d['attributes'],function(_0x1929bf){var _0x288782={};_0x288782[_0x1929bf]={'$like':'%'+_0x5ad04e[_0xb9ef('0x36')][_0xb9ef('0x52')]+'%'};return _0x288782;})});}_0x56870d=_[_0xb9ef('0x42')]({},_0x56870d,_0x5ad04e[_0xb9ef('0x49')]);var _0x474fc9={'where':_0x56870d[_0xb9ef('0x40')]};return db[_0xb9ef('0x33')]['count'](_0x474fc9)[_0xb9ef('0x2d')](function(_0x5b9a4b){_0x4cebed[_0xb9ef('0x25')]=_0x5b9a4b;if(_0x5ad04e[_0xb9ef('0x36')][_0xb9ef('0x53')]){_0x56870d[_0xb9ef('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xb9ef('0x45')](_0x56870d);})[_0xb9ef('0x2d')](function(_0x43d59c){_0x4cebed[_0xb9ef('0x54')]=_0x43d59c;return _0x4cebed;})[_0xb9ef('0x2d')](respondWithFilteredResult(_0x369efc,_0x56870d,_0xb9ef('0x51')))['catch'](handleError(_0x369efc,null,_0xb9ef('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2f1c926..d873343 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 _0x057f=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x057f,0xaa));var _0xf057=function(_0x567248,_0x4e4d75){_0x567248=_0x567248-0x0;var _0x20a156=_0x057f[_0x567248];return _0x20a156;};'use strict';var EventEmitter=require(_0xf057('0x0'));var VoiceQueueReport=require(_0xf057('0x1'))['db'][_0xf057('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf057('0x3')](0x0);var events={'afterCreate':_0xf057('0x4'),'afterUpdate':'update','afterDestroy':_0xf057('0x5')};function emitEvent(_0x3a0b9d){return function(_0x29080e,_0x1483ed,_0x1a735e){VoiceQueueReportEvents[_0xf057('0x6')](_0x3a0b9d+':'+_0x29080e['id'],_0x29080e);VoiceQueueReportEvents[_0xf057('0x6')](_0x3a0b9d,_0x29080e);_0x1a735e(null);};}for(var e in events){if(events[_0xf057('0x7')](e)){var event=events[e];VoiceQueueReport[_0xf057('0x8')](e,emitEvent(event));}}module[_0xf057('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xb96e=['exports','events','../../mysqldb','VoiceQueueReport','save','update','remove','emit'];(function(_0x2a21f4,_0x149710){var _0xdd7aef=function(_0x116ea6){while(--_0x116ea6){_0x2a21f4['push'](_0x2a21f4['shift']());}};_0xdd7aef(++_0x149710);}(_0xb96e,0x1e1));var _0xeb96=function(_0x560a54,_0x6a2e02){_0x560a54=_0x560a54-0x0;var _0x312268=_0xb96e[_0x560a54];return _0x312268;};'use strict';var EventEmitter=require(_0xeb96('0x0'));var VoiceQueueReport=require(_0xeb96('0x1'))['db'][_0xeb96('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb96('0x3'),'afterUpdate':_0xeb96('0x4'),'afterDestroy':_0xeb96('0x5')};function emitEvent(_0x46e8fd){return function(_0x16bc11,_0x1812ce,_0x8dd259){VoiceQueueReportEvents['emit'](_0x46e8fd+':'+_0x16bc11['id'],_0x16bc11);VoiceQueueReportEvents[_0xeb96('0x6')](_0x46e8fd,_0x16bc11);_0x8dd259(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xeb96('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index b199b00..f78d0bd 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 _0xfa65=['uniqueid','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','VoiceQueueReport'];(function(_0x596650,_0x4ab6e8){var _0xd1e426=function(_0x385e4c){while(--_0x385e4c){_0x596650['push'](_0x596650['shift']());}};_0xd1e426(++_0x4ab6e8);}(_0xfa65,0x97));var _0x5fa6=function(_0x526487,_0x321b12){_0x526487=_0x526487-0x0;var _0x1aca63=_0xfa65[_0x526487];return _0x1aca63;};'use strict';var _=require('lodash');var util=require(_0x5fa6('0x0'));var logger=require(_0x5fa6('0x1'))(_0x5fa6('0x2'));var moment=require('moment');var BPromise=require(_0x5fa6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5fa6('0x4'));var config=require(_0x5fa6('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0x5fa6('0x6')]=function(_0x3257e1,_0x3de8ea){return _0x3257e1[_0x5fa6('0x7')](_0x5fa6('0x8'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x5fa6('0x9')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7cba=['api','bluebird','path','rimraf','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','calleridnum','../../config/logger'];(function(_0x217848,_0x4cc7aa){var _0x328823=function(_0x3b6d4e){while(--_0x3b6d4e){_0x217848['push'](_0x217848['shift']());}};_0x328823(++_0x4cc7aa);}(_0x7cba,0x1d5));var _0xa7cb=function(_0xeb57a6,_0x28989f){_0xeb57a6=_0xeb57a6-0x0;var _0x499b7a=_0x7cba[_0xeb57a6];return _0x499b7a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7cb('0x0'))(_0xa7cb('0x1'));var moment=require('moment');var BPromise=require(_0xa7cb('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7cb('0x3'));var rimraf=require(_0xa7cb('0x4'));var config=require('../../config/environment');var attributes=require(_0xa7cb('0x5'));module[_0xa7cb('0x6')]=function(_0x35c383,_0x4df6de){return _0x35c383['define'](_0xa7cb('0x7'),attributes,{'tableName':_0xa7cb('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xa7cb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 4f53d55..38e3575 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 _0x3311=['model','stringify','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','map'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3311,0x1b5));var _0x1331=function(_0x4e4e49,_0x5dc466){_0x4e4e49=_0x4e4e49-0x0;var _0x671be=_0x3311[_0x4e4e49];return _0x671be;};'use strict';var _=require(_0x1331('0x0'));var util=require(_0x1331('0x1'));var moment=require(_0x1331('0x2'));var BPromise=require(_0x1331('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1331('0x4'));var db=require(_0x1331('0x5'))['db'];var utils=require(_0x1331('0x6'));var logger=require(_0x1331('0x7'))(_0x1331('0x8'));var config=require('../../config/environment');var jayson=require(_0x1331('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1331('0xa')]=_['defaults'](config[_0x1331('0xa')],{'host':_0x1331('0xb'),'port':0x18eb});var socket=require(_0x1331('0xc'))(new Redis(config[_0x1331('0xa')]));require(_0x1331('0xd'))[_0x1331('0xe')](socket);function respondWithRpcPromise(_0x16a63e,_0x1657d7,_0x4f6a96){return new BPromise(function(_0x1479bf,_0x58376a){return client[_0x1331('0xf')](_0x16a63e,_0x4f6a96)[_0x1331('0x10')](function(_0x58a2ad){logger[_0x1331('0x11')](_0x1331('0x12'),_0x1657d7,_0x1331('0x13'));logger[_0x1331('0x14')](_0x1331('0x15'),_0x1657d7,_0x1331('0x13'),JSON['stringify'](_0x58a2ad));if(_0x58a2ad[_0x1331('0x16')]){if(_0x58a2ad[_0x1331('0x16')][_0x1331('0x17')]===0x1f4){logger[_0x1331('0x16')](_0x1331('0x12'),_0x1657d7,_0x58a2ad[_0x1331('0x16')][_0x1331('0x18')]);return _0x58376a(_0x58a2ad['error'][_0x1331('0x18')]);}logger[_0x1331('0x16')](_0x1331('0x12'),_0x1657d7,_0x58a2ad[_0x1331('0x16')][_0x1331('0x18')]);return _0x1479bf(_0x58a2ad[_0x1331('0x16')][_0x1331('0x18')]);}else{logger[_0x1331('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x1657d7,_0x1331('0x13'));_0x1479bf(_0x58a2ad[_0x1331('0x19')]['message']);}})[_0x1331('0x1a')](function(_0x351dcc){logger[_0x1331('0x16')](_0x1331('0x12'),_0x1657d7,_0x351dcc);_0x58376a(_0x351dcc);});});}exports[_0x1331('0x1b')]=function(_0x480137){var _0x123bad=this;return new Promise(function(_0x5cf456,_0x20cd4f){return db[_0x1331('0x1c')][_0x1331('0x1d')]({'raw':_0x480137[_0x1331('0x1e')]?_0x480137[_0x1331('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x480137[_0x1331('0x1e')]?_0x480137['options'][_0x1331('0x1f')]||null:null,'attributes':_0x480137['options']?_0x480137['options'][_0x1331('0x20')]||null:null,'limit':_0x480137['options']?_0x480137[_0x1331('0x1e')][_0x1331('0x21')]||null:null,'include':_0x480137['options']?_0x480137[_0x1331('0x1e')][_0x1331('0x22')]?_[_0x1331('0x23')](_0x480137[_0x1331('0x1e')][_0x1331('0x22')],function(_0x2513a3){return{'model':db[_0x2513a3[_0x1331('0x24')]],'as':_0x2513a3['as'],'attributes':_0x2513a3['attributes'],'include':_0x2513a3[_0x1331('0x22')]?_[_0x1331('0x23')](_0x2513a3[_0x1331('0x22')],function(_0x68db26){return{'model':db[_0x68db26[_0x1331('0x24')]],'as':_0x68db26['as'],'attributes':_0x68db26['attributes'],'include':_0x68db26[_0x1331('0x22')]?_[_0x1331('0x23')](_0x68db26[_0x1331('0x22')],function(_0x1517a9){return{'model':db[_0x1517a9[_0x1331('0x24')]],'as':_0x1517a9['as'],'attributes':_0x1517a9[_0x1331('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21f360){logger[_0x1331('0x11')](_0x1331('0x1b'),_0x480137);logger[_0x1331('0x14')]('GetVoiceQueueReport',_0x480137,JSON[_0x1331('0x25')](_0x21f360));_0x5cf456(_0x21f360);})['catch'](function(_0xc66963){logger[_0x1331('0x16')](_0x1331('0x1b'),_0xc66963[_0x1331('0x18')],_0x480137);_0x20cd4f(_0x123bad[_0x1331('0x16')](0x1f4,_0xc66963['message']));});});};exports[_0x1331('0x26')]=function(_0x467752){var _0x32bb99=this;return new Promise(function(_0x7adbf2,_0xe0f4a){return db[_0x1331('0x1c')]['create'](_0x467752[_0x1331('0x27')],{'raw':_0x467752[_0x1331('0x1e')]?_0x467752['options'][_0x1331('0x28')]===undefined?!![]:![]:!![]})[_0x1331('0x10')](function(_0x1e0bc5){logger[_0x1331('0x11')](_0x1331('0x26'),_0x467752);logger[_0x1331('0x14')](_0x1331('0x26'),_0x467752,JSON[_0x1331('0x25')](_0x1e0bc5));_0x7adbf2(_0x1e0bc5);})[_0x1331('0x1a')](function(_0x195f52){logger[_0x1331('0x16')](_0x1331('0x26'),_0x195f52[_0x1331('0x18')],_0x467752);_0xe0f4a(_0x32bb99[_0x1331('0x16')](0x1f4,_0x195f52[_0x1331('0x18')]));});});};exports[_0x1331('0x29')]=function(_0x3e77a5){var _0x1134c4=this;return new Promise(function(_0x37a48b,_0x59244f){return db[_0x1331('0x1c')][_0x1331('0x2a')](_0x3e77a5['body'],{'raw':_0x3e77a5['options']?_0x3e77a5[_0x1331('0x1e')][_0x1331('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e77a5['options']?_0x3e77a5[_0x1331('0x1e')][_0x1331('0x1f')]||null:null,'attributes':_0x3e77a5[_0x1331('0x1e')]?_0x3e77a5['options'][_0x1331('0x20')]||null:null,'limit':_0x3e77a5[_0x1331('0x1e')]?_0x3e77a5[_0x1331('0x1e')][_0x1331('0x21')]||null:null})['then'](function(_0x37d06b){logger[_0x1331('0x11')](_0x1331('0x29'),_0x3e77a5);logger[_0x1331('0x14')](_0x1331('0x29'),_0x3e77a5,JSON[_0x1331('0x25')](_0x37d06b));_0x37a48b(_0x37d06b);})[_0x1331('0x1a')](function(_0x4e2660){logger['error'](_0x1331('0x29'),_0x4e2660[_0x1331('0x18')],_0x3e77a5);_0x59244f(_0x1134c4[_0x1331('0x16')](0x1f4,_0x4e2660['message']));});});}; \ No newline at end of file +var _0x6328=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','attributes','include','map','model','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','body','update','limit','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x559642,_0x30f3b1){var _0x2b81ce=function(_0x276a94){while(--_0x276a94){_0x559642['push'](_0x559642['shift']());}};_0x2b81ce(++_0x30f3b1);}(_0x6328,0xda));var _0x8632=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x6328[_0x8c1005];return _0x175354;};'use strict';var _=require(_0x8632('0x0'));var util=require(_0x8632('0x1'));var moment=require('moment');var BPromise=require(_0x8632('0x2'));var rs=require(_0x8632('0x3'));var fs=require('fs');var Redis=require(_0x8632('0x4'));var db=require(_0x8632('0x5'))['db'];var utils=require(_0x8632('0x6'));var logger=require(_0x8632('0x7'))(_0x8632('0x8'));var config=require(_0x8632('0x9'));var jayson=require(_0x8632('0xa'));var client=jayson['client'][_0x8632('0xb')]({'port':0x232a});config[_0x8632('0xc')]=_[_0x8632('0xd')](config['redis'],{'host':_0x8632('0xe'),'port':0x18eb});var socket=require(_0x8632('0xf'))(new Redis(config[_0x8632('0xc')]));require(_0x8632('0x10'))['register'](socket);function respondWithRpcPromise(_0x3dadb7,_0x1ba0c6,_0x36550f){return new BPromise(function(_0x343788,_0x2c474f){return client[_0x8632('0x11')](_0x3dadb7,_0x36550f)[_0x8632('0x12')](function(_0x5439c7){logger[_0x8632('0x13')](_0x8632('0x14'),_0x1ba0c6,_0x8632('0x15'));logger[_0x8632('0x16')](_0x8632('0x17'),_0x1ba0c6,_0x8632('0x15'),JSON['stringify'](_0x5439c7));if(_0x5439c7[_0x8632('0x18')]){if(_0x5439c7[_0x8632('0x18')][_0x8632('0x19')]===0x1f4){logger[_0x8632('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x1ba0c6,_0x5439c7[_0x8632('0x18')][_0x8632('0x1a')]);return _0x2c474f(_0x5439c7[_0x8632('0x18')][_0x8632('0x1a')]);}logger[_0x8632('0x18')](_0x8632('0x14'),_0x1ba0c6,_0x5439c7['error']['message']);return _0x343788(_0x5439c7[_0x8632('0x18')][_0x8632('0x1a')]);}else{logger['info'](_0x8632('0x14'),_0x1ba0c6,_0x8632('0x15'));_0x343788(_0x5439c7[_0x8632('0x1b')][_0x8632('0x1a')]);}})[_0x8632('0x1c')](function(_0x27285c){logger[_0x8632('0x18')](_0x8632('0x14'),_0x1ba0c6,_0x27285c);_0x2c474f(_0x27285c);});});}exports['GetVoiceQueueReport']=function(_0x42eb46){var _0x4f2ba8=this;return new Promise(function(_0xea95d9,_0xb3460d){return db['VoiceQueueReport']['findAll']({'raw':_0x42eb46[_0x8632('0x1d')]?_0x42eb46['options'][_0x8632('0x1e')]===undefined?!![]:![]:!![],'where':_0x42eb46['options']?_0x42eb46[_0x8632('0x1d')][_0x8632('0x1f')]||null:null,'attributes':_0x42eb46[_0x8632('0x1d')]?_0x42eb46[_0x8632('0x1d')][_0x8632('0x20')]||null:null,'limit':_0x42eb46[_0x8632('0x1d')]?_0x42eb46[_0x8632('0x1d')]['limit']||null:null,'include':_0x42eb46[_0x8632('0x1d')]?_0x42eb46[_0x8632('0x1d')][_0x8632('0x21')]?_[_0x8632('0x22')](_0x42eb46['options']['include'],function(_0x344f3e){return{'model':db[_0x344f3e[_0x8632('0x23')]],'as':_0x344f3e['as'],'attributes':_0x344f3e['attributes'],'include':_0x344f3e[_0x8632('0x21')]?_['map'](_0x344f3e[_0x8632('0x21')],function(_0x368f0f){return{'model':db[_0x368f0f[_0x8632('0x23')]],'as':_0x368f0f['as'],'attributes':_0x368f0f['attributes'],'include':_0x368f0f[_0x8632('0x21')]?_[_0x8632('0x22')](_0x368f0f[_0x8632('0x21')],function(_0x2224d1){return{'model':db[_0x2224d1[_0x8632('0x23')]],'as':_0x2224d1['as'],'attributes':_0x2224d1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x187422){logger[_0x8632('0x13')](_0x8632('0x24'),_0x42eb46);logger[_0x8632('0x16')](_0x8632('0x24'),_0x42eb46,JSON[_0x8632('0x25')](_0x187422));_0xea95d9(_0x187422);})[_0x8632('0x1c')](function(_0x3c85f0){logger[_0x8632('0x18')](_0x8632('0x24'),_0x3c85f0[_0x8632('0x1a')],_0x42eb46);_0xb3460d(_0x4f2ba8[_0x8632('0x18')](0x1f4,_0x3c85f0[_0x8632('0x1a')]));});});};exports[_0x8632('0x26')]=function(_0x5694cf){var _0x8fb987=this;return new Promise(function(_0x57c9b3,_0x59ae3f){return db[_0x8632('0x27')][_0x8632('0x28')](_0x5694cf[_0x8632('0x29')],{'raw':_0x5694cf[_0x8632('0x1d')]?_0x5694cf['options']['raw']===undefined?!![]:![]:!![]})[_0x8632('0x12')](function(_0x520c02){logger['info'](_0x8632('0x26'),_0x5694cf);logger['debug'](_0x8632('0x26'),_0x5694cf,JSON[_0x8632('0x25')](_0x520c02));_0x57c9b3(_0x520c02);})[_0x8632('0x1c')](function(_0x4045d8){logger[_0x8632('0x18')](_0x8632('0x26'),_0x4045d8[_0x8632('0x1a')],_0x5694cf);_0x59ae3f(_0x8fb987[_0x8632('0x18')](0x1f4,_0x4045d8['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x5d4c39){var _0x150fbf=this;return new Promise(function(_0x20989e,_0x3decc4){return db[_0x8632('0x27')][_0x8632('0x2a')](_0x5d4c39[_0x8632('0x29')],{'raw':_0x5d4c39[_0x8632('0x1d')]?_0x5d4c39['options'][_0x8632('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4c39[_0x8632('0x1d')]?_0x5d4c39[_0x8632('0x1d')][_0x8632('0x1f')]||null:null,'attributes':_0x5d4c39[_0x8632('0x1d')]?_0x5d4c39['options'][_0x8632('0x20')]||null:null,'limit':_0x5d4c39[_0x8632('0x1d')]?_0x5d4c39[_0x8632('0x1d')][_0x8632('0x2b')]||null:null})['then'](function(_0x11a93e){logger[_0x8632('0x13')](_0x8632('0x2c'),_0x5d4c39);logger['debug'](_0x8632('0x2c'),_0x5d4c39,JSON[_0x8632('0x25')](_0x11a93e));_0x20989e(_0x11a93e);})[_0x8632('0x1c')](function(_0x2c0899){logger['error'](_0x8632('0x2c'),_0x2c0899[_0x8632('0x1a')],_0x5d4c39);_0x3decc4(_0x150fbf['error'](0x1f4,_0x2c0899[_0x8632('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 2cc0ea5..3554243 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 _0xf776=['length','./voiceQueueReport.events','remove','update','emit','removeListener'];(function(_0xe37cad,_0x9fcbdd){var _0x24593e=function(_0x4170bb){while(--_0x4170bb){_0xe37cad['push'](_0xe37cad['shift']());}};_0x24593e(++_0x9fcbdd);}(_0xf776,0x169));var _0x6f77=function(_0x55426d,_0x2f03f3){_0x55426d=_0x55426d-0x0;var _0xa506cf=_0xf776[_0x55426d];return _0xa506cf;};'use strict';var VoiceQueueReportEvents=require(_0x6f77('0x0'));var events=['save',_0x6f77('0x1'),_0x6f77('0x2')];function createListener(_0x4e3b77,_0x43f2fd){return function(_0x2458e0){_0x43f2fd[_0x6f77('0x3')](_0x4e3b77,_0x2458e0);};}function removeListener(_0x16874b,_0x53ec9b){return function(){VoiceQueueReportEvents[_0x6f77('0x4')](_0x16874b,_0x53ec9b);};}exports['register']=function(_0xf62e3e){for(var _0x21909a=0x0,_0x36ffd2=events[_0x6f77('0x5')];_0x21909a<_0x36ffd2;_0x21909a++){var _0x545ba9=events[_0x21909a];var _0x1dd52f=createListener('voiceQueueReport:'+_0x545ba9,_0xf62e3e);VoiceQueueReportEvents['on'](_0x545ba9,_0x1dd52f);}}; \ No newline at end of file +var _0xc83b=['emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0xa8f24a,_0x48d7d3){var _0x3a1471=function(_0x281470){while(--_0x281470){_0xa8f24a['push'](_0xa8f24a['shift']());}};_0x3a1471(++_0x48d7d3);}(_0xc83b,0xa4));var _0xbc83=function(_0x3f2b15,_0x2df038){_0x3f2b15=_0x3f2b15-0x0;var _0x342e3a=_0xc83b[_0x3f2b15];return _0x342e3a;};'use strict';var VoiceQueueReportEvents=require(_0xbc83('0x0'));var events=[_0xbc83('0x1'),_0xbc83('0x2'),_0xbc83('0x3')];function createListener(_0x4b7749,_0x34a18e){return function(_0x443083){_0x34a18e[_0xbc83('0x4')](_0x4b7749,_0x443083);};}function removeListener(_0x261032,_0xee232c){return function(){VoiceQueueReportEvents['removeListener'](_0x261032,_0xee232c);};}exports[_0xbc83('0x5')]=function(_0x230b16){for(var _0x48d06a=0x0,_0x109543=events[_0xbc83('0x6')];_0x48d06a<_0x109543;_0x48d06a++){var _0x5447f8=events[_0x48d06a];var _0x285181=createListener(_0xbc83('0x7')+_0x5447f8,_0x230b16);VoiceQueueReportEvents['on'](_0x5447f8,_0x285181);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index dd0bd03..c6f6a3d 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 _0xa4fb=['../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5a4d05,_0x5bf9e9){var _0x7a3f97=function(_0x1ed9ab){while(--_0x1ed9ab){_0x5a4d05['push'](_0x5a4d05['shift']());}};_0x7a3f97(++_0x5bf9e9);}(_0xa4fb,0x150));var _0xba4f=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0xa4fb[_0x574617];return _0x29de90;};'use strict';var multer=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var path=require(_0xba4f('0x2'));var timeout=require(_0xba4f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xba4f('0x4'));var auth=require(_0xba4f('0x5'));var interaction=require(_0xba4f('0x6'));var config=require('../../config/environment');var controller=require(_0xba4f('0x7'));router[_0xba4f('0x8')]('/',auth[_0xba4f('0x9')](),controller[_0xba4f('0xa')]);router[_0xba4f('0x8')](_0xba4f('0xb'),auth[_0xba4f('0x9')](),controller[_0xba4f('0xc')]);router[_0xba4f('0xd')]('/',auth[_0xba4f('0x9')](),controller['create']);router[_0xba4f('0xe')]('/:id',auth[_0xba4f('0x9')](),controller[_0xba4f('0xf')]);router[_0xba4f('0x10')](_0xba4f('0xb'),auth[_0xba4f('0x9')](),controller[_0xba4f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd3bd=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','connect-timeout'];(function(_0xe3e0f6,_0x4c8a9d){var _0x5e2625=function(_0x550b8c){while(--_0x550b8c){_0xe3e0f6['push'](_0xe3e0f6['shift']());}};_0x5e2625(++_0x4c8a9d);}(_0xd3bd,0xa9));var _0xdd3b=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xd3bd[_0x9df060];return _0x338dfe;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdd3b('0x0'));var express=require(_0xdd3b('0x1'));var router=express['Router']();var fs_extra=require(_0xdd3b('0x2'));var auth=require(_0xdd3b('0x3'));var interaction=require(_0xdd3b('0x4'));var config=require(_0xdd3b('0x5'));var controller=require(_0xdd3b('0x6'));router[_0xdd3b('0x7')]('/',auth[_0xdd3b('0x8')](),controller[_0xdd3b('0x9')]);router['get'](_0xdd3b('0xa'),auth[_0xdd3b('0x8')](),controller[_0xdd3b('0xb')]);router[_0xdd3b('0xc')]('/',auth[_0xdd3b('0x8')](),controller[_0xdd3b('0xd')]);router[_0xdd3b('0xe')]('/:id',auth[_0xdd3b('0x8')](),controller[_0xdd3b('0xf')]);router['delete'](_0xdd3b('0xa'),auth[_0xdd3b('0x8')](),controller[_0xdd3b('0x10')]);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 22d23e5..55f676b 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 _0x113d=['DATE','literal','sequelize','moment','exports','STRING'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x113d,0xfe));var _0xd113=function(_0x390579,_0x50c790){_0x390579=_0x390579-0x0;var _0x41b3b6=_0x113d[_0x390579];return _0x41b3b6;};'use strict';var Sequelize=require(_0xd113('0x0'));var moment=require(_0xd113('0x1'));module[_0xd113('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd113('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd113('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd113('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd113('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd113('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd113('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd113('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xd113('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xf017=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','STRING','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf017,0x11c));var _0x7f01=function(_0x2196be,_0x42feaf){_0x2196be=_0x2196be-0x0;var _0x379fc1=_0xf017[_0x2196be];return _0x379fc1;};'use strict';var Sequelize=require(_0x7f01('0x0'));var moment=require('moment');module[_0x7f01('0x1')]={'time':{'type':Sequelize[_0x7f01('0x2')]},'callid':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7f01('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7f01('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x7f01('0x4')](_0x7f01('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 93664b6..4008148 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 _0x74a0=['options','then','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','destroy','error','stack','send','index','map','VoiceQueuesLog','fieldName','type','key','model','name','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x74a0,0x1db));var _0x074a=function(_0x15aa0f,_0x596f6e){_0x15aa0f=_0x15aa0f-0x0;var _0x56cb65=_0x74a0[_0x15aa0f];return _0x56cb65;};'use strict';var emlformat=require(_0x074a('0x0'));var rimraf=require(_0x074a('0x1'));var zipdir=require(_0x074a('0x2'));var jsonpatch=require(_0x074a('0x3'));var rp=require(_0x074a('0x4'));var moment=require('moment');var BPromise=require(_0x074a('0x5'));var Mustache=require(_0x074a('0x6'));var util=require(_0x074a('0x7'));var path=require('path');var sox=require(_0x074a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x074a('0x9'));var squel=require(_0x074a('0xa'));var crypto=require(_0x074a('0xb'));var jsforce=require(_0x074a('0xc'));var deskjs=require(_0x074a('0xd'));var toCsv=require(_0x074a('0xe'));var querystring=require(_0x074a('0xf'));var Papa=require(_0x074a('0x10'));var Redis=require(_0x074a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x074a('0x12'));var as=require(_0x074a('0x13'));var hardwareService=require(_0x074a('0x14'));var logger=require('../../config/logger')(_0x074a('0x15'));var utils=require(_0x074a('0x16'));var config=require(_0x074a('0x17'));var licenseUtil=require(_0x074a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4958ca,_0x3b0c00){_0x3b0c00=_0x3b0c00||0xcc;return function(_0xedb54d){if(_0xedb54d){return _0x4958ca[_0x074a('0x19')](_0x3b0c00);}return _0x4958ca[_0x074a('0x1a')](_0x3b0c00)[_0x074a('0x1b')]();};}function respondWithResult(_0x41b149,_0x73dba3){_0x73dba3=_0x73dba3||0xc8;return function(_0x5d152e){if(_0x5d152e){return _0x41b149[_0x074a('0x1a')](_0x73dba3)[_0x074a('0x1c')](_0x5d152e);}};}function respondWithFilteredResult(_0x2998e6,_0xaef97d){return function(_0x1a9c6b){if(_0x1a9c6b){var _0x11981e=typeof _0xaef97d['offset']==='undefined'&&typeof _0xaef97d[_0x074a('0x1d')]===_0x074a('0x1e');var _0x5270d6=_0x1a9c6b[_0x074a('0x1f')];var _0x2a9d51=_0x11981e?0x0:_0xaef97d[_0x074a('0x20')];var _0x2c45d0=_0x11981e?_0x1a9c6b[_0x074a('0x1f')]:_0xaef97d[_0x074a('0x20')]+_0xaef97d[_0x074a('0x1d')];var _0xf0bcf8;if(_0x2c45d0>=_0x5270d6){_0x2c45d0=_0x5270d6;_0xf0bcf8=0xc8;}else{_0xf0bcf8=0xce;}_0x2998e6[_0x074a('0x1a')](_0xf0bcf8);return _0x2998e6[_0x074a('0x21')](_0x074a('0x22'),_0x2a9d51+'-'+_0x2c45d0+'/'+_0x5270d6)[_0x074a('0x1c')](_0x1a9c6b);}return null;};}function patchUpdates(_0x33cb40){return function(_0x172a31){try{jsonpatch[_0x074a('0x23')](_0x172a31,_0x33cb40,!![]);}catch(_0x33c46f){return BPromise['reject'](_0x33c46f);}return _0x172a31['save']();};}function saveUpdates(_0x230356,_0x2c7f7f){return function(_0x1b91ba){if(_0x1b91ba){return _0x1b91ba[_0x074a('0x24')](_0x230356)['then'](function(_0x13214a){return _0x13214a;});}return null;};}function removeEntity(_0x2a56cc,_0x39ce9c){return function(_0x39c1c0){if(_0x39c1c0){return _0x39c1c0[_0x074a('0x25')]()['then'](function(){_0x2a56cc[_0x074a('0x1a')](0xcc)[_0x074a('0x1b')]();});}};}function handleEntityNotFound(_0x21755e,_0x1f58f9){return function(_0x60233e){if(!_0x60233e){_0x21755e['sendStatus'](0x194);}return _0x60233e;};}function handleError(_0x284551,_0x1f2112){_0x1f2112=_0x1f2112||0x1f4;return function(_0x32cdad){logger[_0x074a('0x26')](_0x32cdad[_0x074a('0x27')]);if(_0x32cdad['name']){delete _0x32cdad['name'];}_0x284551[_0x074a('0x1a')](_0x1f2112)[_0x074a('0x28')](_0x32cdad);};}exports[_0x074a('0x29')]=function(_0x5c4b86,_0x1c7a85){var _0x424030={},_0x567e68={},_0x451457={'count':0x0,'rows':[]};var _0x33ba18=_[_0x074a('0x2a')](db[_0x074a('0x2b')]['rawAttributes'],function(_0x4ca52a){return{'name':_0x4ca52a[_0x074a('0x2c')],'type':_0x4ca52a[_0x074a('0x2d')][_0x074a('0x2e')]};});_0x567e68[_0x074a('0x2f')]=_[_0x074a('0x2a')](_0x33ba18,_0x074a('0x30'));_0x567e68[_0x074a('0x31')]=_[_0x074a('0x32')](_0x5c4b86[_0x074a('0x31')]);_0x567e68[_0x074a('0x33')]=_[_0x074a('0x34')](_0x567e68[_0x074a('0x2f')],_0x567e68['query']);_0x424030['attributes']=_['intersection'](_0x567e68[_0x074a('0x2f')],qs[_0x074a('0x35')](_0x5c4b86[_0x074a('0x31')][_0x074a('0x35')]));_0x424030['attributes']=_0x424030['attributes'][_0x074a('0x36')]?_0x424030[_0x074a('0x37')]:_0x567e68[_0x074a('0x2f')];if(!_0x5c4b86['query'][_0x074a('0x38')](_0x074a('0x39'))){_0x424030[_0x074a('0x1d')]=qs['limit'](_0x5c4b86[_0x074a('0x31')][_0x074a('0x1d')]);_0x424030[_0x074a('0x20')]=qs['offset'](_0x5c4b86[_0x074a('0x31')][_0x074a('0x20')]);}_0x424030[_0x074a('0x3a')]=qs[_0x074a('0x3b')](_0x5c4b86[_0x074a('0x31')][_0x074a('0x3b')]);_0x424030[_0x074a('0x3c')]=qs['filters'](_[_0x074a('0x3d')](_0x5c4b86[_0x074a('0x31')],_0x567e68[_0x074a('0x33')]),_0x33ba18);if(_0x5c4b86[_0x074a('0x31')][_0x074a('0x3e')]){_0x424030['where']=_['merge'](_0x424030[_0x074a('0x3c')],{'$or':_[_0x074a('0x2a')](_0x33ba18,function(_0x159a06){if(_0x159a06[_0x074a('0x2d')]!==_0x074a('0x3f')){var _0x5bd235={};_0x5bd235[_0x159a06[_0x074a('0x30')]]={'$like':'%'+_0x5c4b86[_0x074a('0x31')][_0x074a('0x3e')]+'%'};return _0x5bd235;}})});}_0x424030=_['merge']({},_0x424030,_0x5c4b86[_0x074a('0x40')]);var _0x391d0c={'where':_0x424030[_0x074a('0x3c')]};return db['VoiceQueuesLog']['count'](_0x391d0c)[_0x074a('0x41')](function(_0xb56e0b){_0x451457[_0x074a('0x1f')]=_0xb56e0b;if(_0x5c4b86['query'][_0x074a('0x42')]){_0x424030[_0x074a('0x43')]=[{'all':!![]}];}return db[_0x074a('0x2b')][_0x074a('0x44')](_0x424030);})[_0x074a('0x41')](function(_0x4ca20){_0x451457[_0x074a('0x45')]=_0x4ca20;return _0x451457;})['then'](respondWithFilteredResult(_0x1c7a85,_0x424030))[_0x074a('0x46')](handleError(_0x1c7a85,null));};exports['show']=function(_0x33291c,_0x23c856){var _0xe34c29={'raw':!![],'where':{'id':_0x33291c[_0x074a('0x47')]['id']}},_0x2a85fa={};_0x2a85fa[_0x074a('0x2f')]=_[_0x074a('0x32')](db['VoiceQueuesLog'][_0x074a('0x48')]);_0x2a85fa[_0x074a('0x31')]=_[_0x074a('0x32')](_0x33291c['query']);_0x2a85fa['filters']=_['intersection'](_0x2a85fa[_0x074a('0x2f')],_0x2a85fa['query']);_0xe34c29['attributes']=_[_0x074a('0x34')](_0x2a85fa[_0x074a('0x2f')],qs[_0x074a('0x35')](_0x33291c['query']['fields']));_0xe34c29[_0x074a('0x37')]=_0xe34c29[_0x074a('0x37')]['length']?_0xe34c29[_0x074a('0x37')]:_0x2a85fa[_0x074a('0x2f')];if(_0x33291c[_0x074a('0x31')][_0x074a('0x42')]){_0xe34c29[_0x074a('0x43')]=[{'all':!![]}];}_0xe34c29=_[_0x074a('0x49')]({},_0xe34c29,_0x33291c['options']);return db[_0x074a('0x2b')][_0x074a('0x4a')](_0xe34c29)['then'](handleEntityNotFound(_0x23c856,null))['then'](respondWithResult(_0x23c856,null))[_0x074a('0x46')](handleError(_0x23c856,null));};exports['create']=function(_0x285530,_0x3000a6){return db['VoiceQueuesLog'][_0x074a('0x4b')](_0x285530[_0x074a('0x4c')],{})[_0x074a('0x41')](respondWithResult(_0x3000a6,0xc9))[_0x074a('0x46')](handleError(_0x3000a6,null));};exports[_0x074a('0x24')]=function(_0x25c145,_0x5c0e2d){if(_0x25c145[_0x074a('0x4c')]['id']){delete _0x25c145['body']['id'];}return db[_0x074a('0x2b')][_0x074a('0x4a')]({'where':{'id':_0x25c145[_0x074a('0x47')]['id']}})[_0x074a('0x41')](handleEntityNotFound(_0x5c0e2d,null))['then'](saveUpdates(_0x25c145[_0x074a('0x4c')],null))[_0x074a('0x41')](respondWithResult(_0x5c0e2d,null))[_0x074a('0x46')](handleError(_0x5c0e2d,null));};exports[_0x074a('0x25')]=function(_0x387660,_0xf33b8b){return db[_0x074a('0x2b')][_0x074a('0x4a')]({'where':{'id':_0x387660['params']['id']}})['then'](handleEntityNotFound(_0xf33b8b,null))[_0x074a('0x41')](removeEntity(_0xf33b8b,null))[_0x074a('0x46')](handleError(_0xf33b8b,null));}; \ No newline at end of file +var _0x3069=['sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x5d7742,_0x4738e5){var _0x202be5=function(_0x4a9146){while(--_0x4a9146){_0x5d7742['push'](_0x5d7742['shift']());}};_0x202be5(++_0x4738e5);}(_0x3069,0x1d7));var _0x9306=function(_0x119ac4,_0x39e8a0){_0x119ac4=_0x119ac4-0x0;var _0x2b49a3=_0x3069[_0x119ac4];return _0x2b49a3;};'use strict';var emlformat=require(_0x9306('0x0'));var rimraf=require(_0x9306('0x1'));var zipdir=require(_0x9306('0x2'));var jsonpatch=require(_0x9306('0x3'));var rp=require(_0x9306('0x4'));var moment=require(_0x9306('0x5'));var BPromise=require(_0x9306('0x6'));var Mustache=require(_0x9306('0x7'));var util=require(_0x9306('0x8'));var path=require(_0x9306('0x9'));var sox=require('sox');var csv=require(_0x9306('0xa'));var ejs=require(_0x9306('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9306('0xc'));var squel=require(_0x9306('0xd'));var crypto=require('crypto');var jsforce=require(_0x9306('0xe'));var deskjs=require(_0x9306('0xf'));var toCsv=require(_0x9306('0xa'));var querystring=require(_0x9306('0x10'));var Papa=require(_0x9306('0x11'));var Redis=require('ioredis');var authService=require(_0x9306('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9306('0x13'));var hardwareService=require(_0x9306('0x14'));var logger=require('../../config/logger')(_0x9306('0x15'));var utils=require(_0x9306('0x16'));var config=require(_0x9306('0x17'));var licenseUtil=require(_0x9306('0x18'));var db=require(_0x9306('0x19'))['db'];function respondWithStatusCode(_0x2469be,_0x10e7a2){_0x10e7a2=_0x10e7a2||0xcc;return function(_0x471fa8){if(_0x471fa8){return _0x2469be[_0x9306('0x1a')](_0x10e7a2);}return _0x2469be[_0x9306('0x1b')](_0x10e7a2)['end']();};}function respondWithResult(_0x3a893e,_0x1745d1){_0x1745d1=_0x1745d1||0xc8;return function(_0x168ea2){if(_0x168ea2){return _0x3a893e[_0x9306('0x1b')](_0x1745d1)[_0x9306('0x1c')](_0x168ea2);}};}function respondWithFilteredResult(_0x49ff38,_0xd16277){return function(_0x3bb123){if(_0x3bb123){var _0x5d8755=typeof _0xd16277[_0x9306('0x1d')]===_0x9306('0x1e')&&typeof _0xd16277[_0x9306('0x1f')]===_0x9306('0x1e');var _0x407f10=_0x3bb123[_0x9306('0x20')];var _0xbed488=_0x5d8755?0x0:_0xd16277[_0x9306('0x1d')];var _0x8bc91c=_0x5d8755?_0x3bb123[_0x9306('0x20')]:_0xd16277[_0x9306('0x1d')]+_0xd16277[_0x9306('0x1f')];var _0x3f831a;if(_0x8bc91c>=_0x407f10){_0x8bc91c=_0x407f10;_0x3f831a=0xc8;}else{_0x3f831a=0xce;}_0x49ff38[_0x9306('0x1b')](_0x3f831a);return _0x49ff38['set'](_0x9306('0x21'),_0xbed488+'-'+_0x8bc91c+'/'+_0x407f10)[_0x9306('0x1c')](_0x3bb123);}return null;};}function patchUpdates(_0x372287){return function(_0xcc3a2e){try{jsonpatch[_0x9306('0x22')](_0xcc3a2e,_0x372287,!![]);}catch(_0x5724ba){return BPromise[_0x9306('0x23')](_0x5724ba);}return _0xcc3a2e[_0x9306('0x24')]();};}function saveUpdates(_0x43bcd5,_0x2eae10){return function(_0xab9995){if(_0xab9995){return _0xab9995[_0x9306('0x25')](_0x43bcd5)[_0x9306('0x26')](function(_0x3f3c91){return _0x3f3c91;});}return null;};}function removeEntity(_0x79cf38,_0x3152a6){return function(_0x18d31c){if(_0x18d31c){return _0x18d31c[_0x9306('0x27')]()[_0x9306('0x26')](function(){_0x79cf38['status'](0xcc)[_0x9306('0x28')]();});}};}function handleEntityNotFound(_0x2eed25,_0x20df94){return function(_0x7654ee){if(!_0x7654ee){_0x2eed25['sendStatus'](0x194);}return _0x7654ee;};}function handleError(_0x285355,_0x3a5180){_0x3a5180=_0x3a5180||0x1f4;return function(_0x4f44fd){logger[_0x9306('0x29')](_0x4f44fd[_0x9306('0x2a')]);if(_0x4f44fd[_0x9306('0x2b')]){delete _0x4f44fd[_0x9306('0x2b')];}_0x285355[_0x9306('0x1b')](_0x3a5180)[_0x9306('0x2c')](_0x4f44fd);};}exports[_0x9306('0x2d')]=function(_0x254192,_0x345ac5){var _0x33518b={},_0x5b167d={},_0x306d71={'count':0x0,'rows':[]};var _0x459aaf=_[_0x9306('0x2e')](db[_0x9306('0x2f')][_0x9306('0x30')],function(_0x5bd447){return{'name':_0x5bd447[_0x9306('0x31')],'type':_0x5bd447[_0x9306('0x32')]['key']};});_0x5b167d[_0x9306('0x33')]=_[_0x9306('0x2e')](_0x459aaf,_0x9306('0x2b'));_0x5b167d['query']=_[_0x9306('0x34')](_0x254192[_0x9306('0x35')]);_0x5b167d[_0x9306('0x36')]=_[_0x9306('0x37')](_0x5b167d['model'],_0x5b167d['query']);_0x33518b[_0x9306('0x38')]=_['intersection'](_0x5b167d[_0x9306('0x33')],qs[_0x9306('0x39')](_0x254192[_0x9306('0x35')][_0x9306('0x39')]));_0x33518b[_0x9306('0x38')]=_0x33518b[_0x9306('0x38')][_0x9306('0x3a')]?_0x33518b[_0x9306('0x38')]:_0x5b167d[_0x9306('0x33')];if(!_0x254192[_0x9306('0x35')][_0x9306('0x3b')](_0x9306('0x3c'))){_0x33518b[_0x9306('0x1f')]=qs['limit'](_0x254192[_0x9306('0x35')]['limit']);_0x33518b[_0x9306('0x1d')]=qs['offset'](_0x254192['query'][_0x9306('0x1d')]);}_0x33518b['order']=qs[_0x9306('0x3d')](_0x254192[_0x9306('0x35')][_0x9306('0x3d')]);_0x33518b[_0x9306('0x3e')]=qs[_0x9306('0x36')](_['pick'](_0x254192[_0x9306('0x35')],_0x5b167d[_0x9306('0x36')]),_0x459aaf);if(_0x254192[_0x9306('0x35')]['filter']){_0x33518b[_0x9306('0x3e')]=_[_0x9306('0x3f')](_0x33518b[_0x9306('0x3e')],{'$or':_[_0x9306('0x2e')](_0x459aaf,function(_0x176a8d){if(_0x176a8d[_0x9306('0x32')]!==_0x9306('0x40')){var _0x41d304={};_0x41d304[_0x176a8d[_0x9306('0x2b')]]={'$like':'%'+_0x254192[_0x9306('0x35')][_0x9306('0x41')]+'%'};return _0x41d304;}})});}_0x33518b=_[_0x9306('0x3f')]({},_0x33518b,_0x254192[_0x9306('0x42')]);var _0x16242a={'where':_0x33518b[_0x9306('0x3e')]};return db[_0x9306('0x2f')]['count'](_0x16242a)[_0x9306('0x26')](function(_0x490993){_0x306d71[_0x9306('0x20')]=_0x490993;if(_0x254192[_0x9306('0x35')][_0x9306('0x43')]){_0x33518b[_0x9306('0x44')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x9306('0x45')](_0x33518b);})['then'](function(_0x450d71){_0x306d71['rows']=_0x450d71;return _0x306d71;})[_0x9306('0x26')](respondWithFilteredResult(_0x345ac5,_0x33518b))[_0x9306('0x46')](handleError(_0x345ac5,null));};exports[_0x9306('0x47')]=function(_0x567a69,_0x2a609c){var _0x594649={'raw':!![],'where':{'id':_0x567a69['params']['id']}},_0x1b5324={};_0x1b5324[_0x9306('0x33')]=_[_0x9306('0x34')](db['VoiceQueuesLog'][_0x9306('0x30')]);_0x1b5324[_0x9306('0x35')]=_[_0x9306('0x34')](_0x567a69['query']);_0x1b5324[_0x9306('0x36')]=_[_0x9306('0x37')](_0x1b5324[_0x9306('0x33')],_0x1b5324[_0x9306('0x35')]);_0x594649[_0x9306('0x38')]=_[_0x9306('0x37')](_0x1b5324[_0x9306('0x33')],qs[_0x9306('0x39')](_0x567a69[_0x9306('0x35')][_0x9306('0x39')]));_0x594649[_0x9306('0x38')]=_0x594649['attributes']['length']?_0x594649[_0x9306('0x38')]:_0x1b5324['model'];if(_0x567a69[_0x9306('0x35')][_0x9306('0x43')]){_0x594649[_0x9306('0x44')]=[{'all':!![]}];}_0x594649=_[_0x9306('0x3f')]({},_0x594649,_0x567a69[_0x9306('0x42')]);return db[_0x9306('0x2f')]['find'](_0x594649)[_0x9306('0x26')](handleEntityNotFound(_0x2a609c,null))[_0x9306('0x26')](respondWithResult(_0x2a609c,null))['catch'](handleError(_0x2a609c,null));};exports[_0x9306('0x48')]=function(_0x206a59,_0x1d1319){return db['VoiceQueuesLog'][_0x9306('0x48')](_0x206a59['body'],{})[_0x9306('0x26')](respondWithResult(_0x1d1319,0xc9))[_0x9306('0x46')](handleError(_0x1d1319,null));};exports[_0x9306('0x25')]=function(_0x1f888f,_0x228bed){if(_0x1f888f[_0x9306('0x49')]['id']){delete _0x1f888f[_0x9306('0x49')]['id'];}return db[_0x9306('0x2f')][_0x9306('0x4a')]({'where':{'id':_0x1f888f[_0x9306('0x4b')]['id']}})[_0x9306('0x26')](handleEntityNotFound(_0x228bed,null))[_0x9306('0x26')](saveUpdates(_0x1f888f['body'],null))[_0x9306('0x26')](respondWithResult(_0x228bed,null))['catch'](handleError(_0x228bed,null));};exports[_0x9306('0x27')]=function(_0x1fa418,_0x1b5e46){return db[_0x9306('0x2f')][_0x9306('0x4a')]({'where':{'id':_0x1fa418['params']['id']}})[_0x9306('0x26')](handleEntityNotFound(_0x1b5e46,null))['then'](removeEntity(_0x1b5e46,null))[_0x9306('0x46')](handleError(_0x1b5e46,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 4deecd5..2ba6112 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 _0x684d=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','VoiceQueuesLog','voice_queues_log','event_dtm','dtm'];(function(_0x3d69a5,_0x4a3ace){var _0x1a7038=function(_0x169d8b){while(--_0x169d8b){_0x3d69a5['push'](_0x3d69a5['shift']());}};_0x1a7038(++_0x4a3ace);}(_0x684d,0x174));var _0xd684=function(_0x45059a,_0x4e003a){_0x45059a=_0x45059a-0x0;var _0x37838e=_0x684d[_0x45059a];return _0x37838e;};'use strict';var _=require('lodash');var util=require(_0xd684('0x0'));var logger=require(_0xd684('0x1'))(_0xd684('0x2'));var moment=require('moment');var BPromise=require(_0xd684('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd684('0x4'));var rimraf=require(_0xd684('0x5'));var config=require(_0xd684('0x6'));var attributes=require('./voiceQueuesLog.attributes');module[_0xd684('0x7')]=function(_0x5f50ac,_0x3bf907){return _0x5f50ac['define'](_0xd684('0x8'),attributes,{'tableName':_0xd684('0x9'),'paranoid':![],'indexes':[{'name':_0xd684('0xa'),'fields':['event',_0xd684('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3d1b=['dtm','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','voice_queues_log','event_dtm','event'];(function(_0x4f67f1,_0x3d02bf){var _0x52c611=function(_0x2ff881){while(--_0x2ff881){_0x4f67f1['push'](_0x4f67f1['shift']());}};_0x52c611(++_0x3d02bf);}(_0x3d1b,0xb7));var _0xb3d1=function(_0x5dda44,_0x40b720){_0x5dda44=_0x5dda44-0x0;var _0x25506a=_0x3d1b[_0x5dda44];return _0x25506a;};'use strict';var _=require(_0xb3d1('0x0'));var util=require(_0xb3d1('0x1'));var logger=require(_0xb3d1('0x2'))(_0xb3d1('0x3'));var moment=require('moment');var BPromise=require(_0xb3d1('0x4'));var rp=require(_0xb3d1('0x5'));var fs=require('fs');var path=require(_0xb3d1('0x6'));var rimraf=require(_0xb3d1('0x7'));var config=require(_0xb3d1('0x8'));var attributes=require('./voiceQueuesLog.attributes');module[_0xb3d1('0x9')]=function(_0x57e99a,_0x527560){return _0x57e99a['define']('VoiceQueuesLog',attributes,{'tableName':_0xb3d1('0xa'),'paranoid':![],'indexes':[{'name':_0xb3d1('0xb'),'fields':[_0xb3d1('0xc'),_0xb3d1('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 7d5df82..2bf75a8 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 _0x0be7=['stringify','error','code','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x0be7,0xc4));var _0x70be=function(_0x53c1a6,_0x19ee54){_0x53c1a6=_0x53c1a6-0x0;var _0x261fd3=_0x0be7[_0x53c1a6];return _0x261fd3;};'use strict';var _=require('lodash');var util=require(_0x70be('0x0'));var moment=require('moment');var BPromise=require(_0x70be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70be('0x2'));var db=require(_0x70be('0x3'))['db'];var utils=require(_0x70be('0x4'));var logger=require(_0x70be('0x5'))(_0x70be('0x6'));var config=require(_0x70be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x70be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8b00,_0x5a8b51,_0x352f03){return new BPromise(function(_0x23373d,_0x11aa1a){return client[_0x70be('0x9')](_0xe8b00,_0x352f03)[_0x70be('0xa')](function(_0x5940c2){logger['info'](_0x70be('0xb'),_0x5a8b51,_0x70be('0xc'));logger[_0x70be('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5a8b51,_0x70be('0xc'),JSON[_0x70be('0xe')](_0x5940c2));if(_0x5940c2[_0x70be('0xf')]){if(_0x5940c2['error'][_0x70be('0x10')]===0x1f4){logger[_0x70be('0xf')](_0x70be('0xb'),_0x5a8b51,_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);return _0x11aa1a(_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);}logger[_0x70be('0xf')](_0x70be('0xb'),_0x5a8b51,_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);return _0x23373d(_0x5940c2[_0x70be('0xf')][_0x70be('0x11')]);}else{logger[_0x70be('0x12')](_0x70be('0xb'),_0x5a8b51,'request\x20sent');_0x23373d(_0x5940c2[_0x70be('0x13')][_0x70be('0x11')]);}})[_0x70be('0x14')](function(_0x56e261){logger['error'](_0x70be('0xb'),_0x5a8b51,_0x56e261);_0x11aa1a(_0x56e261);});});} \ No newline at end of file +var _0xb7f1=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x1cfad8,_0x1a5444){var _0x1e3f35=function(_0x11620d){while(--_0x11620d){_0x1cfad8['push'](_0x1cfad8['shift']());}};_0x1e3f35(++_0x1a5444);}(_0xb7f1,0xdc));var _0x1b7f=function(_0x3dba2d,_0x54e044){_0x3dba2d=_0x3dba2d-0x0;var _0x5371dc=_0xb7f1[_0x3dba2d];return _0x5371dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b7f('0x0'));var BPromise=require(_0x1b7f('0x1'));var rs=require(_0x1b7f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b7f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b7f('0x4'));var config=require(_0x1b7f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1b7f('0x6')][_0x1b7f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b58f7,_0x6c9f9,_0x34213c){return new BPromise(function(_0x4dda12,_0x16935b){return client[_0x1b7f('0x8')](_0x2b58f7,_0x34213c)[_0x1b7f('0x9')](function(_0x1ee997){logger[_0x1b7f('0xa')](_0x1b7f('0xb'),_0x6c9f9,_0x1b7f('0xc'));logger['debug'](_0x1b7f('0xd'),_0x6c9f9,'request\x20sent',JSON['stringify'](_0x1ee997));if(_0x1ee997[_0x1b7f('0xe')]){if(_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0xf')]===0x1f4){logger[_0x1b7f('0xe')](_0x1b7f('0xb'),_0x6c9f9,_0x1ee997[_0x1b7f('0xe')]['message']);return _0x16935b(_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0x10')]);}logger[_0x1b7f('0xe')](_0x1b7f('0xb'),_0x6c9f9,_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0x10')]);return _0x4dda12(_0x1ee997[_0x1b7f('0xe')][_0x1b7f('0x10')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x6c9f9,_0x1b7f('0xc'));_0x4dda12(_0x1ee997[_0x1b7f('0x11')]['message']);}})[_0x1b7f('0x12')](function(_0x45735f){logger[_0x1b7f('0xe')](_0x1b7f('0xb'),_0x6c9f9,_0x45735f);_0x16935b(_0x45735f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1beed49..7a23a9e 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 _0xe221=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','delete','multer','util'];(function(_0x5d5d37,_0x2ae286){var _0x2fd5c0=function(_0x340067){while(--_0x340067){_0x5d5d37['push'](_0x5d5d37['shift']());}};_0x2fd5c0(++_0x2ae286);}(_0xe221,0x17e));var _0x1e22=function(_0x52fc4a,_0x594288){_0x52fc4a=_0x52fc4a-0x0;var _0x51a067=_0xe221[_0x52fc4a];return _0x51a067;};'use strict';var multer=require(_0x1e22('0x0'));var util=require(_0x1e22('0x1'));var path=require('path');var timeout=require(_0x1e22('0x2'));var express=require(_0x1e22('0x3'));var router=express[_0x1e22('0x4')]();var fs_extra=require(_0x1e22('0x5'));var auth=require(_0x1e22('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e22('0x7'));var controller=require('./voiceRecording.controller');router[_0x1e22('0x8')]('/',auth[_0x1e22('0x9')](),controller[_0x1e22('0xa')]);router[_0x1e22('0x8')](_0x1e22('0xb'),auth[_0x1e22('0x9')](),controller[_0x1e22('0xc')]);router[_0x1e22('0x8')]('/:id',auth[_0x1e22('0x9')](),controller[_0x1e22('0xd')]);router['get']('/:id/download',auth[_0x1e22('0x9')](),controller[_0x1e22('0xe')]);router[_0x1e22('0x8')](_0x1e22('0xf'),controller[_0x1e22('0x10')]);router[_0x1e22('0x8')](_0x1e22('0x11'),auth[_0x1e22('0x9')](),controller[_0x1e22('0x12')]);router[_0x1e22('0x13')]('/',auth[_0x1e22('0x9')](),controller[_0x1e22('0x14')]);router[_0x1e22('0x13')](_0x1e22('0x11'),auth[_0x1e22('0x9')](),controller[_0x1e22('0x15')]);router['put']('/:id',auth[_0x1e22('0x9')](),controller[_0x1e22('0x16')]);router[_0x1e22('0x17')]('/:id',auth[_0x1e22('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x49bc=['isAuthenticated','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','runTranscribe','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceRecording.controller','get','index','/describe'];(function(_0x46c836,_0x30019f){var _0x4da8d1=function(_0x5ecb56){while(--_0x5ecb56){_0x46c836['push'](_0x46c836['shift']());}};_0x4da8d1(++_0x30019f);}(_0x49bc,0xbc));var _0xc49b=function(_0x1f1c2d,_0x140a00){_0x1f1c2d=_0x1f1c2d-0x0;var _0x341b65=_0x49bc[_0x1f1c2d];return _0x341b65;};'use strict';var multer=require(_0xc49b('0x0'));var util=require(_0xc49b('0x1'));var path=require(_0xc49b('0x2'));var timeout=require(_0xc49b('0x3'));var express=require(_0xc49b('0x4'));var router=express[_0xc49b('0x5')]();var fs_extra=require(_0xc49b('0x6'));var auth=require(_0xc49b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc49b('0x8'));router[_0xc49b('0x9')]('/',auth['isAuthenticated'](),controller[_0xc49b('0xa')]);router[_0xc49b('0x9')](_0xc49b('0xb'),auth[_0xc49b('0xc')](),controller['describe']);router[_0xc49b('0x9')](_0xc49b('0xd'),auth[_0xc49b('0xc')](),controller[_0xc49b('0xe')]);router[_0xc49b('0x9')](_0xc49b('0xf'),auth['isAuthenticated'](),controller[_0xc49b('0x10')]);router[_0xc49b('0x9')](_0xc49b('0x11'),controller[_0xc49b('0x12')]);router[_0xc49b('0x9')]('/:id/transcribe',auth[_0xc49b('0xc')](),controller[_0xc49b('0x13')]);router['post']('/',auth[_0xc49b('0xc')](),controller['create']);router['post']('/:id/transcribe',auth['isAuthenticated'](),controller[_0xc49b('0x14')]);router[_0xc49b('0x15')](_0xc49b('0xd'),auth[_0xc49b('0xc')](),controller[_0xc49b('0x16')]);router[_0xc49b('0x17')](_0xc49b('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc49b('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index c7a0ea9..dcbdc0b 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(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 05f0544..f7a9300 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 _0x28c6=['Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','includeAll','include','VoiceRecording','findAll','rows','catch','show','params','merge','create','body','find','describe','download','uniqueid','format','%s.cypher','existsSync','value','Sequelize','ValidationError','filename','extname','unlink','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','MD5','token','$and','push','decryptFile','secrets','recording','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Buckets'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x28c6,0xa6));var _0x628c=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x28c6[_0x4e55a9];return _0x4a9b67;};'use strict';var emlformat=require(_0x628c('0x0'));var rimraf=require(_0x628c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x628c('0x2'));var moment=require('moment');var BPromise=require(_0x628c('0x3'));var Mustache=require(_0x628c('0x4'));var util=require(_0x628c('0x5'));var path=require('path');var sox=require(_0x628c('0x6'));var csv=require(_0x628c('0x7'));var ejs=require(_0x628c('0x8'));var fs=require('fs');var fs_extra=require(_0x628c('0x9'));var _=require(_0x628c('0xa'));var squel=require('squel');var crypto=require(_0x628c('0xb'));var jsforce=require(_0x628c('0xc'));var deskjs=require(_0x628c('0xd'));var toCsv=require(_0x628c('0x7'));var querystring=require(_0x628c('0xe'));var Papa=require(_0x628c('0xf'));var AWS=require(_0x628c('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0x628c('0x11'));var authService=require(_0x628c('0x12'));var qs=require(_0x628c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x628c('0x14'));var logger=require(_0x628c('0x15'))(_0x628c('0x16'));var utils=require('../../config/utils');var config=require(_0x628c('0x17'));var licenseUtil=require(_0x628c('0x18'));var db=require(_0x628c('0x19'))['db'];function respondWithStatusCode(_0x5c608c,_0x25ae5e){_0x25ae5e=_0x25ae5e||0xcc;return function(_0x138593){if(_0x138593){return _0x5c608c[_0x628c('0x1a')](_0x25ae5e);}return _0x5c608c[_0x628c('0x1b')](_0x25ae5e)['end']();};}function respondWithResult(_0x3dd829,_0x4a2c5b){_0x4a2c5b=_0x4a2c5b||0xc8;return function(_0x226cb5){if(_0x226cb5){return _0x3dd829[_0x628c('0x1b')](_0x4a2c5b)[_0x628c('0x1c')](_0x226cb5);}};}function respondWithFilteredResult(_0x14bc9c,_0x4280c5){return function(_0x10dcb1){if(_0x10dcb1){var _0x53b2fc=typeof _0x4280c5[_0x628c('0x1d')]===_0x628c('0x1e')&&typeof _0x4280c5[_0x628c('0x1f')]===_0x628c('0x1e');var _0x467108=_0x10dcb1[_0x628c('0x20')];var _0x28344b=_0x53b2fc?0x0:_0x4280c5['offset'];var _0x37743c=_0x53b2fc?_0x10dcb1[_0x628c('0x20')]:_0x4280c5[_0x628c('0x1d')]+_0x4280c5[_0x628c('0x1f')];var _0x68fa4f;if(_0x37743c>=_0x467108){_0x37743c=_0x467108;_0x68fa4f=0xc8;}else{_0x68fa4f=0xce;}_0x14bc9c[_0x628c('0x1b')](_0x68fa4f);return _0x14bc9c[_0x628c('0x21')]('Content-Range',_0x28344b+'-'+_0x37743c+'/'+_0x467108)[_0x628c('0x1c')](_0x10dcb1);}return null;};}function patchUpdates(_0x428603){return function(_0x5df680){try{jsonpatch[_0x628c('0x22')](_0x5df680,_0x428603,!![]);}catch(_0x1aec50){return BPromise[_0x628c('0x23')](_0x1aec50);}return _0x5df680[_0x628c('0x24')]();};}function saveUpdates(_0x7221af,_0x118289){return function(_0x5d99b4){if(_0x5d99b4){return _0x5d99b4[_0x628c('0x25')](_0x7221af)[_0x628c('0x26')](function(_0x3921f1){return _0x3921f1;});}return null;};}function removeEntity(_0x12da9a,_0x52d488){return function(_0x3fa217){if(_0x3fa217){return _0x3fa217[_0x628c('0x27')]()[_0x628c('0x26')](function(){_0x12da9a[_0x628c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3274a7,_0x54d7fb){return function(_0x443a9b){if(!_0x443a9b){_0x3274a7[_0x628c('0x1a')](0x194);}return _0x443a9b;};}function handleError(_0x7edf00,_0x5b2324){_0x5b2324=_0x5b2324||0x1f4;return function(_0x3af09e){logger[_0x628c('0x28')](_0x3af09e['stack']);if(_0x3af09e[_0x628c('0x29')]){delete _0x3af09e[_0x628c('0x29')];}_0x7edf00['status'](_0x5b2324)[_0x628c('0x2a')](_0x3af09e);};}exports[_0x628c('0x2b')]=function(_0x3b77e1,_0x3776dd){var _0x1f2667={},_0x20ff45={},_0x37e85b={'count':0x0,'rows':[]};var _0x3a8e49=_[_0x628c('0x2c')](db['VoiceRecording'][_0x628c('0x2d')],function(_0x3341b2){return{'name':_0x3341b2[_0x628c('0x2e')],'type':_0x3341b2['type'][_0x628c('0x2f')]};});_0x20ff45['model']=_[_0x628c('0x30')](_[_0x628c('0x2c')](_0x3a8e49,_0x628c('0x29')),['format']);_0x20ff45[_0x628c('0x31')]=_[_0x628c('0x32')](_0x3b77e1[_0x628c('0x31')]);_0x20ff45[_0x628c('0x33')]=_[_0x628c('0x34')](_0x20ff45[_0x628c('0x35')],_0x20ff45[_0x628c('0x31')]);_0x1f2667[_0x628c('0x36')]=_[_0x628c('0x34')](_0x20ff45['model'],qs[_0x628c('0x37')](_0x3b77e1[_0x628c('0x31')][_0x628c('0x37')]));_0x1f2667[_0x628c('0x36')]=_0x1f2667['attributes'][_0x628c('0x38')]?_0x1f2667['attributes']:_0x20ff45[_0x628c('0x35')];if(!_0x3b77e1['query']['hasOwnProperty'](_0x628c('0x39'))){_0x1f2667['limit']=qs['limit'](_0x3b77e1[_0x628c('0x31')][_0x628c('0x1f')]);_0x1f2667[_0x628c('0x1d')]=qs[_0x628c('0x1d')](_0x3b77e1[_0x628c('0x31')]['offset']);}_0x1f2667[_0x628c('0x3a')]=qs[_0x628c('0x3b')](_0x3b77e1[_0x628c('0x31')][_0x628c('0x3b')]);_0x1f2667['where']=qs[_0x628c('0x33')](_[_0x628c('0x3c')](_0x3b77e1[_0x628c('0x31')],_0x20ff45['filters']),_0x3a8e49);if(_0x3b77e1[_0x628c('0x31')]['filter']){_0x1f2667[_0x628c('0x3d')]=_['merge'](_0x1f2667[_0x628c('0x3d')],{'$or':_['map'](_0x3a8e49,function(_0x57ab1f){if(_0x57ab1f[_0x628c('0x3e')]!==_0x628c('0x3f')){var _0xee142={};_0xee142[_0x57ab1f[_0x628c('0x29')]]={'$like':'%'+_0x3b77e1['query'][_0x628c('0x40')]+'%'};return _0xee142;}})});}_0x1f2667=_['merge']({},_0x1f2667,_0x3b77e1[_0x628c('0x41')]);var _0x89df23={'where':_0x1f2667[_0x628c('0x3d')]};return db['VoiceRecording'][_0x628c('0x20')](_0x89df23)[_0x628c('0x26')](function(_0x1c4acf){_0x37e85b[_0x628c('0x20')]=_0x1c4acf;if(_0x3b77e1[_0x628c('0x31')][_0x628c('0x42')]){_0x1f2667[_0x628c('0x43')]=[{'all':!![]}];}return db[_0x628c('0x44')][_0x628c('0x45')](_0x1f2667);})[_0x628c('0x26')](function(_0x12e137){_0x37e85b[_0x628c('0x46')]=_0x12e137;return _0x37e85b;})[_0x628c('0x26')](respondWithFilteredResult(_0x3776dd,_0x1f2667))[_0x628c('0x47')](handleError(_0x3776dd,null));};exports[_0x628c('0x48')]=function(_0x5c54d1,_0x5240ea){var _0x34e573={'raw':![],'where':{'id':_0x5c54d1[_0x628c('0x49')]['id']}},_0x43a600={};_0x43a600[_0x628c('0x35')]=_[_0x628c('0x32')](db['VoiceRecording'][_0x628c('0x2d')]);_0x43a600[_0x628c('0x31')]=_[_0x628c('0x32')](_0x5c54d1['query']);_0x43a600[_0x628c('0x33')]=_[_0x628c('0x34')](_0x43a600[_0x628c('0x35')],_0x43a600[_0x628c('0x31')]);_0x34e573[_0x628c('0x36')]=_[_0x628c('0x34')](_0x43a600['model'],qs['fields'](_0x5c54d1[_0x628c('0x31')][_0x628c('0x37')]));_0x34e573['attributes']=_0x34e573[_0x628c('0x36')][_0x628c('0x38')]?_0x34e573[_0x628c('0x36')]:_0x43a600[_0x628c('0x35')];if(_0x5c54d1[_0x628c('0x31')][_0x628c('0x42')]){_0x34e573[_0x628c('0x43')]=[{'all':!![]}];}_0x34e573=_[_0x628c('0x4a')]({},_0x34e573,_0x5c54d1[_0x628c('0x41')]);return db['VoiceRecording']['find'](_0x34e573)[_0x628c('0x26')](handleEntityNotFound(_0x5240ea,null))[_0x628c('0x26')](respondWithResult(_0x5240ea,null))['catch'](handleError(_0x5240ea,null));};exports[_0x628c('0x4b')]=function(_0x5b8991,_0x706196){return db[_0x628c('0x44')]['create'](_0x5b8991['body'],{})[_0x628c('0x26')](respondWithResult(_0x706196,0xc9))['catch'](handleError(_0x706196,null));};exports[_0x628c('0x25')]=function(_0x5c7ee8,_0x3749bf){if(_0x5c7ee8['body']['id']){delete _0x5c7ee8[_0x628c('0x4c')]['id'];}return db[_0x628c('0x44')][_0x628c('0x4d')]({'where':{'id':_0x5c7ee8[_0x628c('0x49')]['id']}})[_0x628c('0x26')](handleEntityNotFound(_0x3749bf,null))[_0x628c('0x26')](saveUpdates(_0x5c7ee8[_0x628c('0x4c')],null))[_0x628c('0x26')](respondWithResult(_0x3749bf,null))[_0x628c('0x47')](handleError(_0x3749bf,null));};exports[_0x628c('0x4e')]=function(_0x545ceb,_0x5c5a5f){return db[_0x628c('0x44')][_0x628c('0x4e')]()['then'](respondWithResult(_0x5c5a5f,null))[_0x628c('0x47')](handleError(_0x5c5a5f,null));};exports[_0x628c('0x4f')]=function(_0x1a5251,_0x53a7cc,_0x2e0bba){var _0xc51ef1=require('../../components/encryptor');var _0x2bb8bb=![];var _0xe126ea={};if(_0x1a5251[_0x628c('0x31')][_0x628c('0x3e')]&&_0x1a5251[_0x628c('0x31')]['type']==='uniqueid'){_0xe126ea[_0x628c('0x50')]=_0x1a5251[_0x628c('0x49')]['id'];}else{_0xe126ea['id']=_0x1a5251['params']['id'];}return db[_0x628c('0x44')][_0x628c('0x4d')]({'where':_0xe126ea,'attributes':['id','value'],'raw':!![]})[_0x628c('0x26')](handleEntityNotFound(_0x53a7cc,null))[_0x628c('0x26')](function(_0x2acc46){if(_0x2acc46){var _0x3487cd=_0x2acc46['value'];var _0x2bc17d=util[_0x628c('0x51')](_0x628c('0x52'),_0x3487cd);if(fs[_0x628c('0x53')](_0x2bc17d)){_0x2bb8bb=!![];return _0xc51ef1['decryptFile'](_0x2bc17d,_0x3487cd,config['secrets']['recording'])['then'](function(){return _0x2acc46;});}return _0x2acc46;}})[_0x628c('0x26')](function(_0x2ce92d){if(_0x2ce92d){var _0x344df2=_0x2ce92d[_0x628c('0x54')];if(!fs[_0x628c('0x53')](_0x344df2)){throw new db[(_0x628c('0x55'))][(_0x628c('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x2ce92d[_0x628c('0x57')]){return _0x53a7cc[_0x628c('0x4f')](_0x344df2,_0x2ce92d[_0x628c('0x57')]+path[_0x628c('0x58')](_0x344df2),function(){if(_0x2bb8bb){fs[_0x628c('0x59')](_0x344df2);}});}else{return _0x53a7cc['download'](_0x344df2,function(_0x2d329e){if(_0x2bb8bb){fs[_0x628c('0x59')](_0x344df2);}});}}})[_0x628c('0x47')](function(_0x4681dd){if(_0x4681dd['message']===_0x628c('0x5a')){_0x53a7cc['status'](0x194)[_0x628c('0x2a')](_0x628c('0x5b'));}else{return handleError(_0x53a7cc,null);}});};exports[_0x628c('0x5c')]=function(_0x4019a5,_0x26e731,_0x5daf83){var _0xf2ef16=require(_0x628c('0x5d'));var _0x387470=![];var _0x235418={'$and':[db['sequelize']['where'](db['sequelize']['fn'](_0x628c('0x5e'),db['sequelize']['col'](_0x628c('0x50'))),_0x4019a5[_0x628c('0x31')][_0x628c('0x5f')])]};if(_0x4019a5['query'][_0x628c('0x3e')]&&_0x4019a5['query'][_0x628c('0x3e')]==='uniqueid'){_0x235418['$and']['push']({'uniqueid':_0x4019a5[_0x628c('0x49')]['id']});}else{_0x235418[_0x628c('0x60')][_0x628c('0x61')]({'id':_0x4019a5['params']['id']});}return db[_0x628c('0x44')][_0x628c('0x4d')]({'where':_0x235418,'attributes':['id','value'],'raw':!![]})[_0x628c('0x26')](handleEntityNotFound(_0x26e731,null))[_0x628c('0x26')](function(_0x320ae7){if(_0x320ae7){var _0x1955d0=util[_0x628c('0x51')]('%s.cypher',_0x320ae7[_0x628c('0x54')]);if(fs[_0x628c('0x53')](_0x1955d0)){_0x387470=!![];return _0xf2ef16[_0x628c('0x62')](_0x1955d0,_0x320ae7[_0x628c('0x54')],config[_0x628c('0x63')][_0x628c('0x64')])[_0x628c('0x26')](function(){return _0x320ae7;});}return _0x320ae7;}})[_0x628c('0x26')](function(_0x2d7eb2){if(_0x2d7eb2){if(!fs['existsSync'](_0x2d7eb2[_0x628c('0x54')])){throw new db[(_0x628c('0x55'))][(_0x628c('0x56'))](_0x628c('0x5a'));}if(_0x2d7eb2[_0x628c('0x57')]){return _0x26e731['download'](_0x2d7eb2['value'],_0x2d7eb2[_0x628c('0x57')]+path[_0x628c('0x58')](_0x2d7eb2[_0x628c('0x54')]),function(){if(_0x387470){fs[_0x628c('0x59')](_0x2d7eb2[_0x628c('0x54')]);}});}else{return _0x26e731[_0x628c('0x4f')](_0x2d7eb2[_0x628c('0x54')],function(_0x5d543e){if(_0x387470){fs[_0x628c('0x59')](_0x2d7eb2['value']);}});}}})['catch'](handleError(_0x26e731,null));};exports[_0x628c('0x27')]=function(_0x171381,_0x782e56){return db[_0x628c('0x44')][_0x628c('0x4d')]({'where':{'id':_0x171381[_0x628c('0x49')]['id']}})[_0x628c('0x26')](function(_0x125cb4){if(_[_0x628c('0x65')](_0x125cb4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x125cb4;})[_0x628c('0x26')](function(_0x52a75f){var _0x360392=_0x52a75f[_0x628c('0x54')];logger[_0x628c('0x66')](_0x628c('0x67'),_0x360392);if(!_[_0x628c('0x65')](_0x52a75f['value'])&&fs[_0x628c('0x53')](_0x360392)){logger['info'](_0x628c('0x68')+_0x360392+_0x628c('0x69'));fs[_0x628c('0x6a')](_0x360392);}_0x360392=_0x360392+'.cypher';if(!_[_0x628c('0x65')](_0x52a75f['value'])&&fs[_0x628c('0x53')](_0x360392)){logger[_0x628c('0x66')](_0x628c('0x68')+_0x360392+_0x628c('0x69'));fs[_0x628c('0x6a')](_0x360392);}return _0x52a75f;})[_0x628c('0x26')](function(_0x418aa2){if(!_0x418aa2)throw new InternalError();return _0x418aa2[_0x628c('0x27')]();})[_0x628c('0x26')](function(){_0x782e56[_0x628c('0x1b')](0xcc)[_0x628c('0x6b')]();})[_0x628c('0x47')](handleError(_0x782e56,null));};function getBucketslist(_0x2a82ce,_0x375ef7,_0x565a42){return new Promise(function(_0x58f902,_0x551568){var _0x2cad69=new AWS['S3']({'accessKeyId':_0x375ef7,'secretAccessKey':_0x2a82ce,'region':_0x565a42});_0x2cad69[_0x628c('0x6c')]({},function(_0x2c8d8b,_0x51f753){if(_0x2c8d8b){return _0x551568(_0x2c8d8b);}else{return _0x58f902(_0x51f753);}});});}function createBucket(_0x3b8af5,_0x469618,_0xd89399,_0x472150){return new Promise(function(_0x5f2320,_0x149659){var _0x2a1edb=new AWS['S3']({'accessKeyId':_0x469618,'secretAccessKey':_0x3b8af5,'region':_0xd89399});_0x2a1edb['createBucket']({'Bucket':_0x472150},function(_0x10a973,_0xf13738){if(_0x10a973){return _0x149659(_0x10a973);}else{return _0x5f2320(_0xf13738);}});});}function uploadFile(_0x50adda,_0x237708,_0x3159d7,_0x3d9942,_0x3f2d15,_0x1007be){return new Promise(function(_0x1ec299,_0x239646){var _0x141fe2=new AWS['S3']({'accessKeyId':_0x237708,'secretAccessKey':_0x50adda,'region':_0x3159d7});_0x141fe2[_0x628c('0x6d')]({'Bucket':_0x3d9942,'Key':_0x3f2d15,'Body':_0x1007be},function(_0xb0d2f8,_0x5090b4){if(_0xb0d2f8){return _0x239646(_0xb0d2f8);}else{return _0x1ec299(_0x5090b4);}});});}function startTranscribe(_0x43efc0,_0x5f3a7b,_0xa8f011,_0x4126a8,_0xe9ea50,_0x73d324){return new Promise(function(_0x55b23f,_0x396edd){var _0x513f5f=new AWS[(_0x628c('0x6e'))]({'accessKeyId':_0x5f3a7b,'secretAccessKey':_0x43efc0,'region':_0xa8f011});_0x513f5f[_0x628c('0x6f')]({'TranscriptionJobName':_0x4126a8,'LanguageCode':_0xe9ea50,'Media':{'MediaFileUri':_0x73d324}},function(_0x50ccbf,_0x2cba64){if(_0x50ccbf){return _0x396edd(_0x50ccbf);}else{return _0x55b23f(_0x2cba64);}});});}function transcribe(_0x41252c,_0x4b5d70,_0x4a9a28,_0x4f778f,_0x5532d8,_0xa1f47c,_0x1f6ac1){return new Promise(function(_0x3e2483,_0x4dc822){var _0x4badf5={};logger[_0x628c('0x66')](util[_0x628c('0x51')](_0x628c('0x70'),_0x41252c,_0x5532d8));return uploadFile(_0x4b5d70,_0x4a9a28,_0x4f778f,_0x5532d8,path['basename'](_0xa1f47c),fs['readFileSync'](_0xa1f47c))[_0x628c('0x26')](function(_0x160843){logger[_0x628c('0x66')](util[_0x628c('0x51')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x41252c,_0x5532d8,_0x160843[_0x628c('0x71')]));_0x4badf5[_0x628c('0x72')]=_0x160843[_0x628c('0x73')];_0x4badf5[_0x628c('0x74')]=_0x160843[_0x628c('0x71')];logger['info'](util['format'](_0x628c('0x75'),_0x41252c));return startTranscribe(_0x4b5d70,_0x4a9a28,_0x4f778f,uuidv4(),_0x1f6ac1,_0x160843[_0x628c('0x71')]);})[_0x628c('0x26')](function(_0x31269d){logger[_0x628c('0x66')](util['format'](_0x628c('0x76'),_0x41252c,_0x31269d[_0x628c('0x77')][_0x628c('0x78')]));_0x4badf5['transcribeName']=_0x31269d[_0x628c('0x77')][_0x628c('0x78')];_0x4badf5[_0x628c('0x79')]=_0x31269d['TranscriptionJob'][_0x628c('0x7a')];return _0x3e2483(_0x4badf5);})[_0x628c('0x47')](function(_0x3494ca){return _0x4dc822(_0x3494ca);});});}exports[_0x628c('0x7b')]=function(_0x30371f,_0x156806,_0x5c4527){var _0x190e99;var _0x2a7952;var _0x5d5011;var _0x38b46b=require(_0x628c('0x5d'));return db['VoiceRecording'][_0x628c('0x7c')]({'where':{'id':_0x30371f[_0x628c('0x49')]['id']}})[_0x628c('0x26')](function(_0x450e7e){if(_0x450e7e){var _0x2fa707=util['format']('%s.cypher',_0x450e7e['value']);if(fs[_0x628c('0x53')](_0x2fa707)){cypher=!![];return _0x38b46b[_0x628c('0x62')](_0x2fa707,_0x450e7e['value'],config[_0x628c('0x63')][_0x628c('0x64')])[_0x628c('0x26')](function(){return _0x450e7e;});}return _0x450e7e;}})[_0x628c('0x26')](function(_0x2f1e2d){if(!_0x2f1e2d){throw new db['Sequelize']['ValidationError'](_0x628c('0x7d'));}_0x2a7952=_0x2f1e2d;return db[_0x628c('0x7e')]['findOne']({'where':{'id':0x1}});})[_0x628c('0x26')](handleEntityNotFound(_0x156806,null))[_0x628c('0x26')](function(_0xd5fd6c){if(_0xd5fd6c){_0x190e99=_0xd5fd6c;if(!_0x190e99[_0x628c('0x7f')]||!_0x190e99[_0x628c('0x80')]||!_0x190e99[_0x628c('0x81')]||!_0x190e99[_0x628c('0x82')]||!_0x190e99[_0x628c('0x72')]){throw new db[(_0x628c('0x55'))][(_0x628c('0x56'))](_0x628c('0x83'));}if(_0x30371f[_0x628c('0x4c')][_0x628c('0x84')]&&(!_0x190e99[_0x628c('0x85')]||!_0x190e99[_0x628c('0x86')]||!_0x190e99[_0x628c('0x87')]||!_0x190e99[_0x628c('0x82')]||!_0x190e99[_0x628c('0x72')])){throw new db[(_0x628c('0x55'))][(_0x628c('0x56'))](_0x628c('0x88'));}return db['CloudProvider']['findOne']({'where':{'id':_0x190e99['transcribeAccountId']}});}})[_0x628c('0x26')](function(_0x52f2f0){if(!_0x52f2f0){throw new db[(_0x628c('0x55'))][(_0x628c('0x56'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x52f2f0[_0x628c('0x89')]||!_0x52f2f0['data2']){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x5d5011=_0x52f2f0;return getBucketslist(_0x5d5011[_0x628c('0x89')],_0x5d5011[_0x628c('0x8a')],_0x190e99[_0x628c('0x81')]);})[_0x628c('0x26')](function(_0xb3a4d3){if(_0xb3a4d3&&_0xb3a4d3[_0x628c('0x8b')]){var _0x11a17a=_[_0x628c('0x4d')](_0xb3a4d3[_0x628c('0x8b')],function(_0x1f123c){return _0x1f123c[_0x628c('0x8c')]===_0x190e99[_0x628c('0x72')];});if(!_0x11a17a){logger[_0x628c('0x66')](util[_0x628c('0x51')](_0x628c('0x8d'),_0x30371f['params']['id'],_0x190e99[_0x628c('0x72')]));return createBucket(_0x5d5011[_0x628c('0x89')],_0x5d5011[_0x628c('0x8a')],_0x190e99[_0x628c('0x81')],_0x190e99[_0x628c('0x72')]);}logger['info'](util[_0x628c('0x51')](_0x628c('0x8e'),_0x30371f[_0x628c('0x49')]['id'],_0x190e99['bucket']));return;}})[_0x628c('0x26')](function(_0x510d97){if(_0x2a7952[_0x628c('0x79')]===_0x628c('0x8f')){return transcribe(_0x30371f[_0x628c('0x49')]['id'],_0x5d5011[_0x628c('0x89')],_0x5d5011['data2'],_0x190e99['transcribeRegion'],_0x190e99['bucket'],_0x2a7952[_0x628c('0x54')],_0x190e99[_0x628c('0x82')]);}else{logger[_0x628c('0x66')](util[_0x628c('0x51')](_0x628c('0x90'),_0x30371f['params']['id']));return{'transcribeStatus':_0x628c('0x91')};}})[_0x628c('0x26')](function(_0x5748c8){if(_0x5748c8){_0x5748c8[_0x628c('0x92')]=_0x30371f['body'][_0x628c('0x84')];return _0x2a7952[_0x628c('0x93')](_0x5748c8);}})[_0x628c('0x26')](respondWithResult(_0x156806,null))['catch'](handleError(_0x156806,null));};function writeFile(_0x5af5ab,_0x3d9b79){return new Promise(function(_0x22e66b,_0x5ea37c){fs[_0x628c('0x94')](_0x3d9b79,_0x5af5ab,function(_0x353af4,_0x47ba8b){if(_0x353af4){return _0x5ea37c(_0x353af4);}else{return _0x22e66b(_0x47ba8b);}});});}exports[_0x628c('0x95')]=function(_0x48a212,_0x3a1bdf,_0xc6e6d1){return db['VoiceRecording'][_0x628c('0x7c')]({'where':{'id':_0x48a212[_0x628c('0x49')]['id']}})[_0x628c('0x26')](handleEntityNotFound(_0x3a1bdf))[_0x628c('0x26')](function(_0xa88995){if(_0xa88995&&_0xa88995['fileText']){var _0x200b60=_0xa88995['fileText'];var _0x10e7c2=config['root']+_0x628c('0x96')+_0xa88995['id']+_0x628c('0x97');if(fs[_0x628c('0x53')](_0x10e7c2)){return _0x10e7c2;}return writeFile(_0x200b60,_0x10e7c2)[_0x628c('0x26')](function(){return _0x10e7c2;});}else{throw new db['Sequelize'][(_0x628c('0x56'))](_0x628c('0x98'));}})[_0x628c('0x26')](function(_0x32fd9e){return _0x3a1bdf['download'](_0x32fd9e);})[_0x628c('0x47')](handleError(_0x3a1bdf));}; \ No newline at end of file +var _0x3f6b=['findOne','ValidationError','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','aws-sdk','uuid/v4','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','json','offset','limit','undefined','count','status','set','Content-Range','apply','update','then','destroy','error','stack','name','map','VoiceRecording','type','key','differenceBy','format','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','create','body','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','download','unlink','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','decryptFile','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','listBuckets','createBucket','upload','basename','readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe'];(function(_0x4845e4,_0x94613b){var _0x563711=function(_0x3cef0c){while(--_0x3cef0c){_0x4845e4['push'](_0x4845e4['shift']());}};_0x563711(++_0x94613b);}(_0x3f6b,0xb8));var _0xb3f6=function(_0x262ede,_0x2def4e){_0x262ede=_0x262ede-0x0;var _0xa2e1c7=_0x3f6b[_0x262ede];return _0xa2e1c7;};'use strict';var emlformat=require(_0xb3f6('0x0'));var rimraf=require(_0xb3f6('0x1'));var zipdir=require(_0xb3f6('0x2'));var jsonpatch=require(_0xb3f6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb3f6('0x4'));var Mustache=require(_0xb3f6('0x5'));var util=require(_0xb3f6('0x6'));var path=require(_0xb3f6('0x7'));var sox=require(_0xb3f6('0x8'));var csv=require(_0xb3f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3f6('0xa'));var _=require(_0xb3f6('0xb'));var squel=require(_0xb3f6('0xc'));var crypto=require('crypto');var jsforce=require(_0xb3f6('0xd'));var deskjs=require(_0xb3f6('0xe'));var toCsv=require(_0xb3f6('0x9'));var querystring=require(_0xb3f6('0xf'));var Papa=require('papaparse');var AWS=require(_0xb3f6('0x10'));var uuidv4=require(_0xb3f6('0x11'));var Redis=require(_0xb3f6('0x12'));var authService=require(_0xb3f6('0x13'));var qs=require(_0xb3f6('0x14'));var as=require(_0xb3f6('0x15'));var hardwareService=require(_0xb3f6('0x16'));var logger=require(_0xb3f6('0x17'))(_0xb3f6('0x18'));var utils=require(_0xb3f6('0x19'));var config=require(_0xb3f6('0x1a'));var licenseUtil=require(_0xb3f6('0x1b'));var db=require(_0xb3f6('0x1c'))['db'];function respondWithStatusCode(_0x2ebaf6,_0x13f287){_0x13f287=_0x13f287||0xcc;return function(_0x35af73){if(_0x35af73){return _0x2ebaf6[_0xb3f6('0x1d')](_0x13f287);}return _0x2ebaf6['status'](_0x13f287)[_0xb3f6('0x1e')]();};}function respondWithResult(_0x38c3cd,_0x14aff5){_0x14aff5=_0x14aff5||0xc8;return function(_0x37d9b1){if(_0x37d9b1){return _0x38c3cd['status'](_0x14aff5)[_0xb3f6('0x1f')](_0x37d9b1);}};}function respondWithFilteredResult(_0x2e28b7,_0x257506){return function(_0x1f78e4){if(_0x1f78e4){var _0x1aa9cc=typeof _0x257506[_0xb3f6('0x20')]==='undefined'&&typeof _0x257506[_0xb3f6('0x21')]===_0xb3f6('0x22');var _0x4539b2=_0x1f78e4[_0xb3f6('0x23')];var _0xe5a0a1=_0x1aa9cc?0x0:_0x257506['offset'];var _0xd347d3=_0x1aa9cc?_0x1f78e4[_0xb3f6('0x23')]:_0x257506[_0xb3f6('0x20')]+_0x257506['limit'];var _0x13d99d;if(_0xd347d3>=_0x4539b2){_0xd347d3=_0x4539b2;_0x13d99d=0xc8;}else{_0x13d99d=0xce;}_0x2e28b7[_0xb3f6('0x24')](_0x13d99d);return _0x2e28b7[_0xb3f6('0x25')](_0xb3f6('0x26'),_0xe5a0a1+'-'+_0xd347d3+'/'+_0x4539b2)[_0xb3f6('0x1f')](_0x1f78e4);}return null;};}function patchUpdates(_0x5ccf99){return function(_0x33aae4){try{jsonpatch[_0xb3f6('0x27')](_0x33aae4,_0x5ccf99,!![]);}catch(_0x1fd6f2){return BPromise['reject'](_0x1fd6f2);}return _0x33aae4['save']();};}function saveUpdates(_0x452b63,_0x20a473){return function(_0x120ce7){if(_0x120ce7){return _0x120ce7[_0xb3f6('0x28')](_0x452b63)[_0xb3f6('0x29')](function(_0x26591f){return _0x26591f;});}return null;};}function removeEntity(_0x39927e,_0x1a6a91){return function(_0x22e4c4){if(_0x22e4c4){return _0x22e4c4[_0xb3f6('0x2a')]()[_0xb3f6('0x29')](function(){_0x39927e[_0xb3f6('0x24')](0xcc)[_0xb3f6('0x1e')]();});}};}function handleEntityNotFound(_0x3d5172,_0x472bf2){return function(_0x271d81){if(!_0x271d81){_0x3d5172[_0xb3f6('0x1d')](0x194);}return _0x271d81;};}function handleError(_0x5d0e3a,_0x54422f){_0x54422f=_0x54422f||0x1f4;return function(_0x5d5490){logger[_0xb3f6('0x2b')](_0x5d5490[_0xb3f6('0x2c')]);if(_0x5d5490[_0xb3f6('0x2d')]){delete _0x5d5490[_0xb3f6('0x2d')];}_0x5d0e3a[_0xb3f6('0x24')](_0x54422f)['send'](_0x5d5490);};}exports['index']=function(_0x271cc0,_0x2c7a28){var _0x151b33={},_0xc4f2b0={},_0x3b0896={'count':0x0,'rows':[]};var _0x4eb5e8=_[_0xb3f6('0x2e')](db[_0xb3f6('0x2f')]['rawAttributes'],function(_0x270f86){return{'name':_0x270f86['fieldName'],'type':_0x270f86[_0xb3f6('0x30')][_0xb3f6('0x31')]};});_0xc4f2b0['model']=_[_0xb3f6('0x32')](_['map'](_0x4eb5e8,'name'),[_0xb3f6('0x33')]);_0xc4f2b0[_0xb3f6('0x34')]=_[_0xb3f6('0x35')](_0x271cc0[_0xb3f6('0x34')]);_0xc4f2b0['filters']=_['intersection'](_0xc4f2b0[_0xb3f6('0x36')],_0xc4f2b0['query']);_0x151b33[_0xb3f6('0x37')]=_[_0xb3f6('0x38')](_0xc4f2b0[_0xb3f6('0x36')],qs[_0xb3f6('0x39')](_0x271cc0[_0xb3f6('0x34')][_0xb3f6('0x39')]));_0x151b33[_0xb3f6('0x37')]=_0x151b33[_0xb3f6('0x37')][_0xb3f6('0x3a')]?_0x151b33[_0xb3f6('0x37')]:_0xc4f2b0['model'];if(!_0x271cc0[_0xb3f6('0x34')][_0xb3f6('0x3b')]('nolimit')){_0x151b33[_0xb3f6('0x21')]=qs[_0xb3f6('0x21')](_0x271cc0[_0xb3f6('0x34')][_0xb3f6('0x21')]);_0x151b33['offset']=qs['offset'](_0x271cc0[_0xb3f6('0x34')][_0xb3f6('0x20')]);}_0x151b33[_0xb3f6('0x3c')]=qs[_0xb3f6('0x3d')](_0x271cc0[_0xb3f6('0x34')][_0xb3f6('0x3d')]);_0x151b33[_0xb3f6('0x3e')]=qs['filters'](_[_0xb3f6('0x3f')](_0x271cc0[_0xb3f6('0x34')],_0xc4f2b0['filters']),_0x4eb5e8);if(_0x271cc0[_0xb3f6('0x34')][_0xb3f6('0x40')]){_0x151b33[_0xb3f6('0x3e')]=_[_0xb3f6('0x41')](_0x151b33[_0xb3f6('0x3e')],{'$or':_[_0xb3f6('0x2e')](_0x4eb5e8,function(_0x2d1188){if(_0x2d1188[_0xb3f6('0x30')]!==_0xb3f6('0x42')){var _0x2ccd45={};_0x2ccd45[_0x2d1188[_0xb3f6('0x2d')]]={'$like':'%'+_0x271cc0['query'][_0xb3f6('0x40')]+'%'};return _0x2ccd45;}})});}_0x151b33=_['merge']({},_0x151b33,_0x271cc0[_0xb3f6('0x43')]);var _0x178666={'where':_0x151b33['where']};return db[_0xb3f6('0x2f')][_0xb3f6('0x23')](_0x178666)[_0xb3f6('0x29')](function(_0x2c0cf7){_0x3b0896[_0xb3f6('0x23')]=_0x2c0cf7;if(_0x271cc0[_0xb3f6('0x34')][_0xb3f6('0x44')]){_0x151b33[_0xb3f6('0x45')]=[{'all':!![]}];}return db[_0xb3f6('0x2f')][_0xb3f6('0x46')](_0x151b33);})[_0xb3f6('0x29')](function(_0x4e177a){_0x3b0896[_0xb3f6('0x47')]=_0x4e177a;return _0x3b0896;})[_0xb3f6('0x29')](respondWithFilteredResult(_0x2c7a28,_0x151b33))[_0xb3f6('0x48')](handleError(_0x2c7a28,null));};exports[_0xb3f6('0x49')]=function(_0x354bd1,_0x30b5e0){var _0x362f47={'raw':![],'where':{'id':_0x354bd1[_0xb3f6('0x4a')]['id']}},_0x1f62d4={};_0x1f62d4[_0xb3f6('0x36')]=_[_0xb3f6('0x35')](db['VoiceRecording'][_0xb3f6('0x4b')]);_0x1f62d4[_0xb3f6('0x34')]=_[_0xb3f6('0x35')](_0x354bd1[_0xb3f6('0x34')]);_0x1f62d4[_0xb3f6('0x4c')]=_[_0xb3f6('0x38')](_0x1f62d4[_0xb3f6('0x36')],_0x1f62d4[_0xb3f6('0x34')]);_0x362f47[_0xb3f6('0x37')]=_[_0xb3f6('0x38')](_0x1f62d4[_0xb3f6('0x36')],qs[_0xb3f6('0x39')](_0x354bd1['query']['fields']));_0x362f47[_0xb3f6('0x37')]=_0x362f47[_0xb3f6('0x37')][_0xb3f6('0x3a')]?_0x362f47[_0xb3f6('0x37')]:_0x1f62d4['model'];if(_0x354bd1['query'][_0xb3f6('0x44')]){_0x362f47[_0xb3f6('0x45')]=[{'all':!![]}];}_0x362f47=_[_0xb3f6('0x41')]({},_0x362f47,_0x354bd1[_0xb3f6('0x43')]);return db[_0xb3f6('0x2f')]['find'](_0x362f47)[_0xb3f6('0x29')](handleEntityNotFound(_0x30b5e0,null))[_0xb3f6('0x29')](respondWithResult(_0x30b5e0,null))['catch'](handleError(_0x30b5e0,null));};exports[_0xb3f6('0x4d')]=function(_0x134588,_0x4cb6a3){return db[_0xb3f6('0x2f')][_0xb3f6('0x4d')](_0x134588['body'],{})[_0xb3f6('0x29')](respondWithResult(_0x4cb6a3,0xc9))[_0xb3f6('0x48')](handleError(_0x4cb6a3,null));};exports[_0xb3f6('0x28')]=function(_0x273e44,_0x5ef748){if(_0x273e44[_0xb3f6('0x4e')]['id']){delete _0x273e44[_0xb3f6('0x4e')]['id'];}return db[_0xb3f6('0x2f')][_0xb3f6('0x4f')]({'where':{'id':_0x273e44[_0xb3f6('0x4a')]['id']}})[_0xb3f6('0x29')](handleEntityNotFound(_0x5ef748,null))[_0xb3f6('0x29')](saveUpdates(_0x273e44[_0xb3f6('0x4e')],null))[_0xb3f6('0x29')](respondWithResult(_0x5ef748,null))[_0xb3f6('0x48')](handleError(_0x5ef748,null));};exports[_0xb3f6('0x50')]=function(_0x5d4973,_0x52f2da){return db[_0xb3f6('0x2f')][_0xb3f6('0x50')]()[_0xb3f6('0x29')](respondWithResult(_0x52f2da,null))[_0xb3f6('0x48')](handleError(_0x52f2da,null));};exports['download']=function(_0x79644a,_0x480e88,_0x4fc90a){var _0x227d94=require(_0xb3f6('0x51'));var _0x3c0b3f=![];var _0x104bc0={};if(_0x79644a['query'][_0xb3f6('0x30')]&&_0x79644a[_0xb3f6('0x34')][_0xb3f6('0x30')]==='uniqueid'){_0x104bc0[_0xb3f6('0x52')]=_0x79644a['params']['id'];}else{_0x104bc0['id']=_0x79644a['params']['id'];}return db[_0xb3f6('0x2f')][_0xb3f6('0x4f')]({'where':_0x104bc0,'attributes':['id',_0xb3f6('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x480e88,null))[_0xb3f6('0x29')](function(_0x5abded){if(_0x5abded){var _0x207985=_0x5abded[_0xb3f6('0x53')];var _0xccf8cf=util['format'](_0xb3f6('0x54'),_0x207985);if(fs[_0xb3f6('0x55')](_0xccf8cf)){_0x3c0b3f=!![];return _0x227d94['decryptFile'](_0xccf8cf,_0x207985,config[_0xb3f6('0x56')][_0xb3f6('0x57')])['then'](function(){return _0x5abded;});}return _0x5abded;}})['then'](function(_0x272408){if(_0x272408){var _0x4e2f0d=_0x272408['value'];if(!fs['existsSync'](_0x4e2f0d)){throw new db[(_0xb3f6('0x58'))]['ValidationError'](_0xb3f6('0x59'));}if(_0x272408[_0xb3f6('0x5a')]){return _0x480e88[_0xb3f6('0x5b')](_0x4e2f0d,_0x272408[_0xb3f6('0x5a')]+path['extname'](_0x4e2f0d),function(){if(_0x3c0b3f){fs[_0xb3f6('0x5c')](_0x4e2f0d);}});}else{return _0x480e88[_0xb3f6('0x5b')](_0x4e2f0d,function(_0x3b6c98){if(_0x3c0b3f){fs['unlink'](_0x4e2f0d);}});}}})[_0xb3f6('0x48')](function(_0x30f475){if(_0x30f475['message']===_0xb3f6('0x59')){_0x480e88[_0xb3f6('0x24')](0x194)['send'](_0xb3f6('0x5d'));}else{return handleError(_0x480e88,null);}});};exports[_0xb3f6('0x5e')]=function(_0x35ae6f,_0x5560b9,_0x216fd0){var _0x5baef7=require(_0xb3f6('0x51'));var _0x250be1=![];var _0x2f64ff={'$and':[db[_0xb3f6('0x5f')][_0xb3f6('0x3e')](db['sequelize']['fn'](_0xb3f6('0x60'),db[_0xb3f6('0x5f')][_0xb3f6('0x61')]('uniqueid')),_0x35ae6f[_0xb3f6('0x34')][_0xb3f6('0x62')])]};if(_0x35ae6f[_0xb3f6('0x34')]['type']&&_0x35ae6f[_0xb3f6('0x34')][_0xb3f6('0x30')]===_0xb3f6('0x52')){_0x2f64ff['$and'][_0xb3f6('0x63')]({'uniqueid':_0x35ae6f[_0xb3f6('0x4a')]['id']});}else{_0x2f64ff[_0xb3f6('0x64')][_0xb3f6('0x63')]({'id':_0x35ae6f[_0xb3f6('0x4a')]['id']});}return db[_0xb3f6('0x2f')]['find']({'where':_0x2f64ff,'attributes':['id',_0xb3f6('0x53')],'raw':!![]})[_0xb3f6('0x29')](handleEntityNotFound(_0x5560b9,null))[_0xb3f6('0x29')](function(_0x522c45){if(_0x522c45){var _0x166011=util['format'](_0xb3f6('0x54'),_0x522c45[_0xb3f6('0x53')]);if(fs[_0xb3f6('0x55')](_0x166011)){_0x250be1=!![];return _0x5baef7[_0xb3f6('0x65')](_0x166011,_0x522c45['value'],config['secrets'][_0xb3f6('0x57')])[_0xb3f6('0x29')](function(){return _0x522c45;});}return _0x522c45;}})[_0xb3f6('0x29')](function(_0x2a0204){if(_0x2a0204){if(!fs[_0xb3f6('0x55')](_0x2a0204['value'])){throw new db[(_0xb3f6('0x58'))]['ValidationError'](_0xb3f6('0x59'));}if(_0x2a0204['filename']){return _0x5560b9['download'](_0x2a0204['value'],_0x2a0204['filename']+path[_0xb3f6('0x66')](_0x2a0204[_0xb3f6('0x53')]),function(){if(_0x250be1){fs[_0xb3f6('0x5c')](_0x2a0204[_0xb3f6('0x53')]);}});}else{return _0x5560b9['download'](_0x2a0204[_0xb3f6('0x53')],function(_0x12c350){if(_0x250be1){fs[_0xb3f6('0x5c')](_0x2a0204[_0xb3f6('0x53')]);}});}}})[_0xb3f6('0x48')](handleError(_0x5560b9,null));};exports[_0xb3f6('0x2a')]=function(_0x5c9241,_0x1eadb6){return db[_0xb3f6('0x2f')]['find']({'where':{'id':_0x5c9241[_0xb3f6('0x4a')]['id']}})[_0xb3f6('0x29')](function(_0x11a9f9){if(_['isNil'](_0x11a9f9)){throw new ReferenceError(_0xb3f6('0x67'));}return _0x11a9f9;})[_0xb3f6('0x29')](function(_0x2eebb6){var _0x420069=_0x2eebb6[_0xb3f6('0x53')];logger[_0xb3f6('0x68')](_0xb3f6('0x69'),_0x420069);if(!_['isNil'](_0x2eebb6[_0xb3f6('0x53')])&&fs[_0xb3f6('0x55')](_0x420069)){logger[_0xb3f6('0x68')](_0xb3f6('0x6a')+_0x420069+_0xb3f6('0x6b'));fs[_0xb3f6('0x6c')](_0x420069);}_0x420069=_0x420069+_0xb3f6('0x6d');if(!_[_0xb3f6('0x6e')](_0x2eebb6[_0xb3f6('0x53')])&&fs[_0xb3f6('0x55')](_0x420069)){logger[_0xb3f6('0x68')]('File:\x20\x22'+_0x420069+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb3f6('0x6c')](_0x420069);}return _0x2eebb6;})[_0xb3f6('0x29')](function(_0x4ac342){if(!_0x4ac342)throw new InternalError();return _0x4ac342[_0xb3f6('0x2a')]();})[_0xb3f6('0x29')](function(){_0x1eadb6['status'](0xcc)['end']();})[_0xb3f6('0x48')](handleError(_0x1eadb6,null));};function getBucketslist(_0x30e929,_0x2d4ff0,_0x5911cb){return new Promise(function(_0x1b1012,_0x109412){var _0x24ef8c=new AWS['S3']({'accessKeyId':_0x2d4ff0,'secretAccessKey':_0x30e929,'region':_0x5911cb});_0x24ef8c[_0xb3f6('0x6f')]({},function(_0x16489a,_0x5a7783){if(_0x16489a){return _0x109412(_0x16489a);}else{return _0x1b1012(_0x5a7783);}});});}function createBucket(_0x28d18e,_0x4e5efe,_0x586075,_0x2e3ddf){return new Promise(function(_0x258710,_0x505410){var _0x2f224e=new AWS['S3']({'accessKeyId':_0x4e5efe,'secretAccessKey':_0x28d18e,'region':_0x586075});_0x2f224e[_0xb3f6('0x70')]({'Bucket':_0x2e3ddf},function(_0x1b83c1,_0x20b653){if(_0x1b83c1){return _0x505410(_0x1b83c1);}else{return _0x258710(_0x20b653);}});});}function uploadFile(_0x1fda49,_0x4d7c93,_0x27142c,_0x307153,_0x2a167c,_0x5a75b6){return new Promise(function(_0x5dbd42,_0x59fccb){var _0x371032=new AWS['S3']({'accessKeyId':_0x4d7c93,'secretAccessKey':_0x1fda49,'region':_0x27142c});_0x371032[_0xb3f6('0x71')]({'Bucket':_0x307153,'Key':_0x2a167c,'Body':_0x5a75b6},function(_0x297be9,_0x95e948){if(_0x297be9){return _0x59fccb(_0x297be9);}else{return _0x5dbd42(_0x95e948);}});});}function startTranscribe(_0x3c3e24,_0x5261a0,_0x4ed285,_0x10fbd5,_0xe55cae,_0x51f2c6){return new Promise(function(_0x822cb8,_0x2e96d1){var _0x5f1dbe=new AWS['TranscribeService']({'accessKeyId':_0x5261a0,'secretAccessKey':_0x3c3e24,'region':_0x4ed285});_0x5f1dbe['startTranscriptionJob']({'TranscriptionJobName':_0x10fbd5,'LanguageCode':_0xe55cae,'Media':{'MediaFileUri':_0x51f2c6}},function(_0x276ae4,_0x586cf4){if(_0x276ae4){return _0x2e96d1(_0x276ae4);}else{return _0x822cb8(_0x586cf4);}});});}function transcribe(_0x44af61,_0xa80dc0,_0x170725,_0x5d8900,_0x485bff,_0x3b849a,_0x4bd9e3){return new Promise(function(_0x48a923,_0x194459){var _0x5ed13e={};logger[_0xb3f6('0x68')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x44af61,_0x485bff));return uploadFile(_0xa80dc0,_0x170725,_0x5d8900,_0x485bff,path[_0xb3f6('0x72')](_0x3b849a),fs[_0xb3f6('0x73')](_0x3b849a))[_0xb3f6('0x29')](function(_0x4b7bc9){logger[_0xb3f6('0x68')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x44af61,_0x485bff,_0x4b7bc9['Location']));_0x5ed13e[_0xb3f6('0x74')]=_0x4b7bc9[_0xb3f6('0x75')];_0x5ed13e[_0xb3f6('0x76')]=_0x4b7bc9[_0xb3f6('0x77')];logger[_0xb3f6('0x68')](util[_0xb3f6('0x33')](_0xb3f6('0x78'),_0x44af61));return startTranscribe(_0xa80dc0,_0x170725,_0x5d8900,uuidv4(),_0x4bd9e3,_0x4b7bc9[_0xb3f6('0x77')]);})[_0xb3f6('0x29')](function(_0x42e2ca){logger[_0xb3f6('0x68')](util['format'](_0xb3f6('0x79'),_0x44af61,_0x42e2ca[_0xb3f6('0x7a')][_0xb3f6('0x7b')]));_0x5ed13e[_0xb3f6('0x7c')]=_0x42e2ca[_0xb3f6('0x7a')]['TranscriptionJobName'];_0x5ed13e[_0xb3f6('0x7d')]=_0x42e2ca[_0xb3f6('0x7a')][_0xb3f6('0x7e')];return _0x48a923(_0x5ed13e);})[_0xb3f6('0x48')](function(_0x34e12f){return _0x194459(_0x34e12f);});});}exports[_0xb3f6('0x7f')]=function(_0x4c96e3,_0x3fbd30,_0xb3a8af){var _0x23ce4a;var _0x4e7891;var _0x3214db;var _0x35bbbe=require(_0xb3f6('0x51'));return db['VoiceRecording'][_0xb3f6('0x80')]({'where':{'id':_0x4c96e3['params']['id']}})[_0xb3f6('0x29')](function(_0xee87f9){if(_0xee87f9){var _0x10d698=util[_0xb3f6('0x33')](_0xb3f6('0x54'),_0xee87f9[_0xb3f6('0x53')]);if(fs[_0xb3f6('0x55')](_0x10d698)){cypher=!![];return _0x35bbbe[_0xb3f6('0x65')](_0x10d698,_0xee87f9[_0xb3f6('0x53')],config['secrets'][_0xb3f6('0x57')])['then'](function(){return _0xee87f9;});}return _0xee87f9;}})['then'](function(_0x2f0f93){if(!_0x2f0f93){throw new db[(_0xb3f6('0x58'))][(_0xb3f6('0x81'))](_0xb3f6('0x82'));}_0x4e7891=_0x2f0f93;return db[_0xb3f6('0x83')]['findOne']({'where':{'id':0x1}});})[_0xb3f6('0x29')](handleEntityNotFound(_0x3fbd30,null))[_0xb3f6('0x29')](function(_0x2bddb9){if(_0x2bddb9){_0x23ce4a=_0x2bddb9;if(!_0x23ce4a[_0xb3f6('0x84')]||!_0x23ce4a[_0xb3f6('0x85')]||!_0x23ce4a[_0xb3f6('0x86')]||!_0x23ce4a[_0xb3f6('0x87')]||!_0x23ce4a['bucket']){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x4c96e3['body']['runSentiment']&&(!_0x23ce4a['sentiment']||!_0x23ce4a[_0xb3f6('0x88')]||!_0x23ce4a[_0xb3f6('0x89')]||!_0x23ce4a[_0xb3f6('0x87')]||!_0x23ce4a[_0xb3f6('0x74')])){throw new db[(_0xb3f6('0x58'))][(_0xb3f6('0x81'))](_0xb3f6('0x8a'));}return db[_0xb3f6('0x8b')][_0xb3f6('0x80')]({'where':{'id':_0x23ce4a[_0xb3f6('0x85')]}});}})[_0xb3f6('0x29')](function(_0x30ddf6){if(!_0x30ddf6){throw new db[(_0xb3f6('0x58'))]['ValidationError'](_0xb3f6('0x8c'));}if(!_0x30ddf6[_0xb3f6('0x8d')]||!_0x30ddf6['data2']){throw new db['Sequelize']['ValidationError'](_0xb3f6('0x8e'));}_0x3214db=_0x30ddf6;return getBucketslist(_0x3214db['data1'],_0x3214db[_0xb3f6('0x8f')],_0x23ce4a[_0xb3f6('0x86')]);})[_0xb3f6('0x29')](function(_0x14da42){if(_0x14da42&&_0x14da42[_0xb3f6('0x90')]){var _0x292bb0=_['find'](_0x14da42[_0xb3f6('0x90')],function(_0x3b2701){return _0x3b2701[_0xb3f6('0x91')]===_0x23ce4a[_0xb3f6('0x74')];});if(!_0x292bb0){logger[_0xb3f6('0x68')](util[_0xb3f6('0x33')](_0xb3f6('0x92'),_0x4c96e3['params']['id'],_0x23ce4a[_0xb3f6('0x74')]));return createBucket(_0x3214db[_0xb3f6('0x8d')],_0x3214db[_0xb3f6('0x8f')],_0x23ce4a['transcribeRegion'],_0x23ce4a[_0xb3f6('0x74')]);}logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4c96e3[_0xb3f6('0x4a')]['id'],_0x23ce4a['bucket']));return;}})[_0xb3f6('0x29')](function(_0x490142){if(_0x4e7891[_0xb3f6('0x7d')]==='NEW'){return transcribe(_0x4c96e3['params']['id'],_0x3214db[_0xb3f6('0x8d')],_0x3214db['data2'],_0x23ce4a['transcribeRegion'],_0x23ce4a['bucket'],_0x4e7891[_0xb3f6('0x53')],_0x23ce4a['language']);}else{logger[_0xb3f6('0x68')](util['format'](_0xb3f6('0x93'),_0x4c96e3[_0xb3f6('0x4a')]['id']));return{'transcribeStatus':_0xb3f6('0x94')};}})[_0xb3f6('0x29')](function(_0x3d0745){if(_0x3d0745){_0x3d0745[_0xb3f6('0x95')]=_0x4c96e3[_0xb3f6('0x4e')][_0xb3f6('0x96')];return _0x4e7891['updateAttributes'](_0x3d0745);}})[_0xb3f6('0x29')](respondWithResult(_0x3fbd30,null))[_0xb3f6('0x48')](handleError(_0x3fbd30,null));};function writeFile(_0x29d4ac,_0x145006){return new Promise(function(_0x5b64b8,_0x3a24a0){fs[_0xb3f6('0x97')](_0x145006,_0x29d4ac,function(_0x544e4e,_0x2e860d){if(_0x544e4e){return _0x3a24a0(_0x544e4e);}else{return _0x5b64b8(_0x2e860d);}});});}exports[_0xb3f6('0x98')]=function(_0x48e3cb,_0x45e768,_0xf8f17a){return db[_0xb3f6('0x2f')][_0xb3f6('0x80')]({'where':{'id':_0x48e3cb[_0xb3f6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x45e768))[_0xb3f6('0x29')](function(_0xb5a56d){if(_0xb5a56d&&_0xb5a56d['fileText']){var _0x130323=_0xb5a56d['fileText'];var _0x514b27=config[_0xb3f6('0x99')]+'/server/files/transcribes/transcribe_'+_0xb5a56d['id']+_0xb3f6('0x9a');if(fs['existsSync'](_0x514b27)){return _0x514b27;}return writeFile(_0x130323,_0x514b27)[_0xb3f6('0x29')](function(){return _0x514b27;});}else{throw new db['Sequelize'][(_0xb3f6('0x81'))](_0xb3f6('0x9b'));}})[_0xb3f6('0x29')](function(_0xe369ec){return _0x45e768[_0xb3f6('0x5b')](_0xe369ec);})['catch'](handleError(_0x45e768));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d0a7089..cfdf1bd 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 _0x9aea=['transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','uniqueid'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x9aea,0xdd));var _0xa9ae=function(_0x3a83fe,_0x7bec21){_0x3a83fe=_0x3a83fe-0x0;var _0x486626=_0x9aea[_0x3a83fe];return _0x486626;};'use strict';var attributes=require(_0xa9ae('0x0'));module['exports']=function(_0x45ec16,_0x5e1d51){return _0x45ec16[_0xa9ae('0x1')](_0xa9ae('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xa9ae('0x3'),'fields':[_0xa9ae('0x3')]},{'name':_0xa9ae('0x4'),'fields':[_0xa9ae('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b40=['exports','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x274865,_0x206535){var _0x1af46d=function(_0xc8d547){while(--_0xc8d547){_0x274865['push'](_0x274865['shift']());}};_0x1af46d(++_0x206535);}(_0x0b40,0xba));var _0x00b4=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x0b40[_0x1147ab];return _0x55cb5a;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x00b4('0x0')]=function(_0x10719a,_0x53b8fd){return _0x10719a[_0x00b4('0x1')](_0x00b4('0x2'),attributes,{'tableName':_0x00b4('0x3'),'paranoid':![],'indexes':[{'name':_0x00b4('0x4'),'fields':[_0x00b4('0x4')]},{'name':_0x00b4('0x5'),'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 965d217..9d2b1a8 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 _0x4888=['recording','unlink','CreateVoiceRecording\x20file\x20encrypted','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateVoiceRecording','VoiceRecording','update','body','options','where','attributes','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','value','format','%s.cypher','encryptFile','secrets'];(function(_0x145520,_0x1c8fa6){var _0x47ef1c=function(_0x53c446){while(--_0x53c446){_0x145520['push'](_0x145520['shift']());}};_0x47ef1c(++_0x1c8fa6);}(_0x4888,0x198));var _0x8488=function(_0x4bdd56,_0x219c46){_0x4bdd56=_0x4bdd56-0x0;var _0x5c1151=_0x4888[_0x4bdd56];return _0x5c1151;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});}exports[_0x8488('0x17')]=function(_0x60ae2f){var _0x39775f=this;return new Promise(function(_0x1aedb1,_0x27c62a){return db[_0x8488('0x18')][_0x8488('0x19')](_0x60ae2f[_0x8488('0x1a')],{'raw':_0x60ae2f[_0x8488('0x1b')]?_0x60ae2f[_0x8488('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x60ae2f['options']?_0x60ae2f[_0x8488('0x1b')][_0x8488('0x1c')]||null:null,'attributes':_0x60ae2f[_0x8488('0x1b')]?_0x60ae2f[_0x8488('0x1b')][_0x8488('0x1d')]||null:null,'limit':_0x60ae2f[_0x8488('0x1b')]?_0x60ae2f[_0x8488('0x1b')][_0x8488('0x1e')]||null:null})[_0x8488('0xd')](function(_0x5123d0){logger[_0x8488('0xe')](_0x8488('0x17'),_0x60ae2f);logger[_0x8488('0x11')](_0x8488('0x17'),_0x60ae2f,JSON[_0x8488('0x12')](_0x5123d0));_0x1aedb1(_0x5123d0);})['catch'](function(_0x577234){logger['error']('UpdateVoiceRecording',_0x577234[_0x8488('0x15')],_0x60ae2f);_0x27c62a(_0x39775f['error'](0x1f4,_0x577234['message']));});});};exports[_0x8488('0x1f')]=function(_0x2f350a){var _0x2b3c97=this;return new Promise(function(_0x6ebee0,_0x287662){var _0x503b83=require(_0x8488('0x20'));var _0x38c137;return db[_0x8488('0x21')][_0x8488('0x22')]({'attributes':['id',_0x8488('0x23')],'where':{'id':0x1},'raw':!![]})[_0x8488('0xd')](function(_0x2c15ff){_0x38c137=_0x2c15ff;return db[_0x8488('0x18')][_0x8488('0x24')](_0x2f350a[_0x8488('0x1a')]);})[_0x8488('0xd')](function(_0x58d0cc){if(_0x38c137['callRecordingEncryption']&&fs['existsSync'](_0x58d0cc[_0x8488('0x25')])){var _0x408c36=util[_0x8488('0x26')](_0x8488('0x27'),_0x58d0cc[_0x8488('0x25')]);return _0x503b83[_0x8488('0x28')](_0x58d0cc['value'],_0x408c36,config[_0x8488('0x29')][_0x8488('0x2a')])[_0x8488('0xd')](function(){fs[_0x8488('0x2b')](_0x58d0cc[_0x8488('0x25')]);logger['info'](_0x8488('0x2c'));return _0x58d0cc;});}return _0x58d0cc;})[_0x8488('0xd')](function(_0x579d50){logger[_0x8488('0xe')](_0x8488('0x1f'),_0x2f350a);logger[_0x8488('0x11')](_0x8488('0x1f'),_0x2f350a,JSON[_0x8488('0x12')](_0x579d50));_0x6ebee0(_0x579d50);})['catch'](function(_0x44c8f3){logger[_0x8488('0x13')](_0x8488('0x1f'),_0x44c8f3['message'],_0x2f350a);_0x287662(_0x2b3c97[_0x8488('0x13')](0x1f4,_0x44c8f3['message']));});});}; \ No newline at end of file +var _0x3d04=['result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','debug','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','value','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','VoiceRecording,\x20%s,\x20%s','message','info'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var BPromise=require(_0x43d0('0x3'));var rs=require(_0x43d0('0x4'));var fs=require('fs');var Redis=require(_0x43d0('0x5'));var db=require(_0x43d0('0x6'))['db'];var utils=require(_0x43d0('0x7'));var logger=require('../../config/logger')(_0x43d0('0x8'));var config=require(_0x43d0('0x9'));var jayson=require(_0x43d0('0xa'));var client=jayson[_0x43d0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484271,_0x50919e,_0x5efb95){return new BPromise(function(_0x457550,_0x3344d3){return client[_0x43d0('0xc')](_0x484271,_0x5efb95)[_0x43d0('0xd')](function(_0x44a763){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'),JSON[_0x43d0('0xf')](_0x44a763));if(_0x44a763[_0x43d0('0x10')]){if(_0x44a763[_0x43d0('0x10')]['code']===0x1f4){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x44a763['error'][_0x43d0('0x12')]);return _0x3344d3(_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);}logger['error'](_0x43d0('0x11'),_0x50919e,_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);return _0x457550(_0x44a763['error'][_0x43d0('0x12')]);}else{logger[_0x43d0('0x13')](_0x43d0('0x11'),_0x50919e,_0x43d0('0xe'));_0x457550(_0x44a763[_0x43d0('0x14')]['message']);}})['catch'](function(_0x1e91a7){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x1e91a7);_0x3344d3(_0x1e91a7);});});}exports['UpdateVoiceRecording']=function(_0x2c641e){var _0x532402=this;return new Promise(function(_0x2c9d06,_0x468ca2){return db[_0x43d0('0x15')]['update'](_0x2c641e[_0x43d0('0x16')],{'raw':_0x2c641e[_0x43d0('0x17')]?_0x2c641e['options'][_0x43d0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c641e[_0x43d0('0x17')]?_0x2c641e[_0x43d0('0x17')][_0x43d0('0x19')]||null:null,'attributes':_0x2c641e[_0x43d0('0x17')]?_0x2c641e[_0x43d0('0x17')][_0x43d0('0x1a')]||null:null,'limit':_0x2c641e[_0x43d0('0x17')]?_0x2c641e[_0x43d0('0x17')][_0x43d0('0x1b')]||null:null})[_0x43d0('0xd')](function(_0x19d2ff){logger[_0x43d0('0x13')](_0x43d0('0x1c'),_0x2c641e);logger[_0x43d0('0x1d')]('UpdateVoiceRecording',_0x2c641e,JSON[_0x43d0('0xf')](_0x19d2ff));_0x2c9d06(_0x19d2ff);})[_0x43d0('0x1e')](function(_0x509041){logger[_0x43d0('0x10')]('UpdateVoiceRecording',_0x509041[_0x43d0('0x12')],_0x2c641e);_0x468ca2(_0x532402[_0x43d0('0x10')](0x1f4,_0x509041['message']));});});};exports[_0x43d0('0x1f')]=function(_0x238c64){var _0x5ac4c0=this;return new Promise(function(_0x12df30,_0x4692bc){var _0x22ae3c=require('../../components/encryptor');var _0x447725;return db[_0x43d0('0x20')][_0x43d0('0x21')]({'attributes':['id',_0x43d0('0x22')],'where':{'id':0x1},'raw':!![]})[_0x43d0('0xd')](function(_0x440ecb){_0x447725=_0x440ecb;return db[_0x43d0('0x15')]['create'](_0x238c64[_0x43d0('0x16')]);})[_0x43d0('0xd')](function(_0x6bc471){if(_0x447725['callRecordingEncryption']&&fs['existsSync'](_0x6bc471['value'])){var _0x3c1ea3=util[_0x43d0('0x23')](_0x43d0('0x24'),_0x6bc471[_0x43d0('0x25')]);return _0x22ae3c[_0x43d0('0x26')](_0x6bc471[_0x43d0('0x25')],_0x3c1ea3,config['secrets'][_0x43d0('0x27')])[_0x43d0('0xd')](function(){fs[_0x43d0('0x28')](_0x6bc471[_0x43d0('0x25')]);logger[_0x43d0('0x13')](_0x43d0('0x29'));return _0x6bc471;});}return _0x6bc471;})[_0x43d0('0xd')](function(_0x1bdd74){logger[_0x43d0('0x13')](_0x43d0('0x1f'),_0x238c64);logger[_0x43d0('0x1d')]('CreateVoiceRecording',_0x238c64,JSON[_0x43d0('0xf')](_0x1bdd74));_0x12df30(_0x1bdd74);})[_0x43d0('0x1e')](function(_0x45ec78){logger[_0x43d0('0x10')]('CreateVoiceRecording',_0x45ec78[_0x43d0('0x12')],_0x238c64);_0x4692bc(_0x5ac4c0['error'](0x1f4,_0x45ec78[_0x43d0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 8b0dcd4..4e44994 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 _0x7909=['fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','util','path','connect-timeout','express'];(function(_0x51d4ee,_0xdead36){var _0x2939b0=function(_0x1d7bf6){while(--_0x1d7bf6){_0x51d4ee['push'](_0x51d4ee['shift']());}};_0x2939b0(++_0xdead36);}(_0x7909,0x12e));var _0x9790=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7909[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0x9790('0x0'));var path=require(_0x9790('0x1'));var timeout=require(_0x9790('0x2'));var express=require(_0x9790('0x3'));var router=express['Router']();var fs_extra=require(_0x9790('0x4'));var auth=require(_0x9790('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9790('0x6'));var controller=require(_0x9790('0x7'));router[_0x9790('0x8')]('/',auth[_0x9790('0x9')](),controller[_0x9790('0xa')]);router[_0x9790('0x8')]('/describe',auth[_0x9790('0x9')](),controller['describe']);router[_0x9790('0x8')](_0x9790('0xb'),auth['isAuthenticated'](),controller[_0x9790('0xc')]);router[_0x9790('0xd')]('/',auth['isAuthenticated'](),controller[_0x9790('0xe')]);router[_0x9790('0xf')](_0x9790('0xb'),auth['isAuthenticated'](),controller[_0x9790('0x10')]);router['delete'](_0x9790('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9790('0x11')]=router; \ No newline at end of file +var _0x2a1c=['Router','fs-extra','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','express'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2a1c,0x19e));var _0xc2a1=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x2a1c[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0xc2a1('0x0'));var util=require(_0xc2a1('0x1'));var path=require(_0xc2a1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc2a1('0x3'));var router=express[_0xc2a1('0x4')]();var fs_extra=require(_0xc2a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc2a1('0x6'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc2a1('0x7')]);router[_0xc2a1('0x8')](_0xc2a1('0x9'),auth[_0xc2a1('0xa')](),controller[_0xc2a1('0xb')]);router[_0xc2a1('0x8')](_0xc2a1('0xc'),auth[_0xc2a1('0xa')](),controller[_0xc2a1('0xd')]);router[_0xc2a1('0xe')]('/',auth[_0xc2a1('0xa')](),controller['create']);router[_0xc2a1('0xf')](_0xc2a1('0xc'),auth[_0xc2a1('0xa')](),controller['update']);router[_0xc2a1('0x10')](_0xc2a1('0xc'),auth['isAuthenticated'](),controller[_0xc2a1('0x11')]);module[_0xc2a1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 6b027c2..1e66cce 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 _0x4a0f=['attended','STRING','Yes','sequelize','moment','ENUM','blind'];(function(_0x3dc4d0,_0x5ba240){var _0x30669b=function(_0x4a8a1f){while(--_0x4a8a1f){_0x3dc4d0['push'](_0x3dc4d0['shift']());}};_0x30669b(++_0x5ba240);}(_0x4a0f,0x1ed));var _0xf4a0=function(_0x560542,_0x4c8c73){_0x560542=_0x560542-0x0;var _0x49f743=_0x4a0f[_0x560542];return _0x49f743;};'use strict';var Sequelize=require(_0xf4a0('0x0'));var moment=require(_0xf4a0('0x1'));module['exports']={'type':{'type':Sequelize[_0xf4a0('0x2')](_0xf4a0('0x3'),_0xf4a0('0x4'))},'result':{'type':Sequelize[_0xf4a0('0x5')]},'transfererchannel':{'type':Sequelize[_0xf4a0('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xf4a0('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf4a0('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf4a0('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xf4a0('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xf4a0('0x5')]},'transferercontext':{'type':Sequelize[_0xf4a0('0x5')]},'transfererexten':{'type':Sequelize[_0xf4a0('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xf4a0('0x5')]},'transfereechannel':{'type':Sequelize[_0xf4a0('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xf4a0('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xf4a0('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf4a0('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xf4a0('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf4a0('0x5')]},'isexternal':{'type':Sequelize[_0xf4a0('0x2')](_0xf4a0('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xf4a0('0x5')]}}; \ No newline at end of file +var _0x2ac6=['Yes','sequelize','ENUM','attended','STRING'];(function(_0x59abe4,_0x3ef04d){var _0x18e292=function(_0x4da8ed){while(--_0x4da8ed){_0x59abe4['push'](_0x59abe4['shift']());}};_0x18e292(++_0x3ef04d);}(_0x2ac6,0xf1));var _0x62ac=function(_0x1254a5,_0x2ba0be){_0x1254a5=_0x1254a5-0x0;var _0x2fbf81=_0x2ac6[_0x1254a5];return _0x2fbf81;};'use strict';var Sequelize=require(_0x62ac('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x62ac('0x1')]('blind',_0x62ac('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x62ac('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x62ac('0x3')]},'transferercalleridname':{'type':Sequelize[_0x62ac('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x62ac('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x62ac('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x62ac('0x3')]},'transferercontext':{'type':Sequelize[_0x62ac('0x3')]},'transfererexten':{'type':Sequelize[_0x62ac('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x62ac('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x62ac('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x62ac('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x62ac('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x62ac('0x3')]},'transfereecontext':{'type':Sequelize[_0x62ac('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x62ac('0x1')](_0x62ac('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x62ac('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index f832239..c73fc4e 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 _0xca42=['sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceTransferReport','include','findAll','catch','show','params','keys','intersection','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','limit','undefined','offset','count','status','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x104870,_0x410c33){var _0x2e3bf8=function(_0x271908){while(--_0x271908){_0x104870['push'](_0x104870['shift']());}};_0x2e3bf8(++_0x410c33);}(_0xca42,0xf2));var _0x2ca4=function(_0x3793f8,_0xf9ad68){_0x3793f8=_0x3793f8-0x0;var _0x3d17f9=_0xca42[_0x3793f8];return _0x3d17f9;};'use strict';var emlformat=require(_0x2ca4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ca4('0x1'));var jsonpatch=require(_0x2ca4('0x2'));var rp=require(_0x2ca4('0x3'));var moment=require(_0x2ca4('0x4'));var BPromise=require(_0x2ca4('0x5'));var Mustache=require(_0x2ca4('0x6'));var util=require(_0x2ca4('0x7'));var path=require(_0x2ca4('0x8'));var sox=require(_0x2ca4('0x9'));var csv=require(_0x2ca4('0xa'));var ejs=require(_0x2ca4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2ca4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ca4('0xa'));var querystring=require(_0x2ca4('0xd'));var Papa=require('papaparse');var Redis=require(_0x2ca4('0xe'));var authService=require(_0x2ca4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2ca4('0x10'));var hardwareService=require(_0x2ca4('0x11'));var logger=require('../../config/logger')(_0x2ca4('0x12'));var utils=require(_0x2ca4('0x13'));var config=require(_0x2ca4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ca4('0x15'))['db'];function respondWithStatusCode(_0x471c4c,_0x33afab){_0x33afab=_0x33afab||0xcc;return function(_0x27930a){if(_0x27930a){return _0x471c4c[_0x2ca4('0x16')](_0x33afab);}return _0x471c4c['status'](_0x33afab)['end']();};}function respondWithResult(_0x300c5f,_0x3a763c){_0x3a763c=_0x3a763c||0xc8;return function(_0x58e8be){if(_0x58e8be){return _0x300c5f['status'](_0x3a763c)[_0x2ca4('0x17')](_0x58e8be);}};}function respondWithFilteredResult(_0x2c2a40,_0x34c628){return function(_0x3961ef){if(_0x3961ef){var _0x116e85=typeof _0x34c628['offset']==='undefined'&&typeof _0x34c628[_0x2ca4('0x18')]===_0x2ca4('0x19');var _0x1716f1=_0x3961ef['count'];var _0x5398ad=_0x116e85?0x0:_0x34c628[_0x2ca4('0x1a')];var _0x5f1310=_0x116e85?_0x3961ef[_0x2ca4('0x1b')]:_0x34c628[_0x2ca4('0x1a')]+_0x34c628[_0x2ca4('0x18')];var _0x1f4e33;if(_0x5f1310>=_0x1716f1){_0x5f1310=_0x1716f1;_0x1f4e33=0xc8;}else{_0x1f4e33=0xce;}_0x2c2a40[_0x2ca4('0x1c')](_0x1f4e33);return _0x2c2a40[_0x2ca4('0x1d')](_0x2ca4('0x1e'),_0x5398ad+'-'+_0x5f1310+'/'+_0x1716f1)[_0x2ca4('0x17')](_0x3961ef);}return null;};}function patchUpdates(_0x20ba42){return function(_0x39f9cd){try{jsonpatch['apply'](_0x39f9cd,_0x20ba42,!![]);}catch(_0x39bf33){return BPromise[_0x2ca4('0x1f')](_0x39bf33);}return _0x39f9cd[_0x2ca4('0x20')]();};}function saveUpdates(_0x5864df,_0x3dc329){return function(_0x24db10){if(_0x24db10){return _0x24db10[_0x2ca4('0x21')](_0x5864df)[_0x2ca4('0x22')](function(_0x68ed70){return _0x68ed70;});}return null;};}function removeEntity(_0xd488fc,_0x417c8e){return function(_0x3ac345){if(_0x3ac345){return _0x3ac345[_0x2ca4('0x23')]()['then'](function(){_0xd488fc[_0x2ca4('0x1c')](0xcc)[_0x2ca4('0x24')]();});}};}function handleEntityNotFound(_0x3a6047,_0x650eb8){return function(_0x33e77d){if(!_0x33e77d){_0x3a6047['sendStatus'](0x194);}return _0x33e77d;};}function handleError(_0x5a174,_0x1e04b4){_0x1e04b4=_0x1e04b4||0x1f4;return function(_0x23572e){logger['error'](_0x23572e[_0x2ca4('0x25')]);if(_0x23572e[_0x2ca4('0x26')]){delete _0x23572e[_0x2ca4('0x26')];}_0x5a174['status'](_0x1e04b4)[_0x2ca4('0x27')](_0x23572e);};}exports[_0x2ca4('0x28')]=function(_0x1723d9,_0x29fc64){var _0x3ba6aa={},_0x1f85cf={},_0x4c595c={'count':0x0,'rows':[]};var _0x3a3228=_[_0x2ca4('0x29')](db['VoiceTransferReport'][_0x2ca4('0x2a')],function(_0x29fdef){return{'name':_0x29fdef[_0x2ca4('0x2b')],'type':_0x29fdef['type'][_0x2ca4('0x2c')]};});_0x1f85cf[_0x2ca4('0x2d')]=_['map'](_0x3a3228,_0x2ca4('0x26'));_0x1f85cf['query']=_['keys'](_0x1723d9[_0x2ca4('0x2e')]);_0x1f85cf[_0x2ca4('0x2f')]=_['intersection'](_0x1f85cf[_0x2ca4('0x2d')],_0x1f85cf[_0x2ca4('0x2e')]);_0x3ba6aa[_0x2ca4('0x30')]=_['intersection'](_0x1f85cf[_0x2ca4('0x2d')],qs['fields'](_0x1723d9[_0x2ca4('0x2e')][_0x2ca4('0x31')]));_0x3ba6aa[_0x2ca4('0x30')]=_0x3ba6aa[_0x2ca4('0x30')][_0x2ca4('0x32')]?_0x3ba6aa[_0x2ca4('0x30')]:_0x1f85cf[_0x2ca4('0x2d')];if(!_0x1723d9[_0x2ca4('0x2e')][_0x2ca4('0x33')](_0x2ca4('0x34'))){_0x3ba6aa[_0x2ca4('0x18')]=qs[_0x2ca4('0x18')](_0x1723d9[_0x2ca4('0x2e')]['limit']);_0x3ba6aa[_0x2ca4('0x1a')]=qs['offset'](_0x1723d9[_0x2ca4('0x2e')][_0x2ca4('0x1a')]);}_0x3ba6aa[_0x2ca4('0x35')]=qs[_0x2ca4('0x36')](_0x1723d9[_0x2ca4('0x2e')][_0x2ca4('0x36')]);_0x3ba6aa[_0x2ca4('0x37')]=qs[_0x2ca4('0x2f')](_[_0x2ca4('0x38')](_0x1723d9[_0x2ca4('0x2e')],_0x1f85cf[_0x2ca4('0x2f')]),_0x3a3228);if(_0x1723d9[_0x2ca4('0x2e')][_0x2ca4('0x39')]){_0x3ba6aa[_0x2ca4('0x37')]=_[_0x2ca4('0x3a')](_0x3ba6aa['where'],{'$or':_['map'](_0x3a3228,function(_0x4871d4){if(_0x4871d4[_0x2ca4('0x3b')]!==_0x2ca4('0x3c')){var _0x437c88={};_0x437c88[_0x4871d4[_0x2ca4('0x26')]]={'$like':'%'+_0x1723d9[_0x2ca4('0x2e')][_0x2ca4('0x39')]+'%'};return _0x437c88;}})});}_0x3ba6aa=_[_0x2ca4('0x3a')]({},_0x3ba6aa,_0x1723d9[_0x2ca4('0x3d')]);var _0x21e4a2={'where':_0x3ba6aa[_0x2ca4('0x37')]};return db[_0x2ca4('0x3e')]['count'](_0x21e4a2)[_0x2ca4('0x22')](function(_0x48521d){_0x4c595c['count']=_0x48521d;if(_0x1723d9['query']['includeAll']){_0x3ba6aa[_0x2ca4('0x3f')]=[{'all':!![]}];}return db[_0x2ca4('0x3e')][_0x2ca4('0x40')](_0x3ba6aa);})['then'](function(_0x1003b8){_0x4c595c['rows']=_0x1003b8;return _0x4c595c;})[_0x2ca4('0x22')](respondWithFilteredResult(_0x29fc64,_0x3ba6aa))[_0x2ca4('0x41')](handleError(_0x29fc64,null));};exports[_0x2ca4('0x42')]=function(_0x297336,_0x50599e){var _0x11a375={'raw':!![],'where':{'id':_0x297336[_0x2ca4('0x43')]['id']}},_0x45fd69={};_0x45fd69[_0x2ca4('0x2d')]=_[_0x2ca4('0x44')](db[_0x2ca4('0x3e')]['rawAttributes']);_0x45fd69[_0x2ca4('0x2e')]=_[_0x2ca4('0x44')](_0x297336['query']);_0x45fd69[_0x2ca4('0x2f')]=_[_0x2ca4('0x45')](_0x45fd69[_0x2ca4('0x2d')],_0x45fd69[_0x2ca4('0x2e')]);_0x11a375['attributes']=_[_0x2ca4('0x45')](_0x45fd69['model'],qs[_0x2ca4('0x31')](_0x297336['query'][_0x2ca4('0x31')]));_0x11a375[_0x2ca4('0x30')]=_0x11a375[_0x2ca4('0x30')][_0x2ca4('0x32')]?_0x11a375[_0x2ca4('0x30')]:_0x45fd69[_0x2ca4('0x2d')];if(_0x297336['query']['includeAll']){_0x11a375['include']=[{'all':!![]}];}_0x11a375=_[_0x2ca4('0x3a')]({},_0x11a375,_0x297336[_0x2ca4('0x3d')]);return db[_0x2ca4('0x3e')][_0x2ca4('0x46')](_0x11a375)[_0x2ca4('0x22')](handleEntityNotFound(_0x50599e,null))[_0x2ca4('0x22')](respondWithResult(_0x50599e,null))[_0x2ca4('0x41')](handleError(_0x50599e,null));};exports[_0x2ca4('0x47')]=function(_0x455f17,_0xeac9a5){return db['VoiceTransferReport'][_0x2ca4('0x47')](_0x455f17['body'],{})['then'](respondWithResult(_0xeac9a5,0xc9))['catch'](handleError(_0xeac9a5,null));};exports[_0x2ca4('0x21')]=function(_0x34e038,_0x461ea4){if(_0x34e038[_0x2ca4('0x48')]['id']){delete _0x34e038[_0x2ca4('0x48')]['id'];}return db[_0x2ca4('0x3e')]['find']({'where':{'id':_0x34e038[_0x2ca4('0x43')]['id']}})[_0x2ca4('0x22')](handleEntityNotFound(_0x461ea4,null))[_0x2ca4('0x22')](saveUpdates(_0x34e038[_0x2ca4('0x48')],null))[_0x2ca4('0x22')](respondWithResult(_0x461ea4,null))[_0x2ca4('0x41')](handleError(_0x461ea4,null));};exports[_0x2ca4('0x23')]=function(_0xf39347,_0x494c7a){return db['VoiceTransferReport'][_0x2ca4('0x46')]({'where':{'id':_0xf39347[_0x2ca4('0x43')]['id']}})[_0x2ca4('0x22')](handleEntityNotFound(_0x494c7a,null))[_0x2ca4('0x22')](removeEntity(_0x494c7a,null))[_0x2ca4('0x41')](handleError(_0x494c7a,null));};exports[_0x2ca4('0x49')]=function(_0x4ed6ec,_0x40596b){return db[_0x2ca4('0x3e')][_0x2ca4('0x49')]()[_0x2ca4('0x22')](respondWithResult(_0x40596b,null))['catch'](handleError(_0x40596b,null));}; \ No newline at end of file +var _0x8b0f=['VIRTUAL','merge','options','VoiceTransferReport','then','includeAll','include','findAll','rows','catch','show','params','keys','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','error','name','send','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8b0f,0x156));var _0xf8b0=function(_0x115bf2,_0x17b577){_0x115bf2=_0x115bf2-0x0;var _0x149a65=_0x8b0f[_0x115bf2];return _0x149a65;};'use strict';var emlformat=require(_0xf8b0('0x0'));var rimraf=require(_0xf8b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8b0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf8b0('0x3'));var Mustache=require('mustache');var util=require(_0xf8b0('0x4'));var path=require(_0xf8b0('0x5'));var sox=require(_0xf8b0('0x6'));var csv=require(_0xf8b0('0x7'));var ejs=require(_0xf8b0('0x8'));var fs=require('fs');var fs_extra=require(_0xf8b0('0x9'));var _=require(_0xf8b0('0xa'));var squel=require(_0xf8b0('0xb'));var crypto=require(_0xf8b0('0xc'));var jsforce=require(_0xf8b0('0xd'));var deskjs=require(_0xf8b0('0xe'));var toCsv=require(_0xf8b0('0x7'));var querystring=require(_0xf8b0('0xf'));var Papa=require(_0xf8b0('0x10'));var Redis=require(_0xf8b0('0x11'));var authService=require(_0xf8b0('0x12'));var qs=require(_0xf8b0('0x13'));var as=require(_0xf8b0('0x14'));var hardwareService=require(_0xf8b0('0x15'));var logger=require(_0xf8b0('0x16'))(_0xf8b0('0x17'));var utils=require(_0xf8b0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf8b0('0x19'));var db=require(_0xf8b0('0x1a'))['db'];function respondWithStatusCode(_0x143976,_0xc71aed){_0xc71aed=_0xc71aed||0xcc;return function(_0x20a53f){if(_0x20a53f){return _0x143976[_0xf8b0('0x1b')](_0xc71aed);}return _0x143976['status'](_0xc71aed)['end']();};}function respondWithResult(_0x844716,_0x518fcf){_0x518fcf=_0x518fcf||0xc8;return function(_0x57d24b){if(_0x57d24b){return _0x844716[_0xf8b0('0x1c')](_0x518fcf)['json'](_0x57d24b);}};}function respondWithFilteredResult(_0x52b2ab,_0x33257d){return function(_0xf65c58){if(_0xf65c58){var _0x4eea91=typeof _0x33257d[_0xf8b0('0x1d')]===_0xf8b0('0x1e')&&typeof _0x33257d[_0xf8b0('0x1f')]===_0xf8b0('0x1e');var _0x282af7=_0xf65c58['count'];var _0x19e28c=_0x4eea91?0x0:_0x33257d[_0xf8b0('0x1d')];var _0x4c3dd1=_0x4eea91?_0xf65c58[_0xf8b0('0x20')]:_0x33257d[_0xf8b0('0x1d')]+_0x33257d['limit'];var _0x1bd162;if(_0x4c3dd1>=_0x282af7){_0x4c3dd1=_0x282af7;_0x1bd162=0xc8;}else{_0x1bd162=0xce;}_0x52b2ab[_0xf8b0('0x1c')](_0x1bd162);return _0x52b2ab[_0xf8b0('0x21')](_0xf8b0('0x22'),_0x19e28c+'-'+_0x4c3dd1+'/'+_0x282af7)['json'](_0xf65c58);}return null;};}function patchUpdates(_0x315cf3){return function(_0x570285){try{jsonpatch[_0xf8b0('0x23')](_0x570285,_0x315cf3,!![]);}catch(_0x269892){return BPromise[_0xf8b0('0x24')](_0x269892);}return _0x570285[_0xf8b0('0x25')]();};}function saveUpdates(_0x59f02e,_0x10aba0){return function(_0x2b5ca0){if(_0x2b5ca0){return _0x2b5ca0['update'](_0x59f02e)['then'](function(_0x45df43){return _0x45df43;});}return null;};}function removeEntity(_0x1aa1f5,_0x440303){return function(_0x4314fc){if(_0x4314fc){return _0x4314fc[_0xf8b0('0x26')]()['then'](function(){_0x1aa1f5['status'](0xcc)[_0xf8b0('0x27')]();});}};}function handleEntityNotFound(_0x5e30b2,_0x3cf648){return function(_0x5e2cf0){if(!_0x5e2cf0){_0x5e30b2['sendStatus'](0x194);}return _0x5e2cf0;};}function handleError(_0x5115f1,_0x58f5b5){_0x58f5b5=_0x58f5b5||0x1f4;return function(_0x29b201){logger[_0xf8b0('0x28')](_0x29b201['stack']);if(_0x29b201[_0xf8b0('0x29')]){delete _0x29b201[_0xf8b0('0x29')];}_0x5115f1['status'](_0x58f5b5)[_0xf8b0('0x2a')](_0x29b201);};}exports[_0xf8b0('0x2b')]=function(_0x34df7d,_0x16b56a){var _0x65508b={},_0x371ff3={},_0x413b04={'count':0x0,'rows':[]};var _0x2d0efa=_['map'](db['VoiceTransferReport'][_0xf8b0('0x2c')],function(_0x579e91){return{'name':_0x579e91[_0xf8b0('0x2d')],'type':_0x579e91['type'][_0xf8b0('0x2e')]};});_0x371ff3['model']=_[_0xf8b0('0x2f')](_0x2d0efa,'name');_0x371ff3[_0xf8b0('0x30')]=_['keys'](_0x34df7d[_0xf8b0('0x30')]);_0x371ff3[_0xf8b0('0x31')]=_[_0xf8b0('0x32')](_0x371ff3[_0xf8b0('0x33')],_0x371ff3[_0xf8b0('0x30')]);_0x65508b[_0xf8b0('0x34')]=_[_0xf8b0('0x32')](_0x371ff3[_0xf8b0('0x33')],qs[_0xf8b0('0x35')](_0x34df7d[_0xf8b0('0x30')]['fields']));_0x65508b[_0xf8b0('0x34')]=_0x65508b[_0xf8b0('0x34')][_0xf8b0('0x36')]?_0x65508b[_0xf8b0('0x34')]:_0x371ff3['model'];if(!_0x34df7d['query'][_0xf8b0('0x37')](_0xf8b0('0x38'))){_0x65508b['limit']=qs[_0xf8b0('0x1f')](_0x34df7d[_0xf8b0('0x30')]['limit']);_0x65508b[_0xf8b0('0x1d')]=qs['offset'](_0x34df7d['query']['offset']);}_0x65508b[_0xf8b0('0x39')]=qs[_0xf8b0('0x3a')](_0x34df7d[_0xf8b0('0x30')][_0xf8b0('0x3a')]);_0x65508b[_0xf8b0('0x3b')]=qs[_0xf8b0('0x31')](_[_0xf8b0('0x3c')](_0x34df7d['query'],_0x371ff3['filters']),_0x2d0efa);if(_0x34df7d[_0xf8b0('0x30')][_0xf8b0('0x3d')]){_0x65508b[_0xf8b0('0x3b')]=_['merge'](_0x65508b['where'],{'$or':_['map'](_0x2d0efa,function(_0x17d95a){if(_0x17d95a[_0xf8b0('0x3e')]!==_0xf8b0('0x3f')){var _0x295ccd={};_0x295ccd[_0x17d95a[_0xf8b0('0x29')]]={'$like':'%'+_0x34df7d[_0xf8b0('0x30')]['filter']+'%'};return _0x295ccd;}})});}_0x65508b=_[_0xf8b0('0x40')]({},_0x65508b,_0x34df7d[_0xf8b0('0x41')]);var _0x5c2969={'where':_0x65508b[_0xf8b0('0x3b')]};return db[_0xf8b0('0x42')][_0xf8b0('0x20')](_0x5c2969)[_0xf8b0('0x43')](function(_0x40605a){_0x413b04['count']=_0x40605a;if(_0x34df7d[_0xf8b0('0x30')][_0xf8b0('0x44')]){_0x65508b[_0xf8b0('0x45')]=[{'all':!![]}];}return db[_0xf8b0('0x42')][_0xf8b0('0x46')](_0x65508b);})[_0xf8b0('0x43')](function(_0x5ab9be){_0x413b04[_0xf8b0('0x47')]=_0x5ab9be;return _0x413b04;})[_0xf8b0('0x43')](respondWithFilteredResult(_0x16b56a,_0x65508b))[_0xf8b0('0x48')](handleError(_0x16b56a,null));};exports[_0xf8b0('0x49')]=function(_0x5da979,_0x42d6fa){var _0x12aa45={'raw':!![],'where':{'id':_0x5da979[_0xf8b0('0x4a')]['id']}},_0x3a5aaa={};_0x3a5aaa[_0xf8b0('0x33')]=_[_0xf8b0('0x4b')](db[_0xf8b0('0x42')]['rawAttributes']);_0x3a5aaa[_0xf8b0('0x30')]=_[_0xf8b0('0x4b')](_0x5da979[_0xf8b0('0x30')]);_0x3a5aaa[_0xf8b0('0x31')]=_[_0xf8b0('0x32')](_0x3a5aaa[_0xf8b0('0x33')],_0x3a5aaa[_0xf8b0('0x30')]);_0x12aa45[_0xf8b0('0x34')]=_[_0xf8b0('0x32')](_0x3a5aaa['model'],qs['fields'](_0x5da979[_0xf8b0('0x30')]['fields']));_0x12aa45['attributes']=_0x12aa45[_0xf8b0('0x34')][_0xf8b0('0x36')]?_0x12aa45['attributes']:_0x3a5aaa[_0xf8b0('0x33')];if(_0x5da979[_0xf8b0('0x30')]['includeAll']){_0x12aa45[_0xf8b0('0x45')]=[{'all':!![]}];}_0x12aa45=_[_0xf8b0('0x40')]({},_0x12aa45,_0x5da979[_0xf8b0('0x41')]);return db[_0xf8b0('0x42')]['find'](_0x12aa45)['then'](handleEntityNotFound(_0x42d6fa,null))['then'](respondWithResult(_0x42d6fa,null))[_0xf8b0('0x48')](handleError(_0x42d6fa,null));};exports[_0xf8b0('0x4c')]=function(_0x386799,_0xd8da13){return db[_0xf8b0('0x42')][_0xf8b0('0x4c')](_0x386799[_0xf8b0('0x4d')],{})[_0xf8b0('0x43')](respondWithResult(_0xd8da13,0xc9))[_0xf8b0('0x48')](handleError(_0xd8da13,null));};exports[_0xf8b0('0x4e')]=function(_0x222530,_0x4d5b94){if(_0x222530['body']['id']){delete _0x222530['body']['id'];}return db[_0xf8b0('0x42')][_0xf8b0('0x4f')]({'where':{'id':_0x222530[_0xf8b0('0x4a')]['id']}})[_0xf8b0('0x43')](handleEntityNotFound(_0x4d5b94,null))[_0xf8b0('0x43')](saveUpdates(_0x222530['body'],null))[_0xf8b0('0x43')](respondWithResult(_0x4d5b94,null))[_0xf8b0('0x48')](handleError(_0x4d5b94,null));};exports[_0xf8b0('0x26')]=function(_0x1b8446,_0x1ea6a1){return db[_0xf8b0('0x42')][_0xf8b0('0x4f')]({'where':{'id':_0x1b8446['params']['id']}})['then'](handleEntityNotFound(_0x1ea6a1,null))['then'](removeEntity(_0x1ea6a1,null))[_0xf8b0('0x48')](handleError(_0x1ea6a1,null));};exports[_0xf8b0('0x50')]=function(_0x1ff3c4,_0x2db35a){return db[_0xf8b0('0x42')][_0xf8b0('0x50')]()[_0xf8b0('0x43')](respondWithResult(_0x2db35a,null))[_0xf8b0('0x48')](handleError(_0x2db35a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 0268c09..326e893 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 _0xb570=['path','../../config/environment','define','VoiceTransferReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4e9438,_0x25146a){var _0x27a778=function(_0x28f748){while(--_0x28f748){_0x4e9438['push'](_0x4e9438['shift']());}};_0x27a778(++_0x25146a);}(_0xb570,0x144));var _0x0b57=function(_0x3ba01f,_0x3c000e){_0x3ba01f=_0x3ba01f-0x0;var _0x53f5a5=_0xb570[_0x3ba01f];return _0x53f5a5;};'use strict';var _=require(_0x0b57('0x0'));var util=require(_0x0b57('0x1'));var logger=require(_0x0b57('0x2'))(_0x0b57('0x3'));var moment=require(_0x0b57('0x4'));var BPromise=require('bluebird');var rp=require(_0x0b57('0x5'));var fs=require('fs');var path=require(_0x0b57('0x6'));var rimraf=require('rimraf');var config=require(_0x0b57('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0xe06428,_0x34dcd7){return _0xe06428[_0x0b57('0x8')](_0x0b57('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96a5=['exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x55afdb,_0x48d0e4){var _0x115fb2=function(_0x26f7bd){while(--_0x26f7bd){_0x55afdb['push'](_0x55afdb['shift']());}};_0x115fb2(++_0x48d0e4);}(_0x96a5,0xe1));var _0x596a=function(_0x9a7d08,_0xe9048){_0x9a7d08=_0x9a7d08-0x0;var _0x58e6e8=_0x96a5[_0x9a7d08];return _0x58e6e8;};'use strict';var _=require(_0x596a('0x0'));var util=require('util');var logger=require(_0x596a('0x1'))(_0x596a('0x2'));var moment=require('moment');var BPromise=require(_0x596a('0x3'));var rp=require(_0x596a('0x4'));var fs=require('fs');var path=require(_0x596a('0x5'));var rimraf=require(_0x596a('0x6'));var config=require(_0x596a('0x7'));var attributes=require(_0x596a('0x8'));module[_0x596a('0x9')]=function(_0x230e9c,_0x512fe8){return _0x230e9c[_0x596a('0xa')](_0x596a('0xb'),attributes,{'tableName':_0x596a('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 be61707..c84ab56 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 _0xe184=['message','result','catch','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0xe184,0x188));var _0x4e18=function(_0x24c72d,_0x58d17f){_0x24c72d=_0x24c72d-0x0;var _0x1176b9=_0xe184[_0x24c72d];return _0x1176b9;};'use strict';var _=require(_0x4e18('0x0'));var util=require(_0x4e18('0x1'));var moment=require(_0x4e18('0x2'));var BPromise=require(_0x4e18('0x3'));var rs=require(_0x4e18('0x4'));var fs=require('fs');var Redis=require(_0x4e18('0x5'));var db=require(_0x4e18('0x6'))['db'];var utils=require(_0x4e18('0x7'));var logger=require(_0x4e18('0x8'))(_0x4e18('0x9'));var config=require(_0x4e18('0xa'));var jayson=require(_0x4e18('0xb'));var client=jayson[_0x4e18('0xc')][_0x4e18('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x27285c,_0x6a9895,_0x3c5206){return new BPromise(function(_0x1446b4,_0x160be5){return client[_0x4e18('0xe')](_0x27285c,_0x3c5206)[_0x4e18('0xf')](function(_0xab9ac0){logger[_0x4e18('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x6a9895,_0x4e18('0x11'));logger[_0x4e18('0x12')](_0x4e18('0x13'),_0x6a9895,'request\x20sent',JSON[_0x4e18('0x14')](_0xab9ac0));if(_0xab9ac0[_0x4e18('0x15')]){if(_0xab9ac0[_0x4e18('0x15')][_0x4e18('0x16')]===0x1f4){logger[_0x4e18('0x15')](_0x4e18('0x17'),_0x6a9895,_0xab9ac0['error']['message']);return _0x160be5(_0xab9ac0[_0x4e18('0x15')][_0x4e18('0x18')]);}logger[_0x4e18('0x15')](_0x4e18('0x17'),_0x6a9895,_0xab9ac0[_0x4e18('0x15')][_0x4e18('0x18')]);return _0x1446b4(_0xab9ac0['error'][_0x4e18('0x18')]);}else{logger['info'](_0x4e18('0x17'),_0x6a9895,'request\x20sent');_0x1446b4(_0xab9ac0[_0x4e18('0x19')][_0x4e18('0x18')]);}})[_0x4e18('0x1a')](function(_0x1e46a9){logger[_0x4e18('0x15')](_0x4e18('0x17'),_0x6a9895,_0x1e46a9);_0x160be5(_0x1e46a9);});});}exports['CreateVoiceTransferReport']=function(_0x28e7e2){var _0x253aa2=this;return new Promise(function(_0x226773,_0xe1979a){return db[_0x4e18('0x1b')][_0x4e18('0x1c')](_0x28e7e2['body'],{'raw':_0x28e7e2[_0x4e18('0x1d')]?_0x28e7e2[_0x4e18('0x1d')][_0x4e18('0x1e')]===undefined?!![]:![]:!![]})[_0x4e18('0xf')](function(_0x2603d8){logger[_0x4e18('0x10')]('CreateVoiceTransferReport',_0x28e7e2);logger['debug'](_0x4e18('0x1f'),_0x28e7e2,JSON['stringify'](_0x2603d8));_0x226773(_0x2603d8);})['catch'](function(_0x32af2a){logger[_0x4e18('0x15')](_0x4e18('0x1f'),_0x32af2a[_0x4e18('0x18')],_0x28e7e2);_0xe1979a(_0x253aa2['error'](0x1f4,_0x32af2a[_0x4e18('0x18')]));});});}; \ No newline at end of file +var _0x9ff3=['raw','CreateVoiceTransferReport','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','VoiceTransferReport','create','body','options'];(function(_0x39653b,_0x218650){var _0x5dbb60=function(_0x1f2bec){while(--_0x1f2bec){_0x39653b['push'](_0x39653b['shift']());}};_0x5dbb60(++_0x218650);}(_0x9ff3,0x115));var _0x39ff=function(_0x226e0b,_0x5cbc29){_0x226e0b=_0x226e0b-0x0;var _0x5f2cd5=_0x9ff3[_0x226e0b];return _0x5f2cd5;};'use strict';var _=require(_0x39ff('0x0'));var util=require(_0x39ff('0x1'));var moment=require('moment');var BPromise=require(_0x39ff('0x2'));var rs=require(_0x39ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x39ff('0x4'));var logger=require('../../config/logger')(_0x39ff('0x5'));var config=require(_0x39ff('0x6'));var jayson=require(_0x39ff('0x7'));var client=jayson['client'][_0x39ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cf546,_0x4fa51e,_0x49ecdb){return new BPromise(function(_0x3f2474,_0x1e8a52){return client[_0x39ff('0x9')](_0x4cf546,_0x49ecdb)[_0x39ff('0xa')](function(_0x1da3aa){logger[_0x39ff('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x4fa51e,_0x39ff('0xc'));logger[_0x39ff('0xd')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4fa51e,_0x39ff('0xc'),JSON['stringify'](_0x1da3aa));if(_0x1da3aa[_0x39ff('0xe')]){if(_0x1da3aa[_0x39ff('0xe')]['code']===0x1f4){logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x4fa51e,_0x1da3aa[_0x39ff('0xe')][_0x39ff('0x10')]);return _0x1e8a52(_0x1da3aa[_0x39ff('0xe')][_0x39ff('0x10')]);}logger[_0x39ff('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x4fa51e,_0x1da3aa[_0x39ff('0xe')][_0x39ff('0x10')]);return _0x3f2474(_0x1da3aa['error'][_0x39ff('0x10')]);}else{logger[_0x39ff('0xb')](_0x39ff('0xf'),_0x4fa51e,_0x39ff('0xc'));_0x3f2474(_0x1da3aa[_0x39ff('0x11')][_0x39ff('0x10')]);}})[_0x39ff('0x12')](function(_0x57b324){logger['error'](_0x39ff('0xf'),_0x4fa51e,_0x57b324);_0x1e8a52(_0x57b324);});});}exports['CreateVoiceTransferReport']=function(_0xafa265){var _0x15e3be=this;return new Promise(function(_0x4512f1,_0x556544){return db[_0x39ff('0x13')][_0x39ff('0x14')](_0xafa265[_0x39ff('0x15')],{'raw':_0xafa265[_0x39ff('0x16')]?_0xafa265[_0x39ff('0x16')][_0x39ff('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x19faab){logger[_0x39ff('0xb')]('CreateVoiceTransferReport',_0xafa265);logger[_0x39ff('0xd')](_0x39ff('0x18'),_0xafa265,JSON['stringify'](_0x19faab));_0x4512f1(_0x19faab);})[_0x39ff('0x12')](function(_0x17a789){logger[_0x39ff('0xe')](_0x39ff('0x18'),_0x17a789[_0x39ff('0x10')],_0xafa265);_0x556544(_0x15e3be[_0x39ff('0xe')](0x1f4,_0x17a789[_0x39ff('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 081b1eb..3a61122 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 _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x462345,_0x3ef834){var _0x397683=function(_0x2ea21d){while(--_0x2ea21d){_0x462345['push'](_0x462345['shift']());}};_0x397683(++_0x3ef834);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb4e6[_0x2064e5];return _0x21a233;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file +var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x53c8b8,_0x342fb3){var _0x59b9fa=function(_0x1bd129){while(--_0x1bd129){_0x53c8b8['push'](_0x53c8b8['shift']());}};_0x59b9fa(++_0x342fb3);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb4e6[_0x53ccf2];return _0x5a2964;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index cfadf70..70b327f 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 _0x12ec=['stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','code','message','result','catch','User','findOne','agent','then','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','redis','defaults','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0x12ec,0x1d9));var _0xc12e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x12ec[_0x47e7cb];return _0x2a8874;};'use strict';var path=require(_0xc12e('0x0'));var fs=require('fs');var _=require(_0xc12e('0x1'));var db=require(_0xc12e('0x2'))['db'];var config=require(_0xc12e('0x3'));var util=require(_0xc12e('0x4'));var BPromise=require(_0xc12e('0x5'));var jayson=require(_0xc12e('0x6'));var amiClient=jayson['client'][_0xc12e('0x7')]({'port':0x232a});var logger=require(_0xc12e('0x8'))(_0xc12e('0x9'));var Redis=require(_0xc12e('0xa'));config[_0xc12e('0xb')]=_[_0xc12e('0xc')](config[_0xc12e('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc12e('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xc12e('0xd'),'required':[!![],_0xc12e('0xe')]},'callNumber':{'type':_0xc12e('0xf'),'required':[!![],_0xc12e('0x10')]},'callerId':{'type':_0xc12e('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xc12e('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xc12e('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc12e('0xd'),'required':[!![],_0xc12e('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc12e('0xe')]},'sessionId':{'type':_0xc12e('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xc12e('0xf'),'required':[!![],_0xc12e('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xc12e('0xd'),'required':[!![],_0xc12e('0xe')]},'sessionId':{'type':_0xc12e('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xc12e('0xd'),'required':[!![],_0xc12e('0xe')]},'sessionId':{'type':_0xc12e('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xc12e('0xd'),'required':[!![],_0xc12e('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xc12e('0xd'),'required':[!![],_0xc12e('0xe')]}});function emit(_0x1c4041,_0x56ec06,_0x2376a2){logger[_0xc12e('0x12')](_0x1c4041,_0x56ec06,JSON[_0xc12e('0x13')](_0x2376a2));io['to'](_0x1c4041)[_0xc12e('0x14')](_0x56ec06,_0x2376a2);}function handleError(_0x43a038){return function(_0x44de6a){console[_0xc12e('0x15')](_0xc12e('0x16'),_0x44de6a,_0x44de6a instanceof RangeError);logger[_0xc12e('0x17')](_0x44de6a[_0xc12e('0x18')]);if(_0x44de6a instanceof RangeError){if(_0x44de6a[_0xc12e('0x19')]){delete _0x44de6a[_0xc12e('0x19')];}_0x43a038['status'](0x194)['send'](_0x44de6a);}else{if(_0x44de6a[_0xc12e('0x19')]){delete _0x44de6a[_0xc12e('0x19')];}_0x43a038[_0xc12e('0x1a')](0x1f4)[_0xc12e('0x1b')](_0x44de6a);}};}function checkError(){return function(_0xaf0289){if(!_0xaf0289){throw new RangeError(_0xc12e('0x1c'));}return _0xaf0289;};}function respondWithRpcPromise(_0x5974b9,_0x1f761e){return new BPromise(function(_0x223d74,_0x394116){var _0x5ce75c=amiClient;return _0x5ce75c[_0xc12e('0x1d')](_0x5974b9,_0x1f761e)['then'](function(_0x17b423){if(_0x17b423[_0xc12e('0x17')]){if(_0x17b423[_0xc12e('0x17')][_0xc12e('0x1e')]===0x1f4){return _0x394116(_0x17b423[_0xc12e('0x17')][_0xc12e('0x1f')]);}return _0x223d74(_0x17b423[_0xc12e('0x17')]['message']);}else{_0x223d74(_0x17b423[_0xc12e('0x20')]);}})[_0xc12e('0x21')](function(_0x46758d){_0x394116(_0x46758d);});});}function getAgent(_0x24d805){return db[_0xc12e('0x22')][_0xc12e('0x23')]({'where':{'id':_0x24d805,'role':_0xc12e('0x24')}})[_0xc12e('0x25')](checkError());}function getAgentCheckSession(_0x3ab48b,_0x2f1329){return new BPromise(function(_0x488d9a,_0xad1353){var _0x2fea2e=respondWithRpcPromise('VoiceChannels');var _0x1eefbc=getAgent(_0x3ab48b);Promise['all']([_0x2fea2e,_0x1eefbc])[_0xc12e('0x25')](function(_0x377dd8){var _0x1ef511=_0x377dd8[0x0];var _0x58524a=_0x377dd8[0x1];var _0x34692f=_[_0xc12e('0x26')](_0x1ef511[_0xc12e('0x27')],function(_0x4676c8){return _0x4676c8[_0xc12e('0x28')]==_0x58524a['id']&&_0x4676c8[_0xc12e('0x29')]==_0x2f1329;});if(_0x34692f[_0xc12e('0x2a')]==0x1){_0x488d9a(_0x58524a);}else{_0xad1353(new RangeError(_0xc12e('0x2b')+_0x2f1329+_0xc12e('0x2c')));}});});}exports[_0xc12e('0x2d')]=function(_0x3398c8,_0x4617e9){logger[_0xc12e('0x12')](_0xc12e('0x2e'),_0x3398c8[_0xc12e('0x2f')]);var _0x3e128a=originateValidation[_0xc12e('0x30')](_0x3398c8['body']);if(_0x3e128a[_0xc12e('0x2a')]>0x0){return _0x4617e9[_0xc12e('0x1a')](0x190)[_0xc12e('0x31')](_0x3e128a);}var _0x19eecf=_0x3398c8[_0xc12e('0x2f')][_0xc12e('0x32')];var _0x1e920d=_0x3398c8[_0xc12e('0x2f')][_0xc12e('0x33')];var _0x35d7c6=_0x3398c8[_0xc12e('0x2f')][_0xc12e('0x34')];var _0x256c42=_0x3398c8[_0xc12e('0x2f')][_0xc12e('0x35')];return getAgent(_0x19eecf)[_0xc12e('0x25')](function(_0x1198d2){logger[_0xc12e('0x12')]('entityFound:',_0x1198d2['name']);emit(util[_0xc12e('0x36')](_0xc12e('0x37'),_0x1198d2['name']),_0xc12e('0x38'),{'callNumber':_0x1e920d,'callerId':_0x35d7c6,'callbackUrl':_0x256c42});return _0x4617e9[_0xc12e('0x1a')](0xc8)[_0xc12e('0x31')]({'error':![],'message':_0xc12e('0x39')});})[_0xc12e('0x21')](handleError(_0x4617e9));};exports[_0xc12e('0x3a')]=function(_0x5caf7a,_0x2e07fa){logger['info'](_0xc12e('0x3b'),_0x5caf7a[_0xc12e('0x2f')]);var _0x17ca1d=hangupValidation[_0xc12e('0x30')](_0x5caf7a[_0xc12e('0x2f')]);if(_0x17ca1d['length']>0x0){return _0x2e07fa[_0xc12e('0x1a')](0x190)[_0xc12e('0x31')](_0x17ca1d);}var _0x1d930f=_0x5caf7a[_0xc12e('0x2f')][_0xc12e('0x32')];var _0x5a05bc=_0x5caf7a[_0xc12e('0x2f')][_0xc12e('0x29')];return getAgent(_0x1d930f)[_0xc12e('0x25')](function(_0x29161d){logger[_0xc12e('0x12')]('entityFound:',_0x29161d[_0xc12e('0x19')]);emit(util[_0xc12e('0x36')](_0xc12e('0x37'),_0x29161d[_0xc12e('0x19')]),_0xc12e('0x3c'),{'sessionId':_0x5a05bc});return _0x2e07fa[_0xc12e('0x1a')](0xc8)[_0xc12e('0x31')]({'error':![],'message':_0xc12e('0x3d')});})[_0xc12e('0x21')](handleError(_0x2e07fa));};exports[_0xc12e('0x3e')]=function(_0x16fb67,_0x28adc2){logger[_0xc12e('0x12')](_0xc12e('0x3f'),_0x16fb67[_0xc12e('0x2f')]);var _0x1c99af=answerValidation[_0xc12e('0x30')](_0x16fb67[_0xc12e('0x2f')]);if(_0x1c99af[_0xc12e('0x2a')]>0x0){return _0x28adc2[_0xc12e('0x1a')](0x190)[_0xc12e('0x31')](_0x1c99af);}var _0x16b9cc=_0x16fb67[_0xc12e('0x2f')]['userId'];var _0x10431f=_0x16fb67[_0xc12e('0x2f')][_0xc12e('0x29')];return getAgent(_0x16b9cc)[_0xc12e('0x25')](function(_0x3889ae){logger[_0xc12e('0x12')](_0xc12e('0x40'),_0x3889ae[_0xc12e('0x19')]);emit(util[_0xc12e('0x36')]('user:%s',_0x3889ae[_0xc12e('0x19')]),_0xc12e('0x41'),{'sessionId':_0x10431f});return _0x28adc2[_0xc12e('0x1a')](0xc8)[_0xc12e('0x31')]({'error':![],'message':_0xc12e('0x42')});})['catch'](handleError(_0x28adc2));};exports[_0xc12e('0x43')]=function(_0x38c78d,_0x1faeb2){logger[_0xc12e('0x12')](_0xc12e('0x44'),_0x38c78d[_0xc12e('0x2f')]);var _0x63bcfd=holdValidation[_0xc12e('0x30')](_0x38c78d[_0xc12e('0x2f')]);if(_0x63bcfd[_0xc12e('0x2a')]>0x0){return _0x1faeb2[_0xc12e('0x1a')](0x190)[_0xc12e('0x31')](_0x63bcfd);}var _0x3c8d51=_0x38c78d[_0xc12e('0x2f')]['userId'];var _0x2bb62d=_0x38c78d['body'][_0xc12e('0x29')];return getAgent(_0x3c8d51)['then'](function(_0x55d842){logger[_0xc12e('0x12')](_0xc12e('0x40'),_0x55d842[_0xc12e('0x19')]);emit(util[_0xc12e('0x36')](_0xc12e('0x37'),_0x55d842[_0xc12e('0x19')]),_0xc12e('0x45'),{'sessionId':_0x2bb62d});return _0x1faeb2['status'](0xc8)[_0xc12e('0x31')]({'error':![],'message':_0xc12e('0x46')});})[_0xc12e('0x21')](handleError(_0x1faeb2));};exports[_0xc12e('0x47')]=function(_0x243ed7,_0x13debd){logger[_0xc12e('0x12')](_0xc12e('0x48'),_0x243ed7['body']);var _0x586cc9=unholdValidation[_0xc12e('0x30')](_0x243ed7['body']);if(_0x586cc9['length']>0x0){return _0x13debd[_0xc12e('0x1a')](0x190)[_0xc12e('0x31')](_0x586cc9);}var _0x3af56c=_0x243ed7['body'][_0xc12e('0x32')];var _0x52e9a8=_0x243ed7[_0xc12e('0x2f')][_0xc12e('0x29')];return getAgent(_0x3af56c)['then'](function(_0x3148b9){logger[_0xc12e('0x12')](_0xc12e('0x40'),_0x3148b9[_0xc12e('0x19')]);emit(util[_0xc12e('0x36')](_0xc12e('0x37'),_0x3148b9[_0xc12e('0x19')]),'webbar:unhold',{'sessionId':_0x52e9a8});return _0x13debd[_0xc12e('0x1a')](0xc8)[_0xc12e('0x31')]({'error':![],'message':'unhold\x20executed!'});})[_0xc12e('0x21')](handleError(_0x13debd));};exports[_0xc12e('0x49')]=function(_0x3d706f,_0x4fe180){logger['info']('calls\x20fired:',_0x4fe180[_0xc12e('0x2f')]);var _0x1e0948=callsValidation[_0xc12e('0x30')](_0x3d706f[_0xc12e('0x2f')]);if(_0x1e0948[_0xc12e('0x2a')]>0x0){return _0x4fe180[_0xc12e('0x1a')](0x190)[_0xc12e('0x31')](_0x1e0948);}var _0x20ae73=_0x3d706f[_0xc12e('0x2f')]['userId'];var _0x4d3398=respondWithRpcPromise('VoiceChannels');var _0x588738=getAgent(_0x20ae73);return Promise[_0xc12e('0x4a')]([_0x4d3398,_0x588738])[_0xc12e('0x25')](function(_0x26e7ce){var _0xf8c531=_0x26e7ce[0x0];var _0x2fde71=_0x26e7ce[0x1];var _0x1115b6=_[_0xc12e('0x26')](_0xf8c531[_0xc12e('0x27')],function(_0x50bf72){return _0x50bf72[_0xc12e('0x28')]==_0x2fde71['id'];});return _0x4fe180[_0xc12e('0x1a')](0xc8)['json']({'count':_0x1115b6[_0xc12e('0x2a')],'rows':_0x1115b6});})['catch'](handleError(_0x4fe180));};exports[_0xc12e('0x4b')]=function(_0x2709e7,_0x43402d){logger[_0xc12e('0x12')](_0xc12e('0x4c'),_0x2709e7[_0xc12e('0x2f')]);var _0x4af457=conferenceValidation[_0xc12e('0x30')](_0x2709e7[_0xc12e('0x2f')]);if(_0x4af457[_0xc12e('0x2a')]>0x0){return _0x43402d['status'](0x190)[_0xc12e('0x31')](_0x4af457);}var _0x2a078e=_0x2709e7[_0xc12e('0x2f')][_0xc12e('0x32')];return getAgent(_0x2a078e)[_0xc12e('0x25')](function(_0x1a8c1e){logger[_0xc12e('0x12')](_0xc12e('0x40'),_0x1a8c1e[_0xc12e('0x19')]);emit(util[_0xc12e('0x36')](_0xc12e('0x37'),_0x1a8c1e['name']),_0xc12e('0x4d'));return _0x43402d[_0xc12e('0x1a')](0xc8)[_0xc12e('0x31')]({'error':![],'message':_0xc12e('0x4e')});})[_0xc12e('0x21')](handleError(_0x43402d));};exports[_0xc12e('0x4f')]=function(_0x2e934d,_0xadc42e){logger[_0xc12e('0x12')]('transfer\x20fired:',_0x2e934d[_0xc12e('0x2f')]);var _0xe4f863=transferValidation[_0xc12e('0x30')](_0x2e934d[_0xc12e('0x2f')]);if(_0xe4f863[_0xc12e('0x2a')]>0x0){return _0xadc42e[_0xc12e('0x1a')](0x190)[_0xc12e('0x31')](_0xe4f863);}var _0x3d3441=_0x2e934d[_0xc12e('0x2f')][_0xc12e('0x32')];var _0x28bc6c=_0x2e934d['body'][_0xc12e('0x29')];var _0x180049=_0x2e934d[_0xc12e('0x2f')][_0xc12e('0x50')];return getAgent(_0x3d3441)[_0xc12e('0x25')](function(_0x17d4bf){logger['info'](_0xc12e('0x40'),_0x17d4bf[_0xc12e('0x19')]);emit(util[_0xc12e('0x36')]('user:%s',_0x17d4bf[_0xc12e('0x19')]),'webbar:transfer',{'sessionId':_0x28bc6c,'transferNumber':_0x180049});return _0xadc42e[_0xc12e('0x1a')](0xc8)[_0xc12e('0x31')]({'error':![],'message':_0xc12e('0x51')});})[_0xc12e('0x21')](handleError(_0xadc42e));}; \ No newline at end of file +var _0x63c9=['calls\x20fired:','conference','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','redis','localhost','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','NotFound','request','error','code','message','result','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','userId','callNumber','callbackUrl','entityFound:','format','originate\x20executed!','catch','hangup','sessionId','user:%s','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','unhold\x20executed!','calls'];(function(_0x5c7e1f,_0x2b323e){var _0x491712=function(_0x2ed016){while(--_0x2ed016){_0x5c7e1f['push'](_0x5c7e1f['shift']());}};_0x491712(++_0x2b323e);}(_0x63c9,0x97));var _0x963c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x63c9[_0x4565bf];return _0x5610ba;};'use strict';var path=require(_0x963c('0x0'));var fs=require('fs');var _=require(_0x963c('0x1'));var db=require(_0x963c('0x2'))['db'];var config=require(_0x963c('0x3'));var util=require('util');var BPromise=require(_0x963c('0x4'));var jayson=require(_0x963c('0x5'));var amiClient=jayson[_0x963c('0x6')][_0x963c('0x7')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require('ioredis');config[_0x963c('0x8')]=_['defaults'](config[_0x963c('0x8')],{'host':_0x963c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x963c('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x963c('0xa')]},'callNumber':{'type':_0x963c('0xb'),'required':[!![],_0x963c('0xc')]},'callerId':{'type':_0x963c('0xb')},'callbackUrl':{'type':_0x963c('0xb')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x963c('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x963c('0xd'),'required':[!![],_0x963c('0xa')]},'sessionId':{'type':_0x963c('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x963c('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x963c('0xb'),'required':[!![],_0x963c('0xe')]},'transferNumber':{'type':_0x963c('0xb'),'required':[!![],_0x963c('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x963c('0xd'),'required':[!![],_0x963c('0xa')]},'sessionId':{'type':_0x963c('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x963c('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x963c('0xd'),'required':[!![],_0x963c('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':_0x963c('0xd'),'required':[!![],_0x963c('0xa')]}});function emit(_0x3a60c6,_0x183a35,_0x1119d8){logger[_0x963c('0x10')](_0x3a60c6,_0x183a35,JSON[_0x963c('0x11')](_0x1119d8));io['to'](_0x3a60c6)[_0x963c('0x12')](_0x183a35,_0x1119d8);}function handleError(_0x4d479b){return function(_0x3e1746){console['log'](_0x963c('0x13'),_0x3e1746,_0x3e1746 instanceof RangeError);logger['error'](_0x3e1746[_0x963c('0x14')]);if(_0x3e1746 instanceof RangeError){if(_0x3e1746[_0x963c('0x15')]){delete _0x3e1746[_0x963c('0x15')];}_0x4d479b[_0x963c('0x16')](0x194)['send'](_0x3e1746);}else{if(_0x3e1746[_0x963c('0x15')]){delete _0x3e1746[_0x963c('0x15')];}_0x4d479b[_0x963c('0x16')](0x1f4)['send'](_0x3e1746);}};}function checkError(){return function(_0x245fe1){if(!_0x245fe1){throw new RangeError(_0x963c('0x17'));}return _0x245fe1;};}function respondWithRpcPromise(_0x417218,_0x1d3f0b){return new BPromise(function(_0x1afaaf,_0x4b566d){var _0x5a10e0=amiClient;return _0x5a10e0[_0x963c('0x18')](_0x417218,_0x1d3f0b)['then'](function(_0x145a07){if(_0x145a07[_0x963c('0x19')]){if(_0x145a07[_0x963c('0x19')][_0x963c('0x1a')]===0x1f4){return _0x4b566d(_0x145a07[_0x963c('0x19')]['message']);}return _0x1afaaf(_0x145a07[_0x963c('0x19')][_0x963c('0x1b')]);}else{_0x1afaaf(_0x145a07[_0x963c('0x1c')]);}})['catch'](function(_0x10cf35){_0x4b566d(_0x10cf35);});});}function getAgent(_0x53f145){return db[_0x963c('0x1d')][_0x963c('0x1e')]({'where':{'id':_0x53f145,'role':_0x963c('0x1f')}})[_0x963c('0x20')](checkError());}function getAgentCheckSession(_0x4bce70,_0x34907f){return new BPromise(function(_0x467d4c,_0x431384){var _0x36201f=respondWithRpcPromise(_0x963c('0x21'));var _0x1ff286=getAgent(_0x4bce70);Promise[_0x963c('0x22')]([_0x36201f,_0x1ff286])[_0x963c('0x20')](function(_0x520589){var _0x595606=_0x520589[0x0];var _0x2a313d=_0x520589[0x1];var _0xe22558=_[_0x963c('0x23')](_0x595606[_0x963c('0x24')],function(_0x5f9376){return _0x5f9376[_0x963c('0x25')]==_0x2a313d['id']&&_0x5f9376['sessionId']==_0x34907f;});if(_0xe22558[_0x963c('0x26')]==0x1){_0x467d4c(_0x2a313d);}else{_0x431384(new RangeError('sessionId\x20'+_0x34907f+_0x963c('0x27')));}});});}exports[_0x963c('0x28')]=function(_0x44d0d9,_0x451283){logger[_0x963c('0x10')](_0x963c('0x29'),_0x44d0d9[_0x963c('0x2a')]);var _0x3918e2=originateValidation[_0x963c('0x2b')](_0x44d0d9[_0x963c('0x2a')]);if(_0x3918e2[_0x963c('0x26')]>0x0){return _0x451283['status'](0x190)[_0x963c('0x2c')](_0x3918e2);}var _0x2fdbe5=_0x44d0d9[_0x963c('0x2a')][_0x963c('0x2d')];var _0xcd10da=_0x44d0d9['body'][_0x963c('0x2e')];var _0x515201=_0x44d0d9[_0x963c('0x2a')]['callerId'];var _0x142ec2=_0x44d0d9[_0x963c('0x2a')][_0x963c('0x2f')];return getAgent(_0x2fdbe5)['then'](function(_0x580f31){logger[_0x963c('0x10')](_0x963c('0x30'),_0x580f31['name']);emit(util[_0x963c('0x31')]('user:%s',_0x580f31[_0x963c('0x15')]),'webbar:originate',{'callNumber':_0xcd10da,'callerId':_0x515201,'callbackUrl':_0x142ec2});return _0x451283[_0x963c('0x16')](0xc8)[_0x963c('0x2c')]({'error':![],'message':_0x963c('0x32')});})[_0x963c('0x33')](handleError(_0x451283));};exports[_0x963c('0x34')]=function(_0x205e40,_0x13021f){logger[_0x963c('0x10')]('hangup\x20fired:',_0x205e40[_0x963c('0x2a')]);var _0x60e550=hangupValidation[_0x963c('0x2b')](_0x205e40[_0x963c('0x2a')]);if(_0x60e550[_0x963c('0x26')]>0x0){return _0x13021f['status'](0x190)['json'](_0x60e550);}var _0x49ae16=_0x205e40[_0x963c('0x2a')]['userId'];var _0x3e1ff9=_0x205e40[_0x963c('0x2a')][_0x963c('0x35')];return getAgent(_0x49ae16)['then'](function(_0x1a406f){logger[_0x963c('0x10')](_0x963c('0x30'),_0x1a406f[_0x963c('0x15')]);emit(util[_0x963c('0x31')](_0x963c('0x36'),_0x1a406f['name']),_0x963c('0x37'),{'sessionId':_0x3e1ff9});return _0x13021f['status'](0xc8)[_0x963c('0x2c')]({'error':![],'message':_0x963c('0x38')});})['catch'](handleError(_0x13021f));};exports[_0x963c('0x39')]=function(_0x202743,_0x251309){logger[_0x963c('0x10')]('answer\x20fired:',_0x202743[_0x963c('0x2a')]);var _0x80c06b=answerValidation['validate'](_0x202743[_0x963c('0x2a')]);if(_0x80c06b[_0x963c('0x26')]>0x0){return _0x251309[_0x963c('0x16')](0x190)[_0x963c('0x2c')](_0x80c06b);}var _0x1d0de6=_0x202743[_0x963c('0x2a')]['userId'];var _0x18e628=_0x202743[_0x963c('0x2a')][_0x963c('0x35')];return getAgent(_0x1d0de6)[_0x963c('0x20')](function(_0x187c16){logger[_0x963c('0x10')]('entityFound:',_0x187c16[_0x963c('0x15')]);emit(util[_0x963c('0x31')](_0x963c('0x36'),_0x187c16[_0x963c('0x15')]),_0x963c('0x3a'),{'sessionId':_0x18e628});return _0x251309[_0x963c('0x16')](0xc8)[_0x963c('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0x963c('0x33')](handleError(_0x251309));};exports['hold']=function(_0x138155,_0x3354a5){logger[_0x963c('0x10')](_0x963c('0x3b'),_0x138155[_0x963c('0x2a')]);var _0x4ca069=holdValidation[_0x963c('0x2b')](_0x138155[_0x963c('0x2a')]);if(_0x4ca069[_0x963c('0x26')]>0x0){return _0x3354a5[_0x963c('0x16')](0x190)[_0x963c('0x2c')](_0x4ca069);}var _0x445dc9=_0x138155['body'][_0x963c('0x2d')];var _0x56d84d=_0x138155[_0x963c('0x2a')][_0x963c('0x35')];return getAgent(_0x445dc9)['then'](function(_0x296b15){logger['info']('entityFound:',_0x296b15[_0x963c('0x15')]);emit(util[_0x963c('0x31')](_0x963c('0x36'),_0x296b15[_0x963c('0x15')]),_0x963c('0x3c'),{'sessionId':_0x56d84d});return _0x3354a5[_0x963c('0x16')](0xc8)[_0x963c('0x2c')]({'error':![],'message':_0x963c('0x3d')});})[_0x963c('0x33')](handleError(_0x3354a5));};exports['unhold']=function(_0xac1f80,_0x170b46){logger[_0x963c('0x10')](_0x963c('0x3e'),_0xac1f80[_0x963c('0x2a')]);var _0x566659=unholdValidation[_0x963c('0x2b')](_0xac1f80[_0x963c('0x2a')]);if(_0x566659[_0x963c('0x26')]>0x0){return _0x170b46[_0x963c('0x16')](0x190)[_0x963c('0x2c')](_0x566659);}var _0x3445d7=_0xac1f80[_0x963c('0x2a')]['userId'];var _0x3651f9=_0xac1f80[_0x963c('0x2a')][_0x963c('0x35')];return getAgent(_0x3445d7)[_0x963c('0x20')](function(_0x4b7e0a){logger['info'](_0x963c('0x30'),_0x4b7e0a['name']);emit(util['format']('user:%s',_0x4b7e0a['name']),'webbar:unhold',{'sessionId':_0x3651f9});return _0x170b46['status'](0xc8)['json']({'error':![],'message':_0x963c('0x3f')});})[_0x963c('0x33')](handleError(_0x170b46));};exports[_0x963c('0x40')]=function(_0x444db7,_0x4bff0e){logger['info'](_0x963c('0x41'),_0x4bff0e['body']);var _0x565ebb=callsValidation['validate'](_0x444db7['body']);if(_0x565ebb[_0x963c('0x26')]>0x0){return _0x4bff0e[_0x963c('0x16')](0x190)[_0x963c('0x2c')](_0x565ebb);}var _0x21135e=_0x444db7[_0x963c('0x2a')][_0x963c('0x2d')];var _0x9d41ec=respondWithRpcPromise(_0x963c('0x21'));var _0x3e3775=getAgent(_0x21135e);return Promise[_0x963c('0x22')]([_0x9d41ec,_0x3e3775])['then'](function(_0xc4870){var _0x9bd2ad=_0xc4870[0x0];var _0x25b437=_0xc4870[0x1];var _0x2097a8=_[_0x963c('0x23')](_0x9bd2ad[_0x963c('0x24')],function(_0x7016e9){return _0x7016e9[_0x963c('0x25')]==_0x25b437['id'];});return _0x4bff0e[_0x963c('0x16')](0xc8)[_0x963c('0x2c')]({'count':_0x2097a8[_0x963c('0x26')],'rows':_0x2097a8});})[_0x963c('0x33')](handleError(_0x4bff0e));};exports[_0x963c('0x42')]=function(_0x3de976,_0x5e77b9){logger[_0x963c('0x10')]('conference\x20fired:',_0x3de976[_0x963c('0x2a')]);var _0x353c5b=conferenceValidation['validate'](_0x3de976[_0x963c('0x2a')]);if(_0x353c5b[_0x963c('0x26')]>0x0){return _0x5e77b9[_0x963c('0x16')](0x190)[_0x963c('0x2c')](_0x353c5b);}var _0x3c8b62=_0x3de976[_0x963c('0x2a')][_0x963c('0x2d')];return getAgent(_0x3c8b62)[_0x963c('0x20')](function(_0x4f52fc){logger[_0x963c('0x10')](_0x963c('0x30'),_0x4f52fc[_0x963c('0x15')]);emit(util['format'](_0x963c('0x36'),_0x4f52fc[_0x963c('0x15')]),_0x963c('0x43'));return _0x5e77b9[_0x963c('0x16')](0xc8)[_0x963c('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0x963c('0x33')](handleError(_0x5e77b9));};exports['transfer']=function(_0x2b9e73,_0x388c30){logger[_0x963c('0x10')](_0x963c('0x44'),_0x2b9e73[_0x963c('0x2a')]);var _0x1abbc9=transferValidation[_0x963c('0x2b')](_0x2b9e73[_0x963c('0x2a')]);if(_0x1abbc9[_0x963c('0x26')]>0x0){return _0x388c30[_0x963c('0x16')](0x190)[_0x963c('0x2c')](_0x1abbc9);}var _0x5cbdd9=_0x2b9e73[_0x963c('0x2a')][_0x963c('0x2d')];var _0x835633=_0x2b9e73[_0x963c('0x2a')][_0x963c('0x35')];var _0x1dcf0c=_0x2b9e73[_0x963c('0x2a')][_0x963c('0x45')];return getAgent(_0x5cbdd9)[_0x963c('0x20')](function(_0xcabad5){logger[_0x963c('0x10')]('entityFound:',_0xcabad5[_0x963c('0x15')]);emit(util[_0x963c('0x31')](_0x963c('0x36'),_0xcabad5[_0x963c('0x15')]),_0x963c('0x46'),{'sessionId':_0x835633,'transferNumber':_0x1dcf0c});return _0x388c30[_0x963c('0x16')](0xc8)[_0x963c('0x2c')]({'error':![],'message':_0x963c('0x47')});})[_0x963c('0x33')](handleError(_0x388c30));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d9493da..c6a75a6 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 _0xfc14=['/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','/:id/send','send','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3b07d7,_0x374e44){var _0x2a9b53=function(_0x11a0e5){while(--_0x11a0e5){_0x3b07d7['push'](_0x3b07d7['shift']());}};_0x2a9b53(++_0x374e44);}(_0xfc14,0x7a));var _0x4fc1=function(_0x2054f5,_0x28cf67){_0x2054f5=_0x2054f5-0x0;var _0x2f8a4d=_0xfc14[_0x2054f5];return _0x2f8a4d;};'use strict';var multer=require(_0x4fc1('0x0'));var util=require(_0x4fc1('0x1'));var path=require(_0x4fc1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4fc1('0x3')]();var fs_extra=require(_0x4fc1('0x4'));var auth=require(_0x4fc1('0x5'));var interaction=require(_0x4fc1('0x6'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x4fc1('0x7')]('/',auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x9')]);router['get'](_0x4fc1('0xa'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0xb')]);router[_0x4fc1('0x7')](_0x4fc1('0xc'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0xd')]);router[_0x4fc1('0x7')](_0x4fc1('0xe'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0xf')]);router[_0x4fc1('0x7')](_0x4fc1('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4fc1('0x7')](_0x4fc1('0x11'),auth[_0x4fc1('0x8')](),controller['getAgents']);router[_0x4fc1('0x7')](_0x4fc1('0x12'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x13')]);router[_0x4fc1('0x14')]('/',auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x15')]);router['post'](_0x4fc1('0xe'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x16')]);router[_0x4fc1('0x14')]('/:id/canned_answers',auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x17')]);router[_0x4fc1('0x14')](_0x4fc1('0x11'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x18')]);router[_0x4fc1('0x14')](_0x4fc1('0x12'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x4fc1('0x19'),controller['notify']);router[_0x4fc1('0x14')](_0x4fc1('0x1a'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x1b')]);router['put'](_0x4fc1('0xc'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x1c')]);router[_0x4fc1('0x1d')](_0x4fc1('0xc'),auth[_0x4fc1('0x8')](),controller['destroy']);router[_0x4fc1('0x1d')](_0x4fc1('0xe'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x1e')]);router[_0x4fc1('0x1d')](_0x4fc1('0x10'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x1f')]);router[_0x4fc1('0x1d')](_0x4fc1('0x11'),auth[_0x4fc1('0x8')](),controller[_0x4fc1('0x20')]);module[_0x4fc1('0x21')]=router; \ No newline at end of file +var _0xe6cf=['./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','update','delete','destroy','removeDispositions','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x565dc8,_0x4261e5){var _0x46d643=function(_0x90b2f7){while(--_0x90b2f7){_0x565dc8['push'](_0x565dc8['shift']());}};_0x46d643(++_0x4261e5);}(_0xe6cf,0x1f0));var _0xfe6c=function(_0x3a96e2,_0x5ecb0f){_0x3a96e2=_0x3a96e2-0x0;var _0x2c1e1f=_0xe6cf[_0x3a96e2];return _0x2c1e1f;};'use strict';var multer=require('multer');var util=require(_0xfe6c('0x0'));var path=require(_0xfe6c('0x1'));var timeout=require(_0xfe6c('0x2'));var express=require(_0xfe6c('0x3'));var router=express[_0xfe6c('0x4')]();var fs_extra=require(_0xfe6c('0x5'));var auth=require(_0xfe6c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfe6c('0x7'));var controller=require(_0xfe6c('0x8'));router[_0xfe6c('0x9')]('/',auth[_0xfe6c('0xa')](),controller[_0xfe6c('0xb')]);router[_0xfe6c('0x9')]('/describe',auth[_0xfe6c('0xa')](),controller[_0xfe6c('0xc')]);router[_0xfe6c('0x9')](_0xfe6c('0xd'),auth[_0xfe6c('0xa')](),controller['show']);router[_0xfe6c('0x9')](_0xfe6c('0xe'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0xf')]);router['get']('/:id/canned_answers',auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x10')]);router[_0xfe6c('0x9')](_0xfe6c('0x11'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x12')]);router[_0xfe6c('0x9')](_0xfe6c('0x13'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x14')]);router['post']('/',auth[_0xfe6c('0xa')](),controller['create']);router[_0xfe6c('0x15')](_0xfe6c('0xe'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x16')]);router[_0xfe6c('0x15')](_0xfe6c('0x17'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x18')]);router['post'](_0xfe6c('0x11'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x19')]);router[_0xfe6c('0x15')](_0xfe6c('0x13'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x1a')]);router[_0xfe6c('0x15')](_0xfe6c('0x1b'),controller[_0xfe6c('0x1c')]);router[_0xfe6c('0x15')](_0xfe6c('0x1d'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x1e')]);router['put'](_0xfe6c('0xd'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x1f')]);router[_0xfe6c('0x20')](_0xfe6c('0xd'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x21')]);router[_0xfe6c('0x20')](_0xfe6c('0xe'),auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x22')]);router['delete'](_0xfe6c('0x17'),auth[_0xfe6c('0xa')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0xfe6c('0xa')](),controller[_0xfe6c('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index fc8f629..6f139a1 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 _0x032b=['generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x032b,0x183));var _0xb032=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0x032b[_0x503cd5];return _0x1fdf1e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb032('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb032('0x1'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb032('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb032('0x3')]();}},'phone':{'type':Sequelize[_0xb032('0x2')]},'type':{'type':Sequelize[_0xb032('0x4')](_0xb032('0x5'),_0xb032('0x6'))},'accountSid':{'type':Sequelize[_0xb032('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xb032('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb032('0x7')],'defaultValue':function(){return _0xb032('0x8');}},'notificationSound':{'type':Sequelize[_0xb032('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb032('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb032('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb032('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb032('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb032('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb032('0xa')],'comment':_0xb032('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x11e483){if(!_0x11e483){this[_0xb032('0xc')](_0xb032('0xd'),null);}this[_0xb032('0xc')](_0xb032('0xe'),_0x11e483);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa535=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0xa535,0x19b));var _0x5a53=function(_0x28c368,_0x31fab2){_0x28c368=_0x28c368-0x0;var _0x5969ee=_0xa535[_0x28c368];return _0x5969ee;};'use strict';var Sequelize=require(_0x5a53('0x0'));var rs=require(_0x5a53('0x1'));module[_0x5a53('0x2')]={'name':{'type':Sequelize[_0x5a53('0x3')],'unique':_0x5a53('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x5a53('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x5a53('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x5a53('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x5a53('0x3')]},'type':{'type':Sequelize[_0x5a53('0x5')](_0x5a53('0x6'),_0x5a53('0x7'))},'accountSid':{'type':Sequelize[_0x5a53('0x3')]},'baseUrl':{'type':Sequelize[_0x5a53('0x3')]},'authToken':{'type':Sequelize[_0x5a53('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5a53('0x8');}},'notificationSound':{'type':Sequelize[_0x5a53('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5a53('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5a53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5a53('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a53('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5a53('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a53('0xa')],'comment':_0x5a53('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x5a53('0x9')],'defaultValue':![],'comment':_0x5a53('0xc'),'set':function(_0x28ac08){if(!_0x28ac08){this[_0x5a53('0xd')](_0x5a53('0xe'),null);}this[_0x5a53('0xd')]('mandatoryDisposition',_0x28ac08);}},'description':{'type':Sequelize[_0x5a53('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index bb6c9ce..8f896f8 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 _0xbfcc=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','count','set','Content-Range','save','update','get','UserProfileResource','destroy','sendStatus','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','limit','order','sort','where','filters','pick','merge','name','filter','options','includeAll','include','findAll','show','params','mandatoryDispositionPause','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','nolimit','WhatsappAccountId','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','findAndCountAll','priority','stack','finally','send','getApplications','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','message_id','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','replace','Body','MessageSid','notifications','messageId','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','contact','interaction','created','autoclose','push','applications','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','waitForTheAssignedQueue','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto'];(function(_0x2d2b63,_0x277d0a){var _0x5d18f8=function(_0x4eca54){while(--_0x4eca54){_0x2d2b63['push'](_0x2d2b63['shift']());}};_0x5d18f8(++_0x277d0a);}(_0xbfcc,0x186));var _0xcbfc=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0xbfcc[_0x335271];return _0xa9fff8;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require(_0xcbfc('0x1'));var zipdir=require(_0xcbfc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbfc('0x3'));var moment=require(_0xcbfc('0x4'));var BPromise=require(_0xcbfc('0x5'));var Mustache=require(_0xcbfc('0x6'));var util=require('util');var path=require(_0xcbfc('0x7'));var sox=require('sox');var csv=require(_0xcbfc('0x8'));var ejs=require(_0xcbfc('0x9'));var fs=require('fs');var fs_extra=require(_0xcbfc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcbfc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcbfc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcbfc('0xd'));var Papa=require(_0xcbfc('0xe'));var Redis=require(_0xcbfc('0xf'));var authService=require(_0xcbfc('0x10'));var qs=require(_0xcbfc('0x11'));var as=require(_0xcbfc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbfc('0x13'))(_0xcbfc('0x14'));var utils=require(_0xcbfc('0x15'));var config=require(_0xcbfc('0x16'));var licenseUtil=require(_0xcbfc('0x17'));var db=require(_0xcbfc('0x18'))['db'];config['redis']=_[_0xcbfc('0x19')](config[_0xcbfc('0x1a')],{'host':_0xcbfc('0x1b'),'port':0x18eb});var socket=require(_0xcbfc('0x1c'))(new Redis(config[_0xcbfc('0x1a')]));require(_0xcbfc('0x1d'))[_0xcbfc('0x1e')](socket);var jayson=require(_0xcbfc('0x1f'));var client=jayson[_0xcbfc('0x20')][_0xcbfc('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x34c151,_0x4078a2,_0x25db2f,_0x5b3e44){return new BPromise(function(_0x29aff6,_0x5f580f){var _0x23bd03=_0x5b3e44||client;return _0x23bd03['request'](_0x34c151,_0x25db2f)[_0xcbfc('0x22')](function(_0x4af8e3){logger[_0xcbfc('0x23')](_0xcbfc('0x24'),_0x4078a2,'request\x20sent');logger[_0xcbfc('0x25')](_0xcbfc('0x26'),_0x4078a2,'request\x20sent',JSON[_0xcbfc('0x27')](_0x4af8e3));if(_0x4af8e3[_0xcbfc('0x28')]){if(_0x4af8e3[_0xcbfc('0x28')][_0xcbfc('0x29')]===0x1f4){logger[_0xcbfc('0x28')](_0xcbfc('0x24'),_0x4078a2,_0x4af8e3[_0xcbfc('0x28')][_0xcbfc('0x2a')]);return _0x5f580f(_0x4af8e3['error'][_0xcbfc('0x2a')]);}logger[_0xcbfc('0x28')](_0xcbfc('0x24'),_0x4078a2,_0x4af8e3[_0xcbfc('0x28')][_0xcbfc('0x2a')]);return _0x29aff6(_0x4af8e3[_0xcbfc('0x28')][_0xcbfc('0x2a')]);}else{logger[_0xcbfc('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x4078a2,'request\x20sent');_0x29aff6(_0x4af8e3['result'][_0xcbfc('0x2a')]);}})[_0xcbfc('0x2b')](function(_0x28833b){logger[_0xcbfc('0x28')](_0xcbfc('0x24'),_0x4078a2,_0x28833b);_0x5f580f(_0x28833b);});});}function respondWithStatusCode(_0x7073ed,_0x4237fc){_0x4237fc=_0x4237fc||0xcc;return function(_0x174779){if(_0x174779){return _0x7073ed['sendStatus'](_0x4237fc);}return _0x7073ed[_0xcbfc('0x2c')](_0x4237fc)[_0xcbfc('0x2d')]();};}function respondWithResult(_0x38c498,_0x54715d){_0x54715d=_0x54715d||0xc8;return function(_0x28cfc3){if(_0x28cfc3){return _0x38c498[_0xcbfc('0x2c')](_0x54715d)[_0xcbfc('0x2e')](_0x28cfc3);}};}function respondWithFilteredResult(_0xace3d2,_0x413e75){return function(_0x30a541){if(_0x30a541){var _0x51100f=typeof _0x413e75[_0xcbfc('0x2f')]===_0xcbfc('0x30')&&typeof _0x413e75['limit']===_0xcbfc('0x30');var _0x36cb4d=_0x30a541[_0xcbfc('0x31')];var _0x21dcaf=_0x51100f?0x0:_0x413e75[_0xcbfc('0x2f')];var _0x4fcb2e=_0x51100f?_0x30a541[_0xcbfc('0x31')]:_0x413e75[_0xcbfc('0x2f')]+_0x413e75['limit'];var _0x15cb4e;if(_0x4fcb2e>=_0x36cb4d){_0x4fcb2e=_0x36cb4d;_0x15cb4e=0xc8;}else{_0x15cb4e=0xce;}_0xace3d2[_0xcbfc('0x2c')](_0x15cb4e);return _0xace3d2[_0xcbfc('0x32')](_0xcbfc('0x33'),_0x21dcaf+'-'+_0x4fcb2e+'/'+_0x36cb4d)[_0xcbfc('0x2e')](_0x30a541);}return null;};}function patchUpdates(_0x278966){return function(_0xa474a1){try{jsonpatch['apply'](_0xa474a1,_0x278966,!![]);}catch(_0x2a0ec2){return BPromise['reject'](_0x2a0ec2);}return _0xa474a1[_0xcbfc('0x34')]();};}function saveUpdates(_0x245cc3,_0x1c4c58){return function(_0x2494bc){if(_0x2494bc){return _0x2494bc[_0xcbfc('0x35')](_0x245cc3)[_0xcbfc('0x22')](function(_0x471b7c){return _0x471b7c;});}return null;};}function removeEntity(_0x488426,_0x158f4a){return function(_0x3176dd){if(_0x3176dd){return _0x3176dd['destroy']()[_0xcbfc('0x22')](function(){var _0x246d7e=_0x3176dd[_0xcbfc('0x36')]({'plain':!![]});var _0x3d662f='WhatsappAccounts';return db[_0xcbfc('0x37')][_0xcbfc('0x38')]({'where':{'type':_0x3d662f,'resourceId':_0x246d7e['id']}})[_0xcbfc('0x22')](function(){return _0x3176dd;});})[_0xcbfc('0x22')](function(){_0x488426[_0xcbfc('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ecce,_0x1914ce){return function(_0x238717){if(!_0x238717){_0x12ecce[_0xcbfc('0x39')](0x194);}return _0x238717;};}function handleError(_0x383052,_0x214788){_0x214788=_0x214788||0x1f4;return function(_0x4d1d4e){logger[_0xcbfc('0x28')](_0x4d1d4e['stack']);if(_0x4d1d4e['name']){delete _0x4d1d4e['name'];}_0x383052[_0xcbfc('0x2c')](_0x214788)['send'](_0x4d1d4e);};}exports[_0xcbfc('0x3a')]=function(_0x144849,_0x34caa2){var _0x2a2ad3={'include':[{'model':db[_0xcbfc('0x3b')],'as':'mandatoryDispositionPause'}]},_0x52d607={},_0x48b987={'count':0x0,'rows':[]};var _0x5a4efa=_[_0xcbfc('0x3c')](db[_0xcbfc('0x3d')][_0xcbfc('0x3e')],function(_0x474b2a){return{'name':_0x474b2a[_0xcbfc('0x3f')],'type':_0x474b2a[_0xcbfc('0x40')][_0xcbfc('0x41')]};});_0x52d607[_0xcbfc('0x42')]=_[_0xcbfc('0x3c')](_0x5a4efa,'name');_0x52d607['query']=_[_0xcbfc('0x43')](_0x144849[_0xcbfc('0x44')]);_0x52d607['filters']=_['intersection'](_0x52d607[_0xcbfc('0x42')],_0x52d607[_0xcbfc('0x44')]);_0x2a2ad3[_0xcbfc('0x45')]=_[_0xcbfc('0x46')](_0x52d607[_0xcbfc('0x42')],qs[_0xcbfc('0x47')](_0x144849[_0xcbfc('0x44')]['fields']));_0x2a2ad3[_0xcbfc('0x45')]=_0x2a2ad3[_0xcbfc('0x45')]['length']?_0x2a2ad3[_0xcbfc('0x45')]:_0x52d607['model'];if(!_0x144849[_0xcbfc('0x44')]['hasOwnProperty']('nolimit')){_0x2a2ad3[_0xcbfc('0x48')]=qs[_0xcbfc('0x48')](_0x144849[_0xcbfc('0x44')][_0xcbfc('0x48')]);_0x2a2ad3['offset']=qs[_0xcbfc('0x2f')](_0x144849[_0xcbfc('0x44')]['offset']);}_0x2a2ad3[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0x144849[_0xcbfc('0x44')][_0xcbfc('0x4a')]);_0x2a2ad3[_0xcbfc('0x4b')]=qs[_0xcbfc('0x4c')](_[_0xcbfc('0x4d')](_0x144849['query'],_0x52d607[_0xcbfc('0x4c')]),_0x5a4efa);if(_0x144849[_0xcbfc('0x44')]['filter']){_0x2a2ad3[_0xcbfc('0x4b')]=_[_0xcbfc('0x4e')](_0x2a2ad3['where'],{'$or':_[_0xcbfc('0x3c')](_0x5a4efa,function(_0x86c04b){if(_0x86c04b['type']!=='VIRTUAL'){var _0x425fec={};_0x425fec[_0x86c04b[_0xcbfc('0x4f')]]={'$like':'%'+_0x144849[_0xcbfc('0x44')][_0xcbfc('0x50')]+'%'};return _0x425fec;}})});}_0x2a2ad3=_['merge']({},_0x2a2ad3,_0x144849[_0xcbfc('0x51')]);var _0x58af43={'where':_0x2a2ad3[_0xcbfc('0x4b')]};return db[_0xcbfc('0x3d')][_0xcbfc('0x31')](_0x58af43)[_0xcbfc('0x22')](function(_0x1780f3){_0x48b987[_0xcbfc('0x31')]=_0x1780f3;if(_0x144849[_0xcbfc('0x44')][_0xcbfc('0x52')]){_0x2a2ad3[_0xcbfc('0x53')]=[{'all':!![]}];}return db[_0xcbfc('0x3d')][_0xcbfc('0x54')](_0x2a2ad3);})[_0xcbfc('0x22')](function(_0x3dcae5){_0x48b987['rows']=_0x3dcae5;return _0x48b987;})[_0xcbfc('0x22')](respondWithFilteredResult(_0x34caa2,_0x2a2ad3))['catch'](handleError(_0x34caa2,null));};exports[_0xcbfc('0x55')]=function(_0x3735d6,_0x9602de){var _0x4d6944={'raw':![],'where':{'id':_0x3735d6[_0xcbfc('0x56')]['id']},'include':[{'model':db[_0xcbfc('0x3b')],'as':_0xcbfc('0x57')}]},_0xf73433={};_0xf73433['model']=_[_0xcbfc('0x43')](db[_0xcbfc('0x3d')][_0xcbfc('0x3e')]);_0xf73433[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x3735d6[_0xcbfc('0x44')]);_0xf73433[_0xcbfc('0x4c')]=_[_0xcbfc('0x46')](_0xf73433[_0xcbfc('0x42')],_0xf73433['query']);_0x4d6944[_0xcbfc('0x45')]=_[_0xcbfc('0x46')](_0xf73433[_0xcbfc('0x42')],qs[_0xcbfc('0x47')](_0x3735d6[_0xcbfc('0x44')][_0xcbfc('0x47')]));_0x4d6944[_0xcbfc('0x45')]=_0x4d6944[_0xcbfc('0x45')][_0xcbfc('0x58')]?_0x4d6944['attributes']:_0xf73433['model'];if(_0x3735d6[_0xcbfc('0x44')][_0xcbfc('0x52')]){_0x4d6944[_0xcbfc('0x53')]=[{'all':!![]}];}_0x4d6944=_[_0xcbfc('0x4e')]({},_0x4d6944,_0x3735d6['options']);return db[_0xcbfc('0x3d')][_0xcbfc('0x59')](_0x4d6944)['then'](handleEntityNotFound(_0x9602de,null))[_0xcbfc('0x22')](respondWithResult(_0x9602de,null))[_0xcbfc('0x2b')](handleError(_0x9602de,null));};exports[_0xcbfc('0x5a')]=function(_0x5a2bf7,_0x1db049){return db[_0xcbfc('0x3d')]['create'](_0x5a2bf7[_0xcbfc('0x5b')],{})['then'](function(_0x1e8cdb){var _0x3e4f71=_0x5a2bf7['user'][_0xcbfc('0x36')]({'plain':!![]});if(!_0x3e4f71)throw new Error(_0xcbfc('0x5c'));if(_0x3e4f71[_0xcbfc('0x5d')]===_0xcbfc('0x5e')){var _0x565606=_0x1e8cdb[_0xcbfc('0x36')]({'plain':!![]});var _0x206c12=_0xcbfc('0x5f');return db[_0xcbfc('0x60')][_0xcbfc('0x59')]({'where':{'name':_0x206c12,'userProfileId':_0x3e4f71['userProfileId']},'raw':!![]})[_0xcbfc('0x22')](function(_0x330a58){if(_0x330a58&&_0x330a58[_0xcbfc('0x61')]===0x0){return db[_0xcbfc('0x37')][_0xcbfc('0x5a')]({'name':_0x565606['name'],'resourceId':_0x565606['id'],'type':_0x330a58['name'],'sectionId':_0x330a58['id']},{})[_0xcbfc('0x22')](function(){return _0x1e8cdb;});}else{return _0x1e8cdb;}})['catch'](function(_0x53f31f){logger[_0xcbfc('0x28')](_0xcbfc('0x62'),_0x53f31f);throw _0x53f31f;});}return _0x1e8cdb;})['then'](respondWithResult(_0x1db049,0xc9))[_0xcbfc('0x2b')](handleError(_0x1db049,null));};exports[_0xcbfc('0x35')]=function(_0x4e1dae,_0xc9576b){if(_0x4e1dae['body']['id']){delete _0x4e1dae[_0xcbfc('0x5b')]['id'];}return db[_0xcbfc('0x3d')]['find']({'where':{'id':_0x4e1dae[_0xcbfc('0x56')]['id']},'include':[{'model':db[_0xcbfc('0x3b')],'as':'mandatoryDispositionPause'}]})[_0xcbfc('0x22')](handleEntityNotFound(_0xc9576b,null))[_0xcbfc('0x22')](saveUpdates(_0x4e1dae[_0xcbfc('0x5b')],null))[_0xcbfc('0x22')](respondWithResult(_0xc9576b,null))[_0xcbfc('0x2b')](handleError(_0xc9576b,null));};exports[_0xcbfc('0x38')]=function(_0x537feb,_0x420a13){return db[_0xcbfc('0x3d')][_0xcbfc('0x59')]({'where':{'id':_0x537feb[_0xcbfc('0x56')]['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x420a13,null))[_0xcbfc('0x22')](removeEntity(_0x420a13,null))[_0xcbfc('0x2b')](handleError(_0x420a13,null));};exports[_0xcbfc('0x63')]=function(_0x5ad1c9,_0x1f09f1){return db['WhatsappAccount'][_0xcbfc('0x63')]()[_0xcbfc('0x22')](respondWithResult(_0x1f09f1,null))['catch'](handleError(_0x1f09f1,null));};exports[_0xcbfc('0x64')]=function(_0x31235a,_0x48878d,_0x21a7f8){if(_0x31235a['body']['id']){delete _0x31235a[_0xcbfc('0x5b')]['id'];}return db[_0xcbfc('0x3d')]['find']({'where':{'id':_0x31235a[_0xcbfc('0x56')]['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x48878d,null))['then'](function(_0x7143f9){if(_0x7143f9){_0x31235a['body']['WhatsappAccountId']=_0x7143f9['id'];return db[_0xcbfc('0x65')][_0xcbfc('0x5a')](_0x31235a[_0xcbfc('0x5b')]);}})[_0xcbfc('0x22')](respondWithResult(_0x48878d,null))[_0xcbfc('0x2b')](handleError(_0x48878d,null));};exports['getDispositions']=function(_0x5d8abd,_0x2c4918,_0x212a31){var _0x1aa45d={'raw':![],'where':{}};var _0x86fbf5={};var _0x15c9e2={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcbfc('0x66')]({'where':{'id':_0x5d8abd[_0xcbfc('0x56')]['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x2c4918,null))[_0xcbfc('0x22')](function(_0x4fd60e){if(_0x4fd60e){_0x86fbf5[_0xcbfc('0x42')]=_['keys'](db[_0xcbfc('0x65')][_0xcbfc('0x3e')]);_0x86fbf5[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x5d8abd['query']);_0x86fbf5[_0xcbfc('0x4c')]=_[_0xcbfc('0x46')](_0x86fbf5[_0xcbfc('0x42')],_0x86fbf5[_0xcbfc('0x44')]);_0x1aa45d[_0xcbfc('0x45')]=_['intersection'](_0x86fbf5[_0xcbfc('0x42')],qs[_0xcbfc('0x47')](_0x5d8abd[_0xcbfc('0x44')][_0xcbfc('0x47')]));_0x1aa45d[_0xcbfc('0x45')]=_0x1aa45d[_0xcbfc('0x45')]['length']?_0x1aa45d[_0xcbfc('0x45')]:_0x86fbf5[_0xcbfc('0x42')];if(!_0x5d8abd[_0xcbfc('0x44')][_0xcbfc('0x67')](_0xcbfc('0x68'))){_0x1aa45d[_0xcbfc('0x48')]=qs['limit'](_0x5d8abd[_0xcbfc('0x44')][_0xcbfc('0x48')]);_0x1aa45d[_0xcbfc('0x2f')]=qs[_0xcbfc('0x2f')](_0x5d8abd['query'][_0xcbfc('0x2f')]);}_0x1aa45d[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0x5d8abd[_0xcbfc('0x44')]['sort']);_0x1aa45d['where']=qs['filters'](_[_0xcbfc('0x4d')](_0x5d8abd[_0xcbfc('0x44')],_0x86fbf5['filters']));_0x1aa45d[_0xcbfc('0x4b')][_0xcbfc('0x69')]=_0x4fd60e['id'];if(_0x5d8abd[_0xcbfc('0x44')][_0xcbfc('0x50')]){_0x1aa45d['where']=_['merge'](_0x1aa45d[_0xcbfc('0x4b')],{'$or':_[_0xcbfc('0x3c')](_0x1aa45d[_0xcbfc('0x45')],function(_0x546c21){var _0xbc2397={};_0xbc2397[_0x546c21]={'$like':'%'+_0x5d8abd[_0xcbfc('0x44')][_0xcbfc('0x50')]+'%'};return _0xbc2397;})});}_0x1aa45d=_[_0xcbfc('0x4e')]({},_0x1aa45d,_0x5d8abd[_0xcbfc('0x51')]);return db[_0xcbfc('0x65')]['count']({'where':_0x1aa45d[_0xcbfc('0x4b')]})[_0xcbfc('0x22')](function(_0x3ffd0c){_0x15c9e2['count']=_0x3ffd0c;if(_0x5d8abd[_0xcbfc('0x44')]['includeAll']){_0x1aa45d[_0xcbfc('0x53')]=[{'all':!![]}];}return db[_0xcbfc('0x65')]['findAll'](_0x1aa45d);})[_0xcbfc('0x22')](function(_0x4a18ed){_0x15c9e2[_0xcbfc('0x6a')]=_0x4a18ed;return _0x15c9e2;});}})['then'](respondWithFilteredResult(_0x2c4918,_0x1aa45d))[_0xcbfc('0x2b')](handleError(_0x2c4918,null));};exports[_0xcbfc('0x6b')]=function(_0x121df1,_0x29aa86,_0x5b60e4){return db[_0xcbfc('0x3d')][_0xcbfc('0x59')]({'where':{'id':_0x121df1[_0xcbfc('0x56')]['id']}})['then'](handleEntityNotFound(_0x29aa86,null))[_0xcbfc('0x22')](function(_0x31ee8a){if(_0x31ee8a){return _0x31ee8a[_0xcbfc('0x6b')](_0x121df1[_0xcbfc('0x44')]['ids']);}})[_0xcbfc('0x22')](respondWithStatusCode(_0x29aa86,null))[_0xcbfc('0x2b')](handleError(_0x29aa86,null));};exports['addAnswer']=function(_0x192f5,_0x454e30,_0x30495e){if(_0x192f5[_0xcbfc('0x5b')]['id']){delete _0x192f5['body']['id'];}return db[_0xcbfc('0x3d')]['find']({'where':{'id':_0x192f5[_0xcbfc('0x56')]['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x454e30,null))[_0xcbfc('0x22')](function(_0x2eedda){if(_0x2eedda){_0x192f5['body'][_0xcbfc('0x69')]=_0x2eedda['id'];return db[_0xcbfc('0x6c')]['create'](_0x192f5[_0xcbfc('0x5b')]);}})['then'](respondWithResult(_0x454e30,null))[_0xcbfc('0x2b')](handleError(_0x454e30,null));};exports[_0xcbfc('0x6d')]=function(_0x2d1c19,_0x21f8a2,_0x5319c7){var _0x13a32={'raw':![],'where':{}};var _0x48778f={};var _0x36e96e={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcbfc('0x66')]({'where':{'id':_0x2d1c19[_0xcbfc('0x56')]['id']}})['then'](handleEntityNotFound(_0x21f8a2,null))['then'](function(_0x12317a){if(_0x12317a){_0x48778f[_0xcbfc('0x42')]=_[_0xcbfc('0x43')](db[_0xcbfc('0x6c')][_0xcbfc('0x3e')]);_0x48778f[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x2d1c19[_0xcbfc('0x44')]);_0x48778f[_0xcbfc('0x4c')]=_['intersection'](_0x48778f[_0xcbfc('0x42')],_0x48778f[_0xcbfc('0x44')]);_0x13a32[_0xcbfc('0x45')]=_[_0xcbfc('0x46')](_0x48778f[_0xcbfc('0x42')],qs[_0xcbfc('0x47')](_0x2d1c19[_0xcbfc('0x44')]['fields']));_0x13a32[_0xcbfc('0x45')]=_0x13a32[_0xcbfc('0x45')][_0xcbfc('0x58')]?_0x13a32[_0xcbfc('0x45')]:_0x48778f[_0xcbfc('0x42')];if(!_0x2d1c19[_0xcbfc('0x44')][_0xcbfc('0x67')](_0xcbfc('0x68'))){_0x13a32[_0xcbfc('0x48')]=qs[_0xcbfc('0x48')](_0x2d1c19[_0xcbfc('0x44')][_0xcbfc('0x48')]);_0x13a32['offset']=qs['offset'](_0x2d1c19[_0xcbfc('0x44')][_0xcbfc('0x2f')]);}_0x13a32[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0x2d1c19['query'][_0xcbfc('0x4a')]);_0x13a32[_0xcbfc('0x4b')]=qs['filters'](_['pick'](_0x2d1c19['query'],_0x48778f[_0xcbfc('0x4c')]));_0x13a32[_0xcbfc('0x4b')][_0xcbfc('0x69')]=_0x12317a['id'];if(_0x2d1c19[_0xcbfc('0x44')][_0xcbfc('0x50')]){_0x13a32[_0xcbfc('0x4b')]=_[_0xcbfc('0x4e')](_0x13a32['where'],{'$or':_['map'](_0x13a32['attributes'],function(_0x2eaf6a){var _0x4f680b={};_0x4f680b[_0x2eaf6a]={'$like':'%'+_0x2d1c19[_0xcbfc('0x44')][_0xcbfc('0x50')]+'%'};return _0x4f680b;})});}_0x13a32=_[_0xcbfc('0x4e')]({},_0x13a32,_0x2d1c19[_0xcbfc('0x51')]);return db[_0xcbfc('0x6c')][_0xcbfc('0x31')]({'where':_0x13a32[_0xcbfc('0x4b')]})['then'](function(_0x45f685){_0x36e96e['count']=_0x45f685;if(_0x2d1c19[_0xcbfc('0x44')][_0xcbfc('0x52')]){_0x13a32[_0xcbfc('0x53')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x13a32);})[_0xcbfc('0x22')](function(_0x649ae8){_0x36e96e[_0xcbfc('0x6a')]=_0x649ae8;return _0x36e96e;});}})[_0xcbfc('0x22')](respondWithFilteredResult(_0x21f8a2,_0x13a32))['catch'](handleError(_0x21f8a2,null));};exports[_0xcbfc('0x6e')]=function(_0x52d8a2,_0x350dca,_0x460fe3){return db['WhatsappAccount']['find']({'where':{'id':_0x52d8a2[_0xcbfc('0x56')]['id']}})['then'](handleEntityNotFound(_0x350dca,null))[_0xcbfc('0x22')](function(_0x3a13c0){if(_0x3a13c0){return _0x3a13c0[_0xcbfc('0x6e')](_0x52d8a2['query'][_0xcbfc('0x6f')]);}})[_0xcbfc('0x22')](respondWithStatusCode(_0x350dca,null))[_0xcbfc('0x2b')](handleError(_0x350dca,null));};exports[_0xcbfc('0x70')]=function(_0x5cc1ef,_0x13329a,_0x21fefc){return db['WhatsappAccount']['find']({'where':{'id':_0x5cc1ef[_0xcbfc('0x56')]['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x13329a,null))[_0xcbfc('0x22')](function(_0x488cbc){if(_0x488cbc){return _0x488cbc[_0xcbfc('0x70')](_0x5cc1ef['body']['ids'],_[_0xcbfc('0x71')](_0x5cc1ef[_0xcbfc('0x5b')],['ids','id'])||{})[_0xcbfc('0x72')](function(_0x411dec){for(var _0x14d804=0x0;_0x14d804<_0x5cc1ef[_0xcbfc('0x5b')][_0xcbfc('0x6f')][_0xcbfc('0x58')];_0x14d804+=0x1){socket[_0xcbfc('0x73')](_0xcbfc('0x74'),{'UserId':Number(_0x5cc1ef['body'][_0xcbfc('0x6f')][_0x14d804]),'WhatsappAccountId':Number(_0x5cc1ef['params']['id'])});}return _0x411dec;});}})[_0xcbfc('0x22')](respondWithResult(_0x13329a,null))['catch'](handleError(_0x13329a,null));};exports[_0xcbfc('0x75')]=function(_0x436282,_0x31e540,_0x1be420){return db[_0xcbfc('0x3d')][_0xcbfc('0x59')]({'where':{'id':_0x436282['params']['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x31e540,null))['then'](function(_0x254909){if(_0x254909){return _0x254909[_0xcbfc('0x75')](_0x436282['query'][_0xcbfc('0x6f')])[_0xcbfc('0x22')](function(){if(_[_0xcbfc('0x76')](_0x436282['query']['ids'])){for(var _0x433181=0x0;_0x433181<_0x436282['query'][_0xcbfc('0x6f')][_0xcbfc('0x58')];_0x433181+=0x1){socket[_0xcbfc('0x73')](_0xcbfc('0x77'),{'UserId':Number(_0x436282[_0xcbfc('0x44')]['ids'][_0x433181]),'WhatsappAccountId':Number(_0x436282[_0xcbfc('0x56')]['id'])});}}else{socket[_0xcbfc('0x73')](_0xcbfc('0x77'),{'UserId':Number(_0x436282[_0xcbfc('0x44')]['ids']),'WhatsappAccountId':Number(_0x436282[_0xcbfc('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x31e540,null))[_0xcbfc('0x2b')](handleError(_0x31e540,null));};exports[_0xcbfc('0x78')]=function(_0x2b6d5b,_0x35bac6,_0xea05cc){var _0x14cfb9={};var _0x563d59={};var _0x35d1bc;var _0x2f0bd7;return db[_0xcbfc('0x3d')][_0xcbfc('0x66')]({'where':{'id':_0x2b6d5b[_0xcbfc('0x56')]['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x35bac6,null))['then'](function(_0x184f1a){if(_0x184f1a){_0x35d1bc=_0x184f1a;_0x563d59['model']=_[_0xcbfc('0x43')](db[_0xcbfc('0x79')][_0xcbfc('0x3e')]);_0x563d59[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x2b6d5b[_0xcbfc('0x44')]);_0x563d59[_0xcbfc('0x4c')]=_[_0xcbfc('0x46')](_0x563d59[_0xcbfc('0x42')],_0x563d59[_0xcbfc('0x44')]);_0x14cfb9[_0xcbfc('0x45')]=_[_0xcbfc('0x46')](_0x563d59[_0xcbfc('0x42')],qs[_0xcbfc('0x47')](_0x2b6d5b['query'][_0xcbfc('0x47')]));_0x14cfb9['attributes']=_0x14cfb9['attributes'][_0xcbfc('0x58')]?_0x14cfb9[_0xcbfc('0x45')]:_0x563d59['model'];_0x14cfb9[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0x2b6d5b[_0xcbfc('0x44')]['sort']);_0x14cfb9[_0xcbfc('0x4b')]=qs[_0xcbfc('0x4c')](_[_0xcbfc('0x4d')](_0x2b6d5b[_0xcbfc('0x44')],_0x563d59['filters']));if(_0x2b6d5b['query'][_0xcbfc('0x50')]){_0x14cfb9[_0xcbfc('0x4b')]=_[_0xcbfc('0x4e')](_0x14cfb9[_0xcbfc('0x4b')],{'$or':_[_0xcbfc('0x3c')](_0x14cfb9['attributes'],function(_0x24f8d7){var _0x1ac86f={};_0x1ac86f[_0x24f8d7]={'$like':'%'+_0x2b6d5b['query'][_0xcbfc('0x50')]+'%'};return _0x1ac86f;})});}_0x14cfb9=_[_0xcbfc('0x4e')]({},_0x14cfb9,_0x2b6d5b[_0xcbfc('0x51')]);return _0x35d1bc['getAgents'](_0x14cfb9);}})[_0xcbfc('0x22')](function(_0xa156d7){if(_0xa156d7){_0x2f0bd7=_0xa156d7[_0xcbfc('0x58')];if(!_0x2b6d5b[_0xcbfc('0x44')]['hasOwnProperty'](_0xcbfc('0x68'))){_0x14cfb9[_0xcbfc('0x48')]=qs['limit'](_0x2b6d5b[_0xcbfc('0x44')]['limit']);_0x14cfb9['offset']=qs[_0xcbfc('0x2f')](_0x2b6d5b[_0xcbfc('0x44')][_0xcbfc('0x2f')]);}return _0x35d1bc[_0xcbfc('0x78')](_0x14cfb9);}})[_0xcbfc('0x22')](function(_0x39710b){if(_0x39710b){return _0x39710b?{'count':_0x2f0bd7,'rows':_0x39710b}:null;}})[_0xcbfc('0x22')](respondWithResult(_0x35bac6,null))[_0xcbfc('0x2b')](handleError(_0x35bac6,null));};exports[_0xcbfc('0x7a')]=function(_0x13de23,_0x306d8c){var _0x55fe16=_0x13de23[_0xcbfc('0x56')]['id'];var _0x5a6068=_0x13de23[_0xcbfc('0x5b')];var _0xcbce99=0xc8;var _0x737ace=null;return db[_0xcbfc('0x7b')][_0xcbfc('0x7c')]({'isolationLevel':db['sequelize'][_0xcbfc('0x7d')][_0xcbfc('0x7e')]['READ_COMMITTED']},function(_0x207041){return db['WhatsappAccount'][_0xcbfc('0x66')]({'where':{'id':_0x55fe16},'transaction':_0x207041})[_0xcbfc('0x22')](function(_0x43778b){if(_0x43778b){return db['WhatsappApplication'][_0xcbfc('0x38')]({'where':{'WhatsappAccountId':_0x55fe16},'transaction':_0x207041})[_0xcbfc('0x22')](function(){var _0x4d436d=_[_0xcbfc('0x3c')](_0x5a6068,function(_0x229689){_0x229689['WhatsappAccountId']=_0x55fe16;return _0x229689;});return db[_0xcbfc('0x7f')]['bulkCreate'](_0x4d436d,{'transaction':_0x207041});});}else{_0xcbce99=0x194;_0x737ace=[];}});})[_0xcbfc('0x22')](function(){if(_0xcbce99!==0x194){return db[_0xcbfc('0x7f')][_0xcbfc('0x80')]({'where':{'WhatsappAccountId':_0x55fe16},'order':_0xcbfc('0x81')})['then'](function(_0x3555f4){_0x737ace=_0x3555f4;});}})[_0xcbfc('0x2b')](function(_0x91a689){_0xcbce99=0x1f4;logger['error'](_0x91a689[_0xcbfc('0x82')]);if(_0x91a689[_0xcbfc('0x4f')]){delete _0x91a689['name'];}_0x737ace=_0x91a689;})[_0xcbfc('0x83')](function(){if(_0x737ace===null){_0x306d8c[_0xcbfc('0x39')](_0xcbce99);}else{if(_0xcbce99===0x1f4){_0x306d8c[_0xcbfc('0x2c')](_0xcbce99)[_0xcbfc('0x84')](_0x737ace);}else{_0x306d8c[_0xcbfc('0x2c')](_0xcbce99)['json'](_0x737ace);}}});};exports[_0xcbfc('0x85')]=function(_0x358e53,_0x256ff6,_0x75cad3){var _0x2f0ed9={};var _0x5babc7={};var _0xb00b4a;var _0x174de5;return db[_0xcbfc('0x3d')][_0xcbfc('0x66')]({'where':{'id':_0x358e53[_0xcbfc('0x56')]['id']}})[_0xcbfc('0x22')](handleEntityNotFound(_0x256ff6,null))[_0xcbfc('0x22')](function(_0x5ca7c7){if(_0x5ca7c7){_0xb00b4a=_0x5ca7c7;_0x5babc7[_0xcbfc('0x42')]=_[_0xcbfc('0x43')](db['WhatsappApplication'][_0xcbfc('0x3e')]);_0x5babc7[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x358e53[_0xcbfc('0x44')]);_0x5babc7['filters']=_['intersection'](_0x5babc7[_0xcbfc('0x42')],_0x5babc7[_0xcbfc('0x44')]);_0x2f0ed9[_0xcbfc('0x45')]=_['intersection'](_0x5babc7['model'],qs[_0xcbfc('0x47')](_0x358e53[_0xcbfc('0x44')]['fields']));_0x2f0ed9['attributes']=_0x2f0ed9[_0xcbfc('0x45')][_0xcbfc('0x58')]?_0x2f0ed9['attributes']:_0x5babc7[_0xcbfc('0x42')];_0x2f0ed9['order']=qs[_0xcbfc('0x4a')](_0x358e53['query'][_0xcbfc('0x4a')]);_0x2f0ed9['where']=qs[_0xcbfc('0x4c')](_['pick'](_0x358e53[_0xcbfc('0x44')],_0x5babc7[_0xcbfc('0x4c')]));if(_0x358e53['query'][_0xcbfc('0x50')]){_0x2f0ed9[_0xcbfc('0x4b')]=_[_0xcbfc('0x4e')](_0x2f0ed9[_0xcbfc('0x4b')],{'$or':_[_0xcbfc('0x3c')](_0x2f0ed9['attributes'],function(_0x539dbd){var _0x311950={};_0x311950[_0x539dbd]={'$like':'%'+_0x358e53[_0xcbfc('0x44')][_0xcbfc('0x50')]+'%'};return _0x311950;})});}_0x2f0ed9=_[_0xcbfc('0x4e')]({},_0x2f0ed9,_0x358e53[_0xcbfc('0x51')]);return _0xb00b4a[_0xcbfc('0x85')](_0x2f0ed9);}})[_0xcbfc('0x22')](function(_0x287d4b){if(_0x287d4b){_0x174de5=_0x287d4b[_0xcbfc('0x58')];if(!_0x358e53[_0xcbfc('0x44')]['hasOwnProperty']('nolimit')){_0x2f0ed9['limit']=qs['limit'](_0x358e53[_0xcbfc('0x44')]['limit']);_0x2f0ed9[_0xcbfc('0x2f')]=qs[_0xcbfc('0x2f')](_0x358e53['query'][_0xcbfc('0x2f')]);}return _0xb00b4a['getApplications'](_0x2f0ed9);}})['then'](function(_0x439911){if(_0x439911){return _0x439911?{'count':_0x174de5,'rows':_0x439911}:null;}})['then'](respondWithResult(_0x256ff6,null))[_0xcbfc('0x2b')](handleError(_0x256ff6,null));};exports['notify']=function(_0x2d8f3f,_0x2388e2,_0x2079ec){var _0x240e74={'channel':_0xcbfc('0x86')};var _0x5a93a9=[];var _0x48cc13=[];var _0x54421d={};return db[_0xcbfc('0x3d')][_0xcbfc('0x59')]({'where':{'id':_0x2d8f3f[_0xcbfc('0x56')]['id']},'include':[{'model':db[_0xcbfc('0x7f')],'as':_0xcbfc('0x87')}]})[_0xcbfc('0x22')](handleEntityNotFound(_0x2388e2,null))['then'](function(_0x4582c8){_0x240e74[_0xcbfc('0x88')]=_0x4582c8;if(_0x240e74['account']&&_0x240e74[_0xcbfc('0x88')][_0xcbfc('0x40')]===_0xcbfc('0x89')&&_0x2d8f3f['body'][_0xcbfc('0x8a')]){if(_0x2d8f3f[_0xcbfc('0x5b')][_0xcbfc('0x8a')]['length']===0x0)return;if(_0x2d8f3f['body'][_0xcbfc('0x8a')][0x0]['state']!==_0xcbfc('0x8b'))return;return db[_0xcbfc('0x8c')][_0xcbfc('0x35')]({'read':!![],'readAt':_0x2d8f3f[_0xcbfc('0x5b')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x2d8f3f[_0xcbfc('0x5b')][_0xcbfc('0x8a')][0x0][_0xcbfc('0x8d')]},'individualHooks':!![]})[_0xcbfc('0x22')](function(_0x3f2d04){return _0x2388e2[_0xcbfc('0x2c')](0xc8)[_0xcbfc('0x2e')](_0x3f2d04);});}_0x240e74['applications']=_[_0xcbfc('0x8e')](_0x4582c8[_0xcbfc('0x87')],[_0xcbfc('0x81')],[_0xcbfc('0x8f')]);if(_0x240e74['account'][_0xcbfc('0x87')]){delete _0x240e74[_0xcbfc('0x88')][_0xcbfc('0x87')];}return db[_0xcbfc('0x90')]['describe']()[_0xcbfc('0x22')](function(_0x2c8baa){if(!_0x2c8baa){throw new db[(_0xcbfc('0x91'))]['ValidationError'](_0xcbfc('0x92'));}_0x5a93a9=_[_0xcbfc('0x93')](_['keys'](_0x2c8baa),[_0xcbfc('0x94'),_0xcbfc('0x95')]);_0x48cc13=_['difference'](_[_0xcbfc('0x43')](_0x2c8baa),[_0xcbfc('0x94'),_0xcbfc('0x95'),_0xcbfc('0x96'),'ListId']);_0x240e74['body']={'mapKey':_0xcbfc('0x97')};if(_0x240e74[_0xcbfc('0x88')]&&_0x240e74[_0xcbfc('0x88')][_0xcbfc('0x40')]===_0xcbfc('0x98')){_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x99')]=_0x2d8f3f[_0xcbfc('0x5b')][_0xcbfc('0x9a')][_0xcbfc('0x9b')]('whatsapp:','');_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x5b')]=_0x2d8f3f['body'][_0xcbfc('0x9c')];_0x240e74['body']['messageId']=_0x2d8f3f['body'][_0xcbfc('0x9d')];}if(_0x240e74[_0xcbfc('0x88')]&&_0x240e74['account'][_0xcbfc('0x40')]===_0xcbfc('0x89')){_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x99')]=_0x2d8f3f[_0xcbfc('0x5b')]['notifications'][0x0][_0xcbfc('0x99')];_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x5b')]=_0x2d8f3f[_0xcbfc('0x5b')][_0xcbfc('0x9e')][0x0][_0xcbfc('0x2a')][_0xcbfc('0x5b')];_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x9f')]=_0x2d8f3f[_0xcbfc('0x5b')][_0xcbfc('0x9e')][0x0][_0xcbfc('0x8d')];}if(_0x240e74[_0xcbfc('0x5b')]['id']){delete _0x240e74['body']['id'];}if(_['isNil'](_0x240e74['body'][_0xcbfc('0x99')])){throw new db[(_0xcbfc('0x91'))][(_0xcbfc('0xa0'))](_0xcbfc('0xa1'));}if(_[_0xcbfc('0xa2')](_0x240e74['body']['body'])||_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x5b')]===''){throw new db[(_0xcbfc('0x91'))][(_0xcbfc('0xa0'))](_0xcbfc('0xa3'));}if(_['isNil'](_0x240e74['body'][_0xcbfc('0xa4')])){throw new db['Sequelize'][(_0xcbfc('0xa0'))](_0xcbfc('0xa5')+_0x48cc13);}if(!_[_0xcbfc('0xa6')](_0x48cc13,_0x240e74[_0xcbfc('0x5b')]['mapKey'])){throw new db[(_0xcbfc('0x91'))][(_0xcbfc('0xa0'))](_0xcbfc('0xa7')+_0x48cc13);}_0x54421d[_0x240e74['body'][_0xcbfc('0xa4')]]=_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x99')];return db[_0xcbfc('0xa8')][_0xcbfc('0x59')]({'where':{'id':_0x240e74['account'][_0xcbfc('0xa9')]},'include':[{'model':db['CmContact'],'as':_0xcbfc('0xaa'),'where':_0x54421d,'limit':0x1,'order':[[_0xcbfc('0x95'),_0xcbfc('0xab')]]}]});})[_0xcbfc('0x22')](handleEntityNotFound(_0x2388e2,null))[_0xcbfc('0x22')](function(_0x4f6e39){if(_0x4f6e39){_0x240e74['list']=_[_0xcbfc('0x71')](_0x4f6e39,[_0xcbfc('0xaa')]);if(_0x4f6e39[_0xcbfc('0xaa')][_0xcbfc('0x58')]){return _0x4f6e39[_0xcbfc('0xaa')][0x0];}var _0x373431=_['defaults'](_0x240e74[_0xcbfc('0x5b')],{'firstName':_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x99')],'ListId':_0x4f6e39['id']});_0x373431[_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0xa4')]]=_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0x99')];return db[_0xcbfc('0x90')][_0xcbfc('0x5a')](_0x373431,{'fields':_0x5a93a9,'raw':!![]});}})[_0xcbfc('0x22')](handleEntityNotFound(_0x2388e2,null))[_0xcbfc('0x22')](function(_0x763858){if(_0x763858){_0x240e74[_0xcbfc('0xac')]=_0x763858;var _0x48de1f={'ContactId':_0x763858['id'],'phone':_0x240e74['body'][_0xcbfc('0x99')],'WhatsappAccountId':_0x2d8f3f['params']['id']};var _0x30de1c={'ContactId':_0x763858['id'],'WhatsappAccountId':_0x2d8f3f[_0xcbfc('0x56')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xcbfc('0x59')]({'where':_0x30de1c})[_0xcbfc('0x22')](function(_0x1413d5){if(_0x1413d5){return[_0x1413d5,![]];}return db['WhatsappInteraction'][_0xcbfc('0x5a')](_0x48de1f)[_0xcbfc('0x22')](function(_0x364812){return[_0x364812,!![]];});});}})[_0xcbfc('0x72')](function(_0xdda102,_0x505985){_0x240e74[_0xcbfc('0xad')]=_0xdda102['get']({'plain':!![]});_0x240e74['interaction'][_0xcbfc('0xae')]=![];if(_0x505985){if(_0x240e74['account'][_0xcbfc('0xaf')]){_0x240e74['applications'][_0xcbfc('0xb0')]({'id':0x0,'priority':_0x240e74[_0xcbfc('0xb1')][_0xcbfc('0x58')]+0x1,'app':'close','appdata':_0xcbfc('0xb2'),'interval':'*,*,*,*'});}_0x240e74[_0xcbfc('0xad')][_0xcbfc('0xae')]=!![];}return db[_0xcbfc('0x8c')]['create']({'phone':_0x240e74[_0xcbfc('0x5b')]['from'],'messageId':_0x240e74['body']['messageId'],'body':_0x240e74['body'][_0xcbfc('0x5b')],'WhatsappAccountId':_0x2d8f3f['params']['id'],'WhatsappInteractionId':_0xdda102['id'],'direction':'in','ContactId':_0xdda102[_0xcbfc('0xb3')],'AttachmentId':_0x240e74[_0xcbfc('0x5b')][_0xcbfc('0xb4')]});})['then'](function(_0x41175c){_0x240e74[_0xcbfc('0x2a')]=_0x41175c;if(!_0x240e74[_0xcbfc('0xad')][_0xcbfc('0xb5')])return;return db[_0xcbfc('0x79')][_0xcbfc('0x59')]({'attributes':['id',_0xcbfc('0x4f')],'where':{'id':_0x240e74[_0xcbfc('0xad')][_0xcbfc('0xb5')]}});})[_0xcbfc('0x22')](function(_0x285ec7){if(_0x285ec7){_0x240e74[_0xcbfc('0xb1')][_0xcbfc('0xb6')]({'id':0x0,'priority':0x0,'app':_0xcbfc('0xb7'),'appdata':_0x285ec7[_0xcbfc('0x4f')]+','+(_0x240e74[_0xcbfc('0x88')][_0xcbfc('0xb8')]||0xa),'interval':_0xcbfc('0xb9')});}if(!_0x240e74[_0xcbfc('0xad')][_0xcbfc('0xba')])return;return db[_0xcbfc('0xbb')]['find']({'attributes':['id',_0xcbfc('0x4f')],'where':{'id':_0x240e74['interaction'][_0xcbfc('0xba')]}});})[_0xcbfc('0x22')](function(_0x1ea6a7){if(_0x1ea6a7){_0x240e74['applications'][_0xcbfc('0xb6')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1ea6a7['name']+','+(_0x240e74[_0xcbfc('0x88')][_0xcbfc('0xbc')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xcbfc('0xbd'),'startRouting',_0x240e74);})[_0xcbfc('0x22')](function(_0x3204a9){if(_0x3204a9){var _0x3b784a=0xc8;var _0x303d51='receiveMessage';logger[_0xcbfc('0x23')](_0xcbfc('0x26'),_0x303d51,_0x3b784a,_0xcbfc('0xbe'));logger[_0xcbfc('0x25')](_0xcbfc('0xbf'),_0x303d51,_0x3b784a,_0xcbfc('0xbe'),JSON[_0xcbfc('0x27')](_0x3204a9));if(_0x240e74[_0xcbfc('0x88')][_0xcbfc('0x40')]===_0xcbfc('0x98')){return _0x2388e2[_0xcbfc('0x2c')](_0x3b784a)[_0xcbfc('0x32')](_0xcbfc('0xc0'),_0xcbfc('0xc1'))[_0xcbfc('0x84')](_0xcbfc('0xc2'));}else{return _0x2388e2[_0xcbfc('0x2c')](_0x3b784a)[_0xcbfc('0x2e')](_0x3204a9);}}});})[_0xcbfc('0x2b')](handleError(_0x2388e2,null));};exports['send']=function(_0x3e5850,_0x58b0a4,_0x16ae8a){var _0x121b8a,_0x2aa0b1,_0x5bc38c;if(_['isNil'](_0x3e5850[_0xcbfc('0x5b')][_0xcbfc('0x5b')])||_0x3e5850[_0xcbfc('0x5b')][_0xcbfc('0x5b')]===''){throw new db['Sequelize']['ValidationError'](_0xcbfc('0xa3'));}if(_[_0xcbfc('0xa2')](_0x3e5850[_0xcbfc('0x5b')]['to'])){throw new db['Sequelize'][(_0xcbfc('0xa0'))](_0xcbfc('0xc3'));}_0x121b8a=_0x3e5850[_0xcbfc('0x5b')]['to'];return db[_0xcbfc('0x3d')][_0xcbfc('0x59')]({'where':{'id':_0x3e5850[_0xcbfc('0x56')]['id']},'include':[{'model':db[_0xcbfc('0xa8')],'as':_0xcbfc('0xc4'),'include':[{'model':db[_0xcbfc('0x90')],'as':'Contacts','where':{'mobile':_0x121b8a},'limit':0x1,'order':[[_0xcbfc('0x95'),_0xcbfc('0xab')]]}]}]})[_0xcbfc('0x22')](handleEntityNotFound(_0x58b0a4,null))[_0xcbfc('0x22')](function(_0x58cd26){if(_0x58cd26&&_0x58cd26[_0xcbfc('0xc4')]){_0x2aa0b1=_0x58cd26[_0xcbfc('0x36')]({'plain':!![]});if(_0x2aa0b1[_0xcbfc('0xc4')]&&_0x2aa0b1[_0xcbfc('0xc4')][_0xcbfc('0xaa')]['length']){return _0x2aa0b1[_0xcbfc('0xc4')][_0xcbfc('0xaa')][0x0];}return db[_0xcbfc('0x90')][_0xcbfc('0x5a')](_[_0xcbfc('0x19')](_0x3e5850[_0xcbfc('0x5b')],{'firstName':_0x121b8a,'mobile':_0x121b8a,'phone':_0x121b8a,'ListId':_0x2aa0b1['ListId']}));}})[_0xcbfc('0x22')](handleEntityNotFound(_0x58b0a4,null))[_0xcbfc('0x22')](function(_0x140758){if(_0x140758){_0x5bc38c=_0x140758;return db[_0xcbfc('0xc5')][_0xcbfc('0x59')]({'where':{'ContactId':_0x5bc38c['id'],'closed':![],'WhatsappAccountId':_0x2aa0b1['id']}})[_0xcbfc('0x22')](function(_0xe4974d){if(_0xe4974d){return[_0xe4974d,![]];}return db['WhatsappInteraction'][_0xcbfc('0x5a')]({'UserId':_0x3e5850[_0xcbfc('0x5e')]['id'],'ContactId':_0x5bc38c['id'],'WhatsappAccountId':_0x2aa0b1['id'],'phone':_0x121b8a,'firstMsgDirection':_0xcbfc('0xc6'),'Messages':[_[_0xcbfc('0x4e')](_0x3e5850[_0xcbfc('0x5b')],{'read':![],'body':_0x3e5850[_0xcbfc('0x5b')]['body'],'phone':_0x121b8a,'WhatsappAccountId':_0x2aa0b1['id'],'UserId':_0x3e5850['user']['id'],'ContactId':_0x5bc38c['id']})]},{'include':[{'model':db[_0xcbfc('0x8c')],'as':_0xcbfc('0xc7')}]})[_0xcbfc('0x22')](function(_0x38409b){return[_0x38409b,!![]];});});}})[_0xcbfc('0x72')](function(_0x5b8793,_0x101d08){if(_0x101d08){return _0x5b8793;}return db[_0xcbfc('0x8c')][_0xcbfc('0x5a')](_[_0xcbfc('0x4e')](_0x3e5850[_0xcbfc('0x5b')],{'read':![],'body':_0x3e5850[_0xcbfc('0x5b')][_0xcbfc('0x5b')],'phone':_0x121b8a,'WhatsappAccountId':_0x2aa0b1['id'],'WhatsappInteractionId':_0x5b8793['id'],'UserId':_0x3e5850[_0xcbfc('0x5e')]['id'],'ContactId':_0x5bc38c['id']}))[_0xcbfc('0x22')](function(_0x405d88){_0x5b8793[_0xcbfc('0xc8')][_0xcbfc('0xc7')]=[];_0x5b8793[_0xcbfc('0xc8')][_0xcbfc('0xc7')][_0xcbfc('0xb0')](_0x405d88[_0xcbfc('0xc8')]);return _0x5b8793;});})[_0xcbfc('0x22')](respondWithResult(_0x58b0a4,null))[_0xcbfc('0x2b')](handleError(_0x58b0a4,null));}; \ No newline at end of file +var _0x75d4=['localhost','jayson/promise','request','info','debug','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','fields','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','WhatsappAccountId','Disposition','findOne','ids','getAnswers','CannedAnswer','removeAnswers','addAgents','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','replace','whatsapp:','Body','MessageSid','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','WhatsappInteraction','spread','interaction','autoclose','push','close','*,*,*,*','created','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','List','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x53ce96,_0x5bb735){var _0x162ed4=function(_0x2588e8){while(--_0x2588e8){_0x53ce96['push'](_0x53ce96['shift']());}};_0x162ed4(++_0x5bb735);}(_0x75d4,0x16e));var _0x475d=function(_0x248fb6,_0xa44f1a){_0x248fb6=_0x248fb6-0x0;var _0x207e5f=_0x75d4[_0x248fb6];return _0x207e5f;};'use strict';var emlformat=require(_0x475d('0x0'));var rimraf=require(_0x475d('0x1'));var zipdir=require(_0x475d('0x2'));var jsonpatch=require(_0x475d('0x3'));var rp=require(_0x475d('0x4'));var moment=require(_0x475d('0x5'));var BPromise=require(_0x475d('0x6'));var Mustache=require(_0x475d('0x7'));var util=require(_0x475d('0x8'));var path=require(_0x475d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x475d('0xa'));var _=require(_0x475d('0xb'));var squel=require(_0x475d('0xc'));var crypto=require('crypto');var jsforce=require(_0x475d('0xd'));var deskjs=require(_0x475d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x475d('0xf'));var Redis=require(_0x475d('0x10'));var authService=require(_0x475d('0x11'));var qs=require(_0x475d('0x12'));var as=require(_0x475d('0x13'));var hardwareService=require(_0x475d('0x14'));var logger=require(_0x475d('0x15'))(_0x475d('0x16'));var utils=require(_0x475d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x475d('0x18'));var db=require(_0x475d('0x19'))['db'];config[_0x475d('0x1a')]=_[_0x475d('0x1b')](config[_0x475d('0x1a')],{'host':_0x475d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x475d('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1a00fc,_0xf9f5c7,_0x4722d5,_0x2613d2){return new BPromise(function(_0x3b1dfd,_0x2f1e97){var _0x6de170=_0x2613d2||client;return _0x6de170[_0x475d('0x1e')](_0x1a00fc,_0x4722d5)['then'](function(_0xe2ac1f){logger[_0x475d('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0xf9f5c7,'request\x20sent');logger[_0x475d('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xf9f5c7,_0x475d('0x21'),JSON[_0x475d('0x22')](_0xe2ac1f));if(_0xe2ac1f['error']){if(_0xe2ac1f[_0x475d('0x23')][_0x475d('0x24')]===0x1f4){logger[_0x475d('0x23')](_0x475d('0x25'),_0xf9f5c7,_0xe2ac1f[_0x475d('0x23')][_0x475d('0x26')]);return _0x2f1e97(_0xe2ac1f['error']['message']);}logger[_0x475d('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0xf9f5c7,_0xe2ac1f[_0x475d('0x23')][_0x475d('0x26')]);return _0x3b1dfd(_0xe2ac1f[_0x475d('0x23')]['message']);}else{logger[_0x475d('0x1f')](_0x475d('0x25'),_0xf9f5c7,_0x475d('0x21'));_0x3b1dfd(_0xe2ac1f['result'][_0x475d('0x26')]);}})[_0x475d('0x27')](function(_0x4365f0){logger['error'](_0x475d('0x25'),_0xf9f5c7,_0x4365f0);_0x2f1e97(_0x4365f0);});});}function respondWithStatusCode(_0x357f55,_0x1a2ecf){_0x1a2ecf=_0x1a2ecf||0xcc;return function(_0x34ddfa){if(_0x34ddfa){return _0x357f55[_0x475d('0x28')](_0x1a2ecf);}return _0x357f55[_0x475d('0x29')](_0x1a2ecf)[_0x475d('0x2a')]();};}function respondWithResult(_0x328228,_0x4a5a38){_0x4a5a38=_0x4a5a38||0xc8;return function(_0x230220){if(_0x230220){return _0x328228[_0x475d('0x29')](_0x4a5a38)['json'](_0x230220);}};}function respondWithFilteredResult(_0x1c39a1,_0x3a979d){return function(_0xf1a65f){if(_0xf1a65f){var _0x3ee84d=typeof _0x3a979d[_0x475d('0x2b')]===_0x475d('0x2c')&&typeof _0x3a979d['limit']===_0x475d('0x2c');var _0xe02ad3=_0xf1a65f[_0x475d('0x2d')];var _0x2f746b=_0x3ee84d?0x0:_0x3a979d[_0x475d('0x2b')];var _0x2539be=_0x3ee84d?_0xf1a65f[_0x475d('0x2d')]:_0x3a979d[_0x475d('0x2b')]+_0x3a979d[_0x475d('0x2e')];var _0x2d620b;if(_0x2539be>=_0xe02ad3){_0x2539be=_0xe02ad3;_0x2d620b=0xc8;}else{_0x2d620b=0xce;}_0x1c39a1['status'](_0x2d620b);return _0x1c39a1[_0x475d('0x2f')](_0x475d('0x30'),_0x2f746b+'-'+_0x2539be+'/'+_0xe02ad3)[_0x475d('0x31')](_0xf1a65f);}return null;};}function patchUpdates(_0x4de709){return function(_0x45b224){try{jsonpatch[_0x475d('0x32')](_0x45b224,_0x4de709,!![]);}catch(_0x3a4b81){return BPromise['reject'](_0x3a4b81);}return _0x45b224[_0x475d('0x33')]();};}function saveUpdates(_0x304158,_0xcd11e1){return function(_0x1fb3ae){if(_0x1fb3ae){return _0x1fb3ae[_0x475d('0x34')](_0x304158)[_0x475d('0x35')](function(_0x381efa){return _0x381efa;});}return null;};}function removeEntity(_0x535fb0,_0x83f3a1){return function(_0x56398a){if(_0x56398a){return _0x56398a[_0x475d('0x36')]()[_0x475d('0x35')](function(){var _0x5eb419=_0x56398a[_0x475d('0x37')]({'plain':!![]});var _0x2d6cb3='WhatsappAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x2d6cb3,'resourceId':_0x5eb419['id']}})[_0x475d('0x35')](function(){return _0x56398a;});})['then'](function(){_0x535fb0[_0x475d('0x29')](0xcc)[_0x475d('0x2a')]();});}};}function handleEntityNotFound(_0x3d2ec6,_0x29d786){return function(_0x31535b){if(!_0x31535b){_0x3d2ec6[_0x475d('0x28')](0x194);}return _0x31535b;};}function handleError(_0x32bc44,_0x41ecbf){_0x41ecbf=_0x41ecbf||0x1f4;return function(_0x275aa1){logger[_0x475d('0x23')](_0x275aa1[_0x475d('0x38')]);if(_0x275aa1[_0x475d('0x39')]){delete _0x275aa1[_0x475d('0x39')];}_0x32bc44['status'](_0x41ecbf)[_0x475d('0x3a')](_0x275aa1);};}exports[_0x475d('0x3b')]=function(_0x1248d4,_0xa2ec1){var _0x56257a={'include':[{'model':db[_0x475d('0x3c')],'as':_0x475d('0x3d')}]},_0x32285a={},_0x941a76={'count':0x0,'rows':[]};var _0x3bc384=_['map'](db[_0x475d('0x3e')][_0x475d('0x3f')],function(_0x4fd7cf){return{'name':_0x4fd7cf[_0x475d('0x40')],'type':_0x4fd7cf[_0x475d('0x41')]['key']};});_0x32285a[_0x475d('0x42')]=_[_0x475d('0x43')](_0x3bc384,_0x475d('0x39'));_0x32285a[_0x475d('0x44')]=_[_0x475d('0x45')](_0x1248d4[_0x475d('0x44')]);_0x32285a[_0x475d('0x46')]=_[_0x475d('0x47')](_0x32285a[_0x475d('0x42')],_0x32285a[_0x475d('0x44')]);_0x56257a[_0x475d('0x48')]=_[_0x475d('0x47')](_0x32285a[_0x475d('0x42')],qs['fields'](_0x1248d4[_0x475d('0x44')]['fields']));_0x56257a['attributes']=_0x56257a['attributes'][_0x475d('0x49')]?_0x56257a[_0x475d('0x48')]:_0x32285a[_0x475d('0x42')];if(!_0x1248d4[_0x475d('0x44')][_0x475d('0x4a')](_0x475d('0x4b'))){_0x56257a['limit']=qs['limit'](_0x1248d4['query'][_0x475d('0x2e')]);_0x56257a[_0x475d('0x2b')]=qs[_0x475d('0x2b')](_0x1248d4[_0x475d('0x44')][_0x475d('0x2b')]);}_0x56257a[_0x475d('0x4c')]=qs[_0x475d('0x4d')](_0x1248d4[_0x475d('0x44')][_0x475d('0x4d')]);_0x56257a[_0x475d('0x4e')]=qs['filters'](_[_0x475d('0x4f')](_0x1248d4[_0x475d('0x44')],_0x32285a[_0x475d('0x46')]),_0x3bc384);if(_0x1248d4[_0x475d('0x44')][_0x475d('0x50')]){_0x56257a[_0x475d('0x4e')]=_[_0x475d('0x51')](_0x56257a[_0x475d('0x4e')],{'$or':_[_0x475d('0x43')](_0x3bc384,function(_0x26593b){if(_0x26593b[_0x475d('0x41')]!==_0x475d('0x52')){var _0x13ea65={};_0x13ea65[_0x26593b[_0x475d('0x39')]]={'$like':'%'+_0x1248d4[_0x475d('0x44')][_0x475d('0x50')]+'%'};return _0x13ea65;}})});}_0x56257a=_[_0x475d('0x51')]({},_0x56257a,_0x1248d4['options']);var _0x1181f3={'where':_0x56257a['where']};return db[_0x475d('0x3e')]['count'](_0x1181f3)[_0x475d('0x35')](function(_0x21acdf){_0x941a76[_0x475d('0x2d')]=_0x21acdf;if(_0x1248d4[_0x475d('0x44')][_0x475d('0x53')]){_0x56257a[_0x475d('0x54')]=[{'all':!![]}];}return db[_0x475d('0x3e')][_0x475d('0x55')](_0x56257a);})[_0x475d('0x35')](function(_0x3a3f36){_0x941a76[_0x475d('0x56')]=_0x3a3f36;return _0x941a76;})[_0x475d('0x35')](respondWithFilteredResult(_0xa2ec1,_0x56257a))[_0x475d('0x27')](handleError(_0xa2ec1,null));};exports[_0x475d('0x57')]=function(_0x1187a3,_0x1d5264){var _0x5bc7ea={'raw':![],'where':{'id':_0x1187a3[_0x475d('0x58')]['id']},'include':[{'model':db[_0x475d('0x3c')],'as':_0x475d('0x3d')}]},_0x202fe3={};_0x202fe3[_0x475d('0x42')]=_[_0x475d('0x45')](db['WhatsappAccount'][_0x475d('0x3f')]);_0x202fe3['query']=_[_0x475d('0x45')](_0x1187a3['query']);_0x202fe3[_0x475d('0x46')]=_[_0x475d('0x47')](_0x202fe3['model'],_0x202fe3[_0x475d('0x44')]);_0x5bc7ea[_0x475d('0x48')]=_[_0x475d('0x47')](_0x202fe3[_0x475d('0x42')],qs[_0x475d('0x59')](_0x1187a3[_0x475d('0x44')]['fields']));_0x5bc7ea[_0x475d('0x48')]=_0x5bc7ea[_0x475d('0x48')][_0x475d('0x49')]?_0x5bc7ea[_0x475d('0x48')]:_0x202fe3[_0x475d('0x42')];if(_0x1187a3[_0x475d('0x44')][_0x475d('0x53')]){_0x5bc7ea['include']=[{'all':!![]}];}_0x5bc7ea=_[_0x475d('0x51')]({},_0x5bc7ea,_0x1187a3[_0x475d('0x5a')]);return db[_0x475d('0x3e')][_0x475d('0x5b')](_0x5bc7ea)[_0x475d('0x35')](handleEntityNotFound(_0x1d5264,null))[_0x475d('0x35')](respondWithResult(_0x1d5264,null))[_0x475d('0x27')](handleError(_0x1d5264,null));};exports[_0x475d('0x5c')]=function(_0x49bbab,_0x108954){return db[_0x475d('0x3e')][_0x475d('0x5c')](_0x49bbab[_0x475d('0x5d')],{})[_0x475d('0x35')](function(_0xdb775f){var _0x3b9326=_0x49bbab['user'][_0x475d('0x37')]({'plain':!![]});if(!_0x3b9326)throw new Error(_0x475d('0x5e'));if(_0x3b9326['role']===_0x475d('0x5f')){var _0x3d69f8=_0xdb775f[_0x475d('0x37')]({'plain':!![]});var _0x278c83='WhatsappAccounts';return db[_0x475d('0x60')][_0x475d('0x5b')]({'where':{'name':_0x278c83,'userProfileId':_0x3b9326[_0x475d('0x61')]},'raw':!![]})[_0x475d('0x35')](function(_0x20a208){if(_0x20a208&&_0x20a208[_0x475d('0x62')]===0x0){return db[_0x475d('0x63')]['create']({'name':_0x3d69f8[_0x475d('0x39')],'resourceId':_0x3d69f8['id'],'type':_0x20a208[_0x475d('0x39')],'sectionId':_0x20a208['id']},{})['then'](function(){return _0xdb775f;});}else{return _0xdb775f;}})[_0x475d('0x27')](function(_0x4c35e7){logger[_0x475d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c35e7);throw _0x4c35e7;});}return _0xdb775f;})[_0x475d('0x35')](respondWithResult(_0x108954,0xc9))['catch'](handleError(_0x108954,null));};exports[_0x475d('0x34')]=function(_0x40c6c4,_0x1fdc23){if(_0x40c6c4[_0x475d('0x5d')]['id']){delete _0x40c6c4['body']['id'];}return db[_0x475d('0x3e')][_0x475d('0x5b')]({'where':{'id':_0x40c6c4[_0x475d('0x58')]['id']},'include':[{'model':db[_0x475d('0x3c')],'as':_0x475d('0x3d')}]})[_0x475d('0x35')](handleEntityNotFound(_0x1fdc23,null))[_0x475d('0x35')](saveUpdates(_0x40c6c4[_0x475d('0x5d')],null))[_0x475d('0x35')](respondWithResult(_0x1fdc23,null))['catch'](handleError(_0x1fdc23,null));};exports[_0x475d('0x36')]=function(_0x2dc0bb,_0x14abf9){return db['WhatsappAccount'][_0x475d('0x5b')]({'where':{'id':_0x2dc0bb['params']['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x14abf9,null))['then'](removeEntity(_0x14abf9,null))[_0x475d('0x27')](handleError(_0x14abf9,null));};exports[_0x475d('0x64')]=function(_0x298857,_0x4c2de8){return db[_0x475d('0x3e')][_0x475d('0x64')]()[_0x475d('0x35')](respondWithResult(_0x4c2de8,null))[_0x475d('0x27')](handleError(_0x4c2de8,null));};exports['addDisposition']=function(_0x4e98a2,_0x27d029,_0x23168f){if(_0x4e98a2[_0x475d('0x5d')]['id']){delete _0x4e98a2['body']['id'];}return db[_0x475d('0x3e')][_0x475d('0x5b')]({'where':{'id':_0x4e98a2['params']['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x27d029,null))['then'](function(_0x55c333){if(_0x55c333){_0x4e98a2[_0x475d('0x5d')][_0x475d('0x65')]=_0x55c333['id'];return db[_0x475d('0x66')][_0x475d('0x5c')](_0x4e98a2['body']);}})['then'](respondWithResult(_0x27d029,null))[_0x475d('0x27')](handleError(_0x27d029,null));};exports['getDispositions']=function(_0x5602ef,_0x38a099,_0x3381bc){var _0x42f53e={'raw':![],'where':{}};var _0xe4728b={};var _0x43688e={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x475d('0x67')]({'where':{'id':_0x5602ef[_0x475d('0x58')]['id']}})['then'](handleEntityNotFound(_0x38a099,null))[_0x475d('0x35')](function(_0x3e4ea1){if(_0x3e4ea1){_0xe4728b['model']=_[_0x475d('0x45')](db[_0x475d('0x66')][_0x475d('0x3f')]);_0xe4728b['query']=_[_0x475d('0x45')](_0x5602ef[_0x475d('0x44')]);_0xe4728b[_0x475d('0x46')]=_[_0x475d('0x47')](_0xe4728b[_0x475d('0x42')],_0xe4728b[_0x475d('0x44')]);_0x42f53e[_0x475d('0x48')]=_[_0x475d('0x47')](_0xe4728b[_0x475d('0x42')],qs['fields'](_0x5602ef[_0x475d('0x44')][_0x475d('0x59')]));_0x42f53e[_0x475d('0x48')]=_0x42f53e[_0x475d('0x48')]['length']?_0x42f53e[_0x475d('0x48')]:_0xe4728b[_0x475d('0x42')];if(!_0x5602ef['query'][_0x475d('0x4a')](_0x475d('0x4b'))){_0x42f53e[_0x475d('0x2e')]=qs[_0x475d('0x2e')](_0x5602ef['query'][_0x475d('0x2e')]);_0x42f53e[_0x475d('0x2b')]=qs[_0x475d('0x2b')](_0x5602ef[_0x475d('0x44')]['offset']);}_0x42f53e[_0x475d('0x4c')]=qs[_0x475d('0x4d')](_0x5602ef[_0x475d('0x44')][_0x475d('0x4d')]);_0x42f53e[_0x475d('0x4e')]=qs['filters'](_[_0x475d('0x4f')](_0x5602ef[_0x475d('0x44')],_0xe4728b['filters']));_0x42f53e['where'][_0x475d('0x65')]=_0x3e4ea1['id'];if(_0x5602ef['query'][_0x475d('0x50')]){_0x42f53e[_0x475d('0x4e')]=_['merge'](_0x42f53e[_0x475d('0x4e')],{'$or':_[_0x475d('0x43')](_0x42f53e[_0x475d('0x48')],function(_0xe00b38){var _0x25d08d={};_0x25d08d[_0xe00b38]={'$like':'%'+_0x5602ef['query'][_0x475d('0x50')]+'%'};return _0x25d08d;})});}_0x42f53e=_[_0x475d('0x51')]({},_0x42f53e,_0x5602ef[_0x475d('0x5a')]);return db[_0x475d('0x66')][_0x475d('0x2d')]({'where':_0x42f53e[_0x475d('0x4e')]})[_0x475d('0x35')](function(_0x4db1e4){_0x43688e['count']=_0x4db1e4;if(_0x5602ef[_0x475d('0x44')][_0x475d('0x53')]){_0x42f53e[_0x475d('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x475d('0x55')](_0x42f53e);})[_0x475d('0x35')](function(_0x1d7af6){_0x43688e[_0x475d('0x56')]=_0x1d7af6;return _0x43688e;});}})[_0x475d('0x35')](respondWithFilteredResult(_0x38a099,_0x42f53e))[_0x475d('0x27')](handleError(_0x38a099,null));};exports['removeDispositions']=function(_0xb23f89,_0x4be300,_0x2c272b){return db[_0x475d('0x3e')]['find']({'where':{'id':_0xb23f89[_0x475d('0x58')]['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x4be300,null))['then'](function(_0x55b04c){if(_0x55b04c){return _0x55b04c['removeDispositions'](_0xb23f89[_0x475d('0x44')][_0x475d('0x68')]);}})[_0x475d('0x35')](respondWithStatusCode(_0x4be300,null))[_0x475d('0x27')](handleError(_0x4be300,null));};exports['addAnswer']=function(_0xe34915,_0x270d7c,_0x167495){if(_0xe34915[_0x475d('0x5d')]['id']){delete _0xe34915[_0x475d('0x5d')]['id'];}return db[_0x475d('0x3e')][_0x475d('0x5b')]({'where':{'id':_0xe34915['params']['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x270d7c,null))[_0x475d('0x35')](function(_0x5288dd){if(_0x5288dd){_0xe34915[_0x475d('0x5d')][_0x475d('0x65')]=_0x5288dd['id'];return db['CannedAnswer'][_0x475d('0x5c')](_0xe34915[_0x475d('0x5d')]);}})[_0x475d('0x35')](respondWithResult(_0x270d7c,null))[_0x475d('0x27')](handleError(_0x270d7c,null));};exports[_0x475d('0x69')]=function(_0xb4760c,_0x3f96df,_0x4e9fb1){var _0x2ac447={'raw':![],'where':{}};var _0x5414e={};var _0x353060={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x475d('0x67')]({'where':{'id':_0xb4760c[_0x475d('0x58')]['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x3f96df,null))[_0x475d('0x35')](function(_0x3f66b4){if(_0x3f66b4){_0x5414e[_0x475d('0x42')]=_[_0x475d('0x45')](db[_0x475d('0x6a')][_0x475d('0x3f')]);_0x5414e[_0x475d('0x44')]=_['keys'](_0xb4760c[_0x475d('0x44')]);_0x5414e[_0x475d('0x46')]=_['intersection'](_0x5414e[_0x475d('0x42')],_0x5414e[_0x475d('0x44')]);_0x2ac447[_0x475d('0x48')]=_['intersection'](_0x5414e['model'],qs[_0x475d('0x59')](_0xb4760c[_0x475d('0x44')][_0x475d('0x59')]));_0x2ac447[_0x475d('0x48')]=_0x2ac447[_0x475d('0x48')]['length']?_0x2ac447[_0x475d('0x48')]:_0x5414e[_0x475d('0x42')];if(!_0xb4760c[_0x475d('0x44')][_0x475d('0x4a')]('nolimit')){_0x2ac447[_0x475d('0x2e')]=qs[_0x475d('0x2e')](_0xb4760c[_0x475d('0x44')][_0x475d('0x2e')]);_0x2ac447[_0x475d('0x2b')]=qs[_0x475d('0x2b')](_0xb4760c[_0x475d('0x44')][_0x475d('0x2b')]);}_0x2ac447[_0x475d('0x4c')]=qs[_0x475d('0x4d')](_0xb4760c['query']['sort']);_0x2ac447[_0x475d('0x4e')]=qs[_0x475d('0x46')](_[_0x475d('0x4f')](_0xb4760c[_0x475d('0x44')],_0x5414e['filters']));_0x2ac447[_0x475d('0x4e')][_0x475d('0x65')]=_0x3f66b4['id'];if(_0xb4760c[_0x475d('0x44')][_0x475d('0x50')]){_0x2ac447['where']=_[_0x475d('0x51')](_0x2ac447[_0x475d('0x4e')],{'$or':_[_0x475d('0x43')](_0x2ac447[_0x475d('0x48')],function(_0xe8b754){var _0x4ef360={};_0x4ef360[_0xe8b754]={'$like':'%'+_0xb4760c[_0x475d('0x44')][_0x475d('0x50')]+'%'};return _0x4ef360;})});}_0x2ac447=_['merge']({},_0x2ac447,_0xb4760c[_0x475d('0x5a')]);return db[_0x475d('0x6a')][_0x475d('0x2d')]({'where':_0x2ac447['where']})[_0x475d('0x35')](function(_0x1817fb){_0x353060[_0x475d('0x2d')]=_0x1817fb;if(_0xb4760c[_0x475d('0x44')][_0x475d('0x53')]){_0x2ac447[_0x475d('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x475d('0x55')](_0x2ac447);})[_0x475d('0x35')](function(_0x372c61){_0x353060['rows']=_0x372c61;return _0x353060;});}})['then'](respondWithFilteredResult(_0x3f96df,_0x2ac447))['catch'](handleError(_0x3f96df,null));};exports[_0x475d('0x6b')]=function(_0x5c3a47,_0x561438,_0x5b0699){return db['WhatsappAccount'][_0x475d('0x5b')]({'where':{'id':_0x5c3a47['params']['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x561438,null))[_0x475d('0x35')](function(_0x4b2c11){if(_0x4b2c11){return _0x4b2c11['removeAnswers'](_0x5c3a47['query']['ids']);}})[_0x475d('0x35')](respondWithStatusCode(_0x561438,null))[_0x475d('0x27')](handleError(_0x561438,null));};exports[_0x475d('0x6c')]=function(_0x2d36fe,_0x330426,_0x30e6bf){return db[_0x475d('0x3e')]['find']({'where':{'id':_0x2d36fe[_0x475d('0x58')]['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x330426,null))[_0x475d('0x35')](function(_0x29bc50){if(_0x29bc50){return _0x29bc50[_0x475d('0x6c')](_0x2d36fe[_0x475d('0x5d')][_0x475d('0x68')],_['omit'](_0x2d36fe[_0x475d('0x5d')],['ids','id'])||{})['spread'](function(_0x4238d1){for(var _0x16ead1=0x0;_0x16ead1<_0x2d36fe['body']['ids']['length'];_0x16ead1+=0x1){socket[_0x475d('0x6d')](_0x475d('0x6e'),{'UserId':Number(_0x2d36fe['body']['ids'][_0x16ead1]),'WhatsappAccountId':Number(_0x2d36fe['params']['id'])});}return _0x4238d1;});}})[_0x475d('0x35')](respondWithResult(_0x330426,null))[_0x475d('0x27')](handleError(_0x330426,null));};exports[_0x475d('0x6f')]=function(_0x23996c,_0x48a98f,_0x12b704){return db['WhatsappAccount'][_0x475d('0x5b')]({'where':{'id':_0x23996c[_0x475d('0x58')]['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x48a98f,null))['then'](function(_0xe10038){if(_0xe10038){return _0xe10038[_0x475d('0x6f')](_0x23996c[_0x475d('0x44')][_0x475d('0x68')])[_0x475d('0x35')](function(){if(_[_0x475d('0x70')](_0x23996c['query'][_0x475d('0x68')])){for(var _0x10a1f9=0x0;_0x10a1f9<_0x23996c[_0x475d('0x44')][_0x475d('0x68')][_0x475d('0x49')];_0x10a1f9+=0x1){socket[_0x475d('0x6d')](_0x475d('0x71'),{'UserId':Number(_0x23996c['query'][_0x475d('0x68')][_0x10a1f9]),'WhatsappAccountId':Number(_0x23996c[_0x475d('0x58')]['id'])});}}else{socket[_0x475d('0x6d')](_0x475d('0x71'),{'UserId':Number(_0x23996c[_0x475d('0x44')]['ids']),'WhatsappAccountId':Number(_0x23996c[_0x475d('0x58')]['id'])});}});}})[_0x475d('0x35')](respondWithStatusCode(_0x48a98f,null))[_0x475d('0x27')](handleError(_0x48a98f,null));};exports[_0x475d('0x72')]=function(_0x1077d5,_0x456291,_0x10cb30){var _0x4bfb50={};var _0x40e111={};var _0xd5065d;var _0x277edc;return db[_0x475d('0x3e')][_0x475d('0x67')]({'where':{'id':_0x1077d5[_0x475d('0x58')]['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x456291,null))[_0x475d('0x35')](function(_0x310ea4){if(_0x310ea4){_0xd5065d=_0x310ea4;_0x40e111[_0x475d('0x42')]=_[_0x475d('0x45')](db['User'][_0x475d('0x3f')]);_0x40e111[_0x475d('0x44')]=_[_0x475d('0x45')](_0x1077d5[_0x475d('0x44')]);_0x40e111['filters']=_[_0x475d('0x47')](_0x40e111['model'],_0x40e111[_0x475d('0x44')]);_0x4bfb50[_0x475d('0x48')]=_[_0x475d('0x47')](_0x40e111[_0x475d('0x42')],qs['fields'](_0x1077d5[_0x475d('0x44')][_0x475d('0x59')]));_0x4bfb50[_0x475d('0x48')]=_0x4bfb50[_0x475d('0x48')][_0x475d('0x49')]?_0x4bfb50['attributes']:_0x40e111[_0x475d('0x42')];_0x4bfb50[_0x475d('0x4c')]=qs['sort'](_0x1077d5[_0x475d('0x44')][_0x475d('0x4d')]);_0x4bfb50[_0x475d('0x4e')]=qs[_0x475d('0x46')](_['pick'](_0x1077d5['query'],_0x40e111[_0x475d('0x46')]));if(_0x1077d5[_0x475d('0x44')][_0x475d('0x50')]){_0x4bfb50['where']=_[_0x475d('0x51')](_0x4bfb50['where'],{'$or':_[_0x475d('0x43')](_0x4bfb50[_0x475d('0x48')],function(_0x2c2139){var _0x1edd80={};_0x1edd80[_0x2c2139]={'$like':'%'+_0x1077d5[_0x475d('0x44')]['filter']+'%'};return _0x1edd80;})});}_0x4bfb50=_[_0x475d('0x51')]({},_0x4bfb50,_0x1077d5[_0x475d('0x5a')]);return _0xd5065d[_0x475d('0x72')](_0x4bfb50);}})['then'](function(_0x2a6cf0){if(_0x2a6cf0){_0x277edc=_0x2a6cf0['length'];if(!_0x1077d5[_0x475d('0x44')][_0x475d('0x4a')](_0x475d('0x4b'))){_0x4bfb50[_0x475d('0x2e')]=qs['limit'](_0x1077d5['query'][_0x475d('0x2e')]);_0x4bfb50[_0x475d('0x2b')]=qs[_0x475d('0x2b')](_0x1077d5[_0x475d('0x44')][_0x475d('0x2b')]);}return _0xd5065d['getAgents'](_0x4bfb50);}})[_0x475d('0x35')](function(_0x2cd868){if(_0x2cd868){return _0x2cd868?{'count':_0x277edc,'rows':_0x2cd868}:null;}})[_0x475d('0x35')](respondWithResult(_0x456291,null))[_0x475d('0x27')](handleError(_0x456291,null));};exports['addApplications']=function(_0x2b724f,_0x20fa79){var _0x2cec93=_0x2b724f[_0x475d('0x58')]['id'];var _0x26121e=_0x2b724f[_0x475d('0x5d')];var _0x46b47d=0xc8;var _0x1a4b23=null;return db[_0x475d('0x73')][_0x475d('0x74')]({'isolationLevel':db[_0x475d('0x73')][_0x475d('0x75')][_0x475d('0x76')][_0x475d('0x77')]},function(_0x5e2d16){return db[_0x475d('0x3e')][_0x475d('0x67')]({'where':{'id':_0x2cec93},'transaction':_0x5e2d16})[_0x475d('0x35')](function(_0x245033){if(_0x245033){return db[_0x475d('0x78')][_0x475d('0x36')]({'where':{'WhatsappAccountId':_0x2cec93},'transaction':_0x5e2d16})[_0x475d('0x35')](function(){var _0x3ec146=_[_0x475d('0x43')](_0x26121e,function(_0x42bcbb){_0x42bcbb[_0x475d('0x65')]=_0x2cec93;return _0x42bcbb;});return db[_0x475d('0x78')][_0x475d('0x79')](_0x3ec146,{'transaction':_0x5e2d16});});}else{_0x46b47d=0x194;_0x1a4b23=[];}});})['then'](function(){if(_0x46b47d!==0x194){return db[_0x475d('0x78')][_0x475d('0x7a')]({'where':{'WhatsappAccountId':_0x2cec93},'order':_0x475d('0x7b')})[_0x475d('0x35')](function(_0x5b2a51){_0x1a4b23=_0x5b2a51;});}})[_0x475d('0x27')](function(_0x517d6b){_0x46b47d=0x1f4;logger[_0x475d('0x23')](_0x517d6b[_0x475d('0x38')]);if(_0x517d6b[_0x475d('0x39')]){delete _0x517d6b[_0x475d('0x39')];}_0x1a4b23=_0x517d6b;})['finally'](function(){if(_0x1a4b23===null){_0x20fa79[_0x475d('0x28')](_0x46b47d);}else{if(_0x46b47d===0x1f4){_0x20fa79[_0x475d('0x29')](_0x46b47d)[_0x475d('0x3a')](_0x1a4b23);}else{_0x20fa79[_0x475d('0x29')](_0x46b47d)[_0x475d('0x31')](_0x1a4b23);}}});};exports[_0x475d('0x7c')]=function(_0x2f0f78,_0x486a98,_0x572f14){var _0x3a7d03={};var _0x4902e2={};var _0x4d0389;var _0x11f11e;return db[_0x475d('0x3e')]['findOne']({'where':{'id':_0x2f0f78[_0x475d('0x58')]['id']}})[_0x475d('0x35')](handleEntityNotFound(_0x486a98,null))[_0x475d('0x35')](function(_0x3b2ec7){if(_0x3b2ec7){_0x4d0389=_0x3b2ec7;_0x4902e2['model']=_[_0x475d('0x45')](db[_0x475d('0x78')][_0x475d('0x3f')]);_0x4902e2[_0x475d('0x44')]=_[_0x475d('0x45')](_0x2f0f78[_0x475d('0x44')]);_0x4902e2['filters']=_[_0x475d('0x47')](_0x4902e2[_0x475d('0x42')],_0x4902e2['query']);_0x3a7d03[_0x475d('0x48')]=_[_0x475d('0x47')](_0x4902e2[_0x475d('0x42')],qs[_0x475d('0x59')](_0x2f0f78[_0x475d('0x44')][_0x475d('0x59')]));_0x3a7d03[_0x475d('0x48')]=_0x3a7d03[_0x475d('0x48')][_0x475d('0x49')]?_0x3a7d03[_0x475d('0x48')]:_0x4902e2[_0x475d('0x42')];_0x3a7d03[_0x475d('0x4c')]=qs['sort'](_0x2f0f78[_0x475d('0x44')][_0x475d('0x4d')]);_0x3a7d03[_0x475d('0x4e')]=qs[_0x475d('0x46')](_['pick'](_0x2f0f78[_0x475d('0x44')],_0x4902e2[_0x475d('0x46')]));if(_0x2f0f78[_0x475d('0x44')][_0x475d('0x50')]){_0x3a7d03['where']=_[_0x475d('0x51')](_0x3a7d03[_0x475d('0x4e')],{'$or':_[_0x475d('0x43')](_0x3a7d03[_0x475d('0x48')],function(_0x41b254){var _0x20dbcd={};_0x20dbcd[_0x41b254]={'$like':'%'+_0x2f0f78['query'][_0x475d('0x50')]+'%'};return _0x20dbcd;})});}_0x3a7d03=_[_0x475d('0x51')]({},_0x3a7d03,_0x2f0f78[_0x475d('0x5a')]);return _0x4d0389[_0x475d('0x7c')](_0x3a7d03);}})[_0x475d('0x35')](function(_0x35b9ed){if(_0x35b9ed){_0x11f11e=_0x35b9ed[_0x475d('0x49')];if(!_0x2f0f78[_0x475d('0x44')][_0x475d('0x4a')](_0x475d('0x4b'))){_0x3a7d03[_0x475d('0x2e')]=qs[_0x475d('0x2e')](_0x2f0f78['query'][_0x475d('0x2e')]);_0x3a7d03[_0x475d('0x2b')]=qs[_0x475d('0x2b')](_0x2f0f78[_0x475d('0x44')][_0x475d('0x2b')]);}return _0x4d0389['getApplications'](_0x3a7d03);}})[_0x475d('0x35')](function(_0x8a9951){if(_0x8a9951){return _0x8a9951?{'count':_0x11f11e,'rows':_0x8a9951}:null;}})[_0x475d('0x35')](respondWithResult(_0x486a98,null))[_0x475d('0x27')](handleError(_0x486a98,null));};exports['notify']=function(_0x3a4cb7,_0x458c48,_0x5384df){var _0x21def4={'channel':_0x475d('0x7d')};var _0x325282=[];var _0x417a69=[];var _0x45b575={};return db[_0x475d('0x3e')][_0x475d('0x5b')]({'where':{'id':_0x3a4cb7[_0x475d('0x58')]['id']},'include':[{'model':db[_0x475d('0x78')],'as':_0x475d('0x7e')}]})[_0x475d('0x35')](handleEntityNotFound(_0x458c48,null))[_0x475d('0x35')](function(_0x51500d){_0x21def4[_0x475d('0x7f')]=_0x51500d;if(_0x21def4[_0x475d('0x7f')]&&_0x21def4[_0x475d('0x7f')][_0x475d('0x41')]===_0x475d('0x80')&&_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x81')]){if(_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x81')]['length']===0x0)return;if(_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x81')][0x0][_0x475d('0x82')]!==_0x475d('0x83'))return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x81')][0x0]['timestamp']},{'where':{'messageId':_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x81')][0x0]['message_id']},'individualHooks':!![]})[_0x475d('0x35')](function(_0x57d619){return _0x458c48[_0x475d('0x29')](0xc8)[_0x475d('0x31')](_0x57d619);});}_0x21def4[_0x475d('0x84')]=_['orderBy'](_0x51500d[_0x475d('0x7e')],[_0x475d('0x7b')],['asc']);if(_0x21def4[_0x475d('0x7f')][_0x475d('0x7e')]){delete _0x21def4[_0x475d('0x7f')][_0x475d('0x7e')];}return db[_0x475d('0x85')][_0x475d('0x64')]()[_0x475d('0x35')](function(_0x2d4f7e){if(!_0x2d4f7e){throw new db[(_0x475d('0x86'))][(_0x475d('0x87'))](_0x475d('0x88'));}_0x325282=_[_0x475d('0x89')](_[_0x475d('0x45')](_0x2d4f7e),[_0x475d('0x8a'),'updatedAt']);_0x417a69=_[_0x475d('0x89')](_['keys'](_0x2d4f7e),['createdAt',_0x475d('0x8b'),_0x475d('0x8c'),_0x475d('0x8d')]);_0x21def4[_0x475d('0x5d')]={'mapKey':_0x475d('0x8e')};if(_0x21def4[_0x475d('0x7f')]&&_0x21def4[_0x475d('0x7f')][_0x475d('0x41')]==='twilio'){_0x21def4['body'][_0x475d('0x8f')]=_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x90')][_0x475d('0x91')](_0x475d('0x92'),'');_0x21def4[_0x475d('0x5d')][_0x475d('0x5d')]=_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x93')];_0x21def4[_0x475d('0x5d')]['messageId']=_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x94')];}if(_0x21def4[_0x475d('0x7f')]&&_0x21def4[_0x475d('0x7f')]['type']==='sinch'){_0x21def4[_0x475d('0x5d')][_0x475d('0x8f')]=_0x3a4cb7['body']['notifications'][0x0][_0x475d('0x8f')];_0x21def4[_0x475d('0x5d')][_0x475d('0x5d')]=_0x3a4cb7[_0x475d('0x5d')][_0x475d('0x95')][0x0]['message'][_0x475d('0x5d')];_0x21def4[_0x475d('0x5d')]['messageId']=_0x3a4cb7['body'][_0x475d('0x95')][0x0][_0x475d('0x96')];}if(_0x21def4['body']['id']){delete _0x21def4[_0x475d('0x5d')]['id'];}if(_[_0x475d('0x97')](_0x21def4[_0x475d('0x5d')][_0x475d('0x8f')])){throw new db['Sequelize'][(_0x475d('0x87'))](_0x475d('0x98'));}if(_[_0x475d('0x97')](_0x21def4[_0x475d('0x5d')]['body'])||_0x21def4[_0x475d('0x5d')]['body']===''){throw new db[(_0x475d('0x86'))][(_0x475d('0x87'))](_0x475d('0x99'));}if(_[_0x475d('0x97')](_0x21def4[_0x475d('0x5d')]['mapKey'])){throw new db[(_0x475d('0x86'))][(_0x475d('0x87'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x417a69);}if(!_[_0x475d('0x9a')](_0x417a69,_0x21def4[_0x475d('0x5d')][_0x475d('0x9b')])){throw new db[(_0x475d('0x86'))]['ValidationError'](_0x475d('0x9c')+_0x417a69);}_0x45b575[_0x21def4['body']['mapKey']]=_0x21def4[_0x475d('0x5d')][_0x475d('0x8f')];return db[_0x475d('0x9d')][_0x475d('0x5b')]({'where':{'id':_0x21def4['account'][_0x475d('0x8d')]},'include':[{'model':db[_0x475d('0x85')],'as':_0x475d('0x9e'),'where':_0x45b575,'limit':0x1,'order':[[_0x475d('0x8b'),_0x475d('0x9f')]]}]});})[_0x475d('0x35')](handleEntityNotFound(_0x458c48,null))['then'](function(_0x4f0776){if(_0x4f0776){_0x21def4[_0x475d('0xa0')]=_[_0x475d('0xa1')](_0x4f0776,['Contacts']);if(_0x4f0776['Contacts'][_0x475d('0x49')]){return _0x4f0776[_0x475d('0x9e')][0x0];}var _0x3daf8e=_[_0x475d('0x1b')](_0x21def4['body'],{'firstName':_0x21def4[_0x475d('0x5d')][_0x475d('0x8f')],'ListId':_0x4f0776['id']});_0x3daf8e[_0x21def4[_0x475d('0x5d')][_0x475d('0x9b')]]=_0x21def4['body'][_0x475d('0x8f')];return db[_0x475d('0x85')][_0x475d('0x5c')](_0x3daf8e,{'fields':_0x325282,'raw':!![]});}})[_0x475d('0x35')](handleEntityNotFound(_0x458c48,null))[_0x475d('0x35')](function(_0x500d1b){if(_0x500d1b){_0x21def4[_0x475d('0xa2')]=_0x500d1b;var _0x4a67e4={'ContactId':_0x500d1b['id'],'phone':_0x21def4[_0x475d('0x5d')][_0x475d('0x8f')],'WhatsappAccountId':_0x3a4cb7[_0x475d('0x58')]['id']};var _0x1bf2e2={'ContactId':_0x500d1b['id'],'WhatsappAccountId':_0x3a4cb7[_0x475d('0x58')]['id'],'closed':![]};return db[_0x475d('0xa3')]['find']({'where':_0x1bf2e2})[_0x475d('0x35')](function(_0x43d9f6){if(_0x43d9f6){return[_0x43d9f6,![]];}return db[_0x475d('0xa3')][_0x475d('0x5c')](_0x4a67e4)[_0x475d('0x35')](function(_0x57bef9){return[_0x57bef9,!![]];});});}})[_0x475d('0xa4')](function(_0x4a85a1,_0x3d7f06){_0x21def4[_0x475d('0xa5')]=_0x4a85a1[_0x475d('0x37')]({'plain':!![]});_0x21def4[_0x475d('0xa5')]['created']=![];if(_0x3d7f06){if(_0x21def4[_0x475d('0x7f')][_0x475d('0xa6')]){_0x21def4[_0x475d('0x84')][_0x475d('0xa7')]({'id':0x0,'priority':_0x21def4[_0x475d('0x84')][_0x475d('0x49')]+0x1,'app':_0x475d('0xa8'),'appdata':'unmanaged','interval':_0x475d('0xa9')});}_0x21def4[_0x475d('0xa5')][_0x475d('0xaa')]=!![];}return db[_0x475d('0xab')][_0x475d('0x5c')]({'phone':_0x21def4[_0x475d('0x5d')][_0x475d('0x8f')],'messageId':_0x21def4[_0x475d('0x5d')][_0x475d('0xac')],'body':_0x21def4[_0x475d('0x5d')][_0x475d('0x5d')],'WhatsappAccountId':_0x3a4cb7[_0x475d('0x58')]['id'],'WhatsappInteractionId':_0x4a85a1['id'],'direction':'in','ContactId':_0x4a85a1[_0x475d('0xad')],'AttachmentId':_0x21def4['body'][_0x475d('0xae')]});})['then'](function(_0x5aacdb){_0x21def4[_0x475d('0x26')]=_0x5aacdb;if(!_0x21def4[_0x475d('0xa5')][_0x475d('0xaf')])return;return db[_0x475d('0xb0')][_0x475d('0x5b')]({'attributes':['id',_0x475d('0x39')],'where':{'id':_0x21def4[_0x475d('0xa5')][_0x475d('0xaf')]}});})[_0x475d('0x35')](function(_0x3060b6){if(_0x3060b6){_0x21def4[_0x475d('0x84')][_0x475d('0xb1')]({'id':0x0,'priority':0x0,'app':_0x475d('0xb2'),'appdata':_0x3060b6[_0x475d('0x39')]+','+(_0x21def4[_0x475d('0x7f')][_0x475d('0xb3')]||0xa),'interval':'*,*,*,*'});}if(!_0x21def4['interaction'][_0x475d('0xb4')])return;return db['WhatsappQueue']['find']({'attributes':['id',_0x475d('0x39')],'where':{'id':_0x21def4[_0x475d('0xa5')]['queueId']}});})['then'](function(_0x1d8b14){if(_0x1d8b14){_0x21def4[_0x475d('0x84')][_0x475d('0xb1')]({'id':0x0,'priority':0x1,'app':_0x475d('0xb5'),'appdata':_0x1d8b14[_0x475d('0x39')]+','+(_0x21def4[_0x475d('0x7f')][_0x475d('0xb6')]||0x12c),'interval':_0x475d('0xa9')});}return respondWithRpcPromise(_0x475d('0xb7'),_0x475d('0xb8'),_0x21def4);})[_0x475d('0x35')](function(_0x101ecf){if(_0x101ecf){var _0x411c02=0xc8;var _0x5708d8=_0x475d('0xb9');logger['info'](_0x475d('0xba'),_0x5708d8,_0x411c02,_0x475d('0xbb'));logger[_0x475d('0x20')](_0x475d('0xbc'),_0x5708d8,_0x411c02,_0x475d('0xbb'),JSON['stringify'](_0x101ecf));if(_0x21def4[_0x475d('0x7f')][_0x475d('0x41')]===_0x475d('0xbd')){return _0x458c48[_0x475d('0x29')](_0x411c02)[_0x475d('0x2f')](_0x475d('0xbe'),_0x475d('0xbf'))[_0x475d('0x3a')](_0x475d('0xc0'));}else{return _0x458c48[_0x475d('0x29')](_0x411c02)[_0x475d('0x31')](_0x101ecf);}}});})[_0x475d('0x27')](handleError(_0x458c48,null));};exports[_0x475d('0x3a')]=function(_0x357a83,_0x354bf1,_0x1ef793){var _0x236026,_0x495306,_0x1740ee;if(_['isNil'](_0x357a83[_0x475d('0x5d')][_0x475d('0x5d')])||_0x357a83[_0x475d('0x5d')][_0x475d('0x5d')]===''){throw new db[(_0x475d('0x86'))][(_0x475d('0x87'))](_0x475d('0x99'));}if(_[_0x475d('0x97')](_0x357a83[_0x475d('0x5d')]['to'])){throw new db['Sequelize'][(_0x475d('0x87'))]('to\x20is\x20mandatory');}_0x236026=_0x357a83[_0x475d('0x5d')]['to'];return db[_0x475d('0x3e')][_0x475d('0x5b')]({'where':{'id':_0x357a83[_0x475d('0x58')]['id']},'include':[{'model':db[_0x475d('0x9d')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x236026},'limit':0x1,'order':[[_0x475d('0x8b'),_0x475d('0x9f')]]}]}]})[_0x475d('0x35')](handleEntityNotFound(_0x354bf1,null))[_0x475d('0x35')](function(_0x44a99d){if(_0x44a99d&&_0x44a99d['List']){_0x495306=_0x44a99d[_0x475d('0x37')]({'plain':!![]});if(_0x495306[_0x475d('0xc1')]&&_0x495306[_0x475d('0xc1')][_0x475d('0x9e')][_0x475d('0x49')]){return _0x495306[_0x475d('0xc1')][_0x475d('0x9e')][0x0];}return db[_0x475d('0x85')][_0x475d('0x5c')](_[_0x475d('0x1b')](_0x357a83[_0x475d('0x5d')],{'firstName':_0x236026,'mobile':_0x236026,'phone':_0x236026,'ListId':_0x495306['ListId']}));}})[_0x475d('0x35')](handleEntityNotFound(_0x354bf1,null))[_0x475d('0x35')](function(_0x16e2ba){if(_0x16e2ba){_0x1740ee=_0x16e2ba;return db[_0x475d('0xa3')][_0x475d('0x5b')]({'where':{'ContactId':_0x1740ee['id'],'closed':![],'WhatsappAccountId':_0x495306['id']}})[_0x475d('0x35')](function(_0x1b8f50){if(_0x1b8f50){return[_0x1b8f50,![]];}return db['WhatsappInteraction'][_0x475d('0x5c')]({'UserId':_0x357a83['user']['id'],'ContactId':_0x1740ee['id'],'WhatsappAccountId':_0x495306['id'],'phone':_0x236026,'firstMsgDirection':_0x475d('0xc2'),'Messages':[_[_0x475d('0x51')](_0x357a83[_0x475d('0x5d')],{'read':![],'body':_0x357a83[_0x475d('0x5d')][_0x475d('0x5d')],'phone':_0x236026,'WhatsappAccountId':_0x495306['id'],'UserId':_0x357a83['user']['id'],'ContactId':_0x1740ee['id']})]},{'include':[{'model':db[_0x475d('0xab')],'as':'Messages'}]})[_0x475d('0x35')](function(_0x3f2fc3){return[_0x3f2fc3,!![]];});});}})[_0x475d('0xa4')](function(_0x677197,_0x4ff13e){if(_0x4ff13e){return _0x677197;}return db['WhatsappMessage'][_0x475d('0x5c')](_[_0x475d('0x51')](_0x357a83[_0x475d('0x5d')],{'read':![],'body':_0x357a83['body'][_0x475d('0x5d')],'phone':_0x236026,'WhatsappAccountId':_0x495306['id'],'WhatsappInteractionId':_0x677197['id'],'UserId':_0x357a83[_0x475d('0x5f')]['id'],'ContactId':_0x1740ee['id']}))[_0x475d('0x35')](function(_0x3d87cd){_0x677197[_0x475d('0xc3')][_0x475d('0xc4')]=[];_0x677197[_0x475d('0xc3')][_0x475d('0xc4')][_0x475d('0xa7')](_0x3d87cd[_0x475d('0xc3')]);return _0x677197;});})[_0x475d('0x35')](respondWithResult(_0x354bf1,null))[_0x475d('0x27')](handleError(_0x354bf1,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 48d66b0..4a776ff 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 _0x0f2d=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x0f2d,0x17d));var _0xd0f2=function(_0x398b23,_0xe3dd9){_0x398b23=_0x398b23-0x0;var _0x319672=_0x0f2d[_0x398b23];return _0x319672;};'use strict';var EventEmitter=require(_0xd0f2('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd0f2('0x1')](0x0);var events={'afterCreate':_0xd0f2('0x2'),'afterUpdate':_0xd0f2('0x3'),'afterDestroy':_0xd0f2('0x4')};function emitEvent(_0x29d0a2){return function(_0x4847e7,_0x399e74,_0x5332d5){WhatsappAccountEvents[_0xd0f2('0x5')](_0x29d0a2+':'+_0x4847e7['id'],_0x4847e7);WhatsappAccountEvents['emit'](_0x29d0a2,_0x4847e7);_0x5332d5(null);};}for(var e in events){if(events[_0xd0f2('0x6')](e)){var event=events[e];WhatsappAccount[_0xd0f2('0x7')](e,emitEvent(event));}}module[_0xd0f2('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x6264=['remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6264,0x11e));var _0x4626=function(_0x3067fe,_0x1eb454){_0x3067fe=_0x3067fe-0x0;var _0x14c031=_0x6264[_0x3067fe];return _0x14c031;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x4626('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4626('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4626('0x2')};function emitEvent(_0x4a34f6){return function(_0x23c8cc,_0x351faa,_0x39fd39){WhatsappAccountEvents[_0x4626('0x3')](_0x4a34f6+':'+_0x23c8cc['id'],_0x23c8cc);WhatsappAccountEvents[_0x4626('0x3')](_0x4a34f6,_0x23c8cc);_0x39fd39(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x4626('0x4')](e,emitEvent(event));}}module[_0x4626('0x5')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 663e767..af694a1 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 _0xb283=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','request-promise','path'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xb283,0xd2));var _0x3b28=function(_0xf90bad,_0x2b272a){_0xf90bad=_0xf90bad-0x0;var _0x2deef0=_0xb283[_0xf90bad];return _0x2deef0;};'use strict';var _=require(_0x3b28('0x0'));var util=require(_0x3b28('0x1'));var logger=require('../../config/logger')(_0x3b28('0x2'));var moment=require(_0x3b28('0x3'));var BPromise=require('bluebird');var rp=require(_0x3b28('0x4'));var fs=require('fs');var path=require(_0x3b28('0x5'));var rimraf=require('rimraf');var config=require(_0x3b28('0x6'));var attributes=require(_0x3b28('0x7'));module[_0x3b28('0x8')]=function(_0x26f1c8,_0x2b1543){return _0x26f1c8[_0x3b28('0x9')](_0x3b28('0xa'),attributes,{'tableName':_0x3b28('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd734=['WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x1437c2,_0x571f30){var _0x41b1ad=function(_0x4dc2ea){while(--_0x4dc2ea){_0x1437c2['push'](_0x1437c2['shift']());}};_0x41b1ad(++_0x571f30);}(_0xd734,0xd2));var _0x4d73=function(_0x322b84,_0x576604){_0x322b84=_0x322b84-0x0;var _0x2398b2=_0xd734[_0x322b84];return _0x2398b2;};'use strict';var _=require(_0x4d73('0x0'));var util=require(_0x4d73('0x1'));var logger=require(_0x4d73('0x2'))(_0x4d73('0x3'));var moment=require(_0x4d73('0x4'));var BPromise=require(_0x4d73('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d73('0x6'));var config=require(_0x4d73('0x7'));var attributes=require(_0x4d73('0x8'));module[_0x4d73('0x9')]=function(_0x22745e,_0x5a59ce){return _0x22745e[_0x4d73('0xa')](_0x4d73('0xb'),attributes,{'tableName':_0x4d73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 12c19cc..ea0e86f 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 _0x9209=['result','ShowWhatsappAccount','find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x9209,0x1ba));var _0x9920=function(_0xfcb2,_0x5ef656){_0xfcb2=_0xfcb2-0x0;var _0x436b21=_0x9209[_0xfcb2];return _0x436b21;};'use strict';var _=require(_0x9920('0x0'));var util=require(_0x9920('0x1'));var moment=require(_0x9920('0x2'));var BPromise=require(_0x9920('0x3'));var rs=require(_0x9920('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9920('0x5'));var logger=require(_0x9920('0x6'))(_0x9920('0x7'));var config=require(_0x9920('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9920('0x9')][_0x9920('0xa')]({'port':0x232a});config[_0x9920('0xb')]=_[_0x9920('0xc')](config[_0x9920('0xb')],{'host':_0x9920('0xd'),'port':0x18eb});var socket=require(_0x9920('0xe'))(new Redis(config[_0x9920('0xb')]));require(_0x9920('0xf'))[_0x9920('0x10')](socket);function respondWithRpcPromise(_0x5dc7af,_0x27463b,_0x1b1528){return new BPromise(function(_0x1f7a17,_0x19babc){return client[_0x9920('0x11')](_0x5dc7af,_0x1b1528)[_0x9920('0x12')](function(_0x569e1c){logger[_0x9920('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x27463b,'request\x20sent');logger[_0x9920('0x14')](_0x9920('0x15'),_0x27463b,'request\x20sent',JSON['stringify'](_0x569e1c));if(_0x569e1c[_0x9920('0x16')]){if(_0x569e1c[_0x9920('0x16')]['code']===0x1f4){logger[_0x9920('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x27463b,_0x569e1c['error'][_0x9920('0x17')]);return _0x19babc(_0x569e1c[_0x9920('0x16')][_0x9920('0x17')]);}logger[_0x9920('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x27463b,_0x569e1c[_0x9920('0x16')][_0x9920('0x17')]);return _0x1f7a17(_0x569e1c['error'][_0x9920('0x17')]);}else{logger[_0x9920('0x13')](_0x9920('0x18'),_0x27463b,_0x9920('0x19'));_0x1f7a17(_0x569e1c[_0x9920('0x1a')]['message']);}})['catch'](function(_0x2236f9){logger['error'](_0x9920('0x18'),_0x27463b,_0x2236f9);_0x19babc(_0x2236f9);});});}exports[_0x9920('0x1b')]=function(_0x54e7ed){var _0x58762d=this;return new Promise(function(_0x4183b9,_0x2e2e50){return db['WhatsappAccount'][_0x9920('0x1c')]({'raw':_0x54e7ed[_0x9920('0x1d')]?_0x54e7ed[_0x9920('0x1d')][_0x9920('0x1e')]===undefined?!![]:![]:!![],'where':_0x54e7ed[_0x9920('0x1d')]?_0x54e7ed[_0x9920('0x1d')][_0x9920('0x1f')]||null:null,'attributes':_0x54e7ed[_0x9920('0x1d')]?_0x54e7ed[_0x9920('0x1d')]['attributes']||null:null,'include':_0x54e7ed['options']?_0x54e7ed[_0x9920('0x1d')][_0x9920('0x20')]?_[_0x9920('0x21')](_0x54e7ed[_0x9920('0x1d')]['include'],function(_0x47b0eb){return{'model':db[_0x47b0eb[_0x9920('0x22')]],'as':_0x47b0eb['as'],'attributes':_0x47b0eb[_0x9920('0x23')],'include':_0x47b0eb[_0x9920('0x20')]?_[_0x9920('0x21')](_0x47b0eb[_0x9920('0x20')],function(_0x8d6c5d){return{'model':db[_0x8d6c5d['model']],'as':_0x8d6c5d['as'],'attributes':_0x8d6c5d[_0x9920('0x23')],'include':_0x8d6c5d['include']?_[_0x9920('0x21')](_0x8d6c5d[_0x9920('0x20')],function(_0x442cac){return{'model':db[_0x442cac['model']],'as':_0x442cac['as'],'attributes':_0x442cac[_0x9920('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x259327){logger[_0x9920('0x13')]('ShowWhatsappAccount',_0x54e7ed);logger[_0x9920('0x14')](_0x9920('0x1b'),_0x54e7ed,JSON['stringify'](_0x259327));_0x4183b9(_0x259327);})['catch'](function(_0x702609){logger[_0x9920('0x16')](_0x9920('0x1b'),_0x702609['message'],_0x54e7ed);_0x2e2e50(_0x58762d['error'](0x1f4,_0x702609['message']));});});}; \ No newline at end of file +var _0x26bd=['stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0xcdb5c1,_0xea6ccf){var _0x1e80de=function(_0x437cba){while(--_0x437cba){_0xcdb5c1['push'](_0xcdb5c1['shift']());}};_0x1e80de(++_0xea6ccf);}(_0x26bd,0xaa));var _0xd26b=function(_0x45dd01,_0x1afc0a){_0x45dd01=_0x45dd01-0x0;var _0x25037e=_0x26bd[_0x45dd01];return _0x25037e;};'use strict';var _=require(_0xd26b('0x0'));var util=require(_0xd26b('0x1'));var moment=require(_0xd26b('0x2'));var BPromise=require(_0xd26b('0x3'));var rs=require(_0xd26b('0x4'));var fs=require('fs');var Redis=require(_0xd26b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd26b('0x6'));var logger=require(_0xd26b('0x7'))(_0xd26b('0x8'));var config=require(_0xd26b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd26b('0xa')][_0xd26b('0xb')]({'port':0x232a});config[_0xd26b('0xc')]=_[_0xd26b('0xd')](config['redis'],{'host':_0xd26b('0xe'),'port':0x18eb});var socket=require(_0xd26b('0xf'))(new Redis(config[_0xd26b('0xc')]));require(_0xd26b('0x10'))[_0xd26b('0x11')](socket);function respondWithRpcPromise(_0x1cbf48,_0x5c590d,_0x2cbde7){return new BPromise(function(_0x5b40c6,_0x40ce1c){return client[_0xd26b('0x12')](_0x1cbf48,_0x2cbde7)[_0xd26b('0x13')](function(_0x385735){logger[_0xd26b('0x14')](_0xd26b('0x15'),_0x5c590d,_0xd26b('0x16'));logger[_0xd26b('0x17')](_0xd26b('0x18'),_0x5c590d,'request\x20sent',JSON[_0xd26b('0x19')](_0x385735));if(_0x385735[_0xd26b('0x1a')]){if(_0x385735['error']['code']===0x1f4){logger[_0xd26b('0x1a')](_0xd26b('0x15'),_0x5c590d,_0x385735[_0xd26b('0x1a')][_0xd26b('0x1b')]);return _0x40ce1c(_0x385735[_0xd26b('0x1a')]['message']);}logger[_0xd26b('0x1a')]('WhatsappAccount,\x20%s,\x20%s',_0x5c590d,_0x385735[_0xd26b('0x1a')][_0xd26b('0x1b')]);return _0x5b40c6(_0x385735[_0xd26b('0x1a')][_0xd26b('0x1b')]);}else{logger['info'](_0xd26b('0x15'),_0x5c590d,_0xd26b('0x16'));_0x5b40c6(_0x385735[_0xd26b('0x1c')][_0xd26b('0x1b')]);}})[_0xd26b('0x1d')](function(_0x24da5d){logger['error'](_0xd26b('0x15'),_0x5c590d,_0x24da5d);_0x40ce1c(_0x24da5d);});});}exports[_0xd26b('0x1e')]=function(_0x1c5eb5){var _0x3a7bfc=this;return new Promise(function(_0x343623,_0x2443b9){return db[_0xd26b('0x1f')][_0xd26b('0x20')]({'raw':_0x1c5eb5['options']?_0x1c5eb5[_0xd26b('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x1c5eb5[_0xd26b('0x21')]?_0x1c5eb5[_0xd26b('0x21')][_0xd26b('0x22')]||null:null,'attributes':_0x1c5eb5[_0xd26b('0x21')]?_0x1c5eb5[_0xd26b('0x21')]['attributes']||null:null,'include':_0x1c5eb5['options']?_0x1c5eb5[_0xd26b('0x21')][_0xd26b('0x23')]?_[_0xd26b('0x24')](_0x1c5eb5[_0xd26b('0x21')][_0xd26b('0x23')],function(_0x23c933){return{'model':db[_0x23c933[_0xd26b('0x25')]],'as':_0x23c933['as'],'attributes':_0x23c933[_0xd26b('0x26')],'include':_0x23c933[_0xd26b('0x23')]?_[_0xd26b('0x24')](_0x23c933[_0xd26b('0x23')],function(_0x42a2c0){return{'model':db[_0x42a2c0[_0xd26b('0x25')]],'as':_0x42a2c0['as'],'attributes':_0x42a2c0['attributes'],'include':_0x42a2c0[_0xd26b('0x23')]?_[_0xd26b('0x24')](_0x42a2c0[_0xd26b('0x23')],function(_0x5611d6){return{'model':db[_0x5611d6[_0xd26b('0x25')]],'as':_0x5611d6['as'],'attributes':_0x5611d6[_0xd26b('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20530f){logger['info'](_0xd26b('0x1e'),_0x1c5eb5);logger[_0xd26b('0x17')](_0xd26b('0x1e'),_0x1c5eb5,JSON['stringify'](_0x20530f));_0x343623(_0x20530f);})[_0xd26b('0x1d')](function(_0x19e48c){logger[_0xd26b('0x1a')](_0xd26b('0x1e'),_0x19e48c[_0xd26b('0x1b')],_0x1c5eb5);_0x2443b9(_0x3a7bfc[_0xd26b('0x1a')](0x1f4,_0x19e48c[_0xd26b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 46ac585..d48e938 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 _0x65da=['./whatsappAccount.events','save','emit','removeListener','register','length'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x65da,0x132));var _0xa65d=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x65da[_0x32b542];return _0x554d54;};'use strict';var WhatsappAccountEvents=require(_0xa65d('0x0'));var events=[_0xa65d('0x1'),'remove','update'];function createListener(_0x369ee8,_0xe3701a){return function(_0x282e46){_0xe3701a[_0xa65d('0x2')](_0x369ee8,_0x282e46);};}function removeListener(_0x1abfc9,_0x39bf97){return function(){WhatsappAccountEvents[_0xa65d('0x3')](_0x1abfc9,_0x39bf97);};}exports[_0xa65d('0x4')]=function(_0x148e90){for(var _0x1c9a6f=0x0,_0x337e74=events[_0xa65d('0x5')];_0x1c9a6f<_0x337e74;_0x1c9a6f++){var _0x5d966b=events[_0x1c9a6f];var _0x5c5d83=createListener('whatsappAccount:'+_0x5d966b,_0x148e90);WhatsappAccountEvents['on'](_0x5d966b,_0x5c5d83);}}; \ No newline at end of file +var _0xb8e6=['update','length'];(function(_0x411ce6,_0x4b3d2a){var _0x345706=function(_0x35cade){while(--_0x35cade){_0x411ce6['push'](_0x411ce6['shift']());}};_0x345706(++_0x4b3d2a);}(_0xb8e6,0x1b6));var _0x6b8e=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0xb8e6[_0x44d9ab];return _0x31485e;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save','remove',_0x6b8e('0x0')];function createListener(_0x11cc90,_0x4ed7b3){return function(_0x3fd274){_0x4ed7b3['emit'](_0x11cc90,_0x3fd274);};}function removeListener(_0x3480fd,_0x4e1394){return function(){WhatsappAccountEvents['removeListener'](_0x3480fd,_0x4e1394);};}exports['register']=function(_0x4af7fe){for(var _0x55b747=0x0,_0x359fff=events[_0x6b8e('0x1')];_0x55b747<_0x359fff;_0x55b747++){var _0x906d5e=events[_0x55b747];var _0x139406=createListener('whatsappAccount:'+_0x906d5e,_0x4af7fe);WhatsappAccountEvents['on'](_0x906d5e,_0x139406);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 02f0641..04bd4e0 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 _0xff10=['index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x220155,_0x15d63d){var _0x1dd6d3=function(_0x2cacc3){while(--_0x2cacc3){_0x220155['push'](_0x220155['shift']());}};_0x1dd6d3(++_0x15d63d);}(_0xff10,0x172));var _0x0ff1=function(_0x3006bd,_0x4e2d81){_0x3006bd=_0x3006bd-0x0;var _0x30bd32=_0xff10[_0x3006bd];return _0x30bd32;};'use strict';var multer=require(_0x0ff1('0x0'));var util=require(_0x0ff1('0x1'));var path=require(_0x0ff1('0x2'));var timeout=require(_0x0ff1('0x3'));var express=require(_0x0ff1('0x4'));var router=express['Router']();var fs_extra=require(_0x0ff1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ff1('0x6'));var config=require('../../config/environment');var controller=require(_0x0ff1('0x7'));router[_0x0ff1('0x8')]('/',auth[_0x0ff1('0x9')](),controller[_0x0ff1('0xa')]);router[_0x0ff1('0x8')]('/:id',auth[_0x0ff1('0x9')](),controller[_0x0ff1('0xb')]);router[_0x0ff1('0xc')]('/',auth[_0x0ff1('0x9')](),controller['create']);router[_0x0ff1('0xd')](_0x0ff1('0xe'),auth[_0x0ff1('0x9')](),controller[_0x0ff1('0xf')]);router[_0x0ff1('0x10')](_0x0ff1('0xe'),auth[_0x0ff1('0x9')](),controller[_0x0ff1('0x11')]);module[_0x0ff1('0x12')]=router; \ No newline at end of file +var _0x75d5=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x237c45,_0x55cf99){var _0x2942f6=function(_0x45a615){while(--_0x45a615){_0x237c45['push'](_0x237c45['shift']());}};_0x2942f6(++_0x55cf99);}(_0x75d5,0x149));var _0x575d=function(_0x498e1b,_0x27e8bb){_0x498e1b=_0x498e1b-0x0;var _0x2c1d62=_0x75d5[_0x498e1b];return _0x2c1d62;};'use strict';var multer=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var path=require('path');var timeout=require(_0x575d('0x2'));var express=require(_0x575d('0x3'));var router=express[_0x575d('0x4')]();var fs_extra=require(_0x575d('0x5'));var auth=require(_0x575d('0x6'));var interaction=require(_0x575d('0x7'));var config=require(_0x575d('0x8'));var controller=require(_0x575d('0x9'));router[_0x575d('0xa')]('/',auth['isAuthenticated'](),controller[_0x575d('0xb')]);router[_0x575d('0xa')](_0x575d('0xc'),auth[_0x575d('0xd')](),controller[_0x575d('0xe')]);router[_0x575d('0xf')]('/',auth[_0x575d('0xd')](),controller[_0x575d('0x10')]);router[_0x575d('0x11')](_0x575d('0xc'),auth[_0x575d('0xd')](),controller[_0x575d('0x12')]);router[_0x575d('0x13')](_0x575d('0xc'),auth['isAuthenticated'](),controller[_0x575d('0x14')]);module[_0x575d('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 3024cd6..f6cde49 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 _0x696b=['*,*,*,*','exports','STRING','noop','TEXT'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x696b,0x1c3));var _0xb696=function(_0x21f37e,_0x491cc0){_0x21f37e=_0x21f37e-0x0;var _0x4ff423=_0x696b[_0x21f37e];return _0x4ff423;};'use strict';var Sequelize=require('sequelize');module[_0xb696('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb696('0x1')],'allowNull':![],'defaultValue':_0xb696('0x2')},'appdata':{'type':Sequelize[_0xb696('0x3')]()},'description':{'type':Sequelize[_0xb696('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb696('0x4')}}; \ No newline at end of file +var _0x03db=['noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x19e759,_0x4ef25d){var _0x356807=function(_0x39184f){while(--_0x39184f){_0x19e759['push'](_0x19e759['shift']());}};_0x356807(++_0x4ef25d);}(_0x03db,0x116));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb03d('0x0'));module[_0xb03d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb03d('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb03d('0x3')]},'interval':{'type':Sequelize[_0xb03d('0x3')],'defaultValue':_0xb03d('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 96286df..256585e 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 _0x8277=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','key','keys','query','filters','model','attributes','intersection','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','find','create','body','params','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2beb8c,_0x64ddb0){var _0x10b7e3=function(_0x5dfe54){while(--_0x5dfe54){_0x2beb8c['push'](_0x2beb8c['shift']());}};_0x10b7e3(++_0x64ddb0);}(_0x8277,0xcf));var _0x7827=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x8277[_0x31b5a5];return _0x364cc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7827('0x0'));var zipdir=require(_0x7827('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7827('0x2'));var moment=require(_0x7827('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7827('0x4'));var util=require(_0x7827('0x5'));var path=require('path');var sox=require(_0x7827('0x6'));var csv=require(_0x7827('0x7'));var ejs=require(_0x7827('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7827('0x9'));var squel=require(_0x7827('0xa'));var crypto=require(_0x7827('0xb'));var jsforce=require(_0x7827('0xc'));var deskjs=require(_0x7827('0xd'));var toCsv=require(_0x7827('0x7'));var querystring=require(_0x7827('0xe'));var Papa=require(_0x7827('0xf'));var Redis=require(_0x7827('0x10'));var authService=require(_0x7827('0x11'));var qs=require(_0x7827('0x12'));var as=require(_0x7827('0x13'));var hardwareService=require(_0x7827('0x14'));var logger=require(_0x7827('0x15'))('api');var utils=require(_0x7827('0x16'));var config=require(_0x7827('0x17'));var licenseUtil=require(_0x7827('0x18'));var db=require(_0x7827('0x19'))['db'];function respondWithStatusCode(_0x5e3061,_0x3a5a48){_0x3a5a48=_0x3a5a48||0xcc;return function(_0xb8c1a9){if(_0xb8c1a9){return _0x5e3061[_0x7827('0x1a')](_0x3a5a48);}return _0x5e3061[_0x7827('0x1b')](_0x3a5a48)[_0x7827('0x1c')]();};}function respondWithResult(_0x41dcb9,_0x35c668){_0x35c668=_0x35c668||0xc8;return function(_0x453f04){if(_0x453f04){return _0x41dcb9[_0x7827('0x1b')](_0x35c668)[_0x7827('0x1d')](_0x453f04);}};}function respondWithFilteredResult(_0x2eae42,_0x33bded){return function(_0x2fe484){if(_0x2fe484){var _0x85c389=typeof _0x33bded[_0x7827('0x1e')]==='undefined'&&typeof _0x33bded[_0x7827('0x1f')]===_0x7827('0x20');var _0x19be26=_0x2fe484[_0x7827('0x21')];var _0x34a6b2=_0x85c389?0x0:_0x33bded[_0x7827('0x1e')];var _0x18ca8f=_0x85c389?_0x2fe484[_0x7827('0x21')]:_0x33bded['offset']+_0x33bded[_0x7827('0x1f')];var _0x13f66f;if(_0x18ca8f>=_0x19be26){_0x18ca8f=_0x19be26;_0x13f66f=0xc8;}else{_0x13f66f=0xce;}_0x2eae42[_0x7827('0x1b')](_0x13f66f);return _0x2eae42[_0x7827('0x22')](_0x7827('0x23'),_0x34a6b2+'-'+_0x18ca8f+'/'+_0x19be26)[_0x7827('0x1d')](_0x2fe484);}return null;};}function patchUpdates(_0x216bf6){return function(_0x523edf){try{jsonpatch[_0x7827('0x24')](_0x523edf,_0x216bf6,!![]);}catch(_0x4a1dd1){return BPromise[_0x7827('0x25')](_0x4a1dd1);}return _0x523edf[_0x7827('0x26')]();};}function saveUpdates(_0x4697aa,_0x3465de){return function(_0x589d37){if(_0x589d37){return _0x589d37[_0x7827('0x27')](_0x4697aa)[_0x7827('0x28')](function(_0x14070d){return _0x14070d;});}return null;};}function removeEntity(_0x5ecc81,_0x18dbc3){return function(_0x55a4d4){if(_0x55a4d4){return _0x55a4d4[_0x7827('0x29')]()['then'](function(){_0x5ecc81[_0x7827('0x1b')](0xcc)[_0x7827('0x1c')]();});}};}function handleEntityNotFound(_0x2745e4,_0x3271c9){return function(_0x4d1c18){if(!_0x4d1c18){_0x2745e4[_0x7827('0x1a')](0x194);}return _0x4d1c18;};}function handleError(_0x4b2a0d,_0x3ec12e){_0x3ec12e=_0x3ec12e||0x1f4;return function(_0x2e12d6){logger[_0x7827('0x2a')](_0x2e12d6[_0x7827('0x2b')]);if(_0x2e12d6[_0x7827('0x2c')]){delete _0x2e12d6[_0x7827('0x2c')];}_0x4b2a0d[_0x7827('0x1b')](_0x3ec12e)[_0x7827('0x2d')](_0x2e12d6);};}exports[_0x7827('0x2e')]=function(_0x4b25ba,_0x21b502){var _0x301b31={},_0x25415b={},_0x25bcbe={'count':0x0,'rows':[]};var _0x52c029=_[_0x7827('0x2f')](db[_0x7827('0x30')][_0x7827('0x31')],function(_0x26a004){return{'name':_0x26a004['fieldName'],'type':_0x26a004['type'][_0x7827('0x32')]};});_0x25415b['model']=_[_0x7827('0x2f')](_0x52c029,_0x7827('0x2c'));_0x25415b['query']=_[_0x7827('0x33')](_0x4b25ba[_0x7827('0x34')]);_0x25415b[_0x7827('0x35')]=_['intersection'](_0x25415b[_0x7827('0x36')],_0x25415b['query']);_0x301b31[_0x7827('0x37')]=_[_0x7827('0x38')](_0x25415b['model'],qs[_0x7827('0x39')](_0x4b25ba['query'][_0x7827('0x39')]));_0x301b31['attributes']=_0x301b31[_0x7827('0x37')][_0x7827('0x3a')]?_0x301b31[_0x7827('0x37')]:_0x25415b[_0x7827('0x36')];if(!_0x4b25ba[_0x7827('0x34')]['hasOwnProperty']('nolimit')){_0x301b31[_0x7827('0x1f')]=qs['limit'](_0x4b25ba[_0x7827('0x34')]['limit']);_0x301b31[_0x7827('0x1e')]=qs[_0x7827('0x1e')](_0x4b25ba['query'][_0x7827('0x1e')]);}_0x301b31[_0x7827('0x3b')]=qs[_0x7827('0x3c')](_0x4b25ba['query'][_0x7827('0x3c')]);_0x301b31[_0x7827('0x3d')]=qs[_0x7827('0x35')](_[_0x7827('0x3e')](_0x4b25ba[_0x7827('0x34')],_0x25415b['filters']),_0x52c029);if(_0x4b25ba[_0x7827('0x34')]['filter']){_0x301b31[_0x7827('0x3d')]=_[_0x7827('0x3f')](_0x301b31[_0x7827('0x3d')],{'$or':_['map'](_0x52c029,function(_0x30bb81){if(_0x30bb81[_0x7827('0x40')]!==_0x7827('0x41')){var _0x4624af={};_0x4624af[_0x30bb81['name']]={'$like':'%'+_0x4b25ba[_0x7827('0x34')][_0x7827('0x42')]+'%'};return _0x4624af;}})});}_0x301b31=_[_0x7827('0x3f')]({},_0x301b31,_0x4b25ba['options']);var _0x4bfaa0={'where':_0x301b31[_0x7827('0x3d')]};return db[_0x7827('0x30')]['count'](_0x4bfaa0)[_0x7827('0x28')](function(_0x5243a5){_0x25bcbe['count']=_0x5243a5;if(_0x4b25ba[_0x7827('0x34')][_0x7827('0x43')]){_0x301b31[_0x7827('0x44')]=[{'all':!![]}];}return db[_0x7827('0x30')]['findAll'](_0x301b31);})[_0x7827('0x28')](function(_0x453ec0){_0x25bcbe[_0x7827('0x45')]=_0x453ec0;return _0x25bcbe;})[_0x7827('0x28')](respondWithFilteredResult(_0x21b502,_0x301b31))[_0x7827('0x46')](handleError(_0x21b502,null));};exports[_0x7827('0x47')]=function(_0x2f8a8c,_0x37dd2b){var _0x58fbcf={'raw':!![],'where':{'id':_0x2f8a8c['params']['id']}},_0xe79716={};_0xe79716[_0x7827('0x36')]=_[_0x7827('0x33')](db[_0x7827('0x30')][_0x7827('0x31')]);_0xe79716[_0x7827('0x34')]=_[_0x7827('0x33')](_0x2f8a8c[_0x7827('0x34')]);_0xe79716[_0x7827('0x35')]=_[_0x7827('0x38')](_0xe79716[_0x7827('0x36')],_0xe79716[_0x7827('0x34')]);_0x58fbcf[_0x7827('0x37')]=_[_0x7827('0x38')](_0xe79716[_0x7827('0x36')],qs[_0x7827('0x39')](_0x2f8a8c[_0x7827('0x34')][_0x7827('0x39')]));_0x58fbcf[_0x7827('0x37')]=_0x58fbcf[_0x7827('0x37')]['length']?_0x58fbcf['attributes']:_0xe79716[_0x7827('0x36')];if(_0x2f8a8c['query'][_0x7827('0x43')]){_0x58fbcf[_0x7827('0x44')]=[{'all':!![]}];}_0x58fbcf=_[_0x7827('0x3f')]({},_0x58fbcf,_0x2f8a8c['options']);return db[_0x7827('0x30')][_0x7827('0x48')](_0x58fbcf)[_0x7827('0x28')](handleEntityNotFound(_0x37dd2b,null))[_0x7827('0x28')](respondWithResult(_0x37dd2b,null))[_0x7827('0x46')](handleError(_0x37dd2b,null));};exports[_0x7827('0x49')]=function(_0x180d4b,_0x2340d6){return db[_0x7827('0x30')]['create'](_0x180d4b[_0x7827('0x4a')],{})[_0x7827('0x28')](respondWithResult(_0x2340d6,0xc9))[_0x7827('0x46')](handleError(_0x2340d6,null));};exports[_0x7827('0x27')]=function(_0x2ee0d8,_0x458aa4){if(_0x2ee0d8[_0x7827('0x4a')]['id']){delete _0x2ee0d8['body']['id'];}return db[_0x7827('0x30')][_0x7827('0x48')]({'where':{'id':_0x2ee0d8[_0x7827('0x4b')]['id']}})[_0x7827('0x28')](handleEntityNotFound(_0x458aa4,null))[_0x7827('0x28')](saveUpdates(_0x2ee0d8[_0x7827('0x4a')],null))[_0x7827('0x28')](respondWithResult(_0x458aa4,null))['catch'](handleError(_0x458aa4,null));};exports['destroy']=function(_0x59b38d,_0x224a9a){return db[_0x7827('0x30')]['find']({'where':{'id':_0x59b38d[_0x7827('0x4b')]['id']}})['then'](handleEntityNotFound(_0x224a9a,null))['then'](removeEntity(_0x224a9a,null))[_0x7827('0x46')](handleError(_0x224a9a,null));}; \ No newline at end of file +var _0xfb67=['catch','show','rawAttributes','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','WhatsappApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows'];(function(_0xa3b332,_0x5e3799){var _0xf10aad=function(_0x10a184){while(--_0x10a184){_0xa3b332['push'](_0xa3b332['shift']());}};_0xf10aad(++_0x5e3799);}(_0xfb67,0xdd));var _0x7fb6=function(_0x2ad6e1,_0x30fbe0){_0x2ad6e1=_0x2ad6e1-0x0;var _0x2629b5=_0xfb67[_0x2ad6e1];return _0x2629b5;};'use strict';var emlformat=require(_0x7fb6('0x0'));var rimraf=require(_0x7fb6('0x1'));var zipdir=require(_0x7fb6('0x2'));var jsonpatch=require(_0x7fb6('0x3'));var rp=require(_0x7fb6('0x4'));var moment=require(_0x7fb6('0x5'));var BPromise=require(_0x7fb6('0x6'));var Mustache=require('mustache');var util=require(_0x7fb6('0x7'));var path=require(_0x7fb6('0x8'));var sox=require(_0x7fb6('0x9'));var csv=require(_0x7fb6('0xa'));var ejs=require(_0x7fb6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fb6('0xc'));var squel=require(_0x7fb6('0xd'));var crypto=require(_0x7fb6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fb6('0xf'));var toCsv=require(_0x7fb6('0xa'));var querystring=require('querystring');var Papa=require(_0x7fb6('0x10'));var Redis=require(_0x7fb6('0x11'));var authService=require(_0x7fb6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb6('0x14'))(_0x7fb6('0x15'));var utils=require(_0x7fb6('0x16'));var config=require(_0x7fb6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb6('0x18'))['db'];function respondWithStatusCode(_0x1b6ac7,_0x3c594f){_0x3c594f=_0x3c594f||0xcc;return function(_0x549370){if(_0x549370){return _0x1b6ac7['sendStatus'](_0x3c594f);}return _0x1b6ac7['status'](_0x3c594f)['end']();};}function respondWithResult(_0x4fe18e,_0x59287e){_0x59287e=_0x59287e||0xc8;return function(_0x2e8b7c){if(_0x2e8b7c){return _0x4fe18e[_0x7fb6('0x19')](_0x59287e)['json'](_0x2e8b7c);}};}function respondWithFilteredResult(_0x196700,_0x3e4441){return function(_0x5046e2){if(_0x5046e2){var _0xb4c375=typeof _0x3e4441[_0x7fb6('0x1a')]===_0x7fb6('0x1b')&&typeof _0x3e4441[_0x7fb6('0x1c')]===_0x7fb6('0x1b');var _0x26c3ec=_0x5046e2[_0x7fb6('0x1d')];var _0x3ef701=_0xb4c375?0x0:_0x3e4441[_0x7fb6('0x1a')];var _0x5de506=_0xb4c375?_0x5046e2[_0x7fb6('0x1d')]:_0x3e4441[_0x7fb6('0x1a')]+_0x3e4441[_0x7fb6('0x1c')];var _0x169389;if(_0x5de506>=_0x26c3ec){_0x5de506=_0x26c3ec;_0x169389=0xc8;}else{_0x169389=0xce;}_0x196700[_0x7fb6('0x19')](_0x169389);return _0x196700[_0x7fb6('0x1e')](_0x7fb6('0x1f'),_0x3ef701+'-'+_0x5de506+'/'+_0x26c3ec)['json'](_0x5046e2);}return null;};}function patchUpdates(_0x5e6997){return function(_0x1fa63a){try{jsonpatch[_0x7fb6('0x20')](_0x1fa63a,_0x5e6997,!![]);}catch(_0x293c9d){return BPromise[_0x7fb6('0x21')](_0x293c9d);}return _0x1fa63a['save']();};}function saveUpdates(_0xc44cf5,_0x13ad95){return function(_0x490749){if(_0x490749){return _0x490749[_0x7fb6('0x22')](_0xc44cf5)['then'](function(_0x488cd2){return _0x488cd2;});}return null;};}function removeEntity(_0x34a4d1,_0x4b15e5){return function(_0x51ed55){if(_0x51ed55){return _0x51ed55['destroy']()[_0x7fb6('0x23')](function(){_0x34a4d1['status'](0xcc)[_0x7fb6('0x24')]();});}};}function handleEntityNotFound(_0x4a9866,_0x3566a1){return function(_0xc60290){if(!_0xc60290){_0x4a9866[_0x7fb6('0x25')](0x194);}return _0xc60290;};}function handleError(_0x260e8b,_0x253f23){_0x253f23=_0x253f23||0x1f4;return function(_0x4c9b90){logger[_0x7fb6('0x26')](_0x4c9b90['stack']);if(_0x4c9b90[_0x7fb6('0x27')]){delete _0x4c9b90[_0x7fb6('0x27')];}_0x260e8b['status'](_0x253f23)['send'](_0x4c9b90);};}exports['index']=function(_0x25216a,_0x440a04){var _0x35e18f={},_0x3bf606={},_0x7f3844={'count':0x0,'rows':[]};var _0x2bc3b9=_['map'](db[_0x7fb6('0x28')]['rawAttributes'],function(_0x4221c3){return{'name':_0x4221c3[_0x7fb6('0x29')],'type':_0x4221c3[_0x7fb6('0x2a')][_0x7fb6('0x2b')]};});_0x3bf606[_0x7fb6('0x2c')]=_[_0x7fb6('0x2d')](_0x2bc3b9,_0x7fb6('0x27'));_0x3bf606[_0x7fb6('0x2e')]=_[_0x7fb6('0x2f')](_0x25216a['query']);_0x3bf606[_0x7fb6('0x30')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],_0x3bf606[_0x7fb6('0x2e')]);_0x35e18f[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x25216a[_0x7fb6('0x2e')]['fields']));_0x35e18f[_0x7fb6('0x32')]=_0x35e18f[_0x7fb6('0x32')][_0x7fb6('0x34')]?_0x35e18f[_0x7fb6('0x32')]:_0x3bf606['model'];if(!_0x25216a['query'][_0x7fb6('0x35')](_0x7fb6('0x36'))){_0x35e18f[_0x7fb6('0x1c')]=qs[_0x7fb6('0x1c')](_0x25216a[_0x7fb6('0x2e')]['limit']);_0x35e18f[_0x7fb6('0x1a')]=qs[_0x7fb6('0x1a')](_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x1a')]);}_0x35e18f['order']=qs[_0x7fb6('0x37')](_0x25216a[_0x7fb6('0x2e')]['sort']);_0x35e18f[_0x7fb6('0x38')]=qs['filters'](_[_0x7fb6('0x39')](_0x25216a['query'],_0x3bf606[_0x7fb6('0x30')]),_0x2bc3b9);if(_0x25216a['query'][_0x7fb6('0x3a')]){_0x35e18f[_0x7fb6('0x38')]=_[_0x7fb6('0x3b')](_0x35e18f[_0x7fb6('0x38')],{'$or':_[_0x7fb6('0x2d')](_0x2bc3b9,function(_0x39edfe){if(_0x39edfe['type']!=='VIRTUAL'){var _0x5d237={};_0x5d237[_0x39edfe[_0x7fb6('0x27')]]={'$like':'%'+_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3a')]+'%'};return _0x5d237;}})});}_0x35e18f=_['merge']({},_0x35e18f,_0x25216a['options']);var _0x213e6a={'where':_0x35e18f['where']};return db[_0x7fb6('0x28')][_0x7fb6('0x1d')](_0x213e6a)[_0x7fb6('0x23')](function(_0x33828c){_0x7f3844[_0x7fb6('0x1d')]=_0x33828c;if(_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3c')]){_0x35e18f[_0x7fb6('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x35e18f);})[_0x7fb6('0x23')](function(_0x543de3){_0x7f3844[_0x7fb6('0x3e')]=_0x543de3;return _0x7f3844;})[_0x7fb6('0x23')](respondWithFilteredResult(_0x440a04,_0x35e18f))[_0x7fb6('0x3f')](handleError(_0x440a04,null));};exports[_0x7fb6('0x40')]=function(_0x6fa286,_0x3b77ba){var _0x1dbfb8={'raw':!![],'where':{'id':_0x6fa286['params']['id']}},_0x661d04={};_0x661d04['model']=_[_0x7fb6('0x2f')](db['WhatsappApplication'][_0x7fb6('0x41')]);_0x661d04['query']=_[_0x7fb6('0x2f')](_0x6fa286[_0x7fb6('0x2e')]);_0x661d04['filters']=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],_0x661d04[_0x7fb6('0x2e')]);_0x1dbfb8[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x6fa286[_0x7fb6('0x2e')][_0x7fb6('0x33')]));_0x1dbfb8['attributes']=_0x1dbfb8[_0x7fb6('0x32')]['length']?_0x1dbfb8[_0x7fb6('0x32')]:_0x661d04[_0x7fb6('0x2c')];if(_0x6fa286['query'][_0x7fb6('0x3c')]){_0x1dbfb8[_0x7fb6('0x3d')]=[{'all':!![]}];}_0x1dbfb8=_[_0x7fb6('0x3b')]({},_0x1dbfb8,_0x6fa286['options']);return db[_0x7fb6('0x28')][_0x7fb6('0x42')](_0x1dbfb8)[_0x7fb6('0x23')](handleEntityNotFound(_0x3b77ba,null))[_0x7fb6('0x23')](respondWithResult(_0x3b77ba,null))[_0x7fb6('0x3f')](handleError(_0x3b77ba,null));};exports[_0x7fb6('0x43')]=function(_0x363564,_0x4eac42){return db[_0x7fb6('0x28')][_0x7fb6('0x43')](_0x363564['body'],{})[_0x7fb6('0x23')](respondWithResult(_0x4eac42,0xc9))['catch'](handleError(_0x4eac42,null));};exports[_0x7fb6('0x22')]=function(_0x597eac,_0x2fb8f0){if(_0x597eac['body']['id']){delete _0x597eac[_0x7fb6('0x44')]['id'];}return db[_0x7fb6('0x28')]['find']({'where':{'id':_0x597eac[_0x7fb6('0x45')]['id']}})[_0x7fb6('0x23')](handleEntityNotFound(_0x2fb8f0,null))[_0x7fb6('0x23')](saveUpdates(_0x597eac[_0x7fb6('0x44')],null))[_0x7fb6('0x23')](respondWithResult(_0x2fb8f0,null))[_0x7fb6('0x3f')](handleError(_0x2fb8f0,null));};exports[_0x7fb6('0x46')]=function(_0x164bfd,_0x14993f){return db[_0x7fb6('0x28')][_0x7fb6('0x42')]({'where':{'id':_0x164bfd[_0x7fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x14993f,null))['then'](removeEntity(_0x14993f,null))[_0x7fb6('0x3f')](handleError(_0x14993f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 8d78e5a..b00ad1f 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 _0x544a=['whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x544a,0xbd));var _0xa544=function(_0x3f8736,_0x546caf){_0x3f8736=_0x3f8736-0x0;var _0x2db96c=_0x544a[_0x3f8736];return _0x2db96c;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var logger=require(_0xa544('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa544('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa544('0x4'));var rimraf=require(_0xa544('0x5'));var config=require('../../config/environment');var attributes=require(_0xa544('0x6'));module[_0xa544('0x7')]=function(_0x2f5992,_0x15a604){return _0x2f5992[_0xa544('0x8')]('WhatsappApplication',attributes,{'tableName':_0xa544('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa544('0xa')});}; \ No newline at end of file +var _0x6c32=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var logger=require(_0x26c3('0x1'))('api');var moment=require(_0x26c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x26c3('0x3'));var fs=require('fs');var path=require(_0x26c3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26c3('0x5'));module[_0x26c3('0x6')]=function(_0x421941,_0x402393){return _0x421941[_0x26c3('0x7')](_0x26c3('0x8'),attributes,{'tableName':_0x26c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x26c3('0xa'),'collate':_0x26c3('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index c11912f..707a9b4 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 _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x203b16,_0x418af6){var _0x5c8785=function(_0x1642ee){while(--_0x1642ee){_0x203b16['push'](_0x203b16['shift']());}};_0x5c8785(++_0x418af6);}(_0x5fd1,0x155));var _0x15fd=function(_0xd483d2,_0x17e458){_0xd483d2=_0xd483d2-0x0;var _0x4bfd35=_0x5fd1[_0xd483d2];return _0x4bfd35;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x38da29,_0x50dc9a){var _0x4a32b1=function(_0x3c50c3){while(--_0x3c50c3){_0x38da29['push'](_0x38da29['shift']());}};_0x4a32b1(++_0x50dc9a);}(_0x5fd1,0x155));var _0x15fd=function(_0x107d3a,_0x3ca698){_0x107d3a=_0x107d3a-0x0;var _0x10b64e=_0x5fd1[_0x107d3a];return _0x10b64e;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ad271a7..d356e52 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 _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ddec1,_0x491520){var _0x4dbaac=function(_0x1de963){while(--_0x1de963){_0x5ddec1['push'](_0x5ddec1['shift']());}};_0x4dbaac(++_0x491520);}(_0x85d0,0x164));var _0x085d=function(_0x24e2d1,_0x2dd1ba){_0x24e2d1=_0x24e2d1-0x0;var _0x1751ca=_0x85d0[_0x24e2d1];return _0x1751ca;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x085d('0x0'));var router=express[_0x085d('0x1')]();var fs_extra=require(_0x085d('0x2'));var auth=require(_0x085d('0x3'));var interaction=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0x6')](_0x085d('0xa'),auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0x6')](_0x085d('0xd'),auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router['get'](_0x085d('0xf'),auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);router[_0x085d('0x11')]('/',auth['isAuthenticated'](),controller[_0x085d('0x12')]);router[_0x085d('0x11')]('/:id/messages',auth[_0x085d('0xb')](),controller[_0x085d('0x13')]);router[_0x085d('0x11')](_0x085d('0x14'),auth['isAuthenticated'](),interaction[_0x085d('0x15')](_0x085d('0x16'),'whatsappinteraction:addtags'),controller['addTags']);router[_0x085d('0x17')](_0x085d('0xa'),auth[_0x085d('0xb')](),interaction[_0x085d('0x15')](_0x085d('0x16'),'whatsappinteraction:update'),controller[_0x085d('0x18')]);router[_0x085d('0x19')](_0x085d('0xa'),auth[_0x085d('0xb')](),interaction[_0x085d('0x15')](_0x085d('0x16'),_0x085d('0x1a')),controller[_0x085d('0x1b')]);router[_0x085d('0x19')]('/:id/tags',auth[_0x085d('0xb')](),controller[_0x085d('0x1c')]);module[_0x085d('0x1d')]=router; \ No newline at end of file +var _0xaf1b=['tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags'];(function(_0x1aa71b,_0x39a178){var _0x50c2b7=function(_0x487c17){while(--_0x487c17){_0x1aa71b['push'](_0x1aa71b['shift']());}};_0x50c2b7(++_0x39a178);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x45e8c7,_0x460776){_0x45e8c7=_0x45e8c7-0x0;var _0x2a934f=_0xaf1b[_0x45e8c7];return _0x2a934f;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['get'](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x11')]);router['get'](_0xbaf1('0x12'),auth[_0xbaf1('0xc')](),controller['getMessages']);router[_0xbaf1('0xb')]('/:id/download',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x13')]);router[_0xbaf1('0x14')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x15')]);router[_0xbaf1('0x14')]('/:id/messages',auth['isAuthenticated'](),controller[_0xbaf1('0x16')]);router[_0xbaf1('0x14')](_0xbaf1('0x17'),auth[_0xbaf1('0xc')](),interaction[_0xbaf1('0x18')](_0xbaf1('0x19'),_0xbaf1('0x1a')),controller['addTags']);router[_0xbaf1('0x1b')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),interaction[_0xbaf1('0x18')](_0xbaf1('0x19'),_0xbaf1('0x1c')),controller[_0xbaf1('0x1d')]);router[_0xbaf1('0x1e')]('/:id',auth[_0xbaf1('0xc')](),interaction['tracked'](_0xbaf1('0x19'),_0xbaf1('0x1f')),controller[_0xbaf1('0x20')]);router[_0xbaf1('0x1e')]('/:id/tags',auth[_0xbaf1('0xc')](),controller['removeTags']);module[_0xbaf1('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 8c25398..16bdb24 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 _0x7a40=['BOOLEAN','INTEGER','sequelize','moment','exports','DATE','STRING','ENUM','out'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x7a40,0x197));var _0x07a4=function(_0x8b2415,_0xb75bd5){_0x8b2415=_0x8b2415-0x0;var _0xb3586e=_0x7a40[_0x8b2415];return _0xb3586e;};'use strict';var Sequelize=require(_0x07a4('0x0'));var moment=require(_0x07a4('0x1'));module[_0x07a4('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x07a4('0x3')]},'disposition':{'type':Sequelize[_0x07a4('0x4')]},'secondDisposition':{'type':Sequelize[_0x07a4('0x4')]},'thirdDisposition':{'type':Sequelize[_0x07a4('0x4')]},'note':{'type':Sequelize[_0x07a4('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x07a4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x07a4('0x5')]('in',_0x07a4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x07a4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x07a4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x07a4('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x07a4('0x8')]}}; \ No newline at end of file +var _0x6d11=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x1709fa,_0x41c9c7){var _0x3bd583=function(_0x276652){while(--_0x276652){_0x1709fa['push'](_0x1709fa['shift']());}};_0x3bd583(++_0x41c9c7);}(_0x6d11,0xbf));var _0x16d1=function(_0x2e7266,_0x4340ee){_0x2e7266=_0x2e7266-0x0;var _0x5d0cc7=_0x6d11[_0x2e7266];return _0x5d0cc7;};'use strict';var Sequelize=require(_0x16d1('0x0'));var moment=require(_0x16d1('0x1'));module[_0x16d1('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x16d1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x16d1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x16d1('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x16d1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x16d1('0x5')]('in',_0x16d1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x16d1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x16d1('0x5')]('in',_0x16d1('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x16d1('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 442624b..12ffe6a 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 _0xdf4d=['WhatsappMessage','ids','omit','getMessages','findOne','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filters','WhatsappInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','createWriteStream','out','System','Contact','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','type','getOptions','findAll','whatsapp','query','user','catch','show','keys','model','attributes','fields','includeAll','include','create','body','update','find','params','describe','addMessage'];(function(_0xc769be,_0xa21daa){var _0x40bcda=function(_0x17d54c){while(--_0x17d54c){_0xc769be['push'](_0xc769be['shift']());}};_0x40bcda(++_0xa21daa);}(_0xdf4d,0xcb));var _0xddf4=function(_0x3a0086,_0x1d1f2f){_0x3a0086=_0x3a0086-0x0;var _0x3c1cd8=_0xdf4d[_0x3a0086];return _0x3c1cd8;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xddf4('0x0'));var moment=require(_0xddf4('0x1'));var BPromise=require('bluebird');var util=require(_0xddf4('0x2'));var path=require(_0xddf4('0x3'));var ejs=require(_0xddf4('0x4'));var fs=require('fs');var _=require(_0xddf4('0x5'));var Redis=require(_0xddf4('0x6'));var interaction=require(_0xddf4('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xddf4('0x8'))(_0xddf4('0x9'));var config=require(_0xddf4('0xa'));var db=require(_0xddf4('0xb'))['db'];config[_0xddf4('0xc')]=_[_0xddf4('0xd')](config[_0xddf4('0xc')],{'host':_0xddf4('0xe'),'port':0x18eb});var socket=require(_0xddf4('0xf'))(new Redis(config[_0xddf4('0xc')]));require(_0xddf4('0x10'))['register'](socket);function respondWithStatusCode(_0x27e945,_0x4a698e){_0x4a698e=_0x4a698e||0xcc;return function(_0x44c33d){if(_0x44c33d){return _0x27e945[_0xddf4('0x11')](_0x4a698e);}return _0x27e945[_0xddf4('0x12')](_0x4a698e)[_0xddf4('0x13')]();};}function respondWithResult(_0x4b7f16,_0x2c7595){_0x2c7595=_0x2c7595||0xc8;return function(_0x32298b){if(_0x32298b){return _0x4b7f16[_0xddf4('0x12')](_0x2c7595)[_0xddf4('0x14')](_0x32298b);}};}function respondWithFilteredResult(_0x4c4c26,_0x4993fc){return function(_0xa9b80d){if(_0xa9b80d){var _0x4e83b2=typeof _0x4993fc[_0xddf4('0x15')]===_0xddf4('0x16')&&typeof _0x4993fc[_0xddf4('0x17')]===_0xddf4('0x16');var _0x3ef3a1=_0xa9b80d['count'];var _0x151b7b=_0x4e83b2?0x0:_0x4993fc['offset'];var _0x13c576=_0x4e83b2?_0xa9b80d[_0xddf4('0x18')]:_0x4993fc[_0xddf4('0x15')]+_0x4993fc[_0xddf4('0x17')];var _0x2e393d;if(_0x13c576>=_0x3ef3a1){_0x13c576=_0x3ef3a1;_0x2e393d=0xc8;}else{_0x2e393d=0xce;}_0x4c4c26[_0xddf4('0x12')](_0x2e393d);return _0x4c4c26[_0xddf4('0x19')]('Content-Range',_0x151b7b+'-'+_0x13c576+'/'+_0x3ef3a1)['json'](_0xa9b80d);}return null;};}function saveUpdates(_0x136036){return function(_0x1aa57a){if(_0x1aa57a){return _0x1aa57a['update'](_0x136036)['then'](function(_0x5cb24f){return _0x5cb24f;});}return null;};}function removeEntity(_0x361fc6){return function(_0x412dab){if(_0x412dab){return _0x412dab[_0xddf4('0x1a')]()[_0xddf4('0x1b')](function(){_0x361fc6[_0xddf4('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a1223){return function(_0x5b1aee){if(!_0x5b1aee){_0x2a1223[_0xddf4('0x11')](0x194);}return _0x5b1aee;};}function handleError(_0x36ce1a,_0x3a2e57){_0x3a2e57=_0x3a2e57||0x1f4;return function(_0x52d533){logger[_0xddf4('0x1c')](_0x52d533[_0xddf4('0x1d')]);if(_0x52d533[_0xddf4('0x1e')]){delete _0x52d533['name'];}_0x36ce1a[_0xddf4('0x12')](_0x3a2e57)[_0xddf4('0x1f')](_0x52d533);};}exports[_0xddf4('0x20')]=function(_0x3d37da,_0x321b6c){var _0x44e751={};var _0x33894c=_[_0xddf4('0x21')](db[_0xddf4('0x22')][_0xddf4('0x23')],function(_0x2c76c6){return{'name':_0x2c76c6['fieldName'],'type':_0x2c76c6[_0xddf4('0x24')]['key']};});_0x44e751=qs[_0xddf4('0x25')](_0x33894c,_0x3d37da);return interaction[_0xddf4('0x26')](_0xddf4('0x27'),_0x3d37da[_0xddf4('0x28')],_0x3d37da[_0xddf4('0x29')],_0x44e751,_0x33894c)[_0xddf4('0x1b')](respondWithFilteredResult(_0x321b6c,_0x44e751))[_0xddf4('0x2a')](handleError(_0x321b6c,null));};exports[_0xddf4('0x2b')]=function(_0x2808fe,_0x1c48bd){var _0x9143e0={'raw':![],'where':{'id':_0x2808fe['params']['id']}},_0x5dca0b={};_0x5dca0b['model']=_[_0xddf4('0x2c')](db['WhatsappInteraction'][_0xddf4('0x23')]);_0x5dca0b[_0xddf4('0x28')]=_[_0xddf4('0x2c')](_0x2808fe[_0xddf4('0x28')]);_0x5dca0b['filters']=_['intersection'](_0x5dca0b[_0xddf4('0x2d')],_0x5dca0b[_0xddf4('0x28')]);_0x9143e0[_0xddf4('0x2e')]=_['intersection'](_0x5dca0b[_0xddf4('0x2d')],qs[_0xddf4('0x2f')](_0x2808fe[_0xddf4('0x28')]['fields']));_0x9143e0[_0xddf4('0x2e')]=_0x9143e0[_0xddf4('0x2e')]['length']?_0x9143e0['attributes']:_0x5dca0b[_0xddf4('0x2d')];if(_0x2808fe['query'][_0xddf4('0x30')]){_0x9143e0[_0xddf4('0x31')]=[{'all':!![]}];}_0x9143e0=_['merge']({},_0x9143e0,_0x2808fe['options']);return db[_0xddf4('0x22')]['find'](_0x9143e0)[_0xddf4('0x1b')](handleEntityNotFound(_0x1c48bd,null))[_0xddf4('0x1b')](respondWithResult(_0x1c48bd,null))[_0xddf4('0x2a')](handleError(_0x1c48bd,null));};exports[_0xddf4('0x32')]=function(_0x45401f,_0x3d2361){return db[_0xddf4('0x22')][_0xddf4('0x32')](_0x45401f[_0xddf4('0x33')],{})[_0xddf4('0x1b')](respondWithResult(_0x3d2361,0xc9))['catch'](handleError(_0x3d2361,null));};exports[_0xddf4('0x34')]=function(_0x384f05,_0x3f2622){if(_0x384f05[_0xddf4('0x33')]['id']){delete _0x384f05[_0xddf4('0x33')]['id'];}return db[_0xddf4('0x22')][_0xddf4('0x35')]({'where':{'id':_0x384f05[_0xddf4('0x36')]['id']}})[_0xddf4('0x1b')](handleEntityNotFound(_0x3f2622,null))[_0xddf4('0x1b')](saveUpdates(_0x384f05[_0xddf4('0x33')],null))[_0xddf4('0x1b')](respondWithResult(_0x3f2622,null))[_0xddf4('0x2a')](handleError(_0x3f2622,null));};exports['destroy']=function(_0x39107f,_0xbbfd39){return db['WhatsappInteraction'][_0xddf4('0x35')]({'where':{'id':_0x39107f[_0xddf4('0x36')]['id']}})[_0xddf4('0x1b')](handleEntityNotFound(_0xbbfd39,null))[_0xddf4('0x1b')](removeEntity(_0xbbfd39,null))[_0xddf4('0x2a')](handleError(_0xbbfd39,null));};exports[_0xddf4('0x37')]=function(_0x1d434f,_0x1e89de){return db['WhatsappInteraction'][_0xddf4('0x37')]()['then'](respondWithResult(_0x1e89de,null))['catch'](handleError(_0x1e89de,null));};exports[_0xddf4('0x38')]=function(_0x63a5db,_0x3cd53f){return db[_0xddf4('0x39')][_0xddf4('0x35')]({'where':{'id':_0x63a5db['params']['id']}})[_0xddf4('0x1b')](handleEntityNotFound(_0x3cd53f,null))[_0xddf4('0x1b')](function(_0x28653e){if(_0x28653e){return _0x28653e[_0xddf4('0x38')](_0x63a5db[_0xddf4('0x33')][_0xddf4('0x3a')],_[_0xddf4('0x3b')](_0x63a5db[_0xddf4('0x33')],[_0xddf4('0x3a'),'id'])||{});}})[_0xddf4('0x1b')](respondWithResult(_0x3cd53f,null))[_0xddf4('0x2a')](handleError(_0x3cd53f,null));};exports[_0xddf4('0x3c')]=function(_0x3d7478,_0x5d25f9){var _0x1bcb35={'raw':![],'where':{}};var _0x284134={};var _0x59d876={'count':0x0,'rows':[]};return db[_0xddf4('0x22')][_0xddf4('0x3d')]({'where':{'id':_0x3d7478[_0xddf4('0x36')]['id']}})[_0xddf4('0x1b')](handleEntityNotFound(_0x5d25f9,null))[_0xddf4('0x1b')](function(_0x20d2b2){if(_0x20d2b2){_0x284134[_0xddf4('0x2d')]=_[_0xddf4('0x2c')](db[_0xddf4('0x39')][_0xddf4('0x23')]);_0x284134[_0xddf4('0x28')]=_[_0xddf4('0x2c')](_0x3d7478['query']);_0x284134['filters']=_[_0xddf4('0x3e')](_0x284134[_0xddf4('0x2d')],_0x284134[_0xddf4('0x28')]);_0x1bcb35[_0xddf4('0x2e')]=_[_0xddf4('0x3e')](_0x284134[_0xddf4('0x2d')],qs['fields'](_0x3d7478[_0xddf4('0x28')][_0xddf4('0x2f')]));_0x1bcb35['attributes']=_0x1bcb35[_0xddf4('0x2e')][_0xddf4('0x3f')]?_0x1bcb35[_0xddf4('0x2e')]:_0x284134[_0xddf4('0x2d')];if(!_0x3d7478['query'][_0xddf4('0x40')](_0xddf4('0x41'))){_0x1bcb35['limit']=qs['limit'](_0x3d7478[_0xddf4('0x28')]['limit']);_0x1bcb35[_0xddf4('0x15')]=qs[_0xddf4('0x15')](_0x3d7478[_0xddf4('0x28')][_0xddf4('0x15')]);}_0x1bcb35['order']=qs[_0xddf4('0x42')](_0x3d7478[_0xddf4('0x28')]['sort']);_0x1bcb35[_0xddf4('0x43')]=qs['filters'](_[_0xddf4('0x44')](_0x3d7478[_0xddf4('0x28')],_0x284134[_0xddf4('0x45')]));_0x1bcb35['where'][_0xddf4('0x46')]=_0x20d2b2['id'];if(_0x3d7478['query'][_0xddf4('0x47')]){_0x1bcb35['where']=_[_0xddf4('0x48')](_0x1bcb35[_0xddf4('0x43')],{'$or':_[_0xddf4('0x21')](_0x1bcb35[_0xddf4('0x2e')],function(_0x112eca){var _0x5200ea={};_0x5200ea[_0x112eca]={'$like':'%'+_0x3d7478[_0xddf4('0x28')][_0xddf4('0x47')]+'%'};return _0x5200ea;})});}if(_0x3d7478[_0xddf4('0x28')]['$gte']){var _0x92a747=_0x3d7478['query'][_0xddf4('0x49')][_0xddf4('0x4a')](',');var _0x7e031b={};_0x7e031b[_0x92a747[0x0]]={'$gte':moment(_0x92a747[0x1])[_0xddf4('0x4b')](_0xddf4('0x4c'))};_0x1bcb35[_0xddf4('0x43')]=_['merge'](_0x1bcb35[_0xddf4('0x43')],_0x7e031b);}_0x1bcb35=_[_0xddf4('0x48')]({},_0x1bcb35,_0x3d7478[_0xddf4('0x4d')]);return db['WhatsappMessage'][_0xddf4('0x18')]({'where':_0x1bcb35[_0xddf4('0x43')]})[_0xddf4('0x1b')](function(_0x2789c4){_0x59d876[_0xddf4('0x18')]=_0x2789c4;if(_0x3d7478['query']['includeAll']){_0x1bcb35['include']=[{'all':!![]}];}return db[_0xddf4('0x39')][_0xddf4('0x26')](_0x1bcb35);})[_0xddf4('0x1b')](function(_0x36f286){_0x59d876[_0xddf4('0x4e')]=_0x36f286;return _0x59d876;});}})['then'](respondWithFilteredResult(_0x5d25f9,_0x1bcb35))[_0xddf4('0x2a')](handleError(_0x5d25f9,null));};exports[_0xddf4('0x4f')]=function(_0x20c3c6,_0x58dcb1){return db[_0xddf4('0x22')][_0xddf4('0x35')]({'where':{'id':_0x20c3c6[_0xddf4('0x36')]['id']}})['then'](handleEntityNotFound(_0x58dcb1,null))[_0xddf4('0x1b')](function(_0x423e8b){if(_0x423e8b){return _0x423e8b['setTags'](_0x20c3c6[_0xddf4('0x33')][_0xddf4('0x3a')],_[_0xddf4('0x3b')](_0x20c3c6[_0xddf4('0x33')],[_0xddf4('0x3a'),'id'])||{})['spread'](function(){return db[_0xddf4('0x50')][_0xddf4('0x26')]({'attributes':['id',_0xddf4('0x1e'),_0xddf4('0x51')],'where':{'id':_0x20c3c6['body'][_0xddf4('0x3a')]}});})[_0xddf4('0x1b')](function(_0x2eca89){socket[_0xddf4('0x52')](_0xddf4('0x53'),{'id':Number(_0x20c3c6[_0xddf4('0x36')]['id']),'tags':_0x2eca89||[]});return{'id':Number(_0x20c3c6[_0xddf4('0x36')]['id']),'tags':_0x2eca89||[]};});}})[_0xddf4('0x1b')](respondWithResult(_0x58dcb1,null))[_0xddf4('0x2a')](handleError(_0x58dcb1,null));};exports[_0xddf4('0x54')]=function(_0x21db53,_0x605e2c){return db['WhatsappInteraction'][_0xddf4('0x35')]({'where':{'id':_0x21db53['params']['id']}})['then'](handleEntityNotFound(_0x605e2c,null))[_0xddf4('0x1b')](function(_0x57eca3){if(_0x57eca3){return _0x57eca3['removeTags'](_0x21db53[_0xddf4('0x28')][_0xddf4('0x3a')]);}})[_0xddf4('0x1b')](respondWithStatusCode(_0x605e2c,null))[_0xddf4('0x2a')](handleError(_0x605e2c,null));};exports[_0xddf4('0x55')]=function(_0x526881,_0x4aa85a){var _0x1c18f1=moment()['unix']()[_0xddf4('0x56')]();var _0x37bf7e=path['join'](config[_0xddf4('0x57')],_0xddf4('0x58'),_0xddf4('0x59'),_0xddf4('0x5a'));var _0xe21801=path[_0xddf4('0x5b')](config['root'],'server','files','attachments');var _0x223028=path[_0xddf4('0x5b')](_0x37bf7e,_0x1c18f1);var _0x243ec9=util[_0xddf4('0x4b')](_0xddf4('0x5c'),_0x526881[_0xddf4('0x36')]['id'],_0x1c18f1);var _0xb7b514=path['join'](_0x37bf7e,_0x243ec9);var _0x82d699=[];_0x82d699[_0xddf4('0x5d')]({'model':db[_0xddf4('0x5e')],'as':'User','attributes':['id',_0xddf4('0x5f')],'raw':!![]});_0x82d699['push']({'model':db[_0xddf4('0x60')],'as':'Contact','attributes':['id',_0xddf4('0x61'),_0xddf4('0x62')],'raw':!![]});if(_0x526881[_0xddf4('0x28')][_0xddf4('0x63')]){_0x82d699[_0xddf4('0x5d')]({'model':db[_0xddf4('0x64')],'as':_0xddf4('0x64'),'raw':!![]});}var _0x340ee8=[{'model':db[_0xddf4('0x39')],'as':_0xddf4('0x65'),'attributes':['id',_0xddf4('0x33'),_0xddf4('0x66'),_0xddf4('0x67'),_0xddf4('0x68'),_0xddf4('0x69')],'include':_0x82d699}];_0x340ee8[_0xddf4('0x5d')]({'model':db[_0xddf4('0x6a')],'as':'Account','attributes':['id','name']});_0x340ee8[_0xddf4('0x5d')]({'model':db[_0xddf4('0x5e')],'as':_0xddf4('0x6b'),'attributes':['id',_0xddf4('0x5f')]});return db[_0xddf4('0x22')][_0xddf4('0x35')]({'where':{'id':_0x526881['params']['id']},'include':_0x340ee8})[_0xddf4('0x1b')](handleEntityNotFound(_0x4aa85a,null))[_0xddf4('0x1b')](function(_0x356b25){if(_0x356b25){var _0x4c47e2=_0x356b25[_0xddf4('0x6c')]({'plain':!![]});fs[_0xddf4('0x6d')](_0x223028);var _0xd71e22={'channel':_0xddf4('0x6e'),'account':_0x4c47e2[_0xddf4('0x6f')][_0xddf4('0x1e')],'agent':_0x4c47e2[_0xddf4('0x6b')]?_0x4c47e2['Owner'][_0xddf4('0x5f')]:_0xddf4('0x70'),'createdAt':moment(_0x4c47e2[_0xddf4('0x66')])[_0xddf4('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4c47e2[_0xddf4('0x71')]?moment(_0x4c47e2[_0xddf4('0x72')])['format'](_0xddf4('0x4c'))[_0xddf4('0x56')]():'','disposition':_0x4c47e2[_0xddf4('0x73')],'messages':_(_0x4c47e2[_0xddf4('0x65')])[_0xddf4('0x47')]({'secret':![]})['map'](function(_0x4a286b){if(_0x4a286b[_0xddf4('0x64')]){var _0x1c1976=path['join'](_0xe21801,_0x4a286b[_0xddf4('0x64')][_0xddf4('0x74')]);if(fs['existsSync'](_0x1c1976)){fs[_0xddf4('0x75')](_0x1c1976)['pipe'](fs[_0xddf4('0x76')](path['join'](_0x223028,_0x4a286b[_0xddf4('0x64')]['basename'])));}}return{'date':moment(_0x4a286b['createdAt'])[_0xddf4('0x4b')](_0xddf4('0x4c'))[_0xddf4('0x56')](),'sender':_0x4a286b['direction']===_0xddf4('0x77')?_0x4a286b['User']?_0x4a286b[_0xddf4('0x5e')]['fullname']:_0xddf4('0x78'):_0x4a286b['Contact'][_0xddf4('0x61')]+(_0x4a286b[_0xddf4('0x79')]['lastName']?'\x20'+_0x4a286b[_0xddf4('0x79')][_0xddf4('0x62')]:''),'body':_0x4a286b['Attachment']?_0x4a286b[_0xddf4('0x64')][_0xddf4('0x74')]:_0x4a286b[_0xddf4('0x33')],'direction':_0x4a286b[_0xddf4('0x67')]===_0xddf4('0x77')?'A':'C','secret':_0x4a286b[_0xddf4('0x68')],'read':_0x4a286b['read'],'attachment':_0x4a286b[_0xddf4('0x64')]};})['value']()};return ejs[_0xddf4('0x7a')](path[_0xddf4('0x5b')](config[_0xddf4('0x57')],'server',_0xddf4('0x7b'),_0xddf4('0x7c')),{'interaction':_0xd71e22})[_0xddf4('0x1b')](function(_0x499d50){var _0x394cf3=path[_0xddf4('0x5b')](_0x223028,_0xddf4('0x7d')+_0x4c47e2['id']+'-'+_0x1c18f1+_0xddf4('0x7e'));var _0x4d20fa={'path':_0x394cf3,'channel':_0xddf4('0x6e'),'interactionId':_0x4c47e2['id']};return pdf['createPdfFromHTML'](_0x499d50,_0x4d20fa);})[_0xddf4('0x1b')](function(){return new BPromise(function(_0x3a67be,_0xa771f4){zipdir(_0x223028,{'saveTo':_0xb7b514},function(_0x266b57,_0x57321c){if(_0x266b57)return _0xa771f4(_0x266b57);return _0x3a67be(_0x57321c);});})[_0xddf4('0x1b')](function(){return new BPromise(function(_0x4aaaf6,_0x5da933){rimraf(_0x223028,function(_0x453932){if(_0x453932)_0x5da933(_0x453932);return _0x4aaaf6();});});})[_0xddf4('0x1b')](function(){return _0x4aa85a[_0xddf4('0x55')](_0xb7b514,_0x243ec9,function(_0x477be5){if(_0x477be5){console[_0xddf4('0x7f')](_0xddf4('0x80'),_0x477be5);}else{fs[_0xddf4('0x81')](_0xb7b514);}});});});}else{return _0x4aa85a['sendStatus'](0xc8);}})[_0xddf4('0x2a')](handleError(_0x4aa85a,null));}; \ No newline at end of file +var _0x867d=['rawAttributes','filters','intersection','length','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','attributes','fields','hasOwnProperty','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','omit','spread','Tag','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','Messages','existsSync','createReadStream','pipe','createWriteStream','out','System','value','views','downloadInteraction.ejs','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','json','destroy','then','error','name','index','map','WhatsappInteraction','fieldName','type','key','getOptions','findAll','query','user','catch','show','model','keys'];(function(_0x594c5c,_0x55e42e){var _0xfd162e=function(_0x60ec46){while(--_0x60ec46){_0x594c5c['push'](_0x594c5c['shift']());}};_0xfd162e(++_0x55e42e);}(_0x867d,0x13d));var _0xd867=function(_0x454219,_0xe71f95){_0x454219=_0x454219-0x0;var _0x5a16b0=_0x867d[_0x454219];return _0x5a16b0;};'use strict';var rimraf=require(_0xd867('0x0'));var zipdir=require(_0xd867('0x1'));var moment=require(_0xd867('0x2'));var BPromise=require(_0xd867('0x3'));var util=require(_0xd867('0x4'));var path=require('path');var ejs=require(_0xd867('0x5'));var fs=require('fs');var _=require(_0xd867('0x6'));var Redis=require(_0xd867('0x7'));var interaction=require(_0xd867('0x8'));var qs=require(_0xd867('0x9'));var pdf=require(_0xd867('0xa'));var logger=require(_0xd867('0xb'))('api');var config=require(_0xd867('0xc'));var db=require('../../mysqldb')['db'];config[_0xd867('0xd')]=_[_0xd867('0xe')](config[_0xd867('0xd')],{'host':_0xd867('0xf'),'port':0x18eb});var socket=require(_0xd867('0x10'))(new Redis(config['redis']));require(_0xd867('0x11'))[_0xd867('0x12')](socket);function respondWithStatusCode(_0x405fb0,_0x5207fc){_0x5207fc=_0x5207fc||0xcc;return function(_0x50f1ae){if(_0x50f1ae){return _0x405fb0[_0xd867('0x13')](_0x5207fc);}return _0x405fb0['status'](_0x5207fc)[_0xd867('0x14')]();};}function respondWithResult(_0xfab6be,_0x56a13d){_0x56a13d=_0x56a13d||0xc8;return function(_0x25f237){if(_0x25f237){return _0xfab6be[_0xd867('0x15')](_0x56a13d)['json'](_0x25f237);}};}function respondWithFilteredResult(_0x267764,_0x2692b6){return function(_0x274e05){if(_0x274e05){var _0x44f6cd=typeof _0x2692b6[_0xd867('0x16')]===_0xd867('0x17')&&typeof _0x2692b6['limit']===_0xd867('0x17');var _0x52750e=_0x274e05[_0xd867('0x18')];var _0x34bf10=_0x44f6cd?0x0:_0x2692b6[_0xd867('0x16')];var _0x31b60c=_0x44f6cd?_0x274e05[_0xd867('0x18')]:_0x2692b6['offset']+_0x2692b6[_0xd867('0x19')];var _0xf43654;if(_0x31b60c>=_0x52750e){_0x31b60c=_0x52750e;_0xf43654=0xc8;}else{_0xf43654=0xce;}_0x267764[_0xd867('0x15')](_0xf43654);return _0x267764[_0xd867('0x1a')]('Content-Range',_0x34bf10+'-'+_0x31b60c+'/'+_0x52750e)[_0xd867('0x1b')](_0x274e05);}return null;};}function saveUpdates(_0x1d7694){return function(_0x59f213){if(_0x59f213){return _0x59f213['update'](_0x1d7694)['then'](function(_0x3ebc0e){return _0x3ebc0e;});}return null;};}function removeEntity(_0x5c314c){return function(_0x5ec69e){if(_0x5ec69e){return _0x5ec69e[_0xd867('0x1c')]()[_0xd867('0x1d')](function(){_0x5c314c[_0xd867('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58b9ad){return function(_0x286bb2){if(!_0x286bb2){_0x58b9ad[_0xd867('0x13')](0x194);}return _0x286bb2;};}function handleError(_0x395af2,_0x3d4a08){_0x3d4a08=_0x3d4a08||0x1f4;return function(_0x31a4e9){logger[_0xd867('0x1e')](_0x31a4e9['stack']);if(_0x31a4e9[_0xd867('0x1f')]){delete _0x31a4e9[_0xd867('0x1f')];}_0x395af2['status'](_0x3d4a08)['send'](_0x31a4e9);};}exports[_0xd867('0x20')]=function(_0x5173dd,_0x136f49){var _0x379612={};var _0x3d10db=_[_0xd867('0x21')](db[_0xd867('0x22')]['rawAttributes'],function(_0x53d9f6){return{'name':_0x53d9f6[_0xd867('0x23')],'type':_0x53d9f6[_0xd867('0x24')][_0xd867('0x25')]};});_0x379612=qs[_0xd867('0x26')](_0x3d10db,_0x5173dd);return interaction[_0xd867('0x27')]('whatsapp',_0x5173dd[_0xd867('0x28')],_0x5173dd[_0xd867('0x29')],_0x379612,_0x3d10db)[_0xd867('0x1d')](respondWithFilteredResult(_0x136f49,_0x379612))[_0xd867('0x2a')](handleError(_0x136f49,null));};exports[_0xd867('0x2b')]=function(_0x238152,_0x4f93e9){var _0xd40d66={'raw':![],'where':{'id':_0x238152['params']['id']}},_0x560315={};_0x560315[_0xd867('0x2c')]=_[_0xd867('0x2d')](db[_0xd867('0x22')][_0xd867('0x2e')]);_0x560315[_0xd867('0x28')]=_[_0xd867('0x2d')](_0x238152['query']);_0x560315[_0xd867('0x2f')]=_[_0xd867('0x30')](_0x560315[_0xd867('0x2c')],_0x560315['query']);_0xd40d66['attributes']=_[_0xd867('0x30')](_0x560315[_0xd867('0x2c')],qs['fields'](_0x238152[_0xd867('0x28')]['fields']));_0xd40d66['attributes']=_0xd40d66['attributes'][_0xd867('0x31')]?_0xd40d66['attributes']:_0x560315['model'];if(_0x238152['query']['includeAll']){_0xd40d66[_0xd867('0x32')]=[{'all':!![]}];}_0xd40d66=_[_0xd867('0x33')]({},_0xd40d66,_0x238152[_0xd867('0x34')]);return db[_0xd867('0x22')][_0xd867('0x35')](_0xd40d66)['then'](handleEntityNotFound(_0x4f93e9,null))[_0xd867('0x1d')](respondWithResult(_0x4f93e9,null))[_0xd867('0x2a')](handleError(_0x4f93e9,null));};exports[_0xd867('0x36')]=function(_0x424f07,_0x36c249){return db[_0xd867('0x22')][_0xd867('0x36')](_0x424f07[_0xd867('0x37')],{})[_0xd867('0x1d')](respondWithResult(_0x36c249,0xc9))[_0xd867('0x2a')](handleError(_0x36c249,null));};exports['update']=function(_0x47aae7,_0x2e1e62){if(_0x47aae7[_0xd867('0x37')]['id']){delete _0x47aae7[_0xd867('0x37')]['id'];}return db[_0xd867('0x22')][_0xd867('0x35')]({'where':{'id':_0x47aae7[_0xd867('0x38')]['id']}})[_0xd867('0x1d')](handleEntityNotFound(_0x2e1e62,null))[_0xd867('0x1d')](saveUpdates(_0x47aae7['body'],null))[_0xd867('0x1d')](respondWithResult(_0x2e1e62,null))['catch'](handleError(_0x2e1e62,null));};exports[_0xd867('0x1c')]=function(_0x1828e1,_0x3d4001){return db[_0xd867('0x22')]['find']({'where':{'id':_0x1828e1['params']['id']}})[_0xd867('0x1d')](handleEntityNotFound(_0x3d4001,null))[_0xd867('0x1d')](removeEntity(_0x3d4001,null))[_0xd867('0x2a')](handleError(_0x3d4001,null));};exports[_0xd867('0x39')]=function(_0x272a41,_0x23e92f){return db['WhatsappInteraction']['describe']()[_0xd867('0x1d')](respondWithResult(_0x23e92f,null))[_0xd867('0x2a')](handleError(_0x23e92f,null));};exports[_0xd867('0x3a')]=function(_0x59c42b,_0x1638c0){return db[_0xd867('0x3b')][_0xd867('0x35')]({'where':{'id':_0x59c42b[_0xd867('0x38')]['id']}})[_0xd867('0x1d')](handleEntityNotFound(_0x1638c0,null))[_0xd867('0x1d')](function(_0x147469){if(_0x147469){return _0x147469['addMessage'](_0x59c42b['body'][_0xd867('0x3c')],_['omit'](_0x59c42b[_0xd867('0x37')],[_0xd867('0x3c'),'id'])||{});}})[_0xd867('0x1d')](respondWithResult(_0x1638c0,null))[_0xd867('0x2a')](handleError(_0x1638c0,null));};exports[_0xd867('0x3d')]=function(_0x1d631b,_0x499415){var _0x1395bf={'raw':![],'where':{}};var _0x58bfa7={};var _0x5a6575={'count':0x0,'rows':[]};return db[_0xd867('0x22')][_0xd867('0x3e')]({'where':{'id':_0x1d631b[_0xd867('0x38')]['id']}})[_0xd867('0x1d')](handleEntityNotFound(_0x499415,null))[_0xd867('0x1d')](function(_0x26b0e9){if(_0x26b0e9){_0x58bfa7[_0xd867('0x2c')]=_[_0xd867('0x2d')](db['WhatsappMessage'][_0xd867('0x2e')]);_0x58bfa7[_0xd867('0x28')]=_['keys'](_0x1d631b[_0xd867('0x28')]);_0x58bfa7['filters']=_[_0xd867('0x30')](_0x58bfa7[_0xd867('0x2c')],_0x58bfa7[_0xd867('0x28')]);_0x1395bf[_0xd867('0x3f')]=_[_0xd867('0x30')](_0x58bfa7[_0xd867('0x2c')],qs[_0xd867('0x40')](_0x1d631b[_0xd867('0x28')]['fields']));_0x1395bf[_0xd867('0x3f')]=_0x1395bf[_0xd867('0x3f')][_0xd867('0x31')]?_0x1395bf[_0xd867('0x3f')]:_0x58bfa7[_0xd867('0x2c')];if(!_0x1d631b[_0xd867('0x28')][_0xd867('0x41')]('nolimit')){_0x1395bf[_0xd867('0x19')]=qs[_0xd867('0x19')](_0x1d631b[_0xd867('0x28')][_0xd867('0x19')]);_0x1395bf[_0xd867('0x16')]=qs[_0xd867('0x16')](_0x1d631b[_0xd867('0x28')][_0xd867('0x16')]);}_0x1395bf['order']=qs[_0xd867('0x42')](_0x1d631b['query'][_0xd867('0x42')]);_0x1395bf[_0xd867('0x43')]=qs[_0xd867('0x2f')](_[_0xd867('0x44')](_0x1d631b[_0xd867('0x28')],_0x58bfa7[_0xd867('0x2f')]));_0x1395bf[_0xd867('0x43')]['WhatsappInteractionId']=_0x26b0e9['id'];if(_0x1d631b[_0xd867('0x28')][_0xd867('0x45')]){_0x1395bf[_0xd867('0x43')]=_[_0xd867('0x33')](_0x1395bf[_0xd867('0x43')],{'$or':_[_0xd867('0x21')](_0x1395bf['attributes'],function(_0x54bfb3){var _0x56e1cc={};_0x56e1cc[_0x54bfb3]={'$like':'%'+_0x1d631b[_0xd867('0x28')][_0xd867('0x45')]+'%'};return _0x56e1cc;})});}if(_0x1d631b[_0xd867('0x28')][_0xd867('0x46')]){var _0x317f53=_0x1d631b[_0xd867('0x28')]['$gte'][_0xd867('0x47')](',');var _0x4b91ba={};_0x4b91ba[_0x317f53[0x0]]={'$gte':moment(_0x317f53[0x1])[_0xd867('0x48')](_0xd867('0x49'))};_0x1395bf[_0xd867('0x43')]=_['merge'](_0x1395bf[_0xd867('0x43')],_0x4b91ba);}_0x1395bf=_['merge']({},_0x1395bf,_0x1d631b[_0xd867('0x34')]);return db[_0xd867('0x3b')][_0xd867('0x18')]({'where':_0x1395bf[_0xd867('0x43')]})[_0xd867('0x1d')](function(_0x4ad5f3){_0x5a6575[_0xd867('0x18')]=_0x4ad5f3;if(_0x1d631b[_0xd867('0x28')][_0xd867('0x4a')]){_0x1395bf[_0xd867('0x32')]=[{'all':!![]}];}return db[_0xd867('0x3b')][_0xd867('0x27')](_0x1395bf);})[_0xd867('0x1d')](function(_0x15284f){_0x5a6575[_0xd867('0x4b')]=_0x15284f;return _0x5a6575;});}})[_0xd867('0x1d')](respondWithFilteredResult(_0x499415,_0x1395bf))['catch'](handleError(_0x499415,null));};exports[_0xd867('0x4c')]=function(_0x1eff5d,_0x19d24f){return db['WhatsappInteraction'][_0xd867('0x35')]({'where':{'id':_0x1eff5d['params']['id']}})[_0xd867('0x1d')](handleEntityNotFound(_0x19d24f,null))[_0xd867('0x1d')](function(_0xcbc376){if(_0xcbc376){return _0xcbc376[_0xd867('0x4d')](_0x1eff5d[_0xd867('0x37')]['ids'],_[_0xd867('0x4e')](_0x1eff5d['body'],[_0xd867('0x3c'),'id'])||{})[_0xd867('0x4f')](function(){return db[_0xd867('0x50')]['findAll']({'attributes':['id',_0xd867('0x1f'),'color'],'where':{'id':_0x1eff5d[_0xd867('0x37')][_0xd867('0x3c')]}});})[_0xd867('0x1d')](function(_0x5f19e9){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x1eff5d['params']['id']),'tags':_0x5f19e9||[]});return{'id':Number(_0x1eff5d[_0xd867('0x38')]['id']),'tags':_0x5f19e9||[]};});}})[_0xd867('0x1d')](respondWithResult(_0x19d24f,null))[_0xd867('0x2a')](handleError(_0x19d24f,null));};exports['removeTags']=function(_0x30c4b2,_0x52aef4){return db[_0xd867('0x22')][_0xd867('0x35')]({'where':{'id':_0x30c4b2[_0xd867('0x38')]['id']}})['then'](handleEntityNotFound(_0x52aef4,null))['then'](function(_0x48a89a){if(_0x48a89a){return _0x48a89a['removeTags'](_0x30c4b2[_0xd867('0x28')][_0xd867('0x3c')]);}})[_0xd867('0x1d')](respondWithStatusCode(_0x52aef4,null))[_0xd867('0x2a')](handleError(_0x52aef4,null));};exports[_0xd867('0x51')]=function(_0x122dba,_0x4c4c55){var _0x391bd5=moment()['unix']()[_0xd867('0x52')]();var _0x113976=path[_0xd867('0x53')](config[_0xd867('0x54')],_0xd867('0x55'),_0xd867('0x56'),_0xd867('0x57'));var _0x34ac38=path[_0xd867('0x53')](config[_0xd867('0x54')],_0xd867('0x55'),'files',_0xd867('0x58'));var _0x334068=path['join'](_0x113976,_0x391bd5);var _0x5da6b3=util['format'](_0xd867('0x59'),_0x122dba[_0xd867('0x38')]['id'],_0x391bd5);var _0x1e053a=path['join'](_0x113976,_0x5da6b3);var _0x2e6180=[];_0x2e6180[_0xd867('0x5a')]({'model':db['User'],'as':_0xd867('0x5b'),'attributes':['id',_0xd867('0x5c')],'raw':!![]});_0x2e6180['push']({'model':db[_0xd867('0x5d')],'as':_0xd867('0x5e'),'attributes':['id',_0xd867('0x5f'),_0xd867('0x60')],'raw':!![]});if(_0x122dba['query'][_0xd867('0x58')]){_0x2e6180[_0xd867('0x5a')]({'model':db[_0xd867('0x61')],'as':_0xd867('0x61'),'raw':!![]});}var _0x24f954=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id','body',_0xd867('0x62'),_0xd867('0x63'),'secret',_0xd867('0x64')],'include':_0x2e6180}];_0x24f954[_0xd867('0x5a')]({'model':db[_0xd867('0x65')],'as':'Account','attributes':['id',_0xd867('0x1f')]});_0x24f954[_0xd867('0x5a')]({'model':db[_0xd867('0x5b')],'as':_0xd867('0x66'),'attributes':['id','fullname']});return db[_0xd867('0x22')][_0xd867('0x35')]({'where':{'id':_0x122dba[_0xd867('0x38')]['id']},'include':_0x24f954})[_0xd867('0x1d')](handleEntityNotFound(_0x4c4c55,null))[_0xd867('0x1d')](function(_0x10ed4f){if(_0x10ed4f){var _0x3dcb49=_0x10ed4f[_0xd867('0x67')]({'plain':!![]});fs[_0xd867('0x68')](_0x334068);var _0x3dd800={'channel':_0xd867('0x69'),'account':_0x3dcb49['Account'][_0xd867('0x1f')],'agent':_0x3dcb49['Owner']?_0x3dcb49[_0xd867('0x66')][_0xd867('0x5c')]:_0xd867('0x6a'),'createdAt':moment(_0x3dcb49[_0xd867('0x62')])[_0xd867('0x48')](_0xd867('0x49'))[_0xd867('0x52')](),'closedAt':_0x3dcb49['closed']?moment(_0x3dcb49[_0xd867('0x6b')])[_0xd867('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd867('0x52')]():'','disposition':_0x3dcb49['disposition'],'messages':_(_0x3dcb49[_0xd867('0x6c')])['filter']({'secret':![]})['map'](function(_0x51a359){if(_0x51a359[_0xd867('0x61')]){var _0x4c64e1=path[_0xd867('0x53')](_0x34ac38,_0x51a359[_0xd867('0x61')]['basename']);if(fs[_0xd867('0x6d')](_0x4c64e1)){fs[_0xd867('0x6e')](_0x4c64e1)[_0xd867('0x6f')](fs[_0xd867('0x70')](path[_0xd867('0x53')](_0x334068,_0x51a359[_0xd867('0x61')]['basename'])));}}return{'date':moment(_0x51a359[_0xd867('0x62')])[_0xd867('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd867('0x52')](),'sender':_0x51a359[_0xd867('0x63')]===_0xd867('0x71')?_0x51a359[_0xd867('0x5b')]?_0x51a359[_0xd867('0x5b')][_0xd867('0x5c')]:_0xd867('0x72'):_0x51a359[_0xd867('0x5e')][_0xd867('0x5f')]+(_0x51a359[_0xd867('0x5e')]['lastName']?'\x20'+_0x51a359['Contact'][_0xd867('0x60')]:''),'body':_0x51a359['Attachment']?_0x51a359['Attachment']['basename']:_0x51a359[_0xd867('0x37')],'direction':_0x51a359[_0xd867('0x63')]==='out'?'A':'C','secret':_0x51a359['secret'],'read':_0x51a359[_0xd867('0x64')],'attachment':_0x51a359[_0xd867('0x61')]};})[_0xd867('0x73')]()};return ejs['renderFile'](path[_0xd867('0x53')](config[_0xd867('0x54')],_0xd867('0x55'),_0xd867('0x74'),_0xd867('0x75')),{'interaction':_0x3dd800})[_0xd867('0x1d')](function(_0x19ee31){var _0x5b7044=path['join'](_0x334068,'transcript-'+_0x3dcb49['id']+'-'+_0x391bd5+'.pdf');var _0x3c0232={'path':_0x5b7044,'channel':_0xd867('0x69'),'interactionId':_0x3dcb49['id']};return pdf[_0xd867('0x76')](_0x19ee31,_0x3c0232);})['then'](function(){return new BPromise(function(_0x4def41,_0x40e3d1){zipdir(_0x334068,{'saveTo':_0x1e053a},function(_0x111ea3,_0x2ed387){if(_0x111ea3)return _0x40e3d1(_0x111ea3);return _0x4def41(_0x2ed387);});})[_0xd867('0x1d')](function(){return new BPromise(function(_0xf74940,_0x36d254){rimraf(_0x334068,function(_0x36ec55){if(_0x36ec55)_0x36d254(_0x36ec55);return _0xf74940();});});})[_0xd867('0x1d')](function(){return _0x4c4c55[_0xd867('0x51')](_0x1e053a,_0x5da6b3,function(_0x19ff17){if(_0x19ff17){console[_0xd867('0x77')](_0xd867('0x78'),_0x19ff17);}else{fs['unlinkSync'](_0x1e053a);}});});});}else{return _0x4c4c55[_0xd867('0x13')](0xc8);}})['catch'](handleError(_0x4c4c55,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 487136e..a17986f 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 _0xdb76=['save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x4f8e06,_0x1548c9){var _0x381ca9=function(_0x37c5df){while(--_0x37c5df){_0x4f8e06['push'](_0x4f8e06['shift']());}};_0x381ca9(++_0x1548c9);}(_0xdb76,0x1be));var _0x6db7=function(_0x5b95a7,_0x2192db){_0x5b95a7=_0x5b95a7-0x0;var _0x3f6e48=_0xdb76[_0x5b95a7];return _0x3f6e48;};'use strict';var EventEmitter=require(_0x6db7('0x0'));var WhatsappInteraction=require(_0x6db7('0x1'))['db'][_0x6db7('0x2')];var WhatsappMessage=require(_0x6db7('0x1'))['db'][_0x6db7('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6db7('0x4'),'afterUpdate':_0x6db7('0x5'),'afterDestroy':_0x6db7('0x6')};function emitEvent(_0x40f6ce){return function(_0x57a095,_0x117f1c,_0x7bba2d){_0x57a095[_0x6db7('0x7')]({'attributes':['id'],'raw':!![]})[_0x6db7('0x8')](function(_0x3b7b8a){_0x57a095['setDataValue'](_0x6db7('0x9'),_0x3b7b8a[_0x6db7('0xa')](function(_0x4e2553){return{'id':_0x4e2553['id']};}));return WhatsappMessage[_0x6db7('0xb')]({'where':{'WhatsappInteractionId':_0x57a095['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6db7('0x8')](function(_0x582d31){_0x57a095[_0x6db7('0xc')](_0x6db7('0xd'),_0x582d31[_0x6db7('0xe')]);WhatsappInteractionEvents['emit'](_0x40f6ce+':'+_0x57a095['id'],_0x57a095);WhatsappInteractionEvents['emit'](_0x40f6ce,_0x57a095);_0x7bba2d(null);})[_0x6db7('0xf')](_0x7bba2d(null));};}for(var e in events){if(events[_0x6db7('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x6db7('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x3c81=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','getUsers','then','Users','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x9cf9f8,_0x1efb85){var _0x24550a=function(_0x588463){while(--_0x588463){_0x9cf9f8['push'](_0x9cf9f8['shift']());}};_0x24550a(++_0x1efb85);}(_0x3c81,0x102));var _0x13c8=function(_0x14149e,_0x2826bb){_0x14149e=_0x14149e-0x0;var _0x1c5db6=_0x3c81[_0x14149e];return _0x1c5db6;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var WhatsappInteraction=require(_0x13c8('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x13c8('0x1'))['db'][_0x13c8('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x101d4f){return function(_0x3ec886,_0x18bd0f,_0x1c16f1){_0x3ec886[_0x13c8('0x3')]({'attributes':['id'],'raw':!![]})[_0x13c8('0x4')](function(_0x445b69){_0x3ec886['setDataValue'](_0x13c8('0x5'),_0x445b69['map'](function(_0x380aed){return{'id':_0x380aed['id']};}));return WhatsappMessage[_0x13c8('0x6')]({'where':{'WhatsappInteractionId':_0x3ec886['id'],'direction':'in','read':![]},'raw':!![]});})[_0x13c8('0x4')](function(_0x30b4d6){_0x3ec886[_0x13c8('0x7')](_0x13c8('0x8'),_0x30b4d6[_0x13c8('0x9')]);WhatsappInteractionEvents[_0x13c8('0xa')](_0x101d4f+':'+_0x3ec886['id'],_0x3ec886);WhatsappInteractionEvents[_0x13c8('0xa')](_0x101d4f,_0x3ec886);_0x1c16f1(null);})[_0x13c8('0xb')](_0x1c16f1(null));};}for(var e in events){if(events[_0x13c8('0xc')](e)){var event=events[e];WhatsappInteraction[_0x13c8('0xd')](e,emitEvent(event));}}module[_0x13c8('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index fac7244..9818c25 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 _0x81ef=['bluebird','request-promise','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x3b9565,_0x4bc2b1){var _0x404e58=function(_0x2a6a05){while(--_0x2a6a05){_0x3b9565['push'](_0x3b9565['shift']());}};_0x404e58(++_0x4bc2b1);}(_0x81ef,0x16c));var _0xf81e=function(_0x2ba149,_0x37eaa2){_0x2ba149=_0x2ba149-0x0;var _0x23572a=_0x81ef[_0x2ba149];return _0x23572a;};'use strict';var _=require(_0xf81e('0x0'));var util=require(_0xf81e('0x1'));var logger=require('../../config/logger')(_0xf81e('0x2'));var moment=require(_0xf81e('0x3'));var BPromise=require(_0xf81e('0x4'));var rp=require(_0xf81e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf81e('0x6'));var config=require('../../config/environment');var attributes=require(_0xf81e('0x7'));module[_0xf81e('0x8')]=function(_0x92cde0,_0x107384){return _0x92cde0[_0xf81e('0x9')](_0xf81e('0xa'),attributes,{'tableName':_0xf81e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x390f09,_0x4a84eb,_0x12c043){if(_0x390f09['changed'](_0xf81e('0xc'))){_0x390f09[_0xf81e('0xd')]=moment()[_0xf81e('0xe')](_0xf81e('0xf'));}_0x12c043(null,_0x390f09);}}});}; \ No newline at end of file +var _0xf0e4=['format','YYYY-MM-DD\x20HH:mm:ss','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','whatsapp_interactions','closed','closedAt'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf0e4,0x198));var _0x4f0e=function(_0x2f7116,_0x459cef){_0x2f7116=_0x2f7116-0x0;var _0x22ccdc=_0xf0e4[_0x2f7116];return _0x22ccdc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4f0e('0x0'));var moment=require(_0x4f0e('0x1'));var BPromise=require(_0x4f0e('0x2'));var rp=require(_0x4f0e('0x3'));var fs=require('fs');var path=require(_0x4f0e('0x4'));var rimraf=require(_0x4f0e('0x5'));var config=require(_0x4f0e('0x6'));var attributes=require(_0x4f0e('0x7'));module[_0x4f0e('0x8')]=function(_0x2c5999,_0x85019f){return _0x2c5999['define']('WhatsappInteraction',attributes,{'tableName':_0x4f0e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1af495,_0x1415e3,_0x1e9610){if(_0x1af495['changed'](_0x4f0e('0xa'))){_0x1af495[_0x4f0e('0xb')]=moment()[_0x4f0e('0xc')](_0x4f0e('0xd'));}_0x1e9610(null,_0x1af495);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index da25f4e..048c428 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 _0x0ac9=['info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','WhatsappInteraction','update','body','options','raw','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','where','ids','omit','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then'];(function(_0x5139d5,_0x249f6a){var _0x2e5d5a=function(_0xbdac4f){while(--_0xbdac4f){_0x5139d5['push'](_0x5139d5['shift']());}};_0x2e5d5a(++_0x249f6a);}(_0x0ac9,0x14d));var _0x90ac=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0x0ac9[_0x7feb90];return _0x3c5b33;};'use strict';var _=require('lodash');var util=require(_0x90ac('0x0'));var moment=require('moment');var BPromise=require(_0x90ac('0x1'));var rs=require(_0x90ac('0x2'));var fs=require('fs');var Redis=require(_0x90ac('0x3'));var db=require(_0x90ac('0x4'))['db'];var utils=require(_0x90ac('0x5'));var logger=require(_0x90ac('0x6'))(_0x90ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x90ac('0x8'));var client=jayson[_0x90ac('0x9')][_0x90ac('0xa')]({'port':0x232a});config[_0x90ac('0xb')]=_[_0x90ac('0xc')](config[_0x90ac('0xb')],{'host':_0x90ac('0xd'),'port':0x18eb});var socket=require(_0x90ac('0xe'))(new Redis(config[_0x90ac('0xb')]));require(_0x90ac('0xf'))[_0x90ac('0x10')](socket);function respondWithRpcPromise(_0x102dcc,_0x5e05c0,_0x470fd4){return new BPromise(function(_0xff5c06,_0x2874b3){return client[_0x90ac('0x11')](_0x102dcc,_0x470fd4)[_0x90ac('0x12')](function(_0x557bb8){logger[_0x90ac('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x5e05c0,'request\x20sent');logger[_0x90ac('0x14')](_0x90ac('0x15'),_0x5e05c0,_0x90ac('0x16'),JSON[_0x90ac('0x17')](_0x557bb8));if(_0x557bb8[_0x90ac('0x18')]){if(_0x557bb8[_0x90ac('0x18')][_0x90ac('0x19')]===0x1f4){logger[_0x90ac('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x5e05c0,_0x557bb8[_0x90ac('0x18')][_0x90ac('0x1a')]);return _0x2874b3(_0x557bb8['error'][_0x90ac('0x1a')]);}logger['error'](_0x90ac('0x1b'),_0x5e05c0,_0x557bb8[_0x90ac('0x18')][_0x90ac('0x1a')]);return _0xff5c06(_0x557bb8[_0x90ac('0x18')][_0x90ac('0x1a')]);}else{logger[_0x90ac('0x13')](_0x90ac('0x1b'),_0x5e05c0,_0x90ac('0x16'));_0xff5c06(_0x557bb8[_0x90ac('0x1c')][_0x90ac('0x1a')]);}})[_0x90ac('0x1d')](function(_0x536709){logger[_0x90ac('0x18')](_0x90ac('0x1b'),_0x5e05c0,_0x536709);_0x2874b3(_0x536709);});});}exports['UpdateWhatsappInteraction']=function(_0x313d89){var _0x57e818=this;return new Promise(function(_0x35176a,_0x1d7f9e){return db[_0x90ac('0x1e')][_0x90ac('0x1f')](_0x313d89[_0x90ac('0x20')],{'raw':_0x313d89[_0x90ac('0x21')]?_0x313d89[_0x90ac('0x21')][_0x90ac('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x313d89[_0x90ac('0x21')]?_0x313d89['options']['where']||null:null,'attributes':_0x313d89[_0x90ac('0x21')]?_0x313d89['options'][_0x90ac('0x23')]||null:null,'limit':_0x313d89[_0x90ac('0x21')]?_0x313d89[_0x90ac('0x21')][_0x90ac('0x24')]||null:null})[_0x90ac('0x12')](function(_0x3c4765){logger[_0x90ac('0x13')](_0x90ac('0x25'),_0x313d89);logger[_0x90ac('0x14')](_0x90ac('0x25'),_0x313d89,JSON[_0x90ac('0x17')](_0x3c4765));_0x35176a(_0x3c4765);})[_0x90ac('0x1d')](function(_0x31a0d0){logger[_0x90ac('0x18')](_0x90ac('0x25'),_0x31a0d0['message'],_0x313d89);_0x1d7f9e(_0x57e818[_0x90ac('0x18')](0x1f4,_0x31a0d0['message']));});});};exports[_0x90ac('0x26')]=function(_0x399449){return new Promise(function(_0x429859,_0x501874){return db['WhatsappInteraction'][_0x90ac('0x27')]({'where':_0x399449[_0x90ac('0x21')]?_0x399449[_0x90ac('0x21')][_0x90ac('0x28')]||null:null})[_0x90ac('0x12')](function(_0x30e8eb){if(_0x30e8eb){return _0x30e8eb['addTags'](_0x399449[_0x90ac('0x20')][_0x90ac('0x29')],_[_0x90ac('0x2a')](_0x399449[_0x90ac('0x20')],[_0x90ac('0x29'),'id'])||{});}})['spread'](function(_0x5dbd51){logger[_0x90ac('0x13')](_0x90ac('0x2b'),_0x399449);logger[_0x90ac('0x14')](_0x90ac('0x2b'),_0x399449,JSON[_0x90ac('0x17')](_0x5dbd51));_0x429859(_0x5dbd51);})[_0x90ac('0x1d')](function(_0x3004e1){logger[_0x90ac('0x18')](_0x90ac('0x2b'),_0x3004e1[_0x90ac('0x1a')],_0x399449);_0x501874(_this[_0x90ac('0x18')](0x1f4,_0x3004e1[_0x90ac('0x1a')]));});});}; \ No newline at end of file +var _0x8b0e=['options','raw','where','attributes','info','debug','AddTagsToWhatsappInteraction','find','addTags','body','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x8b0e,0xd0));var _0xe8b0=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x8b0e[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xe8b0('0x0'));var util=require(_0xe8b0('0x1'));var moment=require(_0xe8b0('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8b0('0x4'))['db'];var utils=require(_0xe8b0('0x5'));var logger=require(_0xe8b0('0x6'))(_0xe8b0('0x7'));var config=require(_0xe8b0('0x8'));var jayson=require(_0xe8b0('0x9'));var client=jayson['client'][_0xe8b0('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe8b0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe8b0('0xc'))(new Redis(config['redis']));require(_0xe8b0('0xd'))[_0xe8b0('0xe')](socket);function respondWithRpcPromise(_0x3282f5,_0x486dd9,_0x48909b){return new BPromise(function(_0x23364a,_0x182afe){return client[_0xe8b0('0xf')](_0x3282f5,_0x48909b)[_0xe8b0('0x10')](function(_0x58dbaa){logger['info'](_0xe8b0('0x11'),_0x486dd9,_0xe8b0('0x12'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x486dd9,_0xe8b0('0x12'),JSON[_0xe8b0('0x13')](_0x58dbaa));if(_0x58dbaa[_0xe8b0('0x14')]){if(_0x58dbaa['error'][_0xe8b0('0x15')]===0x1f4){logger[_0xe8b0('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x486dd9,_0x58dbaa[_0xe8b0('0x14')]['message']);return _0x182afe(_0x58dbaa[_0xe8b0('0x14')][_0xe8b0('0x16')]);}logger['error'](_0xe8b0('0x11'),_0x486dd9,_0x58dbaa[_0xe8b0('0x14')][_0xe8b0('0x16')]);return _0x23364a(_0x58dbaa['error'][_0xe8b0('0x16')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x486dd9,_0xe8b0('0x12'));_0x23364a(_0x58dbaa['result'][_0xe8b0('0x16')]);}})[_0xe8b0('0x17')](function(_0x2f43c1){logger[_0xe8b0('0x14')](_0xe8b0('0x11'),_0x486dd9,_0x2f43c1);_0x182afe(_0x2f43c1);});});}exports[_0xe8b0('0x18')]=function(_0x19fc78){var _0x3e2ced=this;return new Promise(function(_0x4b77a3,_0x5b2ecd){return db[_0xe8b0('0x19')]['update'](_0x19fc78['body'],{'raw':_0x19fc78['options']?_0x19fc78[_0xe8b0('0x1a')][_0xe8b0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19fc78[_0xe8b0('0x1a')]?_0x19fc78[_0xe8b0('0x1a')][_0xe8b0('0x1c')]||null:null,'attributes':_0x19fc78[_0xe8b0('0x1a')]?_0x19fc78[_0xe8b0('0x1a')][_0xe8b0('0x1d')]||null:null,'limit':_0x19fc78[_0xe8b0('0x1a')]?_0x19fc78[_0xe8b0('0x1a')]['limit']||null:null})[_0xe8b0('0x10')](function(_0x410f05){logger[_0xe8b0('0x1e')](_0xe8b0('0x18'),_0x19fc78);logger[_0xe8b0('0x1f')](_0xe8b0('0x18'),_0x19fc78,JSON[_0xe8b0('0x13')](_0x410f05));_0x4b77a3(_0x410f05);})[_0xe8b0('0x17')](function(_0x23a546){logger['error']('UpdateWhatsappInteraction',_0x23a546['message'],_0x19fc78);_0x5b2ecd(_0x3e2ced[_0xe8b0('0x14')](0x1f4,_0x23a546[_0xe8b0('0x16')]));});});};exports[_0xe8b0('0x20')]=function(_0xcd72aa){return new Promise(function(_0x537bcb,_0x42fab0){return db[_0xe8b0('0x19')][_0xe8b0('0x21')]({'where':_0xcd72aa[_0xe8b0('0x1a')]?_0xcd72aa[_0xe8b0('0x1a')][_0xe8b0('0x1c')]||null:null})['then'](function(_0x1465bd){if(_0x1465bd){return _0x1465bd[_0xe8b0('0x22')](_0xcd72aa[_0xe8b0('0x23')]['ids'],_[_0xe8b0('0x24')](_0xcd72aa[_0xe8b0('0x23')],['ids','id'])||{});}})[_0xe8b0('0x25')](function(_0x378258){logger[_0xe8b0('0x1e')](_0xe8b0('0x26'),_0xcd72aa);logger[_0xe8b0('0x1f')](_0xe8b0('0x26'),_0xcd72aa,JSON[_0xe8b0('0x13')](_0x378258));_0x537bcb(_0x378258);})[_0xe8b0('0x17')](function(_0x48a786){logger[_0xe8b0('0x14')]('AddTags',_0x48a786[_0xe8b0('0x16')],_0xcd72aa);_0x42fab0(_this[_0xe8b0('0x14')](0x1f4,_0x48a786['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f931e96..ab96c05 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 _0x628d=['register','length','./whatsappInteraction.events','emit','removeListener'];(function(_0x126d56,_0x2914cb){var _0x4014a9=function(_0x2bd1a2){while(--_0x2bd1a2){_0x126d56['push'](_0x126d56['shift']());}};_0x4014a9(++_0x2914cb);}(_0x628d,0xac));var _0xd628=function(_0x1dbc96,_0xb7f876){_0x1dbc96=_0x1dbc96-0x0;var _0x3951a5=_0x628d[_0x1dbc96];return _0x3951a5;};'use strict';var WhatsappInteractionEvents=require(_0xd628('0x0'));var events=['save','remove','update'];function createListener(_0x413b36,_0x310e27){return function(_0x1526e1){_0x310e27[_0xd628('0x1')](_0x413b36,_0x1526e1);};}function removeListener(_0x1306b7,_0x8d68fd){return function(){WhatsappInteractionEvents[_0xd628('0x2')](_0x1306b7,_0x8d68fd);};}exports[_0xd628('0x3')]=function(_0x526ec2){for(var _0x932702=0x0,_0x47e161=events[_0xd628('0x4')];_0x932702<_0x47e161;_0x932702++){var _0x14da38=events[_0x932702];var _0x2aa514=createListener('whatsappInteraction:'+_0x14da38,_0x526ec2);WhatsappInteractionEvents['on'](_0x14da38,_0x2aa514);}}; \ No newline at end of file +var _0x8a15=['update','emit','removeListener','length','whatsappInteraction:','save','remove'];(function(_0x547640,_0x579b2a){var _0x481c2a=function(_0x4a972f){while(--_0x4a972f){_0x547640['push'](_0x547640['shift']());}};_0x481c2a(++_0x579b2a);}(_0x8a15,0xd0));var _0x58a1=function(_0x4413a1,_0x55a868){_0x4413a1=_0x4413a1-0x0;var _0x184cf3=_0x8a15[_0x4413a1];return _0x184cf3;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x58a1('0x0'),_0x58a1('0x1'),_0x58a1('0x2')];function createListener(_0x4e6bc7,_0x17da95){return function(_0x37ca08){_0x17da95[_0x58a1('0x3')](_0x4e6bc7,_0x37ca08);};}function removeListener(_0x3461b7,_0x5ce80c){return function(){WhatsappInteractionEvents[_0x58a1('0x4')](_0x3461b7,_0x5ce80c);};}exports['register']=function(_0x16b160){for(var _0x383113=0x0,_0x3d88a=events[_0x58a1('0x5')];_0x383113<_0x3d88a;_0x383113++){var _0x26ff74=events[_0x383113];var _0x160699=createListener(_0x58a1('0x6')+_0x26ff74,_0x16b160);WhatsappInteractionEvents['on'](_0x26ff74,_0x160699);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 561bca8..1466569 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 _0x09d1=['tracked','whatsappmessage:create','create','post','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/:id','show'];(function(_0x644ecd,_0x397f36){var _0x1c66ce=function(_0x4cf42b){while(--_0x4cf42b){_0x644ecd['push'](_0x644ecd['shift']());}};_0x1c66ce(++_0x397f36);}(_0x09d1,0x95));var _0x109d=function(_0x2b0170,_0x3514ee){_0x2b0170=_0x2b0170-0x0;var _0x3167db=_0x09d1[_0x2b0170];return _0x3167db;};'use strict';var multer=require(_0x109d('0x0'));var util=require(_0x109d('0x1'));var path=require(_0x109d('0x2'));var timeout=require(_0x109d('0x3'));var express=require(_0x109d('0x4'));var router=express['Router']();var fs_extra=require(_0x109d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x109d('0x6'));var config=require(_0x109d('0x7'));var controller=require(_0x109d('0x8'));router[_0x109d('0x9')]('/',auth[_0x109d('0xa')](),controller['index']);router[_0x109d('0x9')]('/describe',auth[_0x109d('0xa')](),controller['describe']);router[_0x109d('0x9')](_0x109d('0xb'),auth[_0x109d('0xa')](),controller[_0x109d('0xc')]);router['post']('/',auth[_0x109d('0xa')](),interaction[_0x109d('0xd')]('whatsapp',_0x109d('0xe')),controller[_0x109d('0xf')]);router[_0x109d('0x10')](_0x109d('0x11'),controller['status']);router[_0x109d('0x12')](_0x109d('0xb'),auth[_0x109d('0xa')](),controller[_0x109d('0x13')]);router[_0x109d('0x12')](_0x109d('0x14'),auth['isAuthenticated'](),controller[_0x109d('0x15')]);router[_0x109d('0x12')](_0x109d('0x16'),auth[_0x109d('0xa')](),controller[_0x109d('0x17')]);router[_0x109d('0x18')]('/:id',auth[_0x109d('0xa')](),controller[_0x109d('0x19')]);module[_0x109d('0x1a')]=router; \ No newline at end of file +var _0xb013=['fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x2b0352,_0x11756b){var _0x3e2a75=function(_0x226284){while(--_0x226284){_0x2b0352['push'](_0x2b0352['shift']());}};_0x3e2a75(++_0x11756b);}(_0xb013,0x11b));var _0x3b01=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb013[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3b01('0x0'));var util=require(_0x3b01('0x1'));var path=require(_0x3b01('0x2'));var timeout=require(_0x3b01('0x3'));var express=require('express');var router=express[_0x3b01('0x4')]();var fs_extra=require(_0x3b01('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3b01('0x6'));var config=require(_0x3b01('0x7'));var controller=require(_0x3b01('0x8'));router[_0x3b01('0x9')]('/',auth['isAuthenticated'](),controller[_0x3b01('0xa')]);router[_0x3b01('0x9')](_0x3b01('0xb'),auth[_0x3b01('0xc')](),controller[_0x3b01('0xd')]);router[_0x3b01('0x9')](_0x3b01('0xe'),auth['isAuthenticated'](),controller[_0x3b01('0xf')]);router[_0x3b01('0x10')]('/',auth[_0x3b01('0xc')](),interaction[_0x3b01('0x11')](_0x3b01('0x12'),_0x3b01('0x13')),controller[_0x3b01('0x14')]);router[_0x3b01('0x10')](_0x3b01('0x15'),controller[_0x3b01('0x16')]);router['put'](_0x3b01('0xe'),auth[_0x3b01('0xc')](),controller[_0x3b01('0x17')]);router[_0x3b01('0x18')](_0x3b01('0x19'),auth['isAuthenticated'](),controller[_0x3b01('0x1a')]);router[_0x3b01('0x18')](_0x3b01('0x1b'),auth['isAuthenticated'](),controller[_0x3b01('0x1c')]);router[_0x3b01('0x1d')](_0x3b01('0xe'),auth[_0x3b01('0xc')](),controller[_0x3b01('0x1e')]);module[_0x3b01('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 3b1aa93..ead8e1c 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 _0x12e8=['medium','BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x439aa2,_0x16f27c){var _0x110b71=function(_0x3cc859){while(--_0x3cc859){_0x439aa2['push'](_0x439aa2['shift']());}};_0x110b71(++_0x16f27c);}(_0x12e8,0x195));var _0x812e=function(_0x5bd2bf,_0x549ecf){_0x5bd2bf=_0x5bd2bf-0x0;var _0x3e037a=_0x12e8[_0x5bd2bf];return _0x3e037a;};'use strict';var Sequelize=require(_0x812e('0x0'));module[_0x812e('0x1')]={'body':{'type':Sequelize[_0x812e('0x2')](_0x812e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x812e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x812e('0x5')),'defaultValue':_0x812e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x812e('0x6')](0xbe)},'phone':{'type':Sequelize[_0x812e('0x6')]},'readAt':{'type':Sequelize[_0x812e('0x7')]},'secret':{'type':Sequelize[_0x812e('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x812e('0x6')]},'providerResponse':{'type':Sequelize[_0x812e('0x2')]}}; \ No newline at end of file +var _0xd16a=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1b3d60,_0x51583b){var _0x4abc3d=function(_0x5c9acb){while(--_0x5c9acb){_0x1b3d60['push'](_0x1b3d60['shift']());}};_0x4abc3d(++_0x51583b);}(_0xd16a,0x151));var _0xad16=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd16a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xad16('0x0'));module[_0xad16('0x1')]={'body':{'type':Sequelize[_0xad16('0x2')](_0xad16('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xad16('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xad16('0x5')]('in','out'),'defaultValue':_0xad16('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xad16('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xad16('0x8')]},'secret':{'type':Sequelize[_0xad16('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xad16('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ed1ad1a..91778c9 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 _0x242f=['WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','reject','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','create','body','find','destroy','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','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','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','fullname','interface','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','then','info','request\x20sent','debug'];(function(_0x3ce3d0,_0x597f99){var _0x23cbe9=function(_0x5dd39b){while(--_0x5dd39b){_0x3ce3d0['push'](_0x3ce3d0['shift']());}};_0x23cbe9(++_0x597f99);}(_0x242f,0x6d));var _0xf242=function(_0xba7840,_0x36fac8){_0xba7840=_0xba7840-0x0;var _0x532b9a=_0x242f[_0xba7840];return _0x532b9a;};'use strict';var emlformat=require(_0xf242('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf242('0x1'));var jsonpatch=require(_0xf242('0x2'));var rp=require(_0xf242('0x3'));var moment=require(_0xf242('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf242('0x5'));var util=require(_0xf242('0x6'));var path=require('path');var sox=require(_0xf242('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf242('0x8'));var _=require('lodash');var squel=require(_0xf242('0x9'));var crypto=require(_0xf242('0xa'));var jsforce=require(_0xf242('0xb'));var deskjs=require(_0xf242('0xc'));var toCsv=require(_0xf242('0xd'));var querystring=require(_0xf242('0xe'));var Papa=require(_0xf242('0xf'));var Redis=require(_0xf242('0x10'));var authService=require(_0xf242('0x11'));var qs=require(_0xf242('0x12'));var as=require(_0xf242('0x13'));var hardwareService=require(_0xf242('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf242('0x15'));var config=require(_0xf242('0x16'));var licenseUtil=require(_0xf242('0x17'));var db=require(_0xf242('0x18'))['db'];config[_0xf242('0x19')]=_[_0xf242('0x1a')](config['redis'],{'host':_0xf242('0x1b'),'port':0x18eb});var socket=require(_0xf242('0x1c'))(new Redis(config[_0xf242('0x19')]));require(_0xf242('0x1d'))[_0xf242('0x1e')](socket);var jayson=require(_0xf242('0x1f'));var client=jayson['client'][_0xf242('0x20')]({'port':0x232c});var client9002=jayson[_0xf242('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53eeb4,_0x470548,_0x406158,_0x4abbed){return new BPromise(function(_0x1975c7,_0x5409c6){var _0x5f195b=_0x4abbed||client;return _0x5f195b['request'](_0x53eeb4,_0x406158)[_0xf242('0x22')](function(_0x417bed){logger[_0xf242('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x470548,_0xf242('0x24'));logger[_0xf242('0x25')](_0xf242('0x26'),_0x470548,_0xf242('0x24'),JSON[_0xf242('0x27')](_0x417bed));if(_0x417bed[_0xf242('0x28')]){if(_0x417bed[_0xf242('0x28')][_0xf242('0x29')]===0x1f4){logger[_0xf242('0x28')](_0xf242('0x2a'),_0x470548,_0x417bed[_0xf242('0x28')][_0xf242('0x2b')]);return _0x5409c6(_0x417bed[_0xf242('0x28')][_0xf242('0x2b')]);}logger[_0xf242('0x28')](_0xf242('0x2a'),_0x470548,_0x417bed[_0xf242('0x28')][_0xf242('0x2b')]);return _0x1975c7(_0x417bed[_0xf242('0x28')][_0xf242('0x2b')]);}else{logger[_0xf242('0x23')](_0xf242('0x2a'),_0x470548,_0xf242('0x24'));_0x1975c7(_0x417bed['result'][_0xf242('0x2b')]);}})[_0xf242('0x2c')](function(_0x421140){logger[_0xf242('0x28')](_0xf242('0x2a'),_0x470548,_0x421140);_0x5409c6(_0x421140);});});}function respondWithStatusCode(_0x20df5f,_0x434b07){_0x434b07=_0x434b07||0xcc;return function(_0x1710ba){if(_0x1710ba){return _0x20df5f[_0xf242('0x2d')](_0x434b07);}return _0x20df5f['status'](_0x434b07)[_0xf242('0x2e')]();};}function respondWithResult(_0x1b3eab,_0x477c24){_0x477c24=_0x477c24||0xc8;return function(_0x33a891){if(_0x33a891){return _0x1b3eab['status'](_0x477c24)[_0xf242('0x2f')](_0x33a891);}};}function respondWithFilteredResult(_0xfe68ff,_0x240648){return function(_0x33afdd){if(_0x33afdd){var _0x296702=typeof _0x240648['offset']===_0xf242('0x30')&&typeof _0x240648[_0xf242('0x31')]==='undefined';var _0x4617f9=_0x33afdd[_0xf242('0x32')];var _0x4f5ad0=_0x296702?0x0:_0x240648[_0xf242('0x33')];var _0x2d4c77=_0x296702?_0x33afdd[_0xf242('0x32')]:_0x240648['offset']+_0x240648[_0xf242('0x31')];var _0x2039e9;if(_0x2d4c77>=_0x4617f9){_0x2d4c77=_0x4617f9;_0x2039e9=0xc8;}else{_0x2039e9=0xce;}_0xfe68ff['status'](_0x2039e9);return _0xfe68ff[_0xf242('0x34')](_0xf242('0x35'),_0x4f5ad0+'-'+_0x2d4c77+'/'+_0x4617f9)[_0xf242('0x2f')](_0x33afdd);}return null;};}function patchUpdates(_0x4d1777){return function(_0x1076c9){try{jsonpatch['apply'](_0x1076c9,_0x4d1777,!![]);}catch(_0x81d328){return BPromise[_0xf242('0x36')](_0x81d328);}return _0x1076c9['save']();};}function saveUpdates(_0x498829,_0x4dc597){return function(_0x186575){if(_0x186575){return _0x186575['update'](_0x498829)['then'](function(_0x587282){return _0x587282;});}return null;};}function removeEntity(_0x525d96,_0x377d3e){return function(_0x1e2bf2){if(_0x1e2bf2){return _0x1e2bf2['destroy']()[_0xf242('0x22')](function(){_0x525d96['status'](0xcc)[_0xf242('0x2e')]();});}};}function handleEntityNotFound(_0x30c4b1,_0x238239){return function(_0xd127af){if(!_0xd127af){_0x30c4b1[_0xf242('0x2d')](0x194);}return _0xd127af;};}function handleError(_0x35e837,_0x5bc530){_0x5bc530=_0x5bc530||0x1f4;return function(_0x302e7d){logger['error'](_0x302e7d[_0xf242('0x37')]);if(_0x302e7d['name']){delete _0x302e7d[_0xf242('0x38')];}_0x35e837['status'](_0x5bc530)[_0xf242('0x39')](_0x302e7d);};}exports[_0xf242('0x3a')]=function(_0x4074dc,_0x1b1c84){var _0x1bfc34={},_0x150a39={},_0x28cf02={'count':0x0,'rows':[]};var _0xf904e=_[_0xf242('0x3b')](db[_0xf242('0x3c')][_0xf242('0x3d')],function(_0x670a42){return{'name':_0x670a42[_0xf242('0x3e')],'type':_0x670a42[_0xf242('0x3f')][_0xf242('0x40')]};});_0x150a39[_0xf242('0x41')]=_[_0xf242('0x3b')](_0xf904e,'name');_0x150a39[_0xf242('0x42')]=_['keys'](_0x4074dc[_0xf242('0x42')]);_0x150a39[_0xf242('0x43')]=_[_0xf242('0x44')](_0x150a39['model'],_0x150a39[_0xf242('0x42')]);_0x1bfc34['attributes']=_[_0xf242('0x44')](_0x150a39[_0xf242('0x41')],qs[_0xf242('0x45')](_0x4074dc[_0xf242('0x42')][_0xf242('0x45')]));_0x1bfc34[_0xf242('0x46')]=_0x1bfc34[_0xf242('0x46')][_0xf242('0x47')]?_0x1bfc34['attributes']:_0x150a39[_0xf242('0x41')];if(!_0x4074dc[_0xf242('0x42')][_0xf242('0x48')](_0xf242('0x49'))){_0x1bfc34[_0xf242('0x31')]=qs['limit'](_0x4074dc[_0xf242('0x42')][_0xf242('0x31')]);_0x1bfc34['offset']=qs['offset'](_0x4074dc[_0xf242('0x42')]['offset']);}_0x1bfc34[_0xf242('0x4a')]=qs[_0xf242('0x4b')](_0x4074dc[_0xf242('0x42')][_0xf242('0x4b')]);_0x1bfc34[_0xf242('0x4c')]=qs[_0xf242('0x43')](_[_0xf242('0x4d')](_0x4074dc[_0xf242('0x42')],_0x150a39[_0xf242('0x43')]),_0xf904e);if(_0x4074dc[_0xf242('0x42')][_0xf242('0x4e')]){_0x1bfc34[_0xf242('0x4c')]=_[_0xf242('0x4f')](_0x1bfc34[_0xf242('0x4c')],{'$or':_[_0xf242('0x3b')](_0xf904e,function(_0x503682){if(_0x503682[_0xf242('0x3f')]!=='VIRTUAL'){var _0x280e3b={};_0x280e3b[_0x503682[_0xf242('0x38')]]={'$like':'%'+_0x4074dc['query'][_0xf242('0x4e')]+'%'};return _0x280e3b;}})});}_0x1bfc34=_['merge']({},_0x1bfc34,_0x4074dc[_0xf242('0x50')]);var _0x4c998e={'where':_0x1bfc34[_0xf242('0x4c')]};return db[_0xf242('0x3c')][_0xf242('0x32')](_0x4c998e)[_0xf242('0x22')](function(_0xb9ebb3){_0x28cf02[_0xf242('0x32')]=_0xb9ebb3;if(_0x4074dc[_0xf242('0x42')][_0xf242('0x51')]){_0x1bfc34[_0xf242('0x52')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xf242('0x53')](_0x1bfc34);})[_0xf242('0x22')](function(_0x3240c7){_0x28cf02['rows']=_0x3240c7;return _0x28cf02;})['then'](respondWithFilteredResult(_0x1b1c84,_0x1bfc34))['catch'](handleError(_0x1b1c84,null));};exports[_0xf242('0x54')]=function(_0x48a035,_0xf79a1){var _0x2425e4={'raw':!![],'where':{'id':_0x48a035[_0xf242('0x55')]['id']}},_0x4ef93e={};_0x4ef93e[_0xf242('0x41')]=_[_0xf242('0x56')](db[_0xf242('0x3c')]['rawAttributes']);_0x4ef93e[_0xf242('0x42')]=_[_0xf242('0x56')](_0x48a035[_0xf242('0x42')]);_0x4ef93e[_0xf242('0x43')]=_[_0xf242('0x44')](_0x4ef93e[_0xf242('0x41')],_0x4ef93e['query']);_0x2425e4[_0xf242('0x46')]=_['intersection'](_0x4ef93e['model'],qs['fields'](_0x48a035[_0xf242('0x42')][_0xf242('0x45')]));_0x2425e4[_0xf242('0x46')]=_0x2425e4[_0xf242('0x46')][_0xf242('0x47')]?_0x2425e4['attributes']:_0x4ef93e[_0xf242('0x41')];if(_0x48a035['query'][_0xf242('0x51')]){_0x2425e4[_0xf242('0x52')]=[{'all':!![]}];}_0x2425e4=_['merge']({},_0x2425e4,_0x48a035['options']);return db[_0xf242('0x3c')]['find'](_0x2425e4)['then'](handleEntityNotFound(_0xf79a1,null))[_0xf242('0x22')](respondWithResult(_0xf79a1,null))[_0xf242('0x2c')](handleError(_0xf79a1,null));};exports['create']=function(_0x2c8e5d,_0x54c411){return db[_0xf242('0x3c')][_0xf242('0x57')](_0x2c8e5d[_0xf242('0x58')],{})[_0xf242('0x22')](respondWithResult(_0x54c411,0xc9))[_0xf242('0x2c')](handleError(_0x54c411,null));};exports['update']=function(_0x496f62,_0x1967ed){if(_0x496f62[_0xf242('0x58')]['id']){delete _0x496f62[_0xf242('0x58')]['id'];}return db[_0xf242('0x3c')][_0xf242('0x59')]({'where':{'id':_0x496f62[_0xf242('0x55')]['id']}})['then'](handleEntityNotFound(_0x1967ed,null))['then'](saveUpdates(_0x496f62['body'],null))[_0xf242('0x22')](respondWithResult(_0x1967ed,null))['catch'](handleError(_0x1967ed,null));};exports[_0xf242('0x5a')]=function(_0x2b9132,_0x4de1b9){return db[_0xf242('0x3c')][_0xf242('0x59')]({'where':{'id':_0x2b9132[_0xf242('0x55')]['id']}})[_0xf242('0x22')](handleEntityNotFound(_0x4de1b9,null))[_0xf242('0x22')](removeEntity(_0x4de1b9,null))[_0xf242('0x2c')](handleError(_0x4de1b9,null));};exports[_0xf242('0x5b')]=function(_0x5d0c1,_0x42580a){return db[_0xf242('0x3c')]['describe']()['then'](respondWithResult(_0x42580a,null))[_0xf242('0x2c')](handleError(_0x42580a,null));};var interaction_log=require(_0xf242('0x5c'))(_0xf242('0x5d'));exports[_0xf242('0x5e')]=function(_0x48b657,_0x287bad,_0x54be1f){var _0x27efd9={'agent':{},'channel':_0xf242('0x5f')};if(_0x48b657[_0xf242('0x58')]['id']){delete _0x48b657[_0xf242('0x58')]['id'];}_0x48b657[_0xf242('0x58')][_0xf242('0x60')]=!![];_0x48b657[_0xf242('0x58')][_0xf242('0x61')]=moment()[_0xf242('0x62')](_0xf242('0x63'));_0x48b657[_0xf242('0x58')][_0xf242('0x64')]=_0x48b657[_0xf242('0x58')][_0xf242('0x64')]||_0x48b657[_0xf242('0x65')]['id'];_0x27efd9[_0xf242('0x66')]['id']=_0x48b657[_0xf242('0x58')][_0xf242('0x64')];return db[_0xf242('0x3c')][_0xf242('0x59')]({'where':{'id':_0x48b657[_0xf242('0x55')]['id'],'UserId':null}})[_0xf242('0x22')](handleEntityNotFound(_0x287bad,null))['then'](saveUpdates(_0x48b657[_0xf242('0x58')],null))[_0xf242('0x22')](function(_0x3656e1){if(_0x3656e1){_0x27efd9[_0xf242('0x2b')]=_0x3656e1[_0xf242('0x67')]({'plain':!![]});return db[_0xf242('0x68')][_0xf242('0x59')]({'where':{'id':_0x3656e1[_0xf242('0x69')]}});}return null;})[_0xf242('0x22')](handleEntityNotFound(_0x287bad,null))[_0xf242('0x22')](function(_0x110ac8){if(_0x110ac8){return _0x110ac8['update']({'UserId':_0x48b657[_0xf242('0x58')][_0xf242('0x64')],'read1stAt':_[_0xf242('0x6a')](_0x110ac8['read1stAt'])?moment()[_0xf242('0x62')](_0xf242('0x63')):undefined});}return null;})['then'](function(_0x179b88){if(_0x179b88){_0x27efd9[_0xf242('0x6b')]=_0x179b88[_0xf242('0x67')]({'plain':!![]});interaction_log[_0xf242('0x23')](_0xf242('0x6c'),_0x48b657[_0xf242('0x65')]['id'],_0x48b657[_0xf242('0x65')][_0xf242('0x38')],_0x48b657[_0xf242('0x65')]['role'],_0x27efd9[_0xf242('0x6b')]['id'],_0x48b657[_0xf242('0x58')]?JSON[_0xf242('0x27')](_0x48b657[_0xf242('0x58')]):_0xf242('0x6d'));return respondWithRpcPromise(_0xf242('0x6e'),_0xf242('0x6f'),_0x27efd9);}return null;})['then'](function(_0x1110b2){var _0x3f7256='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1110b2[_0xf242('0x2b')]['ContactId'];return db[_0xf242('0x70')][_0xf242('0x42')](_0x3f7256,{'type':db[_0xf242('0x71')][_0xf242('0x72')][_0xf242('0x73')],'raw':!![]})[_0xf242('0x22')](function(_0x1b9dc8){return _0x1b9dc8;});})[_0xf242('0x22')](function(_0x1f5d90){if(_0x1f5d90){_0x27efd9[_0xf242('0x2b')][_0xf242('0x74')]=_0x1f5d90[0x0];if(!_0x48b657[_0xf242('0x58')][_0xf242('0x64')])return;return db[_0xf242('0x75')][_0xf242('0x59')]({'where':{'id':_0x48b657[_0xf242('0x58')]['UserId'],'role':_0xf242('0x66')},'attributes':['id',_0xf242('0x38'),'fullname',_0xf242('0x76'),_0xf242('0x77')],'raw':!![]});}return null;})[_0xf242('0x22')](function(_0x2df131){if(!_0x2df131)return null;_0x27efd9['message']['agent']=_0x2df131;return _0x27efd9;})[_0xf242('0x22')](function(_0x5bf203){if(_0x5bf203){if(_0x48b657[_0xf242('0x58')][_0xf242('0x78')]){_0x27efd9['message']['interface']=util['format'](_0xf242('0x79'),_0x48b657[_0xf242('0x65')][_0xf242('0x38')]);_0x27efd9[_0xf242('0x2b')][_0xf242('0x7a')]=_0x27efd9[_0xf242('0x7a')];_0x27efd9[_0xf242('0x2b')][_0xf242('0x7b')]=_0x27efd9[_0xf242('0x7a')];_0x27efd9['message']['event']=_0xf242('0x5e');return respondWithRpcPromise('EventManager',_0xf242('0x7c'),{'event':_0xf242('0x7d'),'message':_0x27efd9[_0xf242('0x2b')]},client9002)['then'](function(){return _0x27efd9;});}return _0x27efd9;}return null;})['then'](respondWithResult(_0x287bad,null))[_0xf242('0x2c')](handleError(_0x287bad,null));};var interaction_log=require('../../config/logger')(_0xf242('0x5d'));exports[_0xf242('0x36')]=function(_0x59c0ed,_0x40a243,_0xcab383){var _0x1df906={'agent':{},'channel':_0xf242('0x5f')};if(_0x59c0ed['body']['id']){delete _0x59c0ed[_0xf242('0x58')]['id'];}_0x59c0ed[_0xf242('0x58')][_0xf242('0x64')]=_0x59c0ed[_0xf242('0x58')][_0xf242('0x64')]||_0x59c0ed[_0xf242('0x65')]['id'];_0x1df906[_0xf242('0x66')]['id']=_0x59c0ed[_0xf242('0x58')][_0xf242('0x64')];return db['WhatsappMessage'][_0xf242('0x59')]({'where':{'id':_0x59c0ed[_0xf242('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x40a243,null))[_0xf242('0x22')](function(_0x4ce10c){if(_0x4ce10c){_0x1df906['message']=_0x4ce10c['get']({'plain':!![]});return db['WhatsappInteraction'][_0xf242('0x59')]({'where':{'id':_0x4ce10c[_0xf242('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x40a243,null))[_0xf242('0x22')](function(_0x501c76){if(_0x501c76){_0x1df906[_0xf242('0x6b')]=_0x501c76[_0xf242('0x67')]({'plain':!![]});interaction_log[_0xf242('0x23')](_0xf242('0x7e'),_0x59c0ed[_0xf242('0x65')]['id'],_0x59c0ed[_0xf242('0x65')][_0xf242('0x38')],_0x59c0ed['user'][_0xf242('0x7f')],_0x1df906['interaction']['id'],_0x59c0ed[_0xf242('0x58')]?JSON['stringify'](_0x59c0ed[_0xf242('0x58')]):_0xf242('0x6d'));return respondWithRpcPromise(_0xf242('0x80'),_0xf242('0x81'),_0x1df906);}return null;})['then'](function(_0x4949f2){var _0x3d38dc=_0xf242('0x82')+_0x4949f2['message'][_0xf242('0x83')];return db['sequelize'][_0xf242('0x42')](_0x3d38dc,{'type':db[_0xf242('0x71')][_0xf242('0x72')][_0xf242('0x73')],'raw':!![]})[_0xf242('0x22')](function(_0x324974){return _0x324974;});})['then'](function(_0x5927d9){if(_0x5927d9){_0x1df906[_0xf242('0x2b')]['contact']=_0x5927d9[0x0];if(!_0x59c0ed[_0xf242('0x58')][_0xf242('0x64')])return;return db[_0xf242('0x75')]['find']({'where':{'id':_0x59c0ed[_0xf242('0x58')][_0xf242('0x64')],'role':_0xf242('0x66')},'attributes':['id',_0xf242('0x38'),_0xf242('0x84'),_0xf242('0x76'),'internal'],'raw':!![]});}return null;})[_0xf242('0x22')](function(_0x4f3b7c){if(!_0x4f3b7c)return null;_0x1df906[_0xf242('0x2b')][_0xf242('0x66')]=_0x4f3b7c;return _0x1df906;})['then'](function(_0x5eeb75){if(_0x5eeb75){_0x5eeb75[_0xf242('0x2b')][_0xf242('0x85')]=util[_0xf242('0x62')](_0xf242('0x79'),_0x59c0ed['user'][_0xf242('0x38')]);_0x5eeb75['message'][_0xf242('0x7a')]=_0x1df906['channel'];_0x5eeb75[_0xf242('0x2b')][_0xf242('0x7b')]=_0x1df906[_0xf242('0x7a')];_0x5eeb75[_0xf242('0x2b')][_0xf242('0x86')]=_0xf242('0x36');respondWithRpcPromise(_0xf242('0x7c'),'EventManager',{'event':_0xf242('0x87'),'message':_0x5eeb75[_0xf242('0x2b')]},client9002);return _0x1df906;}return null;})[_0xf242('0x22')](respondWithResult(_0x40a243,null))[_0xf242('0x2c')](handleError(_0x40a243,null));};exports['status']=function(_0x3c678a,_0x16308e,_0x3494f4){if(_0x3c678a[_0xf242('0x58')]['id']){delete _0x3c678a['body']['id'];}var _0x3d5fa5;return db[_0xf242('0x3c')][_0xf242('0x59')]({'where':{'id':_0x3c678a[_0xf242('0x55')]['id']}})[_0xf242('0x22')](handleEntityNotFound(_0x16308e,null))[_0xf242('0x22')](function(_0x2215ff){if(_0x2215ff){_0x3d5fa5=_0x2215ff;return db[_0xf242('0x88')][_0xf242('0x59')]({'where':{'id':_0x2215ff[_0xf242('0x89')]}});}})[_0xf242('0x22')](handleEntityNotFound(_0x16308e,null))[_0xf242('0x22')](function(_0x463db0){if(_0x463db0){logger['debug'](_0xf242('0x8a'),_0xf242('0x8b'),_0xf242('0x8c'),_0x463db0['type'],util['inspect'](_0x3c678a[_0xf242('0x58')],{'showHidden':![],'depth':null}));switch(_0x463db0[_0xf242('0x3f')]){case _0xf242('0x8d'):if(_0x3c678a[_0xf242('0x58')][_0xf242('0x8e')]&&_0x3c678a['body'][_0xf242('0x8e')]===_0x3d5fa5[_0xf242('0x8f')]&&_0x3c678a[_0xf242('0x58')][_0xf242('0x90')]&&_0x3c678a[_0xf242('0x58')][_0xf242('0x90')]===_0xf242('0x60')){return _0x3d5fa5['update']({'read':!![]});}else{logger[_0xf242('0x28')](_0xf242('0x91'),_0xf242('0x8b'),_0xf242('0x8d'),util[_0xf242('0x92')](_0x3c678a[_0xf242('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3d5fa5;}})[_0xf242('0x22')](respondWithResult(_0x16308e,null))['catch'](handleError(_0x16308e,null));}; \ No newline at end of file +var _0xf025=['../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','end','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','length','find','create','params','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','get','[WHATSAPPMESSAGE: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','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x589002,_0x1c9c42){var _0x1ebe5a=function(_0x7f9547){while(--_0x7f9547){_0x589002['push'](_0x589002['shift']());}};_0x1ebe5a(++_0x1c9c42);}(_0xf025,0x17f));var _0x5f02=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0xf025[_0x4fbb15];return _0x436338;};'use strict';var emlformat=require(_0x5f02('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f02('0x1'));var rp=require(_0x5f02('0x2'));var moment=require(_0x5f02('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5f02('0x4'));var path=require(_0x5f02('0x5'));var sox=require('sox');var csv=require(_0x5f02('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f02('0x7'));var squel=require(_0x5f02('0x8'));var crypto=require(_0x5f02('0x9'));var jsforce=require(_0x5f02('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5f02('0x6'));var querystring=require('querystring');var Papa=require(_0x5f02('0xb'));var Redis=require(_0x5f02('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5f02('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f02('0xe'))('api');var utils=require(_0x5f02('0xf'));var config=require(_0x5f02('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f02('0x11'))['db'];config[_0x5f02('0x12')]=_[_0x5f02('0x13')](config[_0x5f02('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x5f02('0x14'))(new Redis(config[_0x5f02('0x12')]));require(_0x5f02('0x15'))[_0x5f02('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5f02('0x17')][_0x5f02('0x18')]({'port':0x232c});var client9002=jayson[_0x5f02('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31bcb0,_0x12cea2,_0x2fcecc,_0x4391f6){return new BPromise(function(_0x249b10,_0x2e5f6b){var _0x4c87f1=_0x4391f6||client;return _0x4c87f1[_0x5f02('0x19')](_0x31bcb0,_0x2fcecc)[_0x5f02('0x1a')](function(_0xe4c8a5){logger[_0x5f02('0x1b')](_0x5f02('0x1c'),_0x12cea2,_0x5f02('0x1d'));logger['debug'](_0x5f02('0x1e'),_0x12cea2,'request\x20sent',JSON[_0x5f02('0x1f')](_0xe4c8a5));if(_0xe4c8a5[_0x5f02('0x20')]){if(_0xe4c8a5['error']['code']===0x1f4){logger[_0x5f02('0x20')](_0x5f02('0x1c'),_0x12cea2,_0xe4c8a5[_0x5f02('0x20')][_0x5f02('0x21')]);return _0x2e5f6b(_0xe4c8a5[_0x5f02('0x20')]['message']);}logger[_0x5f02('0x20')](_0x5f02('0x1c'),_0x12cea2,_0xe4c8a5[_0x5f02('0x20')][_0x5f02('0x21')]);return _0x249b10(_0xe4c8a5['error'][_0x5f02('0x21')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x12cea2,_0x5f02('0x1d'));_0x249b10(_0xe4c8a5['result'][_0x5f02('0x21')]);}})[_0x5f02('0x22')](function(_0x4b7ed5){logger['error'](_0x5f02('0x1c'),_0x12cea2,_0x4b7ed5);_0x2e5f6b(_0x4b7ed5);});});}function respondWithStatusCode(_0x46d1f0,_0x225d04){_0x225d04=_0x225d04||0xcc;return function(_0x1fec38){if(_0x1fec38){return _0x46d1f0[_0x5f02('0x23')](_0x225d04);}return _0x46d1f0[_0x5f02('0x24')](_0x225d04)['end']();};}function respondWithResult(_0x447651,_0x3544c3){_0x3544c3=_0x3544c3||0xc8;return function(_0x20b841){if(_0x20b841){return _0x447651[_0x5f02('0x24')](_0x3544c3)[_0x5f02('0x25')](_0x20b841);}};}function respondWithFilteredResult(_0x187e4e,_0x537503){return function(_0x416789){if(_0x416789){var _0x37f5ed=typeof _0x537503[_0x5f02('0x26')]==='undefined'&&typeof _0x537503['limit']===_0x5f02('0x27');var _0x374c1e=_0x416789[_0x5f02('0x28')];var _0x11a250=_0x37f5ed?0x0:_0x537503[_0x5f02('0x26')];var _0x2a792a=_0x37f5ed?_0x416789[_0x5f02('0x28')]:_0x537503[_0x5f02('0x26')]+_0x537503[_0x5f02('0x29')];var _0x4e3b20;if(_0x2a792a>=_0x374c1e){_0x2a792a=_0x374c1e;_0x4e3b20=0xc8;}else{_0x4e3b20=0xce;}_0x187e4e[_0x5f02('0x24')](_0x4e3b20);return _0x187e4e[_0x5f02('0x2a')](_0x5f02('0x2b'),_0x11a250+'-'+_0x2a792a+'/'+_0x374c1e)[_0x5f02('0x25')](_0x416789);}return null;};}function patchUpdates(_0x557671){return function(_0x2753e9){try{jsonpatch['apply'](_0x2753e9,_0x557671,!![]);}catch(_0x40d13e){return BPromise['reject'](_0x40d13e);}return _0x2753e9['save']();};}function saveUpdates(_0x3a392e,_0x1b2492){return function(_0x5adb09){if(_0x5adb09){return _0x5adb09[_0x5f02('0x2c')](_0x3a392e)[_0x5f02('0x1a')](function(_0x37023e){return _0x37023e;});}return null;};}function removeEntity(_0x3ccef7,_0x2142e2){return function(_0x55fecb){if(_0x55fecb){return _0x55fecb['destroy']()[_0x5f02('0x1a')](function(){_0x3ccef7[_0x5f02('0x24')](0xcc)[_0x5f02('0x2d')]();});}};}function handleEntityNotFound(_0x36fea6,_0x370c28){return function(_0x27418c){if(!_0x27418c){_0x36fea6[_0x5f02('0x23')](0x194);}return _0x27418c;};}function handleError(_0x7145e3,_0xf8be88){_0xf8be88=_0xf8be88||0x1f4;return function(_0x5811d7){logger[_0x5f02('0x20')](_0x5811d7[_0x5f02('0x2e')]);if(_0x5811d7[_0x5f02('0x2f')]){delete _0x5811d7[_0x5f02('0x2f')];}_0x7145e3[_0x5f02('0x24')](_0xf8be88)[_0x5f02('0x30')](_0x5811d7);};}exports['index']=function(_0x2f31a2,_0x4e33ef){var _0x489072={},_0x489774={},_0xe97ac2={'count':0x0,'rows':[]};var _0x1dcebf=_[_0x5f02('0x31')](db[_0x5f02('0x32')][_0x5f02('0x33')],function(_0x2fcd02){return{'name':_0x2fcd02[_0x5f02('0x34')],'type':_0x2fcd02['type']['key']};});_0x489774[_0x5f02('0x35')]=_['map'](_0x1dcebf,_0x5f02('0x2f'));_0x489774[_0x5f02('0x36')]=_[_0x5f02('0x37')](_0x2f31a2[_0x5f02('0x36')]);_0x489774['filters']=_[_0x5f02('0x38')](_0x489774[_0x5f02('0x35')],_0x489774['query']);_0x489072[_0x5f02('0x39')]=_[_0x5f02('0x38')](_0x489774[_0x5f02('0x35')],qs[_0x5f02('0x3a')](_0x2f31a2['query'][_0x5f02('0x3a')]));_0x489072[_0x5f02('0x39')]=_0x489072[_0x5f02('0x39')]['length']?_0x489072[_0x5f02('0x39')]:_0x489774[_0x5f02('0x35')];if(!_0x2f31a2['query'][_0x5f02('0x3b')](_0x5f02('0x3c'))){_0x489072[_0x5f02('0x29')]=qs[_0x5f02('0x29')](_0x2f31a2['query'][_0x5f02('0x29')]);_0x489072['offset']=qs[_0x5f02('0x26')](_0x2f31a2[_0x5f02('0x36')]['offset']);}_0x489072[_0x5f02('0x3d')]=qs[_0x5f02('0x3e')](_0x2f31a2[_0x5f02('0x36')][_0x5f02('0x3e')]);_0x489072['where']=qs['filters'](_[_0x5f02('0x3f')](_0x2f31a2['query'],_0x489774['filters']),_0x1dcebf);if(_0x2f31a2['query'][_0x5f02('0x40')]){_0x489072[_0x5f02('0x41')]=_['merge'](_0x489072[_0x5f02('0x41')],{'$or':_[_0x5f02('0x31')](_0x1dcebf,function(_0x1e2560){if(_0x1e2560[_0x5f02('0x42')]!==_0x5f02('0x43')){var _0x1d1815={};_0x1d1815[_0x1e2560[_0x5f02('0x2f')]]={'$like':'%'+_0x2f31a2['query'][_0x5f02('0x40')]+'%'};return _0x1d1815;}})});}_0x489072=_[_0x5f02('0x44')]({},_0x489072,_0x2f31a2[_0x5f02('0x45')]);var _0x158528={'where':_0x489072[_0x5f02('0x41')]};return db[_0x5f02('0x32')][_0x5f02('0x28')](_0x158528)['then'](function(_0x15cd74){_0xe97ac2['count']=_0x15cd74;if(_0x2f31a2[_0x5f02('0x36')][_0x5f02('0x46')]){_0x489072[_0x5f02('0x47')]=[{'all':!![]}];}return db[_0x5f02('0x32')][_0x5f02('0x48')](_0x489072);})[_0x5f02('0x1a')](function(_0x2482c8){_0xe97ac2[_0x5f02('0x49')]=_0x2482c8;return _0xe97ac2;})[_0x5f02('0x1a')](respondWithFilteredResult(_0x4e33ef,_0x489072))[_0x5f02('0x22')](handleError(_0x4e33ef,null));};exports[_0x5f02('0x4a')]=function(_0x2aca96,_0x53c2cf){var _0x5efaf9={'raw':!![],'where':{'id':_0x2aca96['params']['id']}},_0x3e6b3f={};_0x3e6b3f[_0x5f02('0x35')]=_[_0x5f02('0x37')](db[_0x5f02('0x32')][_0x5f02('0x33')]);_0x3e6b3f[_0x5f02('0x36')]=_[_0x5f02('0x37')](_0x2aca96[_0x5f02('0x36')]);_0x3e6b3f['filters']=_[_0x5f02('0x38')](_0x3e6b3f[_0x5f02('0x35')],_0x3e6b3f[_0x5f02('0x36')]);_0x5efaf9['attributes']=_[_0x5f02('0x38')](_0x3e6b3f[_0x5f02('0x35')],qs['fields'](_0x2aca96['query'][_0x5f02('0x3a')]));_0x5efaf9[_0x5f02('0x39')]=_0x5efaf9[_0x5f02('0x39')][_0x5f02('0x4b')]?_0x5efaf9['attributes']:_0x3e6b3f[_0x5f02('0x35')];if(_0x2aca96[_0x5f02('0x36')][_0x5f02('0x46')]){_0x5efaf9[_0x5f02('0x47')]=[{'all':!![]}];}_0x5efaf9=_[_0x5f02('0x44')]({},_0x5efaf9,_0x2aca96[_0x5f02('0x45')]);return db[_0x5f02('0x32')][_0x5f02('0x4c')](_0x5efaf9)[_0x5f02('0x1a')](handleEntityNotFound(_0x53c2cf,null))[_0x5f02('0x1a')](respondWithResult(_0x53c2cf,null))[_0x5f02('0x22')](handleError(_0x53c2cf,null));};exports[_0x5f02('0x4d')]=function(_0x3f8f4b,_0x57be5c){return db[_0x5f02('0x32')]['create'](_0x3f8f4b['body'],{})[_0x5f02('0x1a')](respondWithResult(_0x57be5c,0xc9))[_0x5f02('0x22')](handleError(_0x57be5c,null));};exports['update']=function(_0x20009f,_0x31bc70){if(_0x20009f['body']['id']){delete _0x20009f['body']['id'];}return db[_0x5f02('0x32')][_0x5f02('0x4c')]({'where':{'id':_0x20009f[_0x5f02('0x4e')]['id']}})[_0x5f02('0x1a')](handleEntityNotFound(_0x31bc70,null))[_0x5f02('0x1a')](saveUpdates(_0x20009f[_0x5f02('0x4f')],null))[_0x5f02('0x1a')](respondWithResult(_0x31bc70,null))[_0x5f02('0x22')](handleError(_0x31bc70,null));};exports['destroy']=function(_0x5d0416,_0x3d55c2){return db['WhatsappMessage']['find']({'where':{'id':_0x5d0416[_0x5f02('0x4e')]['id']}})[_0x5f02('0x1a')](handleEntityNotFound(_0x3d55c2,null))[_0x5f02('0x1a')](removeEntity(_0x3d55c2,null))[_0x5f02('0x22')](handleError(_0x3d55c2,null));};exports['describe']=function(_0x5970e4,_0x2433b8){return db[_0x5f02('0x32')][_0x5f02('0x50')]()[_0x5f02('0x1a')](respondWithResult(_0x2433b8,null))[_0x5f02('0x22')](handleError(_0x2433b8,null));};var interaction_log=require(_0x5f02('0xe'))(_0x5f02('0x51'));exports[_0x5f02('0x52')]=function(_0x129bcf,_0x3166f,_0x3f1280){var _0x228f2c={'agent':{},'channel':_0x5f02('0x53')};if(_0x129bcf[_0x5f02('0x4f')]['id']){delete _0x129bcf[_0x5f02('0x4f')]['id'];}_0x129bcf['body'][_0x5f02('0x54')]=!![];_0x129bcf[_0x5f02('0x4f')][_0x5f02('0x55')]=moment()['format'](_0x5f02('0x56'));_0x129bcf[_0x5f02('0x4f')][_0x5f02('0x57')]=_0x129bcf['body'][_0x5f02('0x57')]||_0x129bcf[_0x5f02('0x58')]['id'];_0x228f2c[_0x5f02('0x59')]['id']=_0x129bcf[_0x5f02('0x4f')][_0x5f02('0x57')];return db[_0x5f02('0x32')][_0x5f02('0x4c')]({'where':{'id':_0x129bcf[_0x5f02('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3166f,null))['then'](saveUpdates(_0x129bcf[_0x5f02('0x4f')],null))['then'](function(_0x5e16d0){if(_0x5e16d0){_0x228f2c[_0x5f02('0x21')]=_0x5e16d0['get']({'plain':!![]});return db[_0x5f02('0x5a')]['find']({'where':{'id':_0x5e16d0[_0x5f02('0x5b')]}});}return null;})[_0x5f02('0x1a')](handleEntityNotFound(_0x3166f,null))[_0x5f02('0x1a')](function(_0x917287){if(_0x917287){return _0x917287['update']({'UserId':_0x129bcf[_0x5f02('0x4f')][_0x5f02('0x57')],'read1stAt':_[_0x5f02('0x5c')](_0x917287[_0x5f02('0x5d')])?moment()[_0x5f02('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x44aab9){if(_0x44aab9){_0x228f2c[_0x5f02('0x5f')]=_0x44aab9[_0x5f02('0x60')]({'plain':!![]});interaction_log[_0x5f02('0x1b')](_0x5f02('0x61'),_0x129bcf[_0x5f02('0x58')]['id'],_0x129bcf['user']['name'],_0x129bcf[_0x5f02('0x58')][_0x5f02('0x62')],_0x228f2c[_0x5f02('0x5f')]['id'],_0x129bcf[_0x5f02('0x4f')]?JSON[_0x5f02('0x1f')](_0x129bcf['body']):_0x5f02('0x63'));return respondWithRpcPromise(_0x5f02('0x64'),'acceptMessage',_0x228f2c);}return null;})[_0x5f02('0x1a')](function(_0x49d449){var _0x5c0591=_0x5f02('0x65')+_0x49d449['message'][_0x5f02('0x66')];return db[_0x5f02('0x67')][_0x5f02('0x36')](_0x5c0591,{'type':db[_0x5f02('0x68')][_0x5f02('0x69')][_0x5f02('0x6a')],'raw':!![]})[_0x5f02('0x1a')](function(_0x214f90){return _0x214f90;});})[_0x5f02('0x1a')](function(_0x2e5fd6){if(_0x2e5fd6){_0x228f2c[_0x5f02('0x21')][_0x5f02('0x6b')]=_0x2e5fd6[0x0];if(!_0x129bcf[_0x5f02('0x4f')][_0x5f02('0x57')])return;return db[_0x5f02('0x6c')][_0x5f02('0x4c')]({'where':{'id':_0x129bcf[_0x5f02('0x4f')][_0x5f02('0x57')],'role':_0x5f02('0x59')},'attributes':['id',_0x5f02('0x2f'),_0x5f02('0x6d'),_0x5f02('0x6e'),_0x5f02('0x6f')],'raw':!![]});}return null;})['then'](function(_0x3b911c){if(!_0x3b911c)return null;_0x228f2c[_0x5f02('0x21')][_0x5f02('0x59')]=_0x3b911c;return _0x228f2c;})[_0x5f02('0x1a')](function(_0x46ee41){if(_0x46ee41){if(_0x129bcf[_0x5f02('0x4f')][_0x5f02('0x70')]){_0x228f2c['message']['interface']=util['format']('SIP/%s',_0x129bcf['user'][_0x5f02('0x2f')]);_0x228f2c['message'][_0x5f02('0x71')]=_0x228f2c[_0x5f02('0x71')];_0x228f2c['message'][_0x5f02('0x72')]=_0x228f2c['channel'];_0x228f2c['message'][_0x5f02('0x73')]=_0x5f02('0x52');return respondWithRpcPromise(_0x5f02('0x74'),_0x5f02('0x74'),{'event':_0x5f02('0x75'),'message':_0x228f2c[_0x5f02('0x21')]},client9002)['then'](function(){return _0x228f2c;});}return _0x228f2c;}return null;})[_0x5f02('0x1a')](respondWithResult(_0x3166f,null))[_0x5f02('0x22')](handleError(_0x3166f,null));};var interaction_log=require(_0x5f02('0xe'))(_0x5f02('0x51'));exports[_0x5f02('0x76')]=function(_0x155ac8,_0x14da0b,_0x3c3a54){var _0x4dc5aa={'agent':{},'channel':_0x5f02('0x53')};if(_0x155ac8[_0x5f02('0x4f')]['id']){delete _0x155ac8['body']['id'];}_0x155ac8[_0x5f02('0x4f')][_0x5f02('0x57')]=_0x155ac8['body'][_0x5f02('0x57')]||_0x155ac8[_0x5f02('0x58')]['id'];_0x4dc5aa['agent']['id']=_0x155ac8['body']['UserId'];return db['WhatsappMessage'][_0x5f02('0x4c')]({'where':{'id':_0x155ac8[_0x5f02('0x4e')]['id'],'UserId':null}})[_0x5f02('0x1a')](handleEntityNotFound(_0x14da0b,null))[_0x5f02('0x1a')](function(_0x25d4f7){if(_0x25d4f7){_0x4dc5aa[_0x5f02('0x21')]=_0x25d4f7[_0x5f02('0x60')]({'plain':!![]});return db[_0x5f02('0x5a')]['find']({'where':{'id':_0x25d4f7[_0x5f02('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x14da0b,null))['then'](function(_0x18755c){if(_0x18755c){_0x4dc5aa[_0x5f02('0x5f')]=_0x18755c['get']({'plain':!![]});interaction_log[_0x5f02('0x1b')](_0x5f02('0x77'),_0x155ac8['user']['id'],_0x155ac8[_0x5f02('0x58')][_0x5f02('0x2f')],_0x155ac8[_0x5f02('0x58')][_0x5f02('0x62')],_0x4dc5aa['interaction']['id'],_0x155ac8['body']?JSON[_0x5f02('0x1f')](_0x155ac8[_0x5f02('0x4f')]):_0x5f02('0x63'));return respondWithRpcPromise(_0x5f02('0x78'),_0x5f02('0x79'),_0x4dc5aa);}return null;})[_0x5f02('0x1a')](function(_0x24b95c){var _0x225627='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x24b95c['message'][_0x5f02('0x66')];return db['sequelize'][_0x5f02('0x36')](_0x225627,{'type':db[_0x5f02('0x68')]['QueryTypes'][_0x5f02('0x6a')],'raw':!![]})[_0x5f02('0x1a')](function(_0xf1af2f){return _0xf1af2f;});})[_0x5f02('0x1a')](function(_0x47d9eb){if(_0x47d9eb){_0x4dc5aa['message']['contact']=_0x47d9eb[0x0];if(!_0x155ac8[_0x5f02('0x4f')]['UserId'])return;return db[_0x5f02('0x6c')][_0x5f02('0x4c')]({'where':{'id':_0x155ac8[_0x5f02('0x4f')]['UserId'],'role':_0x5f02('0x59')},'attributes':['id','name','fullname',_0x5f02('0x6e'),_0x5f02('0x6f')],'raw':!![]});}return null;})[_0x5f02('0x1a')](function(_0x71e80c){if(!_0x71e80c)return null;_0x4dc5aa[_0x5f02('0x21')]['agent']=_0x71e80c;return _0x4dc5aa;})[_0x5f02('0x1a')](function(_0x3fce64){if(_0x3fce64){_0x3fce64[_0x5f02('0x21')]['interface']=util['format'](_0x5f02('0x7a'),_0x155ac8[_0x5f02('0x58')][_0x5f02('0x2f')]);_0x3fce64[_0x5f02('0x21')][_0x5f02('0x71')]=_0x4dc5aa[_0x5f02('0x71')];_0x3fce64[_0x5f02('0x21')][_0x5f02('0x72')]=_0x4dc5aa[_0x5f02('0x71')];_0x3fce64[_0x5f02('0x21')][_0x5f02('0x73')]=_0x5f02('0x76');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x3fce64[_0x5f02('0x21')]},client9002);return _0x4dc5aa;}return null;})['then'](respondWithResult(_0x14da0b,null))['catch'](handleError(_0x14da0b,null));};exports[_0x5f02('0x24')]=function(_0x51daa9,_0x2ec1f7,_0x3ccbee){if(_0x51daa9['body']['id']){delete _0x51daa9['body']['id'];}var _0x9ee2a4;return db[_0x5f02('0x32')][_0x5f02('0x4c')]({'where':{'id':_0x51daa9[_0x5f02('0x4e')]['id']}})[_0x5f02('0x1a')](handleEntityNotFound(_0x2ec1f7,null))[_0x5f02('0x1a')](function(_0x3162dc){if(_0x3162dc){_0x9ee2a4=_0x3162dc;return db[_0x5f02('0x7b')][_0x5f02('0x4c')]({'where':{'id':_0x3162dc[_0x5f02('0x7c')]}});}})[_0x5f02('0x1a')](handleEntityNotFound(_0x2ec1f7,null))['then'](function(_0x2a2473){if(_0x2a2473){logger[_0x5f02('0x7d')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x5f02('0x24'),_0x5f02('0x7e'),_0x2a2473[_0x5f02('0x42')],util[_0x5f02('0x7f')](_0x51daa9[_0x5f02('0x4f')],{'showHidden':![],'depth':null}));switch(_0x2a2473['type']){case'twilio':if(_0x51daa9[_0x5f02('0x4f')][_0x5f02('0x80')]&&_0x51daa9[_0x5f02('0x4f')][_0x5f02('0x80')]===_0x9ee2a4[_0x5f02('0x81')]&&_0x51daa9[_0x5f02('0x4f')]['MessageStatus']&&_0x51daa9['body'][_0x5f02('0x82')]==='read'){return _0x9ee2a4[_0x5f02('0x2c')]({'read':!![]});}else{logger['error'](_0x5f02('0x83'),'status',_0x5f02('0x84'),util[_0x5f02('0x7f')](_0x51daa9[_0x5f02('0x4f')],{'showHidden':![],'depth':null}));}break;}return _0x9ee2a4;}})['then'](respondWithResult(_0x2ec1f7,null))[_0x5f02('0x22')](handleError(_0x2ec1f7,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 3e8f8f2..3b8a075 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 _0x9c2c=['events','../../mysqldb','update','emit','hasOwnProperty','hook','exports'];(function(_0x112eb2,_0x369928){var _0x2ac36b=function(_0xbf3657){while(--_0xbf3657){_0x112eb2['push'](_0x112eb2['shift']());}};_0x2ac36b(++_0x369928);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc9c2('0x0'));var WhatsappMessage=require(_0xc9c2('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9c2('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3d0e43){return function(_0x14e513,_0x5bf334,_0x4db342){WhatsappMessageEvents[_0xc9c2('0x3')](_0x3d0e43+':'+_0x14e513['id'],_0x14e513);WhatsappMessageEvents['emit'](_0x3d0e43,_0x14e513);_0x4db342(null);};}for(var e in events){if(events[_0xc9c2('0x4')](e)){var event=events[e];WhatsappMessage[_0xc9c2('0x5')](e,emitEvent(event));}}module[_0xc9c2('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0xf45e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage'];(function(_0xba6447,_0x458f89){var _0x11e3ba=function(_0x4fe040){while(--_0x4fe040){_0xba6447['push'](_0xba6447['shift']());}};_0x11e3ba(++_0x458f89);}(_0xf45e,0x115));var _0xef45=function(_0x283448,_0x251f5e){_0x283448=_0x283448-0x0;var _0x481bcf=_0xf45e[_0x283448];return _0x481bcf;};'use strict';var EventEmitter=require(_0xef45('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xef45('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef45('0x2'),'afterUpdate':_0xef45('0x3'),'afterDestroy':_0xef45('0x4')};function emitEvent(_0x1e94ee){return function(_0x37772f,_0x8b048c,_0x3cd579){WhatsappMessageEvents[_0xef45('0x5')](_0x1e94ee+':'+_0x37772f['id'],_0x37772f);WhatsappMessageEvents[_0xef45('0x5')](_0x1e94ee,_0x37772f);_0x3cd579(null);};}for(var e in events){if(events[_0xef45('0x6')](e)){var event=events[e];WhatsappMessage[_0xef45('0x7')](e,emitEvent(event));}}module[_0xef45('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 9a50779..70c1b24 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 _0x98d5=['WhatsappAccountId','then','type','authToken','phone','accountSid','messages','create','whatsapp:','remote','/status?token=','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','message_id','statuses','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','update','createdAt','error','find'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x98d5,0x157));var _0x598d=function(_0x2e4c36,_0xcc49f6){_0x2e4c36=_0x2e4c36-0x0;var _0x5d71a0=_0x98d5[_0x2e4c36];return _0x5d71a0;};'use strict';var _=require(_0x598d('0x0'));var util=require(_0x598d('0x1'));var logger=require(_0x598d('0x2'))(_0x598d('0x3'));var moment=require(_0x598d('0x4'));var BPromise=require(_0x598d('0x5'));var rp=require(_0x598d('0x6'));var fetch=require(_0x598d('0x7'));var fs=require('fs');var path=require(_0x598d('0x8'));var rimraf=require('rimraf');var config=require(_0x598d('0x9'));var attributes=require(_0x598d('0xa'));module[_0x598d('0xb')]=function(_0x1e5ada,_0x36b2c9){return _0x1e5ada['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x598d('0xc'),'fields':[_0x598d('0xc')]},{'name':_0x598d('0xd'),'fields':[_0x598d('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c62d7,_0x55146d,_0xec0cb5){var _0x18df63=_0x1e5ada[_0x598d('0xf')];var _0x36a557=_0x1c62d7['get']({'plain':!![]});if(_0x36a557[_0x598d('0x10')]['toLowerCase']()==='in'||_0x36a557['direction'][_0x598d('0x11')]()===_0x598d('0x12')&&!_0x36a557[_0x598d('0x13')]&&!_[_0x598d('0x14')](_0x36a557[_0x598d('0x15')])){_0x18df63[_0x598d('0x16')][_0x598d('0x17')]({'where':{'id':_0x36a557['WhatsappInteractionId']}})['then'](function(_0xc2abea){if(_0xc2abea){_0xc2abea[_0x598d('0x18')]({'lastMsgAt':_0x36a557[_0x598d('0x19')],'lastMsgDirection':_0x36a557[_0x598d('0x10')][_0x598d('0x11')]()});}})['catch'](function(_0x31399a){console[_0x598d('0x1a')](_0x31399a);});}if(_0x36a557[_0x598d('0x10')]==='out'&&!_0x36a557[_0x598d('0x13')]){var _0x25a06c;_0x18df63['WhatsappAccount'][_0x598d('0x1b')]({'where':{'id':_0x36a557[_0x598d('0x1c')]},'raw':!![]})[_0x598d('0x1d')](function(_0x3ee609){_0x25a06c=_0x3ee609;if(_0x25a06c&&_0x25a06c[_0x598d('0x1e')]){switch(_0x25a06c[_0x598d('0x1e')]){case'twilio':var _0x33f68e=require('twilio');if(_0x25a06c['accountSid']&&_0x25a06c[_0x598d('0x1f')]&&_0x25a06c[_0x598d('0x20')]){var _0xe9eb0=new _0x33f68e(_0x25a06c[_0x598d('0x21')],_0x25a06c[_0x598d('0x1f')]);_0xe9eb0[_0x598d('0x22')][_0x598d('0x23')]({'body':_0x36a557[_0x598d('0xe')],'to':_0x598d('0x24')+_0x36a557['phone'],'from':_0x598d('0x24')+_0x25a06c[_0x598d('0x20')],'statusCallback':_0x25a06c[_0x598d('0x25')]+'/api/whatsapp/messages/'+_0x36a557['id']+_0x598d('0x26')+_0x25a06c['token']})[_0x598d('0x1d')](function(_0x4801ea){if(_0x4801ea[_0x598d('0x27')]){return _0x1c62d7['update']({'messageId':_0x4801ea[_0x598d('0x27')]});}})[_0x598d('0x28')](function(_0x437f1b){logger[_0x598d('0x1a')](_0x598d('0x29'),'afterCreate','twilio',util[_0x598d('0x2a')](_0x437f1b,{'showHidden':![],'depth':null}));});}else{logger[_0x598d('0x1a')](_0x598d('0x29'),'afterCreate','twilio',_0x598d('0x2b'));}break;case _0x598d('0x2c'):var _0x2c176f=_0x25a06c['accountSid'];var _0x592957=_0x25a06c['authToken'];var _0x260cfd=_0x25a06c['baseUrl']+_0x598d('0x2d')+_0x2c176f+_0x598d('0x2e');var _0x43fb37={'to':[_0x36a557[_0x598d('0x20')]],'message':{'type':_0x598d('0x2f'),'text':_0x36a557[_0x598d('0xe')]}};var _0x316a10={'method':'POST','uri':_0x260cfd,'headers':{'Authorization':_0x598d('0x30')+_0x592957,'Content-Type':_0x598d('0x31')},'body':_0x43fb37,'json':!![]};rp(_0x316a10)[_0x598d('0x1d')](function(_0x13df30){if(_0x13df30['statuses'][0x0][_0x598d('0x32')]){return _0x1c62d7[_0x598d('0x18')]({'messageId':_0x13df30[_0x598d('0x33')][0x0][_0x598d('0x32')]});}})[_0x598d('0x28')](function(_0x2e50be){logger['err']('WhatsappMessage,\x20%s',_0x2e50be);});break;}}})[_0x598d('0x34')](function(){_0xec0cb5();});}else{_0xec0cb5();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb770=['twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','then','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type'];(function(_0x4ed8a2,_0x9c29f7){var _0x1c81f4=function(_0x857247){while(--_0x857247){_0x4ed8a2['push'](_0x4ed8a2['shift']());}};_0x1c81f4(++_0x9c29f7);}(_0xb770,0x191));var _0x0b77=function(_0x1b128f,_0x368097){_0x1b128f=_0x1b128f-0x0;var _0x27fb39=_0xb770[_0x1b128f];return _0x27fb39;};'use strict';var _=require(_0x0b77('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0b77('0x1'));var moment=require(_0x0b77('0x2'));var BPromise=require(_0x0b77('0x3'));var rp=require(_0x0b77('0x4'));var fetch=require(_0x0b77('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b77('0x6'));var config=require(_0x0b77('0x7'));var attributes=require(_0x0b77('0x8'));module[_0x0b77('0x9')]=function(_0x562a26,_0x4ad389){return _0x562a26['define'](_0x0b77('0xa'),attributes,{'tableName':_0x0b77('0xb'),'paranoid':![],'indexes':[{'name':_0x0b77('0xc'),'fields':['messageId']},{'name':_0x0b77('0xd'),'fields':[_0x0b77('0xe')],'type':_0x0b77('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47c6ef,_0x4bd643,_0x2970b9){var _0x18a547=_0x562a26[_0x0b77('0x10')];var _0x5715ce=_0x47c6ef[_0x0b77('0x11')]({'plain':!![]});if(_0x5715ce[_0x0b77('0x12')][_0x0b77('0x13')]()==='in'||_0x5715ce[_0x0b77('0x12')][_0x0b77('0x13')]()===_0x0b77('0x14')&&!_0x5715ce[_0x0b77('0x15')]&&!_[_0x0b77('0x16')](_0x5715ce['UserId'])){_0x18a547[_0x0b77('0x17')][_0x0b77('0x18')]({'where':{'id':_0x5715ce['WhatsappInteractionId']}})[_0x0b77('0x19')](function(_0x570f96){if(_0x570f96){_0x570f96[_0x0b77('0x1a')]({'lastMsgAt':_0x5715ce[_0x0b77('0x1b')],'lastMsgDirection':_0x5715ce[_0x0b77('0x12')][_0x0b77('0x13')]()});}})['catch'](function(_0x42b3f2){console[_0x0b77('0x1c')](_0x42b3f2);});}if(_0x5715ce[_0x0b77('0x12')]===_0x0b77('0x14')&&!_0x5715ce['secret']){var _0x3c82f5;_0x18a547[_0x0b77('0x1d')][_0x0b77('0x1e')]({'where':{'id':_0x5715ce[_0x0b77('0x1f')]},'raw':!![]})[_0x0b77('0x19')](function(_0x49ff3f){_0x3c82f5=_0x49ff3f;if(_0x3c82f5&&_0x3c82f5['type']){switch(_0x3c82f5[_0x0b77('0x20')]){case _0x0b77('0x21'):var _0x2dc69d=require('twilio');if(_0x3c82f5[_0x0b77('0x22')]&&_0x3c82f5[_0x0b77('0x23')]&&_0x3c82f5[_0x0b77('0x24')]){var _0x5d5ead=new _0x2dc69d(_0x3c82f5['accountSid'],_0x3c82f5['authToken']);_0x5d5ead[_0x0b77('0x25')][_0x0b77('0x26')]({'body':_0x5715ce['body'],'to':_0x0b77('0x27')+_0x5715ce[_0x0b77('0x24')],'from':'whatsapp:'+_0x3c82f5['phone'],'statusCallback':_0x3c82f5[_0x0b77('0x28')]+_0x0b77('0x29')+_0x5715ce['id']+_0x0b77('0x2a')+_0x3c82f5[_0x0b77('0x2b')]})[_0x0b77('0x19')](function(_0x2e672e){if(_0x2e672e[_0x0b77('0x2c')]){return _0x47c6ef['update']({'messageId':_0x2e672e[_0x0b77('0x2c')]});}})[_0x0b77('0x2d')](function(_0x262a7c){logger[_0x0b77('0x1c')](_0x0b77('0x2e'),_0x0b77('0x2f'),'twilio',util['inspect'](_0x262a7c,{'showHidden':![],'depth':null}));});}else{logger[_0x0b77('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x0b77('0x2f'),_0x0b77('0x21'),_0x0b77('0x30'));}break;case _0x0b77('0x31'):var _0x3fef46=_0x3c82f5[_0x0b77('0x22')];var _0x3dae57=_0x3c82f5[_0x0b77('0x23')];var _0x4db804=_0x3c82f5['baseUrl']+_0x0b77('0x32')+_0x3fef46+_0x0b77('0x33');var _0x2230e4={'to':[_0x5715ce[_0x0b77('0x24')]],'message':{'type':_0x0b77('0x34'),'text':_0x5715ce['body']}};var _0x58f536={'method':_0x0b77('0x35'),'uri':_0x4db804,'headers':{'Authorization':_0x0b77('0x36')+_0x3dae57,'Content-Type':'application/json'},'body':_0x2230e4,'json':!![]};rp(_0x58f536)['then'](function(_0x2809e3){if(_0x2809e3[_0x0b77('0x37')][0x0][_0x0b77('0x38')]){return _0x47c6ef[_0x0b77('0x1a')]({'messageId':_0x2809e3[_0x0b77('0x37')][0x0][_0x0b77('0x38')]});}})[_0x0b77('0x2d')](function(_0x127f32){logger[_0x0b77('0x39')](_0x0b77('0x3a'),_0x127f32);});break;}}})[_0x0b77('0x3b')](function(){_0x2970b9();});}else{_0x2970b9();}}},'charset':_0x0b77('0x3c'),'collate':_0x0b77('0x3d')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 3387755..a3de38f 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 _0xad72=['request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','options','raw','CreateWhatsappMessage','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','WhatsappMessage,\x20%s,\x20%s'];(function(_0xa4cfa7,_0x178bec){var _0x5d4b96=function(_0x58f90a){while(--_0x58f90a){_0xa4cfa7['push'](_0xa4cfa7['shift']());}};_0x5d4b96(++_0x178bec);}(_0xad72,0xc8));var _0x2ad7=function(_0x2c46de,_0x3bf39c){_0x2c46de=_0x2c46de-0x0;var _0xeab943=_0xad72[_0x2c46de];return _0xeab943;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ad7('0x0'));var BPromise=require(_0x2ad7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ad7('0x2'));var db=require(_0x2ad7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ad7('0x4'))(_0x2ad7('0x5'));var config=require(_0x2ad7('0x6'));var jayson=require(_0x2ad7('0x7'));var client=jayson['client'][_0x2ad7('0x8')]({'port':0x232a});config[_0x2ad7('0x9')]=_[_0x2ad7('0xa')](config[_0x2ad7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ad7('0xb'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x2ad7('0xc')](socket);function respondWithRpcPromise(_0x545f9d,_0x14074b,_0x1a4a3b){return new BPromise(function(_0x173406,_0x518bc5){return client[_0x2ad7('0xd')](_0x545f9d,_0x1a4a3b)[_0x2ad7('0xe')](function(_0x44b0eb){logger['info'](_0x2ad7('0xf'),_0x14074b,_0x2ad7('0x10'));logger[_0x2ad7('0x11')](_0x2ad7('0x12'),_0x14074b,_0x2ad7('0x10'),JSON[_0x2ad7('0x13')](_0x44b0eb));if(_0x44b0eb[_0x2ad7('0x14')]){if(_0x44b0eb[_0x2ad7('0x14')][_0x2ad7('0x15')]===0x1f4){logger[_0x2ad7('0x14')](_0x2ad7('0xf'),_0x14074b,_0x44b0eb[_0x2ad7('0x14')][_0x2ad7('0x16')]);return _0x518bc5(_0x44b0eb[_0x2ad7('0x14')]['message']);}logger[_0x2ad7('0x14')](_0x2ad7('0xf'),_0x14074b,_0x44b0eb[_0x2ad7('0x14')][_0x2ad7('0x16')]);return _0x173406(_0x44b0eb[_0x2ad7('0x14')][_0x2ad7('0x16')]);}else{logger[_0x2ad7('0x17')](_0x2ad7('0xf'),_0x14074b,_0x2ad7('0x10'));_0x173406(_0x44b0eb['result']['message']);}})['catch'](function(_0x3183cd){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x14074b,_0x3183cd);_0x518bc5(_0x3183cd);});});}exports['CreateWhatsappMessage']=function(_0x21478c){var _0x1c8c1b=this;return new Promise(function(_0x369f11,_0x2b96d3){return db['WhatsappMessage']['create'](_0x21478c['body'],{'raw':_0x21478c[_0x2ad7('0x18')]?_0x21478c[_0x2ad7('0x18')][_0x2ad7('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x417b82){logger[_0x2ad7('0x17')]('CreateWhatsappMessage',_0x21478c);logger[_0x2ad7('0x11')](_0x2ad7('0x1a'),_0x21478c,JSON['stringify'](_0x417b82));_0x369f11(_0x417b82);})['catch'](function(_0x2a2a3b){logger[_0x2ad7('0x14')](_0x2ad7('0x1a'),_0x2a2a3b['message'],_0x21478c);_0x2b96d3(_0x1c8c1b[_0x2ad7('0x14')](0x1f4,_0x2a2a3b[_0x2ad7('0x16')]));});});}; \ No newline at end of file +var _0x92b4=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','create'];(function(_0x190180,_0x3eb2a4){var _0x50a373=function(_0x5f5848){while(--_0x5f5848){_0x190180['push'](_0x190180['shift']());}};_0x50a373(++_0x3eb2a4);}(_0x92b4,0x1c3));var _0x492b=function(_0x1f9804,_0x4aed5a){_0x1f9804=_0x1f9804-0x0;var _0x5418d3=_0x92b4[_0x1f9804];return _0x5418d3;};'use strict';var _=require(_0x492b('0x0'));var util=require(_0x492b('0x1'));var moment=require(_0x492b('0x2'));var BPromise=require(_0x492b('0x3'));var rs=require(_0x492b('0x4'));var fs=require('fs');var Redis=require(_0x492b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x492b('0x6'));var logger=require('../../config/logger')(_0x492b('0x7'));var config=require(_0x492b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x492b('0x9')][_0x492b('0xa')]({'port':0x232a});config['redis']=_[_0x492b('0xb')](config[_0x492b('0xc')],{'host':_0x492b('0xd'),'port':0x18eb});var socket=require(_0x492b('0xe'))(new Redis(config[_0x492b('0xc')]));require(_0x492b('0xf'))[_0x492b('0x10')](socket);function respondWithRpcPromise(_0x2fb860,_0x44ee5b,_0x5c5a1c){return new BPromise(function(_0x4aea4b,_0x50fdad){return client[_0x492b('0x11')](_0x2fb860,_0x5c5a1c)['then'](function(_0x485f13){logger[_0x492b('0x12')](_0x492b('0x13'),_0x44ee5b,_0x492b('0x14'));logger[_0x492b('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x44ee5b,_0x492b('0x14'),JSON['stringify'](_0x485f13));if(_0x485f13[_0x492b('0x16')]){if(_0x485f13[_0x492b('0x16')][_0x492b('0x17')]===0x1f4){logger[_0x492b('0x16')](_0x492b('0x13'),_0x44ee5b,_0x485f13[_0x492b('0x16')][_0x492b('0x18')]);return _0x50fdad(_0x485f13['error']['message']);}logger[_0x492b('0x16')](_0x492b('0x13'),_0x44ee5b,_0x485f13[_0x492b('0x16')][_0x492b('0x18')]);return _0x4aea4b(_0x485f13[_0x492b('0x16')][_0x492b('0x18')]);}else{logger[_0x492b('0x12')](_0x492b('0x13'),_0x44ee5b,_0x492b('0x14'));_0x4aea4b(_0x485f13['result'][_0x492b('0x18')]);}})[_0x492b('0x19')](function(_0x938b1){logger[_0x492b('0x16')](_0x492b('0x13'),_0x44ee5b,_0x938b1);_0x50fdad(_0x938b1);});});}exports[_0x492b('0x1a')]=function(_0x362c6e){var _0x21c893=this;return new Promise(function(_0x188c49,_0x2a3791){return db[_0x492b('0x1b')][_0x492b('0x1c')](_0x362c6e['body'],{'raw':_0x362c6e['options']?_0x362c6e[_0x492b('0x1d')][_0x492b('0x1e')]===undefined?!![]:![]:!![]})[_0x492b('0x1f')](function(_0x162204){logger[_0x492b('0x12')](_0x492b('0x1a'),_0x362c6e);logger[_0x492b('0x15')]('CreateWhatsappMessage',_0x362c6e,JSON['stringify'](_0x162204));_0x188c49(_0x162204);})[_0x492b('0x19')](function(_0x3bc04b){logger['error'](_0x492b('0x1a'),_0x3bc04b[_0x492b('0x18')],_0x362c6e);_0x2a3791(_0x21c893[_0x492b('0x16')](0x1f4,_0x3bc04b['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 1af7c54..d78bf00 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 _0xe158=['removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0xe158,0x1b3));var _0x8e15=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xe158[_0x230e39];return _0xa804e;};'use strict';var WhatsappMessageEvents=require(_0x8e15('0x0'));var events=[_0x8e15('0x1'),_0x8e15('0x2'),_0x8e15('0x3')];function createListener(_0x7dc266,_0xaa6611){return function(_0x59b2db){_0xaa6611[_0x8e15('0x4')](_0x7dc266,_0x59b2db);};}function removeListener(_0x2c5793,_0x1641fd){return function(){WhatsappMessageEvents[_0x8e15('0x5')](_0x2c5793,_0x1641fd);};}exports[_0x8e15('0x6')]=function(_0x184f2e){for(var _0x417a6d=0x0,_0x8008e2=events['length'];_0x417a6d<_0x8008e2;_0x417a6d++){var _0x26e281=events[_0x417a6d];var _0x1da6b6=createListener(_0x8e15('0x7')+_0x26e281,_0x184f2e);WhatsappMessageEvents['on'](_0x26e281,_0x1da6b6);}}; \ No newline at end of file +var _0x05b0=['emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','remove','update'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0x05b0,0x195));var _0x005b=function(_0x221a15,_0x2a6eb6){_0x221a15=_0x221a15-0x0;var _0x3c7e1d=_0x05b0[_0x221a15];return _0x3c7e1d;};'use strict';var WhatsappMessageEvents=require(_0x005b('0x0'));var events=['save',_0x005b('0x1'),_0x005b('0x2')];function createListener(_0x4cd943,_0x2119e2){return function(_0x1e6152){_0x2119e2[_0x005b('0x3')](_0x4cd943,_0x1e6152);};}function removeListener(_0x410c24,_0x5b1026){return function(){WhatsappMessageEvents[_0x005b('0x4')](_0x410c24,_0x5b1026);};}exports[_0x005b('0x5')]=function(_0x30570a){for(var _0x1766a0=0x0,_0x3d2026=events[_0x005b('0x6')];_0x1766a0<_0x3d2026;_0x1766a0++){var _0x4b92e7=events[_0x1766a0];var _0x14c7b0=createListener(_0x005b('0x7')+_0x4b92e7,_0x30570a);WhatsappMessageEvents['on'](_0x4b92e7,_0x14c7b0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a862ff7..f2f1e4a 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 _0x3759=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path'];(function(_0x496236,_0x3cbdc5){var _0x5af53c=function(_0x2dfecf){while(--_0x2dfecf){_0x496236['push'](_0x496236['shift']());}};_0x5af53c(++_0x3cbdc5);}(_0x3759,0x131));var _0x9375=function(_0x539ea8,_0x78a700){_0x539ea8=_0x539ea8-0x0;var _0x3afeae=_0x3759[_0x539ea8];return _0x3afeae;};'use strict';var multer=require(_0x9375('0x0'));var util=require(_0x9375('0x1'));var path=require(_0x9375('0x2'));var timeout=require(_0x9375('0x3'));var express=require(_0x9375('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9375('0x5'));var interaction=require(_0x9375('0x6'));var config=require('../../config/environment');var controller=require(_0x9375('0x7'));router[_0x9375('0x8')]('/',auth['isAuthenticated'](),controller[_0x9375('0x9')]);router[_0x9375('0x8')](_0x9375('0xa'),auth[_0x9375('0xb')](),controller[_0x9375('0xc')]);router[_0x9375('0x8')](_0x9375('0xd'),auth[_0x9375('0xb')](),controller['show']);router['get']('/:id/members',auth[_0x9375('0xb')](),controller[_0x9375('0xe')]);router[_0x9375('0x8')]('/:id/teams',auth[_0x9375('0xb')](),controller[_0x9375('0xf')]);router[_0x9375('0x8')](_0x9375('0x10'),auth['isAuthenticated'](),controller[_0x9375('0x11')]);router[_0x9375('0x12')]('/',auth[_0x9375('0xb')](),controller[_0x9375('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x9375('0x14')]);router['post']('/:id/users',auth[_0x9375('0xb')](),controller[_0x9375('0x15')]);router[_0x9375('0x16')]('/:id',auth[_0x9375('0xb')](),controller['update']);router[_0x9375('0x17')](_0x9375('0xd'),auth['isAuthenticated'](),controller[_0x9375('0x18')]);router['delete']('/:id/teams',auth[_0x9375('0xb')](),controller[_0x9375('0x19')]);router[_0x9375('0x17')](_0x9375('0x10'),auth['isAuthenticated'](),controller[_0x9375('0x1a')]);module[_0x9375('0x1b')]=router; \ No newline at end of file +var _0xd540=['/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','/:id/teams','removeTeams','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5c1726,_0x27281a){var _0x20f183=function(_0x4ce740){while(--_0x4ce740){_0x5c1726['push'](_0x5c1726['shift']());}};_0x20f183(++_0x27281a);}(_0xd540,0x1d2));var _0x0d54=function(_0x4cacb8,_0x4af4a6){_0x4cacb8=_0x4cacb8-0x0;var _0x5248fa=_0xd540[_0x4cacb8];return _0x5248fa;};'use strict';var multer=require(_0x0d54('0x0'));var util=require('util');var path=require(_0x0d54('0x1'));var timeout=require(_0x0d54('0x2'));var express=require('express');var router=express[_0x0d54('0x3')]();var fs_extra=require(_0x0d54('0x4'));var auth=require(_0x0d54('0x5'));var interaction=require(_0x0d54('0x6'));var config=require(_0x0d54('0x7'));var controller=require(_0x0d54('0x8'));router[_0x0d54('0x9')]('/',auth[_0x0d54('0xa')](),controller[_0x0d54('0xb')]);router[_0x0d54('0x9')](_0x0d54('0xc'),auth[_0x0d54('0xa')](),controller[_0x0d54('0xd')]);router['get'](_0x0d54('0xe'),auth[_0x0d54('0xa')](),controller['show']);router[_0x0d54('0x9')](_0x0d54('0xf'),auth[_0x0d54('0xa')](),controller[_0x0d54('0x10')]);router[_0x0d54('0x9')]('/:id/teams',auth[_0x0d54('0xa')](),controller[_0x0d54('0x11')]);router[_0x0d54('0x9')](_0x0d54('0x12'),auth['isAuthenticated'](),controller[_0x0d54('0x13')]);router[_0x0d54('0x14')]('/',auth[_0x0d54('0xa')](),controller[_0x0d54('0x15')]);router[_0x0d54('0x14')]('/:id/teams',auth[_0x0d54('0xa')](),controller[_0x0d54('0x16')]);router[_0x0d54('0x14')](_0x0d54('0x12'),auth[_0x0d54('0xa')](),controller[_0x0d54('0x17')]);router['put']('/:id',auth[_0x0d54('0xa')](),controller[_0x0d54('0x18')]);router[_0x0d54('0x19')]('/:id',auth[_0x0d54('0xa')](),controller[_0x0d54('0x1a')]);router['delete'](_0x0d54('0x1b'),auth['isAuthenticated'](),controller[_0x0d54('0x1c')]);router[_0x0d54('0x19')](_0x0d54('0x12'),auth[_0x0d54('0xa')](),controller['removeAgents']);module[_0x0d54('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 594a27d..a1551f5 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 _0xa75b=['sequelize','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x2371ca,_0x492257){var _0x15eaab=function(_0x27c1e3){while(--_0x27c1e3){_0x2371ca['push'](_0x2371ca['shift']());}};_0x15eaab(++_0x492257);}(_0xa75b,0x170));var _0xba75=function(_0x5bd083,_0x3f632d){_0x5bd083=_0x5bd083-0x0;var _0x84b539=_0xa75b[_0x5bd083];return _0x84b539;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xba75('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xba75('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xba75('0x3')](_0xba75('0x4'),_0xba75('0x5'),_0xba75('0x6'))},'description':{'type':Sequelize[_0xba75('0x7')]}}; \ No newline at end of file +var _0xd240=['exports','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0xd240,0x1c7));var _0x0d24=function(_0x1ca226,_0x3618a7){_0x1ca226=_0x1ca226-0x0;var _0x19830e=_0xd240[_0x1ca226];return _0x19830e;};'use strict';var Sequelize=require('sequelize');module[_0x0d24('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0d24('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0d24('0x2')](_0x0d24('0x3'),_0x0d24('0x4'),_0x0d24('0x5'))},'description':{'type':Sequelize[_0x0d24('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 402e533..79a7424 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 _0x3066=['from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','all','union','compact','removeTeams','isEmpty','removeAgents','forEach','emit','userWhatsappQueue:remove','addAgents','omit','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','offset','limit','undefined','count','set','Content-Range','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','index','map','fieldName','getOptions','WhatsappQueue','include','findAll','catch','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','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','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappQueueId','merge','filter','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','SIP','getTeams','Team','options','addTeams','ids','User','Agents','online','interface','flatMap','transaction','each','userWhatsappQueue:save','select','field','tq.TeamId'];(function(_0xd0cd54,_0x613e58){var _0x5f3f4f=function(_0x4fb920){while(--_0x4fb920){_0xd0cd54['push'](_0xd0cd54['shift']());}};_0x5f3f4f(++_0x613e58);}(_0x3066,0x8d));var _0x6306=function(_0x3ec856,_0xda9fd7){_0x3ec856=_0x3ec856-0x0;var _0x572403=_0x3066[_0x3ec856];return _0x572403;};'use strict';var BPromise=require(_0x6306('0x0'));var util=require('util');var _=require(_0x6306('0x1'));var squel=require(_0x6306('0x2'));var Redis=require(_0x6306('0x3'));var qs=require(_0x6306('0x4'));var logger=require(_0x6306('0x5'))('api');var config=require(_0x6306('0x6'));var db=require('../../mysqldb')['db'];config[_0x6306('0x7')]=_['defaults'](config[_0x6306('0x7')],{'host':_0x6306('0x8'),'port':0x18eb});var socket=require(_0x6306('0x9'))(new Redis(config[_0x6306('0x7')]));require(_0x6306('0xa'))['register'](socket);function respondWithStatusCode(_0x1a993e,_0x5b6d86){_0x5b6d86=_0x5b6d86||0xcc;return function(_0x3f3fd5){if(_0x3f3fd5){return _0x1a993e[_0x6306('0xb')](_0x5b6d86);}return _0x1a993e[_0x6306('0xc')](_0x5b6d86)['end']();};}function respondWithResult(_0x5b2b3c,_0x82cb1a){_0x82cb1a=_0x82cb1a||0xc8;return function(_0x32a360){if(_0x32a360){return _0x5b2b3c[_0x6306('0xc')](_0x82cb1a)['json'](_0x32a360);}};}function respondWithFilteredResult(_0x20fcc7,_0x2fecb9){return function(_0x5076a2){if(_0x5076a2){var _0x2cc423=typeof _0x2fecb9[_0x6306('0xd')]==='undefined'&&typeof _0x2fecb9[_0x6306('0xe')]===_0x6306('0xf');var _0x3d4c29=_0x5076a2[_0x6306('0x10')];var _0xee0cc9=_0x2cc423?0x0:_0x2fecb9[_0x6306('0xd')];var _0x410119=_0x2cc423?_0x5076a2[_0x6306('0x10')]:_0x2fecb9['offset']+_0x2fecb9[_0x6306('0xe')];var _0x1e52a0;if(_0x410119>=_0x3d4c29){_0x410119=_0x3d4c29;_0x1e52a0=0xc8;}else{_0x1e52a0=0xce;}_0x20fcc7['status'](_0x1e52a0);return _0x20fcc7[_0x6306('0x11')](_0x6306('0x12'),_0xee0cc9+'-'+_0x410119+'/'+_0x3d4c29)['json'](_0x5076a2);}return null;};}function saveUpdates(_0x1f8ab8){return function(_0x429036){if(_0x429036){return _0x429036['update'](_0x1f8ab8)[_0x6306('0x13')](function(_0x21c2cb){return _0x21c2cb;});}return null;};}function removeEntity(_0x2e7928){return function(_0x41e173){if(_0x41e173){return _0x41e173['destroy']()[_0x6306('0x13')](function(){var _0x1d2b54=_0x41e173[_0x6306('0x14')]({'plain':!![]});var _0x9bf4a9=_0x6306('0x15');return db[_0x6306('0x16')][_0x6306('0x17')]({'where':{'type':_0x9bf4a9,'resourceId':_0x1d2b54['id']}})[_0x6306('0x13')](function(){return _0x41e173;});})[_0x6306('0x13')](function(){_0x2e7928[_0x6306('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aae3f){return function(_0x257cb5){if(!_0x257cb5){_0x4aae3f[_0x6306('0xb')](0x194);}return _0x257cb5;};}function handleError(_0x5cdd7e,_0x54799f){_0x54799f=_0x54799f||0x1f4;return function(_0x53b1d8){logger[_0x6306('0x18')](_0x53b1d8[_0x6306('0x19')]);if(_0x53b1d8[_0x6306('0x1a')]){delete _0x53b1d8['name'];}_0x5cdd7e[_0x6306('0xc')](_0x54799f)['send'](_0x53b1d8);};}exports[_0x6306('0x1b')]=function(_0x205433,_0x389e85){var _0x119cae={};var _0x22bb2e={'count':0x0,'rows':[]};var _0x1271d8=_[_0x6306('0x1c')](db['WhatsappQueue']['rawAttributes'],function(_0x4f849a){return{'name':_0x4f849a[_0x6306('0x1d')],'type':_0x4f849a['type']['key']};});_0x119cae=qs[_0x6306('0x1e')](_0x1271d8,_0x205433);var _0x41eee6={'where':_0x119cae['where']};return db[_0x6306('0x1f')][_0x6306('0x10')](_0x41eee6)[_0x6306('0x13')](function(_0x3fd865){_0x22bb2e['count']=_0x3fd865;_0x119cae[_0x6306('0x20')]=qs[_0x6306('0x20')](_0x205433['query']);return db[_0x6306('0x1f')][_0x6306('0x21')](_0x119cae);})[_0x6306('0x13')](function(_0x176ead){_0x22bb2e['rows']=_0x176ead;return _0x22bb2e;})['then'](respondWithFilteredResult(_0x389e85,_0x119cae))[_0x6306('0x22')](handleError(_0x389e85,null));};exports[_0x6306('0x23')]=function(_0x4d0274,_0x450738){var _0x28b80a={'raw':!![],'where':{'id':_0x4d0274[_0x6306('0x24')]['id']}},_0x1cc71e={};_0x1cc71e[_0x6306('0x25')]=_[_0x6306('0x26')](db['WhatsappQueue'][_0x6306('0x27')]);_0x1cc71e[_0x6306('0x28')]=_[_0x6306('0x26')](_0x4d0274['query']);_0x1cc71e[_0x6306('0x29')]=_['intersection'](_0x1cc71e['model'],_0x1cc71e[_0x6306('0x28')]);_0x28b80a[_0x6306('0x2a')]=_[_0x6306('0x2b')](_0x1cc71e[_0x6306('0x25')],qs[_0x6306('0x2c')](_0x4d0274[_0x6306('0x28')][_0x6306('0x2c')]));_0x28b80a[_0x6306('0x2a')]=_0x28b80a[_0x6306('0x2a')][_0x6306('0x2d')]?_0x28b80a[_0x6306('0x2a')]:_0x1cc71e[_0x6306('0x25')];if(_0x4d0274[_0x6306('0x28')]['includeAll']){_0x28b80a[_0x6306('0x20')]=[{'all':!![]}];}_0x28b80a=_['merge']({},_0x28b80a,_0x4d0274['options']);return db[_0x6306('0x1f')][_0x6306('0x2e')](_0x28b80a)[_0x6306('0x13')](handleEntityNotFound(_0x450738,null))['then'](respondWithResult(_0x450738,null))[_0x6306('0x22')](handleError(_0x450738,null));};exports[_0x6306('0x2f')]=function(_0x19d5ec,_0xb4a9ce){return db[_0x6306('0x1f')][_0x6306('0x2f')](_0x19d5ec[_0x6306('0x30')],{})['then'](function(_0x29423d){var _0x170fcb=_0x19d5ec[_0x6306('0x31')]['get']({'plain':!![]});if(!_0x170fcb)throw new Error(_0x6306('0x32'));if(_0x170fcb[_0x6306('0x33')]===_0x6306('0x31')){var _0x292d5b=_0x29423d[_0x6306('0x14')]({'plain':!![]});var _0x4d122d=_0x6306('0x15');return db[_0x6306('0x34')][_0x6306('0x2e')]({'where':{'name':_0x4d122d,'userProfileId':_0x170fcb[_0x6306('0x35')]},'raw':!![]})['then'](function(_0x3aad32){if(_0x3aad32&&_0x3aad32[_0x6306('0x36')]===0x0){return db['UserProfileResource'][_0x6306('0x2f')]({'name':_0x292d5b['name'],'resourceId':_0x292d5b['id'],'type':_0x3aad32[_0x6306('0x1a')],'sectionId':_0x3aad32['id']},{})['then'](function(){return _0x29423d;});}else{return _0x29423d;}})[_0x6306('0x22')](function(_0x126a3c){logger[_0x6306('0x18')](_0x6306('0x37'),_0x126a3c);throw _0x126a3c;});}return _0x29423d;})[_0x6306('0x13')](respondWithResult(_0xb4a9ce,0xc9))[_0x6306('0x22')](handleError(_0xb4a9ce,null));};exports['update']=function(_0x55816e,_0x2da2bd){if(_0x55816e[_0x6306('0x30')]['id']){delete _0x55816e[_0x6306('0x30')]['id'];}return db[_0x6306('0x1f')]['find']({'where':{'id':_0x55816e[_0x6306('0x24')]['id']}})[_0x6306('0x13')](handleEntityNotFound(_0x2da2bd,null))['then'](saveUpdates(_0x55816e[_0x6306('0x30')],null))[_0x6306('0x13')](respondWithResult(_0x2da2bd,null))[_0x6306('0x22')](handleError(_0x2da2bd,null));};exports['destroy']=function(_0x24a088,_0x246e65){return db['WhatsappQueue'][_0x6306('0x2e')]({'where':{'id':_0x24a088[_0x6306('0x24')]['id']}})['then'](handleEntityNotFound(_0x246e65,null))[_0x6306('0x13')](removeEntity(_0x246e65,null))[_0x6306('0x22')](handleError(_0x246e65,null));};exports[_0x6306('0x38')]=function(_0x258516,_0x49e273){return db['WhatsappQueue'][_0x6306('0x38')]()[_0x6306('0x13')](respondWithResult(_0x49e273,null))[_0x6306('0x22')](handleError(_0x49e273,null));};exports[_0x6306('0x39')]=function(_0x11f864,_0x16a859){var _0x1bacf5={'raw':!![],'where':{}},_0x112e21={},_0x39adeb;return db['WhatsappQueue'][_0x6306('0x3a')]({'where':{'id':_0x11f864['params']['id']}})[_0x6306('0x13')](handleEntityNotFound(_0x16a859,null))['then'](function(_0x5a4f41){if(_0x5a4f41){_0x39adeb=_0x5a4f41[_0x6306('0x14')]({'plain':!![]});_0x112e21[_0x6306('0x25')]=_[_0x6306('0x26')](db[_0x6306('0x3b')][_0x6306('0x27')]);_0x112e21[_0x6306('0x28')]=_[_0x6306('0x26')](_0x11f864[_0x6306('0x28')]);_0x112e21['filters']=_[_0x6306('0x2b')](_0x112e21['model'],_0x112e21[_0x6306('0x28')]);_0x1bacf5['attributes']=_['intersection'](_0x112e21[_0x6306('0x25')],qs[_0x6306('0x2c')](_0x11f864[_0x6306('0x28')][_0x6306('0x2c')]));_0x1bacf5['attributes']=_0x1bacf5[_0x6306('0x2a')]['length']?_0x1bacf5[_0x6306('0x2a')]:_0x112e21[_0x6306('0x25')];if(!_0x11f864[_0x6306('0x28')][_0x6306('0x3c')](_0x6306('0x3d'))){_0x1bacf5[_0x6306('0xe')]=qs['limit'](_0x11f864[_0x6306('0x28')]['limit']);_0x1bacf5['offset']=qs[_0x6306('0xd')](_0x11f864['query'][_0x6306('0xd')]);}_0x1bacf5[_0x6306('0x3e')]=qs['sort'](_0x11f864[_0x6306('0x28')][_0x6306('0x3f')]);_0x1bacf5['where']=qs[_0x6306('0x29')](_[_0x6306('0x40')](_0x11f864[_0x6306('0x28')],_0x112e21[_0x6306('0x29')]));_0x1bacf5[_0x6306('0x41')][_0x6306('0x42')]=_0x5a4f41['id'];if(_0x11f864['query']['filter']){_0x1bacf5[_0x6306('0x41')]=_[_0x6306('0x43')](_0x1bacf5[_0x6306('0x41')],{'$or':_['map'](_0x1bacf5[_0x6306('0x2a')],function(_0x1938c8){var _0x915a4e={};_0x915a4e[_0x1938c8]={'$like':'%'+_0x11f864[_0x6306('0x28')][_0x6306('0x44')]+'%'};return _0x915a4e;})});}_0x1bacf5=_['merge']({},_0x1bacf5,_0x11f864['options']);return db[_0x6306('0x3b')][_0x6306('0x21')](_0x1bacf5);}})['then'](function(_0x3917b6){if(_0x3917b6){return db['User'][_0x6306('0x45')]({'where':{'id':_[_0x6306('0x1c')](_0x3917b6,_0x6306('0x46')),'role':_0x6306('0x47')},'attributes':['id',_0x6306('0x1a'),_0x6306('0x48'),_0x6306('0x49'),'createdAt']});}})['then'](function(_0x50f6cd){if(_0x50f6cd){return{'count':_0x50f6cd[_0x6306('0x10')],'rows':_['map'](_0x50f6cd[_0x6306('0x4a')],function(_0x2e9b40){return{'membername':_0x2e9b40['name'],'UserId':_0x2e9b40['id'],'queue_name':_0x39adeb['name'],'WhatsappQueueId':_0x39adeb['id'],'interface':util[_0x6306('0x4b')]('%s/%s',_0x6306('0x4c'),_0x2e9b40['name']),'penalty':0x0,'paused':_0x2e9b40[_0x6306('0x48')],'createdAt':_0x2e9b40['createdAt'],'updatedAt':_0x2e9b40[_0x6306('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x16a859,_0x1bacf5))[_0x6306('0x22')](handleError(_0x16a859,null));};exports[_0x6306('0x4d')]=function(_0x3a6674,_0x5aa8b5){var _0x130a14={};var _0x4fdcd8={};var _0x4ab752;var _0x4a54f0;return db[_0x6306('0x1f')][_0x6306('0x3a')]({'where':{'id':_0x3a6674[_0x6306('0x24')]['id']}})['then'](handleEntityNotFound(_0x5aa8b5,null))['then'](function(_0x1546c8){if(_0x1546c8){_0x4ab752=_0x1546c8;_0x4fdcd8[_0x6306('0x25')]=_[_0x6306('0x26')](db[_0x6306('0x4e')][_0x6306('0x27')]);_0x4fdcd8[_0x6306('0x28')]=_[_0x6306('0x26')](_0x3a6674[_0x6306('0x28')]);_0x4fdcd8[_0x6306('0x29')]=_[_0x6306('0x2b')](_0x4fdcd8['model'],_0x4fdcd8[_0x6306('0x28')]);_0x130a14['attributes']=_['intersection'](_0x4fdcd8['model'],qs[_0x6306('0x2c')](_0x3a6674['query'][_0x6306('0x2c')]));_0x130a14[_0x6306('0x2a')]=_0x130a14['attributes'][_0x6306('0x2d')]?_0x130a14[_0x6306('0x2a')]:_0x4fdcd8[_0x6306('0x25')];_0x130a14['order']=qs['sort'](_0x3a6674['query']['sort']);_0x130a14['where']=qs[_0x6306('0x29')](_[_0x6306('0x40')](_0x3a6674[_0x6306('0x28')],_0x4fdcd8['filters']));if(_0x3a6674[_0x6306('0x28')][_0x6306('0x44')]){_0x130a14['where']=_[_0x6306('0x43')](_0x130a14[_0x6306('0x41')],{'$or':_[_0x6306('0x1c')](_0x130a14[_0x6306('0x2a')],function(_0x3087ec){var _0x2a5162={};_0x2a5162[_0x3087ec]={'$like':'%'+_0x3a6674[_0x6306('0x28')][_0x6306('0x44')]+'%'};return _0x2a5162;})});}_0x130a14=_[_0x6306('0x43')]({},_0x130a14,_0x3a6674[_0x6306('0x4f')]);return _0x4ab752[_0x6306('0x4d')](_0x130a14);}})[_0x6306('0x13')](function(_0x44cc40){if(_0x44cc40){_0x4a54f0=_0x44cc40[_0x6306('0x2d')];if(!_0x3a6674[_0x6306('0x28')][_0x6306('0x3c')](_0x6306('0x3d'))){_0x130a14[_0x6306('0xe')]=qs[_0x6306('0xe')](_0x3a6674[_0x6306('0x28')][_0x6306('0xe')]);_0x130a14[_0x6306('0xd')]=qs['offset'](_0x3a6674['query'][_0x6306('0xd')]);}return _0x4ab752['getTeams'](_0x130a14);}})[_0x6306('0x13')](function(_0x3fff61){if(_0x3fff61){return _0x3fff61?{'count':_0x4a54f0,'rows':_0x3fff61}:null;}})[_0x6306('0x13')](respondWithResult(_0x5aa8b5,null))[_0x6306('0x22')](handleError(_0x5aa8b5,null));};exports[_0x6306('0x50')]=function(_0x342c76,_0x1bb44c){var _0x10950d=_0x342c76[_0x6306('0x30')][_0x6306('0x51')];return db['Team'][_0x6306('0x21')]({'where':{'id':_0x10950d},'attributes':['id'],'include':[{'model':db[_0x6306('0x52')],'as':_0x6306('0x53'),'attributes':['id',_0x6306('0x1a'),_0x6306('0x54'),'voicePause',_0x6306('0x55')],'raw':!![]}]})[_0x6306('0x13')](function(_0x4a4e2f){if(_0x4a4e2f){var _0x2afbba=_[_0x6306('0x56')](_0x4a4e2f,function(_0x3d1451){var _0x4601c3=_0x3d1451['get']({'plain':!![]});return _0x4601c3['Agents'];});return db[_0x6306('0x1f')][_0x6306('0x2e')]({'where':{'id':_0x342c76[_0x6306('0x24')]['id']}})[_0x6306('0x13')](function(_0x19ec55){return db['sequelize'][_0x6306('0x57')](function(_0x1c60cd){return _0x19ec55[_0x6306('0x50')](_0x10950d,{'transaction':_0x1c60cd})[_0x6306('0x13')](function(){return BPromise[_0x6306('0x58')](_0x2afbba,function(_0x462dc3){return db[_0x6306('0x3b')]['findOrCreate']({'where':{'UserId':_0x462dc3['id'],'WhatsappQueueId':_0x342c76[_0x6306('0x24')]['id']},'transaction':_0x1c60cd});});})[_0x6306('0x13')](function(){_0x2afbba['forEach'](function(_0x5f5cd9){socket['emit'](_0x6306('0x59'),{'UserId':_0x5f5cd9['id'],'WhatsappQueueId':_0x19ec55['id']});});});});});}})[_0x6306('0x13')](respondWithStatusCode(_0x1bb44c,null))[_0x6306('0x22')](handleError(_0x1bb44c,null));};exports['removeTeams']=function(_0x3bf49d,_0x2b8829){return db['Team'][_0x6306('0x21')]({'where':{'id':_0x3bf49d[_0x6306('0x28')][_0x6306('0x51')]},'attributes':['id'],'include':[{'model':db[_0x6306('0x52')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6306('0x13')](handleEntityNotFound(_0x2b8829,null))['then'](function(_0x3feffc){var _0x32c286=_[_0x6306('0x1c')](_0x3feffc,'id');var _0x4069bb=[];var _0x10ba85=[];var _0x59b689=squel[_0x6306('0x5a')]();_0x59b689[_0x6306('0x5b')](_0x6306('0x5c'))[_0x6306('0x5d')](_0x6306('0x5e'),'tq')[_0x6306('0x5f')](_0x6306('0x60'),'ut',_0x6306('0x61'))['where'](_0x6306('0x62'),_0x3bf49d[_0x6306('0x24')]['id']);for(var _0x3dcf5f=0x0;_0x3dcf5f<_0x3feffc[_0x6306('0x2d')];_0x3dcf5f+=0x1){let _0x29b72d=_0x3feffc[_0x3dcf5f];for(var _0x540070=0x0;_0x540070<_0x29b72d['Agents'][_0x6306('0x2d')];_0x540070+=0x1){let _0x63a9f2=_0x29b72d['Agents'][_0x540070];var _0x4acbfa=_0x59b689['clone']();_0x4acbfa[_0x6306('0x41')](_0x6306('0x63'),_0x63a9f2['id']);_0x10ba85[_0x6306('0x64')](db[_0x6306('0x65')][_0x6306('0x28')](_0x4acbfa[_0x6306('0x66')](),{'type':db[_0x6306('0x65')][_0x6306('0x67')][_0x6306('0x68')]})[_0x6306('0x13')](function(_0x330281){if(_0x330281[_0x6306('0x2d')]===0x1){return _0x63a9f2['id'];}else{var _0x1f76d0=_['every'](_[_0x6306('0x1c')](_0x330281,'TeamId'),function(_0x3570ac){return _['includes'](_0x32c286,_0x3570ac);});if(_0x1f76d0){return _0x63a9f2['id'];}}}));}}return BPromise[_0x6306('0x69')](_0x10ba85)[_0x6306('0x13')](function(_0x1568ca){_0x4069bb=_(_0x4069bb)[_0x6306('0x6a')](_0x1568ca)[_0x6306('0x6b')]()['value']();return db[_0x6306('0x1f')]['find']({'where':{'id':_0x3bf49d[_0x6306('0x24')]['id']}})[_0x6306('0x13')](function(_0x3655e6){return db[_0x6306('0x65')][_0x6306('0x57')](function(_0x10f187){return _0x3655e6[_0x6306('0x6c')](_0x3bf49d['query'][_0x6306('0x51')],{'transaction':_0x10f187})[_0x6306('0x13')](function(){if(!_[_0x6306('0x6d')](_0x4069bb)){return _0x3655e6[_0x6306('0x6e')](_0x4069bb,{'transaction':_0x10f187});}})[_0x6306('0x13')](function(){_0x4069bb[_0x6306('0x6f')](function(_0x5cb57e){socket[_0x6306('0x70')](_0x6306('0x71'),{'UserId':_0x5cb57e,'WhatsappQueueId':_0x3655e6['id']});});});});});});})[_0x6306('0x13')](respondWithStatusCode(_0x2b8829,null))[_0x6306('0x22')](handleError(_0x2b8829,null));};exports[_0x6306('0x72')]=function(_0x159367,_0x533df4){return db['WhatsappQueue']['find']({'where':{'id':_0x159367[_0x6306('0x24')]['id']}})[_0x6306('0x13')](handleEntityNotFound(_0x533df4,null))[_0x6306('0x13')](function(_0x21a6f4){if(_0x21a6f4){return _0x21a6f4[_0x6306('0x72')](_0x159367[_0x6306('0x30')][_0x6306('0x51')],_[_0x6306('0x73')](_0x159367[_0x6306('0x30')],[_0x6306('0x51'),'id'])||{})['spread'](function(_0x59877f){for(var _0x30c0b6=0x0;_0x30c0b6<_0x159367['body'][_0x6306('0x51')]['length'];_0x30c0b6+=0x1){socket[_0x6306('0x70')](_0x6306('0x59'),{'UserId':Number(_0x159367[_0x6306('0x30')][_0x6306('0x51')][_0x30c0b6]),'WhatsappQueueId':Number(_0x159367[_0x6306('0x24')]['id'])});}return _0x59877f;});}})[_0x6306('0x13')](respondWithResult(_0x533df4,null))[_0x6306('0x22')](handleError(_0x533df4,null));};exports[_0x6306('0x6e')]=function(_0x13b7bb,_0x597a37){return db['WhatsappQueue']['find']({'where':{'id':_0x13b7bb[_0x6306('0x24')]['id']}})[_0x6306('0x13')](handleEntityNotFound(_0x597a37,null))[_0x6306('0x13')](function(_0xa8f854){if(_0xa8f854){return _0xa8f854[_0x6306('0x6e')](_0x13b7bb[_0x6306('0x28')][_0x6306('0x51')])[_0x6306('0x13')](function(){if(_['isArray'](_0x13b7bb[_0x6306('0x28')][_0x6306('0x51')])){for(var _0x207c54=0x0;_0x207c54<_0x13b7bb[_0x6306('0x28')][_0x6306('0x51')][_0x6306('0x2d')];_0x207c54+=0x1){socket[_0x6306('0x70')]('userWhatsappQueue:remove',{'UserId':Number(_0x13b7bb[_0x6306('0x28')][_0x6306('0x51')][_0x207c54]),'WhatsappQueueId':Number(_0x13b7bb[_0x6306('0x24')]['id'])});}}else{socket[_0x6306('0x70')](_0x6306('0x71'),{'UserId':Number(_0x13b7bb[_0x6306('0x28')][_0x6306('0x51')]),'WhatsappQueueId':Number(_0x13b7bb[_0x6306('0x24')]['id'])});}});}})[_0x6306('0x13')](respondWithStatusCode(_0x597a37,null))[_0x6306('0x22')](handleError(_0x597a37,null));};exports[_0x6306('0x74')]=function(_0x3bce96,_0x36ea12){var _0x580101={};var _0x7f2648={};var _0x46c218;var _0x272085;return db[_0x6306('0x1f')][_0x6306('0x3a')]({'where':{'id':_0x3bce96[_0x6306('0x24')]['id']}})['then'](handleEntityNotFound(_0x36ea12,null))[_0x6306('0x13')](function(_0x3970d1){if(_0x3970d1){_0x46c218=_0x3970d1;_0x7f2648[_0x6306('0x25')]=_[_0x6306('0x26')](db[_0x6306('0x52')][_0x6306('0x27')]);_0x7f2648[_0x6306('0x28')]=_[_0x6306('0x26')](_0x3bce96[_0x6306('0x28')]);_0x7f2648[_0x6306('0x29')]=_[_0x6306('0x2b')](_0x7f2648[_0x6306('0x25')],_0x7f2648[_0x6306('0x28')]);_0x580101[_0x6306('0x2a')]=_['intersection'](_0x7f2648['model'],qs[_0x6306('0x2c')](_0x3bce96[_0x6306('0x28')][_0x6306('0x2c')]));_0x580101[_0x6306('0x2a')]=_0x580101['attributes'][_0x6306('0x2d')]?_0x580101['attributes']:_0x7f2648[_0x6306('0x25')];_0x580101[_0x6306('0x3e')]=qs[_0x6306('0x3f')](_0x3bce96['query'][_0x6306('0x3f')]);_0x580101['where']=qs[_0x6306('0x29')](_[_0x6306('0x40')](_0x3bce96[_0x6306('0x28')],_0x7f2648[_0x6306('0x29')]));if(_0x3bce96['query']['filter']){_0x580101[_0x6306('0x41')]=_['merge'](_0x580101[_0x6306('0x41')],{'$or':_[_0x6306('0x1c')](_0x580101[_0x6306('0x2a')],function(_0x555a3e){var _0x885f7b={};_0x885f7b[_0x555a3e]={'$like':'%'+_0x3bce96[_0x6306('0x28')][_0x6306('0x44')]+'%'};return _0x885f7b;})});}_0x580101=_[_0x6306('0x43')]({},_0x580101,_0x3bce96['options']);return _0x46c218[_0x6306('0x74')](_0x580101);}})[_0x6306('0x13')](function(_0x5acb83){if(_0x5acb83){_0x272085=_0x5acb83[_0x6306('0x2d')];if(!_0x3bce96[_0x6306('0x28')]['hasOwnProperty'](_0x6306('0x3d'))){_0x580101[_0x6306('0xe')]=qs[_0x6306('0xe')](_0x3bce96['query'][_0x6306('0xe')]);_0x580101[_0x6306('0xd')]=qs['offset'](_0x3bce96[_0x6306('0x28')][_0x6306('0xd')]);}return _0x46c218[_0x6306('0x74')](_0x580101);}})[_0x6306('0x13')](function(_0x2cbbfc){if(_0x2cbbfc){return _0x2cbbfc?{'count':_0x272085,'rows':_0x2cbbfc}:null;}})['then'](respondWithResult(_0x36ea12,null))['catch'](handleError(_0x36ea12,null));}; \ No newline at end of file +var _0xd8a8=['UserWhatsappQueue','filters','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappQueueId','filter','options','findAll','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','then','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','type','key','include','query','rows','catch','show','params','model','keys','attributes','intersection','fields','length','includeAll','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne'];(function(_0x3674d4,_0x4ce93b){var _0x4b5cd4=function(_0x59081c){while(--_0x59081c){_0x3674d4['push'](_0x3674d4['shift']());}};_0x4b5cd4(++_0x4ce93b);}(_0xd8a8,0x13d));var _0x8d8a=function(_0x220b41,_0x332855){_0x220b41=_0x220b41-0x0;var _0x406a52=_0xd8a8[_0x220b41];return _0x406a52;};'use strict';var BPromise=require('bluebird');var util=require(_0x8d8a('0x0'));var _=require(_0x8d8a('0x1'));var squel=require(_0x8d8a('0x2'));var Redis=require(_0x8d8a('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x8d8a('0x4'))(_0x8d8a('0x5'));var config=require('../../config/environment');var db=require(_0x8d8a('0x6'))['db'];config[_0x8d8a('0x7')]=_[_0x8d8a('0x8')](config['redis'],{'host':_0x8d8a('0x9'),'port':0x18eb});var socket=require(_0x8d8a('0xa'))(new Redis(config[_0x8d8a('0x7')]));require(_0x8d8a('0xb'))[_0x8d8a('0xc')](socket);function respondWithStatusCode(_0x4f7b0d,_0x546dfc){_0x546dfc=_0x546dfc||0xcc;return function(_0x1ab1c5){if(_0x1ab1c5){return _0x4f7b0d[_0x8d8a('0xd')](_0x546dfc);}return _0x4f7b0d[_0x8d8a('0xe')](_0x546dfc)[_0x8d8a('0xf')]();};}function respondWithResult(_0x522dc9,_0x70c640){_0x70c640=_0x70c640||0xc8;return function(_0x53a6a2){if(_0x53a6a2){return _0x522dc9[_0x8d8a('0xe')](_0x70c640)[_0x8d8a('0x10')](_0x53a6a2);}};}function respondWithFilteredResult(_0x2dc6ab,_0x2a4b90){return function(_0x2852a9){if(_0x2852a9){var _0x451a96=typeof _0x2a4b90[_0x8d8a('0x11')]===_0x8d8a('0x12')&&typeof _0x2a4b90[_0x8d8a('0x13')]===_0x8d8a('0x12');var _0x566b16=_0x2852a9['count'];var _0x2549a7=_0x451a96?0x0:_0x2a4b90[_0x8d8a('0x11')];var _0x4fe710=_0x451a96?_0x2852a9[_0x8d8a('0x14')]:_0x2a4b90[_0x8d8a('0x11')]+_0x2a4b90['limit'];var _0x403590;if(_0x4fe710>=_0x566b16){_0x4fe710=_0x566b16;_0x403590=0xc8;}else{_0x403590=0xce;}_0x2dc6ab[_0x8d8a('0xe')](_0x403590);return _0x2dc6ab[_0x8d8a('0x15')]('Content-Range',_0x2549a7+'-'+_0x4fe710+'/'+_0x566b16)[_0x8d8a('0x10')](_0x2852a9);}return null;};}function saveUpdates(_0x5861e6){return function(_0x192ad6){if(_0x192ad6){return _0x192ad6[_0x8d8a('0x16')](_0x5861e6)['then'](function(_0x2050a8){return _0x2050a8;});}return null;};}function removeEntity(_0x13762e){return function(_0x1ce529){if(_0x1ce529){return _0x1ce529[_0x8d8a('0x17')]()[_0x8d8a('0x18')](function(){var _0x446f43=_0x1ce529['get']({'plain':!![]});var _0x1552b3=_0x8d8a('0x19');return db[_0x8d8a('0x1a')][_0x8d8a('0x17')]({'where':{'type':_0x1552b3,'resourceId':_0x446f43['id']}})['then'](function(){return _0x1ce529;});})[_0x8d8a('0x18')](function(){_0x13762e[_0x8d8a('0xe')](0xcc)[_0x8d8a('0xf')]();});}};}function handleEntityNotFound(_0x2f9532){return function(_0x2e5d94){if(!_0x2e5d94){_0x2f9532[_0x8d8a('0xd')](0x194);}return _0x2e5d94;};}function handleError(_0x32e0b1,_0x132945){_0x132945=_0x132945||0x1f4;return function(_0x555c40){logger[_0x8d8a('0x1b')](_0x555c40[_0x8d8a('0x1c')]);if(_0x555c40[_0x8d8a('0x1d')]){delete _0x555c40[_0x8d8a('0x1d')];}_0x32e0b1[_0x8d8a('0xe')](_0x132945)[_0x8d8a('0x1e')](_0x555c40);};}exports[_0x8d8a('0x1f')]=function(_0x232f28,_0x27b045){var _0xecb4e={};var _0x5ad219={'count':0x0,'rows':[]};var _0x4a6d18=_[_0x8d8a('0x20')](db[_0x8d8a('0x21')][_0x8d8a('0x22')],function(_0x1ce948){return{'name':_0x1ce948['fieldName'],'type':_0x1ce948[_0x8d8a('0x23')][_0x8d8a('0x24')]};});_0xecb4e=qs['getOptions'](_0x4a6d18,_0x232f28);var _0x54f570={'where':_0xecb4e['where']};return db[_0x8d8a('0x21')][_0x8d8a('0x14')](_0x54f570)[_0x8d8a('0x18')](function(_0x198626){_0x5ad219[_0x8d8a('0x14')]=_0x198626;_0xecb4e[_0x8d8a('0x25')]=qs[_0x8d8a('0x25')](_0x232f28[_0x8d8a('0x26')]);return db[_0x8d8a('0x21')]['findAll'](_0xecb4e);})[_0x8d8a('0x18')](function(_0x4bc774){_0x5ad219[_0x8d8a('0x27')]=_0x4bc774;return _0x5ad219;})[_0x8d8a('0x18')](respondWithFilteredResult(_0x27b045,_0xecb4e))[_0x8d8a('0x28')](handleError(_0x27b045,null));};exports[_0x8d8a('0x29')]=function(_0x4f5c84,_0x4e2572){var _0x4ce0e4={'raw':!![],'where':{'id':_0x4f5c84[_0x8d8a('0x2a')]['id']}},_0x242ae1={};_0x242ae1[_0x8d8a('0x2b')]=_['keys'](db[_0x8d8a('0x21')][_0x8d8a('0x22')]);_0x242ae1[_0x8d8a('0x26')]=_[_0x8d8a('0x2c')](_0x4f5c84[_0x8d8a('0x26')]);_0x242ae1['filters']=_['intersection'](_0x242ae1[_0x8d8a('0x2b')],_0x242ae1[_0x8d8a('0x26')]);_0x4ce0e4[_0x8d8a('0x2d')]=_[_0x8d8a('0x2e')](_0x242ae1[_0x8d8a('0x2b')],qs[_0x8d8a('0x2f')](_0x4f5c84['query']['fields']));_0x4ce0e4[_0x8d8a('0x2d')]=_0x4ce0e4[_0x8d8a('0x2d')][_0x8d8a('0x30')]?_0x4ce0e4[_0x8d8a('0x2d')]:_0x242ae1[_0x8d8a('0x2b')];if(_0x4f5c84[_0x8d8a('0x26')][_0x8d8a('0x31')]){_0x4ce0e4[_0x8d8a('0x25')]=[{'all':!![]}];}_0x4ce0e4=_[_0x8d8a('0x32')]({},_0x4ce0e4,_0x4f5c84['options']);return db[_0x8d8a('0x21')][_0x8d8a('0x33')](_0x4ce0e4)[_0x8d8a('0x18')](handleEntityNotFound(_0x4e2572,null))['then'](respondWithResult(_0x4e2572,null))['catch'](handleError(_0x4e2572,null));};exports[_0x8d8a('0x34')]=function(_0x353396,_0x1ae2cd){return db[_0x8d8a('0x21')]['create'](_0x353396[_0x8d8a('0x35')],{})[_0x8d8a('0x18')](function(_0x1b4d61){var _0x47d04e=_0x353396[_0x8d8a('0x36')][_0x8d8a('0x37')]({'plain':!![]});if(!_0x47d04e)throw new Error(_0x8d8a('0x38'));if(_0x47d04e[_0x8d8a('0x39')]===_0x8d8a('0x36')){var _0x50d798=_0x1b4d61[_0x8d8a('0x37')]({'plain':!![]});var _0x511c8c='WhatsappQueues';return db[_0x8d8a('0x3a')][_0x8d8a('0x33')]({'where':{'name':_0x511c8c,'userProfileId':_0x47d04e[_0x8d8a('0x3b')]},'raw':!![]})['then'](function(_0x1cf664){if(_0x1cf664&&_0x1cf664[_0x8d8a('0x3c')]===0x0){return db[_0x8d8a('0x1a')][_0x8d8a('0x34')]({'name':_0x50d798[_0x8d8a('0x1d')],'resourceId':_0x50d798['id'],'type':_0x1cf664[_0x8d8a('0x1d')],'sectionId':_0x1cf664['id']},{})[_0x8d8a('0x18')](function(){return _0x1b4d61;});}else{return _0x1b4d61;}})['catch'](function(_0x1a5b5f){logger[_0x8d8a('0x1b')](_0x8d8a('0x3d'),_0x1a5b5f);throw _0x1a5b5f;});}return _0x1b4d61;})['then'](respondWithResult(_0x1ae2cd,0xc9))['catch'](handleError(_0x1ae2cd,null));};exports[_0x8d8a('0x16')]=function(_0x56c49d,_0x3d1892){if(_0x56c49d['body']['id']){delete _0x56c49d[_0x8d8a('0x35')]['id'];}return db[_0x8d8a('0x21')]['find']({'where':{'id':_0x56c49d['params']['id']}})['then'](handleEntityNotFound(_0x3d1892,null))['then'](saveUpdates(_0x56c49d[_0x8d8a('0x35')],null))[_0x8d8a('0x18')](respondWithResult(_0x3d1892,null))[_0x8d8a('0x28')](handleError(_0x3d1892,null));};exports[_0x8d8a('0x17')]=function(_0x5ad7e3,_0x5ecd82){return db['WhatsappQueue'][_0x8d8a('0x33')]({'where':{'id':_0x5ad7e3[_0x8d8a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5ecd82,null))[_0x8d8a('0x18')](removeEntity(_0x5ecd82,null))[_0x8d8a('0x28')](handleError(_0x5ecd82,null));};exports[_0x8d8a('0x3e')]=function(_0x51c52e,_0x5d3cf0){return db[_0x8d8a('0x21')]['describe']()[_0x8d8a('0x18')](respondWithResult(_0x5d3cf0,null))[_0x8d8a('0x28')](handleError(_0x5d3cf0,null));};exports['getMembers']=function(_0x41c137,_0x1eb219){var _0x480aa3={'raw':!![],'where':{}},_0x534473={},_0x4d0257;return db[_0x8d8a('0x21')][_0x8d8a('0x3f')]({'where':{'id':_0x41c137[_0x8d8a('0x2a')]['id']}})[_0x8d8a('0x18')](handleEntityNotFound(_0x1eb219,null))[_0x8d8a('0x18')](function(_0xb9536){if(_0xb9536){_0x4d0257=_0xb9536['get']({'plain':!![]});_0x534473[_0x8d8a('0x2b')]=_[_0x8d8a('0x2c')](db[_0x8d8a('0x40')][_0x8d8a('0x22')]);_0x534473[_0x8d8a('0x26')]=_[_0x8d8a('0x2c')](_0x41c137[_0x8d8a('0x26')]);_0x534473[_0x8d8a('0x41')]=_[_0x8d8a('0x2e')](_0x534473[_0x8d8a('0x2b')],_0x534473[_0x8d8a('0x26')]);_0x480aa3[_0x8d8a('0x2d')]=_['intersection'](_0x534473[_0x8d8a('0x2b')],qs[_0x8d8a('0x2f')](_0x41c137[_0x8d8a('0x26')]['fields']));_0x480aa3['attributes']=_0x480aa3[_0x8d8a('0x2d')][_0x8d8a('0x30')]?_0x480aa3[_0x8d8a('0x2d')]:_0x534473['model'];if(!_0x41c137[_0x8d8a('0x26')][_0x8d8a('0x42')](_0x8d8a('0x43'))){_0x480aa3[_0x8d8a('0x13')]=qs[_0x8d8a('0x13')](_0x41c137[_0x8d8a('0x26')][_0x8d8a('0x13')]);_0x480aa3[_0x8d8a('0x11')]=qs['offset'](_0x41c137[_0x8d8a('0x26')]['offset']);}_0x480aa3[_0x8d8a('0x44')]=qs[_0x8d8a('0x45')](_0x41c137[_0x8d8a('0x26')][_0x8d8a('0x45')]);_0x480aa3[_0x8d8a('0x46')]=qs['filters'](_[_0x8d8a('0x47')](_0x41c137['query'],_0x534473['filters']));_0x480aa3['where'][_0x8d8a('0x48')]=_0xb9536['id'];if(_0x41c137[_0x8d8a('0x26')][_0x8d8a('0x49')]){_0x480aa3[_0x8d8a('0x46')]=_[_0x8d8a('0x32')](_0x480aa3['where'],{'$or':_[_0x8d8a('0x20')](_0x480aa3[_0x8d8a('0x2d')],function(_0x3e79a7){var _0x53d0a2={};_0x53d0a2[_0x3e79a7]={'$like':'%'+_0x41c137['query']['filter']+'%'};return _0x53d0a2;})});}_0x480aa3=_[_0x8d8a('0x32')]({},_0x480aa3,_0x41c137[_0x8d8a('0x4a')]);return db[_0x8d8a('0x40')][_0x8d8a('0x4b')](_0x480aa3);}})[_0x8d8a('0x18')](function(_0x124354){if(_0x124354){return db[_0x8d8a('0x4c')][_0x8d8a('0x4d')]({'where':{'id':_[_0x8d8a('0x20')](_0x124354,_0x8d8a('0x4e')),'role':_0x8d8a('0x4f')},'attributes':['id',_0x8d8a('0x1d'),_0x8d8a('0x50'),'updatedAt',_0x8d8a('0x51')]});}})[_0x8d8a('0x18')](function(_0xf986fb){if(_0xf986fb){return{'count':_0xf986fb[_0x8d8a('0x14')],'rows':_[_0x8d8a('0x20')](_0xf986fb[_0x8d8a('0x27')],function(_0x4caa87){return{'membername':_0x4caa87[_0x8d8a('0x1d')],'UserId':_0x4caa87['id'],'queue_name':_0x4d0257[_0x8d8a('0x1d')],'WhatsappQueueId':_0x4d0257['id'],'interface':util['format']('%s/%s',_0x8d8a('0x52'),_0x4caa87[_0x8d8a('0x1d')]),'penalty':0x0,'paused':_0x4caa87['whatsappPause'],'createdAt':_0x4caa87[_0x8d8a('0x51')],'updatedAt':_0x4caa87[_0x8d8a('0x53')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d8a('0x18')](respondWithFilteredResult(_0x1eb219,_0x480aa3))[_0x8d8a('0x28')](handleError(_0x1eb219,null));};exports[_0x8d8a('0x54')]=function(_0x41f717,_0x27e620){var _0x5ed076={};var _0x480a12={};var _0x5c6524;var _0x3129b0;return db['WhatsappQueue'][_0x8d8a('0x3f')]({'where':{'id':_0x41f717['params']['id']}})[_0x8d8a('0x18')](handleEntityNotFound(_0x27e620,null))[_0x8d8a('0x18')](function(_0x9cead3){if(_0x9cead3){_0x5c6524=_0x9cead3;_0x480a12['model']=_[_0x8d8a('0x2c')](db[_0x8d8a('0x55')][_0x8d8a('0x22')]);_0x480a12[_0x8d8a('0x26')]=_['keys'](_0x41f717[_0x8d8a('0x26')]);_0x480a12[_0x8d8a('0x41')]=_[_0x8d8a('0x2e')](_0x480a12[_0x8d8a('0x2b')],_0x480a12[_0x8d8a('0x26')]);_0x5ed076[_0x8d8a('0x2d')]=_['intersection'](_0x480a12[_0x8d8a('0x2b')],qs['fields'](_0x41f717[_0x8d8a('0x26')][_0x8d8a('0x2f')]));_0x5ed076['attributes']=_0x5ed076['attributes'][_0x8d8a('0x30')]?_0x5ed076['attributes']:_0x480a12['model'];_0x5ed076[_0x8d8a('0x44')]=qs[_0x8d8a('0x45')](_0x41f717[_0x8d8a('0x26')][_0x8d8a('0x45')]);_0x5ed076[_0x8d8a('0x46')]=qs[_0x8d8a('0x41')](_[_0x8d8a('0x47')](_0x41f717[_0x8d8a('0x26')],_0x480a12[_0x8d8a('0x41')]));if(_0x41f717[_0x8d8a('0x26')]['filter']){_0x5ed076[_0x8d8a('0x46')]=_['merge'](_0x5ed076[_0x8d8a('0x46')],{'$or':_[_0x8d8a('0x20')](_0x5ed076['attributes'],function(_0x47605c){var _0x5a6abc={};_0x5a6abc[_0x47605c]={'$like':'%'+_0x41f717[_0x8d8a('0x26')][_0x8d8a('0x49')]+'%'};return _0x5a6abc;})});}_0x5ed076=_[_0x8d8a('0x32')]({},_0x5ed076,_0x41f717[_0x8d8a('0x4a')]);return _0x5c6524['getTeams'](_0x5ed076);}})[_0x8d8a('0x18')](function(_0x1c962e){if(_0x1c962e){_0x3129b0=_0x1c962e[_0x8d8a('0x30')];if(!_0x41f717[_0x8d8a('0x26')]['hasOwnProperty'](_0x8d8a('0x43'))){_0x5ed076[_0x8d8a('0x13')]=qs['limit'](_0x41f717[_0x8d8a('0x26')][_0x8d8a('0x13')]);_0x5ed076[_0x8d8a('0x11')]=qs[_0x8d8a('0x11')](_0x41f717['query']['offset']);}return _0x5c6524['getTeams'](_0x5ed076);}})[_0x8d8a('0x18')](function(_0x4d3570){if(_0x4d3570){return _0x4d3570?{'count':_0x3129b0,'rows':_0x4d3570}:null;}})[_0x8d8a('0x18')](respondWithResult(_0x27e620,null))[_0x8d8a('0x28')](handleError(_0x27e620,null));};exports[_0x8d8a('0x56')]=function(_0x578b9d,_0x39668f){var _0x519fd6=_0x578b9d['body'][_0x8d8a('0x57')];return db[_0x8d8a('0x55')][_0x8d8a('0x4b')]({'where':{'id':_0x519fd6},'attributes':['id'],'include':[{'model':db[_0x8d8a('0x4c')],'as':_0x8d8a('0x58'),'attributes':['id',_0x8d8a('0x1d'),_0x8d8a('0x59'),_0x8d8a('0x5a'),_0x8d8a('0x5b')],'raw':!![]}]})[_0x8d8a('0x18')](function(_0x4e7cff){if(_0x4e7cff){var _0x4eda20=_[_0x8d8a('0x5c')](_0x4e7cff,function(_0x25398d){var _0x3eb957=_0x25398d[_0x8d8a('0x37')]({'plain':!![]});return _0x3eb957[_0x8d8a('0x58')];});return db[_0x8d8a('0x21')][_0x8d8a('0x33')]({'where':{'id':_0x578b9d[_0x8d8a('0x2a')]['id']}})[_0x8d8a('0x18')](function(_0x234d16){return db[_0x8d8a('0x5d')]['transaction'](function(_0x5e2987){return _0x234d16[_0x8d8a('0x56')](_0x519fd6,{'transaction':_0x5e2987})[_0x8d8a('0x18')](function(){return BPromise[_0x8d8a('0x5e')](_0x4eda20,function(_0xc5f606){return db[_0x8d8a('0x40')][_0x8d8a('0x5f')]({'where':{'UserId':_0xc5f606['id'],'WhatsappQueueId':_0x578b9d[_0x8d8a('0x2a')]['id']},'transaction':_0x5e2987});});})[_0x8d8a('0x18')](function(){_0x4eda20[_0x8d8a('0x60')](function(_0x110eb5){socket[_0x8d8a('0x61')](_0x8d8a('0x62'),{'UserId':_0x110eb5['id'],'WhatsappQueueId':_0x234d16['id']});});});});});}})[_0x8d8a('0x18')](respondWithStatusCode(_0x39668f,null))[_0x8d8a('0x28')](handleError(_0x39668f,null));};exports['removeTeams']=function(_0xea2368,_0x1ac074){return db[_0x8d8a('0x55')][_0x8d8a('0x4b')]({'where':{'id':_0xea2368[_0x8d8a('0x26')][_0x8d8a('0x57')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8d8a('0x18')](handleEntityNotFound(_0x1ac074,null))['then'](function(_0xf30430){var _0x5e402a=_[_0x8d8a('0x20')](_0xf30430,'id');var _0x4cf388=[];var _0x4796b3=[];var _0x15b492=squel['select']();_0x15b492[_0x8d8a('0x63')](_0x8d8a('0x64'))['from'](_0x8d8a('0x65'),'tq')[_0x8d8a('0x66')](_0x8d8a('0x67'),'ut',_0x8d8a('0x68'))['where'](_0x8d8a('0x69'),_0xea2368['params']['id']);for(var _0x21f086=0x0;_0x21f086<_0xf30430[_0x8d8a('0x30')];_0x21f086+=0x1){let _0xe3680e=_0xf30430[_0x21f086];for(var _0x3892a6=0x0;_0x3892a6<_0xe3680e[_0x8d8a('0x58')][_0x8d8a('0x30')];_0x3892a6+=0x1){let _0x364235=_0xe3680e[_0x8d8a('0x58')][_0x3892a6];var _0x22d00b=_0x15b492[_0x8d8a('0x6a')]();_0x22d00b[_0x8d8a('0x46')](_0x8d8a('0x6b'),_0x364235['id']);_0x4796b3[_0x8d8a('0x6c')](db[_0x8d8a('0x5d')]['query'](_0x22d00b[_0x8d8a('0x6d')](),{'type':db[_0x8d8a('0x5d')][_0x8d8a('0x6e')][_0x8d8a('0x6f')]})[_0x8d8a('0x18')](function(_0x5a3829){if(_0x5a3829['length']===0x1){return _0x364235['id'];}else{var _0xdd07a0=_['every'](_[_0x8d8a('0x20')](_0x5a3829,_0x8d8a('0x70')),function(_0x383d86){return _[_0x8d8a('0x71')](_0x5e402a,_0x383d86);});if(_0xdd07a0){return _0x364235['id'];}}}));}}return BPromise['all'](_0x4796b3)[_0x8d8a('0x18')](function(_0x424c45){_0x4cf388=_(_0x4cf388)[_0x8d8a('0x72')](_0x424c45)[_0x8d8a('0x73')]()[_0x8d8a('0x74')]();return db[_0x8d8a('0x21')][_0x8d8a('0x33')]({'where':{'id':_0xea2368[_0x8d8a('0x2a')]['id']}})[_0x8d8a('0x18')](function(_0x5b2bc1){return db[_0x8d8a('0x5d')][_0x8d8a('0x75')](function(_0x4ad23b){return _0x5b2bc1[_0x8d8a('0x76')](_0xea2368['query'][_0x8d8a('0x57')],{'transaction':_0x4ad23b})[_0x8d8a('0x18')](function(){if(!_[_0x8d8a('0x77')](_0x4cf388)){return _0x5b2bc1[_0x8d8a('0x78')](_0x4cf388,{'transaction':_0x4ad23b});}})[_0x8d8a('0x18')](function(){_0x4cf388[_0x8d8a('0x60')](function(_0x37e4d2){socket[_0x8d8a('0x61')](_0x8d8a('0x79'),{'UserId':_0x37e4d2,'WhatsappQueueId':_0x5b2bc1['id']});});});});});});})[_0x8d8a('0x18')](respondWithStatusCode(_0x1ac074,null))['catch'](handleError(_0x1ac074,null));};exports[_0x8d8a('0x7a')]=function(_0x30bb98,_0x563903){return db[_0x8d8a('0x21')][_0x8d8a('0x33')]({'where':{'id':_0x30bb98[_0x8d8a('0x2a')]['id']}})[_0x8d8a('0x18')](handleEntityNotFound(_0x563903,null))[_0x8d8a('0x18')](function(_0x4c83b7){if(_0x4c83b7){return _0x4c83b7['addAgents'](_0x30bb98[_0x8d8a('0x35')][_0x8d8a('0x57')],_[_0x8d8a('0x7b')](_0x30bb98[_0x8d8a('0x35')],[_0x8d8a('0x57'),'id'])||{})[_0x8d8a('0x7c')](function(_0x26a76a){for(var _0x1fc04a=0x0;_0x1fc04a<_0x30bb98['body'][_0x8d8a('0x57')][_0x8d8a('0x30')];_0x1fc04a+=0x1){socket[_0x8d8a('0x61')](_0x8d8a('0x62'),{'UserId':Number(_0x30bb98[_0x8d8a('0x35')][_0x8d8a('0x57')][_0x1fc04a]),'WhatsappQueueId':Number(_0x30bb98['params']['id'])});}return _0x26a76a;});}})[_0x8d8a('0x18')](respondWithResult(_0x563903,null))[_0x8d8a('0x28')](handleError(_0x563903,null));};exports[_0x8d8a('0x78')]=function(_0x507021,_0x27fe01){return db[_0x8d8a('0x21')][_0x8d8a('0x33')]({'where':{'id':_0x507021[_0x8d8a('0x2a')]['id']}})[_0x8d8a('0x18')](handleEntityNotFound(_0x27fe01,null))[_0x8d8a('0x18')](function(_0x75a207){if(_0x75a207){return _0x75a207[_0x8d8a('0x78')](_0x507021[_0x8d8a('0x26')][_0x8d8a('0x57')])[_0x8d8a('0x18')](function(){if(_[_0x8d8a('0x7d')](_0x507021[_0x8d8a('0x26')][_0x8d8a('0x57')])){for(var _0x1debd5=0x0;_0x1debd5<_0x507021[_0x8d8a('0x26')]['ids']['length'];_0x1debd5+=0x1){socket[_0x8d8a('0x61')]('userWhatsappQueue:remove',{'UserId':Number(_0x507021[_0x8d8a('0x26')][_0x8d8a('0x57')][_0x1debd5]),'WhatsappQueueId':Number(_0x507021['params']['id'])});}}else{socket[_0x8d8a('0x61')](_0x8d8a('0x79'),{'UserId':Number(_0x507021['query'][_0x8d8a('0x57')]),'WhatsappQueueId':Number(_0x507021[_0x8d8a('0x2a')]['id'])});}});}})[_0x8d8a('0x18')](respondWithStatusCode(_0x27fe01,null))[_0x8d8a('0x28')](handleError(_0x27fe01,null));};exports[_0x8d8a('0x7e')]=function(_0x73a7e5,_0x2c3923){var _0x13caad={};var _0x16cf27={};var _0x243e80;var _0x456aa8;return db[_0x8d8a('0x21')][_0x8d8a('0x3f')]({'where':{'id':_0x73a7e5[_0x8d8a('0x2a')]['id']}})[_0x8d8a('0x18')](handleEntityNotFound(_0x2c3923,null))[_0x8d8a('0x18')](function(_0x362b71){if(_0x362b71){_0x243e80=_0x362b71;_0x16cf27[_0x8d8a('0x2b')]=_[_0x8d8a('0x2c')](db['User']['rawAttributes']);_0x16cf27[_0x8d8a('0x26')]=_['keys'](_0x73a7e5[_0x8d8a('0x26')]);_0x16cf27[_0x8d8a('0x41')]=_['intersection'](_0x16cf27[_0x8d8a('0x2b')],_0x16cf27['query']);_0x13caad[_0x8d8a('0x2d')]=_[_0x8d8a('0x2e')](_0x16cf27[_0x8d8a('0x2b')],qs[_0x8d8a('0x2f')](_0x73a7e5[_0x8d8a('0x26')]['fields']));_0x13caad['attributes']=_0x13caad[_0x8d8a('0x2d')][_0x8d8a('0x30')]?_0x13caad['attributes']:_0x16cf27[_0x8d8a('0x2b')];_0x13caad[_0x8d8a('0x44')]=qs[_0x8d8a('0x45')](_0x73a7e5['query'][_0x8d8a('0x45')]);_0x13caad[_0x8d8a('0x46')]=qs['filters'](_[_0x8d8a('0x47')](_0x73a7e5[_0x8d8a('0x26')],_0x16cf27['filters']));if(_0x73a7e5[_0x8d8a('0x26')]['filter']){_0x13caad[_0x8d8a('0x46')]=_[_0x8d8a('0x32')](_0x13caad[_0x8d8a('0x46')],{'$or':_[_0x8d8a('0x20')](_0x13caad[_0x8d8a('0x2d')],function(_0x481084){var _0x57c863={};_0x57c863[_0x481084]={'$like':'%'+_0x73a7e5[_0x8d8a('0x26')][_0x8d8a('0x49')]+'%'};return _0x57c863;})});}_0x13caad=_[_0x8d8a('0x32')]({},_0x13caad,_0x73a7e5[_0x8d8a('0x4a')]);return _0x243e80['getAgents'](_0x13caad);}})[_0x8d8a('0x18')](function(_0x9f117e){if(_0x9f117e){_0x456aa8=_0x9f117e[_0x8d8a('0x30')];if(!_0x73a7e5[_0x8d8a('0x26')][_0x8d8a('0x42')](_0x8d8a('0x43'))){_0x13caad[_0x8d8a('0x13')]=qs[_0x8d8a('0x13')](_0x73a7e5[_0x8d8a('0x26')][_0x8d8a('0x13')]);_0x13caad[_0x8d8a('0x11')]=qs[_0x8d8a('0x11')](_0x73a7e5[_0x8d8a('0x26')]['offset']);}return _0x243e80[_0x8d8a('0x7e')](_0x13caad);}})['then'](function(_0x1e7086){if(_0x1e7086){return _0x1e7086?{'count':_0x456aa8,'rows':_0x1e7086}:null;}})['then'](respondWithResult(_0x2c3923,null))[_0x8d8a('0x28')](handleError(_0x2c3923,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 3a0985b..f8c1f6a 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 _0xf4df=['exports','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x382bba,_0x552036){var _0x208ad7=function(_0x47fed8){while(--_0x47fed8){_0x382bba['push'](_0x382bba['shift']());}};_0x208ad7(++_0x552036);}(_0xf4df,0x1b9));var _0xff4d=function(_0x3e7c63,_0xc2b958){_0x3e7c63=_0x3e7c63-0x0;var _0x1ddc57=_0xf4df[_0x3e7c63];return _0x1ddc57;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xff4d('0x0'))['db'][_0xff4d('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xff4d('0x2')](0x0);var events={'afterCreate':_0xff4d('0x3'),'afterUpdate':_0xff4d('0x4'),'afterDestroy':_0xff4d('0x5')};function emitEvent(_0x2cdac7){return function(_0x103e16,_0x152e9f,_0x426c8a){WhatsappQueueEvents[_0xff4d('0x6')](_0x2cdac7+':'+_0x103e16['id'],_0x103e16);WhatsappQueueEvents['emit'](_0x2cdac7,_0x103e16);_0x426c8a(null);};}for(var e in events){if(events[_0xff4d('0x7')](e)){var event=events[e];WhatsappQueue[_0xff4d('0x8')](e,emitEvent(event));}}module[_0xff4d('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0x991f=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','WhatsappQueue'];(function(_0x2f1a99,_0x27bd1c){var _0x4c415c=function(_0x11720c){while(--_0x11720c){_0x2f1a99['push'](_0x2f1a99['shift']());}};_0x4c415c(++_0x27bd1c);}(_0x991f,0xd7));var _0xf991=function(_0x20b5d6,_0x426c04){_0x20b5d6=_0x20b5d6-0x0;var _0x1d3319=_0x991f[_0x20b5d6];return _0x1d3319;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0xf991('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf991('0x1')](0x0);var events={'afterCreate':_0xf991('0x2'),'afterUpdate':_0xf991('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10f898){return function(_0x4f9cc1,_0x2aad90,_0x41b8ba){WhatsappQueueEvents[_0xf991('0x4')](_0x10f898+':'+_0x4f9cc1['id'],_0x4f9cc1);WhatsappQueueEvents['emit'](_0x10f898,_0x4f9cc1);_0x41b8ba(null);};}for(var e in events){if(events[_0xf991('0x5')](e)){var event=events[e];WhatsappQueue[_0xf991('0x6')](e,emitEvent(event));}}module[_0xf991('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 69688f2..447f84e 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 _0xa711=['whatsapp_queues','lodash','../../config/logger','api','bluebird','request-promise','./whatsappQueue.attributes','exports','define','WhatsappQueue'];(function(_0x2d0043,_0x160399){var _0x1a7c6f=function(_0x1921dc){while(--_0x1921dc){_0x2d0043['push'](_0x2d0043['shift']());}};_0x1a7c6f(++_0x160399);}(_0xa711,0x123));var _0x1a71=function(_0x25e324,_0x4e7e0f){_0x25e324=_0x25e324-0x0;var _0x863d7a=_0xa711[_0x25e324];return _0x863d7a;};'use strict';var _=require(_0x1a71('0x0'));var util=require('util');var logger=require(_0x1a71('0x1'))(_0x1a71('0x2'));var moment=require('moment');var BPromise=require(_0x1a71('0x3'));var rp=require(_0x1a71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1a71('0x5'));module[_0x1a71('0x6')]=function(_0xcf45c,_0x221da7){return _0xcf45c[_0x1a71('0x7')](_0x1a71('0x8'),attributes,{'tableName':_0x1a71('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6483=['lodash','util','api','bluebird','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','whatsapp_queues'];(function(_0x22b8d4,_0x3c0230){var _0x2b0328=function(_0x13bfbc){while(--_0x13bfbc){_0x22b8d4['push'](_0x22b8d4['shift']());}};_0x2b0328(++_0x3c0230);}(_0x6483,0xb0));var _0x3648=function(_0x5238ca,_0x750aa4){_0x5238ca=_0x5238ca-0x0;var _0x4f39f8=_0x6483[_0x5238ca];return _0x4f39f8;};'use strict';var _=require(_0x3648('0x0'));var util=require(_0x3648('0x1'));var logger=require('../../config/logger')(_0x3648('0x2'));var moment=require('moment');var BPromise=require(_0x3648('0x3'));var rp=require(_0x3648('0x4'));var fs=require('fs');var path=require(_0x3648('0x5'));var rimraf=require(_0x3648('0x6'));var config=require('../../config/environment');var attributes=require(_0x3648('0x7'));module[_0x3648('0x8')]=function(_0x2da67d,_0x12243a){return _0x2da67d[_0x3648('0x9')]('WhatsappQueue',attributes,{'tableName':_0x3648('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 4c3e88c..7eb6eb3 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 _0x1ee8=['catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowWhatsappQueue','find','util','moment','randomstring','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x5cfda6,_0x1d64e6){var _0x279770=function(_0x115701){while(--_0x115701){_0x5cfda6['push'](_0x5cfda6['shift']());}};_0x279770(++_0x1d64e6);}(_0x1ee8,0xa7));var _0x81ee=function(_0x6c44a1,_0x17df10){_0x6c44a1=_0x6c44a1-0x0;var _0x28a4b7=_0x1ee8[_0x6c44a1];return _0x28a4b7;};'use strict';var _=require('lodash');var util=require(_0x81ee('0x0'));var moment=require(_0x81ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x81ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x81ee('0x3'))(_0x81ee('0x4'));var config=require('../../config/environment');var jayson=require(_0x81ee('0x5'));var client=jayson[_0x81ee('0x6')]['http']({'port':0x232a});config[_0x81ee('0x7')]=_[_0x81ee('0x8')](config[_0x81ee('0x7')],{'host':_0x81ee('0x9'),'port':0x18eb});var socket=require(_0x81ee('0xa'))(new Redis(config['redis']));require(_0x81ee('0xb'))[_0x81ee('0xc')](socket);function respondWithRpcPromise(_0x294517,_0x177038,_0x40f13e){return new BPromise(function(_0x33d0ab,_0x1ad000){return client[_0x81ee('0xd')](_0x294517,_0x40f13e)[_0x81ee('0xe')](function(_0x374274){logger[_0x81ee('0xf')](_0x81ee('0x10'),_0x177038,_0x81ee('0x11'));logger[_0x81ee('0x12')](_0x81ee('0x13'),_0x177038,_0x81ee('0x11'),JSON['stringify'](_0x374274));if(_0x374274['error']){if(_0x374274['error']['code']===0x1f4){logger[_0x81ee('0x14')](_0x81ee('0x10'),_0x177038,_0x374274[_0x81ee('0x14')][_0x81ee('0x15')]);return _0x1ad000(_0x374274[_0x81ee('0x14')]['message']);}logger[_0x81ee('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x177038,_0x374274[_0x81ee('0x14')][_0x81ee('0x15')]);return _0x33d0ab(_0x374274[_0x81ee('0x14')][_0x81ee('0x15')]);}else{logger[_0x81ee('0xf')](_0x81ee('0x10'),_0x177038,'request\x20sent');_0x33d0ab(_0x374274[_0x81ee('0x16')]['message']);}})[_0x81ee('0x17')](function(_0x1c067c){logger[_0x81ee('0x14')](_0x81ee('0x10'),_0x177038,_0x1c067c);_0x1ad000(_0x1c067c);});});}exports[_0x81ee('0x18')]=function(_0x20600b){var _0x40939e=this;return new Promise(function(_0x2ad413,_0x5254c6){return db[_0x81ee('0x19')][_0x81ee('0x1a')]({'raw':_0x20600b[_0x81ee('0x1b')]?_0x20600b[_0x81ee('0x1b')][_0x81ee('0x1c')]===undefined?!![]:![]:!![],'where':_0x20600b['options']?_0x20600b[_0x81ee('0x1b')][_0x81ee('0x1d')]||null:null,'attributes':_0x20600b[_0x81ee('0x1b')]?_0x20600b['options']['attributes']||null:null,'limit':_0x20600b['options']?_0x20600b[_0x81ee('0x1b')][_0x81ee('0x1e')]||null:null,'include':_0x20600b['options']?_0x20600b[_0x81ee('0x1b')][_0x81ee('0x1f')]?_[_0x81ee('0x20')](_0x20600b[_0x81ee('0x1b')]['include'],function(_0x5700d7){return{'model':db[_0x5700d7['model']],'as':_0x5700d7['as'],'attributes':_0x5700d7['attributes'],'include':_0x5700d7[_0x81ee('0x1f')]?_[_0x81ee('0x20')](_0x5700d7[_0x81ee('0x1f')],function(_0x4771a7){return{'model':db[_0x4771a7[_0x81ee('0x21')]],'as':_0x4771a7['as'],'attributes':_0x4771a7[_0x81ee('0x22')],'include':_0x4771a7[_0x81ee('0x1f')]?_[_0x81ee('0x20')](_0x4771a7[_0x81ee('0x1f')],function(_0x115d76){return{'model':db[_0x115d76[_0x81ee('0x21')]],'as':_0x115d76['as'],'attributes':_0x115d76[_0x81ee('0x22')]};}):[]};}):[]};}):[]:[]})[_0x81ee('0xe')](function(_0x445ca5){logger[_0x81ee('0xf')](_0x81ee('0x18'),_0x20600b);logger[_0x81ee('0x12')](_0x81ee('0x18'),_0x20600b,JSON[_0x81ee('0x23')](_0x445ca5));_0x2ad413(_0x445ca5);})['catch'](function(_0x30b060){logger[_0x81ee('0x14')]('GetWhatsappQueue',_0x30b060[_0x81ee('0x15')],_0x20600b);_0x5254c6(_0x40939e[_0x81ee('0x14')](0x1f4,_0x30b060[_0x81ee('0x15')]));});});};exports[_0x81ee('0x24')]=function(_0x4411db){var _0x294d32=this;return new Promise(function(_0x220fca,_0x3b8cd){return db[_0x81ee('0x19')][_0x81ee('0x25')]({'raw':_0x4411db['options']?_0x4411db[_0x81ee('0x1b')][_0x81ee('0x1c')]===undefined?!![]:![]:!![],'where':_0x4411db[_0x81ee('0x1b')]?_0x4411db['options']['where']||null:null,'attributes':_0x4411db[_0x81ee('0x1b')]?_0x4411db['options'][_0x81ee('0x22')]||null:null,'include':_0x4411db[_0x81ee('0x1b')]?_0x4411db[_0x81ee('0x1b')][_0x81ee('0x1f')]?_['map'](_0x4411db[_0x81ee('0x1b')][_0x81ee('0x1f')],function(_0x3ce379){return{'model':db[_0x3ce379[_0x81ee('0x21')]],'as':_0x3ce379['as'],'attributes':_0x3ce379[_0x81ee('0x22')],'include':_0x3ce379['include']?_['map'](_0x3ce379[_0x81ee('0x1f')],function(_0x475085){return{'model':db[_0x475085[_0x81ee('0x21')]],'as':_0x475085['as'],'attributes':_0x475085['attributes'],'include':_0x475085[_0x81ee('0x1f')]?_[_0x81ee('0x20')](_0x475085[_0x81ee('0x1f')],function(_0x13df67){return{'model':db[_0x13df67[_0x81ee('0x21')]],'as':_0x13df67['as'],'attributes':_0x13df67['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x49b8db){logger[_0x81ee('0xf')]('ShowWhatsappQueue',_0x4411db);logger['debug']('ShowWhatsappQueue',_0x4411db,JSON[_0x81ee('0x23')](_0x49b8db));_0x220fca(_0x49b8db);})['catch'](function(_0x37a5ed){logger[_0x81ee('0x14')]('ShowWhatsappQueue',_0x37a5ed['message'],_0x4411db);_0x3b8cd(_0x294d32[_0x81ee('0x14')](0x1f4,_0x37a5ed[_0x81ee('0x15')]));});});}; \ No newline at end of file +var _0xdad2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','GetWhatsappQueue','WhatsappQueue','findAll','options','attributes','limit','include','map','model','catch','find','ShowWhatsappQueue','lodash','bluebird'];(function(_0x3a801b,_0x592c24){var _0x2535fe=function(_0x53f3b1){while(--_0x53f3b1){_0x3a801b['push'](_0x3a801b['shift']());}};_0x2535fe(++_0x592c24);}(_0xdad2,0xee));var _0x2dad=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xdad2[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x2dad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2dad('0x1'));var rs=require(_0x2dad('0x2'));var fs=require('fs');var Redis=require(_0x2dad('0x3'));var db=require(_0x2dad('0x4'))['db'];var utils=require(_0x2dad('0x5'));var logger=require(_0x2dad('0x6'))(_0x2dad('0x7'));var config=require(_0x2dad('0x8'));var jayson=require(_0x2dad('0x9'));var client=jayson[_0x2dad('0xa')]['http']({'port':0x232a});config[_0x2dad('0xb')]=_[_0x2dad('0xc')](config[_0x2dad('0xb')],{'host':_0x2dad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2dad('0xb')]));require(_0x2dad('0xe'))[_0x2dad('0xf')](socket);function respondWithRpcPromise(_0x310eb0,_0x41450c,_0x575123){return new BPromise(function(_0x2771cb,_0x434c84){return client[_0x2dad('0x10')](_0x310eb0,_0x575123)[_0x2dad('0x11')](function(_0x333df1){logger[_0x2dad('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x41450c,_0x2dad('0x13'));logger[_0x2dad('0x14')](_0x2dad('0x15'),_0x41450c,_0x2dad('0x13'),JSON[_0x2dad('0x16')](_0x333df1));if(_0x333df1['error']){if(_0x333df1[_0x2dad('0x17')][_0x2dad('0x18')]===0x1f4){logger[_0x2dad('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x41450c,_0x333df1['error'][_0x2dad('0x19')]);return _0x434c84(_0x333df1[_0x2dad('0x17')][_0x2dad('0x19')]);}logger[_0x2dad('0x17')](_0x2dad('0x1a'),_0x41450c,_0x333df1[_0x2dad('0x17')][_0x2dad('0x19')]);return _0x2771cb(_0x333df1[_0x2dad('0x17')][_0x2dad('0x19')]);}else{logger[_0x2dad('0x12')](_0x2dad('0x1a'),_0x41450c,_0x2dad('0x13'));_0x2771cb(_0x333df1[_0x2dad('0x1b')]['message']);}})['catch'](function(_0x515454){logger[_0x2dad('0x17')](_0x2dad('0x1a'),_0x41450c,_0x515454);_0x434c84(_0x515454);});});}exports[_0x2dad('0x1c')]=function(_0x3045a0){var _0x17a10d=this;return new Promise(function(_0x276428,_0x48aa95){return db[_0x2dad('0x1d')][_0x2dad('0x1e')]({'raw':_0x3045a0[_0x2dad('0x1f')]?_0x3045a0['options']['raw']===undefined?!![]:![]:!![],'where':_0x3045a0['options']?_0x3045a0[_0x2dad('0x1f')]['where']||null:null,'attributes':_0x3045a0[_0x2dad('0x1f')]?_0x3045a0[_0x2dad('0x1f')][_0x2dad('0x20')]||null:null,'limit':_0x3045a0[_0x2dad('0x1f')]?_0x3045a0[_0x2dad('0x1f')][_0x2dad('0x21')]||null:null,'include':_0x3045a0['options']?_0x3045a0['options'][_0x2dad('0x22')]?_[_0x2dad('0x23')](_0x3045a0[_0x2dad('0x1f')][_0x2dad('0x22')],function(_0x4af639){return{'model':db[_0x4af639[_0x2dad('0x24')]],'as':_0x4af639['as'],'attributes':_0x4af639[_0x2dad('0x20')],'include':_0x4af639[_0x2dad('0x22')]?_['map'](_0x4af639['include'],function(_0xca8ead){return{'model':db[_0xca8ead['model']],'as':_0xca8ead['as'],'attributes':_0xca8ead[_0x2dad('0x20')],'include':_0xca8ead[_0x2dad('0x22')]?_['map'](_0xca8ead[_0x2dad('0x22')],function(_0x42c611){return{'model':db[_0x42c611[_0x2dad('0x24')]],'as':_0x42c611['as'],'attributes':_0x42c611['attributes']};}):[]};}):[]};}):[]:[]})[_0x2dad('0x11')](function(_0x284c6a){logger[_0x2dad('0x12')](_0x2dad('0x1c'),_0x3045a0);logger['debug'](_0x2dad('0x1c'),_0x3045a0,JSON[_0x2dad('0x16')](_0x284c6a));_0x276428(_0x284c6a);})[_0x2dad('0x25')](function(_0x104e8c){logger['error']('GetWhatsappQueue',_0x104e8c['message'],_0x3045a0);_0x48aa95(_0x17a10d['error'](0x1f4,_0x104e8c[_0x2dad('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x3f8acb){var _0x403905=this;return new Promise(function(_0xec272f,_0xa97543){return db[_0x2dad('0x1d')][_0x2dad('0x26')]({'raw':_0x3f8acb[_0x2dad('0x1f')]?_0x3f8acb[_0x2dad('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3f8acb[_0x2dad('0x1f')]?_0x3f8acb[_0x2dad('0x1f')]['where']||null:null,'attributes':_0x3f8acb[_0x2dad('0x1f')]?_0x3f8acb[_0x2dad('0x1f')][_0x2dad('0x20')]||null:null,'include':_0x3f8acb[_0x2dad('0x1f')]?_0x3f8acb['options'][_0x2dad('0x22')]?_[_0x2dad('0x23')](_0x3f8acb[_0x2dad('0x1f')]['include'],function(_0x52117b){return{'model':db[_0x52117b['model']],'as':_0x52117b['as'],'attributes':_0x52117b[_0x2dad('0x20')],'include':_0x52117b[_0x2dad('0x22')]?_['map'](_0x52117b['include'],function(_0xd39ab5){return{'model':db[_0xd39ab5['model']],'as':_0xd39ab5['as'],'attributes':_0xd39ab5[_0x2dad('0x20')],'include':_0xd39ab5[_0x2dad('0x22')]?_[_0x2dad('0x23')](_0xd39ab5[_0x2dad('0x22')],function(_0x1e4e66){return{'model':db[_0x1e4e66[_0x2dad('0x24')]],'as':_0x1e4e66['as'],'attributes':_0x1e4e66[_0x2dad('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2dad('0x11')](function(_0x5d3905){logger['info']('ShowWhatsappQueue',_0x3f8acb);logger['debug'](_0x2dad('0x27'),_0x3f8acb,JSON['stringify'](_0x5d3905));_0xec272f(_0x5d3905);})[_0x2dad('0x25')](function(_0x252caa){logger[_0x2dad('0x17')]('ShowWhatsappQueue',_0x252caa[_0x2dad('0x19')],_0x3f8acb);_0xa97543(_0x403905[_0x2dad('0x17')](0x1f4,_0x252caa['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index f7dc646..5dc92c3 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 _0xcecd=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x3990d3,_0x54d8cc){var _0x2218fa=function(_0x4adebf){while(--_0x4adebf){_0x3990d3['push'](_0x3990d3['shift']());}};_0x2218fa(++_0x54d8cc);}(_0xcecd,0x8d));var _0xdcec=function(_0x33445f,_0x1c5487){_0x33445f=_0x33445f-0x0;var _0x3c52ae=_0xcecd[_0x33445f];return _0x3c52ae;};'use strict';var WhatsappQueueEvents=require(_0xdcec('0x0'));var events=[_0xdcec('0x1'),_0xdcec('0x2'),_0xdcec('0x3')];function createListener(_0x50e0cd,_0x233653){return function(_0x92900d){_0x233653[_0xdcec('0x4')](_0x50e0cd,_0x92900d);};}function removeListener(_0x571a65,_0x10e045){return function(){WhatsappQueueEvents[_0xdcec('0x5')](_0x571a65,_0x10e045);};}exports[_0xdcec('0x6')]=function(_0x12e470){for(var _0x2c9979=0x0,_0x18983b=events[_0xdcec('0x7')];_0x2c9979<_0x18983b;_0x2c9979++){var _0x29f6da=events[_0x2c9979];var _0x26f234=createListener(_0xdcec('0x8')+_0x29f6da,_0x12e470);WhatsappQueueEvents['on'](_0x29f6da,_0x26f234);}}; \ No newline at end of file +var _0x6ba5=['update','emit','removeListener','register','./whatsappQueue.events','save','remove'];(function(_0x444002,_0x14b95c){var _0x3d1271=function(_0x105248){while(--_0x105248){_0x444002['push'](_0x444002['shift']());}};_0x3d1271(++_0x14b95c);}(_0x6ba5,0x17e));var _0x56ba=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0x6ba5[_0x12b8ec];return _0x21af77;};'use strict';var WhatsappQueueEvents=require(_0x56ba('0x0'));var events=[_0x56ba('0x1'),_0x56ba('0x2'),_0x56ba('0x3')];function createListener(_0x34dda2,_0x24d4fb){return function(_0x48c761){_0x24d4fb[_0x56ba('0x4')](_0x34dda2,_0x48c761);};}function removeListener(_0x379c30,_0x33260){return function(){WhatsappQueueEvents[_0x56ba('0x5')](_0x379c30,_0x33260);};}exports[_0x56ba('0x6')]=function(_0xfdfdc1){for(var _0x585226=0x0,_0x21771b=events['length'];_0x585226<_0x21771b;_0x585226++){var _0x4ffd8a=events[_0x585226];var _0xa08f9a=createListener('whatsappQueue:'+_0x4ffd8a,_0xfdfdc1);WhatsappQueueEvents['on'](_0x4ffd8a,_0xa08f9a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ce8365b..8b945d5 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 _0xab89=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14c43d,_0x3878be){var _0x305631=function(_0x4815c2){while(--_0x4815c2){_0x14c43d['push'](_0x14c43d['shift']());}};_0x305631(++_0x3878be);}(_0xab89,0x1ed));var _0x9ab8=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xab89[_0x5f3f88];return _0xd08119;};'use strict';var multer=require(_0x9ab8('0x0'));var util=require(_0x9ab8('0x1'));var path=require(_0x9ab8('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ab8('0x3'));var router=express['Router']();var fs_extra=require(_0x9ab8('0x4'));var auth=require(_0x9ab8('0x5'));var interaction=require(_0x9ab8('0x6'));var config=require(_0x9ab8('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x9ab8('0x8')]('/',auth[_0x9ab8('0x9')](),controller[_0x9ab8('0xa')]);router[_0x9ab8('0x8')](_0x9ab8('0xb'),auth[_0x9ab8('0x9')](),controller[_0x9ab8('0xc')]);router[_0x9ab8('0x8')](_0x9ab8('0xd'),auth[_0x9ab8('0x9')](),controller[_0x9ab8('0xe')]);router[_0x9ab8('0xf')]('/',auth[_0x9ab8('0x9')](),controller[_0x9ab8('0x10')]);router[_0x9ab8('0x11')](_0x9ab8('0xd'),auth[_0x9ab8('0x9')](),controller['update']);router['delete'](_0x9ab8('0xd'),auth[_0x9ab8('0x9')](),controller[_0x9ab8('0x12')]);module[_0x9ab8('0x13')]=router; \ No newline at end of file +var _0x51bf=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','get','/describe'];(function(_0x99405c,_0x445476){var _0x3daed0=function(_0x21d002){while(--_0x21d002){_0x99405c['push'](_0x99405c['shift']());}};_0x3daed0(++_0x445476);}(_0x51bf,0x185));var _0xf51b=function(_0x5c8734,_0xdef60){_0x5c8734=_0x5c8734-0x0;var _0x2ac6f8=_0x51bf[_0x5c8734];return _0x2ac6f8;};'use strict';var multer=require(_0xf51b('0x0'));var util=require(_0xf51b('0x1'));var path=require(_0xf51b('0x2'));var timeout=require(_0xf51b('0x3'));var express=require(_0xf51b('0x4'));var router=express[_0xf51b('0x5')]();var fs_extra=require(_0xf51b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf51b('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xf51b('0x8')](),controller['index']);router[_0xf51b('0x9')](_0xf51b('0xa'),auth['isAuthenticated'](),controller[_0xf51b('0xb')]);router[_0xf51b('0x9')](_0xf51b('0xc'),auth['isAuthenticated'](),controller[_0xf51b('0xd')]);router[_0xf51b('0xe')]('/',auth['isAuthenticated'](),controller[_0xf51b('0xf')]);router[_0xf51b('0x10')](_0xf51b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf51b('0x11')](_0xf51b('0xc'),auth[_0xf51b('0x8')](),controller[_0xf51b('0x12')]);module[_0xf51b('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index bbd1a9d..03b79b0 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4f8ebc,_0x529e08){var _0x28e654=function(_0x423783){while(--_0x423783){_0x4f8ebc['push'](_0x4f8ebc['shift']());}};_0x28e654(++_0x529e08);}(_0x7a54,0x106));var _0x47a5=function(_0x2174a2,_0x5a6bf9){_0x2174a2=_0x2174a2-0x0;var _0x159ab6=_0x7a54[_0x2174a2];return _0x159ab6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4002d1,_0x55ee08){var _0x54031c=function(_0x30cd45){while(--_0x30cd45){_0x4002d1['push'](_0x4002d1['shift']());}};_0x54031c(++_0x55ee08);}(_0x7a54,0x106));var _0x47a5=function(_0x41d9fc,_0x9595ec){_0x41d9fc=_0x41d9fc-0x0;var _0x1527af=_0x7a54[_0x41d9fc];return _0x1527af;};'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 88f1133..417ef79 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 _0x5b12=['options','includeAll','include','findAll','then','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','WhatsappQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x14e322,_0x4215c2){var _0x329687=function(_0x1f238e){while(--_0x1f238e){_0x14e322['push'](_0x14e322['shift']());}};_0x329687(++_0x4215c2);}(_0x5b12,0xa3));var _0x25b1=function(_0x5d0b24,_0x370673){_0x5d0b24=_0x5d0b24-0x0;var _0x20bfe5=_0x5b12[_0x5d0b24];return _0x20bfe5;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];function respondWithStatusCode(_0x459070,_0xbdd348){_0xbdd348=_0xbdd348||0xcc;return function(_0x1c5421){if(_0x1c5421){return _0x459070[_0x25b1('0x19')](_0xbdd348);}return _0x459070[_0x25b1('0x1a')](_0xbdd348)[_0x25b1('0x1b')]();};}function respondWithResult(_0x76b5c4,_0x4ee40c){_0x4ee40c=_0x4ee40c||0xc8;return function(_0x2c337a){if(_0x2c337a){return _0x76b5c4[_0x25b1('0x1a')](_0x4ee40c)['json'](_0x2c337a);}};}function respondWithFilteredResult(_0xb5b9cf,_0x4bb1bb){return function(_0xe32e02){if(_0xe32e02){var _0x4a5a58=typeof _0x4bb1bb['offset']===_0x25b1('0x1c')&&typeof _0x4bb1bb['limit']===_0x25b1('0x1c');var _0x2ca567=_0xe32e02[_0x25b1('0x1d')];var _0x27ccc9=_0x4a5a58?0x0:_0x4bb1bb[_0x25b1('0x1e')];var _0x2a7d14=_0x4a5a58?_0xe32e02[_0x25b1('0x1d')]:_0x4bb1bb[_0x25b1('0x1e')]+_0x4bb1bb['limit'];var _0x4ecff1;if(_0x2a7d14>=_0x2ca567){_0x2a7d14=_0x2ca567;_0x4ecff1=0xc8;}else{_0x4ecff1=0xce;}_0xb5b9cf[_0x25b1('0x1a')](_0x4ecff1);return _0xb5b9cf['set'](_0x25b1('0x1f'),_0x27ccc9+'-'+_0x2a7d14+'/'+_0x2ca567)['json'](_0xe32e02);}return null;};}function patchUpdates(_0x3bfd7d){return function(_0x59aa37){try{jsonpatch[_0x25b1('0x20')](_0x59aa37,_0x3bfd7d,!![]);}catch(_0x529310){return BPromise[_0x25b1('0x21')](_0x529310);}return _0x59aa37['save']();};}function saveUpdates(_0x4e3f48,_0x565cfd){return function(_0x3bca9f){if(_0x3bca9f){return _0x3bca9f[_0x25b1('0x22')](_0x4e3f48)['then'](function(_0x19bab8){return _0x19bab8;});}return null;};}function removeEntity(_0x26b555,_0x1e5915){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x25b1('0x23')]()['then'](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0xd22469,_0x282187){return function(_0x1f37ed){if(!_0x1f37ed){_0xd22469[_0x25b1('0x19')](0x194);}return _0x1f37ed;};}function handleError(_0x5d9ed7,_0x3c05c6){_0x3c05c6=_0x3c05c6||0x1f4;return function(_0x27dd68){logger[_0x25b1('0x24')](_0x27dd68['stack']);if(_0x27dd68[_0x25b1('0x25')]){delete _0x27dd68[_0x25b1('0x25')];}_0x5d9ed7[_0x25b1('0x1a')](_0x3c05c6)['send'](_0x27dd68);};}exports[_0x25b1('0x26')]=function(_0x54ce2d,_0x19ecd1){var _0x3febb8={},_0x3a4475={},_0x293413={'count':0x0,'rows':[]};var _0x362118=_[_0x25b1('0x27')](db[_0x25b1('0x28')]['rawAttributes'],function(_0x30d455){return{'name':_0x30d455[_0x25b1('0x29')],'type':_0x30d455[_0x25b1('0x2a')][_0x25b1('0x2b')]};});_0x3a4475[_0x25b1('0x2c')]=_['map'](_0x362118,_0x25b1('0x25'));_0x3a4475[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x54ce2d[_0x25b1('0x2d')]);_0x3a4475[_0x25b1('0x2f')]=_['intersection'](_0x3a4475['model'],_0x3a4475[_0x25b1('0x2d')]);_0x3febb8['attributes']=_[_0x25b1('0x30')](_0x3a4475[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x54ce2d['query']['fields']));_0x3febb8[_0x25b1('0x32')]=_0x3febb8[_0x25b1('0x32')][_0x25b1('0x33')]?_0x3febb8['attributes']:_0x3a4475[_0x25b1('0x2c')];if(!_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x34')](_0x25b1('0x35'))){_0x3febb8['limit']=qs[_0x25b1('0x36')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x36')]);_0x3febb8['offset']=qs['offset'](_0x54ce2d[_0x25b1('0x2d')]['offset']);}_0x3febb8[_0x25b1('0x37')]=qs[_0x25b1('0x38')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x38')]);_0x3febb8[_0x25b1('0x39')]=qs[_0x25b1('0x2f')](_[_0x25b1('0x3a')](_0x54ce2d[_0x25b1('0x2d')],_0x3a4475[_0x25b1('0x2f')]),_0x362118);if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]){_0x3febb8[_0x25b1('0x39')]=_[_0x25b1('0x3c')](_0x3febb8[_0x25b1('0x39')],{'$or':_[_0x25b1('0x27')](_0x362118,function(_0x4837d5){if(_0x4837d5[_0x25b1('0x2a')]!==_0x25b1('0x3d')){var _0x53423d={};_0x53423d[_0x4837d5[_0x25b1('0x25')]]={'$like':'%'+_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]+'%'};return _0x53423d;}})});}_0x3febb8=_[_0x25b1('0x3c')]({},_0x3febb8,_0x54ce2d[_0x25b1('0x3e')]);var _0x5bdefd={'where':_0x3febb8[_0x25b1('0x39')]};return db['WhatsappQueueReport'][_0x25b1('0x1d')](_0x5bdefd)['then'](function(_0x2e8747){_0x293413[_0x25b1('0x1d')]=_0x2e8747;if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x3febb8[_0x25b1('0x40')]=[{'all':!![]}];}return db[_0x25b1('0x28')][_0x25b1('0x41')](_0x3febb8);})[_0x25b1('0x42')](function(_0x3f9754){_0x293413['rows']=_0x3f9754;return _0x293413;})[_0x25b1('0x42')](respondWithFilteredResult(_0x19ecd1,_0x3febb8))['catch'](handleError(_0x19ecd1,null));};exports[_0x25b1('0x43')]=function(_0x2f56ac,_0x4d4e32){var _0x52d3f8={'raw':!![],'where':{'id':_0x2f56ac[_0x25b1('0x44')]['id']}},_0x39b4c7={};_0x39b4c7[_0x25b1('0x2c')]=_[_0x25b1('0x2e')](db[_0x25b1('0x28')][_0x25b1('0x45')]);_0x39b4c7[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x2f56ac[_0x25b1('0x2d')]);_0x39b4c7[_0x25b1('0x2f')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],_0x39b4c7[_0x25b1('0x2d')]);_0x52d3f8[_0x25b1('0x32')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x2f56ac['query']['fields']));_0x52d3f8['attributes']=_0x52d3f8[_0x25b1('0x32')]['length']?_0x52d3f8[_0x25b1('0x32')]:_0x39b4c7['model'];if(_0x2f56ac[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x52d3f8[_0x25b1('0x40')]=[{'all':!![]}];}_0x52d3f8=_[_0x25b1('0x3c')]({},_0x52d3f8,_0x2f56ac[_0x25b1('0x3e')]);return db[_0x25b1('0x28')]['find'](_0x52d3f8)[_0x25b1('0x42')](handleEntityNotFound(_0x4d4e32,null))[_0x25b1('0x42')](respondWithResult(_0x4d4e32,null))[_0x25b1('0x46')](handleError(_0x4d4e32,null));};exports[_0x25b1('0x47')]=function(_0x58ae67,_0x489f73){return db[_0x25b1('0x28')][_0x25b1('0x47')](_0x58ae67['body'],{})[_0x25b1('0x42')](respondWithResult(_0x489f73,0xc9))['catch'](handleError(_0x489f73,null));};exports[_0x25b1('0x22')]=function(_0x4b6181,_0x543f9b){if(_0x4b6181[_0x25b1('0x48')]['id']){delete _0x4b6181[_0x25b1('0x48')]['id'];}return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x4b6181['params']['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x543f9b,null))['then'](saveUpdates(_0x4b6181[_0x25b1('0x48')],null))['then'](respondWithResult(_0x543f9b,null))[_0x25b1('0x46')](handleError(_0x543f9b,null));};exports[_0x25b1('0x23')]=function(_0x1fcc79,_0x4fb92e){return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x1fcc79[_0x25b1('0x44')]['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x4fb92e,null))[_0x25b1('0x42')](removeEntity(_0x4fb92e,null))[_0x25b1('0x46')](handleError(_0x4fb92e,null));};exports['describe']=function(_0x134c64,_0x133f50){return db[_0x25b1('0x28')][_0x25b1('0x4a')]()[_0x25b1('0x42')](respondWithResult(_0x133f50,null))[_0x25b1('0x46')](handleError(_0x133f50,null));}; \ No newline at end of file +var _0xac4a=['where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5d9d73,_0x36381e){var _0x6826f3=function(_0x3a0240){while(--_0x3a0240){_0x5d9d73['push'](_0x5d9d73['shift']());}};_0x6826f3(++_0x36381e);}(_0xac4a,0x13f));var _0xaac4=function(_0x16b159,_0x46d9d6){_0x16b159=_0x16b159-0x0;var _0x251447=_0xac4a[_0x16b159];return _0x251447;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={},_0x16b33c={},_0xda10b6={'count':0x0,'rows':[]};var _0xb76ccc=_[_0xaac4('0x29')](db[_0xaac4('0x2a')]['rawAttributes'],function(_0xcf6c1){return{'name':_0xcf6c1['fieldName'],'type':_0xcf6c1[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x16b33c[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0xb76ccc,'name');_0x16b33c['query']=_['keys'](_0x386c9b[_0xaac4('0x2e')]);_0x16b33c[_0xaac4('0x2f')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],_0x16b33c[_0xaac4('0x2e')]);_0x316445[_0xaac4('0x31')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x32')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x33')]?_0x316445[_0xaac4('0x31')]:_0x16b33c['model'];if(!_0x386c9b['query'][_0xaac4('0x34')](_0xaac4('0x35'))){_0x316445[_0xaac4('0x1a')]=qs['limit'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x316445[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x18')]);}_0x316445[_0xaac4('0x36')]=qs['sort'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x316445[_0xaac4('0x38')]=qs['filters'](_[_0xaac4('0x39')](_0x386c9b['query'],_0x16b33c['filters']),_0xb76ccc);if(_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x3a')]){_0x316445[_0xaac4('0x38')]=_['merge'](_0x316445['where'],{'$or':_[_0xaac4('0x29')](_0xb76ccc,function(_0x33cc4){if(_0x33cc4[_0xaac4('0x2b')]!==_0xaac4('0x3b')){var _0x2b65b1={};_0x2b65b1[_0x33cc4[_0xaac4('0x26')]]={'$like':'%'+_0x386c9b['query']['filter']+'%'};return _0x2b65b1;}})});}_0x316445=_[_0xaac4('0x3c')]({},_0x316445,_0x386c9b[_0xaac4('0x3d')]);var _0x5371b4={'where':_0x316445[_0xaac4('0x38')]};return db[_0xaac4('0x2a')][_0xaac4('0x1b')](_0x5371b4)['then'](function(_0x74a1c){_0xda10b6[_0xaac4('0x1b')]=_0x74a1c;if(_0x386c9b[_0xaac4('0x2e')]['includeAll']){_0x316445[_0xaac4('0x3e')]=[{'all':!![]}];}return db[_0xaac4('0x2a')][_0xaac4('0x3f')](_0x316445);})[_0xaac4('0x23')](function(_0x51e59d){_0xda10b6[_0xaac4('0x40')]=_0x51e59d;return _0xda10b6;})['then'](respondWithFilteredResult(_0x4d0f5f,_0x316445))['catch'](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x41')]=function(_0x31e240,_0x27df36){var _0x40c007={'raw':!![],'where':{'id':_0x31e240[_0xaac4('0x42')]['id']}},_0x43bc12={};_0x43bc12[_0xaac4('0x2d')]=_[_0xaac4('0x43')](db['WhatsappQueueReport'][_0xaac4('0x44')]);_0x43bc12[_0xaac4('0x2e')]=_[_0xaac4('0x43')](_0x31e240[_0xaac4('0x2e')]);_0x43bc12['filters']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],_0x43bc12[_0xaac4('0x2e')]);_0x40c007['attributes']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x31e240[_0xaac4('0x2e')]['fields']));_0x40c007[_0xaac4('0x31')]=_0x40c007[_0xaac4('0x31')][_0xaac4('0x33')]?_0x40c007['attributes']:_0x43bc12[_0xaac4('0x2d')];if(_0x31e240[_0xaac4('0x2e')][_0xaac4('0x45')]){_0x40c007[_0xaac4('0x3e')]=[{'all':!![]}];}_0x40c007=_[_0xaac4('0x3c')]({},_0x40c007,_0x31e240[_0xaac4('0x3d')]);return db[_0xaac4('0x2a')][_0xaac4('0x46')](_0x40c007)[_0xaac4('0x23')](handleEntityNotFound(_0x27df36,null))['then'](respondWithResult(_0x27df36,null))[_0xaac4('0x47')](handleError(_0x27df36,null));};exports[_0xaac4('0x48')]=function(_0x27425a,_0x360420){return db[_0xaac4('0x2a')]['create'](_0x27425a['body'],{})[_0xaac4('0x23')](respondWithResult(_0x360420,0xc9))[_0xaac4('0x47')](handleError(_0x360420,null));};exports[_0xaac4('0x21')]=function(_0x16c7f4,_0x5f33ea){if(_0x16c7f4[_0xaac4('0x49')]['id']){delete _0x16c7f4['body']['id'];}return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x16c7f4['params']['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x5f33ea,null))[_0xaac4('0x23')](saveUpdates(_0x16c7f4[_0xaac4('0x49')],null))['then'](respondWithResult(_0x5f33ea,null))['catch'](handleError(_0x5f33ea,null));};exports[_0xaac4('0x22')]=function(_0x2c1751,_0x22dda7){return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x2c1751[_0xaac4('0x42')]['id']}})['then'](handleEntityNotFound(_0x22dda7,null))[_0xaac4('0x23')](removeEntity(_0x22dda7,null))[_0xaac4('0x47')](handleError(_0x22dda7,null));};exports[_0xaac4('0x4a')]=function(_0x38f9af,_0x56201b){return db[_0xaac4('0x2a')]['describe']()[_0xaac4('0x23')](respondWithResult(_0x56201b,null))[_0xaac4('0x47')](handleError(_0x56201b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 322b8ed..6a32e1b 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 _0x9e3c=['exports','define','WhatsappQueueReport','report_whatsapp_queue','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x4c7281,_0x4e11b8){var _0x3b47c5=function(_0xa9add8){while(--_0xa9add8){_0x4c7281['push'](_0x4c7281['shift']());}};_0x3b47c5(++_0x4e11b8);}(_0x9e3c,0xf4));var _0xc9e3=function(_0xdb3d60,_0x286503){_0xdb3d60=_0xdb3d60-0x0;var _0x38a1ae=_0x9e3c[_0xdb3d60];return _0x38a1ae;};'use strict';var _=require(_0xc9e3('0x0'));var util=require(_0xc9e3('0x1'));var logger=require(_0xc9e3('0x2'))(_0xc9e3('0x3'));var moment=require(_0xc9e3('0x4'));var BPromise=require('bluebird');var rp=require(_0xc9e3('0x5'));var fs=require('fs');var path=require(_0xc9e3('0x6'));var rimraf=require('rimraf');var config=require(_0xc9e3('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0xc9e3('0x8')]=function(_0x1e4289,_0x5d4242){return _0x1e4289[_0xc9e3('0x9')](_0xc9e3('0xa'),attributes,{'tableName':_0xc9e3('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe373=['define','uniqueid','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./whatsappQueueReport.attributes','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe373,0x136));var _0x3e37=function(_0x356589,_0x30d81e){_0x356589=_0x356589-0x0;var _0x2b85e4=_0xe373[_0x356589];return _0x2b85e4;};'use strict';var _=require(_0x3e37('0x0'));var util=require(_0x3e37('0x1'));var logger=require(_0x3e37('0x2'))(_0x3e37('0x3'));var moment=require('moment');var BPromise=require(_0x3e37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e37('0x5'));var rimraf=require('rimraf');var config=require(_0x3e37('0x6'));var attributes=require(_0x3e37('0x7'));module[_0x3e37('0x8')]=function(_0x15d201,_0x4dc84f){return _0x15d201[_0x3e37('0x9')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3e37('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 54ca422..1cfd7d3 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 _0x012a=['message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x11ca50,_0x4135c6){var _0x4f66cc=function(_0x41686f){while(--_0x41686f){_0x11ca50['push'](_0x11ca50['shift']());}};_0x4f66cc(++_0x4135c6);}(_0x012a,0x6a));var _0xa012=function(_0x3316ae,_0x196be2){_0x3316ae=_0x3316ae-0x0;var _0x324aa=_0x012a[_0x3316ae];return _0x324aa;};'use strict';var _=require(_0xa012('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa012('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa012('0x2'));var db=require(_0xa012('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa012('0x4'))(_0xa012('0x5'));var config=require(_0xa012('0x6'));var jayson=require(_0xa012('0x7'));var client=jayson['client'][_0xa012('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24f1f9,_0x1d21a8,_0x1d8c14){return new BPromise(function(_0x22db10,_0x1284f2){return client[_0xa012('0x9')](_0x24f1f9,_0x1d8c14)[_0xa012('0xa')](function(_0x5370fc){logger[_0xa012('0xb')](_0xa012('0xc'),_0x1d21a8,_0xa012('0xd'));logger[_0xa012('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1d21a8,_0xa012('0xd'),JSON[_0xa012('0xf')](_0x5370fc));if(_0x5370fc[_0xa012('0x10')]){if(_0x5370fc['error'][_0xa012('0x11')]===0x1f4){logger[_0xa012('0x10')](_0xa012('0xc'),_0x1d21a8,_0x5370fc['error']['message']);return _0x1284f2(_0x5370fc[_0xa012('0x10')][_0xa012('0x12')]);}logger[_0xa012('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1d21a8,_0x5370fc['error']['message']);return _0x22db10(_0x5370fc['error']['message']);}else{logger[_0xa012('0xb')](_0xa012('0xc'),_0x1d21a8,_0xa012('0xd'));_0x22db10(_0x5370fc['result'][_0xa012('0x12')]);}})[_0xa012('0x13')](function(_0x2533bf){logger['error'](_0xa012('0xc'),_0x1d21a8,_0x2533bf);_0x1284f2(_0x2533bf);});});}exports[_0xa012('0x14')]=function(_0x44e246){var _0x2c049a=this;return new Promise(function(_0x2750ac,_0x262af1){return db[_0xa012('0x15')][_0xa012('0x16')](_0x44e246[_0xa012('0x17')],{'raw':_0x44e246[_0xa012('0x18')]?_0x44e246[_0xa012('0x18')][_0xa012('0x19')]===undefined?!![]:![]:!![]})[_0xa012('0xa')](function(_0xde4f31){logger[_0xa012('0xb')](_0xa012('0x14'),_0x44e246);logger['debug']('CreateWhatsappQueueReport',_0x44e246,JSON['stringify'](_0xde4f31));_0x2750ac(_0xde4f31);})[_0xa012('0x13')](function(_0x442283){logger['error'](_0xa012('0x14'),_0x442283[_0xa012('0x12')],_0x44e246);_0x262af1(_0x2c049a[_0xa012('0x10')](0x1f4,_0x442283[_0xa012('0x12')]));});});};exports[_0xa012('0x1a')]=function(_0x3d3773){var _0x3decb7=this;return new Promise(function(_0x3d1ad2,_0x39f383){return db['WhatsappQueueReport'][_0xa012('0x1b')](_0x3d3773[_0xa012('0x17')],{'raw':_0x3d3773['options']?_0x3d3773[_0xa012('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d3773[_0xa012('0x18')]?_0x3d3773['options'][_0xa012('0x1c')]||null:null,'attributes':_0x3d3773[_0xa012('0x18')]?_0x3d3773['options'][_0xa012('0x1d')]||null:null,'limit':_0x3d3773['options']?_0x3d3773['options'][_0xa012('0x1e')]||null:null})[_0xa012('0xa')](function(_0x3df341){logger['info'](_0xa012('0x1a'),_0x3d3773);logger[_0xa012('0xe')]('UpdateWhatsappQueueReport',_0x3d3773,JSON[_0xa012('0xf')](_0x3df341));_0x3d1ad2(_0x3df341);})[_0xa012('0x13')](function(_0x20bfa4){logger['error']('UpdateWhatsappQueueReport',_0x20bfa4[_0xa012('0x12')],_0x3d3773);_0x39f383(_0x3decb7[_0xa012('0x10')](0x1f4,_0x20bfa4[_0xa012('0x12')]));});});}; \ No newline at end of file +var _0x1d89=['raw','body','attributes','limit','UpdateWhatsappQueueReport','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x1d89,0x156));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91d8('0x0'));var util=require(_0x91d8('0x1'));var moment=require('moment');var BPromise=require(_0x91d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91d8('0x3'))['db'];var utils=require(_0x91d8('0x4'));var logger=require(_0x91d8('0x5'))(_0x91d8('0x6'));var config=require(_0x91d8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x91d8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19516b,_0x4847d6,_0x5ade3a){return new BPromise(function(_0x36d4af,_0x22cc9b){return client[_0x91d8('0x9')](_0x19516b,_0x5ade3a)[_0x91d8('0xa')](function(_0x2a1a9d){logger[_0x91d8('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4847d6,_0x91d8('0xc'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4847d6,'request\x20sent',JSON[_0x91d8('0xd')](_0x2a1a9d));if(_0x2a1a9d[_0x91d8('0xe')]){if(_0x2a1a9d[_0x91d8('0xe')]['code']===0x1f4){logger['error'](_0x91d8('0xf'),_0x4847d6,_0x2a1a9d[_0x91d8('0xe')][_0x91d8('0x10')]);return _0x22cc9b(_0x2a1a9d[_0x91d8('0xe')][_0x91d8('0x10')]);}logger[_0x91d8('0xe')](_0x91d8('0xf'),_0x4847d6,_0x2a1a9d[_0x91d8('0xe')][_0x91d8('0x10')]);return _0x36d4af(_0x2a1a9d[_0x91d8('0xe')][_0x91d8('0x10')]);}else{logger[_0x91d8('0xb')](_0x91d8('0xf'),_0x4847d6,'request\x20sent');_0x36d4af(_0x2a1a9d[_0x91d8('0x11')][_0x91d8('0x10')]);}})[_0x91d8('0x12')](function(_0x52e1e3){logger['error'](_0x91d8('0xf'),_0x4847d6,_0x52e1e3);_0x22cc9b(_0x52e1e3);});});}exports[_0x91d8('0x13')]=function(_0xb7054c){var _0x4e5b14=this;return new Promise(function(_0x4b5531,_0x5a5633){return db[_0x91d8('0x14')]['create'](_0xb7054c['body'],{'raw':_0xb7054c[_0x91d8('0x15')]?_0xb7054c['options'][_0x91d8('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x40a5be){logger[_0x91d8('0xb')]('CreateWhatsappQueueReport',_0xb7054c);logger['debug'](_0x91d8('0x13'),_0xb7054c,JSON[_0x91d8('0xd')](_0x40a5be));_0x4b5531(_0x40a5be);})['catch'](function(_0x4a26c8){logger[_0x91d8('0xe')](_0x91d8('0x13'),_0x4a26c8[_0x91d8('0x10')],_0xb7054c);_0x5a5633(_0x4e5b14[_0x91d8('0xe')](0x1f4,_0x4a26c8['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x3d656b){var _0x1cdc73=this;return new Promise(function(_0x14b24c,_0x13233b){return db[_0x91d8('0x14')]['update'](_0x3d656b[_0x91d8('0x17')],{'raw':_0x3d656b[_0x91d8('0x15')]?_0x3d656b[_0x91d8('0x15')][_0x91d8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d656b['options']?_0x3d656b['options']['where']||null:null,'attributes':_0x3d656b[_0x91d8('0x15')]?_0x3d656b[_0x91d8('0x15')][_0x91d8('0x18')]||null:null,'limit':_0x3d656b[_0x91d8('0x15')]?_0x3d656b[_0x91d8('0x15')][_0x91d8('0x19')]||null:null})[_0x91d8('0xa')](function(_0x3b38cc){logger[_0x91d8('0xb')](_0x91d8('0x1a'),_0x3d656b);logger[_0x91d8('0x1b')](_0x91d8('0x1a'),_0x3d656b,JSON[_0x91d8('0xd')](_0x3b38cc));_0x14b24c(_0x3b38cc);})[_0x91d8('0x12')](function(_0x3dcf69){logger[_0x91d8('0xe')](_0x91d8('0x1a'),_0x3dcf69[_0x91d8('0x10')],_0x3d656b);_0x13233b(_0x1cdc73[_0x91d8('0xe')](0x1f4,_0x3dcf69['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 1addd23..b79ecef 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 _0xc406=['../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x576fe0,_0x29de93){var _0x524bf4=function(_0x30d42e){while(--_0x30d42e){_0x576fe0['push'](_0x576fe0['shift']());}};_0x524bf4(++_0x29de93);}(_0xc406,0xbe));var _0x6c40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc406[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6c40('0x0'));var util=require(_0x6c40('0x1'));var path=require(_0x6c40('0x2'));var timeout=require(_0x6c40('0x3'));var express=require(_0x6c40('0x4'));var router=express[_0x6c40('0x5')]();var fs_extra=require(_0x6c40('0x6'));var auth=require(_0x6c40('0x7'));var interaction=require(_0x6c40('0x8'));var config=require('../../config/environment');var controller=require(_0x6c40('0x9'));router[_0x6c40('0xa')]('/',auth[_0x6c40('0xb')](),controller[_0x6c40('0xc')]);router['get'](_0x6c40('0xd'),auth[_0x6c40('0xb')](),controller['describe']);router[_0x6c40('0xa')](_0x6c40('0xe'),auth[_0x6c40('0xb')](),controller[_0x6c40('0xf')]);router[_0x6c40('0x10')]('/',auth[_0x6c40('0xb')](),controller['create']);router[_0x6c40('0x11')](_0x6c40('0xe'),auth[_0x6c40('0xb')](),controller[_0x6c40('0x12')]);router[_0x6c40('0x13')](_0x6c40('0xe'),auth[_0x6c40('0xb')](),controller[_0x6c40('0x14')]);module[_0x6c40('0x15')]=router; \ No newline at end of file +var _0xb287=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0xc3d9bb,_0xfe7ac1){var _0x2431c1=function(_0x29f8c7){while(--_0x29f8c7){_0xc3d9bb['push'](_0xc3d9bb['shift']());}};_0x2431c1(++_0xfe7ac1);}(_0xb287,0x1eb));var _0x7b28=function(_0x3042d4,_0x4e14d5){_0x3042d4=_0x3042d4-0x0;var _0x150b74=_0xb287[_0x3042d4];return _0x150b74;};'use strict';var multer=require('multer');var util=require(_0x7b28('0x0'));var path=require(_0x7b28('0x1'));var timeout=require(_0x7b28('0x2'));var express=require(_0x7b28('0x3'));var router=express['Router']();var fs_extra=require(_0x7b28('0x4'));var auth=require(_0x7b28('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b28('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0x7b28('0x7')]('/',auth[_0x7b28('0x8')](),controller[_0x7b28('0x9')]);router['get'](_0x7b28('0xa'),auth[_0x7b28('0x8')](),controller[_0x7b28('0xb')]);router['get'](_0x7b28('0xc'),auth[_0x7b28('0x8')](),controller[_0x7b28('0xd')]);router['post']('/',auth[_0x7b28('0x8')](),controller[_0x7b28('0xe')]);router[_0x7b28('0xf')](_0x7b28('0xc'),auth[_0x7b28('0x8')](),controller['update']);router[_0x7b28('0x10')](_0x7b28('0xc'),auth['isAuthenticated'](),controller[_0x7b28('0x11')]);module[_0x7b28('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 4ef1be3..fe5ac30 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 _0xd0e4=['exports','STRING','ENUM','queue','DATE','sequelize'];(function(_0x25b66a,_0x5944d0){var _0x4a2fc6=function(_0x5ba96e){while(--_0x5ba96e){_0x25b66a['push'](_0x25b66a['shift']());}};_0x4a2fc6(++_0x5944d0);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x597065,_0x453bfd){_0x597065=_0x597065-0x0;var _0xb8e1fb=_0xd0e4[_0x597065];return _0xb8e1fb;};'use strict';var Sequelize=require(_0x4d0e('0x0'));module[_0x4d0e('0x1')]={'uniqueid':{'type':Sequelize[_0x4d0e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4d0e('0x3')]('account','agent',_0x4d0e('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4d0e('0x5')]}}; \ No newline at end of file +var _0x38fd=['exports','STRING','account','agent','queue','DATE','sequelize'];(function(_0x1b50ec,_0x9007a7){var _0x2adaab=function(_0xff9ffb){while(--_0xff9ffb){_0x1b50ec['push'](_0x1b50ec['shift']());}};_0x2adaab(++_0x9007a7);}(_0x38fd,0x117));var _0xd38f=function(_0x55ac81,_0x15cb67){_0x55ac81=_0x55ac81-0x0;var _0x37ac74=_0x38fd[_0x55ac81];return _0x37ac74;};'use strict';var Sequelize=require(_0xd38f('0x0'));module[_0xd38f('0x1')]={'uniqueid':{'type':Sequelize[_0xd38f('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd38f('0x3'),_0xd38f('0x4'),_0xd38f('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd38f('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 66f0be3..518f0df 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 _0xe4d3=['error','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe4d3,0xbc));var _0x3e4d=function(_0x2e8f13,_0x426905){_0x2e8f13=_0x2e8f13-0x0;var _0x374a00=_0xe4d3[_0x2e8f13];return _0x374a00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e4d('0x0'));var zipdir=require(_0x3e4d('0x1'));var jsonpatch=require(_0x3e4d('0x2'));var rp=require(_0x3e4d('0x3'));var moment=require(_0x3e4d('0x4'));var BPromise=require(_0x3e4d('0x5'));var Mustache=require(_0x3e4d('0x6'));var util=require(_0x3e4d('0x7'));var path=require('path');var sox=require(_0x3e4d('0x8'));var csv=require(_0x3e4d('0x9'));var ejs=require(_0x3e4d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e4d('0xb'));var squel=require(_0x3e4d('0xc'));var crypto=require(_0x3e4d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3e4d('0xe'));var toCsv=require(_0x3e4d('0x9'));var querystring=require(_0x3e4d('0xf'));var Papa=require('papaparse');var Redis=require(_0x3e4d('0x10'));var authService=require(_0x3e4d('0x11'));var qs=require(_0x3e4d('0x12'));var as=require(_0x3e4d('0x13'));var hardwareService=require(_0x3e4d('0x14'));var logger=require(_0x3e4d('0x15'))(_0x3e4d('0x16'));var utils=require(_0x3e4d('0x17'));var config=require(_0x3e4d('0x18'));var licenseUtil=require(_0x3e4d('0x19'));var db=require(_0x3e4d('0x1a'))['db'];function respondWithStatusCode(_0x2fe133,_0x2d1b3b){_0x2d1b3b=_0x2d1b3b||0xcc;return function(_0x493b27){if(_0x493b27){return _0x2fe133[_0x3e4d('0x1b')](_0x2d1b3b);}return _0x2fe133[_0x3e4d('0x1c')](_0x2d1b3b)['end']();};}function respondWithResult(_0x5e231a,_0x5ed992){_0x5ed992=_0x5ed992||0xc8;return function(_0x38bd52){if(_0x38bd52){return _0x5e231a[_0x3e4d('0x1c')](_0x5ed992)['json'](_0x38bd52);}};}function respondWithFilteredResult(_0x4b30c8,_0x23e467){return function(_0x2fa4b1){if(_0x2fa4b1){var _0x4b9d50=typeof _0x23e467[_0x3e4d('0x1d')]===_0x3e4d('0x1e')&&typeof _0x23e467[_0x3e4d('0x1f')]==='undefined';var _0x64783d=_0x2fa4b1[_0x3e4d('0x20')];var _0x36348e=_0x4b9d50?0x0:_0x23e467[_0x3e4d('0x1d')];var _0x482221=_0x4b9d50?_0x2fa4b1['count']:_0x23e467['offset']+_0x23e467[_0x3e4d('0x1f')];var _0x2d16b3;if(_0x482221>=_0x64783d){_0x482221=_0x64783d;_0x2d16b3=0xc8;}else{_0x2d16b3=0xce;}_0x4b30c8[_0x3e4d('0x1c')](_0x2d16b3);return _0x4b30c8[_0x3e4d('0x21')]('Content-Range',_0x36348e+'-'+_0x482221+'/'+_0x64783d)['json'](_0x2fa4b1);}return null;};}function patchUpdates(_0xd1deac){return function(_0x2d8e20){try{jsonpatch[_0x3e4d('0x22')](_0x2d8e20,_0xd1deac,!![]);}catch(_0x63a829){return BPromise[_0x3e4d('0x23')](_0x63a829);}return _0x2d8e20[_0x3e4d('0x24')]();};}function saveUpdates(_0x3909d8,_0x49737e){return function(_0x3e4ac7){if(_0x3e4ac7){return _0x3e4ac7[_0x3e4d('0x25')](_0x3909d8)[_0x3e4d('0x26')](function(_0x194632){return _0x194632;});}return null;};}function removeEntity(_0x1b7ce8,_0x3ac0fa){return function(_0xfd932e){if(_0xfd932e){return _0xfd932e[_0x3e4d('0x27')]()[_0x3e4d('0x26')](function(){_0x1b7ce8[_0x3e4d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xca562d,_0xb7a5a1){return function(_0x10ee62){if(!_0x10ee62){_0xca562d[_0x3e4d('0x1b')](0x194);}return _0x10ee62;};}function handleError(_0x2fe863,_0x3d49ef){_0x3d49ef=_0x3d49ef||0x1f4;return function(_0x2e999b){logger[_0x3e4d('0x28')](_0x2e999b['stack']);if(_0x2e999b[_0x3e4d('0x29')]){delete _0x2e999b[_0x3e4d('0x29')];}_0x2fe863[_0x3e4d('0x1c')](_0x3d49ef)[_0x3e4d('0x2a')](_0x2e999b);};}exports['index']=function(_0x388834,_0x86d99e){var _0x497e54={},_0x20d80d={},_0x7338fd={'count':0x0,'rows':[]};var _0x54ed60=_[_0x3e4d('0x2b')](db[_0x3e4d('0x2c')][_0x3e4d('0x2d')],function(_0x5d711a){return{'name':_0x5d711a[_0x3e4d('0x2e')],'type':_0x5d711a[_0x3e4d('0x2f')][_0x3e4d('0x30')]};});_0x20d80d[_0x3e4d('0x31')]=_[_0x3e4d('0x2b')](_0x54ed60,'name');_0x20d80d[_0x3e4d('0x32')]=_['keys'](_0x388834[_0x3e4d('0x32')]);_0x20d80d['filters']=_[_0x3e4d('0x33')](_0x20d80d[_0x3e4d('0x31')],_0x20d80d['query']);_0x497e54['attributes']=_[_0x3e4d('0x33')](_0x20d80d[_0x3e4d('0x31')],qs[_0x3e4d('0x34')](_0x388834[_0x3e4d('0x32')][_0x3e4d('0x34')]));_0x497e54['attributes']=_0x497e54[_0x3e4d('0x35')][_0x3e4d('0x36')]?_0x497e54[_0x3e4d('0x35')]:_0x20d80d[_0x3e4d('0x31')];if(!_0x388834[_0x3e4d('0x32')]['hasOwnProperty'](_0x3e4d('0x37'))){_0x497e54[_0x3e4d('0x1f')]=qs[_0x3e4d('0x1f')](_0x388834['query'][_0x3e4d('0x1f')]);_0x497e54[_0x3e4d('0x1d')]=qs['offset'](_0x388834[_0x3e4d('0x32')]['offset']);}_0x497e54[_0x3e4d('0x38')]=qs[_0x3e4d('0x39')](_0x388834[_0x3e4d('0x32')]['sort']);_0x497e54[_0x3e4d('0x3a')]=qs[_0x3e4d('0x3b')](_[_0x3e4d('0x3c')](_0x388834[_0x3e4d('0x32')],_0x20d80d[_0x3e4d('0x3b')]),_0x54ed60);if(_0x388834['query']['filter']){_0x497e54[_0x3e4d('0x3a')]=_[_0x3e4d('0x3d')](_0x497e54[_0x3e4d('0x3a')],{'$or':_[_0x3e4d('0x2b')](_0x54ed60,function(_0x2759c6){if(_0x2759c6['type']!=='VIRTUAL'){var _0x439e63={};_0x439e63[_0x2759c6[_0x3e4d('0x29')]]={'$like':'%'+_0x388834[_0x3e4d('0x32')][_0x3e4d('0x3e')]+'%'};return _0x439e63;}})});}_0x497e54=_[_0x3e4d('0x3d')]({},_0x497e54,_0x388834[_0x3e4d('0x3f')]);var _0x25d0f7={'where':_0x497e54[_0x3e4d('0x3a')]};return db[_0x3e4d('0x2c')][_0x3e4d('0x20')](_0x25d0f7)[_0x3e4d('0x26')](function(_0xe1f663){_0x7338fd[_0x3e4d('0x20')]=_0xe1f663;if(_0x388834['query']['includeAll']){_0x497e54[_0x3e4d('0x40')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x3e4d('0x41')](_0x497e54);})[_0x3e4d('0x26')](function(_0x39762a){_0x7338fd[_0x3e4d('0x42')]=_0x39762a;return _0x7338fd;})['then'](respondWithFilteredResult(_0x86d99e,_0x497e54))[_0x3e4d('0x43')](handleError(_0x86d99e,null));};exports[_0x3e4d('0x44')]=function(_0x1c0d86,_0x58150e){var _0x4dcded={'raw':!![],'where':{'id':_0x1c0d86[_0x3e4d('0x45')]['id']}},_0x16a2f1={};_0x16a2f1[_0x3e4d('0x31')]=_[_0x3e4d('0x46')](db[_0x3e4d('0x2c')]['rawAttributes']);_0x16a2f1[_0x3e4d('0x32')]=_[_0x3e4d('0x46')](_0x1c0d86['query']);_0x16a2f1[_0x3e4d('0x3b')]=_[_0x3e4d('0x33')](_0x16a2f1[_0x3e4d('0x31')],_0x16a2f1[_0x3e4d('0x32')]);_0x4dcded[_0x3e4d('0x35')]=_[_0x3e4d('0x33')](_0x16a2f1[_0x3e4d('0x31')],qs['fields'](_0x1c0d86[_0x3e4d('0x32')][_0x3e4d('0x34')]));_0x4dcded[_0x3e4d('0x35')]=_0x4dcded[_0x3e4d('0x35')][_0x3e4d('0x36')]?_0x4dcded[_0x3e4d('0x35')]:_0x16a2f1[_0x3e4d('0x31')];if(_0x1c0d86[_0x3e4d('0x32')][_0x3e4d('0x47')]){_0x4dcded[_0x3e4d('0x40')]=[{'all':!![]}];}_0x4dcded=_['merge']({},_0x4dcded,_0x1c0d86[_0x3e4d('0x3f')]);return db[_0x3e4d('0x2c')][_0x3e4d('0x48')](_0x4dcded)[_0x3e4d('0x26')](handleEntityNotFound(_0x58150e,null))['then'](respondWithResult(_0x58150e,null))[_0x3e4d('0x43')](handleError(_0x58150e,null));};exports[_0x3e4d('0x49')]=function(_0x3a1b0d,_0x44f452){return db['WhatsappTransferReport'][_0x3e4d('0x49')](_0x3a1b0d[_0x3e4d('0x4a')],{})[_0x3e4d('0x26')](respondWithResult(_0x44f452,0xc9))['catch'](handleError(_0x44f452,null));};exports[_0x3e4d('0x25')]=function(_0x7a443b,_0x49c9ae){if(_0x7a443b[_0x3e4d('0x4a')]['id']){delete _0x7a443b[_0x3e4d('0x4a')]['id'];}return db[_0x3e4d('0x2c')][_0x3e4d('0x48')]({'where':{'id':_0x7a443b[_0x3e4d('0x45')]['id']}})['then'](handleEntityNotFound(_0x49c9ae,null))[_0x3e4d('0x26')](saveUpdates(_0x7a443b['body'],null))[_0x3e4d('0x26')](respondWithResult(_0x49c9ae,null))['catch'](handleError(_0x49c9ae,null));};exports[_0x3e4d('0x27')]=function(_0x4f35a9,_0x65b015){return db['WhatsappTransferReport'][_0x3e4d('0x48')]({'where':{'id':_0x4f35a9['params']['id']}})[_0x3e4d('0x26')](handleEntityNotFound(_0x65b015,null))['then'](removeEntity(_0x65b015,null))[_0x3e4d('0x43')](handleError(_0x65b015,null));};exports[_0x3e4d('0x4b')]=function(_0x592a2c,_0x3c8d91){return db[_0x3e4d('0x2c')][_0x3e4d('0x4b')]()[_0x3e4d('0x26')](respondWithResult(_0x3c8d91,null))[_0x3e4d('0x43')](handleError(_0x3c8d91,null));}; \ No newline at end of file +var _0xcc1b=['error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xcc1b,0x100));var _0xbcc1=function(_0x437a39,_0x1700ca){_0x437a39=_0x437a39-0x0;var _0x293144=_0xcc1b[_0x437a39];return _0x293144;};'use strict';var emlformat=require(_0xbcc1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcc1('0x1'));var jsonpatch=require(_0xbcc1('0x2'));var rp=require('request-promise');var moment=require(_0xbcc1('0x3'));var BPromise=require(_0xbcc1('0x4'));var Mustache=require(_0xbcc1('0x5'));var util=require(_0xbcc1('0x6'));var path=require(_0xbcc1('0x7'));var sox=require(_0xbcc1('0x8'));var csv=require(_0xbcc1('0x9'));var ejs=require(_0xbcc1('0xa'));var fs=require('fs');var fs_extra=require(_0xbcc1('0xb'));var _=require('lodash');var squel=require(_0xbcc1('0xc'));var crypto=require('crypto');var jsforce=require(_0xbcc1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbcc1('0x9'));var querystring=require(_0xbcc1('0xe'));var Papa=require(_0xbcc1('0xf'));var Redis=require('ioredis');var authService=require(_0xbcc1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcc1('0x11'))('api');var utils=require(_0xbcc1('0x12'));var config=require(_0xbcc1('0x13'));var licenseUtil=require(_0xbcc1('0x14'));var db=require(_0xbcc1('0x15'))['db'];function respondWithStatusCode(_0x44d7b4,_0x4ea7d6){_0x4ea7d6=_0x4ea7d6||0xcc;return function(_0x4693fa){if(_0x4693fa){return _0x44d7b4['sendStatus'](_0x4ea7d6);}return _0x44d7b4[_0xbcc1('0x16')](_0x4ea7d6)[_0xbcc1('0x17')]();};}function respondWithResult(_0x53ede,_0x4619bc){_0x4619bc=_0x4619bc||0xc8;return function(_0x1e5543){if(_0x1e5543){return _0x53ede[_0xbcc1('0x16')](_0x4619bc)[_0xbcc1('0x18')](_0x1e5543);}};}function respondWithFilteredResult(_0x4be22d,_0x23cfd5){return function(_0xd37cb){if(_0xd37cb){var _0x124c8f=typeof _0x23cfd5[_0xbcc1('0x19')]===_0xbcc1('0x1a')&&typeof _0x23cfd5[_0xbcc1('0x1b')]===_0xbcc1('0x1a');var _0x4dae80=_0xd37cb[_0xbcc1('0x1c')];var _0x523530=_0x124c8f?0x0:_0x23cfd5[_0xbcc1('0x19')];var _0x1c4d6c=_0x124c8f?_0xd37cb[_0xbcc1('0x1c')]:_0x23cfd5[_0xbcc1('0x19')]+_0x23cfd5[_0xbcc1('0x1b')];var _0x175c06;if(_0x1c4d6c>=_0x4dae80){_0x1c4d6c=_0x4dae80;_0x175c06=0xc8;}else{_0x175c06=0xce;}_0x4be22d[_0xbcc1('0x16')](_0x175c06);return _0x4be22d[_0xbcc1('0x1d')](_0xbcc1('0x1e'),_0x523530+'-'+_0x1c4d6c+'/'+_0x4dae80)[_0xbcc1('0x18')](_0xd37cb);}return null;};}function patchUpdates(_0x1717c8){return function(_0x4533ad){try{jsonpatch[_0xbcc1('0x1f')](_0x4533ad,_0x1717c8,!![]);}catch(_0x38b471){return BPromise['reject'](_0x38b471);}return _0x4533ad['save']();};}function saveUpdates(_0x769638,_0x6e78af){return function(_0x1ecab2){if(_0x1ecab2){return _0x1ecab2[_0xbcc1('0x20')](_0x769638)[_0xbcc1('0x21')](function(_0x4305ab){return _0x4305ab;});}return null;};}function removeEntity(_0x5063ee,_0xbafce7){return function(_0x433cd2){if(_0x433cd2){return _0x433cd2[_0xbcc1('0x22')]()[_0xbcc1('0x21')](function(){_0x5063ee[_0xbcc1('0x16')](0xcc)[_0xbcc1('0x17')]();});}};}function handleEntityNotFound(_0x3522fb,_0x23a45b){return function(_0x2f6325){if(!_0x2f6325){_0x3522fb[_0xbcc1('0x23')](0x194);}return _0x2f6325;};}function handleError(_0x417a63,_0x2e6d4d){_0x2e6d4d=_0x2e6d4d||0x1f4;return function(_0x577ff8){logger[_0xbcc1('0x24')](_0x577ff8['stack']);if(_0x577ff8[_0xbcc1('0x25')]){delete _0x577ff8[_0xbcc1('0x25')];}_0x417a63[_0xbcc1('0x16')](_0x2e6d4d)[_0xbcc1('0x26')](_0x577ff8);};}exports[_0xbcc1('0x27')]=function(_0x21dc90,_0x1bca3f){var _0x4d27c2={},_0x5d8c0e={},_0x2b3f06={'count':0x0,'rows':[]};var _0x36323e=_[_0xbcc1('0x28')](db[_0xbcc1('0x29')][_0xbcc1('0x2a')],function(_0x1b64d0){return{'name':_0x1b64d0[_0xbcc1('0x2b')],'type':_0x1b64d0[_0xbcc1('0x2c')][_0xbcc1('0x2d')]};});_0x5d8c0e[_0xbcc1('0x2e')]=_[_0xbcc1('0x28')](_0x36323e,_0xbcc1('0x25'));_0x5d8c0e[_0xbcc1('0x2f')]=_[_0xbcc1('0x30')](_0x21dc90['query']);_0x5d8c0e[_0xbcc1('0x31')]=_[_0xbcc1('0x32')](_0x5d8c0e[_0xbcc1('0x2e')],_0x5d8c0e[_0xbcc1('0x2f')]);_0x4d27c2['attributes']=_[_0xbcc1('0x32')](_0x5d8c0e[_0xbcc1('0x2e')],qs[_0xbcc1('0x33')](_0x21dc90[_0xbcc1('0x2f')][_0xbcc1('0x33')]));_0x4d27c2[_0xbcc1('0x34')]=_0x4d27c2[_0xbcc1('0x34')][_0xbcc1('0x35')]?_0x4d27c2[_0xbcc1('0x34')]:_0x5d8c0e[_0xbcc1('0x2e')];if(!_0x21dc90['query'][_0xbcc1('0x36')]('nolimit')){_0x4d27c2['limit']=qs[_0xbcc1('0x1b')](_0x21dc90['query'][_0xbcc1('0x1b')]);_0x4d27c2[_0xbcc1('0x19')]=qs['offset'](_0x21dc90[_0xbcc1('0x2f')][_0xbcc1('0x19')]);}_0x4d27c2[_0xbcc1('0x37')]=qs[_0xbcc1('0x38')](_0x21dc90[_0xbcc1('0x2f')]['sort']);_0x4d27c2[_0xbcc1('0x39')]=qs[_0xbcc1('0x31')](_[_0xbcc1('0x3a')](_0x21dc90[_0xbcc1('0x2f')],_0x5d8c0e[_0xbcc1('0x31')]),_0x36323e);if(_0x21dc90[_0xbcc1('0x2f')]['filter']){_0x4d27c2['where']=_[_0xbcc1('0x3b')](_0x4d27c2['where'],{'$or':_[_0xbcc1('0x28')](_0x36323e,function(_0xbfdb14){if(_0xbfdb14[_0xbcc1('0x2c')]!==_0xbcc1('0x3c')){var _0x12d7f2={};_0x12d7f2[_0xbfdb14['name']]={'$like':'%'+_0x21dc90[_0xbcc1('0x2f')][_0xbcc1('0x3d')]+'%'};return _0x12d7f2;}})});}_0x4d27c2=_[_0xbcc1('0x3b')]({},_0x4d27c2,_0x21dc90[_0xbcc1('0x3e')]);var _0xb696fe={'where':_0x4d27c2['where']};return db[_0xbcc1('0x29')][_0xbcc1('0x1c')](_0xb696fe)[_0xbcc1('0x21')](function(_0x3be47f){_0x2b3f06[_0xbcc1('0x1c')]=_0x3be47f;if(_0x21dc90['query'][_0xbcc1('0x3f')]){_0x4d27c2['include']=[{'all':!![]}];}return db[_0xbcc1('0x29')][_0xbcc1('0x40')](_0x4d27c2);})[_0xbcc1('0x21')](function(_0xdd1318){_0x2b3f06[_0xbcc1('0x41')]=_0xdd1318;return _0x2b3f06;})[_0xbcc1('0x21')](respondWithFilteredResult(_0x1bca3f,_0x4d27c2))[_0xbcc1('0x42')](handleError(_0x1bca3f,null));};exports[_0xbcc1('0x43')]=function(_0x3ebab0,_0x39ccdc){var _0x448c4d={'raw':!![],'where':{'id':_0x3ebab0[_0xbcc1('0x44')]['id']}},_0x23f78f={};_0x23f78f[_0xbcc1('0x2e')]=_[_0xbcc1('0x30')](db['WhatsappTransferReport']['rawAttributes']);_0x23f78f[_0xbcc1('0x2f')]=_['keys'](_0x3ebab0[_0xbcc1('0x2f')]);_0x23f78f[_0xbcc1('0x31')]=_[_0xbcc1('0x32')](_0x23f78f[_0xbcc1('0x2e')],_0x23f78f['query']);_0x448c4d[_0xbcc1('0x34')]=_[_0xbcc1('0x32')](_0x23f78f['model'],qs[_0xbcc1('0x33')](_0x3ebab0[_0xbcc1('0x2f')]['fields']));_0x448c4d[_0xbcc1('0x34')]=_0x448c4d[_0xbcc1('0x34')][_0xbcc1('0x35')]?_0x448c4d[_0xbcc1('0x34')]:_0x23f78f[_0xbcc1('0x2e')];if(_0x3ebab0[_0xbcc1('0x2f')][_0xbcc1('0x3f')]){_0x448c4d['include']=[{'all':!![]}];}_0x448c4d=_[_0xbcc1('0x3b')]({},_0x448c4d,_0x3ebab0[_0xbcc1('0x3e')]);return db[_0xbcc1('0x29')][_0xbcc1('0x45')](_0x448c4d)[_0xbcc1('0x21')](handleEntityNotFound(_0x39ccdc,null))['then'](respondWithResult(_0x39ccdc,null))[_0xbcc1('0x42')](handleError(_0x39ccdc,null));};exports[_0xbcc1('0x46')]=function(_0xda31e,_0x3d134b){return db['WhatsappTransferReport'][_0xbcc1('0x46')](_0xda31e[_0xbcc1('0x47')],{})[_0xbcc1('0x21')](respondWithResult(_0x3d134b,0xc9))[_0xbcc1('0x42')](handleError(_0x3d134b,null));};exports['update']=function(_0x4c2ed5,_0x13ceee){if(_0x4c2ed5[_0xbcc1('0x47')]['id']){delete _0x4c2ed5[_0xbcc1('0x47')]['id'];}return db[_0xbcc1('0x29')][_0xbcc1('0x45')]({'where':{'id':_0x4c2ed5[_0xbcc1('0x44')]['id']}})[_0xbcc1('0x21')](handleEntityNotFound(_0x13ceee,null))['then'](saveUpdates(_0x4c2ed5[_0xbcc1('0x47')],null))[_0xbcc1('0x21')](respondWithResult(_0x13ceee,null))['catch'](handleError(_0x13ceee,null));};exports[_0xbcc1('0x22')]=function(_0x5269b9,_0x5ccc74){return db[_0xbcc1('0x29')][_0xbcc1('0x45')]({'where':{'id':_0x5269b9[_0xbcc1('0x44')]['id']}})[_0xbcc1('0x21')](handleEntityNotFound(_0x5ccc74,null))['then'](removeEntity(_0x5ccc74,null))[_0xbcc1('0x42')](handleError(_0x5ccc74,null));};exports[_0xbcc1('0x48')]=function(_0xe641b6,_0x448a7a){return db['WhatsappTransferReport'][_0xbcc1('0x48')]()[_0xbcc1('0x21')](respondWithResult(_0x448a7a,null))[_0xbcc1('0x42')](handleError(_0x448a7a,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 58257c7..ce7c894 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 _0x60e0=['lodash','util','../../config/logger','api','moment','bluebird','path','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x408ed9,_0x59c5d6){var _0x337f0f=function(_0x2fe794){while(--_0x2fe794){_0x408ed9['push'](_0x408ed9['shift']());}};_0x337f0f(++_0x59c5d6);}(_0x60e0,0x120));var _0x060e=function(_0x14fa28,_0x4cad53){_0x14fa28=_0x14fa28-0x0;var _0x598c67=_0x60e0[_0x14fa28];return _0x598c67;};'use strict';var _=require(_0x060e('0x0'));var util=require(_0x060e('0x1'));var logger=require(_0x060e('0x2'))(_0x060e('0x3'));var moment=require(_0x060e('0x4'));var BPromise=require(_0x060e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x060e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x060e('0x7'));module[_0x060e('0x8')]=function(_0x449900,_0x8c55e8){return _0x449900['define'](_0x060e('0x9'),attributes,{'tableName':_0x060e('0xa'),'paranoid':![],'indexes':[{'name':_0x060e('0xb'),'fields':[_0x060e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x81df=['../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x81df,0x163));var _0xf81d=function(_0x41beea,_0x5104db){_0x41beea=_0x41beea-0x0;var _0x26fa17=_0x81df[_0x41beea];return _0x26fa17;};'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(_0xf81d('0x9'));var attributes=require(_0xf81d('0xa'));module['exports']=function(_0x56f541,_0x16ec69){return _0x56f541[_0xf81d('0xb')](_0xf81d('0xc'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xf81d('0xd'),'fields':[_0xf81d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 125c5e4..c62a5eb 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 _0x4936=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x21f4b2,_0x4fffe5){var _0x1d8b06=function(_0x416ec6){while(--_0x416ec6){_0x21f4b2['push'](_0x21f4b2['shift']());}};_0x1d8b06(++_0x4fffe5);}(_0x4936,0x9f));var _0x6493=function(_0xca42ed,_0x3cf6f3){_0xca42ed=_0xca42ed-0x0;var _0x2c59c5=_0x4936[_0xca42ed];return _0x2c59c5;};'use strict';var _=require(_0x6493('0x0'));var util=require(_0x6493('0x1'));var moment=require(_0x6493('0x2'));var BPromise=require(_0x6493('0x3'));var rs=require(_0x6493('0x4'));var fs=require('fs');var Redis=require(_0x6493('0x5'));var db=require(_0x6493('0x6'))['db'];var utils=require(_0x6493('0x7'));var logger=require('../../config/logger')(_0x6493('0x8'));var config=require('../../config/environment');var jayson=require(_0x6493('0x9'));var client=jayson[_0x6493('0xa')][_0x6493('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f43e1,_0xd68225,_0x39ec7b){return new BPromise(function(_0x13aabc,_0x16b0d9){return client[_0x6493('0xc')](_0x2f43e1,_0x39ec7b)[_0x6493('0xd')](function(_0x4105d0){logger[_0x6493('0xe')](_0x6493('0xf'),_0xd68225,_0x6493('0x10'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0xd68225,_0x6493('0x10'),JSON[_0x6493('0x11')](_0x4105d0));if(_0x4105d0[_0x6493('0x12')]){if(_0x4105d0[_0x6493('0x12')][_0x6493('0x13')]===0x1f4){logger['error'](_0x6493('0xf'),_0xd68225,_0x4105d0[_0x6493('0x12')][_0x6493('0x14')]);return _0x16b0d9(_0x4105d0[_0x6493('0x12')][_0x6493('0x14')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0xd68225,_0x4105d0[_0x6493('0x12')][_0x6493('0x14')]);return _0x13aabc(_0x4105d0[_0x6493('0x12')][_0x6493('0x14')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0xd68225,_0x6493('0x10'));_0x13aabc(_0x4105d0['result'][_0x6493('0x14')]);}})[_0x6493('0x15')](function(_0x43079b){logger[_0x6493('0x12')](_0x6493('0xf'),_0xd68225,_0x43079b);_0x16b0d9(_0x43079b);});});} \ No newline at end of file +var _0x6042=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x6042,0x109));var _0x2604=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6042[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2604('0x0'));var util=require(_0x2604('0x1'));var moment=require(_0x2604('0x2'));var BPromise=require(_0x2604('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2604('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2604('0x5'));var logger=require(_0x2604('0x6'))(_0x2604('0x7'));var config=require(_0x2604('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2604('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52ab02,_0xd9a858,_0x24381d){return new BPromise(function(_0x5e61ef,_0x43827d){return client[_0x2604('0xa')](_0x52ab02,_0x24381d)[_0x2604('0xb')](function(_0xf603ae){logger[_0x2604('0xc')](_0x2604('0xd'),_0xd9a858,_0x2604('0xe'));logger[_0x2604('0xf')](_0x2604('0x10'),_0xd9a858,_0x2604('0xe'),JSON[_0x2604('0x11')](_0xf603ae));if(_0xf603ae['error']){if(_0xf603ae[_0x2604('0x12')][_0x2604('0x13')]===0x1f4){logger[_0x2604('0x12')](_0x2604('0xd'),_0xd9a858,_0xf603ae[_0x2604('0x12')][_0x2604('0x14')]);return _0x43827d(_0xf603ae['error'][_0x2604('0x14')]);}logger[_0x2604('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0xd9a858,_0xf603ae[_0x2604('0x12')][_0x2604('0x14')]);return _0x5e61ef(_0xf603ae[_0x2604('0x12')][_0x2604('0x14')]);}else{logger[_0x2604('0xc')](_0x2604('0xd'),_0xd9a858,_0x2604('0xe'));_0x5e61ef(_0xf603ae[_0x2604('0x15')][_0x2604('0x14')]);}})[_0x2604('0x16')](function(_0x9d2402){logger[_0x2604('0x12')](_0x2604('0xd'),_0xd9a858,_0x9d2402);_0x43827d(_0x9d2402);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 67fe735..3497260 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f5d=['./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','name','Online\x20apps:','map','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB'];(function(_0x449d1e,_0x117a74){var _0x440487=function(_0x20435a){while(--_0x20435a){_0x449d1e['push'](_0x449d1e['shift']());}};_0x440487(++_0x117a74);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x4f5d[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xd4f5('0x0'));var db=require(_0xd4f5('0x1'))['db'];var seedDb=require(_0xd4f5('0x2'));var checkLicense=require(_0xd4f5('0x3'));var rpc=require(_0xd4f5('0x4'));var config=require(_0xd4f5('0x5'));var logger=require('./config/logger')(_0xd4f5('0x6'));var pm2=require(_0xd4f5('0x7'));var pm2Config=require(_0xd4f5('0x8'));var schedule=require(_0xd4f5('0x9'));var chat=require(_0xd4f5('0xa'));var whatsapp=require(_0xd4f5('0xb'));var transcribe=require(_0xd4f5('0xc'));var provider=require(_0xd4f5('0xd'));function main(){return db[_0xd4f5('0xe')][_0xd4f5('0xf')]()[_0xd4f5('0x10')](function(){if(config[_0xd4f5('0x11')]){return seedDb[_0xd4f5('0x12')]();}})['then'](function(){return checkLicense[_0xd4f5('0x12')]();})[_0xd4f5('0x10')](function(){return rpc['listen']();})[_0xd4f5('0x10')](function(_0x90fe4){logger[_0xd4f5('0x13')](_0x90fe4);return chat[_0xd4f5('0x14')]();})[_0xd4f5('0x10')](function(){return whatsapp[_0xd4f5('0x14')]();})[_0xd4f5('0x10')](function(){return schedule[_0xd4f5('0x14')]();})[_0xd4f5('0x10')](function(){return transcribe['start']();})[_0xd4f5('0x10')](function(){return provider[_0xd4f5('0x14')]();})['then'](function(_0x1553ec){logger[_0xd4f5('0x13')](_0x1553ec);return pm2[_0xd4f5('0x14')](pm2Config);})['then'](function(_0x166d4d){var _0x18dd1c=_0x166d4d[_0xd4f5('0x15')](function(_0x1a158f){return typeof _0x1a158f[_0xd4f5('0x16')]===_0xd4f5('0x17')&&_0x1a158f[_0xd4f5('0x16')]>=0x0;});if(_0x18dd1c[_0xd4f5('0x18')]>0x0){throw new Error(_0x18dd1c['length']+_0xd4f5('0x19')+_['map'](_0x18dd1c,function(_0x45d043){return'\x22'+_0x45d043['pm2_env'][_0xd4f5('0x1a')]+'\x22';}));}logger[_0xd4f5('0x13')](_0xd4f5('0x1b'),_[_0xd4f5('0x1c')](_[_0xd4f5('0x15')](_0x166d4d,{'status':_0xd4f5('0x1d')}),_0xd4f5('0x1a'))[_0xd4f5('0x1e')]());logger['info'](_0xd4f5('0x1f'),_[_0xd4f5('0x1c')](_['filter'](_0x166d4d,function(_0x1aae04){return _0x1aae04[_0xd4f5('0x20')]!=='online';}),'name')[_0xd4f5('0x1e')]()||_0xd4f5('0x21'));console[_0xd4f5('0x22')](_0xd4f5('0x23'));})[_0xd4f5('0x24')](function(_0x2a96b3){console[_0xd4f5('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2a96b3);logger['error'](_0xd4f5('0x25'),_0x2a96b3);process[_0xd4f5('0x26')](0x1);});}main(); \ No newline at end of file +var _0x3c17=['info','start','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online','join','Offline\x20apps:','status','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','default','listen'];(function(_0x14a6bb,_0x68aaa6){var _0x53d06f=function(_0x4335d7){while(--_0x4335d7){_0x14a6bb['push'](_0x14a6bb['shift']());}};_0x53d06f(++_0x68aaa6);}(_0x3c17,0x1a1));var _0x73c1=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x3c17[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0x73c1('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x73c1('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x73c1('0x2'));var config=require(_0x73c1('0x3'));var logger=require(_0x73c1('0x4'))('app');var pm2=require(_0x73c1('0x5'));var pm2Config=require(_0x73c1('0x6'));var schedule=require(_0x73c1('0x7'));var chat=require(_0x73c1('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x73c1('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x73c1('0xa')][_0x73c1('0xb')]()[_0x73c1('0xc')](function(){if(config['seedDB']){return seedDb['default']();}})[_0x73c1('0xc')](function(){return checkLicense[_0x73c1('0xd')]();})[_0x73c1('0xc')](function(){return rpc[_0x73c1('0xe')]();})[_0x73c1('0xc')](function(_0x11518f){logger[_0x73c1('0xf')](_0x11518f);return chat['start']();})['then'](function(){return whatsapp[_0x73c1('0x10')]();})[_0x73c1('0xc')](function(){return schedule[_0x73c1('0x10')]();})[_0x73c1('0xc')](function(){return transcribe['start']();})[_0x73c1('0xc')](function(){return provider['start']();})[_0x73c1('0xc')](function(_0x5f3799){logger[_0x73c1('0xf')](_0x5f3799);return pm2[_0x73c1('0x10')](pm2Config);})['then'](function(_0x537965){var _0x1cc555=_0x537965['filter'](function(_0x72a36){return typeof _0x72a36['exitCode']===_0x73c1('0x11')&&_0x72a36['exitCode']>=0x0;});if(_0x1cc555[_0x73c1('0x12')]>0x0){throw new Error(_0x1cc555[_0x73c1('0x12')]+_0x73c1('0x13')+_[_0x73c1('0x14')](_0x1cc555,function(_0x8c0803){return'\x22'+_0x8c0803[_0x73c1('0x15')][_0x73c1('0x16')]+'\x22';}));}logger[_0x73c1('0xf')](_0x73c1('0x17'),_['map'](_[_0x73c1('0x18')](_0x537965,{'status':_0x73c1('0x19')}),_0x73c1('0x16'))[_0x73c1('0x1a')]());logger['info'](_0x73c1('0x1b'),_[_0x73c1('0x14')](_[_0x73c1('0x18')](_0x537965,function(_0x2e17e5){return _0x2e17e5[_0x73c1('0x1c')]!==_0x73c1('0x19');}),_0x73c1('0x16'))[_0x73c1('0x1a')]()||'None');console[_0x73c1('0x1d')](_0x73c1('0x1e'));})[_0x73c1('0x1f')](function(_0x5eafe2){console[_0x73c1('0x1d')](_0x73c1('0x20'),_0x5eafe2);logger[_0x73c1('0x21')](_0x73c1('0x22'),_0x5eafe2);process[_0x73c1('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c13538d..60f18e1 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 _0x3533=['ValidationError','length','unshift','join','sign','secret','payload','options','promisify','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','voicePause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','closed','disposition','then','query','forceDownload','status','unmanaged','json','Unmanaged.','catch','headers','authorization','Basic','find','authenticate','Wrong\x20credentials.','user','startsWith','Unknown\x20authorization\x20format','getUuid','apikey','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','redirect','/dashboards/general','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x3533,0x9b));var _0x3353=function(_0x547379,_0x2492ff){_0x547379=_0x547379-0x0;var _0x3d0fa5=_0x3533[_0x547379];return _0x3d0fa5;};'use strict';var db=require(_0x3353('0x0'))['db'];var config=require(_0x3353('0x1'));var hardwareConf=require(_0x3353('0x2'));var licenseUtil=require(_0x3353('0x3'));var encryptor=require('../encryptor');var _=require(_0x3353('0x4'));var jwt=require(_0x3353('0x5'));var expressJwt=require(_0x3353('0x6'));var compose=require(_0x3353('0x7'));var basicAuth=require(_0x3353('0x8'));var crypto=require(_0x3353('0x9'));var BPromise=require(_0x3353('0xa'));var util=require('util');var moment=require(_0x3353('0xb'));var validateJwt=expressJwt({'secret':config[_0x3353('0xc')][_0x3353('0xd')]});var userAttributes=['id',_0x3353('0xe'),_0x3353('0xf'),_0x3353('0x10'),_0x3353('0x11'),_0x3353('0x12'),_0x3353('0x13'),_0x3353('0x14'),'md5secret',_0x3353('0x15'),'chatPause','mailPause',_0x3353('0x16'),_0x3353('0x17'),'openchannelPause',_0x3353('0x18'),_0x3353('0x19'),_0x3353('0x1a'),_0x3353('0x1b'),_0x3353('0x1c'),_0x3353('0x1d'),_0x3353('0x1e'),_0x3353('0x1f'),_0x3353('0x20'),'phoneBarAutoAnswerDelay',_0x3353('0x21'),'phoneBarEnableRecording',_0x3353('0x22'),_0x3353('0x23'),_0x3353('0x24'),_0x3353('0x25'),_0x3353('0x26'),_0x3353('0x27'),_0x3353('0x28'),_0x3353('0x29'),_0x3353('0x2a'),_0x3353('0x2b'),_0x3353('0x2c'),_0x3353('0x2d'),_0x3353('0x2e'),'downloadOmnichannelInteractions',_0x3353('0x2f'),_0x3353('0x30'),_0x3353('0x31'),_0x3353('0x32'),'chatAutoanswerDelay',_0x3353('0x33'),'emailAutoanswerDelay',_0x3353('0x34'),_0x3353('0x35'),'openchannelAutoanswer',_0x3353('0x36'),_0x3353('0x37'),_0x3353('0x38'),_0x3353('0x39'),'whatsappAutoanswerDelay',_0x3353('0x3a')];exports[_0x3353('0x3b')]=function(){return this[_0x3353('0x3c')](!![])[_0x3353('0x3d')](function(_0x1d9d56,_0x48b8a9,_0x49f341){if(_0x1d9d56['user']){_0x49f341();}else{return db[_0x3353('0x3e')][_0x3353('0x3f')]({'where':{'id':_0x1d9d56[_0x3353('0x40')]['id']},'attributes':['id',_0x3353('0x41'),_0x3353('0x42')],'raw':!![]})[_0x3353('0x43')](function(_0x4cbe9c){if(_0x4cbe9c&&_0x4cbe9c['closed']&&!_0x1d9d56[_0x3353('0x44')][_0x3353('0x45')]){return _0x48b8a9[_0x3353('0x46')](_0x4cbe9c['disposition']===_0x3353('0x47')?0x195:0x193)[_0x3353('0x48')]({'message':_0x4cbe9c[_0x3353('0x42')]===_0x3353('0x47')?_0x3353('0x49'):'Forbidden.'});}else{_0x49f341();}})[_0x3353('0x4a')](function(_0x505287){_0x49f341(_0x505287);});}});};exports[_0x3353('0x3c')]=function isAuthenticated(_0x58540a){return compose()[_0x3353('0x3d')](function(_0xad4c83,_0x5581dc,_0x1d3f24){var _0x5b22ef;if(_0xad4c83[_0x3353('0x4b')][_0x3353('0x4c')]){if(_['startsWith'](_0xad4c83['headers'][_0x3353('0x4c')],_0x3353('0x4d'))){var _0x33e4aa=basicAuth(_0xad4c83);db['User'][_0x3353('0x4e')]({'where':{'name':_0x33e4aa[_0x3353('0x10')]}})[_0x3353('0x43')](function(_0x33c4e3){if(!_0x33c4e3||!_0x33c4e3[_0x3353('0x4f')](_0x33e4aa['pass'])){return _0x5581dc[_0x3353('0x46')](0x191)[_0x3353('0x48')]({'message':_0x3353('0x50')});}_0xad4c83[_0x3353('0x51')]={'id':_0x33c4e3['id']};_0x1d3f24();})[_0x3353('0x4a')](function(_0x57f473){_0x1d3f24(_0x57f473);});}else if(_[_0x3353('0x52')](_0xad4c83['headers'][_0x3353('0x4c')],'Bearer')){validateJwt(_0xad4c83,_0x5581dc,_0x1d3f24);}else{if(_0x58540a){_0x1d3f24();}else{return _0x5581dc[_0x3353('0x46')](0x193)[_0x3353('0x48')]({'message':_0x3353('0x53')});}}}else if(_0xad4c83['query']['apikey']){try{var _0x4440f0={'audience':hardwareConf[_0x3353('0x54')](),'issuer':hardwareConf[_0x3353('0x54')]()};verifyJwt(_0xad4c83[_0x3353('0x44')][_0x3353('0x55')],_0x4440f0)[_0x3353('0x43')](function(_0x4d19e6){return db['User'][_0x3353('0x4e')]({'where':{'id':_0x4d19e6[_0x3353('0x56')]}})[_0x3353('0x43')](function(_0x38e562){_0x5b22ef=_0x38e562;return db['Setting'][_0x3353('0x3f')]({'where':{'id':0x1},'attributes':[_0x3353('0x57'),_0x3353('0x58')],'raw':!![]});})[_0x3353('0x43')](function(_0x311d0c){if(!_0x5b22ef||!_[_0x3353('0x59')](_0x5b22ef[_0x3353('0x5a')],_0x4d19e6[_0x3353('0x5b')])){return _0x5581dc[_0x3353('0x46')](0x191)[_0x3353('0x48')]({'message':_0x3353('0x5c')});}if(_0x5b22ef['disabled']){return _0x5581dc[_0x3353('0x46')](0x191)[_0x3353('0x48')]({'message':_0x3353('0x5d')});}if(_0x5b22ef[_0x3353('0x5e')]){if(_0x311d0c[_0x3353('0x58')]>0x0){if(moment(_0x5b22ef[_0x3353('0x5f')])['add'](_0x311d0c['blockDuration'],_0x3353('0x60'))>moment()){return _0x5581dc[_0x3353('0x46')](0x191)['json']({'message':_0x3353('0x5d')});}}else{return _0x5581dc[_0x3353('0x46')](0x191)[_0x3353('0x48')]({'message':'Invalid\x20API\x20access\x20key'});}}_0xad4c83['user']={'id':_0x5b22ef['id']};_0x1d3f24();});})[_0x3353('0x4a')](function(){return _0x5581dc[_0x3353('0x46')](0x191)['json']({'message':_0x3353('0x5d')});});}catch(_0x36f6b6){_0x1d3f24(_0x36f6b6);}}else if(_0x58540a){_0x1d3f24();}else{return _0x5581dc[_0x3353('0x46')](0x193)[_0x3353('0x48')]({'message':_0x3353('0x53')});}})[_0x3353('0x3d')](function(_0xc08578,_0x2fa37,_0x25496c){if(_0xc08578[_0x3353('0x51')]){db[_0x3353('0x61')][_0x3353('0x4e')]({'where':{'id':_0xc08578[_0x3353('0x51')]['id']},'attributes':userAttributes})[_0x3353('0x43')](function(_0x20bc0c){if(!_0x20bc0c){return _0x2fa37[_0x3353('0x46')](0x194)[_0x3353('0x48')]({'message':_0x3353('0x62')});}_0xc08578['user']=_0x20bc0c;_0x25496c();})[_0x3353('0x4a')](function(_0x53331f){_0x25496c(_0x53331f);});}else if(_0x58540a){_0x25496c();}else{return _0x2fa37[_0x3353('0x46')](0x194)[_0x3353('0x48')]({'message':_0x3353('0x63')});}});};exports[_0x3353('0x64')]=function canUpdate(){return compose()['use'](function(_0x25dde1,_0x41b84f,_0xe5f9d){return licenseUtil[_0x3353('0x65')]()['then'](function(_0x3935ff){if(_0x3935ff[_0x3353('0x66')]){_0xe5f9d();}else{return _0x41b84f[_0x3353('0x46')](0x193)[_0x3353('0x48')]({'message':'Forbidden'});}})[_0x3353('0x4a')](function(_0xccca02){_0xe5f9d(_0xccca02);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x3353('0x3d')](function(_0x1a78e6,_0x128251,_0x370492){return licenseUtil['getLicense']()[_0x3353('0x43')](function(_0x2f976d){if(_0x2f976d[_0x3353('0x67')]){_0x370492();}else{return _0x128251[_0x3353('0x46')](0x193)[_0x3353('0x48')]({'message':_0x3353('0x68')});}})[_0x3353('0x4a')](function(_0x581d81){_0x370492(_0x581d81);});});};exports[_0x3353('0x69')]=function(_0xe7850e,_0x9d50a,_0xcd9844){_0xe7850e['isMiddleware']=!![];return _0xcd9844();};exports[_0x3353('0x6a')]=function signToken(_0x2acd72){return signJwt(_0x2acd72);};exports[_0x3353('0x6b')]=function(_0x3d7b3e,_0x27729d){if(!_0x3d7b3e[_0x3353('0x51')]){return _0x27729d[_0x3353('0x46')](0x194)[_0x3353('0x48')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x146f84={'payload':{'id':_0x3d7b3e[_0x3353('0x51')]['id'],'role':_0x3d7b3e[_0x3353('0x51')][_0x3353('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x146f84)[_0x3353('0x43')](function(_0x5c52fe){_0x27729d[_0x3353('0x6c')]('motion.token',_0x5c52fe);_0x27729d[_0x3353('0x6d')](_0x3353('0x6e'));})[_0x3353('0x4a')](function(_0x262f96){return _0x27729d[_0x3353('0x46')](0x1f4)['send'](_0x262f96);});};exports[_0x3353('0x6f')]=function(_0xf34fda){if(_[_0x3353('0x70')](_0xf34fda[_0x3353('0x5a')])||_[_0x3353('0x70')](_0xf34fda['apiKeyIat'])){return null;}else{return createJwt(_0xf34fda);}};exports[_0x3353('0x71')]=function(_0xbf09a5){_0xbf09a5[_0x3353('0x5a')]=generateNonce();_0xbf09a5[_0x3353('0x72')]=generateIssuedAt();return createJwt(_0xbf09a5);};exports[_0x3353('0x73')]=function(_0x1c7f37,_0x5384ee){var _0x4a2ada=_0x1c7f37[_0x3353('0x44')]['apikey'];if(_0x4a2ada){var _0x29aeff={'nonce':_0x5384ee[_0x3353('0x5a')],'iat':_0x5384ee['apiKeyIat'],'audience':hardwareConf[_0x3353('0x54')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x4a2ada,_0x29aeff)['then'](function(){return generateApiKey(_0x5384ee);});}else{throw{'message':_0x3353('0x74')};}};exports[_0x3353('0x75')]=function(_0x5cdabb){var _0x35e02f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x35e02f[_0x3353('0x76')](_0x5cdabb))throw new db[(_0x3353('0x77'))]['ValidationError'](_0x3353('0x78'));return;};exports[_0x3353('0x79')]=function(_0x189709,_0x64628a,_0x1e76c9){var _0x521c90=encryptor[_0x3353('0x7a')](_0x64628a)[_0x3353('0x7b')](',');for(var _0x1c220b=0x0;_0x1c220b<_0x1e76c9;_0x1c220b++){if(!_0x521c90[_0x1c220b])break;if(_0x189709['toLowerCase']()===_0x521c90[_0x1c220b][_0x3353('0x7c')]()){var _0x9aa8de=util[_0x3353('0x7d')](_0x3353('0x7e'),_0x1e76c9);if(_0x1e76c9===0x1){_0x9aa8de='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x3353('0x7f'))](_0x9aa8de);}}return;};exports['updatePasswordsHistory']=function(_0x36fb46,_0xf6d405){var _0x4e99a2=_0xf6d405?encryptor[_0x3353('0x7a')](_0xf6d405)['split'](','):[];if(_0x4e99a2[_0x3353('0x80')]===0x5){_0x4e99a2['splice'](-0x1,0x1);}_0x4e99a2[_0x3353('0x81')](_0x36fb46);return encryptor['encryptString'](_0x4e99a2[_0x3353('0x82')](','));};function signJwt(_0x58ed8d){var _0x52a3d7=BPromise['promisify'](jwt[_0x3353('0x83')],{'context':jwt});var _0x2efaa0=_0x58ed8d[_0x3353('0x84')]||config[_0x3353('0xc')][_0x3353('0xd')];return new BPromise(function(_0x46c4c3,_0x525d42){_0x52a3d7(_0x58ed8d[_0x3353('0x85')],_0x2efaa0,_0x58ed8d[_0x3353('0x86')])[_0x3353('0x43')](function(_0x299cde){_0x46c4c3(_0x299cde);})[_0x3353('0x4a')](function(_0x308bb2){_0x525d42(_0x308bb2);});});}function verifyJwt(_0x188565,_0x221416,_0x4f1516){var _0x29b86d=BPromise[_0x3353('0x87')](jwt['verify'],{'context':jwt});var _0x1633d0=_0x4f1516||config[_0x3353('0xc')]['session'];return new BPromise(function(_0x30b126,_0x142c25){_0x29b86d(_0x188565,_0x1633d0,_0x221416)[_0x3353('0x43')](function(_0x577ce8){_0x30b126(_0x577ce8);})[_0x3353('0x4a')](function(_0x5da18b){_0x142c25(_0x5da18b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x3353('0x88')](_0x3353('0x89'));}function generateIssuedAt(){return Math[_0x3353('0x8a')](Date[_0x3353('0x8b')]()/0x3e8)['toString']();}function createJwt(_0x2d8af9){var _0xc00623={'payload':{'iat':_0x2d8af9[_0x3353('0x72')],'nonce':_0x2d8af9[_0x3353('0x5a')]},'options':{'algorithm':_0x3353('0x8c'),'subject':_0x2d8af9['id']['toString'](),'issuer':hardwareConf[_0x3353('0x54')](),'audience':hardwareConf[_0x3353('0x54')]()}};return signJwt(_0xc00623)[_0x3353('0x43')](function(_0x5afcaa){return{'iat':_0x2d8af9['apiKeyIat'],'nonce':_0x2d8af9[_0x3353('0x5a')],'token':_0x5afcaa};});} \ No newline at end of file +var _0xdfe2=['bluebird','util','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isAuthenticated','user','ChatInteraction','findOne','params','closed','then','query','forceDownload','status','unmanaged','json','disposition','Forbidden.','catch','use','headers','authorization','startsWith','Basic','User','find','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','promisify','sign','secrets','payload','options','verify','randomBytes','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','composable-middleware','crypto'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xdfe2,0x86));var _0x2dfe=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xdfe2[_0x101e7b];return _0x4995c0;};'use strict';var db=require(_0x2dfe('0x0'))['db'];var config=require(_0x2dfe('0x1'));var hardwareConf=require(_0x2dfe('0x2'));var licenseUtil=require(_0x2dfe('0x3'));var encryptor=require(_0x2dfe('0x4'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x2dfe('0x5'));var compose=require(_0x2dfe('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x2dfe('0x7'));var BPromise=require(_0x2dfe('0x8'));var util=require(_0x2dfe('0x9'));var moment=require(_0x2dfe('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0x2dfe('0xb')]});var userAttributes=['id',_0x2dfe('0xc'),_0x2dfe('0xd'),_0x2dfe('0xe'),_0x2dfe('0xf'),_0x2dfe('0x10'),_0x2dfe('0x11'),_0x2dfe('0x12'),_0x2dfe('0x13'),_0x2dfe('0x14'),_0x2dfe('0x15'),_0x2dfe('0x16'),_0x2dfe('0x17'),_0x2dfe('0x18'),_0x2dfe('0x19'),_0x2dfe('0x1a'),_0x2dfe('0x1b'),_0x2dfe('0x1c'),_0x2dfe('0x1d'),_0x2dfe('0x1e'),_0x2dfe('0x1f'),'passwordResetAt','alias',_0x2dfe('0x20'),_0x2dfe('0x21'),_0x2dfe('0x22'),_0x2dfe('0x23'),_0x2dfe('0x24'),'phoneBarEnableSettings',_0x2dfe('0x25'),'phoneBarPrefixRequired',_0x2dfe('0x26'),_0x2dfe('0x27'),_0x2dfe('0x28'),_0x2dfe('0x29'),_0x2dfe('0x2a'),_0x2dfe('0x2b'),'settingsEnabled',_0x2dfe('0x2c'),_0x2dfe('0x2d'),_0x2dfe('0x2e'),_0x2dfe('0x2f'),'ignorePauseForPreviewCalls',_0x2dfe('0x30'),'chatAutoanswer',_0x2dfe('0x31'),'emailAutoanswer',_0x2dfe('0x32'),_0x2dfe('0x33'),_0x2dfe('0x34'),'openchannelAutoanswer',_0x2dfe('0x35'),_0x2dfe('0x36'),_0x2dfe('0x37'),_0x2dfe('0x38'),_0x2dfe('0x39'),'messengerSoundNotification'];exports['isChatInteractionAuthorized']=function(){return this[_0x2dfe('0x3a')](!![])['use'](function(_0x166b59,_0x4a8f60,_0x5d13a3){if(_0x166b59[_0x2dfe('0x3b')]){_0x5d13a3();}else{return db[_0x2dfe('0x3c')][_0x2dfe('0x3d')]({'where':{'id':_0x166b59[_0x2dfe('0x3e')]['id']},'attributes':['id',_0x2dfe('0x3f'),'disposition'],'raw':!![]})[_0x2dfe('0x40')](function(_0x48fd34){if(_0x48fd34&&_0x48fd34[_0x2dfe('0x3f')]&&!_0x166b59[_0x2dfe('0x41')][_0x2dfe('0x42')]){return _0x4a8f60[_0x2dfe('0x43')](_0x48fd34['disposition']===_0x2dfe('0x44')?0x195:0x193)[_0x2dfe('0x45')]({'message':_0x48fd34[_0x2dfe('0x46')]==='unmanaged'?'Unmanaged.':_0x2dfe('0x47')});}else{_0x5d13a3();}})[_0x2dfe('0x48')](function(_0x3b58da){_0x5d13a3(_0x3b58da);});}});};exports[_0x2dfe('0x3a')]=function isAuthenticated(_0x46b996){return compose()[_0x2dfe('0x49')](function(_0x2cfe62,_0x35fcb3,_0x4f010d){var _0x2e6b0a;if(_0x2cfe62[_0x2dfe('0x4a')][_0x2dfe('0x4b')]){if(_[_0x2dfe('0x4c')](_0x2cfe62['headers']['authorization'],_0x2dfe('0x4d'))){var _0x33b691=basicAuth(_0x2cfe62);db[_0x2dfe('0x4e')][_0x2dfe('0x4f')]({'where':{'name':_0x33b691[_0x2dfe('0xe')]}})['then'](function(_0x23f02a){if(!_0x23f02a||!_0x23f02a[_0x2dfe('0x50')](_0x33b691['pass'])){return _0x35fcb3[_0x2dfe('0x43')](0x191)[_0x2dfe('0x45')]({'message':_0x2dfe('0x51')});}_0x2cfe62[_0x2dfe('0x3b')]={'id':_0x23f02a['id']};_0x4f010d();})[_0x2dfe('0x48')](function(_0x3064c0){_0x4f010d(_0x3064c0);});}else if(_[_0x2dfe('0x4c')](_0x2cfe62['headers'][_0x2dfe('0x4b')],_0x2dfe('0x52'))){validateJwt(_0x2cfe62,_0x35fcb3,_0x4f010d);}else{if(_0x46b996){_0x4f010d();}else{return _0x35fcb3[_0x2dfe('0x43')](0x193)[_0x2dfe('0x45')]({'message':_0x2dfe('0x53')});}}}else if(_0x2cfe62[_0x2dfe('0x41')][_0x2dfe('0x54')]){try{var _0x4c7de1={'audience':hardwareConf[_0x2dfe('0x55')](),'issuer':hardwareConf[_0x2dfe('0x55')]()};verifyJwt(_0x2cfe62[_0x2dfe('0x41')][_0x2dfe('0x54')],_0x4c7de1)[_0x2dfe('0x40')](function(_0x5af8a6){return db[_0x2dfe('0x4e')][_0x2dfe('0x4f')]({'where':{'id':_0x5af8a6['sub']}})[_0x2dfe('0x40')](function(_0x10089c){_0x2e6b0a=_0x10089c;return db[_0x2dfe('0x56')][_0x2dfe('0x3d')]({'where':{'id':0x1},'attributes':[_0x2dfe('0x57'),'blockDuration'],'raw':!![]});})[_0x2dfe('0x40')](function(_0x70f603){if(!_0x2e6b0a||!_[_0x2dfe('0x58')](_0x2e6b0a[_0x2dfe('0x59')],_0x5af8a6[_0x2dfe('0x5a')])){return _0x35fcb3[_0x2dfe('0x43')](0x191)[_0x2dfe('0x45')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x2e6b0a[_0x2dfe('0x5b')]){return _0x35fcb3[_0x2dfe('0x43')](0x191)['json']({'message':_0x2dfe('0x5c')});}if(_0x2e6b0a[_0x2dfe('0x5d')]){if(_0x70f603[_0x2dfe('0x5e')]>0x0){if(moment(_0x2e6b0a[_0x2dfe('0x5f')])[_0x2dfe('0x60')](_0x70f603['blockDuration'],'minutes')>moment()){return _0x35fcb3[_0x2dfe('0x43')](0x191)['json']({'message':_0x2dfe('0x5c')});}}else{return _0x35fcb3['status'](0x191)[_0x2dfe('0x45')]({'message':_0x2dfe('0x5c')});}}_0x2cfe62[_0x2dfe('0x3b')]={'id':_0x2e6b0a['id']};_0x4f010d();});})[_0x2dfe('0x48')](function(){return _0x35fcb3[_0x2dfe('0x43')](0x191)['json']({'message':_0x2dfe('0x5c')});});}catch(_0x34e117){_0x4f010d(_0x34e117);}}else if(_0x46b996){_0x4f010d();}else{return _0x35fcb3['status'](0x193)[_0x2dfe('0x45')]({'message':_0x2dfe('0x53')});}})['use'](function(_0x249232,_0x71ff16,_0x5ad8e6){if(_0x249232[_0x2dfe('0x3b')]){db[_0x2dfe('0x4e')][_0x2dfe('0x4f')]({'where':{'id':_0x249232[_0x2dfe('0x3b')]['id']},'attributes':userAttributes})[_0x2dfe('0x40')](function(_0x43326f){if(!_0x43326f){return _0x71ff16[_0x2dfe('0x43')](0x194)[_0x2dfe('0x45')]({'message':_0x2dfe('0x61')});}_0x249232[_0x2dfe('0x3b')]=_0x43326f;_0x5ad8e6();})[_0x2dfe('0x48')](function(_0x59d5d3){_0x5ad8e6(_0x59d5d3);});}else if(_0x46b996){_0x5ad8e6();}else{return _0x71ff16['status'](0x194)[_0x2dfe('0x45')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x2dfe('0x62')]=function canUpdate(){return compose()[_0x2dfe('0x49')](function(_0x187afe,_0x26679b,_0x1d2c98){return licenseUtil[_0x2dfe('0x63')]()[_0x2dfe('0x40')](function(_0x2bfdb6){if(_0x2bfdb6[_0x2dfe('0x64')]){_0x1d2c98();}else{return _0x26679b[_0x2dfe('0x43')](0x193)[_0x2dfe('0x45')]({'message':'Forbidden'});}})[_0x2dfe('0x48')](function(_0x5e73ca){_0x1d2c98(_0x5e73ca);});});};exports[_0x2dfe('0x65')]=function isWebrtcLicence(){return compose()[_0x2dfe('0x49')](function(_0x517d33,_0x431f1a,_0x58943f){return licenseUtil[_0x2dfe('0x63')]()[_0x2dfe('0x40')](function(_0x5b9dac){if(_0x5b9dac[_0x2dfe('0x66')]){_0x58943f();}else{return _0x431f1a['status'](0x193)[_0x2dfe('0x45')]({'message':'Forbidden'});}})[_0x2dfe('0x48')](function(_0x1e1295){_0x58943f(_0x1e1295);});});};exports[_0x2dfe('0x67')]=function(_0x40a3cc,_0x21c1b5,_0xa8c5fa){_0x40a3cc[_0x2dfe('0x67')]=!![];return _0xa8c5fa();};exports[_0x2dfe('0x68')]=function signToken(_0x18bd3c){return signJwt(_0x18bd3c);};exports['setTokenCookie']=function(_0x1e25df,_0x372def){if(!_0x1e25df[_0x2dfe('0x3b')]){return _0x372def['status'](0x194)[_0x2dfe('0x45')]({'message':_0x2dfe('0x69')});}var _0xd19cfd={'payload':{'id':_0x1e25df[_0x2dfe('0x3b')]['id'],'role':_0x1e25df['user'][_0x2dfe('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0xd19cfd)[_0x2dfe('0x40')](function(_0x9fd035){_0x372def[_0x2dfe('0x6a')](_0x2dfe('0x6b'),_0x9fd035);_0x372def[_0x2dfe('0x6c')](_0x2dfe('0x6d'));})[_0x2dfe('0x48')](function(_0x34ff35){return _0x372def[_0x2dfe('0x43')](0x1f4)[_0x2dfe('0x6e')](_0x34ff35);});};exports['retrieveApiKey']=function(_0x4111b0){if(_[_0x2dfe('0x6f')](_0x4111b0[_0x2dfe('0x59')])||_[_0x2dfe('0x6f')](_0x4111b0['apiKeyIat'])){return null;}else{return createJwt(_0x4111b0);}};exports[_0x2dfe('0x70')]=function(_0x4f950b){_0x4f950b['apiKeyNonce']=generateNonce();_0x4f950b[_0x2dfe('0x71')]=generateIssuedAt();return createJwt(_0x4f950b);};exports[_0x2dfe('0x72')]=function(_0x94f619,_0x430219){var _0x3c2b74=_0x94f619[_0x2dfe('0x41')][_0x2dfe('0x54')];if(_0x3c2b74){var _0x19c03d={'nonce':_0x430219[_0x2dfe('0x59')],'iat':_0x430219[_0x2dfe('0x71')],'audience':hardwareConf[_0x2dfe('0x55')](),'issuer':hardwareConf[_0x2dfe('0x55')]()};return verifyJwt(_0x3c2b74,_0x19c03d)[_0x2dfe('0x40')](function(){return generateApiKey(_0x430219);});}else{throw{'message':_0x2dfe('0x73')};}};exports['validatePasswordPattern']=function(_0x2ab2a1){var _0x452a84=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x452a84[_0x2dfe('0x74')](_0x2ab2a1))throw new db[(_0x2dfe('0x75'))][(_0x2dfe('0x76'))](_0x2dfe('0x77'));return;};exports[_0x2dfe('0x78')]=function(_0x1987a6,_0x3be5ab,_0x193dc){var _0x182014=encryptor[_0x2dfe('0x79')](_0x3be5ab)[_0x2dfe('0x7a')](',');for(var _0xb538f4=0x0;_0xb538f4<_0x193dc;_0xb538f4++){if(!_0x182014[_0xb538f4])break;if(_0x1987a6['toLowerCase']()===_0x182014[_0xb538f4][_0x2dfe('0x7b')]()){var _0x4177f5=util[_0x2dfe('0x7c')](_0x2dfe('0x7d'),_0x193dc);if(_0x193dc===0x1){_0x4177f5=_0x2dfe('0x7e');}throw new db['Sequelize'][(_0x2dfe('0x76'))](_0x4177f5);}}return;};exports[_0x2dfe('0x7f')]=function(_0x5149bd,_0x4a0e87){var _0x14aaa3=_0x4a0e87?encryptor[_0x2dfe('0x79')](_0x4a0e87)[_0x2dfe('0x7a')](','):[];if(_0x14aaa3[_0x2dfe('0x80')]===0x5){_0x14aaa3[_0x2dfe('0x81')](-0x1,0x1);}_0x14aaa3[_0x2dfe('0x82')](_0x5149bd);return encryptor['encryptString'](_0x14aaa3['join'](','));};function signJwt(_0x52c6cb){var _0x4d7f29=BPromise[_0x2dfe('0x83')](jwt[_0x2dfe('0x84')],{'context':jwt});var _0x37d811=_0x52c6cb['secret']||config[_0x2dfe('0x85')][_0x2dfe('0xb')];return new BPromise(function(_0x2bd023,_0x2bd430){_0x4d7f29(_0x52c6cb[_0x2dfe('0x86')],_0x37d811,_0x52c6cb[_0x2dfe('0x87')])[_0x2dfe('0x40')](function(_0x4e2b5d){_0x2bd023(_0x4e2b5d);})['catch'](function(_0x34240e){_0x2bd430(_0x34240e);});});}function verifyJwt(_0x218043,_0x78bb79,_0x625196){var _0x2bb27d=BPromise[_0x2dfe('0x83')](jwt[_0x2dfe('0x88')],{'context':jwt});var _0x4c6ef5=_0x625196||config[_0x2dfe('0x85')][_0x2dfe('0xb')];return new BPromise(function(_0x3ce9fb,_0x135155){_0x2bb27d(_0x218043,_0x4c6ef5,_0x78bb79)[_0x2dfe('0x40')](function(_0x40a6dc){_0x3ce9fb(_0x40a6dc);})[_0x2dfe('0x48')](function(_0x54e43f){_0x135155(_0x54e43f);});});}function generateNonce(){return crypto[_0x2dfe('0x89')](0x10)['toString'](_0x2dfe('0x8a'));}function generateIssuedAt(){return Math[_0x2dfe('0x8b')](Date[_0x2dfe('0x8c')]()/0x3e8)['toString']();}function createJwt(_0x416ab1){var _0x4f03bd={'payload':{'iat':_0x416ab1[_0x2dfe('0x71')],'nonce':_0x416ab1['apiKeyNonce']},'options':{'algorithm':_0x2dfe('0x8d'),'subject':_0x416ab1['id']['toString'](),'issuer':hardwareConf[_0x2dfe('0x55')](),'audience':hardwareConf[_0x2dfe('0x55')]()}};return signJwt(_0x4f03bd)[_0x2dfe('0x40')](function(_0x3d08b5){return{'iat':_0x416ab1[_0x2dfe('0x71')],'nonce':_0x416ab1['apiKeyNonce'],'token':_0x3d08b5};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index ca381ff..7ac580f 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 _0xf4cd=['describe','keys','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','filter','clause','user','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','rows','CmContact'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xf4cd,0x1ad));var _0xdf4c=function(_0x388685,_0x3cb775){_0x388685=_0x388685-0x0;var _0x103b2f=_0xf4cd[_0x388685];return _0x103b2f;};'use strict';var _=require(_0xdf4c('0x0'));var sqlUtils=require(_0xdf4c('0x1'));var db=require(_0xdf4c('0x2'))['db'];exports[_0xdf4c('0x3')]=function(_0x8afd72,_0x32bfcb,_0x3b6f94,_0x52e1b3){var _0x2a46e0={'count':0x0,'rows':[]};var _0x36058e=sqlUtils[_0xdf4c('0x4')](_0x32bfcb,_0x8afd72);if(_0x36058e){return Promise[_0xdf4c('0x5')](_0x2a46e0);}var _0x2c30e2=sqlUtils['getContactsSubquery']();var _0x354b22={};var _0x181bff=![];var _0x474f3a=![];return Promise[_0xdf4c('0x5')]()[_0xdf4c('0x6')](function(){if(_0x8afd72[_0xdf4c('0x7')]){return sqlUtils[_0xdf4c('0x8')](_0x8afd72[_0xdf4c('0x7')],_0x52e1b3);}else{return sqlUtils[_0xdf4c('0x9')](_0x8afd72,_0x52e1b3);}})[_0xdf4c('0x6')](function(_0x34f870){_0x2c30e2['where'](_0x34f870[_0xdf4c('0xa')]);_0x2c30e2[_0xdf4c('0xb')](_0x34f870['fields']);_0x2c30e2[_0xdf4c('0xb')](_0x34f870[_0xdf4c('0xc')]);_0x2c30e2[_0xdf4c('0xb')](_0x34f870['user'][_0xdf4c('0xd')]);_0x354b22=_0x34f870['tags'];_0x474f3a=_0x34f870[_0xdf4c('0xe')][_0xdf4c('0xf')];return sqlUtils[_0xdf4c('0x10')](_0x32bfcb,_0x8afd72,_0x474f3a);})[_0xdf4c('0x6')](function(_0x454863){_0x2c30e2[_0xdf4c('0xb')](_0x454863);var _0x1c829d=_0x8afd72[_0xdf4c('0x7')]?_0x354b22[_0xdf4c('0x11')]:_0x8afd72[_0xdf4c('0x12')];_0x181bff=_0x1c829d?!![]:![];return sqlUtils[_0xdf4c('0x13')](_0x2c30e2,_0x1c829d);})[_0xdf4c('0x6')](function(_0x4e5777){_0x2a46e0[_0xdf4c('0x14')]=_0x4e5777;if(_0x2a46e0[_0xdf4c('0x14')]===0x0){return;}if(_0x8afd72[_0xdf4c('0x15')]){_0x474f3a=!![];}return sqlUtils[_0xdf4c('0x16')](_0x2c30e2,_0x8afd72[_0xdf4c('0x17')],_0x3b6f94,_0x181bff,_0x354b22[_0xdf4c('0xd')],_0x474f3a);})[_0xdf4c('0x6')](function(_0x47c7c6){if(!_0x47c7c6){return[];}return sqlUtils[_0xdf4c('0x18')](_0x47c7c6,_0x8afd72,_0x3b6f94);})[_0xdf4c('0x6')](function(_0x719665){_0x2a46e0[_0xdf4c('0x19')]=_0x719665;return _0x2a46e0;})['catch'](function(_0x322a4c){throw _0x322a4c;});};exports['describe']=function(){var _0x3b5ebc={};var _0x4197bb=[];return db[_0xdf4c('0x1a')][_0xdf4c('0x1b')]()[_0xdf4c('0x6')](function(_0x376dc4){_0x3b5ebc=_0x376dc4;var _0x137fdf=Object[_0xdf4c('0x1c')](_0x3b5ebc)['filter'](function(_0x44e388){return _['startsWith'](_0x44e388,_0xdf4c('0x1d'))?_0x44e388:undefined;});var _0xc19006=_0x137fdf[_0xdf4c('0x1e')](function(_0xef968d){return db[_0xdf4c('0x1f')][_0xdf4c('0x20')]({'where':{'id':_0xef968d[_0xdf4c('0x21')](0x3)},'raw':!![]});});return Promise[_0xdf4c('0x22')](_0xc19006);})[_0xdf4c('0x6')](function(_0x3ce6ad){for(var _0x337ea1=0x0;_0x337ea1<_0x3ce6ad[_0xdf4c('0x23')];_0x337ea1++){if(_0x3ce6ad[_0x337ea1]){var _0x3e4be5='cf_'+_0x3ce6ad[_0x337ea1]['id'];_0x3b5ebc[_0x3e4be5][_0xdf4c('0x24')]=_0x3ce6ad[_0x337ea1][_0xdf4c('0x25')];}}_0x4197bb=_['map'](Object[_0xdf4c('0x1c')](_0x3b5ebc),function(_0x299ab3){return{'name':_0x299ab3,'type':_0x3b5ebc[_0x299ab3][_0xdf4c('0x25')]};});return _0x4197bb;})['catch'](function(_0x5a0076){throw _0x5a0076;});}; \ No newline at end of file +var _0xfbfb=['filter','user','clause','tags','checkListsRestrictions','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','describe','startsWith','cf_','map','findOne','slice','all','length','fieldType','type','catch','./sql-utils','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseQueryParameters','where','fields'];(function(_0x18ba0d,_0x38941d){var _0x4ea85a=function(_0x2e0cc0){while(--_0x2e0cc0){_0x18ba0d['push'](_0x18ba0d['shift']());}};_0x4ea85a(++_0x38941d);}(_0xfbfb,0x116));var _0xbfbf=function(_0x4f7a4b,_0x5d759e){_0x4f7a4b=_0x4f7a4b-0x0;var _0x1cb979=_0xfbfb[_0x4f7a4b];return _0x1cb979;};'use strict';var _=require('lodash');var sqlUtils=require(_0xbfbf('0x0'));var db=require(_0xbfbf('0x1'))['db'];exports['findAll']=function(_0x28cf6c,_0x370eab,_0xbc04de,_0x366b5e){var _0x4a4ccf={'count':0x0,'rows':[]};var _0x52d17e=sqlUtils[_0xbfbf('0x2')](_0x370eab,_0x28cf6c);if(_0x52d17e){return Promise['resolve'](_0x4a4ccf);}var _0xa8b68a=sqlUtils[_0xbfbf('0x3')]();var _0x6335b1={};var _0x5b8694=![];var _0xbd8ea5=![];return Promise[_0xbfbf('0x4')]()[_0xbfbf('0x5')](function(){if(_0x28cf6c['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x28cf6c[_0xbfbf('0x6')],_0x366b5e);}else{return sqlUtils[_0xbfbf('0x7')](_0x28cf6c,_0x366b5e);}})['then'](function(_0x3bf39f){_0xa8b68a['where'](_0x3bf39f['default']);_0xa8b68a[_0xbfbf('0x8')](_0x3bf39f[_0xbfbf('0x9')]);_0xa8b68a[_0xbfbf('0x8')](_0x3bf39f[_0xbfbf('0xa')]);_0xa8b68a[_0xbfbf('0x8')](_0x3bf39f[_0xbfbf('0xb')][_0xbfbf('0xc')]);_0x6335b1=_0x3bf39f[_0xbfbf('0xd')];_0xbd8ea5=_0x3bf39f['user']['skip'];return sqlUtils[_0xbfbf('0xe')](_0x370eab,_0x28cf6c,_0xbd8ea5);})[_0xbfbf('0x5')](function(_0x304ec8){_0xa8b68a['where'](_0x304ec8);var _0x5d50e2=_0x28cf6c[_0xbfbf('0x6')]?_0x6335b1['ids']:_0x28cf6c[_0xbfbf('0xf')];_0x5b8694=_0x5d50e2?!![]:![];return sqlUtils[_0xbfbf('0x10')](_0xa8b68a,_0x5d50e2);})['then'](function(_0x248c8d){_0x4a4ccf[_0xbfbf('0x11')]=_0x248c8d;if(_0x4a4ccf['count']===0x0){return;}if(_0x28cf6c[_0xbfbf('0x12')]){_0xbd8ea5=!![];}return sqlUtils[_0xbfbf('0x13')](_0xa8b68a,_0x28cf6c[_0xbfbf('0x9')],_0xbc04de,_0x5b8694,_0x6335b1[_0xbfbf('0xc')],_0xbd8ea5);})[_0xbfbf('0x5')](function(_0x4c3c41){if(!_0x4c3c41){return[];}return sqlUtils[_0xbfbf('0x14')](_0x4c3c41,_0x28cf6c,_0xbc04de);})[_0xbfbf('0x5')](function(_0x3e6f98){_0x4a4ccf['rows']=_0x3e6f98;return _0x4a4ccf;})['catch'](function(_0x3d3271){throw _0x3d3271;});};exports[_0xbfbf('0x15')]=function(){var _0x50ffa9={};var _0xff1b5a=[];return db['CmContact']['describe']()['then'](function(_0x3d54ff){_0x50ffa9=_0x3d54ff;var _0x58677c=Object['keys'](_0x50ffa9)[_0xbfbf('0xa')](function(_0x640969){return _[_0xbfbf('0x16')](_0x640969,_0xbfbf('0x17'))?_0x640969:undefined;});var _0x50ddd5=_0x58677c[_0xbfbf('0x18')](function(_0x43e6ec){return db['CmCustomField'][_0xbfbf('0x19')]({'where':{'id':_0x43e6ec[_0xbfbf('0x1a')](0x3)},'raw':!![]});});return Promise[_0xbfbf('0x1b')](_0x50ddd5);})[_0xbfbf('0x5')](function(_0x12b51e){for(var _0x55ff9d=0x0;_0x55ff9d<_0x12b51e[_0xbfbf('0x1c')];_0x55ff9d++){if(_0x12b51e[_0x55ff9d]){var _0x3963e8=_0xbfbf('0x17')+_0x12b51e[_0x55ff9d]['id'];_0x50ffa9[_0x3963e8][_0xbfbf('0x1d')]=_0x12b51e[_0x55ff9d][_0xbfbf('0x1e')];}}_0xff1b5a=_[_0xbfbf('0x18')](Object['keys'](_0x50ffa9),function(_0x5b07b2){return{'name':_0x5b07b2,'type':_0x50ffa9[_0x5b07b2][_0xbfbf('0x1e')]};});return _0xff1b5a;})[_0xbfbf('0x1f')](function(_0x394969){throw _0x394969;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 8439137..6c7ce32 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 _0x6ae8=['role','c.ListId\x20IS\x20NULL','attributes','limit','offset','group','subqry.id','having','order','subqry.','findAll','color','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','clone','c.id','isEmpty','t.id\x20IN\x20?','COUNT(*)','lodash','../parsers/advancedSearch','../parsers/qs','../../mysqldb','agent','search','ListId','autocomplete','select','from','where','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','lastName','phone','fax','createdAt','updatedAt','deletedAt','push','forEach','TagIds','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','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.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','dateOfBirth','datetime','buildExpression','type','text','value','start','end','split','tags','clause','and','user','uc.UserId\x20=\x20?','keys','map','some','name','compact','Contact','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter'];(function(_0x2a396a,_0x5de621){var _0x3b4966=function(_0x55ad0e){while(--_0x55ad0e){_0x2a396a['push'](_0x2a396a['shift']());}};_0x3b4966(++_0x5de621);}(_0x6ae8,0x13e));var _0x86ae=function(_0x12dc45,_0x388e68){_0x12dc45=_0x12dc45-0x0;var _0x3691e4=_0x6ae8[_0x12dc45];return _0x3691e4;};'use strict';var _=require(_0x86ae('0x0'));var squel=require('squel');var as=require(_0x86ae('0x1'));var qs=require(_0x86ae('0x2'));var utils=require('../interaction/utils');var db=require(_0x86ae('0x3'))['db'];function skipContactsQuery(_0x1f2943,_0x3652ae){var _0x11a353=![];if(_0x1f2943['role']===_0x86ae('0x4')&&!_0x3652ae[_0x86ae('0x5')]&&!_0x3652ae[_0x86ae('0x6')]&&_0x3652ae[_0x86ae('0x7')]!=='true'){_0x11a353=!![];}return _0x11a353;}function getContactsSubquery(){return squel[_0x86ae('0x8')]()[_0x86ae('0x9')]('cm_contacts','c')[_0x86ae('0xa')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x2542ef,_0x4377f8){var _0x538fdb=_0x4377f8?'c':'subqry';_0x2542ef[_0x86ae('0xb')](_0x86ae('0xc'),'uc',_0x86ae('0xd')+_0x538fdb+_0x86ae('0xe'))[_0x86ae('0xb')]('cm_contact_has_tags','ct',_0x86ae('0xf')+_0x538fdb+_0x86ae('0xe'))[_0x86ae('0xb')](_0x86ae('0x10'),'t',_0x86ae('0x11'));return _0x2542ef;}function addFieldsToQuery(_0x48ffb8,_0x47587b,_0x20527a,_0x270137,_0x58e0c8){var _0x5a6026=_0x58e0c8?'c':_0x86ae('0x12');if(!_0x47587b){_0x47587b=['id','firstName',_0x86ae('0x13'),_0x86ae('0x14'),'mobile',_0x86ae('0x15'),'email','ListId','CompanyId',_0x86ae('0x16'),_0x86ae('0x17'),_0x86ae('0x18'),'TagIds'];}else if(!_0x47587b['includes']('id')){_0x47587b[_0x86ae('0x19')]('id');}var _0x22090c=_0x20527a&&_0x58e0c8||!_0x20527a&&!_0x58e0c8;if(_0x270137){_0x22090c=_0x270137&&_0x58e0c8||!_0x270137&&!_0x58e0c8;}_0x47587b[_0x86ae('0x1a')](function(_0x3e98cb){if(_0x3e98cb===_0x86ae('0x1b')){if(_0x22090c){_0x48ffb8[_0x86ae('0x1c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3e98cb);}else if(_0x20527a||_0x270137){_0x48ffb8[_0x86ae('0x1c')](_0x5a6026+'.'+_0x3e98cb);}}else{_0x48ffb8[_0x86ae('0x1c')](_0x5a6026+'.'+_0x3e98cb);}});return _0x48ffb8;}function getSqlClauses(){var _0x22a1a6={'default':squel[_0x86ae('0x1d')](),'fields':squel[_0x86ae('0x1d')](),'filter':squel[_0x86ae('0x1d')](),'tags':{'clause':squel[_0x86ae('0x1d')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x22a1a6;}function parseTagParameter(_0x443d5c){var _0x32ed95=squel[_0x86ae('0x1d')]();if(_0x443d5c){var _0x44752d=utils[_0x86ae('0x1e')](_0x443d5c);_0x44752d['forEach'](function(_0x19910a){_0x32ed95['or'](_0x86ae('0x1f'),'%,'+_0x19910a+',%');});}return _0x32ed95;}function parseSearchFilter(_0x1b1620){var _0x50544b=squel[_0x86ae('0x1d')]();if(_0x1b1620){var _0x5b9425=_0x1b1620['replace']('\x5c','\x5c\x5c')[_0x86ae('0x20')](/'/g,'\x27\x27');if(_0x5b9425['split']('\x20')['length']>0x1){_0x50544b['or'](_0x86ae('0x21'),qs['getFullTextValue'](_0x5b9425,!![]),null);}else{if(qs[_0x86ae('0x22')](_0x5b9425)){_0x50544b['or'](_0x86ae('0x23'),_0x5b9425+'%');_0x50544b['or']('c.phone\x20LIKE\x20?',_0x5b9425+'%');_0x50544b['or'](_0x86ae('0x24'),_0x5b9425+'%');_0x50544b['or']('c.fax\x20LIKE\x20?',_0x5b9425+'%');}else if(qs['isEmail'](_0x5b9425)){_0x50544b['or']('c.email\x20LIKE\x20?',_0x5b9425+'%');}else{_0x50544b['or'](_0x86ae('0x25'),'%'+_0x5b9425+'%');_0x50544b['or'](_0x86ae('0x26'),'%'+_0x5b9425+'%');_0x50544b['or'](_0x86ae('0x27'),'%'+_0x5b9425+'%');}}}return _0x50544b;}function parseAdvancedSearchFilter(_0x5a71c1,_0x317a23){var _0x50f495=getSqlClauses();var _0x2bcd29=as[_0x86ae('0x28')](_0x5a71c1);var _0x501a13=_0x2bcd29[_0x86ae('0x29')];for(var _0x2a175a=0x0;_0x2a175a<_0x2bcd29[_0x86ae('0x2a')][_0x86ae('0x2b')];_0x2a175a++){var _0x1dc65c=_0x2bcd29['conditions'][_0x2a175a];var _0x1ac44d='c';var _0x5ecce9=_['find'](_0x317a23,['name',_0x1dc65c[_0x86ae('0x1c')]]);if(_0x5ecce9){if(_0x1dc65c[_0x86ae('0x1c')]===_0x86ae('0x2c')||_0x5ecce9['fieldType']===_0x86ae('0x2d')){_0x1dc65c['castTo']='DATE';}var _0x3ad7c9=as[_0x86ae('0x2e')](_0x1ac44d,_0x5ecce9[_0x86ae('0x2f')],_0x1dc65c);_0x50f495['default'][_0x501a13](_0x3ad7c9[_0x86ae('0x30')],_0x3ad7c9[_0x86ae('0x31')][_0x86ae('0x32')],_0x3ad7c9[_0x86ae('0x31')][_0x86ae('0x33')]);}else{if(_0x1dc65c[_0x86ae('0x1c')]==='Tag'){var _0xe952c=_0x1dc65c['value'][_0x86ae('0x34')](',')['map'](function(_0x32be64){return Number(_0x32be64);});var _0x5769f2=parseTagParameter(_0xe952c);_0x50f495[_0x86ae('0x35')][_0x86ae('0x36')][_0x86ae('0x37')](_0x5769f2);_0x50f495['tags']['ids']=_0xe952c;}else if(_0x1dc65c[_0x86ae('0x1c')]==='User'){_0x50f495[_0x86ae('0x38')][_0x86ae('0x36')][_0x86ae('0x37')](_0x86ae('0x39'),_0x1dc65c[_0x86ae('0x31')]);_0x50f495[_0x86ae('0x38')]['skip']=!![];}}}return _0x50f495;}function parseModelFields(_0x178f40,_0x1ffd3a){var _0x27ada8=squel[_0x86ae('0x1d')]();var _0x567485=_(_0x178f40)[_0x86ae('0x3a')]()[_0x86ae('0x3b')](function(_0x2a9089){return _[_0x86ae('0x3c')](_0x1ffd3a,[_0x86ae('0x3d'),_0x2a9089])?_0x2a9089:undefined;})[_0x86ae('0x3e')]()[_0x86ae('0x31')]();if(_0x178f40[_0x86ae('0x3f')]){_0x567485[_0x86ae('0x19')](_0x86ae('0x3f'));}if(_0x178f40[_0x86ae('0x40')]){_0x567485[_0x86ae('0x19')]('User');}if(_0x567485['length']>0x0){_0x567485['forEach'](function(_0x170878){if(_0x170878===_0x86ae('0x6')){_0x27ada8[_0x86ae('0x37')](_0x86ae('0x41'),[][_0x86ae('0x42')](_0x178f40[_0x170878]));}else if(_0x170878===_0x86ae('0x3f')){var _0x189ff3='%'+_0x178f40[_0x170878]+'%';_0x27ada8['and'](_0x86ae('0x43'),_0x189ff3);}else if(_0x170878===_0x86ae('0x40')){_0x27ada8[_0x86ae('0x37')](_0x86ae('0x39'),_0x178f40[_0x170878]);}else{_0x27ada8[_0x86ae('0x37')]('c.'+_0x170878+_0x86ae('0x44'),_0x178f40[_0x170878]);}});}return _0x27ada8;}function parseQueryParameters(_0x331c54,_0x263ff6){var _0x53af63=getSqlClauses();return Promise[_0x86ae('0x45')]()[_0x86ae('0x46')](function(){return parseModelFields(_0x331c54,_0x263ff6);})['then'](function(_0x3bf327){_0x53af63[_0x86ae('0x47')][_0x86ae('0x37')](_0x3bf327);return parseTagParameter(_0x331c54[_0x86ae('0x48')]);})[_0x86ae('0x46')](function(_0x439bf2){_0x53af63[_0x86ae('0x35')]['clause']['and'](_0x439bf2);return parseSearchFilter(_0x331c54[_0x86ae('0x49')]);})[_0x86ae('0x46')](function(_0x2ddaf2){_0x53af63[_0x86ae('0x49')]=_0x2ddaf2;return _0x53af63;});}function checkListsRestrictions(_0x3852e2,_0x3fda6c,_0x39dc35){var _0x4c00bb=squel['expr']();return Promise[_0x86ae('0x45')]()['then'](function(){if(_0x3fda6c[_0x86ae('0x5')]&&_0x3852e2[_0x86ae('0x4a')]===_0x86ae('0x4')&&!_0x39dc35){return _0x3852e2['getLists']({'attributes':['id'],'raw':!![]});}})[_0x86ae('0x46')](function(_0x90767c){if(_0x90767c){if(_0x90767c[_0x86ae('0x2b')]===0x0){_0x4c00bb[_0x86ae('0x37')](_0x86ae('0x4b'));}else{_0x4c00bb[_0x86ae('0x37')](_0x86ae('0x41'),_[_0x86ae('0x3b')](_0x90767c,'id'));}}})['then'](function(){return _0x4c00bb;});}function buildContactsQuery(_0x33f4eb,_0x2658eb,_0x48fa03,_0x205be4,_0x1cf3c2,_0x11cb08){if(_0x2658eb){_0x2658eb=_0x48fa03[_0x86ae('0x4c')];}_0x33f4eb=addFieldsToQuery(_0x33f4eb,_0x2658eb,_0x205be4,_0x11cb08,!![]);var _0x178f4b=squel[_0x86ae('0x8')]();_0x178f4b=addFieldsToQuery(_0x178f4b,_0x2658eb,_0x205be4,_0x11cb08,![]);if(_0x205be4||_0x11cb08){_0x33f4eb=applyJoinClauses(_0x33f4eb,!![]);_0x33f4eb['group']('c.id');if(_0x48fa03['limit']){_0x178f4b[_0x86ae('0x4d')](_0x48fa03[_0x86ae('0x4d')]);}if(_0x48fa03[_0x86ae('0x4e')]){_0x178f4b[_0x86ae('0x4e')](_0x48fa03[_0x86ae('0x4e')]);}}else{_0x178f4b=applyJoinClauses(_0x178f4b,![]);_0x178f4b[_0x86ae('0x4f')](_0x86ae('0x50'));if(_0x48fa03[_0x86ae('0x4d')]){_0x33f4eb[_0x86ae('0x4d')](_0x48fa03[_0x86ae('0x4d')]);}if(_0x48fa03[_0x86ae('0x4e')]){_0x33f4eb[_0x86ae('0x4e')](_0x48fa03[_0x86ae('0x4e')]);}}_0x178f4b[_0x86ae('0x51')](_0x1cf3c2);if(_0x48fa03[_0x86ae('0x52')]){_0x48fa03[_0x86ae('0x52')][_0x86ae('0x1a')](function(_0xc81670){_0x33f4eb[_0x86ae('0x52')]('c.'+_0xc81670[0x0],_0xc81670[0x1]==='DESC'?![]:!![]);_0x178f4b[_0x86ae('0x52')](_0x86ae('0x53')+_0xc81670[0x0],_0xc81670[0x1]==='DESC'?![]:!![]);});}_0x178f4b['from'](_0x33f4eb,_0x86ae('0x12'));return _0x178f4b;}function getFilteredContacts(_0x574d79){var _0x3819bb=[];return db['Tag'][_0x86ae('0x54')]({'attributes':['id',_0x86ae('0x3d'),_0x86ae('0x55')],'raw':!![]})[_0x86ae('0x46')](function(_0x252a2c){_0x3819bb=_['keyBy'](_0x252a2c,'id');var _0x284464={'type':db[_0x86ae('0x56')]['QueryTypes'][_0x86ae('0x57')],'model':db[_0x86ae('0x58')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x86ae('0x59')][_0x86ae('0x5a')](_0x574d79[_0x86ae('0x5b')](),_0x284464);})[_0x86ae('0x46')](function(_0x49fb5c){_0x49fb5c[_0x86ae('0x1a')](function(_0x482ce3){if(_0x482ce3[_0x86ae('0x1b')]){_0x482ce3[_0x86ae('0x5c')]=[];_0x482ce3['TagIds']['split'](',')['forEach'](function(_0x1ff589){_0x482ce3[_0x86ae('0x5c')][_0x86ae('0x19')](_0x3819bb[_0x1ff589]);});}delete _0x482ce3[_0x86ae('0x1b')];});return _0x49fb5c;});}function countFilteredContacts(_0x4e9b63,_0x54da00){var _0x2c6f64=_0x4e9b63[_0x86ae('0x5d')]();_0x2c6f64[_0x86ae('0x1c')]('COUNT(*)');_0x2c6f64=applyJoinClauses(_0x2c6f64,!![]);_0x4e9b63[_0x86ae('0x4f')](_0x86ae('0x5e'));var _0x46d1ce=utils[_0x86ae('0x1e')](_0x54da00);if(!_[_0x86ae('0x5f')](_0x46d1ce)){_0x2c6f64[_0x86ae('0xa')](_0x86ae('0x60'),_0x46d1ce);}var _0xdab7cb={'type':db[_0x86ae('0x56')]['QueryTypes'][_0x86ae('0x57')],'raw':!![]};return db[_0x86ae('0x59')][_0x86ae('0x5a')](_0x2c6f64[_0x86ae('0x5b')](),_0xdab7cb)[_0x86ae('0x46')](function(_0x106f21){return _0x106f21[0x0][_0x86ae('0x61')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xdbaf=['limit','offset','subqry.id','order','DESC','subqry.','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','TagIds','clone','COUNT(*)','c.id','isEmpty','t.id\x20IN\x20?','query','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','autocomplete','true','from','cm_contacts','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','email','ListId','createdAt','deletedAt','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','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)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','castTo','buildExpression','type','default','value','end','Tag','split','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','Contact','concat','\x20=\x20?','resolve','then','fields','tag','getLists','c.ListId\x20IS\x20NULL','attributes','group'];(function(_0x530e45,_0x1b7670){var _0x266ade=function(_0x485236){while(--_0x485236){_0x530e45['push'](_0x530e45['shift']());}};_0x266ade(++_0x1b7670);}(_0xdbaf,0x1c2));var _0xfdba=function(_0x40d0cb,_0x21d091){_0x40d0cb=_0x40d0cb-0x0;var _0x54a504=_0xdbaf[_0x40d0cb];return _0x54a504;};'use strict';var _=require(_0xfdba('0x0'));var squel=require(_0xfdba('0x1'));var as=require(_0xfdba('0x2'));var qs=require(_0xfdba('0x3'));var utils=require(_0xfdba('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x14bced,_0x9859e6){var _0x364d78=![];if(_0x14bced[_0xfdba('0x5')]===_0xfdba('0x6')&&!_0x9859e6[_0xfdba('0x7')]&&!_0x9859e6['ListId']&&_0x9859e6[_0xfdba('0x8')]!==_0xfdba('0x9')){_0x364d78=!![];}return _0x364d78;}function getContactsSubquery(){return squel['select']()[_0xfdba('0xa')](_0xfdba('0xb'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x461cd4,_0x174def){var _0x2c1d53=_0x174def?'c':'subqry';_0x461cd4[_0xfdba('0xc')](_0xfdba('0xd'),'uc','uc.CmContactId\x20=\x20'+_0x2c1d53+_0xfdba('0xe'))[_0xfdba('0xc')](_0xfdba('0xf'),'ct','ct.CmContactId\x20=\x20'+_0x2c1d53+_0xfdba('0xe'))[_0xfdba('0xc')](_0xfdba('0x10'),'t',_0xfdba('0x11'));return _0x461cd4;}function addFieldsToQuery(_0x17a5a7,_0x1256ce,_0x320d04,_0x4a65d7,_0x5b6aff){var _0x1c078b=_0x5b6aff?'c':_0xfdba('0x12');if(!_0x1256ce){_0x1256ce=['id',_0xfdba('0x13'),_0xfdba('0x14'),_0xfdba('0x15'),_0xfdba('0x16'),_0xfdba('0x17'),_0xfdba('0x18'),_0xfdba('0x19'),'CompanyId',_0xfdba('0x1a'),'updatedAt',_0xfdba('0x1b'),'TagIds'];}else if(!_0x1256ce[_0xfdba('0x1c')]('id')){_0x1256ce[_0xfdba('0x1d')]('id');}var _0x494f34=_0x320d04&&_0x5b6aff||!_0x320d04&&!_0x5b6aff;if(_0x4a65d7){_0x494f34=_0x4a65d7&&_0x5b6aff||!_0x4a65d7&&!_0x5b6aff;}_0x1256ce[_0xfdba('0x1e')](function(_0x56c39a){if(_0x56c39a==='TagIds'){if(_0x494f34){_0x17a5a7['field'](_0xfdba('0x1f'),_0x56c39a);}else if(_0x320d04||_0x4a65d7){_0x17a5a7['field'](_0x1c078b+'.'+_0x56c39a);}}else{_0x17a5a7[_0xfdba('0x20')](_0x1c078b+'.'+_0x56c39a);}});return _0x17a5a7;}function getSqlClauses(){var _0x3a1d0a={'default':squel['expr'](),'fields':squel[_0xfdba('0x21')](),'filter':squel[_0xfdba('0x21')](),'tags':{'clause':squel[_0xfdba('0x21')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x3a1d0a;}function parseTagParameter(_0x1641d){var _0x22c9c4=squel[_0xfdba('0x21')]();if(_0x1641d){var _0x5e5f65=utils[_0xfdba('0x22')](_0x1641d);_0x5e5f65['forEach'](function(_0x4ee53e){_0x22c9c4['or'](_0xfdba('0x23'),'%,'+_0x4ee53e+',%');});}return _0x22c9c4;}function parseSearchFilter(_0x49208b){var _0x2d0832=squel[_0xfdba('0x21')]();if(_0x49208b){var _0x2a4e4e=_0x49208b[_0xfdba('0x24')]('\x5c','\x5c\x5c')[_0xfdba('0x24')](/'/g,'\x27\x27');if(_0x2a4e4e['split']('\x20')[_0xfdba('0x25')]>0x1){_0x2d0832['or'](_0xfdba('0x26'),qs[_0xfdba('0x27')](_0x2a4e4e,!![]),null);}else{if(qs['isNumeric'](_0x2a4e4e)){_0x2d0832['or'](_0xfdba('0x28'),_0x2a4e4e+'%');_0x2d0832['or'](_0xfdba('0x29'),_0x2a4e4e+'%');_0x2d0832['or'](_0xfdba('0x2a'),_0x2a4e4e+'%');_0x2d0832['or'](_0xfdba('0x2b'),_0x2a4e4e+'%');}else if(qs[_0xfdba('0x2c')](_0x2a4e4e)){_0x2d0832['or'](_0xfdba('0x2d'),_0x2a4e4e+'%');}else{_0x2d0832['or'](_0xfdba('0x2e'),'%'+_0x2a4e4e+'%');_0x2d0832['or'](_0xfdba('0x2f'),'%'+_0x2a4e4e+'%');_0x2d0832['or'](_0xfdba('0x2d'),'%'+_0x2a4e4e+'%');}}}return _0x2d0832;}function parseAdvancedSearchFilter(_0x525e13,_0x1dc32c){var _0x2dadec=getSqlClauses();var _0x40c636=as[_0xfdba('0x30')](_0x525e13);var _0x5afa14=_0x40c636[_0xfdba('0x31')];for(var _0x3b9837=0x0;_0x3b9837<_0x40c636[_0xfdba('0x32')]['length'];_0x3b9837++){var _0x1c02a2=_0x40c636[_0xfdba('0x32')][_0x3b9837];var _0xab339c='c';var _0x33a256=_[_0xfdba('0x33')](_0x1dc32c,[_0xfdba('0x34'),_0x1c02a2[_0xfdba('0x20')]]);if(_0x33a256){if(_0x1c02a2[_0xfdba('0x20')]===_0xfdba('0x35')||_0x33a256[_0xfdba('0x36')]==='datetime'){_0x1c02a2[_0xfdba('0x37')]='DATE';}var _0xdd2b2d=as[_0xfdba('0x38')](_0xab339c,_0x33a256[_0xfdba('0x39')],_0x1c02a2);_0x2dadec[_0xfdba('0x3a')][_0x5afa14](_0xdd2b2d['text'],_0xdd2b2d[_0xfdba('0x3b')]['start'],_0xdd2b2d['value'][_0xfdba('0x3c')]);}else{if(_0x1c02a2[_0xfdba('0x20')]===_0xfdba('0x3d')){var _0xe39c87=_0x1c02a2[_0xfdba('0x3b')][_0xfdba('0x3e')](',')[_0xfdba('0x3f')](function(_0x3bf3b8){return Number(_0x3bf3b8);});var _0x2ac270=parseTagParameter(_0xe39c87);_0x2dadec[_0xfdba('0x40')][_0xfdba('0x41')][_0xfdba('0x42')](_0x2ac270);_0x2dadec['tags'][_0xfdba('0x43')]=_0xe39c87;}else if(_0x1c02a2[_0xfdba('0x20')]===_0xfdba('0x44')){_0x2dadec[_0xfdba('0x45')][_0xfdba('0x41')]['and'](_0xfdba('0x46'),_0x1c02a2[_0xfdba('0x3b')]);_0x2dadec[_0xfdba('0x45')][_0xfdba('0x47')]=!![];}}}return _0x2dadec;}function parseModelFields(_0x374a71,_0x6437e2){var _0x4b5502=squel[_0xfdba('0x21')]();var _0x329b2c=_(_0x374a71)[_0xfdba('0x48')]()[_0xfdba('0x3f')](function(_0x28e78b){return _[_0xfdba('0x49')](_0x6437e2,[_0xfdba('0x34'),_0x28e78b])?_0x28e78b:undefined;})['compact']()[_0xfdba('0x3b')]();if(_0x374a71[_0xfdba('0x4a')]){_0x329b2c['push'](_0xfdba('0x4a'));}if(_0x374a71[_0xfdba('0x44')]){_0x329b2c[_0xfdba('0x1d')](_0xfdba('0x44'));}if(_0x329b2c[_0xfdba('0x25')]>0x0){_0x329b2c[_0xfdba('0x1e')](function(_0x155f7e){if(_0x155f7e==='ListId'){_0x4b5502['and']('c.ListId\x20IN\x20?',[][_0xfdba('0x4b')](_0x374a71[_0x155f7e]));}else if(_0x155f7e===_0xfdba('0x4a')){var _0xdfcb92='%'+_0x374a71[_0x155f7e]+'%';_0x4b5502[_0xfdba('0x42')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0xdfcb92);}else if(_0x155f7e===_0xfdba('0x44')){_0x4b5502[_0xfdba('0x42')](_0xfdba('0x46'),_0x374a71[_0x155f7e]);}else{_0x4b5502['and']('c.'+_0x155f7e+_0xfdba('0x4c'),_0x374a71[_0x155f7e]);}});}return _0x4b5502;}function parseQueryParameters(_0x2cb91,_0x5d2313){var _0x4a033b=getSqlClauses();return Promise[_0xfdba('0x4d')]()[_0xfdba('0x4e')](function(){return parseModelFields(_0x2cb91,_0x5d2313);})['then'](function(_0x2c674e){_0x4a033b[_0xfdba('0x4f')][_0xfdba('0x42')](_0x2c674e);return parseTagParameter(_0x2cb91[_0xfdba('0x50')]);})[_0xfdba('0x4e')](function(_0x414c19){_0x4a033b[_0xfdba('0x40')][_0xfdba('0x41')][_0xfdba('0x42')](_0x414c19);return parseSearchFilter(_0x2cb91['filter']);})['then'](function(_0x2d4eba){_0x4a033b['filter']=_0x2d4eba;return _0x4a033b;});}function checkListsRestrictions(_0xc99f6,_0x49409b,_0x3b8b56){var _0x2a1995=squel[_0xfdba('0x21')]();return Promise[_0xfdba('0x4d')]()['then'](function(){if(_0x49409b['search']&&_0xc99f6[_0xfdba('0x5')]===_0xfdba('0x6')&&!_0x3b8b56){return _0xc99f6[_0xfdba('0x51')]({'attributes':['id'],'raw':!![]});}})[_0xfdba('0x4e')](function(_0x211469){if(_0x211469){if(_0x211469[_0xfdba('0x25')]===0x0){_0x2a1995[_0xfdba('0x42')](_0xfdba('0x52'));}else{_0x2a1995[_0xfdba('0x42')]('c.ListId\x20IN\x20?',_[_0xfdba('0x3f')](_0x211469,'id'));}}})['then'](function(){return _0x2a1995;});}function buildContactsQuery(_0x27105b,_0x43fa14,_0x15e06c,_0xe25528,_0x561e0a,_0x242fe7){if(_0x43fa14){_0x43fa14=_0x15e06c[_0xfdba('0x53')];}_0x27105b=addFieldsToQuery(_0x27105b,_0x43fa14,_0xe25528,_0x242fe7,!![]);var _0x5947ca=squel['select']();_0x5947ca=addFieldsToQuery(_0x5947ca,_0x43fa14,_0xe25528,_0x242fe7,![]);if(_0xe25528||_0x242fe7){_0x27105b=applyJoinClauses(_0x27105b,!![]);_0x27105b[_0xfdba('0x54')]('c.id');if(_0x15e06c['limit']){_0x5947ca[_0xfdba('0x55')](_0x15e06c[_0xfdba('0x55')]);}if(_0x15e06c[_0xfdba('0x56')]){_0x5947ca[_0xfdba('0x56')](_0x15e06c[_0xfdba('0x56')]);}}else{_0x5947ca=applyJoinClauses(_0x5947ca,![]);_0x5947ca['group'](_0xfdba('0x57'));if(_0x15e06c['limit']){_0x27105b['limit'](_0x15e06c[_0xfdba('0x55')]);}if(_0x15e06c[_0xfdba('0x56')]){_0x27105b[_0xfdba('0x56')](_0x15e06c[_0xfdba('0x56')]);}}_0x5947ca['having'](_0x561e0a);if(_0x15e06c[_0xfdba('0x58')]){_0x15e06c['order'][_0xfdba('0x1e')](function(_0xdbd1a7){_0x27105b[_0xfdba('0x58')]('c.'+_0xdbd1a7[0x0],_0xdbd1a7[0x1]===_0xfdba('0x59')?![]:!![]);_0x5947ca[_0xfdba('0x58')](_0xfdba('0x5a')+_0xdbd1a7[0x0],_0xdbd1a7[0x1]===_0xfdba('0x59')?![]:!![]);});}_0x5947ca['from'](_0x27105b,'subqry');return _0x5947ca;}function getFilteredContacts(_0x534cd0){var _0x4014f7=[];return db['Tag']['findAll']({'attributes':['id',_0xfdba('0x34'),_0xfdba('0x5b')],'raw':!![]})['then'](function(_0xb3d3b6){_0x4014f7=_[_0xfdba('0x5c')](_0xb3d3b6,'id');var _0x30a0ed={'type':db[_0xfdba('0x5d')][_0xfdba('0x5e')][_0xfdba('0x5f')],'model':db[_0xfdba('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xfdba('0x61')]['query'](_0x534cd0[_0xfdba('0x62')](),_0x30a0ed);})['then'](function(_0x5389d0){_0x5389d0[_0xfdba('0x1e')](function(_0x5b7b20){if(_0x5b7b20['TagIds']){_0x5b7b20[_0xfdba('0x63')]=[];_0x5b7b20[_0xfdba('0x64')][_0xfdba('0x3e')](',')[_0xfdba('0x1e')](function(_0x469a06){_0x5b7b20[_0xfdba('0x63')][_0xfdba('0x1d')](_0x4014f7[_0x469a06]);});}delete _0x5b7b20[_0xfdba('0x64')];});return _0x5389d0;});}function countFilteredContacts(_0x5a628b,_0x555e44){var _0xdd6393=_0x5a628b[_0xfdba('0x65')]();_0xdd6393[_0xfdba('0x20')](_0xfdba('0x66'));_0xdd6393=applyJoinClauses(_0xdd6393,!![]);_0x5a628b[_0xfdba('0x54')](_0xfdba('0x67'));var _0x54d367=utils[_0xfdba('0x22')](_0x555e44);if(!_[_0xfdba('0x68')](_0x54d367)){_0xdd6393['where'](_0xfdba('0x69'),_0x54d367);}var _0x3d8d6c={'type':db[_0xfdba('0x5d')]['QueryTypes'][_0xfdba('0x5f')],'raw':!![]};return db[_0xfdba('0x61')][_0xfdba('0x6a')](_0xdd6393[_0xfdba('0x62')](),_0x3d8d6c)[_0xfdba('0x4e')](function(_0x58bc99){return _0x58bc99[0x0][_0xfdba('0x66')];});}module['exports']={'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 8373b33..59b6143 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 _0x11af=['binary','write','end','close','unlink','decryptFile','createDecipher','update','final','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data'];(function(_0x504eef,_0x155f27){var _0x2116f5=function(_0x816c4f){while(--_0x816c4f){_0x504eef['push'](_0x504eef['shift']());}};_0x2116f5(++_0x155f27);}(_0x11af,0xdb));var _0xf11a=function(_0x36ec2f,_0x91178f){_0x36ec2f=_0x36ec2f-0x0;var _0x4f454b=_0x11af[_0x36ec2f];return _0x4f454b;};'use strict';var crypto=require(_0xf11a('0x0'));var fs=require('fs');var BPromise=require(_0xf11a('0x1'));var _=require(_0xf11a('0x2'));var config=require(_0xf11a('0x3'));var logger=require(_0xf11a('0x4'))(_0xf11a('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xf11a('0x6')][_0xf11a('0x7')],'algorithm':_0xf11a('0x8')};const fileOptions={'algorithm':'aes192'};if(config[_0xf11a('0x9')]&&config[_0xf11a('0x9')][_0xf11a('0xa')]){var isSupported=isAlgorithmSupported(config[_0xf11a('0x9')][_0xf11a('0xa')]);if(isSupported){fileOptions[_0xf11a('0xa')]=config[_0xf11a('0x9')][_0xf11a('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf11a('0xb')](',\x20');logger['error'](config['encrypt'][_0xf11a('0xa')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x55c6ff){return AES_SUPPORTED_RX['test'](_0x55c6ff);}function getSupportedCiphers(){return crypto[_0xf11a('0xc')]()[_0xf11a('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x548776){return getSupportedCiphers()['indexOf'](_0x548776)>-0x1;}function combineOptions(_0x29ac62){var _0x18d2fd={};for(var _0x218dd1 in fileOptions){if(fileOptions[_0xf11a('0xe')](_0x218dd1)){_0x18d2fd[_0x218dd1]=fileOptions[_0x218dd1];}}if(_0x29ac62){for(var _0x2b7cbb in _0x29ac62){if(_0x29ac62['hasOwnProperty'](_0x2b7cbb)){_0x18d2fd[_0x2b7cbb]=_0x29ac62[_0x2b7cbb];}}}return _0x18d2fd;}exports[_0xf11a('0xf')]=function(_0x19385f,_0x30b963,_0x236a2d,_0x2691a2){return new BPromise(function(_0x4ab424,_0x1b2cfb){_0x2691a2=combineOptions(_0x2691a2);var _0x22326f=new Buffer(_0x236a2d);var _0x1f2b84=fs[_0xf11a('0x10')](_0x19385f);var _0x359ae8=fs[_0xf11a('0x11')](_0x30b963);var _0x454c49=crypto['createCipher'](_0x2691a2[_0xf11a('0xa')],_0x22326f);_0x1f2b84['on'](_0xf11a('0x12'),function(_0x579a3a){var _0x441376=new Buffer(_0x454c49['update'](_0x579a3a),_0xf11a('0x13'));_0x359ae8[_0xf11a('0x14')](_0x441376);});_0x1f2b84['on']('end',function(){try{var _0x2a0dcb=new Buffer(_0x454c49['final']('binary'),_0xf11a('0x13'));_0x359ae8[_0xf11a('0x14')](_0x2a0dcb);_0x359ae8[_0xf11a('0x15')]();_0x359ae8['on'](_0xf11a('0x16'),function(){return _0x4ab424(_0x30b963);});}catch(_0xfc9941){fs[_0xf11a('0x17')](_0x30b963);return _0x1b2cfb(_0xfc9941);}});});};exports[_0xf11a('0x18')]=function(_0x54ae37,_0xaa7fc9,_0x50234a,_0x359523){return new BPromise(function(_0x5e4847,_0x2e4df6){_0x359523=combineOptions(_0x359523);var _0x44b65d=new Buffer(_0x50234a);var _0x4901da=fs[_0xf11a('0x10')](_0x54ae37);var _0x124d6d=fs['createWriteStream'](_0xaa7fc9);var _0x3fe088=crypto[_0xf11a('0x19')](_0x359523[_0xf11a('0xa')],_0x44b65d);_0x4901da['on'](_0xf11a('0x12'),function(_0x12a1f6){var _0x3e1b2f=new Buffer(_0x3fe088[_0xf11a('0x1a')](_0x12a1f6),_0xf11a('0x13'));_0x124d6d['write'](_0x3e1b2f);});_0x4901da['on']('end',function(){try{var _0x16f6ea=new Buffer(_0x3fe088[_0xf11a('0x1b')]('binary'),_0xf11a('0x13'));_0x124d6d[_0xf11a('0x14')](_0x16f6ea);_0x124d6d[_0xf11a('0x15')]();_0x124d6d['on'](_0xf11a('0x16'),function(){return _0x5e4847(_0xaa7fc9);});}catch(_0xf2cdad){fs[_0xf11a('0x17')](_0xaa7fc9);return _0x2e4df6(_0xf2cdad);}});});};exports[_0xf11a('0x1c')]=function(_0x32bf2d,_0x1c9db7,_0xa6875f){var _0x21c4e5=_0xa6875f||stringOptions['algorithm'];var _0x5dc34c=_0x1c9db7||stringOptions[_0xf11a('0x1d')];var _0x4dcdbd=crypto[_0xf11a('0x1e')](_0x21c4e5,_0x5dc34c);var _0x3be348=_0x4dcdbd[_0xf11a('0x1a')](_0x32bf2d,_0xf11a('0x1f'),_0xf11a('0x20'));_0x3be348+=_0x4dcdbd['final'](_0xf11a('0x20'));return _0x3be348;};exports[_0xf11a('0x21')]=function(_0x2969d1,_0x59577e,_0x1c7586){var _0x4b7230=_0x1c7586||stringOptions[_0xf11a('0xa')];var _0x24a8c8=_0x59577e||stringOptions['secret'];var _0x45e02e=crypto['createDecipher'](_0x4b7230,_0x24a8c8);var _0x2b04bb=_0x45e02e['update'](_0x2969d1,_0xf11a('0x20'),'utf8');_0x2b04bb+=_0x45e02e[_0xf11a('0x1b')](_0xf11a('0x1f'));return _0x2b04bb;}; \ No newline at end of file +var _0xb18d=['getCiphers','filter','indexOf','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','final','end','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0x156627,_0x27ec9a){var _0x174ce9=function(_0x12b9c2){while(--_0x12b9c2){_0x156627['push'](_0x156627['shift']());}};_0x174ce9(++_0x27ec9a);}(_0xb18d,0x1b9));var _0xdb18=function(_0x2a60ae,_0x2f523f){_0x2a60ae=_0x2a60ae-0x0;var _0x3b5161=_0xb18d[_0x2a60ae];return _0x3b5161;};'use strict';var crypto=require(_0xdb18('0x0'));var fs=require('fs');var BPromise=require(_0xdb18('0x1'));var _=require(_0xdb18('0x2'));var config=require('../../config/environment');var logger=require(_0xdb18('0x3'))(_0xdb18('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xdb18('0x5')][_0xdb18('0x6')],'algorithm':_0xdb18('0x7')};const fileOptions={'algorithm':_0xdb18('0x8')};if(config['encrypt']&&config[_0xdb18('0x9')][_0xdb18('0xa')]){var isSupported=isAlgorithmSupported(config[_0xdb18('0x9')]['algorithm']);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0xdb18('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xdb18('0xb')](',\x20');logger[_0xdb18('0xc')](config['encrypt'][_0xdb18('0xa')],_0xdb18('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x18c8ee){return AES_SUPPORTED_RX['test'](_0x18c8ee);}function getSupportedCiphers(){return crypto[_0xdb18('0xe')]()[_0xdb18('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xdade7b){return getSupportedCiphers()[_0xdb18('0x10')](_0xdade7b)>-0x1;}function combineOptions(_0x1530ab){var _0x38e4bc={};for(var _0x404e3b in fileOptions){if(fileOptions['hasOwnProperty'](_0x404e3b)){_0x38e4bc[_0x404e3b]=fileOptions[_0x404e3b];}}if(_0x1530ab){for(var _0x4c5aaf in _0x1530ab){if(_0x1530ab['hasOwnProperty'](_0x4c5aaf)){_0x38e4bc[_0x4c5aaf]=_0x1530ab[_0x4c5aaf];}}}return _0x38e4bc;}exports[_0xdb18('0x11')]=function(_0x5df086,_0x43fa78,_0x25092e,_0x20744f){return new BPromise(function(_0x4f11e8,_0x25948c){_0x20744f=combineOptions(_0x20744f);var _0x3fb4d7=new Buffer(_0x25092e);var _0x45d397=fs[_0xdb18('0x12')](_0x5df086);var _0x39ca38=fs[_0xdb18('0x13')](_0x43fa78);var _0x55c954=crypto[_0xdb18('0x14')](_0x20744f[_0xdb18('0xa')],_0x3fb4d7);_0x45d397['on'](_0xdb18('0x15'),function(_0x157d29){var _0x1108e6=new Buffer(_0x55c954[_0xdb18('0x16')](_0x157d29),_0xdb18('0x17'));_0x39ca38[_0xdb18('0x18')](_0x1108e6);});_0x45d397['on']('end',function(){try{var _0x56b25e=new Buffer(_0x55c954[_0xdb18('0x19')]('binary'),_0xdb18('0x17'));_0x39ca38[_0xdb18('0x18')](_0x56b25e);_0x39ca38[_0xdb18('0x1a')]();_0x39ca38['on'](_0xdb18('0x1b'),function(){return _0x4f11e8(_0x43fa78);});}catch(_0x47fb11){fs[_0xdb18('0x1c')](_0x43fa78);return _0x25948c(_0x47fb11);}});});};exports[_0xdb18('0x1d')]=function(_0x2830ed,_0x4a5d90,_0x522149,_0x15e604){return new BPromise(function(_0x1825a4,_0x4f6cf4){_0x15e604=combineOptions(_0x15e604);var _0x40c329=new Buffer(_0x522149);var _0x5d6615=fs['createReadStream'](_0x2830ed);var _0x43d473=fs[_0xdb18('0x13')](_0x4a5d90);var _0x4fdc41=crypto[_0xdb18('0x1e')](_0x15e604[_0xdb18('0xa')],_0x40c329);_0x5d6615['on']('data',function(_0x51b562){var _0x35c94a=new Buffer(_0x4fdc41[_0xdb18('0x16')](_0x51b562),_0xdb18('0x17'));_0x43d473[_0xdb18('0x18')](_0x35c94a);});_0x5d6615['on']('end',function(){try{var _0x19265d=new Buffer(_0x4fdc41[_0xdb18('0x19')](_0xdb18('0x17')),_0xdb18('0x17'));_0x43d473[_0xdb18('0x18')](_0x19265d);_0x43d473[_0xdb18('0x1a')]();_0x43d473['on'](_0xdb18('0x1b'),function(){return _0x1825a4(_0x4a5d90);});}catch(_0x2009b6){fs['unlink'](_0x4a5d90);return _0x4f6cf4(_0x2009b6);}});});};exports[_0xdb18('0x1f')]=function(_0x158dbb,_0x12378f,_0x3b8b85){var _0x46eaa6=_0x3b8b85||stringOptions[_0xdb18('0xa')];var _0x185866=_0x12378f||stringOptions[_0xdb18('0x20')];var _0x2eef00=crypto[_0xdb18('0x14')](_0x46eaa6,_0x185866);var _0x134f15=_0x2eef00[_0xdb18('0x16')](_0x158dbb,_0xdb18('0x21'),_0xdb18('0x22'));_0x134f15+=_0x2eef00[_0xdb18('0x19')]('base64');return _0x134f15;};exports['decryptString']=function(_0x45c438,_0x43f8ee,_0x26d675){var _0x1711e7=_0x26d675||stringOptions[_0xdb18('0xa')];var _0x4f6a39=_0x43f8ee||stringOptions['secret'];var _0x4a2264=crypto[_0xdb18('0x1e')](_0x1711e7,_0x4f6a39);var _0x45b5f3=_0x4a2264[_0xdb18('0x16')](_0x45c438,_0xdb18('0x22'),_0xdb18('0x21'));_0x45b5f3+=_0x4a2264[_0xdb18('0x19')](_0xdb18('0x21'));return _0x45b5f3;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 1c955a5..0fa982a 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 _0x402d=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','info'];(function(_0x233d44,_0x487429){var _0x5145ad=function(_0x3fea23){while(--_0x3fea23){_0x233d44['push'](_0x233d44['shift']());}};_0x5145ad(++_0x487429);}(_0x402d,0x19e));var _0xd402=function(_0x4a700b,_0xa8afa0){_0x4a700b=_0x4a700b-0x0;var _0x25cc98=_0x402d[_0x4a700b];return _0x25cc98;};'use strict';var util=require(_0xd402('0x0'));var path=require('path');var _=require(_0xd402('0x1'));var csv=require(_0xd402('0x2'));var fs=require('fs');var BPromise=require(_0xd402('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xd402('0x4'));var db=require(_0xd402('0x5'))['db'];var dbH=require(_0xd402('0x5'))[_0xd402('0x6')];var logger=require(_0xd402('0x7'))(_0xd402('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xd402('0x9')][0x2]);var QUERY=process[_0xd402('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5c35a6,_0xc5bb17){var _0x1196ea={'status':_0x5c35a6};var _0x3b1b7c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc5bb17){_0x1196ea[_0xd402('0xa')]=_0xc5bb17;}return db[_0xd402('0xb')]['update'](_0x1196ea,_0x3b1b7c);}function main(){var _0x2eabe5=0x1388;var _0x2f46a9;logger['info'](util[_0xd402('0xc')](_0xd402('0xd'),EXTRACTED_REPORT_ID,_0xd402('0xe')));return db[_0xd402('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd402('0x10'),_0xd402('0x11')]})[_0xd402('0x12')](function(_0x5abeb9){if(_0x5abeb9){_0x2f46a9=_0x5abeb9;_0x2eabe5=_0x2f46a9['splitSizeCsv']||0x1388;}})[_0xd402('0x12')](function(){return dbH[_0xd402('0x13')][_0xd402('0x14')](util[_0xd402('0xc')](_0xd402('0x15'),QUERY),{'type':dbH['sequelize'][_0xd402('0x16')][_0xd402('0x17')]});})[_0xd402('0x12')](function(_0x2dd705){if(!_0x2dd705[0x0]['num']){return analyticExtractedReport(_0xd402('0x18'));}var _0x55f6bc=[];var _0x3efdb4=0x0;if(_0x2f46a9[_0xd402('0x10')]){if(_0x2dd705&&_0x2dd705[_0xd402('0x19')]){var _0x559ad0=_[_0xd402('0x1a')](_0x2dd705[0x0][_0xd402('0x1b')]/_0x2eabe5);var _0x41e915=Number[_0xd402('0x1c')](_0x2dd705[0x0][_0xd402('0x1b')]/_0x2eabe5)?_0x2dd705[0x0][_0xd402('0x1b')]%_0x2eabe5:0x0;_0x559ad0[_0xd402('0x1d')](function(_0x1cba41){if(_0x1cba41>0x0){_0x3efdb4+=_0x2eabe5;}_0x55f6bc[_0xd402('0x1e')](dbH['sequelize'][_0xd402('0x14')](util[_0xd402('0xc')](_0xd402('0x1f'),QUERY,_0x2eabe5,_0x3efdb4),{'type':dbH[_0xd402('0x13')][_0xd402('0x16')]['SELECT']}));});if(_0x41e915>0x0){_0x3efdb4+=_0x2eabe5;_0x55f6bc[_0xd402('0x1e')](dbH[_0xd402('0x13')][_0xd402('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x41e915,_0x3efdb4),{'type':dbH[_0xd402('0x13')]['QueryTypes'][_0xd402('0x17')]}));}}}else{_0x55f6bc[_0xd402('0x1e')](dbH['sequelize'][_0xd402('0x14')](QUERY,{'type':dbH[_0xd402('0x13')][_0xd402('0x16')][_0xd402('0x17')]}));}var _0x3c788f=path[_0xd402('0x20')](PATH);var _0x1f237b=path[_0xd402('0x21')](PATH,_0xd402('0x22'));var _0x520dd3=_0x2f46a9[_0xd402('0x10')]&&_0x55f6bc[_0xd402('0x19')]>0x1;var _0x16550c=[];if(!fs[_0xd402('0x23')](path[_0xd402('0x24')](_0x3c788f,_0x1f237b))&&_0x520dd3){fs['mkdirSync'](path[_0xd402('0x24')](_0x3c788f,_0x1f237b));}return BPromise[_0xd402('0x25')](_0x55f6bc,function(_0xbbb9df){_0x16550c[_0xd402('0x1e')](_0xbbb9df);})[_0xd402('0x12')](function(){for(var _0x4130ff=0x0;_0x4130ff<_0x16550c['length'];_0x4130ff+=0x1){var _0x5e46b0;var _0x44765d=_0x16550c[_0x4130ff];if(_0x520dd3){_0x5e46b0=path[_0xd402('0x24')](_0x3c788f,_0x1f237b,util['format'](_0xd402('0x26'),_0x1f237b,_0x4130ff,_0xd402('0x27')));}else{_0x5e46b0=path[_0xd402('0x24')](_0x3c788f,util['format']('%s.%s',_0x1f237b,_0xd402('0x27')));}fs[_0xd402('0x28')](_0x5e46b0,csv(_0x44765d));}})[_0xd402('0x12')](function(){if(_0x520dd3){return new Promise(function(_0x5227e5){zipdir(path[_0xd402('0x24')](_0x3c788f,_0x1f237b),{'saveTo':path[_0xd402('0x24')](_0x3c788f,util[_0xd402('0xc')](_0xd402('0x29'),_0x1f237b,_0xd402('0x2a')))},function(_0x54307b,_0x16445b){rimraf(path[_0xd402('0x24')](_0x3c788f,_0x1f237b),function(){});_0x5227e5(_0xd402('0x2b'));});});}})[_0xd402('0x12')](function(){logger[_0xd402('0x2c')](util[_0xd402('0xc')](_0xd402('0x2d'),EXTRACTED_REPORT_ID,_0xd402('0xe')));return analyticExtractedReport('Completed',_0x520dd3?util['format'](_0xd402('0x29'),_0x1f237b,_0x520dd3?_0xd402('0x2a'):'csv'):null);});})[_0xd402('0x2e')](function(_0x102089){logger[_0xd402('0x2c')](util[_0xd402('0xc')](_0xd402('0x2f'),EXTRACTED_REPORT_ID,_0xd402('0xe')),util[_0xd402('0x30')](_0x102089,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd402('0x31'));})[_0xd402('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8c58=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','length','mkdirSync','join','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','rimraf','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','then','splitSizeCsv','sequelize','query','format','SELECT','num','Empty','isInteger','forEach','push'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x8c58,0x135));var _0x88c5=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x8c58[_0x24259d];return _0x5a701;};'use strict';var util=require(_0x88c5('0x0'));var path=require(_0x88c5('0x1'));var _=require(_0x88c5('0x2'));var csv=require(_0x88c5('0x3'));var fs=require('fs');var BPromise=require(_0x88c5('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x88c5('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x88c5('0x6')];var logger=require(_0x88c5('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x88c5('0x8')][0x2]);var QUERY=process[_0x88c5('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c7a7c,_0x3fea90){var _0x340777={'status':_0x4c7a7c};var _0x33ddb9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3fea90){_0x340777[_0x88c5('0x9')]=_0x3fea90;}return db[_0x88c5('0xa')][_0x88c5('0xb')](_0x340777,_0x33ddb9);}function main(){var _0xc7c296=0x1388;var _0x5a65df;logger['info'](util['format'](_0x88c5('0xc'),EXTRACTED_REPORT_ID,_0x88c5('0xd')));return db[_0x88c5('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x88c5('0xf'),'splitSizeCsv']})[_0x88c5('0x10')](function(_0x143699){if(_0x143699){_0x5a65df=_0x143699;_0xc7c296=_0x5a65df[_0x88c5('0x11')]||0x1388;}})[_0x88c5('0x10')](function(){return dbH[_0x88c5('0x12')][_0x88c5('0x13')](util[_0x88c5('0x14')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x88c5('0x12')]['QueryTypes'][_0x88c5('0x15')]});})[_0x88c5('0x10')](function(_0x14765a){if(!_0x14765a[0x0][_0x88c5('0x16')]){return analyticExtractedReport(_0x88c5('0x17'));}var _0x39e312=[];var _0x39a159=0x0;if(_0x5a65df['split']){if(_0x14765a&&_0x14765a['length']){var _0x4a5609=_['range'](_0x14765a[0x0][_0x88c5('0x16')]/_0xc7c296);var _0x58a29b=Number[_0x88c5('0x18')](_0x14765a[0x0][_0x88c5('0x16')]/_0xc7c296)?_0x14765a[0x0]['num']%_0xc7c296:0x0;_0x4a5609[_0x88c5('0x19')](function(_0x22f1eb){if(_0x22f1eb>0x0){_0x39a159+=_0xc7c296;}_0x39e312[_0x88c5('0x1a')](dbH[_0x88c5('0x12')][_0x88c5('0x13')](util[_0x88c5('0x14')](_0x88c5('0x1b'),QUERY,_0xc7c296,_0x39a159),{'type':dbH[_0x88c5('0x12')]['QueryTypes'][_0x88c5('0x15')]}));});if(_0x58a29b>0x0){_0x39a159+=_0xc7c296;_0x39e312[_0x88c5('0x1a')](dbH['sequelize'][_0x88c5('0x13')](util[_0x88c5('0x14')](_0x88c5('0x1b'),QUERY,_0x58a29b,_0x39a159),{'type':dbH[_0x88c5('0x12')][_0x88c5('0x1c')][_0x88c5('0x15')]}));}}}else{_0x39e312['push'](dbH[_0x88c5('0x12')][_0x88c5('0x13')](QUERY,{'type':dbH[_0x88c5('0x12')][_0x88c5('0x1c')][_0x88c5('0x15')]}));}var _0x442764=path[_0x88c5('0x1d')](PATH);var _0x109841=path[_0x88c5('0x1e')](PATH,_0x88c5('0x1f'));var _0x416484=_0x5a65df['split']&&_0x39e312[_0x88c5('0x20')]>0x1;var _0x37d438=[];if(!fs['existsSync'](path['join'](_0x442764,_0x109841))&&_0x416484){fs[_0x88c5('0x21')](path[_0x88c5('0x22')](_0x442764,_0x109841));}return BPromise[_0x88c5('0x23')](_0x39e312,function(_0x36d378){_0x37d438['push'](_0x36d378);})[_0x88c5('0x10')](function(){for(var _0x586d66=0x0;_0x586d66<_0x37d438[_0x88c5('0x20')];_0x586d66+=0x1){var _0x22bc88;var _0x2116b8=_0x37d438[_0x586d66];if(_0x416484){_0x22bc88=path['join'](_0x442764,_0x109841,util[_0x88c5('0x14')]('%s%d.%s',_0x109841,_0x586d66,_0x88c5('0x24')));}else{_0x22bc88=path['join'](_0x442764,util[_0x88c5('0x14')](_0x88c5('0x25'),_0x109841,_0x88c5('0x24')));}fs[_0x88c5('0x26')](_0x22bc88,csv(_0x2116b8));}})[_0x88c5('0x10')](function(){if(_0x416484){return new Promise(function(_0x26bb1f){zipdir(path[_0x88c5('0x22')](_0x442764,_0x109841),{'saveTo':path[_0x88c5('0x22')](_0x442764,util[_0x88c5('0x14')](_0x88c5('0x25'),_0x109841,_0x88c5('0x27')))},function(_0x5c0742,_0x391dd7){rimraf(path[_0x88c5('0x22')](_0x442764,_0x109841),function(){});_0x26bb1f(_0x88c5('0x28'));});});}})[_0x88c5('0x10')](function(){logger[_0x88c5('0x29')](util['format'](_0x88c5('0x2a'),EXTRACTED_REPORT_ID,_0x88c5('0xd')));return analyticExtractedReport('Completed',_0x416484?util[_0x88c5('0x14')](_0x88c5('0x25'),_0x109841,_0x416484?_0x88c5('0x27'):_0x88c5('0x24')):null);});})[_0x88c5('0x2b')](function(_0x16da8f){logger[_0x88c5('0x29')](util[_0x88c5('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x88c5('0xd')),util[_0x88c5('0x2c')](_0x16da8f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x88c5('0x2d'));})[_0x88c5('0x2e')](function(){process[_0x88c5('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 6ba4193..cc1cbdb 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 _0x491e=['sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','PDF','Completed','info','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','body','push','chunk','keys','forEach','format','name','startDate','endDate','header','before','margin','landscape','\x20/\x20','footer','black','right','num','Empty','Setting','split','splitSizePdf','then','isInteger'];(function(_0x4c4a33,_0x1ff81b){var _0x480290=function(_0x54b633){while(--_0x54b633){_0x4c4a33['push'](_0x4c4a33['shift']());}};_0x480290(++_0x1ff81b);}(_0x491e,0x80));var _0xe491=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x491e[_0x3d4ef1];return _0x409423;};'use strict';var _=require(_0xe491('0x0'));var fs=require('fs');var util=require(_0xe491('0x1'));var path=require(_0xe491('0x2'));var moment=require(_0xe491('0x3'));var htmlToPdfmake=require(_0xe491('0x4'));var PdfPrinter=require(_0xe491('0x5'));var zipdir=require(_0xe491('0x6'));var rimraf=require(_0xe491('0x7'));var JSDOM=require(_0xe491('0x8'))[_0xe491('0x9')];var window=new JSDOM('')['window'];var BPromise=require(_0xe491('0xa'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xe491('0xb')];var logger=require(_0xe491('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xe491('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b2e98,_0xb50768){var _0x12ee58={'status':_0x2b2e98};var _0x4b248d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb50768){_0x12ee58[_0xe491('0xe')]=_0xb50768;}return db[_0xe491('0xf')][_0xe491('0x10')](_0x12ee58,_0x4b248d);}function getHeaders(_0xd0cbb0){return _[_0xe491('0x11')](_0xd0cbb0,function(_0x2f9bc1){return{'text':_0x2f9bc1,'style':_0xe491('0x12')};});}function getRows(_0x3b7815,_0x458380){return _[_0xe491('0x11')](_0x458380,function(_0x510bdf){return _(_0x510bdf)[_0xe491('0x13')](_0x3b7815)['map'](function(_0x3c477f){return _0x3c477f?_[_0xe491('0x14')](_0x3c477f):'';})[_0xe491('0x15')]();});}function createTable(_0x53c885,_0x2112f6){var _0x30aff0={'widths':_[_0xe491('0x16')](Array(_0x53c885[_0xe491('0x17')]),0x91),'heights':function(_0x2a91d4){return _0x2a91d4===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x13e489=getHeaders(_0x53c885);_0x30aff0[_0xe491('0x18')][_0xe491('0x19')](_0x13e489);var _0xd3e486=getRows(_0x53c885,_0x2112f6);_0x30aff0[_0xe491('0x18')]=_0x30aff0[_0xe491('0x18')]['concat'](_0xd3e486);return _0x30aff0;}function createTables(_0x1787c6){var _0x292ef1=[];var _0x20c7a2=_[_0xe491('0x1a')](Object[_0xe491('0x1b')](_0x1787c6[0x0]),0x5);_0x20c7a2[_0xe491('0x1c')](function(_0xf09022){_0x292ef1['push'](createTable(_0xf09022,_0x1787c6));});return _0x292ef1;}function getPDFDocDefinition(_0x166b8f){var _0x1eba4e=util[_0xe491('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xe491('0x1e')],moment(EXTRACTED_REPORT[_0xe491('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xe491('0x20')])[_0xe491('0x1d')](FORMAT));var _0x32d924=[];for(var _0x56637c=0x0;_0x56637c<_0x166b8f[_0xe491('0x17')];_0x56637c++){var _0x42f23b=[];if(_0x56637c===0x0){_0x42f23b[_0xe491('0x19')]({'text':_0x1eba4e,'style':_0xe491('0x21')});}var _0x161102={'table':_0x166b8f[_0x56637c]};if(_0x56637c>0x0){_0x161102['pageBreak']=_0xe491('0x22');_0x161102[_0xe491('0x23')]=[0x0,0x46,0x0,0x0];}_0x42f23b['push'](_0x161102);_0x32d924[_0xe491('0x19')](_0x42f23b);}return{'pageSize':'A4','pageOrientation':_0xe491('0x24'),'content':_0x32d924,'footer':function(_0xc8c9eb,_0x399af9){return{'text':_0xc8c9eb[_0xe491('0x14')]()+_0xe491('0x25')+_0x399af9,'style':_0xe491('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe491('0x27')},'footer':{'alignment':_0xe491('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xe63167){var _0x300c43=0x1388;var _0xfe0f7c;if(!_0xe63167[0x0][_0xe491('0x29')]){return analyticExtractedReport(_0xe491('0x2a'));}return db[_0xe491('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe491('0x2c'),_0xe491('0x2d')]})[_0xe491('0x2e')](function(_0xa4d8d7){if(_0xa4d8d7){_0xfe0f7c=_0xa4d8d7;_0x300c43=_0xfe0f7c[_0xe491('0x2d')]||0x3e8;}})['then'](function(){var _0x123262=[];var _0x119621=0x0;if(_0xfe0f7c['split']){if(_0xe63167&&_0xe63167['length']){var _0x39b064=_['range'](_0xe63167[0x0][_0xe491('0x29')]/_0x300c43);var _0x38197d=Number[_0xe491('0x2f')](_0xe63167[0x0][_0xe491('0x29')]/_0x300c43)?_0xe63167[0x0][_0xe491('0x29')]%_0x300c43:0x0;_0x39b064['forEach'](function(_0x35aded){if(_0x35aded>0x0){_0x119621+=_0x300c43;}_0x123262[_0xe491('0x19')](dbH[_0xe491('0x30')][_0xe491('0x31')](util[_0xe491('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x300c43,_0x119621),{'type':dbH[_0xe491('0x30')][_0xe491('0x32')][_0xe491('0x33')]}));});if(_0x38197d>0x0){_0x119621+=_0x300c43;_0x123262[_0xe491('0x19')](dbH[_0xe491('0x30')][_0xe491('0x31')](util[_0xe491('0x1d')](_0xe491('0x34'),QUERY,_0x38197d,_0x119621),{'type':dbH['sequelize'][_0xe491('0x32')][_0xe491('0x33')]}));}}}else{_0x123262[_0xe491('0x19')](dbH[_0xe491('0x30')]['query'](QUERY,{'type':dbH[_0xe491('0x30')][_0xe491('0x32')][_0xe491('0x33')]}));}var _0x21222b=path[_0xe491('0x35')](PATH);var _0xf08cc4=path[_0xe491('0x36')](PATH,_0xe491('0x37'));var _0x18d14d=_0xfe0f7c[_0xe491('0x2c')]&&_0x123262[_0xe491('0x17')]>0x1;var _0x3fb087=[];if(!fs[_0xe491('0x38')](path[_0xe491('0x39')](_0x21222b,_0xf08cc4))&&_0x18d14d){fs['mkdirSync'](path['join'](_0x21222b,_0xf08cc4));}return BPromise[_0xe491('0x3a')](_0x123262,function(_0x46fc75){_0x3fb087[_0xe491('0x19')](_0x46fc75);})['then'](function(){var _0x524f40=[];for(var _0x49a406=0x0;_0x49a406<_0x3fb087[_0xe491('0x17')];_0x49a406+=0x1){var _0x2a357b=_0x3fb087[_0x49a406];var _0x31760b=createTables(_[_0xe491('0x3b')](_0x2a357b));var _0x4e55ba;var _0x2fc78b=getPDFDocDefinition(_0x31760b);var _0x538437=getPDFPrinter();var _0x4c90b4=_0x538437[_0xe491('0x3c')](_0x2fc78b);if(_0x18d14d){_0x4e55ba=path['join'](_0x21222b,_0xf08cc4,util[_0xe491('0x1d')](_0xe491('0x3d'),_0xf08cc4,_0x49a406,_0xe491('0x3e')));}else{_0x4e55ba=path['join'](_0x21222b,util[_0xe491('0x1d')](_0xe491('0x3f'),_0xf08cc4,'pdf'));}_0x524f40[_0xe491('0x19')](writePDFDocument(_0x4c90b4,_0x4e55ba));}return Promise[_0xe491('0x40')](_0x524f40);})[_0xe491('0x2e')](function(){if(_0x18d14d){return new Promise(function(_0x26e23a){zipdir(path['join'](_0x21222b,_0xf08cc4),{'saveTo':path[_0xe491('0x39')](_0x21222b,util[_0xe491('0x1d')](_0xe491('0x3f'),_0xf08cc4,'zip'))},function(){rimraf(path[_0xe491('0x39')](_0x21222b,_0xf08cc4),function(){});_0x26e23a('zip\x20finished');});});}})[_0xe491('0x2e')](function(){if(!_0x18d14d)return;rimraf(path[_0xe491('0x39')](_0x21222b,_0xf08cc4),function(){});})[_0xe491('0x2e')](function(){logger['info'](util[_0xe491('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xe491('0x41')));return analyticExtractedReport(_0xe491('0x42'),_0x18d14d?util[_0xe491('0x1d')]('%s.%s',_0xf08cc4,_0x18d14d?'zip':_0xe491('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe491('0x43')](util[_0xe491('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe491('0x41')));return db[_0xe491('0xf')][_0xe491('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe491('0x2e')](function(_0x2a751d){EXTRACTED_REPORT=_0x2a751d;return dbH[_0xe491('0x30')][_0xe491('0x31')](util[_0xe491('0x1d')](_0xe491('0x45'),QUERY),{'type':dbH[_0xe491('0x30')]['QueryTypes'][_0xe491('0x33')]});})['then'](extractReport)[_0xe491('0x46')](function(_0x1b73f2){logger[_0xe491('0x43')](util[_0xe491('0x1d')](_0xe491('0x47'),EXTRACTED_REPORT_ID,_0xe491('0x41')),util[_0xe491('0x48')](_0x1b73f2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe491('0x49'));})[_0xe491('0x4a')](function(){process[_0xe491('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x79a226=new PdfPrinter({'Arial':{'normal':__dirname+_0xe491('0x4c'),'bold':__dirname+_0xe491('0x4d'),'italics':__dirname+_0xe491('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x79a226;}function getPDFDocDefinitionFromHTML(_0x2aacf7,_0x44b050){var _0x305523=util[_0xe491('0x1d')]('%s\x20#%d',_0x44b050['channel'],_0x44b050[_0xe491('0x4f')]);var _0x49d964=moment()['format'](_0xe491('0x50'))['toString']();var _0x44bdc6=htmlToPdfmake(_0x2aacf7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x44bdc6],'defaultStyle':{'font':_0xe491('0x51')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe491('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xe491('0x53'),'style':_0xe491('0x21')}];},'footer':function(_0x41dd31,_0x5b4db4){return[{'text':util[_0xe491('0x1d')](_0xe491('0x54'),_0x305523,_0x41dd31,_0x5b4db4,_0x49d964),'style':_0xe491('0x26')}];}};}function writePDFDocument(_0x3e6c98,_0x102b8b){return new Promise(function(_0x8c2b0e,_0x4234b8){var _0x34803e=_0x3e6c98[_0xe491('0x55')](fs['createWriteStream'](_0x102b8b));_0x34803e['on']('finish',function(){_0x8c2b0e('finish');});_0x34803e['on']('error',function(_0x5cac4b){_0x4234b8(_0x5cac4b);});_0x3e6c98[_0xe491('0x56')]();});}exports[_0xe491('0x57')]=function(_0x5187b3,_0x277d37){var _0x43ae69=getPDFPrinter();var _0x3566da=getPDFDocDefinitionFromHTML(_0x5187b3,_0x277d37);var _0x318325=_0x43ae69[_0xe491('0x3c')](_0x3566da);return writePDFDocument(_0x318325,_0x277d37['path'])[_0xe491('0x46')](function(_0xf42d3f){throw _0xf42d3f;});}; \ No newline at end of file +var _0x4c53=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','path','lodash','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','toString','value','length','auto','body','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','margin','\x20/\x20','footer','Arial','black','right','Empty','Setting','split','splitSizePdf','then','range','num','isInteger','sequelize','query'];(function(_0x460d5c,_0x2502a8){var _0x2983d9=function(_0x40a42e){while(--_0x40a42e){_0x460d5c['push'](_0x460d5c['shift']());}};_0x2983d9(++_0x2502a8);}(_0x4c53,0xe3));var _0x34c5=function(_0x3aa0f6,_0x4dd14b){_0x3aa0f6=_0x3aa0f6-0x0;var _0xf10f49=_0x4c53[_0x3aa0f6];return _0xf10f49;};'use strict';var _=require(_0x34c5('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0x34c5('0x1'));var htmlToPdfmake=require(_0x34c5('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x34c5('0x3'));var rimraf=require(_0x34c5('0x4'));var JSDOM=require(_0x34c5('0x5'))[_0x34c5('0x6')];var window=new JSDOM('')[_0x34c5('0x7')];var BPromise=require(_0x34c5('0x8'));var db=require(_0x34c5('0x9'))['db'];var dbH=require(_0x34c5('0x9'))['dbH'];var logger=require('../../config/logger')(_0x34c5('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x34c5('0xb')][0x2]);var QUERY=process[_0x34c5('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x34c5('0xb')][0x5];var FORMAT=_0x34c5('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x10908f,_0x125084){var _0x2f0336={'status':_0x10908f};var _0x97712={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x125084){_0x2f0336[_0x34c5('0xd')]=_0x125084;}return db['AnalyticExtractedReport'][_0x34c5('0xe')](_0x2f0336,_0x97712);}function getHeaders(_0x3fb7dd){return _[_0x34c5('0xf')](_0x3fb7dd,function(_0x63a06c){return{'text':_0x63a06c,'style':'tableHeader'};});}function getRows(_0x1f7067,_0x1ed814){return _[_0x34c5('0xf')](_0x1ed814,function(_0x3f44e0){return _(_0x3f44e0)[_0x34c5('0x10')](_0x1f7067)['map'](function(_0x54f08f){return _0x54f08f?_[_0x34c5('0x11')](_0x54f08f):'';})[_0x34c5('0x12')]();});}function createTable(_0x5e99bd,_0x237d22){var _0xbb29b0={'widths':_['fill'](Array(_0x5e99bd[_0x34c5('0x13')]),0x91),'heights':function(_0x300ae6){return _0x300ae6===0x0?_0x34c5('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x35afb4=getHeaders(_0x5e99bd);_0xbb29b0[_0x34c5('0x15')]['push'](_0x35afb4);var _0x1ec31d=getRows(_0x5e99bd,_0x237d22);_0xbb29b0[_0x34c5('0x15')]=_0xbb29b0[_0x34c5('0x15')]['concat'](_0x1ec31d);return _0xbb29b0;}function createTables(_0x48ccee){var _0x178d78=[];var _0x348dd0=_[_0x34c5('0x16')](Object[_0x34c5('0x17')](_0x48ccee[0x0]),0x5);_0x348dd0[_0x34c5('0x18')](function(_0x3c768e){_0x178d78[_0x34c5('0x19')](createTable(_0x3c768e,_0x48ccee));});return _0x178d78;}function getPDFDocDefinition(_0x23101d){var _0xd48d53=util[_0x34c5('0x1a')](_0x34c5('0x1b'),NAME,EXTRACTED_REPORT[_0x34c5('0x1c')],moment(EXTRACTED_REPORT[_0x34c5('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x270d45=[];for(var _0x4539f3=0x0;_0x4539f3<_0x23101d[_0x34c5('0x13')];_0x4539f3++){var _0x585032=[];if(_0x4539f3===0x0){_0x585032[_0x34c5('0x19')]({'text':_0xd48d53,'style':_0x34c5('0x1e')});}var _0x316f60={'table':_0x23101d[_0x4539f3]};if(_0x4539f3>0x0){_0x316f60[_0x34c5('0x1f')]=_0x34c5('0x20');_0x316f60[_0x34c5('0x21')]=[0x0,0x46,0x0,0x0];}_0x585032['push'](_0x316f60);_0x270d45['push'](_0x585032);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x270d45,'footer':function(_0x54217c,_0x5cda96){return{'text':_0x54217c[_0x34c5('0x11')]()+_0x34c5('0x22')+_0x5cda96,'style':_0x34c5('0x23')};},'defaultStyle':{'font':_0x34c5('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x34c5('0x25')},'footer':{'alignment':_0x34c5('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x35f8a2){var _0x30fa89=0x1388;var _0x4d0037;if(!_0x35f8a2[0x0]['num']){return analyticExtractedReport(_0x34c5('0x27'));}return db[_0x34c5('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x34c5('0x29'),_0x34c5('0x2a')]})[_0x34c5('0x2b')](function(_0x43b6f7){if(_0x43b6f7){_0x4d0037=_0x43b6f7;_0x30fa89=_0x4d0037[_0x34c5('0x2a')]||0x3e8;}})[_0x34c5('0x2b')](function(){var _0xdb5d53=[];var _0x4c7c2e=0x0;if(_0x4d0037[_0x34c5('0x29')]){if(_0x35f8a2&&_0x35f8a2[_0x34c5('0x13')]){var _0x9cf655=_[_0x34c5('0x2c')](_0x35f8a2[0x0][_0x34c5('0x2d')]/_0x30fa89);var _0x295ddd=Number[_0x34c5('0x2e')](_0x35f8a2[0x0][_0x34c5('0x2d')]/_0x30fa89)?_0x35f8a2[0x0]['num']%_0x30fa89:0x0;_0x9cf655[_0x34c5('0x18')](function(_0x11a048){if(_0x11a048>0x0){_0x4c7c2e+=_0x30fa89;}_0xdb5d53[_0x34c5('0x19')](dbH[_0x34c5('0x2f')][_0x34c5('0x30')](util['format'](_0x34c5('0x31'),QUERY,_0x30fa89,_0x4c7c2e),{'type':dbH[_0x34c5('0x2f')][_0x34c5('0x32')][_0x34c5('0x33')]}));});if(_0x295ddd>0x0){_0x4c7c2e+=_0x30fa89;_0xdb5d53[_0x34c5('0x19')](dbH['sequelize'][_0x34c5('0x30')](util['format'](_0x34c5('0x31'),QUERY,_0x295ddd,_0x4c7c2e),{'type':dbH[_0x34c5('0x2f')]['QueryTypes'][_0x34c5('0x33')]}));}}}else{_0xdb5d53['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x34c5('0x2f')][_0x34c5('0x32')][_0x34c5('0x33')]}));}var _0x8b1c3b=path[_0x34c5('0x34')](PATH);var _0x250760=path[_0x34c5('0x35')](PATH,_0x34c5('0x36'));var _0x4ed5b8=_0x4d0037[_0x34c5('0x29')]&&_0xdb5d53[_0x34c5('0x13')]>0x1;var _0x3521a5=[];if(!fs['existsSync'](path[_0x34c5('0x37')](_0x8b1c3b,_0x250760))&&_0x4ed5b8){fs[_0x34c5('0x38')](path['join'](_0x8b1c3b,_0x250760));}return BPromise[_0x34c5('0x39')](_0xdb5d53,function(_0x244c47){_0x3521a5[_0x34c5('0x19')](_0x244c47);})[_0x34c5('0x2b')](function(){var _0x10b0ea=[];for(var _0x1c6388=0x0;_0x1c6388<_0x3521a5[_0x34c5('0x13')];_0x1c6388+=0x1){var _0x507873=_0x3521a5[_0x1c6388];var _0x29c52c=createTables(_[_0x34c5('0x3a')](_0x507873));var _0x234edd;var _0x40b979=getPDFDocDefinition(_0x29c52c);var _0x23e6b1=getPDFPrinter();var _0x45d334=_0x23e6b1[_0x34c5('0x3b')](_0x40b979);if(_0x4ed5b8){_0x234edd=path[_0x34c5('0x37')](_0x8b1c3b,_0x250760,util[_0x34c5('0x1a')](_0x34c5('0x3c'),_0x250760,_0x1c6388,'pdf'));}else{_0x234edd=path[_0x34c5('0x37')](_0x8b1c3b,util[_0x34c5('0x1a')](_0x34c5('0x3d'),_0x250760,_0x34c5('0x3e')));}_0x10b0ea[_0x34c5('0x19')](writePDFDocument(_0x45d334,_0x234edd));}return Promise[_0x34c5('0x3f')](_0x10b0ea);})[_0x34c5('0x2b')](function(){if(_0x4ed5b8){return new Promise(function(_0x317a9d){zipdir(path[_0x34c5('0x37')](_0x8b1c3b,_0x250760),{'saveTo':path['join'](_0x8b1c3b,util['format']('%s.%s',_0x250760,_0x34c5('0x40')))},function(){rimraf(path[_0x34c5('0x37')](_0x8b1c3b,_0x250760),function(){});_0x317a9d('zip\x20finished');});});}})[_0x34c5('0x2b')](function(){if(!_0x4ed5b8)return;rimraf(path['join'](_0x8b1c3b,_0x250760),function(){});})[_0x34c5('0x2b')](function(){logger[_0x34c5('0x41')](util[_0x34c5('0x1a')](_0x34c5('0x42'),EXTRACTED_REPORT_ID,_0x34c5('0x43')));return analyticExtractedReport(_0x34c5('0x44'),_0x4ed5b8?util['format'](_0x34c5('0x3d'),_0x250760,_0x4ed5b8?'zip':_0x34c5('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x34c5('0x41')](util[_0x34c5('0x1a')](_0x34c5('0x45'),EXTRACTED_REPORT_ID,_0x34c5('0x43')));return db[_0x34c5('0x46')][_0x34c5('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x34c5('0x2b')](function(_0x36233b){EXTRACTED_REPORT=_0x36233b;return dbH['sequelize'][_0x34c5('0x30')](util[_0x34c5('0x1a')](_0x34c5('0x48'),QUERY),{'type':dbH[_0x34c5('0x2f')]['QueryTypes'][_0x34c5('0x33')]});})[_0x34c5('0x2b')](extractReport)[_0x34c5('0x49')](function(_0x4aef7d){logger['info'](util[_0x34c5('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x34c5('0x43')),util[_0x34c5('0x4a')](_0x4aef7d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x34c5('0x4b')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5a8a4b=new PdfPrinter({'Arial':{'normal':__dirname+_0x34c5('0x4c'),'bold':__dirname+_0x34c5('0x4d'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x34c5('0x4e')}});return _0x5a8a4b;}function getPDFDocDefinitionFromHTML(_0x12f2b7,_0x236d9b){var _0xa966f9=util[_0x34c5('0x1a')](_0x34c5('0x4f'),_0x236d9b[_0x34c5('0x50')],_0x236d9b[_0x34c5('0x51')]);var _0xe5db12=moment()[_0x34c5('0x1a')](_0x34c5('0x52'))[_0x34c5('0x11')]();var _0x1dab24=htmlToPdfmake(_0x12f2b7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1dab24],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x34c5('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x34c5('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x34c5('0x53')}},'header':function(){return[{'text':_0x34c5('0x54'),'style':_0x34c5('0x1e')}];},'footer':function(_0x5800f6,_0x10f871){return[{'text':util[_0x34c5('0x1a')](_0x34c5('0x55'),_0xa966f9,_0x5800f6,_0x10f871,_0xe5db12),'style':'footer'}];}};}function writePDFDocument(_0x3728dd,_0x997bdc){return new Promise(function(_0x35d7a7,_0x412c7f){var _0x4687be=_0x3728dd[_0x34c5('0x56')](fs[_0x34c5('0x57')](_0x997bdc));_0x4687be['on'](_0x34c5('0x58'),function(){_0x35d7a7('finish');});_0x4687be['on']('error',function(_0x49e99a){_0x412c7f(_0x49e99a);});_0x3728dd[_0x34c5('0x59')]();});}exports[_0x34c5('0x5a')]=function(_0x495002,_0x34cbf5){var _0x14306e=getPDFPrinter();var _0x39a5e4=getPDFDocDefinitionFromHTML(_0x495002,_0x34cbf5);var _0x13c6e4=_0x14306e[_0x34c5('0x3b')](_0x39a5e4);return writePDFDocument(_0x13c6e4,_0x34cbf5[_0x34c5('0x5b')])[_0x34c5('0x49')](function(_0x324f89){throw _0x324f89;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ccbd1c0..9e778ff 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 _0x0ae5=['sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','mkdirSync','each','join','%s%d.%s','%s.%s','xlsx','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','XLSX','find','split','then'];(function(_0xeca744,_0x28e6d0){var _0x456880=function(_0x4d48bb){while(--_0x4d48bb){_0xeca744['push'](_0xeca744['shift']());}};_0x456880(++_0x28e6d0);}(_0x0ae5,0x16a));var _0x50ae=function(_0x2bf9f1,_0x545f3b){_0x2bf9f1=_0x2bf9f1-0x0;var _0x34e6f7=_0x0ae5[_0x2bf9f1];return _0x34e6f7;};'use strict';var util=require(_0x50ae('0x0'));var path=require(_0x50ae('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x50ae('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x50ae('0x3'))['db'];var dbH=require(_0x50ae('0x3'))[_0x50ae('0x4')];var logger=require('../../config/logger')(_0x50ae('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x50ae('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xe8a3be,_0xd1273d){var _0x243829={'status':_0xe8a3be};var _0x63ece0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd1273d){_0x243829[_0x50ae('0x7')]=_0xd1273d;}return db[_0x50ae('0x8')][_0x50ae('0x9')](_0x243829,_0x63ece0);}function main(){var _0x5937cf=0x1388;var _0x2ac3a5;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x50ae('0xa')));return db['Setting'][_0x50ae('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x50ae('0xc'),'splitSizeXlsx']})[_0x50ae('0xd')](function(_0x35cc70){if(_0x35cc70){_0x2ac3a5=_0x35cc70;_0x5937cf=_0x2ac3a5['splitSizeXlsx']||0x1388;}})[_0x50ae('0xd')](function(){return dbH[_0x50ae('0xe')]['query'](util[_0x50ae('0xf')](_0x50ae('0x10'),QUERY),{'type':dbH[_0x50ae('0xe')][_0x50ae('0x11')][_0x50ae('0x12')]});})[_0x50ae('0xd')](function(_0x4c0a1a){if(!_0x4c0a1a[0x0]['num']){return analyticExtractedReport('Empty');}var _0xd5df7b=[];var _0x58eed6=0x0;if(_0x2ac3a5[_0x50ae('0xc')]){if(_0x4c0a1a&&_0x4c0a1a[_0x50ae('0x13')]){var _0x58b245=_[_0x50ae('0x14')](_0x4c0a1a[0x0][_0x50ae('0x15')]/_0x5937cf);var _0x38fd17=Number[_0x50ae('0x16')](_0x4c0a1a[0x0][_0x50ae('0x15')]/_0x5937cf)?_0x4c0a1a[0x0][_0x50ae('0x15')]%_0x5937cf:0x0;_0x58b245[_0x50ae('0x17')](function(_0x398f73){if(_0x398f73>0x0){_0x58eed6+=_0x5937cf;}_0xd5df7b[_0x50ae('0x18')](dbH[_0x50ae('0xe')][_0x50ae('0x19')](util[_0x50ae('0xf')](_0x50ae('0x1a'),QUERY,_0x5937cf,_0x58eed6),{'type':dbH[_0x50ae('0xe')]['QueryTypes'][_0x50ae('0x12')]}));});if(_0x38fd17>0x0){_0x58eed6+=_0x5937cf;_0xd5df7b[_0x50ae('0x18')](dbH['sequelize'][_0x50ae('0x19')](util[_0x50ae('0xf')](_0x50ae('0x1a'),QUERY,_0x38fd17,_0x58eed6),{'type':dbH[_0x50ae('0xe')][_0x50ae('0x11')]['SELECT']}));}}}else{_0xd5df7b[_0x50ae('0x18')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x50ae('0xe')][_0x50ae('0x11')][_0x50ae('0x12')]}));}var _0x26e8b8=path[_0x50ae('0x1b')](PATH);var _0x9a14ad=path[_0x50ae('0x1c')](PATH,_0x50ae('0x1d'));var _0x2ec370=_0x2ac3a5[_0x50ae('0xc')]&&_0xd5df7b[_0x50ae('0x13')]>0x1;var _0x7f3f29=[];if(!fs[_0x50ae('0x1e')](path['join'](_0x26e8b8,_0x9a14ad))&&_0x2ec370){fs[_0x50ae('0x1f')](path['join'](_0x26e8b8,_0x9a14ad));}return BPromise[_0x50ae('0x20')](_0xd5df7b,function(_0x3b4d96){_0x7f3f29['push'](_0x3b4d96);})['then'](function(){for(var _0x309f24=0x0;_0x309f24<_0x7f3f29['length'];_0x309f24+=0x1){var _0x15894d;var _0x17534d=_0x7f3f29[_0x309f24];if(_0x2ec370){_0x15894d=path[_0x50ae('0x21')](_0x26e8b8,_0x9a14ad,util[_0x50ae('0xf')](_0x50ae('0x22'),_0x9a14ad,_0x309f24,'xlsx'));}else{_0x15894d=path['join'](_0x26e8b8,util['format'](_0x50ae('0x23'),_0x9a14ad,_0x50ae('0x24')));}fs['writeFileSync'](_0x15894d,json2xls(_0x17534d),'binary');}})['then'](function(){if(_0x2ec370){return new Promise(function(_0x5d513b){zipdir(path[_0x50ae('0x21')](_0x26e8b8,_0x9a14ad),{'saveTo':path[_0x50ae('0x21')](_0x26e8b8,util['format'](_0x50ae('0x23'),_0x9a14ad,'zip'))},function(_0x27c7e3,_0x3aed19){rimraf(path['join'](_0x26e8b8,_0x9a14ad),function(){});_0x5d513b(_0x50ae('0x25'));});});}})[_0x50ae('0xd')](function(){logger[_0x50ae('0x26')](util[_0x50ae('0xf')](_0x50ae('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x50ae('0x28'),_0x2ec370?util['format'](_0x50ae('0x23'),_0x9a14ad,_0x2ec370?'zip':_0x50ae('0x24')):null);});})[_0x50ae('0x29')](function(_0x42c68b){logger[_0x50ae('0x26')](util['format'](_0x50ae('0x2a'),EXTRACTED_REPORT_ID,_0x50ae('0xa')),util[_0x50ae('0x2b')](_0x42c68b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x50ae('0x2c'));})[_0x50ae('0x2d')](function(){process[_0x50ae('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4b74=['each','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','QueryTypes','num','Empty','split','length','range','isInteger','forEach','push','SELECT','dirname','join','mkdirSync'];(function(_0x27b44f,_0x4a3547){var _0x5c4c8b=function(_0x561495){while(--_0x561495){_0x27b44f['push'](_0x27b44f['shift']());}};_0x5c4c8b(++_0x4a3547);}(_0x4b74,0x103));var _0x44b7=function(_0x465a4c,_0x228080){_0x465a4c=_0x465a4c-0x0;var _0x1df8c5=_0x4b74[_0x465a4c];return _0x1df8c5;};'use strict';var util=require(_0x44b7('0x0'));var path=require(_0x44b7('0x1'));var _=require(_0x44b7('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x44b7('0x3'));var zipdir=require(_0x44b7('0x4'));var rimraf=require(_0x44b7('0x5'));var db=require(_0x44b7('0x6'))['db'];var dbH=require(_0x44b7('0x6'))[_0x44b7('0x7')];var logger=require(_0x44b7('0x8'))(_0x44b7('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x44b7('0xa')][0x3];var PATH=process[_0x44b7('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x7b80e9,_0x4a582b){var _0x45dfbe={'status':_0x7b80e9};var _0xabf05c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a582b){_0x45dfbe[_0x44b7('0xb')]=_0x4a582b;}return db['AnalyticExtractedReport'][_0x44b7('0xc')](_0x45dfbe,_0xabf05c);}function main(){var _0x4765e6=0x1388;var _0x592286;logger[_0x44b7('0xd')](util[_0x44b7('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x44b7('0xf')));return db[_0x44b7('0x10')][_0x44b7('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x44b7('0x12')]})[_0x44b7('0x13')](function(_0x47e9f2){if(_0x47e9f2){_0x592286=_0x47e9f2;_0x4765e6=_0x592286[_0x44b7('0x12')]||0x1388;}})['then'](function(){return dbH[_0x44b7('0x14')][_0x44b7('0x15')](util[_0x44b7('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x44b7('0x16')]['SELECT']});})['then'](function(_0x52419d){if(!_0x52419d[0x0][_0x44b7('0x17')]){return analyticExtractedReport(_0x44b7('0x18'));}var _0x4bae25=[];var _0x304807=0x0;if(_0x592286[_0x44b7('0x19')]){if(_0x52419d&&_0x52419d[_0x44b7('0x1a')]){var _0xb3f580=_[_0x44b7('0x1b')](_0x52419d[0x0][_0x44b7('0x17')]/_0x4765e6);var _0x40c84e=Number[_0x44b7('0x1c')](_0x52419d[0x0][_0x44b7('0x17')]/_0x4765e6)?_0x52419d[0x0][_0x44b7('0x17')]%_0x4765e6:0x0;_0xb3f580[_0x44b7('0x1d')](function(_0x490b4b){if(_0x490b4b>0x0){_0x304807+=_0x4765e6;}_0x4bae25[_0x44b7('0x1e')](dbH['sequelize'][_0x44b7('0x15')](util[_0x44b7('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4765e6,_0x304807),{'type':dbH[_0x44b7('0x14')][_0x44b7('0x16')][_0x44b7('0x1f')]}));});if(_0x40c84e>0x0){_0x304807+=_0x4765e6;_0x4bae25[_0x44b7('0x1e')](dbH[_0x44b7('0x14')][_0x44b7('0x15')](util[_0x44b7('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x40c84e,_0x304807),{'type':dbH[_0x44b7('0x14')]['QueryTypes'][_0x44b7('0x1f')]}));}}}else{_0x4bae25[_0x44b7('0x1e')](dbH['sequelize'][_0x44b7('0x15')](QUERY,{'type':dbH[_0x44b7('0x14')][_0x44b7('0x16')][_0x44b7('0x1f')]}));}var _0x27d96c=path[_0x44b7('0x20')](PATH);var _0xe90edf=path['basename'](PATH,'.xlsx');var _0x2c2a29=_0x592286['split']&&_0x4bae25[_0x44b7('0x1a')]>0x1;var _0x5e5f58=[];if(!fs['existsSync'](path[_0x44b7('0x21')](_0x27d96c,_0xe90edf))&&_0x2c2a29){fs[_0x44b7('0x22')](path[_0x44b7('0x21')](_0x27d96c,_0xe90edf));}return BPromise[_0x44b7('0x23')](_0x4bae25,function(_0x2bad24){_0x5e5f58['push'](_0x2bad24);})[_0x44b7('0x13')](function(){for(var _0x5d33af=0x0;_0x5d33af<_0x5e5f58[_0x44b7('0x1a')];_0x5d33af+=0x1){var _0x3da272;var _0x115f80=_0x5e5f58[_0x5d33af];if(_0x2c2a29){_0x3da272=path['join'](_0x27d96c,_0xe90edf,util['format']('%s%d.%s',_0xe90edf,_0x5d33af,_0x44b7('0x24')));}else{_0x3da272=path[_0x44b7('0x21')](_0x27d96c,util['format']('%s.%s',_0xe90edf,_0x44b7('0x24')));}fs[_0x44b7('0x25')](_0x3da272,json2xls(_0x115f80),_0x44b7('0x26'));}})[_0x44b7('0x13')](function(){if(_0x2c2a29){return new Promise(function(_0x420fc5){zipdir(path[_0x44b7('0x21')](_0x27d96c,_0xe90edf),{'saveTo':path[_0x44b7('0x21')](_0x27d96c,util['format']('%s.%s',_0xe90edf,_0x44b7('0x27')))},function(_0x41a178,_0xe40ce4){rimraf(path[_0x44b7('0x21')](_0x27d96c,_0xe90edf),function(){});_0x420fc5(_0x44b7('0x28'));});});}})[_0x44b7('0x13')](function(){logger['info'](util[_0x44b7('0xe')](_0x44b7('0x29'),EXTRACTED_REPORT_ID,_0x44b7('0xf')));return analyticExtractedReport(_0x44b7('0x2a'),_0x2c2a29?util[_0x44b7('0xe')](_0x44b7('0x2b'),_0xe90edf,_0x2c2a29?_0x44b7('0x27'):_0x44b7('0x24')):null);});})[_0x44b7('0x2c')](function(_0x278383){logger[_0x44b7('0xd')](util['format'](_0x44b7('0x2d'),EXTRACTED_REPORT_ID,_0x44b7('0xf')),util['inspect'](_0x278383,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x44b7('0x2e'));})[_0x44b7('0x2f')](function(){process[_0x44b7('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8cb9ef4..2ae501b 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 _0xd257=['$[${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-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','map','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','sortBy','catch','rewrite','lodash','util','models','Interval','intervals','VoiceExtension','findAll','IntervalId','then','uniq','exten','filter','groupBy','queue','hasOwnProperty','priority','extension','find','extensions','push','format','type','context','VoiceExtensionId','outbound','Set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)='];(function(_0x17e10d,_0xd2880d){var _0x1af860=function(_0x917373){while(--_0x917373){_0x17e10d['push'](_0x17e10d['shift']());}};_0x1af860(++_0xd2880d);}(_0xd257,0xf6));var _0x7d25=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xd257[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0x7d25('0x0'));var util=require(_0x7d25('0x1'));function rewrite(_0x20e53b,_0x4350a2){var _0x4bc485=this;return _0x20e53b[_0x7d25('0x2')][_0x7d25('0x3')]['findAll']({'raw':!![]})['then'](function(_0x423cdf){_0x4bc485[_0x7d25('0x4')]=_0x423cdf;return _0x20e53b[_0x7d25('0x2')][_0x7d25('0x5')][_0x7d25('0x6')]({'where':{'IntervalId':_0x4350a2[_0x7d25('0x7')]},'raw':!![]});})[_0x7d25('0x8')](function(_0xb7e259){return _0x20e53b[_0x7d25('0x2')]['VoiceExtension'][_0x7d25('0x6')]({'where':{'exten':{'$in':_[_0x7d25('0x9')](_['map'](_0xb7e259,_0x7d25('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x24b68f){var _0x3a3abd=_['filter'](_0x24b68f,{'priority':'1'});var _0x1333b2=_[_0x7d25('0xb')](_0x24b68f,{'isApp':0x1});var _0x3fb294=_[_0x7d25('0xc')](_0x1333b2,'exten');var _0x45afc7=[_0x7d25('0xd'),'playback'];var _0x5ee93c=[];var _0x45f898=[];for(var _0x3f0dd1 in _0x3fb294){if(_0x3fb294[_0x7d25('0xe')](_0x3f0dd1)){_0x4bc485[_0x7d25('0xf')]=0x2;_0x4bc485['extensions']=[];_0x4bc485[_0x7d25('0x10')]=_[_0x7d25('0x11')](_0x3a3abd,{'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')]});_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0]['type'],'app':'Set','appdata':util[_0x7d25('0x14')]('CDR(type)=%s',_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')]),'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});if(_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')]==='inbound'){_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')],'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});}else if(_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')]===_0x7d25('0x18')){if(_0x4bc485[_0x7d25('0x10')]){_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x1a')+(_0x4bc485[_0x7d25('0x10')][_0x7d25('0x1b')]?'${EXTEN:'+_0x4bc485[_0x7d25('0x10')]['cutdigits']+'}':_0x7d25('0x1c')),'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0]['exten'],'priority':_0x4bc485['priority']++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});}_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')],'app':'Set','appdata':_0x7d25('0x1d')+_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')],'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0]['exten'],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});var _0x469dfc=_0x4bc485['priority']++;_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')],'app':'ExecIf','appdata':_0x7d25('0x1e')+(_0x469dfc+0x2)+_0x7d25('0x1f')+(_0x469dfc+0x1)+')','context':_0x3fb294[_0x3f0dd1][0x0]['context'],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x469dfc,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});if(_0x4bc485[_0x7d25('0x10')]){_0x4bc485['extensions'][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0]['type'],'app':_0x7d25('0x19'),'appdata':_0x4bc485[_0x7d25('0x10')]['cutdigits']?_0x7d25('0x20')+_0x4bc485[_0x7d25('0x10')][_0x7d25('0x1b')]+'}':_0x7d25('0x21'),'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0]['exten'],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});}_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0]['type'],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x22')+_0x3fb294[_0x3f0dd1][0x0]['VoiceExtensionId'],'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0]['VoiceExtensionId']});if(_0x4bc485['extension']&&_0x4bc485[_0x7d25('0x10')]['hasOwnProperty'](_0x7d25('0x23'))&&_0x4bc485[_0x7d25('0x10')]['recordingFormat']!==_0x7d25('0x24')){_0x4bc485[_0x7d25('0x12')]['push']({'type':_0x3fb294[_0x3f0dd1][0x0]['type'],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x25'),'context':_0x3fb294[_0x3f0dd1][0x0]['context'],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x26')+_0x4bc485[_0x7d25('0x10')][_0x7d25('0x23')]||_0x7d25('0x27'),'context':_0x3fb294[_0x3f0dd1][0x0]['context'],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0]['VoiceExtensionId']});}}_0x4bc485[_0x7d25('0x12')]['push']({'type':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')],'app':'Set','appdata':_0x7d25('0x28'),'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485['priority']++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x15')],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x29'),'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0]['type'],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x2a'),'context':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x16')],'exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'priority':_0x4bc485[_0x7d25('0xf')]++,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});for(var _0x2bc8b4=0x0,_0x3b6216=0x0;_0x2bc8b4<_0x3fb294[_0x3f0dd1][_0x7d25('0x2b')];_0x2bc8b4+=0x1,_0x3b6216=0x0){var _0x4a3af8=_0x3fb294[_0x3f0dd1][_0x2bc8b4];if(_0x4a3af8[_0x7d25('0x15')]){_0x4a3af8[_0x7d25('0x15')]=_0x4a3af8[_0x7d25('0x15')]['toLowerCase']();}var _0x4813e3=[];var _0x1adb34=[];delete _0x4a3af8['id'];delete _0x4a3af8[_0x7d25('0x2c')];delete _0x4a3af8['updatedAt'];var _0x415874=_0x4a3af8[_0x7d25('0x2d')]!=='*,*,*,*'?[_0x4a3af8[_0x7d25('0x2d')]]:_0x4a3af8[_0x7d25('0x7')]?_[_0x7d25('0x2e')](_['filter'](_0x4bc485[_0x7d25('0x4')],{'IntervalId':_0x4a3af8[_0x7d25('0x7')]}),_0x7d25('0x2d')):[];if(_0x4a3af8['hasOwnProperty']('tag')){if(_0x4a3af8[_0x7d25('0x2f')]&&_0x4a3af8['tag']!=='--'){_0x4813e3[_0x7d25('0x13')]({'type':_0x4a3af8[_0x7d25('0x15')],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x30')+_0x4a3af8[_0x7d25('0x2f')],'context':_0x4a3af8[_0x7d25('0x16')],'exten':_0x4a3af8[_0x7d25('0xa')],'priority':_0x415874[_0x7d25('0x2b')]+_0x4bc485[_0x7d25('0xf')]+_0x3b6216++,'VoiceExtensionId':_0x4a3af8[_0x7d25('0x17')]});}}if(_0x4a3af8[_0x7d25('0x15')]==='outbound'&&_0x4a3af8[_0x7d25('0xe')]('callerID')){if(_0x4a3af8[_0x7d25('0x31')]){_0x4813e3[_0x7d25('0x13')]({'type':_0x4a3af8[_0x7d25('0x15')],'app':_0x7d25('0x32'),'appdata':_0x7d25('0x33')+_0x4a3af8[_0x7d25('0x31')]+')','context':_0x4a3af8[_0x7d25('0x16')],'exten':_0x4a3af8['exten'],'priority':_0x415874[_0x7d25('0x2b')]+_0x4bc485[_0x7d25('0xf')]+_0x3b6216++,'VoiceExtensionId':_0x4a3af8[_0x7d25('0x17')]});}else{_0x4813e3[_0x7d25('0x13')]({'type':_0x4a3af8['type'],'app':_0x7d25('0x32'),'appdata':_0x7d25('0x34'),'context':_0x4a3af8[_0x7d25('0x16')],'exten':_0x4a3af8[_0x7d25('0xa')],'priority':_0x415874['length']+_0x4bc485[_0x7d25('0xf')]+_0x3b6216++,'VoiceExtensionId':_0x4a3af8[_0x7d25('0x17')]});}}if(_0x4a3af8['hasOwnProperty'](_0x7d25('0x35'))){if(_0x45afc7[_0x7d25('0x36')](_0x4a3af8[_0x7d25('0x37')]['toLowerCase']())>=0x0&&_0x4a3af8[_0x7d25('0x38')]!==_0x7d25('0x39')){if(_0x4a3af8[_0x7d25('0x35')]){_0x4813e3[_0x7d25('0x13')]({'type':_0x4a3af8[_0x7d25('0x15')],'app':_0x7d25('0x32'),'appdata':_0x7d25('0x3a'),'context':_0x4a3af8[_0x7d25('0x16')],'exten':_0x4a3af8[_0x7d25('0xa')],'priority':_0x415874[_0x7d25('0x2b')]+_0x4bc485[_0x7d25('0xf')]+_0x3b6216++,'VoiceExtensionId':_0x4a3af8[_0x7d25('0x17')]});_0x4813e3[_0x7d25('0x13')]({'type':_0x4a3af8[_0x7d25('0x15')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4a3af8[_0x7d25('0x16')],'exten':_0x4a3af8[_0x7d25('0xa')],'priority':_0x415874[_0x7d25('0x2b')]+_0x4bc485[_0x7d25('0xf')]+_0x3b6216++,'VoiceExtensionId':_0x4a3af8['VoiceExtensionId']});}else{_0x4813e3[_0x7d25('0x13')]({'type':_0x4a3af8[_0x7d25('0x15')],'app':_0x7d25('0x32'),'appdata':_0x7d25('0x3b'),'context':_0x4a3af8[_0x7d25('0x16')],'exten':_0x4a3af8[_0x7d25('0xa')],'priority':_0x415874[_0x7d25('0x2b')]+_0x4bc485[_0x7d25('0xf')]+_0x3b6216++,'VoiceExtensionId':_0x4a3af8['VoiceExtensionId']});_0x4813e3[_0x7d25('0x13')]({'type':_0x4a3af8[_0x7d25('0x15')],'app':_0x7d25('0x19'),'appdata':_0x7d25('0x3c'),'context':_0x4a3af8[_0x7d25('0x16')],'exten':_0x4a3af8[_0x7d25('0xa')],'priority':_0x415874[_0x7d25('0x2b')]+_0x4bc485[_0x7d25('0xf')]+_0x3b6216++,'VoiceExtensionId':_0x4a3af8[_0x7d25('0x17')]});}}}for(var _0x2a4f06=0x0;_0x2a4f06<_0x415874[_0x7d25('0x2b')];_0x2a4f06+=0x1){var _0x29ebdd=_0x4bc485[_0x7d25('0xf')]+_0x415874[_0x7d25('0x2b')];var _0x47f8f0=_0x2a4f06===_0x415874[_0x7d25('0x2b')]-0x1?_0x4bc485[_0x7d25('0xf')]+_0x4813e3[_0x7d25('0x2b')]+_0x1adb34[_0x7d25('0x2b')]+0x2:_0x4bc485['priority']+_0x2a4f06+0x1;_0x4813e3[_0x7d25('0x3d')](_0x2a4f06,0x0,{'type':_0x4a3af8['type'],'app':_0x7d25('0x3e'),'appdata':_0x415874[_0x2a4f06]+'?'+_0x4a3af8['context']+_0x7d25('0x3f')+_0x29ebdd+':'+_0x4a3af8['context']+_0x7d25('0x3f')+_0x47f8f0,'exten':_0x4a3af8['exten'],'context':_0x4a3af8[_0x7d25('0x16')],'priority':_0x4bc485['priority']+_0x2a4f06,'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0]['VoiceExtensionId']});}_0x4a3af8[_0x7d25('0xf')]=_0x4813e3[_0x7d25('0x2b')]?_[_0x7d25('0x40')](_0x4813e3)[_0x7d25('0xf')]+0x1:_0x4bc485[_0x7d25('0xf')];_0x4bc485[_0x7d25('0xf')]=(_0x1adb34[_0x7d25('0x2b')]?_[_0x7d25('0x40')](_0x1adb34)[_0x7d25('0xf')]:_0x4a3af8[_0x7d25('0xf')])+0x1;_0x4bc485[_0x7d25('0x12')]=_[_0x7d25('0x41')](_0x4bc485[_0x7d25('0x12')],_0x4813e3,[_0x4a3af8],_0x1adb34);}_0x4bc485[_0x7d25('0x12')][_0x7d25('0x13')]({'type':_0x3fb294[_0x3f0dd1][0x0]['type'],'app':'Hangup','exten':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0xa')],'context':_0x3fb294[_0x3f0dd1][0x0]['context'],'priority':_0x4bc485['priority'],'VoiceExtensionId':_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]});_0x5ee93c[_0x7d25('0x13')](_0x3fb294[_0x3f0dd1][0x0][_0x7d25('0x17')]);_0x45f898=_['concat'](_0x45f898,_0x4bc485[_0x7d25('0x12')]);}}return _0x20e53b['transaction'](function(_0xfee942){return _0x20e53b[_0x7d25('0x2')][_0x7d25('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5ee93c}},'transaction':_0xfee942})['then'](function(_0x55019b){return _0x20e53b['models'][_0x7d25('0x5')]['bulkCreate'](_[_0x7d25('0x42')](_0x45f898,'priority'),{'transaction':_0xfee942});});});})[_0x7d25('0x43')](function(_0x587d71){console['error'](_0x587d71);});}exports[_0x7d25('0x44')]=rewrite; \ No newline at end of file +var _0x2f35=['exten','CAST(priority\x20AS\x20UNSIGNED)','filter','playback','hasOwnProperty','priority','extensions','extension','push','type','Set','format','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','catch','rewrite','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map'];(function(_0x323b83,_0x3d791e){var _0x1ce44f=function(_0x2ac607){while(--_0x2ac607){_0x323b83['push'](_0x323b83['shift']());}};_0x1ce44f(++_0x3d791e);}(_0x2f35,0x146));var _0x52f3=function(_0x20c893,_0xbef2b4){_0x20c893=_0x20c893-0x0;var _0xc705e8=_0x2f35[_0x20c893];return _0xc705e8;};'use strict';var _=require('lodash');var util=require(_0x52f3('0x0'));function rewrite(_0x452eba,_0x34ef8b){var _0x39c0ee=this;return _0x452eba[_0x52f3('0x1')][_0x52f3('0x2')][_0x52f3('0x3')]({'raw':!![]})[_0x52f3('0x4')](function(_0x32fb8c){_0x39c0ee['intervals']=_0x32fb8c;return _0x452eba[_0x52f3('0x1')][_0x52f3('0x5')][_0x52f3('0x3')]({'where':{'IntervalId':_0x34ef8b[_0x52f3('0x6')]},'raw':!![]});})['then'](function(_0x5e076e){return _0x452eba[_0x52f3('0x1')][_0x52f3('0x5')][_0x52f3('0x3')]({'where':{'exten':{'$in':_[_0x52f3('0x7')](_[_0x52f3('0x8')](_0x5e076e,_0x52f3('0x9')))}},'order':[{'raw':_0x52f3('0xa')}],'raw':!![]});})[_0x52f3('0x4')](function(_0x3082b0){var _0x25805d=_[_0x52f3('0xb')](_0x3082b0,{'priority':'1'});var _0x15bd98=_[_0x52f3('0xb')](_0x3082b0,{'isApp':0x1});var _0x19c4a4=_['groupBy'](_0x15bd98,_0x52f3('0x9'));var _0x21a06f=['queue',_0x52f3('0xc')];var _0x1835d6=[];var _0x276f97=[];for(var _0x434c6f in _0x19c4a4){if(_0x19c4a4[_0x52f3('0xd')](_0x434c6f)){_0x39c0ee[_0x52f3('0xe')]=0x2;_0x39c0ee[_0x52f3('0xf')]=[];_0x39c0ee[_0x52f3('0x10')]=_['find'](_0x25805d,{'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')]});_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':util[_0x52f3('0x14')]('CDR(type)=%s',_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')]),'context':_0x19c4a4[_0x434c6f][0x0]['context'],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x39c0ee[_0x52f3('0xe')]++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});if(_0x19c4a4[_0x434c6f][0x0]['type']===_0x52f3('0x16')){_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x17')+_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')],'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0]['exten'],'priority':_0x39c0ee['priority']++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});}else if(_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')]===_0x52f3('0x19')){if(_0x39c0ee[_0x52f3('0x10')]){_0x39c0ee[_0x52f3('0xf')]['push']({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x1a')+(_0x39c0ee[_0x52f3('0x10')][_0x52f3('0x1b')]?'${EXTEN:'+_0x39c0ee['extension'][_0x52f3('0x1b')]+'}':'${EXTEN}'),'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0]['exten'],'priority':_0x39c0ee[_0x52f3('0xe')]++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0]['VoiceExtensionId']});}_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x17')+_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')],'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x39c0ee['priority']++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0]['VoiceExtensionId']});var _0x53ef9d=_0x39c0ee[_0x52f3('0xe')]++;_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':'ExecIf','appdata':_0x52f3('0x1c')+(_0x53ef9d+0x2)+_0x52f3('0x1d')+(_0x53ef9d+0x1)+')','context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x53ef9d,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});if(_0x39c0ee['extension']){_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':_0x39c0ee[_0x52f3('0x10')]['cutdigits']?_0x52f3('0x1e')+_0x39c0ee[_0x52f3('0x10')][_0x52f3('0x1b')]+'}':_0x52f3('0x1f'),'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0]['exten'],'priority':_0x39c0ee['priority']++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});}_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x20')+_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')],'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x39c0ee[_0x52f3('0xe')]++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});if(_0x39c0ee[_0x52f3('0x10')]&&_0x39c0ee[_0x52f3('0x10')][_0x52f3('0xd')](_0x52f3('0x21'))&&_0x39c0ee[_0x52f3('0x10')][_0x52f3('0x21')]!==_0x52f3('0x22')){_0x39c0ee['extensions'][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x19c4a4[_0x434c6f][0x0]['context'],'exten':_0x19c4a4[_0x434c6f][0x0]['exten'],'priority':_0x39c0ee[_0x52f3('0xe')]++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x39c0ee[_0x52f3('0x10')]['recordingFormat']||_0x52f3('0x23'),'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x39c0ee['priority']++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});}}_0x39c0ee[_0x52f3('0xf')][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x24'),'context':_0x19c4a4[_0x434c6f][0x0]['context'],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x39c0ee[_0x52f3('0xe')]++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0]['VoiceExtensionId']});_0x39c0ee['extensions'][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':'Set','appdata':_0x52f3('0x25'),'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x39c0ee['priority']++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0]['VoiceExtensionId']});_0x39c0ee[_0x52f3('0xf')]['push']({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':'Set','appdata':_0x52f3('0x26'),'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'priority':_0x39c0ee[_0x52f3('0xe')]++,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0]['VoiceExtensionId']});for(var _0x43e2b7=0x0,_0x4dc85b=0x0;_0x43e2b7<_0x19c4a4[_0x434c6f][_0x52f3('0x27')];_0x43e2b7+=0x1,_0x4dc85b=0x0){var _0x3076a0=_0x19c4a4[_0x434c6f][_0x43e2b7];if(_0x3076a0[_0x52f3('0x12')]){_0x3076a0[_0x52f3('0x12')]=_0x3076a0[_0x52f3('0x12')][_0x52f3('0x28')]();}var _0x59a707=[];var _0x113c73=[];delete _0x3076a0['id'];delete _0x3076a0[_0x52f3('0x29')];delete _0x3076a0['updatedAt'];var _0x712f3=_0x3076a0[_0x52f3('0x2a')]!==_0x52f3('0x2b')?[_0x3076a0[_0x52f3('0x2a')]]:_0x3076a0[_0x52f3('0x6')]?_[_0x52f3('0x8')](_[_0x52f3('0xb')](_0x39c0ee[_0x52f3('0x2c')],{'IntervalId':_0x3076a0['IntervalId']}),_0x52f3('0x2a')):[];if(_0x3076a0[_0x52f3('0xd')](_0x52f3('0x2d'))){if(_0x3076a0[_0x52f3('0x2d')]&&_0x3076a0[_0x52f3('0x2d')]!=='--'){_0x59a707[_0x52f3('0x11')]({'type':_0x3076a0['type'],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x2e')+_0x3076a0['tag'],'context':_0x3076a0[_0x52f3('0x18')],'exten':_0x3076a0[_0x52f3('0x9')],'priority':_0x712f3[_0x52f3('0x27')]+_0x39c0ee[_0x52f3('0xe')]+_0x4dc85b++,'VoiceExtensionId':_0x3076a0[_0x52f3('0x15')]});}}if(_0x3076a0['type']===_0x52f3('0x19')&&_0x3076a0[_0x52f3('0xd')]('callerID')){if(_0x3076a0['callerID']){_0x59a707[_0x52f3('0x11')]({'type':_0x3076a0['type'],'app':'ExecIf','appdata':_0x52f3('0x2f')+_0x3076a0[_0x52f3('0x30')]+')','context':_0x3076a0[_0x52f3('0x18')],'exten':_0x3076a0[_0x52f3('0x9')],'priority':_0x712f3[_0x52f3('0x27')]+_0x39c0ee[_0x52f3('0xe')]+_0x4dc85b++,'VoiceExtensionId':_0x3076a0[_0x52f3('0x15')]});}else{_0x59a707['push']({'type':_0x3076a0['type'],'app':_0x52f3('0x31'),'appdata':_0x52f3('0x32'),'context':_0x3076a0[_0x52f3('0x18')],'exten':_0x3076a0[_0x52f3('0x9')],'priority':_0x712f3['length']+_0x39c0ee['priority']+_0x4dc85b++,'VoiceExtensionId':_0x3076a0[_0x52f3('0x15')]});}}if(_0x3076a0[_0x52f3('0xd')](_0x52f3('0x33'))){if(_0x21a06f['indexOf'](_0x3076a0['app'][_0x52f3('0x28')]())>=0x0&&_0x3076a0[_0x52f3('0x34')]!==_0x52f3('0x35')){if(_0x3076a0[_0x52f3('0x33')]){_0x59a707['push']({'type':_0x3076a0[_0x52f3('0x12')],'app':_0x52f3('0x31'),'appdata':_0x52f3('0x36'),'context':_0x3076a0[_0x52f3('0x18')],'exten':_0x3076a0[_0x52f3('0x9')],'priority':_0x712f3['length']+_0x39c0ee[_0x52f3('0xe')]+_0x4dc85b++,'VoiceExtensionId':_0x3076a0[_0x52f3('0x15')]});_0x59a707[_0x52f3('0x11')]({'type':_0x3076a0['type'],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x37'),'context':_0x3076a0[_0x52f3('0x18')],'exten':_0x3076a0['exten'],'priority':_0x712f3[_0x52f3('0x27')]+_0x39c0ee['priority']+_0x4dc85b++,'VoiceExtensionId':_0x3076a0[_0x52f3('0x15')]});}else{_0x59a707[_0x52f3('0x11')]({'type':_0x3076a0['type'],'app':'ExecIf','appdata':_0x52f3('0x38'),'context':_0x3076a0[_0x52f3('0x18')],'exten':_0x3076a0[_0x52f3('0x9')],'priority':_0x712f3[_0x52f3('0x27')]+_0x39c0ee['priority']+_0x4dc85b++,'VoiceExtensionId':_0x3076a0[_0x52f3('0x15')]});_0x59a707['push']({'type':_0x3076a0['type'],'app':_0x52f3('0x13'),'appdata':_0x52f3('0x39'),'context':_0x3076a0['context'],'exten':_0x3076a0[_0x52f3('0x9')],'priority':_0x712f3[_0x52f3('0x27')]+_0x39c0ee[_0x52f3('0xe')]+_0x4dc85b++,'VoiceExtensionId':_0x3076a0['VoiceExtensionId']});}}}for(var _0x196fc6=0x0;_0x196fc6<_0x712f3['length'];_0x196fc6+=0x1){var _0x1f0863=_0x39c0ee[_0x52f3('0xe')]+_0x712f3['length'];var _0x2bad13=_0x196fc6===_0x712f3['length']-0x1?_0x39c0ee['priority']+_0x59a707['length']+_0x113c73[_0x52f3('0x27')]+0x2:_0x39c0ee[_0x52f3('0xe')]+_0x196fc6+0x1;_0x59a707[_0x52f3('0x3a')](_0x196fc6,0x0,{'type':_0x3076a0['type'],'app':'GotoIfTime','appdata':_0x712f3[_0x196fc6]+'?'+_0x3076a0[_0x52f3('0x18')]+_0x52f3('0x3b')+_0x1f0863+':'+_0x3076a0['context']+_0x52f3('0x3b')+_0x2bad13,'exten':_0x3076a0[_0x52f3('0x9')],'context':_0x3076a0[_0x52f3('0x18')],'priority':_0x39c0ee[_0x52f3('0xe')]+_0x196fc6,'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});}_0x3076a0[_0x52f3('0xe')]=_0x59a707[_0x52f3('0x27')]?_[_0x52f3('0x3c')](_0x59a707)['priority']+0x1:_0x39c0ee[_0x52f3('0xe')];_0x39c0ee[_0x52f3('0xe')]=(_0x113c73[_0x52f3('0x27')]?_[_0x52f3('0x3c')](_0x113c73)[_0x52f3('0xe')]:_0x3076a0[_0x52f3('0xe')])+0x1;_0x39c0ee[_0x52f3('0xf')]=_[_0x52f3('0x3d')](_0x39c0ee[_0x52f3('0xf')],_0x59a707,[_0x3076a0],_0x113c73);}_0x39c0ee['extensions'][_0x52f3('0x11')]({'type':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x12')],'app':'Hangup','exten':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x9')],'context':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x18')],'priority':_0x39c0ee['priority'],'VoiceExtensionId':_0x19c4a4[_0x434c6f][0x0][_0x52f3('0x15')]});_0x1835d6['push'](_0x19c4a4[_0x434c6f][0x0]['VoiceExtensionId']);_0x276f97=_[_0x52f3('0x3d')](_0x276f97,_0x39c0ee[_0x52f3('0xf')]);}}return _0x452eba[_0x52f3('0x3e')](function(_0x474342){return _0x452eba[_0x52f3('0x1')][_0x52f3('0x5')][_0x52f3('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x1835d6}},'transaction':_0x474342})[_0x52f3('0x4')](function(_0x3efe31){return _0x452eba['models']['VoiceExtension'][_0x52f3('0x40')](_['sortBy'](_0x276f97,'priority'),{'transaction':_0x474342});});});})[_0x52f3('0x41')](function(_0x32fc84){console['error'](_0x32fc84);});}exports[_0x52f3('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index b4bf2ae..b42e17f 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 _0x77a4=['CmContact','createReadStream','duplicate','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','length','find','Duplicate\x20Contact','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','fromQuery','id\x20IN\x20?','cm_hopper_final','VoiceQueue','findAll','outbound','CmList','Lists','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','BlackLists','Campaign','get','dialCheckDuplicateType','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x77a4,0xdf));var _0x477a=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x77a4[_0x3ce2c4];return _0x4047c1;};'use strict';var BPromise=require('bluebird');var util=require(_0x477a('0x0'));var _=require(_0x477a('0x1'));var fs=require('fs');var squel=require(_0x477a('0x2'));var Papa=require(_0x477a('0x3'));var Redis=require(_0x477a('0x4'));var db=require(_0x477a('0x5'))['db'];var config=require(_0x477a('0x6'));var logger=require(_0x477a('0x7'))(_0x477a('0x8'));config[_0x477a('0x9')]=_[_0x477a('0xa')](config[_0x477a('0x9')],{'host':_0x477a('0xb'),'port':0x18eb});var socket=require(_0x477a('0xc'))(new Redis(config[_0x477a('0x9')]));require(_0x477a('0xd'))[_0x477a('0xe')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x477a('0xf')||process[_0x477a('0x10')][0x2]==='null'){throw new Error(_0x477a('0x11'));}var FILEPATH=process[_0x477a('0x10')][0x2];if(!process[_0x477a('0x10')][0x3]||process['argv'][0x3]===_0x477a('0xf')||process[_0x477a('0x10')][0x3]===_0x477a('0x12')||!process[_0x477a('0x10')][0x4]||process[_0x477a('0x10')][0x4]===_0x477a('0xf')||process[_0x477a('0x10')][0x4]===_0x477a('0x12')){throw new Error(_0x477a('0x13'));}var FIELDS=_[_0x477a('0x14')](process[_0x477a('0x10')][0x3][_0x477a('0x15')](','),process[_0x477a('0x10')][0x4][_0x477a('0x15')](','));if(!process['argv'][0x5]||process[_0x477a('0x10')][0x5]==='undefined'||process[_0x477a('0x10')][0x5]===_0x477a('0x12')){throw new Error(_0x477a('0x16'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x477a('0x10')][0x6]&&process[_0x477a('0x10')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x477a('0x12')?process[_0x477a('0x10')][0x6]:null;var DUPLICATES=process[_0x477a('0x10')][0x7]&&process[_0x477a('0x10')][0x7]!==_0x477a('0xf')&&process['argv'][0x7]!==_0x477a('0x12')?process[_0x477a('0x10')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]==='undefined'||process[_0x477a('0x10')][0x8]===_0x477a('0x12')){throw new Error(_0x477a('0x17'));}var SOCKET_TIMESTAMP=process[_0x477a('0x10')][0x8];}catch(_0x31c21e){logger[_0x477a('0x18')](_0x31c21e);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(_0x5bc842,_0x3d6b3d,_0x42452f,_0x4a7bf0){var _0xd755ce={'message':_0x3d6b3d};_0xd755ce[_0x5bc842]=!![];if(_0x42452f){_0xd755ce['contact']=_0x42452f;}if(_0x4a7bf0){_0xd755ce[_0x477a('0x19')]=_0x4a7bf0;}return _0xd755ce;}function isEmail(_0x5cdfdb){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))*$/[_0x477a('0x1a')](_0x5cdfdb);}function checkRow(_0x1e6723,_0x4721fb,_0x37dd20){return new BPromise(function(_0x5a8282,_0x5b34c2){if(_['isNil'](_0x1e6723)){return _0x5b34c2(handleCheckRowError(_0x477a('0x18'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x37dd20));}if(_0x1e6723[_0x477a('0x1b')]&&_0x1e6723['errors']['length']){var _0x54ce80=_[_0x477a('0x1c')](_0x1e6723[_0x477a('0x1b')],_0x477a('0x1d'))[_0x477a('0x1e')](';');return _0x5b34c2(handleCheckRowError('error',_0x54ce80,null,_0x37dd20));}var _0x112782={};for(var _0x521f75 in FIELDS){if(FIELDS[_0x477a('0x1f')](_0x521f75)&&FIELDS[_0x521f75]){_0x112782[_0x521f75]=_0x1e6723[_0x477a('0x20')][0x0][FIELDS[_0x521f75]]||_0x1e6723[_0x477a('0x20')][0x0]['\ufeff'+FIELDS[_0x521f75]];}}if(!_0x112782[_0x477a('0x21')]){return _0x5b34c2(handleCheckRowError(_0x477a('0x18'),_0x477a('0x22'),null,_0x37dd20));}if(!_0x112782['phone']){return _0x5b34c2(handleCheckRowError('error',_0x477a('0x23'),null,_0x37dd20));}if(_0x112782[_0x477a('0x24')]){var _0x46e0e=moment(_0x112782['birthDate'],'YYYY-MM-DD');if(!_0x46e0e[_0x477a('0x25')]()){return _0x5b34c2(handleCheckRowError(_0x477a('0x18'),_0x477a('0x26'),null,_0x37dd20));}}if(_0x112782[_0x477a('0x27')]){if(!isEmail(_0x112782[_0x477a('0x27')])){return _0x5b34c2(handleCheckRowError(_0x477a('0x18'),_0x477a('0x28'),null,_0x37dd20));}}_0x112782['ListId']=LISTID;_0x112782['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x477a('0x29')]&&_0x4721fb){var _0x3dd01f={};for(var _0x5ca8cf=0x0,_0x3810f0=DUPLICATES['length'];_0x5ca8cf<_0x3810f0;_0x5ca8cf+=0x1){_0x3dd01f[DUPLICATES[_0x5ca8cf]]=_0x112782[DUPLICATES[_0x5ca8cf]];}var _0x306bf5=_[_0x477a('0x2a')](_0x4721fb,_0x3dd01f);if(_0x306bf5){return _0x5b34c2(handleCheckRowError('duplicate',_0x477a('0x2b'),_0x306bf5,_0x37dd20));}}return db['CmContact']['create'](_0x112782,{'raw':!![],'hooks':![],'fields':_[_0x477a('0x2c')](_0x112782)})[_0x477a('0x2d')](function(_0x130349){if(DUPLICATES&&DUPLICATES[_0x477a('0x29')]&&_0x4721fb){_0x4721fb[_0x477a('0x2e')](_[_0x477a('0x2f')](_0x112782,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x130349['id'];return _0x5a8282();})['catch'](function(_0x5e61ae){return _0x5b34c2(handleCheckRowError('error',_0x477a('0x30')+(_0x5e61ae['message']||JSON[_0x477a('0x31')](_0x5e61ae)),null,_0x37dd20));});});}function checkHopper(){function _0x518916(){return function(_0x5c4942){logger[_0x477a('0x18')](_0x477a('0x32'),_0x477a('0x33'),util[_0x477a('0x34')](_0x5c4942,{'showHidden':![],'depth':null}));};}var _0x17ed33=function(_0x30ed0c,_0x1c5468){var _0x498eb9=squel[_0x477a('0x35')]()[_0x477a('0x36')](_0x477a('0x37'))['fromQuery']([_0x477a('0x38'),_0x477a('0x39'),_0x477a('0x3a'),_0x477a('0x3b'),_0x1c5468,'createdAt',_0x477a('0x3c')],squel[_0x477a('0x3d')]()[_0x477a('0x3e')](_0x477a('0x38'),_0x477a('0x38'))[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x39'))[_0x477a('0x3e')]('id','ContactId')[_0x477a('0x3e')](LISTID[_0x477a('0x40')](),'ListId')['field'](_0x30ed0c['id'][_0x477a('0x40')](),_0x1c5468)[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x41'))['field'](_0x477a('0x3f'),'updatedAt')[_0x477a('0x42')](_0x477a('0x43'))[_0x477a('0x44')](_0x477a('0x45'))[_0x477a('0x44')](_0x477a('0x46'),LISTID[_0x477a('0x40')]())['where'](_0x477a('0x47'))['where'](_0x477a('0x48'),squel[_0x477a('0x3d')]()[_0x477a('0x3e')](_0x477a('0x38'))[_0x477a('0x42')](_0x477a('0x37'))[_0x477a('0x44')](_0x1c5468+_0x477a('0x49'),_0x30ed0c['id'][_0x477a('0x40')]())))[_0x477a('0x40')]();return _0x498eb9;};var _0x1476e3=function(_0x23f0e6,_0x775423){var _0x53b194=squel['insert']()['into'](_0x477a('0x37'))[_0x477a('0x4a')]([_0x477a('0x38'),'scheduledAt',_0x477a('0x3a'),_0x477a('0x3b'),_0x775423,_0x477a('0x41'),'updatedAt'],squel[_0x477a('0x3d')]()[_0x477a('0x3e')]('phone',_0x477a('0x38'))[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x39'))[_0x477a('0x3e')]('id',_0x477a('0x3a'))['field'](LISTID[_0x477a('0x40')](),_0x477a('0x3b'))[_0x477a('0x3e')](_0x23f0e6['id'][_0x477a('0x40')](),_0x775423)[_0x477a('0x3e')](_0x477a('0x3f'),'createdAt')['field'](_0x477a('0x3f'),'updatedAt')[_0x477a('0x42')]('cm_contacts')['where'](_0x477a('0x45'))[_0x477a('0x44')](_0x477a('0x46'),LISTID[_0x477a('0x40')]())[_0x477a('0x44')](_0x477a('0x4b'),squel['str'](hopperContacts))[_0x477a('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x477a('0x44')](_0x477a('0x48'),squel[_0x477a('0x3d')]()[_0x477a('0x3e')]('calleridnum')[_0x477a('0x42')](_0x477a('0x4c'))[_0x477a('0x44')](_0x775423+_0x477a('0x49'),_0x23f0e6['id'][_0x477a('0x40')]()))[_0x477a('0x44')](_0x477a('0x48'),squel['select']()[_0x477a('0x3e')](_0x477a('0x38'))[_0x477a('0x42')](_0x477a('0x37'))['where'](_0x775423+_0x477a('0x49'),_0x23f0e6['id'][_0x477a('0x40')]())))[_0x477a('0x40')]();return _0x53b194;};function _0xa9772(_0x9cb862,_0x53d38f){var _0xf54e14=squel[_0x477a('0x35')]()[_0x477a('0x36')](_0x477a('0x37'))['fromQuery'](['phone','scheduledAt',_0x477a('0x3a'),'ListId',_0x53d38f,_0x477a('0x41'),_0x477a('0x3c')],squel['select']()[_0x477a('0x3e')](_0x477a('0x38'),_0x477a('0x38'))[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x39'))['field']('id',_0x477a('0x3a'))[_0x477a('0x3e')](LISTID[_0x477a('0x40')](),_0x477a('0x3b'))[_0x477a('0x3e')](_0x9cb862['id']['toString'](),_0x53d38f)[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x41'))[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x3c'))[_0x477a('0x42')](_0x477a('0x43'))[_0x477a('0x44')](_0x477a('0x45'))[_0x477a('0x44')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0x477a('0x4b'),squel['str'](hopperContacts))[_0x477a('0x44')](_0x477a('0x47')))[_0x477a('0x40')]();return _0xf54e14;}function _0x189ad3(_0x5992a0,_0x426fd3){var _0x3914d1=squel['insert']()[_0x477a('0x36')]('cm_hopper_black')[_0x477a('0x4a')]([_0x477a('0x38'),_0x477a('0x3a'),_0x477a('0x3b'),_0x426fd3,'createdAt','updatedAt'],squel['select']()[_0x477a('0x3e')](_0x477a('0x38'),'phone')['field']('id',_0x477a('0x3a'))[_0x477a('0x3e')](LISTID['toString'](),_0x477a('0x3b'))[_0x477a('0x3e')](_0x5992a0['id']['toString'](),_0x426fd3)[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x41'))[_0x477a('0x3e')](_0x477a('0x3f'),_0x477a('0x3c'))[_0x477a('0x42')]('cm_contacts')[_0x477a('0x44')](_0x477a('0x45'))[_0x477a('0x44')](_0x477a('0x46'),LISTID[_0x477a('0x40')]())['where'](_0x477a('0x4b'),squel['str'](hopperContacts))[_0x477a('0x44')](_0x477a('0x47')))[_0x477a('0x40')]();return _0x3914d1;}return db[_0x477a('0x4d')][_0x477a('0x4e')]({'where':{'type':_0x477a('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x477a('0x50')],'as':_0x477a('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x2f965c){var _0x25755c=[];if(_0x2f965c){var _0x55f2db;for(var _0x51107c=0x0,_0x39a45b;_0x51107c<_0x2f965c[_0x477a('0x29')];_0x51107c+=0x1){_0x39a45b=_0x2f965c[_0x51107c]['get']({'plain':!![]});switch(_0x39a45b['dialCheckDuplicateType']){case _0x477a('0x52'):_0x25755c[_0x477a('0x2e')](db[_0x477a('0x53')][_0x477a('0x54')](_0x1476e3(_0x39a45b,_0x477a('0x55')))[_0x477a('0x2d')](function(){})[_0x477a('0x56')](_0x518916()));break;case _0x477a('0x57'):_0x25755c[_0x477a('0x2e')](db[_0x477a('0x53')][_0x477a('0x54')](_0x17ed33(_0x39a45b,_0x477a('0x55')))[_0x477a('0x2d')](function(){})[_0x477a('0x56')](_0x518916()));break;default:_0x25755c[_0x477a('0x2e')](db['sequelize'][_0x477a('0x54')](_0xa9772(_0x39a45b,_0x477a('0x55')))[_0x477a('0x2d')](function(){})['catch'](_0x518916()));}}}return _0x25755c;})[_0x477a('0x58')]()[_0x477a('0x2d')](function(){return db[_0x477a('0x4d')][_0x477a('0x4e')]({'where':{'type':_0x477a('0x4f')},'attributes':['id'],'include':[{'model':db[_0x477a('0x50')],'as':_0x477a('0x59'),'where':{'id':LISTID}}]})[_0x477a('0x2d')](function(_0x1a4a2c){var _0x4b77ec=[];if(_0x1a4a2c){var _0xf18e0d;for(var _0x3428e6=0x0,_0x574b0e;_0x3428e6<_0x1a4a2c['length'];_0x3428e6+=0x1){_0x574b0e=_0x1a4a2c[_0x3428e6]['get']({'plain':!![]});_0x4b77ec[_0x477a('0x2e')](db[_0x477a('0x53')][_0x477a('0x54')](_0x189ad3(_0x574b0e,'VoiceQueueId'))[_0x477a('0x2d')](function(){})['catch'](_0x518916()));}}return _0x4b77ec;})['all']();})[_0x477a('0x2d')](function(){return db[_0x477a('0x5a')][_0x477a('0x4e')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x477a('0x2d')](function(_0x26ffb9){var _0x1c9cd5=[];if(_0x26ffb9){for(var _0x4ddb9e=0x0,_0x1297f4;_0x4ddb9e<_0x26ffb9[_0x477a('0x29')];_0x4ddb9e+=0x1){_0x1297f4=_0x26ffb9[_0x4ddb9e][_0x477a('0x5b')]({'plain':!![]});switch(_0x1297f4[_0x477a('0x5c')]){case _0x477a('0x52'):_0x1c9cd5[_0x477a('0x2e')](db[_0x477a('0x53')]['query'](_0x1476e3(_0x1297f4,'CampaignId'))[_0x477a('0x2d')](function(){})[_0x477a('0x56')](_0x518916()));break;case _0x477a('0x57'):_0x1c9cd5[_0x477a('0x2e')](db[_0x477a('0x53')]['query'](_0x17ed33(_0x1297f4,_0x477a('0x5d')))[_0x477a('0x2d')](function(){})[_0x477a('0x56')](_0x518916()));break;default:_0x1c9cd5['push'](db[_0x477a('0x53')]['query'](_0xa9772(_0x1297f4,_0x477a('0x5d')))[_0x477a('0x2d')](function(){})['catch'](_0x518916()));}}}return _0x1c9cd5;})['all']();})[_0x477a('0x2d')](function(){return db[_0x477a('0x5a')][_0x477a('0x4e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x477a('0x59'),'where':{'id':LISTID}}]})[_0x477a('0x2d')](function(_0x5411a4){var _0x3712e5=[];if(_0x5411a4){for(var _0x313611=0x0,_0x56dab7;_0x313611<_0x5411a4[_0x477a('0x29')];_0x313611+=0x1){_0x56dab7=_0x5411a4[_0x313611][_0x477a('0x5b')]({'plain':!![]});_0x3712e5['push'](db[_0x477a('0x53')]['query'](_0x189ad3(_0x56dab7,'CampaignId'))[_0x477a('0x2d')](function(){})['catch'](_0x518916()));}}return _0x3712e5;})['all']();})['catch'](function(_0x3e34d4){logger[_0x477a('0x18')](_0x477a('0x5e'),'generalCheckHopper',_0x3e34d4['message']);});}var processPromises=function(_0x594dae){return BPromise[_0x477a('0x58')](promises)['then'](function(_0x12bf09){})[_0x477a('0x56')](function(_0x4b5549){logger[_0x477a('0x18')](_0x477a('0x5f'),JSON[_0x477a('0x31')](_0x4b5549));})['finally'](function(){socket[_0x477a('0x60')](_0x477a('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x594dae){return _0x594dae['resume']();}});};var endCsv=function(){return BPromise[_0x477a('0x62')]()[_0x477a('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x477a('0x2d')](function(){socket[_0x477a('0x60')](_0x477a('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x477a('0x63')](FILEPATH);}catch(_0x2ba9ba){logger['error'](_0x477a('0x64'),JSON[_0x477a('0x31')](_0x2ba9ba));}finally{process[_0x477a('0x65')](0x0);}});};process['on'](_0x477a('0x66'),function(){logger[_0x477a('0x67')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x477a('0x15')](',');return db[_0x477a('0x68')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1fcd32){var _0x51dca8=fs[_0x477a('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x51dca8,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4c6e9b,_0x1fe9d2){total+=0x1;var _0x31e111=total;promises[_0x477a('0x2e')](checkRow(_0x4c6e9b,_0x1fcd32,_0x31e111)[_0x477a('0x2d')](function(){success+=0x1;})['catch'](function(_0x3e9866){if(_0x3e9866[_0x477a('0x18')]){errors+=0x1;delete _0x3e9866[_0x477a('0x18')];}else if(_0x3e9866[_0x477a('0x6a')]){duplicates+=0x1;delete _0x3e9866[_0x477a('0x6a')];}rows[_0x477a('0x2e')](_0x3e9866);}));if(total%0xc8===0x0){_0x1fe9d2['pause']();return processPromises(_0x1fe9d2);}},'complete':function(){return processPromises()[_0x477a('0x2d')](function(){logger[_0x477a('0x67')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3b39bd,_0x1a89e2){logger[_0x477a('0x67')](_0x477a('0x6b'),JSON[_0x477a('0x31')](_0x3b39bd));endCsv();}});})['catch'](function(_0x504dd3){logger[_0x477a('0x18')](_0x477a('0x6c'),JSON[_0x477a('0x31')](_0x504dd3));});}main(); \ No newline at end of file +var _0xb6c9=['birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','select','field','phone','ContactId','toString','NOW()','createdAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','updatedAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','papaparse','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid'];(function(_0x695fb9,_0x19d6ac){var _0x502e29=function(_0x260c4c){while(--_0x260c4c){_0x695fb9['push'](_0x695fb9['shift']());}};_0x502e29(++_0x19d6ac);}(_0xb6c9,0x12d));var _0x9b6c=function(_0x3a0614,_0x4b6627){_0x3a0614=_0x3a0614-0x0;var _0x12bba7=_0xb6c9[_0x3a0614];return _0x12bba7;};'use strict';var BPromise=require('bluebird');var util=require(_0x9b6c('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x9b6c('0x1'));var Redis=require('ioredis');var db=require(_0x9b6c('0x2'))['db'];var config=require(_0x9b6c('0x3'));var logger=require('../../../config/logger')('api');config[_0x9b6c('0x4')]=_[_0x9b6c('0x5')](config['redis'],{'host':_0x9b6c('0x6'),'port':0x18eb});var socket=require(_0x9b6c('0x7'))(new Redis(config[_0x9b6c('0x4')]));require(_0x9b6c('0x8'))[_0x9b6c('0x9')](socket);try{if(!process['argv'][0x2]||process[_0x9b6c('0xa')][0x2]===_0x9b6c('0xb')||process[_0x9b6c('0xa')][0x2]==='null'){throw new Error(_0x9b6c('0xc'));}var FILEPATH=process[_0x9b6c('0xa')][0x2];if(!process[_0x9b6c('0xa')][0x3]||process[_0x9b6c('0xa')][0x3]==='undefined'||process['argv'][0x3]===_0x9b6c('0xd')||!process[_0x9b6c('0xa')][0x4]||process[_0x9b6c('0xa')][0x4]===_0x9b6c('0xb')||process[_0x9b6c('0xa')][0x4]===_0x9b6c('0xd')){throw new Error(_0x9b6c('0xe'));}var FIELDS=_[_0x9b6c('0xf')](process[_0x9b6c('0xa')][0x3][_0x9b6c('0x10')](','),process[_0x9b6c('0xa')][0x4][_0x9b6c('0x10')](','));if(!process[_0x9b6c('0xa')][0x5]||process[_0x9b6c('0xa')][0x5]===_0x9b6c('0xb')||process[_0x9b6c('0xa')][0x5]===_0x9b6c('0xd')){throw new Error(_0x9b6c('0x11'));}var LISTID=process[_0x9b6c('0xa')][0x5];var COMPANYID=process[_0x9b6c('0xa')][0x6]&&process[_0x9b6c('0xa')][0x6]!=='undefined'&&process[_0x9b6c('0xa')][0x6]!=='null'?process[_0x9b6c('0xa')][0x6]:null;var DUPLICATES=process[_0x9b6c('0xa')][0x7]&&process['argv'][0x7]!==_0x9b6c('0xb')&&process[_0x9b6c('0xa')][0x7]!==_0x9b6c('0xd')?process['argv'][0x7]:null;if(!process[_0x9b6c('0xa')][0x8]||process['argv'][0x8]===_0x9b6c('0xb')||process[_0x9b6c('0xa')][0x8]==='null'){throw new Error(_0x9b6c('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x1a8bc1){logger[_0x9b6c('0x13')](_0x1a8bc1);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(_0x1caae3,_0x41a6a1,_0x1a081d,_0x2050e9){var _0x2cbb11={'message':_0x41a6a1};_0x2cbb11[_0x1caae3]=!![];if(_0x1a081d){_0x2cbb11[_0x9b6c('0x14')]=_0x1a081d;}if(_0x2050e9){_0x2cbb11[_0x9b6c('0x15')]=_0x2050e9;}return _0x2cbb11;}function isEmail(_0x374c95){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))*$/[_0x9b6c('0x16')](_0x374c95);}function checkRow(_0x3365d7,_0x303061,_0x9fc803){return new BPromise(function(_0x28fca6,_0x4ea7e8){if(_[_0x9b6c('0x17')](_0x3365d7)){return _0x4ea7e8(handleCheckRowError(_0x9b6c('0x13'),_0x9b6c('0x18'),null,_0x9fc803));}if(_0x3365d7[_0x9b6c('0x19')]&&_0x3365d7[_0x9b6c('0x19')][_0x9b6c('0x1a')]){var _0x147875=_[_0x9b6c('0x1b')](_0x3365d7[_0x9b6c('0x19')],_0x9b6c('0x1c'))[_0x9b6c('0x1d')](';');return _0x4ea7e8(handleCheckRowError(_0x9b6c('0x13'),_0x147875,null,_0x9fc803));}var _0x332e46={};for(var _0x4158a5 in FIELDS){if(FIELDS[_0x9b6c('0x1e')](_0x4158a5)&&FIELDS[_0x4158a5]){_0x332e46[_0x4158a5]=_0x3365d7[_0x9b6c('0x1f')][0x0][FIELDS[_0x4158a5]]||_0x3365d7['data'][0x0]['\ufeff'+FIELDS[_0x4158a5]];}}if(!_0x332e46[_0x9b6c('0x20')]){return _0x4ea7e8(handleCheckRowError(_0x9b6c('0x13'),_0x9b6c('0x21'),null,_0x9fc803));}if(!_0x332e46['phone']){return _0x4ea7e8(handleCheckRowError('error',_0x9b6c('0x22'),null,_0x9fc803));}if(_0x332e46[_0x9b6c('0x23')]){var _0x1ee34f=moment(_0x332e46[_0x9b6c('0x23')],_0x9b6c('0x24'));if(!_0x1ee34f[_0x9b6c('0x25')]()){return _0x4ea7e8(handleCheckRowError('error',_0x9b6c('0x26'),null,_0x9fc803));}}if(_0x332e46[_0x9b6c('0x27')]){if(!isEmail(_0x332e46[_0x9b6c('0x27')])){return _0x4ea7e8(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x9fc803));}}_0x332e46[_0x9b6c('0x28')]=LISTID;_0x332e46[_0x9b6c('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x303061){var _0x2ba49c={};for(var _0x532b3d=0x0,_0x5953e8=DUPLICATES['length'];_0x532b3d<_0x5953e8;_0x532b3d+=0x1){_0x2ba49c[DUPLICATES[_0x532b3d]]=_0x332e46[DUPLICATES[_0x532b3d]];}var _0x1b92ee=_[_0x9b6c('0x2a')](_0x303061,_0x2ba49c);if(_0x1b92ee){return _0x4ea7e8(handleCheckRowError(_0x9b6c('0x2b'),_0x9b6c('0x2c'),_0x1b92ee,_0x9fc803));}}return db[_0x9b6c('0x2d')]['create'](_0x332e46,{'raw':!![],'hooks':![],'fields':_[_0x9b6c('0x2e')](_0x332e46)})[_0x9b6c('0x2f')](function(_0x656cc9){if(DUPLICATES&&DUPLICATES[_0x9b6c('0x1a')]&&_0x303061){_0x303061[_0x9b6c('0x30')](_[_0x9b6c('0x31')](_0x332e46,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x656cc9['id'];return _0x28fca6();})[_0x9b6c('0x32')](function(_0x30686d){return _0x4ea7e8(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x30686d[_0x9b6c('0x1c')]||JSON[_0x9b6c('0x33')](_0x30686d)),null,_0x9fc803));});});}function checkHopper(){function _0xc94139(){return function(_0x3f48f6){logger[_0x9b6c('0x13')](_0x9b6c('0x34'),_0x9b6c('0x35'),util[_0x9b6c('0x36')](_0x3f48f6,{'showHidden':![],'depth':null}));};}var _0x4e2cd8=function(_0x1c3d86,_0x38410c){var _0x430369=squel[_0x9b6c('0x37')]()[_0x9b6c('0x38')](_0x9b6c('0x39'))[_0x9b6c('0x3a')](['phone',_0x9b6c('0x3b'),'ContactId',_0x9b6c('0x28'),_0x38410c,'createdAt','updatedAt'],squel[_0x9b6c('0x3c')]()[_0x9b6c('0x3d')](_0x9b6c('0x3e'),_0x9b6c('0x3e'))[_0x9b6c('0x3d')]('NOW()',_0x9b6c('0x3b'))['field']('id',_0x9b6c('0x3f'))[_0x9b6c('0x3d')](LISTID[_0x9b6c('0x40')](),_0x9b6c('0x28'))['field'](_0x1c3d86['id']['toString'](),_0x38410c)[_0x9b6c('0x3d')](_0x9b6c('0x41'),_0x9b6c('0x42'))[_0x9b6c('0x3d')](_0x9b6c('0x41'),'updatedAt')[_0x9b6c('0x43')](_0x9b6c('0x44'))[_0x9b6c('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x9b6c('0x46'),LISTID[_0x9b6c('0x40')]())['where'](_0x9b6c('0x47'))[_0x9b6c('0x45')](_0x9b6c('0x48'),squel[_0x9b6c('0x3c')]()[_0x9b6c('0x3d')]('phone')['from'](_0x9b6c('0x39'))[_0x9b6c('0x45')](_0x38410c+_0x9b6c('0x49'),_0x1c3d86['id'][_0x9b6c('0x40')]())))[_0x9b6c('0x40')]();return _0x430369;};var _0x186236=function(_0x3c174f,_0x292677){var _0x5830c7=squel[_0x9b6c('0x37')]()[_0x9b6c('0x38')](_0x9b6c('0x39'))[_0x9b6c('0x3a')]([_0x9b6c('0x3e'),'scheduledAt','ContactId','ListId',_0x292677,_0x9b6c('0x42'),_0x9b6c('0x4a')],squel['select']()[_0x9b6c('0x3d')](_0x9b6c('0x3e'),_0x9b6c('0x3e'))[_0x9b6c('0x3d')]('NOW()',_0x9b6c('0x3b'))[_0x9b6c('0x3d')]('id',_0x9b6c('0x3f'))[_0x9b6c('0x3d')](LISTID[_0x9b6c('0x40')](),_0x9b6c('0x28'))[_0x9b6c('0x3d')](_0x3c174f['id']['toString'](),_0x292677)[_0x9b6c('0x3d')]('NOW()',_0x9b6c('0x42'))['field']('NOW()','updatedAt')['from']('cm_contacts')[_0x9b6c('0x45')](_0x9b6c('0x4b'))[_0x9b6c('0x45')](_0x9b6c('0x46'),LISTID[_0x9b6c('0x40')]())[_0x9b6c('0x45')](_0x9b6c('0x4c'),squel[_0x9b6c('0x4d')](hopperContacts))['where'](_0x9b6c('0x47'))[_0x9b6c('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9b6c('0x3c')]()['field'](_0x9b6c('0x4e'))[_0x9b6c('0x43')]('cm_hopper_final')[_0x9b6c('0x45')](_0x292677+_0x9b6c('0x49'),_0x3c174f['id']['toString']()))[_0x9b6c('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9b6c('0x3c')]()[_0x9b6c('0x3d')]('phone')[_0x9b6c('0x43')](_0x9b6c('0x39'))[_0x9b6c('0x45')](_0x292677+_0x9b6c('0x49'),_0x3c174f['id'][_0x9b6c('0x40')]())))[_0x9b6c('0x40')]();return _0x5830c7;};function _0x1eec12(_0x9f9851,_0x1e5815){var _0x11e898=squel[_0x9b6c('0x37')]()[_0x9b6c('0x38')](_0x9b6c('0x39'))[_0x9b6c('0x3a')]([_0x9b6c('0x3e'),_0x9b6c('0x3b'),_0x9b6c('0x3f'),'ListId',_0x1e5815,'createdAt',_0x9b6c('0x4a')],squel['select']()[_0x9b6c('0x3d')](_0x9b6c('0x3e'),'phone')[_0x9b6c('0x3d')](_0x9b6c('0x41'),_0x9b6c('0x3b'))[_0x9b6c('0x3d')]('id',_0x9b6c('0x3f'))['field'](LISTID[_0x9b6c('0x40')](),'ListId')[_0x9b6c('0x3d')](_0x9f9851['id']['toString'](),_0x1e5815)[_0x9b6c('0x3d')](_0x9b6c('0x41'),_0x9b6c('0x42'))['field'](_0x9b6c('0x41'),_0x9b6c('0x4a'))[_0x9b6c('0x43')](_0x9b6c('0x44'))[_0x9b6c('0x45')](_0x9b6c('0x4b'))[_0x9b6c('0x45')]('ListId\x20=\x20?',LISTID[_0x9b6c('0x40')]())[_0x9b6c('0x45')]('id\x20IN\x20?',squel[_0x9b6c('0x4d')](hopperContacts))[_0x9b6c('0x45')](_0x9b6c('0x47')))['toString']();return _0x11e898;}function _0x1d0dcd(_0x374a14,_0x37d8fe){var _0x5f3046=squel[_0x9b6c('0x37')]()[_0x9b6c('0x38')](_0x9b6c('0x4f'))[_0x9b6c('0x3a')]([_0x9b6c('0x3e'),_0x9b6c('0x3f'),'ListId',_0x37d8fe,'createdAt',_0x9b6c('0x4a')],squel[_0x9b6c('0x3c')]()[_0x9b6c('0x3d')]('phone','phone')[_0x9b6c('0x3d')]('id',_0x9b6c('0x3f'))[_0x9b6c('0x3d')](LISTID[_0x9b6c('0x40')](),_0x9b6c('0x28'))[_0x9b6c('0x3d')](_0x374a14['id'][_0x9b6c('0x40')](),_0x37d8fe)[_0x9b6c('0x3d')](_0x9b6c('0x41'),_0x9b6c('0x42'))[_0x9b6c('0x3d')]('NOW()','updatedAt')[_0x9b6c('0x43')](_0x9b6c('0x44'))[_0x9b6c('0x45')](_0x9b6c('0x4b'))[_0x9b6c('0x45')]('ListId\x20=\x20?',LISTID[_0x9b6c('0x40')]())['where'](_0x9b6c('0x4c'),squel['str'](hopperContacts))[_0x9b6c('0x45')](_0x9b6c('0x47')))[_0x9b6c('0x40')]();return _0x5f3046;}return db['VoiceQueue'][_0x9b6c('0x50')]({'where':{'type':_0x9b6c('0x51')},'attributes':['id',_0x9b6c('0x52')],'include':[{'model':db[_0x9b6c('0x53')],'as':_0x9b6c('0x54'),'where':{'id':LISTID}}]})[_0x9b6c('0x2f')](function(_0x4b0af1){var _0x5cd4a5=[];if(_0x4b0af1){var _0x423f2e;for(var _0x4046d3=0x0,_0x5586e6;_0x4046d3<_0x4b0af1[_0x9b6c('0x1a')];_0x4046d3+=0x1){_0x5586e6=_0x4b0af1[_0x4046d3][_0x9b6c('0x55')]({'plain':!![]});switch(_0x5586e6[_0x9b6c('0x52')]){case _0x9b6c('0x56'):_0x5cd4a5[_0x9b6c('0x30')](db[_0x9b6c('0x57')][_0x9b6c('0x58')](_0x186236(_0x5586e6,_0x9b6c('0x59')))['then'](function(){})[_0x9b6c('0x32')](_0xc94139()));break;case'onlyIfOpen':_0x5cd4a5[_0x9b6c('0x30')](db[_0x9b6c('0x57')][_0x9b6c('0x58')](_0x4e2cd8(_0x5586e6,_0x9b6c('0x59')))['then'](function(){})[_0x9b6c('0x32')](_0xc94139()));break;default:_0x5cd4a5[_0x9b6c('0x30')](db[_0x9b6c('0x57')][_0x9b6c('0x58')](_0x1eec12(_0x5586e6,_0x9b6c('0x59')))[_0x9b6c('0x2f')](function(){})['catch'](_0xc94139()));}}}return _0x5cd4a5;})[_0x9b6c('0x5a')]()[_0x9b6c('0x2f')](function(){return db[_0x9b6c('0x5b')][_0x9b6c('0x50')]({'where':{'type':_0x9b6c('0x51')},'attributes':['id'],'include':[{'model':db[_0x9b6c('0x53')],'as':_0x9b6c('0x5c'),'where':{'id':LISTID}}]})[_0x9b6c('0x2f')](function(_0x45b5aa){var _0x34decf=[];if(_0x45b5aa){var _0x48d104;for(var _0x50073a=0x0,_0x52f5c6;_0x50073a<_0x45b5aa[_0x9b6c('0x1a')];_0x50073a+=0x1){_0x52f5c6=_0x45b5aa[_0x50073a][_0x9b6c('0x55')]({'plain':!![]});_0x34decf[_0x9b6c('0x30')](db[_0x9b6c('0x57')]['query'](_0x1d0dcd(_0x52f5c6,_0x9b6c('0x59')))[_0x9b6c('0x2f')](function(){})[_0x9b6c('0x32')](_0xc94139()));}}return _0x34decf;})[_0x9b6c('0x5a')]();})['then'](function(){return db[_0x9b6c('0x5d')][_0x9b6c('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x9b6c('0x54'),'where':{'id':LISTID}}]})[_0x9b6c('0x2f')](function(_0x10fbb0){var _0x3dca4d=[];if(_0x10fbb0){for(var _0x366003=0x0,_0x341c96;_0x366003<_0x10fbb0['length'];_0x366003+=0x1){_0x341c96=_0x10fbb0[_0x366003][_0x9b6c('0x55')]({'plain':!![]});switch(_0x341c96[_0x9b6c('0x52')]){case _0x9b6c('0x56'):_0x3dca4d[_0x9b6c('0x30')](db[_0x9b6c('0x57')]['query'](_0x186236(_0x341c96,_0x9b6c('0x5e')))[_0x9b6c('0x2f')](function(){})[_0x9b6c('0x32')](_0xc94139()));break;case _0x9b6c('0x5f'):_0x3dca4d[_0x9b6c('0x30')](db[_0x9b6c('0x57')][_0x9b6c('0x58')](_0x4e2cd8(_0x341c96,_0x9b6c('0x5e')))['then'](function(){})['catch'](_0xc94139()));break;default:_0x3dca4d[_0x9b6c('0x30')](db['sequelize'][_0x9b6c('0x58')](_0x1eec12(_0x341c96,_0x9b6c('0x5e')))[_0x9b6c('0x2f')](function(){})[_0x9b6c('0x32')](_0xc94139()));}}}return _0x3dca4d;})[_0x9b6c('0x5a')]();})[_0x9b6c('0x2f')](function(){return db[_0x9b6c('0x5d')][_0x9b6c('0x50')]({'attributes':['id'],'include':[{'model':db[_0x9b6c('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x5a3277){var _0x527621=[];if(_0x5a3277){for(var _0x525e99=0x0,_0x130107;_0x525e99<_0x5a3277[_0x9b6c('0x1a')];_0x525e99+=0x1){_0x130107=_0x5a3277[_0x525e99][_0x9b6c('0x55')]({'plain':!![]});_0x527621[_0x9b6c('0x30')](db[_0x9b6c('0x57')][_0x9b6c('0x58')](_0x1d0dcd(_0x130107,_0x9b6c('0x5e')))[_0x9b6c('0x2f')](function(){})[_0x9b6c('0x32')](_0xc94139()));}}return _0x527621;})[_0x9b6c('0x5a')]();})['catch'](function(_0x565574){logger[_0x9b6c('0x13')](_0x9b6c('0x60'),_0x9b6c('0x61'),_0x565574[_0x9b6c('0x1c')]);});}var processPromises=function(_0x25e3dc){return BPromise[_0x9b6c('0x5a')](promises)[_0x9b6c('0x2f')](function(_0x496ea9){})[_0x9b6c('0x32')](function(_0x599b3e){logger[_0x9b6c('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0x9b6c('0x33')](_0x599b3e));})[_0x9b6c('0x62')](function(){socket[_0x9b6c('0x63')](_0x9b6c('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x25e3dc){return _0x25e3dc['resume']();}});};var endCsv=function(){return BPromise[_0x9b6c('0x65')]()[_0x9b6c('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x9b6c('0x2f')](function(){socket['emit'](_0x9b6c('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9b6c('0x66')](FILEPATH);}catch(_0x2b78d3){logger[_0x9b6c('0x13')](_0x9b6c('0x67'),JSON[_0x9b6c('0x33')](_0x2b78d3));}finally{process[_0x9b6c('0x68')](0x0);}});};process['on'](_0x9b6c('0x69'),function(){logger[_0x9b6c('0x6a')](_0x9b6c('0x6b'));endCsv();});function main(){return BPromise[_0x9b6c('0x65')]()[_0x9b6c('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9b6c('0x10')](',');return db['CmContact'][_0x9b6c('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9b6c('0x2f')](function(_0x371991){var _0x558ef1=fs[_0x9b6c('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9b6c('0x6d')](_0x558ef1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x19141f,_0x293460){total+=0x1;var _0x3055a9=total;promises[_0x9b6c('0x30')](checkRow(_0x19141f,_0x371991,_0x3055a9)[_0x9b6c('0x2f')](function(){success+=0x1;})[_0x9b6c('0x32')](function(_0x440f7d){if(_0x440f7d[_0x9b6c('0x13')]){errors+=0x1;delete _0x440f7d['error'];}else if(_0x440f7d[_0x9b6c('0x2b')]){duplicates+=0x1;delete _0x440f7d[_0x9b6c('0x2b')];}rows[_0x9b6c('0x30')](_0x440f7d);}));if(total%0xc8===0x0){_0x293460[_0x9b6c('0x6e')]();return processPromises(_0x293460);}},'complete':function(){return processPromises()['then'](function(){logger[_0x9b6c('0x6a')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x230c2e,_0x27c035){logger[_0x9b6c('0x6a')](_0x9b6c('0x6f'),JSON[_0x9b6c('0x33')](_0x230c2e));endCsv();}});})[_0x9b6c('0x32')](function(_0x20a6f9){logger[_0x9b6c('0x13')](_0x9b6c('0x70'),JSON[_0x9b6c('0x33')](_0x20a6f9));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index e0b69b2..13af2cd 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 _0xf6da=['dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','finish','affectedRows','unlink','complete','arguments\x20\x20\x20','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','squel','../../../config/environment/shared','../../../config/logger','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','then','split','push','all','isNil','filter','CmContactHasItem','findOne','update','updated','create','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_contacts.createdAt','cm_hopper_black','fromQuery','updatedAt','field','ListId\x20=\x20?','\x20=\x20','toString','cm_contacts.priority','priority','.CmListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','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?','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','info','Received\x20SIGINT','error','exit','errors','code','message','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','sequelize','query','timezones','dialTimezone','utcOffset','set','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','includes','keys','ContactItemType','name','_description','header','writeFileSync','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format'];(function(_0x51a8d9,_0x303cbb){var _0x1820a5=function(_0x222796){while(--_0x222796){_0x51a8d9['push'](_0x51a8d9['shift']());}};_0x1820a5(++_0x303cbb);}(_0xf6da,0xe9));var _0xaf6d=function(_0x5a9126,_0xc1c87e){_0x5a9126=_0x5a9126-0x0;var _0x1134ed=_0xf6da[_0x5a9126];return _0x1134ed;};'use strict';var fs=require('fs');var path=require(_0xaf6d('0x0'));var _=require('lodash');var Papa=require(_0xaf6d('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xaf6d('0x2'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require(_0xaf6d('0x3'));var logger=require(_0xaf6d('0x4'))('import');config['redis']=_['defaults'](config['redis'],{'host':_0xaf6d('0x5'),'port':0x18eb});var socket=require(_0xaf6d('0x6'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xaf6d('0x7'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xaf6d('0x8')](_0xaf6d('0x7'));function isEmail(_0x712cd9){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))*$/[_0xaf6d('0x9')](_0x712cd9);}function selectNotIn(_0x22bf38,_0x3b4973,_0x3784d3,_0x12a890,_0x4a3fce){return squel[_0xaf6d('0xa')]()['field'](_0xaf6d('0xb'))[_0xaf6d('0xc')](_0x12a890)[_0xaf6d('0xd')](_0x3b4973,null,_0x3b4973+_0xaf6d('0xe')+_0x12a890+'.'+_0x3784d3)[_0xaf6d('0xf')](_0x12a890+'.'+_0x3784d3+'\x20=\x20'+_0x22bf38+'.'+_0x3784d3)[_0xaf6d('0xf')](_0x3b4973+_0xaf6d('0x10')+_0x4a3fce[_0xaf6d('0xd')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xad9a29,_0x1b001b){promisesAdditionalPhones=[];return db[_0xaf6d('0x11')][_0xaf6d('0x12')]({'raw':!![],'attributes':['id',_0xaf6d('0x13')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0xf541d3){if(_0xf541d3!==null){var _0x438969=[];for(var _0x5ea2c7=0x0;_0x5ea2c7<_0xf541d3[_0xaf6d('0x14')];_0x5ea2c7++){var _0x5ca38d=_0xf541d3[_0x5ea2c7];_0x438969['push'](insertAdditionalPhones(_0x5ca38d));}}Promise['all'](_0x438969)[_0xaf6d('0x15')](function(){_0xad9a29({'val':0x1});});});});}function insertAdditionalPhones(_0x39ad89){return new Promise(function(_0x1317c5,_0x1c1e8c){var _0x3c4f55=_0x39ad89['AdditionalPhones'];var _0x24486f=_0x3c4f55[_0xaf6d('0x16')](';');var _0x146c62=[];orderBy=0x0;for(var _0x3fbfe9=0x0;_0x3fbfe9<_0x24486f[_0xaf6d('0x14')];_0x3fbfe9++){_0x146c62[_0xaf6d('0x17')](splitAdditionalPhone(_0x39ad89['id'],_0x24486f[_0x3fbfe9]));}Promise[_0xaf6d('0x18')](_0x146c62)[_0xaf6d('0x15')](function(){_0x1317c5({'val':_0x24486f[_0xaf6d('0x14')]});});});}function splitAdditionalPhone(_0x1bc04c,_0x31332e){return new Promise(function(_0x10c0a4,_0x52b4ae){var _0x2cbcce=_0x31332e[_0xaf6d('0x16')](':');var _0x3614df=_0x2cbcce[0x0];var _0x330240=_0x2cbcce[0x1];if(!_[_0xaf6d('0x19')](_0x330240)){var _0x3b4064=_0x330240['split']('|');var _0x13257e=[];for(var _0x442f95=0x0;_0x442f95<_0x3b4064[_0xaf6d('0x14')];_0x442f95++){if(_0x3b4064[_0x442f95]!==''){var _0x2691a4=_[_0xaf6d('0x1a')](promisesAdditionalPhones,{'contactId':_0x1bc04c,'phone':_0x3b4064[_0x442f95]});if(_0x2691a4['length']==0x0){orderBy++;promisesAdditionalPhones[_0xaf6d('0x17')]({'contactId':_0x1bc04c,'contactTypeId':_0x3614df,'phone':_0x3b4064[_0x442f95],'orderBy':orderBy});}}}_0x10c0a4({'ok':0x1});}else _0x10c0a4({'res':0x0});});}function createAdditionalPhone(_0x2fed00,_0x290d2b,_0x21b6ed,_0x57730e){var _0x20143c='';var _0x5e3fd5='';var _0x151eab=_0x21b6ed[_0xaf6d('0x16')]('§');_0x20143c=_0x151eab[0x0];if(_0x151eab[_0xaf6d('0x14')]==0x2)_0x5e3fd5=_0x151eab[0x1];return new Promise(function(_0x488885,_0x11ece2){return db[_0xaf6d('0x1b')][_0xaf6d('0x1c')]({'where':{'CmContactId':_0x2fed00,'item':_0x20143c}})[_0xaf6d('0x15')](function(_0x1887b6){if(_0x1887b6){return db[_0xaf6d('0x1b')][_0xaf6d('0x1d')]({'ItemTypeId':_0x290d2b,'description':_0x5e3fd5,'OrderBy':_0x57730e},{'where':{'CmContactId':_0x2fed00,'item':_0x20143c}})[_0xaf6d('0x15')](function(_0xa412a5){_0x488885({'res':_0xaf6d('0x1e')});});}else{return db[_0xaf6d('0x1b')][_0xaf6d('0x1f')]({'CmContactId':_0x2fed00,'item':_0x20143c,'description':_0x5e3fd5,'ItemTypeId':_0x290d2b,'OrderBy':_0x57730e,'ItemClass':'PHONE'})[_0xaf6d('0x15')](function(_0x54b120){_0x488885({'res':_0xaf6d('0x20')});});}});});}function insertCmHopper(_0x35c10e,_0x192b99,_0x479998,_0x4350fc,_0x2bda1a){var _0x4f0164=[_0xaf6d('0x21'),'cm_contacts.scheduledat',_0xaf6d('0x22'),_0xaf6d('0x23'),_0x192b99+'.'+_0x4350fc,'cm_contacts.createdAt',_0xaf6d('0x24'),'cm_contacts.priority',_0xaf6d('0x25'),'\x22'+_0x2bda1a+'\x22'];return squel[_0xaf6d('0x26')]()[_0xaf6d('0x27')](_0xaf6d('0x28'))['fromQuery']([_0xaf6d('0xb'),_0xaf6d('0x29'),_0xaf6d('0x2a'),_0xaf6d('0x2b'),_0x4350fc,_0xaf6d('0x2c'),'updatedAt','priority',_0xaf6d('0x2d'),_0xaf6d('0x2e')],squel[_0xaf6d('0xa')]()[_0xaf6d('0x2f')](_0x4f0164)[_0xaf6d('0xc')](_0x192b99)[_0xaf6d('0xd')](_0xaf6d('0x30'),null,_0xaf6d('0x31')+_0x192b99+_0xaf6d('0x32'))[_0xaf6d('0xd')](_0x479998,null,_0x479998+_0xaf6d('0xe')+_0x192b99+'.'+_0x4350fc)[_0xaf6d('0xf')](_0x192b99+'.CmListId\x20=\x20?',_0x35c10e)[_0xaf6d('0xf')](_0xaf6d('0x33'),NOW)[_0xaf6d('0xf')](_0xaf6d('0x34'),selectNotIn(_0x192b99,_0x479998,_0x4350fc,'cm_hopper',['\x22always\x22',_0xaf6d('0x35')]))[_0xaf6d('0xf')](_0xaf6d('0x34'),selectNotIn(_0x192b99,_0x479998,_0x4350fc,_0xaf6d('0x28'),[_0xaf6d('0x36')])))['toString']();}function insertCmHopperBlack(_0x13a777,_0x2b5f4e,_0x3457b1,_0x1266d4){var _0x5d84d7=[_0xaf6d('0x21'),_0xaf6d('0x22'),'cm_contacts.ListId',_0x2b5f4e+'.'+_0x1266d4,_0xaf6d('0x37'),_0xaf6d('0x24')];return squel[_0xaf6d('0x26')]()['into'](_0xaf6d('0x38'))[_0xaf6d('0x39')](['phone','ContactId',_0xaf6d('0x2b'),_0x1266d4,_0xaf6d('0x2c'),_0xaf6d('0x3a')],squel[_0xaf6d('0xa')]()[_0xaf6d('0x2f')](_0x5d84d7)[_0xaf6d('0xc')](_0x2b5f4e)[_0xaf6d('0xd')](_0xaf6d('0x30'),null,_0xaf6d('0x31')+_0x2b5f4e+'.CmListId')[_0xaf6d('0xd')](_0x3457b1,null,_0x3457b1+_0xaf6d('0xe')+_0x2b5f4e+'.'+_0x1266d4)[_0xaf6d('0xf')](_0x2b5f4e+'.CmListId\x20=\x20?',_0x13a777)[_0xaf6d('0xf')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xaf6d('0xa')]()[_0xaf6d('0x3b')](_0xaf6d('0xb'))['from'](_0xaf6d('0x38'))[_0xaf6d('0xf')](_0xaf6d('0x3c'),_0x13a777)[_0xaf6d('0xf')](_0x1266d4+_0xaf6d('0x3d')+_0x2b5f4e+'.'+_0x1266d4)))[_0xaf6d('0x3e')]();}function insertTzCmHopper(_0x15aecc,_0x4eb69d,_0x23c985,_0x21f53b,_0x2484ef,_0x370c93){var _0x40648b=[_0xaf6d('0x21'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x370c93+'.offset-cm_contacts.utcOffset\x20minute)',_0xaf6d('0x22'),_0xaf6d('0x23'),_0x4eb69d+'.'+_0x21f53b,_0xaf6d('0x37'),_0xaf6d('0x24'),_0xaf6d('0x3f'),_0xaf6d('0x25'),'\x22'+_0x2484ef+'\x22'];var _0xffd7b0=squel[_0xaf6d('0x26')]()[_0xaf6d('0x27')](_0xaf6d('0x28'))[_0xaf6d('0x39')]([_0xaf6d('0xb'),_0xaf6d('0x29'),_0xaf6d('0x2a'),_0xaf6d('0x2b'),_0x21f53b,'createdAt','updatedAt',_0xaf6d('0x40'),'UserId',_0xaf6d('0x2e')],squel['select']()[_0xaf6d('0x2f')](_0x40648b)[_0xaf6d('0xc')](_0x4eb69d)[_0xaf6d('0xd')](_0xaf6d('0x30'),null,_0xaf6d('0x31')+_0x4eb69d+'.CmListId')[_0xaf6d('0xd')](_0x23c985,null,_0x23c985+_0xaf6d('0xe')+_0x4eb69d+'.'+_0x21f53b)[_0xaf6d('0xd')](_0x370c93,null,_0x370c93+_0xaf6d('0xe')+_0x4eb69d+'.'+_0x21f53b)[_0xaf6d('0xf')](_0x4eb69d+_0xaf6d('0x41'),_0x15aecc)[_0xaf6d('0xf')](_0xaf6d('0x33'),NOW)[_0xaf6d('0xf')](_0xaf6d('0x34'),selectNotIn(_0x4eb69d,_0x23c985,_0x21f53b,_0xaf6d('0x28'),[_0xaf6d('0x36'),_0xaf6d('0x35')]))[_0xaf6d('0xf')](_0xaf6d('0x34'),selectNotIn(_0x4eb69d,_0x23c985,_0x21f53b,_0xaf6d('0x28'),[_0xaf6d('0x36')])))[_0xaf6d('0x3e')]();return _0xffd7b0;}function insertTzCmHopperBlack(_0x333789,_0x2167c0,_0x36e485,_0x262497){var _0x435afa=[_0xaf6d('0x21'),_0xaf6d('0x22'),'cm_contacts.ListId',_0x2167c0+'.'+_0x262497,_0xaf6d('0x37'),_0xaf6d('0x24')];return squel[_0xaf6d('0x26')]()[_0xaf6d('0x27')](_0xaf6d('0x38'))[_0xaf6d('0x39')](['phone',_0xaf6d('0x2a'),_0xaf6d('0x2b'),_0x262497,_0xaf6d('0x2c'),'updatedAt'],squel[_0xaf6d('0xa')]()[_0xaf6d('0x2f')](_0x435afa)[_0xaf6d('0xc')](_0x2167c0)[_0xaf6d('0xd')](_0xaf6d('0x30'),null,_0xaf6d('0x31')+_0x2167c0+_0xaf6d('0x32'))[_0xaf6d('0xd')](_0x36e485,null,_0x36e485+_0xaf6d('0xe')+_0x2167c0+'.'+_0x262497)[_0xaf6d('0xf')](_0x2167c0+'.CmListId\x20=\x20?',_0x333789)['where'](_0xaf6d('0x33'),NOW)[_0xaf6d('0xf')](_0xaf6d('0x34'),squel['select']()[_0xaf6d('0x3b')](_0xaf6d('0xb'))[_0xaf6d('0xc')]('cm_hopper_black')['where'](_0xaf6d('0x3c'),_0x333789)['where'](_0x262497+_0xaf6d('0x3d')+_0x2167c0+'.'+_0x262497)))[_0xaf6d('0x3e')]();}function insertCmHopperAdditionalPhones(_0x33569d){var _0x33bd3b=[_0xaf6d('0x42'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xaf6d('0x43'),'cm_contact_has_items.updatedAt'];return squel[_0xaf6d('0x26')]()[_0xaf6d('0x27')](_0xaf6d('0x44'))['fromQuery']([_0xaf6d('0x45'),_0xaf6d('0xb'),'OrderBy',_0xaf6d('0x2c'),_0xaf6d('0x3a')],squel[_0xaf6d('0xa')]()[_0xaf6d('0x2f')](_0x33bd3b)[_0xaf6d('0xc')](_0xaf6d('0x28'))[_0xaf6d('0xd')](_0xaf6d('0x30'),null,_0xaf6d('0x46'))[_0xaf6d('0xd')](_0xaf6d('0x47'),null,_0xaf6d('0x48'))[_0xaf6d('0xf')](_0xaf6d('0x49'),_0x33569d)[_0xaf6d('0xf')](_0xaf6d('0x33'),NOW))['toString']();}function insertCmContact(_0x433492,_0x4732e0,_0x10ec6f,_0x429019){var _0x14b7b1=_['concat'](_['keys'](_0x429019),[_0xaf6d('0x2b'),_0xaf6d('0x4a'),_0xaf6d('0x2c'),_0xaf6d('0x3a'),_0xaf6d('0x4b')]);return squel['insert']()[_0xaf6d('0x27')](_0xaf6d('0x30'))[_0xaf6d('0x39')](_0x14b7b1,squel[_0xaf6d('0xa')]()[_0xaf6d('0x2f')](_0x14b7b1)[_0xaf6d('0xc')](_0x4732e0)['where']('('+_0x10ec6f['join'](',')+_0xaf6d('0x4c'),squel['select']()['fields'](_0x10ec6f)[_0xaf6d('0xc')](_0xaf6d('0x30'))[_0xaf6d('0xf')]('ListId\x20=\x20?',_0x433492)[_0xaf6d('0xf')]('deletedAt\x20IS\x20NULL'))[_0xaf6d('0xf')](_0xaf6d('0x4d'),squel[_0xaf6d('0xa')]()['field']('MIN(id)',_0xaf6d('0x4e'))['from'](_0x4732e0)['group'](_0x10ec6f[_0xaf6d('0xd')](','))))[_0xaf6d('0x3e')]();}function handleStop(){logger[_0xaf6d('0x4f')](_0xaf6d('0x50'));stopped=!![];}function handleUncaughtException(_0x171d7f){logger[_0xaf6d('0x51')](_0x171d7f['message']);process[_0xaf6d('0x52')](0x1);}function handleError(_0x20aa09,_0x308606){stats[_0xaf6d('0x53')][_0xaf6d('0x17')]({'name':_0x308606[_0xaf6d('0x54')],'message':_0x308606[_0xaf6d('0x55')],'row':_0x20aa09});}function handleQuery(_0x1ffc71){logger['info'](_0x1ffc71);return db['sequelize']['query'](_0x1ffc71)[_0xaf6d('0x56')](function(_0x4cb278){results[_0xaf6d('0x17')](_0x4cb278);})[_0xaf6d('0x57')](function(_0x19c4c7){logger['error'](_0x19c4c7['message']);});}function updateTzCampaigns(_0x46d22e){return new Promise(function(_0xf70286,_0x28c86e){var _0x48a9a8=squel['select']()['fields']([_0xaf6d('0x58'),_0xaf6d('0x59')])['from']('campaigns')[_0xaf6d('0xd')](_0xaf6d('0x5a'),null,_0xaf6d('0x5b'))[_0xaf6d('0xf')](_0xaf6d('0x5c')+_0x46d22e);db['sequelize']['query'](_0x48a9a8['toString']())['spread'](function(_0x398258){var _0xe472ef=[];for(var _0x114dec=0x0;_0x114dec<_0x398258['length'];_0x114dec++){_0xe472ef[_0xaf6d('0x17')](getTimezoneData(_0x398258[_0x114dec],tmp_campaigns));}BPromise['all'](_0xe472ef)[_0xaf6d('0x15')](function(){_0xf70286({'val':0x1});});})[_0xaf6d('0x57')](function(_0x268fba){logger[_0xaf6d('0x51')](_0x268fba['message']);_0xf70286({'val':0x0});});});}function updateTzVoiceQueues(_0x67f311){return new Promise(function(_0x68e5bd,_0x42ed04){var _0x45c741=squel[_0xaf6d('0xa')]()['fields']([_0xaf6d('0x5d'),_0xaf6d('0x5e')])[_0xaf6d('0xc')](_0xaf6d('0x5f'))[_0xaf6d('0xd')]('voice_queues_has_cm_lists',null,_0xaf6d('0x60'))['where'](_0xaf6d('0x61')+_0x67f311);db[_0xaf6d('0x62')][_0xaf6d('0x63')](_0x45c741[_0xaf6d('0x3e')]())[_0xaf6d('0x56')](function(_0x22a5d5){var _0x289837=[];for(var _0x2f44da=0x0;_0x2f44da<_0x22a5d5[_0xaf6d('0x14')];_0x2f44da++){_0x289837[_0xaf6d('0x17')](getTimezoneData(_0x22a5d5[_0x2f44da],tmp_voice_queues));}BPromise[_0xaf6d('0x18')](_0x289837)[_0xaf6d('0x15')](function(){_0x68e5bd({'val':0x1});});})[_0xaf6d('0x57')](function(_0x5c258f){logger['error'](_0x5c258f[_0xaf6d('0x55')]);_0x68e5bd({'val':0x0});});});}function getTimezoneData(_0x33f064,_0x269b0e){return new Promise(function(_0x13ef16,_0x12f1a4){var _0xa23b7b=shared[_0xaf6d('0x64')];var _0x534fe6=_0xa23b7b[_0x33f064[_0xaf6d('0x65')]];if(_['isNil'](_0x534fe6)){_0x13ef16({'ret':0x1});}else{var _0x4f06e4=_0x534fe6[_0xaf6d('0x66')];var _0x3b688d=squel[_0xaf6d('0x26')]()[_0xaf6d('0x27')](_0x269b0e)[_0xaf6d('0x67')]('id',_0x33f064['id'])['set']('offset',_0x4f06e4)[_0xaf6d('0x67')](_0xaf6d('0x65'),_0x33f064[_0xaf6d('0x65')])[_0xaf6d('0x3e')]();return db[_0xaf6d('0x62')][_0xaf6d('0x63')](_0x3b688d)[_0xaf6d('0x56')](function(_0x3d7b76){_0x13ef16({'ret':0x1});})[_0xaf6d('0x57')](function(_0x262d3c){logger[_0xaf6d('0x51')](_0x262d3c[_0xaf6d('0x55')]);_0x12f1a4({'ret':0x1});});}});}function handleTZQuery(_0x185ceb){logger[_0xaf6d('0x4f')](_0x185ceb);return db[_0xaf6d('0x62')][_0xaf6d('0x63')](_0x185ceb)[_0xaf6d('0x56')](function(_0x281a12){})[_0xaf6d('0x57')](function(_0x887004){logger['error'](_0x887004['message']);});}function main(_0x25a8e3,_0x468d0b,_0x15a14b,_0x17167c){logger[_0xaf6d('0x4f')](_0xaf6d('0x68'),_0x25a8e3,JSON[_0xaf6d('0x69')](_0x468d0b));process[_0xaf6d('0x6a')](_0xaf6d('0x6b'));var _0x30e6d0=_0x468d0b[_0xaf6d('0x6c')];var _0x16e189=_['clone'](_0x30e6d0);var _0x3e3c84=_0x468d0b[_0xaf6d('0x6d')];var _0x28ac0d=path[_0xaf6d('0xd')](config[_0xaf6d('0x6e')],_0xaf6d('0x6f'),_0x3e3c84+_0xaf6d('0x70'));hasTZ=_['keys'](_0x30e6d0)[_0xaf6d('0x71')](_0xaf6d('0x65'));var _0x34b2cc=_[_0xaf6d('0x72')](_0x30e6d0)[_0xaf6d('0xd')]();logger[_0xaf6d('0x4f')]('header',_0x34b2cc);db[_0xaf6d('0x73')][_0xaf6d('0x12')]({'raw':!![],'attributes':['id','name']})[_0xaf6d('0x15')](function(_0x3f1912){for(var _0x36f4c3=0x0;_0x36f4c3<_0x3f1912[_0xaf6d('0x14')];_0x36f4c3++){if(_0x3f1912[_0x36f4c3][_0xaf6d('0x74')]in _0x30e6d0){contactItemTypes[_0xaf6d('0x17')](_0x3f1912[_0x36f4c3]);delete _0x16e189[_0x3f1912[_0x36f4c3]['name']];hasAdditionalPhones=!![];}for(var _0x5bb812 in _0x30e6d0){if(_0x3f1912[_0x36f4c3]['name']+_0xaf6d('0x75')===_0x5bb812){phoneDescriptions[_0xaf6d('0x17')]({'itemTypeId':_0x3f1912[_0x36f4c3]['id'],'description':_0x5bb812});delete _0x16e189[_0x5bb812];}}}if(hasAdditionalPhones)_0x16e189[_0xaf6d('0x13')]='';var _0x1ae492=_[_0xaf6d('0x72')](_0x16e189)[_0xaf6d('0xd')]();logger[_0xaf6d('0x4f')](_0xaf6d('0x76'),_0x1ae492);fs[_0xaf6d('0x77')](_0x28ac0d,_0x1ae492+'\x0a');Papa['parse'](fs[_0xaf6d('0x78')](_0x25a8e3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4e923d,_0x5bab63){try{for(var _0x5284ac=0x0,_0x4578f9=[];_0x5284ac<_0x4e923d[_0xaf6d('0x79')][_0xaf6d('0x14')];_0x5284ac++){stats[_0xaf6d('0x7a')]+=0x1;if(_0x4e923d[_0xaf6d('0x53')][_0x5284ac]){handleError(_0x4e923d['data'][_0x5284ac],_0x4e923d[_0xaf6d('0x53')][_0x5284ac]);}else{var _0x3088db=[];var _0x2f6d17=[];var _0x490c18={};for(var _0x1e77dc in _0x30e6d0){let _0x37bfd6=contactItemTypes[_0xaf6d('0x7b')](_0x47a2b7=>_0x47a2b7[_0xaf6d('0x74')]===_0x1e77dc);let _0x352692=contactItemTypes['find'](_0x1ac606=>_0x1ac606[_0xaf6d('0x74')]+_0xaf6d('0x75')===_0x1e77dc);if(_['isNil'](_0x37bfd6)&&_['isNil'](_0x352692)){if(_0x30e6d0[_0xaf6d('0x7c')](_0x1e77dc)){if(_0x4e923d[_0xaf6d('0x79')][_0x5284ac][_0x30e6d0[_0x1e77dc]]){var _0x3f4959=_[_0xaf6d('0x7d')](_0x4e923d[_0xaf6d('0x79')][_0x5284ac][_0x30e6d0[_0x1e77dc]][_0xaf6d('0x7e')](/"/g,'\x27'));switch(_0x1e77dc){case _0xaf6d('0x29'):var _0x31bb39=moment(_0x3f4959,_0xaf6d('0x7'),!![]);if(_0x31bb39[_0xaf6d('0x7f')]()){_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x3f4959+'\x22');}else{_0x3088db['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x3226b9=parseInt(_0x3f4959);_0x3f4959=_[_0xaf6d('0x80')](_0x3226b9)||_0x3226b9<0x0||_0x3226b9>0x4?_0x17167c?0x3:0x2:_0x3226b9;_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x3f4959+'\x22');break;case _0xaf6d('0x2d'):var _0x52fdd9=parseInt(_0x3f4959);if(_[_0xaf6d('0x81')](_0x52fdd9)&&_[_0xaf6d('0x71')](_0x15a14b,_0x52fdd9)){_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x52fdd9+'\x22');}else{_0x3088db['push'](_0xaf6d('0x82'));}break;case _0xaf6d('0x83'):if(isEmail(_0x3f4959)){_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x3f4959+'\x22');}else{_0x3088db[_0xaf6d('0x17')](_0xaf6d('0x84'));}break;case _0xaf6d('0x85'):var _0x4ed9d0=moment(_0x3f4959,_0xaf6d('0x86'),!![]);if(_0x4ed9d0['isValid']()){_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x3f4959+'\x22');}else{_0x3088db['push'](_0xaf6d('0x87'));}break;case'dialTimezone':var _0xdd3c78=shared[_0xaf6d('0x64')];var _0x210049=_0xdd3c78[_0x3f4959];if(!_[_0xaf6d('0x19')](_0x210049)){var _0x4e59a2=_0x210049[_0xaf6d('0x66')];_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x3f4959+'\x22');_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x4e59a2+'\x22');}break;default:_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x3f4959+'\x22');}}else{switch(_0x1e77dc){case _0xaf6d('0x88'):case _0xaf6d('0xb'):_0x3088db[_0xaf6d('0x17')](_0x1e77dc+_0xaf6d('0x89'));break;default:_0x4578f9[_0xaf6d('0x17')]('\x22\x22');}}}}else{var _0x2625f9='';if(!_[_0xaf6d('0x19')](_0x37bfd6)){if(!_0x490c18[_0xaf6d('0x7c')](_0x37bfd6['id'])){if(!_[_0xaf6d('0x19')](_0x4e923d[_0xaf6d('0x79')][_0x5284ac][_0x30e6d0[_0x1e77dc]])){var _0x3f4959=_['trim'](_0x4e923d[_0xaf6d('0x79')][_0x5284ac][_0x30e6d0[_0x1e77dc]]['replace'](/"/g,'\x27'));var _0x597d0e=phoneDescriptions[_0xaf6d('0x7b')](_0x3a38a5=>_0x3a38a5['itemTypeId']===_0x37bfd6['id']);if(!_[_0xaf6d('0x19')](_0x597d0e)){var _0x21c5de=_['trim'](_0x4e923d['data'][_0x5284ac][_0x30e6d0[_0x597d0e[_0xaf6d('0x8a')]]][_0xaf6d('0x7e')](/"/g,'\x27'));if(!_[_0xaf6d('0x19')](_0x21c5de))_0x3f4959=_0x3f4959+'§'+_0x21c5de;}if(_0x2625f9=='')_0x2625f9=_0x3f4959;else _0x2625f9+='|'+_0x3f4959;}_0x2f6d17[_0xaf6d('0x17')](_0x37bfd6['id']+':'+_0x2625f9);_0x490c18[_0x37bfd6['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4578f9[_0xaf6d('0x17')]('\x22'+_0x2f6d17['join'](';')+'\x22');}if(_0x3088db[_0xaf6d('0x14')]){handleError(_0x4e923d[_0xaf6d('0x79')][_0x5284ac],{'code':_0xaf6d('0x8b'),'message':_0x3088db[_0xaf6d('0xd')]()});}else{fs[_0xaf6d('0x8c')](_0x28ac0d,_0x4578f9[_0xaf6d('0xd')]()+'\x0a');}_0x4578f9=[];}if(!(stats[_0xaf6d('0x7a')]%0xc8)){socket['emit'](_0xaf6d('0x8d')+_0x3e3c84,stats);stats['errors']=[];}}if(stopped){logger[_0xaf6d('0x4f')](_0xaf6d('0x8e'));_0x5bab63[_0xaf6d('0x8f')]();}}catch(_0x351128){handleError(_0x4e923d['data'][_0x5284ac],{'code':_0xaf6d('0x90'),'message':_0x351128[_0xaf6d('0x55')]});logger[_0xaf6d('0x51')](_0xaf6d('0x91'),_0x351128['message']);}},'complete':function(){try{var _0x5db945=[];var _0x20b629=[];var _0x7c8cfe=_0xaf6d('0x30');if(_0x468d0b[_0xaf6d('0x92')]&&_0x468d0b['duplicates']['length']){_0x7c8cfe=_0xaf6d('0x93')+_0x3e3c84;_0x5db945[_0xaf6d('0x17')](_0xaf6d('0x94')+_0x7c8cfe+_0xaf6d('0x95'));}tmp_campaigns=_0xaf6d('0x96')+_0x3e3c84;tmp_voice_queues=_0xaf6d('0x97')+_0x3e3c84;_0x20b629[_0xaf6d('0x17')](_0xaf6d('0x94')+tmp_campaigns+_0xaf6d('0x98'));_0x20b629[_0xaf6d('0x17')](_0xaf6d('0x94')+tmp_voice_queues+_0xaf6d('0x98'));BPromise['each'](_0x20b629,handleTZQuery)[_0xaf6d('0x15')](function(_0xdbbb79){updateTzCampaigns(_0x468d0b[_0xaf6d('0x2b')])[_0xaf6d('0x15')](function(_0x4ca0a5){updateTzVoiceQueues(_0x468d0b['ListId'])[_0xaf6d('0x15')](function(_0x1b6e1d){if(hasTZ)_0x1ae492=_0x1ae492['replace'](_0xaf6d('0x65'),_0xaf6d('0x99'));var _0x52c9d9=util[_0xaf6d('0x8')](_0xaf6d('0x9a'),_0x28ac0d,_0x7c8cfe,_0x1ae492,_0x468d0b['ListId'],_0x468d0b['CompanyId']||null,NOW,NOW);if(_[_0xaf6d('0x19')](_0x30e6d0[_0xaf6d('0x29')])){_0x52c9d9+=',\x20scheduledAt\x20=\x20NOW()';}_0x5db945[_0xaf6d('0x17')](_0x52c9d9);if(_0x468d0b['duplicates']&&_0x468d0b[_0xaf6d('0x92')][_0xaf6d('0x14')]){_0x5db945[_0xaf6d('0x17')](insertCmContact(_0x468d0b[_0xaf6d('0x2b')],_0x7c8cfe,_0x468d0b['duplicates'],_0x30e6d0));_0x5db945['push'](_0xaf6d('0x9b')+_0x7c8cfe+';');}BPromise[_0xaf6d('0x9c')](_0x5db945,handleQuery)[_0xaf6d('0x15')](function(_0x29e0ef){BPromise[_0xaf6d('0x18')]([handleAdditionalPhones()])[_0xaf6d('0x15')](function(){_0x5db945=[];for(var _0x160f18=0x0;_0x160f18\x20\x20','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','then','length','push','split','isNil','filter','CmContactHasItem','findOne','update','create','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','updatedAt','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.updatedAt','createdAt','priority','UserId','cm_contacts','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','group','Received\x20SIGINT','message','exit','errors','code','sequelize','query','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','spread','all','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x9538,0x1aa));var _0x8953=function(_0x4ed7,_0x14f3ba){_0x4ed7=_0x4ed7-0x0;var _0x584b32=_0x9538[_0x4ed7];return _0x584b32;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8953('0x0'));var Papa=require(_0x8953('0x1'));var util=require(_0x8953('0x2'));var BPromise=require(_0x8953('0x3'));var moment=require('moment');var squel=require(_0x8953('0x4'));var Redis=require(_0x8953('0x5'));var db=require(_0x8953('0x6'))['db'];var config=require(_0x8953('0x7'));var shared=require(_0x8953('0x8'));var logger=require(_0x8953('0x9'))('import');config[_0x8953('0xa')]=_[_0x8953('0xb')](config[_0x8953('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8953('0xc'))(new Redis(config[_0x8953('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x8953('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x8953('0xd')](_0x8953('0xe'));function isEmail(_0x332770){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'](_0x332770);}function selectNotIn(_0x159a4e,_0x80745,_0x64a158,_0x1317be,_0x4db032){return squel[_0x8953('0xf')]()[_0x8953('0x10')](_0x8953('0x11'))[_0x8953('0x12')](_0x1317be)[_0x8953('0x13')](_0x80745,null,_0x80745+_0x8953('0x14')+_0x1317be+'.'+_0x64a158)[_0x8953('0x15')](_0x1317be+'.'+_0x64a158+_0x8953('0x16')+_0x159a4e+'.'+_0x64a158)[_0x8953('0x15')](_0x80745+_0x8953('0x17')+_0x4db032[_0x8953('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4f2fb8,_0x2cb163){promisesAdditionalPhones=[];return db['CmContact'][_0x8953('0x18')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x8953('0x19')](function(_0x1a56d0){if(_0x1a56d0!==null){var _0x4a5eb2=[];for(var _0x340563=0x0;_0x340563<_0x1a56d0[_0x8953('0x1a')];_0x340563++){var _0x3dac4f=_0x1a56d0[_0x340563];_0x4a5eb2[_0x8953('0x1b')](insertAdditionalPhones(_0x3dac4f));}}Promise['all'](_0x4a5eb2)['then'](function(){_0x4f2fb8({'val':0x1});});});});}function insertAdditionalPhones(_0x55abdf){return new Promise(function(_0x5b9600,_0x246e7c){var _0x6de778=_0x55abdf['AdditionalPhones'];var _0x281fb2=_0x6de778['split'](';');var _0xcc3c8b=[];orderBy=0x0;for(var _0x71d91d=0x0;_0x71d91d<_0x281fb2['length'];_0x71d91d++){_0xcc3c8b[_0x8953('0x1b')](splitAdditionalPhone(_0x55abdf['id'],_0x281fb2[_0x71d91d]));}Promise['all'](_0xcc3c8b)[_0x8953('0x19')](function(){_0x5b9600({'val':_0x281fb2[_0x8953('0x1a')]});});});}function splitAdditionalPhone(_0x1e1c5a,_0x483745){return new Promise(function(_0x531241,_0x23fe2b){var _0x17ea0a=_0x483745[_0x8953('0x1c')](':');var _0x2de36c=_0x17ea0a[0x0];var _0x465874=_0x17ea0a[0x1];if(!_[_0x8953('0x1d')](_0x465874)){var _0x3b9254=_0x465874[_0x8953('0x1c')]('|');var _0x4153ae=[];for(var _0x49ad82=0x0;_0x49ad82<_0x3b9254['length'];_0x49ad82++){if(_0x3b9254[_0x49ad82]!==''){var _0x1bda90=_[_0x8953('0x1e')](promisesAdditionalPhones,{'contactId':_0x1e1c5a,'phone':_0x3b9254[_0x49ad82]});if(_0x1bda90[_0x8953('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x1e1c5a,'contactTypeId':_0x2de36c,'phone':_0x3b9254[_0x49ad82],'orderBy':orderBy});}}}_0x531241({'ok':0x1});}else _0x531241({'res':0x0});});}function createAdditionalPhone(_0x58728d,_0xdcd0e4,_0x3d8a98,_0x119672){var _0x134f3b='';var _0x24a408='';var _0x139435=_0x3d8a98['split']('§');_0x134f3b=_0x139435[0x0];if(_0x139435['length']==0x2)_0x24a408=_0x139435[0x1];return new Promise(function(_0x23324f,_0x1f66d3){return db[_0x8953('0x1f')][_0x8953('0x20')]({'where':{'CmContactId':_0x58728d,'item':_0x134f3b}})[_0x8953('0x19')](function(_0x2d216c){if(_0x2d216c){return db[_0x8953('0x1f')][_0x8953('0x21')]({'ItemTypeId':_0xdcd0e4,'description':_0x24a408,'OrderBy':_0x119672},{'where':{'CmContactId':_0x58728d,'item':_0x134f3b}})[_0x8953('0x19')](function(_0x543645){_0x23324f({'res':'updated'});});}else{return db['CmContactHasItem'][_0x8953('0x22')]({'CmContactId':_0x58728d,'item':_0x134f3b,'description':_0x24a408,'ItemTypeId':_0xdcd0e4,'OrderBy':_0x119672,'ItemClass':_0x8953('0x23')})[_0x8953('0x19')](function(_0x39d350){_0x23324f({'res':'inserted'});});}});});}function insertCmHopper(_0x3cba10,_0x53bba0,_0x54443b,_0x2f1134,_0x38f3f7){var _0x2453ae=[_0x8953('0x24'),'cm_contacts.scheduledat',_0x8953('0x25'),_0x8953('0x26'),_0x53bba0+'.'+_0x2f1134,_0x8953('0x27'),'cm_contacts.updatedAt',_0x8953('0x28'),_0x8953('0x29'),'\x22'+_0x38f3f7+'\x22'];return squel[_0x8953('0x2a')]()[_0x8953('0x2b')](_0x8953('0x2c'))[_0x8953('0x2d')]([_0x8953('0x11'),_0x8953('0x2e'),_0x8953('0x2f'),_0x8953('0x30'),_0x2f1134,'createdAt','updatedAt','priority','UserId',_0x8953('0x31')],squel[_0x8953('0xf')]()[_0x8953('0x32')](_0x2453ae)[_0x8953('0x12')](_0x53bba0)[_0x8953('0x13')]('cm_contacts',null,_0x8953('0x33')+_0x53bba0+_0x8953('0x34'))[_0x8953('0x13')](_0x54443b,null,_0x54443b+_0x8953('0x14')+_0x53bba0+'.'+_0x2f1134)[_0x8953('0x15')](_0x53bba0+_0x8953('0x35'),_0x3cba10)['where'](_0x8953('0x36'),NOW)['where'](_0x8953('0x37'),selectNotIn(_0x53bba0,_0x54443b,_0x2f1134,_0x8953('0x2c'),[_0x8953('0x38'),_0x8953('0x39')]))['where'](_0x8953('0x37'),selectNotIn(_0x53bba0,_0x54443b,_0x2f1134,'cm_hopper',[_0x8953('0x38')])))[_0x8953('0x3a')]();}function insertCmHopperBlack(_0x2368d5,_0x40a19c,_0x4ddf0a,_0x3e4cc0){var _0x23e079=[_0x8953('0x24'),_0x8953('0x25'),'cm_contacts.ListId',_0x40a19c+'.'+_0x3e4cc0,_0x8953('0x27'),'cm_contacts.updatedAt'];return squel[_0x8953('0x2a')]()[_0x8953('0x2b')](_0x8953('0x3b'))[_0x8953('0x2d')](['phone',_0x8953('0x2f'),_0x8953('0x30'),_0x3e4cc0,'createdAt',_0x8953('0x3c')],squel[_0x8953('0xf')]()[_0x8953('0x32')](_0x23e079)[_0x8953('0x12')](_0x40a19c)[_0x8953('0x13')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x40a19c+_0x8953('0x34'))[_0x8953('0x13')](_0x4ddf0a,null,_0x4ddf0a+'.id\x20=\x20'+_0x40a19c+'.'+_0x3e4cc0)['where'](_0x40a19c+_0x8953('0x35'),_0x2368d5)[_0x8953('0x15')](_0x8953('0x36'),NOW)[_0x8953('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x8953('0xf')]()['field'](_0x8953('0x11'))[_0x8953('0x12')](_0x8953('0x3b'))[_0x8953('0x15')](_0x8953('0x3d'),_0x2368d5)[_0x8953('0x15')](_0x3e4cc0+_0x8953('0x16')+_0x40a19c+'.'+_0x3e4cc0)))[_0x8953('0x3a')]();}function insertTzCmHopper(_0x472506,_0x59c1d9,_0x1097cc,_0x421de4,_0x43573d,_0x357e0e){var _0x34414d=['cm_contacts.phone',_0x8953('0x3e')+_0x357e0e+'.offset-cm_contacts.utcOffset\x20minute)',_0x8953('0x25'),'cm_contacts.ListId',_0x59c1d9+'.'+_0x421de4,_0x8953('0x27'),_0x8953('0x3f'),'cm_contacts.priority',_0x8953('0x29'),'\x22'+_0x43573d+'\x22'];var _0x401b59=squel['insert']()[_0x8953('0x2b')](_0x8953('0x2c'))['fromQuery']([_0x8953('0x11'),_0x8953('0x2e'),_0x8953('0x2f'),_0x8953('0x30'),_0x421de4,_0x8953('0x40'),_0x8953('0x3c'),_0x8953('0x41'),_0x8953('0x42'),'recallme'],squel[_0x8953('0xf')]()['fields'](_0x34414d)[_0x8953('0x12')](_0x59c1d9)['join'](_0x8953('0x43'),null,_0x8953('0x33')+_0x59c1d9+_0x8953('0x34'))[_0x8953('0x13')](_0x1097cc,null,_0x1097cc+_0x8953('0x14')+_0x59c1d9+'.'+_0x421de4)[_0x8953('0x13')](_0x357e0e,null,_0x357e0e+'.id\x20=\x20'+_0x59c1d9+'.'+_0x421de4)[_0x8953('0x15')](_0x59c1d9+_0x8953('0x35'),_0x472506)[_0x8953('0x15')](_0x8953('0x36'),NOW)[_0x8953('0x15')](_0x8953('0x37'),selectNotIn(_0x59c1d9,_0x1097cc,_0x421de4,'cm_hopper',[_0x8953('0x38'),_0x8953('0x39')]))[_0x8953('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x59c1d9,_0x1097cc,_0x421de4,_0x8953('0x2c'),[_0x8953('0x38')])))[_0x8953('0x3a')]();return _0x401b59;}function insertTzCmHopperBlack(_0xc0f55e,_0x5b3182,_0x46fbf0,_0x5dedc9){var _0x5893fe=[_0x8953('0x24'),_0x8953('0x25'),_0x8953('0x26'),_0x5b3182+'.'+_0x5dedc9,_0x8953('0x27'),'cm_contacts.updatedAt'];return squel[_0x8953('0x2a')]()[_0x8953('0x2b')](_0x8953('0x3b'))[_0x8953('0x2d')](['phone',_0x8953('0x2f'),_0x8953('0x30'),_0x5dedc9,_0x8953('0x40'),_0x8953('0x3c')],squel[_0x8953('0xf')]()['fields'](_0x5893fe)['from'](_0x5b3182)[_0x8953('0x13')]('cm_contacts',null,_0x8953('0x33')+_0x5b3182+_0x8953('0x34'))[_0x8953('0x13')](_0x46fbf0,null,_0x46fbf0+'.id\x20=\x20'+_0x5b3182+'.'+_0x5dedc9)[_0x8953('0x15')](_0x5b3182+'.CmListId\x20=\x20?',_0xc0f55e)[_0x8953('0x15')](_0x8953('0x36'),NOW)['where'](_0x8953('0x37'),squel[_0x8953('0xf')]()['field']('phone')[_0x8953('0x12')](_0x8953('0x3b'))[_0x8953('0x15')]('ListId\x20=\x20?',_0xc0f55e)[_0x8953('0x15')](_0x5dedc9+_0x8953('0x16')+_0x5b3182+'.'+_0x5dedc9)))[_0x8953('0x3a')]();}function insertCmHopperAdditionalPhones(_0x2ef2ef){var _0x15ffac=[_0x8953('0x44'),_0x8953('0x45'),_0x8953('0x46'),_0x8953('0x47'),_0x8953('0x48')];return squel[_0x8953('0x2a')]()[_0x8953('0x2b')](_0x8953('0x49'))[_0x8953('0x2d')]([_0x8953('0x4a'),_0x8953('0x11'),'OrderBy',_0x8953('0x40'),_0x8953('0x3c')],squel[_0x8953('0xf')]()[_0x8953('0x32')](_0x15ffac)['from'](_0x8953('0x2c'))[_0x8953('0x13')](_0x8953('0x43'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x8953('0x13')]('cm_contact_has_items',null,_0x8953('0x4b'))['where'](_0x8953('0x4c'),_0x2ef2ef)[_0x8953('0x15')](_0x8953('0x36'),NOW))[_0x8953('0x3a')]();}function insertCmContact(_0x22ca0a,_0x255784,_0x838966,_0x22793a){var _0x12b00d=_[_0x8953('0x4d')](_[_0x8953('0x4e')](_0x22793a),[_0x8953('0x30'),'CompanyId',_0x8953('0x40'),_0x8953('0x3c'),_0x8953('0x4f')]);return squel[_0x8953('0x2a')]()['into'](_0x8953('0x43'))[_0x8953('0x2d')](_0x12b00d,squel[_0x8953('0xf')]()[_0x8953('0x32')](_0x12b00d)['from'](_0x255784)[_0x8953('0x15')]('('+_0x838966[_0x8953('0x13')](',')+_0x8953('0x50'),squel['select']()[_0x8953('0x32')](_0x838966)[_0x8953('0x12')]('cm_contacts')[_0x8953('0x15')](_0x8953('0x3d'),_0x22ca0a)[_0x8953('0x15')](_0x8953('0x51')))[_0x8953('0x15')](_0x8953('0x52'),squel[_0x8953('0xf')]()['field']('MIN(id)','min_id')[_0x8953('0x12')](_0x255784)[_0x8953('0x53')](_0x838966['join'](','))))['toString']();}function handleStop(){logger['info'](_0x8953('0x54'));stopped=!![];}function handleUncaughtException(_0x15708b){logger['error'](_0x15708b[_0x8953('0x55')]);process[_0x8953('0x56')](0x1);}function handleError(_0xd01805,_0x49791d){stats[_0x8953('0x57')]['push']({'name':_0x49791d[_0x8953('0x58')],'message':_0x49791d[_0x8953('0x55')],'row':_0xd01805});}function handleQuery(_0x2d89b2){logger['info'](_0x2d89b2);return db[_0x8953('0x59')][_0x8953('0x5a')](_0x2d89b2)['spread'](function(_0x386d68){results[_0x8953('0x1b')](_0x386d68);})[_0x8953('0x5b')](function(_0x4f19f0){logger[_0x8953('0x5c')](_0x4f19f0['message']);});}function updateTzCampaigns(_0x579efb){return new Promise(function(_0x539bb4,_0x3214fc){var _0x4de2ed=squel['select']()['fields']([_0x8953('0x5d'),_0x8953('0x5e')])[_0x8953('0x12')](_0x8953('0x5f'))[_0x8953('0x13')](_0x8953('0x60'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x8953('0x15')](_0x8953('0x61')+_0x579efb);db[_0x8953('0x59')][_0x8953('0x5a')](_0x4de2ed[_0x8953('0x3a')]())[_0x8953('0x62')](function(_0x4629cf){var _0x358259=[];for(var _0x22db08=0x0;_0x22db08<_0x4629cf[_0x8953('0x1a')];_0x22db08++){_0x358259['push'](getTimezoneData(_0x4629cf[_0x22db08],tmp_campaigns));}BPromise[_0x8953('0x63')](_0x358259)[_0x8953('0x19')](function(){_0x539bb4({'val':0x1});});})[_0x8953('0x5b')](function(_0x486ee7){logger[_0x8953('0x5c')](_0x486ee7[_0x8953('0x55')]);_0x539bb4({'val':0x0});});});}function updateTzVoiceQueues(_0x194464){return new Promise(function(_0x528079,_0x9ce2a7){var _0x18d3b2=squel['select']()[_0x8953('0x32')]([_0x8953('0x64'),_0x8953('0x65')])[_0x8953('0x12')](_0x8953('0x66'))[_0x8953('0x13')](_0x8953('0x67'),null,_0x8953('0x68'))[_0x8953('0x15')](_0x8953('0x69')+_0x194464);db[_0x8953('0x59')][_0x8953('0x5a')](_0x18d3b2[_0x8953('0x3a')]())[_0x8953('0x62')](function(_0x35fa32){var _0x22f3d3=[];for(var _0x1a9143=0x0;_0x1a9143<_0x35fa32[_0x8953('0x1a')];_0x1a9143++){_0x22f3d3[_0x8953('0x1b')](getTimezoneData(_0x35fa32[_0x1a9143],tmp_voice_queues));}BPromise[_0x8953('0x63')](_0x22f3d3)[_0x8953('0x19')](function(){_0x528079({'val':0x1});});})['catch'](function(_0x355176){logger[_0x8953('0x5c')](_0x355176[_0x8953('0x55')]);_0x528079({'val':0x0});});});}function getTimezoneData(_0x277736,_0x1881af){return new Promise(function(_0x34b7d2,_0x224689){var _0x50d1b4=shared[_0x8953('0x6a')];var _0xa01a2a=_0x50d1b4[_0x277736[_0x8953('0x6b')]];if(_[_0x8953('0x1d')](_0xa01a2a)){_0x34b7d2({'ret':0x1});}else{var _0x228616=_0xa01a2a[_0x8953('0x6c')];var _0x1a2504=squel[_0x8953('0x2a')]()[_0x8953('0x2b')](_0x1881af)['set']('id',_0x277736['id'])[_0x8953('0x6d')](_0x8953('0x6e'),_0x228616)[_0x8953('0x6d')](_0x8953('0x6b'),_0x277736[_0x8953('0x6b')])[_0x8953('0x3a')]();return db[_0x8953('0x59')][_0x8953('0x5a')](_0x1a2504)[_0x8953('0x62')](function(_0x155a07){_0x34b7d2({'ret':0x1});})[_0x8953('0x5b')](function(_0x2324aa){logger[_0x8953('0x5c')](_0x2324aa[_0x8953('0x55')]);_0x224689({'ret':0x1});});}});}function handleTZQuery(_0x235459){logger[_0x8953('0x6f')](_0x235459);return db[_0x8953('0x59')][_0x8953('0x5a')](_0x235459)[_0x8953('0x62')](function(_0x15e8c6){})[_0x8953('0x5b')](function(_0xdea1d3){logger[_0x8953('0x5c')](_0xdea1d3[_0x8953('0x55')]);});}function main(_0xa1906d,_0x133613,_0x14c84e,_0x104847){logger[_0x8953('0x6f')](_0x8953('0x70'),_0xa1906d,JSON[_0x8953('0x71')](_0x133613));process[_0x8953('0x72')](_0x8953('0x73'));var _0x5214a4=_0x133613[_0x8953('0x74')];var _0xc4c52f=_[_0x8953('0x75')](_0x5214a4);var _0x18b8a3=_0x133613[_0x8953('0x76')];var _0x57a9a9=path[_0x8953('0x13')](config['root'],_0x8953('0x77'),_0x18b8a3+_0x8953('0x78'));hasTZ=_['keys'](_0x5214a4)[_0x8953('0x79')]('dialTimezone');var _0x1e842f=_[_0x8953('0x4e')](_0x5214a4)['join']();logger['info'](_0x8953('0x7a'),_0x1e842f);db['ContactItemType'][_0x8953('0x18')]({'raw':!![],'attributes':['id',_0x8953('0x7b')]})[_0x8953('0x19')](function(_0x544177){for(var _0x4c492a=0x0;_0x4c492a<_0x544177[_0x8953('0x1a')];_0x4c492a++){if(_0x544177[_0x4c492a][_0x8953('0x7b')]in _0x5214a4){contactItemTypes[_0x8953('0x1b')](_0x544177[_0x4c492a]);delete _0xc4c52f[_0x544177[_0x4c492a]['name']];hasAdditionalPhones=!![];}for(var _0x3d758e in _0x5214a4){if(_0x544177[_0x4c492a][_0x8953('0x7b')]+_0x8953('0x7c')===_0x3d758e){phoneDescriptions[_0x8953('0x1b')]({'itemTypeId':_0x544177[_0x4c492a]['id'],'description':_0x3d758e});delete _0xc4c52f[_0x3d758e];}}}if(hasAdditionalPhones)_0xc4c52f[_0x8953('0x7d')]='';var _0x5a410a=_['keys'](_0xc4c52f)[_0x8953('0x13')]();logger[_0x8953('0x6f')](_0x8953('0x7a'),_0x5a410a);fs[_0x8953('0x7e')](_0x57a9a9,_0x5a410a+'\x0a');Papa[_0x8953('0x7f')](fs[_0x8953('0x80')](_0xa1906d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x8b7c02,_0x1a76ff){try{for(var _0x20ac04=0x0,_0xc4068c=[];_0x20ac04<_0x8b7c02['data'][_0x8953('0x1a')];_0x20ac04++){stats[_0x8953('0x81')]+=0x1;if(_0x8b7c02[_0x8953('0x57')][_0x20ac04]){handleError(_0x8b7c02[_0x8953('0x82')][_0x20ac04],_0x8b7c02[_0x8953('0x57')][_0x20ac04]);}else{var _0x49948f=[];var _0x3d7bf7=[];var _0x193bbd={};for(var _0x294669 in _0x5214a4){let _0x1148b9=contactItemTypes[_0x8953('0x83')](_0x2a3e5b=>_0x2a3e5b[_0x8953('0x7b')]===_0x294669);let _0xe80a66=contactItemTypes['find'](_0x4a5542=>_0x4a5542[_0x8953('0x7b')]+_0x8953('0x7c')===_0x294669);if(_['isNil'](_0x1148b9)&&_[_0x8953('0x1d')](_0xe80a66)){if(_0x5214a4[_0x8953('0x84')](_0x294669)){if(_0x8b7c02[_0x8953('0x82')][_0x20ac04][_0x5214a4[_0x294669]]){var _0x3a6dd9=_['trim'](_0x8b7c02[_0x8953('0x82')][_0x20ac04][_0x5214a4[_0x294669]][_0x8953('0x85')](/"/g,'\x27'));switch(_0x294669){case _0x8953('0x2e'):var _0x1b7afa=moment(_0x3a6dd9,_0x8953('0xe'),!![]);if(_0x1b7afa[_0x8953('0x86')]()){_0xc4068c[_0x8953('0x1b')]('\x22'+_0x3a6dd9+'\x22');}else{_0x49948f[_0x8953('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x8953('0x41'):var _0x333898=parseInt(_0x3a6dd9);_0x3a6dd9=_['isNaN'](_0x333898)||_0x333898<0x0||_0x333898>0x4?_0x104847?0x3:0x2:_0x333898;_0xc4068c[_0x8953('0x1b')]('\x22'+_0x3a6dd9+'\x22');break;case _0x8953('0x42'):var _0x268bba=parseInt(_0x3a6dd9);if(_[_0x8953('0x87')](_0x268bba)&&_[_0x8953('0x79')](_0x14c84e,_0x268bba)){_0xc4068c['push']('\x22'+_0x268bba+'\x22');}else{_0x49948f[_0x8953('0x1b')](_0x8953('0x88'));}break;case _0x8953('0x89'):if(isEmail(_0x3a6dd9)){_0xc4068c[_0x8953('0x1b')]('\x22'+_0x3a6dd9+'\x22');}else{_0x49948f['push'](_0x8953('0x8a'));}break;case _0x8953('0x8b'):var _0x5c8502=moment(_0x3a6dd9,_0x8953('0x8c'),!![]);if(_0x5c8502[_0x8953('0x86')]()){_0xc4068c[_0x8953('0x1b')]('\x22'+_0x3a6dd9+'\x22');}else{_0x49948f[_0x8953('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x22b1c0=shared[_0x8953('0x6a')];var _0x59867e=_0x22b1c0[_0x3a6dd9];if(!_[_0x8953('0x1d')](_0x59867e)){var _0x39e7f9=_0x59867e[_0x8953('0x6c')];_0xc4068c[_0x8953('0x1b')]('\x22'+_0x3a6dd9+'\x22');_0xc4068c[_0x8953('0x1b')]('\x22'+_0x39e7f9+'\x22');}break;default:_0xc4068c[_0x8953('0x1b')]('\x22'+_0x3a6dd9+'\x22');}}else{switch(_0x294669){case _0x8953('0x8d'):case _0x8953('0x11'):_0x49948f['push'](_0x294669+_0x8953('0x8e'));break;default:_0xc4068c['push']('\x22\x22');}}}}else{var _0x11bc36='';if(!_['isNil'](_0x1148b9)){if(!_0x193bbd['hasOwnProperty'](_0x1148b9['id'])){if(!_[_0x8953('0x1d')](_0x8b7c02[_0x8953('0x82')][_0x20ac04][_0x5214a4[_0x294669]])){var _0x3a6dd9=_[_0x8953('0x8f')](_0x8b7c02[_0x8953('0x82')][_0x20ac04][_0x5214a4[_0x294669]][_0x8953('0x85')](/"/g,'\x27'));var _0x3ffb13=phoneDescriptions[_0x8953('0x83')](_0x47eb4f=>_0x47eb4f['itemTypeId']===_0x1148b9['id']);if(!_[_0x8953('0x1d')](_0x3ffb13)){var _0x559e93=_['trim'](_0x8b7c02[_0x8953('0x82')][_0x20ac04][_0x5214a4[_0x3ffb13[_0x8953('0x90')]]][_0x8953('0x85')](/"/g,'\x27'));if(!_[_0x8953('0x1d')](_0x559e93))_0x3a6dd9=_0x3a6dd9+'§'+_0x559e93;}if(_0x11bc36=='')_0x11bc36=_0x3a6dd9;else _0x11bc36+='|'+_0x3a6dd9;}_0x3d7bf7[_0x8953('0x1b')](_0x1148b9['id']+':'+_0x11bc36);_0x193bbd[_0x1148b9['id']]=0x1;}}}}if(hasAdditionalPhones){_0xc4068c[_0x8953('0x1b')]('\x22'+_0x3d7bf7[_0x8953('0x13')](';')+'\x22');}if(_0x49948f['length']){handleError(_0x8b7c02[_0x8953('0x82')][_0x20ac04],{'code':_0x8953('0x91'),'message':_0x49948f['join']()});}else{fs[_0x8953('0x92')](_0x57a9a9,_0xc4068c[_0x8953('0x13')]()+'\x0a');}_0xc4068c=[];}if(!(stats[_0x8953('0x81')]%0xc8)){socket[_0x8953('0x93')]('contact:import:'+_0x18b8a3,stats);stats['errors']=[];}}if(stopped){logger[_0x8953('0x6f')]('Abort\x20parser');_0x1a76ff[_0x8953('0x94')]();}}catch(_0x58c5f2){handleError(_0x8b7c02[_0x8953('0x82')][_0x20ac04],{'code':_0x8953('0x95'),'message':_0x58c5f2[_0x8953('0x55')]});logger[_0x8953('0x5c')](_0x8953('0x96'),_0x58c5f2[_0x8953('0x55')]);}},'complete':function(){try{var _0x610e32=[];var _0x1d9137=[];var _0x5eacac=_0x8953('0x43');if(_0x133613['duplicates']&&_0x133613['duplicates'][_0x8953('0x1a')]){_0x5eacac='cm_contacts_'+_0x18b8a3;_0x610e32[_0x8953('0x1b')](_0x8953('0x97')+_0x5eacac+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x8953('0x98')+_0x18b8a3;tmp_voice_queues='voice_queues_'+_0x18b8a3;_0x1d9137['push'](_0x8953('0x97')+tmp_campaigns+_0x8953('0x99'));_0x1d9137[_0x8953('0x1b')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x8953('0x99'));BPromise['each'](_0x1d9137,handleTZQuery)['then'](function(_0x4ab0a9){updateTzCampaigns(_0x133613[_0x8953('0x30')])['then'](function(_0x1c6fa3){updateTzVoiceQueues(_0x133613['ListId'])[_0x8953('0x19')](function(_0x20ac00){if(hasTZ)_0x5a410a=_0x5a410a[_0x8953('0x85')]('dialTimezone',_0x8953('0x9a'));var _0xd6fd89=util['format'](_0x8953('0x9b'),_0x57a9a9,_0x5eacac,_0x5a410a,_0x133613[_0x8953('0x30')],_0x133613[_0x8953('0x9c')]||null,NOW,NOW);if(_[_0x8953('0x1d')](_0x5214a4[_0x8953('0x2e')])){_0xd6fd89+=_0x8953('0x9d');}_0x610e32[_0x8953('0x1b')](_0xd6fd89);if(_0x133613['duplicates']&&_0x133613[_0x8953('0x9e')][_0x8953('0x1a')]){_0x610e32[_0x8953('0x1b')](insertCmContact(_0x133613[_0x8953('0x30')],_0x5eacac,_0x133613[_0x8953('0x9e')],_0x5214a4));_0x610e32[_0x8953('0x1b')](_0x8953('0x9f')+_0x5eacac+';');}BPromise[_0x8953('0xa0')](_0x610e32,handleQuery)[_0x8953('0x19')](function(_0x53679a){BPromise[_0x8953('0x63')]([handleAdditionalPhones()])['then'](function(){_0x610e32=[];for(var _0x514517=0x0;_0x514517_0x2de85a['name']===_0x33b521);let _0x1a3422=contactItemTypes[_0x8d79('0x73')](_0x1641d5=>_0x1641d5[_0x8d79('0x6b')]+_0x8d79('0x6c')===_0x33b521);if(_[_0x8d79('0x1a')](_0x176059)&&_[_0x8d79('0x1a')](_0x1a3422)){if(_0x31734e[_0x8d79('0x74')](_0x33b521)){if(_0x45ac4a[_0x8d79('0x71')][_0x363908][_0x31734e[_0x33b521]]){var _0x390c4c=_[_0x8d79('0x75')](_0x45ac4a[_0x8d79('0x71')][_0x363908][_0x31734e[_0x33b521]][_0x8d79('0x76')](/"/g,'\x27'));switch(_0x33b521){case'scheduledat':var _0x4cc4dc=moment(_0x390c4c,_0x8d79('0xb'),!![]);if(_0x4cc4dc[_0x8d79('0x77')]()){_0x1241cf[_0x8d79('0x1c')]('\x22'+_0x390c4c+'\x22');}else{_0x16802d['push'](_0x8d79('0x78'));}break;case'priority':var _0x522c6d=parseInt(_0x390c4c);_0x390c4c=_[_0x8d79('0x79')](_0x522c6d)||_0x522c6d<0x0||_0x522c6d>0x4?_0x5b20bf?0x3:0x2:_0x522c6d;_0x1241cf['push']('\x22'+_0x390c4c+'\x22');break;case'UserId':var _0x273134=parseInt(_0x390c4c);if(_[_0x8d79('0x7a')](_0x273134)&&_[_0x8d79('0x7b')](_0xcd3af6,_0x273134)){_0x1241cf[_0x8d79('0x1c')]('\x22'+_0x273134+'\x22');}else{_0x16802d['push'](_0x8d79('0x7c'));}break;case _0x8d79('0x7d'):if(isEmail(_0x390c4c)){_0x1241cf['push']('\x22'+_0x390c4c+'\x22');}else{_0x16802d[_0x8d79('0x1c')](_0x8d79('0x7e'));}break;case'dateOfBirth':var _0x50d5d8=moment(_0x390c4c,_0x8d79('0x7f'),!![]);if(_0x50d5d8[_0x8d79('0x77')]()){_0x1241cf[_0x8d79('0x1c')]('\x22'+_0x390c4c+'\x22');}else{_0x16802d[_0x8d79('0x1c')](_0x8d79('0x80'));}break;default:_0x1241cf['push']('\x22'+_0x390c4c+'\x22');}}else{switch(_0x33b521){case _0x8d79('0x81'):case _0x8d79('0x11'):_0x16802d['push'](_0x33b521+'\x20not\x20specified');break;default:_0x1241cf[_0x8d79('0x1c')]('\x22\x22');}}}}else{var _0xa9a7d8='';if(!_[_0x8d79('0x1a')](_0x176059)){if(!_0x522f5a[_0x8d79('0x74')](_0x176059['id'])){for(var _0x3210df=0x0;_0x3210df<_0x31734e[_0x33b521][_0x8d79('0x19')];_0x3210df++){var _0x390c4c=_['trim'](_0x45ac4a[_0x8d79('0x71')][_0x363908][_0x31734e[_0x33b521][_0x3210df]][_0x8d79('0x76')](/"/g,'\x27'));var _0x4c5fe6=phoneDescriptions[_0x8d79('0x73')](_0x3de27c=>_0x3de27c[_0x8d79('0x82')]===_0x176059['id']);if(!_[_0x8d79('0x1a')](_0x4c5fe6)){var _0x148fd8=_[_0x8d79('0x75')](_0x45ac4a[_0x8d79('0x71')][_0x363908][_0x31734e[_0x4c5fe6[_0x8d79('0x83')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x8d79('0x1a')](_0x148fd8))_0x390c4c=_0x390c4c+'§'+_0x148fd8;}if(_0xa9a7d8=='')_0xa9a7d8=_0x390c4c;else _0xa9a7d8+='|'+_0x390c4c;}_0x35f59b['push'](_0x176059['id']+':'+_0xa9a7d8);_0x522f5a[_0x176059['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1241cf['push']('\x22'+_0x35f59b['join'](';')+'\x22');}if(_0x16802d[_0x8d79('0x19')]){handleError(_0x45ac4a[_0x8d79('0x71')][_0x363908],{'code':_0x8d79('0x84'),'message':_0x16802d[_0x8d79('0x3f')]()});}else{fs[_0x8d79('0x85')](_0xb7811,_0x1241cf[_0x8d79('0x3f')]()+'\x0a');}_0x1241cf=[];}if(!(stats[_0x8d79('0x86')]%0xc8)){socket['emit'](_0x8d79('0x87')+_0x4a401b,stats);stats[_0x8d79('0x72')]=[];}}if(stopped){logger['info'](_0x8d79('0x88'));_0x134363['abort']();}}catch(_0xfa7824){handleError(_0x45ac4a[_0x8d79('0x71')][_0x363908],{'code':'SystemError','message':_0xfa7824['message']});logger[_0x8d79('0x1e')](_0x8d79('0x89'),_0xfa7824[_0x8d79('0x8a')]);}},'complete':function(){try{var _0x4a3227=[];var _0x2e9cf8=tempTableName;_0x4a3227[_0x8d79('0x1c')]('CREATE\x20TABLE\x20'+_0x2e9cf8+_0x8d79('0x8b'));logger['info'](_0x8d79('0x8c'),contactItemTypes[_0x8d79('0x19')]);var _0x1b534d=util[_0x8d79('0xa')](_0x8d79('0x8d'),_0xb7811,_0x2e9cf8,_0x5b9ef9,_0x4b0bc7[_0x8d79('0x35')],_0x4b0bc7[_0x8d79('0x56')]||null,NOW,NOW);if(_[_0x8d79('0x1a')](_0x31734e['scheduledat'])){_0x1b534d+=_0x8d79('0x8e');}_0x4a3227[_0x8d79('0x1c')](_0x1b534d);BPromise[_0x8d79('0x8f')](_0x4a3227,handleQuery)['then'](function(_0x5cf87f){BPromise[_0x8d79('0x20')]([handleAdditionalPhones()])['then'](function(){_0x4a3227=[];for(var _0x4d631a=0x0;_0x4d631a\x20\x20');}var _0x26471c=path[_0x8d79('0x3f')](config[_0x8d79('0x65')],_0x8d79('0x66'),process[_0x8d79('0x99')][0x2]);if(!fs[_0x8d79('0x9a')](_0x26471c)){throw new Error(_0x8d79('0x9b'));}var _0x3c102a={};try{_0x3c102a=JSON[_0x8d79('0x6f')](process[_0x8d79('0x99')][0x3]);if(!_0x3c102a['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x1adb1a=0x0;if(_0x3c102a[_0x8d79('0x63')][_0x8d79('0x39')]){_0x1adb1a=0x1;}if(!_0x3c102a['ListId']){throw new Error(_0x8d79('0x9c'));}}catch(_0x2e4d97){throw new Error(_0x8d79('0x9d'));}var _0x1106b6=[];try{_0x1106b6=_[_0x8d79('0x9e')](JSON['parse'](process[_0x8d79('0x99')][0x4]),'id');}catch(_0x39c1a7){logger['info'](_0x8d79('0x9f'));}main(_0x26471c,_0x3c102a,_0x1106b6,_0x1adb1a);}validate();process['on'](_0x8d79('0xa0'),handleStop);process['on'](_0x8d79('0xa1'),handleUncaughtException); \ No newline at end of file +var _0xa88f=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','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',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','errors','code','send','binding','clone','root','server/files/tmp','.csv','body','ContactItemType','name','_description','header','writeFileSync','data','find','hasOwnProperty','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','itemTypeId','SystemRow','rows','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','CIS\x20len','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','CompanyId','each','contact','contactTypeId','orderBy','finish','emit','contact:import:','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','parse','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','uncaughtException','path','lodash','papaparse','util','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','field','phone','from','join','where','sequelize','query','spread','isNil','AdditionalPhones','push','all','then','catch','error','message','length','split','filter','CmContactHasItem','findOne','updated','create','inserted','update','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_hopper','\x22always\x22','toString','cm_contacts.createdAt','cm_contacts.updatedAt','insert','cm_hopper_black','fields','ListId\x20=\x20?','\x20=\x20?'];(function(_0x4fe2d7,_0x453708){var _0x123262=function(_0x4e452f){while(--_0x4e452f){_0x4fe2d7['push'](_0x4fe2d7['shift']());}};_0x123262(++_0x453708);}(_0xa88f,0x182));var _0xfa88=function(_0x2e0276,_0x51d7b8){_0x2e0276=_0x2e0276-0x0;var _0x7204fe=_0xa88f[_0x2e0276];return _0x7204fe;};'use strict';var fs=require('fs');var path=require(_0xfa88('0x0'));var _=require(_0xfa88('0x1'));var Papa=require(_0xfa88('0x2'));var util=require(_0xfa88('0x3'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xfa88('0x4'));var Redis=require(_0xfa88('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xfa88('0x6'));var logger=require(_0xfa88('0x7'))(_0xfa88('0x8'));config[_0xfa88('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfa88('0xa'))(new Redis(config[_0xfa88('0x9')]));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()[_0xfa88('0xb')](_0xfa88('0xc'));var tempTableName='cm_contacts_temp_'+moment()['format'](_0xfa88('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4037e3){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))*$/[_0xfa88('0xe')](_0x4037e3);}function selectNotIn(_0x4b375c,_0x1d8487,_0x102d10,_0x4d92e7,_0x2432cd){return squel[_0xfa88('0xf')]()[_0xfa88('0x10')](_0xfa88('0x11'))[_0xfa88('0x12')](_0x4d92e7)[_0xfa88('0x13')](_0x1d8487,null,_0x1d8487+'.id\x20=\x20'+_0x4d92e7+'.'+_0x102d10)[_0xfa88('0x14')](_0x4d92e7+'.'+_0x102d10+'\x20=\x20'+_0x4b375c+'.'+_0x102d10)[_0xfa88('0x14')](_0x1d8487+'.dialCheckDuplicateType\x20IN\x20('+_0x2432cd[_0xfa88('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3448a5,_0x5c8c11){promisesAdditionalPhones=[];promisesContact=[];return db[_0xfa88('0x15')][_0xfa88('0x16')]('select\x20*\x20from\x20'+tempTableName)[_0xfa88('0x17')](function(_0x39e9c5){if(_0x39e9c5!==null){var _0x40daca=[];for(var _0x18380a=0x0;_0x18380a<_0x39e9c5['length'];_0x18380a++){var _0x20a4c2=_0x39e9c5[_0x18380a];if(!_[_0xfa88('0x18')](_0x20a4c2[_0xfa88('0x11')])){if(!_[_0xfa88('0x18')](_0x20a4c2[_0xfa88('0x19')]))_0x40daca[_0xfa88('0x1a')](insertAdditionalPhones(_0x20a4c2));promisesContact['push']({'contact':_0x20a4c2});}}}Promise[_0xfa88('0x1b')](_0x40daca)[_0xfa88('0x1c')](function(){_0x3448a5({'val':0x1});});})[_0xfa88('0x1d')](function(_0x4d1489){logger[_0xfa88('0x1e')](_0x4d1489[_0xfa88('0x1f')]);});});}function insertAdditionalPhones(_0x5a225e){return new Promise(function(_0x1e6897,_0x15c286){var _0x48c827=_0x5a225e[_0xfa88('0x19')];if(_[_0xfa88('0x18')](_0x48c827))_0x15c286({'val':0x0});else{var _0x1b0808=_0x48c827['split'](';');var _0x5191af=[];orderBy=0x0;for(var _0x394b93=0x0;_0x394b93<_0x1b0808[_0xfa88('0x20')];_0x394b93++){_0x5191af[_0xfa88('0x1a')](splitAdditionalPhone(_0x5a225e['id'],_0x1b0808[_0x394b93]));}Promise['all'](_0x5191af)[_0xfa88('0x1c')](function(){_0x1e6897({'val':_0x1b0808[_0xfa88('0x20')]});});}});}function splitAdditionalPhone(_0x49d00e,_0x5eb8d1){return new Promise(function(_0x5e0d7f,_0x52bf05){var _0x4f0d16=_0x5eb8d1['split'](':');var _0x254790=_0x4f0d16[0x0];var _0x1be550=_0x4f0d16[0x1];if(_0x1be550!==''){var _0x5cbc65=_0x1be550[_0xfa88('0x21')]('|');var _0x14eb41=[];for(var _0x4cda27=0x0;_0x4cda27<_0x5cbc65[_0xfa88('0x20')];_0x4cda27++){if(_0x5cbc65[_0x4cda27]!==''){var _0x3114a8=_[_0xfa88('0x22')](promisesAdditionalPhones,{'contactId':_0x49d00e,'phone':_0x5cbc65[_0x4cda27]});if(_0x3114a8['length']==0x0){orderBy++;promisesAdditionalPhones[_0xfa88('0x1a')]({'contactId':_0x49d00e,'contactTypeId':_0x254790,'phone':_0x5cbc65[_0x4cda27],'orderBy':orderBy});}}}_0x5e0d7f({'ok':0x1});}else _0x5e0d7f({'res':0x0});});}function createAdditionalPhone(_0x193580,_0x586b99,_0x8aaf7c,_0x90ef74){var _0x13b87b='';var _0x584e7b='';var _0x30ca6c=_0x8aaf7c[_0xfa88('0x21')]('§');_0x13b87b=_0x30ca6c[0x0];if(_0x30ca6c[_0xfa88('0x20')]==0x2)_0x584e7b=_0x30ca6c[0x1];return new Promise(function(_0x245ee3,_0x45e65f){return db[_0xfa88('0x23')][_0xfa88('0x24')]({'where':{'CmContactId':_0x193580,'item':_0x13b87b}})[_0xfa88('0x1c')](function(_0x1628a4){if(_0x1628a4){return db[_0xfa88('0x23')]['update']({'ItemTypeId':_0x586b99,'description':_0x584e7b,'OrderBy':_0x90ef74},{'where':{'CmContactId':_0x193580,'item':_0x13b87b}})[_0xfa88('0x1c')](function(_0x1951fb){_0x245ee3({'res':_0xfa88('0x25')});});}else{return db[_0xfa88('0x23')][_0xfa88('0x26')]({'CmContactId':_0x193580,'item':_0x13b87b,'ItemTypeId':_0x586b99,'description':_0x584e7b,'OrderBy':_0x90ef74,'ItemClass':'PHONE'})[_0xfa88('0x1c')](function(_0x5a3749){_0x245ee3({'res':_0xfa88('0x27')});});}});});}function updateContact(_0x45cdf5){return new Promise(function(_0x596e7c,_0x22a27c){var _0x1682c3=_0x45cdf5['id'];delete _0x45cdf5['id'];return db['CmContact'][_0xfa88('0x28')](_0x45cdf5,{'where':{'id':_0x1682c3}})[_0xfa88('0x1c')](function(_0x3b1b8a){updatedRows+=0x1;return db[_0xfa88('0x29')][_0xfa88('0x28')]({'phone':_0x45cdf5['phone']},{'where':{'ContactId':_0x1682c3}})[_0xfa88('0x1c')](function(_0x165d25){_0x596e7c({'ret':'OK'});});});});}function insertCmHopper(_0x2af9fa,_0x5094e9,_0x1ee6b9,_0x35b984,_0x11e777){var _0x31978f=[_0xfa88('0x2a'),'cm_contacts.scheduledat',_0xfa88('0x2b'),_0xfa88('0x2c'),_0x5094e9+'.'+_0x35b984,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xfa88('0x2d'),_0xfa88('0x2e'),'\x22'+_0x11e777+'\x22'];return squel['insert']()[_0xfa88('0x2f')]('cm_hopper')[_0xfa88('0x30')]([_0xfa88('0x11'),'scheduledat',_0xfa88('0x31'),_0xfa88('0x32'),_0x35b984,_0xfa88('0x33'),_0xfa88('0x34'),'priority',_0xfa88('0x35'),_0xfa88('0x36')],squel[_0xfa88('0xf')]()['fields'](_0x31978f)[_0xfa88('0x12')](_0x5094e9)[_0xfa88('0x13')](_0xfa88('0x37'),null,_0xfa88('0x38')+_0x5094e9+_0xfa88('0x39'))[_0xfa88('0x13')](_0x1ee6b9,null,_0x1ee6b9+_0xfa88('0x3a')+_0x5094e9+'.'+_0x35b984)[_0xfa88('0x14')](_0x5094e9+_0xfa88('0x3b'),_0x2af9fa)[_0xfa88('0x14')](_0xfa88('0x3c'),NOW)[_0xfa88('0x14')](_0xfa88('0x3d'),selectNotIn(_0x5094e9,_0x1ee6b9,_0x35b984,'cm_hopper',['\x22always\x22',_0xfa88('0x3e')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5094e9,_0x1ee6b9,_0x35b984,_0xfa88('0x3f'),[_0xfa88('0x40')])))[_0xfa88('0x41')]();}function insertCmHopperBlack(_0x4357d1,_0x54949c,_0xf9105d,_0x437177){var _0x4570ec=[_0xfa88('0x2a'),_0xfa88('0x2b'),_0xfa88('0x2c'),_0x54949c+'.'+_0x437177,_0xfa88('0x42'),_0xfa88('0x43')];return squel[_0xfa88('0x44')]()[_0xfa88('0x2f')](_0xfa88('0x45'))['fromQuery']([_0xfa88('0x11'),_0xfa88('0x31'),_0xfa88('0x32'),_0x437177,'createdAt',_0xfa88('0x34')],squel[_0xfa88('0xf')]()[_0xfa88('0x46')](_0x4570ec)[_0xfa88('0x12')](_0x54949c)['join'](_0xfa88('0x37'),null,_0xfa88('0x38')+_0x54949c+_0xfa88('0x39'))[_0xfa88('0x13')](_0xf9105d,null,_0xf9105d+_0xfa88('0x3a')+_0x54949c+'.'+_0x437177)[_0xfa88('0x14')](_0x54949c+_0xfa88('0x3b'),_0x4357d1)[_0xfa88('0x14')](_0xfa88('0x3c'),NOW)[_0xfa88('0x14')](_0xfa88('0x3d'),squel[_0xfa88('0xf')]()['field'](_0xfa88('0x11'))[_0xfa88('0x12')](_0xfa88('0x45'))[_0xfa88('0x14')](_0xfa88('0x47'),_0x4357d1)['where'](_0x437177+_0xfa88('0x48'),_0x54949c+'.'+_0x437177)))[_0xfa88('0x41')]();}function insertCmHopperAdditionalPhones(_0x3c0395){var _0x12efed=[_0xfa88('0x49'),_0xfa88('0x4a'),_0xfa88('0x4b'),_0xfa88('0x4c'),_0xfa88('0x4d')];return squel[_0xfa88('0x44')]()[_0xfa88('0x2f')]('cm_hopper_additional_phones')['fromQuery']([_0xfa88('0x4e'),_0xfa88('0x11'),'OrderBy',_0xfa88('0x33'),_0xfa88('0x34')],squel[_0xfa88('0xf')]()['fields'](_0x12efed)[_0xfa88('0x12')](_0xfa88('0x3f'))[_0xfa88('0x13')](_0xfa88('0x37'),null,_0xfa88('0x4f'))['join'](_0xfa88('0x50'),null,_0xfa88('0x51'))['where'](_0xfa88('0x52'),_0x3c0395)[_0xfa88('0x14')](_0xfa88('0x3c'),NOW))[_0xfa88('0x41')]();}function insertCmContact(_0x56f934,_0x3f9c85,_0x4963d1,_0x4ff262){var _0x1915d5=_['concat'](_[_0xfa88('0x53')](_0x4ff262),[_0xfa88('0x32'),'CompanyId',_0xfa88('0x33'),_0xfa88('0x34')]);return squel[_0xfa88('0x44')]()[_0xfa88('0x2f')](_0xfa88('0x37'))['fromQuery'](_0x1915d5,squel[_0xfa88('0xf')]()[_0xfa88('0x46')](_0x1915d5)['from'](_0x3f9c85)[_0xfa88('0x14')]('('+_0x4963d1[_0xfa88('0x13')](',')+_0xfa88('0x54'),squel[_0xfa88('0xf')]()[_0xfa88('0x46')](_0x4963d1)[_0xfa88('0x12')]('cm_contacts')['where'](_0xfa88('0x47'),_0x56f934))[_0xfa88('0x14')](_0xfa88('0x55'),squel['select']()[_0xfa88('0x10')](_0xfa88('0x56'),_0xfa88('0x57'))['from'](_0x3f9c85)[_0xfa88('0x58')](_0x4963d1[_0xfa88('0x13')](','))))[_0xfa88('0x41')]();}function handleStop(){logger[_0xfa88('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2d56eb){logger['error'](_0x2d56eb[_0xfa88('0x1f')]);process['exit'](0x1);}function handleError(_0x19aed8,_0x8f0319){stats[_0xfa88('0x5a')][_0xfa88('0x1a')]({'name':_0x8f0319[_0xfa88('0x5b')],'message':_0x8f0319[_0xfa88('0x1f')],'row':_0x19aed8});}function handleQuery(_0x2a6129){logger['info'](_0x2a6129);return db[_0xfa88('0x15')][_0xfa88('0x16')](_0x2a6129)[_0xfa88('0x17')](function(_0x2e5b0d){results[_0xfa88('0x1a')](_0x2e5b0d);})['catch'](function(_0x35285c){logger[_0xfa88('0x1e')](_0x35285c['message']);});}function main(_0x4ce9b5,_0x19a16e,_0x1a6b2e,_0x2d06e3){logger['info']('main',_0x4ce9b5,JSON['stringify'](_0x19a16e));process[_0xfa88('0x5c')]('start');var _0x28ea6a=_0x19a16e[_0xfa88('0x5d')];var _0x183721=_[_0xfa88('0x5e')](_0x28ea6a);var _0x6b2852=_0x19a16e['socket_timestamp'];var _0x1d3162=path['join'](config[_0xfa88('0x5f')],_0xfa88('0x60'),_0x6b2852+_0xfa88('0x61'));logger[_0xfa88('0x59')](_0xfa88('0x62'),_0x19a16e);db[_0xfa88('0x63')]['findAll']({'raw':!![],'attributes':['id',_0xfa88('0x64')]})[_0xfa88('0x1c')](function(_0x5992ff){for(var _0x3a4a8f=0x0;_0x3a4a8f<_0x5992ff[_0xfa88('0x20')];_0x3a4a8f++){if(_0x5992ff[_0x3a4a8f][_0xfa88('0x64')]in _0x28ea6a){contactItemTypes[_0xfa88('0x1a')](_0x5992ff[_0x3a4a8f]);delete _0x183721[_0x5992ff[_0x3a4a8f][_0xfa88('0x64')]];hasAdditionalPhones=!![];}for(var _0x39fc04 in _0x28ea6a){if(_0x5992ff[_0x3a4a8f][_0xfa88('0x64')]+_0xfa88('0x65')===_0x39fc04){phoneDescriptions[_0xfa88('0x1a')]({'itemTypeId':_0x5992ff[_0x3a4a8f]['id'],'description':_0x39fc04});delete _0x183721[_0x39fc04];}}}if(hasAdditionalPhones)_0x183721['AdditionalPhones']='';var _0x5b5f56=_[_0xfa88('0x53')](_0x183721)[_0xfa88('0x13')]();logger[_0xfa88('0x59')](_0xfa88('0x66'),_0x5b5f56);fs[_0xfa88('0x67')](_0x1d3162,_0x5b5f56+'\x0a');Papa['parse'](fs['createReadStream'](_0x4ce9b5),{'header':!![],'skipEmptyLines':!![],'step':function(_0xb940a,_0x2d010f){try{for(var _0x5128f7=0x0,_0x58769c=[];_0x5128f7<_0xb940a[_0xfa88('0x68')]['length'];_0x5128f7++){stats['rows']+=0x1;if(_0xb940a['errors'][_0x5128f7]){handleError(_0xb940a[_0xfa88('0x68')][_0x5128f7],_0xb940a['errors'][_0x5128f7]);}else{var _0xa772=[];var _0x48dcb=[];var _0x474fad={};for(var _0xa91137 in _0x28ea6a){let _0x3c2fff=contactItemTypes[_0xfa88('0x69')](_0x4657df=>_0x4657df['name']===_0xa91137);let _0x2f008a=contactItemTypes[_0xfa88('0x69')](_0x42baf3=>_0x42baf3[_0xfa88('0x64')]+_0xfa88('0x65')===_0xa91137);if(_[_0xfa88('0x18')](_0x3c2fff)&&_[_0xfa88('0x18')](_0x2f008a)){if(_0x28ea6a[_0xfa88('0x6a')](_0xa91137)){if(_0xb940a[_0xfa88('0x68')][_0x5128f7][_0x28ea6a[_0xa91137]]){var _0xa884d5=_['trim'](_0xb940a[_0xfa88('0x68')][_0x5128f7][_0x28ea6a[_0xa91137]][_0xfa88('0x6b')](/"/g,'\x27'));switch(_0xa91137){case _0xfa88('0x6c'):var _0x33d7bc=moment(_0xa884d5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x33d7bc[_0xfa88('0x6d')]()){_0x58769c['push']('\x22'+_0xa884d5+'\x22');}else{_0xa772[_0xfa88('0x1a')](_0xfa88('0x6e'));}break;case _0xfa88('0x6f'):var _0xee8722=parseInt(_0xa884d5);_0xa884d5=_[_0xfa88('0x70')](_0xee8722)||_0xee8722<0x0||_0xee8722>0x4?_0x2d06e3?0x3:0x2:_0xee8722;_0x58769c[_0xfa88('0x1a')]('\x22'+_0xa884d5+'\x22');break;case _0xfa88('0x35'):var _0x1946e1=parseInt(_0xa884d5);if(_[_0xfa88('0x71')](_0x1946e1)&&_[_0xfa88('0x72')](_0x1a6b2e,_0x1946e1)){_0x58769c[_0xfa88('0x1a')]('\x22'+_0x1946e1+'\x22');}else{_0xa772['push'](_0xfa88('0x73'));}break;case _0xfa88('0x74'):if(isEmail(_0xa884d5)){_0x58769c[_0xfa88('0x1a')]('\x22'+_0xa884d5+'\x22');}else{_0xa772['push'](_0xfa88('0x75'));}break;case _0xfa88('0x76'):var _0x557135=moment(_0xa884d5,_0xfa88('0x77'),!![]);if(_0x557135[_0xfa88('0x6d')]()){_0x58769c[_0xfa88('0x1a')]('\x22'+_0xa884d5+'\x22');}else{_0xa772[_0xfa88('0x1a')](_0xfa88('0x78'));}break;default:_0x58769c[_0xfa88('0x1a')]('\x22'+_0xa884d5+'\x22');}}else{switch(_0xa91137){case _0xfa88('0x79'):case'phone':_0xa772[_0xfa88('0x1a')](_0xa91137+_0xfa88('0x7a'));break;default:_0x58769c[_0xfa88('0x1a')]('\x22\x22');}}}}else{var _0x1a33f5='';if(!_[_0xfa88('0x18')](_0x3c2fff)){if(!_0x474fad[_0xfa88('0x6a')](_0x3c2fff['id'])){for(var _0xaaeacc=0x0;_0xaaeacc<_0x28ea6a[_0xa91137][_0xfa88('0x20')];_0xaaeacc++){var _0xa884d5=_[_0xfa88('0x7b')](_0xb940a[_0xfa88('0x68')][_0x5128f7][_0x28ea6a[_0xa91137][_0xaaeacc]][_0xfa88('0x6b')](/"/g,'\x27'));var _0x4c73ac=phoneDescriptions[_0xfa88('0x69')](_0x2cadb4=>_0x2cadb4[_0xfa88('0x7c')]===_0x3c2fff['id']);if(!_[_0xfa88('0x18')](_0x4c73ac)){var _0x1a44a4=_['trim'](_0xb940a[_0xfa88('0x68')][_0x5128f7][_0x28ea6a[_0x4c73ac['description']][0x0]][_0xfa88('0x6b')](/"/g,'\x27'));if(!_[_0xfa88('0x18')](_0x1a44a4))_0xa884d5=_0xa884d5+'§'+_0x1a44a4;}if(_0x1a33f5=='')_0x1a33f5=_0xa884d5;else _0x1a33f5+='|'+_0xa884d5;}_0x48dcb[_0xfa88('0x1a')](_0x3c2fff['id']+':'+_0x1a33f5);_0x474fad[_0x3c2fff['id']]=0x1;}}}}if(hasAdditionalPhones){_0x58769c[_0xfa88('0x1a')]('\x22'+_0x48dcb['join'](';')+'\x22');}if(_0xa772['length']){handleError(_0xb940a[_0xfa88('0x68')][_0x5128f7],{'code':_0xfa88('0x7d'),'message':_0xa772[_0xfa88('0x13')]()});}else{fs['appendFileSync'](_0x1d3162,_0x58769c[_0xfa88('0x13')]()+'\x0a');}_0x58769c=[];}if(!(stats[_0xfa88('0x7e')]%0xc8)){socket['emit']('contact:import:'+_0x6b2852,stats);stats[_0xfa88('0x5a')]=[];}}if(stopped){logger[_0xfa88('0x59')](_0xfa88('0x7f'));_0x2d010f[_0xfa88('0x80')]();}}catch(_0x428331){handleError(_0xb940a[_0xfa88('0x68')][_0x5128f7],{'code':_0xfa88('0x81'),'message':_0x428331['message']});logger[_0xfa88('0x1e')](_0xfa88('0x82'),_0x428331[_0xfa88('0x1f')]);}},'complete':function(){try{var _0x42dd32=[];var _0x3a1735=tempTableName;_0x42dd32[_0xfa88('0x1a')](_0xfa88('0x83')+_0x3a1735+'\x20LIKE\x20cm_contacts;');logger[_0xfa88('0x59')](_0xfa88('0x84'),contactItemTypes[_0xfa88('0x20')]);var _0x6c294a=util[_0xfa88('0xb')](_0xfa88('0x85'),_0x1d3162,_0x3a1735,_0x5b5f56,_0x19a16e[_0xfa88('0x32')],_0x19a16e[_0xfa88('0x86')]||null,NOW,NOW);if(_[_0xfa88('0x18')](_0x28ea6a[_0xfa88('0x6c')])){_0x6c294a+=',\x20scheduledAt\x20=\x20NOW()';}_0x42dd32[_0xfa88('0x1a')](_0x6c294a);BPromise[_0xfa88('0x87')](_0x42dd32,handleQuery)[_0xfa88('0x1c')](function(_0x1f68e6){BPromise[_0xfa88('0x1b')]([handleAdditionalPhones()])[_0xfa88('0x1c')](function(){_0x42dd32=[];for(var _0x3c6337=0x0;_0x3c6337\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.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.MailAccountId','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','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName'];(function(_0x49efa5,_0x2a8c59){var _0x247079=function(_0x46460c){while(--_0x46460c){_0x49efa5['push'](_0x49efa5['shift']());}};_0x247079(++_0x2a8c59);}(_0xf3c3,0x15c));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3f3c('0x0'));var squel=require(_0x3f3c('0x1'));var as=require(_0x3f3c('0x2'));var qs=require(_0x3f3c('0x3'));var updateInteraction=require(_0x3f3c('0x4'))[_0x3f3c('0x5')];var utils=require(_0x3f3c('0x6'));var db=require(_0x3f3c('0x7'))['db'];function skipInteractionsQuery(_0x50a294,_0x4209e8,_0xcf83e6){var _0x24571f=![];var _0x497dc0=utils['getAccountFK'](_0x50a294);if(_0x4209e8[_0x3f3c('0x8')]===_0x3f3c('0x9')&&!_0xcf83e6[_0x3f3c('0xa')]&&!_0xcf83e6[_0x497dc0]){_0x24571f=!![];}return _0x24571f;}function getTagsQuery(){return squel[_0x3f3c('0xb')]()[_0x3f3c('0xc')]('id')[_0x3f3c('0xc')](_0x3f3c('0xd'))['field'](_0x3f3c('0xe'))[_0x3f3c('0xf')]('tools_tags');}function getUsersQuery(_0x44fd0d,_0x7cdbac){var _0x369a15=utils[_0x3f3c('0x10')](_0x44fd0d);var _0x2f3b49=_0x3f3c('0x11')+_0x44fd0d+_0x3f3c('0x12');var _0x3bbab9=squel[_0x3f3c('0xb')]()[_0x3f3c('0xc')](_0x3f3c('0x13'))[_0x3f3c('0xc')](_0x3f3c('0x14'))[_0x3f3c('0xc')](_0x3f3c('0x15')+_0x369a15)[_0x3f3c('0xf')](_0x2f3b49,'ui')[_0x3f3c('0x16')](_0x3f3c('0x17'),'u',_0x3f3c('0x18'));if(_0x7cdbac[_0x3f3c('0x19')]>0x0){_0x3bbab9[_0x3f3c('0x1a')](_0x3f3c('0x15')+_0x369a15+_0x3f3c('0x1b'),_[_0x3f3c('0x1c')](_0x7cdbac,'id'));}return _0x3bbab9;}function getInteractionsQuery(_0x4d958c){var _0x15790c=utils[_0x3f3c('0x1d')](_0x4d958c);var _0x4fe8ab=utils[_0x3f3c('0x1e')](_0x4d958c);var _0x18b0b1=utils['getInteractionFK'](_0x4d958c);return squel['select']()[_0x3f3c('0xf')](_0x15790c['interactions'],'i')['left_join']('cm_contacts','c',_0x3f3c('0x1f'))[_0x3f3c('0x16')]('users','o',_0x3f3c('0x20'))['left_join'](_0x15790c['accounts'],'a',_0x3f3c('0x21')+_0x4fe8ab)['left_join'](_0x15790c[_0x3f3c('0x22')],'me',_0x3f3c('0x23')+_0x18b0b1+_0x3f3c('0x24'))[_0x3f3c('0x16')](_0x15790c[_0x3f3c('0x25')],'it',_0x3f3c('0x26')+_0x18b0b1+_0x3f3c('0x24'))[_0x3f3c('0x16')](_0x3f3c('0x27'),'t',_0x3f3c('0x28'));}function getSqlClauses(){var _0x19969b={'body':squel[_0x3f3c('0x29')](),'contact':squel['expr'](),'default':squel[_0x3f3c('0x29')](),'fields':squel[_0x3f3c('0x29')](),'filter':squel[_0x3f3c('0x29')](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x3f3c('0x29')]()};return _0x19969b;}function parseTagParameter(_0x9ab74b){var _0xf4d13a=squel[_0x3f3c('0x29')]();if(_0x9ab74b){var _0x4cc456=utils[_0x3f3c('0x2a')](_0x9ab74b);_0x4cc456['forEach'](function(_0x4ebf73){_0xf4d13a['or'](_0x3f3c('0x2b'),'%,'+_0x4ebf73+',%');});}return _0xf4d13a;}function parseReadParameter(_0x214a52){var _0x16d825='';if(_0x214a52){_0x16d825=_0x3f3c('0x2c');if(_0x214a52==='1'){_0x16d825=_0x16d825[_0x3f3c('0x2d')]('{OPERATOR}','=');}else{_0x16d825=_0x16d825['replace']('{OPERATOR}','>');}}return _0x16d825;}function parseSearchFilter(_0x4e66b1,_0x5033e2){var _0xbd87b2=squel[_0x3f3c('0x29')]();if(_0x5033e2){var _0xc6f812=_0x5033e2['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3f3c('0x2e')](_0xc6f812)){_0xbd87b2['or'](_0x3f3c('0x2f'),_0xc6f812+'%');switch(_0x4e66b1){case _0x3f3c('0x30'):case'whatsapp':_0xbd87b2['or']('i.phone\x20LIKE\x20?',_0xc6f812+'%');break;case _0x3f3c('0x31'):_0xbd87b2['or']('i.fax\x20LIKE\x20?',_0xc6f812+'%');break;case'openchannel':_0xbd87b2['or'](_0x3f3c('0x32'),_0xc6f812+'%');break;case _0x3f3c('0x33'):_0xbd87b2['or'](_0x3f3c('0x34'),qs[_0x3f3c('0x35')](_0xc6f812,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3f3c('0x35')](_0xc6f812));break;}}else if(_0x4e66b1===_0x3f3c('0x33')&&qs[_0x3f3c('0x36')](_0xc6f812)){_0xbd87b2['or'](_0x3f3c('0x37'),_0xc6f812+'%');}else{if(_0x4e66b1==='mail'){_0xbd87b2['or'](_0x3f3c('0x34'),qs['getFullTextValue'](_0xc6f812,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3f3c('0x35')](_0xc6f812));}else if(_0x4e66b1!=='fax'){_0xbd87b2['or'](_0x3f3c('0x38'),qs[_0x3f3c('0x35')](_0xc6f812));}_0xbd87b2['or'](_0x3f3c('0x39'),qs[_0x3f3c('0x35')](_0xc6f812,!![]),null);}}return _0xbd87b2;}function parseAdvancedSearchFilter(_0x591b17,_0x388859){var _0xcdcd4=getSqlClauses();var _0x3c4dc2=as[_0x3f3c('0x3a')](_0x591b17);var _0x44798e=_0x3c4dc2[_0x3f3c('0x3b')];for(var _0x49038f=0x0;_0x49038f<_0x3c4dc2['conditions']['length'];_0x49038f++){var _0x3a8565=_0x3c4dc2[_0x3f3c('0x3c')][_0x49038f];var _0x57c1b7='i';var _0x4b9346=_[_0x3f3c('0x3d')](_0x388859,[_0x3f3c('0xd'),_0x3a8565[_0x3f3c('0xc')]]);if(_0x4b9346){var _0x15264b=as[_0x3f3c('0x3e')](_0x57c1b7,_0x4b9346['type'],_0x3a8565);_0xcdcd4[_0x3f3c('0x3f')][_0x44798e](_0x15264b[_0x3f3c('0x40')],_0x15264b[_0x3f3c('0x41')]['start'],_0x15264b['value'][_0x3f3c('0x42')]);}else{switch(_0x3a8565[_0x3f3c('0xc')]){case'unreadMessages':var _0x10a841=parseReadParameter(_0x3a8565['value']);_0xcdcd4[_0x3f3c('0x43')]['and'](_0x10a841);break;case _0x3f3c('0x44'):if(_0x3a8565[_0x3f3c('0x45')]===_0x3f3c('0x46')){if(_0x3a8565[_0x3f3c('0x41')][_0x3f3c('0x47')]('\x20')[_0x3f3c('0x19')]>0x1){_0xcdcd4[_0x3f3c('0x48')][_0x44798e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3a8565['value'],!![]),null);}else{var _0x57ece5='%'+_0x3a8565[_0x3f3c('0x41')]+'%';_0xcdcd4[_0x3f3c('0x48')][_0x44798e](_0x3f3c('0x49'),_0x57ece5,_0x57ece5,_0x57ece5);}}else{_0x4b9346=_[_0x3f3c('0x3d')](_0x388859,[_0x3f3c('0xd'),'ContactId']);_0x3a8565[_0x3f3c('0xc')]=_0x3f3c('0x4a');_0x15264b=as[_0x3f3c('0x3e')](_0x57c1b7,_0x4b9346[_0x3f3c('0x4b')],_0x3a8565);_0xcdcd4[_0x3f3c('0x48')][_0x44798e](_0x15264b[_0x3f3c('0x40')],_0x15264b[_0x3f3c('0x41')][_0x3f3c('0x4c')],_0x15264b[_0x3f3c('0x41')][_0x3f3c('0x42')]);}break;case _0x3f3c('0x4d'):var _0x5357b0=_0x3a8565['value'][_0x3f3c('0x47')](',')['map'](function(_0x40e4d6){return Number(_0x40e4d6);});var _0x3df65c=parseTagParameter(_0x5357b0);_0xcdcd4[_0x3f3c('0x4e')][_0x3f3c('0x4f')][_0x3f3c('0x50')](_0x3df65c);_0xcdcd4[_0x3f3c('0x4e')][_0x3f3c('0x51')]=_0x5357b0;break;case _0x3f3c('0x52'):if(_0x3a8565['operator']===_0x3f3c('0x46')){_0xcdcd4[_0x3f3c('0x53')][_0x44798e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname,\x20o.internal)\x20LIKE\x20?','%'+_0x3a8565[_0x3f3c('0x41')]+'%',null);}else{_0x4b9346=_['find'](_0x388859,[_0x3f3c('0xd'),_0x3f3c('0x54')]);_0x3a8565[_0x3f3c('0xc')]=_0x3f3c('0x54');_0x15264b=as[_0x3f3c('0x3e')](_0x57c1b7,_0x4b9346[_0x3f3c('0x4b')],_0x3a8565);_0xcdcd4[_0x3f3c('0x53')][_0x44798e](_0x15264b[_0x3f3c('0x40')],_0x15264b[_0x3f3c('0x41')][_0x3f3c('0x4c')],_0x15264b[_0x3f3c('0x41')][_0x3f3c('0x42')]);}break;case'body':case'plainBody':_0x15264b=as[_0x3f3c('0x3e')]('me',null,_0x3a8565);_0xcdcd4[_0x3f3c('0x55')][_0x44798e](_0x15264b[_0x3f3c('0x40')],_0x15264b['value'][_0x3f3c('0x4c')],_0x15264b[_0x3f3c('0x41')][_0x3f3c('0x42')]);break;}}}return _0xcdcd4;}function parseModelFields(_0x3d0a16,_0x4caa90,_0x266889){var _0x355286=utils['getAccountFK'](_0x3d0a16);var _0x2632d1=squel[_0x3f3c('0x29')]();var _0x21fff8=_(_0x4caa90)[_0x3f3c('0x56')]()[_0x3f3c('0x1c')](function(_0x59a821){return _[_0x3f3c('0x57')](_0x266889,[_0x3f3c('0xd'),_0x59a821])?_0x59a821:undefined;})['compact']()[_0x3f3c('0x41')]();if(_0x21fff8[_0x3f3c('0x19')]>0x0){_0x21fff8['forEach'](function(_0x1c785e){if(_0x1c785e===_0x355286){_0x2632d1[_0x3f3c('0x50')]('i.'+_0x355286+_0x3f3c('0x1b'),[][_0x3f3c('0x58')](_0x4caa90[_0x1c785e]));}else if(_0x1c785e===_0x3f3c('0x59')){var _0x57a3a4=JSON['parse'](_0x4caa90[_0x1c785e])[_0x3f3c('0x5a')];var _0x3c0f18=JSON[_0x3f3c('0x5b')](_0x4caa90[_0x1c785e])[_0x3f3c('0x5c')];_0x2632d1[_0x3f3c('0x50')](_0x3f3c('0x5d'),_0x57a3a4,_0x3c0f18);}else{if(_0x4caa90[_0x1c785e]===_0x3f3c('0x5e')){_0x2632d1['and']('i.'+_0x1c785e+_0x3f3c('0x5f'));}else{_0x2632d1[_0x3f3c('0x50')]('i.'+_0x1c785e+_0x3f3c('0x60'),_0x4caa90[_0x1c785e]);}}});}return _0x2632d1;}function parseQueryParameters(_0x27a6d7,_0x5d0276,_0x2e89d7){var _0x3a37a9=getSqlClauses();return Promise[_0x3f3c('0x61')]()[_0x3f3c('0x62')](function(){return parseModelFields(_0x27a6d7,_0x5d0276,_0x2e89d7);})[_0x3f3c('0x62')](function(_0x316284){_0x3a37a9[_0x3f3c('0x63')]['and'](_0x316284);return parseReadParameter(_0x5d0276[_0x3f3c('0x43')]);})[_0x3f3c('0x62')](function(_0x5a3aac){_0x3a37a9['read'][_0x3f3c('0x50')](_0x5a3aac);return parseTagParameter(_0x5d0276[_0x3f3c('0x64')]);})[_0x3f3c('0x62')](function(_0x3defd6){_0x3a37a9[_0x3f3c('0x4e')]['clause'][_0x3f3c('0x50')](_0x3defd6);return parseSearchFilter(_0x27a6d7,_0x5d0276['filter']);})[_0x3f3c('0x62')](function(_0x141efe){_0x3a37a9[_0x3f3c('0x65')]=_0x141efe;return _0x3a37a9;});}function checkAccountsRestrictions(_0x5b593f,_0x9ba6fb,_0x43a2c7){var _0x2eb12b=utils[_0x3f3c('0x1e')](_0x5b593f);var _0xa4391d='get'+_[_0x3f3c('0x66')](_0x5b593f)+(_0x5b593f==='chat'?_0x3f3c('0x67'):_0x3f3c('0x68'));var _0x5c8b08=squel[_0x3f3c('0x29')]();return Promise[_0x3f3c('0x61')]()['then'](function(){if(_0x43a2c7[_0x3f3c('0xa')]&&_0x9ba6fb[_0x3f3c('0x8')]===_0x3f3c('0x9')){return _0x9ba6fb[_0xa4391d]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x41c30e){if(_0x41c30e){if(_0x41c30e[_0x3f3c('0x19')]===0x0){_0x5c8b08[_0x3f3c('0x50')]('i.'+_0x2eb12b+'\x20IS\x20NULL');}else{_0x5c8b08[_0x3f3c('0x50')]('i.'+_0x2eb12b+_0x3f3c('0x1b'),_[_0x3f3c('0x1c')](_0x41c30e,'id'));}}else if(!_0x43a2c7[_0x2eb12b]){_0x5c8b08[_0x3f3c('0x50')]('i.'+_0x2eb12b+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x5c8b08;});}function getClosedOrderClause(_0x56e0bf,_0x490048){var _0x1e1aca='';var _0x1bdb42=[_0x3f3c('0x69'),'i.secondDisposition','i.disposition'];if(_0x56e0bf==='mail'){_0x1bdb42[_0x3f3c('0x6a')](_0x3f3c('0x6b'));}if(_0x490048[_0x3f3c('0x6c')]==='0'&&_0x56e0bf===_0x3f3c('0x33')){_0x1e1aca=_0x3f3c('0x6b');}else{if(_0x490048['closed']==='1'){_0x1bdb42[_0x3f3c('0x6d')]();}_0x1e1aca=_0x3f3c('0x6e')+_0x1bdb42[_0x3f3c('0x6f')](',\x20')+')';}return _0x1e1aca;}function getFilteredInteractions(_0x8fe2e9,_0x4b3dd9,_0x29fcb0,_0x3215ae){var _0x11cdae=utils[_0x3f3c('0x10')](_0x8fe2e9);var _0x1a4c6f=_['capitalize'](_0x8fe2e9)+_0x3f3c('0x70');var _0x309122=[];var _0x210a4b=getTagsQuery();var _0x310596={'type':db[_0x3f3c('0x71')][_0x3f3c('0x72')][_0x3f3c('0x73')],'raw':!![]};var _0x335e24=[];var _0x556efb=[];return db[_0x3f3c('0x74')]['query'](_0x210a4b[_0x3f3c('0x75')](),_0x310596)[_0x3f3c('0x62')](function(_0x305afd){_0x309122=_[_0x3f3c('0x76')](_0x305afd,'id');_0x310596=_[_0x3f3c('0x77')](_0x310596,{'model':db[_0x1a4c6f],'mapToModel':!![],'nest':!![]});if(_0x29fcb0[_0x3f3c('0x63')]){_0x3215ae['attributes'][_0x3f3c('0x78')](function(_0x1e0949){_0x4b3dd9[_0x3f3c('0xc')]('i.'+_0x1e0949);});}else{_0x4b3dd9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3f3c('0x79'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x7a'),_0x3f3c('0x7b'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x7c'),_0x3f3c('0x7d'));if(_0x8fe2e9===_0x3f3c('0x33')){_0x4b3dd9[_0x3f3c('0xc')]('a.email',_0x3f3c('0x7e'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x7f'),_0x3f3c('0x80'));_0x4b3dd9[_0x3f3c('0xc')]('i.id');_0x4b3dd9[_0x3f3c('0xc')]('i.createdAt');_0x4b3dd9[_0x3f3c('0xc')]('i.updatedAt');_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x81'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x82'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x83'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x84'));_0x4b3dd9[_0x3f3c('0xc')]('i.lastMsgDirection');_0x4b3dd9['field'](_0x3f3c('0x85'));_0x4b3dd9['field'](_0x3f3c('0x86'));_0x4b3dd9['field'](_0x3f3c('0x87'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x69'));_0x4b3dd9['field'](_0x3f3c('0x6b'));_0x4b3dd9[_0x3f3c('0xc')]('i.to');_0x4b3dd9['field']('i.ContactId');_0x4b3dd9['field'](_0x3f3c('0x88'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x89'));}else if(_0x8fe2e9===_0x3f3c('0x8a')){_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x8b'),_0x3f3c('0x80'));}else{_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x8c'),_0x3f3c('0x80'));}if(_0x8fe2e9!==_0x3f3c('0x33')){_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x8d'));}_0x4b3dd9['field'](_0x3f3c('0x8e'),'Contact.firstName');_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x8f'),'Contact.lastName');_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x90'),'Contact.email');_0x4b3dd9['field']('c.phone','Contact.phone');_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x91'),_0x3f3c('0x92'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x93'),_0x3f3c('0x94'));_0x4b3dd9[_0x3f3c('0xc')]('o.fullname',_0x3f3c('0x95'));_0x4b3dd9[_0x3f3c('0xc')](_0x3f3c('0x96'),'Owner.internal');_0x4b3dd9['field'](_0x3f3c('0x97'),_0x3f3c('0x98'));}if(_0x3215ae[_0x3f3c('0x99')]){_0x4b3dd9[_0x3f3c('0x99')](_0x3215ae[_0x3f3c('0x99')]);}if(_0x3215ae['offset']){_0x4b3dd9['offset'](_0x3215ae[_0x3f3c('0x9a')]);}return db[_0x3f3c('0x74')][_0x3f3c('0x9b')](_0x4b3dd9['toString'](),_0x310596);})[_0x3f3c('0x62')](function(_0x23ffdd){_0x335e24=_0x23ffdd;var _0x334662=getUsersQuery(_0x8fe2e9,_0x335e24);return db[_0x3f3c('0x74')][_0x3f3c('0x9b')](_0x334662['toString'](),_0x310596);})[_0x3f3c('0x62')](function(_0x3d2f35){_0x556efb=_['groupBy'](_0x3d2f35,_0x11cdae);if(_0x8fe2e9===_0x3f3c('0x33')){return db['Setting']['findOne']({'attributes':[_0x3f3c('0x9c')],'raw':!![]});}})['then'](function(_0x29bc11){var _0x2cd0e6=_0x29bc11?_0x29bc11[_0x3f3c('0x9c')]:undefined;var _0x5321f2=_0x335e24['map'](function(_0x7bbc94){return updateInteraction(_0x7bbc94,_0x309122,_0x556efb,_0x2cd0e6);});return Promise[_0x3f3c('0x9d')](_0x5321f2);});}function countFilteredInteractions(_0x5d207a,_0x1e87f6){var _0x4d95a7=_0x5d207a[_0x3f3c('0x9e')]();_0x4d95a7[_0x3f3c('0xc')](_0x3f3c('0x9f'));_0x4d95a7[_0x3f3c('0xc')](_0x3f3c('0xa0'),_0x3f3c('0x79'));var _0x3ca5fa=utils[_0x3f3c('0x2a')](_0x1e87f6);if(!_[_0x3f3c('0xa1')](_0x3ca5fa)){_0x4d95a7[_0x3f3c('0x1a')](_0x3f3c('0xa2'),_0x3ca5fa);}var _0x28fef7={'type':db['Sequelize']['QueryTypes'][_0x3f3c('0x73')],'raw':!![]};return db['sequelize']['query'](_0x4d95a7[_0x3f3c('0x75')](),_0x28fef7);}module[_0x3f3c('0xa3')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x4caf=['unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','mail','c.email\x20LIKE\x20?','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)','parseSearch','sqlOperator','conditions','buildExpression','text','start','value','end','unreadMessages','read','and','Contact','operator','$substring','split','contact','find','ContactId','type','Tag','tags','clause','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname,\x20o.internal)\x20LIKE\x20?','UserId','user','body','plainBody','keys','some','compact','concat','parse','$gte','$lte','null','\x20=\x20?','then','tag','filter','capitalize','chat','Websites','Accounts','resolve','agent','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','i.substatus','closed','shift','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','keyBy','merge','attributes','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','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.createdAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','role','search','select','field','name','from','tools_tags','getInteractionFK','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','interactions','o.id\x20=\x20i.UserId','accounts','messages','me.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?'];(function(_0x5e859e,_0x4a4607){var _0x3fa5d5=function(_0x5972c0){while(--_0x5972c0){_0x5e859e['push'](_0x5e859e['shift']());}};_0x3fa5d5(++_0x4a4607);}(_0x4caf,0x7c));var _0xf4ca=function(_0x4897f3,_0x46d20c){_0x4897f3=_0x4897f3-0x0;var _0x596165=_0x4caf[_0x4897f3];return _0x596165;};'use strict';var _=require(_0xf4ca('0x0'));var squel=require(_0xf4ca('0x1'));var as=require(_0xf4ca('0x2'));var qs=require(_0xf4ca('0x3'));var updateInteraction=require(_0xf4ca('0x4'))[_0xf4ca('0x5')];var utils=require(_0xf4ca('0x6'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x416c94,_0x2d284b,_0x1f524e){var _0x2b48ea=![];var _0x3c6d86=utils[_0xf4ca('0x7')](_0x416c94);if(_0x2d284b[_0xf4ca('0x8')]==='agent'&&!_0x1f524e[_0xf4ca('0x9')]&&!_0x1f524e[_0x3c6d86]){_0x2b48ea=!![];}return _0x2b48ea;}function getTagsQuery(){return squel[_0xf4ca('0xa')]()[_0xf4ca('0xb')]('id')['field'](_0xf4ca('0xc'))['field']('color')[_0xf4ca('0xd')](_0xf4ca('0xe'));}function getUsersQuery(_0x4884b7,_0x322f67){var _0x52dea9=utils[_0xf4ca('0xf')](_0x4884b7);var _0x59873e='user_has_'+_0x4884b7+_0xf4ca('0x10');var _0x5b319c=squel[_0xf4ca('0xa')]()[_0xf4ca('0xb')]('u.id')[_0xf4ca('0xb')](_0xf4ca('0x11'))['field'](_0xf4ca('0x12')+_0x52dea9)[_0xf4ca('0xd')](_0x59873e,'ui')[_0xf4ca('0x13')](_0xf4ca('0x14'),'u',_0xf4ca('0x15'));if(_0x322f67[_0xf4ca('0x16')]>0x0){_0x5b319c[_0xf4ca('0x17')](_0xf4ca('0x12')+_0x52dea9+_0xf4ca('0x18'),_[_0xf4ca('0x19')](_0x322f67,'id'));}return _0x5b319c;}function getInteractionsQuery(_0x645ad4){var _0x4c4fb6=utils['getInteractionsTables'](_0x645ad4);var _0x9f5e98=utils[_0xf4ca('0x7')](_0x645ad4);var _0x8e9e89=utils[_0xf4ca('0xf')](_0x645ad4);return squel[_0xf4ca('0xa')]()[_0xf4ca('0xd')](_0x4c4fb6[_0xf4ca('0x1a')],'i')[_0xf4ca('0x13')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf4ca('0x13')]('users','o',_0xf4ca('0x1b'))[_0xf4ca('0x13')](_0x4c4fb6[_0xf4ca('0x1c')],'a','a.id\x20=\x20i.'+_0x9f5e98)[_0xf4ca('0x13')](_0x4c4fb6[_0xf4ca('0x1d')],'me',_0xf4ca('0x1e')+_0x8e9e89+_0xf4ca('0x1f'))[_0xf4ca('0x13')](_0x4c4fb6['interactionsTags'],'it','it.'+_0x8e9e89+_0xf4ca('0x1f'))['left_join'](_0xf4ca('0xe'),'t',_0xf4ca('0x20'));}function getSqlClauses(){var _0x4b046a={'body':squel[_0xf4ca('0x21')](),'contact':squel[_0xf4ca('0x21')](),'default':squel[_0xf4ca('0x21')](),'fields':squel[_0xf4ca('0x21')](),'filter':squel[_0xf4ca('0x21')](),'read':squel[_0xf4ca('0x21')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0xf4ca('0x21')]()};return _0x4b046a;}function parseTagParameter(_0x256424){var _0x3b0db9=squel[_0xf4ca('0x21')]();if(_0x256424){var _0x1f5ed0=utils[_0xf4ca('0x22')](_0x256424);_0x1f5ed0[_0xf4ca('0x23')](function(_0x480616){_0x3b0db9['or'](_0xf4ca('0x24'),'%,'+_0x480616+',%');});}return _0x3b0db9;}function parseReadParameter(_0xeef30e){var _0x59e7db='';if(_0xeef30e){_0x59e7db=_0xf4ca('0x25');if(_0xeef30e==='1'){_0x59e7db=_0x59e7db['replace'](_0xf4ca('0x26'),'=');}else{_0x59e7db=_0x59e7db['replace']('{OPERATOR}','>');}}return _0x59e7db;}function parseSearchFilter(_0x5d6333,_0x4cc91e){var _0x57cc12=squel[_0xf4ca('0x21')]();if(_0x4cc91e){var _0x3a6a84=_0x4cc91e['replace']('\x5c','\x5c\x5c')[_0xf4ca('0x27')](/'/g,'\x27\x27');if(qs[_0xf4ca('0x28')](_0x3a6a84)){_0x57cc12['or'](_0xf4ca('0x29'),_0x3a6a84+'%');switch(_0x5d6333){case _0xf4ca('0x2a'):case _0xf4ca('0x2b'):_0x57cc12['or'](_0xf4ca('0x2c'),_0x3a6a84+'%');break;case _0xf4ca('0x2d'):_0x57cc12['or'](_0xf4ca('0x2e'),_0x3a6a84+'%');break;case'openchannel':_0x57cc12['or'](_0xf4ca('0x2f'),_0x3a6a84+'%');break;case'mail':_0x57cc12['or'](_0xf4ca('0x30'),qs['getFullTextValue'](_0x3a6a84,!![]))['or'](_0xf4ca('0x31'),qs[_0xf4ca('0x32')](_0x3a6a84));break;}}else if(_0x5d6333===_0xf4ca('0x33')&&qs['isEmail'](_0x3a6a84)){_0x57cc12['or'](_0xf4ca('0x34'),_0x3a6a84+'%');}else{if(_0x5d6333===_0xf4ca('0x33')){_0x57cc12['or'](_0xf4ca('0x30'),qs['getFullTextValue'](_0x3a6a84,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf4ca('0x32')](_0x3a6a84));}else if(_0x5d6333!==_0xf4ca('0x2d')){_0x57cc12['or'](_0xf4ca('0x35'),qs['getFullTextValue'](_0x3a6a84));}_0x57cc12['or'](_0xf4ca('0x36'),qs['getFullTextValue'](_0x3a6a84,!![]),null);}}return _0x57cc12;}function parseAdvancedSearchFilter(_0x48db5d,_0x10e2de){var _0x545af2=getSqlClauses();var _0x117af9=as[_0xf4ca('0x37')](_0x48db5d);var _0x440d9d=_0x117af9[_0xf4ca('0x38')];for(var _0x4bdca3=0x0;_0x4bdca3<_0x117af9['conditions'][_0xf4ca('0x16')];_0x4bdca3++){var _0x450125=_0x117af9[_0xf4ca('0x39')][_0x4bdca3];var _0x494799='i';var _0x1195c8=_['find'](_0x10e2de,[_0xf4ca('0xc'),_0x450125['field']]);if(_0x1195c8){var _0x98b3cd=as[_0xf4ca('0x3a')](_0x494799,_0x1195c8['type'],_0x450125);_0x545af2['default'][_0x440d9d](_0x98b3cd[_0xf4ca('0x3b')],_0x98b3cd['value'][_0xf4ca('0x3c')],_0x98b3cd[_0xf4ca('0x3d')][_0xf4ca('0x3e')]);}else{switch(_0x450125[_0xf4ca('0xb')]){case _0xf4ca('0x3f'):var _0x3b9e70=parseReadParameter(_0x450125[_0xf4ca('0x3d')]);_0x545af2[_0xf4ca('0x40')][_0xf4ca('0x41')](_0x3b9e70);break;case _0xf4ca('0x42'):if(_0x450125[_0xf4ca('0x43')]===_0xf4ca('0x44')){if(_0x450125[_0xf4ca('0x3d')][_0xf4ca('0x45')]('\x20')[_0xf4ca('0x16')]>0x1){_0x545af2['contact'][_0x440d9d](_0xf4ca('0x36'),qs['getFullTextValue'](_0x450125['value'],!![]),null);}else{var _0x37b9f5='%'+_0x450125[_0xf4ca('0x3d')]+'%';_0x545af2[_0xf4ca('0x46')][_0x440d9d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x37b9f5,_0x37b9f5,_0x37b9f5);}}else{_0x1195c8=_[_0xf4ca('0x47')](_0x10e2de,[_0xf4ca('0xc'),_0xf4ca('0x48')]);_0x450125[_0xf4ca('0xb')]=_0xf4ca('0x48');_0x98b3cd=as[_0xf4ca('0x3a')](_0x494799,_0x1195c8[_0xf4ca('0x49')],_0x450125);_0x545af2[_0xf4ca('0x46')][_0x440d9d](_0x98b3cd['text'],_0x98b3cd[_0xf4ca('0x3d')][_0xf4ca('0x3c')],_0x98b3cd[_0xf4ca('0x3d')][_0xf4ca('0x3e')]);}break;case _0xf4ca('0x4a'):var _0x4e8281=_0x450125['value'][_0xf4ca('0x45')](',')[_0xf4ca('0x19')](function(_0x26bc65){return Number(_0x26bc65);});var _0x25d3dc=parseTagParameter(_0x4e8281);_0x545af2[_0xf4ca('0x4b')][_0xf4ca('0x4c')][_0xf4ca('0x41')](_0x25d3dc);_0x545af2[_0xf4ca('0x4b')]['ids']=_0x4e8281;break;case _0xf4ca('0x4d'):if(_0x450125[_0xf4ca('0x43')]==='$substring'){_0x545af2['user'][_0x440d9d](_0xf4ca('0x4e'),'%'+_0x450125[_0xf4ca('0x3d')]+'%',null);}else{_0x1195c8=_['find'](_0x10e2de,[_0xf4ca('0xc'),'UserId']);_0x450125[_0xf4ca('0xb')]=_0xf4ca('0x4f');_0x98b3cd=as[_0xf4ca('0x3a')](_0x494799,_0x1195c8['type'],_0x450125);_0x545af2[_0xf4ca('0x50')][_0x440d9d](_0x98b3cd[_0xf4ca('0x3b')],_0x98b3cd[_0xf4ca('0x3d')][_0xf4ca('0x3c')],_0x98b3cd['value'][_0xf4ca('0x3e')]);}break;case _0xf4ca('0x51'):case _0xf4ca('0x52'):_0x98b3cd=as[_0xf4ca('0x3a')]('me',null,_0x450125);_0x545af2['body'][_0x440d9d](_0x98b3cd[_0xf4ca('0x3b')],_0x98b3cd['value']['start'],_0x98b3cd[_0xf4ca('0x3d')][_0xf4ca('0x3e')]);break;}}}return _0x545af2;}function parseModelFields(_0x48ba63,_0x561145,_0x5741cd){var _0x50908d=utils['getAccountFK'](_0x48ba63);var _0x1bc6eb=squel['expr']();var _0x277415=_(_0x561145)[_0xf4ca('0x53')]()[_0xf4ca('0x19')](function(_0x2fce67){return _[_0xf4ca('0x54')](_0x5741cd,['name',_0x2fce67])?_0x2fce67:undefined;})[_0xf4ca('0x55')]()[_0xf4ca('0x3d')]();if(_0x277415[_0xf4ca('0x16')]>0x0){_0x277415[_0xf4ca('0x23')](function(_0x583ae1){if(_0x583ae1===_0x50908d){_0x1bc6eb['and']('i.'+_0x50908d+_0xf4ca('0x18'),[][_0xf4ca('0x56')](_0x561145[_0x583ae1]));}else if(_0x583ae1==='createdAt'){var _0x5b721c=JSON[_0xf4ca('0x57')](_0x561145[_0x583ae1])[_0xf4ca('0x58')];var _0x4f4cfd=JSON[_0xf4ca('0x57')](_0x561145[_0x583ae1])[_0xf4ca('0x59')];_0x1bc6eb[_0xf4ca('0x41')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b721c,_0x4f4cfd);}else{if(_0x561145[_0x583ae1]===_0xf4ca('0x5a')){_0x1bc6eb[_0xf4ca('0x41')]('i.'+_0x583ae1+'\x20IS\x20NULL');}else{_0x1bc6eb['and']('i.'+_0x583ae1+_0xf4ca('0x5b'),_0x561145[_0x583ae1]);}}});}return _0x1bc6eb;}function parseQueryParameters(_0x2e18c5,_0x2562c7,_0x4c89da){var _0x372651=getSqlClauses();return Promise['resolve']()[_0xf4ca('0x5c')](function(){return parseModelFields(_0x2e18c5,_0x2562c7,_0x4c89da);})[_0xf4ca('0x5c')](function(_0x51b840){_0x372651['fields'][_0xf4ca('0x41')](_0x51b840);return parseReadParameter(_0x2562c7[_0xf4ca('0x40')]);})[_0xf4ca('0x5c')](function(_0x5d8638){_0x372651[_0xf4ca('0x40')]['and'](_0x5d8638);return parseTagParameter(_0x2562c7[_0xf4ca('0x5d')]);})['then'](function(_0x35185f){_0x372651['tags'][_0xf4ca('0x4c')][_0xf4ca('0x41')](_0x35185f);return parseSearchFilter(_0x2e18c5,_0x2562c7[_0xf4ca('0x5e')]);})[_0xf4ca('0x5c')](function(_0x5ba3b8){_0x372651[_0xf4ca('0x5e')]=_0x5ba3b8;return _0x372651;});}function checkAccountsRestrictions(_0x205625,_0xf25200,_0x4e72ff){var _0x2b1a50=utils[_0xf4ca('0x7')](_0x205625);var _0x1d0a8a='get'+_[_0xf4ca('0x5f')](_0x205625)+(_0x205625===_0xf4ca('0x60')?_0xf4ca('0x61'):_0xf4ca('0x62'));var _0x292c22=squel[_0xf4ca('0x21')]();return Promise[_0xf4ca('0x63')]()[_0xf4ca('0x5c')](function(){if(_0x4e72ff[_0xf4ca('0x9')]&&_0xf25200[_0xf4ca('0x8')]===_0xf4ca('0x64')){return _0xf25200[_0x1d0a8a]({'attributes':['id'],'raw':!![]});}})[_0xf4ca('0x5c')](function(_0x5ae859){if(_0x5ae859){if(_0x5ae859[_0xf4ca('0x16')]===0x0){_0x292c22['and']('i.'+_0x2b1a50+'\x20IS\x20NULL');}else{_0x292c22['and']('i.'+_0x2b1a50+_0xf4ca('0x18'),_[_0xf4ca('0x19')](_0x5ae859,'id'));}}else if(!_0x4e72ff[_0x2b1a50]){_0x292c22[_0xf4ca('0x41')]('i.'+_0x2b1a50+_0xf4ca('0x65'));}})[_0xf4ca('0x5c')](function(){return _0x292c22;});}function getClosedOrderClause(_0x7172e1,_0x4ae044){var _0x3f8809='';var _0x1a38a5=[_0xf4ca('0x66'),'i.secondDisposition',_0xf4ca('0x67')];if(_0x7172e1===_0xf4ca('0x33')){_0x1a38a5['unshift'](_0xf4ca('0x68'));}if(_0x4ae044['closed']==='0'&&_0x7172e1===_0xf4ca('0x33')){_0x3f8809=_0xf4ca('0x68');}else{if(_0x4ae044[_0xf4ca('0x69')]==='1'){_0x1a38a5[_0xf4ca('0x6a')]();}_0x3f8809='CONCAT_WS(\x27\x27,\x20'+_0x1a38a5[_0xf4ca('0x6b')](',\x20')+')';}return _0x3f8809;}function getFilteredInteractions(_0x2818d7,_0x2bd56a,_0x7b72f3,_0x11ab1a){var _0x5a5bb0=utils[_0xf4ca('0xf')](_0x2818d7);var _0x2b7219=_[_0xf4ca('0x5f')](_0x2818d7)+_0xf4ca('0x6c');var _0x383c3e=[];var _0x33c7b2=getTagsQuery();var _0x50eb6a={'type':db[_0xf4ca('0x6d')][_0xf4ca('0x6e')][_0xf4ca('0x6f')],'raw':!![]};var _0x241a95=[];var _0x340b16=[];return db[_0xf4ca('0x70')][_0xf4ca('0x71')](_0x33c7b2['toString'](),_0x50eb6a)['then'](function(_0x2b3fe3){_0x383c3e=_[_0xf4ca('0x72')](_0x2b3fe3,'id');_0x50eb6a=_[_0xf4ca('0x73')](_0x50eb6a,{'model':db[_0x2b7219],'mapToModel':!![],'nest':!![]});if(_0x7b72f3['fields']){_0x11ab1a[_0xf4ca('0x74')][_0xf4ca('0x23')](function(_0x1d4e61){_0x2bd56a[_0xf4ca('0xb')]('i.'+_0x1d4e61);});}else{_0x2bd56a[_0xf4ca('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf4ca('0x3f'));_0x2bd56a[_0xf4ca('0xb')]('a.key','Account.key');_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x75'),_0xf4ca('0x76'));if(_0x2818d7==='mail'){_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x77'),_0xf4ca('0x78'));_0x2bd56a['field'](_0xf4ca('0x79'),_0xf4ca('0x7a'));_0x2bd56a[_0xf4ca('0xb')]('i.id');_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x7b'));_0x2bd56a[_0xf4ca('0xb')]('i.updatedAt');_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x7c'));_0x2bd56a[_0xf4ca('0xb')]('i.closedAt');_0x2bd56a['field'](_0xf4ca('0x7d'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x7e'));_0x2bd56a[_0xf4ca('0xb')]('i.lastMsgDirection');_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x7f'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x67'));_0x2bd56a['field'](_0xf4ca('0x80'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x66'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x68'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x81'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x82'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x83'));_0x2bd56a['field'](_0xf4ca('0x84'));}else if(_0x2818d7==='openchannel'){_0x2bd56a[_0xf4ca('0xb')]('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',_0xf4ca('0x7a'));}else{_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x85'),_0xf4ca('0x7a'));}if(_0x2818d7!==_0xf4ca('0x33')){_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x86'));}_0x2bd56a[_0xf4ca('0xb')]('c.firstName',_0xf4ca('0x87'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x88'),_0xf4ca('0x89'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x8a'),_0xf4ca('0x8b'));_0x2bd56a[_0xf4ca('0xb')]('c.phone',_0xf4ca('0x8c'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x8d'),_0xf4ca('0x8e'));_0x2bd56a['field'](_0xf4ca('0x8f'),_0xf4ca('0x90'));_0x2bd56a[_0xf4ca('0xb')](_0xf4ca('0x91'),_0xf4ca('0x92'));_0x2bd56a['field'](_0xf4ca('0x93'),_0xf4ca('0x94'));_0x2bd56a[_0xf4ca('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x11ab1a[_0xf4ca('0x95')]){_0x2bd56a[_0xf4ca('0x95')](_0x11ab1a[_0xf4ca('0x95')]);}if(_0x11ab1a[_0xf4ca('0x96')]){_0x2bd56a[_0xf4ca('0x96')](_0x11ab1a[_0xf4ca('0x96')]);}return db[_0xf4ca('0x70')]['query'](_0x2bd56a[_0xf4ca('0x97')](),_0x50eb6a);})[_0xf4ca('0x5c')](function(_0x462c02){_0x241a95=_0x462c02;var _0x3f43fa=getUsersQuery(_0x2818d7,_0x241a95);return db[_0xf4ca('0x70')][_0xf4ca('0x71')](_0x3f43fa['toString'](),_0x50eb6a);})[_0xf4ca('0x5c')](function(_0x279c39){_0x340b16=_[_0xf4ca('0x98')](_0x279c39,_0x5a5bb0);if(_0x2818d7===_0xf4ca('0x33')){return db[_0xf4ca('0x99')][_0xf4ca('0x9a')]({'attributes':[_0xf4ca('0x9b')],'raw':!![]});}})[_0xf4ca('0x5c')](function(_0xf323f){var _0x324ac5=_0xf323f?_0xf323f[_0xf4ca('0x9b')]:undefined;var _0x4f675a=_0x241a95[_0xf4ca('0x19')](function(_0x79682e){return updateInteraction(_0x79682e,_0x383c3e,_0x340b16,_0x324ac5);});return Promise['all'](_0x4f675a);});}function countFilteredInteractions(_0x4e1c5f,_0x3c599f){var _0x40d5ad=_0x4e1c5f[_0xf4ca('0x9c')]();_0x40d5ad['field'](_0xf4ca('0x9d'));_0x40d5ad[_0xf4ca('0xb')](_0xf4ca('0x9e'),_0xf4ca('0x3f'));var _0x53e47a=utils[_0xf4ca('0x22')](_0x3c599f);if(!_['isEmpty'](_0x53e47a)){_0x40d5ad[_0xf4ca('0x17')](_0xf4ca('0x9f'),_0x53e47a);}var _0x56ddf5={'type':db[_0xf4ca('0x6d')][_0xf4ca('0x6e')][_0xf4ca('0x6f')],'raw':!![]};return db[_0xf4ca('0x70')][_0xf4ca('0x71')](_0x40d5ad['toString'](),_0x56ddf5);}module[_0xf4ca('0xa0')]={'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 fe7e64e..e729b5b 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 _0x5378=['talking','answered','unmanaged','abandoned','disposition','UserId','MailMessage','findOne','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','Tags','TagIds','../../mysqldb','map','fullname','split','forEach','push','waiting'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x5378,0x157));var _0x8537=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5378[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var db=require(_0x8537('0x0'))['db'];function getInteractionUsers(_0x29af0e,_0x41ae4e){return new Promise(function(_0x274a7c,_0x912899){try{var _0x11ff53=[];if(_0x41ae4e[_0x29af0e]){_0x11ff53=_0x41ae4e[_0x29af0e][_0x8537('0x1')](function(_0x2c76cf){return{'id':_0x2c76cf['id'],'fullname':_0x2c76cf[_0x8537('0x2')]};});}return _0x274a7c(_0x11ff53);}catch(_0x33468a){_0x912899(_0x33468a);}});}function getInteractionTags(_0x286a44,_0x447674){var _0x5cd855=[];if(_0x286a44){_0x286a44[_0x8537('0x3')](',')[_0x8537('0x4')](function(_0x29570f){_0x5cd855[_0x8537('0x5')](_0x447674[_0x29570f]);});}return _0x5cd855;}function updateWaitingCounter(_0xf9f4fb){if(_0xf9f4fb[_0x8537('0x6')]){_0xf9f4fb['waiting']-=0x1;}}function updateInteractionCounters(_0x3ad2cb){_0x3ad2cb['waiting']=0x0;_0x3ad2cb[_0x8537('0x7')]=0x0;_0x3ad2cb[_0x8537('0x8')]=0x0;_0x3ad2cb[_0x8537('0x9')]=0x0;_0x3ad2cb[_0x8537('0xa')]=0x0;_0x3ad2cb['total']=0x0;if(_0x3ad2cb['closed']){if(_0x3ad2cb[_0x8537('0xb')]===_0x8537('0xa')){_0x3ad2cb[_0x8537('0xa')]+=0x1;updateWaitingCounter(_0x3ad2cb);}if(_0x3ad2cb[_0x8537('0xc')]){_0x3ad2cb['answered']+=0x1;if(_0x3ad2cb[_0x8537('0x7')]){_0x3ad2cb[_0x8537('0x7')]-=0x1;}}else{if(_0x3ad2cb[_0x8537('0xb')]){_0x3ad2cb[_0x8537('0x9')]+=0x1;updateWaitingCounter(_0x3ad2cb);}}}else{if(!_0x3ad2cb[_0x8537('0xc')]){_0x3ad2cb[_0x8537('0x6')]+=0x1;}if(_0x3ad2cb[_0x8537('0xc')]){_0x3ad2cb['talking']+=0x1;updateWaitingCounter(_0x3ad2cb);}}_0x3ad2cb['total']+=0x1;return _0x3ad2cb;}function getLastMessageText(_0x55ef35){return db[_0x8537('0xd')][_0x8537('0xe')]({'where':{'$and':[{'MailInteractionId':_0x55ef35['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8537('0xf')],'order':_0x8537('0x10'),'raw':!![]})[_0x8537('0x11')](function(_0x2f0e73){if(_0x2f0e73&&_0x2f0e73[_0x8537('0xf')]){_0x55ef35[_0x8537('0x12')]=_[_0x8537('0x13')](_0x2f0e73[_0x8537('0xf')]);}return _0x55ef35;})[_0x8537('0x14')](function(_0x4c5d39){throw _0x4c5d39;});}exports[_0x8537('0x15')]=function(_0x22e063,_0x19ffaa,_0x6cd65e,_0x41b479){return new Promise(function(_0x28344b,_0x587052){return getInteractionUsers(_0x22e063['id'],_0x6cd65e)[_0x8537('0x11')](function(_0x5b6c5c){_0x22e063[_0x8537('0x16')]=_0x5b6c5c;return getInteractionTags(_0x22e063['TagIds'],_0x19ffaa);})[_0x8537('0x11')](function(_0x3b568e){_0x22e063[_0x8537('0x17')]=_0x3b568e;delete _0x22e063[_0x8537('0x18')];return updateInteractionCounters(_0x22e063);})['then'](function(_0x1130e6){if(_0x41b479){return getLastMessageText(_0x1130e6);}else{return _0x1130e6;}})['then'](function(_0x82e15d){_0x28344b(_0x82e15d);})[_0x8537('0x14')](function(_0x5a6930){_0x587052(_0x5a6930);});});}; \ No newline at end of file +var _0xa088=['talking','answered','unmanaged','abandoned','total','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting'];(function(_0x9ce749,_0x38b8cf){var _0x3d2c62=function(_0x58d630){while(--_0x58d630){_0x9ce749['push'](_0x9ce749['shift']());}};_0x3d2c62(++_0x38b8cf);}(_0xa088,0x18d));var _0x8a08=function(_0x29bbe0,_0x421be4){_0x29bbe0=_0x29bbe0-0x0;var _0x4b2c42=_0xa088[_0x29bbe0];return _0x4b2c42;};'use strict';var _=require(_0x8a08('0x0'));var db=require(_0x8a08('0x1'))['db'];function getInteractionUsers(_0x58edae,_0x3ab79c){return new Promise(function(_0x4aaf34,_0x109722){try{var _0x4fa542=[];if(_0x3ab79c[_0x58edae]){_0x4fa542=_0x3ab79c[_0x58edae][_0x8a08('0x2')](function(_0x2139f5){return{'id':_0x2139f5['id'],'fullname':_0x2139f5[_0x8a08('0x3')]};});}return _0x4aaf34(_0x4fa542);}catch(_0x2e7153){_0x109722(_0x2e7153);}});}function getInteractionTags(_0x47f191,_0x3f0eaa){var _0xacb3d5=[];if(_0x47f191){_0x47f191[_0x8a08('0x4')](',')[_0x8a08('0x5')](function(_0x432a71){_0xacb3d5[_0x8a08('0x6')](_0x3f0eaa[_0x432a71]);});}return _0xacb3d5;}function updateWaitingCounter(_0x520036){if(_0x520036[_0x8a08('0x7')]){_0x520036[_0x8a08('0x7')]-=0x1;}}function updateInteractionCounters(_0x26e475){_0x26e475['waiting']=0x0;_0x26e475[_0x8a08('0x8')]=0x0;_0x26e475[_0x8a08('0x9')]=0x0;_0x26e475[_0x8a08('0xa')]=0x0;_0x26e475[_0x8a08('0xb')]=0x0;_0x26e475[_0x8a08('0xc')]=0x0;if(_0x26e475['closed']){if(_0x26e475[_0x8a08('0xd')]==='abandoned'){_0x26e475[_0x8a08('0xb')]+=0x1;updateWaitingCounter(_0x26e475);}if(_0x26e475[_0x8a08('0xe')]){_0x26e475['answered']+=0x1;if(_0x26e475[_0x8a08('0x8')]){_0x26e475['talking']-=0x1;}}else{if(_0x26e475[_0x8a08('0xd')]){_0x26e475[_0x8a08('0xa')]+=0x1;updateWaitingCounter(_0x26e475);}}}else{if(!_0x26e475[_0x8a08('0xe')]){_0x26e475['waiting']+=0x1;}if(_0x26e475[_0x8a08('0xe')]){_0x26e475[_0x8a08('0x8')]+=0x1;updateWaitingCounter(_0x26e475);}}_0x26e475[_0x8a08('0xc')]+=0x1;return _0x26e475;}function getLastMessageText(_0x5effe7){return db[_0x8a08('0xf')][_0x8a08('0x10')]({'where':{'$and':[{'MailInteractionId':_0x5effe7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8a08('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8a08('0x12')],'order':_0x8a08('0x13'),'raw':!![]})[_0x8a08('0x14')](function(_0x63d540){if(_0x63d540&&_0x63d540[_0x8a08('0x12')]){_0x5effe7[_0x8a08('0x15')]=_[_0x8a08('0x16')](_0x63d540['plainBody']);}return _0x5effe7;})[_0x8a08('0x17')](function(_0x5dce1){throw _0x5dce1;});}exports[_0x8a08('0x18')]=function(_0x30829d,_0x1c7d60,_0x1c6e47,_0x49baa2){return new Promise(function(_0x35afe2,_0x2bd9f9){return getInteractionUsers(_0x30829d['id'],_0x1c6e47)['then'](function(_0xb33d31){_0x30829d[_0x8a08('0x19')]=_0xb33d31;return getInteractionTags(_0x30829d['TagIds'],_0x1c7d60);})[_0x8a08('0x14')](function(_0x436ef5){_0x30829d[_0x8a08('0x1a')]=_0x436ef5;delete _0x30829d['TagIds'];return updateInteractionCounters(_0x30829d);})[_0x8a08('0x14')](function(_0x110fa2){if(_0x49baa2){return getLastMessageText(_0x110fa2);}else{return _0x110fa2;}})[_0x8a08('0x14')](function(_0x380bc3){_0x35afe2(_0x380bc3);})[_0x8a08('0x17')](function(_0x5039df){_0x2bd9f9(_0x5039df);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 4353c66..c795c28 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 _0x2989=['openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interaction_has_tags','_messages','user_has_','_interactions','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','then','update','catch','error','exports','../../config/logger'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x2989,0x73));var _0x9298=function(_0x283ec2,_0x4d1c02){_0x283ec2=_0x283ec2-0x0;var _0xdc5b57=_0x2989[_0x283ec2];return _0xdc5b57;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x9298('0x0'))(_0x9298('0x1')),'mail':require(_0x9298('0x0'))(_0x9298('0x2')),'fax':require(_0x9298('0x0'))(_0x9298('0x3')),'sms':require('../../config/logger')(_0x9298('0x4')),'chat':require(_0x9298('0x0'))(_0x9298('0x5')),'whatsapp':require(_0x9298('0x0'))('whatsapp-interactions')};function getAccountFK(_0xcce773){return _[_0x9298('0x6')](_0xcce773)+(_0xcce773===_0x9298('0x7')?_0x9298('0x8'):_0x9298('0x9'))+'Id';}function getInteractionFK(_0x2ee046){return _[_0x9298('0x6')](_0x2ee046)+_0x9298('0xa');}function getInteractionId(_0x2a5b2f,_0x50cc2b,_0x3d32a4){if(_0x2a5b2f&&_0x2a5b2f[_['upperFirst'](_0x3d32a4)+_0x9298('0xa')]){return _0x2a5b2f[_[_0x9298('0xb')](_0x3d32a4)+_0x9298('0xa')];}else if(_0x2a5b2f&&_0x2a5b2f['id']){return _0x2a5b2f['id'];}else if(_0x50cc2b&&_0x50cc2b['id']){return _0x50cc2b['id'];}else{return _0x9298('0xc');}}function getInteractionsTables(_0x12a5f2){return{'accounts':_0x12a5f2+'_'+(_0x12a5f2===_0x9298('0x7')?'websites':_0x9298('0xd')),'interactions':_0x12a5f2+'_interactions','interactionsTags':_0x12a5f2+_0x9298('0xe'),'messages':_0x12a5f2+_0x9298('0xf'),'userInteractions':_0x9298('0x10')+_0x12a5f2+_0x9298('0x11')};}function getSelectedTags(_0x4531a7){var _0x4d250c=[];if(_0x4531a7){_0x4d250c=Array['isArray'](_0x4531a7)?_0x4531a7:[_0x4531a7];}return _0x4d250c;}function log(_0xb0c488,_0xdcf625,_0x4056a2,_0x2b8a63,_0x444e32,_0x4c2997){loggers[_0x444e32['toLowerCase']()][_0xb0c488](_0x9298('0x12'),_0x4c2997[_0x9298('0x13')](),_0xdcf625?_0xdcf625['id']:null,_0xdcf625?_0xdcf625[_0x9298('0x14')]:null,_0xdcf625?_0xdcf625[_0x9298('0x15')]:null,getInteractionId(_0x4056a2,_0x2b8a63,_0x444e32),_0x4056a2?JSON[_0x9298('0x16')](_0x4056a2):_0x9298('0x17'));}function updateUser(_0x105f86,_0x139e91,_0xda7dd9,_0x26928e,_0x1f0f02){db[_[_0x9298('0xb')](_0x26928e)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x139e91,_0xda7dd9,_0x26928e)}})[_0x9298('0x18')](function(_0x41f81e){if(_0x41f81e){return _0x41f81e[_0x9298('0x19')]({'UserId':_0x105f86?_0x105f86['id']:null});}})['then'](function(_0x3c3f19){if(_0x3c3f19){log('info',_0x105f86,_0x139e91,_0xda7dd9,_0x26928e,_0x1f0f02);}})[_0x9298('0x1a')](function(){log(_0x9298('0x1b'),_0x105f86,_0x139e91,_0xda7dd9,_0x26928e,_0x1f0f02);});}module[_0x9298('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x686d=['../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','update','info','catch','error','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x686d,0x153));var _0xd686=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0x686d[_0x47a12a];return _0x30cd40;};'use strict';var _=require(_0xd686('0x0'));var db=require(_0xd686('0x1'))['db'];var loggers={'openchannel':require(_0xd686('0x2'))(_0xd686('0x3')),'mail':require(_0xd686('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0xd686('0x4')),'chat':require('../../config/logger')(_0xd686('0x5')),'whatsapp':require('../../config/logger')(_0xd686('0x6'))};function getAccountFK(_0x16b409){return _[_0xd686('0x7')](_0x16b409)+(_0x16b409===_0xd686('0x8')?_0xd686('0x9'):_0xd686('0xa'))+'Id';}function getInteractionFK(_0xc0b4bd){return _[_0xd686('0x7')](_0xc0b4bd)+_0xd686('0xb');}function getInteractionId(_0x4b403c,_0x472e7a,_0x2de8c7){if(_0x4b403c&&_0x4b403c[_[_0xd686('0xc')](_0x2de8c7)+_0xd686('0xb')]){return _0x4b403c[_[_0xd686('0xc')](_0x2de8c7)+_0xd686('0xb')];}else if(_0x4b403c&&_0x4b403c['id']){return _0x4b403c['id'];}else if(_0x472e7a&&_0x472e7a['id']){return _0x472e7a['id'];}else{return _0xd686('0xd');}}function getInteractionsTables(_0x22c39c){return{'accounts':_0x22c39c+'_'+(_0x22c39c==='chat'?_0xd686('0xe'):_0xd686('0xf')),'interactions':_0x22c39c+_0xd686('0x10'),'interactionsTags':_0x22c39c+_0xd686('0x11'),'messages':_0x22c39c+_0xd686('0x12'),'userInteractions':_0xd686('0x13')+_0x22c39c+_0xd686('0x10')};}function getSelectedTags(_0x44f5b7){var _0x43b01a=[];if(_0x44f5b7){_0x43b01a=Array['isArray'](_0x44f5b7)?_0x44f5b7:[_0x44f5b7];}return _0x43b01a;}function log(_0x2f7370,_0x20dcc7,_0x43c511,_0xa94caa,_0x1a6416,_0x5aff08){loggers[_0x1a6416[_0xd686('0x14')]()][_0x2f7370](_0xd686('0x15'),_0x5aff08[_0xd686('0x16')](),_0x20dcc7?_0x20dcc7['id']:null,_0x20dcc7?_0x20dcc7[_0xd686('0x17')]:null,_0x20dcc7?_0x20dcc7[_0xd686('0x18')]:null,getInteractionId(_0x43c511,_0xa94caa,_0x1a6416),_0x43c511?JSON['stringify'](_0x43c511):_0xd686('0x19'));}function updateUser(_0x18edf8,_0x13aa38,_0x2cad24,_0x45dc7c,_0x5698df){db[_[_0xd686('0xc')](_0x45dc7c)+_0xd686('0x1a')][_0xd686('0x1b')]({'where':{'id':getInteractionId(_0x13aa38,_0x2cad24,_0x45dc7c)}})[_0xd686('0x1c')](function(_0x59bcfb){if(_0x59bcfb){return _0x59bcfb[_0xd686('0x1d')]({'UserId':_0x18edf8?_0x18edf8['id']:null});}})[_0xd686('0x1c')](function(_0x20da1a){if(_0x20da1a){log(_0xd686('0x1e'),_0x18edf8,_0x13aa38,_0x2cad24,_0x45dc7c,_0x5698df);}})[_0xd686('0x1f')](function(){log(_0xd686('0x20'),_0x18edf8,_0x13aa38,_0x2cad24,_0x45dc7c,_0x5698df);});}module[_0xd686('0x21')]={'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 67ae9ea..93876e2 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 _0xd400=['admin','user','isUserLimit','util','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','use','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User'];(function(_0x11ddf7,_0x178aa0){var _0x1a19f0=function(_0x1aaa34){while(--_0x1aaa34){_0x11ddf7['push'](_0x11ddf7['shift']());}};_0x1a19f0(++_0x178aa0);}(_0xd400,0x107));var _0x0d40=function(_0xf65238,_0x59edab){_0xf65238=_0xf65238-0x0;var _0x2e8975=_0xd400[_0xf65238];return _0x2e8975;};'use strict';var crypto=require('crypto');var util=require(_0x0d40('0x0'));var compose=require('composable-middleware');var db=require(_0x0d40('0x1'))['db'];var config=require(_0x0d40('0x2'));function getValueFromLicense(_0xbf35c1,_0x19404a){if(_0xbf35c1&&_0x19404a){if(_0x19404a['data1']&&_0x19404a[_0x0d40('0x3')]){var _0x41a77a=_0x19404a[_0x0d40('0x4')];var _0x32d29f=_0x19404a[_0x0d40('0x3')];var _0x435905=_0x41a77a['split']('-')[0x4];var _0xfcb75c=_0x41a77a[_0x0d40('0x5')]('-')[0x0];var _0x288073=crypto[_0x0d40('0x6')](_0x0d40('0x7'),util['format'](_0x0d40('0x8'),_0x435905,_0x41a77a,_0xfcb75c));var _0x4c3e42=_0x288073[_0x0d40('0x9')](_0x32d29f,_0x0d40('0xa'),_0x0d40('0xb'));_0x4c3e42+=_0x288073[_0x0d40('0xc')](_0x0d40('0xb'));var _0x5d475b=JSON['parse'](_0x4c3e42);return _0x5d475b['hasOwnProperty'](_0xbf35c1)?_0x5d475b[_0xbf35c1]:null;}}return null;}function isLimit(_0x3159fc,_0x25400d,_0x4067ad,_0x44343e){var _0x3214a5=_0x25400d;return compose()[_0x0d40('0xd')](function(_0x23c315,_0x561199,_0x17d761){return db['License'][_0x0d40('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x0d40('0xf')](function(_0x29305b){var _0x2bb040=getValueFromLicense(_0x3159fc,_0x29305b);return _0x2bb040?_0x2bb040:_0x3214a5;})[_0x0d40('0xf')](function(_0x4ed9ef){_0x3214a5=_0x4ed9ef;return _0x4067ad[_0x0d40('0x10')](_0x44343e);})[_0x0d40('0xf')](function(_0x35555b){if(_0x35555b>=_0x3214a5){return _0x561199[_0x0d40('0x11')](0x193)[_0x0d40('0x12')]({'message':util[_0x0d40('0x13')](_0x0d40('0x14'),_0x3159fc)});}_0x17d761();})['catch'](function(_0x591c90){_0x17d761(_0x591c90);});});}function isUserLimit(){return isLimit(_0x0d40('0x15'),0x1,db[_0x0d40('0x16')],{'where':{'$or':[{'role':_0x0d40('0x17')},{'role':_0x0d40('0x18')}]}});}exports[_0x0d40('0x19')]=isUserLimit; \ No newline at end of file +var _0x544d=['format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','count','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher'];(function(_0xfc722f,_0x3f3954){var _0x2648d1=function(_0x131112){while(--_0x131112){_0xfc722f['push'](_0xfc722f['shift']());}};_0x2648d1(++_0x3f3954);}(_0x544d,0xbb));var _0xd544=function(_0x158d04,_0xbc4c8){_0x158d04=_0x158d04-0x0;var _0x454dfe=_0x544d[_0x158d04];return _0x454dfe;};'use strict';var crypto=require(_0xd544('0x0'));var util=require(_0xd544('0x1'));var compose=require(_0xd544('0x2'));var db=require(_0xd544('0x3'))['db'];var config=require(_0xd544('0x4'));function getValueFromLicense(_0x3809f6,_0x4e0ceb){if(_0x3809f6&&_0x4e0ceb){if(_0x4e0ceb[_0xd544('0x5')]&&_0x4e0ceb[_0xd544('0x6')]){var _0x3ca222=_0x4e0ceb[_0xd544('0x5')];var _0x4697e3=_0x4e0ceb['license'];var _0x306878=_0x3ca222[_0xd544('0x7')]('-')[0x4];var _0x4b1123=_0x3ca222[_0xd544('0x7')]('-')[0x0];var _0x1750b1=crypto[_0xd544('0x8')]('aes-256-ctr',util[_0xd544('0x9')](_0xd544('0xa'),_0x306878,_0x3ca222,_0x4b1123));var _0x1aa625=_0x1750b1[_0xd544('0xb')](_0x4697e3,'base64',_0xd544('0xc'));_0x1aa625+=_0x1750b1[_0xd544('0xd')](_0xd544('0xc'));var _0x32dafc=JSON[_0xd544('0xe')](_0x1aa625);return _0x32dafc[_0xd544('0xf')](_0x3809f6)?_0x32dafc[_0x3809f6]:null;}}return null;}function isLimit(_0x5081e8,_0x5893c6,_0xe235a0,_0x530037){var _0x5601e1=_0x5893c6;return compose()[_0xd544('0x10')](function(_0x24270a,_0x436c20,_0x43ae8b){return db[_0xd544('0x11')][_0xd544('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x4b384f){var _0x53556e=getValueFromLicense(_0x5081e8,_0x4b384f);return _0x53556e?_0x53556e:_0x5601e1;})['then'](function(_0x50a810){_0x5601e1=_0x50a810;return _0xe235a0[_0xd544('0x13')](_0x530037);})[_0xd544('0x14')](function(_0x1b617c){if(_0x1b617c>=_0x5601e1){return _0x436c20[_0xd544('0x15')](0x193)['json']({'message':util[_0xd544('0x9')](_0xd544('0x16'),_0x5081e8)});}_0x43ae8b();})['catch'](function(_0x29060b){_0x43ae8b(_0x29060b);});});}function isUserLimit(){return isLimit(_0xd544('0x17'),0x1,db[_0xd544('0x18')],{'where':{'$or':[{'role':_0xd544('0x19')},{'role':_0xd544('0x1a')}]}});}exports[_0xd544('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 72dc84b..6651725 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 _0x186d=['LIKE\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','pop','utcOffset','hours','minutes','start','parseSearch','startsWith','[$or]','and','[$and]','split','length','slice','forEach','shift','match','filter','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x186d,0xa4));var _0xd186=function(_0x46ce98,_0x52d764){_0x46ce98=_0x46ce98-0x0;var _0x172f46=_0x186d[_0x46ce98];return _0x172f46;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0xd186('0x0')]=function(_0xbedb81){var _0x2c9f17={'conditions':[]};_0x2c9f17['sqlOperator']=_[_0xd186('0x1')](_0xbedb81,_0xd186('0x2'))?'or':_0xd186('0x3');var _0x398e22=_0xbedb81['replace'](_0xd186('0x4'),'')['replace']('[$or]','')[_0xd186('0x5')]('||');for(var _0x5cb2e1=0x0;_0x5cb2e1<_0x398e22[_0xd186('0x6')];_0x5cb2e1++){var _0x5b9db7=_0x398e22[_0x5cb2e1][_0xd186('0x5')](':=');var _0x54e597=_0x5b9db7[0x0];var _0x4a97c3=_0x5b9db7[_0xd186('0x7')](0x1);_0x4a97c3[_0xd186('0x8')](function(_0x447b40){var _0x1c94f1=_0x447b40[_0xd186('0x5')]('[')[_0xd186('0x9')]();var _0x5428cd=_0x447b40[_0xd186('0xa')](/\[(.*?)\]/g);_0x5428cd['forEach'](function(_0x1088a0){var _0x3668c1=_0x1088a0[_0xd186('0x5')]('[')[_0xd186('0xb')](function(_0x4fcdbb){return _0x4fcdbb['indexOf'](']')>-0x1;})['map'](function(_0x484e94){return _0x484e94['split'](']')[0x0];})[0x0];_0x2c9f17['conditions'][_0xd186('0xc')]({'field':_0x54e597,'operator':_0x1c94f1,'value':_0x3668c1});});});}return _0x2c9f17;};exports[_0xd186('0xd')]=function(_0x47a454,_0x2912e9,_0x3baf48){var _0x1ed3b6={};if(_0x2912e9===_0xd186('0xe')){if(_0x3baf48['operator']===_0xd186('0xf')){_0x3baf48[_0xd186('0x10')]=_0xd186('0x11');_0x3baf48[_0xd186('0x12')]+=','+_0x3baf48[_0xd186('0x12')];}else if(_[_0xd186('0x13')]([_0xd186('0x14'),_0xd186('0x15')],_0x3baf48[_0xd186('0x10')])){_0x3baf48[_0xd186('0x12')]=moment(_0x3baf48[_0xd186('0x12')])[_0xd186('0x16')](0x1,_0xd186('0x17'))[_0xd186('0x18')](_0xd186('0x19'));}}if(_0x3baf48[_0xd186('0x1a')]){_0x2912e9=_0x3baf48[_0xd186('0x1a')];_0x1ed3b6[_0xd186('0x1b')]='CAST('+_0x47a454+'.'+_0x3baf48[_0xd186('0x1c')]+'\x20AS\x20'+_0x3baf48[_0xd186('0x1a')]+')\x20'+parseOperator(_0x3baf48[_0xd186('0x10')]);}else{_0x1ed3b6['text']=_0x47a454+'.'+_0x3baf48[_0xd186('0x1c')]+'\x20'+parseOperator(_0x3baf48['operator']);}if(_['includes']([_0xd186('0x1d'),_0xd186('0x1e')],_0x3baf48[_0xd186('0x10')]))_0x1ed3b6[_0xd186('0x1b')]='('+_0x1ed3b6[_0xd186('0x1b')]+_0xd186('0x1f')+_0x47a454+'.'+_0x3baf48[_0xd186('0x1c')]+_0xd186('0x20');_0x1ed3b6[_0xd186('0x12')]=parseValue(_0x2912e9,_0x3baf48[_0xd186('0x10')],_0x3baf48['value']);return _0x1ed3b6;};function parseOperator(_0x4d6a89){var _0x4f7a68;switch(_0x4d6a89){case _0xd186('0x21'):_0x4f7a68=_0xd186('0x22');break;case _0xd186('0x1e'):_0x4f7a68=_0xd186('0x23');break;case'$eq':_0x4f7a68=_0xd186('0x24');break;case'$ne':_0x4f7a68='<>\x20?';break;case _0xd186('0x25'):case _0xd186('0x26'):case _0xd186('0x27'):_0x4f7a68=_0xd186('0x28');break;case'$lt':_0x4f7a68='<\x20?';break;case _0xd186('0x14'):_0x4f7a68=_0xd186('0x29');break;case _0xd186('0x15'):_0x4f7a68=_0xd186('0x2a');break;case _0xd186('0x2b'):_0x4f7a68=_0xd186('0x2c');break;case _0xd186('0x11'):_0x4f7a68=_0xd186('0x2d');break;}return _0x4f7a68;}function parseValue(_0x532381,_0x336fab,_0x5ca659){var _0x343a19={'start':undefined,'end':undefined};switch(_0x336fab){case _0xd186('0x21'):case _0xd186('0x1e'):_0x343a19['start']=_0x5ca659[_0xd186('0x5')](',');break;case'$substring':_0x343a19['start']='%'+_0x5ca659+'%';break;case'$startsWith':_0x343a19['start']=_0x5ca659+'%';break;case'$endsWith':_0x343a19['start']='%'+_0x5ca659;break;case _0xd186('0x11'):var _0x3dc6a6=_0x5ca659[_0xd186('0x5')](',');var _0x5ca659=_0x3dc6a6[_0xd186('0x9')]();var _0x1632ff=_0x3dc6a6[_0xd186('0x2e')]();if(_0x532381===_0xd186('0xe')){_0x5ca659=moment(_0x5ca659)[_0xd186('0x2f')](0x0,!![])['format']();_0x1632ff=moment(_0x1632ff)['utcOffset'](0x0,!![])[_0xd186('0x16')](0x17,_0xd186('0x30'))[_0xd186('0x16')](0x3b,_0xd186('0x31'))[_0xd186('0x16')](0x3b,'seconds')[_0xd186('0x18')]();}_0x343a19={'start':_0x5ca659,'end':_0x1632ff};break;default:_0x343a19[_0xd186('0x32')]=_0x5ca659;break;}return _0x343a19;} \ No newline at end of file +var _0xc862=['length','shift','forEach','filter','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','>\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','$in','start','$startsWith','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','replace','[$and]','[$or]','split'];(function(_0x3b2489,_0x4a1f11){var _0x142a2b=function(_0x103721){while(--_0x103721){_0x3b2489['push'](_0x3b2489['shift']());}};_0x142a2b(++_0x4a1f11);}(_0xc862,0x130));var _0x2c86=function(_0x3dcf16,_0x371872){_0x3dcf16=_0x3dcf16-0x0;var _0x35f04c=_0xc862[_0x3dcf16];return _0x35f04c;};'use strict';var _=require(_0x2c86('0x0'));var moment=require('moment');exports[_0x2c86('0x1')]=function(_0x1f2ab0){var _0x4ec502={'conditions':[]};_0x4ec502[_0x2c86('0x2')]=_[_0x2c86('0x3')](_0x1f2ab0,'[$or]')?'or':'and';var _0x4bdbad=_0x1f2ab0[_0x2c86('0x4')](_0x2c86('0x5'),'')[_0x2c86('0x4')](_0x2c86('0x6'),'')[_0x2c86('0x7')]('||');for(var _0x6cdbd7=0x0;_0x6cdbd7<_0x4bdbad[_0x2c86('0x8')];_0x6cdbd7++){var _0x14bd7b=_0x4bdbad[_0x6cdbd7][_0x2c86('0x7')](':=');var _0x5bbef6=_0x14bd7b[0x0];var _0x51554e=_0x14bd7b['slice'](0x1);_0x51554e['forEach'](function(_0x116177){var _0x352bb8=_0x116177[_0x2c86('0x7')]('[')[_0x2c86('0x9')]();var _0x47e8aa=_0x116177['match'](/\[(.*?)\]/g);_0x47e8aa[_0x2c86('0xa')](function(_0x30f6f0){var _0x11ab23=_0x30f6f0[_0x2c86('0x7')]('[')[_0x2c86('0xb')](function(_0x352b14){return _0x352b14['indexOf'](']')>-0x1;})['map'](function(_0x2ed1c7){return _0x2ed1c7[_0x2c86('0x7')](']')[0x0];})[0x0];_0x4ec502[_0x2c86('0xc')][_0x2c86('0xd')]({'field':_0x5bbef6,'operator':_0x352bb8,'value':_0x11ab23});});});}return _0x4ec502;};exports[_0x2c86('0xe')]=function(_0x507d9d,_0x49dab7,_0x3f9fb0){var _0x5e3a71={};if(_0x49dab7===_0x2c86('0xf')){if(_0x3f9fb0[_0x2c86('0x10')]===_0x2c86('0x11')){_0x3f9fb0[_0x2c86('0x10')]='$between';_0x3f9fb0['value']+=','+_0x3f9fb0[_0x2c86('0x12')];}else if(_[_0x2c86('0x13')]([_0x2c86('0x14'),_0x2c86('0x15')],_0x3f9fb0[_0x2c86('0x10')])){_0x3f9fb0[_0x2c86('0x12')]=moment(_0x3f9fb0[_0x2c86('0x12')])[_0x2c86('0x16')](0x1,_0x2c86('0x17'))[_0x2c86('0x18')](_0x2c86('0x19'));}}if(_0x3f9fb0['castTo']){_0x49dab7=_0x3f9fb0[_0x2c86('0x1a')];_0x5e3a71[_0x2c86('0x1b')]=_0x2c86('0x1c')+_0x507d9d+'.'+_0x3f9fb0[_0x2c86('0x1d')]+'\x20AS\x20'+_0x3f9fb0[_0x2c86('0x1a')]+')\x20'+parseOperator(_0x3f9fb0[_0x2c86('0x10')]);}else{_0x5e3a71['text']=_0x507d9d+'.'+_0x3f9fb0['field']+'\x20'+parseOperator(_0x3f9fb0['operator']);}if(_[_0x2c86('0x13')]([_0x2c86('0x1e'),_0x2c86('0x1f')],_0x3f9fb0['operator']))_0x5e3a71['text']='('+_0x5e3a71[_0x2c86('0x1b')]+_0x2c86('0x20')+_0x507d9d+'.'+_0x3f9fb0[_0x2c86('0x1d')]+'\x20IS\x20NULL)';_0x5e3a71[_0x2c86('0x12')]=parseValue(_0x49dab7,_0x3f9fb0[_0x2c86('0x10')],_0x3f9fb0[_0x2c86('0x12')]);return _0x5e3a71;};function parseOperator(_0x409b36){var _0x2bea9f;switch(_0x409b36){case'$in':_0x2bea9f='IN\x20?';break;case'$notIn':_0x2bea9f=_0x2c86('0x21');break;case _0x2c86('0x11'):_0x2bea9f=_0x2c86('0x22');break;case _0x2c86('0x1e'):_0x2bea9f=_0x2c86('0x23');break;case _0x2c86('0x24'):case'$startsWith':case _0x2c86('0x25'):_0x2bea9f=_0x2c86('0x26');break;case'$lt':_0x2bea9f='<\x20?';break;case'$gt':_0x2bea9f=_0x2c86('0x27');break;case'$lte':_0x2bea9f=_0x2c86('0x28');break;case _0x2c86('0x29'):_0x2bea9f='>=\x20?';break;case _0x2c86('0x2a'):_0x2bea9f=_0x2c86('0x2b');break;}return _0x2bea9f;}function parseValue(_0x2fe010,_0x19bb70,_0x11aee1){var _0x4ed448={'start':undefined,'end':undefined};switch(_0x19bb70){case _0x2c86('0x2c'):case'$notIn':_0x4ed448[_0x2c86('0x2d')]=_0x11aee1[_0x2c86('0x7')](',');break;case _0x2c86('0x24'):_0x4ed448['start']='%'+_0x11aee1+'%';break;case _0x2c86('0x2e'):_0x4ed448['start']=_0x11aee1+'%';break;case'$endsWith':_0x4ed448[_0x2c86('0x2d')]='%'+_0x11aee1;break;case'$between':var _0x4be89b=_0x11aee1[_0x2c86('0x7')](',');var _0x11aee1=_0x4be89b[_0x2c86('0x9')]();var _0x32a549=_0x4be89b[_0x2c86('0x2f')]();if(_0x2fe010===_0x2c86('0xf')){_0x11aee1=moment(_0x11aee1)[_0x2c86('0x30')](0x0,!![])[_0x2c86('0x18')]();_0x32a549=moment(_0x32a549)[_0x2c86('0x30')](0x0,!![])[_0x2c86('0x16')](0x17,_0x2c86('0x31'))['add'](0x3b,_0x2c86('0x32'))[_0x2c86('0x16')](0x3b,_0x2c86('0x33'))[_0x2c86('0x18')]();}_0x4ed448={'start':_0x11aee1,'end':_0x32a549};break;default:_0x4ed448[_0x2c86('0x2d')]=_0x11aee1;break;}return _0x4ed448;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index dc4cd17..7b59fab 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 _0xd56f=['match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','map','intersection','attributes','nolimit','limit','order','sort','where','filter','object','columns','value','VIRTUAL','lower','merge','options','include','lodash','sequelize','moment','parse','keys','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','offset','col','priority','unsigned','substr','cast','omit','length','isObject','isString','hasOwnProperty','isNumeric'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd56f,0xe8));var _0xfd56=function(_0x482815,_0x3601b1){_0x482815=_0x482815-0x0;var _0x272d11=_0xd56f[_0x482815];return _0x272d11;};'use strict';var _=require(_0xfd56('0x0'));var sequelize=require(_0xfd56('0x1'));var moment=require(_0xfd56('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4299d1){var _0x5b83cb=['ne'];try{var _0x1b786e=JSON[_0xfd56('0x3')](_0x4299d1);var _0x529405=Object[_0xfd56('0x4')](_0x1b786e)[0x0];return _0x5b83cb['includes'](_0x529405);}catch(_0x566176){return![];}}function getOperatorValue(_0x2454ba){var _0x1b0f15=JSON[_0xfd56('0x3')](_0x2454ba);var _0x305111=Object[_0xfd56('0x4')](_0x1b0f15)[0x0];var _0x2cf392=_0x1b0f15[_0x305111];return{['$'+_0x305111]:_0x2cf392};}function parseIncludeModel(_0x27ec81){var _0x2b3b03=JSON['parse'](_0x27ec81);return{'model':db[_0x2b3b03['model']],'as':_0x2b3b03[_0xfd56('0x5')],'attributes':_0x2b3b03[_0xfd56('0x6')],'raw':_0x2b3b03[_0xfd56('0x7')]};}exports[_0xfd56('0x6')]=function(_0x169ced){var _0x4cf672=null;if(_0x169ced){_0x4cf672=_0x169ced[_0xfd56('0x8')](',');}return _0x4cf672;};exports[_0xfd56('0x9')]=function(_0x486311,_0x5a2401){var _0x48d2db={};if(!_[_0xfd56('0xa')](_0x486311)){_[_0xfd56('0xb')](_0x486311,function(_0xcbc31b,_0x376f88){try{if(_0x5a2401){var _0x3a2091=_[_0xfd56('0xc')](_0x5a2401,{'name':_0x376f88})||{};if(hasSequelizeOperator(_0xcbc31b)){_0x48d2db[_0x376f88]=getOperatorValue(_0xcbc31b);}else if(_0x3a2091[_0xfd56('0xd')]===_0xfd56('0xe')&&_[_0xfd56('0xf')](_0xcbc31b)){var _0x265a4c=JSON['parse'](_0xcbc31b);var _0x411140={'$gte':moment(moment(_0x265a4c[_0xfd56('0x10')])[_0xfd56('0x11')](_0xfd56('0x12')))['utc']()[_0xfd56('0x11')](),'$lte':moment(moment(_0x265a4c[_0xfd56('0x13')])[_0xfd56('0x11')]('YYYY-MM-DD'))['utc']()[_0xfd56('0x14')](0x1,'s')[_0xfd56('0x11')]()};_0x48d2db[_0x376f88]=_0x411140;}else if(_0x3a2091[_0xfd56('0x15')]===_0xfd56('0x16')){_0x48d2db[_0x376f88]=_0xcbc31b;}else{_0x48d2db[_0x376f88]=_[_0xfd56('0x17')](_0xcbc31b)?_0xcbc31b:JSON[_0xfd56('0x3')](_0xcbc31b);}}else{_0x48d2db[_0x376f88]=_['isArray'](_0xcbc31b)?_0xcbc31b:JSON[_0xfd56('0x3')](_0xcbc31b);}}catch(_0x224817){_0x48d2db[_0x376f88]=_0xcbc31b[_0xfd56('0x8')](',');}});}return _0x48d2db;};exports['limit']=function(_0x85dd2b){_0x85dd2b=parseInt(_0x85dd2b,0xa);if(!_0x85dd2b||_0x85dd2b<0x0){_0x85dd2b=LIMIT_VALUE;}return _0x85dd2b;};exports[_0xfd56('0x18')]=function(_0x3b6f25){_0x3b6f25=parseInt(_0x3b6f25,0xa);if(!_0x3b6f25||_0x3b6f25<0x0){_0x3b6f25=0x0;}return _0x3b6f25;};exports['sort']=function(_0xf77efe){var _0x248cbc,_0xb22250=null;if(_0xf77efe){_0x248cbc=_0xf77efe['split'](',');_0xb22250=_['map'](_0x248cbc,function(_0x518381){if(_0x518381['indexOf']('-')===0x0){return[_0x518381==='priority'?sequelize['cast'](sequelize[_0xfd56('0x19')](_0xfd56('0x1a')),_0xfd56('0x1b')):_0x518381[_0xfd56('0x1c')](0x1),'DESC'];}else{return[_0x518381===_0xfd56('0x1a')?sequelize[_0xfd56('0x1d')](sequelize[_0xfd56('0x19')](_0xfd56('0x1a')),'unsigned'):_0x518381,'ASC'];}});}return _0xb22250;};exports[_0xfd56('0x1e')]=function(_0x2d3769,_0x166889){if(_[_0xfd56('0xa')](_0x2d3769)){return _0x2d3769;}if(_['isArray'](_0x2d3769)){for(var _0x2f40ba=0x0;_0x2f40ba<_0x2d3769[_0xfd56('0x1f')];_0x2f40ba+=0x1){_0x2d3769[_0x2f40ba]=this[_0xfd56('0x1e')](_0x2d3769[_0x2f40ba],_0x166889);}return _0x2d3769;}if(!_[_0xfd56('0x20')](_0x2d3769)){return _0x2d3769;}if(_[_0xfd56('0x21')](_0x166889)){_0x166889=[_0x166889];}if(!_[_0xfd56('0x17')](_0x166889)){return _0x2d3769;}for(var _0x3c1c78=0x0;_0x3c1c78<_0x166889[_0xfd56('0x1f')];_0x3c1c78+=0x1){_['unset'](_0x2d3769,_0x166889[_0x3c1c78]);}for(var _0x490103 in _0x2d3769){if(_0x2d3769[_0xfd56('0x22')](_0x490103)){_0x2d3769[_0x490103]=this[_0xfd56('0x1e')](_0x2d3769[_0x490103],_0x166889);}}return _0x2d3769;};exports[_0xfd56('0x23')]=function(_0x5bc3f1){return _0x5bc3f1[_0xfd56('0x24')](RegExp(_0xfd56('0x25')))?!![]:![];};exports[_0xfd56('0x26')]=function(_0x232986){return _0x232986[_0xfd56('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xfd56('0x27')]=function(_0x4f81a1,_0x1ee7bd){var _0x342e08=[];var _0x5ecbd4=/[ `!@#$%^&*()_\-?~]/;var _0xd62f02=_0x1ee7bd?_0xfd56('0x28'):_0xfd56('0x29');_0x4f81a1[_0xfd56('0x8')](/[ ,]+/)[_0xfd56('0x2a')](function(_0x5b1271){_0x5b1271=_0x5b1271[_0xfd56('0x2b')](/([^:]")"+/g,'$1');_0x5b1271='+'+_0x5b1271+'*';var _0x1bc39e=_0x5b1271[_0xfd56('0x24')](_0x5ecbd4);if(_0x1bc39e){_0x5b1271='\x22'+_0x5b1271+'\x22';}_0x342e08[_0xfd56('0x2c')](_0x5b1271);});_0xd62f02=_0xd62f02[_0xfd56('0x2b')](_0xfd56('0x29'),_0x342e08[_0xfd56('0x2d')]('\x20'));return _0xd62f02;};exports[_0xfd56('0x2e')]=function(_0x72fffb,_0x37d63c,_0x282ad2){var _0x51a5c3={},_0x2dd0a3={};if(_0x37d63c[_0xfd56('0x2f')][_0xfd56('0x30')]){_0x37d63c['query']['id']=_0x37d63c[_0xfd56('0x2f')][_0xfd56('0x30')];delete _0x37d63c[_0xfd56('0x2f')][_0xfd56('0x30')];}_0x51a5c3[_0xfd56('0x31')]=_[_0xfd56('0x32')](_0x72fffb,_0xfd56('0x15'));_0x51a5c3[_0xfd56('0x2f')]=_[_0xfd56('0x4')](_0x37d63c[_0xfd56('0x2f')]);_0x51a5c3[_0xfd56('0x9')]=_[_0xfd56('0x33')](_0x51a5c3[_0xfd56('0x31')],_0x51a5c3[_0xfd56('0x2f')]);_0x2dd0a3[_0xfd56('0x34')]=_[_0xfd56('0x33')](_0x51a5c3['model'],this['fields'](_0x37d63c[_0xfd56('0x2f')]['fields']));_0x2dd0a3[_0xfd56('0x34')]=_0x2dd0a3[_0xfd56('0x34')][_0xfd56('0x1f')]?_0x2dd0a3['attributes']:_0x51a5c3['model'];if(!_0x37d63c[_0xfd56('0x2f')][_0xfd56('0x22')](_0xfd56('0x35'))){_0x2dd0a3['limit']=this[_0xfd56('0x36')](_0x37d63c[_0xfd56('0x2f')][_0xfd56('0x36')]);_0x2dd0a3['offset']=this[_0xfd56('0x18')](_0x37d63c['query'][_0xfd56('0x18')]);}_0x2dd0a3[_0xfd56('0x37')]=this[_0xfd56('0x38')](_0x37d63c['query'][_0xfd56('0x38')]);_0x2dd0a3[_0xfd56('0x39')]=this[_0xfd56('0x9')](_['pick'](_0x37d63c[_0xfd56('0x2f')],_0x51a5c3[_0xfd56('0x9')]),_0x72fffb);if(_0x37d63c[_0xfd56('0x2f')][_0xfd56('0x3a')]){var _0x344516=_0x72fffb;var _0x88877b=_0x37d63c[_0xfd56('0x2f')][_0xfd56('0x3a')];if(typeof _0x88877b===_0xfd56('0x3b')){_0x344516=_[_0xfd56('0x3a')](_0x72fffb,function(_0x2f593d){return _['includes'](_0x88877b[_0xfd56('0x3c')],_0x2f593d[_0xfd56('0x15')]);});_0x88877b=_0x88877b[_0xfd56('0x3d')];}_0x2dd0a3['where']=_['merge'](_0x2dd0a3[_0xfd56('0x39')],{'$or':_[_0xfd56('0x32')](_0x344516,function(_0x514436){if(_0x514436[_0xfd56('0xd')]!==_0xfd56('0x3e')){if(_0x282ad2){return sequelize[_0xfd56('0x39')](sequelize['fn'](_0xfd56('0x3f'),sequelize[_0xfd56('0x19')](_0x514436[_0xfd56('0x15')])),{'$like':sequelize['fn'](_0xfd56('0x3f'),'%'+_0x37d63c[_0xfd56('0x2f')][_0xfd56('0x3a')]+'%')});}else{var _0x2221c0={};_0x2221c0[_0x514436[_0xfd56('0x15')]]={'$like':'%'+_0x37d63c['query'][_0xfd56('0x3a')]+'%'};return _0x2221c0;}}})});}_0x2dd0a3=_[_0xfd56('0x40')]({},_0x2dd0a3,_0x37d63c[_0xfd56('0x41')]);return _0x2dd0a3;};exports['include']=function(_0xc862cc){var _0x222372=[];if(_0xc862cc['includeAll']){_0x222372['push']({'all':!![]});}else if(_0xc862cc[_0xfd56('0x42')]){if(Array[_0xfd56('0x17')](_0xc862cc[_0xfd56('0x42')])){_0x222372=Object[_0xfd56('0x4')](_0xc862cc[_0xfd56('0x42')])[_0xfd56('0x32')](function(_0x499dbb){return parseIncludeModel(_0xc862cc[_0xfd56('0x42')][_0x499dbb]);});}else{var _0x3563ed=parseIncludeModel(_0xc862cc[_0xfd56('0x42')]);_0x222372[_0xfd56('0x2c')](_0x3563ed);}}return _0x222372;}; \ No newline at end of file +var _0x404f=['unsigned','substr','DESC','ASC','omit','isEmpty','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','offset','order','where','pick','filter','object','columns','value','merge','lower','includeAll','include','sequelize','moment','parse','keys','includes','alias','fields','raw','split','filters','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','sort','map','indexOf','priority','cast','col'];(function(_0x68ed1c,_0x310895){var _0x1b6f34=function(_0x1d72f9){while(--_0x1d72f9){_0x68ed1c['push'](_0x68ed1c['shift']());}};_0x1b6f34(++_0x310895);}(_0x404f,0xf7));var _0xf404=function(_0x329310,_0x11824d){_0x329310=_0x329310-0x0;var _0x5f5148=_0x404f[_0x329310];return _0x5f5148;};'use strict';var _=require('lodash');var sequelize=require(_0xf404('0x0'));var moment=require(_0xf404('0x1'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x527f62){var _0x4ccc25=['ne'];try{var _0x305983=JSON[_0xf404('0x2')](_0x527f62);var _0x5e55cb=Object[_0xf404('0x3')](_0x305983)[0x0];return _0x4ccc25[_0xf404('0x4')](_0x5e55cb);}catch(_0x17357d){return![];}}function getOperatorValue(_0x30e9d7){var _0x4fc282=JSON[_0xf404('0x2')](_0x30e9d7);var _0xe754f7=Object[_0xf404('0x3')](_0x4fc282)[0x0];var _0x289707=_0x4fc282[_0xe754f7];return{['$'+_0xe754f7]:_0x289707};}function parseIncludeModel(_0x354577){var _0x3fbf13=JSON[_0xf404('0x2')](_0x354577);return{'model':db[_0x3fbf13['model']],'as':_0x3fbf13[_0xf404('0x5')],'attributes':_0x3fbf13[_0xf404('0x6')],'raw':_0x3fbf13[_0xf404('0x7')]};}exports['fields']=function(_0x2df2f3){var _0x38a1f6=null;if(_0x2df2f3){_0x38a1f6=_0x2df2f3[_0xf404('0x8')](',');}return _0x38a1f6;};exports[_0xf404('0x9')]=function(_0x5b5729,_0x19c882){var _0x35402b={};if(!_['isEmpty'](_0x5b5729)){_['forOwn'](_0x5b5729,function(_0x110995,_0x386943){try{if(_0x19c882){var _0x2ee9c8=_[_0xf404('0xa')](_0x19c882,{'name':_0x386943})||{};if(hasSequelizeOperator(_0x110995)){_0x35402b[_0x386943]=getOperatorValue(_0x110995);}else if(_0x2ee9c8[_0xf404('0xb')]===_0xf404('0xc')&&_[_0xf404('0xd')](_0x110995)){var _0x47d8be=JSON['parse'](_0x110995);var _0x343649={'$gte':moment(moment(_0x47d8be[_0xf404('0xe')])[_0xf404('0xf')](_0xf404('0x10')))[_0xf404('0x11')]()[_0xf404('0xf')](),'$lte':moment(moment(_0x47d8be[_0xf404('0x12')])[_0xf404('0xf')](_0xf404('0x10')))[_0xf404('0x11')]()[_0xf404('0x13')](0x1,'s')['format']()};_0x35402b[_0x386943]=_0x343649;}else if(_0x2ee9c8[_0xf404('0x14')]==='uniqueid'){_0x35402b[_0x386943]=_0x110995;}else{_0x35402b[_0x386943]=_[_0xf404('0x15')](_0x110995)?_0x110995:JSON[_0xf404('0x2')](_0x110995);}}else{_0x35402b[_0x386943]=_[_0xf404('0x15')](_0x110995)?_0x110995:JSON['parse'](_0x110995);}}catch(_0x327a23){_0x35402b[_0x386943]=_0x110995[_0xf404('0x8')](',');}});}return _0x35402b;};exports[_0xf404('0x16')]=function(_0x3f7664){_0x3f7664=parseInt(_0x3f7664,0xa);if(!_0x3f7664||_0x3f7664<0x0){_0x3f7664=LIMIT_VALUE;}return _0x3f7664;};exports['offset']=function(_0x4ab34a){_0x4ab34a=parseInt(_0x4ab34a,0xa);if(!_0x4ab34a||_0x4ab34a<0x0){_0x4ab34a=0x0;}return _0x4ab34a;};exports[_0xf404('0x17')]=function(_0x2de9d0){var _0x4e71b0,_0x438951=null;if(_0x2de9d0){_0x4e71b0=_0x2de9d0[_0xf404('0x8')](',');_0x438951=_[_0xf404('0x18')](_0x4e71b0,function(_0x459930){if(_0x459930[_0xf404('0x19')]('-')===0x0){return[_0x459930===_0xf404('0x1a')?sequelize[_0xf404('0x1b')](sequelize[_0xf404('0x1c')](_0xf404('0x1a')),_0xf404('0x1d')):_0x459930[_0xf404('0x1e')](0x1),_0xf404('0x1f')];}else{return[_0x459930==='priority'?sequelize['cast'](sequelize[_0xf404('0x1c')]('priority'),'unsigned'):_0x459930,_0xf404('0x20')];}});}return _0x438951;};exports[_0xf404('0x21')]=function(_0x594fe8,_0x2f94a3){if(_[_0xf404('0x22')](_0x594fe8)){return _0x594fe8;}if(_['isArray'](_0x594fe8)){for(var _0x5834e9=0x0;_0x5834e9<_0x594fe8[_0xf404('0x23')];_0x5834e9+=0x1){_0x594fe8[_0x5834e9]=this[_0xf404('0x21')](_0x594fe8[_0x5834e9],_0x2f94a3);}return _0x594fe8;}if(!_[_0xf404('0x24')](_0x594fe8)){return _0x594fe8;}if(_['isString'](_0x2f94a3)){_0x2f94a3=[_0x2f94a3];}if(!_[_0xf404('0x15')](_0x2f94a3)){return _0x594fe8;}for(var _0x4c1966=0x0;_0x4c1966<_0x2f94a3[_0xf404('0x23')];_0x4c1966+=0x1){_[_0xf404('0x25')](_0x594fe8,_0x2f94a3[_0x4c1966]);}for(var _0x30b367 in _0x594fe8){if(_0x594fe8[_0xf404('0x26')](_0x30b367)){_0x594fe8[_0x30b367]=this[_0xf404('0x21')](_0x594fe8[_0x30b367],_0x2f94a3);}}return _0x594fe8;};exports[_0xf404('0x27')]=function(_0x50fdfb){return _0x50fdfb[_0xf404('0x28')](RegExp(_0xf404('0x29')))?!![]:![];};exports[_0xf404('0x2a')]=function(_0x3fd4cf){return _0x3fd4cf[_0xf404('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0xf404('0x2b')]=function(_0x2c2593,_0x286c35){var _0x360dd1=[];var _0xc9e3b2=/[ `!@#$%^&*()_\-?~]/;var _0x142743=_0x286c35?_0xf404('0x2c'):_0xf404('0x2d');_0x2c2593[_0xf404('0x8')](/[ ,]+/)[_0xf404('0x2e')](function(_0xc09d59){_0xc09d59=_0xc09d59[_0xf404('0x2f')](/([^:]")"+/g,'$1');_0xc09d59='+'+_0xc09d59+'*';var _0x3d1f5a=_0xc09d59[_0xf404('0x28')](_0xc9e3b2);if(_0x3d1f5a){_0xc09d59='\x22'+_0xc09d59+'\x22';}_0x360dd1[_0xf404('0x30')](_0xc09d59);});_0x142743=_0x142743[_0xf404('0x2f')]('{EXPR}',_0x360dd1[_0xf404('0x31')]('\x20'));return _0x142743;};exports[_0xf404('0x32')]=function(_0x1ec7c9,_0x86b717,_0x5afe81){var _0x59efb0={},_0x33066e={};if(_0x86b717[_0xf404('0x33')][_0xf404('0x34')]){_0x86b717[_0xf404('0x33')]['id']=_0x86b717[_0xf404('0x33')]['$id'];delete _0x86b717['query'][_0xf404('0x34')];}_0x59efb0[_0xf404('0x35')]=_['map'](_0x1ec7c9,_0xf404('0x14'));_0x59efb0[_0xf404('0x33')]=_['keys'](_0x86b717['query']);_0x59efb0[_0xf404('0x9')]=_[_0xf404('0x36')](_0x59efb0[_0xf404('0x35')],_0x59efb0['query']);_0x33066e['attributes']=_[_0xf404('0x36')](_0x59efb0[_0xf404('0x35')],this[_0xf404('0x6')](_0x86b717['query']['fields']));_0x33066e[_0xf404('0x37')]=_0x33066e[_0xf404('0x37')][_0xf404('0x23')]?_0x33066e[_0xf404('0x37')]:_0x59efb0['model'];if(!_0x86b717[_0xf404('0x33')]['hasOwnProperty'](_0xf404('0x38'))){_0x33066e[_0xf404('0x16')]=this[_0xf404('0x16')](_0x86b717[_0xf404('0x33')]['limit']);_0x33066e[_0xf404('0x39')]=this[_0xf404('0x39')](_0x86b717[_0xf404('0x33')][_0xf404('0x39')]);}_0x33066e[_0xf404('0x3a')]=this[_0xf404('0x17')](_0x86b717[_0xf404('0x33')][_0xf404('0x17')]);_0x33066e[_0xf404('0x3b')]=this[_0xf404('0x9')](_[_0xf404('0x3c')](_0x86b717[_0xf404('0x33')],_0x59efb0[_0xf404('0x9')]),_0x1ec7c9);if(_0x86b717['query'][_0xf404('0x3d')]){var _0x190eaa=_0x1ec7c9;var _0x3946d5=_0x86b717[_0xf404('0x33')][_0xf404('0x3d')];if(typeof _0x3946d5===_0xf404('0x3e')){_0x190eaa=_['filter'](_0x1ec7c9,function(_0x4772e3){return _[_0xf404('0x4')](_0x3946d5[_0xf404('0x3f')],_0x4772e3[_0xf404('0x14')]);});_0x3946d5=_0x3946d5[_0xf404('0x40')];}_0x33066e[_0xf404('0x3b')]=_[_0xf404('0x41')](_0x33066e[_0xf404('0x3b')],{'$or':_[_0xf404('0x18')](_0x190eaa,function(_0x5e5aa7){if(_0x5e5aa7[_0xf404('0xb')]!=='VIRTUAL'){if(_0x5afe81){return sequelize['where'](sequelize['fn'](_0xf404('0x42'),sequelize[_0xf404('0x1c')](_0x5e5aa7[_0xf404('0x14')])),{'$like':sequelize['fn'](_0xf404('0x42'),'%'+_0x86b717[_0xf404('0x33')]['filter']+'%')});}else{var _0x3b805a={};_0x3b805a[_0x5e5aa7[_0xf404('0x14')]]={'$like':'%'+_0x86b717[_0xf404('0x33')]['filter']+'%'};return _0x3b805a;}}})});}_0x33066e=_['merge']({},_0x33066e,_0x86b717['options']);return _0x33066e;};exports['include']=function(_0x24f1dc){var _0xa49a4f=[];if(_0x24f1dc[_0xf404('0x43')]){_0xa49a4f['push']({'all':!![]});}else if(_0x24f1dc[_0xf404('0x44')]){if(Array[_0xf404('0x15')](_0x24f1dc[_0xf404('0x44')])){_0xa49a4f=Object[_0xf404('0x3')](_0x24f1dc[_0xf404('0x44')])[_0xf404('0x18')](function(_0x245c5b){return parseIncludeModel(_0x24f1dc[_0xf404('0x44')][_0x245c5b]);});}else{var _0x2c8879=parseIncludeModel(_0x24f1dc['include']);_0xa49a4f[_0xf404('0x30')](_0x2c8879);}}return _0xa49a4f;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 9a867c1..651cadb 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 _0x5fdc=['length','idle','unknown','unavailable','ringing','isNil','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','getRealtimeAgents','*pause','busy','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','voicePause','whatsappPause','pauseType','find','merge','globalStatus','fields','order','startsWith','DESC','ASC','fullname,internal','substring','indexOf','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastPauseAt','chatCapacity','mailCapacity','smsCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','online','omit','pick','role','faxCapacity','openchannelCapacity','whatsappCapacity','faxCurrentCapacity','mailCurrentCapacity','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','queue','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','filter'];(function(_0x4050ff,_0x3b1584){var _0x5c5c09=function(_0x460035){while(--_0x460035){_0x4050ff['push'](_0x4050ff['shift']());}};_0x5c5c09(++_0x3b1584);}(_0x5fdc,0x127));var _0xc5fd=function(_0x350773,_0x5e4017){_0x350773=_0x350773-0x0;var _0x251764=_0x5fdc[_0x350773];return _0x251764;};'use strict';var _=require(_0xc5fd('0x0'));var jayson=require(_0xc5fd('0x1'));var db=require(_0xc5fd('0x2'))['db'];var amiClient=jayson[_0xc5fd('0x3')][_0xc5fd('0x4')]({'port':0x232a});var routingClient=jayson[_0xc5fd('0x3')][_0xc5fd('0x4')]({'port':0x232c});function isAgentPaused(_0x4d015c,_0xfdf928){var _0x1b6205=[_0x4d015c[_0xc5fd('0x5')],_0x4d015c[_0xc5fd('0x6')],_0x4d015c[_0xc5fd('0x7')],_0x4d015c[_0xc5fd('0x8')],_0x4d015c[_0xc5fd('0x9')],_0x4d015c['voicePause'],_0x4d015c['whatsappPause']];if(!_0xfdf928)return _['every'](_0x1b6205);var _0x224801=_[_0xc5fd('0xa')](_0x1b6205);return _0x224801[_0xc5fd('0xb')]>0x0&&_0x224801[_0xc5fd('0xb')]<_0x1b6205['length']?!![]:![];}function isIdle(_0x4e1e94){return _0x4e1e94===_0xc5fd('0xc')||_0x4e1e94===_0xc5fd('0xd')||_0x4e1e94===_0xc5fd('0xe')||_0x4e1e94===_0xc5fd('0xf')||_[_0xc5fd('0x10')](_0x4e1e94);}function isAgentIdle(_0x368c80){if(_0x368c80['voiceStatus']!==_0xc5fd('0xc')&&_0x368c80['voicePause']){_0x368c80['voiceStatus']=_0xc5fd('0x11');return![];}return _[_0xc5fd('0x12')]([_0x368c80[_0xc5fd('0x13')],_0x368c80[_0xc5fd('0x14')],_0x368c80[_0xc5fd('0x15')],_0x368c80[_0xc5fd('0x16')],_0x368c80[_0xc5fd('0x17')],_0x368c80[_0xc5fd('0x18')],_0x368c80['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xc5fd('0x19')](_0xc5fd('0x1a'),{})[_0xc5fd('0x1b')](function(_0x3404e0){if(_0x3404e0['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x4efafd=_0x3404e0['result'];return routingClient['request'](_0xc5fd('0x1a'),{})[_0xc5fd('0x1b')](function(_0x27f611){if(_0x27f611[_0xc5fd('0x1c')]){throw new Error(_0xc5fd('0x1d'));}var _0x3f981f=_0x27f611[_0xc5fd('0x1e')];return _['merge']({},_0x4efafd,_0x3f981f);});})[_0xc5fd('0x1f')](function(_0x27bda1){throw _0x27bda1;});}exports[_0xc5fd('0x20')]=getRealtimeAgents;function getAgentStatus(_0x9c12e4){var _0x3b3093='unknown';if(isAgentPaused(_0x9c12e4))_0x3b3093=_0xc5fd('0x11');else if(isAgentPaused(_0x9c12e4,!![]))_0x3b3093=_0xc5fd('0x21');else if(isAgentIdle(_0x9c12e4))_0x3b3093=_0xc5fd('0xc');else _0x3b3093=_0xc5fd('0x22');return _0x3b3093;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x4c85d5,_0x13cc42){var _0x2ab935=_[_0xc5fd('0x23')](_0x4c85d5)?_0x4c85d5:[_0x4c85d5];var _0x42d7f4=_[_0xc5fd('0x24')](_0x13cc42)+_0xc5fd('0x25');var _0x56d473=_[_0xc5fd('0x26')](_0x2ab935,function(_0x2701f7){return db[_0x42d7f4][_0xc5fd('0x27')]({'where':{'id':_0x2701f7}})[_0xc5fd('0x1b')](function(_0x39bb5e){if(!_0x39bb5e)return[];return _0x39bb5e[_0xc5fd('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xc5fd('0x29')](_0x56d473)['then'](function(_0x3a86f9){var _0x48cd1d=_(_0x3a86f9)[_0xc5fd('0x2a')]()[_0xc5fd('0x26')]('id')[_0xc5fd('0x2b')]()[_0xc5fd('0x2c')]();return _0x48cd1d;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x176313,_0x1bbdc4,_0x19c4a0){try{if(_0x1bbdc4[_0xc5fd('0xb')]>0x0){_0x176313=_0x176313[_0xc5fd('0xa')](function(_0x209975){return _0x1bbdc4['includes'](_0x209975['id']);});}var _0x412ef7=_0x176313['filter'](function(_0x4859f7){var _0x12a962=_0xc5fd('0x22');if(isAgentIdle(_0x4859f7)){_0x12a962=_0xc5fd('0xc');}return _0x12a962===_0x19c4a0;});return _[_0xc5fd('0x26')](_0x412ef7,'id');}catch(_0x7693c4){throw _0x7693c4;}}exports[_0xc5fd('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2a891d,_0x321eea,_0x49260d){return Promise[_0xc5fd('0x2e')]()[_0xc5fd('0x1b')](function(){if(_0x321eea[_0xc5fd('0xb')]>0x0){_0x2a891d=_0x2a891d[_0xc5fd('0xa')](function(_0x14c832){return _0x321eea[_0xc5fd('0x2f')](_0x14c832['id']);});}return _0x2a891d;})[_0xc5fd('0x1b')](function(){return db[_0xc5fd('0x30')][_0xc5fd('0x31')]({'attributes':['id',_0xc5fd('0x32'),_0xc5fd('0x33'),_0xc5fd('0x5'),'faxPause',_0xc5fd('0x7'),_0xc5fd('0x8'),_0xc5fd('0x9'),_0xc5fd('0x34'),_0xc5fd('0x35'),_0xc5fd('0x36')],'where':{'id':{'$in':_[_0xc5fd('0x26')](_0x2a891d,'id')}},'raw':!![]});})[_0xc5fd('0x1b')](function(_0x358883){return _0x358883['map'](function(_0xd15f7e){var _0x14d1c7=_[_0xc5fd('0x37')](_0x2a891d,['id',_0xd15f7e['id']]);var _0xc2c90b=filterAgentAttributes(_0x14d1c7);_[_0xc5fd('0x38')](_0xd15f7e,_0xc2c90b);_0xd15f7e[_0xc5fd('0x39')]=getAgentStatus(_0xd15f7e);return _0xd15f7e;});})[_0xc5fd('0x1b')](function(_0x50f1bf){var _0x8cd899=sortAgentsByStatus(_0x50f1bf,_0x49260d);return _[_0xc5fd('0x26')](_0x8cd899,'id');})['catch'](function(_0x1f7a7b){throw _0x1f7a7b;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x31bb5e){var _0x73533a={'fields':[],'order':null};var _0x23e7c8=_0x31bb5e['split'](',');_0x73533a[_0xc5fd('0x3a')]=_[_0xc5fd('0xa')](_0x23e7c8,function(_0x584662){if(!_0x584662[_0xc5fd('0x2f')](_0xc5fd('0x39'))){return!![];}_0x73533a[_0xc5fd('0x3b')]=_[_0xc5fd('0x3c')](_0x584662,'-')?_0xc5fd('0x3d'):_0xc5fd('0x3e');return![];});return _0x73533a;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x401e22){if(!_0x401e22){_0x401e22=_0xc5fd('0x3f');}if(_0x401e22[_0xc5fd('0x2f')](_0xc5fd('0x33'))&&!_0x401e22['includes']('internal')){var _0x47fe66=_0x401e22[_0xc5fd('0x40')](0x0,_0x401e22[_0xc5fd('0x41')](_0xc5fd('0x33')));_0x401e22+=','+_0x47fe66+_0xc5fd('0x42');}return _0x401e22;}exports[_0xc5fd('0x43')]=validateSortParameter;function sortAgentsByStatus(_0x33514d,_0x2c5d7a){var _0x2ef96f=_0x33514d[_0xc5fd('0x44')](function(_0x53341b,_0x5a2199){if(_0x53341b[_0xc5fd('0x39')]===_0x5a2199['globalStatus']){if(_0x53341b[_0xc5fd('0x39')]===_0xc5fd('0x11')){if(_0x2c5d7a===_0xc5fd('0x3d')){return(_0x53341b['pauseType']||'')<(_0x5a2199[_0xc5fd('0x36')]||'')||_0x53341b[_0xc5fd('0x33')]['toLowerCase']()>_0x5a2199[_0xc5fd('0x33')][_0xc5fd('0x45')]()?0x1:-0x1;}else{return(_0x53341b['pauseType']||'')<(_0x5a2199[_0xc5fd('0x36')]||'')||_0x53341b['fullname'][_0xc5fd('0x45')]()>_0x5a2199[_0xc5fd('0x33')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x2c5d7a===_0xc5fd('0x3d')){return _0x53341b[_0xc5fd('0x33')][_0xc5fd('0x45')]()<_0x5a2199['fullname'][_0xc5fd('0x45')]()?0x1:-0x1;}else{return _0x53341b[_0xc5fd('0x33')]['toLowerCase']()<_0x5a2199['fullname'][_0xc5fd('0x45')]()?-0x1:0x1;}}}else{if(_0x2c5d7a==='DESC'){return _0x53341b['globalStatus']<_0x5a2199['globalStatus']?0x1:-0x1;}else{return _0x53341b[_0xc5fd('0x39')]<_0x5a2199[_0xc5fd('0x39')]?-0x1:0x1;}}});return _0x2ef96f;}exports[_0xc5fd('0x46')]=sortAgentsByStatus;function filterAgentAttributes(_0x3fbf5d){var _0x453b02=[_0xc5fd('0x47'),'online','lastLoginAt','lastPauseAt',_0xc5fd('0x36'),_0xc5fd('0x48'),_0xc5fd('0x42'),'address',_0xc5fd('0x5'),'openchannelPause',_0xc5fd('0x7'),_0xc5fd('0x9'),_0xc5fd('0x35'),_0xc5fd('0x6'),_0xc5fd('0x34'),_0xc5fd('0x49'),'openchannelCapacity',_0xc5fd('0x4a'),_0xc5fd('0x4b'),'whatsappCapacity','faxCapacity',_0xc5fd('0x4c'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xc5fd('0x4d'),_0xc5fd('0x4e'),'faxCurrentCapacity',_0xc5fd('0x13'),_0xc5fd('0x16'),'mailStatus',_0xc5fd('0x17'),_0xc5fd('0x4f'),_0xc5fd('0x14'),_0xc5fd('0x18'),_0xc5fd('0x50'),_0xc5fd('0x51'),_0xc5fd('0x52'),_0xc5fd('0x53'),_0xc5fd('0x54'),_0xc5fd('0x55'),_0xc5fd('0x56'),'queue',_0xc5fd('0x57'),_0xc5fd('0x58'),_0xc5fd('0x59'),'phoneBarEnableAutomaticScreenRecording'];var _0xb540a=[_0xc5fd('0x5'),_0xc5fd('0x8'),_0xc5fd('0x7'),'smsPause',_0xc5fd('0x35'),'faxPause','voicePause',_0xc5fd('0x5a')];var _0x3f7cd6=_(_0x3fbf5d)[_0xc5fd('0x5b')](_0xb540a)[_0xc5fd('0x5c')](_0x453b02)[_0xc5fd('0x2c')]();return _0x3f7cd6;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0xc5fd('0x33'),_0xc5fd('0x5d'),'internal','online','globalStatus',_0xc5fd('0x47'),'lastLoginAt',_0xc5fd('0x36'),_0xc5fd('0x48'),_0xc5fd('0x6'),_0xc5fd('0x5'),_0xc5fd('0x7'),_0xc5fd('0x8'),_0xc5fd('0x9'),'voicePause',_0xc5fd('0x35'),_0xc5fd('0x13'),_0xc5fd('0x14'),'mailStatus','openchannelStatus',_0xc5fd('0x17'),_0xc5fd('0x18'),_0xc5fd('0x4f'),_0xc5fd('0x50'),_0xc5fd('0x55'),_0xc5fd('0x52'),_0xc5fd('0x51'),_0xc5fd('0x53'),_0xc5fd('0x56'),_0xc5fd('0x54'),_0xc5fd('0x49'),_0xc5fd('0x5e'),_0xc5fd('0x4a'),_0xc5fd('0x5f'),_0xc5fd('0x4b'),_0xc5fd('0x60'),'chatCurrentCapacity',_0xc5fd('0x61'),_0xc5fd('0x62'),_0xc5fd('0x63'),'smsCurrentCapacity',_0xc5fd('0x4e'),_0xc5fd('0x59'),_0xc5fd('0x64'),_0xc5fd('0x57'),'onhold',_0xc5fd('0x65'),_0xc5fd('0x58')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x19cb=['toLowerCase','sortAgentsByStatus','userpic','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','filterAgentAttributes','role','online','lastLoginAt','faxStatusTime','mailStatusTime','voiceStatusTime','whatsappStatusTime','openchannelCurrentCapacity','whatsappCurrentCapacity','onhold','getRealtimeAgentsQueryFields','jayson/promise','../../mysqldb','http','chatPause','faxPause','smsPause','voicePause','whatsappPause','every','length','idle','unavailable','ringing','isNil','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','result','merge','getRealtimeAgents','unknown','*pause','busy','isArray','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','filter','includes','map','getAgentIdsByStatus','resolve','name','fullname','mailPause','openchannelPause','pauseType','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','validateSortParameter','sort','pause'];(function(_0x28f45a,_0xedfc23){var _0x314592=function(_0x51c973){while(--_0x51c973){_0x28f45a['push'](_0x28f45a['shift']());}};_0x314592(++_0xedfc23);}(_0x19cb,0x146));var _0xb19c=function(_0x5d958f,_0x478e75){_0x5d958f=_0x5d958f-0x0;var _0x3916d5=_0x19cb[_0x5d958f];return _0x3916d5;};'use strict';var _=require('lodash');var jayson=require(_0xb19c('0x0'));var db=require(_0xb19c('0x1'))['db'];var amiClient=jayson['client'][_0xb19c('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0xb19c('0x2')]({'port':0x232c});function isAgentPaused(_0x534a1d,_0x503187){var _0x56d20c=[_0x534a1d[_0xb19c('0x3')],_0x534a1d[_0xb19c('0x4')],_0x534a1d['mailPause'],_0x534a1d['openchannelPause'],_0x534a1d[_0xb19c('0x5')],_0x534a1d[_0xb19c('0x6')],_0x534a1d[_0xb19c('0x7')]];if(!_0x503187)return _[_0xb19c('0x8')](_0x56d20c);var _0x5d50d4=_['filter'](_0x56d20c);return _0x5d50d4[_0xb19c('0x9')]>0x0&&_0x5d50d4[_0xb19c('0x9')]<_0x56d20c[_0xb19c('0x9')]?!![]:![];}function isIdle(_0x12d1ce){return _0x12d1ce===_0xb19c('0xa')||_0x12d1ce==='unknown'||_0x12d1ce===_0xb19c('0xb')||_0x12d1ce===_0xb19c('0xc')||_[_0xb19c('0xd')](_0x12d1ce);}function isAgentIdle(_0x3b7448){if(_0x3b7448[_0xb19c('0xe')]!==_0xb19c('0xa')&&_0x3b7448['voicePause']){_0x3b7448['voiceStatus']='pause';return![];}return _[_0xb19c('0x8')]([_0x3b7448[_0xb19c('0xf')],_0x3b7448[_0xb19c('0x10')],_0x3b7448['mailStatus'],_0x3b7448[_0xb19c('0x11')],_0x3b7448[_0xb19c('0x12')],_0x3b7448[_0xb19c('0xe')],_0x3b7448['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xb19c('0x13')]('Agents',{})[_0xb19c('0x14')](function(_0x261602){if(_0x261602[_0xb19c('0x15')]){throw new Error(_0xb19c('0x16'));}var _0x11eea0=_0x261602['result'];return routingClient[_0xb19c('0x13')](_0xb19c('0x17'),{})[_0xb19c('0x14')](function(_0x2b2815){if(_0x2b2815[_0xb19c('0x15')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x4d3926=_0x2b2815[_0xb19c('0x18')];return _[_0xb19c('0x19')]({},_0x11eea0,_0x4d3926);});})['catch'](function(_0x55cf87){throw _0x55cf87;});}exports[_0xb19c('0x1a')]=getRealtimeAgents;function getAgentStatus(_0x1914e1){var _0xe42795=_0xb19c('0x1b');if(isAgentPaused(_0x1914e1))_0xe42795='pause';else if(isAgentPaused(_0x1914e1,!![]))_0xe42795=_0xb19c('0x1c');else if(isAgentIdle(_0x1914e1))_0xe42795=_0xb19c('0xa');else _0xe42795=_0xb19c('0x1d');return _0xe42795;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x250604,_0x383878){var _0x186f47=_[_0xb19c('0x1e')](_0x250604)?_0x250604:[_0x250604];var _0xe0e6d9=_['startCase'](_0x383878)+'Queue';var _0x3b3d64=_['map'](_0x186f47,function(_0x7b3f7a){return db[_0xe0e6d9]['findOne']({'where':{'id':_0x7b3f7a}})[_0xb19c('0x14')](function(_0x1fdc4e){if(!_0x1fdc4e)return[];return _0x1fdc4e[_0xb19c('0x1f')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb19c('0x20')](_0x3b3d64)[_0xb19c('0x14')](function(_0x1774fc){var _0x343dda=_(_0x1774fc)[_0xb19c('0x21')]()['map']('id')[_0xb19c('0x22')]()[_0xb19c('0x23')]();return _0x343dda;});}exports[_0xb19c('0x24')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x318c5d,_0x513339,_0x5d9bcd){try{if(_0x513339['length']>0x0){_0x318c5d=_0x318c5d[_0xb19c('0x25')](function(_0x1dd187){return _0x513339[_0xb19c('0x26')](_0x1dd187['id']);});}var _0x168045=_0x318c5d[_0xb19c('0x25')](function(_0x4acb68){var _0x1f11e8=_0xb19c('0x1d');if(isAgentIdle(_0x4acb68)){_0x1f11e8=_0xb19c('0xa');}return _0x1f11e8===_0x5d9bcd;});return _[_0xb19c('0x27')](_0x168045,'id');}catch(_0x11ddf3){throw _0x11ddf3;}}exports[_0xb19c('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x7b42f5,_0x4bd235,_0x1f5720){return Promise[_0xb19c('0x29')]()['then'](function(){if(_0x4bd235[_0xb19c('0x9')]>0x0){_0x7b42f5=_0x7b42f5[_0xb19c('0x25')](function(_0x31c93f){return _0x4bd235[_0xb19c('0x26')](_0x31c93f['id']);});}return _0x7b42f5;})[_0xb19c('0x14')](function(){return db['User']['findAll']({'attributes':['id',_0xb19c('0x2a'),_0xb19c('0x2b'),_0xb19c('0x3'),'faxPause',_0xb19c('0x2c'),_0xb19c('0x2d'),_0xb19c('0x5'),_0xb19c('0x6'),_0xb19c('0x7'),_0xb19c('0x2e')],'where':{'id':{'$in':_[_0xb19c('0x27')](_0x7b42f5,'id')}},'raw':!![]});})[_0xb19c('0x14')](function(_0xa02709){return _0xa02709['map'](function(_0x36fd64){var _0x2d8eff=_['find'](_0x7b42f5,['id',_0x36fd64['id']]);var _0x546e2e=filterAgentAttributes(_0x2d8eff);_[_0xb19c('0x19')](_0x36fd64,_0x546e2e);_0x36fd64[_0xb19c('0x2f')]=getAgentStatus(_0x36fd64);return _0x36fd64;});})[_0xb19c('0x14')](function(_0x58ea64){var _0x13378a=sortAgentsByStatus(_0x58ea64,_0x1f5720);return _['map'](_0x13378a,'id');})[_0xb19c('0x30')](function(_0x54f1f7){throw _0x54f1f7;});}exports[_0xb19c('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x52226b){var _0x4573be={'fields':[],'order':null};var _0x37c64c=_0x52226b[_0xb19c('0x32')](',');_0x4573be[_0xb19c('0x33')]=_[_0xb19c('0x25')](_0x37c64c,function(_0x17e6dd){if(!_0x17e6dd[_0xb19c('0x26')](_0xb19c('0x2f'))){return!![];}_0x4573be[_0xb19c('0x34')]=_['startsWith'](_0x17e6dd,'-')?_0xb19c('0x35'):_0xb19c('0x36');return![];});return _0x4573be;}exports[_0xb19c('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0x2826fd){if(!_0x2826fd){_0x2826fd=_0xb19c('0x38');}if(_0x2826fd[_0xb19c('0x26')]('fullname')&&!_0x2826fd[_0xb19c('0x26')](_0xb19c('0x39'))){var _0x5bde43=_0x2826fd[_0xb19c('0x3a')](0x0,_0x2826fd['indexOf'](_0xb19c('0x2b')));_0x2826fd+=','+_0x5bde43+_0xb19c('0x39');}return _0x2826fd;}exports[_0xb19c('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x238524,_0x371fb3){var _0x2981b2=_0x238524[_0xb19c('0x3c')](function(_0x49db9e,_0x584a57){if(_0x49db9e[_0xb19c('0x2f')]===_0x584a57['globalStatus']){if(_0x49db9e[_0xb19c('0x2f')]===_0xb19c('0x3d')){if(_0x371fb3===_0xb19c('0x35')){return(_0x49db9e[_0xb19c('0x2e')]||'')<(_0x584a57['pauseType']||'')||_0x49db9e['fullname']['toLowerCase']()>_0x584a57[_0xb19c('0x2b')][_0xb19c('0x3e')]()?0x1:-0x1;}else{return(_0x49db9e[_0xb19c('0x2e')]||'')<(_0x584a57[_0xb19c('0x2e')]||'')||_0x49db9e[_0xb19c('0x2b')][_0xb19c('0x3e')]()>_0x584a57[_0xb19c('0x2b')][_0xb19c('0x3e')]()?-0x1:0x1;}}else{if(_0x371fb3===_0xb19c('0x35')){return _0x49db9e['fullname'][_0xb19c('0x3e')]()<_0x584a57[_0xb19c('0x2b')][_0xb19c('0x3e')]()?0x1:-0x1;}else{return _0x49db9e[_0xb19c('0x2b')][_0xb19c('0x3e')]()<_0x584a57[_0xb19c('0x2b')][_0xb19c('0x3e')]()?-0x1:0x1;}}}else{if(_0x371fb3===_0xb19c('0x35')){return _0x49db9e[_0xb19c('0x2f')]<_0x584a57[_0xb19c('0x2f')]?0x1:-0x1;}else{return _0x49db9e[_0xb19c('0x2f')]<_0x584a57['globalStatus']?-0x1:0x1;}}});return _0x2981b2;}exports[_0xb19c('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x2f5a83){var _0x11b297=[_0xb19c('0x40'),'online','lastLoginAt',_0xb19c('0x41'),_0xb19c('0x2e'),_0xb19c('0x41'),_0xb19c('0x39'),'address',_0xb19c('0x3'),_0xb19c('0x2d'),'mailPause','smsPause',_0xb19c('0x7'),_0xb19c('0x4'),_0xb19c('0x6'),_0xb19c('0x42'),_0xb19c('0x43'),_0xb19c('0x44'),_0xb19c('0x45'),_0xb19c('0x46'),_0xb19c('0x47'),'chatCurrentCapacity','openchannelCurrentCapacity',_0xb19c('0x48'),_0xb19c('0x49'),'whatsappCurrentCapacity',_0xb19c('0x4a'),_0xb19c('0xf'),_0xb19c('0x11'),_0xb19c('0x4b'),_0xb19c('0x12'),_0xb19c('0x4c'),_0xb19c('0x10'),'voiceStatus',_0xb19c('0x4d'),_0xb19c('0x4e'),'mailStatusTime',_0xb19c('0x4f'),'whatsappStatusTime','faxStatusTime','voiceStatusTime',_0xb19c('0x50'),_0xb19c('0x51'),_0xb19c('0x52'),_0xb19c('0x53'),_0xb19c('0x54')];var _0x5f1588=[_0xb19c('0x3'),_0xb19c('0x2d'),_0xb19c('0x2c'),_0xb19c('0x5'),_0xb19c('0x7'),'faxPause',_0xb19c('0x6'),'online'];var _0x60c816=_(_0x2f5a83)['omit'](_0x5f1588)['pick'](_0x11b297)['value']();return _0x60c816;}exports[_0xb19c('0x55')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0xb19c('0x2b'),_0xb19c('0x56'),_0xb19c('0x39'),_0xb19c('0x57'),_0xb19c('0x2f'),'userpic',_0xb19c('0x58'),_0xb19c('0x2e'),'lastPauseAt',_0xb19c('0x4'),_0xb19c('0x3'),_0xb19c('0x2c'),_0xb19c('0x2d'),_0xb19c('0x5'),_0xb19c('0x6'),_0xb19c('0x7'),'chatStatus',_0xb19c('0x10'),_0xb19c('0x4b'),_0xb19c('0x11'),'smsStatus','voiceStatus','whatsappStatus','chatStatusTime',_0xb19c('0x59'),_0xb19c('0x5a'),_0xb19c('0x4e'),_0xb19c('0x4f'),_0xb19c('0x5b'),_0xb19c('0x5c'),_0xb19c('0x42'),_0xb19c('0x47'),_0xb19c('0x44'),'openchannelCapacity',_0xb19c('0x45'),'whatsappCapacity','chatCurrentCapacity','faxCurrentCapacity',_0xb19c('0x48'),_0xb19c('0x5d'),_0xb19c('0x49'),_0xb19c('0x5e'),_0xb19c('0x53'),_0xb19c('0x54'),_0xb19c('0x51'),_0xb19c('0x5f'),_0xb19c('0x50'),_0xb19c('0x52')];}exports[_0xb19c('0x60')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 16bdc80..779b4c9 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 _0x8f61=['erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','getRealtimeQueues','concat','outbound','get','loggedInDb','loggedIn','voice','talking','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringInUse','unavailable','unknown','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x12b893,_0x1ba772){var _0x69e8f7=function(_0x6fcd49){while(--_0x6fcd49){_0x12b893['push'](_0x12b893['shift']());}};_0x69e8f7(++_0x1ba772);}(_0x8f61,0x8d));var _0x18f6=function(_0x2aed8e,_0x108d6c){_0x2aed8e=_0x2aed8e-0x0;var _0x5914b3=_0x8f61[_0x2aed8e];return _0x5914b3;};'use strict';var _=require(_0x18f6('0x0'));var jayson=require(_0x18f6('0x1'));var util=require(_0x18f6('0x2'));var amiClient=jayson[_0x18f6('0x3')][_0x18f6('0x4')]({'port':0x232a});var routingClient=jayson[_0x18f6('0x3')][_0x18f6('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x18f6('0x5'),'loggedIn',_0x18f6('0x6'),_0x18f6('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x18f6('0x8'),_0x18f6('0x9'),_0x18f6('0xa'),'loggedInDb',_0x18f6('0xb'),_0x18f6('0xc'),'ringing',_0x18f6('0xd'),'talking',_0x18f6('0xe'),_0x18f6('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x18f6('0x10'),_0x18f6('0x11'),_0x18f6('0x12'),'statusMessage',_0x18f6('0x13'),_0x18f6('0x14'),_0x18f6('0x15'),_0x18f6('0x16'),_0x18f6('0x17'),_0x18f6('0x18'),_0x18f6('0x19'),_0x18f6('0x1a'),_0x18f6('0x1b'),_0x18f6('0x1c'),_0x18f6('0x1d'),_0x18f6('0x1e'),_0x18f6('0x1f'),_0x18f6('0x20'),'predictiveIntervalAnsweredCalls',_0x18f6('0x21'),_0x18f6('0x22'),_0x18f6('0x23'),_0x18f6('0x24')];function getRealtimeQueues(_0x461f77,_0x5093c9){var _0x1fea97=_0x5093c9==='voice'?amiClient:routingClient;return _0x1fea97[_0x18f6('0x25')](_[_0x18f6('0x26')](_0x5093c9)+_0x18f6('0x27'),_0x461f77)[_0x18f6('0x28')](function(_0x2cda97){if(_0x2cda97[_0x18f6('0x29')])throw new Error(util[_0x18f6('0x2a')](_0x18f6('0x2b'),_0x5093c9));return _0x2cda97['result'];})['catch'](function(_0x66cf7){throw _0x66cf7;});}exports[_0x18f6('0x2c')]=getRealtimeQueues;function initializeQueues(_0x20e4ad,_0x566125,_0x5e35aa,_0x592c09){var _0x21ff50=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5e35aa==='voice'){if(_0x592c09==='inbound'){_0x21ff50=_0x21ff50[_0x18f6('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x592c09===_0x18f6('0x2e')){_0x21ff50=_0x21ff50[_0x18f6('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x20e4ad['map'](function(_0x3eaa4f){var _0x300b56=_0x3eaa4f[_0x18f6('0x2f')]({'plain':!![]});_0x300b56[_0x18f6('0x6')]=0x0;_0x300b56[_0x18f6('0x30')]=0x0;_0x300b56[_0x18f6('0x31')]=0x0;_0x300b56[_0x18f6('0x5')]=0x0;_0x300b56[_0x18f6('0x7')]=0x0;if(_0x5e35aa===_0x18f6('0x32')){_0x300b56[_0x18f6('0x33')]=0x0;_0x300b56[_0x18f6('0x8')]=0x0;if(_0x592c09===_0x18f6('0x2e')){_0x300b56[_0x18f6('0x10')]=0x0;_0x300b56[_0x18f6('0x11')]=0x0;}}var _0x34986a=_[_0x18f6('0x34')](_0x566125,['id',_0x300b56['id']]);if(_0x34986a){_[_0x18f6('0x35')](_0x300b56,_[_0x18f6('0x36')](_0x34986a,_0x21ff50));}return _0x300b56;});}exports[_0x18f6('0x37')]=initializeQueues; \ No newline at end of file +var _0xf411=['http','available','waiting','busy','inUse','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','outbound','concat','map','loggedIn','originated','find','pick','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf411,0x68));var _0x1f41=function(_0x5245bc,_0x55e740){_0x5245bc=_0x5245bc-0x0;var _0x2acb9a=_0xf411[_0x5245bc];return _0x2acb9a;};'use strict';var _=require(_0x1f41('0x0'));var jayson=require('jayson/promise');var util=require(_0x1f41('0x1'));var amiClient=jayson['client'][_0x1f41('0x2')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1f41('0x3'),'loggedIn','paused',_0x1f41('0x4')];var VOICE_QUEUE_ATTRIBUTES=[_0x1f41('0x5'),_0x1f41('0x6'),'invalid',_0x1f41('0x7'),_0x1f41('0x8'),_0x1f41('0x9'),_0x1f41('0xa'),_0x1f41('0xb'),_0x1f41('0xc'),_0x1f41('0xd'),_0x1f41('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1f41('0xf'),'originated','message',_0x1f41('0x10'),_0x1f41('0x11'),_0x1f41('0x12'),_0x1f41('0x13'),_0x1f41('0x14'),_0x1f41('0x15'),_0x1f41('0x16'),_0x1f41('0x17'),_0x1f41('0x18'),_0x1f41('0x19'),_0x1f41('0x1a'),_0x1f41('0x1b'),_0x1f41('0x1c'),_0x1f41('0x1d'),'predictiveIntervalTotalCalls',_0x1f41('0x1e'),_0x1f41('0x1f'),_0x1f41('0x20'),_0x1f41('0x21'),_0x1f41('0x22')];function getRealtimeQueues(_0x79d8b3,_0x157547){var _0xc41900=_0x157547===_0x1f41('0x23')?amiClient:routingClient;return _0xc41900[_0x1f41('0x24')](_[_0x1f41('0x25')](_0x157547)+'Queues',_0x79d8b3)[_0x1f41('0x26')](function(_0xaf0a67){if(_0xaf0a67[_0x1f41('0x27')])throw new Error(util[_0x1f41('0x28')](_0x1f41('0x29'),_0x157547));return _0xaf0a67[_0x1f41('0x2a')];})[_0x1f41('0x2b')](function(_0x1b668c){throw _0x1b668c;});}exports[_0x1f41('0x2c')]=getRealtimeQueues;function initializeQueues(_0x30486d,_0x712351,_0x3f080e,_0x2d918f){var _0x4c7afd=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3f080e===_0x1f41('0x23')){if(_0x2d918f===_0x1f41('0x2d')){_0x4c7afd=_0x4c7afd['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2d918f===_0x1f41('0x2e')){_0x4c7afd=_0x4c7afd[_0x1f41('0x2f')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x30486d[_0x1f41('0x30')](function(_0x98728a){var _0x2bf69a=_0x98728a['get']({'plain':!![]});_0x2bf69a['paused']=0x0;_0x2bf69a[_0x1f41('0x7')]=0x0;_0x2bf69a[_0x1f41('0x31')]=0x0;_0x2bf69a['available']=0x0;_0x2bf69a[_0x1f41('0x4')]=0x0;if(_0x3f080e==='voice'){_0x2bf69a[_0x1f41('0xc')]=0x0;_0x2bf69a[_0x1f41('0x5')]=0x0;if(_0x2d918f==='outbound'){_0x2bf69a[_0x1f41('0xf')]=0x0;_0x2bf69a[_0x1f41('0x32')]=0x0;}}var _0x111068=_[_0x1f41('0x33')](_0x712351,['id',_0x2bf69a['id']]);if(_0x111068){_['merge'](_0x2bf69a,_[_0x1f41('0x34')](_0x111068,_0x4c7afd));}return _0x2bf69a;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 41179de..8e4b937 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(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 4d55474..1787787 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 _0xea8e=['lodash','crypto','child_process','execSync','../environment','networkInterfaces','keys','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','digest','hex','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','substring'];(function(_0x372a2f,_0x533bfd){var _0x291e83=function(_0x4d662d){while(--_0x4d662d){_0x372a2f['push'](_0x372a2f['shift']());}};_0x291e83(++_0x533bfd);}(_0xea8e,0xe7));var _0xeea8=function(_0x1d98da,_0x532964){_0x1d98da=_0x1d98da-0x0;var _0x2a56f2=_0xea8e[_0x1d98da];return _0x2a56f2;};'use strict';var _=require(_0xeea8('0x0'));var os=require('os');var crypto=require(_0xeea8('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xeea8('0x2'))[_0xeea8('0x3')];var config=require(_0xeea8('0x4'));function getInterfaces(){var _0x34f275=[];var _0x393a67=os[_0xeea8('0x5')]();var _0x45937d=_['orderBy'](_[_0xeea8('0x6')](_0x393a67));for(var _0x308667=0x0;_0x308667<_0x45937d['length'];_0x308667++){var _0x2d2f87=_0x393a67[_0x45937d[_0x308667]]['filter'](function(_0x1cb745){return _0x1cb745['family']===_0xeea8('0x7')&&_0x1cb745[_0xeea8('0x8')]===![];});_0x34f275=_0x34f275[_0xeea8('0x9')](_0x2d2f87);}return _0x34f275;}function getFirstInterface(){var _0x160b09=_[_0xeea8('0xa')](getInterfaces());return{'macAddress':_0x160b09&&_0x160b09[_0xeea8('0xb')]?_0x160b09[_0xeea8('0xb')]:'00:00:00:00:00:00','ipAddress':_0x160b09&&_0x160b09[_0xeea8('0xc')]?_0x160b09[_0xeea8('0xc')]:_0xeea8('0xd')};}exports[_0xeea8('0xe')]=getFirstInterface;function getCPUhash(){var _0x56affb=_[_0xeea8('0xf')](os[_0xeea8('0x10')]()[_0xeea8('0x11')](function(_0x2a5135){return _0x2a5135[_0xeea8('0x12')];}))[_0xeea8('0x13')](':');return crypto[_0xeea8('0x14')](_0xeea8('0x15'))[_0xeea8('0x16')](_0x56affb)[_0xeea8('0x17')](_0xeea8('0x18'));}exports['getUuid']=function(){var _0xd38ed6=os['platform']();var _0x59b8dd=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x59b8dd['test'](config[_0xeea8('0x19')])){return config[_0xeea8('0x19')];}else if(_0xd38ed6===_0xeea8('0x1a')){return exec(_0xeea8('0x1b'),{'encoding':_0xeea8('0x1c')})[_0xeea8('0x1d')]('\x0d\x0a','');}else{var _0x466dda=getFirstInterface();var _0x3f94e9=getCPUhash();var _0x58b2ba=_0x3f94e9+'|'+os[_0xeea8('0x1e')]()+'|'+_0x466dda[_0xeea8('0x1f')]+'|'+_0x466dda['ipAddress'];var _0x26ab93=crypto[_0xeea8('0x14')](_0xeea8('0x15'))[_0xeea8('0x16')](_0x58b2ba)[_0xeea8('0x17')]('hex');return _0x26ab93[_0xeea8('0x20')](0x0,0x8)+'-'+_0x26ab93[_0xeea8('0x20')](0x8,0xc)+'-'+_0x26ab93['substring'](0xc,0x10)+'-'+_0x26ab93[_0xeea8('0x20')](0x10,0x14)+'-'+_0x26ab93[_0xeea8('0x20')](0x14);}}; \ No newline at end of file +var _0xa9fc=['hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','length','filter','family','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','map','model','join','createHash','md5','update','digest'];(function(_0x4d0222,_0x11e646){var _0x9ac99c=function(_0x1f0154){while(--_0x1f0154){_0x4d0222['push'](_0x4d0222['shift']());}};_0x9ac99c(++_0x11e646);}(_0xa9fc,0x154));var _0xca9f=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0xa9fc[_0x3725ee];return _0x399c71;};'use strict';var _=require(_0xca9f('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xca9f('0x1'));var exec=require(_0xca9f('0x2'))[_0xca9f('0x3')];var config=require(_0xca9f('0x4'));function getInterfaces(){var _0x547afe=[];var _0x4fe706=os[_0xca9f('0x5')]();var _0x3f6127=_['orderBy'](_['keys'](_0x4fe706));for(var _0x7295f9=0x0;_0x7295f9<_0x3f6127[_0xca9f('0x6')];_0x7295f9++){var _0x2d3035=_0x4fe706[_0x3f6127[_0x7295f9]][_0xca9f('0x7')](function(_0x310650){return _0x310650[_0xca9f('0x8')]===_0xca9f('0x9')&&_0x310650['internal']===![];});_0x547afe=_0x547afe['concat'](_0x2d3035);}return _0x547afe;}function getFirstInterface(){var _0x39a8f6=_[_0xca9f('0xa')](getInterfaces());return{'macAddress':_0x39a8f6&&_0x39a8f6[_0xca9f('0xb')]?_0x39a8f6[_0xca9f('0xb')]:_0xca9f('0xc'),'ipAddress':_0x39a8f6&&_0x39a8f6[_0xca9f('0xd')]?_0x39a8f6[_0xca9f('0xd')]:_0xca9f('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x113b9a=_[_0xca9f('0xf')](os['cpus']()[_0xca9f('0x10')](function(_0x59fee4){return _0x59fee4[_0xca9f('0x11')];}))[_0xca9f('0x12')](':');return crypto[_0xca9f('0x13')](_0xca9f('0x14'))[_0xca9f('0x15')](_0x113b9a)[_0xca9f('0x16')](_0xca9f('0x17'));}exports[_0xca9f('0x18')]=function(){var _0x4d0437=os[_0xca9f('0x19')]();var _0x1ad5d5=/[0-9a-f-]{36}/;if(config[_0xca9f('0x1a')]&&_0x1ad5d5[_0xca9f('0x1b')](config[_0xca9f('0x1a')])){return config[_0xca9f('0x1a')];}else if(_0x4d0437==='win32'){return exec(_0xca9f('0x1c'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x2c7ce5=getFirstInterface();var _0x450c90=getCPUhash();var _0x53f8a4=_0x450c90+'|'+os[_0xca9f('0x1d')]()+'|'+_0x2c7ce5[_0xca9f('0x1e')]+'|'+_0x2c7ce5[_0xca9f('0x1f')];var _0x56035c=crypto[_0xca9f('0x13')](_0xca9f('0x14'))[_0xca9f('0x15')](_0x53f8a4)[_0xca9f('0x16')](_0xca9f('0x17'));return _0x56035c[_0xca9f('0x20')](0x0,0x8)+'-'+_0x56035c[_0xca9f('0x20')](0x8,0xc)+'-'+_0x56035c[_0xca9f('0x20')](0xc,0x10)+'-'+_0x56035c['substring'](0x10,0x14)+'-'+_0x56035c[_0xca9f('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index d54f8a0..20214a4 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 _0xeafd=['message','finally','getUuid','License','findOrCreate','default','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','../logger','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','data1','data2','then','active','license','info','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch'];(function(_0x5bca20,_0x37e530){var _0x40f5f5=function(_0x2b62a5){while(--_0x2b62a5){_0x5bca20['push'](_0x5bca20['shift']());}};_0x40f5f5(++_0x37e530);}(_0xeafd,0x16e));var _0xdeaf=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0xeafd[_0x2405bc];return _0x5272d4;};'use strict';var util=require('util');var moment=require(_0xdeaf('0x0'));var rp=require(_0xdeaf('0x1'));var BPromise=require(_0xdeaf('0x2'));var pkginfo=require(_0xdeaf('0x3'))(module,_0xdeaf('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xdeaf('0x5'));var hardware=require('./hardware');var logger=require(_0xdeaf('0x6'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5df3bc){return new BPromise(function(_0x598915,_0x15883a){var _0x39e391=util[_0xdeaf('0x7')](_0xdeaf('0x8'),HOST,_0x5df3bc,module['exports'][_0xdeaf('0x4')]);if(oldToken){_0x39e391=util['format'](_0xdeaf('0x9'),HOST,_0x5df3bc,module[_0xdeaf('0xa')]['version'],oldToken);}var _0x3c7856={'uri':_0x39e391,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3c7856)['then'](function(_0x3ed674){_0x598915(_0x3ed674);})['catch'](function(_0x245e32){_0x15883a(_0x245e32);});});}function manageLicense(_0x1c5b7d,_0x4e3c2b){var _0x4bcd06=_0x4e3c2b['get']({'plain':!![]});if(!isOldTokenSent&&_0x4bcd06[_0xdeaf('0xb')]!==_0x1c5b7d&&!_0x4bcd06[_0xdeaf('0xc')]){oldToken=_0x4bcd06[_0xdeaf('0xb')];}httpRequest(_0x1c5b7d)[_0xdeaf('0xd')](function(_0x37dce0){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x37dce0[_0xdeaf('0xe')]){isOldTokenSent=![];if(!_0x4bcd06[_0xdeaf('0xf')]&&_0x4bcd06['license']!=_0x37dce0['license']||_0x4bcd06[_0xdeaf('0xf')]&&_0x4bcd06['data2']){logger[_0xdeaf('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4bcd06[_0xdeaf('0xf')]&&!_0x4bcd06['data2']&&_0x4bcd06['license']!=_0x37dce0[_0xdeaf('0xf')]){logger[_0xdeaf('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x4bcd06['license']&&!_0x4bcd06[_0xdeaf('0xc')]&&_0x4bcd06['license']==_0x37dce0['license']){return _0x4e3c2b;}return _0x4e3c2b['update']({'data1':_0x1c5b7d,'data2':null,'license':_0x37dce0[_0xdeaf('0xf')]});}else{if(_0x37dce0[_0xdeaf('0xf')]||_0x4bcd06['license']){if(!_0x4bcd06[_0xdeaf('0xc')]){if(_0x4bcd06['data1']==_0x1c5b7d){GRAY_PERIOD_REASON=_0xdeaf('0x11');logger[_0xdeaf('0x10')](_0xdeaf('0x12'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xdeaf('0x10')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4bcd06['data1'],_0x1c5b7d);}logger[_0xdeaf('0x10')](_0xdeaf('0x13'),GRAY_PERIOD_REASON[_0xdeaf('0x14')](),moment()['format'](_0xdeaf('0x15')));return _0x4e3c2b[_0xdeaf('0x16')]({'data2':encryptor[_0xdeaf('0x17')](moment()['format'](_0xdeaf('0x15')))});}else{if(moment()[_0xdeaf('0x18')](encryptor[_0xdeaf('0x19')](_0x4bcd06[_0xdeaf('0xc')]),_0xdeaf('0x1a'))>DAYS){logger[_0xdeaf('0x10')](_0xdeaf('0x1b'),moment()[_0xdeaf('0x7')](_0xdeaf('0x15')));isOldTokenSent=![];return _0x4e3c2b[_0xdeaf('0x16')]({'data1':_0x1c5b7d,'data2':null,'license':null});}}}else{if(_0x4bcd06[_0xdeaf('0xb')]!=_0x1c5b7d){logger[_0xdeaf('0x10')](_0xdeaf('0x1c'),_0x4bcd06[_0xdeaf('0xb')],_0x1c5b7d);return _0x4e3c2b['update']({'data1':_0x1c5b7d,'data2':null,'license':null});}}}return _0x4e3c2b;})[_0xdeaf('0xd')](function(_0x4a98d1){_0x4e3c2b=_0x4a98d1;})[_0xdeaf('0x1d')](function(_0x23c32f){logger['error'](_0x23c32f[_0xdeaf('0x1e')]);})[_0xdeaf('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0xdeaf('0x20')](),_0x4e3c2b);},TIME);});}function defaultLicense(){var _0x20f5fd=hardware[_0xdeaf('0x20')]();if(_0x20f5fd){return db[_0xdeaf('0x21')][_0xdeaf('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x20f5fd}})['spread'](function(_0x14a452,_0x36f12f){logger[_0xdeaf('0x10')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x20f5fd);manageLicense(_0x20f5fd,_0x14a452);})[_0xdeaf('0x1d')](function(_0x6f4713){logger['error'](_0x6f4713[_0xdeaf('0x1e')]);});}}exports[_0xdeaf('0x23')]=defaultLicense; \ No newline at end of file +var _0x3ec0=['message','finally','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','version','../../components/encryptor','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','data1','data2','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x3ec0,0x165));var _0x03ec=function(_0x44b18a,_0x2c02b2){_0x44b18a=_0x44b18a-0x0;var _0x2088a4=_0x3ec0[_0x44b18a];return _0x2088a4;};'use strict';var util=require(_0x03ec('0x0'));var moment=require(_0x03ec('0x1'));var rp=require(_0x03ec('0x2'));var BPromise=require(_0x03ec('0x3'));var pkginfo=require('pkginfo')(module,_0x03ec('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x03ec('0x5'));var hardware=require('./hardware');var logger=require('../logger')('license');var HOST=_0x03ec('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2de593){return new BPromise(function(_0x27dd7a,_0x5e82ce){var _0x31eeeb=util[_0x03ec('0x7')]('%s/api/servers/%s/check?version=%s',HOST,_0x2de593,module[_0x03ec('0x8')][_0x03ec('0x4')]);if(oldToken){_0x31eeeb=util['format'](_0x03ec('0x9'),HOST,_0x2de593,module[_0x03ec('0x8')][_0x03ec('0x4')],oldToken);}var _0x35c7af={'uri':_0x31eeeb,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x35c7af)[_0x03ec('0xa')](function(_0x134faf){_0x27dd7a(_0x134faf);})[_0x03ec('0xb')](function(_0xedfb8){_0x5e82ce(_0xedfb8);});});}function manageLicense(_0x3111d0,_0x1fbe86){var _0x55e31e=_0x1fbe86['get']({'plain':!![]});if(!isOldTokenSent&&_0x55e31e[_0x03ec('0xc')]!==_0x3111d0&&!_0x55e31e[_0x03ec('0xd')]){oldToken=_0x55e31e[_0x03ec('0xc')];}httpRequest(_0x3111d0)['then'](function(_0x459f27){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x459f27['active']){isOldTokenSent=![];if(!_0x55e31e[_0x03ec('0xe')]&&_0x55e31e['license']!=_0x459f27['license']||_0x55e31e[_0x03ec('0xe')]&&_0x55e31e['data2']){logger['info'](_0x03ec('0xf'));}if(_0x55e31e['license']&&!_0x55e31e['data2']&&_0x55e31e[_0x03ec('0xe')]!=_0x459f27[_0x03ec('0xe')]){logger['info'](_0x03ec('0x10'));}if(_0x55e31e[_0x03ec('0xe')]&&!_0x55e31e['data2']&&_0x55e31e[_0x03ec('0xe')]==_0x459f27[_0x03ec('0xe')]){return _0x1fbe86;}return _0x1fbe86[_0x03ec('0x11')]({'data1':_0x3111d0,'data2':null,'license':_0x459f27[_0x03ec('0xe')]});}else{if(_0x459f27['license']||_0x55e31e[_0x03ec('0xe')]){if(!_0x55e31e[_0x03ec('0xd')]){if(_0x55e31e[_0x03ec('0xc')]==_0x3111d0){GRAY_PERIOD_REASON=_0x03ec('0x12');logger[_0x03ec('0x13')](_0x03ec('0x14'));}else{GRAY_PERIOD_REASON=_0x03ec('0x15');logger[_0x03ec('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x55e31e[_0x03ec('0xc')],_0x3111d0);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x03ec('0x16')](),moment()['format'](_0x03ec('0x17')));return _0x1fbe86[_0x03ec('0x11')]({'data2':encryptor[_0x03ec('0x18')](moment()['format'](_0x03ec('0x17')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x55e31e[_0x03ec('0xd')]),_0x03ec('0x19'))>DAYS){logger[_0x03ec('0x13')](_0x03ec('0x1a'),moment()[_0x03ec('0x7')](_0x03ec('0x17')));isOldTokenSent=![];return _0x1fbe86['update']({'data1':_0x3111d0,'data2':null,'license':null});}}}else{if(_0x55e31e[_0x03ec('0xc')]!=_0x3111d0){logger[_0x03ec('0x13')](_0x03ec('0x1b'),_0x55e31e[_0x03ec('0xc')],_0x3111d0);return _0x1fbe86[_0x03ec('0x11')]({'data1':_0x3111d0,'data2':null,'license':null});}}}return _0x1fbe86;})[_0x03ec('0xa')](function(_0x52aa7d){_0x1fbe86=_0x52aa7d;})[_0x03ec('0xb')](function(_0x105c40){logger['error'](_0x105c40[_0x03ec('0x1c')]);})[_0x03ec('0x1d')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1fbe86);},TIME);});}function defaultLicense(){var _0x594145=hardware['getUuid']();if(_0x594145){return db['License'][_0x03ec('0x1e')]({'where':{'id':0x1},'defaults':{'data1':_0x594145}})[_0x03ec('0x1f')](function(_0x69c8e9,_0x4a4980){logger['info'](_0x03ec('0x20'),_0x594145);manageLicense(_0x594145,_0x69c8e9);})[_0x03ec('0xb')](function(_0x423943){logger[_0x03ec('0x21')](_0x423943[_0x03ec('0x1c')]);});}}exports[_0x03ec('0x22')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 64d394b..6738660 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 _0x8a3b=['days','grayReason','changed','disabled','message','findAll','role','COUNT','sequelize','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','lodash','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','format','parse','machineUuid','gray','deadline','add'];(function(_0x53c0a1,_0x5768ad){var _0xe26c52=function(_0x29232d){while(--_0x29232d){_0x53c0a1['push'](_0x53c0a1['shift']());}};_0xe26c52(++_0x5768ad);}(_0x8a3b,0x1d7));var _0xb8a3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8a3b[_0x297fd3];return _0x2af381;};'use strict';var util=require('util');var _=require(_0xb8a3('0x0'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0xb8a3('0x1'));var encryptor=require(_0xb8a3('0x2'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb8a3('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb8a3('0x4'),'machineUuid':hardware[_0xb8a3('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb8a3('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb8a3('0x6'),'machineUuid':hardware[_0xb8a3('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x238b1d){return new BPromise(function(_0xcdd7e1,_0x29e50e){return db[_0xb8a3('0x7')][_0xb8a3('0x8')](_[_0xb8a3('0x9')](_0x238b1d,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2d8f38){return checkLicense(_0x2d8f38,null);})[_0xb8a3('0xa')](function(_0x16073c){_0xcdd7e1(_0x16073c);return;})[_0xb8a3('0xb')](function(_0x1aed23){_0x29e50e(_0x1aed23);});});}function checkLicense(_0x33e367,_0x69540c){if(!_0x33e367){demoLicense[_0xb8a3('0xc')]=_0x33e367[_0xb8a3('0xd')];return demoLicense;}try{var _0x564533=_0x69540c||_0x33e367[_0xb8a3('0xe')];if(_[_0xb8a3('0xf')](_0x564533)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x32591e=_0x33e367['data1'];var _0x4f5ecf=_0x33e367[_0xb8a3('0x10')];var _0x381b80=_0x32591e[_0xb8a3('0x11')]('-')[0x4];var _0x386516=_0x32591e[_0xb8a3('0x11')]('-')[0x0];var _0x128cbd=encryptor['decryptString'](_0x564533,util[_0xb8a3('0x12')]('%s:%s:%s',_0x381b80,_0x32591e,_0x386516));var _0x3add64=JSON[_0xb8a3('0x13')](_0x128cbd);_0x3add64['demo']=![];_0x3add64['uuid']=_0x32591e;_0x3add64[_0xb8a3('0x14')]=hardware[_0xb8a3('0x5')]();if(_0x4f5ecf){var _0x502bd6=encryptor['decryptString'](_0x4f5ecf);_0x3add64[_0xb8a3('0x15')]=_0x502bd6;_0x3add64[_0xb8a3('0x16')]=moment(_0x502bd6)[_0xb8a3('0x17')](0x7,_0xb8a3('0x18'))['format']();_0x3add64[_0xb8a3('0x19')]=_0x3add64[_0xb8a3('0xc')]!=_0x3add64['machineUuid']?_0xb8a3('0x1a'):_0xb8a3('0x1b');}return _0x3add64;}catch(_0x2b3569){breakingLicense[_0xb8a3('0xc')]=_0x33e367[_0xb8a3('0xd')];breakingLicense['message']=_0x2b3569[_0xb8a3('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3495dc,_0x3892ef){getLicense()['then'](function(_0x10b6c8){return db['User'][_0xb8a3('0x1d')]({'attributes':[_0xb8a3('0x1e'),[db['sequelize']['fn'](_0xb8a3('0x1f'),db[_0xb8a3('0x20')][_0xb8a3('0x21')](_0xb8a3('0x1e'))),_0xb8a3('0x22')]],'group':_0xb8a3('0x1e'),'where':{'role':{'$or':[_0xb8a3('0x23'),_0xb8a3('0x24'),_0xb8a3('0x25')]}},'raw':!![]})[_0xb8a3('0xa')](function(_0x389f80){var _0x4f3924={'user':_0x10b6c8[_0xb8a3('0x26')]||0x0,'telephone':_0x10b6c8[_0xb8a3('0x27')]||0x0};_0x389f80[_0xb8a3('0x28')](function(_0x52650f){var _0x1970b1=_0x52650f['role']===_0xb8a3('0x23')?_0xb8a3('0x24'):_0x52650f['role'];_0x4f3924[_0x1970b1]-=_0x52650f[_0xb8a3('0x22')];if(_0x4f3924[_0x1970b1]<0x0)_0x4f3924[_0x1970b1]=0x0;});_0x3495dc(_0x4f3924);return;});})[_0xb8a3('0xb')](function(_0x214c01){_0x3892ef(_0x214c01);});});}function checkUserLimits(_0x151215){return new BPromise(function(_0x32e2f9,_0x351110){getLimits()['then'](function(_0x5092ef){var _0x53e8f6=_[_0xb8a3('0x29')](_[_0xb8a3('0x2a')](_0x151215,_0xb8a3('0x1e')),['admin',_0xb8a3('0x24'),_0xb8a3('0x25')]);var _0x3fe66a=(_0x53e8f6[_0xb8a3('0x23')]||0x0)+(_0x53e8f6[_0xb8a3('0x24')]||0x0);var _0x219c16=_0x53e8f6['telephone']||0x0;if(_0x3fe66a>_0x5092ef['user'])return _0x351110(_0xb8a3('0x2b'));if(_0x219c16>_0x5092ef['telephone'])return _0x351110(_0xb8a3('0x2c'));return _0x32e2f9();})[_0xb8a3('0xb')](function(_0x2dfeb1){_0x351110(_0x2dfeb1);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x7a8d=['data2','decryptString','format','%s:%s:%s','parse','demo','uuid','deadline','days','machineUuid','changed','disabled','message','role','sequelize','COUNT','col','count','admin','telephone','users','telephones','forEach','user','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','find','then','data1','license','isEmpty','License\x20key\x20value\x20not\x20found'];(function(_0x42afde,_0x377195){var _0x5e9990=function(_0x157ea9){while(--_0x157ea9){_0x42afde['push'](_0x42afde['shift']());}};_0x5e9990(++_0x377195);}(_0x7a8d,0x17e));var _0xd7a8=function(_0x36bfc7,_0xc2841){_0x36bfc7=_0x36bfc7-0x0;var _0x26264c=_0x7a8d[_0x36bfc7];return _0x26264c;};'use strict';var util=require(_0xd7a8('0x0'));var _=require(_0xd7a8('0x1'));var moment=require(_0xd7a8('0x2'));var BPromise=require('bluebird');var hardware=require(_0xd7a8('0x3'));var encryptor=require(_0xd7a8('0x4'));var db=require(_0xd7a8('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd7a8('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xd7a8('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x57c858){return new BPromise(function(_0x1607fc,_0x3bd10e){return db['License'][_0xd7a8('0x8')](_['defaults'](_0x57c858,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3d3ad5){return checkLicense(_0x3d3ad5,null);})[_0xd7a8('0x9')](function(_0xd46b4d){_0x1607fc(_0xd46b4d);return;})['catch'](function(_0x7ee5f){_0x3bd10e(_0x7ee5f);});});}function checkLicense(_0xcdd011,_0x2eac2b){if(!_0xcdd011){demoLicense['uuid']=_0xcdd011[_0xd7a8('0xa')];return demoLicense;}try{var _0x472bc0=_0x2eac2b||_0xcdd011[_0xd7a8('0xb')];if(_[_0xd7a8('0xc')](_0x472bc0)){throw new Error(_0xd7a8('0xd'));}var _0x4ef631=_0xcdd011[_0xd7a8('0xa')];var _0x3cc1c7=_0xcdd011[_0xd7a8('0xe')];var _0x5e2922=_0x4ef631['split']('-')[0x4];var _0x1996be=_0x4ef631['split']('-')[0x0];var _0x558c27=encryptor[_0xd7a8('0xf')](_0x472bc0,util[_0xd7a8('0x10')](_0xd7a8('0x11'),_0x5e2922,_0x4ef631,_0x1996be));var _0x22bce3=JSON[_0xd7a8('0x12')](_0x558c27);_0x22bce3[_0xd7a8('0x13')]=![];_0x22bce3[_0xd7a8('0x14')]=_0x4ef631;_0x22bce3['machineUuid']=hardware[_0xd7a8('0x7')]();if(_0x3cc1c7){var _0xa09b5a=encryptor[_0xd7a8('0xf')](_0x3cc1c7);_0x22bce3['gray']=_0xa09b5a;_0x22bce3[_0xd7a8('0x15')]=moment(_0xa09b5a)['add'](0x7,_0xd7a8('0x16'))['format']();_0x22bce3['grayReason']=_0x22bce3[_0xd7a8('0x14')]!=_0x22bce3[_0xd7a8('0x17')]?_0xd7a8('0x18'):_0xd7a8('0x19');}return _0x22bce3;}catch(_0x1c1d56){breakingLicense[_0xd7a8('0x14')]=_0xcdd011[_0xd7a8('0xa')];breakingLicense[_0xd7a8('0x1a')]=_0x1c1d56[_0xd7a8('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1354df,_0x8c5ae9){getLicense()[_0xd7a8('0x9')](function(_0x5c44cd){return db['User']['findAll']({'attributes':[_0xd7a8('0x1b'),[db[_0xd7a8('0x1c')]['fn'](_0xd7a8('0x1d'),db['sequelize'][_0xd7a8('0x1e')](_0xd7a8('0x1b'))),_0xd7a8('0x1f')]],'group':_0xd7a8('0x1b'),'where':{'role':{'$or':[_0xd7a8('0x20'),'user',_0xd7a8('0x21')]}},'raw':!![]})[_0xd7a8('0x9')](function(_0x59f51e){var _0x182fb8={'user':_0x5c44cd[_0xd7a8('0x22')]||0x0,'telephone':_0x5c44cd[_0xd7a8('0x23')]||0x0};_0x59f51e[_0xd7a8('0x24')](function(_0x42663b){var _0x2e0929=_0x42663b[_0xd7a8('0x1b')]==='admin'?_0xd7a8('0x25'):_0x42663b[_0xd7a8('0x1b')];_0x182fb8[_0x2e0929]-=_0x42663b[_0xd7a8('0x1f')];if(_0x182fb8[_0x2e0929]<0x0)_0x182fb8[_0x2e0929]=0x0;});_0x1354df(_0x182fb8);return;});})[_0xd7a8('0x26')](function(_0x5a8862){_0x8c5ae9(_0x5a8862);});});}function checkUserLimits(_0x218388){return new BPromise(function(_0x1d7829,_0x580d27){getLimits()[_0xd7a8('0x9')](function(_0x1751fb){var _0x3b1ffa=_[_0xd7a8('0x27')](_[_0xd7a8('0x28')](_0x218388,_0xd7a8('0x1b')),[_0xd7a8('0x20'),_0xd7a8('0x25'),_0xd7a8('0x21')]);var _0x4c9a55=(_0x3b1ffa[_0xd7a8('0x20')]||0x0)+(_0x3b1ffa[_0xd7a8('0x25')]||0x0);var _0x46dafe=_0x3b1ffa['telephone']||0x0;if(_0x4c9a55>_0x1751fb[_0xd7a8('0x25')])return _0x580d27(_0xd7a8('0x29'));if(_0x46dafe>_0x1751fb['telephone'])return _0x580d27(_0xd7a8('0x2a'));return _0x1d7829();})[_0xd7a8('0x26')](function(_0x5e8266){_0x580d27(_0x5e8266);});});}module[_0xd7a8('0x2b')]={'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 ab46421..7a27cda 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 _0x8f4c=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x549efc,_0x5d035a){var _0x4b6c2d=function(_0x29a4f1){while(--_0x29a4f1){_0x549efc['push'](_0x549efc['shift']());}};_0x4b6c2d(++_0x5d035a);}(_0x8f4c,0x113));var _0xc8f4=function(_0xf17786,_0x22bf88){_0xf17786=_0xf17786-0x0;var _0x7d3eb1=_0x8f4c[_0xf17786];return _0x7d3eb1;};'use strict';module[_0xc8f4('0x0')]={'DOMAIN':_0xc8f4('0x1'),'SESSION_SECRET':_0xc8f4('0x2'),'GOOGLE_ID':_0xc8f4('0x3'),'GOOGLE_SECRET':_0xc8f4('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xfcbb=['http://localhost:9000','myappanuglar-secret','exports'];(function(_0x4c5258,_0x3afb0f){var _0x3055db=function(_0x3edca1){while(--_0x3edca1){_0x4c5258['push'](_0x4c5258['shift']());}};_0x3055db(++_0x3afb0f);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x41f54b,_0x2b1411){_0x41f54b=_0x41f54b-0x0;var _0xec31e9=_0xfcbb[_0x41f54b];return _0xec31e9;};'use strict';module[_0xbfcb('0x0')]={'DOMAIN':_0xbfcb('0x1'),'SESSION_SECRET':_0xbfcb('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index a67997b..2370c96 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4601=['fileLogger'];(function(_0x5ca651,_0x1724a1){var _0x1aee54=function(_0x27489e){while(--_0x27489e){_0x5ca651['push'](_0x5ca651['shift']());}};_0x1aee54(++_0x1724a1);}(_0x4601,0x82));var _0x1460=function(_0x4fc99f,_0x3ac99c){_0x4fc99f=_0x4fc99f-0x0;var _0x1bc92d=_0x4601[_0x4fc99f];return _0x1bc92d;};'use strict';var fileLogger=require('../utils/loggers')[_0x1460('0x0')];module['exports']=fileLogger; \ No newline at end of file +var _0x4c42=['fileLogger','exports','../utils/loggers'];(function(_0x336769,_0x48670a){var _0x4bcde5=function(_0x1bf2d9){while(--_0x1bf2d9){_0x336769['push'](_0x336769['shift']());}};_0x4bcde5(++_0x48670a);}(_0x4c42,0x10a));var _0x24c4=function(_0x2ede73,_0x1057aa){_0x2ede73=_0x2ede73-0x0;var _0x2a0932=_0x4c42[_0x2ede73];return _0x2a0932;};'use strict';var fileLogger=require(_0x24c4('0x0'))[_0x24c4('0x1')];module[_0x24c4('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 836991f..6fc09d9 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 _0xb548=['../../services/express/index.js','ami','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','resolve','join','root','express'];(function(_0x56470f,_0x3cbafa){var _0x1be7bc=function(_0x558567){while(--_0x558567){_0x56470f['push'](_0x56470f['shift']());}};_0x1be7bc(++_0x3cbafa);}(_0xb548,0x121));var _0x8b54=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xb548[_0x2aa0e7];return _0x1472c0;};'use strict';var path=require(_0x8b54('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x8b54('0x1')](path[_0x8b54('0x2')](cfg[_0x8b54('0x3')],'legacy-libs'))};var pm2config={'apps':[{'name':_0x8b54('0x4'),'script':path[_0x8b54('0x2')](__dirname,_0x8b54('0x5')),'env':env},{'name':_0x8b54('0x6'),'script':path[_0x8b54('0x2')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x8b54('0x7'),'script':path['join'](__dirname,_0x8b54('0x8')),'env':env},{'name':_0x8b54('0x9'),'script':path[_0x8b54('0x2')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x8b54('0xa'),'script':path[_0x8b54('0x2')](__dirname,_0x8b54('0xb')),'env':env},{'name':_0x8b54('0xc'),'script':path['join'](__dirname,_0x8b54('0xd')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x4eef=['../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','root','legacy-libs','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0xd9543,_0xa5f6cb){var _0x3ef7e0=function(_0x221ee6){while(--_0x221ee6){_0xd9543['push'](_0xd9543['shift']());}};_0x3ef7e0(++_0xa5f6cb);}(_0x4eef,0x172));var _0xf4ee=function(_0xcdaf32,_0x45a0f2){_0xcdaf32=_0xcdaf32-0x0;var _0x4a2e89=_0x4eef[_0xcdaf32];return _0x4a2e89;};'use strict';var path=require(_0xf4ee('0x0'));var cfg=require(_0xf4ee('0x1'));var env={'NODE_PATH':path[_0xf4ee('0x2')](path[_0xf4ee('0x3')](cfg[_0xf4ee('0x4')],_0xf4ee('0x5')))};var pm2config={'apps':[{'name':'express','script':path['join'](__dirname,_0xf4ee('0x6')),'env':env},{'name':_0xf4ee('0x7'),'script':path['join'](__dirname,_0xf4ee('0x8')),'env':env},{'name':_0xf4ee('0x9'),'script':path[_0xf4ee('0x3')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0xf4ee('0xa'),'script':path[_0xf4ee('0x3')](__dirname,_0xf4ee('0xb')),'env':env},{'name':_0xf4ee('0xc'),'script':path[_0xf4ee('0x3')](__dirname,_0xf4ee('0xd')),'env':env},{'name':'xdr','script':path[_0xf4ee('0x3')](__dirname,_0xf4ee('0xe')),'env':env}]};module[_0xf4ee('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 9547674..fdbc6de 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 _0x4709=['disconnect','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then','stop','restart','list','describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4709,0x1e4));var _0x9470=function(_0x215250,_0x584168){_0x215250=_0x215250-0x0;var _0x22777b=_0x4709[_0x215250];return _0x22777b;};'use strict';var pm2=require(_0x9470('0x0'));var BPromise=require(_0x9470('0x1'));var config=require(_0x9470('0x2'));function connect(){return new BPromise(function(_0x2bd406,_0x10cb25){return pm2[_0x9470('0x3')](function(_0x250eb7){if(_0x250eb7){return _0x10cb25(_0x250eb7);}return _0x2bd406(_0x9470('0x4'));});});};exports[_0x9470('0x5')]=function(_0x5b0d79){return connect()[_0x9470('0x6')](function(){return new BPromise(function(_0x2bffd0,_0x384058){return pm2[_0x9470('0x5')](_0x5b0d79,function(_0x36f1a3,_0x521870){if(_0x36f1a3){return _0x384058(_0x36f1a3);}pm2['disconnect']();return _0x2bffd0(_0x521870);});});});};exports[_0x9470('0x7')]=function(_0x5552dc){return connect()[_0x9470('0x6')](function(){return new BPromise(function(_0x2a83a0,_0x3480b1){return pm2[_0x9470('0x7')](_0x5552dc,function(_0x3d7909,_0x5b77a9){if(_0x3d7909){return _0x3480b1(_0x3d7909);}pm2['disconnect']();return _0x2a83a0(_0x5b77a9);});});});};exports['restart']=function(_0x5e7e9a){return connect()[_0x9470('0x6')](function(){return new BPromise(function(_0x40a59e,_0x2494bb){return pm2[_0x9470('0x8')](_0x5e7e9a,function(_0x553553,_0x20ad8a){if(_0x553553){return _0x2494bb(_0x553553);}pm2['disconnect']();return _0x40a59e(_0x20ad8a);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x465b43,_0x1f5d2e){return pm2[_0x9470('0x9')](function(_0x2bef79,_0x23cf4c){if(_0x2bef79){return _0x1f5d2e(_0x2bef79);}pm2['disconnect']();return _0x465b43(_0x23cf4c);});});});};exports[_0x9470('0xa')]=function(_0x13708c){return connect()[_0x9470('0x6')](function(){return new BPromise(function(_0x5bc960,_0x50b131){return pm2['describe'](_0x13708c,function(_0x4db27e,_0x29d5c4){if(_0x4db27e){return _0x50b131(_0x4db27e);}pm2[_0x9470('0xb')]();return _0x5bc960(_0x29d5c4);});});});};exports[_0x9470('0xc')]=function(_0xfd215b){return connect()['then'](function(){return new BPromise(function(_0x2acd81,_0xd6f40c){return pm2['delete'](_0xfd215b,function(_0x50733c,_0x63f12b){if(_0x50733c){return _0xd6f40c(_0x50733c);}pm2[_0x9470('0xb')]();return _0x2acd81(_0x63f12b);});});});};exports['dump']=function(){return connect()[_0x9470('0x6')](function(){return new BPromise(function(_0x7414ba,_0x3abc4f){return pm2[_0x9470('0xd')](function(_0x349473){if(_0x349473){return _0x3abc4f(_0x349473);}return _0x7414ba(_0x9470('0xe'));});});});}; \ No newline at end of file +var _0x0586=['dump','pm2','bluebird','./config','connect','connected','start','stop','disconnect','then','restart','list','describe','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0586,0x15f));var _0x6058=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0586[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0x6058('0x0'));var BPromise=require(_0x6058('0x1'));var config=require(_0x6058('0x2'));function connect(){return new BPromise(function(_0x3c4504,_0x5936ed){return pm2[_0x6058('0x3')](function(_0x3d3fb8){if(_0x3d3fb8){return _0x5936ed(_0x3d3fb8);}return _0x3c4504(_0x6058('0x4'));});});};exports['start']=function(_0x2014c7){return connect()['then'](function(){return new BPromise(function(_0x50baf7,_0x5391da){return pm2[_0x6058('0x5')](_0x2014c7,function(_0x5f214f,_0x4ce159){if(_0x5f214f){return _0x5391da(_0x5f214f);}pm2['disconnect']();return _0x50baf7(_0x4ce159);});});});};exports[_0x6058('0x6')]=function(_0x328538){return connect()['then'](function(){return new BPromise(function(_0x48111a,_0x40549f){return pm2[_0x6058('0x6')](_0x328538,function(_0x2ea7d2,_0x4bea85){if(_0x2ea7d2){return _0x40549f(_0x2ea7d2);}pm2[_0x6058('0x7')]();return _0x48111a(_0x4bea85);});});});};exports['restart']=function(_0xf84c31){return connect()[_0x6058('0x8')](function(){return new BPromise(function(_0xc3c0b6,_0x377948){return pm2[_0x6058('0x9')](_0xf84c31,function(_0x18d9b1,_0x3c6073){if(_0x18d9b1){return _0x377948(_0x18d9b1);}pm2[_0x6058('0x7')]();return _0xc3c0b6(_0x3c6073);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x329404,_0x5d9aa9){return pm2[_0x6058('0xa')](function(_0x25d180,_0x47b5a7){if(_0x25d180){return _0x5d9aa9(_0x25d180);}pm2[_0x6058('0x7')]();return _0x329404(_0x47b5a7);});});});};exports[_0x6058('0xb')]=function(_0x254f94){return connect()[_0x6058('0x8')](function(){return new BPromise(function(_0x301593,_0x3077d8){return pm2[_0x6058('0xb')](_0x254f94,function(_0x57ae98,_0x1b2a98){if(_0x57ae98){return _0x3077d8(_0x57ae98);}pm2['disconnect']();return _0x301593(_0x1b2a98);});});});};exports[_0x6058('0xc')]=function(_0x14335b){return connect()[_0x6058('0x8')](function(){return new BPromise(function(_0x5b138a,_0x2de85e){return pm2['delete'](_0x14335b,function(_0xba2f9c,_0x505c53){if(_0xba2f9c){return _0x2de85e(_0xba2f9c);}pm2[_0x6058('0x7')]();return _0x5b138a(_0x505c53);});});});};exports[_0x6058('0xd')]=function(){return connect()[_0x6058('0x8')](function(){return new BPromise(function(_0x188adc,_0x30bec3){return pm2['dump'](function(_0x5222e0){if(_0x5222e0){return _0x30bec3(_0x5222e0);}return _0x188adc('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 341108f..218dbb6 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 _0x30c1=['minutes','then','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','lastMsgAt','subtract'];(function(_0x1b5f7a,_0x281348){var _0x205dd7=function(_0x331712){while(--_0x331712){_0x1b5f7a['push'](_0x1b5f7a['shift']());}};_0x205dd7(++_0x281348);}(_0x30c1,0x1e9));var _0x130c=function(_0x1c0460,_0x30fbcc){_0x1c0460=_0x1c0460-0x0;var _0x237424=_0x30c1[_0x1c0460];return _0x237424;};'use strict';var _=require(_0x130c('0x0'));var moment=require(_0x130c('0x1'));var Redis=require(_0x130c('0x2'));var util=require(_0x130c('0x3'));var config=require(_0x130c('0x4'));var db=require(_0x130c('0x5'))['db'];var logger=require('../logger')(_0x130c('0x6'));config['redis']=_[_0x130c('0x7')](config['redis'],{'host':_0x130c('0x8'),'port':0x18eb});var io=require(_0x130c('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x24f0ab=0x0;var _0x4d80f2=[];return db['Setting'][_0x130c('0xa')]({'raw':!![],'attributes':['id',_0x130c('0xb')],'where':{'id':0x1}})['then'](function(_0x2775cc){_0x24f0ab=_0x2775cc[_0x130c('0xb')];if(_0x24f0ab){return db[_0x130c('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x130c('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x130c('0xe')](_0x2775cc['chatTimeout'],_0x130c('0xf'))}}});}else{return[];}})[_0x130c('0x10')](function(_0x290f9a){if(_0x290f9a&&_0x290f9a['length']){_0x4d80f2=_['map'](_0x290f9a||[],'id');logger[_0x130c('0x11')](_0x130c('0x12'),_0x4d80f2[_0x130c('0x13')]());return db['ChatInteraction'][_0x130c('0x14')]({'closeReason':_0x130c('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x130c('0x16'))},{'where':{'id':_0x4d80f2}});}})[_0x130c('0x10')](function(){if(_0x4d80f2&&_0x4d80f2[_0x130c('0x17')]){logger[_0x130c('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4d80f2[_0x130c('0x13')]());for(var _0x1d84c9=0x0;_0x1d84c9<_0x4d80f2['length'];_0x1d84c9++){io[_0x130c('0x18')](_0x130c('0x19'),{'id':_0x4d80f2[_0x1d84c9],'closed':!![]});}}})[_0x130c('0x1a')](function(_0x399d1e){logger[_0x130c('0x1b')]('[CHAT]\x20Error\x20closing\x20interactions',_0x399d1e?util['inspect'](_0x399d1e,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa1d0=['localhost','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','schedule','redis','defaults'];(function(_0x4cbf1a,_0x537bf1){var _0x4d6087=function(_0x2cf64d){while(--_0x2cf64d){_0x4cbf1a['push'](_0x4cbf1a['shift']());}};_0x4d6087(++_0x537bf1);}(_0xa1d0,0xe0));var _0x0a1d=function(_0x54df0d,_0x44e2d3){_0x54df0d=_0x54df0d-0x0;var _0x1d4ceb=_0xa1d0[_0x54df0d];return _0x1d4ceb;};'use strict';var _=require(_0x0a1d('0x0'));var moment=require('moment');var Redis=require(_0x0a1d('0x1'));var util=require(_0x0a1d('0x2'));var config=require(_0x0a1d('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x0a1d('0x4'));config[_0x0a1d('0x5')]=_[_0x0a1d('0x6')](config[_0x0a1d('0x5')],{'host':_0x0a1d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x32ac75=0x0;var _0x4d5c2a=[];return db['Setting'][_0x0a1d('0x8')]({'raw':!![],'attributes':['id',_0x0a1d('0x9')],'where':{'id':0x1}})[_0x0a1d('0xa')](function(_0x1575cc){_0x32ac75=_0x1575cc[_0x0a1d('0x9')];if(_0x32ac75){return db[_0x0a1d('0xb')][_0x0a1d('0xc')]({'raw':!![],'attributes':['id',_0x0a1d('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0a1d('0xe')](_0x1575cc[_0x0a1d('0x9')],_0x0a1d('0xf'))}}});}else{return[];}})[_0x0a1d('0xa')](function(_0x178f4e){if(_0x178f4e&&_0x178f4e[_0x0a1d('0x10')]){_0x4d5c2a=_[_0x0a1d('0x11')](_0x178f4e||[],'id');logger[_0x0a1d('0x12')](_0x0a1d('0x13'),_0x4d5c2a['join']());return db[_0x0a1d('0xb')][_0x0a1d('0x14')]({'closeReason':_0x0a1d('0x15'),'disposition':_0x0a1d('0x16'),'closed':!![],'closedAt':moment()[_0x0a1d('0x17')](_0x0a1d('0x18'))},{'where':{'id':_0x4d5c2a}});}})[_0x0a1d('0xa')](function(){if(_0x4d5c2a&&_0x4d5c2a[_0x0a1d('0x10')]){logger[_0x0a1d('0x12')](_0x0a1d('0x19'),_0x4d5c2a[_0x0a1d('0x1a')]());for(var _0x5a4a01=0x0;_0x5a4a01<_0x4d5c2a[_0x0a1d('0x10')];_0x5a4a01++){io[_0x0a1d('0x1b')](_0x0a1d('0x1c'),{'id':_0x4d5c2a[_0x5a4a01],'closed':!![]});}}})[_0x0a1d('0x1d')](function(_0xa94be0){logger[_0x0a1d('0x1e')]('[CHAT]\x20Error\x20closing\x20interactions',_0xa94be0?util[_0x0a1d('0x1f')](_0xa94be0,{'showHidden':![],'depth':null}):'');});}exports[_0x0a1d('0x20')]=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 7698e5a..b509804 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 _0xf05e=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf05e,0xe2));var _0xef05=function(_0x44565e,_0x19e34){_0x44565e=_0x44565e-0x0;var _0x583604=_0xf05e[_0x44565e];return _0x583604;};'use strict';function start(){var _0x3995b4=require(_0xef05('0x0'));return _0x3995b4[_0xef05('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x0b44=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x2b8445,_0x9ebd55){var _0x321d21=function(_0xad1782){while(--_0xad1782){_0x2b8445['push'](_0x2b8445['shift']());}};_0x321d21(++_0x9ebd55);}(_0x0b44,0x116));var _0x40b4=function(_0x18f62a,_0x294c09){_0x18f62a=_0x18f62a-0x0;var _0x26ece9=_0x0b44[_0x18f62a];return _0x26ece9;};'use strict';function start(){var _0x8152ec=require(_0x40b4('0x0'));return _0x8152ec[_0x40b4('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index ed6ccf0..66be614 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 _0x3a6f=['../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','message','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','Empty','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','Loading','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Failed','error','SendMail','error\x20mail','email\x20sent','case\x20loading','currentAttempt','retryOptions','retries','job','data','operation','still\x20loading','stop','case\x20empty','case\x20failed','entity','attempt','Job\x20ID\x20','dataValues','sendMail','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','toString','difference','length','deleteJob','delete\x20cron','resolve','run\x20job','cron','active','startAt','endAt','start','exists','stop\x20cron','update','update\x20cron','util','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','retry','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','number','AnalyticExtractedReport','findOne','then','catch','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','join'];(function(_0x2ce38b,_0x29cb69){var _0x7f9db=function(_0x33b613){while(--_0x33b613){_0x2ce38b['push'](_0x2ce38b['shift']());}};_0x7f9db(++_0x29cb69);}(_0x3a6f,0x180));var _0xf3a6=function(_0x3ef47d,_0x376369){_0x3ef47d=_0x3ef47d-0x0;var _0xef9333=_0x3a6f[_0x3ef47d];return _0xef9333;};'use strict';var fs=require('fs');var util=require(_0xf3a6('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0xf3a6('0x1'));var CronJobManager=require(_0xf3a6('0x2'));var jayson=require(_0xf3a6('0x3'));var BPromise=require(_0xf3a6('0x4'));var logger=require(_0xf3a6('0x5'))(_0xf3a6('0x6'));var db=require(_0xf3a6('0x7'))['db'];const retry=require(_0xf3a6('0x8'));var analyticCustomReportController=require(_0xf3a6('0x9'));var analyticDefaultReportController=require(_0xf3a6('0xa'));var client=jayson[_0xf3a6('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x2859d1){const _0x1b6ff1={};if(typeof _0x2859d1===_0xf3a6('0xc')){_0x1b6ff1['id']=_0x2859d1;}return db[_0xf3a6('0xd')][_0xf3a6('0xe')]({'where':_0x1b6ff1})[_0xf3a6('0xf')](function(_0x4fd038){return _0x4fd038;})[_0xf3a6('0x10')](function(_0x5f25da){logger['error'](_0x5f25da);});}function handleSendEmail(_0x2d8d18,_0x42ce69){logger[_0xf3a6('0x11')](_0xf3a6('0x12'),_0x2d8d18[_0xf3a6('0x13')]);var _0x5e75d5=!![];var _0x4368b8=_0x2d8d18[_0xf3a6('0x14')]['getSmtpOptions']();var _0x5c664d={'account':_0x4368b8,'message':{'from':util[_0xf3a6('0x15')](_0xf3a6('0x16'),_0x2d8d18['MailAccount'][_0xf3a6('0x17')],_0x2d8d18[_0xf3a6('0x14')]['email']||_0x2d8d18[_0xf3a6('0x14')]['Smtp'][_0xf3a6('0x18')]),'to':_0x2d8d18[_0xf3a6('0x13')],'cc':_0x2d8d18['cc'],'bcc':_0x2d8d18[_0xf3a6('0x19')],'subject':util[_0xf3a6('0x15')](_0xf3a6('0x1a'),_0x42ce69[_0xf3a6('0x17')],_0x2d8d18['subtractNumber'],_0x2d8d18['subtractUnit'])}};var _0x56c2de=path[_0xf3a6('0x1b')](__dirname,_0xf3a6('0x1c'));var _0x1b295d=_0x42ce69['savename'];var _0x5ad5e1=util['format'](_0xf3a6('0x1d'),path[_0xf3a6('0x1e')](_0x42ce69[_0xf3a6('0x1f')],path[_0xf3a6('0x20')](_0x42ce69[_0xf3a6('0x1f')])),_0xf3a6('0x21'));var _0x156da4=path[_0xf3a6('0x1b')](_0x56c2de,_0x1b295d);var _0x33edc8=path[_0xf3a6('0x1b')](_0x56c2de,_0x5ad5e1);if(fs[_0xf3a6('0x22')](_0x156da4)){_0x42ce69[_0xf3a6('0x23')]=_0xf3a6('0x24');_0x5c664d[_0xf3a6('0x25')][_0xf3a6('0x26')]=[{'filename':_0x1b295d,'path':_0x156da4}];_0x5c664d['message'][_0xf3a6('0x27')]=util[_0xf3a6('0x15')](_0xf3a6('0x28'),JSON[_0xf3a6('0x29')](_0x42ce69,null,0x2));}else if(fs[_0xf3a6('0x22')](_0x33edc8)){_0x42ce69[_0xf3a6('0x23')]=_0xf3a6('0x24');_0x5c664d[_0xf3a6('0x25')][_0xf3a6('0x26')]=[{'filename':_0x5ad5e1,'path':_0x33edc8}];}else{if(_0x42ce69['status']===_0xf3a6('0x2a')){_0x5c664d[_0xf3a6('0x25')]['text']=_0xf3a6('0x2b');if(!_0x2d8d18[_0xf3a6('0x2c')]){_0x5e75d5=![];logger['info'](_0xf3a6('0x2d'));}}else if(_0x42ce69[_0xf3a6('0x23')]===_0xf3a6('0x2e')){_0x5c664d[_0xf3a6('0x25')][_0xf3a6('0x27')]=_0xf3a6('0x2f');}else if(_0x42ce69[_0xf3a6('0x23')]===_0xf3a6('0x30')){_0x5c664d[_0xf3a6('0x25')][_0xf3a6('0x27')]=_0xf3a6('0x31');}else if(_0x42ce69[_0xf3a6('0x23')]===_0xf3a6('0x32')){_0x5c664d[_0xf3a6('0x25')]['text']='Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else{logger[_0xf3a6('0x33')]('[handleSendEmail]\x20Unrecognized\x20status:',_0x42ce69[_0xf3a6('0x23')]);}}if(_0x5e75d5){return client['request'](_0xf3a6('0x34'),_0x5c664d)[_0xf3a6('0xf')](function(_0x161c19){if(_0x161c19[_0xf3a6('0x33')]){return logger[_0xf3a6('0x33')](_0xf3a6('0x35'),JSON[_0xf3a6('0x29')](_0x161c19));}return logger[_0xf3a6('0x11')](_0xf3a6('0x36'));})['catch'](function(_0x377142){return logger['error'](_0xf3a6('0x35'),JSON['stringify'](_0x377142));});}}function handleError(){return function(_0x7468e9){return logger[_0xf3a6('0x33')](JSON[_0xf3a6('0x29')](_0x7468e9));};}function loading(_0x453afe){logger[_0xf3a6('0x11')](_0xf3a6('0x37'));if(_0x453afe[_0xf3a6('0x38')]===_0x453afe[_0xf3a6('0x39')][_0xf3a6('0x3a')]){handleSendEmail(_0x453afe[_0xf3a6('0x3b')],_0x453afe[_0xf3a6('0x3c')]);_0x453afe[_0xf3a6('0x3d')]['stop']();}else{_0x453afe[_0xf3a6('0x3d')][_0xf3a6('0x8')](_0xf3a6('0x3e'));}}function completed(_0x152b9d){logger['info']('case\x20completed');handleSendEmail(_0x152b9d['job'],_0x152b9d['data']);_0x152b9d[_0xf3a6('0x3d')][_0xf3a6('0x3f')]();}function empty(_0x36d67b){logger['info'](_0xf3a6('0x40'));handleSendEmail(_0x36d67b['job'],_0x36d67b[_0xf3a6('0x3c')]);_0x36d67b[_0xf3a6('0x3d')][_0xf3a6('0x3f')]();}function failed(_0x3872a3){logger['info'](_0xf3a6('0x41'));handleSendEmail(_0x3872a3[_0xf3a6('0x3b')],_0x3872a3['data']);_0x3872a3[_0xf3a6('0x3d')][_0xf3a6('0x3f')]();}function urecognized(_0x481913){logger['error']('Unrecognized\x20status:',_0x481913[_0xf3a6('0x42')]['dataValues'][_0xf3a6('0x23')]);_0x481913['operation'][_0xf3a6('0x3f')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x1caa1b,_0x32e9f9){const _0x3a09e9={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0x28c962=retry[_0xf3a6('0x3d')](_0x3a09e9);_0x28c962[_0xf3a6('0x43')](_0x4f78e6=>{logger[_0xf3a6('0x11')](_0xf3a6('0x44')+_0x1caa1b['id']+'\x20Attempt\x20#:'+_0x4f78e6);try{getReportData(_0x32e9f9['id'])[_0xf3a6('0xf')](function(_0xfbd7dd){_0x32e9f9=_0xfbd7dd;logger[_0xf3a6('0x11')]('report\x20status:',_0xfbd7dd['dataValues']['status']);if(!reportStatusStrategies[_0xfbd7dd[_0xf3a6('0x45')][_0xf3a6('0x23')]]){logger[_0xf3a6('0x33')]('report\x20status:',_0xfbd7dd['dataValues']['status']);_0x28c962[_0xf3a6('0x8')]();}reportStatusStrategies[_0xfbd7dd['dataValues'][_0xf3a6('0x23')]]({'operation':_0x28c962,'currentAttempt':_0x4f78e6,'retryOptions':_0x3a09e9,'job':_0x1caa1b,'data':_0x32e9f9,'entity':_0xfbd7dd});});}catch(_0xea730a){_0x28c962[_0xf3a6('0x8')](_0xea730a);}});}function handleResult(_0x4ddaea){return function(_0x551dc4){if(_0x4ddaea[_0xf3a6('0x46')]&&_0x4ddaea[_0xf3a6('0x14')]&&_0x4ddaea['MailAccount'][_0xf3a6('0x47')]&&!_[_0xf3a6('0x48')](_0x4ddaea[_0xf3a6('0x13')])){retryer(_0x4ddaea,_0x551dc4);}};}function handleJob(_0x4862bf){return function(){try{if(_[_0xf3a6('0x48')](_0x4862bf[_0xf3a6('0x49')])){return logger[_0xf3a6('0x11')](_0xf3a6('0x4a'));}if(_[_0xf3a6('0x48')](_0x4862bf[_0xf3a6('0x4b')])){return logger[_0xf3a6('0x11')]('subtractUnit\x20null\x20or\x20undefined');}var _0x253bc8={'startDate':moment()['subtract'](_0x4862bf[_0xf3a6('0x49')],_0x4862bf[_0xf3a6('0x4b')])[_0xf3a6('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xf3a6('0x15')](_0xf3a6('0x4c')),'type':'scheduled','output':_0x4862bf[_0xf3a6('0x4d')],'name':_0x4862bf[_0xf3a6('0x17')]};if(!_[_0xf3a6('0x48')](_0x4862bf[_0xf3a6('0x4e')])){logger[_0xf3a6('0x11')](_0xf3a6('0x4f'),_0x4862bf[_0xf3a6('0x4e')]);return analyticDefaultReportController['runReport']({'id':_0x4862bf[_0xf3a6('0x4e')]},_0x253bc8)['then'](handleResult(_0x4862bf))[_0xf3a6('0x10')](handleError());}if(!_['isNil'](_0x4862bf['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4862bf['CustomReportId']);return analyticCustomReportController[_0xf3a6('0x50')]({'id':_0x4862bf[_0xf3a6('0x51')]},_0x253bc8)['then'](handleResult(_0x4862bf))['catch'](handleError());}}catch(_0x3ba66b){logger[_0xf3a6('0x33')](JSON[_0xf3a6('0x29')](_0x3ba66b));}return logger[_0xf3a6('0x11')](_0xf3a6('0x52'));};}function getJobs(_0x424595){var _0x39fc9f={};if(_0x424595){_0x39fc9f['id']=_0x424595;}return db[_0xf3a6('0x53')][_0xf3a6('0x54')]({'where':_0x39fc9f,'include':[{'model':db[_0xf3a6('0x14')],'attributes':['id',_0xf3a6('0x17'),'email'],'include':[{'model':db[_0xf3a6('0x55')],'as':_0xf3a6('0x47'),'include':[{'model':db[_0xf3a6('0x56')],'as':_0xf3a6('0x56')}]}]}]})[_0xf3a6('0xf')](function(_0x201881){var _0x249a5c=_['keys'](manager['jobs']);var _0x5bb2ea=_['map'](_0x201881,function(_0x4ac37b){return _0x4ac37b['id'][_0xf3a6('0x57')]();});var _0x8e37e5=_['keyBy'](_0x201881,function(_0x4f0f68){return _0x4f0f68['id'][_0xf3a6('0x57')]();});var _0xff1804=_0x424595?_0x5bb2ea:_[_0xf3a6('0x58')](_0x5bb2ea,_0x249a5c);var _0x4adce3=_['intersection'](_0x5bb2ea,_0x249a5c);var _0x58c4c3=_[_0xf3a6('0x58')](_0x249a5c,_0x5bb2ea);var _0x36c439;var _0x307522;for(_0x36c439=0x0;_0x36c439<_0x58c4c3[_0xf3a6('0x59')]&&!_0x424595;_0x36c439+=0x1){_0x307522=_0x58c4c3[_0x36c439][_0xf3a6('0x57')]();if(manager['exists'](_0x307522)){manager['stop'](_0x307522);manager[_0xf3a6('0x5a')](_0x307522);logger[_0xf3a6('0x11')](_0xf3a6('0x5b'),_0x307522);}}logger[_0xf3a6('0x11')]('toRun',JSON[_0xf3a6('0x29')](_0xff1804));for(_0x36c439=0x0;_0x36c439<_0xff1804[_0xf3a6('0x59')];_0x36c439+=0x1){_0x307522=_0xff1804[_0x36c439][_0xf3a6('0x57')]();if(_0x424595){logger[_0xf3a6('0x11')](JSON[_0xf3a6('0x29')](_0x8e37e5[_0x307522]));BPromise[_0xf3a6('0x5c')]()[_0xf3a6('0xf')](handleJob(_0x8e37e5[_0x307522]));logger[_0xf3a6('0x11')](_0xf3a6('0x5d'),_0x8e37e5[_0x307522][_0xf3a6('0x17')],_0x8e37e5[_0x307522][_0xf3a6('0x5e')]);}else if(_0x8e37e5[_0x307522][_0xf3a6('0x5e')]&&_0x8e37e5[_0x307522][_0xf3a6('0x5f')]&&moment()['isBetween'](_0x8e37e5[_0x307522][_0xf3a6('0x60')],_0x8e37e5[_0x307522][_0xf3a6('0x61')])){manager['add'](_0x307522,_0x8e37e5[_0x307522][_0xf3a6('0x5e')],handleJob(_0x8e37e5[_0x307522]));manager[_0xf3a6('0x62')](_0x307522);logger['info']('add\x20cron',_0x8e37e5[_0x307522]['name'],_0x8e37e5[_0x307522][_0xf3a6('0x5e')]);}else if(manager[_0xf3a6('0x63')](_0x307522)){manager['stop'](_0x307522);manager[_0xf3a6('0x5a')](_0x307522);logger['info'](_0xf3a6('0x64'),_0x8e37e5[_0x307522]['name'],_0x8e37e5[_0x307522][_0xf3a6('0x5e')]);}}for(_0x36c439=0x0,_0x307522;_0x36c439<_0x4adce3[_0xf3a6('0x59')]&&!_0x424595;_0x36c439+=0x1){_0x307522=_0x4adce3[_0x36c439]['toString']();if(manager[_0xf3a6('0x63')](_0x307522)){if(_0x8e37e5[_0x307522][_0xf3a6('0x5e')]&&_0x8e37e5[_0x307522][_0xf3a6('0x5f')]&&moment()['isBetween'](_0x8e37e5[_0x307522][_0xf3a6('0x60')],_0x8e37e5[_0x307522][_0xf3a6('0x61')])){manager[_0xf3a6('0x65')](_0x307522,_0x8e37e5[_0x307522][_0xf3a6('0x5e')],handleJob(_0x8e37e5[_0x307522]));logger[_0xf3a6('0x11')](_0xf3a6('0x66'),_0x8e37e5[_0x307522][_0xf3a6('0x17')],_0x8e37e5[_0x307522][_0xf3a6('0x5e')]);}else{manager[_0xf3a6('0x3f')](_0x307522);manager[_0xf3a6('0x5a')](_0x307522);logger[_0xf3a6('0x11')](_0xf3a6('0x64'),_0x8e37e5[_0x307522]['name'],_0x8e37e5[_0x307522]['cron']);}}}})['catch'](function(_0x5bb219){logger[_0xf3a6('0x33')](JSON[_0xf3a6('0x29')](_0x5bb219));});}exports['run']=function(_0x31268e){return getJobs(_0x31268e);};exports[_0xf3a6('0x62')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9749=['Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','basename','extname','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Empty','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','Loading','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Failed','[handleSendEmail]\x20Unrecognized\x20status:','SendMail','then','error\x20mail','info','email\x20sent','currentAttempt','retryOptions','retries','job','data','operation','still\x20loading','case\x20completed','stop','case\x20empty','Unrecognized\x20status:','entity','dataValues','attempt','report\x20status:','sendMail','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','MailServerOut','CloudProvider','jobs','map','keyBy','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','run','util','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','retry','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','number','findOne','catch','error','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x9749,0x1a1));var _0x9974=function(_0x2d6706,_0x901d04){_0x2d6706=_0x2d6706-0x0;var _0x475406=_0x9749[_0x2d6706];return _0x475406;};'use strict';var fs=require('fs');var util=require(_0x9974('0x0'));var path=require('path');var _=require(_0x9974('0x1'));var moment=require('moment');var CronJobManager=require(_0x9974('0x2'));var jayson=require(_0x9974('0x3'));var BPromise=require(_0x9974('0x4'));var logger=require(_0x9974('0x5'))(_0x9974('0x6'));var db=require(_0x9974('0x7'))['db'];const retry=require(_0x9974('0x8'));var analyticCustomReportController=require(_0x9974('0x9'));var analyticDefaultReportController=require(_0x9974('0xa'));var client=jayson[_0x9974('0xb')][_0x9974('0xc')]({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x4d3e7a){const _0x2ad353={};if(typeof _0x4d3e7a===_0x9974('0xd')){_0x2ad353['id']=_0x4d3e7a;}return db['AnalyticExtractedReport'][_0x9974('0xe')]({'where':_0x2ad353})['then'](function(_0x32b106){return _0x32b106;})[_0x9974('0xf')](function(_0x78f9f7){logger[_0x9974('0x10')](_0x78f9f7);});}function handleSendEmail(_0x78340e,_0x3e591b){logger['info'](_0x9974('0x11'),_0x78340e[_0x9974('0x12')]);var _0x10eebf=!![];var _0x12a2ce=_0x78340e[_0x9974('0x13')][_0x9974('0x14')]();var _0x3b6407={'account':_0x12a2ce,'message':{'from':util[_0x9974('0x15')]('\x22%s\x22\x20<%s>',_0x78340e[_0x9974('0x13')][_0x9974('0x16')],_0x78340e[_0x9974('0x13')][_0x9974('0x12')]||_0x78340e[_0x9974('0x13')][_0x9974('0x17')][_0x9974('0x18')]),'to':_0x78340e['email'],'cc':_0x78340e['cc'],'bcc':_0x78340e[_0x9974('0x19')],'subject':util[_0x9974('0x15')](_0x9974('0x1a'),_0x3e591b['name'],_0x78340e[_0x9974('0x1b')],_0x78340e['subtractUnit'])}};var _0x276846=path[_0x9974('0x1c')](__dirname,_0x9974('0x1d'));var _0x53e54b=_0x3e591b[_0x9974('0x1e')];var _0x1cc3f6=util[_0x9974('0x15')](_0x9974('0x1f'),path[_0x9974('0x20')](_0x3e591b[_0x9974('0x1e')],path[_0x9974('0x21')](_0x3e591b[_0x9974('0x1e')])),'zip');var _0x38d5f1=path['join'](_0x276846,_0x53e54b);var _0x112e0d=path[_0x9974('0x1c')](_0x276846,_0x1cc3f6);if(fs['existsSync'](_0x38d5f1)){_0x3e591b['status']=_0x9974('0x22');_0x3b6407[_0x9974('0x23')][_0x9974('0x24')]=[{'filename':_0x53e54b,'path':_0x38d5f1}];_0x3b6407['message'][_0x9974('0x25')]=util['format'](_0x9974('0x26'),JSON[_0x9974('0x27')](_0x3e591b,null,0x2));}else if(fs['existsSync'](_0x112e0d)){_0x3e591b[_0x9974('0x28')]=_0x9974('0x22');_0x3b6407[_0x9974('0x23')][_0x9974('0x24')]=[{'filename':_0x1cc3f6,'path':_0x112e0d}];}else{if(_0x3e591b[_0x9974('0x28')]===_0x9974('0x29')){_0x3b6407[_0x9974('0x23')][_0x9974('0x25')]=_0x9974('0x2a');if(!_0x78340e[_0x9974('0x2b')]){_0x10eebf=![];logger['info'](_0x9974('0x2c'));}}else if(_0x3e591b[_0x9974('0x28')]===_0x9974('0x2d')){_0x3b6407[_0x9974('0x23')]['text']=_0x9974('0x2e');}else if(_0x3e591b[_0x9974('0x28')]===_0x9974('0x2f')){_0x3b6407[_0x9974('0x23')][_0x9974('0x25')]=_0x9974('0x30');}else if(_0x3e591b['status']===_0x9974('0x31')){_0x3b6407['message'][_0x9974('0x25')]='Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else{logger[_0x9974('0x10')](_0x9974('0x32'),_0x3e591b[_0x9974('0x28')]);}}if(_0x10eebf){return client['request'](_0x9974('0x33'),_0x3b6407)[_0x9974('0x34')](function(_0x243393){if(_0x243393['error']){return logger[_0x9974('0x10')](_0x9974('0x35'),JSON[_0x9974('0x27')](_0x243393));}return logger[_0x9974('0x36')](_0x9974('0x37'));})[_0x9974('0xf')](function(_0x38dbde){return logger['error'](_0x9974('0x35'),JSON[_0x9974('0x27')](_0x38dbde));});}}function handleError(){return function(_0x8ea5f0){return logger['error'](JSON[_0x9974('0x27')](_0x8ea5f0));};}function loading(_0x442683){logger[_0x9974('0x36')]('case\x20loading');if(_0x442683[_0x9974('0x38')]===_0x442683[_0x9974('0x39')][_0x9974('0x3a')]){handleSendEmail(_0x442683[_0x9974('0x3b')],_0x442683[_0x9974('0x3c')]);_0x442683[_0x9974('0x3d')]['stop']();}else{_0x442683[_0x9974('0x3d')][_0x9974('0x8')](_0x9974('0x3e'));}}function completed(_0x2b4027){logger[_0x9974('0x36')](_0x9974('0x3f'));handleSendEmail(_0x2b4027['job'],_0x2b4027[_0x9974('0x3c')]);_0x2b4027[_0x9974('0x3d')][_0x9974('0x40')]();}function empty(_0x60131e){logger[_0x9974('0x36')](_0x9974('0x41'));handleSendEmail(_0x60131e[_0x9974('0x3b')],_0x60131e[_0x9974('0x3c')]);_0x60131e[_0x9974('0x3d')][_0x9974('0x40')]();}function failed(_0x84891f){logger[_0x9974('0x36')]('case\x20failed');handleSendEmail(_0x84891f[_0x9974('0x3b')],_0x84891f[_0x9974('0x3c')]);_0x84891f[_0x9974('0x3d')][_0x9974('0x40')]();}function urecognized(_0x3b96e1){logger['error'](_0x9974('0x42'),_0x3b96e1[_0x9974('0x43')][_0x9974('0x44')][_0x9974('0x28')]);_0x3b96e1[_0x9974('0x3d')][_0x9974('0x40')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x56914f,_0x66e17b){const _0xf0795d={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0xe574b0=retry[_0x9974('0x3d')](_0xf0795d);_0xe574b0[_0x9974('0x45')](_0x32dbc2=>{logger[_0x9974('0x36')]('Job\x20ID\x20'+_0x56914f['id']+'\x20Attempt\x20#:'+_0x32dbc2);try{getReportData(_0x66e17b['id'])[_0x9974('0x34')](function(_0x452e0a){_0x66e17b=_0x452e0a;logger[_0x9974('0x36')](_0x9974('0x46'),_0x452e0a['dataValues'][_0x9974('0x28')]);if(!reportStatusStrategies[_0x452e0a[_0x9974('0x44')][_0x9974('0x28')]]){logger[_0x9974('0x10')](_0x9974('0x46'),_0x452e0a[_0x9974('0x44')][_0x9974('0x28')]);_0xe574b0[_0x9974('0x8')]();}reportStatusStrategies[_0x452e0a[_0x9974('0x44')]['status']]({'operation':_0xe574b0,'currentAttempt':_0x32dbc2,'retryOptions':_0xf0795d,'job':_0x56914f,'data':_0x66e17b,'entity':_0x452e0a});});}catch(_0x360c78){_0xe574b0[_0x9974('0x8')](_0x360c78);}});}function handleResult(_0x4a7fd3){return function(_0x29e3eb){if(_0x4a7fd3[_0x9974('0x47')]&&_0x4a7fd3[_0x9974('0x13')]&&_0x4a7fd3[_0x9974('0x13')][_0x9974('0x17')]&&!_[_0x9974('0x48')](_0x4a7fd3['email'])){retryer(_0x4a7fd3,_0x29e3eb);}};}function handleJob(_0x54de2d){return function(){try{if(_[_0x9974('0x48')](_0x54de2d[_0x9974('0x1b')])){return logger[_0x9974('0x36')](_0x9974('0x49'));}if(_[_0x9974('0x48')](_0x54de2d['subtractUnit'])){return logger[_0x9974('0x36')](_0x9974('0x4a'));}var _0x296360={'startDate':moment()[_0x9974('0x4b')](_0x54de2d['subtractNumber'],_0x54de2d[_0x9974('0x4c')])[_0x9974('0x15')](_0x9974('0x4d')),'endDate':moment()[_0x9974('0x15')](_0x9974('0x4d')),'type':_0x9974('0x4e'),'output':_0x54de2d[_0x9974('0x4f')],'name':_0x54de2d[_0x9974('0x16')]};if(!_[_0x9974('0x48')](_0x54de2d['DefaultReportId'])){logger[_0x9974('0x36')]('exec\x20defaul\x20report\x20id:%s',_0x54de2d[_0x9974('0x50')]);return analyticDefaultReportController[_0x9974('0x51')]({'id':_0x54de2d[_0x9974('0x50')]},_0x296360)[_0x9974('0x34')](handleResult(_0x54de2d))['catch'](handleError());}if(!_[_0x9974('0x48')](_0x54de2d['CustomReportId'])){logger[_0x9974('0x36')](_0x9974('0x52'),_0x54de2d[_0x9974('0x53')]);return analyticCustomReportController[_0x9974('0x51')]({'id':_0x54de2d[_0x9974('0x53')]},_0x296360)['then'](handleResult(_0x54de2d))[_0x9974('0xf')](handleError());}}catch(_0x5cec53){logger[_0x9974('0x10')](JSON[_0x9974('0x27')](_0x5cec53));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x262ebb){var _0x5b7a7f={};if(_0x262ebb){_0x5b7a7f['id']=_0x262ebb;}return db[_0x9974('0x54')]['findAll']({'where':_0x5b7a7f,'include':[{'model':db[_0x9974('0x13')],'attributes':['id',_0x9974('0x16'),_0x9974('0x12')],'include':[{'model':db[_0x9974('0x55')],'as':'Smtp','include':[{'model':db[_0x9974('0x56')],'as':_0x9974('0x56')}]}]}]})['then'](function(_0x28a859){var _0x44f3be=_['keys'](manager[_0x9974('0x57')]);var _0x2cbf5b=_[_0x9974('0x58')](_0x28a859,function(_0x138e92){return _0x138e92['id']['toString']();});var _0x44d987=_[_0x9974('0x59')](_0x28a859,function(_0x453162){return _0x453162['id'][_0x9974('0x5a')]();});var _0x552228=_0x262ebb?_0x2cbf5b:_[_0x9974('0x5b')](_0x2cbf5b,_0x44f3be);var _0x52c18f=_[_0x9974('0x5c')](_0x2cbf5b,_0x44f3be);var _0x2e11bd=_[_0x9974('0x5b')](_0x44f3be,_0x2cbf5b);var _0x49c88f;var _0x352e5f;for(_0x49c88f=0x0;_0x49c88f<_0x2e11bd[_0x9974('0x5d')]&&!_0x262ebb;_0x49c88f+=0x1){_0x352e5f=_0x2e11bd[_0x49c88f][_0x9974('0x5a')]();if(manager[_0x9974('0x5e')](_0x352e5f)){manager[_0x9974('0x40')](_0x352e5f);manager[_0x9974('0x5f')](_0x352e5f);logger[_0x9974('0x36')](_0x9974('0x60'),_0x352e5f);}}logger[_0x9974('0x36')]('toRun',JSON[_0x9974('0x27')](_0x552228));for(_0x49c88f=0x0;_0x49c88f<_0x552228[_0x9974('0x5d')];_0x49c88f+=0x1){_0x352e5f=_0x552228[_0x49c88f][_0x9974('0x5a')]();if(_0x262ebb){logger[_0x9974('0x36')](JSON[_0x9974('0x27')](_0x44d987[_0x352e5f]));BPromise[_0x9974('0x61')]()['then'](handleJob(_0x44d987[_0x352e5f]));logger['info'](_0x9974('0x62'),_0x44d987[_0x352e5f][_0x9974('0x16')],_0x44d987[_0x352e5f][_0x9974('0x63')]);}else if(_0x44d987[_0x352e5f][_0x9974('0x63')]&&_0x44d987[_0x352e5f][_0x9974('0x64')]&&moment()[_0x9974('0x65')](_0x44d987[_0x352e5f][_0x9974('0x66')],_0x44d987[_0x352e5f][_0x9974('0x67')])){manager[_0x9974('0x68')](_0x352e5f,_0x44d987[_0x352e5f][_0x9974('0x63')],handleJob(_0x44d987[_0x352e5f]));manager[_0x9974('0x69')](_0x352e5f);logger[_0x9974('0x36')](_0x9974('0x6a'),_0x44d987[_0x352e5f][_0x9974('0x16')],_0x44d987[_0x352e5f][_0x9974('0x63')]);}else if(manager['exists'](_0x352e5f)){manager['stop'](_0x352e5f);manager['deleteJob'](_0x352e5f);logger['info'](_0x9974('0x6b'),_0x44d987[_0x352e5f][_0x9974('0x16')],_0x44d987[_0x352e5f][_0x9974('0x63')]);}}for(_0x49c88f=0x0,_0x352e5f;_0x49c88f<_0x52c18f['length']&&!_0x262ebb;_0x49c88f+=0x1){_0x352e5f=_0x52c18f[_0x49c88f][_0x9974('0x5a')]();if(manager[_0x9974('0x5e')](_0x352e5f)){if(_0x44d987[_0x352e5f][_0x9974('0x63')]&&_0x44d987[_0x352e5f][_0x9974('0x64')]&&moment()[_0x9974('0x65')](_0x44d987[_0x352e5f][_0x9974('0x66')],_0x44d987[_0x352e5f][_0x9974('0x67')])){manager[_0x9974('0x6c')](_0x352e5f,_0x44d987[_0x352e5f][_0x9974('0x63')],handleJob(_0x44d987[_0x352e5f]));logger[_0x9974('0x36')]('update\x20cron',_0x44d987[_0x352e5f][_0x9974('0x16')],_0x44d987[_0x352e5f][_0x9974('0x63')]);}else{manager[_0x9974('0x40')](_0x352e5f);manager['deleteJob'](_0x352e5f);logger[_0x9974('0x36')]('stop\x20cron',_0x44d987[_0x352e5f][_0x9974('0x16')],_0x44d987[_0x352e5f]['cron']);}}}})[_0x9974('0xf')](function(_0x5d8abf){logger[_0x9974('0x10')](JSON[_0x9974('0x27')](_0x5d8abf));});}exports[_0x9974('0x6d')]=function(_0x2f99bd){return getJobs(_0x2f99bd);};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 cdc1e9e..df5daa7 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 _0xefda=['push','catch','inspect','start','lodash','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','update','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Transcript\x20not\x20available','ValidationError','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Sentiment\x20Analysis\x20not\x20configured','findOne','Sentiment','Negative','name','SequelizeValidationError','error','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','CloudProvider','forEach'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0xefda,0x96));var _0xaefd=function(_0x4981e9,_0x2d8b39){_0x4981e9=_0x4981e9-0x0;var _0x3ea69b=_0xefda[_0x4981e9];return _0x3ea69b;};var _=require(_0xaefd('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xaefd('0x1'));var BPromise=require(_0xaefd('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xaefd('0x3'))(_0xaefd('0x4'));function getTranscriptionJob(_0x2ade44,_0x22df24,_0x1ef6b4,_0x3288f9){return new Promise(function(_0x497258,_0x3677ea){var _0x3b9736=new AWS[(_0xaefd('0x5'))]({'accessKeyId':_0x22df24,'secretAccessKey':_0x2ade44,'region':_0x1ef6b4});_0x3b9736[_0xaefd('0x6')]({'TranscriptionJobName':_0x3288f9},function(_0x4ce248,_0x15193c){if(_0x4ce248){return _0x3677ea(_0x4ce248);}else{return _0x497258(_0x15193c);}});});}function sentiment(_0xbb04fb,_0x463ce7,_0x4d44ed,_0x48a255,_0x54a3b1){return new Promise(function(_0xa6239d,_0x16b36e){var _0x20135c=new AWS[(_0xaefd('0x7'))]({'accessKeyId':_0x463ce7,'secretAccessKey':_0xbb04fb,'region':_0x4d44ed});_0x20135c[_0xaefd('0x8')]({'Text':_0x48a255,'LanguageCode':_0x54a3b1[_0xaefd('0x9')](0x0,0x2)},function(_0x2ad4d9,_0x3dfddf){if(_0x2ad4d9){return _0x16b36e(_0x2ad4d9);}else{return _0xa6239d(_0x3dfddf);}});});}function checkTranscribeJob(_0x27be0f,_0x382983,_0x2a310c){var _0x4b2b5c;return new BPromise(function(_0x3172d3,_0x4ac467){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0xc'),_0x27be0f['id'],_0x27be0f[_0xaefd('0xd')]));return getTranscriptionJob(_0x2a310c['data1'],_0x2a310c[_0xaefd('0xe')],_0x382983[_0xaefd('0xf')],_0x27be0f[_0xaefd('0xd')])[_0xaefd('0x10')](function(_0x10ee28){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x11'),_0x27be0f['id'],_0x27be0f['transcribeName'],_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')]));if(!_0x27be0f[_0xaefd('0x14')]){switch(_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')]){case _0xaefd('0x15'):var _0x516e84={'transcribeStatus':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x13')],'fileUri':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x16')][_0xaefd('0x17')]};logger[_0xaefd('0xa')](util['format'](_0xaefd('0x18'),_0x27be0f['id']));return rp({'uri':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x16')][_0xaefd('0x17')],'json':!![]})[_0xaefd('0x10')](function(_0x577fb7){logger['info'](util['format'](_0xaefd('0x19'),_0x27be0f['id']));if(_0x577fb7&&_0x577fb7[_0xaefd('0x1a')]&&_0x577fb7[_0xaefd('0x1a')]['transcripts']&&_0x577fb7[_0xaefd('0x1a')]['transcripts'][_0xaefd('0x1b')]){_0x516e84[_0xaefd('0x14')]='';for(var _0x1a05eb=0x0;_0x1a05eb<_0x577fb7['results'][_0xaefd('0x1c')][_0xaefd('0x1b')];_0x1a05eb++){_0x516e84[_0xaefd('0x14')]+=_0x577fb7[_0xaefd('0x1a')][_0xaefd('0x1c')][_0x1a05eb]['transcript']+'';}}return _0x27be0f[_0xaefd('0x1d')](_0x516e84);})['then'](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27be0f['id']));if(!_0x27be0f[_0xaefd('0x1e')]){throw new db[(_0xaefd('0x1f'))]['ValidationError'](_0xaefd('0x20'));}if(!_0x382983[_0xaefd('0x21')]||!_0x382983[_0xaefd('0x22')]||!_0x382983['sentimentRegion']||!_0x382983[_0xaefd('0x23')]||!_0x382983['bucket']){throw new db[(_0xaefd('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x516e84[_0xaefd('0x14')]){throw new Error(_0xaefd('0x24'));}if(_0x382983['sentimentAccountId']===_0x2a310c['id']){return _0x2a310c;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xaefd('0x22')]}});}})[_0xaefd('0x10')](function(_0x4b6910){if(!_0x4b6910){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x4b6910[_0xaefd('0x27')]||!_0x4b6910[_0xaefd('0xe')]){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x28'));}_0x4b2b5c=_0x4b6910;logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x29'),_0x27be0f['id']));return sentiment(_0x4b2b5c[_0xaefd('0x27')],_0x4b2b5c[_0xaefd('0xe')],_0x382983[_0xaefd('0x2a')],_0x516e84[_0xaefd('0x14')],_0x382983[_0xaefd('0x23')]);})[_0xaefd('0x10')](function(_0x195571){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2b'),_0x27be0f['id']));return _0x27be0f[_0xaefd('0x1d')]({'sentiment':_0x195571['Sentiment'],'sPositive':_0x195571[_0xaefd('0x2c')][_0xaefd('0x2d')],'sNegative':_0x195571[_0xaefd('0x2c')]['Negative'],'sMixed':_0x195571[_0xaefd('0x2c')]['Mixed'],'sNeutral':_0x195571[_0xaefd('0x2c')][_0xaefd('0x2e')]});})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2f'),_0x27be0f['id']));_0x3172d3();});case _0xaefd('0x30'):return _0x27be0f[_0xaefd('0x1d')]({'transcribeStatus':_0xaefd('0x30'),'failureReason':_0x10ee28[_0xaefd('0x12')][_0xaefd('0x31')]})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27be0f['id']));_0x3172d3();});default:logger[_0xaefd('0xa')](util['format'](_0xaefd('0x32'),_0x27be0f['id']));break;}}else{return BPromise[_0xaefd('0x33')]()[_0xaefd('0x10')](function(){if(!_0x27be0f[_0xaefd('0x1e')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x20'));}if(!_0x382983[_0xaefd('0x21')]||!_0x382983[_0xaefd('0x22')]||!_0x382983[_0xaefd('0x2a')]||!_0x382983['language']||!_0x382983[_0xaefd('0x34')]){throw new db[(_0xaefd('0x1f'))]['ValidationError'](_0xaefd('0x35'));}if(!_0x27be0f[_0xaefd('0x14')]){throw new Error(_0xaefd('0x24'));}if(_0x382983['sentimentAccountId']===_0x2a310c['id']){return _0x2a310c;}else{return db['CloudProvider'][_0xaefd('0x36')]({'where':{'id':_settings[_0xaefd('0x22')]}});}})[_0xaefd('0x10')](function(_0x179648){if(!_0x179648){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x179648[_0xaefd('0x27')]||!_0x179648['data2']){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x28'));}_0x4b2b5c=_0x179648;logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x29'),_0x27be0f['id']));return sentiment(_0x4b2b5c[_0xaefd('0x27')],_0x4b2b5c[_0xaefd('0xe')],_0x382983['sentimentRegion'],_0x27be0f['fileText'],_0x382983[_0xaefd('0x23')]);})[_0xaefd('0x10')](function(_0x532328){logger['info'](util[_0xaefd('0xb')](_0xaefd('0x2b'),_0x27be0f['id']));return _0x27be0f[_0xaefd('0x1d')]({'sentiment':_0x532328[_0xaefd('0x37')],'sPositive':_0x532328[_0xaefd('0x2c')][_0xaefd('0x2d')],'sNegative':_0x532328[_0xaefd('0x2c')][_0xaefd('0x38')],'sMixed':_0x532328[_0xaefd('0x2c')]['Mixed'],'sNeutral':_0x532328[_0xaefd('0x2c')][_0xaefd('0x2e')],'transcribeStatus':_0xaefd('0x15')});})[_0xaefd('0x10')](function(){logger[_0xaefd('0xa')](util[_0xaefd('0xb')](_0xaefd('0x2f'),_0x27be0f['id']));_0x3172d3();});}})['catch'](function(_0x20716c){if(_0x20716c){if(!_0x20716c['name']||_0x20716c[_0xaefd('0x39')]!==_0xaefd('0x3a')){logger[_0xaefd('0x3b')](util[_0xaefd('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x27be0f['id']),util['inspect'](_0x20716c,{'showHidden':![],'depth':null}));}}_0x3172d3();});});}function checkTranscribe(){var _0x1a73c5;var _0x34839e;var _0x179b8b;return db['VoiceRecording'][_0xaefd('0x3c')]({'where':{'transcribeStatus':_0xaefd('0x3d')}})['then'](function(_0x3deacd){if(!_0x3deacd||!_0x3deacd[_0xaefd('0x1b')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x3e'));}_0x1a73c5=_0x3deacd;return db[_0xaefd('0x3f')][_0xaefd('0x36')]({'where':{'id':0x1}});})[_0xaefd('0x10')](function(_0x4dc674){if(!_0x4dc674){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x40'));}_0x34839e=_0x4dc674;if(!_0x34839e['transcribe']||!_0x34839e[_0xaefd('0x41')]||!_0x34839e['transcribeRegion']||!_0x34839e[_0xaefd('0x23')]||!_0x34839e[_0xaefd('0x34')]){throw new db[(_0xaefd('0x1f'))][(_0xaefd('0x25'))](_0xaefd('0x42'));}return db[_0xaefd('0x43')]['findOne']({'where':{'id':_0x34839e['transcribeAccountId']}});})[_0xaefd('0x10')](function(_0x338823){if(!_0x338823){throw new db['Sequelize'][(_0xaefd('0x25'))](_0xaefd('0x26'));}if(!_0x338823[_0xaefd('0x27')]||!_0x338823[_0xaefd('0xe')]){throw new db['Sequelize']['ValidationError'](_0xaefd('0x28'));}_0x179b8b=_0x338823;var _0x41ef40=[];_0x1a73c5[_0xaefd('0x44')](function(_0x1fe44a){_0x41ef40[_0xaefd('0x45')](checkTranscribeJob(_0x1fe44a,_0x34839e,_0x179b8b));});return BPromise['all'](_0x41ef40);})[_0xaefd('0x46')](function(_0x3b6290){if(_0x3b6290){if(!_0x3b6290['name']||_0x3b6290[_0xaefd('0x39')]!==_0xaefd('0x3a')){logger['error'](util[_0xaefd('0x47')](_0x3b6290,{'showHidden':![],'depth':null}));}}});}exports[_0xaefd('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x8721=['No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','forEach','push','all','inspect','start','lodash','aws-sdk','request-promise','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','sentimentAccountId','ValidationError','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS'];(function(_0x3c16e6,_0x110ffc){var _0x27fb33=function(_0x1eeac2){while(--_0x1eeac2){_0x3c16e6['push'](_0x3c16e6['shift']());}};_0x27fb33(++_0x110ffc);}(_0x8721,0xd9));var _0x1872=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x8721[_0x10df18];return _0x1f9a1d;};var _=require(_0x1872('0x0'));var AWS=require(_0x1872('0x1'));var rp=require(_0x1872('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x1872('0x3'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x50a1c5,_0x40690e,_0x1cd36f,_0x3678b3){return new Promise(function(_0x47ca3a,_0x4befaf){var _0x2dc064=new AWS[(_0x1872('0x4'))]({'accessKeyId':_0x40690e,'secretAccessKey':_0x50a1c5,'region':_0x1cd36f});_0x2dc064[_0x1872('0x5')]({'TranscriptionJobName':_0x3678b3},function(_0x4d019e,_0x2aaad6){if(_0x4d019e){return _0x4befaf(_0x4d019e);}else{return _0x47ca3a(_0x2aaad6);}});});}function sentiment(_0x2c2f41,_0x3fe445,_0x2c2b48,_0x1f43c6,_0x1b057e){return new Promise(function(_0x120590,_0x1c18fc){var _0x406daf=new AWS[(_0x1872('0x6'))]({'accessKeyId':_0x3fe445,'secretAccessKey':_0x2c2f41,'region':_0x2c2b48});_0x406daf[_0x1872('0x7')]({'Text':_0x1f43c6,'LanguageCode':_0x1b057e['substring'](0x0,0x2)},function(_0x15a121,_0x392b65){if(_0x15a121){return _0x1c18fc(_0x15a121);}else{return _0x120590(_0x392b65);}});});}function checkTranscribeJob(_0xb6951b,_0x4345d0,_0x5122df){var _0x412663;return new BPromise(function(_0x1a8e90,_0x12ad66){logger[_0x1872('0x8')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xb6951b['id'],_0xb6951b[_0x1872('0x9')]));return getTranscriptionJob(_0x5122df[_0x1872('0xa')],_0x5122df[_0x1872('0xb')],_0x4345d0[_0x1872('0xc')],_0xb6951b[_0x1872('0x9')])[_0x1872('0xd')](function(_0x4be58a){logger['info'](util[_0x1872('0xe')](_0x1872('0xf'),_0xb6951b['id'],_0xb6951b[_0x1872('0x9')],_0x4be58a['TranscriptionJob'][_0x1872('0x10')]));if(!_0xb6951b['fileText']){switch(_0x4be58a[_0x1872('0x11')][_0x1872('0x10')]){case _0x1872('0x12'):var _0x4d1f11={'transcribeStatus':_0x4be58a[_0x1872('0x11')]['TranscriptionJobStatus'],'fileUri':_0x4be58a[_0x1872('0x11')][_0x1872('0x13')][_0x1872('0x14')]};logger[_0x1872('0x8')](util[_0x1872('0xe')]('[RECORDING:%d]\x20Get\x20transcript',_0xb6951b['id']));return rp({'uri':_0x4be58a[_0x1872('0x11')][_0x1872('0x13')][_0x1872('0x14')],'json':!![]})[_0x1872('0xd')](function(_0xcc4221){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x15'),_0xb6951b['id']));if(_0xcc4221&&_0xcc4221[_0x1872('0x16')]&&_0xcc4221['results']['transcripts']&&_0xcc4221['results'][_0x1872('0x17')][_0x1872('0x18')]){_0x4d1f11[_0x1872('0x19')]='';for(var _0x32499a=0x0;_0x32499a<_0xcc4221['results'][_0x1872('0x17')][_0x1872('0x18')];_0x32499a++){_0x4d1f11[_0x1872('0x19')]+=_0xcc4221['results'][_0x1872('0x17')][_0x32499a]['transcript']+'';}}return _0xb6951b[_0x1872('0x1a')](_0x4d1f11);})[_0x1872('0xd')](function(){logger[_0x1872('0x8')](util['format'](_0x1872('0x1b'),_0xb6951b['id']));if(!_0xb6951b[_0x1872('0x1c')]){throw new db['Sequelize']['ValidationError'](_0x1872('0x1d'));}if(!_0x4345d0['sentiment']||!_0x4345d0['sentimentAccountId']||!_0x4345d0[_0x1872('0x1e')]||!_0x4345d0['language']||!_0x4345d0[_0x1872('0x1f')]){throw new db[(_0x1872('0x20'))]['ValidationError'](_0x1872('0x21'));}if(!_0x4d1f11[_0x1872('0x19')]){throw new Error(_0x1872('0x22'));}if(_0x4345d0['sentimentAccountId']===_0x5122df['id']){return _0x5122df;}else{return db[_0x1872('0x23')][_0x1872('0x24')]({'where':{'id':_settings[_0x1872('0x25')]}});}})[_0x1872('0xd')](function(_0x372f7b){if(!_0x372f7b){throw new db['Sequelize'][(_0x1872('0x26'))](_0x1872('0x27'));}if(!_0x372f7b[_0x1872('0xa')]||!_0x372f7b[_0x1872('0xb')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x412663=_0x372f7b;logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x28'),_0xb6951b['id']));return sentiment(_0x412663[_0x1872('0xa')],_0x412663[_0x1872('0xb')],_0x4345d0[_0x1872('0x1e')],_0x4d1f11[_0x1872('0x19')],_0x4345d0[_0x1872('0x29')]);})['then'](function(_0x4a8c86){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x2a'),_0xb6951b['id']));return _0xb6951b[_0x1872('0x1a')]({'sentiment':_0x4a8c86[_0x1872('0x2b')],'sPositive':_0x4a8c86[_0x1872('0x2c')]['Positive'],'sNegative':_0x4a8c86[_0x1872('0x2c')][_0x1872('0x2d')],'sMixed':_0x4a8c86['SentimentScore']['Mixed'],'sNeutral':_0x4a8c86['SentimentScore'][_0x1872('0x2e')]});})[_0x1872('0xd')](function(){logger[_0x1872('0x8')](util['format'](_0x1872('0x1b'),_0xb6951b['id']));_0x1a8e90();});case _0x1872('0x2f'):return _0xb6951b[_0x1872('0x1a')]({'transcribeStatus':_0x1872('0x2f'),'failureReason':_0x4be58a[_0x1872('0x11')][_0x1872('0x30')]})['then'](function(){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x1b'),_0xb6951b['id']));_0x1a8e90();});default:logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x31'),_0xb6951b['id']));break;}}else{return BPromise[_0x1872('0x32')]()[_0x1872('0xd')](function(){if(!_0xb6951b['tempSentiment']){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))](_0x1872('0x1d'));}if(!_0x4345d0['sentiment']||!_0x4345d0[_0x1872('0x25')]||!_0x4345d0[_0x1872('0x1e')]||!_0x4345d0['language']||!_0x4345d0[_0x1872('0x1f')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))](_0x1872('0x21'));}if(!_0xb6951b[_0x1872('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x4345d0[_0x1872('0x25')]===_0x5122df['id']){return _0x5122df;}else{return db[_0x1872('0x23')][_0x1872('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x1872('0xd')](function(_0x1df449){if(!_0x1df449){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))](_0x1872('0x27'));}if(!_0x1df449[_0x1872('0xa')]||!_0x1df449[_0x1872('0xb')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x412663=_0x1df449;logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x28'),_0xb6951b['id']));return sentiment(_0x412663[_0x1872('0xa')],_0x412663[_0x1872('0xb')],_0x4345d0[_0x1872('0x1e')],_0xb6951b[_0x1872('0x19')],_0x4345d0['language']);})['then'](function(_0x42618f){logger[_0x1872('0x8')](util[_0x1872('0xe')](_0x1872('0x2a'),_0xb6951b['id']));return _0xb6951b['update']({'sentiment':_0x42618f['Sentiment'],'sPositive':_0x42618f['SentimentScore']['Positive'],'sNegative':_0x42618f[_0x1872('0x2c')]['Negative'],'sMixed':_0x42618f[_0x1872('0x2c')][_0x1872('0x33')],'sNeutral':_0x42618f['SentimentScore'][_0x1872('0x2e')],'transcribeStatus':_0x1872('0x12')});})['then'](function(){logger[_0x1872('0x8')](util[_0x1872('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xb6951b['id']));_0x1a8e90();});}})[_0x1872('0x34')](function(_0x41042b){if(_0x41042b){if(!_0x41042b[_0x1872('0x35')]||_0x41042b[_0x1872('0x35')]!==_0x1872('0x36')){logger[_0x1872('0x37')](util[_0x1872('0xe')](_0x1872('0x38'),_0xb6951b['id']),util['inspect'](_0x41042b,{'showHidden':![],'depth':null}));}}_0x1a8e90();});});}function checkTranscribe(){var _0x5b7f62;var _0x8c015;var _0x1b555f;return db[_0x1872('0x39')]['findAll']({'where':{'transcribeStatus':_0x1872('0x3a')}})[_0x1872('0xd')](function(_0x8a4098){if(!_0x8a4098||!_0x8a4098[_0x1872('0x18')]){throw new db[(_0x1872('0x20'))]['ValidationError'](_0x1872('0x3b'));}_0x5b7f62=_0x8a4098;return db[_0x1872('0x3c')][_0x1872('0x24')]({'where':{'id':0x1}});})[_0x1872('0xd')](function(_0x3fc8c2){if(!_0x3fc8c2){throw new db['Sequelize'][(_0x1872('0x26'))](_0x1872('0x3d'));}_0x8c015=_0x3fc8c2;if(!_0x8c015[_0x1872('0x3e')]||!_0x8c015[_0x1872('0x3f')]||!_0x8c015[_0x1872('0xc')]||!_0x8c015[_0x1872('0x29')]||!_0x8c015[_0x1872('0x1f')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Transcribe\x20not\x20configured');}return db[_0x1872('0x23')][_0x1872('0x24')]({'where':{'id':_0x8c015[_0x1872('0x3f')]}});})[_0x1872('0xd')](function(_0x340570){if(!_0x340570){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x340570['data1']||!_0x340570[_0x1872('0xb')]){throw new db[(_0x1872('0x20'))][(_0x1872('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x1b555f=_0x340570;var _0x25004c=[];_0x5b7f62[_0x1872('0x40')](function(_0xd33499){_0x25004c[_0x1872('0x41')](checkTranscribeJob(_0xd33499,_0x8c015,_0x1b555f));});return BPromise[_0x1872('0x42')](_0x25004c);})[_0x1872('0x34')](function(_0x1614de){if(_0x1614de){if(!_0x1614de[_0x1872('0x35')]||_0x1614de['name']!==_0x1872('0x36')){logger['error'](util[_0x1872('0x43')](_0x1614de,{'showHidden':![],'depth':null}));}}});}exports[_0x1872('0x44')]=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 8eda58a..1a10a3c 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 _0x6816=['emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','socket.io-emitter','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0x6816,0x97));var _0x6681=function(_0x19bb59,_0x3e80f0){_0x19bb59=_0x19bb59-0x0;var _0x39cac3=_0x6816[_0x19bb59];return _0x39cac3;};'use strict';var _=require(_0x6681('0x0'));var moment=require(_0x6681('0x1'));var Redis=require(_0x6681('0x2'));var util=require(_0x6681('0x3'));var config=require(_0x6681('0x4'));var db=require(_0x6681('0x5'))['db'];var logger=require(_0x6681('0x6'))('schedule');config[_0x6681('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6681('0x8'))(new Redis(config[_0x6681('0x7')]));function closeInteractions(){var _0x541956=[];return db['WhatsappInteraction'][_0x6681('0x9')]({'raw':!![],'attributes':['id',_0x6681('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6681('0xb')](0x18,'hours')}}})[_0x6681('0xc')](function(_0x11fe53){if(_0x11fe53&&_0x11fe53[_0x6681('0xd')]){_0x541956=_[_0x6681('0xe')](_0x11fe53||[],'id');logger[_0x6681('0xf')](_0x6681('0x10'),_0x541956[_0x6681('0x11')]());return db['WhatsappInteraction'][_0x6681('0x12')]({'closeReason':_0x6681('0x13'),'disposition':_0x6681('0x14'),'closed':!![],'closedAt':moment()[_0x6681('0x15')](_0x6681('0x16'))},{'where':{'id':_0x541956}});}})[_0x6681('0xc')](function(){if(_0x541956&&_0x541956['length']){logger[_0x6681('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x541956[_0x6681('0x11')]());for(var _0x306a32=0x0;_0x306a32<_0x541956['length'];_0x306a32++){io[_0x6681('0x17')]('whatsappInteraction:update',{'id':_0x541956[_0x306a32],'closed':!![]});}}})[_0x6681('0x18')](function(_0x5d74a7){logger[_0x6681('0x19')](_0x6681('0x1a'),_0x5d74a7?util[_0x6681('0x1b')](_0x5d74a7,{'showHidden':![],'depth':null}):'');});}exports[_0x6681('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4961=['util','../../mysqldb','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','length','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','inspect','lodash','moment','ioredis'];(function(_0x4a6623,_0x556597){var _0x3c56ff=function(_0xa97801){while(--_0xa97801){_0x4a6623['push'](_0x4a6623['shift']());}};_0x3c56ff(++_0x556597);}(_0x4961,0x1a6));var _0x1496=function(_0x4d87ec,_0x3f2c31){_0x4d87ec=_0x4d87ec-0x0;var _0x1d1538=_0x4961[_0x4d87ec];return _0x1d1538;};'use strict';var _=require(_0x1496('0x0'));var moment=require(_0x1496('0x1'));var Redis=require(_0x1496('0x2'));var util=require(_0x1496('0x3'));var config=require('../../config/environment');var db=require(_0x1496('0x4'))['db'];var logger=require('../logger')('schedule');config[_0x1496('0x5')]=_['defaults'](config['redis'],{'host':_0x1496('0x6'),'port':0x18eb});var io=require(_0x1496('0x7'))(new Redis(config[_0x1496('0x5')]));function closeInteractions(){var _0x81bda2=[];return db[_0x1496('0x8')][_0x1496('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1496('0xa')](0x18,_0x1496('0xb'))}}})['then'](function(_0x3ab125){if(_0x3ab125&&_0x3ab125[_0x1496('0xc')]){_0x81bda2=_['map'](_0x3ab125||[],'id');logger['info'](_0x1496('0xd'),_0x81bda2[_0x1496('0xe')]());return db['WhatsappInteraction']['update']({'closeReason':_0x1496('0xf'),'disposition':_0x1496('0x10'),'closed':!![],'closedAt':moment()[_0x1496('0x11')](_0x1496('0x12'))},{'where':{'id':_0x81bda2}});}})[_0x1496('0x13')](function(){if(_0x81bda2&&_0x81bda2[_0x1496('0xc')]){logger[_0x1496('0x14')](_0x1496('0x15'),_0x81bda2['join']());for(var _0xb9c9a1=0x0;_0xb9c9a1<_0x81bda2['length'];_0xb9c9a1++){io[_0x1496('0x16')](_0x1496('0x17'),{'id':_0x81bda2[_0xb9c9a1],'closed':!![]});}}})['catch'](function(_0x23d374){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x23d374?util[_0x1496('0x18')](_0x23d374,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 4a32098..eec2fd7 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb58c=['contacts1','CmHopper','hopper1','contacts2','catch','util','../mysqldb','Innocenzo','innocenzo.biondo','push','now','Biondo','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0x5cb5cd,_0x6d4a7b){var _0x59caa6=function(_0x39bb7f){while(--_0x39bb7f){_0x5cb5cd['push'](_0x5cb5cd['shift']());}};_0x59caa6(++_0x6d4a7b);}(_0xb58c,0x122));var _0xcb58=function(_0x1b00f1,_0x15ffa8){_0x1b00f1=_0x1b00f1-0x0;var _0x5c3dad=_0xb58c[_0x1b00f1];return _0x5c3dad;};'use strict';var util=require(_0xcb58('0x0'));var db=require(_0xcb58('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xcb58('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xcb58('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xcb58('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xcb58('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcb58('0x5')](),'updatedAt':Date[_0xcb58('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xcb58('0x4')]({'id':i,'firstName':_0xcb58('0x2')+i,'lastName':_0xcb58('0x6')+i,'phone':0xf879fb460+i,'email':_0xcb58('0x3')+i+_0xcb58('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xcb58('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xcb58('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xcb58('0x5')]()});}db[_0xcb58('0x8')][_0xcb58('0x9')]({'where':{}})[_0xcb58('0xa')](function(){return db['CmContact'][_0xcb58('0xb')](contacts);})[_0xcb58('0xa')](function(){console[_0xcb58('0xc')](_0xcb58('0xd'),_0xcb58('0xe'));return db['CmHopper'][_0xcb58('0x9')]({'where':{}});})['then'](function(){return db[_0xcb58('0xf')]['bulkCreate'](hopper);})['then'](function(){console[_0xcb58('0xc')](_0xcb58('0xd'),_0xcb58('0x10'));return db[_0xcb58('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0xcb58('0xc')](_0xcb58('0xd'),_0xcb58('0x11'));return db[_0xcb58('0xf')]['bulkCreate'](hopper2);})[_0xcb58('0xa')](function(){console[_0xcb58('0xc')]('finished\x20populating','hopper2');})[_0xcb58('0x12')](function(_0x54f457){console[_0xcb58('0xc')](_0x54f457);}); \ No newline at end of file +var _0x236c=['CmContact','destroy','then','bulkCreate','finished\x20populating','CmHopper','log','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo'];(function(_0x277a8d,_0x8f4900){var _0x3e1793=function(_0x5e8f41){while(--_0x5e8f41){_0x277a8d['push'](_0x277a8d['shift']());}};_0x3e1793(++_0x8f4900);}(_0x236c,0x12a));var _0xc236=function(_0x16e16f,_0x48ee91){_0x16e16f=_0x16e16f-0x0;var _0x1e611c=_0x236c[_0x16e16f];return _0x1e611c;};'use strict';var util=require(_0xc236('0x0'));var db=require(_0xc236('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc236('0x2')]({'id':i,'firstName':_0xc236('0x3')+i,'lastName':_0xc236('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc236('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc236('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc236('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc236('0x2')]({'id':i,'firstName':_0xc236('0x3')+i,'lastName':_0xc236('0x4')+i,'phone':0xf879fb460+i,'email':_0xc236('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc236('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc236('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xc236('0x6')]()});}db[_0xc236('0x8')][_0xc236('0x9')]({'where':{}})[_0xc236('0xa')](function(){return db[_0xc236('0x8')][_0xc236('0xb')](contacts);})[_0xc236('0xa')](function(){console['log'](_0xc236('0xc'),'contacts1');return db[_0xc236('0xd')][_0xc236('0x9')]({'where':{}});})[_0xc236('0xa')](function(){return db['CmHopper'][_0xc236('0xb')](hopper);})[_0xc236('0xa')](function(){console[_0xc236('0xe')](_0xc236('0xc'),_0xc236('0xf'));return db[_0xc236('0x8')][_0xc236('0xb')](contacts2);})['then'](function(){console['log'](_0xc236('0xc'),_0xc236('0x10'));return db[_0xc236('0xd')][_0xc236('0xb')](hopper2);})[_0xc236('0xa')](function(){console[_0xc236('0xe')](_0xc236('0xc'),_0xc236('0x11'));})['catch'](function(_0x16b16a){console[_0xc236('0xe')](_0x16b16a);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 02ba79a..d1f37fd 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37f7=['format','%s%s','agent','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','User','bulkCreate','catch','log','push'];(function(_0xd94071,_0x44e2be){var _0x58a109=function(_0x7c5972){while(--_0x7c5972){_0xd94071['push'](_0xd94071['shift']());}};_0x58a109(++_0x44e2be);}(_0x37f7,0x167));var _0x737f=function(_0x14dc9a,_0x3d4c0d){_0x14dc9a=_0x14dc9a-0x0;var _0x2626ba=_0x37f7[_0x14dc9a];return _0x2626ba;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x737f('0x0')]({'name':util[_0x737f('0x1')](_0x737f('0x2'),'agent',i),'fullname':util[_0x737f('0x1')](_0x737f('0x2'),_0x737f('0x3'),i),'email':util[_0x737f('0x1')]('%s%s@xcally.com',_0x737f('0x3'),i),'role':_0x737f('0x3'),'password':'password','internal':0xfa0+i,'type':_0x737f('0x4'),'transport':[_0x737f('0x5'),'ws',_0x737f('0x6')],'disallow':[_0x737f('0x7')],'allow':[_0x737f('0x8')],'defaultuser':util[_0x737f('0x1')]('%s%s','agent',i),'encryption':_0x737f('0x9'),'avpf':_0x737f('0x9'),'force_avp':'yes','icesupport':_0x737f('0x9'),'dtlsenable':_0x737f('0x9'),'dtlsverify':'no','dtlscertfile':_0x737f('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x737f('0x1')](_0x737f('0x2'),_0x737f('0x3'),i),0xfa0+i)});}db[_0x737f('0xb')][_0x737f('0xc')](users)['then'](function(){console['log']('add\x20user');})[_0x737f('0xd')](function(_0x3a0489){console[_0x737f('0xe')](_0x3a0489);}); \ No newline at end of file +var _0xd52c=['/etc/pki/tls/private/motion.key','actpass','User','then','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','yes'];(function(_0x5d79ab,_0x2ff6d8){var _0x34d54c=function(_0x42fabf){while(--_0x42fabf){_0x5d79ab['push'](_0x5d79ab['shift']());}};_0x34d54c(++_0x2ff6d8);}(_0xd52c,0x76));var _0xcd52=function(_0x2be104,_0x4bf5d0){_0x2be104=_0x2be104-0x0;var _0x31c115=_0xd52c[_0x2be104];return _0x31c115;};'use strict';var util=require(_0xcd52('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xcd52('0x1')]({'name':util[_0xcd52('0x2')](_0xcd52('0x3'),_0xcd52('0x4'),i),'fullname':util[_0xcd52('0x2')](_0xcd52('0x3'),_0xcd52('0x4'),i),'email':util[_0xcd52('0x2')](_0xcd52('0x5'),'agent',i),'role':_0xcd52('0x4'),'password':'password','internal':0xfa0+i,'type':_0xcd52('0x6'),'transport':[_0xcd52('0x7'),'ws',_0xcd52('0x8')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util['format']('%s%s',_0xcd52('0x4'),i),'encryption':_0xcd52('0x9'),'avpf':_0xcd52('0x9'),'force_avp':'yes','icesupport':_0xcd52('0x9'),'dtlsenable':_0xcd52('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xcd52('0xa'),'dtlssetup':_0xcd52('0xb'),'callerid':util[_0xcd52('0x2')]('\x22%s\x22\x20<%s>',util[_0xcd52('0x2')]('%s%s',_0xcd52('0x4'),i),0xfa0+i)});}db[_0xcd52('0xc')]['bulkCreate'](users)[_0xcd52('0xd')](function(){console['log'](_0xcd52('0xe'));})[_0xcd52('0xf')](function(_0x4d0787){console['log'](_0x4d0787);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 29e0556..2dceb0b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x414f=['ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','bluebird','../mysqldb','name','Agents','User','role','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','resourceId','map','telephone','Campaign','where','%s:queue:%s','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteractions','admin','voice:inbound','include','push','VoiceQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','voice:outbound','ChatQueues','ChatQueue','FaxQueues','FaxQueue','OpenchannelQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave'];(function(_0x1a1bcb,_0x1ba00c){var _0x461f5a=function(_0x4935bf){while(--_0x4935bf){_0x1a1bcb['push'](_0x1a1bcb['shift']());}};_0x461f5a(++_0x1ba00c);}(_0x414f,0x13f));var _0xf414=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0x414f[_0x51af96];return _0x2bb16b;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var BPromise=require(_0xf414('0x1'));var db=require(_0xf414('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xf414('0x3')],'include':[{'as':_0xf414('0x4'),'model':db[_0xf414('0x5')],'attributes':['id',_0xf414('0x3'),_0xf414('0x6')],'raw':!![],'where':{'role':_0xf414('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf414('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xf414('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xf414('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xf414('0x3'),_0xf414('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4e69bd,_0x26a409,_0x2bbf01){return db[_0xf414('0x9')][_0xf414('0xa')]({'where':{'name':_0x4e69bd,'userProfileId':_0x26a409},'raw':!![]})[_0xf414('0xb')](function(_0x44648f){if(_0x44648f){if(_0x44648f[_0xf414('0xc')]){switch(_0x4e69bd){case _0xf414('0xd'):case'ChatQueues':case'FaxQueues':case _0xf414('0xe'):case _0xf414('0xf'):case _0xf414('0x10'):case _0xf414('0x11'):return db[_0x2bbf01][_0xf414('0x12')](queryQueues);case'Telephones':return db[_0x2bbf01][_0xf414('0x12')](queryTelephones);case _0xf414('0x13'):return db[_0x2bbf01][_0xf414('0x12')](queryTrunks);case _0xf414('0x14'):return db[_0x2bbf01][_0xf414('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0xf414('0x12')]({'attributes':[_0xf414('0x15')],'where':{'sectionId':_0x44648f['id']},'raw':!![]})[_0xf414('0xb')](function(_0x706d2e){if(_0x706d2e){var _0x4d3021={'where':{'id':_[_0xf414('0x16')](_0x706d2e,_0xf414('0x15'))},'raw':!![]};switch(_0x2bbf01){case _0xf414('0x5'):_0x4d3021['where'][_0xf414('0x6')]=_0xf414('0x17');break;case _0xf414('0x18'):_0x4d3021[_0xf414('0x19')][_0xf414('0x8')]='ivr';break;}return db[_0x2bbf01][_0xf414('0x12')](_0x4d3021);}else{return[];}});}}else{return[];}})['then'](function(_0x5ede89){return _0x5ede89;});}function joinOrLeaveQueues(_0x24b65e,_0x44b829,_0x572605,_0x49249b){_0x24b65e[_0x44b829](util['format'](_0xf414('0x1a'),_0x572605,_0x49249b[_0xf414('0x3')]));if(_0x49249b[_0xf414('0x4')]){for(var _0x417af1=0x0;_0x417af1<_0x49249b[_0xf414('0x4')][_0xf414('0x1b')];_0x417af1+=0x1){_0x24b65e[_0x44b829](util[_0xf414('0x1c')](_0xf414('0x1d'),_0x49249b[_0xf414('0x4')][_0x417af1]['name']));}}}function joinOrLeave(_0xcde327,_0x3ae2a0,_0x236504){var _0x4999e4;if(_0xcde327[_0xf414('0x1e')][_0xf414('0x1f')]['id']){db[_0xf414('0x5')][_0xf414('0x20')]({'attributes':['id',_0xf414('0x3'),_0xf414('0x6'),_0xf414('0x21')],'where':{'id':_0xcde327[_0xf414('0x1e')]['query']['id']},'include':[{'model':db[_0xf414('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xf414('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xf414('0x24')],'as':_0xf414('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xf414('0x26')],'as':_0xf414('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xf414('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xf414('0x29'),'attributes':['id'],'raw':!![]}]})[_0xf414('0xb')](function(_0x209790){if(_0x209790){_0x4999e4=_0x209790;_0xcde327[_0x3ae2a0](util['format'](_0xf414('0x1d'),_0x209790['name']));var _0x485afe=[];switch(_0x209790[_0xf414('0x6')]){case _0xf414('0x2a'):_0xcde327[_0x3ae2a0](_0xf414('0x2b'));_0xcde327[_0x3ae2a0]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xf414('0x2c'))){delete queryQueues['include'];}_0x485afe[_0xf414('0x2d')](db[_0xf414('0x2e')][_0xf414('0x12')](queryQueues));_0x485afe[_0xf414('0x2d')](db['ChatQueue'][_0xf414('0x12')](queryQueues));_0x485afe['push'](db['FaxQueue'][_0xf414('0x12')](queryQueues));_0x485afe[_0xf414('0x2d')](db[_0xf414('0x2f')][_0xf414('0x12')](queryQueues));_0x485afe[_0xf414('0x2d')](db[_0xf414('0x30')][_0xf414('0x12')](queryQueues));_0x485afe[_0xf414('0x2d')](db['OpenchannelQueue']['findAll'](queryQueues));_0x485afe[_0xf414('0x2d')](db[_0xf414('0x31')][_0xf414('0x12')](queryQueues));_0x485afe['push'](db['User'][_0xf414('0x12')](queryTelephones));_0x485afe['push'](db[_0xf414('0x32')]['findAll'](queryTrunks));_0x485afe[_0xf414('0x2d')](db[_0xf414('0x18')]['findAll'](queryCampaigns));_0x485afe[_0xf414('0x2d')](db[_0xf414('0x5')][_0xf414('0x12')](queryAgents));break;case'user':_0xcde327[_0x3ae2a0](_0xf414('0x2b'));_0xcde327[_0x3ae2a0](_0xf414('0x33'));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0xd'),_0x209790[_0xf414('0x21')],_0xf414('0x2e')));_0x485afe['push'](getAssociatedResources(_0xf414('0x34'),_0x209790[_0xf414('0x21')],_0xf414('0x35')));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0x36'),_0x209790[_0xf414('0x21')],_0xf414('0x37')));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0xe'),_0x209790['userProfileId'],_0xf414('0x2f')));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0xf'),_0x209790[_0xf414('0x21')],_0xf414('0x30')));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0x10'),_0x209790[_0xf414('0x21')],_0xf414('0x38')));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0x11'),_0x209790[_0xf414('0x21')],_0xf414('0x31')));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0x39'),_0x209790[_0xf414('0x21')],_0xf414('0x5')));_0x485afe['push'](getAssociatedResources(_0xf414('0x13'),_0x209790[_0xf414('0x21')],'Trunk'));_0x485afe[_0xf414('0x2d')](getAssociatedResources(_0xf414('0x14'),_0x209790['userProfileId'],_0xf414('0x18')));_0x485afe[_0xf414('0x2d')](db[_0xf414('0x5')][_0xf414('0x12')](queryAgents));break;case _0xf414('0x7'):_0xcde327[_0x3ae2a0](_0xf414('0x2b'));_0xcde327[_0x3ae2a0](_0xf414('0x33'));_0x485afe['push'](_0x209790[_0xf414('0x3a')]({'attributes':['id',_0xf414('0x3')]}));_0x485afe[_0xf414('0x2d')](_0x209790[_0xf414('0x3b')]({'attributes':['id',_0xf414('0x3')]}));_0x485afe[_0xf414('0x2d')](_0x209790[_0xf414('0x3c')]({'attributes':['id',_0xf414('0x3')]}));_0x485afe[_0xf414('0x2d')](_0x209790['getSmsQueues']({'attributes':['id',_0xf414('0x3')]}));_0x485afe[_0xf414('0x2d')](_0x209790[_0xf414('0x3d')]({'attributes':['id',_0xf414('0x3')]}));_0x485afe['push'](_0x209790['getOpenchannelQueues']({'attributes':['id',_0xf414('0x3')]}));_0x485afe[_0xf414('0x2d')](_0x209790['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0xf414('0x3e')](_0x485afe);}})[_0xf414('0xb')](function(_0x33c42d){if(_0x33c42d&&_0x33c42d[_0xf414('0x1b')]){for(var _0x1e7e28=0x0;_0x1e7e28<_0x33c42d[_0xf414('0x1b')];_0x1e7e28+=0x1){for(var _0x8754a1=0x0;_0x8754a1<_0x33c42d[_0x1e7e28][_0xf414('0x1b')];_0x8754a1+=0x1){switch(_0x1e7e28){case 0x0:joinOrLeaveQueues(_0xcde327,_0x3ae2a0,_0xf414('0x3f'),_0x33c42d[_0x1e7e28][_0x8754a1]);break;case 0x1:joinOrLeaveQueues(_0xcde327,_0x3ae2a0,_0xf414('0x40'),_0x33c42d[_0x1e7e28][_0x8754a1]);break;case 0x2:joinOrLeaveQueues(_0xcde327,_0x3ae2a0,_0xf414('0x41'),_0x33c42d[_0x1e7e28][_0x8754a1]);break;case 0x3:joinOrLeaveQueues(_0xcde327,_0x3ae2a0,_0xf414('0x42'),_0x33c42d[_0x1e7e28][_0x8754a1]);break;case 0x4:joinOrLeaveQueues(_0xcde327,_0x3ae2a0,_0xf414('0x43'),_0x33c42d[_0x1e7e28][_0x8754a1]);break;case 0x5:joinOrLeaveQueues(_0xcde327,_0x3ae2a0,_0xf414('0x44'),_0x33c42d[_0x1e7e28][_0x8754a1]);break;case 0x6:joinOrLeaveQueues(_0xcde327,_0x3ae2a0,_0xf414('0x45'),_0x33c42d[_0x1e7e28][_0x8754a1]);break;case 0x7:if(_0x4999e4[_0xf414('0x6')]!=='agent')_0xcde327[_0x3ae2a0](util[_0xf414('0x1c')](_0xf414('0x46'),_0x33c42d[_0x1e7e28][_0x8754a1]['name']));break;case 0x8:if(_0x4999e4[_0xf414('0x6')]!==_0xf414('0x7'))_0xcde327[_0x3ae2a0](util[_0xf414('0x1c')](_0xf414('0x47'),_0x33c42d[_0x1e7e28][_0x8754a1][_0xf414('0x3')]));break;case 0x9:if(_0x4999e4[_0xf414('0x6')]!=='agent')_0xcde327[_0x3ae2a0](util[_0xf414('0x1c')]('campaign:%s:%s',_0x33c42d[_0x1e7e28][_0x8754a1]['type'],_0x33c42d[_0x1e7e28][_0x8754a1][_0xf414('0x3')]));break;case 0xa:_0xcde327[_0x3ae2a0](util[_0xf414('0x1c')](_0xf414('0x1d'),_0x33c42d[_0x1e7e28][_0x8754a1]['name']));break;}}}}})[_0xf414('0xb')](function(){if(_0x3ae2a0===_0xf414('0x48')){var _0x20319f=_[_0xf414('0x16')](_0x4999e4[_0xf414('0x49')],'id');return _0x4999e4[_0xf414('0x4a')](_0x20319f)['then'](function(){for(var _0x1f0324=0x0;_0x1f0324<_0x20319f['length'];_0x1f0324+=0x1){_0x236504['emit'](_0xf414('0x4b'),{'ChatInteractionId':Number(_0x20319f[_0x1f0324]),'UserId':Number(_0x4999e4['id'])});}});}})[_0xf414('0xb')](function(){if(_0x3ae2a0==='leave'){var _0x5ceccb=_['map'](_0x4999e4['MailInteractions'],'id');return _0x4999e4[_0xf414('0x4c')](_0x5ceccb)[_0xf414('0xb')](function(){for(var _0x22d341=0x0;_0x22d341<_0x5ceccb['length'];_0x22d341+=0x1){_0x236504[_0xf414('0x4d')](_0xf414('0x4e'),{'MailInteractionId':Number(_0x5ceccb[_0x22d341]),'UserId':Number(_0x4999e4['id'])});}});}})[_0xf414('0xb')](function(){if(_0x3ae2a0===_0xf414('0x48')){var _0x5061cc=_[_0xf414('0x16')](_0x4999e4[_0xf414('0x25')],'id');return _0x4999e4['removeFaxInteractions'](_0x5061cc)[_0xf414('0xb')](function(){for(var _0x3f1555=0x0;_0x3f1555<_0x5061cc['length'];_0x3f1555+=0x1){_0x236504[_0xf414('0x4d')](_0xf414('0x4f'),{'FaxInteractionId':Number(_0x5061cc[_0x3f1555]),'UserId':Number(_0x4999e4['id'])});}});}})['then'](function(){if(_0x3ae2a0===_0xf414('0x48')){var _0x54d909=_[_0xf414('0x16')](_0x4999e4['SmsInteractions'],'id');return _0x4999e4[_0xf414('0x50')](_0x54d909)['then'](function(){for(var _0x1d17bf=0x0;_0x1d17bf<_0x54d909[_0xf414('0x1b')];_0x1d17bf+=0x1){_0x236504[_0xf414('0x4d')](_0xf414('0x51'),{'SmsInteractionId':Number(_0x54d909[_0x1d17bf]),'UserId':Number(_0x4999e4['id'])});}});}})[_0xf414('0xb')](function(){if(_0x3ae2a0==='leave'){var _0x375493=_[_0xf414('0x16')](_0x4999e4[_0xf414('0x52')],'id');return _0x4999e4['removeOpenchannelInteractions'](_0x375493)[_0xf414('0xb')](function(){for(var _0x30b335=0x0;_0x30b335<_0x375493[_0xf414('0x1b')];_0x30b335+=0x1){_0x236504[_0xf414('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x375493[_0x30b335]),'UserId':Number(_0x4999e4['id'])});}});}})[_0xf414('0xb')](function(){if(_0x3ae2a0==='leave'){var _0x59ad77=_['map'](_0x4999e4[_0xf414('0x29')],'id');return _0x4999e4[_0xf414('0x53')](_0x59ad77)['then'](function(){for(var _0x169835=0x0;_0x169835<_0x59ad77[_0xf414('0x1b')];_0x169835+=0x1){_0x236504[_0xf414('0x4d')](_0xf414('0x54'),{'WhatsappInteractionId':Number(_0x59ad77[_0x169835]),'UserId':Number(_0x4999e4['id'])});}});}})['catch'](function(_0x4d30f0){_0xcde327[_0xf414('0x55')](_0x4d30f0);});}}function onDisconnect(_0x40762d,_0x20caaf){joinOrLeave(_0x40762d,_0xf414('0x48'),_0x20caaf);}function onConnect(_0x6380d0){joinOrLeave(_0x6380d0,_0xf414('0x56'));}exports[_0xf414('0x57')]=function(_0x31c305){_0x31c305['on'](_0xf414('0x58'),function(_0x2827fd){_0x2827fd[_0xf414('0x59')](0x0);_0x2827fd[_0xf414('0x5a')]=_0x2827fd[_0xf414('0x5b')][_0xf414('0x58')]['remoteAddress']+':'+_0x2827fd[_0xf414('0x5b')][_0xf414('0x58')][_0xf414('0x5c')];_0x2827fd[_0xf414('0x5d')]=new Date();_0x2827fd[_0xf414('0x55')]=function(_0xb9b892){console[_0xf414('0x55')](_0xf414('0x5e')+_0x2827fd[_0xf414('0x5f')]['name']+'['+_0x2827fd[_0xf414('0x5a')]+']',_0xb9b892);};_0x2827fd['on'](_0xf414('0x60'),function(){onDisconnect(_0x2827fd,_0x31c305);_0x2827fd[_0xf414('0x55')]('DISCONNECTED');});onConnect(_0x2827fd);_0x2827fd[_0xf414('0x55')](_0xf414('0x61'));});}; \ No newline at end of file +var _0xbcf1=['OpenchannelQueue','Trunk','user','voice:outbound','WhatsappQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','removeChatInteractions','emit','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','telephone','agent','type','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','then','map','resourceId','User','where','ivr','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','role','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue'];(function(_0x2ce323,_0x44ecb0){var _0x3a5732=function(_0x451ed7){while(--_0x451ed7){_0x2ce323['push'](_0x2ce323['shift']());}};_0x3a5732(++_0x44ecb0);}(_0xbcf1,0x97));var _0x1bcf=function(_0x41b0a8,_0x1b05cc){_0x41b0a8=_0x41b0a8-0x0;var _0x3a83d4=_0xbcf1[_0x41b0a8];return _0x3a83d4;};'use strict';var _=require(_0x1bcf('0x0'));var util=require('util');var BPromise=require(_0x1bcf('0x1'));var db=require(_0x1bcf('0x2'))['db'];var config=require(_0x1bcf('0x3'));var queryQueues={'attributes':['id',_0x1bcf('0x4')],'include':[{'as':_0x1bcf('0x5'),'model':db['User'],'attributes':['id',_0x1bcf('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1bcf('0x4')],'where':{'role':_0x1bcf('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1bcf('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x1bcf('0x4')],'where':{'role':_0x1bcf('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1bcf('0x4'),_0x1bcf('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x1d4518,_0x52dc9e,_0x42a7d6){return db[_0x1bcf('0x9')]['findOne']({'where':{'name':_0x1d4518,'userProfileId':_0x52dc9e},'raw':!![]})['then'](function(_0x4da9e6){if(_0x4da9e6){if(_0x4da9e6[_0x1bcf('0xa')]){switch(_0x1d4518){case _0x1bcf('0xb'):case _0x1bcf('0xc'):case _0x1bcf('0xd'):case _0x1bcf('0xe'):case _0x1bcf('0xf'):case _0x1bcf('0x10'):case _0x1bcf('0x11'):return db[_0x42a7d6][_0x1bcf('0x12')](queryQueues);case _0x1bcf('0x13'):return db[_0x42a7d6][_0x1bcf('0x12')](queryTelephones);case _0x1bcf('0x14'):return db[_0x42a7d6]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x42a7d6][_0x1bcf('0x12')](queryCampaigns);}}else{return db[_0x1bcf('0x15')][_0x1bcf('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x4da9e6['id']},'raw':!![]})[_0x1bcf('0x16')](function(_0x419fce){if(_0x419fce){var _0x34badf={'where':{'id':_[_0x1bcf('0x17')](_0x419fce,_0x1bcf('0x18'))},'raw':!![]};switch(_0x42a7d6){case _0x1bcf('0x19'):_0x34badf[_0x1bcf('0x1a')]['role']=_0x1bcf('0x6');break;case'Campaign':_0x34badf[_0x1bcf('0x1a')][_0x1bcf('0x8')]=_0x1bcf('0x1b');break;}return db[_0x42a7d6][_0x1bcf('0x12')](_0x34badf);}else{return[];}});}}else{return[];}})[_0x1bcf('0x16')](function(_0x5aede4){return _0x5aede4;});}function joinOrLeaveQueues(_0x4b1f72,_0x384b06,_0x5933bc,_0x193edf){_0x4b1f72[_0x384b06](util[_0x1bcf('0x1c')](_0x1bcf('0x1d'),_0x5933bc,_0x193edf[_0x1bcf('0x4')]));if(_0x193edf[_0x1bcf('0x5')]){for(var _0x2783e6=0x0;_0x2783e6<_0x193edf[_0x1bcf('0x5')][_0x1bcf('0x1e')];_0x2783e6+=0x1){_0x4b1f72[_0x384b06](util[_0x1bcf('0x1c')](_0x1bcf('0x1f'),_0x193edf['Agents'][_0x2783e6][_0x1bcf('0x4')]));}}}function joinOrLeave(_0x462c45,_0x563085,_0x4c028c){var _0x11f22c;if(_0x462c45[_0x1bcf('0x20')][_0x1bcf('0x21')]['id']){db[_0x1bcf('0x19')][_0x1bcf('0x22')]({'attributes':['id',_0x1bcf('0x4'),'role',_0x1bcf('0x23')],'where':{'id':_0x462c45[_0x1bcf('0x20')][_0x1bcf('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x1bcf('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x1bcf('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bcf('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1bcf('0x27')],'as':_0x1bcf('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x1bcf('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bcf('0x2a')],'as':_0x1bcf('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x1bcf('0x16')](function(_0x9ede1f){if(_0x9ede1f){_0x11f22c=_0x9ede1f;_0x462c45[_0x563085](util[_0x1bcf('0x1c')](_0x1bcf('0x1f'),_0x9ede1f[_0x1bcf('0x4')]));var _0x28d2ed=[];switch(_0x9ede1f[_0x1bcf('0x2c')]){case'admin':_0x462c45[_0x563085](_0x1bcf('0x2d'));_0x462c45[_0x563085]('voice:outbound');if(queryQueues[_0x1bcf('0x2e')](_0x1bcf('0x2f'))){delete queryQueues[_0x1bcf('0x2f')];}_0x28d2ed[_0x1bcf('0x30')](db[_0x1bcf('0x31')][_0x1bcf('0x12')](queryQueues));_0x28d2ed[_0x1bcf('0x30')](db[_0x1bcf('0x32')][_0x1bcf('0x12')](queryQueues));_0x28d2ed['push'](db[_0x1bcf('0x33')]['findAll'](queryQueues));_0x28d2ed[_0x1bcf('0x30')](db[_0x1bcf('0x34')][_0x1bcf('0x12')](queryQueues));_0x28d2ed[_0x1bcf('0x30')](db['MailQueue'][_0x1bcf('0x12')](queryQueues));_0x28d2ed[_0x1bcf('0x30')](db[_0x1bcf('0x35')]['findAll'](queryQueues));_0x28d2ed['push'](db['WhatsappQueue'][_0x1bcf('0x12')](queryQueues));_0x28d2ed['push'](db[_0x1bcf('0x19')][_0x1bcf('0x12')](queryTelephones));_0x28d2ed['push'](db[_0x1bcf('0x36')][_0x1bcf('0x12')](queryTrunks));_0x28d2ed[_0x1bcf('0x30')](db['Campaign']['findAll'](queryCampaigns));_0x28d2ed[_0x1bcf('0x30')](db[_0x1bcf('0x19')][_0x1bcf('0x12')](queryAgents));break;case _0x1bcf('0x37'):_0x462c45[_0x563085](_0x1bcf('0x2d'));_0x462c45[_0x563085](_0x1bcf('0x38'));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0xb'),_0x9ede1f[_0x1bcf('0x23')],'VoiceQueue'));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0xc'),_0x9ede1f[_0x1bcf('0x23')],_0x1bcf('0x32')));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0xd'),_0x9ede1f[_0x1bcf('0x23')],'FaxQueue'));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0xe'),_0x9ede1f[_0x1bcf('0x23')],_0x1bcf('0x34')));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0xf'),_0x9ede1f[_0x1bcf('0x23')],'MailQueue'));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0x10'),_0x9ede1f[_0x1bcf('0x23')],'OpenchannelQueue'));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0x11'),_0x9ede1f['userProfileId'],_0x1bcf('0x39')));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0x13'),_0x9ede1f[_0x1bcf('0x23')],_0x1bcf('0x19')));_0x28d2ed[_0x1bcf('0x30')](getAssociatedResources(_0x1bcf('0x14'),_0x9ede1f[_0x1bcf('0x23')],_0x1bcf('0x36')));_0x28d2ed['push'](getAssociatedResources(_0x1bcf('0x3a'),_0x9ede1f[_0x1bcf('0x23')],'Campaign'));_0x28d2ed[_0x1bcf('0x30')](db[_0x1bcf('0x19')][_0x1bcf('0x12')](queryAgents));break;case _0x1bcf('0x7'):_0x462c45[_0x563085]('voice:inbound');_0x462c45[_0x563085](_0x1bcf('0x38'));_0x28d2ed[_0x1bcf('0x30')](_0x9ede1f[_0x1bcf('0x3b')]({'attributes':['id',_0x1bcf('0x4')]}));_0x28d2ed[_0x1bcf('0x30')](_0x9ede1f[_0x1bcf('0x3c')]({'attributes':['id',_0x1bcf('0x4')]}));_0x28d2ed[_0x1bcf('0x30')](_0x9ede1f[_0x1bcf('0x3d')]({'attributes':['id','name']}));_0x28d2ed[_0x1bcf('0x30')](_0x9ede1f['getSmsQueues']({'attributes':['id',_0x1bcf('0x4')]}));_0x28d2ed[_0x1bcf('0x30')](_0x9ede1f[_0x1bcf('0x3e')]({'attributes':['id',_0x1bcf('0x4')]}));_0x28d2ed[_0x1bcf('0x30')](_0x9ede1f[_0x1bcf('0x3f')]({'attributes':['id',_0x1bcf('0x4')]}));_0x28d2ed['push'](_0x9ede1f['getWhatsappQueues']({'attributes':['id',_0x1bcf('0x4')]}));break;}return BPromise[_0x1bcf('0x40')](_0x28d2ed);}})[_0x1bcf('0x16')](function(_0x347a55){if(_0x347a55&&_0x347a55[_0x1bcf('0x1e')]){for(var _0x4541dc=0x0;_0x4541dc<_0x347a55[_0x1bcf('0x1e')];_0x4541dc+=0x1){for(var _0x466fa6=0x0;_0x466fa6<_0x347a55[_0x4541dc]['length'];_0x466fa6+=0x1){switch(_0x4541dc){case 0x0:joinOrLeaveQueues(_0x462c45,_0x563085,_0x1bcf('0x41'),_0x347a55[_0x4541dc][_0x466fa6]);break;case 0x1:joinOrLeaveQueues(_0x462c45,_0x563085,_0x1bcf('0x42'),_0x347a55[_0x4541dc][_0x466fa6]);break;case 0x2:joinOrLeaveQueues(_0x462c45,_0x563085,_0x1bcf('0x43'),_0x347a55[_0x4541dc][_0x466fa6]);break;case 0x3:joinOrLeaveQueues(_0x462c45,_0x563085,_0x1bcf('0x44'),_0x347a55[_0x4541dc][_0x466fa6]);break;case 0x4:joinOrLeaveQueues(_0x462c45,_0x563085,_0x1bcf('0x45'),_0x347a55[_0x4541dc][_0x466fa6]);break;case 0x5:joinOrLeaveQueues(_0x462c45,_0x563085,_0x1bcf('0x46'),_0x347a55[_0x4541dc][_0x466fa6]);break;case 0x6:joinOrLeaveQueues(_0x462c45,_0x563085,_0x1bcf('0x47'),_0x347a55[_0x4541dc][_0x466fa6]);break;case 0x7:if(_0x11f22c[_0x1bcf('0x2c')]!=='agent')_0x462c45[_0x563085](util['format'](_0x1bcf('0x48'),_0x347a55[_0x4541dc][_0x466fa6][_0x1bcf('0x4')]));break;case 0x8:if(_0x11f22c[_0x1bcf('0x2c')]!==_0x1bcf('0x7'))_0x462c45[_0x563085](util[_0x1bcf('0x1c')]('trunk:%s',_0x347a55[_0x4541dc][_0x466fa6][_0x1bcf('0x4')]));break;case 0x9:if(_0x11f22c[_0x1bcf('0x2c')]!==_0x1bcf('0x7'))_0x462c45[_0x563085](util[_0x1bcf('0x1c')](_0x1bcf('0x49'),_0x347a55[_0x4541dc][_0x466fa6][_0x1bcf('0x8')],_0x347a55[_0x4541dc][_0x466fa6][_0x1bcf('0x4')]));break;case 0xa:_0x462c45[_0x563085](util[_0x1bcf('0x1c')](_0x1bcf('0x1f'),_0x347a55[_0x4541dc][_0x466fa6][_0x1bcf('0x4')]));break;}}}}})[_0x1bcf('0x16')](function(){if(_0x563085==='leave'){var _0x48a4a9=_[_0x1bcf('0x17')](_0x11f22c[_0x1bcf('0x24')],'id');return _0x11f22c[_0x1bcf('0x4a')](_0x48a4a9)['then'](function(){for(var _0x29e510=0x0;_0x29e510<_0x48a4a9[_0x1bcf('0x1e')];_0x29e510+=0x1){_0x4c028c[_0x1bcf('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x48a4a9[_0x29e510]),'UserId':Number(_0x11f22c['id'])});}});}})[_0x1bcf('0x16')](function(){if(_0x563085===_0x1bcf('0x4c')){var _0x2250fe=_[_0x1bcf('0x17')](_0x11f22c[_0x1bcf('0x25')],'id');return _0x11f22c[_0x1bcf('0x4d')](_0x2250fe)[_0x1bcf('0x16')](function(){for(var _0x38dd1e=0x0;_0x38dd1e<_0x2250fe[_0x1bcf('0x1e')];_0x38dd1e+=0x1){_0x4c028c[_0x1bcf('0x4b')](_0x1bcf('0x4e'),{'MailInteractionId':Number(_0x2250fe[_0x38dd1e]),'UserId':Number(_0x11f22c['id'])});}});}})[_0x1bcf('0x16')](function(){if(_0x563085===_0x1bcf('0x4c')){var _0x57ab67=_['map'](_0x11f22c[_0x1bcf('0x4f')],'id');return _0x11f22c[_0x1bcf('0x50')](_0x57ab67)[_0x1bcf('0x16')](function(){for(var _0x3d8d48=0x0;_0x3d8d48<_0x57ab67[_0x1bcf('0x1e')];_0x3d8d48+=0x1){_0x4c028c[_0x1bcf('0x4b')](_0x1bcf('0x51'),{'FaxInteractionId':Number(_0x57ab67[_0x3d8d48]),'UserId':Number(_0x11f22c['id'])});}});}})[_0x1bcf('0x16')](function(){if(_0x563085===_0x1bcf('0x4c')){var _0x2182e9=_[_0x1bcf('0x17')](_0x11f22c['SmsInteractions'],'id');return _0x11f22c['removeSmsInteractions'](_0x2182e9)[_0x1bcf('0x16')](function(){for(var _0x5bcfd9=0x0;_0x5bcfd9<_0x2182e9[_0x1bcf('0x1e')];_0x5bcfd9+=0x1){_0x4c028c['emit'](_0x1bcf('0x52'),{'SmsInteractionId':Number(_0x2182e9[_0x5bcfd9]),'UserId':Number(_0x11f22c['id'])});}});}})[_0x1bcf('0x16')](function(){if(_0x563085===_0x1bcf('0x4c')){var _0x18a590=_['map'](_0x11f22c['OpenchannelInteractions'],'id');return _0x11f22c[_0x1bcf('0x53')](_0x18a590)[_0x1bcf('0x16')](function(){for(var _0x1818cf=0x0;_0x1818cf<_0x18a590[_0x1bcf('0x1e')];_0x1818cf+=0x1){_0x4c028c[_0x1bcf('0x4b')](_0x1bcf('0x54'),{'OpenchannelInteractionId':Number(_0x18a590[_0x1818cf]),'UserId':Number(_0x11f22c['id'])});}});}})[_0x1bcf('0x16')](function(){if(_0x563085===_0x1bcf('0x4c')){var _0x19517f=_[_0x1bcf('0x17')](_0x11f22c[_0x1bcf('0x2b')],'id');return _0x11f22c[_0x1bcf('0x55')](_0x19517f)[_0x1bcf('0x16')](function(){for(var _0x8627f=0x0;_0x8627f<_0x19517f['length'];_0x8627f+=0x1){_0x4c028c[_0x1bcf('0x4b')](_0x1bcf('0x56'),{'WhatsappInteractionId':Number(_0x19517f[_0x8627f]),'UserId':Number(_0x11f22c['id'])});}});}})[_0x1bcf('0x57')](function(_0x1c9c9c){_0x462c45['log'](_0x1c9c9c);});}}function onDisconnect(_0x4fd9cd,_0x395fbe){joinOrLeave(_0x4fd9cd,_0x1bcf('0x4c'),_0x395fbe);}function onConnect(_0x519c77){joinOrLeave(_0x519c77,_0x1bcf('0x58'));}exports[_0x1bcf('0x59')]=function(_0xa7405a){_0xa7405a['on'](_0x1bcf('0x5a'),function(_0x3fb1d4){_0x3fb1d4[_0x1bcf('0x5b')](0x0);_0x3fb1d4[_0x1bcf('0x5c')]=_0x3fb1d4[_0x1bcf('0x5d')][_0x1bcf('0x5a')][_0x1bcf('0x5e')]+':'+_0x3fb1d4[_0x1bcf('0x5d')][_0x1bcf('0x5a')][_0x1bcf('0x5f')];_0x3fb1d4[_0x1bcf('0x60')]=new Date();_0x3fb1d4[_0x1bcf('0x61')]=function(_0x48d0ec){console[_0x1bcf('0x61')](_0x1bcf('0x62')+_0x3fb1d4['nsp'][_0x1bcf('0x4')]+'['+_0x3fb1d4[_0x1bcf('0x5c')]+']',_0x48d0ec);};_0x3fb1d4['on'](_0x1bcf('0x63'),function(){onDisconnect(_0x3fb1d4,_0xa7405a);_0x3fb1d4[_0x1bcf('0x61')](_0x1bcf('0x64'));});onConnect(_0x3fb1d4);_0x3fb1d4[_0x1bcf('0x61')](_0x1bcf('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 215c47e..1416a7b 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 _0x1bb6=['toLowerCase','condition','util','../../mysqldb','../logger','client','Chat','afterCreate','newinteraction','ChatInteraction','closedinteraction','newmessage','ChatOfflineMessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','sequelize','Sequelize','QueryTypes','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','catch','AfterCreateMessage','offlineMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','SELECT','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','email','internal','default','length','hasOwnProperty','model','hook','callback'];(function(_0x27d020,_0x3e50af){var _0x14a24b=function(_0x2cf88b){while(--_0x2cf88b){_0x27d020['push'](_0x27d020['shift']());}};_0x14a24b(++_0x3e50af);}(_0x1bb6,0x136));var _0x61bb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1bb6[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x61bb('0x0'));var db=require(_0x61bb('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x61bb('0x2'))('triggers');var client=jayson[_0x61bb('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x61bb('0x4'),'model':'ChatInteraction','event':_0x61bb('0x5'),'condition':_0x61bb('0x6'),'callback':afterCreate},{'channel':_0x61bb('0x4'),'model':_0x61bb('0x7'),'event':'afterUpdate','condition':_0x61bb('0x8'),'callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':'afterCreate','condition':_0x61bb('0x9'),'callback':afterCreateMessage},{'channel':_0x61bb('0x4'),'model':_0x61bb('0xa'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x9'),'callback':afterCreateOfflineMessage},{'channel':_0x61bb('0xb'),'model':'SmsInteraction','event':_0x61bb('0x5'),'condition':_0x61bb('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0x61bb('0xc'),'event':_0x61bb('0xd'),'condition':_0x61bb('0x8'),'callback':afterUpdate},{'channel':_0x61bb('0xb'),'model':_0x61bb('0xe'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x9'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x61bb('0x5'),'condition':_0x61bb('0x6'),'callback':afterCreate},{'channel':_0x61bb('0xf'),'model':_0x61bb('0x10'),'event':_0x61bb('0xd'),'condition':_0x61bb('0x8'),'callback':afterUpdate},{'channel':_0x61bb('0xf'),'model':_0x61bb('0x11'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x9'),'callback':afterCreateMessage},{'channel':_0x61bb('0x12'),'model':_0x61bb('0x13'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x6'),'callback':afterCreate},{'channel':_0x61bb('0x12'),'model':_0x61bb('0x13'),'event':'afterUpdate','condition':_0x61bb('0x8'),'callback':afterUpdate},{'channel':_0x61bb('0x12'),'model':_0x61bb('0x14'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x9'),'callback':afterCreateMessage},{'channel':_0x61bb('0x15'),'model':_0x61bb('0x16'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x6'),'callback':afterCreate},{'channel':_0x61bb('0x15'),'model':_0x61bb('0x16'),'event':_0x61bb('0xd'),'condition':_0x61bb('0x8'),'callback':afterUpdate},{'channel':'Mail','model':_0x61bb('0x17'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x9'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x61bb('0x18'),'event':_0x61bb('0x5'),'condition':_0x61bb('0x6'),'callback':afterCreate},{'channel':_0x61bb('0x19'),'model':_0x61bb('0x18'),'event':'afterUpdate','condition':_0x61bb('0x8'),'callback':afterUpdate},{'channel':_0x61bb('0x19'),'model':_0x61bb('0x1a'),'event':_0x61bb('0x5'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x3d9332){return client[_0x61bb('0x1b')](_0x61bb('0x1c'),_0x3d9332)[_0x61bb('0x1d')](function(_0x4ce22c){logger[_0x61bb('0x1e')]('Trigger,\x20%s',_0x61bb('0x1c'),_0x4ce22c);if(_0x4ce22c['error']){if(_0x4ce22c[_0x61bb('0x1f')][_0x61bb('0x20')]===0x1f4){logger['error'](_0x61bb('0x21'),_0x61bb('0x1c'),_0x4ce22c[_0x61bb('0x1f')]);}}})['catch'](function(_0x3466f7){logger['error'](_0x61bb('0x21'),'EventManager',_0x3466f7);});}function afterCreateMessage(_0x3930ca){return function(_0x448b7c){_0x448b7c=_0x448b7c[_0x61bb('0x22')]({'plain':!![]});_0x448b7c[_0x61bb('0x23')]=_0x3930ca;_0x448b7c[_0x61bb('0x24')]=_0x3930ca;_0x448b7c[_0x61bb('0x25')]=_0x448b7c[_0x61bb('0x26')];Promise[_0x61bb('0x27')]()['then'](function(){if(typeof _0x448b7c[_0x61bb('0x28')]===_0x61bb('0x29'))return null;var _0x20e6d7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x448b7c['ContactId'];return db[_0x61bb('0x2a')]['query'](_0x20e6d7,{'type':db[_0x61bb('0x2b')][_0x61bb('0x2c')]['SELECT'],'raw':!![]});})[_0x61bb('0x1d')](function(_0x5b57fb){if(_0x5b57fb){_0x448b7c[_0x61bb('0x2d')]=_0x5b57fb[0x0];}if(typeof _0x448b7c['UserId']==='undefined')return;return getAgent(_0x448b7c[_0x61bb('0x2e')]);})[_0x61bb('0x1d')](function(_0x57005d){if(_0x57005d){_0x448b7c[_0x61bb('0x2f')]=util[_0x61bb('0x30')](_0x61bb('0x31'),_0x57005d[_0x61bb('0x32')]);_0x448b7c[_0x61bb('0x33')]=_0x57005d;_0x448b7c['channel']=_0x3930ca;return request({'event':_0x61bb('0x34'),'message':_0x448b7c});}else{return request({'event':_0x61bb('0x35'),'message':_0x448b7c});}})[_0x61bb('0x36')](function(_0x1cc9d5){logger['error'](_0x61bb('0x21'),_0x61bb('0x37'),_0x1cc9d5);});};}function afterCreateOfflineMessage(_0x67e395){return function(_0x2ed85b){_0x2ed85b=_0x2ed85b['get']({'plain':!![]});_0x2ed85b['channel']=_0x67e395;_0x2ed85b[_0x61bb('0x24')]=_0x67e395;_0x2ed85b[_0x61bb('0x25')]=_0x61bb('0x38');return request({'event':_0x2ed85b[_0x61bb('0x25')],'message':_0x2ed85b});};}function afterCreate(_0x53a0f4,_0x19b5e4){return function(_0x52e01b){_0x52e01b=_0x52e01b['get']({'plain':!![]});_0x52e01b[_0x61bb('0x23')]=_0x53a0f4;_0x52e01b['motionChannel']=_0x53a0f4;_0x52e01b['event']='opened';Promise[_0x61bb('0x27')]()[_0x61bb('0x1d')](function(){var _0x11c799=_0x61bb('0x39')+_0x52e01b['ContactId'];return db[_0x61bb('0x2a')][_0x61bb('0x3a')](_0x11c799,{'type':db[_0x61bb('0x2b')][_0x61bb('0x2c')][_0x61bb('0x3b')],'raw':!![]});})['then'](function(_0x54104a){if(_0x54104a){_0x52e01b[_0x61bb('0x2d')]=_0x54104a[0x0];}if(typeof _0x52e01b[_0x61bb('0x2e')]==='undefined')return;return getAgent(_0x52e01b[_0x61bb('0x2e')]);})['then'](function(_0x2f1e6e){if(_0x2f1e6e){_0x52e01b[_0x61bb('0x2f')]=util[_0x61bb('0x30')](_0x61bb('0x31'),_0x2f1e6e[_0x61bb('0x32')]);_0x52e01b[_0x61bb('0x33')]=_0x2f1e6e;}return request({'event':_0x19b5e4,'message':_0x52e01b});})[_0x61bb('0x36')](function(_0x21d22b){logger['error'](_0x61bb('0x21'),_0x61bb('0x3c'),_0x21d22b);});};}function afterUpdate(_0x2af434){return function(_0x5bf1d5){var _0x544105=_0x5bf1d5[_0x61bb('0x3d')]('closed')&&_0x5bf1d5[_0x61bb('0x3e')];var _0x41681d=_0x5bf1d5[_0x61bb('0x3d')]('substatus');if(_0x544105||_0x41681d){var _0x2e816c=_0x544105?'closedinteraction':_0x61bb('0x3f');var _0x58cb9e=_0x5bf1d5['get']({'plain':!![]});_0x58cb9e['channel']=_0x2af434;_0x58cb9e[_0x61bb('0x24')]=_0x2af434;_0x58cb9e[_0x61bb('0x25')]=_0x544105?_0x61bb('0x3e'):_0x61bb('0x3f');var _0x3763df='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x58cb9e[_0x61bb('0x28')];return db[_0x61bb('0x2a')][_0x61bb('0x3a')](_0x3763df,{'type':db[_0x61bb('0x2b')][_0x61bb('0x2c')]['SELECT'],'raw':!![]})[_0x61bb('0x1d')](function(_0x41de3b){if(_0x41de3b){_0x58cb9e['contact']=_0x41de3b[0x0];}if(typeof _0x58cb9e[_0x61bb('0x2e')]==='undefined')return;return getAgent(_0x58cb9e[_0x61bb('0x2e')]);})[_0x61bb('0x1d')](function(_0x41c802){if(_0x41c802){_0x58cb9e['interface']=util[_0x61bb('0x30')](_0x61bb('0x31'),_0x41c802[_0x61bb('0x32')]);_0x58cb9e[_0x61bb('0x33')]=_0x41c802;}return request({'event':_0x2e816c,'message':_0x58cb9e});})[_0x61bb('0x36')](function(_0x38b162){logger[_0x61bb('0x1f')](_0x61bb('0x21'),_0x61bb('0x40'),_0x38b162);});}};}function getAgent(_0x52e63d){return db[_0x61bb('0x41')][_0x61bb('0x42')]({'where':{'id':_0x52e63d},'attributes':['id',_0x61bb('0x32'),'fullname',_0x61bb('0x43'),_0x61bb('0x44')],'raw':!![]})['then'](function(_0x48e06f){return _0x48e06f;});}exports[_0x61bb('0x45')]=function(){for(var _0x3c020e=0x0;_0x3c020e=_0x5c9878['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4a3a12(_0x2cb508);})['catch'](function(_0x4172c8){_0x175680(_0x4172c8);});});}; \ No newline at end of file +var _0x4050=['then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','sms','getChannels','isValidChannel','includes','clearBlockUser','updateAttributes','agent','User','count'];(function(_0x4c7110,_0x4255c6){var _0x5e0651=function(_0x50f559){while(--_0x50f559){_0x4c7110['push'](_0x4c7110['shift']());}};_0x5e0651(++_0x4255c6);}(_0x4050,0xec));var _0x0405=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x4050[_0x35d4e9];return _0x5c2770;};'use strict';var _=require(_0x0405('0x0'));var BPromise=require(_0x0405('0x1'));var db=require(_0x0405('0x2'))['db'];var util=require(_0x0405('0x3'));var channels=[_0x0405('0x4'),_0x0405('0x5'),_0x0405('0x6'),'fax',_0x0405('0x7'),'whatsapp','openchannel'];exports[_0x0405('0x8')]=function(){return channels;};exports[_0x0405('0x9')]=function(_0x28799f){_0x28799f=_0x28799f['toLowerCase']();return _[_0x0405('0xa')](channels,_0x28799f);};exports[_0x0405('0xb')]=function(_0x7214cc,_0x409f0e,_0x35c8db,_0x33b94e){var _0x198a78={'loginAttempts':_0x409f0e,'blocked':_0x35c8db};if(!_['isUndefined'](_0x33b94e)){_0x198a78['blockedAt']=_0x33b94e;}return _0x7214cc[_0x0405('0xc')](_0x198a78);};exports['getLicense']=function(_0x34e2f8){return new BPromise(function(_0x15f653,_0x2d7a96){var _0x4e254f=0x0;if(_0x34e2f8['role']!==_0x0405('0xd')){_0x15f653(_0x34e2f8);}db[_0x0405('0xe')][_0x0405('0xf')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x34e2f8['id']}}})[_0x0405('0x10')](function(_0x2fb43f){_0x4e254f=_0x2fb43f;return util[_0x0405('0x11')]();})[_0x0405('0x10')](function(_0x1b9620){if(_0x1b9620&&_0x1b9620[_0x0405('0x12')]&&_0x4e254f>=_0x1b9620['agents']){throw Error(_0x0405('0x13'));}_0x15f653(_0x34e2f8);})[_0x0405('0x14')](function(_0x230b63){_0x2d7a96(_0x230b63);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 8d6a07d..060f324 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa455=['Resource\x20Conflict','Conflict','error','stack','statusMessage','status','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval'];(function(_0x22b430,_0x1aede5){var _0x338d2a=function(_0x1335f7){while(--_0x1335f7){_0x22b430['push'](_0x22b430['shift']());}};_0x338d2a(++_0x1aede5);}(_0xa455,0x13f));var _0x5a45=function(_0x8d6414,_0x28e959){_0x8d6414=_0x8d6414-0x0;var _0x5ddef1=_0xa455[_0x8d6414];return _0x5ddef1;};'use strict';var util=require(_0x5a45('0x0'));var logger=require(_0x5a45('0x1'))(_0x5a45('0x2'));var APIError=function(_0x2e86c5,_0xb86ab1){this[_0x5a45('0x3')]=_0x2e86c5||_0x5a45('0x4');this[_0x5a45('0x5')]=_0xb86ab1||_0x5a45('0x6');util[_0x5a45('0x7')](APIError,Error);};var APIBadRequestError=function(_0x1b38f1){this[_0x5a45('0x3')]=_0x1b38f1||'Bad\x20Request';this['name']=_0x5a45('0x8');util[_0x5a45('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x3686c6){this[_0x5a45('0x3')]=_0x3686c6||_0x5a45('0x9');this[_0x5a45('0x5')]='Forbidden';util[_0x5a45('0x7')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x4ae2e3){this[_0x5a45('0x3')]=_0x4ae2e3||_0x5a45('0xa');this[_0x5a45('0x5')]=_0x5a45('0xb');util[_0x5a45('0x7')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x1ea718){this[_0x5a45('0x3')]=_0x1ea718||_0x5a45('0xc');this[_0x5a45('0x5')]=_0x5a45('0xd');this[_0x5a45('0xe')]=0x193;this[_0x5a45('0xf')]={'type':_0x5a45('0x10')};util[_0x5a45('0x7')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x8431b0){this[_0x5a45('0x3')]=_0x8431b0||_0x5a45('0x11');this['name']=_0x5a45('0x12');util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x2693f5){switch(_0x2693f5){case _0x5a45('0x8'):return 0x190;case _0x5a45('0x9'),_0x5a45('0xd'):return 0x193;case _0x5a45('0xb'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x3a61d7){if(_0x3a61d7==='Out\x20Of\x20Interval')return _0x3a61d7;return null;}function handleError(_0x58dc9f){return function(_0x36acd6){logger[_0x5a45('0x13')](_0x36acd6[_0x5a45('0x14')]);var _0x45421e=getStatusCode(_0x36acd6[_0x5a45('0x5')]);var _0x4a25d4=getCustomStatusMessage(_0x36acd6['name']);if(_0x36acd6['name']){delete _0x36acd6['name'];}if(_0x4a25d4){_0x58dc9f[_0x5a45('0x15')]=_0x4a25d4;}return _0x58dc9f[_0x5a45('0x16')](_0x45421e)['send'](_0x36acd6);};}module[_0x5a45('0x17')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x462a=['name','Forbidden','Entity\x20not\x20found','Not\x20Found','Out\x20Of\x20Interval','OutOfInterval','Conflict','error','stack','statusMessage','exports','api','Internal\x20Server\x20Error','inherits','message','Bad\x20Request'];(function(_0x4e85eb,_0x27a8b0){var _0xa68701=function(_0x5bd845){while(--_0x5bd845){_0x4e85eb['push'](_0x4e85eb['shift']());}};_0xa68701(++_0x27a8b0);}(_0x462a,0xcb));var _0xa462=function(_0x4a2217,_0x9c653a){_0x4a2217=_0x4a2217-0x0;var _0x24cb1c=_0x462a[_0x4a2217];return _0x24cb1c;};'use strict';var util=require('util');var logger=require('../config/logger')(_0xa462('0x0'));var APIError=function(_0x5964bb,_0x43c575){this['message']=_0x5964bb||_0xa462('0x1');this['name']=_0x43c575||'Error';util[_0xa462('0x2')](APIError,Error);};var APIBadRequestError=function(_0x43b54c){this[_0xa462('0x3')]=_0x43b54c||_0xa462('0x4');this[_0xa462('0x5')]=_0xa462('0x4');util[_0xa462('0x2')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x4dae46){this['message']=_0x4dae46||_0xa462('0x6');this[_0xa462('0x5')]='Forbidden';util[_0xa462('0x2')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x2ed733){this[_0xa462('0x3')]=_0x2ed733||_0xa462('0x7');this[_0xa462('0x5')]=_0xa462('0x8');util[_0xa462('0x2')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0xaa4322){this[_0xa462('0x3')]=_0xaa4322||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0xa462('0x5')]=_0xa462('0x9');this['code']=0x193;this['details']={'type':_0xa462('0xa')};util[_0xa462('0x2')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x42afc8){this['message']=_0x42afc8||'Resource\x20Conflict';this[_0xa462('0x5')]=_0xa462('0xb');util[_0xa462('0x2')](APIBadRequestError,APIError);};function getStatusCode(_0x95e031){switch(_0x95e031){case _0xa462('0x4'):return 0x190;case _0xa462('0x6'),'Out\x20Of\x20Interval':return 0x193;case _0xa462('0x8'):return 0x194;case _0xa462('0xb'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x2d8729){if(_0x2d8729===_0xa462('0x9'))return _0x2d8729;return null;}function handleError(_0x4535c0){return function(_0x4c7f87){logger[_0xa462('0xc')](_0x4c7f87[_0xa462('0xd')]);var _0x697308=getStatusCode(_0x4c7f87['name']);var _0x304653=getCustomStatusMessage(_0x4c7f87['name']);if(_0x4c7f87[_0xa462('0x5')]){delete _0x4c7f87[_0xa462('0x5')];}if(_0x304653){_0x4535c0[_0xa462('0xe')]=_0x304653;}return _0x4535c0['status'](_0x697308)['send'](_0x4c7f87);};}module[_0xa462('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 053c9f8..9188138 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfac8=['exports','404','status','render','json'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfac8,0x190));var _0x8fac=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0xfac8[_0x9d639c];return _0x1671de;};'use strict';module[_0x8fac('0x0')][0x194]=function pageNotFound(_0x58d87d,_0x280366){var _0x2eb0ee=_0x8fac('0x1');var _0xbb9727=0x194;var _0x1fe52c={'status':_0xbb9727};_0x280366['status'](_0x1fe52c[_0x8fac('0x2')]);_0x280366[_0x8fac('0x3')](_0x2eb0ee,{},function(_0x3aa608,_0x387e46){if(_0x3aa608){return _0x280366[_0x8fac('0x2')](_0x1fe52c[_0x8fac('0x2')])[_0x8fac('0x4')](_0x1fe52c);}_0x280366['send'](_0x387e46);});}; \ No newline at end of file +var _0xd1d3=['render','json','status'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xd1d3,0x68));var _0x3d1d=function(_0x2f5cbf,_0x3910c8){_0x2f5cbf=_0x2f5cbf-0x0;var _0xfccd3e=_0xd1d3[_0x2f5cbf];return _0xfccd3e;};'use strict';module['exports'][0x194]=function pageNotFound(_0xe5c66e,_0x34204c){var _0x501a91='404';var _0x50fc0b=0x194;var _0x184f71={'status':_0x50fc0b};_0x34204c[_0x3d1d('0x0')](_0x184f71['status']);_0x34204c[_0x3d1d('0x1')](_0x501a91,{},function(_0xaf1915,_0x5ed012){if(_0xaf1915){return _0x34204c[_0x3d1d('0x0')](_0x184f71[_0x3d1d('0x0')])[_0x3d1d('0x2')](_0x184f71);}_0x34204c['send'](_0x5ed012);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index bc31c92..61f54af 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb72a=['Interactions','MailApplication','ListId','TemplateId','team_has_mail_queues','Teams','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatOfflineMessage','TagId','MailQueueReport','Contact','DashboardItem','Items','FaxAccountId','Answers','Exntensions','List','FaxInteractionId','fax_interaction_has_tags','AttachmentId','Dispositions','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatWebsiteId','user_has_chat_websites','Agent','Queue','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','team_has_chat_queues','CompanyId','Phones','CmContactId','JscriptySessions','Company','cm_contact_has_tags','CmHopperId','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','Subject','FieldId','Variable','Descriptions','Description','Field','VariableId','int_desk_configuration_has_tags','ZohoConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','ChatQueueReport','FromId','SessionId','ProjectId','team_has_fax_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Extensions','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','sequelizeHistory','xcall','name','utf8_general_ci','database','password','username','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','VoiceMail','cascade','UserId','Recordings','hasMany','VoiceExtension','HopperFinals','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','Hoppers','SET\x20NULL','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueue','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','UserWhatsappQueue','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','Members','CmHopper','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailServerIn','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','hasOne','Smtp','Messages'];(function(_0xc2e46e,_0x3b979c){var _0x1a355d=function(_0x2cd000){while(--_0x2cd000){_0xc2e46e['push'](_0xc2e46e['shift']());}};_0x1a355d(++_0x3b979c);}(_0xb72a,0x8e));var _0xab72=function(_0x5c416d,_0x1452fc){_0x5c416d=_0x5c416d-0x0;var _0x27f533=_0xb72a[_0x5c416d];return _0x27f533;};'use strict';var config=require(_0xab72('0x0'));var Sequelize=require(_0xab72('0x1'));var _=require(_0xab72('0x2'));var jstz=require(_0xab72('0x3'));var timezone=jstz[_0xab72('0x4')]();config[_0xab72('0x1')]=_[_0xab72('0x5')](config[_0xab72('0x1')],{'database':_0xab72('0x6'),'username':'xcall','password':_0xab72('0x7'),'options':{'host':_0xab72('0x8'),'port':0xcea,'dialect':_0xab72('0x9'),'dialectOptions':{'charset':_0xab72('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xab72('0xb'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xab72('0x5')](config[_0xab72('0xc')],{'database':_0xab72('0x6'),'username':_0xab72('0xd'),'password':_0xab72('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xab72('0x9'),'dialectOptions':{'charset':_0xab72('0xa')},'logging':![],'timezone':timezone[_0xab72('0xe')](),'define':{'charset':_0xab72('0xb'),'collate':_0xab72('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xab72('0x10')],config[_0xab72('0x1')]['username'],config[_0xab72('0x1')][_0xab72('0x11')],config[_0xab72('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xab72('0xc')][_0xab72('0x10')],config[_0xab72('0xc')][_0xab72('0x12')],config[_0xab72('0xc')][_0xab72('0x11')],config[_0xab72('0xc')][_0xab72('0x13')])};db[_0xab72('0x14')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x16'));db['VoiceChanSpy']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x17'));db[_0xab72('0x18')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x19'));db['VoiceExtension']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x1a'));db['VoiceMusicOnHold']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x1b'));db[_0xab72('0x1c')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x1d'));db[_0xab72('0x1e')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x1f'));db[_0xab72('0x20')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x21'));db['VoiceMail']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x22'));db['VoiceMailMessage']=db[_0xab72('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xab72('0x23')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x24'));db[_0xab72('0x25')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x26'));db[_0xab72('0x27')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x28'));db[_0xab72('0x29')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x2a'));db[_0xab72('0x2b')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x2c'));db[_0xab72('0x2d')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x2e'));db['VoiceTransferReport']=db['sequelize']['import'](_0xab72('0x2f'));db[_0xab72('0x30')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xab72('0x31')]=db[_0xab72('0x1')]['import'](_0xab72('0x32'));db[_0xab72('0x33')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x34'));db[_0xab72('0x35')]=db['sequelize'][_0xab72('0x15')]('../api/userMailQueue/userMailQueue.model');db[_0xab72('0x36')]=db[_0xab72('0x1')]['import'](_0xab72('0x37'));db[_0xab72('0x38')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/userSmsQueue/userSmsQueue.model');db[_0xab72('0x39')]=db[_0xab72('0x1')]['import'](_0xab72('0x3a'));db['UserWhatsappQueue']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x3b'));db['MailServerIn']=db[_0xab72('0x1')]['import'](_0xab72('0x3c'));db['MailServerOut']=db['sequelize'][_0xab72('0x15')](_0xab72('0x3d'));db[_0xab72('0x3e')]=db['sequelize'][_0xab72('0x15')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x3f'));db[_0xab72('0x40')]=db['sequelize']['import']('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db['sequelize'][_0xab72('0x15')](_0xab72('0x41'));db[_0xab72('0x42')]=db[_0xab72('0x1')]['import'](_0xab72('0x43'));db['MailApplication']=db[_0xab72('0x1')][_0xab72('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0xab72('0x15')]('../api/mailQueueReport/mailQueueReport.model');db[_0xab72('0x44')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x45'));db['DashboardItem']=db['sequelize'][_0xab72('0x15')](_0xab72('0x46'));db[_0xab72('0x47')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x48'));db[_0xab72('0x49')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x4a'));db[_0xab72('0x4b')]=db[_0xab72('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0xab72('0x4c')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x4d'));db[_0xab72('0x4e')]=db[_0xab72('0x1')]['import'](_0xab72('0x4f'));db[_0xab72('0x50')]=db[_0xab72('0x1')]['import'](_0xab72('0x51'));db[_0xab72('0x52')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x53'));db['SmsApplication']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x54'));db[_0xab72('0x55')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x56'));db[_0xab72('0x57')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/smsMessage/smsMessage.model');db[_0xab72('0x58')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x59'));db[_0xab72('0x5a')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x5b'));db[_0xab72('0x5c')]=db['sequelize']['import'](_0xab72('0x5d'));db[_0xab72('0x5e')]=db['sequelize']['import'](_0xab72('0x5f'));db[_0xab72('0x60')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0xab72('0x61')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0xab72('0x62')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x63'));db[_0xab72('0x64')]=db['sequelize']['import'](_0xab72('0x65'));db[_0xab72('0x66')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/chatApplication/chatApplication.model');db[_0xab72('0x67')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x68'));db[_0xab72('0x69')]=db[_0xab72('0x1')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xab72('0x1')][_0xab72('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db[_0xab72('0x6a')]=db[_0xab72('0x1')]['import']('../api/chatGroup/chatGroup.model');db[_0xab72('0x6b')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x6c'));db[_0xab72('0x6d')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x6e'));db[_0xab72('0x6f')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x70'));db['CmHopper']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x71'));db['CmHopperBlack']=db[_0xab72('0x1')]['import'](_0xab72('0x72'));db[_0xab72('0x73')]=db['sequelize']['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0xab72('0x74')]=db[_0xab72('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0xab72('0x75')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x76'));db[_0xab72('0x77')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x78'));db[_0xab72('0x79')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x7a'));db[_0xab72('0x7b')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/automation/automation.model');db[_0xab72('0x7c')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x7d'));db[_0xab72('0x7e')]=db[_0xab72('0x1')]['import'](_0xab72('0x7f'));db[_0xab72('0x80')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x81'));db[_0xab72('0x82')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x83'));db[_0xab72('0x84')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x85'));db[_0xab72('0x86')]=db[_0xab72('0x1')]['import'](_0xab72('0x87'));db[_0xab72('0x88')]=db[_0xab72('0x1')]['import'](_0xab72('0x89'));db['Schedule']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x8a'));db[_0xab72('0x8b')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x8c'));db[_0xab72('0x8d')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/tag/tag.model');db[_0xab72('0x8e')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x8f'));db[_0xab72('0x90')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x91'));db[_0xab72('0x92')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x93'));db[_0xab72('0x94')]=db[_0xab72('0x1')]['import'](_0xab72('0x95'));db[_0xab72('0x96')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x97'));db['Variable']=db[_0xab72('0x1')]['import'](_0xab72('0x98'));db[_0xab72('0x99')]=db[_0xab72('0x1')]['import'](_0xab72('0x9a'));db['IntegrationReport']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x9b'));db[_0xab72('0x9c')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x9d'));db[_0xab72('0x9e')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x9f'));db[_0xab72('0xa0')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xa1'));db[_0xab72('0xa2')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xa3'));db['AnalyticFieldReport']=db[_0xab72('0x1')]['import'](_0xab72('0xa4'));db[_0xab72('0xa5')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xa6'));db[_0xab72('0xa7')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xa8'));db[_0xab72('0xa9')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xab72('0xaa')]=db[_0xab72('0x1')]['import'](_0xab72('0xab'));db[_0xab72('0xac')]=db['sequelize'][_0xab72('0x15')](_0xab72('0xad'));db[_0xab72('0xae')]=db['sequelize'][_0xab72('0x15')](_0xab72('0xaf'));db[_0xab72('0xb0')]=db[_0xab72('0x1')]['import'](_0xab72('0xb1'));db[_0xab72('0xb2')]=db[_0xab72('0x1')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xab72('0xb3')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xb4'));db[_0xab72('0xb5')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xb6'));db['ZohoAccount']=db[_0xab72('0x1')][_0xab72('0x15')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db['sequelize']['import'](_0xab72('0xb7'));db[_0xab72('0xb8')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/intZohoField/intZohoField.model');db[_0xab72('0xb9')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xba'));db[_0xab72('0xbb')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xbc'));db[_0xab72('0xbd')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xbe'));db[_0xab72('0xbf')]=db['sequelize'][_0xab72('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xab72('0x1')][_0xab72('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xab72('0xc0')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xc1'));db[_0xab72('0xc2')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xc3'));db[_0xab72('0xc4')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xc5'));db['VtigerField']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xc6'));db[_0xab72('0xc7')]=db['sequelize'][_0xab72('0x15')](_0xab72('0xc8'));db[_0xab72('0xc9')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xab72('0xca')]=db[_0xab72('0x1')]['import'](_0xab72('0xcb'));db[_0xab72('0xcc')]=db[_0xab72('0x1')]['import'](_0xab72('0xcd'));db[_0xab72('0xce')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xcf'));db[_0xab72('0xd0')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xd1'));db[_0xab72('0xd2')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xd3'));db[_0xab72('0xd4')]=db[_0xab72('0x1')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xab72('0xd5')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xd6'));db[_0xab72('0x99')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x9a'));db['Network']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xd7'));db['ChatQueueReport']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xd8'));db[_0xab72('0xd9')]=db['sequelize']['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0xab72('0xda')]=db[_0xab72('0x1')]['import'](_0xab72('0xdb'));db[_0xab72('0xdc')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xdd'));db[_0xab72('0xde')]=db['sequelize'][_0xab72('0x15')](_0xab72('0xdf'));db[_0xab72('0xe0')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xe1'));db[_0xab72('0xe2')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xe3'));db[_0xab72('0xe4')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xab72('0xe5')]=db[_0xab72('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0xab72('0xe6')]=db[_0xab72('0x1')]['import'](_0xab72('0xe7'));db[_0xab72('0xe8')]=db['sequelize'][_0xab72('0x15')](_0xab72('0xe9'));db[_0xab72('0xea')]=db[_0xab72('0x1')]['import'](_0xab72('0xeb'));db[_0xab72('0xec')]=db[_0xab72('0x1')]['import'](_0xab72('0xed'));db['SquareMessage']=db[_0xab72('0x1')]['import'](_0xab72('0xee'));db[_0xab72('0xef')]=db['sequelize'][_0xab72('0x15')]('../api/team/team.model');db[_0xab72('0xf0')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xf1'));db[_0xab72('0xf2')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xf3'));db[_0xab72('0xf4')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xf5'));db[_0xab72('0xf6')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xf7'));db[_0xab72('0xf8')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/plugin/plugin.model');db[_0xab72('0xf9')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xfa'));db['ChatTransferReport']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xfb'));db[_0xab72('0xfc')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0xfd'));db[_0xab72('0xfe')]=db[_0xab72('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db['sequelize'][_0xab72('0x15')](_0xab72('0xff'));db[_0xab72('0x100')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x101'));db[_0xab72('0x102')]=db['sequelize'][_0xab72('0x15')](_0xab72('0x103'));db[_0xab72('0x104')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/userProfile/userProfile.model');db[_0xab72('0x105')]=db[_0xab72('0x1')]['import'](_0xab72('0x106'));db['UserProfileResource']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x107'));db['UserNotification']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x108'));db['WhatsappAccount']=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x109'));db[_0xab72('0x10a')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x10b'));db[_0xab72('0x10c')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x10d'));db[_0xab72('0x10e')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x10f'));db[_0xab72('0x110')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x111'));db[_0xab72('0x112')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x113'));db['WhatsappQueue']=db['sequelize'][_0xab72('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0xab72('0x114')]=db['sequelize'][_0xab72('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0xab72('0x115')]=db[_0xab72('0x1')][_0xab72('0x15')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xab72('0x116')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x117'));db[_0xab72('0x118')]=db[_0xab72('0x1')][_0xab72('0x15')](_0xab72('0x119'));db[_0xab72('0x11a')]=db[_0xab72('0x1')]['import'](_0xab72('0x11b'));db[_0xab72('0x11c')]=db['sequelize'][_0xab72('0x15')]('../api/mailInteractionHasTag/mailInteractionHasTag.model');db['User']['hasOne'](db[_0xab72('0x11d')],{'as':_0xab72('0x11d'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x14')]['hasOne'](db[_0xab72('0x11a')],{'as':'userSetting','onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x11f')});db['User']['hasMany'](db['VoiceRecording'],{'as':_0xab72('0x120'),'foreignKey':'UserId'});db[_0xab72('0x14')][_0xab72('0x121')](db[_0xab72('0x30')],{'as':'VoiceQueuesRt','foreignKey':_0xab72('0x11f')});db[_0xab72('0x14')]['hasMany'](db[_0xab72('0x122')],{'as':'Extensions','onDelete':_0xab72('0x11e'),'hooks':!![]});db['User'][_0xab72('0x121')](db[_0xab72('0x73')],{'as':_0xab72('0x123'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x14')][_0xab72('0x121')](db[_0xab72('0x74')],{'as':_0xab72('0x124'),'foreignKey':'UserId'});db[_0xab72('0x14')][_0xab72('0x121')](db[_0xab72('0x75')],{'as':'ReportAgentPreview','foreignKey':_0xab72('0x11f')});db['User'][_0xab72('0x121')](db[_0xab72('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0xab72('0x11f')});db['User'][_0xab72('0x121')](db[_0xab72('0x67')],{'as':_0xab72('0x125'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x14')][_0xab72('0x121')](db[_0xab72('0x55')],{'as':_0xab72('0x126'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x14')][_0xab72('0x121')](db[_0xab72('0x4b')],{'as':_0xab72('0x127'),'foreignKey':_0xab72('0x11f')});db['User'][_0xab72('0x121')](db[_0xab72('0x128')],{'as':_0xab72('0x129'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x14')][_0xab72('0x121')](db[_0xab72('0x10c')],{'as':_0xab72('0x12a'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x14')]['hasMany'](db[_0xab72('0x12b')],{'as':_0xab72('0x12c'),'foreignKey':_0xab72('0x12d')});db['User'][_0xab72('0x121')](db['CmHopper'],{'as':_0xab72('0x12e'),'foreignKey':_0xab72('0x11f'),'onDelete':_0xab72('0x12f')});db['User'][_0xab72('0x130')](db[_0xab72('0x104')],{'as':_0xab72('0x104'),'foreignKey':_0xab72('0x131')});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x6a')],{'as':_0xab72('0x133'),'through':_0xab72('0x134')});db[_0xab72('0x14')]['belongsToMany'](db[_0xab72('0x6f')],{'as':_0xab72('0x135'),'through':_0xab72('0x136')});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x100')],{'as':'Lists','through':_0xab72('0x137')});db['User'][_0xab72('0x132')](db[_0xab72('0xef')],{'through':_0xab72('0x138')});db[_0xab72('0x14')][_0xab72('0x132')](db['MailInteraction'],{'as':_0xab72('0x129'),'through':_0xab72('0x139')});db['User'][_0xab72('0x132')](db[_0xab72('0x67')],{'as':_0xab72('0x125'),'through':_0xab72('0x13a')});db[_0xab72('0x14')]['belongsToMany'](db[_0xab72('0x4b')],{'as':_0xab72('0x127'),'through':_0xab72('0x13b')});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x55')],{'as':_0xab72('0x126'),'through':_0xab72('0x13c')});db['User'][_0xab72('0x132')](db[_0xab72('0x5e')],{'as':'OpenchannelInteractions','through':_0xab72('0x13d')});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x10c')],{'as':_0xab72('0x12a'),'through':_0xab72('0x13e')});db['User'][_0xab72('0x132')](db[_0xab72('0x1c')],{'as':'VoiceQueues','through':_0xab72('0x31'),'required':![]});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x102')],{'as':_0xab72('0x13f'),'through':_0xab72('0x118'),'required':![]});db['User'][_0xab72('0x132')](db[_0xab72('0x140')],{'as':_0xab72('0x141'),'through':_0xab72('0x35'),'required':![]});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x142')],{'as':_0xab72('0x143'),'through':_0xab72('0x33'),'required':![],'hooks':!![]});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x4e')],{'as':_0xab72('0x144'),'through':'UserFaxQueue','required':![]});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x58')],{'as':_0xab72('0x145'),'through':_0xab72('0x38'),'required':![]});db[_0xab72('0x14')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0xab72('0x146'),'through':'UserOpenchannelQueue','required':![]});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x147')],{'as':'WhatsappQueues','through':_0xab72('0x148'),'required':![]});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x100')],{'through':_0xab72('0x137')});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x62')],{'as':_0xab72('0x149'),'through':'user_has_chat_websites'});db[_0xab72('0x14')][_0xab72('0x132')](db[_0xab72('0x47')],{'as':_0xab72('0x14a'),'through':_0xab72('0x14b')});db['User'][_0xab72('0x132')](db[_0xab72('0x3e')],{'as':_0xab72('0x14c'),'through':_0xab72('0x14d')});db['User'][_0xab72('0x132')](db[_0xab72('0x5a')],{'as':_0xab72('0x14e'),'through':_0xab72('0x14f')});db[_0xab72('0x14')][_0xab72('0x132')](db['SmsAccount'],{'as':_0xab72('0x150'),'through':_0xab72('0x151')});db[_0xab72('0x14')]['belongsToMany'](db[_0xab72('0x152')],{'as':'WhatsappAccounts','through':_0xab72('0x153')});db[_0xab72('0x154')][_0xab72('0x121')](db[_0xab72('0x122')],{'as':_0xab72('0x155'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x156')});db[_0xab72('0x18')][_0xab72('0x121')](db[_0xab72('0x122')],{'onDelete':_0xab72('0x11e')});db[_0xab72('0x122')][_0xab72('0x121')](db['VoiceExtension'],{'as':_0xab72('0x157'),'onDelete':'cascade'});db[_0xab72('0x158')][_0xab72('0x132')](db[_0xab72('0x8b')],{'as':_0xab72('0x159'),'through':'moh_has_sounds'});db[_0xab72('0x1c')][_0xab72('0x121')](db[_0xab72('0x30')],{'as':_0xab72('0x15a'),'foreignKey':'VoiceQueueId'});db[_0xab72('0x1c')][_0xab72('0x121')](db[_0xab72('0x15b')],{'as':_0xab72('0x12e'),'foreignKey':_0xab72('0x15c')});db['VoiceQueue'][_0xab72('0x121')](db['CmHopperFinal'],{'as':_0xab72('0x123'),'foreignKey':_0xab72('0x15c')});db[_0xab72('0x1c')][_0xab72('0x121')](db[_0xab72('0x74')],{'as':_0xab72('0x15d'),'foreignKey':_0xab72('0x15c')});db[_0xab72('0x1c')][_0xab72('0x121')](db['ReportAgentPreview'],{'as':_0xab72('0x75'),'foreignKey':_0xab72('0x15c')});db[_0xab72('0x1c')][_0xab72('0x121')](db[_0xab72('0x15e')],{'as':_0xab72('0x15f'),'foreignKey':_0xab72('0x15c')});db[_0xab72('0x1c')][_0xab72('0x121')](db[_0xab72('0xde')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xab72('0x1c')][_0xab72('0x130')](db['Trunk'],{'as':_0xab72('0x2d'),'foreignKey':_0xab72('0x160')});db[_0xab72('0x1c')][_0xab72('0x130')](db[_0xab72('0x2d')],{'as':_0xab72('0x161'),'foreignKey':_0xab72('0x162')});db['VoiceQueue'][_0xab72('0x130')](db[_0xab72('0x82')],{'as':_0xab72('0x82'),'foreignKey':_0xab72('0x163')});db[_0xab72('0x1c')][_0xab72('0x130')](db[_0xab72('0x84')],{'as':_0xab72('0x164'),'foreignKey':_0xab72('0x165')});db[_0xab72('0x1c')][_0xab72('0x132')](db['CmList'],{'as':_0xab72('0x166'),'through':_0xab72('0x167')});db['VoiceQueue'][_0xab72('0x132')](db['User'],{'as':_0xab72('0x168'),'through':'UserVoiceQueue'});db[_0xab72('0x1c')][_0xab72('0x132')](db[_0xab72('0xef')],{'as':'Teams','through':_0xab72('0x115')});db[_0xab72('0x1c')]['belongsToMany'](db[_0xab72('0x100')],{'as':_0xab72('0x169'),'through':_0xab72('0x16a')});db['VoiceRecording'][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x14'),'foreignKey':'UserId'});db[_0xab72('0x20')][_0xab72('0x130')](db['User'],{'as':_0xab72('0x14'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x11d')][_0xab72('0x121')](db[_0xab72('0x16b')],{'as':'Messages','onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x16c'),'sourceKey':_0xab72('0x16d')});db[_0xab72('0x16b')][_0xab72('0x130')](db[_0xab72('0x11d')],{'foreignKey':_0xab72('0x16c'),'targetKey':_0xab72('0x16d')});db[_0xab72('0x23')][_0xab72('0x121')](db['VoiceQueueReport'],{'as':_0xab72('0x16e'),'foreignKey':_0xab72('0x16f'),'constraints':![]});db['VoiceCallReport'][_0xab72('0x121')](db[_0xab72('0x27')],{'as':_0xab72('0x170'),'foreignKey':_0xab72('0x16f'),'constraints':![]});db[_0xab72('0x23')]['belongsTo'](db['User'],{'as':_0xab72('0x14'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x23')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':'Contact','foreignKey':_0xab72('0x171')});db[_0xab72('0x172')]['belongsTo'](db[_0xab72('0x3e')],{'as':_0xab72('0x3e'),'foreignKey':_0xab72('0x173')});db[_0xab72('0x172')][_0xab72('0x130')](db[_0xab72('0x114')],{'as':_0xab72('0x114'),'foreignKey':_0xab72('0x174'),'onDelete':_0xab72('0x175')});db[_0xab72('0x176')][_0xab72('0x130')](db[_0xab72('0x3e')],{'as':_0xab72('0x3e'),'foreignKey':_0xab72('0x173')});db[_0xab72('0x176')][_0xab72('0x130')](db[_0xab72('0x114')],{'as':'CloudProvider','foreignKey':_0xab72('0x174'),'onDelete':_0xab72('0x175')});db[_0xab72('0x3e')]['hasOne'](db['MailServerIn'],{'as':_0xab72('0x177'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x3e')][_0xab72('0x178')](db[_0xab72('0x176')],{'as':_0xab72('0x179'),'onDelete':_0xab72('0x11e')});db['MailAccount'][_0xab72('0x121')](db[_0xab72('0x7e')],{'as':'Dispositions','foreignKey':_0xab72('0x173'),'onDelete':'cascade'});db['MailAccount'][_0xab72('0x121')](db[_0xab72('0x7c')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xab72('0x3e')][_0xab72('0x121')](db[_0xab72('0x42')],{'as':_0xab72('0x17a'),'foreignKey':_0xab72('0x173')});db[_0xab72('0x3e')][_0xab72('0x121')](db[_0xab72('0x128')],{'as':_0xab72('0x17b')});db['MailAccount'][_0xab72('0x121')](db[_0xab72('0x17c')],{'as':_0xab72('0x157'),'foreignKey':_0xab72('0x173'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x3e')][_0xab72('0x130')](db[_0xab72('0x100')],{'as':'List','foreignKey':_0xab72('0x17d')});db['MailAccount'][_0xab72('0x130')](db[_0xab72('0x94')],{'as':'Template','foreignKey':_0xab72('0x17e')});db[_0xab72('0x3e')][_0xab72('0x130')](db['Pause'],{'as':_0xab72('0x164'),'foreignKey':_0xab72('0x165')});db[_0xab72('0x3e')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x168'),'through':_0xab72('0x14d')});db[_0xab72('0x140')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x168'),'through':_0xab72('0x35')});db['MailQueue']['belongsToMany'](db['Team'],{'through':_0xab72('0x17f'),'as':_0xab72('0x180')});db[_0xab72('0x128')]['hasMany'](db[_0xab72('0x42')],{'as':_0xab72('0x17a'),'onDelete':_0xab72('0x11e'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0xab72('0x130')](db['MailAccount'],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x173')});db[_0xab72('0x128')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':'Contact','foreignKey':_0xab72('0x171')});db[_0xab72('0x128')][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x182'),'foreignKey':_0xab72('0x11f')});db['MailInteraction'][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x183'),'as':_0xab72('0x184')});db[_0xab72('0x128')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xab72('0x185')});db['MailInteraction']['belongsToMany'](db[_0xab72('0x14')],{'as':_0xab72('0x186'),'through':_0xab72('0x139'),'foreignKey':_0xab72('0x187')});db[_0xab72('0x42')][_0xab72('0x121')](db['Attachment'],{'as':_0xab72('0x188'),'onDelete':_0xab72('0x11e')});db['MailMessage'][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x14')});db[_0xab72('0x42')][_0xab72('0x130')](db[_0xab72('0x6f')],{'onDelete':_0xab72('0x11e'),'as':'Contact'});db[_0xab72('0x42')][_0xab72('0x130')](db[_0xab72('0x128')],{'as':_0xab72('0x189'),'foreignKey':_0xab72('0x187')});db['MailMessage'][_0xab72('0x130')](db[_0xab72('0x3e')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x173')});db[_0xab72('0x42')][_0xab72('0x130')](db[_0xab72('0x62')],{'as':_0xab72('0x62'),'foreignKey':'ChatWebsiteId'});db[_0xab72('0x42')][_0xab72('0x130')](db[_0xab72('0x18a')],{'as':_0xab72('0x18a'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0xab72('0x130')](db[_0xab72('0x14')],{'onDelete':_0xab72('0x175')});db[_0xab72('0x17c')][_0xab72('0x130')](db[_0xab72('0x140')],{'onDelete':_0xab72('0x175')});db[_0xab72('0x17c')]['belongsTo'](db['MailAccount'],{'onDelete':_0xab72('0x175')});db[_0xab72('0x17c')][_0xab72('0x130')](db['Interval'],{'onDelete':_0xab72('0x175'),'foreignKey':_0xab72('0x163')});db[_0xab72('0x17c')]['belongsTo'](db[_0xab72('0x8d')],{'onDelete':_0xab72('0x175'),'foreignKey':_0xab72('0x18b')});db[_0xab72('0x18c')][_0xab72('0x130')](db['MailAccount'],{});db['MailQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xab72('0x18c')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db[_0xab72('0x18c')]['belongsTo'](db['MailInteraction'],{});db[_0xab72('0x18c')][_0xab72('0x130')](db[_0xab72('0x42')],{});db['MailQueueReport'][_0xab72('0x130')](db[_0xab72('0x14')],{});db['MailQueueReport'][_0xab72('0x130')](db[_0xab72('0x140')],{});db[_0xab72('0x44')][_0xab72('0x121')](db[_0xab72('0x18e')],{'as':_0xab72('0x18f'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x47')][_0xab72('0x121')](db[_0xab72('0x7e')],{'as':'Dispositions','foreignKey':_0xab72('0x190'),'onDelete':_0xab72('0x11e')});db['FaxAccount'][_0xab72('0x121')](db[_0xab72('0x7c')],{'as':_0xab72('0x191'),'foreignKey':_0xab72('0x190')});db[_0xab72('0x47')][_0xab72('0x121')](db[_0xab72('0x4b')],{'as':_0xab72('0x17b')});db[_0xab72('0x47')][_0xab72('0x121')](db['FaxApplication'],{'as':_0xab72('0x157'),'foreignKey':_0xab72('0x190'),'onDelete':'cascade'});db[_0xab72('0x47')][_0xab72('0x121')](db['VoiceExtension'],{'as':_0xab72('0x192'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x47')][_0xab72('0x121')](db[_0xab72('0x4c')],{'as':_0xab72('0x17a')});db[_0xab72('0x47')][_0xab72('0x130')](db['Trunk'],{'as':_0xab72('0x2d')});db[_0xab72('0x47')]['belongsTo'](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':_0xab72('0x17d')});db[_0xab72('0x47')]['belongsTo'](db[_0xab72('0x84')],{'as':_0xab72('0x164'),'foreignKey':_0xab72('0x165')});db[_0xab72('0x47')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':'Agents','through':_0xab72('0x14b')});db[_0xab72('0x49')][_0xab72('0x130')](db[_0xab72('0x14')],{'onDelete':'restrict'});db[_0xab72('0x49')][_0xab72('0x130')](db[_0xab72('0x4e')],{'onDelete':'restrict'});db[_0xab72('0x49')]['belongsTo'](db[_0xab72('0x47')],{'onDelete':_0xab72('0x175')});db[_0xab72('0x49')][_0xab72('0x130')](db[_0xab72('0x8d')],{'onDelete':_0xab72('0x175'),'foreignKey':'TagId'});db['FaxInteraction'][_0xab72('0x121')](db[_0xab72('0x4c')],{'as':_0xab72('0x17a'),'onDelete':'cascade','foreignKey':_0xab72('0x194')});db['FaxInteraction'][_0xab72('0x130')](db['FaxAccount'],{'as':'Account','foreignKey':_0xab72('0x190')});db['FaxInteraction'][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db[_0xab72('0x4b')][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x182'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x4b')]['belongsToMany'](db[_0xab72('0x8d')],{'through':'fax_interaction_has_tags','as':_0xab72('0x184')});db[_0xab72('0x4b')][_0xab72('0x132')](db['Tag'],{'through':_0xab72('0x195'),'as':_0xab72('0x185')});db['FaxInteraction'][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x186'),'through':'user_has_fax_interactions','foreignKey':_0xab72('0x194')});db[_0xab72('0x4c')]['belongsTo'](db['User'],{'onDelete':_0xab72('0x11e'),'as':_0xab72('0x14')});db[_0xab72('0x4c')][_0xab72('0x130')](db[_0xab72('0x4b')],{'as':_0xab72('0x189'),'foreignKey':_0xab72('0x194')});db[_0xab72('0x4c')][_0xab72('0x130')](db[_0xab72('0x6f')],{'onDelete':'cascade','as':_0xab72('0x18d')});db[_0xab72('0x4c')][_0xab72('0x130')](db[_0xab72('0xf6')],{'as':_0xab72('0xf6'),'foreignKey':_0xab72('0x196')});db[_0xab72('0x4c')][_0xab72('0x130')](db[_0xab72('0x47')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x190')});db[_0xab72('0x4e')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x168'),'through':_0xab72('0x36')});db[_0xab72('0x4e')]['belongsToMany'](db['Team'],{'through':'team_has_fax_queues','as':_0xab72('0x180')});db[_0xab72('0x50')]['belongsTo'](db[_0xab72('0x47')],{});db[_0xab72('0x50')][_0xab72('0x130')](db[_0xab72('0x100')],{'as':'List','foreignKey':'ListId'});db[_0xab72('0x50')]['belongsTo'](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db['FaxQueueReport'][_0xab72('0x130')](db[_0xab72('0x4b')],{});db[_0xab72('0x50')][_0xab72('0x130')](db[_0xab72('0x4c')],{});db[_0xab72('0x50')][_0xab72('0x130')](db[_0xab72('0x14')],{});db[_0xab72('0x50')]['belongsTo'](db[_0xab72('0x4e')],{});db[_0xab72('0x52')]['hasMany'](db[_0xab72('0x7e')],{'as':_0xab72('0x197'),'foreignKey':_0xab72('0x198'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x52')][_0xab72('0x121')](db[_0xab72('0x7c')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xab72('0x121')](db['SmsMessage'],{'as':_0xab72('0x17a'),'foreignKey':_0xab72('0x198')});db[_0xab72('0x52')][_0xab72('0x121')](db[_0xab72('0x55')],{'as':'Interactions'});db[_0xab72('0x52')][_0xab72('0x121')](db[_0xab72('0x199')],{'as':_0xab72('0x157'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0xab72('0x52')][_0xab72('0x130')](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':_0xab72('0x17d')});db['SmsAccount'][_0xab72('0x130')](db[_0xab72('0x84')],{'as':_0xab72('0x164'),'foreignKey':_0xab72('0x165')});db[_0xab72('0x52')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x168'),'through':_0xab72('0x151')});db[_0xab72('0x199')][_0xab72('0x130')](db[_0xab72('0x14')],{'onDelete':_0xab72('0x175')});db[_0xab72('0x199')][_0xab72('0x130')](db[_0xab72('0x58')],{'onDelete':'restrict'});db['SmsApplication'][_0xab72('0x130')](db[_0xab72('0x52')],{'onDelete':_0xab72('0x175')});db['SmsApplication'][_0xab72('0x130')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xab72('0x163')});db[_0xab72('0x199')][_0xab72('0x130')](db['Tag'],{'onDelete':_0xab72('0x175'),'foreignKey':_0xab72('0x18b')});db[_0xab72('0x55')][_0xab72('0x121')](db[_0xab72('0x57')],{'as':'Messages','onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x19a')});db[_0xab72('0x55')][_0xab72('0x130')](db[_0xab72('0x52')],{'as':'Account','foreignKey':_0xab72('0x198')});db[_0xab72('0x55')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':'Contact','foreignKey':_0xab72('0x171')});db['SmsInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xab72('0x11f')});db[_0xab72('0x55')][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0xab72('0x55')][_0xab72('0x132')](db['Tag'],{'through':_0xab72('0x19b'),'as':_0xab72('0x185')});db[_0xab72('0x55')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x186'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xab72('0x130')](db[_0xab72('0x14')],{'as':'User'});db['SmsMessage'][_0xab72('0x130')](db[_0xab72('0x6f')],{'onDelete':_0xab72('0x11e'),'as':_0xab72('0x18d')});db[_0xab72('0x57')][_0xab72('0x130')](db[_0xab72('0x55')],{'onDelete':_0xab72('0x11e'),'as':'Interaction','foreignKey':_0xab72('0x19a')});db[_0xab72('0x57')][_0xab72('0x130')](db[_0xab72('0x52')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x198')});db[_0xab72('0x58')]['belongsToMany'](db['User'],{'as':_0xab72('0x168'),'through':'UserSmsQueue','foreignKey':_0xab72('0x19c')});db[_0xab72('0x58')][_0xab72('0x132')](db[_0xab72('0xef')],{'through':_0xab72('0x19d'),'as':_0xab72('0x180')});db[_0xab72('0x5a')][_0xab72('0x121')](db[_0xab72('0x7e')],{'as':'Dispositions','foreignKey':_0xab72('0x19e'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x5a')]['hasMany'](db[_0xab72('0x7c')],{'as':_0xab72('0x191'),'foreignKey':_0xab72('0x19e')});db[_0xab72('0x5a')][_0xab72('0x121')](db['OpenchannelInteraction'],{'as':_0xab72('0x17b'),'foreignKey':_0xab72('0x19e')});db[_0xab72('0x5a')][_0xab72('0x121')](db[_0xab72('0x60')],{'as':_0xab72('0x17a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0xab72('0x5c')],{'as':_0xab72('0x157'),'foreignKey':_0xab72('0x19e'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x5a')]['belongsTo'](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':_0xab72('0x17d')});db[_0xab72('0x5a')]['belongsTo'](db[_0xab72('0x84')],{'as':_0xab72('0x164'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xab72('0x5a')][_0xab72('0x132')](db['User'],{'as':'Agents','through':_0xab72('0x14f')});db[_0xab72('0x5c')][_0xab72('0x130')](db[_0xab72('0x14')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xab72('0x130')](db[_0xab72('0x61')],{'onDelete':'restrict','foreignKey':_0xab72('0x19f')});db[_0xab72('0x5c')][_0xab72('0x130')](db[_0xab72('0x5a')],{'onDelete':_0xab72('0x175'),'foreignKey':_0xab72('0x19e')});db[_0xab72('0x5c')]['belongsTo'](db[_0xab72('0x82')],{'onDelete':_0xab72('0x175'),'foreignKey':_0xab72('0x163')});db['OpenchannelApplication']['belongsTo'](db[_0xab72('0x8d')],{'onDelete':_0xab72('0x175'),'foreignKey':_0xab72('0x18b')});db['OpenchannelInteraction'][_0xab72('0x121')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1a0')});db['OpenchannelInteraction']['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xab72('0x5e')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db[_0xab72('0x5e')][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x182'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x5e')][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x1a1'),'as':'Tags'});db[_0xab72('0x5e')][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x1a1'),'as':'ThroughTags'});db[_0xab72('0x5e')][_0xab72('0x132')](db['User'],{'as':_0xab72('0x186'),'through':'user_has_openchannel_interactions','foreignKey':_0xab72('0x1a0')});db['OpenchannelMessage'][_0xab72('0x130')](db[_0xab72('0x14')],{'onDelete':'cascade','as':_0xab72('0x14')});db[_0xab72('0x60')][_0xab72('0x130')](db[_0xab72('0x6f')],{'onDelete':_0xab72('0x11e'),'as':'Contact'});db[_0xab72('0x60')][_0xab72('0x130')](db[_0xab72('0x5e')],{'onDelete':'cascade','as':_0xab72('0x189'),'foreignKey':_0xab72('0x1a0')});db[_0xab72('0x60')]['belongsTo'](db['Attachment'],{'as':_0xab72('0xf6'),'foreignKey':'AttachmentId'});db[_0xab72('0x60')][_0xab72('0x130')](db['OpenchannelAccount'],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x19e')});db[_0xab72('0x61')][_0xab72('0x132')](db['User'],{'as':_0xab72('0x168'),'through':_0xab72('0x39'),'foreignKey':_0xab72('0x19f')});db['OpenchannelQueue'][_0xab72('0x132')](db[_0xab72('0xef')],{'through':_0xab72('0x1a2'),'as':_0xab72('0x180')});db[_0xab72('0x62')][_0xab72('0x121')](db[_0xab72('0x7e')],{'as':_0xab72('0x197'),'foreignKey':'ChatWebsiteId','onDelete':_0xab72('0x11e')});db['ChatWebsite'][_0xab72('0x121')](db[_0xab72('0x7c')],{'as':_0xab72('0x191'),'foreignKey':'ChatWebsiteId'});db[_0xab72('0x62')][_0xab72('0x121')](db[_0xab72('0x6b')],{'as':_0xab72('0x1a3')});db[_0xab72('0x62')][_0xab72('0x121')](db['ChatInteraction'],{'as':_0xab72('0x17b')});db[_0xab72('0x62')][_0xab72('0x121')](db[_0xab72('0x66')],{'as':'Applications','foreignKey':_0xab72('0x1a4'),'onDelete':'cascade'});db[_0xab72('0x62')][_0xab72('0x121')](db[_0xab72('0x69')],{'as':_0xab72('0x17a')});db[_0xab72('0x62')]['belongsTo'](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':_0xab72('0x17d')});db['ChatWebsite'][_0xab72('0x130')](db[_0xab72('0x82')],{'as':_0xab72('0x82'),'foreignKey':'IntervalId'});db[_0xab72('0x62')][_0xab72('0x130')](db[_0xab72('0x3e')],{'as':_0xab72('0x3e'),'foreignKey':_0xab72('0x173')});db[_0xab72('0x62')][_0xab72('0x130')](db[_0xab72('0x84')],{'as':_0xab72('0x164'),'foreignKey':_0xab72('0x165')});db[_0xab72('0x62')]['belongsToMany'](db['User'],{'as':_0xab72('0x168'),'through':_0xab72('0x1a5')});db['OpenchannelQueueReport'][_0xab72('0x130')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xab72('0x130')](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':_0xab72('0x17d')});db['OpenchannelQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xab72('0x64')][_0xab72('0x130')](db['OpenchannelInteraction'],{});db[_0xab72('0x64')][_0xab72('0x130')](db[_0xab72('0x60')],{});db[_0xab72('0x64')][_0xab72('0x130')](db[_0xab72('0x14')],{});db[_0xab72('0x64')]['belongsTo'](db[_0xab72('0x61')],{});db['ChatApplication']['belongsTo'](db[_0xab72('0x14')],{'as':_0xab72('0x1a6'),'foreignKey':_0xab72('0x11f'),'onDelete':_0xab72('0x175')});db['ChatApplication'][_0xab72('0x130')](db[_0xab72('0x142')],{'as':_0xab72('0x1a7'),'foreignKey':'ChatQueueId','onDelete':_0xab72('0x175')});db['ChatApplication'][_0xab72('0x130')](db[_0xab72('0x62')],{'as':_0xab72('0x1a8'),'foreignKey':'ChatWebsiteId','onDelete':_0xab72('0x175')});db[_0xab72('0x66')][_0xab72('0x130')](db[_0xab72('0x8d')],{'onDelete':'restrict','foreignKey':_0xab72('0x18b')});db[_0xab72('0x67')][_0xab72('0x121')](db[_0xab72('0x69')],{'as':'Messages','onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0xab72('0x67')][_0xab72('0x130')](db[_0xab72('0x62')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x1a4')});db[_0xab72('0x67')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':'ContactId'});db[_0xab72('0x67')][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x182'),'foreignKey':'UserId'});db[_0xab72('0x67')][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x1a9'),'as':_0xab72('0x184')});db[_0xab72('0x67')][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x1a9'),'as':'ThroughTags'});db[_0xab72('0x67')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x186'),'through':'user_has_chat_interactions','foreignKey':_0xab72('0x1aa')});db[_0xab72('0x69')][_0xab72('0x130')](db[_0xab72('0x14')],{'onDelete':_0xab72('0x11e'),'as':_0xab72('0x14')});db[_0xab72('0x69')]['belongsTo'](db['CmContact'],{'onDelete':_0xab72('0x11e'),'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db['ChatMessage'][_0xab72('0x130')](db[_0xab72('0x67')],{'onDelete':_0xab72('0x11e'),'as':_0xab72('0x189'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xab72('0x130')](db[_0xab72('0xf6')],{'as':'Attachment','foreignKey':'AttachmentId'});db['ChatMessage'][_0xab72('0x130')](db[_0xab72('0x62')],{'as':'Account','foreignKey':_0xab72('0x1a4')});db[_0xab72('0x18a')][_0xab72('0x121')](db[_0xab72('0xf6')],{'as':_0xab72('0x188'),'foreignKey':_0xab72('0x1ab'),'onDelete':_0xab72('0x11e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xab72('0x6f')],{'onDelete':_0xab72('0x11e'),'as':_0xab72('0x18d'),'foreignKey':'ContactId'});db[_0xab72('0x18a')][_0xab72('0x130')](db[_0xab72('0x62')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x1a4')});db['ChatQueue'][_0xab72('0x132')](db[_0xab72('0x14')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0xab72('0x142')][_0xab72('0x132')](db[_0xab72('0xef')],{'through':_0xab72('0x1ac'),'as':_0xab72('0x180')});db['ChatGroup'][_0xab72('0x121')](db[_0xab72('0xd9')],{'as':_0xab72('0x17a'),'foreignKey':'ChatGroupId','onDelete':_0xab72('0x11e')});db[_0xab72('0x6a')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x15a'),'through':_0xab72('0x134')});db[_0xab72('0x6b')][_0xab72('0x130')](db['ChatWebsite'],{'as':_0xab72('0x1a8'),'foreignKey':_0xab72('0x1a4')});db[_0xab72('0x6d')][_0xab72('0x121')](db[_0xab72('0x6f')],{'as':_0xab72('0x135'),'foreignKey':_0xab72('0x1ad')});db[_0xab72('0x6f')][_0xab72('0x121')](db['CmContactHasItem'],{'as':_0xab72('0x1ae'),'foreignKey':_0xab72('0x1af')});db[_0xab72('0x6f')][_0xab72('0x121')](db[_0xab72('0x15b')],{'as':'Hoppers','foreignKey':_0xab72('0x171')});db['CmContact']['hasMany'](db[_0xab72('0x73')],{'as':'HopperFinals','foreignKey':_0xab72('0x171')});db['CmContact'][_0xab72('0x121')](db[_0xab72('0x74')],{'as':_0xab72('0x15d'),'foreignKey':_0xab72('0x171')});db['CmContact'][_0xab72('0x121')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xab72('0x171')});db['CmContact'][_0xab72('0x121')](db[_0xab72('0xde')],{'as':_0xab72('0x1b0'),'foreignKey':_0xab72('0x171')});db[_0xab72('0x6f')][_0xab72('0x121')](db[_0xab72('0x5e')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xab72('0x6f')]['hasMany'](db[_0xab72('0x67')],{'as':'ChatInteractions','foreignKey':_0xab72('0x171'),'onDelete':_0xab72('0x175')});db['CmContact'][_0xab72('0x121')](db[_0xab72('0x55')],{'as':'SmsInteractions','foreignKey':_0xab72('0x171'),'onDelete':_0xab72('0x175')});db[_0xab72('0x6f')][_0xab72('0x121')](db[_0xab72('0x4b')],{'as':_0xab72('0x127'),'foreignKey':_0xab72('0x171'),'onDelete':_0xab72('0x175')});db['CmContact'][_0xab72('0x121')](db[_0xab72('0x128')],{'as':_0xab72('0x129'),'foreignKey':_0xab72('0x171'),'onDelete':_0xab72('0x175')});db[_0xab72('0x6f')][_0xab72('0x130')](db[_0xab72('0x6d')],{'as':_0xab72('0x1b1'),'foreignKey':'CompanyId'});db[_0xab72('0x6f')][_0xab72('0x130')](db[_0xab72('0x100')],{'as':'List','foreignKey':'ListId','onDelete':_0xab72('0x11e')});db[_0xab72('0x6f')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':'Users','through':_0xab72('0x136')});db[_0xab72('0x6f')]['belongsToMany'](db[_0xab72('0x8d')],{'as':_0xab72('0x184'),'through':_0xab72('0x1b2')});db[_0xab72('0x6f')]['belongsToMany'](db[_0xab72('0x8d')],{'through':_0xab72('0x1b2'),'as':_0xab72('0x185')});db[_0xab72('0x15b')][_0xab72('0x121')](db[_0xab72('0x92')],{'as':'AdditionalPhones','foreignKey':_0xab72('0x1b3')});db[_0xab72('0x15b')][_0xab72('0x130')](db['CmContact'],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x15b')]['belongsTo'](db[_0xab72('0x100')],{'as':'List','foreignKey':_0xab72('0x17d'),'onDelete':'cascade'});db['CmHopper'][_0xab72('0x130')](db['User'],{'as':_0xab72('0x1a6'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x15b')][_0xab72('0x130')](db['VoiceQueue'],{'as':_0xab72('0x1a7'),'foreignKey':'VoiceQueueId','onDelete':_0xab72('0x11e')});db[_0xab72('0x15b')][_0xab72('0x130')](db[_0xab72('0xf2')],{'as':_0xab72('0xf2'),'foreignKey':_0xab72('0x1b4'),'onDelete':_0xab72('0x11e')});db['CmHopper'][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x182'),'foreignKey':_0xab72('0x1b5')});db[_0xab72('0x15e')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':'Contact','foreignKey':_0xab72('0x171'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x15e')][_0xab72('0x130')](db['CmList'],{'as':'List','foreignKey':_0xab72('0x17d'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xab72('0x15c'),'onDelete':_0xab72('0x11e')});db['CmHopperBlack']['belongsTo'](db[_0xab72('0xf2')],{'as':_0xab72('0xf2'),'foreignKey':_0xab72('0x1b4'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x7b')][_0xab72('0x121')](db[_0xab72('0x80')],{'as':{'plural':'All','singular':_0xab72('0x1b6')},'foreignKey':_0xab72('0x1b7'),'onDelete':_0xab72('0x11e'),'hooks':!![]});db[_0xab72('0x7b')][_0xab72('0x121')](db[_0xab72('0x80')],{'as':{'plural':_0xab72('0x1b8'),'singular':_0xab72('0x1b9')},'foreignKey':_0xab72('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0xab72('0x7b')][_0xab72('0x121')](db[_0xab72('0x79')],{'as':_0xab72('0x1bb'),'foreignKey':_0xab72('0x1bc'),'onDelete':_0xab72('0x11e'),'hooks':!![]});db[_0xab72('0x7e')]['hasMany'](db[_0xab72('0x7e')],{'as':_0xab72('0x197'),'foreignKey':_0xab72('0x1bd'),'onDelete':'cascade'});db['Interval'][_0xab72('0x121')](db[_0xab72('0x82')],{'as':_0xab72('0x1be'),'foreignKey':'IntervalId','onDelete':_0xab72('0x11e'),'hooks':!![],'required':![]});db[_0xab72('0x82')][_0xab72('0x121')](db[_0xab72('0x122')],{'as':'Extensions','foreignKey':_0xab72('0x163'),'onDelete':_0xab72('0x175')});db[_0xab72('0x82')][_0xab72('0x121')](db[_0xab72('0x17c')],{'as':'MailApplications','foreignKey':_0xab72('0x163')});db[_0xab72('0x82')]['hasMany'](db[_0xab72('0x66')],{'as':_0xab72('0x1bf'),'foreignKey':_0xab72('0x163')});db[_0xab72('0x82')][_0xab72('0x121')](db['FaxApplication'],{'as':_0xab72('0x1c0'),'foreignKey':'IntervalId'});db[_0xab72('0x82')]['hasMany'](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xab72('0x163')});db[_0xab72('0x1c1')][_0xab72('0x130')](db['MailAccount'],{});db[_0xab72('0x1c1')][_0xab72('0x130')](db['AnalyticDefaultReport'],{'foreignKey':_0xab72('0x1c2')});db['Schedule'][_0xab72('0x130')](db[_0xab72('0x9c')],{'foreignKey':_0xab72('0x1c3')});db['Sound'][_0xab72('0x132')](db[_0xab72('0x158')],{'as':_0xab72('0x1c4'),'through':_0xab72('0x1c5'),'onDelete':_0xab72('0x175')});db[_0xab72('0x8d')][_0xab72('0x132')](db[_0xab72('0x6f')],{'through':'cm_contact_has_tags'});db['Tag'][_0xab72('0x132')](db[_0xab72('0x67')],{'through':'chat_interaction_has_tags'});db[_0xab72('0x8d')][_0xab72('0x132')](db['MailInteraction'],{'through':_0xab72('0x183')});db[_0xab72('0x8d')][_0xab72('0x132')](db['SmsInteraction'],{'through':_0xab72('0x19b')});db[_0xab72('0x8d')][_0xab72('0x132')](db['FaxInteraction'],{'through':_0xab72('0x195')});db[_0xab72('0x8d')][_0xab72('0x132')](db['OpenchannelInteraction'],{'through':_0xab72('0x1a1')});db[_0xab72('0x8d')][_0xab72('0x132')](db['WhatsappInteraction'],{'through':_0xab72('0x1c6')});db[_0xab72('0x90')][_0xab72('0x130')](db[_0xab72('0x8e')],{'as':'ItemType','foreignKey':'ItemTypeId'});db['CmHopperAdditionalPhone'][_0xab72('0x130')](db[_0xab72('0x15b')],{'as':'Hopper','foreignKey':_0xab72('0x1b3')});db[_0xab72('0x90')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x1af')});db['Trigger'][_0xab72('0x121')](db[_0xab72('0x80')],{'as':{'plural':'AllConditions','singular':_0xab72('0x1c7')},'foreignKey':_0xab72('0x1c8'),'onDelete':_0xab72('0x11e'),'hooks':!![]});db[_0xab72('0x96')]['hasMany'](db[_0xab72('0x80')],{'as':{'plural':'AnyConditions','singular':_0xab72('0x1c9')},'foreignKey':_0xab72('0x1ca'),'onDelete':_0xab72('0x11e'),'hooks':!![]});db[_0xab72('0x96')][_0xab72('0x121')](db[_0xab72('0x79')],{'as':_0xab72('0x1bb'),'foreignKey':_0xab72('0x1cb'),'onDelete':'cascade','hooks':!![]});db[_0xab72('0x9c')][_0xab72('0x121')](db[_0xab72('0x1cc')],{'as':_0xab72('0x1cd'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1c3'),'hooks':!![]});db[_0xab72('0x9e')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xab72('0x1cd'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xab72('0xa2')][_0xab72('0x121')](db[_0xab72('0x1cc')],{'as':_0xab72('0x1cd'),'onDelete':'cascade','foreignKey':_0xab72('0x1ce')});db['AnalyticFieldReport']['belongsTo'](db[_0xab72('0xa2')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xab72('0x121')](db['SalesforceConfiguration'],{'as':_0xab72('0x1cf'),'onDelete':'cascade','foreignKey':_0xab72('0x1d0')});db['SalesforceConfiguration'][_0xab72('0x121')](db[_0xab72('0xaa')],{'as':_0xab72('0x1d1'),'onDelete':'cascade','foreignKey':_0xab72('0x1d2')});db[_0xab72('0xa9')][_0xab72('0x121')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d3')});db[_0xab72('0xa9')][_0xab72('0x121')](db['SalesforceField'],{'as':_0xab72('0x1cd'),'onDelete':_0xab72('0x11e'),'foreignKey':'FieldId'});db[_0xab72('0xa9')][_0xab72('0x130')](db['SalesforceAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xab72('0xaa')]['hasMany'](db[_0xab72('0xaa')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db['SalesforceField'][_0xab72('0x121')](db[_0xab72('0xaa')],{'as':'Description','foreignKey':_0xab72('0x1d3')});db[_0xab72('0xaa')][_0xab72('0x121')](db['SalesforceField'],{'as':'Field','foreignKey':_0xab72('0x1d5')});db[_0xab72('0xaa')][_0xab72('0x130')](db[_0xab72('0x1d6')],{'as':'Variable','foreignKey':'VariableId'});db[_0xab72('0xac')][_0xab72('0x121')](db[_0xab72('0xae')],{'as':_0xab72('0x1cf'),'onDelete':'cascade','foreignKey':_0xab72('0x1d0')});db[_0xab72('0xae')][_0xab72('0x121')](db[_0xab72('0xb0')],{'as':_0xab72('0x1d1'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d2')});db['SugarcrmConfiguration'][_0xab72('0x121')](db[_0xab72('0xb0')],{'as':_0xab72('0x1d7'),'onDelete':'cascade','foreignKey':_0xab72('0x1d3')});db['SugarcrmConfiguration'][_0xab72('0x121')](db[_0xab72('0xb0')],{'as':_0xab72('0x1cd'),'onDelete':'cascade','foreignKey':_0xab72('0x1d5')});db[_0xab72('0xae')][_0xab72('0x130')](db[_0xab72('0xac')],{'as':'Account','foreignKey':_0xab72('0x1d0')});db[_0xab72('0xb0')][_0xab72('0x121')](db[_0xab72('0xb0')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xb0')][_0xab72('0x121')](db[_0xab72('0xb0')],{'as':_0xab72('0x1d8'),'foreignKey':_0xab72('0x1d3')});db['SugarcrmField'][_0xab72('0x121')](db[_0xab72('0xb0')],{'as':_0xab72('0x1d9'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xb0')][_0xab72('0x130')](db['Variable'],{'as':_0xab72('0x1d6'),'foreignKey':_0xab72('0x1da')});db[_0xab72('0xb2')][_0xab72('0x121')](db['DeskConfiguration'],{'as':_0xab72('0x1cf'),'onDelete':_0xab72('0x11e'),'foreignKey':'AccountId'});db[_0xab72('0xb3')][_0xab72('0x121')](db[_0xab72('0xb5')],{'as':_0xab72('0x1d1'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xb3')][_0xab72('0x121')](db['DeskField'],{'as':_0xab72('0x1d7'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d3')});db[_0xab72('0xb3')][_0xab72('0x121')](db[_0xab72('0xb5')],{'as':_0xab72('0x1cd'),'onDelete':'cascade','foreignKey':_0xab72('0x1d5')});db[_0xab72('0xb3')]['belongsTo'](db[_0xab72('0xb2')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x1d0')});db['DeskConfiguration'][_0xab72('0x132')](db['Tag'],{'through':_0xab72('0x1db')});db[_0xab72('0xb5')][_0xab72('0x121')](db[_0xab72('0xb5')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xb5')][_0xab72('0x121')](db[_0xab72('0xb5')],{'as':_0xab72('0x1d8'),'foreignKey':_0xab72('0x1d3')});db['DeskField'][_0xab72('0x121')](db[_0xab72('0xb5')],{'as':_0xab72('0x1d9'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xb5')][_0xab72('0x130')](db[_0xab72('0x1d6')],{'as':_0xab72('0x1d6'),'foreignKey':_0xab72('0x1da')});db['ZohoAccount'][_0xab72('0x121')](db[_0xab72('0x1dc')],{'as':_0xab72('0x1cf'),'onDelete':'cascade','foreignKey':_0xab72('0x1d0')});db[_0xab72('0x1dc')][_0xab72('0x121')](db['ZohoField'],{'as':_0xab72('0x1d1'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0x1dc')][_0xab72('0x121')](db[_0xab72('0xb8')],{'as':_0xab72('0x1d7'),'onDelete':'cascade','foreignKey':_0xab72('0x1d3')});db[_0xab72('0x1dc')]['hasMany'](db[_0xab72('0xb8')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db['ZohoConfiguration'][_0xab72('0x130')](db['ZohoAccount'],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x1d0')});db['ZohoField'][_0xab72('0x121')](db[_0xab72('0xb8')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xb8')][_0xab72('0x121')](db[_0xab72('0xb8')],{'as':_0xab72('0x1d8'),'foreignKey':'DescriptionId'});db[_0xab72('0xb8')][_0xab72('0x121')](db[_0xab72('0xb8')],{'as':_0xab72('0x1d9'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xb8')][_0xab72('0x130')](db[_0xab72('0x1d6')],{'as':_0xab72('0x1d6'),'foreignKey':_0xab72('0x1da')});db[_0xab72('0xb9')][_0xab72('0x121')](db[_0xab72('0xbb')],{'as':_0xab72('0x1cf'),'onDelete':'cascade','foreignKey':_0xab72('0x1d0')});db[_0xab72('0xbb')][_0xab72('0x121')](db[_0xab72('0xbd')],{'as':_0xab72('0x1d1'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xbb')][_0xab72('0x121')](db[_0xab72('0xbd')],{'as':_0xab72('0x1d7'),'foreignKey':'DescriptionId'});db[_0xab72('0xbb')][_0xab72('0x121')](db[_0xab72('0xbd')],{'as':_0xab72('0x1cd'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xbb')][_0xab72('0x130')](db[_0xab72('0xb9')],{'as':_0xab72('0x181'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xab72('0x1dd')});db[_0xab72('0xbd')]['hasMany'](db[_0xab72('0xbd')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xbd')][_0xab72('0x121')](db[_0xab72('0xbd')],{'as':'Description','foreignKey':_0xab72('0x1d3')});db[_0xab72('0xbd')][_0xab72('0x121')](db[_0xab72('0xbd')],{'as':_0xab72('0x1d9'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xbd')]['belongsTo'](db[_0xab72('0x1d6')],{'as':_0xab72('0x1d6'),'foreignKey':'VariableId'});db[_0xab72('0xbf')]['hasMany'](db[_0xab72('0x1de')],{'as':_0xab72('0x1cf'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d0')});db['FreshdeskConfiguration'][_0xab72('0x121')](db['FreshdeskField'],{'as':_0xab72('0x1d1'),'onDelete':_0xab72('0x11e'),'foreignKey':'SubjectId'});db[_0xab72('0x1de')][_0xab72('0x121')](db[_0xab72('0xc0')],{'as':_0xab72('0x1d7'),'onDelete':'cascade','foreignKey':_0xab72('0x1d3')});db[_0xab72('0x1de')]['hasMany'](db[_0xab72('0xc0')],{'as':'Fields','onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0x1de')][_0xab72('0x130')](db['FreshdeskAccount'],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x1d0')});db['FreshdeskConfiguration'][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x1df')});db[_0xab72('0xc0')][_0xab72('0x121')](db[_0xab72('0xc0')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xc0')][_0xab72('0x121')](db[_0xab72('0xc0')],{'as':_0xab72('0x1d8'),'foreignKey':_0xab72('0x1d3')});db['FreshdeskField'][_0xab72('0x121')](db[_0xab72('0xc0')],{'as':_0xab72('0x1d9'),'foreignKey':'FieldId'});db[_0xab72('0xc0')]['belongsTo'](db['Variable'],{'as':_0xab72('0x1d6'),'foreignKey':_0xab72('0x1da')});db['VtigerAccount'][_0xab72('0x121')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xab72('0x11e'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0xab72('0x121')](db[_0xab72('0x1e0')],{'as':_0xab72('0x1d1'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xc4')][_0xab72('0x121')](db[_0xab72('0x1e0')],{'as':_0xab72('0x1d7'),'foreignKey':_0xab72('0x1d3')});db[_0xab72('0xc4')][_0xab72('0x121')](db['VtigerField'],{'as':_0xab72('0x1cd'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xc4')][_0xab72('0x130')](db['VtigerAccount'],{'as':'Account','foreignKey':'AccountId'});db['VtigerField'][_0xab72('0x121')](db[_0xab72('0x1e0')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db['VtigerField'][_0xab72('0x121')](db[_0xab72('0x1e0')],{'as':'Description','foreignKey':_0xab72('0x1d3')});db[_0xab72('0x1e0')][_0xab72('0x121')](db[_0xab72('0x1e0')],{'as':_0xab72('0x1d9'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0x1e0')][_0xab72('0x130')](db[_0xab72('0x1d6')],{'as':'Variable','foreignKey':_0xab72('0x1da')});db[_0xab72('0xc7')][_0xab72('0x121')](db[_0xab72('0xc9')],{'as':_0xab72('0x1cf'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d0')});db[_0xab72('0xc9')][_0xab72('0x121')](db['ServicenowField'],{'as':_0xab72('0x1d1'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xc9')][_0xab72('0x121')](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0xab72('0x1d3')});db[_0xab72('0xc9')][_0xab72('0x121')](db[_0xab72('0xca')],{'as':_0xab72('0x1cd'),'foreignKey':'FieldId'});db[_0xab72('0xc9')][_0xab72('0x130')](db[_0xab72('0xc7')],{'as':'Account','foreignKey':_0xab72('0x1d0')});db['ServicenowField']['hasMany'](db[_0xab72('0xca')],{'as':_0xab72('0x1d4'),'foreignKey':'SubjectId'});db['ServicenowField']['hasMany'](db[_0xab72('0xca')],{'as':_0xab72('0x1d8'),'foreignKey':_0xab72('0x1d3')});db[_0xab72('0xca')][_0xab72('0x121')](db[_0xab72('0xca')],{'as':_0xab72('0x1d9'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xca')][_0xab72('0x130')](db[_0xab72('0x1d6')],{'as':_0xab72('0x1d6'),'foreignKey':_0xab72('0x1da')});db['Dynamics365Account'][_0xab72('0x121')](db[_0xab72('0xce')],{'as':_0xab72('0x1cf'),'onDelete':'cascade','foreignKey':_0xab72('0x1d0')});db['Dynamics365Account'][_0xab72('0x130')](db[_0xab72('0x114')],{'as':_0xab72('0x114'),'foreignKey':_0xab72('0x174')});db[_0xab72('0xce')][_0xab72('0x121')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0xab72('0x121')](db[_0xab72('0xd0')],{'as':_0xab72('0x1d7'),'onDelete':'cascade','foreignKey':_0xab72('0x1d3')});db[_0xab72('0xce')][_0xab72('0x121')](db[_0xab72('0xd0')],{'as':_0xab72('0x1cd'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xce')][_0xab72('0x130')](db[_0xab72('0xcc')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x1d0')});db['Dynamics365Field'][_0xab72('0x121')](db['Dynamics365Field'],{'as':_0xab72('0x1d4'),'foreignKey':'SubjectId'});db[_0xab72('0xd0')][_0xab72('0x121')](db['Dynamics365Field'],{'as':_0xab72('0x1d8'),'foreignKey':'DescriptionId'});db[_0xab72('0xd0')][_0xab72('0x121')](db[_0xab72('0xd0')],{'as':_0xab72('0x1d9'),'foreignKey':_0xab72('0x1d5')});db[_0xab72('0xd0')][_0xab72('0x130')](db[_0xab72('0x1d6')],{'as':_0xab72('0x1d6'),'foreignKey':_0xab72('0x1da')});db[_0xab72('0xd2')][_0xab72('0x121')](db[_0xab72('0xd4')],{'as':_0xab72('0x1cf'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x1d0')});db[_0xab72('0xd4')][_0xab72('0x121')](db[_0xab72('0xd5')],{'as':'Subjects','foreignKey':_0xab72('0x1d2')});db[_0xab72('0xd4')][_0xab72('0x121')](db[_0xab72('0xd5')],{'as':_0xab72('0x1d7'),'foreignKey':_0xab72('0x1d3')});db[_0xab72('0xd4')][_0xab72('0x121')](db[_0xab72('0xd5')],{'as':_0xab72('0x1cd'),'foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0xab72('0xd2')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x1d0')});db['FreshsalesField'][_0xab72('0x121')](db[_0xab72('0xd5')],{'as':_0xab72('0x1d4'),'foreignKey':_0xab72('0x1d2')});db[_0xab72('0xd5')]['hasMany'](db['FreshsalesField'],{'as':_0xab72('0x1d8'),'foreignKey':_0xab72('0x1d3')});db[_0xab72('0xd5')]['hasMany'](db[_0xab72('0xd5')],{'as':_0xab72('0x1d9'),'foreignKey':'FieldId'});db['FreshsalesField']['belongsTo'](db[_0xab72('0x1d6')],{'as':'Variable','foreignKey':_0xab72('0x1da')});db[_0xab72('0x1e1')][_0xab72('0x130')](db[_0xab72('0x62')],{});db['ChatQueueReport']['belongsTo'](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':'ListId'});db[_0xab72('0x1e1')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db[_0xab72('0x1e1')][_0xab72('0x130')](db[_0xab72('0x67')],{});db[_0xab72('0x1e1')]['belongsTo'](db['ChatMessage'],{});db['ChatQueueReport'][_0xab72('0x130')](db['User'],{});db[_0xab72('0x1e1')][_0xab72('0x130')](db['ChatQueue'],{});db[_0xab72('0xd9')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0xab72('0x1e2')});db[_0xab72('0xd9')]['belongsTo'](db[_0xab72('0x14')],{'onDelete':_0xab72('0x11e'),'foreignKey':'ToId'});db[_0xab72('0xde')][_0xab72('0x121')](db[_0xab72('0xdc')],{'foreignKey':'SessionId','onDelete':_0xab72('0x11e')});db[_0xab72('0xde')]['hasMany'](db[_0xab72('0xda')],{'foreignKey':_0xab72('0x1e3'),'onDelete':_0xab72('0x11e')});db[_0xab72('0xe0')][_0xab72('0x130')](db['SmsAccount'],{});db[_0xab72('0xe0')][_0xab72('0x130')](db[_0xab72('0x100')],{'as':'List','foreignKey':'ListId'});db[_0xab72('0xe0')]['belongsTo'](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db['SmsQueueReport'][_0xab72('0x130')](db[_0xab72('0x55')],{});db[_0xab72('0xe0')][_0xab72('0x130')](db[_0xab72('0x57')],{});db[_0xab72('0xe0')][_0xab72('0x130')](db[_0xab72('0x14')],{});db[_0xab72('0xe0')][_0xab72('0x130')](db[_0xab72('0x58')],{});db[_0xab72('0xe5')][_0xab72('0x121')](db[_0xab72('0xde')],{'foreignKey':_0xab72('0x1e4')});db[_0xab72('0xe5')][_0xab72('0x121')](db[_0xab72('0xdc')],{'foreignKey':_0xab72('0x1e4')});db[_0xab72('0xe5')][_0xab72('0x121')](db['JscriptyAnswerReport'],{'foreignKey':_0xab72('0x1e4')});db[_0xab72('0xef')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':'Agents','through':_0xab72('0x138')});db['Team'][_0xab72('0x132')](db[_0xab72('0x1c')],{'through':_0xab72('0x115'),'as':'VoiceQueues'});db[_0xab72('0xef')][_0xab72('0x132')](db[_0xab72('0x140')],{'through':_0xab72('0x17f'),'as':_0xab72('0x141')});db[_0xab72('0xef')][_0xab72('0x132')](db[_0xab72('0x142')],{'through':_0xab72('0x1ac'),'as':_0xab72('0x143')});db[_0xab72('0xef')][_0xab72('0x132')](db[_0xab72('0x4e')],{'through':_0xab72('0x1e5'),'as':'FaxQueues'});db[_0xab72('0xef')][_0xab72('0x132')](db[_0xab72('0x58')],{'through':'team_has_sms_queues','as':_0xab72('0x145')});db[_0xab72('0xef')][_0xab72('0x132')](db[_0xab72('0x61')],{'through':_0xab72('0x1a2'),'as':_0xab72('0x146')});db['Team'][_0xab72('0x132')](db[_0xab72('0x147')],{'through':_0xab72('0x1e6'),'as':'WhatsappQueues'});db[_0xab72('0xef')]['belongsToMany'](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0xab72('0xf2')][_0xab72('0x121')](db['CmHopper'],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xab72('0xf2')][_0xab72('0x121')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xab72('0x1b4')});db['Campaign'][_0xab72('0x121')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xab72('0x1b4')});db[_0xab72('0xf2')][_0xab72('0x121')](db[_0xab72('0x15e')],{'as':'HopperBlacks','foreignKey':_0xab72('0x1b4')});db[_0xab72('0xf2')][_0xab72('0x130')](db['Trunk'],{'as':_0xab72('0x2d'),'foreignKey':_0xab72('0x160')});db[_0xab72('0xf2')]['belongsTo'](db[_0xab72('0x2d')],{'as':_0xab72('0x161'),'foreignKey':'TrunkBackupId'});db[_0xab72('0xf2')][_0xab72('0x130')](db[_0xab72('0x82')],{'as':_0xab72('0x82'),'foreignKey':_0xab72('0x163')});db[_0xab72('0xf2')]['belongsTo'](db[_0xab72('0xea')],{'as':_0xab72('0xea'),'foreignKey':_0xab72('0x1e7')});db[_0xab72('0xf2')][_0xab72('0x132')](db[_0xab72('0x100')],{'as':_0xab72('0x166'),'through':'campaigns_has_cm_lists'});db[_0xab72('0xf2')][_0xab72('0x132')](db['CmList'],{'as':_0xab72('0x169'),'through':_0xab72('0x1e8')});db[_0xab72('0xf6')][_0xab72('0x130')](db[_0xab72('0x18a')],{'as':'ChatOfflineMessage','foreignKey':_0xab72('0x1ab')});db[_0xab72('0xf9')]['belongsTo'](db['MailMessage'],{});db[_0xab72('0xf9')]['belongsTo'](db[_0xab72('0x128')],{});db[_0xab72('0xf9')]['belongsTo'](db['MailAccount'],{'foreignKey':_0xab72('0x1e9'),'as':_0xab72('0x1ea')});db['MailTransferReport']['belongsTo'](db[_0xab72('0x14')],{'foreignKey':_0xab72('0x1eb'),'as':_0xab72('0x1ec')});db[_0xab72('0xf9')][_0xab72('0x130')](db[_0xab72('0x14')],{'foreignKey':_0xab72('0x1ed'),'as':'ToAgent'});db[_0xab72('0xf9')]['belongsTo'](db[_0xab72('0x140')],{'foreignKey':_0xab72('0x1ee'),'as':_0xab72('0x1ef')});db[_0xab72('0xf9')][_0xab72('0x130')](db['MailAccount'],{'foreignKey':_0xab72('0x1f0'),'as':_0xab72('0x1f1')});db[_0xab72('0x1f2')]['belongsTo'](db[_0xab72('0x69')],{});db[_0xab72('0x1f2')][_0xab72('0x130')](db[_0xab72('0x67')],{});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0xab72('0x1ea')});db['ChatTransferReport'][_0xab72('0x130')](db['User'],{'foreignKey':_0xab72('0x1eb'),'as':_0xab72('0x1ec')});db[_0xab72('0x1f2')][_0xab72('0x130')](db[_0xab72('0x14')],{'foreignKey':_0xab72('0x1ed'),'as':_0xab72('0x1f3')});db[_0xab72('0x1f2')][_0xab72('0x130')](db[_0xab72('0x142')],{'foreignKey':_0xab72('0x1f4'),'as':_0xab72('0x1ef')});db[_0xab72('0x1f2')][_0xab72('0x130')](db[_0xab72('0x62')],{'foreignKey':_0xab72('0x1f5'),'as':_0xab72('0x1f1')});db[_0xab72('0xfc')][_0xab72('0x130')](db[_0xab72('0x4c')],{});db[_0xab72('0xfc')][_0xab72('0x130')](db[_0xab72('0x4b')],{});db[_0xab72('0xfc')][_0xab72('0x130')](db[_0xab72('0x47')],{'foreignKey':_0xab72('0x1f6'),'as':_0xab72('0x1ea')});db[_0xab72('0xfc')][_0xab72('0x130')](db[_0xab72('0x14')],{'foreignKey':_0xab72('0x1eb'),'as':_0xab72('0x1ec')});db['FaxTransferReport']['belongsTo'](db[_0xab72('0x14')],{'foreignKey':'ToUserId','as':_0xab72('0x1f3')});db[_0xab72('0xfc')][_0xab72('0x130')](db[_0xab72('0x4e')],{'foreignKey':_0xab72('0x1f7'),'as':'ToQueue'});db[_0xab72('0xfc')][_0xab72('0x130')](db[_0xab72('0x47')],{'foreignKey':_0xab72('0x1f8'),'as':'ToAccount'});db[_0xab72('0xfe')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xab72('0xfe')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0xab72('0xfe')]['belongsTo'](db[_0xab72('0x5a')],{'foreignKey':_0xab72('0x1f9'),'as':_0xab72('0x1ea')});db['OpenchannelTransferReport'][_0xab72('0x130')](db['User'],{'foreignKey':_0xab72('0x1eb'),'as':_0xab72('0x1ec')});db[_0xab72('0xfe')][_0xab72('0x130')](db[_0xab72('0x14')],{'foreignKey':_0xab72('0x1ed'),'as':_0xab72('0x1f3')});db['OpenchannelTransferReport'][_0xab72('0x130')](db['OpenchannelQueue'],{'foreignKey':_0xab72('0x1fa'),'as':_0xab72('0x1ef')});db[_0xab72('0xfe')][_0xab72('0x130')](db[_0xab72('0x5a')],{'foreignKey':_0xab72('0x1fb'),'as':'ToAccount'});db[_0xab72('0x1fc')]['belongsTo'](db[_0xab72('0x57')],{});db[_0xab72('0x1fc')]['belongsTo'](db[_0xab72('0x55')],{});db[_0xab72('0x1fc')][_0xab72('0x130')](db['SmsAccount'],{'foreignKey':_0xab72('0x1fd'),'as':_0xab72('0x1ea')});db[_0xab72('0x1fc')][_0xab72('0x130')](db[_0xab72('0x14')],{'foreignKey':'FromUserId','as':_0xab72('0x1ec')});db[_0xab72('0x1fc')][_0xab72('0x130')](db['User'],{'foreignKey':_0xab72('0x1ed'),'as':_0xab72('0x1f3')});db['SmsTransferReport']['belongsTo'](db[_0xab72('0x58')],{'foreignKey':_0xab72('0x1fe'),'as':_0xab72('0x1ef')});db[_0xab72('0x1fc')]['belongsTo'](db[_0xab72('0x52')],{'foreignKey':_0xab72('0x1ff'),'as':'ToAccount'});db['CmList']['hasMany'](db[_0xab72('0x7e')],{'as':_0xab72('0x197'),'foreignKey':_0xab72('0x17d'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x100')][_0xab72('0x121')](db[_0xab72('0x77')],{'as':_0xab72('0x200'),'foreignKey':'ListId'});db[_0xab72('0x100')][_0xab72('0x121')](db[_0xab72('0x6f')],{'as':_0xab72('0x135'),'onDelete':_0xab72('0x11e'),'foreignKey':_0xab72('0x17d')});db[_0xab72('0x100')]['hasMany'](db[_0xab72('0x73')],{'as':_0xab72('0x123'),'foreignKey':_0xab72('0x17d')});db[_0xab72('0x100')][_0xab72('0x121')](db[_0xab72('0x74')],{'as':_0xab72('0x124'),'foreignKey':'ListId'});db[_0xab72('0x100')][_0xab72('0x121')](db[_0xab72('0x75')],{'as':_0xab72('0x75'),'foreignKey':_0xab72('0x17d')});db[_0xab72('0x100')]['belongsToMany'](db[_0xab72('0x1c')],{'as':'Queues','through':_0xab72('0x167')});db[_0xab72('0x100')]['belongsToMany'](db['User'],{'as':_0xab72('0x168'),'through':_0xab72('0x137')});db['VoicePrefix']['hasMany'](db[_0xab72('0x122')],{'as':_0xab72('0x201'),'onDelete':_0xab72('0x11e')});db['VoicePrefix'][_0xab72('0x132')](db[_0xab72('0x14')],{'as':'Agents','through':_0xab72('0x118')});db[_0xab72('0x102')][_0xab72('0x132')](db[_0xab72('0xef')],{'through':_0xab72('0x116'),'as':_0xab72('0x180')});db[_0xab72('0x104')]['hasMany'](db[_0xab72('0x14')],{'as':'Users','foreignKey':_0xab72('0x131')});db[_0xab72('0x104')][_0xab72('0x121')](db[_0xab72('0x105')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0xab72('0x11e')});db['UserProfileSection'][_0xab72('0x121')](db['UserProfileResource'],{'as':_0xab72('0x202'),'foreignKey':_0xab72('0x203'),'onDelete':'cascade'});db[_0xab72('0x152')][_0xab72('0x121')](db[_0xab72('0x7e')],{'as':_0xab72('0x197'),'foreignKey':_0xab72('0x204'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x152')]['hasMany'](db[_0xab72('0x7c')],{'as':_0xab72('0x191'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xab72('0x121')](db['WhatsappMessage'],{'as':_0xab72('0x17a'),'foreignKey':_0xab72('0x204')});db[_0xab72('0x152')][_0xab72('0x121')](db[_0xab72('0x10c')],{'as':_0xab72('0x17b')});db[_0xab72('0x152')][_0xab72('0x121')](db[_0xab72('0x10a')],{'as':_0xab72('0x157'),'foreignKey':_0xab72('0x204'),'onDelete':_0xab72('0x11e')});db[_0xab72('0x152')][_0xab72('0x130')](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':_0xab72('0x17d')});db['WhatsappAccount'][_0xab72('0x130')](db['Pause'],{'as':_0xab72('0x164'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xab72('0x152')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':'Agents','through':_0xab72('0x153')});db[_0xab72('0x10a')][_0xab72('0x130')](db[_0xab72('0x14')],{'onDelete':_0xab72('0x175')});db[_0xab72('0x10a')]['belongsTo'](db[_0xab72('0x147')],{'onDelete':_0xab72('0x175')});db[_0xab72('0x10a')]['belongsTo'](db[_0xab72('0x152')],{'onDelete':'restrict'});db[_0xab72('0x10a')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xab72('0x163')});db[_0xab72('0x10a')]['belongsTo'](db[_0xab72('0x8d')],{'onDelete':_0xab72('0x175'),'foreignKey':_0xab72('0x18b')});db['WhatsappInteraction'][_0xab72('0x121')](db['WhatsappMessage'],{'as':_0xab72('0x17a'),'onDelete':'cascade','foreignKey':_0xab72('0x205')});db['WhatsappInteraction'][_0xab72('0x130')](db[_0xab72('0x152')],{'as':_0xab72('0x181'),'foreignKey':_0xab72('0x204')});db[_0xab72('0x10c')]['belongsTo'](db[_0xab72('0x6f')],{'as':_0xab72('0x18d'),'foreignKey':_0xab72('0x171')});db['WhatsappInteraction'][_0xab72('0x130')](db[_0xab72('0x14')],{'as':_0xab72('0x182'),'foreignKey':_0xab72('0x11f')});db[_0xab72('0x10c')][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x1c6'),'as':_0xab72('0x184')});db[_0xab72('0x10c')][_0xab72('0x132')](db[_0xab72('0x8d')],{'through':_0xab72('0x1c6'),'as':_0xab72('0x185')});db[_0xab72('0x10c')][_0xab72('0x132')](db[_0xab72('0x14')],{'as':_0xab72('0x186'),'through':_0xab72('0x13e'),'foreignKey':_0xab72('0x205')});db[_0xab72('0x10e')][_0xab72('0x130')](db['User'],{'as':_0xab72('0x14')});db[_0xab72('0x10e')][_0xab72('0x130')](db['CmContact'],{'onDelete':_0xab72('0x11e'),'as':_0xab72('0x18d')});db[_0xab72('0x10e')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0xab72('0x189'),'foreignKey':_0xab72('0x205')});db['WhatsappMessage'][_0xab72('0x130')](db[_0xab72('0x152')],{'as':_0xab72('0x181'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db[_0xab72('0x152')],{});db[_0xab72('0x110')]['belongsTo'](db[_0xab72('0x100')],{'as':_0xab72('0x193'),'foreignKey':'ListId'});db[_0xab72('0x110')][_0xab72('0x130')](db[_0xab72('0x6f')],{'as':'Contact','foreignKey':_0xab72('0x171')});db[_0xab72('0x110')][_0xab72('0x130')](db[_0xab72('0x10c')],{});db['WhatsappQueueReport'][_0xab72('0x130')](db[_0xab72('0x147')],{});db[_0xab72('0x110')][_0xab72('0x130')](db[_0xab72('0x10e')],{});db['WhatsappQueueReport']['belongsTo'](db['User'],{});db['WhatsappTransferReport'][_0xab72('0x130')](db['WhatsappMessage'],{});db[_0xab72('0x112')][_0xab72('0x130')](db[_0xab72('0x10c')],{});db[_0xab72('0x112')][_0xab72('0x130')](db[_0xab72('0x152')],{'foreignKey':'FromWhatsappAccountId','as':_0xab72('0x1ea')});db['WhatsappTransferReport'][_0xab72('0x130')](db[_0xab72('0x152')],{'foreignKey':_0xab72('0x206'),'as':_0xab72('0x1f1')});db['WhatsappTransferReport'][_0xab72('0x130')](db[_0xab72('0x147')],{'foreignKey':'ToQueueId','as':'ToQueue'});db['WhatsappTransferReport']['belongsTo'](db[_0xab72('0x14')],{'foreignKey':_0xab72('0x1eb'),'as':_0xab72('0x1ec')});db[_0xab72('0x112')][_0xab72('0x130')](db['User'],{'foreignKey':_0xab72('0x1ed'),'as':_0xab72('0x1f3')});db[_0xab72('0x147')]['belongsToMany'](db[_0xab72('0x14')],{'as':_0xab72('0x168'),'through':_0xab72('0x148'),'foreignKey':'WhatsappQueueId'});db[_0xab72('0x147')][_0xab72('0x132')](db[_0xab72('0xef')],{'through':_0xab72('0x1e6'),'as':'Teams'});db[_0xab72('0x11a')][_0xab72('0x130')](db['User'],{'as':_0xab72('0x207'),'foreignKey':'UserId','onDelete':_0xab72('0x11e'),'hooks':!![]});db['CloudProvider'][_0xab72('0x178')](db['Dynamics365Account'],{'as':_0xab72('0xcc'),'onDelete':_0xab72('0x175')});db['CloudProvider'][_0xab72('0x178')](db[_0xab72('0x172')],{'as':'Imap','onDelete':_0xab72('0x175')});db['CloudProvider'][_0xab72('0x178')](db[_0xab72('0x176')],{'as':'Smtp','onDelete':_0xab72('0x175')});module[_0xab72('0x208')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x4600=['../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/tag/tag.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','Integration','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','UserId','userSetting','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','Hoppers','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','FaxQueues','OpenchannelQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','ReportAgentPreview','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','BlackLists','ScreenRecording','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Messages','Interactions','List','TemplateId','user_has_mail_accounts','team_has_mail_queues','Teams','MailInteraction','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','DashboardItem','FaxAccountId','Exntensions','ListId','TagId','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','openchannel_interaction_has_tags','OpenchannelInteractionId','AttachmentId','UserOpenchannelQueue','team_has_openchannel_queues','Answers','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','ChatProactiveAction','Contacts','CompanyId','Phones','CmContactId','Company','cm_user_has_contacts','cm_contact_has_tags','CmHopperId','Queue','OwnerId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','whatsapp_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','Hopper','Trigger','AllCondition','AnyConditions','AnyCondition','Action','TriggerId','Fields','DefaultReportId','MetricId','SalesforceConfiguration','SalesforceField','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','VariableId','Configurations','AccountId','Field','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ChatQueueReport','FromId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','MailQueues','ChatQueues','OpenchannelQueues','team_has_whatsapp_queues','WhatsappQueues','CampaignId','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','CmCustomField','CustomFields','HopperHistory','Queues','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappAccount','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','utf8mb4','name','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','SmsApplication','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue'];(function(_0x5d1f17,_0x79a922){var _0xc80013=function(_0x377b66){while(--_0x377b66){_0x5d1f17['push'](_0x5d1f17['shift']());}};_0xc80013(++_0x79a922);}(_0x4600,0x191));var _0x0460=function(_0x539234,_0xbb7ffa){_0x539234=_0x539234-0x0;var _0x44b8cb=_0x4600[_0x539234];return _0x44b8cb;};'use strict';var config=require(_0x0460('0x0'));var Sequelize=require(_0x0460('0x1'));var _=require(_0x0460('0x2'));var jstz=require(_0x0460('0x3'));var timezone=jstz['determine']();config[_0x0460('0x1')]=_[_0x0460('0x4')](config[_0x0460('0x1')],{'database':_0x0460('0x5'),'username':_0x0460('0x6'),'password':_0x0460('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x0460('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x0460('0x9'),'collate':_0x0460('0xa')}}});config[_0x0460('0xb')]=_[_0x0460('0x4')](config[_0x0460('0xb')],{'database':_0x0460('0x5'),'username':_0x0460('0x6'),'password':_0x0460('0x7'),'options':{'host':_0x0460('0xc'),'port':0xcea,'dialect':_0x0460('0x8'),'dialectOptions':{'charset':_0x0460('0xd')},'logging':![],'timezone':timezone[_0x0460('0xe')](),'define':{'charset':'utf8','collate':_0x0460('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0460('0x1')][_0x0460('0xf')],config[_0x0460('0x1')]['username'],config[_0x0460('0x1')][_0x0460('0x10')],config[_0x0460('0x1')][_0x0460('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0460('0xb')][_0x0460('0xf')],config[_0x0460('0xb')][_0x0460('0x12')],config[_0x0460('0xb')]['password'],config[_0x0460('0xb')]['options'])};db[_0x0460('0x13')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x15'));db[_0x0460('0x16')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x17'));db[_0x0460('0x18')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x19'));db[_0x0460('0x1a')]=db['sequelize']['import']('../api/voiceExtension/voiceExtension.model');db[_0x0460('0x1b')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x1c'));db[_0x0460('0x1d')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x0460('0x1e')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x1f'));db[_0x0460('0x20')]=db[_0x0460('0x1')]['import']('../api/voiceMail/voiceMail.model');db[_0x0460('0x21')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x22'));db[_0x0460('0x23')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x24'));db[_0x0460('0x25')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x26'));db['VoiceAgentReport']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x27'));db['VoiceQueueReport']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x28'));db[_0x0460('0x29')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x2a'));db[_0x0460('0x2b')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x2c'));db[_0x0460('0x2d')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x2e'));db[_0x0460('0x2f')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x0460('0x30')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x31'));db[_0x0460('0x32')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x33'));db[_0x0460('0x34')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x35'));db[_0x0460('0x36')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x37'));db[_0x0460('0x38')]=db[_0x0460('0x1')]['import'](_0x0460('0x39'));db['UserOpenchannelQueue']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x3a'));db[_0x0460('0x3b')]=db[_0x0460('0x1')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x0460('0x3c')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x3d'));db['MailServerOut']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x3e'));db[_0x0460('0x3f')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x40'));db[_0x0460('0x41')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x42'));db[_0x0460('0x43')]=db[_0x0460('0x1')]['import'](_0x0460('0x44'));db['MailInteraction']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x45'));db[_0x0460('0x46')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x47'));db[_0x0460('0x48')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x49'));db[_0x0460('0x4a')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x4b'));db[_0x0460('0x4c')]=db['sequelize'][_0x0460('0x14')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x4d'));db[_0x0460('0x4e')]=db[_0x0460('0x1')]['import'](_0x0460('0x4f'));db[_0x0460('0x50')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x51'));db['FaxInteraction']=db[_0x0460('0x1')]['import'](_0x0460('0x52'));db[_0x0460('0x53')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/faxMessage/faxMessage.model');db[_0x0460('0x54')]=db['sequelize']['import'](_0x0460('0x55'));db[_0x0460('0x56')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x0460('0x57')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/smsAccount/smsAccount.model');db[_0x0460('0x58')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/smsApplication/smsApplication.model');db[_0x0460('0x59')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0x0460('0x5a')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x5b'));db[_0x0460('0x5c')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x5d'));db['OpenchannelAccount']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x5e'));db['OpenchannelApplication']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x5f'));db[_0x0460('0x60')]=db[_0x0460('0x1')]['import'](_0x0460('0x61'));db['OpenchannelMessage']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0x0460('0x62')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x63'));db['OpenchannelQueueReport']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x64'));db[_0x0460('0x65')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/chatApplication/chatApplication.model');db[_0x0460('0x66')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0x0460('0x67')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x68'));db['ChatOfflineMessage']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x69'));db[_0x0460('0x6a')]=db[_0x0460('0x1')]['import'](_0x0460('0x6b'));db[_0x0460('0x6c')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x6d'));db['ChatProactiveAction']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x6e'));db[_0x0460('0x6f')]=db[_0x0460('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0x0460('0x70')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/cmContact/cmContact.model');db[_0x0460('0x71')]=db[_0x0460('0x1')]['import']('../api/cmHopper/cmHopper.model');db[_0x0460('0x72')]=db[_0x0460('0x1')]['import'](_0x0460('0x73'));db[_0x0460('0x74')]=db['sequelize']['import'](_0x0460('0x75'));db['CmHopperHistory']=db['sequelize'][_0x0460('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x76'));db['CmCustomField']=db[_0x0460('0x1')]['import'](_0x0460('0x77'));db['Action']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x78'));db['Automation']=db[_0x0460('0x1')]['import'](_0x0460('0x79'));db[_0x0460('0x7a')]=db[_0x0460('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x0460('0x7b')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x7c'));db[_0x0460('0x7d')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x7e'));db[_0x0460('0x7f')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x80'));db[_0x0460('0x81')]=db[_0x0460('0x1')]['import'](_0x0460('0x82'));db[_0x0460('0x83')]=db['sequelize']['import'](_0x0460('0x84'));db[_0x0460('0x85')]=db[_0x0460('0x1')]['import'](_0x0460('0x86'));db[_0x0460('0x87')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/schedule/schedule.model');db[_0x0460('0x88')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/sound/sound.model');db['Tag']=db[_0x0460('0x1')]['import'](_0x0460('0x89'));db['ContactItemType']=db['sequelize'][_0x0460('0x14')]('../api/contactItemType/contactItemType.model');db[_0x0460('0x8a')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x8b'));db[_0x0460('0x8c')]=db[_0x0460('0x1')]['import'](_0x0460('0x8d'));db[_0x0460('0x8e')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x8f'));db['Trigger']=db[_0x0460('0x1')]['import'](_0x0460('0x90'));db[_0x0460('0x91')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x92'));db['Integration']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x93'));db['IntegrationReport']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/integrationReport/integrationReport.model');db[_0x0460('0x94')]=db[_0x0460('0x1')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x0460('0x95')]=db['sequelize']['import'](_0x0460('0x96'));db[_0x0460('0x97')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x98'));db['AnalyticMetric']=db[_0x0460('0x1')]['import'](_0x0460('0x99'));db[_0x0460('0x9a')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x9b'));db[_0x0460('0x9c')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x0460('0x9d')]=db['sequelize']['import'](_0x0460('0x9e'));db['SalesforceConfiguration']=db[_0x0460('0x1')]['import'](_0x0460('0x9f'));db['SalesforceField']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0460('0xa0')]=db[_0x0460('0x1')]['import'](_0x0460('0xa1'));db[_0x0460('0xa2')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xa3'));db[_0x0460('0xa4')]=db[_0x0460('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x0460('0xa5')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xa6'));db[_0x0460('0xa7')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xa8'));db[_0x0460('0xa9')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xaa'));db[_0x0460('0xab')]=db['sequelize'][_0x0460('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0x0460('0xac')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x0460('0x1')]['import'](_0x0460('0xad'));db[_0x0460('0xae')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xaf'));db['ZendeskConfiguration']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xb0'));db[_0x0460('0xb1')]=db['sequelize'][_0x0460('0x14')](_0x0460('0xb2'));db['FreshdeskAccount']=db['sequelize']['import'](_0x0460('0xb3'));db['FreshdeskConfiguration']=db['sequelize']['import'](_0x0460('0xb4'));db[_0x0460('0xb5')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xb6'));db[_0x0460('0xb7')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x0460('0xb8')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xb9'));db[_0x0460('0xba')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xbb'));db[_0x0460('0xbc')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xbd'));db[_0x0460('0xbe')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x0460('0xbf')]=db[_0x0460('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x0460('0xc0')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0460('0xc1')]=db[_0x0460('0x1')]['import'](_0x0460('0xc2'));db[_0x0460('0xc3')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xc4'));db[_0x0460('0xc5')]=db['sequelize'][_0x0460('0x14')](_0x0460('0xc6'));db[_0x0460('0xc7')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x0460('0xc8')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x0460('0xc9')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/integration/integration.model');db['Network']=db['sequelize'][_0x0460('0x14')](_0x0460('0xca'));db['ChatQueueReport']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x0460('0xcb')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xcc'));db[_0x0460('0xcd')]=db['sequelize']['import'](_0x0460('0xce'));db['JscriptyQuestionReport']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xcf'));db['JscriptySessionReport']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x0460('0x1')]['import'](_0x0460('0xd0'));db[_0x0460('0xd1')]=db['sequelize'][_0x0460('0x14')](_0x0460('0xd2'));db['SquareDetailsReport']=db[_0x0460('0x1')]['import'](_0x0460('0xd3'));db[_0x0460('0xd4')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xd5'));db[_0x0460('0xd6')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/setting/setting.model');db[_0x0460('0xd7')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xd8'));db[_0x0460('0xd9')]=db[_0x0460('0x1')]['import'](_0x0460('0xda'));db[_0x0460('0xdb')]=db['sequelize']['import']('../api/squareRecording/squareRecording.model');db[_0x0460('0xdc')]=db[_0x0460('0x1')]['import'](_0x0460('0xdd'));db['Team']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xde'));db['License']=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xdf'));db[_0x0460('0xe0')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xe1'));db[_0x0460('0xe2')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xe3'));db[_0x0460('0xe4')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xe5'));db['Plugin']=db[_0x0460('0x1')]['import']('../api/plugin/plugin.model');db[_0x0460('0xe6')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xe7'));db[_0x0460('0xe8')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xe9'));db[_0x0460('0xea')]=db['sequelize']['import'](_0x0460('0xeb'));db['OpenchannelTransferReport']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x0460('0xec')]=db[_0x0460('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0x0460('0xed')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/cmList/cmList.model');db[_0x0460('0xee')]=db['sequelize'][_0x0460('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0x0460('0xef')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0xf0'));db[_0x0460('0xf1')]=db['sequelize'][_0x0460('0x14')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x0460('0x1')][_0x0460('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0x0460('0xf2')]=db['sequelize'][_0x0460('0x14')](_0x0460('0xf3'));db['WhatsappAccount']=db[_0x0460('0x1')]['import'](_0x0460('0xf4'));db[_0x0460('0xf5')]=db[_0x0460('0x1')]['import'](_0x0460('0xf6'));db[_0x0460('0xf7')]=db['sequelize'][_0x0460('0x14')](_0x0460('0xf8'));db[_0x0460('0xf9')]=db[_0x0460('0x1')]['import'](_0x0460('0xfa'));db[_0x0460('0xfb')]=db[_0x0460('0x1')]['import'](_0x0460('0xfc'));db[_0x0460('0xfd')]=db['sequelize'][_0x0460('0x14')](_0x0460('0xfe'));db[_0x0460('0xff')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x100'));db[_0x0460('0x101')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x102'));db[_0x0460('0x103')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x104'));db[_0x0460('0x105')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x106'));db[_0x0460('0x107')]=db[_0x0460('0x1')][_0x0460('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x0460('0x108')]=db['sequelize'][_0x0460('0x14')](_0x0460('0x109'));db[_0x0460('0x10a')]=db[_0x0460('0x1')][_0x0460('0x14')](_0x0460('0x10b'));db['User'][_0x0460('0x10c')](db[_0x0460('0x20')],{'as':_0x0460('0x20'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')][_0x0460('0x10c')](db[_0x0460('0x108')],{'as':_0x0460('0x10f'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')]['hasMany'](db[_0x0460('0x1e')],{'as':_0x0460('0x110'),'foreignKey':'UserId'});db[_0x0460('0x13')][_0x0460('0x111')](db[_0x0460('0x2f')],{'as':_0x0460('0x112'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')][_0x0460('0x111')](db['VoiceExtension'],{'as':_0x0460('0x113'),'onDelete':'cascade','hooks':!![]});db['User'][_0x0460('0x111')](db[_0x0460('0x74')],{'as':_0x0460('0x114'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')][_0x0460('0x111')](db[_0x0460('0x115')],{'as':'HopperHistory','foreignKey':'UserId'});db['User']['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x0460('0x13')][_0x0460('0x111')](db[_0x0460('0x60')],{'as':_0x0460('0x116'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x0460('0x66')],{'as':_0x0460('0x117'),'foreignKey':'UserId'});db[_0x0460('0x13')][_0x0460('0x111')](db[_0x0460('0x59')],{'as':_0x0460('0x118'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')][_0x0460('0x111')](db[_0x0460('0x119')],{'as':_0x0460('0x11a'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')]['hasMany'](db['MailInteraction'],{'as':_0x0460('0x11b'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')][_0x0460('0x111')](db[_0x0460('0xf7')],{'as':'WhatsappInteractions','foreignKey':_0x0460('0x10e')});db[_0x0460('0x13')]['hasMany'](db[_0x0460('0xf2')],{'as':_0x0460('0x11c'),'foreignKey':'SenderId'});db['User']['hasMany'](db[_0x0460('0x71')],{'as':_0x0460('0x11d'),'foreignKey':'UserId','onDelete':'SET\x20NULL'});db[_0x0460('0x13')][_0x0460('0x11e')](db[_0x0460('0xef')],{'as':_0x0460('0xef'),'foreignKey':_0x0460('0x11f')});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0x0460('0x120'),'through':_0x0460('0x121')});db[_0x0460('0x13')]['belongsToMany'](db[_0x0460('0x70')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0xed')],{'as':'Lists','through':_0x0460('0x123')});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x124')],{'through':_0x0460('0x125')});db[_0x0460('0x13')][_0x0460('0x122')](db['MailInteraction'],{'as':_0x0460('0x11b'),'through':_0x0460('0x126')});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x66')],{'as':'ChatInteractions','through':_0x0460('0x127')});db[_0x0460('0x13')]['belongsToMany'](db[_0x0460('0x119')],{'as':_0x0460('0x11a'),'through':_0x0460('0x128')});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x59')],{'as':_0x0460('0x118'),'through':'user_has_sms_interactions'});db[_0x0460('0x13')]['belongsToMany'](db[_0x0460('0x60')],{'as':_0x0460('0x116'),'through':_0x0460('0x129')});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0xf7')],{'as':'WhatsappInteractions','through':_0x0460('0x12a')});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x1d')],{'as':_0x0460('0x12b'),'through':_0x0460('0x30'),'required':![]});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0xee')],{'as':_0x0460('0x12c'),'through':_0x0460('0x107'),'required':![]});db[_0x0460('0x13')][_0x0460('0x122')](db['MailQueue'],{'as':'MailQueues','through':_0x0460('0x34'),'required':![]});db[_0x0460('0x13')]['belongsToMany'](db[_0x0460('0x6a')],{'as':'ChatQueues','through':_0x0460('0x32'),'required':![],'hooks':!![]});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x54')],{'as':_0x0460('0x12d'),'through':_0x0460('0x36'),'required':![]});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x5c')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x0460('0x13')]['belongsToMany'](db[_0x0460('0x12e')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x0460('0x13')]['belongsToMany'](db[_0x0460('0xff')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0xed')],{'through':_0x0460('0x123')});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x62')],{'as':_0x0460('0x12f'),'through':_0x0460('0x130')});db['User'][_0x0460('0x122')](db['FaxAccount'],{'as':_0x0460('0x131'),'through':_0x0460('0x132')});db[_0x0460('0x13')][_0x0460('0x122')](db[_0x0460('0x3f')],{'as':_0x0460('0x133'),'through':'user_has_mail_accounts'});db['User'][_0x0460('0x122')](db[_0x0460('0x134')],{'as':_0x0460('0x135'),'through':_0x0460('0x136')});db[_0x0460('0x13')]['belongsToMany'](db['SmsAccount'],{'as':_0x0460('0x137'),'through':_0x0460('0x138')});db[_0x0460('0x13')][_0x0460('0x122')](db['WhatsappAccount'],{'as':_0x0460('0x139'),'through':_0x0460('0x13a')});db[_0x0460('0x16')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x0460('0x18')][_0x0460('0x111')](db[_0x0460('0x1a')],{'onDelete':_0x0460('0x10d')});db[_0x0460('0x1a')][_0x0460('0x111')](db['VoiceExtension'],{'as':_0x0460('0x13b'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x1b')][_0x0460('0x122')](db[_0x0460('0x88')],{'as':_0x0460('0x13c'),'through':_0x0460('0x13d')});db['VoiceQueue'][_0x0460('0x111')](db[_0x0460('0x2f')],{'as':_0x0460('0x13e'),'foreignKey':_0x0460('0x13f')});db[_0x0460('0x1d')][_0x0460('0x111')](db[_0x0460('0x71')],{'as':_0x0460('0x11d'),'foreignKey':_0x0460('0x13f')});db[_0x0460('0x1d')][_0x0460('0x111')](db['CmHopperFinal'],{'as':_0x0460('0x114'),'foreignKey':_0x0460('0x13f')});db[_0x0460('0x1d')][_0x0460('0x111')](db[_0x0460('0x115')],{'as':_0x0460('0x140'),'foreignKey':_0x0460('0x13f')});db[_0x0460('0x1d')][_0x0460('0x111')](db[_0x0460('0x141')],{'as':_0x0460('0x141'),'foreignKey':_0x0460('0x13f')});db[_0x0460('0x1d')][_0x0460('0x111')](db['CmHopperBlack'],{'as':_0x0460('0x142'),'foreignKey':_0x0460('0x13f')});db[_0x0460('0x1d')][_0x0460('0x111')](db[_0x0460('0x143')],{'as':_0x0460('0x144'),'foreignKey':_0x0460('0x13f')});db[_0x0460('0x1d')][_0x0460('0x11e')](db[_0x0460('0x2b')],{'as':_0x0460('0x2b'),'foreignKey':_0x0460('0x145')});db[_0x0460('0x1d')]['belongsTo'](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x0460('0x146')});db[_0x0460('0x1d')][_0x0460('0x11e')](db[_0x0460('0x7f')],{'as':_0x0460('0x7f'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x1d')][_0x0460('0x11e')](db[_0x0460('0x81')],{'as':_0x0460('0x148'),'foreignKey':_0x0460('0x149')});db[_0x0460('0x1d')][_0x0460('0x122')](db[_0x0460('0xed')],{'as':_0x0460('0x14a'),'through':_0x0460('0x14b')});db[_0x0460('0x1d')][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':_0x0460('0x30')});db['VoiceQueue'][_0x0460('0x122')](db[_0x0460('0x124')],{'as':'Teams','through':_0x0460('0x103')});db[_0x0460('0x1d')]['belongsToMany'](db[_0x0460('0xed')],{'as':_0x0460('0x14d'),'through':'voice_queues_has_cm_blacklists'});db[_0x0460('0x1e')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x13'),'foreignKey':'UserId'});db[_0x0460('0x14e')]['belongsTo'](db[_0x0460('0x13')],{'as':_0x0460('0x13'),'foreignKey':_0x0460('0x10e')});db['VoiceMail'][_0x0460('0x111')](db['VoiceMailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0460('0x14f'),'sourceKey':_0x0460('0x150')});db['VoiceMailMessage']['belongsTo'](db[_0x0460('0x20')],{'foreignKey':_0x0460('0x14f'),'targetKey':_0x0460('0x150')});db[_0x0460('0x23')]['hasMany'](db[_0x0460('0x151')],{'as':'QueueCalls','foreignKey':_0x0460('0x152'),'constraints':![]});db[_0x0460('0x23')]['hasMany'](db['VoiceAgentReport'],{'as':_0x0460('0x153'),'foreignKey':_0x0460('0x152'),'constraints':![]});db[_0x0460('0x23')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x13'),'foreignKey':_0x0460('0x10e')});db['VoiceCallReport'][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x3c')][_0x0460('0x11e')](db[_0x0460('0x3f')],{'as':'MailAccount','foreignKey':_0x0460('0x156')});db[_0x0460('0x3c')][_0x0460('0x11e')](db[_0x0460('0x101')],{'as':_0x0460('0x101'),'foreignKey':_0x0460('0x157'),'onDelete':_0x0460('0x158')});db['MailServerOut'][_0x0460('0x11e')](db[_0x0460('0x3f')],{'as':_0x0460('0x3f'),'foreignKey':_0x0460('0x156')});db['MailServerOut'][_0x0460('0x11e')](db[_0x0460('0x101')],{'as':_0x0460('0x101'),'foreignKey':'CloudProviderId','onDelete':_0x0460('0x158')});db[_0x0460('0x3f')][_0x0460('0x10c')](db[_0x0460('0x3c')],{'as':_0x0460('0x159'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x3f')][_0x0460('0x10c')](db['MailServerOut'],{'as':_0x0460('0x15a'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x3f')]['hasMany'](db[_0x0460('0x7b')],{'as':_0x0460('0x15b'),'foreignKey':_0x0460('0x156'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x3f')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x0460('0x156')});db[_0x0460('0x3f')][_0x0460('0x111')](db['MailMessage'],{'as':_0x0460('0x15c'),'foreignKey':_0x0460('0x156')});db[_0x0460('0x3f')][_0x0460('0x111')](db['MailInteraction'],{'as':_0x0460('0x15d')});db[_0x0460('0x3f')]['hasMany'](db[_0x0460('0x48')],{'as':'Applications','foreignKey':'MailAccountId','onDelete':_0x0460('0x10d')});db[_0x0460('0x3f')]['belongsTo'](db[_0x0460('0xed')],{'as':_0x0460('0x15e'),'foreignKey':'ListId'});db['MailAccount'][_0x0460('0x11e')](db[_0x0460('0x8e')],{'as':_0x0460('0x8e'),'foreignKey':_0x0460('0x15f')});db[_0x0460('0x3f')][_0x0460('0x11e')](db[_0x0460('0x81')],{'as':_0x0460('0x148'),'foreignKey':_0x0460('0x149')});db[_0x0460('0x3f')]['belongsToMany'](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':_0x0460('0x160')});db[_0x0460('0x41')]['belongsToMany'](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':_0x0460('0x34')});db[_0x0460('0x41')][_0x0460('0x122')](db[_0x0460('0x124')],{'through':_0x0460('0x161'),'as':_0x0460('0x162')});db['MailInteraction'][_0x0460('0x111')](db['MailMessage'],{'as':_0x0460('0x15c'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x0460('0x163')][_0x0460('0x11e')](db[_0x0460('0x3f')],{'as':_0x0460('0x164'),'foreignKey':'MailAccountId'});db[_0x0460('0x163')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':'ContactId'});db[_0x0460('0x163')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x165'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x163')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':_0x0460('0x167'),'as':_0x0460('0x168')});db['MailInteraction']['belongsToMany'](db[_0x0460('0x166')],{'through':_0x0460('0x167'),'as':_0x0460('0x169')});db['MailInteraction']['belongsToMany'](db[_0x0460('0x13')],{'as':_0x0460('0x16a'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db[_0x0460('0xe4')],{'as':_0x0460('0x16b'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x46')][_0x0460('0x11e')](db['User'],{'as':_0x0460('0x13')});db[_0x0460('0x46')][_0x0460('0x11e')](db['CmContact'],{'onDelete':'cascade','as':_0x0460('0x154')});db[_0x0460('0x46')]['belongsTo'](db[_0x0460('0x163')],{'as':_0x0460('0x16c'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0460('0x11e')](db[_0x0460('0x3f')],{'as':'Account','foreignKey':_0x0460('0x156')});db[_0x0460('0x46')][_0x0460('0x11e')](db[_0x0460('0x62')],{'as':_0x0460('0x62'),'foreignKey':'ChatWebsiteId'});db[_0x0460('0x46')][_0x0460('0x11e')](db['ChatOfflineMessage'],{'as':_0x0460('0x16d'),'foreignKey':_0x0460('0x16e')});db[_0x0460('0x48')][_0x0460('0x11e')](db['User'],{'onDelete':_0x0460('0x158')});db[_0x0460('0x48')][_0x0460('0x11e')](db[_0x0460('0x41')],{'onDelete':'restrict'});db[_0x0460('0x48')][_0x0460('0x11e')](db[_0x0460('0x3f')],{'onDelete':_0x0460('0x158')});db[_0x0460('0x48')]['belongsTo'](db['Interval'],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x48')][_0x0460('0x11e')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x0460('0x4a')]['belongsTo'](db[_0x0460('0x3f')],{});db[_0x0460('0x4a')][_0x0460('0x11e')](db['CmList'],{'as':_0x0460('0x15e'),'foreignKey':'ListId'});db[_0x0460('0x4a')]['belongsTo'](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db['MailQueueReport'][_0x0460('0x11e')](db[_0x0460('0x163')],{});db[_0x0460('0x4a')]['belongsTo'](db[_0x0460('0x46')],{});db[_0x0460('0x4a')]['belongsTo'](db[_0x0460('0x13')],{});db['MailQueueReport']['belongsTo'](db['MailQueue'],{});db[_0x0460('0x4c')][_0x0460('0x111')](db[_0x0460('0x16f')],{'as':'Items','onDelete':_0x0460('0x10d')});db['FaxAccount']['hasMany'](db[_0x0460('0x7b')],{'as':_0x0460('0x15b'),'foreignKey':_0x0460('0x170'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x4e')][_0x0460('0x111')](db[_0x0460('0x7a')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0x0460('0x4e')][_0x0460('0x111')](db[_0x0460('0x119')],{'as':_0x0460('0x15d')});db[_0x0460('0x4e')][_0x0460('0x111')](db[_0x0460('0x50')],{'as':_0x0460('0x13b'),'foreignKey':_0x0460('0x170'),'onDelete':_0x0460('0x10d')});db['FaxAccount'][_0x0460('0x111')](db[_0x0460('0x1a')],{'as':_0x0460('0x171'),'onDelete':_0x0460('0x10d')});db['FaxAccount'][_0x0460('0x111')](db['FaxMessage'],{'as':_0x0460('0x15c')});db['FaxAccount'][_0x0460('0x11e')](db[_0x0460('0x2b')],{'as':_0x0460('0x2b')});db[_0x0460('0x4e')][_0x0460('0x11e')](db['CmList'],{'as':_0x0460('0x15e'),'foreignKey':_0x0460('0x172')});db[_0x0460('0x4e')][_0x0460('0x11e')](db[_0x0460('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x0460('0x149')});db['FaxAccount'][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':'user_has_fax_accounts'});db[_0x0460('0x50')][_0x0460('0x11e')](db[_0x0460('0x13')],{'onDelete':_0x0460('0x158')});db[_0x0460('0x50')][_0x0460('0x11e')](db[_0x0460('0x54')],{'onDelete':_0x0460('0x158')});db[_0x0460('0x50')][_0x0460('0x11e')](db['FaxAccount'],{'onDelete':_0x0460('0x158')});db[_0x0460('0x50')][_0x0460('0x11e')](db[_0x0460('0x166')],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x173')});db[_0x0460('0x119')][_0x0460('0x111')](db[_0x0460('0x53')],{'as':_0x0460('0x15c'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x174')});db[_0x0460('0x119')][_0x0460('0x11e')](db[_0x0460('0x4e')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x170')});db[_0x0460('0x119')][_0x0460('0x11e')](db['CmContact'],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x119')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x165'),'foreignKey':'UserId'});db[_0x0460('0x119')][_0x0460('0x122')](db['Tag'],{'through':_0x0460('0x175'),'as':_0x0460('0x168')});db[_0x0460('0x119')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':'fax_interaction_has_tags','as':_0x0460('0x169')});db['FaxInteraction'][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x16a'),'through':_0x0460('0x128'),'foreignKey':_0x0460('0x174')});db[_0x0460('0x53')]['belongsTo'](db[_0x0460('0x13')],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x13')});db[_0x0460('0x53')]['belongsTo'](db[_0x0460('0x119')],{'as':'Interaction','foreignKey':_0x0460('0x174')});db[_0x0460('0x53')][_0x0460('0x11e')](db[_0x0460('0x70')],{'onDelete':'cascade','as':_0x0460('0x154')});db['FaxMessage'][_0x0460('0x11e')](db[_0x0460('0xe4')],{'as':_0x0460('0xe4'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0x0460('0x11e')](db['FaxAccount'],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x170')});db[_0x0460('0x54')][_0x0460('0x122')](db['User'],{'as':_0x0460('0x14c'),'through':_0x0460('0x36')});db[_0x0460('0x54')][_0x0460('0x122')](db[_0x0460('0x124')],{'through':_0x0460('0x176'),'as':'Teams'});db['FaxQueueReport'][_0x0460('0x11e')](db[_0x0460('0x4e')],{});db[_0x0460('0x56')][_0x0460('0x11e')](db[_0x0460('0xed')],{'as':'List','foreignKey':'ListId'});db['FaxQueueReport'][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x56')]['belongsTo'](db[_0x0460('0x119')],{});db[_0x0460('0x56')][_0x0460('0x11e')](db[_0x0460('0x53')],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db['FaxQueueReport'][_0x0460('0x11e')](db['FaxQueue'],{});db[_0x0460('0x57')][_0x0460('0x111')](db['Disposition'],{'as':_0x0460('0x15b'),'foreignKey':'SmsAccountId','onDelete':_0x0460('0x10d')});db[_0x0460('0x57')][_0x0460('0x111')](db[_0x0460('0x7a')],{'as':'Answers','foreignKey':_0x0460('0x177')});db['SmsAccount'][_0x0460('0x111')](db[_0x0460('0x5a')],{'as':_0x0460('0x15c'),'foreignKey':_0x0460('0x177')});db['SmsAccount'][_0x0460('0x111')](db[_0x0460('0x59')],{'as':_0x0460('0x15d')});db[_0x0460('0x57')]['hasMany'](db[_0x0460('0x58')],{'as':_0x0460('0x13b'),'foreignKey':_0x0460('0x177'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x57')]['belongsTo'](db['CmList'],{'as':_0x0460('0x15e'),'foreignKey':'ListId'});db[_0x0460('0x57')][_0x0460('0x11e')](db[_0x0460('0x81')],{'as':_0x0460('0x148'),'foreignKey':_0x0460('0x149')});db[_0x0460('0x57')]['belongsToMany'](db['User'],{'as':_0x0460('0x14c'),'through':'user_has_sms_accounts'});db[_0x0460('0x58')]['belongsTo'](db[_0x0460('0x13')],{'onDelete':_0x0460('0x158')});db[_0x0460('0x58')][_0x0460('0x11e')](db['SmsQueue'],{'onDelete':_0x0460('0x158')});db['SmsApplication'][_0x0460('0x11e')](db['SmsAccount'],{'onDelete':_0x0460('0x158')});db['SmsApplication']['belongsTo'](db[_0x0460('0x7f')],{'onDelete':_0x0460('0x158'),'foreignKey':'IntervalId'});db[_0x0460('0x58')][_0x0460('0x11e')](db[_0x0460('0x166')],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x173')});db[_0x0460('0x59')][_0x0460('0x111')](db[_0x0460('0x5a')],{'as':'Messages','onDelete':_0x0460('0x10d'),'foreignKey':'SmsInteractionId'});db[_0x0460('0x59')][_0x0460('0x11e')](db[_0x0460('0x57')],{'as':_0x0460('0x164'),'foreignKey':'SmsAccountId'});db[_0x0460('0x59')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x59')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x165'),'foreignKey':'UserId'});db[_0x0460('0x59')][_0x0460('0x122')](db['Tag'],{'through':_0x0460('0x178'),'as':_0x0460('0x168')});db[_0x0460('0x59')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':_0x0460('0x178'),'as':_0x0460('0x169')});db[_0x0460('0x59')][_0x0460('0x122')](db['User'],{'as':_0x0460('0x16a'),'through':_0x0460('0x179'),'foreignKey':_0x0460('0x17a')});db[_0x0460('0x5a')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x13')});db['SmsMessage'][_0x0460('0x11e')](db[_0x0460('0x70')],{'onDelete':'cascade','as':_0x0460('0x154')});db[_0x0460('0x5a')][_0x0460('0x11e')](db['SmsInteraction'],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x16c'),'foreignKey':_0x0460('0x17a')});db[_0x0460('0x5a')][_0x0460('0x11e')](db[_0x0460('0x57')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x177')});db['SmsQueue']['belongsToMany'](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':_0x0460('0x38'),'foreignKey':_0x0460('0x17b')});db['SmsQueue'][_0x0460('0x122')](db[_0x0460('0x124')],{'through':_0x0460('0x17c'),'as':'Teams'});db['OpenchannelAccount'][_0x0460('0x111')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x0460('0x17d'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x134')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x0460('0x17d')});db[_0x0460('0x134')][_0x0460('0x111')](db[_0x0460('0x60')],{'as':_0x0460('0x15d'),'foreignKey':_0x0460('0x17d')});db[_0x0460('0x134')][_0x0460('0x111')](db[_0x0460('0x17e')],{'as':_0x0460('0x15c'),'foreignKey':'OpenchannelAccountId'});db[_0x0460('0x134')][_0x0460('0x111')](db[_0x0460('0x17f')],{'as':_0x0460('0x13b'),'foreignKey':'OpenchannelAccountId','onDelete':_0x0460('0x10d')});db[_0x0460('0x134')]['belongsTo'](db[_0x0460('0xed')],{'as':_0x0460('0x15e'),'foreignKey':_0x0460('0x172')});db[_0x0460('0x134')]['belongsTo'](db[_0x0460('0x81')],{'as':_0x0460('0x148'),'foreignKey':_0x0460('0x149')});db[_0x0460('0x134')][_0x0460('0x122')](db[_0x0460('0x13')],{'as':'Agents','through':_0x0460('0x136')});db[_0x0460('0x17f')][_0x0460('0x11e')](db[_0x0460('0x13')],{'onDelete':_0x0460('0x158')});db[_0x0460('0x17f')][_0x0460('0x11e')](db[_0x0460('0x12e')],{'onDelete':_0x0460('0x158'),'foreignKey':'OpenchannelQueueId'});db[_0x0460('0x17f')]['belongsTo'](db[_0x0460('0x134')],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x17d')});db[_0x0460('0x17f')]['belongsTo'](db[_0x0460('0x7f')],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x17f')][_0x0460('0x11e')](db['Tag'],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x173')});db[_0x0460('0x60')][_0x0460('0x111')](db[_0x0460('0x17e')],{'as':_0x0460('0x15c'),'onDelete':_0x0460('0x10d'),'foreignKey':'OpenchannelInteractionId'});db[_0x0460('0x60')][_0x0460('0x11e')](db[_0x0460('0x134')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x17d')});db[_0x0460('0x60')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x60')]['belongsTo'](db[_0x0460('0x13')],{'as':'Owner','foreignKey':_0x0460('0x10e')});db[_0x0460('0x60')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':_0x0460('0x180'),'as':_0x0460('0x168')});db['OpenchannelInteraction'][_0x0460('0x122')](db[_0x0460('0x166')],{'through':'openchannel_interaction_has_tags','as':_0x0460('0x169')});db[_0x0460('0x60')][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x16a'),'through':_0x0460('0x129'),'foreignKey':_0x0460('0x181')});db[_0x0460('0x17e')]['belongsTo'](db[_0x0460('0x13')],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x13')});db['OpenchannelMessage']['belongsTo'](db[_0x0460('0x70')],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x154')});db[_0x0460('0x17e')][_0x0460('0x11e')](db['OpenchannelInteraction'],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x16c'),'foreignKey':_0x0460('0x181')});db[_0x0460('0x17e')][_0x0460('0x11e')](db[_0x0460('0xe4')],{'as':_0x0460('0xe4'),'foreignKey':_0x0460('0x182')});db[_0x0460('0x17e')][_0x0460('0x11e')](db['OpenchannelAccount'],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x17d')});db[_0x0460('0x12e')][_0x0460('0x122')](db['User'],{'as':_0x0460('0x14c'),'through':_0x0460('0x183'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x0460('0x122')](db['Team'],{'through':_0x0460('0x184'),'as':_0x0460('0x162')});db['ChatWebsite'][_0x0460('0x111')](db[_0x0460('0x7b')],{'as':_0x0460('0x15b'),'foreignKey':'ChatWebsiteId','onDelete':_0x0460('0x10d')});db[_0x0460('0x62')][_0x0460('0x111')](db[_0x0460('0x7a')],{'as':_0x0460('0x185'),'foreignKey':_0x0460('0x186')});db['ChatWebsite'][_0x0460('0x111')](db['ChatProactiveAction'],{'as':_0x0460('0x187')});db[_0x0460('0x62')][_0x0460('0x111')](db[_0x0460('0x66')],{'as':_0x0460('0x15d')});db[_0x0460('0x62')][_0x0460('0x111')](db['ChatApplication'],{'as':'Applications','foreignKey':_0x0460('0x186'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x62')]['hasMany'](db[_0x0460('0x67')],{'as':_0x0460('0x15c')});db[_0x0460('0x62')][_0x0460('0x11e')](db[_0x0460('0xed')],{'as':_0x0460('0x15e'),'foreignKey':_0x0460('0x172')});db['ChatWebsite']['belongsTo'](db[_0x0460('0x7f')],{'as':_0x0460('0x7f'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x62')][_0x0460('0x11e')](db[_0x0460('0x3f')],{'as':_0x0460('0x3f'),'foreignKey':_0x0460('0x156')});db[_0x0460('0x62')][_0x0460('0x11e')](db['Pause'],{'as':_0x0460('0x148'),'foreignKey':_0x0460('0x149')});db[_0x0460('0x62')][_0x0460('0x122')](db[_0x0460('0x13')],{'as':'Agents','through':_0x0460('0x130')});db[_0x0460('0x188')]['belongsTo'](db[_0x0460('0x134')],{});db['OpenchannelQueueReport'][_0x0460('0x11e')](db[_0x0460('0xed')],{'as':_0x0460('0x15e'),'foreignKey':'ListId'});db[_0x0460('0x188')]['belongsTo'](db[_0x0460('0x70')],{'as':'Contact','foreignKey':_0x0460('0x155')});db[_0x0460('0x188')][_0x0460('0x11e')](db[_0x0460('0x60')],{});db[_0x0460('0x188')][_0x0460('0x11e')](db[_0x0460('0x17e')],{});db['OpenchannelQueueReport'][_0x0460('0x11e')](db[_0x0460('0x13')],{});db['OpenchannelQueueReport'][_0x0460('0x11e')](db['OpenchannelQueue'],{});db[_0x0460('0x65')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x189'),'foreignKey':_0x0460('0x10e'),'onDelete':_0x0460('0x158')});db[_0x0460('0x65')]['belongsTo'](db['ChatQueue'],{'as':'Queue','foreignKey':_0x0460('0x18a'),'onDelete':_0x0460('0x158')});db[_0x0460('0x65')][_0x0460('0x11e')](db[_0x0460('0x62')],{'as':_0x0460('0x18b'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x0460('0x65')][_0x0460('0x11e')](db['Tag'],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x173')});db[_0x0460('0x66')][_0x0460('0x111')](db[_0x0460('0x67')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0460('0x18c')});db[_0x0460('0x66')][_0x0460('0x11e')](db[_0x0460('0x62')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x186')});db[_0x0460('0x66')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x66')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x165'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x66')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction'][_0x0460('0x122')](db[_0x0460('0x166')],{'through':_0x0460('0x18d'),'as':_0x0460('0x169')});db[_0x0460('0x66')]['belongsToMany'](db[_0x0460('0x13')],{'as':'Users','through':_0x0460('0x127'),'foreignKey':_0x0460('0x18c')});db[_0x0460('0x67')][_0x0460('0x11e')](db[_0x0460('0x13')],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x13')});db['ChatMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0460('0x155')});db[_0x0460('0x67')][_0x0460('0x11e')](db['ChatInteraction'],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x16c'),'foreignKey':_0x0460('0x18c')});db[_0x0460('0x67')][_0x0460('0x11e')](db[_0x0460('0xe4')],{'as':_0x0460('0xe4'),'foreignKey':'AttachmentId'});db[_0x0460('0x67')]['belongsTo'](db[_0x0460('0x62')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x186')});db['ChatOfflineMessage'][_0x0460('0x111')](db[_0x0460('0xe4')],{'as':_0x0460('0x16b'),'foreignKey':_0x0460('0x16e'),'onDelete':_0x0460('0x10d'),'hooks':!![]});db[_0x0460('0x16d')][_0x0460('0x11e')](db[_0x0460('0x70')],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x154'),'foreignKey':'ContactId'});db[_0x0460('0x16d')][_0x0460('0x11e')](db[_0x0460('0x62')],{'as':_0x0460('0x164'),'foreignKey':'ChatWebsiteId'});db[_0x0460('0x6a')][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':_0x0460('0x32'),'hooks':!![]});db[_0x0460('0x6a')][_0x0460('0x122')](db[_0x0460('0x124')],{'through':_0x0460('0x18e'),'as':'Teams'});db['ChatGroup'][_0x0460('0x111')](db[_0x0460('0xcb')],{'as':_0x0460('0x15c'),'foreignKey':_0x0460('0x18f'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x6c')][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x13e'),'through':_0x0460('0x121')});db[_0x0460('0x190')][_0x0460('0x11e')](db[_0x0460('0x62')],{'as':_0x0460('0x18b'),'foreignKey':_0x0460('0x186')});db[_0x0460('0x6f')][_0x0460('0x111')](db['CmContact'],{'as':_0x0460('0x191'),'foreignKey':_0x0460('0x192')});db[_0x0460('0x70')]['hasMany'](db['CmContactHasItem'],{'as':_0x0460('0x193'),'foreignKey':_0x0460('0x194')});db['CmContact']['hasMany'](db[_0x0460('0x71')],{'as':'Hoppers','foreignKey':_0x0460('0x155')});db[_0x0460('0x70')][_0x0460('0x111')](db[_0x0460('0x74')],{'as':_0x0460('0x114'),'foreignKey':'ContactId'});db['CmContact'][_0x0460('0x111')](db['CmHopperHistory'],{'as':_0x0460('0x140'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x70')]['hasMany'](db[_0x0460('0x141')],{'as':_0x0460('0x141'),'foreignKey':_0x0460('0x155')});db[_0x0460('0x70')][_0x0460('0x111')](db[_0x0460('0x143')],{'as':_0x0460('0x144'),'foreignKey':_0x0460('0x155')});db['CmContact']['hasMany'](db[_0x0460('0x60')],{'as':_0x0460('0x116'),'foreignKey':_0x0460('0x155'),'onDelete':_0x0460('0x158')});db[_0x0460('0x70')]['hasMany'](db[_0x0460('0x66')],{'as':_0x0460('0x117'),'foreignKey':_0x0460('0x155'),'onDelete':_0x0460('0x158')});db[_0x0460('0x70')][_0x0460('0x111')](db[_0x0460('0x59')],{'as':'SmsInteractions','foreignKey':_0x0460('0x155'),'onDelete':_0x0460('0x158')});db['CmContact'][_0x0460('0x111')](db[_0x0460('0x119')],{'as':_0x0460('0x11a'),'foreignKey':_0x0460('0x155'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x0460('0x163')],{'as':'MailInteractions','foreignKey':_0x0460('0x155'),'onDelete':'restrict'});db[_0x0460('0x70')][_0x0460('0x11e')](db[_0x0460('0x6f')],{'as':_0x0460('0x195'),'foreignKey':'CompanyId'});db[_0x0460('0x70')][_0x0460('0x11e')](db[_0x0460('0xed')],{'as':_0x0460('0x15e'),'foreignKey':'ListId','onDelete':_0x0460('0x10d')});db['CmContact'][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x16a'),'through':_0x0460('0x196')});db[_0x0460('0x70')]['belongsToMany'](db[_0x0460('0x166')],{'as':_0x0460('0x168'),'through':'cm_contact_has_tags'});db[_0x0460('0x70')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':_0x0460('0x197'),'as':'ThroughTags'});db[_0x0460('0x71')][_0x0460('0x111')](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':_0x0460('0x198')});db[_0x0460('0x71')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x71')][_0x0460('0x11e')](db[_0x0460('0xed')],{'as':'List','foreignKey':_0x0460('0x172'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x71')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x189'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0x71')][_0x0460('0x11e')](db[_0x0460('0x1d')],{'as':_0x0460('0x199'),'foreignKey':_0x0460('0x13f'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x71')][_0x0460('0x11e')](db[_0x0460('0xe0')],{'as':_0x0460('0xe0'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x0460('0x71')][_0x0460('0x11e')](db['User'],{'as':_0x0460('0x165'),'foreignKey':_0x0460('0x19a')});db['CmHopperBlack']['belongsTo'](db['CmContact'],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155'),'onDelete':_0x0460('0x10d')});db['CmHopperBlack'][_0x0460('0x11e')](db['CmList'],{'as':'List','foreignKey':_0x0460('0x172'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x72')][_0x0460('0x11e')](db[_0x0460('0x1d')],{'as':'Queue','foreignKey':_0x0460('0x13f'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x72')][_0x0460('0x11e')](db[_0x0460('0xe0')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x0460('0x19b')][_0x0460('0x111')](db[_0x0460('0x7d')],{'as':{'plural':_0x0460('0x19c'),'singular':_0x0460('0x19d')},'foreignKey':_0x0460('0x19e'),'onDelete':_0x0460('0x10d'),'hooks':!![]});db[_0x0460('0x19b')][_0x0460('0x111')](db[_0x0460('0x7d')],{'as':{'plural':_0x0460('0x19f'),'singular':_0x0460('0x1a0')},'foreignKey':_0x0460('0x1a1'),'onDelete':_0x0460('0x10d'),'hooks':!![]});db[_0x0460('0x19b')][_0x0460('0x111')](db['Action'],{'as':_0x0460('0x1a2'),'foreignKey':'AutomationId','onDelete':_0x0460('0x10d'),'hooks':!![]});db[_0x0460('0x7b')]['hasMany'](db['Disposition'],{'as':_0x0460('0x15b'),'foreignKey':_0x0460('0x1a3'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x7f')][_0x0460('0x111')](db[_0x0460('0x7f')],{'as':_0x0460('0x1a4'),'foreignKey':_0x0460('0x147'),'onDelete':_0x0460('0x10d'),'hooks':!![],'required':![]});db[_0x0460('0x7f')][_0x0460('0x111')](db[_0x0460('0x1a')],{'as':_0x0460('0x113'),'foreignKey':_0x0460('0x147'),'onDelete':_0x0460('0x158')});db['Interval'][_0x0460('0x111')](db[_0x0460('0x48')],{'as':_0x0460('0x1a5'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x7f')][_0x0460('0x111')](db['ChatApplication'],{'as':_0x0460('0x1a6'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x7f')]['hasMany'](db['FaxApplication'],{'as':_0x0460('0x1a7'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x7f')][_0x0460('0x111')](db[_0x0460('0x58')],{'as':_0x0460('0x1a8'),'foreignKey':_0x0460('0x147')});db[_0x0460('0x87')]['belongsTo'](db['MailAccount'],{});db[_0x0460('0x87')]['belongsTo'](db[_0x0460('0x95')],{'foreignKey':'DefaultReportId'});db[_0x0460('0x87')]['belongsTo'](db[_0x0460('0x94')],{'foreignKey':_0x0460('0x1a9')});db['Sound'][_0x0460('0x122')](db[_0x0460('0x1b')],{'as':_0x0460('0x1aa'),'through':_0x0460('0x13d'),'onDelete':_0x0460('0x158')});db[_0x0460('0x166')][_0x0460('0x122')](db[_0x0460('0x70')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0460('0x122')](db['ChatInteraction'],{'through':_0x0460('0x18d')});db[_0x0460('0x166')]['belongsToMany'](db[_0x0460('0x163')],{'through':'mail_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x0460('0x59')],{'through':_0x0460('0x178')});db[_0x0460('0x166')][_0x0460('0x122')](db[_0x0460('0x119')],{'through':_0x0460('0x175')});db['Tag'][_0x0460('0x122')](db['OpenchannelInteraction'],{'through':_0x0460('0x180')});db['Tag'][_0x0460('0x122')](db[_0x0460('0xf7')],{'through':_0x0460('0x1ab')});db['CmContactHasItem'][_0x0460('0x11e')](db[_0x0460('0x1ac')],{'as':_0x0460('0x1ad'),'foreignKey':_0x0460('0x1ae')});db[_0x0460('0x8c')]['belongsTo'](db[_0x0460('0x71')],{'as':_0x0460('0x1af'),'foreignKey':_0x0460('0x198')});db[_0x0460('0x8a')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x194')});db[_0x0460('0x1b0')][_0x0460('0x111')](db[_0x0460('0x7d')],{'as':{'plural':'AllConditions','singular':_0x0460('0x1b1')},'foreignKey':'TriggerAllId','onDelete':_0x0460('0x10d'),'hooks':!![]});db[_0x0460('0x1b0')][_0x0460('0x111')](db[_0x0460('0x7d')],{'as':{'plural':_0x0460('0x1b2'),'singular':_0x0460('0x1b3')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x0460('0x1b0')]['hasMany'](db[_0x0460('0x1b4')],{'as':'Actions','foreignKey':_0x0460('0x1b5'),'onDelete':_0x0460('0x10d'),'hooks':!![]});db[_0x0460('0x94')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1a9'),'hooks':!![]});db[_0x0460('0x95')][_0x0460('0x111')](db[_0x0460('0x9a')],{'as':_0x0460('0x1b6'),'onDelete':'cascade','foreignKey':_0x0460('0x1b7')});db['AnalyticMetric'][_0x0460('0x111')](db[_0x0460('0x9a')],{'as':_0x0460('0x1b6'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1b8')});db[_0x0460('0x9a')][_0x0460('0x11e')](db['AnalyticMetric'],{'foreignKey':_0x0460('0x1b8')});db[_0x0460('0x9d')][_0x0460('0x111')](db[_0x0460('0x1b9')],{'as':'Configurations','onDelete':_0x0460('0x10d'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0460('0x111')](db[_0x0460('0x1ba')],{'as':_0x0460('0x1bb'),'onDelete':'cascade','foreignKey':_0x0460('0x1bc')});db[_0x0460('0x1b9')][_0x0460('0x111')](db[_0x0460('0x1ba')],{'as':_0x0460('0x1bd'),'onDelete':_0x0460('0x10d'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0x0460('0x111')](db[_0x0460('0x1ba')],{'as':_0x0460('0x1b6'),'onDelete':'cascade','foreignKey':_0x0460('0x1be')});db[_0x0460('0x1b9')][_0x0460('0x11e')](db['SalesforceAccount'],{'as':_0x0460('0x164'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x0460('0x1bf'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0x1ba')][_0x0460('0x111')](db['SalesforceField'],{'as':_0x0460('0x1c0'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0x1ba')][_0x0460('0x111')](db[_0x0460('0x1ba')],{'as':'Field','foreignKey':_0x0460('0x1be')});db[_0x0460('0x1ba')]['belongsTo'](db[_0x0460('0x91')],{'as':_0x0460('0x91'),'foreignKey':_0x0460('0x1c2')});db[_0x0460('0xa0')][_0x0460('0x111')](db[_0x0460('0xa2')],{'as':_0x0460('0x1c3'),'onDelete':_0x0460('0x10d'),'foreignKey':'AccountId'});db[_0x0460('0xa2')][_0x0460('0x111')](db[_0x0460('0xa4')],{'as':_0x0460('0x1bb'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0xa2')][_0x0460('0x111')](db[_0x0460('0xa4')],{'as':_0x0460('0x1bd'),'onDelete':_0x0460('0x10d'),'foreignKey':'DescriptionId'});db[_0x0460('0xa2')][_0x0460('0x111')](db[_0x0460('0xa4')],{'as':_0x0460('0x1b6'),'onDelete':'cascade','foreignKey':_0x0460('0x1be')});db['SugarcrmConfiguration'][_0x0460('0x11e')](db[_0x0460('0xa0')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x1c4')});db['SugarcrmField'][_0x0460('0x111')](db[_0x0460('0xa4')],{'as':_0x0460('0x1bf'),'foreignKey':'SubjectId'});db[_0x0460('0xa4')]['hasMany'](db[_0x0460('0xa4')],{'as':_0x0460('0x1c0'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xa4')][_0x0460('0x111')](db[_0x0460('0xa4')],{'as':_0x0460('0x1c5'),'foreignKey':_0x0460('0x1be')});db['SugarcrmField'][_0x0460('0x11e')](db[_0x0460('0x91')],{'as':_0x0460('0x91'),'foreignKey':_0x0460('0x1c2')});db[_0x0460('0xa5')]['hasMany'](db[_0x0460('0xa7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x0460('0x1c4')});db[_0x0460('0xa7')][_0x0460('0x111')](db[_0x0460('0xa9')],{'as':_0x0460('0x1bb'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0xa7')][_0x0460('0x111')](db[_0x0460('0xa9')],{'as':_0x0460('0x1bd'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xa7')][_0x0460('0x111')](db[_0x0460('0xa9')],{'as':_0x0460('0x1b6'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0xa7')][_0x0460('0x11e')](db[_0x0460('0xa5')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x1c4')});db[_0x0460('0xa7')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':'int_desk_configuration_has_tags'});db[_0x0460('0xa9')]['hasMany'](db[_0x0460('0xa9')],{'as':'Subject','foreignKey':_0x0460('0x1bc')});db[_0x0460('0xa9')][_0x0460('0x111')](db[_0x0460('0xa9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0460('0xa9')][_0x0460('0x111')](db[_0x0460('0xa9')],{'as':_0x0460('0x1c5'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0xa9')][_0x0460('0x11e')](db[_0x0460('0x91')],{'as':_0x0460('0x91'),'foreignKey':_0x0460('0x1c2')});db[_0x0460('0xab')][_0x0460('0x111')](db[_0x0460('0xac')],{'as':'Configurations','onDelete':_0x0460('0x10d'),'foreignKey':'AccountId'});db['ZohoConfiguration'][_0x0460('0x111')](db[_0x0460('0x1c6')],{'as':_0x0460('0x1bb'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0xac')]['hasMany'](db[_0x0460('0x1c6')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x0460('0x1c1')});db['ZohoConfiguration'][_0x0460('0x111')](db[_0x0460('0x1c6')],{'as':'Fields','onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1be')});db['ZohoConfiguration'][_0x0460('0x11e')](db[_0x0460('0xab')],{'as':'Account','foreignKey':_0x0460('0x1c4')});db[_0x0460('0x1c6')][_0x0460('0x111')](db[_0x0460('0x1c6')],{'as':_0x0460('0x1bf'),'foreignKey':_0x0460('0x1bc')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':'Description','foreignKey':_0x0460('0x1c1')});db[_0x0460('0x1c6')][_0x0460('0x111')](db[_0x0460('0x1c6')],{'as':_0x0460('0x1c5'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0x1c6')][_0x0460('0x11e')](db[_0x0460('0x91')],{'as':_0x0460('0x91'),'foreignKey':_0x0460('0x1c2')});db[_0x0460('0xae')][_0x0460('0x111')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x0460('0x10d'),'foreignKey':'AccountId'});db[_0x0460('0x1c7')][_0x0460('0x111')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x0460('0x1bc')});db['ZendeskConfiguration'][_0x0460('0x111')](db[_0x0460('0xb1')],{'as':_0x0460('0x1bd'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0x1c7')][_0x0460('0x111')](db['ZendeskField'],{'as':_0x0460('0x1b6'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0x1c7')][_0x0460('0x11e')](db[_0x0460('0xae')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x1c4')});db[_0x0460('0x1c7')]['belongsToMany'](db[_0x0460('0x166')],{'through':_0x0460('0x1c8')});db[_0x0460('0xb1')]['hasMany'](db['ZendeskField'],{'as':_0x0460('0x1bf'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0xb1')]['hasMany'](db[_0x0460('0xb1')],{'as':_0x0460('0x1c0'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xb1')][_0x0460('0x111')](db[_0x0460('0xb1')],{'as':_0x0460('0x1c5'),'foreignKey':'FieldId'});db[_0x0460('0xb1')][_0x0460('0x11e')](db[_0x0460('0x91')],{'as':_0x0460('0x91'),'foreignKey':_0x0460('0x1c2')});db[_0x0460('0x1c9')][_0x0460('0x111')](db[_0x0460('0x1ca')],{'as':_0x0460('0x1c3'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1c4')});db[_0x0460('0x1ca')][_0x0460('0x111')](db[_0x0460('0xb5')],{'as':_0x0460('0x1bb'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0x1ca')][_0x0460('0x111')](db['FreshdeskField'],{'as':_0x0460('0x1bd'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0x1ca')][_0x0460('0x111')](db[_0x0460('0xb5')],{'as':_0x0460('0x1b6'),'onDelete':'cascade','foreignKey':_0x0460('0x1be')});db[_0x0460('0x1ca')][_0x0460('0x11e')](db['FreshdeskAccount'],{'as':_0x0460('0x164'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x0460('0x122')](db['Tag'],{'through':_0x0460('0x1cb')});db['FreshdeskField'][_0x0460('0x111')](db['FreshdeskField'],{'as':_0x0460('0x1bf'),'foreignKey':'SubjectId'});db[_0x0460('0xb5')][_0x0460('0x111')](db['FreshdeskField'],{'as':_0x0460('0x1c0'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xb5')][_0x0460('0x111')](db[_0x0460('0xb5')],{'as':_0x0460('0x1c5'),'foreignKey':'FieldId'});db[_0x0460('0xb5')][_0x0460('0x11e')](db[_0x0460('0x91')],{'as':'Variable','foreignKey':'VariableId'});db[_0x0460('0xb7')][_0x0460('0x111')](db[_0x0460('0xb8')],{'as':_0x0460('0x1c3'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1c4')});db[_0x0460('0xb8')][_0x0460('0x111')](db['VtigerField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x0460('0xb8')][_0x0460('0x111')](db['VtigerField'],{'as':_0x0460('0x1bd'),'foreignKey':_0x0460('0x1c1')});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0x0460('0x1b6'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0xb8')][_0x0460('0x11e')](db[_0x0460('0xb7')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x1c4')});db[_0x0460('0xba')][_0x0460('0x111')](db[_0x0460('0xba')],{'as':_0x0460('0x1bf'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0xba')][_0x0460('0x111')](db['VtigerField'],{'as':_0x0460('0x1c0'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xba')][_0x0460('0x111')](db['VtigerField'],{'as':'Field','foreignKey':_0x0460('0x1be')});db[_0x0460('0xba')][_0x0460('0x11e')](db['Variable'],{'as':'Variable','foreignKey':_0x0460('0x1c2')});db[_0x0460('0xbc')][_0x0460('0x111')](db[_0x0460('0xbe')],{'as':'Configurations','onDelete':_0x0460('0x10d'),'foreignKey':'AccountId'});db[_0x0460('0xbe')][_0x0460('0x111')](db[_0x0460('0xbf')],{'as':_0x0460('0x1bb'),'foreignKey':'SubjectId'});db[_0x0460('0xbe')][_0x0460('0x111')](db[_0x0460('0xbf')],{'as':_0x0460('0x1bd'),'foreignKey':'DescriptionId'});db[_0x0460('0xbe')][_0x0460('0x111')](db[_0x0460('0xbf')],{'as':_0x0460('0x1b6'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0xbe')]['belongsTo'](db['ServicenowAccount'],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x1c4')});db['ServicenowField'][_0x0460('0x111')](db['ServicenowField'],{'as':_0x0460('0x1bf'),'foreignKey':_0x0460('0x1bc')});db['ServicenowField']['hasMany'](db[_0x0460('0xbf')],{'as':_0x0460('0x1c0'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xbf')][_0x0460('0x111')](db[_0x0460('0xbf')],{'as':'Field','foreignKey':'FieldId'});db[_0x0460('0xbf')][_0x0460('0x11e')](db[_0x0460('0x91')],{'as':_0x0460('0x91'),'foreignKey':'VariableId'});db[_0x0460('0xc0')][_0x0460('0x111')](db[_0x0460('0xc1')],{'as':'Configurations','onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1c4')});db[_0x0460('0xc0')][_0x0460('0x11e')](db[_0x0460('0x101')],{'as':_0x0460('0x101'),'foreignKey':_0x0460('0x157')});db[_0x0460('0xc1')][_0x0460('0x111')](db[_0x0460('0xc3')],{'as':'Subjects','onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0xc1')][_0x0460('0x111')](db[_0x0460('0xc3')],{'as':_0x0460('0x1bd'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xc1')][_0x0460('0x111')](db[_0x0460('0xc3')],{'as':_0x0460('0x1b6'),'onDelete':_0x0460('0x10d'),'foreignKey':'FieldId'});db[_0x0460('0xc1')]['belongsTo'](db[_0x0460('0xc0')],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x1c4')});db['Dynamics365Field'][_0x0460('0x111')](db[_0x0460('0xc3')],{'as':_0x0460('0x1bf'),'foreignKey':_0x0460('0x1bc')});db[_0x0460('0xc3')][_0x0460('0x111')](db[_0x0460('0xc3')],{'as':_0x0460('0x1c0'),'foreignKey':_0x0460('0x1c1')});db[_0x0460('0xc3')][_0x0460('0x111')](db[_0x0460('0xc3')],{'as':'Field','foreignKey':_0x0460('0x1be')});db[_0x0460('0xc3')]['belongsTo'](db[_0x0460('0x91')],{'as':_0x0460('0x91'),'foreignKey':'VariableId'});db[_0x0460('0xc5')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x0460('0x1c3'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1c4')});db[_0x0460('0xc7')][_0x0460('0x111')](db[_0x0460('0xc8')],{'as':'Subjects','foreignKey':_0x0460('0x1bc')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x0460('0x1bd'),'foreignKey':_0x0460('0x1c1')});db['FreshsalesConfiguration'][_0x0460('0x111')](db[_0x0460('0xc8')],{'as':_0x0460('0x1b6'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0xc7')][_0x0460('0x11e')](db[_0x0460('0xc5')],{'as':'Account','foreignKey':_0x0460('0x1c4')});db['FreshsalesField']['hasMany'](db[_0x0460('0xc8')],{'as':'Subject','foreignKey':_0x0460('0x1bc')});db[_0x0460('0xc8')][_0x0460('0x111')](db[_0x0460('0xc8')],{'as':_0x0460('0x1c0'),'foreignKey':'DescriptionId'});db[_0x0460('0xc8')][_0x0460('0x111')](db[_0x0460('0xc8')],{'as':_0x0460('0x1c5'),'foreignKey':_0x0460('0x1be')});db[_0x0460('0xc8')][_0x0460('0x11e')](db[_0x0460('0x91')],{'as':'Variable','foreignKey':_0x0460('0x1c2')});db[_0x0460('0x1cc')][_0x0460('0x11e')](db[_0x0460('0x62')],{});db[_0x0460('0x1cc')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x0460('0x172')});db[_0x0460('0x1cc')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':'Contact','foreignKey':_0x0460('0x155')});db[_0x0460('0x1cc')][_0x0460('0x11e')](db[_0x0460('0x66')],{});db[_0x0460('0x1cc')][_0x0460('0x11e')](db[_0x0460('0x67')],{});db[_0x0460('0x1cc')][_0x0460('0x11e')](db[_0x0460('0x13')],{});db[_0x0460('0x1cc')][_0x0460('0x11e')](db[_0x0460('0x6a')],{});db['ChatInternalMessage'][_0x0460('0x11e')](db['User'],{'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1cd')});db['ChatInternalMessage'][_0x0460('0x11e')](db[_0x0460('0x13')],{'onDelete':'cascade','foreignKey':'ToId'});db[_0x0460('0x143')][_0x0460('0x111')](db[_0x0460('0x1ce')],{'foreignKey':_0x0460('0x1cf'),'onDelete':'cascade'});db[_0x0460('0x143')][_0x0460('0x111')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x0460('0x10d')});db[_0x0460('0x1d0')][_0x0460('0x11e')](db[_0x0460('0x57')],{});db[_0x0460('0x1d0')][_0x0460('0x11e')](db[_0x0460('0xed')],{'as':'List','foreignKey':_0x0460('0x172')});db[_0x0460('0x1d0')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':'ContactId'});db[_0x0460('0x1d0')]['belongsTo'](db[_0x0460('0x59')],{});db[_0x0460('0x1d0')][_0x0460('0x11e')](db[_0x0460('0x5a')],{});db[_0x0460('0x1d0')][_0x0460('0x11e')](db[_0x0460('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0x0460('0x5c')],{});db[_0x0460('0xd4')]['hasMany'](db[_0x0460('0x143')],{'foreignKey':_0x0460('0x1d1')});db[_0x0460('0xd4')]['hasMany'](db[_0x0460('0x1ce')],{'foreignKey':_0x0460('0x1d1')});db[_0x0460('0xd4')][_0x0460('0x111')](db['JscriptyAnswerReport'],{'foreignKey':_0x0460('0x1d1')});db['Team'][_0x0460('0x122')](db[_0x0460('0x13')],{'as':'Agents','through':'user_has_teams'});db[_0x0460('0x124')]['belongsToMany'](db['VoiceQueue'],{'through':_0x0460('0x103'),'as':_0x0460('0x12b')});db['Team'][_0x0460('0x122')](db[_0x0460('0x41')],{'through':'team_has_mail_queues','as':_0x0460('0x1d2')});db[_0x0460('0x124')][_0x0460('0x122')](db[_0x0460('0x6a')],{'through':_0x0460('0x18e'),'as':_0x0460('0x1d3')});db[_0x0460('0x124')]['belongsToMany'](db[_0x0460('0x54')],{'through':'team_has_fax_queues','as':_0x0460('0x12d')});db[_0x0460('0x124')][_0x0460('0x122')](db['SmsQueue'],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0x0460('0x124')][_0x0460('0x122')](db[_0x0460('0x12e')],{'through':_0x0460('0x184'),'as':_0x0460('0x1d4')});db[_0x0460('0x124')]['belongsToMany'](db[_0x0460('0xff')],{'through':_0x0460('0x1d5'),'as':_0x0460('0x1d6')});db[_0x0460('0x124')][_0x0460('0x122')](db[_0x0460('0xee')],{'through':_0x0460('0x105'),'as':_0x0460('0x12c')});db[_0x0460('0xe0')][_0x0460('0x111')](db[_0x0460('0x71')],{'as':_0x0460('0x11d'),'foreignKey':_0x0460('0x1d7')});db['Campaign'][_0x0460('0x111')](db['CmHopperFinal'],{'as':_0x0460('0x114'),'foreignKey':'CampaignId'});db[_0x0460('0xe0')][_0x0460('0x111')](db['CmHopperHistory'],{'as':_0x0460('0x140'),'foreignKey':'CampaignId'});db[_0x0460('0xe0')][_0x0460('0x111')](db['CmHopperBlack'],{'as':_0x0460('0x142'),'foreignKey':'CampaignId'});db[_0x0460('0xe0')][_0x0460('0x11e')](db[_0x0460('0x2b')],{'as':'Trunk','foreignKey':_0x0460('0x145')});db[_0x0460('0xe0')][_0x0460('0x11e')](db[_0x0460('0x2b')],{'as':_0x0460('0x1d8'),'foreignKey':_0x0460('0x146')});db[_0x0460('0xe0')][_0x0460('0x11e')](db[_0x0460('0x7f')],{'as':'Interval','foreignKey':_0x0460('0x147')});db[_0x0460('0xe0')][_0x0460('0x11e')](db['SquareProject'],{'as':_0x0460('0xd9'),'foreignKey':_0x0460('0x1d9')});db[_0x0460('0xe0')][_0x0460('0x122')](db[_0x0460('0xed')],{'as':_0x0460('0x14a'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x0460('0x122')](db[_0x0460('0xed')],{'as':_0x0460('0x14d'),'through':_0x0460('0x1da')});db[_0x0460('0xe4')]['belongsTo'](db[_0x0460('0x16d')],{'as':_0x0460('0x16d'),'foreignKey':_0x0460('0x16e')});db[_0x0460('0xe6')][_0x0460('0x11e')](db[_0x0460('0x46')],{});db[_0x0460('0xe6')][_0x0460('0x11e')](db['MailInteraction'],{});db[_0x0460('0xe6')][_0x0460('0x11e')](db[_0x0460('0x3f')],{'foreignKey':_0x0460('0x1db'),'as':_0x0460('0x1dc')});db['MailTransferReport'][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1dd'),'as':_0x0460('0x1de')});db[_0x0460('0xe6')][_0x0460('0x11e')](db['User'],{'foreignKey':_0x0460('0x1df'),'as':_0x0460('0x1e0')});db[_0x0460('0xe6')][_0x0460('0x11e')](db['MailQueue'],{'foreignKey':_0x0460('0x1e1'),'as':'ToQueue'});db['MailTransferReport']['belongsTo'](db[_0x0460('0x3f')],{'foreignKey':_0x0460('0x1e2'),'as':_0x0460('0x1e3')});db[_0x0460('0xe8')][_0x0460('0x11e')](db[_0x0460('0x67')],{});db['ChatTransferReport'][_0x0460('0x11e')](db['ChatInteraction'],{});db[_0x0460('0xe8')][_0x0460('0x11e')](db[_0x0460('0x62')],{'foreignKey':_0x0460('0x1e4'),'as':'FromAccount'});db[_0x0460('0xe8')][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1dd'),'as':'FromAgent'});db[_0x0460('0xe8')][_0x0460('0x11e')](db['User'],{'foreignKey':_0x0460('0x1df'),'as':_0x0460('0x1e0')});db['ChatTransferReport']['belongsTo'](db[_0x0460('0x6a')],{'foreignKey':'ToChatQueueId','as':_0x0460('0x1e5')});db[_0x0460('0xe8')][_0x0460('0x11e')](db[_0x0460('0x62')],{'foreignKey':_0x0460('0x1e6'),'as':_0x0460('0x1e3')});db[_0x0460('0xea')][_0x0460('0x11e')](db[_0x0460('0x53')],{});db['FaxTransferReport'][_0x0460('0x11e')](db[_0x0460('0x119')],{});db[_0x0460('0xea')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x0460('0x1e7'),'as':_0x0460('0x1dc')});db[_0x0460('0xea')][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1dd'),'as':'FromAgent'});db[_0x0460('0xea')][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1df'),'as':_0x0460('0x1e0')});db[_0x0460('0xea')][_0x0460('0x11e')](db['FaxQueue'],{'foreignKey':_0x0460('0x1e8'),'as':_0x0460('0x1e5')});db['FaxTransferReport'][_0x0460('0x11e')](db[_0x0460('0x4e')],{'foreignKey':'ToFaxAccountId','as':_0x0460('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelMessage'],{});db[_0x0460('0x1e9')][_0x0460('0x11e')](db[_0x0460('0x60')],{});db[_0x0460('0x1e9')][_0x0460('0x11e')](db[_0x0460('0x134')],{'foreignKey':_0x0460('0x1ea'),'as':'FromAccount'});db[_0x0460('0x1e9')][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1dd'),'as':_0x0460('0x1de')});db[_0x0460('0x1e9')][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0460('0x1e9')][_0x0460('0x11e')](db['OpenchannelQueue'],{'foreignKey':_0x0460('0x1eb'),'as':_0x0460('0x1e5')});db['OpenchannelTransferReport'][_0x0460('0x11e')](db[_0x0460('0x134')],{'foreignKey':_0x0460('0x1ec'),'as':_0x0460('0x1e3')});db[_0x0460('0xec')]['belongsTo'](db[_0x0460('0x5a')],{});db['SmsTransferReport'][_0x0460('0x11e')](db['SmsInteraction'],{});db[_0x0460('0xec')][_0x0460('0x11e')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x0460('0x1dc')});db['SmsTransferReport']['belongsTo'](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1dd'),'as':_0x0460('0x1de')});db[_0x0460('0xec')][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1df'),'as':'ToAgent'});db[_0x0460('0xec')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0x0460('0x1ed'),'as':_0x0460('0x1e5')});db[_0x0460('0xec')][_0x0460('0x11e')](db[_0x0460('0x57')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x0460('0xed')][_0x0460('0x111')](db[_0x0460('0x7b')],{'as':_0x0460('0x15b'),'foreignKey':'ListId','onDelete':_0x0460('0x10d')});db[_0x0460('0xed')]['hasMany'](db[_0x0460('0x1ee')],{'as':_0x0460('0x1ef'),'foreignKey':_0x0460('0x172')});db['CmList'][_0x0460('0x111')](db['CmContact'],{'as':_0x0460('0x191'),'onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x172')});db[_0x0460('0xed')]['hasMany'](db[_0x0460('0x74')],{'as':_0x0460('0x114'),'foreignKey':_0x0460('0x172')});db[_0x0460('0xed')][_0x0460('0x111')](db['CmHopperHistory'],{'as':_0x0460('0x1f0'),'foreignKey':_0x0460('0x172')});db[_0x0460('0xed')][_0x0460('0x111')](db['ReportAgentPreview'],{'as':_0x0460('0x141'),'foreignKey':'ListId'});db['CmList'][_0x0460('0x122')](db['VoiceQueue'],{'as':_0x0460('0x1f1'),'through':_0x0460('0x14b')});db[_0x0460('0xed')][_0x0460('0x122')](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':_0x0460('0x123')});db[_0x0460('0xee')][_0x0460('0x111')](db['VoiceExtension'],{'as':_0x0460('0x113'),'onDelete':'cascade'});db[_0x0460('0xee')]['belongsToMany'](db[_0x0460('0x13')],{'as':_0x0460('0x14c'),'through':_0x0460('0x107')});db['VoicePrefix'][_0x0460('0x122')](db['Team'],{'through':_0x0460('0x105'),'as':_0x0460('0x162')});db[_0x0460('0xef')][_0x0460('0x111')](db[_0x0460('0x13')],{'as':_0x0460('0x16a'),'foreignKey':_0x0460('0x11f')});db[_0x0460('0xef')][_0x0460('0x111')](db[_0x0460('0xf1')],{'as':_0x0460('0x1f2'),'foreignKey':_0x0460('0x11f'),'onDelete':'cascade'});db[_0x0460('0xf1')]['hasMany'](db[_0x0460('0x1f3')],{'as':_0x0460('0x1f4'),'foreignKey':'sectionId','onDelete':_0x0460('0x10d')});db['WhatsappAccount'][_0x0460('0x111')](db[_0x0460('0x7b')],{'as':'Dispositions','foreignKey':_0x0460('0x1f5'),'onDelete':_0x0460('0x10d')});db['WhatsappAccount']['hasMany'](db[_0x0460('0x7a')],{'as':_0x0460('0x185'),'foreignKey':_0x0460('0x1f5')});db[_0x0460('0x1f6')][_0x0460('0x111')](db[_0x0460('0xf9')],{'as':'Messages','foreignKey':_0x0460('0x1f5')});db['WhatsappAccount'][_0x0460('0x111')](db[_0x0460('0xf7')],{'as':_0x0460('0x15d')});db[_0x0460('0x1f6')][_0x0460('0x111')](db[_0x0460('0xf5')],{'as':_0x0460('0x13b'),'foreignKey':_0x0460('0x1f5'),'onDelete':_0x0460('0x10d')});db[_0x0460('0x1f6')]['belongsTo'](db[_0x0460('0xed')],{'as':'List','foreignKey':_0x0460('0x172')});db[_0x0460('0x1f6')]['belongsTo'](db[_0x0460('0x81')],{'as':_0x0460('0x148'),'foreignKey':_0x0460('0x149')});db[_0x0460('0x1f6')][_0x0460('0x122')](db['User'],{'as':_0x0460('0x14c'),'through':_0x0460('0x13a')});db[_0x0460('0xf5')][_0x0460('0x11e')](db[_0x0460('0x13')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0x0460('0xff')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x0460('0x11e')](db['WhatsappAccount'],{'onDelete':_0x0460('0x158')});db['WhatsappApplication']['belongsTo'](db[_0x0460('0x7f')],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x147')});db[_0x0460('0xf5')][_0x0460('0x11e')](db[_0x0460('0x166')],{'onDelete':_0x0460('0x158'),'foreignKey':_0x0460('0x173')});db[_0x0460('0xf7')][_0x0460('0x111')](db[_0x0460('0xf9')],{'as':'Messages','onDelete':_0x0460('0x10d'),'foreignKey':_0x0460('0x1f7')});db[_0x0460('0xf7')][_0x0460('0x11e')](db[_0x0460('0x1f6')],{'as':_0x0460('0x164'),'foreignKey':'WhatsappAccountId'});db[_0x0460('0xf7')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0x0460('0xf7')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x165'),'foreignKey':_0x0460('0x10e')});db[_0x0460('0xf7')][_0x0460('0x122')](db[_0x0460('0x166')],{'through':_0x0460('0x1ab'),'as':'Tags'});db['WhatsappInteraction'][_0x0460('0x122')](db[_0x0460('0x166')],{'through':_0x0460('0x1ab'),'as':_0x0460('0x169')});db[_0x0460('0xf7')][_0x0460('0x122')](db['User'],{'as':'Users','through':_0x0460('0x12a'),'foreignKey':_0x0460('0x1f7')});db['WhatsappMessage'][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x13')});db[_0x0460('0xf9')][_0x0460('0x11e')](db[_0x0460('0x70')],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x154')});db[_0x0460('0xf9')][_0x0460('0x11e')](db['WhatsappInteraction'],{'onDelete':_0x0460('0x10d'),'as':_0x0460('0x16c'),'foreignKey':_0x0460('0x1f7')});db[_0x0460('0xf9')][_0x0460('0x11e')](db['WhatsappAccount'],{'as':_0x0460('0x164'),'foreignKey':_0x0460('0x1f5')});db[_0x0460('0xfb')][_0x0460('0x11e')](db[_0x0460('0x1f6')],{});db[_0x0460('0xfb')]['belongsTo'](db[_0x0460('0xed')],{'as':_0x0460('0x15e'),'foreignKey':_0x0460('0x172')});db[_0x0460('0xfb')][_0x0460('0x11e')](db[_0x0460('0x70')],{'as':_0x0460('0x154'),'foreignKey':_0x0460('0x155')});db[_0x0460('0xfb')]['belongsTo'](db[_0x0460('0xf7')],{});db[_0x0460('0xfb')][_0x0460('0x11e')](db[_0x0460('0xff')],{});db[_0x0460('0xfb')][_0x0460('0x11e')](db[_0x0460('0xf9')],{});db[_0x0460('0xfb')][_0x0460('0x11e')](db[_0x0460('0x13')],{});db[_0x0460('0xfd')][_0x0460('0x11e')](db[_0x0460('0xf9')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x0460('0xf7')],{});db['WhatsappTransferReport'][_0x0460('0x11e')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x0460('0x1dc')});db[_0x0460('0xfd')][_0x0460('0x11e')](db[_0x0460('0x1f6')],{'foreignKey':_0x0460('0x1f8'),'as':_0x0460('0x1e3')});db['WhatsappTransferReport'][_0x0460('0x11e')](db['WhatsappQueue'],{'foreignKey':_0x0460('0x1f9'),'as':_0x0460('0x1e5')});db[_0x0460('0xfd')][_0x0460('0x11e')](db[_0x0460('0x13')],{'foreignKey':_0x0460('0x1dd'),'as':_0x0460('0x1de')});db[_0x0460('0xfd')][_0x0460('0x11e')](db['User'],{'foreignKey':_0x0460('0x1df'),'as':'ToAgent'});db['WhatsappQueue'][_0x0460('0x122')](db[_0x0460('0x13')],{'as':'Agents','through':_0x0460('0x3b'),'foreignKey':_0x0460('0x1fa')});db[_0x0460('0xff')][_0x0460('0x122')](db[_0x0460('0x124')],{'through':'team_has_whatsapp_queues','as':_0x0460('0x162')});db[_0x0460('0x108')][_0x0460('0x11e')](db[_0x0460('0x13')],{'as':_0x0460('0x1fb'),'foreignKey':_0x0460('0x10e'),'onDelete':_0x0460('0x10d'),'hooks':!![]});db[_0x0460('0x101')][_0x0460('0x10c')](db[_0x0460('0xc0')],{'as':_0x0460('0xc0'),'onDelete':_0x0460('0x158')});db[_0x0460('0x101')][_0x0460('0x10c')](db['MailServerIn'],{'as':_0x0460('0x159'),'onDelete':_0x0460('0x158')});db[_0x0460('0x101')][_0x0460('0x10c')](db['MailServerOut'],{'as':_0x0460('0x15a'),'onDelete':_0x0460('0x158')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 58bf6a3..6bf281f 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3fe=['/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/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/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integrationReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/snippet','snippet','3.10.1','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/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/voice/transfers/reports','./api/voiceTransferReport','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage'];(function(_0x951b5d,_0x2feee6){var _0x3fe65d=function(_0x29a01d){while(--_0x29a01d){_0x951b5d['push'](_0x951b5d['shift']());}};_0x3fe65d(++_0x2feee6);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x167295,_0x555a81){_0x167295=_0x167295-0x0;var _0x400be6=_0xf3fe[_0x167295];return _0x400be6;};'use strict';var path=require('path');var express=require(_0xef3f('0x0'));var errors=require(_0xef3f('0x1'));var config=require(_0xef3f('0x2'));var setupLoggers=require(_0xef3f('0x3'))[_0xef3f('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0xef3f('0x5')]=function(_0x18a97c){return setupLoggers(_0x18a97c)[_0xef3f('0x6')](function(){_0x18a97c[_0xef3f('0x7')](_0xef3f('0x8'),require('./api/user'));_0x18a97c['use'](_0xef3f('0x9'),require(_0xef3f('0xa')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xb'),require(_0xef3f('0xc')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xd'),require(_0xef3f('0xe')));_0x18a97c[_0xef3f('0x7')]('/api/voice/mohs',require(_0xef3f('0xf')));_0x18a97c['use'](_0xef3f('0x10'),require(_0xef3f('0x11')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x12'),require('./api/voiceRecording'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x13'),require('./api/screenRecording'));_0x18a97c[_0xef3f('0x7')]('/api/voice/mails',require(_0xef3f('0x14')));_0x18a97c['use'](_0xef3f('0x15'),require(_0xef3f('0x16')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x17'),require(_0xef3f('0x18')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x19'),require(_0xef3f('0x1a')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x1b'),require(_0xef3f('0x1c')));_0x18a97c['use'](_0xef3f('0x1d'),require(_0xef3f('0x1e')));_0x18a97c['use'](_0xef3f('0x1f'),require(_0xef3f('0x20')));_0x18a97c['use']('/api/trunks',require('./api/trunk'));_0x18a97c['use'](_0xef3f('0x21'),require(_0xef3f('0x22')));_0x18a97c['use']('/api/mail/out_servers',require('./api/mailServerOut'));_0x18a97c[_0xef3f('0x7')]('/api/mail/accounts',require(_0xef3f('0x23')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x24'),require(_0xef3f('0x25')));_0x18a97c['use']('/api/mail/substatuses',require(_0xef3f('0x26')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x27'),require(_0xef3f('0x28')));_0x18a97c[_0xef3f('0x7')]('/api/mail/messages',require(_0xef3f('0x29')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x2a'),require(_0xef3f('0x2b')));_0x18a97c['use'](_0xef3f('0x2c'),require(_0xef3f('0x2d')));_0x18a97c['use'](_0xef3f('0x2e'),require('./api/dashboard'));_0x18a97c[_0xef3f('0x7')]('/api/dashboards/items',require('./api/dashboardItem'));_0x18a97c['use'](_0xef3f('0x2f'),require(_0xef3f('0x30')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x31'),require(_0xef3f('0x32')));_0x18a97c[_0xef3f('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x18a97c['use'](_0xef3f('0x33'),require(_0xef3f('0x34')));_0x18a97c[_0xef3f('0x7')]('/api/fax/queues',require(_0xef3f('0x35')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x36'),require(_0xef3f('0x37')));_0x18a97c['use'](_0xef3f('0x38'),require(_0xef3f('0x39')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x3a'),require('./api/smsApplication'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x3b'),require(_0xef3f('0x3c')));_0x18a97c[_0xef3f('0x7')]('/api/sms/messages',require(_0xef3f('0x3d')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x3e'),require('./api/smsQueue'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x3f'),require(_0xef3f('0x40')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x41'),require(_0xef3f('0x42')));_0x18a97c['use'](_0xef3f('0x43'),require('./api/openchannelInteraction'));_0x18a97c[_0xef3f('0x7')]('/api/openchannel/messages',require(_0xef3f('0x44')));_0x18a97c['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x45'),require(_0xef3f('0x46')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x47'),require(_0xef3f('0x48')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x49'),require('./api/chatApplication'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x4a'),require(_0xef3f('0x4b')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x4c'),require(_0xef3f('0x4d')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x4e'),require(_0xef3f('0x4f')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x50'),require(_0xef3f('0x51')));_0x18a97c[_0xef3f('0x7')]('/api/chat/groups',require(_0xef3f('0x52')));_0x18a97c[_0xef3f('0x7')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x18a97c[_0xef3f('0x7')]('/api/cm/companies',require(_0xef3f('0x53')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x54'),require(_0xef3f('0x55')));_0x18a97c[_0xef3f('0x7')]('/api/cm/hopper',require(_0xef3f('0x56')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x57'),require(_0xef3f('0x58')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x59'),require('./api/cmHopperFinal'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x5a'),require(_0xef3f('0x5b')));_0x18a97c['use']('/api/cm/custom_fields',require(_0xef3f('0x5c')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x5d'),require('./api/action'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x5e'),require(_0xef3f('0x5f')));_0x18a97c[_0xef3f('0x7')]('/api/canned_answers',require(_0xef3f('0x60')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x61'),require('./api/disposition'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x62'),require(_0xef3f('0x63')));_0x18a97c[_0xef3f('0x7')]('/api/intervals',require(_0xef3f('0x64')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x65'),require('./api/pause'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x66'),require('./api/cdr'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x67'),require(_0xef3f('0x68')));_0x18a97c['use'](_0xef3f('0x69'),require('./api/schedule'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x6a'),require('./api/sound'));_0x18a97c[_0xef3f('0x7')]('/api/tags',require(_0xef3f('0x6b')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x6c'),require(_0xef3f('0x6d')));_0x18a97c['use']('/api/cm_contact_has_items',require(_0xef3f('0x6e')));_0x18a97c[_0xef3f('0x7')]('/api/cm_hopper_additional_phones',require(_0xef3f('0x6f')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x70'),require(_0xef3f('0x71')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x72'),require(_0xef3f('0x73')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x74'),require(_0xef3f('0x75')));_0x18a97c[_0xef3f('0x7')]('/api/integrations',require('./api/integration'));_0x18a97c[_0xef3f('0x7')]('/api/integrations/reports',require(_0xef3f('0x76')));_0x18a97c['use']('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x77'),require('./api/analyticDefaultReport'));_0x18a97c['use'](_0xef3f('0x78'),require('./api/analyticExtractedReport'));_0x18a97c['use'](_0xef3f('0x79'),require('./api/analyticMetric'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x7a'),require('./api/analyticFieldReport'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x7b'),require(_0xef3f('0x7c')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/salesforce/accounts',require(_0xef3f('0x7d')));_0x18a97c['use']('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x7e'),require(_0xef3f('0x7f')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x80'),require(_0xef3f('0x81')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/sugarcrm/configurations',require(_0xef3f('0x82')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/sugarcrm/fields',require(_0xef3f('0x83')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x84'),require(_0xef3f('0x85')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x86'),require(_0xef3f('0x87')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/desk/fields',require(_0xef3f('0x88')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x89'),require('./api/intZohoAccount'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x8a'),require(_0xef3f('0x8b')));_0x18a97c['use'](_0xef3f('0x8c'),require(_0xef3f('0x8d')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/zendesk/accounts',require(_0xef3f('0x8e')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x8f'),require(_0xef3f('0x90')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x91'),require(_0xef3f('0x92')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x93'),require(_0xef3f('0x94')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/freshdesk/configurations',require(_0xef3f('0x95')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x96'),require(_0xef3f('0x97')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x18a97c[_0xef3f('0x7')]('/api/integrations/vtiger/configurations',require(_0xef3f('0x98')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x99'),require(_0xef3f('0x9a')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x9b'),require(_0xef3f('0x9c')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x9d'),require(_0xef3f('0x9e')));_0x18a97c['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x9f'),require(_0xef3f('0xa0')));_0x18a97c['use'](_0xef3f('0xa1'),require('./api/intDynamics365Configuration'));_0x18a97c['use']('/api/integrations/dynamics365/fields',require(_0xef3f('0xa2')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xa3'),require(_0xef3f('0xa4')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xa5'),require(_0xef3f('0xa6')));_0x18a97c[_0xef3f('0x7')]('/api/integrations/freshsales/fields',require(_0xef3f('0xa7')));_0x18a97c[_0xef3f('0x7')]('/api/networks',require('./api/network'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xa8'),require(_0xef3f('0xa9')));_0x18a97c[_0xef3f('0x7')]('/api/chat/internal/messages',require(_0xef3f('0xaa')));_0x18a97c[_0xef3f('0x7')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xab'),require(_0xef3f('0xac')));_0x18a97c['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x18a97c['use'](_0xef3f('0xad'),require('./api/smsQueueReport'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xae'),require(_0xef3f('0xaf')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xb0'),require(_0xef3f('0xb1')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xb2'),require(_0xef3f('0xb3')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xb4'),require(_0xef3f('0xb5')));_0x18a97c[_0xef3f('0x7')]('/api/square/odbc',require(_0xef3f('0xb6')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xb7'),require(_0xef3f('0xb8')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xb9'),require(_0xef3f('0xba')));_0x18a97c[_0xef3f('0x7')]('/api/square/messages',require(_0xef3f('0xbb')));_0x18a97c['use'](_0xef3f('0xbc'),require(_0xef3f('0xbd')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xbe'),require('./api/license'));_0x18a97c[_0xef3f('0x7')]('/api/campaigns',require('./api/campaign'));_0x18a97c['use'](_0xef3f('0xbf'),require(_0xef3f('0xc0')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xc1'),require(_0xef3f('0xc2')));_0x18a97c[_0xef3f('0x7')]('/api/plugins',require(_0xef3f('0xc3')));_0x18a97c[_0xef3f('0x7')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x18a97c['use']('/api/chat/reports/transfer',require(_0xef3f('0xc4')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xc5'),require('./api/faxTransferReport'));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xc6'),require(_0xef3f('0xc7')));_0x18a97c[_0xef3f('0x7')]('/api/sms/reports/transfer',require(_0xef3f('0xc8')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xc9'),require(_0xef3f('0xca')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xcb'),require(_0xef3f('0xcc')));_0x18a97c['use'](_0xef3f('0xcd'),require(_0xef3f('0xce')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xcf'),require(_0xef3f('0xd0')));_0x18a97c[_0xef3f('0x7')]('/api/userProfile/resources',require(_0xef3f('0xd1')));_0x18a97c[_0xef3f('0x7')]('/api/userNotifications',require(_0xef3f('0xd2')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xd3'),require(_0xef3f('0xd4')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xd5'),require(_0xef3f('0xd6')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xd7'),require(_0xef3f('0xd8')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xd9'),require(_0xef3f('0xda')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xdb'),require(_0xef3f('0xdc')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xdd'),require(_0xef3f('0xde')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xdf'),require(_0xef3f('0xe0')));_0x18a97c[_0xef3f('0x7')]('/api/cloudProviders',require(_0xef3f('0xe1')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xe2'),require(_0xef3f('0xe3')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xe4'),require(_0xef3f('0xe5')));_0x18a97c['use'](_0xef3f('0xe6'),require(_0xef3f('0xe7')));_0x18a97c['use'](_0xef3f('0xe8'),require(_0xef3f('0xe9')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xea'),require(_0xef3f('0xeb')));_0x18a97c['use']('/api/auth/activedirectory',require(_0xef3f('0xec')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xed'),require(_0xef3f('0xee')));_0x18a97c[_0xef3f('0x7')]('/api/rpc',require(_0xef3f('0xef')));_0x18a97c['use'](_0xef3f('0xf0'),require(_0xef3f('0xf1')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xf2'),require(_0xef3f('0xf3')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xf4'),require(_0xef3f('0xf5')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xf6'),require(_0xef3f('0xf7')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xf8'),clientSideLogs);_0x18a97c[_0xef3f('0x7')](_0xef3f('0xf9'),express[_0xef3f('0xfa')](path[_0xef3f('0xfb')](config[_0xef3f('0xfc')],'/apidoc')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xfd'),express['static'](path['join'](config['root'],_0xef3f('0xfd'))));_0x18a97c[_0xef3f('0x7')]('/demo',express[_0xef3f('0xfa')](path[_0xef3f('0xfb')](config[_0xef3f('0xfc')],'/demo')));_0x18a97c[_0xef3f('0x7')](_0xef3f('0xfe'),express[_0xef3f('0xfa')](path[_0xef3f('0xfb')](config[_0xef3f('0xfc')],_0xef3f('0xff'),_0xef3f('0x100'))));_0x18a97c[_0xef3f('0x7')](_0xef3f('0x101'),express['static'](path[_0xef3f('0xfb')](config[_0xef3f('0xfc')],_0xef3f('0x102'))));_0x18a97c[_0xef3f('0x103')](_0xef3f('0x104'))[_0xef3f('0x105')](errors[0x194]);_0x18a97c[_0xef3f('0x103')]('/*')[_0xef3f('0x105')](function(_0x31a2a2,_0x52848d){_0x52848d[_0xef3f('0x106')](path[_0xef3f('0x107')](_0x18a97c['get'](_0xef3f('0x108'))+'/index.html'));});return _0x18a97c;});}; \ No newline at end of file +var _0xe7de=['/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.10.1','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/contacts','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/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/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./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/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue'];(function(_0xe7c3f1,_0x12326f){var _0x1a0934=function(_0x2c3300){while(--_0x2c3300){_0xe7c3f1['push'](_0xe7c3f1['shift']());}};_0x1a0934(++_0x12326f);}(_0xe7de,0x165));var _0xee7d=function(_0x220d41,_0x44dd4a){_0x220d41=_0x220d41-0x0;var _0x1bc7f1=_0xe7de[_0x220d41];return _0x1bc7f1;};'use strict';var path=require(_0xee7d('0x0'));var express=require(_0xee7d('0x1'));var errors=require(_0xee7d('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xee7d('0x3')];var clientSideLogs=require(_0xee7d('0x4'));exports[_0xee7d('0x5')]=function(_0x3f1c6d){return setupLoggers(_0x3f1c6d)[_0xee7d('0x6')](function(){_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x8'),require(_0xee7d('0x9')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xa'),require(_0xee7d('0xb')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xc'),require(_0xee7d('0xd')));_0x3f1c6d['use'](_0xee7d('0xe'),require(_0xee7d('0xf')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x10'),require(_0xee7d('0x11')));_0x3f1c6d[_0xee7d('0x7')]('/api/voice/queues',require(_0xee7d('0x12')));_0x3f1c6d['use'](_0xee7d('0x13'),require(_0xee7d('0x14')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x15'),require(_0xee7d('0x16')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x17'),require(_0xee7d('0x18')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x19'),require(_0xee7d('0x1a')));_0x3f1c6d['use']('/api/voice/calls/reports',require(_0xee7d('0x1b')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x1c'),require(_0xee7d('0x1d')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x1e'),require('./api/voiceAgentReport'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x1f'),require(_0xee7d('0x20')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x21'),require(_0xee7d('0x22')));_0x3f1c6d['use'](_0xee7d('0x23'),require(_0xee7d('0x24')));_0x3f1c6d[_0xee7d('0x7')]('/api/voice/transfers/reports',require(_0xee7d('0x25')));_0x3f1c6d['use'](_0xee7d('0x26'),require(_0xee7d('0x27')));_0x3f1c6d[_0xee7d('0x7')]('/api/mail/accounts',require(_0xee7d('0x28')));_0x3f1c6d['use'](_0xee7d('0x29'),require(_0xee7d('0x2a')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x2b'),require('./api/mailSubstatus'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x2c'),require(_0xee7d('0x2d')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x2e'),require(_0xee7d('0x2f')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x30'),require(_0xee7d('0x31')));_0x3f1c6d['use'](_0xee7d('0x32'),require(_0xee7d('0x33')));_0x3f1c6d[_0xee7d('0x7')]('/api/dashboards',require(_0xee7d('0x34')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x35'),require(_0xee7d('0x36')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x37'),require(_0xee7d('0x38')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x39'),require('./api/faxApplication'));_0x3f1c6d[_0xee7d('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x3f1c6d[_0xee7d('0x7')]('/api/fax/messages',require(_0xee7d('0x3a')));_0x3f1c6d[_0xee7d('0x7')]('/api/fax/queues',require(_0xee7d('0x3b')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x3c'),require(_0xee7d('0x3d')));_0x3f1c6d[_0xee7d('0x7')]('/api/sms/accounts',require(_0xee7d('0x3e')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x3f'),require(_0xee7d('0x40')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x41'),require(_0xee7d('0x42')));_0x3f1c6d[_0xee7d('0x7')]('/api/sms/messages',require(_0xee7d('0x43')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x44'),require('./api/smsQueue'));_0x3f1c6d[_0xee7d('0x7')]('/api/openchannel/accounts',require(_0xee7d('0x45')));_0x3f1c6d[_0xee7d('0x7')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x3f1c6d[_0xee7d('0x7')]('/api/openchannel/interactions',require(_0xee7d('0x46')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x47'),require(_0xee7d('0x48')));_0x3f1c6d[_0xee7d('0x7')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x3f1c6d[_0xee7d('0x7')]('/api/chat/websites',require(_0xee7d('0x49')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x4a'),require(_0xee7d('0x4b')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x4c'),require(_0xee7d('0x4d')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x4e'),require(_0xee7d('0x4f')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x50'),require('./api/chatMessage'));_0x3f1c6d[_0xee7d('0x7')]('/api/chat/offline_messages',require(_0xee7d('0x51')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x52'),require('./api/chatQueue'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x53'),require(_0xee7d('0x54')));_0x3f1c6d['use'](_0xee7d('0x55'),require('./api/chatProactiveAction'));_0x3f1c6d[_0xee7d('0x7')]('/api/cm/companies',require('./api/cmCompany'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x56'),require(_0xee7d('0x57')));_0x3f1c6d[_0xee7d('0x7')]('/api/cm/hopper',require(_0xee7d('0x58')));_0x3f1c6d['use']('/api/cm/hopper_black',require(_0xee7d('0x59')));_0x3f1c6d['use'](_0xee7d('0x5a'),require('./api/cmHopperFinal'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x5b'),require(_0xee7d('0x5c')));_0x3f1c6d[_0xee7d('0x7')]('/api/cm/custom_fields',require(_0xee7d('0x5d')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x5e'),require(_0xee7d('0x5f')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x60'),require('./api/automation'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x61'),require(_0xee7d('0x62')));_0x3f1c6d[_0xee7d('0x7')]('/api/dispositions',require(_0xee7d('0x63')));_0x3f1c6d['use'](_0xee7d('0x64'),require('./api/condition'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x65'),require(_0xee7d('0x66')));_0x3f1c6d['use'](_0xee7d('0x67'),require('./api/pause'));_0x3f1c6d[_0xee7d('0x7')]('/api/cdr',require(_0xee7d('0x68')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x69'),require('./api/voiceQueuesLog'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x6a'),require('./api/schedule'));_0x3f1c6d['use'](_0xee7d('0x6b'),require(_0xee7d('0x6c')));_0x3f1c6d['use'](_0xee7d('0x6d'),require(_0xee7d('0x6e')));_0x3f1c6d[_0xee7d('0x7')]('/api/contact_item_types',require('./api/contactItemType'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x6f'),require(_0xee7d('0x70')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x71'),require(_0xee7d('0x72')));_0x3f1c6d['use'](_0xee7d('0x73'),require(_0xee7d('0x74')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x75'),require(_0xee7d('0x76')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x77'),require(_0xee7d('0x78')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x79'),require('./api/integration'));_0x3f1c6d['use'](_0xee7d('0x7a'),require(_0xee7d('0x7b')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x7c'),require(_0xee7d('0x7d')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x7e'),require('./api/analyticDefaultReport'));_0x3f1c6d[_0xee7d('0x7')]('/api/analytics/extracted_reports',require(_0xee7d('0x7f')));_0x3f1c6d[_0xee7d('0x7')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x3f1c6d['use'](_0xee7d('0x80'),require(_0xee7d('0x81')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x82'),require(_0xee7d('0x83')));_0x3f1c6d['use'](_0xee7d('0x84'),require(_0xee7d('0x85')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x86'),require(_0xee7d('0x87')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x88'),require(_0xee7d('0x89')));_0x3f1c6d['use'](_0xee7d('0x8a'),require(_0xee7d('0x8b')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x8c'),require(_0xee7d('0x8d')));_0x3f1c6d['use'](_0xee7d('0x8e'),require('./api/intSugarcrmField'));_0x3f1c6d['use'](_0xee7d('0x8f'),require('./api/intDeskAccount'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x90'),require('./api/intDeskConfiguration'));_0x3f1c6d['use']('/api/integrations/desk/fields',require(_0xee7d('0x91')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x92'),require(_0xee7d('0x93')));_0x3f1c6d[_0xee7d('0x7')]('/api/integrations/zoho/configurations',require(_0xee7d('0x94')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x95'),require(_0xee7d('0x96')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x97'),require('./api/intZendeskAccount'));_0x3f1c6d['use'](_0xee7d('0x98'),require('./api/intZendeskConfiguration'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x99'),require(_0xee7d('0x9a')));_0x3f1c6d[_0xee7d('0x7')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x3f1c6d['use'](_0xee7d('0x9b'),require(_0xee7d('0x9c')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x9d'),require('./api/intFreshdeskField'));_0x3f1c6d[_0xee7d('0x7')]('/api/integrations/vtiger/accounts',require(_0xee7d('0x9e')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x9f'),require(_0xee7d('0xa0')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xa1'),require(_0xee7d('0xa2')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xa3'),require(_0xee7d('0xa4')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xa5'),require('./api/intServicenowConfiguration'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xa6'),require(_0xee7d('0xa7')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xa8'),require(_0xee7d('0xa9')));_0x3f1c6d[_0xee7d('0x7')]('/api/integrations/dynamics365/configurations',require(_0xee7d('0xaa')));_0x3f1c6d[_0xee7d('0x7')]('/api/integrations/dynamics365/fields',require(_0xee7d('0xab')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xac'),require(_0xee7d('0xad')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xae'),require(_0xee7d('0xaf')));_0x3f1c6d[_0xee7d('0x7')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xb0'),require(_0xee7d('0xb1')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xb2'),require(_0xee7d('0xb3')));_0x3f1c6d['use'](_0xee7d('0xb4'),require(_0xee7d('0xb5')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xb6'),require('./api/jscriptyAnswerReport'));_0x3f1c6d['use'](_0xee7d('0xb7'),require(_0xee7d('0xb8')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xb9'),require('./api/jscriptySessionReport'));_0x3f1c6d['use'](_0xee7d('0xba'),require('./api/smsQueueReport'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xbb'),require('./api/squareReport'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xbc'),require(_0xee7d('0xbd')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xbe'),require(_0xee7d('0xbf')));_0x3f1c6d[_0xee7d('0x7')]('/api/settings',require(_0xee7d('0xc0')));_0x3f1c6d[_0xee7d('0x7')]('/api/square/odbc',require(_0xee7d('0xc1')));_0x3f1c6d['use']('/api/square/projects',require('./api/squareProject'));_0x3f1c6d['use'](_0xee7d('0xc2'),require(_0xee7d('0xc3')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xc4'),require(_0xee7d('0xc5')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xc6'),require(_0xee7d('0xc7')));_0x3f1c6d['use']('/api/license',require('./api/license'));_0x3f1c6d['use'](_0xee7d('0xc8'),require('./api/campaign'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xc9'),require('./api/migration'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xca'),require(_0xee7d('0xcb')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xcc'),require(_0xee7d('0xcd')));_0x3f1c6d['use'](_0xee7d('0xce'),require(_0xee7d('0xcf')));_0x3f1c6d['use'](_0xee7d('0xd0'),require('./api/chatTransferReport'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xd1'),require(_0xee7d('0xd2')));_0x3f1c6d['use']('/api/openchannel/reports/transfer',require(_0xee7d('0xd3')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xd4'),require(_0xee7d('0xd5')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xd6'),require(_0xee7d('0xd7')));_0x3f1c6d[_0xee7d('0x7')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xd8'),require(_0xee7d('0xd9')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xda'),require(_0xee7d('0xdb')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xdc'),require(_0xee7d('0xdd')));_0x3f1c6d['use']('/api/userNotifications',require(_0xee7d('0xde')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xdf'),require(_0xee7d('0xe0')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xe1'),require('./api/whatsappApplication'));_0x3f1c6d['use'](_0xee7d('0xe2'),require(_0xee7d('0xe3')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xe4'),require('./api/whatsappMessage'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xe5'),require(_0xee7d('0xe6')));_0x3f1c6d[_0xee7d('0x7')]('/api/whatsapp/reports/transfer',require(_0xee7d('0xe7')));_0x3f1c6d[_0xee7d('0x7')]('/api/whatsapp/queues',require(_0xee7d('0xe8')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xe9'),require('./api/cloudProvider'));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xea'),require(_0xee7d('0xeb')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xec'),require(_0xee7d('0xed')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xee'),require(_0xee7d('0xef')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xf0'),require(_0xee7d('0xf1')));_0x3f1c6d[_0xee7d('0x7')]('/api/auth/google',require(_0xee7d('0xf2')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xf3'),require(_0xee7d('0xf4')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xf5'),require('./api/jira'));_0x3f1c6d['use']('/api/rpc',require(_0xee7d('0xf6')));_0x3f1c6d[_0xee7d('0x7')]('/api/version',require(_0xee7d('0xf7')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xf8'),require('./api/system'));_0x3f1c6d['use'](_0xee7d('0xf9'),require(_0xee7d('0xfa')));_0x3f1c6d['use'](_0xee7d('0xfb'),require(_0xee7d('0xfc')));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0xfd'),clientSideLogs);_0x3f1c6d[_0xee7d('0x7')]('/apidoc',express[_0xee7d('0xfe')](path[_0xee7d('0xff')](config[_0xee7d('0x100')],_0xee7d('0x101'))));_0x3f1c6d[_0xee7d('0x7')]('/www',express['static'](path[_0xee7d('0xff')](config[_0xee7d('0x100')],_0xee7d('0x102'))));_0x3f1c6d[_0xee7d('0x7')](_0xee7d('0x103'),express[_0xee7d('0xfe')](path[_0xee7d('0xff')](config[_0xee7d('0x100')],_0xee7d('0x103'))));_0x3f1c6d['use'](_0xee7d('0x104'),express[_0xee7d('0xfe')](path[_0xee7d('0xff')](config['root'],_0xee7d('0x105'),_0xee7d('0x106'))));_0x3f1c6d['use'](_0xee7d('0x107'),express['static'](path[_0xee7d('0xff')](config[_0xee7d('0x100')],_0xee7d('0x108'))));_0x3f1c6d[_0xee7d('0x109')](_0xee7d('0x10a'))[_0xee7d('0x10b')](errors[0x194]);_0x3f1c6d[_0xee7d('0x109')]('/*')[_0xee7d('0x10b')](function(_0x522d7e,_0x490046){_0x490046[_0xee7d('0x10c')](path[_0xee7d('0x10d')](_0x3f1c6d[_0xee7d('0x10b')](_0xee7d('0x10e'))+_0xee7d('0x10f')));});return _0x3f1c6d;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 43ae856..86d6900 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c32=['../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc'];(function(_0x2399ad,_0x9404ce){var _0x32221b=function(_0x299da1){while(--_0x299da1){_0x2399ad['push'](_0x2399ad['shift']());}};_0x32221b(++_0x9404ce);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x26c3('0x0'));var _=require('lodash');var config=require(_0x26c3('0x1'));exports['listen']=function(){return new Promise(function(_0x3428b4,_0x4eac69){var _0x3847b3={};_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/user/user.rpc'));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x3')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x4')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x5')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x6')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x7')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x8')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x9')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/trunk/trunk.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0xa')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0xb')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/mailServerIn/mailServerIn.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0xc')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0xd')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0xe')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0xf')));_0x3847b3=_['merge'](_0x3847b3,require('../api/mailApplication/mailApplication.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x10')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x11')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x12')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x13')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/faxMessage/faxMessage.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/faxQueue/faxQueue.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x14')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x15')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x16')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x17')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x18')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x19')));_0x3847b3=_['merge'](_0x3847b3,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x1a')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x1b')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x1c')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x1d')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x1e')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x1f')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x20')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x21')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x22')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x23')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3847b3=_['merge'](_0x3847b3,require('../api/interval/interval.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x24')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x25')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x26')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x27')));_0x3847b3=_['merge'](_0x3847b3,require('../api/variable/variable.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x28')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x29')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x2a')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x2b')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x2c')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x2d')));_0x3847b3=_['merge'](_0x3847b3,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x2e')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x2f')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x30')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x31')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x32')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x33')));_0x3847b3=_['merge'](_0x3847b3,require('../api/squareProject/squareProject.rpc'));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x34')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x35')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x36')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x37')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x38')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x39')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x3a')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x3b')));_0x3847b3=_[_0x26c3('0x2')](_0x3847b3,require(_0x26c3('0x3c')));_0x3847b3=_['merge'](_0x3847b3,require(_0x26c3('0x3d')));var _0x304766=jayson[_0x26c3('0x3e')](_0x3847b3)[_0x26c3('0x3f')]();var _0x5d0d50=config[_0x26c3('0x40')][_0x26c3('0x41')]||config[_0x26c3('0x41')]+0x1;var _0x2783a3=config[_0x26c3('0x40')]['ip']||_0x26c3('0x42');_0x304766['on'](_0x26c3('0x43'),function(_0x1f2a3d){return _0x4eac69(_0x1f2a3d);});_0x304766[_0x26c3('0x44')](_0x5d0d50,_0x2783a3,function(){console['log'](_0x26c3('0x45'),_0x2783a3,_0x5d0d50);require(_0x26c3('0x46'))[_0x26c3('0x47')]();return _0x3428b4(_0x26c3('0x48')+_0x2783a3+':'+_0x5d0d50);});});}; \ No newline at end of file +var _0x054c=['../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc'];(function(_0x36f82a,_0x4ec395){var _0x495067=function(_0x2ede56){while(--_0x2ede56){_0x36f82a['push'](_0x36f82a['shift']());}};_0x495067(++_0x4ec395);}(_0x054c,0x194));var _0xc054=function(_0x1c6231,_0x32a8cf){_0x1c6231=_0x1c6231-0x0;var _0x192b26=_0x054c[_0x1c6231];return _0x192b26;};'use strict';var jayson=require(_0xc054('0x0'));var _=require(_0xc054('0x1'));var config=require('../config/environment');exports[_0xc054('0x2')]=function(){return new Promise(function(_0x10e18e,_0x1ec677){var _0x24c371={};_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x3')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x5')));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x6')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x7')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x8')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x9')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/memberReport/memberReport.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/trunk/trunk.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0xa')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0xb')));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0xc')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0xd')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/mailInteraction/mailInteraction.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0xe')));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0xf')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x10')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x11')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x12')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x13')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/faxMessage/faxMessage.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x14')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x15')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x16')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x17')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x18')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x19')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x1a')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x1b')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x1c')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x1d')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x1e')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x1f')));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x20')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x21')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x22')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x23')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x24')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x25')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x26')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x27')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x28')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x29')));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x2a')));_0x24c371=_['merge'](_0x24c371,require('../api/template/template.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x2b')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x2c')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x2d')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x2e')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x2f')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x30')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x31')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x32')));_0x24c371=_['merge'](_0x24c371,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x33')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x34')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x35')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x36')));_0x24c371=_['merge'](_0x24c371,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x37')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x38')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x39')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/squareOdbc/squareOdbc.rpc'));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x3a')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require('../api/squareRecording/squareRecording.rpc'));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x3b')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x3c')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x3d')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x3e')));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x3f')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x40')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x41')));_0x24c371=_['merge'](_0x24c371,require(_0xc054('0x42')));_0x24c371=_[_0xc054('0x4')](_0x24c371,require(_0xc054('0x43')));var _0x13e755=jayson[_0xc054('0x44')](_0x24c371)[_0xc054('0x45')]();var _0x1edc66=config[_0xc054('0x46')][_0xc054('0x47')]||config[_0xc054('0x47')]+0x1;var _0x1021ab=config[_0xc054('0x46')]['ip']||'localhost';_0x13e755['on'](_0xc054('0x48'),function(_0xcadc2b){return _0x1ec677(_0xcadc2b);});_0x13e755[_0xc054('0x2')](_0x1edc66,_0x1021ab,function(){console[_0xc054('0x49')](_0xc054('0x4a'),_0x1021ab,_0x1edc66);require(_0xc054('0x4b'))['default']();return _0x10e18e(_0xc054('0x4c')+_0x1021ab+':'+_0x1edc66);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3f34c0d..8f30c8b 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 _0xbc37=['sendRequest','sync','prototype','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','EventEmitter','./reply','./error','call','utf8','setEncoding','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xbc37,0x11a));var _0x7bc3=function(_0x587735,_0x382c7d){_0x587735=_0x587735-0x0;var _0xcf1087=_0xbc37[_0x587735];return _0xcf1087;};'use strict';var util=require(_0x7bc3('0x0'));var _=require(_0x7bc3('0x1'));var EventEmitter=require('events')[_0x7bc3('0x2')];var AGIReply=require(_0x7bc3('0x3'));var AGIError=require(_0x7bc3('0x4'));function AGIChannel(_0x12e140){var _0x5c1914=this,_0x372ad2=new AGIReply(),_0x1524ac=![],_0x2aebf2={};EventEmitter[_0x7bc3('0x5')](_0x5c1914);_0x12e140['setEncoding'](_0x7bc3('0x6'));_0x12e140['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x372ad2[_0x7bc3('0x7')](_0x7bc3('0x6'));_0x372ad2['on'](_0x7bc3('0x8'),function(_0x48fb5b){for(var _0x28e602 in _0x48fb5b){_0x5c1914[_0x28e602]=_0x48fb5b[_0x28e602];}_0x5c1914[_0x7bc3('0x9')](_0x7bc3('0xa'));});_0x372ad2['on'](_0x7bc3('0xb'),function(_0x5bc8cd){if(_0x5bc8cd['toLowerCase']()==_0x7bc3('0xc')){_0x5c1914[_0x7bc3('0x9')](_0x7bc3('0xc'));return;}if(_0x5bc8cd[_0x7bc3('0xd')](0x0,0xb)==_0x7bc3('0xe')){_0x1524ac=!![];}if(_0x1524ac){_0x2aebf2['rx']+=_0x5bc8cd+'\x0a';if(_0x5bc8cd[_0x7bc3('0xf')](_0x7bc3('0x10'))!=-0x1){_0x1524ac=![];}}else{_0x2aebf2['rx']=_0x5bc8cd;}if(_0x1524ac){return;}if(typeof _0x2aebf2['cb']=='function'){var _0x50b00c=_0x2aebf2['rx'][_0x7bc3('0xd')](0x0,0x3),_0x17e70b=null,_0x32cf44=null;_0x50b00c=parseInt(_0x50b00c);if(isNaN(_0x50b00c)){_0x2aebf2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x7bc3('0x11')});return;}if(_0x50b00c!=0xc8){_0x2aebf2['cb'](null,{'code':_0x50b00c,'result':-0x1,'extra':'KO'});return;}_0x17e70b=_0x2aebf2['rx'][_0x7bc3('0xd')](0x4)['replace'](_0x7bc3('0x12'),'');if(_0x17e70b[_0x7bc3('0x13')]('\x20')!=-0x1){_0x17e70b=_0x17e70b[_0x7bc3('0x14')](0x0,_0x17e70b[_0x7bc3('0x13')]('\x20'));}if(_[_0x7bc3('0x15')](_0x17e70b,'-1')){_0x17e70b=parseInt(_0x17e70b);}_0x32cf44=_0x2aebf2['rx'][_0x7bc3('0x16')]('\x20');if(_0x32cf44['length']==0x3){_0x32cf44=_0x32cf44[0x2][_0x7bc3('0xd')](0x1,_0x32cf44[0x2][_0x7bc3('0x17')]-0x1);}else if(_0x32cf44[_0x7bc3('0x17')]>0x3){var _0x29af27=/\((.+)\)/;var _0x588aca=_0x2aebf2['rx'][_0x7bc3('0x18')](_0x29af27);if(_0x588aca){_0x32cf44=_0x588aca[0x1];}else{_0x32cf44=null;}}else{_0x32cf44=null;}_0x2aebf2['cb'](null,{'code':_0x50b00c,'result':_0x17e70b,'extra':_0x32cf44});}});_0x12e140['on'](_0x7bc3('0x19'),function(_0x45c21b){_0x5c1914['emit'](_0x7bc3('0x19'),new AGIError(_0x7bc3('0x1a'),_0x45c21b[_0x7bc3('0x1b')]));});_0x12e140['on'](_0x7bc3('0x1c'),function(){_0x5c1914['emit'](_0x7bc3('0x1c'),new AGIError(_0x7bc3('0x1d')));});_0x12e140['on']('timeout',function(){_0x5c1914[_0x7bc3('0x9')](_0x7bc3('0x1e'),new AGIError(_0x7bc3('0x1f')));_0x12e140[_0x7bc3('0x20')]();});_0x12e140[_0x7bc3('0x21')](_0x372ad2);this[_0x7bc3('0x22')]=function(_0x5ec87f,_0x4ad53d){var _0x5ec87f=_0x5ec87f||'',_0x4ad53d=typeof _0x4ad53d==_0x7bc3('0x23')?_0x4ad53d:new Function();_0x2aebf2={'tx':_0x5ec87f,'rx':'','cb':_0x4ad53d};_0x12e140[_0x7bc3('0x24')](_0x5ec87f+'\x0a');},this[_0x7bc3('0x1c')]=function(){_0x12e140[_0x7bc3('0x20')]();};}util[_0x7bc3('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x7bc3('0x26')]=function(_0x216119){return this[_0x7bc3('0x22')][_0x7bc3('0x27')](this,_0x216119);};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x29')]=function(){return this[_0x7bc3('0x26')](_0x7bc3('0x2a'));};AGIChannel['prototype'][_0x7bc3('0x2b')]=function(_0xa63259,_0x3fe7e9,_0x34907d){_0xa63259=_0xa63259===undefined?'beep':_0xa63259;_0x3fe7e9=_0x3fe7e9===undefined?'5':_0x3fe7e9;_0x34907d=_0x34907d===undefined?'1':_0x34907d;return this[_0x7bc3('0x26')](util[_0x7bc3('0x2c')](_0x7bc3('0x2d'),_0xa63259,_0x3fe7e9*0x3e8,_0x34907d));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x2e')]=function(_0x43c053){_0x43c053=_0x43c053||_0x7bc3('0x2f');return this[_0x7bc3('0x26')](util[_0x7bc3('0x2c')](_0x7bc3('0x30'),_0x43c053));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x31')]=function(_0x2248e6,_0x518bcb){if(_[_0x7bc3('0x32')](_0x518bcb)){return this['sendRequest'](util['format'](_0x7bc3('0x33'),_0x2248e6,_0x518bcb[_0x7bc3('0x34')](',')));}return this['sendRequest'](util['format'](_0x7bc3('0x33'),_0x2248e6,_0x518bcb));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x35')]=function(_0x18d974){return this[_0x7bc3('0x26')](util['format'](_0x7bc3('0x36'),_0x18d974));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x37')]=function(_0x58a6b2){return this[_0x7bc3('0x26')](util[_0x7bc3('0x2c')](_0x7bc3('0x38'),_0x58a6b2));};AGIChannel['prototype'][_0x7bc3('0x39')]=function(_0x3c07bb){return this[_0x7bc3('0x26')](util[_0x7bc3('0x2c')]('SET\x20PRIORITY\x20%s',_0x3c07bb));};AGIChannel[_0x7bc3('0x28')]['hangup']=function(){return this[_0x7bc3('0x26')](_0x7bc3('0x3a'));};AGIChannel['prototype'][_0x7bc3('0x3b')]=function(_0x3e20ac,_0x364ff4){var _0x7438af=_[_0x7bc3('0x3c')](_0x364ff4)||_[_0x7bc3('0x3d')](_0x364ff4)?_0x364ff4[_0x7bc3('0x3e')]():_0x364ff4;return this['sendRequest'](util[_0x7bc3('0x2c')](_0x7bc3('0x3f'),_0x3e20ac,_0x7438af?_0x7438af[_0x7bc3('0x3e')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x7bc3('0x40')]=function(_0x515020,_0x22f43a){return this[_0x7bc3('0x26')](util[_0x7bc3('0x2c')]('SAY\x20NUMBER\x20%s\x20%s',_0x515020,_0x22f43a));};AGIChannel[_0x7bc3('0x28')]['sayDigits']=function(_0x27d8cb,_0x428a52){return this['sendRequest'](util[_0x7bc3('0x2c')](_0x7bc3('0x41'),_0x27d8cb,_0x428a52));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x42')]=function(_0x38b746,_0x16bb77){return this[_0x7bc3('0x26')](util[_0x7bc3('0x2c')](_0x7bc3('0x43'),_0x38b746,_0x16bb77));};AGIChannel[_0x7bc3('0x28')]['continueAt']=function(_0x17dc50,_0x416a0c,_0xac58f5){_0x416a0c=_0x416a0c||this['extension'];_0xac58f5=_0xac58f5||0x1;this[_0x7bc3('0x35')](_0x17dc50);this[_0x7bc3('0x37')](_0x416a0c);this['setPriority'](_0xac58f5);return this[_0x7bc3('0x2e')](util[_0x7bc3('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x17dc50,_0x416a0c,_0xac58f5));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x44')]=function(_0x5d1371){return this['sendRequest'](util[_0x7bc3('0x2c')](_0x7bc3('0x45'),_0x5d1371));};AGIChannel['prototype']['recordFile']=function(_0x2352c0,_0x28d8a6,_0x301abb,_0x5a11f9,_0x42060c,_0x13901a){_0x28d8a6=_0x28d8a6||_0x7bc3('0x46');_0x301abb=_0x301abb||'';_0x5a11f9=_0x5a11f9===undefined?-0x1:_0x5a11f9==='-1'?-0x1:_0x5a11f9*0x3e8;_0x42060c=_0x42060c===undefined?'':'s='+_0x42060c;_0x13901a=_0x13901a?_0x7bc3('0x47'):'';return this[_0x7bc3('0x26')](util[_0x7bc3('0x2c')](_0x7bc3('0x48'),_0x2352c0,_0x28d8a6,_0x301abb,_0x5a11f9,_0x13901a,_0x42060c));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x49')]=function(_0x4f4005,_0x5bb952){_0x5bb952=_0x5bb952||'';return this['sendRequest'](util[_0x7bc3('0x2c')](_0x7bc3('0x4a'),_0x4f4005,_0x5bb952));};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x4b')]=function(_0xc0ffdb){return this[_0x7bc3('0x31')](_0x7bc3('0x4c'),_0xc0ffdb);};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x4d')]=function(_0x59063c){return this[_0x7bc3('0x31')]('WAIT',_0x59063c);};AGIChannel[_0x7bc3('0x28')][_0x7bc3('0x19')]=function(_0x4c7923,_0x5764c9){this[_0x7bc3('0x2e')](util[_0x7bc3('0x2c')](_0x7bc3('0x4e'),_0x4c7923['id'],_0x4c7923[_0x7bc3('0x4f')],_0x5764c9));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xf970=['noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','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','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','ready','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','emit','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','answer','prototype','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0f97('0x0'));var _=require('lodash');var EventEmitter=require(_0x0f97('0x1'))[_0x0f97('0x2')];var AGIReply=require(_0x0f97('0x3'));var AGIError=require(_0x0f97('0x4'));function AGIChannel(_0x1b1ab7){var _0x25e484=this,_0x439149=new AGIReply(),_0x4ab74d=![],_0xc822e8={};EventEmitter[_0x0f97('0x5')](_0x25e484);_0x1b1ab7[_0x0f97('0x6')](_0x0f97('0x7'));_0x1b1ab7[_0x0f97('0x8')](0x8*0x3c*0x3c*0x3e8);_0x439149[_0x0f97('0x6')](_0x0f97('0x7'));_0x439149['on'](_0x0f97('0x9'),function(_0x2891f7){for(var _0x5598eb in _0x2891f7){_0x25e484[_0x5598eb]=_0x2891f7[_0x5598eb];}_0x25e484['emit'](_0x0f97('0xa'));});_0x439149['on']('line',function(_0x1366b4){if(_0x1366b4[_0x0f97('0xb')]()==_0x0f97('0xc')){_0x25e484['emit'](_0x0f97('0xc'));return;}if(_0x1366b4['substring'](0x0,0xb)==_0x0f97('0xd')){_0x4ab74d=!![];}if(_0x4ab74d){_0xc822e8['rx']+=_0x1366b4+'\x0a';if(_0x1366b4[_0x0f97('0xe')](_0x0f97('0xf'))!=-0x1){_0x4ab74d=![];}}else{_0xc822e8['rx']=_0x1366b4;}if(_0x4ab74d){return;}if(typeof _0xc822e8['cb']==_0x0f97('0x10')){var _0x38ae73=_0xc822e8['rx'][_0x0f97('0x11')](0x0,0x3),_0x4934af=null,_0x56d310=null;_0x38ae73=parseInt(_0x38ae73);if(isNaN(_0x38ae73)){_0xc822e8['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0f97('0x12')});return;}if(_0x38ae73!=0xc8){_0xc822e8['cb'](null,{'code':_0x38ae73,'result':-0x1,'extra':'KO'});return;}_0x4934af=_0xc822e8['rx'][_0x0f97('0x11')](0x4)[_0x0f97('0x13')](_0x0f97('0x14'),'');if(_0x4934af[_0x0f97('0x15')]('\x20')!=-0x1){_0x4934af=_0x4934af['substr'](0x0,_0x4934af['indexOf']('\x20'));}if(_[_0x0f97('0x16')](_0x4934af,'-1')){_0x4934af=parseInt(_0x4934af);}_0x56d310=_0xc822e8['rx'][_0x0f97('0x17')]('\x20');if(_0x56d310[_0x0f97('0x18')]==0x3){_0x56d310=_0x56d310[0x2][_0x0f97('0x11')](0x1,_0x56d310[0x2]['length']-0x1);}else if(_0x56d310['length']>0x3){var _0x336f61=/\((.+)\)/;var _0xf83320=_0xc822e8['rx'][_0x0f97('0x19')](_0x336f61);if(_0xf83320){_0x56d310=_0xf83320[0x1];}else{_0x56d310=null;}}else{_0x56d310=null;}_0xc822e8['cb'](null,{'code':_0x38ae73,'result':_0x4934af,'extra':_0x56d310});}});_0x1b1ab7['on'](_0x0f97('0x1a'),function(_0xae246){_0x25e484[_0x0f97('0x1b')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0xae246[_0x0f97('0x1c')]));});_0x1b1ab7['on'](_0x0f97('0x1d'),function(){_0x25e484[_0x0f97('0x1b')](_0x0f97('0x1d'),new AGIError(_0x0f97('0x1e')));});_0x1b1ab7['on'](_0x0f97('0x1f'),function(){_0x25e484['emit'](_0x0f97('0x1f'),new AGIError(_0x0f97('0x20')));_0x1b1ab7[_0x0f97('0x21')]();});_0x1b1ab7[_0x0f97('0x22')](_0x439149);this[_0x0f97('0x23')]=function(_0x316e84,_0x21784d){var _0x316e84=_0x316e84||'',_0x21784d=typeof _0x21784d==_0x0f97('0x10')?_0x21784d:new Function();_0xc822e8={'tx':_0x316e84,'rx':'','cb':_0x21784d};_0x1b1ab7[_0x0f97('0x24')](_0x316e84+'\x0a');},this['close']=function(){_0x1b1ab7[_0x0f97('0x21')]();};}util[_0x0f97('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x0f97('0x26')]=function(_0x15df5c){return this['command']['sync'](this,_0x15df5c);};AGIChannel['prototype'][_0x0f97('0x27')]=function(){return this[_0x0f97('0x26')]('ANSWER');};AGIChannel[_0x0f97('0x28')][_0x0f97('0x29')]=function(_0x30a715,_0x30d33d,_0x10f71c){_0x30a715=_0x30a715===undefined?_0x0f97('0x2a'):_0x30a715;_0x30d33d=_0x30d33d===undefined?'5':_0x30d33d;_0x10f71c=_0x10f71c===undefined?'1':_0x10f71c;return this[_0x0f97('0x26')](util[_0x0f97('0x2b')](_0x0f97('0x2c'),_0x30a715,_0x30d33d*0x3e8,_0x10f71c));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x2d')]=function(_0x4fe728){_0x4fe728=_0x4fe728||_0x0f97('0x2e');return this[_0x0f97('0x26')](util[_0x0f97('0x2b')](_0x0f97('0x2f'),_0x4fe728));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x30')]=function(_0x2aeef8,_0x28ba36){if(_['isArray'](_0x28ba36)){return this['sendRequest'](util[_0x0f97('0x2b')](_0x0f97('0x31'),_0x2aeef8,_0x28ba36[_0x0f97('0x32')](',')));}return this[_0x0f97('0x26')](util[_0x0f97('0x2b')](_0x0f97('0x31'),_0x2aeef8,_0x28ba36));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x33')]=function(_0x139c8a){return this[_0x0f97('0x26')](util[_0x0f97('0x2b')]('SET\x20CONTEXT\x20%s',_0x139c8a));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x34')]=function(_0xe2526c){return this[_0x0f97('0x26')](util[_0x0f97('0x2b')]('SET\x20EXTENSION\x20%s',_0xe2526c));};AGIChannel[_0x0f97('0x28')]['setPriority']=function(_0x2f85f5){return this['sendRequest'](util[_0x0f97('0x2b')](_0x0f97('0x35'),_0x2f85f5));};AGIChannel[_0x0f97('0x28')][_0x0f97('0xc')]=function(){return this[_0x0f97('0x26')]('HANGUP');};AGIChannel['prototype'][_0x0f97('0x36')]=function(_0x428089,_0x595adf){var _0xfa6702=_[_0x0f97('0x37')](_0x595adf)||_[_0x0f97('0x38')](_0x595adf)?_0x595adf[_0x0f97('0x39')]():_0x595adf;return this['sendRequest'](util[_0x0f97('0x2b')](_0x0f97('0x3a'),_0x428089,_0xfa6702?_0xfa6702[_0x0f97('0x39')]()[_0x0f97('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0f97('0x28')]['sayNumber']=function(_0x568fbd,_0x36effc){return this[_0x0f97('0x26')](util[_0x0f97('0x2b')](_0x0f97('0x3b'),_0x568fbd,_0x36effc));};AGIChannel[_0x0f97('0x28')]['sayDigits']=function(_0x516e3b,_0x230ccf){return this[_0x0f97('0x26')](util[_0x0f97('0x2b')]('SAY\x20DIGITS\x20%s\x20%s',_0x516e3b,_0x230ccf));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x3c')]=function(_0x1053cb,_0x5e07e8){return this[_0x0f97('0x26')](util[_0x0f97('0x2b')](_0x0f97('0x3d'),_0x1053cb,_0x5e07e8));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x3e')]=function(_0x1dc76d,_0xf4ed1a,_0x21500a){_0xf4ed1a=_0xf4ed1a||this[_0x0f97('0x3f')];_0x21500a=_0x21500a||0x1;this[_0x0f97('0x33')](_0x1dc76d);this[_0x0f97('0x34')](_0xf4ed1a);this['setPriority'](_0x21500a);return this[_0x0f97('0x2d')](util[_0x0f97('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x1dc76d,_0xf4ed1a,_0x21500a));};AGIChannel[_0x0f97('0x28')]['getVariable']=function(_0x153777){return this[_0x0f97('0x26')](util[_0x0f97('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x153777));};AGIChannel['prototype'][_0x0f97('0x40')]=function(_0xb33b82,_0x299695,_0xcda718,_0x278a8c,_0x5ad169,_0x5962a4){_0x299695=_0x299695||_0x0f97('0x41');_0xcda718=_0xcda718||'';_0x278a8c=_0x278a8c===undefined?-0x1:_0x278a8c==='-1'?-0x1:_0x278a8c*0x3e8;_0x5ad169=_0x5ad169===undefined?'':'s='+_0x5ad169;_0x5962a4=_0x5962a4?_0x0f97('0x42'):'';return this[_0x0f97('0x26')](util[_0x0f97('0x2b')](_0x0f97('0x43'),_0xb33b82,_0x299695,_0xcda718,_0x278a8c,_0x5962a4,_0x5ad169));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x44')]=function(_0xd9f44b,_0x14b827){_0x14b827=_0x14b827||'';return this['sendRequest'](util[_0x0f97('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xd9f44b,_0x14b827));};AGIChannel[_0x0f97('0x28')][_0x0f97('0x45')]=function(_0xd246c1){return this['exec']('AGI',_0xd246c1);};AGIChannel[_0x0f97('0x28')][_0x0f97('0x46')]=function(_0x40ea51){return this['exec']('WAIT',_0x40ea51);};AGIChannel['prototype'][_0x0f97('0x1a')]=function(_0x3cdbee,_0x1871b6){this[_0x0f97('0x2d')](util[_0x0f97('0x2b')](_0x0f97('0x47'),_0x3cdbee['id'],_0x3cdbee[_0x0f97('0x48')],_0x1871b6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0f97('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 512b3be..37c333b 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 _0x5620=['name','Undefined\x20error.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message'];(function(_0x233438,_0x48d3d4){var _0x4d06c3=function(_0x224386){while(--_0x224386){_0x233438['push'](_0x233438['shift']());}};_0x4d06c3(++_0x48d3d4);}(_0x5620,0x196));var _0x0562=function(_0x22d202,_0xfcd670){_0x22d202=_0x22d202-0x0;var _0x3cb212=_0x5620[_0x22d202];return _0x3cb212;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x0562('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x0562('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0x0562('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0x0562('0x3'),'E_AGI_SOCKET_ERROR':_0x0562('0x4'),'E_AGI_SOCKET_CLOSE':_0x0562('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x0562('0x6'),'E_AGI_COMMAND_EMPTY':_0x0562('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x0562('0x8')};function AGIError(_0x52a0cf){var _0x52a0cf=_0x52a0cf||null,_0x2d1af4=_0x2d1af4||[],_0x14b0a7=0x1,_0x235ea3='';if(!error[_0x52a0cf]){_0x52a0cf=_0x0562('0x9');}_0x2d1af4[_0x0562('0xa')](error[_0x52a0cf]);while(arguments[_0x14b0a7]){_0x2d1af4[_0x0562('0xa')](arguments[_0x14b0a7]);_0x14b0a7++;}_0x235ea3=util[_0x0562('0xb')][_0x0562('0xc')](util,_0x2d1af4);this[_0x0562('0xd')]=_0x235ea3;this[_0x0562('0xe')]=_0x52a0cf;}module['exports']=AGIError; \ No newline at end of file +var _0x4421=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x4a74e5,_0x108772){var _0x1339c6=function(_0x7d44df){while(--_0x7d44df){_0x4a74e5['push'](_0x4a74e5['shift']());}};_0x1339c6(++_0x108772);}(_0x4421,0x170));var _0x1442=function(_0x1be78c,_0x395cda){_0x1be78c=_0x1be78c-0x0;var _0x6554b8=_0x4421[_0x1be78c];return _0x6554b8;};'use strict';var util=require(_0x1442('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x1442('0x1'),'E_AGI_SERVER_ERROR':_0x1442('0x2'),'E_AGI_SERVER_CLOSE':_0x1442('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x1442('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x1442('0x5'),'E_AGI_SOCKET_ERROR':_0x1442('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x1442('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1442('0x8'),'E_AGI_IVR_ENTRY':_0x1442('0x9')};function AGIError(_0xab4feb){var _0xab4feb=_0xab4feb||null,_0x1b5e29=_0x1b5e29||[],_0x439b09=0x1,_0x23fe1a='';if(!error[_0xab4feb]){_0xab4feb=_0x1442('0xa');}_0x1b5e29[_0x1442('0xb')](error[_0xab4feb]);while(arguments[_0x439b09]){_0x1b5e29[_0x1442('0xb')](arguments[_0x439b09]);_0x439b09++;}_0x23fe1a=util['format'][_0x1442('0xc')](util,_0x1b5e29);this[_0x1442('0xd')]=_0x23fe1a;this[_0x1442('0xe')]=_0xab4feb;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index a14375a..ca6d46c 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 _0x1ad9=['redis','defaults','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','parse','projectUpdate','exports','lodash','events','./error'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x1ad9,0xb1));var _0x91ad=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x1ad9[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x91ad('0x0'));var EventEmitter=require(_0x91ad('0x1'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0x91ad('0x2'));var config=require('../../config/environment');config[_0x91ad('0x3')]=_[_0x91ad('0x4')](config[_0x91ad('0x3')],{'host':_0x91ad('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x91ad('0x3')]);sub[_0x91ad('0x6')]('agi',function(_0x506505){if(_0x506505)return eventEmitter[_0x91ad('0x7')](_0x91ad('0x8'),new AGIError(_0x91ad('0x9'),_0x506505));});sub['on'](_0x91ad('0xa'),function(_0xc1b41d,_0x5bac2a){if(_0xc1b41d!==_0x91ad('0xb'))return;try{var _0x1a3c39=JSON[_0x91ad('0xc')](_0x5bac2a);eventEmitter[_0x91ad('0x7')](_0x91ad('0xd'),_0x1a3c39);}catch(_0x578492){eventEmitter[_0x91ad('0x7')](_0x91ad('0x8'),new AGIError(_0x91ad('0x9'),_0x578492));}});module[_0x91ad('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x3020=['subscribe','agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','error','exports','lodash','ioredis','./error','../../config/environment','redis','localhost'];(function(_0x40c652,_0x2ff0ec){var _0xe2b520=function(_0x1285fc){while(--_0x1285fc){_0x40c652['push'](_0x40c652['shift']());}};_0xe2b520(++_0x2ff0ec);}(_0x3020,0xdb));var _0x0302=function(_0x545f8b,_0x475cf8){_0x545f8b=_0x545f8b-0x0;var _0x3ea7c9=_0x3020[_0x545f8b];return _0x3ea7c9;};'use strict';var _=require(_0x0302('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0x0302('0x1'));var AGIError=require(_0x0302('0x2'));var config=require(_0x0302('0x3'));config['redis']=_['defaults'](config[_0x0302('0x4')],{'host':_0x0302('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x0302('0x4')]);sub[_0x0302('0x6')](_0x0302('0x7'),function(_0x5a2568){if(_0x5a2568)return eventEmitter[_0x0302('0x8')]('error',new AGIError(_0x0302('0x9'),_0x5a2568));});sub['on'](_0x0302('0xa'),function(_0x8fc1e4,_0x7f699){if(_0x8fc1e4!=='agi')return;try{var _0x16fccd=JSON[_0x0302('0xb')](_0x7f699);eventEmitter[_0x0302('0x8')](_0x0302('0xc'),_0x16fccd);}catch(_0x4b16fb){eventEmitter[_0x0302('0x8')](_0x0302('0xd'),new AGIError(_0x0302('0x9'),_0x4b16fb));}});module[_0x0302('0xe')]={'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 bd2326b..339db01 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 _0x853a=['max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','edges','prototype','addVertex','vertices','addEdge','push','size','relations','numberOfEdges','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','split','agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x853a,0x189));var _0xa853=function(_0x357b8c,_0x315ad2){_0x357b8c=_0x357b8c-0x0;var _0x148add=_0x853a[_0x357b8c];return _0x148add;};'use strict';var _=require(_0xa853('0x0'));var logger=require('../../../config/logger')(_0xa853('0x1'));var verticesWithRetry=[_0xa853('0x2'),_0xa853('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0xa853('0x4')]={};this['numberOfEdges']=0x0;};Graph[_0xa853('0x5')][_0xa853('0x6')]=function(_0x99577b){this[_0xa853('0x7')][_0x99577b['id']]=_0x99577b;this[_0xa853('0x4')][_0x99577b['id']]=[];};Graph['prototype'][_0xa853('0x8')]=function(_0x56a85b,_0x39bb1a,_0x37d5d6){this['edges'][_0x56a85b][_0xa853('0x9')]({'target':_0x39bb1a,'condition':_0x37d5d6});this['numberOfEdges']+=0x1;};Graph[_0xa853('0x5')][_0xa853('0xa')]=function(){return _[_0xa853('0xa')](this[_0xa853('0x7')]);};Graph[_0xa853('0x5')][_0xa853('0xb')]=function(){return this[_0xa853('0xc')];};Graph[_0xa853('0x5')]['getVertex']=function(_0x151200){return this['vertices'][_0x151200];};Graph[_0xa853('0x5')]['traverseBFS']=function(_0x2ef645,_0x46fc11){if(!this['vertices'][_0x2ef645]){return logger['info'](_0xa853('0xd'));}var _0x132a4e=_0x46fc11(this['vertices'][_0x2ef645]);if(!_0x132a4e){return logger[_0xa853('0xe')](_0xa853('0xf'));}if(this[_0xa853('0x4')][_0x2ef645][_0xa853('0x10')]===0x0){return logger[_0xa853('0xe')](_0xa853('0x11'));}for(var _0x184d21=0x0,_0x192d91=[],_0x4e0384=![];_0x184d21\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','info','arg_1','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','close','find','handleNotFound','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','connection','lodash','util','../../config/logger','agi','../../config/license/util','./rpc','./project'];(function(_0x5222da,_0x494a16){var _0x1aa8a0=function(_0x530da0){while(--_0x530da0){_0x5222da['push'](_0x5222da['shift']());}};_0x1aa8a0(++_0x494a16);}(_0x66e0,0x199));var _0x066e=function(_0x314742,_0x1111a2){_0x314742=_0x314742-0x0;var _0x47f041=_0x66e0[_0x314742];return _0x47f041;};'use strict';var _=require(_0x066e('0x0'));var syncho=require('syncho');var util=require(_0x066e('0x1'));var config=require('../../config/environment');var logger=require(_0x066e('0x2'))(_0x066e('0x3'));var utilLicense=require(_0x066e('0x4'));var rpc=require(_0x066e('0x5'));var Project=require(_0x066e('0x6'));var AGIEmitter=require(_0x066e('0x7'))[_0x066e('0x8')];var projects=[];config[_0x066e('0x3')]=_['defaults'](config['agi'],{'ip':_0x066e('0x9'),'port':0x11dd});AGIEmitter['on'](_0x066e('0xa'),projectUpdateHandler);function connectionHandler(_0x2e5c83){process[_0x066e('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2e5c83);agiHandler(_0x2e5c83);}catch(_0x5090d9){logger[_0x066e('0xc')](_0x5090d9[_0x066e('0xd')]);}});});}function projectUpdateHandler(_0x5d0dd7){try{var _0x1d70a6=_[_0x066e('0xe')](projects,['id',_0x5d0dd7['id']]);if(_0x1d70a6>-0x1){if(_0x5d0dd7[_0x066e('0xf')]===!![]){projects['splice'](_0x1d70a6,0x1);}else{projects[_0x1d70a6]=_0x5d0dd7;}}else{projects[_0x066e('0x10')](_0x5d0dd7);}}catch(_0x5c913c){logger[_0x066e('0xc')](_0x5c913c[_0x066e('0xd')]);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi']['port']);logger['info'](util[_0x066e('0x11')](_0x066e('0x12'),config[_0x066e('0x3')]['ip'],config[_0x066e('0x3')][_0x066e('0x13')]));}function errorHandler(_0x281546){if(_0x281546&&_0x281546[_0x066e('0x14')]&&_0x281546[_0x066e('0x15')]){logger['error'](util[_0x066e('0x11')](_0x066e('0x16'),_0x281546['name'],_0x281546[_0x066e('0x15')]));}else{logger[_0x066e('0xc')](util['format'](_0x066e('0x17'),_0x281546[_0x066e('0xd')]));}}function closeHandler(){logger['info'](util[_0x066e('0x11')](_0x066e('0x18'),this['arg_1'],this[_0x066e('0x19')],this[_0x066e('0x1a')],this[_0x066e('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2fde32){logger['error'](_0x2fde32['stack']);}}function timeoutHandler(){logger[_0x066e('0x1c')](util[_0x066e('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x066e('0x1d')],this[_0x066e('0x19')],this[_0x066e('0x1a')],this[_0x066e('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x066e('0x1c')](util[_0x066e('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x066e('0x1d')],this[_0x066e('0x19')],this[_0x066e('0x1a')],this[_0x066e('0x1b')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x583763,_0x5159eb){rpc['createSquareReport'](_0x583763)[_0x066e('0x1e')](function(_0x45654f){if(_0x5159eb){_0x5159eb(null,_0x45654f);}})[_0x066e('0x1f')](function(_0x110601){if(_0x5159eb){_0x5159eb(null,_0x110601);}});}function setChannelVariables(_0x43b979){for(var _0x5e0a3c in _0x43b979){if(_0x43b979[_0x066e('0x20')](_0x5e0a3c)){if(_0x5e0a3c[_0x066e('0x21')](_0x066e('0x22'))===0x0){_0x43b979[_0x5e0a3c[_0x066e('0x23')](0x4)]=_0x43b979[_0x5e0a3c];delete _0x43b979[_0x5e0a3c];}}}}function agiHandler(_0x3caca5){logger[_0x066e('0x24')](_0x066e('0x25'),JSON['stringify'](_0x3caca5,null,0x2));logger[_0x066e('0x1c')](util[_0x066e('0x11')](_0x066e('0x26'),_0x3caca5[_0x066e('0x1d')],_0x3caca5['calleridname'],_0x3caca5[_0x066e('0x1a')],_0x3caca5[_0x066e('0x1b')],_0x3caca5[_0x066e('0x27')]));_0x3caca5['on']('error',errorHandler);_0x3caca5['on'](_0x066e('0x28'),closeHandler);_0x3caca5['on']('timeout',timeoutHandler);_0x3caca5['evtHangup']=![];_0x3caca5['on']('hangup',hangupHandler);var _0x5c6849=_[_0x066e('0x29')](projects,[_0x066e('0x14'),_0x3caca5[_0x066e('0x1d')]]);if(!_0x5c6849)return Project[_0x066e('0x2a')](_0x3caca5);if(!_0x5c6849['production'])return Project['handleUnpublished'](_0x3caca5);return Project['initialize'](_0x5c6849,_0x3caca5);}function main(){var _0x566726;return utilLicense[_0x066e('0x2b')]()[_0x066e('0x1e')](function(_0x567c9c){if(!_0x567c9c)return;if(_0x567c9c[_0x066e('0x2c')]){if(_0x567c9c[_0x066e('0x2d')]&&_0x567c9c[_0x066e('0x2d')]>0x0){logger[_0x066e('0x1c')](util[_0x066e('0x11')](_0x066e('0x2e'),_0x567c9c[_0x066e('0x2d')]));_0x566726=_0x567c9c[_0x066e('0x2d')];}else{logger[_0x066e('0x1c')](_0x066e('0x2f'));}}else{logger[_0x066e('0x1c')](_0x066e('0x30'));_0x566726=-0x1;}})[_0x066e('0x1e')](function(){return Project['getAll']();})['then'](function(_0x180ef5){projects=_0x180ef5;return;})[_0x066e('0x1f')](function(_0x285d3d){logger['error'](_0x066e('0x31'),_0x285d3d[_0x066e('0xd')]);})[_0x066e('0x32')](function(){var _0x33454a=require('./server')(config[_0x066e('0x3')][_0x066e('0x13')],config[_0x066e('0x3')]['ip'],_0x566726);_0x33454a['on']('error',errorHandler);_0x33454a['on']('listening',listeningHandler);_0x33454a['on'](_0x066e('0x33'),connectionHandler);_0x33454a['on'](_0x066e('0x28'),closeHandler);});}main(); \ No newline at end of file +var _0xd449=['handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','projectUpdate','error','stack','findIndex','deleted','splice','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find'];(function(_0x8fb5e2,_0x427d66){var _0x4d2bd0=function(_0x3ca1c6){while(--_0x3ca1c6){_0x8fb5e2['push'](_0x8fb5e2['shift']());}};_0x4d2bd0(++_0x427d66);}(_0xd449,0x8a));var _0x9d44=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0xd449[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0x9d44('0x0'));var syncho=require('syncho');var util=require(_0x9d44('0x1'));var config=require(_0x9d44('0x2'));var logger=require(_0x9d44('0x3'))(_0x9d44('0x4'));var utilLicense=require(_0x9d44('0x5'));var rpc=require(_0x9d44('0x6'));var Project=require(_0x9d44('0x7'));var AGIEmitter=require(_0x9d44('0x8'))[_0x9d44('0x9')];var projects=[];config['agi']=_[_0x9d44('0xa')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x9d44('0xb'),projectUpdateHandler);function connectionHandler(_0x440b7c){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x440b7c);agiHandler(_0x440b7c);}catch(_0x318ca5){logger[_0x9d44('0xc')](_0x318ca5[_0x9d44('0xd')]);}});});}function projectUpdateHandler(_0x20b665){try{var _0x2225b5=_[_0x9d44('0xe')](projects,['id',_0x20b665['id']]);if(_0x2225b5>-0x1){if(_0x20b665[_0x9d44('0xf')]===!![]){projects[_0x9d44('0x10')](_0x2225b5,0x1);}else{projects[_0x2225b5]=_0x20b665;}}else{projects[_0x9d44('0x11')](_0x20b665);}}catch(_0x2e1e6d){logger[_0x9d44('0xc')](_0x2e1e6d['stack']);}}function listeningHandler(){console['log'](_0x9d44('0x12'),config[_0x9d44('0x4')][_0x9d44('0x13')]);logger[_0x9d44('0x14')](util[_0x9d44('0x15')](_0x9d44('0x16'),config[_0x9d44('0x4')]['ip'],config[_0x9d44('0x4')][_0x9d44('0x13')]));}function errorHandler(_0x4b0e1a){if(_0x4b0e1a&&_0x4b0e1a[_0x9d44('0x17')]&&_0x4b0e1a[_0x9d44('0x18')]){logger[_0x9d44('0xc')](util[_0x9d44('0x15')](_0x9d44('0x19'),_0x4b0e1a[_0x9d44('0x17')],_0x4b0e1a[_0x9d44('0x18')]));}else{logger[_0x9d44('0xc')](util[_0x9d44('0x15')]('[ERROR]\x20%s',_0x4b0e1a[_0x9d44('0xd')]));}}function closeHandler(){logger['info'](util[_0x9d44('0x15')](_0x9d44('0x1a'),this[_0x9d44('0x1b')],this[_0x9d44('0x1c')],this['callerid'],this[_0x9d44('0x1d')],this[_0x9d44('0x1e')]));try{createSquareReport(this);}catch(_0x1eaeb8){logger['error'](_0x1eaeb8['stack']);}}function timeoutHandler(){logger[_0x9d44('0x14')](util[_0x9d44('0x15')](_0x9d44('0x1f'),this[_0x9d44('0x1b')],this[_0x9d44('0x1c')],this[_0x9d44('0x20')],this[_0x9d44('0x1d')],this[_0x9d44('0x1e')]));}function hangupHandler(){logger[_0x9d44('0x14')](util[_0x9d44('0x15')](_0x9d44('0x21'),this[_0x9d44('0x1b')],this[_0x9d44('0x1c')],this[_0x9d44('0x20')],this[_0x9d44('0x1d')],this[_0x9d44('0x1e')]));this[_0x9d44('0x22')]=!![];}function createSquareReport(_0x41ba32,_0x279a3f){rpc[_0x9d44('0x23')](_0x41ba32)[_0x9d44('0x24')](function(_0x2a894d){if(_0x279a3f){_0x279a3f(null,_0x2a894d);}})[_0x9d44('0x25')](function(_0x506afa){if(_0x279a3f){_0x279a3f(null,_0x506afa);}});}function setChannelVariables(_0x162842){for(var _0x411d09 in _0x162842){if(_0x162842[_0x9d44('0x26')](_0x411d09)){if(_0x411d09[_0x9d44('0x27')](_0x9d44('0x28'))===0x0){_0x162842[_0x411d09['substring'](0x4)]=_0x162842[_0x411d09];delete _0x162842[_0x411d09];}}}}function agiHandler(_0xd4be64){logger[_0x9d44('0x29')](_0x9d44('0x2a'),JSON[_0x9d44('0x2b')](_0xd4be64,null,0x2));logger[_0x9d44('0x14')](util[_0x9d44('0x15')](_0x9d44('0x2c'),_0xd4be64[_0x9d44('0x1b')],_0xd4be64[_0x9d44('0x1c')],_0xd4be64[_0x9d44('0x20')],_0xd4be64[_0x9d44('0x1d')],_0xd4be64[_0x9d44('0x1e')]));_0xd4be64['on'](_0x9d44('0xc'),errorHandler);_0xd4be64['on'](_0x9d44('0x2d'),closeHandler);_0xd4be64['on'](_0x9d44('0x2e'),timeoutHandler);_0xd4be64[_0x9d44('0x22')]=![];_0xd4be64['on']('hangup',hangupHandler);var _0x36932c=_[_0x9d44('0x2f')](projects,[_0x9d44('0x17'),_0xd4be64[_0x9d44('0x1b')]]);if(!_0x36932c)return Project[_0x9d44('0x30')](_0xd4be64);if(!_0x36932c['production'])return Project[_0x9d44('0x31')](_0xd4be64);return Project[_0x9d44('0x32')](_0x36932c,_0xd4be64);}function main(){var _0x3c351f;return utilLicense[_0x9d44('0x33')]()[_0x9d44('0x24')](function(_0x213e44){if(!_0x213e44)return;if(_0x213e44[_0x9d44('0x34')]){if(_0x213e44['callysquare']&&_0x213e44[_0x9d44('0x35')]>0x0){logger[_0x9d44('0x14')](util[_0x9d44('0x15')](_0x9d44('0x36'),_0x213e44['callysquare']));_0x3c351f=_0x213e44['callysquare'];}else{logger[_0x9d44('0x14')](_0x9d44('0x37'));}}else{logger[_0x9d44('0x14')](_0x9d44('0x38'));_0x3c351f=-0x1;}})[_0x9d44('0x24')](function(){return Project[_0x9d44('0x39')]();})[_0x9d44('0x24')](function(_0x3e93dc){projects=_0x3e93dc;return;})[_0x9d44('0x25')](function(_0x8948e6){logger['error'](_0x9d44('0x3a'),_0x8948e6[_0x9d44('0xd')]);})[_0x9d44('0x3b')](function(){var _0x2d7767=require('./server')(config['agi'][_0x9d44('0x13')],config[_0x9d44('0x4')]['ip'],_0x3c351f);_0x2d7767['on'](_0x9d44('0xc'),errorHandler);_0x2d7767['on'](_0x9d44('0x3c'),listeningHandler);_0x2d7767['on'](_0x9d44('0x3d'),connectionHandler);_0x2d7767['on'](_0x9d44('0x2d'),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 a6c5a50..126c48c 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 _0x97ad=['client','http','request','error','message','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x274c48,_0x2d742f){var _0x5148fc=function(_0x13968a){while(--_0x13968a){_0x274c48['push'](_0x274c48['shift']());}};_0x5148fc(++_0x2d742f);}(_0x97ad,0x1ca));var _0xd97a=function(_0x513a02,_0x5910d6){_0x513a02=_0x513a02-0x0;var _0x10fcc9=_0x97ad[_0x513a02];return _0x10fcc9;};'use strict';var BPromise=require(_0xd97a('0x0'));var jayson=require(_0xd97a('0x1'));var client=jayson[_0xd97a('0x2')][_0xd97a('0x3')]({'port':0x232b});function request(_0x2c47cd,_0x445cd8){return new BPromise(function(_0x3867a1,_0x1ffa87){return client[_0xd97a('0x4')](_0x2c47cd,_0x445cd8)['then'](function(_0x3ac0f5){if(_0x3ac0f5[_0xd97a('0x5')]){return _0x1ffa87(_0x3ac0f5['error'][_0xd97a('0x6')]);}else{return _0x3867a1(_0x3ac0f5[_0xd97a('0x7')]);}})[_0xd97a('0x8')](function(_0xc12a4c){return _0x1ffa87(_0xc12a4c);});});}exports[_0xd97a('0x9')]=function(_0x199d00,_0x18e62c){return request('SendMail',{'account':_0x199d00,'message':_0x18e62c});}; \ No newline at end of file +var _0x2651=['result','catch','SendMail','bluebird','jayson/promise','client','http','error','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2651,0xb7));var _0x1265=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x2651[_0x45b034];return _0x509cb0;};'use strict';var BPromise=require(_0x1265('0x0'));var jayson=require(_0x1265('0x1'));var client=jayson[_0x1265('0x2')][_0x1265('0x3')]({'port':0x232b});function request(_0x2184b3,_0x5f21aa){return new BPromise(function(_0x1363e9,_0x181f01){return client['request'](_0x2184b3,_0x5f21aa)['then'](function(_0xb88252){if(_0xb88252['error']){return _0x181f01(_0xb88252[_0x1265('0x4')][_0x1265('0x5')]);}else{return _0x1363e9(_0xb88252[_0x1265('0x6')]);}})[_0x1265('0x7')](function(_0x3441c6){return _0x181f01(_0x3441c6);});});}exports['sendMailMessage']=function(_0x213b8c,_0x3be7e9){return request(_0x1265('0x8'),{'account':_0x213b8c,'message':_0x3be7e9});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index f76575d..4a41f9d 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 _0xb341=['arg_1','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','getSquareProjects','error','agicommand','hasOwnProperty','retry','addVertex','omit','isArray','length','source','target','addEdge','toJson','inspect','production','start','debug','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','isUndefined','toString','response','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x2c861c,_0x1bb810){var _0x2ef6e8=function(_0x161d34){while(--_0x161d34){_0x2c861c['push'](_0x2c861c['shift']());}};_0x2ef6e8(++_0x1bb810);}(_0xb341,0x1b8));var _0x1b34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb341[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1b34('0x0'));var moment=require(_0x1b34('0x1'));var parser=require(_0x1b34('0x2'));var util=require(_0x1b34('0x3'));var logger=require(_0x1b34('0x4'))(_0x1b34('0x5'));var rpc=require(_0x1b34('0x6'));var mailRpc=require(_0x1b34('0x7'));var Graph=require(_0x1b34('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x1b34('0x9')]()['catch'](function(_0x24822f){logger[_0x1b34('0xa')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x24822f['stack']);return[];});}function addVertex(_0x2ff6f2,_0x3f5b3d,_0x52fcd3){_0x3f5b3d[_0x1b34('0xb')]=_0x52fcd3;if(_0x3f5b3d[_0x1b34('0xc')]('retry')){_0x3f5b3d['maxRetry']=parseInt(_0x3f5b3d[_0x1b34('0xd')],0xa);}_0x2ff6f2[_0x1b34('0xe')](_[_0x1b34('0xf')](_0x3f5b3d,'mxCell'));}function initGraph(_0xb5f75f,_0x21d3aa){var _0x53f1fe=new Graph();for(var _0x29566a in _0xb5f75f){if(_0xb5f75f['hasOwnProperty'](_0x29566a)){if(_[_0x1b34('0x10')](_0xb5f75f[_0x29566a])){for(var _0x314dc9=0x0;_0x314dc9<_0xb5f75f[_0x29566a][_0x1b34('0x11')];_0x314dc9+=0x1){addVertex(_0x53f1fe,_0xb5f75f[_0x29566a][_0x314dc9],_0x29566a);}}else{addVertex(_0x53f1fe,_0xb5f75f[_0x29566a],_0x29566a);}}}for(var _0x2a94da=0x0;_0x2a94da<_0x21d3aa[_0x1b34('0x11')];_0x2a94da+=0x1){if(_0x21d3aa[_0x2a94da][_0x1b34('0x12')]&&_0x21d3aa[_0x2a94da][_0x1b34('0x13')]){_0x53f1fe[_0x1b34('0x14')](_0x21d3aa[_0x2a94da][_0x1b34('0x12')],_0x21d3aa[_0x2a94da]['target'],_0x21d3aa[_0x2a94da]['value']);}}return _0x53f1fe;}function getRoot(_0xba893d){return parser[_0x1b34('0x15')](_0xba893d,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x61d623){return util[_0x1b34('0x16')](_0x61d623,{'showHidden':![],'depth':null});}function initialize(_0x32b715,_0x46c2e9){var _0x3c9715=getRoot(_0x32b715[_0x1b34('0x17')]);if(!_0x3c9715||!_0x3c9715[_0x1b34('0x18')])return;var _0x4d3131,_0x3fe071,_0x218f0d;logger[_0x1b34('0x19')](_0x1b34('0x1a'),JSON[_0x1b34('0x1b')](_0x3c9715,null,0x2));_0x46c2e9[_0x1b34('0x1c')]=moment()['format'](_0x1b34('0x1d'));_0x4d3131=initGraph(_[_0x1b34('0xf')](_0x3c9715,_0x1b34('0x1e')),_0x3c9715[_0x1b34('0x1e')]);_0x3fe071=new Vertices(_0x46c2e9,rpc,mailRpc);logger[_0x1b34('0x1f')](util[_0x1b34('0x20')](_0x1b34('0x21'),_0x46c2e9['arg_1'],_0x46c2e9[_0x1b34('0x22')],_0x46c2e9[_0x1b34('0x23')],_0x46c2e9[_0x1b34('0x24')],_0x46c2e9['uniqueid']));_0x4d3131[_0x1b34('0x25')](_0x3c9715[_0x1b34('0x18')]['id'],function(_0x13c2c4){try{_0x13c2c4=_0x3fe071[_0x1b34('0x26')](_0x13c2c4);logger[_0x1b34('0x19')](_0x1b34('0x27'),JSON[_0x1b34('0x1b')](_0x13c2c4,null,0x2));if(_0x13c2c4[_0x1b34('0xb')]==='gotoc'){logger[_0x1b34('0x1f')](_0x1b34('0x28'));_0x46c2e9['context']=_0x13c2c4[_0x1b34('0x29')]||_0x46c2e9[_0x1b34('0x29')];_0x46c2e9[_0x1b34('0x2a')]=_0x13c2c4[_0x1b34('0x2a')];_0x46c2e9[_0x1b34('0x2b')]=_0x13c2c4['priority']?_0x13c2c4[_0x1b34('0x2b')]-0x1:0x1;return null;}else if(_0x13c2c4&&_0x3fe071[_0x13c2c4[_0x1b34('0xb')]]){_0x218f0d=_0x3fe071[_0x13c2c4[_0x1b34('0xb')]](_0x13c2c4);logger[_0x1b34('0x1f')]('response',JSON['stringify'](_0x218f0d,null,0x2));if(_0x218f0d&&_0x218f0d[_0x1b34('0x2c')]===AGI_CODE_SUCCESS&&_0x218f0d[_0x1b34('0x2d')]!==AGI_RESULT_ERROR&&!_0x46c2e9[_0x1b34('0x2e')]){logger[_0x1b34('0x19')]('response',inspect(_0x218f0d));return _[_0x1b34('0x2f')](_0x218f0d['result'])?null:_0x218f0d[_0x1b34('0x2d')][_0x1b34('0x30')]();}else{logger[_0x1b34('0xa')](_0x1b34('0x31'),inspect(_0x218f0d));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x46c8b7){logger[_0x1b34('0xa')](_0x46c8b7[_0x1b34('0x32')]);return null;}});if(_0x3c9715[_0x1b34('0x33')]){logger[_0x1b34('0x1f')](util[_0x1b34('0x20')](_0x1b34('0x34'),_0x46c2e9['arg_1'],_0x46c2e9['calleridname'],_0x46c2e9['callerid'],_0x46c2e9[_0x1b34('0x24')],_0x46c2e9[_0x1b34('0x35')]));_0x4d3131[_0x1b34('0x25')](_0x3c9715[_0x1b34('0x33')]['id'],function(_0x5762d3){try{_0x5762d3=_0x3fe071[_0x1b34('0x26')](_0x5762d3);logger[_0x1b34('0x19')]('vertex',JSON[_0x1b34('0x1b')](_0x5762d3,null,0x2));if(_0x5762d3&&_0x3fe071[_0x5762d3[_0x1b34('0xb')]]){_0x218f0d=_0x3fe071[_0x5762d3['agicommand']](_0x5762d3);if(_0x218f0d){logger[_0x1b34('0x19')](_0x1b34('0x31'),inspect(_0x218f0d));return _[_0x1b34('0x2f')](_0x218f0d[_0x1b34('0x2d')])?null:_0x218f0d[_0x1b34('0x2d')][_0x1b34('0x30')]();}else{logger[_0x1b34('0xa')]('response',inspect(_0x218f0d));return null;}}else{logger[_0x1b34('0xa')](_0x1b34('0x36'));return null;}}catch(_0x1e5596){logger[_0x1b34('0xa')](_0x1e5596[_0x1b34('0x32')]);return null;}});}logger[_0x1b34('0x1f')](util[_0x1b34('0x20')](_0x1b34('0x37'),_0x46c2e9[_0x1b34('0x38')],_0x46c2e9['calleridname'],_0x46c2e9[_0x1b34('0x23')],_0x46c2e9[_0x1b34('0x24')],_0x46c2e9[_0x1b34('0x35')]));logger[_0x1b34('0x1f')](util[_0x1b34('0x20')](_0x1b34('0x39'),_0x46c2e9[_0x1b34('0x29')],_0x46c2e9[_0x1b34('0x2a')],parseInt(_0x46c2e9[_0x1b34('0x2b')],0xa)+0x1));_0x46c2e9[_0x1b34('0x3a')](_0x46c2e9[_0x1b34('0x29')],_0x46c2e9['extension'],parseInt(_0x46c2e9[_0x1b34('0x2b')],0xa)+0x1);_0x46c2e9['close']();}function handleNotFound(_0x5d8834){logger['error'](util[_0x1b34('0x20')]('Project\x20%s\x20not\x20found',_0x5d8834['arg_1']));_0x5d8834[_0x1b34('0x3a')](_0x5d8834[_0x1b34('0x29')],_0x5d8834[_0x1b34('0x2a')],parseInt(_0x5d8834[_0x1b34('0x2b')],0xa)+0x1);_0x5d8834[_0x1b34('0x3b')]();}function handleUnpublished(_0x6766cf){logger['error'](util[_0x1b34('0x20')](_0x1b34('0x3c'),_0x6766cf[_0x1b34('0x38')]));_0x6766cf[_0x1b34('0x3a')](_0x6766cf[_0x1b34('0x29')],_0x6766cf[_0x1b34('0x2a')],parseInt(_0x6766cf[_0x1b34('0x2b')],0xa)+0x1);_0x6766cf[_0x1b34('0x3b')]();}module[_0x1b34('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x558a=['[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','exports','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','retry','hasOwnProperty','length','source','target','addEdge','toJson','root','inspect','production','start','stringify','joinAt','format','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','dnid','uniqueid','traverseBFS','clear','debug','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','isUndefined','toString'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x558a,0x173));var _0xa558=function(_0x3bb39e,_0x2ca25d){_0x3bb39e=_0x3bb39e-0x0;var _0x28814f=_0x558a[_0x3bb39e];return _0x28814f;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require('xml2json');var util=require(_0xa558('0x0'));var logger=require(_0xa558('0x1'))(_0xa558('0x2'));var rpc=require(_0xa558('0x3'));var mailRpc=require(_0xa558('0x4'));var Graph=require(_0xa558('0x5'));var Vertices=require(_0xa558('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x26d9a3){logger[_0xa558('0x7')](_0xa558('0x8'),_0x26d9a3['stack']);return[];});}function addVertex(_0x583641,_0x2bf3b5,_0x402a05){_0x2bf3b5[_0xa558('0x9')]=_0x402a05;if(_0x2bf3b5['hasOwnProperty'](_0xa558('0xa'))){_0x2bf3b5['maxRetry']=parseInt(_0x2bf3b5[_0xa558('0xa')],0xa);}_0x583641['addVertex'](_['omit'](_0x2bf3b5,'mxCell'));}function initGraph(_0x51e1ba,_0x54ca60){var _0x4a439a=new Graph();for(var _0x385307 in _0x51e1ba){if(_0x51e1ba[_0xa558('0xb')](_0x385307)){if(_['isArray'](_0x51e1ba[_0x385307])){for(var _0xa62052=0x0;_0xa62052<_0x51e1ba[_0x385307][_0xa558('0xc')];_0xa62052+=0x1){addVertex(_0x4a439a,_0x51e1ba[_0x385307][_0xa62052],_0x385307);}}else{addVertex(_0x4a439a,_0x51e1ba[_0x385307],_0x385307);}}}for(var _0x4967f7=0x0;_0x4967f7<_0x54ca60['length'];_0x4967f7+=0x1){if(_0x54ca60[_0x4967f7][_0xa558('0xd')]&&_0x54ca60[_0x4967f7][_0xa558('0xe')]){_0x4a439a[_0xa558('0xf')](_0x54ca60[_0x4967f7][_0xa558('0xd')],_0x54ca60[_0x4967f7][_0xa558('0xe')],_0x54ca60[_0x4967f7]['value']);}}return _0x4a439a;}function getRoot(_0x170eba){return parser[_0xa558('0x10')](_0x170eba,{'object':!![]})['mxGraphModel'][_0xa558('0x11')];}function inspect(_0x3e2924){return util[_0xa558('0x12')](_0x3e2924,{'showHidden':![],'depth':null});}function initialize(_0x5d88d4,_0x31aa5b){var _0x4d90ee=getRoot(_0x5d88d4[_0xa558('0x13')]);if(!_0x4d90ee||!_0x4d90ee[_0xa558('0x14')])return;var _0x4542ef,_0x19fde1,_0x107db4;logger['debug'](_0xa558('0x11'),JSON[_0xa558('0x15')](_0x4d90ee,null,0x2));_0x31aa5b[_0xa558('0x16')]=moment()[_0xa558('0x17')]('YYYY-MM-DD\x20HH:mm:ss');_0x4542ef=initGraph(_['omit'](_0x4d90ee,'mxCell'),_0x4d90ee['mxCell']);_0x19fde1=new Vertices(_0x31aa5b,rpc,mailRpc);logger[_0xa558('0x18')](util[_0xa558('0x17')](_0xa558('0x19'),_0x31aa5b[_0xa558('0x1a')],_0x31aa5b[_0xa558('0x1b')],_0x31aa5b[_0xa558('0x1c')],_0x31aa5b[_0xa558('0x1d')],_0x31aa5b[_0xa558('0x1e')]));_0x4542ef[_0xa558('0x1f')](_0x4d90ee[_0xa558('0x14')]['id'],function(_0x35ee00){try{_0x35ee00=_0x19fde1[_0xa558('0x20')](_0x35ee00);logger[_0xa558('0x21')]('vertex',JSON[_0xa558('0x15')](_0x35ee00,null,0x2));if(_0x35ee00[_0xa558('0x9')]===_0xa558('0x22')){logger['info'](_0xa558('0x23'));_0x31aa5b[_0xa558('0x24')]=_0x35ee00[_0xa558('0x24')]||_0x31aa5b[_0xa558('0x24')];_0x31aa5b[_0xa558('0x25')]=_0x35ee00[_0xa558('0x25')];_0x31aa5b['priority']=_0x35ee00[_0xa558('0x26')]?_0x35ee00[_0xa558('0x26')]-0x1:0x1;return null;}else if(_0x35ee00&&_0x19fde1[_0x35ee00['agicommand']]){_0x107db4=_0x19fde1[_0x35ee00[_0xa558('0x9')]](_0x35ee00);logger[_0xa558('0x18')]('response',JSON['stringify'](_0x107db4,null,0x2));if(_0x107db4&&_0x107db4[_0xa558('0x27')]===AGI_CODE_SUCCESS&&_0x107db4[_0xa558('0x28')]!==AGI_RESULT_ERROR&&!_0x31aa5b[_0xa558('0x29')]){logger[_0xa558('0x21')](_0xa558('0x2a'),inspect(_0x107db4));return _[_0xa558('0x2b')](_0x107db4[_0xa558('0x28')])?null:_0x107db4[_0xa558('0x28')][_0xa558('0x2c')]();}else{logger[_0xa558('0x7')](_0xa558('0x2a'),inspect(_0x107db4));return null;}}else{logger[_0xa558('0x7')]('agicommand\x20not\x20found');return null;}}catch(_0x216c3a){logger[_0xa558('0x7')](_0x216c3a['stack']);return null;}});if(_0x4d90ee['finally']){logger['info'](util[_0xa558('0x17')](_0xa558('0x2d'),_0x31aa5b[_0xa558('0x1a')],_0x31aa5b['calleridname'],_0x31aa5b[_0xa558('0x1c')],_0x31aa5b['dnid'],_0x31aa5b[_0xa558('0x1e')]));_0x4542ef[_0xa558('0x1f')](_0x4d90ee[_0xa558('0x2e')]['id'],function(_0xe78580){try{_0xe78580=_0x19fde1['clear'](_0xe78580);logger['debug']('vertex',JSON[_0xa558('0x15')](_0xe78580,null,0x2));if(_0xe78580&&_0x19fde1[_0xe78580[_0xa558('0x9')]]){_0x107db4=_0x19fde1[_0xe78580['agicommand']](_0xe78580);if(_0x107db4){logger[_0xa558('0x21')](_0xa558('0x2a'),inspect(_0x107db4));return _[_0xa558('0x2b')](_0x107db4[_0xa558('0x28')])?null:_0x107db4[_0xa558('0x28')]['toString']();}else{logger['error'](_0xa558('0x2a'),inspect(_0x107db4));return null;}}else{logger[_0xa558('0x7')](_0xa558('0x2f'));return null;}}catch(_0x53cdff){logger[_0xa558('0x7')](_0x53cdff['stack']);return null;}});}logger['info'](util[_0xa558('0x17')](_0xa558('0x30'),_0x31aa5b['arg_1'],_0x31aa5b[_0xa558('0x1b')],_0x31aa5b[_0xa558('0x1c')],_0x31aa5b[_0xa558('0x1d')],_0x31aa5b[_0xa558('0x1e')]));logger['info'](util[_0xa558('0x17')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x31aa5b[_0xa558('0x24')],_0x31aa5b['extension'],parseInt(_0x31aa5b[_0xa558('0x26')],0xa)+0x1));_0x31aa5b[_0xa558('0x31')](_0x31aa5b[_0xa558('0x24')],_0x31aa5b[_0xa558('0x25')],parseInt(_0x31aa5b['priority'],0xa)+0x1);_0x31aa5b[_0xa558('0x32')]();}function handleNotFound(_0x5b554d){logger['error'](util[_0xa558('0x17')]('Project\x20%s\x20not\x20found',_0x5b554d['arg_1']));_0x5b554d[_0xa558('0x31')](_0x5b554d[_0xa558('0x24')],_0x5b554d[_0xa558('0x25')],parseInt(_0x5b554d[_0xa558('0x26')],0xa)+0x1);_0x5b554d[_0xa558('0x32')]();}function handleUnpublished(_0x1870d5){logger[_0xa558('0x7')](util[_0xa558('0x17')]('Project\x20%s\x20not\x20published',_0x1870d5['arg_1']));_0x1870d5['continueAt'](_0x1870d5['context'],_0x1870d5[_0xa558('0x25')],parseInt(_0x1870d5[_0xa558('0x26')],0xa)+0x1);_0x1870d5['close']();}module[_0xa558('0x33')]={'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 b2b25fe..07b6ee4 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 _0x8782=['Transform','call','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','headers','emit','line','util','stream'];(function(_0x3708d8,_0x5b6e4d){var _0x388b62=function(_0x3f12bf){while(--_0x3f12bf){_0x3708d8['push'](_0x3708d8['shift']());}};_0x388b62(++_0x5b6e4d);}(_0x8782,0x17a));var _0x2878=function(_0x302fe4,_0x277a94){_0x302fe4=_0x302fe4-0x0;var _0x5667ec=_0x8782[_0x302fe4];return _0x5667ec;};'use strict';var util=require(_0x2878('0x0'));var Transform=require(_0x2878('0x1'))[_0x2878('0x2')];function AGIReply(_0x471f01){Transform[_0x2878('0x3')](this,_0x471f01);this[_0x2878('0x4')]='';this[_0x2878('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x2878('0x6')][_0x2878('0x7')]=function(_0x1c085f,_0x5a32cc,_0x28a5ea){var _0x5826f6='\x0a',_0x2fe6d8=['\x0a\x0a',_0x2878('0x8')],_0x428571=-0x1,_0x2ea986=-0x1,_0x4ed075='',_0x2deb60=0x0,_0x5d9e74='',_0x305bf4='';this[_0x2878('0x4')]+=_0x1c085f[_0x2878('0x9')]();_0x5d9e74=this[_0x2878('0x4')];if(!this[_0x2878('0x5')]){_0x2deb60=0x0;while(_0x2fe6d8[_0x2deb60]){while((_0x2ea986=_0x5d9e74[_0x2878('0xa')](_0x2fe6d8[_0x2deb60]))!=-0x1){_0x4ed075=_0x2fe6d8[_0x2deb60];_0x305bf4=_0x5d9e74[_0x2878('0xb')](0x0,_0x2ea986);_0x5d9e74=_0x5d9e74[_0x2878('0xb')](_0x2ea986+_0x4ed075[_0x2878('0xc')]);var _0x279196=_0x305bf4[_0x2878('0xd')](_0x5826f6),_0x5d7189=0x0,_0x3bdaaf={},_0x37a7d5='',_0x4f5833='',_0x1a225f=-0x1;while(_0x279196[_0x5d7189]){_0x1a225f=_0x279196[_0x5d7189]['indexOf'](':');if(_0x1a225f!=-0x1){_0x37a7d5=_0x279196[_0x5d7189][_0x2878('0xe')](0x0,_0x1a225f)[_0x2878('0xf')]();_0x4f5833=_0x279196[_0x5d7189][_0x2878('0xe')](_0x1a225f+0x1)['trim']();if(_0x37a7d5['length']>0x0){_0x3bdaaf[_0x37a7d5]=_0x4f5833;}}else{}_0x5d7189++;}this['emit'](_0x2878('0x10'),_0x3bdaaf);this[_0x2878('0x5')]=!![];}_0x2deb60++;}this[_0x2878('0x4')]=_0x5d9e74;}else{while((_0x428571=_0x5d9e74['indexOf'](_0x5826f6))!=-0x1){_0x305bf4=_0x5d9e74[_0x2878('0xb')](0x0,_0x428571);this[_0x2878('0x11')](_0x2878('0x12'),_0x305bf4);_0x5d9e74=_0x5d9e74[_0x2878('0xb')](_0x428571+_0x5826f6[_0x2878('0xc')]);}this['_localBuffer']=_0x5d9e74;}_0x28a5ea();};module['exports']=AGIReply; \ No newline at end of file +var _0x65a6=['_transform','toString','indexOf','substring','split','trim','length','emit','headers','_localBuffer','exports','util','stream','_inBody'];(function(_0x41c0e0,_0x69d04c){var _0x155556=function(_0x5834b4){while(--_0x5834b4){_0x41c0e0['push'](_0x41c0e0['shift']());}};_0x155556(++_0x69d04c);}(_0x65a6,0xa5));var _0x665a=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0x65a6[_0xe719ec];return _0x4842a1;};'use strict';var util=require(_0x665a('0x0'));var Transform=require(_0x665a('0x1'))['Transform'];function AGIReply(_0x2ab044){Transform['call'](this,_0x2ab044);this['_localBuffer']='';this[_0x665a('0x2')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x665a('0x3')]=function(_0x4ff178,_0x11bc3a,_0x5a0222){var _0x84e131='\x0a',_0x23813b=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x62656f=-0x1,_0x4a7631=-0x1,_0x4768d6='',_0x182c36=0x0,_0xed540d='',_0x582efe='';this['_localBuffer']+=_0x4ff178[_0x665a('0x4')]();_0xed540d=this['_localBuffer'];if(!this['_inBody']){_0x182c36=0x0;while(_0x23813b[_0x182c36]){while((_0x4a7631=_0xed540d[_0x665a('0x5')](_0x23813b[_0x182c36]))!=-0x1){_0x4768d6=_0x23813b[_0x182c36];_0x582efe=_0xed540d['substring'](0x0,_0x4a7631);_0xed540d=_0xed540d[_0x665a('0x6')](_0x4a7631+_0x4768d6['length']);var _0x5d4326=_0x582efe[_0x665a('0x7')](_0x84e131),_0x391e83=0x0,_0x5be700={},_0x1f5ab8='',_0x5db8d8='',_0x2b4fbc=-0x1;while(_0x5d4326[_0x391e83]){_0x2b4fbc=_0x5d4326[_0x391e83]['indexOf'](':');if(_0x2b4fbc!=-0x1){_0x1f5ab8=_0x5d4326[_0x391e83]['slice'](0x0,_0x2b4fbc)[_0x665a('0x8')]();_0x5db8d8=_0x5d4326[_0x391e83]['slice'](_0x2b4fbc+0x1)[_0x665a('0x8')]();if(_0x1f5ab8[_0x665a('0x9')]>0x0){_0x5be700[_0x1f5ab8]=_0x5db8d8;}}else{}_0x391e83++;}this[_0x665a('0xa')](_0x665a('0xb'),_0x5be700);this[_0x665a('0x2')]=!![];}_0x182c36++;}this[_0x665a('0xc')]=_0xed540d;}else{while((_0x62656f=_0xed540d['indexOf'](_0x84e131))!=-0x1){_0x582efe=_0xed540d['substring'](0x0,_0x62656f);this[_0x665a('0xa')]('line',_0x582efe);_0xed540d=_0xed540d['substring'](_0x62656f+_0x84e131[_0x665a('0x9')]);}this[_0x665a('0xc')]=_0xed540d;}_0x5a0222();};module[_0x665a('0xd')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 41e0890..15167d0 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 _0xe41f=['merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','ShowPause','agentLogin','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request','then','error','result','catch','getSquareProjects','GetSquareProjects','name','production','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','ShowSquareProject','getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport'];(function(_0x245d64,_0x4b05da){var _0x4dd20a=function(_0x3f8202){while(--_0x3f8202){_0x245d64['push'](_0x245d64['shift']());}};_0x4dd20a(++_0x4b05da);}(_0xe41f,0x13e));var _0xfe41=function(_0x1e01f7,_0x5ccc11){_0x1e01f7=_0x1e01f7-0x0;var _0xec3964=_0xe41f[_0x1e01f7];return _0xec3964;};'use strict';var _=require(_0xfe41('0x0'));var moment=require(_0xfe41('0x1'));var jayson=require(_0xfe41('0x2'));var client=jayson[_0xfe41('0x3')]['http']({'port':0x2329});function request(_0x592921,_0x4a2627){return new Promise(function(_0x196b31,_0x67a2d3){return client[_0xfe41('0x4')](_0x592921,_0x4a2627)[_0xfe41('0x5')](function(_0x53ae3b){if(_0x53ae3b['error']){return _0x67a2d3(_0x53ae3b[_0xfe41('0x6')]['message']);}else{return _0x196b31(_0x53ae3b[_0xfe41('0x7')]);}})[_0xfe41('0x8')](function(_0x4f92d3){return _0x67a2d3(_0x4f92d3);});});}exports[_0xfe41('0x9')]=function(){return request(_0xfe41('0xa'),{'options':{'raw':![],'attributes':['id',_0xfe41('0xb'),'production']}});};exports['getSquareProject']=function(_0x4a072c){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4a072c},'attributes':[_0xfe41('0xc')]}});};exports[_0xfe41('0xd')]=function(_0x4c858a){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4c858a},'include':[{'model':_0xfe41('0xe'),'as':_0xfe41('0xf'),'include':[{'model':_0xfe41('0x10'),'as':'CloudProvider'}]}],'attributes':['id',_0xfe41('0xb'),_0xfe41('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x313c9b){return request(_0xfe41('0x12'),{'options':{'where':{'id':_0x313c9b},'attributes':[_0xfe41('0xb')]}});};exports[_0xfe41('0x13')]=function(_0x3cffc1){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3cffc1},'attributes':[_0xfe41('0xb')]}});};exports[_0xfe41('0x14')]=function(_0x1de7f0){return request('ShowVariable',{'options':{'where':{'id':_0x1de7f0},'attributes':['name']}});};exports[_0xfe41('0x15')]=function(_0xca164f){return request(_0xfe41('0x16'),{'options':{'where':{'id':_0xca164f},'attributes':[_0xfe41('0x17')]}});};exports['getUserById']=function(_0x6611fd){return request(_0xfe41('0x18'),{'options':{'where':{'id':_0x6611fd},'attributes':[_0xfe41('0xb')]}});};exports[_0xfe41('0x19')]=function(_0x27de87){return request(_0xfe41('0x1a'),{'options':{'where':{'phone':_0x27de87[_0xfe41('0x1b')]},'attributes':['id']}});};exports[_0xfe41('0x1c')]=function(_0xdce570){return request(_0xfe41('0x1d'),{'options':{'where':{'id':_0xdce570},'attributes':[_0xfe41('0xb')]}});};exports[_0xfe41('0x1e')]=function(_0x3cf01e){return request('ShowSound',{'options':{'where':{'id':_0x3cf01e},'attributes':[_0xfe41('0x1f')]}});};exports[_0xfe41('0x20')]=function(_0x1c532c){return request(_0xfe41('0x21'),{'options':{'raw':![],'where':{'id':_0x1c532c},'include':[{'model':_0xfe41('0x22'),'as':_0xfe41('0x23')}]}});};exports[_0xfe41('0x24')]=function(_0x37599e){return request(_0xfe41('0x25'),{'options':{'where':{'id':_0x37599e},'attributes':['id',_0xfe41('0xb')]}});};exports[_0xfe41('0x26')]=function(_0x21f42a){return request('CreateSmsMessage',{'body':_0x21f42a});};exports[_0xfe41('0x27')]=function(_0x30f703){return request(_0xfe41('0x28'),{'body':_0x30f703});};exports[_0xfe41('0x29')]=function(_0x16709b){return request('CreateSquareReport',{'body':_[_0xfe41('0x2a')](_0x16709b,{'project_name':_0x16709b[_0xfe41('0x2b')],'prev_project_name':_0x16709b[_0xfe41('0x2c')]||'','is_subproject':_0x16709b[_0xfe41('0x2c')]?!![]:![],'leaveAt':moment()[_0xfe41('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xfe41('0x2e')]=function(_0x2a3dcc){return request(_0xfe41('0x2f'),{'body':_0x2a3dcc});};exports[_0xfe41('0x30')]=function(_0x44d7a3){return request(_0xfe41('0x31'),{'body':_0x44d7a3});};exports[_0xfe41('0x32')]=function(_0x49a86d){return request(_0xfe41('0x33'),{'options':{'raw':![],'where':{'phone':_0x49a86d[_0xfe41('0x1b')],'ListId':_0x49a86d['ListId']}}})[_0xfe41('0x5')](function(_0x52dc17){if(_0x52dc17){return _0x52dc17;}return request(_0xfe41('0x34'),{'body':_0x49a86d});});};exports['getPauseById']=function(_0x2ac84b){return request(_0xfe41('0x35'),{'options':{'where':{'id':_0x2ac84b},'attributes':[_0xfe41('0xb')]}});};exports[_0xfe41('0x36')]=function(_0x33bc2c,_0x83d5ab){return request('LoginUser',{'body':{'interface':_0x83d5ab},'options':{'where':_0x33bc2c}});};exports[_0xfe41('0x37')]=function(_0x40808d,_0x358737,_0x4abf6f){return request(_0xfe41('0x38'),{'body':{'type':_0x358737,'uniqueid':_0x4abf6f},'options':{'where':_0x40808d}});};exports['agentUnpause']=function(_0xd20bc6){return request(_0xfe41('0x39'),{'body':{},'options':{'where':_0xd20bc6}});};exports[_0xfe41('0x3a')]=function(_0xf139e7){return request(_0xfe41('0x3b'),{'body':{},'options':{'where':_0xf139e7}});}; \ No newline at end of file +var _0x55d2=['ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','jayson/promise','client','http','request','then','error','result','catch','getSquareProjects','GetSquareProjects','ShowSquareProject','getMailAccountById','ShowMailAccount','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById'];(function(_0x30798f,_0x3b68d6){var _0x2bce3c=function(_0x54fcb7){while(--_0x54fcb7){_0x30798f['push'](_0x30798f['shift']());}};_0x2bce3c(++_0x3b68d6);}(_0x55d2,0x9f));var _0x255d=function(_0x13b65c,_0x1aa36f){_0x13b65c=_0x13b65c-0x0;var _0xb7b670=_0x55d2[_0x13b65c];return _0xb7b670;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0x255d('0x0'));var client=jayson[_0x255d('0x1')][_0x255d('0x2')]({'port':0x2329});function request(_0x2bac55,_0x28c41e){return new Promise(function(_0x2c9d29,_0x57cbc1){return client[_0x255d('0x3')](_0x2bac55,_0x28c41e)[_0x255d('0x4')](function(_0xda2444){if(_0xda2444[_0x255d('0x5')]){return _0x57cbc1(_0xda2444['error']['message']);}else{return _0x2c9d29(_0xda2444[_0x255d('0x6')]);}})[_0x255d('0x7')](function(_0x253ac9){return _0x57cbc1(_0x253ac9);});});}exports[_0x255d('0x8')]=function(){return request(_0x255d('0x9'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports['getSquareProject']=function(_0x51c2dc){return request(_0x255d('0xa'),{'options':{'raw':![],'where':{'name':_0x51c2dc},'attributes':['production']}});};exports[_0x255d('0xb')]=function(_0x2c3754){return request(_0x255d('0xc'),{'options':{'raw':![],'where':{'id':_0x2c3754},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x255d('0xd'),'as':_0x255d('0xd')}]}],'attributes':['id',_0x255d('0xe'),_0x255d('0xf')],'smtp':!![]}});};exports[_0x255d('0x10')]=function(_0x30d8f0){return request(_0x255d('0xa'),{'options':{'where':{'id':_0x30d8f0},'attributes':[_0x255d('0xe')]}});};exports[_0x255d('0x11')]=function(_0x2b21fd){return request(_0x255d('0x12'),{'options':{'where':{'id':_0x2b21fd},'attributes':[_0x255d('0xe')]}});};exports[_0x255d('0x13')]=function(_0x500002){return request(_0x255d('0x14'),{'options':{'where':{'id':_0x500002},'attributes':[_0x255d('0xe')]}});};exports['getSquareOdbcById']=function(_0x477c48){return request(_0x255d('0x15'),{'options':{'where':{'id':_0x477c48},'attributes':[_0x255d('0x16')]}});};exports[_0x255d('0x17')]=function(_0x201313){return request(_0x255d('0x18'),{'options':{'where':{'id':_0x201313},'attributes':[_0x255d('0xe')]}});};exports[_0x255d('0x19')]=function(_0x464f6a){return request(_0x255d('0x1a'),{'options':{'where':{'phone':_0x464f6a['phone']},'attributes':['id']}});};exports[_0x255d('0x1b')]=function(_0x46b939){return request(_0x255d('0x1c'),{'options':{'where':{'id':_0x46b939},'attributes':[_0x255d('0xe')]}});};exports[_0x255d('0x1d')]=function(_0x24f105){return request(_0x255d('0x1e'),{'options':{'where':{'id':_0x24f105},'attributes':[_0x255d('0x1f')]}});};exports[_0x255d('0x20')]=function(_0x48a380){return request(_0x255d('0x21'),{'options':{'raw':![],'where':{'id':_0x48a380},'include':[{'model':_0x255d('0x22'),'as':_0x255d('0x23')}]}});};exports[_0x255d('0x24')]=function(_0xb9d98e){return request(_0x255d('0x25'),{'options':{'where':{'id':_0xb9d98e},'attributes':['id',_0x255d('0xe')]}});};exports[_0x255d('0x26')]=function(_0xd69061){return request(_0x255d('0x27'),{'body':_0xd69061});};exports[_0x255d('0x28')]=function(_0x37e01e){return request(_0x255d('0x29'),{'body':_0x37e01e});};exports[_0x255d('0x2a')]=function(_0x3d7126){return request(_0x255d('0x2b'),{'body':_[_0x255d('0x2c')](_0x3d7126,{'project_name':_0x3d7126[_0x255d('0x2d')],'prev_project_name':_0x3d7126[_0x255d('0x2e')]||'','is_subproject':_0x3d7126['arg_2']?!![]:![],'leaveAt':moment()[_0x255d('0x2f')](_0x255d('0x30'))})});};exports[_0x255d('0x31')]=function(_0x22c91b){return request(_0x255d('0x32'),{'body':_0x22c91b});};exports[_0x255d('0x33')]=function(_0x56f124){return request(_0x255d('0x34'),{'body':_0x56f124});};exports['createCmContact']=function(_0x3ed01d){return request(_0x255d('0x35'),{'options':{'raw':![],'where':{'phone':_0x3ed01d[_0x255d('0x36')],'ListId':_0x3ed01d['ListId']}}})[_0x255d('0x4')](function(_0x3f8849){if(_0x3f8849){return _0x3f8849;}return request(_0x255d('0x37'),{'body':_0x3ed01d});});};exports[_0x255d('0x38')]=function(_0x25eb35){return request(_0x255d('0x39'),{'options':{'where':{'id':_0x25eb35},'attributes':['name']}});};exports[_0x255d('0x3a')]=function(_0x529680,_0x5e7231){return request(_0x255d('0x3b'),{'body':{'interface':_0x5e7231},'options':{'where':_0x529680}});};exports[_0x255d('0x3c')]=function(_0x2a9402,_0x3bc0a0,_0x5d28bd){return request(_0x255d('0x3d'),{'body':{'type':_0x3bc0a0,'uniqueid':_0x5d28bd},'options':{'where':_0x2a9402}});};exports[_0x255d('0x3e')]=function(_0x50983){return request('UnpauseUser',{'body':{},'options':{'where':_0x50983}});};exports[_0x255d('0x3f')]=function(_0x57acc7){return request('LogoutUser',{'body':{},'options':{'where':_0x57acc7}});}; \ 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 e3d585a..b64651b 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 _0xab3f=['./polly','exports'];(function(_0x4310f5,_0x2a75a3){var _0x3a391b=function(_0x34e211){while(--_0x34e211){_0x4310f5['push'](_0x4310f5['shift']());}};_0x3a391b(++_0x2a75a3);}(_0xab3f,0x72));var _0xfab3=function(_0x2f3093,_0x1a18aa){_0x2f3093=_0x2f3093-0x0;var _0x44eeb8=_0xab3f[_0x2f3093];return _0x44eeb8;};var polly=require(_0xfab3('0x0'));var lex=require('./lex');module[_0xfab3('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4d68=['exports','./polly','./lex'];(function(_0x4fae85,_0x370e6a){var _0x121bab=function(_0x3e588a){while(--_0x3e588a){_0x4fae85['push'](_0x4fae85['shift']());}};_0x121bab(++_0x370e6a);}(_0x4d68,0x1c3));var _0x84d6=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0x4d68[_0x35d3a8];return _0x182378;};var polly=require(_0x84d6('0x0'));var lex=require(_0x84d6('0x1'));module[_0x84d6('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index c10715d..3c05471 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2547=['exports'];(function(_0x40e59a,_0x2608dd){var _0x571c0d=function(_0x563802){while(--_0x563802){_0x40e59a['push'](_0x40e59a['shift']());}};_0x571c0d(++_0x2608dd);}(_0x2547,0x1cd));var _0x7254=function(_0x1399e6,_0x575dfc){_0x1399e6=_0x1399e6-0x0;var _0x14081d=_0x2547[_0x1399e6];return _0x14081d;};'use strict';var lex=require('./lib/api');module[_0x7254('0x0')]=function(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435){return lex(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435);}; \ No newline at end of file +var _0x6c76=['./lib/api','exports'];(function(_0x42dd1d,_0xb0a2a6){var _0x5c67b7=function(_0x43e3e5){while(--_0x43e3e5){_0x42dd1d['push'](_0x42dd1d['shift']());}};_0x5c67b7(++_0xb0a2a6);}(_0x6c76,0x184));var _0x66c7=function(_0x5519da,_0x58bacc){_0x5519da=_0x5519da-0x0;var _0x584b8e=_0x6c76[_0x5519da];return _0x584b8e;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ 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 1c056f3..0094752 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(_0x120760,_0x151824){var _0xaa08f7=function(_0x49eeb8){while(--_0x49eeb8){_0x120760['push'](_0x120760['shift']());}};_0xaa08f7(++_0x151824);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x5eda34,_0x3836e2){var _0x27de7c=function(_0x52809b){while(--_0x52809b){_0x5eda34['push'](_0x5eda34['shift']());}};_0x27de7c(++_0x3836e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 7176d2e..38bb4b8 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 _0x50cd=['exports'];(function(_0x338708,_0x2518ff){var _0x459ec5=function(_0x106f3d){while(--_0x106f3d){_0x338708['push'](_0x338708['shift']());}};_0x459ec5(++_0x2518ff);}(_0x50cd,0x1df));var _0xd50c=function(_0x1d1fdf,_0x33ba5a){_0x1d1fdf=_0x1d1fdf-0x0;var _0x3521d6=_0x50cd[_0x1d1fdf];return _0x3521d6;};'use strict';var polly=require('./lib/api');module[_0xd50c('0x0')]=function(_0x48bb83,_0x41fa3c,_0x421e57,_0x251b2a,_0x258ee0,_0x292e25,_0x344573){return polly(_0x48bb83,_0x41fa3c,_0x421e57,_0x251b2a,_0x258ee0,_0x292e25,_0x344573);}; \ No newline at end of file +var _0x7782=['./lib/api','exports'];(function(_0xc33acc,_0xeeb744){var _0x16e08e=function(_0x2473f8){while(--_0x2473f8){_0xc33acc['push'](_0xc33acc['shift']());}};_0x16e08e(++_0xeeb744);}(_0x7782,0x1d0));var _0x2778=function(_0x272a31,_0x4e4a26){_0x272a31=_0x272a31-0x0;var _0x17cd00=_0x7782[_0x272a31];return _0x17cd00;};'use strict';var polly=require(_0x2778('0x0'));module[_0x2778('0x1')]=function(_0x3c1717,_0x22c66f,_0x50762e,_0x31bf01,_0x5ca6aa,_0x507872,_0x141700){return polly(_0x3c1717,_0x22c66f,_0x50762e,_0x31bf01,_0x5ca6aa,_0x507872,_0x141700);}; \ 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 a96d7e6..9e5bed5 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 _0x7832=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7832,0x6c));var _0x2783=function(_0x2eb4a4,_0x4b70cb){_0x2eb4a4=_0x2eb4a4-0x0;var _0x94cbe6=_0x7832[_0x2eb4a4];return _0x94cbe6;};'use strict';var fs=require('fs');var path=require(_0x2783('0x0'));var BPromise=require(_0x2783('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x1fe242,_0x33ac68,_0x16c169){return new BPromise(function(_0x10f54f,_0x17e15a){_0x1fe242[_0x2783('0x2')](_0x33ac68,function(_0x4d26cc,_0xdd70f6){if(_0x4d26cc){_0x17e15a(_0x4d26cc);}else if(_0xdd70f6){if(_0xdd70f6[_0x2783('0x3')]instanceof Buffer){fs[_0x2783('0x4')](_0x16c169,_0xdd70f6[_0x2783('0x3')],function(_0x256eb8){if(_0x256eb8){_0x17e15a(_0x256eb8);}else{_0x10f54f();}});}else{_0x17e15a(new Error(_0x2783('0x5')));}}else{_0x17e15a(new Error(_0x2783('0x6')));}});});}module[_0x2783('0x7')]=function(_0x356a85,_0x5adda0,_0x2a7c62,_0x4eb823,_0x5ed957,_0x246759,_0x597c28){var _0x48a4d9=new AWS[(_0x2783('0x8'))]({'accessKeyId':_0x356a85,'secretAccessKey':_0x5adda0,'region':_0x2a7c62});var _0x28a038={'Text':_0x5ed957,'TextType':_0x246759||_0x2783('0x9'),'OutputFormat':_0x2783('0xa'),'VoiceId':_0x4eb823};return pollyResult(_0x48a4d9,_0x28a038,_0x597c28);}; \ No newline at end of file +var _0x3027=['No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3027,0x101));var _0x7302=function(_0x1effd3,_0x52c997){_0x1effd3=_0x1effd3-0x0;var _0x47efad=_0x3027[_0x1effd3];return _0x47efad;};'use strict';var fs=require('fs');var path=require(_0x7302('0x0'));var BPromise=require(_0x7302('0x1'));var rs=require(_0x7302('0x2'));var AWS=require(_0x7302('0x3'));function pollyResult(_0x51e7e2,_0x11f097,_0x3d2c55){return new BPromise(function(_0x41178f,_0x481de9){_0x51e7e2['synthesizeSpeech'](_0x11f097,function(_0x18ec74,_0x402ec1){if(_0x18ec74){_0x481de9(_0x18ec74);}else if(_0x402ec1){if(_0x402ec1[_0x7302('0x4')]instanceof Buffer){fs[_0x7302('0x5')](_0x3d2c55,_0x402ec1[_0x7302('0x4')],function(_0x7e3dce){if(_0x7e3dce){_0x481de9(_0x7e3dce);}else{_0x41178f();}});}else{_0x481de9(new Error(_0x7302('0x6')));}}else{_0x481de9(new Error(_0x7302('0x7')));}});});}module['exports']=function(_0x161e9d,_0x3257c4,_0x44e0a0,_0x528170,_0x77d33c,_0x4c2cd9,_0x1d4afa){var _0x282bf6=new AWS[(_0x7302('0x8'))]({'accessKeyId':_0x161e9d,'secretAccessKey':_0x3257c4,'region':_0x44e0a0});var _0x117955={'Text':_0x77d33c,'TextType':_0x4c2cd9||_0x7302('0x9'),'OutputFormat':_0x7302('0xa'),'VoiceId':_0x528170};return pollyResult(_0x282bf6,_0x117955,_0x1d4afa);}; \ 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 d59f6c9..fbe47d8 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 _0x4074=['./lib/api','exports'];(function(_0x21b6f0,_0x3c948){var _0x1ec11a=function(_0x5d6656){while(--_0x5d6656){_0x21b6f0['push'](_0x21b6f0['shift']());}};_0x1ec11a(++_0x3c948);}(_0x4074,0x1f0));var _0x4407=function(_0x340b99,_0xc9c2c){_0x340b99=_0x340b99-0x0;var _0x1608ba=_0x4074[_0x340b99];return _0x1608ba;};'use strict';var asr=require(_0x4407('0x0'));module[_0x4407('0x1')]=function(_0x500ca3,_0x58f658,_0x2c3e21,_0x5845ad){return asr(_0x500ca3,_0x58f658,_0x2c3e21);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x399e50,_0x55cbfa,_0x2ae405,_0x3b64c0){return asr(_0x399e50,_0x55cbfa,_0x2ae405);}; \ 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 7851fc6..e932875 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 _0xa9e0=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string'];(function(_0x39fdfe,_0x277109){var _0x390094=function(_0x4bc75e){while(--_0x4bc75e){_0x39fdfe['push'](_0x39fdfe['shift']());}};_0x390094(++_0x277109);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var url=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var fs=require('fs');var host=_0x0a9e('0x2');module['exports']=function(_0x550fbc,_0x18d5c9,_0x4ce2f1){return new BPromise(function(_0x333808,_0x432180){var _0x2ab90b;if(typeof _0x550fbc!==_0x0a9e('0x3')||_0x550fbc[_0x0a9e('0x4')]===0x0){return _0x432180('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x18d5c9!==_0x0a9e('0x3')||_0x18d5c9[_0x0a9e('0x4')]===0x0){return _0x432180(_0x0a9e('0x5'));}if(typeof _0x4ce2f1!=='undefined'&&(typeof _0x4ce2f1!=='string'||_0x4ce2f1[_0x0a9e('0x4')]===0x0)){return _0x432180('lang\x20should\x20be\x20a\x20string');}try{_0x2ab90b=fs['readFileSync'](_0x550fbc)[_0x0a9e('0x6')](_0x0a9e('0x7'));}catch(_0x307b3e){return _0x432180(_0x307b3e);}return _0x333808({'method':_0x0a9e('0x8'),'uri':host+_0x0a9e('0x9')+_0x18d5c9,'body':{'config':{'encoding':_0x0a9e('0xa'),'sampleRateHertz':'8000','languageCode':_0x4ce2f1},'audio':{'content':_0x2ab90b}},'json':!![]});});}; \ No newline at end of file +var _0xe57e=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','string','length'];(function(_0xccc44a,_0x4e3c11){var _0x239fd6=function(_0x37feda){while(--_0x37feda){_0xccc44a['push'](_0xccc44a['shift']());}};_0x239fd6(++_0x4e3c11);}(_0xe57e,0xf2));var _0xee57=function(_0x5aa48f,_0x5a31b7){_0x5aa48f=_0x5aa48f-0x0;var _0x18d72c=_0xe57e[_0x5aa48f];return _0x18d72c;};'use strict';var url=require(_0xee57('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xee57('0x1');module[_0xee57('0x2')]=function(_0x336aaa,_0x59bb30,_0x5e53cc){return new BPromise(function(_0x2dbc91,_0x544e4a){var _0x2d975b;if(typeof _0x336aaa!==_0xee57('0x3')||_0x336aaa[_0xee57('0x4')]===0x0){return _0x544e4a('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x59bb30!=='string'||_0x59bb30[_0xee57('0x4')]===0x0){return _0x544e4a(_0xee57('0x5'));}if(typeof _0x5e53cc!==_0xee57('0x6')&&(typeof _0x5e53cc!==_0xee57('0x3')||_0x5e53cc[_0xee57('0x4')]===0x0)){return _0x544e4a(_0xee57('0x7'));}try{_0x2d975b=fs[_0xee57('0x8')](_0x336aaa)['toString']('base64');}catch(_0x195956){return _0x544e4a(_0x195956);}return _0x2dbc91({'method':_0xee57('0x9'),'uri':host+_0xee57('0xa')+_0x59bb30,'body':{'config':{'encoding':_0xee57('0xb'),'sampleRateHertz':_0xee57('0xc'),'languageCode':_0x5e53cc},'audio':{'content':_0x2d975b}},'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 66689d6..7c37d1c 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 _0x95ae=['./asr'];(function(_0x23bea4,_0x38a38){var _0xb54789=function(_0x2a5608){while(--_0x2a5608){_0x23bea4['push'](_0x23bea4['shift']());}};_0xb54789(++_0x38a38);}(_0x95ae,0xaa));var _0xe95a=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x95ae[_0x344a3f];return _0x264712;};var asr=require(_0xe95a('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x8b24=['exports','./asr'];(function(_0x90ead9,_0x4987e2){var _0x4cddce=function(_0x180784){while(--_0x180784){_0x90ead9['push'](_0x90ead9['shift']());}};_0x4cddce(++_0x4987e2);}(_0x8b24,0x109));var _0x48b2=function(_0x1b2b71,_0x338dd8){_0x1b2b71=_0x1b2b71-0x0;var _0x14aa21=_0x8b24[_0x1b2b71];return _0x14aa21;};var asr=require(_0x48b2('0x0'));module[_0x48b2('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 3bf65f6..e9e1688 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 _0x6922=['name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','CustomActionData','AudioFromTts','Data','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s'];(function(_0x5c0d76,_0x293106){var _0x250a9b=function(_0xe26981){while(--_0xe26981){_0x5c0d76['push'](_0x5c0d76['shift']());}};_0x250a9b(++_0x293106);}(_0x6922,0x148));var _0x2692=function(_0x1c9dd6,_0xe89ac7){_0x1c9dd6=_0x1c9dd6-0x0;var _0x3b62c4=_0x6922[_0x1c9dd6];return _0x3b62c4;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x2692('0x0'));var dialogflow=require(_0x2692('0x1'));var fs=require('fs');var http=require(_0x2692('0x2'));var https=require(_0x2692('0x3'));var md5=require('md5');var path=require(_0x2692('0x4'));var querystring=require(_0x2692('0x5'));var rp=require(_0x2692('0x6'));var rs=require(_0x2692('0x7'));var sox=require(_0x2692('0x8'));var tts=require(_0x2692('0x9'));var urlParse=require(_0x2692('0xa'))[_0x2692('0xb')];var util=require(_0x2692('0xc'));var aws=require(_0x2692('0xd'));var google=require(_0x2692('0xe'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x2692('0xf'))('agi');var ISPEECH_API=_0x2692('0x10');function downloadFile(_0xb3023b,_0x4b6ec2){return new BPromise(function(_0x284772,_0x5c1d1b){var _0x1336f4=urlParse(_0xb3023b);var _0x29e581=_0x1336f4[_0x2692('0x11')]===_0x2692('0x12')?https:http;var _0x521b7f={'host':_0x1336f4[_0x2692('0x13')],'path':_0x1336f4[_0x2692('0x4')],'headers':{'user-agent':_0x2692('0x14')}};_0x29e581['get'](_0x521b7f,function(_0x25df5){if(_0x25df5[_0x2692('0x15')]!==0xc8){logger[_0x2692('0x16')](_0x2692('0x17')+_0xb3023b+_0x2692('0x18')+_0x25df5[_0x2692('0x15')]+'\x20('+_0x25df5['statusMessage']+')');_0x5c1d1b(new Error('request\x20to\x20'+_0xb3023b+_0x2692('0x18')+_0x25df5['statusCode']+'\x20('+_0x25df5[_0x2692('0x19')]+')'));return;}var _0x113423=fs['createWriteStream'](_0x4b6ec2);_0x113423['on'](_0x2692('0x1a'),function(){logger[_0x2692('0x1b')](_0x2692('0x1c'));_0x113423[_0x2692('0x1d')](_0x284772);});_0x113423['on'](_0x2692('0x16'),function(_0x4dd5e5){fs[_0x2692('0x1e')](_0x4b6ec2);logger['error'](_0x2692('0x1f'),_0x4dd5e5);_0x5c1d1b(_0x4dd5e5);});_0x25df5[_0x2692('0x20')](_0x113423);})['on']('error',function(_0x542990){logger[_0x2692('0x16')](_0x542990);_0x5c1d1b(_0x542990);})[_0x2692('0x21')]();});}function uploadFile(_0x372b52){return new BPromise(function(_0x467c9a,_0x343ff7){var _0x3318e3=urlParse(_0x372b52);var _0x3919dd=_0x3318e3[_0x2692('0x11')]===_0x2692('0x12')?https:http;var _0xe94e33={'host':_0x3318e3['host'],'path':_0x3318e3[_0x2692('0x4')],'headers':{'user-agent':_0x2692('0x14')}};_0x3919dd[_0x2692('0x22')](_0xe94e33,function(_0x184d5c){if(_0x184d5c[_0x2692('0x15')]!==0xc8){_0x343ff7(new Error(_0x2692('0x17')+_0x372b52+_0x2692('0x18')+_0x184d5c['statusCode']+'\x20('+_0x184d5c[_0x2692('0x19')]+')'));return;}var _0x4a9e08='';_0x184d5c['on'](_0x2692('0x23'),function(_0x40dbcc){_0x4a9e08+=_0x40dbcc;});_0x184d5c['on'](_0x2692('0x21'),function(){_0x467c9a(_0x4a9e08);});})['on'](_0x2692('0x16'),function(_0x19c7b0){_0x343ff7(_0x19c7b0);})[_0x2692('0x21')]();});}function convertFile(_0xdc4ce8,_0x3a9507){return new BPromise(function(_0x5ed930,_0x5b7cef){var _0xe011c4=sox[_0x2692('0x24')](_0xdc4ce8,_0x3a9507,{'sampleRate':0x1f40,'format':_0x2692('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xe011c4['on'](_0x2692('0x16'),function(_0x4679e2){logger[_0x2692('0x16')](_0x2692('0x26'),_0x4679e2);_0x5b7cef(_0x4679e2);});_0xe011c4['on'](_0x2692('0x21'),function(){logger[_0x2692('0x1b')](_0x2692('0x27'));_0x5ed930();});_0xe011c4['start']();});}function base64Decode(_0xce0de6,_0x5b41fa){var _0x22369d=path[_0x2692('0x28')](__dirname,'tmp',rs[_0x2692('0x29')](0x4)+_0x2692('0x2a'));fs[_0x2692('0x2b')](_0x22369d,_0xce0de6,_0x2692('0x2c'));return convertFile(_0x22369d,_0x5b41fa)[_0x2692('0x2d')](function(){try{fs[_0x2692('0x1e')](_0x22369d);fs[_0x2692('0x2e')](_0x5b41fa,_0x2692('0x2f'));}catch(_0x3e33ee){logger[_0x2692('0x16')](_0x3e33ee);}return _0x5b41fa[_0x2692('0x30')]('.')[0x0];});}function base64Encode(_0x52583c){var _0x52d7e7=fs[_0x2692('0x31')](_0x52583c);return new Buffer(_0x52d7e7)[_0x2692('0x32')](_0x2692('0x2c'));}exports[_0x2692('0x33')]=function(_0x4a7f9a,_0x148575,_0x43fd1f,_0x33e16c,_0x35d6bb,_0xa28000){var _0x482f8c,_0x3dd2a0;var _0x16c1cc=_0x2692('0x34');var _0x1ce2f0=_0x2692('0x35')+_0x4a7f9a;var _0x142c62={};if(_0x148575===_0x2692('0x36')){_0x142c62[_0x2692('0x37')]={'ssml':_0x43fd1f};}else{_0x142c62[_0x2692('0x37')]={'text':_0x43fd1f};};_0x142c62[_0x2692('0x38')]={'languageCode':_0x33e16c,'ssmlGender':_0x35d6bb};_0x142c62[_0x2692('0x39')]={'audioEncoding':_0x2692('0x3a'),'sampleRateHertz':0x1f40};var _0x114606={'url':_0x16c1cc+_0x2692('0x3b')+_0x1ce2f0,'method':_0x2692('0x3c'),'json':!![],'body':_0x142c62};return rp(_0x114606)[_0x2692('0x2d')](function(_0x1b16af){return new BPromise(function(_0x5b1418,_0x2a5446){_0x482f8c=path[_0x2692('0x28')](__dirname,_0x2692('0x3d'),rs[_0x2692('0x29')](0x4)+_0x2692('0x3e'));var _0x54cca0=Buffer[_0x2692('0x3f')](_0x1b16af['audioContent'],_0x2692('0x2c'));return fs['writeFile'](_0x482f8c,_0x54cca0,function(_0x10567d){_0x2a5446(_0x10567d);},function(_0x4aded9){fs[_0x2692('0x2e')](_0x482f8c,'777');_0x5b1418(_0x4aded9);});});})[_0x2692('0x2d')](function(_0x5259df){_0x3dd2a0=path[_0x2692('0x28')](__dirname,_0x2692('0x3d'),rs[_0x2692('0x29')](0x4)+_0x2692('0x2a'));return convertFile(_0x482f8c,_0x3dd2a0);})[_0x2692('0x2d')](function(){try{fs['unlink'](_0x482f8c);fs[_0x2692('0x2e')](_0x3dd2a0,_0x2692('0x2f'));}catch(_0x1169b9){logger[_0x2692('0x16')](_0x1169b9);}logger['info'](_0x2692('0x40'),_0x3dd2a0['split']('.')[0x0]);return _0x3dd2a0[_0x2692('0x30')]('.')[0x0];});};exports['googleTTS']=function(_0x2054d5,_0x48bfd8){var _0x55a725=_0x2692('0x41');var _0x43b5f2,_0x2e562b;var _0x209a9f;var _0x10a85d={'encoding':_0x2692('0x42'),'method':'POST','timeout':0x2710,'url':_0x55a725,'headers':{'Content-Type':_0x2692('0x43')},'body':_0x2692('0x44')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x2692('0x45')]([_0x2054d5,_0x48bfd8||'en',![],_0x2692('0x46')]),null,_0x2692('0x47')]]]))};return rp(_0x10a85d)['then'](function(_0x3d33ad){try{_0x209a9f=eval(_0x3d33ad[_0x2692('0x48')](0x5))[0x0][0x2];}catch(_0x3dd72b){throw new Error('parse\x20response\x20failed:\x0a'+_0x3d33ad[_0x2692('0x23')]);}if(!_0x209a9f){if(_0x2054d5[_0x2692('0x49')]>0xc8){throw new Error(_0x2692('0x4a'));}else{throw new Error(_0x2692('0x4b')+_0x48bfd8+_0x2692('0x4c'));}}try{_0x209a9f=eval(_0x209a9f)[0x0];}catch(_0x3c6abc){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x2692('0x23')]);}const _0x299b1b=_0x209a9f;_0x43b5f2=path['resolve'](__dirname,_0x2692('0x3d'),rs[_0x2692('0x29')](0x4)+_0x2692('0x3e'));fs['writeFileSync'](_0x43b5f2,_0x209a9f,{'encoding':_0x2692('0x2c')});_0x2e562b=path[_0x2692('0x28')](__dirname,_0x2692('0x3d'),rs[_0x2692('0x29')](0x4)+'.wav');return convertFile(_0x43b5f2,_0x2e562b);})[_0x2692('0x2d')](function(){try{fs[_0x2692('0x1e')](_0x43b5f2);fs[_0x2692('0x2e')](_0x2e562b,'777');}catch(_0x25c812){logger[_0x2692('0x16')](_0x25c812);}logger['info']('goggleTTS\x20path',_0x2e562b['split']('.')[0x0]);return _0x2e562b[_0x2692('0x30')]('.')[0x0];});};exports[_0x2692('0x4d')]=function(_0x5e59d9,_0x3864b5,_0xf07bff){return google[_0x2692('0x4e')](_0x5e59d9,_0x3864b5,_0xf07bff)[_0x2692('0x2d')](function(_0x853e0b){logger[_0x2692('0x1b')](_0x853e0b['uri']);return rp(_0x853e0b);})['then'](function(_0x93880e){var _0x345618='';var _0x6a87fb=0x0;try{fs[_0x2692('0x1e')](_0x5e59d9);}catch(_0x40f8f9){logger['error'](_0x40f8f9);}if(_0x93880e&&_0x93880e[_0x2692('0x4f')]){_0x345618=_0x93880e['results'][_0x2692('0x50')](function(_0x1e56e6){return _0x1e56e6&&_0x1e56e6['alternatives'][0x0]&&_0x1e56e6[_0x2692('0x51')][0x0][_0x2692('0x52')]?_0x1e56e6[_0x2692('0x51')][0x0][_0x2692('0x52')]:'';})['join']('\x0a');_0x6a87fb=_0x93880e[_0x2692('0x4f')]['map'](function(_0x1cc36c){return _0x1cc36c&&_0x1cc36c[_0x2692('0x51')][0x0]&&_0x1cc36c[_0x2692('0x51')][0x0][_0x2692('0x53')]?_0x1cc36c[_0x2692('0x51')][0x0][_0x2692('0x53')]:0x0;})[_0x2692('0x54')]('\x0a');}logger[_0x2692('0x1b')](_0x2692('0x55'),_0x345618);logger[_0x2692('0x1b')](_0x2692('0x56'),_0x6a87fb);return{'transcript':_0x345618,'confidence':_0x6a87fb};})[_0x2692('0x57')](function(_0x4e802c){logger[_0x2692('0x16')](_0x2692('0x58'),_0x4e802c[_0x2692('0x15')],_0x4e802c[_0x2692('0x59')],_0x4e802c[_0x2692('0x5a')]);});};exports[_0x2692('0x5b')]=function(_0x1ef476,_0x15864c,_0x224cbe,_0x44cf6f){var _0x3f7f9e=apiai(_0x15864c,{'language':_0x44cf6f||'en'});return _0x3f7f9e[_0x2692('0x5c')](_0x224cbe,{'sessionId':md5(_0x1ef476)})['then'](function(_0x5af33f){logger[_0x2692('0x1b')](JSON[_0x2692('0x45')](_0x5af33f));return{'source':_0x5af33f[_0x2692('0x5d')][_0x2692('0x5e')],'resolvedQuery':_0x5af33f[_0x2692('0x5d')][_0x2692('0x5f')],'action':_0x5af33f[_0x2692('0x5d')][_0x2692('0x60')],'actionIncomplete':_0x5af33f['result']['actionIncomplete'],'speech':_0x5af33f[_0x2692('0x5d')][_0x2692('0x61')]['speech'],'score':_0x5af33f['result'][_0x2692('0x62')],'statusCode':_0x5af33f[_0x2692('0x63')][_0x2692('0x64')],'endConversation':_0x5af33f[_0x2692('0x5d')][_0x2692('0x65')][_0x2692('0x66')]||![],'isFallbackIntent':_0x5af33f[_0x2692('0x5d')][_0x2692('0x65')][_0x2692('0x67')]};});};exports[_0x2692('0x68')]=function(_0x3db15b,_0x80997e,_0x548018,_0xf83b9d,_0x126b02,_0x5d6d87){var _0x277b06=_0xf83b9d['replace'](/\\n/g,'\x0a');var _0x38dc16={'credentials':{'private_key':_0x277b06,'client_email':_0x548018}};var _0x546f43=new dialogflow[(_0x2692('0x69'))](_0x38dc16);var _0x5d03f6=_0x546f43['sessionPath'](_0x80997e,md5(_0x3db15b));var _0x42de98={'session':_0x5d03f6,'queryInput':{'text':{'text':_0x126b02,'languageCode':_0x5d6d87}}};return _0x546f43[_0x2692('0x6a')](_0x42de98)[_0x2692('0x2d')](function(_0x31359f){if(_0x31359f&&_0x31359f['length']){logger[_0x2692('0x1b')](_0x2692('0x6b'),JSON[_0x2692('0x45')](_0x31359f));var _0x59f603=_0x31359f[0x0];if(_0x59f603){var _0x56bd5a={'action':_0x59f603[_0x2692('0x6c')][_0x2692('0x60')],'allRequiredParamsPresent':_0x59f603['queryResult'][_0x2692('0x6d')],'endConversation':_0x59f603[_0x2692('0x6c')]['diagnosticInfo']&&_0x59f603[_0x2692('0x6c')]['diagnosticInfo']['fields']?_0x59f603[_0x2692('0x6c')][_0x2692('0x6e')][_0x2692('0x6f')]['end_conversation'][_0x2692('0x70')]:![],'fulfillmentText':_0x59f603[_0x2692('0x6c')][_0x2692('0x71')],'intentName':_0x59f603['queryResult'][_0x2692('0x72')][_0x2692('0x59')],'intentDisplayName':_0x59f603[_0x2692('0x6c')][_0x2692('0x72')][_0x2692('0x73')],'isFallbackIntent':_0x59f603[_0x2692('0x6c')]['intent'][_0x2692('0x74')],'languageCode':_0x59f603['queryResult'][_0x2692('0x75')],'queryText':_0x59f603[_0x2692('0x6c')]['queryText'],'responseId':_0x59f603[_0x2692('0x76')],'score':_0x59f603[_0x2692('0x6c')][_0x2692('0x77')],'speech':_0x59f603['queryResult'][_0x2692('0x71')],'providerResponse':JSON[_0x2692('0x45')](_0x31359f)};return _0x56bd5a;}}});};exports[_0x2692('0x78')]=function(_0x8d206b,_0x26e864,_0xad176f,_0xe4f684){return tilde[_0x2692('0x4e')](_0x8d206b,_0x26e864,_0xad176f,_0xe4f684)[_0x2692('0x2d')](function(_0x4ed9de){try{fs['unlink'](_0x8d206b);}catch(_0x48fb08){logger[_0x2692('0x16')](_0x48fb08);}logger['info'](_0x2692('0x79'),_0x4ed9de[_0x2692('0x52')]);logger[_0x2692('0x1b')](_0x2692('0x7a'),_0x4ed9de[_0x2692('0x53')]);return _0x4ed9de;});};exports[_0x2692('0x7b')]=function(_0x585263,_0x1b0f51,_0x197229,_0x3923e0,_0x26eecf,_0x4650d1){var _0x466ac3=path['resolve'](__dirname,_0x2692('0x3d'),rs[_0x2692('0x29')](0x4)+_0x2692('0x3e'));var _0x4f3692;return aws[_0x2692('0x7c')](_0x585263,_0x1b0f51,_0x197229,_0x3923e0,_0x26eecf,_0x4650d1,_0x466ac3)[_0x2692('0x2d')](function(){_0x4f3692=path[_0x2692('0x28')](__dirname,'tmp',rs[_0x2692('0x29')](0x4)+_0x2692('0x2a'));return convertFile(_0x466ac3,_0x4f3692);})['then'](function(){try{fs[_0x2692('0x1e')](_0x466ac3);fs[_0x2692('0x2e')](_0x4f3692,_0x2692('0x2f'));}catch(_0x1f43a1){logger[_0x2692('0x16')](_0x1f43a1);}return _0x4f3692['split']('.')[0x0];});};exports[_0x2692('0x7d')]=function(_0x39097f,_0xe1e3b4,_0x1b8432,_0x516246,_0x483258,_0x119d01){return aws[_0x2692('0x7e')](_0x39097f,_0xe1e3b4,_0x1b8432,_0x516246,_0x483258,_0x119d01)['then'](function(_0x548dfe){logger[_0x2692('0x1b')](JSON[_0x2692('0x45')](_0x548dfe));return _0x548dfe;});};exports[_0x2692('0x7f')]=function(_0x3c09c3,_0x5d1a03,_0x15ece7,_0x211ccb){var _0x5f49a3=util[_0x2692('0x80')](_0x2692('0x81'),ISPEECH_API,_0x3c09c3,encodeURIComponent(_0x5d1a03),_0x15ece7,_0x211ccb);var _0x17a305=path[_0x2692('0x28')](__dirname,'tmp',rs[_0x2692('0x29')](0x4)+_0x2692('0x3e'));var _0x220c99;return downloadFile(_0x5f49a3,_0x17a305)[_0x2692('0x2d')](function(){_0x220c99=path[_0x2692('0x28')](__dirname,'tmp',rs[_0x2692('0x29')](0x4)+_0x2692('0x2a'));return convertFile(_0x17a305,_0x220c99);})['then'](function(){try{fs[_0x2692('0x1e')](_0x17a305);fs[_0x2692('0x2e')](_0x220c99,_0x2692('0x2f'));}catch(_0x34cc68){logger[_0x2692('0x16')](_0x34cc68);}return _0x220c99[_0x2692('0x30')]('.')[0x0];});};exports['ispeechASR']=function(_0x835d79,_0x34ea46,_0x5eb2ab,_0x35e380){var _0x131d16=util[_0x2692('0x80')](_0x2692('0x82'),ISPEECH_API,_0x34ea46,_0x5eb2ab,base64Encode(_0x835d79),_0x35e380?util[_0x2692('0x80')](_0x2692('0x83'),encodeURIComponent(_0x35e380)):_0x2692('0x84'));return uploadFile(_0x131d16)[_0x2692('0x2d')](function(_0x49d5c3){return querystring[_0x2692('0xb')](_0x49d5c3);});};exports['sestekNDA']=function(_0x35a635,_0x29236d){return sestek[_0x2692('0x85')](_0x35a635,_0x29236d)['then'](function(_0x373bda){logger[_0x2692('0x1b')](JSON[_0x2692('0x45')](_0x373bda));var _0x1e5a58={'speech':_0x373bda[_0x2692('0x86')],'action':_0x373bda[_0x2692('0x87')]?_0x373bda[_0x2692('0x87')]['CustomAction']:undefined,'actiondata':_0x373bda[_0x2692('0x87')]?_0x373bda['channelData'][_0x2692('0x88')]:undefined};if(_0x373bda[_0x2692('0x87')]&&_0x373bda[_0x2692('0x87')]['AudioFromTts']){return base64Decode(_0x373bda[_0x2692('0x87')][_0x2692('0x89')][_0x2692('0x8a')],path[_0x2692('0x28')](__dirname,_0x2692('0x3d'),rs[_0x2692('0x29')](0x4)+_0x2692('0x2a')))['then'](function(_0x10a621){_0x1e5a58['audiofile']=_0x10a621;return _0x1e5a58;});}return _0x1e5a58;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xe47c=['freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','https','path','querystring','sox','google-tts-api','util','./google','./sestek','./tilde','agi','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','error','unlink','download\x20error','pipe','end','data','wav','error\x20convert','generate','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','text:synthesize','POST','resolve','tmp','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','.wav','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe47c,0x91));var _0xce47=function(_0x860f79,_0x121fbb){_0x860f79=_0x860f79-0x0;var _0xe7c610=_0xe47c[_0x860f79];return _0xe7c610;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xce47('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0xce47('0x1'));var md5=require('md5');var path=require(_0xce47('0x2'));var querystring=require(_0xce47('0x3'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0xce47('0x4'));var tts=require(_0xce47('0x5'));var urlParse=require('url')['parse'];var util=require(_0xce47('0x6'));var aws=require('./aws');var google=require(_0xce47('0x7'));var sestek=require(_0xce47('0x8'));var tilde=require(_0xce47('0x9'));var logger=require('../../../config/logger')(_0xce47('0xa'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x10fcf8,_0x2f6d50){return new BPromise(function(_0x2af275,_0x52162a){var _0x1c77b8=urlParse(_0x10fcf8);var _0x459931=_0x1c77b8[_0xce47('0xb')]===_0xce47('0xc')?https:http;var _0x21cc35={'host':_0x1c77b8[_0xce47('0xd')],'path':_0x1c77b8[_0xce47('0x2')],'headers':{'user-agent':_0xce47('0xe')}};_0x459931[_0xce47('0xf')](_0x21cc35,function(_0x2ad2b8){if(_0x2ad2b8[_0xce47('0x10')]!==0xc8){logger['error'](_0xce47('0x11')+_0x10fcf8+_0xce47('0x12')+_0x2ad2b8[_0xce47('0x10')]+'\x20('+_0x2ad2b8[_0xce47('0x13')]+')');_0x52162a(new Error('request\x20to\x20'+_0x10fcf8+_0xce47('0x12')+_0x2ad2b8['statusCode']+'\x20('+_0x2ad2b8[_0xce47('0x13')]+')'));return;}var _0x3dbabd=fs[_0xce47('0x14')](_0x2f6d50);_0x3dbabd['on'](_0xce47('0x15'),function(){logger[_0xce47('0x16')]('finish\x20download\x20file');_0x3dbabd['close'](_0x2af275);});_0x3dbabd['on'](_0xce47('0x17'),function(_0x264ac4){fs[_0xce47('0x18')](_0x2f6d50);logger['error'](_0xce47('0x19'),_0x264ac4);_0x52162a(_0x264ac4);});_0x2ad2b8[_0xce47('0x1a')](_0x3dbabd);})['on'](_0xce47('0x17'),function(_0x187973){logger['error'](_0x187973);_0x52162a(_0x187973);})[_0xce47('0x1b')]();});}function uploadFile(_0x31fc4a){return new BPromise(function(_0x423c97,_0x183afb){var _0x5d9fb4=urlParse(_0x31fc4a);var _0x171dd3=_0x5d9fb4[_0xce47('0xb')]===_0xce47('0xc')?https:http;var _0x4f6ed2={'host':_0x5d9fb4['host'],'path':_0x5d9fb4['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x171dd3['get'](_0x4f6ed2,function(_0x643939){if(_0x643939[_0xce47('0x10')]!==0xc8){_0x183afb(new Error(_0xce47('0x11')+_0x31fc4a+_0xce47('0x12')+_0x643939[_0xce47('0x10')]+'\x20('+_0x643939[_0xce47('0x13')]+')'));return;}var _0x267754='';_0x643939['on'](_0xce47('0x1c'),function(_0x50a722){_0x267754+=_0x50a722;});_0x643939['on'](_0xce47('0x1b'),function(){_0x423c97(_0x267754);});})['on'](_0xce47('0x17'),function(_0x5c03ef){_0x183afb(_0x5c03ef);})[_0xce47('0x1b')]();});}function convertFile(_0xd3223f,_0x38f04a){return new BPromise(function(_0x124bf4,_0x1323dc){var _0x238824=sox['transcode'](_0xd3223f,_0x38f04a,{'sampleRate':0x1f40,'format':_0xce47('0x1d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x238824['on'](_0xce47('0x17'),function(_0x2ed687){logger['error'](_0xce47('0x1e'),_0x2ed687);_0x1323dc(_0x2ed687);});_0x238824['on'](_0xce47('0x1b'),function(){logger[_0xce47('0x16')]('finish\x20to\x20convert');_0x124bf4();});_0x238824['start']();});}function base64Decode(_0x2472d7,_0x34c3e0){var _0x51a175=path['resolve'](__dirname,'tmp',rs[_0xce47('0x1f')](0x4)+'.wav');fs[_0xce47('0x20')](_0x51a175,_0x2472d7,_0xce47('0x21'));return convertFile(_0x51a175,_0x34c3e0)[_0xce47('0x22')](function(){try{fs[_0xce47('0x18')](_0x51a175);fs[_0xce47('0x23')](_0x34c3e0,'777');}catch(_0x40e055){logger[_0xce47('0x17')](_0x40e055);}return _0x34c3e0[_0xce47('0x24')]('.')[0x0];});}function base64Encode(_0x4ea0da){var _0x18f260=fs[_0xce47('0x25')](_0x4ea0da);return new Buffer(_0x18f260)[_0xce47('0x26')](_0xce47('0x21'));}exports['googleCloudTTS']=function(_0x4559e7,_0x148315,_0x23916d,_0x43954f,_0x222315,_0x3bc2a9){var _0x38ab0a,_0x5f5aba;var _0x88d70e=_0xce47('0x27');var _0x5b35a6=_0xce47('0x28')+_0x4559e7;var _0x4c2c0b={};if(_0x148315===_0xce47('0x29')){_0x4c2c0b[_0xce47('0x2a')]={'ssml':_0x23916d};}else{_0x4c2c0b[_0xce47('0x2a')]={'text':_0x23916d};};_0x4c2c0b['voice']={'languageCode':_0x43954f,'ssmlGender':_0x222315};_0x4c2c0b['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x4cc8d0={'url':_0x88d70e+_0xce47('0x2b')+_0x5b35a6,'method':_0xce47('0x2c'),'json':!![],'body':_0x4c2c0b};return rp(_0x4cc8d0)[_0xce47('0x22')](function(_0x4dbde3){return new BPromise(function(_0x38fcc9,_0x20d95d){_0x38ab0a=path[_0xce47('0x2d')](__dirname,_0xce47('0x2e'),rs[_0xce47('0x1f')](0x4)+_0xce47('0x2f'));var _0x980891=Buffer[_0xce47('0x30')](_0x4dbde3[_0xce47('0x31')],'base64');return fs[_0xce47('0x32')](_0x38ab0a,_0x980891,function(_0x4f9f9a){_0x20d95d(_0x4f9f9a);},function(_0x110367){fs['chmodSync'](_0x38ab0a,'777');_0x38fcc9(_0x110367);});});})[_0xce47('0x22')](function(_0x18ed52){_0x5f5aba=path['resolve'](__dirname,_0xce47('0x2e'),rs['generate'](0x4)+'.wav');return convertFile(_0x38ab0a,_0x5f5aba);})[_0xce47('0x22')](function(){try{fs['unlink'](_0x38ab0a);fs[_0xce47('0x23')](_0x5f5aba,_0xce47('0x33'));}catch(_0x1f6930){logger[_0xce47('0x17')](_0x1f6930);}logger[_0xce47('0x16')](_0xce47('0x34'),_0x5f5aba[_0xce47('0x24')]('.')[0x0]);return _0x5f5aba[_0xce47('0x24')]('.')[0x0];});};exports[_0xce47('0x35')]=function(_0x3e9095,_0x207ea9){var _0x4f24ff='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x1e2186,_0x4e43e5;var _0x570cb3;var _0x450d8b={'encoding':_0xce47('0x36'),'method':_0xce47('0x2c'),'timeout':0x2710,'url':_0x4f24ff,'headers':{'Content-Type':_0xce47('0x37')},'body':_0xce47('0x38')+encodeURIComponent(JSON[_0xce47('0x39')]([[['jQ1olc',JSON[_0xce47('0x39')]([_0x3e9095,_0x207ea9||'en',![],_0xce47('0x3a')]),null,_0xce47('0x3b')]]]))};return rp(_0x450d8b)['then'](function(_0x4b91dd){try{_0x570cb3=eval(_0x4b91dd['slice'](0x5))[0x0][0x2];}catch(_0x5d3e86){throw new Error(_0xce47('0x3c')+_0x4b91dd['data']);}if(!_0x570cb3){if(_0x3e9095['length']>0xc8){throw new Error(_0xce47('0x3d'));}else{throw new Error(_0xce47('0x3e')+_0x207ea9+'\x22\x20might\x20not\x20exist');}}try{_0x570cb3=eval(_0x570cb3)[0x0];}catch(_0x1d599e){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xce47('0x1c')]);}const _0x2a5ff0=_0x570cb3;_0x1e2186=path[_0xce47('0x2d')](__dirname,_0xce47('0x2e'),rs[_0xce47('0x1f')](0x4)+_0xce47('0x2f'));fs[_0xce47('0x20')](_0x1e2186,_0x570cb3,{'encoding':_0xce47('0x21')});_0x4e43e5=path['resolve'](__dirname,'tmp',rs[_0xce47('0x1f')](0x4)+_0xce47('0x3f'));return convertFile(_0x1e2186,_0x4e43e5);})[_0xce47('0x22')](function(){try{fs[_0xce47('0x18')](_0x1e2186);fs[_0xce47('0x23')](_0x4e43e5,'777');}catch(_0x2d7ac9){logger[_0xce47('0x17')](_0x2d7ac9);}logger[_0xce47('0x16')](_0xce47('0x40'),_0x4e43e5[_0xce47('0x24')]('.')[0x0]);return _0x4e43e5['split']('.')[0x0];});};exports[_0xce47('0x41')]=function(_0x3e8283,_0x4d17ec,_0x2a203a){return google[_0xce47('0x42')](_0x3e8283,_0x4d17ec,_0x2a203a)[_0xce47('0x22')](function(_0x4d99a1){logger[_0xce47('0x16')](_0x4d99a1['uri']);return rp(_0x4d99a1);})[_0xce47('0x22')](function(_0x4864be){var _0x51e86e='';var _0x282e86=0x0;try{fs[_0xce47('0x18')](_0x3e8283);}catch(_0x3ef3e1){logger[_0xce47('0x17')](_0x3ef3e1);}if(_0x4864be&&_0x4864be['results']){_0x51e86e=_0x4864be[_0xce47('0x43')][_0xce47('0x44')](function(_0x22944d){return _0x22944d&&_0x22944d[_0xce47('0x45')][0x0]&&_0x22944d[_0xce47('0x45')][0x0]['transcript']?_0x22944d[_0xce47('0x45')][0x0][_0xce47('0x46')]:'';})[_0xce47('0x47')]('\x0a');_0x282e86=_0x4864be[_0xce47('0x43')]['map'](function(_0x307c0f){return _0x307c0f&&_0x307c0f[_0xce47('0x45')][0x0]&&_0x307c0f[_0xce47('0x45')][0x0][_0xce47('0x48')]?_0x307c0f['alternatives'][0x0][_0xce47('0x48')]:0x0;})[_0xce47('0x47')]('\x0a');}logger[_0xce47('0x16')](_0xce47('0x49'),_0x51e86e);logger['info'](_0xce47('0x4a'),_0x282e86);return{'transcript':_0x51e86e,'confidence':_0x282e86};})[_0xce47('0x4b')](function(_0x3887fe){logger[_0xce47('0x17')](_0xce47('0x4c'),_0x3887fe[_0xce47('0x10')],_0x3887fe[_0xce47('0x4d')],_0x3887fe['message']);});};exports['googleDialogflow']=function(_0x4f578a,_0x19575f,_0x56622d,_0x3a6fce){var _0x3d9f00=apiai(_0x19575f,{'language':_0x3a6fce||'en'});return _0x3d9f00[_0xce47('0x4e')](_0x56622d,{'sessionId':md5(_0x4f578a)})['then'](function(_0x4d7d61){logger[_0xce47('0x16')](JSON[_0xce47('0x39')](_0x4d7d61));return{'source':_0x4d7d61[_0xce47('0x4f')]['source'],'resolvedQuery':_0x4d7d61[_0xce47('0x4f')][_0xce47('0x50')],'action':_0x4d7d61[_0xce47('0x4f')][_0xce47('0x51')],'actionIncomplete':_0x4d7d61[_0xce47('0x4f')][_0xce47('0x52')],'speech':_0x4d7d61[_0xce47('0x4f')][_0xce47('0x53')][_0xce47('0x54')],'score':_0x4d7d61[_0xce47('0x4f')]['score'],'statusCode':_0x4d7d61[_0xce47('0x55')]['code'],'endConversation':_0x4d7d61[_0xce47('0x4f')][_0xce47('0x56')][_0xce47('0x57')]||![],'isFallbackIntent':_0x4d7d61[_0xce47('0x4f')][_0xce47('0x56')][_0xce47('0x58')]};});};exports[_0xce47('0x59')]=function(_0x1e5d6a,_0x4660be,_0x5db782,_0x37f697,_0x1b167d,_0x46d33f){var _0x34f2f9=_0x37f697[_0xce47('0x5a')](/\\n/g,'\x0a');var _0x2ce1e9={'credentials':{'private_key':_0x34f2f9,'client_email':_0x5db782}};var _0x435af9=new dialogflow[(_0xce47('0x5b'))](_0x2ce1e9);var _0x4b5c7d=_0x435af9[_0xce47('0x5c')](_0x4660be,md5(_0x1e5d6a));var _0x3933fb={'session':_0x4b5c7d,'queryInput':{'text':{'text':_0x1b167d,'languageCode':_0x46d33f}}};return _0x435af9[_0xce47('0x5d')](_0x3933fb)[_0xce47('0x22')](function(_0x44f483){if(_0x44f483&&_0x44f483[_0xce47('0x5e')]){logger['info'](_0xce47('0x5f'),JSON[_0xce47('0x39')](_0x44f483));var _0xb32d33=_0x44f483[0x0];if(_0xb32d33){var _0x2d18d9={'action':_0xb32d33[_0xce47('0x60')][_0xce47('0x51')],'allRequiredParamsPresent':_0xb32d33[_0xce47('0x60')][_0xce47('0x61')],'endConversation':_0xb32d33[_0xce47('0x60')]['diagnosticInfo']&&_0xb32d33[_0xce47('0x60')][_0xce47('0x62')][_0xce47('0x63')]?_0xb32d33['queryResult'][_0xce47('0x62')][_0xce47('0x63')][_0xce47('0x64')][_0xce47('0x65')]:![],'fulfillmentText':_0xb32d33[_0xce47('0x60')]['fulfillmentText'],'intentName':_0xb32d33[_0xce47('0x60')][_0xce47('0x66')][_0xce47('0x4d')],'intentDisplayName':_0xb32d33['queryResult'][_0xce47('0x66')][_0xce47('0x67')],'isFallbackIntent':_0xb32d33[_0xce47('0x60')][_0xce47('0x66')][_0xce47('0x68')],'languageCode':_0xb32d33[_0xce47('0x60')][_0xce47('0x69')],'queryText':_0xb32d33[_0xce47('0x60')][_0xce47('0x6a')],'responseId':_0xb32d33[_0xce47('0x6b')],'score':_0xb32d33['queryResult']['intentDetectionConfidence'],'speech':_0xb32d33[_0xce47('0x60')][_0xce47('0x6c')],'providerResponse':JSON[_0xce47('0x39')](_0x44f483)};return _0x2d18d9;}}});};exports[_0xce47('0x6d')]=function(_0x3a0060,_0x2348b0,_0x42a79f,_0x18d209){return tilde[_0xce47('0x42')](_0x3a0060,_0x2348b0,_0x42a79f,_0x18d209)[_0xce47('0x22')](function(_0x20d3dd){try{fs[_0xce47('0x18')](_0x3a0060);}catch(_0x2b8782){logger[_0xce47('0x17')](_0x2b8782);}logger['info'](_0xce47('0x6e'),_0x20d3dd[_0xce47('0x46')]);logger[_0xce47('0x16')]('Tilde\x20ASR\x20confidence',_0x20d3dd[_0xce47('0x48')]);return _0x20d3dd;});};exports[_0xce47('0x6f')]=function(_0x1f83f1,_0x3f4ccc,_0x5c9332,_0x299f74,_0x49812f,_0x5e9462){var _0x5971d9=path[_0xce47('0x2d')](__dirname,_0xce47('0x2e'),rs[_0xce47('0x1f')](0x4)+_0xce47('0x2f'));var _0x4316a6;return aws[_0xce47('0x70')](_0x1f83f1,_0x3f4ccc,_0x5c9332,_0x299f74,_0x49812f,_0x5e9462,_0x5971d9)['then'](function(){_0x4316a6=path[_0xce47('0x2d')](__dirname,'tmp',rs[_0xce47('0x1f')](0x4)+_0xce47('0x3f'));return convertFile(_0x5971d9,_0x4316a6);})[_0xce47('0x22')](function(){try{fs[_0xce47('0x18')](_0x5971d9);fs['chmodSync'](_0x4316a6,_0xce47('0x33'));}catch(_0x54ce5e){logger[_0xce47('0x17')](_0x54ce5e);}return _0x4316a6[_0xce47('0x24')]('.')[0x0];});};exports[_0xce47('0x71')]=function(_0x44c529,_0x48da2b,_0x53abf2,_0x5f09a6,_0x543502,_0x40434d){return aws[_0xce47('0x72')](_0x44c529,_0x48da2b,_0x53abf2,_0x5f09a6,_0x543502,_0x40434d)[_0xce47('0x22')](function(_0x12ad1c){logger['info'](JSON['stringify'](_0x12ad1c));return _0x12ad1c;});};exports[_0xce47('0x73')]=function(_0x42abad,_0x458332,_0x31185f,_0x6ba6ec){var _0x19a9d0=util['format'](_0xce47('0x74'),ISPEECH_API,_0x42abad,encodeURIComponent(_0x458332),_0x31185f,_0x6ba6ec);var _0x2ea476=path[_0xce47('0x2d')](__dirname,_0xce47('0x2e'),rs[_0xce47('0x1f')](0x4)+_0xce47('0x2f'));var _0x258d11;return downloadFile(_0x19a9d0,_0x2ea476)['then'](function(){_0x258d11=path[_0xce47('0x2d')](__dirname,_0xce47('0x2e'),rs[_0xce47('0x1f')](0x4)+_0xce47('0x3f'));return convertFile(_0x2ea476,_0x258d11);})['then'](function(){try{fs[_0xce47('0x18')](_0x2ea476);fs[_0xce47('0x23')](_0x258d11,_0xce47('0x33'));}catch(_0x14df92){logger[_0xce47('0x17')](_0x14df92);}return _0x258d11[_0xce47('0x24')]('.')[0x0];});};exports[_0xce47('0x75')]=function(_0x1ac3f9,_0x51b458,_0x594605,_0x3e4a3b){var _0x175df5=util[_0xce47('0x76')](_0xce47('0x77'),ISPEECH_API,_0x51b458,_0x594605,base64Encode(_0x1ac3f9),_0x3e4a3b?util[_0xce47('0x76')](_0xce47('0x78'),encodeURIComponent(_0x3e4a3b)):_0xce47('0x79'));return uploadFile(_0x175df5)[_0xce47('0x22')](function(_0x4ab694){return querystring[_0xce47('0x7a')](_0x4ab694);});};exports[_0xce47('0x7b')]=function(_0x5b6792,_0x3fb0b7){return sestek[_0xce47('0x7c')](_0x5b6792,_0x3fb0b7)[_0xce47('0x22')](function(_0x2d4b91){logger['info'](JSON[_0xce47('0x39')](_0x2d4b91));var _0x25da44={'speech':_0x2d4b91[_0xce47('0x7d')],'action':_0x2d4b91[_0xce47('0x7e')]?_0x2d4b91[_0xce47('0x7e')][_0xce47('0x7f')]:undefined,'actiondata':_0x2d4b91[_0xce47('0x7e')]?_0x2d4b91[_0xce47('0x7e')][_0xce47('0x80')]:undefined};if(_0x2d4b91[_0xce47('0x7e')]&&_0x2d4b91[_0xce47('0x7e')][_0xce47('0x81')]){return base64Decode(_0x2d4b91['channelData'][_0xce47('0x81')][_0xce47('0x82')],path[_0xce47('0x2d')](__dirname,_0xce47('0x2e'),rs[_0xce47('0x1f')](0x4)+_0xce47('0x3f')))[_0xce47('0x22')](function(_0x440d4c){_0x25da44[_0xce47('0x83')]=_0x440d4c;return _0x25da44;});}return _0x25da44;});};exports[_0xce47('0x84')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 5c6df60..761c08f 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 _0x1858=['exports'];(function(_0x3b875b,_0x4ffa4f){var _0x36ddb3=function(_0xac8f48){while(--_0xac8f48){_0x3b875b['push'](_0x3b875b['shift']());}};_0x36ddb3(++_0x4ffa4f);}(_0x1858,0x104));var _0x8185=function(_0x3ef61a,_0x3c6073){_0x3ef61a=_0x3ef61a-0x0;var _0xbaae1d=_0x1858[_0x3ef61a];return _0xbaae1d;};var nda=require('./nda');module[_0x8185('0x0')]={'nda':nda}; \ No newline at end of file +var _0x358d=['exports','./nda'];(function(_0x41c8aa,_0x444dd3){var _0x16b761=function(_0x93a04){while(--_0x93a04){_0x41c8aa['push'](_0x41c8aa['shift']());}};_0x16b761(++_0x444dd3);}(_0x358d,0xd9));var _0xd358=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0x358d[_0x3616bb];return _0x1c0994;};var nda=require(_0xd358('0x0'));module[_0xd358('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 0941206..d146f21 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 _0x78f0=['ndagenerate_audio','AudioOutputSettings','custom_action','body','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','extension','text','Bearer\x20','access_token','channelData','ProjectName','project'];(function(_0x9664b9,_0x51d10e){var _0x420c36=function(_0x131a18){while(--_0x131a18){_0x9664b9['push'](_0x9664b9['shift']());}};_0x420c36(++_0x51d10e);}(_0x78f0,0x15d));var _0x078f=function(_0x473a6b,_0x48dcbf){_0x473a6b=_0x473a6b-0x0;var _0x4f53d0=_0x78f0[_0x473a6b];return _0x4f53d0;};'use strict';var rp=require(_0x078f('0x0'));var url=require(_0x078f('0x1'));var logger=require(_0x078f('0x2'))(_0x078f('0x3'));module[_0x078f('0x4')]=function(_0x2bde34,_0x34a715){var _0x316f1c={'method':'POST','uri':url[_0x078f('0x5')](_0x34a715[_0x078f('0x6')],_0x078f('0x7')),'form':{'grant_type':_0x078f('0x8'),'username':_0x34a715['username'],'password':_0x34a715[_0x078f('0x8')]},'json':!![]};return rp(_0x316f1c)[_0x078f('0x9')](function(_0x4a7db3){var _0x2ef013={'method':_0x078f('0xa'),'uri':url[_0x078f('0x5')](_0x34a715[_0x078f('0xb')],_0x078f('0xc')),'body':{'type':_0x34a715[_0x078f('0xd')]||_0x078f('0xe'),'channelId':_0x078f('0xf'),'conversation':{'id':_0x2bde34['uniqueid']},'from':{'id':_0x2bde34[_0x078f('0x10')],'name':_0x2bde34[_0x078f('0x11')]},'recipient':{'id':_0x2bde34['dnid'],'name':_0x2bde34[_0x078f('0x12')]},'text':_0x34a715[_0x078f('0x13')],'channelData':{}},'headers':{'Authorization':_0x078f('0x14')+_0x4a7db3[_0x078f('0x15')]},'json':!![]};if(_0x34a715['project']){_0x2ef013['body'][_0x078f('0x16')][_0x078f('0x17')]=_0x34a715[_0x078f('0x18')];}if(_0x34a715[_0x078f('0x19')]=='1'){_0x2ef013['body'][_0x078f('0x16')][_0x078f('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x34a715[_0x078f('0x1b')]){_0x2ef013[_0x078f('0x1c')][_0x078f('0x16')][_0x078f('0x1d')]=_0x34a715[_0x078f('0x1b')];if(_0x34a715[_0x078f('0x1e')]){_0x2ef013['body']['channelData'][_0x078f('0x1f')]=_0x34a715[_0x078f('0x1e')];}}logger[_0x078f('0x20')](JSON[_0x078f('0x21')](_0x2ef013));return rp(_0x2ef013);});}; \ No newline at end of file +var _0xb9a7=['text','Bearer\x20','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','url','POST','resolve','ndauth_url','/token','password','username','then','message','Nda','callerid','dnid'];(function(_0x281180,_0x4a7cda){var _0x183311=function(_0x2ea813){while(--_0x2ea813){_0x281180['push'](_0x281180['shift']());}};_0x183311(++_0x4a7cda);}(_0xb9a7,0x112));var _0x7b9a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb9a7[_0x4b055c];return _0x4b62bb;};'use strict';var rp=require('request-promise');var url=require(_0x7b9a('0x0'));var logger=require('../../../../../config/logger')('agi');module['exports']=function(_0x4278a1,_0x559be2){var _0x1396ec={'method':_0x7b9a('0x1'),'uri':url[_0x7b9a('0x2')](_0x559be2[_0x7b9a('0x3')],_0x7b9a('0x4')),'form':{'grant_type':_0x7b9a('0x5'),'username':_0x559be2[_0x7b9a('0x6')],'password':_0x559be2[_0x7b9a('0x5')]},'json':!![]};return rp(_0x1396ec)[_0x7b9a('0x7')](function(_0x3e51f0){var _0x4d3f20={'method':_0x7b9a('0x1'),'uri':url[_0x7b9a('0x2')](_0x559be2['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x559be2['ndaactivity_type']||_0x7b9a('0x8'),'channelId':_0x7b9a('0x9'),'conversation':{'id':_0x4278a1['uniqueid']},'from':{'id':_0x4278a1[_0x7b9a('0xa')],'name':_0x4278a1['calleridname']},'recipient':{'id':_0x4278a1[_0x7b9a('0xb')],'name':_0x4278a1['extension']},'text':_0x559be2[_0x7b9a('0xc')],'channelData':{}},'headers':{'Authorization':_0x7b9a('0xd')+_0x3e51f0[_0x7b9a('0xe')]},'json':!![]};if(_0x559be2['project']){_0x4d3f20[_0x7b9a('0xf')][_0x7b9a('0x10')]['ProjectName']=_0x559be2[_0x7b9a('0x11')];}if(_0x559be2[_0x7b9a('0x12')]=='1'){_0x4d3f20['body'][_0x7b9a('0x10')][_0x7b9a('0x13')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7b9a('0x14')};}if(_0x559be2[_0x7b9a('0x15')]){_0x4d3f20[_0x7b9a('0xf')][_0x7b9a('0x10')][_0x7b9a('0x16')]=_0x559be2[_0x7b9a('0x15')];if(_0x559be2[_0x7b9a('0x17')]){_0x4d3f20['body'][_0x7b9a('0x10')]['CustomActionData']=_0x559be2[_0x7b9a('0x17')];}}logger[_0x7b9a('0x18')](JSON[_0x7b9a('0x19')](_0x4d3f20));return rp(_0x4d3f20);});}; \ 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 f85c619..afb874e 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 _0x56e9=['exports','./lib/api'];(function(_0x393f95,_0x47ccb2){var _0x1e4dac=function(_0x13efc8){while(--_0x13efc8){_0x393f95['push'](_0x393f95['shift']());}};_0x1e4dac(++_0x47ccb2);}(_0x56e9,0x123));var _0x956e=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x56e9[_0xff5df6];return _0x2634bb;};'use strict';var asr=require(_0x956e('0x0'));module[_0x956e('0x1')]=function(_0x81f34c,_0x2ad282,_0xd4b130,_0x222087){return asr(_0x81f34c,_0x2ad282,_0xd4b130,_0x222087);}; \ No newline at end of file +var _0xa21e=['./lib/api','exports'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xa21e,0x166));var _0xea21=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa21e[_0x2aea9e];return _0x430b92;};'use strict';var asr=require(_0xea21('0x0'));module[_0xea21('0x1')]=function(_0x19c11d,_0x4d8f35,_0x78ed7b,_0x390a44){return asr(_0x19c11d,_0x4d8f35,_0x78ed7b,_0x390a44);}; \ 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 878490d..257bcdb 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 _0x2927=['../../../../../../config/logger','agi','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','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','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','moment'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x2927,0x1af));var _0x7292=function(_0x1ba703,_0x5de107){_0x1ba703=_0x1ba703-0x0;var _0x2ef233=_0x2927[_0x1ba703];return _0x2ef233;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7292('0x0'));var crypto=require('crypto');var logger=require(_0x7292('0x1'))(_0x7292('0x2'));module['exports']=function(_0x36dcaf,_0x2c8e6a,_0x367f4c,_0x5d6c45){return new BPromise(function(_0x5c2b2d,_0x5cde3a){logger[_0x7292('0x3')](_0x7292('0x4'),_0x5d6c45||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x48e782=new WebSocket(_0x5d6c45||_0x7292('0x5'),{'perMessageDeflate':![]});var _0x184ae6='';var _0x40bcf7='0';var _0x15dce0='1';var _0x5d3b45=_0x7292('0x6');function _0x1979b8(_0x48026e){var _0x37ace8=crypto[_0x7292('0x7')]('sha1');_0x37ace8['update'](_0x48026e);return _0x37ace8[_0x7292('0x8')](_0x7292('0x9'));}function _0x48c1ab(){try{logger[_0x7292('0x3')](_0x7292('0xa'));var _0x1636bf=moment()[_0x7292('0xb')]();var _0x1214bb=_0x1979b8(_0x1636bf+_0x2c8e6a+_0x367f4c);_0x48e782[_0x7292('0xc')](JSON['stringify']({'appID':_0x2c8e6a,'timestamp':_0x1636bf,'appKey':_0x1214bb}));var _0x5ac44e=fs[_0x7292('0xd')](_0x36dcaf);_0x5ac44e['on']('data',function(_0x9ce84c){_0x48e782[_0x7292('0xc')](_0x9ce84c);});_0x5ac44e['on'](_0x7292('0xe'),function(){_0x48e782[_0x7292('0xc')](_0x7292('0xf'));});}catch(_0x2e1983){logger[_0x7292('0x10')](_0x7292('0x11'),JSON[_0x7292('0x12')](_0x2e1983));_0x48e782[_0x7292('0x13')]();}}function _0x4bb371(_0x340443){try{if(_0x340443){var _0x5a8806=JSON['parse'](_0x340443);switch(_0x5a8806['status']){case 0x0:if(_0x5a8806[_0x7292('0x14')]){if(_0x5a8806[_0x7292('0x14')][_0x7292('0x15')]){logger['info'](_0x7292('0x16'),JSON[_0x7292('0x12')](_0x5a8806[_0x7292('0x14')]['hypotheses']));_0x184ae6=_0x5a8806[_0x7292('0x14')][_0x7292('0x17')][0x0][_0x7292('0x18')];_0x40bcf7=_0x5a8806['result'][_0x7292('0x17')][0x0][_0x7292('0x19')];_0x15dce0='0';_0x5d3b45='Success.';_0x48e782[_0x7292('0x13')]();}}break;case 0x1:logger[_0x7292('0x3')](_0x7292('0x6'));_0x15dce0='1';_0x5d3b45=_0x7292('0x6');break;case 0x2:logger['info'](_0x7292('0x1a'));_0x15dce0='2';_0x5d3b45=_0x7292('0x1a');break;case 0x9:logger[_0x7292('0x3')](_0x7292('0x1b'));_0x15dce0='9';_0x5d3b45=_0x7292('0x1b');break;case 0xa:logger['info'](_0x7292('0x1c'));_0x15dce0='10';_0x5d3b45=_0x7292('0x1c');break;case 0xb:logger[_0x7292('0x3')](_0x7292('0x1d'));_0x15dce0='11';_0x5d3b45=_0x7292('0x1d');}}}catch(_0x4d0c69){logger['error'](_0x7292('0x1e'),JSON[_0x7292('0x12')](_0x4d0c69));_0x48e782['terminate']();}}function _0x485ff4(){logger['info'](_0x7292('0x1f'));_0x5c2b2d({'transcript':_0x184ae6,'confidence':_0x40bcf7,'status':_0x15dce0,'status_message':_0x5d3b45});}function _0x2260ea(_0x391292){logger[_0x7292('0x10')](_0x7292('0x20'));if(!_[_0x7292('0x21')](_0x391292)){logger['error'](_[_0x7292('0x22')](_0x391292)?JSON[_0x7292('0x12')](_0x391292):_0x391292);}}_0x48e782['on'](_0x7292('0x23'),_0x48c1ab);_0x48e782['on']('message',_0x4bb371);_0x48e782['on'](_0x7292('0xe'),_0x485ff4);_0x48e782['on']('error',_0x2260ea);});}; \ No newline at end of file +var _0x17c5=['unix','stringify','createReadStream','data','close','send','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','info','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket'];(function(_0xc501b0,_0x46a0e7){var _0x3c9941=function(_0xaaf8be){while(--_0xaaf8be){_0xc501b0['push'](_0xc501b0['shift']());}};_0x3c9941(++_0x46a0e7);}(_0x17c5,0x134));var _0x517c=function(_0x11f706,_0x7e59d6){_0x11f706=_0x11f706-0x0;var _0x43c630=_0x17c5[_0x11f706];return _0x43c630;};'use strict';var BPromise=require(_0x517c('0x0'));var _=require(_0x517c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x517c('0x2'));var logger=require(_0x517c('0x3'))(_0x517c('0x4'));module[_0x517c('0x5')]=function(_0x5253ec,_0x59f925,_0x5a33d2,_0x16e840){return new BPromise(function(_0x19dc0a,_0x1ca7a7){logger['info']('Tilde\x20URI',_0x16e840||_0x517c('0x6'));var _0x4f2330=new WebSocket(_0x16e840||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x444713='';var _0x527714='0';var _0x143357='1';var _0x5263ef=_0x517c('0x7');function _0x36ae33(_0x44a53c){var _0x47c881=crypto['createHash'](_0x517c('0x8'));_0x47c881[_0x517c('0x9')](_0x44a53c);return _0x47c881['digest'](_0x517c('0xa'));}function _0x3923fe(){try{logger['info'](_0x517c('0xb'));var _0x745c27=moment()[_0x517c('0xc')]();var _0x443863=_0x36ae33(_0x745c27+_0x59f925+_0x5a33d2);_0x4f2330['send'](JSON[_0x517c('0xd')]({'appID':_0x59f925,'timestamp':_0x745c27,'appKey':_0x443863}));var _0x37cf85=fs[_0x517c('0xe')](_0x5253ec);_0x37cf85['on'](_0x517c('0xf'),function(_0x305087){_0x4f2330['send'](_0x305087);});_0x37cf85['on'](_0x517c('0x10'),function(){_0x4f2330[_0x517c('0x11')]('EOS');});}catch(_0x19a9cc){logger[_0x517c('0x12')](_0x517c('0x13'),JSON[_0x517c('0xd')](_0x19a9cc));_0x4f2330[_0x517c('0x14')]();}}function _0x2a0784(_0x3f254c){try{if(_0x3f254c){var _0x492380=JSON['parse'](_0x3f254c);switch(_0x492380[_0x517c('0x15')]){case 0x0:if(_0x492380[_0x517c('0x16')]){if(_0x492380[_0x517c('0x16')][_0x517c('0x17')]){logger[_0x517c('0x18')](_0x517c('0x19'),JSON['stringify'](_0x492380[_0x517c('0x16')][_0x517c('0x1a')]));_0x444713=_0x492380[_0x517c('0x16')][_0x517c('0x1a')][0x0]['transcript'];_0x527714=_0x492380[_0x517c('0x16')][_0x517c('0x1a')][0x0][_0x517c('0x1b')];_0x143357='0';_0x5263ef=_0x517c('0x1c');_0x4f2330[_0x517c('0x14')]();}}break;case 0x1:logger[_0x517c('0x18')](_0x517c('0x7'));_0x143357='1';_0x5263ef=_0x517c('0x7');break;case 0x2:logger[_0x517c('0x18')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x143357='2';_0x5263ef=_0x517c('0x1d');break;case 0x9:logger[_0x517c('0x18')](_0x517c('0x1e'));_0x143357='9';_0x5263ef=_0x517c('0x1e');break;case 0xa:logger['info'](_0x517c('0x1f'));_0x143357='10';_0x5263ef=_0x517c('0x1f');break;case 0xb:logger[_0x517c('0x18')](_0x517c('0x20'));_0x143357='11';_0x5263ef='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5e2a09){logger[_0x517c('0x12')](_0x517c('0x21'),JSON[_0x517c('0xd')](_0x5e2a09));_0x4f2330[_0x517c('0x14')]();}}function _0x4d5281(){logger[_0x517c('0x18')](_0x517c('0x22'));_0x19dc0a({'transcript':_0x444713,'confidence':_0x527714,'status':_0x143357,'status_message':_0x5263ef});}function _0x5b2fcf(_0x41fb45){logger['error'](_0x517c('0x23'));if(!_[_0x517c('0x24')](_0x41fb45)){logger[_0x517c('0x12')](_[_0x517c('0x25')](_0x41fb45)?JSON['stringify'](_0x41fb45):_0x41fb45);}}_0x4f2330['on'](_0x517c('0x26'),_0x3923fe);_0x4f2330['on'](_0x517c('0x27'),_0x2a0784);_0x4f2330['on'](_0x517c('0x10'),_0x4d5281);_0x4f2330['on'](_0x517c('0x12'),_0x5b2fcf);});}; \ 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 6d39faa..aac2bb3 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 _0x9d86=['./asr'];(function(_0xfd7c1e,_0x5eb3a4){var _0x10498d=function(_0x695a34){while(--_0x695a34){_0xfd7c1e['push'](_0xfd7c1e['shift']());}};_0x10498d(++_0x5eb3a4);}(_0x9d86,0xfb));var _0x69d8=function(_0x37836f,_0x1bed41){_0x37836f=_0x37836f-0x0;var _0x3c38bd=_0x9d86[_0x37836f];return _0x3c38bd;};var asr=require(_0x69d8('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x539e=['exports','./asr'];(function(_0x44cc65,_0x17e1ef){var _0x1f57dd=function(_0x5cf2cf){while(--_0x5cf2cf){_0x44cc65['push'](_0x44cc65['shift']());}};_0x1f57dd(++_0x17e1ef);}(_0x539e,0x13f));var _0xe539=function(_0x545262,_0x37382a){_0x545262=_0x545262-0x0;var _0x368866=_0x539e[_0x545262];return _0x368866;};var asr=require(_0xe539('0x0'));module[_0xe539('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 030abe0..a0c926f 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 39e02a3..39edbf1 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 _0x85d0=['number','includes','PUT','method','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','length','setVariable','stringify','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','toUpperCase','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','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','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','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','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','file_id','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','failure','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getSound','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','sayDigits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','unlink','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','exports','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','getSoundPath','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','dnid','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout'];(function(_0x41b0a8,_0x1b05cc){var _0x3a83d4=function(_0x3d1011){while(--_0x3d1011){_0x41b0a8['push'](_0x41b0a8['shift']());}};_0x3a83d4(++_0x1b05cc);}(_0x85d0,0x164));var _0x085d=function(_0x111a62,_0x3b0866){_0x111a62=_0x111a62-0x0;var _0x9cdcb7=_0x85d0[_0x111a62];return _0x9cdcb7;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var Mustache=require(_0x085d('0x2'));var rp=require(_0x085d('0x3'));var logger=require(_0x085d('0x4'))(_0x085d('0x5'));var config=require('../../config/environment');var scripts=require(_0x085d('0x6'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x085d('0x7'),_0x085d('0x8')];var verticesWithRetry=[_0x085d('0x9'),'getdigits',_0x085d('0xa')];var AGIVertices=function(_0xa94124,_0x210aa0,_0x3129a8){this[_0x085d('0xb')]=_0xa94124;this[_0x085d('0xc')]=_0x210aa0;this[_0x085d('0xd')]=_0x3129a8;};AGIVertices[_0x085d('0xe')][_0x085d('0xf')]=function(_0x572c9d,_0x764e2b){this[_0x085d('0xc')][_0x085d('0x10')](_0x572c9d)[_0x085d('0x11')](function(_0x4bc325){_0x764e2b(null,_0x4bc325?_0x4bc325[_0x085d('0x12')]:![]);})[_0x085d('0x13')](function(_0x5c6c27){_0x764e2b(_0x5c6c27);});};AGIVertices[_0x085d('0xe')][_0x085d('0x14')]=function(_0x2f2b93,_0x6b21d1){this['rpc'][_0x085d('0x15')](_0x2f2b93)[_0x085d('0x11')](function(_0x5ac8bb){_0x6b21d1(null,_0x5ac8bb?_0x5ac8bb['name']:![]);})[_0x085d('0x13')](function(_0x334263){_0x6b21d1(_0x334263);});};AGIVertices[_0x085d('0xe')][_0x085d('0x16')]=function(_0x309c15,_0x5ed56a){this[_0x085d('0xc')][_0x085d('0x17')](_0x309c15)[_0x085d('0x11')](function(_0x1b0a6c){_0x5ed56a(null,_0x1b0a6c?_0x1b0a6c[_0x085d('0x12')]:![]);})[_0x085d('0x13')](function(_0x5c046e){_0x5ed56a(_0x5c046e);});};AGIVertices[_0x085d('0xe')][_0x085d('0x18')]=function(_0x5c8232,_0xba531c){this[_0x085d('0xc')][_0x085d('0x19')](_0x5c8232)[_0x085d('0x11')](function(_0x3bb427){_0xba531c(null,_0x3bb427?_0x3bb427['dsn']:![]);})[_0x085d('0x13')](function(_0x5fd5f){_0xba531c(_0x5fd5f);});};AGIVertices[_0x085d('0xe')][_0x085d('0x1a')]=function(_0x4cf0e1,_0x5b3f9c){this['rpc'][_0x085d('0x1b')](_0x4cf0e1)[_0x085d('0x11')](function(_0x10735c){_0x5b3f9c(null,_0x10735c?_0x10735c[_0x085d('0x12')]:![]);})[_0x085d('0x13')](function(_0x17dafb){_0x5b3f9c(_0x17dafb);});};AGIVertices['prototype'][_0x085d('0x1c')]=function(_0x27b36a,_0x329703){this['rpc'][_0x085d('0x1d')](_0x27b36a)[_0x085d('0x11')](function(_0xbacfbc){_0x329703(null,_0xbacfbc?_0xbacfbc[_0x085d('0x12')]:![]);})[_0x085d('0x13')](function(_0x4b9032){_0x329703(_0x4b9032);});};AGIVertices['prototype']['getSound']=function(_0x16614,_0x102dfc){var _0x402440=this;this['rpc'][_0x085d('0x1e')](_0x16614)[_0x085d('0x11')](function(_0x3faf6b){_0x102dfc(null,_0x3faf6b?_0x402440['getSoundPath'](_0x3faf6b[_0x085d('0x1f')]):![]);})[_0x085d('0x13')](function(_0x3f905d){_0x102dfc(_0x3f905d);});};AGIVertices[_0x085d('0xe')]['getMailAccount']=function(_0x318cab,_0x580c40){this['rpc'][_0x085d('0x20')](_0x318cab)[_0x085d('0x11')](function(_0x4b0066){_0x580c40(null,_0x4b0066?_0x4b0066:![]);})[_0x085d('0x13')](function(_0x903b71){_0x580c40(_0x903b71);});};AGIVertices[_0x085d('0xe')]['sendMailMessage']=function(_0x30b632,_0x36bd27,_0x1e5cae){this['mailRpc'][_0x085d('0x21')](_0x30b632,_0x36bd27)['then'](function(){_0x1e5cae(null);})[_0x085d('0x13')](function(_0xf16df){_0x1e5cae(_0xf16df);});};AGIVertices[_0x085d('0xe')][_0x085d('0x22')]=function(_0x5c71f3,_0x1f6f72){this[_0x085d('0xc')][_0x085d('0x23')](_0x5c71f3)[_0x085d('0x11')](function(_0x54e579){if(_0x54e579){if(_0x54e579['IntervalId']){_0x1f6f72(null,[_0x54e579[_0x085d('0x24')]]);}else{_0x1f6f72(null,_[_0x085d('0x25')](_0x54e579[_0x085d('0x26')],_0x085d('0x24')));}}else{_0x1f6f72(null,![]);}})[_0x085d('0x13')](function(_0x2f2b65){_0x1f6f72(_0x2f2b65);});};AGIVertices[_0x085d('0xe')][_0x085d('0x27')]=function(_0x16e977){return util['format'](_0x085d('0x28'),FILES_PATH,_0x16e977);};AGIVertices[_0x085d('0xe')]['getQueryOdbc']=function(_0x254a9b,_0x5c82ef,_0x1cc755){odbc[_0x085d('0x29')](_0x254a9b,function(_0x4aed62){if(_0x4aed62){logger[_0x085d('0x2a')](_0x085d('0x2b'),_0x4aed62);_0x1cc755(_0x4aed62);}else{logger[_0x085d('0x2c')](_0x085d('0x2d'));odbc[_0x085d('0x2e')](_0x5c82ef,function(_0x58963f,_0x3fc23c){if(_0x58963f){logger['info']('Error\x20executing\x20query\x20%s',_0x5c82ef);_0x1cc755(_0x58963f);}else{logger[_0x085d('0x2c')](_0x085d('0x2f'),_0x5c82ef);odbc[_0x085d('0x30')](function(_0x7b1d2f){if(_0x7b1d2f){logger[_0x085d('0x2a')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x7b1d2f);}_0x1cc755(null,_0x3fc23c);});}});}});};AGIVertices[_0x085d('0xe')]['getSmsAccount']=function(_0x3a8646,_0x65ec6d){this[_0x085d('0xc')]['getSmsAccountById'](_0x3a8646)[_0x085d('0x11')](function(_0x55d81a){_0x65ec6d(null,_0x55d81a?_0x55d81a:![]);})[_0x085d('0x13')](function(_0x284172){_0x65ec6d(_0x284172);});};AGIVertices['prototype'][_0x085d('0x31')]=function(_0x23c52a,_0x20586e){this['rpc']['createSmsMessage'](_0x23c52a)[_0x085d('0x11')](function(_0x1f1e1f){_0x20586e(null,_0x1f1e1f);})[_0x085d('0x13')](function(_0x336361){_0x20586e(_0x336361);});};AGIVertices[_0x085d('0xe')][_0x085d('0x32')]=function(_0x27e1c7,_0x120980,_0x2978a1){this[_0x085d('0xc')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x085d('0x33')],'node':_0x27e1c7[_0x085d('0x34')],'application':_0x27e1c7[_0x085d('0x35')],'data':_0x120980||null,'project_name':this[_0x085d('0xb')][_0x085d('0x36')],'callerid':this[_0x085d('0xb')][_0x085d('0x37')]})[_0x085d('0x11')](function(_0x1041ff){if(_0x2978a1){_0x2978a1(null,_0x1041ff);}})[_0x085d('0x13')](function(_0x20a4ef){if(_0x2978a1){_0x2978a1(_0x20a4ef);}});};AGIVertices['prototype'][_0x085d('0x38')]=function(_0x318896,_0x1df88b,_0x399015,_0x39d3ac){this['rpc'][_0x085d('0x38')]({'uniqueid':this['channel'][_0x085d('0x33')],'callerid':this['channel']['callerid'],'calleridname':this[_0x085d('0xb')][_0x085d('0x39')],'context':this[_0x085d('0xb')][_0x085d('0x3a')],'extension':this[_0x085d('0xb')]['extension'],'priority':this['channel']['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0x085d('0xb')][_0x085d('0x3b')],'projectName':this['channel'][_0x085d('0x36')],'saveName':_0x1df88b,'filename':_0x318896['file']||_0x1df88b,'savePath':_0x399015})['then'](function(_0x415a4b){_0x39d3ac(null,_0x415a4b);})[_0x085d('0x13')](function(_0x1da4b8){_0x39d3ac(_0x1da4b8);});};AGIVertices[_0x085d('0xe')]['createSquareMessage']=function(_0x22216c,_0x5ec8dc,_0x43225a,_0x458c54,_0x5d6f22){this[_0x085d('0xc')][_0x085d('0x3c')]({'uniqueid':this[_0x085d('0xb')][_0x085d('0x33')],'body':_0x22216c,'direction':_0x5ec8dc,'providerName':_0x43225a,'providerResponse':_0x458c54})['then'](function(_0x256103){if(_0x5d6f22){_0x5d6f22(null,_0x256103);}})['catch'](function(_0x24dd9c){if(_0x5d6f22){_0x5d6f22(_0x24dd9c);}});};AGIVertices['prototype']['createCmContact']=function(_0x1212e6,_0x41e3e0){this[_0x085d('0xc')][_0x085d('0x3d')]({'firstName':_[_0x085d('0x3e')](_0x1212e6[_0x085d('0x12')])||_[_0x085d('0x3f')](_0x1212e6[_0x085d('0x12')])?'callback_'+Math['random']():_0x1212e6['name'],'lastName':_[_0x085d('0x3e')](_0x1212e6['lastName'])||_[_0x085d('0x3f')](_0x1212e6['lastName'])?null:_0x1212e6[_0x085d('0x40')],'phone':_0x1212e6[_0x085d('0x41')],'ListId':_0x1212e6[_0x085d('0x42')],'scheduledat':_0x1212e6[_0x085d('0x43')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x085d('0x44'),'description':_0x085d('0x45')+_0x1212e6['scheduledAt'][_0x085d('0x46')](),'priority':_0x1212e6[_0x085d('0x47')]})[_0x085d('0x11')](function(_0x2af16a){_0x41e3e0(null,_0x2af16a);})[_0x085d('0x13')](function(_0xc5464e){_0x41e3e0(_0xc5464e);});};AGIVertices[_0x085d('0xe')][_0x085d('0x48')]=function(_0x483f75,_0x3e5a65){this['rpc'][_0x085d('0x49')](_0x483f75)['then'](function(_0x258405){_0x3e5a65(null,_0x258405?_0x258405['name']:![]);})[_0x085d('0x13')](function(_0x183932){_0x3e5a65(_0x183932);});};AGIVertices['prototype']['agentPause']=function(_0x313506,_0x237070,_0x31e99f){var _0x43ce84={'role':_0x085d('0x4a')};_0x43ce84[_0x313506]=this[_0x085d('0xb')][_0x085d('0x37')];this[_0x085d('0xc')][_0x085d('0x4b')](_0x43ce84,_0x237070,this[_0x085d('0xb')][_0x085d('0x33')])[_0x085d('0x11')](function(_0x2b7744){_0x31e99f(null,_[_0x085d('0x3f')](_0x2b7744)?![]:!![]);})['catch'](function(_0x595ba0){logger[_0x085d('0x2a')](_0x595ba0);_0x31e99f(null,![]);});};AGIVertices[_0x085d('0xe')]['agentUnpause']=function(_0x5b89e1,_0x4e695e){var _0xbd6325={'role':_0x085d('0x4a')};_0xbd6325[_0x5b89e1]=this['channel'][_0x085d('0x37')];this[_0x085d('0xc')][_0x085d('0x4c')](_0xbd6325)['then'](function(_0x73e470){_0x4e695e(null,_[_0x085d('0x3f')](_0x73e470)?![]:!![]);})[_0x085d('0x13')](function(_0xc3cb69){logger['error'](_0xc3cb69);_0x4e695e(null,![]);});};AGIVertices[_0x085d('0xe')][_0x085d('0x4d')]=function(_0x5cf5e9,_0x34eb37){var _0x375779={'role':_0x085d('0x4a')};_0x375779[_0x5cf5e9]=this['channel']['callerid'];this['rpc'][_0x085d('0x4d')](_0x375779)[_0x085d('0x11')](function(_0x53bc2e){_0x34eb37(null,_[_0x085d('0x3f')](_0x53bc2e)?![]:!![]);})['catch'](function(_0x376d73){logger[_0x085d('0x2a')](_0x376d73);_0x34eb37(null,![]);});};AGIVertices['prototype'][_0x085d('0x4e')]=function(_0x2af674,_0x5cbc5a){var _0x1a2930={'role':_0x085d('0x4a')};_0x1a2930[_0x2af674]=this[_0x085d('0xb')][_0x085d('0x37')];var _0x52e168=_0x2af674!='internal'?util[_0x085d('0x4f')](_0x085d('0x50'),_0x085d('0x51'),this[_0x085d('0xb')]['callerid']):undefined;this['rpc']['agentLogin'](_0x1a2930,_0x52e168)[_0x085d('0x11')](function(_0x582270){_0x5cbc5a(null,_['isNil'](_0x582270)?![]:!![]);})[_0x085d('0x13')](function(_0x546bbc){logger[_0x085d('0x2a')](_0x546bbc);_0x5cbc5a(null,![]);});};AGIVertices[_0x085d('0xe')][_0x085d('0x52')]=function(_0x1f11c2,_0x557bc3){sh[_0x085d('0x53')](_[_0x085d('0x54')](_0x1f11c2),function(_0x26d0a1,_0x7f5541){var _0x28b92f=_0x7f5541[_0x085d('0x55')](/(\r\n|\n|\r)/gm,'');_0x557bc3(null,_0x28b92f);});};AGIVertices[_0x085d('0xe')][_0x085d('0x56')]=function(_0x3d7e64,_0xaeadce){scripts['googleCloudTTS'](_0x3d7e64['apiKey'],_0x3d7e64[_0x085d('0x57')]||_0x085d('0x58'),_0x3d7e64['text'],_0x3d7e64[_0x085d('0x59')]||_0x085d('0x5a'),_0x3d7e64[_0x085d('0x5b')]||_0x085d('0x5c'),_0x3d7e64[_0x085d('0x5d')]||_0x085d('0x5e'))[_0x085d('0x11')](function(_0x4256d5){_0xaeadce(null,_0x4256d5);})[_0x085d('0x13')](function(_0x351a3d){_0xaeadce(_0x351a3d);});};AGIVertices[_0x085d('0xe')][_0x085d('0x5f')]=function(_0xf885e1,_0x2c60cf){scripts[_0x085d('0x5f')](_0xf885e1[_0x085d('0x58')],_0xf885e1[_0x085d('0x60')]||'en',0x1)['then'](function(_0x2b214f){_0x2c60cf(null,_0x2b214f);})[_0x085d('0x13')](function(_0x178af1){_0x2c60cf(_0x178af1);});};AGIVertices['prototype'][_0x085d('0x61')]=function(_0x4de098,_0x53fd1b){var _0x261ac7={'uri':_0x4de098[_0x085d('0x62')],'method':_0x4de098['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4de098[_0x085d('0x63')])===_0x085d('0x64')&&parseInt(_0x4de098[_0x085d('0x63')])>=0x1?parseInt(_0x4de098[_0x085d('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x085d('0x65')](['POST',_0x085d('0x66')],_0x261ac7[_0x085d('0x67')]['toUpperCase']())){try{_0x261ac7['body']=_0x4de098[_0x085d('0x8')]?JSON['parse'](_0x4de098[_0x085d('0x8')]):{};}catch(_0x10c5f9){logger[_0x085d('0x2a')](_0x085d('0x68'),_0x10c5f9);}}try{_0x261ac7['headers']=_0x4de098['rawHeaders']?JSON[_0x085d('0x69')](_0x4de098[_0x085d('0x7')]):{};}catch(_0x1de071){logger['error'](_0x085d('0x6a'),_0x1de071);}if(_0x4de098['computedVariables']){try{var _0x2f78b6=require(_0x4de098[_0x085d('0x6b')])[_0x085d('0x6c')](this,_0x261ac7);_0x261ac7['uri']=Mustache[_0x085d('0x6d')](_0x4de098['url'],_0x2f78b6,{},['$$','$$']);if(_0x261ac7[_0x085d('0x6e')]){_0x261ac7[_0x085d('0x6e')]=JSON[_0x085d('0x69')](Mustache['render'](JSON['stringify'](_0x261ac7[_0x085d('0x6e')]),_0x2f78b6,{},['$$','$$']));}if(_0x261ac7[_0x085d('0x6f')]){_0x261ac7[_0x085d('0x6f')]=JSON[_0x085d('0x69')](Mustache['render'](JSON['stringify'](_0x261ac7['body']),_0x2f78b6,{},['$$','$$']));}}catch(_0x143289){logger[_0x085d('0x2a')](_0x085d('0x70'),_0x143289);}}rp(_0x261ac7)['then'](function(_0x5baac1){var _0x31802d={'statusCode':_0x5baac1[_0x085d('0x71')]||0xc8,'statusMessage':_0x5baac1[_0x085d('0x72')]||'OK','headers':_0x5baac1['headers']||{},'body':_0x5baac1[_0x085d('0x6f')]||{}};_0x53fd1b(null,_0x31802d);})['catch'](function(_0x2300a5){var _0x3908bf={'statusCode':_0x2300a5['statusCode']||0x1f4,'statusMessage':_0x2300a5[_0x085d('0x73')]||_0x085d('0x74'),'headers':_0x2300a5[_0x085d('0x75')]['headers']||{},'body':_0x2300a5[_0x085d('0x75')][_0x085d('0x6f')]||{}};_0x53fd1b(null,_0x3908bf);});};AGIVertices[_0x085d('0xe')][_0x085d('0x76')]=function(_0x2de70b,_0x562711){scripts[_0x085d('0x76')](this[_0x085d('0xb')][_0x085d('0x33')],_0x2de70b['key'],_0x2de70b[_0x085d('0x58')],_0x2de70b[_0x085d('0x77')]||'en')[_0x085d('0x11')](function(_0x38d2dd){_0x562711(null,_0x38d2dd);})[_0x085d('0x13')](function(_0xcdc93e){_0x562711(_0xcdc93e);});};AGIVertices[_0x085d('0xe')][_0x085d('0x78')]=function(_0x57706d,_0x1f3144){scripts['googleDialogflowV2'](this['channel'][_0x085d('0x33')],_0x57706d[_0x085d('0x79')],_0x57706d[_0x085d('0x7a')],_0x57706d[_0x085d('0x7b')],_0x57706d[_0x085d('0x58')],_0x57706d[_0x085d('0x7c')]||'en')[_0x085d('0x11')](function(_0x22a749){_0x1f3144(null,_0x22a749);})['catch'](function(_0x223858){_0x1f3144(_0x223858);});};AGIVertices[_0x085d('0xe')][_0x085d('0x7d')]=function(_0x4fec3f,_0x28f9a1){scripts[_0x085d('0x7d')](this[_0x085d('0xb')],_0x4fec3f)[_0x085d('0x11')](function(_0x4d8c25){_0x28f9a1(null,_0x4d8c25);})[_0x085d('0x13')](function(_0x5d86b3){_0x28f9a1(_0x5d86b3);});};AGIVertices[_0x085d('0xe')][_0x085d('0x7e')]=function(_0x43ad61,_0x5c92f7){scripts[_0x085d('0x7e')](_0x43ad61[_0x085d('0x7f')],_0x43ad61[_0x085d('0x58')],_0x43ad61['ispeech_tts_language']||_0x085d('0x5a'),_0x43ad61[_0x085d('0x80')])[_0x085d('0x11')](function(_0x5095d2){_0x5c92f7(null,_0x5095d2);})[_0x085d('0x13')](function(_0x397f6f){_0x5c92f7(_0x397f6f);});};AGIVertices[_0x085d('0xe')][_0x085d('0x81')]=function(_0x5ddaa3,_0x8dbaf0,_0xb23019){scripts[_0x085d('0x81')](_0x8dbaf0,_0x5ddaa3[_0x085d('0x7f')],_0x5ddaa3[_0x085d('0x82')]||'en-US',this[_0x085d('0x83')](_0x5ddaa3[_0x085d('0x84')])?_0x5ddaa3[_0x085d('0x84')]:undefined)[_0x085d('0x11')](function(_0x1ea8a3){_0xb23019(null,_0x1ea8a3);})[_0x085d('0x13')](function(_0x1811c7){_0xb23019(_0x1811c7);});};AGIVertices[_0x085d('0xe')][_0x085d('0x85')]=function(_0x52ba3b,_0x58d940){scripts[_0x085d('0x85')](_0x52ba3b[_0x085d('0x86')],_0x52ba3b[_0x085d('0x87')],_0x52ba3b['aws_polly_region'],_0x52ba3b['aws_polly_voice']||'Amy',_0x52ba3b[_0x085d('0x58')],_0x52ba3b[_0x085d('0x88')]||'text')[_0x085d('0x11')](function(_0x802f6f){_0x58d940(null,_0x802f6f);})[_0x085d('0x13')](function(_0x101e5e){_0x58d940(_0x101e5e);});};AGIVertices[_0x085d('0xe')][_0x085d('0x89')]=function(_0x85b1ef,_0x389066){scripts[_0x085d('0x89')](this[_0x085d('0xb')]['uniqueid'],_0x85b1ef['aws_access_key_id'],_0x85b1ef[_0x085d('0x87')],_0x85b1ef['aws_lex_region'],_0x85b1ef[_0x085d('0x58')],_0x85b1ef[_0x085d('0x8a')])[_0x085d('0x11')](function(_0x5da87f){_0x389066(null,_0x5da87f);})['catch'](function(_0x337041){_0x389066(_0x337041);});};AGIVertices[_0x085d('0xe')][_0x085d('0x8b')]=function(_0x7b501,_0x1d2895,_0x227516){scripts[_0x085d('0x8b')](_0x1d2895,_0x7b501['key'],_0x7b501[_0x085d('0x8c')]||'en-US')[_0x085d('0x11')](function(_0x4695d8){_0x227516(null,_0x4695d8);})[_0x085d('0x13')](function(_0x285e8f){_0x227516(_0x285e8f);});};AGIVertices['prototype'][_0x085d('0x8d')]=function(_0x356081,_0x537fe7,_0x17860e){scripts['tildeASR'](_0x537fe7,_0x356081[_0x085d('0x8e')],_0x356081[_0x085d('0x8f')],_0x356081['uri'])[_0x085d('0x11')](function(_0x29119d){_0x17860e(null,_0x29119d);})[_0x085d('0x13')](function(_0xc5b63b){_0x17860e(_0xc5b63b);});};AGIVertices['prototype'][_0x085d('0x90')]=function(_0x2d56f1){var _0x50f3b4=_['includes'](verticesWithRetry,_0x2d56f1[_0x085d('0x35')])?_0x2d56f1:_[_0x085d('0x91')](_0x2d56f1);for(var _0x4a71d9 in _0x50f3b4){if(_0x50f3b4[_0x085d('0x92')](_0x4a71d9)){if(_0x50f3b4[_0x4a71d9]&&_[_0x085d('0x93')](_0x50f3b4[_0x4a71d9])){if(_['includes'](recursiveMapAttributes,_0x4a71d9)){_0x50f3b4[_0x4a71d9]=this[_0x085d('0x94')](_0x50f3b4[_0x4a71d9]);}else{_0x50f3b4[_0x4a71d9]=this[_0x085d('0x95')](_0x50f3b4[_0x4a71d9]);}}}}return _0x50f3b4;};AGIVertices['prototype'][_0x085d('0x96')]=function(_0x4fe369){for(var _0x411e39 in _0x4fe369){if(_0x4fe369[_0x085d('0x92')](_0x411e39)){if(_['isPlainObject'](_0x4fe369[_0x411e39])){this[_0x085d('0x96')](_0x4fe369[_0x411e39]);}else if(_[_0x085d('0x97')](_0x4fe369[_0x411e39])){for(var _0x1819c0=0x0;_0x1819c0<_0x4fe369[_0x411e39]['length'];_0x1819c0++){this[_0x085d('0x96')](_0x4fe369[_0x411e39][_0x1819c0]);}}else if(_[_0x085d('0x93')](_0x4fe369[_0x411e39])){_0x4fe369[_0x411e39]=this[_0x085d('0x95')](_0x4fe369[_0x411e39]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x22d084,_0x5f36d7){for(var _0x5551d0 in _0x22d084){if(_0x22d084['hasOwnProperty'](_0x5551d0)){if(_['isPlainObject'](_0x22d084[_0x5551d0])){if(!_[_0x085d('0x3e')](_0x22d084[_0x5551d0])){this[_0x085d('0x98')](_0x22d084[_0x5551d0],util[_0x085d('0x4f')](_0x085d('0x99'),_0x5f36d7,_0x5551d0));}}else if(_[_0x085d('0x97')](_0x22d084[_0x5551d0])){for(var _0xfb8013=0x0;_0xfb8013<_0x22d084[_0x5551d0][_0x085d('0x9a')];_0xfb8013++){this[_0x085d('0x98')](_0x22d084[_0x5551d0][_0xfb8013],util[_0x085d('0x4f')](_0x085d('0x99'),_0x5f36d7,_0x5551d0+'['+_0xfb8013+']'));}}else{if(!_[_0x085d('0x3f')](_0x22d084[_0x5551d0])){this[_0x085d('0xb')][_0x085d('0x9b')](util['format'](_0x085d('0x99'),_0x5f36d7,_0x5551d0),_0x22d084[_0x5551d0]);}}}}};AGIVertices[_0x085d('0xe')][_0x085d('0x94')]=function(_0x3b44e4){try{var _0x53d995=JSON[_0x085d('0x69')](_0x3b44e4);this['recursiveNodeIndex'](_0x53d995);return JSON[_0x085d('0x9c')](_0x53d995);}catch(_0xc739ab){return this[_0x085d('0x95')](_0x3b44e4);}};AGIVertices[_0x085d('0xe')][_0x085d('0x95')]=function(_0x2f013e){var _0x4109e8=_0x2f013e['split']('{');for(var _0x526724=0x1;_0x526724<_0x4109e8['length'];_0x526724+=0x1){var _0x2b39d1=_0x4109e8[_0x526724][_0x085d('0x9d')]('}');if(_0x2b39d1['length']>0x1){_0x2f013e=_0x2f013e['replaceAll']('{'+_0x2b39d1[0x0]+'}',this[_0x085d('0xb')]['getVariable'](_0x2b39d1[0x0])[_0x085d('0x9e')]||_0x2b39d1[0x0]);}}if(_0x4109e8[_0x085d('0x9a')]===0x1){return _0x2f013e['toString']();}return this[_0x085d('0x95')](_0x2f013e);};AGIVertices[_0x085d('0xe')][_0x085d('0x9f')]=function(_0x445dad,_0x32f9d8){var _0x5297bf=this[_0x085d('0xb')]['getVariable'](_0x445dad);if(_0x5297bf[_0x085d('0xa0')]===-0x1){return _0x5297bf;}logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0xa1'),_0x32f9d8,_0x5297bf['extra']));return this[_0x085d('0xb')][_0x085d('0x9b')](_0x32f9d8,_0x5297bf[_0x085d('0x9e')]);};AGIVertices['prototype'][_0x085d('0x83')]=function(_0x8bd318){return _0x8bd318&&_0x8bd318!=='0'&&_0x8bd318!=='-1'&&_0x8bd318!=='';};AGIVertices[_0x085d('0xe')][_0x085d('0xa2')]=function(_0x42b5dd){this['createSquareDetailsReport'][_0x085d('0x6c')](this,_0x42b5dd,'-');_0x42b5dd[_0x085d('0xa3')]=_0x42b5dd['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x085d('0xe')]['mrcpsynth']=function(_0xb1eb39){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0xa4'),_0xb1eb39[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0xb1eb39[_0x085d('0x58')])){return this[_0x085d('0xb')]['noop'](_0x085d('0xa5'));}var _0x35c12d='\x22'+_0xb1eb39[_0x085d('0x58')]+'\x22';if(this['isConfigured'](_0xb1eb39[_0x085d('0x75')])){_0x35c12d+=','+_0xb1eb39[_0x085d('0x75')];}var _0x23615a=this['channel']['exec'](_0x085d('0xa6'),_0x35c12d);if(_0x23615a[_0x085d('0xa0')]===-0x1){return _0x23615a;}return this[_0x085d('0xb')][_0x085d('0xa7')](util['format'](_0x085d('0xa8'),_0x35c12d));};AGIVertices[_0x085d('0xe')][_0x085d('0xa9')]=function(_0x3ea23d){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0xaa'),_0x3ea23d[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x3ea23d[_0x085d('0xab')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xac'));}var _0x11833f=_0x3ea23d[_0x085d('0xab')];if(this[_0x085d('0x83')](_0x3ea23d[_0x085d('0x75')])){_0x11833f+=','+_0x3ea23d['options'];}var _0x38ac41=this[_0x085d('0xb')][_0x085d('0x53')](_0x085d('0xad'),_0x11833f);if(_0x38ac41[_0x085d('0xa0')]===-0x1){return _0x38ac41;}var _0x3d3c75=this[_0x085d('0x9f')](_0x085d('0xae'),_0x085d('0xaf'));if(_0x3d3c75[_0x085d('0xa0')]===-0x1){return _0x3d3c75;}var _0x3b5724=this[_0x085d('0x9f')]('RECOG_INPUT()',_0x085d('0xb0'));if(_0x3b5724['result']===-0x1){return _0x3b5724;}var _0x4fced0=this[_0x085d('0x9f')]('RECOG_INSTANCE()',_0x085d('0xb1'));if(_0x4fced0['result']===-0x1){return _0x4fced0;}return this[_0x085d('0xb')][_0x085d('0xa7')](util['format'](_0x085d('0xb2'),_0x11833f));};AGIVertices['prototype'][_0x085d('0x5')]=function(_0x497198){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0xb3'),_0x497198[_0x085d('0x34')]));return this[_0x085d('0xb')]['agi']([_0x497198[_0x085d('0xb4')],_0x497198[_0x085d('0xb5')]]);};AGIVertices[_0x085d('0xe')]['answer']=function(_0x139ded){logger[_0x085d('0x2c')](util['format'](_0x085d('0xb6'),_0x139ded[_0x085d('0x34')]));if(this[_0x085d('0x83')](_0x139ded[_0x085d('0x63')])){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0xb7'),_0x139ded[_0x085d('0x63')]));var _0x300319=this[_0x085d('0xb')]['wait'](_0x139ded[_0x085d('0x63')]);if(_0x300319[_0x085d('0xa0')]===-0x1){return _0x300319;}}return this[_0x085d('0xb')][_0x085d('0xb8')]();};AGIVertices[_0x085d('0xe')][_0x085d('0x44')]=function(_0x26f992){logger[_0x085d('0x2c')](util[_0x085d('0x4f')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x26f992[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x26f992[_0x085d('0x42')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x26f992,_0x085d('0xb9'));}_0x26f992[_0x085d('0x43')]=moment();if(this[_0x085d('0x83')](_0x26f992[_0x085d('0xba')])){_0x26f992[_0x085d('0x43')]=moment()[_0x085d('0xbb')](_0x26f992['delay'],_0x085d('0xbc'));}if(!this[_0x085d('0x83')](_0x26f992[_0x085d('0x47')])){_0x26f992['callback_priority']=0x2;}this['createCmContact'][_0x085d('0x6c')](this,_0x26f992);return this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0xbd'),_0x26f992[_0x085d('0x41')],_0x26f992[_0x085d('0x42')],_0x26f992[_0x085d('0x43')]));};AGIVertices[_0x085d('0xe')]['custom_app']=function(_0x14f47f){logger[_0x085d('0x2c')](util['format'](_0x085d('0xbe'),_0x14f47f[_0x085d('0x34')]));var _0x354645=this[_0x085d('0xb')]['exec'](_0x14f47f[_0x085d('0xbf')],_0x14f47f[_0x085d('0x75')]);if(_0x354645['result']===-0x1){return _0x354645;}return this[_0x085d('0xb')][_0x085d('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x14f47f[_0x085d('0xbf')],_0x14f47f[_0x085d('0x75')]));};AGIVertices[_0x085d('0xe')][_0x085d('0xc0')]=function(_0x1e41fc){logger[_0x085d('0x2c')](util['format'](_0x085d('0xc1'),_0x1e41fc['label']));if(!this[_0x085d('0x83')](_0x1e41fc['text'])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xa5'));}var _0x2abf11='\x22'+_0x1e41fc[_0x085d('0x58')]+'\x22';if(this[_0x085d('0x83')](_0x1e41fc['options'])){_0x2abf11+=','+_0x1e41fc[_0x085d('0x75')];}var _0x19f0c2=this[_0x085d('0xb')][_0x085d('0x53')](_0x085d('0xa6'),_0x2abf11);if(_0x19f0c2['result']===-0x1){return _0x19f0c2;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2abf11));};AGIVertices['prototype'][_0x085d('0xc2')]=function(_0x2660f3){logger[_0x085d('0x2c')](util['format'](_0x085d('0xc3'),_0x2660f3[_0x085d('0x34')]));if(!this['isConfigured'](_0x2660f3[_0x085d('0x58')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xa5'));}var _0x5a036b='\x22'+_0x2660f3[_0x085d('0x58')]+'\x22';if(this[_0x085d('0x83')](_0x2660f3[_0x085d('0x75')])){_0x5a036b+=','+_0x2660f3[_0x085d('0x75')];}var _0x499198=this[_0x085d('0xb')][_0x085d('0x53')](_0x085d('0xa6'),_0x5a036b);if(_0x499198[_0x085d('0xa0')]===-0x1){return _0x499198;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xa8'),_0x5a036b));};AGIVertices['prototype']['lumenvoxasr']=function(_0x40547f){logger[_0x085d('0x2c')](util['format'](_0x085d('0xc4'),_0x40547f[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x40547f[_0x085d('0xab')])){return this[_0x085d('0xb')]['noop'](_0x085d('0xac'));}var _0x5f508d=_0x40547f['grammar'];if(this[_0x085d('0x83')](_0x40547f['options'])){_0x5f508d+=','+_0x40547f[_0x085d('0x75')];}var _0x40653d=this[_0x085d('0xb')][_0x085d('0x53')]('MRCPRecog',_0x5f508d);if(_0x40653d['result']===-0x1){return _0x40653d;}var _0x48b748=this[_0x085d('0x9f')](_0x085d('0xae'),_0x085d('0xc5'));if(_0x48b748[_0x085d('0xa0')]===-0x1){return _0x48b748;}var _0x4878f2=this[_0x085d('0x9f')](_0x085d('0xc6'),_0x085d('0xc7'));if(_0x4878f2[_0x085d('0xa0')]===-0x1){return _0x4878f2;}var _0x570366=this[_0x085d('0x9f')](_0x085d('0xc8'),_0x085d('0xc9'));if(_0x570366[_0x085d('0xa0')]===-0x1){return _0x570366;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xb2'),_0x5f508d));};AGIVertices[_0x085d('0xe')]['sestekasr']=function(_0x11e9ac){logger['info'](util[_0x085d('0x4f')](_0x085d('0xca'),_0x11e9ac[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x11e9ac['grammar'])){return this[_0x085d('0xb')][_0x085d('0xa7')]('no\x20grammar\x20configured');}var _0x50dd9b=_0x11e9ac[_0x085d('0xab')];if(this['isConfigured'](_0x11e9ac['options'])){_0x50dd9b+=','+_0x11e9ac['options'];}var _0x420686=this[_0x085d('0xb')][_0x085d('0x53')]('MRCPRecog',_0x50dd9b);if(_0x420686['result']===-0x1){return _0x420686;}var _0x5d417d=this[_0x085d('0x9f')](_0x085d('0xae'),_0x085d('0xcb'));if(_0x5d417d[_0x085d('0xa0')]===-0x1){return _0x5d417d;}var _0x2d2ee4=this['getAndSetVariable'](_0x085d('0xc6'),_0x085d('0xcc'));if(_0x2d2ee4[_0x085d('0xa0')]===-0x1){return _0x2d2ee4;}var _0x263f19=this['getAndSetVariable'](_0x085d('0xc8'),_0x085d('0xcd'));if(_0x263f19['result']===-0x1){return _0x263f19;}return this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0xb2'),_0x50dd9b));};AGIVertices['prototype']['database']=function(_0xf57977){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0xce'),_0xf57977[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0xf57977[_0x085d('0xcf')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0xf57977,_0x085d('0xd0'));}var _0x4fd3be=this[_0x085d('0x18')][_0x085d('0x6c')](this,_0xf57977[_0x085d('0xcf')]);if(!_0x4fd3be){return this['channel'][_0x085d('0x2a')](_0xf57977,_0x085d('0xd1'));}if(!this[_0x085d('0x83')](_0xf57977['query'])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0xf57977,_0x085d('0xd2'));}var _0x4de652=_0xf57977['query'][_0x085d('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0xd3'),_0x4de652));var _0x197187=this[_0x085d('0xd4')][_0x085d('0x6c')](this,_0x4fd3be,_0x4de652);this[_0x085d('0x32')][_0x085d('0x6c')](this,_0xf57977,_0x4de652);if(!this[_0x085d('0x83')](_0xf57977[_0x085d('0xd5')])){return this[_0x085d('0xb')]['noop'](_0x085d('0xd6'));}var _0x2db634=this[_0x085d('0xf')][_0x085d('0x6c')](this,_0xf57977[_0x085d('0xd5')]);if(!_0x2db634){return this[_0x085d('0xb')]['error'](_0xf57977,_0x085d('0xd7'));}var _0x561459=this;_0x197187['forEach'](function(_0x84749b,_0x109891){Object[_0x085d('0xd8')](_0x84749b)[_0x085d('0xd9')](function(_0x580315){_0x561459[_0x085d('0xb')][_0x085d('0x9b')](util['format'](_0x085d('0xda'),_0x2db634,_0x109891,_0x580315),_0x84749b[_0x580315]);});});this['channel'][_0x085d('0x9b')](util[_0x085d('0x4f')]('%s_ROWS_COUNT',_0x2db634),_0x197187['length']);return this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xdb'),_0x2db634));};AGIVertices['prototype'][_0x085d('0xdc')]=function(_0x31b17b){logger[_0x085d('0xdd')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x31b17b[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x31b17b[_0x085d('0xde')])){return this['channel'][_0x085d('0x2a')](_0x31b17b,_0x085d('0xdf'));}var _0xd95388=this[_0x085d('0x1a')][_0x085d('0x6c')](this,_0x31b17b['sip_id']);if(!_0xd95388){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x31b17b,_0x085d('0xe0'));}var _0x3f7591=this[_0x085d('0xb')][_0x085d('0x53')](_0x085d('0xe1'),[util[_0x085d('0x4f')](_0x085d('0xe2'),_0xd95388),_0x31b17b['timeout'],_0x31b17b[_0x085d('0xe3')],_0x31b17b[_0x085d('0x62')]]);if(_0x3f7591['result']===-0x1){return _0x3f7591;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xe4'),_0x085d('0xe1')));};AGIVertices[_0x085d('0xe')]['dialogflow']=function(_0x45942b){logger['info'](util['format'](_0x085d('0xe5'),_0x45942b['label']));if(!this['isConfigured'](_0x45942b[_0x085d('0x7f')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xe6'));}if(!this[_0x085d('0x83')](_0x45942b[_0x085d('0x58')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xa5'));}this[_0x085d('0xb')][_0x085d('0xe7')]=!![];this[_0x085d('0x32')](_0x45942b);this[_0x085d('0x3c')](_0x45942b[_0x085d('0x58')],'in','','');this['channel']['noop'](util['format'](_0x085d('0xe8'),_0x45942b['text']));var _0x5247b1=this[_0x085d('0x76')][_0x085d('0x6c')](this,_0x45942b);if(_0x5247b1){for(var _0x2509ff in _0x5247b1){if(_0x5247b1[_0x085d('0x92')](_0x2509ff)){this['channel'][_0x085d('0x9b')](util['format'](_0x085d('0xe9'),_0x2509ff['toUpperCase']()),_0x5247b1[_0x2509ff]);}}this['createSquareMessage'](_0x5247b1[_0x085d('0xea')],'out',_0x085d('0xeb'),'');return this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xec'),_0x5247b1[_0x085d('0xea')]));}return this[_0x085d('0xb')][_0x085d('0x2a')](_0x45942b,_0x085d('0xed'));};AGIVertices[_0x085d('0xe')][_0x085d('0xee')]=function(_0x1b57eb){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0xef'),_0x1b57eb['label']));if(!this[_0x085d('0x83')](_0x1b57eb[_0x085d('0x79')])){return this['channel'][_0x085d('0xa7')]('no\x20project_id\x20configured');}if(!this[_0x085d('0x83')](_0x1b57eb['client_email'])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xf0'));}if(!this['isConfigured'](_0x1b57eb['private_key'])){return this['channel'][_0x085d('0xa7')](_0x085d('0xf1'));}if(!this['isConfigured'](_0x1b57eb[_0x085d('0x7c')])){return this['channel']['noop'](_0x085d('0xf2'));}if(!this[_0x085d('0x83')](_0x1b57eb[_0x085d('0x58')])){return this['channel'][_0x085d('0xa7')](_0x085d('0xa5'));}this[_0x085d('0xb')][_0x085d('0xe7')]=!![];this[_0x085d('0x32')](_0x1b57eb);this[_0x085d('0x3c')](_0x1b57eb[_0x085d('0x58')],'in','','');this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xf3'),_0x1b57eb[_0x085d('0x58')]));var _0x5719d1=this[_0x085d('0x78')][_0x085d('0x6c')](this,_0x1b57eb);if(_0x5719d1){for(var _0x314052 in _0x5719d1){if(_0x5719d1['hasOwnProperty'](_0x314052)){if(_0x314052!=='providerResponse'){this['channel'][_0x085d('0x9b')](util[_0x085d('0x4f')]('DIALOGFLOW_%s',_0x314052[_0x085d('0xf4')]()),_0x5719d1[_0x314052]);}}}this[_0x085d('0x3c')](_0x5719d1['speech'],_0x085d('0xf5'),_0x085d('0xee'),_0x5719d1[_0x085d('0xf6')]);return this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xf7'),_0x5719d1[_0x085d('0xea')]));}return this[_0x085d('0xb')][_0x085d('0x2a')](_0x1b57eb,_0x085d('0xf8'));};AGIVertices[_0x085d('0xe')][_0x085d('0xf9')]=function(_0x34f743){logger['info'](util[_0x085d('0x4f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x34f743['label']));if(!this[_0x085d('0x83')](_0x34f743[_0x085d('0xfa')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xfb'));}if(!this[_0x085d('0x83')](_0x34f743[_0x085d('0xfc')])){return this['channel'][_0x085d('0xa7')](_0x085d('0xfd'));}if(!this[_0x085d('0x83')](_0x34f743[_0x085d('0xfe')])){return this[_0x085d('0xb')][_0x085d('0xa7')]('no\x20password\x20configured');}if(!this[_0x085d('0x83')](_0x34f743[_0x085d('0xff')])){return this[_0x085d('0xb')]['noop'](_0x085d('0xa5'));}this[_0x085d('0xb')][_0x085d('0xe7')]=!![];this[_0x085d('0x32')](_0x34f743);this[_0x085d('0x3c')](_0x34f743['text'],'in','','');this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x100'),_0x34f743['text']));var _0x3b5ba4=this[_0x085d('0x7d')][_0x085d('0x6c')](this,_0x34f743);if(_0x3b5ba4){for(var _0x560587 in _0x3b5ba4){if(_0x3b5ba4[_0x085d('0x92')](_0x560587)){this[_0x085d('0xb')][_0x085d('0x9b')](util[_0x085d('0x4f')](_0x085d('0x101'),_0x560587['toUpperCase']()),_0x3b5ba4[_0x560587]);}}this['createSquareMessage'](_0x3b5ba4[_0x085d('0xea')],_0x085d('0xf5'),'sesteknda','');if(_0x3b5ba4['audiofile']){this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0x102'),_0x3b5ba4[_0x085d('0x103')]));var _0x1d9b8e=this[_0x085d('0xb')][_0x085d('0x104')](_0x3b5ba4[_0x085d('0x103')]);try{fs['unlink'](_0x3b5ba4[_0x085d('0x103')]+_0x085d('0x105'));}catch(_0x56f5c5){logger[_0x085d('0x2a')](_0x56f5c5);}return _0x1d9b8e;}else{return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')]('SestekNDA\x20Result\x20%s',_0x3b5ba4[_0x085d('0xea')]));}}return this[_0x085d('0xb')][_0x085d('0x2a')](_0x34f743,_0x085d('0x106'));};AGIVertices[_0x085d('0xe')][_0x085d('0x107')]=function(_0x460610){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x108'),_0x460610['label']));return this[_0x085d('0xb')]['noop'](_0x085d('0x107'));};AGIVertices[_0x085d('0xe')][_0x085d('0x109')]=function(_0x209d48){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x10a'),_0x209d48[_0x085d('0x34')]));var _0x57c4a4='';if(_0x209d48[_0x085d('0x10b')]){if(!this[_0x085d('0x83')](_0x209d48[_0x085d('0x10b')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x209d48,_0x085d('0x10c'));}else{var _0x3463a4=parseInt(_0x209d48[_0x085d('0x10b')],0xa);if(isNaN(_0x3463a4)){_0x57c4a4=_0x209d48[_0x085d('0x10b')];}else{_0x57c4a4=this[_0x085d('0x1c')][_0x085d('0x6c')](this,_0x209d48[_0x085d('0x10b')]);if(!_0x57c4a4){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x209d48,_0x085d('0x10d'));}}}}else if(_0x209d48[_0x085d('0x10e')]){_0x57c4a4=_0x209d48['trunk_name'];}else{return this[_0x085d('0xb')][_0x085d('0x2a')](_0x209d48,'no\x20trunk\x20selected');}var _0x33a322=this[_0x085d('0xb')]['exec'](_0x085d('0xe1'),[util[_0x085d('0x4f')]('SIP/%s/%s',_0x57c4a4,_0x209d48[_0x085d('0x41')]),_0x209d48[_0x085d('0x63')],_0x209d48['opts'],_0x209d48['url']]);if(_0x33a322[_0x085d('0xa0')]===-0x1){return _0x33a322;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0xe4'),_0x085d('0xe1')));};AGIVertices[_0x085d('0xe')]['finally']=function(_0xab3aac){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x10f'),_0xab3aac[_0x085d('0x34')]));return this['channel'][_0x085d('0xa7')]('finally');};AGIVertices[_0x085d('0xe')][_0x085d('0x110')]=function(_0x521eb2){logger['info'](util[_0x085d('0x4f')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x521eb2[_0x085d('0x34')]));if(_0x521eb2[_0x085d('0xa3')]===0x0){return this[_0x085d('0xa2')](_0x521eb2);}_0x521eb2[_0x085d('0xa3')]-=0x1;if(!this[_0x085d('0x83')](_0x521eb2['file_id'])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x521eb2,'no\x20file\x20audio\x20selected');}var _0x326943=this['getSound']['sync'](this,_0x521eb2['file_id']);if(!_0x326943){return this['channel'][_0x085d('0x2a')](_0x521eb2,'no\x20file\x20audio\x20found');}if(!this[_0x085d('0x83')](_0x521eb2[_0x085d('0xd5')])){return this[_0x085d('0xb')][_0x085d('0x2a')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x31911d=this[_0x085d('0xb')][_0x085d('0x111')](_0x326943,_0x521eb2[_0x085d('0x112')],_0x521eb2[_0x085d('0x113')]);var _0x5a1fb4=_0x31911d[_0x085d('0xa0')]?_0x31911d['result']['toString']():'';logger['info'](_0x085d('0x114'),JSON[_0x085d('0x9c')](_0x31911d));if(_0x31911d[_0x085d('0xa0')]===-0x1){this[_0x085d('0x32')][_0x085d('0x6c')](this,_0x521eb2,_0x5a1fb4);return _0x31911d;}else if(_0x31911d[_0x085d('0x9e')]==='timeout'){_0x31911d[_0x085d('0xa0')]=_0x5a1fb4[_0x085d('0x9a')]>=parseInt(_0x521eb2[_0x085d('0x115')])?'x':'i';}else{_0x31911d[_0x085d('0xa0')]=_0x5a1fb4[_0x085d('0x9a')]>=parseInt(_0x521eb2['mindigit'])&&_0x5a1fb4[_0x085d('0x9a')]<=parseInt(_0x521eb2[_0x085d('0x113')])?'x':'i';}var _0x12c74f=this['getVariable'][_0x085d('0x6c')](this,_0x521eb2[_0x085d('0xd5')]);if(!_0x12c74f){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x521eb2,_0x085d('0xd7'));}this[_0x085d('0xb')][_0x085d('0x9b')](_0x12c74f,_0x5a1fb4);if(this[_0x085d('0x83')](_0x521eb2['hiddendigitsnum'])){var _0x24f5a1=parseInt(_0x521eb2[_0x085d('0x116')],0xa);var _0x48e749=rs[_0x085d('0x117')]({'charset':'*','length':_0x24f5a1});var _0x2af835=_0x5a1fb4[_0x085d('0x9a')];if(_0x2af835>0x0){if(_0x2af835>_0x24f5a1){this['createSquareDetailsReport'][_0x085d('0x6c')](this,_0x521eb2,_0x521eb2[_0x085d('0x118')]==='first'?_0x48e749+_0x5a1fb4[_0x085d('0x119')](_0x24f5a1):_0x5a1fb4[_0x085d('0x119')](0x0,_0x2af835-_0x24f5a1)+_0x48e749);}else{this[_0x085d('0x32')][_0x085d('0x6c')](this,_0x521eb2,rs['generate']({'charset':'*','length':_0x2af835}));}}else{this[_0x085d('0x32')]['sync'](this,_0x521eb2,'');}}else{this[_0x085d('0x32')]['sync'](this,_0x521eb2,_0x5a1fb4);}return _0x31911d;};AGIVertices['prototype'][_0x085d('0xa')]=function(_0xffd5d3){logger[_0x085d('0x2c')](util['format'](_0x085d('0x11a'),_0xffd5d3[_0x085d('0x34')]));return this['getdigits'](_0xffd5d3);};AGIVertices['prototype'][_0x085d('0x11b')]=function(_0x1f31ac){logger['info'](util[_0x085d('0x4f')](_0x085d('0x11c'),_0x1f31ac[_0x085d('0x34')]));this['createSquareDetailsReport']['sync'](this,_0x1f31ac,_0x1f31ac[_0x085d('0x11d')]);return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x11e'),_0x1f31ac[_0x085d('0x11d')]));};AGIVertices[_0x085d('0xe')][_0x085d('0x11f')]=function(_0x22789a){logger['info'](util['format'](_0x085d('0x120'),_0x22789a[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x22789a['aws_access_key_id'])||!this[_0x085d('0x83')](_0x22789a[_0x085d('0x87')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0x121'));}if(!this['isConfigured'](_0x22789a[_0x085d('0x58')])){return this[_0x085d('0xb')]['noop']('no\x20text\x20configured');}this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x122'),_0x22789a[_0x085d('0x58')]));var _0x13d2f9=this[_0x085d('0x85')][_0x085d('0x6c')](this,_0x22789a);if(_0x13d2f9){this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x123'),_0x13d2f9));var _0x59b54b=this['channel'][_0x085d('0x104')](_0x13d2f9);try{fs['unlink'](_0x13d2f9+_0x085d('0x105'));}catch(_0x2b69f9){logger[_0x085d('0x2a')](_0x2b69f9);}return _0x59b54b;}return this['channel'][_0x085d('0x2a')](_0x22789a,_0x085d('0x124'));};AGIVertices['prototype']['awslex']=function(_0x2c4d68){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x125'),_0x2c4d68[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x2c4d68[_0x085d('0x86')])||!this[_0x085d('0x83')](_0x2c4d68[_0x085d('0x87')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0x121'));}if(!this[_0x085d('0x83')](_0x2c4d68[_0x085d('0x8a')])){return this[_0x085d('0xb')]['noop'](_0x085d('0x126'));}if(!this[_0x085d('0x83')](_0x2c4d68[_0x085d('0x58')])){return this['channel'][_0x085d('0xa7')](_0x085d('0xa5'));}this[_0x085d('0xb')][_0x085d('0xe7')]=!![];this[_0x085d('0x32')](_0x2c4d68);this['createSquareMessage'](_0x2c4d68[_0x085d('0x58')],'in','','');this['channel'][_0x085d('0xa7')](util['format'](_0x085d('0x127'),_0x2c4d68[_0x085d('0x58')]));var _0xaa768a=this[_0x085d('0x89')]['sync'](this,_0x2c4d68);if(_0xaa768a){for(var _0x4b2d8a in _0xaa768a){if(_0xaa768a[_0x085d('0x92')](_0x4b2d8a)&&_[_0x085d('0x93')](_0xaa768a[_0x4b2d8a])){this[_0x085d('0xb')][_0x085d('0x9b')](util[_0x085d('0x4f')](_0x085d('0x128'),_0x4b2d8a[_0x085d('0xf4')]()),_0xaa768a[_0x4b2d8a]);}}if(_[_0x085d('0x3f')](_0xaa768a[_0x085d('0x73')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0x129'));}else{this['createSquareMessage'](_0xaa768a[_0x085d('0x73')],_0x085d('0xf5'),'amazonlex','');return this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')]('Amazon\x20Lex\x20Result\x20%s',_0xaa768a[_0x085d('0x73')]));}}return this['channel'][_0x085d('0x2a')](_0x2c4d68,_0x085d('0x12a'));};AGIVertices[_0x085d('0xe')][_0x085d('0x12b')]=function(_0x5395d4){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x12c'),_0x5395d4[_0x085d('0x34')],_0x5395d4[_0x085d('0x63')]));if(!this[_0x085d('0x83')](_0x5395d4['key'])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xe6'));}var _0x5f19a8=_0x085d('0x12d');var _0x3ec20c=util[_0x085d('0x4f')]('%s/recordings/%s',FILES_PATH,rs[_0x085d('0x117')](0x4));var _0x4797af=util['format'](_0x085d('0x99'),_0x3ec20c,_0x5f19a8);var _0xf89dcf=!![];if(_0x5395d4[_0x085d('0x12e')]===_0x085d('0x12f')){_0xf89dcf=![];}var _0x34f54c=this[_0x085d('0xb')][_0x085d('0x130')](_0x3ec20c,_0x5f19a8,_0x5395d4[_0x085d('0x131')],_0x5395d4['timeout'],undefined,_0xf89dcf);if(_0x34f54c['result']!==-0x1){this[_0x085d('0xb')][_0x085d('0xa7')](util['format'](_0x085d('0x132'),_0x4797af));var _0x1e3d0d=this[_0x085d('0x8b')][_0x085d('0x6c')](this,_0x5395d4,_0x4797af);if(_0x1e3d0d){for(var _0x24130d in _0x1e3d0d){if(_0x1e3d0d['hasOwnProperty'](_0x24130d)){this['channel'][_0x085d('0x9b')](util['format'](_0x085d('0x133'),_0x24130d[_0x085d('0xf4')]()),_0x1e3d0d[_0x24130d]);}}return this['channel']['noop'](util['format'](_0x085d('0x134'),JSON[_0x085d('0x9c')](_0x1e3d0d)));}}return _0x34f54c;};AGIVertices[_0x085d('0xe')][_0x085d('0x135')]=function(_0x427580){logger['info'](util[_0x085d('0x4f')](_0x085d('0x136'),_0x427580[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x427580['appid'])){return this['channel']['noop'](_0x085d('0x137'));}if(!this[_0x085d('0x83')](_0x427580[_0x085d('0x8f')])){return this['channel'][_0x085d('0xa7')](_0x085d('0x138'));}var _0x1723ac=_0x085d('0x12d');var _0xe84e8f=util[_0x085d('0x4f')](_0x085d('0x139'),FILES_PATH,rs['generate'](0x4));var _0x34f8c7=util[_0x085d('0x4f')]('%s.%s',_0xe84e8f,_0x1723ac);var _0x44fa89=!![];if(_0x427580[_0x085d('0x12e')]===_0x085d('0x12f')){_0x44fa89=![];}var _0x57d168=this[_0x085d('0xb')][_0x085d('0x130')](_0xe84e8f,_0x1723ac,_0x427580[_0x085d('0x131')],_0x427580[_0x085d('0x63')],undefined,_0x44fa89);if(_0x57d168[_0x085d('0xa0')]!==-0x1){this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0x13a'),_0x34f8c7));var _0x5eb0ca=this[_0x085d('0x8d')][_0x085d('0x6c')](this,_0x427580,_0x34f8c7);if(_0x5eb0ca){for(var _0x581fb7 in _0x5eb0ca){if(_0x5eb0ca[_0x085d('0x92')](_0x581fb7)){this['channel'][_0x085d('0x9b')](util[_0x085d('0x4f')](_0x085d('0x13b'),_0x581fb7['toUpperCase']()),_0x5eb0ca[_0x581fb7]);}}return this['channel']['noop'](util[_0x085d('0x4f')](_0x085d('0x13c'),JSON['stringify'](_0x5eb0ca)));}}return _0x57d168;};AGIVertices[_0x085d('0xe')][_0x085d('0x13d')]=function(_0x15e583){logger['info'](util[_0x085d('0x4f')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x15e583[_0x085d('0x34')]));return this[_0x085d('0xb')]['continueAt'](_0x15e583[_0x085d('0x3a')],_0x15e583[_0x085d('0x13e')],_0x15e583['priority']);};AGIVertices[_0x085d('0xe')][_0x085d('0x13f')]=function(_0x191ede){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x140'),_0x191ede[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x191ede[_0x085d('0x141')])){return this[_0x085d('0xb')]['error'](_0x191ede,'no\x20condition\x20configured');}try{var _0xc69d72=eval(_0x191ede[_0x085d('0x141')])?_0x085d('0x142'):_0x085d('0x143');this[_0x085d('0xb')][_0x085d('0xa7')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x191ede[_0x085d('0x141')],_0xc69d72));return{'code':0xc8,'result':_0xc69d72};}catch(_0x3749b1){return{'code':0xc8,'result':_0x085d('0x143')};}};AGIVertices['prototype'][_0x085d('0x144')]=function(_0x39dc53){logger['info'](util[_0x085d('0x4f')](_0x085d('0x145'),_0x39dc53[_0x085d('0x34')]));if(!this['isConfigured'](_0x39dc53['interval_id'])){return this['channel'][_0x085d('0x2a')](_0x39dc53,_0x085d('0x146'));}var _0x9b90dd=this['getIntervals']['sync'](this,_0x39dc53[_0x085d('0x147')]);if(!_0x9b90dd){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x39dc53,_0x085d('0x148'));}for(var _0x37ce54=0x0;_0x37ce54<_0x9b90dd[_0x085d('0x9a')];_0x37ce54+=0x1){var _0x1ff642=this[_0x085d('0xb')]['getVariable'](util[_0x085d('0x4f')](_0x085d('0x149'),_0x9b90dd[_0x37ce54]));if(_0x1ff642[_0x085d('0xa0')]===-0x1){return _0x1ff642;}logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x14a'),_0x9b90dd[_0x37ce54],_0x1ff642[_0x085d('0x9e')]));if(_0x1ff642[_0x085d('0x9e')]==='true'){logger[_0x085d('0x2c')](util['format'](_0x085d('0x14a'),_0x9b90dd[_0x37ce54],'true'));this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')]('IFTIME\x20%s\x20%s',_0x9b90dd[_0x37ce54],_0x085d('0x142')));return{'code':0xc8,'result':_0x085d('0x142')};}else{logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x14a'),_0x9b90dd[_0x37ce54],'false'));this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x14a'),_0x9b90dd[_0x37ce54],_0x085d('0x143')));}}return{'code':0xc8,'result':_0x085d('0x143')};};AGIVertices['prototype'][_0x085d('0x14b')]=function(_0x3f20ce){logger['info'](util[_0x085d('0x4f')](_0x085d('0x14c'),_0x3f20ce[_0x085d('0x34')]));return this[_0x085d('0xb')][_0x085d('0x14b')]();};AGIVertices['prototype'][_0x085d('0x14d')]=function(_0x540fe6){logger[_0x085d('0x2c')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x540fe6[_0x085d('0x34')]));if(!this['isConfigured'](_0x540fe6['key'])){return this['channel']['noop'](_0x085d('0xe6'));}var _0x1c3fc6=_0x085d('0x12d');var _0x3bf595=util[_0x085d('0x4f')](_0x085d('0x139'),FILES_PATH,rs[_0x085d('0x117')](0x4));var _0x4c355b=util['format'](_0x085d('0x99'),_0x3bf595,_0x1c3fc6);var _0x501685=!![];if(_0x540fe6[_0x085d('0x12e')]==='NOBEEP'){_0x501685=![];}var _0x42771a=this[_0x085d('0xb')]['recordFile'](_0x3bf595,_0x1c3fc6,_0x540fe6[_0x085d('0x131')],_0x540fe6[_0x085d('0x63')],undefined,_0x501685);if(_0x42771a['result']!==-0x1){this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x14e'),_0x4c355b));var _0x4faeea=this[_0x085d('0x81')]['sync'](this,_0x540fe6,_0x4c355b);if(_0x4faeea){for(var _0xa54e4 in _0x4faeea){if(_0x4faeea[_0x085d('0x92')](_0xa54e4)){this['channel'][_0x085d('0x9b')](util[_0x085d('0x4f')](_0x085d('0x14f'),_0xa54e4[_0x085d('0xf4')]()),_0x4faeea[_0xa54e4]);}}return this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x150'),JSON[_0x085d('0x9c')](_0x4faeea)));}}return _0x42771a;};AGIVertices[_0x085d('0xe')][_0x085d('0x151')]=function(_0x240b22){logger['info'](util[_0x085d('0x4f')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x240b22[_0x085d('0x34')]));if(!this['isConfigured'](_0x240b22['key'])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xe6'));}if(!this['isConfigured'](_0x240b22[_0x085d('0x58')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xa5'));}this['channel'][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x152'),_0x240b22[_0x085d('0x58')]));var _0x223eac=this['ispeechTTS'][_0x085d('0x6c')](this,_0x240b22);if(_0x223eac){this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0x14e'),_0x223eac));var _0x958554=this['channel'][_0x085d('0x104')](_0x223eac,_0x240b22[_0x085d('0x131')]);try{fs['unlink'](_0x223eac+'.wav');}catch(_0x3e95f8){logger[_0x085d('0x2a')](_0x3e95f8);}return _0x958554;}return this['channel'][_0x085d('0x2a')](_0x240b22,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x085d('0x153')]=function(_0x245065){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x154'),_0x245065[_0x085d('0x34')]));if(!this['isConfigured'](_0x245065['findBy'])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x245065,'no\x20find\x20by\x20configured');}logger[_0x085d('0x2c')](util['format'](_0x085d('0x155'),this['channel']['callerid'],_0x245065[_0x085d('0x156')]));var _0x51bcdf=this[_0x085d('0x4e')][_0x085d('0x6c')](this,_0x245065[_0x085d('0x156')]);if(_0x51bcdf){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x157'),this['channel'][_0x085d('0x37')],_0x245065['findBy']));this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x157'),this['channel'][_0x085d('0x37')],_0x245065[_0x085d('0x156')]));return{'code':0xc8,'result':_0x085d('0x158')};}else{logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x159'),this[_0x085d('0xb')]['callerid'],_0x245065[_0x085d('0x156')]));this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x159'),this['channel'][_0x085d('0x37')],_0x245065[_0x085d('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x085d('0xe')]['logout']=function(_0x49253a){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x15a'),_0x49253a[_0x085d('0x34')]));if(!this['isConfigured'](_0x49253a['findBy'])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x49253a,_0x085d('0x15b'));}logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x155'),this['channel']['callerid'],_0x49253a[_0x085d('0x156')]));var _0x4d4c72=this[_0x085d('0x4d')][_0x085d('0x6c')](this,_0x49253a[_0x085d('0x156')]);if(_0x4d4c72){logger[_0x085d('0x2c')](util[_0x085d('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x085d('0xb')]['callerid'],_0x49253a['findBy']));this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x157'),this[_0x085d('0xb')][_0x085d('0x37')],_0x49253a['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x159'),this['channel'][_0x085d('0x37')],_0x49253a[_0x085d('0x156')]));this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0x159'),this[_0x085d('0xb')][_0x085d('0x37')],_0x49253a['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x4500c2){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x15c'),_0x4500c2[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x4500c2[_0x085d('0x15d')])){return this[_0x085d('0xb')]['error'](_0x4500c2,_0x085d('0x15e'));}this[_0x085d('0xb')]['noop'](util['format'](_0x085d('0x15f'),_0x4500c2[_0x085d('0x15d')]));var _0x4be882=eval(_0x4500c2[_0x085d('0x15d')]);if(!this[_0x085d('0x83')](_0x4500c2[_0x085d('0xd5')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xd6'));}var _0x3e2c35=this[_0x085d('0xf')][_0x085d('0x6c')](this,_0x4500c2[_0x085d('0xd5')]);if(!_0x3e2c35){return this[_0x085d('0xb')]['error'](_0x4500c2,_0x085d('0xd7'));}if(_[_0x085d('0x97')](_0x4be882)){var _0x45867c=this;_0x4be882[_0x085d('0xd9')](function(_0x379ef3,_0x1076b7){_0x45867c['channel']['setVariable'](util[_0x085d('0x4f')](_0x085d('0x160'),_0x3e2c35,_0x1076b7),_0x379ef3);});return this[_0x085d('0xb')][_0x085d('0xa7')](util['format']('variable\x20%s[key]\x20set',_0x3e2c35));}else{return this[_0x085d('0xb')][_0x085d('0x9b')](_0x3e2c35,_0x4be882);}};AGIVertices['prototype'][_0x085d('0x9')]=function(_0x2a5db8){logger['info'](util[_0x085d('0x4f')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2a5db8['label']));if(_0x2a5db8[_0x085d('0xa3')]===0x0){return this['maxRetry'](_0x2a5db8);}_0x2a5db8['retry']-=0x1;if(!this[_0x085d('0x83')](_0x2a5db8['file_id'])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x2a5db8,'no\x20file\x20audio\x20selected');}var _0x236df7=this['getSound'][_0x085d('0x6c')](this,_0x2a5db8[_0x085d('0x161')]);if(!_0x236df7){return this['channel'][_0x085d('0x2a')](_0x2a5db8,_0x085d('0x162'));}var _0x4bfab9=this[_0x085d('0xb')]['getData'](_0x236df7,_0x2a5db8[_0x085d('0x112')],_0x2a5db8[_0x085d('0x163')]);var _0x5dfa44=_0x4bfab9['result'];if(_0x4bfab9[_0x085d('0xa0')]===-0x1){this[_0x085d('0x32')][_0x085d('0x6c')](this,_0x2a5db8,'-1');return _0x4bfab9;}else if(_0x4bfab9[_0x085d('0x9e')]===_0x085d('0x63')){_0x4bfab9[_0x085d('0xa0')]=_0x4bfab9[_0x085d('0xa0')][_0x085d('0x9a')]>0x0?_0x4bfab9[_0x085d('0xa0')]:'t';}else if(_[_0x085d('0x3e')](_0x4bfab9[_0x085d('0xa0')])){_0x4bfab9[_0x085d('0xa0')]='#';_0x5dfa44='#';}if(!this[_0x085d('0x83')](_0x2a5db8[_0x085d('0xd5')])){this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xd6'));}else{var _0x540739=this[_0x085d('0xf')][_0x085d('0x6c')](this,_0x2a5db8[_0x085d('0xd5')]);if(!_0x540739){return this['channel'][_0x085d('0x2a')](_0x2a5db8,_0x085d('0xd7'));}this[_0x085d('0xb')][_0x085d('0x9b')](_0x540739,_0x5dfa44);}this['createSquareDetailsReport'][_0x085d('0x6c')](this,_0x2a5db8,_0x5dfa44);return _0x4bfab9;};AGIVertices[_0x085d('0xe')][_0x085d('0xa7')]=function(_0x561c47){logger['info'](util[_0x085d('0x4f')](_0x085d('0x164'),_0x561c47[_0x085d('0x34')]));return this[_0x085d('0xb')][_0x085d('0xa7')](_0x561c47[_0x085d('0x165')]||_0x561c47[_0x085d('0x34')]);};AGIVertices['prototype']['pause']=function(_0x48e207){logger['info'](util[_0x085d('0x4f')](_0x085d('0x166'),_0x48e207['label']));if(!this[_0x085d('0x83')](_0x48e207[_0x085d('0x156')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x48e207,_0x085d('0x15b'));}logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x155'),this['channel'][_0x085d('0x37')],_0x48e207[_0x085d('0x156')]));var _0x5eaae6=this[_0x085d('0x48')][_0x085d('0x6c')](this,_0x48e207[_0x085d('0x167')]);var _0xc47f55=this[_0x085d('0x4b')][_0x085d('0x6c')](this,_0x48e207[_0x085d('0x156')],_0x5eaae6);if(_0xc47f55){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x157'),this['channel'][_0x085d('0x37')],_0x48e207[_0x085d('0x156')]));this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x085d('0x37')],_0x48e207[_0x085d('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x159'),this['channel'][_0x085d('0x37')],_0x48e207[_0x085d('0x156')]));this[_0x085d('0xb')][_0x085d('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x085d('0xb')][_0x085d('0x37')],_0x48e207[_0x085d('0x156')]));return{'code':0xc8,'result':_0x085d('0x168')};}};AGIVertices['prototype'][_0x085d('0x169')]=function(_0x4d44cb){logger['info'](util['format'](_0x085d('0x16a'),_0x4d44cb[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x4d44cb[_0x085d('0x161')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x4d44cb,'no\x20file\x20audio\x20selected');}var _0x19bfb9=this['getSound'][_0x085d('0x6c')](this,_0x4d44cb[_0x085d('0x161')]);if(!_0x19bfb9){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x4d44cb,_0x085d('0x162'));}var _0x24f08c=this[_0x085d('0xb')][_0x085d('0x53')](_0x085d('0x16b'),[_0x19bfb9,_0x4d44cb['opts']]);if(_0x24f08c[_0x085d('0xa0')]===-0x1){return _0x24f08c;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x16c'),_0x085d('0x16b'),_0x19bfb9));};AGIVertices[_0x085d('0xe')][_0x085d('0x16d')]=function(_0x20fae5){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x16e'),_0x20fae5[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0x20fae5[_0x085d('0x16f')])){return this[_0x085d('0xb')]['error'](_0x20fae5,_0x085d('0x170'));}var _0x14d947='';var _0x13e677=parseInt(_0x20fae5[_0x085d('0x16f')],0xa);if(isNaN(_0x13e677)){_0x14d947=_0x20fae5[_0x085d('0x16f')];}else{_0x14d947=this['getVoiceQueue']['sync'](this,_0x20fae5[_0x085d('0x16f')]);if(!_0x14d947){return this['channel'][_0x085d('0x2a')](_0x20fae5,'no\x20queue\x20found');}}var _0x48cece='';if(this[_0x085d('0x83')](_0x20fae5[_0x085d('0x161')])){var _0x3f042b=this[_0x085d('0x171')][_0x085d('0x6c')](this,_0x20fae5['file_id']);if(_0x3f042b){_0x48cece=_0x3f042b;}}this[_0x085d('0x32')]['sync'](this,_0x20fae5,_0x14d947);if(_0x20fae5[_0x085d('0xe3')]['indexOf']('x')<0x0){_0x20fae5['opts']+='x';}if(_0x20fae5[_0x085d('0xe3')][_0x085d('0x172')]('X')<0x0){_0x20fae5[_0x085d('0xe3')]+='X';}this[_0x085d('0xb')][_0x085d('0x9b')](_0x085d('0x173'),_0x14d947?_0x14d947['toLowerCase']():'');var _0x39f705=this[_0x085d('0xb')]['exec'](_0x085d('0x174'),[_0x14d947,_0x20fae5[_0x085d('0xe3')],_0x20fae5[_0x085d('0x62')],_0x48cece,_0x20fae5[_0x085d('0x63')],_0x20fae5[_0x085d('0x5')],_0x20fae5[_0x085d('0x175')],_0x20fae5[_0x085d('0x176')],'',_0x20fae5['position']]);if(_0x39f705['result']===-0x1){return _0x39f705;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x16c'),_0x085d('0x174'),_0x14d947));};AGIVertices['prototype'][_0x085d('0x177')]=function(_0x11cc7d){logger['info'](util[_0x085d('0x4f')](_0x085d('0x178'),_0x11cc7d[_0x085d('0x34')]));var _0x1caae4=_0x11cc7d[_0x085d('0x179')]||_0x085d('0x12d');var _0x2e0713=util[_0x085d('0x4f')](_0x085d('0x17a'),this[_0x085d('0xb')]['uniqueid'],rs['generate'](0x5));var _0x32e28d=util[_0x085d('0x4f')](_0x085d('0x17b'),FILES_PATH,_0x2e0713,_0x1caae4);var _0x26ca77=util[_0x085d('0x4f')]('%s/recordings/%s',FILES_PATH,_0x2e0713);this[_0x085d('0x38')]['sync'](this,_0x11cc7d,_0x2e0713,_0x32e28d);this[_0x085d('0xb')][_0x085d('0x9b')](_0x085d('0x17c'),_0x2e0713);logger[_0x085d('0x2c')](_0x085d('0x17d'),_0x26ca77,_0x1caae4,_0x11cc7d[_0x085d('0x17e')],_0x11cc7d[_0x085d('0x63')]);return this[_0x085d('0xb')][_0x085d('0x130')](_0x26ca77,_0x1caae4,_0x11cc7d[_0x085d('0x17e')],_0x11cc7d['timeout'],undefined,!![]);};AGIVertices[_0x085d('0xe')][_0x085d('0x17f')]=function(_0x493e90){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x180'),_0x493e90['label']));if(!this['isConfigured'](_0x493e90['url'])){return this['channel'][_0x085d('0xa7')]('no\x20url\x20configured');}var _0x87b154=this[_0x085d('0x61')][_0x085d('0x6c')](this,_0x493e90);logger['info'](util[_0x085d('0x4f')](_0x085d('0x181'),util[_0x085d('0x182')](_0x87b154,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x493e90['variable_id'])){return this[_0x085d('0xb')][_0x085d('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x21f699=this[_0x085d('0xf')][_0x085d('0x6c')](this,_0x493e90['variable_id']);if(!_0x21f699){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x493e90,'no\x20variable\x20found');}this[_0x085d('0xb')][_0x085d('0x9b')](util[_0x085d('0x4f')](_0x085d('0x183'),_0x21f699),_0x87b154[_0x085d('0x71')]?_0x87b154[_0x085d('0x71')]:_0x085d('0x184'));this[_0x085d('0xb')][_0x085d('0x9b')](util[_0x085d('0x4f')](_0x085d('0x185'),_0x21f699),_0x87b154[_0x085d('0x72')]?_0x87b154['statusMessage']:'OK');if(_0x87b154['body']){try{this['saveRestApiResult'](_0x87b154[_0x085d('0x6f')],_0x21f699);}catch(_0x13ccbe){logger[_0x085d('0x2a')](util[_0x085d('0x4f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x21f699));}}return this[_0x085d('0xb')][_0x085d('0xa7')](util['format'](_0x085d('0xdb'),_0x21f699));};AGIVertices[_0x085d('0xe')][_0x085d('0x186')]=function(_0x36951b){logger[_0x085d('0x2c')](util[_0x085d('0x4f')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x36951b['label']));return this[_0x085d('0xb')][_0x085d('0x187')](_0x36951b['digits'][_0x085d('0x55')](/\s+/g,''),_0x36951b['escape_digits']);};AGIVertices[_0x085d('0xe')][_0x085d('0x188')]=function(_0x30ed34){logger[_0x085d('0x2c')](util[_0x085d('0x4f')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x30ed34[_0x085d('0x34')]));return this[_0x085d('0xb')][_0x085d('0x189')](_0x30ed34[_0x085d('0x64')][_0x085d('0x55')](/\s+/g,''),_0x30ed34[_0x085d('0x17e')]);};AGIVertices['prototype'][_0x085d('0x18a')]=function(_0x1c8911){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x18b'),_0x1c8911[_0x085d('0x34')]));return this[_0x085d('0xb')]['sayPhonetic'](_0x1c8911[_0x085d('0x58')],_0x1c8911[_0x085d('0x17e')]);};AGIVertices[_0x085d('0xe')]['sendMail']=function(_0x77809e){logger['info'](util[_0x085d('0x4f')](_0x085d('0x18c'),_0x77809e[_0x085d('0x34')]));if(!this['isConfigured'](_0x77809e[_0x085d('0x18d')])){return this[_0x085d('0xb')]['noop'](_0x085d('0x18e'));}var _0x5e5aa8=this[_0x085d('0x18f')][_0x085d('0x6c')](this,_0x77809e[_0x085d('0x18d')]);if(!_0x5e5aa8||!_0x5e5aa8[_0x085d('0x190')]){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x77809e,_0x085d('0x191'));}var _0x4d7b56={'from':util[_0x085d('0x4f')](_0x085d('0x192'),_0x5e5aa8[_0x085d('0x12')],_0x5e5aa8[_0x085d('0x193')]||_0x5e5aa8[_0x085d('0x190')][_0x085d('0x194')]),'to':_0x77809e['to']||'','cc':_0x77809e['cc']||'','bcc':_0x77809e[_0x085d('0x195')]||'','subject':_0x77809e['subject'],'html':_0x77809e[_0x085d('0x58')],'text':_0x77809e[_0x085d('0x58')]};if(this[_0x085d('0x83')](_0x77809e[_0x085d('0x196')])){}logger[_0x085d('0xdd')]('sendMail\x20message',JSON[_0x085d('0x9c')](_0x4d7b56));this['createSquareDetailsReport']['sync'](this,_0x77809e,_0x77809e[_0x085d('0x18d')]);this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x197'),_0x5e5aa8[_0x085d('0x12')]));this[_0x085d('0x21')][_0x085d('0x6c')](this,_0x5e5aa8[_0x085d('0x198')],_0x4d7b56);return this['channel']['noop'](_0x085d('0x199'));};AGIVertices['prototype'][_0x085d('0x19a')]=function(_0x645845){logger[_0x085d('0x2c')](util[_0x085d('0x4f')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x645845['label']));return this['channel'][_0x085d('0xa7')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x085d('0xe')]['sendSMS']=function(_0x770b1){logger['info'](util['format'](_0x085d('0x19b'),_0x770b1['label']));if(!this['isConfigured'](_0x770b1[_0x085d('0x19c')])){return this['channel'][_0x085d('0xa7')](_0x085d('0x19d'));}var _0x553ea2=this['getSmsAccount']['sync'](this,_0x770b1[_0x085d('0x19c')]);if(!_0x553ea2){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x770b1,_0x085d('0x19e'));}var _0x3e6b68={'body':_0x770b1[_0x085d('0x19f')],'phone':_0x770b1['to']||'','SmsAccountId':_0x553ea2['id']};logger[_0x085d('0xdd')](_0x085d('0x1a0'),JSON['stringify'](_0x3e6b68));this[_0x085d('0x32')][_0x085d('0x6c')](this,_0x770b1,_0x770b1[_0x085d('0x19c')]);this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0x1a1'),_0x553ea2['name']));this[_0x085d('0x31')][_0x085d('0x6c')](this,_0x3e6b68);return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0x1a2'));};AGIVertices[_0x085d('0xe')][_0x085d('0x1a3')]=function(_0xf60363){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x1a4'),_0xf60363['label']));if(!this[_0x085d('0x83')](_0xf60363[_0x085d('0xd5')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0xf60363,'no\x20variable\x20selected');}var _0x5c40b4=this[_0x085d('0xf')][_0x085d('0x6c')](this,_0xf60363[_0x085d('0xd5')]);if(!_0x5c40b4){return this['channel']['error'](_0xf60363,_0x085d('0xd7'));}return this[_0x085d('0xb')]['setVariable'](_0x5c40b4,_0xf60363['variable_value']);};AGIVertices[_0x085d('0xe')][_0x085d('0x1a5')]=function(_0x5d2c8f){logger[_0x085d('0x2c')](util[_0x085d('0x4f')]('Enter\x20in\x20START\x20(%s)\x20block',_0x5d2c8f[_0x085d('0x34')]));this['channel'][_0x085d('0xa7')](_0x085d('0x1a6'));var _0x488fec=this[_0x085d('0xb')][_0x085d('0xf')](_0x085d('0x1a7'));if(!_[_0x085d('0x3e')](_0x488fec['extra'])){this['channel'][_0x085d('0x33')]=_0x488fec[_0x085d('0x9e')];}if(_0x5d2c8f[_0x085d('0xb8')]===_0x085d('0x1a8')){this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0x1a9'));return this[_0x085d('0xb')]['answer']();}return this[_0x085d('0xb')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x085d('0x1aa')]=function(_0x2ba2cb){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x1ab'),_0x2ba2cb['label']));if(!this[_0x085d('0x83')](_0x2ba2cb[_0x085d('0x1ac')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x2ba2cb,_0x085d('0x1ad'));}var _0x4768e0=this[_0x085d('0x16')][_0x085d('0x6c')](this,_0x2ba2cb[_0x085d('0x1ac')]);if(!this[_0x085d('0x83')](_0x4768e0)){return this['channel']['error'](_0x2ba2cb,util[_0x085d('0x4f')](_0x085d('0x1ae'),_0x2ba2cb[_0x085d('0x1ac')]));}if(_0x4768e0===this[_0x085d('0xb')]['arg_1']){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x2ba2cb,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport']['sync'](this,_0x2ba2cb,_0x4768e0);var _0x32cb65=this[_0x085d('0xb')][_0x085d('0x53')](_0x085d('0x1af'),util[_0x085d('0x4f')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x085d('0x1b0')]||_0x085d('0x1b1'),_0x4768e0,this['channel'][_0x085d('0x36')]));if(_0x32cb65[_0x085d('0xa0')]===-0x1){return _0x32cb65;}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x16c'),'AGI',_0x4768e0));};AGIVertices[_0x085d('0xe')]['system']=function(_0x272a05){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x1b2'),_0x272a05[_0x085d('0x34')]));var _0x4c56a5=this[_0x085d('0x52')][_0x085d('0x6c')](this,_0x272a05[_0x085d('0xb4')]);this[_0x085d('0x32')][_0x085d('0x6c')](this,_0x272a05,_0x272a05[_0x085d('0xb4')]);if(this[_0x085d('0x83')](_0x272a05[_0x085d('0xd5')])){var _0x2f9d57=this[_0x085d('0xf')]['sync'](this,_0x272a05[_0x085d('0xd5')]);if(_0x2f9d57){this[_0x085d('0xb')][_0x085d('0x9b')](_0x2f9d57,_0x4c56a5);return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x1b3'),_0x272a05[_0x085d('0xb4')],_0x2f9d57));}}return this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x272a05['command']));};AGIVertices[_0x085d('0xe')][_0x085d('0x1b4')]=function(_0xa6c18b){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x1b5'),_0xa6c18b[_0x085d('0x34')]));_0xa6c18b[_0x085d('0x58')]=_0xa6c18b[_0x085d('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x085d('0x83')](_0xa6c18b['apiKey'])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0x1b6'));}if(!this['isConfigured'](_0xa6c18b['text'])){return this['channel'][_0x085d('0xa7')](_0x085d('0xa5'));}this[_0x085d('0xb')][_0x085d('0xa7')](util['format'](_0x085d('0x1b7'),_0xa6c18b[_0x085d('0x58')]));var _0x1ae2d9=this[_0x085d('0x56')][_0x085d('0x6c')](this,_0xa6c18b);if(_0x1ae2d9){this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x1b8'),_0x1ae2d9));var _0x37fe94=this['channel'][_0x085d('0x104')](_0x1ae2d9);try{fs[_0x085d('0x1b9')](_0x1ae2d9+_0x085d('0x105'));}catch(_0x2e6597){logger[_0x085d('0x2a')](_0x2e6597);}return _0x37fe94;}return this[_0x085d('0xb')][_0x085d('0x2a')](_0xa6c18b,_0x085d('0x1ba'));};AGIVertices[_0x085d('0xe')][_0x085d('0x1bb')]=function(_0x5ac6fd){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x1bc'),_0x5ac6fd[_0x085d('0x34')]));_0x5ac6fd[_0x085d('0x58')]=_0x5ac6fd[_0x085d('0x58')][_0x085d('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5ac6fd[_0x085d('0x58')])){return this[_0x085d('0xb')][_0x085d('0xa7')](_0x085d('0xa5'));}this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')](_0x085d('0x1bd'),_0x5ac6fd['text']));var _0x3c033f=this[_0x085d('0x5f')]['sync'](this,_0x5ac6fd);if(_0x3c033f){this['channel']['noop'](util[_0x085d('0x4f')](_0x085d('0x1be'),_0x3c033f));var _0x5909ef=this[_0x085d('0xb')]['streamFile'](_0x3c033f);try{fs['unlink'](_0x3c033f+_0x085d('0x105'));}catch(_0x530123){logger['error'](_0x530123);}return _0x5909ef;}return this[_0x085d('0xb')][_0x085d('0x2a')](_0x5ac6fd,_0x085d('0x1bf'));};AGIVertices[_0x085d('0xe')][_0x085d('0x1c0')]=function(_0x2c4b74){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x1c1'),_0x2c4b74['label']));if(!this[_0x085d('0x83')](_0x2c4b74[_0x085d('0x156')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0x2c4b74,_0x085d('0x15b'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x085d('0xb')]['callerid'],_0x2c4b74[_0x085d('0x156')]));var _0x19d18b=this[_0x085d('0x4c')][_0x085d('0x6c')](this,_0x2c4b74['findBy']);if(_0x19d18b){logger[_0x085d('0x2c')](util[_0x085d('0x4f')](_0x085d('0x157'),this[_0x085d('0xb')][_0x085d('0x37')],_0x2c4b74['findBy']));this[_0x085d('0xb')]['noop'](util[_0x085d('0x4f')](_0x085d('0x157'),this[_0x085d('0xb')]['callerid'],_0x2c4b74[_0x085d('0x156')]));return{'code':0xc8,'result':_0x085d('0x158')};}else{logger['info'](util[_0x085d('0x4f')](_0x085d('0x159'),this[_0x085d('0xb')][_0x085d('0x37')],_0x2c4b74[_0x085d('0x156')]));this[_0x085d('0xb')][_0x085d('0xa7')](util[_0x085d('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x085d('0xb')]['callerid'],_0x2c4b74[_0x085d('0x156')]));return{'code':0xc8,'result':_0x085d('0x168')};}};AGIVertices[_0x085d('0xe')]['voicemail']=function(_0x1b9c79){logger['info'](util['format'](_0x085d('0x1c2'),_0x1b9c79[_0x085d('0x34')]));var _0x5c0b37=this[_0x085d('0xb')]['exec'](_0x085d('0x1c3'),[_0x1b9c79['mailbox'],_0x1b9c79['options']]);if(_0x5c0b37[_0x085d('0xa0')]===-0x1){return _0x5c0b37;}return this[_0x085d('0xb')][_0x085d('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x085d('0x1c3'),_0x1b9c79['mailbox']));};AGIVertices[_0x085d('0xe')][_0x085d('0x1c4')]=function(_0xb5c65){logger[_0x085d('0x2c')](util['format'](_0x085d('0x1c5'),_0xb5c65[_0x085d('0x34')]));if(!this[_0x085d('0x83')](_0xb5c65[_0x085d('0xd5')])){return this[_0x085d('0xb')][_0x085d('0x2a')](_0xb5c65,'no\x20variable\x20selected');}var _0xe7420e=this['getVariable'][_0x085d('0x6c')](this,_0xb5c65[_0x085d('0xd5')]);if(!_0xe7420e){return this[_0x085d('0xb')]['error'](_0xb5c65,_0x085d('0xd7'));}var _0x32b128=this['channel'][_0x085d('0xf')](_0xe7420e);return{'code':0xc8,'result':_0x32b128[_0x085d('0x9e')]?_0x32b128[_0x085d('0x9e')]:'-'};};String[_0x085d('0xe')][_0x085d('0x1c6')]=function(_0x2467ab,_0x47e6fb){return this[_0x085d('0x9d')](_0x2467ab)['join'](_0x47e6fb);};module[_0x085d('0x1c7')]=AGIVertices; \ No newline at end of file +var _0x08d9=['Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20selected','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','NOBEEP','recordFile','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','no\x20key\x20configured','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','failure','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','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','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','no\x20subproject\x20selected','getSquareProject','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','host','127.0.0.1','AGI','system','shellCommand','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','shelljs','randomstring','moment','mustache','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','map','Intervals','interval','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','extension','priority','file','createCmContact','isEmpty','callback_','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','isNil','agentUnpause','agentLogout','internal','LOCAL','agentLogin','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appsecret','clear','includes','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','getVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','result','MRCP_RECOG_CONFIDENCE','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','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','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','bot','createSquareMessage','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url'];(function(_0xd14ea2,_0x407488){var _0x9527a3=function(_0x3e53d3){while(--_0x3e53d3){_0xd14ea2['push'](_0xd14ea2['shift']());}};_0x9527a3(++_0x407488);}(_0x08d9,0xc2));var _0x908d=function(_0x54f220,_0x31abcd){_0x54f220=_0x54f220-0x0;var _0x55073b=_0x08d9[_0x54f220];return _0x55073b;};'use strict';var fs=require('fs');var util=require(_0x908d('0x0'));var _=require('lodash');var sh=require(_0x908d('0x1'));var odbc=require('odbc')();var rs=require(_0x908d('0x2'));var moment=require(_0x908d('0x3'));var Mustache=require(_0x908d('0x4'));var rp=require('request-promise');var logger=require('../../config/logger')(_0x908d('0x5'));var config=require(_0x908d('0x6'));var scripts=require(_0x908d('0x7'));var FILES_PATH=_0x908d('0x8');var recursiveMapAttributes=[_0x908d('0x9'),'rawBody'];var verticesWithRetry=[_0x908d('0xa'),_0x908d('0xb'),_0x908d('0xc')];var AGIVertices=function(_0x2b5bad,_0x30bbd6,_0x44b888){this[_0x908d('0xd')]=_0x2b5bad;this[_0x908d('0xe')]=_0x30bbd6;this[_0x908d('0xf')]=_0x44b888;};AGIVertices[_0x908d('0x10')]['getVariable']=function(_0x938950,_0x1a1666){this[_0x908d('0xe')][_0x908d('0x11')](_0x938950)[_0x908d('0x12')](function(_0x4ecbf7){_0x1a1666(null,_0x4ecbf7?_0x4ecbf7['name']:![]);})['catch'](function(_0x3213df){_0x1a1666(_0x3213df);});};AGIVertices[_0x908d('0x10')][_0x908d('0x13')]=function(_0x23d6c8,_0x2e1a77){this[_0x908d('0xe')][_0x908d('0x14')](_0x23d6c8)['then'](function(_0x508b2e){_0x2e1a77(null,_0x508b2e?_0x508b2e[_0x908d('0x15')]:![]);})[_0x908d('0x16')](function(_0x178809){_0x2e1a77(_0x178809);});};AGIVertices[_0x908d('0x10')]['getSquareProject']=function(_0x4c56f2,_0x16895a){this[_0x908d('0xe')][_0x908d('0x17')](_0x4c56f2)[_0x908d('0x12')](function(_0x4cc9ba){_0x16895a(null,_0x4cc9ba?_0x4cc9ba[_0x908d('0x15')]:![]);})[_0x908d('0x16')](function(_0x3dea46){_0x16895a(_0x3dea46);});};AGIVertices[_0x908d('0x10')][_0x908d('0x18')]=function(_0x1c3d3c,_0x10137f){this['rpc'][_0x908d('0x19')](_0x1c3d3c)[_0x908d('0x12')](function(_0x46dd69){_0x10137f(null,_0x46dd69?_0x46dd69['dsn']:![]);})[_0x908d('0x16')](function(_0x126eaa){_0x10137f(_0x126eaa);});};AGIVertices[_0x908d('0x10')][_0x908d('0x1a')]=function(_0x3969d7,_0x53d9bb){this[_0x908d('0xe')]['getUserById'](_0x3969d7)[_0x908d('0x12')](function(_0x10148){_0x53d9bb(null,_0x10148?_0x10148[_0x908d('0x15')]:![]);})[_0x908d('0x16')](function(_0x43492b){_0x53d9bb(_0x43492b);});};AGIVertices[_0x908d('0x10')][_0x908d('0x1b')]=function(_0x3c68e0,_0x509105){this[_0x908d('0xe')][_0x908d('0x1c')](_0x3c68e0)[_0x908d('0x12')](function(_0x269e36){_0x509105(null,_0x269e36?_0x269e36[_0x908d('0x15')]:![]);})['catch'](function(_0x5cd721){_0x509105(_0x5cd721);});};AGIVertices[_0x908d('0x10')][_0x908d('0x1d')]=function(_0x41ca76,_0x40e8bc){var _0x35e70d=this;this['rpc'][_0x908d('0x1e')](_0x41ca76)[_0x908d('0x12')](function(_0x5f529e){_0x40e8bc(null,_0x5f529e?_0x35e70d[_0x908d('0x1f')](_0x5f529e[_0x908d('0x20')]):![]);})[_0x908d('0x16')](function(_0x44b7a5){_0x40e8bc(_0x44b7a5);});};AGIVertices[_0x908d('0x10')][_0x908d('0x21')]=function(_0x29418b,_0x7a0d41){this[_0x908d('0xe')][_0x908d('0x22')](_0x29418b)[_0x908d('0x12')](function(_0x4828e4){_0x7a0d41(null,_0x4828e4?_0x4828e4:![]);})[_0x908d('0x16')](function(_0x2f00ff){_0x7a0d41(_0x2f00ff);});};AGIVertices[_0x908d('0x10')][_0x908d('0x23')]=function(_0x4e44b6,_0x28f130,_0x22e8dd){this[_0x908d('0xf')][_0x908d('0x23')](_0x4e44b6,_0x28f130)[_0x908d('0x12')](function(){_0x22e8dd(null);})[_0x908d('0x16')](function(_0x235203){_0x22e8dd(_0x235203);});};AGIVertices[_0x908d('0x10')][_0x908d('0x24')]=function(_0x3890da,_0xe49bb8){this['rpc']['getIntervalById'](_0x3890da)[_0x908d('0x12')](function(_0x9eb272){if(_0x9eb272){if(_0x9eb272['IntervalId']){_0xe49bb8(null,[_0x9eb272['interval']]);}else{_0xe49bb8(null,_[_0x908d('0x25')](_0x9eb272[_0x908d('0x26')],_0x908d('0x27')));}}else{_0xe49bb8(null,![]);}})[_0x908d('0x16')](function(_0x1ebb8f){_0xe49bb8(_0x1ebb8f);});};AGIVertices['prototype'][_0x908d('0x1f')]=function(_0x17cbee){return util[_0x908d('0x28')](_0x908d('0x29'),FILES_PATH,_0x17cbee);};AGIVertices[_0x908d('0x10')]['getQueryOdbc']=function(_0x5e626e,_0x1a3b7d,_0x522ef1){odbc[_0x908d('0x2a')](_0x5e626e,function(_0x28768b){if(_0x28768b){logger[_0x908d('0x2b')](_0x908d('0x2c'),_0x28768b);_0x522ef1(_0x28768b);}else{logger[_0x908d('0x2d')](_0x908d('0x2e'));odbc[_0x908d('0x2f')](_0x1a3b7d,function(_0x2f8216,_0x47e985){if(_0x2f8216){logger['info'](_0x908d('0x30'),_0x1a3b7d);_0x522ef1(_0x2f8216);}else{logger[_0x908d('0x2d')](_0x908d('0x31'),_0x1a3b7d);odbc['close'](function(_0x48544e){if(_0x48544e){logger['error'](_0x908d('0x32'),_0x48544e);}_0x522ef1(null,_0x47e985);});}});}});};AGIVertices['prototype'][_0x908d('0x33')]=function(_0x10667b,_0x1dd840){this['rpc']['getSmsAccountById'](_0x10667b)['then'](function(_0x1c14fb){_0x1dd840(null,_0x1c14fb?_0x1c14fb:![]);})[_0x908d('0x16')](function(_0x59073d){_0x1dd840(_0x59073d);});};AGIVertices[_0x908d('0x10')]['createSmsMessage']=function(_0x929529,_0x13b5d7){this[_0x908d('0xe')]['createSmsMessage'](_0x929529)[_0x908d('0x12')](function(_0x375d21){_0x13b5d7(null,_0x375d21);})[_0x908d('0x16')](function(_0x3399e7){_0x13b5d7(_0x3399e7);});};AGIVertices['prototype'][_0x908d('0x34')]=function(_0x1a518d,_0x1c5910,_0x1eddf3){this[_0x908d('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x908d('0xd')][_0x908d('0x35')],'node':_0x1a518d[_0x908d('0x36')],'application':_0x1a518d[_0x908d('0x37')],'data':_0x1c5910||null,'project_name':this[_0x908d('0xd')][_0x908d('0x38')],'callerid':this['channel']['callerid']})[_0x908d('0x12')](function(_0x5556af){if(_0x1eddf3){_0x1eddf3(null,_0x5556af);}})[_0x908d('0x16')](function(_0x1ab59a){if(_0x1eddf3){_0x1eddf3(_0x1ab59a);}});};AGIVertices['prototype'][_0x908d('0x39')]=function(_0x1baf68,_0x53dccb,_0x47b978,_0x245fa8){this[_0x908d('0xe')][_0x908d('0x39')]({'uniqueid':this['channel'][_0x908d('0x35')],'callerid':this['channel'][_0x908d('0x3a')],'calleridname':this[_0x908d('0xd')]['calleridname'],'context':this[_0x908d('0xd')]['context'],'extension':this['channel'][_0x908d('0x3b')],'priority':this[_0x908d('0xd')][_0x908d('0x3c')],'accountcode':this[_0x908d('0xd')]['accountcode'],'dnid':this['channel']['dnid'],'projectName':this[_0x908d('0xd')][_0x908d('0x38')],'saveName':_0x53dccb,'filename':_0x1baf68[_0x908d('0x3d')]||_0x53dccb,'savePath':_0x47b978})[_0x908d('0x12')](function(_0x44d091){_0x245fa8(null,_0x44d091);})[_0x908d('0x16')](function(_0x3f5d4f){_0x245fa8(_0x3f5d4f);});};AGIVertices[_0x908d('0x10')]['createSquareMessage']=function(_0x2c7ba3,_0x5c4105,_0xcabdb6,_0xf541e5,_0x192554){this[_0x908d('0xe')]['createSquareMessage']({'uniqueid':this['channel'][_0x908d('0x35')],'body':_0x2c7ba3,'direction':_0x5c4105,'providerName':_0xcabdb6,'providerResponse':_0xf541e5})[_0x908d('0x12')](function(_0xe24937){if(_0x192554){_0x192554(null,_0xe24937);}})[_0x908d('0x16')](function(_0x29d1ea){if(_0x192554){_0x192554(_0x29d1ea);}});};AGIVertices[_0x908d('0x10')][_0x908d('0x3e')]=function(_0x40615b,_0x176039){this[_0x908d('0xe')]['createCmContact']({'firstName':_[_0x908d('0x3f')](_0x40615b[_0x908d('0x15')])||_['isNil'](_0x40615b['name'])?_0x908d('0x40')+Math['random']():_0x40615b[_0x908d('0x15')],'lastName':_[_0x908d('0x3f')](_0x40615b['lastName'])||_['isNil'](_0x40615b[_0x908d('0x41')])?null:_0x40615b[_0x908d('0x41')],'phone':_0x40615b['phone'],'ListId':_0x40615b[_0x908d('0x42')],'scheduledat':_0x40615b[_0x908d('0x43')],'callbackUniqueid':this[_0x908d('0xd')][_0x908d('0x35')],'tags':_0x908d('0x44'),'description':_0x908d('0x45')+_0x40615b[_0x908d('0x43')][_0x908d('0x46')](),'priority':_0x40615b[_0x908d('0x47')]})[_0x908d('0x12')](function(_0x106320){_0x176039(null,_0x106320);})[_0x908d('0x16')](function(_0x488a80){_0x176039(_0x488a80);});};AGIVertices['prototype'][_0x908d('0x48')]=function(_0x5dcc5b,_0x1471cd){this[_0x908d('0xe')][_0x908d('0x49')](_0x5dcc5b)[_0x908d('0x12')](function(_0x3e959b){_0x1471cd(null,_0x3e959b?_0x3e959b[_0x908d('0x15')]:![]);})[_0x908d('0x16')](function(_0x403136){_0x1471cd(_0x403136);});};AGIVertices[_0x908d('0x10')][_0x908d('0x4a')]=function(_0x491953,_0x11d6f9,_0x1de835){var _0x3a3cd9={'role':_0x908d('0x4b')};_0x3a3cd9[_0x491953]=this[_0x908d('0xd')][_0x908d('0x3a')];this['rpc'][_0x908d('0x4a')](_0x3a3cd9,_0x11d6f9,this['channel'][_0x908d('0x35')])[_0x908d('0x12')](function(_0x23fe9a){_0x1de835(null,_[_0x908d('0x4c')](_0x23fe9a)?![]:!![]);})[_0x908d('0x16')](function(_0x9eec01){logger['error'](_0x9eec01);_0x1de835(null,![]);});};AGIVertices[_0x908d('0x10')][_0x908d('0x4d')]=function(_0x3bf30c,_0x24c79d){var _0x421274={'role':_0x908d('0x4b')};_0x421274[_0x3bf30c]=this['channel'][_0x908d('0x3a')];this[_0x908d('0xe')][_0x908d('0x4d')](_0x421274)['then'](function(_0x590368){_0x24c79d(null,_['isNil'](_0x590368)?![]:!![]);})['catch'](function(_0x154484){logger[_0x908d('0x2b')](_0x154484);_0x24c79d(null,![]);});};AGIVertices[_0x908d('0x10')][_0x908d('0x4e')]=function(_0x1e4ed0,_0x18b5fd){var _0x11bf76={'role':_0x908d('0x4b')};_0x11bf76[_0x1e4ed0]=this[_0x908d('0xd')][_0x908d('0x3a')];this['rpc'][_0x908d('0x4e')](_0x11bf76)[_0x908d('0x12')](function(_0x383355){_0x18b5fd(null,_[_0x908d('0x4c')](_0x383355)?![]:!![]);})[_0x908d('0x16')](function(_0x2cbb28){logger[_0x908d('0x2b')](_0x2cbb28);_0x18b5fd(null,![]);});};AGIVertices[_0x908d('0x10')]['agentLogin']=function(_0x927733,_0x12b880){var _0x444209={'role':_0x908d('0x4b')};_0x444209[_0x927733]=this[_0x908d('0xd')][_0x908d('0x3a')];var _0x491e21=_0x927733!=_0x908d('0x4f')?util[_0x908d('0x28')]('%s/%s@from-sip/n',_0x908d('0x50'),this[_0x908d('0xd')][_0x908d('0x3a')]):undefined;this['rpc'][_0x908d('0x51')](_0x444209,_0x491e21)[_0x908d('0x12')](function(_0x5dee6e){_0x12b880(null,_[_0x908d('0x4c')](_0x5dee6e)?![]:!![]);})['catch'](function(_0x526319){logger[_0x908d('0x2b')](_0x526319);_0x12b880(null,![]);});};AGIVertices[_0x908d('0x10')]['shellCommand']=function(_0x3bcfa1,_0xc179eb){sh[_0x908d('0x52')](_[_0x908d('0x53')](_0x3bcfa1),function(_0xa2a963,_0x1375ca){var _0x1bdbea=_0x1375ca[_0x908d('0x54')](/(\r\n|\n|\r)/gm,'');_0xc179eb(null,_0x1bdbea);});};AGIVertices[_0x908d('0x10')][_0x908d('0x55')]=function(_0x203404,_0x41ef83){scripts[_0x908d('0x55')](_0x203404[_0x908d('0x56')],_0x203404[_0x908d('0x57')]||_0x908d('0x58'),_0x203404['text'],_0x203404[_0x908d('0x59')]||'en-US',_0x203404[_0x908d('0x5a')]||'MALE',_0x203404[_0x908d('0x5b')]||_0x908d('0x5c'))['then'](function(_0xd3718e){_0x41ef83(null,_0xd3718e);})['catch'](function(_0x21fb82){_0x41ef83(_0x21fb82);});};AGIVertices[_0x908d('0x10')][_0x908d('0x5d')]=function(_0x4a1fe4,_0x5bcec1){scripts[_0x908d('0x5d')](_0x4a1fe4[_0x908d('0x58')],_0x4a1fe4[_0x908d('0x5e')]||'en',0x1)[_0x908d('0x12')](function(_0x3e0922){_0x5bcec1(null,_0x3e0922);})[_0x908d('0x16')](function(_0x2b7802){_0x5bcec1(_0x2b7802);});};AGIVertices['prototype'][_0x908d('0x5f')]=function(_0x3aa2a6,_0x31d4e9){var _0x35c028={'uri':_0x3aa2a6[_0x908d('0x60')],'method':_0x3aa2a6[_0x908d('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3aa2a6['timeout'])===_0x908d('0x62')&&parseInt(_0x3aa2a6[_0x908d('0x63')])>=0x1?parseInt(_0x3aa2a6[_0x908d('0x63')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x908d('0x64'),_0x908d('0x65')],_0x35c028[_0x908d('0x61')][_0x908d('0x66')]())){try{_0x35c028['body']=_0x3aa2a6['rawBody']?JSON[_0x908d('0x67')](_0x3aa2a6['rawBody']):{};}catch(_0x313d04){logger['error'](_0x908d('0x68'),_0x313d04);}}try{_0x35c028[_0x908d('0x69')]=_0x3aa2a6[_0x908d('0x9')]?JSON[_0x908d('0x67')](_0x3aa2a6[_0x908d('0x9')]):{};}catch(_0x23924a){logger[_0x908d('0x2b')](_0x908d('0x6a'),_0x23924a);}if(_0x3aa2a6[_0x908d('0x6b')]){try{var _0x49b490=require(_0x3aa2a6[_0x908d('0x6b')])[_0x908d('0x6c')](this,_0x35c028);_0x35c028[_0x908d('0x6d')]=Mustache[_0x908d('0x6e')](_0x3aa2a6[_0x908d('0x60')],_0x49b490,{},['$$','$$']);if(_0x35c028[_0x908d('0x69')]){_0x35c028['headers']=JSON['parse'](Mustache['render'](JSON[_0x908d('0x6f')](_0x35c028['headers']),_0x49b490,{},['$$','$$']));}if(_0x35c028[_0x908d('0x70')]){_0x35c028['body']=JSON[_0x908d('0x67')](Mustache['render'](JSON[_0x908d('0x6f')](_0x35c028[_0x908d('0x70')]),_0x49b490,{},['$$','$$']));}}catch(_0x31401f){logger[_0x908d('0x2b')](_0x908d('0x71'),_0x31401f);}}rp(_0x35c028)[_0x908d('0x12')](function(_0x177ee3){var _0x4f5efa={'statusCode':_0x177ee3[_0x908d('0x72')]||0xc8,'statusMessage':_0x177ee3['statusMessage']||'OK','headers':_0x177ee3[_0x908d('0x69')]||{},'body':_0x177ee3[_0x908d('0x70')]||{}};_0x31d4e9(null,_0x4f5efa);})[_0x908d('0x16')](function(_0xe6faa4){var _0x1aa433={'statusCode':_0xe6faa4['statusCode']||0x1f4,'statusMessage':_0xe6faa4['message']||_0x908d('0x73'),'headers':_0xe6faa4[_0x908d('0x74')][_0x908d('0x69')]||{},'body':_0xe6faa4[_0x908d('0x74')]['body']||{}};_0x31d4e9(null,_0x1aa433);});};AGIVertices[_0x908d('0x10')][_0x908d('0x75')]=function(_0xc2f39b,_0xde7683){scripts['googleDialogflow'](this[_0x908d('0xd')][_0x908d('0x35')],_0xc2f39b[_0x908d('0x76')],_0xc2f39b[_0x908d('0x58')],_0xc2f39b[_0x908d('0x77')]||'en')[_0x908d('0x12')](function(_0x474838){_0xde7683(null,_0x474838);})[_0x908d('0x16')](function(_0x1f1412){_0xde7683(_0x1f1412);});};AGIVertices['prototype'][_0x908d('0x78')]=function(_0xc9be1c,_0x3fbad0){scripts['googleDialogflowV2'](this[_0x908d('0xd')]['uniqueid'],_0xc9be1c[_0x908d('0x79')],_0xc9be1c[_0x908d('0x7a')],_0xc9be1c[_0x908d('0x7b')],_0xc9be1c[_0x908d('0x58')],_0xc9be1c[_0x908d('0x7c')]||'en')[_0x908d('0x12')](function(_0x5441ba){_0x3fbad0(null,_0x5441ba);})[_0x908d('0x16')](function(_0x173392){_0x3fbad0(_0x173392);});};AGIVertices[_0x908d('0x10')][_0x908d('0x7d')]=function(_0x378b70,_0x287869){scripts[_0x908d('0x7d')](this[_0x908d('0xd')],_0x378b70)[_0x908d('0x12')](function(_0xbe48ae){_0x287869(null,_0xbe48ae);})[_0x908d('0x16')](function(_0x278955){_0x287869(_0x278955);});};AGIVertices[_0x908d('0x10')]['ispeechTTS']=function(_0x463223,_0x1a3fd3){scripts[_0x908d('0x7e')](_0x463223[_0x908d('0x76')],_0x463223[_0x908d('0x58')],_0x463223[_0x908d('0x7f')]||_0x908d('0x80'),_0x463223['speed'])[_0x908d('0x12')](function(_0x49bb97){_0x1a3fd3(null,_0x49bb97);})[_0x908d('0x16')](function(_0x517586){_0x1a3fd3(_0x517586);});};AGIVertices[_0x908d('0x10')][_0x908d('0x81')]=function(_0x4a0b13,_0x3bb8d7,_0x144934){scripts[_0x908d('0x81')](_0x3bb8d7,_0x4a0b13[_0x908d('0x76')],_0x4a0b13[_0x908d('0x82')]||_0x908d('0x80'),this[_0x908d('0x83')](_0x4a0b13[_0x908d('0x84')])?_0x4a0b13[_0x908d('0x84')]:undefined)[_0x908d('0x12')](function(_0x50e621){_0x144934(null,_0x50e621);})[_0x908d('0x16')](function(_0xcb9437){_0x144934(_0xcb9437);});};AGIVertices[_0x908d('0x10')][_0x908d('0x85')]=function(_0x337bb3,_0x1af42d){scripts[_0x908d('0x85')](_0x337bb3[_0x908d('0x86')],_0x337bb3[_0x908d('0x87')],_0x337bb3[_0x908d('0x88')],_0x337bb3['aws_polly_voice']||_0x908d('0x89'),_0x337bb3[_0x908d('0x58')],_0x337bb3['aws_text_type']||_0x908d('0x58'))['then'](function(_0xb0e86c){_0x1af42d(null,_0xb0e86c);})[_0x908d('0x16')](function(_0x10468f){_0x1af42d(_0x10468f);});};AGIVertices[_0x908d('0x10')][_0x908d('0x8a')]=function(_0x312f1c,_0x2f8480){scripts[_0x908d('0x8a')](this['channel'][_0x908d('0x35')],_0x312f1c[_0x908d('0x86')],_0x312f1c[_0x908d('0x87')],_0x312f1c[_0x908d('0x8b')],_0x312f1c[_0x908d('0x58')],_0x312f1c[_0x908d('0x8c')])[_0x908d('0x12')](function(_0x4dd2ca){_0x2f8480(null,_0x4dd2ca);})['catch'](function(_0x425fda){_0x2f8480(_0x425fda);});};AGIVertices[_0x908d('0x10')][_0x908d('0x8d')]=function(_0x35ed11,_0x20f263,_0x1f74ce){scripts['googleASR'](_0x20f263,_0x35ed11[_0x908d('0x76')],_0x35ed11['google_asr_language']||'en-US')[_0x908d('0x12')](function(_0x5d4854){_0x1f74ce(null,_0x5d4854);})[_0x908d('0x16')](function(_0x254523){_0x1f74ce(_0x254523);});};AGIVertices[_0x908d('0x10')]['tildeASR']=function(_0x43deb0,_0x1be8c7,_0x111c29){scripts[_0x908d('0x8e')](_0x1be8c7,_0x43deb0['appid'],_0x43deb0[_0x908d('0x8f')],_0x43deb0[_0x908d('0x6d')])['then'](function(_0x2ee09b){_0x111c29(null,_0x2ee09b);})['catch'](function(_0x5d7389){_0x111c29(_0x5d7389);});};AGIVertices['prototype'][_0x908d('0x90')]=function(_0x10b2a2){var _0x2cfe60=_[_0x908d('0x91')](verticesWithRetry,_0x10b2a2[_0x908d('0x37')])?_0x10b2a2:_['clone'](_0x10b2a2);for(var _0x339c14 in _0x2cfe60){if(_0x2cfe60[_0x908d('0x92')](_0x339c14)){if(_0x2cfe60[_0x339c14]&&_[_0x908d('0x93')](_0x2cfe60[_0x339c14])){if(_['includes'](recursiveMapAttributes,_0x339c14)){_0x2cfe60[_0x339c14]=this[_0x908d('0x94')](_0x2cfe60[_0x339c14]);}else{_0x2cfe60[_0x339c14]=this[_0x908d('0x95')](_0x2cfe60[_0x339c14]);}}}}return _0x2cfe60;};AGIVertices[_0x908d('0x10')][_0x908d('0x96')]=function(_0x6cc3ac){for(var _0x17d332 in _0x6cc3ac){if(_0x6cc3ac[_0x908d('0x92')](_0x17d332)){if(_[_0x908d('0x97')](_0x6cc3ac[_0x17d332])){this[_0x908d('0x96')](_0x6cc3ac[_0x17d332]);}else if(_[_0x908d('0x98')](_0x6cc3ac[_0x17d332])){for(var _0x2a4ce6=0x0;_0x2a4ce6<_0x6cc3ac[_0x17d332][_0x908d('0x99')];_0x2a4ce6++){this[_0x908d('0x96')](_0x6cc3ac[_0x17d332][_0x2a4ce6]);}}else if(_[_0x908d('0x93')](_0x6cc3ac[_0x17d332])){_0x6cc3ac[_0x17d332]=this[_0x908d('0x95')](_0x6cc3ac[_0x17d332]);}}}};AGIVertices[_0x908d('0x10')][_0x908d('0x9a')]=function(_0x1f60e6,_0x43e9dd){for(var _0x210824 in _0x1f60e6){if(_0x1f60e6['hasOwnProperty'](_0x210824)){if(_[_0x908d('0x97')](_0x1f60e6[_0x210824])){if(!_['isEmpty'](_0x1f60e6[_0x210824])){this[_0x908d('0x9a')](_0x1f60e6[_0x210824],util['format'](_0x908d('0x9b'),_0x43e9dd,_0x210824));}}else if(_['isArray'](_0x1f60e6[_0x210824])){for(var _0x4c6d3d=0x0;_0x4c6d3d<_0x1f60e6[_0x210824]['length'];_0x4c6d3d++){this[_0x908d('0x9a')](_0x1f60e6[_0x210824][_0x4c6d3d],util[_0x908d('0x28')](_0x908d('0x9b'),_0x43e9dd,_0x210824+'['+_0x4c6d3d+']'));}}else{if(!_[_0x908d('0x4c')](_0x1f60e6[_0x210824])){this['channel'][_0x908d('0x9c')](util[_0x908d('0x28')]('%s.%s',_0x43e9dd,_0x210824),_0x1f60e6[_0x210824]);}}}}};AGIVertices[_0x908d('0x10')][_0x908d('0x94')]=function(_0x4bfd13){try{var _0x2ef543=JSON[_0x908d('0x67')](_0x4bfd13);this[_0x908d('0x96')](_0x2ef543);return JSON['stringify'](_0x2ef543);}catch(_0x1bd578){return this['replaceAllVariables'](_0x4bfd13);}};AGIVertices[_0x908d('0x10')][_0x908d('0x95')]=function(_0x2c804d){var _0x738549=_0x2c804d[_0x908d('0x9d')]('{');for(var _0x29c7dc=0x1;_0x29c7dc<_0x738549[_0x908d('0x99')];_0x29c7dc+=0x1){var _0x164fba=_0x738549[_0x29c7dc][_0x908d('0x9d')]('}');if(_0x164fba[_0x908d('0x99')]>0x1){_0x2c804d=_0x2c804d[_0x908d('0x9e')]('{'+_0x164fba[0x0]+'}',this[_0x908d('0xd')]['getVariable'](_0x164fba[0x0])[_0x908d('0x9f')]||_0x164fba[0x0]);}}if(_0x738549[_0x908d('0x99')]===0x1){return _0x2c804d[_0x908d('0x46')]();}return this[_0x908d('0x95')](_0x2c804d);};AGIVertices[_0x908d('0x10')][_0x908d('0xa0')]=function(_0x444ece,_0x1c308a){var _0x514c50=this[_0x908d('0xd')][_0x908d('0xa1')](_0x444ece);if(_0x514c50['result']===-0x1){return _0x514c50;}logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xa2'),_0x1c308a,_0x514c50['extra']));return this['channel'][_0x908d('0x9c')](_0x1c308a,_0x514c50['extra']);};AGIVertices[_0x908d('0x10')][_0x908d('0x83')]=function(_0x437c9c){return _0x437c9c&&_0x437c9c!=='0'&&_0x437c9c!=='-1'&&_0x437c9c!=='';};AGIVertices['prototype'][_0x908d('0xa3')]=function(_0x2a890c){this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x2a890c,'-');_0x2a890c[_0x908d('0xa4')]=_0x2a890c[_0x908d('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x908d('0x10')][_0x908d('0xa5')]=function(_0x285d1d){logger['info'](util[_0x908d('0x28')](_0x908d('0xa6'),_0x285d1d[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x285d1d[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xa8'));}var _0x3114ce='\x22'+_0x285d1d[_0x908d('0x58')]+'\x22';if(this[_0x908d('0x83')](_0x285d1d[_0x908d('0x74')])){_0x3114ce+=','+_0x285d1d[_0x908d('0x74')];}var _0x333d5b=this[_0x908d('0xd')][_0x908d('0x52')](_0x908d('0xa9'),_0x3114ce);if(_0x333d5b['result']===-0x1){return _0x333d5b;}return this[_0x908d('0xd')][_0x908d('0xa7')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x3114ce));};AGIVertices[_0x908d('0x10')][_0x908d('0xaa')]=function(_0x1db8d9){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xab'),_0x1db8d9['label']));if(!this[_0x908d('0x83')](_0x1db8d9[_0x908d('0xac')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20grammar\x20configured');}var _0x5baeef=_0x1db8d9[_0x908d('0xac')];if(this[_0x908d('0x83')](_0x1db8d9[_0x908d('0x74')])){_0x5baeef+=','+_0x1db8d9[_0x908d('0x74')];}var _0x510662=this['channel'][_0x908d('0x52')](_0x908d('0xad'),_0x5baeef);if(_0x510662[_0x908d('0xae')]===-0x1){return _0x510662;}var _0x442c9a=this[_0x908d('0xa0')]('RECOG_CONFIDENCE()',_0x908d('0xaf'));if(_0x442c9a[_0x908d('0xae')]===-0x1){return _0x442c9a;}var _0x2878be=this[_0x908d('0xa0')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x2878be['result']===-0x1){return _0x2878be;}var _0x13153f=this['getAndSetVariable'](_0x908d('0xb0'),_0x908d('0xb1'));if(_0x13153f[_0x908d('0xae')]===-0x1){return _0x13153f;}return this[_0x908d('0xd')][_0x908d('0xa7')](util['format'](_0x908d('0xb2'),_0x5baeef));};AGIVertices[_0x908d('0x10')][_0x908d('0x5')]=function(_0x1e73c8){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1e73c8[_0x908d('0x36')]));return this['channel'][_0x908d('0x5')]([_0x1e73c8['command'],_0x1e73c8['args']]);};AGIVertices['prototype']['answer']=function(_0x2f60d3){logger['info'](util[_0x908d('0x28')](_0x908d('0xb3'),_0x2f60d3[_0x908d('0x36')]));if(this[_0x908d('0x83')](_0x2f60d3['timeout'])){logger['info'](util[_0x908d('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2f60d3['timeout']));var _0x43ee91=this[_0x908d('0xd')][_0x908d('0xb4')](_0x2f60d3[_0x908d('0x63')]);if(_0x43ee91[_0x908d('0xae')]===-0x1){return _0x43ee91;}}return this[_0x908d('0xd')][_0x908d('0xb5')]();};AGIVertices[_0x908d('0x10')][_0x908d('0x44')]=function(_0x35648f){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xb6'),_0x35648f[_0x908d('0x36')]));if(!this['isConfigured'](_0x35648f[_0x908d('0x42')])){return this['channel'][_0x908d('0x2b')](_0x35648f,_0x908d('0xb7'));}_0x35648f[_0x908d('0x43')]=moment();if(this[_0x908d('0x83')](_0x35648f[_0x908d('0xb8')])){_0x35648f[_0x908d('0x43')]=moment()[_0x908d('0xb9')](_0x35648f[_0x908d('0xb8')],_0x908d('0xba'));}if(!this[_0x908d('0x83')](_0x35648f[_0x908d('0x47')])){_0x35648f[_0x908d('0x47')]=0x2;}this['createCmContact'][_0x908d('0x6c')](this,_0x35648f);return this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xbb'),_0x35648f[_0x908d('0xbc')],_0x35648f['list_id'],_0x35648f[_0x908d('0x43')]));};AGIVertices[_0x908d('0x10')][_0x908d('0xbd')]=function(_0x491b75){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xbe'),_0x491b75[_0x908d('0x36')]));var _0xea676c=this[_0x908d('0xd')][_0x908d('0x52')](_0x491b75['application'],_0x491b75[_0x908d('0x74')]);if(_0xea676c['result']===-0x1){return _0xea676c;}return this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xbf'),_0x491b75[_0x908d('0xc0')],_0x491b75['options']));};AGIVertices[_0x908d('0x10')][_0x908d('0xc1')]=function(_0x444f90){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xc2'),_0x444f90[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x444f90[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20text\x20configured');}var _0x35f91a='\x22'+_0x444f90[_0x908d('0x58')]+'\x22';if(this[_0x908d('0x83')](_0x444f90[_0x908d('0x74')])){_0x35f91a+=','+_0x444f90[_0x908d('0x74')];}var _0x17948f=this[_0x908d('0xd')][_0x908d('0x52')](_0x908d('0xa9'),_0x35f91a);if(_0x17948f[_0x908d('0xae')]===-0x1){return _0x17948f;}return this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0xc3'),_0x35f91a));};AGIVertices[_0x908d('0x10')]['sestektts']=function(_0x285277){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xc4'),_0x285277[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x285277[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xa8'));}var _0x3f5a4c='\x22'+_0x285277[_0x908d('0x58')]+'\x22';if(this[_0x908d('0x83')](_0x285277['options'])){_0x3f5a4c+=','+_0x285277[_0x908d('0x74')];}var _0x17dbcf=this[_0x908d('0xd')]['exec'](_0x908d('0xa9'),_0x3f5a4c);if(_0x17dbcf['result']===-0x1){return _0x17dbcf;}return this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0xc3'),_0x3f5a4c));};AGIVertices[_0x908d('0x10')][_0x908d('0xc5')]=function(_0x25d238){logger['info'](util[_0x908d('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x25d238['label']));if(!this[_0x908d('0x83')](_0x25d238[_0x908d('0xac')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x4c4d11=_0x25d238[_0x908d('0xac')];if(this[_0x908d('0x83')](_0x25d238[_0x908d('0x74')])){_0x4c4d11+=','+_0x25d238['options'];}var _0x31078a=this[_0x908d('0xd')][_0x908d('0x52')](_0x908d('0xad'),_0x4c4d11);if(_0x31078a[_0x908d('0xae')]===-0x1){return _0x31078a;}var _0x568935=this[_0x908d('0xa0')]('RECOG_CONFIDENCE()',_0x908d('0xc6'));if(_0x568935[_0x908d('0xae')]===-0x1){return _0x568935;}var _0xc61736=this[_0x908d('0xa0')](_0x908d('0xc7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0xc61736[_0x908d('0xae')]===-0x1){return _0xc61736;}var _0x343e1d=this[_0x908d('0xa0')](_0x908d('0xb0'),_0x908d('0xc8'));if(_0x343e1d[_0x908d('0xae')]===-0x1){return _0x343e1d;}return this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xb2'),_0x4c4d11));};AGIVertices['prototype'][_0x908d('0xc9')]=function(_0x426e0b){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xca'),_0x426e0b[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x426e0b['grammar'])){return this['channel'][_0x908d('0xa7')]('no\x20grammar\x20configured');}var _0x294c8a=_0x426e0b['grammar'];if(this[_0x908d('0x83')](_0x426e0b[_0x908d('0x74')])){_0x294c8a+=','+_0x426e0b[_0x908d('0x74')];}var _0x1a0ce8=this[_0x908d('0xd')]['exec'](_0x908d('0xad'),_0x294c8a);if(_0x1a0ce8[_0x908d('0xae')]===-0x1){return _0x1a0ce8;}var _0x34b255=this[_0x908d('0xa0')](_0x908d('0xcb'),_0x908d('0xcc'));if(_0x34b255[_0x908d('0xae')]===-0x1){return _0x34b255;}var _0x311677=this[_0x908d('0xa0')](_0x908d('0xc7'),_0x908d('0xcd'));if(_0x311677[_0x908d('0xae')]===-0x1){return _0x311677;}var _0xec528c=this[_0x908d('0xa0')](_0x908d('0xb0'),'SESTEK_ASR_INSTANCE');if(_0xec528c[_0x908d('0xae')]===-0x1){return _0xec528c;}return this['channel']['noop'](util[_0x908d('0x28')](_0x908d('0xb2'),_0x294c8a));};AGIVertices[_0x908d('0x10')][_0x908d('0xce')]=function(_0x537f9a){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xcf'),_0x537f9a[_0x908d('0x36')]));if(!this['isConfigured'](_0x537f9a[_0x908d('0xd0')])){return this['channel'][_0x908d('0x2b')](_0x537f9a,'no\x20database\x20selected');}var _0x10a47d=this['getSquareOdbc'][_0x908d('0x6c')](this,_0x537f9a[_0x908d('0xd0')]);if(!_0x10a47d){return this[_0x908d('0xd')]['error'](_0x537f9a,_0x908d('0xd1'));}if(!this[_0x908d('0x83')](_0x537f9a[_0x908d('0x2f')])){return this['channel'][_0x908d('0x2b')](_0x537f9a,_0x908d('0xd2'));}var _0x2d00fd=_0x537f9a[_0x908d('0x2f')][_0x908d('0x54')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xd3'),_0x2d00fd));var _0x18ae39=this[_0x908d('0xd4')]['sync'](this,_0x10a47d,_0x2d00fd);this[_0x908d('0x34')]['sync'](this,_0x537f9a,_0x2d00fd);if(!this['isConfigured'](_0x537f9a[_0x908d('0xd5')])){return this[_0x908d('0xd')]['noop'](_0x908d('0xd6'));}var _0x46995c=this[_0x908d('0xa1')][_0x908d('0x6c')](this,_0x537f9a[_0x908d('0xd5')]);if(!_0x46995c){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x537f9a,_0x908d('0xd7'));}var _0x5d8701=this;_0x18ae39[_0x908d('0xd8')](function(_0x39b5d3,_0x3dac7f){Object['keys'](_0x39b5d3)['forEach'](function(_0x24edb1){_0x5d8701[_0x908d('0xd')][_0x908d('0x9c')](util[_0x908d('0x28')](_0x908d('0xd9'),_0x46995c,_0x3dac7f,_0x24edb1),_0x39b5d3[_0x24edb1]);});});this[_0x908d('0xd')]['setVariable'](util['format'](_0x908d('0xda'),_0x46995c),_0x18ae39['length']);return this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xdb'),_0x46995c));};AGIVertices[_0x908d('0x10')][_0x908d('0xdc')]=function(_0x210abd){logger[_0x908d('0xdd')](util[_0x908d('0x28')](_0x908d('0xde'),_0x210abd['label']));if(!this[_0x908d('0x83')](_0x210abd[_0x908d('0xdf')])){return this['channel']['error'](_0x210abd,_0x908d('0xe0'));}var _0x2cba33=this[_0x908d('0x1a')][_0x908d('0x6c')](this,_0x210abd['sip_id']);if(!_0x2cba33){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x210abd,_0x908d('0xe1'));}var _0x175174=this['channel'][_0x908d('0x52')]('DIAL',[util[_0x908d('0x28')](_0x908d('0xe2'),_0x2cba33),_0x210abd[_0x908d('0x63')],_0x210abd[_0x908d('0xe3')],_0x210abd['url']]);if(_0x175174[_0x908d('0xae')]===-0x1){return _0x175174;}return this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xe4'),_0x908d('0xe5')));};AGIVertices[_0x908d('0x10')][_0x908d('0xe6')]=function(_0x2d7c50){logger['info'](util[_0x908d('0x28')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x2d7c50[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x2d7c50[_0x908d('0x76')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20key\x20configured');}if(!this[_0x908d('0x83')](_0x2d7c50[_0x908d('0x58')])){return this['channel'][_0x908d('0xa7')](_0x908d('0xa8'));}this[_0x908d('0xd')][_0x908d('0xe7')]=!![];this['createSquareDetailsReport'](_0x2d7c50);this[_0x908d('0xe8')](_0x2d7c50[_0x908d('0x58')],'in','','');this[_0x908d('0xd')][_0x908d('0xa7')](util['format']('Trying\x20Dialogflow:\x20%s',_0x2d7c50[_0x908d('0x58')]));var _0x1fac76=this['googleDialogflow'][_0x908d('0x6c')](this,_0x2d7c50);if(_0x1fac76){for(var _0x234328 in _0x1fac76){if(_0x1fac76[_0x908d('0x92')](_0x234328)){this[_0x908d('0xd')][_0x908d('0x9c')](util['format'](_0x908d('0xe9'),_0x234328[_0x908d('0x66')]()),_0x1fac76[_0x234328]);}}this[_0x908d('0xe8')](_0x1fac76[_0x908d('0xea')],_0x908d('0xeb'),_0x908d('0xe6'),'');return this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xec'),_0x1fac76[_0x908d('0xea')]));}return this['channel'][_0x908d('0x2b')](_0x2d7c50,_0x908d('0xed'));};AGIVertices[_0x908d('0x10')][_0x908d('0xee')]=function(_0x18eefc){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xef'),_0x18eefc[_0x908d('0x36')]));if(!this['isConfigured'](_0x18eefc['dialogflowV2_project_id'])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x18eefc[_0x908d('0x7a')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xf0'));}if(!this[_0x908d('0x83')](_0x18eefc[_0x908d('0x7b')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xf1'));}if(!this[_0x908d('0x83')](_0x18eefc['dialogflowV2_language'])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xf2'));}if(!this[_0x908d('0x83')](_0x18eefc[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20text\x20configured');}this['channel'][_0x908d('0xe7')]=!![];this[_0x908d('0x34')](_0x18eefc);this[_0x908d('0xe8')](_0x18eefc[_0x908d('0x58')],'in','','');this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xf3'),_0x18eefc[_0x908d('0x58')]));var _0x48635c=this[_0x908d('0x78')][_0x908d('0x6c')](this,_0x18eefc);if(_0x48635c){for(var _0x41b36d in _0x48635c){if(_0x48635c[_0x908d('0x92')](_0x41b36d)){if(_0x41b36d!==_0x908d('0xf4')){this[_0x908d('0xd')][_0x908d('0x9c')](util[_0x908d('0x28')]('DIALOGFLOW_%s',_0x41b36d[_0x908d('0x66')]()),_0x48635c[_0x41b36d]);}}}this[_0x908d('0xe8')](_0x48635c[_0x908d('0xea')],_0x908d('0xeb'),_0x908d('0xee'),_0x48635c[_0x908d('0xf4')]);return this['channel']['noop'](util[_0x908d('0x28')]('DialogflowV2\x20Result\x20%s',_0x48635c['speech']));}return this['channel'][_0x908d('0x2b')](_0x18eefc,_0x908d('0xf5'));};AGIVertices['prototype']['sesteknda']=function(_0x143f56){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0xf6'),_0x143f56['label']));if(!this['isConfigured'](_0x143f56[_0x908d('0xf7')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x143f56['username'])){return this['channel'][_0x908d('0xa7')](_0x908d('0xf8'));}if(!this[_0x908d('0x83')](_0x143f56[_0x908d('0xf9')])){return this['channel']['noop'](_0x908d('0xfa'));}if(!this[_0x908d('0x83')](_0x143f56[_0x908d('0xfb')])){return this[_0x908d('0xd')]['noop'](_0x908d('0xa8'));}this['channel']['bot']=!![];this[_0x908d('0x34')](_0x143f56);this[_0x908d('0xe8')](_0x143f56[_0x908d('0x58')],'in','','');this[_0x908d('0xd')][_0x908d('0xa7')](util['format'](_0x908d('0xfc'),_0x143f56[_0x908d('0x58')]));var _0x378655=this[_0x908d('0x7d')][_0x908d('0x6c')](this,_0x143f56);if(_0x378655){for(var _0x23f4ca in _0x378655){if(_0x378655[_0x908d('0x92')](_0x23f4ca)){this[_0x908d('0xd')]['setVariable'](util['format'](_0x908d('0xfd'),_0x23f4ca[_0x908d('0x66')]()),_0x378655[_0x23f4ca]);}}this[_0x908d('0xe8')](_0x378655[_0x908d('0xea')],'out','sesteknda','');if(_0x378655[_0x908d('0xfe')]){this[_0x908d('0xd')]['noop'](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x378655[_0x908d('0xfe')]));var _0x4e1337=this[_0x908d('0xd')][_0x908d('0xff')](_0x378655[_0x908d('0xfe')]);try{fs[_0x908d('0x100')](_0x378655[_0x908d('0xfe')]+'.wav');}catch(_0x288d21){logger[_0x908d('0x2b')](_0x288d21);}return _0x4e1337;}else{return this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x101'),_0x378655[_0x908d('0xea')]));}}return this[_0x908d('0xd')][_0x908d('0x2b')](_0x143f56,_0x908d('0x102'));};AGIVertices[_0x908d('0x10')]['end']=function(_0x3ba99b){logger[_0x908d('0x2d')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x3ba99b[_0x908d('0x36')]));return this[_0x908d('0xd')]['noop'](_0x908d('0x103'));};AGIVertices[_0x908d('0x10')]['ext_dial']=function(_0x335d34){logger['info'](util[_0x908d('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x335d34[_0x908d('0x36')]));var _0x56ca5a='';if(_0x335d34[_0x908d('0x104')]){if(!this[_0x908d('0x83')](_0x335d34[_0x908d('0x104')])){return this['channel'][_0x908d('0x2b')](_0x335d34,_0x908d('0x105'));}else{var _0x1acab0=parseInt(_0x335d34[_0x908d('0x104')],0xa);if(isNaN(_0x1acab0)){_0x56ca5a=_0x335d34[_0x908d('0x104')];}else{_0x56ca5a=this['getTrunk'][_0x908d('0x6c')](this,_0x335d34[_0x908d('0x104')]);if(!_0x56ca5a){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x335d34,'no\x20trunk\x20found');}}}}else if(_0x335d34['trunk_name']){_0x56ca5a=_0x335d34[_0x908d('0x106')];}else{return this[_0x908d('0xd')][_0x908d('0x2b')](_0x335d34,_0x908d('0x105'));}var _0x29d467=this[_0x908d('0xd')]['exec'](_0x908d('0xe5'),[util['format']('SIP/%s/%s',_0x56ca5a,_0x335d34['phone']),_0x335d34[_0x908d('0x63')],_0x335d34[_0x908d('0xe3')],_0x335d34[_0x908d('0x60')]]);if(_0x29d467[_0x908d('0xae')]===-0x1){return _0x29d467;}return this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0xe4'),_0x908d('0xe5')));};AGIVertices['prototype'][_0x908d('0x107')]=function(_0x468002){logger[_0x908d('0x2d')](util['format'](_0x908d('0x108'),_0x468002['label']));return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x107'));};AGIVertices[_0x908d('0x10')][_0x908d('0xb')]=function(_0x17f187){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x109'),_0x17f187[_0x908d('0x36')]));if(_0x17f187[_0x908d('0xa4')]===0x0){return this[_0x908d('0xa3')](_0x17f187);}_0x17f187[_0x908d('0xa4')]-=0x1;if(!this[_0x908d('0x83')](_0x17f187[_0x908d('0x10a')])){return this['channel'][_0x908d('0x2b')](_0x17f187,_0x908d('0x10b'));}var _0x1c2787=this['getSound']['sync'](this,_0x17f187[_0x908d('0x10a')]);if(!_0x1c2787){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x17f187,_0x908d('0x10c'));}if(!this[_0x908d('0x83')](_0x17f187['variable_id'])){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x908d('0xd6'));}var _0x4994ab=this[_0x908d('0xd')][_0x908d('0x10d')](_0x1c2787,_0x17f187[_0x908d('0x10e')],_0x17f187[_0x908d('0x10f')]);var _0x271af6=_0x4994ab[_0x908d('0xae')]?_0x4994ab[_0x908d('0xae')][_0x908d('0x46')]():'';logger[_0x908d('0x2d')](_0x908d('0x110'),JSON['stringify'](_0x4994ab));if(_0x4994ab[_0x908d('0xae')]===-0x1){this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x17f187,_0x271af6);return _0x4994ab;}else if(_0x4994ab[_0x908d('0x9f')]===_0x908d('0x63')){_0x4994ab['result']=_0x271af6[_0x908d('0x99')]>=parseInt(_0x17f187[_0x908d('0x111')])?'x':'i';}else{_0x4994ab['result']=_0x271af6['length']>=parseInt(_0x17f187['mindigit'])&&_0x271af6['length']<=parseInt(_0x17f187[_0x908d('0x10f')])?'x':'i';}var _0x4f3a58=this[_0x908d('0xa1')][_0x908d('0x6c')](this,_0x17f187[_0x908d('0xd5')]);if(!_0x4f3a58){return this['channel'][_0x908d('0x2b')](_0x17f187,_0x908d('0xd7'));}this[_0x908d('0xd')]['setVariable'](_0x4f3a58,_0x271af6);if(this['isConfigured'](_0x17f187[_0x908d('0x112')])){var _0x27c9ba=parseInt(_0x17f187[_0x908d('0x112')],0xa);var _0xfc5a3b=rs[_0x908d('0x113')]({'charset':'*','length':_0x27c9ba});var _0x233f58=_0x271af6['length'];if(_0x233f58>0x0){if(_0x233f58>_0x27c9ba){this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x17f187,_0x17f187[_0x908d('0x114')]==='first'?_0xfc5a3b+_0x271af6[_0x908d('0x115')](_0x27c9ba):_0x271af6[_0x908d('0x115')](0x0,_0x233f58-_0x27c9ba)+_0xfc5a3b);}else{this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x17f187,rs[_0x908d('0x113')]({'charset':'*','length':_0x233f58}));}}else{this['createSquareDetailsReport'][_0x908d('0x6c')](this,_0x17f187,'');}}else{this['createSquareDetailsReport'][_0x908d('0x6c')](this,_0x17f187,_0x271af6);}return _0x4994ab;};AGIVertices[_0x908d('0x10')]['getsecretdigits']=function(_0x23aceb){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x116'),_0x23aceb[_0x908d('0x36')]));return this[_0x908d('0xb')](_0x23aceb);};AGIVertices[_0x908d('0x10')][_0x908d('0x117')]=function(_0x508a51){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x118'),_0x508a51[_0x908d('0x36')]));this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x508a51,_0x508a51[_0x908d('0x119')]);return this[_0x908d('0xd')][_0x908d('0xa7')](util['format'](_0x908d('0x11a'),_0x508a51[_0x908d('0x119')]));};AGIVertices[_0x908d('0x10')][_0x908d('0x11b')]=function(_0x368a98){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x11c'),_0x368a98[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x368a98[_0x908d('0x86')])||!this[_0x908d('0x83')](_0x368a98[_0x908d('0x87')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x11d'));}if(!this[_0x908d('0x83')](_0x368a98[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20text\x20configured');}this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x11e'),_0x368a98[_0x908d('0x58')]));var _0x1753c6=this[_0x908d('0x85')][_0x908d('0x6c')](this,_0x368a98);if(_0x1753c6){this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x11f'),_0x1753c6));var _0x4f7d44=this[_0x908d('0xd')][_0x908d('0xff')](_0x1753c6);try{fs[_0x908d('0x100')](_0x1753c6+'.wav');}catch(_0x3585b6){logger[_0x908d('0x2b')](_0x3585b6);}return _0x4f7d44;}return this['channel']['error'](_0x368a98,_0x908d('0x120'));};AGIVertices['prototype'][_0x908d('0x121')]=function(_0x55d8ff){logger[_0x908d('0x2d')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x55d8ff['label']));if(!this[_0x908d('0x83')](_0x55d8ff['aws_access_key_id'])||!this[_0x908d('0x83')](_0x55d8ff[_0x908d('0x87')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x11d'));}if(!this[_0x908d('0x83')](_0x55d8ff[_0x908d('0x8c')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x122'));}if(!this[_0x908d('0x83')](_0x55d8ff[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20text\x20configured');}this[_0x908d('0xd')][_0x908d('0xe7')]=!![];this['createSquareDetailsReport'](_0x55d8ff);this[_0x908d('0xe8')](_0x55d8ff[_0x908d('0x58')],'in','','');this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x55d8ff[_0x908d('0x58')]));var _0x3261e7=this[_0x908d('0x8a')][_0x908d('0x6c')](this,_0x55d8ff);if(_0x3261e7){for(var _0x1537d4 in _0x3261e7){if(_0x3261e7[_0x908d('0x92')](_0x1537d4)&&_[_0x908d('0x93')](_0x3261e7[_0x1537d4])){this[_0x908d('0xd')][_0x908d('0x9c')](util['format'](_0x908d('0x123'),_0x1537d4[_0x908d('0x66')]()),_0x3261e7[_0x1537d4]);}}if(_['isNil'](_0x3261e7[_0x908d('0x124')])){return this[_0x908d('0xd')]['noop'](_0x908d('0x125'));}else{this['createSquareMessage'](_0x3261e7[_0x908d('0x124')],'out',_0x908d('0x126'),'');return this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x127'),_0x3261e7[_0x908d('0x124')]));}}return this[_0x908d('0xd')][_0x908d('0x2b')](_0x55d8ff,_0x908d('0x128'));};AGIVertices[_0x908d('0x10')][_0x908d('0x129')]=function(_0x3e4593){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x12a'),_0x3e4593[_0x908d('0x36')],_0x3e4593['timeout']));if(!this[_0x908d('0x83')](_0x3e4593[_0x908d('0x76')])){return this[_0x908d('0xd')]['noop']('no\x20key\x20configured');}var _0x413101=_0x908d('0x12b');var _0x314a89=util[_0x908d('0x28')](_0x908d('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x484af2=util[_0x908d('0x28')](_0x908d('0x9b'),_0x314a89,_0x413101);var _0x1a7055=!![];if(_0x3e4593[_0x908d('0x12d')]==='NOBEEP'){_0x1a7055=![];}var _0x49db8e=this[_0x908d('0xd')]['recordFile'](_0x314a89,_0x413101,_0x3e4593[_0x908d('0x12e')],_0x3e4593[_0x908d('0x63')],undefined,_0x1a7055);if(_0x49db8e[_0x908d('0xae')]!==-0x1){this['channel'][_0x908d('0xa7')](util['format']('google\x20%s\x20file\x20created',_0x484af2));var _0x592ed9=this['googleASR'][_0x908d('0x6c')](this,_0x3e4593,_0x484af2);if(_0x592ed9){for(var _0x8e1e76 in _0x592ed9){if(_0x592ed9[_0x908d('0x92')](_0x8e1e76)){this[_0x908d('0xd')]['setVariable'](util['format'](_0x908d('0x12f'),_0x8e1e76['toUpperCase']()),_0x592ed9[_0x8e1e76]);}}return this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0x130'),JSON[_0x908d('0x6f')](_0x592ed9)));}}return _0x49db8e;};AGIVertices['prototype']['tildeasr']=function(_0x5da38b){logger['info'](util[_0x908d('0x28')](_0x908d('0x131'),_0x5da38b[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x5da38b[_0x908d('0x132')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x5da38b[_0x908d('0x8f')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20appsecret\x20configured');}var _0x1b8e34=_0x908d('0x12b');var _0x17376a=util[_0x908d('0x28')](_0x908d('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x1c1303=util[_0x908d('0x28')]('%s.%s',_0x17376a,_0x1b8e34);var _0x4834a2=!![];if(_0x5da38b[_0x908d('0x12d')]==='NOBEEP'){_0x4834a2=![];}var _0x527630=this[_0x908d('0xd')]['recordFile'](_0x17376a,_0x1b8e34,_0x5da38b[_0x908d('0x12e')],_0x5da38b[_0x908d('0x63')],undefined,_0x4834a2);if(_0x527630[_0x908d('0xae')]!==-0x1){this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x133'),_0x1c1303));var _0x58618f=this[_0x908d('0x8e')][_0x908d('0x6c')](this,_0x5da38b,_0x1c1303);if(_0x58618f){for(var _0x3126ba in _0x58618f){if(_0x58618f[_0x908d('0x92')](_0x3126ba)){this[_0x908d('0xd')][_0x908d('0x9c')](util[_0x908d('0x28')](_0x908d('0x134'),_0x3126ba[_0x908d('0x66')]()),_0x58618f[_0x3126ba]);}}return this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')]('TildeASR\x20Result\x20%s',JSON[_0x908d('0x6f')](_0x58618f)));}}return _0x527630;};AGIVertices[_0x908d('0x10')]['gotoc']=function(_0x4f6e40){logger[_0x908d('0x2d')](util['format'](_0x908d('0x135'),_0x4f6e40[_0x908d('0x36')]));return this[_0x908d('0xd')][_0x908d('0x136')](_0x4f6e40[_0x908d('0x137')],_0x4f6e40[_0x908d('0x3b')],_0x4f6e40[_0x908d('0x3c')]);};AGIVertices[_0x908d('0x10')]['gotoif']=function(_0x3d6b13){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x138'),_0x3d6b13['label']));if(!this[_0x908d('0x83')](_0x3d6b13['condition'])){return this[_0x908d('0xd')]['error'](_0x3d6b13,_0x908d('0x139'));}try{var _0x2fe3a3=eval(_0x3d6b13[_0x908d('0x13a')])?'true':_0x908d('0x13b');this[_0x908d('0xd')]['noop'](util['format'](_0x908d('0x13c'),_0x3d6b13[_0x908d('0x13a')],_0x2fe3a3));return{'code':0xc8,'result':_0x2fe3a3};}catch(_0x29961d){return{'code':0xc8,'result':_0x908d('0x13b')};}};AGIVertices['prototype'][_0x908d('0x13d')]=function(_0xae4f69){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x13e'),_0xae4f69[_0x908d('0x36')]));if(!this['isConfigured'](_0xae4f69[_0x908d('0x13f')])){return this[_0x908d('0xd')]['error'](_0xae4f69,_0x908d('0x140'));}var _0x91d169=this[_0x908d('0x24')]['sync'](this,_0xae4f69[_0x908d('0x13f')]);if(!_0x91d169){return this[_0x908d('0xd')]['error'](_0xae4f69,'no\x20intervals\x20found');}for(var _0x4a4cd0=0x0;_0x4a4cd0<_0x91d169['length'];_0x4a4cd0+=0x1){var _0x148d2a=this['channel'][_0x908d('0xa1')](util[_0x908d('0x28')](_0x908d('0x141'),_0x91d169[_0x4a4cd0]));if(_0x148d2a[_0x908d('0xae')]===-0x1){return _0x148d2a;}logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x142'),_0x91d169[_0x4a4cd0],_0x148d2a['extra']));if(_0x148d2a['extra']===_0x908d('0x143')){logger[_0x908d('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x91d169[_0x4a4cd0],'true'));this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x142'),_0x91d169[_0x4a4cd0],_0x908d('0x143')));return{'code':0xc8,'result':_0x908d('0x143')};}else{logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x142'),_0x91d169[_0x4a4cd0],'false'));this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x142'),_0x91d169[_0x4a4cd0],_0x908d('0x13b')));}}return{'code':0xc8,'result':_0x908d('0x13b')};};AGIVertices['prototype'][_0x908d('0x144')]=function(_0x456598){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x145'),_0x456598[_0x908d('0x36')]));return this['channel'][_0x908d('0x144')]();};AGIVertices[_0x908d('0x10')][_0x908d('0x146')]=function(_0x251dab){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x251dab[_0x908d('0x36')]));if(!this['isConfigured'](_0x251dab['key'])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20key\x20configured');}var _0x5c2638=_0x908d('0x12b');var _0x2b470e=util[_0x908d('0x28')](_0x908d('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x78df32=util[_0x908d('0x28')](_0x908d('0x9b'),_0x2b470e,_0x5c2638);var _0x41ffb4=!![];if(_0x251dab[_0x908d('0x12d')]===_0x908d('0x147')){_0x41ffb4=![];}var _0x4cff3f=this[_0x908d('0xd')][_0x908d('0x148')](_0x2b470e,_0x5c2638,_0x251dab[_0x908d('0x12e')],_0x251dab[_0x908d('0x63')],undefined,_0x41ffb4);if(_0x4cff3f[_0x908d('0xae')]!==-0x1){this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x149'),_0x78df32));var _0x194a9f=this[_0x908d('0x81')][_0x908d('0x6c')](this,_0x251dab,_0x78df32);if(_0x194a9f){for(var _0xfee960 in _0x194a9f){if(_0x194a9f[_0x908d('0x92')](_0xfee960)){this[_0x908d('0xd')][_0x908d('0x9c')](util[_0x908d('0x28')]('ISPEECH_ASR_%s',_0xfee960[_0x908d('0x66')]()),_0x194a9f[_0xfee960]);}}return this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x14a'),JSON[_0x908d('0x6f')](_0x194a9f)));}}return _0x4cff3f;};AGIVertices[_0x908d('0x10')][_0x908d('0x14b')]=function(_0x4342e8){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x14c'),_0x4342e8['label']));if(!this['isConfigured'](_0x4342e8[_0x908d('0x76')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x14d'));}if(!this[_0x908d('0x83')](_0x4342e8['text'])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xa8'));}this[_0x908d('0xd')][_0x908d('0xa7')](util['format'](_0x908d('0x14e'),_0x4342e8[_0x908d('0x58')]));var _0x41722c=this[_0x908d('0x7e')][_0x908d('0x6c')](this,_0x4342e8);if(_0x41722c){this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0x149'),_0x41722c));var _0x52fc61=this[_0x908d('0xd')][_0x908d('0xff')](_0x41722c,_0x4342e8[_0x908d('0x12e')]);try{fs[_0x908d('0x100')](_0x41722c+_0x908d('0x14f'));}catch(_0x238d1){logger['error'](_0x238d1);}return _0x52fc61;}return this[_0x908d('0xd')]['error'](_0x4342e8,_0x908d('0x150'));};AGIVertices[_0x908d('0x10')][_0x908d('0x151')]=function(_0x2757db){logger['info'](util[_0x908d('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2757db['label']));if(!this[_0x908d('0x83')](_0x2757db[_0x908d('0x152')])){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x2757db,'no\x20find\x20by\x20configured');}logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x153'),this['channel'][_0x908d('0x3a')],_0x2757db['findBy']));var _0x1cb200=this[_0x908d('0x51')][_0x908d('0x6c')](this,_0x2757db[_0x908d('0x152')]);if(_0x1cb200){logger[_0x908d('0x2d')](util['format'](_0x908d('0x154'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x2757db[_0x908d('0x152')]));this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x154'),this['channel'][_0x908d('0x3a')],_0x2757db[_0x908d('0x152')]));return{'code':0xc8,'result':_0x908d('0x155')};}else{logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x156'),this['channel'][_0x908d('0x3a')],_0x2757db['findBy']));this[_0x908d('0xd')][_0x908d('0xa7')](util['format'](_0x908d('0x156'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x2757db[_0x908d('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x908d('0x10')][_0x908d('0x157')]=function(_0x47725a){logger['info'](util[_0x908d('0x28')](_0x908d('0x158'),_0x47725a[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x47725a[_0x908d('0x152')])){return this[_0x908d('0xd')]['error'](_0x47725a,_0x908d('0x159'));}logger['info'](util[_0x908d('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x908d('0x3a')],_0x47725a[_0x908d('0x152')]));var _0x123fd5=this[_0x908d('0x4e')]['sync'](this,_0x47725a['findBy']);if(_0x123fd5){logger['info'](util[_0x908d('0x28')](_0x908d('0x154'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x47725a[_0x908d('0x152')]));this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x154'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x47725a[_0x908d('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x908d('0x2d')](util['format'](_0x908d('0x156'),this['channel']['callerid'],_0x47725a['findBy']));this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0x156'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x47725a['findBy']));return{'code':0xc8,'result':_0x908d('0x15a')};}};AGIVertices[_0x908d('0x10')]['math']=function(_0x54af9a){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x54af9a[_0x908d('0x36')]));if(!this['isConfigured'](_0x54af9a[_0x908d('0x15b')])){return this['channel'][_0x908d('0x2b')](_0x54af9a,_0x908d('0x15c'));}this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0x15d'),_0x54af9a[_0x908d('0x15b')]));var _0x25c45b=eval(_0x54af9a[_0x908d('0x15b')]);if(!this[_0x908d('0x83')](_0x54af9a[_0x908d('0xd5')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xd6'));}var _0xc19116=this[_0x908d('0xa1')]['sync'](this,_0x54af9a[_0x908d('0xd5')]);if(!_0xc19116){return this['channel'][_0x908d('0x2b')](_0x54af9a,_0x908d('0xd7'));}if(_[_0x908d('0x98')](_0x25c45b)){var _0x158465=this;_0x25c45b[_0x908d('0xd8')](function(_0x3fba0a,_0xadb5d7){_0x158465['channel'][_0x908d('0x9c')](util[_0x908d('0x28')](_0x908d('0x15e'),_0xc19116,_0xadb5d7),_0x3fba0a);});return this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0x15f'),_0xc19116));}else{return this['channel'][_0x908d('0x9c')](_0xc19116,_0x25c45b);}};AGIVertices[_0x908d('0x10')]['menu']=function(_0x1361ca){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1361ca[_0x908d('0x36')]));if(_0x1361ca[_0x908d('0xa4')]===0x0){return this[_0x908d('0xa3')](_0x1361ca);}_0x1361ca[_0x908d('0xa4')]-=0x1;if(!this[_0x908d('0x83')](_0x1361ca[_0x908d('0x10a')])){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x1361ca,_0x908d('0x10b'));}var _0x4409a5=this[_0x908d('0x1d')]['sync'](this,_0x1361ca[_0x908d('0x10a')]);if(!_0x4409a5){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x1361ca,_0x908d('0x10c'));}var _0x52e8ee=this['channel']['getData'](_0x4409a5,_0x1361ca[_0x908d('0x10e')],_0x1361ca['digit']);var _0x2dbe0e=_0x52e8ee[_0x908d('0xae')];if(_0x52e8ee['result']===-0x1){this['createSquareDetailsReport'][_0x908d('0x6c')](this,_0x1361ca,'-1');return _0x52e8ee;}else if(_0x52e8ee[_0x908d('0x9f')]==='timeout'){_0x52e8ee[_0x908d('0xae')]=_0x52e8ee[_0x908d('0xae')][_0x908d('0x99')]>0x0?_0x52e8ee[_0x908d('0xae')]:'t';}else if(_[_0x908d('0x3f')](_0x52e8ee[_0x908d('0xae')])){_0x52e8ee[_0x908d('0xae')]='#';_0x2dbe0e='#';}if(!this[_0x908d('0x83')](_0x1361ca[_0x908d('0xd5')])){this['channel'][_0x908d('0xa7')](_0x908d('0xd6'));}else{var _0x4d5c01=this['getVariable'][_0x908d('0x6c')](this,_0x1361ca[_0x908d('0xd5')]);if(!_0x4d5c01){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x1361ca,_0x908d('0xd7'));}this['channel'][_0x908d('0x9c')](_0x4d5c01,_0x2dbe0e);}this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x1361ca,_0x2dbe0e);return _0x52e8ee;};AGIVertices[_0x908d('0x10')][_0x908d('0xa7')]=function(_0x578969){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x160'),_0x578969[_0x908d('0x36')]));return this['channel'][_0x908d('0xa7')](_0x578969[_0x908d('0x161')]||_0x578969[_0x908d('0x36')]);};AGIVertices[_0x908d('0x10')][_0x908d('0x162')]=function(_0x34fdb6){logger['info'](util[_0x908d('0x28')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x34fdb6[_0x908d('0x36')]));if(!this['isConfigured'](_0x34fdb6['findBy'])){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x34fdb6,_0x908d('0x159'));}logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x153'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x34fdb6[_0x908d('0x152')]));var _0x1a2bdd=this[_0x908d('0x48')][_0x908d('0x6c')](this,_0x34fdb6[_0x908d('0x163')]);var _0x46c9b5=this['agentPause']['sync'](this,_0x34fdb6[_0x908d('0x152')],_0x1a2bdd);if(_0x46c9b5){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x34fdb6['findBy']));this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x908d('0x3a')],_0x34fdb6['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x156'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x34fdb6['findBy']));this[_0x908d('0xd')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x908d('0xd')][_0x908d('0x3a')],_0x34fdb6['findBy']));return{'code':0xc8,'result':_0x908d('0x15a')};}};AGIVertices[_0x908d('0x10')][_0x908d('0x164')]=function(_0x444df1){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x165'),_0x444df1[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x444df1[_0x908d('0x10a')])){return this['channel']['error'](_0x444df1,_0x908d('0x10b'));}var _0xfdd9ea=this[_0x908d('0x1d')][_0x908d('0x6c')](this,_0x444df1[_0x908d('0x10a')]);if(!_0xfdd9ea){return this['channel']['error'](_0x444df1,_0x908d('0x10c'));}var _0x3b38ab=this['channel'][_0x908d('0x52')](_0x908d('0x166'),[_0xfdd9ea,_0x444df1[_0x908d('0xe3')]]);if(_0x3b38ab[_0x908d('0xae')]===-0x1){return _0x3b38ab;}return this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xbf'),_0x908d('0x166'),_0xfdd9ea));};AGIVertices[_0x908d('0x10')][_0x908d('0x167')]=function(_0x47b54b){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x168'),_0x47b54b[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x47b54b[_0x908d('0x169')])){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x47b54b,_0x908d('0x16a'));}var _0x595b5f='';var _0x302283=parseInt(_0x47b54b[_0x908d('0x169')],0xa);if(isNaN(_0x302283)){_0x595b5f=_0x47b54b['queue_id'];}else{_0x595b5f=this[_0x908d('0x13')]['sync'](this,_0x47b54b[_0x908d('0x169')]);if(!_0x595b5f){return this[_0x908d('0xd')]['error'](_0x47b54b,'no\x20queue\x20found');}}var _0x594701='';if(this[_0x908d('0x83')](_0x47b54b[_0x908d('0x10a')])){var _0x41b770=this['getSound'][_0x908d('0x6c')](this,_0x47b54b[_0x908d('0x10a')]);if(_0x41b770){_0x594701=_0x41b770;}}this['createSquareDetailsReport'][_0x908d('0x6c')](this,_0x47b54b,_0x595b5f);if(_0x47b54b[_0x908d('0xe3')]['indexOf']('x')<0x0){_0x47b54b[_0x908d('0xe3')]+='x';}if(_0x47b54b[_0x908d('0xe3')][_0x908d('0x16b')]('X')<0x0){_0x47b54b[_0x908d('0xe3')]+='X';}this[_0x908d('0xd')]['setVariable'](_0x908d('0x16c'),_0x595b5f?_0x595b5f['toLowerCase']():'');var _0x30c7af=this[_0x908d('0xd')][_0x908d('0x52')](_0x908d('0x16d'),[_0x595b5f,_0x47b54b['opts'],_0x47b54b[_0x908d('0x60')],_0x594701,_0x47b54b[_0x908d('0x63')],_0x47b54b[_0x908d('0x5')],_0x47b54b[_0x908d('0x16e')],_0x47b54b['gosub'],'',_0x47b54b[_0x908d('0x16f')]]);if(_0x30c7af[_0x908d('0xae')]===-0x1){return _0x30c7af;}return this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0xbf'),_0x908d('0x16d'),_0x595b5f));};AGIVertices[_0x908d('0x10')][_0x908d('0x170')]=function(_0x1c024e){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x171'),_0x1c024e[_0x908d('0x36')]));var _0x33ce78=_0x1c024e[_0x908d('0x172')]||_0x908d('0x12b');var _0x30422e=util[_0x908d('0x28')](_0x908d('0x173'),this[_0x908d('0xd')][_0x908d('0x35')],rs[_0x908d('0x113')](0x5));var _0x2aa96e=util['format'](_0x908d('0x174'),FILES_PATH,_0x30422e,_0x33ce78);var _0x34ec37=util[_0x908d('0x28')]('%s/recordings/%s',FILES_PATH,_0x30422e);this[_0x908d('0x39')][_0x908d('0x6c')](this,_0x1c024e,_0x30422e,_0x2aa96e);this[_0x908d('0xd')][_0x908d('0x9c')](_0x908d('0x175'),_0x30422e);logger[_0x908d('0x2d')](_0x908d('0x176'),_0x34ec37,_0x33ce78,_0x1c024e['escape_digits'],_0x1c024e[_0x908d('0x63')]);return this['channel']['recordFile'](_0x34ec37,_0x33ce78,_0x1c024e[_0x908d('0x177')],_0x1c024e[_0x908d('0x63')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x260d23){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x260d23['label']));if(!this[_0x908d('0x83')](_0x260d23[_0x908d('0x60')])){return this['channel'][_0x908d('0xa7')](_0x908d('0x178'));}var _0x54041b=this[_0x908d('0x5f')][_0x908d('0x6c')](this,_0x260d23);logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x179'),util[_0x908d('0x17a')](_0x54041b,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x260d23[_0x908d('0xd5')])){return this['channel'][_0x908d('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x478b6c=this[_0x908d('0xa1')]['sync'](this,_0x260d23[_0x908d('0xd5')]);if(!_0x478b6c){return this[_0x908d('0xd')]['error'](_0x260d23,_0x908d('0xd7'));}this['channel'][_0x908d('0x9c')](util['format'](_0x908d('0x17b'),_0x478b6c),_0x54041b['statusCode']?_0x54041b[_0x908d('0x72')]:_0x908d('0x17c'));this[_0x908d('0xd')]['setVariable'](util['format'](_0x908d('0x17d'),_0x478b6c),_0x54041b[_0x908d('0x17e')]?_0x54041b[_0x908d('0x17e')]:'OK');if(_0x54041b[_0x908d('0x70')]){try{this[_0x908d('0x9a')](_0x54041b[_0x908d('0x70')],_0x478b6c);}catch(_0x1f5d6a){logger['error'](util[_0x908d('0x28')](_0x908d('0x17f'),_0x478b6c));}}return this[_0x908d('0xd')]['noop'](util['format']('variable\x20%s\x20set',_0x478b6c));};AGIVertices[_0x908d('0x10')][_0x908d('0x180')]=function(_0x14b638){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x14b638[_0x908d('0x36')]));return this[_0x908d('0xd')][_0x908d('0x181')](_0x14b638['digits'][_0x908d('0x54')](/\s+/g,''),_0x14b638[_0x908d('0x177')]);};AGIVertices[_0x908d('0x10')][_0x908d('0x182')]=function(_0x1054df){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x183'),_0x1054df[_0x908d('0x36')]));return this[_0x908d('0xd')][_0x908d('0x184')](_0x1054df[_0x908d('0x62')]['replace'](/\s+/g,''),_0x1054df[_0x908d('0x177')]);};AGIVertices[_0x908d('0x10')][_0x908d('0x185')]=function(_0x361a09){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x186'),_0x361a09[_0x908d('0x36')]));return this['channel'][_0x908d('0x187')](_0x361a09[_0x908d('0x58')],_0x361a09['escape_digits']);};AGIVertices[_0x908d('0x10')][_0x908d('0x188')]=function(_0x4b8706){logger[_0x908d('0x2d')](util['format'](_0x908d('0x189'),_0x4b8706['label']));if(!this['isConfigured'](_0x4b8706['account_id'])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20mail\x20account\x20configured');}var _0x2ce8ce=this['getMailAccount']['sync'](this,_0x4b8706[_0x908d('0x18a')]);if(!_0x2ce8ce||!_0x2ce8ce[_0x908d('0x18b')]){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x4b8706,_0x908d('0x18c'));}var _0x21ec88={'from':util[_0x908d('0x28')]('\x22%s\x22\x20<%s>',_0x2ce8ce[_0x908d('0x15')],_0x2ce8ce['email']||_0x2ce8ce[_0x908d('0x18b')][_0x908d('0x18d')]),'to':_0x4b8706['to']||'','cc':_0x4b8706['cc']||'','bcc':_0x4b8706[_0x908d('0x18e')]||'','subject':_0x4b8706[_0x908d('0x18f')],'html':_0x4b8706['text'],'text':_0x4b8706[_0x908d('0x58')]};if(this[_0x908d('0x83')](_0x4b8706[_0x908d('0x190')])){}logger[_0x908d('0xdd')]('sendMail\x20message',JSON['stringify'](_0x21ec88));this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x4b8706,_0x4b8706[_0x908d('0x18a')]);this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0x191'),_0x2ce8ce[_0x908d('0x15')]));this['sendMailMessage'][_0x908d('0x6c')](this,_0x2ce8ce[_0x908d('0x192')],_0x21ec88);return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x193'));};AGIVertices[_0x908d('0x10')][_0x908d('0x194')]=function(_0x5d24b3){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x195'),_0x5d24b3[_0x908d('0x36')]));return this['channel'][_0x908d('0xa7')](_0x908d('0x196'));};AGIVertices[_0x908d('0x10')][_0x908d('0x197')]=function(_0x503204){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x503204[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x503204[_0x908d('0x198')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x199'));}var _0x52d857=this[_0x908d('0x33')][_0x908d('0x6c')](this,_0x503204[_0x908d('0x198')]);if(!_0x52d857){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x503204,'no\x20sms\x20account\x20found');}var _0x5e0698={'body':_0x503204['sms_text'],'phone':_0x503204['to']||'','SmsAccountId':_0x52d857['id']};logger[_0x908d('0xdd')](_0x908d('0x19a'),JSON[_0x908d('0x6f')](_0x5e0698));this[_0x908d('0x34')]['sync'](this,_0x503204,_0x503204[_0x908d('0x198')]);this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x19b'),_0x52d857['name']));this['createSmsMessage'][_0x908d('0x6c')](this,_0x5e0698);return this[_0x908d('0xd')][_0x908d('0xa7')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x908d('0x10')]['set']=function(_0x5b3e22){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x19c'),_0x5b3e22[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x5b3e22[_0x908d('0xd5')])){return this['channel'][_0x908d('0x2b')](_0x5b3e22,_0x908d('0x19d'));}var _0x10003c=this['getVariable'][_0x908d('0x6c')](this,_0x5b3e22['variable_id']);if(!_0x10003c){return this[_0x908d('0xd')]['error'](_0x5b3e22,'no\x20variable\x20found');}return this[_0x908d('0xd')][_0x908d('0x9c')](_0x10003c,_0x5b3e22['variable_value']);};AGIVertices[_0x908d('0x10')][_0x908d('0x19e')]=function(_0x4a1210){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x19f'),_0x4a1210[_0x908d('0x36')]));this[_0x908d('0xd')][_0x908d('0xa7')]('START\x20CALLY\x20SQUARE');var _0x4c70fd=this[_0x908d('0xd')][_0x908d('0xa1')](_0x908d('0x1a0'));if(!_[_0x908d('0x3f')](_0x4c70fd[_0x908d('0x9f')])){this[_0x908d('0xd')][_0x908d('0x35')]=_0x4c70fd['extra'];}if(_0x4a1210[_0x908d('0xb5')]===_0x908d('0x1a1')){this[_0x908d('0xd')]['noop'](_0x908d('0x1a2'));return this['channel']['answer']();}return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x1a3'));};AGIVertices[_0x908d('0x10')]['subproject']=function(_0x1e828f){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1e828f[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x1e828f['project_id'])){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x1e828f,_0x908d('0x1a4'));}var _0x1ea663=this[_0x908d('0x1a5')][_0x908d('0x6c')](this,_0x1e828f[_0x908d('0x1a6')]);if(!this['isConfigured'](_0x1ea663)){return this[_0x908d('0xd')]['error'](_0x1e828f,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1e828f['project_id']));}if(_0x1ea663===this[_0x908d('0xd')]['arg_1']){return this['channel'][_0x908d('0x2b')](_0x1e828f,_0x908d('0x1a7'));}this[_0x908d('0x34')][_0x908d('0x6c')](this,_0x1e828f,_0x1ea663);var _0x108978=this[_0x908d('0xd')][_0x908d('0x52')]('AGI',util[_0x908d('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x908d('0x1a8')]||_0x908d('0x1a9'),_0x1ea663,this[_0x908d('0xd')][_0x908d('0x38')]));if(_0x108978[_0x908d('0xae')]===-0x1){return _0x108978;}return this[_0x908d('0xd')][_0x908d('0xa7')](util['format'](_0x908d('0xbf'),_0x908d('0x1aa'),_0x1ea663));};AGIVertices[_0x908d('0x10')][_0x908d('0x1ab')]=function(_0x2b5f36){logger['info'](util[_0x908d('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2b5f36[_0x908d('0x36')]));var _0x2cc59c=this[_0x908d('0x1ac')]['sync'](this,_0x2b5f36[_0x908d('0x1ad')]);this[_0x908d('0x34')]['sync'](this,_0x2b5f36,_0x2b5f36[_0x908d('0x1ad')]);if(this['isConfigured'](_0x2b5f36[_0x908d('0xd5')])){var _0x56cc1a=this[_0x908d('0xa1')][_0x908d('0x6c')](this,_0x2b5f36[_0x908d('0xd5')]);if(_0x56cc1a){this[_0x908d('0xd')]['setVariable'](_0x56cc1a,_0x2cc59c);return this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2b5f36['command'],_0x56cc1a));}}return this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')](_0x908d('0x1ae'),_0x2b5f36[_0x908d('0x1ad')]));};AGIVertices[_0x908d('0x10')][_0x908d('0x1af')]=function(_0x4cc2f6){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x4cc2f6[_0x908d('0x36')]));_0x4cc2f6[_0x908d('0x58')]=_0x4cc2f6[_0x908d('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x908d('0x83')](_0x4cc2f6[_0x908d('0x56')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0x1b0'));}if(!this[_0x908d('0x83')](_0x4cc2f6[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')](_0x908d('0xa8'));}this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x1b1'),_0x4cc2f6['text']));var _0x1e3d4f=this[_0x908d('0x55')][_0x908d('0x6c')](this,_0x4cc2f6);if(_0x1e3d4f){this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x1b2'),_0x1e3d4f));var _0x21cd7b=this[_0x908d('0xd')][_0x908d('0xff')](_0x1e3d4f);try{fs['unlink'](_0x1e3d4f+_0x908d('0x14f'));}catch(_0x148273){logger[_0x908d('0x2b')](_0x148273);}return _0x21cd7b;}return this[_0x908d('0xd')]['error'](_0x4cc2f6,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x908d('0x10')][_0x908d('0x1b3')]=function(_0x493f6f){logger[_0x908d('0x2d')](util['format'](_0x908d('0x1b4'),_0x493f6f['label']));_0x493f6f[_0x908d('0x58')]=_0x493f6f[_0x908d('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x908d('0x83')](_0x493f6f[_0x908d('0x58')])){return this[_0x908d('0xd')][_0x908d('0xa7')]('no\x20text\x20configured');}this['channel'][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0x1b5'),_0x493f6f[_0x908d('0x58')]));var _0x1e7b0f=this['googleTTS'][_0x908d('0x6c')](this,_0x493f6f);if(_0x1e7b0f){this['channel']['noop'](util[_0x908d('0x28')](_0x908d('0x1b6'),_0x1e7b0f));var _0x47afb4=this[_0x908d('0xd')][_0x908d('0xff')](_0x1e7b0f);try{fs[_0x908d('0x100')](_0x1e7b0f+_0x908d('0x14f'));}catch(_0x3647f3){logger[_0x908d('0x2b')](_0x3647f3);}return _0x47afb4;}return this[_0x908d('0xd')][_0x908d('0x2b')](_0x493f6f,_0x908d('0x1b7'));};AGIVertices['prototype'][_0x908d('0x1b8')]=function(_0x11e8f8){logger['info'](util[_0x908d('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x11e8f8[_0x908d('0x36')]));if(!this[_0x908d('0x83')](_0x11e8f8[_0x908d('0x152')])){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x11e8f8,_0x908d('0x159'));}logger[_0x908d('0x2d')](util[_0x908d('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x908d('0x3a')],_0x11e8f8[_0x908d('0x152')]));var _0x54681e=this[_0x908d('0x4d')]['sync'](this,_0x11e8f8[_0x908d('0x152')]);if(_0x54681e){logger[_0x908d('0x2d')](util[_0x908d('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x908d('0xd')][_0x908d('0x3a')],_0x11e8f8[_0x908d('0x152')]));this[_0x908d('0xd')]['noop'](util[_0x908d('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x908d('0xd')]['callerid'],_0x11e8f8[_0x908d('0x152')]));return{'code':0xc8,'result':_0x908d('0x155')};}else{logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x156'),this[_0x908d('0xd')]['callerid'],_0x11e8f8[_0x908d('0x152')]));this['channel'][_0x908d('0xa7')](util['format'](_0x908d('0x156'),this[_0x908d('0xd')][_0x908d('0x3a')],_0x11e8f8[_0x908d('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x908d('0x1b9')]=function(_0x230786){logger[_0x908d('0x2d')](util[_0x908d('0x28')](_0x908d('0x1ba'),_0x230786['label']));var _0xe9354e=this[_0x908d('0xd')][_0x908d('0x52')](_0x908d('0x1bb'),[_0x230786['mailbox'],_0x230786[_0x908d('0x74')]]);if(_0xe9354e[_0x908d('0xae')]===-0x1){return _0xe9354e;}return this[_0x908d('0xd')][_0x908d('0xa7')](util[_0x908d('0x28')](_0x908d('0xbf'),_0x908d('0x1bb'),_0x230786['mailbox']));};AGIVertices[_0x908d('0x10')][_0x908d('0x1bc')]=function(_0x1a3d48){logger[_0x908d('0x2d')](util['format'](_0x908d('0x1bd'),_0x1a3d48['label']));if(!this[_0x908d('0x83')](_0x1a3d48[_0x908d('0xd5')])){return this['channel'][_0x908d('0x2b')](_0x1a3d48,'no\x20variable\x20selected');}var _0x2750f1=this['getVariable'][_0x908d('0x6c')](this,_0x1a3d48[_0x908d('0xd5')]);if(!_0x2750f1){return this[_0x908d('0xd')][_0x908d('0x2b')](_0x1a3d48,_0x908d('0xd7'));}var _0x1d537b=this[_0x908d('0xd')][_0x908d('0xa1')](_0x2750f1);return{'code':0xc8,'result':_0x1d537b['extra']?_0x1d537b[_0x908d('0x9f')]:'-'};};String[_0x908d('0x10')][_0x908d('0x9e')]=function(_0x3f369e,_0x35d48e){return this['split'](_0x3f369e)['join'](_0x35d48e);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 63c9ff8..13abc6f 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 _0x0faa=['../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','updateAcw','lastPauseAt','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','prototype','startAcw','queue','ACW','name','mandatoryDispositionPause','QueuePause','then','getAgent','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','message','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','deleteChannelAfterTimeout','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','../ami','acw','../rpc/user'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x0faa,0xb3));var _0xa0fa=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0faa[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var moment=require('moment');var ami=require(_0xa0fa('0x0'));var logger=require('../../../config/logger')(_0xa0fa('0x1'));var RpcUser=require(_0xa0fa('0x2'));var RpcVoiceAgentReport=require(_0xa0fa('0x3'));function Acw(_0x1cf2a1){this[_0xa0fa('0x4')]=_0x1cf2a1[_0xa0fa('0x4')];this[_0xa0fa('0x5')]=_0x1cf2a1[_0xa0fa('0x5')];this[_0xa0fa('0x6')]=_0x1cf2a1[_0xa0fa('0x6')];this[_0xa0fa('0x7')]={};ami['on'](_0xa0fa('0x8'),this[_0xa0fa('0x9')][_0xa0fa('0xa')](this));ami['on'](_0xa0fa('0xb'),this[_0xa0fa('0xc')][_0xa0fa('0xa')](this));ami['on']('hangup',this[_0xa0fa('0xd')][_0xa0fa('0xa')](this));ami['on'](_0xa0fa('0xe'),this[_0xa0fa('0xf')]['bind'](this));ami['on'](_0xa0fa('0x10'),this[_0xa0fa('0x11')][_0xa0fa('0xa')](this));ami['on'](_0xa0fa('0x12'),this[_0xa0fa('0x13')][_0xa0fa('0xa')](this));ami['on'](_0xa0fa('0x14'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x8ddf52){var _0x3a88e7=moment()[_0xa0fa('0x15')](0x0);var _0x1e7a3d=moment(_0x8ddf52)[_0xa0fa('0x15')](0x0);return _0x3a88e7[_0xa0fa('0x16')](_0x1e7a3d,_0xa0fa('0x17'));}Acw['prototype'][_0xa0fa('0x18')]=function(_0x1971d4,_0x4f19d5){var _0x4bc13f=this;var _0xd820d0=getDiff(_0x4bc13f[_0xa0fa('0x6')][_0x1971d4][_0xa0fa('0x19')]);clearTimeout(_0x4bc13f[_0xa0fa('0x6')][_0x1971d4][_0xa0fa('0x1a')]);_0x4bc13f[_0xa0fa('0x6')][_0x1971d4][_0xa0fa('0x1a')]=![];return RpcVoiceAgentReport[_0xa0fa('0x1b')]({'acwtime':_0xd820d0},_0x4bc13f['timers'][_0x1971d4][_0xa0fa('0x1c')],_0x1971d4)['then'](function(_0x1c8e5b){logger['info'](_0xa0fa('0x1d'),_0x4f19d5,_0xd820d0,_0x1c8e5b);})[_0xa0fa('0x1e')](function(_0x5a8b4a){logger[_0xa0fa('0x1f')](_0xa0fa('0x20'),_0x4f19d5,_0x5a8b4a);})[_0xa0fa('0x21')](function(){delete _0x4bc13f['timers'][_0x1971d4];});};Acw[_0xa0fa('0x22')][_0xa0fa('0x23')]=function(_0x3c09a4){try{var _0x4435a1=this;var _0x26ef65=this[_0xa0fa('0x7')][_0x3c09a4]['interface'];var _0x329b08=this[_0xa0fa('0x7')][_0x3c09a4][_0xa0fa('0x24')];var _0x3c0808=this[_0xa0fa('0x4')][_0x329b08];var _0x2a4b84=![];var _0x16be46=_0xa0fa('0x25');if(_0x3c0808['mandatoryDisposition']&&_0x3c0808['mandatoryDispositionPause'][_0xa0fa('0x26')]){_0x2a4b84=!![];_0x16be46=_0x3c0808[_0xa0fa('0x27')][_0xa0fa('0x26')];}return ami['Action']({'action':_0xa0fa('0x28'),'interface':_0x26ef65,'paused':!![],'reason':_0x16be46})[_0xa0fa('0x29')](function(){if(_0x4435a1['agents'][_0x26ef65]){return RpcUser[_0xa0fa('0x2a')](_0x4435a1['agents'][_0x26ef65]['id'])[_0xa0fa('0x29')](function(_0x206256){if(!_0x206256||_0x206256['voicePause']){logger[_0xa0fa('0x2b')](_0xa0fa('0x2c'),_0x3c09a4,_0x26ef65,_0x329b08);return;}logger['info'](_0xa0fa('0x2d'),_0x3c09a4,_0x26ef65,_0x329b08);var _0x497ef0=_0x4435a1[_0xa0fa('0x7')][_0x3c09a4][_0xa0fa('0x2e')]&&_0x4435a1[_0xa0fa('0x7')][_0x3c09a4][_0xa0fa('0x2f')]?_0x4435a1['channels'][_0x3c09a4][_0xa0fa('0x2f')]:_0x3c09a4;return RpcUser[_0xa0fa('0x30')](_0x4435a1[_0xa0fa('0x5')][_0x26ef65],_0x16be46,_0x497ef0)[_0xa0fa('0x29')](function(_0x74817f){_0x4435a1[_0xa0fa('0x4')][_0x329b08][_0xa0fa('0x31')]-=0x1;_0x4435a1[_0xa0fa('0x4')][_0x329b08][_0xa0fa('0x32')]+=0x1;return _0x74817f;});})[_0xa0fa('0x29')](function(_0x22c07f){if(_0x2a4b84||!_0x22c07f){return;}_0x4435a1[_0xa0fa('0x6')][_0x26ef65]={};logger[_0xa0fa('0x2b')](_0xa0fa('0x33'),_0x3c09a4,_0x4435a1[_0xa0fa('0x4')][_0x329b08][_0xa0fa('0x34')],_0x26ef65,_0x329b08);_0x4435a1[_0xa0fa('0x6')][_0x26ef65][_0xa0fa('0x1a')]=setTimeout(_0x4435a1[_0xa0fa('0x35')][_0xa0fa('0xa')](_0x4435a1,_0x26ef65),_0x4435a1[_0xa0fa('0x4')][_0x329b08]['acwTimeout']*0x3e8);_0x4435a1[_0xa0fa('0x6')][_0x26ef65][_0xa0fa('0x19')]=moment()[_0xa0fa('0x36')]('YYYY-MM-DD\x20HH:mm:ss');_0x4435a1[_0xa0fa('0x6')][_0x26ef65][_0xa0fa('0x1c')]=_0x3c09a4;_0x4435a1[_0xa0fa('0x6')][_0x26ef65]['queue']=_0x329b08;_0x4435a1[_0xa0fa('0x6')][_0x26ef65][_0xa0fa('0x18')]=_0x4435a1['updateAcw'][_0xa0fa('0xa')](_0x4435a1,_0x26ef65,_0x3c09a4);});}})[_0xa0fa('0x1e')](function(){logger[_0xa0fa('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3c09a4,_0x4435a1['voiceQueues'][_0x329b08][_0xa0fa('0x34')],_0x26ef65,_0x329b08);})[_0xa0fa('0x21')](function(){delete _0x4435a1['channels'][_0x3c09a4];});}catch(_0x16b338){logger[_0xa0fa('0x1f')](_0xa0fa('0x37'),_0x16b338['message']);}};Acw[_0xa0fa('0x22')]['stopAcw']=function(_0x680a40){try{var _0x3e5d7c=this;if(_0x3e5d7c['timers'][_0x680a40]){_0x3e5d7c['timers'][_0x680a40][_0xa0fa('0x1a')]=![];var _0x531d89=_0x3e5d7c[_0xa0fa('0x6')][_0x680a40][_0xa0fa('0x1c')];var _0x16f879=_0x3e5d7c[_0xa0fa('0x6')][_0x680a40]['queue'];var _0x49cab8=_0x3e5d7c[_0xa0fa('0x4')][_0x16f879][_0xa0fa('0x34')];logger[_0xa0fa('0x2b')](_0xa0fa('0x38'),_0x531d89,_0x680a40);RpcUser['getAgent'](this[_0xa0fa('0x5')][_0x680a40]['id'])[_0xa0fa('0x29')](function(_0x2db7ce){if(_0x2db7ce[_0xa0fa('0x39')]===_0xa0fa('0x25')){return RpcUser[_0xa0fa('0x3a')](_0x3e5d7c[_0xa0fa('0x5')][_0x680a40]);}});RpcVoiceAgentReport[_0xa0fa('0x1b')]({'acwtime':_0x49cab8,'agentacw':!![]},_0x531d89,_0x680a40)[_0xa0fa('0x29')](function(_0x2d5cfe){logger[_0xa0fa('0x2b')](_0xa0fa('0x1d'),_0x531d89,_0x49cab8,_0x2d5cfe);})[_0xa0fa('0x1e')](function(_0x5dc9d4){logger['error'](_0xa0fa('0x20'),_0x531d89,_0x5dc9d4);});}else{logger[_0xa0fa('0x1f')](_0xa0fa('0x3b'),_0x680a40);if(_0x3e5d7c['timers']){logger['info'](_0xa0fa('0x3c'),JSON[_0xa0fa('0x3d')](_0x3e5d7c[_0xa0fa('0x6')]));}}}catch(_0x52e668){logger[_0xa0fa('0x1f')]('[ACW][STOP]\x20%s',_0x52e668['message']);}};Acw[_0xa0fa('0x22')][_0xa0fa('0x9')]=function(_0x389319){try{if(this[_0xa0fa('0x4')][_0x389319[_0xa0fa('0x24')]]&&(this['voiceQueues'][_0x389319[_0xa0fa('0x24')]]['acw']||this['voiceQueues'][_0x389319[_0xa0fa('0x24')]][_0xa0fa('0x3e')])){if(this[_0xa0fa('0x5')][_0x389319[_0xa0fa('0x3f')]]){this[_0xa0fa('0x7')][_0x389319[_0xa0fa('0x1c')]]={'queue':_0x389319[_0xa0fa('0x24')],'interface':_0x389319[_0xa0fa('0x3f')],'destlinkedid':_0x389319['destlinkedid']};}}}catch(_0x26d4c6){logger[_0xa0fa('0x1f')](_0xa0fa('0x40'),_0x26d4c6[_0xa0fa('0x41')]);}};Acw[_0xa0fa('0x22')][_0xa0fa('0x42')]=function(_0x1a5c9e){try{if(this['voiceQueues'][_0x1a5c9e[_0xa0fa('0x24')]]&&(this[_0xa0fa('0x4')][_0x1a5c9e[_0xa0fa('0x24')]]['acw']||this[_0xa0fa('0x4')][_0x1a5c9e[_0xa0fa('0x24')]]['mandatoryDisposition'])){if(this[_0xa0fa('0x5')][_0x1a5c9e['interface']]){this[_0xa0fa('0x7')][_0x1a5c9e['uniqueid']]={'queue':_0x1a5c9e['queue'],'interface':_0x1a5c9e['interface']};}}}catch(_0x177705){logger[_0xa0fa('0x1f')](_0xa0fa('0x43'),_0x177705[_0xa0fa('0x41')]);}};Acw[_0xa0fa('0x22')][_0xa0fa('0xc')]=function(_0x51ede0){try{if(this[_0xa0fa('0x7')][_0x51ede0[_0xa0fa('0x1c')]]&&_[_0xa0fa('0x44')](this[_0xa0fa('0x7')][_0x51ede0['uniqueid']][_0xa0fa('0x2e')])){logger[_0xa0fa('0x2b')](_0xa0fa('0x45'),_0x51ede0[_0xa0fa('0x1c')]);this[_0xa0fa('0x23')](_0x51ede0['uniqueid']);}else if(this[_0xa0fa('0x7')][_0x51ede0[_0xa0fa('0x46')]]&&_['isUndefined'](this[_0xa0fa('0x7')][_0x51ede0['linkedid']][_0xa0fa('0x2e')])){logger[_0xa0fa('0x2b')](_0xa0fa('0x47'),_0x51ede0[_0xa0fa('0x46')]);this[_0xa0fa('0x23')](_0x51ede0[_0xa0fa('0x46')]);}}catch(_0x32df30){logger[_0xa0fa('0x1f')](_0xa0fa('0x48'),_0x32df30['message']);}};Acw['prototype'][_0xa0fa('0xd')]=function(_0xbebd56){try{if(this[_0xa0fa('0x7')][_0xbebd56[_0xa0fa('0x1c')]]&&this[_0xa0fa('0x7')][_0xbebd56['uniqueid']]['attended']){logger[_0xa0fa('0x2b')](_0xa0fa('0x49'),_0xbebd56[_0xa0fa('0x1c')]);this[_0xa0fa('0x23')](_0xbebd56[_0xa0fa('0x1c')]);}else if(this['channels'][_0xbebd56['linkedid']]&&this['channels'][_0xbebd56[_0xa0fa('0x46')]][_0xa0fa('0x2e')]){logger[_0xa0fa('0x2b')](_0xa0fa('0x4a'),_0xbebd56['linkedid']);this['startAcw'](_0xbebd56[_0xa0fa('0x46')]);}}catch(_0x14f8a5){logger[_0xa0fa('0x1f')](_0xa0fa('0x4b'),_0x14f8a5[_0xa0fa('0x41')]);}};Acw[_0xa0fa('0x22')][_0xa0fa('0x11')]=function(_0x2adf08){try{if(!_[_0xa0fa('0x4c')](this[_0xa0fa('0x7')][_0x2adf08[_0xa0fa('0x4d')]])){this[_0xa0fa('0x23')](_0x2adf08[_0xa0fa('0x4d')]);if(this[_0xa0fa('0x7')][_0x2adf08[_0xa0fa('0x4e')]]){this['channels'][_0x2adf08['secondtransfereruniqueid']][_0xa0fa('0x2e')]=!![];this[_0xa0fa('0x7')][_0x2adf08[_0xa0fa('0x4f')]]=this[_0xa0fa('0x7')][_0x2adf08[_0xa0fa('0x4e')]];this['deleteChannelAfterTimeout'](_0x2adf08[_0xa0fa('0x4e')]);}}else if(!_[_0xa0fa('0x4c')](this['channels'][_0x2adf08['transfertargetuniqueid']])){this['startAcw'](_0x2adf08[_0xa0fa('0x4f')]);if(this['channels'][_0x2adf08[_0xa0fa('0x50')]]){this[_0xa0fa('0x7')][_0x2adf08[_0xa0fa('0x50')]][_0xa0fa('0x2e')]=!![];this[_0xa0fa('0x7')][_0x2adf08[_0xa0fa('0x4d')]]=this['channels'][_0x2adf08[_0xa0fa('0x50')]];this[_0xa0fa('0x51')](_0x2adf08[_0xa0fa('0x50')]);}}}catch(_0x2dfd82){logger[_0xa0fa('0x1f')](_0xa0fa('0x52'),_0x2dfd82[_0xa0fa('0x41')]);}};Acw[_0xa0fa('0x22')]['syncBlindTransfer']=function(_0x1bd744){try{if(this['channels'][_0x1bd744[_0xa0fa('0x53')]]){logger[_0xa0fa('0x2b')](_0xa0fa('0x54'),JSON[_0xa0fa('0x3d')](_0x1bd744['transfereruniqueid']));this[_0xa0fa('0x23')](_0x1bd744['transfereruniqueid']);}else if(this[_0xa0fa('0x7')][_0x1bd744['transfererlinkedid']]){logger['info'](_0xa0fa('0x55'),JSON[_0xa0fa('0x3d')](_0x1bd744[_0xa0fa('0x56')]));this[_0xa0fa('0x23')](_0x1bd744[_0xa0fa('0x56')]);}}catch(_0x477561){logger[_0xa0fa('0x1f')]('[ACW][syncBlindTransfer]\x20%s',_0x477561[_0xa0fa('0x41')]);}};Acw[_0xa0fa('0x22')][_0xa0fa('0xf')]=function(_0x5e3707){try{if(this[_0xa0fa('0x4')][_0x5e3707[_0xa0fa('0x24')]]&&this['voiceQueues'][_0x5e3707['queue']][_0xa0fa('0x57')]==='all'){if(this[_0xa0fa('0x5')][_0x5e3707['interface']]){logger[_0xa0fa('0x2b')](_0xa0fa('0x58'),_0x5e3707['uniqueid'],_0x5e3707[_0xa0fa('0x3f')],_0x5e3707[_0xa0fa('0x24')]);return RpcUser[_0xa0fa('0x30')](this[_0xa0fa('0x5')][_0x5e3707['interface']],_0xa0fa('0x59'),_0x5e3707[_0xa0fa('0x1c')]);}}}catch(_0x5c3715){logger[_0xa0fa('0x1f')](_0xa0fa('0x5a'),_0x5c3715[_0xa0fa('0x41')]);}};Acw['prototype'][_0xa0fa('0x51')]=function(_0x33d7c3,_0x21a6b7=0x2710){if(this[_0xa0fa('0x7')][_0x33d7c3]){setTimeout(()=>{delete this[_0xa0fa('0x7')][_0x33d7c3];},_0x21a6b7);}};module['exports']=Acw; \ No newline at end of file +var _0x3a2c=['finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','secondtransfereruniqueid','transfertargetuniqueid','deleteChannelAfterTimeout','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','lastPauseAt','timer','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw'];(function(_0xc74312,_0x3d8ef0){var _0x3a9838=function(_0x49cfac){while(--_0x49cfac){_0xc74312['push'](_0xc74312['shift']());}};_0x3a9838(++_0x3d8ef0);}(_0x3a2c,0xe0));var _0xc3a2=function(_0x2787b6,_0x286653){_0x2787b6=_0x2787b6-0x0;var _0x483b48=_0x3a2c[_0x2787b6];return _0x483b48;};'use strict';var _=require(_0xc3a2('0x0'));var moment=require('moment');var ami=require(_0xc3a2('0x1'));var logger=require(_0xc3a2('0x2'))(_0xc3a2('0x3'));var RpcUser=require(_0xc3a2('0x4'));var RpcVoiceAgentReport=require(_0xc3a2('0x5'));function Acw(_0xeb1976){this[_0xc3a2('0x6')]=_0xeb1976['voiceQueues'];this[_0xc3a2('0x7')]=_0xeb1976[_0xc3a2('0x7')];this['timers']=_0xeb1976[_0xc3a2('0x8')];this[_0xc3a2('0x9')]={};ami['on'](_0xc3a2('0xa'),this['syncAgentConnect'][_0xc3a2('0xb')](this));ami['on'](_0xc3a2('0xc'),this[_0xc3a2('0xd')][_0xc3a2('0xb')](this));ami['on'](_0xc3a2('0xe'),this[_0xc3a2('0xf')]['bind'](this));ami['on']('agentringnoanswer',this[_0xc3a2('0x10')][_0xc3a2('0xb')](this));ami['on'](_0xc3a2('0x11'),this['syncAttendedTransfer'][_0xc3a2('0xb')](this));ami['on'](_0xc3a2('0x12'),this[_0xc3a2('0x13')][_0xc3a2('0xb')](this));ami['on'](_0xc3a2('0x14'),this[_0xc3a2('0x15')][_0xc3a2('0xb')](this));}function getDiff(_0x56862e){var _0x22b627=moment()[_0xc3a2('0x16')](0x0);var _0x4cfeb2=moment(_0x56862e)[_0xc3a2('0x16')](0x0);return _0x22b627['diff'](_0x4cfeb2,_0xc3a2('0x17'));}Acw[_0xc3a2('0x18')]['updateAcw']=function(_0x4328dc,_0xadc06d){var _0x11e1e3=this;var _0x7b9980=getDiff(_0x11e1e3[_0xc3a2('0x8')][_0x4328dc][_0xc3a2('0x19')]);clearTimeout(_0x11e1e3[_0xc3a2('0x8')][_0x4328dc][_0xc3a2('0x1a')]);_0x11e1e3['timers'][_0x4328dc][_0xc3a2('0x1a')]=![];return RpcVoiceAgentReport[_0xc3a2('0x1b')]({'acwtime':_0x7b9980},_0x11e1e3['timers'][_0x4328dc][_0xc3a2('0x1c')],_0x4328dc)[_0xc3a2('0x1d')](function(_0x3b6d63){logger['info'](_0xc3a2('0x1e'),_0xadc06d,_0x7b9980,_0x3b6d63);})[_0xc3a2('0x1f')](function(_0x1db69a){logger[_0xc3a2('0x20')](_0xc3a2('0x21'),_0xadc06d,_0x1db69a);})['finally'](function(){delete _0x11e1e3[_0xc3a2('0x8')][_0x4328dc];});};Acw[_0xc3a2('0x18')]['startAcw']=function(_0x85f0c8){try{var _0x3a6f1a=this;var _0xe57e8b=this[_0xc3a2('0x9')][_0x85f0c8][_0xc3a2('0x22')];var _0x52c982=this['channels'][_0x85f0c8][_0xc3a2('0x23')];var _0x52ff91=this[_0xc3a2('0x6')][_0x52c982];var _0x48ed8e=![];var _0x4a307b=_0xc3a2('0x24');if(_0x52ff91[_0xc3a2('0x25')]&&_0x52ff91[_0xc3a2('0x26')][_0xc3a2('0x27')]){_0x48ed8e=!![];_0x4a307b=_0x52ff91[_0xc3a2('0x26')]['name'];}return ami[_0xc3a2('0x28')]({'action':_0xc3a2('0x29'),'interface':_0xe57e8b,'paused':!![],'reason':_0x4a307b})['then'](function(){if(_0x3a6f1a[_0xc3a2('0x7')][_0xe57e8b]){return RpcUser[_0xc3a2('0x2a')](_0x3a6f1a['agents'][_0xe57e8b]['id'])[_0xc3a2('0x1d')](function(_0x3e880e){if(!_0x3e880e||_0x3e880e[_0xc3a2('0x2b')]){logger[_0xc3a2('0x2c')](_0xc3a2('0x2d'),_0x85f0c8,_0xe57e8b,_0x52c982);return;}logger[_0xc3a2('0x2c')](_0xc3a2('0x2e'),_0x85f0c8,_0xe57e8b,_0x52c982);var _0x40549f=_0x3a6f1a[_0xc3a2('0x9')][_0x85f0c8][_0xc3a2('0x2f')]&&_0x3a6f1a['channels'][_0x85f0c8][_0xc3a2('0x30')]?_0x3a6f1a['channels'][_0x85f0c8][_0xc3a2('0x30')]:_0x85f0c8;return RpcUser[_0xc3a2('0x31')](_0x3a6f1a[_0xc3a2('0x7')][_0xe57e8b],_0x4a307b,_0x40549f)[_0xc3a2('0x1d')](function(_0x53d19d){_0x3a6f1a[_0xc3a2('0x6')][_0x52c982][_0xc3a2('0x32')]-=0x1;_0x3a6f1a[_0xc3a2('0x6')][_0x52c982][_0xc3a2('0x33')]+=0x1;return _0x53d19d;});})[_0xc3a2('0x1d')](function(_0x35b5b7){if(_0x48ed8e||!_0x35b5b7){return;}_0x3a6f1a[_0xc3a2('0x8')][_0xe57e8b]={};logger[_0xc3a2('0x2c')](_0xc3a2('0x34'),_0x85f0c8,_0x3a6f1a[_0xc3a2('0x6')][_0x52c982][_0xc3a2('0x35')],_0xe57e8b,_0x52c982);_0x3a6f1a[_0xc3a2('0x8')][_0xe57e8b][_0xc3a2('0x1a')]=setTimeout(_0x3a6f1a[_0xc3a2('0x36')][_0xc3a2('0xb')](_0x3a6f1a,_0xe57e8b),_0x3a6f1a[_0xc3a2('0x6')][_0x52c982]['acwTimeout']*0x3e8);_0x3a6f1a[_0xc3a2('0x8')][_0xe57e8b][_0xc3a2('0x19')]=moment()[_0xc3a2('0x37')](_0xc3a2('0x38'));_0x3a6f1a[_0xc3a2('0x8')][_0xe57e8b]['uniqueid']=_0x85f0c8;_0x3a6f1a['timers'][_0xe57e8b][_0xc3a2('0x23')]=_0x52c982;_0x3a6f1a[_0xc3a2('0x8')][_0xe57e8b][_0xc3a2('0x39')]=_0x3a6f1a['updateAcw'][_0xc3a2('0xb')](_0x3a6f1a,_0xe57e8b,_0x85f0c8);});}})[_0xc3a2('0x1f')](function(){logger[_0xc3a2('0x20')](_0xc3a2('0x34'),_0x85f0c8,_0x3a6f1a['voiceQueues'][_0x52c982][_0xc3a2('0x35')],_0xe57e8b,_0x52c982);})[_0xc3a2('0x3a')](function(){delete _0x3a6f1a['channels'][_0x85f0c8];});}catch(_0x5b51f7){logger[_0xc3a2('0x20')](_0xc3a2('0x3b'),_0x5b51f7[_0xc3a2('0x3c')]);}};Acw[_0xc3a2('0x18')]['stopAcw']=function(_0x467485){try{var _0x17c323=this;if(_0x17c323['timers'][_0x467485]){_0x17c323['timers'][_0x467485][_0xc3a2('0x1a')]=![];var _0x113167=_0x17c323[_0xc3a2('0x8')][_0x467485][_0xc3a2('0x1c')];var _0x536912=_0x17c323[_0xc3a2('0x8')][_0x467485][_0xc3a2('0x23')];var _0x21dab4=_0x17c323[_0xc3a2('0x6')][_0x536912]['acwTimeout'];logger['info'](_0xc3a2('0x3d'),_0x113167,_0x467485);RpcUser[_0xc3a2('0x2a')](this[_0xc3a2('0x7')][_0x467485]['id'])[_0xc3a2('0x1d')](function(_0x105ff0){if(_0x105ff0['pauseType']===_0xc3a2('0x24')){return RpcUser[_0xc3a2('0x3e')](_0x17c323['agents'][_0x467485]);}});RpcVoiceAgentReport[_0xc3a2('0x1b')]({'acwtime':_0x21dab4,'agentacw':!![]},_0x113167,_0x467485)[_0xc3a2('0x1d')](function(_0x3cb574){logger[_0xc3a2('0x2c')](_0xc3a2('0x1e'),_0x113167,_0x21dab4,_0x3cb574);})[_0xc3a2('0x1f')](function(_0x36d40e){logger['error'](_0xc3a2('0x21'),_0x113167,_0x36d40e);});}else{logger[_0xc3a2('0x20')](_0xc3a2('0x3f'),_0x467485);if(_0x17c323['timers']){logger['info'](_0xc3a2('0x40'),JSON[_0xc3a2('0x41')](_0x17c323[_0xc3a2('0x8')]));}}}catch(_0x1ac294){logger[_0xc3a2('0x20')](_0xc3a2('0x42'),_0x1ac294[_0xc3a2('0x3c')]);}};Acw[_0xc3a2('0x18')][_0xc3a2('0x43')]=function(_0x1704b7){try{if(this['voiceQueues'][_0x1704b7[_0xc3a2('0x23')]]&&(this[_0xc3a2('0x6')][_0x1704b7['queue']][_0xc3a2('0x3')]||this['voiceQueues'][_0x1704b7['queue']][_0xc3a2('0x25')])){if(this[_0xc3a2('0x7')][_0x1704b7[_0xc3a2('0x22')]]){this[_0xc3a2('0x9')][_0x1704b7[_0xc3a2('0x1c')]]={'queue':_0x1704b7[_0xc3a2('0x23')],'interface':_0x1704b7[_0xc3a2('0x22')],'destlinkedid':_0x1704b7[_0xc3a2('0x30')]};}}}catch(_0x566753){logger[_0xc3a2('0x20')](_0xc3a2('0x44'),_0x566753[_0xc3a2('0x3c')]);}};Acw[_0xc3a2('0x18')]['syncAgentConnectPreview']=function(_0x2838f2){try{if(this[_0xc3a2('0x6')][_0x2838f2[_0xc3a2('0x23')]]&&(this[_0xc3a2('0x6')][_0x2838f2['queue']][_0xc3a2('0x3')]||this[_0xc3a2('0x6')][_0x2838f2[_0xc3a2('0x23')]][_0xc3a2('0x25')])){if(this[_0xc3a2('0x7')][_0x2838f2[_0xc3a2('0x22')]]){this['channels'][_0x2838f2[_0xc3a2('0x1c')]]={'queue':_0x2838f2[_0xc3a2('0x23')],'interface':_0x2838f2['interface']};}}}catch(_0x10d82f){logger[_0xc3a2('0x20')](_0xc3a2('0x45'),_0x10d82f['message']);}};Acw[_0xc3a2('0x18')][_0xc3a2('0xd')]=function(_0x5c1356){try{if(this[_0xc3a2('0x9')][_0x5c1356[_0xc3a2('0x1c')]]&&_[_0xc3a2('0x46')](this[_0xc3a2('0x9')][_0x5c1356[_0xc3a2('0x1c')]][_0xc3a2('0x2f')])){logger['info'](_0xc3a2('0x47'),_0x5c1356[_0xc3a2('0x1c')]);this['startAcw'](_0x5c1356[_0xc3a2('0x1c')]);}else if(this['channels'][_0x5c1356[_0xc3a2('0x48')]]&&_[_0xc3a2('0x46')](this[_0xc3a2('0x9')][_0x5c1356[_0xc3a2('0x48')]]['attended'])){logger[_0xc3a2('0x2c')](_0xc3a2('0x49'),_0x5c1356[_0xc3a2('0x48')]);this[_0xc3a2('0x4a')](_0x5c1356[_0xc3a2('0x48')]);}}catch(_0x2eaaaf){logger[_0xc3a2('0x20')]('[ACW][syncHangupRequest]\x20%s',_0x2eaaaf[_0xc3a2('0x3c')]);}};Acw['prototype'][_0xc3a2('0xf')]=function(_0x328013){try{if(this['channels'][_0x328013[_0xc3a2('0x1c')]]&&this[_0xc3a2('0x9')][_0x328013[_0xc3a2('0x1c')]][_0xc3a2('0x2f')]){logger['info'](_0xc3a2('0x4b'),_0x328013[_0xc3a2('0x1c')]);this[_0xc3a2('0x4a')](_0x328013[_0xc3a2('0x1c')]);}else if(this['channels'][_0x328013[_0xc3a2('0x48')]]&&this['channels'][_0x328013[_0xc3a2('0x48')]][_0xc3a2('0x2f')]){logger[_0xc3a2('0x2c')](_0xc3a2('0x4c'),_0x328013['linkedid']);this[_0xc3a2('0x4a')](_0x328013[_0xc3a2('0x48')]);}}catch(_0x1fcda1){logger[_0xc3a2('0x20')](_0xc3a2('0x4d'),_0x1fcda1['message']);}};Acw['prototype'][_0xc3a2('0x4e')]=function(_0x549596){try{if(!_[_0xc3a2('0x4f')](this[_0xc3a2('0x9')][_0x549596['transfereeuniqueid']])){this[_0xc3a2('0x4a')](_0x549596['transfereeuniqueid']);if(this['channels'][_0x549596[_0xc3a2('0x50')]]){this[_0xc3a2('0x9')][_0x549596['secondtransfereruniqueid']][_0xc3a2('0x2f')]=!![];this[_0xc3a2('0x9')][_0x549596[_0xc3a2('0x51')]]=this['channels'][_0x549596[_0xc3a2('0x50')]];this[_0xc3a2('0x52')](_0x549596[_0xc3a2('0x50')]);}}else if(!_[_0xc3a2('0x4f')](this[_0xc3a2('0x9')][_0x549596[_0xc3a2('0x51')]])){this[_0xc3a2('0x4a')](_0x549596[_0xc3a2('0x51')]);if(this['channels'][_0x549596[_0xc3a2('0x53')]]){this[_0xc3a2('0x9')][_0x549596[_0xc3a2('0x53')]][_0xc3a2('0x2f')]=!![];this[_0xc3a2('0x9')][_0x549596[_0xc3a2('0x54')]]=this[_0xc3a2('0x9')][_0x549596['origtransfereruniqueid']];this[_0xc3a2('0x52')](_0x549596[_0xc3a2('0x53')]);}}}catch(_0x1e5e29){logger[_0xc3a2('0x20')]('[ACW][syncAttendedTransfer]\x20%s',_0x1e5e29['message']);}};Acw[_0xc3a2('0x18')][_0xc3a2('0x13')]=function(_0x3746f7){try{if(this[_0xc3a2('0x9')][_0x3746f7[_0xc3a2('0x55')]]){logger['info'](_0xc3a2('0x56'),JSON[_0xc3a2('0x41')](_0x3746f7[_0xc3a2('0x55')]));this[_0xc3a2('0x4a')](_0x3746f7[_0xc3a2('0x55')]);}else if(this['channels'][_0x3746f7[_0xc3a2('0x57')]]){logger['info'](_0xc3a2('0x58'),JSON[_0xc3a2('0x41')](_0x3746f7['transfererlinkedid']));this[_0xc3a2('0x4a')](_0x3746f7[_0xc3a2('0x57')]);}}catch(_0x4071e6){logger[_0xc3a2('0x20')](_0xc3a2('0x59'),_0x4071e6[_0xc3a2('0x3c')]);}};Acw[_0xc3a2('0x18')]['syncAgentRingNoAnswer']=function(_0x4e64d3){try{if(this[_0xc3a2('0x6')][_0x4e64d3[_0xc3a2('0x23')]]&&this['voiceQueues'][_0x4e64d3[_0xc3a2('0x23')]][_0xc3a2('0x5a')]==='all'){if(this[_0xc3a2('0x7')][_0x4e64d3[_0xc3a2('0x22')]]){logger[_0xc3a2('0x2c')](_0xc3a2('0x5b'),_0x4e64d3[_0xc3a2('0x1c')],_0x4e64d3['interface'],_0x4e64d3[_0xc3a2('0x23')]);return RpcUser['savePause'](this['agents'][_0x4e64d3[_0xc3a2('0x22')]],_0xc3a2('0x5c'),_0x4e64d3[_0xc3a2('0x1c')]);}}}catch(_0x329e89){logger[_0xc3a2('0x20')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x329e89['message']);}};Acw[_0xc3a2('0x18')][_0xc3a2('0x52')]=function(_0x26b203,_0xb0a46b=0x2710){if(this[_0xc3a2('0x9')][_0x26b203]){setTimeout(()=>{delete this[_0xc3a2('0x9')][_0x26b203];},_0xb0a46b);}};module[_0xc3a2('0x5d')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 4020bd5..9d4ab80 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 _0x5a0b=['Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','actionDeviceStateList','then','catch','[ami.js][fullybooted]','close','bluebird','util','../../config/logger','asterisk','password','keepConnected','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','Action','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect'];(function(_0x499bcf,_0x46f0fd){var _0x5b795f=function(_0x4efe95){while(--_0x4efe95){_0x499bcf['push'](_0x499bcf['shift']());}};_0x5b795f(++_0x46f0fd);}(_0x5a0b,0xd9));var _0xb5a0=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x5a0b[_0x4d8ed9];return _0x1e2140;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xb5a0('0x0'));var util=require(_0xb5a0('0x1'));var logger=require(_0xb5a0('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0xb5a0('0x3')]['port'],config[_0xb5a0('0x3')]['ip'],config[_0xb5a0('0x3')]['username'],config[_0xb5a0('0x3')][_0xb5a0('0x4')],!![]);ami[_0xb5a0('0x5')]();ami['Action']=BPromise[_0xb5a0('0x6')](ami['action']);function error(_0x178ecd){logger[_0xb5a0('0x7')](util['format'](_0xb5a0('0x8'),config['asterisk']['username'],config[_0xb5a0('0x3')]['ip'],config[_0xb5a0('0x3')][_0xb5a0('0x9')],util['inspect'](_0x178ecd,![],null)));}function close(){logger[_0xb5a0('0x7')](util[_0xb5a0('0xa')](_0xb5a0('0xb'),config[_0xb5a0('0x3')][_0xb5a0('0xc')],config[_0xb5a0('0x3')]['ip'],config[_0xb5a0('0x3')][_0xb5a0('0x9')]));}ami[_0xb5a0('0xd')]=function(){return function(){return ami['Action']({'action':_0xb5a0('0xe')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xb5a0('0xf')]({'action':_0xb5a0('0x10')});};};ami[_0xb5a0('0x11')]=function(){return function(){return ami[_0xb5a0('0xf')]({'action':'sippeerstatus'});};};ami[_0xb5a0('0x12')]=function(){return function(){return ami['Action']({'action':_0xb5a0('0x13')});};};ami[_0xb5a0('0x14')]=function(){return function(){return ami['Action']({'action':_0xb5a0('0x15')});};};function connect(){logger[_0xb5a0('0x16')](util['format'](_0xb5a0('0x17'),config[_0xb5a0('0x3')][_0xb5a0('0xc')],config[_0xb5a0('0x3')]['ip'],config[_0xb5a0('0x3')][_0xb5a0('0x9')]));ami[_0xb5a0('0x18')](_0xb5a0('0x7'),error);ami[_0xb5a0('0x18')]('close',close);}ami['on']('connect',connect);ami['on'](_0xb5a0('0x19'),function(_0x3ed3e1){logger[_0xb5a0('0x16')](util[_0xb5a0('0xa')](_0xb5a0('0x1a'),config[_0xb5a0('0x3')]['username'],config[_0xb5a0('0x3')]['ip'],config[_0xb5a0('0x3')][_0xb5a0('0x9')],util[_0xb5a0('0x1b')](_0x3ed3e1,![],null)));});ami['on']('fullybooted',function(){logger['info'](util[_0xb5a0('0xa')](_0xb5a0('0x1c'),config[_0xb5a0('0x3')]['username'],config[_0xb5a0('0x3')]['ip'],config[_0xb5a0('0x3')]['port']));return Promise[_0xb5a0('0x1d')]()['then'](ami[_0xb5a0('0xd')]())['then'](ami[_0xb5a0('0x1e')]())[_0xb5a0('0x1f')](ami[_0xb5a0('0x11')]())[_0xb5a0('0x1f')](ami['actionQueueSummary']())[_0xb5a0('0x1f')](ami[_0xb5a0('0x14')]())[_0xb5a0('0x20')](function(_0x46670d){logger[_0xb5a0('0x7')](_0xb5a0('0x21'),util[_0xb5a0('0x1b')](_0x46670d,{'showHidden':![],'depth':null}));});});ami['once'](_0xb5a0('0x7'),error);ami[_0xb5a0('0x18')](_0xb5a0('0x22'),close);module['exports']=ami; \ No newline at end of file +var _0x0246=['actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','asterisk-manager','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus'];(function(_0x3b271f,_0x43ce48){var _0x104b37=function(_0x40df04){while(--_0x40df04){_0x3b271f['push'](_0x3b271f['shift']());}};_0x104b37(++_0x43ce48);}(_0x0246,0xe2));var _0x6024=function(_0x555da2,_0xcd6b7a){_0x555da2=_0x555da2-0x0;var _0xbce0ff=_0x0246[_0x555da2];return _0xbce0ff;};'use strict';var Manager=require(_0x6024('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require(_0x6024('0x1'))(_0x6024('0x2'));var config=require(_0x6024('0x3'));var ami=new Manager(config[_0x6024('0x4')]['port'],config[_0x6024('0x4')]['ip'],config['asterisk']['username'],config['asterisk'][_0x6024('0x5')],!![]);ami[_0x6024('0x6')]();ami[_0x6024('0x7')]=BPromise['promisify'](ami[_0x6024('0x8')]);function error(_0x2345bd){logger[_0x6024('0x9')](util[_0x6024('0xa')](_0x6024('0xb'),config['asterisk'][_0x6024('0xc')],config['asterisk']['ip'],config[_0x6024('0x4')][_0x6024('0xd')],util['inspect'](_0x2345bd,![],null)));}function close(){logger[_0x6024('0x9')](util[_0x6024('0xa')](_0x6024('0xe'),config[_0x6024('0x4')]['username'],config['asterisk']['ip'],config[_0x6024('0x4')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x6024('0x7')]({'action':_0x6024('0xf')});};};ami[_0x6024('0x10')]=function(){return function(){return ami[_0x6024('0x7')]({'action':'devicestatelist'});};};ami[_0x6024('0x11')]=function(){return function(){return ami['Action']({'action':_0x6024('0x12')});};};ami[_0x6024('0x13')]=function(){return function(){return ami[_0x6024('0x7')]({'action':'queuesummary'});};};ami[_0x6024('0x14')]=function(){return function(){return ami[_0x6024('0x7')]({'action':_0x6024('0x15')});};};function connect(){logger[_0x6024('0x16')](util[_0x6024('0xa')](_0x6024('0x17'),config['asterisk'][_0x6024('0xc')],config['asterisk']['ip'],config[_0x6024('0x4')][_0x6024('0xd')]));ami[_0x6024('0x18')](_0x6024('0x9'),error);ami[_0x6024('0x18')]('close',close);}ami['on']('connect',connect);ami['on'](_0x6024('0x19'),function(_0x1194d5){logger[_0x6024('0x16')](util[_0x6024('0xa')](_0x6024('0x1a'),config[_0x6024('0x4')]['username'],config[_0x6024('0x4')]['ip'],config[_0x6024('0x4')]['port'],util[_0x6024('0x1b')](_0x1194d5,![],null)));});ami['on'](_0x6024('0x1c'),function(){logger[_0x6024('0x16')](util[_0x6024('0xa')](_0x6024('0x1d'),config['asterisk'][_0x6024('0xc')],config['asterisk']['ip'],config[_0x6024('0x4')][_0x6024('0xd')]));return Promise[_0x6024('0x1e')]()[_0x6024('0x1f')](ami[_0x6024('0x20')]())[_0x6024('0x1f')](ami[_0x6024('0x10')]())['then'](ami[_0x6024('0x11')]())['then'](ami[_0x6024('0x13')]())[_0x6024('0x1f')](ami[_0x6024('0x14')]())[_0x6024('0x21')](function(_0x34558b){logger[_0x6024('0x9')](_0x6024('0x22'),util['inspect'](_0x34558b,{'showHidden':![],'depth':null}));});});ami['once'](_0x6024('0x9'),error);ami['once']('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 943d6e1..9cfc463 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 _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xda3f,0xec));var _0xfda3=function(_0x20e854,_0xea9a85){_0x20e854=_0x20e854-0x0;var _0x16b34f=_0xda3f[_0x20e854];return _0x16b34f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file +var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0xd2dd48,_0x1a985){var _0x3853db=function(_0x2cfb39){while(--_0x2cfb39){_0xd2dd48['push'](_0xd2dd48['shift']());}};_0x3853db(++_0x1a985);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1f7a87,_0x234585){_0x1f7a87=_0x1f7a87-0x0;var _0x4e15bc=_0xb43b[_0x1f7a87];return _0x4e15bc;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index bb9224c..5100b52 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 _0x0662=['handlePower','power','Queue','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','type','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','outboundDropCallsDayTimeout','state','statedesc','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','callAdditionalPhoneAfterMin','countabandonedretry','add','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','queueBooked','preview','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','response','Success','callProgressDetecting','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','countbusyretry','reason19\x20machine....','[rescheduleContact][Machine]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','[syncHangupIvr][createHistory]','queuesSummary','running','INACTIVE','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','online','resolve','handlePreviewRecallNotifications','map','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','Agent','user:%s','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-CAMPAIGNID','setXMDContactVariables','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','dialAbandonedMaxRetry','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','agentBusyFactor','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','maxNumberOriginate','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','Contact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[countReScheduled]\x20','checkIsBlackList','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','actions','uniqueId','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','message','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','Intervals','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','\x20NOT\x20Active','isIVRCampaign','format','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','interval','content','true','catch','iftime\x20%s,%s','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','syncCampaigns','undefined','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive'];(function(_0xd07e81,_0x1ccacd){var _0x379364=function(_0x8f8eec){while(--_0x8f8eec){_0xd07e81['push'](_0xd07e81['shift']());}};_0x379364(++_0x1ccacd);}(_0x0662,0x175));var _0x2066=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0662[_0x484e36];return _0xafc85d;};'use strict';var util=require('util');var _=require(_0x2066('0x0'));var uuid=require(_0x2066('0x1'));var moment=require(_0x2066('0x2'));var rr=require('rr');var Redis=require(_0x2066('0x3'));var utils=require('./utils');var hopperUtils=require(_0x2066('0x4'));var ut=require(_0x2066('0x5'));var config=require(_0x2066('0x6'));var logger=require(_0x2066('0x7'))(_0x2066('0x8'));var loggerBooked=require(_0x2066('0x7'))(_0x2066('0x9'));var loggerPredictive=require(_0x2066('0x7'))(_0x2066('0xa'));var loggerPredictiveCalls=require(_0x2066('0x7'))(_0x2066('0xb'));var loggerSyncQueueSummary=require(_0x2066('0x7'))(_0x2066('0xc'));var ami=require(_0x2066('0xd'));config[_0x2066('0xe')]=_[_0x2066('0xf')](config[_0x2066('0xe')],{'host':_0x2066('0x10'),'port':0x18eb});var io=require(_0x2066('0x11'))(new Redis(config[_0x2066('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x2066('0x12'));var RpcSetting=require(_0x2066('0x13'));var Interval=require(_0x2066('0x14'));var Action=require(_0x2066('0x15'));var History=require(_0x2066('0x16'));var Final=require(_0x2066('0x17'));var AgentComplete=require(_0x2066('0x18'));var QueueCallerAbandon=require(_0x2066('0x19'));var Hangup=require(_0x2066('0x1a'));var ipAgi=process[_0x2066('0x1b')][_0x2066('0x1c')]||_0x2066('0x1d');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x2066('0x1e')][_0x2066('0x1f')]=function(_0xb2f61d){this[_0x2066('0x20')]=this['tail']?this['tail'][_0x2066('0x21')](_0xb2f61d):_0xb2f61d();};function Dialer(_0x13d702,_0x469c67){this['sequence']=new Sequence();this['preview']=_0x469c67;this[_0x2066('0x22')]=_0x13d702[_0x2066('0x22')];this[_0x2066('0x23')]=_0x13d702[_0x2066('0x23')];this[_0x2066('0x24')]=_0x13d702[_0x2066('0x24')];this[_0x2066('0x25')]=_0x13d702[_0x2066('0x25')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x2066('0x26')]={};this['contactsId']={};this[_0x2066('0x27')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this[_0x2066('0x28')]={};this['queuesSummary']={};ami['on'](_0x2066('0x29'),this[_0x2066('0x2a')][_0x2066('0x2b')](this));ami['on'](_0x2066('0x2c'),this[_0x2066('0x2d')][_0x2066('0x2b')](this));ami['on'](_0x2066('0x2e'),this['syncOriginateResponse'][_0x2066('0x2b')](this));ami['on'](_0x2066('0x2f'),this[_0x2066('0x30')][_0x2066('0x2b')](this));ami['on'](_0x2066('0x31'),this[_0x2066('0xc')]['bind'](this));ami['on']('custom:queuesummarycomplete',this[_0x2066('0x32')]['bind'](this));ami['on'](_0x2066('0x33'),this[_0x2066('0x34')][_0x2066('0x2b')](this));ami['on'](_0x2066('0x35'),this[_0x2066('0x36')]['bind'](this));ami['on'](_0x2066('0x37'),this['syncVarSet'][_0x2066('0x2b')](this));ami['on']('queuemember',this[_0x2066('0x38')]['bind'](this));ami['on'](_0x2066('0x39'),this[_0x2066('0x3a')][_0x2066('0x2b')](this));this['loopCampaigns']();this[_0x2066('0x3b')]();RpcSetting[_0x2066('0x3c')]()[_0x2066('0x3d')](function(_0x351f52){previewRecallmeReminderInterval=_0x351f52[_0x2066('0x3e')];});}function isNotNull(_0x46dc0b){return _0x46dc0b!==null&&!_[_0x2066('0x3f')](_0x46dc0b);}function msgResponse(_0x393aa5,_0x2aeb4a,_0x2e0bfb){return{'action':_0x393aa5,'response':_0x2aeb4a,'message':_0x2e0bfb,'stack':_0x2e0bfb};}function emit(_0x57370c,_0x50d222,_0x160149){io['to'](_0x57370c)['emit'](_0x50d222,_0x160149);}function emitOutboundVoiceQueueSummary(_0x4b543a){if(_0x4b543a['type']===_0x2066('0x40')){logger[_0x2066('0x41')](_0x2066('0x42'),util[_0x2066('0x43')](_0x4b543a,{'showHidden':![],'depth':null}));emit(util['format'](_0x2066('0x44'),_0x4b543a['name']),'voice_queue:save',_0x4b543a);}}function checkGetDataPredictive(_0x23378e){if(isNotNull(_0x23378e)&&!_['isEmpty'](_0x23378e)){loggerPredictive[_0x2066('0x45')](_0x2066('0x46'));loggerPredictive[_0x2066('0x45')](_0x2066('0x47'),_0x23378e[_0x2066('0x48')]);loggerPredictive[_0x2066('0x45')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23378e[_0x2066('0x49')]);loggerPredictive[_0x2066('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23378e[_0x2066('0x4a')]);loggerPredictive['info'](_0x2066('0x4b'),_0x23378e[_0x2066('0x4c')]);loggerPredictive[_0x2066('0x45')](_0x2066('0x4d'),_0x23378e['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x2066('0x45')](_0x2066('0x4e'),_0x23378e[_0x2066('0x4f')]);loggerPredictive[_0x2066('0x45')](_0x2066('0x50'));if(_0x23378e[_0x2066('0x48')]>0x0){if(!_[_0x2066('0x3f')](_0x23378e[_0x2066('0x4f')])&&_0x23378e[_0x2066('0x4f')]>0x0){return!![];}loggerPredictive[_0x2066('0x45')](_0x2066('0x51'));if(!_[_0x2066('0x3f')](_0x23378e[_0x2066('0x52')])&&_0x23378e[_0x2066('0x52')]>0x0){return!![];}loggerPredictive[_0x2066('0x45')](_0x2066('0x53'));}else{loggerPredictive[_0x2066('0x45')](_0x2066('0x54'));}}else{loggerPredictive[_0x2066('0x45')](_0x2066('0x55'));}return![];}function mergeDataErlangB(_0x4fc2f9){return function(_0x27a760){loggerPredictive[_0x2066('0x45')](_0x2066('0x56'));loggerPredictive['info'](_0x2066('0x57'),_0x27a760['erlangCalls']);loggerPredictive[_0x2066('0x45')](_0x2066('0x58'),_0x27a760['erlangCallToSecond']);loggerPredictive[_0x2066('0x45')](_0x2066('0x59'),_0x27a760[_0x2066('0x5a')]);loggerPredictive[_0x2066('0x45')](_0x2066('0x5b'),_0x27a760[_0x2066('0x5c')]);loggerPredictive[_0x2066('0x45')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x27a760['erlangAbandonmentRate']);loggerPredictive[_0x2066('0x45')]('---------------------------');_[_0x2066('0x5d')](_0x4fc2f9,_0x27a760);};}function ifInterval(_0x41b5b2,_0x561f22){if(_[_0x2066('0x3f')](_0x561f22)){return![];}return utils[_0x2066('0x5e')](undefined,_0x561f22)<_0x41b5b2*0x3c;}function clearPredictiveAttributes(_0x2fb74c){if(_0x2fb74c[_0x2066('0x5f')]){_0x2fb74c[_0x2066('0x5f')]=undefined;loggerPredictive[_0x2066('0x41')](_0x2fb74c[_0x2066('0x60')],_0x2066('0x61'));}if(_0x2fb74c[_0x2066('0x62')]){_0x2fb74c[_0x2066('0x62')]=undefined;loggerPredictive['debug'](_0x2fb74c[_0x2066('0x60')],'startPredictive\x20value\x20cleared');}if(_0x2fb74c[_0x2066('0x63')]){clearInterval(_0x2fb74c[_0x2066('0x63')]);_0x2fb74c['handlePredictive']=undefined;loggerPredictive[_0x2066('0x41')](_0x2fb74c[_0x2066('0x60')],_0x2066('0x64'));}}function loggerCatchPredictive(_0x2725f8,_0x3713a3){return function(_0x149232){loggerPredictive[_0x2066('0x65')](_0x3713a3[_0x2066('0x60')],_0x2725f8);loggerPredictive[_0x2066('0x65')](_0x149232[_0x2066('0x66')]);clearPredictiveAttributes(_0x3713a3);};}function loggerCatch(_0x3dab3b){return function(_0x4cf773){logger[_0x2066('0x65')](_0x3dab3b,util[_0x2066('0x43')](_0x4cf773,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xb2def6,_0x779544,_0x4c9cae){return function(_0x493a59){utils[_0x2066('0x67')](_0x779544,_0x4c9cae,0x0);_0x779544[_0x2066('0x68')]=0x0;logger[_0x2066('0x65')](_0xb2def6,util[_0x2066('0x43')](_0x493a59,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x511336){return function(_0x2e4fd9){if(isNotNull(_0x2e4fd9)&&isNotNull(_0x2e4fd9[0x0])){if(_0x2e4fd9[0x0][_0x2066('0x69')]>0x0){_0x511336['message']=utils[_0x2066('0x6a')][_0x2066('0x6b')];logger[_0x2066('0x45')](_0x2066('0x6c')+_0x511336[_0x2066('0x60')],_0x2e4fd9[0x0][_0x2066('0x69')],_0x2066('0x6d'));}else{_0x511336['message']=utils[_0x2066('0x6a')][_0x2066('0x6e')];logger[_0x2066('0x45')](_0x2066('0x6f')+_0x511336['name']);}}};}function createObjHistory(_0x4bc815,_0x26250c,_0x58cae1,_0x45222c,_0x3dac6e){_0x4bc815[_0x2066('0x70')]=_0x58cae1;var _0x2e3de3=new Action(_0x4bc815,_0x26250c);var _0x297684=new History(_0x2e3de3);_0x297684['state']=_0x45222c;_0x297684['statedesc']=_0x3dac6e;_0x297684[_0x2066('0x71')]=_0x2e3de3[_0x2066('0x72')];return _0x297684;}function unlockQueueStatus(_0x3879e9,_0x3dcdaf){setTimeout(function(){if(_[_0x2066('0x3f')](_0x3879e9[_0x2066('0x73')])){loggerBooked[_0x2066('0x65')](_0x2066('0x74'),_0x3dcdaf);}_0x3879e9['queueStatusComplete']=!![];loggerBooked[_0x2066('0x45')](_0x2066('0x75'),_0x3dcdaf,JSON[_0x2066('0x76')](_[_0x2066('0x77')](_0x3879e9,[_0x2066('0x60'),_0x2066('0x73')])));},0x1f3);}function checkInterval(_0x4e6eaf){return function(){if(!isNotNull(_0x4e6eaf[_0x2066('0x78')])){_0x4e6eaf[_0x2066('0x70')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x4e6eaf[_0x2066('0x60')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4e6eaf[_0x2066('0x78')][_0x2066('0x79')])){_0x4e6eaf[_0x2066('0x70')]=utils['CAMPAIGN_STATUS'][_0x2066('0x7a')];throw _0x4e6eaf['name']+_0x2066('0x7b');}if(!isNotNull(_[_0x2066('0x7c')](_0x4e6eaf[_0x2066('0x78')]['Intervals']))){_0x4e6eaf[_0x2066('0x70')]=utils[_0x2066('0x6a')][_0x2066('0x7a')];throw _0x4e6eaf['name']+_0x2066('0x7b');}};}function checkIsIVRCampaignActive(_0x246b8d){return function(){if(!utils[_0x2066('0x7d')](_0x246b8d)){_0x246b8d[_0x2066('0x70')]=utils[_0x2066('0x6a')]['INACTIVE'];throw _0x246b8d['name']+_0x2066('0x7e');}};}function emitCampaignSummary(_0x275723){if(utils[_0x2066('0x7f')](_0x275723)){emit(util[_0x2066('0x80')]('campaign:ivr:%s',_0x275723[_0x2066('0x60')]),_0x2066('0x81'),_0x275723);}}function loggerCatchQueueSummary(_0x52ee4e,_0x51db08){return function(_0x356f7d){clearPredictiveAttributes(_0x51db08);emitCampaignSummary(_0x51db08);loggerSyncQueueSummary[_0x2066('0x41')](_0x52ee4e,util['inspect'](_0x356f7d,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x339450){if(_0x339450[_0x2066('0x82')]){if(_0x339450[_0x2066('0x83')]===0x0){_0x339450[_0x2066('0x82')]=![];_0x339450['message']=utils[_0x2066('0x6a')]['INACTIVE'];loggerSyncQueueSummary[_0x2066('0x41')](_0x2066('0x84'),_0x339450[_0x2066('0x60')],_0x2066('0x85'));}else{_0x339450[_0x2066('0x70')]=utils[_0x2066('0x6a')]['DISACTIVED'];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x339450[_0x2066('0x60')],_0x2066('0x86'));}emitCampaignSummary(_0x339450);}}function myreject(_0x344d63){return function(_0x20af3a){return _0x344d63(msgResponse(_0x2066('0x87'),_0x2066('0x88'),JSON[_0x2066('0x76')](_0x20af3a)));};}Dialer['prototype'][_0x2066('0x89')]=function(_0x1e3f24){return!_[_0x2066('0x3f')](_0x1e3f24)&&_0x1e3f24&&!_['isUndefined'](_0x1e3f24[_0x2066('0x60')])&&!_[_0x2066('0x3f')](_0x1e3f24['active'])&&_0x1e3f24['active']&&(this[_0x2066('0x25')][util['format'](_0x2066('0x8a'),_0x1e3f24[_0x2066('0x60')])]['status']===_0x2066('0x8b')||this['trunks'][util[_0x2066('0x80')](_0x2066('0x8a'),_0x1e3f24[_0x2066('0x60')])][_0x2066('0x8c')]===_0x2066('0x8d'));};Dialer[_0x2066('0x1e')][_0x2066('0x8e')]=function(_0x256ffe){var _0x466a1b=this;return function(){if(!_0x466a1b['isTrunkReachable'](_0x256ffe[_0x2066('0x8f')])){if(!_0x466a1b[_0x2066('0x89')](_0x256ffe['TrunkBackup'])){_0x256ffe[_0x2066('0x70')]=utils[_0x2066('0x6a')][_0x2066('0x90')];throw _0x256ffe[_0x2066('0x60')]+_0x2066('0x91');}}};};Dialer[_0x2066('0x1e')][_0x2066('0x92')]=function(_0x276cce,_0x5a0a2c,_0x4b99f0,_0x2e149b){var _0x38049f=this;return function(){var _0x1ed4d5=!![];return _0x38049f[_0x2066('0x93')](_0x276cce,_0x5a0a2c,_0x4b99f0,_0x2e149b,_0x1ed4d5);};};Dialer[_0x2066('0x1e')]['checkIfTimeIntervals']=function(_0x4d591c,_0x11a0e0,_0x43a6dd,_0x793b3e){var _0xd4b045=this;return function(){var _0x4a8653=![];return _0xd4b045[_0x2066('0x93')](_0x4d591c[_0x2066('0x79')],_0x11a0e0,_0x43a6dd,_0x793b3e,_0x4a8653);};};Dialer['prototype'][_0x2066('0x93')]=function(_0x4558f9,_0x4a9e98,_0x41aa10,_0x2e4b15,_0xa78c3a){var _0x24ed5c=[];return new Promise(function(_0x24be6c,_0x10373d){if(!isNotNull(_0x4558f9)){_0x2e4b15[_0x2066('0x70')]=utils[_0x2066('0x6a')]['NULL_INTERVAL'];return _0x10373d(msgResponse(_0x2066('0x94'),_0x2066('0x95'),_0x41aa10+_0x2066('0x96')));}if(_['isEmpty'](_0x4558f9)){_0x2e4b15[_0x2066('0x70')]=utils[_0x2066('0x6a')][_0x2066('0x97')];return _0x10373d(msgResponse(_0x2066('0x94'),_0x2066('0x95'),_0x41aa10+'\x20Intervals\x20is\x20empty\x20'));}if(_0x4a9e98&&_[_0x2066('0x3f')](config[_0x2066('0x98')][_0x4a9e98])){_0x2e4b15[_0x2066('0x70')]=utils[_0x2066('0x6a')][_0x2066('0x99')];return _0x10373d(msgResponse('ifTime','Failure',_0x41aa10+_0x2066('0x9a')+_0x4a9e98));}if(_[_0x2066('0x9b')](_0x4558f9)){for(var _0x3beac3=0x0;_0x3beac3<_0x4558f9[_0x2066('0x9c')];_0x3beac3+=0x1){_0x24ed5c[_0x2066('0x9d')](ami[_0x2066('0x9e')]({'action':'command','command':util[_0x2066('0x80')]('iftime\x20%s,%s',_0x4558f9[_0x3beac3][_0x2066('0x9f')],!_[_0x2066('0x3f')](config['timezones'][_0x4a9e98])?_0x4a9e98:'')})[_0x2066('0x3d')](function(_0x5ed332){return _0x5ed332[_0x2066('0xa0')]['indexOf'](_0x2066('0xa1'))>=0x0;})[_0x2066('0xa2')](myreject(_0x10373d)));}}else{_0x24ed5c[_0x2066('0x9d')](ami[_0x2066('0x9e')]({'action':'command','command':util[_0x2066('0x80')](_0x2066('0xa3'),_0x4558f9,!_[_0x2066('0x3f')](config[_0x2066('0x98')][_0x4a9e98])?_0x4a9e98:'')})['then'](function(_0x54c6dd){return _0x54c6dd[_0x2066('0xa0')]['indexOf']('true')>=0x0;})[_0x2066('0xa2')](myreject(_0x10373d)));}Promise['all'](_0x24ed5c)['then'](function(_0x2ea464){var _0x18827d=_['some'](_0x2ea464);if(_0x18827d){return _0x24be6c(_0x18827d);}else{_0x2e4b15[_0x2066('0x70')]=_0xa78c3a?utils[_0x2066('0x6a')][_0x2066('0xa4')]:utils[_0x2066('0x6a')][_0x2066('0xa5')];return _0x10373d(msgResponse(_0x2066('0xa6'),_0x2066('0x95'),'Global:\x20'+_0xa78c3a+'\x20'+_0x41aa10+_0x2066('0xa7')+util[_0x2066('0x43')](_0x4558f9,{'showHidden':![],'depth':null})+_0x2066('0xa8')+_0x4a9e98));}})[_0x2066('0xa2')](function(_0x219136){return _0x10373d(msgResponse(_0x2066('0x94'),_0x2066('0x95'),JSON[_0x2066('0x76')](_0x219136)));});});};Dialer[_0x2066('0x1e')][_0x2066('0xa9')]=function(){var _0x488019=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x2066('0x3d')](function(){setInterval(function(){_0x488019[_0x2066('0xaa')]();},0x3e8);});};Dialer[_0x2066('0x1e')][_0x2066('0xaa')]=function(){var _0x4d5e53=this;var _0x2d1283;for(var _0x16d912 in this['campaigns']){if(typeof this[_0x2066('0x23')][_0x16d912]!==_0x2066('0xab')){_0x2d1283=this[_0x2066('0x23')][_0x16d912];if(utils['isIVRCampaign'](_0x2d1283)&&utils['isIVRCampaignActive'](_0x2d1283)){_0x2d1283[_0x2066('0x82')]=!![];Promise['resolve']()[_0x2066('0x3d')](checkIsIVRCampaignActive(_0x2d1283))['then'](checkInterval(_0x2d1283))[_0x2066('0x3d')](_0x4d5e53['checkIsTrunkReachable'](_0x2d1283))['then'](_0x4d5e53[_0x2066('0x92')](_0x2d1283[_0x2066('0xac')],_0x2d1283[_0x2066('0xad')],_0x2d1283['name'],_0x2d1283))['then'](_0x4d5e53['checkIfTimeIntervals'](_0x2d1283[_0x2066('0x78')],_0x2d1283['dialTimezone'],_0x2d1283['name'],_0x2d1283))[_0x2066('0x3d')](_0x4d5e53[_0x2066('0xae')](_0x2d1283))['catch'](loggerCatchQueueSummary(_0x2066('0xaf'),_0x2d1283));}else{notSendMessagesCampaign(_0x2d1283);}}}};Dialer[_0x2066('0x1e')][_0x2066('0xb0')]=function(_0x588cb5){if(_0x588cb5[_0x2066('0xb1')]!==_0x2066('0xa')){clearPredictiveAttributes(_0x588cb5);}switch(_0x588cb5[_0x2066('0xb1')]){case _0x2066('0xb2'):this[_0x2066('0xb3')](_0x588cb5,0x1);break;case _0x2066('0xb4'):this[_0x2066('0xb3')](_0x588cb5,_0x588cb5['dialPowerLevel']);break;case _0x2066('0xa'):this['predictive'](_0x588cb5);break;case _0x2066('0x9'):this[_0x2066('0xb3')](_0x588cb5,0x1);break;default:logger['error'](_0x2066('0xb5'),_0x588cb5[_0x2066('0x60')],'method\x20not\x20recognized');}};Dialer[_0x2066('0x1e')]['ifTime']=function(_0x166eb4,_0x51f560){var _0x49afe4=_0x166eb4['dialTimezone'];var _0x432fea=_0x51f560?_0x166eb4['dialGlobalInterval']:_0x166eb4[_0x2066('0x78')][_0x2066('0x79')];logger['silly'](_0x2066('0xb6'),_0x432fea,_0x49afe4,_0x166eb4[_0x2066('0x60')],util[_0x2066('0x80')](_0x2066('0xb7'),_0x166eb4['name'],_0x166eb4['id']));var _0x52e394=null;return Interval[_0x2066('0xb8')](_0x432fea,_0x49afe4)[_0x2066('0x3d')](function(_0x49f884){if(_0x49f884===!![]){return _0x49f884;}else{_0x166eb4[_0x2066('0x70')]=_0x51f560?utils[_0x2066('0x6a')][_0x2066('0xa4')]:utils[_0x2066('0x6a')][_0x2066('0xa5')];_0x52e394=msgResponse(_0x2066('0xa6'),_0x2066('0x95'),_0x2066('0xb9')+_0x51f560+'\x20'+_0x166eb4['name']+_0x2066('0xa7')+util[_0x2066('0x43')](_0x432fea,{'showHidden':![],'depth':null})+_0x2066('0xa8')+_0x49afe4);}if(_0x52e394!==null){logger[_0x2066('0xba')](_0x2066('0xbb'),_0x52e394);_0x52e394['isGlobal']=_0x51f560;throw _0x52e394;}})[_0x2066('0xa2')](function(_0x54c150){logger[_0x2066('0x65')](_0x2066('0xbc'),_0x54c150);throw msgResponse(_0x2066('0x87'),_0x2066('0x88'),util[_0x2066('0x43')](_0x54c150,{'showHidden':![],'depth':null}));});};Dialer['prototype']['syncAgentConnect']=function(_0x19139d){if(this[_0x2066('0x22')][_0x19139d[_0x2066('0xbd')]]){if(this[_0x2066('0x27')][_0x19139d[_0x2066('0xbe')]]&&this[_0x2066('0x27')][_0x19139d[_0x2066('0xbe')]][_0x2066('0xbf')]!=='ivr'){this['updateOriginated'](this[_0x2066('0x22')][_0x19139d[_0x2066('0xbd')]]);this[_0x2066('0x27')][_0x19139d[_0x2066('0xbe')]]['answertime']=moment()['format'](_0x2066('0xc0'));}}};Dialer[_0x2066('0x1e')]['syncAgentComplete']=function(_0x24434b){var _0x1033cb=this[_0x2066('0x27')][_0x24434b[_0x2066('0xbe')]];if(this['voiceQueues'][_0x24434b['queue']]){if(_0x1033cb&&_0x1033cb[_0x2066('0xbf')]!==_0x2066('0xc1')){delete this[_0x2066('0x27')][_0x24434b[_0x2066('0xbe')]];this['voiceQueues'][_0x24434b[_0x2066('0xbd')]][_0x2066('0xc2')]+=0x1;var _0x169d41=new AgentComplete(_0x1033cb,_0x24434b);if(_0x24434b['reason']===_0x2066('0xc3')){_0x169d41[_0x2066('0xc4')]=this[_0x2066('0x22')][_0x24434b['queue']][_0x2066('0xc5')]&&this[_0x2066('0x22')][_0x24434b[_0x2066('0xbd')]]['dialAgiAfterHangupAgent']?moment()[_0x2066('0x80')](_0x2066('0xc0')):undefined;}hopperUtils[_0x2066('0xc6')](_0x169d41)[_0x2066('0xa2')](loggerCatch(_0x2066('0xc7')));hopperUtils[_0x2066('0xc8')](_0x169d41)['catch'](loggerCatch(_0x2066('0xc9')));}}};Dialer[_0x2066('0x1e')][_0x2066('0x2d')]=function(_0x1c39df){var _0xb98673=this['uniqueId'][_0x1c39df[_0x2066('0xbe')]];var _0x533c87=this;var _0x1a0ecb=![];var _0xe733e1;var _0x1ddaee;if(this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]]){if(_0xb98673&&_0xb98673['type']!==_0x2066('0xc1')){delete this[_0x2066('0x27')][_0x1c39df['uniqueid']];this['updateOriginated'](this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]]);_0xb98673[_0x2066('0xca')]=moment()['format'](_0x2066('0xc0'));var _0x4b8735=new QueueCallerAbandon(_0xb98673,_0x1c39df);if(utils['getSeconds'](_0xb98673[_0x2066('0xca')],_0xb98673[_0x2066('0xcb')])>=_0xb98673['dialQueueTimeout']){this['voiceQueues'][_0x1c39df[_0x2066('0xbd')]][_0x2066('0x4a')]+=0x1;this['voiceQueues'][_0x1c39df[_0x2066('0xbd')]][_0x2066('0xcc')]+=0x1;this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4b8735[_0x2066('0xcd')]=0xa;_0x4b8735[_0x2066('0xce')]='Drop';_0x4b8735[_0x2066('0xcf')]=_0x2066('0xd0');_0x4b8735[_0x2066('0xc4')]=this['voiceQueues'][_0x1c39df[_0x2066('0xbd')]][_0x2066('0xc5')]?moment()[_0x2066('0x80')](_0x2066('0xc0')):undefined;_0x4b8735[_0x2066('0xd1')]+=0x1;_0x4b8735[_0x2066('0xd2')]+=0x1;_0xe733e1=this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]][_0x2066('0xd3')];_0x1ddaee=this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x2066('0xd4')](_0x4b8735,_0x4b8735[_0x2066('0xcd')],_0xb98673[_0x2066('0xd5')])[_0x2066('0x3d')](function(_0x1b8c0b){_0x1a0ecb=_0x1b8c0b[_0x2066('0xd6')]==0x1;if(_0x4b8735[_0x2066('0xd1')]>=_0x533c87[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]][_0x2066('0xd7')]){_0x533c87['queueCallerAbandonCreateState'](_0x4b8735,_0x1b8c0b['additional']);}else{hopperUtils[_0x2066('0xd8')]({'active':![],'countdropretry':_0x4b8735['countdropretry'],'scheduledat':moment()['add'](_0x533c87[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]][_0x2066('0xd3')],'minutes')[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0xb98673[_0x2066('0xd9')],'ListId':_0xb98673[_0x2066('0xda')],'VoiceQueueId':_0xb98673[_0x2066('0xdb')]||undefined,'CampaignId':_0xb98673[_0x2066('0xdc')]||undefined})['catch'](loggerCatch(_0x2066('0xdd')));var _0x6098d8=new History(_0x4b8735);_0x6098d8['state']=0xa;_0x6098d8['statedesc']=_0x2066('0xde');_0x6098d8['starttime']=moment()['format'](_0x2066('0xc0'));_0x6098d8[_0x2066('0x71')]=_0x6098d8[_0x2066('0x72')];_0x6098d8[_0x2066('0xdf')]=_0x4b8735[_0x2066('0xdf')];_0x6098d8['calleridnum']=_0x4b8735[_0x2066('0xe0')];hopperUtils['createHistory'](_0x6098d8)[_0x2066('0xa2')](loggerCatch(_0x2066('0xe1')));}})[_0x2066('0x3d')](function(){if(_0x1a0ecb)hopperUtils['swapAdditionalPhones'](_0x4b8735,_0xe733e1,_0x1ddaee)[_0x2066('0x3d')](function(){return 0x1;});});}else{this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]][_0x2066('0x4c')]+=0x1;this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]][_0x2066('0xe2')]+=0x1;_0x4b8735[_0x2066('0xcd')]=0xb;_0x4b8735['statedesc']='Abandoned';_0x4b8735[_0x2066('0xcf')]=_0x2066('0xe3');_0x4b8735['countabandonedretry']+=0x1;_0x4b8735['countglobal']+=0x1;_0xe733e1=this[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]]['dialAbandonedRetryFrequency'];_0x1ddaee=this['voiceQueues'][_0x1c39df[_0x2066('0xbd')]][_0x2066('0xe4')];hopperUtils[_0x2066('0xd4')](_0x4b8735,_0x4b8735[_0x2066('0xcd')],_0xb98673[_0x2066('0xd5')])[_0x2066('0x3d')](function(_0x27ea1f){if(_0x4b8735[_0x2066('0xe5')]>=_0x533c87[_0x2066('0x22')][_0x1c39df[_0x2066('0xbd')]]['dialAbandonedMaxRetry']){_0x533c87['queueCallerAbandonCreateState'](_0x4b8735,_0x27ea1f['additional']);}else{hopperUtils[_0x2066('0xd8')]({'active':![],'countabandonedretry':_0x4b8735['countabandonedretry'],'scheduledat':moment()[_0x2066('0xe6')](_0x533c87['voiceQueues'][_0x1c39df['queue']][_0x2066('0xe7')],_0x2066('0xe8'))[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0xb98673['ContactId'],'ListId':_0xb98673[_0x2066('0xda')],'VoiceQueueId':_0xb98673[_0x2066('0xdb')]||undefined,'CampaignId':_0xb98673[_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0xe9')));var _0x108ca0=new History(_0x4b8735);_0x108ca0[_0x2066('0xcd')]=0xb;_0x108ca0[_0x2066('0xce')]='Abandoned';_0x108ca0[_0x2066('0x72')]=moment()[_0x2066('0x80')](_0x2066('0xc0'));_0x108ca0[_0x2066('0x71')]=_0x108ca0[_0x2066('0x72')];_0x108ca0[_0x2066('0xdf')]=_0x4b8735['calleridname'];_0x108ca0['calleridnum']=_0x4b8735[_0x2066('0xe0')];hopperUtils['createHistory'](_0x108ca0)[_0x2066('0xa2')](loggerCatch(_0x2066('0xea')));}})[_0x2066('0x3d')](function(){if(_0x1a0ecb)hopperUtils[_0x2066('0xeb')](_0x4b8735,_0xe733e1,_0x1ddaee)['then'](function(){return 0x1;});});}}}};Dialer[_0x2066('0x1e')][_0x2066('0x36')]=function(_0x3f1208){if(this[_0x2066('0x26')][_0x3f1208[_0x2066('0xbe')]]){this['actions'][_0x3f1208[_0x2066('0xbe')]][_0x2066('0xec')]=_0x3f1208[_0x2066('0xec')];}if(this['uniqueId'][_0x3f1208[_0x2066('0xbe')]]){this[_0x2066('0x27')][_0x3f1208['uniqueid']]['channel']=_0x3f1208[_0x2066('0xec')];}};Dialer[_0x2066('0x1e')][_0x2066('0x38')]=function(_0x38441a){if(!this['actions'][_0x38441a['actionid']]){return;}var _0x75d989=this['voiceQueues'][this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]]['queue']][_0x2066('0xee')]||_0x2066('0xef');if(_0x75d989===_0x2066('0xf0')){if(this['actions'][_0x38441a[_0x2066('0xed')]]&&_[_0x2066('0xf1')](this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]][_0x2066('0xf2')])&&_0x38441a[_0x2066('0x8c')]==='1'&&_0x38441a[_0x2066('0xf3')]==='0'){if(this[_0x2066('0x24')][_0x38441a['stateinterface']]){if(!this['agents'][_0x38441a[_0x2066('0xf4')]][_0x2066('0xf2')]){this[_0x2066('0x24')][_0x38441a[_0x2066('0xf4')]]['locked']=!![];this['actions'][_0x38441a[_0x2066('0xed')]][_0x2066('0xf2')]=!![];this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]][_0x2066('0xf4')]=_0x38441a[_0x2066('0xf4')];}}}}else if(_0x75d989==='rrmemory'){if(this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]]){if(this['agents'][_0x38441a[_0x2066('0xf4')]]){this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]][_0x2066('0xf4')]=_0x38441a[_0x2066('0xf4')];if(_[_0x2066('0xf1')](this[_0x2066('0xf5')][this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]]['queue']])){this[_0x2066('0xf5')][this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]][_0x2066('0xbd')]]=[];}this[_0x2066('0xf5')][this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]][_0x2066('0xbd')]]['push'](_[_0x2066('0x5d')](_[_0x2066('0x77')](this[_0x2066('0x26')][_0x38441a[_0x2066('0xed')]],['idHopper',_0x2066('0xf4')]),{'status':_0x38441a[_0x2066('0x8c')],'paused':_0x38441a[_0x2066('0xf3')]}));}}}};Dialer[_0x2066('0x1e')]['syncQueueStatusComplete']=function(_0x3839a6){if(!this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]]){return;}var _0x1ecc2c=this;var _0x42bf56=this[_0x2066('0x22')][this[_0x2066('0x26')][_0x3839a6['actionid']][_0x2066('0xbd')]];var _0x13fb0d=_0x42bf56[_0x2066('0xee')]||_0x2066('0xef');if(_0x13fb0d===_0x2066('0xf0')){if(this[_0x2066('0x26')][_0x3839a6['actionid']]&&this['actions'][_0x3839a6['actionid']][_0x2066('0xf4')]){this[_0x2066('0xf6')][_0x2066('0xf7')](this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xf8')],this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xf4')])['catch'](function(_0x568a95){logger[_0x2066('0x65')](_0x2066('0xf9'),util['inspect'](_0x568a95,{'showHidden':![],'depth':null}));})[_0x2066('0x21')](function(){_0x1ecc2c[_0x2066('0xfa')](_0x1ecc2c[_0x2066('0x22')][_0x1ecc2c['actions'][_0x3839a6['actionid']][_0x2066('0xbd')]]);_0x1ecc2c[_0x2066('0x24')][_0x1ecc2c[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xf4')]][_0x2066('0xf2')]=![];delete _0x1ecc2c['actions'][_0x3839a6['actionid']];unlockQueueStatus(_0x42bf56);});}else{this[_0x2066('0xfa')](this['voiceQueues'][this['actions'][_0x3839a6['actionid']][_0x2066('0xbd')]]);hopperUtils[_0x2066('0xd8')]({'active':![],'ContactId':this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xd9')],'ListId':this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xda')],'VoiceQueueId':this[_0x2066('0x26')][_0x3839a6['actionid']][_0x2066('0xdb')]||undefined,'CampaignId':this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0xfb')));delete this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]];unlockQueueStatus(_0x42bf56);}}else if(_0x13fb0d===_0x2066('0xef')){var _0x3c0816;if(this['actions'][_0x3839a6[_0x2066('0xed')]]&&!_[_0x2066('0x7c')](this[_0x2066('0xf5')][this['actions'][_0x3839a6[_0x2066('0xed')]][_0x2066('0xbd')]])){if(this['queueBookedRR'][_0x1ecc2c[_0x2066('0x26')][_0x3839a6['actionid']]['queue']]){this[_0x2066('0x28')][_0x1ecc2c[_0x2066('0x26')][_0x3839a6['actionid']][_0x2066('0xbd')]]=this['queueBookedRR'][this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xbd')]]?this[_0x2066('0x28')][this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xbd')]]:this['queueBooked'][this[_0x2066('0x26')][_0x3839a6['actionid']][_0x2066('0xbd')]]?this[_0x2066('0xf5')][this[_0x2066('0x26')][_0x3839a6['actionid']]['queue']][_0x2066('0xfc')]||0x0:0x0;}this[_0x2066('0xf5')][this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xbd')]]['_rr']=this[_0x2066('0x28')][this[_0x2066('0x26')][_0x3839a6[_0x2066('0xed')]][_0x2066('0xbd')]];for(var _0xa1d5de=0x0;_0xa1d5de=_0x44a223[_0x2066('0x121')]){_0x2e953d[_0x2066('0x122')](_0x15b5bd,_0x213618,_0x1ed2e8,'reason19\x20machine....');}else{if(_0x15b5bd[_0x2066('0x11b')]>=_0x44a223[_0x2066('0x123')]){_0x2e953d[_0x2066('0x124')](_0x15b5bd,_0x213618,_0x1ed2e8,_0x2066('0x125'));}else{hopperUtils[_0x2066('0xd8')]({'active':![],'countmachineretry':_0x15b5bd[_0x2066('0x11b')],'scheduledat':moment()[_0x2066('0xe6')](_0x44a223[_0x2066('0x126')],_0x2066('0xe8'))['format'](_0x2066('0xc0')),'ContactId':_0x15b5bd['ContactId'],'ListId':_0x15b5bd[_0x2066('0xda')],'VoiceQueueId':_0x15b5bd['VoiceQueueId']||undefined,'CampaignId':_0x15b5bd[_0x2066('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x213618({'reschedule':0x1});}}});}if(_0x13346f[_0x2066('0xbf')]===_0x2066('0xc1')&&this[_0x2066('0x23')][_0x13346f[_0x2066('0xbd')]][_0x2066('0x10c')]&&_0x21ccd4['value']===_0x2066('0x10e')){delete this['uniqueId'][_0x21ccd4[_0x2066('0xbe')]];this['updateOriginated'](this[_0x2066('0x23')][_0x13346f['queue']]);_0x3eed3d=new Hangup(_0x13346f,_0x21ccd4);_0x3eed3d[_0x2066('0xcd')]=0x12;_0x3eed3d[_0x2066('0xce')]=_0x2066('0x110');_0x3eed3d[_0x2066('0x111')]=_0x2066('0x112');ami['emit'](_0x2066('0x114'),ut['buildObj'](_0x3eed3d,_0x2066('0x116')));this[_0x2066('0x117')](_0x3eed3d,_0x2066('0x127'),'[syncHangupInAMDIvr]');}if(_0x13346f[_0x2066('0xbf')]===_0x2066('0xc1')&&this[_0x2066('0x23')][_0x13346f[_0x2066('0xbd')]][_0x2066('0x10c')]&&_0x21ccd4[_0x2066('0x10d')]===_0x2066('0x11a')){return new Promise(function(_0x49d557,_0x49e6c8){delete _0x2e953d[_0x2066('0x27')][_0x21ccd4[_0x2066('0xbe')]];_0x2e953d[_0x2066('0xfa')](_0x2e953d[_0x2066('0x23')][_0x13346f['queue']]);_0x2e953d[_0x2066('0x23')][_0x13346f['queue']]['outboundAnswerCallsDay']+=0x1;_0x2e953d['campaigns'][_0x13346f[_0x2066('0xbd')]][_0x2066('0x10f')]+=0x1;var _0x541530=_0x2e953d[_0x2066('0x23')][_0x13346f[_0x2066('0xbd')]];var _0x4ee7f5=new Hangup(_0x13346f,_0x21ccd4);_0x4ee7f5['state']=0x13;_0x4ee7f5['statedesc']='Machine';_0x4ee7f5[_0x2066('0x111')]='AMD';_0x4ee7f5[_0x2066('0x11b')]+=0x1;_0x4ee7f5[_0x2066('0xd2')]+=0x1;_0x4ee7f5['amd']=!![];ami[_0x2066('0x113')](_0x2066('0x114'),ut[_0x2066('0x115')](_0x4ee7f5,'amd'));hopperUtils[_0x2066('0xc6')](_0x4ee7f5)[_0x2066('0xa2')](loggerCatch(_0x2066('0x11c')));if(_0x4ee7f5[_0x2066('0x128')]+_0x4ee7f5[_0x2066('0x11d')]+_0x4ee7f5['countnoanswerretry']+_0x4ee7f5['countnosuchnumberretry']+_0x4ee7f5[_0x2066('0xd1')]+_0x4ee7f5[_0x2066('0xe5')]+_0x4ee7f5['countmachineretry']+_0x4ee7f5[_0x2066('0x120')]>=_0x541530['dialGlobalMaxRetry']){_0x2e953d[_0x2066('0x122')](_0x4ee7f5,_0x49d557,_0x49e6c8,_0x2066('0x129'));}else{if(_0x4ee7f5[_0x2066('0x11b')]>=_0x541530[_0x2066('0x123')]){_0x2e953d['createStateFinal'](_0x4ee7f5,_0x49d557,_0x49e6c8,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4ee7f5[_0x2066('0x11b')],'scheduledat':moment()[_0x2066('0xe6')](_0x541530['dialMachineRetryFrequency'],'minutes')[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0x4ee7f5['ContactId'],'ListId':_0x4ee7f5['ListId'],'VoiceQueueId':_0x4ee7f5[_0x2066('0xdb')]||undefined,'CampaignId':_0x4ee7f5['CampaignId']||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0x12a')));_0x49d557({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x2066('0x34')]=function(_0x107ee6){var _0x4ea218=this[_0x2066('0x27')][_0x107ee6[_0x2066('0xbe')]];var _0x2e3aec;if(_0x4ea218&&_0x4ea218['type']===_0x2066('0xc1')){delete this['uniqueId'][_0x107ee6['uniqueid']];this[_0x2066('0xfa')](this[_0x2066('0x23')][_0x4ea218['queue']]);this['campaigns'][_0x4ea218[_0x2066('0xbd')]]['ivrAnswerCallsDay']+=0x1;_0x2e3aec=new Hangup(_0x4ea218,_0x107ee6);hopperUtils[_0x2066('0xc6')](_0x2e3aec)[_0x2066('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x2e3aec)['catch'](loggerCatch(_0x2066('0x12b')));}if(_0x4ea218&&_0x4ea218[_0x2066('0xbf')]!==_0x2066('0xc1')&&isNotNull(this['voiceQueues'][_0x4ea218[_0x2066('0xbd')]][_0x2066('0x12c')])){delete this[_0x2066('0x27')][_0x107ee6[_0x2066('0xbe')]];this[_0x2066('0xfa')](this[_0x2066('0x22')][_0x4ea218['queue']]);this[_0x2066('0x22')][_0x4ea218['queue']][_0x2066('0xc2')]+=0x1;this[_0x2066('0x22')][_0x4ea218['queue']][_0x2066('0x10f')]+=0x1;_0x2e3aec=new Hangup(_0x4ea218,_0x107ee6);_0x2e3aec[_0x2066('0xcd')]=0x10;_0x2e3aec[_0x2066('0xce')]=_0x2066('0x12d');_0x2e3aec[_0x2066('0x111')]=_0x2066('0x12e');hopperUtils[_0x2066('0xc6')](_0x2e3aec)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x2e3aec)[_0x2066('0xa2')](loggerCatch('[syncHangupIvr]'));}if(_0x4ea218&&_0x4ea218['type']!==_0x2066('0xc1')&&!isNotNull(this[_0x2066('0x22')][_0x4ea218['queue']][_0x2066('0x12c')])){if(_0x107ee6['cause-txt']==='Normal\x20Clearing'){delete this[_0x2066('0x27')][_0x107ee6[_0x2066('0xbe')]];this['voiceQueues'][_0x4ea218['queue']][_0x2066('0xc2')]+=0x1;const _0x26ffa2=new AgentComplete(_0x4ea218,_0x107ee6);_0x26ffa2[_0x2066('0xdc')]=this[_0x2066('0x22')][_0x4ea218[_0x2066('0xbd')]]['id'];hopperUtils[_0x2066('0xc6')](_0x26ffa2)[_0x2066('0xa2')](loggerCatch(_0x2066('0xc7')));hopperUtils[_0x2066('0xc8')](_0x26ffa2)[_0x2066('0xa2')](loggerCatch(_0x2066('0xc9')));}else{delete this[_0x2066('0x27')][_0x107ee6['uniqueid']];this[_0x2066('0xfa')](this[_0x2066('0x22')][_0x4ea218[_0x2066('0xbd')]]);this[_0x2066('0x22')][_0x4ea218[_0x2066('0xbd')]][_0x2066('0x12f')]+=0x1;_0x2e3aec=new Hangup(_0x4ea218,_0x107ee6);_0x2e3aec['state']=0xc;_0x2e3aec['statedesc']=_0x107ee6[_0x2066('0x130')];_0x2e3aec['membername']='Unknow';hopperUtils[_0x2066('0xc6')](_0x2e3aec)[_0x2066('0xa2')](loggerCatch(_0x2066('0x131')));hopperUtils['moveContactManagedDialer'](_0x2e3aec)[_0x2066('0xa2')](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x2066('0x1e')][_0x2066('0xc')]=function(_0xa36d7f){var _0x79bfb1=this;if(!_0x79bfb1[_0x2066('0x132')][_0xa36d7f['name']]){_0x79bfb1['queuesSummary'][_0xa36d7f[_0x2066('0x60')]]={'running':![]};}else if(_0x79bfb1[_0x2066('0x132')][_0xa36d7f['name']][_0x2066('0x133')]===!![]){return;}else if(_0x79bfb1[_0x2066('0x132')][_0xa36d7f[_0x2066('0x60')]][_0x2066('0x133')]===![]){_0x79bfb1[_0x2066('0x132')][_0xa36d7f[_0x2066('0x60')]]['running']=!![];}var _0x4c84d3=_0x79bfb1['voiceQueues'][_0xa36d7f[_0x2066('0x60')]];var _0x2b944d=_0x4c84d3[_0x2066('0x70')]!==utils[_0x2066('0x6a')][_0x2066('0x134')];var _0x459a57=utils['isPreviewCampaign'](_0x4c84d3);_0x4c84d3[_0x2066('0x135')]=utils[_0x2066('0x136')](_0x4c84d3,_0x79bfb1[_0x2066('0x25')]);Promise['resolve']()[_0x2066('0x3d')](function(){if(_0x4c84d3['statusMessage']===utils[_0x2066('0x6a')][_0x2066('0x134')]){if(_0x2b944d){clearPredictiveAttributes(_0x4c84d3);_0xa36d7f[_0x2066('0x62')]=undefined;_0xa36d7f['startProgressive']=undefined;}if(_0x4c84d3[_0x2066('0x135')]===utils[_0x2066('0x6a')][_0x2066('0x134')]){_0xa36d7f[_0x2066('0x137')]=0x0;_0xa36d7f[_0x2066('0xf3')]=0x0;_0xa36d7f[_0x2066('0x138')]=0x0;_0xa36d7f[_0x2066('0x139')]=0x0;_0xa36d7f[_0x2066('0x13a')]=0x0;}}else if(_0x4c84d3['statusMessage']===utils[_0x2066('0x6a')][_0x2066('0x13b')]&&!_0x459a57){return _0x79bfb1[_0x2066('0x94')](_0x4c84d3,!![])[_0x2066('0x3d')](function(){return _0x79bfb1['ifTime'](_0x4c84d3,![]);})[_0x2066('0x3d')](function(){return _0x79bfb1['checkDialMethod'](_0x4c84d3);})[_0x2066('0xa2')](function(_0xb2b42f){loggerSyncQueueSummary[_0x2066('0x41')](_0x2066('0x13c'),util[_0x2066('0x43')](_0xb2b42f,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x4c84d3);});}else{clearPredictiveAttributes(_0x4c84d3);}})['then'](function(){var _0x298036=_0xa36d7f[_0x2066('0x13d')](_0x4c84d3);if(_0x298036||_0x4c84d3['queueSummaryCountersUpdated']){_0x4c84d3[_0x2066('0x13e')]=![];_0xa36d7f['updateReportFromOutboundQueue'](_0x4c84d3);Object[_0x2066('0x13f')](_0x4c84d3,_0xa36d7f);emitOutboundVoiceQueueSummary(_0xa36d7f);}_0x79bfb1[_0x2066('0x132')][_0x4c84d3['name']][_0x2066('0x133')]=![];})[_0x2066('0xa2')](function(_0x54f510){logger[_0x2066('0x65')](_0x2066('0x13c'),util['inspect'](_0x54f510,{'showHidden':![],'depth':null}));_0x79bfb1[_0x2066('0x132')][_0x4c84d3[_0x2066('0x60')]]['running']=![];});};Dialer['prototype']['syncQueueSummaryComplete']=_[_0x2066('0x140')](function(){var _0x205227=_[_0x2066('0x141')](this[_0x2066('0x22')],function(_0x1ceb37){return _0x1ceb37[_0x2066('0x142')];});var _0x562765=_[_0x2066('0x141')](this[_0x2066('0x24')],function(_0xdb7fc9){return _0xdb7fc9[_0x2066('0x143')]&&_0xdb7fc9['status']===_0x2066('0x8b');});if(_0x205227[_0x2066('0x9c')]>0x0&&_0x562765['length']>0x0){return Promise[_0x2066('0x144')]()[_0x2066('0x3d')](cmHopper[_0x2066('0x145')](_[_0x2066('0x146')](_0x205227,'id'),previewRecallmeReminderInterval,_['map'](_0x562765,'id')))[_0x2066('0x3d')](function(_0x2ec00b){for(var _0x18175e=0x0;_0x18175e<_0x2ec00b[_0x2066('0x9c')];_0x18175e++){var _0x3ea4ea=_0x2ec00b[_0x18175e]['Agent'][_0x2066('0x60')];if(_0x3ea4ea)io['to'](util['format']('user:%s',_0x3ea4ea))[_0x2066('0x113')](_0x2066('0x147'),{'hopper':_0x2ec00b[_0x18175e]});}})[_0x2066('0xa2')](function(_0x390947){logger[_0x2066('0x65')]('checkPreviewRecallReminder',_0x390947);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x2066('0x1e')][_0x2066('0x3b')]=function(){var _0x4c30ff=this;setInterval(function(){_0x4c30ff[_0x2066('0x148')](_0x4c30ff[_0x2066('0x27')],_0x2066('0x149'));_0x4c30ff['clearZombieChannels'](_0x4c30ff['actions'],'[actions]');},0x32c8);};Dialer['prototype'][_0x2066('0x148')]=function(_0x1e08eb,_0xa1ea0b){var _0x1ab7bb=this;for(var _0x196da4 in _0x1e08eb){if(typeof _0x1e08eb[_0x196da4]!=='undefined'){this['sequence']['enqueue'](function(){if(!_[_0x2066('0xf1')](_0x1e08eb[_0x196da4])){return ami[_0x2066('0x9e')]({'action':_0x2066('0x8c'),'channel':_0x1e08eb[_0x196da4][_0x2066('0xec')]})[_0x2066('0xa2')](function(_0xe091d7){if(_0xe091d7[_0x2066('0x70')]===_0x2066('0x14a')){setTimeout(function(){if(_0x1e08eb[_0x196da4]&&_0x1e08eb[_0x196da4][_0x2066('0xbf')]!=='ivr'){_0x1ab7bb[_0x2066('0xfa')](_0x1ab7bb[_0x2066('0x22')][_0x1e08eb[_0x196da4][_0x2066('0xbd')]]);logger[_0x2066('0x65')](_0x2066('0x14b'),_0xa1ea0b,_0x196da4,_0x1e08eb[_0x196da4][_0x2066('0xbd')]);delete _0x1e08eb[_0x196da4];}if(_0x1e08eb[_0x196da4]&&_0x1e08eb[_0x196da4][_0x2066('0xbf')]===_0x2066('0xc1')){_0x1ab7bb[_0x2066('0xfa')](_0x1ab7bb[_0x2066('0x23')][_0x1e08eb[_0x196da4]['queue']]);logger[_0x2066('0x65')](_0x2066('0x14c'),_0xa1ea0b,_0x196da4,_0x1e08eb[_0x196da4][_0x2066('0xbd')]);delete _0x1e08eb[_0x196da4];}},0x2328);}});}});}}};Dialer[_0x2066('0x1e')]['getVoiceQueueRtPauses']=function(_0x348161){return Promise['resolve']()[_0x2066('0x3d')](voiceQueueRt[_0x2066('0x14d')](_0x348161))[_0x2066('0xa2')](loggerCatch(_0x2066('0x14e')));};Dialer['prototype'][_0x2066('0xfa')]=function(_0x3f8caa){if(!_[_0x2066('0x3f')](_0x3f8caa)&&_0x3f8caa!==null){if(typeof _0x3f8caa['originated']!==_0x2066('0xab')){if(_0x3f8caa['originated']>0x0){_0x3f8caa[_0x2066('0x83')]-=0x1;}else{logger[_0x2066('0x65')](_0x2066('0x14f'));}}}else{logger[_0x2066('0x65')](_0x2066('0x150'));}};Dialer[_0x2066('0x1e')]['loggerHandler']=function(_0x317502,_0x472c2e){var _0x23d30f=this;return function(_0x477676){_0x23d30f[_0x2066('0xfa')](_0x472c2e);logger['error'](_0x317502,util[_0x2066('0x43')](_0x477676,{'showHidden':![],'depth':null}));};};Dialer[_0x2066('0x1e')][_0x2066('0x151')]=function(_0x3e63bc,_0x48fcdd,_0x1d3492){var _0x263bea={'state':0x19,'statedesc':_0x2066('0x152')};this[_0x2066('0xfa')](_0x48fcdd);this[_0x2066('0x117')](_[_0x2066('0x5d')](_0x263bea,_['pick'](_0x1d3492,[_0x2066('0xd9'),_0x2066('0xda'),_0x2066('0x153'),'VoiceQueueId',_0x2066('0xdc')])),_0x2066('0x154'),_0x2066('0x155'));logger[_0x2066('0x65')](_0x3e63bc);};Dialer[_0x2066('0x1e')][_0x2066('0x117')]=function(_0x29f716,_0x4de143,_0x22df22){hopperUtils[_0x2066('0xc6')](_0x29f716)['catch'](loggerCatch(_0x4de143));hopperUtils[_0x2066('0xc8')](_0x29f716)[_0x2066('0xa2')](loggerCatch(_0x22df22));};Dialer[_0x2066('0x1e')][_0x2066('0x156')]=function(_0x16f033,_0x160027){hopperUtils['createHistory'](_0x16f033)[_0x2066('0xa2')](loggerCatch(_0x2066('0xc7')));if(_0x160027==0x0){hopperUtils[_0x2066('0xc8')](_0x16f033)[_0x2066('0xa2')](loggerCatch(_0x2066('0x157')));}};Dialer[_0x2066('0x1e')][_0x2066('0x158')]=function(_0x4ffb63){return Promise[_0x2066('0x144')]()[_0x2066('0x3d')](cmHopper[_0x2066('0x145')](_0x4ffb63['id'],previewRecallmeReminderInterval))[_0x2066('0x3d')](function(_0x5232d5){for(var _0x75047f=0x0;_0x75047f<_0x5232d5[_0x2066('0x9c')];_0x75047f++){var _0x341a32=_0x5232d5[_0x75047f][_0x2066('0x159')][_0x2066('0x60')];if(_0x341a32)io['to'](util[_0x2066('0x80')](_0x2066('0x15a'),_0x341a32))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x5232d5[_0x75047f]});}})[_0x2066('0xa2')](function(){});};Dialer[_0x2066('0x1e')][_0x2066('0xae')]=function(_0x42e850){var _0x3af525=this;return function(){_0x3af525[_0x2066('0x15b')](_0x42e850);};};Dialer[_0x2066('0x1e')][_0x2066('0x15c')]=function(_0x57a0cb,_0x13912a){var _0x5344c4=this;var _0x4e1d2c=uuid['v4']();this[_0x2066('0x26')][_0x4e1d2c]=new Action(_0x57a0cb,_0x13912a,_0x4e1d2c);return new Promise(function(_0x3280d3,_0x5554ab){if(_[_0x2066('0x3f')](_0x57a0cb)&&typeof _0x57a0cb!==_0x2066('0x15d')){return _0x5554ab(msgResponse(_0x2066('0x15e'),_0x2066('0x95'),_0x2066('0x15f')));}if(_['isUndefined'](_0x13912a[_0x2066('0x160')])||_0x13912a[_0x2066('0x160')]===null){return _0x5554ab(msgResponse(_0x2066('0x15e'),_0x2066('0x95'),_0x2066('0x161')));}var _0x59fb63={'XMD-CALLERID':_0x5344c4[_0x2066('0x26')][_0x4e1d2c]['getCaller'](),'XMD-AGI':_0x57a0cb[_0x2066('0x12c')]?util[_0x2066('0x80')]('\x22agi://%s/square,%s\x22',ipAgi,_0x57a0cb[_0x2066('0x12c')]):_0x2066('0x162'),'XMD-AGIAFTER':_0x57a0cb[_0x2066('0xc5')]?util[_0x2066('0x80')](_0x2066('0x163'),ipAgi,_0x57a0cb[_0x2066('0xc5')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x57a0cb)?util['format'](_0x2066('0x164'),_0x57a0cb['name'],_0x57a0cb[_0x2066('0x165')]||'',_0x57a0cb[_0x2066('0x166')]?'c':'',_0x57a0cb[_0x2066('0x167')]||0x3):_0x2066('0x162'),'XMD-CONTACTID':_0x13912a[_0x2066('0xd9')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5344c4['actions'][_0x4e1d2c]['getCaller'](),'XMD-AMD':_0x57a0cb[_0x2066('0x10c')]?_0x2066('0x13b'):_0x2066('0x162'),'XMD-DESTINATION':_0x2066('0x168')};if(_0x57a0cb[_0x2066('0x10c')]){_0x59fb63[_0x2066('0x169')]=_0x57a0cb[_0x2066('0x16a')]||0x9c4;_0x59fb63[_0x2066('0x16b')]=_0x57a0cb[_0x2066('0x16c')]||0x5dc;_0x59fb63[_0x2066('0x16d')]=_0x57a0cb[_0x2066('0x16e')]||0x320;_0x59fb63['XMD-AMDTOTALANALYSISTIME']=_0x57a0cb[_0x2066('0x16f')]||0x1388;_0x59fb63[_0x2066('0x170')]=_0x57a0cb['dialAMDMinWordLength']||0x64;_0x59fb63[_0x2066('0x171')]=_0x57a0cb[_0x2066('0x172')]||0x32;_0x59fb63[_0x2066('0x173')]=_0x57a0cb[_0x2066('0x174')]||0x3;_0x59fb63[_0x2066('0x175')]=_0x57a0cb['dialAMDSilenceThreshold']||0x100;_0x59fb63[_0x2066('0x176')]=_0x57a0cb[_0x2066('0x177')]||0x1388;}if(utils[_0x2066('0x178')](_0x57a0cb)){_0x59fb63['XMD-VOICEQUEUEID']=_0x13912a[_0x2066('0xdb')];}else{_0x59fb63[_0x2066('0x179')]=_0x13912a[_0x2066('0xdc')];}var _0xad6e08=utils[_0x2066('0x17a')](_0x13912a['Contact']);Object[_0x2066('0x13f')](_0x59fb63,_0xad6e08);var _0xe6b91f=_0x5344c4[_0x2066('0x89')](_0x57a0cb[_0x2066('0x8f')])?utils['getCallerId'](_0x57a0cb[_0x2066('0x8f')][_0x2066('0x17b')],_0x57a0cb[_0x2066('0x17c')],_0x57a0cb[_0x2066('0x17d')]>0x0?utils[_0x2066('0x17e')](_0x57a0cb[_0x2066('0x17f')],_0x57a0cb[_0x2066('0x17d')]):_0x57a0cb['dialOriginateCallerIdNumber']):utils[_0x2066('0x180')](_[_0x2066('0xf1')](_0x57a0cb['TrunkBackup'])?_0x57a0cb[_0x2066('0x8f')][_0x2066('0x17b')]:_0x57a0cb[_0x2066('0x181')][_0x2066('0x17b')],_0x57a0cb[_0x2066('0x17c')],_0x57a0cb[_0x2066('0x17d')]>0x0?utils['getCallerIdRandom'](_0x57a0cb['dialOriginateCallerIdNumber'],_0x57a0cb['dialRandomLastDigitCallerIdNumber']):_0x57a0cb[_0x2066('0x17f')]);if(_0xe6b91f){_0x59fb63['XMD-ORIGINATECALLERIDNAME']=_0x5344c4[_0x2066('0x26')][_0x4e1d2c][_0x2066('0x182')]=utils['extractCalleridName'](_0xe6b91f);_0x59fb63[_0x2066('0x183')]=_0x13912a['phone'];}_0x57a0cb[_0x2066('0x184')]=_0x59fb63;return ami[_0x2066('0x9e')]({'actionid':_0x4e1d2c,'action':_0x2066('0x15e'),'channel':_0x5344c4[_0x2066('0x89')](_0x57a0cb[_0x2066('0x8f')])?util[_0x2066('0x80')](_0x2066('0x185'),_0x57a0cb[_0x2066('0x8f')]['name'],isNotNull(_0x57a0cb[_0x2066('0x186')])?_0x57a0cb['dialPrefix'][_0x2066('0x187')]()||'':'',_0x57a0cb[_0x2066('0x188')]>0x0?_0x13912a[_0x2066('0x160')][_0x2066('0x189')](_0x57a0cb[_0x2066('0x188')]):_0x13912a['phone']):util[_0x2066('0x80')](_0x2066('0x185'),_[_0x2066('0xf1')](_0x57a0cb['TrunkBackup'])?_0x57a0cb['Trunk'][_0x2066('0x60')]:_0x57a0cb[_0x2066('0x181')][_0x2066('0x60')],isNotNull(_0x57a0cb[_0x2066('0x186')])?_0x57a0cb[_0x2066('0x186')][_0x2066('0x187')]()||'':'',_0x57a0cb[_0x2066('0x188')]>0x0?_0x13912a[_0x2066('0x160')][_0x2066('0x189')](_0x57a0cb[_0x2066('0x188')]):_0x13912a[_0x2066('0x160')]),'callerid':_0xe6b91f,'Exten':'xcally-motion-dialer','Context':_0x2066('0x18a'),'Priority':'1','variable':_0x59fb63,'timeout':(_0x57a0cb[_0x2066('0x18b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4e1d2c})[_0x2066('0x3d')](function(_0x2a8b67){return _0x3280d3(_0x2a8b67);})[_0x2066('0xa2')](function(_0x1f2a5e){_0x57a0cb[_0x2066('0x18c')]+=0x1;var _0x20371d=new History(_0x5344c4[_0x2066('0x26')][_0x4e1d2c]);logger[_0x2066('0x65')](util[_0x2066('0x80')](_0x2066('0x18d'),JSON[_0x2066('0x76')](_0x1f2a5e)));_0x20371d['state']=0xe;_0x20371d[_0x2066('0xce')]=_0x2066('0x18e');_0x20371d['starttime']=moment()[_0x2066('0x80')](_0x2066('0xc0'));_0x20371d['endtime']=_0x20371d['starttime'];hopperUtils[_0x2066('0xc6')](_0x20371d)[_0x2066('0xa2')](loggerCatch(_0x2066('0x18f')));_0x5344c4[_0x2066('0xc8')](_0x20371d)[_0x2066('0xa2')](loggerCatch(_0x2066('0x18f')))[_0x2066('0x21')](function(){delete _0x5344c4[_0x2066('0x26')][_0x4e1d2c];return _0x5554ab(msgResponse(_0x2066('0x15e'),_0x2066('0x88'),_0x2066('0x190')));});});});};Dialer[_0x2066('0x1e')][_0x2066('0x191')]=function(_0x30e32c,_0x3ecb5e,_0x40fb3a){var _0x565c0b=new History(_0x3ecb5e);if(_0x565c0b['countbusyretry']+_0x565c0b[_0x2066('0x11d')]+_0x565c0b[_0x2066('0x11e')]+_0x565c0b[_0x2066('0x11f')]+_0x565c0b['countdropretry']+_0x565c0b[_0x2066('0xe5')]+_0x565c0b[_0x2066('0x11b')]+_0x565c0b[_0x2066('0x120')]>=_0x40fb3a[_0x2066('0x121')]-0x1){return!![];}switch(_0x30e32c){case 0x3:if(_0x565c0b[_0x2066('0x11e')]>=_0x40fb3a['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x2066('0xd8')]({'active':![],'countnoanswerretry':_0x565c0b[_0x2066('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x40fb3a[_0x2066('0x192')],_0x2066('0xe8'))['format'](_0x2066('0xc0')),'ContactId':_0x565c0b['ContactId'],'ListId':_0x565c0b['ListId'],'VoiceQueueId':_0x565c0b[_0x2066('0xdb')]||undefined,'CampaignId':_0x565c0b[_0x2066('0xdc')]||undefined})['catch'](loggerCatch(_0x2066('0x193')));break;case 0x5:if(_0x565c0b[_0x2066('0x128')]>=_0x40fb3a['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x2066('0xd8')]({'active':![],'countbusyretry':_0x565c0b['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x40fb3a['dialBusyRetryFrequency'],'minutes')[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0x565c0b['ContactId'],'ListId':_0x565c0b[_0x2066('0xda')],'VoiceQueueId':_0x565c0b[_0x2066('0xdb')]||undefined,'CampaignId':_0x565c0b['CampaignId']||undefined})['catch'](loggerCatch(_0x2066('0x194')));break;case 0x8:if(_0x565c0b[_0x2066('0x11d')]>=_0x40fb3a[_0x2066('0x195')]-0x1){return!![];}hopperUtils[_0x2066('0xd8')]({'active':![],'countcongestionretry':_0x565c0b[_0x2066('0x11d')]+=0x1,'scheduledat':moment()[_0x2066('0xe6')](_0x40fb3a['dialCongestionRetryFrequency'],_0x2066('0xe8'))[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0x565c0b['ContactId'],'ListId':_0x565c0b[_0x2066('0xda')],'VoiceQueueId':_0x565c0b[_0x2066('0xdb')]||undefined,'CampaignId':_0x565c0b[_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0x196')));break;case 0x0:if(_0x565c0b['countnosuchnumberretry']>=_0x40fb3a[_0x2066('0x197')]-0x1){return!![];}else{hopperUtils[_0x2066('0xd8')]({'active':![],'countnosuchnumberretry':_0x565c0b['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x2066('0xe6')](_0x40fb3a[_0x2066('0x198')],'minutes')[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0x565c0b[_0x2066('0xd9')],'ListId':_0x565c0b['ListId'],'VoiceQueueId':_0x565c0b['VoiceQueueId']||undefined,'CampaignId':_0x565c0b[_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x565c0b[_0x2066('0xd1')]>=_0x40fb3a['dialDropMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x565c0b['countdropretry']+=0x1,'scheduledat':moment()[_0x2066('0xe6')](_0x40fb3a[_0x2066('0xd3')],_0x2066('0xe8'))[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0x565c0b[_0x2066('0xd9')],'ListId':_0x565c0b[_0x2066('0xda')],'VoiceQueueId':_0x565c0b[_0x2066('0xdb')]||undefined,'CampaignId':_0x565c0b['CampaignId']||undefined})[_0x2066('0xa2')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x565c0b[_0x2066('0xe5')]>=_0x40fb3a['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x2066('0xd8')]({'active':![],'countabandonedretry':_0x565c0b[_0x2066('0xe5')]+=0x1,'scheduledat':moment()[_0x2066('0xe6')](_0x40fb3a[_0x2066('0xe7')],_0x2066('0xe8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x565c0b[_0x2066('0xd9')],'ListId':_0x565c0b[_0x2066('0xda')],'VoiceQueueId':_0x565c0b[_0x2066('0xdb')]||undefined,'CampaignId':_0x565c0b['CampaignId']||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0xe9')));break;case 0x13:if(_0x565c0b[_0x2066('0x11b')]>=_0x40fb3a[_0x2066('0x123')]-0x1){return!![];}hopperUtils[_0x2066('0xd8')]({'active':![],'countmachineretry':_0x565c0b['countmachineretry']+=0x1,'scheduledat':moment()[_0x2066('0xe6')](_0x40fb3a['dialMachineRetryFrequency'],_0x2066('0xe8'))[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0x565c0b['ContactId'],'ListId':_0x565c0b[_0x2066('0xda')],'VoiceQueueId':_0x565c0b[_0x2066('0xdb')]||undefined,'CampaignId':_0x565c0b['CampaignId']||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0x12a')));break;case 0x14:if(_0x565c0b[_0x2066('0x120')]>=_0x40fb3a['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x2066('0xd8')]({'active':![],'countagentrejectretry':_0x565c0b['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x2066('0xe6')](_0x40fb3a[_0x2066('0x199')],_0x2066('0xe8'))[_0x2066('0x80')](_0x2066('0xc0')),'ContactId':_0x565c0b[_0x2066('0xd9')],'ListId':_0x565c0b[_0x2066('0xda')],'VoiceQueueId':_0x565c0b['VoiceQueueId']||undefined,'CampaignId':_0x565c0b[_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x2066('0x1e')][_0x2066('0x108')]=function(_0x1b1ee7,_0x38f41c,_0x59ac01){var _0x3532f0=this;var _0x580e52=new History(_0x1b1ee7);var _0x5dc804=![];var _0x3d9041;var _0x5decd2;return new Promise(function(_0x4aac48,_0x5a68ac){if(_[_0x2066('0x3f')](_0x38f41c)&&typeof _0x38f41c!=='object'){return _0x5a68ac(msgResponse(_0x2066('0x19a'),_0x2066('0x95'),_0x2066('0x19b')));}if(_[_0x2066('0x3f')](_0x59ac01)&&typeof _0x59ac01!=='object'){return _0x5a68ac(msgResponse('[callProgressDetecting]','Failure',_0x2066('0x19c')));}hopperUtils[_0x2066('0xd4')](_0x580e52,_0x59ac01[_0x2066('0x19d')],_0x38f41c)[_0x2066('0x3d')](function(_0x4a33c1){if(_0x4a33c1[_0x2066('0xd6')]==0x1)_0x5dc804=!![];switch(_0x59ac01[_0x2066('0x19d')]){case'0':_0x38f41c[_0x2066('0x19e')]+=0x1;_0x580e52[_0x2066('0xcd')]=0x0;_0x580e52[_0x2066('0xce')]=_0x2066('0x19f');_0x580e52[_0x2066('0x11f')]+=0x1;_0x580e52['countglobal']+=0x1;ami[_0x2066('0x113')](_0x2066('0x1a0'),ut[_0x2066('0x115')](_0x1b1ee7,_0x2066('0x1a1')));_0x3d9041=_0x38f41c[_0x2066('0x198')];_0x5decd2=_0x38f41c[_0x2066('0xe4')];hopperUtils[_0x2066('0xc6')](_0x580e52)[_0x2066('0xa2')](loggerCatch(_0x2066('0x11c')));if(_0x3532f0[_0x2066('0x191')](0x0,_0x1b1ee7,_0x38f41c)&&!_0x5dc804){if(_0x580e52[_0x2066('0x11f')]>=_0x38f41c[_0x2066('0x197')]){_0x3532f0[_0x2066('0x124')](_0x580e52,_0x4aac48,_0x5a68ac,_0x2066('0x1a2'));}else{_0x3532f0[_0x2066('0x122')](_0x580e52,_0x4aac48,_0x5a68ac,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x38f41c[_0x2066('0x1a3')]+=0x1;_0x580e52[_0x2066('0xcd')]=0x3;_0x580e52['statedesc']=_0x2066('0x1a4');_0x580e52[_0x2066('0x11e')]+=0x1;_0x580e52['countglobal']+=0x1;var _0x28a3f2=ut[_0x2066('0x1a5')](_0x1b1ee7,_0x38f41c);ami[_0x2066('0x113')](_0x2066('0x1a6'),_0x28a3f2);_0x3d9041=_0x38f41c[_0x2066('0x192')];_0x5decd2=_0x38f41c['callAdditionalPhoneAfterMin'];hopperUtils[_0x2066('0xc6')](_0x580e52)[_0x2066('0xa2')](loggerCatch(_0x2066('0x1a7')));if(_0x3532f0['checkRetriveMax'](0x3,_0x1b1ee7,_0x38f41c)&&!_0x5dc804){if(_0x580e52[_0x2066('0x11e')]>=_0x38f41c[_0x2066('0x1a8')]){_0x3532f0[_0x2066('0x124')](_0x580e52,_0x4aac48,_0x5a68ac,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3532f0[_0x2066('0x122')](_0x580e52,_0x4aac48,_0x5a68ac,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x38f41c['outboundBusyCallsDay']+=0x1;_0x580e52[_0x2066('0xcd')]=0x5;_0x580e52['statedesc']='Busy';_0x580e52['countbusyretry']+=0x1;_0x580e52[_0x2066('0xd2')]+=0x1;ami['emit'](_0x2066('0x1a9'),ut[_0x2066('0x115')](_0x1b1ee7,_0x2066('0x1aa')));_0x3d9041=_0x38f41c['dialBusyRetryFrequency'];_0x5decd2=_0x38f41c['callAdditionalPhoneAfterMin'];hopperUtils[_0x2066('0xc6')](_0x580e52)[_0x2066('0xa2')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3532f0['checkRetriveMax'](0x5,_0x1b1ee7,_0x38f41c)&&!_0x5dc804){if(_0x580e52['countbusyretry']>=_0x38f41c[_0x2066('0x1ab')]){_0x3532f0[_0x2066('0x124')](_0x580e52,_0x4aac48,_0x5a68ac,_0x2066('0x1ac'));}else{_0x3532f0[_0x2066('0x122')](_0x580e52,_0x4aac48,_0x5a68ac,_0x2066('0x1ac'));}}break;case'8':_0x38f41c[_0x2066('0x1ad')]+=0x1;_0x580e52[_0x2066('0xcd')]=0x8;_0x580e52[_0x2066('0xce')]='Congestion';_0x580e52[_0x2066('0x11d')]+=0x1;_0x580e52[_0x2066('0xd2')]+=0x1;_0x3d9041=_0x38f41c[_0x2066('0x1ae')];_0x5decd2=_0x38f41c[_0x2066('0xe4')];ami[_0x2066('0x113')](_0x2066('0x1af'),ut[_0x2066('0x115')](_0x1b1ee7,_0x2066('0x1b0')));hopperUtils['createHistory'](_0x580e52)[_0x2066('0xa2')](loggerCatch(_0x2066('0x1b1')));if(_0x3532f0[_0x2066('0x191')](0x8,_0x1b1ee7,_0x38f41c)&&!_0x5dc804){if(_0x580e52[_0x2066('0x11d')]>=_0x38f41c[_0x2066('0x195')]){_0x3532f0[_0x2066('0x124')](_0x580e52,_0x4aac48,_0x5a68ac,'reason\x208\x20congestion');}else{_0x3532f0[_0x2066('0x122')](_0x580e52,_0x4aac48,_0x5a68ac,_0x2066('0x1b2'));}}break;case'11':_0x38f41c[_0x2066('0x1b3')]+=0x1;_0x580e52['state']=0xb;_0x580e52[_0x2066('0xce')]=_0x2066('0x1b4');_0x580e52['countabandonedretry']+=0x1;_0x580e52['countglobal']+=0x1;_0x3d9041=_0x38f41c[_0x2066('0xe7')];_0x5decd2=_0x38f41c['callAdditionalPhoneAfterMin'];hopperUtils[_0x2066('0xc6')](_0x580e52)[_0x2066('0xa2')](loggerCatch(_0x2066('0xea')));if(_0x3532f0[_0x2066('0x191')](0xb,_0x1b1ee7,_0x38f41c)&&!_0x5dc804){if(_0x580e52[_0x2066('0xe5')]>=_0x38f41c[_0x2066('0x1b5')]){_0x3532f0[_0x2066('0x124')](_0x580e52,_0x4aac48,_0x5a68ac,_0x2066('0x1b6'));}else{_0x3532f0[_0x2066('0x122')](_0x580e52,_0x4aac48,_0x5a68ac,_0x2066('0x1b6'));}}break;case'20':_0x38f41c[_0x2066('0x1b7')]+=0x1;_0x580e52[_0x2066('0xcd')]=0x14;_0x580e52[_0x2066('0xce')]='AgentReject';_0x580e52['countagentrejectretry']+=0x1;_0x580e52['countglobal']+=0x1;_0x3d9041=_0x38f41c[_0x2066('0x199')];_0x5decd2=_0x38f41c['callAdditionalPhoneAfterMin'];ami['emit'](_0x2066('0x1b8'),ut['buildObj'](_0x1b1ee7,_0x2066('0x1b9')));hopperUtils[_0x2066('0xc6')](_0x580e52)['catch'](loggerCatch(_0x2066('0x1ba')));if(_0x3532f0[_0x2066('0x191')](0x14,_0x1b1ee7,_0x38f41c)&&!_0x5dc804){if(_0x580e52[_0x2066('0x120')]>=_0x38f41c[_0x2066('0x1bb')]){_0x3532f0['createStateFinal'](_0x580e52,_0x4aac48,_0x5a68ac,'reason\x2020\x20agentreject');}else{_0x3532f0[_0x2066('0x122')](_0x580e52,_0x4aac48,_0x5a68ac,_0x2066('0x1bc'));}}break;default:_0x38f41c[_0x2066('0x12f')]+=0x1;_0x580e52[_0x2066('0xcd')]=0xc;_0x580e52['statedesc']=_0x59ac01[_0x2066('0x19d')];_0x3d9041=_0x38f41c[_0x2066('0x199')];_0x5decd2=_0x38f41c[_0x2066('0xe4')];hopperUtils['createHistory'](_0x580e52)[_0x2066('0xa2')](loggerCatch(_0x2066('0x1bd')));if(_0x3532f0['checkRetriveMax'](_0x59ac01[_0x2066('0x19d')],_0x1b1ee7,_0x38f41c)&&!_0x5dc804){if(_0x580e52[_0x2066('0x128')]+_0x580e52[_0x2066('0x11d')]+_0x580e52[_0x2066('0x11e')]+_0x580e52['countnosuchnumberretry']+_0x580e52[_0x2066('0xd1')]+_0x580e52[_0x2066('0xe5')]+_0x580e52[_0x2066('0x11b')]+_0x580e52[_0x2066('0x120')]>=_0x38f41c['dialGlobalMaxRetry']){_0x3532f0[_0x2066('0x122')](_0x580e52,_0x4aac48,_0x5a68ac,_0x59ac01[_0x2066('0x19d')]);}else{_0x3532f0[_0x2066('0x124')](_0x580e52,_0x4aac48,_0x5a68ac,_0x59ac01['reason']);}}}})[_0x2066('0x3d')](function(){if(_0x5dc804){hopperUtils[_0x2066('0xeb')](_0x580e52,_0x3d9041,_0x5decd2)[_0x2066('0x3d')](function(){return _0x4aac48(0x1);});}});});};Dialer[_0x2066('0x1e')][_0x2066('0x122')]=function(_0x596c39,_0x32f4a1,_0x556150,_0x3ff857){var _0x529f1d=new Final(_0x596c39);_0x529f1d[_0x2066('0xcd')]=0xf;_0x529f1d[_0x2066('0xce')]='Global';this[_0x2066('0x124')](_0x529f1d,_0x32f4a1,_0x556150,_0x3ff857);};Dialer[_0x2066('0x1e')][_0x2066('0x124')]=function(_0x1fef93,_0x120812,_0x148869,_0xf6f11b){hopperUtils['moveContactManagedDialer'](_0x1fef93)[_0x2066('0x3d')](function(){return _0x120812(msgResponse(_0x2066('0x19a'),_0x2066('0x107'),_0xf6f11b));})['catch'](function(){return _0x148869(msgResponse(_0x2066('0x1be'),_0x2066('0x95'),_0x2066('0x1bf')));});};Dialer[_0x2066('0x1e')][_0x2066('0xa')]=function(_0x3cd9f3){var _0x4b53f8=_0x3cd9f3[_0x2066('0x1c0')]/0x64;var _0x1b28d7=_0x3cd9f3[_0x2066('0xcc')]/(_0x3cd9f3[_0x2066('0xcc')]+_0x3cd9f3[_0x2066('0xc2')]);var _0x100af9=Math[_0x2066('0x1c1')](_0x3cd9f3[_0x2066('0x1c2')]*(_0x3cd9f3[_0x2066('0x1c3')]/0x64));var _0x4683d3=Math[_0x2066('0x1c1')](_0x3cd9f3['predictiveIntervalAvailable']*(_0x3cd9f3[_0x2066('0x1c4')]/0x64));var _0x239dd8=_0x3cd9f3['available']+_0x3cd9f3[_0x2066('0x139')];var _0xbd326e=Math[_0x2066('0x1c5')](_0x3cd9f3[_0x2066('0x1c6')]*_0x3cd9f3[_0x2066('0x5a')]*_0x3cd9f3[_0x2066('0x1c7')]*_0x3cd9f3[_0x2066('0x1c8')]);if(_[_0x2066('0x3f')](_0x3cd9f3[_0x2066('0x5f')])){if(!_[_0x2066('0x3f')](_0x3cd9f3['startPredictive'])){_0x3cd9f3['startPredictive']=undefined;loggerPredictive[_0x2066('0x65')](_0x2066('0x1c9'),_0x2066('0x1ca'));}if(!_[_0x2066('0x3f')](_0x3cd9f3[_0x2066('0x63')])){loggerPredictive['error'](_0x2066('0x1c9'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3cd9f3['handlePredictive']);_0x3cd9f3[_0x2066('0x63')]=undefined;}_0x3cd9f3[_0x2066('0x5f')]=moment()[_0x2066('0x80')](_0x2066('0xc0'));loggerPredictive[_0x2066('0x45')](_0x3cd9f3[_0x2066('0x60')],_0x2066('0x1cb'),_0x3cd9f3[_0x2066('0x5f')]);this[_0x2066('0xb3')](_0x3cd9f3,0x1);}else if(ifInterval(_0x3cd9f3[_0x2066('0x1cc')],_0x3cd9f3[_0x2066('0x5f')])){this[_0x2066('0xb3')](_0x3cd9f3,0x1);loggerPredictiveCalls[_0x2066('0x45')](_0x2066('0x1cd'),_0x3cd9f3[_0x2066('0x5f')],_0x3cd9f3[_0x2066('0x60')]);_0x3cd9f3['erlangCalls']=0x0;_0x3cd9f3[_0x2066('0x1ce')]=0x0;}else if(_0x4b53f8<_0x1b28d7&&_0x3cd9f3[_0x2066('0x1cf')]===_0x2066('0x1d0')){clearPredictiveAttributes(_0x3cd9f3);loggerPredictive['info'](_0x2066('0x1d1'),'Dropped\x20calls\x20day',_0x1b28d7,_0x2066('0x5f'),_0x3cd9f3['name']);}else if(_0xbd326e<_0x3cd9f3[_0x2066('0x1ce')]&&_0x3cd9f3[_0x2066('0x1cf')]===_0x2066('0x1d0')){clearPredictiveAttributes(_0x3cd9f3);loggerPredictive[_0x2066('0x45')](_0x2066('0x1d2'),_0x2066('0x1d3'),_0xbd326e,_0x2066('0x1d4'),_0x3cd9f3['predictiveIntervalErlangCallsDroppedCalls'],_0x2066('0x5f'),_0x3cd9f3[_0x2066('0x60')]);}else if(!ifInterval(_0x3cd9f3[_0x2066('0x1cc')],_0x3cd9f3[_0x2066('0x5f')])&&_[_0x2066('0x3f')](_0x3cd9f3['startPredictive'])&&!_[_0x2066('0x3f')](_0x3cd9f3[_0x2066('0x5f')])){_0x3cd9f3[_0x2066('0x62')]=moment()[_0x2066('0x80')](_0x2066('0xc0'));loggerPredictive[_0x2066('0x45')](_0x3cd9f3[_0x2066('0x60')],_0x2066('0x1d5'),_0x3cd9f3[_0x2066('0x62')]);hopperUtils[_0x2066('0x1d6')](_0x3cd9f3['dialPredictiveInterval'])[_0x2066('0x3d')](this['getDataPredictive'](_0x3cd9f3))[_0x2066('0x3d')](mergeDataErlangB(_0x3cd9f3))['then'](this[_0x2066('0x1d7')](_0x3cd9f3))[_0x2066('0xa2')](loggerCatchPredictive(_0x2066('0x1d8'),_0x3cd9f3));}else if(!ifInterval(_0x3cd9f3['dialPredictiveInterval'],_0x3cd9f3[_0x2066('0x62')])){_0x3cd9f3['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3cd9f3[_0x2066('0x62')]=moment()[_0x2066('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2066('0x45')](_0x3cd9f3[_0x2066('0x60')],_0x2066('0x1d9'),_0x3cd9f3[_0x2066('0x62')]);clearInterval(_0x3cd9f3[_0x2066('0x63')]);_0x3cd9f3['handlePredictive']=undefined;hopperUtils[_0x2066('0x1d6')](_0x3cd9f3[_0x2066('0x1cc')])[_0x2066('0x3d')](this[_0x2066('0x1da')](_0x3cd9f3))['then'](mergeDataErlangB(_0x3cd9f3))[_0x2066('0x3d')](this[_0x2066('0x1d7')](_0x3cd9f3))['catch'](loggerCatchPredictive(_0x2066('0x1db'),_0x3cd9f3));}else if(_0x3cd9f3[_0x2066('0x1c2')]&&_0x239dd8<_0x3cd9f3[_0x2066('0x1c2')]-_0x4683d3){clearPredictiveAttributes(_0x3cd9f3);loggerPredictive[_0x2066('0x45')](_0x3cd9f3[_0x2066('0x60')],_0x2066('0x1dc'),_0x239dd8,_0x2066('0x1dd'),_0x3cd9f3[_0x2066('0x1c2')],'-',_0x4683d3,'=',_0x3cd9f3['predictiveIntervalAvailable']-_0x4683d3,')');}else if(_0x3cd9f3['predictiveIntervalAvailable']&&_0x239dd8>_0x3cd9f3[_0x2066('0x1c2')]+_0x100af9){clearPredictiveAttributes(_0x3cd9f3);loggerPredictive['info'](_0x3cd9f3[_0x2066('0x60')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x239dd8,_0x2066('0x1de'),_0x3cd9f3[_0x2066('0x1c2')],'+',_0x100af9,'=',_0x3cd9f3['predictiveIntervalAvailable']+_0x100af9,')');}};Dialer[_0x2066('0x1e')]['getDataPredictive']=function(_0x22383c){var _0x4052d4=this;return function(_0x2a02be){return new Promise(function(_0xd43446,_0x4c2430){_[_0x2066('0x5d')](_0x22383c,_0x2a02be[0x0]);if(checkGetDataPredictive(_0x2a02be[0x0])){var _0x8fcf23=_0x22383c[_0x2066('0x1c2')]=_0x22383c[_0x2066('0x139')]+_0x22383c['available'];var _0x2172fa=_0x22383c['dialPredictiveInterval']*0x3c;var _0x3a6679=_0x2a02be[0x0][_0x2066('0x4f')]+_0x2a02be[0x0]['predictiveIntervalAvgHoldtime'];var _0x23d351=(_0x2a02be[0x0][_0x2066('0x49')]+_0x2a02be[0x0][_0x2066('0x4a')]+_0x2a02be[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2a02be[0x0][_0x2066('0x48')];_0x22383c[_0x2066('0x1c7')]=_0x23d351>0x0?_0x23d351:0x1;switch(_0x22383c[_0x2066('0x1cf')]){case _0x2066('0x1d0'):var _0x3f53e4=_0x22383c[_0x2066('0x1c0')]/0x64;return _0x4052d4[_0x2066('0x1df')](_0x8fcf23,_0x2172fa,_0x3a6679,_0x23d351,_0x3f53e4)[_0x2066('0x3d')](function(_0x389205){return _0xd43446(_0x389205);});case'agentBusyFactor':var _0x17f39a=_0x22383c[_0x2066('0x1c0')]/0x64;return _0x4052d4[_0x2066('0x1e0')](_0x8fcf23,_0x2172fa,_0x3a6679,_0x23d351,_0x17f39a)[_0x2066('0x3d')](function(_0x409ce0){return _0xd43446(_0x409ce0);});default:return _0x4c2430(msgResponse(_0x2066('0x1e1'),_0x2066('0x95'),_0x2066('0x1e2')));}}else{return _0x4c2430(msgResponse(_0x2066('0x1e1'),_0x2066('0x95'),_0x2066('0x1e3')));}});};};Dialer[_0x2066('0x1e')][_0x2066('0x1e4')]=function(_0x59d4d2){var _0x46e16e=this;return function(_0x128993){return new Promise(function(_0x14b14c,_0x521fcc){_[_0x2066('0x5d')](_0x59d4d2,_0x128993[0x0]);if(checkGetDataPredictive(_0x128993[0x0])){loggerPredictive[_0x2066('0x45')](JSON['stringify'](_0x128993[0x0]));if(_0x59d4d2['dialPredictiveOptimization']==='dropRate'){return _0x46e16e['getVoiceQueueRtPauses'](_0x59d4d2['id'])['then'](function(_0x18a40e){var _0x3b9619=_0x59d4d2[_0x2066('0x1e5')]-_0x18a40e[0x0][_0x2066('0x1e6')];var _0x2e9ea4=_0x59d4d2[_0x2066('0x1cc')]*0x3c;var _0x10fb57=_0x128993[0x0][_0x2066('0x4f')]+_0x128993[0x0]['predictiveIntervalAvgHoldtime'];var _0x2a5e4d=(_0x128993[0x0]['predictiveIntervalAnsweredCalls']+_0x128993[0x0][_0x2066('0x4a')]+_0x128993[0x0][_0x2066('0x4c')])/_0x128993[0x0]['predictiveIntervalTotalCalls'];var _0x4c670f=_0x59d4d2[_0x2066('0x1c0')]/0x64;_0x59d4d2['predictiveIntervalPauses']=_0x18a40e[0x0][_0x2066('0x1e6')]||0x0;_0x59d4d2[_0x2066('0x1c7')]=_0x2a5e4d>0x0?_0x2a5e4d:0x1;return _0x46e16e[_0x2066('0x1df')](_0x3b9619,_0x2e9ea4,_0x10fb57,_0x2a5e4d,_0x4c670f);})[_0x2066('0x3d')](function(_0x58cb6e){return _0x14b14c(_0x58cb6e);})[_0x2066('0xa2')](function(_0x904862){return _0x521fcc(msgResponse('[CatchErlangB]','Failure',JSON[_0x2066('0x76')](_0x904862)));});}if(_0x59d4d2[_0x2066('0x1cf')]===_0x2066('0x1e7')){return _0x46e16e['getVoiceQueueRtPauses'](_0x59d4d2['id'])[_0x2066('0x3d')](function(_0x426ea5){var _0x33aec1=_0x59d4d2[_0x2066('0x1e5')]-_0x426ea5[0x0][_0x2066('0x1e6')];var _0x1aa8ce=_0x59d4d2[_0x2066('0x1cc')]*0x3c;var _0x49cfef=_0x128993[0x0][_0x2066('0x4f')]+_0x128993[0x0][_0x2066('0x52')];var _0x2a397b=(_0x128993[0x0]['predictiveIntervalAnsweredCalls']+_0x128993[0x0][_0x2066('0x4a')]+_0x128993[0x0][_0x2066('0x4c')])/_0x128993[0x0][_0x2066('0x48')];var _0x22b83e=_0x59d4d2[_0x2066('0x1c0')]/0x64;_0x59d4d2[_0x2066('0x1e8')]=_0x426ea5[0x0][_0x2066('0x1e6')]||0x0;_0x59d4d2['predictiveIntervalHitRate']=_0x2a397b>0x0?_0x2a397b:0x1;return _0x46e16e[_0x2066('0x1e0')](_0x33aec1,_0x1aa8ce,_0x49cfef,_0x2a397b,_0x22b83e);})[_0x2066('0x3d')](function(_0x12b2e1){return _0x14b14c(_0x12b2e1);})[_0x2066('0xa2')](function(_0x5b07a2){return _0x521fcc(msgResponse(_0x2066('0x1e9'),_0x2066('0x95'),JSON[_0x2066('0x76')](_0x5b07a2)));});}}else{return _0x521fcc(msgResponse(_0x2066('0x1e1'),'Failure',_0x2066('0x1e3')));}});};};Dialer[_0x2066('0x1e')][_0x2066('0x1d7')]=function(_0x4e3c97){var _0x527e03=this;return function(){var _0x555be0=0x0;var _0x3fac4c=Math['floor'](_0x4e3c97['erlangCallToSecond']*0x3e8);if(_0x3fac4c>0x0){_0x3fac4c=_0x3fac4c<0x64?0x64:_0x3fac4c;loggerPredictive[_0x2066('0x45')](_0x4e3c97[_0x2066('0x60')],_0x2066('0x1ea'),_0x3fac4c,_0x2066('0x1eb'));_0x4e3c97[_0x2066('0x63')]=setInterval(function(){_0x527e03['handlePredictive'](_0x4e3c97);loggerPredictiveCalls[_0x2066('0x45')](_0x2066('0x1ec'),_0x555be0+=0x1);},_0x3fac4c);}else{loggerPredictive['info'](_0x4e3c97[_0x2066('0x60')],_0x2066('0x1ed'));}};};Dialer[_0x2066('0x1e')]['checkContactBlack']=function(_0x21e23d,_0x3a5708){var _0x5de754=this;return function(_0x211b16){if(_[_0x2066('0x7c')](_0x211b16)){if(_['isNil'](_0x3a5708[_0x2066('0x153')])||!_0x3a5708['recallme']){if(_0x21e23d[_0x2066('0xb1')]===_0x2066('0x9')){_0x21e23d[_0x2066('0x73')]=_['isUndefined'](_0x21e23d[_0x2066('0x73')])?!![]:_0x21e23d[_0x2066('0x73')];var _0xf24371=uuid['v4']();_0x5de754['actions'][_0xf24371]=new Action(_0x21e23d,_0x3a5708,_0xf24371);loggerBooked['info']('[booked][checkContactBlack]',_0xf24371,_0x2066('0x1ee'),JSON['stringify'](_0x21e23d['queueStatusComplete']),'Queue:\x20',_0x21e23d[_0x2066('0x60')]);if(_0x21e23d[_0x2066('0x73')]){_0x21e23d[_0x2066('0x73')]=![];_0x5de754[_0x2066('0xf5')][_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xbd')]]=[];ami[_0x2066('0x9e')]({'actionid':_0xf24371,'action':_0x2066('0x1ef'),'queue':_0x21e23d[_0x2066('0x60')]})[_0x2066('0xa2')](function(){_0x5de754[_0x2066('0xfa')](_0x21e23d);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xd9')],'ListId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xda')],'VoiceQueueId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xdb')]||undefined,'CampaignId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0x1f0')));delete _0x5de754[_0x2066('0x26')][_0xf24371];});}else{loggerBooked[_0x2066('0x45')](_0x2066('0x1f1'),JSON[_0x2066('0x76')](_0x21e23d['queueStatusComplete']),_0x2066('0x1f2'),_0x21e23d[_0x2066('0x60')]);_0x5de754[_0x2066('0xfa')](_0x21e23d);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xd9')],'ListId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xda')],'VoiceQueueId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xdb')]||undefined,'CampaignId':_0x5de754[_0x2066('0x26')][_0xf24371][_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0x1f0')));delete _0x5de754['actions'][_0xf24371];}}else{return _0x5de754[_0x2066('0x15c')](_0x21e23d,_0x3a5708);}}else{if(utils['getSeconds'](undefined,_0x3a5708[_0x2066('0x1f3')])<_0x21e23d[_0x2066('0x1f4')]*0x3c){if(_0x3a5708[_0x2066('0x159')]&&!_0x3a5708[_0x2066('0x159')]['voicePause']){_0x5de754[_0x2066('0xf6')]['run'](_0x3a5708['id'])['finally'](function(){_0x5de754[_0x2066('0xfa')](_0x21e23d);});}else{hopperUtils['unlockContact']({'active':![]},_0x3a5708['id'],0x1)[_0x2066('0x21')](function(){_0x5de754[_0x2066('0xfa')](_0x21e23d);});}}else{_0x21e23d['outboundReCallsDay']+=0x1;_0x5de754[_0x2066('0xfa')](_0x21e23d);if(_0x21e23d[_0x2066('0x1f5')]){hopperUtils[_0x2066('0xd8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3a5708[_0x2066('0xd9')],'ListId':_0x3a5708[_0x2066('0xda')],'VoiceQueueId':_0x3a5708[_0x2066('0xdb')]||undefined,'CampaignId':_0x3a5708[_0x2066('0xdc')]||undefined})[_0x2066('0xa2')](loggerCatch(_0x2066('0x1f6')));hopperUtils[_0x2066('0xc6')](createObjHistory(_0x21e23d,_0x3a5708,utils['CAMPAIGN_STATUS'][_0x2066('0x1f7')],0x17,'RecallInQueue'))['catch'](loggerCatch(_0x2066('0x1f8')));}else{_0x5de754[_0x2066('0x117')](createObjHistory(_0x21e23d,_0x3a5708,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x2066('0x1f9')),_0x2066('0x1fa'),_0x2066('0x1fb'));}}}}else{_0x21e23d[_0x2066('0x1fc')]+=0x1;_0x5de754[_0x2066('0x117')](createObjHistory(_0x21e23d,_0x3a5708,utils[_0x2066('0x6a')][_0x2066('0x1fd')],0xd,_0x2066('0x1fe')),_0x2066('0x1ff'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x2066('0x1e')][_0x2066('0x15b')]=function(_0x2341ed){var _0x47e46f=this;var _0x431ce9=_0x2341ed['limitCalls']-_0x2341ed[_0x2066('0x83')];emitCampaignSummary(_0x2341ed);if(_0x431ce9>0x0&&_0x2341ed[_0x2066('0x68')]==0x0){if(_0x431ce9>this[_0x2066('0x200')]){_0x431ce9=this[_0x2066('0x200')];}_0x2341ed[_0x2066('0x68')]=0x1;hopperUtils[_0x2066('0x201')](_0x2341ed,_0x431ce9)['then'](function(_0x559974){_0x2341ed['temp']=0x0;if(_0x559974){if(!utils[_0x2066('0x202')](_0x559974)){_0x2341ed[_0x2066('0x70')]=utils['CAMPAIGN_STATUS'][_0x2066('0x6e')];logger[_0x2066('0x45')]('[getContactCampaign2][Empty]'+_0x2341ed['name']);}else{_0x2341ed[_0x2066('0x83')]+=_0x559974[_0x2066('0x9c')];_0x2341ed[_0x2066('0x70')]=utils[_0x2066('0x6a')][_0x2066('0x203')];for(var _0x552df8=0x0;_0x552df8<_0x559974[_0x2066('0x9c')];_0x552df8+=0x1){_0x2341ed[_0x2066('0x204')]+=0x1;if(_[_0x2066('0xf1')](_0x559974[_0x552df8])||_[_0x2066('0xf1')](_0x559974[_0x552df8][_0x2066('0x205')])||_[_0x2066('0xf1')](_0x559974[_0x552df8][_0x2066('0x160')])){_0x47e46f[_0x2066('0x151')](_0x2066('0x206'),_0x2341ed,_0x559974[_0x552df8]);}else{hopperUtils[_0x2066('0x207')](_['pick'](_0x559974[_0x552df8],['CampaignId','phone']))[_0x2066('0x3d')](_0x47e46f['checkContactBlack'](_0x2341ed,_0x559974[_0x552df8]))[_0x2066('0xa2')](_0x47e46f[_0x2066('0x208')](_0x2066('0x209'),_0x2341ed));}}}}})[_0x2066('0xa2')](loggerGetContactDialer(_0x2066('0x20a'),_0x2341ed,_0x431ce9));}};Dialer[_0x2066('0x1e')][_0x2066('0xb3')]=function(_0x4b83ab,_0x1f0513){var _0xce2a7f=this;var _0xdbc292=[];if(_0x1f0513<0x1||_0x4b83ab[_0x2066('0xb1')]===_0x2066('0x9')){_0x1f0513=0x1;}var _0x3a4fe8=Math[_0x2066('0x1c5')](_0x4b83ab[_0x2066('0x137')]*_0x1f0513)-_0x4b83ab[_0x2066('0x83')];if(_0x4b83ab[_0x2066('0x20b')]>0x0){var _0xbf07c5=_0x4b83ab[_0x2066('0x20b')]-_0x4b83ab[_0x2066('0x83')]-_0x4b83ab['talking']-_0x4b83ab['pTalking'];if(_0x3a4fe8>_0xbf07c5){_0x3a4fe8=_0xbf07c5;}}if(_0x3a4fe8>0x0&&_0x4b83ab[_0x2066('0x68')]==0x0){if(_0x4b83ab[_0x2066('0xb1')]===_0x2066('0x9')){_0x3a4fe8=0x1;}if(_0x3a4fe8>this['maxNumberOriginate']){_0x3a4fe8=this[_0x2066('0x200')];}for(var _0x214d39 in this[_0x2066('0x24')]){if(typeof this[_0x2066('0x24')][_0x214d39]!=='undefined'){if(this[_0x2066('0x24')][_0x214d39][_0x2066('0xcd')]===_0x2066('0x20c')&&this[_0x2066('0x24')][_0x214d39][_0x2066('0x8c')]===_0x2066('0x8b')){_0xdbc292[_0x2066('0x9d')](this[_0x2066('0x24')][_0x214d39]['id']);}}}_0x4b83ab['temp']=0x1;hopperUtils[_0x2066('0x20d')](_0x4b83ab,_0xdbc292,_0x3a4fe8)[_0x2066('0x3d')](function(_0xc7c83b){_0x4b83ab[_0x2066('0x68')]=0x0;if(_0xc7c83b){if(!utils[_0x2066('0x202')](_0xc7c83b)){hopperUtils['countReScheduled'](_0x4b83ab)[_0x2066('0x3d')](sendMessageReschedule(_0x4b83ab))[_0x2066('0xa2')](loggerCatch(_0x2066('0x20e')));}else{_0x4b83ab[_0x2066('0x83')]+=_0xc7c83b[_0x2066('0x9c')];_0x4b83ab['message']=_0x4b83ab[_0x2066('0xb1')]===_0x2066('0x9')?utils['CAMPAIGN_STATUS'][_0x2066('0x13b')]:utils[_0x2066('0x6a')][_0x2066('0x203')];for(var _0x23fbfb=0x0;_0x23fbfb<_0xc7c83b['length'];_0x23fbfb+=0x1){if(_[_0x2066('0xf1')](_0xc7c83b[_0x23fbfb])||_['isNil'](_0xc7c83b[_0x23fbfb][_0x2066('0x205')])||_['isNil'](_0xc7c83b[_0x23fbfb]['phone'])){_0xce2a7f[_0x2066('0x151')](_0x2066('0x206'),_0x4b83ab,_0xc7c83b[_0x23fbfb]);}else{hopperUtils[_0x2066('0x20f')](_[_0x2066('0x77')](_0xc7c83b[_0x23fbfb],[_0x2066('0xdb'),_0x2066('0x160')]))['then'](_0xce2a7f[_0x2066('0x210')](_0x4b83ab,_0xc7c83b[_0x23fbfb]))['catch'](_0xce2a7f[_0x2066('0x208')](_0x2066('0x206'),_0x4b83ab));}}}}})[_0x2066('0xa2')](loggerGetContactDialer(_0x2066('0x211'),_0x4b83ab,_0x3a4fe8));}};Dialer[_0x2066('0x1e')][_0x2066('0x63')]=function(_0x5a2771){if(_0x5a2771[_0x2066('0x20b')]>0x0){var _0xf6ec1f=_0x5a2771[_0x2066('0x20b')]-_0x5a2771['originated']-_0x5a2771['talking'];if(_0xf6ec1f>0x0&&_0x5a2771[_0x2066('0x68')]==0x0){this[_0x2066('0x212')](_0x5a2771);}else{loggerPredictiveCalls[_0x2066('0x45')](_0x2066('0x213'));}}else{this[_0x2066('0x212')](_0x5a2771);}};Dialer[_0x2066('0x1e')][_0x2066('0x212')]=function(_0x4e8d90){var _0x1ab5d3=this;var _0x3b159b=[];_0x4e8d90[_0x2066('0x83')]+=0x1;for(var _0x3f6cda in this[_0x2066('0x24')]){if(typeof this[_0x2066('0x24')][_0x3f6cda]!=='undefined'){if(this[_0x2066('0x24')][_0x3f6cda][_0x2066('0xcd')]===_0x2066('0x20c')&&this[_0x2066('0x24')][_0x3f6cda][_0x2066('0x8c')]===_0x2066('0x8b')){_0x3b159b[_0x2066('0x9d')](this['agents'][_0x3f6cda]['id']);}}}_0x4e8d90[_0x2066('0x68')]=0x1;return this[_0x2066('0x20d')](_0x4e8d90['id'],_0x3b159b,0x1,_0x4e8d90[_0x2066('0x214')],_0x4e8d90)[_0x2066('0x3d')](function(_0x52ac93){_0x4e8d90[_0x2066('0x68')]=0x1;if(_0x52ac93){if(!utils[_0x2066('0x202')](_0x52ac93)){utils[_0x2066('0x67')](_0x4e8d90,0x1,0x0);return hopperUtils[_0x2066('0x215')](_0x4e8d90)[_0x2066('0x3d')](sendMessageReschedule(_0x4e8d90))[_0x2066('0xa2')](loggerCatch(_0x2066('0x20e')));}else{_0x4e8d90['message']=utils[_0x2066('0x6a')][_0x2066('0x203')];if(_[_0x2066('0xf1')](_0x52ac93[0x0])||_[_0x2066('0xf1')](_0x52ac93[0x0][_0x2066('0x205')])||_[_0x2066('0xf1')](_0x52ac93[0x0][_0x2066('0x160')])){_0x1ab5d3['emptyContact'](_0x2066('0x206'),_0x4e8d90,_0x52ac93[0x0]);}else{return hopperUtils[_0x2066('0x20f')](_[_0x2066('0x77')](_0x52ac93[0x0],[_0x2066('0xdb'),_0x2066('0x160')]))[_0x2066('0x3d')](_0x1ab5d3[_0x2066('0x210')](_0x4e8d90,_0x52ac93[0x0]))['catch'](_0x1ab5d3[_0x2066('0x208')](_0x2066('0x216'),_0x4e8d90));}}}})[_0x2066('0xa2')](loggerGetContactDialer(_0x2066('0x217'),_0x4e8d90,0x1));};Dialer[_0x2066('0x1e')]['abandonmentRate']=function(_0x132f1d,_0x11e0ec,_0xb44efe,_0x50fa3e,_0x44d4bf,_0x54a422){loggerPredictive[_0x2066('0x45')](_0x2066('0x218'));loggerPredictive[_0x2066('0x45')](_0x2066('0x219'),_0x132f1d);loggerPredictive[_0x2066('0x45')](_0x2066('0x21a'),_0x11e0ec);loggerPredictive[_0x2066('0x45')](_0x2066('0x21b'),_0xb44efe);loggerPredictive[_0x2066('0x45')](_0x2066('0x21c'),_0x50fa3e);loggerPredictive[_0x2066('0x45')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44d4bf);loggerPredictive[_0x2066('0x45')](_0x2066('0x50'));return new Promise(function(_0x141542,_0x187564){if(_0x132f1d<=0x0||isNaN(_0x132f1d)){return _0x187564(msgResponse(_0x2066('0x21d'),_0x2066('0x88'),_0x2066('0x21e')+_0x132f1d));}if(_0xb44efe<=0x0||isNaN(_0xb44efe)){return _0x187564(msgResponse(_0x2066('0x21d'),_0x2066('0x88'),_0x2066('0x21f')+_0xb44efe));}if(_0x50fa3e<=0x0||isNaN(_0x50fa3e)){return _0x187564(msgResponse(_0x2066('0x21d'),_0x2066('0x88'),_0x2066('0x220')+_0x50fa3e));}if(_0x11e0ec<=0x0||isNaN(_0x11e0ec)){return _0x187564(msgResponse(_0x2066('0x21d'),'Error',_0x2066('0x221')+_0x11e0ec));}if(_0x44d4bf<=0x0||isNaN(_0x44d4bf)){return _0x187564(msgResponse(_0x2066('0x21d'),'Error',_0x2066('0x222')+_0x44d4bf));}_0x54a422=_0x54a422||0x0;var _0x406073=0x1/_0xb44efe;var _0x359952=0x0;var _0x3d5597=0x0;var _0x37cba9=0x0;var _0x34bdf7=0x0;for(var _0x435d43=0x0;_0x37cba9<_0x44d4bf;_0x435d43+=0x1){_0x3d5597=_0x435d43/_0x11e0ec;_0x359952=(_0x50fa3e*_0x3d5597+_0x54a422)/_0x406073;_0x37cba9=utils[_0x2066('0x223')](_0x359952,_0x132f1d);_0x34bdf7=_0x359952/_0x132f1d*(0x1-utils[_0x2066('0x223')](_0x359952,_0x132f1d));}return _0x141542({'erlangCalls':_0x435d43,'erlangCallToSecond':_0x11e0ec/_0x435d43,'erlangAbandonmentRate':_0x37cba9,'erlangBusyFactor':_0x34bdf7});});};Dialer['prototype'][_0x2066('0x1e0')]=function(_0x21b432,_0xd25596,_0x5cd138,_0x363c5b,_0x17b16f,_0x4de48b){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x2066('0x45')]('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',_0x21b432);loggerPredictive['info'](_0x2066('0x21a'),_0xd25596);loggerPredictive[_0x2066('0x45')](_0x2066('0x21b'),_0x5cd138);loggerPredictive[_0x2066('0x45')](_0x2066('0x21c'),_0x363c5b);loggerPredictive[_0x2066('0x45')](_0x2066('0x224'),_0x17b16f);loggerPredictive[_0x2066('0x45')](_0x2066('0x50'));return new Promise(function(_0x4ef7d4,_0x406cfe){if(_0x21b432<=0x0||isNaN(_0x21b432)){return _0x406cfe(msgResponse(_0x2066('0x225'),_0x2066('0x88'),_0x2066('0x21e')+_0x21b432));}if(_0x5cd138<=0x0||isNaN(_0x5cd138)){return _0x406cfe(msgResponse(_0x2066('0x225'),'Error',_0x2066('0x21f')+_0x5cd138));}if(_0x363c5b<=0x0||isNaN(_0x363c5b)){return _0x406cfe(msgResponse(_0x2066('0x225'),_0x2066('0x88'),'p\x20=\x20'+_0x363c5b));}if(_0xd25596<=0x0||isNaN(_0xd25596)){return _0x406cfe(msgResponse(_0x2066('0x225'),'Error','interval\x20=\x20'+_0xd25596));}if(_0x17b16f<=0x0||isNaN(_0x17b16f)){return _0x406cfe(msgResponse(_0x2066('0x225'),_0x2066('0x88'),_0x2066('0x226')+_0x17b16f));}_0x4de48b=_0x4de48b||0x0;var _0x336fff=0x1/_0x5cd138;var _0xf40d1=0x0;var _0x465c58=0x0;var _0x52754c=0x0;var _0x3ea746=0x0;for(var _0x4271fc=0x0;_0x3ea746<_0x17b16f;_0x4271fc+=0x1){_0x465c58=_0x4271fc/_0xd25596;_0xf40d1=(_0x363c5b*_0x465c58+_0x4de48b)/_0x336fff;_0x52754c=utils[_0x2066('0x223')](_0xf40d1,_0x21b432);_0x3ea746=_0xf40d1/_0x21b432*(0x1-utils[_0x2066('0x223')](_0xf40d1,_0x21b432));}return _0x4ef7d4({'erlangCalls':_0x4271fc,'erlangCallToSecond':_0xd25596/_0x4271fc,'erlangAbandonmentRate':_0x52754c,'erlangBusyFactor':_0x3ea746});});};module[_0x2066('0x227')]=Dialer; \ No newline at end of file +var _0x2f49=['stringify','resetActiveCalls','syncCampaigns','undefined','resolve','dialTimezone','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Voice\x20Queue\x20%s\x20$s','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','type','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','Drop','TIMEOUT','agiafterat','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','ContactId','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','dropreason','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actions','actionid','strategy','rrmemory','roundrobin','isNil','locked','stateinterface','merge','idHopper','paused','syncQueueStatusComplete','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','AMD','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','[syncAgentComplete]','outboundUnknownCallsDay','Unknow','running','INACTIVE','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel][ivr]','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','launchHandleIvr','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','assign','Trunk','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsCallersExit','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getVoiceQueueRtPauses','[CatchErlangB]','loggedIn','predictiveIntervalDroppedCallsTimeout','outboundQueuePauses','busyFactor','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','RUNNING','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','getContactDialer','[actionOriginate]\x20','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','../ami','redis','defaults','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','---------------------------','getSeconds','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CONTACTS_RESCHEDULED','CAMPAIGN_STATUS','[getContactDialer2][Empty]','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','isIVRCampaignActive','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','isTrunkReachable','active','SIP/%s','status','prototype','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','ifTime','isArray','push','Action','command','format','iftime\x20%s,%s','interval','content','catch','indexOf','true','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0x2f49,0x16d));var _0x92f4=function(_0x456540,_0x56c437){_0x456540=_0x456540-0x0;var _0x1ab26c=_0x2f49[_0x456540];return _0x1ab26c;};'use strict';var util=require(_0x92f4('0x0'));var _=require(_0x92f4('0x1'));var uuid=require(_0x92f4('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x92f4('0x3'));var utils=require(_0x92f4('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x92f4('0x5'));var config=require(_0x92f4('0x6'));var logger=require(_0x92f4('0x7'))(_0x92f4('0x8'));var loggerBooked=require('../../../config/logger')(_0x92f4('0x9'));var loggerPredictive=require(_0x92f4('0x7'))(_0x92f4('0xa'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x92f4('0x7'))('syncQueueSummary');var ami=require(_0x92f4('0xb'));config[_0x92f4('0xc')]=_[_0x92f4('0xd')](config[_0x92f4('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x92f4('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x92f4('0xe'));var RpcSetting=require(_0x92f4('0xf'));var Interval=require(_0x92f4('0x10'));var Action=require('./models/action');var History=require(_0x92f4('0x11'));var Final=require(_0x92f4('0x12'));var AgentComplete=require(_0x92f4('0x13'));var QueueCallerAbandon=require(_0x92f4('0x14'));var Hangup=require(_0x92f4('0x15'));var ipAgi=process[_0x92f4('0x16')][_0x92f4('0x17')]||_0x92f4('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x92f4('0x19')]=function(_0x34b3f5){this[_0x92f4('0x1a')]=this[_0x92f4('0x1a')]?this[_0x92f4('0x1a')][_0x92f4('0x1b')](_0x34b3f5):_0x34b3f5();};function Dialer(_0x1dcce4,_0x321347){this[_0x92f4('0x1c')]=new Sequence();this['preview']=_0x321347;this['voiceQueues']=_0x1dcce4[_0x92f4('0x1d')];this[_0x92f4('0x1e')]=_0x1dcce4[_0x92f4('0x1e')];this[_0x92f4('0x1f')]=_0x1dcce4['agents'];this[_0x92f4('0x20')]=_0x1dcce4[_0x92f4('0x20')];this[_0x92f4('0x21')]=config[_0x92f4('0x21')]||0x2;this[_0x92f4('0x22')]={};this['actions']={};this['contactsId']={};this[_0x92f4('0x23')]={};this[_0x92f4('0x24')]={};this[_0x92f4('0x25')]={};this['startProgressive']={};this[_0x92f4('0x26')]={};this[_0x92f4('0x27')]={};this[_0x92f4('0x28')]={};this[_0x92f4('0x29')]={};ami['on'](_0x92f4('0x2a'),this[_0x92f4('0x2b')]['bind'](this));ami['on'](_0x92f4('0x2c'),this[_0x92f4('0x2d')]['bind'](this));ami['on'](_0x92f4('0x2e'),this[_0x92f4('0x2f')][_0x92f4('0x30')](this));ami['on'](_0x92f4('0x31'),this[_0x92f4('0x32')][_0x92f4('0x30')](this));ami['on']('custom:queuesummary',this[_0x92f4('0x33')]['bind'](this));ami['on'](_0x92f4('0x34'),this[_0x92f4('0x35')][_0x92f4('0x30')](this));ami['on']('hangup',this[_0x92f4('0x36')][_0x92f4('0x30')](this));ami['on']('newexten',this[_0x92f4('0x37')][_0x92f4('0x30')](this));ami['on'](_0x92f4('0x38'),this[_0x92f4('0x39')][_0x92f4('0x30')](this));ami['on']('queuemember',this[_0x92f4('0x3a')][_0x92f4('0x30')](this));ami['on'](_0x92f4('0x3b'),this['syncQueueStatusComplete'][_0x92f4('0x30')](this));this[_0x92f4('0x3c')]();this[_0x92f4('0x3d')]();RpcSetting['getSettings']()[_0x92f4('0x3e')](function(_0x4aaf04){previewRecallmeReminderInterval=_0x4aaf04[_0x92f4('0x3f')];});}function isNotNull(_0x3405ea){return _0x3405ea!==null&&!_[_0x92f4('0x40')](_0x3405ea);}function msgResponse(_0x10aff0,_0xf522a5,_0x505b6f){return{'action':_0x10aff0,'response':_0xf522a5,'message':_0x505b6f,'stack':_0x505b6f};}function emit(_0x1a4e5c,_0x26fbf6,_0x49b86b){io['to'](_0x1a4e5c)['emit'](_0x26fbf6,_0x49b86b);}function emitOutboundVoiceQueueSummary(_0x2025d2){if(_0x2025d2['type']==='outbound'){logger[_0x92f4('0x41')](_0x92f4('0x42'),util[_0x92f4('0x43')](_0x2025d2,{'showHidden':![],'depth':null}));emit(util['format'](_0x92f4('0x44'),_0x2025d2[_0x92f4('0x45')]),_0x92f4('0x46'),_0x2025d2);}}function checkGetDataPredictive(_0x1ae3b8){if(isNotNull(_0x1ae3b8)&&!_['isEmpty'](_0x1ae3b8)){loggerPredictive[_0x92f4('0x47')](_0x92f4('0x48'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ae3b8[_0x92f4('0x49')]);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x4a'),_0x1ae3b8[_0x92f4('0x4b')]);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x4c'),_0x1ae3b8['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x4d'),_0x1ae3b8['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x4e'),_0x1ae3b8[_0x92f4('0x4f')]);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x50'),_0x1ae3b8['predictiveIntervalAvgTalktime']);loggerPredictive[_0x92f4('0x47')]('---------------------------');if(_0x1ae3b8[_0x92f4('0x49')]>0x0){if(!_[_0x92f4('0x40')](_0x1ae3b8[_0x92f4('0x51')])&&_0x1ae3b8[_0x92f4('0x51')]>0x0){return!![];}loggerPredictive[_0x92f4('0x47')](_0x92f4('0x52'));if(!_['isUndefined'](_0x1ae3b8[_0x92f4('0x4f')])&&_0x1ae3b8[_0x92f4('0x4f')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x92f4('0x47')](_0x92f4('0x53'));}}else{loggerPredictive[_0x92f4('0x47')](_0x92f4('0x54'));}return![];}function mergeDataErlangB(_0x3fa781){return function(_0x205010){loggerPredictive[_0x92f4('0x47')](_0x92f4('0x55'));loggerPredictive['info'](_0x92f4('0x56'),_0x205010[_0x92f4('0x57')]);loggerPredictive[_0x92f4('0x47')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x205010[_0x92f4('0x58')]);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x59'),_0x205010[_0x92f4('0x5a')]);loggerPredictive['info'](_0x92f4('0x5b'),_0x205010[_0x92f4('0x5c')]);loggerPredictive[_0x92f4('0x47')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x205010[_0x92f4('0x5a')]);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x5d'));_['merge'](_0x3fa781,_0x205010);};}function ifInterval(_0x23458b,_0x261050){if(_['isUndefined'](_0x261050)){return![];}return utils[_0x92f4('0x5e')](undefined,_0x261050)<_0x23458b*0x3c;}function clearPredictiveAttributes(_0x4897b7){if(_0x4897b7[_0x92f4('0x5f')]){_0x4897b7[_0x92f4('0x5f')]=undefined;loggerPredictive['debug'](_0x4897b7[_0x92f4('0x45')],_0x92f4('0x60'));}if(_0x4897b7['startPredictive']){_0x4897b7['startPredictive']=undefined;loggerPredictive[_0x92f4('0x41')](_0x4897b7[_0x92f4('0x45')],_0x92f4('0x61'));}if(_0x4897b7[_0x92f4('0x62')]){clearInterval(_0x4897b7[_0x92f4('0x62')]);_0x4897b7[_0x92f4('0x62')]=undefined;loggerPredictive['debug'](_0x4897b7[_0x92f4('0x45')],_0x92f4('0x63'));}}function loggerCatchPredictive(_0x578d82,_0x3ef12b){return function(_0x9ae415){loggerPredictive[_0x92f4('0x64')](_0x3ef12b[_0x92f4('0x45')],_0x578d82);loggerPredictive['error'](_0x9ae415[_0x92f4('0x65')]);clearPredictiveAttributes(_0x3ef12b);};}function loggerCatch(_0x2e9c5a){return function(_0x38f431){logger[_0x92f4('0x64')](_0x2e9c5a,util[_0x92f4('0x43')](_0x38f431,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4f6300,_0x56beca,_0x542ce1){return function(_0x255201){utils[_0x92f4('0x66')](_0x56beca,_0x542ce1,0x0);_0x56beca[_0x92f4('0x67')]=0x0;logger['error'](_0x4f6300,util['inspect'](_0x255201,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x223884){return function(_0x2853b1){if(isNotNull(_0x2853b1)&&isNotNull(_0x2853b1[0x0])){if(_0x2853b1[0x0][_0x92f4('0x68')]>0x0){_0x223884[_0x92f4('0x69')]=utils['CAMPAIGN_STATUS'][_0x92f4('0x6a')];logger[_0x92f4('0x47')]('[getContactDialer2][ReScheduled]'+_0x223884[_0x92f4('0x45')],_0x2853b1[0x0][_0x92f4('0x68')],'contacts');}else{_0x223884[_0x92f4('0x69')]=utils[_0x92f4('0x6b')]['NO_AVAILABLE_CONTACTS'];logger[_0x92f4('0x47')](_0x92f4('0x6c')+_0x223884[_0x92f4('0x45')]);}}};}function createObjHistory(_0x3ce30d,_0x88f77,_0x4438f1,_0x4109c5,_0x119db2){_0x3ce30d[_0x92f4('0x69')]=_0x4438f1;var _0x3649e6=new Action(_0x3ce30d,_0x88f77);var _0x167cae=new History(_0x3649e6);_0x167cae['state']=_0x4109c5;_0x167cae[_0x92f4('0x6d')]=_0x119db2;_0x167cae[_0x92f4('0x6e')]=_0x3649e6[_0x92f4('0x6f')];return _0x167cae;}function unlockQueueStatus(_0x4a8fd5,_0x5851fc){setTimeout(function(){if(_[_0x92f4('0x40')](_0x4a8fd5['queueStatusComplete'])){loggerBooked[_0x92f4('0x64')](_0x92f4('0x70'),_0x5851fc);}_0x4a8fd5[_0x92f4('0x71')]=!![];loggerBooked[_0x92f4('0x47')](_0x92f4('0x72'),_0x5851fc,JSON['stringify'](_[_0x92f4('0x73')](_0x4a8fd5,[_0x92f4('0x45'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0xb0e663){return function(){if(!isNotNull(_0xb0e663['Interval'])){_0xb0e663[_0x92f4('0x69')]=utils[_0x92f4('0x6b')][_0x92f4('0x74')];throw _0xb0e663[_0x92f4('0x45')]+_0x92f4('0x75');}if(!isNotNull(_0xb0e663[_0x92f4('0x76')][_0x92f4('0x77')])){_0xb0e663[_0x92f4('0x69')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0xb0e663[_0x92f4('0x45')]+_0x92f4('0x75');}if(!isNotNull(_[_0x92f4('0x78')](_0xb0e663[_0x92f4('0x76')]['Intervals']))){_0xb0e663[_0x92f4('0x69')]=utils[_0x92f4('0x6b')]['NULL_INTERVAL'];throw _0xb0e663['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x34d3c8){return function(){if(!utils[_0x92f4('0x79')](_0x34d3c8)){_0x34d3c8['message']=utils['CAMPAIGN_STATUS']['INACTIVE'];throw _0x34d3c8[_0x92f4('0x45')]+_0x92f4('0x7a');}};}function emitCampaignSummary(_0x471761){if(utils[_0x92f4('0x7b')](_0x471761)){emit(util['format'](_0x92f4('0x7c'),_0x471761[_0x92f4('0x45')]),_0x92f4('0x7d'),_0x471761);}}function loggerCatchQueueSummary(_0x575681,_0x40b1c2){return function(_0x473c6c){clearPredictiveAttributes(_0x40b1c2);emitCampaignSummary(_0x40b1c2);loggerSyncQueueSummary[_0x92f4('0x41')](_0x575681,util[_0x92f4('0x43')](_0x473c6c,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5687c6){if(_0x5687c6[_0x92f4('0x7e')]){if(_0x5687c6[_0x92f4('0x7f')]===0x0){_0x5687c6['sendMessageOneNotActive']=![];_0x5687c6[_0x92f4('0x69')]=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0x92f4('0x41')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5687c6['name'],_0x92f4('0x80'));}else{_0x5687c6[_0x92f4('0x69')]=utils[_0x92f4('0x6b')][_0x92f4('0x81')];loggerSyncQueueSummary[_0x92f4('0x41')](_0x92f4('0x82'),_0x5687c6[_0x92f4('0x45')],'is\x20disactive');}emitCampaignSummary(_0x5687c6);}}function myreject(_0x4ce74e){return function(_0x4f36d8){return _0x4ce74e(msgResponse(_0x92f4('0x83'),'Error',JSON['stringify'](_0x4f36d8)));};}Dialer['prototype'][_0x92f4('0x84')]=function(_0x1343be){return!_[_0x92f4('0x40')](_0x1343be)&&_0x1343be&&!_[_0x92f4('0x40')](_0x1343be[_0x92f4('0x45')])&&!_[_0x92f4('0x40')](_0x1343be[_0x92f4('0x85')])&&_0x1343be[_0x92f4('0x85')]&&(this[_0x92f4('0x20')][util['format'](_0x92f4('0x86'),_0x1343be[_0x92f4('0x45')])]['status']==='reachable'||this[_0x92f4('0x20')][util['format'](_0x92f4('0x86'),_0x1343be[_0x92f4('0x45')])][_0x92f4('0x87')]==='unmonitored');};Dialer[_0x92f4('0x88')][_0x92f4('0x89')]=function(_0x4a764e){var _0x3f653f=this;return function(){if(!_0x3f653f['isTrunkReachable'](_0x4a764e['Trunk'])){if(!_0x3f653f[_0x92f4('0x84')](_0x4a764e[_0x92f4('0x8a')])){_0x4a764e[_0x92f4('0x69')]=utils[_0x92f4('0x6b')][_0x92f4('0x8b')];throw _0x4a764e[_0x92f4('0x45')]+_0x92f4('0x8c');}}};};Dialer[_0x92f4('0x88')][_0x92f4('0x8d')]=function(_0x28644d,_0x4e577a,_0x40a26c,_0x52f464){var _0x6ef884=this;return function(){var _0x13f808=!![];return _0x6ef884[_0x92f4('0x8e')](_0x28644d,_0x4e577a,_0x40a26c,_0x52f464,_0x13f808);};};Dialer[_0x92f4('0x88')][_0x92f4('0x8f')]=function(_0x1972bd,_0x8d1dd7,_0x41f250,_0x250893){var _0x135196=this;return function(){var _0x4791f5=![];return _0x135196[_0x92f4('0x8e')](_0x1972bd[_0x92f4('0x77')],_0x8d1dd7,_0x41f250,_0x250893,_0x4791f5);};};Dialer['prototype'][_0x92f4('0x8e')]=function(_0x1c519f,_0x1d141e,_0x2cb1d9,_0x5b987f,_0x443dd2){var _0x46d4f2=[];return new Promise(function(_0x5d11cb,_0x1d0cb2){if(!isNotNull(_0x1c519f)){_0x5b987f[_0x92f4('0x69')]=utils[_0x92f4('0x6b')][_0x92f4('0x74')];return _0x1d0cb2(msgResponse('ifTime','Failure',_0x2cb1d9+_0x92f4('0x90')));}if(_[_0x92f4('0x78')](_0x1c519f)){_0x5b987f['message']=utils[_0x92f4('0x6b')]['EMPTY_INTERVAL'];return _0x1d0cb2(msgResponse('ifTime',_0x92f4('0x91'),_0x2cb1d9+_0x92f4('0x92')));}if(_0x1d141e&&_['isUndefined'](config[_0x92f4('0x93')][_0x1d141e])){_0x5b987f['message']=utils[_0x92f4('0x6b')][_0x92f4('0x94')];return _0x1d0cb2(msgResponse(_0x92f4('0x95'),_0x92f4('0x91'),_0x2cb1d9+'\x20Timezone\x20unknow\x20'+_0x1d141e));}if(_[_0x92f4('0x96')](_0x1c519f)){for(var _0x5321ca=0x0;_0x5321ca<_0x1c519f['length'];_0x5321ca+=0x1){_0x46d4f2[_0x92f4('0x97')](ami[_0x92f4('0x98')]({'action':_0x92f4('0x99'),'command':util[_0x92f4('0x9a')](_0x92f4('0x9b'),_0x1c519f[_0x5321ca][_0x92f4('0x9c')],!_[_0x92f4('0x40')](config[_0x92f4('0x93')][_0x1d141e])?_0x1d141e:'')})[_0x92f4('0x3e')](function(_0x236bdb){return _0x236bdb[_0x92f4('0x9d')]['indexOf']('true')>=0x0;})[_0x92f4('0x9e')](myreject(_0x1d0cb2)));}}else{_0x46d4f2[_0x92f4('0x97')](ami[_0x92f4('0x98')]({'action':'command','command':util[_0x92f4('0x9a')](_0x92f4('0x9b'),_0x1c519f,!_[_0x92f4('0x40')](config[_0x92f4('0x93')][_0x1d141e])?_0x1d141e:'')})['then'](function(_0x5a54b4){return _0x5a54b4[_0x92f4('0x9d')][_0x92f4('0x9f')](_0x92f4('0xa0'))>=0x0;})[_0x92f4('0x9e')](myreject(_0x1d0cb2)));}Promise[_0x92f4('0xa1')](_0x46d4f2)[_0x92f4('0x3e')](function(_0x49e21e){var _0x30dec7=_[_0x92f4('0xa2')](_0x49e21e);if(_0x30dec7){return _0x5d11cb(_0x30dec7);}else{_0x5b987f['message']=_0x443dd2?utils[_0x92f4('0x6b')][_0x92f4('0xa3')]:utils[_0x92f4('0x6b')][_0x92f4('0xa4')];return _0x1d0cb2(msgResponse(_0x92f4('0xa5'),_0x92f4('0x91'),_0x92f4('0xa6')+_0x443dd2+'\x20'+_0x2cb1d9+_0x92f4('0xa7')+util['inspect'](_0x1c519f,{'showHidden':![],'depth':null})+_0x92f4('0xa8')+_0x1d141e));}})[_0x92f4('0x9e')](function(_0x54ab59){return _0x1d0cb2(msgResponse(_0x92f4('0x95'),_0x92f4('0x91'),JSON[_0x92f4('0xa9')](_0x54ab59)));});});};Dialer[_0x92f4('0x88')][_0x92f4('0x3c')]=function(){var _0x177801=this;return cmHopper[_0x92f4('0xaa')]({'active':![]},{'where':{'active':!![]}})[_0x92f4('0x3e')](function(){setInterval(function(){_0x177801[_0x92f4('0xab')]();},0x3e8);});};Dialer[_0x92f4('0x88')][_0x92f4('0xab')]=function(){var _0x194e9c=this;var _0x257181;for(var _0x5c19ae in this['campaigns']){if(typeof this[_0x92f4('0x1e')][_0x5c19ae]!==_0x92f4('0xac')){_0x257181=this[_0x92f4('0x1e')][_0x5c19ae];if(utils['isIVRCampaign'](_0x257181)&&utils['isIVRCampaignActive'](_0x257181)){_0x257181[_0x92f4('0x7e')]=!![];Promise[_0x92f4('0xad')]()[_0x92f4('0x3e')](checkIsIVRCampaignActive(_0x257181))[_0x92f4('0x3e')](checkInterval(_0x257181))[_0x92f4('0x3e')](_0x194e9c[_0x92f4('0x89')](_0x257181))[_0x92f4('0x3e')](_0x194e9c[_0x92f4('0x8d')](_0x257181['dialGlobalInterval'],_0x257181[_0x92f4('0xae')],_0x257181[_0x92f4('0x45')],_0x257181))[_0x92f4('0x3e')](_0x194e9c['checkIfTimeIntervals'](_0x257181[_0x92f4('0x76')],_0x257181['dialTimezone'],_0x257181[_0x92f4('0x45')],_0x257181))['then'](_0x194e9c['launchHandleIvr'](_0x257181))[_0x92f4('0x9e')](loggerCatchQueueSummary('[syncCampaigns]',_0x257181));}else{notSendMessagesCampaign(_0x257181);}}}};Dialer['prototype'][_0x92f4('0xaf')]=function(_0x5d11ce){if(_0x5d11ce[_0x92f4('0xb0')]!==_0x92f4('0xa')){clearPredictiveAttributes(_0x5d11ce);}switch(_0x5d11ce[_0x92f4('0xb0')]){case _0x92f4('0xb1'):this[_0x92f4('0xb2')](_0x5d11ce,0x1);break;case _0x92f4('0xb3'):this[_0x92f4('0xb2')](_0x5d11ce,_0x5d11ce[_0x92f4('0xb4')]);break;case _0x92f4('0xa'):this[_0x92f4('0xa')](_0x5d11ce);break;case'booked':this[_0x92f4('0xb2')](_0x5d11ce,0x1);break;default:logger[_0x92f4('0x64')](_0x92f4('0xb5'),_0x5d11ce[_0x92f4('0x45')],_0x92f4('0xb6'));}};Dialer[_0x92f4('0x88')][_0x92f4('0x95')]=function(_0x3a977f,_0x2dd3a1){var _0x55f643=_0x3a977f[_0x92f4('0xae')];var _0x2311aa=_0x2dd3a1?_0x3a977f[_0x92f4('0xb7')]:_0x3a977f[_0x92f4('0x76')][_0x92f4('0x77')];logger[_0x92f4('0xb8')]('Dialer::ifTime()',_0x2311aa,_0x55f643,_0x3a977f[_0x92f4('0x45')],util['format'](_0x92f4('0xb9'),_0x3a977f[_0x92f4('0x45')],_0x3a977f['id']));var _0x4a9697=null;return Interval['intervalIftime'](_0x2311aa,_0x55f643)[_0x92f4('0x3e')](function(_0x1e6377){if(_0x1e6377===!![]){return _0x1e6377;}else{_0x3a977f[_0x92f4('0x69')]=_0x2dd3a1?utils[_0x92f4('0x6b')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x92f4('0xa4')];_0x4a9697=msgResponse(_0x92f4('0xa5'),'Failure',_0x92f4('0xa6')+_0x2dd3a1+'\x20'+_0x3a977f['name']+_0x92f4('0xa7')+util[_0x92f4('0x43')](_0x2311aa,{'showHidden':![],'depth':null})+_0x92f4('0xa8')+_0x55f643);}if(_0x4a9697!==null){logger[_0x92f4('0xb8')](_0x92f4('0xba'),_0x4a9697);_0x4a9697[_0x92f4('0xbb')]=_0x2dd3a1;throw _0x4a9697;}})['catch'](function(_0x3a650f){logger[_0x92f4('0x64')]('AMI\x20IfTime',_0x3a650f);throw msgResponse(_0x92f4('0x83'),'Error',util[_0x92f4('0x43')](_0x3a650f,{'showHidden':![],'depth':null}));});};Dialer['prototype']['syncAgentConnect']=function(_0x101a59){if(this['voiceQueues'][_0x101a59[_0x92f4('0xbc')]]){if(this[_0x92f4('0x23')][_0x101a59[_0x92f4('0xbd')]]&&this[_0x92f4('0x23')][_0x101a59[_0x92f4('0xbd')]][_0x92f4('0xbe')]!==_0x92f4('0xbf')){this[_0x92f4('0xc0')](this[_0x92f4('0x1d')][_0x101a59['queue']]);this[_0x92f4('0x23')][_0x101a59[_0x92f4('0xbd')]]['answertime']=moment()[_0x92f4('0x9a')](_0x92f4('0xc1'));}}};Dialer['prototype']['syncAgentComplete']=function(_0x103dba){var _0x534faa=this[_0x92f4('0x23')][_0x103dba['uniqueid']];if(this[_0x92f4('0x1d')][_0x103dba[_0x92f4('0xbc')]]){if(_0x534faa&&_0x534faa[_0x92f4('0xbe')]!==_0x92f4('0xbf')){delete this[_0x92f4('0x23')][_0x103dba['uniqueid']];this['voiceQueues'][_0x103dba[_0x92f4('0xbc')]][_0x92f4('0xc2')]+=0x1;var _0x33c12e=new AgentComplete(_0x534faa,_0x103dba);if(_0x103dba[_0x92f4('0xc3')]===_0x92f4('0xc4')){_0x33c12e['agiafterat']=this[_0x92f4('0x1d')][_0x103dba[_0x92f4('0xbc')]][_0x92f4('0xc5')]&&this[_0x92f4('0x1d')][_0x103dba[_0x92f4('0xbc')]]['dialAgiAfterHangupAgent']?moment()[_0x92f4('0x9a')](_0x92f4('0xc1')):undefined;}hopperUtils[_0x92f4('0xc6')](_0x33c12e)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0xc7')));hopperUtils[_0x92f4('0xc8')](_0x33c12e)[_0x92f4('0x9e')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x92f4('0x88')][_0x92f4('0x2d')]=function(_0x5373a7){var _0x27bca7=this[_0x92f4('0x23')][_0x5373a7[_0x92f4('0xbd')]];var _0x5741d9=this;var _0x2d9ae8=![];var _0xb770e;var _0x5f55cc;if(this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]]){if(_0x27bca7&&_0x27bca7[_0x92f4('0xbe')]!==_0x92f4('0xbf')){delete this['uniqueId'][_0x5373a7['uniqueid']];this[_0x92f4('0xc0')](this[_0x92f4('0x1d')][_0x5373a7['queue']]);_0x27bca7[_0x92f4('0xc9')]=moment()[_0x92f4('0x9a')](_0x92f4('0xc1'));var _0xa9009d=new QueueCallerAbandon(_0x27bca7,_0x5373a7);if(utils[_0x92f4('0x5e')](_0x27bca7['droptime'],_0x27bca7[_0x92f4('0xca')])>=_0x27bca7[_0x92f4('0xcb')]){this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x92f4('0x1d')][_0x5373a7['queue']][_0x92f4('0xcc')]+=0x1;this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]][_0x92f4('0xcd')]+=0x1;_0xa9009d[_0x92f4('0xce')]=0xa;_0xa9009d[_0x92f4('0x6d')]=_0x92f4('0xcf');_0xa9009d['dropreason']=_0x92f4('0xd0');_0xa9009d[_0x92f4('0xd1')]=this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]][_0x92f4('0xc5')]?moment()[_0x92f4('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xa9009d['countdropretry']+=0x1;_0xa9009d[_0x92f4('0xd2')]+=0x1;_0xb770e=this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]]['dialDropRetryFrequency'];_0x5f55cc=this['voiceQueues'][_0x5373a7[_0x92f4('0xbc')]][_0x92f4('0xd3')];hopperUtils[_0x92f4('0xd4')](_0xa9009d,_0xa9009d[_0x92f4('0xce')],_0x27bca7['voiceQueue'])[_0x92f4('0x3e')](function(_0x52be13){_0x2d9ae8=_0x52be13[_0x92f4('0xd5')]==0x1;if(_0xa9009d[_0x92f4('0xd6')]>=_0x5741d9[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]][_0x92f4('0xd7')]){_0x5741d9[_0x92f4('0xd8')](_0xa9009d,_0x52be13[_0x92f4('0xd5')]);}else{hopperUtils[_0x92f4('0xd9')]({'active':![],'countdropretry':_0xa9009d[_0x92f4('0xd6')],'scheduledat':moment()[_0x92f4('0xda')](_0x5741d9['voiceQueues'][_0x5373a7[_0x92f4('0xbc')]]['dialDropRetryFrequency'],'minutes')[_0x92f4('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x27bca7[_0x92f4('0xdb')],'ListId':_0x27bca7['ListId'],'VoiceQueueId':_0x27bca7['VoiceQueueId']||undefined,'CampaignId':_0x27bca7['CampaignId']||undefined})[_0x92f4('0x9e')](loggerCatch('[rescheduleContact][Drop]'));var _0x3ff129=new History(_0xa9009d);_0x3ff129['state']=0xa;_0x3ff129[_0x92f4('0x6d')]=_0x92f4('0xcf');_0x3ff129[_0x92f4('0x6f')]=moment()['format'](_0x92f4('0xc1'));_0x3ff129['endtime']=_0x3ff129[_0x92f4('0x6f')];_0x3ff129['calleridname']=_0xa9009d[_0x92f4('0xdc')];_0x3ff129[_0x92f4('0xdd')]=_0xa9009d[_0x92f4('0xdd')];hopperUtils[_0x92f4('0xc6')](_0x3ff129)[_0x92f4('0x9e')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(){if(_0x2d9ae8)hopperUtils[_0x92f4('0xde')](_0xa9009d,_0xb770e,_0x5f55cc)[_0x92f4('0x3e')](function(){return 0x1;});});}else{this['voiceQueues'][_0x5373a7[_0x92f4('0xbc')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]][_0x92f4('0xdf')]+=0x1;_0xa9009d['state']=0xb;_0xa9009d[_0x92f4('0x6d')]=_0x92f4('0xe0');_0xa9009d[_0x92f4('0xe1')]='CALLEREXIT';_0xa9009d['countabandonedretry']+=0x1;_0xa9009d[_0x92f4('0xd2')]+=0x1;_0xb770e=this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]]['dialAbandonedRetryFrequency'];_0x5f55cc=this[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x92f4('0xd4')](_0xa9009d,_0xa9009d[_0x92f4('0xce')],_0x27bca7['voiceQueue'])[_0x92f4('0x3e')](function(_0x1f1ff4){if(_0xa9009d[_0x92f4('0xe2')]>=_0x5741d9[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]][_0x92f4('0xe3')]){_0x5741d9[_0x92f4('0xd8')](_0xa9009d,_0x1f1ff4[_0x92f4('0xd5')]);}else{hopperUtils[_0x92f4('0xd9')]({'active':![],'countabandonedretry':_0xa9009d['countabandonedretry'],'scheduledat':moment()[_0x92f4('0xda')](_0x5741d9[_0x92f4('0x1d')][_0x5373a7[_0x92f4('0xbc')]][_0x92f4('0xe4')],_0x92f4('0xe5'))[_0x92f4('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x27bca7[_0x92f4('0xdb')],'ListId':_0x27bca7[_0x92f4('0xe6')],'VoiceQueueId':_0x27bca7[_0x92f4('0xe7')]||undefined,'CampaignId':_0x27bca7[_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0xe9')));var _0xe0432b=new History(_0xa9009d);_0xe0432b[_0x92f4('0xce')]=0xb;_0xe0432b[_0x92f4('0x6d')]=_0x92f4('0xe0');_0xe0432b[_0x92f4('0x6f')]=moment()['format'](_0x92f4('0xc1'));_0xe0432b[_0x92f4('0x6e')]=_0xe0432b[_0x92f4('0x6f')];_0xe0432b[_0x92f4('0xdc')]=_0xa9009d[_0x92f4('0xdc')];_0xe0432b['calleridnum']=_0xa9009d[_0x92f4('0xdd')];hopperUtils[_0x92f4('0xc6')](_0xe0432b)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0xea')));}})['then'](function(){if(_0x2d9ae8)hopperUtils[_0x92f4('0xde')](_0xa9009d,_0xb770e,_0x5f55cc)[_0x92f4('0x3e')](function(){return 0x1;});});}}}};Dialer[_0x92f4('0x88')][_0x92f4('0x37')]=function(_0x2ba6c5){if(this['actions'][_0x2ba6c5[_0x92f4('0xbd')]]){this['actions'][_0x2ba6c5[_0x92f4('0xbd')]][_0x92f4('0xeb')]=_0x2ba6c5['channel'];}if(this[_0x92f4('0x23')][_0x2ba6c5[_0x92f4('0xbd')]]){this[_0x92f4('0x23')][_0x2ba6c5[_0x92f4('0xbd')]][_0x92f4('0xeb')]=_0x2ba6c5['channel'];}};Dialer[_0x92f4('0x88')][_0x92f4('0x3a')]=function(_0x31c9ba){if(!this[_0x92f4('0xec')][_0x31c9ba[_0x92f4('0xed')]]){return;}var _0x4fc771=this[_0x92f4('0x1d')][this[_0x92f4('0xec')][_0x31c9ba['actionid']][_0x92f4('0xbc')]][_0x92f4('0xee')]||_0x92f4('0xef');if(_0x4fc771===_0x92f4('0xf0')){if(this['actions'][_0x31c9ba[_0x92f4('0xed')]]&&_[_0x92f4('0xf1')](this['actions'][_0x31c9ba['actionid']][_0x92f4('0xf2')])&&_0x31c9ba[_0x92f4('0x87')]==='1'&&_0x31c9ba['paused']==='0'){if(this[_0x92f4('0x1f')][_0x31c9ba['stateinterface']]){if(!this['agents'][_0x31c9ba[_0x92f4('0xf3')]][_0x92f4('0xf2')]){this[_0x92f4('0x1f')][_0x31c9ba[_0x92f4('0xf3')]][_0x92f4('0xf2')]=!![];this[_0x92f4('0xec')][_0x31c9ba[_0x92f4('0xed')]][_0x92f4('0xf2')]=!![];this['actions'][_0x31c9ba['actionid']][_0x92f4('0xf3')]=_0x31c9ba['stateinterface'];}}}}else if(_0x4fc771==='rrmemory'){if(this[_0x92f4('0xec')][_0x31c9ba['actionid']]){if(this['agents'][_0x31c9ba[_0x92f4('0xf3')]]){this[_0x92f4('0xec')][_0x31c9ba[_0x92f4('0xed')]][_0x92f4('0xf3')]=_0x31c9ba[_0x92f4('0xf3')];if(_[_0x92f4('0xf1')](this[_0x92f4('0x27')][this[_0x92f4('0xec')][_0x31c9ba['actionid']]['queue']])){this[_0x92f4('0x27')][this['actions'][_0x31c9ba[_0x92f4('0xed')]][_0x92f4('0xbc')]]=[];}this[_0x92f4('0x27')][this[_0x92f4('0xec')][_0x31c9ba[_0x92f4('0xed')]][_0x92f4('0xbc')]][_0x92f4('0x97')](_[_0x92f4('0xf4')](_[_0x92f4('0x73')](this[_0x92f4('0xec')][_0x31c9ba['actionid']],[_0x92f4('0xf5'),_0x92f4('0xf3')]),{'status':_0x31c9ba[_0x92f4('0x87')],'paused':_0x31c9ba[_0x92f4('0xf6')]}));}}}};Dialer[_0x92f4('0x88')][_0x92f4('0xf7')]=function(_0x142b6b){if(!this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]]){return;}var _0x2f5b5e=this;var _0x434872=this[_0x92f4('0x1d')][this[_0x92f4('0xec')][_0x142b6b['actionid']][_0x92f4('0xbc')]];var _0x403bb7=_0x434872[_0x92f4('0xee')]||_0x92f4('0xef');if(_0x403bb7===_0x92f4('0xf0')){if(this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]]&&this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xf3')]){this[_0x92f4('0xf8')][_0x92f4('0xf9')](this[_0x92f4('0xec')][_0x142b6b['actionid']][_0x92f4('0xf5')],this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xf3')])[_0x92f4('0x9e')](function(_0x5988f9){logger[_0x92f4('0x64')](_0x92f4('0xfa'),util[_0x92f4('0x43')](_0x5988f9,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2f5b5e['updateOriginated'](_0x2f5b5e['voiceQueues'][_0x2f5b5e[_0x92f4('0xec')][_0x142b6b['actionid']][_0x92f4('0xbc')]]);_0x2f5b5e[_0x92f4('0x1f')][_0x2f5b5e[_0x92f4('0xec')][_0x142b6b['actionid']][_0x92f4('0xf3')]]['locked']=![];delete _0x2f5b5e[_0x92f4('0xec')][_0x142b6b['actionid']];unlockQueueStatus(_0x434872);});}else{this[_0x92f4('0xc0')](this[_0x92f4('0x1d')][this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xbc')]]);hopperUtils[_0x92f4('0xd9')]({'active':![],'ContactId':this['actions'][_0x142b6b['actionid']][_0x92f4('0xdb')],'ListId':this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xe6')],'VoiceQueueId':this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xe7')]||undefined,'CampaignId':this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0xfb')));delete this['actions'][_0x142b6b[_0x92f4('0xed')]];unlockQueueStatus(_0x434872);}}else if(_0x403bb7===_0x92f4('0xef')){var _0x59ee13;if(this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]]&&!_[_0x92f4('0x78')](this[_0x92f4('0x27')][this['actions'][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xbc')]])){if(this[_0x92f4('0x28')][_0x2f5b5e[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]]['queue']]){this['queueBookedRR'][_0x2f5b5e[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]]['queue']]=this[_0x92f4('0x28')][this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xbc')]]?this[_0x92f4('0x28')][this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xbc')]]:this['queueBooked'][this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xbc')]]?this[_0x92f4('0x27')][this[_0x92f4('0xec')][_0x142b6b['actionid']][_0x92f4('0xbc')]][_0x92f4('0xfc')]||0x0:0x0;}this[_0x92f4('0x27')][this[_0x92f4('0xec')][_0x142b6b[_0x92f4('0xed')]]['queue']][_0x92f4('0xfc')]=this['queueBookedRR'][this['actions'][_0x142b6b[_0x92f4('0xed')]][_0x92f4('0xbc')]];for(var _0x593c18=0x0;_0x593c18=_0x59ef42[_0x92f4('0x123')]){_0x35b510[_0x92f4('0x124')](_0x35e44b,_0x16f3cf,_0x42e6bb,'reason19\x20machine....');}else{if(_0x35e44b['countmachineretry']>=_0x59ef42[_0x92f4('0x125')]){_0x35b510[_0x92f4('0x126')](_0x35e44b,_0x16f3cf,_0x42e6bb,_0x92f4('0x127'));}else{hopperUtils[_0x92f4('0xd9')]({'active':![],'countmachineretry':_0x35e44b[_0x92f4('0x11c')],'scheduledat':moment()['add'](_0x59ef42[_0x92f4('0x128')],'minutes')[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0x35e44b['ContactId'],'ListId':_0x35e44b[_0x92f4('0xe6')],'VoiceQueueId':_0x35e44b[_0x92f4('0xe7')]||undefined,'CampaignId':_0x35e44b[_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x129')));_0x16f3cf({'reschedule':0x1});}}});}if(_0x5a2aac['type']===_0x92f4('0xbf')&&this['campaigns'][_0x5a2aac[_0x92f4('0xbc')]]['dialAMDActive']&&_0x2a8b07[_0x92f4('0x10d')]===_0x92f4('0x10e')){delete this['uniqueId'][_0x2a8b07[_0x92f4('0xbd')]];this[_0x92f4('0xc0')](this[_0x92f4('0x1e')][_0x5a2aac[_0x92f4('0xbc')]]);_0x2a93f3=new Hangup(_0x5a2aac,_0x2a8b07);_0x2a93f3[_0x92f4('0xce')]=0x12;_0x2a93f3[_0x92f4('0x6d')]=_0x92f4('0x110');_0x2a93f3[_0x92f4('0x111')]=_0x92f4('0x12a');ami['emit'](_0x92f4('0x113'),ut[_0x92f4('0x114')](_0x2a93f3,_0x92f4('0x115')));this[_0x92f4('0x116')](_0x2a93f3,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x5a2aac[_0x92f4('0xbe')]==='ivr'&&this[_0x92f4('0x1e')][_0x5a2aac['queue']][_0x92f4('0x119')]&&_0x2a8b07[_0x92f4('0x10d')]===_0x92f4('0x11a')){return new Promise(function(_0x5a7b76,_0x49b564){delete _0x35b510[_0x92f4('0x23')][_0x2a8b07['uniqueid']];_0x35b510['updateOriginated'](_0x35b510['campaigns'][_0x5a2aac[_0x92f4('0xbc')]]);_0x35b510[_0x92f4('0x1e')][_0x5a2aac[_0x92f4('0xbc')]]['outboundAnswerCallsDay']+=0x1;_0x35b510[_0x92f4('0x1e')][_0x5a2aac['queue']][_0x92f4('0x10f')]+=0x1;var _0x4a06e2=_0x35b510[_0x92f4('0x1e')][_0x5a2aac[_0x92f4('0xbc')]];var _0x37fb46=new Hangup(_0x5a2aac,_0x2a8b07);_0x37fb46[_0x92f4('0xce')]=0x13;_0x37fb46['statedesc']='Machine';_0x37fb46['membername']=_0x92f4('0x12a');_0x37fb46['countmachineretry']+=0x1;_0x37fb46[_0x92f4('0xd2')]+=0x1;_0x37fb46['amd']=!![];ami[_0x92f4('0x112')]('custom:amd',ut['buildObj'](_0x37fb46,_0x92f4('0x115')));hopperUtils[_0x92f4('0xc6')](_0x37fb46)[_0x92f4('0x9e')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x37fb46['countbusyretry']+_0x37fb46[_0x92f4('0x11f')]+_0x37fb46[_0x92f4('0x120')]+_0x37fb46[_0x92f4('0x121')]+_0x37fb46[_0x92f4('0xd6')]+_0x37fb46[_0x92f4('0xe2')]+_0x37fb46[_0x92f4('0x11c')]+_0x37fb46[_0x92f4('0x122')]>=_0x4a06e2[_0x92f4('0x123')]){_0x35b510[_0x92f4('0x124')](_0x37fb46,_0x5a7b76,_0x49b564,'reason19\x20machine....');}else{if(_0x37fb46[_0x92f4('0x11c')]>=_0x4a06e2[_0x92f4('0x125')]){_0x35b510['createStateFinal'](_0x37fb46,_0x5a7b76,_0x49b564,_0x92f4('0x127'));}else{hopperUtils[_0x92f4('0xd9')]({'active':![],'countmachineretry':_0x37fb46[_0x92f4('0x11c')],'scheduledat':moment()[_0x92f4('0xda')](_0x4a06e2[_0x92f4('0x128')],_0x92f4('0xe5'))[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0x37fb46['ContactId'],'ListId':_0x37fb46[_0x92f4('0xe6')],'VoiceQueueId':_0x37fb46[_0x92f4('0xe7')]||undefined,'CampaignId':_0x37fb46['CampaignId']||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x129')));_0x5a7b76({'reschedule':0x1});}}});}}};Dialer[_0x92f4('0x88')]['syncHangup']=function(_0x275a4b){var _0x21ac28=this['uniqueId'][_0x275a4b[_0x92f4('0xbd')]];var _0x23f00d;if(_0x21ac28&&_0x21ac28[_0x92f4('0xbe')]===_0x92f4('0xbf')){delete this[_0x92f4('0x23')][_0x275a4b[_0x92f4('0xbd')]];this[_0x92f4('0xc0')](this[_0x92f4('0x1e')][_0x21ac28[_0x92f4('0xbc')]]);this[_0x92f4('0x1e')][_0x21ac28[_0x92f4('0xbc')]][_0x92f4('0x12b')]+=0x1;_0x23f00d=new Hangup(_0x21ac28,_0x275a4b);hopperUtils[_0x92f4('0xc6')](_0x23f00d)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x12c')));hopperUtils['moveContactManagedDialer'](_0x23f00d)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x12d')));}if(_0x21ac28&&_0x21ac28['type']!==_0x92f4('0xbf')&&isNotNull(this[_0x92f4('0x1d')][_0x21ac28[_0x92f4('0xbc')]]['dialQueueProject'])){delete this['uniqueId'][_0x275a4b[_0x92f4('0xbd')]];this[_0x92f4('0xc0')](this[_0x92f4('0x1d')][_0x21ac28['queue']]);this[_0x92f4('0x1d')][_0x21ac28[_0x92f4('0xbc')]][_0x92f4('0xc2')]+=0x1;this[_0x92f4('0x1d')][_0x21ac28['queue']][_0x92f4('0x10f')]+=0x1;_0x23f00d=new Hangup(_0x21ac28,_0x275a4b);_0x23f00d[_0x92f4('0xce')]=0x10;_0x23f00d[_0x92f4('0x6d')]=_0x92f4('0x12e');_0x23f00d[_0x92f4('0x111')]=_0x92f4('0x12f');hopperUtils[_0x92f4('0xc6')](_0x23f00d)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x12c')));hopperUtils[_0x92f4('0xc8')](_0x23f00d)[_0x92f4('0x9e')](loggerCatch('[syncHangupIvr]'));}if(_0x21ac28&&_0x21ac28['type']!==_0x92f4('0xbf')&&!isNotNull(this[_0x92f4('0x1d')][_0x21ac28['queue']][_0x92f4('0x130')])){if(_0x275a4b[_0x92f4('0x131')]==='Normal\x20Clearing'){delete this[_0x92f4('0x23')][_0x275a4b[_0x92f4('0xbd')]];this[_0x92f4('0x1d')][_0x21ac28[_0x92f4('0xbc')]]['outboundAnswerCallsDay']+=0x1;const _0x1c0560=new AgentComplete(_0x21ac28,_0x275a4b);_0x1c0560[_0x92f4('0xe8')]=this[_0x92f4('0x1d')][_0x21ac28[_0x92f4('0xbc')]]['id'];hopperUtils[_0x92f4('0xc6')](_0x1c0560)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0xc7')));hopperUtils[_0x92f4('0xc8')](_0x1c0560)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x132')));}else{delete this[_0x92f4('0x23')][_0x275a4b[_0x92f4('0xbd')]];this['updateOriginated'](this[_0x92f4('0x1d')][_0x21ac28['queue']]);this[_0x92f4('0x1d')][_0x21ac28[_0x92f4('0xbc')]][_0x92f4('0x133')]+=0x1;_0x23f00d=new Hangup(_0x21ac28,_0x275a4b);_0x23f00d[_0x92f4('0xce')]=0xc;_0x23f00d[_0x92f4('0x6d')]=_0x275a4b['cause-txt'];_0x23f00d[_0x92f4('0x111')]=_0x92f4('0x134');hopperUtils['createHistory'](_0x23f00d)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x12c')));hopperUtils[_0x92f4('0xc8')](_0x23f00d)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x12d')));}}};Dialer[_0x92f4('0x88')]['syncQueueSummary']=function(_0xe10b97){var _0x4417d9=this;if(!_0x4417d9[_0x92f4('0x29')][_0xe10b97[_0x92f4('0x45')]]){_0x4417d9[_0x92f4('0x29')][_0xe10b97['name']]={'running':![]};}else if(_0x4417d9[_0x92f4('0x29')][_0xe10b97['name']]['running']===!![]){return;}else if(_0x4417d9[_0x92f4('0x29')][_0xe10b97[_0x92f4('0x45')]][_0x92f4('0x135')]===![]){_0x4417d9[_0x92f4('0x29')][_0xe10b97[_0x92f4('0x45')]][_0x92f4('0x135')]=!![];}var _0x179e54=_0x4417d9[_0x92f4('0x1d')][_0xe10b97[_0x92f4('0x45')]];var _0x1f6506=_0x179e54[_0x92f4('0x69')]!==utils[_0x92f4('0x6b')][_0x92f4('0x136')];var _0x2d980b=utils[_0x92f4('0x137')](_0x179e54);_0x179e54[_0x92f4('0x138')]=utils[_0x92f4('0x139')](_0x179e54,_0x4417d9[_0x92f4('0x20')]);Promise[_0x92f4('0xad')]()['then'](function(){if(_0x179e54['statusMessage']===utils[_0x92f4('0x6b')][_0x92f4('0x136')]){if(_0x1f6506){clearPredictiveAttributes(_0x179e54);_0xe10b97[_0x92f4('0x25')]=undefined;_0xe10b97[_0x92f4('0x5f')]=undefined;}if(_0x179e54['statusMessage']===utils[_0x92f4('0x6b')][_0x92f4('0x136')]){_0xe10b97[_0x92f4('0x13a')]=0x0;_0xe10b97[_0x92f4('0xf6')]=0x0;_0xe10b97[_0x92f4('0x13b')]=0x0;_0xe10b97[_0x92f4('0x13c')]=0x0;_0xe10b97[_0x92f4('0x13d')]=0x0;}}else if(_0x179e54[_0x92f4('0x138')]===utils[_0x92f4('0x6b')][_0x92f4('0x13e')]&&!_0x2d980b){return _0x4417d9[_0x92f4('0x95')](_0x179e54,!![])['then'](function(){return _0x4417d9['ifTime'](_0x179e54,![]);})['then'](function(){return _0x4417d9['checkDialMethod'](_0x179e54);})[_0x92f4('0x9e')](function(_0x227ff8){loggerSyncQueueSummary[_0x92f4('0x41')]('[syncQueueSummary]',util[_0x92f4('0x43')](_0x227ff8,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x179e54);});}else{clearPredictiveAttributes(_0x179e54);}})[_0x92f4('0x3e')](function(){var _0x520d12=_0xe10b97[_0x92f4('0x13f')](_0x179e54);if(_0x520d12||_0x179e54[_0x92f4('0x140')]){_0x179e54[_0x92f4('0x140')]=![];_0xe10b97[_0x92f4('0x141')](_0x179e54);Object['assign'](_0x179e54,_0xe10b97);emitOutboundVoiceQueueSummary(_0xe10b97);}_0x4417d9[_0x92f4('0x29')][_0x179e54[_0x92f4('0x45')]][_0x92f4('0x135')]=![];})['catch'](function(_0xf9d8a0){logger[_0x92f4('0x64')]('[syncQueueSummary]',util[_0x92f4('0x43')](_0xf9d8a0,{'showHidden':![],'depth':null}));_0x4417d9[_0x92f4('0x29')][_0x179e54[_0x92f4('0x45')]][_0x92f4('0x135')]=![];});};Dialer[_0x92f4('0x88')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x3de359=_[_0x92f4('0x142')](this[_0x92f4('0x1d')],function(_0x45fed8){return _0x45fed8[_0x92f4('0x143')];});var _0x354440=_['filter'](this[_0x92f4('0x1f')],function(_0x5d8cc1){return _0x5d8cc1['online']&&_0x5d8cc1['status']==='reachable';});if(_0x3de359[_0x92f4('0xfd')]>0x0&&_0x354440[_0x92f4('0xfd')]>0x0){return Promise['resolve']()['then'](cmHopper[_0x92f4('0x144')](_['map'](_0x3de359,'id'),previewRecallmeReminderInterval,_['map'](_0x354440,'id')))['then'](function(_0x3c1b9c){for(var _0x4a93d0=0x0;_0x4a93d0<_0x3c1b9c[_0x92f4('0xfd')];_0x4a93d0++){var _0x2811ef=_0x3c1b9c[_0x4a93d0][_0x92f4('0x145')]['name'];if(_0x2811ef)io['to'](util[_0x92f4('0x9a')](_0x92f4('0x146'),_0x2811ef))[_0x92f4('0x112')](_0x92f4('0x147'),{'hopper':_0x3c1b9c[_0x4a93d0]});}})[_0x92f4('0x9e')](function(_0x1c21c2){logger['error'](_0x92f4('0x148'),_0x1c21c2);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x92f4('0x88')][_0x92f4('0x3d')]=function(){var _0x3b7848=this;setInterval(function(){_0x3b7848['clearZombieChannels'](_0x3b7848[_0x92f4('0x23')],'[uniqueid]');_0x3b7848[_0x92f4('0x149')](_0x3b7848[_0x92f4('0xec')],'[actions]');},0x32c8);};Dialer[_0x92f4('0x88')]['clearZombieChannels']=function(_0x5b6cb4,_0x82e0df){var _0x260896=this;for(var _0x53da7b in _0x5b6cb4){if(typeof _0x5b6cb4[_0x53da7b]!==_0x92f4('0xac')){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x5b6cb4[_0x53da7b])){return ami['Action']({'action':_0x92f4('0x87'),'channel':_0x5b6cb4[_0x53da7b][_0x92f4('0xeb')]})[_0x92f4('0x9e')](function(_0x409796){if(_0x409796[_0x92f4('0x69')]===_0x92f4('0x14a')){setTimeout(function(){if(_0x5b6cb4[_0x53da7b]&&_0x5b6cb4[_0x53da7b]['type']!=='ivr'){_0x260896[_0x92f4('0xc0')](_0x260896[_0x92f4('0x1d')][_0x5b6cb4[_0x53da7b][_0x92f4('0xbc')]]);logger[_0x92f4('0x64')]('[Dialer][checkChannel]',_0x82e0df,_0x53da7b,_0x5b6cb4[_0x53da7b][_0x92f4('0xbc')]);delete _0x5b6cb4[_0x53da7b];}if(_0x5b6cb4[_0x53da7b]&&_0x5b6cb4[_0x53da7b][_0x92f4('0xbe')]===_0x92f4('0xbf')){_0x260896['updateOriginated'](_0x260896[_0x92f4('0x1e')][_0x5b6cb4[_0x53da7b][_0x92f4('0xbc')]]);logger[_0x92f4('0x64')](_0x92f4('0x14b'),_0x82e0df,_0x53da7b,_0x5b6cb4[_0x53da7b][_0x92f4('0xbc')]);delete _0x5b6cb4[_0x53da7b];}},0x2328);}});}});}}};Dialer[_0x92f4('0x88')]['getVoiceQueueRtPauses']=function(_0x58b732){return Promise[_0x92f4('0xad')]()[_0x92f4('0x3e')](voiceQueueRt['getVoiceQueueRtPauses'](_0x58b732))[_0x92f4('0x9e')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x92f4('0x88')][_0x92f4('0xc0')]=function(_0x592f7c){if(!_[_0x92f4('0x40')](_0x592f7c)&&_0x592f7c!==null){if(typeof _0x592f7c['originated']!==_0x92f4('0xac')){if(_0x592f7c['originated']>0x0){_0x592f7c[_0x92f4('0x7f')]-=0x1;}else{logger[_0x92f4('0x64')](_0x92f4('0x14c'));}}}else{logger[_0x92f4('0x64')](_0x92f4('0x14d'));}};Dialer['prototype'][_0x92f4('0x14e')]=function(_0x17bcea,_0x175fea){var _0x4d0e3e=this;return function(_0x3bc89f){_0x4d0e3e['updateOriginated'](_0x175fea);logger[_0x92f4('0x64')](_0x17bcea,util[_0x92f4('0x43')](_0x3bc89f,{'showHidden':![],'depth':null}));};};Dialer[_0x92f4('0x88')][_0x92f4('0x14f')]=function(_0x532f12,_0x2271a1,_0x1df479){var _0x484974={'state':0x19,'statedesc':'notFound'};this[_0x92f4('0xc0')](_0x2271a1);this[_0x92f4('0x116')](_[_0x92f4('0xf4')](_0x484974,_[_0x92f4('0x73')](_0x1df479,[_0x92f4('0xdb'),_0x92f4('0xe6'),_0x92f4('0x150'),_0x92f4('0xe7'),_0x92f4('0xe8')])),_0x92f4('0x151'),_0x92f4('0x152'));logger[_0x92f4('0x64')](_0x532f12);};Dialer['prototype'][_0x92f4('0x116')]=function(_0x42871c,_0x553248,_0x2bf474){hopperUtils[_0x92f4('0xc6')](_0x42871c)[_0x92f4('0x9e')](loggerCatch(_0x553248));hopperUtils[_0x92f4('0xc8')](_0x42871c)['catch'](loggerCatch(_0x2bf474));};Dialer[_0x92f4('0x88')][_0x92f4('0xd8')]=function(_0x3f1cc9,_0x4a6dc4){hopperUtils[_0x92f4('0xc6')](_0x3f1cc9)['catch'](loggerCatch(_0x92f4('0xc7')));if(_0x4a6dc4==0x0){hopperUtils[_0x92f4('0xc8')](_0x3f1cc9)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x153')));}};Dialer[_0x92f4('0x88')][_0x92f4('0x148')]=function(_0x3fd479){return Promise[_0x92f4('0xad')]()[_0x92f4('0x3e')](cmHopper[_0x92f4('0x144')](_0x3fd479['id'],previewRecallmeReminderInterval))[_0x92f4('0x3e')](function(_0x36e313){for(var _0x75afcd=0x0;_0x75afcd<_0x36e313[_0x92f4('0xfd')];_0x75afcd++){var _0x54d109=_0x36e313[_0x75afcd]['Agent']['name'];if(_0x54d109)io['to'](util[_0x92f4('0x9a')]('user:%s',_0x54d109))[_0x92f4('0x112')]('user:dialPreviewRecallReminder',{'hopper':_0x36e313[_0x75afcd]});}})[_0x92f4('0x9e')](function(){});};Dialer['prototype'][_0x92f4('0x154')]=function(_0x37e5c7){var _0x2cdb93=this;return function(){_0x2cdb93[_0x92f4('0x155')](_0x37e5c7);};};Dialer['prototype'][_0x92f4('0x156')]=function(_0x26190c,_0x2846e9){var _0x237b22=this;var _0x55faed=uuid['v4']();this[_0x92f4('0xec')][_0x55faed]=new Action(_0x26190c,_0x2846e9,_0x55faed);return new Promise(function(_0x3faa90,_0xf4847b){if(_[_0x92f4('0x40')](_0x26190c)&&typeof _0x26190c!=='object'){return _0xf4847b(msgResponse(_0x92f4('0x157'),_0x92f4('0x91'),_0x92f4('0x158')));}if(_['isUndefined'](_0x2846e9[_0x92f4('0x159')])||_0x2846e9[_0x92f4('0x159')]===null){return _0xf4847b(msgResponse(_0x92f4('0x157'),_0x92f4('0x91'),_0x92f4('0x15a')));}var _0x1ded46={'XMD-CALLERID':_0x237b22[_0x92f4('0xec')][_0x55faed][_0x92f4('0x15b')](),'XMD-AGI':_0x26190c[_0x92f4('0x130')]?util[_0x92f4('0x9a')](_0x92f4('0x15c'),ipAgi,_0x26190c[_0x92f4('0x130')]):_0x92f4('0x15d'),'XMD-AGIAFTER':_0x26190c[_0x92f4('0xc5')]?util[_0x92f4('0x9a')](_0x92f4('0x15c'),ipAgi,_0x26190c['dialQueueProject2']):'NONE','XMD-QUEUE':utils[_0x92f4('0x15e')](_0x26190c)?util[_0x92f4('0x9a')](_0x92f4('0x15f'),_0x26190c[_0x92f4('0x45')],_0x26190c[_0x92f4('0x160')]||'',_0x26190c[_0x92f4('0x161')]?'c':'',_0x26190c[_0x92f4('0xcb')]||0x3):_0x92f4('0x15d'),'XMD-CONTACTID':_0x2846e9[_0x92f4('0xdb')],'XMD-CDRTYPE':_0x92f4('0x8'),'CALLERID(all)':_0x237b22[_0x92f4('0xec')][_0x55faed][_0x92f4('0x15b')](),'XMD-AMD':_0x26190c[_0x92f4('0x119')]?_0x92f4('0x13e'):_0x92f4('0x15d'),'XMD-DESTINATION':_0x92f4('0x10c')};if(_0x26190c['dialAMDActive']){_0x1ded46[_0x92f4('0x162')]=_0x26190c[_0x92f4('0x163')]||0x9c4;_0x1ded46['XMD-AMDGREETING']=_0x26190c[_0x92f4('0x164')]||0x5dc;_0x1ded46[_0x92f4('0x165')]=_0x26190c[_0x92f4('0x166')]||0x320;_0x1ded46[_0x92f4('0x167')]=_0x26190c[_0x92f4('0x168')]||0x1388;_0x1ded46['XMD-AMDMINWORDLENGTH']=_0x26190c[_0x92f4('0x169')]||0x64;_0x1ded46[_0x92f4('0x16a')]=_0x26190c[_0x92f4('0x16b')]||0x32;_0x1ded46[_0x92f4('0x16c')]=_0x26190c['dialAMDMaximumNumberOfWords']||0x3;_0x1ded46[_0x92f4('0x16d')]=_0x26190c[_0x92f4('0x16e')]||0x100;_0x1ded46['XMD-AMDMAXIMUMWORDLENGTH']=_0x26190c[_0x92f4('0x16f')]||0x1388;}if(utils[_0x92f4('0x15e')](_0x26190c)){_0x1ded46[_0x92f4('0x170')]=_0x2846e9[_0x92f4('0xe7')];}else{_0x1ded46['XMD-CAMPAIGNID']=_0x2846e9['CampaignId'];}var _0x2e946c=utils[_0x92f4('0x171')](_0x2846e9[_0x92f4('0x172')]);Object[_0x92f4('0x173')](_0x1ded46,_0x2e946c);var _0x1dc487=_0x237b22[_0x92f4('0x84')](_0x26190c[_0x92f4('0x174')])?utils[_0x92f4('0x175')](_0x26190c[_0x92f4('0x174')][_0x92f4('0x176')],_0x26190c[_0x92f4('0x177')],_0x26190c['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x92f4('0x178')](_0x26190c[_0x92f4('0x179')],_0x26190c[_0x92f4('0x17a')]):_0x26190c[_0x92f4('0x179')]):utils[_0x92f4('0x175')](_[_0x92f4('0xf1')](_0x26190c[_0x92f4('0x8a')])?_0x26190c['Trunk'][_0x92f4('0x176')]:_0x26190c[_0x92f4('0x8a')]['callerid'],_0x26190c[_0x92f4('0x177')],_0x26190c[_0x92f4('0x17a')]>0x0?utils['getCallerIdRandom'](_0x26190c[_0x92f4('0x179')],_0x26190c[_0x92f4('0x17a')]):_0x26190c[_0x92f4('0x179')]);if(_0x1dc487){_0x1ded46[_0x92f4('0x17b')]=_0x237b22[_0x92f4('0xec')][_0x55faed]['originatecalleridname']=utils[_0x92f4('0x17c')](_0x1dc487);_0x1ded46[_0x92f4('0x17d')]=_0x2846e9[_0x92f4('0x159')];}_0x26190c['variables']=_0x1ded46;return ami[_0x92f4('0x98')]({'actionid':_0x55faed,'action':_0x92f4('0x157'),'channel':_0x237b22[_0x92f4('0x84')](_0x26190c[_0x92f4('0x174')])?util[_0x92f4('0x9a')](_0x92f4('0x17e'),_0x26190c[_0x92f4('0x174')][_0x92f4('0x45')],isNotNull(_0x26190c[_0x92f4('0x17f')])?_0x26190c[_0x92f4('0x17f')]['trim']()||'':'',_0x26190c[_0x92f4('0x180')]>0x0?_0x2846e9[_0x92f4('0x159')][_0x92f4('0x181')](_0x26190c[_0x92f4('0x180')]):_0x2846e9[_0x92f4('0x159')]):util[_0x92f4('0x9a')](_0x92f4('0x17e'),_[_0x92f4('0xf1')](_0x26190c['TrunkBackup'])?_0x26190c[_0x92f4('0x174')]['name']:_0x26190c['TrunkBackup'][_0x92f4('0x45')],isNotNull(_0x26190c[_0x92f4('0x17f')])?_0x26190c[_0x92f4('0x17f')][_0x92f4('0x182')]()||'':'',_0x26190c[_0x92f4('0x180')]>0x0?_0x2846e9[_0x92f4('0x159')][_0x92f4('0x181')](_0x26190c[_0x92f4('0x180')]):_0x2846e9[_0x92f4('0x159')]),'callerid':_0x1dc487,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x1ded46,'timeout':(_0x26190c[_0x92f4('0x183')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55faed})['then'](function(_0x128dd6){return _0x3faa90(_0x128dd6);})['catch'](function(_0x100711){_0x26190c[_0x92f4('0x184')]+=0x1;var _0x46e1da=new History(_0x237b22[_0x92f4('0xec')][_0x55faed]);logger[_0x92f4('0x64')](util['format'](_0x92f4('0x185'),JSON[_0x92f4('0xa9')](_0x100711)));_0x46e1da[_0x92f4('0xce')]=0xe;_0x46e1da[_0x92f4('0x6d')]=_0x92f4('0x186');_0x46e1da[_0x92f4('0x6f')]=moment()['format'](_0x92f4('0xc1'));_0x46e1da[_0x92f4('0x6e')]=_0x46e1da[_0x92f4('0x6f')];hopperUtils[_0x92f4('0xc6')](_0x46e1da)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x187')));_0x237b22['moveContactManagedDialer'](_0x46e1da)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x187')))[_0x92f4('0x1b')](function(){delete _0x237b22[_0x92f4('0xec')][_0x55faed];return _0xf4847b(msgResponse('originate',_0x92f4('0x188'),_0x92f4('0x189')));});});});};Dialer[_0x92f4('0x88')][_0x92f4('0x18a')]=function(_0x3017d8,_0x12baff,_0x5007c3){var _0xed6750=new History(_0x12baff);if(_0xed6750[_0x92f4('0x11e')]+_0xed6750['countcongestionretry']+_0xed6750[_0x92f4('0x120')]+_0xed6750['countnosuchnumberretry']+_0xed6750[_0x92f4('0xd6')]+_0xed6750[_0x92f4('0xe2')]+_0xed6750[_0x92f4('0x11c')]+_0xed6750[_0x92f4('0x122')]>=_0x5007c3[_0x92f4('0x123')]-0x1){return!![];}switch(_0x3017d8){case 0x3:if(_0xed6750[_0x92f4('0x120')]>=_0x5007c3[_0x92f4('0x18b')]-0x1){return!![];}hopperUtils[_0x92f4('0xd9')]({'active':![],'countnoanswerretry':_0xed6750[_0x92f4('0x120')]+=0x1,'scheduledat':moment()[_0x92f4('0xda')](_0x5007c3['dialNoAnswerRetryFrequency'],_0x92f4('0xe5'))['format'](_0x92f4('0xc1')),'ContactId':_0xed6750['ContactId'],'ListId':_0xed6750[_0x92f4('0xe6')],'VoiceQueueId':_0xed6750[_0x92f4('0xe7')]||undefined,'CampaignId':_0xed6750['CampaignId']||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x18c')));break;case 0x5:if(_0xed6750[_0x92f4('0x11e')]>=_0x5007c3[_0x92f4('0x18d')]-0x1){return!![];}hopperUtils[_0x92f4('0xd9')]({'active':![],'countbusyretry':_0xed6750[_0x92f4('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x5007c3[_0x92f4('0x18e')],_0x92f4('0xe5'))[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0xed6750[_0x92f4('0xdb')],'ListId':_0xed6750[_0x92f4('0xe6')],'VoiceQueueId':_0xed6750[_0x92f4('0xe7')]||undefined,'CampaignId':_0xed6750['CampaignId']||undefined})[_0x92f4('0x9e')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0xed6750['countcongestionretry']>=_0x5007c3['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x92f4('0xd9')]({'active':![],'countcongestionretry':_0xed6750[_0x92f4('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x5007c3[_0x92f4('0x18f')],'minutes')[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0xed6750['ContactId'],'ListId':_0xed6750[_0x92f4('0xe6')],'VoiceQueueId':_0xed6750[_0x92f4('0xe7')]||undefined,'CampaignId':_0xed6750[_0x92f4('0xe8')]||undefined})['catch'](loggerCatch(_0x92f4('0x190')));break;case 0x0:if(_0xed6750[_0x92f4('0x121')]>=_0x5007c3[_0x92f4('0x191')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0xed6750[_0x92f4('0x121')]+=0x1,'scheduledat':moment()[_0x92f4('0xda')](_0x5007c3[_0x92f4('0x192')],_0x92f4('0xe5'))[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0xed6750[_0x92f4('0xdb')],'ListId':_0xed6750[_0x92f4('0xe6')],'VoiceQueueId':_0xed6750['VoiceQueueId']||undefined,'CampaignId':_0xed6750[_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0xed6750[_0x92f4('0xd6')]>=_0x5007c3[_0x92f4('0xd7')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0xed6750['countdropretry']+=0x1,'scheduledat':moment()[_0x92f4('0xda')](_0x5007c3[_0x92f4('0x193')],_0x92f4('0xe5'))[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0xed6750['ContactId'],'ListId':_0xed6750[_0x92f4('0xe6')],'VoiceQueueId':_0xed6750['VoiceQueueId']||undefined,'CampaignId':_0xed6750[_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0xed6750[_0x92f4('0xe2')]>=_0x5007c3[_0x92f4('0xe3')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0xed6750[_0x92f4('0xe2')]+=0x1,'scheduledat':moment()[_0x92f4('0xda')](_0x5007c3[_0x92f4('0xe4')],_0x92f4('0xe5'))['format'](_0x92f4('0xc1')),'ContactId':_0xed6750[_0x92f4('0xdb')],'ListId':_0xed6750['ListId'],'VoiceQueueId':_0xed6750['VoiceQueueId']||undefined,'CampaignId':_0xed6750[_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0xe9')));break;case 0x13:if(_0xed6750['countmachineretry']>=_0x5007c3[_0x92f4('0x125')]-0x1){return!![];}hopperUtils[_0x92f4('0xd9')]({'active':![],'countmachineretry':_0xed6750[_0x92f4('0x11c')]+=0x1,'scheduledat':moment()[_0x92f4('0xda')](_0x5007c3[_0x92f4('0x128')],'minutes')[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0xed6750[_0x92f4('0xdb')],'ListId':_0xed6750['ListId'],'VoiceQueueId':_0xed6750[_0x92f4('0xe7')]||undefined,'CampaignId':_0xed6750[_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x129')));break;case 0x14:if(_0xed6750[_0x92f4('0x122')]>=_0x5007c3['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x92f4('0xd9')]({'active':![],'countagentrejectretry':_0xed6750[_0x92f4('0x122')]+=0x1,'scheduledat':moment()[_0x92f4('0xda')](_0x5007c3[_0x92f4('0x194')],'minutes')[_0x92f4('0x9a')](_0x92f4('0xc1')),'ContactId':_0xed6750[_0x92f4('0xdb')],'ListId':_0xed6750['ListId'],'VoiceQueueId':_0xed6750[_0x92f4('0xe7')]||undefined,'CampaignId':_0xed6750['CampaignId']||undefined})['catch'](loggerCatch(_0x92f4('0x195')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x31bd24,_0x22ecc0,_0x5cee05){var _0x168419=this;var _0x4d8aaa=new History(_0x31bd24);var _0x4fd624=![];var _0x3eee2b;var _0x4f1fed;return new Promise(function(_0x481cf2,_0x46d12){if(_[_0x92f4('0x40')](_0x22ecc0)&&typeof _0x22ecc0!==_0x92f4('0x196')){return _0x46d12(msgResponse(_0x92f4('0x197'),'Failure',_0x92f4('0x198')));}if(_[_0x92f4('0x40')](_0x5cee05)&&typeof _0x5cee05!==_0x92f4('0x196')){return _0x46d12(msgResponse(_0x92f4('0x197'),'Failure',_0x92f4('0x199')));}hopperUtils[_0x92f4('0xd4')](_0x4d8aaa,_0x5cee05[_0x92f4('0xc3')],_0x22ecc0)[_0x92f4('0x3e')](function(_0x252f3c){if(_0x252f3c[_0x92f4('0xd5')]==0x1)_0x4fd624=!![];switch(_0x5cee05['reason']){case'0':_0x22ecc0[_0x92f4('0x19a')]+=0x1;_0x4d8aaa['state']=0x0;_0x4d8aaa[_0x92f4('0x6d')]=_0x92f4('0x19b');_0x4d8aaa[_0x92f4('0x121')]+=0x1;_0x4d8aaa[_0x92f4('0xd2')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x31bd24,_0x92f4('0x19c')));_0x3eee2b=_0x22ecc0['dialNoSuchNumberRetryFrequency'];_0x4f1fed=_0x22ecc0['callAdditionalPhoneAfterMin'];hopperUtils[_0x92f4('0xc6')](_0x4d8aaa)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x168419[_0x92f4('0x18a')](0x0,_0x31bd24,_0x22ecc0)&&!_0x4fd624){if(_0x4d8aaa[_0x92f4('0x121')]>=_0x22ecc0[_0x92f4('0x191')]){_0x168419[_0x92f4('0x126')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x19d'));}else{_0x168419[_0x92f4('0x124')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x19d'));}}break;case'3':_0x22ecc0[_0x92f4('0x19e')]+=0x1;_0x4d8aaa[_0x92f4('0xce')]=0x3;_0x4d8aaa[_0x92f4('0x6d')]=_0x92f4('0x19f');_0x4d8aaa[_0x92f4('0x120')]+=0x1;_0x4d8aaa[_0x92f4('0xd2')]+=0x1;var _0x865472=ut[_0x92f4('0x1a0')](_0x31bd24,_0x22ecc0);ami[_0x92f4('0x112')](_0x92f4('0x1a1'),_0x865472);_0x3eee2b=_0x22ecc0[_0x92f4('0x1a2')];_0x4f1fed=_0x22ecc0[_0x92f4('0xd3')];hopperUtils['createHistory'](_0x4d8aaa)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x1a3')));if(_0x168419['checkRetriveMax'](0x3,_0x31bd24,_0x22ecc0)&&!_0x4fd624){if(_0x4d8aaa[_0x92f4('0x120')]>=_0x22ecc0[_0x92f4('0x18b')]){_0x168419[_0x92f4('0x126')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1a4'));}else{_0x168419[_0x92f4('0x124')](_0x4d8aaa,_0x481cf2,_0x46d12,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x22ecc0['outboundBusyCallsDay']+=0x1;_0x4d8aaa[_0x92f4('0xce')]=0x5;_0x4d8aaa[_0x92f4('0x6d')]='Busy';_0x4d8aaa[_0x92f4('0x11e')]+=0x1;_0x4d8aaa[_0x92f4('0xd2')]+=0x1;ami[_0x92f4('0x112')](_0x92f4('0x1a5'),ut['buildObj'](_0x31bd24,_0x92f4('0x1a6')));_0x3eee2b=_0x22ecc0[_0x92f4('0x18e')];_0x4f1fed=_0x22ecc0[_0x92f4('0xd3')];hopperUtils['createHistory'](_0x4d8aaa)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x1a7')));if(_0x168419[_0x92f4('0x18a')](0x5,_0x31bd24,_0x22ecc0)&&!_0x4fd624){if(_0x4d8aaa[_0x92f4('0x11e')]>=_0x22ecc0['dialBusyMaxRetry']){_0x168419[_0x92f4('0x126')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1a8'));}else{_0x168419[_0x92f4('0x124')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1a8'));}}break;case'8':_0x22ecc0[_0x92f4('0x1a9')]+=0x1;_0x4d8aaa[_0x92f4('0xce')]=0x8;_0x4d8aaa[_0x92f4('0x6d')]=_0x92f4('0x1aa');_0x4d8aaa[_0x92f4('0x11f')]+=0x1;_0x4d8aaa['countglobal']+=0x1;_0x3eee2b=_0x22ecc0[_0x92f4('0x18f')];_0x4f1fed=_0x22ecc0[_0x92f4('0xd3')];ami[_0x92f4('0x112')](_0x92f4('0x1ab'),ut[_0x92f4('0x114')](_0x31bd24,_0x92f4('0x1ac')));hopperUtils[_0x92f4('0xc6')](_0x4d8aaa)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x1ad')));if(_0x168419[_0x92f4('0x18a')](0x8,_0x31bd24,_0x22ecc0)&&!_0x4fd624){if(_0x4d8aaa[_0x92f4('0x11f')]>=_0x22ecc0['dialCongestionMaxRetry']){_0x168419['createStateFinal'](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1ae'));}else{_0x168419[_0x92f4('0x124')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1ae'));}}break;case'11':_0x22ecc0[_0x92f4('0x1af')]+=0x1;_0x4d8aaa[_0x92f4('0xce')]=0xb;_0x4d8aaa[_0x92f4('0x6d')]=_0x92f4('0xe0');_0x4d8aaa[_0x92f4('0xe2')]+=0x1;_0x4d8aaa[_0x92f4('0xd2')]+=0x1;_0x3eee2b=_0x22ecc0[_0x92f4('0xe4')];_0x4f1fed=_0x22ecc0[_0x92f4('0xd3')];hopperUtils[_0x92f4('0xc6')](_0x4d8aaa)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0xea')));if(_0x168419[_0x92f4('0x18a')](0xb,_0x31bd24,_0x22ecc0)&&!_0x4fd624){if(_0x4d8aaa[_0x92f4('0xe2')]>=_0x22ecc0[_0x92f4('0xe3')]){_0x168419['createStateFinal'](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1b0'));}else{_0x168419[_0x92f4('0x124')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1b0'));}}break;case'20':_0x22ecc0[_0x92f4('0x1b1')]+=0x1;_0x4d8aaa[_0x92f4('0xce')]=0x14;_0x4d8aaa[_0x92f4('0x6d')]=_0x92f4('0x1b2');_0x4d8aaa['countagentrejectretry']+=0x1;_0x4d8aaa['countglobal']+=0x1;_0x3eee2b=_0x22ecc0[_0x92f4('0x194')];_0x4f1fed=_0x22ecc0[_0x92f4('0xd3')];ami['emit'](_0x92f4('0x1b3'),ut[_0x92f4('0x114')](_0x31bd24,_0x92f4('0x1b4')));hopperUtils[_0x92f4('0xc6')](_0x4d8aaa)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x1b5')));if(_0x168419[_0x92f4('0x18a')](0x14,_0x31bd24,_0x22ecc0)&&!_0x4fd624){if(_0x4d8aaa[_0x92f4('0x122')]>=_0x22ecc0['dialAgentRejectMaxRetry']){_0x168419['createStateFinal'](_0x4d8aaa,_0x481cf2,_0x46d12,'reason\x2020\x20agentreject');}else{_0x168419[_0x92f4('0x124')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x92f4('0x1b6'));}}break;default:_0x22ecc0[_0x92f4('0x133')]+=0x1;_0x4d8aaa['state']=0xc;_0x4d8aaa[_0x92f4('0x6d')]=_0x5cee05[_0x92f4('0xc3')];_0x3eee2b=_0x22ecc0[_0x92f4('0x194')];_0x4f1fed=_0x22ecc0[_0x92f4('0xd3')];hopperUtils['createHistory'](_0x4d8aaa)[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x1b7')));if(_0x168419[_0x92f4('0x18a')](_0x5cee05[_0x92f4('0xc3')],_0x31bd24,_0x22ecc0)&&!_0x4fd624){if(_0x4d8aaa['countbusyretry']+_0x4d8aaa['countcongestionretry']+_0x4d8aaa[_0x92f4('0x120')]+_0x4d8aaa[_0x92f4('0x121')]+_0x4d8aaa[_0x92f4('0xd6')]+_0x4d8aaa[_0x92f4('0xe2')]+_0x4d8aaa[_0x92f4('0x11c')]+_0x4d8aaa[_0x92f4('0x122')]>=_0x22ecc0['dialGlobalMaxRetry']){_0x168419[_0x92f4('0x124')](_0x4d8aaa,_0x481cf2,_0x46d12,_0x5cee05[_0x92f4('0xc3')]);}else{_0x168419['createStateFinal'](_0x4d8aaa,_0x481cf2,_0x46d12,_0x5cee05[_0x92f4('0xc3')]);}}}})[_0x92f4('0x3e')](function(){if(_0x4fd624){hopperUtils[_0x92f4('0xde')](_0x4d8aaa,_0x3eee2b,_0x4f1fed)[_0x92f4('0x3e')](function(){return _0x481cf2(0x1);});}});});};Dialer[_0x92f4('0x88')][_0x92f4('0x124')]=function(_0x117f70,_0x587c52,_0x173b00,_0x79f116){var _0x2ffb43=new Final(_0x117f70);_0x2ffb43[_0x92f4('0xce')]=0xf;_0x2ffb43['statedesc']='Global';this[_0x92f4('0x126')](_0x2ffb43,_0x587c52,_0x173b00,_0x79f116);};Dialer['prototype'][_0x92f4('0x126')]=function(_0x390b1a,_0x4a43ee,_0xe88dcf,_0x5a1436){hopperUtils[_0x92f4('0xc8')](_0x390b1a)[_0x92f4('0x3e')](function(){return _0x4a43ee(msgResponse('[callProgressDetecting]',_0x92f4('0x1b8'),_0x5a1436));})[_0x92f4('0x9e')](function(){return _0xe88dcf(msgResponse('[moveContactManagedDialer][0]',_0x92f4('0x91'),_0x92f4('0x1b9')));});};Dialer[_0x92f4('0x88')][_0x92f4('0xa')]=function(_0x4d5f38){var _0x105bdc=_0x4d5f38[_0x92f4('0x1ba')]/0x64;var _0x46d2e2=_0x4d5f38[_0x92f4('0xcc')]/(_0x4d5f38[_0x92f4('0xcc')]+_0x4d5f38[_0x92f4('0xc2')]);var _0x186a65=Math[_0x92f4('0x1bb')](_0x4d5f38['predictiveIntervalAvailable']*(_0x4d5f38['predictiveIntervalMaxThreshold']/0x64));var _0x301c90=Math[_0x92f4('0x1bb')](_0x4d5f38[_0x92f4('0x1bc')]*(_0x4d5f38[_0x92f4('0x1bd')]/0x64));var _0xe08c4=_0x4d5f38[_0x92f4('0x13a')]+_0x4d5f38[_0x92f4('0x13c')];var _0x472c68=Math[_0x92f4('0x1be')](_0x4d5f38['erlangCalls']*_0x4d5f38['erlangAbandonmentRate']*_0x4d5f38[_0x92f4('0x1bf')]*_0x4d5f38[_0x92f4('0x1c0')]);if(_['isUndefined'](_0x4d5f38[_0x92f4('0x5f')])){if(!_[_0x92f4('0x40')](_0x4d5f38[_0x92f4('0x25')])){_0x4d5f38[_0x92f4('0x25')]=undefined;loggerPredictive[_0x92f4('0x64')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x92f4('0x40')](_0x4d5f38['handlePredictive'])){loggerPredictive[_0x92f4('0x64')](_0x92f4('0x1c1'),_0x92f4('0x1c2'));clearInterval(_0x4d5f38['handlePredictive']);_0x4d5f38[_0x92f4('0x62')]=undefined;}_0x4d5f38[_0x92f4('0x5f')]=moment()['format'](_0x92f4('0xc1'));loggerPredictive[_0x92f4('0x47')](_0x4d5f38[_0x92f4('0x45')],_0x92f4('0x1c3'),_0x4d5f38[_0x92f4('0x5f')]);this[_0x92f4('0xb2')](_0x4d5f38,0x1);}else if(ifInterval(_0x4d5f38[_0x92f4('0x1c4')],_0x4d5f38[_0x92f4('0x5f')])){this[_0x92f4('0xb2')](_0x4d5f38,0x1);loggerPredictiveCalls[_0x92f4('0x47')](_0x92f4('0x1c5'),_0x4d5f38[_0x92f4('0x5f')],_0x4d5f38[_0x92f4('0x45')]);_0x4d5f38[_0x92f4('0x57')]=0x0;_0x4d5f38[_0x92f4('0xcd')]=0x0;}else if(_0x105bdc<_0x46d2e2&&_0x4d5f38[_0x92f4('0x1c6')]===_0x92f4('0x1c7')){clearPredictiveAttributes(_0x4d5f38);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x1c8'),_0x92f4('0x1c9'),_0x46d2e2,_0x92f4('0x5f'),_0x4d5f38[_0x92f4('0x45')]);}else if(_0x472c68<_0x4d5f38[_0x92f4('0xcd')]&&_0x4d5f38[_0x92f4('0x1c6')]===_0x92f4('0x1c7')){clearPredictiveAttributes(_0x4d5f38);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x1ca'),_0x92f4('0x1cb'),_0x472c68,_0x92f4('0x1cc'),_0x4d5f38[_0x92f4('0xcd')],'startProgressive',_0x4d5f38[_0x92f4('0x45')]);}else if(!ifInterval(_0x4d5f38[_0x92f4('0x1c4')],_0x4d5f38['startProgressive'])&&_[_0x92f4('0x40')](_0x4d5f38[_0x92f4('0x25')])&&!_['isUndefined'](_0x4d5f38[_0x92f4('0x5f')])){_0x4d5f38[_0x92f4('0x25')]=moment()['format'](_0x92f4('0xc1'));loggerPredictive[_0x92f4('0x47')](_0x4d5f38[_0x92f4('0x45')],_0x92f4('0x1cd'),_0x4d5f38[_0x92f4('0x25')]);hopperUtils[_0x92f4('0x1ce')](_0x4d5f38[_0x92f4('0x1c4')])['then'](this[_0x92f4('0x1cf')](_0x4d5f38))['then'](mergeDataErlangB(_0x4d5f38))[_0x92f4('0x3e')](this[_0x92f4('0x1d0')](_0x4d5f38))[_0x92f4('0x9e')](loggerCatchPredictive(_0x92f4('0x1d1'),_0x4d5f38));}else if(!ifInterval(_0x4d5f38[_0x92f4('0x1c4')],_0x4d5f38['startPredictive'])){_0x4d5f38['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4d5f38['startPredictive']=moment()[_0x92f4('0x9a')](_0x92f4('0xc1'));loggerPredictive['info'](_0x4d5f38[_0x92f4('0x45')],'recalculate\x20predictive\x20at',_0x4d5f38[_0x92f4('0x25')]);clearInterval(_0x4d5f38[_0x92f4('0x62')]);_0x4d5f38[_0x92f4('0x62')]=undefined;hopperUtils['avgHandleTime'](_0x4d5f38[_0x92f4('0x1c4')])[_0x92f4('0x3e')](this[_0x92f4('0x1cf')](_0x4d5f38))[_0x92f4('0x3e')](mergeDataErlangB(_0x4d5f38))[_0x92f4('0x3e')](this['startMethodPredictive'](_0x4d5f38))[_0x92f4('0x9e')](loggerCatchPredictive(_0x92f4('0x1d2'),_0x4d5f38));}else if(_0x4d5f38[_0x92f4('0x1bc')]&&_0xe08c4<_0x4d5f38[_0x92f4('0x1bc')]-_0x301c90){clearPredictiveAttributes(_0x4d5f38);loggerPredictive[_0x92f4('0x47')](_0x4d5f38[_0x92f4('0x45')],_0x92f4('0x1d3'),_0xe08c4,')\x20are\x20less\x20than\x20threshold\x20(',_0x4d5f38[_0x92f4('0x1bc')],'-',_0x301c90,'=',_0x4d5f38[_0x92f4('0x1bc')]-_0x301c90,')');}else if(_0x4d5f38[_0x92f4('0x1bc')]&&_0xe08c4>_0x4d5f38[_0x92f4('0x1bc')]+_0x186a65){clearPredictiveAttributes(_0x4d5f38);loggerPredictive[_0x92f4('0x47')](_0x4d5f38[_0x92f4('0x45')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xe08c4,_0x92f4('0x1d4'),_0x4d5f38['predictiveIntervalAvailable'],'+',_0x186a65,'=',_0x4d5f38[_0x92f4('0x1bc')]+_0x186a65,')');}};Dialer[_0x92f4('0x88')]['getDataPredictive']=function(_0x9e1f95){var _0x30a784=this;return function(_0x1b9df8){return new Promise(function(_0x45827b,_0x846897){_[_0x92f4('0xf4')](_0x9e1f95,_0x1b9df8[0x0]);if(checkGetDataPredictive(_0x1b9df8[0x0])){var _0x2c77e0=_0x9e1f95[_0x92f4('0x1bc')]=_0x9e1f95[_0x92f4('0x13c')]+_0x9e1f95[_0x92f4('0x13a')];var _0x1e8a09=_0x9e1f95[_0x92f4('0x1c4')]*0x3c;var _0x31f414=_0x1b9df8[0x0][_0x92f4('0x51')]+_0x1b9df8[0x0][_0x92f4('0x4f')];var _0x59cb39=(_0x1b9df8[0x0][_0x92f4('0x4b')]+_0x1b9df8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1b9df8[0x0][_0x92f4('0x1d5')])/_0x1b9df8[0x0][_0x92f4('0x49')];_0x9e1f95[_0x92f4('0x1bf')]=_0x59cb39>0x0?_0x59cb39:0x1;switch(_0x9e1f95[_0x92f4('0x1c6')]){case _0x92f4('0x1c7'):var _0x1043ee=_0x9e1f95[_0x92f4('0x1ba')]/0x64;return _0x30a784[_0x92f4('0x1d6')](_0x2c77e0,_0x1e8a09,_0x31f414,_0x59cb39,_0x1043ee)[_0x92f4('0x3e')](function(_0x19aca4){return _0x45827b(_0x19aca4);});case'agentBusyFactor':var _0x4fcee3=_0x9e1f95['dialPredictiveOptimizationPercentage']/0x64;return _0x30a784['busyFactor'](_0x2c77e0,_0x1e8a09,_0x31f414,_0x59cb39,_0x4fcee3)[_0x92f4('0x3e')](function(_0xe005b2){return _0x45827b(_0xe005b2);});default:return _0x846897(msgResponse(_0x92f4('0x1d7'),'Failure',_0x92f4('0x1d8')));}}else{return _0x846897(msgResponse(_0x92f4('0x1d7'),'Failure',_0x92f4('0x1d9')));}});};};Dialer[_0x92f4('0x88')]['getDataPredictiveOld']=function(_0x21ce67){var _0xf84e=this;return function(_0x47021e){return new Promise(function(_0x4021a1,_0x44e4f1){_[_0x92f4('0xf4')](_0x21ce67,_0x47021e[0x0]);if(checkGetDataPredictive(_0x47021e[0x0])){loggerPredictive[_0x92f4('0x47')](JSON[_0x92f4('0xa9')](_0x47021e[0x0]));if(_0x21ce67[_0x92f4('0x1c6')]===_0x92f4('0x1c7')){return _0xf84e[_0x92f4('0x1da')](_0x21ce67['id'])['then'](function(_0x45ce09){var _0x3561e4=_0x21ce67['loggedIn']-_0x45ce09[0x0]['outboundQueuePauses'];var _0x511e24=_0x21ce67['dialPredictiveInterval']*0x3c;var _0x448dc4=_0x47021e[0x0][_0x92f4('0x51')]+_0x47021e[0x0][_0x92f4('0x4f')];var _0xac16be=(_0x47021e[0x0][_0x92f4('0x4b')]+_0x47021e[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x47021e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x47021e[0x0][_0x92f4('0x49')];var _0x1a2aec=_0x21ce67[_0x92f4('0x1ba')]/0x64;_0x21ce67['predictiveIntervalPauses']=_0x45ce09[0x0]['outboundQueuePauses']||0x0;_0x21ce67[_0x92f4('0x1bf')]=_0xac16be>0x0?_0xac16be:0x1;return _0xf84e[_0x92f4('0x1d6')](_0x3561e4,_0x511e24,_0x448dc4,_0xac16be,_0x1a2aec);})[_0x92f4('0x3e')](function(_0x422b5a){return _0x4021a1(_0x422b5a);})[_0x92f4('0x9e')](function(_0x253f95){return _0x44e4f1(msgResponse(_0x92f4('0x1db'),_0x92f4('0x91'),JSON[_0x92f4('0xa9')](_0x253f95)));});}if(_0x21ce67[_0x92f4('0x1c6')]==='agentBusyFactor'){return _0xf84e[_0x92f4('0x1da')](_0x21ce67['id'])['then'](function(_0x1a03ce){var _0x2de8d9=_0x21ce67[_0x92f4('0x1dc')]-_0x1a03ce[0x0]['outboundQueuePauses'];var _0x376a7e=_0x21ce67['dialPredictiveInterval']*0x3c;var _0x348324=_0x47021e[0x0][_0x92f4('0x51')]+_0x47021e[0x0][_0x92f4('0x4f')];var _0x3568d1=(_0x47021e[0x0][_0x92f4('0x4b')]+_0x47021e[0x0][_0x92f4('0x1dd')]+_0x47021e[0x0][_0x92f4('0x1d5')])/_0x47021e[0x0]['predictiveIntervalTotalCalls'];var _0x21481d=_0x21ce67[_0x92f4('0x1ba')]/0x64;_0x21ce67['predictiveIntervalPauses']=_0x1a03ce[0x0][_0x92f4('0x1de')]||0x0;_0x21ce67[_0x92f4('0x1bf')]=_0x3568d1>0x0?_0x3568d1:0x1;return _0xf84e[_0x92f4('0x1df')](_0x2de8d9,_0x376a7e,_0x348324,_0x3568d1,_0x21481d);})['then'](function(_0x366958){return _0x4021a1(_0x366958);})['catch'](function(_0x26e9c9){return _0x44e4f1(msgResponse(_0x92f4('0x1db'),_0x92f4('0x91'),JSON['stringify'](_0x26e9c9)));});}}else{return _0x44e4f1(msgResponse(_0x92f4('0x1d7'),_0x92f4('0x91'),'check\x20failure'));}});};};Dialer['prototype'][_0x92f4('0x1d0')]=function(_0x11689b){var _0x35f216=this;return function(){var _0x3e05b0=0x0;var _0x226828=Math['floor'](_0x11689b[_0x92f4('0x58')]*0x3e8);if(_0x226828>0x0){_0x226828=_0x226828<0x64?0x64:_0x226828;loggerPredictive[_0x92f4('0x47')](_0x11689b[_0x92f4('0x45')],'one\x20call\x20every:',_0x226828,_0x92f4('0x1e0'));_0x11689b[_0x92f4('0x62')]=setInterval(function(){_0x35f216['handlePredictive'](_0x11689b);loggerPredictiveCalls[_0x92f4('0x47')](_0x92f4('0x1e1'),_0x3e05b0+=0x1);},_0x226828);}else{loggerPredictive[_0x92f4('0x47')](_0x11689b[_0x92f4('0x45')],_0x92f4('0x1e2'));}};};Dialer[_0x92f4('0x88')][_0x92f4('0x1e3')]=function(_0x521349,_0x205df2){var _0x4d11ca=this;return function(_0x8bae5b){if(_[_0x92f4('0x78')](_0x8bae5b)){if(_[_0x92f4('0xf1')](_0x205df2[_0x92f4('0x150')])||!_0x205df2[_0x92f4('0x1e4')]){if(_0x521349[_0x92f4('0xb0')]===_0x92f4('0x9')){_0x521349[_0x92f4('0x71')]=_[_0x92f4('0x40')](_0x521349[_0x92f4('0x71')])?!![]:_0x521349[_0x92f4('0x71')];var _0x40cba8=uuid['v4']();_0x4d11ca[_0x92f4('0xec')][_0x40cba8]=new Action(_0x521349,_0x205df2,_0x40cba8);loggerBooked['info'](_0x92f4('0x1e5'),_0x40cba8,'queueStatusComplete:\x20',JSON[_0x92f4('0xa9')](_0x521349[_0x92f4('0x71')]),_0x92f4('0x1e6'),_0x521349[_0x92f4('0x45')]);if(_0x521349[_0x92f4('0x71')]){_0x521349[_0x92f4('0x71')]=![];_0x4d11ca[_0x92f4('0x27')][_0x4d11ca[_0x92f4('0xec')][_0x40cba8]['queue']]=[];ami['Action']({'actionid':_0x40cba8,'action':_0x92f4('0x1e7'),'queue':_0x521349[_0x92f4('0x45')]})['catch'](function(){_0x4d11ca[_0x92f4('0xc0')](_0x521349);hopperUtils[_0x92f4('0xd9')]({'active':![],'ContactId':_0x4d11ca[_0x92f4('0xec')][_0x40cba8][_0x92f4('0xdb')],'ListId':_0x4d11ca[_0x92f4('0xec')][_0x40cba8][_0x92f4('0xe6')],'VoiceQueueId':_0x4d11ca['actions'][_0x40cba8][_0x92f4('0xe7')]||undefined,'CampaignId':_0x4d11ca[_0x92f4('0xec')][_0x40cba8][_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch(_0x92f4('0x1e8')));delete _0x4d11ca['actions'][_0x40cba8];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x521349[_0x92f4('0x71')]),_0x92f4('0x1e6'),_0x521349['name']);_0x4d11ca[_0x92f4('0xc0')](_0x521349);hopperUtils[_0x92f4('0xd9')]({'active':![],'ContactId':_0x4d11ca[_0x92f4('0xec')][_0x40cba8]['ContactId'],'ListId':_0x4d11ca['actions'][_0x40cba8][_0x92f4('0xe6')],'VoiceQueueId':_0x4d11ca['actions'][_0x40cba8]['VoiceQueueId']||undefined,'CampaignId':_0x4d11ca[_0x92f4('0xec')][_0x40cba8][_0x92f4('0xe8')]||undefined})[_0x92f4('0x9e')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4d11ca['actions'][_0x40cba8];}}else{return _0x4d11ca[_0x92f4('0x156')](_0x521349,_0x205df2);}}else{if(utils[_0x92f4('0x5e')](undefined,_0x205df2[_0x92f4('0x1e9')])<_0x521349[_0x92f4('0x1ea')]*0x3c){if(_0x205df2[_0x92f4('0x145')]&&!_0x205df2[_0x92f4('0x145')][_0x92f4('0x1eb')]){_0x4d11ca[_0x92f4('0xf8')][_0x92f4('0xf9')](_0x205df2['id'])[_0x92f4('0x1b')](function(){_0x4d11ca[_0x92f4('0xc0')](_0x521349);});}else{hopperUtils['unlockContact']({'active':![]},_0x205df2['id'],0x1)['finally'](function(){_0x4d11ca[_0x92f4('0xc0')](_0x521349);});}}else{_0x521349[_0x92f4('0x1ec')]+=0x1;_0x4d11ca[_0x92f4('0xc0')](_0x521349);if(_0x521349['dialRecallInQueue']){hopperUtils[_0x92f4('0xd9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x205df2['ContactId'],'ListId':_0x205df2['ListId'],'VoiceQueueId':_0x205df2[_0x92f4('0xe7')]||undefined,'CampaignId':_0x205df2[_0x92f4('0xe8')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x92f4('0xc6')](createObjHistory(_0x521349,_0x205df2,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x92f4('0x1ed')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x4d11ca[_0x92f4('0x116')](createObjHistory(_0x521349,_0x205df2,utils[_0x92f4('0x6b')][_0x92f4('0x1ee')],0x16,_0x92f4('0x1ef')),_0x92f4('0x1f0'),'[Originate][HistoryRecallClose]');}}}}else{_0x521349[_0x92f4('0x1f1')]+=0x1;_0x4d11ca['saveInDb'](createObjHistory(_0x521349,_0x205df2,utils['CAMPAIGN_STATUS'][_0x92f4('0x1f2')],0xd,_0x92f4('0x1f3')),_0x92f4('0x1f4'),_0x92f4('0x1f5'));throw _0x92f4('0x1f6');}};};Dialer['prototype'][_0x92f4('0x155')]=function(_0x478611){var _0x1c2753=this;var _0x1f7da2=_0x478611[_0x92f4('0x1f7')]-_0x478611['originated'];emitCampaignSummary(_0x478611);if(_0x1f7da2>0x0&&_0x478611[_0x92f4('0x67')]==0x0){if(_0x1f7da2>this[_0x92f4('0x21')]){_0x1f7da2=this[_0x92f4('0x21')];}_0x478611[_0x92f4('0x67')]=0x1;hopperUtils[_0x92f4('0x1f8')](_0x478611,_0x1f7da2)[_0x92f4('0x3e')](function(_0x4750a8){_0x478611[_0x92f4('0x67')]=0x0;if(_0x4750a8){if(!utils[_0x92f4('0x1f9')](_0x4750a8)){_0x478611[_0x92f4('0x69')]=utils[_0x92f4('0x6b')][_0x92f4('0x1fa')];logger[_0x92f4('0x47')]('[getContactCampaign2][Empty]'+_0x478611['name']);}else{_0x478611[_0x92f4('0x7f')]+=_0x4750a8[_0x92f4('0xfd')];_0x478611[_0x92f4('0x69')]=utils[_0x92f4('0x6b')][_0x92f4('0x1fb')];for(var _0x3b5a5c=0x0;_0x3b5a5c<_0x4750a8[_0x92f4('0xfd')];_0x3b5a5c+=0x1){_0x478611['ivrTotalCallsDays']+=0x1;if(_[_0x92f4('0xf1')](_0x4750a8[_0x3b5a5c])||_[_0x92f4('0xf1')](_0x4750a8[_0x3b5a5c][_0x92f4('0x172')])||_['isNil'](_0x4750a8[_0x3b5a5c][_0x92f4('0x159')])){_0x1c2753[_0x92f4('0x14f')]('[actionOriginate]\x20',_0x478611,_0x4750a8[_0x3b5a5c]);}else{hopperUtils[_0x92f4('0x1fc')](_['pick'](_0x4750a8[_0x3b5a5c],[_0x92f4('0xe8'),_0x92f4('0x159')]))['then'](_0x1c2753['checkContactBlack'](_0x478611,_0x4750a8[_0x3b5a5c]))[_0x92f4('0x9e')](_0x1c2753[_0x92f4('0x14e')]('[actionOriginateIvr]\x20',_0x478611));}}}}})[_0x92f4('0x9e')](loggerGetContactDialer(_0x92f4('0x1fd'),_0x478611,_0x1f7da2));}};Dialer['prototype'][_0x92f4('0xb2')]=function(_0xce9d10,_0x26583b){var _0x5956bd=this;var _0x1c4972=[];if(_0x26583b<0x1||_0xce9d10[_0x92f4('0xb0')]===_0x92f4('0x9')){_0x26583b=0x1;}var _0x4b88a1=Math[_0x92f4('0x1be')](_0xce9d10['available']*_0x26583b)-_0xce9d10[_0x92f4('0x7f')];if(_0xce9d10[_0x92f4('0x1fe')]>0x0){var _0x3550d7=_0xce9d10[_0x92f4('0x1fe')]-_0xce9d10['originated']-_0xce9d10[_0x92f4('0x13c')]-_0xce9d10[_0x92f4('0x13d')];if(_0x4b88a1>_0x3550d7){_0x4b88a1=_0x3550d7;}}if(_0x4b88a1>0x0&&_0xce9d10[_0x92f4('0x67')]==0x0){if(_0xce9d10[_0x92f4('0xb0')]===_0x92f4('0x9')){_0x4b88a1=0x1;}if(_0x4b88a1>this['maxNumberOriginate']){_0x4b88a1=this[_0x92f4('0x21')];}for(var _0x4aed91 in this[_0x92f4('0x1f')]){if(typeof this[_0x92f4('0x1f')][_0x4aed91]!=='undefined'){if(this[_0x92f4('0x1f')][_0x4aed91]['state']===_0x92f4('0x1ff')&&this['agents'][_0x4aed91][_0x92f4('0x87')]===_0x92f4('0x200')){_0x1c4972[_0x92f4('0x97')](this[_0x92f4('0x1f')][_0x4aed91]['id']);}}}_0xce9d10[_0x92f4('0x67')]=0x1;hopperUtils[_0x92f4('0x201')](_0xce9d10,_0x1c4972,_0x4b88a1)['then'](function(_0x1af1bf){_0xce9d10[_0x92f4('0x67')]=0x0;if(_0x1af1bf){if(!utils[_0x92f4('0x1f9')](_0x1af1bf)){hopperUtils['countReScheduled'](_0xce9d10)[_0x92f4('0x3e')](sendMessageReschedule(_0xce9d10))[_0x92f4('0x9e')](loggerCatch('[countReScheduled]\x20'));}else{_0xce9d10[_0x92f4('0x7f')]+=_0x1af1bf[_0x92f4('0xfd')];_0xce9d10[_0x92f4('0x69')]=_0xce9d10[_0x92f4('0xb0')]==='booked'?utils[_0x92f4('0x6b')][_0x92f4('0x13e')]:utils[_0x92f4('0x6b')][_0x92f4('0x1fb')];for(var _0x332277=0x0;_0x332277<_0x1af1bf['length'];_0x332277+=0x1){if(_[_0x92f4('0xf1')](_0x1af1bf[_0x332277])||_[_0x92f4('0xf1')](_0x1af1bf[_0x332277][_0x92f4('0x172')])||_['isNil'](_0x1af1bf[_0x332277]['phone'])){_0x5956bd[_0x92f4('0x14f')](_0x92f4('0x202'),_0xce9d10,_0x1af1bf[_0x332277]);}else{hopperUtils[_0x92f4('0x203')](_[_0x92f4('0x73')](_0x1af1bf[_0x332277],[_0x92f4('0xe7'),'phone']))['then'](_0x5956bd[_0x92f4('0x1e3')](_0xce9d10,_0x1af1bf[_0x332277]))['catch'](_0x5956bd[_0x92f4('0x14e')](_0x92f4('0x202'),_0xce9d10));}}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0xce9d10,_0x4b88a1));}};Dialer[_0x92f4('0x88')][_0x92f4('0x62')]=function(_0x19d22f){if(_0x19d22f[_0x92f4('0x1fe')]>0x0){var _0x248d70=_0x19d22f[_0x92f4('0x1fe')]-_0x19d22f['originated']-_0x19d22f[_0x92f4('0x13c')];if(_0x248d70>0x0&&_0x19d22f[_0x92f4('0x67')]==0x0){this[_0x92f4('0x204')](_0x19d22f);}else{loggerPredictiveCalls[_0x92f4('0x47')](_0x92f4('0x205'));}}else{this[_0x92f4('0x204')](_0x19d22f);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x46b943){var _0x391608=this;var _0x2a8767=[];_0x46b943[_0x92f4('0x7f')]+=0x1;for(var _0x5970a4 in this[_0x92f4('0x1f')]){if(typeof this[_0x92f4('0x1f')][_0x5970a4]!==_0x92f4('0xac')){if(this[_0x92f4('0x1f')][_0x5970a4][_0x92f4('0xce')]===_0x92f4('0x1ff')&&this[_0x92f4('0x1f')][_0x5970a4][_0x92f4('0x87')]==='reachable'){_0x2a8767[_0x92f4('0x97')](this[_0x92f4('0x1f')][_0x5970a4]['id']);}}}_0x46b943[_0x92f4('0x67')]=0x1;return this[_0x92f4('0x201')](_0x46b943['id'],_0x2a8767,0x1,_0x46b943[_0x92f4('0x206')],_0x46b943)[_0x92f4('0x3e')](function(_0x157f9f){_0x46b943[_0x92f4('0x67')]=0x1;if(_0x157f9f){if(!utils[_0x92f4('0x1f9')](_0x157f9f)){utils[_0x92f4('0x66')](_0x46b943,0x1,0x0);return hopperUtils['countReScheduled'](_0x46b943)[_0x92f4('0x3e')](sendMessageReschedule(_0x46b943))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x46b943['message']=utils[_0x92f4('0x6b')]['RUNNING'];if(_[_0x92f4('0xf1')](_0x157f9f[0x0])||_[_0x92f4('0xf1')](_0x157f9f[0x0][_0x92f4('0x172')])||_[_0x92f4('0xf1')](_0x157f9f[0x0][_0x92f4('0x159')])){_0x391608[_0x92f4('0x14f')](_0x92f4('0x202'),_0x46b943,_0x157f9f[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x92f4('0x73')](_0x157f9f[0x0],[_0x92f4('0xe7'),'phone']))[_0x92f4('0x3e')](_0x391608[_0x92f4('0x1e3')](_0x46b943,_0x157f9f[0x0]))[_0x92f4('0x9e')](_0x391608[_0x92f4('0x14e')](_0x92f4('0x207'),_0x46b943));}}}})[_0x92f4('0x9e')](loggerGetContactDialer(_0x92f4('0x208'),_0x46b943,0x1));};Dialer[_0x92f4('0x88')][_0x92f4('0x1d6')]=function(_0x1e8dfd,_0x1b20eb,_0x26fe4d,_0x212e9f,_0x4d515a,_0x51aba3){loggerPredictive[_0x92f4('0x47')](_0x92f4('0x209'));loggerPredictive[_0x92f4('0x47')](_0x92f4('0x20a'),_0x1e8dfd);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x20b'),_0x1b20eb);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x20c'),_0x26fe4d);loggerPredictive[_0x92f4('0x47')]('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',_0x212e9f);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',_0x4d515a);loggerPredictive['info']('---------------------------');return new Promise(function(_0x5bc0ad,_0x4c28ff){if(_0x1e8dfd<=0x0||isNaN(_0x1e8dfd)){return _0x4c28ff(msgResponse(_0x92f4('0x20d'),_0x92f4('0x188'),'m\x20=\x20'+_0x1e8dfd));}if(_0x26fe4d<=0x0||isNaN(_0x26fe4d)){return _0x4c28ff(msgResponse(_0x92f4('0x20d'),'Error',_0x92f4('0x20e')+_0x26fe4d));}if(_0x212e9f<=0x0||isNaN(_0x212e9f)){return _0x4c28ff(msgResponse(_0x92f4('0x20d'),_0x92f4('0x188'),_0x92f4('0x20f')+_0x212e9f));}if(_0x1b20eb<=0x0||isNaN(_0x1b20eb)){return _0x4c28ff(msgResponse(_0x92f4('0x20d'),'Error',_0x92f4('0x210')+_0x1b20eb));}if(_0x4d515a<=0x0||isNaN(_0x4d515a)){return _0x4c28ff(msgResponse(_0x92f4('0x20d'),'Error','Amax\x20=\x20'+_0x4d515a));}_0x51aba3=_0x51aba3||0x0;var _0x1b1d9b=0x1/_0x26fe4d;var _0x55aaef=0x0;var _0x1a400c=0x0;var _0x3977f2=0x0;var _0x183778=0x0;for(var _0x56a28c=0x0;_0x3977f2<_0x4d515a;_0x56a28c+=0x1){_0x1a400c=_0x56a28c/_0x1b20eb;_0x55aaef=(_0x212e9f*_0x1a400c+_0x51aba3)/_0x1b1d9b;_0x3977f2=utils[_0x92f4('0x211')](_0x55aaef,_0x1e8dfd);_0x183778=_0x55aaef/_0x1e8dfd*(0x1-utils['erlangb'](_0x55aaef,_0x1e8dfd));}return _0x5bc0ad({'erlangCalls':_0x56a28c,'erlangCallToSecond':_0x1b20eb/_0x56a28c,'erlangAbandonmentRate':_0x3977f2,'erlangBusyFactor':_0x183778});});};Dialer[_0x92f4('0x88')][_0x92f4('0x1df')]=function(_0x27178a,_0x28d1ab,_0x22126e,_0x4ec9f1,_0x5ced8e,_0x3e098a){loggerPredictive[_0x92f4('0x47')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x92f4('0x47')](_0x92f4('0x20a'),_0x27178a);loggerPredictive['info'](_0x92f4('0x20b'),_0x28d1ab);loggerPredictive[_0x92f4('0x47')](_0x92f4('0x20c'),_0x22126e);loggerPredictive[_0x92f4('0x47')]('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',_0x4ec9f1);loggerPredictive[_0x92f4('0x47')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ced8e);loggerPredictive['info'](_0x92f4('0x5d'));return new Promise(function(_0x5de96a,_0x219340){if(_0x27178a<=0x0||isNaN(_0x27178a)){return _0x219340(msgResponse(_0x92f4('0x212'),'Error',_0x92f4('0x213')+_0x27178a));}if(_0x22126e<=0x0||isNaN(_0x22126e)){return _0x219340(msgResponse(_0x92f4('0x212'),_0x92f4('0x188'),_0x92f4('0x20e')+_0x22126e));}if(_0x4ec9f1<=0x0||isNaN(_0x4ec9f1)){return _0x219340(msgResponse('[busyFactor]',_0x92f4('0x188'),_0x92f4('0x20f')+_0x4ec9f1));}if(_0x28d1ab<=0x0||isNaN(_0x28d1ab)){return _0x219340(msgResponse(_0x92f4('0x212'),_0x92f4('0x188'),_0x92f4('0x210')+_0x28d1ab));}if(_0x5ced8e<=0x0||isNaN(_0x5ced8e)){return _0x219340(msgResponse(_0x92f4('0x212'),_0x92f4('0x188'),_0x92f4('0x214')+_0x5ced8e));}_0x3e098a=_0x3e098a||0x0;var _0x3a598e=0x1/_0x22126e;var _0x13b064=0x0;var _0x2f085c=0x0;var _0x5f02d8=0x0;var _0x235e4e=0x0;for(var _0x5317ef=0x0;_0x235e4e<_0x5ced8e;_0x5317ef+=0x1){_0x2f085c=_0x5317ef/_0x28d1ab;_0x13b064=(_0x4ec9f1*_0x2f085c+_0x3e098a)/_0x3a598e;_0x5f02d8=utils['erlangb'](_0x13b064,_0x27178a);_0x235e4e=_0x13b064/_0x27178a*(0x1-utils['erlangb'](_0x13b064,_0x27178a));}return _0x5de96a({'erlangCalls':_0x5317ef,'erlangCallToSecond':_0x28d1ab/_0x5317ef,'erlangAbandonmentRate':_0x5f02d8,'erlangBusyFactor':_0x235e4e});});};module[_0x92f4('0x215')]=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 67ae04a..5058a37 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 _0xf750=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','number','queue','active','type'];(function(_0x336e7a,_0x211e1a){var _0x3764db=function(_0x19fdbd){while(--_0x19fdbd){_0x336e7a['push'](_0x336e7a['shift']());}};_0x3764db(++_0x211e1a);}(_0xf750,0x18d));var _0x0f75=function(_0x32bb12,_0x1baa09){_0x32bb12=_0x32bb12-0x0;var _0x1af866=_0xf750[_0x32bb12];return _0x1af866;};'use strict';var util=require(_0x0f75('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x50f57e,_0x34f7bb,_0x521fbe){var _0x1fe2b1='';if(!_[_0x0f75('0x1')](_0x34f7bb)&&_0x0f75('0x2')===typeof _0x34f7bb){_0x1fe2b1+=_0x34f7bb;}if(!_[_0x0f75('0x1')](_0x521fbe)&&_0x0f75('0x2')===typeof _0x521fbe){_0x1fe2b1+='\x20'+_0x521fbe;}if(_0x1fe2b1!==''){return _0x1fe2b1;}return _0x50f57e;}function Action(_0x10f7da,_0x3bb3cb,_0x18fab1){this[_0x0f75('0x3')]=_0x10f7da;this[_0x0f75('0x4')]=_0x18fab1||undefined;this[_0x0f75('0x5')]=checkNameSurname(_0x3bb3cb[_0x0f75('0x6')][_0x0f75('0x7')],_0x3bb3cb[_0x0f75('0x6')]['firstName'],_0x3bb3cb[_0x0f75('0x6')][_0x0f75('0x8')]);this[_0x0f75('0x9')]=_0x3bb3cb['phone'];this[_0x0f75('0xa')]=_0x10f7da['name'];this[_0x0f75('0xb')]=_0x3bb3cb[_0x0f75('0xb')]||![];this['type']=_0x10f7da[_0x0f75('0xc')];this['dialQueueTimeout']=_0x10f7da[_0x0f75('0xd')]||0x3;this[_0x0f75('0xe')]=_0x3bb3cb[_0x0f75('0xe')];this[_0x0f75('0xf')]=_0x3bb3cb[_0x0f75('0xf')];this[_0x0f75('0x10')]=_0x3bb3cb[_0x0f75('0x10')];this['countnoanswerretry']=_0x3bb3cb[_0x0f75('0x11')];this[_0x0f75('0x12')]=_0x3bb3cb[_0x0f75('0x12')];this['countdropretry']=_0x3bb3cb[_0x0f75('0x13')];this[_0x0f75('0x14')]=_0x3bb3cb[_0x0f75('0x14')];this[_0x0f75('0x15')]=_0x3bb3cb[_0x0f75('0x15')];this[_0x0f75('0x16')]=_0x3bb3cb[_0x0f75('0x16')];this[_0x0f75('0x17')]=_0x3bb3cb[_0x0f75('0x17')];this['ListId']=_0x3bb3cb['ListId'];this['UserId']=_0x3bb3cb[_0x0f75('0x18')];this[_0x0f75('0x19')]=_0x3bb3cb[_0x0f75('0x19')];this['CampaignId']=_0x3bb3cb['CampaignId'];this['idHopper']=_0x3bb3cb['id'];this[_0x0f75('0x1a')]=_0x3bb3cb[_0x0f75('0x6')][_0x0f75('0x1b')]||'';this[_0x0f75('0x1c')]=moment()['format'](_0x0f75('0x1d'));this['callback']=_0x3bb3cb[_0x0f75('0x1e')];this[_0x0f75('0x1f')]=_0x3bb3cb[_0x0f75('0x1f')];this[_0x0f75('0x20')]=_0x3bb3cb['callbackat'];this[_0x0f75('0x21')]=_0x3bb3cb['recallme'];this['originatecalleridnum']='';this[_0x0f75('0x22')]='';}Action['prototype'][_0x0f75('0x23')]=function(){return util['format'](_0x0f75('0x24'),this[_0x0f75('0x5')],this[_0x0f75('0x3')][_0x0f75('0x25')]>0x0?this[_0x0f75('0x9')][_0x0f75('0x26')](this['voiceQueue'][_0x0f75('0x25')]):this[_0x0f75('0x9')]);};Action['prototype'][_0x0f75('0x27')]=function(){return this[_0x0f75('0xa')];};module[_0x0f75('0x28')]=Action; \ No newline at end of file +var _0x08f8=['dialCutDigit','prototype','exports','isNil','string','voiceQueue','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','substring'];(function(_0xe43ade,_0x43f1a3){var _0x956560=function(_0x46ae95){while(--_0x46ae95){_0xe43ade['push'](_0xe43ade['shift']());}};_0x956560(++_0x43f1a3);}(_0x08f8,0x13b));var _0x808f=function(_0x4ba770,_0x42ba83){_0x4ba770=_0x4ba770-0x0;var _0x4a6b45=_0x08f8[_0x4ba770];return _0x4a6b45;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x194795,_0x40a69b,_0x592c49){var _0x14a9f3='';if(!_[_0x808f('0x0')](_0x40a69b)&&_0x808f('0x1')===typeof _0x40a69b){_0x14a9f3+=_0x40a69b;}if(!_[_0x808f('0x0')](_0x592c49)&&_0x808f('0x1')===typeof _0x592c49){_0x14a9f3+='\x20'+_0x592c49;}if(_0x14a9f3!==''){return _0x14a9f3;}return _0x194795;}function Action(_0x40e55d,_0x1d5f8a,_0x1e9b83){this[_0x808f('0x2')]=_0x40e55d;this['uniqueid']=_0x1e9b83||undefined;this[_0x808f('0x3')]=checkNameSurname(_0x1d5f8a[_0x808f('0x4')][_0x808f('0x5')],_0x1d5f8a[_0x808f('0x4')]['firstName'],_0x1d5f8a['Contact'][_0x808f('0x6')]);this[_0x808f('0x7')]=_0x1d5f8a[_0x808f('0x5')];this[_0x808f('0x8')]=_0x40e55d[_0x808f('0x3')];this[_0x808f('0x9')]=_0x1d5f8a[_0x808f('0x9')]||![];this['type']=_0x40e55d[_0x808f('0xa')];this['dialQueueTimeout']=_0x40e55d[_0x808f('0xb')]||0x3;this[_0x808f('0xc')]=_0x1d5f8a[_0x808f('0xc')];this['countbusyretry']=_0x1d5f8a['countbusyretry'];this['countcongestionretry']=_0x1d5f8a[_0x808f('0xd')];this['countnoanswerretry']=_0x1d5f8a['countnoanswerretry'];this[_0x808f('0xe')]=_0x1d5f8a[_0x808f('0xe')];this['countdropretry']=_0x1d5f8a[_0x808f('0xf')];this[_0x808f('0x10')]=_0x1d5f8a[_0x808f('0x10')];this['countmachineretry']=_0x1d5f8a[_0x808f('0x11')];this[_0x808f('0x12')]=_0x1d5f8a['countagentrejectretry'];this['ContactId']=_0x1d5f8a['ContactId'];this[_0x808f('0x13')]=_0x1d5f8a[_0x808f('0x13')];this[_0x808f('0x14')]=_0x1d5f8a[_0x808f('0x14')];this[_0x808f('0x15')]=_0x1d5f8a[_0x808f('0x15')];this[_0x808f('0x16')]=_0x1d5f8a[_0x808f('0x16')];this[_0x808f('0x17')]=_0x1d5f8a['id'];this[_0x808f('0x18')]=_0x1d5f8a['Contact'][_0x808f('0x19')]||'';this[_0x808f('0x1a')]=moment()['format'](_0x808f('0x1b'));this['callback']=_0x1d5f8a[_0x808f('0x1c')];this[_0x808f('0x1d')]=_0x1d5f8a[_0x808f('0x1d')];this['callbackat']=_0x1d5f8a[_0x808f('0x1e')];this[_0x808f('0x1f')]=_0x1d5f8a[_0x808f('0x1f')];this['originatecalleridnum']='';this[_0x808f('0x20')]='';}Action['prototype'][_0x808f('0x21')]=function(){return util['format'](_0x808f('0x22'),this[_0x808f('0x3')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x808f('0x7')][_0x808f('0x23')](this[_0x808f('0x2')][_0x808f('0x24')]):this['number']);};Action[_0x808f('0x25')]['getQueue']=function(){return this[_0x808f('0x8')];};module[_0x808f('0x26')]=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 e2fd296..1c9d63b 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 _0x8ab6=['membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime'];(function(_0x5a0fea,_0x165294){var _0xb1fbdb=function(_0x2bce29){while(--_0x2bce29){_0x5a0fea['push'](_0x5a0fea['shift']());}};_0xb1fbdb(++_0x165294);}(_0x8ab6,0xda));var _0x68ab=function(_0x2efa61,_0x2f33cc){_0x2efa61=_0x2efa61-0x0;var _0x2651c4=_0x8ab6[_0x2efa61];return _0x2651c4;};'use strict';var moment=require(_0x68ab('0x0'));var utils=require(_0x68ab('0x1'));function AgentComplete(_0x2d80c8,_0x3a477a){this['state']=0x4;this['statedesc']='Answer';this['scheduledat']=_0x2d80c8['scheduledat'];this[_0x68ab('0x2')]=_0x2d80c8[_0x68ab('0x2')];this[_0x68ab('0x3')]=_0x2d80c8['type']===_0x68ab('0x4')?_0x68ab('0x5'):_0x2d80c8[_0x68ab('0x2')];this['countbusyretry']=_0x2d80c8[_0x68ab('0x6')];this[_0x68ab('0x7')]=_0x2d80c8[_0x68ab('0x7')];this[_0x68ab('0x8')]=_0x2d80c8[_0x68ab('0x8')];this[_0x68ab('0x9')]=_0x2d80c8[_0x68ab('0x6')]+_0x2d80c8[_0x68ab('0x7')]+_0x2d80c8[_0x68ab('0x8')]+_0x2d80c8[_0x68ab('0xa')]+_0x2d80c8[_0x68ab('0xb')]+_0x2d80c8[_0x68ab('0xc')]+_0x2d80c8['countmachineretry']+_0x2d80c8[_0x68ab('0xd')];this[_0x68ab('0xa')]=_0x2d80c8['countnosuchnumberretry'];this[_0x68ab('0xb')]=_0x2d80c8[_0x68ab('0xb')];this[_0x68ab('0xc')]=_0x2d80c8[_0x68ab('0xc')];this[_0x68ab('0xe')]=_0x2d80c8['countmachineretry'];this['countagentrejectretry']=_0x2d80c8['countagentrejectretry'];this['uniqueid']=_0x3a477a['uniqueid'];this['calleridname']=_0x2d80c8[_0x68ab('0xf')];this[_0x68ab('0x10')]=_0x2d80c8[_0x68ab('0x11')];this[_0x68ab('0x12')]=_0x2d80c8[_0x68ab('0x12')];this['responsetime']=_0x2d80c8[_0x68ab('0x13')];this[_0x68ab('0x14')]=_0x2d80c8[_0x68ab('0x14')];this['endtime']=moment()[_0x68ab('0x15')](_0x68ab('0x16'));this[_0x68ab('0x17')]=utils[_0x68ab('0x18')](_0x2d80c8['responsetime'],_0x2d80c8[_0x68ab('0x12')]);this[_0x68ab('0x19')]=utils[_0x68ab('0x18')](_0x2d80c8[_0x68ab('0x14')],_0x2d80c8['responsetime']);this[_0x68ab('0x1a')]=utils[_0x68ab('0x18')](this[_0x68ab('0x1b')],_0x2d80c8['answertime']);this['queue']=_0x3a477a[_0x68ab('0x5')];this[_0x68ab('0x1c')]=_0x3a477a[_0x68ab('0x1c')];this['reason']=_0x3a477a[_0x68ab('0x1d')];this['callback']=_0x2d80c8['callback'];this[_0x68ab('0x1e')]=_0x2d80c8[_0x68ab('0x1e')];this[_0x68ab('0x1f')]=_0x2d80c8['callbackat'];this[_0x68ab('0x20')]=_0x2d80c8['recallme'];this[_0x68ab('0x21')]=_0x2d80c8[_0x68ab('0x21')];this[_0x68ab('0x22')]=_0x2d80c8['ListId'];this[_0x68ab('0x23')]=_0x2d80c8[_0x68ab('0x23')];this[_0x68ab('0x24')]=_0x2d80c8['VoiceQueueId'];this['CampaignId']=_0x2d80c8['CampaignId'];this[_0x68ab('0x25')]=_0x2d80c8['originatecalleridnum']||'';this[_0x68ab('0x26')]=_0x2d80c8[_0x68ab('0x26')]||'';this[_0x68ab('0x27')]=_0x2d80c8[_0x68ab('0x27')];}module[_0x68ab('0x28')]=AgentComplete; \ No newline at end of file +var _0x48cd=['../utils','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x48cd,0x158));var _0xd48c=function(_0x58d4d6,_0x1127fb){_0x58d4d6=_0x58d4d6-0x0;var _0x68c6b0=_0x48cd[_0x58d4d6];return _0x68c6b0;};'use strict';var moment=require('moment');var utils=require(_0xd48c('0x0'));function AgentComplete(_0x247a80,_0x3f8ce4){this[_0xd48c('0x1')]=0x4;this['statedesc']=_0xd48c('0x2');this[_0xd48c('0x3')]=_0x247a80[_0xd48c('0x3')];this[_0xd48c('0x4')]=_0x247a80[_0xd48c('0x4')];this[_0xd48c('0x5')]=_0x247a80[_0xd48c('0x4')]===_0xd48c('0x6')?'queue':_0x247a80['type'];this[_0xd48c('0x7')]=_0x247a80['countbusyretry'];this[_0xd48c('0x8')]=_0x247a80['countcongestionretry'];this[_0xd48c('0x9')]=_0x247a80[_0xd48c('0x9')];this[_0xd48c('0xa')]=_0x247a80[_0xd48c('0x7')]+_0x247a80[_0xd48c('0x8')]+_0x247a80[_0xd48c('0x9')]+_0x247a80[_0xd48c('0xb')]+_0x247a80[_0xd48c('0xc')]+_0x247a80[_0xd48c('0xd')]+_0x247a80[_0xd48c('0xe')]+_0x247a80[_0xd48c('0xf')];this[_0xd48c('0xb')]=_0x247a80[_0xd48c('0xb')];this[_0xd48c('0xc')]=_0x247a80[_0xd48c('0xc')];this[_0xd48c('0xd')]=_0x247a80['countabandonedretry'];this[_0xd48c('0xe')]=_0x247a80[_0xd48c('0xe')];this[_0xd48c('0xf')]=_0x247a80[_0xd48c('0xf')];this['uniqueid']=_0x3f8ce4[_0xd48c('0x10')];this[_0xd48c('0x11')]=_0x247a80['name'];this[_0xd48c('0x12')]=_0x247a80[_0xd48c('0x13')];this[_0xd48c('0x14')]=_0x247a80[_0xd48c('0x14')];this[_0xd48c('0x15')]=_0x247a80[_0xd48c('0x15')];this['answertime']=_0x247a80['answertime'];this[_0xd48c('0x16')]=moment()[_0xd48c('0x17')](_0xd48c('0x18'));this[_0xd48c('0x19')]=utils[_0xd48c('0x1a')](_0x247a80[_0xd48c('0x15')],_0x247a80[_0xd48c('0x14')]);this['holdtime']=utils[_0xd48c('0x1a')](_0x247a80['answertime'],_0x247a80[_0xd48c('0x15')]);this['talktime']=utils[_0xd48c('0x1a')](this['endtime'],_0x247a80['answertime']);this[_0xd48c('0x1b')]=_0x3f8ce4[_0xd48c('0x1b')];this['membername']=_0x3f8ce4[_0xd48c('0x1c')];this['reason']=_0x3f8ce4[_0xd48c('0x1d')];this[_0xd48c('0x1e')]=_0x247a80[_0xd48c('0x1e')];this[_0xd48c('0x1f')]=_0x247a80[_0xd48c('0x1f')];this['callbackat']=_0x247a80[_0xd48c('0x20')];this[_0xd48c('0x21')]=_0x247a80[_0xd48c('0x21')];this[_0xd48c('0x22')]=_0x247a80['ContactId'];this[_0xd48c('0x23')]=_0x247a80['ListId'];this[_0xd48c('0x24')]=_0x247a80[_0xd48c('0x24')];this[_0xd48c('0x25')]=_0x247a80[_0xd48c('0x25')];this[_0xd48c('0x26')]=_0x247a80['CampaignId'];this[_0xd48c('0x27')]=_0x247a80[_0xd48c('0x27')]||'';this['originatecalleridname']=_0x247a80[_0xd48c('0x28')]||'';this['agiafterat']=_0x247a80[_0xd48c('0x29')];}module[_0xd48c('0x2a')]=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 344f9ed..1626830 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 _0x2604=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x532ec3,_0x395975){var _0x4e7f2b=function(_0xb6514b){while(--_0xb6514b){_0x532ec3['push'](_0x532ec3['shift']());}};_0x4e7f2b(++_0x395975);}(_0x2604,0x7b));var _0x4260=function(_0x39ef43,_0x54c722){_0x39ef43=_0x39ef43-0x0;var _0x12965d=_0x2604[_0x39ef43];return _0x12965d;};'use strict';function Final(_0x303c23){this[_0x4260('0x0')]=_0x303c23[_0x4260('0x0')];this[_0x4260('0x1')]=_0x303c23['scheduledat'];this[_0x4260('0x2')]=_0x303c23['type'];this[_0x4260('0x3')]=_0x303c23[_0x4260('0x2')]==='outbound'?_0x4260('0x4'):_0x303c23[_0x4260('0x2')];this['countbusyretry']=_0x303c23[_0x4260('0x5')];this[_0x4260('0x6')]=_0x303c23[_0x4260('0x6')];this[_0x4260('0x7')]=_0x303c23['countnoanswerretry'];this[_0x4260('0x8')]=_0x303c23[_0x4260('0x5')]+_0x303c23[_0x4260('0x6')]+_0x303c23[_0x4260('0x7')]+_0x303c23['countnosuchnumberretry']+_0x303c23['countdropretry']+_0x303c23[_0x4260('0x9')]+_0x303c23[_0x4260('0xa')]+_0x303c23[_0x4260('0xb')];this[_0x4260('0xc')]=_0x303c23['countnosuchnumberretry'];this['countdropretry']=_0x303c23['countdropretry'];this[_0x4260('0x9')]=_0x303c23[_0x4260('0x9')];this['countmachineretry']=_0x303c23['countmachineretry'];this[_0x4260('0xb')]=_0x303c23['countagentrejectretry'];this[_0x4260('0x4')]=_0x303c23[_0x4260('0x4')];this['calleridname']=_0x303c23[_0x4260('0xd')];this[_0x4260('0xe')]=_0x303c23['calleridnum'];this[_0x4260('0xf')]=_0x303c23['starttime'];this[_0x4260('0x10')]=_0x303c23['responsetime'];this[_0x4260('0x11')]=_0x303c23[_0x4260('0x10')];this['ringtime']=_0x303c23['ringtime']||0x0;this['holdtime']=_0x303c23[_0x4260('0x12')]||0x0;this[_0x4260('0x13')]=_0x303c23[_0x4260('0x13')]||0x0;this[_0x4260('0x14')]=_0x303c23[_0x4260('0x14')];this[_0x4260('0x15')]=_0x303c23[_0x4260('0x15')];this[_0x4260('0x16')]=_0x303c23[_0x4260('0x16')];this[_0x4260('0x17')]=_0x303c23['recallme'];this['ContactId']=_0x303c23['ContactId'];this[_0x4260('0x18')]=_0x303c23[_0x4260('0x18')];this[_0x4260('0x19')]=_0x303c23['UserId'];this[_0x4260('0x1a')]=_0x303c23[_0x4260('0x1a')];this[_0x4260('0x1b')]=_0x303c23[_0x4260('0x1b')];this[_0x4260('0x1c')]=_0x303c23[_0x4260('0x1c')]||'';this['originatecalleridname']=_0x303c23[_0x4260('0x1d')]||'';this[_0x4260('0x1e')]=_0x303c23['state'];this[_0x4260('0x1f')]=_0x303c23[_0x4260('0x1f')];}module[_0x4260('0x20')]=Final; \ No newline at end of file +var _0xa67e=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x1da1d1,_0x2530fc){var _0x1c2bfb=function(_0x2a35d5){while(--_0x2a35d5){_0x1da1d1['push'](_0x1da1d1['shift']());}};_0x1c2bfb(++_0x2530fc);}(_0xa67e,0x1e3));var _0xea67=function(_0xbe5cb8,_0x791122){_0xbe5cb8=_0xbe5cb8-0x0;var _0x21da0a=_0xa67e[_0xbe5cb8];return _0x21da0a;};'use strict';function Final(_0xe3bc8a){this[_0xea67('0x0')]=_0xe3bc8a[_0xea67('0x0')];this['scheduledat']=_0xe3bc8a[_0xea67('0x1')];this[_0xea67('0x2')]=_0xe3bc8a[_0xea67('0x2')];this['campaigntype']=_0xe3bc8a[_0xea67('0x2')]===_0xea67('0x3')?_0xea67('0x4'):_0xe3bc8a[_0xea67('0x2')];this[_0xea67('0x5')]=_0xe3bc8a[_0xea67('0x5')];this[_0xea67('0x6')]=_0xe3bc8a['countcongestionretry'];this[_0xea67('0x7')]=_0xe3bc8a[_0xea67('0x7')];this['countglobal']=_0xe3bc8a[_0xea67('0x5')]+_0xe3bc8a[_0xea67('0x6')]+_0xe3bc8a[_0xea67('0x7')]+_0xe3bc8a[_0xea67('0x8')]+_0xe3bc8a[_0xea67('0x9')]+_0xe3bc8a[_0xea67('0xa')]+_0xe3bc8a[_0xea67('0xb')]+_0xe3bc8a[_0xea67('0xc')];this[_0xea67('0x8')]=_0xe3bc8a[_0xea67('0x8')];this[_0xea67('0x9')]=_0xe3bc8a[_0xea67('0x9')];this[_0xea67('0xa')]=_0xe3bc8a['countabandonedretry'];this[_0xea67('0xb')]=_0xe3bc8a[_0xea67('0xb')];this[_0xea67('0xc')]=_0xe3bc8a[_0xea67('0xc')];this[_0xea67('0x4')]=_0xe3bc8a['queue'];this[_0xea67('0xd')]=_0xe3bc8a[_0xea67('0xd')];this[_0xea67('0xe')]=_0xe3bc8a['calleridnum'];this[_0xea67('0xf')]=_0xe3bc8a[_0xea67('0xf')];this['responsetime']=_0xe3bc8a[_0xea67('0x10')];this['endtime']=_0xe3bc8a[_0xea67('0x10')];this['ringtime']=_0xe3bc8a[_0xea67('0x11')]||0x0;this[_0xea67('0x12')]=_0xe3bc8a['holdtime']||0x0;this['talktime']=_0xe3bc8a[_0xea67('0x13')]||0x0;this[_0xea67('0x14')]=_0xe3bc8a[_0xea67('0x14')];this[_0xea67('0x15')]=_0xe3bc8a[_0xea67('0x15')];this[_0xea67('0x16')]=_0xe3bc8a['callbackat'];this[_0xea67('0x17')]=_0xe3bc8a['recallme'];this[_0xea67('0x18')]=_0xe3bc8a['ContactId'];this[_0xea67('0x19')]=_0xe3bc8a[_0xea67('0x19')];this['UserId']=_0xe3bc8a[_0xea67('0x1a')];this[_0xea67('0x1b')]=_0xe3bc8a['VoiceQueueId'];this[_0xea67('0x1c')]=_0xe3bc8a[_0xea67('0x1c')];this[_0xea67('0x1d')]=_0xe3bc8a['originatecalleridnum']||'';this['originatecalleridname']=_0xe3bc8a[_0xea67('0x1e')]||'';this[_0xea67('0x1f')]=_0xe3bc8a[_0xea67('0x1f')];this[_0xea67('0x20')]=_0xe3bc8a[_0xea67('0x20')];}module[_0xea67('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 8d371d1..ba369ab 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 _0xbdfd=['YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime'];(function(_0x1c0711,_0x56a619){var _0x377178=function(_0x4dad2b){while(--_0x4dad2b){_0x1c0711['push'](_0x1c0711['shift']());}};_0x377178(++_0x56a619);}(_0xbdfd,0x10d));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0xdbdf('0x0'));var utils=require(_0xdbdf('0x1'));function Hangup(_0x48d5e6,_0xc33dc3){this[_0xdbdf('0x2')]=0x4;this[_0xdbdf('0x3')]='Answer';this[_0xdbdf('0x4')]=_0x48d5e6[_0xdbdf('0x4')];this[_0xdbdf('0x5')]=_0x48d5e6['type'];this['campaigntype']=_0x48d5e6['type']===_0xdbdf('0x6')?_0xdbdf('0x7'):_0x48d5e6[_0xdbdf('0x5')];this[_0xdbdf('0x8')]=_0x48d5e6['amd']||![];this[_0xdbdf('0x9')]=_0x48d5e6[_0xdbdf('0x9')];this[_0xdbdf('0xa')]=_0x48d5e6[_0xdbdf('0xa')];this[_0xdbdf('0xb')]=_0x48d5e6[_0xdbdf('0xb')];this[_0xdbdf('0xc')]=_0x48d5e6['countbusyretry']+_0x48d5e6[_0xdbdf('0xa')]+_0x48d5e6[_0xdbdf('0xb')]+_0x48d5e6['countnosuchnumberretry']+_0x48d5e6[_0xdbdf('0xd')]+_0x48d5e6[_0xdbdf('0xe')]+_0x48d5e6[_0xdbdf('0xf')]+_0x48d5e6[_0xdbdf('0x10')];this[_0xdbdf('0x11')]=_0x48d5e6[_0xdbdf('0x11')];this[_0xdbdf('0xd')]=_0x48d5e6['countdropretry'];this[_0xdbdf('0xe')]=_0x48d5e6[_0xdbdf('0xe')];this[_0xdbdf('0xf')]=_0x48d5e6[_0xdbdf('0xf')];this[_0xdbdf('0x10')]=_0x48d5e6['countagentrejectretry'];this[_0xdbdf('0x12')]=_0xc33dc3[_0xdbdf('0x12')];this[_0xdbdf('0x13')]=_0x48d5e6[_0xdbdf('0x14')];this['calleridnum']=_0x48d5e6[_0xdbdf('0x15')];this[_0xdbdf('0x16')]=_0x48d5e6['starttime'];this[_0xdbdf('0x17')]=_0x48d5e6[_0xdbdf('0x17')];this[_0xdbdf('0x18')]=moment()['format'](_0xdbdf('0x19'));this[_0xdbdf('0x1a')]=utils[_0xdbdf('0x1b')](_0x48d5e6[_0xdbdf('0x17')],_0x48d5e6[_0xdbdf('0x16')]);this[_0xdbdf('0x1c')]=0x0;this[_0xdbdf('0x1d')]=utils[_0xdbdf('0x1b')](this[_0xdbdf('0x18')],_0x48d5e6[_0xdbdf('0x17')]);this[_0xdbdf('0x7')]=_0x48d5e6[_0xdbdf('0x7')];this[_0xdbdf('0x1e')]='IVR';this['reason']=_0xc33dc3[_0xdbdf('0x1f')];this['callback']=_0x48d5e6[_0xdbdf('0x20')];this[_0xdbdf('0x21')]=_0x48d5e6[_0xdbdf('0x21')];this[_0xdbdf('0x22')]=_0x48d5e6['callbackat'];this[_0xdbdf('0x23')]=_0x48d5e6[_0xdbdf('0x23')];this[_0xdbdf('0x24')]=_0x48d5e6[_0xdbdf('0x24')];this[_0xdbdf('0x25')]=_0x48d5e6[_0xdbdf('0x25')];this[_0xdbdf('0x26')]=_0x48d5e6['UserId'];this[_0xdbdf('0x27')]=_0x48d5e6[_0xdbdf('0x27')];this['CampaignId']=_0x48d5e6[_0xdbdf('0x28')];}module[_0xdbdf('0x29')]=Hangup; \ No newline at end of file +var _0xe548=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','endtime','membername','IVR','reason','cause-txt','callback'];(function(_0x9e6237,_0x21fefa){var _0x5e1124=function(_0x3b5437){while(--_0x3b5437){_0x9e6237['push'](_0x9e6237['shift']());}};_0x5e1124(++_0x21fefa);}(_0xe548,0xef));var _0x8e54=function(_0x4da3b6,_0x233aff){_0x4da3b6=_0x4da3b6-0x0;var _0x574d38=_0xe548[_0x4da3b6];return _0x574d38;};'use strict';var moment=require(_0x8e54('0x0'));var utils=require(_0x8e54('0x1'));function Hangup(_0x1f4ca0,_0x2e5cab){this[_0x8e54('0x2')]=0x4;this[_0x8e54('0x3')]=_0x8e54('0x4');this['scheduledat']=_0x1f4ca0[_0x8e54('0x5')];this[_0x8e54('0x6')]=_0x1f4ca0['type'];this['campaigntype']=_0x1f4ca0[_0x8e54('0x6')]===_0x8e54('0x7')?_0x8e54('0x8'):_0x1f4ca0[_0x8e54('0x6')];this[_0x8e54('0x9')]=_0x1f4ca0[_0x8e54('0x9')]||![];this[_0x8e54('0xa')]=_0x1f4ca0['countbusyretry'];this['countcongestionretry']=_0x1f4ca0['countcongestionretry'];this[_0x8e54('0xb')]=_0x1f4ca0[_0x8e54('0xb')];this[_0x8e54('0xc')]=_0x1f4ca0['countbusyretry']+_0x1f4ca0[_0x8e54('0xd')]+_0x1f4ca0[_0x8e54('0xb')]+_0x1f4ca0[_0x8e54('0xe')]+_0x1f4ca0['countdropretry']+_0x1f4ca0[_0x8e54('0xf')]+_0x1f4ca0['countmachineretry']+_0x1f4ca0[_0x8e54('0x10')];this[_0x8e54('0xe')]=_0x1f4ca0[_0x8e54('0xe')];this[_0x8e54('0x11')]=_0x1f4ca0[_0x8e54('0x11')];this['countabandonedretry']=_0x1f4ca0['countabandonedretry'];this[_0x8e54('0x12')]=_0x1f4ca0['countmachineretry'];this[_0x8e54('0x10')]=_0x1f4ca0['countagentrejectretry'];this['uniqueid']=_0x2e5cab['uniqueid'];this[_0x8e54('0x13')]=_0x1f4ca0[_0x8e54('0x14')];this[_0x8e54('0x15')]=_0x1f4ca0[_0x8e54('0x16')];this[_0x8e54('0x17')]=_0x1f4ca0['starttime'];this['responsetime']=_0x1f4ca0[_0x8e54('0x18')];this['endtime']=moment()[_0x8e54('0x19')](_0x8e54('0x1a'));this[_0x8e54('0x1b')]=utils['getSeconds'](_0x1f4ca0[_0x8e54('0x18')],_0x1f4ca0['starttime']);this[_0x8e54('0x1c')]=0x0;this[_0x8e54('0x1d')]=utils[_0x8e54('0x1e')](this[_0x8e54('0x1f')],_0x1f4ca0[_0x8e54('0x18')]);this['queue']=_0x1f4ca0[_0x8e54('0x8')];this[_0x8e54('0x20')]=_0x8e54('0x21');this[_0x8e54('0x22')]=_0x2e5cab[_0x8e54('0x23')];this[_0x8e54('0x24')]=_0x1f4ca0[_0x8e54('0x24')];this[_0x8e54('0x25')]=_0x1f4ca0[_0x8e54('0x25')];this['callbackat']=_0x1f4ca0[_0x8e54('0x26')];this['recallme']=_0x1f4ca0[_0x8e54('0x27')];this[_0x8e54('0x28')]=_0x1f4ca0['ContactId'];this[_0x8e54('0x29')]=_0x1f4ca0[_0x8e54('0x29')];this['UserId']=_0x1f4ca0[_0x8e54('0x2a')];this[_0x8e54('0x2b')]=_0x1f4ca0[_0x8e54('0x2b')];this[_0x8e54('0x2c')]=_0x1f4ca0[_0x8e54('0x2c')];}module[_0x8e54('0x2d')]=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 44f7415..4ff8bad 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 _0xc63e=['CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','calleridname','name','number','starttime','responsetime','ringtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','VoiceQueueId'];(function(_0x134c95,_0x49ed19){var _0x5ac841=function(_0x442161){while(--_0x442161){_0x134c95['push'](_0x134c95['shift']());}};_0x5ac841(++_0x49ed19);}(_0xc63e,0x1d3));var _0xec63=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xc63e[_0x5d4f12];return _0x4eb577;};'use strict';var utils=require(_0xec63('0x0'));function History(_0x2c8f3d){this[_0xec63('0x1')]=_0x2c8f3d[_0xec63('0x1')];this['scheduledat']=_0x2c8f3d[_0xec63('0x2')]||undefined;this['type']=_0x2c8f3d[_0xec63('0x3')];this[_0xec63('0x4')]=_0x2c8f3d[_0xec63('0x3')]==='outbound'?_0xec63('0x5'):_0x2c8f3d['type'];this[_0xec63('0x6')]=_0x2c8f3d[_0xec63('0x6')];this[_0xec63('0x7')]=_0x2c8f3d[_0xec63('0x7')];this['countnoanswerretry']=_0x2c8f3d[_0xec63('0x8')];this[_0xec63('0x9')]=_0x2c8f3d[_0xec63('0x6')]+_0x2c8f3d[_0xec63('0x7')]+_0x2c8f3d[_0xec63('0x8')]+_0x2c8f3d[_0xec63('0xa')]+_0x2c8f3d['countdropretry']+_0x2c8f3d[_0xec63('0xb')]+_0x2c8f3d[_0xec63('0xc')]+_0x2c8f3d['countagentrejectretry'];this[_0xec63('0xa')]=_0x2c8f3d['countnosuchnumberretry'];this[_0xec63('0xd')]=_0x2c8f3d[_0xec63('0xd')];this[_0xec63('0xb')]=_0x2c8f3d[_0xec63('0xb')];this[_0xec63('0xc')]=_0x2c8f3d[_0xec63('0xc')];this['countagentrejectretry']=_0x2c8f3d['countagentrejectretry'];this[_0xec63('0x5')]=_0x2c8f3d['queue'];this[_0xec63('0xe')]=_0x2c8f3d[_0xec63('0xf')];this['calleridnum']=_0x2c8f3d[_0xec63('0x10')];this[_0xec63('0x11')]=_0x2c8f3d['starttime'];this[_0xec63('0x12')]=_0x2c8f3d[_0xec63('0x12')];this['endtime']=_0x2c8f3d[_0xec63('0x12')];this[_0xec63('0x13')]=utils[_0xec63('0x14')](_0x2c8f3d[_0xec63('0x12')],_0x2c8f3d[_0xec63('0x11')]);this['holdtime']=0x0;this[_0xec63('0x15')]=0x0;this[_0xec63('0x16')]=_0x2c8f3d[_0xec63('0x16')];this[_0xec63('0x17')]=_0x2c8f3d[_0xec63('0x17')];this[_0xec63('0x18')]=_0x2c8f3d[_0xec63('0x18')];this[_0xec63('0x19')]=_0x2c8f3d['recallme'];this['ContactId']=_0x2c8f3d['ContactId'];this[_0xec63('0x1a')]=_0x2c8f3d[_0xec63('0x1a')];this['UserId']=_0x2c8f3d['UserId'];this['VoiceQueueId']=_0x2c8f3d[_0xec63('0x1b')];this[_0xec63('0x1c')]=_0x2c8f3d['CampaignId'];this[_0xec63('0x1d')]=_0x2c8f3d['originatecalleridnum']||'';this[_0xec63('0x1e')]=_0x2c8f3d['originatecalleridname']||'';this['state']=_0x2c8f3d['state'];this[_0xec63('0x1f')]=_0x2c8f3d[_0xec63('0x1f')];}module[_0xec63('0x20')]=History; \ No newline at end of file +var _0x42d5=['ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId'];(function(_0x4d919f,_0x5b0e3b){var _0x521be6=function(_0x283ce3){while(--_0x283ce3){_0x4d919f['push'](_0x4d919f['shift']());}};_0x521be6(++_0x5b0e3b);}(_0x42d5,0x103));var _0x542d=function(_0x54a756,_0x5488ac){_0x54a756=_0x54a756-0x0;var _0xafce1d=_0x42d5[_0x54a756];return _0xafce1d;};'use strict';var utils=require('../utils');function History(_0xdcf01d){this[_0x542d('0x0')]=_0xdcf01d[_0x542d('0x0')];this[_0x542d('0x1')]=_0xdcf01d['scheduledat']||undefined;this['type']=_0xdcf01d[_0x542d('0x2')];this[_0x542d('0x3')]=_0xdcf01d['type']===_0x542d('0x4')?_0x542d('0x5'):_0xdcf01d[_0x542d('0x2')];this['countbusyretry']=_0xdcf01d[_0x542d('0x6')];this['countcongestionretry']=_0xdcf01d[_0x542d('0x7')];this[_0x542d('0x8')]=_0xdcf01d[_0x542d('0x8')];this[_0x542d('0x9')]=_0xdcf01d[_0x542d('0x6')]+_0xdcf01d['countcongestionretry']+_0xdcf01d[_0x542d('0x8')]+_0xdcf01d[_0x542d('0xa')]+_0xdcf01d[_0x542d('0xb')]+_0xdcf01d[_0x542d('0xc')]+_0xdcf01d[_0x542d('0xd')]+_0xdcf01d[_0x542d('0xe')];this['countnosuchnumberretry']=_0xdcf01d[_0x542d('0xa')];this[_0x542d('0xb')]=_0xdcf01d[_0x542d('0xb')];this['countabandonedretry']=_0xdcf01d[_0x542d('0xc')];this['countmachineretry']=_0xdcf01d[_0x542d('0xd')];this[_0x542d('0xe')]=_0xdcf01d[_0x542d('0xe')];this[_0x542d('0x5')]=_0xdcf01d[_0x542d('0x5')];this[_0x542d('0xf')]=_0xdcf01d[_0x542d('0x10')];this[_0x542d('0x11')]=_0xdcf01d[_0x542d('0x12')];this[_0x542d('0x13')]=_0xdcf01d[_0x542d('0x13')];this[_0x542d('0x14')]=_0xdcf01d[_0x542d('0x14')];this[_0x542d('0x15')]=_0xdcf01d[_0x542d('0x14')];this['ringtime']=utils[_0x542d('0x16')](_0xdcf01d['responsetime'],_0xdcf01d[_0x542d('0x13')]);this[_0x542d('0x17')]=0x0;this[_0x542d('0x18')]=0x0;this[_0x542d('0x19')]=_0xdcf01d[_0x542d('0x19')];this['callbackuniqueid']=_0xdcf01d[_0x542d('0x1a')];this[_0x542d('0x1b')]=_0xdcf01d[_0x542d('0x1b')];this['recallme']=_0xdcf01d['recallme'];this[_0x542d('0x1c')]=_0xdcf01d['ContactId'];this[_0x542d('0x1d')]=_0xdcf01d[_0x542d('0x1d')];this[_0x542d('0x1e')]=_0xdcf01d['UserId'];this['VoiceQueueId']=_0xdcf01d['VoiceQueueId'];this[_0x542d('0x1f')]=_0xdcf01d[_0x542d('0x1f')];this[_0x542d('0x20')]=_0xdcf01d[_0x542d('0x20')]||'';this[_0x542d('0x21')]=_0xdcf01d[_0x542d('0x21')]||'';this[_0x542d('0x22')]=_0xdcf01d['state'];this[_0x542d('0x23')]=_0xdcf01d['statedesc'];}module['exports']=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 62a54b0..cd2cd85 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 _0x767b=['type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','dropreason','droptime','ringtime','holdtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat'];(function(_0x2c1841,_0x505204){var _0x28d148=function(_0x5be79f){while(--_0x5be79f){_0x2c1841['push'](_0x2c1841['shift']());}};_0x28d148(++_0x505204);}(_0x767b,0xd0));var _0xb767=function(_0x25a1ac,_0x113c18){_0x25a1ac=_0x25a1ac-0x0;var _0x13ea3a=_0x767b[_0x25a1ac];return _0x13ea3a;};'use strict';var utils=require(_0xb767('0x0'));function QueueCallerAbandon(_0x17d9e0,_0x96ec90){this[_0xb767('0x1')]=_0x17d9e0[_0xb767('0x1')];this[_0xb767('0x2')]=_0x17d9e0['type'];this['campaigntype']=_0x17d9e0[_0xb767('0x2')]==='outbound'?_0xb767('0x3'):_0x17d9e0[_0xb767('0x2')];this[_0xb767('0x4')]=_0x17d9e0[_0xb767('0x4')];this[_0xb767('0x5')]=_0x17d9e0[_0xb767('0x5')];this[_0xb767('0x6')]=_0x17d9e0[_0xb767('0x6')];this[_0xb767('0x7')]=_0x17d9e0[_0xb767('0x4')]+_0x17d9e0[_0xb767('0x5')]+_0x17d9e0[_0xb767('0x6')]+_0x17d9e0[_0xb767('0x8')]+_0x17d9e0['countdropretry']+_0x17d9e0[_0xb767('0x9')]+_0x17d9e0[_0xb767('0xa')]+_0x17d9e0[_0xb767('0xb')];this[_0xb767('0x8')]=_0x17d9e0[_0xb767('0x8')];this[_0xb767('0xc')]=_0x17d9e0['countdropretry'];this[_0xb767('0x9')]=_0x17d9e0[_0xb767('0x9')];this[_0xb767('0xa')]=_0x17d9e0[_0xb767('0xa')];this[_0xb767('0xb')]=_0x17d9e0[_0xb767('0xb')];this['uniqueid']=_0x96ec90[_0xb767('0xd')];this[_0xb767('0xe')]=_0x17d9e0['name'];this[_0xb767('0xf')]=_0x17d9e0[_0xb767('0x10')];this['starttime']=_0x17d9e0[_0xb767('0x11')];this[_0xb767('0x12')]=_0x17d9e0[_0xb767('0x12')];this['droptime']=_0x17d9e0['droptime'];this[_0xb767('0x13')]=_0x17d9e0[_0xb767('0x13')];this['endtime']=this[_0xb767('0x14')];this[_0xb767('0x15')]=utils['getSeconds'](_0x17d9e0[_0xb767('0x12')],_0x17d9e0[_0xb767('0x11')]);this[_0xb767('0x16')]=utils[_0xb767('0x17')](this[_0xb767('0x14')],_0x17d9e0[_0xb767('0x12')]);this[_0xb767('0x18')]=0x0;this[_0xb767('0x3')]=_0x96ec90[_0xb767('0x3')];this[_0xb767('0x19')]=_0x96ec90[_0xb767('0x1a')];this[_0xb767('0x1b')]=_0x96ec90['reason'];this[_0xb767('0x1c')]=_0x17d9e0['callback'];this['callbackuniqueid']=_0x17d9e0['callbackuniqueid'];this['callbackat']=_0x17d9e0[_0xb767('0x1d')];this[_0xb767('0x1e')]=_0x17d9e0['recallme'];this[_0xb767('0x1f')]=_0x17d9e0[_0xb767('0x1f')];this['ListId']=_0x17d9e0[_0xb767('0x20')];this[_0xb767('0x21')]=_0x17d9e0[_0xb767('0x21')];this[_0xb767('0x22')]=_0x17d9e0[_0xb767('0x22')];this[_0xb767('0x23')]=_0x17d9e0['CampaignId'];this[_0xb767('0x24')]=_0x17d9e0[_0xb767('0x24')]||'';this[_0xb767('0x25')]=_0x17d9e0[_0xb767('0x25')]||'';this[_0xb767('0x26')]=_0x17d9e0[_0xb767('0x26')];this[_0xb767('0x27')]=_0x17d9e0[_0xb767('0x27')];this['statedesc']=_0x17d9e0[_0xb767('0x28')];}module[_0xb767('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x5288=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countabandonedretry'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x5288,0x112));var _0x8528=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5288[_0x17d9e3];return _0x14192d;};'use strict';var utils=require(_0x8528('0x0'));function QueueCallerAbandon(_0x5275e6,_0x2192a9){this[_0x8528('0x1')]=_0x5275e6[_0x8528('0x1')];this[_0x8528('0x2')]=_0x5275e6[_0x8528('0x2')];this[_0x8528('0x3')]=_0x5275e6[_0x8528('0x2')]==='outbound'?_0x8528('0x4'):_0x5275e6['type'];this[_0x8528('0x5')]=_0x5275e6[_0x8528('0x5')];this['countcongestionretry']=_0x5275e6['countcongestionretry'];this[_0x8528('0x6')]=_0x5275e6[_0x8528('0x6')];this[_0x8528('0x7')]=_0x5275e6[_0x8528('0x5')]+_0x5275e6[_0x8528('0x8')]+_0x5275e6[_0x8528('0x6')]+_0x5275e6[_0x8528('0x9')]+_0x5275e6['countdropretry']+_0x5275e6['countabandonedretry']+_0x5275e6[_0x8528('0xa')]+_0x5275e6[_0x8528('0xb')];this[_0x8528('0x9')]=_0x5275e6[_0x8528('0x9')];this['countdropretry']=_0x5275e6['countdropretry'];this[_0x8528('0xc')]=_0x5275e6[_0x8528('0xc')];this[_0x8528('0xa')]=_0x5275e6[_0x8528('0xa')];this[_0x8528('0xb')]=_0x5275e6[_0x8528('0xb')];this[_0x8528('0xd')]=_0x2192a9['uniqueid'];this[_0x8528('0xe')]=_0x5275e6[_0x8528('0xf')];this[_0x8528('0x10')]=_0x5275e6[_0x8528('0x11')];this[_0x8528('0x12')]=_0x5275e6[_0x8528('0x12')];this[_0x8528('0x13')]=_0x5275e6[_0x8528('0x13')];this[_0x8528('0x14')]=_0x5275e6['droptime'];this['dropreason']=_0x5275e6[_0x8528('0x15')];this[_0x8528('0x16')]=this[_0x8528('0x14')];this[_0x8528('0x17')]=utils[_0x8528('0x18')](_0x5275e6['responsetime'],_0x5275e6[_0x8528('0x12')]);this['holdtime']=utils[_0x8528('0x18')](this['droptime'],_0x5275e6[_0x8528('0x13')]);this[_0x8528('0x19')]=0x0;this[_0x8528('0x4')]=_0x2192a9[_0x8528('0x4')];this['membername']=_0x2192a9['connectedlinename'];this[_0x8528('0x1a')]=_0x2192a9[_0x8528('0x1a')];this[_0x8528('0x1b')]=_0x5275e6['callback'];this[_0x8528('0x1c')]=_0x5275e6['callbackuniqueid'];this[_0x8528('0x1d')]=_0x5275e6[_0x8528('0x1d')];this[_0x8528('0x1e')]=_0x5275e6[_0x8528('0x1e')];this[_0x8528('0x1f')]=_0x5275e6[_0x8528('0x1f')];this[_0x8528('0x20')]=_0x5275e6[_0x8528('0x20')];this[_0x8528('0x21')]=_0x5275e6['UserId'];this['VoiceQueueId']=_0x5275e6[_0x8528('0x22')];this['CampaignId']=_0x5275e6['CampaignId'];this[_0x8528('0x23')]=_0x5275e6[_0x8528('0x23')]||'';this[_0x8528('0x24')]=_0x5275e6[_0x8528('0x24')]||'';this[_0x8528('0x25')]=_0x5275e6[_0x8528('0x25')];this[_0x8528('0x26')]=_0x5275e6[_0x8528('0x26')];this[_0x8528('0x27')]=_0x5275e6['statedesc'];}module[_0x8528('0x28')]=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 5a8c3af..ce0f89b 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 _0x68b3=['../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper'];(function(_0x1068c2,_0xe81fac){var _0x5c15a6=function(_0x160350){while(--_0x160350){_0x1068c2['push'](_0x1068c2['shift']());}};_0x5c15a6(++_0xe81fac);}(_0x68b3,0x1d8));var _0x368b=function(_0x4923f4,_0x2cdb7c){_0x4923f4=_0x4923f4-0x0;var _0x45beaa=_0x68b3[_0x4923f4];return _0x45beaa;};'use strict';var util=require(_0x368b('0x0'));var logger=require(_0x368b('0x1'))(_0x368b('0x2'));var cmHopper=require(_0x368b('0x3'));var cmHopperAdditionalPhone=require(_0x368b('0x4'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x368b('0x5'));function inspectError(_0x3325ac){return util[_0x368b('0x6')](_0x3325ac,{'showHidden':![],'depth':null});}function getContactDialer(_0x404282,_0x5d68cb,_0x12eb8f){return cmHopper[_0x368b('0x7')](_0x404282['id'],_0x5d68cb,_0x12eb8f,_0x404282[_0x368b('0x8')])[_0x368b('0x9')](function(_0x4406c8){_0x404282[_0x368b('0xa')]=0x0;logger[_0x368b('0xb')](_0x368b('0xc'),inspectError(_0x4406c8));});}exports[_0x368b('0x7')]=getContactDialer;function getContactDialerIvr(_0x1f64d8,_0x2a7b9f){return cmHopper['getContactDialerIvr'](_0x1f64d8['id'],_0x2a7b9f,_0x1f64d8[_0x368b('0x8')])[_0x368b('0x9')](function(_0x34a110){_0x1f64d8['temp']=0x0;logger[_0x368b('0xb')](_0x368b('0xd'),inspectError(_0x34a110));});}exports[_0x368b('0xe')]=getContactDialerIvr;function countReScheduled(_0x5924a6){return cmHopper[_0x368b('0xf')](_0x5924a6)[_0x368b('0x9')](function(_0x514dc7){logger[_0x368b('0xb')](_0x368b('0x10'),inspectError(_0x514dc7));});}exports[_0x368b('0xf')]=countReScheduled;function rescheduleContact(_0x4015fe){return cmHopper[_0x368b('0x11')](_0x4015fe)['catch'](function(_0x2b326c){logger[_0x368b('0xb')]('[rescheduleContact]',inspectError(_0x2b326c));});}exports[_0x368b('0x11')]=rescheduleContact;function unlockContact(_0x2aabb9,_0x30c245,_0x515350){return cmHopper[_0x368b('0x12')](_0x2aabb9,_0x30c245,_0x515350)[_0x368b('0x9')](function(_0x1f1029){logger['error'](_0x368b('0x13'),inspectError(_0x1f1029));});}exports[_0x368b('0x12')]=unlockContact;function moveContactManagedDialer(_0x1c2956){return cmHopper['moveContactManagedDialer'](_0x1c2956)['catch'](function(_0x3e2e9f){logger[_0x368b('0xb')](_0x368b('0x14'),inspectError(_0x3e2e9f));});}exports[_0x368b('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x1a4f20){return cmHopperBlack['checkIsBlackList'](_0x1a4f20)[_0x368b('0x9')](function(_0x44cfe6){logger[_0x368b('0xb')](_0x368b('0x16'),inspectError(_0x44cfe6));});}exports[_0x368b('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x26b206){return cmHopperBlack[_0x368b('0x18')](_0x26b206)[_0x368b('0x9')](function(_0x508e48){logger[_0x368b('0xb')](_0x368b('0x19'),inspectError(_0x508e48));});}exports[_0x368b('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0xc0f7af,_0x286853,_0x4c2fca){return cmHopperAdditionalPhone[_0x368b('0x1a')](_0xc0f7af,_0x286853,_0x4c2fca)[_0x368b('0x9')](function(_0x3a22bd){logger[_0x368b('0xb')](_0x368b('0x1b'),inspectError(_0x3a22bd));});}exports[_0x368b('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x430e16,_0x11ea2d,_0x3123c1){return cmHopperAdditionalPhone[_0x368b('0x1c')](_0x430e16,_0x11ea2d,_0x3123c1)[_0x368b('0x9')](function(_0x344d8a){logger[_0x368b('0xb')](_0x368b('0x1d'),inspectError(_0x344d8a));});}exports[_0x368b('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x23a83a){return cmHopperHistory[_0x368b('0x1e')](_0x23a83a)[_0x368b('0x9')](function(_0x39ef94){logger[_0x368b('0xb')](_0x368b('0x1f'),inspectError(_0x39ef94));});}exports[_0x368b('0x1e')]=avgHandleTime;function createHistory(_0x107d2f){return cmHopperHistory[_0x368b('0x20')](_0x107d2f)['catch'](function(_0x4af77a){logger[_0x368b('0xb')](_0x368b('0x21'),inspectError(_0x4af77a));});}exports[_0x368b('0x20')]=createHistory; \ No newline at end of file +var _0x68b3=['../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper'];(function(_0x4129d8,_0x5f19e1){var _0x1f6d2c=function(_0x381ee1){while(--_0x381ee1){_0x4129d8['push'](_0x4129d8['shift']());}};_0x1f6d2c(++_0x5f19e1);}(_0x68b3,0x1d8));var _0x368b=function(_0x15b313,_0x558bf0){_0x15b313=_0x15b313-0x0;var _0x1d5e28=_0x68b3[_0x15b313];return _0x1d5e28;};'use strict';var util=require(_0x368b('0x0'));var logger=require(_0x368b('0x1'))(_0x368b('0x2'));var cmHopper=require(_0x368b('0x3'));var cmHopperAdditionalPhone=require(_0x368b('0x4'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x368b('0x5'));function inspectError(_0x3325ac){return util[_0x368b('0x6')](_0x3325ac,{'showHidden':![],'depth':null});}function getContactDialer(_0x404282,_0x5d68cb,_0x12eb8f){return cmHopper[_0x368b('0x7')](_0x404282['id'],_0x5d68cb,_0x12eb8f,_0x404282[_0x368b('0x8')])[_0x368b('0x9')](function(_0x4406c8){_0x404282[_0x368b('0xa')]=0x0;logger[_0x368b('0xb')](_0x368b('0xc'),inspectError(_0x4406c8));});}exports[_0x368b('0x7')]=getContactDialer;function getContactDialerIvr(_0x1f64d8,_0x2a7b9f){return cmHopper['getContactDialerIvr'](_0x1f64d8['id'],_0x2a7b9f,_0x1f64d8[_0x368b('0x8')])[_0x368b('0x9')](function(_0x34a110){_0x1f64d8['temp']=0x0;logger[_0x368b('0xb')](_0x368b('0xd'),inspectError(_0x34a110));});}exports[_0x368b('0xe')]=getContactDialerIvr;function countReScheduled(_0x5924a6){return cmHopper[_0x368b('0xf')](_0x5924a6)[_0x368b('0x9')](function(_0x514dc7){logger[_0x368b('0xb')](_0x368b('0x10'),inspectError(_0x514dc7));});}exports[_0x368b('0xf')]=countReScheduled;function rescheduleContact(_0x4015fe){return cmHopper[_0x368b('0x11')](_0x4015fe)['catch'](function(_0x2b326c){logger[_0x368b('0xb')]('[rescheduleContact]',inspectError(_0x2b326c));});}exports[_0x368b('0x11')]=rescheduleContact;function unlockContact(_0x2aabb9,_0x30c245,_0x515350){return cmHopper[_0x368b('0x12')](_0x2aabb9,_0x30c245,_0x515350)[_0x368b('0x9')](function(_0x1f1029){logger['error'](_0x368b('0x13'),inspectError(_0x1f1029));});}exports[_0x368b('0x12')]=unlockContact;function moveContactManagedDialer(_0x1c2956){return cmHopper['moveContactManagedDialer'](_0x1c2956)['catch'](function(_0x3e2e9f){logger[_0x368b('0xb')](_0x368b('0x14'),inspectError(_0x3e2e9f));});}exports[_0x368b('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x1a4f20){return cmHopperBlack['checkIsBlackList'](_0x1a4f20)[_0x368b('0x9')](function(_0x44cfe6){logger[_0x368b('0xb')](_0x368b('0x16'),inspectError(_0x44cfe6));});}exports[_0x368b('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x26b206){return cmHopperBlack[_0x368b('0x18')](_0x26b206)[_0x368b('0x9')](function(_0x508e48){logger[_0x368b('0xb')](_0x368b('0x19'),inspectError(_0x508e48));});}exports[_0x368b('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0xc0f7af,_0x286853,_0x4c2fca){return cmHopperAdditionalPhone[_0x368b('0x1a')](_0xc0f7af,_0x286853,_0x4c2fca)[_0x368b('0x9')](function(_0x3a22bd){logger[_0x368b('0xb')](_0x368b('0x1b'),inspectError(_0x3a22bd));});}exports[_0x368b('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x430e16,_0x11ea2d,_0x3123c1){return cmHopperAdditionalPhone[_0x368b('0x1c')](_0x430e16,_0x11ea2d,_0x3123c1)[_0x368b('0x9')](function(_0x344d8a){logger[_0x368b('0xb')](_0x368b('0x1d'),inspectError(_0x344d8a));});}exports[_0x368b('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x23a83a){return cmHopperHistory[_0x368b('0x1e')](_0x23a83a)[_0x368b('0x9')](function(_0x39ef94){logger[_0x368b('0xb')](_0x368b('0x1f'),inspectError(_0x39ef94));});}exports[_0x368b('0x1e')]=avgHandleTime;function createHistory(_0x107d2f){return cmHopperHistory[_0x368b('0x20')](_0x107d2f)['catch'](function(_0x4af77a){logger[_0x368b('0xb')](_0x368b('0x21'),inspectError(_0x4af77a));});}exports[_0x368b('0x20')]=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 bd2a4b7..b64fde8 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 _0xd154=['\x22\x22\x20<>','getCallerId','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','erlangb','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','description','length','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','ivr','isIVRCampaign','type','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd154,0x17c));var _0x4d15=function(_0x25a170,_0x3d493d){_0x25a170=_0x25a170-0x0;var _0x3b342c=_0xd154[_0x25a170];return _0x3b342c;};'use strict';var _=require(_0x4d15('0x0'));var moment=require('moment');var util=require(_0x4d15('0x1'));var logger=require('../../../../config/logger')(_0x4d15('0x2'));var timezones=require(_0x4d15('0x3'))[_0x4d15('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x4d15('0x5'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x4d15('0x6'),'DEACTIVATED':_0x4d15('0x7'),'DISACTIVED':_0x4d15('0x8'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x4d15('0x9'),'NO_AVAILABLE_CONTACTS':_0x4d15('0xa'),'NULL_INTERVAL':_0x4d15('0xb'),'OVERTIME_INTERVAL':_0x4d15('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0x4d15('0xd'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x4d15('0xe'),'RUNNING':_0x4d15('0xf'),'UNKNOWN_TIMEZONE':_0x4d15('0x10'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x4d15('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3b42c9){return _0x3b42c9[_0x4d15('0x12')]==='preview';}exports[_0x4d15('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x57b1e8){return _0x57b1e8['type']===_0x4d15('0x14');}exports[_0x4d15('0x15')]=isIVRCampaign;function isOutboundQueue(_0x1cad10){return _0x1cad10[_0x4d15('0x16')]===_0x4d15('0x17');}exports[_0x4d15('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x21e8f9){return _0x21e8f9[_0x4d15('0x19')];}exports[_0x4d15('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x1ce464){return _0x1ce464[_0x4d15('0x1b')];}exports[_0x4d15('0x1c')]=isIVRCampaignActive;function getSeconds(_0x33902a,_0x29ddf1){var _0x2db45e=moment(_0x33902a)[_0x4d15('0x1d')](0x0);var _0x56d081=moment(_0x29ddf1)[_0x4d15('0x1d')](0x0);return _0x2db45e[_0x4d15('0x1e')](_0x56d081,_0x4d15('0x1f'));}exports[_0x4d15('0x20')]=getSeconds;function hasQueueCampaignDataChanged(_0x1895ea,_0x4f9ebe){var _0x547fc7=![];var _0x4d374b=_0x1895ea[_0x4d15('0x12')]!==_0x4f9ebe[_0x4d15('0x12')]||_0x1895ea[_0x4d15('0x19')]!==_0x4f9ebe[_0x4d15('0x19')]||_0x1895ea['message']!==_0x4f9ebe[_0x4d15('0x21')];var _0x5ddfd0=_0x1895ea['available']!==_0x4f9ebe['available']||_0x1895ea[_0x4d15('0x22')]!==_0x4f9ebe[_0x4d15('0x22')]||_0x1895ea[_0x4d15('0x23')]!==_0x4f9ebe[_0x4d15('0x23')]||_0x1895ea['paused']!==_0x4f9ebe[_0x4d15('0x24')]||_0x1895ea[_0x4d15('0x25')]!==_0x4f9ebe[_0x4d15('0x25')]||_0x1895ea['pTalking']!==_0x4f9ebe[_0x4d15('0x26')]||_0x1895ea[_0x4d15('0x27')]!==_0x4f9ebe[_0x4d15('0x27')]||_0x1895ea[_0x4d15('0x28')]!==_0x4f9ebe[_0x4d15('0x28')]||_0x1895ea[_0x4d15('0x29')]!==_0x4f9ebe[_0x4d15('0x29')];if(_0x1895ea['Trunk']&&_0x4f9ebe[_0x4d15('0x2a')]){_0x547fc7=_0x1895ea[_0x4d15('0x2a')][_0x4d15('0x2b')]!==_0x4f9ebe[_0x4d15('0x2a')][_0x4d15('0x2b')]||_0x1895ea[_0x4d15('0x2a')][_0x4d15('0x1b')]!==_0x4f9ebe[_0x4d15('0x2a')][_0x4d15('0x1b')];}return _0x4d374b||_0x5ddfd0||_0x547fc7;}exports[_0x4d15('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x43792c){var _0x1addd0=null;var _0x538baa=_0x43792c[_0x4d15('0x2d')];if(_[_0x4d15('0x2e')](_0x43792c[_0x4d15('0x2f')])||_[_0x4d15('0x2e')](_0x43792c[_0x4d15('0x30')])||_[_0x4d15('0x2e')](_0x43792c[_0x4d15('0x30')]['Intervals'])){_0x1addd0=CAMPAIGN_STATUS[_0x4d15('0x31')];}else if(_[_0x4d15('0x32')](_0x43792c[_0x4d15('0x2f')])||_[_0x4d15('0x32')](_0x43792c[_0x4d15('0x30')][_0x4d15('0x33')])){_0x1addd0=CAMPAIGN_STATUS[_0x4d15('0x34')];}else if(_0x538baa&&!timezones[_0x538baa]){_0x1addd0=CAMPAIGN_STATUS[_0x4d15('0x35')];}return _0x1addd0;}function checkAnyValidTrunk(_0x10869c,_0xa5cf7c){var _0x5d5d2e=null;var _0x61c68d=_0x4d15('0x36');var _0x187365=[_0x4d15('0x37'),_0x4d15('0x38')];var _0x443e56=!![];if(_0x10869c['Trunk']&&_0x10869c[_0x4d15('0x2a')]['active']){_0x61c68d+=_0x10869c[_0x4d15('0x2a')][_0x4d15('0x2b')];_0x5d5d2e=_0xa5cf7c[_0x61c68d];_0x443e56=_0x187365[_0x4d15('0x39')](_0x5d5d2e[_0x4d15('0x3a')]);}else if(_0x10869c[_0x4d15('0x3b')]&&_0x10869c[_0x4d15('0x3b')][_0x4d15('0x1b')]){_0x61c68d+=_0x10869c['TrunkBackup'][_0x4d15('0x2b')];_0x5d5d2e=_0xa5cf7c[_0x61c68d];_0x443e56=_0x187365[_0x4d15('0x39')](_0x5d5d2e[_0x4d15('0x3a')]);}return _0x443e56;}function getQueueCampaignStatusMessage(_0xd815ef,_0x276127){var _0x36a162=CAMPAIGN_STATUS['ACTIVE'];var _0x4df42b=isPreviewCampaign(_0xd815ef);if(!isQueueCampaignActive(_0xd815ef)){if(_0x4df42b){_0x36a162=CAMPAIGN_STATUS[_0x4d15('0x3c')];}else{if(_0xd815ef[_0x4d15('0x29')]===0x0&&_0xd815ef[_0x4d15('0x25')]===0x0&&_0xd815ef[_0x4d15('0x27')]===0x0&&(_0xd815ef[_0x4d15('0x26')]||0x0)===0x0){_0x36a162=CAMPAIGN_STATUS[_0x4d15('0x3c')];}else{_0x36a162=CAMPAIGN_STATUS[_0x4d15('0x3d')];}}}else if(_0xd815ef[_0x4d15('0x22')]===0x0){_0x36a162=CAMPAIGN_STATUS[_0x4d15('0x3e')];}else if(!checkAnyValidTrunk(_0xd815ef,_0x276127)){_0x36a162=CAMPAIGN_STATUS[_0x4d15('0x3f')];}else if(!isPreviewCampaign(_0xd815ef)){var _0x1da257=checkAnyValidQueueCampaignInterval(_0xd815ef);if(_0x1da257){_0x36a162=_0x1da257;}}return _0x36a162;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x31e112){var _0x2d3d5c=CAMPAIGN_STATUS[_0x4d15('0x3d')];if(_0x31e112[_0x4d15('0x29')]===0x0&&_0x31e112[_0x4d15('0x25')]===0x0&&_0x31e112['waiting']===0x0&&(_0x31e112[_0x4d15('0x26')]||0x0)===0x0){_0x2d3d5c=CAMPAIGN_STATUS[_0x4d15('0x3c')];}return _0x2d3d5c;}exports[_0x4d15('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5f59b4){var _0xe6bc39=_0x5f59b4['match'](/"(.*?)"/);return _0xe6bc39?_0xe6bc39[0x1]:_0x5f59b4;}exports[_0x4d15('0x41')]=extractCalleridName;function getCallerId(_0x199d6d,_0x3aa0b9,_0x59f28f){if(!_[_0x4d15('0x42')](_0x59f28f)&&typeof _0x59f28f===_0x4d15('0x43')&&!_[_0x4d15('0x32')](_0x59f28f)){if(!_['isUndefined'](_0x3aa0b9)&&typeof _0x3aa0b9===_0x4d15('0x43')&&!_['isEmpty'](_0x3aa0b9)){return util['format'](_0x4d15('0x44'),_0x3aa0b9,_0x59f28f);}return util[_0x4d15('0x45')]('\x22%s\x22\x20<%s>',_0x59f28f,_0x59f28f);}if(!_[_0x4d15('0x42')](_0x199d6d)&&typeof _0x199d6d===_0x4d15('0x43')&&!_[_0x4d15('0x32')](_0x199d6d)){return _0x199d6d;}return _0x4d15('0x46');}exports[_0x4d15('0x47')]=getCallerId;function getCallerIdRandom(_0x501e9c,_0x1a97b6){var _0x118629;var _0x22f417;var _0x1857d3;if(_0x1a97b6<=0x0){_0x1a97b6=0x1;}_0x118629=new RegExp('\x5cw{0,'+_0x1a97b6+'}$');_0x22f417=Math[_0x4d15('0x48')](0xa,_0x1a97b6-0x1);_0x1857d3=Math[_0x4d15('0x48')](0xa,_0x1a97b6)-0x1;return util[_0x4d15('0x45')]('%s',_[_0x4d15('0x49')](_0x501e9c,_0x118629,_[_0x4d15('0x4a')](_0x22f417,_0x1857d3)[_0x4d15('0x4b')]()));}exports[_0x4d15('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x2f9747){if(_0x2f9747[_0x4d15('0x29')]&&_0x2f9747[_0x4d15('0x29')]>0x0){_0x2f9747[_0x4d15('0x29')]-=0x1;}else{logger['error'](_0x4d15('0x4d'));}}exports[_0x4d15('0x4e')]=decrementOriginate;function checkContactEmpty(_0x563d42){return _0x563d42&&_0x563d42['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x1f7046,_0x1d0cdf){if(_0x1d0cdf===0x0){return 0x0;}var _0x129d91=0x1;for(var _0x33422e=0x1;_0x33422e<=_0x1d0cdf;_0x33422e+=0x1){_0x129d91=0x1+_0x129d91*_0x33422e/_0x1f7046;}return 0x1/_0x129d91;}exports[_0x4d15('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x2e1795,_0x21e047,_0x44d8ee){if(_0x21e047>_0x44d8ee){for(var _0x1a56c6=0x0;_0x1a56c6<_0x21e047-_0x44d8ee;_0x1a56c6+=0x1){decrementOriginate(_0x2e1795);}}}exports[_0x4d15('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x54ebf7){var _0x2ce32a={};var _0x17c9ec=['id',_0x4d15('0x51'),'tags',_0x4d15('0x52')];const _0x12abd1=0xfa;if(_0x54ebf7){for(var _0x1dc05d in _0x54ebf7){if(typeof _0x54ebf7[_0x1dc05d]!==_0x4d15('0x53')){if(!_[_0x4d15('0x2e')](_0x54ebf7[_0x1dc05d])&&!_0x17c9ec[_0x4d15('0x39')](_0x1dc05d)){if(_0x1dc05d===_0x4d15('0x54')&&_0x54ebf7[_0x1dc05d][_0x4d15('0x55')]>_0x12abd1){_0x2ce32a[_0x4d15('0x56')+_0x1dc05d[_0x4d15('0x57')]()]=_0x54ebf7[_0x1dc05d][_0x4d15('0x4b')]()[_0x4d15('0x58')](0x0,_0x12abd1);}else{_0x2ce32a[_0x4d15('0x56')+_0x1dc05d[_0x4d15('0x57')]()]=_0x54ebf7[_0x1dc05d];}}}}}return _0x2ce32a;}exports[_0x4d15('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0x1dcd=['isEmpty','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x5cw{0,','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','timezones','ACTIVE','RESCHEDULED_CONTACTS','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','diff','seconds','message','available','loggedIn','loggedInDb','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x1dcd,0x1b8));var _0xd1dc=function(_0x3aecfa,_0x5bb070){_0x3aecfa=_0x3aecfa-0x0;var _0x228b31=_0x1dcd[_0x3aecfa];return _0x228b31;};'use strict';var _=require(_0xd1dc('0x0'));var moment=require(_0xd1dc('0x1'));var util=require(_0xd1dc('0x2'));var logger=require(_0xd1dc('0x3'))(_0xd1dc('0x4'));var timezones=require('../../../../config/environment/shared')[_0xd1dc('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xd1dc('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xd1dc('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xd1dc('0x8'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xd1dc('0x9'),'NO_AGENTS_LOGGED':_0xd1dc('0xa'),'NO_AVAILABLE_CONTACTS':_0xd1dc('0xb'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xd1dc('0xc'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xd1dc('0xd'),'RECALL_TIMEOUT':_0xd1dc('0xe'),'RUNNING':_0xd1dc('0xf'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xd1dc('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5ca9dd){return _0x5ca9dd[_0xd1dc('0x11')]===_0xd1dc('0x12');}exports[_0xd1dc('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x3cb6bc){return _0x3cb6bc[_0xd1dc('0x14')]===_0xd1dc('0x15');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x26094b){return _0x26094b[_0xd1dc('0x14')]===_0xd1dc('0x16');}exports[_0xd1dc('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x145aef){return _0x145aef[_0xd1dc('0x18')];}exports[_0xd1dc('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x18be8b){return _0x18be8b[_0xd1dc('0x1a')];}exports[_0xd1dc('0x1b')]=isIVRCampaignActive;function getSeconds(_0x2a65e5,_0x359a24){var _0x27f2dc=moment(_0x2a65e5)['milliseconds'](0x0);var _0x90deb4=moment(_0x359a24)['milliseconds'](0x0);return _0x27f2dc[_0xd1dc('0x1c')](_0x90deb4,_0xd1dc('0x1d'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x597b8e,_0x56c456){var _0x4b32c9=![];var _0x4d09e4=_0x597b8e[_0xd1dc('0x11')]!==_0x56c456['dialMethod']||_0x597b8e[_0xd1dc('0x18')]!==_0x56c456[_0xd1dc('0x18')]||_0x597b8e['message']!==_0x56c456[_0xd1dc('0x1e')];var _0x348d19=_0x597b8e[_0xd1dc('0x1f')]!==_0x56c456[_0xd1dc('0x1f')]||_0x597b8e[_0xd1dc('0x20')]!==_0x56c456[_0xd1dc('0x20')]||_0x597b8e[_0xd1dc('0x21')]!==_0x56c456[_0xd1dc('0x21')]||_0x597b8e['paused']!==_0x56c456['paused']||_0x597b8e[_0xd1dc('0x22')]!==_0x56c456[_0xd1dc('0x22')]||_0x597b8e[_0xd1dc('0x23')]!==_0x56c456[_0xd1dc('0x23')]||_0x597b8e[_0xd1dc('0x24')]!==_0x56c456[_0xd1dc('0x24')]||_0x597b8e[_0xd1dc('0x25')]!==_0x56c456['inUse']||_0x597b8e[_0xd1dc('0x26')]!==_0x56c456['originated'];if(_0x597b8e['Trunk']&&_0x56c456[_0xd1dc('0x27')]){_0x4b32c9=_0x597b8e[_0xd1dc('0x27')][_0xd1dc('0x28')]!==_0x56c456[_0xd1dc('0x27')][_0xd1dc('0x28')]||_0x597b8e[_0xd1dc('0x27')][_0xd1dc('0x1a')]!==_0x56c456[_0xd1dc('0x27')][_0xd1dc('0x1a')];}return _0x4d09e4||_0x348d19||_0x4b32c9;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x37a786){var _0x1d0325=null;var _0x233eed=_0x37a786[_0xd1dc('0x29')];if(_['isNil'](_0x37a786[_0xd1dc('0x2a')])||_[_0xd1dc('0x2b')](_0x37a786[_0xd1dc('0x2c')])||_[_0xd1dc('0x2b')](_0x37a786[_0xd1dc('0x2c')][_0xd1dc('0x2d')])){_0x1d0325=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xd1dc('0x2e')](_0x37a786[_0xd1dc('0x2a')])||_[_0xd1dc('0x2e')](_0x37a786[_0xd1dc('0x2c')][_0xd1dc('0x2d')])){_0x1d0325=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x233eed&&!timezones[_0x233eed]){_0x1d0325=CAMPAIGN_STATUS[_0xd1dc('0x2f')];}return _0x1d0325;}function checkAnyValidTrunk(_0x277152,_0x5e4edb){var _0x20bbf9=null;var _0x38e90e=_0xd1dc('0x30');var _0x4c747e=['reachable',_0xd1dc('0x31')];var _0x3dcd4e=!![];if(_0x277152[_0xd1dc('0x27')]&&_0x277152[_0xd1dc('0x27')][_0xd1dc('0x1a')]){_0x38e90e+=_0x277152['Trunk']['name'];_0x20bbf9=_0x5e4edb[_0x38e90e];_0x3dcd4e=_0x4c747e[_0xd1dc('0x32')](_0x20bbf9[_0xd1dc('0x33')]);}else if(_0x277152[_0xd1dc('0x34')]&&_0x277152['TrunkBackup']['active']){_0x38e90e+=_0x277152['TrunkBackup']['name'];_0x20bbf9=_0x5e4edb[_0x38e90e];_0x3dcd4e=_0x4c747e[_0xd1dc('0x32')](_0x20bbf9[_0xd1dc('0x33')]);}return _0x3dcd4e;}function getQueueCampaignStatusMessage(_0x5d151f,_0x1712f6){var _0x184d2b=CAMPAIGN_STATUS[_0xd1dc('0x6')];var _0x263db8=isPreviewCampaign(_0x5d151f);if(!isQueueCampaignActive(_0x5d151f)){if(_0x263db8){_0x184d2b=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x5d151f[_0xd1dc('0x26')]===0x0&&_0x5d151f[_0xd1dc('0x22')]===0x0&&_0x5d151f[_0xd1dc('0x24')]===0x0&&(_0x5d151f[_0xd1dc('0x23')]||0x0)===0x0){_0x184d2b=CAMPAIGN_STATUS[_0xd1dc('0x35')];}else{_0x184d2b=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x5d151f[_0xd1dc('0x20')]===0x0){_0x184d2b=CAMPAIGN_STATUS[_0xd1dc('0x36')];}else if(!checkAnyValidTrunk(_0x5d151f,_0x1712f6)){_0x184d2b=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x5d151f)){var _0x2a3a3f=checkAnyValidQueueCampaignInterval(_0x5d151f);if(_0x2a3a3f){_0x184d2b=_0x2a3a3f;}}return _0x184d2b;}exports[_0xd1dc('0x37')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x249e6a){var _0x422607=CAMPAIGN_STATUS['DISACTIVED'];if(_0x249e6a[_0xd1dc('0x26')]===0x0&&_0x249e6a[_0xd1dc('0x22')]===0x0&&_0x249e6a['waiting']===0x0&&(_0x249e6a[_0xd1dc('0x23')]||0x0)===0x0){_0x422607=CAMPAIGN_STATUS[_0xd1dc('0x35')];}return _0x422607;}exports[_0xd1dc('0x38')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1475ed){var _0x1e4021=_0x1475ed['match'](/"(.*?)"/);return _0x1e4021?_0x1e4021[0x1]:_0x1475ed;}exports[_0xd1dc('0x39')]=extractCalleridName;function getCallerId(_0x3b624b,_0x23aeb2,_0x1363d1){if(!_['isUndefined'](_0x1363d1)&&typeof _0x1363d1==='string'&&!_['isEmpty'](_0x1363d1)){if(!_[_0xd1dc('0x3a')](_0x23aeb2)&&typeof _0x23aeb2===_0xd1dc('0x3b')&&!_[_0xd1dc('0x2e')](_0x23aeb2)){return util[_0xd1dc('0x3c')](_0xd1dc('0x3d'),_0x23aeb2,_0x1363d1);}return util[_0xd1dc('0x3c')](_0xd1dc('0x3d'),_0x1363d1,_0x1363d1);}if(!_[_0xd1dc('0x3a')](_0x3b624b)&&typeof _0x3b624b===_0xd1dc('0x3b')&&!_['isEmpty'](_0x3b624b)){return _0x3b624b;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x6d75e2,_0x37b6e4){var _0x5c146a;var _0x1346c4;var _0x208383;if(_0x37b6e4<=0x0){_0x37b6e4=0x1;}_0x5c146a=new RegExp(_0xd1dc('0x3e')+_0x37b6e4+'}$');_0x1346c4=Math['pow'](0xa,_0x37b6e4-0x1);_0x208383=Math['pow'](0xa,_0x37b6e4)-0x1;return util['format']('%s',_[_0xd1dc('0x3f')](_0x6d75e2,_0x5c146a,_['random'](_0x1346c4,_0x208383)[_0xd1dc('0x40')]()));}exports[_0xd1dc('0x41')]=getCallerIdRandom;function decrementOriginate(_0x238d55){if(_0x238d55[_0xd1dc('0x26')]&&_0x238d55[_0xd1dc('0x26')]>0x0){_0x238d55[_0xd1dc('0x26')]-=0x1;}else{logger[_0xd1dc('0x42')](_0xd1dc('0x43'));}}exports[_0xd1dc('0x44')]=decrementOriginate;function checkContactEmpty(_0x16c83a){return _0x16c83a&&_0x16c83a[_0xd1dc('0x45')]>0x0;}exports[_0xd1dc('0x46')]=checkContactEmpty;function erlangb(_0x499028,_0x2e9369){if(_0x2e9369===0x0){return 0x0;}var _0x22332e=0x1;for(var _0x414720=0x1;_0x414720<=_0x2e9369;_0x414720+=0x1){_0x22332e=0x1+_0x22332e*_0x414720/_0x499028;}return 0x1/_0x22332e;}exports[_0xd1dc('0x47')]=erlangb;function checkContactLowerLimitOriginate(_0x10b8dc,_0x1a930a,_0x1c1477){if(_0x1a930a>_0x1c1477){for(var _0x2f1dfb=0x0;_0x2f1dfb<_0x1a930a-_0x1c1477;_0x2f1dfb+=0x1){decrementOriginate(_0x10b8dc);}}}exports[_0xd1dc('0x48')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4ab249){var _0x4c1d48={};var _0x268f0e=['id',_0xd1dc('0x49'),'tags',_0xd1dc('0x4a')];const _0x4942ac=0xfa;if(_0x4ab249){for(var _0x502a1a in _0x4ab249){if(typeof _0x4ab249[_0x502a1a]!==_0xd1dc('0x4b')){if(!_[_0xd1dc('0x2b')](_0x4ab249[_0x502a1a])&&!_0x268f0e[_0xd1dc('0x32')](_0x502a1a)){if(_0x502a1a===_0xd1dc('0x4c')&&_0x4ab249[_0x502a1a][_0xd1dc('0x45')]>_0x4942ac){_0x4c1d48[_0xd1dc('0x4d')+_0x502a1a[_0xd1dc('0x4e')]()]=_0x4ab249[_0x502a1a]['toString']()[_0xd1dc('0x4f')](0x0,_0x4942ac);}else{_0x4c1d48[_0xd1dc('0x4d')+_0x502a1a[_0xd1dc('0x4e')]()]=_0x4ab249[_0x502a1a];}}}}}return _0x4c1d48;}exports[_0xd1dc('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 e6bfb1f..cdb6964 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(_0x16f8d6,_0xeae008){var _0x30d2ff=function(_0x1e5cd9){while(--_0x1e5cd9){_0x16f8d6['push'](_0x16f8d6['shift']());}};_0x30d2ff(++_0xeae008);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x24ec31,_0x6498f){var _0x4fdb44=function(_0x4508eb){while(--_0x4508eb){_0x24ec31['push'](_0x24ec31['shift']());}};_0x4fdb44(++_0x6498f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index fedf166..092b87e 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 _0x95a5=['[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','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','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','deleteChannelAfterTimeout','exports','util','lodash','bluebird','uuid','moment','path','../../../config/logger','fax','../ami','./rpcDb','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','varset','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','syncVarSet','variable','value','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95a5,0x179));var _0x595a=function(_0xc1967,_0x33a731){_0xc1967=_0xc1967-0x0;var _0x320c77=_0x95a5[_0xc1967];return _0x320c77;};'use strict';var util=require(_0x595a('0x0'));var _=require(_0x595a('0x1'));var BPromise=require(_0x595a('0x2'));var uuid=require(_0x595a('0x3'));var moment=require(_0x595a('0x4'));var path=require(_0x595a('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x595a('0x6'))(_0x595a('0x7'));var ami=require(_0x595a('0x8'));var rpcDb=require(_0x595a('0x9'));var Channel=require('./channel');var ut=require(_0x595a('0xa'));var Action=require('./action');var faxAccount=require(_0x595a('0xb'));var attachment=require(_0x595a('0xc'));var faxMessage=require(_0x595a('0xd'));function Fax(_0x505347){this[_0x595a('0xe')]={};this[_0x595a('0xf')]=_0x505347['faxAccounts'];this[_0x595a('0x10')]=_0x505347['trunks'];this[_0x595a('0x11')]={};ami['on']('newchannel',this[_0x595a('0x12')]['bind'](this));ami['on'](_0x595a('0x13'),this['syncVarSet'][_0x595a('0x14')](this));ami['on'](_0x595a('0x15'),this['syncNewState'][_0x595a('0x14')](this));ami['on'](_0x595a('0x16'),this[_0x595a('0x17')][_0x595a('0x14')](this));ami['on'](_0x595a('0x18'),this[_0x595a('0x19')][_0x595a('0x14')](this));ami['on'](_0x595a('0x1a'),this[_0x595a('0x1b')]['bind'](this));ami['on'](_0x595a('0x1c'),this[_0x595a('0x1d')][_0x595a('0x14')](this));ami['on'](_0x595a('0x1e'),this[_0x595a('0x1f')][_0x595a('0x14')](this));}Fax['prototype'][_0x595a('0x12')]=function(_0x139951){if(_0x139951[_0x595a('0x20')]==='from-voip-provider'){for(var _0x2d4fe8 in this[_0x595a('0xf')]){if(this[_0x595a('0xf')][_0x595a('0x21')](_0x2d4fe8)){if(_0x139951[_0x595a('0x22')]===this[_0x595a('0xf')][_0x2d4fe8][_0x595a('0x23')]){this['channels'][_0x139951[_0x595a('0x24')]]={};this[_0x595a('0xe')][_0x139951[_0x595a('0x24')]][_0x595a('0x25')]=_0x139951['channel'];this[_0x595a('0xe')][_0x139951[_0x595a('0x24')]]['id']=this['faxAccounts'][_0x2d4fe8]['id'];this['channels'][_0x139951[_0x595a('0x24')]][_0x595a('0x26')]=this[_0x595a('0xf')][_0x2d4fe8][_0x595a('0x26')];logger[_0x595a('0x27')](_0x139951[_0x595a('0x24')],_0x595a('0x28'));}}}}if(this[_0x595a('0x11')][_0x139951[_0x595a('0x24')]]){this[_0x595a('0xe')][_0x139951[_0x595a('0x24')]]={};this[_0x595a('0xe')][_0x139951[_0x595a('0x24')]]['channel']=_0x139951[_0x595a('0x25')];logger['info'](_0x139951[_0x595a('0x24')],_0x595a('0x28'));}};Fax[_0x595a('0x29')][_0x595a('0x2a')]=function(_0x385ee0){if(this[_0x595a('0xe')][_0x385ee0[_0x595a('0x24')]]){for(var _0x11b733 in _0x385ee0[_0x595a('0x2b')]){if(_0x385ee0[_0x595a('0x2b')][_0x595a('0x21')](_0x11b733)){this['channels'][_0x385ee0['uniqueid']][_0x11b733]=_0x385ee0[_0x595a('0x2c')];}}}};Fax[_0x595a('0x29')]['syncNewState']=function(_0x196415){if(this[_0x595a('0xe')][_0x196415[_0x595a('0x24')]]){this[_0x595a('0xe')][_0x196415['uniqueid']]['channelstate']=_0x196415['channelstate'];this['channels'][_0x196415['uniqueid']][_0x595a('0x2d')]=_0x196415['channelstatedesc'];}};Fax['prototype'][_0x595a('0x17')]=function(_0x5f14df){if(this['channels'][_0x5f14df[_0x595a('0x24')]]){for(var _0x3d6163 in _0x5f14df[_0x595a('0x2b')]){if(_0x5f14df[_0x595a('0x2b')]['hasOwnProperty'](_0x3d6163)){this[_0x595a('0xe')][_0x5f14df[_0x595a('0x24')]][_0x3d6163]=_0x5f14df[_0x595a('0x2c')];}}}};Fax[_0x595a('0x29')]['syncFaxStatus']=function(_0x590b4e){if(this['channels'][_0x590b4e['uniqueid']]){this['channels'][_0x590b4e[_0x595a('0x24')]]['operation']=_0x590b4e[_0x595a('0x2e')];this[_0x595a('0xe')][_0x590b4e[_0x595a('0x24')]][_0x595a('0x2f')]=_0x590b4e['status'];this[_0x595a('0xe')][_0x590b4e[_0x595a('0x24')]][_0x595a('0x23')]=_0x590b4e[_0x595a('0x23')];this['channels'][_0x590b4e['uniqueid']]['filename']=_0x590b4e[_0x595a('0x30')];logger[_0x595a('0x27')](_0x590b4e[_0x595a('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x595a('0x29')]['syncReceiveFax']=function(_0xd63fba){var _0x101c07=this;if(this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]]){var _0x5037d5=this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]]['id'];this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]][_0x595a('0x31')]=_0xd63fba[_0x595a('0x31')];this['channels'][_0xd63fba[_0x595a('0x24')]]['pagestransferred']=_0xd63fba[_0x595a('0x32')];this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]][_0x595a('0x23')]=_0xd63fba[_0x595a('0x23')];this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]][_0x595a('0x33')]=_0xd63fba[_0x595a('0x33')];this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]][_0x595a('0x34')]=_0xd63fba[_0x595a('0x34')];this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]]['filename']=_0xd63fba[_0x595a('0x30')];this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]][_0x595a('0x35')]=_0xd63fba[_0x595a('0x35')];if(this[_0x595a('0xe')][_0xd63fba[_0x595a('0x24')]][_0x595a('0x32')]>0x0){tiff2pdf(_0xd63fba[_0x595a('0x30')],_0x595a('0x36'),function(_0x1faaf8){logger['info'](_0xd63fba[_0x595a('0x24')],_0x595a('0x37'),_0x1faaf8[_0x595a('0x38')]);attachment[_0x595a('0x39')]({'name':path['parse'](_0xd63fba[_0x595a('0x30')])[_0x595a('0x26')],'basename':path[_0x595a('0x3a')](_0xd63fba[_0x595a('0x30')])[_0x595a('0x26')]+_0x595a('0x3b'),'type':_0x595a('0x3c')})['then'](function(_0x3b2cfc){faxAccount[_0x595a('0x3d')](_0x5037d5,{'from':_0xd63fba[_0x595a('0x35')],'mapKey':_0x595a('0x7'),'body':path[_0x595a('0x3a')](_0xd63fba['filename'])[_0x595a('0x26')]+_0x595a('0x3b'),'AttachmentId':_0x3b2cfc['id']})[_0x595a('0x3e')](function(_0x12accd){logger['error'](_0xd63fba[_0x595a('0x24')],_0x595a('0x3f'),JSON[_0x595a('0x40')](_0x12accd));});})[_0x595a('0x3e')](function(_0x500972){logger['error'](_0xd63fba[_0x595a('0x24')],_0x595a('0x41'),JSON[_0x595a('0x40')](_0x500972));});});}logger[_0x595a('0x27')](_0xd63fba[_0x595a('0x24')],_0x595a('0x41'));}};Fax[_0x595a('0x29')]['syncOriginateResponse']=function(_0x2e365b){if(this[_0x595a('0x11')][_0x2e365b[_0x595a('0x24')]]){_[_0x595a('0x42')](this[_0x595a('0xe')][_0x2e365b['uniqueid']],_[_0x595a('0x43')](_0x2e365b,['response',_0x595a('0x44')]));}};function updateStatus(_0x24cf4e){if(_0x24cf4e[_0x595a('0x45')]){faxMessage[_0x595a('0x46')](_0x24cf4e[_0x595a('0x45')],{'failMessage':_0x595a('0x47')})[_0x595a('0x48')](function(_0x10b831){ut[_0x595a('0x49')](_0x595a('0x4a'),_0x10b831);})['catch'](function(_0x2a8dbb){ut[_0x595a('0x49')](_0x595a('0x4b'),_0x2a8dbb);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x595a('0x4c')]=function(_0x405b65,_0x745a9a,_0x21e92a){var _0x147d98=this;var _0x5f5dd7={};if(_0x745a9a){_0x5f5dd7={'read':_0x745a9a};}else{_0x5f5dd7={'failMessage':_0x21e92a};}if(this[_0x595a('0x11')][_0x405b65][_0x595a('0x45')]){faxMessage['update'](this['actions'][_0x405b65][_0x595a('0x45')],_0x5f5dd7)[_0x595a('0x48')](function(_0x5a51d7){ut[_0x595a('0x49')]('[Fax][Message][Updated]',_0x5a51d7);})[_0x595a('0x3e')](function(_0x1e717d){ut[_0x595a('0x49')](_0x595a('0x4d'),_0x1e717d);})[_0x595a('0x4e')](function(){delete _0x147d98[_0x595a('0xe')][_0x405b65];delete _0x147d98[_0x595a('0x11')][_0x405b65];});}else{ut[_0x595a('0x49')](_0x595a('0x4f'));this['deleteChannelAfterTimeout'](_0x405b65);delete this[_0x595a('0x11')][_0x405b65];}};Fax[_0x595a('0x29')][_0x595a('0x1d')]=function(_0x41a060){var _0x2eab21=this;if(this['channels'][_0x41a060[_0x595a('0x24')]]){if(this[_0x595a('0x11')][_0x41a060[_0x595a('0x24')]]){this['channels'][_0x41a060[_0x595a('0x24')]]['id']=this[_0x595a('0x11')][_0x41a060['uniqueid']]['id'];this[_0x595a('0xe')][_0x41a060['uniqueid']][_0x595a('0x26')]=this[_0x595a('0x11')][_0x41a060[_0x595a('0x24')]][_0x595a('0x26')];}logger[_0x595a('0x27')](_0x41a060[_0x595a('0x24')],this[_0x595a('0x11')][_0x41a060['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x595a('0x50'),JSON['stringify'](this[_0x595a('0xe')][_0x41a060['uniqueid']]));if(this[_0x595a('0x11')][_0x41a060[_0x595a('0x24')]]){if(this['channels'][_0x41a060[_0x595a('0x24')]][_0x595a('0x51')]>0x0&&this[_0x595a('0xe')][_0x41a060[_0x595a('0x24')]][_0x595a('0x18')]===_0x595a('0x52')){this[_0x595a('0x4c')](_0x41a060['uniqueid'],!![]);}else{this[_0x595a('0x4c')](_0x41a060[_0x595a('0x24')],![],this[_0x595a('0xe')][_0x41a060[_0x595a('0x24')]][_0x595a('0x53')]?_0x595a('0x54')+this[_0x595a('0xe')][_0x41a060[_0x595a('0x24')]][_0x595a('0x53')]:_0x595a('0x55'));}}}};Fax[_0x595a('0x29')]['send']=function(_0xc47ff6){var _0xdaa0d4=this;return new BPromise(function(_0x364fdf,_0x162c83){_0xdaa0d4[_0x595a('0x56')](_0xc47ff6,_0xdaa0d4[_0x595a('0xf')][_0xc47ff6['FaxAccountId']])['then'](function(_0x3cbfe7){ut[_0x595a('0x49')](_0x595a('0x57'),_0x3cbfe7);_0x364fdf(ut[_0x595a('0x38')](_0x595a('0x58')));})[_0x595a('0x3e')](function(_0x2431f9){ut['logger'](_0x595a('0x59'),_0x2431f9);updateStatus(_0xc47ff6);_0x162c83(ut['message']('Fax\x20failed'));});});};Fax['prototype'][_0x595a('0x5a')]=function(_0x62f1a8){var _0x27d7f7=this;return new BPromise(function(_0xb990ed,_0x8df183){var _0x3a2ea5=_0x27d7f7[_0x595a('0x5b')](_0x27d7f7['faxAccounts'][_0x62f1a8[_0x595a('0x5c')]][_0x595a('0x5d')],_0x62f1a8);if(_0x3a2ea5[_0x595a('0x5e')]){_0xb990ed(ut[_0x595a('0x38')](_0x595a('0x5f')));}else{_0x8df183(ut[_0x595a('0x38')](_0x3a2ea5['message']));}});};function originate(_0x9f0dcb,_0x37070d,_0x46b9c0){return new BPromise(function(_0x518f91,_0x51afbb){if(_0x46b9c0){var _0x26fd0b=util[_0x595a('0x60')](_0x595a('0x61'),path['parse'](_0x9f0dcb[_0x595a('0x5')])[_0x595a('0x26')],_0x9f0dcb['path']);gs[_0x595a('0x62')](_0x26fd0b)[_0x595a('0x48')](function(){_0x9f0dcb['path']=util[_0x595a('0x60')]('%s/%s.tif',path['parse'](_0x9f0dcb[_0x595a('0x5')])['dir'],path[_0x595a('0x3a')](_0x9f0dcb[_0x595a('0x5')])[_0x595a('0x26')]);_0x37070d[_0x595a('0x63')]=_0x9f0dcb[_0x595a('0x5')];ut[_0x595a('0x49')]('Convert\x20pdf\x20to\x20tif','');ami[_0x595a('0x64')](ut['variablesAction'](_0x9f0dcb,_0x37070d))[_0x595a('0x48')](function(_0x588f17){_0x518f91(_0x588f17);})[_0x595a('0x3e')](function(_0x2a9044){_0x51afbb(_0x2a9044);});})[_0x595a('0x3e')](function(_0x2a4794){_0x51afbb(_0x2a4794);});}else{ami[_0x595a('0x64')](ut[_0x595a('0x65')](_0x9f0dcb,_0x37070d))['then'](function(_0x544ad4){_0x518f91(_0x544ad4);})[_0x595a('0x3e')](function(_0x9e7d85){_0x51afbb(_0x9e7d85);});}});}Fax['prototype'][_0x595a('0x56')]=function(_0x1e1421,_0x1b9278){var _0x3ddab4=this;return new BPromise(function(_0x1f78a0,_0x52c0b6){var _0x20b6dd=uuid['v4']();var _0x5607ab=ut[_0x595a('0x66')](_0x1e1421,_0x1b9278);_0x3ddab4[_0x595a('0x11')][_0x20b6dd]=new Action(_0x20b6dd,_0x1b9278,_0x1e1421);var _0xc0d86d=_0x3ddab4['actions'][_0x20b6dd];if(path[_0x595a('0x3a')](_0x1e1421['path'])[_0x595a('0x67')]===_0x595a('0x3b')){originate(_0xc0d86d,_0x5607ab,!![])[_0x595a('0x48')](function(_0x38c7af){_0x1f78a0(_0x38c7af);})[_0x595a('0x3e')](function(_0x1a36bc){_0x52c0b6(_0x1a36bc);});}else{originate(_0xc0d86d,_0x5607ab,![])['then'](function(_0x3b66c2){_0x1f78a0(_0x3b66c2);})[_0x595a('0x3e')](function(_0x1e83aa){_0x52c0b6(_0x1e83aa);});}});};Fax['prototype'][_0x595a('0x68')]=function(_0x6b7810){return!_['isNil'](_0x6b7810)&&!_[_0x595a('0x69')](_0x6b7810['name'])&&!_[_0x595a('0x69')](_0x6b7810[_0x595a('0x6a')])&&_0x6b7810[_0x595a('0x6a')]&&!_['isNil'](this[_0x595a('0x10')][util['format'](_0x595a('0x6b'),_0x6b7810['name'])])&&!_[_0x595a('0x69')](this[_0x595a('0x10')][util[_0x595a('0x60')](_0x595a('0x6b'),_0x6b7810[_0x595a('0x26')])][_0x595a('0x2f')])&&(this[_0x595a('0x10')][util[_0x595a('0x60')](_0x595a('0x6b'),_0x6b7810['name'])][_0x595a('0x2f')]==='reachable'||this[_0x595a('0x10')][util[_0x595a('0x60')](_0x595a('0x6b'),_0x6b7810['name'])]['status']==='unmonitored');};Fax[_0x595a('0x29')][_0x595a('0x5b')]=function(_0x112905,_0xa89e){if(!this[_0x595a('0x68')](_0x112905)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x595a('0x69')](_0x112905)?'':_0x112905[_0x595a('0x26')]+_0x595a('0x6c'));return{'isValid':![],'message':_0x595a('0x6d')};}if(_[_0x595a('0x69')](_0xa89e[_0x595a('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0xa89e));return{'isValid':![],'message':_0x595a('0x6e')};}if(_[_0x595a('0x69')](_0xa89e[_0x595a('0x5')])){ut[_0x595a('0x49')](_0x595a('0x6f'),JSON[_0x595a('0x40')](_0xa89e));return{'isValid':![],'message':_0x595a('0x70')};}return{'isValid':!![],'message':_0x595a('0x71')};};Fax[_0x595a('0x29')][_0x595a('0x72')]=function(_0x222caf,_0x5872d6=0x2710){if(this[_0x595a('0xe')][_0x222caf]){setTimeout(()=>{delete this['channels'][_0x222caf];},_0x5872d6);}};module[_0x595a('0x73')]=Fax; \ No newline at end of file +var _0x83aa=['\x20receiveFax\x20','merge','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','checkAfterSend','checkTrunk','FaxAccountId','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','operation','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify'];(function(_0x1539d9,_0x9981f6){var _0x40fbef=function(_0x11c845){while(--_0x11c845){_0x1539d9['push'](_0x1539d9['shift']());}};_0x40fbef(++_0x9981f6);}(_0x83aa,0xaf));var _0xa83a=function(_0x1d2064,_0x47aef1){_0x1d2064=_0x1d2064-0x0;var _0x269138=_0x83aa[_0x1d2064];return _0x269138;};'use strict';var util=require(_0xa83a('0x0'));var _=require(_0xa83a('0x1'));var BPromise=require('bluebird');var uuid=require(_0xa83a('0x2'));var moment=require(_0xa83a('0x3'));var path=require(_0xa83a('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xa83a('0x5'));var logger=require(_0xa83a('0x6'))(_0xa83a('0x7'));var ami=require('../ami');var rpcDb=require(_0xa83a('0x8'));var Channel=require(_0xa83a('0x9'));var ut=require(_0xa83a('0xa'));var Action=require(_0xa83a('0xb'));var faxAccount=require(_0xa83a('0xc'));var attachment=require(_0xa83a('0xd'));var faxMessage=require(_0xa83a('0xe'));function Fax(_0x2d27b2){this[_0xa83a('0xf')]={};this[_0xa83a('0x10')]=_0x2d27b2[_0xa83a('0x10')];this[_0xa83a('0x11')]=_0x2d27b2[_0xa83a('0x11')];this[_0xa83a('0x12')]={};ami['on']('newchannel',this[_0xa83a('0x13')][_0xa83a('0x14')](this));ami['on'](_0xa83a('0x15'),this[_0xa83a('0x16')][_0xa83a('0x14')](this));ami['on'](_0xa83a('0x17'),this[_0xa83a('0x18')][_0xa83a('0x14')](this));ami['on'](_0xa83a('0x19'),this[_0xa83a('0x1a')][_0xa83a('0x14')](this));ami['on'](_0xa83a('0x1b'),this[_0xa83a('0x1c')]['bind'](this));ami['on'](_0xa83a('0x1d'),this['syncReceiveFax'][_0xa83a('0x14')](this));ami['on']('hangup',this[_0xa83a('0x1e')][_0xa83a('0x14')](this));ami['on'](_0xa83a('0x1f'),this[_0xa83a('0x20')]['bind'](this));}Fax[_0xa83a('0x21')]['syncNewchannel']=function(_0x3216a6){if(_0x3216a6['context']===_0xa83a('0x22')){for(var _0x3cd2a8 in this[_0xa83a('0x10')]){if(this[_0xa83a('0x10')]['hasOwnProperty'](_0x3cd2a8)){if(_0x3216a6[_0xa83a('0x23')]===this[_0xa83a('0x10')][_0x3cd2a8][_0xa83a('0x24')]){this[_0xa83a('0xf')][_0x3216a6[_0xa83a('0x25')]]={};this[_0xa83a('0xf')][_0x3216a6['uniqueid']][_0xa83a('0x26')]=_0x3216a6[_0xa83a('0x26')];this[_0xa83a('0xf')][_0x3216a6[_0xa83a('0x25')]]['id']=this['faxAccounts'][_0x3cd2a8]['id'];this[_0xa83a('0xf')][_0x3216a6[_0xa83a('0x25')]][_0xa83a('0x27')]=this[_0xa83a('0x10')][_0x3cd2a8][_0xa83a('0x27')];logger[_0xa83a('0x28')](_0x3216a6[_0xa83a('0x25')],_0xa83a('0x29'));}}}}if(this['actions'][_0x3216a6['uniqueid']]){this[_0xa83a('0xf')][_0x3216a6[_0xa83a('0x25')]]={};this[_0xa83a('0xf')][_0x3216a6['uniqueid']]['channel']=_0x3216a6[_0xa83a('0x26')];logger[_0xa83a('0x28')](_0x3216a6[_0xa83a('0x25')],_0xa83a('0x29'));}};Fax['prototype'][_0xa83a('0x16')]=function(_0x336409){if(this['channels'][_0x336409[_0xa83a('0x25')]]){for(var _0x5d1243 in _0x336409[_0xa83a('0x2a')]){if(_0x336409[_0xa83a('0x2a')][_0xa83a('0x2b')](_0x5d1243)){this[_0xa83a('0xf')][_0x336409[_0xa83a('0x25')]][_0x5d1243]=_0x336409[_0xa83a('0x2c')];}}}};Fax[_0xa83a('0x21')][_0xa83a('0x18')]=function(_0x4d60c1){if(this[_0xa83a('0xf')][_0x4d60c1[_0xa83a('0x25')]]){this['channels'][_0x4d60c1[_0xa83a('0x25')]][_0xa83a('0x2d')]=_0x4d60c1[_0xa83a('0x2d')];this[_0xa83a('0xf')][_0x4d60c1[_0xa83a('0x25')]]['channelstatedesc']=_0x4d60c1['channelstatedesc'];}};Fax[_0xa83a('0x21')]['syncNewExten']=function(_0x202e70){if(this[_0xa83a('0xf')][_0x202e70[_0xa83a('0x25')]]){for(var _0x435e24 in _0x202e70[_0xa83a('0x2a')]){if(_0x202e70[_0xa83a('0x2a')][_0xa83a('0x2b')](_0x435e24)){this[_0xa83a('0xf')][_0x202e70[_0xa83a('0x25')]][_0x435e24]=_0x202e70['value'];}}}};Fax[_0xa83a('0x21')][_0xa83a('0x1c')]=function(_0x1ed879){if(this[_0xa83a('0xf')][_0x1ed879[_0xa83a('0x25')]]){this['channels'][_0x1ed879['uniqueid']][_0xa83a('0x2e')]=_0x1ed879[_0xa83a('0x2e')];this[_0xa83a('0xf')][_0x1ed879[_0xa83a('0x25')]][_0xa83a('0x2f')]=_0x1ed879[_0xa83a('0x2f')];this['channels'][_0x1ed879[_0xa83a('0x25')]][_0xa83a('0x24')]=_0x1ed879[_0xa83a('0x24')];this[_0xa83a('0xf')][_0x1ed879[_0xa83a('0x25')]][_0xa83a('0x30')]=_0x1ed879['filename'];logger[_0xa83a('0x28')](_0x1ed879[_0xa83a('0x25')],'\x20syncFaxStatus\x20');}};Fax[_0xa83a('0x21')][_0xa83a('0x31')]=function(_0x3fc345){var _0x7036ae=this;if(this[_0xa83a('0xf')][_0x3fc345[_0xa83a('0x25')]]){var _0x55f745=this[_0xa83a('0xf')][_0x3fc345[_0xa83a('0x25')]]['id'];this[_0xa83a('0xf')][_0x3fc345[_0xa83a('0x25')]]['remotestationid']=_0x3fc345[_0xa83a('0x32')];this[_0xa83a('0xf')][_0x3fc345['uniqueid']][_0xa83a('0x33')]=_0x3fc345[_0xa83a('0x33')];this[_0xa83a('0xf')][_0x3fc345[_0xa83a('0x25')]][_0xa83a('0x24')]=_0x3fc345[_0xa83a('0x24')];this[_0xa83a('0xf')][_0x3fc345[_0xa83a('0x25')]][_0xa83a('0x34')]=_0x3fc345[_0xa83a('0x34')];this['channels'][_0x3fc345['uniqueid']][_0xa83a('0x35')]=_0x3fc345['transferrate'];this[_0xa83a('0xf')][_0x3fc345[_0xa83a('0x25')]][_0xa83a('0x30')]=_0x3fc345[_0xa83a('0x30')];this[_0xa83a('0xf')][_0x3fc345['uniqueid']][_0xa83a('0x36')]=_0x3fc345[_0xa83a('0x36')];if(this[_0xa83a('0xf')][_0x3fc345[_0xa83a('0x25')]][_0xa83a('0x33')]>0x0){tiff2pdf(_0x3fc345[_0xa83a('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x4f9574){logger['info'](_0x3fc345[_0xa83a('0x25')],'\x20result\x20conversion\x20file\x20',_0x4f9574['message']);attachment['create']({'name':path[_0xa83a('0x37')](_0x3fc345[_0xa83a('0x30')])[_0xa83a('0x27')],'basename':path[_0xa83a('0x37')](_0x3fc345[_0xa83a('0x30')])[_0xa83a('0x27')]+_0xa83a('0x38'),'type':_0xa83a('0x39')})[_0xa83a('0x3a')](function(_0xb4217a){faxAccount[_0xa83a('0x3b')](_0x55f745,{'from':_0x3fc345[_0xa83a('0x36')],'mapKey':_0xa83a('0x7'),'body':path[_0xa83a('0x37')](_0x3fc345['filename'])[_0xa83a('0x27')]+_0xa83a('0x38'),'AttachmentId':_0xb4217a['id']})[_0xa83a('0x3c')](function(_0x2f38d2){logger['error'](_0x3fc345['uniqueid'],_0xa83a('0x3d'),JSON[_0xa83a('0x3e')](_0x2f38d2));});})[_0xa83a('0x3c')](function(_0x3af806){logger['error'](_0x3fc345[_0xa83a('0x25')],_0xa83a('0x3f'),JSON[_0xa83a('0x3e')](_0x3af806));});});}logger['info'](_0x3fc345[_0xa83a('0x25')],_0xa83a('0x3f'));}};Fax[_0xa83a('0x21')][_0xa83a('0x20')]=function(_0x10aa7d){if(this[_0xa83a('0x12')][_0x10aa7d['uniqueid']]){_[_0xa83a('0x40')](this[_0xa83a('0xf')][_0x10aa7d[_0xa83a('0x25')]],_['pick'](_0x10aa7d,[_0xa83a('0x41'),_0xa83a('0x42')]));}};function updateStatus(_0x32a8cb){if(_0x32a8cb[_0xa83a('0x43')]){faxMessage[_0xa83a('0x44')](_0x32a8cb['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0xa83a('0x3a')](function(_0x309eaf){ut[_0xa83a('0x45')](_0xa83a('0x46'),_0x309eaf);})[_0xa83a('0x3c')](function(_0x2fe951){ut[_0xa83a('0x45')](_0xa83a('0x47'),_0x2fe951);});}else{ut[_0xa83a('0x45')](_0xa83a('0x48'));}}Fax[_0xa83a('0x21')][_0xa83a('0x49')]=function(_0x5bf42a,_0x322973,_0x9e77f4){var _0x2d0503=this;var _0x15e742={};if(_0x322973){_0x15e742={'read':_0x322973};}else{_0x15e742={'failMessage':_0x9e77f4};}if(this[_0xa83a('0x12')][_0x5bf42a][_0xa83a('0x43')]){faxMessage['update'](this[_0xa83a('0x12')][_0x5bf42a][_0xa83a('0x43')],_0x15e742)[_0xa83a('0x3a')](function(_0x1238b8){ut['logger'](_0xa83a('0x4a'),_0x1238b8);})[_0xa83a('0x3c')](function(_0x4f7cbd){ut[_0xa83a('0x45')](_0xa83a('0x4b'),_0x4f7cbd);})[_0xa83a('0x4c')](function(){delete _0x2d0503['channels'][_0x5bf42a];delete _0x2d0503[_0xa83a('0x12')][_0x5bf42a];});}else{ut['logger'](_0xa83a('0x4d'));this['deleteChannelAfterTimeout'](_0x5bf42a);delete this['actions'][_0x5bf42a];}};Fax['prototype'][_0xa83a('0x1e')]=function(_0x4701dd){var _0x5aede9=this;if(this[_0xa83a('0xf')][_0x4701dd[_0xa83a('0x25')]]){if(this[_0xa83a('0x12')][_0x4701dd[_0xa83a('0x25')]]){this[_0xa83a('0xf')][_0x4701dd[_0xa83a('0x25')]]['id']=this[_0xa83a('0x12')][_0x4701dd[_0xa83a('0x25')]]['id'];this[_0xa83a('0xf')][_0x4701dd[_0xa83a('0x25')]][_0xa83a('0x27')]=this[_0xa83a('0x12')][_0x4701dd[_0xa83a('0x25')]][_0xa83a('0x27')];}logger[_0xa83a('0x28')](_0x4701dd[_0xa83a('0x25')],this[_0xa83a('0x12')][_0x4701dd[_0xa83a('0x25')]]?_0xa83a('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0xa83a('0x3e')](this[_0xa83a('0xf')][_0x4701dd[_0xa83a('0x25')]]));if(this[_0xa83a('0x12')][_0x4701dd[_0xa83a('0x25')]]){if(this[_0xa83a('0xf')][_0x4701dd['uniqueid']]['faxpages']>0x0&&this[_0xa83a('0xf')][_0x4701dd['uniqueid']]['faxstatus']===_0xa83a('0x4f')){this[_0xa83a('0x49')](_0x4701dd['uniqueid'],!![]);}else{this[_0xa83a('0x49')](_0x4701dd[_0xa83a('0x25')],![],this['channels'][_0x4701dd[_0xa83a('0x25')]][_0xa83a('0x50')]?_0xa83a('0x51')+this[_0xa83a('0xf')][_0x4701dd[_0xa83a('0x25')]][_0xa83a('0x50')]:_0xa83a('0x52'));}}}};Fax[_0xa83a('0x21')][_0xa83a('0x53')]=function(_0x10a5af){var _0xaf2aa7=this;return new BPromise(function(_0x187ea4,_0x3501b9){_0xaf2aa7[_0xa83a('0x54')](_0x10a5af,_0xaf2aa7[_0xa83a('0x10')][_0x10a5af['FaxAccountId']])[_0xa83a('0x3a')](function(_0x4bfaa7){ut['logger'](_0xa83a('0x55'),_0x4bfaa7);_0x187ea4(ut['message'](_0xa83a('0x56')));})[_0xa83a('0x3c')](function(_0x1915d7){ut[_0xa83a('0x45')](_0xa83a('0x57'),_0x1915d7);updateStatus(_0x10a5af);_0x3501b9(ut[_0xa83a('0x58')]('Fax\x20failed'));});});};Fax['prototype'][_0xa83a('0x59')]=function(_0x598132){var _0x44c235=this;return new BPromise(function(_0x2d6c80,_0x4c1e52){var _0x28cad1=_0x44c235[_0xa83a('0x5a')](_0x44c235[_0xa83a('0x10')][_0x598132[_0xa83a('0x5b')]][_0xa83a('0x5c')],_0x598132);if(_0x28cad1[_0xa83a('0x5d')]){_0x2d6c80(ut[_0xa83a('0x58')]('Trunk\x20Reachable'));}else{_0x4c1e52(ut[_0xa83a('0x58')](_0x28cad1['message']));}});};function originate(_0x582fbd,_0x1e58c1,_0x5c703a){return new BPromise(function(_0x20411e,_0x4a443e){if(_0x5c703a){var _0x4fec21=util[_0xa83a('0x5e')](_0xa83a('0x5f'),path[_0xa83a('0x37')](_0x582fbd['path'])[_0xa83a('0x27')],_0x582fbd[_0xa83a('0x4')]);gs[_0xa83a('0x60')](_0x4fec21)['then'](function(){_0x582fbd[_0xa83a('0x4')]=util['format'](_0xa83a('0x61'),path['parse'](_0x582fbd[_0xa83a('0x4')])[_0xa83a('0x62')],path[_0xa83a('0x37')](_0x582fbd[_0xa83a('0x4')])[_0xa83a('0x27')]);_0x1e58c1[_0xa83a('0x63')]=_0x582fbd['path'];ut[_0xa83a('0x45')](_0xa83a('0x64'),'');ami[_0xa83a('0x65')](ut[_0xa83a('0x66')](_0x582fbd,_0x1e58c1))[_0xa83a('0x3a')](function(_0x1446bc){_0x20411e(_0x1446bc);})[_0xa83a('0x3c')](function(_0x51612d){_0x4a443e(_0x51612d);});})[_0xa83a('0x3c')](function(_0x1bd081){_0x4a443e(_0x1bd081);});}else{ami[_0xa83a('0x65')](ut['variablesAction'](_0x582fbd,_0x1e58c1))[_0xa83a('0x3a')](function(_0x293f67){_0x20411e(_0x293f67);})[_0xa83a('0x3c')](function(_0x25f2dd){_0x4a443e(_0x25f2dd);});}});}Fax['prototype']['execOriginate']=function(_0x26c578,_0x40e363){var _0x16f137=this;return new BPromise(function(_0x4522f6,_0x30308){var _0x2d6a42=uuid['v4']();var _0x2693bb=ut[_0xa83a('0x67')](_0x26c578,_0x40e363);_0x16f137[_0xa83a('0x12')][_0x2d6a42]=new Action(_0x2d6a42,_0x40e363,_0x26c578);var _0xc216f3=_0x16f137[_0xa83a('0x12')][_0x2d6a42];if(path[_0xa83a('0x37')](_0x26c578[_0xa83a('0x4')])['ext']==='.pdf'){originate(_0xc216f3,_0x2693bb,!![])[_0xa83a('0x3a')](function(_0x32218a){_0x4522f6(_0x32218a);})[_0xa83a('0x3c')](function(_0x370895){_0x30308(_0x370895);});}else{originate(_0xc216f3,_0x2693bb,![])[_0xa83a('0x3a')](function(_0x34ded5){_0x4522f6(_0x34ded5);})[_0xa83a('0x3c')](function(_0x26195d){_0x30308(_0x26195d);});}});};Fax[_0xa83a('0x21')][_0xa83a('0x68')]=function(_0x75e2c5){return!_[_0xa83a('0x69')](_0x75e2c5)&&!_[_0xa83a('0x69')](_0x75e2c5[_0xa83a('0x27')])&&!_[_0xa83a('0x69')](_0x75e2c5[_0xa83a('0x6a')])&&_0x75e2c5[_0xa83a('0x6a')]&&!_[_0xa83a('0x69')](this[_0xa83a('0x11')][util[_0xa83a('0x5e')](_0xa83a('0x6b'),_0x75e2c5[_0xa83a('0x27')])])&&!_[_0xa83a('0x69')](this[_0xa83a('0x11')][util['format']('SIP/%s',_0x75e2c5[_0xa83a('0x27')])][_0xa83a('0x2f')])&&(this[_0xa83a('0x11')][util[_0xa83a('0x5e')]('SIP/%s',_0x75e2c5['name'])][_0xa83a('0x2f')]===_0xa83a('0x6c')||this['trunks'][util[_0xa83a('0x5e')]('SIP/%s',_0x75e2c5['name'])][_0xa83a('0x2f')]===_0xa83a('0x6d'));};Fax[_0xa83a('0x21')][_0xa83a('0x5a')]=function(_0x565edc,_0xd52ddd){if(!this[_0xa83a('0x68')](_0x565edc)){ut[_0xa83a('0x45')](_0xa83a('0x6e'),_[_0xa83a('0x69')](_0x565edc)?'':_0x565edc[_0xa83a('0x27')]+_0xa83a('0x6f'));return{'isValid':![],'message':_0xa83a('0x70')};}if(_[_0xa83a('0x69')](_0xd52ddd[_0xa83a('0x7')])){ut[_0xa83a('0x45')](_0xa83a('0x71'),JSON[_0xa83a('0x3e')](_0xd52ddd));return{'isValid':![],'message':_0xa83a('0x72')};}if(_[_0xa83a('0x69')](_0xd52ddd[_0xa83a('0x4')])){ut[_0xa83a('0x45')](_0xa83a('0x73'),JSON[_0xa83a('0x3e')](_0xd52ddd));return{'isValid':![],'message':_0xa83a('0x74')};}return{'isValid':!![],'message':_0xa83a('0x75')};};Fax[_0xa83a('0x21')]['deleteChannelAfterTimeout']=function(_0x3c8dff,_0x42e634=0x2710){if(this[_0xa83a('0xf')][_0x3c8dff]){setTimeout(()=>{delete this[_0xa83a('0xf')][_0x3c8dff];},_0x42e634);}};module[_0xa83a('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f04ab7d..139418a 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 _0xb5a8=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','util'];(function(_0x48f7c2,_0x4dabfc){var _0x32b5ab=function(_0xd413bb){while(--_0xd413bb){_0x48f7c2['push'](_0x48f7c2['shift']());}};_0x32b5ab(++_0x4dabfc);}(_0xb5a8,0x15b));var _0x8b5a=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xb5a8[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x8b5a('0x0'));var BPromise=require(_0x8b5a('0x1'));var logger=require(_0x8b5a('0x2'))(_0x8b5a('0x3'));var _=require(_0x8b5a('0x4'));var faxAccount=require(_0x8b5a('0x5'));function loggerCatch(_0x3bb751){return function(_0xb80ea1){logger[_0x8b5a('0x6')](_0x3bb751,util[_0x8b5a('0x7')](_0xb80ea1,{'showHidden':![],'depth':null}));};}exports[_0x8b5a('0x8')]=function(_0x39dbfd,_0x1cc3cc){return BPromise[_0x8b5a('0x9')]()[_0x8b5a('0xa')](faxAccount[_0x8b5a('0x8')](_0x39dbfd,_0x1cc3cc))[_0x8b5a('0xb')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xcd7a=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','util'];(function(_0x3bf043,_0x439342){var _0x35a484=function(_0x3ad0ab){while(--_0x3ad0ab){_0x3bf043['push'](_0x3bf043['shift']());}};_0x35a484(++_0x439342);}(_0xcd7a,0x154));var _0xacd7=function(_0x399837,_0x56edf2){_0x399837=_0x399837-0x0;var _0x18fed4=_0xcd7a[_0x399837];return _0x18fed4;};'use strict';var util=require(_0xacd7('0x0'));var BPromise=require('bluebird');var logger=require(_0xacd7('0x1'))(_0xacd7('0x2'));var _=require(_0xacd7('0x3'));var faxAccount=require(_0xacd7('0x4'));function loggerCatch(_0x18e3ec){return function(_0x274864){logger[_0xacd7('0x5')](_0x18e3ec,util[_0xacd7('0x6')](_0x274864,{'showHidden':![],'depth':null}));};}exports[_0xacd7('0x7')]=function(_0x5871bf,_0x1956ef){return BPromise[_0xacd7('0x8')]()[_0xacd7('0x9')](faxAccount[_0xacd7('0x7')](_0x5871bf,_0x1956ef))['catch'](loggerCatch(_0xacd7('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 45adfe1..9911fc8 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 _0xa4ad=['exec','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','child_process'];(function(_0x1079b3,_0x1c3c8e){var _0x2be27e=function(_0x38d54b){while(--_0x38d54b){_0x1079b3['push'](_0x1079b3['shift']());}};_0x2be27e(++_0x1c3c8e);}(_0xa4ad,0xc2));var _0xda4a=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0xa4ad[_0x3bef2c];return _0x331503;};'use strict';var util=require('util');var logger=require(_0xda4a('0x0'))(_0xda4a('0x1'));var BPromise=require(_0xda4a('0x2'));var exec=require(_0xda4a('0x3'))[_0xda4a('0x4')];exports['execute']=function(_0x25d81a){return new BPromise(function(_0xdac76c,_0x252c42){exec(_0x25d81a,function(_0x3b092f,_0x3e8421,_0x48d599){logger[_0xda4a('0x5')](_0xda4a('0x6'),_0x3e8421);if(_0x3b092f){logger['info'](_0xda4a('0x6'),_0xda4a('0x7'),util[_0xda4a('0x8')](_0x3b092f,{'showHidden':![],'depth':null}),_0x3e8421,_0x48d599);_0x252c42(_0x3b092f);}_0xdac76c(_0x3e8421);});});}; \ No newline at end of file +var _0xa8f7=['Exec\x20gs','info','fax','bluebird','child_process'];(function(_0x57acf8,_0x5cc0e0){var _0x2b5a45=function(_0x490306){while(--_0x490306){_0x57acf8['push'](_0x57acf8['shift']());}};_0x2b5a45(++_0x5cc0e0);}(_0xa8f7,0x1d3));var _0x7a8f=function(_0x51a036,_0x208d6f){_0x51a036=_0x51a036-0x0;var _0x202911=_0xa8f7[_0x51a036];return _0x202911;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x7a8f('0x0'));var BPromise=require(_0x7a8f('0x1'));var exec=require(_0x7a8f('0x2'))['exec'];exports['execute']=function(_0x1866c5){return new BPromise(function(_0x395857,_0x141022){exec(_0x1866c5,function(_0x4fcdd4,_0x27f80b,_0x24ac32){logger['info'](_0x7a8f('0x3'),_0x27f80b);if(_0x4fcdd4){logger[_0x7a8f('0x4')](_0x7a8f('0x3'),'\x20Error\x20:',util['inspect'](_0x4fcdd4,{'showHidden':![],'depth':null}),_0x27f80b,_0x24ac32);_0x141022(_0x4fcdd4);}_0x395857(_0x27f80b);});});}; \ 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 4c9ae4f..f08e836 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 _0x9462=['localstationid','path','uniqueid','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','fax','info','inspect','ecm','minrate','format','modem','gateway','faxdetect','t38timeout'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x9462,0x111));var _0x2946=function(_0x2a2816,_0x21057a){_0x2a2816=_0x2a2816-0x0;var _0x32ba44=_0x9462[_0x2a2816];return _0x32ba44;};'use strict';var util=require('util');var _=require(_0x2946('0x0'));var moment=require(_0x2946('0x1'));var logger=require('../../../../config/logger')(_0x2946('0x2'));exports['message']=function(_0x35c8cc){return{'message':_0x35c8cc};};exports['logger']=function(_0x514f33,_0x161769){logger[_0x2946('0x3')](_0x514f33,util[_0x2946('0x4')](_0x161769,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2f86b0,_0x351580){var _0x42bb98={'XMF-ECM':_0x351580[_0x2946('0x5')],'XMF-HEADERINFO':_0x351580['headerinfo'],'XMF-MINRATE':_0x351580[_0x2946('0x6')],'XMF-MAXRATE':_0x351580['maxrate'],'XMF-MODEM':util[_0x2946('0x7')]('\x22%s\x22',_0x351580[_0x2946('0x8')]),'XMF-GATEWAY':_0x351580[_0x2946('0x9')],'XMF-FAXDETECT':_0x351580[_0x2946('0xa')],'XMF-T38TIMEOUT':_0x351580[_0x2946('0xb')],'XMF-LOCALSTATIONID':_0x351580[_0x2946('0xc')],'XMF-PATH':_0x2f86b0[_0x2946('0xd')]};return _0x42bb98;};exports['variablesAction']=function(_0xbd52aa,_0x23fe07){return{'actionid':_0xbd52aa[_0x2946('0xe')],'action':'originate','channel':_0xbd52aa['channel'],'Exten':_0x2946('0xf'),'Context':_0x2946('0x10'),'Priority':'1','callerid':util['format'](_0x2946('0x11'),_0xbd52aa[_0x2946('0x12')]?_0xbd52aa[_0x2946('0x12')]:'',_0xbd52aa['localstationid']),'variable':_0x23fe07,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xbd52aa['uniqueid']};}; \ No newline at end of file +var _0x54da=['localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout'];(function(_0x4c1f9c,_0x517d17){var _0x1307b5=function(_0x48b055){while(--_0x48b055){_0x4c1f9c['push'](_0x4c1f9c['shift']());}};_0x1307b5(++_0x517d17);}(_0x54da,0x180));var _0xa54d=function(_0x32f05c,_0x273aef){_0x32f05c=_0x32f05c-0x0;var _0x4307ed=_0x54da[_0x32f05c];return _0x4307ed;};'use strict';var util=require(_0xa54d('0x0'));var _=require(_0xa54d('0x1'));var moment=require(_0xa54d('0x2'));var logger=require('../../../../config/logger')(_0xa54d('0x3'));exports[_0xa54d('0x4')]=function(_0x267219){return{'message':_0x267219};};exports[_0xa54d('0x5')]=function(_0xd558cf,_0x1771e6){logger[_0xa54d('0x6')](_0xd558cf,util[_0xa54d('0x7')](_0x1771e6,{'showHidden':![],'depth':null}));};exports[_0xa54d('0x8')]=function(_0x1c03e1,_0x3fd19c){var _0x377b29={'XMF-ECM':_0x3fd19c['ecm'],'XMF-HEADERINFO':_0x3fd19c[_0xa54d('0x9')],'XMF-MINRATE':_0x3fd19c[_0xa54d('0xa')],'XMF-MAXRATE':_0x3fd19c[_0xa54d('0xb')],'XMF-MODEM':util['format']('\x22%s\x22',_0x3fd19c[_0xa54d('0xc')]),'XMF-GATEWAY':_0x3fd19c[_0xa54d('0xd')],'XMF-FAXDETECT':_0x3fd19c[_0xa54d('0xe')],'XMF-T38TIMEOUT':_0x3fd19c[_0xa54d('0xf')],'XMF-LOCALSTATIONID':_0x3fd19c[_0xa54d('0x10')],'XMF-PATH':_0x1c03e1[_0xa54d('0x11')]};return _0x377b29;};exports[_0xa54d('0x12')]=function(_0x4f9b5c,_0x3a3013){return{'actionid':_0x4f9b5c['uniqueid'],'action':'originate','channel':_0x4f9b5c[_0xa54d('0x13')],'Exten':_0xa54d('0x14'),'Context':_0xa54d('0x15'),'Priority':'1','callerid':util[_0xa54d('0x16')](_0xa54d('0x17'),_0x4f9b5c[_0xa54d('0x9')]?_0x4f9b5c[_0xa54d('0x9')]:'',_0x4f9b5c[_0xa54d('0x10')]),'variable':_0x3a3013,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4f9b5c[_0xa54d('0x18')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index d94b9ae..f9ce676 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 _0xbfbf=['initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','sync','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfbf,0xa4));var _0xfbfb=function(_0x3f668b,_0x6ab15c){_0x3f668b=_0x3f668b-0x0;var _0x259a77=_0xbfbf[_0x3f668b];return _0x259a77;};'use strict';var util=require(_0xfbfb('0x0'));var moment=require(_0xfbfb('0x1'));var server=require(_0xfbfb('0x2'));var Realtime=require(_0xfbfb('0x3'));var Report=require('./report');var Acw=require(_0xfbfb('0x4'));var Trigger=require(_0xfbfb('0x5'));var Dialer=require(_0xfbfb('0x6'));var Preview=require(_0xfbfb('0x7'));var Fax=require(_0xfbfb('0x8'));var user=require(_0xfbfb('0x9'));var voiceQueue=require(_0xfbfb('0xa'));var voiceQueueReport=require(_0xfbfb('0xb'));var voiceCallReport=require(_0xfbfb('0xc'));var trunk=require(_0xfbfb('0xd'));var trigger=require(_0xfbfb('0xe'));var template=require(_0xfbfb('0xf'));var cmHopperHistory=require(_0xfbfb('0x10'));var campaign=require(_0xfbfb('0x11'));var voiceExtension=require(_0xfbfb('0x12'));var faxAccount=require(_0xfbfb('0x13'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xfbfb('0x14'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xfbfb('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xfbfb('0x16'));var freshsales=require(_0xfbfb('0x17'));var servicenow=require(_0xfbfb('0x18'));var dynamics365=require(_0xfbfb('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xfbfb('0x1a'))(_0xfbfb('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfbfb('0x1c')](_0xfbfb('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xfbfb('0x1c')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()['then'](user['getAgents']())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x1f')]())['then'](user[_0xfbfb('0x20')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x21')]())[_0xfbfb('0x1e')](trunk[_0xfbfb('0x22')]())[_0xfbfb('0x1e')](realtime['initTrunks']())['then'](voiceQueue[_0xfbfb('0x23')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x24')]())[_0xfbfb('0x1e')](trigger[_0xfbfb('0x25')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x26')]())['then'](template['getTemplates']())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x27')]())[_0xfbfb('0x1e')](zendesk[_0xfbfb('0x28')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x29')]())[_0xfbfb('0x1e')](salesforce[_0xfbfb('0x2a')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x2b')]())[_0xfbfb('0x1e')](sugarcrm[_0xfbfb('0x2c')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xfbfb('0x2d')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x2e')]())['then'](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())['then'](zoho[_0xfbfb('0x2f')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x30')]())[_0xfbfb('0x1e')](vtiger[_0xfbfb('0x31')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x32')]())[_0xfbfb('0x1e')](freshsales[_0xfbfb('0x33')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x34')]())[_0xfbfb('0x1e')](servicenow['getServicenowAccounts']())['then'](realtime[_0xfbfb('0x35')]())['then'](dynamics365[_0xfbfb('0x36')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x37')]())['then'](campaign[_0xfbfb('0x38')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x39')]())['then'](voiceExtension[_0xfbfb('0x3a')]())[_0xfbfb('0x1e')](realtime['initVoiceExtensions']())[_0xfbfb('0x1e')](faxAccount[_0xfbfb('0x3b')]())['then'](realtime[_0xfbfb('0x3c')]())[_0xfbfb('0x1e')](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport[_0xfbfb('0x3d')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x3e')]())[_0xfbfb('0x1e')](cmHopperHistory[_0xfbfb('0x3f')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x40')]())[_0xfbfb('0x1e')](cmHopperHistory[_0xfbfb('0x41')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x42')]())[_0xfbfb('0x1e')](voiceCallReport[_0xfbfb('0x43')]())[_0xfbfb('0x1e')](realtime[_0xfbfb('0x44')]())['catch'](function(_0x30bbd2){logger[_0xfbfb('0x45')](_0xfbfb('0x46'),util[_0xfbfb('0x47')](_0x30bbd2,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xfbfb('0x1e')](function(){return initRealtime();})[_0xfbfb('0x1e')](function(){return initParams();})['then'](function(){report[_0xfbfb('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x424e3d){logger[_0xfbfb('0x45')]('[index.js][main]',util[_0xfbfb('0x47')](_0x424e3d,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4a22=['sync','catch','util','moment','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','../../config/logger','ami','get','hour','then','initAgents','getTelephones','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','listen'];(function(_0x439892,_0x2c1700){var _0x3fe156=function(_0x4ce6c8){while(--_0x4ce6c8){_0x439892['push'](_0x439892['shift']());}};_0x3fe156(++_0x2c1700);}(_0x4a22,0x11e));var _0x24a2=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x4a22[_0x5627e1];return _0x2f013f;};'use strict';var util=require(_0x24a2('0x0'));var moment=require(_0x24a2('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x24a2('0x2'));var Trigger=require(_0x24a2('0x3'));var Dialer=require(_0x24a2('0x4'));var Preview=require(_0x24a2('0x5'));var Fax=require(_0x24a2('0x6'));var user=require(_0x24a2('0x7'));var voiceQueue=require(_0x24a2('0x8'));var voiceQueueReport=require(_0x24a2('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x24a2('0xa'));var trigger=require(_0x24a2('0xb'));var template=require(_0x24a2('0xc'));var cmHopperHistory=require(_0x24a2('0xd'));var campaign=require(_0x24a2('0xe'));var voiceExtension=require(_0x24a2('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x24a2('0x10'));var sugarcrm=require(_0x24a2('0x11'));var freshdesk=require(_0x24a2('0x12'));var desk=require(_0x24a2('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x24a2('0x14'));var freshsales=require(_0x24a2('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x24a2('0x16'))(_0x24a2('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x24a2('0x18')](_0x24a2('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x24a2('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x24a2('0x1a')](user['getAgents']())['then'](realtime[_0x24a2('0x1b')]())[_0x24a2('0x1a')](user[_0x24a2('0x1c')]())['then'](realtime['initTelephones']())[_0x24a2('0x1a')](trunk['getTrunks']())['then'](realtime['initTrunks']())['then'](voiceQueue[_0x24a2('0x1d')]())['then'](realtime[_0x24a2('0x1e')]())[_0x24a2('0x1a')](trigger[_0x24a2('0x1f')]())['then'](realtime[_0x24a2('0x20')]())[_0x24a2('0x1a')](template[_0x24a2('0x21')]())['then'](realtime[_0x24a2('0x22')]())['then'](zendesk[_0x24a2('0x23')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x24')]())[_0x24a2('0x1a')](salesforce[_0x24a2('0x25')]())['then'](realtime[_0x24a2('0x26')]())[_0x24a2('0x1a')](sugarcrm[_0x24a2('0x27')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x28')]())['then'](freshdesk[_0x24a2('0x29')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x2a')]())['then'](desk[_0x24a2('0x2b')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x2c')]())[_0x24a2('0x1a')](zoho['getZohoAccounts']())['then'](realtime[_0x24a2('0x2d')]())[_0x24a2('0x1a')](vtiger[_0x24a2('0x2e')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x2f')]())[_0x24a2('0x1a')](freshsales[_0x24a2('0x30')]())['then'](realtime[_0x24a2('0x31')]())['then'](servicenow[_0x24a2('0x32')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x33')]())[_0x24a2('0x1a')](dynamics365[_0x24a2('0x34')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x35')]())[_0x24a2('0x1a')](campaign[_0x24a2('0x36')]())['then'](realtime[_0x24a2('0x37')]())[_0x24a2('0x1a')](voiceExtension['getVoiceExtensions']())[_0x24a2('0x1a')](realtime[_0x24a2('0x38')]())['then'](faxAccount[_0x24a2('0x39')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x3a')]())[_0x24a2('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0x24a2('0x3b')]()[_0x24a2('0x1a')](voiceQueueReport[_0x24a2('0x3c')]())[_0x24a2('0x1a')](realtime['initVoiceQueueReports']())[_0x24a2('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x24a2('0x1a')](realtime[_0x24a2('0x3d')]())[_0x24a2('0x1a')](cmHopperHistory[_0x24a2('0x3e')]())[_0x24a2('0x1a')](realtime[_0x24a2('0x3f')]())[_0x24a2('0x1a')](voiceCallReport[_0x24a2('0x40')]())['then'](realtime[_0x24a2('0x41')]())['catch'](function(_0x1e5863){logger[_0x24a2('0x42')](_0x24a2('0x43'),util['inspect'](_0x1e5863,{'showHidden':![],'depth':null}));});}function main(){return server[_0x24a2('0x44')](realtime,preview,fax)[_0x24a2('0x1a')](function(){return initRealtime();})[_0x24a2('0x1a')](function(){return initParams();})[_0x24a2('0x1a')](function(){report[_0x24a2('0x45')]();setInterval(initRealtime,0x1388);})[_0x24a2('0x46')](function(_0x214148){logger['error']('[index.js][main]',util['inspect'](_0x214148,{'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 f2dd945..e98f425 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 _0x8544=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','voiceStatus','statePause','toNumber','email','address','voiceStatusCallerIdNumber','stringify','format','emit','omit','user:presence','exports','ioredis','redis','defaults','localhost','socket.io-emitter','name','fullname','state','unknown','stateTime','status','phone'];(function(_0x15d076,_0x3946fa){var _0x4ccd7b=function(_0x1b1ba7){while(--_0x1b1ba7){_0x15d076['push'](_0x15d076['shift']());}};_0x4ccd7b(++_0x3946fa);}(_0x8544,0xd8));var _0x4854=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x8544[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var md5=require('md5');var Redis=require(_0x4854('0x0'));var config=require('../../../config/environment');config[_0x4854('0x1')]=_[_0x4854('0x2')](config[_0x4854('0x1')],{'host':_0x4854('0x3'),'port':0x18eb});var io=require(_0x4854('0x4'))(new Redis(config['redis']));function Agent(_0xb0cab4){this['id']=_0xb0cab4['id']||0x0;this[_0x4854('0x5')]=_0xb0cab4[_0x4854('0x5')]||'';this['email']=_0xb0cab4['email']||'';this['accountcode']=_0xb0cab4['accountcode']||'';this[_0x4854('0x6')]=_0xb0cab4['fullname']||'';this[_0x4854('0x7')]=_0x4854('0x8');this[_0x4854('0x9')]=0x0;this[_0x4854('0xa')]=_0x4854('0x8');this['address']='';this[_0x4854('0xb')]='';this['mobile']='';this[_0x4854('0xc')]='';this[_0x4854('0xd')]=_0xb0cab4['online']||![];this['voiceStatus']='unknown';this[_0x4854('0xe')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x4854('0xf')]='';this[_0x4854('0x10')]=![];this[_0x4854('0x11')]=![];this[_0x4854('0x12')]='';}Agent[_0x4854('0x13')][_0x4854('0x14')]=function(_0x245fff){var _0x5f3fc7;if(_0x245fff&&_0x245fff['state']){_0x5f3fc7=_0x245fff['state'][_0x4854('0x15')]();switch(_0x5f3fc7){case _0x4854('0x16'):_0x5f3fc7=_0x4854('0x17');break;case _0x4854('0x18'):_0x5f3fc7=_0x4854('0x19');break;}}if(_0x5f3fc7&&this[_0x4854('0x1a')]!==_0x5f3fc7||_0x245fff[_0x4854('0x1b')]){this[_0x4854('0xe')]=_[_0x4854('0x1c')](moment()['format']('x'));}if(_0x5f3fc7){this['voiceStatus']=_0x5f3fc7;}var _0x1fbe25={'id':this['id'],'name':this['name'],'email':this[_0x4854('0x1d')],'accountcode':this['accountcode'],'fullname':this[_0x4854('0x6')],'state':this[_0x4854('0x7')],'stateTime':this[_0x4854('0x9')],'status':this['status'],'address':this[_0x4854('0x1e')],'online':this[_0x4854('0xd')],'voiceStatus':this[_0x4854('0x1a')],'voiceStatusTime':this[_0x4854('0xe')],'voiceStatusCallerIdNumber':this[_0x4854('0x1f')],'voiceStatusQueue':this[_0x4854('0xf')],'interface':this[_0x4854('0xc')],'onhold':this[_0x4854('0x10')]};var _0x538a73=md5(JSON[_0x4854('0x20')](_0x1fbe25));if(this[_0x4854('0x12')]!==_0x538a73){this[_0x4854('0x12')]=_0x538a73;io['to'](util[_0x4854('0x21')]('user:%s',_0x1fbe25[_0x4854('0x5')]))[_0x4854('0x22')]('user:ami:update',_[_0x4854('0x23')](_0x1fbe25,[_0x4854('0xd')]));io[_0x4854('0x22')](_0x4854('0x24'),_0x1fbe25);}};module[_0x4854('0x25')]=Agent; \ No newline at end of file +var _0x86af=['accountcode','state','unknown','stateTime','address','phone','mobile','online','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','voiceStatusTime','toNumber','format','name','fullname','status','stringify','user:%s','user:ami:update','omit','emit','lodash','util','md5','ioredis','redis','localhost','socket.io-emitter','email'];(function(_0x1afc81,_0x4114a6){var _0x6a34a8=function(_0x21857e){while(--_0x21857e){_0x1afc81['push'](_0x1afc81['shift']());}};_0x6a34a8(++_0x4114a6);}(_0x86af,0x6a));var _0xf86a=function(_0x2c0421,_0xa30722){_0x2c0421=_0x2c0421-0x0;var _0x25a09e=_0x86af[_0x2c0421];return _0x25a09e;};'use strict';var _=require(_0xf86a('0x0'));var util=require(_0xf86a('0x1'));var moment=require('moment');var md5=require(_0xf86a('0x2'));var Redis=require(_0xf86a('0x3'));var config=require('../../../config/environment');config[_0xf86a('0x4')]=_['defaults'](config[_0xf86a('0x4')],{'host':_0xf86a('0x5'),'port':0x18eb});var io=require(_0xf86a('0x6'))(new Redis(config['redis']));function Agent(_0x401347){this['id']=_0x401347['id']||0x0;this['name']=_0x401347['name']||'';this['email']=_0x401347[_0xf86a('0x7')]||'';this['accountcode']=_0x401347[_0xf86a('0x8')]||'';this['fullname']=_0x401347['fullname']||'';this[_0xf86a('0x9')]=_0xf86a('0xa');this[_0xf86a('0xb')]=0x0;this['status']=_0xf86a('0xa');this[_0xf86a('0xc')]='';this[_0xf86a('0xd')]='';this[_0xf86a('0xe')]='';this['interface']='';this[_0xf86a('0xf')]=_0x401347[_0xf86a('0xf')]||![];this['voiceStatus']=_0xf86a('0xa');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0xf86a('0x10')]='';this[_0xf86a('0x11')]=![];this[_0xf86a('0x12')]=![];this[_0xf86a('0x2')]='';}Agent[_0xf86a('0x13')][_0xf86a('0x14')]=function(_0x20d3ab){var _0x58a11f;if(_0x20d3ab&&_0x20d3ab[_0xf86a('0x9')]){_0x58a11f=_0x20d3ab[_0xf86a('0x9')][_0xf86a('0x15')]();switch(_0x58a11f){case _0xf86a('0x16'):_0x58a11f=_0xf86a('0x17');break;case _0xf86a('0x18'):_0x58a11f=_0xf86a('0x19');break;}}if(_0x58a11f&&this['voiceStatus']!==_0x58a11f||_0x20d3ab[_0xf86a('0x1a')]){this[_0xf86a('0x1b')]=_[_0xf86a('0x1c')](moment()[_0xf86a('0x1d')]('x'));}if(_0x58a11f){this['voiceStatus']=_0x58a11f;}var _0xfb5b7={'id':this['id'],'name':this[_0xf86a('0x1e')],'email':this[_0xf86a('0x7')],'accountcode':this[_0xf86a('0x8')],'fullname':this[_0xf86a('0x1f')],'state':this[_0xf86a('0x9')],'stateTime':this['stateTime'],'status':this[_0xf86a('0x20')],'address':this[_0xf86a('0xc')],'online':this[_0xf86a('0xf')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xf86a('0x10')],'interface':this['interface'],'onhold':this[_0xf86a('0x11')]};var _0x2e7a4a=md5(JSON[_0xf86a('0x21')](_0xfb5b7));if(this[_0xf86a('0x2')]!==_0x2e7a4a){this[_0xf86a('0x2')]=_0x2e7a4a;io['to'](util[_0xf86a('0x1d')](_0xf86a('0x22'),_0xfb5b7['name']))['emit'](_0xf86a('0x23'),_[_0xf86a('0x24')](_0xfb5b7,[_0xf86a('0xf')]));io[_0xf86a('0x25')]('user:presence',_0xfb5b7);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 1a63985..59e7bad 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 _0xafbc=['dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x20e7ce,_0x21fee8){var _0x3b8b9b=function(_0xeae0fc){while(--_0xeae0fc){_0x20e7ce['push'](_0x20e7ce['shift']());}};_0x3b8b9b(++_0x21fee8);}(_0xafbc,0x1ab));var _0xcafb=function(_0x48723f,_0x45e8c3){_0x48723f=_0x48723f-0x0;var _0x517962=_0xafbc[_0x48723f];return _0x517962;};'use strict';function Campaign(_0x529586){this['id']=_0x529586['id']||0x0;this[_0xcafb('0x0')]=_0x529586['name']||'';this[_0xcafb('0x1')]=_0x529586[_0xcafb('0x1')]||_0xcafb('0x2');this[_0xcafb('0x3')]=0x0;this['temp']=0x0;this[_0xcafb('0x4')]=0x0;this[_0xcafb('0x5')]=0x0;this[_0xcafb('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xcafb('0x7')]=_0x529586[_0xcafb('0x7')];this[_0xcafb('0x8')]=_0x529586['limitCalls'];this['dialTimezone']=_0x529586[_0xcafb('0x9')]||null;this['dialGlobalInterval']=_0x529586['dialGlobalInterval']?_0x529586[_0xcafb('0xa')]:null;this['dialOriginateCallerIdName']=_0x529586['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x529586[_0xcafb('0xb')];this[_0xcafb('0xc')]=_0x529586[_0xcafb('0xc')]||0x1e;this[_0xcafb('0xd')]=_0x529586[_0xcafb('0xd')];this['dialCongestionRetryFrequency']=_0x529586['dialCongestionRetryFrequency'];this[_0xcafb('0xe')]=_0x529586[_0xcafb('0xe')];this[_0xcafb('0xf')]=_0x529586[_0xcafb('0xf')];this[_0xcafb('0x10')]=_0x529586[_0xcafb('0x10')];this['dialNoAnswerRetryFrequency']=_0x529586[_0xcafb('0x11')];this[_0xcafb('0x12')]=_0x529586[_0xcafb('0x12')];this[_0xcafb('0x13')]=_0x529586[_0xcafb('0x13')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x529586[_0xcafb('0x14')]||0x96;this[_0xcafb('0x15')]=_0x529586[_0xcafb('0x15')]||0x3;this[_0xcafb('0x16')]=_0x529586['dialDropRetryFrequency']||0x96;this[_0xcafb('0x17')]=_0x529586[_0xcafb('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0x529586['dialAbandonedRetryFrequency']||0x96;this[_0xcafb('0x18')]=_0x529586[_0xcafb('0x18')]||0x3;this[_0xcafb('0x19')]=_0x529586[_0xcafb('0x19')]||0x96;this[_0xcafb('0x1a')]=_0x529586[_0xcafb('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x529586[_0xcafb('0x1b')]||0x96;this[_0xcafb('0x1c')]=_0x529586[_0xcafb('0x1c')]||_0xcafb('0x1d');this[_0xcafb('0x1e')]=_0x529586[_0xcafb('0x1e')]||undefined;this[_0xcafb('0x1f')]=_0x529586[_0xcafb('0x1f')]||undefined;this['dialCutDigit']=_0x529586[_0xcafb('0x20')]||undefined;this['TrunkBackup']=_0x529586[_0xcafb('0x21')]?_0x529586['TrunkBackup']:undefined;this['Trunk']=_0x529586['Trunk']?_0x529586['Trunk']:undefined;this[_0xcafb('0x22')]=_0x529586[_0xcafb('0x22')]?_0x529586[_0xcafb('0x22')]:undefined;this['SquareProject']=_0x529586[_0xcafb('0x23')]?_0x529586[_0xcafb('0x23')]:undefined;this[_0xcafb('0x24')]=_0x529586[_0xcafb('0x23')]?_0x529586['SquareProject'][_0xcafb('0x0')]:undefined;this[_0xcafb('0x25')]=_0x529586['dialAMDActive']||![];this[_0xcafb('0x26')]=_0x529586[_0xcafb('0x26')];this['dialAMDGreeting']=_0x529586[_0xcafb('0x27')];this['dialAMDAfterGreetingSilence']=_0x529586['dialAMDAfterGreetingSilence'];this[_0xcafb('0x28')]=_0x529586['dialAMDTotalAnalysisTime'];this[_0xcafb('0x29')]=_0x529586['dialAMDMinWordLength'];this[_0xcafb('0x2a')]=_0x529586['dialAMDBetweenWordsSilence'];this[_0xcafb('0x2b')]=_0x529586[_0xcafb('0x2b')];this[_0xcafb('0x2c')]=_0x529586['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x529586['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x444e=['ivrAnswerCallsDay','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x444e,0x152));var _0xe444=function(_0x313474,_0x4b3fdb){_0x313474=_0x313474-0x0;var _0x2ecb81=_0x444e[_0x313474];return _0x2ecb81;};'use strict';function Campaign(_0x55a1e9){this['id']=_0x55a1e9['id']||0x0;this[_0xe444('0x0')]=_0x55a1e9['name']||'';this[_0xe444('0x1')]=_0x55a1e9[_0xe444('0x1')]||_0xe444('0x2');this[_0xe444('0x3')]=0x0;this[_0xe444('0x4')]=0x0;this[_0xe444('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0xe444('0x6')]=_0x55a1e9['active'];this[_0xe444('0x7')]=_0x55a1e9[_0xe444('0x7')];this[_0xe444('0x8')]=_0x55a1e9[_0xe444('0x8')]||null;this[_0xe444('0x9')]=_0x55a1e9[_0xe444('0x9')]?_0x55a1e9[_0xe444('0x9')]:null;this[_0xe444('0xa')]=_0x55a1e9[_0xe444('0xa')];this[_0xe444('0xb')]=_0x55a1e9[_0xe444('0xb')];this[_0xe444('0xc')]=_0x55a1e9['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x55a1e9[_0xe444('0xd')];this[_0xe444('0xe')]=_0x55a1e9[_0xe444('0xe')];this[_0xe444('0xf')]=_0x55a1e9[_0xe444('0xf')];this[_0xe444('0x10')]=_0x55a1e9[_0xe444('0x10')];this[_0xe444('0x11')]=_0x55a1e9[_0xe444('0x11')];this[_0xe444('0x12')]=_0x55a1e9[_0xe444('0x12')];this[_0xe444('0x13')]=_0x55a1e9[_0xe444('0x13')];this[_0xe444('0x14')]=_0x55a1e9['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x55a1e9['dialNoSuchNumberRetryFrequency']||0x96;this[_0xe444('0x15')]=_0x55a1e9[_0xe444('0x15')]||0x3;this[_0xe444('0x16')]=_0x55a1e9[_0xe444('0x16')]||0x96;this[_0xe444('0x17')]=_0x55a1e9[_0xe444('0x17')]||0x3;this[_0xe444('0x18')]=_0x55a1e9[_0xe444('0x18')]||0x96;this[_0xe444('0x19')]=_0x55a1e9[_0xe444('0x19')]||0x3;this[_0xe444('0x1a')]=_0x55a1e9[_0xe444('0x1a')]||0x96;this[_0xe444('0x1b')]=_0x55a1e9[_0xe444('0x1b')]||0x3;this[_0xe444('0x1c')]=_0x55a1e9[_0xe444('0x1c')]||0x96;this[_0xe444('0x1d')]=_0x55a1e9['dialOrderByScheduledAt']||_0xe444('0x1e');this[_0xe444('0x1f')]=_0x55a1e9['dialPrefix']||undefined;this[_0xe444('0x20')]=_0x55a1e9['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xe444('0x21')]=_0x55a1e9['dialCutDigit']||undefined;this[_0xe444('0x22')]=_0x55a1e9['TrunkBackup']?_0x55a1e9[_0xe444('0x22')]:undefined;this[_0xe444('0x23')]=_0x55a1e9[_0xe444('0x23')]?_0x55a1e9[_0xe444('0x23')]:undefined;this[_0xe444('0x24')]=_0x55a1e9['Interval']?_0x55a1e9['Interval']:undefined;this[_0xe444('0x25')]=_0x55a1e9[_0xe444('0x25')]?_0x55a1e9['SquareProject']:undefined;this[_0xe444('0x26')]=_0x55a1e9[_0xe444('0x25')]?_0x55a1e9[_0xe444('0x25')][_0xe444('0x0')]:undefined;this[_0xe444('0x27')]=_0x55a1e9[_0xe444('0x27')]||![];this['dialAMDInitialSilence']=_0x55a1e9[_0xe444('0x28')];this[_0xe444('0x29')]=_0x55a1e9[_0xe444('0x29')];this['dialAMDAfterGreetingSilence']=_0x55a1e9[_0xe444('0x2a')];this[_0xe444('0x2b')]=_0x55a1e9[_0xe444('0x2b')];this[_0xe444('0x2c')]=_0x55a1e9[_0xe444('0x2c')];this[_0xe444('0x2d')]=_0x55a1e9[_0xe444('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x55a1e9[_0xe444('0x2e')];this['dialAMDSilenceThreshold']=_0x55a1e9[_0xe444('0x2f')];this[_0xe444('0x30')]=_0x55a1e9['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7595a58..6a403eb 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 _0x553e=['calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum'];(function(_0x1e723e,_0x3640e2){var _0x3c7483=function(_0x4f4217){while(--_0x4f4217){_0x1e723e['push'](_0x1e723e['shift']());}};_0x3c7483(++_0x3640e2);}(_0x553e,0x10f));var _0xe553=function(_0x2687bb,_0x1beb75){_0x2687bb=_0x2687bb-0x0;var _0x34c4a1=_0x553e[_0x2687bb];return _0x34c4a1;};'use strict';function Channel(){this[_0xe553('0x0')]=null;this[_0xe553('0x1')]='';this[_0xe553('0x2')]='';this[_0xe553('0x3')]=0x0;this[_0xe553('0x4')]='';this[_0xe553('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xe553('0x6')]=0x0;this[_0xe553('0x7')]='';this[_0xe553('0x8')]=0x0;this[_0xe553('0x9')]=0x0;this[_0xe553('0xa')]=0x0;this[_0xe553('0xb')]=![];this[_0xe553('0xc')]=null;this['endtime']=null;this[_0xe553('0xd')]=![];this[_0xe553('0xe')]=![];this[_0xe553('0xf')]='';this[_0xe553('0x10')]='';this[_0xe553('0x11')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0xe553('0x12')]=null;this[_0xe553('0x13')]=![];this[_0xe553('0x14')]=null;this[_0xe553('0x15')]=null;this[_0xe553('0x16')]=[];this['transfercalleridnum']=undefined;this[_0xe553('0x17')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0xe553('0x18')]=Channel; \ No newline at end of file +var _0x68c3=['billableseconds','type','tag','monitor','queue','monitors','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','duration'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x68c3,0x8b));var _0x368c=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0x68c3[_0x71cd05];return _0x59c9e7;};'use strict';function Channel(){this[_0x368c('0x0')]=null;this['channel']='';this[_0x368c('0x1')]='';this[_0x368c('0x2')]=0x0;this[_0x368c('0x3')]='';this[_0x368c('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x368c('0x5')]=0x0;this[_0x368c('0x6')]='';this[_0x368c('0x7')]=0x0;this[_0x368c('0x8')]=0x0;this[_0x368c('0x9')]=0x0;this[_0x368c('0xa')]=![];this[_0x368c('0xb')]=null;this[_0x368c('0xc')]=null;this[_0x368c('0xd')]=![];this['abandoned']=![];this[_0x368c('0xe')]='';this[_0x368c('0xf')]='';this[_0x368c('0x10')]=0x0;this[_0x368c('0x11')]=0x0;this['holdtime']=0x0;this[_0x368c('0x12')]=null;this[_0x368c('0x13')]=null;this['disposition']=null;this[_0x368c('0x14')]=![];this['monitorFilename']=null;this[_0x368c('0x15')]=null;this[_0x368c('0x16')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x368c('0x17')]=undefined;this[_0x368c('0x18')]=0x0;}module[_0x368c('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7206a61..d440aec 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 _0x4408=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x4408,0xd9));var _0x8440=function(_0x2a416e,_0x478646){_0x2a416e=_0x2a416e-0x0;var _0x4a4f81=_0x4408[_0x2a416e];return _0x4a4f81;};'use strict';function DeskAccount(_0x2e2e9f){this['id']=_0x2e2e9f['id']||0x0;this[_0x8440('0x0')]=_0x2e2e9f[_0x8440('0x0')]||'';this[_0x8440('0x1')]=_0x2e2e9f[_0x8440('0x1')]||'';this['remoteUri']=_0x2e2e9f[_0x8440('0x2')]||'';this[_0x8440('0x3')]=_0x2e2e9f[_0x8440('0x3')]||'';this[_0x8440('0x4')]=_0x2e2e9f[_0x8440('0x4')]||'';this[_0x8440('0x5')]=_0x2e2e9f[_0x8440('0x5')]||'';this[_0x8440('0x6')]=_0x2e2e9f['consumerSecret']||'';this[_0x8440('0x7')]=_0x2e2e9f[_0x8440('0x7')]||'';this[_0x8440('0x8')]=_0x2e2e9f['tokenSecret']||'';this[_0x8440('0x9')]=_0x2e2e9f[_0x8440('0x9')]||'';this[_0x8440('0xa')]=_0x2e2e9f[_0x8440('0xa')]||'';this[_0x8440('0xb')]=_0x2e2e9f['Configurations']||{};}module[_0x8440('0xc')]=DeskAccount; \ No newline at end of file +var _0x45bc=['serverUrl','Configurations','exports','name','remoteUri','authType','password','consumerKey','token','tokenSecret','type'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x45bc,0x142));var _0xc45b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x45bc[_0x14add3];return _0x4a174f;};'use strict';function DeskAccount(_0x2fc564){this['id']=_0x2fc564['id']||0x0;this['name']=_0x2fc564[_0xc45b('0x0')]||'';this['username']=_0x2fc564['username']||'';this[_0xc45b('0x1')]=_0x2fc564[_0xc45b('0x1')]||'';this[_0xc45b('0x2')]=_0x2fc564[_0xc45b('0x2')]||'';this[_0xc45b('0x3')]=_0x2fc564[_0xc45b('0x3')]||'';this[_0xc45b('0x4')]=_0x2fc564[_0xc45b('0x4')]||'';this['consumerSecret']=_0x2fc564['consumerSecret']||'';this[_0xc45b('0x5')]=_0x2fc564[_0xc45b('0x5')]||'';this[_0xc45b('0x6')]=_0x2fc564['tokenSecret']||'';this[_0xc45b('0x7')]=_0x2fc564[_0xc45b('0x7')]||'';this[_0xc45b('0x8')]=_0x2fc564[_0xc45b('0x8')]||'';this[_0xc45b('0x9')]=_0x2fc564[_0xc45b('0x9')]||{};}module[_0xc45b('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ce94d12..16ee7b1 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 _0x3b7f=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x3b7f,0xbe));var _0xf3b7=function(_0x550204,_0x58d6aa){_0x550204=_0x550204-0x0;var _0x33a54b=_0x3b7f[_0x550204];return _0x33a54b;};'use strict';function Dynamics365Account(_0x3e01df){this['id']=_0x3e01df['id']||0x0;this['name']=_0x3e01df[_0xf3b7('0x0')]||'';this[_0xf3b7('0x1')]=_0x3e01df[_0xf3b7('0x1')]||'';this['password']=_0x3e01df[_0xf3b7('0x2')]||'';this[_0xf3b7('0x3')]=_0x3e01df[_0xf3b7('0x3')]||'';this['tenantId']=_0x3e01df[_0xf3b7('0x4')]||'';this[_0xf3b7('0x5')]=_0x3e01df['clientId']||'';this['clientSecret']=_0x3e01df[_0xf3b7('0x6')]||{};this[_0xf3b7('0x7')]=_0x3e01df['serverUrl']||'';this[_0xf3b7('0x8')]=_0x3e01df[_0xf3b7('0x8')]||![];this[_0xf3b7('0x9')]=_0x3e01df[_0xf3b7('0x9')]||{};this[_0xf3b7('0xa')]=_0x3e01df[_0xf3b7('0xa')]||{};}module[_0xf3b7('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x9b9a=['Configurations','CloudProvider','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x128c21,_0x5e4b3d){var _0x4e222d=function(_0xcf56ea){while(--_0xcf56ea){_0x128c21['push'](_0x128c21['shift']());}};_0x4e222d(++_0x5e4b3d);}(_0x9b9a,0xff));var _0xa9b9=function(_0x70ea1b,_0x536395){_0x70ea1b=_0x70ea1b-0x0;var _0xe73e0b=_0x9b9a[_0x70ea1b];return _0xe73e0b;};'use strict';function Dynamics365Account(_0x7f6d7){this['id']=_0x7f6d7['id']||0x0;this['name']=_0x7f6d7[_0xa9b9('0x0')]||'';this[_0xa9b9('0x1')]=_0x7f6d7[_0xa9b9('0x1')]||'';this[_0xa9b9('0x2')]=_0x7f6d7[_0xa9b9('0x2')]||'';this[_0xa9b9('0x3')]=_0x7f6d7['remoteUri']||'';this[_0xa9b9('0x4')]=_0x7f6d7['tenantId']||'';this[_0xa9b9('0x5')]=_0x7f6d7[_0xa9b9('0x5')]||'';this[_0xa9b9('0x6')]=_0x7f6d7['clientSecret']||{};this[_0xa9b9('0x7')]=_0x7f6d7[_0xa9b9('0x7')]||'';this['modernAuthentication']=_0x7f6d7[_0xa9b9('0x8')]||![];this[_0xa9b9('0x9')]=_0x7f6d7[_0xa9b9('0x9')]||{};this[_0xa9b9('0xa')]=_0x7f6d7[_0xa9b9('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 36adbfd..d3e7fff 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 _0xb4d9=['tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x265565,_0x46c184){var _0x61c377=function(_0x16bde9){while(--_0x16bde9){_0x265565['push'](_0x265565['shift']());}};_0x61c377(++_0x46c184);}(_0xb4d9,0x1af));var _0x9b4d=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb4d9[_0xc4001c];return _0x49f7bc;};'use strict';function FaxAccount(_0x5fb3bb){this['id']=_0x5fb3bb['id']||0x0;this[_0x9b4d('0x0')]=_0x5fb3bb[_0x9b4d('0x0')]||'';this['description']=_0x5fb3bb[_0x9b4d('0x1')];this[_0x9b4d('0x2')]=_0x5fb3bb['ecm'];this['headerinfo']=_0x5fb3bb[_0x9b4d('0x3')];this[_0x9b4d('0x4')]=_0x5fb3bb[_0x9b4d('0x4')];this['minrate']=_0x5fb3bb['minrate']||0x960;this[_0x9b4d('0x5')]=_0x5fb3bb[_0x9b4d('0x5')]||0x3840;this[_0x9b4d('0x6')]=_0x5fb3bb['modem']||_0x9b4d('0x7');this[_0x9b4d('0x8')]=_0x5fb3bb[_0x9b4d('0x8')]||'no';this['faxdetect']=_0x5fb3bb[_0x9b4d('0x9')]||'no';this[_0x9b4d('0xa')]=_0x5fb3bb[_0x9b4d('0xa')]||0x1388;this[_0x9b4d('0xb')]=_0x5fb3bb[_0x9b4d('0xb')]||_0x9b4d('0xc');this[_0x9b4d('0xd')]=_0x5fb3bb[_0x9b4d('0xd')]?_0x5fb3bb[_0x9b4d('0xd')]:undefined;this[_0x9b4d('0xe')]=_0x5fb3bb[_0x9b4d('0xe')];this[_0x9b4d('0xf')]=_0x5fb3bb[_0x9b4d('0xf')];}module[_0x9b4d('0x10')]=FaxAccount; \ No newline at end of file +var _0x68d3=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId'];(function(_0x1d5397,_0x5c4771){var _0x52ecea=function(_0x43aeb2){while(--_0x43aeb2){_0x1d5397['push'](_0x1d5397['shift']());}};_0x52ecea(++_0x5c4771);}(_0x68d3,0x162));var _0x368d=function(_0x3f0df6,_0x6b43c3){_0x3f0df6=_0x3f0df6-0x0;var _0x322434=_0x68d3[_0x3f0df6];return _0x322434;};'use strict';function FaxAccount(_0x4414a6){this['id']=_0x4414a6['id']||0x0;this[_0x368d('0x0')]=_0x4414a6[_0x368d('0x0')]||'';this[_0x368d('0x1')]=_0x4414a6[_0x368d('0x1')];this[_0x368d('0x2')]=_0x4414a6[_0x368d('0x2')];this['headerinfo']=_0x4414a6[_0x368d('0x3')];this[_0x368d('0x4')]=_0x4414a6[_0x368d('0x4')];this[_0x368d('0x5')]=_0x4414a6['minrate']||0x960;this[_0x368d('0x6')]=_0x4414a6['maxrate']||0x3840;this[_0x368d('0x7')]=_0x4414a6[_0x368d('0x7')]||'v17,v27,v29';this['gateway']=_0x4414a6[_0x368d('0x8')]||'no';this['faxdetect']=_0x4414a6[_0x368d('0x9')]||'no';this[_0x368d('0xa')]=_0x4414a6['t38timeout']||0x1388;this[_0x368d('0xb')]=_0x4414a6[_0x368d('0xb')]||'SIP';this[_0x368d('0xc')]=_0x4414a6[_0x368d('0xc')]?_0x4414a6[_0x368d('0xc')]:undefined;this[_0x368d('0xd')]=_0x4414a6['ListId'];this[_0x368d('0xe')]=_0x4414a6[_0x368d('0xe')];}module[_0x368d('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ac7f22d..4d957e8 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 _0x38bd=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x25ff2f,_0x5c70dc){var _0x5c2cb2=function(_0x7a945a){while(--_0x7a945a){_0x25ff2f['push'](_0x25ff2f['shift']());}};_0x5c2cb2(++_0x5c70dc);}(_0x38bd,0x92));var _0xd38b=function(_0x5dcc71,_0x29a28f){_0x5dcc71=_0x5dcc71-0x0;var _0x4a2e76=_0x38bd[_0x5dcc71];return _0x4a2e76;};'use strict';function FreshdeskAccount(_0x25e077){this['id']=_0x25e077['id']||0x0;this[_0xd38b('0x0')]=_0x25e077[_0xd38b('0x0')]||'';this[_0xd38b('0x1')]=_0x25e077['username']||'';this['apiKey']=_0x25e077[_0xd38b('0x2')]||'';this[_0xd38b('0x3')]=_0x25e077[_0xd38b('0x3')]||'';this[_0xd38b('0x4')]=_0x25e077[_0xd38b('0x4')]||'';this[_0xd38b('0x5')]=_0x25e077[_0xd38b('0x5')]||{};}module[_0xd38b('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x0217=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4afe3b,_0x255e0d){var _0x2c22d1=function(_0x313847){while(--_0x313847){_0x4afe3b['push'](_0x4afe3b['shift']());}};_0x2c22d1(++_0x255e0d);}(_0x0217,0x1af));var _0x7021=function(_0x574858,_0x3fd612){_0x574858=_0x574858-0x0;var _0x30010a=_0x0217[_0x574858];return _0x30010a;};'use strict';function FreshdeskAccount(_0x4e9143){this['id']=_0x4e9143['id']||0x0;this[_0x7021('0x0')]=_0x4e9143['name']||'';this[_0x7021('0x1')]=_0x4e9143[_0x7021('0x1')]||'';this['apiKey']=_0x4e9143['token']||'';this[_0x7021('0x2')]=_0x4e9143[_0x7021('0x2')]||'';this[_0x7021('0x3')]=_0x4e9143[_0x7021('0x3')]||'';this[_0x7021('0x4')]=_0x4e9143[_0x7021('0x4')]||{};}module[_0x7021('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 34db57f..ea21c9f 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 _0xbe52=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x45dafa,_0x171e29){var _0xeb385a=function(_0x2491d0){while(--_0x2491d0){_0x45dafa['push'](_0x45dafa['shift']());}};_0xeb385a(++_0x171e29);}(_0xbe52,0x164));var _0x2be5=function(_0x51ebfc,_0x31f722){_0x51ebfc=_0x51ebfc-0x0;var _0x528ca4=_0xbe52[_0x51ebfc];return _0x528ca4;};'use strict';function FreshsalesAccount(_0x21fb70){this['id']=_0x21fb70['id']||0x0;this[_0x2be5('0x0')]=_0x21fb70[_0x2be5('0x0')]||'';this[_0x2be5('0x1')]=_0x21fb70[_0x2be5('0x1')]||'';this['apiKey']=_0x21fb70[_0x2be5('0x2')]||'';this[_0x2be5('0x3')]=_0x21fb70[_0x2be5('0x3')]||'';this[_0x2be5('0x4')]=_0x21fb70[_0x2be5('0x4')]||'';this[_0x2be5('0x5')]=_0x21fb70[_0x2be5('0x5')]||{};}module[_0x2be5('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x8d0a=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0xe1b7b3,_0x48cfb0){var _0x1fb71c=function(_0x4e1093){while(--_0x4e1093){_0xe1b7b3['push'](_0xe1b7b3['shift']());}};_0x1fb71c(++_0x48cfb0);}(_0x8d0a,0x65));var _0xa8d0=function(_0x39f850,_0x280c4c){_0x39f850=_0x39f850-0x0;var _0x57f7a3=_0x8d0a[_0x39f850];return _0x57f7a3;};'use strict';function FreshsalesAccount(_0x3c4ce0){this['id']=_0x3c4ce0['id']||0x0;this['name']=_0x3c4ce0[_0xa8d0('0x0')]||'';this[_0xa8d0('0x1')]=_0x3c4ce0[_0xa8d0('0x1')]||'';this[_0xa8d0('0x2')]=_0x3c4ce0[_0xa8d0('0x3')]||'';this[_0xa8d0('0x4')]=_0x3c4ce0[_0xa8d0('0x4')]||'';this[_0xa8d0('0x5')]=_0x3c4ce0[_0xa8d0('0x5')]||'';this['Configurations']=_0x3c4ce0[_0xa8d0('0x6')]||{};}module[_0xa8d0('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 3179348..98c73e9 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 _0x991c=['calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum'];(function(_0x576de1,_0x25656b){var _0x31ed89=function(_0x15c4bf){while(--_0x15c4bf){_0x576de1['push'](_0x576de1['shift']());}};_0x31ed89(++_0x25656b);}(_0x991c,0xc0));var _0xc991=function(_0x5de10b,_0x1c9a8f){_0x5de10b=_0x5de10b-0x0;var _0x56f9f7=_0x991c[_0x5de10b];return _0x56f9f7;};'use strict';function QueueReport(){this[_0xc991('0x0')]=_0xc991('0x1');this[_0xc991('0x2')]='';this[_0xc991('0x3')]='';this[_0xc991('0x4')]='';this[_0xc991('0x5')]='';this[_0xc991('0x6')]=null;this[_0xc991('0x7')]=null;this['position']=0x1;this[_0xc991('0x8')]=0x1;this[_0xc991('0x9')]=![];this[_0xc991('0xa')]=null;this[_0xc991('0xb')]=![];this[_0xc991('0xc')]=null;this[_0xc991('0xd')]=![];this[_0xc991('0xe')]=null;this['originalposition']=0x1;this[_0xc991('0xf')]='';this[_0xc991('0x10')]='';this[_0xc991('0x11')]='';this[_0xc991('0x12')]='';this[_0xc991('0x13')]='';this[_0xc991('0x14')]='';this[_0xc991('0x15')]='';this['holdtime']=0x0;this[_0xc991('0x16')]=![];this[_0xc991('0x17')]='';this[_0xc991('0x18')]=_0xc991('0x19');this[_0xc991('0x1a')]=0x0;this[_0xc991('0x1b')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x719a=['queuecallercompleteAt','queuecallerexitAt','channel','connectedlinenum','connectedlinename','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete'];(function(_0x505e5f,_0x3238c6){var _0x5de7a9=function(_0x352542){while(--_0x352542){_0x505e5f['push'](_0x505e5f['shift']());}};_0x5de7a9(++_0x3238c6);}(_0x719a,0x1e2));var _0xa719=function(_0x10ca94,_0x3070a5){_0x10ca94=_0x10ca94-0x0;var _0x24a46d=_0x719a[_0x10ca94];return _0x24a46d;};'use strict';function QueueReport(){this[_0xa719('0x0')]='inbound';this[_0xa719('0x1')]='';this[_0xa719('0x2')]='';this[_0xa719('0x3')]='';this[_0xa719('0x4')]='';this[_0xa719('0x5')]=null;this[_0xa719('0x6')]=null;this[_0xa719('0x7')]=0x1;this[_0xa719('0x8')]=0x1;this[_0xa719('0x9')]=![];this[_0xa719('0xa')]=null;this[_0xa719('0xb')]=![];this[_0xa719('0xc')]=null;this['queuecallerexit']=![];this[_0xa719('0xd')]=null;this['originalposition']=0x1;this[_0xa719('0xe')]='';this[_0xa719('0xf')]='';this[_0xa719('0x10')]='';this['accountcode']='';this[_0xa719('0x11')]='';this[_0xa719('0x12')]='';this[_0xa719('0x13')]='';this[_0xa719('0x14')]=0x0;this['assigned']=![];this[_0xa719('0x15')]='';this[_0xa719('0x16')]=_0xa719('0x17');this[_0xa719('0x18')]=0x0;this[_0xa719('0x19')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 26ecb07..801052e 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 _0xc8a4=['type','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xc8a4,0x99));var _0x4c8a=function(_0xcb5c7,_0x39d0f3){_0xcb5c7=_0xcb5c7-0x0;var _0x46ceb2=_0xc8a4[_0xcb5c7];return _0x46ceb2;};'use strict';function SalesforceAccount(_0x2a20d7){this['id']=_0x2a20d7['id']||0x0;this[_0x4c8a('0x0')]=_0x2a20d7[_0x4c8a('0x0')]||'';this[_0x4c8a('0x1')]=_0x2a20d7['username']||'';this[_0x4c8a('0x2')]=_0x2a20d7[_0x4c8a('0x2')]||'';this[_0x4c8a('0x3')]=_0x2a20d7[_0x4c8a('0x3')]||'';this[_0x4c8a('0x4')]=_0x2a20d7['clientId']||'';this['clientSecret']=_0x2a20d7[_0x4c8a('0x5')]||'';this[_0x4c8a('0x6')]=_0x2a20d7['securityToken']||'';this[_0x4c8a('0x7')]=_0x2a20d7[_0x4c8a('0x7')]||'integrationTab';this[_0x4c8a('0x8')]=_0x2a20d7['serverUrl']||'';this[_0x4c8a('0x9')]=_0x2a20d7[_0x4c8a('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x6219=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x8ac845,_0x535da8){var _0x3f69ce=function(_0x58bff1){while(--_0x58bff1){_0x8ac845['push'](_0x8ac845['shift']());}};_0x3f69ce(++_0x535da8);}(_0x6219,0xc4));var _0x9621=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0x6219[_0x1e081a];return _0x428209;};'use strict';function SalesforceAccount(_0x4da812){this['id']=_0x4da812['id']||0x0;this[_0x9621('0x0')]=_0x4da812[_0x9621('0x0')]||'';this[_0x9621('0x1')]=_0x4da812[_0x9621('0x1')]||'';this[_0x9621('0x2')]=_0x4da812['remoteUri']||'';this[_0x9621('0x3')]=_0x4da812[_0x9621('0x3')]||'';this['clientId']=_0x4da812[_0x9621('0x4')]||'';this[_0x9621('0x5')]=_0x4da812[_0x9621('0x5')]||'';this[_0x9621('0x6')]=_0x4da812['securityToken']||'';this[_0x9621('0x7')]=_0x4da812[_0x9621('0x7')]||_0x9621('0x8');this[_0x9621('0x9')]=_0x4da812[_0x9621('0x9')]||'';this[_0x9621('0xa')]=_0x4da812['Configurations']||{};}module[_0x9621('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index a2a49e1..49940dc 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 _0xa780=['remoteUri','Configurations','name','username','password'];(function(_0x2513d4,_0x4fa5b9){var _0x4e92ee=function(_0x494d6f){while(--_0x494d6f){_0x2513d4['push'](_0x2513d4['shift']());}};_0x4e92ee(++_0x4fa5b9);}(_0xa780,0x151));var _0x0a78=function(_0x2f53c7,_0x22810a){_0x2f53c7=_0x2f53c7-0x0;var _0x5955f0=_0xa780[_0x2f53c7];return _0x5955f0;};'use strict';function ServicenowAccount(_0x3f7a36){this['id']=_0x3f7a36['id']||0x0;this[_0x0a78('0x0')]=_0x3f7a36[_0x0a78('0x0')]||'';this['username']=_0x3f7a36[_0x0a78('0x1')]||'';this['password']=_0x3f7a36[_0x0a78('0x2')]||'';this[_0x0a78('0x3')]=_0x3f7a36['remoteUri']||'';this['serverUrl']=_0x3f7a36['serverUrl']||'';this[_0x0a78('0x4')]=_0x3f7a36['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xe7c0=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x485817,_0xbaea3){var _0x1bfb72=function(_0x5bd0b9){while(--_0x5bd0b9){_0x485817['push'](_0x485817['shift']());}};_0x1bfb72(++_0xbaea3);}(_0xe7c0,0x1ae));var _0x0e7c=function(_0x1eaf5e,_0x333d16){_0x1eaf5e=_0x1eaf5e-0x0;var _0x409fa2=_0xe7c0[_0x1eaf5e];return _0x409fa2;};'use strict';function ServicenowAccount(_0xacf68f){this['id']=_0xacf68f['id']||0x0;this[_0x0e7c('0x0')]=_0xacf68f[_0x0e7c('0x0')]||'';this['username']=_0xacf68f['username']||'';this[_0x0e7c('0x1')]=_0xacf68f[_0x0e7c('0x1')]||'';this[_0x0e7c('0x2')]=_0xacf68f[_0x0e7c('0x2')]||'';this[_0x0e7c('0x3')]=_0xacf68f[_0x0e7c('0x3')]||'';this[_0x0e7c('0x4')]=_0xacf68f[_0x0e7c('0x4')]||{};}module[_0x0e7c('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 81fe5d2..16400f4 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 _0x54a9=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3d5a50,_0x276d89){var _0x45edc2=function(_0x5ccff3){while(--_0x5ccff3){_0x3d5a50['push'](_0x3d5a50['shift']());}};_0x45edc2(++_0x276d89);}(_0x54a9,0x186));var _0x954a=function(_0x3d1e37,_0xc68814){_0x3d1e37=_0x3d1e37-0x0;var _0x246053=_0x54a9[_0x3d1e37];return _0x246053;};'use strict';function SugarcrmAccount(_0xba7292){this['id']=_0xba7292['id']||0x0;this['name']=_0xba7292[_0x954a('0x0')]||'';this['username']=_0xba7292[_0x954a('0x1')]||'';this[_0x954a('0x2')]=_0xba7292[_0x954a('0x2')]||'';this[_0x954a('0x3')]=_0xba7292[_0x954a('0x3')]||'';this[_0x954a('0x4')]=_0xba7292[_0x954a('0x4')]||'';this['Configurations']=_0xba7292[_0x954a('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x7e62=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x441cc0,_0x205b84){var _0x599a84=function(_0x574f30){while(--_0x574f30){_0x441cc0['push'](_0x441cc0['shift']());}};_0x599a84(++_0x205b84);}(_0x7e62,0x15a));var _0x27e6=function(_0x12369c,_0xe97a11){_0x12369c=_0x12369c-0x0;var _0x3ce340=_0x7e62[_0x12369c];return _0x3ce340;};'use strict';function SugarcrmAccount(_0x2d5ac){this['id']=_0x2d5ac['id']||0x0;this[_0x27e6('0x0')]=_0x2d5ac['name']||'';this[_0x27e6('0x1')]=_0x2d5ac[_0x27e6('0x1')]||'';this['password']=_0x2d5ac['password']||'';this[_0x27e6('0x2')]=_0x2d5ac['remoteUri']||'';this[_0x27e6('0x3')]=_0x2d5ac[_0x27e6('0x3')]||'';this[_0x27e6('0x4')]=_0x2d5ac['Configurations']||{};}module[_0x27e6('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 21ab703..55965e0 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 _0xf269=['name','accountcode','state','unknown','status','address','exports'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xf269,0xd2));var _0x9f26=function(_0x1ab342,_0x92ea3c){_0x1ab342=_0x1ab342-0x0;var _0x3751d1=_0xf269[_0x1ab342];return _0x3751d1;};'use strict';function Telephone(_0x3c1489){this['id']=_0x3c1489['id']||0x0;this[_0x9f26('0x0')]=_0x3c1489[_0x9f26('0x0')]||'';this['accountcode']=_0x3c1489[_0x9f26('0x1')]||'';this[_0x9f26('0x2')]=_0x9f26('0x3');this['stateTime']=0x0;this[_0x9f26('0x4')]='unknown';this[_0x9f26('0x5')]='';}module[_0x9f26('0x6')]=Telephone; \ No newline at end of file +var _0x2182=['address','exports','name','accountcode','state','stateTime','status','unknown'];(function(_0x554936,_0x469ccc){var _0x30f597=function(_0x3e2240){while(--_0x3e2240){_0x554936['push'](_0x554936['shift']());}};_0x30f597(++_0x469ccc);}(_0x2182,0xea));var _0x2218=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2182[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x3bda3e){this['id']=_0x3bda3e['id']||0x0;this[_0x2218('0x0')]=_0x3bda3e[_0x2218('0x0')]||'';this[_0x2218('0x1')]=_0x3bda3e['accountcode']||'';this[_0x2218('0x2')]='unknown';this[_0x2218('0x3')]=0x0;this[_0x2218('0x4')]=_0x2218('0x5');this[_0x2218('0x6')]='';}module[_0x2218('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 8020eaa..fbffc6f 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(_0x4298fa,_0x3e6203){var _0x518fe7=function(_0x2683c1){while(--_0x2683c1){_0x4298fa['push'](_0x4298fa['shift']());}};_0x518fe7(++_0x3e6203);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x429eee,_0x550b5f){var _0x250180=function(_0x2026e1){while(--_0x2026e1){_0x429eee['push'](_0x429eee['shift']());}};_0x250180(++_0x550b5f);}(_0xb10b,0x12a));var _0xbb10=function(_0x41da6,_0x42431b){_0x41da6=_0x41da6-0x0;var _0x282340=_0xb10b[_0x41da6];return _0x282340;};'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 bfbd1b5..fbf9f5a 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 _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5f2f=['AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0xac72f7,_0x237a87){var _0x5b1c13=function(_0x465d93){while(--_0x465d93){_0xac72f7['push'](_0xac72f7['shift']());}};_0x5b1c13(++_0x237a87);}(_0x5f2f,0x73));var _0xf5f2=function(_0x246331,_0x19793b){_0x246331=_0x246331-0x0;var _0xfeb210=_0x5f2f[_0x246331];return _0xfeb210;};'use strict';function Trigger(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||_0xf5f2('0x2');this[_0xf5f2('0x3')]=_0x7c86d8[_0xf5f2('0x3')]||![];this['AllConditions']=_0x7c86d8['AllConditions']||[];this[_0xf5f2('0x4')]=_0x7c86d8[_0xf5f2('0x4')]||[];this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||[];}module[_0xf5f2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 6d417b2..897c701 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 _0xd3c1=['port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','stateTime','status','unknown','registry','indexOf','split','host'];(function(_0x116785,_0x438b60){var _0x3e85d7=function(_0x5274eb){while(--_0x5274eb){_0x116785['push'](_0x116785['shift']());}};_0x3e85d7(++_0x438b60);}(_0xd3c1,0x1a7));var _0x1d3c=function(_0x48246c,_0x4db4e8){_0x48246c=_0x48246c-0x0;var _0x3e4397=_0xd3c1[_0x48246c];return _0x3e4397;};'use strict';function Trunk(_0x204e7a){this['id']=_0x204e7a['id']||0x0;this[_0x1d3c('0x0')]=_0x204e7a['active']||![];this['name']=_0x204e7a[_0x1d3c('0x1')]||'';this['state']='unknown';this[_0x1d3c('0x2')]=0x0;this[_0x1d3c('0x3')]=_0x1d3c('0x4');this[_0x1d3c('0x5')]=_0x204e7a['registry']&&_0x204e7a['registry'][_0x1d3c('0x6')](':')?_0x204e7a[_0x1d3c('0x5')][_0x1d3c('0x7')](':')[0x0]:'';this[_0x1d3c('0x8')]='';this[_0x1d3c('0x9')]='';this[_0x1d3c('0xa')]='';this[_0x1d3c('0xb')]='';this[_0x1d3c('0xc')]='';this[_0x1d3c('0xd')]=_0x1d3c('0x4');this[_0x1d3c('0xe')]='';this[_0x1d3c('0xf')]='';this[_0x1d3c('0x10')]=_0x204e7a['defaultuser']||'';}module[_0x1d3c('0x11')]=Trunk; \ No newline at end of file +var _0xc71a=['unknown','stateTime','registry','indexOf','split','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name'];(function(_0x4ad14b,_0x26b9e9){var _0x2c219e=function(_0x59eda4){while(--_0x59eda4){_0x4ad14b['push'](_0x4ad14b['shift']());}};_0x2c219e(++_0x26b9e9);}(_0xc71a,0x184));var _0xac71=function(_0x5d8992,_0x24fcb5){_0x5d8992=_0x5d8992-0x0;var _0x477d5f=_0xc71a[_0x5d8992];return _0x477d5f;};'use strict';function Trunk(_0x8d77fa){this['id']=_0x8d77fa['id']||0x0;this[_0xac71('0x0')]=_0x8d77fa[_0xac71('0x0')]||![];this[_0xac71('0x1')]=_0x8d77fa[_0xac71('0x1')]||'';this['state']=_0xac71('0x2');this[_0xac71('0x3')]=0x0;this['status']='unknown';this['registry']=_0x8d77fa['registry']&&_0x8d77fa[_0xac71('0x4')][_0xac71('0x5')](':')?_0x8d77fa['registry'][_0xac71('0x6')](':')[0x0]:'';this[_0xac71('0x7')]='';this['port']='';this[_0xac71('0x8')]='';this[_0xac71('0x9')]='';this[_0xac71('0xa')]='';this[_0xac71('0xb')]=_0xac71('0x2');this[_0xac71('0xc')]='';this[_0xac71('0xd')]='';this['defaultuser']=_0x8d77fa[_0xac71('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 8022ac1..1d0c430 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 _0x0e0e=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0e0e,0x15e));var _0xe0e0=function(_0x29e4c0,_0xf8b14d){_0x29e4c0=_0x29e4c0-0x0;var _0x15b64b=_0x0e0e[_0x29e4c0];return _0x15b64b;};'use strict';function voiceExtension(_0x4ba3af){this['id']=_0x4ba3af['id']||0x0;this[_0xe0e0('0x0')]=_0x4ba3af['exten']||'';this[_0xe0e0('0x1')]=_0x4ba3af[_0xe0e0('0x1')]||_0xe0e0('0x2');this['mandatoryDisposition']=_0x4ba3af[_0xe0e0('0x3')]||![];}module[_0xe0e0('0x4')]=voiceExtension; \ No newline at end of file +var _0x6476=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x2d38ad,_0x49c7b7){var _0x35d12b=function(_0x3916e1){while(--_0x3916e1){_0x2d38ad['push'](_0x2d38ad['shift']());}};_0x35d12b(++_0x49c7b7);}(_0x6476,0x1cb));var _0x6647=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6476[_0xa1e3e3];return _0xc980e9;};'use strict';function voiceExtension(_0x57240b){this['id']=_0x57240b['id']||0x0;this[_0x6647('0x0')]=_0x57240b[_0x6647('0x0')]||'';this[_0x6647('0x1')]=_0x57240b[_0x6647('0x1')]||'none';this['mandatoryDisposition']=_0x57240b[_0x6647('0x2')]||![];}module[_0x6647('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 980fa59..04dbce8 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 _0x09da=['unavailable','unknown','acw','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','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','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','name','monitor_format','type','inbound','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','onHold','ringing','ringInUse'];(function(_0x2ccc13,_0x53efad){var _0x3819b6=function(_0x2ad293){while(--_0x2ad293){_0x2ccc13['push'](_0x2ccc13['shift']());}};_0x3819b6(++_0x53efad);}(_0x09da,0xf4));var _0xa09d=function(_0x43cbd2,_0x3bf672){_0x43cbd2=_0x43cbd2-0x0;var _0x567296=_0x09da[_0x43cbd2];return _0x567296;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xa09d('0x0'),'gsm':_0xa09d('0x1')};var strategy={'fewestcalls':_0xa09d('0x2'),'leastrecent':_0xa09d('0x3'),'linear':_0xa09d('0x4'),'random':_0xa09d('0x5'),'ringall':_0xa09d('0x6'),'rr':'roundrobin','rrmemory':_0xa09d('0x7'),'rrordered':_0xa09d('0x8'),'wrandom':'wrandom'};function VoiceQueue(_0x45cf7e){this['id']=_0x45cf7e['id']||0x0;this[_0xa09d('0x9')]=_0x45cf7e[_0xa09d('0x9')]||'';this[_0xa09d('0xa')]=_0x45cf7e['monitor_format']||'';this['type']=_0x45cf7e[_0xa09d('0xb')]||_0xa09d('0xc');this['waiting']=0x0;this[_0xa09d('0xd')]=0x0;this['answered']=0x0;this[_0xa09d('0xe')]=0x0;this[_0xa09d('0xf')]=0x0;this[_0xa09d('0x10')]=0x0;this[_0xa09d('0x11')]=0x0;this[_0xa09d('0x12')]=0x0;this[_0xa09d('0x13')]=0x0;this[_0xa09d('0x14')]=0x0;this[_0xa09d('0x15')]=0x0;this[_0xa09d('0x16')]=0x0;this[_0xa09d('0x17')]=0x0;this[_0xa09d('0x18')]=0x0;this[_0xa09d('0x19')]=0x0;this['paused']=0x0;this[_0xa09d('0x1a')]=0x0;this[_0xa09d('0x1b')]=0x0;this['talking']=0x0;this[_0xa09d('0x1c')]=0x0;this[_0xa09d('0x1d')]=0x0;this[_0xa09d('0x1e')]=_0x45cf7e['acw']||![];this['acwTimeout']=_0x45cf7e['acwTimeout']||0xa;this[_0xa09d('0x1f')]=_0x45cf7e[_0xa09d('0x1f')]||'no';this[_0xa09d('0x20')]=!![];this[_0xa09d('0x21')]='';this[_0xa09d('0x22')]='';this['originated']=0x0;this[_0xa09d('0x23')]=0x0;this[_0xa09d('0x24')]=_0x45cf7e[_0xa09d('0x24')]||null;this[_0xa09d('0x25')]=_0x45cf7e[_0xa09d('0x25')]?_0x45cf7e['dialGlobalInterval']:null;this[_0xa09d('0x26')]=_0x45cf7e[_0xa09d('0x26')];this[_0xa09d('0x27')]=_0x45cf7e[_0xa09d('0x27')]||_0xa09d('0x28');this[_0xa09d('0x29')]=_0x45cf7e[_0xa09d('0x29')]||0x0;this[_0xa09d('0x2a')]=_0x45cf7e[_0xa09d('0x2a')]||0x0;this[_0xa09d('0x2b')]=_0x45cf7e[_0xa09d('0x2b')]||0x1;this[_0xa09d('0x2c')]=_0x45cf7e[_0xa09d('0x2c')]||_0xa09d('0x2d');this['dialPredictiveOptimizationPercentage']=_0x45cf7e[_0xa09d('0x2e')]||0.03;this['dialPredictiveInterval']=_0x45cf7e['dialPredictiveInterval']||0x258;this[_0xa09d('0x2f')]=_0x45cf7e[_0xa09d('0x2f')]||_0xa09d('0x30');this[_0xa09d('0x31')]=_0x45cf7e[_0xa09d('0x31')]||_0xa09d('0x30');this[_0xa09d('0x32')]=_0x45cf7e[_0xa09d('0x32')]||0x1e;this['dialQueueOptions']=_0x45cf7e[_0xa09d('0x33')]||_0xa09d('0x34');this['dialQueueTimeout']=_0x45cf7e['dialQueueTimeout']||0x3;this[_0xa09d('0x35')]=_0x45cf7e[_0xa09d('0x35')]||undefined;this[_0xa09d('0x36')]=_0x45cf7e['dialCongestionMaxRetry']||0x3;this[_0xa09d('0x37')]=_0x45cf7e[_0xa09d('0x37')]||0x96;this[_0xa09d('0x38')]=_0x45cf7e['dialBusyMaxRetry']||0x3;this[_0xa09d('0x39')]=_0x45cf7e[_0xa09d('0x39')]||0x96;this[_0xa09d('0x3a')]=_0x45cf7e['dialNoAnswerMaxRetry']||0x3;this[_0xa09d('0x3b')]=_0x45cf7e[_0xa09d('0x3b')]||0x96;this[_0xa09d('0x3c')]=_0x45cf7e[_0xa09d('0x3c')]||0x3;this[_0xa09d('0x3d')]=_0x45cf7e['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x45cf7e[_0xa09d('0x3e')]||0x3;this[_0xa09d('0x3f')]=_0x45cf7e[_0xa09d('0x3f')]||0x96;this['dialAbandonedMaxRetry']=_0x45cf7e[_0xa09d('0x40')]||0x3;this[_0xa09d('0x41')]=_0x45cf7e['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x45cf7e[_0xa09d('0x42')]||0x3;this[_0xa09d('0x43')]=_0x45cf7e[_0xa09d('0x43')]||0x96;this[_0xa09d('0x44')]=_0x45cf7e[_0xa09d('0x44')]||0x3;this[_0xa09d('0x45')]=_0x45cf7e['dialAgentRejectRetryFrequency']||0x96;this[_0xa09d('0x46')]=_0x45cf7e[_0xa09d('0x46')]||0x3;this[_0xa09d('0x47')]=_0x45cf7e['dialGlobalMaxRetry']||0x4;this[_0xa09d('0x48')]=_0x45cf7e[_0xa09d('0x48')]?_0x45cf7e[_0xa09d('0x48')]:undefined;this[_0xa09d('0x49')]=_0x45cf7e['TrunkBackup']?_0x45cf7e[_0xa09d('0x49')]:undefined;this[_0xa09d('0x4a')]=_0x45cf7e[_0xa09d('0x4a')]||undefined;this[_0xa09d('0x4b')]=_0x45cf7e[_0xa09d('0x4b')]?_0x45cf7e['Interval']:undefined;this[_0xa09d('0x4c')]=_0x45cf7e[_0xa09d('0x4c')]||_0xa09d('0x4d');this[_0xa09d('0x4e')]=_0x45cf7e[_0xa09d('0x4e')]||undefined;this[_0xa09d('0x4f')]=_0x45cf7e[_0xa09d('0x4f')]||undefined;this['strategy']=strategy[_0x45cf7e[_0xa09d('0x50')]];this[_0xa09d('0x51')]=!![];this[_0xa09d('0x52')]=_0x45cf7e[_0xa09d('0x52')]||![];this[_0xa09d('0x53')]=_0x45cf7e[_0xa09d('0x53')];this[_0xa09d('0x54')]=_0x45cf7e[_0xa09d('0x54')];this['dialAMDAfterGreetingSilence']=_0x45cf7e[_0xa09d('0x55')];this[_0xa09d('0x56')]=_0x45cf7e['dialAMDTotalAnalysisTime'];this[_0xa09d('0x57')]=_0x45cf7e[_0xa09d('0x57')];this[_0xa09d('0x58')]=_0x45cf7e['dialAMDBetweenWordsSilence'];this[_0xa09d('0x59')]=_0x45cf7e[_0xa09d('0x59')];this[_0xa09d('0x5a')]=_0x45cf7e['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x45cf7e[_0xa09d('0x5b')];this[_0xa09d('0x5c')]=0x0;this['pTalking']=0x0;this[_0xa09d('0x5d')]=_0x45cf7e[_0xa09d('0x5d')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xa09d('0x5e')]=0x0;this[_0xa09d('0x5f')]=0x0;this[_0xa09d('0x60')]=0x0;this[_0xa09d('0x61')]=0x0;this[_0xa09d('0x62')]=0x0;this[_0xa09d('0x63')]=0x0;this[_0xa09d('0x64')]=0x0;this[_0xa09d('0x65')]=0x0;this[_0xa09d('0x66')]=0x0;this[_0xa09d('0x67')]=0x0;this[_0xa09d('0x68')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xa09d('0x69')]=undefined;this[_0xa09d('0x6a')]=undefined;this[_0xa09d('0x6b')]=undefined;this[_0xa09d('0x6c')]=1.05;this[_0xa09d('0x6d')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xa09d('0x6e')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xa09d('0x6f')]=0x0;this[_0xa09d('0x70')]=0x0;this[_0xa09d('0x71')]=0x0;this[_0xa09d('0x72')]=0x0;this[_0xa09d('0x73')]=_0x45cf7e['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xa09d('0x74')]=_0x45cf7e[_0xa09d('0x75')]||0xa;this[_0xa09d('0x76')]=0x0;this[_0xa09d('0x77')]=0x0;this[_0xa09d('0x78')]=0x1;this[_0xa09d('0x79')]=0x0;this[_0xa09d('0x7a')]=0x0;this[_0xa09d('0x7b')]=0x0;this[_0xa09d('0x7c')]=0x0;this[_0xa09d('0x7d')]=_0x45cf7e[_0xa09d('0x7d')]||0x1e;this[_0xa09d('0x7e')]=_0x45cf7e['dialRecallInQueue']||![];this[_0xa09d('0x7f')]=!!_0x45cf7e[_0xa09d('0x7f')]||![];this[_0xa09d('0x80')]=!!_0x45cf7e[_0xa09d('0x80')]||![];this[_0xa09d('0x81')]=_0x45cf7e[_0xa09d('0x81')]||undefined;this[_0xa09d('0x82')]=_0x45cf7e['dialAgiAfterHangupClient']||![];this[_0xa09d('0x83')]=_0x45cf7e[_0xa09d('0x83')]||![];this[_0xa09d('0xa')]=monitorFormat[_0x45cf7e[_0xa09d('0xa')]]?monitorFormat[_0x45cf7e[_0xa09d('0xa')]]:undefined;this[_0xa09d('0x84')]=_0x45cf7e[_0xa09d('0x84')]||![];this['mandatoryDispositionPause']=_0x45cf7e['mandatoryDispositionPause']?_0x45cf7e[_0xa09d('0x85')]:undefined;this[_0xa09d('0x86')]=![];}module[_0xa09d('0x87')]=VoiceQueue; \ No newline at end of file +var _0x5078=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','inUse','invalid','loggedIn','notInUse','onHold','paused','ringInUse','talking','unavailable','unknown','acw','autopause','sendMessageOneNotActive','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry'];(function(_0x3d3401,_0x3c9a64){var _0x20cde3=function(_0x540725){while(--_0x540725){_0x3d3401['push'](_0x3d3401['shift']());}};_0x20cde3(++_0x3c9a64);}(_0x5078,0x148));var _0x8507=function(_0xea19d5,_0x4ac565){_0xea19d5=_0xea19d5-0x0;var _0x19698e=_0x5078[_0xea19d5];return _0x19698e;};'use strict';var monitorFormat={'wav':_0x8507('0x0'),'wav49':_0x8507('0x1'),'gsm':_0x8507('0x2')};var strategy={'fewestcalls':_0x8507('0x3'),'leastrecent':_0x8507('0x4'),'linear':_0x8507('0x5'),'random':_0x8507('0x6'),'ringall':_0x8507('0x7'),'rr':_0x8507('0x8'),'rrmemory':_0x8507('0x9'),'rrordered':_0x8507('0xa'),'wrandom':_0x8507('0xb')};function VoiceQueue(_0x37519c){this['id']=_0x37519c['id']||0x0;this[_0x8507('0xc')]=_0x37519c[_0x8507('0xc')]||'';this[_0x8507('0xd')]=_0x37519c['monitor_format']||'';this[_0x8507('0xe')]=_0x37519c[_0x8507('0xe')]||_0x8507('0xf');this['waiting']=0x0;this['total']=0x0;this[_0x8507('0x10')]=0x0;this[_0x8507('0x11')]=0x0;this[_0x8507('0x12')]=0x0;this[_0x8507('0x13')]=0x0;this[_0x8507('0x14')]=0x0;this[_0x8507('0x15')]=0x0;this[_0x8507('0x16')]=0x0;this['busy']=0x0;this[_0x8507('0x17')]=0x0;this[_0x8507('0x18')]=0x0;this[_0x8507('0x19')]=0x0;this[_0x8507('0x1a')]=0x0;this[_0x8507('0x1b')]=0x0;this[_0x8507('0x1c')]=0x0;this['ringing']=0x0;this[_0x8507('0x1d')]=0x0;this[_0x8507('0x1e')]=0x0;this[_0x8507('0x1f')]=0x0;this[_0x8507('0x20')]=0x0;this[_0x8507('0x21')]=_0x37519c[_0x8507('0x21')]||![];this['acwTimeout']=_0x37519c['acwTimeout']||0xa;this[_0x8507('0x22')]=_0x37519c[_0x8507('0x22')]||'no';this[_0x8507('0x23')]=!![];this['message']='';this[_0x8507('0x24')]='';this[_0x8507('0x25')]=0x0;this[_0x8507('0x26')]=0x0;this[_0x8507('0x27')]=_0x37519c[_0x8507('0x27')]||null;this[_0x8507('0x28')]=_0x37519c[_0x8507('0x28')]?_0x37519c[_0x8507('0x28')]:null;this['dialActive']=_0x37519c['dialActive'];this[_0x8507('0x29')]=_0x37519c[_0x8507('0x29')]||_0x8507('0x2a');this[_0x8507('0x2b')]=_0x37519c[_0x8507('0x2b')]||0x0;this['dialLimitQueue']=_0x37519c[_0x8507('0x2c')]||0x0;this[_0x8507('0x2d')]=_0x37519c[_0x8507('0x2d')]||0x1;this[_0x8507('0x2e')]=_0x37519c[_0x8507('0x2e')]||_0x8507('0x2f');this[_0x8507('0x30')]=_0x37519c[_0x8507('0x30')]||0.03;this['dialPredictiveInterval']=_0x37519c[_0x8507('0x31')]||0x258;this[_0x8507('0x32')]=_0x37519c[_0x8507('0x32')]||_0x8507('0x33');this[_0x8507('0x34')]=_0x37519c[_0x8507('0x34')]||_0x8507('0x33');this[_0x8507('0x35')]=_0x37519c['dialOriginateTimeout']||0x1e;this[_0x8507('0x36')]=_0x37519c[_0x8507('0x36')]||_0x8507('0x37');this['dialQueueTimeout']=_0x37519c[_0x8507('0x38')]||0x3;this[_0x8507('0x39')]=_0x37519c[_0x8507('0x39')]||undefined;this[_0x8507('0x3a')]=_0x37519c['dialCongestionMaxRetry']||0x3;this[_0x8507('0x3b')]=_0x37519c[_0x8507('0x3b')]||0x96;this[_0x8507('0x3c')]=_0x37519c[_0x8507('0x3c')]||0x3;this[_0x8507('0x3d')]=_0x37519c['dialBusyRetryFrequency']||0x96;this[_0x8507('0x3e')]=_0x37519c[_0x8507('0x3e')]||0x3;this[_0x8507('0x3f')]=_0x37519c[_0x8507('0x3f')]||0x96;this[_0x8507('0x40')]=_0x37519c[_0x8507('0x40')]||0x3;this[_0x8507('0x41')]=_0x37519c[_0x8507('0x41')]||0x96;this[_0x8507('0x42')]=_0x37519c[_0x8507('0x42')]||0x3;this[_0x8507('0x43')]=_0x37519c[_0x8507('0x43')]||0x96;this[_0x8507('0x44')]=_0x37519c['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x37519c[_0x8507('0x45')]||0x96;this['dialMachineMaxRetry']=_0x37519c[_0x8507('0x46')]||0x3;this[_0x8507('0x47')]=_0x37519c['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x37519c['dialAgentRejectMaxRetry']||0x3;this[_0x8507('0x48')]=_0x37519c[_0x8507('0x48')]||0x96;this[_0x8507('0x49')]=_0x37519c[_0x8507('0x49')]||0x3;this[_0x8507('0x4a')]=_0x37519c[_0x8507('0x4a')]||0x4;this['Trunk']=_0x37519c['Trunk']?_0x37519c[_0x8507('0x4b')]:undefined;this[_0x8507('0x4c')]=_0x37519c[_0x8507('0x4c')]?_0x37519c['TrunkBackup']:undefined;this['dialPrefix']=_0x37519c[_0x8507('0x4d')]||undefined;this[_0x8507('0x4e')]=_0x37519c['Interval']?_0x37519c[_0x8507('0x4e')]:undefined;this[_0x8507('0x4f')]=_0x37519c['dialOrderByScheduledAt']||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x37519c[_0x8507('0x50')]||undefined;this[_0x8507('0x51')]=_0x37519c[_0x8507('0x51')]||undefined;this[_0x8507('0x52')]=strategy[_0x37519c['strategy']];this['queueStatusComplete']=!![];this[_0x8507('0x53')]=_0x37519c[_0x8507('0x53')]||![];this['dialAMDInitialSilence']=_0x37519c[_0x8507('0x54')];this[_0x8507('0x55')]=_0x37519c[_0x8507('0x55')];this['dialAMDAfterGreetingSilence']=_0x37519c[_0x8507('0x56')];this[_0x8507('0x57')]=_0x37519c[_0x8507('0x57')];this[_0x8507('0x58')]=_0x37519c[_0x8507('0x58')];this[_0x8507('0x59')]=_0x37519c['dialAMDBetweenWordsSilence'];this[_0x8507('0x5a')]=_0x37519c[_0x8507('0x5a')];this['dialAMDSilenceThreshold']=_0x37519c[_0x8507('0x5b')];this[_0x8507('0x5c')]=_0x37519c['dialAMDMaximumWordLength'];this[_0x8507('0x5d')]=0x0;this['pTalking']=0x0;this[_0x8507('0x5e')]=_0x37519c[_0x8507('0x5e')];this['outboundAnswerCallsDay']=0x0;this[_0x8507('0x5f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x8507('0x60')]=0x0;this[_0x8507('0x61')]=0x0;this[_0x8507('0x62')]=0x0;this[_0x8507('0x63')]=0x0;this[_0x8507('0x64')]=0x0;this[_0x8507('0x65')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x8507('0x66')]=0x0;this[_0x8507('0x67')]=0x0;this[_0x8507('0x68')]=0x0;this[_0x8507('0x69')]=0x0;this['startProgressive']=undefined;this[_0x8507('0x6a')]=undefined;this[_0x8507('0x6b')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x8507('0x6c')]=0x0;this[_0x8507('0x6d')]=0x0;this[_0x8507('0x6e')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x8507('0x6f')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x8507('0x70')]=0x0;this[_0x8507('0x71')]=0x0;this[_0x8507('0x72')]=_0x37519c[_0x8507('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0x37519c[_0x8507('0x73')]||0xa;this[_0x8507('0x74')]=0x0;this[_0x8507('0x75')]=0x0;this[_0x8507('0x76')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x8507('0x77')]=0x0;this[_0x8507('0x78')]=_0x37519c[_0x8507('0x78')]||0x1e;this[_0x8507('0x79')]=_0x37519c[_0x8507('0x79')]||![];this[_0x8507('0x7a')]=!!_0x37519c['dialPreviewAutoRecallMe']||![];this[_0x8507('0x7b')]=!!_0x37519c[_0x8507('0x7b')]||![];this['dialQueueProject2']=_0x37519c[_0x8507('0x7c')]||undefined;this[_0x8507('0x7d')]=_0x37519c[_0x8507('0x7d')]||![];this[_0x8507('0x7e')]=_0x37519c[_0x8507('0x7e')]||![];this[_0x8507('0xd')]=monitorFormat[_0x37519c['monitor_format']]?monitorFormat[_0x37519c['monitor_format']]:undefined;this['mandatoryDisposition']=_0x37519c[_0x8507('0x7f')]||![];this[_0x8507('0x80')]=_0x37519c[_0x8507('0x80')]?_0x37519c[_0x8507('0x80')]:undefined;this[_0x8507('0x81')]=![];}module[_0x8507('0x82')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index c1ee1f4..67cab8f 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 _0x1670=['abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','incall','includes','status','keys','queue','exten','inUse','some','updateReportFromOutboundQueue','preview','available','loggedIn','paused','talking','waiting','answered','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy'];(function(_0x14ed75,_0x54c6c2){var _0x448446=function(_0x59ecc5){while(--_0x59ecc5){_0x14ed75['push'](_0x14ed75['shift']());}};_0x448446(++_0x54c6c2);}(_0x1670,0x9a));var _0x0167=function(_0x5d892e,_0x20d511){_0x5d892e=_0x5d892e-0x0;var _0x2c73ba=_0x1670[_0x5d892e];return _0x2c73ba;};'use strict';var INBOUND_COUNTERS=[_0x0167('0x0'),_0x0167('0x1'),'loggedInDb',_0x0167('0x2'),'ringing',_0x0167('0x3'),_0x0167('0x4')];var OUTBOUND_COUNTERS=[_0x0167('0x0'),_0x0167('0x5'),'inUse','loggedIn',_0x0167('0x6'),_0x0167('0x7'),_0x0167('0x8'),_0x0167('0x9'),_0x0167('0xa'),_0x0167('0xb'),_0x0167('0xc'),_0x0167('0xd'),'outboundNoSuchCallsDay','outboundReCallsDay',_0x0167('0xe'),_0x0167('0xf'),_0x0167('0x2'),_0x0167('0x10'),_0x0167('0x3'),_0x0167('0x11'),_0x0167('0x12'),_0x0167('0x13'),_0x0167('0x4')];function VoiceQueueSummary(_0x275e2f){this['id']=_0x275e2f['id'];this[_0x0167('0x14')]=_0x275e2f[_0x0167('0x14')];this[_0x0167('0x15')]=_0x275e2f[_0x0167('0x15')];this['abandoned']=_0x275e2f[_0x0167('0x16')]||0x0;this['answered']=_0x275e2f[_0x0167('0x5')]||0x0;this['available']=_0x275e2f[_0x0167('0x0')]||0x0;this[_0x0167('0x17')]=_0x275e2f[_0x0167('0x17')]||0x0;this['inUse']=_0x275e2f['inUse']||0x0;this['invalid']=_0x275e2f[_0x0167('0x18')]||0x0;this[_0x0167('0x1')]=_0x275e2f['loggedIn']||0x0;this[_0x0167('0x6')]=_0x275e2f['loggedInDb']||0x0;this['onHold']=_0x275e2f[_0x0167('0x19')]||0x0;this['notInUse']=_0x275e2f[_0x0167('0x1a')]||0x0;this['paused']=_0x275e2f[_0x0167('0x2')]||0x0;this[_0x0167('0x1b')]=_0x275e2f[_0x0167('0x1b')]||0x0;this[_0x0167('0x1c')]=_0x275e2f[_0x0167('0x1c')];this[_0x0167('0x11')]=_0x275e2f[_0x0167('0x11')];this[_0x0167('0x12')]=_0x275e2f[_0x0167('0x12')];this[_0x0167('0x1d')]=_0x275e2f[_0x0167('0x1d')]||0x0;this[_0x0167('0x3')]=_0x275e2f['talking']||0x0;this[_0x0167('0x13')]=_0x275e2f[_0x0167('0x13')]||0x0;this[_0x0167('0x1e')]=_0x275e2f['type'];this[_0x0167('0x1f')]=_0x275e2f[_0x0167('0x1f')]||0x0;this[_0x0167('0x20')]=_0x275e2f[_0x0167('0x20')]||0x0;this['unmanaged']=_0x275e2f[_0x0167('0x21')]||0x0;this['waiting']=_0x275e2f[_0x0167('0x4')]||0x0;if(_0x275e2f[_0x0167('0x1e')]===_0x0167('0x22')){this[_0x0167('0x10')]=_0x275e2f[_0x0167('0x10')]||0x0;this[_0x0167('0x23')]=_0x275e2f[_0x0167('0x23')];this['dialMethod']=_0x275e2f[_0x0167('0x24')];this[_0x0167('0x25')]=_0x275e2f[_0x0167('0x25')];this['dialOriginateCallerIdNumber']=_0x275e2f[_0x0167('0x26')];this[_0x0167('0x27')]=_0x275e2f['dialOriginateTimeout'];this[_0x0167('0x28')]=_0x275e2f[_0x0167('0x28')];this['temp']=_0x275e2f[_0x0167('0x29')];this[_0x0167('0x2a')]=_0x275e2f[_0x0167('0x2a')];this['outboundAnswerCallsDay']=_0x275e2f[_0x0167('0x9')];this[_0x0167('0xa')]=_0x275e2f['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x275e2f[_0x0167('0xb')];this[_0x0167('0xc')]=_0x275e2f[_0x0167('0xc')];this[_0x0167('0x2b')]=_0x275e2f['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x275e2f[_0x0167('0x2c')];this['outboundDropCallsDayTimeout']=_0x275e2f['outboundDropCallsDayTimeout'];this[_0x0167('0xd')]=_0x275e2f[_0x0167('0xd')];this[_0x0167('0x2d')]=_0x275e2f[_0x0167('0x2d')];this[_0x0167('0x2e')]=_0x275e2f[_0x0167('0x2e')];this[_0x0167('0x2f')]=_0x275e2f['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x275e2f[_0x0167('0xe')];this[_0x0167('0xf')]=_0x275e2f[_0x0167('0xf')];this[_0x0167('0x30')]=_0x275e2f[_0x0167('0x30')];this[_0x0167('0x31')]=_0x275e2f['predictiveIntervalAvgHoldtime'];this[_0x0167('0x32')]=_0x275e2f['predictiveIntervalAvgTalktime'];this['predictiveIntervalDroppedCallsCallersExit']=_0x275e2f[_0x0167('0x33')];this[_0x0167('0x34')]=_0x275e2f[_0x0167('0x34')];this['predictiveIntervalErlangCalls']=_0x275e2f[_0x0167('0x35')];this[_0x0167('0x36')]=_0x275e2f[_0x0167('0x36')];this[_0x0167('0x37')]=_0x275e2f['predictiveIntervalHitRate'];this[_0x0167('0x38')]=_0x275e2f[_0x0167('0x38')];this[_0x0167('0x39')]=_0x275e2f['predictiveIntervalPauses'];this[_0x0167('0x3a')]=_0x275e2f[_0x0167('0x3a')];this[_0x0167('0x3b')]=_0x275e2f[_0x0167('0x3b')];this[_0x0167('0x7')]=_0x275e2f['originated'];this[_0x0167('0x3c')]=_0x275e2f[_0x0167('0x3c')];this['erlangCallToSecond']=_0x275e2f[_0x0167('0x3d')];this[_0x0167('0x3e')]=_0x275e2f[_0x0167('0x3e')];this[_0x0167('0x3f')]=_0x275e2f[_0x0167('0x3f')];this[_0x0167('0x40')]=_0x275e2f['startPredictive'];this[_0x0167('0x41')]=_0x275e2f[_0x0167('0x41')];this[_0x0167('0x42')]=_0x275e2f[_0x0167('0x42')];this['statusMessage']=_0x275e2f[_0x0167('0x43')];}if(_0x275e2f[_0x0167('0x44')]){this['Trunk']={'id':_0x275e2f[_0x0167('0x44')]['id'],'name':_0x275e2f[_0x0167('0x44')][_0x0167('0x14')],'active':_0x275e2f['Trunk'][_0x0167('0x45')],'callerid':_0x275e2f[_0x0167('0x44')][_0x0167('0x46')]};}}VoiceQueueSummary[_0x0167('0x47')][_0x0167('0x48')]=function(_0x42183d,_0x14105b,_0x24841d,_0x5f2dd9){this[_0x0167('0x6')]=0x0;this['talking']=0x0;this[_0x0167('0x2')]=0x0;this[_0x0167('0x20')]=0x0;this[_0x0167('0x1a')]=0x0;this['inUse']=0x0;this['busy']=0x0;this['invalid']=0x0;this[_0x0167('0x1f')]=0x0;this[_0x0167('0x1b')]=0x0;this[_0x0167('0x1c')]=0x0;this[_0x0167('0x19')]=0x0;if(_0x24841d){if(_0x24841d[_0x0167('0x0')]){this[_0x0167('0x0')]=Number(_0x24841d['available']);}if(_0x24841d['loggedin']){this['loggedIn']=Number(_0x24841d[_0x0167('0x49')]);}if(_0x24841d['callers']){this[_0x0167('0x4')]=Number(_0x24841d[_0x0167('0x4a')]);}}for(var _0x29588f=0x0;_0x29588f<_0x42183d[_0x0167('0x4b')];_0x29588f++){var _0x482eed=_0x14105b[_0x0167('0x4c')+_0x42183d[_0x29588f][_0x0167('0x14')]];if(_0x482eed&&_0x482eed[_0x0167('0x4d')]){this[_0x0167('0x6')]+=0x1;}if(_0x42183d[_0x29588f][_0x0167('0x4e')]==='1'){this[_0x0167('0x3')]+=0x1;}if(_0x42183d[_0x29588f][_0x0167('0x2')]==='1'&&!['2','7','8'][_0x0167('0x4f')](_0x42183d[_0x29588f][_0x0167('0x50')])){this[_0x0167('0x2')]+=0x1;}switch(_0x42183d[_0x29588f]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0x0167('0x1a')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x0167('0x17')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x0167('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x0167('0x1c')]+=0x1;break;case'8':this[_0x0167('0x19')]+=0x1;break;}}if(this['dialMethod']==='booked'){var _0x4b5742=Object[_0x0167('0x51')](_0x5f2dd9);for(var _0x55aaa0=0x0;_0x55aaa0<_0x4b5742['length'];_0x55aaa0++){var _0x18d29d=_0x4b5742[_0x55aaa0];var _0x4b4b37=_0x5f2dd9[_0x18d29d];if(_0x4b4b37[_0x0167('0x52')]===this[_0x0167('0x14')]&&_0x4b4b37[_0x0167('0x1e')]==='dialer'&&_0x4b4b37[_0x0167('0x53')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this['talking']>this[_0x0167('0x54')]){this[_0x0167('0x3')]=this[_0x0167('0x54')];}this[_0x0167('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x0167('0x47')]['compareToInboundQueue']=function(_0x1eb8c3){var _0x36b989=![];if(_0x1eb8c3){_0x36b989=INBOUND_COUNTERS[_0x0167('0x55')](function(_0x441b4e){return this[_0x441b4e]!==_0x1eb8c3[_0x441b4e];},this);}return _0x36b989;};VoiceQueueSummary['prototype']['compareToOutboundQueue']=function(_0x19af14){var _0x5b3ffd=![];var _0x3a9e01=![];var _0x1deb9c=![];if(_0x19af14){_0x5b3ffd=this[_0x0167('0x24')]!==_0x19af14[_0x0167('0x24')]||this[_0x0167('0x23')]!==_0x19af14[_0x0167('0x23')]||this[_0x0167('0x42')]!==_0x19af14[_0x0167('0x42')]||this[_0x0167('0x43')]!==_0x19af14[_0x0167('0x43')];_0x3a9e01=OUTBOUND_COUNTERS['some'](function(_0x494b91){return this[_0x494b91]!==_0x19af14[_0x494b91];},this);if(this[_0x0167('0x44')]&&_0x19af14['Trunk']){_0x1deb9c=this[_0x0167('0x44')][_0x0167('0x14')]!==_0x19af14['Trunk'][_0x0167('0x14')]||this[_0x0167('0x44')]['active']!==_0x19af14[_0x0167('0x44')][_0x0167('0x45')];}}return _0x5b3ffd||_0x3a9e01||_0x1deb9c;};VoiceQueueSummary[_0x0167('0x47')][_0x0167('0x56')]=function(_0x50b310){this[_0x0167('0x5')]=_0x50b310[_0x0167('0x5')];this[_0x0167('0x42')]=_0x50b310['message'];this[_0x0167('0x43')]=_0x50b310[_0x0167('0x43')];this[_0x0167('0x7')]=_0x50b310[_0x0167('0x7')];this[_0x0167('0x8')]=_0x50b310[_0x0167('0x8')];this[_0x0167('0x9')]=_0x50b310[_0x0167('0x9')];this[_0x0167('0xa')]=_0x50b310['outboundBlacklistCallsDay'];this[_0x0167('0xb')]=_0x50b310[_0x0167('0xb')];this[_0x0167('0xc')]=_0x50b310[_0x0167('0xc')];this[_0x0167('0xd')]=_0x50b310[_0x0167('0xd')];this['outboundNoSuchCallsDay']=_0x50b310[_0x0167('0x2d')];this['outboundReCallsDay']=_0x50b310['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x50b310[_0x0167('0xe')];this[_0x0167('0xf')]=_0x50b310[_0x0167('0xf')];this[_0x0167('0x11')]=_0x50b310[_0x0167('0x11')];this['sumDuration']=_0x50b310[_0x0167('0x12')];this[_0x0167('0x13')]=_0x50b310['total'];if(this[_0x0167('0x24')]===_0x0167('0x57')){this[_0x0167('0x10')]=_0x50b310[_0x0167('0x10')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0xae1c=['strategy','abandoned','busy','invalid','onHold','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','notInUse','loggedin','callers','length','SIP/','incall','status','booked','keys','queue','dialer','exten','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundCongestionCallsDay','preview','exports','ringing','talking','waiting','available','answered','inUse','loggedIn','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','sumDuration','total','name'];(function(_0x226147,_0x89c729){var _0x599c23=function(_0x39ce38){while(--_0x39ce38){_0x226147['push'](_0x226147['shift']());}};_0x599c23(++_0x89c729);}(_0xae1c,0xff));var _0xcae1=function(_0x44cdf6,_0x27c98e){_0x44cdf6=_0x44cdf6-0x0;var _0x21eae1=_0xae1c[_0x44cdf6];return _0x21eae1;};'use strict';var INBOUND_COUNTERS=['available','loggedIn','loggedInDb','paused',_0xcae1('0x0'),_0xcae1('0x1'),_0xcae1('0x2')];var OUTBOUND_COUNTERS=[_0xcae1('0x3'),_0xcae1('0x4'),_0xcae1('0x5'),_0xcae1('0x6'),_0xcae1('0x7'),_0xcae1('0x8'),_0xcae1('0x9'),_0xcae1('0xa'),_0xcae1('0xb'),_0xcae1('0xc'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0xcae1('0xd'),_0xcae1('0xe'),_0xcae1('0xf'),'outboundUnknownCallsDay',_0xcae1('0x10'),_0xcae1('0x11'),_0xcae1('0x1'),'sumBillable',_0xcae1('0x12'),_0xcae1('0x13'),'waiting'];function VoiceQueueSummary(_0x4e24fb){this['id']=_0x4e24fb['id'];this[_0xcae1('0x14')]=_0x4e24fb[_0xcae1('0x14')];this[_0xcae1('0x15')]=_0x4e24fb[_0xcae1('0x15')];this[_0xcae1('0x16')]=_0x4e24fb[_0xcae1('0x16')]||0x0;this[_0xcae1('0x4')]=_0x4e24fb[_0xcae1('0x4')]||0x0;this[_0xcae1('0x3')]=_0x4e24fb[_0xcae1('0x3')]||0x0;this[_0xcae1('0x17')]=_0x4e24fb[_0xcae1('0x17')]||0x0;this[_0xcae1('0x5')]=_0x4e24fb[_0xcae1('0x5')]||0x0;this[_0xcae1('0x18')]=_0x4e24fb['invalid']||0x0;this[_0xcae1('0x6')]=_0x4e24fb[_0xcae1('0x6')]||0x0;this['loggedInDb']=_0x4e24fb['loggedInDb']||0x0;this[_0xcae1('0x19')]=_0x4e24fb[_0xcae1('0x19')]||0x0;this['notInUse']=_0x4e24fb['notInUse']||0x0;this[_0xcae1('0x10')]=_0x4e24fb['paused']||0x0;this[_0xcae1('0x0')]=_0x4e24fb[_0xcae1('0x0')]||0x0;this[_0xcae1('0x1a')]=_0x4e24fb[_0xcae1('0x1a')];this[_0xcae1('0x1b')]=_0x4e24fb[_0xcae1('0x1b')];this[_0xcae1('0x12')]=_0x4e24fb[_0xcae1('0x12')];this[_0xcae1('0x1c')]=_0x4e24fb[_0xcae1('0x1c')]||0x0;this[_0xcae1('0x1')]=_0x4e24fb[_0xcae1('0x1')]||0x0;this[_0xcae1('0x13')]=_0x4e24fb[_0xcae1('0x13')]||0x0;this['type']=_0x4e24fb[_0xcae1('0x1d')];this[_0xcae1('0x1e')]=_0x4e24fb[_0xcae1('0x1e')]||0x0;this[_0xcae1('0x1f')]=_0x4e24fb['unknown']||0x0;this[_0xcae1('0x20')]=_0x4e24fb[_0xcae1('0x20')]||0x0;this[_0xcae1('0x2')]=_0x4e24fb[_0xcae1('0x2')]||0x0;if(_0x4e24fb[_0xcae1('0x1d')]===_0xcae1('0x21')){this[_0xcae1('0x11')]=_0x4e24fb[_0xcae1('0x11')]||0x0;this['dialActive']=_0x4e24fb[_0xcae1('0x22')];this['dialMethod']=_0x4e24fb[_0xcae1('0x23')];this[_0xcae1('0x24')]=_0x4e24fb['dialOriginateCallerIdName'];this[_0xcae1('0x25')]=_0x4e24fb[_0xcae1('0x25')];this[_0xcae1('0x26')]=_0x4e24fb['dialOriginateTimeout'];this['dialPrefix']=_0x4e24fb[_0xcae1('0x27')];this[_0xcae1('0x28')]=_0x4e24fb[_0xcae1('0x28')];this[_0xcae1('0x29')]=_0x4e24fb[_0xcae1('0x29')];this[_0xcae1('0xa')]=_0x4e24fb[_0xcae1('0xa')];this['outboundBlacklistCallsDay']=_0x4e24fb[_0xcae1('0xb')];this[_0xcae1('0xc')]=_0x4e24fb[_0xcae1('0xc')];this['outboundCongestionCallsDay']=_0x4e24fb['outboundCongestionCallsDay'];this[_0xcae1('0x2a')]=_0x4e24fb['outboundDropCallsDayACS'];this[_0xcae1('0x2b')]=_0x4e24fb[_0xcae1('0x2b')];this[_0xcae1('0x2c')]=_0x4e24fb[_0xcae1('0x2c')];this[_0xcae1('0x2d')]=_0x4e24fb[_0xcae1('0x2d')];this[_0xcae1('0xd')]=_0x4e24fb[_0xcae1('0xd')];this[_0xcae1('0x2e')]=_0x4e24fb[_0xcae1('0x2e')];this['outboundReCallsDay']=_0x4e24fb[_0xcae1('0xe')];this[_0xcae1('0xf')]=_0x4e24fb[_0xcae1('0xf')];this[_0xcae1('0x2f')]=_0x4e24fb['outboundUnknownCallsDay'];this[_0xcae1('0x30')]=_0x4e24fb['predictiveIntervalAnsweredCalls'];this[_0xcae1('0x31')]=_0x4e24fb['predictiveIntervalAvgHoldtime'];this[_0xcae1('0x32')]=_0x4e24fb[_0xcae1('0x32')];this[_0xcae1('0x33')]=_0x4e24fb[_0xcae1('0x33')];this[_0xcae1('0x34')]=_0x4e24fb[_0xcae1('0x34')];this[_0xcae1('0x35')]=_0x4e24fb[_0xcae1('0x35')];this[_0xcae1('0x36')]=_0x4e24fb[_0xcae1('0x36')];this['predictiveIntervalHitRate']=_0x4e24fb[_0xcae1('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x4e24fb[_0xcae1('0x38')];this['predictiveIntervalPauses']=_0x4e24fb[_0xcae1('0x39')];this[_0xcae1('0x3a')]=_0x4e24fb['predictiveIntervalAvailable'];this[_0xcae1('0x3b')]=_0x4e24fb[_0xcae1('0x3b')];this[_0xcae1('0x8')]=_0x4e24fb[_0xcae1('0x8')];this['erlangCalls']=_0x4e24fb[_0xcae1('0x3c')];this[_0xcae1('0x3d')]=_0x4e24fb['erlangCallToSecond'];this[_0xcae1('0x3e')]=_0x4e24fb[_0xcae1('0x3e')];this[_0xcae1('0x3f')]=_0x4e24fb['erlangBusyFactor'];this[_0xcae1('0x40')]=_0x4e24fb['startPredictive'];this[_0xcae1('0x41')]=_0x4e24fb[_0xcae1('0x41')];this[_0xcae1('0x42')]=_0x4e24fb['message'];this[_0xcae1('0x43')]=_0x4e24fb[_0xcae1('0x43')];}if(_0x4e24fb[_0xcae1('0x44')]){this[_0xcae1('0x44')]={'id':_0x4e24fb[_0xcae1('0x44')]['id'],'name':_0x4e24fb[_0xcae1('0x44')]['name'],'active':_0x4e24fb[_0xcae1('0x44')][_0xcae1('0x45')],'callerid':_0x4e24fb[_0xcae1('0x44')][_0xcae1('0x46')]};}}VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x48')]=function(_0x349a18,_0x1d6700,_0x145fd7,_0x43f389){this[_0xcae1('0x7')]=0x0;this['talking']=0x0;this[_0xcae1('0x10')]=0x0;this[_0xcae1('0x1f')]=0x0;this[_0xcae1('0x49')]=0x0;this[_0xcae1('0x5')]=0x0;this[_0xcae1('0x17')]=0x0;this[_0xcae1('0x18')]=0x0;this[_0xcae1('0x1e')]=0x0;this['ringing']=0x0;this[_0xcae1('0x1a')]=0x0;this[_0xcae1('0x19')]=0x0;if(_0x145fd7){if(_0x145fd7[_0xcae1('0x3')]){this[_0xcae1('0x3')]=Number(_0x145fd7['available']);}if(_0x145fd7['loggedin']){this['loggedIn']=Number(_0x145fd7[_0xcae1('0x4a')]);}if(_0x145fd7[_0xcae1('0x4b')]){this[_0xcae1('0x2')]=Number(_0x145fd7[_0xcae1('0x4b')]);}}for(var _0x11bacb=0x0;_0x11bacb<_0x349a18[_0xcae1('0x4c')];_0x11bacb++){var _0x5b95ab=_0x1d6700[_0xcae1('0x4d')+_0x349a18[_0x11bacb][_0xcae1('0x14')]];if(_0x5b95ab&&_0x5b95ab['online']){this[_0xcae1('0x7')]+=0x1;}if(_0x349a18[_0x11bacb][_0xcae1('0x4e')]==='1'){this[_0xcae1('0x1')]+=0x1;}if(_0x349a18[_0x11bacb]['paused']==='1'&&!['2','7','8']['includes'](_0x349a18[_0x11bacb][_0xcae1('0x4f')])){this[_0xcae1('0x10')]+=0x1;}switch(_0x349a18[_0x11bacb][_0xcae1('0x4f')]){case'0':this[_0xcae1('0x1f')]+=0x1;break;case'1':this[_0xcae1('0x49')]+=0x1;break;case'2':this[_0xcae1('0x5')]+=0x1;break;case'3':this[_0xcae1('0x17')]+=0x1;break;case'4':this[_0xcae1('0x18')]+=0x1;break;case'5':this[_0xcae1('0x1e')]+=0x1;break;case'6':this[_0xcae1('0x0')]+=0x1;break;case'7':this[_0xcae1('0x1a')]+=0x1;break;case'8':this[_0xcae1('0x19')]+=0x1;break;}}if(this['dialMethod']===_0xcae1('0x50')){var _0xcad695=Object[_0xcae1('0x51')](_0x43f389);for(var _0x258630=0x0;_0x258630<_0xcad695[_0xcae1('0x4c')];_0x258630++){var _0x3ccfb4=_0xcad695[_0x258630];var _0x9ef6d4=_0x43f389[_0x3ccfb4];if(_0x9ef6d4[_0xcae1('0x52')]===this[_0xcae1('0x14')]&&_0x9ef6d4[_0xcae1('0x1d')]===_0xcae1('0x53')&&_0x9ef6d4[_0xcae1('0x54')]==='xcally-motion-preview'){this[_0xcae1('0x1')]+=0x1;}}if(this[_0xcae1('0x1')]>this[_0xcae1('0x5')]){this['talking']=this[_0xcae1('0x5')];}this[_0xcae1('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x55')]=function(_0x5282ac){var _0x2efd37=![];if(_0x5282ac){_0x2efd37=INBOUND_COUNTERS[_0xcae1('0x56')](function(_0x1b40b9){return this[_0x1b40b9]!==_0x5282ac[_0x1b40b9];},this);}return _0x2efd37;};VoiceQueueSummary['prototype'][_0xcae1('0x57')]=function(_0x16b1b2){var _0x90b0ad=![];var _0x4e5d01=![];var _0x303b98=![];if(_0x16b1b2){_0x90b0ad=this[_0xcae1('0x23')]!==_0x16b1b2['dialMethod']||this[_0xcae1('0x22')]!==_0x16b1b2[_0xcae1('0x22')]||this[_0xcae1('0x42')]!==_0x16b1b2['message']||this[_0xcae1('0x43')]!==_0x16b1b2[_0xcae1('0x43')];_0x4e5d01=OUTBOUND_COUNTERS['some'](function(_0x4b68d1){return this[_0x4b68d1]!==_0x16b1b2[_0x4b68d1];},this);if(this[_0xcae1('0x44')]&&_0x16b1b2[_0xcae1('0x44')]){_0x303b98=this[_0xcae1('0x44')][_0xcae1('0x14')]!==_0x16b1b2['Trunk'][_0xcae1('0x14')]||this[_0xcae1('0x44')]['active']!==_0x16b1b2[_0xcae1('0x44')][_0xcae1('0x45')];}}return _0x90b0ad||_0x4e5d01||_0x303b98;};VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x58')]=function(_0x1de80e){this[_0xcae1('0x4')]=_0x1de80e[_0xcae1('0x4')];this[_0xcae1('0x42')]=_0x1de80e[_0xcae1('0x42')];this['statusMessage']=_0x1de80e['statusMessage'];this[_0xcae1('0x8')]=_0x1de80e['originated'];this['outboundAbandonedCallsDay']=_0x1de80e[_0xcae1('0x9')];this[_0xcae1('0xa')]=_0x1de80e[_0xcae1('0xa')];this[_0xcae1('0xb')]=_0x1de80e[_0xcae1('0xb')];this[_0xcae1('0xc')]=_0x1de80e[_0xcae1('0xc')];this[_0xcae1('0x59')]=_0x1de80e[_0xcae1('0x59')];this[_0xcae1('0x2d')]=_0x1de80e[_0xcae1('0x2d')];this[_0xcae1('0xd')]=_0x1de80e['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0x1de80e[_0xcae1('0xe')];this[_0xcae1('0xf')]=_0x1de80e[_0xcae1('0xf')];this[_0xcae1('0x2f')]=_0x1de80e[_0xcae1('0x2f')];this['sumBillable']=_0x1de80e[_0xcae1('0x1b')];this[_0xcae1('0x12')]=_0x1de80e[_0xcae1('0x12')];this[_0xcae1('0x13')]=_0x1de80e[_0xcae1('0x13')];if(this[_0xcae1('0x23')]===_0xcae1('0x5a')){this[_0xcae1('0x11')]=_0x1de80e[_0xcae1('0x11')];}};module[_0xcae1('0x5b')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 2ba428f..a0c87aa 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 _0x8b43=['name','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x37464d,_0x29bf11){var _0x4e7573=function(_0x4de5e3){while(--_0x4de5e3){_0x37464d['push'](_0x37464d['shift']());}};_0x4e7573(++_0x29bf11);}(_0x8b43,0x7e));var _0x38b4=function(_0xabfb21,_0x16eb6f){_0xabfb21=_0xabfb21-0x0;var _0x2d9984=_0x8b43[_0xabfb21];return _0x2d9984;};'use strict';function VtigerAccount(_0x284f4c){this['id']=_0x284f4c['id']||0x0;this[_0x38b4('0x0')]=_0x284f4c[_0x38b4('0x0')]||'';this['username']=_0x284f4c['username']||'';this[_0x38b4('0x1')]=_0x284f4c[_0x38b4('0x1')]||'';this[_0x38b4('0x2')]=_0x284f4c['remoteUri']||'';this[_0x38b4('0x3')]=_0x284f4c[_0x38b4('0x3')]||'';this[_0x38b4('0x4')]=_0x284f4c[_0x38b4('0x4')]||{};}module[_0x38b4('0x5')]=VtigerAccount; \ No newline at end of file +var _0x8d7b=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x32072a,_0x98e19){var _0x42135e=function(_0x4fb2a7){while(--_0x4fb2a7){_0x32072a['push'](_0x32072a['shift']());}};_0x42135e(++_0x98e19);}(_0x8d7b,0x1e8));var _0xb8d7=function(_0x3bf684,_0x43609f){_0x3bf684=_0x3bf684-0x0;var _0x46504d=_0x8d7b[_0x3bf684];return _0x46504d;};'use strict';function VtigerAccount(_0x1c8850){this['id']=_0x1c8850['id']||0x0;this['name']=_0x1c8850[_0xb8d7('0x0')]||'';this[_0xb8d7('0x1')]=_0x1c8850[_0xb8d7('0x1')]||'';this[_0xb8d7('0x2')]=_0x1c8850[_0xb8d7('0x2')]||'';this['remoteUri']=_0x1c8850[_0xb8d7('0x3')]||'';this[_0xb8d7('0x4')]=_0x1c8850[_0xb8d7('0x4')]||'';this[_0xb8d7('0x5')]=_0x1c8850[_0xb8d7('0x5')]||{};}module[_0xb8d7('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 8a50c2a..5acacca 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 _0x0187=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0187,0x165));var _0x7018=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x0187[_0x15c421];return _0x5e5ed5;};'use strict';function ZendeskAccount(_0x466001){this['id']=_0x466001['id']||0x0;this[_0x7018('0x0')]=_0x466001['name']||'';this[_0x7018('0x1')]=_0x466001[_0x7018('0x1')]||'';this[_0x7018('0x2')]=_0x466001[_0x7018('0x2')]||'';this[_0x7018('0x3')]=_0x466001[_0x7018('0x3')]||'';this[_0x7018('0x4')]=_0x466001[_0x7018('0x4')]||'';this[_0x7018('0x5')]=_0x466001[_0x7018('0x5')]||'';this[_0x7018('0x6')]=_0x466001[_0x7018('0x6')]||_0x7018('0x7');this['serverUrl']=_0x466001[_0x7018('0x8')]||'';this['Configurations']=_0x466001[_0x7018('0x9')]||{};}module[_0x7018('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xe908=['serverUrl','Configurations','exports','name','username','password','remoteUri','authType','type','integrationTab'];(function(_0x3cba44,_0x280031){var _0x5750bb=function(_0x9b255d){while(--_0x9b255d){_0x3cba44['push'](_0x3cba44['shift']());}};_0x5750bb(++_0x280031);}(_0xe908,0x193));var _0x8e90=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe908[_0x465a0c];return _0x1e202e;};'use strict';function ZendeskAccount(_0x229431){this['id']=_0x229431['id']||0x0;this['name']=_0x229431[_0x8e90('0x0')]||'';this[_0x8e90('0x1')]=_0x229431[_0x8e90('0x1')]||'';this[_0x8e90('0x2')]=_0x229431['password']||'';this['token']=_0x229431['token']||'';this[_0x8e90('0x3')]=_0x229431[_0x8e90('0x3')]||'';this[_0x8e90('0x4')]=_0x229431[_0x8e90('0x4')]||'';this[_0x8e90('0x5')]=_0x229431['type']||_0x8e90('0x6');this['serverUrl']=_0x229431[_0x8e90('0x7')]||'';this[_0x8e90('0x8')]=_0x229431['Configurations']||{};}module[_0x8e90('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b29e147..491d02d 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 _0xe7e3=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','exports','name'];(function(_0x5bbe7e,_0x19c08f){var _0x6ebda1=function(_0x501701){while(--_0x501701){_0x5bbe7e['push'](_0x5bbe7e['shift']());}};_0x6ebda1(++_0x19c08f);}(_0xe7e3,0x95));var _0x3e7e=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xe7e3[_0x19159a];return _0xa677f4;};'use strict';function ZohoAccount(_0x5a649f){this['id']=_0x5a649f['id']||0x0;this[_0x3e7e('0x0')]=_0x5a649f[_0x3e7e('0x0')]||'';this[_0x3e7e('0x1')]=_0x5a649f[_0x3e7e('0x1')]||'';this['host']=_0x5a649f[_0x3e7e('0x2')]||'';this[_0x3e7e('0x3')]=_0x5a649f['zone']||'';this[_0x3e7e('0x4')]=_0x5a649f[_0x3e7e('0x4')]||'';this[_0x3e7e('0x5')]=_0x5a649f[_0x3e7e('0x5')]||'';this[_0x3e7e('0x6')]=_0x5a649f[_0x3e7e('0x6')]||'';this[_0x3e7e('0x7')]=_0x5a649f[_0x3e7e('0x7')]||'';this[_0x3e7e('0x8')]=_0x5a649f[_0x3e7e('0x8')]||'';this['Configurations']=_0x5a649f['Configurations']||{};}module[_0x3e7e('0x9')]=ZohoAccount; \ No newline at end of file +var _0xaa6a=['clientSecret','serverUrl','code','refreshToken','exports','name','description','host','zone','clientId'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xaa6a,0x1db));var _0xaaa6=function(_0x31f736,_0x3d652a){_0x31f736=_0x31f736-0x0;var _0x301d9a=_0xaa6a[_0x31f736];return _0x301d9a;};'use strict';function ZohoAccount(_0xf5d9b1){this['id']=_0xf5d9b1['id']||0x0;this[_0xaaa6('0x0')]=_0xf5d9b1['name']||'';this['description']=_0xf5d9b1[_0xaaa6('0x1')]||'';this['host']=_0xf5d9b1[_0xaaa6('0x2')]||'';this['zone']=_0xf5d9b1[_0xaaa6('0x3')]||'';this[_0xaaa6('0x4')]=_0xf5d9b1[_0xaaa6('0x4')]||'';this[_0xaaa6('0x5')]=_0xf5d9b1[_0xaaa6('0x5')]||'';this[_0xaaa6('0x6')]=_0xf5d9b1[_0xaaa6('0x6')]||'';this[_0xaaa6('0x7')]=_0xf5d9b1['code']||'';this[_0xaaa6('0x8')]=_0xf5d9b1[_0xaaa6('0x8')]||'';this['Configurations']=_0xf5d9b1['Configurations']||{};}module[_0xaaa6('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index b7163a5..dbd7bc1 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 _0x32f4=['isNil','uniqueid','queue','type','campaigntype','dialAnswer','Agent','channelAgent','membername','SIP/%s','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','format','calleridname','exports','util','lodash','moment','string'];(function(_0x5e65a6,_0x58ed34){var _0xd596c0=function(_0x7b55a){while(--_0x7b55a){_0x5e65a6['push'](_0x5e65a6['shift']());}};_0xd596c0(++_0x58ed34);}(_0x32f4,0x154));var _0x432f=function(_0x2dc0eb,_0x5b9c4f){_0x2dc0eb=_0x2dc0eb-0x0;var _0x17548b=_0x32f4[_0x2dc0eb];return _0x17548b;};'use strict';var util=require(_0x432f('0x0'));var _=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));function checkNameSurname(_0x2b22ad,_0x5ee65a,_0x2a4628){var _0x6f0e8a='';if(!_['isNil'](_0x5ee65a)&&_0x432f('0x3')===typeof _0x5ee65a){_0x6f0e8a+=_0x5ee65a;}if(!_[_0x432f('0x4')](_0x2a4628)&&_0x432f('0x3')===typeof _0x2a4628){_0x6f0e8a+='\x20'+_0x2a4628;}if(_0x6f0e8a!==''){return _0x6f0e8a;}return _0x2b22ad;}function Action(_0x355b02,_0x2f5f03,_0x5d8cc0,_0x5b5f08,_0x2f66fd){this[_0x432f('0x5')]=_0x5d8cc0||undefined;this['idContact']=_0x355b02['id'];this[_0x432f('0x6')]=_0x2f5f03['name'];this[_0x432f('0x7')]=_0x2f5f03[_0x432f('0x7')];this[_0x432f('0x8')]=_0x432f('0x6');this[_0x432f('0x9')]=![];this['membername']=_[_0x432f('0x4')](_0x355b02['Agent'])?undefined:_0x355b02[_0x432f('0xa')]['name'];this[_0x432f('0xb')]=this[_0x432f('0xc')]?util['format'](_0x432f('0xd'),this[_0x432f('0xc')]):_0x5b5f08||undefined;this['calleridname']=checkNameSurname(_0x355b02[_0x432f('0xe')][_0x432f('0xf')],_0x355b02['Contact']['firstName'],_0x355b02[_0x432f('0xe')][_0x432f('0x10')]);this[_0x432f('0x11')]=_0x355b02[_0x432f('0x11')]||![];this[_0x432f('0x12')]=_0x355b02['phone'];this[_0x432f('0x13')]=_0x355b02[_0x432f('0x13')];this[_0x432f('0x14')]=_0x355b02[_0x432f('0x14')]||0x0;this['countcongestionretry']=_0x355b02[_0x432f('0x15')]||0x0;this[_0x432f('0x16')]=_0x355b02[_0x432f('0x16')]||0x0;this[_0x432f('0x17')]=(_0x355b02[_0x432f('0x14')]||0x0)+(_0x355b02[_0x432f('0x15')]||0x0)+(_0x355b02['countnoanswerretry']||0x0)+(_0x355b02[_0x432f('0x18')]||0x0)+(_0x355b02['countdropretry']||0x0)+(_0x355b02[_0x432f('0x19')]||0x0)+(_0x355b02[_0x432f('0x1a')]||0x0)+(_0x355b02[_0x432f('0x1b')]||0x0);this[_0x432f('0x18')]=_0x355b02[_0x432f('0x18')]||0x0;this[_0x432f('0x1c')]=_0x355b02[_0x432f('0x1c')]||0x0;this[_0x432f('0x19')]=_0x355b02[_0x432f('0x19')]||0x0;this[_0x432f('0x1a')]=_0x355b02[_0x432f('0x1a')]||0x0;this[_0x432f('0x1b')]=_0x355b02['countagentrejectretry']||0x0;this['callback']=_0x355b02[_0x432f('0x1d')];this['callbackuniqueid']=_0x355b02[_0x432f('0x1e')];this['callbackat']=_0x355b02[_0x432f('0x1f')];this[_0x432f('0x20')]=_0x355b02[_0x432f('0x20')];this[_0x432f('0x21')]=_0x355b02[_0x432f('0x21')];this[_0x432f('0x22')]=_0x355b02['ListId'];this[_0x432f('0x23')]=_[_0x432f('0x4')](_0x355b02['Agent'])?_0x355b02[_0x432f('0x23')]:_0x355b02[_0x432f('0xa')]['id'];this[_0x432f('0x24')]=_0x355b02[_0x432f('0x24')];this[_0x432f('0x25')]='';this[_0x432f('0x26')]='';}Action[_0x432f('0x27')]['getCaller']=function(){return util[_0x432f('0x28')]('\x22%s\x22\x20<%s>',this[_0x432f('0x29')],this['number']);};module[_0x432f('0x2a')]=Action; \ No newline at end of file +var _0x4991=['ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','SIP/%s','calleridname','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x226432,_0x80ae6f){var _0x468ca2=function(_0x4fb1ea){while(--_0x4fb1ea){_0x226432['push'](_0x226432['shift']());}};_0x468ca2(++_0x80ae6f);}(_0x4991,0xf7));var _0x1499=function(_0x35ca52,_0x2ce03c){_0x35ca52=_0x35ca52-0x0;var _0x383006=_0x4991[_0x35ca52];return _0x383006;};'use strict';var util=require(_0x1499('0x0'));var _=require('lodash');var moment=require(_0x1499('0x1'));function checkNameSurname(_0x5bd577,_0x30d640,_0x256e41){var _0x16ac22='';if(!_[_0x1499('0x2')](_0x30d640)&&_0x1499('0x3')===typeof _0x30d640){_0x16ac22+=_0x30d640;}if(!_[_0x1499('0x2')](_0x256e41)&&_0x1499('0x3')===typeof _0x256e41){_0x16ac22+='\x20'+_0x256e41;}if(_0x16ac22!==''){return _0x16ac22;}return _0x5bd577;}function Action(_0x209616,_0x4b6154,_0x2a8e96,_0x1c3bd7,_0x1c65c3){this[_0x1499('0x4')]=_0x2a8e96||undefined;this[_0x1499('0x5')]=_0x209616['id'];this[_0x1499('0x6')]=_0x4b6154[_0x1499('0x7')];this[_0x1499('0x8')]=_0x4b6154['type'];this[_0x1499('0x9')]=_0x1499('0x6');this['dialAnswer']=![];this[_0x1499('0xa')]=_[_0x1499('0x2')](_0x209616['Agent'])?undefined:_0x209616[_0x1499('0xb')][_0x1499('0x7')];this['channelAgent']=this['membername']?util['format'](_0x1499('0xc'),this[_0x1499('0xa')]):_0x1c3bd7||undefined;this[_0x1499('0xd')]=checkNameSurname(_0x209616[_0x1499('0xe')][_0x1499('0xf')],_0x209616['Contact']['firstName'],_0x209616[_0x1499('0xe')]['lastName']);this[_0x1499('0x10')]=_0x209616[_0x1499('0x10')]||![];this[_0x1499('0x11')]=_0x209616[_0x1499('0xf')];this['scheduledat']=_0x209616[_0x1499('0x12')];this[_0x1499('0x13')]=_0x209616['countbusyretry']||0x0;this[_0x1499('0x14')]=_0x209616[_0x1499('0x14')]||0x0;this[_0x1499('0x15')]=_0x209616[_0x1499('0x15')]||0x0;this[_0x1499('0x16')]=(_0x209616[_0x1499('0x13')]||0x0)+(_0x209616['countcongestionretry']||0x0)+(_0x209616['countnoanswerretry']||0x0)+(_0x209616['countnosuchnumberretry']||0x0)+(_0x209616[_0x1499('0x17')]||0x0)+(_0x209616[_0x1499('0x18')]||0x0)+(_0x209616['countmachineretry']||0x0)+(_0x209616[_0x1499('0x19')]||0x0);this[_0x1499('0x1a')]=_0x209616[_0x1499('0x1a')]||0x0;this[_0x1499('0x17')]=_0x209616[_0x1499('0x17')]||0x0;this[_0x1499('0x18')]=_0x209616[_0x1499('0x18')]||0x0;this[_0x1499('0x1b')]=_0x209616[_0x1499('0x1b')]||0x0;this[_0x1499('0x19')]=_0x209616[_0x1499('0x19')]||0x0;this[_0x1499('0x1c')]=_0x209616[_0x1499('0x1c')];this[_0x1499('0x1d')]=_0x209616[_0x1499('0x1d')];this[_0x1499('0x1e')]=_0x209616[_0x1499('0x1e')];this['recallme']=_0x209616[_0x1499('0x1f')];this[_0x1499('0x20')]=_0x209616[_0x1499('0x20')];this[_0x1499('0x21')]=_0x209616[_0x1499('0x21')];this[_0x1499('0x22')]=_['isNil'](_0x209616['Agent'])?_0x209616[_0x1499('0x22')]:_0x209616[_0x1499('0xb')]['id'];this[_0x1499('0x23')]=_0x209616[_0x1499('0x23')];this[_0x1499('0x24')]='';this['originatecalleridname']='';}Action[_0x1499('0x25')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x1499('0xd')],this[_0x1499('0x26')]);};module[_0x1499('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6e817bd..8ec44c4 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x4260af,_0x58f258){var _0x90689f=function(_0x47a4d9){while(--_0x47a4d9){_0x4260af['push'](_0x4260af['shift']());}};_0x90689f(++_0x58f258);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x4e8e9f,_0x38421e){var _0x4cc150=function(_0x3951ec){while(--_0x3951ec){_0x4e8e9f['push'](_0x4e8e9f['shift']());}};_0x4cc150(++_0x38421e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 286e7a5..0c126ae 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 _0xd0d2=['error','catch','resolve','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport'];(function(_0xa41459,_0x16e1c4){var _0xce9284=function(_0x3f2d28){while(--_0x3f2d28){_0xa41459['push'](_0xa41459['shift']());}};_0xce9284(++_0x16e1c4);}(_0xd0d2,0x1b3));var _0x2d0d=function(_0xb33f4,_0x337620){_0xb33f4=_0xb33f4-0x0;var _0x2ae66c=_0xd0d2[_0xb33f4];return _0x2ae66c;};'use strict';var util=require('util');var BPromise=require(_0x2d0d('0x0'));var logger=require(_0x2d0d('0x1'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x2d0d('0x2'));var cmHopperBlack=require(_0x2d0d('0x3'));var agentReportPreview=require(_0x2d0d('0x4'));var voiceQueueReport=require(_0x2d0d('0x5'));function loggerCatch(_0x157226){return function(_0x3d5cad){logger[_0x2d0d('0x6')](_0x157226,util['inspect'](_0x3d5cad,{'showHidden':![],'depth':null}));};}function create(_0x4ce10f){return cmHopperHistory['createHistory'](_0x4ce10f)[_0x2d0d('0x7')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2f3f86){return BPromise[_0x2d0d('0x8')]()[_0x2d0d('0x9')](agentReportPreview[_0x2d0d('0xa')](_0x2f3f86))[_0x2d0d('0x7')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x55ee85){return cmHopper[_0x2d0d('0xb')](_0x55ee85,!![])[_0x2d0d('0x7')](loggerCatch(_0x2d0d('0xc')));}exports['checkIsBlackList']=function(_0x1073c9){return cmHopperBlack[_0x2d0d('0xd')](_0x1073c9)[_0x2d0d('0x7')](loggerCatch(_0x2d0d('0xe')));};exports[_0x2d0d('0xf')]=function(_0x3d85ab){return BPromise[_0x2d0d('0x8')]()[_0x2d0d('0x9')](cmHopper[_0x2d0d('0xf')](_0x3d85ab))[_0x2d0d('0x7')](loggerCatch(_0x2d0d('0x10')));};exports[_0x2d0d('0xa')]=function(_0x517aa6,_0x3ccd6c){create(_0x517aa6)[_0x2d0d('0x7')](loggerCatch(_0x3ccd6c));moveContact(_0x517aa6)[_0x2d0d('0x7')](loggerCatch(_0x3ccd6c));};exports['createAgentHistory']=function(_0x45c3b5,_0x334c76){createAgent(_0x45c3b5)[_0x2d0d('0x7')](loggerCatch(_0x334c76));};exports[_0x2d0d('0x11')]=function(_0x10d47c,_0x549627){create(_0x10d47c)[_0x2d0d('0x7')](loggerCatch(_0x549627));};exports[_0x2d0d('0x12')]=function(_0x284ee2,_0x1a1db1){moveContact(_0x284ee2)['catch'](loggerCatch(_0x1a1db1));};exports['rescheduleContact']=function(_0x55a256,_0x2e19ea,_0x3ea359){if(_0x2e19ea){_0x55a256['UserId']=null;}if(_0x3ea359){_0x55a256['active']=![];}return cmHopper[_0x2d0d('0x13')](_0x55a256)[_0x2d0d('0x7')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x2d0d('0x14')]=function(_0x3887fa){return cmHopper['countReScheduled'](_0x3887fa)['catch'](loggerCatch(_0x2d0d('0x15')));};exports[_0x2d0d('0x16')]=function(_0x17b77f){return cmHopper[_0x2d0d('0x16')]({'UserId':null},_0x17b77f,0x1)[_0x2d0d('0x7')](loggerCatch(_0x2d0d('0x17')));};exports[_0x2d0d('0x18')]=function(_0x550e18){return cmHopper[_0x2d0d('0x16')]({'active':![]},_0x550e18,0x1)[_0x2d0d('0x7')](loggerCatch('[activeContact]\x20'));};exports[_0x2d0d('0x19')]=function(_0x7dc8ee){var _0x52bef3={};_0x52bef3[_0x2d0d('0x1a')]=_0x7dc8ee[_0x2d0d('0x1a')];_0x52bef3[_0x2d0d('0x1b')]=_0x7dc8ee[_0x2d0d('0x1b')];_0x52bef3[_0x2d0d('0x1c')]=_0x7dc8ee[_0x2d0d('0x1c')];_0x52bef3[_0x2d0d('0x1d')]=_0x7dc8ee[_0x2d0d('0x1d')];_0x52bef3[_0x2d0d('0x1e')]=_0x7dc8ee[_0x2d0d('0x1e')];_0x52bef3[_0x2d0d('0x1f')]=_0x7dc8ee['answertime'];_0x52bef3[_0x2d0d('0x20')]=_0x7dc8ee[_0x2d0d('0x21')];_0x52bef3[_0x2d0d('0x22')]=0x1;_0x52bef3[_0x2d0d('0x23')]=_0x7dc8ee[_0x2d0d('0x24')];_0x52bef3['connectedlinename']=_0x7dc8ee[_0x2d0d('0x25')];_0x52bef3['context']=_0x2d0d('0x26');_0x52bef3[_0x2d0d('0x27')]='xcally-motion-preview';_0x52bef3[_0x2d0d('0x28')]=0x0;_0x52bef3[_0x2d0d('0x29')]=0x1;_0x52bef3[_0x2d0d('0x2a')]=_0x7dc8ee[_0x2d0d('0x25')];_0x52bef3[_0x2d0d('0x2b')]=_0x2d0d('0x2c');return BPromise[_0x2d0d('0x8')]()['then'](voiceQueueReport[_0x2d0d('0x2d')](_0x52bef3))[_0x2d0d('0x7')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x2d0d('0x2e')]=function(_0x2158fc,_0x179482){return BPromise[_0x2d0d('0x8')]()['then'](cmHopper['getContactRecallMe'](_0x2158fc,_0x179482))[_0x2d0d('0x7')](loggerCatch(_0x2d0d('0x2f')));};exports['rescheduleContactInQueue']=function(_0x1f23f8){return cmHopper[_0x2d0d('0x13')](_0x1f23f8,!![],!![])[_0x2d0d('0x7')](loggerCatch(_0x2d0d('0x30')));}; \ No newline at end of file +var _0xac35=['../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','inspect','createHistory','catch','resolve','then','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird'];(function(_0x167983,_0x5f0ac3){var _0x417171=function(_0x1101e3){while(--_0x1101e3){_0x167983['push'](_0x167983['shift']());}};_0x417171(++_0x5f0ac3);}(_0xac35,0x180));var _0x5ac3=function(_0x24c38e,_0x512304){_0x24c38e=_0x24c38e-0x0;var _0x5070ed=_0xac35[_0x24c38e];return _0x5070ed;};'use strict';var util=require('util');var BPromise=require(_0x5ac3('0x0'));var logger=require(_0x5ac3('0x1'))(_0x5ac3('0x2'));var cmHopper=require(_0x5ac3('0x3'));var cmHopperHistory=require(_0x5ac3('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x5ac3('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4b1ebf){return function(_0x1e537c){logger['error'](_0x4b1ebf,util[_0x5ac3('0x6')](_0x1e537c,{'showHidden':![],'depth':null}));};}function create(_0x4eeb7f){return cmHopperHistory[_0x5ac3('0x7')](_0x4eeb7f)[_0x5ac3('0x8')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x39317d){return BPromise[_0x5ac3('0x9')]()[_0x5ac3('0xa')](agentReportPreview[_0x5ac3('0x7')](_0x39317d))[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0xb')));}function moveContact(_0x5a926b){return cmHopper['moveContactManagedDialer'](_0x5a926b,!![])[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0xc')));}exports[_0x5ac3('0xd')]=function(_0x591141){return cmHopperBlack[_0x5ac3('0xd')](_0x591141)[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0xe')));};exports[_0x5ac3('0xf')]=function(_0x8c975b){return BPromise[_0x5ac3('0x9')]()[_0x5ac3('0xa')](cmHopper[_0x5ac3('0xf')](_0x8c975b))[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0x10')));};exports[_0x5ac3('0x7')]=function(_0x4e2dfa,_0x5ec9bc){create(_0x4e2dfa)[_0x5ac3('0x8')](loggerCatch(_0x5ec9bc));moveContact(_0x4e2dfa)['catch'](loggerCatch(_0x5ec9bc));};exports[_0x5ac3('0x11')]=function(_0x4a49bf,_0x3b14f1){createAgent(_0x4a49bf)[_0x5ac3('0x8')](loggerCatch(_0x3b14f1));};exports[_0x5ac3('0x12')]=function(_0xb3ea24,_0x32d245){create(_0xb3ea24)[_0x5ac3('0x8')](loggerCatch(_0x32d245));};exports[_0x5ac3('0x13')]=function(_0x2f310e,_0x1f580e){moveContact(_0x2f310e)[_0x5ac3('0x8')](loggerCatch(_0x1f580e));};exports[_0x5ac3('0x14')]=function(_0x151b80,_0x2db657,_0x377192){if(_0x2db657){_0x151b80[_0x5ac3('0x15')]=null;}if(_0x377192){_0x151b80[_0x5ac3('0x16')]=![];}return cmHopper[_0x5ac3('0x14')](_0x151b80)[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0x17')));};exports[_0x5ac3('0x18')]=function(_0x22f88e){return cmHopper[_0x5ac3('0x18')](_0x22f88e)[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0x19')));};exports['unlockContact']=function(_0x30ab36){return cmHopper[_0x5ac3('0x1a')]({'UserId':null},_0x30ab36,0x1)[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0x1b')));};exports[_0x5ac3('0x1c')]=function(_0x18ac9c){return cmHopper[_0x5ac3('0x1a')]({'active':![]},_0x18ac9c,0x1)[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0x1d')));};exports[_0x5ac3('0x1e')]=function(_0x37628f){var _0x20c3a5={};_0x20c3a5[_0x5ac3('0x1f')]=_0x37628f[_0x5ac3('0x1f')];_0x20c3a5['uniqueid']=_0x37628f[_0x5ac3('0x20')];_0x20c3a5[_0x5ac3('0x21')]=_0x37628f[_0x5ac3('0x21')];_0x20c3a5[_0x5ac3('0x22')]=_0x37628f[_0x5ac3('0x22')];_0x20c3a5['queue']=_0x37628f[_0x5ac3('0x23')];_0x20c3a5[_0x5ac3('0x24')]=_0x37628f['answertime'];_0x20c3a5[_0x5ac3('0x25')]=_0x37628f[_0x5ac3('0x26')];_0x20c3a5[_0x5ac3('0x27')]=0x1;_0x20c3a5[_0x5ac3('0x28')]=_0x37628f[_0x5ac3('0x29')];_0x20c3a5[_0x5ac3('0x2a')]=_0x37628f[_0x5ac3('0x2b')];_0x20c3a5['context']=_0x5ac3('0x2c');_0x20c3a5[_0x5ac3('0x2d')]='xcally-motion-preview';_0x20c3a5['holdtime']=0x0;_0x20c3a5[_0x5ac3('0x2e')]=0x1;_0x20c3a5[_0x5ac3('0x2f')]=_0x37628f['membername'];_0x20c3a5[_0x5ac3('0x30')]=_0x5ac3('0x31');return BPromise[_0x5ac3('0x9')]()[_0x5ac3('0xa')](voiceQueueReport['create'](_0x20c3a5))[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0x32')));};exports[_0x5ac3('0x33')]=function(_0x29300a,_0x7254d8){return BPromise[_0x5ac3('0x9')]()['then'](cmHopper[_0x5ac3('0x33')](_0x29300a,_0x7254d8))[_0x5ac3('0x8')](loggerCatch(_0x5ac3('0x34')));};exports[_0x5ac3('0x35')]=function(_0x285d50){return cmHopper[_0x5ac3('0x14')](_0x285d50,!![],!![])['catch'](loggerCatch(_0x5ac3('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 1a6126f..f8f6402 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 _0xfdd6=['127.0.0.1','../../dialer/utils','error','inspect','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','statedesc','getSeconds','membername','UserId','ringtime','talktime','answertime','isFailure','RECALL','uniqueid','originate','channelAgent','calleridnum','timeout','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridNumber','match','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI'];(function(_0x2980d9,_0xef7ff){var _0x37994e=function(_0x555936){while(--_0x555936){_0x2980d9['push'](_0x2980d9['shift']());}};_0x37994e(++_0xef7ff);}(_0xfdd6,0x10c));var _0x6fdd=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xfdd6[_0x529296];return _0x1796bf;};'use strict';var util=require(_0x6fdd('0x0'));var _=require(_0x6fdd('0x1'));var moment=require('moment');var logger=require(_0x6fdd('0x2'))(_0x6fdd('0x3'));var ipAgi=process[_0x6fdd('0x4')][_0x6fdd('0x5')]||_0x6fdd('0x6');var utils=require(_0x6fdd('0x7'));exports['loggerCatch']=function(_0x2349cc){return function(_0x111261){logger[_0x6fdd('0x8')](_0x2349cc,util[_0x6fdd('0x9')](_0x111261,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x149a53,_0x22ac04){logger[_0x6fdd('0xa')](_0x149a53,util[_0x6fdd('0x9')](_0x22ac04,{'showHidden':![],'depth':null}));};exports[_0x6fdd('0xb')]=function(_0x36dc57,_0x335027){logger[_0x6fdd('0x8')](_0x36dc57,util[_0x6fdd('0x9')](_0x335027,{'showHidden':![],'depth':null}));};exports[_0x6fdd('0xc')]=function(_0x3544e1){return function(_0x5108b1){logger[_0x6fdd('0xa')](_0x3544e1,util[_0x6fdd('0x9')](_0x5108b1,{'showHidden':![],'depth':null}));};};exports[_0x6fdd('0xd')]=function(_0x4c3f49,_0x48ac4d,_0x4b63a3){return{'message':_0x4c3f49,'unlock':_0x48ac4d,'active':_0x4b63a3};};exports['getCallerId']=function(_0x2c8302,_0x3b9b5c,_0x44c2d0){if(!_[_0x6fdd('0xe')](_0x44c2d0)&&'string'===typeof _0x44c2d0&&!_['isEmpty'](_0x44c2d0)){if(!_['isUndefined'](_0x3b9b5c)&&_0x6fdd('0xf')===typeof _0x3b9b5c&&!_[_0x6fdd('0x10')](_0x3b9b5c)){return util[_0x6fdd('0x11')]('\x22%s\x22\x20<%s>',_0x3b9b5c,_0x44c2d0);}return util[_0x6fdd('0x11')](_0x6fdd('0x12'),_0x44c2d0,_0x44c2d0);}if(!_[_0x6fdd('0xe')](_0x2c8302)&&_0x6fdd('0xf')===typeof _0x2c8302&&!_['isEmpty'](_0x2c8302)){return _0x2c8302;}return _0x6fdd('0x13');};exports[_0x6fdd('0x14')]=function(_0x4df7ad){if(_[_0x6fdd('0x15')](_0x4df7ad)){return![];}return _0x4df7ad;};exports[_0x6fdd('0x16')]=function(_0x12410a,_0x22a950,_0x4fd68a,_0x2f8374,_0x264790,_0x2d9645){var _0x2d7fd7={'XMD-QUEUE':_0x22a950[_0x6fdd('0x17')]?_0x22a950[_0x6fdd('0x17')][_0x6fdd('0x18')]:'','XMD-CALLERID':_0x2f8374,'XMD-CALLERID-PREVIEW':_0x2d9645?util[_0x6fdd('0x11')]('\x22%s\x22\x20<%s>',_0x2d9645[_0x6fdd('0x19')],_0x2d9645['calleridnum']):_0x2f8374,'XMD-DIALID':_0x264790,'XMD-CONTACTID':_0x22a950[_0x6fdd('0x1a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2f8374,'XMD-VOICEQUEUEID':_0x22a950[_0x6fdd('0x1b')],'XMD-DIALCHANNEL':_0x4fd68a,'XMD-DIALTIMEOUT':_0x12410a[_0x6fdd('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x6fdd('0x11')](_0x6fdd('0x1d'),_0x12410a[_0x6fdd('0x1e')]?'g':'',_[_0x6fdd('0x10')](_0x12410a[_0x6fdd('0x1f')])?'':_0x6fdd('0x20')),'XMD-DIALURL':_0x12410a['dialPreviewUrl']||'','XMD-AGI':_0x12410a['dialQueueProject']?util['format'](_0x6fdd('0x21'),ipAgi,_0x12410a[_0x6fdd('0x22')]):_0x6fdd('0x23'),'XMD-AGIAFTER':_0x12410a['dialQueueProject2']?util[_0x6fdd('0x11')](_0x6fdd('0x21'),ipAgi,_0x12410a[_0x6fdd('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2d9645?_0x2d9645[_0x6fdd('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x2d9645?_0x2d9645['originatecalleridname']:'','XMD-DESTINATION':_0x6fdd('0x25'),'SIPADDHEADER':_0x6fdd('0x26')};if(!_[_0x6fdd('0x10')](_0x12410a[_0x6fdd('0x1f')])){_0x2d7fd7[util[_0x6fdd('0x11')]('%s',_0x6fdd('0x27'))]=_0x12410a[_0x6fdd('0x1f')];_0x2d7fd7[util[_0x6fdd('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x264790;}return _0x2d7fd7;};exports['toLowerVariables']=function(_0x533f0f){var _0x2a6203={};for(var _0x52212e in _0x533f0f){if(_0x533f0f[_0x6fdd('0x28')](_0x52212e)){_0x2a6203[util[_0x6fdd('0x11')]('%s',_[_0x6fdd('0x29')](_0x52212e))]=_0x533f0f[_0x52212e];}}return{'variables':_0x2a6203};};exports['updateOriginated']=function(_0x471789,_0x45b397){if(!_[_0x6fdd('0x15')](_0x471789)){if(_0x471789[_0x6fdd('0x28')](_0x6fdd('0x2a'))){if(_0x471789['originated']>0x0){_0x471789['originated']-=0x1;}else{logger[_0x6fdd('0x8')](_0x6fdd('0x2b'),_0x45b397);}}}else{logger[_0x6fdd('0x8')](_0x6fdd('0x2c'),_0x45b397);}};exports[_0x6fdd('0x2d')]=function(_0x4a8d84){var _0x44c792=moment()[_0x6fdd('0x11')](_0x6fdd('0x2e'));_0x4a8d84[_0x6fdd('0x2f')]=0xd;_0x4a8d84['statedesc']=_0x6fdd('0x30');_0x4a8d84[_0x6fdd('0x31')]=_0x44c792;_0x4a8d84[_0x6fdd('0x32')]=_0x44c792;_0x4a8d84[_0x6fdd('0x33')]=_0x44c792;};exports['logAgent']=function(_0x2d1c40,_0x1bb747,_0x54f7ff){var _0x3d77ee=moment()[_0x6fdd('0x11')](_0x6fdd('0x2e'));_0x2d1c40[_0x6fdd('0x2f')]=_0x1bb747;_0x2d1c40[_0x6fdd('0x34')]=_0x54f7ff;_0x2d1c40[_0x6fdd('0x32')]=_0x3d77ee;_0x2d1c40['ringtime']=utils[_0x6fdd('0x35')](_0x2d1c40[_0x6fdd('0x32')],_0x2d1c40[_0x6fdd('0x31')]);};exports['logLookAgent']=function(_0x532b08,_0xe5a9dd,_0x442162){_0x532b08[_0x6fdd('0x36')]=_0xe5a9dd;_0x532b08[_0x6fdd('0x37')]=_0x442162;};exports['logCustomer']=function(_0x27fd4d,_0x307089,_0x3bf603){var _0x19e290=moment()[_0x6fdd('0x11')](_0x6fdd('0x2e'));_0x27fd4d['state']=_0x307089;_0x27fd4d[_0x6fdd('0x34')]=_0x3bf603;_0x27fd4d['responsetime']=_0x27fd4d['responsetime']?_0x27fd4d[_0x6fdd('0x32')]:_0x19e290;_0x27fd4d[_0x6fdd('0x33')]=_0x27fd4d['endtime']?_0x27fd4d['endtime']:_0x19e290;_0x27fd4d[_0x6fdd('0x38')]=utils[_0x6fdd('0x35')](_0x27fd4d[_0x6fdd('0x32')]||0x0,_0x27fd4d['starttime']||0x0);_0x27fd4d[_0x6fdd('0x39')]=_0x27fd4d[_0x6fdd('0x3a')]?utils[_0x6fdd('0x35')](_0x27fd4d['endtime'],_0x27fd4d[_0x6fdd('0x3a')]):0x0;};exports[_0x6fdd('0x3b')]=function(_0xf37158){return _0xf37158==='Failure';};exports['variablesAction']=function(_0x321c83,_0x1fdaad,_0x4534c3,_0x1e3a26,_0x5c1f39){var _0x2f8d84=_0x1e3a26?_0x6fdd('0x3c'):_0x321c83[_0x6fdd('0x19')];_0x2f8d84=_0x5c1f39?'BOOKED':_0x2f8d84;return{'actionid':_0x321c83[_0x6fdd('0x3d')],'action':_0x6fdd('0x3e'),'channel':_0x321c83[_0x6fdd('0x3f')],'callerid':util[_0x6fdd('0x11')](_0x6fdd('0x12'),_0x2f8d84,_0x321c83[_0x6fdd('0x40')]),'Exten':_0x6fdd('0x25'),'Context':'from-sip','Priority':'1','variable':_0x4534c3,'timeout':(_0x1fdaad[_0x6fdd('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x321c83[_0x6fdd('0x3d')]};};exports[_0x6fdd('0x42')]=function(_0x4aff36){return _0x4aff36[_0x6fdd('0x43')]+_0x4aff36[_0x6fdd('0x44')]+_0x4aff36['countnoanswerretry']+_0x4aff36['countagentrejectretry']+_0x4aff36[_0x6fdd('0x45')];};exports[_0x6fdd('0x46')]=function(_0x33ce9b){var _0x40f6f2=_['clone'](_0x33ce9b);_0x40f6f2[_0x6fdd('0x2f')]=0xf;_0x40f6f2['statedesc']=_0x6fdd('0x47');return _0x40f6f2;};exports[_0x6fdd('0x48')]=function(_0x1d21a2,_0x4d075a,_0x39421a){var _0x3ad39d={};_0x3ad39d[_0x4d075a]=_0x1d21a2[_0x4d075a];_0x3ad39d[_0x6fdd('0x49')]=![];_0x3ad39d[_0x6fdd('0x4a')]=moment()[_0x6fdd('0x4b')](_0x39421a,'minutes')[_0x6fdd('0x11')](_0x6fdd('0x2e'));_0x3ad39d[_0x6fdd('0x1a')]=_0x1d21a2[_0x6fdd('0x1a')];_0x3ad39d[_0x6fdd('0x4c')]=_0x1d21a2[_0x6fdd('0x4c')];_0x3ad39d[_0x6fdd('0x1b')]=_0x1d21a2[_0x6fdd('0x1b')]||undefined;return _0x3ad39d;};exports['decrementTalkink']=function(_0x1508fd,_0x635b5a){if(!_[_0x6fdd('0x15')](_0x1508fd)){if(_0x1508fd[_0x6fdd('0x4d')]>0x0){_0x1508fd[_0x6fdd('0x4d')]-=0x1;}else{logger['error'](_0x635b5a,_0x6fdd('0x4e'));}}else{logger['error'](_0x635b5a,_0x6fdd('0x4f'));}};exports[_0x6fdd('0x50')]=function(_0x21faae){if(_0x21faae<=0x0){return!![];}return![];};function buildObj(_0x5db3fb,_0x19b087,_0x2905e7){_0x5db3fb[_0x6fdd('0x51')]=_0x19b087;_0x5db3fb[_0x6fdd('0x18')]=_0x5db3fb[_0x6fdd('0x52')];_0x5db3fb[_0x6fdd('0x53')]=_0x5db3fb[_0x6fdd('0x3f')];_0x5db3fb[_0x6fdd('0x54')]=_0x6fdd('0x55');if(_0x2905e7){_0x5db3fb['mandatoryDisposition']=_0x2905e7['mandatoryDisposition'];}return _0x5db3fb;}exports['buildObj']=buildObj;exports[_0x6fdd('0x56')]=function(_0x39c332){var _0x4829c3=[];for(var _0x2274ce in _0x39c332){if(_0x39c332[_0x6fdd('0x28')](_0x2274ce)){if(!_['isNil'](_0x39c332[_0x2274ce])&&_0x39c332[_0x2274ce][_0x6fdd('0x2f')]===_0x6fdd('0x57')&&_0x39c332[_0x2274ce][_0x6fdd('0x58')]===_0x6fdd('0x59')){_0x4829c3[_0x6fdd('0x5a')](_0x39c332[_0x2274ce]['id']);}}}return _0x4829c3;};exports[_0x6fdd('0x5b')]=function(_0x155e77){var _0xaba93c=moment()[_0x6fdd('0x5c')](0x0);var _0x6beee=moment(_0x155e77)[_0x6fdd('0x5c')](0x0);return _0xaba93c['diff'](_0x6beee,'seconds');};exports[_0x6fdd('0x5d')]=function(_0xa013eb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xa013eb['ContactId'],'ListId':_0xa013eb[_0x6fdd('0x4c')],'VoiceQueueId':_0xa013eb[_0x6fdd('0x1b')]||undefined,'CampaignId':_0xa013eb[_0x6fdd('0x5e')]||undefined};};exports[_0x6fdd('0x5f')]=function(_0xab74c6){if(_0xab74c6==='uniqueid'||_0xab74c6===_0x6fdd('0x60')||_0xab74c6===_0x6fdd('0x52')||_0xab74c6===_0x6fdd('0x61')||_0xab74c6===_0x6fdd('0x62')||_0xab74c6===_0x6fdd('0x63')||_0xab74c6===_0x6fdd('0x36')||_0xab74c6===_0x6fdd('0x3f')||_0xab74c6===_0x6fdd('0x19')||_0xab74c6===_0x6fdd('0x49')||_0xab74c6==='calleridnum'||_0xab74c6===_0x6fdd('0x4a')||_0xab74c6===_0x6fdd('0x43')||_0xab74c6===_0x6fdd('0x44')||_0xab74c6===_0x6fdd('0x64')||_0xab74c6===_0x6fdd('0x65')||_0xab74c6===_0x6fdd('0x66')||_0xab74c6===_0x6fdd('0x67')||_0xab74c6===_0x6fdd('0x68')||_0xab74c6==='recallme'||_0xab74c6===_0x6fdd('0x1a')||_0xab74c6===_0x6fdd('0x4c')||_0xab74c6==='UserId'||_0xab74c6===_0x6fdd('0x1b')||_0xab74c6===_0x6fdd('0x69')||_0xab74c6==='xmd-voicequeueid'||_0xab74c6===_0x6fdd('0x6a')||_0xab74c6===_0x6fdd('0x6b')||_0xab74c6===_0x6fdd('0x6c')||_0xab74c6==='xmd-dialurl'||_0xab74c6==='xmd-dialtimeout'||_0xab74c6===_0x6fdd('0x6d')||_0xab74c6===_0x6fdd('0x6e')||_0xab74c6===_0x6fdd('0x6f')||_0xab74c6===_0x6fdd('0x70')||_0xab74c6===_0x6fdd('0x71')||_0xab74c6===_0x6fdd('0x72')||_0xab74c6===_0x6fdd('0x73')||_0xab74c6==='xmd-agi'||_0xab74c6===_0x6fdd('0x74')||_0xab74c6===_0x6fdd('0x75')||_0xab74c6===_0x6fdd('0x76')||_0xab74c6==='rtpaudioqosjitterbridged'||_0xab74c6===_0x6fdd('0x77')||_0xab74c6===_0x6fdd('0x78')||_0xab74c6===_0x6fdd('0x79')||_0xab74c6===_0x6fdd('0x7a')||_0xab74c6==='rtpaudioqos'||_0xab74c6==='rtpaudioqosbridged'||_0xab74c6===_0x6fdd('0x76')||_0xab74c6===_0x6fdd('0x7b')||_0xab74c6===_0x6fdd('0x77')||_0xab74c6===_0x6fdd('0x78')||_0xab74c6==='rtpaudioqosrtt'||_0xab74c6===_0x6fdd('0x7a')||_0xab74c6===_0x6fdd('0x7c')||_0xab74c6===_0x6fdd('0x7d')||_0xab74c6===_0x6fdd('0x2f')||_0xab74c6==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0xb1cc5a,_0x162b28){var _0x2244e0,_0x4f6070,_0x464a15;if(_0x162b28<=0x0){_0x162b28=0x1;}_0x2244e0=new RegExp(_0x6fdd('0x7e')+_0x162b28+'}$');_0x4f6070=Math[_0x6fdd('0x7f')](0xa,_0x162b28-0x1);_0x464a15=Math['pow'](0xa,_0x162b28)-0x1;return util[_0x6fdd('0x11')]('%s',_['replace'](_0xb1cc5a,_0x2244e0,_[_0x6fdd('0x80')](_0x4f6070,_0x464a15)));};exports['extractCalleridName']=function(_0x1c098f){var _0x47f274=_0x1c098f['match'](/"(.*?)"/);return _0x47f274?_0x47f274[0x1]:_0x1c098f;};exports[_0x6fdd('0x81')]=function(_0x5966ae){var _0x4b14f7=_0x5966ae[_0x6fdd('0x82')](/<(.*?)>/);return _0x4b14f7?_0x4b14f7[0x1]:_0x5966ae;};function buildNoAnswerEventPayload(_0x3ea579,_0xb427cf){var _0x3ffbb5=buildObj(_0x3ea579,_0x6fdd('0x83'));if(!_['isEmpty'](_0xb427cf[_0x6fdd('0x84')])){Object[_0x6fdd('0x85')](_0xb427cf[_0x6fdd('0x84')])[_0x6fdd('0x86')](function(_0x21f785){_0x3ffbb5[_0x21f785[_0x6fdd('0x87')]()]=_0xb427cf[_0x6fdd('0x84')][_0x21f785];});}return _0x3ffbb5;}exports[_0x6fdd('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x57b5=['xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','pow','replace','random','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','logger2','info','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','starttime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','getSeconds','logLookAgent','membername','UserId','statedesc','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','Global','active','scheduledat','minutes','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','idContact','type','campaigntype','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl'];(function(_0x324c68,_0x3545c9){var _0x12023f=function(_0x13c2f8){while(--_0x13c2f8){_0x324c68['push'](_0x324c68['shift']());}};_0x12023f(++_0x3545c9);}(_0x57b5,0x1bf));var _0x557b=function(_0x3d5798,_0x11a5a4){_0x3d5798=_0x3d5798-0x0;var _0x2f9b86=_0x57b5[_0x3d5798];return _0x2f9b86;};'use strict';var util=require(_0x557b('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0x557b('0x1'));var ipAgi=process[_0x557b('0x2')][_0x557b('0x3')]||_0x557b('0x4');var utils=require(_0x557b('0x5'));exports[_0x557b('0x6')]=function(_0xdebfa1){return function(_0x1f257d){logger[_0x557b('0x7')](_0xdebfa1,util[_0x557b('0x8')](_0x1f257d,{'showHidden':![],'depth':null}));};};exports[_0x557b('0x9')]=function(_0x5b5519,_0x34209a){logger['info'](_0x5b5519,util[_0x557b('0x8')](_0x34209a,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4ba2e9,_0x54ea92){logger['error'](_0x4ba2e9,util[_0x557b('0x8')](_0x54ea92,{'showHidden':![],'depth':null}));};exports[_0x557b('0xa')]=function(_0x2e20d0){return function(_0x3e5dc4){logger[_0x557b('0xb')](_0x2e20d0,util[_0x557b('0x8')](_0x3e5dc4,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x3a1a95,_0x216003,_0x1eee7e){return{'message':_0x3a1a95,'unlock':_0x216003,'active':_0x1eee7e};};exports[_0x557b('0xc')]=function(_0x557fe4,_0x363557,_0x13f242){if(!_[_0x557b('0xd')](_0x13f242)&&_0x557b('0xe')===typeof _0x13f242&&!_['isEmpty'](_0x13f242)){if(!_[_0x557b('0xd')](_0x363557)&&_0x557b('0xe')===typeof _0x363557&&!_[_0x557b('0xf')](_0x363557)){return util[_0x557b('0x10')](_0x557b('0x11'),_0x363557,_0x13f242);}return util[_0x557b('0x10')](_0x557b('0x11'),_0x13f242,_0x13f242);}if(!_[_0x557b('0xd')](_0x557fe4)&&_0x557b('0xe')===typeof _0x557fe4&&!_[_0x557b('0xf')](_0x557fe4)){return _0x557fe4;}return _0x557b('0x12');};exports[_0x557b('0x13')]=function(_0x5d1730){if(_['isNil'](_0x5d1730)){return![];}return _0x5d1730;};exports[_0x557b('0x14')]=function(_0x5ef7bb,_0x3ddddf,_0x2d411f,_0x1c0097,_0x43325b,_0x4b0471){var _0x269db2={'XMD-QUEUE':_0x3ddddf['Queue']?_0x3ddddf[_0x557b('0x15')][_0x557b('0x16')]:'','XMD-CALLERID':_0x1c0097,'XMD-CALLERID-PREVIEW':_0x4b0471?util['format'](_0x557b('0x11'),_0x4b0471[_0x557b('0x17')],_0x4b0471[_0x557b('0x18')]):_0x1c0097,'XMD-DIALID':_0x43325b,'XMD-CONTACTID':_0x3ddddf[_0x557b('0x19')],'XMD-CDRTYPE':_0x557b('0x1a'),'CALLERID(all)':_0x1c0097,'XMD-VOICEQUEUEID':_0x3ddddf[_0x557b('0x1b')],'XMD-DIALCHANNEL':_0x2d411f,'XMD-DIALTIMEOUT':_0x5ef7bb[_0x557b('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x557b('0x10')](_0x557b('0x1d'),_0x5ef7bb[_0x557b('0x1e')]?'g':'',_[_0x557b('0xf')](_0x5ef7bb[_0x557b('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5ef7bb['dialPreviewUrl']||'','XMD-AGI':_0x5ef7bb['dialQueueProject']?util[_0x557b('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5ef7bb[_0x557b('0x20')]):_0x557b('0x21'),'XMD-AGIAFTER':_0x5ef7bb[_0x557b('0x1e')]?util['format'](_0x557b('0x22'),ipAgi,_0x5ef7bb[_0x557b('0x1e')]):_0x557b('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x4b0471?_0x4b0471[_0x557b('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x4b0471?_0x4b0471[_0x557b('0x24')]:'','XMD-DESTINATION':_0x557b('0x25'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x557b('0xf')](_0x5ef7bb[_0x557b('0x1f')])){_0x269db2[util[_0x557b('0x10')]('%s',_0x557b('0x26'))]=_0x5ef7bb['monitor_format'];_0x269db2[util[_0x557b('0x10')]('%s',_0x557b('0x27'))]=_0x43325b;}return _0x269db2;};exports[_0x557b('0x28')]=function(_0x49c7b5){var _0x507608={};for(var _0x45ca88 in _0x49c7b5){if(_0x49c7b5[_0x557b('0x29')](_0x45ca88)){_0x507608[util[_0x557b('0x10')]('%s',_['toLower'](_0x45ca88))]=_0x49c7b5[_0x45ca88];}}return{'variables':_0x507608};};exports[_0x557b('0x2a')]=function(_0x40434f,_0x36655){if(!_[_0x557b('0x2b')](_0x40434f)){if(_0x40434f[_0x557b('0x29')]('originated')){if(_0x40434f[_0x557b('0x2c')]>0x0){_0x40434f[_0x557b('0x2c')]-=0x1;}else{logger[_0x557b('0x7')](_0x557b('0x2d'),_0x36655);}}}else{logger[_0x557b('0x7')](_0x557b('0x2e'),_0x36655);}};exports[_0x557b('0x2f')]=function(_0x4391dc){var _0x56d1c8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4391dc[_0x557b('0x30')]=0xd;_0x4391dc['statedesc']=_0x557b('0x31');_0x4391dc[_0x557b('0x32')]=_0x56d1c8;_0x4391dc['responsetime']=_0x56d1c8;_0x4391dc[_0x557b('0x33')]=_0x56d1c8;};exports[_0x557b('0x34')]=function(_0x589dff,_0x1adbb0,_0x1893d3){var _0x2bb320=moment()[_0x557b('0x10')](_0x557b('0x35'));_0x589dff['state']=_0x1adbb0;_0x589dff['statedesc']=_0x1893d3;_0x589dff[_0x557b('0x36')]=_0x2bb320;_0x589dff[_0x557b('0x37')]=utils[_0x557b('0x38')](_0x589dff[_0x557b('0x36')],_0x589dff[_0x557b('0x32')]);};exports[_0x557b('0x39')]=function(_0x1938ea,_0x60a8b,_0x4c94fd){_0x1938ea[_0x557b('0x3a')]=_0x60a8b;_0x1938ea[_0x557b('0x3b')]=_0x4c94fd;};exports['logCustomer']=function(_0x2e2be0,_0x442840,_0x4a44ea){var _0x3b9f05=moment()[_0x557b('0x10')](_0x557b('0x35'));_0x2e2be0['state']=_0x442840;_0x2e2be0[_0x557b('0x3c')]=_0x4a44ea;_0x2e2be0[_0x557b('0x36')]=_0x2e2be0['responsetime']?_0x2e2be0[_0x557b('0x36')]:_0x3b9f05;_0x2e2be0[_0x557b('0x33')]=_0x2e2be0[_0x557b('0x33')]?_0x2e2be0[_0x557b('0x33')]:_0x3b9f05;_0x2e2be0[_0x557b('0x37')]=utils['getSeconds'](_0x2e2be0[_0x557b('0x36')]||0x0,_0x2e2be0['starttime']||0x0);_0x2e2be0[_0x557b('0x3d')]=_0x2e2be0[_0x557b('0x3e')]?utils[_0x557b('0x38')](_0x2e2be0['endtime'],_0x2e2be0['answertime']):0x0;};exports[_0x557b('0x3f')]=function(_0x1c2de3){return _0x1c2de3===_0x557b('0x40');};exports[_0x557b('0x41')]=function(_0x4ec2f3,_0x31def2,_0x11df8f,_0x34184c,_0x4f1d0e){var _0x246011=_0x34184c?_0x557b('0x42'):_0x4ec2f3['calleridname'];_0x246011=_0x4f1d0e?_0x557b('0x43'):_0x246011;return{'actionid':_0x4ec2f3[_0x557b('0x44')],'action':_0x557b('0x45'),'channel':_0x4ec2f3[_0x557b('0x46')],'callerid':util['format'](_0x557b('0x11'),_0x246011,_0x4ec2f3[_0x557b('0x18')]),'Exten':_0x557b('0x25'),'Context':_0x557b('0x47'),'Priority':'1','variable':_0x11df8f,'timeout':(_0x31def2[_0x557b('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4ec2f3[_0x557b('0x44')]};};exports[_0x557b('0x49')]=function(_0x11b08a){return _0x11b08a[_0x557b('0x4a')]+_0x11b08a[_0x557b('0x4b')]+_0x11b08a[_0x557b('0x4c')]+_0x11b08a['countagentrejectretry']+_0x11b08a['countnosuchnumberretry'];};exports['cloneAction']=function(_0x54ee70){var _0xe4baa3=_['clone'](_0x54ee70);_0xe4baa3[_0x557b('0x30')]=0xf;_0xe4baa3[_0x557b('0x3c')]=_0x557b('0x4d');return _0xe4baa3;};exports['scheduledAt']=function(_0x3dd89d,_0x5e4c63,_0x454827){var _0x24d82a={};_0x24d82a[_0x5e4c63]=_0x3dd89d[_0x5e4c63];_0x24d82a[_0x557b('0x4e')]=![];_0x24d82a[_0x557b('0x4f')]=moment()['add'](_0x454827,_0x557b('0x50'))[_0x557b('0x10')](_0x557b('0x35'));_0x24d82a[_0x557b('0x19')]=_0x3dd89d[_0x557b('0x19')];_0x24d82a[_0x557b('0x51')]=_0x3dd89d['ListId'];_0x24d82a[_0x557b('0x1b')]=_0x3dd89d[_0x557b('0x1b')]||undefined;return _0x24d82a;};exports[_0x557b('0x52')]=function(_0x46c1f2,_0x360bca){if(!_[_0x557b('0x2b')](_0x46c1f2)){if(_0x46c1f2['pTalking']>0x0){_0x46c1f2['pTalking']-=0x1;}else{logger[_0x557b('0x7')](_0x360bca,_0x557b('0x53'));}}else{logger['error'](_0x360bca,_0x557b('0x54'));}};exports[_0x557b('0x55')]=function(_0x5ecedd){if(_0x5ecedd<=0x0){return!![];}return![];};function buildObj(_0x260451,_0x28bb32,_0x2ad07d){_0x260451[_0x557b('0x56')]=_0x28bb32;_0x260451[_0x557b('0x16')]=_0x260451[_0x557b('0x57')];_0x260451['interface']=_0x260451[_0x557b('0x46')];_0x260451[_0x557b('0x58')]=_0x557b('0x59');if(_0x2ad07d){_0x260451[_0x557b('0x5a')]=_0x2ad07d[_0x557b('0x5a')];}return _0x260451;}exports[_0x557b('0x5b')]=buildObj;exports[_0x557b('0x5c')]=function(_0x4756aa){var _0x40bb9f=[];for(var _0x58beaa in _0x4756aa){if(_0x4756aa['hasOwnProperty'](_0x58beaa)){if(!_['isNil'](_0x4756aa[_0x58beaa])&&_0x4756aa[_0x58beaa][_0x557b('0x30')]===_0x557b('0x5d')&&_0x4756aa[_0x58beaa]['status']==='reachable'){_0x40bb9f[_0x557b('0x5e')](_0x4756aa[_0x58beaa]['id']);}}}return _0x40bb9f;};exports[_0x557b('0x5f')]=function(_0x44df91){var _0xe1d71c=moment()[_0x557b('0x60')](0x0);var _0x236627=moment(_0x44df91)['milliseconds'](0x0);return _0xe1d71c[_0x557b('0x61')](_0x236627,_0x557b('0x62'));};exports[_0x557b('0x63')]=function(_0x315a60){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x315a60[_0x557b('0x19')],'ListId':_0x315a60[_0x557b('0x51')],'VoiceQueueId':_0x315a60['VoiceQueueId']||undefined,'CampaignId':_0x315a60[_0x557b('0x64')]||undefined};};exports['filterKey']=function(_0x6b0ff8){if(_0x6b0ff8===_0x557b('0x44')||_0x6b0ff8===_0x557b('0x65')||_0x6b0ff8===_0x557b('0x57')||_0x6b0ff8===_0x557b('0x66')||_0x6b0ff8===_0x557b('0x67')||_0x6b0ff8==='dialAnswer'||_0x6b0ff8===_0x557b('0x3a')||_0x6b0ff8==='channelAgent'||_0x6b0ff8===_0x557b('0x17')||_0x6b0ff8===_0x557b('0x4e')||_0x6b0ff8===_0x557b('0x18')||_0x6b0ff8===_0x557b('0x4f')||_0x6b0ff8===_0x557b('0x4a')||_0x6b0ff8==='countcongestionretry'||_0x6b0ff8===_0x557b('0x4c')||_0x6b0ff8===_0x557b('0x68')||_0x6b0ff8===_0x557b('0x69')||_0x6b0ff8===_0x557b('0x6a')||_0x6b0ff8===_0x557b('0x6b')||_0x6b0ff8===_0x557b('0x6c')||_0x6b0ff8===_0x557b('0x19')||_0x6b0ff8===_0x557b('0x51')||_0x6b0ff8===_0x557b('0x3b')||_0x6b0ff8===_0x557b('0x1b')||_0x6b0ff8==='sipcallid'||_0x6b0ff8===_0x557b('0x6d')||_0x6b0ff8==='xmd-queue'||_0x6b0ff8===_0x557b('0x6e')||_0x6b0ff8===_0x557b('0x6f')||_0x6b0ff8===_0x557b('0x70')||_0x6b0ff8===_0x557b('0x71')||_0x6b0ff8===_0x557b('0x72')||_0x6b0ff8===_0x557b('0x73')||_0x6b0ff8===_0x557b('0x74')||_0x6b0ff8===_0x557b('0x75')||_0x6b0ff8==='xmd-cdrtype'||_0x6b0ff8==='xmd-callerid'||_0x6b0ff8===_0x557b('0x76')||_0x6b0ff8===_0x557b('0x77')||_0x6b0ff8===_0x557b('0x78')||_0x6b0ff8===_0x557b('0x79')||_0x6b0ff8===_0x557b('0x7a')||_0x6b0ff8===_0x557b('0x7b')||_0x6b0ff8===_0x557b('0x7c')||_0x6b0ff8===_0x557b('0x7d')||_0x6b0ff8===_0x557b('0x7e')||_0x6b0ff8===_0x557b('0x7f')||_0x6b0ff8==='rtpaudioqos'||_0x6b0ff8===_0x557b('0x79')||_0x6b0ff8==='rtpaudioqosjitter'||_0x6b0ff8==='rtpaudioqosjitterbridged'||_0x6b0ff8===_0x557b('0x7c')||_0x6b0ff8==='rtpaudioqoslossbridged'||_0x6b0ff8==='rtpaudioqosrtt'||_0x6b0ff8===_0x557b('0x7f')||_0x6b0ff8===_0x557b('0x80')||_0x6b0ff8===_0x557b('0x81')||_0x6b0ff8===_0x557b('0x30')||_0x6b0ff8===_0x557b('0x3c')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2f20ae,_0xd027cd){var _0xc666d1,_0x187171,_0x2016ed;if(_0xd027cd<=0x0){_0xd027cd=0x1;}_0xc666d1=new RegExp('\x5cw{0,'+_0xd027cd+'}$');_0x187171=Math[_0x557b('0x82')](0xa,_0xd027cd-0x1);_0x2016ed=Math[_0x557b('0x82')](0xa,_0xd027cd)-0x1;return util['format']('%s',_[_0x557b('0x83')](_0x2f20ae,_0xc666d1,_[_0x557b('0x84')](_0x187171,_0x2016ed)));};exports['extractCalleridName']=function(_0x2ceea7){var _0x338880=_0x2ceea7[_0x557b('0x85')](/"(.*?)"/);return _0x338880?_0x338880[0x1]:_0x2ceea7;};exports[_0x557b('0x86')]=function(_0x2257d1){var _0x33029f=_0x2257d1[_0x557b('0x85')](/<(.*?)>/);return _0x33029f?_0x33029f[0x1]:_0x2257d1;};function buildNoAnswerEventPayload(_0x3436cb,_0x4ab79a){var _0x264f22=buildObj(_0x3436cb,_0x557b('0x87'));if(!_['isEmpty'](_0x4ab79a[_0x557b('0x88')])){Object['keys'](_0x4ab79a['variables'])[_0x557b('0x89')](function(_0x2fec76){_0x264f22[_0x2fec76[_0x557b('0x8a')]()]=_0x4ab79a[_0x557b('0x88')][_0x2fec76];});}return _0x264f22;}exports[_0x557b('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 3f70853..6b32395 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 _0x268d=['reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queuepause'];(function(_0x322fa9,_0x40780c){var _0x232126=function(_0x4d4260){while(--_0x4d4260){_0x322fa9['push'](_0x322fa9['shift']());}};_0x232126(++_0x40780c);}(_0x268d,0x115));var _0xd268=function(_0x1b6751,_0x43a3a5){_0x1b6751=_0x1b6751-0x0;var _0x5484a8=_0x268d[_0x1b6751];return _0x5484a8;};'use strict';exports[_0xd268('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd268('0x1'),'required':!![]},'membername':{'type':_0xd268('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xd268('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xd268('0x2')]={'interface':{'type':_0xd268('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xd268('0x1'),'required':![]}};exports[_0xd268('0x3')]={'module':{'type':_0xd268('0x1'),'required':![]}};exports[_0xd268('0x4')]={'uniqueid':{'type':_0xd268('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd268('0x1')},'format':{'type':_0xd268('0x1')},'mixmonitorid':{'type':_0xd268('0x1')}};exports[_0xd268('0x5')]={'uniqueid':{'type':_0xd268('0x1'),'required':!![]}};exports[_0xd268('0x6')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xd268('0x1')}}; \ No newline at end of file +var _0x82d2=['voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queuepause'];(function(_0x381654,_0x233f76){var _0x13af54=function(_0x51b061){while(--_0x51b061){_0x381654['push'](_0x381654['shift']());}};_0x13af54(++_0x233f76);}(_0x82d2,0xd4));var _0x282d=function(_0x2bcf57,_0x176e37){_0x2bcf57=_0x2bcf57-0x0;var _0x3bc6d1=_0x82d2[_0x2bcf57];return _0x3bc6d1;};'use strict';exports[_0x282d('0x0')]={'queue':{'type':_0x282d('0x1'),'required':!![]},'interface':{'type':_0x282d('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x282d('0x2'),'required':![]},'paused':{'type':_0x282d('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x282d('0x1'),'required':!![]},'interface':{'type':_0x282d('0x1'),'required':!![]}};exports[_0x282d('0x4')]={'interface':{'type':_0x282d('0x1'),'required':!![]},'paused':{'type':_0x282d('0x3')},'reason':{'type':_0x282d('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x282d('0x1'),'required':!![]}};exports[_0x282d('0x5')]={'uniqueid':{'type':_0x282d('0x1'),'required':!![]},'filename':{'type':_0x282d('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x282d('0x1'),'required':!![]}};exports[_0x282d('0x6')]={'uniqueid':{'type':_0x282d('0x1'),'required':!![]},'exten':{'type':_0x282d('0x1'),'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 0b83a79..72f3b01 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(_0x21f8ee,_0x437c18){var _0x170f3a=function(_0xdadd23){while(--_0xdadd23){_0x21f8ee['push'](_0x21f8ee['shift']());}};_0x170f3a(++_0x437c18);}(_0xadb5,0xad));var _0x5adb=function(_0x5061a9,_0x5ddb3e){_0x5061a9=_0x5061a9-0x0;var _0x54995e=_0xadb5[_0x5061a9];return _0x54995e;};'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 _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x4ac1b0,_0x4887e2){var _0x4b06c5=function(_0x1beb40){while(--_0x1beb40){_0x4ac1b0['push'](_0x4ac1b0['shift']());}};_0x4b06c5(++_0x4887e2);}(_0xb10b,0x12a));var _0xbb10=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0xb10b[_0x3da612];return _0x1a9d1d;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index a4ff3d6..ef01fc4 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 _0xce65=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x19115e,_0x507bab){var _0x45bbd4=function(_0x1308bf){while(--_0x1308bf){_0x19115e['push'](_0x19115e['shift']());}};_0x45bbd4(++_0x507bab);}(_0xce65,0x1ca));var _0x5ce6=function(_0x4c32bc,_0x3cefe4){_0x4c32bc=_0x4c32bc-0x0;var _0x26a3b4=_0xce65[_0x4c32bc];return _0x26a3b4;};'use strict';function mergeDBDataToRealtime(_0x3e803c,_0x599b03){var _0x3a03eb=Object[_0x5ce6('0x0')]({},_0x3e803c);for(var _0x2e2505 in _0x599b03){if(_0x3a03eb[_0x5ce6('0x1')](_0x2e2505)){_0x3a03eb[_0x2e2505]=_0x599b03[_0x2e2505];}}return _0x3a03eb;}exports[_0x5ce6('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x16fe=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x35ceb8,_0xc332fc){var _0x2ea11e=function(_0x4c6494){while(--_0x4c6494){_0x35ceb8['push'](_0x35ceb8['shift']());}};_0x2ea11e(++_0xc332fc);}(_0x16fe,0x82));var _0xe16f=function(_0x45502a,_0x3ca17b){_0x45502a=_0x45502a-0x0;var _0x55959c=_0x16fe[_0x45502a];return _0x55959c;};'use strict';function mergeDBDataToRealtime(_0x288b4d,_0x3d98c9){var _0xad4050=Object[_0xe16f('0x0')]({},_0x288b4d);for(var _0x28194a in _0x3d98c9){if(_0xad4050[_0xe16f('0x1')](_0x28194a)){_0xad4050[_0x28194a]=_0x3d98c9[_0x28194a];}}return _0xad4050;}exports[_0xe16f('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 7e50a74..8713658 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 _0x3fdd=['../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','type','UserId','membername','monitor','monitors','length','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','phone','indexOf','lastIndexOf','transfererlinkedid','exports','moment','util'];(function(_0xaa9b4b,_0x515dff){var _0x29625f=function(_0x284950){while(--_0x284950){_0xaa9b4b['push'](_0xaa9b4b['shift']());}};_0x29625f(++_0x515dff);}(_0x3fdd,0x17a));var _0xd3fd=function(_0x1ea148,_0x22ec0c){_0x1ea148=_0x1ea148-0x0;var _0x12558=_0x3fdd[_0x1ea148];return _0x12558;};'use strict';var _=require('lodash');var moment=require(_0xd3fd('0x0'));var util=require(_0xd3fd('0x1'));var config=require('../../../config/environment');var ami=require(_0xd3fd('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xd3fd('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xd3fd('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xd3fd('0x5'));var RpcVoiceTransferReport=require(_0xd3fd('0x6'));var VoiceQueueReport=require(_0xd3fd('0x7'));var VoiceCallReport=require(_0xd3fd('0x8'));var VoiceAgentReport=require(_0xd3fd('0x9'));var VoiceDialReport=require(_0xd3fd('0xa'));var UserReport=require('./userReport');function Report(_0x2a512a){this[_0xd3fd('0xb')]=_0x2a512a;this['agents']=_0x2a512a[_0xd3fd('0xc')];this[_0xd3fd('0xd')]=_0x2a512a[_0xd3fd('0xd')];}Report[_0xd3fd('0xe')][_0xd3fd('0xf')]=function(_0x58b37d){var _0x5082a4=new VoiceQueueReport(this[_0xd3fd('0xb')]);var _0x3705df=new VoiceAgentReport(this[_0xd3fd('0xb')]);var _0x12fba=new VoiceDialReport(this[_0xd3fd('0xb')]);var _0x56da65=new VoiceCallReport(this[_0xd3fd('0xb')]);var _0x35c75b=new UserReport(this[_0xd3fd('0xb')]);if(config[_0xd3fd('0x10')]&&config[_0xd3fd('0x10')]['disabled']){ami['on'](_0xd3fd('0x11'),this[_0xd3fd('0x12')][_0xd3fd('0x13')](this));ami['on'](_0xd3fd('0x14'),this[_0xd3fd('0x15')][_0xd3fd('0x13')](this));ami['on'](_0xd3fd('0x16'),this[_0xd3fd('0x17')][_0xd3fd('0x13')](this));ami['on'](_0xd3fd('0x18'),this[_0xd3fd('0x19')][_0xd3fd('0x13')](this));ami['on'](_0xd3fd('0x1a'),this[_0xd3fd('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0xd3fd('0x1c')][_0xd3fd('0x13')](this));}};Report[_0xd3fd('0xe')][_0xd3fd('0x1d')]=function(_0x5cdea4){var _0x276d8f;_0x276d8f=_[_0xd3fd('0x1e')](this[_0xd3fd('0xc')],function(_0x3a62ca){return _0x3a62ca[_0xd3fd('0x1f')]==_0x5cdea4||_0x3a62ca[_0xd3fd('0x20')]==_0x5cdea4;});if(_[_0xd3fd('0x21')](_0x276d8f)){var _0x22de61=_[_0xd3fd('0x1e')](this[_0xd3fd('0xd')],function(_0x245622){return _0x245622[_0xd3fd('0x1f')]==_0x5cdea4||_0x245622['name']==_0x5cdea4;});if(_0x22de61){_0x276d8f=_[_0xd3fd('0x1e')](this[_0xd3fd('0xc')],function(_0xf65115){return _0xf65115[_0xd3fd('0x22')]==util[_0xd3fd('0x23')](_0xd3fd('0x24'),_0x22de61[_0xd3fd('0x20')]);});}}return _0x276d8f;};Report['prototype']['voiceQueueReport']=function(_0x17285a){for(var _0x8f6d33=0x0;_0x8f6d33<_0x17285a['length'];_0x8f6d33+=0x1){var _0x17bd1b=this[_0xd3fd('0x1d')](_0x17285a[_0x8f6d33][_0xd3fd('0x25')]);if(_0x17bd1b){_0x17285a[_0x8f6d33][_0xd3fd('0x1f')]=_0x17bd1b['accountcode'];_0x17285a[_0x8f6d33][_0xd3fd('0x26')]=!![];_0x17285a[_0x8f6d33][_0xd3fd('0x27')]=_0x17bd1b[_0xd3fd('0x20')];_0x17285a[_0x8f6d33]['interface']=_[_0xd3fd('0x21')](_0x17bd1b[_0xd3fd('0x22')])?util[_0xd3fd('0x23')](_0xd3fd('0x24'),_0x17bd1b[_0xd3fd('0x20')]):_0x17bd1b[_0xd3fd('0x22')];if(_0x17285a[_0x8f6d33]['queuecallercomplete']){_0x17285a[_0x8f6d33][_0xd3fd('0x28')]=moment()[_0xd3fd('0x23')](_0xd3fd('0x29'));}if(_0x17285a[_0x8f6d33][_0xd3fd('0x2a')]){_0x17285a[_0x8f6d33][_0xd3fd('0x2b')]=moment()[_0xd3fd('0x23')](_0xd3fd('0x29'));}RpcMemberReport[_0xd3fd('0x12')](_0x17285a[_0x8f6d33]);}RpcVoiceQueueReport[_0xd3fd('0x2c')](_0x17285a[_0x8f6d33]);}};function extractCalleridNumber(_0x13be27){var _0x8e4430=_0x13be27[_0xd3fd('0x2d')](/<(.*?)>/);return _0x8e4430?_0x8e4430[0x1]:_0x13be27;}Report[_0xd3fd('0xe')][_0xd3fd('0x2e')]=function(_0x2be427){for(var _0x1f5acc=0x0;_0x1f5acc','calleridname','transfers','linkedid','type','getCallType','UserId','monitor','monitors','monitorFilename','createdAt','connectedlinenum','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport'];(function(_0x3bd053,_0x102a3d){var _0x40e1e3=function(_0x34a2cc){while(--_0x34a2cc){_0x3bd053['push'](_0x3bd053['shift']());}};_0x40e1e3(++_0x102a3d);}(_0x888f,0xa6));var _0xf888=function(_0x1f3b9e,_0x564869){_0x1f3b9e=_0x1f3b9e-0x0;var _0x245276=_0x888f[_0x1f3b9e];return _0x245276;};'use strict';var _=require(_0xf888('0x0'));var moment=require(_0xf888('0x1'));var util=require(_0xf888('0x2'));var config=require(_0xf888('0x3'));var ami=require(_0xf888('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xf888('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xf888('0x6'));var RpcVoiceRecording=require(_0xf888('0x7'));var RpcVoiceTransferReport=require(_0xf888('0x8'));var VoiceQueueReport=require(_0xf888('0x9'));var VoiceCallReport=require(_0xf888('0xa'));var VoiceAgentReport=require(_0xf888('0xb'));var VoiceDialReport=require(_0xf888('0xc'));var UserReport=require('./userReport');function Report(_0x4aa48b){this[_0xf888('0xd')]=_0x4aa48b;this[_0xf888('0xe')]=_0x4aa48b['agents'];this[_0xf888('0xf')]=_0x4aa48b[_0xf888('0xf')];}Report[_0xf888('0x10')][_0xf888('0x11')]=function(_0x4ca1f5){var _0x2095b0=new VoiceQueueReport(this[_0xf888('0xd')]);var _0x387651=new VoiceAgentReport(this[_0xf888('0xd')]);var _0x33ae09=new VoiceDialReport(this[_0xf888('0xd')]);var _0x5ccb96=new VoiceCallReport(this[_0xf888('0xd')]);var _0xe077c3=new UserReport(this[_0xf888('0xd')]);if(config[_0xf888('0x12')]&&config['xdr']['disabled']){ami['on'](_0xf888('0x13'),this['voiceQueueReport']['bind'](this));ami['on'](_0xf888('0x14'),this['voiceCallReport']['bind'](this));ami['on'](_0xf888('0x15'),this[_0xf888('0x16')][_0xf888('0x17')](this));ami['on']('custom:voiceDialReport',this[_0xf888('0x18')][_0xf888('0x17')](this));ami['on'](_0xf888('0x19'),this[_0xf888('0x1a')]['bind'](this));ami['on'](_0xf888('0x1b'),this[_0xf888('0x1c')][_0xf888('0x17')](this));}};Report[_0xf888('0x10')][_0xf888('0x1d')]=function(_0x373d8b){var _0xdff63b;_0xdff63b=_[_0xf888('0x1e')](this[_0xf888('0xe')],function(_0x316b68){return _0x316b68[_0xf888('0x1f')]==_0x373d8b||_0x316b68[_0xf888('0x20')]==_0x373d8b;});if(_[_0xf888('0x21')](_0xdff63b)){var _0x201dca=_[_0xf888('0x1e')](this[_0xf888('0xf')],function(_0x2e992b){return _0x2e992b[_0xf888('0x1f')]==_0x373d8b||_0x2e992b[_0xf888('0x20')]==_0x373d8b;});if(_0x201dca){_0xdff63b=_[_0xf888('0x1e')](this['agents'],function(_0x203b39){return _0x203b39[_0xf888('0x22')]==util[_0xf888('0x23')](_0xf888('0x24'),_0x201dca['name']);});}}return _0xdff63b;};Report['prototype']['voiceQueueReport']=function(_0x1c72fe){for(var _0x51efd3=0x0;_0x51efd3<_0x1c72fe[_0xf888('0x25')];_0x51efd3+=0x1){var _0x17ea8c=this[_0xf888('0x1d')](_0x1c72fe[_0x51efd3]['connectedlinenum']);if(_0x17ea8c){_0x1c72fe[_0x51efd3][_0xf888('0x1f')]=_0x17ea8c['accountcode'];_0x1c72fe[_0x51efd3]['assigned']=!![];_0x1c72fe[_0x51efd3][_0xf888('0x26')]=_0x17ea8c[_0xf888('0x20')];_0x1c72fe[_0x51efd3][_0xf888('0x22')]=_[_0xf888('0x21')](_0x17ea8c[_0xf888('0x22')])?util['format'](_0xf888('0x24'),_0x17ea8c[_0xf888('0x20')]):_0x17ea8c['interface'];if(_0x1c72fe[_0x51efd3][_0xf888('0x27')]){_0x1c72fe[_0x51efd3]['queuecallercompleteAt']=moment()[_0xf888('0x23')](_0xf888('0x28'));}if(_0x1c72fe[_0x51efd3][_0xf888('0x29')]){_0x1c72fe[_0x51efd3][_0xf888('0x2a')]=moment()[_0xf888('0x23')](_0xf888('0x28'));}RpcMemberReport[_0xf888('0x2b')](_0x1c72fe[_0x51efd3]);}RpcVoiceQueueReport[_0xf888('0x2c')](_0x1c72fe[_0x51efd3]);}};function extractCalleridNumber(_0xb695ba){var _0x32541c=_0xb695ba[_0xf888('0x2d')](/<(.*?)>/);return _0x32541c?_0x32541c[0x1]:_0xb695ba;}Report[_0xf888('0x10')][_0xf888('0x2e')]=function(_0x504c80){for(var _0x24c7e3=0x0;_0x24c7e3{delete this['channels'][_0x49f8e3];},_0x54bf7c);}};module[_0x0976('0x9c')]=VoiceAgentReport; \ No newline at end of file +var _0x4c09=['origtransfereruniqueid','complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','channels','voiceChannels','voiceQueues','agents','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','isUndefined','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','type','inbound','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','calleridnum','variables','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','hasOwnProperty','agentconnectAt','connectedlinename','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','pick','name','accountcode','exten','custom:agentconnect','user:agentconnect','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','error','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','assign','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acw','acwtime','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','deleteChannelAfterTimeout','transfereeuniqueid'];(function(_0x1e625b,_0x5902b1){var _0x55af99=function(_0x3d9c65){while(--_0x3d9c65){_0x1e625b['push'](_0x1e625b['shift']());}};_0x55af99(++_0x5902b1);}(_0x4c09,0x149));var _0x94c0=function(_0xf9cdbe,_0x1a692c){_0xf9cdbe=_0xf9cdbe-0x0;var _0x47b102=_0x4c09[_0xf9cdbe];return _0x47b102;};'use strict';var _=require(_0x94c0('0x0'));var moment=require('moment');var util=require(_0x94c0('0x1'));var Redis=require(_0x94c0('0x2'));var config=require(_0x94c0('0x3'));var logger=require(_0x94c0('0x4'))(_0x94c0('0x5'));var ami=require('../ami');config[_0x94c0('0x6')]=_[_0x94c0('0x7')](config[_0x94c0('0x6')],{'host':_0x94c0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x94c0('0x6')]));function VoiceAgentReport(_0x14584c){this[_0x94c0('0x9')]={};this[_0x94c0('0xa')]=_0x14584c['channels'];this[_0x94c0('0xb')]=_0x14584c[_0x94c0('0xb')];this[_0x94c0('0xc')]=_0x14584c[_0x94c0('0xc')];this['variables']={};ami['on']('agentcalled',this[_0x94c0('0xd')][_0x94c0('0xe')](this));ami['on']('agentconnect',this[_0x94c0('0xf')][_0x94c0('0xe')](this));ami['on'](_0x94c0('0x10'),this[_0x94c0('0x11')][_0x94c0('0xe')](this));ami['on']('queuecallerabandon',this[_0x94c0('0x12')][_0x94c0('0xe')](this));ami['on'](_0x94c0('0x13'),this[_0x94c0('0x14')][_0x94c0('0xe')](this));ami['on'](_0x94c0('0x15'),this[_0x94c0('0x16')]['bind'](this));ami['on'](_0x94c0('0x17'),this[_0x94c0('0x18')]['bind'](this));ami['on'](_0x94c0('0x19'),this[_0x94c0('0x1a')]['bind'](this));ami['on'](_0x94c0('0x1b'),this[_0x94c0('0x1c')]['bind'](this));ami['on'](_0x94c0('0x1d'),this['syncAttendedTransfer'][_0x94c0('0xe')](this));ami['on'](_0x94c0('0x1e'),this[_0x94c0('0x1f')][_0x94c0('0xe')](this));}VoiceAgentReport[_0x94c0('0x20')]['emit']=function(_0x1597b1,_0x4e2582,_0x3aa480){io['to'](_0x1597b1)[_0x94c0('0x21')](_0x4e2582,_0x3aa480);};VoiceAgentReport['prototype'][_0x94c0('0x22')]=function(_0x566387){return _0x566387!==null&&!_['isUndefined'](_0x566387);};VoiceAgentReport['prototype'][_0x94c0('0xd')]=function(_0x165e99){try{if(this[_0x94c0('0x22')](_0x165e99)){logger['info'](_0x94c0('0x23'),_0x165e99['uniqueid'],_0x165e99[_0x94c0('0x24')],_0x165e99[_0x94c0('0x25')]);logger[_0x94c0('0x26')](_0x94c0('0x27'),_0x165e99[_0x94c0('0x28')],util['inspect'](_0x165e99,{'showHidden':![],'depth':null}));if(_[_0x94c0('0x29')](this[_0x94c0('0x9')][_0x165e99[_0x94c0('0x28')]])){this[_0x94c0('0x9')][_0x165e99[_0x94c0('0x28')]]={};}var _0x3828b5=this[_0x94c0('0xc')][_0x165e99[_0x94c0('0x2a')]];var _0x1c6332=this['channels'][_0x165e99[_0x94c0('0x28')]][_0x165e99[_0x94c0('0x25')]];var _0x1f8397=this[_0x94c0('0xb')][_0x165e99[_0x94c0('0x2b')]];var _0x33322d=this['variables'][_0x165e99[_0x94c0('0x28')]];if(_[_0x94c0('0x29')](_0x1c6332)){_0x1c6332={'agentcalledAt':moment()[_0x94c0('0x2c')](_0x94c0('0x2d')),'lastevent':_0x94c0('0x2e'),'mandatoryDisposition':_0x1f8397&&_0x1f8397['mandatoryDisposition']?_0x1f8397['mandatoryDisposition']:![],'type':_0x1f8397&&_0x1f8397[_0x94c0('0x2f')]?_0x1f8397[_0x94c0('0x2f')]:_0x94c0('0x30'),'variables':_0x33322d,'motionChannel':'voice'};}Object['assign'](_0x1c6332,_[_0x94c0('0x31')](_0x165e99,['event',_0x94c0('0x32')]));this[_0x94c0('0x9')][_0x165e99['uniqueid']][_0x165e99[_0x94c0('0x25')]]=_0x1c6332;logger[_0x94c0('0x26')](_0x94c0('0x33'),_0x165e99[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x1c6332,{'showHidden':![],'depth':null}));ami[_0x94c0('0x21')]('custom:agentcalled',_0x1c6332);var _0x575ed7={'id':_0x3828b5['id'],'calleridnum':_0x1c6332[_0x94c0('0x35')],'queue':_0x1c6332[_0x94c0('0x2b')],'variables':_0x1c6332[_0x94c0('0x36')],'uniqueid':_0x165e99[_0x94c0('0x28')]};logger['debug'](_0x94c0('0x37'),_0x165e99[_0x94c0('0x28')],util['inspect'](_0x575ed7,{'showHidden':![],'depth':null}));this[_0x94c0('0x21')](util[_0x94c0('0x2c')](_0x94c0('0x38'),_0x165e99[_0x94c0('0x24')]),_0x94c0('0x39'),_0x575ed7);}}catch(_0x2ecf3d){logger['error']('[%s][voiceAgentReport][agentcalled]',_0x165e99[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x2ecf3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')][_0x94c0('0xf')]=function(_0x2cdb58){try{if(this[_0x94c0('0x22')](_0x2cdb58)){if(this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]]){for(var _0x310313 in this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]]){if(this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x94c0('0x3a')](_0x310313)){if(_0x2cdb58[_0x94c0('0x25')]===_0x310313){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2cdb58[_0x94c0('0x28')],_0x2cdb58['membername'],_0x2cdb58[_0x94c0('0x25')]);this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x3b')]=moment()[_0x94c0('0x2c')](_0x94c0('0x2d'));this['channels'][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x3c')]=_0x2cdb58[_0x94c0('0x3c')];this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313]['connectedlinenum']=_0x2cdb58['connectedlinenum'];this['channels'][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x3d')]=_0x2cdb58['destchannelstate'];this['channels'][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x3e')]=_0x2cdb58[_0x94c0('0x3e')];this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313]['holdtime']=_0x2cdb58[_0x94c0('0x3f')];this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x40')]=_0x94c0('0x41');_['merge'](this[_0x94c0('0xc')][_0x2cdb58[_0x94c0('0x2a')]],_[_0x94c0('0x42')](_0x2cdb58,[_0x94c0('0x2b'),'destconnectedlinenum']));var _0x1d78f2=this[_0x94c0('0xc')][_0x2cdb58[_0x94c0('0x2a')]];var _0x4fe5c9={'id':_0x1d78f2['id'],'name':_0x1d78f2[_0x94c0('0x43')],'agentconnected':!![],'destaccountcode':_0x1d78f2[_0x94c0('0x44')],'destconnectedlinenum':this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x2cdb58[_0x94c0('0x25')]][_0x94c0('0x45')],'queue':this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x2cdb58['destuniqueid']][_0x94c0('0x2b')],'uniqueid':this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x2cdb58['destuniqueid']]['uniqueid']};ami[_0x94c0('0x21')](_0x94c0('0x46'),this[_0x94c0('0x9')][_0x2cdb58['uniqueid']][_0x2cdb58[_0x94c0('0x25')]]);this[_0x94c0('0x21')](util['format'](_0x94c0('0x38'),_0x2cdb58[_0x94c0('0x24')]),_0x94c0('0x47'),_0x4fe5c9);}else if(!this['channels'][_0x2cdb58[_0x94c0('0x28')]][_0x310313]['agentringnoanswer']&&!this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x13')]){logger[_0x94c0('0x48')](_0x94c0('0x49'),_0x2cdb58[_0x94c0('0x28')],this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313]['membername'],_0x310313);this[_0x94c0('0x9')][_0x2cdb58['uniqueid']][_0x310313][_0x94c0('0x10')]=!![];this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x4a')]=moment()[_0x94c0('0x2c')](_0x94c0('0x2d'));this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x4b')]=_0x2cdb58['destuniqueid'];this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x4c')]=_0x2cdb58['membername'];this['channels'][_0x2cdb58[_0x94c0('0x28')]][_0x310313][_0x94c0('0x40')]=_0x94c0('0x4d');this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313]['reason']=_0x94c0('0x4d');logger[_0x94c0('0x26')](_0x94c0('0x4e'),_0x2cdb58[_0x94c0('0x28')],util[_0x94c0('0x34')](this['channels'][_0x2cdb58[_0x94c0('0x28')]][_0x310313],{'showHidden':![],'depth':null}));ami[_0x94c0('0x21')]('custom:agentansweredelsewhere',this[_0x94c0('0x9')][_0x2cdb58[_0x94c0('0x28')]][_0x310313]);}else{logger[_0x94c0('0x26')](_0x94c0('0x4f'),_0x2cdb58[_0x94c0('0x28')]);}}}}}}catch(_0x1603b7){logger[_0x94c0('0x50')]('[%s][voiceAgentReport][agentconnect]',_0x2cdb58[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x1603b7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x94c0('0x11')]=function(_0x576b1d){try{if(this[_0x94c0('0x22')](_0x576b1d)){logger[_0x94c0('0x26')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x576b1d[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x576b1d,{'showHidden':![],'depth':null}));if(this[_0x94c0('0x9')][_0x576b1d['uniqueid']]&&this[_0x94c0('0x9')][_0x576b1d['uniqueid']][_0x576b1d['destuniqueid']]){logger[_0x94c0('0x48')](_0x94c0('0x51'),_0x576b1d[_0x94c0('0x28')],_0x576b1d[_0x94c0('0x24')],_0x576b1d[_0x94c0('0x25')]);var _0x56915c=this['agents'][_0x576b1d['interface']];var _0x47f2ee=this[_0x94c0('0x9')][_0x576b1d[_0x94c0('0x28')]][_0x576b1d[_0x94c0('0x25')]];_0x47f2ee['agentringnoanswer']=!![];_0x47f2ee[_0x94c0('0x4a')]=moment()[_0x94c0('0x2c')](_0x94c0('0x2d'));_0x47f2ee[_0x94c0('0x40')]=_0x94c0('0x52');_0x47f2ee['reason']=_0x94c0('0x52');var _0x4a212c={'id':_0x56915c['id'],'name':_0x56915c[_0x94c0('0x43')],'queue':_0x47f2ee[_0x94c0('0x2b')],'uniqueid':_0x47f2ee[_0x94c0('0x28')]};logger[_0x94c0('0x26')](_0x94c0('0x53'),_0x576b1d[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x4a212c,{'showHidden':![],'depth':null}));this[_0x94c0('0x21')](util[_0x94c0('0x2c')](_0x94c0('0x38'),_0x56915c[_0x94c0('0x43')]),_0x94c0('0x54'),_0x4a212c);ami[_0x94c0('0x21')](_0x94c0('0x55'),_0x47f2ee);this[_0x94c0('0x9')][_0x576b1d[_0x94c0('0x28')]][_0x576b1d[_0x94c0('0x25')]]=Object[_0x94c0('0x56')]({},_0x47f2ee);}}}catch(_0x4150a1){logger[_0x94c0('0x50')]('[%s][voiceAgentReport][agentringnoanswer]',_0x576b1d['uniqueid'],util[_0x94c0('0x34')](_0x4150a1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')][_0x94c0('0x12')]=function(_0x221955){try{if(this[_0x94c0('0x22')](_0x221955)){logger[_0x94c0('0x26')](_0x94c0('0x57'),_0x221955[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x221955,{'showHidden':![],'depth':null}));if(this['channels'][_0x221955[_0x94c0('0x28')]]){for(var _0x14a4f8 in this[_0x94c0('0x9')][_0x221955[_0x94c0('0x28')]]){if(this[_0x94c0('0x9')][_0x221955[_0x94c0('0x28')]][_0x94c0('0x3a')](_0x14a4f8)&&!this[_0x94c0('0x9')][_0x221955[_0x94c0('0x28')]][_0x14a4f8][_0x94c0('0x10')]&&!this[_0x94c0('0x9')][_0x221955[_0x94c0('0x28')]][_0x14a4f8][_0x94c0('0x13')]){logger['info'](_0x94c0('0x58'),_0x221955[_0x94c0('0x28')],this['channels'][_0x221955[_0x94c0('0x28')]][_0x14a4f8][_0x94c0('0x24')],_0x14a4f8);this[_0x94c0('0x9')][_0x221955[_0x94c0('0x28')]][_0x14a4f8][_0x94c0('0x10')]=!![];this['channels'][_0x221955[_0x94c0('0x28')]][_0x14a4f8]['agentringnoanswerAt']=moment()[_0x94c0('0x2c')](_0x94c0('0x2d'));this['channels'][_0x221955[_0x94c0('0x28')]][_0x14a4f8][_0x94c0('0x40')]=_0x94c0('0x59');this['channels'][_0x221955[_0x94c0('0x28')]][_0x14a4f8][_0x94c0('0x5a')]=_0x94c0('0x59');logger[_0x94c0('0x26')](_0x94c0('0x5b'),_0x221955[_0x94c0('0x28')],util[_0x94c0('0x34')](this[_0x94c0('0x9')][_0x221955[_0x94c0('0x28')]][_0x14a4f8],{'showHidden':![],'depth':null}));ami[_0x94c0('0x21')](_0x94c0('0x5c'),this[_0x94c0('0x9')][_0x221955[_0x94c0('0x28')]][_0x14a4f8]);}}}}}catch(_0x542db2){logger[_0x94c0('0x50')](_0x94c0('0x5d'),_0x221955[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x542db2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')][_0x94c0('0x14')]=function(_0x494c01){try{if(this[_0x94c0('0x22')](_0x494c01)){logger[_0x94c0('0x26')](_0x94c0('0x5e'),_0x494c01[_0x94c0('0x28')],util['inspect'](_0x494c01,{'showHidden':![],'depth':null}));if(this['channels'][_0x494c01[_0x94c0('0x28')]]){for(var _0x1235bf in this[_0x94c0('0x9')][_0x494c01['uniqueid']]){if(this[_0x94c0('0x9')][_0x494c01[_0x94c0('0x28')]][_0x94c0('0x3a')](_0x1235bf)){if(this[_0x94c0('0x9')][_0x494c01['uniqueid']][_0x1235bf][_0x94c0('0x3b')]&&!this[_0x94c0('0x9')][_0x494c01[_0x94c0('0x28')]][_0x1235bf][_0x94c0('0x13')]){logger[_0x94c0('0x48')](_0x94c0('0x5f'),_0x494c01[_0x94c0('0x28')],this[_0x94c0('0x9')][_0x494c01['uniqueid']][_0x1235bf][_0x94c0('0x24')],_0x1235bf);this[_0x94c0('0x9')][_0x494c01[_0x94c0('0x28')]][_0x1235bf][_0x94c0('0x13')]=!![];this[_0x94c0('0x9')][_0x494c01['uniqueid']][_0x1235bf][_0x94c0('0x60')]=moment()[_0x94c0('0x2c')](_0x94c0('0x2d'));this['channels'][_0x494c01[_0x94c0('0x28')]][_0x1235bf][_0x94c0('0x40')]='complete';this['channels'][_0x494c01['uniqueid']][_0x1235bf][_0x94c0('0x5a')]=_0x494c01[_0x94c0('0x5a')]==_0x94c0('0x61')?_0x94c0('0x62'):_0x494c01['reason'];this[_0x94c0('0x9')][_0x494c01[_0x94c0('0x28')]][_0x1235bf][_0x94c0('0x63')]=_0x494c01[_0x94c0('0x63')];if(this[_0x94c0('0xb')][_0x494c01[_0x94c0('0x2b')]]&&this[_0x94c0('0xb')][_0x494c01[_0x94c0('0x2b')]][_0x94c0('0x64')]){this['channels'][_0x494c01['uniqueid']][_0x1235bf][_0x94c0('0x65')]=this[_0x94c0('0xb')][_0x494c01['queue']]['acwTimeout'];this[_0x94c0('0x9')][_0x494c01[_0x94c0('0x28')]][_0x1235bf]['agentacw']=!![];}this['agents'][_0x494c01[_0x94c0('0x2a')]]=_['omit'](this[_0x94c0('0xc')][_0x494c01[_0x94c0('0x2a')]],['queue',_0x94c0('0x66')]);logger[_0x94c0('0x26')](_0x94c0('0x67'),_0x494c01['uniqueid'],util['inspect'](this[_0x94c0('0x9')][_0x494c01[_0x94c0('0x28')]][_0x1235bf],{'showHidden':![],'depth':null}));ami[_0x94c0('0x21')](_0x94c0('0x68'),this[_0x94c0('0x9')][_0x494c01['uniqueid']][_0x1235bf]);logger[_0x94c0('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x494c01['uniqueid'],util[_0x94c0('0x34')]({'id':this[_0x94c0('0xc')][_0x494c01[_0x94c0('0x2a')]]['id'],'destaccountcode':_0x494c01[_0x94c0('0x69')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x94c0('0x2c')](_0x94c0('0x38'),_0x494c01[_0x94c0('0x24')]),_0x94c0('0x6a'),{'id':this[_0x94c0('0xc')][_0x494c01['interface']]['id'],'destaccountcode':Number(_0x494c01[_0x94c0('0x69')])});}}}}}}catch(_0x400425){logger['error'](_0x94c0('0x6b'),_0x494c01[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x400425,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x94c0('0x16')]=function(_0x38f795){try{if(this['isNotNull'](_0x38f795)){logger[_0x94c0('0x26')](_0x94c0('0x6c'),_0x38f795[_0x94c0('0x28')],util['inspect'](_0x38f795,{'showHidden':![],'depth':null}));this[_0x94c0('0x6d')](_0x38f795[_0x94c0('0x28')],_[_0x94c0('0x6e')](_0x38f795[_0x94c0('0x6f')])[0x0],_0x38f795[_0x94c0('0x70')]);if(this[_0x94c0('0x9')][_0x38f795[_0x94c0('0x28')]]){for(var _0x1b9dce in this[_0x94c0('0x9')][_0x38f795[_0x94c0('0x28')]]){if(this[_0x94c0('0x9')][_0x38f795[_0x94c0('0x28')]][_0x94c0('0x3a')](_0x1b9dce)){logger[_0x94c0('0x48')](_0x94c0('0x71'),_0x38f795[_0x94c0('0x28')],_0x1b9dce,_[_0x94c0('0x6e')](_0x38f795[_0x94c0('0x6f')])[0x0],_0x38f795[_0x94c0('0x70')]);if(_['isUndefined'](this[_0x94c0('0x9')][_0x38f795[_0x94c0('0x28')]][_0x1b9dce][_0x94c0('0x36')])){this[_0x94c0('0x9')][_0x38f795[_0x94c0('0x28')]][_0x1b9dce][_0x94c0('0x36')]={};}this[_0x94c0('0x9')][_0x38f795[_0x94c0('0x28')]][_0x1b9dce][_0x94c0('0x36')]=this[_0x94c0('0x36')][_0x38f795[_0x94c0('0x28')]];}}}}}catch(_0x24d1a2){logger[_0x94c0('0x50')](_0x94c0('0x72'),_0x38f795['uniqueid'],util[_0x94c0('0x34')](_0x24d1a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')][_0x94c0('0x6d')]=function(_0x3cb8c9,_0x2b5885,_0x3b143d){var _0x5132ba=[_0x94c0('0x73'),_0x94c0('0x74'),_0x94c0('0x75'),'rtpaudioqosjitterbridged',_0x94c0('0x76'),_0x94c0('0x77'),_0x94c0('0x78'),_0x94c0('0x79'),'sipcallid','sipuri','bridgepeer',_0x94c0('0x7a'),_0x94c0('0x7b'),_0x94c0('0x7c'),'memberinterface',_0x94c0('0x7d'),_0x94c0('0x24'),_0x94c0('0x7e'),_0x94c0('0x7f')];if(!_[_0x94c0('0x80')](_0x2b5885)&&!_[_0x94c0('0x81')](_0x5132ba,_0x2b5885)){if(_[_0x94c0('0x29')](this['variables'][_0x3cb8c9])){this[_0x94c0('0x36')][_0x3cb8c9]={};}this['variables'][_0x3cb8c9][_0x2b5885]=_0x3b143d;}};VoiceAgentReport[_0x94c0('0x20')][_0x94c0('0x18')]=function(_0x4b4987){try{if(this[_0x94c0('0x22')](_0x4b4987)){logger[_0x94c0('0x26')](_0x94c0('0x82'),_0x4b4987[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x4b4987,{'showHidden':![],'depth':null}));if(this['channels'][_0x4b4987[_0x94c0('0x28')]]){for(var _0x2560a2 in this[_0x94c0('0x9')][_0x4b4987['uniqueid']]){if(this['channels'][_0x4b4987[_0x94c0('0x28')]][_0x94c0('0x3a')](_0x2560a2)){if(this['channels'][_0x4b4987['uniqueid']][_0x2560a2]['reason']==_0x94c0('0x61')&&this[_0x94c0('0x9')][_0x4b4987['uniqueid']][_0x2560a2][_0x94c0('0x13')]){logger[_0x94c0('0x48')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4b4987[_0x94c0('0x28')],_0x2560a2);this[_0x94c0('0x9')][_0x4b4987[_0x94c0('0x28')]][_0x2560a2][_0x94c0('0x60')]=moment()[_0x94c0('0x2c')](_0x94c0('0x2d'));}}}logger[_0x94c0('0x26')](_0x94c0('0x83'),_0x4b4987[_0x94c0('0x28')],util[_0x94c0('0x34')](_[_0x94c0('0x84')](this['channels'][_0x4b4987[_0x94c0('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x94c0('0x21')](_0x94c0('0x85'),_['values'](this[_0x94c0('0x9')][_0x4b4987[_0x94c0('0x28')]]));this[_0x94c0('0x86')](_0x4b4987[_0x94c0('0x28')]);}if(this['variables'][_0x4b4987['uniqueid']]){delete this[_0x94c0('0x36')][_0x4b4987[_0x94c0('0x28')]];}}}catch(_0x16ada7){logger[_0x94c0('0x50')]('[%s][voiceAgentReport][hangup]',_0x4b4987['uniqueid'],util['inspect'](_0x16ada7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')]['syncAttendedTransfer']=function(_0x2169b2){try{if(this[_0x94c0('0x22')](_0x2169b2)){logger[_0x94c0('0x26')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x2169b2['uniqueid'],util[_0x94c0('0x34')](_0x2169b2,{'showHidden':![],'depth':null}));if(this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]]){for(var _0x5a52b0 in this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]]){if(this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]][_0x94c0('0x3a')](_0x5a52b0)){if(_0x2169b2[_0x94c0('0x88')]===_0x5a52b0){logger[_0x94c0('0x48')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2169b2[_0x94c0('0x28')],this[_0x94c0('0x9')][_0x2169b2['transfereeuniqueid']][_0x5a52b0][_0x94c0('0x24')],_0x5a52b0);var _0x541ffa=moment();this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]][_0x5a52b0][_0x94c0('0x13')]=!![];this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]][_0x5a52b0][_0x94c0('0x60')]=moment()[_0x94c0('0x2c')](_0x94c0('0x2d'));this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]][_0x5a52b0][_0x94c0('0x40')]=_0x94c0('0x89');this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]][_0x5a52b0][_0x94c0('0x5a')]='transfer';this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]][_0x5a52b0][_0x94c0('0x63')]=_0x541ffa[_0x94c0('0x8a')](this[_0x94c0('0x9')][_0x2169b2['transfereeuniqueid']][_0x5a52b0][_0x94c0('0x3b')],'seconds');}}}}if(this[_0x94c0('0x9')][_0x2169b2['secondtransfereruniqueid']]){var _0x2135d6=this['channels'][_0x2169b2[_0x94c0('0x8b')]];this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x8b')]]=this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]];this[_0x94c0('0x9')][_0x2169b2[_0x94c0('0x87')]]=_0x2135d6;}}}catch(_0x114e54){logger[_0x94c0('0x50')]('[%s][voiceAgentReport][attendedtransfer]',_0x2169b2[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x114e54,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')]['syncBlindTransfer']=function(_0xb42a18){try{if(this['isNotNull'](_0xb42a18)){logger[_0x94c0('0x26')](_0x94c0('0x8c'),_0xb42a18['uniqueid'],util[_0x94c0('0x34')](_0xb42a18,{'showHidden':![],'depth':null}));if(this[_0x94c0('0x9')][_0xb42a18[_0x94c0('0x87')]]){for(var _0x4cf127 in this[_0x94c0('0x9')][_0xb42a18[_0x94c0('0x87')]]){if(this[_0x94c0('0x9')][_0xb42a18[_0x94c0('0x87')]][_0x94c0('0x3a')](_0x4cf127)){if(_0xb42a18[_0x94c0('0x8d')]===_0x4cf127){logger['info'](_0x94c0('0x8e'),_0xb42a18['uniqueid'],this[_0x94c0('0x9')][_0xb42a18[_0x94c0('0x87')]][_0x4cf127][_0x94c0('0x24')],_0x4cf127);var _0x1ad91a=moment();this[_0x94c0('0x9')][_0xb42a18['transfereeuniqueid']][_0x4cf127][_0x94c0('0x13')]=!![];this['channels'][_0xb42a18[_0x94c0('0x87')]][_0x4cf127][_0x94c0('0x60')]=_0x1ad91a;this['channels'][_0xb42a18[_0x94c0('0x87')]][_0x4cf127][_0x94c0('0x40')]=_0x94c0('0x89');this[_0x94c0('0x9')][_0xb42a18[_0x94c0('0x87')]][_0x4cf127][_0x94c0('0x5a')]=_0x94c0('0x61');this[_0x94c0('0x9')][_0xb42a18[_0x94c0('0x87')]][_0x4cf127][_0x94c0('0x63')]=_0x1ad91a[_0x94c0('0x8a')](this[_0x94c0('0x9')][_0xb42a18['transfereeuniqueid']][_0x4cf127][_0x94c0('0x3b')],_0x94c0('0x8f'));}}}}}}catch(_0x33d2f1){logger['error'](_0x94c0('0x90'),_0xb42a18[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x33d2f1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')][_0x94c0('0x1a')]=function(_0x4c23cf){var _0x11d280='';try{if(this[_0x94c0('0x22')](_0x4c23cf)){logger[_0x94c0('0x26')](_0x94c0('0x91'),_0x4c23cf[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x4c23cf,{'showHidden':![],'depth':null}));if(_0x4c23cf[_0x94c0('0x92')]){_0x11d280=_0x4c23cf[_0x94c0('0x92')]['substring'](0x0,_0x4c23cf[_0x94c0('0x92')][_0x94c0('0x93')]('-'));if(this['agents'][_0x11d280]){logger[_0x94c0('0x48')](_0x94c0('0x94'),_0x4c23cf[_0x94c0('0x28')],_0x11d280);this[_0x94c0('0xc')][_0x11d280]['onhold']=!![];}}}}catch(_0x391e64){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x4c23cf['uniqueid'],util[_0x94c0('0x34')](_0x391e64,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')]['syncMusicOnHoldStop']=function(_0x166d45){var _0x3a5076='';try{if(this[_0x94c0('0x22')](_0x166d45)){logger['debug'](_0x94c0('0x95'),_0x166d45[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x166d45,{'showHidden':![],'depth':null}));if(_0x166d45[_0x94c0('0x92')]){_0x3a5076=_0x166d45[_0x94c0('0x92')][_0x94c0('0x96')](0x0,_0x166d45[_0x94c0('0x92')][_0x94c0('0x93')]('-'));if(this[_0x94c0('0xc')][_0x3a5076]){logger[_0x94c0('0x48')](_0x94c0('0x97'),_0x166d45[_0x94c0('0x28')],_0x3a5076);this[_0x94c0('0xc')][_0x3a5076][_0x94c0('0x98')]=![];}}}}catch(_0x4ef3ca){logger[_0x94c0('0x50')](_0x94c0('0x99'),_0x166d45[_0x94c0('0x28')],util[_0x94c0('0x34')](_0x4ef3ca,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x94c0('0x20')]['deleteChannelAfterTimeout']=function(_0x186871,_0x4365f9=0x2710){if(this[_0x94c0('0x9')][_0x186871]){setTimeout(()=>{delete this[_0x94c0('0x9')][_0x186871];},_0x4365f9);}};module[_0x94c0('0x9a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 84bdd27..208ae32 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 _0x4303=['syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','syncVarSet','syncHangup','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','channels','merge','pick','keys','context','from-sip','channel','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','split','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','appdata','applicationdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','disposition','includes','lastapplication','set','startsWith','cdr(','type','isNil','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','diff','seconds','connectedlinename','destinationchannel','UserId','membername','queue','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','monitorFilename','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','deleteChannelAfterTimeout','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','user:agentcomplete','length','transferType','then','transferToInternal','isEmpty','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x4303,0x18e));var _0x3430=function(_0x54e628,_0xd5c97d){_0x54e628=_0x54e628-0x0;var _0x23f6f5=_0x4303[_0x54e628];return _0x23f6f5;};'use strict';var _=require(_0x3430('0x0'));var moment=require(_0x3430('0x1'));var util=require(_0x3430('0x2'));var path=require('path');var Redis=require('ioredis');var config=require(_0x3430('0x3'));var logger=require(_0x3430('0x4'))(_0x3430('0x5'));var ami=require('../ami');var Channel=require(_0x3430('0x6'));var RpcSetting=require(_0x3430('0x7'));var applications=['set','queue',_0x3430('0x8'),'dial',_0x3430('0x9'),_0x3430('0xa')];var dispositions=['NO\x20ANSWER',_0x3430('0xb'),'FAILED',_0x3430('0xc'),_0x3430('0xc'),_0x3430('0xc'),_0x3430('0xd'),_0x3430('0xe'),'FAILED',_0x3430('0xb'),_0x3430('0xb')];config[_0x3430('0xf')]=_[_0x3430('0x10')](config[_0x3430('0xf')],{'host':_0x3430('0x11'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x583dbe){this['channels']=_0x583dbe['channels'];this[_0x3430('0x12')]=_0x583dbe[_0x3430('0x12')];this[_0x3430('0x13')]={};ami['on'](_0x3430('0x14'),this[_0x3430('0x15')][_0x3430('0x16')](this));ami['on']('newexten',this[_0x3430('0x15')]['bind'](this));ami['on'](_0x3430('0x17'),this[_0x3430('0x18')][_0x3430('0x16')](this));ami['on']('newstate',this['syncNewState'][_0x3430('0x16')](this));ami['on']('varset',this[_0x3430('0x19')]['bind'](this));ami['on']('hangup',this[_0x3430('0x1a')]['bind'](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x3430('0x16')](this));ami['on'](_0x3430('0x1b'),this['syncAttendedTransfer'][_0x3430('0x16')](this));ami['on'](_0x3430('0x1c'),this[_0x3430('0x1d')]['bind'](this));ami['on'](_0x3430('0x1e'),this[_0x3430('0x1f')][_0x3430('0x16')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x3430('0x16')](this));try{logger[_0x3430('0x20')](_0x3430('0x21'));ami[_0x3430('0x22')]();}catch(_0x1e785e){logger[_0x3430('0x23')](_0x3430('0x24'),util[_0x3430('0x25')](_0x1e785e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x3430('0x26')][_0x3430('0x27')]=function(_0x3c0d0e){return _0x3c0d0e!==null&&!_[_0x3430('0x28')](_0x3c0d0e);};VoiceCallReport[_0x3430('0x26')][_0x3430('0x29')]=function(_0x440ce7,_0x4bbee0,_0x16a5de){io['to'](_0x440ce7)['emit'](_0x4bbee0,_0x16a5de);};VoiceCallReport[_0x3430('0x26')][_0x3430('0x2a')]=function(_0x35a8f7){try{if(this[_0x3430('0x27')](_0x35a8f7)){logger[_0x3430('0x20')](_0x3430('0x2b'),_0x35a8f7['uniqueid'],_0x35a8f7[_0x3430('0x2c')],_0x35a8f7[_0x3430('0x2d')]);logger[_0x3430('0x2e')](_0x3430('0x2f'),_0x35a8f7['uniqueid'],util['inspect'](_0x35a8f7,{'showHidden':![],'depth':null}));if(_0x35a8f7[_0x3430('0x30')]===_0x35a8f7[_0x3430('0x31')]){if(!_[_0x3430('0x28')](this[_0x3430('0x32')][_0x35a8f7[_0x3430('0x30')]])){_[_0x3430('0x33')](this['channels'][_0x35a8f7[_0x3430('0x30')]],_[_0x3430('0x34')](_0x35a8f7,_[_0x3430('0x35')](this[_0x3430('0x32')][_0x35a8f7['uniqueid']])));}}if(_0x35a8f7[_0x3430('0x36')]===_0x3430('0x37')){var _0x3610a7=this[_0x3430('0x12')][_0x35a8f7[_0x3430('0x38')]['split']('-')[0x0]];if(_0x3610a7){if(_0x35a8f7[_0x3430('0x39')]==_0x3430('0x3a')){_0x3610a7[_0x3430('0x3b')]=_0x35a8f7['connectedlinenum'];this[_0x3430('0x29')](util[_0x3430('0x3c')](_0x3430('0x3d'),_0x3610a7[_0x3430('0x3e')]),_0x3430('0x3f'),{'id':_0x3610a7['id'],'destaccountcode':_0x3610a7['accountcode'],'destconnectedlinenum':_0x35a8f7[_0x3430('0x40')]});}}}}}catch(_0x3f73ac){logger[_0x3430('0x23')](_0x3430('0x41'),_0x35a8f7[_0x3430('0x30')],util[_0x3430('0x25')](_0x3f73ac,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3430('0x26')][_0x3430('0x18')]=function(_0x2d93a9){try{if(this[_0x3430('0x27')](_0x2d93a9)){logger[_0x3430('0x2e')](_0x3430('0x42'),_0x2d93a9[_0x3430('0x30')],util['inspect'](_0x2d93a9,{'showHidden':![],'depth':null}));if(this[_0x3430('0x32')][_0x2d93a9[_0x3430('0x30')]]){return;}if(_0x2d93a9[_0x3430('0x38')]===_0x3430('0x43')){return;}if(_0x2d93a9[_0x3430('0x30')]!==_0x2d93a9[_0x3430('0x31')]&&!this[_0x3430('0x13')][_0x2d93a9['linkedid']]){return;}logger['info'](_0x3430('0x44'),_0x2d93a9[_0x3430('0x30')],_0x2d93a9[_0x3430('0x36')],_0x2d93a9[_0x3430('0x39')]);this[_0x3430('0x32')][_0x2d93a9[_0x3430('0x30')]]=new Channel();this['channels'][_0x2d93a9[_0x3430('0x30')]][_0x3430('0x45')]=moment()[_0x3430('0x3c')](_0x3430('0x46'));this['channels'][_0x2d93a9[_0x3430('0x30')]]['disposition']=dispositions[_[_0x3430('0x47')](_0x2d93a9[_0x3430('0x48')])];_['merge'](this[_0x3430('0x32')][_0x2d93a9[_0x3430('0x30')]],_[_0x3430('0x34')](_0x2d93a9,_[_0x3430('0x35')](this[_0x3430('0x32')][_0x2d93a9[_0x3430('0x30')]])));if(_0x2d93a9['context']===_0x3430('0x37')){var _0x2f56e6=this[_0x3430('0x12')][_0x2d93a9[_0x3430('0x38')][_0x3430('0x49')]('-')[0x0]];if(_0x2f56e6&&typeof _0x2f56e6['destconnectedlinenum']===_0x3430('0x4a')){_0x2f56e6[_0x3430('0x3b')]=_0x2d93a9['exten'];logger[_0x3430('0x2e')](_0x3430('0x4b'),_0x2d93a9[_0x3430('0x30')],util[_0x3430('0x25')]({'id':_0x2f56e6['id'],'destaccountcode':_0x2f56e6['accountcode'],'destconnectedlinenum':_0x2d93a9[_0x3430('0x39')]},{'showHidden':![],'depth':null}));this[_0x3430('0x29')](util[_0x3430('0x3c')](_0x3430('0x3d'),_0x2f56e6[_0x3430('0x3e')]),_0x3430('0x3f'),{'id':_0x2f56e6['id'],'destaccountcode':_0x2f56e6[_0x3430('0x4c')],'destconnectedlinenum':_0x2d93a9[_0x3430('0x39')]});}}}}catch(_0x291dc5){logger[_0x3430('0x23')](_0x3430('0x4d'),_0x2d93a9['uniqueid'],util[_0x3430('0x25')](_0x291dc5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3430('0x26')]['syncNewExten']=function(_0x569c64){try{if(this[_0x3430('0x27')](_0x569c64)){logger[_0x3430('0x2e')](_0x3430('0x4e'),_0x569c64[_0x3430('0x30')],util[_0x3430('0x25')](_0x569c64,{'showHidden':![],'depth':null}));if(_0x569c64[_0x3430('0x38')]===_0x3430('0x43')||_0x569c64[_0x3430('0x39')]==='h')return;if(_0x569c64[_0x3430('0x30')]===_0x569c64[_0x3430('0x31')]||this[_0x3430('0x13')][_0x569c64[_0x3430('0x31')]]){_0x569c64[_0x3430('0x4f')]=_0x569c64[_0x3430('0x4f')]?_0x569c64[_0x3430('0x4f')]['toLowerCase']():undefined;_0x569c64['applicationdata']=_0x569c64[_0x3430('0x50')]||_0x569c64[_0x3430('0x51')];if(_0x569c64[_0x3430('0x50')]&&_0x569c64[_0x3430('0x4f')]!=='queue'){_0x569c64[_0x3430('0x51')]=_0x569c64[_0x3430('0x51')][_0x3430('0x52')]();}logger[_0x3430('0x20')](_0x3430('0x53'),_0x569c64[_0x3430('0x30')],_0x569c64[_0x3430('0x4f')],_0x569c64[_0x3430('0x51')]);if(_[_0x3430('0x28')](this['channels'][_0x569c64[_0x3430('0x30')]])){this['channels'][_0x569c64[_0x3430('0x30')]]=new Channel();this[_0x3430('0x32')][_0x569c64[_0x3430('0x30')]][_0x3430('0x45')]=_0x569c64[_0x3430('0x54')]?moment()[_0x3430('0x55')](moment['duration'](_0x569c64[_0x3430('0x54')])['seconds'](),'seconds')[_0x3430('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x3430('0x32')][_0x569c64[_0x3430('0x30')]][_0x3430('0x56')]='NO\x20ANSWER';}_[_0x3430('0x33')](this[_0x3430('0x32')][_0x569c64[_0x3430('0x30')]],_[_0x3430('0x34')](_0x569c64,_['keys'](this[_0x3430('0x32')][_0x569c64[_0x3430('0x30')]])));if(_[_0x3430('0x57')](applications,_0x569c64['application'])){this[_0x3430('0x32')][_0x569c64['uniqueid']][_0x3430('0x58')]=_0x569c64[_0x3430('0x4f')];this[_0x3430('0x32')][_0x569c64[_0x3430('0x30')]]['lastdata']=_0x569c64[_0x3430('0x51')];if(_0x569c64[_0x3430('0x4f')]===_0x3430('0x59')&&_[_0x3430('0x5a')](_0x569c64[_0x3430('0x51')]['toLowerCase'](),_0x3430('0x5b'))){var _0x3bfee9=_0x569c64[_0x3430('0x51')]['split']('=');var _0x1912a6=_0x3bfee9[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x1912a6){if(_0x1912a6[0x1]===_0x3430('0x5c')&&!_[_0x3430('0x5d')](this[_0x3430('0x32')][_0x569c64[_0x3430('0x30')]][_0x1912a6[0x1]]))return;this[_0x3430('0x32')][_0x569c64['uniqueid']][_0x1912a6[0x1]]=_0x3bfee9[0x1];}}else if(_0x569c64[_0x3430('0x4f')]==='queue'){this['channels'][_0x569c64[_0x3430('0x30')]]['queue']=_0x569c64['applicationdata'][_0x3430('0x49')](',')[0x0];}}}}}catch(_0x102e9e){logger[_0x3430('0x23')](_0x3430('0x5e'),_0x569c64[_0x3430('0x30')],util[_0x3430('0x25')](_0x102e9e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3430('0x26')][_0x3430('0x5f')]=function(_0x92cbe1){try{if(this['isNotNull'](_0x92cbe1)){logger[_0x3430('0x20')](_0x3430('0x60'),_0x92cbe1[_0x3430('0x30')],_0x92cbe1['linkedid'],_0x92cbe1['calleridname'],_0x92cbe1[_0x3430('0x2d')]);logger[_0x3430('0x2e')]('[%s][voiceCallReport][newstate]\x20event:',_0x92cbe1[_0x3430('0x30')],util[_0x3430('0x25')](_0x92cbe1,{'showHidden':![],'depth':null}));if(_0x92cbe1[_0x3430('0x48')]!=='6')return;var _0x2c7bb4=this[_0x3430('0x12')][_0x92cbe1[_0x3430('0x38')]['split']('-')[0x0]];if(_0x92cbe1[_0x3430('0x30')]!==_0x92cbe1[_0x3430('0x31')]){var _0x58bb3d=moment();if(this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]]){if(!this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]]['answered']){this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]][_0x3430('0x61')]=!![];this[_0x3430('0x32')][_0x92cbe1['linkedid']][_0x3430('0x62')]=_0x58bb3d[_0x3430('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x3430('0x32')][_0x92cbe1['linkedid']]['starttime']){this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]][_0x3430('0x63')]=_0x58bb3d[_0x3430('0x64')](this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]][_0x3430('0x45')],_0x3430('0x65'));}}this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]][_0x3430('0x31')]=_0x92cbe1[_0x3430('0x30')];if(_0x92cbe1[_0x3430('0x2d')]!==_0x3430('0x3a')){this[_0x3430('0x32')][_0x92cbe1['linkedid']][_0x3430('0x40')]=_0x92cbe1['calleridnum'];}this[_0x3430('0x32')][_0x92cbe1['linkedid']][_0x3430('0x66')]=_0x92cbe1[_0x3430('0x2c')];this[_0x3430('0x32')][_0x92cbe1['linkedid']][_0x3430('0x67')]=_0x92cbe1[_0x3430('0x38')];this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]][_0x3430('0x56')]=dispositions[_[_0x3430('0x47')](_0x92cbe1[_0x3430('0x48')])];if(_0x2c7bb4){this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]][_0x3430('0x68')]=_0x2c7bb4['id'];this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]][_0x3430('0x69')]=_0x2c7bb4[_0x3430('0x3e')];}}if(this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]]){if(!this['channels'][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x61')]){this['channels'][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x61')]=!![];this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x62')]=_0x58bb3d[_0x3430('0x3c')](_0x3430('0x46'));if(this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x45')]){this['channels'][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x63')]=_0x58bb3d[_0x3430('0x64')](this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x45')],_0x3430('0x65'));}}if(_0x92cbe1[_0x3430('0x2d')]!==_0x3430('0x3a')){this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x40')]=_0x92cbe1[_0x3430('0x2d')];}this['channels'][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x66')]=_0x92cbe1['calleridname'];this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x67')]=_0x92cbe1[_0x3430('0x38')];this['channels'][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x56')]=dispositions[_['toNumber'](_0x92cbe1[_0x3430('0x48')])];}}else{if(this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]]){if(_0x2c7bb4){this[_0x3430('0x32')][_0x92cbe1['uniqueid']][_0x3430('0x68')]=_0x2c7bb4['id'];this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x69')]=_0x2c7bb4[_0x3430('0x3e')];}}}if(_0x92cbe1[_0x3430('0x36')]===_0x3430('0x37')){if(_0x2c7bb4){_0x2c7bb4[_0x3430('0x3b')]=_0x92cbe1[_0x3430('0x39')];var _0x1daf2b;if(this['channels'][_0x92cbe1[_0x3430('0x30')]]){_0x1daf2b=this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x30')]][_0x3430('0x6a')];}else if(this[_0x3430('0x32')][_0x92cbe1[_0x3430('0x31')]]){_0x1daf2b=this[_0x3430('0x32')][_0x92cbe1['linkedid']][_0x3430('0x6a')];}_0x2c7bb4[_0x3430('0x6a')]=_0x1daf2b;var _0x4d0f91={'id':_0x2c7bb4['id'],'name':_0x2c7bb4[_0x3430('0x3e')],'agentconnected':!![],'destaccountcode':_0x2c7bb4['accountcode'],'destconnectedlinenum':_0x92cbe1[_0x3430('0x39')],'queue':_0x1daf2b||undefined,'uniqueid':_0x92cbe1[_0x3430('0x31')]};logger[_0x3430('0x2e')](_0x3430('0x6b'),_0x92cbe1[_0x3430('0x30')],util['inspect'](_0x4d0f91,{'showHidden':![],'depth':null}));this[_0x3430('0x29')](util[_0x3430('0x3c')](_0x3430('0x3d'),_0x2c7bb4[_0x3430('0x3e')]),_0x3430('0x3f'),_0x4d0f91);}}}}catch(_0x4869fa){logger[_0x3430('0x23')](_0x3430('0x6c'),_0x92cbe1[_0x3430('0x30')],util[_0x3430('0x25')](_0x4869fa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3430('0x26')][_0x3430('0x6d')]=function(_0x1e04a0,_0x510c87){try{if(this[_0x3430('0x32')][_0x1e04a0]){logger[_0x3430('0x20')](_0x3430('0x6e'),_0x1e04a0,_0x510c87);this['channels'][_0x1e04a0][_0x3430('0x6f')]=!![];if(_['endsWith'](_0x510c87,_0x3430('0x70'))){_0x510c87=_0x510c87[_0x3430('0x71')](_0x3430('0x70'),'.WAV');}this['channels'][_0x1e04a0][_0x3430('0x72')]=_0x510c87;var _0x11f9c3=_['find'](this[_0x3430('0x32')][_0x1e04a0][_0x3430('0x73')],{'filename':_0x510c87});if(_[_0x3430('0x5d')](_0x11f9c3)){this[_0x3430('0x32')][_0x1e04a0][_0x3430('0x73')][_0x3430('0x74')]({'filename':_0x510c87,'createdAt':moment()[_0x3430('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x3430('0x75')});}}}catch(_0x468927){logger['error'](_0x3430('0x76'),_0x1e04a0,util['inspect'](_0x468927,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3430('0x26')][_0x3430('0x19')]=function(_0x466ef2){try{if(this[_0x3430('0x27')](_0x466ef2)){logger[_0x3430('0x2e')](_0x3430('0x77'),_0x466ef2[_0x3430('0x30')],util[_0x3430('0x25')](_0x466ef2,{'showHidden':![],'depth':null}));if(this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]]&&_0x466ef2[_0x3430('0x38')]!=_0x3430('0x43')){if(this[_0x3430('0x27')](_0x466ef2['variable'])){if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')][_0x3430('0x79')])){logger[_0x3430('0x20')](_0x3430('0x7a'),_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')]);this[_0x3430('0x6d')](_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')]);}else if(this['isNotNull'](_0x466ef2[_0x3430('0x78')][_0x3430('0x7c')])){logger[_0x3430('0x20')](_0x3430('0x7d'),_0x466ef2[_0x3430('0x30')],_0x466ef2['value']);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]][_0x3430('0x2d')]=_0x466ef2[_0x3430('0x7b')];}else if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')][_0x3430('0x7e')])){logger['info'](_0x3430('0x7f'),_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')]);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]][_0x3430('0x80')]=_0x466ef2[_0x3430('0x7b')];}else if(this[_0x3430('0x27')](_0x466ef2['variable'][_0x3430('0x81')])){logger[_0x3430('0x20')](_0x3430('0x82'),_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')]);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]]['type']=_0x466ef2[_0x3430('0x7b')];}else if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')][_0x3430('0x83')])){logger[_0x3430('0x20')](_0x3430('0x84'),_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')][_0x3430('0x49')](',')[0x0]);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]][_0x3430('0x6a')]=_0x466ef2['value'][_0x3430('0x49')](',')[0x0];}else if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')][_0x3430('0x85')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x466ef2['uniqueid'],_0x466ef2[_0x3430('0x7b')]);this['channels'][_0x466ef2[_0x3430('0x30')]][_0x3430('0x86')]=_0x466ef2[_0x3430('0x7b')];}else if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')]['xmd-destination'])){logger['info'](_0x3430('0x87'),_0x466ef2[_0x3430('0x30')],_0x466ef2['value']);this['channels'][_0x466ef2[_0x3430('0x30')]]['destination']=_0x466ef2['value'];}else if(this['isNotNull'](_0x466ef2['variable']['xmd-callerid-preview'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')]);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]]['calleridpreview']=_0x466ef2['value'];}else if(this['isNotNull'](_0x466ef2[_0x3430('0x78')][_0x3430('0x88')])){logger['info'](_0x3430('0x89'),_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')]);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]][_0x3430('0x6a')]=_0x466ef2[_0x3430('0x7b')];}else if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')][_0x3430('0x8a')])){logger[_0x3430('0x20')](_0x3430('0x8b'),_0x466ef2[_0x3430('0x30')],_0x466ef2[_0x3430('0x7b')]);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x30')]][_0x3430('0x8c')]=_0x466ef2[_0x3430('0x7b')];}}}else if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')][_0x3430('0x79')])){if(_0x466ef2[_0x3430('0x7b')]){var _0x39f7e7=path[_0x3430('0x8d')](_0x466ef2[_0x3430('0x7b')])[_0x3430('0x3e')];logger['info'](_0x3430('0x7a'),_0x39f7e7,_0x466ef2['value']);this[_0x3430('0x6d')](_0x39f7e7,_0x466ef2['value']);}}else if(this[_0x3430('0x32')][_0x466ef2['linkedid']]){if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')])){if(this[_0x3430('0x27')](_0x466ef2[_0x3430('0x78')][_0x3430('0x8a')])){logger[_0x3430('0x20')](_0x3430('0x8b'),_0x466ef2['linkedid'],_0x466ef2[_0x3430('0x7b')]);this[_0x3430('0x32')][_0x466ef2[_0x3430('0x31')]][_0x3430('0x8e')]=_0x466ef2[_0x3430('0x7b')];}}}}}catch(_0x5227dc){logger[_0x3430('0x23')](_0x3430('0x8f'),_0x466ef2[_0x3430('0x30')],util[_0x3430('0x25')](_0x5227dc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3430('0x26')][_0x3430('0x1a')]=function(_0x11c9e8){try{if(this[_0x3430('0x27')](_0x11c9e8)){logger[_0x3430('0x2e')](_0x3430('0x90'),_0x11c9e8[_0x3430('0x30')],util[_0x3430('0x25')](_0x11c9e8,{'showHidden':![],'depth':null}));if(this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]){if(this['channels'][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]['linkedid']]){this['channels'][this[_0x3430('0x13')][_0x11c9e8['linkedid']][_0x3430('0x31')]][_0x3430('0x30')]=_0x11c9e8['uniqueid'];this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]['linkedid']][_0x3430('0x61')]=this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x61')];this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]['linkedid']][_0x3430('0x62')]=this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x62')];this[_0x3430('0x32')][this['blindTransfers'][_0x11c9e8['linkedid']]['linkedid']]['destinationchannel']=this['channels'][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]['linkedid']][_0x3430('0x38')];this['channels'][this['blindTransfers'][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x31')]]['disposition']=this['channels'][_0x11c9e8[_0x3430('0x30')]]['disposition'];this['channels'][_0x11c9e8['uniqueid']]=this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x31')]];this[_0x3430('0x91')](this['blindTransfers'][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x31')]);}else if(this['channels'][this[_0x3430('0x13')][_0x11c9e8['linkedid']][_0x3430('0x30')]]){this['channels'][this['blindTransfers'][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x30')]][_0x3430('0x30')]=[this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]['uniqueid']]['linkedid'],this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x30')]][_0x3430('0x31')]=this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]['uniqueid']][_0x3430('0x30')]][0x0];this[_0x3430('0x32')][this['blindTransfers'][_0x11c9e8['linkedid']]['uniqueid']][_0x3430('0x61')]=this['channels'][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x61')];this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x30')]][_0x3430('0x62')]=this[_0x3430('0x32')][_0x11c9e8['uniqueid']][_0x3430('0x62')];this[_0x3430('0x32')][this['blindTransfers'][_0x11c9e8[_0x3430('0x31')]]['uniqueid']]['destinationchannel']=this[_0x3430('0x32')][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x30')]][_0x3430('0x38')];this['channels'][this[_0x3430('0x13')][_0x11c9e8[_0x3430('0x31')]]['uniqueid']]['disposition']=this['channels'][_0x11c9e8['uniqueid']]['disposition'];this[_0x3430('0x32')][_0x11c9e8['uniqueid']]=this[_0x3430('0x32')][this['blindTransfers'][_0x11c9e8[_0x3430('0x31')]][_0x3430('0x30')]];this[_0x3430('0x91')](this['blindTransfers'][_0x11c9e8[_0x3430('0x31')]]['uniqueid']);}}if(this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]]){logger['info'](_0x3430('0x92'),_0x11c9e8[_0x3430('0x30')],_0x11c9e8[_0x3430('0x93')]);var _0x12f6b1=moment();this[_0x3430('0x32')][_0x11c9e8['uniqueid']][_0x3430('0x94')]=_0x12f6b1[_0x3430('0x3c')](_0x3430('0x46'));this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x54')]=_0x12f6b1[_0x3430('0x64')](this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x45')],_0x3430('0x65'));if(this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x61')]){this['channels'][_0x11c9e8['uniqueid']][_0x3430('0x95')]=_0x12f6b1['diff'](this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]]['answertime'],'seconds');this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x63')]=this[_0x3430('0x32')][_0x11c9e8[_0x3430('0x30')]][_0x3430('0x54')]-this[_0x3430('0x32')][_0x11c9e8['uniqueid']][_0x3430('0x95')];}if(_0x11c9e8[_0x3430('0x36')]===_0x3430('0x37')){if(this[_0x3430('0x12')][_0x11c9e8[_0x3430('0x38')]['split']('-')[0x0]]){this[_0x3430('0x12')][_0x11c9e8[_0x3430('0x38')]['split']('-')[0x0]]=_[_0x3430('0x96')](this[_0x3430('0x12')][_0x11c9e8[_0x3430('0x38')][_0x3430('0x49')]('-')[0x0]],['destconnectedlinenum']);logger[_0x3430('0x2e')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x11c9e8[_0x3430('0x30')],util[_0x3430('0x25')]({'id':this[_0x3430('0x12')][_0x11c9e8[_0x3430('0x38')][_0x3430('0x49')]('-')[0x0]]['id'],'destaccountcode':this[_0x3430('0x12')][_0x11c9e8[_0x3430('0x38')][_0x3430('0x49')]('-')[0x0]][_0x3430('0x4c')]},{'showHidden':![],'depth':null}));this[_0x3430('0x29')](util['format'](_0x3430('0x3d'),this[_0x3430('0x12')][_0x11c9e8[_0x3430('0x38')][_0x3430('0x49')]('-')[0x0]]['name']),_0x3430('0x97'),{'id':this[_0x3430('0x12')][_0x11c9e8['channel'][_0x3430('0x49')]('-')[0x0]]['id'],'destaccountcode':this[_0x3430('0x12')][_0x11c9e8['channel'][_0x3430('0x49')]('-')[0x0]][_0x3430('0x4c')]});for(var _0x5d5c2f=0x0;_0x5d5c2f{delete this[_0x3430('0x32')][_0x1431b0];},_0x4bf20b);}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x038f=['event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','path','ioredis','../../../config/environment','ami','../model/channel','../rpc/setting','set','queue','agi','dial','NO\x20ANSWER','ANSWERED','BUSY','FAILED','redis','defaults','localhost','channels','agents','coreshowchannel','newexten','bind','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','from-sip','channel','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','name','user:agentconnect','inspect','OutgoingSpoolFailed','blindTransfers','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','context','split','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','error','[%s][voiceCallReport][newchannel]','syncNewExten','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','duration','seconds','includes','lastapplication','cdr(','match','isNil','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','connectedlinename','toNumber','diff','destinationchannel','membername','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','replace','.wav49','monitorFilename','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','deleteChannelAfterTimeout','cause-txt','billableseconds','omit','user:agentcomplete','length','transferType','undefined','transferToInternal','isEmpty','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038f,0xdc));var _0xf038=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x038f[_0x506d2f];return _0x101255;};'use strict';var _=require(_0xf038('0x0'));var moment=require(_0xf038('0x1'));var util=require(_0xf038('0x2'));var path=require(_0xf038('0x3'));var Redis=require(_0xf038('0x4'));var config=require(_0xf038('0x5'));var logger=require('../../../config/logger')(_0xf038('0x6'));var ami=require('../ami');var Channel=require(_0xf038('0x7'));var RpcSetting=require(_0xf038('0x8'));var applications=[_0xf038('0x9'),_0xf038('0xa'),_0xf038('0xb'),_0xf038('0xc'),'playback','voicemail'];var dispositions=[_0xf038('0xd'),'FAILED','FAILED',_0xf038('0xd'),'NO\x20ANSWER','NO\x20ANSWER',_0xf038('0xe'),_0xf038('0xf'),_0xf038('0x10'),_0xf038('0x10'),_0xf038('0x10')];config[_0xf038('0x11')]=_[_0xf038('0x12')](config[_0xf038('0x11')],{'host':_0xf038('0x13'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf038('0x11')]));function VoiceCallReport(_0xd2edd5){this['channels']=_0xd2edd5[_0xf038('0x14')];this[_0xf038('0x15')]=_0xd2edd5[_0xf038('0x15')];this['blindTransfers']={};ami['on'](_0xf038('0x16'),this['syncNewExten']['bind'](this));ami['on'](_0xf038('0x17'),this['syncNewExten'][_0xf038('0x18')](this));ami['on']('newchannel',this[_0xf038('0x19')][_0xf038('0x18')](this));ami['on'](_0xf038('0x1a'),this[_0xf038('0x1b')][_0xf038('0x18')](this));ami['on'](_0xf038('0x1c'),this[_0xf038('0x1d')][_0xf038('0x18')](this));ami['on'](_0xf038('0x1e'),this[_0xf038('0x1f')][_0xf038('0x18')](this));ami['on'](_0xf038('0x20'),this[_0xf038('0x21')][_0xf038('0x18')](this));ami['on'](_0xf038('0x22'),this[_0xf038('0x23')]['bind'](this));ami['on']('blindtransfer',this[_0xf038('0x24')][_0xf038('0x18')](this));ami['on'](_0xf038('0x25'),this['syncMusicOnHoldStart'][_0xf038('0x18')](this));ami['on'](_0xf038('0x26'),this['syncMusicOnHoldStop']['bind'](this));try{logger[_0xf038('0x27')](_0xf038('0x28'));ami[_0xf038('0x29')]();}catch(_0x1bdeea){logger['error'](_0xf038('0x2a'),util['inspect'](_0x1bdeea,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xf038('0x2b')][_0xf038('0x2c')]=function(_0x5c75e4){return _0x5c75e4!==null&&!_[_0xf038('0x2d')](_0x5c75e4);};VoiceCallReport['prototype'][_0xf038('0x2e')]=function(_0x2ff8c9,_0x100f0b,_0x44d3ca){io['to'](_0x2ff8c9)[_0xf038('0x2e')](_0x100f0b,_0x44d3ca);};VoiceCallReport[_0xf038('0x2b')]['syncNewCallerId']=function(_0xb55897){try{if(this[_0xf038('0x2c')](_0xb55897)){logger[_0xf038('0x27')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0xb55897[_0xf038('0x2f')],_0xb55897[_0xf038('0x30')],_0xb55897[_0xf038('0x31')]);logger[_0xf038('0x32')](_0xf038('0x33'),_0xb55897['uniqueid'],util['inspect'](_0xb55897,{'showHidden':![],'depth':null}));if(_0xb55897[_0xf038('0x2f')]===_0xb55897[_0xf038('0x34')]){if(!_[_0xf038('0x2d')](this[_0xf038('0x14')][_0xb55897[_0xf038('0x2f')]])){_[_0xf038('0x35')](this[_0xf038('0x14')][_0xb55897[_0xf038('0x2f')]],_[_0xf038('0x36')](_0xb55897,_[_0xf038('0x37')](this['channels'][_0xb55897[_0xf038('0x2f')]])));}}if(_0xb55897['context']===_0xf038('0x38')){var _0x27a6de=this['agents'][_0xb55897[_0xf038('0x39')]['split']('-')[0x0]];if(_0x27a6de){if(_0xb55897[_0xf038('0x3a')]==_0xf038('0x3b')){_0x27a6de[_0xf038('0x3c')]=_0xb55897[_0xf038('0x3d')];this[_0xf038('0x2e')](util[_0xf038('0x3e')]('user:%s',_0x27a6de[_0xf038('0x3f')]),_0xf038('0x40'),{'id':_0x27a6de['id'],'destaccountcode':_0x27a6de['accountcode'],'destconnectedlinenum':_0xb55897[_0xf038('0x3d')]});}}}}}catch(_0x31fc09){logger['error']('[%s][voiceCallReport][newcallerid]',_0xb55897[_0xf038('0x2f')],util[_0xf038('0x41')](_0x31fc09,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf038('0x2b')][_0xf038('0x19')]=function(_0x4ebe5d){try{if(this[_0xf038('0x2c')](_0x4ebe5d)){logger[_0xf038('0x32')]('[%s][voiceCallReport][newchannel]\x20event:',_0x4ebe5d['uniqueid'],util[_0xf038('0x41')](_0x4ebe5d,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ebe5d[_0xf038('0x2f')]]){return;}if(_0x4ebe5d['channel']===_0xf038('0x42')){return;}if(_0x4ebe5d[_0xf038('0x2f')]!==_0x4ebe5d['linkedid']&&!this[_0xf038('0x43')][_0x4ebe5d[_0xf038('0x34')]]){return;}logger[_0xf038('0x27')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x4ebe5d[_0xf038('0x2f')],_0x4ebe5d['context'],_0x4ebe5d[_0xf038('0x3a')]);this[_0xf038('0x14')][_0x4ebe5d['uniqueid']]=new Channel();this[_0xf038('0x14')][_0x4ebe5d['uniqueid']][_0xf038('0x44')]=moment()[_0xf038('0x3e')](_0xf038('0x45'));this[_0xf038('0x14')][_0x4ebe5d[_0xf038('0x2f')]][_0xf038('0x46')]=dispositions[_['toNumber'](_0x4ebe5d[_0xf038('0x47')])];_['merge'](this[_0xf038('0x14')][_0x4ebe5d[_0xf038('0x2f')]],_[_0xf038('0x36')](_0x4ebe5d,_[_0xf038('0x37')](this[_0xf038('0x14')][_0x4ebe5d[_0xf038('0x2f')]])));if(_0x4ebe5d[_0xf038('0x48')]===_0xf038('0x38')){var _0x2c52bc=this['agents'][_0x4ebe5d[_0xf038('0x39')][_0xf038('0x49')]('-')[0x0]];if(_0x2c52bc&&typeof _0x2c52bc['destconnectedlinenum']==='undefined'){_0x2c52bc[_0xf038('0x3c')]=_0x4ebe5d[_0xf038('0x3a')];logger['debug'](_0xf038('0x4a'),_0x4ebe5d[_0xf038('0x2f')],util[_0xf038('0x41')]({'id':_0x2c52bc['id'],'destaccountcode':_0x2c52bc[_0xf038('0x4b')],'destconnectedlinenum':_0x4ebe5d[_0xf038('0x3a')]},{'showHidden':![],'depth':null}));this[_0xf038('0x2e')](util['format'](_0xf038('0x4c'),_0x2c52bc[_0xf038('0x3f')]),_0xf038('0x40'),{'id':_0x2c52bc['id'],'destaccountcode':_0x2c52bc[_0xf038('0x4b')],'destconnectedlinenum':_0x4ebe5d[_0xf038('0x3a')]});}}}}catch(_0x109611){logger[_0xf038('0x4d')](_0xf038('0x4e'),_0x4ebe5d[_0xf038('0x2f')],util['inspect'](_0x109611,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf038('0x4f')]=function(_0x28b807){try{if(this[_0xf038('0x2c')](_0x28b807)){logger['debug'](_0xf038('0x50'),_0x28b807['uniqueid'],util[_0xf038('0x41')](_0x28b807,{'showHidden':![],'depth':null}));if(_0x28b807['channel']===_0xf038('0x42')||_0x28b807[_0xf038('0x3a')]==='h')return;if(_0x28b807[_0xf038('0x2f')]===_0x28b807[_0xf038('0x34')]||this[_0xf038('0x43')][_0x28b807[_0xf038('0x34')]]){_0x28b807[_0xf038('0x51')]=_0x28b807[_0xf038('0x51')]?_0x28b807[_0xf038('0x51')][_0xf038('0x52')]():undefined;_0x28b807[_0xf038('0x53')]=_0x28b807[_0xf038('0x54')]||_0x28b807[_0xf038('0x53')];if(_0x28b807[_0xf038('0x54')]&&_0x28b807[_0xf038('0x51')]!==_0xf038('0xa')){_0x28b807[_0xf038('0x53')]=_0x28b807[_0xf038('0x53')]['toLowerCase']();}logger[_0xf038('0x27')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x28b807['uniqueid'],_0x28b807['application'],_0x28b807[_0xf038('0x53')]);if(_[_0xf038('0x2d')](this[_0xf038('0x14')][_0x28b807[_0xf038('0x2f')]])){this[_0xf038('0x14')][_0x28b807['uniqueid']]=new Channel();this[_0xf038('0x14')][_0x28b807['uniqueid']][_0xf038('0x44')]=_0x28b807[_0xf038('0x55')]?moment()['subtract'](moment['duration'](_0x28b807['duration'])[_0xf038('0x56')](),_0xf038('0x56'))[_0xf038('0x3e')](_0xf038('0x45')):moment()[_0xf038('0x3e')](_0xf038('0x45'));this[_0xf038('0x14')][_0x28b807['uniqueid']][_0xf038('0x46')]=_0xf038('0xd');}_[_0xf038('0x35')](this[_0xf038('0x14')][_0x28b807[_0xf038('0x2f')]],_[_0xf038('0x36')](_0x28b807,_[_0xf038('0x37')](this[_0xf038('0x14')][_0x28b807[_0xf038('0x2f')]])));if(_[_0xf038('0x57')](applications,_0x28b807[_0xf038('0x51')])){this[_0xf038('0x14')][_0x28b807[_0xf038('0x2f')]][_0xf038('0x58')]=_0x28b807[_0xf038('0x51')];this[_0xf038('0x14')][_0x28b807['uniqueid']]['lastdata']=_0x28b807[_0xf038('0x53')];if(_0x28b807[_0xf038('0x51')]===_0xf038('0x9')&&_['startsWith'](_0x28b807[_0xf038('0x53')][_0xf038('0x52')](),_0xf038('0x59'))){var _0x1db692=_0x28b807['applicationdata'][_0xf038('0x49')]('=');var _0x545269=_0x1db692[0x0][_0xf038('0x52')]()[_0xf038('0x5a')](/cdr\((.*)\)/);if(_0x545269){if(_0x545269[0x1]==='type'&&!_[_0xf038('0x5b')](this[_0xf038('0x14')][_0x28b807[_0xf038('0x2f')]][_0x545269[0x1]]))return;this[_0xf038('0x14')][_0x28b807[_0xf038('0x2f')]][_0x545269[0x1]]=_0x1db692[0x1];}}else if(_0x28b807['application']===_0xf038('0xa')){this[_0xf038('0x14')][_0x28b807[_0xf038('0x2f')]][_0xf038('0xa')]=_0x28b807['applicationdata']['split'](',')[0x0];}}}}}catch(_0x13702f){logger['error']('[%s][voiceCallReport][newexten]',_0x28b807['uniqueid'],util[_0xf038('0x41')](_0x13702f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf038('0x2b')][_0xf038('0x1b')]=function(_0x31933c){try{if(this['isNotNull'](_0x31933c)){logger[_0xf038('0x27')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x31933c[_0xf038('0x2f')],_0x31933c[_0xf038('0x34')],_0x31933c[_0xf038('0x30')],_0x31933c[_0xf038('0x31')]);logger[_0xf038('0x32')](_0xf038('0x5c'),_0x31933c[_0xf038('0x2f')],util[_0xf038('0x41')](_0x31933c,{'showHidden':![],'depth':null}));if(_0x31933c['channelstate']!=='6')return;var _0x3cf896=this[_0xf038('0x15')][_0x31933c['channel'][_0xf038('0x49')]('-')[0x0]];if(_0x31933c['uniqueid']!==_0x31933c['linkedid']){var _0x55adf2=moment();if(this[_0xf038('0x14')][_0x31933c['linkedid']]){if(!this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x5d')]){this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x5d')]=!![];this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x5e')]=_0x55adf2[_0xf038('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xf038('0x14')][_0x31933c['linkedid']][_0xf038('0x44')]){this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x5f')]=_0x55adf2['diff'](this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x44')],_0xf038('0x56'));}}this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x34')]=_0x31933c['uniqueid'];if(_0x31933c[_0xf038('0x31')]!=='xcally-motion-preview'){this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x3d')]=_0x31933c[_0xf038('0x31')];}this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0x60')]=_0x31933c[_0xf038('0x30')];this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]]['destinationchannel']=_0x31933c[_0xf038('0x39')];this['channels'][_0x31933c['linkedid']][_0xf038('0x46')]=dispositions[_[_0xf038('0x61')](_0x31933c[_0xf038('0x47')])];if(_0x3cf896){this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]]['UserId']=_0x3cf896['id'];this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]]['membername']=_0x3cf896[_0xf038('0x3f')];}}if(this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]]){if(!this['channels'][_0x31933c[_0xf038('0x2f')]]['answered']){this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0x5d')]=!![];this['channels'][_0x31933c[_0xf038('0x2f')]][_0xf038('0x5e')]=_0x55adf2[_0xf038('0x3e')](_0xf038('0x45'));if(this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0x44')]){this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0x5f')]=_0x55adf2[_0xf038('0x62')](this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0x44')],_0xf038('0x56'));}}if(_0x31933c[_0xf038('0x31')]!==_0xf038('0x3b')){this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0x3d')]=_0x31933c[_0xf038('0x31')];}this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0x60')]=_0x31933c[_0xf038('0x30')];this['channels'][_0x31933c[_0xf038('0x2f')]][_0xf038('0x63')]=_0x31933c[_0xf038('0x39')];this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0x46')]=dispositions[_[_0xf038('0x61')](_0x31933c['channelstate'])];}}else{if(this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]]){if(_0x3cf896){this[_0xf038('0x14')][_0x31933c['uniqueid']]['UserId']=_0x3cf896['id'];this[_0xf038('0x14')][_0x31933c['uniqueid']][_0xf038('0x64')]=_0x3cf896[_0xf038('0x3f')];}}}if(_0x31933c[_0xf038('0x48')]===_0xf038('0x38')){if(_0x3cf896){_0x3cf896[_0xf038('0x3c')]=_0x31933c['exten'];var _0x1af3ec;if(this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]]){_0x1af3ec=this[_0xf038('0x14')][_0x31933c[_0xf038('0x2f')]][_0xf038('0xa')];}else if(this['channels'][_0x31933c[_0xf038('0x34')]]){_0x1af3ec=this[_0xf038('0x14')][_0x31933c[_0xf038('0x34')]][_0xf038('0xa')];}_0x3cf896[_0xf038('0xa')]=_0x1af3ec;var _0x840ada={'id':_0x3cf896['id'],'name':_0x3cf896[_0xf038('0x3f')],'agentconnected':!![],'destaccountcode':_0x3cf896[_0xf038('0x4b')],'destconnectedlinenum':_0x31933c[_0xf038('0x3a')],'queue':_0x1af3ec||undefined,'uniqueid':_0x31933c[_0xf038('0x34')]};logger[_0xf038('0x32')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x31933c[_0xf038('0x2f')],util['inspect'](_0x840ada,{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',_0x3cf896['name']),_0xf038('0x40'),_0x840ada);}}}}catch(_0x2911d0){logger[_0xf038('0x4d')](_0xf038('0x65'),_0x31933c['uniqueid'],util[_0xf038('0x41')](_0x2911d0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf038('0x2b')][_0xf038('0x66')]=function(_0x220c1a,_0xbae65d){try{if(this['channels'][_0x220c1a]){logger['info'](_0xf038('0x67'),_0x220c1a,_0xbae65d);this[_0xf038('0x14')][_0x220c1a][_0xf038('0x68')]=!![];if(_['endsWith'](_0xbae65d,'.wav49')){_0xbae65d=_0xbae65d[_0xf038('0x69')](_0xf038('0x6a'),'.WAV');}this[_0xf038('0x14')][_0x220c1a][_0xf038('0x6b')]=_0xbae65d;var _0x172034=_[_0xf038('0x6c')](this['channels'][_0x220c1a][_0xf038('0x6d')],{'filename':_0xbae65d});if(_[_0xf038('0x5b')](_0x172034)){this[_0xf038('0x14')][_0x220c1a][_0xf038('0x6d')][_0xf038('0x6e')]({'filename':_0xbae65d,'createdAt':moment()['format'](_0xf038('0x45')),'mixmonitorid':'','status':'rec'});}}}catch(_0x588207){logger[_0xf038('0x4d')](_0xf038('0x6f'),_0x220c1a,util[_0xf038('0x41')](_0x588207,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf038('0x2b')][_0xf038('0x1d')]=function(_0x3813b2){try{if(this['isNotNull'](_0x3813b2)){logger[_0xf038('0x32')](_0xf038('0x70'),_0x3813b2[_0xf038('0x2f')],util['inspect'](_0x3813b2,{'showHidden':![],'depth':null}));if(this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]]&&_0x3813b2[_0xf038('0x39')]!=_0xf038('0x42')){if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')])){if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')]['mixmonitor_filename'])){logger[_0xf038('0x27')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x3813b2['uniqueid'],_0x3813b2[_0xf038('0x72')]);this['syncMixMonitorFilename'](_0x3813b2[_0xf038('0x2f')],_0x3813b2[_0xf038('0x72')]);}else if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')][_0xf038('0x73')])){logger[_0xf038('0x27')](_0xf038('0x74'),_0x3813b2['uniqueid'],_0x3813b2[_0xf038('0x72')]);this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]][_0xf038('0x31')]=_0x3813b2[_0xf038('0x72')];}else if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')][_0xf038('0x75')])){logger[_0xf038('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x3813b2['uniqueid'],_0x3813b2['value']);this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]]['callerid']=_0x3813b2[_0xf038('0x72')];}else if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')]['xmd-cdrtype'])){logger[_0xf038('0x27')](_0xf038('0x76'),_0x3813b2[_0xf038('0x2f')],_0x3813b2[_0xf038('0x72')]);this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]][_0xf038('0x77')]=_0x3813b2[_0xf038('0x72')];}else if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')][_0xf038('0x78')])){logger[_0xf038('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x3813b2[_0xf038('0x2f')],_0x3813b2[_0xf038('0x72')][_0xf038('0x49')](',')[0x0]);this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]][_0xf038('0xa')]=_0x3813b2[_0xf038('0x72')][_0xf038('0x49')](',')[0x0];}else if(this[_0xf038('0x2c')](_0x3813b2['variable'][_0xf038('0x79')])){logger[_0xf038('0x27')](_0xf038('0x7a'),_0x3813b2[_0xf038('0x2f')],_0x3813b2['value']);this[_0xf038('0x14')][_0x3813b2['uniqueid']]['originatecalleridnum']=_0x3813b2[_0xf038('0x72')];}else if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')]['xmd-destination'])){logger[_0xf038('0x27')](_0xf038('0x7b'),_0x3813b2[_0xf038('0x2f')],_0x3813b2['value']);this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]][_0xf038('0x7c')]=_0x3813b2['value'];}else if(this['isNotNull'](_0x3813b2[_0xf038('0x71')][_0xf038('0x7d')])){logger[_0xf038('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x3813b2['uniqueid'],_0x3813b2[_0xf038('0x72')]);this['channels'][_0x3813b2[_0xf038('0x2f')]][_0xf038('0x7e')]=_0x3813b2[_0xf038('0x72')];}else if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')][_0xf038('0x7f')])){logger[_0xf038('0x27')](_0xf038('0x80'),_0x3813b2[_0xf038('0x2f')],_0x3813b2['value']);this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]][_0xf038('0xa')]=_0x3813b2['value'];}else if(this['isNotNull'](_0x3813b2[_0xf038('0x71')][_0xf038('0x81')])){logger[_0xf038('0x27')](_0xf038('0x82'),_0x3813b2['uniqueid'],_0x3813b2['value']);this[_0xf038('0x14')][_0x3813b2[_0xf038('0x2f')]][_0xf038('0x83')]=_0x3813b2[_0xf038('0x72')];}}}else if(this['isNotNull'](_0x3813b2[_0xf038('0x71')]['mixmonitor_filename'])){if(_0x3813b2['value']){var _0x5a0466=path[_0xf038('0x84')](_0x3813b2[_0xf038('0x72')])[_0xf038('0x3f')];logger[_0xf038('0x27')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x5a0466,_0x3813b2[_0xf038('0x72')]);this['syncMixMonitorFilename'](_0x5a0466,_0x3813b2[_0xf038('0x72')]);}}else if(this[_0xf038('0x14')][_0x3813b2[_0xf038('0x34')]]){if(this[_0xf038('0x2c')](_0x3813b2[_0xf038('0x71')])){if(this['isNotNull'](_0x3813b2[_0xf038('0x71')][_0xf038('0x81')])){logger[_0xf038('0x27')](_0xf038('0x82'),_0x3813b2[_0xf038('0x34')],_0x3813b2['value']);this['channels'][_0x3813b2['linkedid']][_0xf038('0x85')]=_0x3813b2[_0xf038('0x72')];}}}}}catch(_0x570481){logger['error'](_0xf038('0x86'),_0x3813b2['uniqueid'],util[_0xf038('0x41')](_0x570481,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf038('0x2b')][_0xf038('0x1f')]=function(_0x5224e1){try{if(this['isNotNull'](_0x5224e1)){logger[_0xf038('0x32')]('[%s][voiceCallReport][hangup]\x20event:',_0x5224e1[_0xf038('0x2f')],util[_0xf038('0x41')](_0x5224e1,{'showHidden':![],'depth':null}));if(this[_0xf038('0x43')][_0x5224e1['linkedid']]){if(this['channels'][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x34')]]){this['channels'][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x34')]][_0xf038('0x2f')]=_0x5224e1[_0xf038('0x2f')];this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1['linkedid']][_0xf038('0x34')]][_0xf038('0x5d')]=this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x5d')];this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]]['linkedid']][_0xf038('0x5e')]=this[_0xf038('0x14')][_0x5224e1['uniqueid']][_0xf038('0x5e')];this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x34')]][_0xf038('0x63')]=this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]]['linkedid']][_0xf038('0x39')];this['channels'][this['blindTransfers'][_0x5224e1[_0xf038('0x34')]]['linkedid']]['disposition']=this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x46')];this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]]=this['channels'][this[_0xf038('0x43')][_0x5224e1['linkedid']][_0xf038('0x34')]];this['deleteChannelAfterTimeout'](this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x34')]);}else if(this[_0xf038('0x14')][this['blindTransfers'][_0x5224e1[_0xf038('0x34')]][_0xf038('0x2f')]]){this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x2f')]][_0xf038('0x2f')]=[this['channels'][this[_0xf038('0x43')][_0x5224e1['linkedid']][_0xf038('0x2f')]]['linkedid'],this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x2f')]][_0xf038('0x34')]=this['channels'][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x2f')]][_0xf038('0x2f')]][0x0];this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]]['uniqueid']][_0xf038('0x5d')]=this[_0xf038('0x14')][_0x5224e1['uniqueid']]['answered'];this[_0xf038('0x14')][this['blindTransfers'][_0x5224e1[_0xf038('0x34')]][_0xf038('0x2f')]]['answertime']=this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x5e')];this['channels'][this['blindTransfers'][_0x5224e1['linkedid']][_0xf038('0x2f')]][_0xf038('0x63')]=this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1['linkedid']][_0xf038('0x2f')]][_0xf038('0x39')];this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x2f')]][_0xf038('0x46')]=this[_0xf038('0x14')][_0x5224e1['uniqueid']][_0xf038('0x46')];this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]]=this[_0xf038('0x14')][this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]][_0xf038('0x2f')]];this[_0xf038('0x87')](this[_0xf038('0x43')][_0x5224e1[_0xf038('0x34')]]['uniqueid']);}}if(this[_0xf038('0x14')][_0x5224e1['uniqueid']]){logger[_0xf038('0x27')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x5224e1[_0xf038('0x2f')],_0x5224e1[_0xf038('0x88')]);var _0x3235de=moment();this[_0xf038('0x14')][_0x5224e1['uniqueid']]['endtime']=_0x3235de[_0xf038('0x3e')](_0xf038('0x45'));this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x55')]=_0x3235de['diff'](this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]]['starttime'],_0xf038('0x56'));if(this['channels'][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x5d')]){this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x89')]=_0x3235de[_0xf038('0x62')](this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x5e')],_0xf038('0x56'));this['channels'][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x5f')]=this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x55')]-this[_0xf038('0x14')][_0x5224e1[_0xf038('0x2f')]][_0xf038('0x89')];}if(_0x5224e1[_0xf038('0x48')]===_0xf038('0x38')){if(this[_0xf038('0x15')][_0x5224e1['channel'][_0xf038('0x49')]('-')[0x0]]){this[_0xf038('0x15')][_0x5224e1[_0xf038('0x39')][_0xf038('0x49')]('-')[0x0]]=_[_0xf038('0x8a')](this[_0xf038('0x15')][_0x5224e1[_0xf038('0x39')][_0xf038('0x49')]('-')[0x0]],[_0xf038('0x3c')]);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x5224e1[_0xf038('0x2f')],util[_0xf038('0x41')]({'id':this['agents'][_0x5224e1[_0xf038('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xf038('0x15')][_0x5224e1['channel']['split']('-')[0x0]][_0xf038('0x4b')]},{'showHidden':![],'depth':null}));this[_0xf038('0x2e')](util[_0xf038('0x3e')]('user:%s',this[_0xf038('0x15')][_0x5224e1[_0xf038('0x39')][_0xf038('0x49')]('-')[0x0]][_0xf038('0x3f')]),_0xf038('0x8b'),{'id':this['agents'][_0x5224e1[_0xf038('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xf038('0x15')][_0x5224e1[_0xf038('0x39')][_0xf038('0x49')]('-')[0x0]]['accountcode']});for(var _0x35912b=0x0;_0x35912b{delete this[_0xf038('0x14')][_0x309ebc];},_0x262a38);}};module[_0xf038('0xb9')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index faf75eb..ca07ee1 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6df6=['deleteChannelAfterTimeout','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isUndefined','emit','prototype','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','substring','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','isNotNull','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','connect','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','complete','total','answertime','answered','billableseconds','sumHoldTime','holdtime','sumDuration','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','[%s][voiceDialReport][newexten]'];(function(_0x1b4ceb,_0x9be1a0){var _0x5d2beb=function(_0x24a5bc){while(--_0x24a5bc){_0x1b4ceb['push'](_0x1b4ceb['shift']());}};_0x5d2beb(++_0x9be1a0);}(_0x6df6,0x15a));var _0x66df=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x6df6[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0x66df('0x0'));var moment=require(_0x66df('0x1'));var util=require('util');var Redis=require(_0x66df('0x2'));var config=require(_0x66df('0x3'));var logger=require(_0x66df('0x4'))(_0x66df('0x5'));var ami=require(_0x66df('0x6'));config[_0x66df('0x7')]=_['defaults'](config[_0x66df('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x66df('0x8'))(new Redis(config[_0x66df('0x7')]));function VoiceDialReport(_0x544d57){this[_0x66df('0x9')]=_0x544d57[_0x66df('0xa')];this[_0x66df('0xb')]=_0x544d57['outbound'];this[_0x66df('0xc')]={};this[_0x66df('0xd')]={};ami['on'](_0x66df('0xe'),this['syncDialBegin'][_0x66df('0xf')](this));ami['on'](_0x66df('0x10'),this[_0x66df('0x11')][_0x66df('0xf')](this));ami['on'](_0x66df('0x12'),this[_0x66df('0x13')][_0x66df('0xf')](this));ami['on'](_0x66df('0x14'),this[_0x66df('0x15')][_0x66df('0xf')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0xa9d0e4){return _0xa9d0e4!==null&&!_[_0x66df('0x16')](_0xa9d0e4);};VoiceDialReport['prototype']['emit']=function(_0x530b60,_0x1a7581,_0x3d7e7a){io['to'](_0x530b60)[_0x66df('0x17')](_0x1a7581,_0x3d7e7a);};VoiceDialReport[_0x66df('0x18')][_0x66df('0x19')]=function(_0x3c0048){try{if(this['isNotNull'](_0x3c0048)){logger[_0x66df('0x1a')](_0x66df('0x1b'),_0x3c0048[_0x66df('0x1c')],util[_0x66df('0x1d')](_0x3c0048,{'showHidden':![],'depth':null}));if(this['channels'][_0x3c0048[_0x66df('0x1c')]]){_[_0x66df('0x1e')](this[_0x66df('0x9')][_0x3c0048[_0x66df('0x1c')]],{'starttime':moment()[_0x66df('0x1f')](_0x66df('0x20')),'lastevent':'called','interface':_0x3c0048['channel']['substring'](0x0,_0x3c0048[_0x66df('0x21')][_0x66df('0x22')]('-')),'membername':_0x3c0048[_0x66df('0x21')][_0x66df('0x23')](_0x3c0048[_0x66df('0x21')][_0x66df('0x22')]('/')+0x1,_0x3c0048['channel'][_0x66df('0x22')]('-'))},_[_0x66df('0x24')](_0x3c0048,[_0x66df('0x25'),_0x66df('0x26')]));logger[_0x66df('0x27')](_0x66df('0x28'),_0x3c0048[_0x66df('0x1c')],this[_0x66df('0x9')][_0x3c0048[_0x66df('0x1c')]][_0x66df('0x29')],this[_0x66df('0x9')][_0x3c0048[_0x66df('0x1c')]][_0x66df('0x2a')]);logger['debug'](_0x66df('0x2b'),_0x3c0048[_0x66df('0x1c')],util['inspect'](this[_0x66df('0x9')][_0x3c0048[_0x66df('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0x66df('0xc')][_0x3c0048['uniqueid']])_[_0x66df('0x1e')](this[_0x66df('0x9')][_0x3c0048['uniqueid']],this[_0x66df('0xc')][_0x3c0048[_0x66df('0x1c')]]);this[_0x66df('0x17')](_0x66df('0x2c'),_0x66df('0x2d'),this[_0x66df('0x9')][_0x3c0048[_0x66df('0x1c')]]);logger[_0x66df('0x1a')](_0x66df('0x2e'),_0x3c0048['uniqueid'],util[_0x66df('0x1d')](this['channels'][_0x3c0048[_0x66df('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x66df('0x17')](_0x66df('0x2f'),this[_0x66df('0x9')][_0x3c0048[_0x66df('0x1c')]]);}}}catch(_0x274179){logger[_0x66df('0x30')]('[%s][voiceDialReport][dialbegin]',_0x3c0048[_0x66df('0x1c')],util[_0x66df('0x1d')](_0x274179,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x66df('0x18')][_0x66df('0x11')]=function(_0x4e7df7){try{if(this[_0x66df('0x31')](_0x4e7df7)){logger['debug'](_0x66df('0x32'),_0x4e7df7[_0x66df('0x1c')],util[_0x66df('0x1d')](_0x4e7df7,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e7df7['uniqueid']]){this[_0x66df('0x9')][_0x4e7df7[_0x66df('0x1c')]][_0x66df('0x33')]=_0x4e7df7[_0x66df('0x33')];if(_0x4e7df7[_0x66df('0x33')]===_0x66df('0x34')){this[_0x66df('0x9')][_0x4e7df7[_0x66df('0x1c')]][_0x66df('0x35')]=_0x4e7df7[_0x66df('0x35')];this['channels'][_0x4e7df7['uniqueid']]['connectedlinename']=_0x4e7df7[_0x66df('0x36')];this[_0x66df('0x9')][_0x4e7df7[_0x66df('0x1c')]]['answertime']=moment()[_0x66df('0x1f')](_0x66df('0x20'));this[_0x66df('0x9')][_0x4e7df7[_0x66df('0x1c')]][_0x66df('0x37')]=_0x66df('0x38');logger[_0x66df('0x27')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x4e7df7['uniqueid'],_0x4e7df7['channel'][_0x66df('0x23')](_0x4e7df7[_0x66df('0x21')]['lastIndexOf']('/')+0x1,_0x4e7df7[_0x66df('0x21')][_0x66df('0x22')]('-')));logger[_0x66df('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x4e7df7[_0x66df('0x1c')],util[_0x66df('0x1d')](this[_0x66df('0x9')][_0x4e7df7[_0x66df('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x66df('0x39'),this[_0x66df('0x9')][_0x4e7df7[_0x66df('0x1c')]]);}logger[_0x66df('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4e7df7[_0x66df('0x1c')],util[_0x66df('0x1d')](this['channels'][_0x4e7df7[_0x66df('0x1c')]],{'showHidden':![],'depth':null}));this['emit'](_0x66df('0x2c'),_0x66df('0x2d'),this[_0x66df('0x9')][_0x4e7df7[_0x66df('0x1c')]]);}}}catch(_0x4f9347){logger['error'](_0x66df('0x3a'),_0x4e7df7[_0x66df('0x1c')],util['inspect'](_0x4f9347,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x66df('0x18')]['syncVarSet']=function(_0x534d4c){try{if(this[_0x66df('0x31')](_0x534d4c)){logger[_0x66df('0x1a')](_0x66df('0x3b'),_0x534d4c[_0x66df('0x1c')],util[_0x66df('0x1d')](_0x534d4c,{'showHidden':![],'depth':null}));this[_0x66df('0x3c')](_0x534d4c[_0x66df('0x1c')],_[_0x66df('0x3d')](_0x534d4c['variable'])[0x0],_0x534d4c[_0x66df('0x3e')]);if(this[_0x66df('0x31')](_0x534d4c[_0x66df('0x3f')])&&this[_0x66df('0x31')](_0x534d4c['variable'][_0x66df('0x40')])){if(_[_0x66df('0x16')](this[_0x66df('0x9')][_0x534d4c[_0x66df('0x1c')]])){this[_0x66df('0x9')][_0x534d4c[_0x66df('0x1c')]]={'routeId':_0x534d4c[_0x66df('0x3e')],'variables':this[_0x66df('0xd')][_0x534d4c['uniqueid']],'motionChannel':_0x66df('0x41')};logger['info'](_0x66df('0x42'),_0x534d4c[_0x66df('0x1c')],_0x534d4c['variable'][_0x66df('0x40')],_[_0x66df('0x3d')](_0x534d4c[_0x66df('0x3f')])[0x0],_0x534d4c['value']);logger[_0x66df('0x1a')](_0x66df('0x43'),_0x534d4c[_0x66df('0x1c')],util['inspect'](this[_0x66df('0x9')][_0x534d4c['uniqueid']],{'showHidden':![],'depth':null}));this[_0x66df('0x17')](_0x66df('0x2c'),_0x66df('0x2d'),this[_0x66df('0x9')][_0x534d4c['uniqueid']]);}}}}catch(_0x56e41e){logger[_0x66df('0x30')]('[%s][voiceDialReport][varset]',_0x534d4c['uniqueid'],util[_0x66df('0x1d')](_0x56e41e,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x66df('0x3c')]=function(_0x1456c9,_0x24914e,_0x46a338){var _0x4fa8f4=[_0x66df('0x44'),'rtpaudioqosbridged',_0x66df('0x45'),'rtpaudioqosjitterbridged',_0x66df('0x46'),_0x66df('0x47'),_0x66df('0x48'),_0x66df('0x49'),'sipcallid','sipuri',_0x66df('0x4a'),_0x66df('0x4b'),'membercalls',_0x66df('0x4c'),_0x66df('0x4d'),_0x66df('0x4e'),_0x66df('0x29'),'memberpenalty',_0x66df('0x4f')];if(!_[_0x66df('0x50')](_0x24914e)&&!_[_0x66df('0x51')](_0x4fa8f4,_0x24914e)){if(_[_0x66df('0x16')](this[_0x66df('0xd')][_0x1456c9])){this['variables'][_0x1456c9]={};}this[_0x66df('0xd')][_0x1456c9][_0x24914e]=_0x46a338;}};VoiceDialReport[_0x66df('0x18')]['syncHangup']=function(_0x2fd7d9){try{if(this[_0x66df('0x31')](_0x2fd7d9)){logger[_0x66df('0x1a')]('[%s][voiceDialReport][hangup]\x20event:',_0x2fd7d9[_0x66df('0x1c')],util['inspect'](_0x2fd7d9,{'showHidden':![],'depth':null}));if(this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]]){logger[_0x66df('0x27')](_0x66df('0x52'),_0x2fd7d9['uniqueid'],_0x2fd7d9[_0x66df('0x53')]);this['channels'][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x54')]=moment()[_0x66df('0x1f')](_0x66df('0x20'));this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]]['duration']=moment(this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x54')])[_0x66df('0x55')](this['channels'][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x56')],_0x66df('0x57'));this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x37')]=_0x66df('0x58');this['outbound'][_0x66df('0x59')]+=0x1;if(this['channels'][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x5a')]){this['outbound'][_0x66df('0x5b')]+=0x1;this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]]['holdtime']=moment(this['channels'][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x5a')])['diff'](this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]]['starttime'],_0x66df('0x57'));this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x5c')]=moment(this[_0x66df('0x9')][_0x2fd7d9['uniqueid']][_0x66df('0x54')])[_0x66df('0x55')](this['channels'][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x5a')],'seconds');this[_0x66df('0xb')][_0x66df('0x5d')]+=this[_0x66df('0x9')][_0x2fd7d9['uniqueid']][_0x66df('0x5e')]||0x0;this[_0x66df('0xb')]['sumBillable']+=this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x5c')];}this[_0x66df('0xb')][_0x66df('0x5f')]+=this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]][_0x66df('0x60')];logger['debug'](_0x66df('0x61'),_0x2fd7d9[_0x66df('0x1c')],util[_0x66df('0x1d')](this['channels'][_0x2fd7d9[_0x66df('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x66df('0x17')](_0x66df('0x62'),this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]]);logger[_0x66df('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x2fd7d9['uniqueid'],util[_0x66df('0x1d')](this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x66df('0x17')]('custom:dialend',this['channels'][_0x2fd7d9['uniqueid']]);logger[_0x66df('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x2fd7d9['uniqueid'],util[_0x66df('0x1d')](this['channels'][_0x2fd7d9['uniqueid']],{'showHidden':![],'depth':null}));this[_0x66df('0x17')](_0x66df('0x2c'),'voice_outbound:save',this[_0x66df('0xb')]);logger['info'](_0x66df('0x63'),JSON[_0x66df('0x64')](this[_0x66df('0x9')][_0x2fd7d9['uniqueid']]));logger[_0x66df('0x1a')](_0x66df('0x65'),_0x2fd7d9[_0x66df('0x1c')],util['inspect'](this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]],{'showHidden':![],'depth':null}));this[_0x66df('0x17')](_0x66df('0x2c'),_0x66df('0x66'),this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x1c')]]);this['deleteChannelAfterTimeout'](_0x2fd7d9[_0x66df('0x1c')]);}else if(this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x67')]]){this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x67')]]['uniqueid']=this[_0x66df('0x9')][_0x2fd7d9[_0x66df('0x67')]][_0x66df('0x68')];}if(this[_0x66df('0xd')][_0x2fd7d9[_0x66df('0x1c')]]){delete this[_0x66df('0xd')][_0x2fd7d9[_0x66df('0x1c')]];}}}catch(_0x306568){logger[_0x66df('0x30')]('[%s][voiceDialReport][hangup]',_0x2fd7d9[_0x66df('0x1c')],util[_0x66df('0x1d')](_0x306568,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x66df('0x18')][_0x66df('0x69')]=function(_0x11b1b0){try{if(this[_0x66df('0x31')](_0x11b1b0)){logger[_0x66df('0x1a')](_0x66df('0x6a'),_0x11b1b0['uniqueid'],util[_0x66df('0x1d')](_0x11b1b0,{'showHidden':![],'depth':null}));if(_0x11b1b0[_0x66df('0x6b')]['toLowerCase']()===_0x66df('0x6c')){_0x11b1b0[_0x66df('0x6d')]=(_0x11b1b0['appdata']||_0x11b1b0[_0x66df('0x6d')])[_0x66df('0x6e')]();if(_[_0x66df('0x6f')](_0x11b1b0['applicationdata'],'cdr(')){if(_[_0x66df('0x16')](this[_0x66df('0xc')][_0x11b1b0[_0x66df('0x1c')]]))this[_0x66df('0xc')][_0x11b1b0[_0x66df('0x1c')]]={};logger[_0x66df('0x27')](_0x66df('0x70'),_0x11b1b0['uniqueid'],_0x11b1b0[_0x66df('0x6b')],_0x11b1b0[_0x66df('0x6d')]);var _0xaeebf2=_0x11b1b0[_0x66df('0x6d')]['split']('=');var _0x5eb33c=_0xaeebf2[0x0]['match'](/cdr\((.*)\)/);if(_0x5eb33c)this[_0x66df('0xc')][_0x11b1b0[_0x66df('0x1c')]][_0x5eb33c[0x1]]=_0xaeebf2[0x1];}}}}catch(_0xb7b71a){logger[_0x66df('0x30')](_0x66df('0x71'),_0x11b1b0[_0x66df('0x1c')],util['inspect'](_0xb7b71a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x66df('0x18')][_0x66df('0x72')]=function(_0x565c39,_0x24b5ec=0x2710){if(this['channels'][_0x565c39]){setTimeout(()=>{delete this[_0x66df('0x9')][_0x565c39];},_0x24b5ec);}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0xdfaa=['omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','error','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','duration','endtime','diff','seconds','total','answered','holdtime','starttime','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','deleteChannelAfterTimeout','linkedid','[%s][voiceDialReport][hangup]','syncNewExten','application','set','appdata','toLowerCase','startsWith','applicationdata','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','applications','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isUndefined','emit','syncDialBegin','isNotNull','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','lastIndexOf','channel'];(function(_0x142422,_0x316c14){var _0x48d830=function(_0x510623){while(--_0x510623){_0x142422['push'](_0x142422['shift']());}};_0x48d830(++_0x316c14);}(_0xdfaa,0xd0));var _0xadfa=function(_0x295d00,_0x1e47a2){_0x295d00=_0x295d00-0x0;var _0x44e718=_0xdfaa[_0x295d00];return _0x44e718;};'use strict';var _=require(_0xadfa('0x0'));var moment=require(_0xadfa('0x1'));var util=require(_0xadfa('0x2'));var Redis=require(_0xadfa('0x3'));var config=require(_0xadfa('0x4'));var logger=require(_0xadfa('0x5'))(_0xadfa('0x6'));var ami=require(_0xadfa('0x7'));config[_0xadfa('0x8')]=_[_0xadfa('0x9')](config['redis'],{'host':_0xadfa('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x4eb8c3){this[_0xadfa('0xb')]=_0x4eb8c3[_0xadfa('0xc')];this[_0xadfa('0xd')]=_0x4eb8c3[_0xadfa('0xd')];this[_0xadfa('0xe')]={};this[_0xadfa('0xf')]={};ami['on'](_0xadfa('0x10'),this['syncDialBegin'][_0xadfa('0x11')](this));ami['on'](_0xadfa('0x12'),this[_0xadfa('0x13')][_0xadfa('0x11')](this));ami['on'](_0xadfa('0x14'),this[_0xadfa('0x15')][_0xadfa('0x11')](this));ami['on'](_0xadfa('0x16'),this[_0xadfa('0x17')][_0xadfa('0x11')](this));}VoiceDialReport[_0xadfa('0x18')]['isNotNull']=function(_0x1f0560){return _0x1f0560!==null&&!_[_0xadfa('0x19')](_0x1f0560);};VoiceDialReport[_0xadfa('0x18')]['emit']=function(_0x8f7b7,_0x9f6c09,_0x53b1da){io['to'](_0x8f7b7)[_0xadfa('0x1a')](_0x9f6c09,_0x53b1da);};VoiceDialReport[_0xadfa('0x18')][_0xadfa('0x1b')]=function(_0xe6608){try{if(this[_0xadfa('0x1c')](_0xe6608)){logger['debug'](_0xadfa('0x1d'),_0xe6608['uniqueid'],util['inspect'](_0xe6608,{'showHidden':![],'depth':null}));if(this[_0xadfa('0xb')][_0xe6608[_0xadfa('0x1e')]]){_[_0xadfa('0x1f')](this[_0xadfa('0xb')][_0xe6608['uniqueid']],{'starttime':moment()[_0xadfa('0x20')](_0xadfa('0x21')),'lastevent':_0xadfa('0x22'),'interface':_0xe6608['channel'][_0xadfa('0x23')](0x0,_0xe6608['channel'][_0xadfa('0x24')]('-')),'membername':_0xe6608[_0xadfa('0x25')][_0xadfa('0x23')](_0xe6608['channel'][_0xadfa('0x24')]('/')+0x1,_0xe6608[_0xadfa('0x25')]['lastIndexOf']('-'))},_[_0xadfa('0x26')](_0xe6608,[_0xadfa('0x27'),'privilege']));logger[_0xadfa('0x28')](_0xadfa('0x29'),_0xe6608[_0xadfa('0x1e')],this[_0xadfa('0xb')][_0xe6608['uniqueid']][_0xadfa('0x2a')],this[_0xadfa('0xb')][_0xe6608[_0xadfa('0x1e')]][_0xadfa('0x2b')]);logger[_0xadfa('0x2c')](_0xadfa('0x2d'),_0xe6608[_0xadfa('0x1e')],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0xe6608[_0xadfa('0x1e')]],{'showHidden':![],'depth':null}));if(this['applications'][_0xe6608['uniqueid']])_[_0xadfa('0x1f')](this[_0xadfa('0xb')][_0xe6608[_0xadfa('0x1e')]],this[_0xadfa('0xe')][_0xe6608['uniqueid']]);this[_0xadfa('0x1a')](_0xadfa('0x2f'),_0xadfa('0x30'),this[_0xadfa('0xb')][_0xe6608['uniqueid']]);logger[_0xadfa('0x2c')](_0xadfa('0x31'),_0xe6608[_0xadfa('0x1e')],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0xe6608['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xadfa('0x1a')](_0xadfa('0x32'),this[_0xadfa('0xb')][_0xe6608[_0xadfa('0x1e')]]);}}}catch(_0x3e67cd){logger['error'](_0xadfa('0x33'),_0xe6608[_0xadfa('0x1e')],util[_0xadfa('0x2e')](_0x3e67cd,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xadfa('0x13')]=function(_0x17f92c){try{if(this[_0xadfa('0x1c')](_0x17f92c)){logger['debug'](_0xadfa('0x34'),_0x17f92c[_0xadfa('0x1e')],util[_0xadfa('0x2e')](_0x17f92c,{'showHidden':![],'depth':null}));if(this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]]){this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]]['dialstatus']=_0x17f92c[_0xadfa('0x35')];if(_0x17f92c[_0xadfa('0x35')]===_0xadfa('0x36')){this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]][_0xadfa('0x37')]=_0x17f92c[_0xadfa('0x37')];this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]][_0xadfa('0x38')]=_0x17f92c[_0xadfa('0x38')];this[_0xadfa('0xb')][_0x17f92c['uniqueid']][_0xadfa('0x39')]=moment()['format'](_0xadfa('0x21'));this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]][_0xadfa('0x3a')]=_0xadfa('0x3b');logger[_0xadfa('0x28')](_0xadfa('0x3c'),_0x17f92c[_0xadfa('0x1e')],_0x17f92c['channel']['substring'](_0x17f92c[_0xadfa('0x25')][_0xadfa('0x24')]('/')+0x1,_0x17f92c['channel'][_0xadfa('0x24')]('-')));logger[_0xadfa('0x2c')](_0xadfa('0x3d'),_0x17f92c[_0xadfa('0x1e')],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xadfa('0x1a')](_0xadfa('0x3e'),this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]]);}logger[_0xadfa('0x2c')](_0xadfa('0x3f'),_0x17f92c['uniqueid'],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]],{'showHidden':![],'depth':null}));this[_0xadfa('0x1a')](_0xadfa('0x2f'),_0xadfa('0x30'),this[_0xadfa('0xb')][_0x17f92c[_0xadfa('0x1e')]]);}}}catch(_0x9c9e51){logger['error'](_0xadfa('0x40'),_0x17f92c[_0xadfa('0x1e')],util[_0xadfa('0x2e')](_0x9c9e51,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xadfa('0x18')]['syncVarSet']=function(_0x253283){try{if(this[_0xadfa('0x1c')](_0x253283)){logger[_0xadfa('0x2c')](_0xadfa('0x41'),_0x253283[_0xadfa('0x1e')],util[_0xadfa('0x2e')](_0x253283,{'showHidden':![],'depth':null}));this[_0xadfa('0x42')](_0x253283['uniqueid'],_[_0xadfa('0x43')](_0x253283[_0xadfa('0x44')])[0x0],_0x253283[_0xadfa('0x45')]);if(this[_0xadfa('0x1c')](_0x253283['variable'])&&this[_0xadfa('0x1c')](_0x253283[_0xadfa('0x44')][_0xadfa('0x46')])){if(_[_0xadfa('0x19')](this[_0xadfa('0xb')][_0x253283['uniqueid']])){this[_0xadfa('0xb')][_0x253283[_0xadfa('0x1e')]]={'routeId':_0x253283[_0xadfa('0x45')],'variables':this[_0xadfa('0xf')][_0x253283['uniqueid']],'motionChannel':'voice'};logger['info'](_0xadfa('0x47'),_0x253283[_0xadfa('0x1e')],_0x253283['variable'][_0xadfa('0x46')],_[_0xadfa('0x43')](_0x253283[_0xadfa('0x44')])[0x0],_0x253283['value']);logger[_0xadfa('0x2c')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x253283['uniqueid'],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0x253283[_0xadfa('0x1e')]],{'showHidden':![],'depth':null}));this[_0xadfa('0x1a')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x253283[_0xadfa('0x1e')]]);}}}}catch(_0x510757){logger[_0xadfa('0x48')](_0xadfa('0x49'),_0x253283[_0xadfa('0x1e')],util[_0xadfa('0x2e')](_0x510757,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xadfa('0x18')]['addVariable']=function(_0x4822de,_0x45456e,_0x27771c){var _0x3472de=[_0xadfa('0x4a'),_0xadfa('0x4b'),'rtpaudioqosjitter',_0xadfa('0x4c'),_0xadfa('0x4d'),_0xadfa('0x4e'),_0xadfa('0x4f'),_0xadfa('0x50'),_0xadfa('0x51'),_0xadfa('0x52'),_0xadfa('0x53'),_0xadfa('0x54'),_0xadfa('0x55'),'memberdynamic','memberinterface',_0xadfa('0x56'),_0xadfa('0x2a'),_0xadfa('0x57'),_0xadfa('0x58')];if(!_[_0xadfa('0x59')](_0x45456e)&&!_[_0xadfa('0x5a')](_0x3472de,_0x45456e)){if(_[_0xadfa('0x19')](this[_0xadfa('0xf')][_0x4822de])){this[_0xadfa('0xf')][_0x4822de]={};}this[_0xadfa('0xf')][_0x4822de][_0x45456e]=_0x27771c;}};VoiceDialReport[_0xadfa('0x18')][_0xadfa('0x17')]=function(_0x3ed778){try{if(this['isNotNull'](_0x3ed778)){logger['debug']('[%s][voiceDialReport][hangup]\x20event:',_0x3ed778['uniqueid'],util[_0xadfa('0x2e')](_0x3ed778,{'showHidden':![],'depth':null}));if(this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]]){logger[_0xadfa('0x28')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x3ed778[_0xadfa('0x1e')],_0x3ed778['cause-txt']);this[_0xadfa('0xb')][_0x3ed778['uniqueid']]['endtime']=moment()['format'](_0xadfa('0x21'));this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]][_0xadfa('0x5b')]=moment(this[_0xadfa('0xb')][_0x3ed778['uniqueid']][_0xadfa('0x5c')])[_0xadfa('0x5d')](this[_0xadfa('0xb')][_0x3ed778['uniqueid']]['starttime'],_0xadfa('0x5e'));this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]][_0xadfa('0x3a')]='complete';this[_0xadfa('0xd')][_0xadfa('0x5f')]+=0x1;if(this['channels'][_0x3ed778[_0xadfa('0x1e')]][_0xadfa('0x39')]){this[_0xadfa('0xd')][_0xadfa('0x60')]+=0x1;this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]][_0xadfa('0x61')]=moment(this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]]['answertime'])[_0xadfa('0x5d')](this[_0xadfa('0xb')][_0x3ed778['uniqueid']][_0xadfa('0x62')],_0xadfa('0x5e'));this['channels'][_0x3ed778[_0xadfa('0x1e')]]['billableseconds']=moment(this[_0xadfa('0xb')][_0x3ed778['uniqueid']][_0xadfa('0x5c')])['diff'](this[_0xadfa('0xb')][_0x3ed778['uniqueid']][_0xadfa('0x39')],_0xadfa('0x5e'));this[_0xadfa('0xd')][_0xadfa('0x63')]+=this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]][_0xadfa('0x61')]||0x0;this[_0xadfa('0xd')][_0xadfa('0x64')]+=this['channels'][_0x3ed778[_0xadfa('0x1e')]]['billableseconds'];}this['outbound'][_0xadfa('0x65')]+=this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]][_0xadfa('0x5b')];logger[_0xadfa('0x2c')](_0xadfa('0x66'),_0x3ed778['uniqueid'],util[_0xadfa('0x2e')](this['channels'][_0x3ed778['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xadfa('0x1a')](_0xadfa('0x67'),this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]]);logger[_0xadfa('0x2c')](_0xadfa('0x68'),_0x3ed778[_0xadfa('0x1e')],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0x3ed778['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xadfa('0x1a')]('custom:dialend',this[_0xadfa('0xb')][_0x3ed778['uniqueid']]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x3ed778[_0xadfa('0x1e')],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]],{'showHidden':![],'depth':null}));this[_0xadfa('0x1a')](_0xadfa('0x2f'),_0xadfa('0x69'),this['outbound']);logger['info'](_0xadfa('0x6a'),JSON['stringify'](this['channels'][_0x3ed778[_0xadfa('0x1e')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x3ed778[_0xadfa('0x1e')],util[_0xadfa('0x2e')](this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]],{'showHidden':![],'depth':null}));this[_0xadfa('0x1a')]('voice:outbound',_0xadfa('0x6b'),this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x1e')]]);this[_0xadfa('0x6c')](_0x3ed778['uniqueid']);}else if(this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x6d')]]){this[_0xadfa('0xb')][_0x3ed778['linkedid']][_0xadfa('0x1e')]=this[_0xadfa('0xb')][_0x3ed778[_0xadfa('0x6d')]]['destuniqueid'];}if(this[_0xadfa('0xf')][_0x3ed778[_0xadfa('0x1e')]]){delete this[_0xadfa('0xf')][_0x3ed778[_0xadfa('0x1e')]];}}}catch(_0x1a5f9a){logger[_0xadfa('0x48')](_0xadfa('0x6e'),_0x3ed778[_0xadfa('0x1e')],util[_0xadfa('0x2e')](_0x1a5f9a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xadfa('0x18')][_0xadfa('0x6f')]=function(_0x21e736){try{if(this['isNotNull'](_0x21e736)){logger[_0xadfa('0x2c')]('[%s][voiceDialReport][newexten]\x20event:',_0x21e736[_0xadfa('0x1e')],util[_0xadfa('0x2e')](_0x21e736,{'showHidden':![],'depth':null}));if(_0x21e736[_0xadfa('0x70')]['toLowerCase']()===_0xadfa('0x71')){_0x21e736['applicationdata']=(_0x21e736[_0xadfa('0x72')]||_0x21e736['applicationdata'])[_0xadfa('0x73')]();if(_[_0xadfa('0x74')](_0x21e736[_0xadfa('0x75')],'cdr(')){if(_[_0xadfa('0x19')](this[_0xadfa('0xe')][_0x21e736[_0xadfa('0x1e')]]))this[_0xadfa('0xe')][_0x21e736[_0xadfa('0x1e')]]={};logger['info'](_0xadfa('0x76'),_0x21e736[_0xadfa('0x1e')],_0x21e736[_0xadfa('0x70')],_0x21e736[_0xadfa('0x75')]);var _0x28bc30=_0x21e736['applicationdata'][_0xadfa('0x77')]('=');var _0x25dddd=_0x28bc30[0x0][_0xadfa('0x78')](/cdr\((.*)\)/);if(_0x25dddd)this[_0xadfa('0xe')][_0x21e736[_0xadfa('0x1e')]][_0x25dddd[0x1]]=_0x28bc30[0x1];}}}}catch(_0x32be8f){logger[_0xadfa('0x48')](_0xadfa('0x79'),_0x21e736['uniqueid'],util['inspect'](_0x32be8f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xadfa('0x18')]['deleteChannelAfterTimeout']=function(_0x1efb43,_0x135698=0x2710){if(this[_0xadfa('0xb')][_0x1efb43]){setTimeout(()=>{delete this[_0xadfa('0xb')][_0x1efb43];},_0x135698);}};module[_0xadfa('0x7a')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 15df146..b9ce092 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca79=['[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','Action','queues','[voiceQueueReport][queues]','isRunning','queuesummary','queuestatus','[voiceQueueReport][queuesummary]','summaryEvent','handleInboundQueueSummaryReport','createQueueSummaryReport','compareToInboundQueue','assign','actionid','inbound','outbound','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','YYYY-MM-DD\x20HH:mm:ss','position','count','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','queuecallerleaveAt','connectedlinename','connectedlinenum','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','info','syncAgentComplete','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','queuecallerjoinAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','sumHoldTime','ATTENDEDTRANSFER','length','milliseconds','diff','total','answered','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','sumDuration','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','custom:voiceQueueReport','deleteChannelAfterTimeout','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','application','appdata','applicationdata','cdr(','split','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','defaults','localhost','redis','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','channels','queueChannels','voiceQueues','campaigns','summary','variables','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuemember','syncQueueMember','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','originated','isEmpty','talking','pTalking','waiting','unlockRR','queuecallerabandon','queuecallercomplete','clearZombieChannels','isNil','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','queue','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type'];(function(_0x569d81,_0xa7b4c7){var _0x172cf0=function(_0x436a01){while(--_0x436a01){_0x569d81['push'](_0x569d81['shift']());}};_0x172cf0(++_0xa7b4c7);}(_0xca79,0x99));var _0x9ca7=function(_0xcad337,_0xe6d7d3){_0xcad337=_0xcad337-0x0;var _0x1bd207=_0xca79[_0xcad337];return _0x1bd207;};'use strict';var _=require(_0x9ca7('0x0'));var moment=require(_0x9ca7('0x1'));var util=require(_0x9ca7('0x2'));var Redis=require(_0x9ca7('0x3'));var config=require('../../../config/environment');var logger=require(_0x9ca7('0x4'))(_0x9ca7('0x5'));var ami=require(_0x9ca7('0x6'));var QueueReport=require(_0x9ca7('0x7'));var VoiceQueueSummary=require(_0x9ca7('0x8'));config['redis']=_[_0x9ca7('0x9')](config['redis'],{'host':_0x9ca7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9ca7('0xb')]));var Sequence=function(){};Sequence[_0x9ca7('0xc')][_0x9ca7('0xd')]=function(_0x535438){this[_0x9ca7('0xe')]=this['tail']?this[_0x9ca7('0xe')][_0x9ca7('0xf')](_0x535438):_0x535438();};function VoiceQueueReport(_0x1d6ff5){this[_0x9ca7('0x10')]=new Sequence();this[_0x9ca7('0x11')]={};this[_0x9ca7('0x12')]=_0x1d6ff5;this['agents']=_0x1d6ff5[_0x9ca7('0x13')];this[_0x9ca7('0x14')]=_0x1d6ff5[_0x9ca7('0x15')];this['voiceQueues']=_0x1d6ff5[_0x9ca7('0x16')];this['campaigns']=_0x1d6ff5[_0x9ca7('0x17')];this[_0x9ca7('0x18')]=initializeSummary();this[_0x9ca7('0x19')]={};ami['on']('queuesummary',this[_0x9ca7('0x1a')]['bind'](this));ami['on'](_0x9ca7('0x1b'),this[_0x9ca7('0x1c')][_0x9ca7('0x1d')](this));ami['on'](_0x9ca7('0x1e'),this[_0x9ca7('0x1f')][_0x9ca7('0x1d')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));ami['on'](_0x9ca7('0x20'),this[_0x9ca7('0x21')][_0x9ca7('0x1d')](this));ami['on']('queuecallerabandon',this[_0x9ca7('0x22')][_0x9ca7('0x1d')](this));ami['on'](_0x9ca7('0x23'),this['syncQueueCallerLeave'][_0x9ca7('0x1d')](this));ami['on'](_0x9ca7('0x24'),this['syncAgentComplete'][_0x9ca7('0x1d')](this));ami['on'](_0x9ca7('0x25'),this[_0x9ca7('0x26')][_0x9ca7('0x1d')](this));ami['on'](_0x9ca7('0x27'),this[_0x9ca7('0x28')]['bind'](this));ami['on'](_0x9ca7('0x29'),this[_0x9ca7('0x2a')][_0x9ca7('0x1d')](this));ami['on'](_0x9ca7('0x2b'),this[_0x9ca7('0x2c')]['bind'](this));ami['on']('musiconholdstart',this[_0x9ca7('0x2d')][_0x9ca7('0x1d')](this));ami['on'](_0x9ca7('0x2e'),this[_0x9ca7('0x2f')][_0x9ca7('0x1d')](this));ami['on']('attendedtransfer',this[_0x9ca7('0x30')][_0x9ca7('0x1d')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0x9ca7('0x31')]();this[_0x9ca7('0x32')]();}function clearChannels(_0x500d77){if(!_['isEmpty'](_0x500d77)){for(var _0x182079 in _0x500d77){if(_0x500d77[_0x9ca7('0x33')](_0x182079)){delete _0x500d77[_0x182079];}}}}function clearCampaigns(_0x123da2){if(!_['isEmpty'](_0x123da2)){for(var _0x25226d in _0x123da2){if(_0x123da2[_0x9ca7('0x33')](_0x25226d)){_0x123da2[_0x25226d][_0x9ca7('0x34')]=0x0;}}}}function clearVoiceQueues(_0x1f5cf8){if(!_[_0x9ca7('0x35')](_0x1f5cf8)){for(var _0x1f6ea0 in _0x1f5cf8){if(_0x1f5cf8[_0x9ca7('0x33')](_0x1f6ea0)){_0x1f5cf8[_0x1f6ea0][_0x9ca7('0x34')]=0x0;_0x1f5cf8[_0x1f6ea0][_0x9ca7('0x36')]=0x0;_0x1f5cf8[_0x1f6ea0][_0x9ca7('0x37')]=0x0;_0x1f5cf8[_0x1f6ea0][_0x9ca7('0x38')]=0x0;_0x1f5cf8[_0x1f6ea0]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x597748){if(!_[_0x9ca7('0x35')](_0x597748)){for(var _0x5bc409 in _0x597748){if(_0x597748[_0x9ca7('0x33')](_0x5bc409)){_0x597748[_0x5bc409][_0x9ca7('0x39')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x1dc175){return _0x1dc175['queuecallerexit']||_0x1dc175[_0x9ca7('0x3a')]||_0x1dc175[_0x9ca7('0x3b')];}VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x3c')]=function(){var _0x172349=this;for(var _0x2886ca in this[_0x9ca7('0x14')]){if(this[_0x9ca7('0x14')]['hasOwnProperty'](_0x2886ca)&&!this[_0x9ca7('0x14')][_0x2886ca]['switch']){this[_0x9ca7('0x10')][_0x9ca7('0xd')](function(){if(!_[_0x9ca7('0x3d')](_0x172349[_0x9ca7('0x14')][_0x2886ca])){return ami['Action']({'action':_0x9ca7('0x3e'),'channel':_0x172349['channels'][_0x2886ca][_0x9ca7('0x3f')]})[_0x9ca7('0x40')](function(_0x304bd6){if(_0x304bd6[_0x9ca7('0x41')]===_0x9ca7('0x42')){setTimeout(function(){if(_0x172349['channels'][_0x2886ca]){delete _0x172349['channels'][_0x2886ca];logger[_0x9ca7('0x43')](_0x9ca7('0x44'),_0x2886ca,util[_0x9ca7('0x45')](_0x304bd6,{'showHidden':![],'depth':null}));}if(_0x172349[_0x9ca7('0x11')][_0x2886ca]){delete _0x172349[_0x9ca7('0x11')][_0x2886ca];logger[_0x9ca7('0x43')](_0x9ca7('0x46'),_0x2886ca,util[_0x9ca7('0x45')](_0x304bd6,{'showHidden':![],'depth':null}));}if(_0x172349['variables'][_0x2886ca]){delete _0x172349[_0x9ca7('0x19')][_0x2886ca];logger[_0x9ca7('0x43')](_0x9ca7('0x47'),_0x2886ca,util['inspect'](_0x304bd6,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x2c')]=function(){logger['error'](_0x9ca7('0x48'));clearChannels(this[_0x9ca7('0x14')]);this['clearQueueReport'](this[_0x9ca7('0x11')]);clearAgentBooked(this[_0x9ca7('0x13')]);clearVoiceQueues(this[_0x9ca7('0x16')]);clearCampaigns(this[_0x9ca7('0x17')]);this['summary']=initializeSummary();};VoiceQueueReport['prototype'][_0x9ca7('0x49')]=function(_0x2861cf){var _0x2fb9ce=this;if(!_['isEmpty'](_0x2861cf)){for(var _0x4e6e00 in _0x2861cf){if(_0x2861cf[_0x9ca7('0x33')](_0x4e6e00)){_0x2fb9ce[_0x9ca7('0x4a')](_0x2861cf[_0x4e6e00],_0x9ca7('0x4b'));delete _0x2861cf[_0x4e6e00];}}}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x4c')]=function(_0x77146e,_0x5685dd,_0x5d27f1){io['to'](_0x77146e)[_0x9ca7('0x4c')](_0x5685dd,_0x5d27f1);};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x4d')]=function(_0x36d278,_0x5a60e7){logger['debug'](_0x9ca7('0x4e')+_0x5a60e7+']\x20sending\x20voice_queue_channel:save\x20event:',_0x36d278[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x36d278,{'showHidden':![],'depth':null}));this[_0x9ca7('0x4c')](util[_0x9ca7('0x50')](_0x9ca7('0x51'),_0x36d278[_0x9ca7('0x52')]),'voice_queue_channel:save',_0x36d278);io['emit'](_0x9ca7('0x53'),_0x36d278);};VoiceQueueReport[_0x9ca7('0xc')]['emitVoiceQueueChannelRemove']=function(_0x2a6b7a,_0x2bfbe8){logger[_0x9ca7('0x54')](_0x9ca7('0x4e')+_0x2bfbe8+_0x9ca7('0x55'),_0x2a6b7a[_0x9ca7('0x4f')],util['inspect'](_0x2a6b7a,{'showHidden':![],'depth':null}));if(_0x2a6b7a[_0x9ca7('0x56')]==='ATTENDEDTRANSFER'){return;}this[_0x9ca7('0x4c')](util[_0x9ca7('0x50')](_0x9ca7('0x51'),_0x2a6b7a['queue']),_0x9ca7('0x57'),_0x2a6b7a);io['emit'](_0x9ca7('0x58'),_0x2a6b7a);};VoiceQueueReport['prototype'][_0x9ca7('0x59')]=function(_0x57a4e4){if(_0x57a4e4[_0x9ca7('0x5a')]==='inbound'){logger[_0x9ca7('0x54')](_0x9ca7('0x5b'),util[_0x9ca7('0x45')](_0x57a4e4,{'showHidden':![],'depth':null}));this['emit'](util[_0x9ca7('0x50')](_0x9ca7('0x51'),_0x57a4e4[_0x9ca7('0x5c')]),_0x9ca7('0x5d'),_0x57a4e4);}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x5e')]=function(_0x2b9eb7){return _0x2b9eb7!==null&&!_['isUndefined'](_0x2b9eb7);};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x32')]=function(){var _0xd7f9b3=this;setInterval(function(){_0xd7f9b3[_0x9ca7('0x3c')]();ami[_0x9ca7('0x5f')]({'action':_0x9ca7('0x60')})[_0x9ca7('0x40')](function(_0x54a094){logger['error'](_0x9ca7('0x61'),util[_0x9ca7('0x45')](_0x54a094,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x31')]=function(){var _0x40dc64=this;setInterval(function(){if(!_0x40dc64['summary'][_0x9ca7('0x62')]){return ami['Action']({'action':_0x9ca7('0x63')})['then'](function(_0x22faf3){_0x40dc64[_0x9ca7('0x18')]['id']=_0x22faf3['actionid'];_0x40dc64[_0x9ca7('0x18')]['isRunning']=!![];_0x40dc64['summary'][_0x9ca7('0x64')][_0x22faf3['actionid']]={};})['catch'](function(_0x5d92c8){logger[_0x9ca7('0x43')](_0x9ca7('0x65'),util[_0x9ca7('0x45')](_0x5d92c8,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype']['createQueueSummaryReport']=function(_0x33e20c,_0x3fba5e){var _0x554660;if(this[_0x9ca7('0x18')]&&this[_0x9ca7('0x18')]['queues']&&this[_0x9ca7('0x18')]['queues'][_0x33e20c[_0x9ca7('0x5c')]]){_0x554660=this[_0x9ca7('0x18')][_0x9ca7('0x60')][_0x33e20c[_0x9ca7('0x5c')]][_0x9ca7('0x66')];}var _0x915635=new VoiceQueueSummary(_0x33e20c);return _0x915635['createReport'](_0x3fba5e['agents'],this[_0x9ca7('0x13')],_0x554660,this[_0x9ca7('0x12')]['channels']);};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x67')]=function(_0xaf574f,_0x5d805d){var _0x46bdd5=this[_0x9ca7('0x68')](_0xaf574f,_0x5d805d);var _0x5abb25=![];_0x5abb25=_0x46bdd5[_0x9ca7('0x69')](_0xaf574f);if(_0x5abb25){Object[_0x9ca7('0x6a')](_0xaf574f,_0x46bdd5);this[_0x9ca7('0x12')][_0x9ca7('0x16')][_0xaf574f['name']]=_0xaf574f;this[_0x9ca7('0x59')](_0x46bdd5);}};VoiceQueueReport[_0x9ca7('0xc')]['syncQueueStatusComplete']=function(_0x4dee2a){var _0xbb568f=null;var _0x2da9dd=this[_0x9ca7('0x18')]['id'];if(this['summary'][_0x9ca7('0x64')][_0x2da9dd]){_0xbb568f=this[_0x9ca7('0x18')][_0x9ca7('0x64')][_0x2da9dd][_0x4dee2a[_0x9ca7('0x6b')]];}if(!_0xbb568f){this['summary']=initializeSummary();return;}var _0x1568f0=this['voiceQueues'][_0xbb568f[_0x9ca7('0x52')]];if(_0x1568f0['type']===_0x9ca7('0x6c')){this[_0x9ca7('0x67')](_0x1568f0,_0xbb568f);}else if(_0x1568f0['type']===_0x9ca7('0x6d')){var _0x8ea4a9=this['createQueueSummaryReport'](_0x1568f0,_0xbb568f);ami[_0x9ca7('0x4c')](_0x9ca7('0x6e'),_0x8ea4a9);}this[_0x9ca7('0x18')][_0x9ca7('0x6f')]-=0x1;var _0x5a0ab0=this[_0x9ca7('0x18')][_0x9ca7('0x6f')]>0x0?!![]:![];if(!_0x5a0ab0){return this[_0x9ca7('0x1c')](this[_0x9ca7('0x18')][_0x9ca7('0x70')]);}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x1f')]=function(_0x463743){var _0xbe90ba=this[_0x9ca7('0x18')]['id'];if(this[_0x9ca7('0x18')]['queuestatus'][_0xbe90ba]&&this[_0x9ca7('0x18')]['queuestatus'][_0xbe90ba][_0x463743[_0x9ca7('0x6b')]]){this[_0x9ca7('0x18')][_0x9ca7('0x64')][_0xbe90ba][_0x463743[_0x9ca7('0x6b')]][_0x9ca7('0x13')][_0x9ca7('0x71')](_0x463743);}};VoiceQueueReport[_0x9ca7('0xc')]['syncQueueSummary']=function(_0x375f9e){var _0x43878a=this;try{if(this[_0x9ca7('0x5e')](_0x375f9e)&&this[_0x9ca7('0x5e')](_0x375f9e[_0x9ca7('0x52')])){logger[_0x9ca7('0x54')](_0x9ca7('0x72'),util[_0x9ca7('0x45')](_0x375f9e,{'showHidden':![],'depth':null}));var _0x3df73e=this[_0x9ca7('0x16')][_0x375f9e[_0x9ca7('0x52')]];if(_0x3df73e){logger[_0x9ca7('0x54')](_0x9ca7('0x73'),_0x3df73e[_0x9ca7('0x5c')]);this['summary']['queues'][_0x3df73e[_0x9ca7('0x5c')]]={'summaryEvent':_0x375f9e};this[_0x9ca7('0x18')][_0x9ca7('0x6f')]+=0x1;return ami['Action']({'action':'queuestatus','queue':_0x3df73e[_0x9ca7('0x5c')]})['then'](function(_0x485f68){if(!_0x43878a['summary']['queuestatus'][_0x375f9e[_0x9ca7('0x6b')]]){_0x43878a[_0x9ca7('0x18')][_0x9ca7('0x64')][_0x375f9e[_0x9ca7('0x6b')]]={};}_0x43878a[_0x9ca7('0x18')][_0x9ca7('0x64')][_0x375f9e[_0x9ca7('0x6b')]][_0x485f68['actionid']]={'queue':_0x3df73e[_0x9ca7('0x5c')],'agents':[]};})[_0x9ca7('0x40')](function(_0xc32982){throw _0xc32982;});}}}catch(_0x81a6){logger[_0x9ca7('0x43')](_0x9ca7('0x65'),util[_0x9ca7('0x45')](_0x81a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x1c')]=function(_0x271ef9){if(this['summary']['statusRequests']>0x0){this[_0x9ca7('0x18')][_0x9ca7('0x70')]=_0x271ef9;return;}logger['debug'](_0x9ca7('0x74'),util[_0x9ca7('0x45')](_0x271ef9,{'showHidden':![],'depth':null}));this[_0x9ca7('0x18')]=initializeSummary();ami[_0x9ca7('0x4c')](_0x9ca7('0x75'),{});};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x21')]=function(_0x228e70){try{if(this[_0x9ca7('0x5e')](_0x228e70)){logger[_0x9ca7('0x54')](_0x9ca7('0x76'),_0x228e70[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x228e70,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9ca7('0x11')][_0x228e70['uniqueid']])){this[_0x9ca7('0x11')][_0x228e70[_0x9ca7('0x4f')]]=[];}if(_[_0x9ca7('0x77')](this['channels'][_0x228e70['uniqueid']])){this[_0x9ca7('0x14')][_0x228e70['uniqueid']]={};}var _0x3a1b16=new QueueReport();_0x3a1b16[_0x9ca7('0x52')]=_0x228e70['queue'];_0x3a1b16[_0x9ca7('0x5a')]=this[_0x9ca7('0x16')][_0x3a1b16['queue']]&&this[_0x9ca7('0x16')][_0x3a1b16[_0x9ca7('0x52')]][_0x9ca7('0x5a')]?this[_0x9ca7('0x16')][_0x3a1b16[_0x9ca7('0x52')]][_0x9ca7('0x5a')]||'inbound':_0x9ca7('0x6c');_0x3a1b16['queuecallerjoinAt']=moment()['format'](_0x9ca7('0x78'));_0x3a1b16[_0x9ca7('0x79')]=_0x228e70[_0x9ca7('0x79')];_0x3a1b16[_0x9ca7('0x7a')]=_0x228e70[_0x9ca7('0x7a')];_0x3a1b16[_0x9ca7('0x4f')]=_0x228e70[_0x9ca7('0x4f')];logger['info'](_0x9ca7('0x7b'),_0x3a1b16[_0x9ca7('0x52')],_0x3a1b16[_0x9ca7('0x5a')]);Object[_0x9ca7('0x6a')](_0x3a1b16,_['pick'](_0x228e70,_['keys'](_0x3a1b16)));this[_0x9ca7('0x11')][_0x228e70[_0x9ca7('0x4f')]]['push'](_0x3a1b16);this[_0x9ca7('0x14')][_0x228e70[_0x9ca7('0x4f')]]=_0x3a1b16;this[_0x9ca7('0x4d')](_0x3a1b16,_0x9ca7('0x20'));}}catch(_0x291ec8){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x228e70[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x291ec8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x22')]=function(_0x53c67e){try{if(this[_0x9ca7('0x5e')](_0x53c67e)){logger[_0x9ca7('0x54')](_0x9ca7('0x7c'),_0x53c67e[_0x9ca7('0x4f')],util['inspect'](_0x53c67e,{'showHidden':![],'depth':null}));if(this[_0x9ca7('0x11')][_0x53c67e[_0x9ca7('0x4f')]]){var _0x148fe7=_[_0x9ca7('0x7d')](this[_0x9ca7('0x11')][_0x53c67e[_0x9ca7('0x4f')]]);_0x148fe7[_0x9ca7('0x3b')]=![];_0x148fe7[_0x9ca7('0x7e')]=null;_0x148fe7[_0x9ca7('0x7f')]=_0x53c67e[_0x9ca7('0x7f')];_0x148fe7[_0x9ca7('0x80')]=_0x53c67e['originalposition'];_0x148fe7[_0x9ca7('0x3a')]=!![];_0x148fe7[_0x9ca7('0x81')]=moment()['format'](_0x9ca7('0x78'));_0x148fe7[_0x9ca7('0x56')]='ABANDONED';_0x148fe7[_0x9ca7('0x82')]=null;logger['info'](_0x9ca7('0x83'),_0x148fe7[_0x9ca7('0x52')],_0x148fe7[_0x9ca7('0x5a')]);this['channels'][_0x53c67e[_0x9ca7('0x4f')]]=_0x148fe7;this[_0x9ca7('0x4a')](_0x148fe7,_0x9ca7('0x3a'));}}}catch(_0x49eab3){logger['error'](_0x9ca7('0x7c'),_0x53c67e[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x49eab3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x84')]=function(_0x4f192a){try{if(this[_0x9ca7('0x5e')](_0x4f192a)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x4f192a['uniqueid'],util[_0x9ca7('0x45')](_0x4f192a,{'showHidden':![],'depth':null}));if(this[_0x9ca7('0x11')][_0x4f192a[_0x9ca7('0x4f')]]){var _0xbaced9=_[_0x9ca7('0x7d')](this['queueReports'][_0x4f192a['uniqueid']]);_0xbaced9[_0x9ca7('0x85')]=moment()[_0x9ca7('0x50')](_0x9ca7('0x78'));_0xbaced9['connectedlinenum']=_0x4f192a['connectedlinenum'];_0xbaced9['connectedlinename']=_0x4f192a[_0x9ca7('0x86')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xbaced9['queue'],_0xbaced9[_0x9ca7('0x5a')],_0x4f192a[_0x9ca7('0x87')],_0x4f192a[_0x9ca7('0x86')]);this[_0x9ca7('0x14')][_0x4f192a[_0x9ca7('0x4f')]]=_0xbaced9;this[_0x9ca7('0x4d')](_0xbaced9,'queuecallerleave');}}}catch(_0x15d4b6){logger['error'](_0x9ca7('0x88'),_0x4f192a[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x15d4b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x26')]=function(_0x1ba62c){try{if(this[_0x9ca7('0x5e')](_0x1ba62c)){logger[_0x9ca7('0x54')](_0x9ca7('0x89'),_0x1ba62c['uniqueid'],util[_0x9ca7('0x45')](_0x1ba62c,{'showHidden':![],'depth':null}));if(this[_0x9ca7('0x11')][_0x1ba62c[_0x9ca7('0x4f')]]){var _0x4e889a=_['last'](this[_0x9ca7('0x11')][_0x1ba62c[_0x9ca7('0x4f')]]);_0x4e889a['queuecallercomplete']=!![];_0x4e889a[_0x9ca7('0x56')]=_0x9ca7('0x8a');logger[_0x9ca7('0x8b')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4e889a[_0x9ca7('0x52')],_0x4e889a[_0x9ca7('0x5a')]);}}}catch(_0x36d18b){logger[_0x9ca7('0x43')](_0x9ca7('0x89'),_0x1ba62c[_0x9ca7('0x4f')],util['inspect'](_0x36d18b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ca7('0xc')][_0x9ca7('0x8c')]=function(_0x4c7366){try{if(this[_0x9ca7('0x5e')](_0x4c7366)){logger[_0x9ca7('0x54')]('[%s][voiceQueueReport][agentcomplete]',_0x4c7366[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x4c7366,{'showHidden':![],'depth':null}));if(this[_0x9ca7('0x11')][_0x4c7366[_0x9ca7('0x4f')]]){var _0x11b810=_[_0x9ca7('0x7d')](this[_0x9ca7('0x11')][_0x4c7366[_0x9ca7('0x4f')]]);_0x11b810[_0x9ca7('0x3a')]=![];_0x11b810[_0x9ca7('0x81')]=null;_0x11b810[_0x9ca7('0x8d')]=!![];_0x11b810[_0x9ca7('0x82')]=_0x4c7366[_0x9ca7('0x8e')];_0x11b810[_0x9ca7('0x7f')]=_0x4c7366[_0x9ca7('0x7f')];_0x11b810[_0x9ca7('0x3b')]=!![];_0x11b810[_0x9ca7('0x8f')]=![];_0x11b810['queuecallerexitAt']=null;if(!_0x11b810[_0x9ca7('0x90')]){if(_0x4c7366[_0x9ca7('0x91')]==_0x9ca7('0x90')){_0x11b810['queuecallerexitreason']=_0x9ca7('0x92');logger[_0x9ca7('0x8b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x11b810['queue'],_0x11b810[_0x9ca7('0x5a')]);}else{if(_[_0x9ca7('0x93')](_0x4c7366[_0x9ca7('0x3f')][_0x9ca7('0x94')](),_0x9ca7('0x95'))){if(this['queueReports'][_0x4c7366[_0x9ca7('0x96')]]){var _0x46f84c=_[_0x9ca7('0x7d')](this[_0x9ca7('0x11')][_0x4c7366[_0x9ca7('0x96')]]);_0x46f84c[_0x9ca7('0x3b')]=![];_0x46f84c[_0x9ca7('0x8f')]=!![];_0x46f84c[_0x9ca7('0x97')]=moment(_0x11b810[_0x9ca7('0x98')])['add'](_0x4c7366[_0x9ca7('0x7f')],_0x9ca7('0x99'))[_0x9ca7('0x50')](_0x9ca7('0x78'));_0x46f84c['queuecallerexitreason']=_0x9ca7('0x9a');_0x46f84c[_0x9ca7('0x90')]=!![];_0x46f84c[_0x9ca7('0x9b')]=_0x9ca7('0x9c');_0x46f84c[_0x9ca7('0x9d')]=_0x4c7366[_0x9ca7('0x9e')];_0x46f84c[_0x9ca7('0x9f')]=_0x4c7366[_0x9ca7('0x4f')];logger[_0x9ca7('0x8b')](_0x9ca7('0xa0'),_0x46f84c['queue'],_0x46f84c[_0x9ca7('0x5a')]);var _0x148608=this['queueReports'][_0x4c7366[_0x9ca7('0x96')]];this['queueReports'][_0x4c7366[_0x9ca7('0x96')]]=this[_0x9ca7('0x11')][_0x4c7366[_0x9ca7('0x4f')]];this[_0x9ca7('0x11')][_0x4c7366['uniqueid']]=_0x148608;}}else{_0x11b810[_0x9ca7('0x56')]=_0x9ca7('0xa1')+_0x4c7366['reason']['toUpperCase']();logger[_0x9ca7('0x8b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x11b810[_0x9ca7('0x52')],_0x11b810[_0x9ca7('0x5a')],_0x11b810[_0x9ca7('0x56')]);}}}this[_0x9ca7('0x14')][_0x4c7366[_0x9ca7('0x4f')]]=_0x11b810;}}}catch(_0x5c4690){logger[_0x9ca7('0x43')]('[%s][voiceQueueReport][agentcomplete]',_0x4c7366[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x5c4690,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ca7('0xc')]['syncVarSet']=function(_0x3fd5b2){try{if(this[_0x9ca7('0x5e')](_0x3fd5b2)){logger[_0x9ca7('0x54')](_0x9ca7('0xa2'),_0x3fd5b2['uniqueid'],util[_0x9ca7('0x45')](_0x3fd5b2,{'showHidden':![],'depth':null}));this[_0x9ca7('0xa3')](_0x3fd5b2[_0x9ca7('0x4f')],_[_0x9ca7('0xa4')](_0x3fd5b2[_0x9ca7('0xa5')])[0x0],_0x3fd5b2['value']);if(this[_0x9ca7('0x11')][_0x3fd5b2[_0x9ca7('0x4f')]]){var _0x5dde4d=_[_0x9ca7('0x7d')](this[_0x9ca7('0x11')][_0x3fd5b2[_0x9ca7('0x4f')]]);if(_0x5dde4d){if(this[_0x9ca7('0x5e')](_0x3fd5b2['variable'])&&this[_0x9ca7('0x5e')](_0x3fd5b2['variable'][_0x9ca7('0x64')])){switch(_0x3fd5b2[_0x9ca7('0xa6')]){case'CONTINUE':_0x5dde4d[_0x9ca7('0x8f')]=![];_0x5dde4d[_0x9ca7('0x97')]=null;break;case _0x9ca7('0xa7'):_0x5dde4d[_0x9ca7('0xa8')]=_0x9ca7('0xa9');_0x5dde4d[_0x9ca7('0x8f')]=!![];_0x5dde4d[_0x9ca7('0x97')]=moment()[_0x9ca7('0x50')](_0x9ca7('0x78'));_0x5dde4d['queuecallerleaveAt']=moment()[_0x9ca7('0x50')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x9ca7('0x54')](_0x9ca7('0xaa'),_0x3fd5b2[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x5dde4d,{'showHidden':![],'depth':null}));ami[_0x9ca7('0x4c')](_0x9ca7('0xab'),_0x5dde4d);break;default:_0x5dde4d[_0x9ca7('0x8f')]=!![];_0x5dde4d['queuecallerexitAt']=moment()['format'](_0x9ca7('0x78'));_0x5dde4d[_0x9ca7('0x85')]=moment()[_0x9ca7('0x50')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5dde4d[_0x9ca7('0x3a')]=![];_0x5dde4d[_0x9ca7('0x81')]=null;_0x5dde4d[_0x9ca7('0x56')]=_0x3fd5b2['value'];this[_0x9ca7('0x14')][_0x3fd5b2[_0x9ca7('0x4f')]]=_0x5dde4d;this['emitVoiceQueueChannelRemove'](_0x5dde4d,_0x9ca7('0x27'));}else if(this[_0x9ca7('0x5e')](_0x3fd5b2['variable'])&&this[_0x9ca7('0x5e')](_0x3fd5b2[_0x9ca7('0xa5')][_0x9ca7('0xac')])){if(!_0x5dde4d[_0x9ca7('0x3a')]){_0x5dde4d[_0x9ca7('0x8f')]=!![];_0x5dde4d['queuecallerexitAt']=moment()[_0x9ca7('0x50')](_0x9ca7('0x78'));_0x5dde4d[_0x9ca7('0x56')]=_0x9ca7('0xad');_0x5dde4d['queuecallerleaveAt']=moment()['format'](_0x9ca7('0x78'));this[_0x9ca7('0x14')][_0x3fd5b2[_0x9ca7('0x4f')]]=_0x5dde4d;}}logger[_0x9ca7('0x8b')](_0x9ca7('0xae'),_0x3fd5b2['uniqueid'],_0x5dde4d[_0x9ca7('0x52')],_0x5dde4d[_0x9ca7('0x5a')],_[_0x9ca7('0xa4')](_0x3fd5b2[_0x9ca7('0xa5')])[0x0],_0x3fd5b2[_0x9ca7('0xa6')]);_0x5dde4d[_0x9ca7('0x19')]=this[_0x9ca7('0x19')][_0x3fd5b2['uniqueid']];}}}}catch(_0x5ab9c1){logger[_0x9ca7('0x43')](_0x9ca7('0xa2'),_0x3fd5b2[_0x9ca7('0x4f')],util[_0x9ca7('0x45')](_0x5ab9c1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ca7('0xc')]['addVariable']=function(_0x2d6d15,_0x1f109c,_0x570288){var _0x59e096=[_0x9ca7('0xaf'),_0x9ca7('0xb0'),_0x9ca7('0xb1'),_0x9ca7('0xb2'),_0x9ca7('0xb3'),_0x9ca7('0xb4'),_0x9ca7('0xb5'),'rtpaudioqosrttbridged',_0x9ca7('0xb6'),_0x9ca7('0xb7'),_0x9ca7('0xb8'),_0x9ca7('0xb9'),_0x9ca7('0xba'),_0x9ca7('0xbb'),_0x9ca7('0xbc'),'memberlastcall',_0x9ca7('0x8e'),_0x9ca7('0xbd'),_0x9ca7('0xbe')];if(!_[_0x9ca7('0x3d')](_0x1f109c)&&!_[_0x9ca7('0xbf')](_0x59e096,_0x1f109c)){if(_[_0x9ca7('0x77')](this['variables'][_0x2d6d15])){this[_0x9ca7('0x19')][_0x2d6d15]={};}this[_0x9ca7('0x19')][_0x2d6d15][_0x1f109c]=_0x570288;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x155f39,_0x10014b,_0x153768){try{var _0x4fa1cc={};if(this['queueReports'][_0x155f39]){for(var _0x2f86c7=0x0;_0x2f86c7{delete this[_0x9ca7('0x14')][_0x4610a7];},_0x27f6f3);}};module[_0x9ca7('0xf3')]=VoiceQueueReport; \ No newline at end of file +var _0x3868=['[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','deleteChannelAfterTimeout','syncHangup','[%s][voiceQueueReport][hangup]','cause-txt','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','defaults','localhost','redis','prototype','tail','sequence','agents','channels','queueChannels','voiceQueues','campaigns','summary','variables','bind','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','queueStatusComplete','unlockRR','queuecallerexit','queuecallerabandon','queuecallercomplete','switch','enqueue','isNil','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','clearZombieChannels','Action','queues','[voiceQueueReport][queues]','loopQueueSummary','isRunning','queuesummary','actionid','queuestatus','createQueueSummaryReport','name','createReport','handleInboundQueueSummaryReport','realtime','statusRequests','syncQueueSummaryComplete','completeEvent','push','syncQueueSummary','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','assign','pick','keys','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','membername','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','handleHangup','length','diff','sumDuration','milliseconds','total','answered','sumBillable','unmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','custom:queuecallerabandon','sumHoldTime'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x3868,0x117));var _0x8386=function(_0x15d6d6,_0x14d98c){_0x15d6d6=_0x15d6d6-0x0;var _0x27d97a=_0x3868[_0x15d6d6];return _0x27d97a;};'use strict';var _=require('lodash');var moment=require(_0x8386('0x0'));var util=require(_0x8386('0x1'));var Redis=require(_0x8386('0x2'));var config=require(_0x8386('0x3'));var logger=require(_0x8386('0x4'))(_0x8386('0x5'));var ami=require(_0x8386('0x6'));var QueueReport=require(_0x8386('0x7'));var VoiceQueueSummary=require(_0x8386('0x8'));config['redis']=_[_0x8386('0x9')](config['redis'],{'host':_0x8386('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8386('0xb')]));var Sequence=function(){};Sequence[_0x8386('0xc')]['enqueue']=function(_0x4a8f36){this[_0x8386('0xd')]=this['tail']?this[_0x8386('0xd')]['finally'](_0x4a8f36):_0x4a8f36();};function VoiceQueueReport(_0x18339e){this[_0x8386('0xe')]=new Sequence();this['queueReports']={};this['realtime']=_0x18339e;this[_0x8386('0xf')]=_0x18339e[_0x8386('0xf')];this[_0x8386('0x10')]=_0x18339e[_0x8386('0x11')];this[_0x8386('0x12')]=_0x18339e[_0x8386('0x12')];this[_0x8386('0x13')]=_0x18339e[_0x8386('0x13')];this[_0x8386('0x14')]=initializeSummary();this[_0x8386('0x15')]={};ami['on']('queuesummary',this['syncQueueSummary'][_0x8386('0x16')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0x8386('0x16')](this));ami['on']('queuemember',this[_0x8386('0x17')][_0x8386('0x16')](this));ami['on'](_0x8386('0x18'),this[_0x8386('0x19')][_0x8386('0x16')](this));ami['on'](_0x8386('0x1a'),this['syncQueueCallerJoin'][_0x8386('0x16')](this));ami['on']('queuecallerabandon',this[_0x8386('0x1b')][_0x8386('0x16')](this));ami['on'](_0x8386('0x1c'),this[_0x8386('0x1d')][_0x8386('0x16')](this));ami['on'](_0x8386('0x1e'),this['syncAgentComplete']['bind'](this));ami['on'](_0x8386('0x1f'),this[_0x8386('0x20')][_0x8386('0x16')](this));ami['on'](_0x8386('0x21'),this[_0x8386('0x22')][_0x8386('0x16')](this));ami['on'](_0x8386('0x23'),this['syncHangup'][_0x8386('0x16')](this));ami['on']('fullybooted',this['syncFullyBooted'][_0x8386('0x16')](this));ami['on'](_0x8386('0x24'),this['syncMusicOnHoldStart'][_0x8386('0x16')](this));ami['on'](_0x8386('0x25'),this[_0x8386('0x26')][_0x8386('0x16')](this));ami['on'](_0x8386('0x27'),this[_0x8386('0x28')][_0x8386('0x16')](this));ami['on'](_0x8386('0x29'),this[_0x8386('0x2a')][_0x8386('0x16')](this));this['loopQueueSummary']();this[_0x8386('0x2b')]();}function clearChannels(_0x1705a9){if(!_[_0x8386('0x2c')](_0x1705a9)){for(var _0x54b322 in _0x1705a9){if(_0x1705a9['hasOwnProperty'](_0x54b322)){delete _0x1705a9[_0x54b322];}}}}function clearCampaigns(_0x1b2821){if(!_[_0x8386('0x2c')](_0x1b2821)){for(var _0x31b313 in _0x1b2821){if(_0x1b2821[_0x8386('0x2d')](_0x31b313)){_0x1b2821[_0x31b313][_0x8386('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x311773){if(!_[_0x8386('0x2c')](_0x311773)){for(var _0x33e907 in _0x311773){if(_0x311773[_0x8386('0x2d')](_0x33e907)){_0x311773[_0x33e907][_0x8386('0x2e')]=0x0;_0x311773[_0x33e907]['talking']=0x0;_0x311773[_0x33e907][_0x8386('0x2f')]=0x0;_0x311773[_0x33e907]['waiting']=0x0;_0x311773[_0x33e907][_0x8386('0x30')]=!![];}}}}function clearAgentBooked(_0x9cf886){if(!_[_0x8386('0x2c')](_0x9cf886)){for(var _0x5f1b55 in _0x9cf886){if(_0x9cf886[_0x8386('0x2d')](_0x5f1b55)){_0x9cf886[_0x5f1b55][_0x8386('0x31')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x18ee89){return _0x18ee89[_0x8386('0x32')]||_0x18ee89[_0x8386('0x33')]||_0x18ee89[_0x8386('0x34')];}VoiceQueueReport[_0x8386('0xc')]['clearZombieChannels']=function(){var _0x2ef315=this;for(var _0x2d6cd8 in this[_0x8386('0x10')]){if(this['channels'][_0x8386('0x2d')](_0x2d6cd8)&&!this[_0x8386('0x10')][_0x2d6cd8][_0x8386('0x35')]){this[_0x8386('0xe')][_0x8386('0x36')](function(){if(!_[_0x8386('0x37')](_0x2ef315[_0x8386('0x10')][_0x2d6cd8])){return ami['Action']({'action':_0x8386('0x38'),'channel':_0x2ef315[_0x8386('0x10')][_0x2d6cd8][_0x8386('0x39')]})[_0x8386('0x3a')](function(_0x3514f0){if(_0x3514f0[_0x8386('0x3b')]===_0x8386('0x3c')){setTimeout(function(){if(_0x2ef315[_0x8386('0x10')][_0x2d6cd8]){delete _0x2ef315[_0x8386('0x10')][_0x2d6cd8];logger[_0x8386('0x3d')](_0x8386('0x3e'),_0x2d6cd8,util[_0x8386('0x3f')](_0x3514f0,{'showHidden':![],'depth':null}));}if(_0x2ef315[_0x8386('0x40')][_0x2d6cd8]){delete _0x2ef315[_0x8386('0x40')][_0x2d6cd8];logger['error']('[%s][voiceQueueReport][checkQueueReport]',_0x2d6cd8,util[_0x8386('0x3f')](_0x3514f0,{'showHidden':![],'depth':null}));}if(_0x2ef315[_0x8386('0x15')][_0x2d6cd8]){delete _0x2ef315[_0x8386('0x15')][_0x2d6cd8];logger[_0x8386('0x3d')]('[%s][voiceQueueReport][checkVariables]',_0x2d6cd8,util[_0x8386('0x3f')](_0x3514f0,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x41')]=function(){logger[_0x8386('0x3d')](_0x8386('0x42'));clearChannels(this['channels']);this[_0x8386('0x43')](this[_0x8386('0x40')]);clearAgentBooked(this[_0x8386('0xf')]);clearVoiceQueues(this[_0x8386('0x12')]);clearCampaigns(this[_0x8386('0x13')]);this[_0x8386('0x14')]=initializeSummary();};VoiceQueueReport['prototype'][_0x8386('0x43')]=function(_0x334655){var _0x6abedb=this;if(!_[_0x8386('0x2c')](_0x334655)){for(var _0x3e7ca4 in _0x334655){if(_0x334655[_0x8386('0x2d')](_0x3e7ca4)){_0x6abedb['emitVoiceQueueChannelRemove'](_0x334655[_0x3e7ca4],'clearqueuereport');delete _0x334655[_0x3e7ca4];}}}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x44')]=function(_0x270ea4,_0x3fc9a9,_0x2d6177){io['to'](_0x270ea4)[_0x8386('0x44')](_0x3fc9a9,_0x2d6177);};VoiceQueueReport[_0x8386('0xc')]['emitVoiceQueueChannelSave']=function(_0x8ca7c1,_0x475efa){logger[_0x8386('0x45')](_0x8386('0x46')+_0x475efa+_0x8386('0x47'),_0x8ca7c1[_0x8386('0x48')],util[_0x8386('0x3f')](_0x8ca7c1,{'showHidden':![],'depth':null}));this[_0x8386('0x44')](util['format'](_0x8386('0x49'),_0x8ca7c1['queue']),'voice_queue_channel:save',_0x8ca7c1);io[_0x8386('0x44')](_0x8386('0x4a'),_0x8ca7c1);};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x4b')]=function(_0x80febb,_0x4bca54){logger[_0x8386('0x45')](_0x8386('0x46')+_0x4bca54+_0x8386('0x4c'),_0x80febb[_0x8386('0x48')],util[_0x8386('0x3f')](_0x80febb,{'showHidden':![],'depth':null}));if(_0x80febb[_0x8386('0x4d')]===_0x8386('0x4e')){return;}this[_0x8386('0x44')](util[_0x8386('0x4f')](_0x8386('0x49'),_0x80febb['queue']),_0x8386('0x50'),_0x80febb);io[_0x8386('0x44')](_0x8386('0x51'),_0x80febb);};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x52')]=function(_0x5d6269){if(_0x5d6269[_0x8386('0x53')]===_0x8386('0x54')){logger[_0x8386('0x45')](_0x8386('0x55'),util[_0x8386('0x3f')](_0x5d6269,{'showHidden':![],'depth':null}));this[_0x8386('0x44')](util[_0x8386('0x4f')](_0x8386('0x49'),_0x5d6269['name']),_0x8386('0x56'),_0x5d6269);}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x57')]=function(_0x2899ae){return _0x2899ae!==null&&!_[_0x8386('0x58')](_0x2899ae);};VoiceQueueReport['prototype'][_0x8386('0x2b')]=function(){var _0x587482=this;setInterval(function(){_0x587482[_0x8386('0x59')]();ami[_0x8386('0x5a')]({'action':_0x8386('0x5b')})[_0x8386('0x3a')](function(_0xb0985){logger[_0x8386('0x3d')](_0x8386('0x5c'),util[_0x8386('0x3f')](_0xb0985,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x5d')]=function(){var _0x3fd05b=this;setInterval(function(){if(!_0x3fd05b[_0x8386('0x14')][_0x8386('0x5e')]){return ami[_0x8386('0x5a')]({'action':_0x8386('0x5f')})['then'](function(_0x4c19c8){_0x3fd05b[_0x8386('0x14')]['id']=_0x4c19c8[_0x8386('0x60')];_0x3fd05b['summary']['isRunning']=!![];_0x3fd05b[_0x8386('0x14')][_0x8386('0x61')][_0x4c19c8[_0x8386('0x60')]]={};})['catch'](function(_0x600f24){logger[_0x8386('0x3d')]('[voiceQueueReport][queuesummary]',util[_0x8386('0x3f')](_0x600f24,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x62')]=function(_0x1880e5,_0x327b8d){var _0x3d55dd;if(this['summary']&&this[_0x8386('0x14')][_0x8386('0x5b')]&&this['summary']['queues'][_0x1880e5[_0x8386('0x63')]]){_0x3d55dd=this[_0x8386('0x14')][_0x8386('0x5b')][_0x1880e5['name']]['summaryEvent'];}var _0xb3e727=new VoiceQueueSummary(_0x1880e5);return _0xb3e727[_0x8386('0x64')](_0x327b8d[_0x8386('0xf')],this[_0x8386('0xf')],_0x3d55dd,this['realtime'][_0x8386('0x10')]);};VoiceQueueReport['prototype'][_0x8386('0x65')]=function(_0x3ff1b9,_0x23c552){var _0x183fe7=this[_0x8386('0x62')](_0x3ff1b9,_0x23c552);var _0x487ca2=![];_0x487ca2=_0x183fe7['compareToInboundQueue'](_0x3ff1b9);if(_0x487ca2){Object['assign'](_0x3ff1b9,_0x183fe7);this[_0x8386('0x66')][_0x8386('0x12')][_0x3ff1b9[_0x8386('0x63')]]=_0x3ff1b9;this[_0x8386('0x52')](_0x183fe7);}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x19')]=function(_0x3afbc7){var _0x5b1945=null;var _0xe64265=this[_0x8386('0x14')]['id'];if(this[_0x8386('0x14')][_0x8386('0x61')][_0xe64265]){_0x5b1945=this[_0x8386('0x14')]['queuestatus'][_0xe64265][_0x3afbc7[_0x8386('0x60')]];}if(!_0x5b1945){this['summary']=initializeSummary();return;}var _0x2fb049=this[_0x8386('0x12')][_0x5b1945['queue']];if(_0x2fb049[_0x8386('0x53')]==='inbound'){this['handleInboundQueueSummaryReport'](_0x2fb049,_0x5b1945);}else if(_0x2fb049[_0x8386('0x53')]==='outbound'){var _0x22c725=this['createQueueSummaryReport'](_0x2fb049,_0x5b1945);ami[_0x8386('0x44')]('custom:queuesummary',_0x22c725);}this[_0x8386('0x14')][_0x8386('0x67')]-=0x1;var _0x24e74e=this[_0x8386('0x14')][_0x8386('0x67')]>0x0?!![]:![];if(!_0x24e74e){return this[_0x8386('0x68')](this[_0x8386('0x14')][_0x8386('0x69')]);}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x17')]=function(_0x3c347a){var _0x93491c=this[_0x8386('0x14')]['id'];if(this['summary'][_0x8386('0x61')][_0x93491c]&&this[_0x8386('0x14')][_0x8386('0x61')][_0x93491c][_0x3c347a['actionid']]){this['summary'][_0x8386('0x61')][_0x93491c][_0x3c347a[_0x8386('0x60')]][_0x8386('0xf')][_0x8386('0x6a')](_0x3c347a);}};VoiceQueueReport['prototype'][_0x8386('0x6b')]=function(_0x21d3bd){var _0x268062=this;try{if(this[_0x8386('0x57')](_0x21d3bd)&&this[_0x8386('0x57')](_0x21d3bd[_0x8386('0x6c')])){logger['debug'](_0x8386('0x6d'),util[_0x8386('0x3f')](_0x21d3bd,{'showHidden':![],'depth':null}));var _0x18665d=this[_0x8386('0x12')][_0x21d3bd[_0x8386('0x6c')]];if(_0x18665d){logger[_0x8386('0x45')](_0x8386('0x6e'),_0x18665d[_0x8386('0x63')]);this[_0x8386('0x14')][_0x8386('0x5b')][_0x18665d[_0x8386('0x63')]]={'summaryEvent':_0x21d3bd};this[_0x8386('0x14')]['statusRequests']+=0x1;return ami[_0x8386('0x5a')]({'action':_0x8386('0x61'),'queue':_0x18665d[_0x8386('0x63')]})['then'](function(_0x2e0291){if(!_0x268062[_0x8386('0x14')][_0x8386('0x61')][_0x21d3bd[_0x8386('0x60')]]){_0x268062[_0x8386('0x14')]['queuestatus'][_0x21d3bd[_0x8386('0x60')]]={};}_0x268062['summary'][_0x8386('0x61')][_0x21d3bd[_0x8386('0x60')]][_0x2e0291[_0x8386('0x60')]]={'queue':_0x18665d[_0x8386('0x63')],'agents':[]};})['catch'](function(_0x5b25c7){throw _0x5b25c7;});}}}catch(_0xc9e60a){logger[_0x8386('0x3d')](_0x8386('0x6f'),util[_0x8386('0x3f')](_0xc9e60a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x68')]=function(_0x31d27d){if(this['summary'][_0x8386('0x67')]>0x0){this[_0x8386('0x14')][_0x8386('0x69')]=_0x31d27d;return;}logger['debug'](_0x8386('0x70'),util[_0x8386('0x3f')](_0x31d27d,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x71')]=function(_0x396fe8){try{if(this[_0x8386('0x57')](_0x396fe8)){logger[_0x8386('0x45')](_0x8386('0x72'),_0x396fe8[_0x8386('0x48')],util[_0x8386('0x3f')](_0x396fe8,{'showHidden':![],'depth':null}));if(_[_0x8386('0x58')](this[_0x8386('0x40')][_0x396fe8[_0x8386('0x48')]])){this['queueReports'][_0x396fe8['uniqueid']]=[];}if(_['isUndefined'](this[_0x8386('0x10')][_0x396fe8[_0x8386('0x48')]])){this[_0x8386('0x10')][_0x396fe8[_0x8386('0x48')]]={};}var _0x2a4eac=new QueueReport();_0x2a4eac['queue']=_0x396fe8[_0x8386('0x6c')];_0x2a4eac['type']=this[_0x8386('0x12')][_0x2a4eac[_0x8386('0x6c')]]&&this[_0x8386('0x12')][_0x2a4eac['queue']][_0x8386('0x53')]?this['voiceQueues'][_0x2a4eac[_0x8386('0x6c')]][_0x8386('0x53')]||_0x8386('0x54'):'inbound';_0x2a4eac[_0x8386('0x73')]=moment()[_0x8386('0x4f')](_0x8386('0x74'));_0x2a4eac['position']=_0x396fe8['position'];_0x2a4eac[_0x8386('0x75')]=_0x396fe8[_0x8386('0x75')];_0x2a4eac[_0x8386('0x48')]=_0x396fe8[_0x8386('0x48')];logger[_0x8386('0x76')](_0x8386('0x77'),_0x2a4eac[_0x8386('0x6c')],_0x2a4eac['type']);Object[_0x8386('0x78')](_0x2a4eac,_[_0x8386('0x79')](_0x396fe8,_[_0x8386('0x7a')](_0x2a4eac)));this[_0x8386('0x40')][_0x396fe8['uniqueid']][_0x8386('0x6a')](_0x2a4eac);this[_0x8386('0x10')][_0x396fe8[_0x8386('0x48')]]=_0x2a4eac;this[_0x8386('0x7b')](_0x2a4eac,_0x8386('0x1a'));}}catch(_0x122226){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x396fe8[_0x8386('0x48')],util[_0x8386('0x3f')](_0x122226,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8386('0x1b')]=function(_0x45d8b2){try{if(this[_0x8386('0x57')](_0x45d8b2)){logger[_0x8386('0x45')](_0x8386('0x7c'),_0x45d8b2[_0x8386('0x48')],util[_0x8386('0x3f')](_0x45d8b2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x45d8b2[_0x8386('0x48')]]){var _0x23b3af=_['last'](this[_0x8386('0x40')][_0x45d8b2[_0x8386('0x48')]]);_0x23b3af[_0x8386('0x34')]=![];_0x23b3af[_0x8386('0x7d')]=null;_0x23b3af[_0x8386('0x7e')]=_0x45d8b2[_0x8386('0x7e')];_0x23b3af['originalposition']=_0x45d8b2['originalposition'];_0x23b3af[_0x8386('0x33')]=!![];_0x23b3af['queuecallerabandonAt']=moment()[_0x8386('0x4f')](_0x8386('0x74'));_0x23b3af[_0x8386('0x4d')]='ABANDONED';_0x23b3af[_0x8386('0x7f')]=null;logger['info'](_0x8386('0x80'),_0x23b3af['queue'],_0x23b3af[_0x8386('0x53')]);this[_0x8386('0x10')][_0x45d8b2[_0x8386('0x48')]]=_0x23b3af;this[_0x8386('0x4b')](_0x23b3af,_0x8386('0x33'));}}}catch(_0x56d360){logger[_0x8386('0x3d')]('[%s][voiceQueueReport][queuecallerabandon]',_0x45d8b2[_0x8386('0x48')],util['inspect'](_0x56d360,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x1d')]=function(_0x252bf){try{if(this['isNotNull'](_0x252bf)){logger[_0x8386('0x45')](_0x8386('0x81'),_0x252bf[_0x8386('0x48')],util['inspect'](_0x252bf,{'showHidden':![],'depth':null}));if(this[_0x8386('0x40')][_0x252bf[_0x8386('0x48')]]){var _0x152c48=_[_0x8386('0x82')](this['queueReports'][_0x252bf[_0x8386('0x48')]]);_0x152c48[_0x8386('0x83')]=moment()[_0x8386('0x4f')](_0x8386('0x74'));_0x152c48[_0x8386('0x84')]=_0x252bf[_0x8386('0x84')];_0x152c48[_0x8386('0x85')]=_0x252bf[_0x8386('0x85')];logger['info'](_0x8386('0x86'),_0x152c48[_0x8386('0x6c')],_0x152c48[_0x8386('0x53')],_0x252bf[_0x8386('0x84')],_0x252bf['connectedlinename']);this[_0x8386('0x10')][_0x252bf[_0x8386('0x48')]]=_0x152c48;this[_0x8386('0x7b')](_0x152c48,'queuecallerleave');}}}catch(_0x2abc9b){logger[_0x8386('0x3d')](_0x8386('0x81'),_0x252bf[_0x8386('0x48')],util[_0x8386('0x3f')](_0x2abc9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x20')]=function(_0x4d6acf){try{if(this[_0x8386('0x57')](_0x4d6acf)){logger[_0x8386('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x4d6acf[_0x8386('0x48')],util[_0x8386('0x3f')](_0x4d6acf,{'showHidden':![],'depth':null}));if(this[_0x8386('0x40')][_0x4d6acf[_0x8386('0x48')]]){var _0x3d9413=_['last'](this['queueReports'][_0x4d6acf[_0x8386('0x48')]]);_0x3d9413['queuecallercomplete']=!![];_0x3d9413[_0x8386('0x4d')]=_0x8386('0x87');logger['info'](_0x8386('0x88'),_0x3d9413[_0x8386('0x6c')],_0x3d9413['type']);}}}catch(_0x319b88){logger[_0x8386('0x3d')](_0x8386('0x89'),_0x4d6acf['uniqueid'],util[_0x8386('0x3f')](_0x319b88,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0x8a')]=function(_0x36aa41){try{if(this[_0x8386('0x57')](_0x36aa41)){logger[_0x8386('0x45')](_0x8386('0x8b'),_0x36aa41[_0x8386('0x48')],util[_0x8386('0x3f')](_0x36aa41,{'showHidden':![],'depth':null}));if(this[_0x8386('0x40')][_0x36aa41['uniqueid']]){var _0x45708b=_[_0x8386('0x82')](this['queueReports'][_0x36aa41[_0x8386('0x48')]]);_0x45708b[_0x8386('0x33')]=![];_0x45708b[_0x8386('0x8c')]=null;_0x45708b[_0x8386('0x8d')]=!![];_0x45708b[_0x8386('0x7f')]=_0x36aa41[_0x8386('0x8e')];_0x45708b[_0x8386('0x7e')]=_0x36aa41[_0x8386('0x7e')];_0x45708b[_0x8386('0x34')]=!![];_0x45708b[_0x8386('0x32')]=![];_0x45708b[_0x8386('0x8f')]=null;if(!_0x45708b[_0x8386('0x90')]){if(_0x36aa41[_0x8386('0x91')]=='transfer'){_0x45708b[_0x8386('0x4d')]='COMPLETED';logger[_0x8386('0x76')](_0x8386('0x92'),_0x45708b[_0x8386('0x6c')],_0x45708b[_0x8386('0x53')]);}else{if(_[_0x8386('0x93')](_0x36aa41['channel']['toLowerCase'](),_0x8386('0x94'))){if(this[_0x8386('0x40')][_0x36aa41[_0x8386('0x95')]]){var _0x5b8862=_[_0x8386('0x82')](this['queueReports'][_0x36aa41[_0x8386('0x95')]]);_0x5b8862[_0x8386('0x34')]=![];_0x5b8862[_0x8386('0x32')]=!![];_0x5b8862[_0x8386('0x8f')]=moment(_0x45708b['queuecallerjoinAt'])[_0x8386('0x96')](_0x36aa41[_0x8386('0x7e')],_0x8386('0x97'))[_0x8386('0x4f')](_0x8386('0x74'));_0x5b8862['queuecallerexitreason']=_0x8386('0x98');_0x5b8862[_0x8386('0x90')]=!![];_0x5b8862[_0x8386('0x99')]=_0x8386('0x9a');_0x5b8862[_0x8386('0x9b')]=_0x36aa41['destexten'];_0x5b8862[_0x8386('0x9c')]=_0x36aa41[_0x8386('0x48')];logger[_0x8386('0x76')](_0x8386('0x9d'),_0x5b8862['queue'],_0x5b8862[_0x8386('0x53')]);var _0x4f76cd=this[_0x8386('0x40')][_0x36aa41[_0x8386('0x95')]];this[_0x8386('0x40')][_0x36aa41[_0x8386('0x95')]]=this[_0x8386('0x40')][_0x36aa41[_0x8386('0x48')]];this[_0x8386('0x40')][_0x36aa41['uniqueid']]=_0x4f76cd;}}else{_0x45708b['queuecallerexitreason']=_0x8386('0x9e')+_0x36aa41[_0x8386('0x91')]['toUpperCase']();logger[_0x8386('0x76')](_0x8386('0x9f'),_0x45708b[_0x8386('0x6c')],_0x45708b[_0x8386('0x53')],_0x45708b[_0x8386('0x4d')]);}}}this[_0x8386('0x10')][_0x36aa41[_0x8386('0x48')]]=_0x45708b;}}}catch(_0x5797d9){logger[_0x8386('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x36aa41[_0x8386('0x48')],util['inspect'](_0x5797d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x177f16){try{if(this['isNotNull'](_0x177f16)){logger[_0x8386('0x45')](_0x8386('0xa0'),_0x177f16['uniqueid'],util[_0x8386('0x3f')](_0x177f16,{'showHidden':![],'depth':null}));this[_0x8386('0xa1')](_0x177f16[_0x8386('0x48')],_[_0x8386('0x7a')](_0x177f16[_0x8386('0xa2')])[0x0],_0x177f16[_0x8386('0xa3')]);if(this[_0x8386('0x40')][_0x177f16[_0x8386('0x48')]]){var _0x3972f4=_[_0x8386('0x82')](this[_0x8386('0x40')][_0x177f16[_0x8386('0x48')]]);if(_0x3972f4){if(this[_0x8386('0x57')](_0x177f16[_0x8386('0xa2')])&&this[_0x8386('0x57')](_0x177f16[_0x8386('0xa2')][_0x8386('0x61')])){switch(_0x177f16[_0x8386('0xa3')]){case _0x8386('0xa4'):_0x3972f4[_0x8386('0x32')]=![];_0x3972f4[_0x8386('0x8f')]=null;break;case'TIMEOUT':_0x3972f4['lastevent']='timeout';_0x3972f4[_0x8386('0x32')]=!![];_0x3972f4[_0x8386('0x8f')]=moment()[_0x8386('0x4f')](_0x8386('0x74'));_0x3972f4['queuecallerleaveAt']=moment()[_0x8386('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x8386('0x45')](_0x8386('0xa5'),_0x177f16[_0x8386('0x48')],util[_0x8386('0x3f')](_0x3972f4,{'showHidden':![],'depth':null}));ami[_0x8386('0x44')](_0x8386('0xa6'),_0x3972f4);break;default:_0x3972f4['queuecallerexit']=!![];_0x3972f4[_0x8386('0x8f')]=moment()[_0x8386('0x4f')](_0x8386('0x74'));_0x3972f4[_0x8386('0x83')]=moment()[_0x8386('0x4f')](_0x8386('0x74'));}_0x3972f4[_0x8386('0x33')]=![];_0x3972f4[_0x8386('0x8c')]=null;_0x3972f4['queuecallerexitreason']=_0x177f16[_0x8386('0xa3')];this['channels'][_0x177f16[_0x8386('0x48')]]=_0x3972f4;this[_0x8386('0x4b')](_0x3972f4,_0x8386('0x21'));}else if(this['isNotNull'](_0x177f16[_0x8386('0xa2')])&&this['isNotNull'](_0x177f16[_0x8386('0xa2')][_0x8386('0xa7')])){if(!_0x3972f4['queuecallerabandon']){_0x3972f4['queuecallerexit']=!![];_0x3972f4[_0x8386('0x8f')]=moment()[_0x8386('0x4f')](_0x8386('0x74'));_0x3972f4['queuecallerexitreason']=_0x8386('0xa8');_0x3972f4[_0x8386('0x83')]=moment()[_0x8386('0x4f')](_0x8386('0x74'));this[_0x8386('0x10')][_0x177f16[_0x8386('0x48')]]=_0x3972f4;}}logger[_0x8386('0x76')](_0x8386('0xa9'),_0x177f16[_0x8386('0x48')],_0x3972f4['queue'],_0x3972f4[_0x8386('0x53')],_[_0x8386('0x7a')](_0x177f16[_0x8386('0xa2')])[0x0],_0x177f16[_0x8386('0xa3')]);_0x3972f4[_0x8386('0x15')]=this[_0x8386('0x15')][_0x177f16[_0x8386('0x48')]];}}}}catch(_0x49cbcb){logger[_0x8386('0x3d')](_0x8386('0xa0'),_0x177f16[_0x8386('0x48')],util[_0x8386('0x3f')](_0x49cbcb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0xa1')]=function(_0x3f1951,_0x7b7d86,_0x592099){var _0x1e62e5=['rtpaudioqos',_0x8386('0xaa'),_0x8386('0xab'),_0x8386('0xac'),'rtpaudioqosloss',_0x8386('0xad'),_0x8386('0xae'),'rtpaudioqosrttbridged','sipcallid',_0x8386('0xaf'),_0x8386('0xb0'),'bridgepvtcallid',_0x8386('0xb1'),_0x8386('0xb2'),_0x8386('0xb3'),_0x8386('0xb4'),'membername',_0x8386('0xb5'),_0x8386('0xb6')];if(!_[_0x8386('0x37')](_0x7b7d86)&&!_['includes'](_0x1e62e5,_0x7b7d86)){if(_['isUndefined'](this['variables'][_0x3f1951])){this[_0x8386('0x15')][_0x3f1951]={};}this['variables'][_0x3f1951][_0x7b7d86]=_0x592099;}};VoiceQueueReport[_0x8386('0xc')][_0x8386('0xb7')]=function(_0x35c25f,_0x1cc51b,_0x4a2ba3){try{var _0x4a332d={};if(this[_0x8386('0x40')][_0x35c25f]){for(var _0x6d2eed=0x0;_0x6d2eed{delete this[_0x8386('0x10')][_0x395823];},_0x265909);}};module[_0x8386('0xed')]=VoiceQueueReport; \ No newline at end of file diff --git a/server/services/ami/rpc/agentReportPreview.js b/server/services/ami/rpc/agentReportPreview.js index 27a3a17..517df43 100644 --- a/server/services/ami/rpc/agentReportPreview.js +++ b/server/services/ami/rpc/agentReportPreview.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47aa=['CreateReportAgentPreview','createHistory'];(function(_0x5c0979,_0x287854){var _0x309972=function(_0x17defd){while(--_0x17defd){_0x5c0979['push'](_0x5c0979['shift']());}};_0x309972(++_0x287854);}(_0x47aa,0x16d));var _0xa47a=function(_0x50212e,_0x1b2b2e){_0x50212e=_0x50212e-0x0;var _0x1525c8=_0x47aa[_0x50212e];return _0x1525c8;};'use strict';var client=require('../client');exports[_0xa47a('0x0')]=function(_0x41b12e){return function(){_0x41b12e['campaign']=_0x41b12e['queue'];return client['Request'](_0xa47a('0x1'),{'body':_0x41b12e,'log':'CreateReportAgentPreview'});};}; \ No newline at end of file +var _0x2e05=['Request','CreateReportAgentPreview','../client','createHistory','campaign','queue'];(function(_0xc15e30,_0x231639){var _0x5a2d88=function(_0x36893e){while(--_0x36893e){_0xc15e30['push'](_0xc15e30['shift']());}};_0x5a2d88(++_0x231639);}(_0x2e05,0x128));var _0x52e0=function(_0x5e5ecb,_0x2b519b){_0x5e5ecb=_0x5e5ecb-0x0;var _0x322b22=_0x2e05[_0x5e5ecb];return _0x322b22;};'use strict';var client=require(_0x52e0('0x0'));exports[_0x52e0('0x1')]=function(_0x1a4777){return function(){_0x1a4777[_0x52e0('0x2')]=_0x1a4777[_0x52e0('0x3')];return client[_0x52e0('0x4')](_0x52e0('0x5'),{'body':_0x1a4777,'log':_0x52e0('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/attachment.js b/server/services/ami/rpc/attachment.js index 532b72a..4c97901 100644 --- a/server/services/ami/rpc/attachment.js +++ b/server/services/ami/rpc/attachment.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53aa=['CreateAttachment','Request'];(function(_0x36ddae,_0x3c11e8){var _0x2fac2e=function(_0x4a3080){while(--_0x4a3080){_0x36ddae['push'](_0x36ddae['shift']());}};_0x2fac2e(++_0x3c11e8);}(_0x53aa,0x6d));var _0xa53a=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x53aa[_0x25d386];return _0x857f4a;};'use strict';var client=require('../client');exports['create']=function(_0x2f2dc1){return client[_0xa53a('0x0')]('CreateAttachment',{'body':_0x2f2dc1,'log':_0xa53a('0x1')});}; \ No newline at end of file +var _0x4f2f=['CreateAttachment','Request'];(function(_0x4da15a,_0x226d9d){var _0x314e82=function(_0x5d7e2a){while(--_0x5d7e2a){_0x4da15a['push'](_0x4da15a['shift']());}};_0x314e82(++_0x226d9d);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4f2f[_0x4cf98e];return _0x1623ac;};'use strict';var client=require('../client');exports['create']=function(_0x21c4bf){return client[_0xf4f2('0x0')]('CreateAttachment',{'body':_0x21c4bf,'log':_0xf4f2('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/campaign.js b/server/services/ami/rpc/campaign.js index 96af5c2..db8b9ef 100644 --- a/server/services/ami/rpc/campaign.js +++ b/server/services/ami/rpc/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x4266c7,_0x35c815){var _0xb87663=function(_0x4e9d0b){while(--_0x4e9d0b){_0x4266c7['push'](_0x4266c7['shift']());}};_0xb87663(++_0x35c815);}(_0x326f,0xd1));var _0xf326=function(_0x58e869,_0x596371){_0x58e869=_0x58e869-0x0;var _0x1a16b2=_0x326f[_0x58e869];return _0x1a16b2;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};}; \ No newline at end of file +var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x480e90,_0x512741){var _0x4b6e6d=function(_0x5ccef0){while(--_0x5ccef0){_0x480e90['push'](_0x480e90['shift']());}};_0x4b6e6d(++_0x512741);}(_0x326f,0xd1));var _0xf326=function(_0x4ba6ce,_0x404cc4){_0x4ba6ce=_0x4ba6ce-0x0;var _0x42377e=_0x326f[_0x4ba6ce];return _0x42377e;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmContact.js b/server/services/ami/rpc/cmContact.js index 66049a6..a7c4aed 100644 --- a/server/services/ami/rpc/cmContact.js +++ b/server/services/ami/rpc/cmContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1a8=['GetCmContact','../client','createContact','Request','CreateCmContact','getContacts'];(function(_0x5412e5,_0x604c7){var _0x2ee0e1=function(_0x55dd3c){while(--_0x55dd3c){_0x5412e5['push'](_0x5412e5['shift']());}};_0x2ee0e1(++_0x604c7);}(_0xb1a8,0xeb));var _0x8b1a=function(_0x19d7e9,_0x3c1fe7){_0x19d7e9=_0x19d7e9-0x0;var _0x48d705=_0xb1a8[_0x19d7e9];return _0x48d705;};'use strict';var client=require(_0x8b1a('0x0'));exports[_0x8b1a('0x1')]=function(_0x49ea51){return function(){return client[_0x8b1a('0x2')](_0x8b1a('0x3'),{'body':_0x49ea51,'log':_0x8b1a('0x3')});};};exports[_0x8b1a('0x4')]=function(_0x567c9d){return function(){return client[_0x8b1a('0x2')](_0x8b1a('0x5'),{'options':_0x567c9d,'log':_0x8b1a('0x5')});};}; \ No newline at end of file +var _0x6d2a=['createContact','Request','CreateCmContact','getContacts','GetCmContact'];(function(_0x3d4878,_0x4b8078){var _0x18f481=function(_0x42be43){while(--_0x42be43){_0x3d4878['push'](_0x3d4878['shift']());}};_0x18f481(++_0x4b8078);}(_0x6d2a,0x136));var _0xa6d2=function(_0x4e28c0,_0x1ef470){_0x4e28c0=_0x4e28c0-0x0;var _0x4039d4=_0x6d2a[_0x4e28c0];return _0x4039d4;};'use strict';var client=require('../client');exports[_0xa6d2('0x0')]=function(_0x3226d5){return function(){return client[_0xa6d2('0x1')]('CreateCmContact',{'body':_0x3226d5,'log':_0xa6d2('0x2')});};};exports[_0xa6d2('0x3')]=function(_0x1a89b2){return function(){return client[_0xa6d2('0x1')](_0xa6d2('0x4'),{'options':_0x1a89b2,'log':_0xa6d2('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopper.js b/server/services/ami/rpc/cmHopper.js index c0d8a42..ba9fe3f 100644 --- a/server/services/ami/rpc/cmHopper.js +++ b/server/services/ami/rpc/cmHopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c23=['resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','../client','moment','getContacts','Request','GetCmHopper','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','CmContact','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','ContactId','countReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','VoiceQueue','unlockContact','getContactRecallMe','GetContactRecallMe','User','voicePause','db.CmHopper.UserId'];(function(_0x4b602f,_0x29d7ba){var _0x283a73=function(_0x30b9d6){while(--_0x30b9d6){_0x4b602f['push'](_0x4b602f['shift']());}};_0x283a73(++_0x29d7ba);}(_0x0c23,0x13e));var _0x30c2=function(_0xadf660,_0x59f1dd){_0xadf660=_0xadf660-0x0;var _0xab229b=_0x0c23[_0xadf660];return _0xab229b;};'use strict';var client=require(_0x30c2('0x0'));var moment=require(_0x30c2('0x1'));exports[_0x30c2('0x2')]=function(_0x461cbb,_0x14066d){return function(){return client[_0x30c2('0x3')](_0x30c2('0x4'),{'options':{'where':{'VoiceQueueId':_0x461cbb},'include':[{'model':'CmContact','as':_0x30c2('0x5')}],'limit':_0x14066d,'raw':![]},'log':_0x30c2('0x6')});};};exports[_0x30c2('0x7')]=function(_0x2c453c,_0x28630b,_0x166e7a){return function(){return client['Request'](_0x30c2('0x8'),{'body':_0x2c453c,'options':{'where':{'VoiceQueueId':_0x28630b,'scheduledat':{'$lte':moment()[_0x30c2('0x9')](_0x30c2('0xa'))}},'limit':_0x166e7a},'log':_0x30c2('0x8')});};};exports[_0x30c2('0xb')]=function(_0x508c12){return client[_0x30c2('0x3')](_0x30c2('0x8'),{'body':_0x508c12,'options':{'where':{'ContactId':_0x508c12['ContactId'],'ListId':_0x508c12[_0x30c2('0xc')],'VoiceQueueId':_0x508c12[_0x30c2('0xd')],'CampaignId':_0x508c12[_0x30c2('0xe')]}},'log':_0x30c2('0xb')});};exports[_0x30c2('0xf')]=function(_0x17eb67,_0x526ba0,_0x4983f4){return function(){return client['Request'](_0x30c2('0x10'),{'options':{'where':{'VoiceQueueId':_0x17eb67,'ListId':_0x526ba0,'ContactId':_0x4983f4}},'log':_0x30c2('0x10')});};};exports[_0x30c2('0x11')]=function(_0x26d859,_0x396194,_0x1b94e3,_0x2712dc){return client['Request'](_0x30c2('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x26d859,'active':![],'scheduledat':{'$lte':moment()[_0x30c2('0x9')]('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x396194}}]},'order':[[_0x30c2('0x13'),_0x30c2('0x14')],[_0x30c2('0x15'),_0x2712dc],['id',_0x30c2('0x16')]],'raw':!![],'limit':_0x1b94e3},'log':_0x30c2('0x12')});};exports[_0x30c2('0x17')]=function(_0x170f58,_0x271d10,_0x1d6318){return client[_0x30c2('0x3')](_0x30c2('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x170f58,'active':![],'scheduledat':{'$lte':moment()[_0x30c2('0x9')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x30c2('0x18'),'as':'Contact'}],'order':[['priority',_0x30c2('0x14')],[_0x30c2('0x15'),_0x1d6318],['id',_0x30c2('0x16')]],'raw':!![],'limit':_0x271d10},'log':'GetContactDialerIvr'});};exports[_0x30c2('0x19')]=function(_0x1d0b52,_0x124140){_0x1d0b52[_0x30c2('0x1a')]=_0x1d0b52[_0x30c2('0x1b')];return client[_0x30c2('0x3')](_0x30c2('0x1c'),{'body':_0x1d0b52,'options':{'where':{'ContactId':_0x1d0b52[_0x30c2('0x1d')],'ListId':_0x1d0b52['ListId'],'VoiceQueueId':_0x1d0b52['VoiceQueueId'],'CampaignId':_0x1d0b52[_0x30c2('0xe')],'active':_0x124140?undefined:!![]}},'log':_0x30c2('0x1c')});};exports[_0x30c2('0x1e')]=function(_0x16f218){return client[_0x30c2('0x3')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x16f218['id']?_0x16f218['id']||null:null}},'log':_0x30c2('0x1e')});};exports[_0x30c2('0x1f')]=function(_0x1a11b1){return function(){return client['Request'](_0x30c2('0x20'),{'options':{'where':{'id':_0x1a11b1},'include':[{'model':_0x30c2('0x18'),'as':_0x30c2('0x5')},{'model':'User','as':_0x30c2('0x21'),'attributes':['id',_0x30c2('0x22')]},{'model':_0x30c2('0x23'),'as':'Queue','attributes':['id',_0x30c2('0x22')]}],'raw':!![]},'log':_0x30c2('0x6')});};};exports[_0x30c2('0x24')]=function(_0x382b1b,_0x5f3634,_0x4d00f3){return client[_0x30c2('0x3')]('UpdateCmHopper',{'body':_0x382b1b,'options':{'where':{'id':_0x5f3634},'limit':_0x4d00f3},'log':_0x30c2('0x8')});};exports[_0x30c2('0x25')]=function(_0x208b54,_0x5227bb){return function(){return client[_0x30c2('0x3')](_0x30c2('0x26'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x208b54,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x30c2('0xa'))},'UserId':{'$in':_0x5227bb}},'order':[[_0x30c2('0x13'),_0x30c2('0x14')],[_0x30c2('0x15'),_0x30c2('0x14')],['id',_0x30c2('0x16')]],'include':[{'model':_0x30c2('0x18'),'as':_0x30c2('0x5')},{'model':_0x30c2('0x27'),'as':_0x30c2('0x21'),'attributes':['id',_0x30c2('0x22'),_0x30c2('0x28')]}],'group':_0x30c2('0x29'),'raw':!![]},'log':_0x30c2('0x12')});};};exports[_0x30c2('0x2a')]=function(_0x474b91,_0xbff615){return client['Request']('ResetActiveCalls',{'body':_0x474b91,'options':_0xbff615||{},'log':_0x30c2('0x2b')});};exports['handlePreviewRecallNotifications']=function(_0x59bdde,_0x3c5117,_0x2557f3){return function(){return client['Request']('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x59bdde,'interval':_0x3c5117,'availableAgentsIds':_0x2557f3}},'log':_0x30c2('0x2c')});};}; \ No newline at end of file +var _0x8a28=['format','Contact','GetContactDialerIvr','campaign','queue','MoveContactManagedDialer','CampaignId','countReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','unlockContact','getContactRecallMe','GetContactRecallMe','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','handlePreviewRecallNotifications','../client','moment','getContacts','Request','GetCmHopper','CmContact','getCmHopper','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr'];(function(_0x4b043b,_0x598b17){var _0x398f5a=function(_0x59bea2){while(--_0x59bea2){_0x4b043b['push'](_0x4b043b['shift']());}};_0x398f5a(++_0x598b17);}(_0x8a28,0xfd));var _0x88a2=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x8a28[_0x4ae625];return _0x31accf;};'use strict';var client=require(_0x88a2('0x0'));var moment=require(_0x88a2('0x1'));exports[_0x88a2('0x2')]=function(_0x3c2c72,_0x27b1c1){return function(){return client[_0x88a2('0x3')](_0x88a2('0x4'),{'options':{'where':{'VoiceQueueId':_0x3c2c72},'include':[{'model':_0x88a2('0x5'),'as':'Contact'}],'limit':_0x27b1c1,'raw':![]},'log':_0x88a2('0x6')});};};exports[_0x88a2('0x7')]=function(_0x3c3392,_0x438e32,_0x29ce92){return function(){return client['Request'](_0x88a2('0x8'),{'body':_0x3c3392,'options':{'where':{'VoiceQueueId':_0x438e32,'scheduledat':{'$lte':moment()['format'](_0x88a2('0x9'))}},'limit':_0x29ce92},'log':_0x88a2('0x8')});};};exports[_0x88a2('0xa')]=function(_0xdbb322){return client[_0x88a2('0x3')](_0x88a2('0x8'),{'body':_0xdbb322,'options':{'where':{'ContactId':_0xdbb322[_0x88a2('0xb')],'ListId':_0xdbb322[_0x88a2('0xc')],'VoiceQueueId':_0xdbb322[_0x88a2('0xd')],'CampaignId':_0xdbb322['CampaignId']}},'log':'rescheduleContact'});};exports[_0x88a2('0xe')]=function(_0x430931,_0x14559e,_0xae0676){return function(){return client[_0x88a2('0x3')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x430931,'ListId':_0x14559e,'ContactId':_0xae0676}},'log':_0x88a2('0xf')});};};exports[_0x88a2('0x10')]=function(_0x367a7d,_0x21b05a,_0x5093c0,_0x923706){return client[_0x88a2('0x3')](_0x88a2('0x11'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x367a7d,'active':![],'scheduledat':{'$lte':moment()['format'](_0x88a2('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x21b05a}}]},'order':[[_0x88a2('0x12'),_0x88a2('0x13')],[_0x88a2('0x14'),_0x923706],['id',_0x88a2('0x15')]],'raw':!![],'limit':_0x5093c0},'log':_0x88a2('0x11')});};exports[_0x88a2('0x16')]=function(_0x2f5220,_0x2890d8,_0x417bf8){return client[_0x88a2('0x3')](_0x88a2('0x11'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2f5220,'active':![],'scheduledat':{'$lte':moment()[_0x88a2('0x17')](_0x88a2('0x9'))}},'include':[{'model':_0x88a2('0x5'),'as':_0x88a2('0x18')}],'order':[[_0x88a2('0x12'),_0x88a2('0x13')],['scheduledat',_0x417bf8],['id',_0x88a2('0x15')]],'raw':!![],'limit':_0x2890d8},'log':_0x88a2('0x19')});};exports['moveContactManagedDialer']=function(_0x499891,_0x7a054c){_0x499891[_0x88a2('0x1a')]=_0x499891[_0x88a2('0x1b')];return client[_0x88a2('0x3')](_0x88a2('0x1c'),{'body':_0x499891,'options':{'where':{'ContactId':_0x499891['ContactId'],'ListId':_0x499891[_0x88a2('0xc')],'VoiceQueueId':_0x499891[_0x88a2('0xd')],'CampaignId':_0x499891[_0x88a2('0x1d')],'active':_0x7a054c?undefined:!![]}},'log':_0x88a2('0x1c')});};exports['countReScheduled']=function(_0x1f104c){return client['Request']('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x1f104c['id']?_0x1f104c['id']||null:null}},'log':_0x88a2('0x1e')});};exports[_0x88a2('0x1f')]=function(_0x4ec713){return function(){return client['Request'](_0x88a2('0x20'),{'options':{'where':{'id':_0x4ec713},'include':[{'model':_0x88a2('0x5'),'as':'Contact'},{'model':_0x88a2('0x21'),'as':_0x88a2('0x22'),'attributes':['id',_0x88a2('0x23')]},{'model':_0x88a2('0x24'),'as':'Queue','attributes':['id',_0x88a2('0x23')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x88a2('0x25')]=function(_0x3d9e8a,_0x39249a,_0x4bb833){return client[_0x88a2('0x3')](_0x88a2('0x8'),{'body':_0x3d9e8a,'options':{'where':{'id':_0x39249a},'limit':_0x4bb833},'log':'UpdateCmHopper'});};exports[_0x88a2('0x26')]=function(_0x537a8f,_0x541cd0){return function(){return client['Request'](_0x88a2('0x27'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x537a8f,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x88a2('0x17')](_0x88a2('0x9'))},'UserId':{'$in':_0x541cd0}},'order':[[_0x88a2('0x12'),_0x88a2('0x13')],[_0x88a2('0x14'),'DESC'],['id',_0x88a2('0x15')]],'include':[{'model':_0x88a2('0x5'),'as':_0x88a2('0x18')},{'model':_0x88a2('0x21'),'as':_0x88a2('0x22'),'attributes':['id',_0x88a2('0x23'),_0x88a2('0x28')]}],'group':_0x88a2('0x29'),'raw':!![]},'log':_0x88a2('0x11')});};};exports[_0x88a2('0x2a')]=function(_0x4db7b1,_0x5afbce){return client[_0x88a2('0x3')](_0x88a2('0x2b'),{'body':_0x4db7b1,'options':_0x5afbce||{},'log':_0x88a2('0x2b')});};exports['handlePreviewRecallNotifications']=function(_0x3ea9d0,_0x12acdf,_0x57dc2f){return function(){return client[_0x88a2('0x3')](_0x88a2('0x2c'),{'body':{'where':{'voiceQueueIds':_0x3ea9d0,'interval':_0x12acdf,'availableAgentsIds':_0x57dc2f}},'log':_0x88a2('0x2d')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperAdditionalPhone.js b/server/services/ami/rpc/cmHopperAdditionalPhone.js index de1c939..43d6df2 100644 --- a/server/services/ami/rpc/cmHopperAdditionalPhone.js +++ b/server/services/ami/rpc/cmHopperAdditionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf29=['SwapAdditionalPhones','incrementPreviewCounters','Request','IncrementPreviewCounters','../client','verifyAdditionalPhones','VerifyAdditionalPhones','swapAdditionalPhones'];(function(_0x36c932,_0x1804b7){var _0xca46dc=function(_0x8a79a9){while(--_0x8a79a9){_0x36c932['push'](_0x36c932['shift']());}};_0xca46dc(++_0x1804b7);}(_0xcf29,0xcc));var _0x9cf2=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0xcf29[_0x786e9];return _0x1f891b;};'use strict';var client=require(_0x9cf2('0x0'));exports[_0x9cf2('0x1')]=function(_0x8e1a5f,_0x1ca953,_0x24d0d2){return client['Request']('VerifyAdditionalPhones',{'body':_0x8e1a5f,'reason':_0x1ca953,'entity':_0x24d0d2,'log':_0x9cf2('0x2')});};exports[_0x9cf2('0x3')]=function(_0x38562f,_0x3a0f9a,_0x267079){return client['Request'](_0x9cf2('0x4'),{'body':_0x38562f,'duration':_0x3a0f9a,'waitTime':_0x267079,'log':_0x9cf2('0x4')});};exports[_0x9cf2('0x5')]=function(_0x3e4315){return function(){return client[_0x9cf2('0x6')](_0x9cf2('0x7'),{'body':_0x3e4315,'log':_0x9cf2('0x7')});};}; \ No newline at end of file +var _0xaedf=['verifyAdditionalPhones','VerifyAdditionalPhones','Request','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xaedf,0x1b8));var _0xfaed=function(_0x4385e8,_0x1c455a){_0x4385e8=_0x4385e8-0x0;var _0x26d658=_0xaedf[_0x4385e8];return _0x26d658;};'use strict';var client=require(_0xfaed('0x0'));exports[_0xfaed('0x1')]=function(_0xb0845d,_0x379a9d,_0x49be51){return client['Request'](_0xfaed('0x2'),{'body':_0xb0845d,'reason':_0x379a9d,'entity':_0x49be51,'log':_0xfaed('0x2')});};exports['swapAdditionalPhones']=function(_0x1deceb,_0x41ff4a,_0x4fb13f){return client[_0xfaed('0x3')](_0xfaed('0x4'),{'body':_0x1deceb,'duration':_0x41ff4a,'waitTime':_0x4fb13f,'log':_0xfaed('0x4')});};exports[_0xfaed('0x5')]=function(_0x4a43bf){return function(){return client[_0xfaed('0x3')](_0xfaed('0x6'),{'body':_0x4a43bf,'log':'IncrementPreviewCounters'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperBlack.js b/server/services/ami/rpc/cmHopperBlack.js index 5ffe411..67863f8 100644 --- a/server/services/ami/rpc/cmHopperBlack.js +++ b/server/services/ami/rpc/cmHopperBlack.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17d3=['GetCmHopperBlack','checkIsBlackListIvr','Request','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','phone'];(function(_0x184a56,_0x503f50){var _0x89ba34=function(_0x2cce45){while(--_0x2cce45){_0x184a56['push'](_0x184a56['shift']());}};_0x89ba34(++_0x503f50);}(_0x17d3,0x13d));var _0x317d=function(_0x3b43f1,_0x42f22b){_0x3b43f1=_0x3b43f1-0x0;var _0x4c4401=_0x17d3[_0x3b43f1];return _0x4c4401;};'use strict';var client=require(_0x317d('0x0'));exports[_0x317d('0x1')]=function(_0x397605){return client['Request']('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x397605['VoiceQueueId'],'phone':_0x397605[_0x317d('0x2')]},'raw':![]},'log':_0x317d('0x3')});};exports[_0x317d('0x4')]=function(_0x1cbdb8){return client[_0x317d('0x5')](_0x317d('0x3'),{'options':{'where':{'CampaignId':_0x1cbdb8[_0x317d('0x6')],'phone':_0x1cbdb8['phone']},'raw':![]},'log':_0x317d('0x7')});}; \ No newline at end of file +var _0xf2fe=['VoiceQueueId','phone','checkIsBlackListIvr','../client','checkIsBlackList','Request','GetCmHopperBlack'];(function(_0x3da225,_0x3f410c){var _0x3c05d4=function(_0x14f8d9){while(--_0x14f8d9){_0x3da225['push'](_0x3da225['shift']());}};_0x3c05d4(++_0x3f410c);}(_0xf2fe,0x8f));var _0xef2f=function(_0x377dbd,_0xf30c3d){_0x377dbd=_0x377dbd-0x0;var _0x4f54e0=_0xf2fe[_0x377dbd];return _0x4f54e0;};'use strict';var client=require(_0xef2f('0x0'));exports[_0xef2f('0x1')]=function(_0x276ce3){return client[_0xef2f('0x2')](_0xef2f('0x3'),{'options':{'where':{'VoiceQueueId':_0x276ce3[_0xef2f('0x4')],'phone':_0x276ce3[_0xef2f('0x5')]},'raw':![]},'log':_0xef2f('0x3')});};exports[_0xef2f('0x6')]=function(_0x238b13){return client[_0xef2f('0x2')](_0xef2f('0x3'),{'options':{'where':{'CampaignId':_0x238b13['CampaignId'],'phone':_0x238b13[_0xef2f('0x5')]},'raw':![]},'log':'GetCmHopperBlackIvr'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperFinal.js b/server/services/ami/rpc/cmHopperFinal.js index b76b59f..9d4dce5 100644 --- a/server/services/ami/rpc/cmHopperFinal.js +++ b/server/services/ami/rpc/cmHopperFinal.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ab0=['createContact','queue','CreateCmHopperFinal','../client'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x9ab0,0x19b));var _0x09ab=function(_0x52b472,_0x4ed28e){_0x52b472=_0x52b472-0x0;var _0x13254d=_0x9ab0[_0x52b472];return _0x13254d;};'use strict';var client=require(_0x09ab('0x0'));exports[_0x09ab('0x1')]=function(_0x237e6){return function(){_0x237e6['campaign']=_0x237e6[_0x09ab('0x2')];return client['Request'](_0x09ab('0x3'),{'body':_0x237e6,'log':_0x09ab('0x3')});};}; \ No newline at end of file +var _0xc92b=['../client','queue','Request','CreateCmHopperFinal'];(function(_0x1aa85d,_0x227ebb){var _0x487537=function(_0x214516){while(--_0x214516){_0x1aa85d['push'](_0x1aa85d['shift']());}};_0x487537(++_0x227ebb);}(_0xc92b,0xb8));var _0xbc92=function(_0x9a0465,_0x331b3f){_0x9a0465=_0x9a0465-0x0;var _0x1de86f=_0xc92b[_0x9a0465];return _0x1de86f;};'use strict';var client=require(_0xbc92('0x0'));exports['createContact']=function(_0x13f6cd){return function(){_0x13f6cd['campaign']=_0x13f6cd[_0xbc92('0x1')];return client[_0xbc92('0x2')](_0xbc92('0x3'),{'body':_0x13f6cd,'log':'CreateCmHopperFinal'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperHistory.js b/server/services/ami/rpc/cmHopperHistory.js index 760e639..baa17ef 100644 --- a/server/services/ami/rpc/cmHopperHistory.js +++ b/server/services/ami/rpc/cmHopperHistory.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4365=['minutes','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','startOf','day','format','endOf','queue','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivr','moment','campaign','Request','CreateCmHopperHistory','avgHandleTime','subtract'];(function(_0x21d2a6,_0x44c6cc){var _0x3a5b9f=function(_0x49353f){while(--_0x49353f){_0x21d2a6['push'](_0x21d2a6['shift']());}};_0x3a5b9f(++_0x44c6cc);}(_0x4365,0x82));var _0x5436=function(_0x248c97,_0x1d9091){_0x248c97=_0x248c97-0x0;var _0x23b211=_0x4365[_0x248c97];return _0x23b211;};'use strict';var client=require('../client');var moment=require(_0x5436('0x0'));exports['createHistory']=function(_0x41a4fe){_0x41a4fe[_0x5436('0x1')]=_0x41a4fe['queue'];return client[_0x5436('0x2')](_0x5436('0x3'),{'body':_0x41a4fe,'log':'CreateCmHopperHistory'});};exports[_0x5436('0x4')]=function(_0x46fede){return client[_0x5436('0x2')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x5436('0x5')](_0x46fede,_0x5436('0x6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0x5436('0x7'))]}},'raw':![]},'log':_0x5436('0x8')});};exports['getVoiceQueueHopperHistory']=function(){return function(){return client[_0x5436('0x2')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x5436('0x9')](_0x5436('0xa'))[_0x5436('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x5436('0xc')](_0x5436('0xa'))[_0x5436('0xb')](_0x5436('0x7'))]},'campaigntype':_0x5436('0xd')},'raw':![]},'log':_0x5436('0xe')});};};exports['getCampaignHopperHistory']=function(){return function(){return client[_0x5436('0x2')](_0x5436('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x5436('0x9')](_0x5436('0xa'))['format'](_0x5436('0x7')),moment()[_0x5436('0xc')](_0x5436('0xa'))[_0x5436('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x5436('0x10')},'raw':![]},'log':'GetCampaignHopperHistory'});};}; \ No newline at end of file +var _0x4ddb=['CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','day','queue','getCampaignHopperHistory','endOf','ivr','GetCampaignHopperHistory','../client','moment','Request'];(function(_0x21b7f2,_0x55c1d4){var _0x1c86da=function(_0xf445ef){while(--_0xf445ef){_0x21b7f2['push'](_0x21b7f2['shift']());}};_0x1c86da(++_0x55c1d4);}(_0x4ddb,0x107));var _0xb4dd=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0x4ddb[_0x3b87f4];return _0x63d16e;};'use strict';var client=require(_0xb4dd('0x0'));var moment=require(_0xb4dd('0x1'));exports['createHistory']=function(_0x3a7bf0){_0x3a7bf0['campaign']=_0x3a7bf0['queue'];return client[_0xb4dd('0x2')]('CreateCmHopperHistory',{'body':_0x3a7bf0,'log':_0xb4dd('0x3')});};exports[_0xb4dd('0x4')]=function(_0x5423e7){return client['Request'](_0xb4dd('0x5'),{'options':{'where':{'endtime':{'$between':[moment()[_0xb4dd('0x6')](_0x5423e7,_0xb4dd('0x7'))[_0xb4dd('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xb4dd('0x8')](_0xb4dd('0x9'))]}},'raw':![]},'log':_0xb4dd('0xa')});};exports['getVoiceQueueHopperHistory']=function(){return function(){return client[_0xb4dd('0x2')](_0xb4dd('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xb4dd('0xc')](_0xb4dd('0xd'))[_0xb4dd('0x8')](_0xb4dd('0x9')),moment()['endOf'](_0xb4dd('0xd'))['format'](_0xb4dd('0x9'))]},'campaigntype':_0xb4dd('0xe')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0xb4dd('0xf')]=function(){return function(){return client['Request']('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xb4dd('0xd'))[_0xb4dd('0x8')](_0xb4dd('0x9')),moment()[_0xb4dd('0x10')](_0xb4dd('0xd'))[_0xb4dd('0x8')](_0xb4dd('0x9'))]},'campaigntype':_0xb4dd('0x11')},'raw':![]},'log':_0xb4dd('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/faxAccount.js b/server/services/ami/rpc/faxAccount.js index 7e1992e..d939f3f 100644 --- a/server/services/ami/rpc/faxAccount.js +++ b/server/services/ami/rpc/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ac2=['tech','TrunkId','ListId','key','callerid','active','getFaxAccount','NotifyFaxAccount','../client','Request','GetFaxAccount','name','description','ecm','headerinfo','minrate','modem','gateway','faxdetect','t38timeout'];(function(_0x5a6707,_0xdefaf3){var _0x5b58c5=function(_0xf7f131){while(--_0xf7f131){_0x5a6707['push'](_0x5a6707['shift']());}};_0x5b58c5(++_0xdefaf3);}(_0x6ac2,0x184));var _0x26ac=function(_0x29dce3,_0x126f7f){_0x29dce3=_0x29dce3-0x0;var _0xe0701=_0x6ac2[_0x29dce3];return _0xe0701;};'use strict';var client=require(_0x26ac('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x26ac('0x1')](_0x26ac('0x2'),{'options':{'raw':![],'attributes':['id',_0x26ac('0x3'),_0x26ac('0x4'),_0x26ac('0x5'),_0x26ac('0x6'),'localstationid',_0x26ac('0x7'),'maxrate',_0x26ac('0x8'),_0x26ac('0x9'),_0x26ac('0xa'),_0x26ac('0xb'),_0x26ac('0xc'),_0x26ac('0xd'),_0x26ac('0xe'),_0x26ac('0xf')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x26ac('0x3'),_0x26ac('0x10'),_0x26ac('0x11')]}]},'log':_0x26ac('0x12')});};};exports['notify']=function(_0x11e8a1,_0x2507f9){return client[_0x26ac('0x1')](_0x26ac('0x13'),{'account':{'id':_0x11e8a1},'body':_0x2507f9,'log':'NotifyFaxAccount'});}; \ No newline at end of file +var _0xcabe=['NotifyFaxAccount','../client','Request','GetFaxAccount','description','ecm','localstationid','minrate','maxrate','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','active','getFaxAccount'];(function(_0x5e9b6e,_0x37cf45){var _0x469cef=function(_0x9c5840){while(--_0x9c5840){_0x5e9b6e['push'](_0x5e9b6e['shift']());}};_0x469cef(++_0x37cf45);}(_0xcabe,0x1ef));var _0xecab=function(_0xf6f768,_0x42c4d6){_0xf6f768=_0xf6f768-0x0;var _0xbd237=_0xcabe[_0xf6f768];return _0xbd237;};'use strict';var client=require(_0xecab('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0xecab('0x1')](_0xecab('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xecab('0x3'),_0xecab('0x4'),'headerinfo',_0xecab('0x5'),_0xecab('0x6'),_0xecab('0x7'),'modem',_0xecab('0x8'),_0xecab('0x9'),_0xecab('0xa'),_0xecab('0xb'),_0xecab('0xc'),_0xecab('0xd'),_0xecab('0xe')],'include':[{'model':_0xecab('0xf'),'as':_0xecab('0xf'),'attributes':['id','name','callerid',_0xecab('0x10')]}]},'log':_0xecab('0x11')});};};exports['notify']=function(_0x445617,_0x3e9db8){return client[_0xecab('0x1')](_0xecab('0x12'),{'account':{'id':_0x445617},'body':_0x3e9db8,'log':_0xecab('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/faxMessage.js b/server/services/ami/rpc/faxMessage.js index 8839d5a..308d565 100644 --- a/server/services/ami/rpc/faxMessage.js +++ b/server/services/ami/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c01=['update','Request','UpdateFaxMessage','../client'];(function(_0x4ce612,_0x20fd12){var _0x4807=function(_0x28fdff){while(--_0x28fdff){_0x4ce612['push'](_0x4ce612['shift']());}};_0x4807(++_0x20fd12);}(_0x6c01,0x1c7));var _0x16c0=function(_0xa7e916,_0x3e7ff8){_0xa7e916=_0xa7e916-0x0;var _0x21261c=_0x6c01[_0xa7e916];return _0x21261c;};'use strict';var client=require(_0x16c0('0x0'));exports[_0x16c0('0x1')]=function(_0x2e2a79,_0x239337){return client[_0x16c0('0x2')](_0x16c0('0x3'),{'body':_0x239337,'options':{'where':{'AttachmentId':_0x2e2a79}},'log':'UpdateFaxMessage'});}; \ No newline at end of file +var _0x51f8=['../client','Request','UpdateFaxMessage'];(function(_0x1c9c23,_0x40544e){var _0x2f807f=function(_0x2b2f3b){while(--_0x2b2f3b){_0x1c9c23['push'](_0x1c9c23['shift']());}};_0x2f807f(++_0x40544e);}(_0x51f8,0x1b3));var _0x851f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x51f8[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x851f('0x0'));exports['update']=function(_0x84805e,_0x174aa5){return client[_0x851f('0x1')]('UpdateFaxMessage',{'body':_0x174aa5,'options':{'where':{'AttachmentId':_0x84805e}},'log':_0x851f('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/desk.js b/server/services/ami/rpc/integrations/desk.js index 019df87..f3b548d 100644 --- a/server/services/ami/rpc/integrations/desk.js +++ b/server/services/ami/rpc/integrations/desk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf49e=['customField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl','Configurations','DeskField','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields'];(function(_0x331e11,_0x475e39){var _0x18a2bd=function(_0x24c571){while(--_0x24c571){_0x331e11['push'](_0x331e11['shift']());}};_0x18a2bd(++_0x475e39);}(_0xf49e,0x1c5));var _0xef49=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf49e[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0xef49('0x0'));exports[_0xef49('0x1')]=function(){return function(_0x23b4a4){return client[_0xef49('0x2')](_0xef49('0x3'),{'options':{'raw':![],'attributes':['id',_0xef49('0x4'),_0xef49('0x5'),_0xef49('0x6'),_0xef49('0x7'),_0xef49('0x8'),_0xef49('0x9'),_0xef49('0xa'),_0xef49('0xb')],'include':[{'model':'DeskConfiguration','as':_0xef49('0xc'),'attributes':['id',_0xef49('0x4')],'include':[{'model':_0xef49('0xd'),'as':'Subjects','attributes':['id',_0xef49('0xa'),_0xef49('0xe'),_0xef49('0xf')],'include':[{'model':_0xef49('0x10'),'as':_0xef49('0x10'),'attributes':['id',_0xef49('0x4')]}]},{'model':_0xef49('0xd'),'as':_0xef49('0x11'),'attributes':['id',_0xef49('0xa'),_0xef49('0xe'),_0xef49('0x12'),_0xef49('0x13'),_0xef49('0x14'),_0xef49('0xf')],'include':[{'model':_0xef49('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':_0xef49('0xd'),'as':_0xef49('0x15'),'attributes':['id',_0xef49('0xa'),_0xef49('0xe'),'idField','nameField',_0xef49('0x16'),_0xef49('0xf')],'include':[{'model':_0xef49('0x10'),'as':'Variable','attributes':['id',_0xef49('0x4')]}]},{'model':_0xef49('0x17'),'as':_0xef49('0x18'),'attributes':['id',_0xef49('0x4')]}]}]},'log':_0xef49('0x3')});};}; \ No newline at end of file +var _0x1d47=['keyContent','customField','Tag','Tags','GetDeskAccount','../../client','getDeskAccounts','Request','name','username','remoteUri','authType','DeskConfiguration','Configurations','type','variableName','Variable','DeskField','Descriptions','content','keyType'];(function(_0x5e6c73,_0x476594){var _0x3e4f33=function(_0x2aff46){while(--_0x2aff46){_0x5e6c73['push'](_0x5e6c73['shift']());}};_0x3e4f33(++_0x476594);}(_0x1d47,0xec));var _0x71d4=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1d47[_0x5d4607];return _0x5e4a86;};'use strict';var client=require(_0x71d4('0x0'));exports[_0x71d4('0x1')]=function(){return function(_0x5b0acc){return client[_0x71d4('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x71d4('0x3'),'description',_0x71d4('0x4'),'password',_0x71d4('0x5'),_0x71d4('0x6'),'type','serverUrl'],'include':[{'model':_0x71d4('0x7'),'as':_0x71d4('0x8'),'attributes':['id','name'],'include':[{'model':'DeskField','as':'Subjects','attributes':['id',_0x71d4('0x9'),'content',_0x71d4('0xa')],'include':[{'model':'Variable','as':_0x71d4('0xb'),'attributes':['id',_0x71d4('0x3')]}]},{'model':_0x71d4('0xc'),'as':_0x71d4('0xd'),'attributes':['id',_0x71d4('0x9'),_0x71d4('0xe'),'key',_0x71d4('0xf'),_0x71d4('0x10'),_0x71d4('0xa')],'include':[{'model':_0x71d4('0xb'),'as':_0x71d4('0xb'),'attributes':['id',_0x71d4('0x3')]}]},{'model':_0x71d4('0xc'),'as':'Fields','attributes':['id',_0x71d4('0x9'),_0x71d4('0xe'),'idField','nameField',_0x71d4('0x11'),_0x71d4('0xa')],'include':[{'model':_0x71d4('0xb'),'as':_0x71d4('0xb'),'attributes':['id',_0x71d4('0x3')]}]},{'model':_0x71d4('0x12'),'as':_0x71d4('0x13'),'attributes':['id',_0x71d4('0x3')]}]}]},'log':_0x71d4('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/dynamics365.js b/server/services/ami/rpc/integrations/dynamics365.js index 93802fe..04f1f0c 100644 --- a/server/services/ami/rpc/integrations/dynamics365.js +++ b/server/services/ami/rpc/integrations/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d9b=['moduleCreate','additionalSearchContact','openNewTab','variableName','Variable','Dynamics365Field','Descriptions','content','keyType','keyContent','Fields','idField','nameField','customField','data2','data5','data7','getDynamics365Accounts','GetDynamics365Account','username','password','remoteUri','clientId','serverUrl','description','Dynamics365Configuration','Configurations','name','ticketType'];(function(_0x14f006,_0x258850){var _0x4d08c4=function(_0x5b8c2b){while(--_0x5b8c2b){_0x14f006['push'](_0x14f006['shift']());}};_0x4d08c4(++_0x258850);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x1b095d,_0x165325){_0x1b095d=_0x1b095d-0x0;var _0x3b3480=_0x9d9b[_0x1b095d];return _0x3b3480;};'use strict';var client=require('../../client');exports[_0xb9d9('0x0')]=function(){return function(_0x2c6a23){return client['Request'](_0xb9d9('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xb9d9('0x2'),_0xb9d9('0x3'),_0xb9d9('0x4'),'tenantId',_0xb9d9('0x5'),'clientSecret',_0xb9d9('0x6'),_0xb9d9('0x7'),'modernAuthentication'],'include':[{'model':_0xb9d9('0x8'),'as':_0xb9d9('0x9'),'attributes':['id',_0xb9d9('0xa'),_0xb9d9('0xb'),_0xb9d9('0xc'),_0xb9d9('0xd'),_0xb9d9('0xe')],'include':[{'model':'Dynamics365Field','as':'Subjects','attributes':['id','type','content',_0xb9d9('0xf')],'include':[{'model':_0xb9d9('0x10'),'as':_0xb9d9('0x10'),'attributes':['id','name']}]},{'model':_0xb9d9('0x11'),'as':_0xb9d9('0x12'),'attributes':['id','type',_0xb9d9('0x13'),'key',_0xb9d9('0x14'),_0xb9d9('0x15'),_0xb9d9('0xf')],'include':[{'model':_0xb9d9('0x10'),'as':_0xb9d9('0x10'),'attributes':['id',_0xb9d9('0xa')]}]},{'model':_0xb9d9('0x11'),'as':_0xb9d9('0x16'),'attributes':['id','type','content',_0xb9d9('0x17'),_0xb9d9('0x18'),_0xb9d9('0x19'),_0xb9d9('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xb9d9('0xa')]}]}]},{'model':'CloudProvider','as':'CloudProvider','attributes':['id',_0xb9d9('0x1a'),_0xb9d9('0x1b'),_0xb9d9('0x1c')]}]},'log':'GetDynamics365Account'});};}; \ No newline at end of file +var _0xd2bf=['password','tenantId','clientId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','ticketType','moduleCreate','additionalSearchContact','openNewTab','Dynamics365Field','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','Fields','nameField','customField','data2','data5','data7','../../client','GetDynamics365Account','name'];(function(_0x1dee88,_0x361904){var _0x399f8c=function(_0x4ba160){while(--_0x4ba160){_0x1dee88['push'](_0x1dee88['shift']());}};_0x399f8c(++_0x361904);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0xd2bf[_0x7ad123];return _0x37d073;};'use strict';var client=require(_0xfd2b('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x4fba3c){return client['Request'](_0xfd2b('0x1'),{'options':{'raw':![],'attributes':['id',_0xfd2b('0x2'),'username',_0xfd2b('0x3'),'remoteUri',_0xfd2b('0x4'),_0xfd2b('0x5'),_0xfd2b('0x6'),_0xfd2b('0x7'),_0xfd2b('0x8'),'modernAuthentication'],'include':[{'model':_0xfd2b('0x9'),'as':_0xfd2b('0xa'),'attributes':['id',_0xfd2b('0x2'),_0xfd2b('0xb'),_0xfd2b('0xc'),_0xfd2b('0xd'),_0xfd2b('0xe')],'include':[{'model':_0xfd2b('0xf'),'as':_0xfd2b('0x10'),'attributes':['id',_0xfd2b('0x11'),_0xfd2b('0x12'),_0xfd2b('0x13')],'include':[{'model':_0xfd2b('0x14'),'as':_0xfd2b('0x14'),'attributes':['id','name']}]},{'model':_0xfd2b('0xf'),'as':_0xfd2b('0x15'),'attributes':['id',_0xfd2b('0x11'),'content',_0xfd2b('0x16'),'keyType',_0xfd2b('0x17'),_0xfd2b('0x13')],'include':[{'model':_0xfd2b('0x14'),'as':'Variable','attributes':['id',_0xfd2b('0x2')]}]},{'model':_0xfd2b('0xf'),'as':_0xfd2b('0x18'),'attributes':['id',_0xfd2b('0x11'),_0xfd2b('0x12'),'idField',_0xfd2b('0x19'),_0xfd2b('0x1a'),_0xfd2b('0x13')],'include':[{'model':_0xfd2b('0x14'),'as':_0xfd2b('0x14'),'attributes':['id',_0xfd2b('0x2')]}]}]},{'model':'CloudProvider','as':'CloudProvider','attributes':['id',_0xfd2b('0x1b'),_0xfd2b('0x1c'),_0xfd2b('0x1d')]}]},'log':_0xfd2b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/freshdesk.js b/server/services/ami/rpc/integrations/freshdesk.js index 52613fd..f24d074 100644 --- a/server/services/ami/rpc/integrations/freshdesk.js +++ b/server/services/ami/rpc/integrations/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd71d=['idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','username','apiKey','remoteUri','FreshdeskConfiguration','Configurations','name','FreshdeskField','Subjects','type','variableName','Variable','content','key','keyType','Fields'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xd71d,0x1a5));var _0xdd71=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xd71d[_0x15876a];return _0xbd900f;};'use strict';var client=require(_0xdd71('0x0'));exports[_0xdd71('0x1')]=function(){return function(_0x164949){return client[_0xdd71('0x2')](_0xdd71('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdd71('0x4'),_0xdd71('0x5'),_0xdd71('0x6'),'serverUrl'],'include':[{'model':_0xdd71('0x7'),'as':_0xdd71('0x8'),'attributes':['id',_0xdd71('0x9')],'include':[{'model':'Tag','attributes':['id',_0xdd71('0x9')]},{'model':_0xdd71('0xa'),'as':_0xdd71('0xb'),'attributes':['id',_0xdd71('0xc'),'content',_0xdd71('0xd')],'include':[{'model':_0xdd71('0xe'),'as':_0xdd71('0xe'),'attributes':['id',_0xdd71('0x9')]}]},{'model':_0xdd71('0xa'),'as':'Descriptions','attributes':['id',_0xdd71('0xc'),_0xdd71('0xf'),_0xdd71('0x10'),_0xdd71('0x11'),'keyContent',_0xdd71('0xd')],'include':[{'model':_0xdd71('0xe'),'as':_0xdd71('0xe'),'attributes':['id',_0xdd71('0x9')]}]},{'model':_0xdd71('0xa'),'as':_0xdd71('0x12'),'attributes':['id','type',_0xdd71('0xf'),_0xdd71('0x13'),_0xdd71('0x14'),_0xdd71('0x15'),'variableName'],'include':[{'model':_0xdd71('0xe'),'as':_0xdd71('0xe'),'attributes':['id',_0xdd71('0x9')]}]}]}]},'log':_0xdd71('0x3')});};}; \ No newline at end of file +var _0x4e34=['FreshdeskConfiguration','Tag','name','FreshdeskField','Subjects','type','content','variableName','Variable','keyContent','Fields','idField','nameField','customField','GetFreshdeskAccount','Request','username','remoteUri','serverUrl'];(function(_0x4f7b5e,_0x555f6f){var _0x4bac7b=function(_0x45fc9b){while(--_0x45fc9b){_0x4f7b5e['push'](_0x4f7b5e['shift']());}};_0x4bac7b(++_0x555f6f);}(_0x4e34,0x19e));var _0x44e3=function(_0x4fee74,_0x52dc94){_0x4fee74=_0x4fee74-0x0;var _0x1720c5=_0x4e34[_0x4fee74];return _0x1720c5;};'use strict';var client=require('../../client');exports['getFreshdeskAccounts']=function(){return function(_0x44f62b){return client[_0x44e3('0x0')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id','name',_0x44e3('0x1'),'apiKey',_0x44e3('0x2'),_0x44e3('0x3')],'include':[{'model':_0x44e3('0x4'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x44e3('0x5'),'attributes':['id',_0x44e3('0x6')]},{'model':_0x44e3('0x7'),'as':_0x44e3('0x8'),'attributes':['id',_0x44e3('0x9'),_0x44e3('0xa'),_0x44e3('0xb')],'include':[{'model':'Variable','as':_0x44e3('0xc'),'attributes':['id',_0x44e3('0x6')]}]},{'model':'FreshdeskField','as':'Descriptions','attributes':['id',_0x44e3('0x9'),_0x44e3('0xa'),'key','keyType',_0x44e3('0xd'),_0x44e3('0xb')],'include':[{'model':_0x44e3('0xc'),'as':_0x44e3('0xc'),'attributes':['id','name']}]},{'model':_0x44e3('0x7'),'as':_0x44e3('0xe'),'attributes':['id',_0x44e3('0x9'),_0x44e3('0xa'),_0x44e3('0xf'),_0x44e3('0x10'),_0x44e3('0x11'),_0x44e3('0xb')],'include':[{'model':'Variable','as':_0x44e3('0xc'),'attributes':['id','name']}]}]}]},'log':_0x44e3('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/freshsales.js b/server/services/ami/rpc/integrations/freshsales.js index b2426ef..af5ca3a 100644 --- a/server/services/ami/rpc/integrations/freshsales.js +++ b/server/services/ami/rpc/integrations/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39e6=['username','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions','key','GetFreshsalesccount','../../client','name'];(function(_0x4a9691,_0x2e40bb){var _0xcc72f5=function(_0x1010af){while(--_0x1010af){_0x4a9691['push'](_0x4a9691['shift']());}};_0xcc72f5(++_0x2e40bb);}(_0x39e6,0x9e));var _0x639e=function(_0x10ee05,_0x4e2028){_0x10ee05=_0x10ee05-0x0;var _0x6c665f=_0x39e6[_0x10ee05];return _0x6c665f;};'use strict';var client=require(_0x639e('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x2b265a){return client['Request']('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x639e('0x1'),_0x639e('0x2'),'apiKey',_0x639e('0x3'),_0x639e('0x4')],'include':[{'model':_0x639e('0x5'),'as':_0x639e('0x6'),'attributes':['id',_0x639e('0x1')],'include':[{'model':_0x639e('0x7'),'as':_0x639e('0x8'),'attributes':['id',_0x639e('0x9'),_0x639e('0xa'),_0x639e('0xb')],'include':[{'model':_0x639e('0xc'),'as':_0x639e('0xc'),'attributes':['id',_0x639e('0x1')]}]},{'model':_0x639e('0x7'),'as':_0x639e('0xd'),'attributes':['id',_0x639e('0x9'),_0x639e('0xa'),_0x639e('0xe'),'keyType','keyContent',_0x639e('0xb')],'include':[{'model':_0x639e('0xc'),'as':_0x639e('0xc'),'attributes':['id',_0x639e('0x1')]}]}]}]},'log':_0x639e('0xf')});};}; \ No newline at end of file +var _0x5e0e=['GetFreshsalesAccount','name','username','apiKey','serverUrl','Configurations','FreshsalesField','Subjects','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0x5e0e,0x89));var _0xe5e0=function(_0x3f7146,_0x824eba){_0x3f7146=_0x3f7146-0x0;var _0x316350=_0x5e0e[_0x3f7146];return _0x316350;};'use strict';var client=require(_0xe5e0('0x0'));exports[_0xe5e0('0x1')]=function(){return function(_0x54701a){return client[_0xe5e0('0x2')](_0xe5e0('0x3'),{'options':{'raw':![],'attributes':['id',_0xe5e0('0x4'),_0xe5e0('0x5'),_0xe5e0('0x6'),'remoteUri',_0xe5e0('0x7')],'include':[{'model':'FreshsalesConfiguration','as':_0xe5e0('0x8'),'attributes':['id',_0xe5e0('0x4')],'include':[{'model':_0xe5e0('0x9'),'as':_0xe5e0('0xa'),'attributes':['id',_0xe5e0('0xb'),_0xe5e0('0xc'),'variableName'],'include':[{'model':_0xe5e0('0xd'),'as':_0xe5e0('0xd'),'attributes':['id','name']}]},{'model':_0xe5e0('0x9'),'as':_0xe5e0('0xe'),'attributes':['id',_0xe5e0('0xb'),_0xe5e0('0xc'),_0xe5e0('0xf'),_0xe5e0('0x10'),_0xe5e0('0x11'),_0xe5e0('0x12')],'include':[{'model':_0xe5e0('0xd'),'as':_0xe5e0('0xd'),'attributes':['id',_0xe5e0('0x4')]}]}]}]},'log':_0xe5e0('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/salesforce.js b/server/services/ami/rpc/integrations/salesforce.js index a328ffd..bb360fc 100644 --- a/server/services/ami/rpc/integrations/salesforce.js +++ b/server/services/ami/rpc/integrations/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd958=['moduleCreate','ticketType','additionalSearchAccount','additionalSearchContact','additionalSearchLead','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','GetSalesforceAccount','username','password','remoteUri','clientId','clientSecret','securityToken','serverUrl','type','Configurations','name','moduleSearch'];(function(_0x57da5d,_0x54d750){var _0x11c440=function(_0x29bee5){while(--_0x29bee5){_0x57da5d['push'](_0x57da5d['shift']());}};_0x11c440(++_0x54d750);}(_0xd958,0xb8));var _0x8d95=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xd958[_0x25e7cb];return _0x375d92;};'use strict';var client=require(_0x8d95('0x0'));exports[_0x8d95('0x1')]=function(){return function(_0x5c134f){return client['Request'](_0x8d95('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8d95('0x3'),_0x8d95('0x4'),_0x8d95('0x5'),_0x8d95('0x6'),_0x8d95('0x7'),_0x8d95('0x8'),_0x8d95('0x9'),_0x8d95('0xa')],'include':[{'model':'SalesforceConfiguration','as':_0x8d95('0xb'),'attributes':['id',_0x8d95('0xc'),_0x8d95('0xd'),_0x8d95('0xe'),_0x8d95('0xf'),'leadId',_0x8d95('0x10'),_0x8d95('0x11'),_0x8d95('0x12')],'include':[{'model':'SalesforceField','as':'Subjects','include':[{'model':_0x8d95('0x13'),'as':_0x8d95('0x13'),'attributes':['id',_0x8d95('0xc')]}]},{'model':'SalesforceField','as':_0x8d95('0x14'),'include':[{'model':'Variable','as':_0x8d95('0x13'),'attributes':['id',_0x8d95('0xc')]}]},{'model':'SalesforceField','as':_0x8d95('0x15'),'include':[{'model':_0x8d95('0x13'),'as':'Variable','attributes':['id',_0x8d95('0xc')]}]}]}]},'log':_0x8d95('0x2')});};}; \ No newline at end of file +var _0xc6d7=['clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','name','moduleSearch','moduleCreate','ticketType','additionalSearchAccount','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','GetSalesforceAccount','../../client','getSalesforceAccounts','Request','username','password','remoteUri','clientId'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xc6d7,0x71));var _0x7c6d=function(_0x4a24b5,_0x55f7cf){_0x4a24b5=_0x4a24b5-0x0;var _0x4c1deb=_0xc6d7[_0x4a24b5];return _0x4c1deb;};'use strict';var client=require(_0x7c6d('0x0'));exports[_0x7c6d('0x1')]=function(){return function(_0xa7b347){return client[_0x7c6d('0x2')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id','name',_0x7c6d('0x3'),_0x7c6d('0x4'),_0x7c6d('0x5'),_0x7c6d('0x6'),_0x7c6d('0x7'),_0x7c6d('0x8'),_0x7c6d('0x9'),_0x7c6d('0xa')],'include':[{'model':_0x7c6d('0xb'),'as':_0x7c6d('0xc'),'attributes':['id',_0x7c6d('0xd'),_0x7c6d('0xe'),_0x7c6d('0xf'),_0x7c6d('0x10'),'leadId',_0x7c6d('0x11'),'additionalSearchContact',_0x7c6d('0x12')],'include':[{'model':_0x7c6d('0x13'),'as':_0x7c6d('0x14'),'include':[{'model':_0x7c6d('0x15'),'as':'Variable','attributes':['id',_0x7c6d('0xd')]}]},{'model':_0x7c6d('0x13'),'as':_0x7c6d('0x16'),'include':[{'model':_0x7c6d('0x15'),'as':_0x7c6d('0x15'),'attributes':['id',_0x7c6d('0xd')]}]},{'model':_0x7c6d('0x13'),'as':'Fields','include':[{'model':_0x7c6d('0x15'),'as':_0x7c6d('0x15'),'attributes':['id',_0x7c6d('0xd')]}]}]}]},'log':_0x7c6d('0x17')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/servicenow.js b/server/services/ami/rpc/integrations/servicenow.js index c40b956..12a862b 100644 --- a/server/services/ami/rpc/integrations/servicenow.js +++ b/server/services/ami/rpc/integrations/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x187d=['../../client','Request','GetServicenowAccount','name','description','username','email','remoteUri','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','idField','nameField'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x187d,0x93));var _0xd187=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x187d[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0xd187('0x0'));exports['getServicenowAccounts']=function(){return function(_0x3b9b6d){return client[_0xd187('0x1')](_0xd187('0x2'),{'options':{'raw':![],'attributes':['id',_0xd187('0x3'),_0xd187('0x4'),_0xd187('0x5'),'password',_0xd187('0x6'),_0xd187('0x7'),'serverUrl'],'include':[{'model':_0xd187('0x8'),'as':_0xd187('0x9'),'attributes':['id',_0xd187('0x3')],'include':[{'model':_0xd187('0xa'),'as':_0xd187('0xb'),'attributes':['id',_0xd187('0xc'),_0xd187('0xd'),_0xd187('0xe')],'include':[{'model':'Variable','as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]},{'model':_0xd187('0xa'),'as':_0xd187('0x10'),'attributes':['id',_0xd187('0xc'),_0xd187('0xd'),'key',_0xd187('0x11'),_0xd187('0x12'),_0xd187('0xe')],'include':[{'model':'Variable','as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]},{'model':_0xd187('0xa'),'as':'Fields','attributes':['id',_0xd187('0xc'),_0xd187('0xd'),_0xd187('0x13'),_0xd187('0x14'),'customField',_0xd187('0xe')],'include':[{'model':_0xd187('0xf'),'as':_0xd187('0xf'),'attributes':['id',_0xd187('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};}; \ No newline at end of file +var _0xda19=['ServicenowConfiguration','Configurations','name','ServicenowField','Subjects','type','Variable','Descriptions','content','key','keyType','keyContent','Fields','nameField','GetServicenowkAccount','getServicenowAccounts','GetServicenowAccount','description','password','email','remoteUri','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x103fe2,_0x55dd47){_0x103fe2=_0x103fe2-0x0;var _0xf67b45=_0xda19[_0x103fe2];return _0xf67b45;};'use strict';var client=require('../../client');exports[_0x9da1('0x0')]=function(){return function(_0x430d39){return client['Request'](_0x9da1('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x9da1('0x2'),'username',_0x9da1('0x3'),_0x9da1('0x4'),_0x9da1('0x5'),_0x9da1('0x6')],'include':[{'model':_0x9da1('0x7'),'as':_0x9da1('0x8'),'attributes':['id',_0x9da1('0x9')],'include':[{'model':_0x9da1('0xa'),'as':_0x9da1('0xb'),'attributes':['id',_0x9da1('0xc'),'content','variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0xe'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),_0x9da1('0x10'),_0x9da1('0x11'),_0x9da1('0x12'),'variableName'],'include':[{'model':'Variable','as':_0x9da1('0xd'),'attributes':['id','name']}]},{'model':_0x9da1('0xa'),'as':_0x9da1('0x13'),'attributes':['id',_0x9da1('0xc'),_0x9da1('0xf'),'idField',_0x9da1('0x14'),'customField','variableName'],'include':[{'model':_0x9da1('0xd'),'as':'Variable','attributes':['id',_0x9da1('0x9')]}]}]}]},'log':_0x9da1('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/sugarcrm.js b/server/services/ami/rpc/integrations/sugarcrm.js index 7afad58..01441d5 100644 --- a/server/services/ami/rpc/integrations/sugarcrm.js +++ b/server/services/ami/rpc/integrations/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','serverUrl','Configurations','type','content','variableName','Variable','key','keyType','Fields','idField'];(function(_0x2abb6a,_0x385d2d){var _0x34c83f=function(_0x279b12){while(--_0x279b12){_0x2abb6a['push'](_0x2abb6a['shift']());}};_0x34c83f(++_0x385d2d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var client=require('../../client');exports[_0x65f6('0x0')]=function(){return function(_0x4a3887){return client[_0x65f6('0x1')](_0x65f6('0x2'),{'options':{'raw':![],'attributes':['id',_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'remoteUri',_0x65f6('0x6')],'include':[{'model':'SugarcrmConfiguration','as':_0x65f6('0x7'),'attributes':['id',_0x65f6('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x65f6('0x8'),_0x65f6('0x9'),_0x65f6('0xa')],'include':[{'model':_0x65f6('0xb'),'as':_0x65f6('0xb'),'attributes':['id',_0x65f6('0x3')]}]},{'model':'SugarcrmField','as':'Descriptions','attributes':['id',_0x65f6('0x8'),_0x65f6('0x9'),_0x65f6('0xc'),_0x65f6('0xd'),'keyContent',_0x65f6('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x65f6('0x3')]}]},{'model':'SugarcrmField','as':_0x65f6('0xe'),'attributes':['id','type',_0x65f6('0x9'),_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0xa')],'include':[{'model':_0x65f6('0xb'),'as':_0x65f6('0xb'),'attributes':['id',_0x65f6('0x3')]}]}]}]},'log':_0x65f6('0x2')});};}; \ No newline at end of file +var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xda2d,0x102));var _0xdda2=function(_0x15aa0b,_0x2af8af){_0x15aa0b=_0x15aa0b-0x0;var _0x28681f=_0xda2d[_0x15aa0b];return _0x28681f;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/vtiger.js b/server/services/ami/rpc/integrations/vtiger.js index 57743c5..727d90a 100644 --- a/server/services/ami/rpc/integrations/vtiger.js +++ b/server/services/ami/rpc/integrations/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8abb=['VtigerField','key','keyContent','Fields','content','nameField','../../client','getVtigerAccounts','Request','GetVtigerAccount','description','username','accessKey','remoteUri','VtigerConfiguration','Configurations','name','Subjects','type','variableName','Variable'];(function(_0x2fef32,_0x18992d){var _0x1087c2=function(_0x1ead9f){while(--_0x1ead9f){_0x2fef32['push'](_0x2fef32['shift']());}};_0x1087c2(++_0x18992d);}(_0x8abb,0x102));var _0xb8ab=function(_0xa19011,_0x3523a7){_0xa19011=_0xa19011-0x0;var _0x54f1ea=_0x8abb[_0xa19011];return _0x54f1ea;};'use strict';var client=require(_0xb8ab('0x0'));exports[_0xb8ab('0x1')]=function(){return function(_0x12e295){return client[_0xb8ab('0x2')](_0xb8ab('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xb8ab('0x4'),_0xb8ab('0x5'),_0xb8ab('0x6'),_0xb8ab('0x7'),'serverUrl'],'include':[{'model':_0xb8ab('0x8'),'as':_0xb8ab('0x9'),'attributes':['id',_0xb8ab('0xa')],'include':[{'model':'VtigerField','as':_0xb8ab('0xb'),'attributes':['id',_0xb8ab('0xc'),'content',_0xb8ab('0xd')],'include':[{'model':_0xb8ab('0xe'),'as':_0xb8ab('0xe'),'attributes':['id',_0xb8ab('0xa')]}]},{'model':_0xb8ab('0xf'),'as':'Descriptions','attributes':['id',_0xb8ab('0xc'),'content',_0xb8ab('0x10'),'keyType',_0xb8ab('0x11'),_0xb8ab('0xd')],'include':[{'model':_0xb8ab('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':'VtigerField','as':_0xb8ab('0x12'),'attributes':['id',_0xb8ab('0xc'),_0xb8ab('0x13'),'idField',_0xb8ab('0x14'),'customField','variableName'],'include':[{'model':_0xb8ab('0xe'),'as':_0xb8ab('0xe'),'attributes':['id',_0xb8ab('0xa')]}]}]}]},'log':_0xb8ab('0x3')});};}; \ No newline at end of file +var _0x9110=['Subjects','type','content','variableName','Descriptions','key','keyType','keyContent','Variable','VtigerField','Fields','nameField','../../client','Request','GetVtigerAccount','name','username','accessKey','serverUrl','VtigerConfiguration'];(function(_0xa7f12b,_0x513b11){var _0x5069c5=function(_0x440ecf){while(--_0x440ecf){_0xa7f12b['push'](_0xa7f12b['shift']());}};_0x5069c5(++_0x513b11);}(_0x9110,0x124));var _0x0911=function(_0x83b426,_0x18fc9f){_0x83b426=_0x83b426-0x0;var _0x4f4588=_0x9110[_0x83b426];return _0x4f4588;};'use strict';var client=require(_0x0911('0x0'));exports['getVtigerAccounts']=function(){return function(_0x143369){return client[_0x0911('0x1')](_0x0911('0x2'),{'options':{'raw':![],'attributes':['id',_0x0911('0x3'),'description',_0x0911('0x4'),_0x0911('0x5'),'remoteUri',_0x0911('0x6')],'include':[{'model':_0x0911('0x7'),'as':'Configurations','attributes':['id',_0x0911('0x3')],'include':[{'model':'VtigerField','as':_0x0911('0x8'),'attributes':['id',_0x0911('0x9'),_0x0911('0xa'),_0x0911('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x0911('0x3')]}]},{'model':'VtigerField','as':_0x0911('0xc'),'attributes':['id',_0x0911('0x9'),'content',_0x0911('0xd'),_0x0911('0xe'),_0x0911('0xf'),_0x0911('0xb')],'include':[{'model':_0x0911('0x10'),'as':'Variable','attributes':['id',_0x0911('0x3')]}]},{'model':_0x0911('0x11'),'as':_0x0911('0x12'),'attributes':['id',_0x0911('0x9'),'content','idField',_0x0911('0x13'),'customField',_0x0911('0xb')],'include':[{'model':_0x0911('0x10'),'as':_0x0911('0x10'),'attributes':['id',_0x0911('0x3')]}]}]}]},'log':'GetVtigerAccount'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/zendesk.js b/server/services/ami/rpc/integrations/zendesk.js index 7db70ef..9295991 100644 --- a/server/services/ami/rpc/integrations/zendesk.js +++ b/server/services/ami/rpc/integrations/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7010=['username','password','token','authType','serverUrl','type','ZendeskConfiguration','Configurations','name','Subjects','content','variableName','Variable','ZendeskField','Descriptions','keyContent','Fields','nameField','customField','../../client','getZendeskAccounts','GetZendeskAccount'];(function(_0x29372b,_0x4b9f6e){var _0x88acd4=function(_0x4909ce){while(--_0x4909ce){_0x29372b['push'](_0x29372b['shift']());}};_0x88acd4(++_0x4b9f6e);}(_0x7010,0xc3));var _0x0701=function(_0x4de4e6,_0x5aa090){_0x4de4e6=_0x4de4e6-0x0;var _0x61b815=_0x7010[_0x4de4e6];return _0x61b815;};'use strict';var client=require(_0x0701('0x0'));exports[_0x0701('0x1')]=function(){return function(_0x91a514){return client['Request'](_0x0701('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0701('0x3'),_0x0701('0x4'),_0x0701('0x5'),'remoteUri',_0x0701('0x6'),_0x0701('0x7'),_0x0701('0x8')],'include':[{'model':_0x0701('0x9'),'as':_0x0701('0xa'),'attributes':['id',_0x0701('0xb')],'include':[{'model':'Tag','attributes':['id',_0x0701('0xb')]},{'model':'ZendeskField','as':_0x0701('0xc'),'attributes':['id',_0x0701('0x8'),_0x0701('0xd'),_0x0701('0xe')],'include':[{'model':_0x0701('0xf'),'as':'Variable','attributes':['id','name']}]},{'model':_0x0701('0x10'),'as':_0x0701('0x11'),'attributes':['id',_0x0701('0x8'),_0x0701('0xd'),'key','keyType',_0x0701('0x12'),_0x0701('0xe')],'include':[{'model':_0x0701('0xf'),'as':'Variable','attributes':['id',_0x0701('0xb')]}]},{'model':_0x0701('0x10'),'as':_0x0701('0x13'),'attributes':['id','type',_0x0701('0xd'),'idField',_0x0701('0x14'),_0x0701('0x15'),_0x0701('0xe')],'include':[{'model':_0x0701('0xf'),'as':_0x0701('0xf'),'attributes':['id',_0x0701('0xb')]}]}]}]},'log':_0x0701('0x2')});};}; \ No newline at end of file +var _0x43f2=['customField','../../client','Request','GetZendeskAccount','password','remoteUri','authType','serverUrl','type','Configurations','name','Tag','ZendeskField','Subjects','content','variableName','Descriptions','key','keyType','keyContent','Variable','Fields','idField','nameField'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x43f2,0x151));var _0x243f=function(_0x22397d,_0x1be3eb){_0x22397d=_0x22397d-0x0;var _0x16b143=_0x43f2[_0x22397d];return _0x16b143;};'use strict';var client=require(_0x243f('0x0'));exports['getZendeskAccounts']=function(){return function(_0x1ec23d){return client[_0x243f('0x1')](_0x243f('0x2'),{'options':{'raw':![],'attributes':['id','name','username',_0x243f('0x3'),'token',_0x243f('0x4'),_0x243f('0x5'),_0x243f('0x6'),_0x243f('0x7')],'include':[{'model':'ZendeskConfiguration','as':_0x243f('0x8'),'attributes':['id',_0x243f('0x9')],'include':[{'model':_0x243f('0xa'),'attributes':['id','name']},{'model':_0x243f('0xb'),'as':_0x243f('0xc'),'attributes':['id',_0x243f('0x7'),_0x243f('0xd'),_0x243f('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x243f('0x9')]}]},{'model':_0x243f('0xb'),'as':_0x243f('0xf'),'attributes':['id',_0x243f('0x7'),_0x243f('0xd'),_0x243f('0x10'),_0x243f('0x11'),_0x243f('0x12'),_0x243f('0xe')],'include':[{'model':_0x243f('0x13'),'as':_0x243f('0x13'),'attributes':['id','name']}]},{'model':_0x243f('0xb'),'as':_0x243f('0x14'),'attributes':['id','type',_0x243f('0xd'),_0x243f('0x15'),_0x243f('0x16'),_0x243f('0x17'),'variableName'],'include':[{'model':_0x243f('0x13'),'as':_0x243f('0x13'),'attributes':['id','name']}]}]}]},'log':_0x243f('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/zoho.js b/server/services/ami/rpc/integrations/zoho.js index 69b1c81..3b6da9e 100644 --- a/server/services/ami/rpc/integrations/zoho.js +++ b/server/services/ami/rpc/integrations/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48d7=['content','variableName','Variable','Descriptions','keyType','keyContent','Fields','type','nameField','customField','../../client','Request','GetZohoAccount','description','host','zone','serverUrl','code','refreshToken','Configurations','name','ZohoField'];(function(_0x1fe903,_0x44f2bc){var _0x559922=function(_0x31f54f){while(--_0x31f54f){_0x1fe903['push'](_0x1fe903['shift']());}};_0x559922(++_0x44f2bc);}(_0x48d7,0x128));var _0x748d=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x48d7[_0x45783c];return _0x1161da;};'use strict';var client=require(_0x748d('0x0'));exports['getZohoAccounts']=function(){return function(_0x1d825d){return client[_0x748d('0x1')](_0x748d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x748d('0x3'),_0x748d('0x4'),_0x748d('0x5'),'clientId','clientSecret',_0x748d('0x6'),_0x748d('0x7'),_0x748d('0x8')],'include':[{'model':'ZohoConfiguration','as':_0x748d('0x9'),'attributes':['id',_0x748d('0xa'),'moduleCreate','moduleSearch',_0x748d('0x3')],'include':[{'model':_0x748d('0xb'),'as':'Subjects','attributes':['id','type',_0x748d('0xc'),_0x748d('0xd')],'include':[{'model':_0x748d('0xe'),'as':_0x748d('0xe'),'attributes':['id',_0x748d('0xa')]}]},{'model':_0x748d('0xb'),'as':_0x748d('0xf'),'attributes':['id','type','content','key',_0x748d('0x10'),_0x748d('0x11'),_0x748d('0xd')],'include':[{'model':_0x748d('0xe'),'as':_0x748d('0xe'),'attributes':['id',_0x748d('0xa')]}]},{'model':_0x748d('0xb'),'as':_0x748d('0x12'),'attributes':['id',_0x748d('0x13'),_0x748d('0xc'),'idField',_0x748d('0x14'),_0x748d('0x15'),_0x748d('0xd')],'include':[{'model':_0x748d('0xe'),'as':_0x748d('0xe'),'attributes':['id',_0x748d('0xa')]}]}]}]},'log':_0x748d('0x2')});};}; \ No newline at end of file +var _0xefa3=['Variable','ZohoField','Descriptions','key','keyType','keyContent','Fields','nameField','customField','../../client','getZohoAccounts','GetZohoAccount','name','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleSearch','description','Subjects','type','content','variableName'];(function(_0x56e175,_0x12a1ac){var _0x53bb00=function(_0x22bf2f){while(--_0x22bf2f){_0x56e175['push'](_0x56e175['shift']());}};_0x53bb00(++_0x12a1ac);}(_0xefa3,0x11c));var _0x3efa=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0xefa3[_0x476c7];return _0x47ae56;};'use strict';var client=require(_0x3efa('0x0'));exports[_0x3efa('0x1')]=function(){return function(_0x5b8a83){return client['Request'](_0x3efa('0x2'),{'options':{'raw':![],'attributes':['id',_0x3efa('0x3'),'description','host','zone','clientId',_0x3efa('0x4'),_0x3efa('0x5'),_0x3efa('0x6'),_0x3efa('0x7')],'include':[{'model':_0x3efa('0x8'),'as':_0x3efa('0x9'),'attributes':['id','name','moduleCreate',_0x3efa('0xa'),_0x3efa('0xb')],'include':[{'model':'ZohoField','as':_0x3efa('0xc'),'attributes':['id',_0x3efa('0xd'),_0x3efa('0xe'),_0x3efa('0xf')],'include':[{'model':_0x3efa('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':_0x3efa('0x11'),'as':_0x3efa('0x12'),'attributes':['id',_0x3efa('0xd'),_0x3efa('0xe'),_0x3efa('0x13'),_0x3efa('0x14'),_0x3efa('0x15'),_0x3efa('0xf')],'include':[{'model':_0x3efa('0x10'),'as':_0x3efa('0x10'),'attributes':['id',_0x3efa('0x3')]}]},{'model':_0x3efa('0x11'),'as':_0x3efa('0x16'),'attributes':['id','type',_0x3efa('0xe'),'idField',_0x3efa('0x17'),_0x3efa('0x18'),_0x3efa('0xf')],'include':[{'model':_0x3efa('0x10'),'as':_0x3efa('0x10'),'attributes':['id',_0x3efa('0x3')]}]}]}]},'log':_0x3efa('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/interval.js b/server/services/ami/rpc/interval.js index 008f120..30149cc 100644 --- a/server/services/ami/rpc/interval.js +++ b/server/services/ami/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3247=['IntervalIftime','intervalIftime','../../../config/logger','dialer','stack','replace','trim','silly','intervalIftime\x20called\x20with','resolve','number','every','map','length','interval','concat','Request'];(function(_0x20afc7,_0x263339){var _0x20cd51=function(_0x5aa807){while(--_0x5aa807){_0x20afc7['push'](_0x20afc7['shift']());}};_0x20cd51(++_0x263339);}(_0x3247,0x1ab));var _0x7324=function(_0x58c8d3,_0x53f9ce){_0x58c8d3=_0x58c8d3-0x0;var _0x4667a2=_0x3247[_0x58c8d3];return _0x4667a2;};var logger=require(_0x7324('0x0'))(_0x7324('0x1'));var client=require('../client');function intervalIftime(_0x3aa87c,_0x52584c){const _0x152bdd=new Error()[_0x7324('0x2')][_0x7324('0x3')](/^Error/,'')[_0x7324('0x4')]();logger[_0x7324('0x5')](_0x7324('0x6'),_0x3aa87c,_0x52584c,_0x152bdd);const _0x4d813e=Array['isArray'](_0x3aa87c);if(!_0x3aa87c||_0x4d813e&&_0x3aa87c['length']===0x0){return Promise[_0x7324('0x7')](![]);}else{var _0x459135=[];var _0x3302b7=[];var _0x78d3b3=_0x4d813e?_0x3aa87c:[_0x3aa87c];var _0x4b969d=_0x78d3b3['every'](function(_0x24a212){return typeof _0x24a212===_0x7324('0x8');});var _0x8f2de1=_0x78d3b3[_0x7324('0x9')](function(_0x58c1ab){return typeof _0x58c1ab==='string';});if(!_0x4b969d&&!_0x8f2de1){_0x459135=_0x78d3b3[_0x7324('0xa')](function(_0x82b391){return _0x82b391['id'];});if(_0x459135[_0x7324('0xb')]===0x0){_0x3302b7=_0x78d3b3[_0x7324('0xa')](function(_0x2c8de8){return _0x2c8de8[_0x7324('0xc')];});}}else{if(_0x4b969d){_0x459135=_0x459135[_0x7324('0xd')](_0x78d3b3);}if(_0x8f2de1){_0x3302b7=_0x3302b7[_0x7324('0xd')](_0x78d3b3);}}return client[_0x7324('0xe')](_0x7324('0xf'),{'intervalIds':_0x459135,'intervals':_0x3302b7,'timezone':_0x52584c,'log':_0x7324('0xf')});}}exports[_0x7324('0x10')]=intervalIftime; \ No newline at end of file +var _0x129d=['silly','intervalIftime\x20called\x20with','isArray','length','every','number','string','map','concat','Request','IntervalIftime','intervalIftime','../client','stack','replace','trim'];(function(_0x1280e3,_0x5a6dbf){var _0x2431a0=function(_0x4e468f){while(--_0x4e468f){_0x1280e3['push'](_0x1280e3['shift']());}};_0x2431a0(++_0x5a6dbf);}(_0x129d,0x17c));var _0xd129=function(_0x4e7b85,_0x3a4d8c){_0x4e7b85=_0x4e7b85-0x0;var _0x9f8531=_0x129d[_0x4e7b85];return _0x9f8531;};var logger=require('../../../config/logger')('dialer');var client=require(_0xd129('0x0'));function intervalIftime(_0x48d0c5,_0x120723){const _0x48f8b3=new Error()[_0xd129('0x1')][_0xd129('0x2')](/^Error/,'')[_0xd129('0x3')]();logger[_0xd129('0x4')](_0xd129('0x5'),_0x48d0c5,_0x120723,_0x48f8b3);const _0x392b2f=Array[_0xd129('0x6')](_0x48d0c5);if(!_0x48d0c5||_0x392b2f&&_0x48d0c5[_0xd129('0x7')]===0x0){return Promise['resolve'](![]);}else{var _0x22cd73=[];var _0x10c797=[];var _0x4bced4=_0x392b2f?_0x48d0c5:[_0x48d0c5];var _0x25a188=_0x4bced4[_0xd129('0x8')](function(_0x1e79df){return typeof _0x1e79df===_0xd129('0x9');});var _0xc5842c=_0x4bced4[_0xd129('0x8')](function(_0x3e0aa9){return typeof _0x3e0aa9===_0xd129('0xa');});if(!_0x25a188&&!_0xc5842c){_0x22cd73=_0x4bced4[_0xd129('0xb')](function(_0x298d6c){return _0x298d6c['id'];});if(_0x22cd73['length']===0x0){_0x10c797=_0x4bced4['map'](function(_0x661ec7){return _0x661ec7['interval'];});}}else{if(_0x25a188){_0x22cd73=_0x22cd73[_0xd129('0xc')](_0x4bced4);}if(_0xc5842c){_0x10c797=_0x10c797[_0xd129('0xc')](_0x4bced4);}}return client[_0xd129('0xd')](_0xd129('0xe'),{'intervalIds':_0x22cd73,'intervals':_0x10c797,'timezone':_0x120723,'log':_0xd129('0xe')});}}exports[_0xd129('0xf')]=intervalIftime; \ No newline at end of file diff --git a/server/services/ami/rpc/memberReport.js b/server/services/ami/rpc/memberReport.js index edc6a4e..cebef3f 100644 --- a/server/services/ami/rpc/memberReport.js +++ b/server/services/ami/rpc/memberReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfaff=['CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','inbound','calleridnum','queue','agent','toNumber','accountcode','uniqueid','Request','starttime','endtime','diff','seconds','outbound','dialstring','lodash','util','../client','voiceQueueReport','queuecallercompleteAt'];(function(_0x109a66,_0x39a107){var _0x22e0ab=function(_0x87ab08){while(--_0x87ab08){_0x109a66['push'](_0x109a66['shift']());}};_0x22e0ab(++_0x39a107);}(_0xfaff,0x183));var _0xffaf=function(_0x4f29ae,_0x1e0c4c){_0x4f29ae=_0x4f29ae-0x0;var _0x44c080=_0xfaff[_0x4f29ae];return _0x44c080;};'use strict';var moment=require('moment');var _=require(_0xffaf('0x0'));var util=require(_0xffaf('0x1'));var client=require(_0xffaf('0x2'));exports[_0xffaf('0x3')]=function(_0xe411db){var _0x3f4f6f=_0xe411db[_0xffaf('0x4')]||_0xe411db['queuecallerexitAt'];return client['Request'](_0xffaf('0x5'),{'body':{'channel':_0xffaf('0x6'),'membername':_0xe411db[_0xffaf('0x7')],'interface':_[_0xffaf('0x8')](_0xe411db[_0xffaf('0x9')])?util[_0xffaf('0xa')](_0xffaf('0xb'),_0xe411db[_0xffaf('0x7')]):_0xe411db[_0xffaf('0x9')],'type':_0xffaf('0xc'),'enterAt':_0xe411db[_0xffaf('0xd')],'exitAt':_0x3f4f6f,'duration':moment(_0x3f4f6f)['diff'](_0xe411db[_0xffaf('0xd')],'seconds'),'data1':_0xffaf('0xe'),'data2':_0xe411db[_0xffaf('0xf')],'data3':_0xe411db['exten'],'data4':null,'data5':_0xe411db[_0xffaf('0x10')],'role':_0xffaf('0x11'),'internal':_0xe411db['accountcode']?_[_0xffaf('0x12')](_0xe411db[_0xffaf('0x13')]):undefined,'uniqueid':_0xe411db[_0xffaf('0x14')]},'log':_0xffaf('0x5')});};exports['voiceDialReport']=function(_0x3d05bb){return client[_0xffaf('0x15')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3d05bb['membername'],'interface':_0x3d05bb['interface'],'type':_0xffaf('0xc'),'enterAt':_0x3d05bb[_0xffaf('0x16')],'exitAt':_0x3d05bb[_0xffaf('0x17')],'duration':moment(_0x3d05bb[_0xffaf('0x17')])[_0xffaf('0x18')](_0x3d05bb[_0xffaf('0x16')],_0xffaf('0x19'))>=0x0?moment(_0x3d05bb['endtime'])[_0xffaf('0x18')](_0x3d05bb[_0xffaf('0x16')],'seconds'):null,'data1':_0xffaf('0x1a'),'data2':_0x3d05bb[_0xffaf('0x13')],'data3':_0x3d05bb['exten'],'data4':_0x3d05bb[_0xffaf('0x1b')]||null,'role':_0xffaf('0x11'),'internal':_0x3d05bb[_0xffaf('0x13')]?_[_0xffaf('0x12')](_0x3d05bb[_0xffaf('0x13')]):undefined,'uniqueid':_0x3d05bb['uniqueid']},'log':_0xffaf('0x5')});}; \ No newline at end of file +var _0x6ab7=['util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','format','SIP/%s','lastAssignedTo','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','voiceDialReport','endtime','starttime','outbound','dialstring','toNumber','uniqueid','moment'];(function(_0x8053f7,_0x1dc82d){var _0x184f82=function(_0x3df55e){while(--_0x3df55e){_0x8053f7['push'](_0x8053f7['shift']());}};_0x184f82(++_0x1dc82d);}(_0x6ab7,0x185));var _0x76ab=function(_0xde9fa7,_0x2b8a00){_0xde9fa7=_0xde9fa7-0x0;var _0x1f286d=_0x6ab7[_0xde9fa7];return _0x1f286d;};'use strict';var moment=require(_0x76ab('0x0'));var _=require('lodash');var util=require(_0x76ab('0x1'));var client=require(_0x76ab('0x2'));exports[_0x76ab('0x3')]=function(_0x2e7e18){var _0x3db218=_0x2e7e18[_0x76ab('0x4')]||_0x2e7e18[_0x76ab('0x5')];return client[_0x76ab('0x6')](_0x76ab('0x7'),{'body':{'channel':_0x76ab('0x8'),'membername':_0x2e7e18['lastAssignedTo'],'interface':_[_0x76ab('0x9')](_0x2e7e18['interface'])?util[_0x76ab('0xa')](_0x76ab('0xb'),_0x2e7e18[_0x76ab('0xc')]):_0x2e7e18[_0x76ab('0xd')],'type':_0x76ab('0xe'),'enterAt':_0x2e7e18[_0x76ab('0xf')],'exitAt':_0x3db218,'duration':moment(_0x3db218)[_0x76ab('0x10')](_0x2e7e18['queuecallerleaveAt'],_0x76ab('0x11')),'data1':_0x76ab('0x12'),'data2':_0x2e7e18[_0x76ab('0x13')],'data3':_0x2e7e18[_0x76ab('0x14')],'data4':null,'data5':_0x2e7e18['queue'],'role':_0x76ab('0x15'),'internal':_0x2e7e18[_0x76ab('0x16')]?_['toNumber'](_0x2e7e18[_0x76ab('0x16')]):undefined,'uniqueid':_0x2e7e18['uniqueid']},'log':_0x76ab('0x7')});};exports[_0x76ab('0x17')]=function(_0x591a2a){return client[_0x76ab('0x6')](_0x76ab('0x7'),{'body':{'channel':'voice','membername':_0x591a2a['membername'],'interface':_0x591a2a[_0x76ab('0xd')],'type':_0x76ab('0xe'),'enterAt':_0x591a2a['starttime'],'exitAt':_0x591a2a[_0x76ab('0x18')],'duration':moment(_0x591a2a[_0x76ab('0x18')])[_0x76ab('0x10')](_0x591a2a[_0x76ab('0x19')],_0x76ab('0x11'))>=0x0?moment(_0x591a2a[_0x76ab('0x18')])['diff'](_0x591a2a[_0x76ab('0x19')],_0x76ab('0x11')):null,'data1':_0x76ab('0x1a'),'data2':_0x591a2a[_0x76ab('0x16')],'data3':_0x591a2a[_0x76ab('0x14')],'data4':_0x591a2a[_0x76ab('0x1b')]||null,'role':_0x76ab('0x15'),'internal':_0x591a2a['accountcode']?_[_0x76ab('0x1c')](_0x591a2a['accountcode']):undefined,'uniqueid':_0x591a2a[_0x76ab('0x1d')]},'log':_0x76ab('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 014e36c..8829a6e 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 _0x83cd=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x118733,_0x2bd820){var _0x4777af=function(_0x52886a){while(--_0x52886a){_0x118733['push'](_0x118733['shift']());}};_0x4777af(++_0x2bd820);}(_0x83cd,0x17b));var _0xd83c=function(_0x430cc6,_0x278b59){_0x430cc6=_0x430cc6-0x0;var _0x36470e=_0x83cd[_0x430cc6];return _0x36470e;};'use strict';var client=require(_0xd83c('0x0'));exports[_0xd83c('0x1')]=function(){return client[_0xd83c('0x2')](_0xd83c('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd83c('0x4'),'previewRecallmeReminderInterval']},'log':_0xd83c('0x5')});}; \ No newline at end of file +var _0x3f8c=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x5d3d3d,_0x8a3cb1){var _0x4bdf59=function(_0x3f0ea8){while(--_0x3f0ea8){_0x5d3d3d['push'](_0x5d3d3d['shift']());}};_0x4bdf59(++_0x8a3cb1);}(_0x3f8c,0x104));var _0xc3f8=function(_0x160471,_0x3c4871){_0x160471=_0x160471-0x0;var _0x284d56=_0x3f8c[_0x160471];return _0x284d56;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xc3f8('0x0')](_0xc3f8('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc3f8('0x2'),_0xc3f8('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index c53d8db..d5f74f0 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 _0xc224=['GetTemplate','name','html','../client','getTemplates'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0xc224,0xe4));var _0x4c22=function(_0x2e79c3,_0x2798ec){_0x2e79c3=_0x2e79c3-0x0;var _0x2e8097=_0xc224[_0x2e79c3];return _0x2e8097;};'use strict';var client=require(_0x4c22('0x0'));exports[_0x4c22('0x1')]=function(_0xde4605){return function(_0x251669){return client['Request'](_0x4c22('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4c22('0x3'),_0x4c22('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x7c80=['getTemplates','Request','GetTemplate','name','../client'];(function(_0x51a822,_0x6303fc){var _0xfa9db5=function(_0xda0729){while(--_0xda0729){_0x51a822['push'](_0x51a822['shift']());}};_0xfa9db5(++_0x6303fc);}(_0x7c80,0xa4));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x07c8('0x0'));exports[_0x07c8('0x1')]=function(_0x4c4d1c){return function(_0x4d1be3){return client[_0x07c8('0x2')](_0x07c8('0x3'),{'options':{'raw':!![],'attributes':['id',_0x07c8('0x4'),'html']},'log':_0x07c8('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 2a6d9bf..025f5b1 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 _0x6366=['getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data3','data4','data6','data7','../client'];(function(_0x214890,_0x2562c0){var _0x760050=function(_0x29742c){while(--_0x29742c){_0x214890['push'](_0x214890['shift']());}};_0x760050(++_0x2562c0);}(_0x6366,0x175));var _0x6636=function(_0xa11b75,_0x436a7c){_0xa11b75=_0xa11b75-0x0;var _0x4a4dd1=_0x6366[_0xa11b75];return _0x4a4dd1;};'use strict';var client=require(_0x6636('0x0'));exports[_0x6636('0x1')]=function(_0x4af26f){return function(_0x47f86e){return client[_0x6636('0x2')](_0x6636('0x3'),{'options':{'raw':![],'attributes':['id',_0x6636('0x4'),_0x6636('0x5'),_0x6636('0x6')],'include':[{'model':_0x6636('0x7'),'as':_0x6636('0x8'),'attributes':['id',_0x6636('0x9'),_0x6636('0xa'),_0x6636('0xb')]},{'model':_0x6636('0x7'),'as':_0x6636('0xc'),'attributes':['id',_0x6636('0x9'),_0x6636('0xa'),_0x6636('0xb')]},{'model':_0x6636('0xd'),'as':_0x6636('0xe'),'attributes':['id',_0x6636('0xf'),_0x6636('0x10'),_0x6636('0x11'),_0x6636('0x12'),_0x6636('0x13'),'data5',_0x6636('0x14'),_0x6636('0x15')]}]},'log':_0x6636('0x3')});};}; \ No newline at end of file +var _0x6af0=['data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','action','data2','data3','data5'];(function(_0x5bf79a,_0x2eaa1d){var _0x3ff10f=function(_0x48523){while(--_0x48523){_0x5bf79a['push'](_0x5bf79a['shift']());}};_0x3ff10f(++_0x2eaa1d);}(_0x6af0,0x1ba));var _0x06af=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x6af0[_0x1969a7];return _0x3d665f;};'use strict';var client=require(_0x06af('0x0'));exports[_0x06af('0x1')]=function(_0x189ce2){return function(_0x3680be){return client[_0x06af('0x2')](_0x06af('0x3'),{'options':{'raw':![],'attributes':['id',_0x06af('0x4'),_0x06af('0x5'),_0x06af('0x6')],'include':[{'model':_0x06af('0x7'),'as':_0x06af('0x8'),'attributes':['id',_0x06af('0x9'),_0x06af('0xa'),'value']},{'model':_0x06af('0x7'),'as':_0x06af('0xb'),'attributes':['id',_0x06af('0x9'),_0x06af('0xa'),_0x06af('0xc')]},{'model':_0x06af('0xd'),'as':'Actions','attributes':['id',_0x06af('0xe'),'data1',_0x06af('0xf'),_0x06af('0x10'),'data4',_0x06af('0x11'),_0x06af('0x12'),_0x06af('0x13')]}]},'log':_0x06af('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 4ed42a4..7bad907 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 _0xcc92=['name','../client','getTrunks','Request','GetTrunk'];(function(_0x189db2,_0x2eaf6a){var _0x48e121=function(_0x4c3cb9){while(--_0x4c3cb9){_0x189db2['push'](_0x189db2['shift']());}};_0x48e121(++_0x2eaf6a);}(_0xcc92,0x141));var _0x2cc9=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0xcc92[_0x3a9661];return _0x5bb119;};'use strict';var client=require(_0x2cc9('0x0'));exports[_0x2cc9('0x1')]=function(_0x954c2d){return function(_0x4b23d9){return client[_0x2cc9('0x2')](_0x2cc9('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2cc9('0x4'),'registry','defaultuser']},'log':_0x2cc9('0x3')});};}; \ No newline at end of file +var _0xa509=['GetTrunk','registry','../client','Request'];(function(_0x675360,_0x3b8385){var _0x492792=function(_0x4f1fa9){while(--_0x4f1fa9){_0x675360['push'](_0x675360['shift']());}};_0x492792(++_0x3b8385);}(_0xa509,0x1ce));var _0x9a50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa509[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x9a50('0x0'));exports['getTrunks']=function(_0x2f0476){return function(_0x5d4692){return client[_0x9a50('0x1')](_0x9a50('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x9a50('0x3'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b65eb13..214dd10 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x417d2d,_0x5a87af){var _0x19f1c1=function(_0x2b515b){while(--_0x2b515b){_0x417d2d['push'](_0x417d2d['shift']());}};_0x19f1c1(++_0x5a87af);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x536ffd,_0xbe6fb){var _0x29f75c=function(_0x1d64d8){while(--_0x1d64d8){_0x536ffd['push'](_0x536ffd['shift']());}};_0x29f75c(++_0xbe6fb);}(_0x34e8,0x12c));var _0x834e=function(_0x1b3022,_0x1e5f0f){_0x1b3022=_0x1b3022-0x0;var _0xaf4ba2=_0x34e8[_0x1b3022];return _0xaf4ba2;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index db4fa16..72fc273 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 _0xf89b=['update','Request','UpdateVoiceAgentReport','../client','create'];(function(_0x2d4a07,_0x2e1f4d){var _0x43f637=function(_0x2992cf){while(--_0x2992cf){_0x2d4a07['push'](_0x2d4a07['shift']());}};_0x43f637(++_0x2e1f4d);}(_0xf89b,0xb7));var _0xbf89=function(_0x231022,_0x13ac7c){_0x231022=_0x231022-0x0;var _0x39d4d6=_0xf89b[_0x231022];return _0x39d4d6;};'use strict';var client=require(_0xbf89('0x0'));exports[_0xbf89('0x1')]=function(_0x4c4062){return client['Request']('CreateVoiceAgentReport',{'body':_0x4c4062,'log':'CreateVoiceAgentReport'});};exports[_0xbf89('0x2')]=function(_0x1b482d,_0x395b92,_0x2b31aa){return client[_0xbf89('0x3')]('UpdateVoiceAgentReport',{'body':_0x1b482d,'options':{'where':{'uniqueid':_0x395b92,'interface':_0x2b31aa,'agentcomplete':!![]}},'log':_0xbf89('0x4')});}; \ No newline at end of file +var _0xc5fb=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x5d061e,_0x37481d){var _0x187164=function(_0x431ba3){while(--_0x431ba3){_0x5d061e['push'](_0x5d061e['shift']());}};_0x187164(++_0x37481d);}(_0xc5fb,0xcb));var _0xbc5f=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0xc5fb[_0x26bcec];return _0x1049dc;};'use strict';var client=require(_0xbc5f('0x0'));exports[_0xbc5f('0x1')]=function(_0x155263){return client[_0xbc5f('0x2')](_0xbc5f('0x3'),{'body':_0x155263,'log':_0xbc5f('0x3')});};exports[_0xbc5f('0x4')]=function(_0x321e82,_0x15903f,_0x464216){return client[_0xbc5f('0x2')]('UpdateVoiceAgentReport',{'body':_0x321e82,'options':{'where':{'uniqueid':_0x15903f,'interface':_0x464216,'agentcomplete':!![]}},'log':_0xbc5f('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index fd353ec..1765a70 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 _0x13e6=['YYYY-MM-DD\x20HH:mm:ss','endOf','duration','billableseconds','moment','util','lodash','create','Request','CreateVoiceCallReport','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day'];(function(_0x4f8709,_0x252add){var _0x1d4968=function(_0x2f3d78){while(--_0x2f3d78){_0x4f8709['push'](_0x4f8709['shift']());}};_0x1d4968(++_0x252add);}(_0x13e6,0xdc));var _0x613e=function(_0x570413,_0x517175){_0x570413=_0x570413-0x0;var _0x5ab28f=_0x13e6[_0x570413];return _0x5ab28f;};'use strict';var moment=require(_0x613e('0x0'));var util=require(_0x613e('0x1'));var _=require(_0x613e('0x2'));var client=require('../client');exports[_0x613e('0x3')]=function(_0x47108f){return client[_0x613e('0x4')](_0x613e('0x5'),{'body':_['merge'](_0x47108f,{'source':_0x47108f[_0x613e('0x6')],'destinationcontext':_0x47108f['context'],'callerid':_0x47108f[_0x613e('0x7')],'amaflags':_0x613e('0x8')}),'log':_0x613e('0x5')});};exports[_0x613e('0x9')]=function(){return function(){return client['Request'](_0x613e('0xa'),{'options':{'where':{'type':[_0x613e('0xb')],'createdAt':{'$between':[moment()[_0x613e('0xc')](_0x613e('0xd'))['format'](_0x613e('0xe')),moment()[_0x613e('0xf')](_0x613e('0xd'))['format'](_0x613e('0xe'))]}},'attributes':['type','disposition',_0x613e('0x10'),_0x613e('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x613d=['callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x613d,0x91));var _0xd613=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x613d[_0x5e77db];return _0x34b675;};'use strict';var moment=require(_0xd613('0x0'));var util=require(_0xd613('0x1'));var _=require('lodash');var client=require(_0xd613('0x2'));exports[_0xd613('0x3')]=function(_0x376edd){return client[_0xd613('0x4')](_0xd613('0x5'),{'body':_[_0xd613('0x6')](_0x376edd,{'source':_0x376edd[_0xd613('0x7')],'destinationcontext':_0x376edd[_0xd613('0x8')],'callerid':_0x376edd[_0xd613('0x9')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xd613('0xa')]=function(){return function(){return client[_0xd613('0x4')](_0xd613('0xb'),{'options':{'where':{'type':[_0xd613('0xc')],'createdAt':{'$between':[moment()[_0xd613('0xd')](_0xd613('0xe'))[_0xd613('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xd613('0x10')](_0xd613('0xe'))[_0xd613('0xf')](_0xd613('0x11'))]}},'attributes':[_0xd613('0x12'),_0xd613('0x13'),'duration',_0xd613('0x14')]},'log':_0xd613('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f3c6f8e..164b4b1 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 _0x31bf=['create','Request','CreateVoiceDialReport','../client'];(function(_0x376326,_0x31aa9){var _0x2a7340=function(_0x2464b5){while(--_0x2464b5){_0x376326['push'](_0x376326['shift']());}};_0x2a7340(++_0x31aa9);}(_0x31bf,0x8b));var _0xf31b=function(_0x4ce48b,_0x5a86ff){_0x4ce48b=_0x4ce48b-0x0;var _0x2c49c6=_0x31bf[_0x4ce48b];return _0x2c49c6;};'use strict';var client=require(_0xf31b('0x0'));exports[_0xf31b('0x1')]=function(_0x3c4787){return client[_0xf31b('0x2')](_0xf31b('0x3'),{'body':_0x3c4787,'log':_0xf31b('0x3')});}; \ No newline at end of file +var _0xa24b=['Request','CreateVoiceDialReport','../client'];(function(_0x27450d,_0x3d55d2){var _0x18b566=function(_0x2a9390){while(--_0x2a9390){_0x27450d['push'](_0x27450d['shift']());}};_0x18b566(++_0x3d55d2);}(_0xa24b,0x137));var _0xba24=function(_0x4cdf61,_0x38a75a){_0x4cdf61=_0x4cdf61-0x0;var _0x5d3f3c=_0xa24b[_0x4cdf61];return _0x5d3f3c;};'use strict';var client=require(_0xba24('0x0'));exports['create']=function(_0x6ccdcc){return client[_0xba24('0x1')](_0xba24('0x2'),{'body':_0x6ccdcc,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index bde6f4f..5018ecf 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 _0x9e0d=['GetVoiceExtension','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x4f95ab,_0x18f61d){var _0x1c8c57=function(_0x12471f){while(--_0x12471f){_0x4f95ab['push'](_0x4f95ab['shift']());}};_0x1c8c57(++_0x18f61d);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x12e506,_0x1718fe){_0x12e506=_0x12e506-0x0;var _0xbddeb4=_0x9e0d[_0x12e506];return _0xbddeb4;};'use strict';var client=require(_0xd9e0('0x0'));exports[_0xd9e0('0x1')]=function(){return function(){return client[_0xd9e0('0x2')](_0xd9e0('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xd9e0('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xd9e0('0x1')});};}; \ No newline at end of file +var _0xe9ad=['Request','GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x3a22ae,_0x1cae81){var _0x1c5332=function(_0x33ab02){while(--_0x33ab02){_0x3a22ae['push'](_0x3a22ae['shift']());}};_0x1c5332(++_0x1cae81);}(_0xe9ad,0x82));var _0xde9a=function(_0x5becd6,_0x13e651){_0x5becd6=_0x5becd6-0x0;var _0x3b7b78=_0xe9ad[_0x5becd6];return _0x3b7b78;};'use strict';var client=require(_0xde9a('0x0'));exports[_0xde9a('0x1')]=function(){return function(){return client[_0xde9a('0x2')](_0xde9a('0x3'),{'options':{'raw':!![],'attributes':['id',_0xde9a('0x4'),_0xde9a('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xde9a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index fa204c1..113ddf9 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 _0x181b=['dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient'];(function(_0x150be7,_0x31fab6){var _0x3e0db1=function(_0x885e28){while(--_0x885e28){_0x150be7['push'](_0x150be7['shift']());}};_0x3e0db1(++_0x31fab6);}(_0x181b,0x18f));var _0xb181=function(_0x58454f,_0x1d05b8){_0x58454f=_0x58454f-0x0;var _0x428e78=_0x181b[_0x58454f];return _0x428e78;};'use strict';var client=require(_0xb181('0x0'));exports[_0xb181('0x1')]=function(){return function(){return client['Request'](_0xb181('0x2'),{'options':{'raw':![],'attributes':['id',_0xb181('0x3'),_0xb181('0x4'),_0xb181('0x5'),'autopause',_0xb181('0x6'),'type',_0xb181('0x7'),_0xb181('0x8'),_0xb181('0x9'),'dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0xb181('0xa'),_0xb181('0xb'),_0xb181('0xc'),_0xb181('0xd'),_0xb181('0xe'),_0xb181('0xf'),_0xb181('0x10'),_0xb181('0x11'),_0xb181('0x12'),_0xb181('0x13'),'dialBusyMaxRetry',_0xb181('0x14'),_0xb181('0x15'),_0xb181('0x16'),_0xb181('0x17'),_0xb181('0x18'),'dialGlobalInterval',_0xb181('0x19'),_0xb181('0x1a'),_0xb181('0x1b'),_0xb181('0x1c'),_0xb181('0x1d'),_0xb181('0x1e'),_0xb181('0x1f'),_0xb181('0x20'),_0xb181('0x21'),_0xb181('0x22'),_0xb181('0x23'),_0xb181('0x24'),_0xb181('0x25'),_0xb181('0x26'),_0xb181('0x27'),'dialOrderByScheduledAt',_0xb181('0x28'),_0xb181('0x29'),_0xb181('0x2a'),_0xb181('0x6'),_0xb181('0x2b'),'dialRandomLastDigitCallerIdNumber',_0xb181('0x2c'),_0xb181('0x2d'),_0xb181('0x2e'),_0xb181('0x2f'),_0xb181('0x30'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0xb181('0x31'),'dialMachineRetryFrequency',_0xb181('0x32'),'dialAgentRejectRetryFrequency',_0xb181('0x33'),_0xb181('0x34'),_0xb181('0x35'),_0xb181('0x36'),_0xb181('0x37')],'include':[{'model':_0xb181('0x38'),'as':_0xb181('0x38'),'attributes':['id',_0xb181('0x3'),_0xb181('0x39'),_0xb181('0x3a')]},{'model':_0xb181('0x3b'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0xb181('0x3c'),'attributes':['id',_0xb181('0x3'),_0xb181('0x39'),_0xb181('0x3a')]},{'model':_0xb181('0x3d'),'as':'Interval','attributes':['id',_0xb181('0x3')],'include':[{'model':_0xb181('0x3d'),'as':_0xb181('0x3e'),'attributes':['id',_0xb181('0x3'),'interval']}]}]},'log':_0xb181('0x1')});};}; \ No newline at end of file +var _0xc0f3=['callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','name'];(function(_0x180a60,_0x11d0e3){var _0xf37e5c=function(_0x7c7ea2){while(--_0x7c7ea2){_0x180a60['push'](_0x180a60['shift']());}};_0xf37e5c(++_0x11d0e3);}(_0xc0f3,0x1d8));var _0x3c0f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc0f3[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x3c0f('0x0')]=function(){return function(){return client[_0x3c0f('0x1')](_0x3c0f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3c0f('0x3'),'acwTimeout','autopause',_0x3c0f('0x4'),_0x3c0f('0x5'),_0x3c0f('0x6'),_0x3c0f('0x7'),_0x3c0f('0x8'),'dialLimitQueue',_0x3c0f('0x9'),_0x3c0f('0xa'),_0x3c0f('0xb'),_0x3c0f('0xc'),'dialOriginateCallerIdName',_0x3c0f('0xd'),_0x3c0f('0xe'),_0x3c0f('0xf'),_0x3c0f('0x10'),_0x3c0f('0x11'),'dialCongestionMaxRetry',_0x3c0f('0x12'),_0x3c0f('0x13'),_0x3c0f('0x14'),_0x3c0f('0x15'),'dialNoAnswerRetryFrequency',_0x3c0f('0x16'),_0x3c0f('0x17'),_0x3c0f('0x18'),_0x3c0f('0x19'),_0x3c0f('0x1a'),_0x3c0f('0x1b'),'dialAMDInitialSilence',_0x3c0f('0x1c'),_0x3c0f('0x1d'),'dialAMDTotalAnalysisTime',_0x3c0f('0x1e'),_0x3c0f('0x1f'),_0x3c0f('0x20'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x3c0f('0x21'),_0x3c0f('0x22'),'dialRecallInQueue',_0x3c0f('0x23'),_0x3c0f('0x24'),_0x3c0f('0x25'),_0x3c0f('0x26'),_0x3c0f('0x4'),'strategy','dialRandomLastDigitCallerIdNumber',_0x3c0f('0x27'),_0x3c0f('0x28'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x3c0f('0x29'),_0x3c0f('0x2a'),_0x3c0f('0x2b'),'dialMachineRetryFrequency',_0x3c0f('0x2c'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x3c0f('0x2d'),_0x3c0f('0x2e'),'dialPreviewAutoRecallMe',_0x3c0f('0x2f')],'include':[{'model':_0x3c0f('0x30'),'as':_0x3c0f('0x30'),'attributes':['id',_0x3c0f('0x31'),_0x3c0f('0x32'),_0x3c0f('0x33')]},{'model':_0x3c0f('0x34'),'as':_0x3c0f('0x35'),'attributes':['id',_0x3c0f('0x31')]},{'model':_0x3c0f('0x30'),'as':_0x3c0f('0x36'),'attributes':['id',_0x3c0f('0x31'),_0x3c0f('0x32'),_0x3c0f('0x33')]},{'model':_0x3c0f('0x37'),'as':_0x3c0f('0x37'),'attributes':['id',_0x3c0f('0x31')],'include':[{'model':_0x3c0f('0x37'),'as':_0x3c0f('0x38'),'attributes':['id',_0x3c0f('0x31'),_0x3c0f('0x39')]}]}]},'log':_0x3c0f('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 527a9be..05b8fc8 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(_0x496fa7,_0xcd0497){var _0x5bfedb=function(_0x46c27b){while(--_0x46c27b){_0x496fa7['push'](_0x496fa7['shift']());}};_0x5bfedb(++_0xcd0497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x31ddb0,_0x261044){var _0x3f9d79=function(_0x34bcaf){while(--_0x34bcaf){_0x31ddb0['push'](_0x31ddb0['shift']());}};_0x3f9d79(++_0x261044);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 b7acb10..6d586e5 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 _0x2394=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x486217,_0x4fc85f){var _0x1f5d36=function(_0x39edf0){while(--_0x39edf0){_0x486217['push'](_0x486217['shift']());}};_0x1f5d36(++_0x4fc85f);}(_0x2394,0x139));var _0x4239=function(_0x764eb6,_0x4ddc00){_0x764eb6=_0x764eb6-0x0;var _0x12e77d=_0x2394[_0x764eb6];return _0x12e77d;};'use strict';var client=require(_0x4239('0x0'));exports[_0x4239('0x1')]=function(_0x37b78d){return function(){return client[_0x4239('0x2')](_0x4239('0x3'),{'options':{'where':{'VoiceQueueId':_0x37b78d,'paused':!![]},'raw':!![]},'log':_0x4239('0x1')});};}; \ No newline at end of file +var _0x9f9e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x1cc551,_0x546124){var _0x2bd073=function(_0x1854f3){while(--_0x1854f3){_0x1cc551['push'](_0x1cc551['shift']());}};_0x2bd073(++_0x546124);}(_0x9f9e,0x10f));var _0xe9f9=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x9f9e[_0x3a9635];return _0x10d08c;};'use strict';var client=require(_0xe9f9('0x0'));exports[_0xe9f9('0x1')]=function(_0x56eb54){return function(){return client[_0xe9f9('0x2')](_0xe9f9('0x3'),{'options':{'where':{'VoiceQueueId':_0x56eb54,'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 b7e7791..73b982f 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2fdeff,_0x1bb36a){var _0x1841c8=function(_0x5483c4){while(--_0x5483c4){_0x2fdeff['push'](_0x2fdeff['shift']());}};_0x1841c8(++_0x1bb36a);}(_0x7a54,0x106));var _0x47a5=function(_0x42de94,_0x37923a){_0x42de94=_0x42de94-0x0;var _0x1f7be1=_0x7a54[_0x42de94];return _0x1f7be1;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x35a934,_0x3d7cd3){var _0x46d520=function(_0x45d464){while(--_0x45d464){_0x35a934['push'](_0x35a934['shift']());}};_0x46d520(++_0x3d7cd3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 180a7d1..c39f90b 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 _0xb192=['context','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','isexternal','origtransfererexten','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid'];(function(_0x282f1c,_0x5605f0){var _0x258044=function(_0x907ee6){while(--_0x907ee6){_0x282f1c['push'](_0x282f1c['shift']());}};_0x258044(++_0x5605f0);}(_0xb192,0x132));var _0x2b19=function(_0x25f005,_0x5e2d36){_0x25f005=_0x25f005-0x0;var _0x2aee98=_0xb192[_0x25f005];return _0x2aee98;};'use strict';var client=require(_0x2b19('0x0'));exports['transfers']={};exports[_0x2b19('0x1')]=function(_0x28475f){return client[_0x2b19('0x2')](_0x2b19('0x3'),{'body':{'result':_0x28475f[_0x2b19('0x4')],'transfererchannel':_0x28475f[_0x2b19('0x5')],'transferercalleridnum':_0x28475f[_0x2b19('0x6')],'transferercalleridname':_0x28475f['transferercalleridname'],'transfererconnectedlinenum':_0x28475f['transfererconnectedlinenum'],'transfererconnectedlinename':_0x28475f[_0x2b19('0x7')],'transfereraccountcode':_0x28475f['transfereraccountcode'],'transferercontext':_0x28475f[_0x2b19('0x8')],'transfererexten':_0x28475f[_0x2b19('0x9')],'transfererlinkedid':_0x28475f[_0x2b19('0xa')],'transfereechannel':_0x28475f[_0x2b19('0xb')],'transfereecalleridnum':_0x28475f['transfereecalleridnum'],'transfereecalleridname':_0x28475f['transfereecalleridname'],'transfereeconnectedlinenum':_0x28475f[_0x2b19('0xc')],'transfereeconnectedlinename':_0x28475f[_0x2b19('0xd')],'transfereeaccountcode':_0x28475f[_0x2b19('0xe')],'transfereecontext':_0x28475f[_0x2b19('0xf')],'transfereeexten':_0x28475f[_0x2b19('0x10')],'transfereelinkedid':_0x28475f[_0x2b19('0x11')],'isexternal':_0x28475f['isexternal'],'context':_0x28475f[_0x2b19('0x12')],'extension':_0x28475f['extension'],'type':'blind'},'log':_0x2b19('0x3')});};exports['attendedTransfer']=function(_0x3cab15){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x3cab15['result'],'transfererchannel':_0x3cab15[_0x2b19('0x13')],'transferercalleridnum':_0x3cab15[_0x2b19('0x14')],'transferercalleridname':_0x3cab15[_0x2b19('0x15')],'transfererconnectedlinenum':_0x3cab15[_0x2b19('0x16')],'transfererconnectedlinename':_0x3cab15[_0x2b19('0x17')],'transfereraccountcode':_0x3cab15[_0x2b19('0x18')],'transferercontext':_0x3cab15[_0x2b19('0x19')],'transfererexten':_0x3cab15[_0x2b19('0x1a')],'transfererlinkedid':_0x3cab15[_0x2b19('0x1b')],'transfereechannel':_0x3cab15['transfertargetchannel'],'transfereecalleridnum':_0x3cab15[_0x2b19('0x1c')],'transfereecalleridname':_0x3cab15[_0x2b19('0x1d')],'transfereeconnectedlinenum':_0x3cab15[_0x2b19('0x1e')],'transfereeconnectedlinename':_0x3cab15[_0x2b19('0x1f')],'transfereeaccountcode':_0x3cab15['transfertargetaccountcode'],'transfereecontext':_0x3cab15[_0x2b19('0x20')],'transfereeexten':_0x3cab15[_0x2b19('0x21')],'transfereelinkedid':_0x3cab15['transfertargetlinkedid'],'isexternal':_0x3cab15[_0x2b19('0x22')],'context':_0x3cab15['origtransferercontext'],'extension':_0x3cab15[_0x2b19('0x23')],'type':'attended'},'log':_0x2b19('0x3')});}; \ No newline at end of file +var _0x192a=['attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','extension','attendedTransfer','result','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten'];(function(_0x23fcec,_0x48ec4c){var _0x447567=function(_0x4781bb){while(--_0x4781bb){_0x23fcec['push'](_0x23fcec['shift']());}};_0x447567(++_0x48ec4c);}(_0x192a,0x151));var _0xa192=function(_0x11c657,_0x370939){_0x11c657=_0x11c657-0x0;var _0x5e62af=_0x192a[_0x11c657];return _0x5e62af;};'use strict';var client=require(_0xa192('0x0'));exports[_0xa192('0x1')]={};exports[_0xa192('0x2')]=function(_0x27e52d){return client[_0xa192('0x3')](_0xa192('0x4'),{'body':{'result':_0x27e52d['result'],'transfererchannel':_0x27e52d['transfererchannel'],'transferercalleridnum':_0x27e52d[_0xa192('0x5')],'transferercalleridname':_0x27e52d[_0xa192('0x6')],'transfererconnectedlinenum':_0x27e52d[_0xa192('0x7')],'transfererconnectedlinename':_0x27e52d[_0xa192('0x8')],'transfereraccountcode':_0x27e52d[_0xa192('0x9')],'transferercontext':_0x27e52d['transferercontext'],'transfererexten':_0x27e52d[_0xa192('0xa')],'transfererlinkedid':_0x27e52d[_0xa192('0xb')],'transfereechannel':_0x27e52d[_0xa192('0xc')],'transfereecalleridnum':_0x27e52d[_0xa192('0xd')],'transfereecalleridname':_0x27e52d[_0xa192('0xe')],'transfereeconnectedlinenum':_0x27e52d[_0xa192('0xf')],'transfereeconnectedlinename':_0x27e52d[_0xa192('0x10')],'transfereeaccountcode':_0x27e52d[_0xa192('0x11')],'transfereecontext':_0x27e52d[_0xa192('0x12')],'transfereeexten':_0x27e52d[_0xa192('0x13')],'transfereelinkedid':_0x27e52d[_0xa192('0x14')],'isexternal':_0x27e52d['isexternal'],'context':_0x27e52d['context'],'extension':_0x27e52d[_0xa192('0x15')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xa192('0x16')]=function(_0x158c78){return client[_0xa192('0x3')](_0xa192('0x4'),{'body':{'result':_0x158c78[_0xa192('0x17')],'transfererchannel':_0x158c78[_0xa192('0x18')],'transferercalleridnum':_0x158c78['origtransferercalleridnum'],'transferercalleridname':_0x158c78[_0xa192('0x19')],'transfererconnectedlinenum':_0x158c78[_0xa192('0x1a')],'transfererconnectedlinename':_0x158c78[_0xa192('0x1b')],'transfereraccountcode':_0x158c78['origtransfereraccountcode'],'transferercontext':_0x158c78[_0xa192('0x1c')],'transfererexten':_0x158c78[_0xa192('0x1d')],'transfererlinkedid':_0x158c78[_0xa192('0x1e')],'transfereechannel':_0x158c78['transfertargetchannel'],'transfereecalleridnum':_0x158c78[_0xa192('0x1f')],'transfereecalleridname':_0x158c78[_0xa192('0x20')],'transfereeconnectedlinenum':_0x158c78[_0xa192('0x21')],'transfereeconnectedlinename':_0x158c78[_0xa192('0x22')],'transfereeaccountcode':_0x158c78[_0xa192('0x23')],'transfereecontext':_0x158c78[_0xa192('0x24')],'transfereeexten':_0x158c78[_0xa192('0x25')],'transfereelinkedid':_0x158c78['transfertargetlinkedid'],'isexternal':_0x158c78[_0xa192('0x26')],'context':_0x158c78[_0xa192('0x27')],'extension':_0x158c78[_0xa192('0x28')],'type':_0xa192('0x29')},'log':_0xa192('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 7a2e894..ad86783 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(_0x3b02ab,_0x3764b3){var _0xf6770f=function(_0x2add79){while(--_0x2add79){_0x3b02ab['push'](_0x3b02ab['shift']());}};_0xf6770f(++_0x3764b3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2830fc,_0x1bbb32){_0x2830fc=_0x2830fc-0x0;var _0x3cc76b=_0xb10b[_0x2830fc];return _0x3cc76b;};'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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x3bffc8,_0x4e0cc7){var _0x2937bc=function(_0x432a6f){while(--_0x432a6f){_0x3bffc8['push'](_0x3bffc8['shift']());}};_0x2937bc(++_0x4e0cc7);}(_0x7a54,0x106));var _0x47a5=function(_0x2467d0,_0x279bdc){_0x2467d0=_0x2467d0-0x0;var _0x4fbce2=_0x7a54[_0x2467d0];return _0x4fbce2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+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 6b24368..1a09adc 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 _0x671e=['ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','updatedAt','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','isNil','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x671e,0xd6));var _0xe671=function(_0x22a35b,_0x55764a){_0x22a35b=_0x22a35b-0x0;var _0xa4e884=_0x671e[_0x22a35b];return _0xa4e884;};'use strict';var _=require(_0xe671('0x0'));var BPromise=require(_0xe671('0x1'));var Redis=require(_0xe671('0x2'));var util=require('util');var config=require(_0xe671('0x3'));var logger=require(_0xe671('0x4'))('trigger');var cmContactRpc=require(_0xe671('0x5'));config[_0xe671('0x6')]=_[_0xe671('0x7')](config['redis'],{'host':_0xe671('0x8'),'port':0x18eb});var io=require(_0xe671('0x9'))(new Redis(config['redis']));function emit(_0x27b847,_0x7ec84b,_0xda7edc,_0x4033d9,_0x48f194){logger[_0xe671('0xa')](_0xe671('0xb'),_0x27b847,_0x7ec84b['id'],_0xda7edc,_0x4033d9,JSON[_0xe671('0xc')](_0x48f194));io['to'](_0xda7edc)[_0xe671('0xd')](_0x4033d9,_0x48f194);}exports['exec']=function(_0x5831af,_0xdceecd,_0x1b34e8,_0x1ea1c3){var _0x5682ac,_0x1893d0;var _0x467e6f={};var _0x1878be;var _0x39c4b9=Number(_0x1b34e8['data1']);var _0x3a051e=_0x1b34e8['data2']?Boolean(Number(_0x1b34e8[_0xe671('0xe')])):![];var _0x52757d;var _0x4f62c1=![];if(!_['isNil'](_0x1b34e8['data5'])){if(_0x1b34e8[_0xe671('0xf')]=='1')_0x4f62c1=!![];}if(!_0x4f62c1){if(_0x1ea1c3[_0xe671('0x10')]){_0x467e6f['id']=_0x1ea1c3[_0xe671('0x10')];}}if(!_0x467e6f['id']){_0x467e6f[_0xe671('0x11')]=_0x39c4b9;_0x52757d=_0x1b34e8['data3']&&_0x1b34e8[_0xe671('0x12')]!=='0'?_0x1b34e8[_0xe671('0x12')][_0xe671('0x13')](','):[_0xe671('0x14')];_0x467e6f[_0xe671('0x15')]=_['map'](_0x52757d,function(_0x135e68){var _0x186bba={};_0x186bba[_0x135e68]=_0x1ea1c3[_0xe671('0x16')]?_0x1ea1c3[_0xe671('0x17')]:_0x1ea1c3[_0xe671('0x18')];return _0x186bba;});_0x1878be=_0x1ea1c3[_0xe671('0x16')]?_0x1ea1c3[_0xe671('0x17')]:_0x1ea1c3[_0xe671('0x18')];}var _0x4a24bf=['id',_0xe671('0x19'),_0xe671('0x1a'),_0xe671('0x14'),_0xe671('0x1b'),'fax',_0xe671('0x11'),'createdAt',_0xe671('0x1c'),_0xe671('0x1d')];var _0x59c49c=_['union'](_0x4a24bf,_0x52757d);BPromise[_0xe671('0x1e')]()[_0xe671('0x1f')](cmContactRpc['getContacts']({'attributes':_0x59c49c,'where':_0x467e6f,'phone':_0x1878be}))['then'](function(_0x3c796b){_0x1893d0=_0x3c796b;if(!_['isEmpty'](_0x1893d0)){if(_0x1893d0[_0xe671('0x20')]===0x1){_0x5682ac=_0x1893d0[0x0];logger['info'](_0xe671('0x21'),_0x1ea1c3[_0xe671('0x22')],_0xdceecd['id'],_0x5682ac['id']);}else{logger['info'](_0xe671('0x23'),_0x1ea1c3[_0xe671('0x22')],_0xdceecd['id'],_[_0xe671('0x24')](_0x1893d0,'id')[_0xe671('0x25')](','));}return;}else{logger[_0xe671('0xa')](_0xe671('0x26'),_0x1ea1c3[_0xe671('0x22')],_0xdceecd['id']);var _0x529266={'ListId':_0x39c4b9};var _0xb4d0ef=_0x1b34e8[_0xe671('0x27')]&&_0x1b34e8[_0xe671('0x27')]!=='0'?_0x1b34e8['data4']:_0xe671('0x14');if(_0x3a051e){logger[_0xe671('0xa')](_0xe671('0x28'),_0x1ea1c3[_0xe671('0x22')],_0xdceecd['id']);_0x529266[_0xb4d0ef]=_['isNil'](_0x1ea1c3[_0xe671('0x16')])?_0x1ea1c3[_0xe671('0x18')]:_0x1ea1c3[_0xe671('0x17')];if(_['isNil'](_0x1ea1c3[_0xe671('0x16')])){_0x529266[_0xe671('0x19')]=_0x1ea1c3['calleridname']&&_0x1ea1c3[_0xe671('0x29')]!==_0xe671('0x2a')?_0x1ea1c3[_0xe671('0x29')]:_0xe671('0x2b');}else{_0x529266[_0xe671('0x19')]=_0x1ea1c3[_0xe671('0x2c')]&&_0x1ea1c3[_0xe671('0x2c')]!==''?_0x1ea1c3[_0xe671('0x2c')]:'Unknown';}return BPromise[_0xe671('0x1e')]()[_0xe671('0x1f')](cmContactRpc[_0xe671('0x2d')](_0x529266))['then'](function(_0x2db5cc){_0x5682ac=_0x2db5cc;_0x1893d0[_0xe671('0x2e')](_0x2db5cc);if(_0x5682ac){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x1ea1c3['uniqueid'],_0xdceecd['id'],_0x5682ac['id']);}return;});}else{logger[_0xe671('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x1ea1c3[_0xe671('0x22')],_0xdceecd['id']);_0x529266[_0xb4d0ef]=_[_0xe671('0x2f')](_0x1ea1c3['routeId'])?_0x1ea1c3['calleridnum']:_0x1ea1c3[_0xe671('0x17')];if(_[_0xe671('0x2f')](_0x1ea1c3[_0xe671('0x16')])){_0x529266[_0xe671('0x19')]=_0x1ea1c3['calleridname']&&_0x1ea1c3[_0xe671('0x29')]!==_0xe671('0x2a')?_0x1ea1c3[_0xe671('0x29')]:_0xe671('0x2b');}else{_0x529266['firstName']=_0x1ea1c3['destcalleridname']&&_0x1ea1c3[_0xe671('0x2c')]!==_0xe671('0x2a')?_0x1ea1c3[_0xe671('0x2c')]:_0xe671('0x2b');}_0x5682ac=_0x529266;_0x1893d0[_0xe671('0x2e')](_0x529266);return;}}})[_0xe671('0x1f')](function(){if(_0x5831af){emit(_0x1ea1c3[_0xe671('0x22')],_0xdceecd,util[_0xe671('0x30')](_0xe671('0x31'),_0x5831af[_0xe671('0x32')]),util['format'](_0xe671('0x33'),_0x1b34e8[_0xe671('0x34')][_0xe671('0x35')]()),{'evt':_['merge'](_0x1ea1c3,{'autoCreate':_0x3a051e}),'contact':_0x5682ac===undefined?{}:_0x5682ac,'contacts':_0x1893d0[_0xe671('0x20')]===0x0?undefined:_0x1893d0});}});}; \ No newline at end of file +var _0x85b0=['[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','firstName','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','action','toLowerCase','length','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','fax','createdAt','scheduledAt','union','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s'];(function(_0x13f520,_0x269ec1){var _0x61867c=function(_0x1434b4){while(--_0x1434b4){_0x13f520['push'](_0x13f520['shift']());}};_0x61867c(++_0x269ec1);}(_0x85b0,0x7f));var _0x085b=function(_0x332a67,_0x40a3ea){_0x332a67=_0x332a67-0x0;var _0x69828a=_0x85b0[_0x332a67];return _0x69828a;};'use strict';var _=require(_0x085b('0x0'));var BPromise=require(_0x085b('0x1'));var Redis=require('ioredis');var util=require(_0x085b('0x2'));var config=require(_0x085b('0x3'));var logger=require(_0x085b('0x4'))(_0x085b('0x5'));var cmContactRpc=require(_0x085b('0x6'));config[_0x085b('0x7')]=_[_0x085b('0x8')](config[_0x085b('0x7')],{'host':_0x085b('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x085b('0x7')]));function emit(_0x50c638,_0x32cba9,_0x36f883,_0x208f28,_0x5828d1){logger[_0x085b('0xa')](_0x085b('0xb'),_0x50c638,_0x32cba9['id'],_0x36f883,_0x208f28,JSON[_0x085b('0xc')](_0x5828d1));io['to'](_0x36f883)['emit'](_0x208f28,_0x5828d1);}exports['exec']=function(_0x451ba8,_0x1868a1,_0x161be2,_0x3cb024){var _0x2eae03,_0x26923b;var _0x362ae9={};var _0x2defdc;var _0x49c5cf=Number(_0x161be2[_0x085b('0xd')]);var _0x3e8acb=_0x161be2['data2']?Boolean(Number(_0x161be2[_0x085b('0xe')])):![];var _0x51c82f;var _0x494e68=![];if(!_[_0x085b('0xf')](_0x161be2['data5'])){if(_0x161be2[_0x085b('0x10')]=='1')_0x494e68=!![];}if(!_0x494e68){if(_0x3cb024[_0x085b('0x11')]){_0x362ae9['id']=_0x3cb024['xmd-contactid'];}}if(!_0x362ae9['id']){_0x362ae9[_0x085b('0x12')]=_0x49c5cf;_0x51c82f=_0x161be2[_0x085b('0x13')]&&_0x161be2[_0x085b('0x13')]!=='0'?_0x161be2['data3'][_0x085b('0x14')](','):[_0x085b('0x15')];_0x362ae9[_0x085b('0x16')]=_[_0x085b('0x17')](_0x51c82f,function(_0x5ecd46){var _0x574afe={};_0x574afe[_0x5ecd46]=_0x3cb024[_0x085b('0x18')]?_0x3cb024[_0x085b('0x19')]:_0x3cb024[_0x085b('0x1a')];return _0x574afe;});_0x2defdc=_0x3cb024[_0x085b('0x18')]?_0x3cb024[_0x085b('0x19')]:_0x3cb024[_0x085b('0x1a')];}var _0xc20181=['id','firstName',_0x085b('0x1b'),_0x085b('0x15'),'mobile',_0x085b('0x1c'),_0x085b('0x12'),_0x085b('0x1d'),_0x085b('0x1e'),'updatedAt'];var _0x2db204=_[_0x085b('0x1f')](_0xc20181,_0x51c82f);BPromise['resolve']()[_0x085b('0x20')](cmContactRpc[_0x085b('0x21')]({'attributes':_0x2db204,'where':_0x362ae9,'phone':_0x2defdc}))[_0x085b('0x20')](function(_0x59f8d1){_0x26923b=_0x59f8d1;if(!_['isEmpty'](_0x26923b)){if(_0x26923b['length']===0x1){_0x2eae03=_0x26923b[0x0];logger[_0x085b('0xa')](_0x085b('0x22'),_0x3cb024['uniqueid'],_0x1868a1['id'],_0x2eae03['id']);}else{logger[_0x085b('0xa')](_0x085b('0x23'),_0x3cb024[_0x085b('0x24')],_0x1868a1['id'],_[_0x085b('0x17')](_0x26923b,'id')[_0x085b('0x25')](','));}return;}else{logger[_0x085b('0xa')](_0x085b('0x26'),_0x3cb024[_0x085b('0x24')],_0x1868a1['id']);var _0x30ab8d={'ListId':_0x49c5cf};var _0x38dbac=_0x161be2[_0x085b('0x27')]&&_0x161be2['data4']!=='0'?_0x161be2[_0x085b('0x27')]:_0x085b('0x15');if(_0x3e8acb){logger[_0x085b('0xa')](_0x085b('0x28'),_0x3cb024[_0x085b('0x24')],_0x1868a1['id']);_0x30ab8d[_0x38dbac]=_[_0x085b('0xf')](_0x3cb024[_0x085b('0x18')])?_0x3cb024['calleridnum']:_0x3cb024[_0x085b('0x19')];if(_[_0x085b('0xf')](_0x3cb024[_0x085b('0x18')])){_0x30ab8d['firstName']=_0x3cb024[_0x085b('0x29')]&&_0x3cb024[_0x085b('0x29')]!==_0x085b('0x2a')?_0x3cb024[_0x085b('0x29')]:_0x085b('0x2b');}else{_0x30ab8d[_0x085b('0x2c')]=_0x3cb024[_0x085b('0x2d')]&&_0x3cb024[_0x085b('0x2d')]!==''?_0x3cb024[_0x085b('0x2d')]:_0x085b('0x2b');}return BPromise[_0x085b('0x2e')]()[_0x085b('0x20')](cmContactRpc[_0x085b('0x2f')](_0x30ab8d))[_0x085b('0x20')](function(_0x25b30f){_0x2eae03=_0x25b30f;_0x26923b[_0x085b('0x30')](_0x25b30f);if(_0x2eae03){logger[_0x085b('0xa')](_0x085b('0x31'),_0x3cb024[_0x085b('0x24')],_0x1868a1['id'],_0x2eae03['id']);}return;});}else{logger[_0x085b('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x3cb024[_0x085b('0x24')],_0x1868a1['id']);_0x30ab8d[_0x38dbac]=_[_0x085b('0xf')](_0x3cb024['routeId'])?_0x3cb024['calleridnum']:_0x3cb024['destcalleridnum'];if(_[_0x085b('0xf')](_0x3cb024[_0x085b('0x18')])){_0x30ab8d['firstName']=_0x3cb024[_0x085b('0x29')]&&_0x3cb024['calleridname']!==''?_0x3cb024['calleridname']:_0x085b('0x2b');}else{_0x30ab8d[_0x085b('0x2c')]=_0x3cb024[_0x085b('0x2d')]&&_0x3cb024['destcalleridname']!==_0x085b('0x2a')?_0x3cb024[_0x085b('0x2d')]:'Unknown';}_0x2eae03=_0x30ab8d;_0x26923b['push'](_0x30ab8d);return;}}})[_0x085b('0x20')](function(){if(_0x451ba8){emit(_0x3cb024['uniqueid'],_0x1868a1,util[_0x085b('0x32')]('user:%s',_0x451ba8['name']),util[_0x085b('0x32')]('trigger:%s',_0x161be2[_0x085b('0x33')][_0x085b('0x34')]()),{'evt':_['merge'](_0x3cb024,{'autoCreate':_0x3e8acb}),'contact':_0x2eae03===undefined?{}:_0x2eae03,'contacts':_0x26923b[_0x085b('0x35')]===0x0?undefined:_0x26923b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 7435773..3f89539 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 _0xd5f8=['length','interface','action','toLowerCase','contactmanager','motionbar','data1','popup','TemplateId','data2','render','html','buildUri','isNil','data3','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winapp','winApplication','winArguments','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','exec','integration','queue','routeId','urlforward','script','search','replace','channel','AllConditions','every','AnyConditions','some','checkTrigger:\x20trigger','evt','field','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','../../../config/logger','trigger','../ami','defaults','redis','localhost','socket.io-emitter','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','motionChannel','undefined','voice','debug','inspect','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions'];(function(_0x4628fe,_0x36f05a){var _0x3df354=function(_0x37dbc8){while(--_0x37dbc8){_0x4628fe['push'](_0x4628fe['shift']());}};_0x3df354(++_0x36f05a);}(_0xd5f8,0x1d1));var _0x8d5f=function(_0x1a1b62,_0x4cbc31){_0x1a1b62=_0x1a1b62-0x0;var _0xec2ba5=_0xd5f8[_0x1a1b62];return _0xec2ba5;};'use strict';var util=require(_0x8d5f('0x0'));var _=require(_0x8d5f('0x1'));var url=require(_0x8d5f('0x2'));var Mustache=require(_0x8d5f('0x3'));var Redis=require(_0x8d5f('0x4'));var urlforward=require(_0x8d5f('0x5'));var integration=require('./integration');var cmContact=require(_0x8d5f('0x6'));var script=require('./script');var config=require('../../../config/environment');var logger=require(_0x8d5f('0x7'))(_0x8d5f('0x8'));var ami=require(_0x8d5f('0x9'));config['redis']=_[_0x8d5f('0xa')](config[_0x8d5f('0xb')],{'host':_0x8d5f('0xc'),'port':0x18eb});var io=require(_0x8d5f('0xd'))(new Redis(config[_0x8d5f('0xb')]));var operators={'equals':function(_0x359273,_0x3b09b7){return _0x359273==_0x3b09b7;},'not_equals':function(_0x1b2999,_0x413447){return _0x1b2999!=_0x413447;}};var barAndWebActions=['popup','url','winapp'];function Trigger(_0x2a2236){this[_0x8d5f('0xe')]=_0x2a2236[_0x8d5f('0xe')];this[_0x8d5f('0xf')]=_0x2a2236[_0x8d5f('0xf')];this[_0x8d5f('0x10')]=_0x2a2236['voiceQueues'];this[_0x8d5f('0x11')]=_0x2a2236[_0x8d5f('0x11')];this[_0x8d5f('0x12')]=_0x2a2236[_0x8d5f('0x12')];this['zendeskAccounts']=_0x2a2236[_0x8d5f('0x13')];this[_0x8d5f('0x14')]=_0x2a2236[_0x8d5f('0x14')];this[_0x8d5f('0x15')]=_0x2a2236[_0x8d5f('0x15')];this[_0x8d5f('0x16')]=_0x2a2236[_0x8d5f('0x16')];this[_0x8d5f('0x17')]=_0x2a2236[_0x8d5f('0x17')];this[_0x8d5f('0x18')]=_0x2a2236[_0x8d5f('0x18')];this[_0x8d5f('0x19')]=_0x2a2236[_0x8d5f('0x19')];this[_0x8d5f('0x1a')]=_0x2a2236[_0x8d5f('0x1a')];this[_0x8d5f('0x1b')]=_0x2a2236[_0x8d5f('0x1b')];this[_0x8d5f('0x1c')]=_0x2a2236['freshsalesAccounts'];this[_0x8d5f('0x1d')]={'zendesk':this[_0x8d5f('0x13')],'salesforce':this[_0x8d5f('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x8d5f('0x16')],'zoho':this[_0x8d5f('0x17')],'desk':this[_0x8d5f('0x18')],'vtiger':this[_0x8d5f('0x19')],'dynamics365':this[_0x8d5f('0x1b')],'freshsales':this[_0x8d5f('0x1c')],'servicenow':this[_0x8d5f('0x1a')]};ami['on']('custom:agentcalled',this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x20'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x21'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x22'),this['syncCustomEvent'][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x23'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x24'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on']('custom:agentbusy',this['syncCustomEvent']['bind'](this));ami['on'](_0x8d5f('0x25'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x26'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x27'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x28'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x29'),this['syncCustomEvent'][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x2a'),this[_0x8d5f('0x2b')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x2c'),this[_0x8d5f('0x2b')][_0x8d5f('0x1f')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x2d'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x2e'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x2f'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x30'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x31'),this[_0x8d5f('0x1e')]['bind'](this));ami['on'](_0x8d5f('0x32'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x33'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));ami['on'](_0x8d5f('0x34'),this[_0x8d5f('0x1e')][_0x8d5f('0x1f')](this));}Trigger[_0x8d5f('0x35')][_0x8d5f('0x36')]=function(_0x56ccbe,_0x2d4202,_0x5b3471){logger['info'](_0x56ccbe,_0x2d4202,JSON['stringify'](_0x5b3471));io['to'](_0x56ccbe)['emit'](_0x2d4202,_0x5b3471);};Trigger['prototype']['syncCustomEvent']=function(_0x3062dc){var _0xc27aa9=_['clone'](_0x3062dc);if(typeof _0xc27aa9[_0x8d5f('0x37')]===_0x8d5f('0x38')){_0xc27aa9[_0x8d5f('0x37')]=_0x8d5f('0x39');}logger[_0x8d5f('0x3a')](_0x8d5f('0x1e'),util[_0x8d5f('0x3b')](_0xc27aa9,{'showHidden':!![],'depth':null}));this[_0x8d5f('0x3c')](_0xc27aa9);};Trigger[_0x8d5f('0x35')][_0x8d5f('0x2b')]=function(_0x274cc8){if(this[_0x8d5f('0xf')][_0x274cc8['interface']]){this[_0x8d5f('0x1e')](_0x274cc8);}};Trigger['prototype']['checkTriggers']=function(_0x1986e1){var _0x7a84c;for(var _0x16aa57 in this[_0x8d5f('0xe')]){if(this[_0x8d5f('0xe')][_0x8d5f('0x3d')](_0x16aa57)){if(this[_0x8d5f('0xe')][_0x16aa57][_0x8d5f('0x3e')]){_0x7a84c=this[_0x8d5f('0x3f')](this['triggers'][_0x16aa57],_0x1986e1);if(_0x7a84c){_[_0x8d5f('0x40')](_0x1986e1,_0x1986e1[_0x8d5f('0x41')]);for(var _0x4488e9=0x0,_0x5a475e,_0xbafba8,_0x188d31;_0x4488e90x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _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(_0x1b7687,_0x4707fd){var _0x24be40=function(_0x5dae99){while(--_0x5dae99){_0x1b7687['push'](_0x1b7687['shift']());}};_0x24be40(++_0x4707fd);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 c9e2cd4..094c2bd 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 _0xc347=['/systemusers(','Bearer\x20','4.0','body','headers','odata-entityid','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','nameField','customField','idField','substring','indexOf','content','assign','Subjects','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/environment','defaults','localhost','redis','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','message','toLowerCase','outbound','calleridnum'];(function(_0x4e8acf,_0x1256e1){var _0x394bab=function(_0x4c838d){while(--_0x4c838d){_0x4e8acf['push'](_0x4e8acf['shift']());}};_0x394bab(++_0x1256e1);}(_0xc347,0x11b));var _0x7c34=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xc347[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x7c34('0x0'));var rp=require(_0x7c34('0x1'));var util=require(_0x7c34('0x2'));var intUtil=require(_0x7c34('0x3'));var md5=require(_0x7c34('0x4'));var Redis=require(_0x7c34('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x7c34('0x6'));config['redis']=_[_0x7c34('0x7')](config['redis'],{'host':_0x7c34('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7c34('0x9')]));function getAuthToken(_0x48bc6c,_0x5e861c,_0x1801de){if(_0x48bc6c[_0x7c34('0xa')]){_0x48bc6c[_0x7c34('0xb')]=_0x48bc6c[_0x7c34('0xc')][_0x7c34('0xd')];_0x48bc6c[_0x7c34('0xe')]=_0x48bc6c[_0x7c34('0xc')][_0x7c34('0xf')];return Promise[_0x7c34('0x10')](_0x48bc6c['CloudProvider'][_0x7c34('0x11')]);}var _0x454d48={'method':_0x7c34('0x12'),'uri':_0x5e861c,'form':{'client_id':_0x48bc6c[_0x7c34('0x13')],'resource':_0x48bc6c['remoteUri'],'username':_0x48bc6c[_0x7c34('0x14')],'password':_0x48bc6c[_0x7c34('0x15')],'grant_type':_0x7c34('0x15'),'client_secret':_0x48bc6c[_0x7c34('0x16')]},'json':!![]};return rp(_0x454d48)[_0x7c34('0x17')](function(_0x2521b5){return _0x2521b5[_0x7c34('0x18')];})['catch'](function(_0x5efe40){logger[_0x7c34('0x19')]('['+[_0x1801de[_0x7c34('0x1a')]()]+_0x7c34('0x1b'));return _0x5efe40['message'];});}function getUser(_0x234da8,_0x1e6304,_0x15485b,_0x5f322e,_0x39cede,_0x4e52f3){return new Promise(function(_0x44dc34,_0x4daaf0){return getAuthToken(_0x1e6304,_0x5f322e,_0x4e52f3)['then'](function(_0x3ea439){var _0x4bcfc9={'method':_0x7c34('0x1c'),'uri':_0x39cede+_0x7c34('0x1d'),'headers':{'Authorization':'Bearer\x20'+_0x3ea439,'OData-Version':'4.0'},'json':!![]};return rp(_0x4bcfc9);})[_0x7c34('0x17')](function(_0x298737){var _0x23a3f9=_0x298737[_0x7c34('0x1e')];var _0x29e1b9=![];var _0x95953d=null;if(!_[_0x7c34('0x1f')](_0x15485b)){if(intUtil['validateEmail'](_0x15485b[_0x7c34('0x20')])){_0x234da8[_0x7c34('0x21')]=_0x15485b[_0x7c34('0x20')];for(_0x95953d=0x0;_0x95953d<_0x23a3f9[_0x7c34('0x22')];_0x95953d++){if(_0x23a3f9[_0x95953d][_0x7c34('0x23')]===_0x15485b[_0x7c34('0x20')]&&!_0x23a3f9[_0x95953d][_0x7c34('0x24')]){_0x29e1b9=!![];logger[_0x7c34('0x25')]('['+[_0x4e52f3[_0x7c34('0x1a')]()]+_0x7c34('0x26')+_0x23a3f9[_0x95953d][_0x7c34('0x27')]+'!');_0x234da8[_0x7c34('0x28')]=_0x23a3f9[_0x95953d][_0x7c34('0x27')];}}}}if(!_0x29e1b9){logger[_0x7c34('0x25')]('['+[_0x4e52f3['toUpperCase']()]+_0x7c34('0x29'));_0x234da8[_0x7c34('0x21')]=_0x1e6304[_0x7c34('0x14')];for(_0x95953d=0x0;_0x95953d<_0x23a3f9[_0x7c34('0x22')];_0x95953d++){if(_0x23a3f9[_0x95953d][_0x7c34('0x23')]===_0x1e6304[_0x7c34('0x14')]){_0x234da8[_0x7c34('0x28')]=_0x23a3f9[_0x95953d][_0x7c34('0x27')];}}}_0x44dc34(_0x234da8);})[_0x7c34('0x2a')](function(_0x4497f3){_0x4daaf0(_0x4497f3[_0x7c34('0x2b')]);});});}function createEndUser(_0x3bc468,_0x114757,_0x146611,_0x13788c,_0x45d24a,_0xa46517,_0x2f321d){return new Promise(function(_0x136407,_0x23b97d){return getAuthToken(_0x114757,_0x146611,_0xa46517)[_0x7c34('0x17')](function(_0x4844a1){var _0x337b4c=_0xa46517[_0x7c34('0x2c')]()===_0x7c34('0x2d')?_0x45d24a['destcalleridnum']:_0x45d24a[_0x7c34('0x2e')];var _0x3b5a98={'method':_0x7c34('0x12'),'uri':_0x13788c+'contacts','body':{'fullname':_0x337b4c,'firstname':_0x337b4c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7c34('0x2f')+_0x3bc468[_0x7c34('0x28')]+')'},'headers':{'Authorization':_0x7c34('0x30')+_0x4844a1,'OData-Version':_0x7c34('0x31')},'json':!![],'resolveWithFullResponse':!![]};_0x3b5a98[_0x7c34('0x32')][_0x2f321d]=_0x337b4c;return rp(_0x3b5a98);})[_0x7c34('0x17')](function(_0x297061){var _0x440b79=_0x297061[_0x7c34('0x33')][_0x7c34('0x34')];var _0x8c9e46=_0x440b79['substring'](_0x440b79[_0x7c34('0x35')]('(')+0x1,_0x440b79['lastIndexOf'](')'));_0x3bc468[_0x7c34('0x36')]=_0x8c9e46;_0x136407(_0x3bc468);})[_0x7c34('0x2a')](function(_0x3afdc0){_0x23b97d(_0x3afdc0[_0x7c34('0x2b')]);});});}function getEndUser(_0x41e0ef,_0x5f0946,_0x26906b,_0x3fcf9d,_0x15d206,_0x30b2f5,_0x11e510,_0x140128){var _0x38de1d=_0x30b2f5[_0x7c34('0x2c')]()===_0x7c34('0x2d')?_0x15d206['destcalleridnum']:_0x15d206[_0x7c34('0x2e')];return getAuthToken(_0x5f0946,_0x26906b,_0x30b2f5)[_0x7c34('0x17')](function(_0x1477d6){_0x140128=_0x140128?_0x140128:_0x7c34('0x37');var _0x5cd9ab={'method':'GET','uri':_0x3fcf9d+_0x7c34('0x38')+_0x140128+_0x7c34('0x39')+_0x140128+_0x7c34('0x3a')+_0x38de1d[_0x7c34('0x3b')]('+',_0x7c34('0x3c'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1477d6,'If-None-Match':null,'OData-Version':_0x7c34('0x31')},'json':!![]};return rp(_0x5cd9ab);})['then'](function(_0x43f346){var _0x144fe9=![];if(!_0x43f346)return _0x144fe9;var _0x343154=_0x43f346[_0x7c34('0x1e')];for(var _0x4a3873=0x0;_0x4a3873<_0x343154[_0x7c34('0x22')];_0x4a3873++){if(_0x343154[_0x4a3873][_0x140128]===_0x38de1d){_0x144fe9=!![];_0x41e0ef[_0x7c34('0x36')]=_0x343154[_0x4a3873][_0x7c34('0x3d')];}}return _0x144fe9;})[_0x7c34('0x17')](function(_0x4c57a9){if(_0x4c57a9)return _0x41e0ef;if(_0x11e510===_0x7c34('0x3e')){logger[_0x7c34('0x25')]('['+[_0x30b2f5[_0x7c34('0x1a')]()]+_0x7c34('0x3f'));return _0x41e0ef;}return createEndUser(_0x41e0ef,_0x5f0946,_0x26906b,_0x3fcf9d,_0x15d206,_0x30b2f5,_0x140128)[_0x7c34('0x17')](function(_0x4c50a8){logger['info']('['+[_0x30b2f5[_0x7c34('0x1a')]()]+_0x7c34('0x40'),_0x4c50a8[_0x7c34('0x36')]);return _0x4c50a8;});});}function getCustomFields(_0x1adaec,_0x425e01,_0xdef2df){var _0x47ec2a={};if(_0x1adaec['length']>0x0){_[_0x7c34('0x41')](_0x1adaec,function(_0x16a930){if(_['includes']([_0x7c34('0x42'),_0x7c34('0x43')],_0x16a930['type'])&&_0x16a930[_0x7c34('0x44')]&&!_0x16a930[_0x7c34('0x45')]){var _0x57a007=_0x16a930[_0x7c34('0x46')][_0x7c34('0x2c')]();var _0x5c6fff=_0x57a007[_0x7c34('0x47')](0x0,_0x57a007[_0x7c34('0x48')]('_'));var _0x274934=_0x57a007[_0x7c34('0x47')](_0x57a007[_0x7c34('0x48')]('_')+0x1);if(_0x5c6fff===_0xdef2df){_0x47ec2a[_0x274934]=_0x16a930[_0x7c34('0x49')];}}});}return _0x47ec2a;}function getTicket(_0x4e532b,_0x596dfa,_0x1658ed,_0x831a8b,_0x3fb5ac,_0x442b69,_0x2e13ad){return new Promise(function(_0x2cbd1f,_0x43876f){var _0x35d067;return getAuthToken(_0x596dfa,_0x1658ed,_0x2e13ad)[_0x7c34('0x17')](function(_0x5a7bf0){if(_0x442b69['ticketType']==='incident'){_0x35d067={'method':_0x7c34('0x12'),'uri':_0x831a8b+'incidents','body':Object[_0x7c34('0x4a')]({},{'title':intUtil['getString'](_0x442b69[_0x7c34('0x4b')],_0x3fb5ac,'\x20'),'description':intUtil[_0x7c34('0x4c')](_0x442b69[_0x7c34('0x4d')],_0x3fb5ac,'\x0a'),'customerid_contact@odata.bind':_0x4e532b[_0x7c34('0x36')]?_0x7c34('0x4e')+_0x4e532b[_0x7c34('0x36')]+')':undefined,'ownerid@odata.bind':_0x7c34('0x2f')+_0x4e532b[_0x7c34('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x442b69[_0x7c34('0x4f')],_0x3fb5ac,_0x442b69[_0x7c34('0x50')])),'headers':{'Authorization':'Bearer\x20'+_0x5a7bf0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x442b69[_0x7c34('0x50')]===_0x7c34('0x51')){var _0x462c2c=_0x4e532b[_0x7c34('0x36')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4e532b['userId']+')','participationtypemask':_0x4e532b[_0x7c34('0x52')]===_0x7c34('0x53')?0x2:0x1},{'partyid_contact@odata.bind':_0x7c34('0x4e')+_0x4e532b[_0x7c34('0x36')]+')','participationtypemask':_0x4e532b[_0x7c34('0x52')]===_0x7c34('0x53')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x7c34('0x2f')+_0x4e532b[_0x7c34('0x28')]+')','participationtypemask':_0x4e532b[_0x7c34('0x52')]===_0x7c34('0x53')?0x2:0x1}];_0x35d067={'method':_0x7c34('0x12'),'uri':_0x831a8b+_0x7c34('0x54'),'body':Object[_0x7c34('0x4a')]({},{'subject':intUtil[_0x7c34('0x4c')](_0x442b69[_0x7c34('0x4b')],_0x3fb5ac,'\x20'),'phonenumber':String(_0x3fb5ac['calleridnum']),'description':intUtil[_0x7c34('0x4c')](_0x442b69['Descriptions'],_0x3fb5ac,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4e532b[_0x7c34('0x36')]?'/contacts('+_0x4e532b[_0x7c34('0x36')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4e532b[_0x7c34('0x28')]+')','directioncode':_0x4e532b[_0x7c34('0x52')]===_0x7c34('0x53')?![]:!![],'phonecall_activity_parties':_0x462c2c},getCustomFields(_0x442b69[_0x7c34('0x4f')],_0x3fb5ac,_0x442b69['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x5a7bf0,'OData-Version':_0x7c34('0x31')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x35d067);})[_0x7c34('0x17')](function(_0x5a1c56){var _0x8cb603=_0x5a1c56['headers'][_0x7c34('0x34')];var _0xa76582=_0x8cb603[_0x7c34('0x47')](_0x8cb603['lastIndexOf']('(')+0x1,_0x8cb603[_0x7c34('0x35')](')'));_0x4e532b[_0x7c34('0x55')]=_0xa76582;_0x2cbd1f(_0x4e532b);})[_0x7c34('0x2a')](function(_0x3f9845){_0x43876f(_0x3f9845[_0x7c34('0x2b')]);});});}function emit(_0x17b96d,_0x2a15ae,_0x4de245,_0x201842){var _0x3a67dc={'uri':util[_0x7c34('0x56')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x17b96d,_0x4de245,_0x201842)};io['to'](util[_0x7c34('0x56')](_0x7c34('0x57'),_0x2a15ae))[_0x7c34('0x58')](_0x7c34('0x59'),_0x3a67dc);}exports['cs']=function(_0x3d0241,_0x405f7b,_0x2277b0,_0x429798,_0x36b144,_0x5d866d,_0x240a92,_0x308602){var _0x13ebe4={};_0x5d866d['remoteUri']=_0x5d866d['modernAuthentication']?intUtil[_0x7c34('0x5a')](_0x5d866d[_0x7c34('0xc')][_0x7c34('0xd')]):intUtil[_0x7c34('0x5a')](_0x5d866d[_0x7c34('0xb')]);_0x5d866d['serverUrl']=intUtil[_0x7c34('0x5a')](_0x5d866d[_0x7c34('0x5b')]);_0x13ebe4[_0x7c34('0x52')]=_0x308602===_0x7c34('0x53')||_0x308602==='unmanaged'?_0x7c34('0x53'):_0x7c34('0x2d');var _0x4dc14d=_0x5d866d['modernAuthentication']?util['format'](_0x7c34('0x5c'),_0x5d866d[_0x7c34('0xc')][_0x7c34('0xd')]):util[_0x7c34('0x56')](_0x7c34('0x5c'),_0x5d866d[_0x7c34('0xb')]);var _0xfa16fb=util['format'](_0x7c34('0x5d'),_0x5d866d[_0x7c34('0xe')]);var _0x4673b0=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d866d[_0x7c34('0x5b')],_0x405f7b['uniqueid'],md5(_0x405f7b[_0x7c34('0x5e')]));if(_0x36b144&&_0x36b144[_0x7c34('0x5f')]){logger[_0x7c34('0x25')](_0x7c34('0x60'),_0x7c34('0x61'));_0x405f7b['recordingURL']=_0x4673b0;}else if(_0x240a92&&_0x240a92[_0x7c34('0x62')]&&_0x240a92['recordingFormat']!==_0x7c34('0x63')){logger[_0x7c34('0x25')]('[OUTBOUND]',_0x7c34('0x61'));_0x405f7b['recordingURL']=_0x4673b0;}else{_0x405f7b[_0x7c34('0x64')]='';}return getUser(_0x13ebe4,_0x5d866d,_0x429798,_0xfa16fb,_0x4dc14d,_0x308602)[_0x7c34('0x17')](function(_0x1099ab){logger[_0x7c34('0x25')]('['+_0x308602[_0x7c34('0x1a')]()+']\x20The\x20User\x20ID\x20is:',_0x1099ab['userId']);logger['info']('['+_0x308602[_0x7c34('0x1a')]()+_0x7c34('0x65'),_0x1099ab[_0x7c34('0x21')]);return getEndUser(_0x1099ab,_0x5d866d,_0xfa16fb,_0x4dc14d,_0x405f7b,_0x308602,_0x2277b0[_0x7c34('0x66')],_0x2277b0[_0x7c34('0x67')]);})[_0x7c34('0x17')](function(_0x18b11c){logger['info']('['+_0x308602['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x18b11c[_0x7c34('0x36')]);logger[_0x7c34('0x25')]('['+_0x308602[_0x7c34('0x1a')]()+_0x7c34('0x68'),_0x405f7b[_0x7c34('0x2e')]);return getTicket(_0x18b11c,_0x5d866d,_0xfa16fb,_0x4dc14d,_0x405f7b,_0x2277b0,_0x308602);})[_0x7c34('0x17')](function(_0x542559){logger[_0x7c34('0x25')](util[_0x7c34('0x56')]('['+_0x308602[_0x7c34('0x1a')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2277b0[_0x7c34('0x50')],_0x542559[_0x7c34('0x55')]));logger['info'](util['format']('['+_0x308602[_0x7c34('0x1a')]()+_0x7c34('0x69'),_0x308602));if(_0x308602!==_0x7c34('0x6a')&&_0x2277b0['openNewTab']){logger[_0x7c34('0x25')]('['+_0x308602[_0x7c34('0x1a')]()+']',_0x7c34('0x6b'));emit(_0x5d866d[_0x7c34('0xb')],_0x429798[_0x7c34('0x6c')],_0x2277b0[_0x7c34('0x50')],_0x542559[_0x7c34('0x55')]);}})[_0x7c34('0x2a')](function(_0x1457e4){logger[_0x7c34('0x19')]('['+_0x308602[_0x7c34('0x1a')]()+_0x7c34('0x6d'),_0x1457e4[_0x7c34('0x2b')]);console[_0x7c34('0x19')]('Error\x20running\x20Dynamics365\x20integration',_0x1457e4);});}; \ No newline at end of file +var _0x95d1=['trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','resolve','data5','POST','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','contacts?$select=','\x20eq\x20\x27','%2b',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','phonecall','queue','callDirection','phonecalls','Descriptions','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit'];(function(_0xec15d9,_0x53d85a){var _0x5875af=function(_0x53e5bc){while(--_0x53e5bc){_0xec15d9['push'](_0xec15d9['shift']());}};_0x5875af(++_0x53d85a);}(_0x95d1,0x84));var _0x195d=function(_0x5dede9,_0x251e16){_0x5dede9=_0x5dede9-0x0;var _0x1a3d15=_0x95d1[_0x5dede9];return _0x1a3d15;};'use strict';var _=require('lodash');var rp=require(_0x195d('0x0'));var util=require(_0x195d('0x1'));var intUtil=require('./util');var md5=require(_0x195d('0x2'));var Redis=require(_0x195d('0x3'));var logger=require(_0x195d('0x4'))(_0x195d('0x5'));var config=require('../../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x195d('0x6'),'port':0x18eb});var io=require(_0x195d('0x7'))(new Redis(config['redis']));function getAuthToken(_0x34a091,_0x19ac4d,_0x4be2a4){if(_0x34a091[_0x195d('0x8')]){_0x34a091['remoteUri']=_0x34a091[_0x195d('0x9')][_0x195d('0xa')];_0x34a091[_0x195d('0xb')]=_0x34a091['CloudProvider']['data2'];return Promise[_0x195d('0xc')](_0x34a091[_0x195d('0x9')][_0x195d('0xd')]);}var _0x20b3fc={'method':_0x195d('0xe'),'uri':_0x19ac4d,'form':{'client_id':_0x34a091['clientId'],'resource':_0x34a091[_0x195d('0xf')],'username':_0x34a091[_0x195d('0x10')],'password':_0x34a091[_0x195d('0x11')],'grant_type':'password','client_secret':_0x34a091[_0x195d('0x12')]},'json':!![]};return rp(_0x20b3fc)[_0x195d('0x13')](function(_0x558516){return _0x558516[_0x195d('0x14')];})[_0x195d('0x15')](function(_0x28a83){logger['error']('['+[_0x4be2a4[_0x195d('0x16')]()]+_0x195d('0x17'));return _0x28a83[_0x195d('0x18')];});}function getUser(_0x40f3f7,_0x3b5bbf,_0x5343b7,_0x1b9b16,_0x40a439,_0x215f1a){return new Promise(function(_0x3b5aab,_0x439aa7){return getAuthToken(_0x3b5bbf,_0x1b9b16,_0x215f1a)[_0x195d('0x13')](function(_0x2cc0bd){var _0x5518dd={'method':_0x195d('0x19'),'uri':_0x40a439+_0x195d('0x1a'),'headers':{'Authorization':_0x195d('0x1b')+_0x2cc0bd,'OData-Version':_0x195d('0x1c')},'json':!![]};return rp(_0x5518dd);})['then'](function(_0x7735a0){var _0x34e0f8=_0x7735a0[_0x195d('0x1d')];var _0xce787d=![];var _0x464cf9=null;if(!_[_0x195d('0x1e')](_0x5343b7)){if(intUtil[_0x195d('0x1f')](_0x5343b7[_0x195d('0x20')])){_0x40f3f7[_0x195d('0x21')]=_0x5343b7[_0x195d('0x20')];for(_0x464cf9=0x0;_0x464cf9<_0x34e0f8[_0x195d('0x22')];_0x464cf9++){if(_0x34e0f8[_0x464cf9][_0x195d('0x23')]===_0x5343b7['email']&&!_0x34e0f8[_0x464cf9]['isdisabled']){_0xce787d=!![];logger[_0x195d('0x24')]('['+[_0x215f1a[_0x195d('0x16')]()]+_0x195d('0x25')+_0x34e0f8[_0x464cf9][_0x195d('0x26')]+'!');_0x40f3f7[_0x195d('0x27')]=_0x34e0f8[_0x464cf9][_0x195d('0x26')];}}}}if(!_0xce787d){logger[_0x195d('0x24')]('['+[_0x215f1a[_0x195d('0x16')]()]+_0x195d('0x28'));_0x40f3f7['userEmail']=_0x3b5bbf[_0x195d('0x10')];for(_0x464cf9=0x0;_0x464cf9<_0x34e0f8[_0x195d('0x22')];_0x464cf9++){if(_0x34e0f8[_0x464cf9][_0x195d('0x23')]===_0x3b5bbf[_0x195d('0x10')]){_0x40f3f7[_0x195d('0x27')]=_0x34e0f8[_0x464cf9][_0x195d('0x26')];}}}_0x3b5aab(_0x40f3f7);})[_0x195d('0x15')](function(_0x5d1393){_0x439aa7(_0x5d1393[_0x195d('0x18')]);});});}function createEndUser(_0x46af0a,_0x3587e9,_0xa9a37f,_0x220d80,_0x5c45e4,_0x41f4a6,_0x1a1021){return new Promise(function(_0x49b6fe,_0x1f8c90){return getAuthToken(_0x3587e9,_0xa9a37f,_0x41f4a6)[_0x195d('0x13')](function(_0x35ded0){var _0xa697c9=_0x41f4a6['toLowerCase']()===_0x195d('0x29')?_0x5c45e4[_0x195d('0x2a')]:_0x5c45e4[_0x195d('0x2b')];var _0x412892={'method':'POST','uri':_0x220d80+_0x195d('0x2c'),'body':{'fullname':_0xa697c9,'firstname':_0xa697c9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x195d('0x2d')+_0x46af0a[_0x195d('0x27')]+')'},'headers':{'Authorization':_0x195d('0x1b')+_0x35ded0,'OData-Version':_0x195d('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x412892[_0x195d('0x2e')][_0x1a1021]=_0xa697c9;return rp(_0x412892);})[_0x195d('0x13')](function(_0x3229b7){var _0x114e41=_0x3229b7[_0x195d('0x2f')][_0x195d('0x30')];var _0x44c4b=_0x114e41[_0x195d('0x31')](_0x114e41[_0x195d('0x32')]('(')+0x1,_0x114e41[_0x195d('0x32')](')'));_0x46af0a[_0x195d('0x33')]=_0x44c4b;_0x49b6fe(_0x46af0a);})[_0x195d('0x15')](function(_0x1eecb1){_0x1f8c90(_0x1eecb1[_0x195d('0x18')]);});});}function getEndUser(_0x2009d4,_0x268691,_0x7d365a,_0x4f5200,_0x4778ca,_0x1b5e28,_0x3e1b01,_0x4ad281){var _0x5266e5=_0x1b5e28[_0x195d('0x34')]()===_0x195d('0x29')?_0x4778ca[_0x195d('0x2a')]:_0x4778ca[_0x195d('0x2b')];return getAuthToken(_0x268691,_0x7d365a,_0x1b5e28)['then'](function(_0x2e96ed){_0x4ad281=_0x4ad281?_0x4ad281:_0x195d('0x35');var _0x2bdfd6={'method':_0x195d('0x19'),'uri':_0x4f5200+_0x195d('0x36')+_0x4ad281+'&$filter='+_0x4ad281+_0x195d('0x37')+_0x5266e5['replace']('+',_0x195d('0x38'))+'\x27','headers':{'Authorization':_0x195d('0x1b')+_0x2e96ed,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2bdfd6);})['then'](function(_0x2cf4c9){var _0x3838c4=![];if(!_0x2cf4c9)return _0x3838c4;var _0x27a5bf=_0x2cf4c9['value'];for(var _0x1b53eb=0x0;_0x1b53eb<_0x27a5bf[_0x195d('0x22')];_0x1b53eb++){if(_0x27a5bf[_0x1b53eb][_0x4ad281]===_0x5266e5){_0x3838c4=!![];_0x2009d4[_0x195d('0x33')]=_0x27a5bf[_0x1b53eb]['contactid'];}}return _0x3838c4;})['then'](function(_0x21a8fb){if(_0x21a8fb)return _0x2009d4;if(_0x3e1b01==='nothing'){logger[_0x195d('0x24')]('['+[_0x1b5e28[_0x195d('0x16')]()]+_0x195d('0x39'));return _0x2009d4;}return createEndUser(_0x2009d4,_0x268691,_0x7d365a,_0x4f5200,_0x4778ca,_0x1b5e28,_0x4ad281)[_0x195d('0x13')](function(_0x8c807a){logger[_0x195d('0x24')]('['+[_0x1b5e28[_0x195d('0x16')]()]+_0x195d('0x3a'),_0x8c807a['enduserId']);return _0x8c807a;});});}function getCustomFields(_0x4ebed0,_0xaf875b,_0x4bb1ef){var _0x597bdf={};if(_0x4ebed0[_0x195d('0x22')]>0x0){_[_0x195d('0x3b')](_0x4ebed0,function(_0x1436b2){if(_[_0x195d('0x3c')](['string',_0x195d('0x3d')],_0x1436b2[_0x195d('0x3e')])&&_0x1436b2[_0x195d('0x3f')]&&!_0x1436b2[_0x195d('0x40')]){var _0x44fbc0=_0x1436b2['idField']['toLowerCase']();var _0x56997a=_0x44fbc0['substring'](0x0,_0x44fbc0[_0x195d('0x41')]('_'));var _0x56b145=_0x44fbc0[_0x195d('0x31')](_0x44fbc0[_0x195d('0x41')]('_')+0x1);if(_0x56997a===_0x4bb1ef){_0x597bdf[_0x56b145]=_0x1436b2[_0x195d('0x42')];}}});}return _0x597bdf;}function getTicket(_0x2eca8e,_0xf3216f,_0x550d3e,_0x28dc08,_0x2d83ad,_0x4c462a,_0x4491e3){return new Promise(function(_0x19f686,_0x3a5c17){var _0x260caf;return getAuthToken(_0xf3216f,_0x550d3e,_0x4491e3)[_0x195d('0x13')](function(_0x2d7d78){if(_0x4c462a[_0x195d('0x43')]===_0x195d('0x44')){_0x260caf={'method':_0x195d('0xe'),'uri':_0x28dc08+_0x195d('0x45'),'body':Object[_0x195d('0x46')]({},{'title':intUtil[_0x195d('0x47')](_0x4c462a[_0x195d('0x48')],_0x2d83ad,'\x20'),'description':intUtil[_0x195d('0x47')](_0x4c462a['Descriptions'],_0x2d83ad,'\x0a'),'customerid_contact@odata.bind':_0x2eca8e['enduserId']?_0x195d('0x49')+_0x2eca8e[_0x195d('0x33')]+')':undefined,'ownerid@odata.bind':_0x195d('0x2d')+_0x2eca8e[_0x195d('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x4c462a['Fields'],_0x2d83ad,_0x4c462a[_0x195d('0x43')])),'headers':{'Authorization':_0x195d('0x1b')+_0x2d7d78,'OData-Version':_0x195d('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4c462a[_0x195d('0x43')]===_0x195d('0x4a')){var _0x3d8f57=_0x2eca8e[_0x195d('0x33')]?[{'partyid_systemuser@odata.bind':_0x195d('0x2d')+_0x2eca8e[_0x195d('0x27')]+')','participationtypemask':_0x2eca8e['callDirection']===_0x195d('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x195d('0x49')+_0x2eca8e['enduserId']+')','participationtypemask':_0x2eca8e['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x195d('0x2d')+_0x2eca8e[_0x195d('0x27')]+')','participationtypemask':_0x2eca8e[_0x195d('0x4c')]===_0x195d('0x4b')?0x2:0x1}];_0x260caf={'method':_0x195d('0xe'),'uri':_0x28dc08+_0x195d('0x4d'),'body':Object[_0x195d('0x46')]({},{'subject':intUtil[_0x195d('0x47')](_0x4c462a[_0x195d('0x48')],_0x2d83ad,'\x20'),'phonenumber':String(_0x2d83ad[_0x195d('0x2b')]),'description':intUtil[_0x195d('0x47')](_0x4c462a[_0x195d('0x4e')],_0x2d83ad,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2eca8e['enduserId']?'/contacts('+_0x2eca8e[_0x195d('0x33')]+')':undefined,'ownerid@odata.bind':_0x195d('0x2d')+_0x2eca8e[_0x195d('0x27')]+')','directioncode':_0x2eca8e[_0x195d('0x4c')]===_0x195d('0x4b')?![]:!![],'phonecall_activity_parties':_0x3d8f57},getCustomFields(_0x4c462a[_0x195d('0x4f')],_0x2d83ad,_0x4c462a[_0x195d('0x43')])),'headers':{'Authorization':_0x195d('0x1b')+_0x2d7d78,'OData-Version':_0x195d('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x260caf);})[_0x195d('0x13')](function(_0x45f306){var _0x439548=_0x45f306[_0x195d('0x2f')][_0x195d('0x30')];var _0x3b66eb=_0x439548['substring'](_0x439548[_0x195d('0x32')]('(')+0x1,_0x439548[_0x195d('0x32')](')'));_0x2eca8e[_0x195d('0x50')]=_0x3b66eb;_0x19f686(_0x2eca8e);})['catch'](function(_0x10c116){_0x3a5c17(_0x10c116[_0x195d('0x18')]);});});}function emit(_0x4272af,_0x3f2657,_0xdfde22,_0x3acb24){var _0x123c84={'uri':util[_0x195d('0x51')](_0x195d('0x52'),_0x4272af,_0xdfde22,_0x3acb24)};io['to'](util[_0x195d('0x51')]('user:%s',_0x3f2657))[_0x195d('0x53')](_0x195d('0x54'),_0x123c84);}exports['cs']=function(_0x334ec4,_0x7acc5e,_0x1bc6dc,_0x2da4d1,_0x49b685,_0x2f6f5f,_0x3f3b89,_0xe661a9){var _0x4de7f8={};_0x2f6f5f['remoteUri']=_0x2f6f5f[_0x195d('0x8')]?intUtil[_0x195d('0x55')](_0x2f6f5f['CloudProvider'][_0x195d('0xa')]):intUtil['stripTrailingSlash'](_0x2f6f5f[_0x195d('0xf')]);_0x2f6f5f[_0x195d('0x56')]=intUtil[_0x195d('0x55')](_0x2f6f5f[_0x195d('0x56')]);_0x4de7f8[_0x195d('0x4c')]=_0xe661a9===_0x195d('0x4b')||_0xe661a9==='unmanaged'?_0x195d('0x4b'):_0x195d('0x29');var _0x279bb6=_0x2f6f5f[_0x195d('0x8')]?util[_0x195d('0x51')]('%s/api/data/v9.0/',_0x2f6f5f[_0x195d('0x9')][_0x195d('0xa')]):util[_0x195d('0x51')]('%s/api/data/v9.0/',_0x2f6f5f['remoteUri']);var _0x336e0e=util[_0x195d('0x51')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2f6f5f['tenantId']);var _0x5dadfe=util[_0x195d('0x51')](_0x195d('0x57'),_0x2f6f5f['serverUrl'],_0x7acc5e[_0x195d('0x58')],md5(_0x7acc5e[_0x195d('0x58')]));if(_0x49b685&&_0x49b685[_0x195d('0x59')]){logger[_0x195d('0x24')](_0x195d('0x5a'),_0x195d('0x5b'));_0x7acc5e[_0x195d('0x5c')]=_0x5dadfe;}else if(_0x3f3b89&&_0x3f3b89[_0x195d('0x5d')]&&_0x3f3b89[_0x195d('0x5d')]!==_0x195d('0x5e')){logger[_0x195d('0x24')](_0x195d('0x5f'),_0x195d('0x5b'));_0x7acc5e[_0x195d('0x5c')]=_0x5dadfe;}else{_0x7acc5e['recordingURL']='';}return getUser(_0x4de7f8,_0x2f6f5f,_0x2da4d1,_0x336e0e,_0x279bb6,_0xe661a9)[_0x195d('0x13')](function(_0x315d2a){logger['info']('['+_0xe661a9[_0x195d('0x16')]()+_0x195d('0x60'),_0x315d2a[_0x195d('0x27')]);logger[_0x195d('0x24')]('['+_0xe661a9['toUpperCase']()+_0x195d('0x61'),_0x315d2a['userEmail']);return getEndUser(_0x315d2a,_0x2f6f5f,_0x336e0e,_0x279bb6,_0x7acc5e,_0xe661a9,_0x1bc6dc[_0x195d('0x62')],_0x1bc6dc[_0x195d('0x63')]);})[_0x195d('0x13')](function(_0x406b6f){logger['info']('['+_0xe661a9[_0x195d('0x16')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x406b6f[_0x195d('0x33')]);logger[_0x195d('0x24')]('['+_0xe661a9[_0x195d('0x16')]()+_0x195d('0x64'),_0x7acc5e[_0x195d('0x2b')]);return getTicket(_0x406b6f,_0x2f6f5f,_0x336e0e,_0x279bb6,_0x7acc5e,_0x1bc6dc,_0xe661a9);})['then'](function(_0x143069){logger['info'](util[_0x195d('0x51')]('['+_0xe661a9['toUpperCase']()+_0x195d('0x65'),_0x1bc6dc[_0x195d('0x43')],_0x143069[_0x195d('0x50')]));logger[_0x195d('0x24')](util[_0x195d('0x51')]('['+_0xe661a9[_0x195d('0x16')]()+_0x195d('0x66'),_0xe661a9));if(_0xe661a9!==_0x195d('0x67')&&_0x1bc6dc[_0x195d('0x68')]){logger[_0x195d('0x24')]('['+_0xe661a9['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2f6f5f[_0x195d('0xf')],_0x2da4d1['name'],_0x1bc6dc[_0x195d('0x43')],_0x143069[_0x195d('0x50')]);}})[_0x195d('0x15')](function(_0x2f55d1){logger[_0x195d('0x69')]('['+_0xe661a9[_0x195d('0x16')]()+_0x195d('0x6a'),_0x2f55d1[_0x195d('0x18')]);console[_0x195d('0x69')](_0x195d('0x6b'),_0x2f55d1);});}; \ 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 cf0a8b3..90ed74a 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 _0xb0e4=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','The\x20Ticket\x20ID\x20is:','user:%s','stringify','monitor_format','lastevent','toUpperCase','request-promise','md5','util','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','name','Fields','custom_fields','value','POST','then','info','%s/api/v2/agents','remoteUri','length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','push','idField','variable','variableName','Variable','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','[QUEUE]'];(function(_0x5d6f0e,_0x28d536){var _0x1810e7=function(_0x52ced3){while(--_0x52ced3){_0x5d6f0e['push'](_0x5d6f0e['shift']());}};_0x1810e7(++_0x28d536);}(_0xb0e4,0x1c8));var _0x4b0e=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb0e4[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var rp=require(_0x4b0e('0x0'));var md5=require(_0x4b0e('0x1'));var util=require(_0x4b0e('0x2'));var Redis=require('ioredis');var intUtil=require(_0x4b0e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x4b0e('0x4'))(_0x4b0e('0x5'));config[_0x4b0e('0x6')]=_[_0x4b0e('0x7')](config[_0x4b0e('0x6')],{'host':_0x4b0e('0x8'),'port':0x18eb});var io=require(_0x4b0e('0x9'))(new Redis(config[_0x4b0e('0x6')]));var headers={'Content-Type':_0x4b0e('0xa'),'Accept':_0x4b0e('0xa')};function emit(_0x41521a,_0x51727a,_0x1d4385){io['to'](_0x41521a)[_0x4b0e('0xb')](_0x51727a,_0x1d4385);}function getTicket(_0x3a6efd,_0x5e0ead,_0x272e51,_0xfb046b,_0x5c6852){logger['info'](_0x4b0e('0xc'));var _0x1e7a25=_[_0x4b0e('0xd')]({'responder_id':_0x5e0ead['id'],'requester_id':_0x272e51['id'],'name':util[_0x4b0e('0xe')](_0x4b0e('0xf'),_0x5c6852[_0x4b0e('0x10')]),'phone':_0x5c6852[_0x4b0e('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xfb046b[_0x4b0e('0x12')],_0x5c6852,'\x20'),'description':intUtil[_0x4b0e('0x13')](_0xfb046b[_0x4b0e('0x14')],_0x5c6852,'
'),'tags':getTags(_0xfb046b['Tags'],_0x4b0e('0x15'))},getCustomFields(_0xfb046b[_0x4b0e('0x16')],_0x5c6852));_0x1e7a25['custom_fields']=_['mapValues'](_['keyBy'](_0x1e7a25[_0x4b0e('0x17')],'id'),_0x4b0e('0x18'));return request({'uri':util[_0x4b0e('0xe')]('%s/api/v2/tickets',_0x3a6efd['remoteUri']),'method':_0x4b0e('0x19'),'body':_0x1e7a25})[_0x4b0e('0x1a')](function(_0x223155){logger[_0x4b0e('0x1b')]('Ticket\x20created!');return _0x223155;});}function getUser(_0x4b6761,_0x139643){if(intUtil['validateEmail'](_0x139643)){return request({'uri':util[_0x4b0e('0xe')](_0x4b0e('0x1c'),_0x4b6761[_0x4b0e('0x1d')]),'qs':{'email':_0x139643}})['then'](function(_0x5027eb){if(_0x5027eb[_0x4b0e('0x1e')]){logger[_0x4b0e('0x1b')]('Agent\x20found!');return _['find'](_0x5027eb,function(_0x1eb2d0){return _0x1eb2d0[_0x4b0e('0x1f')][_0x4b0e('0x20')]===_0x139643;});}else{logger[_0x4b0e('0x1b')](_0x4b0e('0x21'));return request({'uri':util[_0x4b0e('0xe')]('%s/api/v2/agents/me',_0x4b6761[_0x4b0e('0x1d')])})[_0x4b0e('0x1a')](function(_0x511788){logger['info']('Admin\x20account\x20selected.');return _0x511788;});}});}else{logger[_0x4b0e('0x1b')](_0x4b0e('0x22'));return request({'uri':util[_0x4b0e('0xe')](_0x4b0e('0x23'),_0x4b6761['remoteUri'])})[_0x4b0e('0x1a')](function(_0x43ad98){logger[_0x4b0e('0x1b')](_0x4b0e('0x24'));return _0x43ad98;});}}function getEndUser(_0x51d459,_0x40d974,_0x27d525){logger[_0x4b0e('0x1b')](_0x4b0e('0x25'),_0x27d525);return request({'uri':util[_0x4b0e('0xe')](_0x4b0e('0x26'),_0x51d459[_0x4b0e('0x1d')]),'qs':{'phone':_0x27d525}})[_0x4b0e('0x1a')](function(_0x30027a){if(_0x30027a['length']){logger[_0x4b0e('0x1b')]('Enduser\x20found!');return _[_0x4b0e('0x27')](_0x30027a,{'phone':_0x27d525});}else{logger[_0x4b0e('0x1b')](_0x4b0e('0x28'));return request({'uri':util['format']('%s/api/v2/contacts',_0x51d459[_0x4b0e('0x1d')]),'method':'POST','body':{'name':_0x40d974,'phone':_0x27d525}})[_0x4b0e('0x1a')](function(_0x53b2c1){logger['info'](_0x4b0e('0x29'));return _0x53b2c1;});}});}function getAuth(_0x35f38e){return util['format'](_0x4b0e('0x2a'),new Buffer(_0x35f38e[_0x4b0e('0x2b')]+':X')[_0x4b0e('0x2c')](_0x4b0e('0x2d')));}function request(_0x46a348){logger[_0x4b0e('0x2e')]('[HTTP]',JSON['stringify'](_0x46a348));return rp(_['defaults'](_0x46a348,{'method':_0x4b0e('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x14d573,_0x44e2a2){var _0x5d12be=[];if(_0x14d573&&_0x14d573[_0x4b0e('0x1e')]>0x0){_0x5d12be=_['map'](_0x14d573,_0x44e2a2);}return _0x5d12be;}function getCustomFields(_0x242b47,_0x275c26){var _0x2ebe9f=[];var _0x18e748={'custom_fields':[]};if(_0x242b47['length']>0x0){_[_0x4b0e('0x30')](_0x242b47,function(_0x4a340f){if(_[_0x4b0e('0x31')]([_0x4b0e('0x32'),_0x4b0e('0x33')],_0x4a340f[_0x4b0e('0x34')])&&_0x4a340f[_0x4b0e('0x35')]&&!_0x4a340f[_0x4b0e('0x36')]){_0x18e748[_0x4a340f[_0x4b0e('0x35')][_0x4b0e('0x37')]()]=_0x4a340f[_0x4b0e('0x38')][_0x4b0e('0x2c')]();}else if(_[_0x4b0e('0x31')]([_0x4b0e('0x32'),_0x4b0e('0x33')],_0x4a340f[_0x4b0e('0x34')])&&_0x4a340f['idField']&&_0x4a340f[_0x4b0e('0x36')]){_0x18e748[_0x4b0e('0x17')][_0x4b0e('0x39')]({'id':_0x4a340f[_0x4b0e('0x3a')],'value':_0x4a340f[_0x4b0e('0x38')][_0x4b0e('0x2c')]()});}else if(_0x4a340f[_0x4b0e('0x34')]===_0x4b0e('0x3b')&&_0x4a340f[_0x4b0e('0x3c')]&&_0x4a340f['idField']&&_0x4a340f[_0x4b0e('0x36')]){_0x275c26[_0x4a340f['variableName']]&&_0x18e748[_0x4b0e('0x17')][_0x4b0e('0x39')]({'id':_0x4a340f[_0x4b0e('0x3a')],'value':_0x275c26[_0x4a340f['variableName']][_0x4b0e('0x2c')]()});}else if(_0x4a340f[_0x4b0e('0x34')]==='customVariable'&&_0x4a340f['Variable']&&_0x4a340f[_0x4b0e('0x3d')][_0x4b0e('0x15')]&&_0x4a340f[_0x4b0e('0x3a')]&&_0x4a340f['customField']){_0x275c26[_0x4a340f[_0x4b0e('0x3d')]['name'][_0x4b0e('0x37')]()]&&_0x18e748['custom_fields']['push']({'id':_0x4a340f[_0x4b0e('0x3a')],'value':_0x275c26[_0x4a340f['Variable'][_0x4b0e('0x15')][_0x4b0e('0x37')]()]['toString']()});}});}return _0x18e748;}exports['queue']=function(_0x2a71bb,_0x12fa6f,_0x1e2cbd,_0x25f259,_0xe7f0b4,_0x5bdbd9){var _0x2d45b3,_0x4131b4;_0x5bdbd9[_0x4b0e('0x1d')]=intUtil['stripTrailingSlash'](_0x5bdbd9[_0x4b0e('0x1d')]);_0x5bdbd9[_0x4b0e('0x3e')]=intUtil[_0x4b0e('0x3f')](_0x5bdbd9[_0x4b0e('0x3e')]);if(_0xe7f0b4&&_0xe7f0b4['monitor_format']){logger[_0x4b0e('0x1b')]('[QUEUE]',_0x4b0e('0x40'));_0x12fa6f[_0x4b0e('0x41')]=util[_0x4b0e('0xe')](_0x4b0e('0x42'),_0x5bdbd9[_0x4b0e('0x3e')],_0x12fa6f[_0x4b0e('0x43')],md5(_0x12fa6f[_0x4b0e('0x43')]));}else{_0x12fa6f[_0x4b0e('0x41')]='';}headers[_0x4b0e('0x44')]=getAuth(_0x5bdbd9);return getUser(_0x5bdbd9,_0x25f259[_0x4b0e('0x20')])[_0x4b0e('0x1a')](function(_0x1fae03){_0x2d45b3=_0x1fae03;logger[_0x4b0e('0x1b')]('The\x20User\x20ID\x20is:',_0x2d45b3['id']);return getEndUser(_0x5bdbd9,_0x12fa6f[_0x4b0e('0x10')],_0x12fa6f[_0x4b0e('0x11')]);})[_0x4b0e('0x1a')](function(_0x1f16e2){_0x4131b4=_0x1f16e2;logger[_0x4b0e('0x1b')](_0x4b0e('0x45'),_0x4131b4['id']);return getTicket(_0x5bdbd9,_0x2d45b3,_0x4131b4,_0x1e2cbd,_0x12fa6f);})[_0x4b0e('0x1a')](function(_0x572030){if(_0x572030&&_0x572030['id']){logger[_0x4b0e('0x1b')](_0x4b0e('0x46'));logger[_0x4b0e('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x572030['id']);logger[_0x4b0e('0x1b')](_0x4b0e('0x47'),_0x4b0e('0x48'));emit(util[_0x4b0e('0xe')]('user:%s',_0x25f259[_0x4b0e('0x15')]),_0x4b0e('0x49'),{'uri':util[_0x4b0e('0xe')](_0x4b0e('0x4a'),_0x5bdbd9[_0x4b0e('0x1d')],_0x572030['id'])});}})[_0x4b0e('0x4b')](function(_0x1798ab){logger[_0x4b0e('0x4c')](_0x4b0e('0x47'),JSON['stringify'](_0x1798ab));});};exports['outbound']=function(_0x31407d,_0x5e3fc6,_0xc28320,_0x1766cd,_0x3fb29d,_0x2ca0f3,_0x209795){var _0x3562ce,_0x238ba9;_0x2ca0f3[_0x4b0e('0x1d')]=intUtil[_0x4b0e('0x3f')](_0x2ca0f3[_0x4b0e('0x1d')]);_0x2ca0f3[_0x4b0e('0x3e')]=intUtil[_0x4b0e('0x3f')](_0x2ca0f3[_0x4b0e('0x3e')]);if(_0x209795&&_0x209795[_0x4b0e('0x4d')]&&_0x209795[_0x4b0e('0x4d')]!==_0x4b0e('0x4e')){logger[_0x4b0e('0x1b')](_0x4b0e('0x4f'),_0x4b0e('0x40'));_0x5e3fc6[_0x4b0e('0x41')]=util[_0x4b0e('0xe')](_0x4b0e('0x42'),_0x2ca0f3[_0x4b0e('0x3e')],_0x5e3fc6['uniqueid'],md5(_0x5e3fc6[_0x4b0e('0x43')]));}headers[_0x4b0e('0x44')]=getAuth(_0x2ca0f3);return getUser(_0x2ca0f3,_0x1766cd[_0x4b0e('0x20')])[_0x4b0e('0x1a')](function(_0x1abaf6){_0x3562ce=_0x1abaf6;logger[_0x4b0e('0x1b')](_0x4b0e('0x50'),_0x3562ce['id']);return getEndUser(_0x2ca0f3,_0x5e3fc6[_0x4b0e('0x51')],_0x5e3fc6['destcalleridnum']);})[_0x4b0e('0x1a')](function(_0x4420b4){_0x238ba9=_0x4420b4;logger[_0x4b0e('0x1b')](_0x4b0e('0x45'),_0x238ba9['id']);return getTicket(_0x2ca0f3,_0x3562ce,_0x238ba9,_0xc28320,_0x5e3fc6);})[_0x4b0e('0x1a')](function(_0x1bf7f8){if(_0x1bf7f8&&_0x1bf7f8['id']){logger[_0x4b0e('0x1b')]('Ticket\x20created!');logger[_0x4b0e('0x1b')](_0x4b0e('0x52'),_0x1bf7f8['id']);logger[_0x4b0e('0x1b')](_0x4b0e('0x4f'),_0x4b0e('0x48'));emit(util[_0x4b0e('0xe')](_0x4b0e('0x53'),_0x1766cd['name']),_0x4b0e('0x49'),{'uri':util[_0x4b0e('0xe')]('%s/helpdesk/tickets/%d',_0x2ca0f3['remoteUri'],_0x1bf7f8['id'])});}})['catch'](function(_0x2156d8){logger[_0x4b0e('0x4c')](_0x4b0e('0x4f'),JSON[_0x4b0e('0x54')](_0x2156d8));});};exports['unmanaged']=function(_0x57a889,_0x471603,_0x1d76c2,_0x2747e4,_0x2b2417,_0x1c3a13){var _0x36ec0e,_0x35e14f;_0x1c3a13[_0x4b0e('0x1d')]=intUtil[_0x4b0e('0x3f')](_0x1c3a13[_0x4b0e('0x1d')]);_0x1c3a13[_0x4b0e('0x3e')]=intUtil[_0x4b0e('0x3f')](_0x1c3a13[_0x4b0e('0x3e')]);if(_0x2b2417&&_0x2b2417[_0x4b0e('0x55')]){logger[_0x4b0e('0x1b')]('['+_0x471603[_0x4b0e('0x56')][_0x4b0e('0x57')]()+']',_0x4b0e('0x40'));_0x471603['recordingURL']=util[_0x4b0e('0xe')](_0x4b0e('0x42'),_0x1c3a13[_0x4b0e('0x3e')],_0x471603[_0x4b0e('0x43')],md5(_0x471603['uniqueid']));}else{_0x471603[_0x4b0e('0x41')]='';}headers[_0x4b0e('0x44')]=getAuth(_0x1c3a13);return getUser(_0x1c3a13,'')[_0x4b0e('0x1a')](function(_0x13131b){_0x36ec0e=_0x13131b;logger[_0x4b0e('0x1b')](_0x4b0e('0x50'),_0x36ec0e['id']);return getEndUser(_0x1c3a13,_0x471603[_0x4b0e('0x10')],_0x471603[_0x4b0e('0x11')]);})[_0x4b0e('0x1a')](function(_0x16a5cd){_0x35e14f=_0x16a5cd;logger[_0x4b0e('0x1b')](_0x4b0e('0x45'),_0x35e14f['id']);return getTicket(_0x1c3a13,_0x36ec0e,_0x35e14f,_0x1d76c2,_0x471603);})[_0x4b0e('0x1a')](function(_0x676d62){if(_0x676d62){logger[_0x4b0e('0x1b')](_0x4b0e('0x46'));logger[_0x4b0e('0x1b')](_0x4b0e('0x52'),_0x676d62['id']);}})[_0x4b0e('0x4b')](function(_0x27f689){logger[_0x4b0e('0x4c')]('['+_0x471603[_0x4b0e('0x56')][_0x4b0e('0x57')]()+']',JSON['stringify'](_0x27f689));});}; \ No newline at end of file +var _0x0ec6=['%s/api/v2/agents','then','length','find','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','push','variable','variableName','idField','customVariable','Variable','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:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','stringify','outbound','recordingFormat','none','Authorization','destcalleridname','[OUTBOUND]','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','
','name','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','Ticket\x20created!','validateEmail'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0ec6,0x198));var _0x60ec=function(_0x4c9cd7,_0x2dd8fc){_0x4c9cd7=_0x4c9cd7-0x0;var _0x28491c=_0x0ec6[_0x4c9cd7];return _0x28491c;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x60ec('0x0'));var util=require('util');var Redis=require(_0x60ec('0x1'));var intUtil=require(_0x60ec('0x2'));var config=require(_0x60ec('0x3'));var logger=require(_0x60ec('0x4'))(_0x60ec('0x5'));config['redis']=_[_0x60ec('0x6')](config[_0x60ec('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x60ec('0x8'),'Accept':_0x60ec('0x8')};function emit(_0x14150b,_0x45fde9,_0x37cbd5){io['to'](_0x14150b)[_0x60ec('0x9')](_0x45fde9,_0x37cbd5);}function getTicket(_0x72d4f9,_0x14ebee,_0x17387f,_0x324195,_0x434390){logger[_0x60ec('0xa')](_0x60ec('0xb'));var _0x4c0da6=_['merge']({'responder_id':_0x14ebee['id'],'requester_id':_0x17387f['id'],'name':util['format'](_0x60ec('0xc'),_0x434390[_0x60ec('0xd')]),'phone':_0x434390[_0x60ec('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x324195[_0x60ec('0xf')],_0x434390,'\x20'),'description':intUtil[_0x60ec('0x10')](_0x324195['Descriptions'],_0x434390,_0x60ec('0x11')),'tags':getTags(_0x324195['Tags'],_0x60ec('0x12'))},getCustomFields(_0x324195['Fields'],_0x434390));_0x4c0da6[_0x60ec('0x13')]=_[_0x60ec('0x14')](_[_0x60ec('0x15')](_0x4c0da6[_0x60ec('0x13')],'id'),'value');return request({'uri':util[_0x60ec('0x16')](_0x60ec('0x17'),_0x72d4f9[_0x60ec('0x18')]),'method':'POST','body':_0x4c0da6})['then'](function(_0x56abd2){logger[_0x60ec('0xa')](_0x60ec('0x19'));return _0x56abd2;});}function getUser(_0x245d18,_0x1be464){if(intUtil[_0x60ec('0x1a')](_0x1be464)){return request({'uri':util[_0x60ec('0x16')](_0x60ec('0x1b'),_0x245d18[_0x60ec('0x18')]),'qs':{'email':_0x1be464}})[_0x60ec('0x1c')](function(_0x533b53){if(_0x533b53[_0x60ec('0x1d')]){logger[_0x60ec('0xa')]('Agent\x20found!');return _[_0x60ec('0x1e')](_0x533b53,function(_0x45e7e1){return _0x45e7e1[_0x60ec('0x1f')][_0x60ec('0x20')]===_0x1be464;});}else{logger[_0x60ec('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x60ec('0x16')](_0x60ec('0x21'),_0x245d18[_0x60ec('0x18')])})[_0x60ec('0x1c')](function(_0x3c8245){logger[_0x60ec('0xa')]('Admin\x20account\x20selected.');return _0x3c8245;});}});}else{logger[_0x60ec('0xa')](_0x60ec('0x22'));return request({'uri':util['format'](_0x60ec('0x21'),_0x245d18[_0x60ec('0x18')])})[_0x60ec('0x1c')](function(_0x4d2e3c){logger[_0x60ec('0xa')]('Admin\x20account\x20selected.');return _0x4d2e3c;});}}function getEndUser(_0x666522,_0x54dbbf,_0x5cfc52){logger[_0x60ec('0xa')](_0x60ec('0x23'),_0x5cfc52);return request({'uri':util[_0x60ec('0x16')](_0x60ec('0x24'),_0x666522['remoteUri']),'qs':{'phone':_0x5cfc52}})[_0x60ec('0x1c')](function(_0x44c9e4){if(_0x44c9e4[_0x60ec('0x1d')]){logger[_0x60ec('0xa')]('Enduser\x20found!');return _[_0x60ec('0x1e')](_0x44c9e4,{'phone':_0x5cfc52});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x60ec('0x16')](_0x60ec('0x24'),_0x666522[_0x60ec('0x18')]),'method':'POST','body':{'name':_0x54dbbf,'phone':_0x5cfc52}})[_0x60ec('0x1c')](function(_0x35995e){logger['info'](_0x60ec('0x25'));return _0x35995e;});}});}function getAuth(_0x3a492c){return util[_0x60ec('0x16')](_0x60ec('0x26'),new Buffer(_0x3a492c[_0x60ec('0x27')]+':X')[_0x60ec('0x28')](_0x60ec('0x29')));}function request(_0x256228){logger[_0x60ec('0x2a')](_0x60ec('0x2b'),JSON['stringify'](_0x256228));return rp(_['defaults'](_0x256228,{'method':_0x60ec('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0x291397,_0x520204){var _0x13b26c=[];if(_0x291397&&_0x291397[_0x60ec('0x1d')]>0x0){_0x13b26c=_[_0x60ec('0x2d')](_0x291397,_0x520204);}return _0x13b26c;}function getCustomFields(_0x5c562d,_0xa3b193){var _0x4a4b55=[];var _0x41c511={'custom_fields':[]};if(_0x5c562d[_0x60ec('0x1d')]>0x0){_[_0x60ec('0x2e')](_0x5c562d,function(_0x45a7eb){if(_[_0x60ec('0x2f')]([_0x60ec('0x30'),_0x60ec('0x31')],_0x45a7eb[_0x60ec('0x32')])&&_0x45a7eb[_0x60ec('0x33')]&&!_0x45a7eb[_0x60ec('0x34')]){_0x41c511[_0x45a7eb['nameField'][_0x60ec('0x35')]()]=_0x45a7eb['content'][_0x60ec('0x28')]();}else if(_[_0x60ec('0x2f')](['string',_0x60ec('0x31')],_0x45a7eb[_0x60ec('0x32')])&&_0x45a7eb['idField']&&_0x45a7eb['customField']){_0x41c511['custom_fields'][_0x60ec('0x36')]({'id':_0x45a7eb['idField'],'value':_0x45a7eb['content']['toString']()});}else if(_0x45a7eb[_0x60ec('0x32')]===_0x60ec('0x37')&&_0x45a7eb[_0x60ec('0x38')]&&_0x45a7eb[_0x60ec('0x39')]&&_0x45a7eb[_0x60ec('0x34')]){_0xa3b193[_0x45a7eb[_0x60ec('0x38')]]&&_0x41c511[_0x60ec('0x13')][_0x60ec('0x36')]({'id':_0x45a7eb['idField'],'value':_0xa3b193[_0x45a7eb['variableName']][_0x60ec('0x28')]()});}else if(_0x45a7eb[_0x60ec('0x32')]===_0x60ec('0x3a')&&_0x45a7eb[_0x60ec('0x3b')]&&_0x45a7eb[_0x60ec('0x3b')][_0x60ec('0x12')]&&_0x45a7eb['idField']&&_0x45a7eb['customField']){_0xa3b193[_0x45a7eb['Variable'][_0x60ec('0x12')]['toLowerCase']()]&&_0x41c511['custom_fields'][_0x60ec('0x36')]({'id':_0x45a7eb[_0x60ec('0x39')],'value':_0xa3b193[_0x45a7eb[_0x60ec('0x3b')]['name'][_0x60ec('0x35')]()][_0x60ec('0x28')]()});}});}return _0x41c511;}exports[_0x60ec('0x3c')]=function(_0x5e5a2d,_0x29d3d8,_0x3951ad,_0x648afd,_0x273821,_0x3277cb){var _0x9f4b4a,_0x27bc98;_0x3277cb[_0x60ec('0x18')]=intUtil[_0x60ec('0x3d')](_0x3277cb[_0x60ec('0x18')]);_0x3277cb[_0x60ec('0x3e')]=intUtil[_0x60ec('0x3d')](_0x3277cb[_0x60ec('0x3e')]);if(_0x273821&&_0x273821[_0x60ec('0x3f')]){logger[_0x60ec('0xa')](_0x60ec('0x40'),_0x60ec('0x41'));_0x29d3d8[_0x60ec('0x42')]=util['format'](_0x60ec('0x43'),_0x3277cb[_0x60ec('0x3e')],_0x29d3d8[_0x60ec('0x44')],md5(_0x29d3d8[_0x60ec('0x44')]));}else{_0x29d3d8[_0x60ec('0x42')]='';}headers['Authorization']=getAuth(_0x3277cb);return getUser(_0x3277cb,_0x648afd[_0x60ec('0x20')])[_0x60ec('0x1c')](function(_0x45fa69){_0x9f4b4a=_0x45fa69;logger['info'](_0x60ec('0x45'),_0x9f4b4a['id']);return getEndUser(_0x3277cb,_0x29d3d8[_0x60ec('0xd')],_0x29d3d8['calleridnum']);})[_0x60ec('0x1c')](function(_0x12e9b4){_0x27bc98=_0x12e9b4;logger[_0x60ec('0xa')](_0x60ec('0x46'),_0x27bc98['id']);return getTicket(_0x3277cb,_0x9f4b4a,_0x27bc98,_0x3951ad,_0x29d3d8);})['then'](function(_0x537719){if(_0x537719&&_0x537719['id']){logger['info'](_0x60ec('0x19'));logger[_0x60ec('0xa')]('The\x20Ticket\x20ID\x20is:',_0x537719['id']);logger[_0x60ec('0xa')](_0x60ec('0x40'),_0x60ec('0x47'));emit(util[_0x60ec('0x16')](_0x60ec('0x48'),_0x648afd['name']),'trigger:browser:url',{'uri':util[_0x60ec('0x16')]('%s/helpdesk/tickets/%d',_0x3277cb['remoteUri'],_0x537719['id'])});}})[_0x60ec('0x49')](function(_0x3bda94){logger[_0x60ec('0x4a')]('[QUEUE]',JSON[_0x60ec('0x4b')](_0x3bda94));});};exports[_0x60ec('0x4c')]=function(_0x26b9ea,_0x234ed4,_0x2b8620,_0x316bc6,_0x173cca,_0x14ed30,_0x449ffc){var _0x592a53,_0x11abb6;_0x14ed30[_0x60ec('0x18')]=intUtil[_0x60ec('0x3d')](_0x14ed30[_0x60ec('0x18')]);_0x14ed30[_0x60ec('0x3e')]=intUtil[_0x60ec('0x3d')](_0x14ed30[_0x60ec('0x3e')]);if(_0x449ffc&&_0x449ffc[_0x60ec('0x4d')]&&_0x449ffc[_0x60ec('0x4d')]!==_0x60ec('0x4e')){logger[_0x60ec('0xa')]('[OUTBOUND]',_0x60ec('0x41'));_0x234ed4[_0x60ec('0x42')]=util[_0x60ec('0x16')](_0x60ec('0x43'),_0x14ed30[_0x60ec('0x3e')],_0x234ed4[_0x60ec('0x44')],md5(_0x234ed4[_0x60ec('0x44')]));}headers[_0x60ec('0x4f')]=getAuth(_0x14ed30);return getUser(_0x14ed30,_0x316bc6[_0x60ec('0x20')])[_0x60ec('0x1c')](function(_0x3fea85){_0x592a53=_0x3fea85;logger['info'](_0x60ec('0x45'),_0x592a53['id']);return getEndUser(_0x14ed30,_0x234ed4[_0x60ec('0x50')],_0x234ed4['destcalleridnum']);})[_0x60ec('0x1c')](function(_0x16b45d){_0x11abb6=_0x16b45d;logger[_0x60ec('0xa')](_0x60ec('0x46'),_0x11abb6['id']);return getTicket(_0x14ed30,_0x592a53,_0x11abb6,_0x2b8620,_0x234ed4);})['then'](function(_0x11dd2e){if(_0x11dd2e&&_0x11dd2e['id']){logger[_0x60ec('0xa')](_0x60ec('0x19'));logger[_0x60ec('0xa')]('The\x20Ticket\x20ID\x20is:',_0x11dd2e['id']);logger[_0x60ec('0xa')](_0x60ec('0x51'),_0x60ec('0x47'));emit(util['format'](_0x60ec('0x48'),_0x316bc6[_0x60ec('0x12')]),'trigger:browser:url',{'uri':util['format'](_0x60ec('0x52'),_0x14ed30[_0x60ec('0x18')],_0x11dd2e['id'])});}})['catch'](function(_0xaf319c){logger[_0x60ec('0x4a')](_0x60ec('0x51'),JSON['stringify'](_0xaf319c));});};exports[_0x60ec('0x53')]=function(_0x58cba3,_0x2b0653,_0x183317,_0x3b8746,_0x4777ec,_0x325ec4){var _0x3d70f2,_0xfd2e69;_0x325ec4[_0x60ec('0x18')]=intUtil[_0x60ec('0x3d')](_0x325ec4[_0x60ec('0x18')]);_0x325ec4[_0x60ec('0x3e')]=intUtil[_0x60ec('0x3d')](_0x325ec4[_0x60ec('0x3e')]);if(_0x4777ec&&_0x4777ec[_0x60ec('0x3f')]){logger[_0x60ec('0xa')]('['+_0x2b0653[_0x60ec('0x54')][_0x60ec('0x55')]()+']',_0x60ec('0x41'));_0x2b0653[_0x60ec('0x42')]=util[_0x60ec('0x16')](_0x60ec('0x43'),_0x325ec4[_0x60ec('0x3e')],_0x2b0653[_0x60ec('0x44')],md5(_0x2b0653[_0x60ec('0x44')]));}else{_0x2b0653['recordingURL']='';}headers[_0x60ec('0x4f')]=getAuth(_0x325ec4);return getUser(_0x325ec4,'')[_0x60ec('0x1c')](function(_0x93ab0b){_0x3d70f2=_0x93ab0b;logger['info'](_0x60ec('0x45'),_0x3d70f2['id']);return getEndUser(_0x325ec4,_0x2b0653[_0x60ec('0xd')],_0x2b0653[_0x60ec('0xe')]);})[_0x60ec('0x1c')](function(_0x251d74){_0xfd2e69=_0x251d74;logger[_0x60ec('0xa')]('The\x20Enduser\x20ID\x20is:',_0xfd2e69['id']);return getTicket(_0x325ec4,_0x3d70f2,_0xfd2e69,_0x183317,_0x2b0653);})[_0x60ec('0x1c')](function(_0x6f0bac){if(_0x6f0bac){logger[_0x60ec('0xa')](_0x60ec('0x19'));logger[_0x60ec('0xa')](_0x60ec('0x56'),_0x6f0bac['id']);}})[_0x60ec('0x49')](function(_0x4b46d4){logger[_0x60ec('0x4a')]('['+_0x2b0653['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x4b46d4));});}; \ 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 f13d49f..ecd8a4c 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 _0x9482=['/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail'];(function(_0x5be791,_0x94dd5a){var _0x2ea8b8=function(_0x4423c0){while(--_0x4423c0){_0x5be791['push'](_0x5be791['shift']());}};_0x2ea8b8(++_0x94dd5a);}(_0x9482,0x130));var _0x2948=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9482[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x2948('0x0'));var rp=require(_0x2948('0x1'));var md5=require(_0x2948('0x2'));var util=require(_0x2948('0x3'));var moment=require(_0x2948('0x4'));var Promise=require(_0x2948('0x5'));var Redis=require('ioredis');var intUtil=require(_0x2948('0x6'));var config=require(_0x2948('0x7'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0x2948('0x8')](config[_0x2948('0x9')],{'host':_0x2948('0xa'),'port':0x18eb});var io=require(_0x2948('0xb'))(new Redis(config['redis']));function getAdminId(_0x5ba5b7,_0x1c4d2a,_0x55099e,_0x29d595){return new Promise(function(_0x339f54,_0x1c8096){var _0x44fc18=![];var _0x3a304f={'method':_0x2948('0xc'),'uri':_0x29d595+_0x2948('0xd'),'json':!![]};_0x3a304f[_0x2948('0xe')]=_0x55099e;logger[_0x2948('0xf')](_0x2948('0x10'));return rp(_0x3a304f)[_0x2948('0x11')](function(_0x51bfd2){if(_0x51bfd2){var _0x459ecf=_0x51bfd2[_0x2948('0x12')];var _0x2ce82c=null;for(_0x2ce82c=0x0;_0x2ce82c<_0x459ecf[_0x2948('0x13')];_0x2ce82c++){if(_0x459ecf[_0x2ce82c][_0x2948('0x14')]===_0x5ba5b7['adminEmail']){_0x5ba5b7[_0x2948('0x15')]=_0x459ecf[_0x2ce82c]['id'];_0x44fc18=!![];}}if(_0x44fc18){logger['info'](_0x2948('0x16'),_0x5ba5b7[_0x2948('0x15')]);_0x339f54(_0x5ba5b7);}else{_0x1c8096({'statusCode':0x194,'message':_0x2948('0x17')});}}else{_0x1c8096({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x2948('0x18')](function(_0x31fc3c){logger[_0x2948('0x19')]('['+[_0x1c4d2a[_0x2948('0x1a')]()]+']',_0x31fc3c[_0x2948('0x1b')]);_0x1c8096(_0x31fc3c);});});}function getUser(_0xf11f26,_0x9bad34,_0x4562d1){return function(_0x4c4b8f){return new Promise(function(_0xbaa345,_0xfbd94){var _0x37585c={'method':_0x2948('0xc'),'uri':_0x4562d1+_0x2948('0xd'),'json':!![]};_0x37585c[_0x2948('0xe')]=_0x9bad34;logger[_0x2948('0xf')](_0x2948('0x1c'));return rp(_0x37585c)[_0x2948('0x11')](function(_0x3ca9c0){if(_0x3ca9c0){var _0x24714c=_0x3ca9c0[_0x2948('0x12')];var _0x486105=![];var _0x308343=null;if(_0x4c4b8f[_0x2948('0x1d')]!==null){logger[_0x2948('0xf')](_0x2948('0x1e'),_0x4c4b8f[_0x2948('0x1d')]);_0x4c4b8f[_0x2948('0x1f')]=_0x4c4b8f[_0x2948('0x1d')];for(_0x308343=0x0;_0x308343<_0x24714c[_0x2948('0x13')];_0x308343++){if(_0x24714c[_0x308343]['email']===_0x4c4b8f[_0x2948('0x1d')]){_0x486105=!![];_0x4c4b8f[_0x2948('0x20')]=_0x24714c[_0x308343]['id'];logger[_0x2948('0xf')](_0x2948('0x21'),_0x4c4b8f['userId']);}}}if(!_0x486105){logger[_0x2948('0xf')](_0x2948('0x22'));_0x4c4b8f[_0x2948('0x1f')]=_0x4c4b8f[_0x2948('0x23')];_0x4c4b8f[_0x2948('0x20')]=_0x4c4b8f[_0x2948('0x15')];_0x486105=!![];}if(_0x486105){_0xbaa345(_0x4c4b8f);}else{_0xfbd94({'statusCode':0x194,'message':_0x2948('0x17')});}}else{_0xfbd94({'statusCode':0x194,'message':_0x2948('0x17')});}})[_0x2948('0x18')](function(_0x12a0be){logger['error']('['+[_0xf11f26['toUpperCase']()]+']',_0x12a0be[_0x2948('0x1b')]);_0xfbd94(_0x12a0be);});});};}function searchContact(_0x2afa22,_0x5f3fa6,_0x200319,_0x509cdf){return new Promise(function(_0x5643da,_0xfe96fd){var _0x140735={'method':_0x2948('0xc'),'headers':_0x5f3fa6,'uri':_0x2afa22+_0x2948('0x24')+_0x509cdf+'&f='+_0x200319+_0x2948('0x25'),'json':!![]};rp(_0x140735)[_0x2948('0x11')](function(_0x211a34){var _0x4fca6e=_[_0x2948('0x26')](_0x211a34[_0x2948('0x27')][_0x2948('0x27')],[_0x200319,_0x509cdf]);_0x5643da(_0x4fca6e);})['catch'](function(_0x1d803d){_0xfe96fd(_0x1d803d);});});}function getEndUser(_0x3a16bc,_0x1113bb,_0x36accb){return function(_0x295a4b){return new Promise(function(_0x5062d9,_0x1b32e4){logger[_0x2948('0xf')](util[_0x2948('0x28')](_0x2948('0x29'),_0x295a4b[_0x2948('0x2a')]));searchContact(_0x36accb,_0x1113bb,_0x2948('0x2b'),_0x295a4b[_0x2948('0x2a')])[_0x2948('0x11')](function(_0xa0d904){if(_0xa0d904){_0x295a4b[_0x2948('0x2c')]=_0xa0d904['id'];logger['info'](_0x2948('0x2d'),_0x295a4b[_0x2948('0x2c')]);return _0x5062d9(_0x295a4b);}searchContact(_0x36accb,_0x1113bb,_0x2948('0x2e'),_0x295a4b['contactNumber'])[_0x2948('0x11')](function(_0x17ad15){if(_0x17ad15){_0x295a4b[_0x2948('0x2c')]=_0x17ad15['id'];logger[_0x2948('0xf')](_0x2948('0x2f'),_0x295a4b[_0x2948('0x2c')]);return _0x5062d9(_0x295a4b);}createEndUser(_0x295a4b,_0x3a16bc,_0x1113bb,_0x36accb)[_0x2948('0x11')](function(_0x3a064e){logger[_0x2948('0xf')]('Contact\x20created:',_0x3a064e[_0x2948('0x2c')]);return _0x5062d9(_0x3a064e);});});})[_0x2948('0x18')](function(_0x1cde46){_0x1b32e4(_0x1cde46);});});};}function createEndUser(_0x205e58,_0x4fb083,_0x5c3887,_0x14ad3a){return new Promise(function(_0x51b8b8,_0x5fe66d){var _0xf96b5d=moment();var _0x35c183={'method':_0x2948('0x30'),'uri':_0x14ad3a+_0x2948('0x31'),'body':{'contact':{'last_name':_0x205e58[_0x2948('0x2a')],'work_number':_0x205e58[_0x2948('0x2a')],'mobile_number':_0x205e58[_0x2948('0x2a')],'owner_id':_0x205e58['userId'],'created_at':_0xf96b5d[_0x2948('0x28')](_0x2948('0x32'))}},'json':!![]};_0x35c183[_0x2948('0xe')]=_0x5c3887;logger[_0x2948('0xf')](_0x2948('0x33'));return rp(_0x35c183)['then'](function(_0x15a61d){_0x205e58[_0x2948('0x2c')]=_0x15a61d['contact']['id'];_0x51b8b8(_0x205e58);})['catch'](function(_0x5a14af){logger[_0x2948('0x19')]('['+[_0x4fb083['toUpperCase']()]+']',_0x5a14af[_0x2948('0x1b')]);_0x5fe66d(_0x5a14af[_0x2948('0x1b')]);});});}function getTicket(_0x52391d,_0xc91d90,_0x3b0a1e,_0xd43f7b,_0x4720b4){return function(_0x3e3b0a){logger[_0x2948('0xf')](_0x2948('0x34'));return new Promise(function(_0x275149,_0x4bf265){var _0x4c20f6=moment();var _0x1b0a5d={'method':_0x2948('0x30'),'uri':_0x3b0a1e+_0x2948('0x35'),'body':{'title':intUtil[_0x2948('0x36')](_0xd43f7b[_0x2948('0x37')],_0x4720b4,'\x20'),'description':intUtil[_0x2948('0x36')](_0xd43f7b['Descriptions'],_0x4720b4,'\x0a'),'owner_id':_0x3e3b0a[_0x2948('0x20')],'creater_id':_0x3e3b0a[_0x2948('0x15')],'targetable_id':_0x3e3b0a[_0x2948('0x2c')],'targetable_type':_0x2948('0x38'),'created_at':_0x4c20f6['format'](_0x2948('0x32')),'due_date':_0x4c20f6[_0x2948('0x39')](0x1e,'m')[_0x2948('0x28')](_0x2948('0x32'))},'json':!![]};_0x1b0a5d[_0x2948('0xe')]=_0xc91d90;return rp(_0x1b0a5d)[_0x2948('0x11')](function(_0x5ead83){_0x3e3b0a[_0x2948('0x3a')]=_0x5ead83[_0x2948('0x3b')]['id'];logger[_0x2948('0xf')](_0x2948('0x3c'),_0x3e3b0a[_0x2948('0x3a')]);_0x275149(_0x3e3b0a);})[_0x2948('0x18')](function(_0x10a00b){logger['error']('['+[_0x52391d[_0x2948('0x1a')]()]+']',_0x10a00b[_0x2948('0x1b')]);_0x4bf265(_0x10a00b['message']);});});};}function emit(_0x44ddca,_0x4c48da,_0x591c73){var _0x1e9650={'uri':_0x44ddca+_0x2948('0x3d')+_0x591c73};io['to'](util[_0x2948('0x28')]('user:%s',_0x4c48da))[_0x2948('0x3e')](_0x2948('0x3f'),_0x1e9650);}exports['cs']=function(_0x25e45e,_0x26a3f2,_0x5deb20,_0x516028,_0x7a5ffe,_0x17d9ba,_0x492c1e,_0x3ec327){var _0x179b3a={};var _0x2e622f={'Authorization':_0x2948('0x40')+_0x17d9ba[_0x2948('0x41')]};_0x17d9ba[_0x2948('0x42')]=intUtil[_0x2948('0x43')](_0x17d9ba[_0x2948('0x42')]);_0x17d9ba['serverUrl']=intUtil[_0x2948('0x43')](_0x17d9ba[_0x2948('0x44')]);var _0x2132d3=_0x17d9ba[_0x2948('0x42')];_0x179b3a[_0x2948('0x23')]=_0x17d9ba[_0x2948('0x45')];_0x179b3a[_0x2948('0x2a')]=_0x3ec327[_0x2948('0x46')]()===_0x2948('0x47')?_0x26a3f2['destcalleridnum']:_0x26a3f2['calleridnum'];_0x179b3a[_0x2948('0x48')]=_0x3ec327==='queue'||_0x3ec327===_0x2948('0x49')?'queue':_0x2948('0x47');if(_0x516028){_0x179b3a[_0x2948('0x1d')]=_0x516028['email'];}var _0x54e608=util[_0x2948('0x28')](_0x2948('0x4a'),_0x17d9ba[_0x2948('0x44')],_0x26a3f2[_0x2948('0x4b')],md5(_0x26a3f2[_0x2948('0x4b')]));if(_0x7a5ffe&&_0x7a5ffe[_0x2948('0x4c')]){logger[_0x2948('0xf')](_0x2948('0x4d'),'Recording\x20is\x20enabled!');_0x26a3f2[_0x2948('0x4e')]=_0x54e608;}else if(_0x492c1e&&_0x492c1e[_0x2948('0x4f')]&&_0x492c1e['recordingFormat']!==_0x2948('0x50')){logger[_0x2948('0xf')]('[OUTBOUND]',_0x2948('0x51'));_0x26a3f2[_0x2948('0x4e')]=_0x54e608;}else{_0x26a3f2[_0x2948('0x4e')]='';}return getAdminId(_0x179b3a,_0x3ec327,_0x2e622f,_0x2132d3)[_0x2948('0x11')](getUser(_0x3ec327,_0x2e622f,_0x2132d3))[_0x2948('0x11')](getEndUser(_0x3ec327,_0x2e622f,_0x2132d3))[_0x2948('0x11')](getTicket(_0x3ec327,_0x2e622f,_0x2132d3,_0x5deb20,_0x26a3f2))['then'](function(_0x309c27){logger['info'](util[_0x2948('0x28')]('The\x20ticket\x20ID\x20is:\x20%s',_0x309c27[_0x2948('0x3a')]));if(_0x3ec327!==_0x2948('0x49')){logger[_0x2948('0xf')]('['+[_0x3ec327[_0x2948('0x1a')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x2132d3,_0x516028[_0x2948('0x52')],_0x309c27[_0x2948('0x2c')]);}})[_0x2948('0x18')](function(_0x536bae){logger[_0x2948('0x19')]('['+[_0x3ec327[_0x2948('0x1a')]()]+_0x2948('0x53'),util[_0x2948('0x54')](_0x536bae,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2ccc=['Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','contactNumber','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','calleridnum','callDirection','unmanaged','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','GET','/api/selector/owners','Getting\x20admin\x20information','then','users','length','email','adminEmail','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail'];(function(_0x211fe5,_0x46dba4){var _0x561c9d=function(_0x25fdbe){while(--_0x25fdbe){_0x211fe5['push'](_0x211fe5['shift']());}};_0x561c9d(++_0x46dba4);}(_0x2ccc,0x193));var _0xc2cc=function(_0x43758b,_0x320468){_0x43758b=_0x43758b-0x0;var _0x1b0b2c=_0x2ccc[_0x43758b];return _0x1b0b2c;};'use strict';var _=require(_0xc2cc('0x0'));var rp=require(_0xc2cc('0x1'));var md5=require('md5');var util=require(_0xc2cc('0x2'));var moment=require('moment');var Promise=require(_0xc2cc('0x3'));var Redis=require(_0xc2cc('0x4'));var intUtil=require(_0xc2cc('0x5'));var config=require(_0xc2cc('0x6'));var logger=require(_0xc2cc('0x7'))(_0xc2cc('0x8'));config[_0xc2cc('0x9')]=_['defaults'](config[_0xc2cc('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc2cc('0x9')]));function getAdminId(_0x1b1fe7,_0x12e302,_0x12aa06,_0x24b885){return new Promise(function(_0x14e73f,_0x244928){var _0x87ccb9=![];var _0x36d0c8={'method':_0xc2cc('0xa'),'uri':_0x24b885+_0xc2cc('0xb'),'json':!![]};_0x36d0c8['headers']=_0x12aa06;logger['info'](_0xc2cc('0xc'));return rp(_0x36d0c8)[_0xc2cc('0xd')](function(_0x35d7b5){if(_0x35d7b5){var _0x3306d7=_0x35d7b5[_0xc2cc('0xe')];var _0x40ce94=null;for(_0x40ce94=0x0;_0x40ce94<_0x3306d7[_0xc2cc('0xf')];_0x40ce94++){if(_0x3306d7[_0x40ce94][_0xc2cc('0x10')]===_0x1b1fe7[_0xc2cc('0x11')]){_0x1b1fe7['adminId']=_0x3306d7[_0x40ce94]['id'];_0x87ccb9=!![];}}if(_0x87ccb9){logger[_0xc2cc('0x12')](_0xc2cc('0x13'),_0x1b1fe7[_0xc2cc('0x14')]);_0x14e73f(_0x1b1fe7);}else{_0x244928({'statusCode':0x194,'message':_0xc2cc('0x15')});}}else{_0x244928({'statusCode':0x194,'message':_0xc2cc('0x15')});}})[_0xc2cc('0x16')](function(_0x4f51f8){logger['error']('['+[_0x12e302[_0xc2cc('0x17')]()]+']',_0x4f51f8[_0xc2cc('0x18')]);_0x244928(_0x4f51f8);});});}function getUser(_0x1d1ec7,_0x5e1bbc,_0x4404b2){return function(_0x291bc3){return new Promise(function(_0x4f342d,_0x4d999c){var _0x474a63={'method':_0xc2cc('0xa'),'uri':_0x4404b2+_0xc2cc('0xb'),'json':!![]};_0x474a63['headers']=_0x5e1bbc;logger[_0xc2cc('0x12')](_0xc2cc('0x19'));return rp(_0x474a63)[_0xc2cc('0xd')](function(_0x20a3d0){if(_0x20a3d0){var _0x4e5631=_0x20a3d0[_0xc2cc('0xe')];var _0x3806fb=![];var _0x5569b1=null;if(_0x291bc3[_0xc2cc('0x1a')]!==null){logger['info'](_0xc2cc('0x1b'),_0x291bc3['agentEmail']);_0x291bc3[_0xc2cc('0x1c')]=_0x291bc3[_0xc2cc('0x1a')];for(_0x5569b1=0x0;_0x5569b1<_0x4e5631[_0xc2cc('0xf')];_0x5569b1++){if(_0x4e5631[_0x5569b1][_0xc2cc('0x10')]===_0x291bc3[_0xc2cc('0x1a')]){_0x3806fb=!![];_0x291bc3[_0xc2cc('0x1d')]=_0x4e5631[_0x5569b1]['id'];logger[_0xc2cc('0x12')]('User\x20found:',_0x291bc3[_0xc2cc('0x1d')]);}}}if(!_0x3806fb){logger[_0xc2cc('0x12')](_0xc2cc('0x1e'));_0x291bc3['userEmail']=_0x291bc3['adminEmail'];_0x291bc3['userId']=_0x291bc3[_0xc2cc('0x14')];_0x3806fb=!![];}if(_0x3806fb){_0x4f342d(_0x291bc3);}else{_0x4d999c({'statusCode':0x194,'message':_0xc2cc('0x15')});}}else{_0x4d999c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xc2cc('0x16')](function(_0x5aa2ad){logger[_0xc2cc('0x1f')]('['+[_0x1d1ec7['toUpperCase']()]+']',_0x5aa2ad['message']);_0x4d999c(_0x5aa2ad);});});};}function searchContact(_0x4f5d90,_0x1b5a12,_0x277458,_0x215d90){return new Promise(function(_0x3608c9,_0x514e8f){var _0x2907c9={'method':_0xc2cc('0xa'),'headers':_0x1b5a12,'uri':_0x4f5d90+_0xc2cc('0x20')+_0x215d90+_0xc2cc('0x21')+_0x277458+_0xc2cc('0x22'),'json':!![]};rp(_0x2907c9)['then'](function(_0x41e7bc){var _0x550b88=_[_0xc2cc('0x23')](_0x41e7bc[_0xc2cc('0x24')][_0xc2cc('0x24')],[_0x277458,_0x215d90]);_0x3608c9(_0x550b88);})['catch'](function(_0x502c39){_0x514e8f(_0x502c39);});});}function getEndUser(_0x2ccfa8,_0x1d55c3,_0x71a6dd){return function(_0x275a5d){return new Promise(function(_0x1a92e4,_0x1730c3){logger[_0xc2cc('0x12')](util[_0xc2cc('0x25')](_0xc2cc('0x26'),_0x275a5d['contactNumber']));searchContact(_0x71a6dd,_0x1d55c3,_0xc2cc('0x27'),_0x275a5d['contactNumber'])[_0xc2cc('0xd')](function(_0x1d4dae){if(_0x1d4dae){_0x275a5d[_0xc2cc('0x28')]=_0x1d4dae['id'];logger[_0xc2cc('0x12')](_0xc2cc('0x29'),_0x275a5d['endUserId']);return _0x1a92e4(_0x275a5d);}searchContact(_0x71a6dd,_0x1d55c3,_0xc2cc('0x2a'),_0x275a5d['contactNumber'])['then'](function(_0x3cf96c){if(_0x3cf96c){_0x275a5d[_0xc2cc('0x28')]=_0x3cf96c['id'];logger[_0xc2cc('0x12')](_0xc2cc('0x2b'),_0x275a5d[_0xc2cc('0x28')]);return _0x1a92e4(_0x275a5d);}createEndUser(_0x275a5d,_0x2ccfa8,_0x1d55c3,_0x71a6dd)[_0xc2cc('0xd')](function(_0x22a87d){logger[_0xc2cc('0x12')](_0xc2cc('0x2c'),_0x22a87d[_0xc2cc('0x28')]);return _0x1a92e4(_0x22a87d);});});})[_0xc2cc('0x16')](function(_0x3c5118){_0x1730c3(_0x3c5118);});});};}function createEndUser(_0x5a37ff,_0x4c4d5e,_0x476ad8,_0x33511e){return new Promise(function(_0x2ab8d1,_0x6223fd){var _0x35d7b8=moment();var _0x4895c2={'method':_0xc2cc('0x2d'),'uri':_0x33511e+_0xc2cc('0x2e'),'body':{'contact':{'last_name':_0x5a37ff[_0xc2cc('0x2f')],'work_number':_0x5a37ff[_0xc2cc('0x2f')],'mobile_number':_0x5a37ff[_0xc2cc('0x2f')],'owner_id':_0x5a37ff[_0xc2cc('0x1d')],'created_at':_0x35d7b8[_0xc2cc('0x25')](_0xc2cc('0x30'))}},'json':!![]};_0x4895c2[_0xc2cc('0x31')]=_0x476ad8;logger[_0xc2cc('0x12')](_0xc2cc('0x32'));return rp(_0x4895c2)[_0xc2cc('0xd')](function(_0x3e2625){_0x5a37ff[_0xc2cc('0x28')]=_0x3e2625[_0xc2cc('0x33')]['id'];_0x2ab8d1(_0x5a37ff);})[_0xc2cc('0x16')](function(_0x2f621b){logger['error']('['+[_0x4c4d5e[_0xc2cc('0x17')]()]+']',_0x2f621b[_0xc2cc('0x18')]);_0x6223fd(_0x2f621b['message']);});});}function getTicket(_0x427a6f,_0x29ed45,_0x5e62a4,_0x367274,_0x1bc161){return function(_0x28d35f){logger[_0xc2cc('0x12')](_0xc2cc('0x34'));return new Promise(function(_0x52c654,_0x22b2e8){var _0x279796=moment();var _0x40f207={'method':_0xc2cc('0x2d'),'uri':_0x5e62a4+_0xc2cc('0x35'),'body':{'title':intUtil[_0xc2cc('0x36')](_0x367274[_0xc2cc('0x37')],_0x1bc161,'\x20'),'description':intUtil['getString'](_0x367274[_0xc2cc('0x38')],_0x1bc161,'\x0a'),'owner_id':_0x28d35f[_0xc2cc('0x1d')],'creater_id':_0x28d35f['adminId'],'targetable_id':_0x28d35f[_0xc2cc('0x28')],'targetable_type':_0xc2cc('0x39'),'created_at':_0x279796[_0xc2cc('0x25')](_0xc2cc('0x30')),'due_date':_0x279796[_0xc2cc('0x3a')](0x1e,'m')[_0xc2cc('0x25')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x40f207['headers']=_0x29ed45;return rp(_0x40f207)['then'](function(_0x4111ef){_0x28d35f[_0xc2cc('0x3b')]=_0x4111ef['task']['id'];logger[_0xc2cc('0x12')]('Task\x20created:',_0x28d35f[_0xc2cc('0x3b')]);_0x52c654(_0x28d35f);})['catch'](function(_0x49dcb0){logger['error']('['+[_0x427a6f[_0xc2cc('0x17')]()]+']',_0x49dcb0[_0xc2cc('0x18')]);_0x22b2e8(_0x49dcb0['message']);});});};}function emit(_0x59c3e4,_0x25ec35,_0xda8007){var _0x9cc9c2={'uri':_0x59c3e4+_0xc2cc('0x3c')+_0xda8007};io['to'](util[_0xc2cc('0x25')](_0xc2cc('0x3d'),_0x25ec35))[_0xc2cc('0x3e')](_0xc2cc('0x3f'),_0x9cc9c2);}exports['cs']=function(_0x503809,_0xd3ad88,_0x50bd8e,_0x16ff64,_0x473294,_0x5c3366,_0x5841df,_0x19fa7b){var _0x445811={};var _0x191cec={'Authorization':_0xc2cc('0x40')+_0x5c3366['apiKey']};_0x5c3366[_0xc2cc('0x41')]=intUtil['stripTrailingSlash'](_0x5c3366[_0xc2cc('0x41')]);_0x5c3366['serverUrl']=intUtil[_0xc2cc('0x42')](_0x5c3366[_0xc2cc('0x43')]);var _0x3fa615=_0x5c3366['remoteUri'];_0x445811['adminEmail']=_0x5c3366['username'];_0x445811['contactNumber']=_0x19fa7b[_0xc2cc('0x44')]()==='outbound'?_0xd3ad88[_0xc2cc('0x45')]:_0xd3ad88[_0xc2cc('0x46')];_0x445811[_0xc2cc('0x47')]=_0x19fa7b==='queue'||_0x19fa7b===_0xc2cc('0x48')?_0xc2cc('0x49'):_0xc2cc('0x4a');if(_0x16ff64){_0x445811['agentEmail']=_0x16ff64['email'];}var _0x13c785=util[_0xc2cc('0x25')](_0xc2cc('0x4b'),_0x5c3366[_0xc2cc('0x43')],_0xd3ad88['uniqueid'],md5(_0xd3ad88[_0xc2cc('0x4c')]));if(_0x473294&&_0x473294[_0xc2cc('0x4d')]){logger[_0xc2cc('0x12')](_0xc2cc('0x4e'),'Recording\x20is\x20enabled!');_0xd3ad88['recordingURL']=_0x13c785;}else if(_0x5841df&&_0x5841df['recordingFormat']&&_0x5841df[_0xc2cc('0x4f')]!==_0xc2cc('0x50')){logger[_0xc2cc('0x12')](_0xc2cc('0x51'),_0xc2cc('0x52'));_0xd3ad88[_0xc2cc('0x53')]=_0x13c785;}else{_0xd3ad88[_0xc2cc('0x53')]='';}return getAdminId(_0x445811,_0x19fa7b,_0x191cec,_0x3fa615)['then'](getUser(_0x19fa7b,_0x191cec,_0x3fa615))[_0xc2cc('0xd')](getEndUser(_0x19fa7b,_0x191cec,_0x3fa615))[_0xc2cc('0xd')](getTicket(_0x19fa7b,_0x191cec,_0x3fa615,_0x50bd8e,_0xd3ad88))[_0xc2cc('0xd')](function(_0x211cf8){logger[_0xc2cc('0x12')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x211cf8['ticketId']));if(_0x19fa7b!=='unmanaged'){logger[_0xc2cc('0x12')]('['+[_0x19fa7b[_0xc2cc('0x17')]()]+']',_0xc2cc('0x54'));emit(_0x3fa615,_0x16ff64['name'],_0x211cf8[_0xc2cc('0x28')]);}})['catch'](function(_0x1894ad){logger[_0xc2cc('0x1f')]('['+[_0x19fa7b[_0xc2cc('0x17')]()]+_0xc2cc('0x55'),util['inspect'](_0x1894ad,{'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 25cb0d2..0b60f58 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 _0x629c=['./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','log','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger'];(function(_0x304fe0,_0x430c48){var _0x1649f8=function(_0x33a894){while(--_0x33a894){_0x304fe0['push'](_0x304fe0['shift']());}};_0x1649f8(++_0x430c48);}(_0x629c,0x1b0));var _0xc629=function(_0x375061,_0x27025){_0x375061=_0x375061-0x0;var _0x19fbfd=_0x629c[_0x375061];return _0x19fbfd;};'use strict';var _=require(_0xc629('0x0'));var util=require(_0xc629('0x1'));var zendesk=require(_0xc629('0x2'));var salesforce=require(_0xc629('0x3'));var sugarcrm=require(_0xc629('0x4'));var freshdesk=require(_0xc629('0x5'));var zoho=require('./zoho');var desk=require(_0xc629('0x6'));var vtiger=require(_0xc629('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0xc629('0x8'));var freshsales=require(_0xc629('0x9'));var integrations=[_0xc629('0xa'),'salesforce',_0xc629('0xb'),_0xc629('0xc'),'zoho',_0xc629('0xd'),_0xc629('0xe'),_0xc629('0xf'),_0xc629('0x10'),_0xc629('0x11')];exports['exec']=function(_0x438ad2,_0x3455e9,_0xc954be,_0xa22cf,_0x237a93,_0x1a7343){if(_0xc954be){if(_[_0xc629('0x12')](integrations,_0x438ad2[_0xc629('0x13')]['toLowerCase']())){try{var _0x4436f1=null;var _0x29d858='';var _0x7464eb=_0xc954be[_0x438ad2[_0xc629('0x13')][_0xc629('0x14')]()];if(_0x7464eb){var _0x2ea7d7=_0x7464eb[_0x438ad2[_0xc629('0x15')]];if(_0x2ea7d7){var _0x571ae1=_[_0xc629('0x16')](_0x2ea7d7[_0xc629('0x17')],{'id':parseInt(_0x438ad2[_0xc629('0x18')],0xa)});if(_0x571ae1){if(_0xa22cf){if(_0x237a93&&_0x3455e9['queue']){_0x29d858=_0xc629('0x19');}else if(_0x3455e9[_0xc629('0x1a')]){_0x29d858=_0xc629('0x1b');}else{console['log'](_0xc629('0x1c'),_0x3455e9);}}else{_0x29d858=_0xc629('0x1d');}switch(_0x438ad2[_0xc629('0x13')]['toLowerCase']()){case _0xc629('0xa'):zendesk[_0x29d858](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343);break;case _0xc629('0x1e'):salesforce[_0x29d858](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343);break;case _0xc629('0xb'):sugarcrm[_0x29d858](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343);break;case _0xc629('0xc'):freshdesk[_0x29d858](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343);break;case _0xc629('0x1f'):zoho[_0x29d858](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343);break;case'desk':desk[_0x29d858](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343);break;case'vtiger':vtiger[_0x29d858](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343);break;case _0xc629('0x10'):freshsales['cs'](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343,_0x29d858);break;case _0xc629('0x11'):servicenow['cs'](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343,_0x29d858);break;case _0xc629('0xf'):dynamics365['cs'](_0x438ad2,_0x3455e9,_0x571ae1,_0xa22cf,_0x237a93,_0x2ea7d7,_0x1a7343,_0x29d858);break;default:console[_0xc629('0x20')](_0xc629('0x21'));}}else{_0x4436f1=require(_0xc629('0x22'))(_0x438ad2[_0xc629('0x13')][_0xc629('0x14')]());_0x4436f1[_0xc629('0x23')]('[EXEC]',util[_0xc629('0x24')](_0xc629('0x25'),_0x438ad2[_0xc629('0x13')][_0xc629('0x14')](),_0x438ad2[_0xc629('0x18')]));}}else{_0x4436f1=require('../../../../config/logger')(_0x438ad2[_0xc629('0x13')][_0xc629('0x14')]());_0x4436f1['error'](_0xc629('0x26'),util[_0xc629('0x24')](_0xc629('0x27'),_0x438ad2[_0xc629('0x13')][_0xc629('0x14')](),_0x438ad2[_0xc629('0x15')]));}}else{}}catch(_0x539c03){console[_0xc629('0x23')](_0x539c03);}}}}; \ No newline at end of file +var _0xa7a1=['salesforce','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','desk','vtiger','freshsales','exec','data1','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','zendesk'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xa7a1,0x1b8));var _0x1a7a=function(_0x4e346a,_0x1ba060){_0x4e346a=_0x4e346a-0x0;var _0x12ac3a=_0xa7a1[_0x4e346a];return _0x12ac3a;};'use strict';var _=require(_0x1a7a('0x0'));var util=require(_0x1a7a('0x1'));var zendesk=require(_0x1a7a('0x2'));var salesforce=require(_0x1a7a('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1a7a('0x4'));var zoho=require(_0x1a7a('0x5'));var desk=require(_0x1a7a('0x6'));var vtiger=require(_0x1a7a('0x7'));var servicenow=require(_0x1a7a('0x8'));var dynamics365=require(_0x1a7a('0x9'));var freshsales=require(_0x1a7a('0xa'));var integrations=['zendesk','salesforce',_0x1a7a('0xb'),_0x1a7a('0xc'),'zoho',_0x1a7a('0xd'),_0x1a7a('0xe'),'dynamics365',_0x1a7a('0xf'),'servicenow'];exports[_0x1a7a('0x10')]=function(_0x77ce56,_0x20e410,_0x288e2c,_0x41fcba,_0x3fb484,_0x100865){if(_0x288e2c){if(_['includes'](integrations,_0x77ce56[_0x1a7a('0x11')]['toLowerCase']())){try{var _0x10023b=null;var _0xaf6418='';var _0x296f29=_0x288e2c[_0x77ce56['data1']['toLowerCase']()];if(_0x296f29){var _0x551173=_0x296f29[_0x77ce56[_0x1a7a('0x12')]];if(_0x551173){var _0x186aac=_['find'](_0x551173['Configurations'],{'id':parseInt(_0x77ce56[_0x1a7a('0x13')],0xa)});if(_0x186aac){if(_0x41fcba){if(_0x3fb484&&_0x20e410[_0x1a7a('0x14')]){_0xaf6418='queue';}else if(_0x20e410[_0x1a7a('0x15')]){_0xaf6418=_0x1a7a('0x16');}else{console[_0x1a7a('0x17')](_0x1a7a('0x18'),_0x20e410);}}else{_0xaf6418=_0x1a7a('0x19');}switch(_0x77ce56[_0x1a7a('0x11')][_0x1a7a('0x1a')]()){case _0x1a7a('0x1b'):zendesk[_0xaf6418](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865);break;case _0x1a7a('0x1c'):salesforce[_0xaf6418](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865);break;case'sugarcrm':sugarcrm[_0xaf6418](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865);break;case _0x1a7a('0xc'):freshdesk[_0xaf6418](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865);break;case'zoho':zoho[_0xaf6418](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865);break;case _0x1a7a('0xd'):desk[_0xaf6418](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865);break;case _0x1a7a('0xe'):vtiger[_0xaf6418](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865);break;case _0x1a7a('0xf'):freshsales['cs'](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865,_0xaf6418);break;case'servicenow':servicenow['cs'](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865,_0xaf6418);break;case'dynamics365':dynamics365['cs'](_0x77ce56,_0x20e410,_0x186aac,_0x41fcba,_0x3fb484,_0x551173,_0x100865,_0xaf6418);break;default:console[_0x1a7a('0x17')](_0x1a7a('0x1d'));}}else{_0x10023b=require(_0x1a7a('0x1e'))(_0x77ce56[_0x1a7a('0x11')]['toLowerCase']());_0x10023b[_0x1a7a('0x1f')](_0x1a7a('0x20'),util[_0x1a7a('0x21')](_0x1a7a('0x22'),_0x77ce56[_0x1a7a('0x11')][_0x1a7a('0x1a')](),_0x77ce56['data3']));}}else{_0x10023b=require(_0x1a7a('0x1e'))(_0x77ce56[_0x1a7a('0x11')][_0x1a7a('0x1a')]());_0x10023b[_0x1a7a('0x1f')](_0x1a7a('0x20'),util['format'](_0x1a7a('0x23'),_0x77ce56[_0x1a7a('0x11')][_0x1a7a('0x1a')](),_0x77ce56[_0x1a7a('0x12')]));}}else{}}catch(_0x648b83){console['error'](_0x648b83);}}}}; \ 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 f930981..98ba6e5 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 _0x1204=['toString','variable','variableName','idField','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','toUpperCase','lastevent','request-promise','moment','bluebird','md5','jsforce','ioredis','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','sobject','then','length','find','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','moduleSearch','contact_lead','merge','$or','Contact','additionalSearchLead','Lead','cloneDeep','additionalSearchAccount','Account','execute','additionalSearchContact','first','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.','LastName','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','includes','picklist'];(function(_0x1d895c,_0x175701){var _0x7505c7=function(_0x4f065d){while(--_0x4f065d){_0x1d895c['push'](_0x1d895c['shift']());}};_0x7505c7(++_0x175701);}(_0x1204,0x12d));var _0x4120=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1204[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var rp=require(_0x4120('0x0'));var moment=require(_0x4120('0x1'));var BPromise=require(_0x4120('0x2'));var md5=require(_0x4120('0x3'));var jsforce=require(_0x4120('0x4'));var util=require('util');var Redis=require(_0x4120('0x5'));var intUtil=require('./util');var config=require(_0x4120('0x6'));var logger=require('../../../../config/logger')(_0x4120('0x7'));config[_0x4120('0x8')]=_[_0x4120('0x9')](config[_0x4120('0x8')],{'host':_0x4120('0xa'),'port':0x18eb});var io=require(_0x4120('0xb'))(new Redis(config[_0x4120('0x8')]));function emit(_0x4d2444,_0x12f314,_0x3e76c8){io['to'](_0x4d2444)[_0x4120('0xc')](_0x12f314,_0x3e76c8);}function getTicket(_0x29febc,_0x4f7404,_0x37d7e9,_0x269abe,_0x22da8a,_0x122072,_0x108b92,_0x4b3af3){var _0x3bbe83=Object[_0x4120('0xd')]({},{'OwnerId':_0x4f7404['id'],'Subject':intUtil[_0x4120('0xe')](_0x269abe[_0x4120('0xf')],_0x22da8a,'\x20'),'Description':intUtil[_0x4120('0xe')](_0x269abe[_0x4120('0x10')],_0x22da8a,'\x0a')},getCustomFields(_0x122072,_0x22da8a));if(_0x37d7e9){if(_0x269abe[_0x4120('0x11')]===_0x4120('0x12')){_0x3bbe83['ActivityDate']=moment[_0x4120('0x13')]();_0x3bbe83[_0x4120('0x14')]=![];_0x3bbe83[_0x4120('0x15')]=![];if(_0x37d7e9[_0x4120('0x16')]===_0x4120('0x17')||_0x37d7e9[_0x4120('0x16')]==='lead'){_0x3bbe83[_0x4120('0x18')]=_0x37d7e9['id'];}else if(_0x37d7e9[_0x4120('0x16')]===_0x4120('0x19')){_0x3bbe83[_0x4120('0x1a')]=_0x37d7e9['id'];}}else if(_0x269abe[_0x4120('0x11')]===_0x4120('0x1b')){if(_0x37d7e9['endUserType']===_0x4120('0x17')){_0x3bbe83['ContactId']=_0x37d7e9['id'];}else if(_0x37d7e9[_0x4120('0x16')]===_0x4120('0x19')){_0x3bbe83[_0x4120('0x1c')]=_0x37d7e9['id'];}else if(_0x37d7e9[_0x4120('0x16')]===_0x4120('0x1d')&&_0x269abe[_0x4120('0x1e')]){_0x3bbe83[_0x269abe[_0x4120('0x1e')]]=_0x37d7e9['id'];}else{logger[_0x4120('0x1f')](_0x4120('0x20'));}}}return _0x108b92['sobject'](_0x269abe[_0x4120('0x11')])[_0x4120('0x21')](_0x3bbe83);}function getUser(_0x3e20ee,_0x14399b,_0x4eba06){if(!_[_0x4120('0x22')](_0x14399b)&&intUtil['validateEmail'](_0x14399b)){var _0x2d27c3={'Email':_0x14399b};var _0x55e662={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4eba06[_0x4120('0x23')]('User')['find'](_0x2d27c3,_0x55e662)['execute']()[_0x4120('0x24')](function(_0x4a1483){if(_0x4a1483[_0x4120('0x25')]){var _0x221faf=_[_0x4120('0x26')](_0x4a1483,function(_0x128f91){return _0x128f91[_0x4120('0x27')]===_0x14399b;});if(_0x221faf){logger['info']('Agent\x20%s\x20found.',_0x14399b);return BPromise[_0x4120('0x28')]({'id':_0x221faf['Id'],'name':_0x221faf[_0x4120('0x29')]});}}else{logger[_0x4120('0x1f')](_0x4120('0x2a'),_0x14399b);return _0x4eba06[_0x4120('0x2b')]()[_0x4120('0x24')](function(_0x5587c1){return BPromise[_0x4120('0x28')]({'id':_0x5587c1['user_id'],'name':_0x5587c1[_0x4120('0x2c')]});});}});}else{logger[_0x4120('0x1f')](_0x4120('0x2a'),_0x14399b);return _0x4eba06[_0x4120('0x2b')]()[_0x4120('0x24')](function(_0x31b7f){return BPromise['resolve']({'id':_0x31b7f[_0x4120('0x2d')],'name':_0x31b7f[_0x4120('0x2c')]});});}}function getEndUser(_0x1d2797,_0x293df5,_0x4d200a,_0x5ca6be,_0x288518){var _0x5bcdc6={'$or':{'Phone':_0x5ca6be}};var _0x17b965={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x4120('0x24')](function(){logger[_0x4120('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5ca6be,_0x293df5['moduleSearch']);switch(_0x293df5[_0x4120('0x2e')]){case _0x4120('0x2f'):var _0x3bd1d1=_['cloneDeep'](_0x5bcdc6);if(_0x293df5['additionalSearchContact']){var _0x1ece07={};_0x1ece07[_0x293df5['additionalSearchContact']]=_0x5ca6be;_[_0x4120('0x30')](_0x3bd1d1[_0x4120('0x31')],_0x1ece07);}return _0x288518['sobject'](_0x4120('0x32'))[_0x4120('0x26')](_0x3bd1d1,_0x17b965)['execute']()[_0x4120('0x24')](function(_0x17555c){if(_0x17555c&&_0x17555c['length']){return _0x17555c;}else{var _0x1f0581=_['cloneDeep'](_0x5bcdc6);if(_0x293df5[_0x4120('0x33')]){var _0x4e789e={};_0x4e789e[_0x293df5[_0x4120('0x33')]]=_0x5ca6be;_[_0x4120('0x30')](_0x1f0581[_0x4120('0x31')],_0x4e789e);}return _0x288518['sobject'](_0x4120('0x34'))[_0x4120('0x26')](_0x1f0581,_0x17b965);}});case'account_contact_lead':var _0x1da19e=_[_0x4120('0x35')](_0x5bcdc6);if(_0x293df5[_0x4120('0x36')]){var _0x1ece07={};_0x1ece07[_0x293df5[_0x4120('0x36')]]=_0x5ca6be;_[_0x4120('0x30')](_0x1da19e[_0x4120('0x31')],_0x1ece07);}return _0x288518['sobject'](_0x4120('0x37'))['find'](_0x1da19e,_0x17b965)[_0x4120('0x38')]()['then'](function(_0x375988){if(_0x375988&&_0x375988['length']){return _0x375988;}else{var _0x2c1743=_[_0x4120('0x35')](_0x5bcdc6);if(_0x293df5['additionalSearchContact']){var _0x5b37e7={};_0x5b37e7[_0x293df5['additionalSearchContact']]=_0x5ca6be;_[_0x4120('0x30')](_0x2c1743[_0x4120('0x31')],_0x5b37e7);}return _0x288518[_0x4120('0x23')](_0x4120('0x32'))[_0x4120('0x26')](_0x2c1743,_0x17b965)['then'](function(_0x3d4d04){if(_0x3d4d04&&_0x3d4d04[_0x4120('0x25')]){return _0x3d4d04;}else{var _0x57ac64=_[_0x4120('0x35')](_0x5bcdc6);if(_0x293df5[_0x4120('0x33')]){var _0x194b88={};_0x194b88[_0x293df5[_0x4120('0x33')]]=_0x5ca6be;_[_0x4120('0x30')](_0x57ac64[_0x4120('0x31')],_0x194b88);}return _0x288518[_0x4120('0x23')](_0x4120('0x34'))[_0x4120('0x26')](_0x57ac64,_0x17b965);}});}});case'contact':var _0x3bd1d1=_[_0x4120('0x35')](_0x5bcdc6);if(_0x293df5['additionalSearchContact']){var _0x1ece07={};_0x1ece07[_0x293df5[_0x4120('0x39')]]=_0x5ca6be;_['merge'](_0x3bd1d1['$or'],_0x1ece07);}return _0x288518['sobject'](_0x4120('0x32'))[_0x4120('0x26')](_0x3bd1d1,_0x17b965)['execute']();case _0x4120('0x1d'):var _0x36b924=_[_0x4120('0x35')](_0x5bcdc6);if(_0x293df5['additionalSearchLead']){var _0x1ece07={};_0x1ece07[_0x293df5[_0x4120('0x33')]]=_0x5ca6be;_[_0x4120('0x30')](_0x36b924[_0x4120('0x31')],_0x1ece07);}return _0x288518[_0x4120('0x23')](_0x4120('0x34'))[_0x4120('0x26')](_0x36b924,_0x17b965);case _0x4120('0x19'):var _0x1da19e=_[_0x4120('0x35')](_0x5bcdc6);if(_0x293df5['additionalSearchAccount']){var _0x1ece07={};_0x1ece07[_0x293df5[_0x4120('0x36')]]=_0x5ca6be;_[_0x4120('0x30')](_0x1da19e[_0x4120('0x31')],_0x1ece07);}return _0x288518[_0x4120('0x23')](_0x4120('0x37'))[_0x4120('0x26')](_0x1da19e,_0x17b965);default:return null;}})[_0x4120('0x24')](function(_0x3bdb5e){if(_0x3bdb5e&&_0x3bdb5e[_0x4120('0x25')]){var _0x2fefb8=_[_0x4120('0x3a')](_0x3bdb5e);if(_0x2fefb8){return BPromise[_0x4120('0x28')]({'id':_0x2fefb8['Id'],'name':_0x2fefb8[_0x4120('0x29')],'phone':_0x2fefb8[_0x4120('0x3b')],'endUserType':_0x2fefb8['attributes'][_0x4120('0x3c')][_0x4120('0x3d')]()});}}})[_0x4120('0x24')](function(_0x2d4278){if(_0x2d4278){logger[_0x4120('0x1f')](_0x4120('0x3e'),_0x2d4278[_0x4120('0x16')],_0x5ca6be);return BPromise['resolve'](_0x2d4278);}else{logger[_0x4120('0x1f')](_0x4120('0x3f'),_0x5ca6be);var _0x35eaa6={'Phone':_0x5ca6be};if(_0x293df5[_0x4120('0x40')]){if(_0x293df5[_0x4120('0x40')]===_0x4120('0x17')){logger[_0x4120('0x1f')](_0x4120('0x41'),_0x5ca6be,_0x293df5[_0x4120('0x40')]);_0x35eaa6[_0x4120('0x42')]=_0x4d200a!==''?_0x4d200a:util[_0x4120('0x43')](_0x4120('0x44'),_0x5ca6be);}else if(_0x293df5['moduleCreate']===_0x4120('0x1d')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5ca6be,_0x293df5[_0x4120('0x40')]);_0x35eaa6[_0x4120('0x42')]=_0x4d200a!==''?_0x4d200a:util[_0x4120('0x43')](_0x4120('0x44'),_0x5ca6be);_0x35eaa6[_0x4120('0x45')]=_0x4120('0x46');}else if(_0x293df5[_0x4120('0x40')]===_0x4120('0x19')){logger[_0x4120('0x1f')](_0x4120('0x41'),_0x5ca6be,_0x293df5['moduleCreate']);_0x35eaa6['Name']=_0x4d200a!==''?_0x4d200a:util['format']('Caller\x20-\x20%s',_0x5ca6be);}else{return null;}}return _0x288518[_0x4120('0x23')](_[_0x4120('0x47')](_0x293df5[_0x4120('0x40')]))[_0x4120('0x21')](_0x35eaa6)[_0x4120('0x24')](function(_0xe2572a){return BPromise['resolve']({'id':_0xe2572a['id'],'endUserType':_0x293df5[_0x4120('0x40')]});});}});}function getCustomFields(_0x94145a,_0x31ccdf){var _0x1b79b9={};if(_0x94145a['length']>0x0){_['forEach'](_0x94145a,function(_0x758e91){if(_[_0x4120('0x48')](['string',_0x4120('0x49')],_0x758e91[_0x4120('0x3c')])&&_0x758e91['idField']){_0x1b79b9[_0x758e91['idField']]=_0x758e91['content'][_0x4120('0x4a')]();}else if(_0x758e91[_0x4120('0x3c')]===_0x4120('0x4b')&&_0x758e91[_0x4120('0x4c')]&&_0x758e91[_0x4120('0x4d')]){_0x31ccdf[_0x758e91[_0x4120('0x4c')]]&&(_0x1b79b9[_0x758e91[_0x4120('0x4d')]]=_0x31ccdf[_0x758e91[_0x4120('0x4c')]][_0x4120('0x4a')]());}else if(_0x758e91[_0x4120('0x3c')]===_0x4120('0x4e')&&_0x758e91[_0x4120('0x4f')]&&_0x758e91[_0x4120('0x4f')][_0x4120('0x50')]&&_0x758e91[_0x4120('0x4d')]){_0x31ccdf[_0x758e91['Variable'][_0x4120('0x50')][_0x4120('0x3d')]()]&&(_0x1b79b9[_0x758e91[_0x4120('0x4d')]]=_0x31ccdf[_0x758e91['Variable']['name'][_0x4120('0x3d')]()][_0x4120('0x4a')]());}});}return _0x1b79b9;}function getConnection(_0x48dd12){var _0xd87e6=_0x48dd12['password'][_0x4120('0x51')](_0x48dd12[_0x4120('0x52')]);var _0x4acc57=new jsforce[(_0x4120('0x53'))]({'oauth2':{'loginUrl':_0x48dd12[_0x4120('0x54')]||_0x4120('0x55'),'clientId':_0x48dd12[_0x4120('0x56')],'clientSecret':_0x48dd12['clientSecret']}});return _0x4acc57[_0x4120('0x57')](_0x48dd12['username'],_0xd87e6)['then'](function(){logger['info'](_0x4120('0x58'));return _0x4acc57;});}exports[_0x4120('0x59')]=function(_0x2b581b,_0x300f28,_0x4a1ae8,_0x209f3c,_0x46bda1,_0x507072){var _0x54892a,_0x5473e8,_0xc34862,_0x11e3db;_0x507072['serverUrl']=intUtil[_0x4120('0x5a')](_0x507072[_0x4120('0x5b')]);_0x507072[_0x4120('0x54')]=intUtil['stripTrailingSlash'](_0x507072[_0x4120('0x54')]);if(_0x46bda1&&_0x46bda1[_0x4120('0x5c')]){logger[_0x4120('0x1f')](_0x4120('0x5d'),_0x4120('0x5e'));_0x300f28['recordingURL']=util[_0x4120('0x43')](_0x4120('0x5f'),_0x507072['serverUrl'],_0x300f28[_0x4120('0x60')],md5(_0x300f28['uniqueid']));}else{_0x300f28[_0x4120('0x61')]='';}return getConnection(_0x507072)[_0x4120('0x24')](function(_0x1282a9){_0x11e3db=_0x1282a9;return getUser(_0x507072,_0x209f3c[_0x4120('0x62')],_0x11e3db);})[_0x4120('0x24')](function(_0x2cb284){_0x54892a=_0x2cb284;return getEndUser(_0x507072,_0x4a1ae8,_0x300f28[_0x4120('0x63')],_0x300f28[_0x4120('0x64')],_0x11e3db);})[_0x4120('0x24')](function(_0x121470){_0x5473e8=_0x121470;return getTicket(_0x507072,_0x54892a,_0x5473e8,_0x4a1ae8,_0x300f28,_0x4a1ae8[_0x4120('0x65')],_0x11e3db,_0x4120('0x59'));})[_0x4120('0x24')](function(_0x3f4748){_0xc34862=_0x3f4748;logger[_0x4120('0x1f')](_0x4120('0x66'),_0xc34862['id']);logger[_0x4120('0x1f')](_0x4120('0x67'),_0xc34862['id'],_0x209f3c[_0x4120('0x50')],_0x507072[_0x4120('0x3c')]);switch(_0x507072[_0x4120('0x3c')]){case _0x4120('0x68'):emit(util[_0x4120('0x43')](_0x4120('0x69'),_0x209f3c[_0x4120('0x50')]),_0x4120('0x6a'),{'recordId':_0xc34862['id']});break;case _0x4120('0x6b'):emit(util[_0x4120('0x43')]('user:%s',_0x209f3c[_0x4120('0x50')]),_0x4120('0x6c'),{'uri':util[_0x4120('0x43')](_0x4120('0x6d'),_0x11e3db[_0x4120('0x6e')],_0xc34862['id'])});break;default:logger[_0x4120('0x6f')](_0x4120('0x70'));}})['catch'](function(_0x53e68b){logger['error'](_0x4120('0x5d'),_0x53e68b);});};exports[_0x4120('0x71')]=function(_0x226012,_0x2c8c15,_0x4e6d49,_0x483970,_0x440486,_0x4072b3,_0x5a58c7){var _0x58416d,_0x3d9c10,_0x1ababb,_0x3ef124;_0x4072b3[_0x4120('0x5b')]=intUtil[_0x4120('0x5a')](_0x4072b3[_0x4120('0x5b')]);_0x4072b3[_0x4120('0x54')]=intUtil[_0x4120('0x5a')](_0x4072b3[_0x4120('0x54')]);if(_0x5a58c7&&_0x5a58c7[_0x4120('0x72')]&&_0x5a58c7[_0x4120('0x72')]!==_0x4120('0x73')){logger[_0x4120('0x1f')](_0x4120('0x74'),_0x4120('0x5e'));_0x2c8c15[_0x4120('0x61')]=util['format'](_0x4120('0x5f'),_0x4072b3['serverUrl'],_0x2c8c15[_0x4120('0x60')],md5(_0x2c8c15['uniqueid']));}return getConnection(_0x4072b3)[_0x4120('0x24')](function(_0x4d9059){_0x3ef124=_0x4d9059;return getUser(_0x4072b3,_0x483970[_0x4120('0x62')],_0x3ef124);})[_0x4120('0x24')](function(_0x185854){_0x58416d=_0x185854;return getEndUser(_0x4072b3,_0x4e6d49,_0x2c8c15[_0x4120('0x75')],_0x2c8c15[_0x4120('0x76')],_0x3ef124);})[_0x4120('0x24')](function(_0x202dc7){_0x3d9c10=_0x202dc7;return getTicket(_0x4072b3,_0x58416d,_0x3d9c10,_0x4e6d49,_0x2c8c15,_0x4e6d49[_0x4120('0x65')],_0x3ef124,_0x4120('0x71'));})['then'](function(_0x360703){_0x1ababb=_0x360703;logger[_0x4120('0x1f')](_0x4120('0x77'),_0x1ababb['id']);logger[_0x4120('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1ababb['id'],_0x483970['name'],_0x4072b3[_0x4120('0x3c')]);switch(_0x4072b3['type']){case'integrationTab':emit(util[_0x4120('0x43')](_0x4120('0x69'),_0x483970['name']),'trigger:salesforce:display',{'recordId':_0x1ababb['id']});break;case _0x4120('0x6b'):emit(util[_0x4120('0x43')](_0x4120('0x69'),_0x483970[_0x4120('0x50')]),_0x4120('0x6c'),{'uri':util[_0x4120('0x43')](_0x4120('0x6d'),_0x3ef124[_0x4120('0x6e')],_0x1ababb['id'])});break;default:logger[_0x4120('0x6f')]('[OUTBOUND]',_0x4120('0x78'));}})[_0x4120('0x79')](function(_0x3d8e8b){logger['error'](_0x4120('0x74'),_0x3d8e8b);});};exports[_0x4120('0x7a')]=function(_0x317fa9,_0x49ff1a,_0x166e58,_0x30bcfb,_0x29d66f,_0x32b925){var _0x3c424f,_0x1ebd38,_0x15e344,_0x1e5071;_0x32b925[_0x4120('0x5b')]=intUtil[_0x4120('0x5a')](_0x32b925[_0x4120('0x5b')]);_0x32b925['remoteUri']=intUtil['stripTrailingSlash'](_0x32b925[_0x4120('0x54')]);if(_0x29d66f&&_0x29d66f['monitor_format']){logger['info']('['+_0x49ff1a['lastevent'][_0x4120('0x7b')]()+']',_0x4120('0x5e'));_0x49ff1a[_0x4120('0x61')]=util[_0x4120('0x43')](_0x4120('0x5f'),_0x32b925[_0x4120('0x5b')],_0x49ff1a['uniqueid'],md5(_0x49ff1a[_0x4120('0x60')]));}else{_0x49ff1a[_0x4120('0x61')]='';}return getConnection(_0x32b925)['then'](function(_0x1d9fe7){_0x1e5071=_0x1d9fe7;if(!_[_0x4120('0x22')](_0x30bcfb)){return getUser(_0x32b925,_0x30bcfb[_0x4120('0x50')],_0x1e5071);}else{return getUser(_0x32b925,null,_0x1e5071);}})[_0x4120('0x24')](function(_0xd4f870){_0x3c424f=_0xd4f870;return getEndUser(_0x32b925,_0x166e58,_0x49ff1a[_0x4120('0x63')],_0x49ff1a[_0x4120('0x64')],_0x1e5071);})[_0x4120('0x24')](function(_0x34d534){_0x1ebd38=_0x34d534;return getTicket(_0x32b925,_0x3c424f,_0x1ebd38,_0x166e58,_0x49ff1a,_0x166e58[_0x4120('0x65')],_0x1e5071);})[_0x4120('0x24')](function(_0x310e6a){_0x15e344=_0x310e6a;logger[_0x4120('0x1f')]('['+_0x49ff1a[_0x4120('0x7c')][_0x4120('0x7b')]()+']\x20Ticket\x20%s\x20created.',_0x15e344['id']);logger['info']('['+_0x49ff1a[_0x4120('0x7c')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x32b925[_0x4120('0x3c')]);})['catch'](function(_0x62932f){logger[_0x4120('0x6f')]('['+_0x49ff1a[_0x4120('0x7c')][_0x4120('0x7b')]()+']',_0x62932f);});}; \ No newline at end of file +var _0xa848=['lastevent','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','toUpperCase','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Descriptions','ActivityDate','utc','WhoId','endUserType','account','WhatId','Case','AccountId','lead','leadId','info','ticketType','isNil','validateEmail','sobject','User','find','then','length','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','merge','$or','execute','additionalSearchLead','account_contact_lead','cloneDeep','additionalSearchAccount','Account','additionalSearchContact','Contact','Lead','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','contact','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','create','forEach','includes','string','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','https://login.salesforce.com','username','Connection\x20established.','queue','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','[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.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged'];(function(_0x194797,_0x40c56e){var _0x2d2177=function(_0x410fdb){while(--_0x410fdb){_0x194797['push'](_0x194797['shift']());}};_0x2d2177(++_0x40c56e);}(_0xa848,0x107));var _0x8a84=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa848[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x8a84('0x0'));var rp=require(_0x8a84('0x1'));var moment=require(_0x8a84('0x2'));var BPromise=require(_0x8a84('0x3'));var md5=require(_0x8a84('0x4'));var jsforce=require(_0x8a84('0x5'));var util=require(_0x8a84('0x6'));var Redis=require(_0x8a84('0x7'));var intUtil=require(_0x8a84('0x8'));var config=require(_0x8a84('0x9'));var logger=require(_0x8a84('0xa'))(_0x8a84('0xb'));config[_0x8a84('0xc')]=_[_0x8a84('0xd')](config[_0x8a84('0xc')],{'host':_0x8a84('0xe'),'port':0x18eb});var io=require(_0x8a84('0xf'))(new Redis(config['redis']));function emit(_0x26d292,_0x402f41,_0x35386b){io['to'](_0x26d292)[_0x8a84('0x10')](_0x402f41,_0x35386b);}function getTicket(_0x4f412e,_0x2277e2,_0x5b1a5e,_0x346dc6,_0x50f1fe,_0x18b2f3,_0x58da9d,_0x4e319d){var _0x2f48ab=Object['assign']({},{'OwnerId':_0x2277e2['id'],'Subject':intUtil[_0x8a84('0x11')](_0x346dc6['Subjects'],_0x50f1fe,'\x20'),'Description':intUtil[_0x8a84('0x11')](_0x346dc6[_0x8a84('0x12')],_0x50f1fe,'\x0a')},getCustomFields(_0x18b2f3,_0x50f1fe));if(_0x5b1a5e){if(_0x346dc6['ticketType']==='Task'){_0x2f48ab[_0x8a84('0x13')]=moment[_0x8a84('0x14')]();_0x2f48ab['IsReminderSet']=![];_0x2f48ab['IsRecurrence']=![];if(_0x5b1a5e['endUserType']==='contact'||_0x5b1a5e['endUserType']==='lead'){_0x2f48ab[_0x8a84('0x15')]=_0x5b1a5e['id'];}else if(_0x5b1a5e[_0x8a84('0x16')]===_0x8a84('0x17')){_0x2f48ab[_0x8a84('0x18')]=_0x5b1a5e['id'];}}else if(_0x346dc6['ticketType']===_0x8a84('0x19')){if(_0x5b1a5e[_0x8a84('0x16')]==='contact'){_0x2f48ab['ContactId']=_0x5b1a5e['id'];}else if(_0x5b1a5e['endUserType']===_0x8a84('0x17')){_0x2f48ab[_0x8a84('0x1a')]=_0x5b1a5e['id'];}else if(_0x5b1a5e[_0x8a84('0x16')]===_0x8a84('0x1b')&&_0x346dc6[_0x8a84('0x1c')]){_0x2f48ab[_0x346dc6['leadId']]=_0x5b1a5e['id'];}else{logger[_0x8a84('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x58da9d['sobject'](_0x346dc6[_0x8a84('0x1e')])['create'](_0x2f48ab);}function getUser(_0x186f2e,_0x4f42eb,_0xb6091a){if(!_[_0x8a84('0x1f')](_0x4f42eb)&&intUtil[_0x8a84('0x20')](_0x4f42eb)){var _0x358578={'Email':_0x4f42eb};var _0x36d3b0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xb6091a[_0x8a84('0x21')](_0x8a84('0x22'))[_0x8a84('0x23')](_0x358578,_0x36d3b0)['execute']()[_0x8a84('0x24')](function(_0x46682e){if(_0x46682e[_0x8a84('0x25')]){var _0x10ed06=_[_0x8a84('0x23')](_0x46682e,function(_0x2dcc65){return _0x2dcc65['Email']===_0x4f42eb;});if(_0x10ed06){logger['info'](_0x8a84('0x26'),_0x4f42eb);return BPromise[_0x8a84('0x27')]({'id':_0x10ed06['Id'],'name':_0x10ed06['Name']});}}else{logger[_0x8a84('0x1d')](_0x8a84('0x28'),_0x4f42eb);return _0xb6091a[_0x8a84('0x29')]()[_0x8a84('0x24')](function(_0x1e043c){return BPromise[_0x8a84('0x27')]({'id':_0x1e043c[_0x8a84('0x2a')],'name':_0x1e043c['display_name']});});}});}else{logger[_0x8a84('0x1d')](_0x8a84('0x28'),_0x4f42eb);return _0xb6091a[_0x8a84('0x29')]()['then'](function(_0x3accaf){return BPromise[_0x8a84('0x27')]({'id':_0x3accaf[_0x8a84('0x2a')],'name':_0x3accaf['display_name']});});}}function getEndUser(_0x529e14,_0x325d5c,_0x26817d,_0x560f9f,_0x2a15bb){var _0x566446={'$or':{'Phone':_0x560f9f}};var _0x4dea08={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x8a84('0x24')](function(){logger[_0x8a84('0x1d')](_0x8a84('0x2b'),_0x560f9f,_0x325d5c[_0x8a84('0x2c')]);switch(_0x325d5c[_0x8a84('0x2c')]){case _0x8a84('0x2d'):var _0x507267=_['cloneDeep'](_0x566446);if(_0x325d5c['additionalSearchContact']){var _0x115e1f={};_0x115e1f[_0x325d5c['additionalSearchContact']]=_0x560f9f;_[_0x8a84('0x2e')](_0x507267[_0x8a84('0x2f')],_0x115e1f);}return _0x2a15bb[_0x8a84('0x21')]('Contact')[_0x8a84('0x23')](_0x507267,_0x4dea08)[_0x8a84('0x30')]()['then'](function(_0x5e6f3e){if(_0x5e6f3e&&_0x5e6f3e[_0x8a84('0x25')]){return _0x5e6f3e;}else{var _0x2f94ce=_['cloneDeep'](_0x566446);if(_0x325d5c[_0x8a84('0x31')]){var _0x5c2751={};_0x5c2751[_0x325d5c[_0x8a84('0x31')]]=_0x560f9f;_[_0x8a84('0x2e')](_0x2f94ce[_0x8a84('0x2f')],_0x5c2751);}return _0x2a15bb[_0x8a84('0x21')]('Lead')['find'](_0x2f94ce,_0x4dea08);}});case _0x8a84('0x32'):var _0x35e837=_[_0x8a84('0x33')](_0x566446);if(_0x325d5c[_0x8a84('0x34')]){var _0x115e1f={};_0x115e1f[_0x325d5c['additionalSearchAccount']]=_0x560f9f;_[_0x8a84('0x2e')](_0x35e837['$or'],_0x115e1f);}return _0x2a15bb['sobject'](_0x8a84('0x35'))[_0x8a84('0x23')](_0x35e837,_0x4dea08)[_0x8a84('0x30')]()[_0x8a84('0x24')](function(_0x446634){if(_0x446634&&_0x446634['length']){return _0x446634;}else{var _0xc8e85c=_['cloneDeep'](_0x566446);if(_0x325d5c[_0x8a84('0x36')]){var _0x17c1e8={};_0x17c1e8[_0x325d5c[_0x8a84('0x36')]]=_0x560f9f;_[_0x8a84('0x2e')](_0xc8e85c[_0x8a84('0x2f')],_0x17c1e8);}return _0x2a15bb['sobject'](_0x8a84('0x37'))['find'](_0xc8e85c,_0x4dea08)['then'](function(_0x3ff823){if(_0x3ff823&&_0x3ff823[_0x8a84('0x25')]){return _0x3ff823;}else{var _0x1b674e=_[_0x8a84('0x33')](_0x566446);if(_0x325d5c['additionalSearchLead']){var _0x1b662f={};_0x1b662f[_0x325d5c[_0x8a84('0x31')]]=_0x560f9f;_[_0x8a84('0x2e')](_0x1b674e[_0x8a84('0x2f')],_0x1b662f);}return _0x2a15bb['sobject'](_0x8a84('0x38'))[_0x8a84('0x23')](_0x1b674e,_0x4dea08);}});}});case'contact':var _0x507267=_[_0x8a84('0x33')](_0x566446);if(_0x325d5c[_0x8a84('0x36')]){var _0x115e1f={};_0x115e1f[_0x325d5c['additionalSearchContact']]=_0x560f9f;_[_0x8a84('0x2e')](_0x507267[_0x8a84('0x2f')],_0x115e1f);}return _0x2a15bb[_0x8a84('0x21')](_0x8a84('0x37'))[_0x8a84('0x23')](_0x507267,_0x4dea08)[_0x8a84('0x30')]();case _0x8a84('0x1b'):var _0x7f3142=_['cloneDeep'](_0x566446);if(_0x325d5c['additionalSearchLead']){var _0x115e1f={};_0x115e1f[_0x325d5c[_0x8a84('0x31')]]=_0x560f9f;_[_0x8a84('0x2e')](_0x7f3142[_0x8a84('0x2f')],_0x115e1f);}return _0x2a15bb[_0x8a84('0x21')](_0x8a84('0x38'))[_0x8a84('0x23')](_0x7f3142,_0x4dea08);case _0x8a84('0x17'):var _0x35e837=_['cloneDeep'](_0x566446);if(_0x325d5c[_0x8a84('0x34')]){var _0x115e1f={};_0x115e1f[_0x325d5c[_0x8a84('0x34')]]=_0x560f9f;_[_0x8a84('0x2e')](_0x35e837[_0x8a84('0x2f')],_0x115e1f);}return _0x2a15bb[_0x8a84('0x21')]('Account')['find'](_0x35e837,_0x4dea08);default:return null;}})['then'](function(_0x52b5a0){if(_0x52b5a0&&_0x52b5a0[_0x8a84('0x25')]){var _0x1d76ed=_[_0x8a84('0x39')](_0x52b5a0);if(_0x1d76ed){return BPromise['resolve']({'id':_0x1d76ed['Id'],'name':_0x1d76ed[_0x8a84('0x3a')],'phone':_0x1d76ed[_0x8a84('0x3b')],'endUserType':_0x1d76ed[_0x8a84('0x3c')][_0x8a84('0x3d')][_0x8a84('0x3e')]()});}}})[_0x8a84('0x24')](function(_0x18731b){if(_0x18731b){logger['info'](_0x8a84('0x3f'),_0x18731b[_0x8a84('0x16')],_0x560f9f);return BPromise[_0x8a84('0x27')](_0x18731b);}else{logger[_0x8a84('0x1d')](_0x8a84('0x40'),_0x560f9f);var _0x19f9fe={'Phone':_0x560f9f};if(_0x325d5c[_0x8a84('0x41')]){if(_0x325d5c[_0x8a84('0x41')]===_0x8a84('0x42')){logger[_0x8a84('0x1d')](_0x8a84('0x43'),_0x560f9f,_0x325d5c[_0x8a84('0x41')]);_0x19f9fe[_0x8a84('0x44')]=_0x26817d!==_0x8a84('0x45')?_0x26817d:util[_0x8a84('0x46')](_0x8a84('0x47'),_0x560f9f);}else if(_0x325d5c[_0x8a84('0x41')]===_0x8a84('0x1b')){logger[_0x8a84('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x560f9f,_0x325d5c[_0x8a84('0x41')]);_0x19f9fe[_0x8a84('0x44')]=_0x26817d!==_0x8a84('0x45')?_0x26817d:util[_0x8a84('0x46')](_0x8a84('0x47'),_0x560f9f);_0x19f9fe[_0x8a84('0x48')]='No\x20Company';}else if(_0x325d5c[_0x8a84('0x41')]===_0x8a84('0x17')){logger[_0x8a84('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x560f9f,_0x325d5c[_0x8a84('0x41')]);_0x19f9fe[_0x8a84('0x3a')]=_0x26817d!==''?_0x26817d:util['format'](_0x8a84('0x47'),_0x560f9f);}else{return null;}}return _0x2a15bb[_0x8a84('0x21')](_['upperFirst'](_0x325d5c[_0x8a84('0x41')]))[_0x8a84('0x49')](_0x19f9fe)[_0x8a84('0x24')](function(_0x20e2c3){return BPromise['resolve']({'id':_0x20e2c3['id'],'endUserType':_0x325d5c[_0x8a84('0x41')]});});}});}function getCustomFields(_0x48bf70,_0x441cef){var _0xcb303c={};if(_0x48bf70[_0x8a84('0x25')]>0x0){_[_0x8a84('0x4a')](_0x48bf70,function(_0x1759eb){if(_[_0x8a84('0x4b')]([_0x8a84('0x4c'),'picklist'],_0x1759eb[_0x8a84('0x3d')])&&_0x1759eb[_0x8a84('0x4d')]){_0xcb303c[_0x1759eb[_0x8a84('0x4d')]]=_0x1759eb[_0x8a84('0x4e')]['toString']();}else if(_0x1759eb[_0x8a84('0x3d')]===_0x8a84('0x4f')&&_0x1759eb[_0x8a84('0x50')]&&_0x1759eb[_0x8a84('0x4d')]){_0x441cef[_0x1759eb[_0x8a84('0x50')]]&&(_0xcb303c[_0x1759eb[_0x8a84('0x4d')]]=_0x441cef[_0x1759eb[_0x8a84('0x50')]][_0x8a84('0x51')]());}else if(_0x1759eb[_0x8a84('0x3d')]===_0x8a84('0x52')&&_0x1759eb[_0x8a84('0x53')]&&_0x1759eb['Variable']['name']&&_0x1759eb[_0x8a84('0x4d')]){_0x441cef[_0x1759eb[_0x8a84('0x53')]['name'][_0x8a84('0x3e')]()]&&(_0xcb303c[_0x1759eb['idField']]=_0x441cef[_0x1759eb[_0x8a84('0x53')][_0x8a84('0x54')][_0x8a84('0x3e')]()][_0x8a84('0x51')]());}});}return _0xcb303c;}function getConnection(_0x132386){var _0xee8e48=_0x132386[_0x8a84('0x55')][_0x8a84('0x56')](_0x132386['securityToken']);var _0x3fc8ad=new jsforce['Connection']({'oauth2':{'loginUrl':_0x132386['remoteUri']||_0x8a84('0x57'),'clientId':_0x132386['clientId'],'clientSecret':_0x132386['clientSecret']}});return _0x3fc8ad['login'](_0x132386[_0x8a84('0x58')],_0xee8e48)[_0x8a84('0x24')](function(){logger[_0x8a84('0x1d')](_0x8a84('0x59'));return _0x3fc8ad;});}exports[_0x8a84('0x5a')]=function(_0x2eccd8,_0x223967,_0x3dbb4f,_0x33cd4e,_0xa1a96d,_0x29689f){var _0x1c59b6,_0x3e05a9,_0xe95bf7,_0x3caa6f;_0x29689f[_0x8a84('0x5b')]=intUtil['stripTrailingSlash'](_0x29689f[_0x8a84('0x5b')]);_0x29689f[_0x8a84('0x5c')]=intUtil[_0x8a84('0x5d')](_0x29689f[_0x8a84('0x5c')]);if(_0xa1a96d&&_0xa1a96d[_0x8a84('0x5e')]){logger[_0x8a84('0x1d')](_0x8a84('0x5f'),'Recording\x20is\x20enabled!');_0x223967[_0x8a84('0x60')]=util[_0x8a84('0x46')](_0x8a84('0x61'),_0x29689f['serverUrl'],_0x223967[_0x8a84('0x62')],md5(_0x223967[_0x8a84('0x62')]));}else{_0x223967[_0x8a84('0x60')]='';}return getConnection(_0x29689f)['then'](function(_0x242406){_0x3caa6f=_0x242406;return getUser(_0x29689f,_0x33cd4e[_0x8a84('0x63')],_0x3caa6f);})[_0x8a84('0x24')](function(_0x169ff7){_0x1c59b6=_0x169ff7;return getEndUser(_0x29689f,_0x3dbb4f,_0x223967['calleridname'],_0x223967[_0x8a84('0x64')],_0x3caa6f);})[_0x8a84('0x24')](function(_0x4be411){_0x3e05a9=_0x4be411;return getTicket(_0x29689f,_0x1c59b6,_0x3e05a9,_0x3dbb4f,_0x223967,_0x3dbb4f[_0x8a84('0x65')],_0x3caa6f,_0x8a84('0x5a'));})['then'](function(_0x40f88a){_0xe95bf7=_0x40f88a;logger['info'](_0x8a84('0x66'),_0xe95bf7['id']);logger['info'](_0x8a84('0x67'),_0xe95bf7['id'],_0x33cd4e['name'],_0x29689f['type']);switch(_0x29689f['type']){case _0x8a84('0x68'):emit(util[_0x8a84('0x46')](_0x8a84('0x69'),_0x33cd4e[_0x8a84('0x54')]),_0x8a84('0x6a'),{'recordId':_0xe95bf7['id']});break;case _0x8a84('0x6b'):emit(util[_0x8a84('0x46')]('user:%s',_0x33cd4e[_0x8a84('0x54')]),_0x8a84('0x6c'),{'uri':util['format'](_0x8a84('0x6d'),_0x3caa6f[_0x8a84('0x6e')],_0xe95bf7['id'])});break;default:logger['error'](_0x8a84('0x6f'));}})[_0x8a84('0x70')](function(_0x611bab){logger[_0x8a84('0x71')](_0x8a84('0x5f'),_0x611bab);});};exports[_0x8a84('0x72')]=function(_0x537dde,_0x5bc74a,_0x3be86c,_0x7d5af5,_0x424b9,_0x498dc6,_0x260347){var _0x15042b,_0x4f14a0,_0x405c68,_0x3a851c;_0x498dc6[_0x8a84('0x5b')]=intUtil[_0x8a84('0x5d')](_0x498dc6[_0x8a84('0x5b')]);_0x498dc6['remoteUri']=intUtil[_0x8a84('0x5d')](_0x498dc6['remoteUri']);if(_0x260347&&_0x260347[_0x8a84('0x73')]&&_0x260347[_0x8a84('0x73')]!=='none'){logger[_0x8a84('0x1d')](_0x8a84('0x74'),_0x8a84('0x75'));_0x5bc74a['recordingURL']=util[_0x8a84('0x46')](_0x8a84('0x61'),_0x498dc6[_0x8a84('0x5b')],_0x5bc74a[_0x8a84('0x62')],md5(_0x5bc74a[_0x8a84('0x62')]));}return getConnection(_0x498dc6)[_0x8a84('0x24')](function(_0x1e8767){_0x3a851c=_0x1e8767;return getUser(_0x498dc6,_0x7d5af5[_0x8a84('0x63')],_0x3a851c);})['then'](function(_0x20bd24){_0x15042b=_0x20bd24;return getEndUser(_0x498dc6,_0x3be86c,_0x5bc74a[_0x8a84('0x76')],_0x5bc74a[_0x8a84('0x77')],_0x3a851c);})[_0x8a84('0x24')](function(_0x2a2e8e){_0x4f14a0=_0x2a2e8e;return getTicket(_0x498dc6,_0x15042b,_0x4f14a0,_0x3be86c,_0x5bc74a,_0x3be86c[_0x8a84('0x65')],_0x3a851c,_0x8a84('0x72'));})['then'](function(_0x200777){_0x405c68=_0x200777;logger['info'](_0x8a84('0x78'),_0x405c68['id']);logger[_0x8a84('0x1d')](_0x8a84('0x79'),_0x405c68['id'],_0x7d5af5['name'],_0x498dc6[_0x8a84('0x3d')]);switch(_0x498dc6[_0x8a84('0x3d')]){case _0x8a84('0x68'):emit(util['format'](_0x8a84('0x69'),_0x7d5af5['name']),'trigger:salesforce:display',{'recordId':_0x405c68['id']});break;case _0x8a84('0x6b'):emit(util[_0x8a84('0x46')](_0x8a84('0x69'),_0x7d5af5[_0x8a84('0x54')]),'trigger:browser:url',{'uri':util['format'](_0x8a84('0x6d'),_0x3a851c[_0x8a84('0x6e')],_0x405c68['id'])});break;default:logger[_0x8a84('0x71')](_0x8a84('0x74'),_0x8a84('0x7a'));}})[_0x8a84('0x70')](function(_0x222463){logger[_0x8a84('0x71')]('[OUTBOUND]',_0x222463);});};exports[_0x8a84('0x7b')]=function(_0x1194cd,_0x2dc93a,_0xadb6d4,_0x29c59c,_0x3c474a,_0x53aa29){var _0x2126a8,_0x37f8b4,_0x10005e,_0x40111e;_0x53aa29[_0x8a84('0x5b')]=intUtil['stripTrailingSlash'](_0x53aa29[_0x8a84('0x5b')]);_0x53aa29[_0x8a84('0x5c')]=intUtil[_0x8a84('0x5d')](_0x53aa29['remoteUri']);if(_0x3c474a&&_0x3c474a[_0x8a84('0x5e')]){logger[_0x8a84('0x1d')]('['+_0x2dc93a[_0x8a84('0x7c')]['toUpperCase']()+']',_0x8a84('0x75'));_0x2dc93a[_0x8a84('0x60')]=util[_0x8a84('0x46')](_0x8a84('0x61'),_0x53aa29[_0x8a84('0x5b')],_0x2dc93a[_0x8a84('0x62')],md5(_0x2dc93a['uniqueid']));}else{_0x2dc93a['recordingURL']='';}return getConnection(_0x53aa29)[_0x8a84('0x24')](function(_0x10bba5){_0x40111e=_0x10bba5;if(!_[_0x8a84('0x1f')](_0x29c59c)){return getUser(_0x53aa29,_0x29c59c[_0x8a84('0x54')],_0x40111e);}else{return getUser(_0x53aa29,null,_0x40111e);}})[_0x8a84('0x24')](function(_0x3b3187){_0x2126a8=_0x3b3187;return getEndUser(_0x53aa29,_0xadb6d4,_0x2dc93a[_0x8a84('0x7d')],_0x2dc93a[_0x8a84('0x64')],_0x40111e);})[_0x8a84('0x24')](function(_0x3f724a){_0x37f8b4=_0x3f724a;return getTicket(_0x53aa29,_0x2126a8,_0x37f8b4,_0xadb6d4,_0x2dc93a,_0xadb6d4[_0x8a84('0x65')],_0x40111e);})[_0x8a84('0x24')](function(_0x1d403c){_0x10005e=_0x1d403c;logger[_0x8a84('0x1d')]('['+_0x2dc93a[_0x8a84('0x7c')]['toUpperCase']()+_0x8a84('0x7e'),_0x10005e['id']);logger[_0x8a84('0x1d')]('['+_0x2dc93a[_0x8a84('0x7c')]['toUpperCase']()+_0x8a84('0x7f'),_0x53aa29[_0x8a84('0x3d')]);})[_0x8a84('0x70')](function(_0x2d93b2){logger[_0x8a84('0x71')]('['+_0x2dc93a['lastevent'][_0x8a84('0x80')]()+']',_0x2d93b2);});}; \ 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 4eeff02..9ee2d44 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 _0x7745=['info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketNumber','push','all','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message'];(function(_0x238211,_0x34249c){var _0x37b320=function(_0x13e67d){while(--_0x13e67d){_0x238211['push'](_0x238211['shift']());}};_0x37b320(++_0x34249c);}(_0x7745,0xc1));var _0x5774=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x7745[_0x295314];return _0x584b0c;};'use strict';var _=require(_0x5774('0x0'));var Promise=require(_0x5774('0x1'));var rp=require('request-promise');var util=require(_0x5774('0x2'));var md5=require(_0x5774('0x3'));var Redis=require(_0x5774('0x4'));var intUtil=require(_0x5774('0x5'));var config=require('../../../../config/environment');var logger=require(_0x5774('0x6'))(_0x5774('0x7'));config[_0x5774('0x8')]=_[_0x5774('0x9')](config[_0x5774('0x8')],{'host':_0x5774('0xa'),'port':0x18eb});var io=require(_0x5774('0xb'))(new Redis(config['redis']));function getAdminUser(_0x2f4f7a,_0x27fa59,_0xaeddb2,_0xd7d637,_0x9258f2,_0x1577fa){return new Promise(function(_0x5babd1,_0x3761c3){var _0x51d22e={'method':_0x5774('0xc'),'uri':_0xd7d637+_0x5774('0xd')+'&'+_0x9258f2+'&'+_0x1577fa,'auth':_0x27fa59,'json':!![]};return rp(_0x51d22e)[_0x5774('0xe')](function(_0x527449){if(_0x527449['result'][_0x5774('0xf')]>0x0){_0xaeddb2[_0x5774('0x10')]=_0x527449[_0x5774('0x11')][0x0][_0x5774('0x12')];}logger['info']('['+[_0x2f4f7a[_0x5774('0x13')]()]+_0x5774('0x14'),_0xaeddb2);_0x5babd1(_0xaeddb2);})[_0x5774('0x15')](function(_0x5e649c){logger['error']('['+[_0x2f4f7a[_0x5774('0x13')]()]+']',_0x5e649c['message']);_0x3761c3(_0x5e649c[_0x5774('0x16')]);});});}function getUser(_0x1802ff,_0x5e1069,_0x5d2754,_0x42a9a1,_0x343585){return function(_0x3d4d06){logger[_0x5774('0x17')]('['+[_0x1802ff[_0x5774('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x3d4d06);return new Promise(function(_0x10b2b4,_0x347852){if(intUtil[_0x5774('0x18')](_0x3d4d06[_0x5774('0x19')])){var _0x1f24b2={'method':_0x5774('0xc'),'uri':_0x5d2754+_0x5774('0x1a')+_0x3d4d06[_0x5774('0x19')]+'&'+_0x42a9a1+'&'+_0x343585,'auth':_0x5e1069,'json':!![]};logger[_0x5774('0x17')]('['+[_0x1802ff[_0x5774('0x13')]()]+_0x5774('0x1b'),_0x1f24b2);return rp(_0x1f24b2)[_0x5774('0xe')](function(_0x211809){logger[_0x5774('0x17')]('['+[_0x1802ff[_0x5774('0x13')]()]+_0x5774('0x1c'),_0x211809);if(_0x211809[_0x5774('0x11')]['length']>0x0&&String(_0x211809['result'][0x0][_0x5774('0x1d')])===_0x5774('0x1e')){_0x3d4d06[_0x5774('0x1f')]=_0x211809['result'][0x0]['sys_id'];}else{_0x3d4d06[_0x5774('0x1f')]=_0x3d4d06['adminId'];_0x3d4d06[_0x5774('0x19')]=_0x3d4d06[_0x5774('0x20')];}logger[_0x5774('0x17')]('['+[_0x1802ff[_0x5774('0x13')]()]+_0x5774('0x21'),_0x3d4d06);_0x10b2b4(_0x3d4d06);})[_0x5774('0x15')](function(_0x178ba0){logger[_0x5774('0x22')]('['+[_0x1802ff[_0x5774('0x13')]()]+']',_0x178ba0[_0x5774('0x16')]);_0x347852(_0x178ba0[_0x5774('0x16')]);});}else{logger[_0x5774('0x17')]('['+[_0x1802ff[_0x5774('0x13')]()]+_0x5774('0x23'));_0x3d4d06['userId']=_0x3d4d06['adminId'];_0x3d4d06[_0x5774('0x19')]=_0x3d4d06[_0x5774('0x20')];_0x10b2b4(_0x3d4d06);}});};}function createEndUser(_0x913c73,_0x1974e1,_0x228c74,_0x44c0cf,_0x2bc179){logger[_0x5774('0x17')]('['+[_0x913c73[_0x5774('0x13')]()]+_0x5774('0x24'),_0x228c74);return new Promise(function(_0x5c4fae,_0x123cb2){var _0x142b71={'method':_0x5774('0x25'),'uri':_0x44c0cf+_0x5774('0x26')+_0x2bc179,'body':{'user_name':_0x228c74['endUserNumber'],'roles':_0x5774('0x27'),'first_name':_0x228c74[_0x5774('0x28')],'active':_0x5774('0x1e'),'date_format':_0x5774('0x29'),'phone':_0x228c74[_0x5774('0x28')]},'auth':_0x1974e1,'json':!![]};return rp(_0x142b71)[_0x5774('0xe')](function(_0x390dfa){logger['info']('['+[_0x913c73[_0x5774('0x13')]()]+'],\x20EndUser\x20schema',_0x390dfa[_0x5774('0x11')]);_0x228c74['endUserId']=_0x390dfa[_0x5774('0x11')][_0x5774('0x12')];_0x5c4fae(_0x228c74);})[_0x5774('0x15')](function(_0x19cf6b){logger[_0x5774('0x22')]('['+[_0x913c73['toUpperCase']()]+']',_0x19cf6b[_0x5774('0x16')]);_0x123cb2(_0x19cf6b['message']);});});}function getEndUser(_0x4c95cf,_0x4ba880,_0x5c1220,_0xde7130,_0x27f76d){return function(_0x59f320){logger[_0x5774('0x17')]('['+[_0x4c95cf['toUpperCase']()]+_0x5774('0x2a'),_0x59f320);return new Promise(function(_0x49ceca,_0x45d314){var _0x4dde88={'method':_0x5774('0xc'),'uri':_0x5c1220+_0x5774('0x2b')+_0x59f320[_0x5774('0x28')]+'&'+_0xde7130+'&'+_0x27f76d,'auth':_0x4ba880,'json':!![]};return rp(_0x4dde88)[_0x5774('0xe')](function(_0x388f81){if(_0x388f81[_0x5774('0x11')]['length']>0x0){_0x59f320[_0x5774('0x2c')]=_0x388f81[_0x5774('0x11')][0x0][_0x5774('0x12')];logger[_0x5774('0x17')]('['+[_0x4c95cf[_0x5774('0x13')]()]+_0x5774('0x2d'),_0x59f320);_0x49ceca(_0x59f320);}else{return createEndUser(_0x4c95cf,_0x4ba880,_0x59f320,_0x5c1220,_0xde7130)[_0x5774('0xe')](function(_0x108ee7){logger[_0x5774('0x17')]('['+[_0x4c95cf[_0x5774('0x13')]()]+_0x5774('0x2e'),_0x108ee7);_0x49ceca(_0x108ee7);});}})[_0x5774('0x15')](function(_0x166adf){logger[_0x5774('0x22')]('['+[_0x4c95cf[_0x5774('0x13')]()]+']',_0x166adf[_0x5774('0x16')]);_0x45d314(_0x166adf[_0x5774('0x16')]);});});};}function getCustomFields(_0x63b4c8,_0x46fea8){var _0xbfb6fd={};if(_0x63b4c8[_0x5774('0xf')]>0x0){_[_0x5774('0x2f')](_0x63b4c8,function(_0xa80745){if(_[_0x5774('0x30')](['string',_0x5774('0x31')],_0xa80745[_0x5774('0x32')])&&_0xa80745[_0x5774('0x33')]&&!_0xa80745[_0x5774('0x34')]){_0xbfb6fd[_0xa80745['nameField'][_0x5774('0x35')]()]=_0xa80745[_0x5774('0x36')][_0x5774('0x37')]();}else if(_['includes']([_0x5774('0x38'),_0x5774('0x31')],_0xa80745['type'])&&_0xa80745[_0x5774('0x39')]&&_0xa80745[_0x5774('0x34')]){_0xbfb6fd[_0xa80745[_0x5774('0x39')][_0x5774('0x35')]()]=_0xa80745['content'][_0x5774('0x37')]();}else if(_0xa80745[_0x5774('0x32')]===_0x5774('0x3a')&&_0xa80745[_0x5774('0x3b')]&&_0xa80745[_0x5774('0x39')]&&_0xa80745[_0x5774('0x34')]){_0xbfb6fd[_0xa80745[_0x5774('0x39')][_0x5774('0x35')]()]=_0x46fea8[_0xa80745[_0x5774('0x3b')]]['toString']();}else if(_0xa80745[_0x5774('0x32')]==='customVariable'&&_0xa80745[_0x5774('0x3c')]&&_0xa80745[_0x5774('0x3c')]['name']&&_0xa80745[_0x5774('0x39')]&&_0xa80745['customField']){_0xbfb6fd[_0xa80745[_0x5774('0x39')][_0x5774('0x35')]()]=_0x46fea8[_0xa80745[_0x5774('0x3c')][_0x5774('0x3d')][_0x5774('0x35')]()][_0x5774('0x37')]();}});}return _0xbfb6fd;}function getTicket(_0x2aabfa,_0xf27404,_0x54c9bd,_0x56596d,_0x37cf94,_0x4d3321){return function(_0x53bdf6){logger[_0x5774('0x17')]('['+[_0x2aabfa[_0x5774('0x13')]()]+_0x5774('0x3e'),_0x53bdf6);return new Promise(function(_0x698ca4,_0x27f65a){var _0x26cbe3=_0x2aabfa[_0x5774('0x35')]()===_0x5774('0x3f')?_0x53bdf6['userId']:_0x53bdf6['endUserId'];var _0x20cb58={'method':_0x5774('0x25'),'uri':_0x54c9bd+_0x5774('0x40')+'?'+_0x4d3321,'body':Object['assign']({},{'active':_0x5774('0x1e'),'caller_id':_0x26cbe3,'assigned_to':_0x53bdf6[_0x5774('0x1f')],'short_description':intUtil['getString'](_0x56596d[_0x5774('0x41')],_0x37cf94,'\x20'),'description':intUtil[_0x5774('0x42')](_0x56596d[_0x5774('0x43')],_0x37cf94,'\x0a')},getCustomFields(_0x56596d[_0x5774('0x44')],_0x37cf94)),'auth':_0xf27404,'json':!![]};return rp(_0x20cb58)[_0x5774('0xe')](function(_0x5cd96a){logger[_0x5774('0x17')]('['+[_0x2aabfa[_0x5774('0x13')]()]+_0x5774('0x45'),_0x5cd96a[_0x5774('0x11')]);_0x53bdf6[_0x5774('0x46')]=_0x5cd96a[_0x5774('0x11')]['sys_id'];_0x53bdf6['ticketNumber']=_0x5cd96a[_0x5774('0x11')][_0x5774('0x47')];logger[_0x5774('0x17')]('['+[_0x2aabfa['toUpperCase']()]+_0x5774('0x48'),_0x53bdf6);_0x698ca4(_0x53bdf6);})[_0x5774('0x15')](function(_0x31f46e){logger[_0x5774('0x22')]('['+[_0x2aabfa[_0x5774('0x13')]()]+']',_0x31f46e[_0x5774('0x16')]);_0x27f65a(_0x31f46e['message']);});});};}function createRemoteTag(_0x6d0a93,_0x2f75e8,_0x3573e4,_0x5499a6){return new Promise(function(_0x32fb51,_0x27db76){var _0xeea370={'method':'POST','uri':_0x3573e4+_0x5774('0x49')+'?'+_0x5499a6,'body':{'short_description':_0x6d0a93,'global':!![],'active':!![],'name':_0x6d0a93},'auth':_0x2f75e8,'json':!![]};return rp(_0xeea370)[_0x5774('0xe')](function(_0x43b906){var _0x255ae7=_0x43b906['result'][_0x5774('0x12')];_0x32fb51(_0x255ae7);});});}function getRemoteTag(_0x48919e,_0xe956d0,_0x50468e,_0x58c880,_0xf5265f){return new Promise(function(_0x274478,_0x3fddfc){var _0x56fe2e={'method':_0x5774('0xc'),'uri':_0x50468e+_0x5774('0x49')+'?sysparm_query=name%3D'+_0x48919e+'&'+_0x58c880,'auth':_0xe956d0,'json':!![]};return rp(_0x56fe2e)[_0x5774('0xe')](function(_0xabce6a){if(_0xabce6a[_0x5774('0x11')][_0x5774('0xf')]>0x0){var _0x2c72d4=_0xabce6a['result'][0x0][_0x5774('0x12')];_0x274478(_0x2c72d4);}else{return createRemoteTag(_0x48919e,_0xe956d0,_0x50468e,_0x58c880)[_0x5774('0xe')](function(_0x410b93){_0x274478(_0x410b93);});}});});}function assignTagToIncident(_0x316bfb,_0x178407,_0x4e437e,_0x5c7d82,_0x5a435e){return new Promise(function(_0xbce78a,_0x20ed71){var _0x44e43b={'method':_0x5774('0x25'),'uri':_0x4e437e+_0x5774('0x4a')+'?'+_0x5a435e,'body':{'label':_0x316bfb,'table':'incident','id_type':_0x5774('0x4b'),'table_key':_0x5c7d82[_0x5774('0x46')],'title':'Incident\x20-\x20'+_0x5c7d82[_0x5774('0x4c')],'id_display':_0x5c7d82[_0x5774('0x4c')]},'auth':_0x178407,'json':!![]};return rp(_0x44e43b)[_0x5774('0xe')](function(_0x1cbdec){_0xbce78a();})[_0x5774('0x15')](function(){_0xbce78a();});});}function manageTags(_0xb10b39,_0x4439ad,_0x4212fa,_0x45bc59,_0x4d4f12,_0xe6d42d,_0x173e8a){return new Promise(function(_0x1143c3,_0x109686){var _0x32366e=[];_0x4439ad[_0x5774('0x2f')](function(_0xbf935c){_0x32366e[_0x5774('0x4d')](getRemoteTag(_0xbf935c,_0x4212fa,_0x45bc59,_0xe6d42d,_0x173e8a));});return Promise[_0x5774('0x4e')](_0x32366e)['then'](function(_0x2be9b0){if(_0x2be9b0['length']){logger[_0x5774('0x17')]('['+[_0xb10b39[_0x5774('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2be9b0);var _0x3d7c62=[];_0x2be9b0[_0x5774('0x2f')](function(_0x170f31){_0x3d7c62['push'](assignTagToIncident(_0x170f31,_0x4212fa,_0x45bc59,_0x4d4f12,_0xe6d42d));});return Promise[_0x5774('0x4e')](_0x3d7c62)[_0x5774('0xe')](function(){_0x1143c3();})[_0x5774('0x15')](function(){_0x1143c3();});}else{_0x1143c3();}});});}function getTags(_0x12e666,_0xf3b477,_0x1fb5db,_0x89d81d,_0x36ca1c,_0x97214b){return function(_0x35adfe){return new Promise(function(_0x2ffd6e,_0x359bd5){var _0x1970e0=[];var _0x28e49e=_0x89d81d['Tags'];if(_0x28e49e&&_0x28e49e[_0x5774('0xf')]>0x0){_0x1970e0=_[_0x5774('0x4f')](_0x28e49e,_0x5774('0x3d'));}if(_0x1970e0[_0x5774('0xf')]>0x0){return manageTags(_0x12e666,_0x1970e0,_0xf3b477,_0x1fb5db,_0x35adfe,_0x36ca1c,_0x97214b)[_0x5774('0xe')](function(){_0x2ffd6e(_0x35adfe);});}else{_0x2ffd6e(_0x35adfe);}});};}function emit(_0x154bbd,_0x95c6c1,_0x294afd){var _0x255894='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x5774('0x50')+_0x5774('0x51');var _0x3d5e6a={'uri':_0x154bbd+_0x5774('0x52')+_0x294afd+_0x255894};io['to'](util[_0x5774('0x53')](_0x5774('0x54'),_0x95c6c1))[_0x5774('0x55')]('trigger:browser:url',_0x3d5e6a);}exports['cs']=function(_0x481839,_0x378789,_0x298d17,_0x3eaf2f,_0x58a859,_0x205589,_0xfdc124,_0x4a4574){var _0x21d13b={};var _0x2a650d={'user':_0x205589['username'],'pass':_0x205589[_0x5774('0x56')]};var _0x76929e=_0x5774('0x57');var _0x1f43f1=_0x5774('0x58');_0x205589[_0x5774('0x59')]=intUtil[_0x5774('0x5a')](_0x205589[_0x5774('0x59')]);_0x205589[_0x5774('0x5b')]=intUtil[_0x5774('0x5a')](_0x205589[_0x5774('0x5b')]);var _0x1a73a4=util['format'](_0x5774('0x5c'),_0x205589[_0x5774('0x59')]);_0x21d13b[_0x5774('0x19')]=!_[_0x5774('0x5d')](_0x3eaf2f)?_0x3eaf2f[_0x5774('0x5e')]:null;_0x21d13b[_0x5774('0x20')]=_0x205589[_0x5774('0x5e')];_0x21d13b[_0x5774('0x28')]=_0x4a4574[_0x5774('0x35')]()==='outbound'?_0x378789[_0x5774('0x5f')]:_0x378789['calleridnum'];_0x21d13b['callDirection']=_0x4a4574===_0x5774('0x60')||_0x4a4574==='unmanaged'?_0x5774('0x60'):_0x5774('0x3f');var _0xa759d2=util[_0x5774('0x53')](_0x5774('0x61'),_0x205589[_0x5774('0x5b')],_0x378789[_0x5774('0x62')],md5(_0x378789[_0x5774('0x62')]));if(_0x58a859&&_0x58a859[_0x5774('0x63')]){logger[_0x5774('0x17')](_0x5774('0x64'),'Recording\x20is\x20enabled!');_0x378789[_0x5774('0x65')]=_0xa759d2;}else if(_0xfdc124&&_0xfdc124[_0x5774('0x66')]&&_0xfdc124[_0x5774('0x66')]!=='none'){logger[_0x5774('0x17')](_0x5774('0x67'),_0x5774('0x68'));_0x378789[_0x5774('0x65')]=_0xa759d2;}else{_0x378789[_0x5774('0x65')]='';}return getAdminUser(_0x4a4574,_0x2a650d,_0x21d13b,_0x1a73a4,_0x1f43f1,_0x76929e)[_0x5774('0xe')](getUser(_0x4a4574,_0x2a650d,_0x1a73a4,_0x1f43f1,_0x76929e))[_0x5774('0xe')](getEndUser(_0x4a4574,_0x2a650d,_0x1a73a4,_0x1f43f1,_0x76929e))[_0x5774('0xe')](getTicket(_0x4a4574,_0x2a650d,_0x1a73a4,_0x298d17,_0x378789,_0x1f43f1))['then'](function(_0x4ff8df){logger['info'](util[_0x5774('0x53')](_0x5774('0x69'),_0x4ff8df['ticketId']));logger[_0x5774('0x17')](util[_0x5774('0x53')]('call\x20direction:\x20%s',_0x4a4574));if(_0x4a4574!==_0x5774('0x6a')){logger['info']('['+[_0x4a4574['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x205589[_0x5774('0x59')],_0x3eaf2f[_0x5774('0x3d')],_0x4ff8df['ticketId']);}})['catch'](function(_0x1172cc){logger['error']('['+[_0x4a4574[_0x5774('0x13')]()]+_0x5774('0x6b'),util['inspect'](_0x1172cc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6fa1=['Variable','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','emit','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','isNil','email','calleridnum','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','recordingURL','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','sys_id','userId','adminEmail','error','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','toString','string','idField','content','variable','variableName','customVariable'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x6fa1,0x93));var _0x16fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6fa1[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var Promise=require(_0x16fa('0x0'));var rp=require(_0x16fa('0x1'));var util=require('util');var md5=require('md5');var Redis=require(_0x16fa('0x2'));var intUtil=require('./util');var config=require(_0x16fa('0x3'));var logger=require(_0x16fa('0x4'))('servicenow');config[_0x16fa('0x5')]=_[_0x16fa('0x6')](config[_0x16fa('0x5')],{'host':_0x16fa('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16fa('0x5')]));function getAdminUser(_0x8a8836,_0x9f903b,_0x4cb6c4,_0xde9f0,_0x39db34,_0x206ec1){return new Promise(function(_0x3c5760,_0x35bb58){var _0x53caf3={'method':_0x16fa('0x8'),'uri':_0xde9f0+_0x16fa('0x9')+'&'+_0x39db34+'&'+_0x206ec1,'auth':_0x9f903b,'json':!![]};return rp(_0x53caf3)[_0x16fa('0xa')](function(_0x216309){if(_0x216309[_0x16fa('0xb')][_0x16fa('0xc')]>0x0){_0x4cb6c4[_0x16fa('0xd')]=_0x216309[_0x16fa('0xb')][0x0]['sys_id'];}logger['info']('['+[_0x8a8836[_0x16fa('0xe')]()]+_0x16fa('0xf'),_0x4cb6c4);_0x3c5760(_0x4cb6c4);})[_0x16fa('0x10')](function(_0x5c4c66){logger['error']('['+[_0x8a8836[_0x16fa('0xe')]()]+']',_0x5c4c66[_0x16fa('0x11')]);_0x35bb58(_0x5c4c66['message']);});});}function getUser(_0xac115a,_0x3c13ef,_0x8138b2,_0x1e461e,_0x25120e){return function(_0x26fb27){logger[_0x16fa('0x12')]('['+[_0xac115a[_0x16fa('0xe')]()]+'],\x20getUser\x20input\x20crm',_0x26fb27);return new Promise(function(_0x412a3a,_0x37accd){if(intUtil['validateEmail'](_0x26fb27[_0x16fa('0x13')])){var _0x24d210={'method':_0x16fa('0x8'),'uri':_0x8138b2+_0x16fa('0x14')+_0x26fb27[_0x16fa('0x13')]+'&'+_0x1e461e+'&'+_0x25120e,'auth':_0x3c13ef,'json':!![]};logger['info']('['+[_0xac115a['toUpperCase']()]+_0x16fa('0x15'),_0x24d210);return rp(_0x24d210)[_0x16fa('0xa')](function(_0x2acd45){logger['info']('['+[_0xac115a['toUpperCase']()]+_0x16fa('0x16'),_0x2acd45);if(_0x2acd45[_0x16fa('0xb')][_0x16fa('0xc')]>0x0&&String(_0x2acd45['result'][0x0][_0x16fa('0x17')])==='true'){_0x26fb27['userId']=_0x2acd45['result'][0x0][_0x16fa('0x18')];}else{_0x26fb27[_0x16fa('0x19')]=_0x26fb27['adminId'];_0x26fb27['userEmail']=_0x26fb27[_0x16fa('0x1a')];}logger[_0x16fa('0x12')]('['+[_0xac115a[_0x16fa('0xe')]()]+'],\x20getUser\x20crm',_0x26fb27);_0x412a3a(_0x26fb27);})[_0x16fa('0x10')](function(_0x3b6210){logger[_0x16fa('0x1b')]('['+[_0xac115a[_0x16fa('0xe')]()]+']',_0x3b6210[_0x16fa('0x11')]);_0x37accd(_0x3b6210[_0x16fa('0x11')]);});}else{logger[_0x16fa('0x12')]('['+[_0xac115a[_0x16fa('0xe')]()]+']\x20using\x20admin\x20profile');_0x26fb27[_0x16fa('0x19')]=_0x26fb27['adminId'];_0x26fb27[_0x16fa('0x13')]=_0x26fb27[_0x16fa('0x1a')];_0x412a3a(_0x26fb27);}});};}function createEndUser(_0x205176,_0x110c2f,_0x5c263e,_0x5f1ac3,_0x351ada){logger[_0x16fa('0x12')]('['+[_0x205176['toUpperCase']()]+_0x16fa('0x1c'),_0x5c263e);return new Promise(function(_0x20b95d,_0x5eebb1){var _0x1ac1a0={'method':_0x16fa('0x1d'),'uri':_0x5f1ac3+_0x16fa('0x1e')+_0x351ada,'body':{'user_name':_0x5c263e[_0x16fa('0x1f')],'roles':_0x16fa('0x20'),'first_name':_0x5c263e['endUserNumber'],'active':_0x16fa('0x21'),'date_format':'System','phone':_0x5c263e[_0x16fa('0x1f')]},'auth':_0x110c2f,'json':!![]};return rp(_0x1ac1a0)[_0x16fa('0xa')](function(_0x4f3f56){logger[_0x16fa('0x12')]('['+[_0x205176['toUpperCase']()]+_0x16fa('0x22'),_0x4f3f56[_0x16fa('0xb')]);_0x5c263e[_0x16fa('0x23')]=_0x4f3f56[_0x16fa('0xb')][_0x16fa('0x18')];_0x20b95d(_0x5c263e);})[_0x16fa('0x10')](function(_0x19fcb9){logger[_0x16fa('0x1b')]('['+[_0x205176['toUpperCase']()]+']',_0x19fcb9[_0x16fa('0x11')]);_0x5eebb1(_0x19fcb9[_0x16fa('0x11')]);});});}function getEndUser(_0x36e96d,_0x5cbdb4,_0x556eb4,_0x3bcf59,_0x556dcc){return function(_0x3685ca){logger[_0x16fa('0x12')]('['+[_0x36e96d[_0x16fa('0xe')]()]+_0x16fa('0x24'),_0x3685ca);return new Promise(function(_0x5aeb0b,_0x12c9cd){var _0xf08a3={'method':'GET','uri':_0x556eb4+_0x16fa('0x25')+_0x3685ca[_0x16fa('0x1f')]+'&'+_0x3bcf59+'&'+_0x556dcc,'auth':_0x5cbdb4,'json':!![]};return rp(_0xf08a3)[_0x16fa('0xa')](function(_0x45b8e8){if(_0x45b8e8[_0x16fa('0xb')]['length']>0x0){_0x3685ca[_0x16fa('0x23')]=_0x45b8e8[_0x16fa('0xb')][0x0][_0x16fa('0x18')];logger['info']('['+[_0x36e96d[_0x16fa('0xe')]()]+_0x16fa('0x26'),_0x3685ca);_0x5aeb0b(_0x3685ca);}else{return createEndUser(_0x36e96d,_0x5cbdb4,_0x3685ca,_0x556eb4,_0x3bcf59)[_0x16fa('0xa')](function(_0x15740a){logger['info']('['+[_0x36e96d[_0x16fa('0xe')]()]+'],\x20createEndUser\x20crm',_0x15740a);_0x5aeb0b(_0x15740a);});}})[_0x16fa('0x10')](function(_0x1a9ff8){logger[_0x16fa('0x1b')]('['+[_0x36e96d['toUpperCase']()]+']',_0x1a9ff8['message']);_0x12c9cd(_0x1a9ff8[_0x16fa('0x11')]);});});};}function getCustomFields(_0x2a54e9,_0x53d17e){var _0x733c9={};if(_0x2a54e9[_0x16fa('0xc')]>0x0){_[_0x16fa('0x27')](_0x2a54e9,function(_0x5665e0){if(_[_0x16fa('0x28')](['string',_0x16fa('0x29')],_0x5665e0[_0x16fa('0x2a')])&&_0x5665e0[_0x16fa('0x2b')]&&!_0x5665e0[_0x16fa('0x2c')]){_0x733c9[_0x5665e0['nameField'][_0x16fa('0x2d')]()]=_0x5665e0['content'][_0x16fa('0x2e')]();}else if(_[_0x16fa('0x28')]([_0x16fa('0x2f'),'picklist'],_0x5665e0[_0x16fa('0x2a')])&&_0x5665e0[_0x16fa('0x30')]&&_0x5665e0[_0x16fa('0x2c')]){_0x733c9[_0x5665e0[_0x16fa('0x30')]['toLowerCase']()]=_0x5665e0[_0x16fa('0x31')]['toString']();}else if(_0x5665e0[_0x16fa('0x2a')]===_0x16fa('0x32')&&_0x5665e0[_0x16fa('0x33')]&&_0x5665e0[_0x16fa('0x30')]&&_0x5665e0[_0x16fa('0x2c')]){_0x733c9[_0x5665e0[_0x16fa('0x30')][_0x16fa('0x2d')]()]=_0x53d17e[_0x5665e0[_0x16fa('0x33')]][_0x16fa('0x2e')]();}else if(_0x5665e0['type']===_0x16fa('0x34')&&_0x5665e0['Variable']&&_0x5665e0['Variable']['name']&&_0x5665e0[_0x16fa('0x30')]&&_0x5665e0[_0x16fa('0x2c')]){_0x733c9[_0x5665e0[_0x16fa('0x30')][_0x16fa('0x2d')]()]=_0x53d17e[_0x5665e0[_0x16fa('0x35')]['name']['toLowerCase']()][_0x16fa('0x2e')]();}});}return _0x733c9;}function getTicket(_0x69d983,_0x43f953,_0x4d07db,_0x49f881,_0x4e6595,_0x335543){return function(_0x12206d){logger[_0x16fa('0x12')]('['+[_0x69d983['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x12206d);return new Promise(function(_0x311c0d,_0x15b37d){var _0x54fdf3=_0x69d983[_0x16fa('0x2d')]()===_0x16fa('0x36')?_0x12206d[_0x16fa('0x19')]:_0x12206d[_0x16fa('0x23')];var _0x35c5d3={'method':_0x16fa('0x1d'),'uri':_0x4d07db+_0x16fa('0x37')+'?'+_0x335543,'body':Object[_0x16fa('0x38')]({},{'active':_0x16fa('0x21'),'caller_id':_0x54fdf3,'assigned_to':_0x12206d['userId'],'short_description':intUtil[_0x16fa('0x39')](_0x49f881[_0x16fa('0x3a')],_0x4e6595,'\x20'),'description':intUtil[_0x16fa('0x39')](_0x49f881[_0x16fa('0x3b')],_0x4e6595,'\x0a')},getCustomFields(_0x49f881[_0x16fa('0x3c')],_0x4e6595)),'auth':_0x43f953,'json':!![]};return rp(_0x35c5d3)[_0x16fa('0xa')](function(_0x14f70b){logger[_0x16fa('0x12')]('['+[_0x69d983[_0x16fa('0xe')]()]+_0x16fa('0x3d'),_0x14f70b['result']);_0x12206d['ticketId']=_0x14f70b[_0x16fa('0xb')][_0x16fa('0x18')];_0x12206d['ticketNumber']=_0x14f70b[_0x16fa('0xb')][_0x16fa('0x3e')];logger[_0x16fa('0x12')]('['+[_0x69d983[_0x16fa('0xe')]()]+_0x16fa('0x3f'),_0x12206d);_0x311c0d(_0x12206d);})[_0x16fa('0x10')](function(_0x14729c){logger['error']('['+[_0x69d983['toUpperCase']()]+']',_0x14729c['message']);_0x15b37d(_0x14729c['message']);});});};}function createRemoteTag(_0x30147f,_0x45fc56,_0x5eb53c,_0x36c7c3){return new Promise(function(_0x3c0c36,_0x38484c){var _0x37e65b={'method':'POST','uri':_0x5eb53c+_0x16fa('0x40')+'?'+_0x36c7c3,'body':{'short_description':_0x30147f,'global':!![],'active':!![],'name':_0x30147f},'auth':_0x45fc56,'json':!![]};return rp(_0x37e65b)[_0x16fa('0xa')](function(_0x548093){var _0x48f009=_0x548093[_0x16fa('0xb')][_0x16fa('0x18')];_0x3c0c36(_0x48f009);});});}function getRemoteTag(_0xb49018,_0x449921,_0x55037f,_0x3997f2,_0x1dfb24){return new Promise(function(_0x44aecc,_0x361f65){var _0x1f98b4={'method':'GET','uri':_0x55037f+_0x16fa('0x40')+_0x16fa('0x41')+_0xb49018+'&'+_0x3997f2,'auth':_0x449921,'json':!![]};return rp(_0x1f98b4)['then'](function(_0xdb02dd){if(_0xdb02dd['result'][_0x16fa('0xc')]>0x0){var _0x4d3ce6=_0xdb02dd[_0x16fa('0xb')][0x0][_0x16fa('0x18')];_0x44aecc(_0x4d3ce6);}else{return createRemoteTag(_0xb49018,_0x449921,_0x55037f,_0x3997f2)[_0x16fa('0xa')](function(_0x278058){_0x44aecc(_0x278058);});}});});}function assignTagToIncident(_0x17157f,_0x446776,_0x542066,_0x144a6e,_0x34386f){return new Promise(function(_0x1799c9,_0x3a38ae){var _0x56b52d={'method':_0x16fa('0x1d'),'uri':_0x542066+_0x16fa('0x42')+'?'+_0x34386f,'body':{'label':_0x17157f,'table':'incident','id_type':_0x16fa('0x43'),'table_key':_0x144a6e[_0x16fa('0x44')],'title':_0x16fa('0x45')+_0x144a6e[_0x16fa('0x46')],'id_display':_0x144a6e[_0x16fa('0x46')]},'auth':_0x446776,'json':!![]};return rp(_0x56b52d)['then'](function(_0x2f697c){_0x1799c9();})[_0x16fa('0x10')](function(){_0x1799c9();});});}function manageTags(_0x3db58b,_0x151f17,_0x3bcdad,_0x2cd2a5,_0x100438,_0x48e038,_0x8a013){return new Promise(function(_0x5614af,_0x8ff188){var _0x3863dd=[];_0x151f17[_0x16fa('0x27')](function(_0x2a4050){_0x3863dd[_0x16fa('0x47')](getRemoteTag(_0x2a4050,_0x3bcdad,_0x2cd2a5,_0x48e038,_0x8a013));});return Promise[_0x16fa('0x48')](_0x3863dd)[_0x16fa('0xa')](function(_0x1edb66){if(_0x1edb66[_0x16fa('0xc')]){logger[_0x16fa('0x12')]('['+[_0x3db58b[_0x16fa('0xe')]()]+_0x16fa('0x49'),_0x1edb66);var _0x48e0c8=[];_0x1edb66[_0x16fa('0x27')](function(_0x133e5b){_0x48e0c8[_0x16fa('0x47')](assignTagToIncident(_0x133e5b,_0x3bcdad,_0x2cd2a5,_0x100438,_0x48e038));});return Promise[_0x16fa('0x48')](_0x48e0c8)[_0x16fa('0xa')](function(){_0x5614af();})['catch'](function(){_0x5614af();});}else{_0x5614af();}});});}function getTags(_0x321ff3,_0x41146d,_0x41c162,_0x3083aa,_0x14b8b7,_0x779e87){return function(_0x1a3957){return new Promise(function(_0x5afed9,_0x3407a8){var _0xd7f4b6=[];var _0xc62466=_0x3083aa['Tags'];if(_0xc62466&&_0xc62466[_0x16fa('0xc')]>0x0){_0xd7f4b6=_[_0x16fa('0x4a')](_0xc62466,_0x16fa('0x4b'));}if(_0xd7f4b6[_0x16fa('0xc')]>0x0){return manageTags(_0x321ff3,_0xd7f4b6,_0x41146d,_0x41c162,_0x1a3957,_0x14b8b7,_0x779e87)['then'](function(){_0x5afed9(_0x1a3957);});}else{_0x5afed9(_0x1a3957);}});};}function emit(_0x46dad5,_0x3fbbf1,_0x22d244){var _0x340901=_0x16fa('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x16fa('0x4d')+_0x16fa('0x4e');var _0x39c258={'uri':_0x46dad5+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x22d244+_0x340901};io['to'](util[_0x16fa('0x4f')]('user:%s',_0x3fbbf1))[_0x16fa('0x50')](_0x16fa('0x51'),_0x39c258);}exports['cs']=function(_0x409450,_0x4661e9,_0x308d74,_0x4791a8,_0x255783,_0x357d60,_0x413315,_0x5e554c){var _0x4a322a={};var _0x12442b={'user':_0x357d60['username'],'pass':_0x357d60[_0x16fa('0x52')]};var _0x21962e=_0x16fa('0x53');var _0x5cbc91='sysparm_display_value=true';_0x357d60[_0x16fa('0x54')]=intUtil[_0x16fa('0x55')](_0x357d60['remoteUri']);_0x357d60[_0x16fa('0x56')]=intUtil[_0x16fa('0x55')](_0x357d60[_0x16fa('0x56')]);var _0x536ecb=util[_0x16fa('0x4f')]('%s/api/now/table/',_0x357d60[_0x16fa('0x54')]);_0x4a322a['userEmail']=!_[_0x16fa('0x57')](_0x4791a8)?_0x4791a8[_0x16fa('0x58')]:null;_0x4a322a['adminEmail']=_0x357d60[_0x16fa('0x58')];_0x4a322a[_0x16fa('0x1f')]=_0x5e554c[_0x16fa('0x2d')]()===_0x16fa('0x36')?_0x4661e9['destcalleridnum']:_0x4661e9[_0x16fa('0x59')];_0x4a322a['callDirection']=_0x5e554c==='queue'||_0x5e554c===_0x16fa('0x5a')?_0x16fa('0x5b'):_0x16fa('0x36');var _0x1b7778=util[_0x16fa('0x4f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x357d60[_0x16fa('0x56')],_0x4661e9[_0x16fa('0x5c')],md5(_0x4661e9[_0x16fa('0x5c')]));if(_0x255783&&_0x255783[_0x16fa('0x5d')]){logger[_0x16fa('0x12')](_0x16fa('0x5e'),'Recording\x20is\x20enabled!');_0x4661e9[_0x16fa('0x5f')]=_0x1b7778;}else if(_0x413315&&_0x413315['recordingFormat']&&_0x413315['recordingFormat']!=='none'){logger[_0x16fa('0x12')]('[OUTBOUND]',_0x16fa('0x60'));_0x4661e9[_0x16fa('0x5f')]=_0x1b7778;}else{_0x4661e9['recordingURL']='';}return getAdminUser(_0x5e554c,_0x12442b,_0x4a322a,_0x536ecb,_0x5cbc91,_0x21962e)[_0x16fa('0xa')](getUser(_0x5e554c,_0x12442b,_0x536ecb,_0x5cbc91,_0x21962e))['then'](getEndUser(_0x5e554c,_0x12442b,_0x536ecb,_0x5cbc91,_0x21962e))[_0x16fa('0xa')](getTicket(_0x5e554c,_0x12442b,_0x536ecb,_0x308d74,_0x4661e9,_0x5cbc91))[_0x16fa('0xa')](function(_0x45f18a){logger[_0x16fa('0x12')](util['format'](_0x16fa('0x61'),_0x45f18a[_0x16fa('0x44')]));logger[_0x16fa('0x12')](util[_0x16fa('0x4f')](_0x16fa('0x62'),_0x5e554c));if(_0x5e554c!==_0x16fa('0x5a')){logger[_0x16fa('0x12')]('['+[_0x5e554c[_0x16fa('0xe')]()]+']',_0x16fa('0x63'));emit(_0x357d60[_0x16fa('0x54')],_0x4791a8[_0x16fa('0x4b')],_0x45f18a[_0x16fa('0x44')]);}})[_0x16fa('0x10')](function(_0xe4d8d6){logger[_0x16fa('0x1b')]('['+[_0x5e554c[_0x16fa('0xe')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0xe4d8d6,{'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 12b490c..1ef085c 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 _0x3a42=['recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','Ticket\x20created!','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','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','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','merge','string','nameField','customField','toLowerCase','content','type','variable','Variable','custom_fields','login','username','password','PLAIN','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','trigger:browser:url','catch','error','outbound','uri'];(function(_0x4a92e2,_0x2190c5){var _0x425690=function(_0x9d6016){while(--_0x9d6016){_0x4a92e2['push'](_0x4a92e2['shift']());}};_0x425690(++_0x2190c5);}(_0x3a42,0x103));var _0x23a4=function(_0x5de62a,_0x598b61){_0x5de62a=_0x5de62a-0x0;var _0x170063=_0x3a42[_0x5de62a];return _0x170063;};'use strict';var _=require(_0x23a4('0x0'));var rp=require(_0x23a4('0x1'));var BPromise=require(_0x23a4('0x2'));var md5=require(_0x23a4('0x3'));var util=require(_0x23a4('0x4'));var Redis=require(_0x23a4('0x5'));var intUtil=require(_0x23a4('0x6'));var config=require('../../../../config/environment');var logger=require(_0x23a4('0x7'))(_0x23a4('0x8'));config[_0x23a4('0x9')]=_[_0x23a4('0xa')](config['redis'],{'host':_0x23a4('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x23a4('0xc'),'json':!![]};function emit(_0x5142b3,_0x22e02c,_0xc47d47){io['to'](_0x5142b3)[_0x23a4('0xd')](_0x22e02c,_0xc47d47);}function getTicket(_0x2ba12a,_0x43b5ed,_0x40cfdf,_0x5e1767,_0x167a24,_0x453f60,_0x5d0732,_0x4e4cbc){logger[_0x23a4('0xe')](_0x23a4('0xf'));var _0x464ef3=new Date();var _0x4ee016=[{'name':_0x23a4('0x10'),'value':intUtil[_0x23a4('0x11')](_0x5e1767[_0x23a4('0x12')],_0x167a24,'\x20')},{'name':'assigned_user_id','value':_0x43b5ed['id']},{'name':_0x23a4('0x13'),'value':_0x43b5ed['id']},{'name':_0x23a4('0x14'),'value':intUtil[_0x23a4('0x11')](_0x5e1767[_0x23a4('0x15')],_0x167a24,'\x0a')},{'name':'date_start','value':_0x464ef3[_0x23a4('0x16')]()[_0x23a4('0x17')](0x0,0x13)[_0x23a4('0x18')]('T','\x20')},{'name':_0x23a4('0x19'),'value':'0'},{'name':_0x23a4('0x1a'),'value':'15'},{'name':_0x23a4('0x1b'),'value':_0x40cfdf['id']},{'name':_0x23a4('0x1c'),'value':_0x23a4('0x1d')},{'name':'parent_name','value':_0x40cfdf['name']},{'name':'direction','value':_0x4e4cbc}];if(_0x453f60[_0x23a4('0x1e')]){_[_0x23a4('0x1f')](_0x453f60,function(_0x2f4230){if(_0x167a24[_0x2f4230[_0x23a4('0x20')]]){_0x4ee016[_0x23a4('0x21')]({'name':_0x2f4230[_0x23a4('0x22')],'value':_0x167a24[_0x2f4230['variableName']]});}});}return request({'form':{'method':_0x23a4('0x23'),'input_type':'JSON','response_type':_0x23a4('0x24'),'rest_data':JSON[_0x23a4('0x25')]({'session':_0x5d0732['id'],'module_name':_0x23a4('0x26'),'name_value_list':_0x4ee016})}});}function getAuth(_0x705d9b){return util[_0x23a4('0x27')](_0x23a4('0x28'),new Buffer(_0x705d9b['apiKey']+':X')[_0x23a4('0x29')](_0x23a4('0x2a')));}function getServerInfo(_0x11f860){return request({'form':{'method':_0x23a4('0x2b'),'input_type':_0x23a4('0x24'),'response_type':_0x23a4('0x24'),'rest_data':JSON[_0x23a4('0x25')]({'session':_0x11f860['id']})}});}function getUser(_0x317f40,_0x4858f5,_0x55598f){if(!_[_0x23a4('0x2c')](_0x4858f5)){logger[_0x23a4('0xe')](_0x23a4('0x2d'),_0x4858f5);return request({'form':{'method':_0x23a4('0x2e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x23a4('0x25')]({'session':_0x55598f['id'],'module_name':'Employees','query':util['format'](_0x23a4('0x2f'),_0x4858f5),'order_by':'','offset':'0','select_fields':['id',_0x23a4('0x10'),_0x23a4('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4a0496){if(_0x4a0496[_0x23a4('0x31')][_0x23a4('0x1e')]){var _0x1366b4=_['find'](_0x4a0496[_0x23a4('0x31')],function(_0x17d4f4){return _0x17d4f4['name_value_list'][_0x23a4('0x30')][_0x23a4('0x32')]===_0x4858f5;});if(_0x1366b4){logger[_0x23a4('0xe')](_0x23a4('0x33'));return BPromise[_0x23a4('0x34')]({'id':_0x1366b4[_0x23a4('0x35')]['id'][_0x23a4('0x32')],'name':_0x1366b4[_0x23a4('0x35')][_0x23a4('0x10')][_0x23a4('0x32')]});}}logger[_0x23a4('0xe')](_0x23a4('0x36'));return BPromise[_0x23a4('0x34')]({'id':_0x55598f[_0x23a4('0x35')][_0x23a4('0x37')][_0x23a4('0x32')],'name':_0x55598f['name_value_list'][_0x23a4('0x30')]['value']});});}else{logger['info'](_0x23a4('0x38'));return BPromise[_0x23a4('0x34')]({'id':_0x55598f[_0x23a4('0x35')]['user_id'][_0x23a4('0x32')],'name':_0x55598f[_0x23a4('0x35')][_0x23a4('0x30')][_0x23a4('0x32')]});}}function getEndUser(_0x47cda1,_0x2f72e6,_0x183354,_0x2ca745){logger[_0x23a4('0xe')]('Searching\x20enduser\x20with\x20phone',_0x183354);return request({'form':{'method':_0x23a4('0x2e'),'input_type':_0x23a4('0x24'),'response_type':_0x23a4('0x24'),'rest_data':JSON[_0x23a4('0x25')]({'session':_0x2ca745['id'],'module_name':_0x23a4('0x1d'),'query':util[_0x23a4('0x27')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x183354),'order_by':'','offset':'0','select_fields':['id',_0x23a4('0x10'),_0x23a4('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x23a4('0x3a')](function(_0x1df7a0){if(_0x1df7a0[_0x23a4('0x31')]['length']){var _0x5f7ee9=_[_0x23a4('0x3b')](_0x1df7a0[_0x23a4('0x31')],function(_0x226bd0){return _0x226bd0['name_value_list']['phone_home'][_0x23a4('0x32')]===_0x183354;});if(_0x5f7ee9){logger[_0x23a4('0xe')](_0x23a4('0x3c'));return BPromise[_0x23a4('0x34')]({'id':_0x5f7ee9[_0x23a4('0x35')]['id'][_0x23a4('0x32')],'name':_0x5f7ee9[_0x23a4('0x35')][_0x23a4('0x10')][_0x23a4('0x32')],'phone':_0x5f7ee9[_0x23a4('0x35')][_0x23a4('0x39')][_0x23a4('0x32')]});}}else{logger[_0x23a4('0xe')](_0x23a4('0x3d'));return request({'form':{'method':'set_entry','input_type':_0x23a4('0x24'),'response_type':_0x23a4('0x24'),'rest_data':JSON[_0x23a4('0x25')]({'session':_0x2ca745['id'],'module_name':_0x23a4('0x1d'),'name_value_list':[{'name':'first_name','value':_0x2f72e6!==_0x23a4('0x3e')?_0x2f72e6:util[_0x23a4('0x27')](_0x23a4('0x3f'),_0x183354)},{'name':_0x23a4('0x39'),'value':_0x183354}]})}})[_0x23a4('0x3a')](function(_0x592833){logger['info'](_0x23a4('0x40'));return BPromise[_0x23a4('0x34')]({'id':_0x592833['id'],'name':_0x592833['entry_list'][_0x23a4('0x41')][_0x23a4('0x32')],'phone':_0x592833[_0x23a4('0x31')]['phone_home'][_0x23a4('0x32')]});});}});}function request(_0x4313c0){logger[_0x23a4('0x42')]('[HTTP]',JSON[_0x23a4('0x25')](_0x4313c0));return rp(_[_0x23a4('0x43')](def,_0x4313c0));}function getTags(_0x1e8f57,_0x3d36ce){var _0x22a0fe=[];if(_0x1e8f57&&_0x1e8f57[_0x23a4('0x1e')]>0x0){_0x22a0fe=_['map'](_0x1e8f57,_0x3d36ce);}return _0x22a0fe;}function getCustomFields(_0x3efce7,_0xdedf6){var _0x39dcf5=[];var _0x3dfce2={'custom_fields':[]};if(_0x3efce7[_0x23a4('0x1e')]>0x0){_[_0x23a4('0x1f')](_0x3efce7,function(_0x44f931){if(_0x44f931['type']===_0x23a4('0x44')&&_0x44f931[_0x23a4('0x45')]&&!_0x44f931[_0x23a4('0x46')]){_0x3dfce2[_0x44f931[_0x23a4('0x45')][_0x23a4('0x47')]()]=_0x44f931[_0x23a4('0x48')][_0x23a4('0x29')]();}else if(_0x44f931['type']===_0x23a4('0x44')&&_0x44f931['idField']&&_0x44f931[_0x23a4('0x46')]){_0x3dfce2['custom_fields'][_0x23a4('0x21')]({'id':_0x44f931['idField'],'value':_0x44f931[_0x23a4('0x48')]['toString']()});}else if(_0x44f931[_0x23a4('0x49')]===_0x23a4('0x4a')&&_0x44f931[_0x23a4('0x20')]&&_0x44f931[_0x23a4('0x22')]&&_0x44f931[_0x23a4('0x46')]){_0xdedf6[_0x44f931[_0x23a4('0x20')]]&&_0x3dfce2['custom_fields'][_0x23a4('0x21')]({'id':_0x44f931['idField'],'value':_0xdedf6[_0x44f931[_0x23a4('0x20')]][_0x23a4('0x29')]()});}else if(_0x44f931['type']==='customVariable'&&_0x44f931[_0x23a4('0x4b')]&&_0x44f931[_0x23a4('0x4b')][_0x23a4('0x10')]&&_0x44f931[_0x23a4('0x22')]&&_0x44f931[_0x23a4('0x46')]){_0xdedf6[_0x44f931['Variable'][_0x23a4('0x10')][_0x23a4('0x47')]()]&&_0x3dfce2[_0x23a4('0x4c')]['push']({'id':_0x44f931[_0x23a4('0x22')],'value':_0xdedf6[_0x44f931[_0x23a4('0x4b')]['name'][_0x23a4('0x47')]()]['toString']()});}});}return _0x3dfce2;}function getConnection(_0x8cecc0){return request({'method':_0x23a4('0xc'),'form':{'method':_0x23a4('0x4d'),'input_type':_0x23a4('0x24'),'response_type':'JSON','rest_data':JSON[_0x23a4('0x25')]({'user_auth':{'user_name':_0x8cecc0[_0x23a4('0x4e')],'password':_0x8cecc0[_0x23a4('0x4f')],'encryption':_0x23a4('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x23a4('0x3a')](function(_0x4529eb){var _0x13d5a7=_0x4529eb;if(_0x13d5a7['id']){def[_0x23a4('0x51')]=_0x13d5a7['id'];return BPromise[_0x23a4('0x34')](_0x13d5a7);}else{throw new Error(util[_0x23a4('0x27')]('Account\x20%d\x20is\x20not\x20valid',_0x8cecc0['id']));}});}function setRelationship(_0x5977ff,_0x557e1f,_0x54797e,_0x5bdcf9){return request({'form':{'method':_0x23a4('0x52'),'input_type':_0x23a4('0x24'),'response_type':_0x23a4('0x24'),'rest_data':JSON[_0x23a4('0x25')]({'session':_0x5977ff['id'],'module_name':'Calls','module_id':_0x54797e['id'],'link_field_name':_0x5bdcf9,'related_ids':[_0x557e1f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x23a4('0x53')]=function(_0x50fdbe,_0x298243,_0x4c5e7d,_0x1cc2f0,_0x37e189,_0xc8da2c){var _0x10926a,_0x20c065,_0x2371fc,_0x34ac98;_0xc8da2c[_0x23a4('0x54')]=intUtil['stripTrailingSlash'](_0xc8da2c[_0x23a4('0x54')]);_0xc8da2c['serverUrl']=intUtil[_0x23a4('0x55')](_0xc8da2c[_0x23a4('0x56')]);def['uri']=util[_0x23a4('0x27')](_0x23a4('0x57'),_0xc8da2c[_0x23a4('0x54')]);if(_0x37e189&&_0x37e189[_0x23a4('0x58')]){logger[_0x23a4('0xe')](_0x23a4('0x59'),_0x23a4('0x5a'));_0x298243[_0x23a4('0x5b')]=util[_0x23a4('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc8da2c['serverUrl'],_0x298243['uniqueid'],md5(_0x298243[_0x23a4('0x5c')]));}else{_0x298243['recordingURL']='';}return getConnection(_0xc8da2c)[_0x23a4('0x3a')](function(_0x1da269){_0x34ac98=_0x1da269;return getUser(_0xc8da2c,_0x1cc2f0[_0x23a4('0x10')],_0x34ac98);})['then'](function(_0x100613){_0x10926a=_0x100613;logger['info'](_0x23a4('0x5d'),_0x10926a['id']);return getEndUser(_0xc8da2c,_0x298243[_0x23a4('0x5e')],_0x298243[_0x23a4('0x5f')],_0x34ac98);})[_0x23a4('0x3a')](function(_0x18f8a7){_0x20c065=_0x18f8a7;logger[_0x23a4('0xe')](_0x23a4('0x60'),_0x20c065['id']);return getTicket(_0xc8da2c,_0x10926a,_0x20c065,_0x4c5e7d,_0x298243,_0x4c5e7d[_0x23a4('0x61')],_0x34ac98,_0x23a4('0x62'));})[_0x23a4('0x3a')](function(_0x10a7a3){_0x2371fc=_0x10a7a3;logger[_0x23a4('0xe')]('Ticket\x20created!');logger[_0x23a4('0xe')]('The\x20Ticket\x20ID\x20is:',_0x2371fc['id']);return setRelationship(_0x34ac98,_0x10926a,_0x2371fc,_0x23a4('0x63'));})[_0x23a4('0x3a')](function(){return setRelationship(_0x34ac98,_0x20c065,_0x2371fc,_0x23a4('0x64'));})[_0x23a4('0x3a')](function(){return getServerInfo(_0x34ac98);})['then'](function(_0xe3839f){var _0x527b9f=parseInt(_0xe3839f[_0x23a4('0x65')][_0x23a4('0x66')](0x0));var _0x5694e8=util[_0x23a4('0x27')](_0x23a4('0x67'),_0xc8da2c[_0x23a4('0x54')],_0x2371fc['id']);if(_0x527b9f>0x6){_0x5694e8=util[_0x23a4('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xc8da2c[_0x23a4('0x54')],_0x2371fc['id']);}logger[_0x23a4('0xe')](_0x23a4('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x23a4('0x27')](_0x23a4('0x68'),_0x1cc2f0[_0x23a4('0x10')]),_0x23a4('0x69'),{'uri':_0x5694e8});})[_0x23a4('0x6a')](function(_0x2f5167){logger[_0x23a4('0x6b')](_0x23a4('0x59'),JSON[_0x23a4('0x25')](_0x2f5167));});};exports[_0x23a4('0x6c')]=function(_0x5b07e3,_0x3a5825,_0x1ffe0a,_0xa5a502,_0x1db9d4,_0x115785,_0x38722c){var _0x1b4a35,_0x2bda4f,_0x5b376c,_0x33d5a0;_0x115785['remoteUri']=intUtil[_0x23a4('0x55')](_0x115785[_0x23a4('0x54')]);_0x115785[_0x23a4('0x56')]=intUtil[_0x23a4('0x55')](_0x115785[_0x23a4('0x56')]);def[_0x23a4('0x6d')]=util[_0x23a4('0x27')](_0x23a4('0x57'),_0x115785[_0x23a4('0x54')]);if(_0x38722c&&_0x38722c['recordingFormat']&&_0x38722c[_0x23a4('0x6e')]!==_0x23a4('0x6f')){logger[_0x23a4('0xe')](_0x23a4('0x70'),_0x23a4('0x5a'));_0x3a5825[_0x23a4('0x5b')]=util['format'](_0x23a4('0x71'),_0x115785['serverUrl'],_0x3a5825[_0x23a4('0x5c')],md5(_0x3a5825['uniqueid']));}return getConnection(_0x115785)['then'](function(_0x49288d){_0x33d5a0=_0x49288d;return getUser(_0x115785,_0xa5a502[_0x23a4('0x10')],_0x33d5a0);})[_0x23a4('0x3a')](function(_0xa1713c){_0x1b4a35=_0xa1713c;logger[_0x23a4('0xe')](_0x23a4('0x5d'),_0x1b4a35['id']);return getEndUser(_0x115785,_0x3a5825[_0x23a4('0x72')],_0x3a5825[_0x23a4('0x73')],_0x33d5a0);})['then'](function(_0x1e85e1){_0x2bda4f=_0x1e85e1;logger[_0x23a4('0xe')](_0x23a4('0x60'),_0x2bda4f['id']);return getTicket(_0x115785,_0x1b4a35,_0x2bda4f,_0x1ffe0a,_0x3a5825,_0x1ffe0a[_0x23a4('0x61')],_0x33d5a0,_0x23a4('0x74'));})[_0x23a4('0x3a')](function(_0x4f96f4){_0x5b376c=_0x4f96f4;logger['info']('Ticket\x20created!');logger[_0x23a4('0xe')](_0x23a4('0x75'),_0x5b376c['id']);return setRelationship(_0x33d5a0,_0x1b4a35,_0x5b376c,_0x23a4('0x63'));})[_0x23a4('0x3a')](function(){return setRelationship(_0x33d5a0,_0x2bda4f,_0x5b376c,_0x23a4('0x64'));})[_0x23a4('0x3a')](function(){return getServerInfo(_0x33d5a0);})[_0x23a4('0x3a')](function(_0x1d8fd9){var _0x3317cc=parseInt(_0x1d8fd9[_0x23a4('0x65')][_0x23a4('0x66')](0x0));var _0x30acd9=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x115785[_0x23a4('0x54')],_0x5b376c['id']);if(_0x3317cc>0x6){_0x30acd9=util[_0x23a4('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x115785[_0x23a4('0x54')],_0x5b376c['id']);}logger[_0x23a4('0xe')](_0x23a4('0x70'),_0x23a4('0x76'));emit(util[_0x23a4('0x27')](_0x23a4('0x68'),_0xa5a502[_0x23a4('0x10')]),_0x23a4('0x69'),{'uri':_0x30acd9});})[_0x23a4('0x6a')](function(_0x1d216c){logger[_0x23a4('0x6b')](_0x23a4('0x70'),JSON[_0x23a4('0x25')](_0x1d216c));});};exports[_0x23a4('0x77')]=function(_0x2d6a12,_0x5e9819,_0x170d25,_0x5ebb80,_0x134f4b,_0x5453eb){var _0x106261,_0x363865,_0x2871b8,_0xaa5eb9;_0x5453eb[_0x23a4('0x54')]=intUtil[_0x23a4('0x55')](_0x5453eb['remoteUri']);_0x5453eb['serverUrl']=intUtil[_0x23a4('0x55')](_0x5453eb[_0x23a4('0x56')]);def['uri']=util[_0x23a4('0x27')](_0x23a4('0x57'),_0x5453eb[_0x23a4('0x54')]);if(_0x134f4b&&_0x134f4b[_0x23a4('0x58')]){logger[_0x23a4('0xe')]('['+_0x5e9819[_0x23a4('0x78')][_0x23a4('0x79')]()+']',_0x23a4('0x5a'));_0x5e9819[_0x23a4('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5453eb['serverUrl'],_0x5e9819[_0x23a4('0x5c')],md5(_0x5e9819[_0x23a4('0x5c')]));}else{_0x5e9819['recordingURL']='';}return getConnection(_0x5453eb)[_0x23a4('0x3a')](function(_0x2969cc){_0xaa5eb9=_0x2969cc;if(!_['isNil'](_0x5ebb80)){return getUser(_0x5453eb,_0x5ebb80['name'],_0xaa5eb9);}else{return getUser(_0x5453eb,null,_0xaa5eb9);}})['then'](function(_0x77bdef){_0x106261=_0x77bdef;logger[_0x23a4('0xe')](_0x23a4('0x5d'),_0x106261['id']);return getEndUser(_0x5453eb,_0x5e9819['calleridname'],_0x5e9819[_0x23a4('0x5f')],_0xaa5eb9);})[_0x23a4('0x3a')](function(_0x55b86b){_0x363865=_0x55b86b;logger['info'](_0x23a4('0x60'),_0x363865['id']);return getTicket(_0x5453eb,_0x106261,_0x363865,_0x170d25,_0x5e9819,_0x170d25[_0x23a4('0x61')],_0xaa5eb9,_0x23a4('0x62'));})[_0x23a4('0x3a')](function(_0x41bbc9){_0x2871b8=_0x41bbc9;logger['info'](_0x23a4('0x7a'));logger['info'](_0x23a4('0x75'),_0x2871b8['id']);return setRelationship(_0xaa5eb9,_0x106261,_0x2871b8,_0x23a4('0x63'));})[_0x23a4('0x3a')](function(){return setRelationship(_0xaa5eb9,_0x363865,_0x2871b8,_0x23a4('0x64'));})[_0x23a4('0x3a')](function(){return getServerInfo(_0xaa5eb9);})[_0x23a4('0x6a')](function(_0x4433b7){logger['error']('['+_0x5e9819[_0x23a4('0x78')][_0x23a4('0x79')]()+']',JSON[_0x23a4('0x25')](_0x4433b7));});}; \ No newline at end of file +var _0x9e37=['catch','lastevent','toUpperCase','md5','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','created_by','description','getString','Descriptions','date_start','toISOString','slice','duration_minutes','parent_id','Contacts','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','length','find','name_value_list','user_name','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','customField','nameField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[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:','Ticket\x20created!','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','Fields','Outbound','The\x20Ticket\x20ID\x20is:','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','monitor_format'];(function(_0x2067e3,_0x19bcb2){var _0x180c44=function(_0x53751f){while(--_0x53751f){_0x2067e3['push'](_0x2067e3['shift']());}};_0x180c44(++_0x19bcb2);}(_0x9e37,0x7c));var _0x79e3=function(_0x243bba,_0x1ea69f){_0x243bba=_0x243bba-0x0;var _0x12e696=_0x9e37[_0x243bba];return _0x12e696;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x79e3('0x0'));var util=require('util');var Redis=require(_0x79e3('0x1'));var intUtil=require('./util');var config=require(_0x79e3('0x2'));var logger=require(_0x79e3('0x3'))(_0x79e3('0x4'));config[_0x79e3('0x5')]=_['defaults'](config[_0x79e3('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x79e3('0x6'))(new Redis(config[_0x79e3('0x5')]));var def={'method':_0x79e3('0x7'),'json':!![]};function emit(_0x438b77,_0x4bac80,_0x50e9dc){io['to'](_0x438b77)[_0x79e3('0x8')](_0x4bac80,_0x50e9dc);}function getTicket(_0x44a06e,_0x58d4fb,_0x2287d0,_0x56002d,_0x3138ec,_0x18f706,_0x469c89,_0x389e59){logger[_0x79e3('0x9')](_0x79e3('0xa'));var _0x1e0cbd=new Date();var _0x2c3d51=[{'name':_0x79e3('0xb'),'value':intUtil['getString'](_0x56002d[_0x79e3('0xc')],_0x3138ec,'\x20')},{'name':'assigned_user_id','value':_0x58d4fb['id']},{'name':_0x79e3('0xd'),'value':_0x58d4fb['id']},{'name':_0x79e3('0xe'),'value':intUtil[_0x79e3('0xf')](_0x56002d[_0x79e3('0x10')],_0x3138ec,'\x0a')},{'name':_0x79e3('0x11'),'value':_0x1e0cbd[_0x79e3('0x12')]()[_0x79e3('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x79e3('0x14'),'value':'15'},{'name':_0x79e3('0x15'),'value':_0x2287d0['id']},{'name':'parent_type','value':_0x79e3('0x16')},{'name':_0x79e3('0x17'),'value':_0x2287d0[_0x79e3('0xb')]},{'name':_0x79e3('0x18'),'value':_0x389e59}];if(_0x18f706['length']){_[_0x79e3('0x19')](_0x18f706,function(_0x3dc848){if(_0x3138ec[_0x3dc848[_0x79e3('0x1a')]]){_0x2c3d51[_0x79e3('0x1b')]({'name':_0x3dc848[_0x79e3('0x1c')],'value':_0x3138ec[_0x3dc848[_0x79e3('0x1a')]]});}});}return request({'form':{'method':_0x79e3('0x1d'),'input_type':_0x79e3('0x1e'),'response_type':_0x79e3('0x1e'),'rest_data':JSON[_0x79e3('0x1f')]({'session':_0x469c89['id'],'module_name':'Calls','name_value_list':_0x2c3d51})}});}function getAuth(_0x5c5de7){return util[_0x79e3('0x20')](_0x79e3('0x21'),new Buffer(_0x5c5de7[_0x79e3('0x22')]+':X')[_0x79e3('0x23')](_0x79e3('0x24')));}function getServerInfo(_0x35fcbe){return request({'form':{'method':_0x79e3('0x25'),'input_type':_0x79e3('0x1e'),'response_type':_0x79e3('0x1e'),'rest_data':JSON[_0x79e3('0x1f')]({'session':_0x35fcbe['id']})}});}function getUser(_0x188bc0,_0x1f7b8c,_0x568a83){if(!_[_0x79e3('0x26')](_0x1f7b8c)){logger[_0x79e3('0x9')](_0x79e3('0x27'),_0x1f7b8c);return request({'form':{'method':_0x79e3('0x28'),'input_type':_0x79e3('0x1e'),'response_type':'JSON','rest_data':JSON[_0x79e3('0x1f')]({'session':_0x568a83['id'],'module_name':_0x79e3('0x29'),'query':util['format'](_0x79e3('0x2a'),_0x1f7b8c),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x79e3('0x2b')](function(_0x4a9562){if(_0x4a9562[_0x79e3('0x2c')][_0x79e3('0x2d')]){var _0x1be73f=_[_0x79e3('0x2e')](_0x4a9562[_0x79e3('0x2c')],function(_0x57bddc){return _0x57bddc[_0x79e3('0x2f')][_0x79e3('0x30')][_0x79e3('0x31')]===_0x1f7b8c;});if(_0x1be73f){logger[_0x79e3('0x9')](_0x79e3('0x32'));return BPromise['resolve']({'id':_0x1be73f[_0x79e3('0x2f')]['id'][_0x79e3('0x31')],'name':_0x1be73f[_0x79e3('0x2f')]['name'][_0x79e3('0x31')]});}}logger[_0x79e3('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x79e3('0x33')]({'id':_0x568a83['name_value_list'][_0x79e3('0x34')][_0x79e3('0x31')],'name':_0x568a83[_0x79e3('0x2f')][_0x79e3('0x30')]['value']});});}else{logger[_0x79e3('0x9')](_0x79e3('0x35'));return BPromise[_0x79e3('0x33')]({'id':_0x568a83[_0x79e3('0x2f')][_0x79e3('0x34')][_0x79e3('0x31')],'name':_0x568a83[_0x79e3('0x2f')][_0x79e3('0x30')][_0x79e3('0x31')]});}}function getEndUser(_0x1163ff,_0x434fb8,_0x470538,_0x696e42){logger['info'](_0x79e3('0x36'),_0x470538);return request({'form':{'method':_0x79e3('0x28'),'input_type':_0x79e3('0x1e'),'response_type':'JSON','rest_data':JSON[_0x79e3('0x1f')]({'session':_0x696e42['id'],'module_name':_0x79e3('0x16'),'query':util[_0x79e3('0x20')](_0x79e3('0x37'),_0x470538),'order_by':'','offset':'0','select_fields':['id',_0x79e3('0xb'),_0x79e3('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x307620){if(_0x307620[_0x79e3('0x2c')][_0x79e3('0x2d')]){var _0x6301bd=_['find'](_0x307620[_0x79e3('0x2c')],function(_0xff76cb){return _0xff76cb[_0x79e3('0x2f')]['phone_home'][_0x79e3('0x31')]===_0x470538;});if(_0x6301bd){logger[_0x79e3('0x9')](_0x79e3('0x39'));return BPromise[_0x79e3('0x33')]({'id':_0x6301bd['name_value_list']['id'][_0x79e3('0x31')],'name':_0x6301bd[_0x79e3('0x2f')][_0x79e3('0xb')]['value'],'phone':_0x6301bd[_0x79e3('0x2f')][_0x79e3('0x38')][_0x79e3('0x31')]});}}else{logger[_0x79e3('0x9')](_0x79e3('0x3a'));return request({'form':{'method':_0x79e3('0x1d'),'input_type':_0x79e3('0x1e'),'response_type':'JSON','rest_data':JSON[_0x79e3('0x1f')]({'session':_0x696e42['id'],'module_name':_0x79e3('0x16'),'name_value_list':[{'name':_0x79e3('0x3b'),'value':_0x434fb8!==_0x79e3('0x3c')?_0x434fb8:util[_0x79e3('0x20')](_0x79e3('0x3d'),_0x470538)},{'name':_0x79e3('0x38'),'value':_0x470538}]})}})[_0x79e3('0x2b')](function(_0x46f75e){logger[_0x79e3('0x9')](_0x79e3('0x3e'));return BPromise[_0x79e3('0x33')]({'id':_0x46f75e['id'],'name':_0x46f75e['entry_list'][_0x79e3('0x3b')]['value'],'phone':_0x46f75e[_0x79e3('0x2c')][_0x79e3('0x38')][_0x79e3('0x31')]});});}});}function request(_0x36ebf6){logger[_0x79e3('0x3f')](_0x79e3('0x40'),JSON['stringify'](_0x36ebf6));return rp(_['merge'](def,_0x36ebf6));}function getTags(_0x28847e,_0x5338a4){var _0x20bd30=[];if(_0x28847e&&_0x28847e[_0x79e3('0x2d')]>0x0){_0x20bd30=_[_0x79e3('0x41')](_0x28847e,_0x5338a4);}return _0x20bd30;}function getCustomFields(_0x5107e8,_0x5e1bc9){var _0x46f4a7=[];var _0xecd053={'custom_fields':[]};if(_0x5107e8['length']>0x0){_[_0x79e3('0x19')](_0x5107e8,function(_0x16e9e8){if(_0x16e9e8[_0x79e3('0x42')]===_0x79e3('0x43')&&_0x16e9e8['nameField']&&!_0x16e9e8[_0x79e3('0x44')]){_0xecd053[_0x16e9e8[_0x79e3('0x45')][_0x79e3('0x46')]()]=_0x16e9e8[_0x79e3('0x47')][_0x79e3('0x23')]();}else if(_0x16e9e8[_0x79e3('0x42')]===_0x79e3('0x43')&&_0x16e9e8[_0x79e3('0x1c')]&&_0x16e9e8[_0x79e3('0x44')]){_0xecd053[_0x79e3('0x48')][_0x79e3('0x1b')]({'id':_0x16e9e8[_0x79e3('0x1c')],'value':_0x16e9e8[_0x79e3('0x47')][_0x79e3('0x23')]()});}else if(_0x16e9e8[_0x79e3('0x42')]===_0x79e3('0x49')&&_0x16e9e8[_0x79e3('0x1a')]&&_0x16e9e8[_0x79e3('0x1c')]&&_0x16e9e8[_0x79e3('0x44')]){_0x5e1bc9[_0x16e9e8[_0x79e3('0x1a')]]&&_0xecd053[_0x79e3('0x48')][_0x79e3('0x1b')]({'id':_0x16e9e8['idField'],'value':_0x5e1bc9[_0x16e9e8[_0x79e3('0x1a')]][_0x79e3('0x23')]()});}else if(_0x16e9e8[_0x79e3('0x42')]===_0x79e3('0x4a')&&_0x16e9e8[_0x79e3('0x4b')]&&_0x16e9e8[_0x79e3('0x4b')]['name']&&_0x16e9e8[_0x79e3('0x1c')]&&_0x16e9e8[_0x79e3('0x44')]){_0x5e1bc9[_0x16e9e8[_0x79e3('0x4b')]['name'][_0x79e3('0x46')]()]&&_0xecd053[_0x79e3('0x48')]['push']({'id':_0x16e9e8[_0x79e3('0x1c')],'value':_0x5e1bc9[_0x16e9e8['Variable'][_0x79e3('0xb')][_0x79e3('0x46')]()]['toString']()});}});}return _0xecd053;}function getConnection(_0x3d222d){return request({'method':_0x79e3('0x7'),'form':{'method':_0x79e3('0x4c'),'input_type':_0x79e3('0x1e'),'response_type':'JSON','rest_data':JSON[_0x79e3('0x1f')]({'user_auth':{'user_name':_0x3d222d[_0x79e3('0x4d')],'password':_0x3d222d[_0x79e3('0x4e')],'encryption':_0x79e3('0x4f')},'application':_0x79e3('0x50')})}})['then'](function(_0x4f17f1){var _0x3e422a=_0x4f17f1;if(_0x3e422a['id']){def[_0x79e3('0x51')]=_0x3e422a['id'];return BPromise[_0x79e3('0x33')](_0x3e422a);}else{throw new Error(util[_0x79e3('0x20')](_0x79e3('0x52'),_0x3d222d['id']));}});}function setRelationship(_0x2a6614,_0x4a4e94,_0x35cc03,_0x1be055){return request({'form':{'method':'set_relationship','input_type':_0x79e3('0x1e'),'response_type':_0x79e3('0x1e'),'rest_data':JSON['stringify']({'session':_0x2a6614['id'],'module_name':_0x79e3('0x53'),'module_id':_0x35cc03['id'],'link_field_name':_0x1be055,'related_ids':[_0x4a4e94['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x79e3('0x54')]=function(_0x29fb6f,_0x10ac83,_0x23bd41,_0x15305e,_0x504fed,_0x2c6c16){var _0x249786,_0x5e7b4f,_0x522bdd,_0x16cc78;_0x2c6c16[_0x79e3('0x55')]=intUtil[_0x79e3('0x56')](_0x2c6c16[_0x79e3('0x55')]);_0x2c6c16[_0x79e3('0x57')]=intUtil[_0x79e3('0x56')](_0x2c6c16[_0x79e3('0x57')]);def[_0x79e3('0x58')]=util['format'](_0x79e3('0x59'),_0x2c6c16[_0x79e3('0x55')]);if(_0x504fed&&_0x504fed['monitor_format']){logger['info'](_0x79e3('0x5a'),_0x79e3('0x5b'));_0x10ac83[_0x79e3('0x5c')]=util['format'](_0x79e3('0x5d'),_0x2c6c16['serverUrl'],_0x10ac83[_0x79e3('0x5e')],md5(_0x10ac83['uniqueid']));}else{_0x10ac83[_0x79e3('0x5c')]='';}return getConnection(_0x2c6c16)[_0x79e3('0x2b')](function(_0x54a96f){_0x16cc78=_0x54a96f;return getUser(_0x2c6c16,_0x15305e['name'],_0x16cc78);})[_0x79e3('0x2b')](function(_0x3fe81a){_0x249786=_0x3fe81a;logger[_0x79e3('0x9')](_0x79e3('0x5f'),_0x249786['id']);return getEndUser(_0x2c6c16,_0x10ac83[_0x79e3('0x60')],_0x10ac83[_0x79e3('0x61')],_0x16cc78);})[_0x79e3('0x2b')](function(_0x50ec0a){_0x5e7b4f=_0x50ec0a;logger[_0x79e3('0x9')](_0x79e3('0x62'),_0x5e7b4f['id']);return getTicket(_0x2c6c16,_0x249786,_0x5e7b4f,_0x23bd41,_0x10ac83,_0x23bd41['Fields'],_0x16cc78,'Inbound');})[_0x79e3('0x2b')](function(_0x49dcf6){_0x522bdd=_0x49dcf6;logger['info'](_0x79e3('0x63'));logger[_0x79e3('0x9')]('The\x20Ticket\x20ID\x20is:',_0x522bdd['id']);return setRelationship(_0x16cc78,_0x249786,_0x522bdd,'users');})[_0x79e3('0x2b')](function(){return setRelationship(_0x16cc78,_0x5e7b4f,_0x522bdd,_0x79e3('0x64'));})['then'](function(){return getServerInfo(_0x16cc78);})[_0x79e3('0x2b')](function(_0x28310d){var _0x7e1d99=parseInt(_0x28310d[_0x79e3('0x65')][_0x79e3('0x66')](0x0));var _0x5f2520=util[_0x79e3('0x20')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2c6c16[_0x79e3('0x55')],_0x522bdd['id']);if(_0x7e1d99>0x6){_0x5f2520=util[_0x79e3('0x20')](_0x79e3('0x67'),_0x2c6c16[_0x79e3('0x55')],_0x522bdd['id']);}logger[_0x79e3('0x9')](_0x79e3('0x5a'),_0x79e3('0x68'));emit(util[_0x79e3('0x20')](_0x79e3('0x69'),_0x15305e[_0x79e3('0xb')]),'trigger:browser:url',{'uri':_0x5f2520});})['catch'](function(_0x2dd976){logger[_0x79e3('0x6a')](_0x79e3('0x5a'),JSON['stringify'](_0x2dd976));});};exports[_0x79e3('0x6b')]=function(_0x269a44,_0x1e0e42,_0x38c912,_0x35b3e5,_0x5d0bff,_0x50d534,_0x3e24ff){var _0x2538c5,_0xb52c0c,_0x59d199,_0x32a69f;_0x50d534[_0x79e3('0x55')]=intUtil['stripTrailingSlash'](_0x50d534[_0x79e3('0x55')]);_0x50d534[_0x79e3('0x57')]=intUtil[_0x79e3('0x56')](_0x50d534['serverUrl']);def[_0x79e3('0x58')]=util[_0x79e3('0x20')](_0x79e3('0x59'),_0x50d534['remoteUri']);if(_0x3e24ff&&_0x3e24ff['recordingFormat']&&_0x3e24ff[_0x79e3('0x6c')]!=='none'){logger['info'](_0x79e3('0x6d'),_0x79e3('0x5b'));_0x1e0e42[_0x79e3('0x5c')]=util[_0x79e3('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x50d534[_0x79e3('0x57')],_0x1e0e42[_0x79e3('0x5e')],md5(_0x1e0e42[_0x79e3('0x5e')]));}return getConnection(_0x50d534)[_0x79e3('0x2b')](function(_0x3af399){_0x32a69f=_0x3af399;return getUser(_0x50d534,_0x35b3e5[_0x79e3('0xb')],_0x32a69f);})[_0x79e3('0x2b')](function(_0x5ee1d5){_0x2538c5=_0x5ee1d5;logger[_0x79e3('0x9')](_0x79e3('0x5f'),_0x2538c5['id']);return getEndUser(_0x50d534,_0x1e0e42[_0x79e3('0x6e')],_0x1e0e42['destcalleridnum'],_0x32a69f);})[_0x79e3('0x2b')](function(_0x4be988){_0xb52c0c=_0x4be988;logger['info'](_0x79e3('0x62'),_0xb52c0c['id']);return getTicket(_0x50d534,_0x2538c5,_0xb52c0c,_0x38c912,_0x1e0e42,_0x38c912[_0x79e3('0x6f')],_0x32a69f,_0x79e3('0x70'));})[_0x79e3('0x2b')](function(_0x40d74e){_0x59d199=_0x40d74e;logger[_0x79e3('0x9')](_0x79e3('0x63'));logger['info'](_0x79e3('0x71'),_0x59d199['id']);return setRelationship(_0x32a69f,_0x2538c5,_0x59d199,_0x79e3('0x72'));})['then'](function(){return setRelationship(_0x32a69f,_0xb52c0c,_0x59d199,_0x79e3('0x64'));})[_0x79e3('0x2b')](function(){return getServerInfo(_0x32a69f);})[_0x79e3('0x2b')](function(_0x18226b){var _0x5f2f1a=parseInt(_0x18226b[_0x79e3('0x65')][_0x79e3('0x66')](0x0));var _0x524462=util[_0x79e3('0x20')](_0x79e3('0x73'),_0x50d534[_0x79e3('0x55')],_0x59d199['id']);if(_0x5f2f1a>0x6){_0x524462=util[_0x79e3('0x20')](_0x79e3('0x67'),_0x50d534[_0x79e3('0x55')],_0x59d199['id']);}logger[_0x79e3('0x9')](_0x79e3('0x6d'),_0x79e3('0x68'));emit(util['format'](_0x79e3('0x69'),_0x35b3e5['name']),_0x79e3('0x74'),{'uri':_0x524462});})['catch'](function(_0x5a9a9a){logger['error'](_0x79e3('0x6d'),JSON[_0x79e3('0x1f')](_0x5a9a9a));});};exports['unmanaged']=function(_0x31fe87,_0x63cb8,_0x5c2b65,_0x39dcb9,_0x1332be,_0x27d86c){var _0x52670c,_0x17cfc4,_0x359f5f,_0x55e7fa;_0x27d86c[_0x79e3('0x55')]=intUtil[_0x79e3('0x56')](_0x27d86c['remoteUri']);_0x27d86c[_0x79e3('0x57')]=intUtil[_0x79e3('0x56')](_0x27d86c[_0x79e3('0x57')]);def['uri']=util[_0x79e3('0x20')](_0x79e3('0x59'),_0x27d86c[_0x79e3('0x55')]);if(_0x1332be&&_0x1332be[_0x79e3('0x75')]){logger['info']('['+_0x63cb8['lastevent']['toUpperCase']()+']',_0x79e3('0x5b'));_0x63cb8[_0x79e3('0x5c')]=util['format'](_0x79e3('0x5d'),_0x27d86c[_0x79e3('0x57')],_0x63cb8[_0x79e3('0x5e')],md5(_0x63cb8['uniqueid']));}else{_0x63cb8[_0x79e3('0x5c')]='';}return getConnection(_0x27d86c)[_0x79e3('0x2b')](function(_0x298589){_0x55e7fa=_0x298589;if(!_['isNil'](_0x39dcb9)){return getUser(_0x27d86c,_0x39dcb9[_0x79e3('0xb')],_0x55e7fa);}else{return getUser(_0x27d86c,null,_0x55e7fa);}})['then'](function(_0x6515eb){_0x52670c=_0x6515eb;logger[_0x79e3('0x9')]('The\x20User\x20ID\x20is:',_0x52670c['id']);return getEndUser(_0x27d86c,_0x63cb8[_0x79e3('0x60')],_0x63cb8[_0x79e3('0x61')],_0x55e7fa);})['then'](function(_0x44fe30){_0x17cfc4=_0x44fe30;logger[_0x79e3('0x9')]('The\x20Enduser\x20ID\x20is:',_0x17cfc4['id']);return getTicket(_0x27d86c,_0x52670c,_0x17cfc4,_0x5c2b65,_0x63cb8,_0x5c2b65['Fields'],_0x55e7fa,'Inbound');})['then'](function(_0x106927){_0x359f5f=_0x106927;logger[_0x79e3('0x9')](_0x79e3('0x63'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x359f5f['id']);return setRelationship(_0x55e7fa,_0x52670c,_0x359f5f,_0x79e3('0x72'));})[_0x79e3('0x2b')](function(){return setRelationship(_0x55e7fa,_0x17cfc4,_0x359f5f,_0x79e3('0x64'));})['then'](function(){return getServerInfo(_0x55e7fa);})[_0x79e3('0x76')](function(_0x446a73){logger[_0x79e3('0x6a')]('['+_0x63cb8[_0x79e3('0x77')][_0x79e3('0x78')]()+']',JSON[_0x79e3('0x1f')](_0x446a73));});}; \ 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 4cbfc43..715c876 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 _0x67fe=['keyType','string','key','push','format','keyContent','variable','join','stripTrailingSlash','slice','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue'];(function(_0x4f6cc2,_0x3652b0){var _0x1f3163=function(_0x51c4e6){while(--_0x51c4e6){_0x4f6cc2['push'](_0x4f6cc2['shift']());}};_0x1f3163(++_0x3652b0);}(_0x67fe,0xaf));var _0xe67f=function(_0x207e3b,_0x45f48c){_0x207e3b=_0x207e3b-0x0;var _0xa8121a=_0x67fe[_0x207e3b];return _0xa8121a;};'use strict';var _=require(_0xe67f('0x0'));var util=require(_0xe67f('0x1'));exports[_0xe67f('0x2')]=function(_0x3f47e9,_0x3a0454,_0x2509d6){var _0x5ad6c0=[];if(_0x3f47e9[_0xe67f('0x3')]>0x0){var _0x5889bb=_[_0xe67f('0x4')](_0x3f47e9,['id']);for(var _0x313ac6=0x0;_0x313ac6<_0x5889bb['length'];_0x313ac6++){var _0x19ae49=_0x5889bb[_0x313ac6];if(_0x19ae49[_0xe67f('0x5')]==='string'){_0x5ad6c0['push'](_0x19ae49[_0xe67f('0x6')]);}else if(_0x19ae49[_0xe67f('0x5')]==='variable'&&_0x19ae49[_0xe67f('0x7')]){_0x3a0454[_0x19ae49['variableName']]&&_0x5ad6c0['push'](_0x3a0454[_0x19ae49[_0xe67f('0x7')]][_0xe67f('0x8')]());}else if(_0x19ae49[_0xe67f('0x5')]===_0xe67f('0x9')&&_0x19ae49['Variable']&&_0x19ae49[_0xe67f('0xa')][_0xe67f('0xb')]){_0x3a0454[_0x19ae49[_0xe67f('0xa')][_0xe67f('0xb')][_0xe67f('0xc')]()]&&_0x5ad6c0['push'](_0x3a0454[_0x19ae49['Variable'][_0xe67f('0xb')][_0xe67f('0xc')]()][_0xe67f('0x8')]());}else if(_0x19ae49['type']===_0xe67f('0xd')){if(_0x19ae49[_0xe67f('0xe')]===_0xe67f('0xf')&&_0x19ae49[_0xe67f('0x10')]){_0x5ad6c0[_0xe67f('0x11')](util[_0xe67f('0x12')]('%s:\x20%s',_0x19ae49['key'],_0x19ae49[_0xe67f('0x13')]));}else if(_0x19ae49[_0xe67f('0xe')]===_0xe67f('0x14')&&_0x19ae49['variableName']&&_0x19ae49[_0xe67f('0x10')]){_0x3a0454[_0x19ae49['variableName']]&&_0x5ad6c0[_0xe67f('0x11')](util['format']('%s:\x20%s',_0x19ae49[_0xe67f('0x10')],_0x3a0454[_0x19ae49['variableName']]));}else if(_0x19ae49[_0xe67f('0xe')]==='customVariable'&&_0x19ae49['Variable']&&_0x19ae49[_0xe67f('0xa')][_0xe67f('0xb')]&&_0x19ae49['key']){_0x3a0454[_0x19ae49[_0xe67f('0xa')][_0xe67f('0xb')][_0xe67f('0xc')]()]&&_0x5ad6c0[_0xe67f('0x11')](util[_0xe67f('0x12')]('%s:\x20%s',_0x19ae49['key'],_0x3a0454[_0x19ae49[_0xe67f('0xa')][_0xe67f('0xb')]['toLowerCase']()]));}}}}return _0x5ad6c0[_0xe67f('0x15')](_0x2509d6);};exports[_0xe67f('0x16')]=function(_0x4e3da6){var _0x2fc003=_0x4e3da6[_0xe67f('0x17')](-0x1);if(_0x2fc003==='/'){_0x4e3da6=_0x4e3da6['substring'](0x0,_0x4e3da6['lastIndexOf'](_0x2fc003));}return _0x4e3da6;};exports[_0xe67f('0x18')]=function(_0x30f14f){if(!_[_0xe67f('0x19')](_0x30f14f)&&_0x30f14f!==''){var _0x3f3df7=/^(([^<>()\[\]\\.,;:\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 _0x3f3df7[_0xe67f('0x1a')](String(_0x30f14f)[_0xe67f('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xb68d=['Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable'];(function(_0x4b2256,_0x5a9835){var _0x31a63d=function(_0x2d0bdc){while(--_0x2d0bdc){_0x4b2256['push'](_0x4b2256['shift']());}};_0x31a63d(++_0x5a9835);}(_0xb68d,0x160));var _0xdb68=function(_0x112c3b,_0x30c0bc){_0x112c3b=_0x112c3b-0x0;var _0x47f747=_0xb68d[_0x112c3b];return _0x47f747;};'use strict';var _=require(_0xdb68('0x0'));var util=require(_0xdb68('0x1'));exports['getString']=function(_0x37bd64,_0x9cd16d,_0xf76ca6){var _0x221dd0=[];if(_0x37bd64[_0xdb68('0x2')]>0x0){var _0x319bfb=_[_0xdb68('0x3')](_0x37bd64,['id']);for(var _0x25eb73=0x0;_0x25eb73<_0x319bfb[_0xdb68('0x2')];_0x25eb73++){var _0x390ea3=_0x319bfb[_0x25eb73];if(_0x390ea3['type']===_0xdb68('0x4')){_0x221dd0[_0xdb68('0x5')](_0x390ea3[_0xdb68('0x6')]);}else if(_0x390ea3[_0xdb68('0x7')]===_0xdb68('0x8')&&_0x390ea3[_0xdb68('0x9')]){_0x9cd16d[_0x390ea3[_0xdb68('0x9')]]&&_0x221dd0[_0xdb68('0x5')](_0x9cd16d[_0x390ea3['variableName']][_0xdb68('0xa')]());}else if(_0x390ea3[_0xdb68('0x7')]===_0xdb68('0xb')&&_0x390ea3[_0xdb68('0xc')]&&_0x390ea3[_0xdb68('0xc')][_0xdb68('0xd')]){_0x9cd16d[_0x390ea3[_0xdb68('0xc')][_0xdb68('0xd')][_0xdb68('0xe')]()]&&_0x221dd0[_0xdb68('0x5')](_0x9cd16d[_0x390ea3[_0xdb68('0xc')][_0xdb68('0xd')][_0xdb68('0xe')]()][_0xdb68('0xa')]());}else if(_0x390ea3[_0xdb68('0x7')]===_0xdb68('0xf')){if(_0x390ea3[_0xdb68('0x10')]===_0xdb68('0x4')&&_0x390ea3[_0xdb68('0x11')]){_0x221dd0['push'](util[_0xdb68('0x12')](_0xdb68('0x13'),_0x390ea3[_0xdb68('0x11')],_0x390ea3[_0xdb68('0x14')]));}else if(_0x390ea3[_0xdb68('0x10')]===_0xdb68('0x8')&&_0x390ea3[_0xdb68('0x9')]&&_0x390ea3[_0xdb68('0x11')]){_0x9cd16d[_0x390ea3[_0xdb68('0x9')]]&&_0x221dd0[_0xdb68('0x5')](util[_0xdb68('0x12')](_0xdb68('0x13'),_0x390ea3[_0xdb68('0x11')],_0x9cd16d[_0x390ea3[_0xdb68('0x9')]]));}else if(_0x390ea3[_0xdb68('0x10')]===_0xdb68('0xb')&&_0x390ea3['Variable']&&_0x390ea3['Variable'][_0xdb68('0xd')]&&_0x390ea3[_0xdb68('0x11')]){_0x9cd16d[_0x390ea3[_0xdb68('0xc')]['name']['toLowerCase']()]&&_0x221dd0[_0xdb68('0x5')](util[_0xdb68('0x12')](_0xdb68('0x13'),_0x390ea3[_0xdb68('0x11')],_0x9cd16d[_0x390ea3[_0xdb68('0xc')]['name']['toLowerCase']()]));}}}}return _0x221dd0['join'](_0xf76ca6);};exports['stripTrailingSlash']=function(_0x111545){var _0x53418e=_0x111545[_0xdb68('0x15')](-0x1);if(_0x53418e==='/'){_0x111545=_0x111545[_0xdb68('0x16')](0x0,_0x111545[_0xdb68('0x17')](_0x53418e));}return _0x111545;};exports[_0xdb68('0x18')]=function(_0x5879a6){if(!_[_0xdb68('0x19')](_0x5879a6)&&_0x5879a6!==''){var _0xf1d04b=/^(([^<>()\[\]\\.,;:\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 _0xf1d04b['test'](String(_0x5879a6)['toLowerCase']());}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 bdb75a2..6ea6b61 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0xfb2afc,_0x27cbd3){var _0x5aafcf=function(_0x21992b){while(--_0x21992b){_0xfb2afc['push'](_0xfb2afc['shift']());}};_0x5aafcf(++_0x27cbd3);}(_0x34e8,0x12c));var _0x834e=function(_0x26a8a1,_0x5b4856){_0x26a8a1=_0x26a8a1-0x0;var _0x323f37=_0x34e8[_0x26a8a1];return _0x323f37;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 0733022..480faa6 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 _0x3cc9=['The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','format','%s/search.json','type:user\x20role:agent\x20email:%s','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','remoteUri','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','results','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','content','idField','customField','push','variableName','custom_fields','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x1f01f8,_0xe249c5){var _0x31ea67=function(_0x5e05b5){while(--_0x5e05b5){_0x1f01f8['push'](_0x1f01f8['shift']());}};_0x31ea67(++_0xe249c5);}(_0x3cc9,0x105));var _0x93cc=function(_0x3e05a0,_0x2426a3){_0x3e05a0=_0x3e05a0-0x0;var _0x5084fc=_0x3cc9[_0x3e05a0];return _0x5084fc;};'use strict';var _=require(_0x93cc('0x0'));var rp=require(_0x93cc('0x1'));var md5=require(_0x93cc('0x2'));var util=require('util');var Redis=require(_0x93cc('0x3'));var intUtil=require(_0x93cc('0x4'));var config=require(_0x93cc('0x5'));var logger=require(_0x93cc('0x6'))('zendesk');config['redis']=_[_0x93cc('0x7')](config[_0x93cc('0x8')],{'host':_0x93cc('0x9'),'port':0x18eb});var io=require(_0x93cc('0xa'))(new Redis(config[_0x93cc('0x8')]));function emit(_0x43b9af,_0x4621a1,_0xe59ae6){io['to'](_0x43b9af)[_0x93cc('0xb')](_0x4621a1,_0xe59ae6);}var headers={'Content-Type':'application/json','Accept':_0x93cc('0xc')};function getTicket(_0x3f23b4,_0x4f0a03,_0x532578,_0x2f25c3,_0x29ecb8){logger[_0x93cc('0xd')](_0x93cc('0xe'));return request({'uri':util['format'](_0x93cc('0xf'),_0x3f23b4['remoteUri']),'method':_0x93cc('0x10'),'body':{'ticket':_[_0x93cc('0x11')]({'requester_id':_0x532578['id'],'submitter_id':_0x4f0a03?_0x4f0a03['id']:undefined,'assignee_id':_0x4f0a03?_0x4f0a03['id']:undefined,'tags':getTags(_0x2f25c3[_0x93cc('0x12')],'name'),'subject':intUtil[_0x93cc('0x13')](_0x2f25c3[_0x93cc('0x14')],_0x29ecb8,'\x20'),'description':intUtil[_0x93cc('0x13')](_0x2f25c3[_0x93cc('0x15')],_0x29ecb8,'\x0a'),'comment':{'public':![],'body':intUtil[_0x93cc('0x13')](_0x2f25c3['Descriptions'],_0x29ecb8,'\x0a')}},getCustomFields(_0x2f25c3[_0x93cc('0x16')],_0x29ecb8))}})[_0x93cc('0x17')](function(_0x148a19){logger[_0x93cc('0xd')](_0x93cc('0x18'));return _0x148a19['ticket'];});}function getUser(_0x627d07,_0x5900a3){if(intUtil[_0x93cc('0x19')](_0x5900a3)){logger[_0x93cc('0xd')]('Getting\x20agent\x20with\x20email',_0x5900a3);return request({'uri':util[_0x93cc('0x1a')](_0x93cc('0x1b'),_0x627d07['remoteUri']),'qs':{'query':util['format'](_0x93cc('0x1c'),_0x5900a3)}})['then'](function(_0x2d9bb2){if(_0x2d9bb2['count']){logger[_0x93cc('0xd')]('Agent\x20found!');return _[_0x93cc('0x1d')](_0x2d9bb2['results'],{'email':_0x5900a3,'role':_0x93cc('0x1e')});}else{logger['info'](_0x93cc('0x1f'));return request({'uri':util[_0x93cc('0x1a')](_0x93cc('0x20'),_0x627d07['remoteUri'])})[_0x93cc('0x17')](function(_0x51258d){logger[_0x93cc('0xd')]('Admin\x20account\x20selected.');return _0x51258d[_0x93cc('0x21')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x93cc('0x1a')](_0x93cc('0x20'),_0x627d07[_0x93cc('0x22')])})[_0x93cc('0x17')](function(_0x441b65){logger[_0x93cc('0xd')](_0x93cc('0x23'));return _0x441b65['user'];});}}function getEndUser(_0x3f9e7f,_0x44c1f8,_0xa1820a){logger[_0x93cc('0xd')](_0x93cc('0x24'),_0xa1820a);return request({'uri':util[_0x93cc('0x1a')]('%s/search.json',_0x3f9e7f[_0x93cc('0x22')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0xa1820a)}})['then'](function(_0x378048){var _0x5e1e9c;if(_0x378048['results'][_0x93cc('0x25')]){_0x378048[_0x93cc('0x26')]=_[_0x93cc('0x27')](_0x378048[_0x93cc('0x26')],{'suspended':![],'role':'end-user'});if(_0x378048[_0x93cc('0x26')][_0x93cc('0x25')]){_0x5e1e9c=_[_0x93cc('0x28')](_0x378048[_0x93cc('0x26')]);}}if(_0x5e1e9c){logger[_0x93cc('0xd')](_0x93cc('0x29'));return _0x5e1e9c;}else{logger[_0x93cc('0xd')](_0x93cc('0x2a'));return request({'uri':util[_0x93cc('0x1a')](_0x93cc('0x2b'),_0x3f9e7f['remoteUri']),'method':_0x93cc('0x10'),'body':{'user':{'role':_0x93cc('0x2c'),'name':util['format'](_0x93cc('0x2d'),_0x44c1f8||_0xa1820a),'phone':_0xa1820a}}})[_0x93cc('0x17')](function(_0x5911e9){logger[_0x93cc('0xd')](_0x93cc('0x2e'));return _0x5911e9[_0x93cc('0x21')];});}});}function getAuth(_0x51bce7){var _0x1c215a;if(_0x51bce7['authType']===_0x93cc('0x2f')){_0x1c215a=util[_0x93cc('0x1a')](_0x93cc('0x30'),_0x51bce7[_0x93cc('0x31')],_0x51bce7[_0x93cc('0x2f')]);}else if(_0x51bce7[_0x93cc('0x32')]===_0x93cc('0x33')){_0x1c215a=util[_0x93cc('0x1a')](_0x93cc('0x34'),_0x51bce7[_0x93cc('0x31')],_0x51bce7[_0x93cc('0x33')]);}return util['format'](_0x93cc('0x35'),new Buffer(_0x1c215a)[_0x93cc('0x36')](_0x93cc('0x37')));}function request(_0x86a18e){logger[_0x93cc('0x38')](_0x93cc('0x39'),JSON[_0x93cc('0x3a')](_0x86a18e));return rp(_[_0x93cc('0x7')](_0x86a18e,{'method':_0x93cc('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x49aac2,_0x791812){var _0x2a4b55=[];if(_0x49aac2&&_0x49aac2['length']>0x0){_0x2a4b55=_[_0x93cc('0x3c')](_0x49aac2,_0x791812);}return _0x2a4b55;}function getCustomFields(_0x41cdc9,_0x33ee93){var _0x1519ac=[];var _0x3e37b1={'custom_fields':[]};if(_0x41cdc9[_0x93cc('0x25')]>0x0){_[_0x93cc('0x3d')](_0x41cdc9,function(_0x1a39dd){if(_[_0x93cc('0x3e')]([_0x93cc('0x3f'),_0x93cc('0x40')],_0x1a39dd[_0x93cc('0x41')])&&_0x1a39dd[_0x93cc('0x42')]&&!_0x1a39dd['customField']){_0x3e37b1[_0x1a39dd[_0x93cc('0x42')]['toLowerCase']()]=_0x1a39dd[_0x93cc('0x43')]['toString']();}else if(_['includes']([_0x93cc('0x3f'),'picklist'],_0x1a39dd[_0x93cc('0x41')])&&_0x1a39dd[_0x93cc('0x44')]&&_0x1a39dd[_0x93cc('0x45')]){_0x3e37b1['custom_fields'][_0x93cc('0x46')]({'id':_0x1a39dd['idField'],'value':_0x1a39dd['content']['toString']()});}else if(_0x1a39dd[_0x93cc('0x41')]==='variable'&&_0x1a39dd[_0x93cc('0x47')]&&_0x1a39dd[_0x93cc('0x44')]&&_0x1a39dd['customField']){_0x33ee93[_0x1a39dd['variableName']]&&_0x3e37b1[_0x93cc('0x48')][_0x93cc('0x46')]({'id':_0x1a39dd[_0x93cc('0x44')],'value':_0x33ee93[_0x1a39dd[_0x93cc('0x47')]]['toString']()});}else if(_0x1a39dd[_0x93cc('0x41')]===_0x93cc('0x49')&&_0x1a39dd[_0x93cc('0x4a')]&&_0x1a39dd[_0x93cc('0x4a')][_0x93cc('0x4b')]&&_0x1a39dd['idField']&&_0x1a39dd[_0x93cc('0x45')]){_0x33ee93[_0x1a39dd['Variable'][_0x93cc('0x4b')][_0x93cc('0x4c')]()]&&_0x3e37b1['custom_fields'][_0x93cc('0x46')]({'id':_0x1a39dd[_0x93cc('0x44')],'value':_0x33ee93[_0x1a39dd[_0x93cc('0x4a')]['name'][_0x93cc('0x4c')]()][_0x93cc('0x36')]()});}});}return _0x3e37b1;}exports[_0x93cc('0x4d')]=function(_0x211565,_0x1bf973,_0x1d2d87,_0x1ae6fd,_0xadbd7,_0x2f02f8){var _0x1e31b4,_0x2f0d34;_0x2f02f8[_0x93cc('0x22')]=intUtil[_0x93cc('0x4e')](_0x2f02f8['remoteUri']);_0x2f02f8[_0x93cc('0x4f')]=intUtil[_0x93cc('0x4e')](_0x2f02f8[_0x93cc('0x4f')]);if(_0xadbd7&&_0xadbd7['monitor_format']){logger['info'](_0x93cc('0x50'),_0x93cc('0x51'));_0x1bf973[_0x93cc('0x52')]=util['format'](_0x93cc('0x53'),_0x2f02f8[_0x93cc('0x4f')],_0x1bf973[_0x93cc('0x54')],md5(_0x1bf973[_0x93cc('0x54')]));}else{_0x1bf973[_0x93cc('0x52')]='';}headers['Authorization']=getAuth(_0x2f02f8);return getUser(_0x2f02f8,_0x1ae6fd[_0x93cc('0x55')])[_0x93cc('0x17')](function(_0x2658cc){_0x1e31b4=_0x2658cc;logger[_0x93cc('0xd')](_0x93cc('0x56'),_0x1e31b4['id']);return getEndUser(_0x2f02f8,_0x1bf973[_0x93cc('0x57')],_0x1bf973[_0x93cc('0x58')]);})['then'](function(_0x47ff31){_0x2f0d34=_0x47ff31;logger[_0x93cc('0xd')](_0x93cc('0x59'),_0x2f0d34['id']);return getTicket(_0x2f02f8,_0x1e31b4,_0x2f0d34,_0x1d2d87,_0x1bf973);})[_0x93cc('0x17')](function(_0x2ecc4a){if(_0x2ecc4a){logger['info'](_0x93cc('0x5a'),_0x2ecc4a['id']);switch(_0x2f02f8['type']){case _0x93cc('0x5b'):logger[_0x93cc('0xd')]('[QUEUE]',_0x93cc('0x5c'));return request({'uri':util[_0x93cc('0x1a')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2f02f8[_0x93cc('0x22')],_0x1e31b4['id'],_0x2ecc4a['id']),'method':'POST'});case'newTab':logger[_0x93cc('0xd')](_0x93cc('0x50'),_0x93cc('0x5d'));emit(util[_0x93cc('0x1a')](_0x93cc('0x5e'),_0x1ae6fd[_0x93cc('0x4b')]),'trigger:browser:url',{'uri':util[_0x93cc('0x1a')](_0x93cc('0x5f'),_0x2f02f8['remoteUri'][_0x93cc('0x60')](_0x93cc('0x61'),''),_0x2ecc4a['id'])});break;default:logger['error'](_0x93cc('0x50'),_0x93cc('0x62'));}}})[_0x93cc('0x63')](function(_0x56dfa6){logger['error'](_0x93cc('0x64'),util[_0x93cc('0x65')](_0x56dfa6,{'showHidden':!![],'depth':null}));});};exports[_0x93cc('0x66')]=function(_0x54f0d0,_0x540b3e,_0x5459d4,_0x12c35a,_0x1c4ada,_0x51b51c,_0xc65b50){var _0x91e93c,_0x27a323;_0x51b51c[_0x93cc('0x22')]=intUtil[_0x93cc('0x4e')](_0x51b51c[_0x93cc('0x22')]);_0x51b51c[_0x93cc('0x4f')]=intUtil['stripTrailingSlash'](_0x51b51c[_0x93cc('0x4f')]);if(_0xc65b50&&_0xc65b50[_0x93cc('0x67')]&&_0xc65b50[_0x93cc('0x67')]!==_0x93cc('0x68')){logger['info'](_0x93cc('0x69'),_0x93cc('0x51'));_0x540b3e['recordingURL']=util[_0x93cc('0x1a')](_0x93cc('0x53'),_0x51b51c[_0x93cc('0x4f')],_0x540b3e[_0x93cc('0x54')],md5(_0x540b3e[_0x93cc('0x54')]));}headers[_0x93cc('0x6a')]=getAuth(_0x51b51c);return getUser(_0x51b51c,_0x12c35a[_0x93cc('0x55')])[_0x93cc('0x17')](function(_0x513e17){_0x91e93c=_0x513e17;logger['info'](_0x93cc('0x56'),_0x91e93c['id']);return getEndUser(_0x51b51c,_0x540b3e['destcalleridname'],_0x540b3e[_0x93cc('0x6b')]);})[_0x93cc('0x17')](function(_0x2e0b5d){_0x27a323=_0x2e0b5d;logger['info']('The\x20Enduser\x20ID\x20is:',_0x27a323['id']);return getTicket(_0x51b51c,_0x91e93c,_0x27a323,_0x5459d4,_0x540b3e);})[_0x93cc('0x17')](function(_0x33282e){if(_0x33282e){logger[_0x93cc('0xd')]('The\x20Ticket\x20ID\x20is:',_0x33282e['id']);switch(_0x51b51c[_0x93cc('0x41')]){case _0x93cc('0x5b'):logger['info'](_0x93cc('0x69'),_0x93cc('0x5c'));return request({'uri':util[_0x93cc('0x1a')](_0x93cc('0x6c'),_0x51b51c[_0x93cc('0x22')],_0x91e93c['id'],_0x33282e['id']),'method':'POST'});case _0x93cc('0x6d'):logger[_0x93cc('0xd')]('[OUTBOUND]',_0x93cc('0x5d'));emit(util[_0x93cc('0x1a')](_0x93cc('0x5e'),_0x12c35a[_0x93cc('0x4b')]),_0x93cc('0x6e'),{'uri':util['format']('%s/agent/tickets/%s',_0x51b51c[_0x93cc('0x22')]['replace']('/api/v2',''),_0x33282e['id'])});break;default:logger[_0x93cc('0x6f')](_0x93cc('0x69'),_0x93cc('0x62'));}}})[_0x93cc('0x63')](function(_0x11ddf2){logger['error'](_0x93cc('0x70'),util[_0x93cc('0x65')](_0x11ddf2,{'showHidden':!![],'depth':null}));});};exports[_0x93cc('0x71')]=function(_0x286ead,_0x501ad6,_0x1aa758,_0x373357,_0x2fe690,_0x29a52a){var _0x424da5,_0x2ac2ae;_0x29a52a[_0x93cc('0x22')]=intUtil[_0x93cc('0x4e')](_0x29a52a['remoteUri']);_0x29a52a[_0x93cc('0x4f')]=intUtil['stripTrailingSlash'](_0x29a52a[_0x93cc('0x4f')]);if(_0x2fe690&&_0x2fe690[_0x93cc('0x72')]){logger['info']('['+_0x501ad6[_0x93cc('0x73')]['toUpperCase']()+']',_0x93cc('0x51'));_0x501ad6['recordingURL']=util[_0x93cc('0x1a')](_0x93cc('0x53'),_0x29a52a[_0x93cc('0x4f')],_0x501ad6[_0x93cc('0x54')],md5(_0x501ad6['uniqueid']));}else{_0x501ad6[_0x93cc('0x52')]='';}headers[_0x93cc('0x6a')]=getAuth(_0x29a52a);return getUser(_0x29a52a)[_0x93cc('0x17')](function(_0x43b865){_0x424da5=_0x43b865;logger[_0x93cc('0xd')]('The\x20User\x20ID\x20is:',_0x424da5['id']);return getEndUser(_0x29a52a,_0x501ad6['calleridname'],_0x501ad6['calleridnum']);})[_0x93cc('0x17')](function(_0x1329b4){_0x2ac2ae=_0x1329b4;logger['info'](_0x93cc('0x59'),_0x2ac2ae['id']);return getTicket(_0x29a52a,_0x424da5,_0x2ac2ae,_0x1aa758,_0x501ad6);})[_0x93cc('0x17')](function(_0x3c47d3){if(_0x3c47d3){logger['info']('The\x20Ticket\x20ID\x20is:',_0x3c47d3['id']);}})['catch'](function(_0xb5c2e5){logger['error']('['+_0x501ad6['lastevent'][_0x93cc('0x74')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x93cc('0x65')](_0xb5c2e5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5dcb=['catch','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','stringify','GET','length','map','forEach','includes','type','nameField','customField','toLowerCase','content','idField','variable','variableName','custom_fields','Variable','push','queue','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','email'];(function(_0x7f3cde,_0x110d5e){var _0x35ec22=function(_0xd495b){while(--_0xd495b){_0x7f3cde['push'](_0x7f3cde['shift']());}};_0x35ec22(++_0x110d5e);}(_0x5dcb,0x1c2));var _0xb5dc=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0x5dcb[_0x547ff4];return _0xe41057;};'use strict';var _=require(_0xb5dc('0x0'));var rp=require(_0xb5dc('0x1'));var md5=require(_0xb5dc('0x2'));var util=require(_0xb5dc('0x3'));var Redis=require(_0xb5dc('0x4'));var intUtil=require(_0xb5dc('0x5'));var config=require(_0xb5dc('0x6'));var logger=require(_0xb5dc('0x7'))(_0xb5dc('0x8'));config[_0xb5dc('0x9')]=_[_0xb5dc('0xa')](config[_0xb5dc('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb5dc('0xb'))(new Redis(config[_0xb5dc('0x9')]));function emit(_0x2f615f,_0x1a02cf,_0x2c7c63){io['to'](_0x2f615f)[_0xb5dc('0xc')](_0x1a02cf,_0x2c7c63);}var headers={'Content-Type':_0xb5dc('0xd'),'Accept':_0xb5dc('0xd')};function getTicket(_0x283228,_0x2a5684,_0x2d61c9,_0x5becb0,_0x2c0f4a){logger['info'](_0xb5dc('0xe'));return request({'uri':util['format'](_0xb5dc('0xf'),_0x283228[_0xb5dc('0x10')]),'method':_0xb5dc('0x11'),'body':{'ticket':_[_0xb5dc('0x12')]({'requester_id':_0x2d61c9['id'],'submitter_id':_0x2a5684?_0x2a5684['id']:undefined,'assignee_id':_0x2a5684?_0x2a5684['id']:undefined,'tags':getTags(_0x5becb0[_0xb5dc('0x13')],_0xb5dc('0x14')),'subject':intUtil[_0xb5dc('0x15')](_0x5becb0[_0xb5dc('0x16')],_0x2c0f4a,'\x20'),'description':intUtil[_0xb5dc('0x15')](_0x5becb0[_0xb5dc('0x17')],_0x2c0f4a,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb5dc('0x15')](_0x5becb0[_0xb5dc('0x17')],_0x2c0f4a,'\x0a')}},getCustomFields(_0x5becb0[_0xb5dc('0x18')],_0x2c0f4a))}})[_0xb5dc('0x19')](function(_0x210cf9){logger[_0xb5dc('0x1a')](_0xb5dc('0x1b'));return _0x210cf9[_0xb5dc('0x1c')];});}function getUser(_0x3f95be,_0x5a7dde){if(intUtil['validateEmail'](_0x5a7dde)){logger[_0xb5dc('0x1a')](_0xb5dc('0x1d'),_0x5a7dde);return request({'uri':util[_0xb5dc('0x1e')](_0xb5dc('0x1f'),_0x3f95be[_0xb5dc('0x10')]),'qs':{'query':util[_0xb5dc('0x1e')](_0xb5dc('0x20'),_0x5a7dde)}})[_0xb5dc('0x19')](function(_0x2cf446){if(_0x2cf446[_0xb5dc('0x21')]){logger[_0xb5dc('0x1a')]('Agent\x20found!');return _[_0xb5dc('0x22')](_0x2cf446[_0xb5dc('0x23')],{'email':_0x5a7dde,'role':_0xb5dc('0x24')});}else{logger[_0xb5dc('0x1a')](_0xb5dc('0x25'));return request({'uri':util[_0xb5dc('0x1e')](_0xb5dc('0x26'),_0x3f95be[_0xb5dc('0x10')])})['then'](function(_0x2ec73b){logger[_0xb5dc('0x1a')](_0xb5dc('0x27'));return _0x2ec73b[_0xb5dc('0x28')];});}});}else{logger[_0xb5dc('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb5dc('0x1e')](_0xb5dc('0x26'),_0x3f95be[_0xb5dc('0x10')])})[_0xb5dc('0x19')](function(_0x1dc199){logger[_0xb5dc('0x1a')]('Admin\x20account\x20selected.');return _0x1dc199['user'];});}}function getEndUser(_0x5b755a,_0x437ef4,_0x359fd7){logger['info']('Searching\x20enduser\x20with\x20phone',_0x359fd7);return request({'uri':util[_0xb5dc('0x1e')]('%s/search.json',_0x5b755a[_0xb5dc('0x10')]),'qs':{'query':util[_0xb5dc('0x1e')]('type:user\x20role:end-user\x20phone:%s',_0x359fd7)}})['then'](function(_0x1f4c99){var _0x2f03c1;if(_0x1f4c99[_0xb5dc('0x23')]['length']){_0x1f4c99[_0xb5dc('0x23')]=_[_0xb5dc('0x29')](_0x1f4c99[_0xb5dc('0x23')],{'suspended':![],'role':_0xb5dc('0x2a')});if(_0x1f4c99['results']['length']){_0x2f03c1=_[_0xb5dc('0x2b')](_0x1f4c99[_0xb5dc('0x23')]);}}if(_0x2f03c1){logger[_0xb5dc('0x1a')](_0xb5dc('0x2c'));return _0x2f03c1;}else{logger[_0xb5dc('0x1a')](_0xb5dc('0x2d'));return request({'uri':util[_0xb5dc('0x1e')](_0xb5dc('0x2e'),_0x5b755a['remoteUri']),'method':_0xb5dc('0x11'),'body':{'user':{'role':_0xb5dc('0x2a'),'name':util[_0xb5dc('0x1e')](_0xb5dc('0x2f'),_0x437ef4||_0x359fd7),'phone':_0x359fd7}}})['then'](function(_0x1b9213){logger['info'](_0xb5dc('0x30'));return _0x1b9213[_0xb5dc('0x28')];});}});}function getAuth(_0x3301b9){var _0x1992c0;if(_0x3301b9[_0xb5dc('0x31')]===_0xb5dc('0x32')){_0x1992c0=util[_0xb5dc('0x1e')](_0xb5dc('0x33'),_0x3301b9['username'],_0x3301b9[_0xb5dc('0x32')]);}else if(_0x3301b9[_0xb5dc('0x31')]===_0xb5dc('0x34')){_0x1992c0=util[_0xb5dc('0x1e')](_0xb5dc('0x35'),_0x3301b9[_0xb5dc('0x36')],_0x3301b9[_0xb5dc('0x34')]);}return util[_0xb5dc('0x1e')](_0xb5dc('0x37'),new Buffer(_0x1992c0)[_0xb5dc('0x38')](_0xb5dc('0x39')));}function request(_0x3b09a4){logger[_0xb5dc('0x3a')]('[HTTP]',JSON[_0xb5dc('0x3b')](_0x3b09a4));return rp(_['defaults'](_0x3b09a4,{'method':_0xb5dc('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x4fd2dc,_0x34df5a){var _0x11eaa7=[];if(_0x4fd2dc&&_0x4fd2dc[_0xb5dc('0x3d')]>0x0){_0x11eaa7=_[_0xb5dc('0x3e')](_0x4fd2dc,_0x34df5a);}return _0x11eaa7;}function getCustomFields(_0x488d70,_0x2dcfb8){var _0xbcea5f=[];var _0x4ba085={'custom_fields':[]};if(_0x488d70['length']>0x0){_[_0xb5dc('0x3f')](_0x488d70,function(_0x589463){if(_[_0xb5dc('0x40')](['string','picklist'],_0x589463[_0xb5dc('0x41')])&&_0x589463[_0xb5dc('0x42')]&&!_0x589463[_0xb5dc('0x43')]){_0x4ba085[_0x589463[_0xb5dc('0x42')][_0xb5dc('0x44')]()]=_0x589463[_0xb5dc('0x45')]['toString']();}else if(_['includes'](['string','picklist'],_0x589463[_0xb5dc('0x41')])&&_0x589463[_0xb5dc('0x46')]&&_0x589463[_0xb5dc('0x43')]){_0x4ba085['custom_fields']['push']({'id':_0x589463['idField'],'value':_0x589463[_0xb5dc('0x45')][_0xb5dc('0x38')]()});}else if(_0x589463[_0xb5dc('0x41')]===_0xb5dc('0x47')&&_0x589463[_0xb5dc('0x48')]&&_0x589463[_0xb5dc('0x46')]&&_0x589463['customField']){_0x2dcfb8[_0x589463['variableName']]&&_0x4ba085[_0xb5dc('0x49')]['push']({'id':_0x589463[_0xb5dc('0x46')],'value':_0x2dcfb8[_0x589463[_0xb5dc('0x48')]]['toString']()});}else if(_0x589463[_0xb5dc('0x41')]==='customVariable'&&_0x589463[_0xb5dc('0x4a')]&&_0x589463[_0xb5dc('0x4a')][_0xb5dc('0x14')]&&_0x589463[_0xb5dc('0x46')]&&_0x589463['customField']){_0x2dcfb8[_0x589463[_0xb5dc('0x4a')][_0xb5dc('0x14')][_0xb5dc('0x44')]()]&&_0x4ba085[_0xb5dc('0x49')][_0xb5dc('0x4b')]({'id':_0x589463[_0xb5dc('0x46')],'value':_0x2dcfb8[_0x589463['Variable'][_0xb5dc('0x14')][_0xb5dc('0x44')]()]['toString']()});}});}return _0x4ba085;}exports[_0xb5dc('0x4c')]=function(_0x1af868,_0x5083b5,_0xd87773,_0x3b7ac2,_0x336f3a,_0x4192cf){var _0x2d931a,_0x4d46aa;_0x4192cf[_0xb5dc('0x10')]=intUtil['stripTrailingSlash'](_0x4192cf[_0xb5dc('0x10')]);_0x4192cf[_0xb5dc('0x4d')]=intUtil['stripTrailingSlash'](_0x4192cf['serverUrl']);if(_0x336f3a&&_0x336f3a[_0xb5dc('0x4e')]){logger[_0xb5dc('0x1a')]('[QUEUE]',_0xb5dc('0x4f'));_0x5083b5[_0xb5dc('0x50')]=util['format'](_0xb5dc('0x51'),_0x4192cf[_0xb5dc('0x4d')],_0x5083b5[_0xb5dc('0x52')],md5(_0x5083b5[_0xb5dc('0x52')]));}else{_0x5083b5['recordingURL']='';}headers[_0xb5dc('0x53')]=getAuth(_0x4192cf);return getUser(_0x4192cf,_0x3b7ac2['email'])[_0xb5dc('0x19')](function(_0x13cf2f){_0x2d931a=_0x13cf2f;logger['info']('The\x20User\x20ID\x20is:',_0x2d931a['id']);return getEndUser(_0x4192cf,_0x5083b5[_0xb5dc('0x54')],_0x5083b5[_0xb5dc('0x55')]);})[_0xb5dc('0x19')](function(_0x847ac7){_0x4d46aa=_0x847ac7;logger[_0xb5dc('0x1a')](_0xb5dc('0x56'),_0x4d46aa['id']);return getTicket(_0x4192cf,_0x2d931a,_0x4d46aa,_0xd87773,_0x5083b5);})[_0xb5dc('0x19')](function(_0x5879d9){if(_0x5879d9){logger[_0xb5dc('0x1a')](_0xb5dc('0x57'),_0x5879d9['id']);switch(_0x4192cf[_0xb5dc('0x41')]){case _0xb5dc('0x58'):logger[_0xb5dc('0x1a')](_0xb5dc('0x59'),_0xb5dc('0x5a'));return request({'uri':util[_0xb5dc('0x1e')](_0xb5dc('0x5b'),_0x4192cf[_0xb5dc('0x10')],_0x2d931a['id'],_0x5879d9['id']),'method':_0xb5dc('0x11')});case'newTab':logger[_0xb5dc('0x1a')](_0xb5dc('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb5dc('0x1e')](_0xb5dc('0x5c'),_0x3b7ac2[_0xb5dc('0x14')]),'trigger:browser:url',{'uri':util['format'](_0xb5dc('0x5d'),_0x4192cf[_0xb5dc('0x10')][_0xb5dc('0x5e')](_0xb5dc('0x5f'),''),_0x5879d9['id'])});break;default:logger[_0xb5dc('0x60')](_0xb5dc('0x59'),_0xb5dc('0x61'));}}})['catch'](function(_0x99a81b){logger[_0xb5dc('0x60')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xb5dc('0x62')](_0x99a81b,{'showHidden':!![],'depth':null}));});};exports[_0xb5dc('0x63')]=function(_0x16171b,_0x578f74,_0x527d69,_0x211cd1,_0x1455a7,_0x3f8bdd,_0x174a77){var _0x394486,_0x2e44e2;_0x3f8bdd[_0xb5dc('0x10')]=intUtil[_0xb5dc('0x64')](_0x3f8bdd[_0xb5dc('0x10')]);_0x3f8bdd[_0xb5dc('0x4d')]=intUtil[_0xb5dc('0x64')](_0x3f8bdd[_0xb5dc('0x4d')]);if(_0x174a77&&_0x174a77['recordingFormat']&&_0x174a77[_0xb5dc('0x65')]!==_0xb5dc('0x66')){logger[_0xb5dc('0x1a')](_0xb5dc('0x67'),_0xb5dc('0x4f'));_0x578f74[_0xb5dc('0x50')]=util['format'](_0xb5dc('0x51'),_0x3f8bdd['serverUrl'],_0x578f74[_0xb5dc('0x52')],md5(_0x578f74[_0xb5dc('0x52')]));}headers[_0xb5dc('0x53')]=getAuth(_0x3f8bdd);return getUser(_0x3f8bdd,_0x211cd1[_0xb5dc('0x68')])[_0xb5dc('0x19')](function(_0x2cb2fc){_0x394486=_0x2cb2fc;logger['info']('The\x20User\x20ID\x20is:',_0x394486['id']);return getEndUser(_0x3f8bdd,_0x578f74['destcalleridname'],_0x578f74['destcalleridnum']);})[_0xb5dc('0x19')](function(_0x372893){_0x2e44e2=_0x372893;logger[_0xb5dc('0x1a')](_0xb5dc('0x56'),_0x2e44e2['id']);return getTicket(_0x3f8bdd,_0x394486,_0x2e44e2,_0x527d69,_0x578f74);})['then'](function(_0x41d3e5){if(_0x41d3e5){logger['info']('The\x20Ticket\x20ID\x20is:',_0x41d3e5['id']);switch(_0x3f8bdd['type']){case _0xb5dc('0x58'):logger[_0xb5dc('0x1a')](_0xb5dc('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xb5dc('0x5b'),_0x3f8bdd[_0xb5dc('0x10')],_0x394486['id'],_0x41d3e5['id']),'method':'POST'});case'newTab':logger['info'](_0xb5dc('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb5dc('0x1e')](_0xb5dc('0x5c'),_0x211cd1[_0xb5dc('0x14')]),'trigger:browser:url',{'uri':util['format'](_0xb5dc('0x5d'),_0x3f8bdd[_0xb5dc('0x10')][_0xb5dc('0x5e')](_0xb5dc('0x5f'),''),_0x41d3e5['id'])});break;default:logger[_0xb5dc('0x60')]('[OUTBOUND]',_0xb5dc('0x61'));}}})[_0xb5dc('0x69')](function(_0x22e9e1){logger[_0xb5dc('0x60')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xb5dc('0x62')](_0x22e9e1,{'showHidden':!![],'depth':null}));});};exports[_0xb5dc('0x6a')]=function(_0x4f959f,_0x2f4297,_0x742bf5,_0x58cf38,_0x3e3440,_0x5507b6){var _0x2e07ce,_0x4eced8;_0x5507b6[_0xb5dc('0x10')]=intUtil[_0xb5dc('0x64')](_0x5507b6[_0xb5dc('0x10')]);_0x5507b6[_0xb5dc('0x4d')]=intUtil['stripTrailingSlash'](_0x5507b6['serverUrl']);if(_0x3e3440&&_0x3e3440['monitor_format']){logger[_0xb5dc('0x1a')]('['+_0x2f4297[_0xb5dc('0x6b')][_0xb5dc('0x6c')]()+']',_0xb5dc('0x4f'));_0x2f4297['recordingURL']=util[_0xb5dc('0x1e')](_0xb5dc('0x51'),_0x5507b6[_0xb5dc('0x4d')],_0x2f4297[_0xb5dc('0x52')],md5(_0x2f4297['uniqueid']));}else{_0x2f4297[_0xb5dc('0x50')]='';}headers[_0xb5dc('0x53')]=getAuth(_0x5507b6);return getUser(_0x5507b6)[_0xb5dc('0x19')](function(_0x5a9962){_0x2e07ce=_0x5a9962;logger['info'](_0xb5dc('0x6d'),_0x2e07ce['id']);return getEndUser(_0x5507b6,_0x2f4297['calleridname'],_0x2f4297[_0xb5dc('0x55')]);})['then'](function(_0x457184){_0x4eced8=_0x457184;logger[_0xb5dc('0x1a')](_0xb5dc('0x56'),_0x4eced8['id']);return getTicket(_0x5507b6,_0x2e07ce,_0x4eced8,_0x742bf5,_0x2f4297);})[_0xb5dc('0x19')](function(_0x3e553a){if(_0x3e553a){logger[_0xb5dc('0x1a')](_0xb5dc('0x57'),_0x3e553a['id']);}})[_0xb5dc('0x69')](function(_0x1b1485){logger[_0xb5dc('0x60')]('['+_0x2f4297[_0xb5dc('0x6b')][_0xb5dc('0x6c')]()+']'+_0xb5dc('0x6e'),util[_0xb5dc('0x62')](_0x1b1485,{'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 6bbd719..d0de86d 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 _0x4513=['role','first_name','last_name','code','moduleCreate','The\x20failing\x20result\x20is','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','Creating\x20new\x20call...','administrator','Description','Descriptions','Full_Name','Last_Name','First_Name','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','starttime','agentcalledAt','Call_Type','merge','/crm/v2/Calls','SUCCESS','details','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','calleridnum','Inbound','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','access_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Using\x20the\x20admin\x20account!','profile','user','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase'];(function(_0x462926,_0x549149){var _0x1c995f=function(_0x2dc80b){while(--_0x2dc80b){_0x462926['push'](_0x462926['shift']());}};_0x1c995f(++_0x549149);}(_0x4513,0xef));var _0x3451=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4513[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0x3451('0x0'));var md5=require(_0x3451('0x1'));var util=require('util');var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x3451('0x2'));var BPromise=require('bluebird');var config=require(_0x3451('0x3'));var logger=require(_0x3451('0x4'))(_0x3451('0x5'));config[_0x3451('0x6')]=_['defaults'](config['redis'],{'host':_0x3451('0x7'),'port':0x18eb});var io=require(_0x3451('0x8'))(new Redis(config[_0x3451('0x6')]));function emit(_0x150365,_0x258d51,_0x1274d9){io['to'](_0x150365)[_0x3451('0x9')](_0x258d51,_0x1274d9);}function request(_0x262156){logger[_0x3451('0xa')](_0x3451('0xb'),JSON[_0x3451('0xc')](_0x262156));return rp(_0x262156);}function getCustomFields(_0x5c1f71,_0x235e9b){var _0x476688={};if(_0x5c1f71[_0x3451('0xd')]>0x0){_['forEach'](_0x5c1f71,function(_0x542092){if(_['includes']([_0x3451('0xe'),_0x3451('0xf')],_0x542092[_0x3451('0x10')])&&_0x542092[_0x3451('0x11')]){_0x476688[_0x542092['idField']]=_0x542092[_0x3451('0x12')][_0x3451('0x13')]();}else if(_0x542092[_0x3451('0x10')]===_0x3451('0x14')&&_0x542092[_0x3451('0x15')]&&_0x542092['idField']&&_0x235e9b[_0x542092[_0x3451('0x15')]]){_0x476688[_0x542092[_0x3451('0x11')]]=_0x235e9b[_0x542092[_0x3451('0x15')]][_0x3451('0x13')]();}else if(_0x542092[_0x3451('0x10')]===_0x3451('0x16')&&_0x542092[_0x3451('0x17')]&&_0x542092[_0x3451('0x17')]['name']&&_0x542092['idField']&&_0x235e9b[_0x542092[_0x3451('0x17')][_0x3451('0x18')][_0x3451('0x19')]()]){_0x476688[_0x542092[_0x3451('0x11')]]=_0x235e9b[_0x542092['Variable']['name']['toLowerCase']()][_0x3451('0x13')]();}});}return _0x476688;}function getName(_0x3b8bea){if(_0x3b8bea[_0x3451('0x1a')]('\x20')>0x0){var _0x3e04bc=_0x3b8bea[_0x3451('0x1b')](/ (.+)/);if(_0x3e04bc[0x1]){return _0x3e04bc;}}return[_0x3b8bea,_0x3b8bea];}var accountsTokens={};function getAccessToken(_0x39b68a){return new Promise(function(_0x266ed9,_0x3f1fa4){if(!_[_0x3451('0x1c')](accountsTokens[_0x39b68a['id']])&&!_['isNil'](accountsTokens[_0x39b68a['id']]['access_token'])){if(moment()[_0x3451('0x1d')](accountsTokens[_0x39b68a['id']][_0x3451('0x1e')])){_0x266ed9(accountsTokens[_0x39b68a['id']]['access_token']);}}var _0x57fc59;switch(_0x39b68a[_0x3451('0x1f')]){case'US':_0x57fc59=_0x3451('0x20');break;case'AU':_0x57fc59=_0x3451('0x21');break;case'EU':_0x57fc59='https://accounts.zoho.eu';break;case'IN':_0x57fc59='https://accounts.zoho.in';break;case'CN':_0x57fc59=_0x3451('0x22');break;default:_0x57fc59='https://accounts.zoho.eu';break;}var _0x2ae737={'method':_0x3451('0x23'),'uri':_0x57fc59+_0x3451('0x24'),'qs':{'refresh_token':_0x39b68a[_0x3451('0x25')],'client_id':_0x39b68a[_0x3451('0x26')],'client_secret':_0x39b68a[_0x3451('0x27')],'grant_type':_0x3451('0x28')},'json':!![]};return rp(_0x2ae737)[_0x3451('0x29')](function(_0x4d8ff4){accountsTokens[_0x39b68a['id']]={'access_token':_0x4d8ff4[_0x3451('0x2a')],'expires_in':moment()[_0x3451('0x2b')](_0x4d8ff4[_0x3451('0x1e')],_0x3451('0x2c'))};_0x266ed9(_0x4d8ff4[_0x3451('0x2a')]);})[_0x3451('0x2d')](function(_0x3b12c9){logger[_0x3451('0x2e')](_0x3451('0x2f'),_0x3b12c9[_0x3451('0x30')]);_0x3f1fa4(_0x3b12c9);});});}function getUser(_0x4645ab,_0x57b242,_0x1d745e,_0x42c0b2){logger[_0x3451('0x31')](_0x3451('0x32'));return request({'method':'GET','uri':util[_0x3451('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x57b242),'qs':{'type':_0x3451('0x34')},'headers':{'Authorization':_0x3451('0x35')+_0x4645ab},'json':!![]})['then'](function(_0x16c49c){if(_0x16c49c[_0x3451('0x36')]){var _0x3185d7=-0x1;if(_[_0x3451('0x37')](_0x16c49c['users'])){if(!_[_0x3451('0x1c')](_0x42c0b2)){_0x3185d7=_[_0x3451('0x38')](_0x16c49c[_0x3451('0x36')],function(_0x137f1d){return _0x137f1d['email']===_0x42c0b2;});}if(_0x3185d7>=0x0){logger[_0x3451('0x31')]('Agent\x20found!');}else{logger[_0x3451('0x31')](_0x3451('0x39'));_0x3185d7=_[_0x3451('0x38')](_0x16c49c[_0x3451('0x36')],function(_0x3aec1e){return _0x3aec1e[_0x3451('0x3a')][_0x3451('0x18')]==='Administrator';});}return _0x16c49c[_0x3451('0x36')][_0x3185d7];}else{if(_0x16c49c[_0x3451('0x3b')][_0x3451('0x3a')]['name']===_0x3451('0x3c')){logger[_0x3451('0x31')]('Using\x20the\x20admin\x20account!');user=_0x16c49c['user'];return user;}else{logger[_0x3451('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x3451('0xc')](_0x16c49c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x3451('0xc')](_0x16c49c));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x16c49c));throw new Error(_0x3451('0x3d')+JSON[_0x3451('0xc')](_0x16c49c));}})[_0x3451('0x2d')](function(_0x3eef80){console['error'](_0x3eef80);});}function getZohoUser(_0x29de50,_0x275977){return new BPromise(function(_0x1b912d,_0x4b215f){request(_0x29de50)['then'](function(_0x2881b6){var _0x441442=null;if(_0x2881b6){_0x441442=_0x2881b6[_0x3451('0x3e')][0x0];_0x441442[_0x3451('0x3f')]=_0x275977;}_0x1b912d(_0x441442);})[_0x3451('0x2d')](function(_0x59193f){_0x4b215f(_0x59193f);});});}function createEndUser(_0x20279f,_0x2b1774,_0x249b87,_0x34dc42,_0x1d6ac5,_0x533c04){var _0x249b87=getName(_0x249b87);return request({'method':_0x3451('0x23'),'uri':_0x3451('0x40')+_0x2b1774+_0x3451('0x41')+_[_0x3451('0x42')](_0x533c04['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x249b87[0x1],'First_Name':_0x249b87[0x0],'Phone':_0x34dc42,'Owner':{'name':!_[_0x3451('0x1c')](_0x1d6ac5[_0x3451('0x43')][_0x3451('0x18')])?_0x1d6ac5[_0x3451('0x43')][_0x3451('0x18')]:!_[_0x3451('0x1c')](_0x1d6ac5[_0x3451('0x44')])?_0x1d6ac5[_0x3451('0x44')]+'\x20'+_0x1d6ac5[_0x3451('0x45')]:_0x1d6ac5[_0x3451('0x45')],'id':_0x1d6ac5['id']}}]},'headers':{'Authorization':_0x3451('0x35')+_0x20279f},'json':!![]})[_0x3451('0x29')](function(_0x294813){if(_0x294813&&_0x294813['data'][0x0][_0x3451('0x46')]==='SUCCESS'){var _0x48ec17=_0x294813['data'][0x0]['details'];_0x48ec17['enduserType']=_[_0x3451('0x42')](_0x533c04[_0x3451('0x47')])+'s';return _0x48ec17;}logger[_0x3451('0x2e')](_0x3451('0x48'),JSON[_0x3451('0xc')](data));throw new Error(_0x3451('0x49')+JSON[_0x3451('0xc')](data));})['catch'](function(_0x1d63c9){console[_0x3451('0x4a')](_0x3451('0x4b'),_0x1d63c9);});}function getEndUser(_0x46c4f9,_0x315806,_0x344bd1,_0x1c74db,_0x57900c,_0x510211,_0x42ce3d){var _0x130e53={'method':_0x3451('0x4c'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x46c4f9},'json':!![]};switch(_0x42ce3d[_0x3451('0x4d')]){case'contact_lead':_0x130e53['uri']=_0x3451('0x40')+_0x315806+_0x3451('0x4e')+_0x57900c+'))';return getZohoUser(_0x130e53,_0x3451('0x4f'))['then'](function(_0x58814f){if(_0x58814f)return _0x58814f;_0x130e53[_0x3451('0x50')]=_0x3451('0x40')+_0x315806+_0x3451('0x51')+_0x57900c+'))';return getZohoUser(_0x130e53,_0x3451('0x52'))['then'](function(_0x476b16){if(_0x476b16)return _0x476b16;if(_0x42ce3d[_0x3451('0x47')]!='nothing'){return createEndUser(_0x46c4f9,_0x315806,_0x1c74db,_0x57900c,_0x510211,_0x42ce3d);}else{return{};}});});break;case _0x3451('0x53'):_0x130e53[_0x3451('0x50')]=_0x3451('0x40')+_0x315806+_0x3451('0x4e')+_0x57900c+'))';return getZohoUser(_0x130e53,_0x3451('0x4f'))['then'](function(_0x594c9b){if(_0x594c9b)return _0x594c9b;if(_0x42ce3d[_0x3451('0x47')]!=_0x3451('0x54')){return createEndUser(_0x46c4f9,_0x315806,_0x1c74db,_0x57900c,_0x510211,_0x42ce3d);}else{return{};}});break;case'lead':_0x130e53[_0x3451('0x50')]=_0x3451('0x40')+_0x315806+_0x3451('0x51')+_0x57900c+'))';return getZohoUser(_0x130e53,'Leads')['then'](function(_0x29fadb){if(_0x29fadb)return _0x29fadb;if(_0x42ce3d[_0x3451('0x47')]!=_0x3451('0x54')){return createEndUser(_0x46c4f9,_0x315806,_0x1c74db,_0x57900c,_0x510211,_0x42ce3d);}else{return{};}});break;}}function getCall(_0x539a38,_0x598250,_0x3905dc,_0x1482cb,_0x33319e,_0x4a8fb5,_0x3e822c,_0x49d814){logger[_0x3451('0x31')](_0x3451('0x55'));var _0x4c6e61={};_0x4c6e61['Owner']={'name':!_['isNil'](_0x1482cb['role']['name'])&&!_[_0x3451('0x1c')](_0x1482cb['profile'][_0x3451('0x18')])&&_0x1482cb[_0x3451('0x3a')][_0x3451('0x18')]===_0x3451('0x56')?_0x1482cb['role'][_0x3451('0x18')]:!_[_0x3451('0x1c')](_0x1482cb['first_name'])?_0x1482cb['first_name']+'\x20'+_0x1482cb[_0x3451('0x45')]:_0x1482cb[_0x3451('0x45')],'id':_0x1482cb['id']};_0x4c6e61['Subject']=intUtil['getString'](_0x4a8fb5['Subjects'],_0x3e822c,'\x20');_0x4c6e61[_0x3451('0x57')]=intUtil['getString'](_0x4a8fb5[_0x3451('0x58')],_0x3e822c,'\x0a');if(_0x33319e['enduserType']===_0x3451('0x4f')){_0x4c6e61['Who_Id']={'name':!_['isNil'](_0x33319e['Full_Name'])?_0x33319e[_0x3451('0x59')]:!_[_0x3451('0x1c')](_0x33319e['First_Name'])?_0x33319e['First_Name']+'\x20'+_0x33319e[_0x3451('0x5a')]:_0x33319e['Last_Name'],'id':_0x33319e['id']};}if(_0x33319e[_0x3451('0x3f')]===_0x3451('0x52')){_0x4c6e61['What_Id']={'name':!_[_0x3451('0x1c')](_0x33319e[_0x3451('0x59')])?_0x33319e[_0x3451('0x59')]:!_[_0x3451('0x1c')](_0x33319e[_0x3451('0x5b')])?_0x33319e['First_Name']+'\x20'+_0x33319e[_0x3451('0x5a')]:_0x33319e[_0x3451('0x5a')],'id':_0x33319e['id']};_0x4c6e61[_0x3451('0x5c')]=_[_0x3451('0x42')](_0x33319e['enduserType']);}if(_0x3e822c['talktime']){_0x4c6e61[_0x3451('0x5d')]=moment[_0x3451('0x5e')](parseInt(_0x3e822c[_0x3451('0x5f')])*0x3e8)['format'](_0x3451('0x60'));}else if(_0x3e822c[_0x3451('0x61')]&&_0x3e822c[_0x3451('0x62')]){_0x4c6e61[_0x3451('0x5d')]=moment[_0x3451('0x5e')](moment(_0x3e822c['endtime'],_0x3451('0x63'))[_0x3451('0x64')](moment(_0x3e822c['starttime'],_0x3451('0x63'))))['format'](_0x3451('0x60'));}switch(_0x3e822c[_0x3451('0x65')]){case'called':_0x4c6e61[_0x3451('0x66')]=_0x3451('0x67');break;case _0x3451('0x68'):case _0x3451('0x69'):_0x4c6e61['Call_Result']='Answered';break;case _0x3451('0x6a'):_0x4c6e61[_0x3451('0x66')]=_0x3451('0x6b');break;case _0x3451('0x6c'):_0x4c6e61[_0x3451('0x66')]=_0x3451('0x6d');break;case _0x3451('0x6e'):_0x4c6e61[_0x3451('0x66')]=_0x3451('0x6f');default:}_0x4c6e61[_0x3451('0x70')]=(_0x49d814==='outbound'?moment(_0x3e822c[_0x3451('0x71')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x3e822c[_0x3451('0x72')])[_0x3451('0x33')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x4c6e61[_0x3451('0x73')]=_0x49d814||'Inbound';_0x4c6e61=_[_0x3451('0x74')](_0x4c6e61,getCustomFields(_0x4a8fb5['Fields'],_0x3e822c));return request({'method':_0x3451('0x23'),'uri':_0x3451('0x40')+_0x598250+_0x3451('0x75'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x539a38},'body':{'data':[_0x4c6e61]},'json':!![]})[_0x3451('0x29')](function(_0x266daf){if(_0x266daf&&_0x266daf[_0x3451('0x3e')][0x0][_0x3451('0x46')]===_0x3451('0x76')){logger['info']('Call\x20created!');return{'id':_0x266daf[_0x3451('0x3e')][0x0][_0x3451('0x77')]['id']};}})[_0x3451('0x2d')](function(_0x4fb023){logger[_0x3451('0x31')](_0x3451('0x78'),_0x4fb023['stack']);console[_0x3451('0x4a')](_0x3451('0x78'),_0x4fb023);});}exports[_0x3451('0x79')]=function(_0x30558c,_0x37fe12,_0x4010db,_0x2a4d53,_0x203f1f,_0x331cb8){var _0x3588da,_0x233bc3,_0x493679;_0x331cb8[_0x3451('0x7a')]=intUtil['stripTrailingSlash'](_0x331cb8[_0x3451('0x7a')]);_0x331cb8[_0x3451('0x7b')]=intUtil[_0x3451('0x7c')](_0x331cb8[_0x3451('0x7b')]);if(_0x203f1f&&_0x203f1f[_0x3451('0x7d')]){logger['info'](_0x3451('0x7e'),'Recording\x20is\x20enabled!');_0x37fe12[_0x3451('0x7f')]=_0x331cb8[_0x3451('0x7b')]+_0x3451('0x80')+_0x37fe12[_0x3451('0x81')]+_0x3451('0x82')+md5(_0x37fe12[_0x3451('0x81')]);}else{_0x37fe12['recordingURL']='';}var _0x4f987d=_0x331cb8[_0x3451('0x7a')]===_0x3451('0x83')?'eu':_0x3451('0x84');return getAccessToken(_0x331cb8)[_0x3451('0x29')](function(_0x17a07a){_0x493679=_0x17a07a;return getUser(_0x493679,_0x4f987d,_0x331cb8,_0x2a4d53[_0x3451('0x85')]);})[_0x3451('0x29')](function(_0x49d454){_0x3588da=_0x49d454;logger[_0x3451('0x31')]('The\x20User\x20ID\x20is:',_0x3588da['id']);return getEndUser(_0x493679,_0x4f987d,_0x331cb8,_0x37fe12[_0x3451('0x86')],_0x37fe12['calleridnum'],_0x3588da,_0x4010db);})['then'](function(_0x23420d){_0x233bc3=_0x23420d;return getCall(_0x493679,_0x4f987d,_0x331cb8,_0x3588da,_0x233bc3,_0x4010db,_0x37fe12,'Inbound');})['then'](function(_0xf91a81){if(_0xf91a81){logger[_0x3451('0x31')](_0x3451('0x87'),_0xf91a81['id']);logger[_0x3451('0x31')](_0x3451('0x7e'),_0x3451('0x88'));emit(util['format'](_0x3451('0x89'),_0x2a4d53[_0x3451('0x18')]),_0x3451('0x8a'),{'uri':_0x3451('0x8b')+_0x331cb8[_0x3451('0x7a')]+_0x3451('0x8c')+_0xf91a81['id']});}})['catch'](function(_0x59bbbe){logger['error'](_0x3451('0x7e'),JSON[_0x3451('0xc')](_0x59bbbe));});};exports['outbound']=function(_0x53aea5,_0x406c36,_0x86c384,_0xe145e9,_0x502de9,_0x1245f4,_0x45c9f5){var _0x5096f9,_0x2295ab,_0x2e14f7;_0x1245f4[_0x3451('0x7a')]=intUtil[_0x3451('0x7c')](_0x1245f4['host']);_0x1245f4['serverUrl']=intUtil['stripTrailingSlash'](_0x1245f4[_0x3451('0x7b')]);if(_0x45c9f5&&_0x45c9f5['recordingFormat']&&_0x45c9f5[_0x3451('0x8d')]!==_0x3451('0x8e')){logger['info'](_0x3451('0x8f'),_0x3451('0x90'));_0x406c36['recordingURL']=_0x1245f4[_0x3451('0x7b')]+'/api/voice/recordings/'+_0x406c36[_0x3451('0x81')]+_0x3451('0x82')+md5(_0x406c36[_0x3451('0x81')]);}var _0x334401=_0x1245f4[_0x3451('0x7a')]==='zoho.eu'?'eu':_0x3451('0x84');return getAccessToken(_0x1245f4)[_0x3451('0x29')](function(_0x14c338){_0x2e14f7=_0x14c338;return getUser(_0x2e14f7,_0x334401,_0x1245f4,_0xe145e9[_0x3451('0x85')]);})[_0x3451('0x29')](function(_0x7b02e6){_0x5096f9=_0x7b02e6;logger[_0x3451('0x31')]('The\x20User\x20ID\x20is:',_0x5096f9['id']);return getEndUser(_0x2e14f7,_0x334401,_0x1245f4,_0x406c36[_0x3451('0x91')],_0x406c36[_0x3451('0x92')],_0x5096f9,_0x86c384);})[_0x3451('0x29')](function(_0x2665f3){_0x2295ab=_0x2665f3;return getCall(_0x2e14f7,_0x334401,_0x1245f4,_0x5096f9,_0x2295ab,_0x86c384,_0x406c36,_0x3451('0x93'));})[_0x3451('0x29')](function(_0x3442e6){if(_0x3442e6){logger[_0x3451('0x31')](_0x3451('0x87'),_0x3442e6['id']);logger[_0x3451('0x31')](_0x3451('0x8f'),_0x3451('0x88'));emit(util[_0x3451('0x33')](_0x3451('0x89'),_0xe145e9[_0x3451('0x18')]),_0x3451('0x8a'),{'uri':_0x3451('0x8b')+_0x1245f4[_0x3451('0x7a')]+_0x3451('0x8c')+_0x3442e6['id']});}})[_0x3451('0x2d')](function(_0x1d9710){logger[_0x3451('0x2e')]('[OUTBOUND]',JSON['stringify'](_0x1d9710));});};exports[_0x3451('0x94')]=function(_0x41255f,_0x278e61,_0x6d9e08,_0x1a526c,_0x1a9bc2,_0x656e65){var _0x263e1a,_0x1a8e25,_0x12cfd3;_0x656e65[_0x3451('0x7a')]=intUtil['stripTrailingSlash'](_0x656e65[_0x3451('0x7a')]);_0x656e65[_0x3451('0x7b')]=intUtil[_0x3451('0x7c')](_0x656e65[_0x3451('0x7b')]);if(_0x1a9bc2&&_0x1a9bc2['monitor_format']){logger[_0x3451('0x31')]('['+_0x278e61[_0x3451('0x65')][_0x3451('0x95')]()+']',_0x3451('0x90'));_0x278e61['recordingURL']=_0x656e65[_0x3451('0x7b')]+_0x3451('0x80')+_0x278e61[_0x3451('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x278e61[_0x3451('0x81')]);}else{_0x278e61[_0x3451('0x7f')]='';}var _0x27293e=_0x656e65[_0x3451('0x7a')]===_0x3451('0x83')?'eu':'com';return getAccessToken(_0x656e65)[_0x3451('0x29')](function(_0x57696b){_0x12cfd3=_0x57696b;return getUser(_0x12cfd3,_0x27293e,_0x656e65);})['then'](function(_0x3ecf5f){_0x263e1a=_0x3ecf5f;logger['info'](_0x3451('0x96'),_0x263e1a['id']);return getEndUser(_0x12cfd3,_0x27293e,_0x656e65,_0x278e61[_0x3451('0x86')],_0x278e61[_0x3451('0x97')],_0x263e1a,_0x6d9e08);})[_0x3451('0x29')](function(_0x43a592){_0x1a8e25=_0x43a592;return getCall(_0x12cfd3,_0x27293e,_0x656e65,_0x263e1a,_0x1a8e25,_0x6d9e08,_0x278e61,_0x3451('0x98'));})[_0x3451('0x29')](function(_0x49ace2){if(_0x49ace2){logger[_0x3451('0x31')](_0x3451('0x87'),_0x49ace2['id']);}})['catch'](function(_0x214eb4){logger[_0x3451('0x2e')]('['+_0x278e61['lastevent'][_0x3451('0x95')]()+']',JSON['stringify'](_0x214eb4));});}; \ No newline at end of file +var _0x3039=['https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','code','SUCCESS','details','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','Subjects','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','format','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','starttime','agentcalledAt','Call_Type','Fields','POST','/crm/v2/Calls','Call\x20created!','err','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','com','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','request-promise','md5','util','./util','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','socket.io-emitter','redis','emit','debug','[HTTP]','stringify','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','clientId','clientSecret','refresh_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','ActiveUsers','Zoho-oauthtoken\x20','then','users','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType'];(function(_0x14c9ac,_0x1d8b15){var _0xb93cac=function(_0x51adbd){while(--_0x51adbd){_0x14c9ac['push'](_0x14c9ac['shift']());}};_0xb93cac(++_0x1d8b15);}(_0x3039,0x18b));var _0x9303=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3039[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var rp=require(_0x9303('0x0'));var md5=require(_0x9303('0x1'));var util=require(_0x9303('0x2'));var intUtil=require(_0x9303('0x3'));var moment=require('moment');var Redis=require(_0x9303('0x4'));var BPromise=require('bluebird');var config=require(_0x9303('0x5'));var logger=require(_0x9303('0x6'))(_0x9303('0x7'));config['redis']=_[_0x9303('0x8')](config['redis'],{'host':_0x9303('0x9'),'port':0x18eb});var io=require(_0x9303('0xa'))(new Redis(config[_0x9303('0xb')]));function emit(_0x4f67e9,_0xaf6b2e,_0x57f85a){io['to'](_0x4f67e9)[_0x9303('0xc')](_0xaf6b2e,_0x57f85a);}function request(_0x426151){logger[_0x9303('0xd')](_0x9303('0xe'),JSON[_0x9303('0xf')](_0x426151));return rp(_0x426151);}function getCustomFields(_0x3f020b,_0x474969){var _0x1f7431={};if(_0x3f020b['length']>0x0){_[_0x9303('0x10')](_0x3f020b,function(_0x525e50){if(_[_0x9303('0x11')](['string',_0x9303('0x12')],_0x525e50['type'])&&_0x525e50[_0x9303('0x13')]){_0x1f7431[_0x525e50['idField']]=_0x525e50[_0x9303('0x14')][_0x9303('0x15')]();}else if(_0x525e50[_0x9303('0x16')]===_0x9303('0x17')&&_0x525e50[_0x9303('0x18')]&&_0x525e50[_0x9303('0x13')]&&_0x474969[_0x525e50[_0x9303('0x18')]]){_0x1f7431[_0x525e50[_0x9303('0x13')]]=_0x474969[_0x525e50[_0x9303('0x18')]][_0x9303('0x15')]();}else if(_0x525e50[_0x9303('0x16')]===_0x9303('0x19')&&_0x525e50[_0x9303('0x1a')]&&_0x525e50[_0x9303('0x1a')]['name']&&_0x525e50[_0x9303('0x13')]&&_0x474969[_0x525e50['Variable'][_0x9303('0x1b')][_0x9303('0x1c')]()]){_0x1f7431[_0x525e50['idField']]=_0x474969[_0x525e50[_0x9303('0x1a')][_0x9303('0x1b')][_0x9303('0x1c')]()]['toString']();}});}return _0x1f7431;}function getName(_0x1d720a){if(_0x1d720a[_0x9303('0x1d')]('\x20')>0x0){var _0x34fe71=_0x1d720a[_0x9303('0x1e')](/ (.+)/);if(_0x34fe71[0x1]){return _0x34fe71;}}return[_0x1d720a,_0x1d720a];}var accountsTokens={};function getAccessToken(_0x314050){return new Promise(function(_0x15dc5e,_0xbc5c8e){if(!_[_0x9303('0x1f')](accountsTokens[_0x314050['id']])&&!_[_0x9303('0x1f')](accountsTokens[_0x314050['id']][_0x9303('0x20')])){if(moment()['isBefore'](accountsTokens[_0x314050['id']][_0x9303('0x21')])){_0x15dc5e(accountsTokens[_0x314050['id']]['access_token']);}}var _0x1b8e30;switch(_0x314050[_0x9303('0x22')]){case'US':_0x1b8e30='https://accounts.zoho.com';break;case'AU':_0x1b8e30='https://accounts.zoho.com.au';break;case'EU':_0x1b8e30=_0x9303('0x23');break;case'IN':_0x1b8e30=_0x9303('0x24');break;case'CN':_0x1b8e30='https://accounts.zoho.com.cn';break;default:_0x1b8e30=_0x9303('0x23');break;}var _0x25cee6={'method':'POST','uri':_0x1b8e30+_0x9303('0x25'),'qs':{'refresh_token':_0x314050['refreshToken'],'client_id':_0x314050[_0x9303('0x26')],'client_secret':_0x314050[_0x9303('0x27')],'grant_type':_0x9303('0x28')},'json':!![]};return rp(_0x25cee6)['then'](function(_0x1b996e){accountsTokens[_0x314050['id']]={'access_token':_0x1b996e[_0x9303('0x20')],'expires_in':moment()['add'](_0x1b996e[_0x9303('0x21')],_0x9303('0x29'))};_0x15dc5e(_0x1b996e[_0x9303('0x20')]);})[_0x9303('0x2a')](function(_0x1fd199){logger[_0x9303('0x2b')](_0x9303('0x2c'),_0x1fd199[_0x9303('0x2d')]);_0xbc5c8e(_0x1fd199);});});}function getUser(_0x11b838,_0xeb0e4f,_0xed6db6,_0x3ccbac){logger['info'](_0x9303('0x2e'));return request({'method':_0x9303('0x2f'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0xeb0e4f),'qs':{'type':_0x9303('0x30')},'headers':{'Authorization':_0x9303('0x31')+_0x11b838},'json':!![]})[_0x9303('0x32')](function(_0x58b56a){if(_0x58b56a['users']){var _0x5a9781=-0x1;if(_['isArrayLikeObject'](_0x58b56a['users'])){if(!_[_0x9303('0x1f')](_0x3ccbac)){_0x5a9781=_['findIndex'](_0x58b56a[_0x9303('0x33')],function(_0x22c65c){return _0x22c65c[_0x9303('0x34')]===_0x3ccbac;});}if(_0x5a9781>=0x0){logger[_0x9303('0x35')](_0x9303('0x36'));}else{logger['info'](_0x9303('0x37'));_0x5a9781=_[_0x9303('0x38')](_0x58b56a[_0x9303('0x33')],function(_0x35267a){return _0x35267a[_0x9303('0x39')][_0x9303('0x1b')]===_0x9303('0x3a');});}return _0x58b56a[_0x9303('0x33')][_0x5a9781];}else{if(_0x58b56a['user'][_0x9303('0x39')][_0x9303('0x1b')]===_0x9303('0x3a')){logger[_0x9303('0x35')](_0x9303('0x37'));user=_0x58b56a[_0x9303('0x3b')];return user;}else{logger[_0x9303('0x2b')](_0x9303('0x3c'),JSON[_0x9303('0xf')](_0x58b56a));throw new Error(_0x9303('0x3d')+JSON[_0x9303('0xf')](_0x58b56a));}}}else{logger[_0x9303('0x2b')](_0x9303('0x3c'),JSON['stringify'](_0x58b56a));throw new Error(_0x9303('0x3d')+JSON[_0x9303('0xf')](_0x58b56a));}})[_0x9303('0x2a')](function(_0x5d69e1){console['error'](_0x5d69e1);});}function getZohoUser(_0x12282d,_0x273094){return new BPromise(function(_0x283e24,_0x1112a2){request(_0x12282d)['then'](function(_0x157404){var _0xd970bb=null;if(_0x157404){_0xd970bb=_0x157404[_0x9303('0x3e')][0x0];_0xd970bb[_0x9303('0x3f')]=_0x273094;}_0x283e24(_0xd970bb);})[_0x9303('0x2a')](function(_0x202ed3){_0x1112a2(_0x202ed3);});});}function createEndUser(_0x573e04,_0x52911b,_0xb194e4,_0x6e2fb4,_0x4ca4f8,_0x4ae95f){var _0xb194e4=getName(_0xb194e4);return request({'method':'POST','uri':_0x9303('0x40')+_0x52911b+_0x9303('0x41')+_[_0x9303('0x42')](_0x4ae95f[_0x9303('0x43')])+'s','body':{'data':[{'Last_Name':_0xb194e4[0x1],'First_Name':_0xb194e4[0x0],'Phone':_0x6e2fb4,'Owner':{'name':!_[_0x9303('0x1f')](_0x4ca4f8[_0x9303('0x44')]['name'])?_0x4ca4f8[_0x9303('0x44')][_0x9303('0x1b')]:!_['isNil'](_0x4ca4f8['first_name'])?_0x4ca4f8['first_name']+'\x20'+_0x4ca4f8[_0x9303('0x45')]:_0x4ca4f8[_0x9303('0x45')],'id':_0x4ca4f8['id']}}]},'headers':{'Authorization':_0x9303('0x31')+_0x573e04},'json':!![]})[_0x9303('0x32')](function(_0x4b658f){if(_0x4b658f&&_0x4b658f['data'][0x0][_0x9303('0x46')]===_0x9303('0x47')){var _0x401577=_0x4b658f['data'][0x0][_0x9303('0x48')];_0x401577[_0x9303('0x3f')]=_['startCase'](_0x4ae95f[_0x9303('0x43')])+'s';return _0x401577;}logger[_0x9303('0x2b')](_0x9303('0x3c'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x9303('0xf')](data));})[_0x9303('0x2a')](function(_0x59cfa9){console[_0x9303('0x49')]('CREATE\x20ERROR',_0x59cfa9);});}function getEndUser(_0x587577,_0x3844ae,_0x4c9e45,_0x11ebb0,_0x34a30a,_0xc4bc81,_0x218c80){var _0x392567={'method':_0x9303('0x2f'),'uri':'','headers':{'Authorization':_0x9303('0x31')+_0x587577},'json':!![]};switch(_0x218c80['moduleSearch']){case _0x9303('0x4a'):_0x392567[_0x9303('0x4b')]=_0x9303('0x40')+_0x3844ae+_0x9303('0x4c')+_0x34a30a+'))';return getZohoUser(_0x392567,_0x9303('0x4d'))[_0x9303('0x32')](function(_0x583503){if(_0x583503)return _0x583503;_0x392567[_0x9303('0x4b')]=_0x9303('0x40')+_0x3844ae+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x34a30a+'))';return getZohoUser(_0x392567,_0x9303('0x4e'))['then'](function(_0x63e2f7){if(_0x63e2f7)return _0x63e2f7;if(_0x218c80['moduleCreate']!=_0x9303('0x4f')){return createEndUser(_0x587577,_0x3844ae,_0x11ebb0,_0x34a30a,_0xc4bc81,_0x218c80);}else{return{};}});});break;case _0x9303('0x50'):_0x392567[_0x9303('0x4b')]=_0x9303('0x40')+_0x3844ae+_0x9303('0x4c')+_0x34a30a+'))';return getZohoUser(_0x392567,_0x9303('0x4d'))[_0x9303('0x32')](function(_0x2ecebd){if(_0x2ecebd)return _0x2ecebd;if(_0x218c80[_0x9303('0x43')]!=_0x9303('0x4f')){return createEndUser(_0x587577,_0x3844ae,_0x11ebb0,_0x34a30a,_0xc4bc81,_0x218c80);}else{return{};}});break;case _0x9303('0x51'):_0x392567[_0x9303('0x4b')]=_0x9303('0x40')+_0x3844ae+_0x9303('0x52')+_0x34a30a+'))';return getZohoUser(_0x392567,_0x9303('0x4e'))[_0x9303('0x32')](function(_0x2d5714){if(_0x2d5714)return _0x2d5714;if(_0x218c80[_0x9303('0x43')]!=_0x9303('0x4f')){return createEndUser(_0x587577,_0x3844ae,_0x11ebb0,_0x34a30a,_0xc4bc81,_0x218c80);}else{return{};}});break;}}function getCall(_0x4e1d97,_0x4806b3,_0x34f6fd,_0x544340,_0x2803ba,_0x5b14a9,_0x4f0459,_0x4ba47a){logger[_0x9303('0x35')](_0x9303('0x53'));var _0x632fb3={};_0x632fb3[_0x9303('0x54')]={'name':!_[_0x9303('0x1f')](_0x544340[_0x9303('0x44')]['name'])&&!_['isNil'](_0x544340[_0x9303('0x39')][_0x9303('0x1b')])&&_0x544340['profile'][_0x9303('0x1b')]===_0x9303('0x55')?_0x544340['role'][_0x9303('0x1b')]:!_[_0x9303('0x1f')](_0x544340[_0x9303('0x56')])?_0x544340[_0x9303('0x56')]+'\x20'+_0x544340[_0x9303('0x45')]:_0x544340['last_name'],'id':_0x544340['id']};_0x632fb3[_0x9303('0x57')]=intUtil['getString'](_0x5b14a9[_0x9303('0x58')],_0x4f0459,'\x20');_0x632fb3['Description']=intUtil[_0x9303('0x59')](_0x5b14a9[_0x9303('0x5a')],_0x4f0459,'\x0a');if(_0x2803ba[_0x9303('0x3f')]==='Contacts'){_0x632fb3[_0x9303('0x5b')]={'name':!_[_0x9303('0x1f')](_0x2803ba[_0x9303('0x5c')])?_0x2803ba[_0x9303('0x5c')]:!_[_0x9303('0x1f')](_0x2803ba[_0x9303('0x5d')])?_0x2803ba[_0x9303('0x5d')]+'\x20'+_0x2803ba[_0x9303('0x5e')]:_0x2803ba[_0x9303('0x5e')],'id':_0x2803ba['id']};}if(_0x2803ba['enduserType']==='Leads'){_0x632fb3[_0x9303('0x5f')]={'name':!_[_0x9303('0x1f')](_0x2803ba['Full_Name'])?_0x2803ba['Full_Name']:!_[_0x9303('0x1f')](_0x2803ba[_0x9303('0x5d')])?_0x2803ba[_0x9303('0x5d')]+'\x20'+_0x2803ba[_0x9303('0x5e')]:_0x2803ba[_0x9303('0x5e')],'id':_0x2803ba['id']};_0x632fb3[_0x9303('0x60')]=_[_0x9303('0x42')](_0x2803ba[_0x9303('0x3f')]);}if(_0x4f0459[_0x9303('0x61')]){_0x632fb3[_0x9303('0x62')]=moment['utc'](parseInt(_0x4f0459[_0x9303('0x61')])*0x3e8)[_0x9303('0x63')](_0x9303('0x64'));}else if(_0x4f0459[_0x9303('0x65')]&&_0x4f0459[_0x9303('0x66')]){_0x632fb3[_0x9303('0x62')]=moment[_0x9303('0x67')](moment(_0x4f0459[_0x9303('0x66')],_0x9303('0x68'))['diff'](moment(_0x4f0459['starttime'],_0x9303('0x68'))))[_0x9303('0x63')](_0x9303('0x64'));}switch(_0x4f0459[_0x9303('0x69')]){case _0x9303('0x6a'):_0x632fb3[_0x9303('0x6b')]='Called';break;case _0x9303('0x6c'):case _0x9303('0x6d'):_0x632fb3[_0x9303('0x6b')]=_0x9303('0x6e');break;case _0x9303('0x6f'):_0x632fb3[_0x9303('0x6b')]=_0x9303('0x70');break;case _0x9303('0x71'):_0x632fb3[_0x9303('0x6b')]=_0x9303('0x72');break;case'timeout':_0x632fb3[_0x9303('0x6b')]=_0x9303('0x73');default:}_0x632fb3[_0x9303('0x74')]=(_0x4ba47a==='outbound'?moment(_0x4f0459[_0x9303('0x75')])[_0x9303('0x63')](_0x9303('0x68')):moment(_0x4f0459[_0x9303('0x76')])[_0x9303('0x63')](_0x9303('0x68')))||moment()[_0x9303('0x63')](_0x9303('0x68'));_0x632fb3[_0x9303('0x77')]=_0x4ba47a||'Inbound';_0x632fb3=_['merge'](_0x632fb3,getCustomFields(_0x5b14a9[_0x9303('0x78')],_0x4f0459));return request({'method':_0x9303('0x79'),'uri':_0x9303('0x40')+_0x4806b3+_0x9303('0x7a'),'headers':{'Authorization':_0x9303('0x31')+_0x4e1d97},'body':{'data':[_0x632fb3]},'json':!![]})[_0x9303('0x32')](function(_0x5bdb0b){if(_0x5bdb0b&&_0x5bdb0b['data'][0x0][_0x9303('0x46')]===_0x9303('0x47')){logger[_0x9303('0x35')](_0x9303('0x7b'));return{'id':_0x5bdb0b['data'][0x0][_0x9303('0x48')]['id']};}})[_0x9303('0x2a')](function(_0x569cd4){logger[_0x9303('0x35')](_0x9303('0x7c'),_0x569cd4[_0x9303('0x2d')]);console[_0x9303('0x49')](_0x9303('0x7c'),_0x569cd4);});}exports['queue']=function(_0x2f8384,_0x170eb9,_0x222ba8,_0x49f286,_0x413f9d,_0x189ed6){var _0x18b0e8,_0x40ebdc,_0x460727;_0x189ed6['host']=intUtil[_0x9303('0x7d')](_0x189ed6[_0x9303('0x7e')]);_0x189ed6['serverUrl']=intUtil['stripTrailingSlash'](_0x189ed6[_0x9303('0x7f')]);if(_0x413f9d&&_0x413f9d[_0x9303('0x80')]){logger['info'](_0x9303('0x81'),_0x9303('0x82'));_0x170eb9[_0x9303('0x83')]=_0x189ed6[_0x9303('0x7f')]+_0x9303('0x84')+_0x170eb9[_0x9303('0x85')]+_0x9303('0x86')+md5(_0x170eb9[_0x9303('0x85')]);}else{_0x170eb9[_0x9303('0x83')]='';}var _0x1985af=_0x189ed6['host']===_0x9303('0x87')?'eu':'com';return getAccessToken(_0x189ed6)['then'](function(_0x36d1ac){_0x460727=_0x36d1ac;return getUser(_0x460727,_0x1985af,_0x189ed6,_0x49f286[_0x9303('0x34')]);})[_0x9303('0x32')](function(_0x55649c){_0x18b0e8=_0x55649c;logger[_0x9303('0x35')](_0x9303('0x88'),_0x18b0e8['id']);return getEndUser(_0x460727,_0x1985af,_0x189ed6,_0x170eb9[_0x9303('0x89')],_0x170eb9[_0x9303('0x8a')],_0x18b0e8,_0x222ba8);})['then'](function(_0x1ce9d1){_0x40ebdc=_0x1ce9d1;return getCall(_0x460727,_0x1985af,_0x189ed6,_0x18b0e8,_0x40ebdc,_0x222ba8,_0x170eb9,_0x9303('0x8b'));})[_0x9303('0x32')](function(_0x367f1c){if(_0x367f1c){logger[_0x9303('0x35')](_0x9303('0x8c'),_0x367f1c['id']);logger['info'](_0x9303('0x81'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9303('0x63')](_0x9303('0x8d'),_0x49f286[_0x9303('0x1b')]),_0x9303('0x8e'),{'uri':'https://crm.'+_0x189ed6[_0x9303('0x7e')]+_0x9303('0x8f')+_0x367f1c['id']});}})[_0x9303('0x2a')](function(_0x3bc3ee){logger['error']('[QUEUE]',JSON['stringify'](_0x3bc3ee));});};exports[_0x9303('0x90')]=function(_0x4fdbb8,_0x494d86,_0x49b26a,_0x17cc4b,_0x1f8f00,_0x3cf65f,_0x255b6a){var _0x36ff6b,_0x3dc4f2,_0x1d9837;_0x3cf65f['host']=intUtil[_0x9303('0x7d')](_0x3cf65f[_0x9303('0x7e')]);_0x3cf65f[_0x9303('0x7f')]=intUtil[_0x9303('0x7d')](_0x3cf65f['serverUrl']);if(_0x255b6a&&_0x255b6a[_0x9303('0x91')]&&_0x255b6a[_0x9303('0x91')]!=='none'){logger[_0x9303('0x35')](_0x9303('0x92'),_0x9303('0x82'));_0x494d86['recordingURL']=_0x3cf65f[_0x9303('0x7f')]+_0x9303('0x84')+_0x494d86[_0x9303('0x85')]+_0x9303('0x86')+md5(_0x494d86[_0x9303('0x85')]);}var _0x2e2aeb=_0x3cf65f[_0x9303('0x7e')]===_0x9303('0x87')?'eu':_0x9303('0x93');return getAccessToken(_0x3cf65f)['then'](function(_0x23712d){_0x1d9837=_0x23712d;return getUser(_0x1d9837,_0x2e2aeb,_0x3cf65f,_0x17cc4b[_0x9303('0x34')]);})[_0x9303('0x32')](function(_0x16456c){_0x36ff6b=_0x16456c;logger[_0x9303('0x35')](_0x9303('0x88'),_0x36ff6b['id']);return getEndUser(_0x1d9837,_0x2e2aeb,_0x3cf65f,_0x494d86['destcalleridname'],_0x494d86[_0x9303('0x94')],_0x36ff6b,_0x49b26a);})[_0x9303('0x32')](function(_0x2a5598){_0x3dc4f2=_0x2a5598;return getCall(_0x1d9837,_0x2e2aeb,_0x3cf65f,_0x36ff6b,_0x3dc4f2,_0x49b26a,_0x494d86,_0x9303('0x95'));})[_0x9303('0x32')](function(_0x568f42){if(_0x568f42){logger[_0x9303('0x35')]('The\x20Call\x20ID\x20is:',_0x568f42['id']);logger['info'](_0x9303('0x92'),_0x9303('0x96'));emit(util[_0x9303('0x63')](_0x9303('0x8d'),_0x17cc4b[_0x9303('0x1b')]),_0x9303('0x8e'),{'uri':'https://crm.'+_0x3cf65f[_0x9303('0x7e')]+_0x9303('0x8f')+_0x568f42['id']});}})[_0x9303('0x2a')](function(_0x43cb34){logger['error']('[OUTBOUND]',JSON[_0x9303('0xf')](_0x43cb34));});};exports[_0x9303('0x97')]=function(_0x309cb0,_0x998e44,_0x3b0b80,_0x4b6828,_0x437ee6,_0x551ef2){var _0x342b3e,_0x2727eb,_0x5b2b04;_0x551ef2['host']=intUtil[_0x9303('0x7d')](_0x551ef2[_0x9303('0x7e')]);_0x551ef2[_0x9303('0x7f')]=intUtil['stripTrailingSlash'](_0x551ef2['serverUrl']);if(_0x437ee6&&_0x437ee6['monitor_format']){logger[_0x9303('0x35')]('['+_0x998e44[_0x9303('0x69')][_0x9303('0x98')]()+']',_0x9303('0x82'));_0x998e44[_0x9303('0x83')]=_0x551ef2[_0x9303('0x7f')]+_0x9303('0x84')+_0x998e44[_0x9303('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x998e44[_0x9303('0x85')]);}else{_0x998e44[_0x9303('0x83')]='';}var _0x13f10a=_0x551ef2[_0x9303('0x7e')]===_0x9303('0x87')?'eu':_0x9303('0x93');return getAccessToken(_0x551ef2)['then'](function(_0x229c07){_0x5b2b04=_0x229c07;return getUser(_0x5b2b04,_0x13f10a,_0x551ef2);})['then'](function(_0x40d1d0){_0x342b3e=_0x40d1d0;logger['info']('The\x20User\x20ID\x20is:',_0x342b3e['id']);return getEndUser(_0x5b2b04,_0x13f10a,_0x551ef2,_0x998e44[_0x9303('0x89')],_0x998e44[_0x9303('0x8a')],_0x342b3e,_0x3b0b80);})[_0x9303('0x32')](function(_0x4977a5){_0x2727eb=_0x4977a5;return getCall(_0x5b2b04,_0x13f10a,_0x551ef2,_0x342b3e,_0x2727eb,_0x3b0b80,_0x998e44,_0x9303('0x8b'));})[_0x9303('0x32')](function(_0x5b8287){if(_0x5b8287){logger[_0x9303('0x35')](_0x9303('0x8c'),_0x5b8287['id']);}})[_0x9303('0x2a')](function(_0x199788){logger['error']('['+_0x998e44[_0x9303('0x69')][_0x9303('0x98')]()+']',JSON[_0x9303('0xf')](_0x199788));});}; \ 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 143e1ad..8483d3b 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 _0x450c=['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','shelljs','mustache','../../../../config/logger','exec'];(function(_0x29eff2,_0xde51e9){var _0x2b5e13=function(_0x5be192){while(--_0x5be192){_0x29eff2['push'](_0x29eff2['shift']());}};_0x2b5e13(++_0xde51e9);}(_0x450c,0x14e));var _0xc450=function(_0x159cbe,_0x2ed6a6){_0x159cbe=_0x159cbe-0x0;var _0x485dc1=_0x450c[_0x159cbe];return _0x485dc1;};'use strict';var util=require('util');var sh=require(_0xc450('0x0'));var Mustache=require(_0xc450('0x1'));var logger=require(_0xc450('0x2'))('trigger');exports[_0xc450('0x3')]=function(_0x42b841,_0x2745e5){var _0x3c0899=_0x42b841[_0xc450('0x4')]?_0x42b841[_0xc450('0x4')]:_0xc450('0x5');var _0x4fb6d2=_0x42b841[_0xc450('0x6')]?Mustache[_0xc450('0x7')](_0x42b841[_0xc450('0x6')],_0x2745e5):_0x2745e5;sh[_0xc450('0x3')](_0x4fb6d2,function(_0x3b13e8,_0x176484,_0x575233){if(_0x3b13e8!==0x0){logger[_0xc450('0x8')](util[_0xc450('0x9')](_0xc450('0xa'),_0x3c0899,_0x4fb6d2,_0x3b13e8,_0x575233));}else{logger[_0xc450('0xb')](util[_0xc450('0x9')](_0xc450('0xc'),_0x3c0899,_0x4fb6d2,_0x176484));}});}; \ No newline at end of file +var _0x9adc=['%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','../../../../config/logger','data2','Script','render','data3','exec','error','format'];(function(_0xfaa274,_0x382a1c){var _0x3ff21b=function(_0x2a7c83){while(--_0x2a7c83){_0xfaa274['push'](_0xfaa274['shift']());}};_0x3ff21b(++_0x382a1c);}(_0x9adc,0x1a5));var _0xc9ad=function(_0x1bc173,_0x1f46f5){_0x1bc173=_0x1bc173-0x0;var _0x2815a0=_0x9adc[_0x1bc173];return _0x2815a0;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xc9ad('0x0'))('trigger');exports['exec']=function(_0x146d53,_0x18bf4f){var _0x2e6c99=_0x146d53[_0xc9ad('0x1')]?_0x146d53[_0xc9ad('0x1')]:_0xc9ad('0x2');var _0x2f6be1=_0x146d53['data3']?Mustache[_0xc9ad('0x3')](_0x146d53[_0xc9ad('0x4')],_0x18bf4f):_0x18bf4f;sh[_0xc9ad('0x5')](_0x2f6be1,function(_0x5cd988,_0x25be74,_0x2662a){if(_0x5cd988!==0x0){logger[_0xc9ad('0x6')](util[_0xc9ad('0x7')](_0xc9ad('0x8'),_0x2e6c99,_0x2f6be1,_0x5cd988,_0x2662a));}else{logger[_0xc9ad('0x9')](util[_0xc9ad('0x7')](_0xc9ad('0xa'),_0x2e6c99,_0x2f6be1,_0x25be74));}});}; \ 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 73bfce6..819a6e7 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 _0x763a=['data2','number','data5','headers','data6','error','stack','toUpperCase','DELETE','data7','parse','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%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','message','lodash','../../../../config/logger','trigger','data1','render'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0x763a,0x157));var _0xa763=function(_0x11bcbb,_0x57e85d){_0x11bcbb=_0x11bcbb-0x0;var _0x1561e9=_0x763a[_0x11bcbb];return _0x1561e9;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0xa763('0x0'));var Mustache=require('mustache');var logger=require(_0xa763('0x1'))(_0xa763('0x2'));exports['exec']=function(_0x4b0f37,_0x4b86a6){var _0x593d62,_0x2f0de0;var _0x51a6a5={'method':_0x4b0f37[_0xa763('0x3')]['toUpperCase'](),'uri':Mustache[_0xa763('0x4')](_0x4b0f37[_0xa763('0x5')],_0x4b86a6),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4b0f37['data5'])===_0xa763('0x6')&&parseInt(_0x4b0f37['data5'])>=0x1&&parseInt(_0x4b0f37[_0xa763('0x7')])<=0xa?parseInt(_0x4b0f37['data5'])*0x3e8:0x5*0x3e8};try{_0x51a6a5[_0xa763('0x8')]=_0x4b0f37['data6']?JSON['parse'](Mustache[_0xa763('0x4')](_0x4b0f37[_0xa763('0x9')],_0x4b86a6)):{};}catch(_0x1ea62a){logger[_0xa763('0xa')](_0x1ea62a[_0xa763('0xb')]);}switch(_0x4b0f37[_0xa763('0x3')][_0xa763('0xc')]()){case'GET':case _0xa763('0xd'):_0x593d62=null;_0x51a6a5['qs']=_0x4b86a6;break;case'POST':case'PUT':if(_0x4b0f37[_0xa763('0xe')]){try{_0x593d62=JSON[_0xa763('0xf')](Mustache[_0xa763('0x4')](_0x4b0f37[_0xa763('0xe')],_0x4b86a6));_0x51a6a5[_0xa763('0x10')]=_0x593d62;}catch(_0x52c8b2){logger[_0xa763('0xa')](_0x52c8b2['stack']);logger[_0xa763('0xa')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x593d62=_0x4b86a6;_0x51a6a5['body']=_0x593d62;}break;}logger[_0xa763('0x11')](util[_0xa763('0x12')](_0xa763('0x13'),_0x4b0f37[_0xa763('0x3')],_0x4b0f37[_0xa763('0x5')],JSON['stringify'](_0x51a6a5)));rp(_0x51a6a5)[_0xa763('0x14')](function(_0x56ea4f){_0x593d62=!_['isNil'](_0x593d62)?_0xa763('0x15')+_0x593d62:'';_0x2f0de0=typeof _0x56ea4f[_0xa763('0x10')]===_0xa763('0x16')?JSON[_0xa763('0x17')](_0x56ea4f[_0xa763('0x10')]):_0x56ea4f['body'];logger[_0xa763('0x11')](util[_0xa763('0x12')](_0xa763('0x18'),_0x4b0f37[_0xa763('0x3')],_0x4b0f37[_0xa763('0x5')],_0x56ea4f[_0xa763('0x19')],_0x2f0de0));})[_0xa763('0x1a')](function(_0x18d32a){logger['error'](util[_0xa763('0x12')](_0xa763('0x1b'),_0x4b0f37[_0xa763('0x3')],_0x4b0f37[_0xa763('0x5')],_0x18d32a[_0xa763('0x19')],_0x18d32a['name'],_0x18d32a[_0xa763('0x1c')]));});}; \ No newline at end of file +var _0xd2ae=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','info','format','%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','util','lodash','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','number','headers','parse','data6','error','stack','GET','DELETE','PUT','data7','body'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd2ae,0xfc));var _0xed2a=function(_0x1b25a0,_0x48567e){_0x1b25a0=_0x1b25a0-0x0;var _0x2c9e5e=_0xd2ae[_0x1b25a0];return _0x2c9e5e;};'use strict';var rp=require('request-promise');var util=require(_0xed2a('0x0'));var _=require(_0xed2a('0x1'));var Mustache=require('mustache');var logger=require(_0xed2a('0x2'))('trigger');exports[_0xed2a('0x3')]=function(_0x164d60,_0xfb5fed){var _0x786f8c,_0x2b6e40;var _0x10e3bd={'method':_0x164d60[_0xed2a('0x4')][_0xed2a('0x5')](),'uri':Mustache[_0xed2a('0x6')](_0x164d60[_0xed2a('0x7')],_0xfb5fed),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x164d60[_0xed2a('0x8')])===_0xed2a('0x9')&&parseInt(_0x164d60[_0xed2a('0x8')])>=0x1&&parseInt(_0x164d60['data5'])<=0xa?parseInt(_0x164d60[_0xed2a('0x8')])*0x3e8:0x5*0x3e8};try{_0x10e3bd[_0xed2a('0xa')]=_0x164d60['data6']?JSON[_0xed2a('0xb')](Mustache[_0xed2a('0x6')](_0x164d60[_0xed2a('0xc')],_0xfb5fed)):{};}catch(_0x21f69a){logger[_0xed2a('0xd')](_0x21f69a[_0xed2a('0xe')]);}switch(_0x164d60[_0xed2a('0x4')][_0xed2a('0x5')]()){case _0xed2a('0xf'):case _0xed2a('0x10'):_0x786f8c=null;_0x10e3bd['qs']=_0xfb5fed;break;case'POST':case _0xed2a('0x11'):if(_0x164d60[_0xed2a('0x12')]){try{_0x786f8c=JSON['parse'](Mustache[_0xed2a('0x6')](_0x164d60[_0xed2a('0x12')],_0xfb5fed));_0x10e3bd[_0xed2a('0x13')]=_0x786f8c;}catch(_0x2ae2f3){logger['error'](_0x2ae2f3[_0xed2a('0xe')]);logger[_0xed2a('0xd')](_0xed2a('0x14'));}}else{_0x786f8c=_0xfb5fed;_0x10e3bd[_0xed2a('0x13')]=_0x786f8c;}break;}logger['info'](util['format'](_0xed2a('0x15'),_0x164d60[_0xed2a('0x4')],_0x164d60['data2'],JSON[_0xed2a('0x16')](_0x10e3bd)));rp(_0x10e3bd)[_0xed2a('0x17')](function(_0x145c7b){_0x786f8c=!_[_0xed2a('0x18')](_0x786f8c)?_0xed2a('0x19')+_0x786f8c:'';_0x2b6e40=typeof _0x145c7b[_0xed2a('0x13')]===_0xed2a('0x1a')?JSON['stringify'](_0x145c7b['body']):_0x145c7b[_0xed2a('0x13')];logger[_0xed2a('0x1b')](util[_0xed2a('0x1c')](_0xed2a('0x1d'),_0x164d60['data1'],_0x164d60[_0xed2a('0x7')],_0x145c7b[_0xed2a('0x1e')],_0x2b6e40));})[_0xed2a('0x1f')](function(_0x1059db){logger[_0xed2a('0xd')](util[_0xed2a('0x1c')](_0xed2a('0x20'),_0x164d60[_0xed2a('0x4')],_0x164d60[_0xed2a('0x7')],_0x1059db['statusCode'],_0x1059db[_0xed2a('0x21')],_0x1059db['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4ef7aad..e4669c3 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 _0xcafd=['http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x391bf7,_0x5b92f7){var _0x41c384=function(_0x13541a){while(--_0x13541a){_0x391bf7['push'](_0x391bf7['shift']());}};_0x41c384(++_0x5b92f7);}(_0xcafd,0x10a));var _0xdcaf=function(_0x4b54b9,_0x2a2f68){_0x4b54b9=_0x4b54b9-0x0;var _0x30f9d4=_0xcafd[_0x4b54b9];return _0x30f9d4;};'use strict';var jayson=require(_0xdcaf('0x0'));var BPromise=require(_0xdcaf('0x1'));var logger=require(_0xdcaf('0x2'))(_0xdcaf('0x3'));var client=jayson['client'][_0xdcaf('0x4')]({'port':0x2329});client[_0xdcaf('0x5')]=function(_0x59eaed,_0x139662){return new BPromise(function(_0x5c3bc0,_0x378a3e){return client[_0xdcaf('0x6')](_0x59eaed,_0x139662)[_0xdcaf('0x7')](function(_0x446060){logger[_0xdcaf('0x8')](_0xdcaf('0x9'),_0xdcaf('0x3'),_0x59eaed,_0x139662,_0x446060);if(_0x446060['error']){logger[_0xdcaf('0xa')](_0xdcaf('0x9'),_0xdcaf('0x3'),_0x59eaed,_0x446060[_0xdcaf('0xa')][_0xdcaf('0xb')],_0x139662);return _0x378a3e(_0x446060['error'][_0xdcaf('0xb')]);}else{return _0x5c3bc0(_0x446060[_0xdcaf('0xc')]);}})[_0xdcaf('0xd')](function(_0x5a1304){logger[_0xdcaf('0xa')]('rpc',_0xdcaf('0x3'),_0x59eaed,_0x5a1304,_0x139662);return _0x378a3e(_0x5a1304);});});};module[_0xdcaf('0xe')]=client; \ No newline at end of file +var _0xad4a=['jayson/promise','routing','client','Request','request','rpc','error','message','result','catch'];(function(_0x53fb9a,_0x560bc9){var _0x494b4e=function(_0x588e61){while(--_0x588e61){_0x53fb9a['push'](_0x53fb9a['shift']());}};_0x494b4e(++_0x560bc9);}(_0xad4a,0x168));var _0xaad4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xad4a[_0x321bb2];return _0x9c12ed;};'use strict';var jayson=require(_0xaad4('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xaad4('0x1'));var client=jayson[_0xaad4('0x2')]['http']({'port':0x2329});client[_0xaad4('0x3')]=function(_0x2fcf3a,_0x2c8ca9){return new BPromise(function(_0xee281e,_0x8c4fd7){return client[_0xaad4('0x4')](_0x2fcf3a,_0x2c8ca9)['then'](function(_0x5d742a){logger['debug'](_0xaad4('0x5'),_0xaad4('0x1'),_0x2fcf3a,_0x2c8ca9,_0x5d742a);if(_0x5d742a[_0xaad4('0x6')]){logger[_0xaad4('0x6')](_0xaad4('0x5'),_0xaad4('0x1'),_0x2fcf3a,_0x5d742a[_0xaad4('0x6')]['message'],_0x2c8ca9);return _0x8c4fd7(_0x5d742a[_0xaad4('0x6')][_0xaad4('0x7')]);}else{return _0xee281e(_0x5d742a[_0xaad4('0x8')]);}})[_0xaad4('0x9')](function(_0x2ef44d){logger[_0xaad4('0x6')](_0xaad4('0x5'),'routing',_0x2fcf3a,_0x2ef44d,_0x2c8ca9);return _0x8c4fd7(_0x2ef44d);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index e4c22c0..670ce80 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 _0xd0f2=['./realtime','./rpc/mailAccount','email','resolve','then','initMailAccounts','refresh','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server'];(function(_0x1ffe91,_0x43ece5){var _0x2ad3ae=function(_0x3134b1){while(--_0x3134b1){_0x1ffe91['push'](_0x1ffe91['shift']());}};_0x2ad3ae(++_0x43ece5);}(_0xd0f2,0x141));var _0x2d0f=function(_0x3fcb8c,_0x120ae0){_0x3fcb8c=_0x3fcb8c-0x0;var _0x3cca17=_0xd0f2[_0x3fcb8c];return _0x3cca17;};'use strict';var server=require(_0x2d0f('0x0'));var Realtime=require(_0x2d0f('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x2d0f('0x2'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0x2d0f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2d0f('0x4')]()[_0x2d0f('0x5')](mailAccount['getMailAccounts']())[_0x2d0f('0x5')](realtime[_0x2d0f('0x6')]())['then'](function(){email[_0x2d0f('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x2d0f('0x8')](realtime,email)[_0x2d0f('0x5')](function(){return initRealtime();})[_0x2d0f('0x5')](function(){return setting[_0x2d0f('0x9')]();})[_0x2d0f('0x5')](function(_0x408628){return setInterval(initRealtime,_0x408628[_0x2d0f('0xa')]*0x3e8);})[_0x2d0f('0xb')](function(_0x153141){logger[_0x2d0f('0xc')](_0x2d0f('0xd'),_0x153141);});}main(); \ No newline at end of file +var _0x1267=['mailAccounts','listen','getSettings','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','then','getMailAccounts'];(function(_0x437aa2,_0x48d508){var _0x28ac4d=function(_0x4afc37){while(--_0x4afc37){_0x437aa2['push'](_0x437aa2['shift']());}};_0x28ac4d(++_0x48d508);}(_0x1267,0x172));var _0x7126=function(_0x5df926,_0x39e347){_0x5df926=_0x5df926-0x0;var _0x216064=_0x1267[_0x5df926];return _0x216064;};'use strict';var server=require('./server');var Realtime=require(_0x7126('0x0'));var EmailChannel=require(_0x7126('0x1'));var mailAccount=require(_0x7126('0x2'));var setting=require(_0x7126('0x3'));var logger=require(_0x7126('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x7126('0x5')](mailAccount[_0x7126('0x6')]())[_0x7126('0x5')](realtime['initMailAccounts']())[_0x7126('0x5')](function(){email['refresh'](realtime[_0x7126('0x7')]);return realtime;});}function main(){return server[_0x7126('0x8')](realtime,email)[_0x7126('0x5')](function(){return initRealtime();})[_0x7126('0x5')](function(){return setting[_0x7126('0x9')]();})[_0x7126('0x5')](function(_0x53cbf4){return setInterval(initRealtime,_0x53cbf4['loginMailFrequency']*0x3e8);})[_0x7126('0xa')](function(_0x3f5146){logger[_0x7126('0xb')](_0x7126('0xc'),_0x3f5146);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 69fcde1..fe68790 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 _0x58ce=['socket.io-emitter','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','stringify','refresh','service','provider','custom','imapAccounts','hasOwnProperty','email','bind','handleImapEmail','end','handleImapEnd','error','disabled','handleImapBox','messageStatus','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','Smtp','verify','verified','exports','bluebird','md5','../../../config/environment','../../../config/logger','redis','localhost'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x58ce,0x16d));var _0xe58c=function(_0xfd04a5,_0x1fbd6a){_0xfd04a5=_0xfd04a5-0x0;var _0x576bfe=_0x58ce[_0xfd04a5];return _0x576bfe;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xe58c('0x0'));var md5=require(_0xe58c('0x1'));var Redis=require('ioredis');var config=require(_0xe58c('0x2'));var logger=require(_0xe58c('0x3'))('email');config['redis']=_['defaults'](config[_0xe58c('0x4')],{'host':_0xe58c('0x5'),'port':0x18eb});var io=require(_0xe58c('0x6'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x51adf1){logger['info'](_0xe58c('0x7'));this[_0xe58c('0x8')]=_0x51adf1[_0xe58c('0x8')];this['imapAccounts']={};this[_0xe58c('0x9')]=new EmailSmtp();}EmailChannel[_0xe58c('0xa')][_0xe58c('0xb')]=function(_0x3054e0){var _0x467a0b=this[_0xe58c('0x8')][_0x3054e0];var _0x596f5f={'id':_0x467a0b['id'],'name':_0x467a0b[_0xe58c('0xc')],'key':_0x467a0b[_0xe58c('0xd')],'active':_0x467a0b[_0xe58c('0xe')],'Imap':{'status':_0x467a0b[_0xe58c('0xf')][_0xe58c('0x10')],'messageStatus':_0x467a0b[_0xe58c('0xf')]['messageStatus'],'total':_0x467a0b[_0xe58c('0xf')][_0xe58c('0x11')]}};if(_[_0xe58c('0x12')](md5Accounts[_0x3054e0])){md5Accounts[_0x3054e0]={};}var _0x4a412e=md5(JSON[_0xe58c('0x13')](_0x596f5f));if(md5Accounts[_0x3054e0][_0xe58c('0x1')]!==_0x4a412e){md5Accounts[_0x3054e0]['md5']=_0x4a412e;io[_0xe58c('0xb')]('mailAccount:update',_0x596f5f);}};EmailChannel[_0xe58c('0xa')][_0xe58c('0x14')]=function(_0x2351b9){for(var _0x1017d5 in _0x2351b9){if(_0x2351b9['hasOwnProperty'](_0x1017d5)){if(_0x2351b9[_0x1017d5][_0xe58c('0xf')]&&_0x2351b9[_0x1017d5][_0xe58c('0xe')]){var _0x434b6a=_0x2351b9[_0x1017d5]['Imap'];if(!_0x434b6a[_0xe58c('0x15')]&&_0x2351b9[_0x1017d5][_0xe58c('0x16')]!==_0xe58c('0x17'))_0x434b6a[_0xe58c('0x15')]=_0x2351b9[_0x1017d5][_0xe58c('0x16')];if(!this[_0xe58c('0x18')][_0xe58c('0x19')](_0x434b6a['id'])){this[_0xe58c('0x18')][_0x434b6a['id']]=new EmailImap(_0x434b6a,_0x2351b9[_0x1017d5][_0xe58c('0x1a')]);this[_0xe58c('0x18')][_0x434b6a['id']]['on']('box',this['handleImapBox'][_0xe58c('0x1b')](this,_0x1017d5));this[_0xe58c('0x18')][_0x434b6a['id']]['on'](_0xe58c('0x1a'),this[_0xe58c('0x1c')][_0xe58c('0x1b')](this,_0x1017d5));this[_0xe58c('0x18')][_0x434b6a['id']]['on'](_0xe58c('0x1d'),this[_0xe58c('0x1e')][_0xe58c('0x1b')](this,_0x1017d5));this['imapAccounts'][_0x434b6a['id']]['on'](_0xe58c('0x1f'),this['handleImapError'][_0xe58c('0x1b')](this,_0x1017d5));}}else{if(_[_0xe58c('0x12')](this[_0xe58c('0x8')][_0x1017d5][_0xe58c('0xf')])){this[_0xe58c('0x8')][_0x1017d5][_0xe58c('0xf')]={};}this[_0xe58c('0x8')][_0x1017d5][_0xe58c('0xf')][_0xe58c('0x10')]=_0xe58c('0x20');this[_0xe58c('0x8')][_0x1017d5][_0xe58c('0xf')]['messageStatus']='';this[_0xe58c('0xb')](_0x1017d5);}}}};EmailChannel[_0xe58c('0xa')][_0xe58c('0x21')]=function(_0x2029f4,_0x16d7bb){if(this['mailAccounts'][_0x2029f4]){this[_0xe58c('0x8')][_0x2029f4][_0xe58c('0xf')][_0xe58c('0x10')]='connected';this[_0xe58c('0x8')][_0x2029f4][_0xe58c('0xf')][_0xe58c('0x22')]=_0x16d7bb[_0xe58c('0xc')];if(_0x16d7bb[_0xe58c('0x23')]){this[_0xe58c('0x8')][_0x2029f4][_0xe58c('0xf')][_0xe58c('0x11')]=_0x16d7bb[_0xe58c('0x23')]['total'];}return this[_0xe58c('0xb')](_0x2029f4);}};EmailChannel[_0xe58c('0xa')][_0xe58c('0x1c')]=function(_0xd3c136,_0x29048b){logger[_0xe58c('0x24')](_0xe58c('0x25'),_0x29048b[_0xe58c('0x26')],_0x29048b[_0xe58c('0x27')],_0x29048b[_0xe58c('0x28')],_0xd3c136);if(this[_0xe58c('0x8')][_0xd3c136]){return mailAccount['notify'](_0xd3c136,_0x29048b)[_0xe58c('0x29')](function(_0x1bb693){if(_0x1bb693){logger[_0xe58c('0x24')](_0xe58c('0x2a'));}})[_0xe58c('0x2b')](function(_0xd249de){logger[_0xe58c('0x1f')](_0xe58c('0x2c'),JSON[_0xe58c('0x13')](_0xd249de));});}};EmailChannel[_0xe58c('0xa')]['handleImapEnd']=function(_0x2f828e){if(this[_0xe58c('0x8')][_0x2f828e]&&this[_0xe58c('0x8')][_0x2f828e][_0xe58c('0xf')]){if(this[_0xe58c('0x18')][this[_0xe58c('0x8')][_0x2f828e][_0xe58c('0xf')]['id']]){delete this[_0xe58c('0x18')][this[_0xe58c('0x8')][_0x2f828e][_0xe58c('0xf')]['id']];}this[_0xe58c('0x8')][_0x2f828e][_0xe58c('0xf')][_0xe58c('0x2d')]=moment();this[_0xe58c('0xb')](_0x2f828e);}};EmailChannel[_0xe58c('0xa')][_0xe58c('0x2e')]=function(_0x10b44e,_0x42178f){if(this[_0xe58c('0x8')][_0x10b44e]){this['mailAccounts'][_0x10b44e][_0xe58c('0xf')][_0xe58c('0x10')]=_0xe58c('0x1f');this[_0xe58c('0x8')][_0x10b44e]['Imap'][_0xe58c('0x22')]=_0x42178f;return this[_0xe58c('0xb')](_0x10b44e);}};EmailChannel[_0xe58c('0xa')][_0xe58c('0x2f')]=function(_0x55535d,_0x2d920c){return this[_0xe58c('0x9')][_0xe58c('0x30')](_0x55535d,_0x2d920c);};EmailChannel[_0xe58c('0xa')]['verifySmtp']=function(_0x312ec2){var _0x1b0060=this;if(this[_0xe58c('0x8')][_0x312ec2['id']]){if(_['isNil'](this[_0xe58c('0x8')][_0x312ec2['id']][_0xe58c('0x31')])){this[_0xe58c('0x8')][_0x312ec2['id']][_0xe58c('0x31')]={};}this[_0xe58c('0x8')][_0x312ec2['id']][_0xe58c('0x31')][_0xe58c('0x2d')]=moment();return new BPromise(function(_0x5ba52f,_0x517c20){return _0x1b0060[_0xe58c('0x9')][_0xe58c('0x32')](_0x312ec2)[_0xe58c('0x29')](function(_0x17c409){_0x1b0060[_0xe58c('0x8')][_0x312ec2['id']]['Smtp'][_0xe58c('0x10')]=_0xe58c('0x33');_0x1b0060[_0xe58c('0x8')][_0x312ec2['id']]['Smtp']['messageStatus']='';_0x1b0060[_0xe58c('0xb')](_0x312ec2['id']);_0x5ba52f(_0x17c409);})[_0xe58c('0x2b')](function(_0x446bc8){_0x1b0060['mailAccounts'][_0x312ec2['id']][_0xe58c('0x31')][_0xe58c('0x10')]=_0xe58c('0x1f');_0x1b0060[_0xe58c('0x8')][_0x312ec2['id']][_0xe58c('0x31')][_0xe58c('0x22')]=_0x446bc8;_0x1b0060['emit'](_0x312ec2['id']);_0x517c20(_0x446bc8);});});}return this['smtp'][_0xe58c('0x32')](_0x312ec2);};module[_0xe58c('0x34')]=EmailChannel; \ No newline at end of file +var _0x7f09=['custom','service','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','handleImapError','status','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','stringify','smtp','verifySmtp','Smtp','lastSync','verify','then','verified','catch','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','key','active','Imap','messageStatus','total','isNil','mailAccount:update','prototype','refresh','provider'];(function(_0x1df63e,_0x13649a){var _0x5eaf1a=function(_0xdf1d45){while(--_0xdf1d45){_0x1df63e['push'](_0x1df63e['shift']());}};_0x5eaf1a(++_0x13649a);}(_0x7f09,0x1dd));var _0x97f0=function(_0x47ec84,_0x547331){_0x47ec84=_0x47ec84-0x0;var _0x2e7a80=_0x7f09[_0x47ec84];return _0x2e7a80;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x97f0('0x0'));var md5=require(_0x97f0('0x1'));var Redis=require(_0x97f0('0x2'));var config=require(_0x97f0('0x3'));var logger=require(_0x97f0('0x4'))(_0x97f0('0x5'));config[_0x97f0('0x6')]=_[_0x97f0('0x7')](config[_0x97f0('0x6')],{'host':_0x97f0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x97f0('0x6')]));var EmailImap=require(_0x97f0('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x97f0('0xa'));var md5Accounts={};function EmailChannel(_0x2ec1dd){logger[_0x97f0('0xb')](_0x97f0('0xc'));this['mailAccounts']=_0x2ec1dd[_0x97f0('0xd')];this[_0x97f0('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x97f0('0xf')]=function(_0x251e1b){var _0x218036=this[_0x97f0('0xd')][_0x251e1b];var _0x440227={'id':_0x218036['id'],'name':_0x218036[_0x97f0('0x10')],'key':_0x218036[_0x97f0('0x11')],'active':_0x218036[_0x97f0('0x12')],'Imap':{'status':_0x218036[_0x97f0('0x13')]['status'],'messageStatus':_0x218036[_0x97f0('0x13')][_0x97f0('0x14')],'total':_0x218036[_0x97f0('0x13')][_0x97f0('0x15')]}};if(_[_0x97f0('0x16')](md5Accounts[_0x251e1b])){md5Accounts[_0x251e1b]={};}var _0x32ec08=md5(JSON['stringify'](_0x440227));if(md5Accounts[_0x251e1b][_0x97f0('0x1')]!==_0x32ec08){md5Accounts[_0x251e1b][_0x97f0('0x1')]=_0x32ec08;io[_0x97f0('0xf')](_0x97f0('0x17'),_0x440227);}};EmailChannel[_0x97f0('0x18')][_0x97f0('0x19')]=function(_0x182387){for(var _0x4f32e1 in _0x182387){if(_0x182387['hasOwnProperty'](_0x4f32e1)){if(_0x182387[_0x4f32e1][_0x97f0('0x13')]&&_0x182387[_0x4f32e1][_0x97f0('0x12')]){var _0x3d3746=_0x182387[_0x4f32e1][_0x97f0('0x13')];if(!_0x3d3746['service']&&_0x182387[_0x4f32e1][_0x97f0('0x1a')]!==_0x97f0('0x1b'))_0x3d3746[_0x97f0('0x1c')]=_0x182387[_0x4f32e1][_0x97f0('0x1a')];if(!this[_0x97f0('0xe')][_0x97f0('0x1d')](_0x3d3746['id'])){this[_0x97f0('0xe')][_0x3d3746['id']]=new EmailImap(_0x3d3746,_0x182387[_0x4f32e1][_0x97f0('0x5')]);this[_0x97f0('0xe')][_0x3d3746['id']]['on'](_0x97f0('0x1e'),this[_0x97f0('0x1f')][_0x97f0('0x20')](this,_0x4f32e1));this['imapAccounts'][_0x3d3746['id']]['on'](_0x97f0('0x5'),this['handleImapEmail'][_0x97f0('0x20')](this,_0x4f32e1));this[_0x97f0('0xe')][_0x3d3746['id']]['on'](_0x97f0('0x21'),this[_0x97f0('0x22')][_0x97f0('0x20')](this,_0x4f32e1));this[_0x97f0('0xe')][_0x3d3746['id']]['on']('error',this[_0x97f0('0x23')]['bind'](this,_0x4f32e1));}}else{if(_[_0x97f0('0x16')](this[_0x97f0('0xd')][_0x4f32e1][_0x97f0('0x13')])){this[_0x97f0('0xd')][_0x4f32e1][_0x97f0('0x13')]={};}this[_0x97f0('0xd')][_0x4f32e1][_0x97f0('0x13')][_0x97f0('0x24')]=_0x97f0('0x25');this[_0x97f0('0xd')][_0x4f32e1]['Imap']['messageStatus']='';this[_0x97f0('0xf')](_0x4f32e1);}}}};EmailChannel[_0x97f0('0x18')][_0x97f0('0x1f')]=function(_0x1db035,_0x92edf2){if(this[_0x97f0('0xd')][_0x1db035]){this[_0x97f0('0xd')][_0x1db035]['Imap'][_0x97f0('0x24')]=_0x97f0('0x26');this[_0x97f0('0xd')][_0x1db035][_0x97f0('0x13')]['messageStatus']=_0x92edf2[_0x97f0('0x10')];if(_0x92edf2[_0x97f0('0x27')]){this[_0x97f0('0xd')][_0x1db035][_0x97f0('0x13')][_0x97f0('0x15')]=_0x92edf2['messages'][_0x97f0('0x15')];}return this[_0x97f0('0xf')](_0x1db035);}};EmailChannel[_0x97f0('0x18')][_0x97f0('0x28')]=function(_0x428907,_0x686200){logger[_0x97f0('0xb')](_0x97f0('0x29'),_0x686200[_0x97f0('0x2a')],_0x686200[_0x97f0('0x2b')],_0x686200[_0x97f0('0x2c')],_0x428907);if(this[_0x97f0('0xd')][_0x428907]){return mailAccount[_0x97f0('0x2d')](_0x428907,_0x686200)['then'](function(_0x3e40cf){if(_0x3e40cf){logger[_0x97f0('0xb')](_0x97f0('0x2e'));}})['catch'](function(_0x41ec0b){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x97f0('0x2f')](_0x41ec0b));});}};EmailChannel[_0x97f0('0x18')][_0x97f0('0x22')]=function(_0x269f60){if(this['mailAccounts'][_0x269f60]&&this[_0x97f0('0xd')][_0x269f60][_0x97f0('0x13')]){if(this[_0x97f0('0xe')][this[_0x97f0('0xd')][_0x269f60][_0x97f0('0x13')]['id']]){delete this[_0x97f0('0xe')][this[_0x97f0('0xd')][_0x269f60][_0x97f0('0x13')]['id']];}this[_0x97f0('0xd')][_0x269f60][_0x97f0('0x13')]['lastSync']=moment();this['emit'](_0x269f60);}};EmailChannel[_0x97f0('0x18')][_0x97f0('0x23')]=function(_0x351cc7,_0x4cca37){if(this[_0x97f0('0xd')][_0x351cc7]){this[_0x97f0('0xd')][_0x351cc7]['Imap']['status']='error';this['mailAccounts'][_0x351cc7][_0x97f0('0x13')][_0x97f0('0x14')]=_0x4cca37;return this[_0x97f0('0xf')](_0x351cc7);}};EmailChannel[_0x97f0('0x18')]['sendMail']=function(_0x59d0a8,_0x454be0){return this[_0x97f0('0x30')]['send'](_0x59d0a8,_0x454be0);};EmailChannel[_0x97f0('0x18')][_0x97f0('0x31')]=function(_0x16e98a){var _0x4750e3=this;if(this[_0x97f0('0xd')][_0x16e98a['id']]){if(_[_0x97f0('0x16')](this['mailAccounts'][_0x16e98a['id']][_0x97f0('0x32')])){this['mailAccounts'][_0x16e98a['id']][_0x97f0('0x32')]={};}this[_0x97f0('0xd')][_0x16e98a['id']][_0x97f0('0x32')][_0x97f0('0x33')]=moment();return new BPromise(function(_0x47f455,_0x52fde2){return _0x4750e3[_0x97f0('0x30')][_0x97f0('0x34')](_0x16e98a)[_0x97f0('0x35')](function(_0x3e8c3d){_0x4750e3[_0x97f0('0xd')][_0x16e98a['id']]['Smtp'][_0x97f0('0x24')]=_0x97f0('0x36');_0x4750e3[_0x97f0('0xd')][_0x16e98a['id']][_0x97f0('0x32')]['messageStatus']='';_0x4750e3[_0x97f0('0xf')](_0x16e98a['id']);_0x47f455(_0x3e8c3d);})[_0x97f0('0x37')](function(_0x4a0e2d){_0x4750e3['mailAccounts'][_0x16e98a['id']][_0x97f0('0x32')][_0x97f0('0x24')]='error';_0x4750e3[_0x97f0('0xd')][_0x16e98a['id']][_0x97f0('0x32')][_0x97f0('0x14')]=_0x4a0e2d;_0x4750e3[_0x97f0('0xf')](_0x16e98a['id']);_0x52fde2(_0x4a0e2d);});});}return this[_0x97f0('0x30')]['verify'](_0x16e98a);};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 dd725a9..f0ffc63 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 _0x94a5=['handleCloseBox','end','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','exports','lodash','util','imap','mailparser','simpleParser','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','once','ready','handleReady','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','xoauth2','generateXOAuth2Token','password','authentication','host','port','tls','required','openBox','handleOpenBox','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x94a5,0x16b));var _0x594a=function(_0x40e423,_0x10e3df){_0x40e423=_0x40e423-0x0;var _0x2c41f9=_0x94a5[_0x40e423];return _0x2c41f9;};'use strict';var _=require(_0x594a('0x0'));var util=require(_0x594a('0x1'));var Imap=require(_0x594a('0x2'));var simpleParser=require(_0x594a('0x3'))[_0x594a('0x4')];var Iconv=require('iconv')[_0x594a('0x5')];var EventEmitter=require('events')[_0x594a('0x6')];var utils=require(_0x594a('0x7'));var logger=require(_0x594a('0x8'))(_0x594a('0x9'));function EmailImap(_0x1508b2,_0x3fe416){this[_0x594a('0xa')]=_0x1508b2['mailbox'];this[_0x594a('0xb')]=this['getAccount'](_0x1508b2,_0x3fe416);this['imap']=new Imap(this[_0x594a('0xb')]);this[_0x594a('0x2')][_0x594a('0xc')](_0x594a('0xd'),this[_0x594a('0xe')]['bind'](this));this[_0x594a('0x2')][_0x594a('0xc')]('end',this['handleEnd'][_0x594a('0xf')](this));this[_0x594a('0x2')]['on'](_0x594a('0x10'),this[_0x594a('0x11')][_0x594a('0xf')](this));this[_0x594a('0x2')][_0x594a('0x12')]();}util[_0x594a('0x13')](EmailImap,EventEmitter);EmailImap[_0x594a('0x14')]['getAccount']=function(_0x6771b9,_0x51dbb9){var _0x28aab4={'connTimeout':_0x6771b9[_0x594a('0x15')]?_0x6771b9[_0x594a('0x15')]*0x3e8:0x2710,'authTimeout':_0x6771b9[_0x594a('0x16')]?_0x6771b9['authTimeout']*0x3e8:0x1388};if(_0x6771b9[_0x594a('0x17')]){_0x28aab4['user']=_0x6771b9[_0x594a('0x18')];if(_0x6771b9['modernAuthentication']){_0x28aab4[_0x594a('0x19')]=utils[_0x594a('0x1a')](_0x6771b9['CloudProvider']['data5'],_0x6771b9[_0x594a('0x18')]);}else{_0x28aab4[_0x594a('0x1b')]=_0x6771b9[_0x594a('0x1b')];}}else{if(_0x6771b9[_0x594a('0x1c')]){_0x28aab4[_0x594a('0x18')]=_0x6771b9[_0x594a('0x18')];_0x28aab4['password']=_0x6771b9['password'];}}_0x28aab4[_0x594a('0x9')]=_0x51dbb9||_0x6771b9[_0x594a('0x18')]||'anonymous@xcally.com';_0x28aab4['host']=_0x6771b9[_0x594a('0x1d')];_0x28aab4[_0x594a('0x1e')]=_0x6771b9[_0x594a('0x1e')]||0x3e1;if(_0x6771b9[_0x594a('0x1f')]){_0x28aab4[_0x594a('0x1f')]=!![];}else{_0x28aab4[_0x594a('0x1f')]=![];_0x28aab4['autotls']=_0x594a('0x20');}return _0x28aab4;};EmailImap[_0x594a('0x14')][_0x594a('0xe')]=function(){this['imap'][_0x594a('0x21')](this[_0x594a('0xa')],![],this[_0x594a('0x22')][_0x594a('0xf')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x151bca,_0x5bcc09){if(_0x151bca){this[_0x594a('0x11')](_0x151bca,!![]);}else{this[_0x594a('0x23')]('box',_0x5bcc09);this['readUnseen']();}};EmailImap[_0x594a('0x14')][_0x594a('0x24')]=function(_0x4cb28c){if(_0x4cb28c){this[_0x594a('0x11')](_0x4cb28c,!![]);}else{this[_0x594a('0x2')][_0x594a('0x25')]();}};EmailImap[_0x594a('0x14')][_0x594a('0x26')]=function(){this[_0x594a('0x2')][_0x594a('0x27')]([_0x594a('0x28')],this['handleReadUnseen'][_0x594a('0xf')](this));};EmailImap['prototype'][_0x594a('0x29')]=function(_0x16ac52,_0x486913){if(_0x16ac52){this['handleError'](_0x16ac52,!![]);}else{if(_0x486913[_0x594a('0x2a')]){try{var _0x478ed2=this[_0x594a('0x2')]['fetch'](_0x486913,{'bodies':'','markSeen':!![]});_0x478ed2['on'](_0x594a('0x2b'),this['handleFetchMessage']['bind'](this));_0x478ed2[_0x594a('0xc')](_0x594a('0x10'),this['handleFetchError'][_0x594a('0xf')](this));_0x478ed2[_0x594a('0xc')](_0x594a('0x25'),this[_0x594a('0x2c')][_0x594a('0xf')](this));}catch(_0x57f6c9){logger[_0x594a('0x10')](_0x57f6c9);}}else{this['imap'][_0x594a('0x2d')](!![],this[_0x594a('0x24')][_0x594a('0xf')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x5b41f2){_0x5b41f2['on'](_0x594a('0x2e'),this[_0x594a('0x2f')][_0x594a('0xf')](this));_0x5b41f2[_0x594a('0xc')](_0x594a('0x30'),this[_0x594a('0x31')][_0x594a('0xf')](this));_0x5b41f2[_0x594a('0xc')](_0x594a('0x25'),this[_0x594a('0x32')]['bind'](this));};EmailImap[_0x594a('0x14')][_0x594a('0x2f')]=function(_0x3ee6a8){simpleParser(_0x3ee6a8,{'Iconv':Iconv},this[_0x594a('0x33')]['bind'](this));};EmailImap[_0x594a('0x14')][_0x594a('0x31')]=function(){};EmailImap[_0x594a('0x14')]['handleMessageEnd']=function(){};EmailImap[_0x594a('0x14')][_0x594a('0x33')]=function(_0x471884,_0x2060b2){if(_0x471884){logger[_0x594a('0x10')](_0x471884);}else{var _0x217799=this;utils[_0x594a('0x34')](this[_0x594a('0xb')],_0x2060b2,function(_0x496c41){_0x217799[_0x594a('0x23')](_0x594a('0x9'),_0x496c41);});}};EmailImap[_0x594a('0x14')][_0x594a('0x2c')]=function(){this[_0x594a('0x2')][_0x594a('0x2d')](!![],this['handleCloseBox'][_0x594a('0xf')](this));};EmailImap[_0x594a('0x14')][_0x594a('0x35')]=function(_0x5a93da){this[_0x594a('0x11')](_0x5a93da);this[_0x594a('0x2')][_0x594a('0x2d')](!![],this[_0x594a('0x24')][_0x594a('0xf')](this));};EmailImap[_0x594a('0x14')]['handleEnd']=function(){this[_0x594a('0x23')](_0x594a('0x25'));};EmailImap[_0x594a('0x14')]['handleError']=function(_0x23d8d8,_0x2006fe){logger[_0x594a('0x10')]('handleError',this[_0x594a('0xb')][_0x594a('0x9')],JSON[_0x594a('0x36')](_0x23d8d8));var _0x2e5b9a='';if(_0x23d8d8){if(_0x23d8d8[_0x594a('0x37')]){_0x2e5b9a=_0x23d8d8[_0x594a('0x37')];}else{for(var _0x3ac145 in _0x23d8d8){if(_0x23d8d8['hasOwnProperty'](_0x3ac145)){_0x2e5b9a+=_['upperFirst'](_0x3ac145)+':\x20'+_0x23d8d8[_0x3ac145]+'\x0a';}}}}if(_0x2006fe){this[_0x594a('0x2')]['end']();}else{this['emit'](_0x594a('0x10'),_0x2e5b9a);this[_0x594a('0x23')]('end');}};module[_0x594a('0x38')]=EmailImap; \ No newline at end of file +var _0x4a2e=['box','readUnseen','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleCloseBox','stringify','textCode','upperFirst','lodash','util','imap','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','account','once','ready','handleReady','handleEnd','bind','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox'];(function(_0x16e26e,_0x525320){var _0x34b13b=function(_0x254594){while(--_0x254594){_0x16e26e['push'](_0x16e26e['shift']());}};_0x34b13b(++_0x525320);}(_0x4a2e,0xe3));var _0xe4a2=function(_0x31c3d5,_0x40a38c){_0x31c3d5=_0x31c3d5-0x0;var _0x5424ba=_0x4a2e[_0x31c3d5];return _0x5424ba;};'use strict';var _=require(_0xe4a2('0x0'));var util=require(_0xe4a2('0x1'));var Imap=require(_0xe4a2('0x2'));var simpleParser=require(_0xe4a2('0x3'))[_0xe4a2('0x4')];var Iconv=require(_0xe4a2('0x5'))['Iconv'];var EventEmitter=require(_0xe4a2('0x6'))[_0xe4a2('0x7')];var utils=require(_0xe4a2('0x8'));var logger=require(_0xe4a2('0x9'))(_0xe4a2('0xa'));function EmailImap(_0x44a12a,_0x1003f4){this['mailbox']=_0x44a12a['mailbox'];this[_0xe4a2('0xb')]=this['getAccount'](_0x44a12a,_0x1003f4);this['imap']=new Imap(this[_0xe4a2('0xb')]);this['imap'][_0xe4a2('0xc')](_0xe4a2('0xd'),this[_0xe4a2('0xe')]['bind'](this));this['imap'][_0xe4a2('0xc')]('end',this[_0xe4a2('0xf')][_0xe4a2('0x10')](this));this[_0xe4a2('0x2')]['on']('error',this[_0xe4a2('0x11')][_0xe4a2('0x10')](this));this['imap'][_0xe4a2('0x12')]();}util[_0xe4a2('0x13')](EmailImap,EventEmitter);EmailImap[_0xe4a2('0x14')][_0xe4a2('0x15')]=function(_0x12430c,_0x47e30c){var _0x582f9a={'connTimeout':_0x12430c[_0xe4a2('0x16')]?_0x12430c[_0xe4a2('0x16')]*0x3e8:0x2710,'authTimeout':_0x12430c[_0xe4a2('0x17')]?_0x12430c['authTimeout']*0x3e8:0x1388};if(_0x12430c[_0xe4a2('0x18')]){_0x582f9a[_0xe4a2('0x19')]=_0x12430c[_0xe4a2('0x19')];if(_0x12430c[_0xe4a2('0x1a')]){_0x582f9a[_0xe4a2('0x1b')]=utils[_0xe4a2('0x1c')](_0x12430c[_0xe4a2('0x1d')][_0xe4a2('0x1e')],_0x12430c[_0xe4a2('0x19')]);}else{_0x582f9a[_0xe4a2('0x1f')]=_0x12430c['password'];}}else{if(_0x12430c[_0xe4a2('0x20')]){_0x582f9a[_0xe4a2('0x19')]=_0x12430c[_0xe4a2('0x19')];_0x582f9a[_0xe4a2('0x1f')]=_0x12430c['password'];}}_0x582f9a[_0xe4a2('0xa')]=_0x47e30c||_0x12430c['user']||_0xe4a2('0x21');_0x582f9a[_0xe4a2('0x22')]=_0x12430c[_0xe4a2('0x22')];_0x582f9a[_0xe4a2('0x23')]=_0x12430c[_0xe4a2('0x23')]||0x3e1;if(_0x12430c[_0xe4a2('0x24')]){_0x582f9a['tls']=!![];}else{_0x582f9a[_0xe4a2('0x24')]=![];_0x582f9a[_0xe4a2('0x25')]=_0xe4a2('0x26');}return _0x582f9a;};EmailImap[_0xe4a2('0x14')][_0xe4a2('0xe')]=function(){this['imap'][_0xe4a2('0x27')](this['mailbox'],![],this[_0xe4a2('0x28')][_0xe4a2('0x10')](this));};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x28')]=function(_0x46af4e,_0x1b2cc9){if(_0x46af4e){this[_0xe4a2('0x11')](_0x46af4e,!![]);}else{this['emit'](_0xe4a2('0x29'),_0x1b2cc9);this[_0xe4a2('0x2a')]();}};EmailImap[_0xe4a2('0x14')]['handleCloseBox']=function(_0x31fc39){if(_0x31fc39){this[_0xe4a2('0x11')](_0x31fc39,!![]);}else{this[_0xe4a2('0x2')][_0xe4a2('0x2b')]();}};EmailImap['prototype'][_0xe4a2('0x2a')]=function(){this[_0xe4a2('0x2')][_0xe4a2('0x2c')]([_0xe4a2('0x2d')],this[_0xe4a2('0x2e')]['bind'](this));};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x2e')]=function(_0x31d08a,_0x205bce){if(_0x31d08a){this['handleError'](_0x31d08a,!![]);}else{if(_0x205bce[_0xe4a2('0x2f')]){try{var _0x400927=this[_0xe4a2('0x2')][_0xe4a2('0x30')](_0x205bce,{'bodies':'','markSeen':!![]});_0x400927['on'](_0xe4a2('0x31'),this[_0xe4a2('0x32')][_0xe4a2('0x10')](this));_0x400927['once'](_0xe4a2('0x33'),this[_0xe4a2('0x34')][_0xe4a2('0x10')](this));_0x400927[_0xe4a2('0xc')](_0xe4a2('0x2b'),this[_0xe4a2('0x35')][_0xe4a2('0x10')](this));}catch(_0x1c6e55){logger[_0xe4a2('0x33')](_0x1c6e55);}}else{this[_0xe4a2('0x2')][_0xe4a2('0x36')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x32')]=function(_0x41e912){_0x41e912['on'](_0xe4a2('0x37'),this[_0xe4a2('0x38')][_0xe4a2('0x10')](this));_0x41e912['once'](_0xe4a2('0x39'),this[_0xe4a2('0x3a')]['bind'](this));_0x41e912[_0xe4a2('0xc')]('end',this['handleMessageEnd']['bind'](this));};EmailImap[_0xe4a2('0x14')]['handleMessageBody']=function(_0x52b95b){simpleParser(_0x52b95b,{'Iconv':Iconv},this['handleSimpleParser'][_0xe4a2('0x10')](this));};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x3a')]=function(){};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x3b')]=function(){};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x3c')]=function(_0x2c5a87,_0x549434){if(_0x2c5a87){logger[_0xe4a2('0x33')](_0x2c5a87);}else{var _0x2e2486=this;utils[_0xe4a2('0x3d')](this[_0xe4a2('0xb')],_0x549434,function(_0x15c06a){_0x2e2486[_0xe4a2('0x3e')](_0xe4a2('0xa'),_0x15c06a);});}};EmailImap[_0xe4a2('0x14')]['handleFetchEnd']=function(){this[_0xe4a2('0x2')][_0xe4a2('0x36')](!![],this[_0xe4a2('0x3f')]['bind'](this));};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x34')]=function(_0x285e54){this[_0xe4a2('0x11')](_0x285e54);this['imap'][_0xe4a2('0x36')](!![],this[_0xe4a2('0x3f')][_0xe4a2('0x10')](this));};EmailImap['prototype'][_0xe4a2('0xf')]=function(){this[_0xe4a2('0x3e')](_0xe4a2('0x2b'));};EmailImap[_0xe4a2('0x14')][_0xe4a2('0x11')]=function(_0x3fc20e,_0x19ff53){logger[_0xe4a2('0x33')]('handleError',this[_0xe4a2('0xb')][_0xe4a2('0xa')],JSON[_0xe4a2('0x40')](_0x3fc20e));var _0x3c073a='';if(_0x3fc20e){if(_0x3fc20e[_0xe4a2('0x41')]){_0x3c073a=_0x3fc20e['textCode'];}else{for(var _0x1eee01 in _0x3fc20e){if(_0x3fc20e['hasOwnProperty'](_0x1eee01)){_0x3c073a+=_[_0xe4a2('0x42')](_0x1eee01)+':\x20'+_0x3fc20e[_0x1eee01]+'\x0a';}}}}if(_0x19ff53){this['imap'][_0xe4a2('0x2b')]();}else{this[_0xe4a2('0x3e')](_0xe4a2('0x33'),_0x3c073a);this[_0xe4a2('0x3e')](_0xe4a2('0x2b'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 494fdda..2995b2a 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 _0xce51=['nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','sendMail','toString','verify','Not\x20verifired'];(function(_0x3f2d3a,_0x1f611c){var _0x38ebdf=function(_0x441c86){while(--_0x441c86){_0x3f2d3a['push'](_0x3f2d3a['shift']());}};_0x38ebdf(++_0x1f611c);}(_0xce51,0x140));var _0x1ce5=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xce51[_0x4551f6];return _0x581dc2;};'use strict';var nodemailer=require(_0x1ce5('0x0'));var inlineBase64=require(_0x1ce5('0x1'));function EmailSmtp(){}EmailSmtp[_0x1ce5('0x2')][_0x1ce5('0x3')]=function(_0x116ea7,_0x1a732f){return new Promise(function(_0x19b43f,_0x29b6af){var _0xaa9fbb=nodemailer[_0x1ce5('0x4')](_0x116ea7);_0xaa9fbb[_0x1ce5('0x5')]('compile',inlineBase64());_0xaa9fbb[_0x1ce5('0x6')](_0x1a732f,function(_0x3d634e,_0x4fcc55){if(_0x3d634e){_0x29b6af(_0x3d634e[_0x1ce5('0x7')]());}else{_0x19b43f(_0x4fcc55);}});});};EmailSmtp[_0x1ce5('0x2')][_0x1ce5('0x8')]=function(_0x14059b){return new Promise(function(_0x5efb44,_0x1b6ef4){var _0x1fa1cf=nodemailer[_0x1ce5('0x4')](_0x14059b);_0x1fa1cf[_0x1ce5('0x8')](function(_0x17847c,_0x2b6d20){if(_0x17847c){_0x1b6ef4(_0x17847c[_0x1ce5('0x7')]());}else{if(_0x2b6d20){_0x5efb44(_0x2b6d20);}else{_0x1b6ef4(_0x1ce5('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x2543=['prototype','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','send','use','sendMail','toString'];(function(_0x1275b7,_0x457830){var _0x38524b=function(_0x51df7e){while(--_0x51df7e){_0x1275b7['push'](_0x1275b7['shift']());}};_0x38524b(++_0x457830);}(_0x2543,0xe5));var _0x3254=function(_0x870b62,_0x2143f9){_0x870b62=_0x870b62-0x0;var _0x2dcb39=_0x2543[_0x870b62];return _0x2dcb39;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x3254('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x3254('0x1')]=function(_0x1d1263,_0x6fb99c){return new Promise(function(_0x2f0e0e,_0x567432){var _0x47a88f=nodemailer['createTransport'](_0x1d1263);_0x47a88f[_0x3254('0x2')]('compile',inlineBase64());_0x47a88f[_0x3254('0x3')](_0x6fb99c,function(_0x1718df,_0x11fd45){if(_0x1718df){_0x567432(_0x1718df[_0x3254('0x4')]());}else{_0x2f0e0e(_0x11fd45);}});});};EmailSmtp[_0x3254('0x5')][_0x3254('0x6')]=function(_0x3b9284){return new Promise(function(_0xb8e404,_0x3c054f){var _0xfb4705=nodemailer['createTransport'](_0x3b9284);_0xfb4705['verify'](function(_0x70d86f,_0x295bd3){if(_0x70d86f){_0x3c054f(_0x70d86f[_0x3254('0x4')]());}else{if(_0x295bd3){_0xb8e404(_0x295bd3);}else{_0x3c054f(_0x3254('0x7'));}}});});};module[_0x3254('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index b35872c..3d9389b 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 _0x4f24=['replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','generateXOAuth2Token','user=','utf-8','toString','base64','randomstring','path','util','email','address','anonymous','generate','@xcally.com','head','value','name','split','length','slice','join','Anonymous','pop','isEmpty','html','0x1?_0x216222[_0x44f2('0xd')](0x0,-0x1)[_0x44f2('0xe')]('\x20'):_0x47b887[_0x44f2('0xa')];}return _0x44f2('0xf');}function getLastName(_0xf03a86){var _0x59c7d0=_[_0x44f2('0x8')](_0xf03a86[_0x44f2('0x9')]);if(_0x59c7d0&&_0x59c7d0[_0x44f2('0xa')]){var _0x44ea1d=_0x59c7d0[_0x44f2('0xa')][_0x44f2('0xb')](/\s+/);return _0x44ea1d[_0x44f2('0xc')]>0x1?_0x44ea1d[_0x44f2('0x10')]():'';}return'';}function getMails(_0x406721,_0x406822){var _0x7f0230='';for(var _0x4daf66=0x0;_0x4daf66<_0x406822[_0x44f2('0x9')]['length'];_0x4daf66+=0x1){if(_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0x4')]!==_0x406721){if(!_[_0x44f2('0x11')](_0x7f0230)){_0x7f0230+=',';}_0x7f0230+=_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0xa')]||_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0x4')]||'';_0x7f0230+='\x20<';_0x7f0230+=_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0x4')]?_0x406822['value'][_0x4daf66][_0x44f2('0x4')]:'anonymous'+random['generate'](0x6)+_0x44f2('0x7');_0x7f0230+='>';}}return _0x7f0230;}function parseEmail(_0x50a010,_0x4064f8,_0x145bac){if(_0x4064f8[_0x44f2('0x12')]){var _0x349853=/)<[^<]*)*<\/script>/gi;while(_0x349853['test'](_0x4064f8[_0x44f2('0x12')])){_0x4064f8[_0x44f2('0x12')]=_0x4064f8[_0x44f2('0x12')]['replace'](_0x349853,'');}if(_0x4064f8[_0x44f2('0x12')]['includes'](_0x44f2('0x13'))){var _0xfadb14=[];_0x4064f8['attachments'][_0x44f2('0x14')](_0x106b68=>{_0xfadb14[_0x44f2('0x15')](_0x106b68[_0x44f2('0x16')]);});var _0x5bd310=/]+>/g;var _0x5578ec=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x8ae08a=_0x4064f8[_0x44f2('0x12')][_0x44f2('0x17')](_0x5578ec,_0x44f2('0x18'));var _0x264cae=_0x8ae08a[_0x44f2('0x17')](_0x5bd310,'_IMG');for(let _0x48b5de=0x0;_0x48b5de<_0xfadb14['length'];_0x48b5de++){var _0x133e53=_0x264cae[_0x44f2('0x17')](_0x44f2('0x19'),_0x44f2('0x1a')+_0xfadb14[_0x48b5de]+_0x44f2('0x1b'));_0x264cae=_0x133e53;}_0x4064f8[_0x44f2('0x12')]=_0x264cae;}_0x145bac['body']=_0x4064f8[_0x44f2('0x12')];}else{_0x145bac['body']=_0x4064f8['textAsHtml'];}if(_0x145bac[_0x44f2('0x1c')]){_0x145bac[_0x44f2('0x1c')]=_0x145bac[_0x44f2('0x1c')][_0x44f2('0x17')](/0x0){var _0x2cfbe3=[_0x44f2('0x2d'),_0x44f2('0x2e'),_0x44f2('0x2f')];for(var _0x4e3e64=0x0;_0x4e3e64<_0x4064f8[_0x44f2('0x2c')][_0x44f2('0xc')];_0x4e3e64++){var _0x4d86db=_[_0x44f2('0x30')](_0x2cfbe3,_0x4064f8[_0x44f2('0x2c')][_0x4e3e64][_0x44f2('0x31')]);if(_0x4d86db>=0x0){_0x145bac[_0x44f2('0x32')]=!![];}}}return _0x145bac;}exports[_0x44f2('0x33')]=function(_0x416f1f,_0x28897c,_0x172403){var _0x3a9c06={'from':getAddress(_0x28897c[_0x44f2('0x34')]),'firstName':getFirstName(_0x28897c['from']),'lastName':getLastName(_0x28897c[_0x44f2('0x34')]),'mapKey':'email','message':{'from':getMails(_0x416f1f['email'],_0x28897c[_0x44f2('0x34')]),'to':_0x416f1f[_0x44f2('0x3')],'cc':'','subject':_0x28897c[_0x44f2('0x35')]||'','messageId':_0x28897c[_0x44f2('0x36')],'inReplyTo':_0x28897c['inReplyTo'],'sentAt':moment(_0x28897c[_0x44f2('0x37')])[_0x44f2('0x27')](_0x44f2('0x38')),'attach':![],'attachments':[]}};if(!_0x28897c[_0x44f2('0x12')]&&!_0x28897c[_0x44f2('0x39')]){var _0x15680a=_[_0x44f2('0x3a')](_0x28897c[_0x44f2('0x23')],{'contentType':_0x44f2('0x3b')});if(_0x15680a[_0x44f2('0xc')]){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x28897c['messageId']));tnef[_0x44f2('0x3c')](_['first'](_0x15680a)['content'],function(_0xb8272c,_0x49807b){if(_0x49807b){_0x28897c[_0x44f2('0x12')]=_0x49807b[_0x44f2('0x3d')]||'

Empty\x20message

';if(_0x49807b[_0x44f2('0x3e')]){for(var _0x4b397b=0x0;_0x4b397b<_0x49807b[_0x44f2('0x3e')]['length'];_0x4b397b++){var _0x357edb=_0x49807b[_0x44f2('0x3e')][_0x4b397b];_0x3a9c06[_0x44f2('0x1e')]['attachments'][_0x44f2('0x15')]({'filename':_0x357edb[_0x44f2('0x3f')],'content':Buffer[_0x44f2('0x34')](_0x357edb['Data'])});}}}_0x172403(parseEmail(_0x416f1f,_0x28897c,_0x3a9c06));});}else{_0x28897c[_0x44f2('0x12')]=_0x44f2('0x40');_0x172403(parseEmail(_0x416f1f,_0x28897c,_0x3a9c06));}}else{_0x172403(parseEmail(_0x416f1f,_0x28897c,_0x3a9c06));}};exports[_0x44f2('0x41')]=function(_0x10a9d4,_0x2d1550){var _0x4314fe=[_0x44f2('0x42')+(_0x2d1550||''),'auth=Bearer\x20'+_0x10a9d4,'',''];return Buffer[_0x44f2('0x34')](_0x4314fe['join'](''),_0x44f2('0x43'))[_0x44f2('0x44')](_0x44f2('0x45'));}; \ No newline at end of file +var _0x4227=['Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','substring','split','slice','join','length','pop','test','html','replace','includes','\x20[Attachment:\x20','\x20]','textAsHtml','body','message','originTo','isEmpty','originCc','type','attachment','%s-%s','now','root','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','isAutoreply','from','subject','messageId','inReplyTo','date','format','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','content','

Empty\x20message

'];(function(_0x3fbeb6,_0x39f7c9){var _0x54d386=function(_0x473336){while(--_0x473336){_0x3fbeb6['push'](_0x3fbeb6['shift']());}};_0x54d386(++_0x39f7c9);}(_0x4227,0x121));var _0x7422=function(_0x1c515a,_0xdbd7ca){_0x1c515a=_0x1c515a-0x0;var _0x3e820d=_0x4227[_0x1c515a];return _0x3e820d;};'use strict';var _=require(_0x7422('0x0'));var moment=require(_0x7422('0x1'));var random=require(_0x7422('0x2'));var fs=require('fs');var path=require(_0x7422('0x3'));var util=require('util');var tnef=require(_0x7422('0x4'));var logger=require(_0x7422('0x5'))(_0x7422('0x6'));var config=require(_0x7422('0x7'));function getAddress(_0x2d9e98){var _0x2b55db=_['head'](_0x2d9e98[_0x7422('0x8')]);return _0x2b55db&&_0x2b55db[_0x7422('0x9')]?_0x2b55db[_0x7422('0x9')]:_0x7422('0xa')+random[_0x7422('0xb')](0x6)+_0x7422('0xc');}function getFirstName(_0xecbd59){var _0x3a9c58=_[_0x7422('0xd')](_0xecbd59[_0x7422('0x8')]);if(_0x3a9c58&&_0x3a9c58[_0x7422('0xe')]){if(_0x3a9c58[_0x7422('0xe')]==_0x3a9c58[_0x7422('0x9')]){return _0x3a9c58[_0x7422('0xe')][_0x7422('0xf')](0x0,_0x3a9c58['name']['indexOf']('@'));}var _0x3ec978=_0x3a9c58[_0x7422('0xe')][_0x7422('0x10')](/\s+/);return _0x3ec978['length']>0x1?_0x3ec978[_0x7422('0x11')](0x0,-0x1)[_0x7422('0x12')]('\x20'):_0x3a9c58[_0x7422('0xe')];}return'Anonymous';}function getLastName(_0x2b0054){var _0x80e668=_[_0x7422('0xd')](_0x2b0054[_0x7422('0x8')]);if(_0x80e668&&_0x80e668[_0x7422('0xe')]){var _0x5a161d=_0x80e668['name']['split'](/\s+/);return _0x5a161d[_0x7422('0x13')]>0x1?_0x5a161d[_0x7422('0x14')]():'';}return'';}function getMails(_0x145641,_0x2ac178){var _0x349c08='';for(var _0x26ce16=0x0;_0x26ce16<_0x2ac178['value'][_0x7422('0x13')];_0x26ce16+=0x1){if(_0x2ac178['value'][_0x26ce16][_0x7422('0x9')]!==_0x145641){if(!_['isEmpty'](_0x349c08)){_0x349c08+=',';}_0x349c08+=_0x2ac178[_0x7422('0x8')][_0x26ce16][_0x7422('0xe')]||_0x2ac178[_0x7422('0x8')][_0x26ce16][_0x7422('0x9')]||'';_0x349c08+='\x20<';_0x349c08+=_0x2ac178['value'][_0x26ce16][_0x7422('0x9')]?_0x2ac178['value'][_0x26ce16][_0x7422('0x9')]:_0x7422('0xa')+random[_0x7422('0xb')](0x6)+_0x7422('0xc');_0x349c08+='>';}}return _0x349c08;}function parseEmail(_0x24848f,_0x2a242d,_0x2d29cc){if(_0x2a242d['html']){var _0x317c0a=/)<[^<]*)*<\/script>/gi;while(_0x317c0a[_0x7422('0x15')](_0x2a242d[_0x7422('0x16')])){_0x2a242d['html']=_0x2a242d['html'][_0x7422('0x17')](_0x317c0a,'');}if(_0x2a242d[_0x7422('0x16')][_0x7422('0x18')](_0x7422('0x19'))){var _0x5ef96f=[];_0x2a242d[_0x7422('0x1a')][_0x7422('0x1b')](_0xd4dfed=>{_0x5ef96f[_0x7422('0x1c')](_0xd4dfed[_0x7422('0x1d')]);});var _0x45734f=/]+>/g;var _0x25bf5d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1bd1ce=_0x2a242d[_0x7422('0x16')][_0x7422('0x17')](_0x25bf5d,'_SRC');var _0x2b4bc5=_0x1bd1ce[_0x7422('0x17')](_0x45734f,_0x7422('0x1e'));for(let _0x16c9b7=0x0;_0x16c9b7<_0x5ef96f[_0x7422('0x13')];_0x16c9b7++){var _0x37d97d=_0x2b4bc5[_0x7422('0x17')]('_IMG',_0x7422('0x1f')+_0x5ef96f[_0x16c9b7]+_0x7422('0x20'));_0x2b4bc5=_0x37d97d;}_0x2a242d[_0x7422('0x16')]=_0x2b4bc5;}_0x2d29cc['body']=_0x2a242d[_0x7422('0x16')];}else{_0x2d29cc['body']=_0x2a242d[_0x7422('0x21')];}if(_0x2d29cc[_0x7422('0x22')]){_0x2d29cc[_0x7422('0x22')]=_0x2d29cc[_0x7422('0x22')][_0x7422('0x17')](/0x0){var _0x2e61ec=[_0x7422('0x2e'),_0x7422('0x2f'),'Precedence:\x20auto_reply'];for(var _0x5ad417=0x0;_0x5ad417<_0x2a242d[_0x7422('0x2d')]['length'];_0x5ad417++){var _0x28bf20=_['indexOf'](_0x2e61ec,_0x2a242d[_0x7422('0x2d')][_0x5ad417]['line']);if(_0x28bf20>=0x0){_0x2d29cc[_0x7422('0x30')]=!![];}}}return _0x2d29cc;}exports['parser']=function(_0x4613db,_0xd750de,_0x5933f5){var _0x33d250={'from':getAddress(_0xd750de['from']),'firstName':getFirstName(_0xd750de[_0x7422('0x31')]),'lastName':getLastName(_0xd750de[_0x7422('0x31')]),'mapKey':_0x7422('0x6'),'message':{'from':getMails(_0x4613db['email'],_0xd750de['from']),'to':_0x4613db['email'],'cc':'','subject':_0xd750de[_0x7422('0x32')]||'','messageId':_0xd750de[_0x7422('0x33')],'inReplyTo':_0xd750de[_0x7422('0x34')],'sentAt':moment(_0xd750de[_0x7422('0x35')])[_0x7422('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0xd750de['html']&&!_0xd750de['textAsHtml']){var _0x445d9d=_[_0x7422('0x37')](_0xd750de['attachments'],{'contentType':_0x7422('0x38')});if(_0x445d9d[_0x7422('0x13')]){logger['info'](util[_0x7422('0x36')](_0x7422('0x39'),_0xd750de[_0x7422('0x33')]));tnef[_0x7422('0x3a')](_['first'](_0x445d9d)[_0x7422('0x3b')],function(_0x29da5d,_0x5326c6){if(_0x5326c6){_0xd750de[_0x7422('0x16')]=_0x5326c6['BodyHTML']||_0x7422('0x3c');if(_0x5326c6['Attachments']){for(var _0x2bff6b=0x0;_0x2bff6b<_0x5326c6['Attachments'][_0x7422('0x13')];_0x2bff6b++){var _0x2ae42a=_0x5326c6[_0x7422('0x3d')][_0x2bff6b];_0x33d250[_0x7422('0x23')][_0x7422('0x1a')][_0x7422('0x1c')]({'filename':_0x2ae42a[_0x7422('0x3e')],'content':Buffer['from'](_0x2ae42a[_0x7422('0x3f')])});}}}_0x5933f5(parseEmail(_0x4613db,_0xd750de,_0x33d250));});}else{_0xd750de[_0x7422('0x16')]=_0x7422('0x3c');_0x5933f5(parseEmail(_0x4613db,_0xd750de,_0x33d250));}}else{_0x5933f5(parseEmail(_0x4613db,_0xd750de,_0x33d250));}};exports[_0x7422('0x40')]=function(_0x59f235,_0xdff949){var _0x3d8e2b=[_0x7422('0x41')+(_0xdff949||''),_0x7422('0x42')+_0x59f235,'',''];return Buffer[_0x7422('0x31')](_0x3d8e2b[_0x7422('0x12')](''),_0x7422('0x43'))[_0x7422('0x44')](_0x7422('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c709909..de3c999 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 _0x3e72=['active','Imap','Smtp','exports','lodash','key','SERV'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0x3e72,0x82));var _0x23e7=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x3e72[_0x817d9b];return _0x2752e1;};'use strict';var _=require(_0x23e7('0x0'));function MailAccount(_0x3b2f93){this['id']=_0x3b2f93['id']||0x0;this['name']=_0x3b2f93['name']||'Service';this[_0x23e7('0x1')]=_0x3b2f93['key']||_0x23e7('0x2');this[_0x23e7('0x3')]=_0x3b2f93[_0x23e7('0x3')]||![];this[_0x23e7('0x4')]=_0x3b2f93[_0x23e7('0x4')]||[];this[_0x23e7('0x5')]=_0x3b2f93['Smtp']||[];}module[_0x23e7('0x6')]=MailAccount; \ No newline at end of file +var _0xa09e=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0xb984a7,_0x564ef9){var _0x247044=function(_0x4142c7){while(--_0x4142c7){_0xb984a7['push'](_0xb984a7['shift']());}};_0x247044(++_0x564ef9);}(_0xa09e,0x92));var _0xea09=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xa09e[_0x32e649];return _0x14d386;};'use strict';var _=require(_0xea09('0x0'));function MailAccount(_0x536380){this['id']=_0x536380['id']||0x0;this[_0xea09('0x1')]=_0x536380[_0xea09('0x1')]||_0xea09('0x2');this[_0xea09('0x3')]=_0x536380[_0xea09('0x3')]||_0xea09('0x4');this[_0xea09('0x5')]=_0x536380[_0xea09('0x5')]||![];this[_0xea09('0x6')]=_0x536380[_0xea09('0x6')]||[];this['Smtp']=_0x536380[_0xea09('0x7')]||[];}module[_0xea09('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 67522d1..fc89001 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 _0x1436=['mailAccounts','mapKeys','prototype','hasOwnProperty','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1436,0x1e2));var _0x6143=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1436[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6143('0x0'));var MailAccount=require(_0x6143('0x1'));var Realtime=function(){this[_0x6143('0x2')]={};};function freeIsNotKey(_0x4a74ff,_0x42fb2c,_0x8f1a10){var _0x219427=_[_0x6143('0x3')](_0x4a74ff,function(_0x72bdb3,_0x3c2d01){return _0x72bdb3[_0x8f1a10];});for(var _0x3910a6 in _0x42fb2c){if(_0x42fb2c['hasOwnProperty'](_0x3910a6)){if(!_0x219427[_0x3910a6]){delete _0x42fb2c[_0x3910a6];}}}}Realtime[_0x6143('0x4')]['mergeFromDatabase']=function(_0x4dbd85,_0x694dd5){for(var _0x807d5 in _0x694dd5){if(_0x4dbd85[_0x6143('0x5')](_0x807d5)){_0x4dbd85[_0x807d5]=_0x694dd5[_0x807d5];}}};Realtime[_0x6143('0x4')][_0x6143('0x6')]=function(){var _0x343ea1=this;return function(_0x1b3fff){if(_0x1b3fff){freeIsNotKey(_0x1b3fff,_0x343ea1['mailAccounts'],'id');for(var _0x29f68a=0x0,_0x4228d3={},_0xfc9357={};_0x29f68a<_0x1b3fff[_0x6143('0x7')];_0x29f68a+=0x1){_0x4228d3=_0x1b3fff[_0x29f68a];if(_[_0x6143('0x8')](_0x343ea1['mailAccounts'][_0x4228d3['id']])){_0x343ea1[_0x6143('0x2')][_0x4228d3['id']]=new MailAccount(_0x4228d3);}else{_[_0x6143('0x9')](_0x343ea1[_0x6143('0x2')][_0x4228d3['id']],_0x4228d3);}}}return _0x343ea1[_0x6143('0x2')];};};module[_0x6143('0xa')]=Realtime; \ No newline at end of file +var _0x25c0=['isUndefined','merge','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','initMailAccounts','length'];(function(_0x22c665,_0x2164d6){var _0x405400=function(_0xac270b){while(--_0xac270b){_0x22c665['push'](_0x22c665['shift']());}};_0x405400(++_0x2164d6);}(_0x25c0,0x1aa));var _0x025c=function(_0x5178bc,_0x5f74e8){_0x5178bc=_0x5178bc-0x0;var _0xca7d8f=_0x25c0[_0x5178bc];return _0xca7d8f;};'use strict';var _=require('lodash');var MailAccount=require(_0x025c('0x0'));var Realtime=function(){this[_0x025c('0x1')]={};};function freeIsNotKey(_0x26977b,_0x544c2f,_0x306d18){var _0x339d03=_['mapKeys'](_0x26977b,function(_0x3d2265,_0x5d806b){return _0x3d2265[_0x306d18];});for(var _0x24e7e2 in _0x544c2f){if(_0x544c2f[_0x025c('0x2')](_0x24e7e2)){if(!_0x339d03[_0x24e7e2]){delete _0x544c2f[_0x24e7e2];}}}}Realtime[_0x025c('0x3')]['mergeFromDatabase']=function(_0x46953b,_0x1404d7){for(var _0x147f6b in _0x1404d7){if(_0x46953b[_0x025c('0x2')](_0x147f6b)){_0x46953b[_0x147f6b]=_0x1404d7[_0x147f6b];}}};Realtime[_0x025c('0x3')][_0x025c('0x4')]=function(){var _0x303db0=this;return function(_0x4ff4df){if(_0x4ff4df){freeIsNotKey(_0x4ff4df,_0x303db0['mailAccounts'],'id');for(var _0x4703b0=0x0,_0x35fc03={},_0x52d85a={};_0x4703b0<_0x4ff4df[_0x025c('0x5')];_0x4703b0+=0x1){_0x35fc03=_0x4ff4df[_0x4703b0];if(_[_0x025c('0x6')](_0x303db0['mailAccounts'][_0x35fc03['id']])){_0x303db0['mailAccounts'][_0x35fc03['id']]=new MailAccount(_0x35fc03);}else{_[_0x025c('0x7')](_0x303db0[_0x025c('0x1')][_0x35fc03['id']],_0x35fc03);}}}return _0x303db0['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index bc31ecc..297f5ea 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 _0x75b6=['Smtp','service','data5','getMailAccount','Request','NotifyMailAccount','../client','GetMailAccount','name','provider','email','active','key','TemplateId','Imap','CloudProvider','type','MailServerOut'];(function(_0x386031,_0x387404){var _0x15b451=function(_0x4fb808){while(--_0x4fb808){_0x386031['push'](_0x386031['shift']());}};_0x15b451(++_0x387404);}(_0x75b6,0x1a4));var _0x675b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x75b6[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x675b('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x675b('0x1'),{'options':{'attributes':['id',_0x675b('0x2'),_0x675b('0x3'),'service',_0x675b('0x4'),_0x675b('0x5'),_0x675b('0x6'),'ListId',_0x675b('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':_0x675b('0x8'),'include':[{'model':_0x675b('0x9'),'attributes':['id',_0x675b('0x2'),'service',_0x675b('0xa'),'data5'],'as':_0x675b('0x9')}]},{'model':_0x675b('0xb'),'as':_0x675b('0xc'),'include':[{'model':_0x675b('0x9'),'attributes':['id',_0x675b('0x2'),_0x675b('0xd'),_0x675b('0xa'),_0x675b('0xe')],'as':_0x675b('0x9')}]}]},'log':_0x675b('0xf')});};};exports['notify']=function(_0x3ce0a2,_0x13e14b){return client[_0x675b('0x10')](_0x675b('0x11'),{'account':{'id':_0x3ce0a2},'body':_0x13e14b,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x4932=['provider','service','email','active','key','ListId','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount'];(function(_0x20a7fe,_0x1b77d1){var _0x56a59e=function(_0x203af0){while(--_0x203af0){_0x20a7fe['push'](_0x20a7fe['shift']());}};_0x56a59e(++_0x1b77d1);}(_0x4932,0x164));var _0x2493=function(_0x11e4a6,_0x190699){_0x11e4a6=_0x11e4a6-0x0;var _0x1a0b81=_0x4932[_0x11e4a6];return _0x1a0b81;};'use strict';var client=require(_0x2493('0x0'));exports[_0x2493('0x1')]=function(){return function(){return client[_0x2493('0x2')](_0x2493('0x3'),{'options':{'attributes':['id','name',_0x2493('0x4'),_0x2493('0x5'),_0x2493('0x6'),_0x2493('0x7'),_0x2493('0x8'),_0x2493('0x9'),_0x2493('0xa')],'raw':![],'include':[{'model':_0x2493('0xb'),'as':'Imap','include':[{'model':_0x2493('0xc'),'attributes':['id','name',_0x2493('0x5'),_0x2493('0xd'),_0x2493('0xe')],'as':_0x2493('0xc')}]},{'model':_0x2493('0xf'),'as':_0x2493('0x10'),'include':[{'model':_0x2493('0xc'),'attributes':['id','name',_0x2493('0x5'),_0x2493('0xd'),_0x2493('0xe')],'as':_0x2493('0xc')}]}]},'log':_0x2493('0x11')});};};exports[_0x2493('0x12')]=function(_0x2358ce,_0x5680a0){return client[_0x2493('0x2')](_0x2493('0x13'),{'account':{'id':_0x2358ce},'body':_0x5680a0,'log':_0x2493('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 66b5341..89b43ad 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 _0xaf1b=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x4cd14a,_0x3c08b4){var _0x59ac6a=function(_0x5d95ec){while(--_0x5d95ec){_0x4cd14a['push'](_0x4cd14a['shift']());}};_0x59ac6a(++_0x3c08b4);}(_0xaf1b,0x1b3));var _0xbaf1=function(_0x1038ea,_0x1409d3){_0x1038ea=_0x1038ea-0x0;var _0x4b7456=_0xaf1b[_0x1038ea];return _0x4b7456;};'use strict';var client=require(_0xbaf1('0x0'));exports[_0xbaf1('0x1')]=function(){return client[_0xbaf1('0x2')](_0xbaf1('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xbaf1('0x4')]},'log':_0xbaf1('0x5')});}; \ No newline at end of file +var _0xefce=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0xefce,0x19e));var _0xeefc=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0xefce[_0x12833b];return _0x3acad3;};'use strict';var client=require(_0xeefc('0x0'));exports[_0xeefc('0x1')]=function(){return client[_0xeefc('0x2')](_0xeefc('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xeefc('0x4')]},'log':_0xeefc('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 7209296..bf67543 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 f691481..ba43664 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 _0x5ddb=['socket.io','websocket','polling','redis','socket.io-redis','../../config/socketio','../../config/express','default','once','listening','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x5ddb,0x1af));var _0xb5dd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5ddb[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xb5dd('0x0'));var http=require('http');var express=require(_0xb5dd('0x1'));var sticky=require(_0xb5dd('0x2'));var Redis=require(_0xb5dd('0x3'));var config=require(_0xb5dd('0x4'));var app=express();var server=http[_0xb5dd('0x5')](app);server[_0xb5dd('0x6')]=0xdbba0;if(sticky[_0xb5dd('0x7')](server,config[_0xb5dd('0x8')])){var socketio=require(_0xb5dd('0x9'))(server,{'transports':[_0xb5dd('0xa'),_0xb5dd('0xb')]});config[_0xb5dd('0xc')]=_['defaults'](config[_0xb5dd('0xc')],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0xb5dd('0xd'))({'pubClient':new Redis(config[_0xb5dd('0xc')]),'subClient':new Redis(config[_0xb5dd('0xc')])}));require('../../config/triggers')['default']();require(_0xb5dd('0xe'))['default'](socketio);require(_0xb5dd('0xf'))['default'](app);require('../../routes')[_0xb5dd('0x10')](app);}else{server[_0xb5dd('0x11')](_0xb5dd('0x12'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0xb5dd('0x13')]=app; \ No newline at end of file +var _0x8ebd=['../../config/triggers','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','express','sticky-session','createServer','timeout','port','websocket','redis','defaults','localhost','adapter'];(function(_0x35601c,_0xdb7bd4){var _0x4d56a2=function(_0x4d464f){while(--_0x4d464f){_0x35601c['push'](_0x35601c['shift']());}};_0x4d56a2(++_0xdb7bd4);}(_0x8ebd,0x139));var _0xd8eb=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x8ebd[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0xd8eb('0x0'));var sticky=require(_0xd8eb('0x1'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0xd8eb('0x2')](app);server[_0xd8eb('0x3')]=0xdbba0;if(sticky['listen'](server,config[_0xd8eb('0x4')])){var socketio=require('socket.io')(server,{'transports':[_0xd8eb('0x5'),'polling']});config[_0xd8eb('0x6')]=_[_0xd8eb('0x7')](config[_0xd8eb('0x6')],{'host':_0xd8eb('0x8'),'port':0x18eb});socketio[_0xd8eb('0x9')](require('socket.io-redis')({'pubClient':new Redis(config[_0xd8eb('0x6')]),'subClient':new Redis(config[_0xd8eb('0x6')])}));require(_0xd8eb('0xa'))[_0xd8eb('0xb')]();require('../../config/socketio')[_0xd8eb('0xb')](socketio);require(_0xd8eb('0xc'))[_0xd8eb('0xb')](app);require(_0xd8eb('0xd'))[_0xd8eb('0xb')](app);}else{server[_0xd8eb('0xe')](_0xd8eb('0xf'),function(){console[_0xd8eb('0x10')](_0xd8eb('0x11'),config[_0xd8eb('0x4')]);});}exports=module[_0xd8eb('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index cfe7a1b..06b6474 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 _0x61c9=['routing','client','http','Request','request','then','debug','rpc','error','message','catch','jayson/promise','bluebird','../../config/logger'];(function(_0xea1bcd,_0x465e08){var _0xfbe4c6=function(_0x4e20f1){while(--_0x4e20f1){_0xea1bcd['push'](_0xea1bcd['shift']());}};_0xfbe4c6(++_0x465e08);}(_0x61c9,0x177));var _0x961c=function(_0x3543e7,_0x501fcf){_0x3543e7=_0x3543e7-0x0;var _0x42df23=_0x61c9[_0x3543e7];return _0x42df23;};'use strict';var jayson=require(_0x961c('0x0'));var BPromise=require(_0x961c('0x1'));var logger=require(_0x961c('0x2'))(_0x961c('0x3'));var client=jayson[_0x961c('0x4')][_0x961c('0x5')]({'port':0x2329});client[_0x961c('0x6')]=function(_0x22717b,_0x454cef){return new BPromise(function(_0x98ad24,_0x4b20be){return client[_0x961c('0x7')](_0x22717b,_0x454cef)[_0x961c('0x8')](function(_0x29cb75){logger[_0x961c('0x9')](_0x961c('0xa'),_0x961c('0x3'),_0x22717b,_0x454cef,_0x29cb75);if(_0x29cb75[_0x961c('0xb')]){logger[_0x961c('0xb')](_0x961c('0xa'),_0x961c('0x3'),_0x22717b,_0x29cb75[_0x961c('0xb')][_0x961c('0xc')],_0x454cef);return _0x4b20be(_0x29cb75['error'][_0x961c('0xc')]);}else{return _0x98ad24(_0x29cb75['result']);}})[_0x961c('0xd')](function(_0x4928ff){logger[_0x961c('0xb')](_0x961c('0xa'),_0x961c('0x3'),_0x22717b,_0x4928ff,_0x454cef);return _0x4b20be(_0x4928ff);});});};module['exports']=client; \ No newline at end of file +var _0xbf83=['http','Request','request','then','error','rpc','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x439dc5,_0x3dbb0a){var _0x48acb8=function(_0x464f2c){while(--_0x464f2c){_0x439dc5['push'](_0x439dc5['shift']());}};_0x48acb8(++_0x3dbb0a);}(_0xbf83,0x1c9));var _0x3bf8=function(_0x5ea9e5,_0x5e0a3a){_0x5ea9e5=_0x5ea9e5-0x0;var _0x41a518=_0xbf83[_0x5ea9e5];return _0x41a518;};'use strict';var jayson=require(_0x3bf8('0x0'));var BPromise=require(_0x3bf8('0x1'));var logger=require(_0x3bf8('0x2'))(_0x3bf8('0x3'));var client=jayson[_0x3bf8('0x4')][_0x3bf8('0x5')]({'port':0x2329});client[_0x3bf8('0x6')]=function(_0x5167fd,_0x2ab321){return new BPromise(function(_0xe80faa,_0x4f3c0c){return client[_0x3bf8('0x7')](_0x5167fd,_0x2ab321)[_0x3bf8('0x8')](function(_0x555227){logger['debug']('rpc','routing',_0x5167fd,_0x2ab321,_0x555227);if(_0x555227[_0x3bf8('0x9')]){logger['error'](_0x3bf8('0xa'),_0x3bf8('0x3'),_0x5167fd,_0x555227[_0x3bf8('0x9')][_0x3bf8('0xb')],_0x2ab321);return _0x4f3c0c(_0x555227[_0x3bf8('0x9')]['message']);}else{return _0xe80faa(_0x555227[_0x3bf8('0xc')]);}})['catch'](function(_0x2538e0){logger['error'](_0x3bf8('0xa'),_0x3bf8('0x3'),_0x5167fd,_0x2538e0,_0x2ab321);return _0x4f3c0c(_0x2538e0);});});};module[_0x3bf8('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 91ac234..f82cd41 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 _0xcfe8=['./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval'];(function(_0x135ea8,_0x402fba){var _0x11ced5=function(_0x450c86){while(--_0x450c86){_0x135ea8['push'](_0x135ea8['shift']());}};_0x11ced5(++_0x402fba);}(_0xcfe8,0x1f0));var _0x8cfe=function(_0xe3b599,_0x2cdc1b){_0xe3b599=_0xe3b599-0x0;var _0x447be3=_0xcfe8[_0xe3b599];return _0x447be3;};'use strict';var BPromise=require(_0x8cfe('0x0'));var server=require(_0x8cfe('0x1'));var Realtime=require('./realtime');var user=require(_0x8cfe('0x2'));var interval=require(_0x8cfe('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x8cfe('0x4'));var smsQueue=require(_0x8cfe('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x8cfe('0x6'));var whatsappQueue=require(_0x8cfe('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x8cfe('0x8')](user[_0x8cfe('0x9')]())[_0x8cfe('0x8')](realtime['initAgents']())[_0x8cfe('0x8')](interval[_0x8cfe('0xa')]())[_0x8cfe('0x8')](realtime[_0x8cfe('0xb')]())['then'](openchannelQueue[_0x8cfe('0xc')]())[_0x8cfe('0x8')](realtime[_0x8cfe('0xd')]())['then'](chatQueue[_0x8cfe('0xe')]())[_0x8cfe('0x8')](realtime[_0x8cfe('0xf')]())[_0x8cfe('0x8')](smsQueue[_0x8cfe('0x10')]())[_0x8cfe('0x8')](realtime[_0x8cfe('0x11')]())[_0x8cfe('0x8')](mailQueue[_0x8cfe('0x12')]())['then'](realtime['initMailQueues']())[_0x8cfe('0x8')](faxQueue['getFaxQueues']())[_0x8cfe('0x8')](realtime[_0x8cfe('0x13')]())[_0x8cfe('0x8')](whatsappQueue[_0x8cfe('0x14')]())[_0x8cfe('0x8')](realtime[_0x8cfe('0x15')]())[_0x8cfe('0x8')](function(){return realtime;});}function main(){return server[_0x8cfe('0x16')](realtime)[_0x8cfe('0x8')](function(_0x33fed3){return initRealtime();})[_0x8cfe('0x8')](function(_0x4d1a3d){return setInterval(initRealtime,0x1388);})[_0x8cfe('0x17')](function(_0x2a8cab){console[_0x8cfe('0x18')](_0x2a8cab);});}main(); \ No newline at end of file +var _0x8ba1=['getAgents','getIntervals','getChatQueues','initChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','listen','catch','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0xf2e1a3,_0x2fc294){var _0x1202f2=function(_0x3c2d0c){while(--_0x3c2d0c){_0xf2e1a3['push'](_0xf2e1a3['shift']());}};_0x1202f2(++_0x2fc294);}(_0x8ba1,0xbe));var _0x18ba=function(_0x5b0a0f,_0x56296d){_0x5b0a0f=_0x5b0a0f-0x0;var _0x2d0ecc=_0x8ba1[_0x5b0a0f];return _0x2d0ecc;};'use strict';var BPromise=require('bluebird');var server=require(_0x18ba('0x0'));var Realtime=require('./realtime');var user=require(_0x18ba('0x1'));var interval=require(_0x18ba('0x2'));var openchannelQueue=require(_0x18ba('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x18ba('0x4'));var mailQueue=require(_0x18ba('0x5'));var faxQueue=require(_0x18ba('0x6'));var whatsappQueue=require(_0x18ba('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x18ba('0x8')]()[_0x18ba('0x9')](user[_0x18ba('0xa')]())[_0x18ba('0x9')](realtime['initAgents']())[_0x18ba('0x9')](interval[_0x18ba('0xb')]())[_0x18ba('0x9')](realtime['initIntervals']())[_0x18ba('0x9')](openchannelQueue['getOpenchannelQueues']())[_0x18ba('0x9')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x18ba('0xc')]())[_0x18ba('0x9')](realtime[_0x18ba('0xd')]())['then'](smsQueue['getSmsQueues']())[_0x18ba('0x9')](realtime['initSmsQueues']())[_0x18ba('0x9')](mailQueue[_0x18ba('0xe')]())[_0x18ba('0x9')](realtime[_0x18ba('0xf')]())[_0x18ba('0x9')](faxQueue[_0x18ba('0x10')]())[_0x18ba('0x9')](realtime[_0x18ba('0x11')]())[_0x18ba('0x9')](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())[_0x18ba('0x9')](function(){return realtime;});}function main(){return server[_0x18ba('0x12')](realtime)[_0x18ba('0x9')](function(_0x3eda81){return initRealtime();})['then'](function(_0x3b8844){return setInterval(initRealtime,0x1388);})[_0x18ba('0x13')](function(_0x5f45c0){console['log'](_0x5f45c0);});}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 165686a..f7884ab 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x21b74b,_0x543c76){var _0x518cc6=function(_0x5b3010){while(--_0x5b3010){_0x21b74b['push'](_0x21b74b['shift']());}};_0x518cc6(++_0x543c76);}(_0x814b,0x1a2));var _0xb814=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x814b[_0x64aff8];return _0x5488a3;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x41cbab,_0x25ca4b){var _0x1c4b0e=function(_0x41505d){while(--_0x41505d){_0x41cbab['push'](_0x41cbab['shift']());}};_0x1c4b0e(++_0x25ca4b);}(_0x814b,0x1a2));var _0xb814=function(_0x26cd05,_0x1f7d74){_0x26cd05=_0x26cd05-0x0;var _0x3e13b9=_0x814b[_0x26cd05];return _0x3e13b9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 20d7103..288215d 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 _0xb448=['then','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xb448,0xde));var _0x8b44=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xb448[_0x4ae6ef];return _0x3cbb4e;};'use strict';var BPromise=require(_0x8b44('0x0'));var jayson=require(_0x8b44('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x555b43,_0x2a318e){return new BPromise(function(_0x4954be,_0x5a5785){return client['request'](_0x555b43,_0x2a318e)[_0x8b44('0x2')](function(_0x1e7dc9){if(_0x1e7dc9['error']){return _0x5a5785(_0x1e7dc9['error'][_0x8b44('0x3')]);}else{return _0x4954be(_0x1e7dc9['result']);}})[_0x8b44('0x4')](function(_0x4cf30a){return _0x5a5785(_0x4cf30a);});});}exports[_0x8b44('0x5')]=function(_0x61578a,_0x8cef9c){return request(_0x8b44('0x6'),{'account':_0x61578a,'message':_0x8cef9c});}; \ No newline at end of file +var _0x113d=['catch','sendMailMessage','bluebird','jayson/promise','client','http','then','error','message','result'];(function(_0x16c3f5,_0x28a42c){var _0x43cbac=function(_0x1d985a){while(--_0x1d985a){_0x16c3f5['push'](_0x16c3f5['shift']());}};_0x43cbac(++_0x28a42c);}(_0x113d,0x110));var _0xd113=function(_0x424337,_0x266fba){_0x424337=_0x424337-0x0;var _0x37b139=_0x113d[_0x424337];return _0x37b139;};'use strict';var BPromise=require(_0xd113('0x0'));var jayson=require(_0xd113('0x1'));var client=jayson[_0xd113('0x2')][_0xd113('0x3')]({'port':0x232b});function request(_0x1590bb,_0x10cd40){return new BPromise(function(_0xe1bc07,_0x1b1bb2){return client['request'](_0x1590bb,_0x10cd40)[_0xd113('0x4')](function(_0x23cf7e){if(_0x23cf7e['error']){return _0x1b1bb2(_0x23cf7e[_0xd113('0x5')][_0xd113('0x6')]);}else{return _0xe1bc07(_0x23cf7e[_0xd113('0x7')]);}})[_0xd113('0x8')](function(_0x21dad6){return _0x1b1bb2(_0x21dad6);});});}exports[_0xd113('0x9')]=function(_0x3418de,_0x5b9763){return request('SendMail',{'account':_0x3418de,'message':_0x5b9763});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 92d799a..d3f1335 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 _0x3a6d=['faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','CurrentCapacity','Capacity','maxcapacity','idle','prototype','updateRealtime','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','chatCapacity','chatCurrentCapacity','faxCurrentCapacity','smsCurrentCapacity','whatsappStatus','openchannelStatusTime','mailWaitingInteractions','stringify','omit','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause'];(function(_0x16d014,_0x4a5042){var _0x6e8ea1=function(_0x49d37a){while(--_0x49d37a){_0x16d014['push'](_0x16d014['shift']());}};_0x6e8ea1(++_0x4a5042);}(_0x3a6d,0x143));var _0xd3a6=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x3a6d[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xd3a6('0x0'));var md5=require(_0xd3a6('0x1'));var moment=require('moment');var Redis=require(_0xd3a6('0x2'));var config=require(_0xd3a6('0x3'));config[_0xd3a6('0x4')]=_[_0xd3a6('0x5')](config[_0xd3a6('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xd3a6('0x6'))(new Redis(config[_0xd3a6('0x4')]));function Agent(_0x1e44bd){this['id']=_0x1e44bd['id']||0x0;this[_0xd3a6('0x7')]=_0x1e44bd[_0xd3a6('0x7')]||'';this[_0xd3a6('0x8')]=_0x1e44bd['online']||!![];this[_0xd3a6('0x9')]=_0x1e44bd[_0xd3a6('0x9')]||![];this[_0xd3a6('0xa')]=_0x1e44bd[_0xd3a6('0xa')]||![];this[_0xd3a6('0xb')]=_0x1e44bd[_0xd3a6('0xb')]||![];this[_0xd3a6('0xc')]=_0x1e44bd[_0xd3a6('0xc')]||![];this[_0xd3a6('0xd')]=_0x1e44bd['smsPause']||![];this[_0xd3a6('0xe')]=_0x1e44bd[_0xd3a6('0xe')]||![];this[_0xd3a6('0xf')]=_0xd3a6('0x10');this[_0xd3a6('0x11')]=0x0;this['chatCapacity']=_0x1e44bd['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0xd3a6('0x12')]=_0xd3a6('0x10');this[_0xd3a6('0x13')]=0x0;this[_0xd3a6('0x14')]=_0x1e44bd[_0xd3a6('0x14')]||0x0;this[_0xd3a6('0x15')]=0x0;this[_0xd3a6('0x16')]='unknown';this[_0xd3a6('0x17')]=0x0;this[_0xd3a6('0x18')]=_0x1e44bd[_0xd3a6('0x18')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xd3a6('0x19')]=_0xd3a6('0x10');this[_0xd3a6('0x1a')]=0x0;this['smsCapacity']=_0x1e44bd[_0xd3a6('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0xd3a6('0x10');this[_0xd3a6('0x1c')]=0x0;this[_0xd3a6('0x1d')]=_0x1e44bd[_0xd3a6('0x1d')]||0x0;this[_0xd3a6('0x1e')]=0x0;this[_0xd3a6('0x1f')]=_0xd3a6('0x10');this['openchannelStatusTime']=0x0;this[_0xd3a6('0x20')]=_0x1e44bd['openchannelCapacity']||0x0;this[_0xd3a6('0x21')]=0x0;this[_0xd3a6('0x22')]=![];this[_0xd3a6('0x23')]=undefined;this[_0xd3a6('0x1')]='';this[_0xd3a6('0x24')]={};this[_0xd3a6('0x25')]={};this['mailWaitingInteractions']={};this[_0xd3a6('0x26')]={};this[_0xd3a6('0x27')]={};this['whatsappWaitingInteractions']={};this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0x5c9075){if(this[_0x5c9075+_0xd3a6('0x28')]>0x0){if(this[_0x5c9075+_0xd3a6('0x29')]>0x0&&this[_0x5c9075+_0xd3a6('0x28')]>=this[_0x5c9075+'Capacity']){return _0xd3a6('0x2a');}else{return'working';}}else{return _0xd3a6('0x2b');}};Agent[_0xd3a6('0x2c')][_0xd3a6('0x2d')]=function(){var _0x4f6130=[_0xd3a6('0x2e'),_0xd3a6('0x2f'),_0xd3a6('0x30'),_0xd3a6('0x31'),_0xd3a6('0x32'),_0xd3a6('0x33')];for(var _0x5650d1=0x0;_0x5650d1<_0x4f6130[_0xd3a6('0x34')];_0x5650d1+=0x1){var _0x2b5448=this[_0xd3a6('0x35')](_0x4f6130[_0x5650d1]);if(this[_0x4f6130[_0x5650d1]+_0xd3a6('0x36')]!==_0x2b5448){this[_0x4f6130[_0x5650d1]+_0xd3a6('0x37')]=_[_0xd3a6('0x38')](moment()['format']('x'));}this[_0x4f6130[_0x5650d1]+'Status']=_0x2b5448;}var _0x1f4859={'id':this['id'],'name':this[_0xd3a6('0x7')],'online':this[_0xd3a6('0x8')],'voicePause':this[_0xd3a6('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0xd3a6('0xb')],'smsPause':this[_0xd3a6('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0xd3a6('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xd3a6('0x11')],'chatCapacity':this[_0xd3a6('0x39')],'chatCurrentCapacity':this[_0xd3a6('0x3a')],'mailStatus':this[_0xd3a6('0x12')],'mailStatusTime':this[_0xd3a6('0x13')],'mailCapacity':this[_0xd3a6('0x14')],'mailCurrentCapacity':this[_0xd3a6('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xd3a6('0x18')],'faxCurrentCapacity':this[_0xd3a6('0x3b')],'smsStatus':this[_0xd3a6('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xd3a6('0x1b')],'smsCurrentCapacity':this[_0xd3a6('0x3c')],'whatsappStatus':this[_0xd3a6('0x3d')],'whatsappStatusTime':this[_0xd3a6('0x1c')],'whatsappCapacity':this[_0xd3a6('0x1d')],'whatsappCurrentCapacity':this[_0xd3a6('0x1e')],'openchannelStatus':this[_0xd3a6('0x1f')],'openchannelStatusTime':this[_0xd3a6('0x3e')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xd3a6('0x21')],'busy':this[_0xd3a6('0x22')],'busyQueue':this[_0xd3a6('0x23')],'chatWaitingInteractions':this[_0xd3a6('0x24')],'faxWaitingInteractions':this[_0xd3a6('0x25')],'mailWaitingInteractions':this[_0xd3a6('0x3f')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0xd3a6('0x27')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x263615=md5(JSON[_0xd3a6('0x40')](_0x1f4859));if(this[_0xd3a6('0x1')]!==_0x263615){this[_0xd3a6('0x1')]=_0x263615;io['emit']('user:routing:update',_[_0xd3a6('0x41')](_0x1f4859,[_0xd3a6('0x8')]));}};module[_0xd3a6('0x42')]=Agent; \ No newline at end of file +var _0x6d38=['chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','idle','openchannel','fax','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','voicePause','faxStatus','mailWaitingInteractions','smsWaitingInteractions','stringify','emit','omit','md5','moment','ioredis','defaults','localhost','socket.io-emitter','redis','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity'];(function(_0x2d0db7,_0x369a9e){var _0x2a0c09=function(_0x3e1125){while(--_0x3e1125){_0x2d0db7['push'](_0x2d0db7['shift']());}};_0x2a0c09(++_0x369a9e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6d38[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var md5=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var Redis=require(_0x86d3('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x86d3('0x3')](config['redis'],{'host':_0x86d3('0x4'),'port':0x18eb});var io=require(_0x86d3('0x5'))(new Redis(config[_0x86d3('0x6')]));function Agent(_0x4ef557){this['id']=_0x4ef557['id']||0x0;this[_0x86d3('0x7')]=_0x4ef557[_0x86d3('0x7')]||'';this[_0x86d3('0x8')]=_0x4ef557[_0x86d3('0x8')]||!![];this['voicePause']=_0x4ef557['voicePause']||![];this[_0x86d3('0x9')]=_0x4ef557[_0x86d3('0x9')]||![];this[_0x86d3('0xa')]=_0x4ef557['mailPause']||![];this['faxPause']=_0x4ef557[_0x86d3('0xb')]||![];this[_0x86d3('0xc')]=_0x4ef557['smsPause']||![];this['openchannelPause']=_0x4ef557[_0x86d3('0xd')]||![];this[_0x86d3('0xe')]='unknown';this[_0x86d3('0xf')]=0x0;this['chatCapacity']=_0x4ef557[_0x86d3('0x10')]||0x0;this[_0x86d3('0x11')]=0x0;this[_0x86d3('0x12')]=_0x86d3('0x13');this[_0x86d3('0x14')]=0x0;this[_0x86d3('0x15')]=_0x4ef557[_0x86d3('0x15')]||0x0;this[_0x86d3('0x16')]=0x0;this['faxStatus']=_0x86d3('0x13');this[_0x86d3('0x17')]=0x0;this[_0x86d3('0x18')]=_0x4ef557[_0x86d3('0x18')]||0x0;this[_0x86d3('0x19')]=0x0;this[_0x86d3('0x1a')]=_0x86d3('0x13');this[_0x86d3('0x1b')]=0x0;this['smsCapacity']=_0x4ef557[_0x86d3('0x1c')]||0x0;this[_0x86d3('0x1d')]=0x0;this[_0x86d3('0x1e')]=_0x86d3('0x13');this[_0x86d3('0x1f')]=0x0;this[_0x86d3('0x20')]=_0x4ef557[_0x86d3('0x20')]||0x0;this[_0x86d3('0x21')]=0x0;this[_0x86d3('0x22')]='unknown';this[_0x86d3('0x23')]=0x0;this['openchannelCapacity']=_0x4ef557[_0x86d3('0x24')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x86d3('0x25')]=undefined;this[_0x86d3('0x0')]='';this[_0x86d3('0x26')]={};this[_0x86d3('0x27')]={};this['mailWaitingInteractions']={};this[_0x86d3('0x28')]={};this['smsWaitingInteractions']={};this[_0x86d3('0x29')]={};this[_0x86d3('0x2a')]();}Agent[_0x86d3('0x2b')]['getChannelStatus']=function(_0x39d819){if(this[_0x39d819+_0x86d3('0x2c')]>0x0){if(this[_0x39d819+_0x86d3('0x2d')]>0x0&&this[_0x39d819+'CurrentCapacity']>=this[_0x39d819+'Capacity']){return _0x86d3('0x2e');}else{return'working';}}else{return _0x86d3('0x2f');}};Agent[_0x86d3('0x2b')][_0x86d3('0x2a')]=function(){var _0x3c5fe4=['mail','chat',_0x86d3('0x30'),_0x86d3('0x31'),'sms',_0x86d3('0x32')];for(var _0x5b126e=0x0;_0x5b126e<_0x3c5fe4[_0x86d3('0x33')];_0x5b126e+=0x1){var _0x41e2f0=this[_0x86d3('0x34')](_0x3c5fe4[_0x5b126e]);if(this[_0x3c5fe4[_0x5b126e]+_0x86d3('0x35')]!==_0x41e2f0){this[_0x3c5fe4[_0x5b126e]+_0x86d3('0x36')]=_[_0x86d3('0x37')](moment()[_0x86d3('0x38')]('x'));}this[_0x3c5fe4[_0x5b126e]+_0x86d3('0x35')]=_0x41e2f0;}var _0x303f13={'id':this['id'],'name':this[_0x86d3('0x7')],'online':this[_0x86d3('0x8')],'voicePause':this[_0x86d3('0x39')],'chatPause':this[_0x86d3('0x9')],'mailPause':this[_0x86d3('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0x86d3('0xb')],'openchannelPause':this[_0x86d3('0xd')],'chatStatus':this[_0x86d3('0xe')],'chatStatusTime':this[_0x86d3('0xf')],'chatCapacity':this[_0x86d3('0x10')],'chatCurrentCapacity':this[_0x86d3('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x86d3('0x14')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x86d3('0x3a')],'faxStatusTime':this[_0x86d3('0x17')],'faxCapacity':this[_0x86d3('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x86d3('0x1a')],'smsStatusTime':this[_0x86d3('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x86d3('0x1d')],'whatsappStatus':this[_0x86d3('0x1e')],'whatsappStatusTime':this[_0x86d3('0x1f')],'whatsappCapacity':this[_0x86d3('0x20')],'whatsappCurrentCapacity':this[_0x86d3('0x21')],'openchannelStatus':this[_0x86d3('0x22')],'openchannelStatusTime':this[_0x86d3('0x23')],'openchannelCapacity':this[_0x86d3('0x24')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x86d3('0x26')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x86d3('0x3b')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x86d3('0x3c')],'whatsappWaitingInteractions':this[_0x86d3('0x29')]};var _0x452d49=md5(JSON[_0x86d3('0x3d')](_0x303f13));if(this[_0x86d3('0x0')]!==_0x452d49){this[_0x86d3('0x0')]=_0x452d49;io[_0x86d3('0x3e')]('user:routing:update',_[_0x86d3('0x3f')](_0x303f13,[_0x86d3('0x8')]));}};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 af05526..773da89 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 _0xb883=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','online','loggedIn','chatPause','paused','available','name','stringify','format','emit','chat_queue:save','exports','lodash','md5','util','redis','defaults','localhost'];(function(_0x14db9e,_0x3a48c9){var _0x32dd2f=function(_0x7eabde){while(--_0x7eabde){_0x14db9e['push'](_0x14db9e['shift']());}};_0x32dd2f(++_0x3a48c9);}(_0xb883,0x159));var _0x3b88=function(_0x1b9497,_0x5300ef){_0x1b9497=_0x1b9497-0x0;var _0xc684f5=_0xb883[_0x1b9497];return _0xc684f5;};'use strict';var _=require(_0x3b88('0x0'));var md5=require(_0x3b88('0x1'));var util=require(_0x3b88('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3b88('0x3')]=_[_0x3b88('0x4')](config[_0x3b88('0x3')],{'host':_0x3b88('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b88('0x3')]));function ChatQueue(_0xef1365){this['id']=_0xef1365['id']||0x0;this['name']=_0xef1365['name']||'';this[_0x3b88('0x6')]=_0xef1365['timeout']||0xa;this['strategy']=_0xef1365[_0x3b88('0x7')]||_0x3b88('0x8');this[_0x3b88('0x9')]=_0xef1365[_0x3b88('0x9')];this['mapAgentsId']={};this[_0x3b88('0xa')]=0x0;this[_0x3b88('0x1')]='';this[_0x3b88('0xb')]();this[_0x3b88('0xc')]();}ChatQueue[_0x3b88('0xd')]['updateRouting']=function(){var _0x58be3d=this[_0x3b88('0xe')][_0x3b88('0xf')];this[_0x3b88('0xe')]=_['map'](this[_0x3b88('0x9')],'id');this[_0x3b88('0xe')][_0x3b88('0xf')]=_0x58be3d;};ChatQueue[_0x3b88('0xd')][_0x3b88('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4c6008=0x0;_0x4c6008=0x0?this[_0x3b88('0x14')]:0x0;var _0x3e7fec={'id':this['id'],'available':this[_0x3b88('0x14')],'loggedIn':this[_0x3b88('0x11')],'name':this[_0x3b88('0x15')],'paused':this[_0x3b88('0x13')],'waiting':this[_0x3b88('0xa')]};var _0x348583=md5(JSON[_0x3b88('0x16')](_0x3e7fec));if(this[_0x3b88('0x1')]!==_0x348583){this[_0x3b88('0x1')]=_0x348583;io['to'](util[_0x3b88('0x17')]('chat:queue:%s',_0x3e7fec[_0x3b88('0x15')]))[_0x3b88('0x18')](_0x3b88('0x19'),_0x3e7fec);}};module[_0x3b88('0x1a')]=ChatQueue; \ No newline at end of file +var _0x6b6e=['_rr','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x4b35d4,_0x5422d5){var _0x18d8f4=function(_0x550ce9){while(--_0x550ce9){_0x4b35d4['push'](_0x4b35d4['shift']());}};_0x18d8f4(++_0x5422d5);}(_0x6b6e,0x193));var _0xe6b6=function(_0x5d3ab2,_0x44f098){_0x5d3ab2=_0x5d3ab2-0x0;var _0x599864=_0x6b6e[_0x5d3ab2];return _0x599864;};'use strict';var _=require(_0xe6b6('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xe6b6('0x1'));var config=require(_0xe6b6('0x2'));config[_0xe6b6('0x3')]=_[_0xe6b6('0x4')](config[_0xe6b6('0x3')],{'host':_0xe6b6('0x5'),'port':0x18eb});var io=require(_0xe6b6('0x6'))(new Redis(config[_0xe6b6('0x3')]));function ChatQueue(_0x28c191){this['id']=_0x28c191['id']||0x0;this[_0xe6b6('0x7')]=_0x28c191['name']||'';this['timeout']=_0x28c191['timeout']||0xa;this['strategy']=_0x28c191[_0xe6b6('0x8')]||_0xe6b6('0x9');this[_0xe6b6('0xa')]=_0x28c191['Agents'];this[_0xe6b6('0xb')]={};this[_0xe6b6('0xc')]=0x0;this[_0xe6b6('0xd')]='';this[_0xe6b6('0xe')]();this[_0xe6b6('0xf')]();}ChatQueue[_0xe6b6('0x10')][_0xe6b6('0xe')]=function(){var _0x4e7a39=this[_0xe6b6('0xb')][_0xe6b6('0x11')];this[_0xe6b6('0xb')]=_['map'](this[_0xe6b6('0xa')],'id');this[_0xe6b6('0xb')][_0xe6b6('0x11')]=_0x4e7a39;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xe6b6('0x12')]=0x0;this['paused']=0x0;for(var _0x3c37fb=0x0;_0x3c37fb=0x0?this[_0xe6b6('0x17')]:0x0;var _0x1bafb1={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe6b6('0x12')],'name':this['name'],'paused':this[_0xe6b6('0x16')],'waiting':this['waiting']};var _0x3e4fe0=md5(JSON[_0xe6b6('0x18')](_0x1bafb1));if(this[_0xe6b6('0xd')]!==_0x3e4fe0){this[_0xe6b6('0xd')]=_0x3e4fe0;io['to'](util[_0xe6b6('0x19')](_0xe6b6('0x1a'),_0x1bafb1[_0xe6b6('0x7')]))['emit']('chat_queue:save',_0x1bafb1);}};module[_0xe6b6('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 45d009e..c9659ec 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 _0xb9e8=['updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','online','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xb9e8,0x130));var _0x8b9e=function(_0x20b9fc,_0x5dab92){_0x20b9fc=_0x20b9fc-0x0;var _0x511a2b=_0xb9e8[_0x20b9fc];return _0x511a2b;};'use strict';var _=require(_0x8b9e('0x0'));var md5=require(_0x8b9e('0x1'));var util=require(_0x8b9e('0x2'));var Redis=require(_0x8b9e('0x3'));var config=require(_0x8b9e('0x4'));config['redis']=_[_0x8b9e('0x5')](config[_0x8b9e('0x6')],{'host':_0x8b9e('0x7'),'port':0x18eb});var io=require(_0x8b9e('0x8'))(new Redis(config['redis']));function FaxQueue(_0x10cec){this['id']=_0x10cec['id']||0x0;this[_0x8b9e('0x9')]=_0x10cec[_0x8b9e('0x9')]||'';this[_0x8b9e('0xa')]=_0x10cec[_0x8b9e('0xa')]||0xa;this[_0x8b9e('0xb')]=_0x10cec[_0x8b9e('0xb')]||'beepall';this[_0x8b9e('0xc')]=_0x10cec['Agents'];this[_0x8b9e('0xd')]={};this[_0x8b9e('0xe')]=0x0;this[_0x8b9e('0x1')]='';this['updateRouting']();this[_0x8b9e('0xf')]();}FaxQueue['prototype'][_0x8b9e('0x10')]=function(){var _0x236182=this['mapAgentsId'][_0x8b9e('0x11')];this[_0x8b9e('0xd')]=_['map'](this[_0x8b9e('0xc')],'id');this[_0x8b9e('0xd')][_0x8b9e('0x11')]=_0x236182;};FaxQueue[_0x8b9e('0x12')][_0x8b9e('0xf')]=function(){this[_0x8b9e('0x13')]=0x0;this[_0x8b9e('0x14')]=0x0;for(var _0x3d9b67=0x0;_0x3d9b67=0x0?this[_0x8b9e('0x17')]:0x0;var _0xce0580={'id':this['id'],'available':this[_0x8b9e('0x17')],'loggedIn':this[_0x8b9e('0x13')],'name':this['name'],'paused':this[_0x8b9e('0x14')],'waiting':this['waiting']};var _0x289af2=md5(JSON[_0x8b9e('0x18')](_0xce0580));if(this['md5']!==_0x289af2){this[_0x8b9e('0x1')]=_0x289af2;io['to'](util[_0x8b9e('0x19')](_0x8b9e('0x1a'),_0xce0580[_0x8b9e('0x9')]))['emit'](_0x8b9e('0x1b'),_0xce0580);}};module[_0x8b9e('0x1c')]=FaxQueue; \ No newline at end of file +var _0xd6ae=['available','waiting','stringify','format','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','length','online','paused'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd6ae,0x158));var _0xed6a=function(_0xc8e87b,_0x52711){_0xc8e87b=_0xc8e87b-0x0;var _0x3502a9=_0xd6ae[_0xc8e87b];return _0x3502a9;};'use strict';var _=require(_0xed6a('0x0'));var md5=require(_0xed6a('0x1'));var util=require(_0xed6a('0x2'));var Redis=require(_0xed6a('0x3'));var config=require(_0xed6a('0x4'));config['redis']=_['defaults'](config[_0xed6a('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xed6a('0x5')]));function FaxQueue(_0x17a7fa){this['id']=_0x17a7fa['id']||0x0;this[_0xed6a('0x6')]=_0x17a7fa[_0xed6a('0x6')]||'';this[_0xed6a('0x7')]=_0x17a7fa[_0xed6a('0x7')]||0xa;this['strategy']=_0x17a7fa['strategy']||_0xed6a('0x8');this['Agents']=_0x17a7fa[_0xed6a('0x9')];this[_0xed6a('0xa')]={};this['waiting']=0x0;this[_0xed6a('0x1')]='';this[_0xed6a('0xb')]();this[_0xed6a('0xc')]();}FaxQueue[_0xed6a('0xd')]['updateRouting']=function(){var _0x44456c=this[_0xed6a('0xa')]['_rr'];this[_0xed6a('0xa')]=_[_0xed6a('0xe')](this[_0xed6a('0x9')],'id');this[_0xed6a('0xa')][_0xed6a('0xf')]=_0x44456c;};FaxQueue['prototype'][_0xed6a('0xc')]=function(){this[_0xed6a('0x10')]=0x0;this['paused']=0x0;for(var _0xdeddd3=0x0;_0xdeddd3=0x0?this[_0xed6a('0x14')]:0x0;var _0x5ac61e={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xed6a('0x15')]};var _0x3dab65=md5(JSON[_0xed6a('0x16')](_0x5ac61e));if(this[_0xed6a('0x1')]!==_0x3dab65){this[_0xed6a('0x1')]=_0x3dab65;io['to'](util[_0xed6a('0x17')]('fax:queue:%s',_0x5ac61e[_0xed6a('0x6')]))['emit'](_0xed6a('0x18'),_0x5ac61e);}};module[_0xed6a('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7928369..8d3ec73 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 _0x3992=['exports','name','Intervals'];(function(_0xa1fa,_0xad4d14){var _0x3b6173=function(_0x13c0b1){while(--_0x13c0b1){_0xa1fa['push'](_0xa1fa['shift']());}};_0x3b6173(++_0xad4d14);}(_0x3992,0x15d));var _0x2399=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3992[_0x4cf98e];return _0x1623ac;};'use strict';function Interval(_0x430789){this['id']=_0x430789['id']||0x0;this[_0x2399('0x0')]=_0x430789[_0x2399('0x0')]||'';this['Intervals']=_0x430789[_0x2399('0x1')]||{};}module[_0x2399('0x2')]=Interval; \ No newline at end of file +var _0xe923=['Intervals','exports','name'];(function(_0x2549a7,_0x4bb1ec){var _0x35f470=function(_0x19ecac){while(--_0x19ecac){_0x2549a7['push'](_0x2549a7['shift']());}};_0x35f470(++_0x4bb1ec);}(_0xe923,0xc8));var _0x3e92=function(_0x27ed41,_0xb780a1){_0x27ed41=_0x27ed41-0x0;var _0x507934=_0xe923[_0x27ed41];return _0x507934;};'use strict';function Interval(_0x1d68b5){this['id']=_0x1d68b5['id']||0x0;this[_0x3e92('0x0')]=_0x1d68b5['name']||'';this[_0x3e92('0x1')]=_0x1d68b5[_0x3e92('0x1')]||{};}module[_0x3e92('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 4abf7b4..f68baea 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 _0xc488=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','online','mailPause','available','format','emit','mail_queue:save','md5','util','ioredis'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xc488,0x14f));var _0x8c48=function(_0x11ca17,_0x53671f){_0x11ca17=_0x11ca17-0x0;var _0x5899d8=_0xc488[_0x11ca17];return _0x5899d8;};'use strict';var _=require('lodash');var md5=require(_0x8c48('0x0'));var util=require(_0x8c48('0x1'));var Redis=require(_0x8c48('0x2'));var config=require('../../../config/environment');config[_0x8c48('0x3')]=_[_0x8c48('0x4')](config[_0x8c48('0x3')],{'host':_0x8c48('0x5'),'port':0x18eb});var io=require(_0x8c48('0x6'))(new Redis(config['redis']));function MailQueue(_0x2f6b09){this['id']=_0x2f6b09['id']||0x0;this[_0x8c48('0x7')]=_0x2f6b09[_0x8c48('0x7')]||'';this['timeout']=_0x2f6b09[_0x8c48('0x8')]||0xa;this[_0x8c48('0x9')]=_0x2f6b09[_0x8c48('0x9')]||'beepall';this[_0x8c48('0xa')]=_0x2f6b09['Agents'];this['mapAgentsId']={};this[_0x8c48('0xb')]=0x0;this[_0x8c48('0x0')]='';this[_0x8c48('0xc')]();this[_0x8c48('0xd')]();}MailQueue[_0x8c48('0xe')][_0x8c48('0xc')]=function(){var _0x5eaf22=this[_0x8c48('0xf')][_0x8c48('0x10')];this['mapAgentsId']=_[_0x8c48('0x11')](this[_0x8c48('0xa')],'id');this[_0x8c48('0xf')][_0x8c48('0x10')]=_0x5eaf22;};MailQueue[_0x8c48('0xe')][_0x8c48('0xd')]=function(){this[_0x8c48('0x12')]=0x0;this[_0x8c48('0x13')]=0x0;for(var _0x49685f=0x0;_0x49685f=0x0?this['available']:0x0;var _0x1a0bec={'id':this['id'],'available':this[_0x8c48('0x16')],'loggedIn':this[_0x8c48('0x12')],'name':this['name'],'paused':this[_0x8c48('0x13')],'waiting':this[_0x8c48('0xb')]};var _0x55b8a9=md5(JSON['stringify'](_0x1a0bec));if(this['md5']!==_0x55b8a9){this[_0x8c48('0x0')]=_0x55b8a9;io['to'](util[_0x8c48('0x17')]('mail:queue:%s',_0x1a0bec[_0x8c48('0x7')]))[_0x8c48('0x18')](_0x8c48('0x19'),_0x1a0bec);}};module['exports']=MailQueue; \ No newline at end of file +var _0x8129=['prototype','map','_rr','loggedIn','length','online','mailPause','available','paused','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x8129,0x9a));var _0x9812=function(_0x62862d,_0x52fd0a){_0x62862d=_0x62862d-0x0;var _0x24a0e2=_0x8129[_0x62862d];return _0x24a0e2;};'use strict';var _=require(_0x9812('0x0'));var md5=require('md5');var util=require(_0x9812('0x1'));var Redis=require(_0x9812('0x2'));var config=require(_0x9812('0x3'));config[_0x9812('0x4')]=_['defaults'](config[_0x9812('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9812('0x5'))(new Redis(config[_0x9812('0x4')]));function MailQueue(_0x4536e1){this['id']=_0x4536e1['id']||0x0;this[_0x9812('0x6')]=_0x4536e1[_0x9812('0x6')]||'';this[_0x9812('0x7')]=_0x4536e1['timeout']||0xa;this[_0x9812('0x8')]=_0x4536e1[_0x9812('0x8')]||'beepall';this[_0x9812('0x9')]=_0x4536e1[_0x9812('0x9')];this[_0x9812('0xa')]={};this[_0x9812('0xb')]=0x0;this[_0x9812('0xc')]='';this[_0x9812('0xd')]();this['updateRealtime']();}MailQueue[_0x9812('0xe')][_0x9812('0xd')]=function(){var _0x8b4f66=this[_0x9812('0xa')]['_rr'];this['mapAgentsId']=_[_0x9812('0xf')](this[_0x9812('0x9')],'id');this[_0x9812('0xa')][_0x9812('0x10')]=_0x8b4f66;};MailQueue[_0x9812('0xe')]['updateRealtime']=function(){this[_0x9812('0x11')]=0x0;this['paused']=0x0;for(var _0x468ea4=0x0;_0x468ea4=0x0?this[_0x9812('0x15')]:0x0;var _0x5099ff={'id':this['id'],'available':this[_0x9812('0x15')],'loggedIn':this[_0x9812('0x11')],'name':this[_0x9812('0x6')],'paused':this[_0x9812('0x16')],'waiting':this[_0x9812('0xb')]};var _0x5616b1=md5(JSON[_0x9812('0x17')](_0x5099ff));if(this[_0x9812('0xc')]!==_0x5616b1){this[_0x9812('0xc')]=_0x5616b1;io['to'](util[_0x9812('0x18')](_0x9812('0x19'),_0x5099ff[_0x9812('0x6')]))['emit'](_0x9812('0x1a'),_0x5099ff);}};module[_0x9812('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 3860e99..a6f4b2f 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x427bfb,_0x1b54a3){var _0x34be85=function(_0x2c88f0){while(--_0x2c88f0){_0x427bfb['push'](_0x427bfb['shift']());}};_0x34be85(++_0x1b54a3);}(_0x814b,0x1a2));var _0xb814=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0x814b[_0x4d3187];return _0x107906;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x326f,0xd1));var _0xf326=function(_0x5635e9,_0x4fe169){_0x5635e9=_0x5635e9-0x0;var _0x422bef=_0x326f[_0x5635e9];return _0x422bef;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('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 67f1c48..85a7b82 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 _0xf041=['socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','sms_queue:save','exports','util','ioredis','../../../config/environment','redis'];(function(_0x37858a,_0x3b523f){var _0x1ff350=function(_0x13f59c){while(--_0x13f59c){_0x37858a['push'](_0x37858a['shift']());}};_0x1ff350(++_0x3b523f);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1f04('0x0'));var Redis=require(_0x1f04('0x1'));var config=require(_0x1f04('0x2'));config[_0x1f04('0x3')]=_['defaults'](config[_0x1f04('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x1f04('0x4'))(new Redis(config['redis']));function SmsQueue(_0x530a67){this['id']=_0x530a67['id']||0x0;this[_0x1f04('0x5')]=_0x530a67['name']||'';this[_0x1f04('0x6')]=_0x530a67[_0x1f04('0x6')]||0xa;this[_0x1f04('0x7')]=_0x530a67[_0x1f04('0x7')]||'beepall';this[_0x1f04('0x8')]=_0x530a67[_0x1f04('0x8')];this[_0x1f04('0x9')]={};this[_0x1f04('0xa')]=0x0;this[_0x1f04('0xb')]='';this[_0x1f04('0xc')]();this[_0x1f04('0xd')]();}SmsQueue[_0x1f04('0xe')]['updateRouting']=function(){var _0x4f4e37=this[_0x1f04('0x9')][_0x1f04('0xf')];this[_0x1f04('0x9')]=_[_0x1f04('0x10')](this[_0x1f04('0x8')],'id');this[_0x1f04('0x9')][_0x1f04('0xf')]=_0x4f4e37;};SmsQueue[_0x1f04('0xe')][_0x1f04('0xd')]=function(){this[_0x1f04('0x11')]=0x0;this[_0x1f04('0x12')]=0x0;for(var _0x4ebd86=0x0;_0x4ebd86=0x0?this['available']:0x0;var _0x4964bd={'id':this['id'],'available':this[_0x1f04('0x15')],'loggedIn':this[_0x1f04('0x11')],'name':this[_0x1f04('0x5')],'paused':this[_0x1f04('0x12')],'waiting':this[_0x1f04('0xa')]};var _0x30d2e5=md5(JSON[_0x1f04('0x16')](_0x4964bd));if(this[_0x1f04('0xb')]!==_0x30d2e5){this['md5']=_0x30d2e5;io['to'](util[_0x1f04('0x17')](_0x1f04('0x18'),_0x4964bd[_0x1f04('0x5')]))['emit'](_0x1f04('0x19'),_0x4964bd);}};module[_0x1f04('0x1a')]=SmsQueue; \ No newline at end of file +var _0xc73e=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','smsPause','available','paused','waiting','stringify','format','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment'];(function(_0x31002e,_0x3c9a1a){var _0x4b7273=function(_0xa35b39){while(--_0xa35b39){_0x31002e['push'](_0x31002e['shift']());}};_0x4b7273(++_0x3c9a1a);}(_0xc73e,0x1e9));var _0xec73=function(_0x357a99,_0x5e2cb1){_0x357a99=_0x357a99-0x0;var _0x28a97a=_0xc73e[_0x357a99];return _0x28a97a;};'use strict';var _=require(_0xec73('0x0'));var md5=require(_0xec73('0x1'));var util=require('util');var Redis=require(_0xec73('0x2'));var config=require(_0xec73('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0xec73('0x4'),'port':0x18eb});var io=require(_0xec73('0x5'))(new Redis(config['redis']));function SmsQueue(_0x1b81ab){this['id']=_0x1b81ab['id']||0x0;this[_0xec73('0x6')]=_0x1b81ab[_0xec73('0x6')]||'';this[_0xec73('0x7')]=_0x1b81ab['timeout']||0xa;this[_0xec73('0x8')]=_0x1b81ab['strategy']||_0xec73('0x9');this[_0xec73('0xa')]=_0x1b81ab[_0xec73('0xa')];this[_0xec73('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xec73('0xc')]();this[_0xec73('0xd')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x152195=this[_0xec73('0xb')][_0xec73('0xe')];this[_0xec73('0xb')]=_[_0xec73('0xf')](this[_0xec73('0xa')],'id');this[_0xec73('0xb')]['_rr']=_0x152195;};SmsQueue[_0xec73('0x10')]['updateRealtime']=function(){this[_0xec73('0x11')]=0x0;this['paused']=0x0;for(var _0x10f003=0x0;_0x10f003=0x0?this[_0xec73('0x15')]:0x0;var _0x4d28c3={'id':this['id'],'available':this[_0xec73('0x15')],'loggedIn':this[_0xec73('0x11')],'name':this[_0xec73('0x6')],'paused':this['paused'],'waiting':this[_0xec73('0x17')]};var _0x475dd1=md5(JSON[_0xec73('0x18')](_0x4d28c3));if(this[_0xec73('0x1')]!==_0x475dd1){this[_0xec73('0x1')]=_0x475dd1;io['to'](util[_0xec73('0x19')]('sms:queue:%s',_0x4d28c3['name']))[_0xec73('0x1a')](_0xec73('0x1b'),_0x4d28c3);}};module[_0xec73('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 c59638d..9ec0c34 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 _0x1dcc=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x29b44e,_0x37210f){var _0x4ab492=function(_0x3e3c4a){while(--_0x3e3c4a){_0x29b44e['push'](_0x29b44e['shift']());}};_0x4ab492(++_0x37210f);}(_0x1dcc,0x74));var _0xc1dc=function(_0x36c280,_0x27086c){_0x36c280=_0x36c280-0x0;var _0x527dc8=_0x1dcc[_0x36c280];return _0x527dc8;};'use strict';var _=require(_0xc1dc('0x0'));var md5=require(_0xc1dc('0x1'));var util=require(_0xc1dc('0x2'));var Redis=require(_0xc1dc('0x3'));var config=require(_0xc1dc('0x4'));config[_0xc1dc('0x5')]=_[_0xc1dc('0x6')](config['redis'],{'host':_0xc1dc('0x7'),'port':0x18eb});var io=require(_0xc1dc('0x8'))(new Redis(config[_0xc1dc('0x5')]));function WhatsappQueue(_0x108745){this['id']=_0x108745['id']||0x0;this[_0xc1dc('0x9')]=_0x108745[_0xc1dc('0x9')]||'';this[_0xc1dc('0xa')]=_0x108745[_0xc1dc('0xa')]||0xa;this[_0xc1dc('0xb')]=_0x108745['strategy']||_0xc1dc('0xc');this['Agents']=_0x108745[_0xc1dc('0xd')];this[_0xc1dc('0xe')]={};this[_0xc1dc('0xf')]=0x0;this[_0xc1dc('0x1')]='';this[_0xc1dc('0x10')]();this[_0xc1dc('0x11')]();}WhatsappQueue[_0xc1dc('0x12')][_0xc1dc('0x10')]=function(){var _0xed8bdd=this['mapAgentsId']['_rr'];this[_0xc1dc('0xe')]=_[_0xc1dc('0x13')](this[_0xc1dc('0xd')],'id');this[_0xc1dc('0xe')][_0xc1dc('0x14')]=_0xed8bdd;};WhatsappQueue['prototype'][_0xc1dc('0x11')]=function(){this[_0xc1dc('0x15')]=0x0;this[_0xc1dc('0x16')]=0x0;for(var _0x2d8c63=0x0;_0x2d8c63=0x0?this[_0xc1dc('0x1a')]:0x0;var _0x19e62f={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xc1dc('0x9')],'paused':this['paused'],'waiting':this['waiting']};var _0x485ffb=md5(JSON['stringify'](_0x19e62f));if(this[_0xc1dc('0x1')]!==_0x485ffb){this[_0xc1dc('0x1')]=_0x485ffb;io['to'](util[_0xc1dc('0x1b')](_0xc1dc('0x1c'),_0x19e62f['name']))[_0xc1dc('0x1d')]('whatsapp_queue:save',_0x19e62f);}};module[_0xc1dc('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x8645=['loggedIn','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0x8645,0x1e5));var _0x5864=function(_0x1f8cbc,_0x404fad){_0x1f8cbc=_0x1f8cbc-0x0;var _0x26e5d6=_0x8645[_0x1f8cbc];return _0x26e5d6;};'use strict';var _=require(_0x5864('0x0'));var md5=require(_0x5864('0x1'));var util=require(_0x5864('0x2'));var Redis=require(_0x5864('0x3'));var config=require(_0x5864('0x4'));config['redis']=_[_0x5864('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5864('0x6')]));function WhatsappQueue(_0x1fd3ed){this['id']=_0x1fd3ed['id']||0x0;this[_0x5864('0x7')]=_0x1fd3ed['name']||'';this[_0x5864('0x8')]=_0x1fd3ed['timeout']||0xa;this[_0x5864('0x9')]=_0x1fd3ed['strategy']||_0x5864('0xa');this[_0x5864('0xb')]=_0x1fd3ed[_0x5864('0xb')];this['mapAgentsId']={};this[_0x5864('0xc')]=0x0;this[_0x5864('0x1')]='';this[_0x5864('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x5864('0xe')]['updateRouting']=function(){var _0x3d4206=this[_0x5864('0xf')][_0x5864('0x10')];this['mapAgentsId']=_[_0x5864('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x5864('0x10')]=_0x3d4206;};WhatsappQueue['prototype'][_0x5864('0x12')]=function(){this[_0x5864('0x13')]=0x0;this[_0x5864('0x14')]=0x0;for(var _0x1f7b6f=0x0;_0x1f7b6f=0x0?this[_0x5864('0x15')]:0x0;var _0x4dbf25={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5864('0x13')],'name':this[_0x5864('0x7')],'paused':this[_0x5864('0x14')],'waiting':this[_0x5864('0xc')]};var _0x225c61=md5(JSON[_0x5864('0x16')](_0x4dbf25));if(this[_0x5864('0x1')]!==_0x225c61){this[_0x5864('0x1')]=_0x225c61;io['to'](util[_0x5864('0x17')](_0x5864('0x18'),_0x4dbf25['name']))[_0x5864('0x19')](_0x5864('0x1a'),_0x4dbf25);}};module[_0x5864('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 4f25f0f..eb77513 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x6f7ed6,_0x38fc62){var _0x2671c8=function(_0x4bb557){while(--_0x4bb557){_0x6f7ed6['push'](_0x6f7ed6['shift']());}};_0x2671c8(++_0x38fc62);}(_0xb10b,0x12a));var _0xbb10=function(_0x276cc9,_0x17774c){_0x276cc9=_0x276cc9-0x0;var _0x31ac6b=_0xb10b[_0x276cc9];return _0x31ac6b;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 1814965..0516a0b 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 _0xa533=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa533,0x1e2));var _0x3a53=function(_0x30e112,_0x272717){_0x30e112=_0x30e112-0x0;var _0x311ac6=_0xa533[_0x30e112];return _0x311ac6;};'use strict';var client=require(_0x3a53('0x0'));exports[_0x3a53('0x1')]=function(_0x4bd113,_0xeef1f1){return client[_0x3a53('0x2')](_0x3a53('0x3'),{'body':_0xeef1f1,'options':{'where':{'id':_0x4bd113}},'log':_0x3a53('0x4')});};exports[_0x3a53('0x5')]=function(_0x583c7f,_0x1eaad8){return client['Request'](_0x3a53('0x6'),{'body':_0x1eaad8,'options':{'where':{'id':_0x583c7f}},'log':_0x3a53('0x7')});}; \ No newline at end of file +var _0x5594=['Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x1d2922,_0xdcb3e0){var _0x1d7211=function(_0x2becdf){while(--_0x2becdf){_0x1d2922['push'](_0x1d2922['shift']());}};_0x1d7211(++_0xdcb3e0);}(_0x5594,0x1d3));var _0x4559=function(_0x5c7b7d,_0x4bbd89){_0x5c7b7d=_0x5c7b7d-0x0;var _0x2d5a9e=_0x5594[_0x5c7b7d];return _0x2d5a9e;};'use strict';var client=require('../client');exports[_0x4559('0x0')]=function(_0x33c3a0,_0x420262){return client[_0x4559('0x1')]('UpdateChatInteraction',{'body':_0x420262,'options':{'where':{'id':_0x33c3a0}},'log':_0x4559('0x2')});};exports[_0x4559('0x3')]=function(_0x4341b2,_0x132f64){return client[_0x4559('0x1')](_0x4559('0x4'),{'body':_0x132f64,'options':{'where':{'id':_0x4341b2}},'log':_0x4559('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 227bd85..c15199f 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 _0x2a35=['../client','createChatMessage'];(function(_0x2634a7,_0x118508){var _0xa52e2c=function(_0x400f75){while(--_0x400f75){_0x2634a7['push'](_0x2634a7['shift']());}};_0xa52e2c(++_0x118508);}(_0x2a35,0x72));var _0x52a3=function(_0x9b9c8b,_0x6666ba){_0x9b9c8b=_0x9b9c8b-0x0;var _0x47a74d=_0x2a35[_0x9b9c8b];return _0x47a74d;};'use strict';var client=require(_0x52a3('0x0'));exports['create']=function(_0x2fa0b8){return client['Request']('CreateChatMessage',{'body':_0x2fa0b8,'log':_0x52a3('0x1')});}; \ No newline at end of file +var _0x743a=['CreateChatMessage','../client','Request'];(function(_0xe0372e,_0x32ae8b){var _0x3c56ab=function(_0x2a0508){while(--_0x2a0508){_0xe0372e['push'](_0xe0372e['shift']());}};_0x3c56ab(++_0x32ae8b);}(_0x743a,0x1ae));var _0xa743=function(_0x456c93,_0x217748){_0x456c93=_0x456c93-0x0;var _0x368b5f=_0x743a[_0x456c93];return _0x368b5f;};'use strict';var client=require(_0xa743('0x0'));exports['create']=function(_0x2dc803){return client[_0xa743('0x1')](_0xa743('0x2'),{'body':_0x2dc803,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 2982aaa..720ef93 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 _0x6bb4=['../client','getChatQueues','Request','name','timeout','User','Agents','online','chatPause'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x1779d1,_0x55acb6){_0x1779d1=_0x1779d1-0x0;var _0x2884e3=_0x6bb4[_0x1779d1];return _0x2884e3;};'use strict';var client=require(_0x46bb('0x0'));exports[_0x46bb('0x1')]=function(){return function(){return client[_0x46bb('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x46bb('0x3'),_0x46bb('0x4'),'strategy'],'include':[{'model':_0x46bb('0x5'),'as':_0x46bb('0x6'),'attributes':['id',_0x46bb('0x3'),_0x46bb('0x7'),_0x46bb('0x8')]}]},'log':_0x46bb('0x1')});};}; \ No newline at end of file +var _0x3fa4=['../client','name','timeout','strategy','User','Agents','online','getChatQueues'];(function(_0x30ff2a,_0x43a8cb){var _0x177d51=function(_0x3aaa53){while(--_0x3aaa53){_0x30ff2a['push'](_0x30ff2a['shift']());}};_0x177d51(++_0x43a8cb);}(_0x3fa4,0xf0));var _0x43fa=function(_0x145cec,_0x1c7390){_0x145cec=_0x145cec-0x0;var _0xe204e1=_0x3fa4[_0x145cec];return _0xe204e1;};'use strict';var client=require(_0x43fa('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x43fa('0x1'),_0x43fa('0x2'),_0x43fa('0x3')],'include':[{'model':_0x43fa('0x4'),'as':_0x43fa('0x5'),'attributes':['id',_0x43fa('0x1'),_0x43fa('0x6'),'chatPause']}]},'log':_0x43fa('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 2740f10..7c54e5e 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 _0xa5ca=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0xa5ca[_0x261522];return _0x98a25a;};'use strict';var client=require(_0xaa5c('0x0'));exports[_0xaa5c('0x1')]=function(_0x3d7bfc){return client['Request']('CreateChatQueueReport',{'body':_0x3d7bfc,'log':_0xaa5c('0x2')});};exports[_0xaa5c('0x3')]=function(_0x2757fe,_0x12c12f){return client[_0xaa5c('0x4')](_0xaa5c('0x5'),{'body':_0x12c12f,'options':{'where':{'uniqueid':_0x2757fe},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x63bb=['update','UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x178de8,_0x3e9024){var _0x19edb2=function(_0x63a9df){while(--_0x63a9df){_0x178de8['push'](_0x178de8['shift']());}};_0x19edb2(++_0x3e9024);}(_0x63bb,0xf8));var _0xb63b=function(_0x4b03d3,_0x32f1d2){_0x4b03d3=_0x4b03d3-0x0;var _0x58a968=_0x63bb[_0x4b03d3];return _0x58a968;};'use strict';var client=require(_0xb63b('0x0'));exports[_0xb63b('0x1')]=function(_0x1a2a48){return client[_0xb63b('0x2')](_0xb63b('0x3'),{'body':_0x1a2a48,'log':_0xb63b('0x3')});};exports[_0xb63b('0x4')]=function(_0x47ee22,_0x48a423){return client[_0xb63b('0x2')](_0xb63b('0x5'),{'body':_0x48a423,'options':{'where':{'uniqueid':_0x47ee22},'order':[['id',_0xb63b('0x6')]],'limit':0x1},'log':_0xb63b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 4a5e7c8..c5dfb0f 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x7a54,0x106));var _0x47a5=function(_0xa1a2f4,_0x595478){_0xa1a2f4=_0xa1a2f4-0x0;var _0x40727b=_0x7a54[_0xa1a2f4];return _0x40727b;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3fe2c6,_0xe0af43){var _0x3740ec=function(_0x1dff23){while(--_0x1dff23){_0x3fe2c6['push'](_0x3fe2c6['shift']());}};_0x3740ec(++_0xe0af43);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index d079915..7c4d429 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 _0xb0de=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb0de,0x6a));var _0xeb0d=function(_0x1db33d,_0x15befd){_0x1db33d=_0x1db33d-0x0;var _0x4ec6a9=_0xb0de[_0x1db33d];return _0x4ec6a9;};'use strict';var client=require(_0xeb0d('0x0'));exports['create']=function(_0x11e76f){return client[_0xeb0d('0x1')](_0xeb0d('0x2'),{'body':_0x11e76f,'log':_0xeb0d('0x3')});}; \ No newline at end of file +var _0x5214=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0x583841,_0x566591){var _0x171305=function(_0x48b53a){while(--_0x48b53a){_0x583841['push'](_0x583841['shift']());}};_0x171305(++_0x566591);}(_0x5214,0x1c6));var _0x4521=function(_0x51b66f,_0x23c9b0){_0x51b66f=_0x51b66f-0x0;var _0x545f8f=_0x5214[_0x51b66f];return _0x545f8f;};'use strict';var client=require(_0x4521('0x0'));exports['create']=function(_0x54beef){return client[_0x4521('0x1')](_0x4521('0x2'),{'body':_0x54beef,'log':_0x4521('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 85612a1..170080f 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 _0x0448=['../client','getFaxQueues','Request','name','strategy','User','online','faxPause'];(function(_0x37e890,_0x38dfa4){var _0x299034=function(_0x261887){while(--_0x261887){_0x37e890['push'](_0x37e890['shift']());}};_0x299034(++_0x38dfa4);}(_0x0448,0x150));var _0x8044=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x0448[_0x5a3cf0];return _0x5a64ee;};'use strict';var client=require(_0x8044('0x0'));exports[_0x8044('0x1')]=function(){return function(){return client[_0x8044('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x8044('0x3'),'timeout',_0x8044('0x4')],'include':[{'model':_0x8044('0x5'),'as':'Agents','attributes':['id','name',_0x8044('0x6'),_0x8044('0x7')]}]},'log':_0x8044('0x1')});};}; \ No newline at end of file +var _0x3fdd=['Request','timeout','Agents','name','online','faxPause','getFaxQueues'];(function(_0x1cc1fd,_0x33f9f1){var _0x5e3d41=function(_0x356881){while(--_0x356881){_0x1cc1fd['push'](_0x1cc1fd['shift']());}};_0x5e3d41(++_0x33f9f1);}(_0x3fdd,0x68));var _0xd3fd=function(_0x374f98,_0x1399d2){_0x374f98=_0x374f98-0x0;var _0x7cdb71=_0x3fdd[_0x374f98];return _0x7cdb71;};'use strict';var client=require('../client');exports[_0xd3fd('0x0')]=function(){return function(){return client[_0xd3fd('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0xd3fd('0x2'),'strategy'],'include':[{'model':'User','as':_0xd3fd('0x3'),'attributes':['id',_0xd3fd('0x4'),_0xd3fd('0x5'),_0xd3fd('0x6')]}]},'log':_0xd3fd('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 2f7c21f..a2730f2 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 _0xe4e7=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','create'];(function(_0x3ca04d,_0xc49617){var _0x2e1091=function(_0x2d1db3){while(--_0x2d1db3){_0x3ca04d['push'](_0x3ca04d['shift']());}};_0x2e1091(++_0xc49617);}(_0xe4e7,0xc5));var _0x7e4e=function(_0x3cb10d,_0x26b91b){_0x3cb10d=_0x3cb10d-0x0;var _0xb504ba=_0xe4e7[_0x3cb10d];return _0xb504ba;};'use strict';var client=require('../client');exports[_0x7e4e('0x0')]=function(_0x4d2c7b){return client[_0x7e4e('0x1')]('CreateFaxQueueReport',{'body':_0x4d2c7b,'log':_0x7e4e('0x2')});};exports[_0x7e4e('0x3')]=function(_0x2274f1,_0x22b119){return client['Request'](_0x7e4e('0x4'),{'body':_0x22b119,'options':{'where':{'uniqueid':_0x2274f1},'order':[['id',_0x7e4e('0x5')]],'limit':0x1},'log':_0x7e4e('0x4')});}; \ No newline at end of file +var _0x579c=['../client','create','Request','UpdateFaxQueueReport'];(function(_0x34b23e,_0x583971){var _0x7799a1=function(_0x30b94b){while(--_0x30b94b){_0x34b23e['push'](_0x34b23e['shift']());}};_0x7799a1(++_0x583971);}(_0x579c,0x1dc));var _0xc579=function(_0x2b202c,_0x41a18c){_0x2b202c=_0x2b202c-0x0;var _0x2cdd44=_0x579c[_0x2b202c];return _0x2cdd44;};'use strict';var client=require(_0xc579('0x0'));exports[_0xc579('0x1')]=function(_0x38f4b4){return client[_0xc579('0x2')]('CreateFaxQueueReport',{'body':_0x38f4b4,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x23e839,_0x48d5fc){return client['Request'](_0xc579('0x3'),{'body':_0x48d5fc,'options':{'where':{'uniqueid':_0x23e839},'order':[['id','DESC']],'limit':0x1},'log':_0xc579('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a64cca8..03c6857 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 _0x2c64=['GetInterval','name','Intervals','interval','getIntervals','../client','Request'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x2c64,0x1ef));var _0x42c6=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x2c64[_0x2080a3];return _0x8d7d17;};'use strict';var client=require(_0x42c6('0x0'));exports['getIntervals']=function(){return function(){return client[_0x42c6('0x1')](_0x42c6('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x42c6('0x3')],'include':[{'model':'Interval','as':_0x42c6('0x4'),'attributes':['id',_0x42c6('0x3'),_0x42c6('0x5')]}]},'log':_0x42c6('0x6')});};}; \ No newline at end of file +var _0x9d40=['getIntervals','Request','GetInterval','Interval','Intervals','name','interval'];(function(_0x2dd970,_0x57abf9){var _0x1bc477=function(_0x311409){while(--_0x311409){_0x2dd970['push'](_0x2dd970['shift']());}};_0x1bc477(++_0x57abf9);}(_0x9d40,0x16c));var _0x09d4=function(_0x5e47cd,_0x1eae76){_0x5e47cd=_0x5e47cd-0x0;var _0x2373cc=_0x9d40[_0x5e47cd];return _0x2373cc;};'use strict';var client=require('../client');exports[_0x09d4('0x0')]=function(){return function(){return client[_0x09d4('0x1')](_0x09d4('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x09d4('0x3'),'as':_0x09d4('0x4'),'attributes':['id',_0x09d4('0x5'),_0x09d4('0x6')]}]},'log':_0x09d4('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c85cd1c..a9629b5 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 _0x958a=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x31b777,_0x495416){var _0x3ed3ec=function(_0x23dd46){while(--_0x23dd46){_0x31b777['push'](_0x31b777['shift']());}};_0x3ed3ec(++_0x495416);}(_0x958a,0x128));var _0xa958=function(_0x262235,_0x404d1e){_0x262235=_0x262235-0x0;var _0x54d365=_0x958a[_0x262235];return _0x54d365;};'use strict';var client=require(_0xa958('0x0'));exports[_0xa958('0x1')]=function(_0x519e66,_0x44a925){return client[_0xa958('0x2')](_0xa958('0x3'),{'body':_0x44a925,'options':{'where':{'id':_0x519e66}},'log':_0xa958('0x4')});};exports[_0xa958('0x5')]=function(_0x5194f8,_0x3424b0){return client['Request'](_0xa958('0x6'),{'body':_0x3424b0,'options':{'where':{'id':_0x5194f8}},'log':_0xa958('0x7')});}; \ No newline at end of file +var _0x68b3=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','updateMailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68b3,0x1d8));var _0x368b=function(_0x4cbe6a,_0x593aae){_0x4cbe6a=_0x4cbe6a-0x0;var _0x5273fa=_0x68b3[_0x4cbe6a];return _0x5273fa;};'use strict';var client=require(_0x368b('0x0'));exports[_0x368b('0x1')]=function(_0x3e8034,_0xa371c){return client[_0x368b('0x2')]('UpdateMailInteraction',{'body':_0xa371c,'options':{'where':{'id':_0x3e8034}},'log':_0x368b('0x3')});};exports[_0x368b('0x4')]=function(_0xc40116,_0x404282){return client['Request'](_0x368b('0x5'),{'body':_0x404282,'options':{'where':{'id':_0xc40116}},'log':_0x368b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 3676d40..3563cf6 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 _0x44a2=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x26e66e,_0x68684a){var _0x1b3147=function(_0x5d0824){while(--_0x5d0824){_0x26e66e['push'](_0x26e66e['shift']());}};_0x1b3147(++_0x68684a);}(_0x44a2,0x14c));var _0x244a=function(_0x1d618b,_0x20c297){_0x1d618b=_0x1d618b-0x0;var _0x2c0e72=_0x44a2[_0x1d618b];return _0x2c0e72;};'use strict';var client=require('../client');exports[_0x244a('0x0')]=function(_0x551876){return client[_0x244a('0x1')](_0x244a('0x2'),{'body':_0x551876,'log':_0x244a('0x3')});}; \ No newline at end of file +var _0xf021=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x4288e8,_0x42ae9a){var _0x238e62=function(_0x1c9a00){while(--_0x1c9a00){_0x4288e8['push'](_0x4288e8['shift']());}};_0x238e62(++_0x42ae9a);}(_0xf021,0x100));var _0x1f02=function(_0x5a300a,_0x198ebb){_0x5a300a=_0x5a300a-0x0;var _0xb2260f=_0xf021[_0x5a300a];return _0xb2260f;};'use strict';var client=require(_0x1f02('0x0'));exports[_0x1f02('0x1')]=function(_0x3b0bdf){return client[_0x1f02('0x2')](_0x1f02('0x3'),{'body':_0x3b0bdf,'log':_0x1f02('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 1e3e125..de6377f 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 _0x1e1e=['online','mailPause','getMailQueues','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x11daf4,_0x1528c6){var _0x2305c0=function(_0x168e4e){while(--_0x168e4e){_0x11daf4['push'](_0x11daf4['shift']());}};_0x2305c0(++_0x1528c6);}(_0x1e1e,0x161));var _0xe1e1=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x1e1e[_0x16629d];return _0x56ccee;};'use strict';var client=require('../client');exports[_0xe1e1('0x0')]=function(){return function(){return client['Request'](_0xe1e1('0x1'),{'options':{'raw':![],'attributes':['id',_0xe1e1('0x2'),_0xe1e1('0x3'),_0xe1e1('0x4')],'include':[{'model':_0xe1e1('0x5'),'as':_0xe1e1('0x6'),'attributes':['id',_0xe1e1('0x2'),_0xe1e1('0x7'),_0xe1e1('0x8')]}]},'log':_0xe1e1('0x0')});};}; \ No newline at end of file +var _0x2f9b=['../client','name','strategy','User','Agents','online','mailPause','getMailQueues'];(function(_0x309d93,_0x157662){var _0x2dd61d=function(_0x25ff34){while(--_0x25ff34){_0x309d93['push'](_0x309d93['shift']());}};_0x2dd61d(++_0x157662);}(_0x2f9b,0x1b8));var _0xb2f9=function(_0x514801,_0x35f1a5){_0x514801=_0x514801-0x0;var _0x1648cd=_0x2f9b[_0x514801];return _0x1648cd;};'use strict';var client=require(_0xb2f9('0x0'));exports['getMailQueues']=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xb2f9('0x1'),'timeout',_0xb2f9('0x2')],'include':[{'model':_0xb2f9('0x3'),'as':_0xb2f9('0x4'),'attributes':['id',_0xb2f9('0x1'),_0xb2f9('0x5'),_0xb2f9('0x6')]}]},'log':_0xb2f9('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 84baf38..f9351e2 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 _0x1cf7=['CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client','create'];(function(_0x3e3e8d,_0x4b3914){var _0x3d51d4=function(_0x3f0d40){while(--_0x3f0d40){_0x3e3e8d['push'](_0x3e3e8d['shift']());}};_0x3d51d4(++_0x4b3914);}(_0x1cf7,0x16a));var _0x71cf=function(_0x2e407f,_0x3bbd8d){_0x2e407f=_0x2e407f-0x0;var _0x27e69d=_0x1cf7[_0x2e407f];return _0x27e69d;};'use strict';var client=require(_0x71cf('0x0'));exports[_0x71cf('0x1')]=function(_0x1eb301){return client['Request'](_0x71cf('0x2'),{'body':_0x1eb301,'log':'CreateMailQueueReport'});};exports[_0x71cf('0x3')]=function(_0x1490bf,_0x1bea99){return client[_0x71cf('0x4')](_0x71cf('0x5'),{'body':_0x1bea99,'options':{'where':{'uniqueid':_0x1490bf},'order':[['id',_0x71cf('0x6')]],'limit':0x1},'log':_0x71cf('0x5')});}; \ No newline at end of file +var _0x3b05=['Request','UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update'];(function(_0x223aa0,_0x3e2e7a){var _0x28106b=function(_0x570450){while(--_0x570450){_0x223aa0['push'](_0x223aa0['shift']());}};_0x28106b(++_0x3e2e7a);}(_0x3b05,0x184));var _0x53b0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3b05[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x53b0('0x0'));exports[_0x53b0('0x1')]=function(_0x5edc31){return client['Request'](_0x53b0('0x2'),{'body':_0x5edc31,'log':_0x53b0('0x2')});};exports[_0x53b0('0x3')]=function(_0x420cd0,_0x1e1cb9){return client[_0x53b0('0x4')](_0x53b0('0x5'),{'body':_0x1e1cb9,'options':{'where':{'uniqueid':_0x420cd0},'order':[['id',_0x53b0('0x6')]],'limit':0x1},'log':_0x53b0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 928aa74..f4d8a2a 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 _0x77eb=['addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction'];(function(_0x1ea552,_0x127250){var _0x52a7ce=function(_0x165732){while(--_0x165732){_0x1ea552['push'](_0x1ea552['shift']());}};_0x52a7ce(++_0x127250);}(_0x77eb,0x81));var _0xb77e=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x77eb[_0xfc406a];return _0x395473;};'use strict';var client=require(_0xb77e('0x0'));exports[_0xb77e('0x1')]=function(_0x18ff21,_0x5b5b67){return client['Request'](_0xb77e('0x2'),{'body':_0x5b5b67,'options':{'where':{'id':_0x18ff21}},'log':_0xb77e('0x3')});};exports[_0xb77e('0x4')]=function(_0x4806d4,_0x206756){return client[_0xb77e('0x5')](_0xb77e('0x6'),{'body':_0x206756,'options':{'where':{'id':_0x4806d4}},'log':_0xb77e('0x7')});}; \ No newline at end of file +var _0x2815=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','update'];(function(_0xe07be8,_0x5ac2dc){var _0xf1e8f6=function(_0x2f7b37){while(--_0x2f7b37){_0xe07be8['push'](_0xe07be8['shift']());}};_0xf1e8f6(++_0x5ac2dc);}(_0x2815,0x1af));var _0x5281=function(_0x4426df,_0x2b051c){_0x4426df=_0x4426df-0x0;var _0x2a6fb8=_0x2815[_0x4426df];return _0x2a6fb8;};'use strict';var client=require('../client');exports[_0x5281('0x0')]=function(_0x20bf50,_0x3cc022){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x3cc022,'options':{'where':{'id':_0x20bf50}},'log':_0x5281('0x1')});};exports['addTags']=function(_0x4d5a6f,_0x5b6930){return client['Request'](_0x5281('0x2'),{'body':_0x5b6930,'options':{'where':{'id':_0x4d5a6f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 06f9f36..717631a 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 _0x6edf=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x2d7bc7,_0x3d1615){var _0x24832e=function(_0x462e94){while(--_0x462e94){_0x2d7bc7['push'](_0x2d7bc7['shift']());}};_0x24832e(++_0x3d1615);}(_0x6edf,0x1b2));var _0xf6ed=function(_0x1100ec,_0x4c97b1){_0x1100ec=_0x1100ec-0x0;var _0x9d4dee=_0x6edf[_0x1100ec];return _0x9d4dee;};'use strict';var client=require(_0xf6ed('0x0'));exports[_0xf6ed('0x1')]=function(_0x36c9fe){return client[_0xf6ed('0x2')](_0xf6ed('0x3'),{'body':_0x36c9fe,'log':_0xf6ed('0x4')});}; \ No newline at end of file +var _0xb04f=['create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x225240,_0x4542c4){var _0x21b6bb=function(_0x59fed1){while(--_0x59fed1){_0x225240['push'](_0x225240['shift']());}};_0x21b6bb(++_0x4542c4);}(_0xb04f,0x1a4));var _0xfb04=function(_0x3d9019,_0x5ca52b){_0x3d9019=_0x3d9019-0x0;var _0x295666=_0xb04f[_0x3d9019];return _0x295666;};'use strict';var client=require('../client');exports[_0xfb04('0x0')]=function(_0x312f59){return client['Request'](_0xfb04('0x1'),{'body':_0x312f59,'log':_0xfb04('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 8036112..0037456 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 _0xb0dc=['../client','getOpenchannelQueues','Request','name','strategy','User','online','openchannelPause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb0dc,0x150));var _0xcb0d=function(_0x36baac,_0x2ca483){_0x36baac=_0x36baac-0x0;var _0x430de5=_0xb0dc[_0x36baac];return _0x430de5;};'use strict';var client=require(_0xcb0d('0x0'));exports[_0xcb0d('0x1')]=function(){return function(){return client[_0xcb0d('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xcb0d('0x3'),'timeout',_0xcb0d('0x4')],'include':[{'model':_0xcb0d('0x5'),'as':'Agents','attributes':['id',_0xcb0d('0x3'),_0xcb0d('0x6'),_0xcb0d('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x5dea=['name','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','strategy','Agents'];(function(_0x3dded2,_0x43f325){var _0x22319a=function(_0x1aca75){while(--_0x1aca75){_0x3dded2['push'](_0x3dded2['shift']());}};_0x22319a(++_0x43f325);}(_0x5dea,0x1bc));var _0xa5de=function(_0x5f50d3,_0x4c6787){_0x5f50d3=_0x5f50d3-0x0;var _0x1710e7=_0x5dea[_0x5f50d3];return _0x1710e7;};'use strict';var client=require(_0xa5de('0x0'));exports[_0xa5de('0x1')]=function(){return function(){return client[_0xa5de('0x2')](_0xa5de('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xa5de('0x4')],'include':[{'model':'User','as':_0xa5de('0x5'),'attributes':['id',_0xa5de('0x6'),_0xa5de('0x7'),_0xa5de('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 4d8ca98..4e48da9 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 _0x1d3a=['DESC','../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4071cc,_0x2ba75f){var _0x2f2f8c=function(_0x5bd564){while(--_0x5bd564){_0x4071cc['push'](_0x4071cc['shift']());}};_0x2f2f8c(++_0x2ba75f);}(_0x1d3a,0xa2));var _0xa1d3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x1d3a[_0x5f0089];return _0x193892;};'use strict';var client=require(_0xa1d3('0x0'));exports[_0xa1d3('0x1')]=function(_0x304300){return client[_0xa1d3('0x2')](_0xa1d3('0x3'),{'body':_0x304300,'log':_0xa1d3('0x3')});};exports[_0xa1d3('0x4')]=function(_0x44bbf7,_0x3de76b){return client[_0xa1d3('0x2')](_0xa1d3('0x5'),{'body':_0x3de76b,'options':{'where':{'uniqueid':_0x44bbf7},'order':[['id',_0xa1d3('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x4157=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x4157,0xf3));var _0x7415=function(_0x2214bd,_0x5d725e){_0x2214bd=_0x2214bd-0x0;var _0x44e646=_0x4157[_0x2214bd];return _0x44e646;};'use strict';var client=require(_0x7415('0x0'));exports[_0x7415('0x1')]=function(_0x325318){return client[_0x7415('0x2')](_0x7415('0x3'),{'body':_0x325318,'log':'CreateOpenchannelQueueReport'});};exports[_0x7415('0x4')]=function(_0x3bef76,_0x311038){return client[_0x7415('0x2')](_0x7415('0x5'),{'body':_0x311038,'options':{'where':{'uniqueid':_0x3bef76},'order':[['id',_0x7415('0x6')]],'limit':0x1},'log':_0x7415('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 4aaeed5..a7b151a 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 _0x46fc=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x282898,_0x556c29){var _0x147a14=function(_0x24e730){while(--_0x24e730){_0x282898['push'](_0x282898['shift']());}};_0x147a14(++_0x556c29);}(_0x46fc,0x103));var _0xc46f=function(_0x2e1464,_0x39ed59){_0x2e1464=_0x2e1464-0x0;var _0x195022=_0x46fc[_0x2e1464];return _0x195022;};'use strict';var client=require(_0xc46f('0x0'));exports[_0xc46f('0x1')]=function(_0xf5212c,_0x23d3ae){return client[_0xc46f('0x2')](_0xc46f('0x3'),{'body':_0x23d3ae,'options':{'where':{'id':_0xf5212c}},'log':_0xc46f('0x4')});};exports[_0xc46f('0x5')]=function(_0x3a56db,_0x5b0483){return client['Request'](_0xc46f('0x6'),{'body':_0x5b0483,'options':{'where':{'id':_0x3a56db}},'log':_0xc46f('0x7')});}; \ No newline at end of file +var _0x5d55=['update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x169a75,_0x541a4e){var _0x38665b=function(_0x1827c6){while(--_0x1827c6){_0x169a75['push'](_0x169a75['shift']());}};_0x38665b(++_0x541a4e);}(_0x5d55,0x1a4));var _0x55d5=function(_0x1af062,_0x2fb29d){_0x1af062=_0x1af062-0x0;var _0x325b54=_0x5d55[_0x1af062];return _0x325b54;};'use strict';var client=require('../client');exports[_0x55d5('0x0')]=function(_0x4cd0e2,_0x1de575){return client[_0x55d5('0x1')]('UpdateSmsInteraction',{'body':_0x1de575,'options':{'where':{'id':_0x4cd0e2}},'log':_0x55d5('0x2')});};exports[_0x55d5('0x3')]=function(_0x3bca0b,_0x546e6c){return client[_0x55d5('0x1')](_0x55d5('0x4'),{'body':_0x546e6c,'options':{'where':{'id':_0x3bca0b}},'log':_0x55d5('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index af78ec4..62df484 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 _0x0df7=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x0df7,0x72));var _0x70df=function(_0x2af589,_0x3e7e14){_0x2af589=_0x2af589-0x0;var _0x33d2a6=_0x0df7[_0x2af589];return _0x33d2a6;};'use strict';var client=require(_0x70df('0x0'));exports[_0x70df('0x1')]=function(_0x565578){return client[_0x70df('0x2')](_0x70df('0x3'),{'body':_0x565578,'log':_0x70df('0x4')});}; \ No newline at end of file +var _0x7f45=['CreateSmsMessage','createSmsMessage','../client','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7f45,0x6a));var _0x57f4=function(_0x442f61,_0x23a381){_0x442f61=_0x442f61-0x0;var _0x4efe1b=_0x7f45[_0x442f61];return _0x4efe1b;};'use strict';var client=require(_0x57f4('0x0'));exports['create']=function(_0x399fff){return client[_0x57f4('0x1')](_0x57f4('0x2'),{'body':_0x399fff,'log':_0x57f4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 013e906..d5a82fe 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x5a2ec8,_0x560609){var _0x69efdb=function(_0x948ca){while(--_0x948ca){_0x5a2ec8['push'](_0x5a2ec8['shift']());}};_0x69efdb(++_0x560609);}(_0x70e0,0x17b));var _0x070e=function(_0x4ddfc5,_0x20ae5f){_0x4ddfc5=_0x4ddfc5-0x0;var _0x2cb98b=_0x70e0[_0x4ddfc5];return _0x2cb98b;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x5ea2a7,_0x2034f8){var _0x55ef2e=function(_0x3b594d){while(--_0x3b594d){_0x5ea2a7['push'](_0x5ea2a7['shift']());}};_0x55ef2e(++_0x2034f8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 75b0703..dd5c4bc 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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x5c304f,_0x11280c){var _0xd635be=function(_0xd597ee){while(--_0xd597ee){_0x5c304f['push'](_0x5c304f['shift']());}};_0xd635be(++_0x11280c);}(_0x70e0,0x17b));var _0x070e=function(_0x1e90eb,_0x25b0fe){_0x1e90eb=_0x1e90eb-0x0;var _0x3f54e4=_0x70e0[_0x1e90eb];return _0x3f54e4;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x4a7984,_0x33e68f){var _0x40b15b=function(_0x2d852e){while(--_0x2d852e){_0x4a7984['push'](_0x4a7984['shift']());}};_0x40b15b(++_0x33e68f);}(_0x70e0,0x17b));var _0x070e=function(_0x3e78aa,_0x23dcff){_0x3e78aa=_0x3e78aa-0x0;var _0x1256ee=_0x70e0[_0x3e78aa];return _0x1256ee;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 9c0c2b7..0898e6c 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(_0x2f92fb,_0x6a65a2){var _0x1fec4d=function(_0x349aad){while(--_0x349aad){_0x2f92fb['push'](_0x2f92fb['shift']());}};_0x1fec4d(++_0x6a65a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x36a6db,_0x5a7e0f){var _0x160ea4=function(_0x513e20){while(--_0x513e20){_0x36a6db['push'](_0x36a6db['shift']());}};_0x160ea4(++_0x5a7e0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 de43317..4ed9aed 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 _0x96fd=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','updateWhatsappInteraction'];(function(_0xd6e8f7,_0x45b7d0){var _0x3cbb02=function(_0x515935){while(--_0x515935){_0xd6e8f7['push'](_0xd6e8f7['shift']());}};_0x3cbb02(++_0x45b7d0);}(_0x96fd,0x1e9));var _0xd96f=function(_0x34baf0,_0x44d55c){_0x34baf0=_0x34baf0-0x0;var _0x30e3a0=_0x96fd[_0x34baf0];return _0x30e3a0;};'use strict';var client=require('../client');exports[_0xd96f('0x0')]=function(_0x5334c3,_0x2022bf){return client[_0xd96f('0x1')]('UpdateWhatsappInteraction',{'body':_0x2022bf,'options':{'where':{'id':_0x5334c3}},'log':_0xd96f('0x2')});};exports[_0xd96f('0x3')]=function(_0x44f63c,_0x22b39b){return client['Request'](_0xd96f('0x4'),{'body':_0x22b39b,'options':{'where':{'id':_0x44f63c}},'log':_0xd96f('0x5')});}; \ No newline at end of file +var _0xe451=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0xe451,0xec));var _0x1e45=function(_0x2c5f39,_0x472a04){_0x2c5f39=_0x2c5f39-0x0;var _0x581642=_0xe451[_0x2c5f39];return _0x581642;};'use strict';var client=require('../client');exports['update']=function(_0xfe805c,_0x479192){return client['Request']('UpdateWhatsappInteraction',{'body':_0x479192,'options':{'where':{'id':_0xfe805c}},'log':_0x1e45('0x0')});};exports[_0x1e45('0x1')]=function(_0x1f9061,_0x197c03){return client['Request'](_0x1e45('0x2'),{'body':_0x197c03,'options':{'where':{'id':_0x1f9061}},'log':_0x1e45('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 97863be..2419b58 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 _0x30dc=['Request','createWhatsappMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30dc,0x12e));var _0xc30d=function(_0x7e8ffb,_0x272fcc){_0x7e8ffb=_0x7e8ffb-0x0;var _0x1756f6=_0x30dc[_0x7e8ffb];return _0x1756f6;};'use strict';var client=require('../client');exports['create']=function(_0x3b2f39){return client[_0xc30d('0x0')]('CreateWhatsappMessage',{'body':_0x3b2f39,'log':_0xc30d('0x1')});}; \ No newline at end of file +var _0x5ffb=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ffb,0x1ed));var _0xb5ff=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5ffb[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports[_0xb5ff('0x0')]=function(_0x721b6a){return client[_0xb5ff('0x1')](_0xb5ff('0x2'),{'body':_0x721b6a,'log':_0xb5ff('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 635184f..b6dd377 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 _0x7069=['User','Agents','online','../client','getWhatsappQueues','GetWhatsappQueue','name','timeout'];(function(_0x37c820,_0x5667dc){var _0x234312=function(_0x1462d){while(--_0x1462d){_0x37c820['push'](_0x37c820['shift']());}};_0x234312(++_0x5667dc);}(_0x7069,0x1a3));var _0x9706=function(_0x4ca95f,_0x33ea2b){_0x4ca95f=_0x4ca95f-0x0;var _0xb2f0ac=_0x7069[_0x4ca95f];return _0xb2f0ac;};'use strict';var client=require(_0x9706('0x0'));exports[_0x9706('0x1')]=function(){return function(){return client['Request'](_0x9706('0x2'),{'options':{'raw':![],'attributes':['id',_0x9706('0x3'),_0x9706('0x4'),'strategy'],'include':[{'model':_0x9706('0x5'),'as':_0x9706('0x6'),'attributes':['id','name',_0x9706('0x7'),'whatsappPause']}]},'log':_0x9706('0x1')});};}; \ No newline at end of file +var _0xe1bc=['getWhatsappQueues','name','timeout','User','Agents','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe1bc,0xc5));var _0xce1b=function(_0xefc4eb,_0x519792){_0xefc4eb=_0xefc4eb-0x0;var _0x253d31=_0xe1bc[_0xefc4eb];return _0x253d31;};'use strict';var client=require(_0xce1b('0x0'));exports[_0xce1b('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xce1b('0x2'),_0xce1b('0x3'),'strategy'],'include':[{'model':_0xce1b('0x4'),'as':_0xce1b('0x5'),'attributes':['id',_0xce1b('0x2'),'online','whatsappPause']}]},'log':_0xce1b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7f85e3e..3996ae8 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 _0xfba5=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x5e4cb8,_0x431e82){var _0x323bbe=function(_0x2f756a){while(--_0x2f756a){_0x5e4cb8['push'](_0x5e4cb8['shift']());}};_0x323bbe(++_0x431e82);}(_0xfba5,0xbd));var _0x5fba=function(_0x9ad32c,_0x852bef){_0x9ad32c=_0x9ad32c-0x0;var _0x45f700=_0xfba5[_0x9ad32c];return _0x45f700;};'use strict';var client=require(_0x5fba('0x0'));exports[_0x5fba('0x1')]=function(_0x5771ab){return client[_0x5fba('0x2')]('CreateWhatsappQueueReport',{'body':_0x5771ab,'log':_0x5fba('0x3')});};exports[_0x5fba('0x4')]=function(_0x3a5392,_0x62f533){return client[_0x5fba('0x2')](_0x5fba('0x5'),{'body':_0x62f533,'options':{'where':{'uniqueid':_0x3a5392},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xf7cf=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf7cf,0x1e0));var _0xff7c=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0xf7cf[_0x23e33d];return _0x818fc;};'use strict';var client=require(_0xff7c('0x0'));exports[_0xff7c('0x1')]=function(_0x4fb88c){return client[_0xff7c('0x2')]('CreateWhatsappQueueReport',{'body':_0x4fb88c,'log':_0xff7c('0x3')});};exports[_0xff7c('0x4')]=function(_0x3a11c1,_0x220df7){return client[_0xff7c('0x2')](_0xff7c('0x5'),{'body':_0x220df7,'options':{'where':{'uniqueid':_0x3a11c1},'order':[['id',_0xff7c('0x6')]],'limit':0x1},'log':_0xff7c('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 00e3eb8..5708e8f 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 _0xbfcf=['toLowerCase','consequence','length','error','map','message','join','stop','find','agents','atimeout','channel','format','START:%s','rules','close','complete','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x5b8cb6,_0x41036a){var _0x461932=function(_0x62141c){while(--_0x62141c){_0x5b8cb6['push'](_0x5b8cb6['shift']());}};_0x461932(++_0x41036a);}(_0xbfcf,0x183));var _0xfbfc=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0xbfcf[_0x3fc97b];return _0x3a0c82;};'use strict';var schema=require(_0xfbfc('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xfbfc('0x1'))('routing');var strategy=require(_0xfbfc('0x2'));var queue=schema({'name':{'type':_0xfbfc('0x3'),'required':!![],'message':_0xfbfc('0x4')},'timeout':{'type':_0xfbfc('0x5'),'message':_0xfbfc('0x6')}});function writeLog(_0x537c22,_0x16e15e,_0x1b63e8){return logger['info'](util['format'](_0xfbfc('0x7'),_0x537c22,_0x16e15e[_0xfbfc('0x8')],_0x1b63e8));}function handleFindAgent(_0x5e6898){return function(_0x501ba5){return _0x501ba5['name'][_0xfbfc('0x9')]()===_0x5e6898[_0xfbfc('0x9')]();};}exports[_0xfbfc('0xa')]=function(_0x21394f,_0x418741,_0x10ebcd,_0x4a7554){return function(_0x40f4fc){try{var _0x27a462={'name':_0x418741[0x0],'timeout':_0x418741[0x1]};var _0x129fc4=queue['validate'](_0x27a462,{'typecast':!![]});if(_0x129fc4[_0xfbfc('0xb')]){logger[_0xfbfc('0xc')]('[%s][AGENT]\x20%s',_0x21394f,_[_0xfbfc('0xd')](_0x129fc4,_0xfbfc('0xe'))[_0xfbfc('0xf')](',\x20'));_0x40f4fc[_0xfbfc('0x10')]();}else{var _0x2cc61f=_[_0xfbfc('0x11')](_0x10ebcd[_0xfbfc('0x12')],handleFindAgent(_0x27a462['name']));if(_0x2cc61f){var _0x279905=(_0x27a462['timeout']||0xa)*0x3e8;var _0x3ccbe7,_0x3bce84;var _0x591966=seqqueue['createQueue'](_0x279905);_0x591966['id']=_0x21394f;_0x591966[_0xfbfc('0x13')]=_0x279905;_0x591966[_0xfbfc('0x14')]=_0x4a7554['channel'];writeLog(_0x21394f,_0x2cc61f,util[_0xfbfc('0x15')](_0xfbfc('0x16'),_0x279905));_0x10ebcd[_0xfbfc('0x17')][_0x21394f]['on']('end',function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x21394f);clearTimeout(_0x3bce84);_0x3bce84=undefined;_0x591966[_0xfbfc('0x18')]();if(_0x10ebcd[_0xfbfc('0x17')][_0x21394f]){delete _0x10ebcd['rules'][_0x21394f];}_0x40f4fc[_0xfbfc('0x10')]();});_0x10ebcd[_0xfbfc('0x17')][_0x21394f]['on'](_0xfbfc('0x19'),function(){if(_0x10ebcd[_0xfbfc('0x17')][_0x21394f]){delete _0x10ebcd[_0xfbfc('0x17')][_0x21394f];}});_0x3bce84=setTimeout(function(){logger[_0xfbfc('0x1a')](_0xfbfc('0x1b'),_0x21394f);clearTimeout(_0x3bce84);_0x591966[_0xfbfc('0x18')]();_0x40f4fc[_0xfbfc('0x1c')]();},_0x279905);strategy[_0xfbfc('0x1d')](_0x591966,_0x2cc61f,_0x10ebcd,_0x4a7554);}else{logger[_0xfbfc('0xc')](_0xfbfc('0x1e'),_0x21394f,_0x27a462[_0xfbfc('0x8')]);_0x40f4fc[_0xfbfc('0x10')]();}}}catch(_0x413852){console['log'](_0x413852);logger[_0xfbfc('0xc')](_0xfbfc('0x1f'),_0x21394f,_0x413852[_0xfbfc('0x20')]);_0x40f4fc[_0xfbfc('0x10')]();}};}; \ No newline at end of file +var _0xcc6c=['length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','name','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xcc6c,0xd2));var _0xccc6=function(_0x119730,_0x1fbcbb){_0x119730=_0x119730-0x0;var _0x2d279c=_0xcc6c[_0x119730];return _0x2d279c;};'use strict';var schema=require(_0xccc6('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xccc6('0x1'));var logger=require(_0xccc6('0x2'))(_0xccc6('0x3'));var strategy=require(_0xccc6('0x4'));var queue=schema({'name':{'type':_0xccc6('0x5'),'required':!![],'message':_0xccc6('0x6')},'timeout':{'type':'number','message':_0xccc6('0x7')}});function writeLog(_0x5be9b9,_0x165b66,_0x18872b){return logger['info'](util[_0xccc6('0x8')](_0xccc6('0x9'),_0x5be9b9,_0x165b66['name'],_0x18872b));}function handleFindAgent(_0x11f957){return function(_0x2d58fb){return _0x2d58fb['name']['toLowerCase']()===_0x11f957[_0xccc6('0xa')]();};}exports[_0xccc6('0xb')]=function(_0x2acb09,_0x1735c3,_0x53fa01,_0x14c13b){return function(_0x44fcab){try{var _0x2f3366={'name':_0x1735c3[0x0],'timeout':_0x1735c3[0x1]};var _0x1f45ce=queue['validate'](_0x2f3366,{'typecast':!![]});if(_0x1f45ce[_0xccc6('0xc')]){logger[_0xccc6('0xd')](_0xccc6('0xe'),_0x2acb09,_[_0xccc6('0xf')](_0x1f45ce,_0xccc6('0x10'))[_0xccc6('0x11')](',\x20'));_0x44fcab[_0xccc6('0x12')]();}else{var _0x539b85=_[_0xccc6('0x13')](_0x53fa01[_0xccc6('0x14')],handleFindAgent(_0x2f3366[_0xccc6('0x15')]));if(_0x539b85){var _0x1eb3d9=(_0x2f3366[_0xccc6('0x16')]||0xa)*0x3e8;var _0x2b6e09,_0x423ac3;var _0x2b6d20=seqqueue['createQueue'](_0x1eb3d9);_0x2b6d20['id']=_0x2acb09;_0x2b6d20[_0xccc6('0x17')]=_0x1eb3d9;_0x2b6d20[_0xccc6('0x18')]=_0x14c13b[_0xccc6('0x18')];writeLog(_0x2acb09,_0x539b85,util['format'](_0xccc6('0x19'),_0x1eb3d9));_0x53fa01[_0xccc6('0x1a')][_0x2acb09]['on'](_0xccc6('0x1b'),function(){logger['info'](_0xccc6('0x1c'),_0x2acb09);clearTimeout(_0x423ac3);_0x423ac3=undefined;_0x2b6d20[_0xccc6('0x1d')]();if(_0x53fa01[_0xccc6('0x1a')][_0x2acb09]){delete _0x53fa01[_0xccc6('0x1a')][_0x2acb09];}_0x44fcab[_0xccc6('0x12')]();});_0x53fa01[_0xccc6('0x1a')][_0x2acb09]['on']('complete',function(){if(_0x53fa01['rules'][_0x2acb09]){delete _0x53fa01[_0xccc6('0x1a')][_0x2acb09];}});_0x423ac3=setTimeout(function(){logger[_0xccc6('0x1e')](_0xccc6('0x1f'),_0x2acb09);clearTimeout(_0x423ac3);_0x2b6d20['close']();_0x44fcab[_0xccc6('0x20')]();},_0x1eb3d9);strategy[_0xccc6('0x21')](_0x2b6d20,_0x539b85,_0x53fa01,_0x14c13b);}else{logger['error'](_0xccc6('0x22'),_0x2acb09,_0x2f3366['name']);_0x44fcab[_0xccc6('0x12')]();}}}catch(_0x4b0a85){console[_0xccc6('0x23')](_0x4b0a85);logger['error']('[%s][QUEUE]\x20%s',_0x2acb09,_0x4b0a85[_0xccc6('0x24')]);_0x44fcab[_0xccc6('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 0507fdc..a66e00a 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 _0x0d35=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','postText','message','amazonlex','providerResponse','stringify','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','Message','then','[%s][AMAZONLEX]\x20%s','catch','error','finally','stop'];(function(_0xacaf51,_0x1f4d4d){var _0x14cfac=function(_0x41a3fd){while(--_0x41a3fd){_0xacaf51['push'](_0xacaf51['shift']());}};_0x14cfac(++_0x1f4d4d);}(_0x0d35,0x196));var _0x50d3=function(_0x437c69,_0x14b6e1){_0x437c69=_0x437c69-0x0;var _0x8ad84d=_0x0d35[_0x437c69];return _0x8ad84d;};'use strict';var _=require('lodash');var moment=require(_0x50d3('0x0'));var AWS=require(_0x50d3('0x1'));var utils=require(_0x50d3('0x2'));var logger=require(_0x50d3('0x3'))(_0x50d3('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x50d3('0x5')),'mailMessage':require(_0x50d3('0x6')),'smsMessage':require(_0x50d3('0x7')),'faxMessage':require(_0x50d3('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x1ea598,_0x2a5f74){return function(_0x3562af){try{if(!_['isNil'](this[_0x50d3('0x9')]['UserId'])){logger[_0x50d3('0xa')]('[%s][AMAZONLEX]\x20%s',_0x1ea598,_0x50d3('0xb'));return _0x3562af[_0x50d3('0xc')]();}var _0x2ee1e0={'ContactId':this[_0x50d3('0xd')]['id'],'sentAt':moment()[_0x50d3('0xe')](_0x50d3('0xf')),'direction':_0x50d3('0x10')};if(this[_0x50d3('0x11')]==='sms'||this[_0x50d3('0x11')]===_0x50d3('0x12')){_0x2ee1e0[_0x50d3('0x13')]=this[_0x50d3('0x9')][_0x50d3('0x13')];}var _0x2b2116=this[_0x50d3('0x11')];if(_0x2b2116===_0x50d3('0x14')){_0x2ee1e0['ChatWebsiteId']=this[_0x50d3('0x15')]['id'];}else{_0x2ee1e0[_[_0x50d3('0x16')](_0x2b2116)+'AccountId']=this[_0x50d3('0x15')]['id'];}_0x2ee1e0[_[_0x50d3('0x16')](_0x2b2116)+_0x50d3('0x17')]=this[_0x50d3('0x9')]['id'];if(this['interaction'][_0x50d3('0x18')]){var _0x5ddc37=_0x2a5f74[0x4];if(!_[_0x50d3('0x19')](_0x5ddc37)){_0x2ee1e0[_0x50d3('0x1a')]=utils['getMustacheRender'](_0x5ddc37,this);return rpc[_0x2b2116+_0x50d3('0x1b')]['create'](_0x2ee1e0)[_0x50d3('0x1c')](function(_0x355cd1){logger[_0x50d3('0xa')](_0x50d3('0x1d'),_0x1ea598,_0x2ee1e0[_0x50d3('0x1a')]);})[_0x50d3('0x1e')](function(_0x11045d){logger[_0x50d3('0x1f')](_0x50d3('0x1d'),_0x1ea598,JSON['stringify'](_0x11045d));})[_0x50d3('0x20')](function(){logger[_0x50d3('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1ea598);_0x3562af[_0x50d3('0x21')]();});}else{logger['info'](_0x50d3('0x22'),_0x1ea598);_0x3562af[_0x50d3('0x21')]();}}else{var _0x254491=this;var _0x27574b=new AWS[(_0x50d3('0x23'))]({'accessKeyId':_0x2a5f74[0x0],'secretAccessKey':_0x2a5f74[0x1],'region':_0x2a5f74[0x2]});var _0x145b28={'botAlias':'$LATEST','botName':_0x2a5f74[0x3],'inputText':this['message'][_0x50d3('0x1a')],'userId':this['channel']+':'+this[_0x50d3('0x9')]['id'][_0x50d3('0x24')]()};_0x27574b[_0x50d3('0x25')](_0x145b28,function(_0x373cd8,_0x15e122){if(_0x373cd8){logger[_0x50d3('0x1f')](_0x50d3('0x1d'),_0x1ea598,_0x373cd8[_0x50d3('0x26')]);_0x3562af[_0x50d3('0xc')]();}else if(_0x15e122&&_0x15e122[_0x50d3('0x26')]){_0x254491['body'][_0x50d3('0x27')]=_0x15e122;_0x2ee1e0[_0x50d3('0x1a')]=_0x15e122[_0x50d3('0x26')];_0x2ee1e0['providerName']=_0x50d3('0x27');_0x2ee1e0[_0x50d3('0x28')]=JSON[_0x50d3('0x29')](_0x15e122);return rpc[_0x2b2116+_0x50d3('0x1b')]['create'](_0x2ee1e0)[_0x50d3('0x1c')](function(_0x2829b0){logger['info'](_0x50d3('0x1d'),_0x1ea598,_0x2ee1e0[_0x50d3('0x1a')]);if(_0x15e122[_0x50d3('0x2a')]==_0x50d3('0x2b')){_0x3562af[_0x50d3('0xc')]();}else{_0x3562af['stop']();}})[_0x50d3('0x1e')](function(_0x458869){logger[_0x50d3('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x1ea598,JSON[_0x50d3('0x29')](_0x458869));_0x3562af[_0x50d3('0xc')]();});}else{_0x3562af[_0x50d3('0xc')]();}});}}catch(_0xbd44ac){logger[_0x50d3('0x1f')](_0x50d3('0x1d'),_0x1ea598,JSON[_0x50d3('0x29')](_0xbd44ac));_0x3562af[_0x50d3('0x21')]();}};}; \ No newline at end of file +var _0x5184=['Message','create','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','error','amazonlex','providerName','providerResponse','then','dialogState','Failed','moment','aws-sdk','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','body'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x5184,0xa0));var _0x4518=function(_0x12f540,_0x1e1aae){_0x12f540=_0x12f540-0x0;var _0x1f4220=_0x5184[_0x12f540];return _0x1f4220;};'use strict';var _=require('lodash');var moment=require(_0x4518('0x0'));var AWS=require(_0x4518('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x4518('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4518('0x3')),'smsMessage':require(_0x4518('0x4')),'faxMessage':require(_0x4518('0x5')),'whatsappMessage':require(_0x4518('0x6'))};exports[_0x4518('0x7')]=function(_0x238edc,_0x4c962f){return function(_0x23920c){try{if(!_[_0x4518('0x8')](this[_0x4518('0x9')][_0x4518('0xa')])){logger[_0x4518('0xb')](_0x4518('0xc'),_0x238edc,_0x4518('0xd'));return _0x23920c[_0x4518('0xe')]();}var _0x4f81fe={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x4518('0xf')),'direction':_0x4518('0x10')};if(this[_0x4518('0x11')]===_0x4518('0x12')||this[_0x4518('0x11')]===_0x4518('0x13')){_0x4f81fe[_0x4518('0x14')]=this['interaction'][_0x4518('0x14')];}var _0x16116f=this['channel'];if(_0x16116f===_0x4518('0x15')){_0x4f81fe[_0x4518('0x16')]=this['account']['id'];}else{_0x4f81fe[_[_0x4518('0x17')](_0x16116f)+'AccountId']=this['account']['id'];}_0x4f81fe[_[_0x4518('0x17')](_0x16116f)+_0x4518('0x18')]=this[_0x4518('0x9')]['id'];if(this[_0x4518('0x9')][_0x4518('0x19')]){var _0xd0249=_0x4c962f[0x4];if(!_[_0x4518('0x1a')](_0xd0249)){_0x4f81fe[_0x4518('0x1b')]=utils['getMustacheRender'](_0xd0249,this);return rpc[_0x16116f+_0x4518('0x1c')][_0x4518('0x1d')](_0x4f81fe)['then'](function(_0x1a5648){logger[_0x4518('0xb')]('[%s][AMAZONLEX]\x20%s',_0x238edc,_0x4f81fe[_0x4518('0x1b')]);})[_0x4518('0x1e')](function(_0x509873){logger['error'](_0x4518('0xc'),_0x238edc,JSON[_0x4518('0x1f')](_0x509873));})[_0x4518('0x20')](function(){logger[_0x4518('0xb')](_0x4518('0x21'),_0x238edc);_0x23920c[_0x4518('0x22')]();});}else{logger[_0x4518('0xb')](_0x4518('0x23'),_0x238edc);_0x23920c['stop']();}}else{var _0x56fd27=this;var _0x2c19fa=new AWS[(_0x4518('0x24'))]({'accessKeyId':_0x4c962f[0x0],'secretAccessKey':_0x4c962f[0x1],'region':_0x4c962f[0x2]});var _0x2b503f={'botAlias':_0x4518('0x25'),'botName':_0x4c962f[0x3],'inputText':this[_0x4518('0x26')][_0x4518('0x1b')],'userId':this['channel']+':'+this['interaction']['id']['toString']()};_0x2c19fa[_0x4518('0x27')](_0x2b503f,function(_0x58191b,_0x241b51){if(_0x58191b){logger[_0x4518('0x28')]('[%s][AMAZONLEX]\x20%s',_0x238edc,_0x58191b[_0x4518('0x26')]);_0x23920c[_0x4518('0xe')]();}else if(_0x241b51&&_0x241b51[_0x4518('0x26')]){_0x56fd27[_0x4518('0x1b')][_0x4518('0x29')]=_0x241b51;_0x4f81fe[_0x4518('0x1b')]=_0x241b51['message'];_0x4f81fe[_0x4518('0x2a')]=_0x4518('0x29');_0x4f81fe[_0x4518('0x2b')]=JSON['stringify'](_0x241b51);return rpc[_0x16116f+_0x4518('0x1c')][_0x4518('0x1d')](_0x4f81fe)[_0x4518('0x2c')](function(_0x423d67){logger[_0x4518('0xb')](_0x4518('0xc'),_0x238edc,_0x4f81fe['body']);if(_0x241b51[_0x4518('0x2d')]==_0x4518('0x2e')){_0x23920c['next']();}else{_0x23920c[_0x4518('0x22')]();}})[_0x4518('0x1e')](function(_0x501e12){logger[_0x4518('0x28')](_0x4518('0xc'),_0x238edc,JSON[_0x4518('0x1f')](_0x501e12));_0x23920c[_0x4518('0xe')]();});}else{_0x23920c[_0x4518('0xe')]();}});}}catch(_0xb2bdd4){logger[_0x4518('0x28')]('[%s][AMAZONLEX]\x20%s',_0x238edc,JSON['stringify'](_0xb2bdd4));_0x23920c[_0x4518('0x22')]();}};}; \ 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 ad3c9f6..47f9581 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 _0xfd67=['create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','out','getMustacheRender','message','from','mail','phone','read','subject','Re:','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfd67,0x19e));var _0x7fd6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfd67[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7fd6('0x0'));var moment=require(_0x7fd6('0x1'));var utils=require(_0x7fd6('0x2'));var logger=require('../../../../config/logger')(_0x7fd6('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7fd6('0x4')),'mailMessage':require(_0x7fd6('0x5')),'smsMessage':require(_0x7fd6('0x6')),'faxMessage':require(_0x7fd6('0x7')),'whatsappMessage':require(_0x7fd6('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7fd6('0x9')),'mailInteraction':require(_0x7fd6('0xa')),'smsInteraction':require(_0x7fd6('0xb')),'faxInteraction':require(_0x7fd6('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x7fd6('0xd')]=function(_0x389cf8,_0x4b23c2,_0x2b8b06,_0x4c52f8){return function(_0x1a2364){try{var _0x27f5a3=this[_0x7fd6('0xe')];if(_0x27f5a3==='mail'&&_0x4c52f8[_0x7fd6('0xf')][_0x7fd6('0x10')]){logger[_0x7fd6('0x11')](_0x7fd6('0x12'),_0x389cf8,_0x7fd6('0x13'));return _0x1a2364[_0x7fd6('0x14')]();}if(_0x4b23c2[0x0]==='1'&&(_[_0x7fd6('0x15')](this[_0x7fd6('0x16')]['created'])||!this[_0x7fd6('0x16')][_0x7fd6('0x17')])){logger[_0x7fd6('0x11')](_0x7fd6('0x12'),_0x389cf8,_0x7fd6('0x18'));return _0x1a2364['next']();}if(_0x4b23c2[0x0]==='2'&&this[_0x7fd6('0x16')]['autoreplyExecuted']){logger[_0x7fd6('0x11')](_0x7fd6('0x19'),_0x389cf8,'One\x20Time\x20already\x20sent');return _0x1a2364[_0x7fd6('0x14')]();}var _0x327803={'ContactId':this[_0x7fd6('0x1a')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x7fd6('0x1b')};if(this[_0x7fd6('0xe')]==='mail'){_0x327803[_0x7fd6('0xf')]=utils[_0x7fd6('0x1c')](_0x4b23c2[0x2],this);}else{_0x327803[_0x7fd6('0xf')]=utils['getMustacheRender'](_0x4b23c2[0x1],this);}if(this[_0x7fd6('0x1d')]){_0x327803['to']=this['message'][_0x7fd6('0x1e')]||'';if(this['channel']===_0x7fd6('0x1f')&&_0x4b23c2[0x1]==='1'){_0x327803['cc']=this[_0x7fd6('0x1d')]['cc']||'';}_0x327803[_0x7fd6('0x1e')]=this[_0x7fd6('0x1d')]['to']||'';_0x327803[_0x7fd6('0x20')]=this[_0x7fd6('0x1d')][_0x7fd6('0x20')]||'';_0x327803[_0x7fd6('0x21')]=!![];if(this[_0x7fd6('0x1d')][_0x7fd6('0x22')]){_0x327803[_0x7fd6('0x22')]='';_0x327803[_0x7fd6('0x22')]+=_['startsWith'](this[_0x7fd6('0x1d')][_0x7fd6('0x22')],_0x7fd6('0x23'))?'':'Re:\x20';_0x327803['subject']+=this[_0x7fd6('0x1d')][_0x7fd6('0x22')];}}if(this[_0x7fd6('0xe')]==='chat'){_0x327803[_0x7fd6('0x24')]=this['account']['id'];}else{_0x327803[_[_0x7fd6('0x25')](this['channel'])+_0x7fd6('0x26')]=this[_0x7fd6('0x27')]['id'];}_0x327803[_[_0x7fd6('0x25')](this[_0x7fd6('0xe')])+_0x7fd6('0x28')]=this[_0x7fd6('0x16')]['id'];var _0x39e3b2=this[_0x7fd6('0x16')];if(rpc[this[_0x7fd6('0xe')]+'Message']){if(this['channel']==='mail'){_0x327803[_0x7fd6('0x29')]=this[_0x7fd6('0x1d')][_0x7fd6('0x2a')];_0x327803[_0x7fd6('0x2b')]=_0x7fd6('0x2c')+_[_0x7fd6('0x2d')](_0x327803['body'],_0x7fd6('0x2e'),'','replace','';_0x50bb08[_0xc490('0x32')]={'Auto-Submitted':_0xc490('0x33'),'X-Auto-Response-Suppress':_0xc490('0x34'),'Precedence':'auto_reply'};return mailRpc[_0xc490('0x35')](this[_0xc490('0x29')][_0xc490('0x36')],_0x50bb08)[_0xc490('0x37')](function(_0x526023){logger[_0xc490('0x1b')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x140d3e);_0x50bb08[_0xc490('0x2c')]=_0x526023[_0xc490('0x20')]['messageId'];return rpc[_0x283bc2+_0xc490('0x38')]['create'](_0x50bb08);})['then'](function(_0x5b96a3){logger['info'](_0xc490('0x13'),_0x140d3e,JSON[_0xc490('0x39')](_0x5b96a3));})['catch'](function(_0x345428){logger['error'](_0xc490('0x3a'),_0x140d3e,JSON[_0xc490('0x39')](_0x345428));})[_0xc490('0x3b')](function(){Promise[_0xc490('0x3c')]()['then'](function(){if(_0x3574df[0x0]!=='2'||_0x9a201[_0xc490('0x1a')])return;return rpc[_0x283bc2+_0xc490('0x3d')][_0xc490('0x3e')](_0x9a201['id'],{'autoreplyExecuted':!![]})[_0xc490('0x37')](function(_0x17a60b){logger[_0xc490('0x1b')](_0xc490('0x3f'),_0x140d3e,JSON[_0xc490('0x39')](_0x17a60b));})['catch'](function(_0x441d55){logger[_0xc490('0x40')](_0xc490('0x41'),_0x140d3e,JSON[_0xc490('0x39')](_0x441d55));});})[_0xc490('0x37')](function(){_0x4b95f2[_0xc490('0x15')]();});});}else{return rpc[this[_0xc490('0xf')]+_0xc490('0x38')]['create'](_0x50bb08)[_0xc490('0x37')](function(){logger['info']('[%s][AUTOREPLY]\x20%s',_0x140d3e,_0x50bb08['body']);})[_0xc490('0x42')](function(_0x422910){logger[_0xc490('0x40')](_0xc490('0x13'),_0x140d3e,JSON['stringify'](_0x422910));})[_0xc490('0x3b')](function(){Promise[_0xc490('0x3c')]()[_0xc490('0x37')](function(){if(_0x3574df[0x0]!=='2'||_0x9a201[_0xc490('0x1a')])return;return rpc[_0x283bc2+'Interaction']['update'](_0x9a201['id'],{'autoreplyExecuted':!![]})['then'](function(_0x2fe05e){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x140d3e,JSON[_0xc490('0x39')](_0x2fe05e));})['catch'](function(_0x1bf855){logger[_0xc490('0x40')](_0xc490('0x41'),_0x140d3e,JSON[_0xc490('0x39')](_0x1bf855));});})[_0xc490('0x37')](function(){_0x4b95f2[_0xc490('0x15')]();});});}}}catch(_0x439ef1){logger[_0xc490('0x40')]('[%s][AUTOREPLY]\x20%s',_0x140d3e,JSON[_0xc490('0x39')](_0x439ef1));_0x4b95f2['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 5863c82..9bc46ac 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 _0x1d63=['../../rpc/whatsappInteraction','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x1f4a62,_0x24192a){var _0x2a9fe7=function(_0x2c8e09){while(--_0x2c8e09){_0x1f4a62['push'](_0x1f4a62['shift']());}};_0x2a9fe7(++_0x24192a);}(_0x1d63,0x1ef));var _0x31d6=function(_0x46e87e,_0x443ddc){_0x46e87e=_0x46e87e-0x0;var _0x305433=_0x1d63[_0x46e87e];return _0x305433;};'use strict';var moment=require(_0x31d6('0x0'));var logger=require(_0x31d6('0x1'))('routing');var rpc={'chatInteraction':require(_0x31d6('0x2')),'openchannelInteraction':require(_0x31d6('0x3')),'smsInteraction':require(_0x31d6('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x31d6('0x5'))};exports['consequence']=function(_0x5c9c2d,_0x50b3d8,_0x1cc161,_0x3a473c){return function(_0x39e03c){try{logger[_0x31d6('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x5c9c2d,_0x50b3d8[0x0]);var _0x3ad202={'closed':0x1,'closedAt':moment()[_0x31d6('0x7')](_0x31d6('0x8')),'closeReason':_0x31d6('0x9'),'disposition':_0x50b3d8[0x0]};if(rpc[_0x3a473c[_0x31d6('0xa')]+_0x31d6('0xb')]){rpc[_0x3a473c[_0x31d6('0xa')]+_0x31d6('0xb')][_0x31d6('0xc')](_0x3a473c['interaction']['id'],_0x3ad202)[_0x31d6('0xd')](function(_0x104c22){logger[_0x31d6('0x6')](_0x31d6('0xe'),_0x5c9c2d,_0x3a473c['interaction']['id']);})[_0x31d6('0xf')](function(_0x1e45c2){logger['error'](_0x31d6('0x10'),_0x5c9c2d,JSON[_0x31d6('0x11')](_0x1e45c2));})[_0x31d6('0x12')](function(){_0x39e03c[_0x31d6('0x13')]();});}}catch(_0x4b7b74){logger['error'](_0x31d6('0x10'),_0x5c9c2d,JSON[_0x31d6('0x11')](_0x4b7b74));_0x39e03c[_0x31d6('0x13')]();}};}; \ No newline at end of file +var _0x1532=['../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','finally','stringify','moment','../../../../config/logger','routing','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x1ddce6,_0x904c3d){var _0x51c67c=function(_0x2e3ecc){while(--_0x2e3ecc){_0x1ddce6['push'](_0x1ddce6['shift']());}};_0x51c67c(++_0x904c3d);}(_0x1532,0x10c));var _0x2153=function(_0x5436a5,_0x2fba63){_0x5436a5=_0x5436a5-0x0;var _0x357b95=_0x1532[_0x5436a5];return _0x357b95;};'use strict';var moment=require(_0x2153('0x0'));var logger=require(_0x2153('0x1'))(_0x2153('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x2153('0x3')),'mailInteraction':require(_0x2153('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2153('0x5'))};exports[_0x2153('0x6')]=function(_0x5008ff,_0x5b0adb,_0x17cd07,_0x26e0f9){return function(_0x522738){try{logger[_0x2153('0x7')](_0x2153('0x8'),_0x5008ff,_0x5b0adb[0x0]);var _0x4553d1={'closed':0x1,'closedAt':moment()[_0x2153('0x9')](_0x2153('0xa')),'closeReason':'system','disposition':_0x5b0adb[0x0]};if(rpc[_0x26e0f9[_0x2153('0xb')]+'Interaction']){rpc[_0x26e0f9[_0x2153('0xb')]+_0x2153('0xc')][_0x2153('0xd')](_0x26e0f9[_0x2153('0xe')]['id'],_0x4553d1)[_0x2153('0xf')](function(_0x1c9451){logger[_0x2153('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5008ff,_0x26e0f9[_0x2153('0xe')]['id']);})[_0x2153('0x10')](function(_0x200a39){logger[_0x2153('0x11')](_0x2153('0x12'),_0x5008ff,JSON['stringify'](_0x200a39));})[_0x2153('0x13')](function(){_0x522738['stop']();});}}catch(_0x1ce58d){logger[_0x2153('0x11')]('[%s][CLOSE]\x20%s',_0x5008ff,JSON[_0x2153('0x14')](_0x1ce58d));_0x522738['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 4590ec1..fe929f8 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 _0xbb61=['account','upperFirst','AccountId','created','isEmpty','getMustacheRender','Message','create','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','body','result','fulfillment','providerName','dialogflow','providerResponse','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','phone','channel','chat','ChatWebsiteId'];(function(_0x248c90,_0x1ed333){var _0x449036=function(_0x54ed08){while(--_0x54ed08){_0x248c90['push'](_0x248c90['shift']());}};_0x449036(++_0x1ed333);}(_0xbb61,0x131));var _0x1bb6=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xbb61[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x1bb6('0x0'));var moment=require('moment');var apiai=require(_0x1bb6('0x1'));var md5=require(_0x1bb6('0x2'));var utils=require(_0x1bb6('0x3'));var logger=require(_0x1bb6('0x4'))(_0x1bb6('0x5'));var rpc={'chatMessage':require(_0x1bb6('0x6')),'openchannelMessage':require(_0x1bb6('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1bb6('0x8')),'faxMessage':require(_0x1bb6('0x9')),'whatsappMessage':require(_0x1bb6('0xa'))};exports['consequence']=function(_0x362383,_0x4629d0){return function(_0x24d6b9){try{if(!_['isNil'](this[_0x1bb6('0xb')][_0x1bb6('0xc')])){logger[_0x1bb6('0xd')](_0x1bb6('0xe'),_0x362383,_0x1bb6('0xf'));return _0x24d6b9[_0x1bb6('0x10')]();}var _0x5c8d00={'ContactId':this[_0x1bb6('0x11')]['id'],'sentAt':moment()[_0x1bb6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1bb6('0x13')};if(this['channel']==='sms'||this['channel']==='whatsapp'){_0x5c8d00[_0x1bb6('0x14')]=this[_0x1bb6('0xb')]['phone'];}var _0x54bacc=this[_0x1bb6('0x15')];if(_0x54bacc===_0x1bb6('0x16')){_0x5c8d00[_0x1bb6('0x17')]=this[_0x1bb6('0x18')]['id'];}else{_0x5c8d00[_[_0x1bb6('0x19')](_0x54bacc)+_0x1bb6('0x1a')]=this[_0x1bb6('0x18')]['id'];}_0x5c8d00[_[_0x1bb6('0x19')](_0x54bacc)+'InteractionId']=this[_0x1bb6('0xb')]['id'];if(this[_0x1bb6('0xb')][_0x1bb6('0x1b')]){var _0x2fce2f=_0x4629d0[0x2];if(!_[_0x1bb6('0x1c')](_0x2fce2f)){_0x5c8d00['body']=utils[_0x1bb6('0x1d')](_0x2fce2f,this);return rpc[_0x54bacc+_0x1bb6('0x1e')][_0x1bb6('0x1f')](_0x5c8d00)['then'](function(_0x2233a3){logger['info'](_0x1bb6('0xe'),_0x362383,_0x5c8d00['body']);})[_0x1bb6('0x20')](function(_0xdd0546){logger[_0x1bb6('0x21')](_0x1bb6('0xe'),_0x362383,JSON[_0x1bb6('0x22')](_0xdd0546));})[_0x1bb6('0x23')](function(){logger[_0x1bb6('0xd')](_0x1bb6('0x24'),_0x362383);_0x24d6b9[_0x1bb6('0x25')]();});}else{logger['info'](_0x1bb6('0x26'),_0x362383);_0x24d6b9[_0x1bb6('0x25')]();}}else{var _0x52b6e9=this;var _0x194fa0=apiai(_0x4629d0[0x0],{'language':_0x4629d0[0x1]||'en'});return _0x194fa0[_0x1bb6('0x27')](this[_0x1bb6('0x28')][_0x1bb6('0x29')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x5e1eb1){_0x52b6e9['body']['dialogflow']=_0x5e1eb1;_0x5c8d00[_0x1bb6('0x29')]=_0x5e1eb1[_0x1bb6('0x2a')][_0x1bb6('0x2b')]['speech'];_0x5c8d00[_0x1bb6('0x2c')]=_0x1bb6('0x2d');_0x5c8d00[_0x1bb6('0x2e')]=JSON[_0x1bb6('0x22')](_0x5e1eb1);return rpc[_0x54bacc+_0x1bb6('0x1e')]['create'](_0x5c8d00)['then'](function(_0x556672){logger[_0x1bb6('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x362383,_0x5c8d00['body']);if(_0x5e1eb1[_0x1bb6('0x2a')]['metadata']['endConversation']){_0x24d6b9[_0x1bb6('0x10')]();}else{_0x24d6b9[_0x1bb6('0x25')]();}})[_0x1bb6('0x20')](function(_0x108bdf){logger['error'](_0x1bb6('0xe'),_0x362383,JSON[_0x1bb6('0x22')](_0x108bdf));_0x24d6b9['next']();});})[_0x1bb6('0x20')](function(_0x17bdf8){logger[_0x1bb6('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x362383,_0x17bdf8[_0x1bb6('0x28')]);_0x24d6b9[_0x1bb6('0x10')]();});}}catch(_0x30d0ad){logger[_0x1bb6('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x362383,JSON[_0x1bb6('0x22')](_0x30d0ad));_0x24d6b9[_0x1bb6('0x25')]();}};}; \ No newline at end of file +var _0x044a=['body','result','fulfillment','providerName','dialogflow','metadata','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','phone','channel','chat','ChatWebsiteId','upperFirst','account','InteractionId','isEmpty','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','info','textRequest','message'];(function(_0x47e455,_0x867aae){var _0x5214ae=function(_0x4b1d7b){while(--_0x4b1d7b){_0x47e455['push'](_0x47e455['shift']());}};_0x5214ae(++_0x867aae);}(_0x044a,0x173));var _0xa044=function(_0x4a0bf0,_0x2de070){_0x4a0bf0=_0x4a0bf0-0x0;var _0xd52f61=_0x044a[_0x4a0bf0];return _0xd52f61;};'use strict';var _=require(_0xa044('0x0'));var moment=require(_0xa044('0x1'));var apiai=require(_0xa044('0x2'));var md5=require(_0xa044('0x3'));var utils=require(_0xa044('0x4'));var logger=require(_0xa044('0x5'))(_0xa044('0x6'));var rpc={'chatMessage':require(_0xa044('0x7')),'openchannelMessage':require(_0xa044('0x8')),'mailMessage':require(_0xa044('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa044('0xa')),'whatsappMessage':require(_0xa044('0xb'))};exports[_0xa044('0xc')]=function(_0x1c04bb,_0x59b81b){return function(_0xe12f7d){try{if(!_[_0xa044('0xd')](this[_0xa044('0xe')][_0xa044('0xf')])){logger['info'](_0xa044('0x10'),_0x1c04bb,_0xa044('0x11'));return _0xe12f7d[_0xa044('0x12')]();}var _0x47a9dc={'ContactId':this[_0xa044('0x13')]['id'],'sentAt':moment()[_0xa044('0x14')](_0xa044('0x15')),'direction':_0xa044('0x16')};if(this['channel']===_0xa044('0x17')||this['channel']==='whatsapp'){_0x47a9dc[_0xa044('0x18')]=this[_0xa044('0xe')][_0xa044('0x18')];}var _0x344c7d=this[_0xa044('0x19')];if(_0x344c7d===_0xa044('0x1a')){_0x47a9dc[_0xa044('0x1b')]=this['account']['id'];}else{_0x47a9dc[_[_0xa044('0x1c')](_0x344c7d)+'AccountId']=this[_0xa044('0x1d')]['id'];}_0x47a9dc[_[_0xa044('0x1c')](_0x344c7d)+_0xa044('0x1e')]=this[_0xa044('0xe')]['id'];if(this[_0xa044('0xe')]['created']){var _0x516c34=_0x59b81b[0x2];if(!_[_0xa044('0x1f')](_0x516c34)){_0x47a9dc['body']=utils[_0xa044('0x20')](_0x516c34,this);return rpc[_0x344c7d+_0xa044('0x21')][_0xa044('0x22')](_0x47a9dc)[_0xa044('0x23')](function(_0x3ccbd3){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x1c04bb,_0x47a9dc['body']);})[_0xa044('0x24')](function(_0x417cbb){logger[_0xa044('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x1c04bb,JSON[_0xa044('0x26')](_0x417cbb));})[_0xa044('0x27')](function(){logger['info'](_0xa044('0x28'),_0x1c04bb);_0xe12f7d[_0xa044('0x29')]();});}else{logger[_0xa044('0x2a')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1c04bb);_0xe12f7d[_0xa044('0x29')]();}}else{var _0x966548=this;var _0x26747b=apiai(_0x59b81b[0x0],{'language':_0x59b81b[0x1]||'en'});return _0x26747b[_0xa044('0x2b')](this[_0xa044('0x2c')][_0xa044('0x2d')],{'sessionId':md5(this[_0xa044('0xe')]['id'])})[_0xa044('0x23')](function(_0x36c237){_0x966548['body']['dialogflow']=_0x36c237;_0x47a9dc[_0xa044('0x2d')]=_0x36c237[_0xa044('0x2e')][_0xa044('0x2f')]['speech'];_0x47a9dc[_0xa044('0x30')]=_0xa044('0x31');_0x47a9dc['providerResponse']=JSON[_0xa044('0x26')](_0x36c237);return rpc[_0x344c7d+_0xa044('0x21')]['create'](_0x47a9dc)[_0xa044('0x23')](function(_0x2889c2){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x1c04bb,_0x47a9dc['body']);if(_0x36c237[_0xa044('0x2e')][_0xa044('0x32')][_0xa044('0x33')]){_0xe12f7d['next']();}else{_0xe12f7d[_0xa044('0x29')]();}})[_0xa044('0x24')](function(_0x485212){logger[_0xa044('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x1c04bb,JSON['stringify'](_0x485212));_0xe12f7d[_0xa044('0x12')]();});})['catch'](function(_0x30fd39){logger[_0xa044('0x25')](_0xa044('0x10'),_0x1c04bb,_0x30fd39[_0xa044('0x2c')]);_0xe12f7d[_0xa044('0x12')]();});}}catch(_0xf2d227){logger['error'](_0xa044('0x10'),_0x1c04bb,JSON[_0xa044('0x26')](_0xf2d227));_0xe12f7d[_0xa044('0x29')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index f5508a3..fc61959 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 _0xa5f9=['dialogflow','md5','bluebird','../../../../config/logger','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','providerName','providerResponse','push','fulfillmentText','lodash'];(function(_0x2e2fcd,_0x5c07da){var _0x236e96=function(_0x37f28d){while(--_0x37f28d){_0x2e2fcd['push'](_0x2e2fcd['shift']());}};_0x236e96(++_0x5c07da);}(_0xa5f9,0x1db));var _0x9a5f=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xa5f9[_0x3cb30b];return _0x2ca717;};'use strict';var _=require(_0x9a5f('0x0'));var dialogflow=require(_0x9a5f('0x1'));var md5=require(_0x9a5f('0x2'));var moment=require('moment');var Promise=require(_0x9a5f('0x3'));var logger=require(_0x9a5f('0x4'))('routing');var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9a5f('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9a5f('0x6')),'whatsappMessage':require(_0x9a5f('0x7'))};function createMessage(_0x105bf2,_0x148280,_0x5ba494,_0x5a0764){return new Promise(function(_0x79a56f,_0x4086fb){var _0x1f65e6=_[_0x9a5f('0x8')](_0x5ba494);_0x1f65e6['body']=_0x5a0764;return rpc[_0x148280+_0x9a5f('0x9')][_0x9a5f('0xa')](_0x1f65e6)[_0x9a5f('0xb')](function(){logger[_0x9a5f('0xc')](_0x9a5f('0xd'),_0x105bf2,_0x1f65e6[_0x9a5f('0xe')]);_0x79a56f();})[_0x9a5f('0xf')](function(_0x131e25){logger[_0x9a5f('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x105bf2,JSON[_0x9a5f('0x11')](_0x131e25));_0x4086fb(_0x131e25);});});}exports[_0x9a5f('0x12')]=function(_0x1c9b2a,_0x301873){return function(_0x221c0f){try{if(!_['isNil'](this[_0x9a5f('0x13')][_0x9a5f('0x14')])){logger[_0x9a5f('0xc')](_0x9a5f('0xd'),_0x1c9b2a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x221c0f[_0x9a5f('0x15')]();}var _0x47cf08={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9a5f('0x16')](_0x9a5f('0x17')),'direction':_0x9a5f('0x18')};if(this[_0x9a5f('0x19')]===_0x9a5f('0x1a')||this[_0x9a5f('0x19')]===_0x9a5f('0x1b')){_0x47cf08[_0x9a5f('0x1c')]=this[_0x9a5f('0x13')]['phone'];}var _0x4b0d94=this[_0x9a5f('0x19')];if(_0x4b0d94===_0x9a5f('0x1d')){_0x47cf08[_0x9a5f('0x1e')]=this['account']['id'];}else{_0x47cf08[_['upperFirst'](_0x4b0d94)+_0x9a5f('0x1f')]=this[_0x9a5f('0x20')]['id'];}_0x47cf08[_[_0x9a5f('0x21')](_0x4b0d94)+_0x9a5f('0x22')]=this[_0x9a5f('0x13')]['id'];if(this[_0x9a5f('0x13')][_0x9a5f('0x23')]){var _0x3f1b4d=_0x301873[0x4];if(!_['isEmpty'](_0x3f1b4d)){_0x47cf08[_0x9a5f('0xe')]=utils[_0x9a5f('0x24')](_0x3f1b4d,this);return rpc[_0x4b0d94+_0x9a5f('0x9')]['create'](_0x47cf08)[_0x9a5f('0xb')](function(_0x15c30f){logger['info'](_0x9a5f('0xd'),_0x1c9b2a,_0x47cf08[_0x9a5f('0xe')]);})['catch'](function(_0x377720){logger[_0x9a5f('0x10')](_0x9a5f('0xd'),_0x1c9b2a,JSON['stringify'](_0x377720));})[_0x9a5f('0x25')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1c9b2a);_0x221c0f['stop']();});}else{logger[_0x9a5f('0xc')](_0x9a5f('0x26'),_0x1c9b2a);_0x221c0f[_0x9a5f('0x27')]();}}else{var _0x56b2ac=this;var _0x1ba576=_0x301873[0x2]['replace'](/\\n/g,'\x0a');var _0x310dbd={'credentials':{'private_key':_0x1ba576,'client_email':_0x301873[0x1]}};var _0x4c27dd=new dialogflow[(_0x9a5f('0x28'))](_0x310dbd);var _0x5af61d=_0x4c27dd[_0x9a5f('0x29')](_0x301873[0x0],md5(_0x56b2ac[_0x9a5f('0x13')]['id']));var _0x4c0bbf={'session':_0x5af61d,'queryInput':{'text':{'text':_0x56b2ac[_0x9a5f('0x2a')][_0x9a5f('0xe')],'languageCode':_0x301873[0x3]||'en'}}};return _0x4c27dd[_0x9a5f('0x2b')](_0x4c0bbf)['then'](function(_0xaa5c66){if(_0xaa5c66&&_0xaa5c66[_0x9a5f('0x2c')]){_0x56b2ac[_0x9a5f('0xe')][_0x9a5f('0x2d')]=_0xaa5c66;var _0x567cb0=_0xaa5c66[0x0];var _0x25b1d6=_0x567cb0[_0x9a5f('0x2e')]['diagnosticInfo']&&_0x567cb0[_0x9a5f('0x2e')][_0x9a5f('0x2f')][_0x9a5f('0x30')]?_0x567cb0[_0x9a5f('0x2e')][_0x9a5f('0x2f')]['fields'][_0x9a5f('0x31')]['boolValue']:![];_0x56b2ac[_0x9a5f('0xe')][_0x9a5f('0x32')]=_0x567cb0['queryResult'][_0x9a5f('0x33')];_0x56b2ac[_0x9a5f('0xe')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x567cb0[_0x9a5f('0x2e')][_0x9a5f('0x34')];_0x56b2ac[_0x9a5f('0xe')][_0x9a5f('0x35')]=_0x567cb0['queryResult'][_0x9a5f('0x2f')]&&_0x567cb0['queryResult'][_0x9a5f('0x2f')][_0x9a5f('0x30')]?_0x567cb0['queryResult'][_0x9a5f('0x2f')]['fields'][_0x9a5f('0x31')][_0x9a5f('0x36')]:![];_0x56b2ac[_0x9a5f('0xe')][_0x9a5f('0x37')]=_0x567cb0[_0x9a5f('0x2e')][_0x9a5f('0x38')][_0x9a5f('0x39')];_0x56b2ac[_0x9a5f('0xe')][_0x9a5f('0x3a')]=_0x567cb0[_0x9a5f('0x2e')][_0x9a5f('0x38')][_0x9a5f('0x3b')];_0x56b2ac[_0x9a5f('0xe')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x567cb0[_0x9a5f('0x2e')]['intent'][_0x9a5f('0x3c')];_0x56b2ac[_0x9a5f('0xe')]['DIALOGFLOWV2_LANGUAGECODE']=_0x567cb0[_0x9a5f('0x2e')][_0x9a5f('0x3d')];_0x56b2ac[_0x9a5f('0xe')][_0x9a5f('0x3e')]=_0x567cb0[_0x9a5f('0x2e')][_0x9a5f('0x3f')];_0x56b2ac['body']['DIALOGFLOWV2_SCORE']=_0x567cb0[_0x9a5f('0x2e')]['intentDetectionConfidence'];_0x47cf08[_0x9a5f('0x40')]='dialogflowV2';_0x47cf08[_0x9a5f('0x41')]=JSON['stringify'](_0xaa5c66);var _0x37b565=[];for(var _0x36f5c2=0x0;_0x36f5c2<_0xaa5c66[_0x9a5f('0x2c')];_0x36f5c2++){var _0x2cfec5=_0xaa5c66[_0x36f5c2];if(_0x2cfec5&&_0x2cfec5[_0x9a5f('0x2e')]&&_0x2cfec5[_0x9a5f('0x2e')]['fulfillmentText']){_0x37b565[_0x9a5f('0x42')](createMessage(_0x1c9b2a,_0x4b0d94,_0x47cf08,_0x2cfec5['queryResult'][_0x9a5f('0x43')]));}}return Promise['all'](_0x37b565)[_0x9a5f('0xb')](function(){if(_0x25b1d6){_0x221c0f[_0x9a5f('0x15')]();}else{_0x221c0f[_0x9a5f('0x27')]();}})[_0x9a5f('0xf')](function(_0x3e4c76){logger[_0x9a5f('0x10')](_0x9a5f('0xd'),_0x1c9b2a,JSON[_0x9a5f('0x11')](_0x3e4c76));_0x221c0f[_0x9a5f('0x15')]();});}})['catch'](function(_0x4483f0){logger['error'](_0x9a5f('0xd'),_0x1c9b2a,_0x4483f0['message'],_0x4483f0['stack']);_0x221c0f[_0x9a5f('0x15')]();});}}catch(_0x274ba9){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1c9b2a,JSON[_0x9a5f('0x11')](_0x274ba9));_0x221c0f[_0x9a5f('0x27')]();}};}; \ No newline at end of file +var _0x0ba3=['bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','account','AccountId','upperFirst','created','isEmpty','body','getMustacheRender','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','length','fulfillmentText','next','stack','lodash','dialogflow','moment'];(function(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0x0ba3,0x105));var _0x30ba=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x0ba3[_0x3fe393];return _0x534d14;};'use strict';var _=require(_0x30ba('0x0'));var dialogflow=require(_0x30ba('0x1'));var md5=require('md5');var moment=require(_0x30ba('0x2'));var Promise=require(_0x30ba('0x3'));var logger=require(_0x30ba('0x4'))(_0x30ba('0x5'));var utils=require(_0x30ba('0x6'));var rpc={'chatMessage':require(_0x30ba('0x7')),'openchannelMessage':require(_0x30ba('0x8')),'mailMessage':require(_0x30ba('0x9')),'smsMessage':require(_0x30ba('0xa')),'faxMessage':require(_0x30ba('0xb')),'whatsappMessage':require(_0x30ba('0xc'))};function createMessage(_0x561975,_0x4cde18,_0xad3ad9,_0x5573f3){return new Promise(function(_0x17108f,_0x9f6c89){var _0x1ac407=_[_0x30ba('0xd')](_0xad3ad9);_0x1ac407['body']=_0x5573f3;return rpc[_0x4cde18+_0x30ba('0xe')][_0x30ba('0xf')](_0x1ac407)[_0x30ba('0x10')](function(){logger[_0x30ba('0x11')](_0x30ba('0x12'),_0x561975,_0x1ac407['body']);_0x17108f();})[_0x30ba('0x13')](function(_0x1b9f54){logger[_0x30ba('0x14')](_0x30ba('0x12'),_0x561975,JSON['stringify'](_0x1b9f54));_0x9f6c89(_0x1b9f54);});});}exports['consequence']=function(_0xa21927,_0x57c64d){return function(_0x13fb75){try{if(!_['isNil'](this[_0x30ba('0x15')][_0x30ba('0x16')])){logger[_0x30ba('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0xa21927,_0x30ba('0x17'));return _0x13fb75['next']();}var _0x19b312={'ContactId':this[_0x30ba('0x18')]['id'],'sentAt':moment()[_0x30ba('0x19')](_0x30ba('0x1a')),'direction':'out'};if(this[_0x30ba('0x1b')]==='sms'||this[_0x30ba('0x1b')]==='whatsapp'){_0x19b312[_0x30ba('0x1c')]=this[_0x30ba('0x15')][_0x30ba('0x1c')];}var _0x21b18e=this[_0x30ba('0x1b')];if(_0x21b18e==='chat'){_0x19b312['ChatWebsiteId']=this[_0x30ba('0x1d')]['id'];}else{_0x19b312[_['upperFirst'](_0x21b18e)+_0x30ba('0x1e')]=this[_0x30ba('0x1d')]['id'];}_0x19b312[_[_0x30ba('0x1f')](_0x21b18e)+'InteractionId']=this[_0x30ba('0x15')]['id'];if(this[_0x30ba('0x15')][_0x30ba('0x20')]){var _0x21a8b5=_0x57c64d[0x4];if(!_[_0x30ba('0x21')](_0x21a8b5)){_0x19b312[_0x30ba('0x22')]=utils[_0x30ba('0x23')](_0x21a8b5,this);return rpc[_0x21b18e+_0x30ba('0xe')]['create'](_0x19b312)[_0x30ba('0x10')](function(_0x131a3d){logger[_0x30ba('0x11')](_0x30ba('0x12'),_0xa21927,_0x19b312['body']);})['catch'](function(_0x529eb8){logger[_0x30ba('0x14')](_0x30ba('0x12'),_0xa21927,JSON[_0x30ba('0x24')](_0x529eb8));})[_0x30ba('0x25')](function(){logger[_0x30ba('0x11')](_0x30ba('0x26'),_0xa21927);_0x13fb75[_0x30ba('0x27')]();});}else{logger[_0x30ba('0x11')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xa21927);_0x13fb75[_0x30ba('0x27')]();}}else{var _0x394993=this;var _0x216d8f=_0x57c64d[0x2][_0x30ba('0x28')](/\\n/g,'\x0a');var _0x156846={'credentials':{'private_key':_0x216d8f,'client_email':_0x57c64d[0x1]}};var _0xbafc34=new dialogflow[(_0x30ba('0x29'))](_0x156846);var _0x515f6c=_0xbafc34['sessionPath'](_0x57c64d[0x0],md5(_0x394993[_0x30ba('0x15')]['id']));var _0xedde65={'session':_0x515f6c,'queryInput':{'text':{'text':_0x394993['message']['body'],'languageCode':_0x57c64d[0x3]||'en'}}};return _0xbafc34[_0x30ba('0x2a')](_0xedde65)[_0x30ba('0x10')](function(_0x23fda0){if(_0x23fda0&&_0x23fda0['length']){_0x394993['body'][_0x30ba('0x2b')]=_0x23fda0;var _0x3a232c=_0x23fda0[0x0];var _0x3dc116=_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x2d')]&&_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x2d')][_0x30ba('0x2e')]?_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x2d')][_0x30ba('0x2e')][_0x30ba('0x2f')][_0x30ba('0x30')]:![];_0x394993['body']['DIALOGFLOWV2_ACTION']=_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x31')];_0x394993[_0x30ba('0x22')][_0x30ba('0x32')]=_0x3a232c['queryResult']['allRequiredParamsPresent'];_0x394993[_0x30ba('0x22')][_0x30ba('0x33')]=_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x2d')]&&_0x3a232c[_0x30ba('0x2c')]['diagnosticInfo'][_0x30ba('0x2e')]?_0x3a232c[_0x30ba('0x2c')]['diagnosticInfo'][_0x30ba('0x2e')][_0x30ba('0x2f')][_0x30ba('0x30')]:![];_0x394993[_0x30ba('0x22')]['DIALOGFLOWV2_INTENTNAME']=_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x34')]['name'];_0x394993[_0x30ba('0x22')][_0x30ba('0x35')]=_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x34')]['displayName'];_0x394993[_0x30ba('0x22')][_0x30ba('0x36')]=_0x3a232c['queryResult'][_0x30ba('0x34')][_0x30ba('0x37')];_0x394993[_0x30ba('0x22')][_0x30ba('0x38')]=_0x3a232c['queryResult'][_0x30ba('0x39')];_0x394993[_0x30ba('0x22')][_0x30ba('0x3a')]=_0x3a232c[_0x30ba('0x2c')][_0x30ba('0x3b')];_0x394993[_0x30ba('0x22')][_0x30ba('0x3c')]=_0x3a232c[_0x30ba('0x2c')]['intentDetectionConfidence'];_0x19b312[_0x30ba('0x3d')]=_0x30ba('0x2b');_0x19b312['providerResponse']=JSON[_0x30ba('0x24')](_0x23fda0);var _0x268d6f=[];for(var _0x3676da=0x0;_0x3676da<_0x23fda0[_0x30ba('0x3e')];_0x3676da++){var _0x526e0e=_0x23fda0[_0x3676da];if(_0x526e0e&&_0x526e0e[_0x30ba('0x2c')]&&_0x526e0e[_0x30ba('0x2c')][_0x30ba('0x3f')]){_0x268d6f['push'](createMessage(_0xa21927,_0x21b18e,_0x19b312,_0x526e0e[_0x30ba('0x2c')][_0x30ba('0x3f')]));}}return Promise['all'](_0x268d6f)[_0x30ba('0x10')](function(){if(_0x3dc116){_0x13fb75[_0x30ba('0x40')]();}else{_0x13fb75[_0x30ba('0x27')]();}})['catch'](function(_0xb7e5c6){logger[_0x30ba('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0xa21927,JSON[_0x30ba('0x24')](_0xb7e5c6));_0x13fb75[_0x30ba('0x40')]();});}})[_0x30ba('0x13')](function(_0x39ceb1){logger[_0x30ba('0x14')](_0x30ba('0x12'),_0xa21927,_0x39ceb1['message'],_0x39ceb1[_0x30ba('0x41')]);_0x13fb75[_0x30ba('0x40')]();});}}catch(_0x19b46d){logger['error'](_0x30ba('0x12'),_0xa21927,JSON[_0x30ba('0x24')](_0x19b46d));_0x13fb75['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index b98aac8..a7cc73d 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 _0x1554=['consequence','getMustacheRender','error','[%s][GOTOIF]\x20%s','message','stop','condition','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1554,0x1d1));var _0x4155=function(_0x16b516,_0x4da0e3){_0x16b516=_0x16b516-0x0;var _0x2ce78a=_0x1554[_0x16b516];return _0x2ce78a;};'use strict';var schema=require('validate');var _=require(_0x4155('0x0'));var htmlToText=require(_0x4155('0x1'));var utils=require(_0x4155('0x2'));var logger=require(_0x4155('0x3'))(_0x4155('0x4'));var gotoif=schema({'condition':{'type':_0x4155('0x5'),'required':!![],'message':_0x4155('0x6')},'priorityTrue':{'type':_0x4155('0x7'),'message':_0x4155('0x8')},'priorityFalse':{'type':_0x4155('0x7'),'message':_0x4155('0x9')}});exports[_0x4155('0xa')]=function(_0x5e0c66,_0x5dd71a){return function(_0x4da0f5){try{var _0xaa4339={'condition':htmlToText['fromString'](utils[_0x4155('0xb')](_0x5dd71a[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5dd71a[0x1],'priorityFalse':_0x5dd71a[0x2]};var _0x2dae01=gotoif['validate'](_0xaa4339,{'typecast':!![]});if(_0x2dae01['length']){logger[_0x4155('0xc')](_0x4155('0xd'),_0x5e0c66,_['map'](_0x2dae01,_0x4155('0xe'))['join'](',\x20'));_0x4da0f5[_0x4155('0xf')]();}else{try{var _0x47771c=eval('('+_0xaa4339[_0x4155('0x10')]+')');var _0x2c27fd=_0x47771c?_0xaa4339['priorityTrue']:_0xaa4339[_0x4155('0x11')];logger['info'](_0x4155('0x12'),_0x5e0c66,_0xaa4339['condition'],_0x47771c,_0x2c27fd||_0x4155('0x13'));if(_0x2c27fd){var _0xf4b2db=_[_0x4155('0x14')](_0x4da0f5['rules'](),{'p':_0x2c27fd});if(_0xf4b2db>=0x0){logger[_0x4155('0x15')](_0x4155('0x16'),_0x5e0c66,_0x2c27fd||_0x4155('0x13'),_0xf4b2db);_0x4da0f5[_0x4155('0x13')](_0xf4b2db);}else{logger[_0x4155('0x15')](_0x4155('0x17'),_0x5e0c66,_0x2c27fd||'next');_0x4da0f5[_0x4155('0xf')]();}}else{_0x4da0f5['next']();}}catch(_0x5a9880){logger[_0x4155('0xc')](_0x4155('0x18'),_0x5e0c66,_0x5a9880['message']);_0x4da0f5['stop']();}}}catch(_0x2c1731){logger[_0x4155('0xc')](_0x4155('0xd'),_0x5e0c66,JSON['stringify'](_0x2c1731));_0x4da0f5[_0x4155('0xf')]();}};}; \ No newline at end of file +var _0xbeaf=['number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','error','[%s][GOTOIF]\x20%s','map','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing'];(function(_0x45b575,_0x49a05a){var _0x5bdfa2=function(_0x3b117c){while(--_0x3b117c){_0x45b575['push'](_0x45b575['shift']());}};_0x5bdfa2(++_0x49a05a);}(_0xbeaf,0x119));var _0xfbea=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xbeaf[_0x13d07a];return _0x5ee0ee;};'use strict';var schema=require('validate');var _=require(_0xfbea('0x0'));var htmlToText=require(_0xfbea('0x1'));var utils=require(_0xfbea('0x2'));var logger=require(_0xfbea('0x3'))(_0xfbea('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xfbea('0x5'),'message':_0xfbea('0x6')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xfbea('0x7')]=function(_0x2da2be,_0x5ead3c){return function(_0x4fd9f0){try{var _0x2d58a7={'condition':htmlToText[_0xfbea('0x8')](utils[_0xfbea('0x9')](_0x5ead3c[0x0],this),{'wordwrap':![]})[_0xfbea('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5ead3c[0x1],'priorityFalse':_0x5ead3c[0x2]};var _0x2e93f9=gotoif[_0xfbea('0xb')](_0x2d58a7,{'typecast':!![]});if(_0x2e93f9['length']){logger[_0xfbea('0xc')](_0xfbea('0xd'),_0x2da2be,_[_0xfbea('0xe')](_0x2e93f9,'message')['join'](',\x20'));_0x4fd9f0[_0xfbea('0xf')]();}else{try{var _0x1f3834=eval('('+_0x2d58a7[_0xfbea('0x10')]+')');var _0x208c57=_0x1f3834?_0x2d58a7['priorityTrue']:_0x2d58a7[_0xfbea('0x11')];logger[_0xfbea('0x12')](_0xfbea('0x13'),_0x2da2be,_0x2d58a7[_0xfbea('0x10')],_0x1f3834,_0x208c57||_0xfbea('0x14'));if(_0x208c57){var _0x5a2ec0=_[_0xfbea('0x15')](_0x4fd9f0['rules'](),{'p':_0x208c57});if(_0x5a2ec0>=0x0){logger[_0xfbea('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2da2be,_0x208c57||'next',_0x5a2ec0);_0x4fd9f0[_0xfbea('0x14')](_0x5a2ec0);}else{logger[_0xfbea('0x12')](_0xfbea('0x16'),_0x2da2be,_0x208c57||_0xfbea('0x14'));_0x4fd9f0[_0xfbea('0xf')]();}}else{_0x4fd9f0[_0xfbea('0x14')]();}}catch(_0x415de5){logger[_0xfbea('0xc')](_0xfbea('0x17'),_0x2da2be,_0x415de5[_0xfbea('0x18')]);_0x4fd9f0[_0xfbea('0xf')]();}}}catch(_0x4cdb0a){logger[_0xfbea('0xc')](_0xfbea('0xd'),_0x2da2be,JSON[_0xfbea('0x19')](_0x4cdb0a));_0x4fd9f0[_0xfbea('0xf')]();}};}; \ 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 96c6cc8..4941aca 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 _0xf141=['join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','map','message'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xf141,0x17d));var _0x1f14=function(_0x368016,_0x5b65ac){_0x368016=_0x368016-0x0;var _0x15ae43=_0xf141[_0x368016];return _0x15ae43;};'use strict';var schema=require(_0x1f14('0x0'));var _=require(_0x1f14('0x1'));var logger=require(_0x1f14('0x2'))(_0x1f14('0x3'));var gotop=schema({'priority':{'type':_0x1f14('0x4'),'required':!![],'message':_0x1f14('0x5')}});exports[_0x1f14('0x6')]=function(_0x3b978f,_0x38401b){return function(_0x11e379){try{var _0x43a97d={'priority':_0x38401b[0x0]};var _0x311c73=gotop[_0x1f14('0x0')](_0x43a97d,{'typecast':!![]});if(_0x311c73[_0x1f14('0x7')]){logger['error']('[%s][GOTOP]\x20%s',_0x3b978f,_[_0x1f14('0x8')](_0x311c73,_0x1f14('0x9'))[_0x1f14('0xa')](',\x20'));_0x11e379['stop']();}else{logger[_0x1f14('0xb')](_0x1f14('0xc'),_0x3b978f,_0x43a97d['priority']);if(_0x43a97d[_0x1f14('0xd')]){var _0x59b799=_[_0x1f14('0xe')](_0x11e379[_0x1f14('0xf')](),{'p':_0x43a97d[_0x1f14('0xd')]});if(_0x59b799>=0x0){logger[_0x1f14('0xb')](_0x1f14('0x10'),_0x3b978f,_0x43a97d['priority']||_0x1f14('0x11'),_0x59b799);_0x11e379[_0x1f14('0x11')](_0x59b799);}else{logger[_0x1f14('0xb')](_0x1f14('0x12'),_0x3b978f,_0x43a97d[_0x1f14('0xd')]||'next');_0x11e379[_0x1f14('0x13')]();}}else{_0x11e379[_0x1f14('0x11')]();}}}catch(_0x4a8e28){logger[_0x1f14('0x14')](_0x1f14('0x15'),_0x3b978f,JSON[_0x1f14('0x16')](_0x4a8e28));_0x11e379[_0x1f14('0x13')]();}};}; \ No newline at end of file +var _0x748c=['consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x9e5eec,_0x444242){var _0x5a5d60=function(_0x48b251){while(--_0x48b251){_0x9e5eec['push'](_0x9e5eec['shift']());}};_0x5a5d60(++_0x444242);}(_0x748c,0x150));var _0xc748=function(_0x179195,_0x1dcc71){_0x179195=_0x179195-0x0;var _0x3e0ab6=_0x748c[_0x179195];return _0x3e0ab6;};'use strict';var schema=require(_0xc748('0x0'));var _=require(_0xc748('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xc748('0x2'),'required':!![],'message':_0xc748('0x3')}});exports[_0xc748('0x4')]=function(_0x1da203,_0xe40ee9){return function(_0xf78c6e){try{var _0x1095b7={'priority':_0xe40ee9[0x0]};var _0x2a9062=gotop['validate'](_0x1095b7,{'typecast':!![]});if(_0x2a9062[_0xc748('0x5')]){logger[_0xc748('0x6')](_0xc748('0x7'),_0x1da203,_[_0xc748('0x8')](_0x2a9062,_0xc748('0x9'))['join'](',\x20'));_0xf78c6e[_0xc748('0xa')]();}else{logger['info'](_0xc748('0xb'),_0x1da203,_0x1095b7[_0xc748('0xc')]);if(_0x1095b7['priority']){var _0xdb4683=_[_0xc748('0xd')](_0xf78c6e[_0xc748('0xe')](),{'p':_0x1095b7[_0xc748('0xc')]});if(_0xdb4683>=0x0){logger[_0xc748('0xf')](_0xc748('0x10'),_0x1da203,_0x1095b7['priority']||_0xc748('0x11'),_0xdb4683);_0xf78c6e[_0xc748('0x11')](_0xdb4683);}else{logger[_0xc748('0xf')](_0xc748('0x12'),_0x1da203,_0x1095b7['priority']||_0xc748('0x11'));_0xf78c6e['stop']();}}else{_0xf78c6e[_0xc748('0x11')]();}}}catch(_0x329413){logger[_0xc748('0x6')](_0xc748('0x7'),_0x1da203,JSON[_0xc748('0x13')](_0x329413));_0xf78c6e[_0xc748('0xa')]();}};}; \ 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 76d378e..517122c 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 _0x7e07=['then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','upperFirst','AccountId','InteractionId','Message','create'];(function(_0x1cb21a,_0x4f84f0){var _0x43b337=function(_0x3542c3){while(--_0x3542c3){_0x1cb21a['push'](_0x1cb21a['shift']());}};_0x43b337(++_0x4f84f0);}(_0x7e07,0xfc));var _0x77e0=function(_0x4bb66d,_0x32f27b){_0x4bb66d=_0x4bb66d-0x0;var _0x530883=_0x7e07[_0x4bb66d];return _0x530883;};'use strict';var _=require(_0x77e0('0x0'));var utils=require(_0x77e0('0x1'));var logger=require(_0x77e0('0x2'))(_0x77e0('0x3'));var rpc={'chatMessage':require(_0x77e0('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x77e0('0x5')),'smsMessage':require(_0x77e0('0x6')),'faxMessage':require(_0x77e0('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x77e0('0x8')]=function(_0x9b1f7,_0x53ef23){return function(_0x394c1e){try{var _0x22af63={'body':utils[_0x77e0('0x9')](_0x53ef23[0x0],this),'ContactId':this[_0x77e0('0xa')]['id']};if(this[_0x77e0('0xb')]===_0x77e0('0xc')){_0x22af63['ChatWebsiteId']=this['account']['id'];}else{_0x22af63[_[_0x77e0('0xd')](this[_0x77e0('0xb')])+_0x77e0('0xe')]=this['account']['id'];}_0x22af63[_[_0x77e0('0xd')](this[_0x77e0('0xb')])+_0x77e0('0xf')]=this['interaction']['id'];if(rpc[this[_0x77e0('0xb')]+_0x77e0('0x10')]){return rpc[this['channel']+_0x77e0('0x10')][_0x77e0('0x11')](_0x22af63)[_0x77e0('0x12')](function(_0x26ac8b){logger[_0x77e0('0x13')](_0x77e0('0x14'),_0x9b1f7,_0x22af63[_0x77e0('0x15')]);_0x394c1e[_0x77e0('0x16')]();})[_0x77e0('0x17')](function(_0x21ebe6){logger[_0x77e0('0x18')](_0x77e0('0x14'),_0x9b1f7,JSON[_0x77e0('0x19')](_0x21ebe6));_0x394c1e[_0x77e0('0x1a')]();});}}catch(_0x47c75f){logger[_0x77e0('0x18')](_0x77e0('0x14'),_0x9b1f7,JSON[_0x77e0('0x19')](_0x47c75f));_0x394c1e[_0x77e0('0x1a')]();}};}; \ No newline at end of file +var _0xeae6=['interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','channel','chat','account','upperFirst'];(function(_0x19868c,_0x21cac3){var _0x20fb6c=function(_0x37bca0){while(--_0x37bca0){_0x19868c['push'](_0x19868c['shift']());}};_0x20fb6c(++_0x21cac3);}(_0xeae6,0xc3));var _0x6eae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeae6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6eae('0x0'));var utils=require(_0x6eae('0x1'));var logger=require(_0x6eae('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6eae('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6eae('0x4')),'faxMessage':require(_0x6eae('0x5')),'whatsappMessage':require(_0x6eae('0x6'))};exports[_0x6eae('0x7')]=function(_0x3e0903,_0x134c6a){return function(_0x19d1e9){try{var _0x778b34={'body':utils['getMustacheRender'](_0x134c6a[0x0],this),'ContactId':this['contact']['id']};if(this[_0x6eae('0x8')]===_0x6eae('0x9')){_0x778b34['ChatWebsiteId']=this[_0x6eae('0xa')]['id'];}else{_0x778b34[_[_0x6eae('0xb')](this['channel'])+'AccountId']=this[_0x6eae('0xa')]['id'];}_0x778b34[_['upperFirst'](this['channel'])+'InteractionId']=this[_0x6eae('0xc')]['id'];if(rpc[this[_0x6eae('0x8')]+'Message']){return rpc[this[_0x6eae('0x8')]+_0x6eae('0xd')][_0x6eae('0xe')](_0x778b34)[_0x6eae('0xf')](function(_0x118bc0){logger[_0x6eae('0x10')](_0x6eae('0x11'),_0x3e0903,_0x778b34['body']);_0x19d1e9[_0x6eae('0x12')]();})[_0x6eae('0x13')](function(_0x147b90){logger[_0x6eae('0x14')](_0x6eae('0x11'),_0x3e0903,JSON[_0x6eae('0x15')](_0x147b90));_0x19d1e9[_0x6eae('0x16')]();});}}catch(_0x350393){logger[_0x6eae('0x14')](_0x6eae('0x11'),_0x3e0903,JSON[_0x6eae('0x15')](_0x350393));_0x19d1e9[_0x6eae('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 961d216..ed0e22f 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 _0x67ec=['next','stringify','stop','./utils','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x67ec,0x1e3));var _0xc67e=function(_0x44fa91,_0x56a9e0){_0x44fa91=_0x44fa91-0x0;var _0x40a373=_0x67ec[_0x44fa91];return _0x40a373;};'use strict';var utils=require(_0xc67e('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0xc67e('0x1')]=function(_0x18741c,_0x5bd942){return function(_0x4e90c2){try{logger[_0xc67e('0x2')](_0xc67e('0x3'),_0x18741c,utils[_0xc67e('0x4')](_0x5bd942[0x0],this));_0x4e90c2[_0xc67e('0x5')]();}catch(_0x1cf970){logger['error']('[%s][NOOP]\x20%s',_0x18741c,JSON[_0xc67e('0x6')](_0x1cf970));_0x4e90c2[_0xc67e('0x7')]();}};}; \ No newline at end of file +var _0xc7ac=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','stop','./utils'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xc7ac,0x1e9));var _0xcc7a=function(_0x4b4d18,_0x1a954f){_0x4b4d18=_0x4b4d18-0x0;var _0x4d1425=_0xc7ac[_0x4b4d18];return _0x4d1425;};'use strict';var utils=require(_0xcc7a('0x0'));var logger=require(_0xcc7a('0x1'))(_0xcc7a('0x2'));exports[_0xcc7a('0x3')]=function(_0x1f2181,_0x5a9b89){return function(_0x119948){try{logger[_0xcc7a('0x4')](_0xcc7a('0x5'),_0x1f2181,utils[_0xcc7a('0x6')](_0x5a9b89[0x0],this));_0x119948['next']();}catch(_0x198992){logger[_0xcc7a('0x7')](_0xcc7a('0x5'),_0x1f2181,JSON[_0xcc7a('0x8')](_0x198992));_0x119948[_0xcc7a('0x9')]();}};}; \ 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 9e7ea60..acd4f06 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 _0x8322=['error','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','stop','complete','next','rrmemory','beepall','validate','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x8322,0xbc));var _0x2832=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0x8322[_0x26d386];return _0x4ef9a8;};'use strict';var schema=require(_0x2832('0x0'));var _=require('lodash');var util=require(_0x2832('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x2832('0x2'));var Redis=require(_0x2832('0x3'));var config=require(_0x2832('0x4'));var logger=require(_0x2832('0x5'))(_0x2832('0x6'));var strategy=require('./strategy');config[_0x2832('0x7')]=_['defaults'](config['redis'],{'host':_0x2832('0x8'),'port':0x18eb});var io=require(_0x2832('0x9'))(new Redis(config[_0x2832('0x7')]));var attributes=['id',_0x2832('0xa'),_0x2832('0xb'),_0x2832('0xc'),_0x2832('0xd'),_0x2832('0xe')];function emit(_0x16d391,_0x34b644,_0x14d87e){io['to'](_0x16d391)[_0x2832('0xf')](_0x34b644,_0x14d87e);}function emitChannelQueueInteraction(_0x3099db,_0x2c2fc5,_0x1f3aa,_0x341c34,_0x3dc1e5,_0x131c10,_0x3a8a27,_0x296a5a){var _0x4b50f6=_[_0x2832('0x10')](_0x1f3aa);_0x4b50f6[_0x2832('0xa')]=_0x296a5a;_0x4b50f6[_0x2832('0xc')]=_0x2c2fc5;_0x4b50f6['account']=_0x341c34;_0x4b50f6['id']=_0x3dc1e5;if(_0x131c10){attributes[_0x2832('0x11')](_[_0x2832('0x12')](_0x3099db)+'InteractionId');_0x3a8a27[util[_0x2832('0x13')]('%sQueuesWaitingInteractions',_0x3099db)][_0x3dc1e5]=_[_0x2832('0x14')](_0x4b50f6,attributes);}else{delete _0x3a8a27[util['format'](_0x2832('0x15'),_0x3099db)][_0x3dc1e5];}emit(util['format'](_0x2832('0x16'),_0x3099db,_0x2c2fc5),util['format'](_0x2832('0x17'),_0x3099db,_0x131c10?_0x2832('0x18'):'remove'),_[_0x2832('0x14')](_0x4b50f6,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2832('0x19')),'chatQueueReport':require(_0x2832('0x1a')),'smsQueueReport':require(_0x2832('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x2832('0x1c')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x2832('0x1d')),'openchannelInteraction':require(_0x2832('0x1e')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x2832('0x1f'))};var queue=schema({'name':{'type':_0x2832('0x20'),'required':!![],'message':_0x2832('0x21')},'timeout':{'type':_0x2832('0x22'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xfc9ea0,_0x50d29f,_0x6b79ac,_0x5d0f0c){if(_0xfc9ea0&&_0x50d29f&&_0x6b79ac){_0x50d29f[_0x2832('0x23')]+=0x1;var _0x1844b4={'uniqueid':_0xfc9ea0,'from':_0x6b79ac[_0x2832('0x24')]?_0x6b79ac[_0x2832('0x24')][_0x2832('0xd')]:'','joinAt':moment()['format'](_0x2832('0x25')),'ContactId':_0x6b79ac['contact']?_0x6b79ac[_0x2832('0x26')]['id']:null,'ListId':_0x6b79ac[_0x2832('0x27')]?_0x6b79ac[_0x2832('0x27')]['id']:null};_0x1844b4[_[_0x2832('0x28')](_0x6b79ac[_0x2832('0x29')])+_0x2832('0x2a')]=_0x50d29f['id']||null;_0x1844b4[_[_0x2832('0x28')](_0x6b79ac[_0x2832('0x29')])+_0x2832('0x2b')]=_0x6b79ac[_0x2832('0x2c')]?_0x6b79ac['interaction']['id']:null;_0x1844b4[_['upperFirst'](_0x6b79ac[_0x2832('0x29')])+_0x2832('0x2d')]=_0x6b79ac[_0x2832('0x2e')]?_0x6b79ac['message']['id']:null;_0x1844b4[_[_0x2832('0x28')](_0x6b79ac[_0x2832('0x29')])+(_0x6b79ac[_0x2832('0x29')]!==_0x2832('0x2f')?_0x2832('0x30'):'WebsiteId')]=_0x6b79ac['account']?_0x6b79ac[_0x2832('0xb')]['id']:null;logger[_0x2832('0x31')](util[_0x2832('0x13')](_0x2832('0x32'),_0xfc9ea0,_0x50d29f[_0x2832('0x33')]));emitChannelQueueInteraction(_0x6b79ac['channel'],_0x50d29f[_0x2832('0x33')],_0x1844b4,_0x6b79ac[_0x2832('0xb')][_0x2832('0x33')],_0x6b79ac[_0x2832('0x2e')]['id'],!![],_0x5d0f0c,_0x50d29f['id']);if(rpc[_0x6b79ac[_0x2832('0x29')]+'QueueReport']){return rpc[_0x6b79ac[_0x2832('0x29')]+_0x2832('0x34')][_0x2832('0x35')](_0x1844b4)[_0x2832('0x36')](function(_0x26c2dc){logger[_0x2832('0x37')]('create\x20queue\x20report',_0x26c2dc);});}}}function stopRouting(_0xa41d52,_0x12a1dd,_0xcec23b,_0x60e055){if(_0xa41d52&&_0x12a1dd){_0x12a1dd[_0x2832('0x23')]-=0x1;var _0x170b5a={'leaveAt':moment()[_0x2832('0x13')](_0x2832('0x25')),'acceptAt':moment()[_0x2832('0x13')](_0x2832('0x25')),'reason':_0x2832('0x38')};logger[_0x2832('0x31')](util[_0x2832('0x13')](_0x2832('0x39'),_0xa41d52,_0x12a1dd['name']));emitChannelQueueInteraction(_0xcec23b['channel'],_0x12a1dd[_0x2832('0x33')],_0xcec23b[_0x2832('0x24')],_0xcec23b[_0x2832('0xb')][_0x2832('0x33')],_0xcec23b[_0x2832('0x2e')]['id'],![],_0x60e055,_0x12a1dd['id']);return rpc[_0xcec23b[_0x2832('0x29')]+_0x2832('0x3a')][_0x2832('0x3b')](_0xcec23b[_0x2832('0x2c')]['id'],{'queueId':_0x12a1dd['id']})['then'](function(){if(rpc[_0xcec23b['channel']+_0x2832('0x34')]){return rpc[_0xcec23b[_0x2832('0x29')]+_0x2832('0x34')][_0x2832('0x3b')](_0xa41d52,_0x170b5a)[_0x2832('0x36')](function(_0x446d11){logger[_0x2832('0x37')](_0x2832('0x3c'),_0x446d11);});}});}}function endRouting(_0x158c01,_0x493f82,_0x51bb72,_0x3effc7){if(_0x158c01&&_0x493f82){_0x493f82[_0x2832('0x23')]-=0x1;var _0x115826={'leaveAt':moment()[_0x2832('0x13')](_0x2832('0x25')),'exitAt':moment()[_0x2832('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2832('0x3d')};logger[_0x2832('0x31')](util[_0x2832('0x13')](_0x2832('0x3e'),_0x158c01,_0x493f82['name']));emitChannelQueueInteraction(_0x51bb72[_0x2832('0x29')],_0x493f82['name'],_0x51bb72[_0x2832('0x24')],_0x51bb72['account']['name'],_0x51bb72[_0x2832('0x2e')]['id'],![],_0x3effc7);if(rpc[_0x51bb72[_0x2832('0x29')]+_0x2832('0x34')]){return rpc[_0x51bb72['channel']+_0x2832('0x34')][_0x2832('0x3b')](_0x158c01,_0x115826)[_0x2832('0x36')](function(_0x393095){logger['error'](_0x2832('0x3c'),_0x393095);});}}}function handleFindQueue(_0x900dc1){return function(_0x525596){return _0x525596[_0x2832('0x33')][_0x2832('0x3f')]()===_0x900dc1['toLowerCase']();};}exports[_0x2832('0x40')]=function(_0x4841c5,_0x5bf208,_0x2e7a63,_0x112fe0){return function(_0x4aa38a){try{var _0x56b528={'name':_0x5bf208[0x0],'timeout':_0x5bf208[0x1]};var _0x5c9979=queue[_0x2832('0x0')](_0x56b528,{'typecast':!![]});if(_0x5c9979[_0x2832('0x41')]){logger['error'](_0x2832('0x42'),_0x4841c5,_['map'](_0x5c9979,_0x2832('0x2e'))[_0x2832('0x43')](',\x20'));_0x4aa38a['stop']();}else{var _0x40c19e=_[_0x2832('0x44')](_0x2e7a63[_0x112fe0[_0x2832('0x29')]+_0x2832('0x45')],handleFindQueue(_0x56b528[_0x2832('0x33')]));if(_0x40c19e){startRouting(_0x4841c5,_0x40c19e,_0x112fe0,_0x2e7a63);var _0x2eef8a=(_0x40c19e[_0x2832('0x3d')]||0xa)*0x3e8;var _0x4807eb=(_0x56b528['timeout']||0x14)*0x3e8;var _0x319ef6;if(_0x2eef8a>_0x4807eb){_0x4807eb=_0x2eef8a;}var _0x5b5b3e=seqqueue[_0x2832('0x46')](_0x2eef8a);_0x5b5b3e['id']=_0x4841c5;_0x5b5b3e[_0x2832('0x47')]=_0x2eef8a;_0x5b5b3e[_0x2832('0x48')]=_0x4807eb;_0x5b5b3e[_0x2832('0x29')]=_0x112fe0[_0x2832('0x29')];_0x2e7a63[_0x2832('0x49')][_0x4841c5]['on'](_0x2832('0x4a'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4841c5);stopRouting(_0x4841c5,_0x40c19e,_0x112fe0,_0x2e7a63);clearTimeout(_0x319ef6);_0x319ef6=undefined;_0x5b5b3e[_0x2832('0x4b')](!![]);if(_0x2e7a63[_0x2832('0x49')][_0x4841c5]){delete _0x2e7a63[_0x2832('0x49')][_0x4841c5];}_0x4aa38a[_0x2832('0x4c')]();});_0x2e7a63['rules'][_0x4841c5]['on'](_0x2832('0x4d'),function(){if(_0x2e7a63['rules'][_0x4841c5]){delete _0x2e7a63[_0x2832('0x49')][_0x4841c5];}});_0x319ef6=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x4841c5);endRouting(_0x4841c5,_0x40c19e,_0x112fe0,_0x2e7a63);clearTimeout(_0x319ef6);_0x5b5b3e[_0x2832('0x4b')](!![]);_0x4aa38a[_0x2832('0x4e')]();},_0x4807eb);switch(_0x40c19e['strategy']){case'rrmemory':strategy[_0x2832('0x4f')](_0x5b5b3e,_0x40c19e,_0x2e7a63,_0x112fe0);break;default:strategy[_0x2832('0x50')](_0x5b5b3e,_0x40c19e,_0x2e7a63,_0x112fe0);}}else{logger[_0x2832('0x37')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4841c5,_0x56b528[_0x2832('0x33')]);_0x4aa38a[_0x2832('0x4c')]();}}}catch(_0x3281d3){logger[_0x2832('0x37')]('[%s][QUEUE]\x20%s',_0x4841c5,_0x3281d3['stack']);_0x4aa38a[_0x2832('0x4c')]();}};}; \ No newline at end of file +var _0x0156=['AccountId','WebsiteId','info','name','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','emit','clone','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../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','upperFirst','channel','QueueId','interaction','message'];(function(_0x5ca699,_0x4d7c82){var _0x17f08c=function(_0x2d7695){while(--_0x2d7695){_0x5ca699['push'](_0x5ca699['shift']());}};_0x17f08c(++_0x4d7c82);}(_0x0156,0xbe));var _0x6015=function(_0x54bf68,_0x1df62c){_0x54bf68=_0x54bf68-0x0;var _0x32fb54=_0x0156[_0x54bf68];return _0x32fb54;};'use strict';var schema=require(_0x6015('0x0'));var _=require(_0x6015('0x1'));var util=require(_0x6015('0x2'));var seqqueue=require(_0x6015('0x3'));var moment=require(_0x6015('0x4'));var Redis=require(_0x6015('0x5'));var config=require('../../../../config/environment');var logger=require(_0x6015('0x6'))(_0x6015('0x7'));var strategy=require(_0x6015('0x8'));config['redis']=_[_0x6015('0x9')](config[_0x6015('0xa')],{'host':_0x6015('0xb'),'port':0x18eb});var io=require(_0x6015('0xc'))(new Redis(config[_0x6015('0xa')]));var attributes=['id',_0x6015('0xd'),_0x6015('0xe'),_0x6015('0xf'),_0x6015('0x10'),'joinAt'];function emit(_0x55ae15,_0x11ea45,_0x17628a){io['to'](_0x55ae15)[_0x6015('0x11')](_0x11ea45,_0x17628a);}function emitChannelQueueInteraction(_0x19700f,_0x35a4e1,_0x265a9a,_0xb09197,_0x10e8eb,_0x108ca3,_0x268465,_0x3a28e8){var _0x560f4e=_[_0x6015('0x12')](_0x265a9a);_0x560f4e[_0x6015('0xd')]=_0x3a28e8;_0x560f4e[_0x6015('0xf')]=_0x35a4e1;_0x560f4e[_0x6015('0xe')]=_0xb09197;_0x560f4e['id']=_0x10e8eb;if(_0x108ca3){attributes['push'](_[_0x6015('0x13')](_0x19700f)+'InteractionId');_0x268465[util[_0x6015('0x14')](_0x6015('0x15'),_0x19700f)][_0x10e8eb]=_[_0x6015('0x16')](_0x560f4e,attributes);}else{delete _0x268465[util[_0x6015('0x14')](_0x6015('0x15'),_0x19700f)][_0x10e8eb];}emit(util['format'](_0x6015('0x17'),_0x19700f,_0x35a4e1),util[_0x6015('0x14')]('%s_queue_waiting_interaction:%s',_0x19700f,_0x108ca3?'save':_0x6015('0x18')),_[_0x6015('0x16')](_0x560f4e,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x6015('0x19')),'chatQueueReport':require(_0x6015('0x1a')),'smsQueueReport':require(_0x6015('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x6015('0x1c')),'chatInteraction':require(_0x6015('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0x6015('0x1e')),'smsInteraction':require(_0x6015('0x1f')),'whatsappInteraction':require(_0x6015('0x20'))};var queue=schema({'name':{'type':_0x6015('0x21'),'required':!![],'message':_0x6015('0x22')},'timeout':{'type':_0x6015('0x23'),'message':_0x6015('0x24')}});function startRouting(_0x5b24a0,_0x4fa0ac,_0x1b9ad2,_0x2d69bd){if(_0x5b24a0&&_0x4fa0ac&&_0x1b9ad2){_0x4fa0ac[_0x6015('0x25')]+=0x1;var _0x2783eb={'uniqueid':_0x5b24a0,'from':_0x1b9ad2[_0x6015('0x26')]?_0x1b9ad2[_0x6015('0x26')][_0x6015('0x10')]:'','joinAt':moment()[_0x6015('0x14')](_0x6015('0x27')),'ContactId':_0x1b9ad2[_0x6015('0x28')]?_0x1b9ad2[_0x6015('0x28')]['id']:null,'ListId':_0x1b9ad2[_0x6015('0x29')]?_0x1b9ad2[_0x6015('0x29')]['id']:null};_0x2783eb[_[_0x6015('0x2a')](_0x1b9ad2[_0x6015('0x2b')])+_0x6015('0x2c')]=_0x4fa0ac['id']||null;_0x2783eb[_[_0x6015('0x2a')](_0x1b9ad2[_0x6015('0x2b')])+'InteractionId']=_0x1b9ad2['interaction']?_0x1b9ad2[_0x6015('0x2d')]['id']:null;_0x2783eb[_[_0x6015('0x2a')](_0x1b9ad2[_0x6015('0x2b')])+'MessageId']=_0x1b9ad2[_0x6015('0x2e')]?_0x1b9ad2[_0x6015('0x2e')]['id']:null;_0x2783eb[_[_0x6015('0x2a')](_0x1b9ad2[_0x6015('0x2b')])+(_0x1b9ad2[_0x6015('0x2b')]!=='chat'?_0x6015('0x2f'):_0x6015('0x30'))]=_0x1b9ad2['account']?_0x1b9ad2['account']['id']:null;logger[_0x6015('0x31')](util[_0x6015('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x5b24a0,_0x4fa0ac[_0x6015('0x32')]));emitChannelQueueInteraction(_0x1b9ad2[_0x6015('0x2b')],_0x4fa0ac[_0x6015('0x32')],_0x2783eb,_0x1b9ad2['account'][_0x6015('0x32')],_0x1b9ad2[_0x6015('0x2e')]['id'],!![],_0x2d69bd,_0x4fa0ac['id']);if(rpc[_0x1b9ad2[_0x6015('0x2b')]+'QueueReport']){return rpc[_0x1b9ad2['channel']+'QueueReport']['create'](_0x2783eb)[_0x6015('0x33')](function(_0x33210f){logger[_0x6015('0x34')](_0x6015('0x35'),_0x33210f);});}}}function stopRouting(_0xbc80cb,_0x3a7e60,_0x2b7ef6,_0x19cdf1){if(_0xbc80cb&&_0x3a7e60){_0x3a7e60[_0x6015('0x25')]-=0x1;var _0x5c92b2={'leaveAt':moment()['format'](_0x6015('0x27')),'acceptAt':moment()[_0x6015('0x14')](_0x6015('0x27')),'reason':'accepted'};logger['info'](util[_0x6015('0x14')](_0x6015('0x36'),_0xbc80cb,_0x3a7e60[_0x6015('0x32')]));emitChannelQueueInteraction(_0x2b7ef6[_0x6015('0x2b')],_0x3a7e60['name'],_0x2b7ef6['body'],_0x2b7ef6[_0x6015('0xe')][_0x6015('0x32')],_0x2b7ef6[_0x6015('0x2e')]['id'],![],_0x19cdf1,_0x3a7e60['id']);return rpc[_0x2b7ef6['channel']+'Interaction'][_0x6015('0x37')](_0x2b7ef6['interaction']['id'],{'queueId':_0x3a7e60['id']})['then'](function(){if(rpc[_0x2b7ef6[_0x6015('0x2b')]+_0x6015('0x38')]){return rpc[_0x2b7ef6[_0x6015('0x2b')]+_0x6015('0x38')][_0x6015('0x37')](_0xbc80cb,_0x5c92b2)[_0x6015('0x33')](function(_0x1f4fa3){logger[_0x6015('0x34')](_0x6015('0x39'),_0x1f4fa3);});}});}}function endRouting(_0x36b4fa,_0x2f1d7d,_0x47aa92,_0x1906ef){if(_0x36b4fa&&_0x2f1d7d){_0x2f1d7d[_0x6015('0x25')]-=0x1;var _0x2c4690={'leaveAt':moment()[_0x6015('0x14')](_0x6015('0x27')),'exitAt':moment()[_0x6015('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x6015('0x3a')};logger['info'](util['format'](_0x6015('0x3b'),_0x36b4fa,_0x2f1d7d[_0x6015('0x32')]));emitChannelQueueInteraction(_0x47aa92['channel'],_0x2f1d7d[_0x6015('0x32')],_0x47aa92[_0x6015('0x26')],_0x47aa92['account']['name'],_0x47aa92[_0x6015('0x2e')]['id'],![],_0x1906ef);if(rpc[_0x47aa92[_0x6015('0x2b')]+_0x6015('0x38')]){return rpc[_0x47aa92[_0x6015('0x2b')]+_0x6015('0x38')][_0x6015('0x37')](_0x36b4fa,_0x2c4690)[_0x6015('0x33')](function(_0x1e9cc8){logger[_0x6015('0x34')](_0x6015('0x39'),_0x1e9cc8);});}}}function handleFindQueue(_0x466255){return function(_0x5367f1){return _0x5367f1[_0x6015('0x32')][_0x6015('0x3c')]()===_0x466255['toLowerCase']();};}exports[_0x6015('0x3d')]=function(_0x195dc1,_0x2ebaf7,_0x32b984,_0xaee96f){return function(_0x3156c1){try{var _0x4b351a={'name':_0x2ebaf7[0x0],'timeout':_0x2ebaf7[0x1]};var _0x491374=queue[_0x6015('0x0')](_0x4b351a,{'typecast':!![]});if(_0x491374[_0x6015('0x3e')]){logger[_0x6015('0x34')](_0x6015('0x3f'),_0x195dc1,_['map'](_0x491374,_0x6015('0x2e'))[_0x6015('0x40')](',\x20'));_0x3156c1[_0x6015('0x41')]();}else{var _0x2805ca=_[_0x6015('0x42')](_0x32b984[_0xaee96f[_0x6015('0x2b')]+_0x6015('0x43')],handleFindQueue(_0x4b351a['name']));if(_0x2805ca){startRouting(_0x195dc1,_0x2805ca,_0xaee96f,_0x32b984);var _0x5b2553=(_0x2805ca[_0x6015('0x3a')]||0xa)*0x3e8;var _0x3dc8c5=(_0x4b351a['timeout']||0x14)*0x3e8;var _0x54d92e;if(_0x5b2553>_0x3dc8c5){_0x3dc8c5=_0x5b2553;}var _0x45c01b=seqqueue['createQueue'](_0x5b2553);_0x45c01b['id']=_0x195dc1;_0x45c01b[_0x6015('0x44')]=_0x5b2553;_0x45c01b[_0x6015('0x45')]=_0x3dc8c5;_0x45c01b[_0x6015('0x2b')]=_0xaee96f[_0x6015('0x2b')];_0x32b984[_0x6015('0x46')][_0x195dc1]['on'](_0x6015('0x47'),function(){logger[_0x6015('0x31')](_0x6015('0x48'),_0x195dc1);stopRouting(_0x195dc1,_0x2805ca,_0xaee96f,_0x32b984);clearTimeout(_0x54d92e);_0x54d92e=undefined;_0x45c01b[_0x6015('0x49')](!![]);if(_0x32b984['rules'][_0x195dc1]){delete _0x32b984['rules'][_0x195dc1];}_0x3156c1[_0x6015('0x41')]();});_0x32b984[_0x6015('0x46')][_0x195dc1]['on']('complete',function(){if(_0x32b984[_0x6015('0x46')][_0x195dc1]){delete _0x32b984['rules'][_0x195dc1];}});_0x54d92e=setTimeout(function(){logger[_0x6015('0x31')](_0x6015('0x4a'),_0x195dc1);endRouting(_0x195dc1,_0x2805ca,_0xaee96f,_0x32b984);clearTimeout(_0x54d92e);_0x45c01b[_0x6015('0x49')](!![]);_0x3156c1[_0x6015('0x4b')]();},_0x3dc8c5);switch(_0x2805ca[_0x6015('0x4c')]){case _0x6015('0x4d'):strategy[_0x6015('0x4d')](_0x45c01b,_0x2805ca,_0x32b984,_0xaee96f);break;default:strategy[_0x6015('0x4e')](_0x45c01b,_0x2805ca,_0x32b984,_0xaee96f);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x195dc1,_0x4b351a[_0x6015('0x32')]);_0x3156c1[_0x6015('0x41')]();}}}catch(_0x4f158c){logger['error'](_0x6015('0x3f'),_0x195dc1,_0x4f158c['stack']);_0x3156c1[_0x6015('0x41')]();}};}; \ 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 bd91cbd..3ad2cc4 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 _0x24ca=['busy','busyQueue','saveWaitingNotification','showNotification','RINGING','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','writeLog','STOP','exports','lodash','../../../../../config/logger','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','prototype','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel'];(function(_0x541186,_0x4a2152){var _0x24f8d1=function(_0x4d7878){while(--_0x4d7878){_0x541186['push'](_0x541186['shift']());}};_0x24f8d1(++_0x4a2152);}(_0x24ca,0x8c));var _0xa24c=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0x24ca[_0x59e821];return _0x5333f6;};'use strict';var _=require(_0xa24c('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0xa24c('0x1'))('routing');var Agent=function(_0x155c49,_0x1efd39,_0xe69cdd,_0x49f276){this[_0xa24c('0x2')]=uuid['v4']();this[_0xa24c('0x3')]=_0x155c49;this[_0xa24c('0x4')]=_0x1efd39;this['realtime']=_0xe69cdd;this['routing']=_0x49f276;this['squeue'][_0xa24c('0x5')](this[_0xa24c('0x6')][_0xa24c('0x7')](this),this[_0xa24c('0x8')][_0xa24c('0x7')](this));this[_0xa24c('0x3')]['on']('timeout',this[_0xa24c('0x8')][_0xa24c('0x7')](this));this[_0xa24c('0x3')]['on']('drained',this['handleDrained'][_0xa24c('0x7')](this));};Agent[_0xa24c('0x9')][_0xa24c('0x5')]=function(){this[_0xa24c('0x3')][_0xa24c('0x5')](this[_0xa24c('0x6')]['bind'](this),this['handleTimeout']['bind'](this));};Agent[_0xa24c('0x9')][_0xa24c('0xa')]=function(){this[_0xa24c('0x8')](!![]);};Agent[_0xa24c('0x9')][_0xa24c('0x6')]=function(){logger['debug'](_0xa24c('0xb'),this['squeue']['id'],this['agent']['id']);if(_['isNil'](this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']])){logger[_0xa24c('0xe')](_0xa24c('0xf'),this[_0xa24c('0x3')]['id'],this[_0xa24c('0x4')]['id']);setTimeout(this[_0xa24c('0x5')][_0xa24c('0x7')](this),0x3e8);}else{if(this[_0xa24c('0x10')][_0xa24c('0x11')]||util[_0xa24c('0x12')](this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')]['agents'][this[_0xa24c('0x4')]['id']],this['squeue'][_0xa24c('0x13')],![])){this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']][_0xa24c('0x14')]=!![];this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']][_0xa24c('0x15')]=undefined;util[_0xa24c('0x16')](this[_0xa24c('0xc')],this['routing'],this['agent'],this[_0xa24c('0x3')][_0xa24c('0x13')]);util[_0xa24c('0x17')](this[_0xa24c('0x2')],this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']],null,this[_0xa24c('0x10')]);util['writeLog'](this[_0xa24c('0x3')]['id'],this['realtime'][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']],_0xa24c('0x18')+(this[_0xa24c('0x10')]['forcedOwnership']?':FORCED':''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xa24c('0x3')]['id'],this[_0xa24c('0x4')]['id']);setTimeout(this[_0xa24c('0x5')][_0xa24c('0x7')](this),0x3e8);}}};Agent[_0xa24c('0x9')]['handleTimeout']=function(_0x5c8113){if(_[_0xa24c('0x19')](this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']])){return logger[_0xa24c('0xe')](_0xa24c('0xf'),this[_0xa24c('0x3')]['id'],this[_0xa24c('0x4')]['id']);}else{logger[_0xa24c('0xe')](_0xa24c('0x1a'),this['squeue']['id'],this[_0xa24c('0x4')]['id']);util[_0xa24c('0x1b')](this['notificationId'],this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']],null,this[_0xa24c('0x10')]);this[_0xa24c('0xc')][_0xa24c('0xd')][this[_0xa24c('0x4')]['id']][_0xa24c('0x14')]=![];this[_0xa24c('0xc')]['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0xa24c('0x1c')](this['realtime'],this[_0xa24c('0x10')],this[_0xa24c('0x4')],this[_0xa24c('0x3')]['channel']);util[_0xa24c('0x1d')](this[_0xa24c('0x3')]['id'],this[_0xa24c('0xc')]['agents'][this[_0xa24c('0x4')]['id']],_0x5c8113?_0xa24c('0x1e'):'TIMEOUT');}if(!_0x5c8113){setTimeout(this[_0xa24c('0x5')][_0xa24c('0x7')](this),0x3e8);}};function agent(_0xd837dc,_0x570d7c,_0x45c429,_0x2c63da){return new Agent(_0xd837dc,_0x570d7c,_0x45c429,_0x2c63da);}module[_0xa24c('0x1f')]=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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb66c,0x175));var _0xcb66=function(_0x391e3b,_0x3e63ed){_0x391e3b=_0x391e3b-0x0;var _0x355fa1=_0xb66c[_0x391e3b];return _0x355fa1;};'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 62eecb7..a53c550 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 _0xf6f7=['showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','./util','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','timeout','drained','handleDrained','handleTimeout','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','name','saveWaitingNotification'];(function(_0x18ae6d,_0x255d00){var _0x3deb94=function(_0x44b04c){while(--_0x44b04c){_0x18ae6d['push'](_0x18ae6d['shift']());}};_0x3deb94(++_0x255d00);}(_0xf6f7,0x15c));var _0x7f6f=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0xf6f7[_0x81e39d];return _0x548fbb;};'use strict';var _=require(_0x7f6f('0x0'));var uuid=require(_0x7f6f('0x1'));var util=require(_0x7f6f('0x2'));var logger=require('../../../../../config/logger')(_0x7f6f('0x3'));var Beepall=function(_0x192c71,_0x4dc75a,_0x3491e1,_0x10f6f4){this[_0x7f6f('0x4')]=uuid['v4']();this[_0x7f6f('0x5')]=_0x192c71;this[_0x7f6f('0x6')]=_0x4dc75a;this[_0x7f6f('0x7')]=_0x3491e1;this['routing']=_0x10f6f4;this[_0x7f6f('0x5')][_0x7f6f('0x8')](this[_0x7f6f('0x9')][_0x7f6f('0xa')](this),this['handleTimeout'][_0x7f6f('0xa')](this));this[_0x7f6f('0x5')]['on'](_0x7f6f('0xb'),this['handleTimeout'][_0x7f6f('0xa')](this));this[_0x7f6f('0x5')]['on'](_0x7f6f('0xc'),this[_0x7f6f('0xd')][_0x7f6f('0xa')](this));};Beepall['prototype'][_0x7f6f('0x8')]=function(){this['squeue'][_0x7f6f('0x8')](this[_0x7f6f('0x9')][_0x7f6f('0xa')](this),this[_0x7f6f('0xe')]['bind'](this));};Beepall['prototype'][_0x7f6f('0xd')]=function(){this[_0x7f6f('0xe')](!![]);};Beepall['prototype'][_0x7f6f('0x9')]=function(){var _0xfc5ae3=!![];if(!_[_0x7f6f('0xf')](this[_0x7f6f('0x6')])&&!_[_0x7f6f('0xf')](this[_0x7f6f('0x6')]['Agents'])&&this[_0x7f6f('0x6')][_0x7f6f('0x10')][_0x7f6f('0x11')]>0x0){for(var _0x4e7e82=0x0,_0x1c4115;_0x4e7e820x0){for(var _0x1d2da8=0x0,_0xb2476b;_0x1d2da80x0&&_0x327610[_0x46cf77+_0x8980('0x20')]>=_0x327610[_0x46cf77+'Capacity']){writeLog(_0xc591b4,_0x327610,_0x46cf77[_0x8980('0x21')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x8980('0x22')]=function(_0x3d1bc9,_0x2dc7f9,_0x476107,_0x3bc0ff,_0x2a4bca){return sendNotification(!![],_0x3d1bc9,_0x2dc7f9,_0x476107,_0x3bc0ff,_0x2a4bca);};exports[_0x8980('0x23')]=function(_0x55c573,_0x47b682,_0x365ade,_0x50fb52,_0x3d625e){return sendNotification(![],_0x55c573,_0x47b682,_0x365ade,_0x50fb52,_0x3d625e);};exports[_0x8980('0x24')]=function(_0x4bc502,_0x4823f7,_0x36bea3){var _0x534362=_0x4823f7[_0x8980('0x25')]['UserId'];if(!_0x534362&&_0x36bea3){_0x534362=_0x36bea3['id'];}var _0x4ec03e=_['some'](_0x4bc502[_0x4823f7[_0x8980('0x26')]+_0x8980('0x27')],function(_0x4f10ab){var _0x87ef5c=_[_0x8980('0x28')](_0x4823f7[_0x8980('0x26')])+_0x8980('0x29');return _0x4f10ab[_0x87ef5c]===_0x4823f7['interaction']['id'];});if(!_0x4ec03e&&_0x534362&&_0x4bc502[_0x8980('0x2a')][_0x534362]){_0x4ec03e=_[_0x8980('0x2b')](_0x4bc502[_0x8980('0x2a')][_0x534362][_0x4823f7[_0x8980('0x26')]+_0x8980('0x2c')],function(_0x9471c6){return _0x9471c6['id']===_0x4823f7['interaction']['id'];});}return _0x4ec03e;};exports['saveWaitingNotification']=function(_0x5a2d97,_0x140cb7,_0x267204,_0x2b7da1){if(_0x267204&&_0x267204['id']&&_0x5a2d97[_0x8980('0x2a')]&&_0x5a2d97[_0x8980('0x2a')][_0x267204['id']]){_0x5a2d97['agents'][_0x267204['id']][_0x2b7da1+_0x8980('0x2c')][_0x140cb7[_0x8980('0x2d')]['id']]={'id':_0x140cb7[_0x8980('0x25')]['id']};}};exports[_0x8980('0x2e')]=function(_0x5a7259,_0x26ef54,_0x4cd64a,_0x3c8eed){if(_0x4cd64a&&_0x4cd64a['id']&&_0x5a7259[_0x8980('0x2a')]&&_0x5a7259[_0x8980('0x2a')][_0x4cd64a['id']]){delete _0x5a7259[_0x8980('0x2a')][_0x4cd64a['id']][_0x3c8eed+_0x8980('0x2c')][_0x26ef54[_0x8980('0x2d')]['id']];}};exports[_0x8980('0x2f')]=writeLog; \ No newline at end of file +var _0x7eee=['I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','user:%s','emit','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','writeLog','lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','split','\x20interaction','name','body','queue','msg','account','notificationTemplate'];(function(_0x2c0eb5,_0x1ec809){var _0x3b61fb=function(_0x1c5fca){while(--_0x1c5fca){_0x2c0eb5['push'](_0x2c0eb5['shift']());}};_0x3b61fb(++_0x1ec809);}(_0x7eee,0x14c));var _0xe7ee=function(_0x5dc710,_0x99e63d){_0x5dc710=_0x5dc710-0x0;var _0x46b461=_0x7eee[_0x5dc710];return _0x46b461;};'use strict';var _=require(_0xe7ee('0x0'));var util=require(_0xe7ee('0x1'));var utils=require(_0xe7ee('0x2'));var Redis=require('ioredis');var config=require(_0xe7ee('0x3'));var logger=require(_0xe7ee('0x4'))(_0xe7ee('0x5'));config[_0xe7ee('0x6')]=_[_0xe7ee('0x7')](config['redis'],{'host':_0xe7ee('0x8'),'port':0x18eb});var io=require(_0xe7ee('0x9'))(new Redis(config[_0xe7ee('0x6')]));function sendNotification(_0x57ac26,_0x2053f3,_0x57d11b,_0x54488f,_0x236a9c,_0x2acb14){var _0x311302=_0x2acb14||{};var _0x5ed29d=_0x57d11b[_0xe7ee('0xa')]('.');var _0x284c83={'uniqueid':_0x2053f3,'channel':_0x5ed29d[0x0],'id':_0x5ed29d[0x1],'title':_0x5ed29d[0x0]+_0xe7ee('0xb'),'interactionId':_0x5ed29d[0x2],'queue':_0x236a9c?_0x236a9c[_0xe7ee('0xc')]:null,'sound':_0x311302['account']['notificationSound'],'shake':_0x311302['account']['notificationShake']};try{if(!_0x311302[_0xe7ee('0xd')]){_0x311302['body']={};}if(_0x236a9c){_0x311302[_0xe7ee('0xd')]['queue']=_0x236a9c;}else if(_0x311302['body'][_0xe7ee('0xe')]){delete _0x311302[_0xe7ee('0xd')][_0xe7ee('0xe')];}_0x284c83[_0xe7ee('0xf')]=utils['getMustacheRender'](_0x311302[_0xe7ee('0x10')][_0xe7ee('0x11')],_0x311302);}catch(_0x144335){_0x284c83['msg']=_0xe7ee('0x12');logger[_0xe7ee('0x13')](util[_0xe7ee('0x14')](_0xe7ee('0x15'),_0x2053f3,_0x144335[_0xe7ee('0x16')]));}io['to'](util[_0xe7ee('0x14')](_0xe7ee('0x17'),_0x54488f[_0xe7ee('0xc')]))[_0xe7ee('0x18')](util['format']('notification:%s',_0x57ac26?_0xe7ee('0x19'):_0xe7ee('0x1a')),_0x284c83);}function writeLog(_0x38b598,_0x3d0280,_0x32f454){return logger['debug'](util[_0xe7ee('0x14')](_0xe7ee('0x1b'),_0x38b598,_0x3d0280['name'],_0x32f454));}exports[_0xe7ee('0x1c')]=function(_0x5ba6db,_0x14a514,_0x3c11bf,_0x1f38b4){if(_0x14a514[_0xe7ee('0x1d')]){writeLog(_0x5ba6db,_0x14a514,_0xe7ee('0x1e'));return![];}if(!_0x14a514[_0xe7ee('0x1f')]){writeLog(_0x5ba6db,_0x14a514,_0xe7ee('0x20'));return![];}if(_0x14a514[_0x3c11bf+_0xe7ee('0x21')]){writeLog(_0x5ba6db,_0x14a514,_0xe7ee('0x22'));return![];}if(_0x1f38b4&&_0x14a514[_0xe7ee('0x23')](_0x3c11bf+'Capacity')&&_0x14a514[_0xe7ee('0x23')](_0x3c11bf+'CurrentCapacity')){if(_0x14a514[_0x3c11bf+_0xe7ee('0x24')]>0x0&&_0x14a514[_0x3c11bf+_0xe7ee('0x25')]>=_0x14a514[_0x3c11bf+'Capacity']){writeLog(_0x5ba6db,_0x14a514,_0x3c11bf['toUpperCase']()+_0xe7ee('0x26'));return![];}}return!![];};exports[_0xe7ee('0x27')]=function(_0x5885d2,_0x2505b7,_0x3f9af2,_0x13a1dd,_0x2a562e){return sendNotification(!![],_0x5885d2,_0x2505b7,_0x3f9af2,_0x13a1dd,_0x2a562e);};exports['hideNotification']=function(_0x3a7c5c,_0x17ab5c,_0x3d6568,_0x1e5fde,_0x67ff53){return sendNotification(![],_0x3a7c5c,_0x17ab5c,_0x3d6568,_0x1e5fde,_0x67ff53);};exports['checkWaitingNotifications']=function(_0x52d341,_0x561112,_0x20cb05){var _0x25ce52=_0x561112[_0xe7ee('0x28')][_0xe7ee('0x29')];if(!_0x25ce52&&_0x20cb05){_0x25ce52=_0x20cb05['id'];}var _0x3f20c8=_[_0xe7ee('0x2a')](_0x52d341[_0x561112[_0xe7ee('0x2b')]+_0xe7ee('0x2c')],function(_0x3086ab){var _0x736e4c=_[_0xe7ee('0x2d')](_0x561112[_0xe7ee('0x2b')])+_0xe7ee('0x2e');return _0x3086ab[_0x736e4c]===_0x561112[_0xe7ee('0x28')]['id'];});if(!_0x3f20c8&&_0x25ce52&&_0x52d341[_0xe7ee('0x2f')][_0x25ce52]){_0x3f20c8=_[_0xe7ee('0x2a')](_0x52d341[_0xe7ee('0x2f')][_0x25ce52][_0x561112['channel']+'WaitingInteractions'],function(_0x10a933){return _0x10a933['id']===_0x561112[_0xe7ee('0x28')]['id'];});}return _0x3f20c8;};exports['saveWaitingNotification']=function(_0x4e77af,_0x18d33c,_0x4cb075,_0x59a03d){if(_0x4cb075&&_0x4cb075['id']&&_0x4e77af[_0xe7ee('0x2f')]&&_0x4e77af[_0xe7ee('0x2f')][_0x4cb075['id']]){_0x4e77af[_0xe7ee('0x2f')][_0x4cb075['id']][_0x59a03d+_0xe7ee('0x30')][_0x18d33c[_0xe7ee('0x16')]['id']]={'id':_0x18d33c['interaction']['id']};}};exports['removeWaitingNotification']=function(_0x1ed84d,_0x486a46,_0x39bd1e,_0x576acd){if(_0x39bd1e&&_0x39bd1e['id']&&_0x1ed84d[_0xe7ee('0x2f')]&&_0x1ed84d[_0xe7ee('0x2f')][_0x39bd1e['id']]){delete _0x1ed84d[_0xe7ee('0x2f')][_0x39bd1e['id']][_0x576acd+'WaitingInteractions'][_0x486a46[_0xe7ee('0x16')]['id']];}};exports[_0xe7ee('0x31')]=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 d83e20f..5eae84e 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 _0xef89=['../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x412b15,_0x5c29c7){var _0x32c257=function(_0x3b43b5){while(--_0x3b43b5){_0x412b15['push'](_0x412b15['shift']());}};_0x32c257(++_0x5c29c7);}(_0xef89,0xf6));var _0x9ef8=function(_0x3191ea,_0x1a7352){_0x3191ea=_0x3191ea-0x0;var _0x385a79=_0xef89[_0x3191ea];return _0x385a79;};'use strict';var schema=require(_0x9ef8('0x0'));var sh=require(_0x9ef8('0x1'));var _=require(_0x9ef8('0x2'));var utils=require(_0x9ef8('0x3'));var logger=require(_0x9ef8('0x4'))('routing');var system=schema({'command':{'type':_0x9ef8('0x5'),'required':!![],'message':_0x9ef8('0x6')}});exports[_0x9ef8('0x7')]=function(_0x1f2b75,_0x1ebea1){return function(_0x4dd0ba){try{var _0x1698c3={'command':_0x1ebea1[0x0]};var _0x5d40f7=system['validate'](_0x1698c3,{'typecast':!![]});if(_0x5d40f7['length']){logger[_0x9ef8('0x8')](_0x9ef8('0x9'),_0x1f2b75,_[_0x9ef8('0xa')](_0x5d40f7,_0x9ef8('0xb'))[_0x9ef8('0xc')](',\x20'));logger[_0x9ef8('0xd')](_0x9ef8('0xe'),_0x1f2b75);_0x4dd0ba['next']();}else{var _0x6ccc67=this;var _0x49dc9c=utils['getMustacheRender'](_0x1ebea1[0x0],this);logger[_0x9ef8('0xd')](_0x9ef8('0xf'),_0x1f2b75,_0x49dc9c);sh['exec'](_[_0x9ef8('0x10')](_0x49dc9c),function(_0x26a3cb,_0x3af74b){logger[_0x9ef8('0xd')](_0x9ef8('0x11'),_0x1f2b75,_0x26a3cb);if(_0x26a3cb==0x0){var _0x6d291b=_0x3af74b['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1ebea1[0x1])||_[_0x9ef8('0x12')](_0x1ebea1[0x1])){logger[_0x9ef8('0xd')](_0x9ef8('0x13'),_0x1f2b75);_0x6ccc67[_0x9ef8('0x14')][_0x1ebea1[0x1]]=_0x6d291b;}else{logger[_0x9ef8('0xd')](_0x9ef8('0x15'),_0x1f2b75,_0x1ebea1[0x1],_0x6d291b);_0x6ccc67[_0x9ef8('0x14')][_0x1ebea1[0x1]]=_0x6d291b;}}_0x4dd0ba[_0x9ef8('0x16')]();});}}catch(_0x4f4ff2){logger['error'](_0x9ef8('0x9'),_0x1f2b75,_[_0x9ef8('0x17')](_0x4f4ff2)?JSON[_0x9ef8('0x18')](_0x4f4ff2):_0x4f4ff2);logger['info'](_0x9ef8('0xe'),_0x1f2b75);_0x4dd0ba[_0x9ef8('0x16')]();}};}; \ No newline at end of file +var _0x8d5b=['./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate'];(function(_0x4c4854,_0x16418c){var _0x40d06a=function(_0x2efceb){while(--_0x2efceb){_0x4c4854['push'](_0x4c4854['shift']());}};_0x40d06a(++_0x16418c);}(_0x8d5b,0x19f));var _0xb8d5=function(_0x5c7055,_0x550d42){_0x5c7055=_0x5c7055-0x0;var _0x20d196=_0x8d5b[_0x5c7055];return _0x20d196;};'use strict';var schema=require(_0xb8d5('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0xb8d5('0x1'));var logger=require(_0xb8d5('0x2'))(_0xb8d5('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0xb8d5('0x4')}});exports[_0xb8d5('0x5')]=function(_0x1a7148,_0x41fe17){return function(_0x4ffda8){try{var _0x5eb975={'command':_0x41fe17[0x0]};var _0x3a841b=system['validate'](_0x5eb975,{'typecast':!![]});if(_0x3a841b[_0xb8d5('0x6')]){logger[_0xb8d5('0x7')](_0xb8d5('0x8'),_0x1a7148,_['map'](_0x3a841b,_0xb8d5('0x9'))[_0xb8d5('0xa')](',\x20'));logger[_0xb8d5('0xb')](_0xb8d5('0xc'),_0x1a7148);_0x4ffda8['next']();}else{var _0x2b90e3=this;var _0x54d737=utils[_0xb8d5('0xd')](_0x41fe17[0x0],this);logger[_0xb8d5('0xb')](_0xb8d5('0xe'),_0x1a7148,_0x54d737);sh[_0xb8d5('0xf')](_[_0xb8d5('0x10')](_0x54d737),function(_0x518c51,_0x53ab56){logger[_0xb8d5('0xb')](_0xb8d5('0x11'),_0x1a7148,_0x518c51);if(_0x518c51==0x0){var _0x13dcdf=_0x53ab56['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xb8d5('0x12')](_0x41fe17[0x1])||_[_0xb8d5('0x13')](_0x41fe17[0x1])){logger[_0xb8d5('0xb')](_0xb8d5('0x14'),_0x1a7148);_0x2b90e3[_0xb8d5('0x15')][_0x41fe17[0x1]]=_0x13dcdf;}else{logger[_0xb8d5('0xb')](_0xb8d5('0x16'),_0x1a7148,_0x41fe17[0x1],_0x13dcdf);_0x2b90e3[_0xb8d5('0x15')][_0x41fe17[0x1]]=_0x13dcdf;}}_0x4ffda8[_0xb8d5('0x17')]();});}}catch(_0xdd3b20){logger[_0xb8d5('0x7')](_0xb8d5('0x8'),_0x1a7148,_[_0xb8d5('0x18')](_0xdd3b20)?JSON[_0xb8d5('0x19')](_0xdd3b20):_0xdd3b20);logger[_0xb8d5('0xb')](_0xb8d5('0xc'),_0x1a7148);_0x4ffda8[_0xb8d5('0x17')]();}};}; \ 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 5e770f0..a2fc354 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 _0x0711=['interaction','stringify','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x3cc82b,_0x259747){var _0x4d2e83=function(_0x485795){while(--_0x485795){_0x3cc82b['push'](_0x3cc82b['shift']());}};_0x4d2e83(++_0x259747);}(_0x0711,0x163));var _0x1071=function(_0x45f002,_0x43f734){_0x45f002=_0x45f002-0x0;var _0x542701=_0x0711[_0x45f002];return _0x542701;};'use strict';var schema=require(_0x1071('0x0'));var _=require(_0x1071('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1071('0x2')),'smsInteraction':require(_0x1071('0x3')),'mailInteraction':require(_0x1071('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x1071('0x5'))(_0x1071('0x6'));var tag=schema({'tag':{'type':_0x1071('0x7'),'required':!![],'message':_0x1071('0x8')}});exports[_0x1071('0x9')]=function(_0x307cdc,_0x5bdff0,_0x2d4395,_0x49ba16){return function(_0x575554){try{var _0x4b6110={'tag':_0x5bdff0[0x0]};var _0x4bf9bd=tag[_0x1071('0x0')](_0x4b6110,{'typecast':!![]});if(_0x4bf9bd[_0x1071('0xa')]){logger[_0x1071('0xb')](_0x1071('0xc'),_0x307cdc,_[_0x1071('0xd')](_0x4bf9bd,_0x1071('0xe'))[_0x1071('0xf')](',\x20'));logger[_0x1071('0x10')](_0x1071('0x11'),_0x307cdc);_0x575554[_0x1071('0x12')]();}else{var _0x47df81={'ids':[_0x5bdff0[0x0]]};if(rpc[_0x49ba16[_0x1071('0x13')]+'Interaction']){rpc[_0x49ba16[_0x1071('0x13')]+_0x1071('0x14')]['addTags'](_0x49ba16['interaction']['id'],_0x47df81)[_0x1071('0x15')](function(_0x35f995){logger[_0x1071('0x10')](_0x1071('0x16'),_0x307cdc,_0x5bdff0[0x1],_0x49ba16['channel'],_0x49ba16[_0x1071('0x17')]['id']);})['catch'](function(_0x5756d0){logger[_0x1071('0xb')]('[%s][TAG]\x20%s',_0x307cdc,JSON[_0x1071('0x18')](_0x5756d0));logger['info'](_0x1071('0x11'),_0x307cdc);})[_0x1071('0x19')](function(){_0x575554[_0x1071('0x12')]();});}}}catch(_0x21888b){logger[_0x1071('0xb')](_0x1071('0xc'),_0x307cdc,_[_0x1071('0x1a')](_0x21888b)?JSON['stringify'](_0x21888b):_0x21888b);logger[_0x1071('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x307cdc);_0x575554[_0x1071('0x12')]();}};}; \ No newline at end of file +var _0x3add=['channel','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','isObject','validate','lodash','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction'];(function(_0x1707ba,_0x516a16){var _0x343ed1=function(_0x26476d){while(--_0x26476d){_0x1707ba['push'](_0x1707ba['shift']());}};_0x343ed1(++_0x516a16);}(_0x3add,0x1b5));var _0xd3ad=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x3add[_0x4695ba];return _0x524b7d;};'use strict';var schema=require(_0xd3ad('0x0'));var _=require(_0xd3ad('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xd3ad('0x2')),'faxInteraction':require(_0xd3ad('0x3')),'whatsappInteraction':require(_0xd3ad('0x4'))};var logger=require(_0xd3ad('0x5'))(_0xd3ad('0x6'));var tag=schema({'tag':{'type':_0xd3ad('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xd3ad('0x8')]=function(_0x19c65e,_0x32312f,_0x3e8463,_0x47dbcc){return function(_0x4da254){try{var _0x21169c={'tag':_0x32312f[0x0]};var _0x4d49f9=tag[_0xd3ad('0x0')](_0x21169c,{'typecast':!![]});if(_0x4d49f9[_0xd3ad('0x9')]){logger[_0xd3ad('0xa')](_0xd3ad('0xb'),_0x19c65e,_[_0xd3ad('0xc')](_0x4d49f9,_0xd3ad('0xd'))[_0xd3ad('0xe')](',\x20'));logger[_0xd3ad('0xf')](_0xd3ad('0x10'),_0x19c65e);_0x4da254[_0xd3ad('0x11')]();}else{var _0x1bb54f={'ids':[_0x32312f[0x0]]};if(rpc[_0x47dbcc['channel']+_0xd3ad('0x12')]){rpc[_0x47dbcc[_0xd3ad('0x13')]+_0xd3ad('0x12')]['addTags'](_0x47dbcc[_0xd3ad('0x14')]['id'],_0x1bb54f)['then'](function(_0x44a7b0){logger[_0xd3ad('0xf')](_0xd3ad('0x15'),_0x19c65e,_0x32312f[0x1],_0x47dbcc['channel'],_0x47dbcc['interaction']['id']);})['catch'](function(_0xeb4ef8){logger['error'](_0xd3ad('0xb'),_0x19c65e,JSON[_0xd3ad('0x16')](_0xeb4ef8));logger[_0xd3ad('0xf')](_0xd3ad('0x10'),_0x19c65e);})['finally'](function(){_0x4da254[_0xd3ad('0x11')]();});}}}catch(_0x1171b4){logger['error'](_0xd3ad('0xb'),_0x19c65e,_[_0xd3ad('0x17')](_0x1171b4)?JSON[_0xd3ad('0x16')](_0x1171b4):_0x1171b4);logger['info'](_0xd3ad('0x10'),_0x19c65e);_0x4da254[_0xd3ad('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index cf33bf3..8ac619c 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 _0x1bdc=['stringify','utf8','POST','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','replace','includes','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params'];(function(_0x405990,_0x2a8c74){var _0x3ad49b=function(_0x5839bf){while(--_0x5839bf){_0x405990['push'](_0x405990['shift']());}};_0x3ad49b(++_0x2a8c74);}(_0x1bdc,0x1c1));var _0xc1bd=function(_0xd3da2a,_0x22241c){_0xd3da2a=_0xd3da2a-0x0;var _0x10ab61=_0x1bdc[_0xd3da2a];return _0x10ab61;};'use strict';var rp=require(_0xc1bd('0x0'));var logger=require(_0xc1bd('0x1'))(_0xc1bd('0x2'));var _=require(_0xc1bd('0x3'));var arr=[];exports['consequence']=function(_0x20e58f,_0x33ab89){return function(_0x221af2){var _0x21fbb1=_0x33ab89[0xa];var _0xbabe2b=_0x33ab89[0xb];var _0x4bd394=_0x33ab89[0xc];var _0x3013f6=_0x33ab89[0xd];var _0x3c3955=_0x33ab89[0xe];var _0x56129d=_0x33ab89[0xf][_0xc1bd('0x4')](/\n/g,'\x20-\x20');var _0x1151b7=_0x33ab89[0x10][_0xc1bd('0x4')](/\n/g,'\x20');if(!arr[_0xc1bd('0x5')](_0xbabe2b)){arr['push'](_0xbabe2b);var _0x3d4a81=_0x33ab89[0x3];var _0x4e806a=_0x33ab89[0x4];var _0x25dabf=_0x33ab89[0x1];var _0x5ee6bc=_0x33ab89[0x0];var _0x40b673={};_0x40b673[_0xc1bd('0x6')]=_0x33ab89[0x8]+_0xc1bd('0x7')+_0x4bd394+'|'+_0x21fbb1+'|'+_0x3013f6+'|'+_0xbabe2b+'|'+_0x3c3955;_0x40b673[_0xc1bd('0x8')]=_0x33ab89[0x7]+_0xc1bd('0x7')+_0x4bd394+'|'+_0x21fbb1+'|'+_0x3013f6+'|'+_0xbabe2b+'|'+_0x3c3955+'|'+_0x56129d+'|'+_0x1151b7;_0x40b673[_0xc1bd('0x9')]=_0x33ab89[0x9];var _0x2e2f9a={};_0x2e2f9a[_0xc1bd('0xa')]=_0xc1bd('0xb');_0x2e2f9a[_0xc1bd('0xc')]=_0xc1bd('0xd');var _0x5a3f8d=[];_0x5a3f8d['push'](_0x33ab89[0x2]);_0x5a3f8d[_0xc1bd('0xe')](_0x33ab89[0x5]);_0x5a3f8d[_0xc1bd('0xe')](_0x33ab89[0x6]);_0x2e2f9a[_0xc1bd('0xf')]=_0x5a3f8d;_0x2e2f9a['id']=0x1;var _0x4c1201=JSON[_0xc1bd('0x10')](_0x2e2f9a);var _0x21d000={'encoding':_0xc1bd('0x11'),'method':_0xc1bd('0x12'),'timeout':0x2710,'url':_0x3d4a81,'headers':{'Content-Type':'application/json-rpc'},'body':_0x4c1201};return rp(_0x21d000)['then'](function(_0x38184e){const _0x384aef=JSON[_0xc1bd('0x13')](_0x38184e);if(!_0x384aef[_0xc1bd('0x14')][_0xc1bd('0x15')]){throw new Error(_0xc1bd('0x16'));}var _0x154a67=_0xbabe2b;var _0x2eb190='channelId='+_0x25dabf+'&serviceId='+_0x5ee6bc+_0xc1bd('0x17')+_0x154a67+'&data='+JSON['stringify'](_0x40b673);var _0x89f456=_0x4e806a+'?'+_0x2eb190;return rp(_0x89f456);})[_0xc1bd('0x18')](function(_0x2baa4b){logger[_0xc1bd('0x19')](_0xc1bd('0x1a'),_0x20e58f,_0x2baa4b);_0x221af2[_0xc1bd('0x1b')]();})[_0xc1bd('0x1c')](function(_0x452bee){logger['error']('[%s][TVOX]\x20%s',_0x20e58f,_['isObject'](_0x452bee)?JSON[_0xc1bd('0x10')](_0x452bee):_0x452bee);_0x221af2[_0xc1bd('0x1b')]();});}else{logger['info'](_0xc1bd('0x1d'),_0x20e58f);_0x221af2[_0xc1bd('0x1e')]();}};}; \ No newline at end of file +var _0x4015=['then','parse','result','logged','channelId=','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','lodash','consequence','\x20-\x20','includes','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params','stringify','utf8','application/json-rpc'];(function(_0x1e2a0d,_0x496ac4){var _0x114651=function(_0x122df0){while(--_0x122df0){_0x1e2a0d['push'](_0x1e2a0d['shift']());}};_0x114651(++_0x496ac4);}(_0x4015,0x1ee));var _0x5401=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x4015[_0x50e593];return _0x3821d0;};'use strict';var rp=require(_0x5401('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0x5401('0x1'));var arr=[];exports[_0x5401('0x2')]=function(_0x450c04,_0x571f82){return function(_0xf66711){var _0x40c28f=_0x571f82[0xa];var _0x5729ae=_0x571f82[0xb];var _0x520cd4=_0x571f82[0xc];var _0x133c47=_0x571f82[0xd];var _0x35b3a5=_0x571f82[0xe];var _0x37a611=_0x571f82[0xf]['replace'](/\n/g,_0x5401('0x3'));var _0x50efd0=_0x571f82[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x5401('0x4')](_0x5729ae)){arr['push'](_0x5729ae);var _0x19c616=_0x571f82[0x3];var _0x188564=_0x571f82[0x4];var _0x2906ec=_0x571f82[0x1];var _0x200392=_0x571f82[0x0];var _0x38663f={};_0x38663f[_0x5401('0x5')]=_0x571f82[0x8]+_0x5401('0x6')+_0x520cd4+'|'+_0x40c28f+'|'+_0x133c47+'|'+_0x5729ae+'|'+_0x35b3a5;_0x38663f[_0x5401('0x7')]=_0x571f82[0x7]+'?params='+_0x520cd4+'|'+_0x40c28f+'|'+_0x133c47+'|'+_0x5729ae+'|'+_0x35b3a5+'|'+_0x37a611+'|'+_0x50efd0;_0x38663f[_0x5401('0x8')]=_0x571f82[0x9];var _0x4d2b27={};_0x4d2b27[_0x5401('0x9')]=_0x5401('0xa');_0x4d2b27[_0x5401('0xb')]=_0x5401('0xc');var _0x10bd90=[];_0x10bd90[_0x5401('0xd')](_0x571f82[0x2]);_0x10bd90[_0x5401('0xd')](_0x571f82[0x5]);_0x10bd90['push'](_0x571f82[0x6]);_0x4d2b27[_0x5401('0xe')]=_0x10bd90;_0x4d2b27['id']=0x1;var _0x279cb6=JSON[_0x5401('0xf')](_0x4d2b27);var _0x5ff377={'encoding':_0x5401('0x10'),'method':'POST','timeout':0x2710,'url':_0x19c616,'headers':{'Content-Type':_0x5401('0x11')},'body':_0x279cb6};return rp(_0x5ff377)[_0x5401('0x12')](function(_0x27aeb0){const _0x1f6b93=JSON[_0x5401('0x13')](_0x27aeb0);if(!_0x1f6b93[_0x5401('0x14')][_0x5401('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1863ab=_0x5729ae;var _0x2543b4=_0x5401('0x16')+_0x2906ec+_0x5401('0x17')+_0x200392+_0x5401('0x18')+_0x1863ab+'&data='+JSON[_0x5401('0xf')](_0x38663f);var _0x4ecaed=_0x188564+'?'+_0x2543b4;return rp(_0x4ecaed);})[_0x5401('0x12')](function(_0x4b899b){logger[_0x5401('0x19')](_0x5401('0x1a'),_0x450c04,_0x4b899b);_0xf66711['stop']();})['catch'](function(_0x2b83d2){logger[_0x5401('0x1b')]('[%s][TVOX]\x20%s',_0x450c04,_[_0x5401('0x1c')](_0x2b83d2)?JSON['stringify'](_0x2b83d2):_0x2b83d2);_0xf66711[_0x5401('0x1d')]();});}else{logger['info'](_0x5401('0x1e'),_0x450c04);_0xf66711[_0x5401('0x1f')]();}};}; \ 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 4903249..21b016c 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x53f586,_0x4381af){var _0x2c59bf=function(_0x2c1b15){while(--_0x2c1b15){_0x53f586['push'](_0x53f586['shift']());}};_0x2c59bf(++_0x4381af);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x4a195b,_0x53a457){var _0x18853a=function(_0x5daace){while(--_0x5daace){_0x4a195b['push'](_0x4a195b['shift']());}};_0x18853a(++_0x53a457);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index f29ee80..373ad04 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 _0x0447=['emit','complete','Skipped\x20routing\x20for\x20%s','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','log','lodash','util','path','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','isNil','IntervalId','Intervals','interval','rules','channel','message','interaction','transfer','applications','isArray','length','join','.js','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','on\x20interval','\x20|\x20','execute','info'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0x0447,0x8b));var _0x7044=function(_0x21e834,_0x29609a){_0x21e834=_0x21e834-0x0;var _0x238b7b=_0x0447[_0x21e834];return _0x238b7b;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var fs=require('fs');var jayson=require(_0x7044('0x3'));var BPromise=require(_0x7044('0x4'));var utils=require('./applications/utils');var sUtils=require(_0x7044('0x5'));var logger=require(_0x7044('0x6'))(_0x7044('0x7'));var rpc={'openchannelQueueReport':require(_0x7044('0x8')),'mailQueueReport':require(_0x7044('0x9')),'chatQueueReport':require(_0x7044('0xa')),'smsQueueReport':require(_0x7044('0xb')),'faxQueueReport':require(_0x7044('0xc')),'whatsappQueueReport':require(_0x7044('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x72d341,_0x42d53b,_0x2a2b36){return util[_0x7044('0xe')]('%s.%s.%s',_0x72d341,_0x42d53b||0x0,_0x2a2b36||0x0);}function getIntervals(_0x41616d,_0x1d1881){var _0x47945d=[];if(!_[_0x7044('0xf')](_0x1d1881[_0x7044('0x10')])&&!_[_0x7044('0xf')](_0x41616d[_0x1d1881[_0x7044('0x10')]])&&!_['isNil'](_0x41616d[_0x1d1881[_0x7044('0x10')]]['Intervals'])){_0x47945d=_['map'](_0x41616d[_0x1d1881['IntervalId']][_0x7044('0x11')],_0x7044('0x12'));}else if(!_[_0x7044('0xf')](_0x1d1881[_0x7044('0x12')])){_0x47945d=[_0x1d1881['interval']];}return _0x47945d;}exports['listen']=function(_0xd5ae12){_0xd5ae12[_0x7044('0x13')]={};return new BPromise(function(_0x58eb57,_0x4d63a8){var _0x798fe3={'Start':function(_0x310535){var _0x79f418=this;return new Promise(function(_0x35769e,_0x2fecb1){if(_0x310535){try{var _0x5cbec7=[];var _0x5c85fc=getId(_0x310535[_0x7044('0x14')],_0x310535[_0x7044('0x15')]?_0x310535[_0x7044('0x15')]['id']:0x0,_0x310535[_0x7044('0x16')]?_0x310535[_0x7044('0x16')]['id']:0x0);var _0x3f373c=sUtils['checkWaitingNotifications'](_0xd5ae12,_0x310535);if(_0x310535[_0x7044('0x17')]||!_0x3f373c&&_0x310535[_0x7044('0x18')]&&_[_0x7044('0x19')](_0x310535['applications'])&&_0x310535['applications']['length']){for(var _0xced6e4=0x0;_0xced6e4<_0x310535[_0x7044('0x18')][_0x7044('0x1a')];_0xced6e4+=0x1){var _0x4104a9=_0x310535[_0x7044('0x18')][_0xced6e4];if(fs['existsSync'](path[_0x7044('0x1b')](__dirname,'applications',_0x4104a9['app']+_0x7044('0x1c')))){var _0x8bd8c8=[];switch(_0x4104a9[_0x7044('0x1d')][_0x7044('0x1e')]()){case _0x7044('0x1f'):var _0x105da8=_0x4104a9[_0x7044('0x20')][_0x7044('0x21')](',');if(_0x310535[_0x7044('0x14')]==='mail'){_0x8bd8c8['push'](_0x105da8[0x0]);_0x8bd8c8[_0x7044('0x22')](_0x105da8[0x1]);_0x8bd8c8[_0x7044('0x22')](_0x105da8[_0x7044('0x23')](0x2,_0x105da8[_0x7044('0x1a')])[_0x7044('0x1b')](','));}else{_0x8bd8c8[_0x7044('0x22')](_0x105da8[0x0]);_0x8bd8c8[_0x7044('0x22')](_0x105da8[_0x7044('0x23')](0x1,_0x105da8[_0x7044('0x1a')])[_0x7044('0x1b')](','));}break;case _0x7044('0x24'):var _0x115d5c=_0x4104a9['appdata'][_0x7044('0x21')](',');_0x8bd8c8[_0x7044('0x22')](_0x115d5c[0x0]);_0x8bd8c8[_0x7044('0x22')](_0x115d5c[0x1]);_0x8bd8c8[_0x7044('0x22')](_0x115d5c['slice'](0x2,_0x115d5c[_0x7044('0x1a')])['join'](','));break;case'dialogflowv2':var _0x5c049d=_0x4104a9[_0x7044('0x20')]['split'](',');_0x8bd8c8[_0x7044('0x22')](_0x5c049d[0x0]);_0x8bd8c8[_0x7044('0x22')](_0x5c049d[0x1]);_0x8bd8c8['push'](_0x5c049d[0x2]);_0x8bd8c8['push'](_0x5c049d[0x3]);_0x8bd8c8[_0x7044('0x22')](_0x5c049d['slice'](0x4,_0x5c049d['length'])['join'](','));break;case _0x7044('0x25'):var _0x175405=_0x4104a9['appdata'][_0x7044('0x21')](',');_0x8bd8c8[_0x7044('0x22')](_0x175405[0x0]);_0x8bd8c8[_0x7044('0x22')](_0x175405[0x1]);_0x8bd8c8[_0x7044('0x22')](_0x175405[0x2]);_0x8bd8c8[_0x7044('0x22')](_0x175405[0x3]);_0x8bd8c8['push'](_0x175405[_0x7044('0x23')](0x4,_0x175405[_0x7044('0x1a')])[_0x7044('0x1b')](','));break;case _0x7044('0x15'):_0x8bd8c8[_0x7044('0x22')](_0x4104a9['appdata']);break;case _0x7044('0x26'):_0x8bd8c8[_0x7044('0x22')](_0x4104a9['TagId']);_0x8bd8c8[_0x7044('0x22')](_0x4104a9[_0x7044('0x20')]);break;case _0x7044('0x27'):var _0x1a3c1d=utils[_0x7044('0x28')](_0x310535[_0x7044('0x29')]['notificationTemplate'],_0x310535);var _0x5a59b8=_0x4104a9[_0x7044('0x20')][_0x7044('0x21')](',');_0x8bd8c8['push'](_0x5a59b8[0x0]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x1]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x2]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x3]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x4]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x5]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x6]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x7]);_0x8bd8c8[_0x7044('0x22')](_0x5a59b8[0x8]);_0x8bd8c8['push'](_0x5a59b8[0x9]);_0x8bd8c8['push'](_0x5a59b8[0xa]);_0x8bd8c8[_0x7044('0x22')](_0x310535[_0x7044('0x16')]['id']);_0x8bd8c8[_0x7044('0x22')](_0x310535[_0x7044('0x15')]['id']);_0x8bd8c8[_0x7044('0x22')](_0x4104a9[_0x7044('0x2a')]);_0x8bd8c8[_0x7044('0x22')](_0x310535['interaction'][_0x7044('0x2b')]);_0x8bd8c8[_0x7044('0x22')](_0x310535[_0x7044('0x2c')]['body']);_0x8bd8c8[_0x7044('0x22')](_0x1a3c1d);break;default:_0x8bd8c8=_['isNil'](_0x4104a9['appdata'])?[]:_0x4104a9[_0x7044('0x20')]['split'](',');}var _0x221a67={'id':util[_0x7044('0xe')](_0x7044('0x2d'),_0x5c85fc,_0x4104a9['id'],_0x4104a9[_0x7044('0x1d')]),'condition':require(_0x7044('0x2e'))[_0x7044('0x2f')](_0x5c85fc,getIntervals(_0xd5ae12[_0x7044('0x30')],_0x4104a9),_0xd5ae12),'consequence':require(_0x7044('0x31')+_0x4104a9[_0x7044('0x1d')])[_0x7044('0x32')](_0x5c85fc,_0x8bd8c8,_0xd5ae12,_0x310535),'p':_0x4104a9['priority']||0x0};logger['info']('Push\x20new\x20rule',_0x221a67['id'],_0x7044('0x33'),getIntervals(_0xd5ae12[_0x7044('0x30')],_0x4104a9)[_0x7044('0x1b')](_0x7044('0x34')));_0x5cbec7['push'](_0x221a67);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x7044('0x1b')](__dirname,_0x7044('0x18'),_0x4104a9[_0x7044('0x1d')]+_0x7044('0x1c')));}}_0xd5ae12[_0x7044('0x13')][_0x5c85fc]=new RuleEngine(_0x5cbec7);_0xd5ae12[_0x7044('0x13')][_0x5c85fc][_0x7044('0x35')](_0x310535,function(_0x36f9d5){logger[_0x7044('0x36')]('Applications\x20executed',JSON['stringify'](_0x36f9d5['matchPath']));if(_0xd5ae12[_0x7044('0x13')][_0x5c85fc]){_0xd5ae12[_0x7044('0x13')][_0x5c85fc][_0x7044('0x37')](_0x7044('0x38'));}});return _0x35769e({'code':0xc8,'message':_0x310535});}else{if(_0x3f373c){logger[_0x7044('0x36')](util[_0x7044('0xe')](_0x7044('0x39'),_0x5c85fc));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x35769e({'code':0xc8,'message':_0x310535});}}catch(_0x41b367){logger[_0x7044('0x3a')](_0x41b367[_0x7044('0x3b')]);return _0x2fecb1(_0x79f418[_0x7044('0x3a')](0x1f4,_0x41b367));}}return _0x2fecb1(_0x7044('0x3c'));});},'AcceptMessage':function(_0x436e45){var _0x4e4d17=this;return new Promise(function(_0x569672,_0x52514c){if(_0x436e45[_0x7044('0x3d')]&&_0x436e45[_0x7044('0x3d')]['id']){if(_0xd5ae12[_0x7044('0x3e')][_0x436e45[_0x7044('0x3d')]['id']]){_0xd5ae12['agents'][_0x436e45[_0x7044('0x3d')]['id']][_0x7044('0x3f')]=![];_0xd5ae12[_0x7044('0x3e')][_0x436e45['agent']['id']][_0x7044('0x40')]=undefined;}}if(_0x436e45[_0x7044('0x15')]&&_0x436e45[_0x7044('0x15')]['id']){try{var _0x5d85bf=getId(_0x436e45[_0x7044('0x14')],_0x436e45[_0x7044('0x15')]?_0x436e45[_0x7044('0x15')]['id']:0x0,_0x436e45[_0x7044('0x16')]?_0x436e45['interaction']['id']:0x0);if(_0xd5ae12[_0x7044('0x13')][_0x5d85bf]){_0xd5ae12[_0x7044('0x13')][_0x5d85bf]['emit'](_0x7044('0x41'));if(rpc[_0x436e45[_0x7044('0x14')]+_0x7044('0x42')]){rpc[_0x436e45[_0x7044('0x14')]+_0x7044('0x42')]['update'](_0x5d85bf,{'UserId':_0x436e45[_0x7044('0x15')][_0x7044('0x43')]})['catch'](function(){logger['error'](_0x7044('0x44'));});}}return _0x569672({'code':0xc8,'message':_0x436e45});}catch(_0x16f0b0){logger[_0x7044('0x3a')](_0x16f0b0[_0x7044('0x3b')]);return _0x52514c(_0x4e4d17['error'](0x1f4,_0x16f0b0));}}logger[_0x7044('0x3a')](_0x7044('0x45'));return _0x52514c(_0x4e4d17[_0x7044('0x3a')](0x1f4,_0x7044('0x45')));});},'RejectMessage':function(_0x1113e6){var _0x2f178a=this;return new Promise(function(_0x344f38,_0x15a2f6){if(_0x1113e6[_0x7044('0x3d')]&&_0x1113e6[_0x7044('0x3d')]['id']){try{if(_0xd5ae12[_0x7044('0x3e')][_0x1113e6[_0x7044('0x3d')]['id']]){_0xd5ae12[_0x7044('0x3e')][_0x1113e6[_0x7044('0x3d')]['id']][_0x7044('0x3f')]=![];_0xd5ae12['agents'][_0x1113e6['agent']['id']]['busyQueue']=undefined;}return _0x344f38({'code':0xc8,'message':_0x1113e6});}catch(_0x161caa){logger[_0x7044('0x3a')](_0x161caa[_0x7044('0x3b')]);return _0x15a2f6(_0x2f178a[_0x7044('0x3a')](0x1f4,_0x161caa));}}logger[_0x7044('0x3a')](_0x7044('0x45'));return _0x15a2f6(_0x2f178a['error'](0x1f4,_0x7044('0x45')));});},'AbandonInteraction':function(_0x51ea47){var _0x20b263=this;return new Promise(function(_0x394534,_0x256333){if(_0x51ea47[_0x7044('0x14')]&&_0x51ea47[_0x7044('0x16')]&&_0x51ea47[_0x7044('0x16')]['id']){try{var _0x505d42=getId(_0x51ea47['channel'],_0x51ea47[_0x7044('0x15')]?_0x51ea47[_0x7044('0x15')]['id']:0x0,_0x51ea47[_0x7044('0x16')]?_0x51ea47[_0x7044('0x16')]['id']:0x0);if(_0xd5ae12[_0x7044('0x13')][_0x505d42]){_0xd5ae12[_0x7044('0x13')][_0x505d42][_0x7044('0x37')]('end');}return _0x394534({'code':0xc8,'message':_0x51ea47});}catch(_0x1631bd){logger[_0x7044('0x3a')](_0x1631bd['stack']);return _0x256333(_0x20b263[_0x7044('0x3a')](0x1f4,_0x1631bd));}}logger[_0x7044('0x3a')](_0x7044('0x45'));return _0x256333(_0x20b263[_0x7044('0x3a')](0x1f4,_0x7044('0x45')));});},'AgentCapacity':function(_0x5cc6e8){var _0x59101c=this;return new Promise(function(_0x239a2e,_0x2175a3){if(_0xd5ae12['agents'][_0x7044('0x46')](_0x5cc6e8['id'])){for(var _0x7a0c6d in _0x5cc6e8[_0x7044('0x47')]){if(_0x5cc6e8[_0x7044('0x47')][_0x7044('0x46')](_0x7a0c6d)){if(_0xd5ae12[_0x7044('0x3e')][_0x5cc6e8['id']]['hasOwnProperty'](_0x7a0c6d+_0x7044('0x48'))){_0xd5ae12[_0x7044('0x3e')][_0x5cc6e8['id']][_0x7a0c6d+_0x7044('0x48')]=parseInt(_0x5cc6e8[_0x7044('0x47')][_0x7a0c6d],0xa);}}}_0xd5ae12['agents'][_0x5cc6e8['id']][_0x7044('0x49')]();return _0x239a2e({'code':0xc8,'message':_0xd5ae12['agents'][_0x5cc6e8['id']]});}else{return _0x2175a3(_0x59101c[_0x7044('0x3a')](0x1f4,_0x7044('0x4a')));}});},'Agents':function(_0x5e98ec){return new Promise(function(_0x5f20da){var _0x6f785b=_[_0x7044('0x4b')](_0xd5ae12[_0x7044('0x3e')]);if(_0x5e98ec&&_0x5e98ec['id']){var _0x185fff=_[_0x7044('0x4c')](_0x6f785b,function(_0x19214f){return _0x19214f['id']===_0x5e98ec['id'];});_0x5f20da(_0x185fff);}else{_0x5f20da({'count':_0x6f785b[_0x7044('0x1a')],'rows':_0x6f785b});}});},'ChatQueues':function(){return new Promise(function(_0x471859){var _0xd27bb9=[];for(var _0x3baf96 in _0xd5ae12[_0x7044('0x4d')]){if(_0xd5ae12[_0x7044('0x4d')][_0x7044('0x46')](_0x3baf96)){var _0x2ddf80=_0xd5ae12['chatQueues'][_0x3baf96];var _0x51198d={'id':_0x2ddf80['id'],'available':_0x2ddf80[_0x7044('0x4e')],'loggedIn':_0x2ddf80['loggedIn'],'name':_0x2ddf80['name'],'paused':_0x2ddf80[_0x7044('0x4f')],'waiting':_0x2ddf80[_0x7044('0x50')]};_0xd27bb9['push'](_0x51198d);}}_0x471859({'count':_0xd27bb9[_0x7044('0x1a')],'rows':_0xd27bb9});});},'MailQueues':function(){return new Promise(function(_0x5dd111){var _0x4219a3=[];for(var _0x3e482b in _0xd5ae12[_0x7044('0x51')]){if(_0xd5ae12[_0x7044('0x51')][_0x7044('0x46')](_0x3e482b)){var _0x36dc98=_0xd5ae12[_0x7044('0x51')][_0x3e482b];var _0x16ebf9={'id':_0x36dc98['id'],'available':_0x36dc98['available'],'loggedIn':_0x36dc98[_0x7044('0x52')],'name':_0x36dc98[_0x7044('0x53')],'paused':_0x36dc98[_0x7044('0x4f')],'waiting':_0x36dc98[_0x7044('0x50')]};_0x4219a3[_0x7044('0x22')](_0x16ebf9);}}_0x5dd111({'count':_0x4219a3['length'],'rows':_0x4219a3});});},'OpenchannelQueues':function(){return new Promise(function(_0x31cf08){var _0x16d2bb=[];for(var _0x26f391 in _0xd5ae12['openchannelQueues']){if(_0xd5ae12['openchannelQueues'][_0x7044('0x46')](_0x26f391)){var _0xb7e0b4=_0xd5ae12[_0x7044('0x54')][_0x26f391];var _0x2e7928={'id':_0xb7e0b4['id'],'available':_0xb7e0b4[_0x7044('0x4e')],'loggedIn':_0xb7e0b4['loggedIn'],'name':_0xb7e0b4[_0x7044('0x53')],'paused':_0xb7e0b4[_0x7044('0x4f')],'waiting':_0xb7e0b4[_0x7044('0x50')]};_0x16d2bb['push'](_0x2e7928);}}_0x31cf08({'count':_0x16d2bb[_0x7044('0x1a')],'rows':_0x16d2bb});});},'SmsQueues':function(){return new Promise(function(_0x48ba3d){var _0xa2d21f=[];for(var _0x12bf9e in _0xd5ae12['smsQueues']){if(_0xd5ae12['smsQueues'][_0x7044('0x46')](_0x12bf9e)){var _0x4605c5=_0xd5ae12[_0x7044('0x55')][_0x12bf9e];var _0x284ae1={'id':_0x4605c5['id'],'available':_0x4605c5[_0x7044('0x4e')],'loggedIn':_0x4605c5[_0x7044('0x52')],'name':_0x4605c5[_0x7044('0x53')],'paused':_0x4605c5[_0x7044('0x4f')],'waiting':_0x4605c5[_0x7044('0x50')]};_0xa2d21f['push'](_0x284ae1);}}_0x48ba3d({'count':_0xa2d21f['length'],'rows':_0xa2d21f});});},'FaxQueues':function(){return new Promise(function(_0x9996c5){var _0x5c7450=[];for(var _0x50cab0 in _0xd5ae12[_0x7044('0x56')]){if(_0xd5ae12[_0x7044('0x56')][_0x7044('0x46')](_0x50cab0)){var _0x3d9ef0=_0xd5ae12['faxQueues'][_0x50cab0];var _0x3f0e01={'id':_0x3d9ef0['id'],'available':_0x3d9ef0['available'],'loggedIn':_0x3d9ef0[_0x7044('0x52')],'name':_0x3d9ef0[_0x7044('0x53')],'paused':_0x3d9ef0[_0x7044('0x4f')],'waiting':_0x3d9ef0[_0x7044('0x50')]};_0x5c7450[_0x7044('0x22')](_0x3f0e01);}}_0x9996c5({'count':_0x5c7450['length'],'rows':_0x5c7450});});},'WhatsappQueues':function(){return new Promise(function(_0x29c40e){var _0x3a959a=[];for(var _0x505632 in _0xd5ae12[_0x7044('0x57')]){if(_0xd5ae12[_0x7044('0x57')][_0x7044('0x46')](_0x505632)){var _0x45419f=_0xd5ae12['whatsappQueues'][_0x505632];var _0x5956eb={'id':_0x45419f['id'],'available':_0x45419f['available'],'loggedIn':_0x45419f[_0x7044('0x52')],'name':_0x45419f[_0x7044('0x53')],'paused':_0x45419f[_0x7044('0x4f')],'waiting':_0x45419f[_0x7044('0x50')]};_0x3a959a[_0x7044('0x22')](_0x5956eb);}}_0x29c40e({'count':_0x3a959a['length'],'rows':_0x3a959a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x25e551){var _0x57e1cd=_[_0x7044('0x4b')](_0xd5ae12[_0x7044('0x58')]);_0x25e551({'count':_0x57e1cd[_0x7044('0x1a')],'rows':_0x57e1cd});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x22c4b8){var _0x1edc2d=_[_0x7044('0x4b')](_0xd5ae12[_0x7044('0x59')]);_0x22c4b8({'count':_0x1edc2d[_0x7044('0x1a')],'rows':_0x1edc2d});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x52e710){var _0x2dd19c=_[_0x7044('0x4b')](_0xd5ae12[_0x7044('0x5a')]);_0x52e710({'count':_0x2dd19c[_0x7044('0x1a')],'rows':_0x2dd19c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xd7e30e){var _0x39d69f=_['values'](_0xd5ae12[_0x7044('0x5b')]);_0xd7e30e({'count':_0x39d69f['length'],'rows':_0x39d69f});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1e0601){var _0x440fce=_[_0x7044('0x4b')](_0xd5ae12[_0x7044('0x5c')]);_0x1e0601({'count':_0x440fce[_0x7044('0x1a')],'rows':_0x440fce});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x46be2e){var _0x5103ff=_['values'](_0xd5ae12[_0x7044('0x5d')]);_0x46be2e({'count':_0x5103ff[_0x7044('0x1a')],'rows':_0x5103ff});});}};var _0x19175f=jayson[_0x7044('0x5e')](_0x798fe3)['http']();_0x19175f['on']('error',function(_0x3ddad0){logger[_0x7044('0x3a')](JSON[_0x7044('0x5f')](_0x3ddad0));return _0x4d63a8(_0x3ddad0);});_0x19175f['listen'](0x232c,'127.0.0.1',function(){console[_0x7044('0x60')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x58eb57('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x6db4=['push','slice','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','rules','execute','Applications\x20executed','stringify','matchPath','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busy','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','emit','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','message','interaction','checkWaitingNotifications','transfer','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','split','channel','mail'];(function(_0x4906ca,_0x7cb8c0){var _0x493642=function(_0x3624fa){while(--_0x3624fa){_0x4906ca['push'](_0x4906ca['shift']());}};_0x493642(++_0x7cb8c0);}(_0x6db4,0x111));var _0x46db=function(_0x409e47,_0x49e464){_0x409e47=_0x409e47-0x0;var _0x2d86db=_0x6db4[_0x409e47];return _0x2d86db;};'use strict';var _=require('lodash');var util=require(_0x46db('0x0'));var path=require(_0x46db('0x1'));var fs=require('fs');var jayson=require(_0x46db('0x2'));var BPromise=require(_0x46db('0x3'));var utils=require(_0x46db('0x4'));var sUtils=require(_0x46db('0x5'));var logger=require('../../../config/logger')(_0x46db('0x6'));var rpc={'openchannelQueueReport':require(_0x46db('0x7')),'mailQueueReport':require(_0x46db('0x8')),'chatQueueReport':require(_0x46db('0x9')),'smsQueueReport':require(_0x46db('0xa')),'faxQueueReport':require(_0x46db('0xb')),'whatsappQueueReport':require(_0x46db('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x3a2dcb,_0x2a597d,_0x27b949){return util[_0x46db('0xd')](_0x46db('0xe'),_0x3a2dcb,_0x2a597d||0x0,_0x27b949||0x0);}function getIntervals(_0x427c62,_0x2a36f8){var _0x271c75=[];if(!_[_0x46db('0xf')](_0x2a36f8[_0x46db('0x10')])&&!_[_0x46db('0xf')](_0x427c62[_0x2a36f8[_0x46db('0x10')]])&&!_['isNil'](_0x427c62[_0x2a36f8[_0x46db('0x10')]][_0x46db('0x11')])){_0x271c75=_[_0x46db('0x12')](_0x427c62[_0x2a36f8[_0x46db('0x10')]][_0x46db('0x11')],_0x46db('0x13'));}else if(!_[_0x46db('0xf')](_0x2a36f8[_0x46db('0x13')])){_0x271c75=[_0x2a36f8[_0x46db('0x13')]];}return _0x271c75;}exports['listen']=function(_0x54b34d){_0x54b34d['rules']={};return new BPromise(function(_0x417caf,_0xed8db9){var _0x5c982c={'Start':function(_0x1a79a6){var _0x479544=this;return new Promise(function(_0x30e5a9,_0x5dccf9){if(_0x1a79a6){try{var _0x12976b=[];var _0x41a0bc=getId(_0x1a79a6['channel'],_0x1a79a6[_0x46db('0x14')]?_0x1a79a6[_0x46db('0x14')]['id']:0x0,_0x1a79a6[_0x46db('0x15')]?_0x1a79a6[_0x46db('0x15')]['id']:0x0);var _0x1e24e6=sUtils[_0x46db('0x16')](_0x54b34d,_0x1a79a6);if(_0x1a79a6[_0x46db('0x17')]||!_0x1e24e6&&_0x1a79a6[_0x46db('0x18')]&&_['isArray'](_0x1a79a6[_0x46db('0x18')])&&_0x1a79a6[_0x46db('0x18')][_0x46db('0x19')]){for(var _0x53bf89=0x0;_0x53bf89<_0x1a79a6['applications']['length'];_0x53bf89+=0x1){var _0x597a95=_0x1a79a6[_0x46db('0x18')][_0x53bf89];if(fs[_0x46db('0x1a')](path[_0x46db('0x1b')](__dirname,'applications',_0x597a95['app']+_0x46db('0x1c')))){var _0x3601e4=[];switch(_0x597a95[_0x46db('0x1d')][_0x46db('0x1e')]()){case _0x46db('0x1f'):var _0x2d3688=_0x597a95[_0x46db('0x20')][_0x46db('0x21')](',');if(_0x1a79a6[_0x46db('0x22')]===_0x46db('0x23')){_0x3601e4['push'](_0x2d3688[0x0]);_0x3601e4[_0x46db('0x24')](_0x2d3688[0x1]);_0x3601e4[_0x46db('0x24')](_0x2d3688[_0x46db('0x25')](0x2,_0x2d3688[_0x46db('0x19')])[_0x46db('0x1b')](','));}else{_0x3601e4[_0x46db('0x24')](_0x2d3688[0x0]);_0x3601e4['push'](_0x2d3688[_0x46db('0x25')](0x1,_0x2d3688[_0x46db('0x19')])[_0x46db('0x1b')](','));}break;case'dialogflow':var _0x131d75=_0x597a95[_0x46db('0x20')][_0x46db('0x21')](',');_0x3601e4[_0x46db('0x24')](_0x131d75[0x0]);_0x3601e4[_0x46db('0x24')](_0x131d75[0x1]);_0x3601e4[_0x46db('0x24')](_0x131d75[_0x46db('0x25')](0x2,_0x131d75[_0x46db('0x19')])[_0x46db('0x1b')](','));break;case _0x46db('0x26'):var _0x574f9c=_0x597a95[_0x46db('0x20')][_0x46db('0x21')](',');_0x3601e4['push'](_0x574f9c[0x0]);_0x3601e4[_0x46db('0x24')](_0x574f9c[0x1]);_0x3601e4[_0x46db('0x24')](_0x574f9c[0x2]);_0x3601e4[_0x46db('0x24')](_0x574f9c[0x3]);_0x3601e4[_0x46db('0x24')](_0x574f9c[_0x46db('0x25')](0x4,_0x574f9c[_0x46db('0x19')])[_0x46db('0x1b')](','));break;case _0x46db('0x27'):var _0x38108b=_0x597a95[_0x46db('0x20')][_0x46db('0x21')](',');_0x3601e4[_0x46db('0x24')](_0x38108b[0x0]);_0x3601e4['push'](_0x38108b[0x1]);_0x3601e4['push'](_0x38108b[0x2]);_0x3601e4[_0x46db('0x24')](_0x38108b[0x3]);_0x3601e4[_0x46db('0x24')](_0x38108b[_0x46db('0x25')](0x4,_0x38108b['length'])[_0x46db('0x1b')](','));break;case _0x46db('0x14'):_0x3601e4['push'](_0x597a95[_0x46db('0x20')]);break;case _0x46db('0x28'):_0x3601e4[_0x46db('0x24')](_0x597a95[_0x46db('0x29')]);_0x3601e4[_0x46db('0x24')](_0x597a95['appdata']);break;case'tvox':var _0x304588=utils[_0x46db('0x2a')](_0x1a79a6[_0x46db('0x2b')][_0x46db('0x2c')],_0x1a79a6);var _0x2dd421=_0x597a95['appdata'][_0x46db('0x21')](',');_0x3601e4[_0x46db('0x24')](_0x2dd421[0x0]);_0x3601e4[_0x46db('0x24')](_0x2dd421[0x1]);_0x3601e4['push'](_0x2dd421[0x2]);_0x3601e4['push'](_0x2dd421[0x3]);_0x3601e4[_0x46db('0x24')](_0x2dd421[0x4]);_0x3601e4[_0x46db('0x24')](_0x2dd421[0x5]);_0x3601e4[_0x46db('0x24')](_0x2dd421[0x6]);_0x3601e4[_0x46db('0x24')](_0x2dd421[0x7]);_0x3601e4[_0x46db('0x24')](_0x2dd421[0x8]);_0x3601e4[_0x46db('0x24')](_0x2dd421[0x9]);_0x3601e4['push'](_0x2dd421[0xa]);_0x3601e4['push'](_0x1a79a6[_0x46db('0x15')]['id']);_0x3601e4[_0x46db('0x24')](_0x1a79a6['message']['id']);_0x3601e4[_0x46db('0x24')](_0x597a95['ChatWebsiteId']);_0x3601e4[_0x46db('0x24')](_0x1a79a6['interaction'][_0x46db('0x2d')]);_0x3601e4[_0x46db('0x24')](_0x1a79a6[_0x46db('0x2e')][_0x46db('0x2e')]);_0x3601e4['push'](_0x304588);break;default:_0x3601e4=_['isNil'](_0x597a95['appdata'])?[]:_0x597a95[_0x46db('0x20')][_0x46db('0x21')](',');}var _0x3b092c={'id':util[_0x46db('0xd')]('%s:%s:%s',_0x41a0bc,_0x597a95['id'],_0x597a95[_0x46db('0x1d')]),'condition':require(_0x46db('0x2f'))[_0x46db('0x30')](_0x41a0bc,getIntervals(_0x54b34d[_0x46db('0x31')],_0x597a95),_0x54b34d),'consequence':require(_0x46db('0x32')+_0x597a95[_0x46db('0x1d')])[_0x46db('0x33')](_0x41a0bc,_0x3601e4,_0x54b34d,_0x1a79a6),'p':_0x597a95[_0x46db('0x34')]||0x0};logger[_0x46db('0x35')](_0x46db('0x36'),_0x3b092c['id'],_0x46db('0x37'),getIntervals(_0x54b34d[_0x46db('0x31')],_0x597a95)[_0x46db('0x1b')](_0x46db('0x38')));_0x12976b[_0x46db('0x24')](_0x3b092c);}else{logger[_0x46db('0x39')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x46db('0x1b')](__dirname,_0x46db('0x18'),_0x597a95[_0x46db('0x1d')]+_0x46db('0x1c')));}}_0x54b34d[_0x46db('0x3a')][_0x41a0bc]=new RuleEngine(_0x12976b);_0x54b34d['rules'][_0x41a0bc][_0x46db('0x3b')](_0x1a79a6,function(_0x107fd5){logger[_0x46db('0x35')](_0x46db('0x3c'),JSON[_0x46db('0x3d')](_0x107fd5[_0x46db('0x3e')]));if(_0x54b34d[_0x46db('0x3a')][_0x41a0bc]){_0x54b34d[_0x46db('0x3a')][_0x41a0bc]['emit']('complete');}});return _0x30e5a9({'code':0xc8,'message':_0x1a79a6});}else{if(_0x1e24e6){logger[_0x46db('0x35')](util[_0x46db('0xd')](_0x46db('0x3f'),_0x41a0bc));}else{logger[_0x46db('0x35')]('No\x20applications\x20to\x20execute');}return _0x30e5a9({'code':0xc8,'message':_0x1a79a6});}}catch(_0x46acde){logger[_0x46db('0x39')](_0x46acde[_0x46db('0x40')]);return _0x5dccf9(_0x479544[_0x46db('0x39')](0x1f4,_0x46acde));}}return _0x5dccf9(_0x46db('0x41'));});},'AcceptMessage':function(_0x193b2f){var _0x65ba95=this;return new Promise(function(_0x3d87ce,_0xb157b9){if(_0x193b2f[_0x46db('0x42')]&&_0x193b2f['agent']['id']){if(_0x54b34d[_0x46db('0x43')][_0x193b2f['agent']['id']]){_0x54b34d[_0x46db('0x43')][_0x193b2f[_0x46db('0x42')]['id']][_0x46db('0x44')]=![];_0x54b34d[_0x46db('0x43')][_0x193b2f[_0x46db('0x42')]['id']]['busyQueue']=undefined;}}if(_0x193b2f[_0x46db('0x14')]&&_0x193b2f[_0x46db('0x14')]['id']){try{var _0x523aa2=getId(_0x193b2f[_0x46db('0x22')],_0x193b2f[_0x46db('0x14')]?_0x193b2f['message']['id']:0x0,_0x193b2f[_0x46db('0x15')]?_0x193b2f[_0x46db('0x15')]['id']:0x0);if(_0x54b34d['rules'][_0x523aa2]){_0x54b34d['rules'][_0x523aa2]['emit']('end');if(rpc[_0x193b2f[_0x46db('0x22')]+'QueueReport']){rpc[_0x193b2f[_0x46db('0x22')]+_0x46db('0x45')][_0x46db('0x46')](_0x523aa2,{'UserId':_0x193b2f['message'][_0x46db('0x47')]})[_0x46db('0x48')](function(){logger[_0x46db('0x39')](_0x46db('0x49'));});}}return _0x3d87ce({'code':0xc8,'message':_0x193b2f});}catch(_0x4b4ee3){logger[_0x46db('0x39')](_0x4b4ee3[_0x46db('0x40')]);return _0xb157b9(_0x65ba95['error'](0x1f4,_0x4b4ee3));}}logger['error']('message\x20is\x20empty');return _0xb157b9(_0x65ba95[_0x46db('0x39')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x200fd1){var _0x40d633=this;return new Promise(function(_0x80c535,_0x5adbce){if(_0x200fd1[_0x46db('0x42')]&&_0x200fd1[_0x46db('0x42')]['id']){try{if(_0x54b34d[_0x46db('0x43')][_0x200fd1[_0x46db('0x42')]['id']]){_0x54b34d[_0x46db('0x43')][_0x200fd1['agent']['id']][_0x46db('0x44')]=![];_0x54b34d['agents'][_0x200fd1[_0x46db('0x42')]['id']]['busyQueue']=undefined;}return _0x80c535({'code':0xc8,'message':_0x200fd1});}catch(_0x251da5){logger[_0x46db('0x39')](_0x251da5[_0x46db('0x40')]);return _0x5adbce(_0x40d633[_0x46db('0x39')](0x1f4,_0x251da5));}}logger['error'](_0x46db('0x4a'));return _0x5adbce(_0x40d633[_0x46db('0x39')](0x1f4,_0x46db('0x4a')));});},'AbandonInteraction':function(_0x50b590){var _0x5e9693=this;return new Promise(function(_0x219ae3,_0x3370d1){if(_0x50b590['channel']&&_0x50b590['interaction']&&_0x50b590[_0x46db('0x15')]['id']){try{var _0x982ccf=getId(_0x50b590[_0x46db('0x22')],_0x50b590[_0x46db('0x14')]?_0x50b590['message']['id']:0x0,_0x50b590[_0x46db('0x15')]?_0x50b590[_0x46db('0x15')]['id']:0x0);if(_0x54b34d[_0x46db('0x3a')][_0x982ccf]){_0x54b34d['rules'][_0x982ccf][_0x46db('0x4b')]('end');}return _0x219ae3({'code':0xc8,'message':_0x50b590});}catch(_0x5082c0){logger[_0x46db('0x39')](_0x5082c0[_0x46db('0x40')]);return _0x3370d1(_0x5e9693[_0x46db('0x39')](0x1f4,_0x5082c0));}}logger[_0x46db('0x39')](_0x46db('0x4a'));return _0x3370d1(_0x5e9693[_0x46db('0x39')](0x1f4,_0x46db('0x4a')));});},'AgentCapacity':function(_0x92438c){var _0x434434=this;return new Promise(function(_0x5c5826,_0x48ee68){if(_0x54b34d['agents']['hasOwnProperty'](_0x92438c['id'])){for(var _0x37243d in _0x92438c[_0x46db('0x4c')]){if(_0x92438c[_0x46db('0x4c')][_0x46db('0x4d')](_0x37243d)){if(_0x54b34d['agents'][_0x92438c['id']][_0x46db('0x4d')](_0x37243d+_0x46db('0x4e'))){_0x54b34d['agents'][_0x92438c['id']][_0x37243d+_0x46db('0x4e')]=parseInt(_0x92438c[_0x46db('0x4c')][_0x37243d],0xa);}}}_0x54b34d[_0x46db('0x43')][_0x92438c['id']][_0x46db('0x4f')]();return _0x5c5826({'code':0xc8,'message':_0x54b34d[_0x46db('0x43')][_0x92438c['id']]});}else{return _0x48ee68(_0x434434['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x31363a){return new Promise(function(_0x627ea8){var _0x3e8ff1=_[_0x46db('0x50')](_0x54b34d[_0x46db('0x43')]);if(_0x31363a&&_0x31363a['id']){var _0x52e182=_[_0x46db('0x51')](_0x3e8ff1,function(_0x162e50){return _0x162e50['id']===_0x31363a['id'];});_0x627ea8(_0x52e182);}else{_0x627ea8({'count':_0x3e8ff1[_0x46db('0x19')],'rows':_0x3e8ff1});}});},'ChatQueues':function(){return new Promise(function(_0x16ebe0){var _0x57cd6d=[];for(var _0x428a6a in _0x54b34d[_0x46db('0x52')]){if(_0x54b34d[_0x46db('0x52')][_0x46db('0x4d')](_0x428a6a)){var _0x416f84=_0x54b34d['chatQueues'][_0x428a6a];var _0x3530c3={'id':_0x416f84['id'],'available':_0x416f84[_0x46db('0x53')],'loggedIn':_0x416f84[_0x46db('0x54')],'name':_0x416f84[_0x46db('0x55')],'paused':_0x416f84[_0x46db('0x56')],'waiting':_0x416f84[_0x46db('0x57')]};_0x57cd6d[_0x46db('0x24')](_0x3530c3);}}_0x16ebe0({'count':_0x57cd6d['length'],'rows':_0x57cd6d});});},'MailQueues':function(){return new Promise(function(_0x41c2de){var _0x1535fb=[];for(var _0xd5ffb in _0x54b34d[_0x46db('0x58')]){if(_0x54b34d['mailQueues']['hasOwnProperty'](_0xd5ffb)){var _0x4ac1c2=_0x54b34d['mailQueues'][_0xd5ffb];var _0x11e38f={'id':_0x4ac1c2['id'],'available':_0x4ac1c2[_0x46db('0x53')],'loggedIn':_0x4ac1c2[_0x46db('0x54')],'name':_0x4ac1c2[_0x46db('0x55')],'paused':_0x4ac1c2[_0x46db('0x56')],'waiting':_0x4ac1c2[_0x46db('0x57')]};_0x1535fb['push'](_0x11e38f);}}_0x41c2de({'count':_0x1535fb[_0x46db('0x19')],'rows':_0x1535fb});});},'OpenchannelQueues':function(){return new Promise(function(_0x2013e4){var _0x56f4c8=[];for(var _0x337bb3 in _0x54b34d['openchannelQueues']){if(_0x54b34d[_0x46db('0x59')]['hasOwnProperty'](_0x337bb3)){var _0x337d9a=_0x54b34d[_0x46db('0x59')][_0x337bb3];var _0x3bd0f4={'id':_0x337d9a['id'],'available':_0x337d9a[_0x46db('0x53')],'loggedIn':_0x337d9a['loggedIn'],'name':_0x337d9a[_0x46db('0x55')],'paused':_0x337d9a[_0x46db('0x56')],'waiting':_0x337d9a['waiting']};_0x56f4c8[_0x46db('0x24')](_0x3bd0f4);}}_0x2013e4({'count':_0x56f4c8['length'],'rows':_0x56f4c8});});},'SmsQueues':function(){return new Promise(function(_0xe35119){var _0x4f20b6=[];for(var _0x3851a8 in _0x54b34d[_0x46db('0x5a')]){if(_0x54b34d[_0x46db('0x5a')][_0x46db('0x4d')](_0x3851a8)){var _0x3e3a7b=_0x54b34d[_0x46db('0x5a')][_0x3851a8];var _0x271687={'id':_0x3e3a7b['id'],'available':_0x3e3a7b[_0x46db('0x53')],'loggedIn':_0x3e3a7b[_0x46db('0x54')],'name':_0x3e3a7b[_0x46db('0x55')],'paused':_0x3e3a7b[_0x46db('0x56')],'waiting':_0x3e3a7b[_0x46db('0x57')]};_0x4f20b6['push'](_0x271687);}}_0xe35119({'count':_0x4f20b6[_0x46db('0x19')],'rows':_0x4f20b6});});},'FaxQueues':function(){return new Promise(function(_0x480f62){var _0x392ef2=[];for(var _0x4a65e7 in _0x54b34d[_0x46db('0x5b')]){if(_0x54b34d[_0x46db('0x5b')][_0x46db('0x4d')](_0x4a65e7)){var _0xef9f7b=_0x54b34d[_0x46db('0x5b')][_0x4a65e7];var _0x21a1ab={'id':_0xef9f7b['id'],'available':_0xef9f7b[_0x46db('0x53')],'loggedIn':_0xef9f7b[_0x46db('0x54')],'name':_0xef9f7b[_0x46db('0x55')],'paused':_0xef9f7b[_0x46db('0x56')],'waiting':_0xef9f7b[_0x46db('0x57')]};_0x392ef2[_0x46db('0x24')](_0x21a1ab);}}_0x480f62({'count':_0x392ef2[_0x46db('0x19')],'rows':_0x392ef2});});},'WhatsappQueues':function(){return new Promise(function(_0x2e84af){var _0x20f913=[];for(var _0x49640a in _0x54b34d['whatsappQueues']){if(_0x54b34d[_0x46db('0x5c')][_0x46db('0x4d')](_0x49640a)){var _0x5564bd=_0x54b34d[_0x46db('0x5c')][_0x49640a];var _0x4b3cfa={'id':_0x5564bd['id'],'available':_0x5564bd[_0x46db('0x53')],'loggedIn':_0x5564bd[_0x46db('0x54')],'name':_0x5564bd[_0x46db('0x55')],'paused':_0x5564bd['paused'],'waiting':_0x5564bd['waiting']};_0x20f913[_0x46db('0x24')](_0x4b3cfa);}}_0x2e84af({'count':_0x20f913[_0x46db('0x19')],'rows':_0x20f913});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x45a16e){var _0x1903be=_[_0x46db('0x50')](_0x54b34d[_0x46db('0x5d')]);_0x45a16e({'count':_0x1903be[_0x46db('0x19')],'rows':_0x1903be});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x70c18f){var _0x44306f=_[_0x46db('0x50')](_0x54b34d[_0x46db('0x5e')]);_0x70c18f({'count':_0x44306f['length'],'rows':_0x44306f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xbe99ac){var _0x593daf=_[_0x46db('0x50')](_0x54b34d[_0x46db('0x5f')]);_0xbe99ac({'count':_0x593daf[_0x46db('0x19')],'rows':_0x593daf});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x46a4fa){var _0x3bf33=_['values'](_0x54b34d[_0x46db('0x60')]);_0x46a4fa({'count':_0x3bf33[_0x46db('0x19')],'rows':_0x3bf33});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x24e595){var _0x223539=_[_0x46db('0x50')](_0x54b34d[_0x46db('0x61')]);_0x24e595({'count':_0x223539[_0x46db('0x19')],'rows':_0x223539});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x326ac2){var _0x5ef702=_[_0x46db('0x50')](_0x54b34d[_0x46db('0x62')]);_0x326ac2({'count':_0x5ef702[_0x46db('0x19')],'rows':_0x5ef702});});}};var _0x1453cd=jayson[_0x46db('0x63')](_0x5c982c)['http']();_0x1453cd['on'](_0x46db('0x39'),function(_0x8fb433){logger[_0x46db('0x39')](JSON[_0x46db('0x3d')](_0x8fb433));return _0xed8db9(_0x8fb433);});_0x1453cd[_0x46db('0x64')](0x232c,'127.0.0.1',function(){console['log'](_0x46db('0x65'),0x232c);return _0x417caf(_0x46db('0x66')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 0b56f30..d130988 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 _0x5097=['../../../config/logger','routing','client','request','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','message','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','stop','util','jayson/promise'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5097,0x1eb));var _0x7509=function(_0x21a8b2,_0x2664af){_0x21a8b2=_0x21a8b2-0x0;var _0x3220de=_0x5097[_0x21a8b2];return _0x3220de;};'use strict';var util=require(_0x7509('0x0'));var BPromise=require('bluebird');var jayson=require(_0x7509('0x1'));var _=require('lodash');var logger=require(_0x7509('0x2'))(_0x7509('0x3'));var client=jayson[_0x7509('0x4')]['http']({'port':0x232a});function request(_0x118fcc,_0x454d3f){return new BPromise(function(_0x14f355,_0x545ffc){return client[_0x7509('0x5')](_0x118fcc,_0x454d3f)[_0x7509('0x6')](function(_0x5abb20){if(_0x5abb20[_0x7509('0x7')]){return _0x545ffc(_0x5abb20[_0x7509('0x7')]['message']);}else{return _0x14f355(_0x5abb20[_0x7509('0x8')]);}})[_0x7509('0x9')](function(_0x234ee8){return _0x545ffc(_0x234ee8);});});}exports[_0x7509('0xa')]=function(_0xbb4cd3,_0x4cd70,_0x185aa6){return function(_0x3ab8b5){if(_0x185aa6[_0x7509('0xb')]&&!_0x185aa6['rules'][_0xbb4cd3]){logger[_0x7509('0xc')](_0x7509('0xd'),_0xbb4cd3);return _0x3ab8b5['stop']();}var _0x2ef1e0=[];for(var _0x5c1189=0x0;_0x5c1189<_0x4cd70[_0x7509('0xe')];_0x5c1189+=0x1){_0x2ef1e0[_0x7509('0xf')](request(_0x7509('0x10'),{'command':util[_0x7509('0x11')]('iftime\x20%s',_0x4cd70[_0x5c1189])})[_0x7509('0x6')](function(_0x581c71){return _0x581c71&&_0x581c71[_0x7509('0x12')]&&_0x581c71['message'][_0x7509('0x13')](_0x7509('0x14'))>=0x0?!![]:![];})[_0x7509('0x9')](function(){logger['error'](_0x7509('0x15'),_0xbb4cd3,_0x4cd70[_0x5c1189]);}));}BPromise[_0x7509('0x16')](_0x2ef1e0)[_0x7509('0x6')](function(_0x515530){var _0x195a8e=_['some'](_0x515530);logger[_0x7509('0xc')](_0x7509('0x17'),_0xbb4cd3,_0x4cd70[_0x7509('0x18')](_0x7509('0x19')),_0x195a8e);_0x3ab8b5[_0x7509('0x1a')](_0x195a8e);})['catch'](function(_0xdd66cc){logger[_0x7509('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0xbb4cd3,_0x4cd70[_0x7509('0x18')](_0x7509('0x19')),_0xdd66cc[_0x7509('0x1b')]);_0x3ab8b5[_0x7509('0x1c')]();});};}; \ No newline at end of file +var _0x76e7=['error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','then','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x76e7,0x14c));var _0x776e=function(_0x229ba7,_0x23aff8){_0x229ba7=_0x229ba7-0x0;var _0x5bae2c=_0x76e7[_0x229ba7];return _0x5bae2c;};'use strict';var util=require(_0x776e('0x0'));var BPromise=require(_0x776e('0x1'));var jayson=require(_0x776e('0x2'));var _=require(_0x776e('0x3'));var logger=require(_0x776e('0x4'))(_0x776e('0x5'));var client=jayson[_0x776e('0x6')][_0x776e('0x7')]({'port':0x232a});function request(_0x1f2cdd,_0x2d05fb){return new BPromise(function(_0x3a3947,_0x820f64){return client[_0x776e('0x8')](_0x1f2cdd,_0x2d05fb)['then'](function(_0x403d7a){if(_0x403d7a['error']){return _0x820f64(_0x403d7a[_0x776e('0x9')]['message']);}else{return _0x3a3947(_0x403d7a[_0x776e('0xa')]);}})[_0x776e('0xb')](function(_0x238b59){return _0x820f64(_0x238b59);});});}exports[_0x776e('0xc')]=function(_0x431ca0,_0x9f72d0,_0x426f51){return function(_0x2a4d95){if(_0x426f51[_0x776e('0xd')]&&!_0x426f51[_0x776e('0xd')][_0x431ca0]){logger[_0x776e('0xe')](_0x776e('0xf'),_0x431ca0);return _0x2a4d95[_0x776e('0x10')]();}var _0x1d827b=[];for(var _0x1a749b=0x0;_0x1a749b<_0x9f72d0[_0x776e('0x11')];_0x1a749b+=0x1){_0x1d827b[_0x776e('0x12')](request('Command',{'command':util[_0x776e('0x13')](_0x776e('0x14'),_0x9f72d0[_0x1a749b])})[_0x776e('0x15')](function(_0x1d9cce){return _0x1d9cce&&_0x1d9cce[_0x776e('0x16')]&&_0x1d9cce[_0x776e('0x16')][_0x776e('0x17')](_0x776e('0x18'))>=0x0?!![]:![];})[_0x776e('0xb')](function(){logger[_0x776e('0x9')](_0x776e('0x19'),_0x431ca0,_0x9f72d0[_0x1a749b]);}));}BPromise[_0x776e('0x1a')](_0x1d827b)['then'](function(_0x3c423c){var _0x33ef65=_[_0x776e('0x1b')](_0x3c423c);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x431ca0,_0x9f72d0[_0x776e('0x1c')]('\x20|\x20'),_0x33ef65);_0x2a4d95['when'](_0x33ef65);})[_0x776e('0xb')](function(_0x541faa){logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x431ca0,_0x9f72d0[_0x776e('0x1c')](_0x776e('0x1d')),_0x541faa[_0x776e('0x1e')]);_0x2a4d95[_0x776e('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 18ff4a8..17346f1 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 _0xb469=['agentringnoanswerAt','timeout','holdtime','ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','splice','diffTime','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','channel','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout'];(function(_0x340377,_0x5d4ed8){var _0x5601dc=function(_0x514759){while(--_0x514759){_0x340377['push'](_0x340377['shift']());}};_0x5601dc(++_0x5d4ed8);}(_0xb469,0x13b));var _0x9b46=function(_0x580c6e,_0x346a36){_0x580c6e=_0x580c6e-0x0;var _0x594018=_0xb469[_0x580c6e];return _0x594018;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var utils=require(_0x9b46('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34f477,_0x1a41e8){utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34f477[_0x9b46('0x5')],_0x34f477[_0x9b46('0x6')],_0x34f477['queue'],_0x34f477[_0x9b46('0x7')],_0x34f477[_0x9b46('0x8')],_0x34f477['calleridnum'],_0x34f477[_0x9b46('0x9')],_0x34f477['lastevent']));if(_0x34f477['queue']){utils[_0x9b46('0xa')](_0x34f477['queue'])[_0x9b46('0xb')](function(_0xb9d1b5){if(_0xb9d1b5){_0x34f477[_0x9b46('0xc')]=_0xb9d1b5['type'];_0x34f477[_0x9b46('0xd')]=_0x34f477['agentcomplete']?_0xb9d1b5[_0x9b46('0xe')]:![];_0x34f477['acwtime']=_0x34f477[_0x9b46('0xd')]?_0xb9d1b5['acwTimeout']:0x0;}utils[_0x9b46('0xf')](_0x9b46('0x10'),_0x34f477);});}else{utils['request'](_0x9b46('0x10'),_0x34f477);}if(_0x1a41e8){delete transfers[_0x34f477[_0x9b46('0x5')]];}else{delete agents[_0x34f477['destuniqueid']];}}exports[_0x9b46('0x11')]=function(_0x2cfb35){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0x2cfb35);agents[_0x2cfb35[_0x9b46('0x14')]]=_0x2cfb35;agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x18');agents[_0x2cfb35['destuniqueid']]['connectedlinenum']=null;agents[_0x2cfb35['destuniqueid']][_0x9b46('0x19')]=null;utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2cfb35['uniqueid'],agents[_0x2cfb35[_0x9b46('0x14')]]['membername'],_0x2cfb35['destuniqueid']));}catch(_0xfeb1b9){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0xfeb1b9);}};exports['agentringnoanswer']=function(_0x55aece){try{if(!_[_0x9b46('0x1b')](agents[_0x55aece[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util['format']('[%s][agents][agentringnoanswer]',_0x55aece[_0x9b46('0x5')]),_0x55aece);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x1c'),_0x55aece['uniqueid'],agents[_0x55aece[_0x9b46('0x14')]]['membername'],_0x55aece[_0x9b46('0x14')]));agents[_0x55aece[_0x9b46('0x14')]]['agentringnoanswer']=!![];agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]]['reason']=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1f')]=_0x55aece[_0x9b46('0x20')]?parseInt(_0x55aece[_0x9b46('0x20')])/0x3e8:0x0;agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x21')]=0x0;unanswered['push'](_0x55aece[_0x9b46('0x14')]);}}catch(_0xee519e){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x22'),_0x55aece[_0x9b46('0x5')]),_0xee519e);}};exports[_0x9b46('0x23')]=function(_0x17ba3d){try{_[_0x9b46('0x24')](agents,function(_0x20090a,_0x2e1c51){if(_0x20090a['uniqueid']==_0x17ba3d[_0x9b46('0x5')]&&!_[_0x9b46('0x25')](unanswered,_0x20090a[_0x9b46('0x14')])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x17ba3d);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x27'),_0x17ba3d[_0x9b46('0x5')],_0x20090a['membername'],_0x20090a[_0x9b46('0x14')]));_0x20090a['agentringnoanswer']=!![];_0x20090a[_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();_0x20090a[_0x9b46('0x17')]='abandoned';_0x20090a[_0x9b46('0x28')]=_0x9b46('0x29');_0x20090a[_0x9b46('0x1f')]=_0x17ba3d[_0x9b46('0x1f')];_0x20090a[_0x9b46('0x21')]=0x0;writeDB(_0x20090a);}});}catch(_0x5cb73f){utils['error'](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x5cb73f);}};exports[_0x9b46('0x2a')]=function(_0x4fa731){try{if(agents[_0x4fa731[_0x9b46('0x14')]]){utils['debug'](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x4fa731);utils[_0x9b46('0x3')](util['format'](_0x9b46('0x2c'),_0x4fa731['uniqueid'],agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x7')],_0x4fa731[_0x9b46('0x14')]));agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x9')]=_0x4fa731[_0x9b46('0x9')];agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x19')]=_0x4fa731['connectedlinename'];agents[_0x4fa731[_0x9b46('0x14')]]['holdtime']=_0x4fa731[_0x9b46('0x20')];agents[_0x4fa731[_0x9b46('0x14')]]['lastevent']=_0x9b46('0x2e');_['forIn'](agents,function(_0x416538,_0x493b0f){if(_0x416538[_0x9b46('0x14')]!=_0x4fa731[_0x9b46('0x14')]&&_0x416538[_0x9b46('0x5')]==_0x4fa731[_0x9b46('0x5')]){_0x416538[_0x9b46('0x21')]=0x0;_0x416538['holdtime']=_0x4fa731['ringtime'];_0x416538[_0x9b46('0x2f')]=!![];_0x416538['agentringnoanswerAt']=utils['now']();_0x416538['lastevent']='answered_elsewhere';_0x416538[_0x9b46('0x28')]='answered_elsewhere';_0x416538[_0x9b46('0x30')]=_0x4fa731['destuniqueid'];_0x416538[_0x9b46('0x31')]=_0x4fa731[_0x9b46('0x7')];writeDB(_0x416538);}});}}catch(_0x2e92aa){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x2e92aa);}};exports[_0x9b46('0x32')]=function(_0x148d86){try{if(!_['isNil'](agents[_0x148d86[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x148d86);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x34'),_0x148d86[_0x9b46('0x5')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x7')],_0x148d86[_0x9b46('0x14')]));agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x32')]=!![];agents[_0x148d86['destuniqueid']]['agentcompleteAt']=utils[_0x9b46('0x16')]();agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x21')]=utils['diffTime'](agents[_0x148d86['destuniqueid']][_0x9b46('0x35')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x2d')]);agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x28')]=_0x148d86[_0x9b46('0x28')];agents[_0x148d86['destuniqueid']][_0x9b46('0x17')]=_0x9b46('0x36');writeDB(agents[_0x148d86[_0x9b46('0x14')]]);}}catch(_0x47a938){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x47a938);}};exports[_0x9b46('0x37')]=function(_0x566bad){try{if(!_[_0x9b46('0x1b')](agents[_0x566bad[_0x9b46('0x38')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x566bad);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x3a'),_0x566bad[_0x9b46('0x5')],agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x7')],agents[_0x566bad[_0x9b46('0x38')]]['uniqueid']));agents[_0x566bad[_0x9b46('0x38')]]['transfer']=!![];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3b')]=_0x9b46('0x3c');agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3d')]=_0x566bad['extension'];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3e')]=agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x5')];}}catch(_0x3f6b2f){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x3f6b2f);}};exports[_0x9b46('0x3f')]=function(_0x2f411f){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f[_0x9b46('0x40')]),_0x2f411f);if(_0x2f411f['origtransfereruniqueid']==_0x2f411f[_0x9b46('0x41')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x42')]])){utils['info'](util[_0x9b46('0x4')](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x7')]));agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x44')]=!![];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3b')]=_0x9b46('0x45');agents[_0x2f411f[_0x9b46('0x42')]]['transferexten']=_0x2f411f['origtransfererexten'];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x40')];}if(_0x2f411f[_0x9b46('0x46')]&&agents[_0x2f411f[_0x9b46('0x46')]]){agents[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x47')]=0x1;transfers[_0x2f411f[_0x9b46('0x46')]]=_['clone'](agents[_0x2f411f[_0x9b46('0x46')]]);transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x48')]=agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x49')];transfers[_0x2f411f[_0x9b46('0x46')]]['agentcalledAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f['transfereeuniqueid']][_0x9b46('0x47')]=0x2;}}else if(_0x2f411f['secondtransfereruniqueid']==_0x2f411f[_0x9b46('0x4a')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x40')]])){utils[_0x9b46('0x3')](util['format'](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x7')]));agents[_0x2f411f[_0x9b46('0x40')]]['transfer']=!![];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3b')]='ATTENDED';agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x3d')]=_0x2f411f[_0x9b46('0x4b')];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x42')];}if(_0x2f411f[_0x9b46('0x4c')]&&agents[_0x2f411f[_0x9b46('0x4c')]]){agents[_0x2f411f[_0x9b46('0x4c')]]['agententerreason']=0x1;transfers[_0x2f411f['transfertargetuniqueid']]=_[_0x9b46('0x4d')](agents[_0x2f411f[_0x9b46('0x4c')]]);transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x48')]=agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x49')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]]['agentconnectAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x47')]=0x2;}}}catch(_0x4e8756){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f['origtransfereruniqueid']),_0x4e8756);}};exports[_0x9b46('0x4e')]=function(_0x200607){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x200607);if(agents[_0x200607[_0x9b46('0x5')]]&&agents[_0x200607[_0x9b46('0x5')]]['reason']===_0x9b46('0x1e')){if(_0x200607[_0x9b46('0x50')]==='21'){agents[_0x200607['uniqueid']][_0x9b46('0x28')]='rejected';agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x51');}utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]]['membername'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']]['lastevent']));writeDB(agents[_0x200607['uniqueid']]);var _0x2978aa=unanswered['indexOf'](_0x200607['uniqueid']);if(_0x2978aa>-0x1){unanswered[_0x9b46('0x52')](_0x2978aa,0x1);}}if(transfers[_0x200607[_0x9b46('0x5')]]){transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];transfers[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();transfers[_0x200607[_0x9b46('0x5')]]['talktime']=utils['diffTime'](transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x35')],transfers[_0x200607[_0x9b46('0x5')]]['agentconnectAt']);transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')]='agent';transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x36');utils[_0x9b46('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607[_0x9b46('0x5')],transfers[_0x200607['uniqueid']][_0x9b46('0x7')],transfers[_0x200607[_0x9b46('0x5')]]['reason'],transfers[_0x200607['uniqueid']]['lastevent']));writeDB(transfers[_0x200607[_0x9b46('0x5')]],!![]);}if(agents[_0x200607['uniqueid']]&&agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x2d')]){agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];agents[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x21')]=utils[_0x9b46('0x53')](agents[_0x200607['uniqueid']][_0x9b46('0x35')],agents[_0x200607['uniqueid']][_0x9b46('0x2d')]);agents[_0x200607[_0x9b46('0x5')]]['reason']=agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x44')]?_0x9b46('0x44'):_0x9b46('0x54');agents[_0x200607['uniqueid']][_0x9b46('0x17')]='complete';utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x55'),_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x7')],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']][_0x9b46('0x17')]));writeDB(agents[_0x200607['uniqueid']]);}}catch(_0x420d61){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x420d61);}}; \ No newline at end of file +var _0x3c81=['CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinename','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','isNil','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request'];(function(_0x24d68a,_0x49e010){var _0x408697=function(_0x2cbccf){while(--_0x2cbccf){_0x24d68a['push'](_0x24d68a['shift']());}};_0x408697(++_0x49e010);}(_0x3c81,0x102));var _0x13c8=function(_0x42a9ec,_0x4a2ae3){_0x42a9ec=_0x42a9ec-0x0;var _0x56e39e=_0x3c81[_0x42a9ec];return _0x56e39e;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x252f26,_0x131d0b){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x252f26['uniqueid'],_0x252f26[_0x13c8('0x2')],_0x252f26[_0x13c8('0x3')],_0x252f26[_0x13c8('0x4')],_0x252f26[_0x13c8('0x5')],_0x252f26[_0x13c8('0x6')],_0x252f26[_0x13c8('0x7')],_0x252f26[_0x13c8('0x8')]));if(_0x252f26['queue']){utils[_0x13c8('0x9')](_0x252f26['queue'])[_0x13c8('0xa')](function(_0x296463){if(_0x296463){_0x252f26[_0x13c8('0xb')]=_0x296463[_0x13c8('0xb')];_0x252f26[_0x13c8('0xc')]=_0x252f26[_0x13c8('0xd')]?_0x296463[_0x13c8('0xe')]:![];_0x252f26[_0x13c8('0xf')]=_0x252f26[_0x13c8('0xc')]?_0x296463[_0x13c8('0x10')]:0x0;}utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);});}else{utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);}if(_0x131d0b){delete transfers[_0x252f26['uniqueid']];}else{delete agents[_0x252f26[_0x13c8('0x13')]];}}exports[_0x13c8('0x14')]=function(_0x2304b5){try{utils[_0x13c8('0x15')](util['format'](_0x13c8('0x16'),_0x2304b5['uniqueid']),_0x2304b5);agents[_0x2304b5['destuniqueid']]=_0x2304b5;agents[_0x2304b5['destuniqueid']][_0x13c8('0x17')]=utils['now']();agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x18');agents[_0x2304b5[_0x13c8('0x13')]]['connectedlinenum']=null;agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x19')]=null;utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x1c'),_0x2304b5[_0x13c8('0x1d')],agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x4')],_0x2304b5[_0x13c8('0x13')]));}catch(_0x31d122){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x16'),_0x2304b5[_0x13c8('0x1d')]),_0x31d122);}};exports[_0x13c8('0x1f')]=function(_0x313ea3){try{if(!_['isNil'](agents[_0x313ea3[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x313ea3);utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x21'),_0x313ea3[_0x13c8('0x1d')],agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x4')],_0x313ea3['destuniqueid']));agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x1f')]=!![];agents[_0x313ea3['destuniqueid']]['agentringnoanswerAt']=utils[_0x13c8('0x22')]();agents[_0x313ea3[_0x13c8('0x13')]]['lastevent']='timeout';agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x23')]='timeout';agents[_0x313ea3['destuniqueid']][_0x13c8('0x24')]=_0x313ea3['ringtime']?parseInt(_0x313ea3['ringtime'])/0x3e8:0x0;agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x25')]=0x0;unanswered[_0x13c8('0x26')](_0x313ea3['destuniqueid']);}}catch(_0x5ef2f7){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x5ef2f7);}};exports[_0x13c8('0x27')]=function(_0x220d40){try{_[_0x13c8('0x28')](agents,function(_0x4a1b9c,_0x109cb8){if(_0x4a1b9c[_0x13c8('0x1d')]==_0x220d40['uniqueid']&&!_['includes'](unanswered,_0x4a1b9c[_0x13c8('0x13')])){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x220d40);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2a'),_0x220d40[_0x13c8('0x1d')],_0x4a1b9c[_0x13c8('0x4')],_0x4a1b9c[_0x13c8('0x13')]));_0x4a1b9c[_0x13c8('0x1f')]=!![];_0x4a1b9c[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x4a1b9c['lastevent']='abandoned';_0x4a1b9c[_0x13c8('0x23')]=_0x13c8('0x2c');_0x4a1b9c['holdtime']=_0x220d40[_0x13c8('0x24')];_0x4a1b9c['talktime']=0x0;writeDB(_0x4a1b9c);}});}catch(_0x1fdf7d){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x1fdf7d);}};exports[_0x13c8('0x2d')]=function(_0x2039e7){try{if(agents[_0x2039e7[_0x13c8('0x13')]]){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0x2039e7);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2f'),_0x2039e7[_0x13c8('0x1d')],agents[_0x2039e7['destuniqueid']]['membername'],_0x2039e7['destuniqueid']));agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x7')]=_0x2039e7[_0x13c8('0x7')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x19')]=_0x2039e7[_0x13c8('0x19')];agents[_0x2039e7['destuniqueid']]['holdtime']=_0x2039e7[_0x13c8('0x31')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x32');_['forIn'](agents,function(_0x35e1e7,_0x4bd627){if(_0x35e1e7[_0x13c8('0x13')]!=_0x2039e7[_0x13c8('0x13')]&&_0x35e1e7[_0x13c8('0x1d')]==_0x2039e7[_0x13c8('0x1d')]){_0x35e1e7[_0x13c8('0x25')]=0x0;_0x35e1e7[_0x13c8('0x24')]=_0x2039e7[_0x13c8('0x31')];_0x35e1e7[_0x13c8('0x1f')]=!![];_0x35e1e7[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x35e1e7[_0x13c8('0x8')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x23')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x34')]=_0x2039e7[_0x13c8('0x13')];_0x35e1e7[_0x13c8('0x35')]=_0x2039e7[_0x13c8('0x4')];writeDB(_0x35e1e7);}});}}catch(_0xc5eb86){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0xc5eb86);}};exports[_0x13c8('0xd')]=function(_0x44ee66){try{if(!_['isNil'](agents[_0x44ee66[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x44ee66);utils['info'](util['format'](_0x13c8('0x37'),_0x44ee66[_0x13c8('0x1d')],agents[_0x44ee66[_0x13c8('0x13')]]['membername'],_0x44ee66['destuniqueid']));agents[_0x44ee66['destuniqueid']][_0x13c8('0xd')]=!![];agents[_0x44ee66['destuniqueid']][_0x13c8('0x38')]=utils['now']();agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x25')]=utils[_0x13c8('0x39')](agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x38')],agents[_0x44ee66[_0x13c8('0x13')]]['agentconnectAt']);agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x23')]=_0x44ee66['reason'];agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x3a');writeDB(agents[_0x44ee66[_0x13c8('0x13')]]);}}catch(_0x38486a){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x38486a);}};exports[_0x13c8('0x3b')]=function(_0x185d18){try{if(!_['isNil'](agents[_0x185d18[_0x13c8('0x3c')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18[_0x13c8('0x1d')]),_0x185d18);utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x3e'),_0x185d18[_0x13c8('0x1d')],agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x4')],agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')]));agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x3f')]=!![];agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x40')]=_0x13c8('0x41');agents[_0x185d18['transfereruniqueid']][_0x13c8('0x42')]=_0x185d18[_0x13c8('0x43')];agents[_0x185d18[_0x13c8('0x3c')]]['transferuniqueid']=agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')];}}catch(_0x14a738){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18['uniqueid']),_0x14a738);}};exports[_0x13c8('0x44')]=function(_0x554792){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792['origtransfereruniqueid']),_0x554792);if(_0x554792[_0x13c8('0x46')]==_0x554792[_0x13c8('0x47')]){if(!_['isNil'](agents[_0x554792[_0x13c8('0x48')]])){utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4')]));agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x554792['secondtransfereruniqueid']]['transferexten']=_0x554792[_0x13c8('0x4a')];agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x46')];}if(_0x554792[_0x13c8('0x4c')]&&agents[_0x554792[_0x13c8('0x4c')]]){agents[_0x554792[_0x13c8('0x4c')]]['agententerreason']=0x1;transfers[_0x554792['transfereeuniqueid']]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x4c')]]);transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4e')]=agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x4e')];transfers[_0x554792[_0x13c8('0x4c')]]['agentcalledAt']=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4f')]=0x2;}}else if(_0x554792[_0x13c8('0x48')]==_0x554792[_0x13c8('0x50')]){if(!_[_0x13c8('0x51')](agents[_0x554792[_0x13c8('0x46')]])){utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x4')]));agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792[_0x13c8('0x46')]]['transfertype']=_0x13c8('0x52');agents[_0x554792[_0x13c8('0x46')]]['transferexten']=_0x554792[_0x13c8('0x53')];agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x48')];}if(_0x554792[_0x13c8('0x54')]&&agents[_0x554792[_0x13c8('0x54')]]){agents[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x1;transfers[_0x554792[_0x13c8('0x54')]]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x54')]]);transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4e')]=agents[_0x554792[_0x13c8('0x46')]]['calleridname'];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x17')]=utils[_0x13c8('0x22')]();transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x2;}}}catch(_0x55e5ba){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792[_0x13c8('0x46')]),_0x55e5ba);}};exports['hangup']=function(_0x16b409){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x55'),_0x16b409[_0x13c8('0x1d')]),_0x16b409);if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409[_0x13c8('0x1d')]]['reason']===_0x13c8('0x56')){if(_0x16b409[_0x13c8('0x57')]==='21'){agents[_0x16b409[_0x13c8('0x1d')]]['reason']=_0x13c8('0x58');agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']='rejected';}utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x59'),_0x16b409['uniqueid'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);var _0x2d8dfe=unanswered['indexOf'](_0x16b409[_0x13c8('0x1d')]);if(_0x2d8dfe>-0x1){unanswered[_0x13c8('0x5a')](_0x2d8dfe,0x1);}}if(transfers[_0x16b409[_0x13c8('0x1d')]]){transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0xd')]=!![];transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x25')]=utils['diffTime'](transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')],transfers[_0x16b409['uniqueid']]['agentconnectAt']);transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=_0x13c8('0x5b');transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]=_0x13c8('0x3a');utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x59'),_0x16b409[_0x13c8('0x1d')],transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],transfers[_0x16b409['uniqueid']][_0x13c8('0x23')],transfers[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(transfers[_0x16b409[_0x13c8('0x1d')]],!![]);}if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409['uniqueid']][_0x13c8('0x30')]){agents[_0x16b409['uniqueid']][_0x13c8('0xd')]=!![];agents[_0x16b409['uniqueid']][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();agents[_0x16b409[_0x13c8('0x1d')]]['talktime']=utils[_0x13c8('0x39')](agents[_0x16b409['uniqueid']]['agentcompleteAt'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x30')]);agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=agents[_0x16b409['uniqueid']]['transfer']?_0x13c8('0x3f'):'agent';agents[_0x16b409['uniqueid']][_0x13c8('0x8')]=_0x13c8('0x3a');utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x16b409[_0x13c8('0x1d')],agents[_0x16b409['uniqueid']]['membername'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);}}catch(_0x551563){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x55'),_0x16b409['uniqueid']),_0x551563);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 606dd6e..93dccd2 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 _0xdc65=['origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','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','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','substring','lastIndexOf','noop','execif','set','gotoif','[%s][calls][newexten]','util','NO\x20ANSWER','FAILED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','channel','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','channelstate','ANSWERED','hangup','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended'];(function(_0x4d2a1d,_0x547e52){var _0x3e75ca=function(_0x4da669){while(--_0x4da669){_0x4d2a1d['push'](_0x4d2a1d['shift']());}};_0x3e75ca(++_0x547e52);}(_0xdc65,0x9f));var _0x5dc6=function(_0x582e59,_0x5380ce){_0x582e59=_0x582e59-0x0;var _0x5e4c8f=_0xdc65[_0x582e59];return _0x5e4c8f;};'use strict';var _=require('lodash');var util=require(_0x5dc6('0x0'));var utils=require('./utils');var dispositions=[_0x5dc6('0x1'),_0x5dc6('0x2'),'FAILED','NO\x20ANSWER',_0x5dc6('0x1'),_0x5dc6('0x1'),'ANSWERED',_0x5dc6('0x3'),'FAILED',_0x5dc6('0x2'),'FAILED'];var channels={};function writeDB(_0x5775df){utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')](_0x5dc6('0x6'),_0x5775df[_0x5dc6('0x7')],_0x5775df['channel'],_0x5775df[_0x5dc6('0x8')],_0x5775df[_0x5dc6('0x9')],_0x5775df[_0x5dc6('0xa')],_0x5775df['calleridnum'],_0x5775df[_0x5dc6('0xb')],_0x5775df['lastevent']));if(_0x5775df[_0x5dc6('0xc')]){utils[_0x5dc6('0xd')](_0x5775df[_0x5dc6('0xc')])['then'](function(_0x458872){if(_0x458872){_0x5775df[_0x5dc6('0xe')]=_0x458872['id'];}utils[_0x5dc6('0xf')](_0x5dc6('0x10'),_0x5775df);});}else{utils[_0x5dc6('0xf')](_0x5dc6('0x10'),_0x5775df);}if(channels[_0x5775df[_0x5dc6('0x7')]]){delete channels[_0x5775df['uniqueid']];}}exports[_0x5dc6('0x11')]=function(_0x4b4c5a){try{utils[_0x5dc6('0x12')](util[_0x5dc6('0x5')]('[%s][calls][newchannel]',_0x4b4c5a['uniqueid']),_0x4b4c5a);if(_0x4b4c5a[_0x5dc6('0x7')]==_0x4b4c5a['linkedid']&&_0x4b4c5a['channel']!=_0x5dc6('0x13')){utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')](_0x5dc6('0x14'),_0x4b4c5a['uniqueid'],_0x4b4c5a[_0x5dc6('0x15')],_0x4b4c5a[_0x5dc6('0x16')]));channels[_0x4b4c5a[_0x5dc6('0x7')]]={'uniqueid':_0x4b4c5a[_0x5dc6('0x7')],'accountcode':_0x4b4c5a[_0x5dc6('0xc')],'source':_0x4b4c5a[_0x5dc6('0x17')],'destination':_0x4b4c5a['exten'],'destinationcontext':_0x4b4c5a[_0x5dc6('0x15')],'channel':_0x4b4c5a[_0x5dc6('0x18')],'starttime':utils[_0x5dc6('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5dc6('0x1'),'amaflags':_0x5dc6('0x1a')};}}catch(_0x178408){utils[_0x5dc6('0x1b')](util[_0x5dc6('0x5')](_0x5dc6('0x1c'),_0x4b4c5a['uniqueid']),_0x178408);}};exports[_0x5dc6('0x1d')]=function(_0x13b506){try{utils[_0x5dc6('0x12')](util['format'](_0x5dc6('0x1e'),_0x13b506[_0x5dc6('0x7')]),_0x13b506);if(!_[_0x5dc6('0x1f')](channels[_0x13b506[_0x5dc6('0x7')]])&&_0x13b506['channelstate']==0x6){utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x13b506[_0x5dc6('0x7')],_0x13b506['context'],_0x13b506[_0x5dc6('0x18')]));if(_['isNil'](channels[_0x13b506[_0x5dc6('0x7')]][_0x5dc6('0x20')])){channels[_0x13b506[_0x5dc6('0x7')]][_0x5dc6('0x20')]=utils['now']();}}else if(!_[_0x5dc6('0x1f')](channels[_0x13b506[_0x5dc6('0x21')]])&&_0x13b506['channelstate']==0x6&&_0x13b506['context']!=_0x5dc6('0x22')){utils['info'](util[_0x5dc6('0x5')](_0x5dc6('0x23'),_0x13b506[_0x5dc6('0x7')],_0x13b506['linkedid'],_0x13b506[_0x5dc6('0x15')],_0x13b506[_0x5dc6('0x18')]));channels[_0x13b506[_0x5dc6('0x21')]][_0x5dc6('0xc')]=_0x13b506['accountcode'];channels[_0x13b506[_0x5dc6('0x21')]]['destinationchannel']=_0x13b506[_0x5dc6('0x18')];if(_[_0x5dc6('0x1f')](channels[_0x13b506['linkedid']][_0x5dc6('0x24')])){channels[_0x13b506[_0x5dc6('0x21')]]['answertime']=utils['now']();}channels[_0x13b506[_0x5dc6('0x21')]][_0x5dc6('0x25')]=dispositions[_[_0x5dc6('0x26')](_0x13b506[_0x5dc6('0x27')])]||_0x5dc6('0x28');}}catch(_0xc82347){utils['error'](util[_0x5dc6('0x5')](_0x5dc6('0x1e'),_0x13b506['uniqueid']),_0xc82347);}};exports[_0x5dc6('0x29')]=function(_0x123b04){try{if(!_[_0x5dc6('0x1f')](channels[_0x123b04[_0x5dc6('0x7')]])){utils[_0x5dc6('0x12')](util[_0x5dc6('0x5')]('[%s][calls][hangup]',_0x123b04[_0x5dc6('0x7')]),_0x123b04);if(_[_0x5dc6('0x1f')](channels[_0x123b04[_0x5dc6('0x7')]][_0x5dc6('0x2a')])){channels[_0x123b04['uniqueid']]['callerid']=_0x123b04[_0x5dc6('0x2b')]+'\x20<'+_0x123b04[_0x5dc6('0x17')]+'>';}utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x123b04['uniqueid'],channels[_0x123b04[_0x5dc6('0x7')]]['callerid'],_0x123b04[_0x5dc6('0x2c')]));channels[_0x123b04['uniqueid']][_0x5dc6('0x2d')]=utils[_0x5dc6('0x19')]();channels[_0x123b04['uniqueid']][_0x5dc6('0x2e')]=utils[_0x5dc6('0x2f')](channels[_0x123b04[_0x5dc6('0x7')]][_0x5dc6('0x2d')],channels[_0x123b04[_0x5dc6('0x7')]][_0x5dc6('0x30')]);channels[_0x123b04[_0x5dc6('0x7')]][_0x5dc6('0x31')]=channels[_0x123b04['uniqueid']][_0x5dc6('0x24')]?utils[_0x5dc6('0x2f')](channels[_0x123b04[_0x5dc6('0x7')]][_0x5dc6('0x2d')],channels[_0x123b04[_0x5dc6('0x7')]][_0x5dc6('0x24')]):0x0;writeDB(channels[_0x123b04[_0x5dc6('0x7')]]);}}catch(_0x2bf9f8){utils[_0x5dc6('0x1b')](util[_0x5dc6('0x5')](_0x5dc6('0x32'),_0x123b04[_0x5dc6('0x7')]),_0x2bf9f8);}};exports['attendedtransfer']=function(_0x185f6d){try{if(!_['isNil'](channels[_0x185f6d[_0x5dc6('0x33')]])){utils['debug'](util[_0x5dc6('0x5')]('[%s][calls][attendedtransfer]',_0x185f6d[_0x5dc6('0x34')]),_0x185f6d);if(channels[_0x185f6d[_0x5dc6('0x33')]][_0x5dc6('0x18')]==_0x185f6d[_0x5dc6('0x35')]){utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')](_0x5dc6('0x36'),_0x185f6d['origtransfereruniqueid'],_0x185f6d[_0x5dc6('0x33')],_0x185f6d[_0x5dc6('0x37')]));channels[_0x185f6d[_0x5dc6('0x33')]][_0x5dc6('0x38')]=_0x185f6d['secondtransfererchannel'];channels[_0x185f6d[_0x5dc6('0x33')]][_0x5dc6('0x39')]=_0x5dc6('0x3a');}else if(channels[_0x185f6d[_0x5dc6('0x33')]][_0x5dc6('0x18')]=_0x185f6d['transfertargetchannel']){utils['info'](util[_0x5dc6('0x5')](_0x5dc6('0x36'),_0x185f6d[_0x5dc6('0x34')],_0x185f6d[_0x5dc6('0x33')],_0x185f6d[_0x5dc6('0x3b')]));channels[_0x185f6d[_0x5dc6('0x33')]]['destinationchannel']=_0x185f6d[_0x5dc6('0x3b')];channels[_0x185f6d['localtwolinkedid']][_0x5dc6('0x39')]=_0x5dc6('0x3a');}}}catch(_0x4ccdf6){utils[_0x5dc6('0x1b')](util[_0x5dc6('0x5')](_0x5dc6('0x3c'),_0x185f6d[_0x5dc6('0x34')]),_0x4ccdf6);}};exports['musiconholdstart']=function(_0x44b215){try{if(!_[_0x5dc6('0x1f')](channels[_0x44b215['uniqueid']])){utils[_0x5dc6('0x12')](util[_0x5dc6('0x5')]('[%s][calls][musiconholdstart]',_0x44b215[_0x5dc6('0x7')]),_0x44b215);channels[_0x44b215[_0x5dc6('0x7')]][_0x5dc6('0x3d')]=utils[_0x5dc6('0x19')]();utils['info'](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x44b215[_0x5dc6('0x7')],channels[_0x44b215[_0x5dc6('0x7')]][_0x5dc6('0x3d')]));}}catch(_0x3154b5){utils[_0x5dc6('0x1b')](util['format'](_0x5dc6('0x3e'),_0x44b215[_0x5dc6('0x7')]),_0x3154b5);}};exports[_0x5dc6('0x3f')]=function(_0x2c3afe){try{if(!_[_0x5dc6('0x1f')](channels[_0x2c3afe[_0x5dc6('0x7')]])){utils[_0x5dc6('0x12')](util[_0x5dc6('0x5')](_0x5dc6('0x40'),_0x2c3afe[_0x5dc6('0x7')]),_0x2c3afe);if(!_[_0x5dc6('0x1f')](channels[_0x2c3afe['uniqueid']][_0x5dc6('0x3d')])){channels[_0x2c3afe['uniqueid']][_0x5dc6('0x41')]+=utils[_0x5dc6('0x2f')](utils['now'](),channels[_0x2c3afe['uniqueid']]['musiconholdstartAt']);utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')](_0x5dc6('0x42'),_0x2c3afe['uniqueid'],channels[_0x2c3afe[_0x5dc6('0x7')]]['mohtime']));delete channels[_0x2c3afe[_0x5dc6('0x7')]]['musiconholdstartAt'];}}}catch(_0x320539){utils[_0x5dc6('0x1b')](util[_0x5dc6('0x5')](_0x5dc6('0x40'),_0x2c3afe[_0x5dc6('0x7')]),_0x320539);}};exports['varset']=function(_0x261124){try{if(!_['isNil'](channels[_0x261124[_0x5dc6('0x7')]])){utils[_0x5dc6('0x12')](util[_0x5dc6('0x5')]('[%s][calls][varset]',_0x261124[_0x5dc6('0x7')]),_0x261124);if(!_[_0x5dc6('0x1f')](_0x261124[_0x5dc6('0x43')][_0x5dc6('0x44')])){utils['info'](util[_0x5dc6('0x5')](_0x5dc6('0x45'),_0x261124[_0x5dc6('0x7')],_0x261124[_0x5dc6('0x46')]));channels[_0x261124[_0x5dc6('0x7')]][_0x5dc6('0x47')]=_0x261124[_0x5dc6('0x46')];}if(!_[_0x5dc6('0x1f')](_0x261124['variable'][_0x5dc6('0x48')])){utils[_0x5dc6('0x4')](util['format'](_0x5dc6('0x49'),_0x261124['uniqueid'],_0x261124['value']));channels[_0x261124['uniqueid']][_0x5dc6('0x4a')]=_0x261124['value'];channels[_0x261124['uniqueid']][_0x5dc6('0x2a')]='\x22'+_0x261124[_0x5dc6('0x46')]+_0x5dc6('0x4b')+_0x261124[_0x5dc6('0x46')]+'>';}if(!_[_0x5dc6('0x1f')](_0x261124['variable']['xmd-callerid-preview'])||!_['isNil'](_0x261124[_0x5dc6('0x43')][_0x5dc6('0x4c')])){utils['info'](util[_0x5dc6('0x5')](_0x5dc6('0x4d'),_0x261124[_0x5dc6('0x7')],!_[_0x5dc6('0x1f')](_0x261124[_0x5dc6('0x43')][_0x5dc6('0x4e')])?_0x5dc6('0x4e'):_0x5dc6('0x4c'),_0x261124[_0x5dc6('0x46')]));channels[_0x261124[_0x5dc6('0x7')]][_0x5dc6('0x2a')]=_0x261124['value'];}if(!_['isNil'](_0x261124['variable'][_0x5dc6('0x4f')])||!_[_0x5dc6('0x1f')](_0x261124[_0x5dc6('0x43')]['xmcs-queue'])){utils[_0x5dc6('0x4')](util['format'](_0x5dc6('0x4d'),_0x261124[_0x5dc6('0x7')],!_['isNil'](_0x261124[_0x5dc6('0x43')][_0x5dc6('0x4f')])?'xmd-queue':_0x5dc6('0x50'),_0x261124[_0x5dc6('0x46')]));channels[_0x261124['uniqueid']][_0x5dc6('0x51')]=_0x5dc6('0x52');channels[_0x261124[_0x5dc6('0x7')]][_0x5dc6('0x53')]=_0x261124['value'];channels[_0x261124['uniqueid']][_0x5dc6('0x8')]=!![];}if(!_[_0x5dc6('0x1f')](_0x261124['variable'][_0x5dc6('0x54')])){utils['info'](util[_0x5dc6('0x5')](_0x5dc6('0x55'),_0x261124[_0x5dc6('0x7')],_0x261124[_0x5dc6('0x46')]));channels[_0x261124[_0x5dc6('0x7')]][_0x5dc6('0x56')]=_0x261124[_0x5dc6('0x46')];}if(!_[_0x5dc6('0x1f')](_0x261124[_0x5dc6('0x43')][_0x5dc6('0x57')])){utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')](_0x5dc6('0x58'),_0x261124[_0x5dc6('0x7')],_0x261124[_0x5dc6('0x46')]));channels[_0x261124[_0x5dc6('0x7')]][_0x5dc6('0x59')]=_0x261124[_0x5dc6('0x46')];}if(!_[_0x5dc6('0x1f')](_0x261124[_0x5dc6('0x43')][_0x5dc6('0x5a')])){utils[_0x5dc6('0x4')](util['format'](_0x5dc6('0x5b'),_0x261124[_0x5dc6('0x7')],_0x261124[_0x5dc6('0x46')]));channels[_0x261124['uniqueid']][_0x5dc6('0x5c')]=_0x261124[_0x5dc6('0x46')];}if(!_[_0x5dc6('0x1f')](_0x261124[_0x5dc6('0x43')][_0x5dc6('0x5d')])){utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')](_0x5dc6('0x5e'),_0x261124[_0x5dc6('0x7')],_0x261124[_0x5dc6('0x46')]));channels[_0x261124['uniqueid']][_0x5dc6('0x5d')]=_0x261124[_0x5dc6('0x46')];}}}catch(_0x21e6e8){utils['error'](util[_0x5dc6('0x5')]('[%s][calls][varset]',_0x261124['uniqueid']),_0x21e6e8);}};exports[_0x5dc6('0x5f')]=function(_0x4d3b49){try{if(!_[_0x5dc6('0x1f')](channels[_0x4d3b49['uniqueid']])){utils[_0x5dc6('0x12')](util['format']('[%s][calls][newexten]',_0x4d3b49[_0x5dc6('0x7')]),_0x4d3b49);utils[_0x5dc6('0x4')](util[_0x5dc6('0x5')](_0x5dc6('0x60'),_0x4d3b49[_0x5dc6('0x7')],_0x4d3b49[_0x5dc6('0x61')],_0x4d3b49[_0x5dc6('0x62')]));if(_0x4d3b49[_0x5dc6('0x61')][_0x5dc6('0x63')]()=='set'&&_['startsWith'](_0x4d3b49[_0x5dc6('0x62')][_0x5dc6('0x63')](),_0x5dc6('0x64'))){var _0x429c64=_0x4d3b49['appdata'][_0x5dc6('0x65')]('=');var _0x2bb699=_0x429c64[0x0][_0x5dc6('0x66')](_0x429c64[0x0][_0x5dc6('0x67')]('(')+0x1,_0x429c64[0x0][_0x5dc6('0x67')](')'));var _0xec5da7=_0x429c64[0x1];channels[_0x4d3b49[_0x5dc6('0x7')]][_0x2bb699]=_0xec5da7;}if(!_['includes']([_0x5dc6('0x29'),_0x5dc6('0x68'),_0x5dc6('0x69'),_0x5dc6('0x6a'),_0x5dc6('0x6b')],_0x4d3b49[_0x5dc6('0x61')][_0x5dc6('0x63')]())){channels[_0x4d3b49['uniqueid']][_0x5dc6('0x51')]=_0x4d3b49[_0x5dc6('0x61')];channels[_0x4d3b49[_0x5dc6('0x7')]][_0x5dc6('0x53')]=_0x4d3b49[_0x5dc6('0x62')];}}}catch(_0x4a7bf2){utils['error'](util[_0x5dc6('0x5')](_0x5dc6('0x6c'),_0x4d3b49[_0x5dc6('0x7')]),_0x4a7bf2);}}; \ No newline at end of file +var _0x7559=['[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','toLowerCase','cdr','substring','lastIndexOf','includes','noop','execif','util','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','uniqueid','channel','membername','interface','calleridnum','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','ANSWERED','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','variable','xmd-callerid'];(function(_0x481fea,_0x1bcefa){var _0xf403e6=function(_0x321685){while(--_0x321685){_0x481fea['push'](_0x481fea['shift']());}};_0xf403e6(++_0x1bcefa);}(_0x7559,0x1b7));var _0x9755=function(_0x5b120f,_0x1bda7d){_0x5b120f=_0x5b120f-0x0;var _0x442b90=_0x7559[_0x5b120f];return _0x442b90;};'use strict';var _=require('lodash');var util=require(_0x9755('0x0'));var utils=require(_0x9755('0x1'));var dispositions=[_0x9755('0x2'),'FAILED',_0x9755('0x3'),_0x9755('0x2'),_0x9755('0x2'),_0x9755('0x2'),'ANSWERED',_0x9755('0x4'),_0x9755('0x3'),'FAILED',_0x9755('0x3')];var channels={};function writeDB(_0x151917){utils[_0x9755('0x5')](util[_0x9755('0x6')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x151917[_0x9755('0x7')],_0x151917[_0x9755('0x8')],_0x151917['queue'],_0x151917[_0x9755('0x9')],_0x151917[_0x9755('0xa')],_0x151917[_0x9755('0xb')],_0x151917['connectedlinenum'],_0x151917['lastevent']));if(_0x151917['accountcode']){utils[_0x9755('0xc')](_0x151917[_0x9755('0xd')])[_0x9755('0xe')](function(_0x160226){if(_0x160226){_0x151917[_0x9755('0xf')]=_0x160226['id'];}utils[_0x9755('0x10')](_0x9755('0x11'),_0x151917);});}else{utils['request'](_0x9755('0x11'),_0x151917);}if(channels[_0x151917['uniqueid']]){delete channels[_0x151917[_0x9755('0x7')]];}}exports[_0x9755('0x12')]=function(_0x26c95f){try{utils['debug'](util['format'](_0x9755('0x13'),_0x26c95f[_0x9755('0x7')]),_0x26c95f);if(_0x26c95f[_0x9755('0x7')]==_0x26c95f[_0x9755('0x14')]&&_0x26c95f[_0x9755('0x8')]!=_0x9755('0x15')){utils['info'](util[_0x9755('0x6')](_0x9755('0x16'),_0x26c95f[_0x9755('0x7')],_0x26c95f['context'],_0x26c95f[_0x9755('0x17')]));channels[_0x26c95f[_0x9755('0x7')]]={'uniqueid':_0x26c95f[_0x9755('0x7')],'accountcode':_0x26c95f[_0x9755('0xd')],'source':_0x26c95f[_0x9755('0xb')],'destination':_0x26c95f[_0x9755('0x17')],'destinationcontext':_0x26c95f[_0x9755('0x18')],'channel':_0x26c95f[_0x9755('0x8')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9755('0x2'),'amaflags':_0x9755('0x19')};}}catch(_0x331b29){utils[_0x9755('0x1a')](util[_0x9755('0x6')](_0x9755('0x13'),_0x26c95f[_0x9755('0x7')]),_0x331b29);}};exports[_0x9755('0x1b')]=function(_0x5c6395){try{utils[_0x9755('0x1c')](util[_0x9755('0x6')](_0x9755('0x1d'),_0x5c6395[_0x9755('0x7')]),_0x5c6395);if(!_[_0x9755('0x1e')](channels[_0x5c6395[_0x9755('0x7')]])&&_0x5c6395[_0x9755('0x1f')]==0x6){utils['info'](util[_0x9755('0x6')](_0x9755('0x20'),_0x5c6395[_0x9755('0x7')],_0x5c6395['context'],_0x5c6395[_0x9755('0x8')]));if(_[_0x9755('0x1e')](channels[_0x5c6395['uniqueid']][_0x9755('0x21')])){channels[_0x5c6395['uniqueid']][_0x9755('0x21')]=utils[_0x9755('0x22')]();}}else if(!_[_0x9755('0x1e')](channels[_0x5c6395[_0x9755('0x14')]])&&_0x5c6395['channelstate']==0x6&&_0x5c6395[_0x9755('0x18')]!=_0x9755('0x23')){utils[_0x9755('0x5')](util[_0x9755('0x6')](_0x9755('0x24'),_0x5c6395[_0x9755('0x7')],_0x5c6395[_0x9755('0x14')],_0x5c6395['context'],_0x5c6395['channel']));channels[_0x5c6395['linkedid']][_0x9755('0xd')]=_0x5c6395[_0x9755('0xd')];channels[_0x5c6395[_0x9755('0x14')]][_0x9755('0x25')]=_0x5c6395['channel'];if(_[_0x9755('0x1e')](channels[_0x5c6395['linkedid']]['answertime'])){channels[_0x5c6395['linkedid']][_0x9755('0x26')]=utils[_0x9755('0x22')]();}channels[_0x5c6395[_0x9755('0x14')]]['disposition']=dispositions[_[_0x9755('0x27')](_0x5c6395[_0x9755('0x1f')])]||_0x9755('0x28');}}catch(_0x267794){utils[_0x9755('0x1a')](util[_0x9755('0x6')](_0x9755('0x1d'),_0x5c6395[_0x9755('0x7')]),_0x267794);}};exports[_0x9755('0x29')]=function(_0xaaed74){try{if(!_[_0x9755('0x1e')](channels[_0xaaed74[_0x9755('0x7')]])){utils['debug'](util[_0x9755('0x6')]('[%s][calls][hangup]',_0xaaed74[_0x9755('0x7')]),_0xaaed74);if(_[_0x9755('0x1e')](channels[_0xaaed74[_0x9755('0x7')]][_0x9755('0x2a')])){channels[_0xaaed74[_0x9755('0x7')]]['callerid']=_0xaaed74['calleridname']+'\x20<'+_0xaaed74['calleridnum']+'>';}utils['info'](util[_0x9755('0x6')](_0x9755('0x2b'),_0xaaed74[_0x9755('0x7')],channels[_0xaaed74[_0x9755('0x7')]][_0x9755('0x2a')],_0xaaed74[_0x9755('0x2c')]));channels[_0xaaed74[_0x9755('0x7')]][_0x9755('0x2d')]=utils['now']();channels[_0xaaed74['uniqueid']][_0x9755('0x2e')]=utils[_0x9755('0x2f')](channels[_0xaaed74[_0x9755('0x7')]][_0x9755('0x2d')],channels[_0xaaed74['uniqueid']]['starttime']);channels[_0xaaed74['uniqueid']][_0x9755('0x30')]=channels[_0xaaed74[_0x9755('0x7')]][_0x9755('0x26')]?utils[_0x9755('0x2f')](channels[_0xaaed74[_0x9755('0x7')]]['endtime'],channels[_0xaaed74[_0x9755('0x7')]][_0x9755('0x26')]):0x0;writeDB(channels[_0xaaed74[_0x9755('0x7')]]);}}catch(_0xce1e04){utils[_0x9755('0x1a')](util[_0x9755('0x6')](_0x9755('0x31'),_0xaaed74[_0x9755('0x7')]),_0xce1e04);}};exports[_0x9755('0x32')]=function(_0x4442f0){try{if(!_[_0x9755('0x1e')](channels[_0x4442f0[_0x9755('0x33')]])){utils[_0x9755('0x1c')](util['format']('[%s][calls][attendedtransfer]',_0x4442f0[_0x9755('0x34')]),_0x4442f0);if(channels[_0x4442f0['localtwolinkedid']]['channel']==_0x4442f0['transfereechannel']){utils['info'](util[_0x9755('0x6')](_0x9755('0x35'),_0x4442f0['origtransfereruniqueid'],_0x4442f0['localtwolinkedid'],_0x4442f0['secondtransfererchannel']));channels[_0x4442f0[_0x9755('0x33')]][_0x9755('0x25')]=_0x4442f0[_0x9755('0x36')];channels[_0x4442f0['localtwolinkedid']]['userfield']=_0x9755('0x37');}else if(channels[_0x4442f0[_0x9755('0x33')]][_0x9755('0x8')]=_0x4442f0[_0x9755('0x38')]){utils[_0x9755('0x5')](util[_0x9755('0x6')](_0x9755('0x35'),_0x4442f0['origtransfereruniqueid'],_0x4442f0['localtwolinkedid'],_0x4442f0[_0x9755('0x39')]));channels[_0x4442f0[_0x9755('0x33')]]['destinationchannel']=_0x4442f0[_0x9755('0x39')];channels[_0x4442f0[_0x9755('0x33')]][_0x9755('0x3a')]=_0x9755('0x37');}}}catch(_0x246fcf){utils[_0x9755('0x1a')](util[_0x9755('0x6')](_0x9755('0x3b'),_0x4442f0[_0x9755('0x34')]),_0x246fcf);}};exports[_0x9755('0x3c')]=function(_0x45f3e6){try{if(!_[_0x9755('0x1e')](channels[_0x45f3e6[_0x9755('0x7')]])){utils[_0x9755('0x1c')](util[_0x9755('0x6')]('[%s][calls][musiconholdstart]',_0x45f3e6['uniqueid']),_0x45f3e6);channels[_0x45f3e6[_0x9755('0x7')]]['musiconholdstartAt']=utils[_0x9755('0x22')]();utils['info'](util[_0x9755('0x6')](_0x9755('0x3d'),_0x45f3e6['uniqueid'],channels[_0x45f3e6[_0x9755('0x7')]][_0x9755('0x3e')]));}}catch(_0x4f3a38){utils[_0x9755('0x1a')](util[_0x9755('0x6')](_0x9755('0x3f'),_0x45f3e6['uniqueid']),_0x4f3a38);}};exports['musiconholdstop']=function(_0xf2632){try{if(!_[_0x9755('0x1e')](channels[_0xf2632[_0x9755('0x7')]])){utils[_0x9755('0x1c')](util['format'](_0x9755('0x40'),_0xf2632[_0x9755('0x7')]),_0xf2632);if(!_[_0x9755('0x1e')](channels[_0xf2632[_0x9755('0x7')]][_0x9755('0x3e')])){channels[_0xf2632[_0x9755('0x7')]][_0x9755('0x41')]+=utils[_0x9755('0x2f')](utils[_0x9755('0x22')](),channels[_0xf2632[_0x9755('0x7')]][_0x9755('0x3e')]);utils[_0x9755('0x5')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0xf2632[_0x9755('0x7')],channels[_0xf2632['uniqueid']][_0x9755('0x41')]));delete channels[_0xf2632['uniqueid']]['musiconholdstartAt'];}}}catch(_0xf5e85){utils[_0x9755('0x1a')](util[_0x9755('0x6')]('[%s][calls][musiconholdstop]',_0xf2632[_0x9755('0x7')]),_0xf5e85);}};exports[_0x9755('0x42')]=function(_0x8fc289){try{if(!_[_0x9755('0x1e')](channels[_0x8fc289['uniqueid']])){utils['debug'](util[_0x9755('0x6')]('[%s][calls][varset]',_0x8fc289[_0x9755('0x7')]),_0x8fc289);if(!_['isNil'](_0x8fc289['variable'][_0x9755('0x43')])){utils[_0x9755('0x5')](util[_0x9755('0x6')](_0x9755('0x44'),_0x8fc289[_0x9755('0x7')],_0x8fc289[_0x9755('0x45')]));channels[_0x8fc289[_0x9755('0x7')]][_0x9755('0x46')]=_0x8fc289[_0x9755('0x45')];}if(!_[_0x9755('0x1e')](_0x8fc289['variable'][_0x9755('0x47')])){utils['info'](util['format'](_0x9755('0x48'),_0x8fc289[_0x9755('0x7')],_0x8fc289[_0x9755('0x45')]));channels[_0x8fc289['uniqueid']][_0x9755('0x49')]=_0x8fc289[_0x9755('0x45')];channels[_0x8fc289[_0x9755('0x7')]][_0x9755('0x2a')]='\x22'+_0x8fc289['value']+'\x22\x20<'+_0x8fc289[_0x9755('0x45')]+'>';}if(!_[_0x9755('0x1e')](_0x8fc289[_0x9755('0x4a')]['xmd-callerid-preview'])||!_['isNil'](_0x8fc289[_0x9755('0x4a')][_0x9755('0x4b')])){utils['info'](util['format'](_0x9755('0x4c'),_0x8fc289[_0x9755('0x7')],!_[_0x9755('0x1e')](_0x8fc289[_0x9755('0x4a')][_0x9755('0x4d')])?'xmd-callerid-preview':'xmd-callerid',_0x8fc289[_0x9755('0x45')]));channels[_0x8fc289[_0x9755('0x7')]][_0x9755('0x2a')]=_0x8fc289[_0x9755('0x45')];}if(!_[_0x9755('0x1e')](_0x8fc289[_0x9755('0x4a')][_0x9755('0x4e')])||!_[_0x9755('0x1e')](_0x8fc289['variable']['xmcs-queue'])){utils[_0x9755('0x5')](util['format'](_0x9755('0x4c'),_0x8fc289[_0x9755('0x7')],!_[_0x9755('0x1e')](_0x8fc289[_0x9755('0x4a')]['xmd-queue'])?'xmd-queue':_0x9755('0x4f'),_0x8fc289['value']));channels[_0x8fc289['uniqueid']][_0x9755('0x50')]=_0x9755('0x51');channels[_0x8fc289[_0x9755('0x7')]][_0x9755('0x52')]=_0x8fc289[_0x9755('0x45')];channels[_0x8fc289[_0x9755('0x7')]]['queue']=!![];}if(!_['isNil'](_0x8fc289[_0x9755('0x4a')][_0x9755('0x53')])){utils[_0x9755('0x5')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x8fc289[_0x9755('0x7')],_0x8fc289[_0x9755('0x45')]));channels[_0x8fc289[_0x9755('0x7')]][_0x9755('0x54')]=_0x8fc289[_0x9755('0x45')];}if(!_[_0x9755('0x1e')](_0x8fc289['variable'][_0x9755('0x55')])){utils[_0x9755('0x5')](util[_0x9755('0x6')](_0x9755('0x56'),_0x8fc289[_0x9755('0x7')],_0x8fc289['value']));channels[_0x8fc289[_0x9755('0x7')]]['type']=_0x8fc289[_0x9755('0x45')];}if(!_[_0x9755('0x1e')](_0x8fc289[_0x9755('0x4a')][_0x9755('0x57')])){utils[_0x9755('0x5')](util[_0x9755('0x6')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x8fc289[_0x9755('0x7')],_0x8fc289[_0x9755('0x45')]));channels[_0x8fc289[_0x9755('0x7')]]['routeid']=_0x8fc289['value'];}if(!_[_0x9755('0x1e')](_0x8fc289['variable'][_0x9755('0x58')])){utils['info'](util[_0x9755('0x6')](_0x9755('0x59'),_0x8fc289[_0x9755('0x7')],_0x8fc289['value']));channels[_0x8fc289[_0x9755('0x7')]][_0x9755('0x58')]=_0x8fc289[_0x9755('0x45')];}}}catch(_0xf8f595){utils[_0x9755('0x1a')](util[_0x9755('0x6')]('[%s][calls][varset]',_0x8fc289[_0x9755('0x7')]),_0xf8f595);}};exports[_0x9755('0x5a')]=function(_0x4eb651){try{if(!_[_0x9755('0x1e')](channels[_0x4eb651[_0x9755('0x7')]])){utils[_0x9755('0x1c')](util['format'](_0x9755('0x5b'),_0x4eb651[_0x9755('0x7')]),_0x4eb651);utils[_0x9755('0x5')](util[_0x9755('0x6')](_0x9755('0x5c'),_0x4eb651[_0x9755('0x7')],_0x4eb651['application'],_0x4eb651[_0x9755('0x5d')]));if(_0x4eb651[_0x9755('0x5e')]['toLowerCase']()==_0x9755('0x5f')&&_['startsWith'](_0x4eb651[_0x9755('0x5d')][_0x9755('0x60')](),_0x9755('0x61'))){var _0x37a4bb=_0x4eb651[_0x9755('0x5d')]['split']('=');var _0x4ae0c7=_0x37a4bb[0x0][_0x9755('0x62')](_0x37a4bb[0x0][_0x9755('0x63')]('(')+0x1,_0x37a4bb[0x0][_0x9755('0x63')](')'));var _0x5e731c=_0x37a4bb[0x1];channels[_0x4eb651[_0x9755('0x7')]][_0x4ae0c7]=_0x5e731c;}if(!_[_0x9755('0x64')]([_0x9755('0x29'),_0x9755('0x65'),_0x9755('0x66'),'set','gotoif'],_0x4eb651[_0x9755('0x5e')][_0x9755('0x60')]())){channels[_0x4eb651[_0x9755('0x7')]]['lastapplication']=_0x4eb651[_0x9755('0x5e')];channels[_0x4eb651[_0x9755('0x7')]][_0x9755('0x52')]=_0x4eb651[_0x9755('0x5d')];}}}catch(_0x3bbe3b){utils[_0x9755('0x1a')](util['format'](_0x9755('0x5b'),_0x4eb651[_0x9755('0x7')]),_0x3bbe3b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index d487188..e6c7153 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 _0xf1e5=['./utils','info','shutdown','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x12514c,_0x4e394c){var _0x39ebe5=function(_0x16105e){while(--_0x16105e){_0x12514c['push'](_0x12514c['shift']());}};_0x39ebe5(++_0x4e394c);}(_0xf1e5,0x70));var _0x5f1e=function(_0x122d03,_0x3dc975){_0x122d03=_0x122d03-0x0;var _0x5dd107=_0xf1e5[_0x122d03];return _0x5dd107;};'use strict';var utils=require(_0x5f1e('0x0'));exports['connect']=function(){utils[_0x5f1e('0x1')]('[core]\x20connected');};exports[_0x5f1e('0x2')]=function(){utils[_0x5f1e('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0x5f1e('0x1')](_0x5f1e('0x3'));};exports[_0x5f1e('0x4')]=function(_0x40e543){utils['error'](_0x5f1e('0x5'),_0x40e543);};exports[_0x5f1e('0x6')]=function(){utils[_0x5f1e('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x15529a){}; \ No newline at end of file +var _0x2d6b=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','./utils'];(function(_0x4a74c1,_0x29c762){var _0x1ed207=function(_0x2c89ec){while(--_0x2c89ec){_0x4a74c1['push'](_0x4a74c1['shift']());}};_0x1ed207(++_0x29c762);}(_0x2d6b,0xf1));var _0xb2d6=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2d6b[_0x11005e];return _0x29338f;};'use strict';var utils=require(_0xb2d6('0x0'));exports[_0xb2d6('0x1')]=function(){utils[_0xb2d6('0x2')](_0xb2d6('0x3'));};exports[_0xb2d6('0x4')]=function(){utils[_0xb2d6('0x2')](_0xb2d6('0x5'));};exports[_0xb2d6('0x6')]=function(){utils['info'](_0xb2d6('0x7'));};exports[_0xb2d6('0x8')]=function(_0x19b1a9){utils['error'](_0xb2d6('0x9'),_0x19b1a9);};exports[_0xb2d6('0xa')]=function(){utils[_0xb2d6('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x49ba8a){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 657343a..62a1f57 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 _0x9dda=['now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','duration','endtime','holdtime','diffTime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','connectedlinenum','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr(routeid)','split','error','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','debug','[%s][dials][dialbegin]','assign','starttime'];(function(_0x24277d,_0x5a3f0d){var _0x5b5710=function(_0x3fbe78){while(--_0x3fbe78){_0x24277d['push'](_0x24277d['shift']());}};_0x5b5710(++_0x5a3f0d);}(_0x9dda,0x1e9));var _0xa9dd=function(_0x26b36d,_0x2ca82b){_0x26b36d=_0x26b36d-0x0;var _0x55f378=_0x9dda[_0x26b36d];return _0x55f378;};'use strict';var _=require(_0xa9dd('0x0'));var util=require('util');var utils=require(_0xa9dd('0x1'));var dials={};function writeDB(_0x3edc65){utils[_0xa9dd('0x2')](util[_0xa9dd('0x3')](_0xa9dd('0x4'),_0x3edc65[_0xa9dd('0x5')],_0x3edc65['channel'],_0x3edc65[_0xa9dd('0x6')],_0x3edc65['calleridnum'],_0x3edc65[_0xa9dd('0x7')],_0x3edc65['dialstatus']));utils['request']('CreateVoiceDialReport',_0x3edc65);delete dials[_0x3edc65[_0xa9dd('0x5')]];}exports[_0xa9dd('0x8')]=function(_0x29f358){try{utils['debug'](util[_0xa9dd('0x3')](_0xa9dd('0x9'),_0x29f358[_0xa9dd('0x5')]),_0x29f358);utils[_0xa9dd('0x2')](util[_0xa9dd('0x3')](_0xa9dd('0xa'),_0x29f358[_0xa9dd('0x5')],_0x29f358[_0xa9dd('0xb')],_0x29f358['appdata']));if(_0x29f358['application'][_0xa9dd('0xc')]()==_0xa9dd('0xd')&&_['startsWith'](_0x29f358[_0xa9dd('0xe')][_0xa9dd('0xc')](),_0xa9dd('0xf'))){var _0x1dacbe=_0x29f358[_0xa9dd('0xe')][_0xa9dd('0x10')]('=');dials[_0x29f358[_0xa9dd('0x5')]]={'routeId':_0x1dacbe[0x1]};}}catch(_0x924b77){utils[_0xa9dd('0x11')](util[_0xa9dd('0x3')]('[%s][dials][newexten]',_0x29f358[_0xa9dd('0x5')]),_0x924b77);}};exports['varset']=function(_0x47d074){try{utils['debug'](util['format'](_0xa9dd('0x12'),_0x47d074[_0xa9dd('0x5')]),_0x47d074);if(!_['isNil'](_0x47d074[_0xa9dd('0x13')][_0xa9dd('0x14')])){utils['info'](util[_0xa9dd('0x3')](_0xa9dd('0x15'),_0x47d074[_0xa9dd('0x5')],_0x47d074[_0xa9dd('0x16')]));dials[_0x47d074[_0xa9dd('0x5')]]={'routeId':_0x47d074[_0xa9dd('0x16')]};}}catch(_0x474d4b){utils['error'](util['format'](_0xa9dd('0x12'),_0x47d074[_0xa9dd('0x5')]),_0x474d4b);}};exports['dialbegin']=function(_0x3e805a){try{if(!_[_0xa9dd('0x17')](dials[_0x3e805a[_0xa9dd('0x5')]])){utils[_0xa9dd('0x18')](util['format'](_0xa9dd('0x19'),_0x3e805a[_0xa9dd('0x5')]),_0x3e805a);dials[_0x3e805a['uniqueid']]=_[_0xa9dd('0x1a')](dials[_0x3e805a[_0xa9dd('0x5')]],_0x3e805a);dials[_0x3e805a['uniqueid']][_0xa9dd('0x1b')]=utils[_0xa9dd('0x1c')]();dials[_0x3e805a[_0xa9dd('0x5')]]['lastevent']=_0xa9dd('0x1d');utils[_0xa9dd('0x2')](util[_0xa9dd('0x3')](_0xa9dd('0x1e'),_0x3e805a[_0xa9dd('0x5')],dials[_0x3e805a[_0xa9dd('0x5')]][_0xa9dd('0x1b')]));}}catch(_0x585f8e){utils['error'](util[_0xa9dd('0x3')](_0xa9dd('0x19'),_0x3e805a['uniqueid']),_0x585f8e);}};exports['dialend']=function(_0x953bcc){try{if(!_[_0xa9dd('0x17')](dials[_0x953bcc[_0xa9dd('0x5')]])){utils[_0xa9dd('0x18')](util['format'](_0xa9dd('0x1f'),_0x953bcc[_0xa9dd('0x5')]),_0x953bcc);dials[_0x953bcc[_0xa9dd('0x5')]][_0xa9dd('0x20')]=_0x953bcc[_0xa9dd('0x20')];if(_0x953bcc[_0xa9dd('0x20')]==_0xa9dd('0x21')){dials[_0x953bcc[_0xa9dd('0x5')]]=_[_0xa9dd('0x1a')](dials[_0x953bcc[_0xa9dd('0x5')]],_0x953bcc);dials[_0x953bcc[_0xa9dd('0x5')]]['answertime']=utils['now']();dials[_0x953bcc[_0xa9dd('0x5')]][_0xa9dd('0x22')]=_0xa9dd('0x23');utils[_0xa9dd('0x2')](util[_0xa9dd('0x3')](_0xa9dd('0x24'),_0x953bcc[_0xa9dd('0x5')],_0x953bcc[_0xa9dd('0x20')],dials[_0x953bcc['uniqueid']][_0xa9dd('0x25')]));}else{utils['info'](util[_0xa9dd('0x3')](_0xa9dd('0x26'),_0x953bcc[_0xa9dd('0x5')],_0x953bcc[_0xa9dd('0x20')]));}}}catch(_0x9ff710){utils['error'](util[_0xa9dd('0x3')]('[%s][dials][dialend]',_0x953bcc['uniqueid']),_0x9ff710);}};exports['hangup']=function(_0x23b935){try{if(!_[_0xa9dd('0x17')](dials[_0x23b935[_0xa9dd('0x5')]])){utils[_0xa9dd('0x18')](util['format']('[%s][dials][hangup]',_0x23b935[_0xa9dd('0x5')]),_0x23b935);utils[_0xa9dd('0x2')](util[_0xa9dd('0x3')](_0xa9dd('0x27'),_0x23b935['uniqueid'],_0x23b935[_0xa9dd('0x28')],_0x23b935[_0xa9dd('0x29')],_0x23b935[_0xa9dd('0x2a')]));dials[_0x23b935[_0xa9dd('0x5')]]=_['assign'](dials[_0x23b935['uniqueid']],{'endtime':utils[_0xa9dd('0x1c')](),'lastevent':'complete'});dials[_0x23b935[_0xa9dd('0x5')]][_0xa9dd('0x2b')]=utils['diffTime'](dials[_0x23b935[_0xa9dd('0x5')]][_0xa9dd('0x2c')],dials[_0x23b935[_0xa9dd('0x5')]][_0xa9dd('0x1b')]);dials[_0x23b935[_0xa9dd('0x5')]][_0xa9dd('0x2d')]=utils['diffTime'](dials[_0x23b935['uniqueid']][_0xa9dd('0x25')]||dials[_0x23b935['uniqueid']][_0xa9dd('0x2c')],dials[_0x23b935[_0xa9dd('0x5')]]['starttime']);dials[_0x23b935[_0xa9dd('0x5')]]['billableseconds']=dials[_0x23b935['uniqueid']][_0xa9dd('0x25')]?utils[_0xa9dd('0x2e')](dials[_0x23b935[_0xa9dd('0x5')]][_0xa9dd('0x2c')],dials[_0x23b935[_0xa9dd('0x5')]][_0xa9dd('0x25')]):0x0;writeDB(dials[_0x23b935[_0xa9dd('0x5')]]);}}catch(_0x21dcb0){utils[_0xa9dd('0x11')](util['format']('[%s][dials][hangup]',_0x23b935['uniqueid']),_0x21dcb0);}}; \ No newline at end of file +var _0x63a1=['answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','dialstatus','CreateVoiceDialReport','uniqueid','[%s][dials][newexten]','application','toLowerCase','set','appdata','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','debug','[%s][dials][dialbegin]','assign','starttime','lastevent','called','dialend','ANSWER'];(function(_0x15544a,_0x4e802f){var _0x5dd90f=function(_0x12064f){while(--_0x12064f){_0x15544a['push'](_0x15544a['shift']());}};_0x5dd90f(++_0x4e802f);}(_0x63a1,0x1a0));var _0x163a=function(_0x41f56f,_0x8e1b2b){_0x41f56f=_0x41f56f-0x0;var _0x5618ef=_0x63a1[_0x41f56f];return _0x5618ef;};'use strict';var _=require(_0x163a('0x0'));var util=require('util');var utils=require(_0x163a('0x1'));var dials={};function writeDB(_0x1712aa){utils[_0x163a('0x2')](util[_0x163a('0x3')](_0x163a('0x4'),_0x1712aa['uniqueid'],_0x1712aa[_0x163a('0x5')],_0x1712aa['dialstring'],_0x1712aa[_0x163a('0x6')],_0x1712aa['connectedlinenum'],_0x1712aa[_0x163a('0x7')]));utils['request'](_0x163a('0x8'),_0x1712aa);delete dials[_0x1712aa[_0x163a('0x9')]];}exports['newexten']=function(_0x4b4bdc){try{utils['debug'](util['format'](_0x163a('0xa'),_0x4b4bdc['uniqueid']),_0x4b4bdc);utils[_0x163a('0x2')](util[_0x163a('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4b4bdc[_0x163a('0x9')],_0x4b4bdc[_0x163a('0xb')],_0x4b4bdc['appdata']));if(_0x4b4bdc['application'][_0x163a('0xc')]()==_0x163a('0xd')&&_['startsWith'](_0x4b4bdc[_0x163a('0xe')][_0x163a('0xc')](),_0x163a('0xf'))){var _0x3224e1=_0x4b4bdc[_0x163a('0xe')][_0x163a('0x10')]('=');dials[_0x4b4bdc[_0x163a('0x9')]]={'routeId':_0x3224e1[0x1]};}}catch(_0x5a8c94){utils[_0x163a('0x11')](util[_0x163a('0x3')](_0x163a('0xa'),_0x4b4bdc[_0x163a('0x9')]),_0x5a8c94);}};exports[_0x163a('0x12')]=function(_0x5d6647){try{utils['debug'](util[_0x163a('0x3')](_0x163a('0x13'),_0x5d6647['uniqueid']),_0x5d6647);if(!_[_0x163a('0x14')](_0x5d6647[_0x163a('0x15')][_0x163a('0x16')])){utils[_0x163a('0x2')](util[_0x163a('0x3')](_0x163a('0x17'),_0x5d6647[_0x163a('0x9')],_0x5d6647[_0x163a('0x18')]));dials[_0x5d6647[_0x163a('0x9')]]={'routeId':_0x5d6647[_0x163a('0x18')]};}}catch(_0x424069){utils['error'](util[_0x163a('0x3')]('[%s][dials][varset]',_0x5d6647[_0x163a('0x9')]),_0x424069);}};exports[_0x163a('0x19')]=function(_0x11f1b3){try{if(!_[_0x163a('0x14')](dials[_0x11f1b3['uniqueid']])){utils[_0x163a('0x1a')](util[_0x163a('0x3')](_0x163a('0x1b'),_0x11f1b3[_0x163a('0x9')]),_0x11f1b3);dials[_0x11f1b3['uniqueid']]=_[_0x163a('0x1c')](dials[_0x11f1b3[_0x163a('0x9')]],_0x11f1b3);dials[_0x11f1b3[_0x163a('0x9')]][_0x163a('0x1d')]=utils['now']();dials[_0x11f1b3[_0x163a('0x9')]][_0x163a('0x1e')]=_0x163a('0x1f');utils[_0x163a('0x2')](util[_0x163a('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x11f1b3[_0x163a('0x9')],dials[_0x11f1b3[_0x163a('0x9')]][_0x163a('0x1d')]));}}catch(_0x525b2e){utils[_0x163a('0x11')](util['format'](_0x163a('0x1b'),_0x11f1b3[_0x163a('0x9')]),_0x525b2e);}};exports[_0x163a('0x20')]=function(_0x3fdaca){try{if(!_[_0x163a('0x14')](dials[_0x3fdaca[_0x163a('0x9')]])){utils[_0x163a('0x1a')](util[_0x163a('0x3')]('[%s][dials][dialend]',_0x3fdaca[_0x163a('0x9')]),_0x3fdaca);dials[_0x3fdaca['uniqueid']][_0x163a('0x7')]=_0x3fdaca[_0x163a('0x7')];if(_0x3fdaca[_0x163a('0x7')]==_0x163a('0x21')){dials[_0x3fdaca['uniqueid']]=_[_0x163a('0x1c')](dials[_0x3fdaca[_0x163a('0x9')]],_0x3fdaca);dials[_0x3fdaca[_0x163a('0x9')]][_0x163a('0x22')]=utils[_0x163a('0x23')]();dials[_0x3fdaca[_0x163a('0x9')]][_0x163a('0x1e')]='connect';utils[_0x163a('0x2')](util[_0x163a('0x3')](_0x163a('0x24'),_0x3fdaca['uniqueid'],_0x3fdaca[_0x163a('0x7')],dials[_0x3fdaca[_0x163a('0x9')]][_0x163a('0x22')]));}else{utils['info'](util['format'](_0x163a('0x25'),_0x3fdaca[_0x163a('0x9')],_0x3fdaca[_0x163a('0x7')]));}}}catch(_0x149ae9){utils[_0x163a('0x11')](util['format'](_0x163a('0x26'),_0x3fdaca['uniqueid']),_0x149ae9);}};exports[_0x163a('0x27')]=function(_0x284d56){try{if(!_['isNil'](dials[_0x284d56[_0x163a('0x9')]])){utils[_0x163a('0x1a')](util[_0x163a('0x3')](_0x163a('0x28'),_0x284d56['uniqueid']),_0x284d56);utils[_0x163a('0x2')](util[_0x163a('0x3')](_0x163a('0x29'),_0x284d56[_0x163a('0x9')],_0x284d56[_0x163a('0x6')],_0x284d56[_0x163a('0x2a')],_0x284d56[_0x163a('0x2b')]));dials[_0x284d56[_0x163a('0x9')]]=_[_0x163a('0x1c')](dials[_0x284d56['uniqueid']],{'endtime':utils[_0x163a('0x23')](),'lastevent':_0x163a('0x2c')});dials[_0x284d56[_0x163a('0x9')]][_0x163a('0x2d')]=utils[_0x163a('0x2e')](dials[_0x284d56[_0x163a('0x9')]]['endtime'],dials[_0x284d56['uniqueid']][_0x163a('0x1d')]);dials[_0x284d56[_0x163a('0x9')]][_0x163a('0x2f')]=utils[_0x163a('0x2e')](dials[_0x284d56[_0x163a('0x9')]]['answertime']||dials[_0x284d56[_0x163a('0x9')]][_0x163a('0x30')],dials[_0x284d56[_0x163a('0x9')]][_0x163a('0x1d')]);dials[_0x284d56[_0x163a('0x9')]][_0x163a('0x31')]=dials[_0x284d56['uniqueid']]['answertime']?utils[_0x163a('0x2e')](dials[_0x284d56['uniqueid']][_0x163a('0x30')],dials[_0x284d56[_0x163a('0x9')]][_0x163a('0x22')]):0x0;writeDB(dials[_0x284d56[_0x163a('0x9')]]);}}catch(_0x47fb82){utils['error'](util[_0x163a('0x3')](_0x163a('0x28'),_0x284d56[_0x163a('0x9')]),_0x47fb82);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 9d0b306..197a5c9 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 _0x1f96=['util','xdr','disabled','production','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','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','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils'];(function(_0x32691a,_0x4e946a){var _0x1a9905=function(_0x2c7ea5){while(--_0x2c7ea5){_0x32691a['push'](_0x32691a['shift']());}};_0x1a9905(++_0x4e946a);}(_0x1f96,0x1a8));var _0x61f9=function(_0x523347,_0x5b7207){_0x523347=_0x523347-0x0;var _0x3e30dd=_0x1f96[_0x523347];return _0x3e30dd;};var AsteriskManager=require('asterisk-manager');var config=require(_0x61f9('0x0'));var utils=require(_0x61f9('0x1'));var util=require(_0x61f9('0x2'));var isXDREnabled=config['xdr']&&config[_0x61f9('0x3')][_0x61f9('0x4')]?!config[_0x61f9('0x3')]['disabled']:!![];var isProduction=config['env']===_0x61f9('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x61f9('0x6')][_0x61f9('0x7')],config['asterisk']['ip'],config[_0x61f9('0x6')][_0x61f9('0x8')],config['asterisk'][_0x61f9('0x9')],!![]);ami[_0x61f9('0xa')]();if(!isXDREnabled){utils[_0x61f9('0xb')](_0x61f9('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x61f9('0xb')](_0x61f9('0xd'));}else{var agents=require(_0x61f9('0xe'));var calls=require(_0x61f9('0xf'));var queues=require(_0x61f9('0x10'));var recordings=require(_0x61f9('0x11'));var members=require(_0x61f9('0x12'));var dials=require(_0x61f9('0x13'));var transfers=require('./transfers.controller');var core=require(_0x61f9('0x14'));ami['on']('connect',core[_0x61f9('0x15')]);ami['on']('shutdown',core[_0x61f9('0x16')]);ami['on']('fullybooted',core[_0x61f9('0x17')]);ami['on'](_0x61f9('0x18'),core[_0x61f9('0x18')]);ami['on'](_0x61f9('0x19'),core['close']);ami['on'](_0x61f9('0x1a'),core['managerevent']);ami['on']('devicestatechange',function(_0x23d1da){try{utils['debug'](util[_0x61f9('0x1b')](_0x61f9('0x1c'),_0x23d1da[_0x61f9('0x1d')]),_0x23d1da);members['devicestatechange'](_0x23d1da);}catch(_0x36f88b){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x1c'),_0x23d1da[_0x61f9('0x1d')]),_0x36f88b);}});ami['on'](_0x61f9('0x1e'),function(_0x25bd7f){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x20'),_0x25bd7f[_0x61f9('0x21')]),_0x25bd7f);agents['agentcalled'](_0x25bd7f);}catch(_0x5f0dcb){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x20'),_0x25bd7f[_0x61f9('0x21')]),_0x5f0dcb);}});ami['on']('agentringnoanswer',function(_0x4c40ec){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x22'),_0x4c40ec[_0x61f9('0x21')]),_0x4c40ec);agents[_0x61f9('0x23')](_0x4c40ec);}catch(_0x153c83){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x22'),_0x4c40ec[_0x61f9('0x21')]),_0x153c83);}});ami['on']('agentconnect',function(_0x1987a2){try{utils['debug'](util[_0x61f9('0x1b')](_0x61f9('0x24'),_0x1987a2[_0x61f9('0x21')]),_0x1987a2);agents[_0x61f9('0x25')](_0x1987a2);queues[_0x61f9('0x25')](_0x1987a2);}catch(_0x126e43){utils['error'](util[_0x61f9('0x1b')](_0x61f9('0x24'),_0x1987a2[_0x61f9('0x21')]),_0x126e43);}});ami['on'](_0x61f9('0x26'),function(_0x212b17){try{utils['debug'](util[_0x61f9('0x1b')](_0x61f9('0x27'),_0x212b17[_0x61f9('0x21')]),_0x212b17);agents[_0x61f9('0x26')](_0x212b17);queues['agentcomplete'](_0x212b17);members[_0x61f9('0x26')](_0x212b17);}catch(_0x1027b2){utils[_0x61f9('0x18')](util['format'](_0x61f9('0x27'),_0x212b17[_0x61f9('0x21')]),_0x1027b2);}});ami['on'](_0x61f9('0x28'),function(_0x251186){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x29'),_0x251186[_0x61f9('0x21')]),_0x251186);agents[_0x61f9('0x28')](_0x251186);queues['queuecallerabandon'](_0x251186);}catch(_0xb60d1e){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')]('[%s][index][queuecallerabandon]',_0x251186[_0x61f9('0x21')]),_0xb60d1e);}});ami['on'](_0x61f9('0x2a'),function(_0x107b68){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x2b'),_0x107b68[_0x61f9('0x21')]),_0x107b68);queues[_0x61f9('0x2a')](_0x107b68);recordings['queuecallerjoin'](_0x107b68);}catch(_0x582206){utils['error'](util[_0x61f9('0x1b')](_0x61f9('0x2b'),_0x107b68[_0x61f9('0x21')]),_0x582206);}});ami['on'](_0x61f9('0x2c'),function(_0x13e37f){try{utils['debug'](util[_0x61f9('0x1b')](_0x61f9('0x2d'),_0x13e37f['uniqueid']),_0x13e37f);queues['queuecallerleave'](_0x13e37f);}catch(_0x3fe03a){utils[_0x61f9('0x18')](util['format'](_0x61f9('0x2d'),_0x13e37f[_0x61f9('0x21')]),_0x3fe03a);}});ami['on']('musiconholdstart',function(_0x11844c){try{utils['debug'](util[_0x61f9('0x1b')](_0x61f9('0x2e'),_0x11844c['uniqueid']),_0x11844c);queues[_0x61f9('0x2f')](_0x11844c);calls[_0x61f9('0x2f')](_0x11844c);}catch(_0x4235b5){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x2e'),_0x11844c[_0x61f9('0x21')]),_0x4235b5);}});ami['on'](_0x61f9('0x30'),function(_0x1bd0be){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x31'),_0x1bd0be[_0x61f9('0x21')]),_0x1bd0be);queues[_0x61f9('0x30')](_0x1bd0be);calls[_0x61f9('0x30')](_0x1bd0be);}catch(_0x5d081d){utils[_0x61f9('0x18')](util['format'](_0x61f9('0x31'),_0x1bd0be[_0x61f9('0x21')]),_0x5d081d);}});ami['on'](_0x61f9('0x32'),function(_0x1348a1){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x33'),_0x1348a1[_0x61f9('0x21')]),_0x1348a1);calls[_0x61f9('0x32')](_0x1348a1);recordings[_0x61f9('0x32')](_0x1348a1);}catch(_0x139bf2){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x33'),_0x1348a1[_0x61f9('0x21')]),_0x139bf2);}});ami['on'](_0x61f9('0x34'),function(_0x56b4af){try{utils[_0x61f9('0x1f')](util['format']('[%s][index][hangup]',_0x56b4af['uniqueid']),_0x56b4af);calls[_0x61f9('0x34')](_0x56b4af);recordings[_0x61f9('0x34')](_0x56b4af);dials[_0x61f9('0x34')](_0x56b4af);agents[_0x61f9('0x34')](_0x56b4af);queues[_0x61f9('0x34')](_0x56b4af);}catch(_0x4aa93d){utils['error'](util[_0x61f9('0x1b')]('[%s][index][hangup]',_0x56b4af[_0x61f9('0x21')]),_0x4aa93d);}});ami['on'](_0x61f9('0x35'),function(_0x1a5257){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x36'),_0x1a5257['uniqueid']),_0x1a5257);members[_0x61f9('0x35')](_0x1a5257);}catch(_0x2a8138){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x36'),_0x1a5257['uniqueid']),_0x2a8138);}});ami['on'](_0x61f9('0x37'),function(_0x1668e0){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x38'),_0x1668e0[_0x61f9('0x21')]),_0x1668e0);queues['blindtransfer'](_0x1668e0);agents[_0x61f9('0x37')](_0x1668e0);transfers[_0x61f9('0x37')](_0x1668e0);}catch(_0x4583c2){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')]('[%s][index][blindtransfer]',_0x1668e0[_0x61f9('0x21')]),_0x4583c2);}});ami['on'](_0x61f9('0x39'),function(_0x304ab6){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x3a'),_0x304ab6[_0x61f9('0x3b')]),_0x304ab6);queues[_0x61f9('0x39')](_0x304ab6);transfers[_0x61f9('0x39')](_0x304ab6);agents['attendedtransfer'](_0x304ab6);calls['attendedtransfer'](_0x304ab6);}catch(_0x22aee5){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x3a'),_0x304ab6['origtransfereruniqueid']),_0x22aee5);}});ami['on'](_0x61f9('0x3c'),function(_0x342bc3){try{utils[_0x61f9('0x1f')](util['format'](_0x61f9('0x3d'),_0x342bc3['uniqueid']),_0x342bc3);queues[_0x61f9('0x3c')](_0x342bc3);recordings[_0x61f9('0x3c')](_0x342bc3);calls[_0x61f9('0x3c')](_0x342bc3);dials[_0x61f9('0x3c')](_0x342bc3);}catch(_0x5ae2cd){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x3d'),_0x342bc3['uniqueid']),_0x5ae2cd);}});ami['on'](_0x61f9('0x3e'),function(_0x1fbd8f){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x3f'),_0x1fbd8f[_0x61f9('0x21')]),_0x1fbd8f);calls[_0x61f9('0x3e')](_0x1fbd8f);recordings[_0x61f9('0x3e')](_0x1fbd8f);dials['newexten'](_0x1fbd8f);}catch(_0x2147e6){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x3f'),_0x1fbd8f['uniqueid']),_0x2147e6);}});ami['on'](_0x61f9('0x40'),function(_0x5a7d5c){try{utils['debug'](util[_0x61f9('0x1b')](_0x61f9('0x41'),_0x5a7d5c['uniqueid']),_0x5a7d5c);calls[_0x61f9('0x40')](_0x5a7d5c);recordings[_0x61f9('0x40')](_0x5a7d5c);}catch(_0x49908b){utils['error'](util['format'](_0x61f9('0x41'),_0x5a7d5c[_0x61f9('0x21')]),_0x49908b);}});ami['on'](_0x61f9('0x42'),function(_0xf02681){try{utils[_0x61f9('0x1f')](util[_0x61f9('0x1b')](_0x61f9('0x43'),_0xf02681['uniqueid']),_0xf02681);dials[_0x61f9('0x42')](_0xf02681);}catch(_0x5101c4){utils[_0x61f9('0x18')](util[_0x61f9('0x1b')](_0x61f9('0x44'),_0xf02681['uniqueid']),_0x5101c4);}});ami['on'](_0x61f9('0x45'),function(_0x5b6bde){try{utils['debug'](util['format'](_0x61f9('0x46'),_0x5b6bde[_0x61f9('0x21')]),_0x5b6bde);dials['dialend'](_0x5b6bde);}catch(_0x4ba1af){utils[_0x61f9('0x18')](util['format'](_0x61f9('0x46'),_0x5b6bde[_0x61f9('0x21')]),_0x4ba1af);}});} \ No newline at end of file +var _0xabb0=['[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','device','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xabb0,0xdc));var _0x0abb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabb0[_0x501510];return _0x1e6ee5;};var AsteriskManager=require(_0x0abb('0x0'));var config=require(_0x0abb('0x1'));var utils=require(_0x0abb('0x2'));var util=require(_0x0abb('0x3'));var isXDREnabled=config[_0x0abb('0x4')]&&config[_0x0abb('0x4')][_0x0abb('0x5')]?!config[_0x0abb('0x4')][_0x0abb('0x5')]:!![];var isProduction=config[_0x0abb('0x6')]===_0x0abb('0x7')||![];var isLocalAsterisk=config[_0x0abb('0x4')]&&config['xdr'][_0x0abb('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0x0abb('0x9')][_0x0abb('0xa')],config[_0x0abb('0x9')]['ip'],config[_0x0abb('0x9')][_0x0abb('0xb')],config[_0x0abb('0x9')]['password'],!![]);ami[_0x0abb('0xc')]();if(!isXDREnabled){utils[_0x0abb('0xd')](_0x0abb('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x0abb('0xd')](_0x0abb('0xf'));}else{var agents=require(_0x0abb('0x10'));var calls=require('./calls.controller');var queues=require(_0x0abb('0x11'));var recordings=require('./recordings.controller');var members=require(_0x0abb('0x12'));var dials=require(_0x0abb('0x13'));var transfers=require(_0x0abb('0x14'));var core=require('./core.controller');ami['on'](_0x0abb('0x15'),core[_0x0abb('0x15')]);ami['on'](_0x0abb('0x16'),core[_0x0abb('0x16')]);ami['on']('fullybooted',core[_0x0abb('0x17')]);ami['on'](_0x0abb('0x18'),core[_0x0abb('0x18')]);ami['on'](_0x0abb('0x19'),core[_0x0abb('0x19')]);ami['on']('managerevent',core[_0x0abb('0x1a')]);ami['on'](_0x0abb('0x1b'),function(_0x42df24){try{utils[_0x0abb('0x1c')](util['format']('[%s][index][devicestatechange]',_0x42df24[_0x0abb('0x1d')]),_0x42df24);members[_0x0abb('0x1b')](_0x42df24);}catch(_0x485e54){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x1f'),_0x42df24[_0x0abb('0x1d')]),_0x485e54);}});ami['on'](_0x0abb('0x20'),function(_0x4335e1){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')](_0x0abb('0x21'),_0x4335e1[_0x0abb('0x22')]),_0x4335e1);agents[_0x0abb('0x20')](_0x4335e1);}catch(_0x3402a7){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x21'),_0x4335e1[_0x0abb('0x22')]),_0x3402a7);}});ami['on'](_0x0abb('0x23'),function(_0x2eb62f){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')](_0x0abb('0x24'),_0x2eb62f[_0x0abb('0x22')]),_0x2eb62f);agents[_0x0abb('0x23')](_0x2eb62f);}catch(_0x4602f9){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')]('[%s][index][agentringnoanswer]',_0x2eb62f[_0x0abb('0x22')]),_0x4602f9);}});ami['on'](_0x0abb('0x25'),function(_0x1cd2f8){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')](_0x0abb('0x26'),_0x1cd2f8[_0x0abb('0x22')]),_0x1cd2f8);agents['agentconnect'](_0x1cd2f8);queues[_0x0abb('0x25')](_0x1cd2f8);}catch(_0x448ee4){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x26'),_0x1cd2f8[_0x0abb('0x22')]),_0x448ee4);}});ami['on'](_0x0abb('0x27'),function(_0xe8e7ff){try{utils['debug'](util[_0x0abb('0x1e')](_0x0abb('0x28'),_0xe8e7ff[_0x0abb('0x22')]),_0xe8e7ff);agents['agentcomplete'](_0xe8e7ff);queues['agentcomplete'](_0xe8e7ff);members[_0x0abb('0x27')](_0xe8e7ff);}catch(_0x394cd0){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x28'),_0xe8e7ff[_0x0abb('0x22')]),_0x394cd0);}});ami['on'](_0x0abb('0x29'),function(_0x205049){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')]('[%s][index][queuecallerabandon]',_0x205049[_0x0abb('0x22')]),_0x205049);agents[_0x0abb('0x29')](_0x205049);queues['queuecallerabandon'](_0x205049);}catch(_0x9620bf){utils['error'](util[_0x0abb('0x1e')](_0x0abb('0x2a'),_0x205049[_0x0abb('0x22')]),_0x9620bf);}});ami['on'](_0x0abb('0x2b'),function(_0x481bb1){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')](_0x0abb('0x2c'),_0x481bb1[_0x0abb('0x22')]),_0x481bb1);queues[_0x0abb('0x2b')](_0x481bb1);recordings['queuecallerjoin'](_0x481bb1);}catch(_0x2a86f3){utils['error'](util[_0x0abb('0x1e')](_0x0abb('0x2c'),_0x481bb1['uniqueid']),_0x2a86f3);}});ami['on'](_0x0abb('0x2d'),function(_0x225fc5){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')](_0x0abb('0x2e'),_0x225fc5[_0x0abb('0x22')]),_0x225fc5);queues[_0x0abb('0x2d')](_0x225fc5);}catch(_0xdad303){utils['error'](util[_0x0abb('0x1e')](_0x0abb('0x2e'),_0x225fc5[_0x0abb('0x22')]),_0xdad303);}});ami['on'](_0x0abb('0x2f'),function(_0x560365){try{utils[_0x0abb('0x1c')](util['format'](_0x0abb('0x30'),_0x560365[_0x0abb('0x22')]),_0x560365);queues['musiconholdstart'](_0x560365);calls[_0x0abb('0x2f')](_0x560365);}catch(_0x2bfdd9){utils['error'](util[_0x0abb('0x1e')](_0x0abb('0x30'),_0x560365[_0x0abb('0x22')]),_0x2bfdd9);}});ami['on'](_0x0abb('0x31'),function(_0x3ff78b){try{utils['debug'](util[_0x0abb('0x1e')](_0x0abb('0x32'),_0x3ff78b[_0x0abb('0x22')]),_0x3ff78b);queues[_0x0abb('0x31')](_0x3ff78b);calls[_0x0abb('0x31')](_0x3ff78b);}catch(_0x1c0b7c){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x32'),_0x3ff78b[_0x0abb('0x22')]),_0x1c0b7c);}});ami['on'](_0x0abb('0x33'),function(_0x59ec97){try{utils[_0x0abb('0x1c')](util['format'](_0x0abb('0x34'),_0x59ec97[_0x0abb('0x22')]),_0x59ec97);calls[_0x0abb('0x33')](_0x59ec97);recordings[_0x0abb('0x33')](_0x59ec97);}catch(_0x46b737){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x34'),_0x59ec97[_0x0abb('0x22')]),_0x46b737);}});ami['on'](_0x0abb('0x35'),function(_0x3c0004){try{utils[_0x0abb('0x1c')](util['format']('[%s][index][hangup]',_0x3c0004['uniqueid']),_0x3c0004);calls['hangup'](_0x3c0004);recordings[_0x0abb('0x35')](_0x3c0004);dials[_0x0abb('0x35')](_0x3c0004);agents[_0x0abb('0x35')](_0x3c0004);queues['hangup'](_0x3c0004);}catch(_0x4f1c46){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')]('[%s][index][hangup]',_0x3c0004[_0x0abb('0x22')]),_0x4f1c46);}});ami['on']('cdr',function(_0x414b82){try{utils['debug'](util[_0x0abb('0x1e')](_0x0abb('0x36'),_0x414b82[_0x0abb('0x22')]),_0x414b82);members[_0x0abb('0x37')](_0x414b82);}catch(_0x5380d6){utils['error'](util[_0x0abb('0x1e')](_0x0abb('0x36'),_0x414b82[_0x0abb('0x22')]),_0x5380d6);}});ami['on'](_0x0abb('0x38'),function(_0x438ca6){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')]('[%s][index][blindtransfer]',_0x438ca6[_0x0abb('0x22')]),_0x438ca6);queues[_0x0abb('0x38')](_0x438ca6);agents['blindtransfer'](_0x438ca6);transfers[_0x0abb('0x38')](_0x438ca6);}catch(_0x1eaffb){utils[_0x0abb('0x18')](util['format'](_0x0abb('0x39'),_0x438ca6[_0x0abb('0x22')]),_0x1eaffb);}});ami['on']('attendedtransfer',function(_0x5e585a){try{utils['debug'](util[_0x0abb('0x1e')](_0x0abb('0x3a'),_0x5e585a['origtransfereruniqueid']),_0x5e585a);queues[_0x0abb('0x3b')](_0x5e585a);transfers[_0x0abb('0x3b')](_0x5e585a);agents['attendedtransfer'](_0x5e585a);calls[_0x0abb('0x3b')](_0x5e585a);}catch(_0x22d796){utils[_0x0abb('0x18')](util['format'](_0x0abb('0x3a'),_0x5e585a[_0x0abb('0x3c')]),_0x22d796);}});ami['on'](_0x0abb('0x3d'),function(_0x24cfff){try{utils['debug'](util[_0x0abb('0x1e')]('[%s][index][varset]',_0x24cfff[_0x0abb('0x22')]),_0x24cfff);queues['varset'](_0x24cfff);recordings[_0x0abb('0x3d')](_0x24cfff);calls[_0x0abb('0x3d')](_0x24cfff);dials[_0x0abb('0x3d')](_0x24cfff);}catch(_0x5141f7){utils[_0x0abb('0x18')](util['format'](_0x0abb('0x3e'),_0x24cfff[_0x0abb('0x22')]),_0x5141f7);}});ami['on']('newexten',function(_0x32c51b){try{utils['debug'](util[_0x0abb('0x1e')]('[%s][index][newexten]',_0x32c51b[_0x0abb('0x22')]),_0x32c51b);calls['newexten'](_0x32c51b);recordings[_0x0abb('0x3f')](_0x32c51b);dials['newexten'](_0x32c51b);}catch(_0x354a97){utils['error'](util[_0x0abb('0x1e')](_0x0abb('0x40'),_0x32c51b['uniqueid']),_0x354a97);}});ami['on']('newchannel',function(_0x36bf9b){try{utils['debug'](util[_0x0abb('0x1e')](_0x0abb('0x41'),_0x36bf9b[_0x0abb('0x22')]),_0x36bf9b);calls[_0x0abb('0x42')](_0x36bf9b);recordings['newchannel'](_0x36bf9b);}catch(_0x1402b4){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x41'),_0x36bf9b['uniqueid']),_0x1402b4);}});ami['on']('dialbegin',function(_0x2405dd){try{utils[_0x0abb('0x1c')](util['format'](_0x0abb('0x43'),_0x2405dd['uniqueid']),_0x2405dd);dials[_0x0abb('0x44')](_0x2405dd);}catch(_0x53fab6){utils[_0x0abb('0x18')](util[_0x0abb('0x1e')](_0x0abb('0x45'),_0x2405dd[_0x0abb('0x22')]),_0x53fab6);}});ami['on'](_0x0abb('0x46'),function(_0x352dea){try{utils[_0x0abb('0x1c')](util[_0x0abb('0x1e')]('[%s][index][dialend]',_0x352dea[_0x0abb('0x22')]),_0x352dea);dials[_0x0abb('0x46')](_0x352dea);}catch(_0x6b2d7f){utils[_0x0abb('0x18')](util['format']('[%s][index][dialend]',_0x352dea['uniqueid']),_0x6b2d7f);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e462ea5..8687b52 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 _0x8150=['queue','[%s][members][agentcomplete]','[%s][members][cdr]','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','Local/_attended@transfer','Queue:','info','format','uniqueid','channel','data2','membername','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','state','voice','now','agent','exitAt','duration','enterAt','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign'];(function(_0x5a63a1,_0x4ef850){var _0x1f115d=function(_0x1e5bd1){while(--_0x1e5bd1){_0x5a63a1['push'](_0x5a63a1['shift']());}};_0x1f115d(++_0x4ef850);}(_0x8150,0x1a7));var _0x0815=function(_0x1bf2cc,_0x1bea91){_0x1bf2cc=_0x1bf2cc-0x0;var _0x3edcf1=_0x8150[_0x1bf2cc];return _0x3edcf1;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x0815('0x0'),_0x0815('0x1')];function writeDB(_0x456b25){utils[_0x0815('0x2')](util[_0x0815('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x456b25[_0x0815('0x4')],_0x456b25['interface'],_0x456b25[_0x0815('0x5')],_0x456b25[_0x0815('0x6')],_0x456b25[_0x0815('0x7')],_0x456b25['type']));if(_0x456b25[_0x0815('0x8')]){utils[_0x0815('0x9')](_0x456b25[_0x0815('0x8')])[_0x0815('0xa')](function(_0x15a262){if(_0x15a262){_0x456b25[_0x0815('0x7')]=_0x15a262[_0x0815('0xb')];_0x456b25[_0x0815('0xc')]=_0x15a262[_0x0815('0xc')];utils[_0x0815('0xd')](_0x0815('0xe'),_0x456b25);}else{utils[_0x0815('0xf')](_0x456b25['interface'][_0x0815('0x10')]('/')[0x1])[_0x0815('0xa')](function(_0x551555){if(_0x551555){_0x456b25[_0x0815('0x7')]=_0x551555[_0x0815('0xb')];_0x456b25[_0x0815('0xc')]=_0x551555['internal'];utils[_0x0815('0xd')](_0x0815('0xe'),_0x456b25);}});}})[_0x0815('0x11')](function(_0x3b9e73){utils[_0x0815('0x12')](util['format'](_0x0815('0x13'),_0x456b25[_0x0815('0x4')]),_0x3b9e73);});}delete members[_0x456b25[_0x0815('0x8')]];}function startsWith(_0x34b746,_0x229719){return _[_0x0815('0x14')](_0x34b746,function(_0x1d8180){return _[_0x0815('0x15')](_0x229719,_0x1d8180);});}exports[_0x0815('0x16')]=function(_0x1eb43d){try{utils[_0x0815('0x17')](util[_0x0815('0x3')]('[%s][members][devicestatechange]',members[_0x1eb43d[_0x0815('0x18')]]?members[_0x1eb43d[_0x0815('0x18')]]['uniqueid']:_0x1eb43d[_0x0815('0x18')]),_0x1eb43d);utils[_0x0815('0x2')](util[_0x0815('0x3')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1eb43d[_0x0815('0x18')]]?members[_0x1eb43d['device']][_0x0815('0x4')]:_0x1eb43d[_0x0815('0x18')],_0x1eb43d[_0x0815('0x19')],_0x1eb43d[_0x0815('0x18')]));switch(_0x1eb43d[_0x0815('0x19')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x1eb43d[_0x0815('0x18')])){members[_0x1eb43d['device']]={'channel':_0x0815('0x1a'),'interface':_0x1eb43d[_0x0815('0x18')],'type':'TALKING','enterAt':utils[_0x0815('0x1b')](),'role':_0x0815('0x1c')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x1eb43d[_0x0815('0x18')]])){members[_0x1eb43d[_0x0815('0x18')]][_0x0815('0x1d')]=utils['now']();members[_0x1eb43d[_0x0815('0x18')]][_0x0815('0x1e')]=utils['diffTime'](members[_0x1eb43d[_0x0815('0x18')]][_0x0815('0x1d')],members[_0x1eb43d[_0x0815('0x18')]][_0x0815('0x1f')]);if(members[_0x1eb43d[_0x0815('0x18')]]['uniqueid']){writeDB(members[_0x1eb43d[_0x0815('0x18')]]);}}break;default:break;}}catch(_0x3bc37a){utils[_0x0815('0x12')](util[_0x0815('0x3')](_0x0815('0x20'),members[_0x1eb43d['device']]?members[_0x1eb43d[_0x0815('0x18')]]['uniqueid']:_0x1eb43d['device']),_0x3bc37a);}};exports[_0x0815('0x21')]=function(_0x3ae189){try{if(!_[_0x0815('0x22')](members[_0x3ae189[_0x0815('0x8')]])){utils[_0x0815('0x17')](util['format']('[%s][members][agentcomplete]',_0x3ae189[_0x0815('0x4')]),_0x3ae189);utils[_0x0815('0x2')](util['format'](_0x0815('0x23'),_0x3ae189[_0x0815('0x4')],_0x3ae189[_0x0815('0x8')],_0x3ae189['queue']));members[_0x3ae189[_0x0815('0x8')]]=_[_0x0815('0x24')](members[_0x3ae189[_0x0815('0x8')]],{'data4':_0x3ae189[_0x0815('0x25')],'uniqueid':_0x3ae189[_0x0815('0x4')]});}}catch(_0x2d74a1){utils[_0x0815('0x12')](util['format'](_0x0815('0x26'),_0x3ae189['uniqueid']),_0x2d74a1);}};exports['cdr']=function(_0x4c9927){try{utils[_0x0815('0x17')](util[_0x0815('0x3')](_0x0815('0x27'),_0x4c9927['uniqueid']),_0x4c9927);if(_0x4c9927[_0x0815('0x5')]){var _0xab3529=_0x4c9927[_0x0815('0x5')][_0x0815('0x10')]('-')[0x0];if(!_[_0x0815('0x22')](members[_0xab3529])){members[_0xab3529]=_[_0x0815('0x24')](members[_0xab3529],{'data1':members[_0xab3529][_0x0815('0x28')]||_0x4c9927[_0x0815('0x29')],'data2':members[_0xab3529][_0x0815('0x6')]||_0x4c9927[_0x0815('0x2a')],'data3':members[_0xab3529][_0x0815('0x2b')]||_0x4c9927[_0x0815('0x2c')],'uniqueid':members[_0xab3529]['uniqueid']||_0x4c9927[_0x0815('0x4')]});utils[_0x0815('0x2')](util[_0x0815('0x3')](_0x0815('0x2d'),_0x4c9927[_0x0815('0x4')],members[_0xab3529][_0x0815('0x28')],members[_0xab3529][_0x0815('0x6')],members[_0xab3529][_0x0815('0x2b')]));if(members[_0xab3529][_0x0815('0x1d')]){writeDB(members[_0xab3529]);}}}if(_0x4c9927['destinationchannel']){var _0x4d3337=_0x4c9927['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0x4d3337])){members[_0x4d3337]=_[_0x0815('0x24')](members[_0x4d3337],{'data1':members[_0x4d3337][_0x0815('0x28')]||_0x4c9927[_0x0815('0x29')],'data2':members[_0x4d3337][_0x0815('0x6')]||_0x4c9927[_0x0815('0x2a')],'data3':members[_0x4d3337]['data3']||_0x4c9927[_0x0815('0x2c')],'uniqueid':members[_0x4d3337][_0x0815('0x4')]||_0x4c9927['uniqueid']});utils[_0x0815('0x2')](util['format'](_0x0815('0x2d'),_0x4c9927[_0x0815('0x4')],members[_0x4d3337]['data1'],members[_0x4d3337][_0x0815('0x6')],members[_0x4d3337]['data3']));if(members[_0x4d3337][_0x0815('0x1d')]){writeDB(members[_0x4d3337]);}}}}catch(_0x2e5017){utils[_0x0815('0x12')](util['format']('[%s][members][cdr]',_0x4c9927[_0x0815('0x4')]),_0x2e5017);}}; \ No newline at end of file +var _0xcc94=['request','getUserByName','split','name','CreateMemberReport','catch','error','format','[%s][members][writeDB]','some','startsWith','debug','device','state','INUSE','BUSY','voice','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data1','source','data3','destination','destinationchannel','type','util','./utils','Local/_attended@transfer','Queue:','info','uniqueid','interface','channel','data2','membername','then','internal'];(function(_0x19373c,_0x4df262){var _0x2a143a=function(_0x45f5b8){while(--_0x45f5b8){_0x19373c['push'](_0x19373c['shift']());}};_0x2a143a(++_0x4df262);}(_0xcc94,0xee));var _0x4cc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc94[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4cc9('0x0'));var utils=require(_0x4cc9('0x1'));var members={};var exclude=[_0x4cc9('0x2'),_0x4cc9('0x3')];function writeDB(_0x3ff2b0){utils[_0x4cc9('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3ff2b0[_0x4cc9('0x5')],_0x3ff2b0[_0x4cc9('0x6')],_0x3ff2b0[_0x4cc9('0x7')],_0x3ff2b0[_0x4cc9('0x8')],_0x3ff2b0[_0x4cc9('0x9')],_0x3ff2b0['type']));if(_0x3ff2b0[_0x4cc9('0x6')]){utils['getUserByInterface'](_0x3ff2b0[_0x4cc9('0x6')])[_0x4cc9('0xa')](function(_0x16a1b8){if(_0x16a1b8){_0x3ff2b0[_0x4cc9('0x9')]=_0x16a1b8['name'];_0x3ff2b0['internal']=_0x16a1b8[_0x4cc9('0xb')];utils[_0x4cc9('0xc')]('CreateMemberReport',_0x3ff2b0);}else{utils[_0x4cc9('0xd')](_0x3ff2b0[_0x4cc9('0x6')][_0x4cc9('0xe')]('/')[0x1])[_0x4cc9('0xa')](function(_0x83bf5c){if(_0x83bf5c){_0x3ff2b0[_0x4cc9('0x9')]=_0x83bf5c[_0x4cc9('0xf')];_0x3ff2b0['internal']=_0x83bf5c[_0x4cc9('0xb')];utils[_0x4cc9('0xc')](_0x4cc9('0x10'),_0x3ff2b0);}});}})[_0x4cc9('0x11')](function(_0x33cedb){utils[_0x4cc9('0x12')](util[_0x4cc9('0x13')](_0x4cc9('0x14'),_0x3ff2b0[_0x4cc9('0x5')]),_0x33cedb);});}delete members[_0x3ff2b0[_0x4cc9('0x6')]];}function startsWith(_0x46aa3e,_0x3b6893){return _[_0x4cc9('0x15')](_0x46aa3e,function(_0x2f2f43){return _[_0x4cc9('0x16')](_0x3b6893,_0x2f2f43);});}exports['devicestatechange']=function(_0x142696){try{utils[_0x4cc9('0x17')](util[_0x4cc9('0x13')]('[%s][members][devicestatechange]',members[_0x142696['device']]?members[_0x142696['device']][_0x4cc9('0x5')]:_0x142696[_0x4cc9('0x18')]),_0x142696);utils[_0x4cc9('0x4')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x142696[_0x4cc9('0x18')]]?members[_0x142696[_0x4cc9('0x18')]]['uniqueid']:_0x142696[_0x4cc9('0x18')],_0x142696[_0x4cc9('0x19')],_0x142696[_0x4cc9('0x18')]));switch(_0x142696[_0x4cc9('0x19')]){case _0x4cc9('0x1a'):case _0x4cc9('0x1b'):if(!startsWith(exclude,_0x142696[_0x4cc9('0x18')])){members[_0x142696[_0x4cc9('0x18')]]={'channel':_0x4cc9('0x1c'),'interface':_0x142696['device'],'type':'TALKING','enterAt':utils[_0x4cc9('0x1d')](),'role':'agent'};}break;case _0x4cc9('0x1e'):if(!_[_0x4cc9('0x1f')](members[_0x142696[_0x4cc9('0x18')]])){members[_0x142696[_0x4cc9('0x18')]][_0x4cc9('0x20')]=utils[_0x4cc9('0x1d')]();members[_0x142696[_0x4cc9('0x18')]][_0x4cc9('0x21')]=utils[_0x4cc9('0x22')](members[_0x142696[_0x4cc9('0x18')]][_0x4cc9('0x20')],members[_0x142696[_0x4cc9('0x18')]][_0x4cc9('0x23')]);if(members[_0x142696['device']]['uniqueid']){writeDB(members[_0x142696[_0x4cc9('0x18')]]);}}break;default:break;}}catch(_0x36fc0c){utils[_0x4cc9('0x12')](util[_0x4cc9('0x13')](_0x4cc9('0x24'),members[_0x142696[_0x4cc9('0x18')]]?members[_0x142696[_0x4cc9('0x18')]][_0x4cc9('0x5')]:_0x142696[_0x4cc9('0x18')]),_0x36fc0c);}};exports[_0x4cc9('0x25')]=function(_0x50b6e1){try{if(!_[_0x4cc9('0x1f')](members[_0x50b6e1[_0x4cc9('0x6')]])){utils[_0x4cc9('0x17')](util['format'](_0x4cc9('0x26'),_0x50b6e1[_0x4cc9('0x5')]),_0x50b6e1);utils['info'](util['format'](_0x4cc9('0x27'),_0x50b6e1[_0x4cc9('0x5')],_0x50b6e1[_0x4cc9('0x6')],_0x50b6e1['queue']));members[_0x50b6e1[_0x4cc9('0x6')]]=_[_0x4cc9('0x28')](members[_0x50b6e1[_0x4cc9('0x6')]],{'data4':_0x50b6e1[_0x4cc9('0x29')],'uniqueid':_0x50b6e1[_0x4cc9('0x5')]});}}catch(_0x204bc1){utils[_0x4cc9('0x12')](util[_0x4cc9('0x13')]('[%s][members][agentcomplete]',_0x50b6e1[_0x4cc9('0x5')]),_0x204bc1);}};exports[_0x4cc9('0x2a')]=function(_0x1290bf){try{utils['debug'](util[_0x4cc9('0x13')](_0x4cc9('0x2b'),_0x1290bf[_0x4cc9('0x5')]),_0x1290bf);if(_0x1290bf[_0x4cc9('0x7')]){var _0x31d595=_0x1290bf[_0x4cc9('0x7')]['split']('-')[0x0];if(!_[_0x4cc9('0x1f')](members[_0x31d595])){members[_0x31d595]=_[_0x4cc9('0x28')](members[_0x31d595],{'data1':members[_0x31d595][_0x4cc9('0x2c')]||_0x1290bf['type'],'data2':members[_0x31d595][_0x4cc9('0x8')]||_0x1290bf[_0x4cc9('0x2d')],'data3':members[_0x31d595][_0x4cc9('0x2e')]||_0x1290bf[_0x4cc9('0x2f')],'uniqueid':members[_0x31d595][_0x4cc9('0x5')]||_0x1290bf[_0x4cc9('0x5')]});utils[_0x4cc9('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1290bf[_0x4cc9('0x5')],members[_0x31d595][_0x4cc9('0x2c')],members[_0x31d595][_0x4cc9('0x8')],members[_0x31d595]['data3']));if(members[_0x31d595][_0x4cc9('0x20')]){writeDB(members[_0x31d595]);}}}if(_0x1290bf['destinationchannel']){var _0x42833b=_0x1290bf[_0x4cc9('0x30')][_0x4cc9('0xe')]('-')[0x0];if(!_[_0x4cc9('0x1f')](members[_0x42833b])){members[_0x42833b]=_[_0x4cc9('0x28')](members[_0x42833b],{'data1':members[_0x42833b][_0x4cc9('0x2c')]||_0x1290bf[_0x4cc9('0x31')],'data2':members[_0x42833b]['data2']||_0x1290bf[_0x4cc9('0x2d')],'data3':members[_0x42833b][_0x4cc9('0x2e')]||_0x1290bf['destination'],'uniqueid':members[_0x42833b]['uniqueid']||_0x1290bf['uniqueid']});utils[_0x4cc9('0x4')](util[_0x4cc9('0x13')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1290bf[_0x4cc9('0x5')],members[_0x42833b]['data1'],members[_0x42833b][_0x4cc9('0x8')],members[_0x42833b][_0x4cc9('0x2e')]));if(members[_0x42833b][_0x4cc9('0x20')]){writeDB(members[_0x42833b]);}}}}catch(_0x1eaba9){utils[_0x4cc9('0x12')](util[_0x4cc9('0x13')](_0x4cc9('0x2b'),_0x1290bf[_0x4cc9('0x5')]),_0x1eaba9);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e04d093..f28cb10 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 _0x81f6=['secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','info','position','assign','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','now','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','queuecallerabandonAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','origtransfererlinkedid'];(function(_0x3ef21a,_0x46b2b5){var _0x2f5710=function(_0x1d573a){while(--_0x1d573a){_0x3ef21a['push'](_0x3ef21a['shift']());}};_0x2f5710(++_0x46b2b5);}(_0x81f6,0x1ae));var _0x681f=function(_0x5b6d8c,_0x547ba4){_0x5b6d8c=_0x5b6d8c-0x0;var _0x1d4e23=_0x81f6[_0x5b6d8c];return _0x1d4e23;};'use strict';var _=require('lodash');var util=require(_0x681f('0x0'));var utils=require(_0x681f('0x1'));var queues={};function writeDB(_0x301d0a){utils['info'](util[_0x681f('0x2')](_0x681f('0x3'),_0x301d0a[_0x681f('0x4')],_0x301d0a[_0x681f('0x5')],_0x301d0a['queue'],_0x301d0a[_0x681f('0x6')],_0x301d0a[_0x681f('0x7')],_0x301d0a[_0x681f('0x8')],_0x301d0a[_0x681f('0x9')]));if(_0x301d0a['queue']){utils[_0x681f('0xa')](_0x301d0a[_0x681f('0xb')])['then'](function(_0x4a80fc){if(_0x4a80fc){_0x301d0a['type']=_0x4a80fc[_0x681f('0xc')];}utils[_0x681f('0xd')]('CreateVoiceQueueReport',_0x301d0a);});}else{utils[_0x681f('0xd')](_0x681f('0xe'),_0x301d0a);}if(_0x301d0a[_0x681f('0xf')]){delete queues[_0x301d0a[_0x681f('0xf')]];}else{delete queues[_0x301d0a['uniqueid']];}}exports['queuecallerjoin']=function(_0x57258b){try{utils[_0x681f('0x10')](util[_0x681f('0x2')](_0x681f('0x11'),_0x57258b[_0x681f('0x4')]),_0x57258b);utils[_0x681f('0x12')](util[_0x681f('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x57258b[_0x681f('0x4')],_0x57258b[_0x681f('0xb')],_0x57258b[_0x681f('0x13')]));queues[_0x57258b[_0x681f('0x4')]]=_[_0x681f('0x14')](_0x57258b,{'originalposition':_0x57258b['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x8aa713){utils[_0x681f('0x15')](util[_0x681f('0x2')](_0x681f('0x11'),_0x57258b['uniqueid']),_0x8aa713);}};exports['hangup']=function(_0x278ade){try{if(!_[_0x681f('0x16')](queues[_0x278ade[_0x681f('0x4')]])){utils[_0x681f('0x10')](util[_0x681f('0x2')](_0x681f('0x17'),_0x278ade['uniqueid']),_0x278ade);if(queues[_0x278ade['uniqueid']][_0x681f('0x18')]){if(!queues[_0x278ade[_0x681f('0x4')]][_0x681f('0x19')]&&!queues[_0x278ade['uniqueid']][_0x681f('0x1a')]){queues[_0x278ade[_0x681f('0x4')]]['queuecallercomplete']=!![];queues[_0x278ade[_0x681f('0x4')]][_0x681f('0x1b')]=utils[_0x681f('0x1c')]();queues[_0x278ade[_0x681f('0x4')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x1d'),_0x278ade[_0x681f('0x4')],queues[_0x278ade[_0x681f('0x4')]][_0x681f('0x1e')],queues[_0x278ade['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x278ade['uniqueid']]);}else if(queues[_0x278ade[_0x681f('0x4')]][_0x681f('0xf')]){utils[_0x681f('0x12')](util['format'](_0x681f('0x1f'),_0x278ade[_0x681f('0x4')],queues[_0x278ade[_0x681f('0x4')]][_0x681f('0x1e')],queues[_0x278ade[_0x681f('0x4')]]['transfereduniqueid']));queues[queues[_0x278ade['uniqueid']][_0x681f('0xf')]]=queues[_0x278ade[_0x681f('0x4')]];queues[queues[_0x278ade[_0x681f('0x4')]][_0x681f('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x278ade['uniqueid']];}}}catch(_0x5bf6b6){utils[_0x681f('0x15')](util['format'](_0x681f('0x17'),_0x278ade[_0x681f('0x4')]),_0x5bf6b6);}};exports[_0x681f('0x20')]=function(_0x18e64c){try{utils[_0x681f('0x10')](util[_0x681f('0x2')](_0x681f('0x21'),_0x18e64c[_0x681f('0x4')]),_0x18e64c);if(!_[_0x681f('0x16')](_0x18e64c[_0x681f('0x22')][_0x681f('0x23')])&&_0x18e64c['value']['toUpperCase']()!=='CONTINUE'){if(!_[_0x681f('0x16')](queues[_0x18e64c[_0x681f('0x4')]])){queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x19')]=![];queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x24')]=null;queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x1a')]=!![];queues[_0x18e64c[_0x681f('0x4')]]['queuecallerexitAt']=utils[_0x681f('0x1c')]();queues[_0x18e64c['uniqueid']]['queuecallerexitreason']=_0x18e64c['value'][_0x681f('0x25')]();utils['info'](util['format'](_0x681f('0x26'),_0x18e64c[_0x681f('0x4')],queues[_0x18e64c['uniqueid']][_0x681f('0x1e')],_0x18e64c[_0x681f('0x27')],queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x9')]));writeDB(queues[_0x18e64c[_0x681f('0x4')]]);}}else if(!_[_0x681f('0x16')](_0x18e64c[_0x681f('0x22')][_0x681f('0x28')])){if(!_[_0x681f('0x16')](queues[_0x18e64c[_0x681f('0x4')]])&&!queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x19')]){queues[_0x18e64c['uniqueid']][_0x681f('0x19')]=![];queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x24')]=null;queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x1a')]=!![];queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x29')]=utils[_0x681f('0x1c')]();queues[_0x18e64c[_0x681f('0x4')]][_0x681f('0x9')]=_0x681f('0x2a');utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x2b'),_0x18e64c[_0x681f('0x4')],queues[_0x18e64c['uniqueid']][_0x681f('0x1e')],_0x18e64c[_0x681f('0x27')],queues[_0x18e64c['uniqueid']][_0x681f('0x9')]));}}}catch(_0x21f91f){utils[_0x681f('0x15')](util[_0x681f('0x2')]('[%s][queues][varset]',_0x18e64c[_0x681f('0x4')]),_0x21f91f);}};exports[_0x681f('0x19')]=function(_0x54f057){try{if(!_['isNil'](queues[_0x54f057[_0x681f('0x4')]])){utils[_0x681f('0x10')](util[_0x681f('0x2')]('[%s][queues][queuecallerabandon]',_0x54f057[_0x681f('0x4')]),_0x54f057);queues[_0x54f057[_0x681f('0x4')]]['queuecallerexit']=![];queues[_0x54f057['uniqueid']][_0x681f('0x29')]=null;queues[_0x54f057['uniqueid']][_0x681f('0x19')]=!![];queues[_0x54f057[_0x681f('0x4')]][_0x681f('0x24')]=utils[_0x681f('0x1c')]();queues[_0x54f057['uniqueid']][_0x681f('0x9')]=_0x681f('0x2c');utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x2d'),_0x54f057[_0x681f('0x4')],queues[_0x54f057[_0x681f('0x4')]]['name'],queues[_0x54f057[_0x681f('0x4')]][_0x681f('0x9')]));}}catch(_0x4a731d){utils[_0x681f('0x15')](util[_0x681f('0x2')](_0x681f('0x2e'),_0x54f057[_0x681f('0x4')]),_0x4a731d);}};exports[_0x681f('0x2f')]=function(_0x1a6792){try{if(!_[_0x681f('0x16')](queues[_0x1a6792[_0x681f('0x4')]])){utils[_0x681f('0x10')](util[_0x681f('0x2')](_0x681f('0x30'),_0x1a6792[_0x681f('0x4')]),_0x1a6792);utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x31'),_0x1a6792[_0x681f('0x4')],queues[_0x1a6792[_0x681f('0x4')]]['name'],_0x1a6792['connectedlinenum'],_0x1a6792[_0x681f('0x32')]));queues[_0x1a6792[_0x681f('0x4')]]['queuecallerleave']=!![];queues[_0x1a6792[_0x681f('0x4')]][_0x681f('0x18')]=utils[_0x681f('0x1c')]();queues[_0x1a6792[_0x681f('0x4')]]['holdtime']=utils[_0x681f('0x33')](queues[_0x1a6792['uniqueid']]['queuecallerleaveAt'],queues[_0x1a6792[_0x681f('0x4')]][_0x681f('0x34')]);queues[_0x1a6792[_0x681f('0x4')]][_0x681f('0x13')]=_0x1a6792[_0x681f('0x13')];queues[_0x1a6792['uniqueid']][_0x681f('0x35')]=_0x1a6792['count'];queues[_0x1a6792[_0x681f('0x4')]][_0x681f('0x36')]=_0x1a6792['connectedlinenum'];queues[_0x1a6792[_0x681f('0x4')]][_0x681f('0x32')]=_0x1a6792[_0x681f('0x32')];}}catch(_0x506b02){utils[_0x681f('0x15')](util['format']('[%s][queues][queuecallerleave]',_0x1a6792['uniqueid']),_0x506b02);}};exports['agentconnect']=function(_0x49e99f){try{if(!_[_0x681f('0x16')](queues[_0x49e99f[_0x681f('0x4')]])){utils['debug'](util[_0x681f('0x2')]('[%s][queues][agentconnect]',_0x49e99f[_0x681f('0x4')]),_0x49e99f);utils[_0x681f('0x12')](util['format'](_0x681f('0x37'),_0x49e99f['uniqueid'],queues[_0x49e99f[_0x681f('0x4')]]['name'],_0x49e99f[_0x681f('0x38')],_0x49e99f[_0x681f('0x39')]));queues[_0x49e99f[_0x681f('0x4')]][_0x681f('0x19')]=![];queues[_0x49e99f[_0x681f('0x4')]][_0x681f('0x19')]=![];queues[_0x49e99f[_0x681f('0x4')]][_0x681f('0x24')]=null;queues[_0x49e99f['uniqueid']]['queuecallerexit']=![];queues[_0x49e99f[_0x681f('0x4')]][_0x681f('0x9')]=null;queues[_0x49e99f[_0x681f('0x4')]]['queuecallerexitAt']=null;queues[_0x49e99f[_0x681f('0x4')]][_0x681f('0x3a')]=!![];queues[_0x49e99f[_0x681f('0x4')]][_0x681f('0x8')]=_0x49e99f[_0x681f('0x39')];queues[_0x49e99f[_0x681f('0x4')]][_0x681f('0x6')]=_0x49e99f[_0x681f('0x38')];}}catch(_0x1a5be9){utils['error'](util['format'](_0x681f('0x3b'),_0x49e99f[_0x681f('0x4')]),_0x1a5be9);}};exports['agentcomplete']=function(_0x33c8da){try{if(!_[_0x681f('0x16')](queues[_0x33c8da[_0x681f('0x4')]])){if(queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x18')]){utils[_0x681f('0x10')](util['format'](_0x681f('0x3c'),_0x33c8da[_0x681f('0x4')]),_0x33c8da);queues[_0x33c8da['uniqueid']]['queuecallerabandon']=![];queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x19')]=![];queues[_0x33c8da[_0x681f('0x4')]]['queuecallerabandonAt']=null;queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x1a')]=![];queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x29')]=null;queues[_0x33c8da[_0x681f('0x4')]]['assigned']=!![];queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x6')]=_0x33c8da[_0x681f('0x38')];queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x3d')]=!![];queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x1b')]=utils[_0x681f('0x1c')]();if(_0x33c8da[_0x681f('0x3e')]==_0x681f('0x3f')){if(!queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x3f')]){queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x9')]=_0x681f('0x40');}}else{queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x9')]=_0x681f('0x41')+_0x33c8da[_0x681f('0x3e')][_0x681f('0x25')]();}utils['info'](util[_0x681f('0x2')](_0x681f('0x42'),_0x33c8da[_0x681f('0x4')],queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x1e')],_0x33c8da['membername'],queues[_0x33c8da[_0x681f('0x4')]][_0x681f('0x9')]));writeDB(queues[_0x33c8da[_0x681f('0x4')]]);}}}catch(_0x3529f6){utils[_0x681f('0x15')](util[_0x681f('0x2')](_0x681f('0x3c'),_0x33c8da[_0x681f('0x4')]),_0x3529f6);}};exports[_0x681f('0x43')]=function(_0x5d3ca0){try{if(!_[_0x681f('0x16')](queues[_0x5d3ca0['transfereeuniqueid']])){utils['debug'](util[_0x681f('0x2')](_0x681f('0x44'),_0x5d3ca0[_0x681f('0x4')]),_0x5d3ca0);queues[_0x5d3ca0[_0x681f('0x45')]][_0x681f('0x3f')]=!![];queues[_0x5d3ca0[_0x681f('0x45')]][_0x681f('0x46')]='BLIND';queues[_0x5d3ca0['transfereeuniqueid']][_0x681f('0x47')]=_0x5d3ca0[_0x681f('0x48')];queues[_0x5d3ca0['transfereeuniqueid']][_0x681f('0x49')]=_0x5d3ca0[_0x681f('0x45')];queues[_0x5d3ca0[_0x681f('0x45')]][_0x681f('0x9')]='BLINDTRANSFER';utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x4a'),_0x5d3ca0[_0x681f('0x4')],queues[_0x5d3ca0[_0x681f('0x45')]]['name'],_0x5d3ca0[_0x681f('0x45')],_0x5d3ca0[_0x681f('0x48')]));}}catch(_0x1aa551){utils[_0x681f('0x15')](util['format'](_0x681f('0x44'),_0x5d3ca0[_0x681f('0x4')]),_0x1aa551);}};exports[_0x681f('0x4b')]=function(_0x377d21){try{utils['debug'](util[_0x681f('0x2')](_0x681f('0x4c'),_0x377d21[_0x681f('0x4d')]),_0x377d21);if(_0x377d21[_0x681f('0x4d')]==_0x377d21['origtransfererlinkedid']){if(!_[_0x681f('0x16')](queues[_0x377d21['secondtransfererlinkedid']])){utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x4e'),_0x377d21[_0x681f('0x4d')],queues[_0x377d21['secondtransfererlinkedid']][_0x681f('0x1e')],_0x377d21[_0x681f('0x4f')]));queues[_0x377d21[_0x681f('0x50')]]['transfer']=!![];queues[_0x377d21[_0x681f('0x50')]]['transfertype']=_0x681f('0x51');queues[_0x377d21[_0x681f('0x50')]][_0x681f('0x47')]=_0x377d21[_0x681f('0x4f')];queues[_0x377d21[_0x681f('0x50')]][_0x681f('0x49')]=_0x377d21[_0x681f('0x4d')];queues[_0x377d21[_0x681f('0x50')]]['queuecallerexitreason']=_0x681f('0x52');}if(!_[_0x681f('0x16')](queues[_0x377d21['origtransfererlinkedid']])){if(_0x377d21['transfereelinkedid']&&queues[_0x377d21[_0x681f('0x53')]]){queues[_0x377d21[_0x681f('0x53')]][_0x681f('0x54')]=0x1;queues[_0x377d21['transfereeuniqueid']]=_['clone'](queues[_0x377d21[_0x681f('0x53')]]);queues[_0x377d21[_0x681f('0x45')]][_0x681f('0xf')]=_0x377d21[_0x681f('0x55')];queues[_0x377d21[_0x681f('0x45')]][_0x681f('0x54')]=0x2;queues[_0x377d21[_0x681f('0x45')]][_0x681f('0x7')]=queues[_0x377d21['secondtransfererlinkedid']][_0x681f('0x7')];queues[_0x377d21[_0x681f('0x45')]][_0x681f('0x56')]=queues[_0x377d21['secondtransfererlinkedid']][_0x681f('0x56')];queues[_0x377d21[_0x681f('0x45')]][_0x681f('0x34')]=utils['now']();queues[_0x377d21['transfereeuniqueid']][_0x681f('0x18')]=utils[_0x681f('0x1c')]();queues[_0x377d21[_0x681f('0x45')]][_0x681f('0x57')]=0x0;queues[_0x377d21[_0x681f('0x45')]]['mohtime']=0x0;utils['info'](util[_0x681f('0x2')](_0x681f('0x58'),_0x377d21[_0x681f('0x4d')],queues[_0x377d21[_0x681f('0x45')]][_0x681f('0x1e')],queues[_0x377d21['transfereeuniqueid']][_0x681f('0x7')],queues[_0x377d21[_0x681f('0x45')]][_0x681f('0x56')]));}else{utils['info'](util[_0x681f('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x377d21['origtransfereruniqueid'],queues[_0x377d21[_0x681f('0x59')]][_0x681f('0x1e')],_0x377d21[_0x681f('0x50')]));queues[_0x377d21[_0x681f('0x59')]][_0x681f('0xf')]=_0x377d21[_0x681f('0x50')];}}}else if(_0x377d21[_0x681f('0x5a')]==_0x377d21[_0x681f('0x50')]){if(!_['isNil'](queues[_0x377d21[_0x681f('0x59')]])){utils[_0x681f('0x12')](util[_0x681f('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x377d21[_0x681f('0x4d')],queues[_0x377d21[_0x681f('0x59')]][_0x681f('0x1e')],_0x377d21[_0x681f('0x5a')],_0x377d21[_0x681f('0x5b')]));queues[_0x377d21[_0x681f('0x59')]][_0x681f('0x3f')]=!![];queues[_0x377d21[_0x681f('0x59')]][_0x681f('0x46')]=_0x681f('0x51');queues[_0x377d21['origtransfererlinkedid']]['transferexten']=_0x377d21[_0x681f('0x5b')];queues[_0x377d21[_0x681f('0x59')]]['transferuniqueid']=_0x377d21['secondtransfereruniqueid'];queues[_0x377d21[_0x681f('0x59')]][_0x681f('0x9')]=_0x681f('0x52');}if(!_[_0x681f('0x16')](queues[_0x377d21[_0x681f('0x50')]])){if(_0x377d21[_0x681f('0x5c')]&&queues[_0x377d21[_0x681f('0x5c')]]){queues[_0x377d21[_0x681f('0x5c')]][_0x681f('0x54')]=0x1;queues[_0x377d21[_0x681f('0x55')]]=_[_0x681f('0x5d')](queues[_0x377d21[_0x681f('0x5c')]]);queues[_0x377d21[_0x681f('0x55')]][_0x681f('0xf')]=_0x377d21[_0x681f('0x55')];queues[_0x377d21['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x377d21[_0x681f('0x55')]][_0x681f('0x7')]=queues[_0x377d21[_0x681f('0x59')]]['calleridnum'];queues[_0x377d21[_0x681f('0x55')]]['calleridname']=queues[_0x377d21['origtransfererlinkedid']]['calleridname'];queues[_0x377d21[_0x681f('0x55')]][_0x681f('0x34')]=utils[_0x681f('0x1c')]();queues[_0x377d21[_0x681f('0x55')]][_0x681f('0x18')]=utils[_0x681f('0x1c')]();queues[_0x377d21[_0x681f('0x55')]][_0x681f('0x57')]=0x0;queues[_0x377d21[_0x681f('0x55')]]['mohtime']=0x0;utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x5e'),_0x377d21[_0x681f('0x4d')],queues[_0x377d21[_0x681f('0x55')]][_0x681f('0x1e')],queues[_0x377d21[_0x681f('0x55')]][_0x681f('0xf')],queues[_0x377d21[_0x681f('0x55')]][_0x681f('0x7')],queues[_0x377d21[_0x681f('0x55')]]['calleridname']));}else{utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x5f'),_0x377d21['origtransfereruniqueid'],queues[_0x377d21[_0x681f('0x50')]][_0x681f('0x1e')],_0x377d21[_0x681f('0x59')]));queues[_0x377d21[_0x681f('0x50')]]['transfereduniqueid']=_0x377d21[_0x681f('0x59')];}}}}catch(_0x4e75e7){utils['error'](util[_0x681f('0x2')](_0x681f('0x4c'),_0x377d21['origtransfereruniqueid']),_0x4e75e7);}};exports[_0x681f('0x60')]=function(_0x184caa){try{if(!_[_0x681f('0x16')](queues[_0x184caa[_0x681f('0x4')]])){utils['debug'](util[_0x681f('0x2')](_0x681f('0x61'),_0x184caa[_0x681f('0x4')]),_0x184caa);queues[_0x184caa['uniqueid']][_0x681f('0x62')]=utils[_0x681f('0x1c')]();utils[_0x681f('0x12')](util['format'](_0x681f('0x63'),_0x184caa[_0x681f('0x4')],queues[_0x184caa['uniqueid']]['name'],queues[_0x184caa[_0x681f('0x4')]][_0x681f('0x62')]));}}catch(_0x55e074){utils[_0x681f('0x15')](util[_0x681f('0x2')]('[%s][queues][musiconholdstart]',_0x184caa[_0x681f('0x4')]),_0x55e074);}};exports[_0x681f('0x64')]=function(_0x513736){try{if(!_[_0x681f('0x16')](queues[_0x513736[_0x681f('0x4')]])){if(!_[_0x681f('0x16')](queues[_0x513736[_0x681f('0x4')]]['musiconholdstartAt'])){utils[_0x681f('0x10')](util[_0x681f('0x2')](_0x681f('0x65'),_0x513736[_0x681f('0x4')]),_0x513736);queues[_0x513736[_0x681f('0x4')]][_0x681f('0x66')]+=utils[_0x681f('0x33')](utils[_0x681f('0x1c')](),queues[_0x513736[_0x681f('0x4')]][_0x681f('0x62')]);utils[_0x681f('0x12')](util[_0x681f('0x2')](_0x681f('0x67'),_0x513736['uniqueid'],queues[_0x513736[_0x681f('0x4')]]['name'],queues[_0x513736['uniqueid']][_0x681f('0x66')]));delete queues[_0x513736['uniqueid']][_0x681f('0x62')];}}}catch(_0x3547d6){utils['error'](util[_0x681f('0x2')]('[%s][queues][musiconholdstop]',_0x513736[_0x681f('0x4')]),_0x3547d6);}}; \ No newline at end of file +var _0xe9cb=['transfer','COMPLETEDBY','[%s][queues][agentcomplete]','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','calleridnum','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','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','value','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','queuecallerjoinAt','position','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','destaccountcode','agentcomplete','reason'];(function(_0x237c7f,_0x3a9366){var _0x3376f5=function(_0x273813){while(--_0x273813){_0x237c7f['push'](_0x237c7f['shift']());}};_0x3376f5(++_0x3a9366);}(_0xe9cb,0xfb));var _0xbe9c=function(_0x4c145e,_0x2a7ca6){_0x4c145e=_0x4c145e-0x0;var _0x159842=_0xe9cb[_0x4c145e];return _0x159842;};'use strict';var _=require(_0xbe9c('0x0'));var util=require(_0xbe9c('0x1'));var utils=require(_0xbe9c('0x2'));var queues={};function writeDB(_0x5373dc){utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x5'),_0x5373dc['uniqueid'],_0x5373dc[_0xbe9c('0x6')],_0x5373dc[_0xbe9c('0x7')],_0x5373dc[_0xbe9c('0x8')],_0x5373dc['calleridnum'],_0x5373dc['accountcode'],_0x5373dc[_0xbe9c('0x9')]));if(_0x5373dc['queue']){utils[_0xbe9c('0xa')](_0x5373dc[_0xbe9c('0x7')])[_0xbe9c('0xb')](function(_0x2e792c){if(_0x2e792c){_0x5373dc[_0xbe9c('0xc')]=_0x2e792c[_0xbe9c('0xc')];}utils['request'](_0xbe9c('0xd'),_0x5373dc);});}else{utils['request'](_0xbe9c('0xd'),_0x5373dc);}if(_0x5373dc[_0xbe9c('0xe')]){delete queues[_0x5373dc[_0xbe9c('0xe')]];}else{delete queues[_0x5373dc[_0xbe9c('0xf')]];}}exports[_0xbe9c('0x10')]=function(_0x3039d9){try{utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')]('[%s][queues][queuecallerjoin]',_0x3039d9[_0xbe9c('0xf')]),_0x3039d9);utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x12'),_0x3039d9['uniqueid'],_0x3039d9[_0xbe9c('0x7')],_0x3039d9['position']));queues[_0x3039d9[_0xbe9c('0xf')]]=_[_0xbe9c('0x13')](_0x3039d9,{'originalposition':_0x3039d9['position'],'queuecallerjoinAt':utils[_0xbe9c('0x14')](),'mohtime':0x0});}catch(_0x1d5346){utils[_0xbe9c('0x15')](util['format']('[%s][queues][queuecallerjoin]',_0x3039d9['uniqueid']),_0x1d5346);}};exports[_0xbe9c('0x16')]=function(_0xf1d5c8){try{if(!_[_0xbe9c('0x17')](queues[_0xf1d5c8[_0xbe9c('0xf')]])){utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')](_0xbe9c('0x18'),_0xf1d5c8[_0xbe9c('0xf')]),_0xf1d5c8);if(queues[_0xf1d5c8[_0xbe9c('0xf')]]['queuecallerleaveAt']){if(!queues[_0xf1d5c8[_0xbe9c('0xf')]]['queuecallerabandon']&&!queues[_0xf1d5c8['uniqueid']][_0xbe9c('0x19')]){queues[_0xf1d5c8[_0xbe9c('0xf')]][_0xbe9c('0x1a')]=!![];queues[_0xf1d5c8[_0xbe9c('0xf')]][_0xbe9c('0x1b')]=utils['now']();queues[_0xf1d5c8[_0xbe9c('0xf')]][_0xbe9c('0x9')]=_0xbe9c('0x1c');}utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x1d'),_0xf1d5c8['uniqueid'],queues[_0xf1d5c8[_0xbe9c('0xf')]][_0xbe9c('0x1e')],queues[_0xf1d5c8[_0xbe9c('0xf')]][_0xbe9c('0x9')]));writeDB(queues[_0xf1d5c8['uniqueid']]);}else if(queues[_0xf1d5c8[_0xbe9c('0xf')]][_0xbe9c('0xe')]){utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x1f'),_0xf1d5c8[_0xbe9c('0xf')],queues[_0xf1d5c8['uniqueid']][_0xbe9c('0x1e')],queues[_0xf1d5c8['uniqueid']]['transfereduniqueid']));queues[queues[_0xf1d5c8['uniqueid']][_0xbe9c('0xe')]]=queues[_0xf1d5c8['uniqueid']];queues[queues[_0xf1d5c8[_0xbe9c('0xf')]][_0xbe9c('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0xf1d5c8['uniqueid']];}}}catch(_0x2a4b68){utils[_0xbe9c('0x15')](util[_0xbe9c('0x4')](_0xbe9c('0x18'),_0xf1d5c8[_0xbe9c('0xf')]),_0x2a4b68);}};exports[_0xbe9c('0x20')]=function(_0x3e7eca){try{utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')](_0xbe9c('0x21'),_0x3e7eca['uniqueid']),_0x3e7eca);if(!_[_0xbe9c('0x17')](_0x3e7eca[_0xbe9c('0x22')][_0xbe9c('0x23')])&&_0x3e7eca['value'][_0xbe9c('0x24')]()!==_0xbe9c('0x25')){if(!_[_0xbe9c('0x17')](queues[_0x3e7eca['uniqueid']])){queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x26')]=![];queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x27')]=null;queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x19')]=!![];queues[_0x3e7eca['uniqueid']]['queuecallerexitAt']=utils[_0xbe9c('0x14')]();queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x9')]=_0x3e7eca[_0xbe9c('0x28')][_0xbe9c('0x24')]();utils['info'](util[_0xbe9c('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3e7eca['uniqueid'],queues[_0x3e7eca['uniqueid']][_0xbe9c('0x1e')],_0x3e7eca[_0xbe9c('0x28')],queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x9')]));writeDB(queues[_0x3e7eca[_0xbe9c('0xf')]]);}}else if(!_[_0xbe9c('0x17')](_0x3e7eca[_0xbe9c('0x22')][_0xbe9c('0x29')])){if(!_[_0xbe9c('0x17')](queues[_0x3e7eca[_0xbe9c('0xf')]])&&!queues[_0x3e7eca[_0xbe9c('0xf')]]['queuecallerabandon']){queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x26')]=![];queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x27')]=null;queues[_0x3e7eca[_0xbe9c('0xf')]]['queuecallerexit']=!![];queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x2a')]=utils[_0xbe9c('0x14')]();queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x9')]=_0xbe9c('0x2b');utils['info'](util[_0xbe9c('0x4')](_0xbe9c('0x2c'),_0x3e7eca['uniqueid'],queues[_0x3e7eca['uniqueid']][_0xbe9c('0x1e')],_0x3e7eca[_0xbe9c('0x28')],queues[_0x3e7eca[_0xbe9c('0xf')]][_0xbe9c('0x9')]));}}}catch(_0x21106f){utils['error'](util[_0xbe9c('0x4')]('[%s][queues][varset]',_0x3e7eca[_0xbe9c('0xf')]),_0x21106f);}};exports[_0xbe9c('0x26')]=function(_0x5f038e){try{if(!_['isNil'](queues[_0x5f038e[_0xbe9c('0xf')]])){utils[_0xbe9c('0x11')](util['format'](_0xbe9c('0x2d'),_0x5f038e[_0xbe9c('0xf')]),_0x5f038e);queues[_0x5f038e['uniqueid']]['queuecallerexit']=![];queues[_0x5f038e['uniqueid']][_0xbe9c('0x2a')]=null;queues[_0x5f038e[_0xbe9c('0xf')]]['queuecallerabandon']=!![];queues[_0x5f038e[_0xbe9c('0xf')]][_0xbe9c('0x27')]=utils['now']();queues[_0x5f038e[_0xbe9c('0xf')]]['queuecallerexitreason']='ABANDONED';utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x2e'),_0x5f038e[_0xbe9c('0xf')],queues[_0x5f038e[_0xbe9c('0xf')]][_0xbe9c('0x1e')],queues[_0x5f038e[_0xbe9c('0xf')]][_0xbe9c('0x9')]));}}catch(_0x38bb32){utils[_0xbe9c('0x15')](util[_0xbe9c('0x4')](_0xbe9c('0x2d'),_0x5f038e[_0xbe9c('0xf')]),_0x38bb32);}};exports[_0xbe9c('0x2f')]=function(_0x147c29){try{if(!_['isNil'](queues[_0x147c29['uniqueid']])){utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')]('[%s][queues][queuecallerleave]',_0x147c29[_0xbe9c('0xf')]),_0x147c29);utils[_0xbe9c('0x3')](util['format'](_0xbe9c('0x30'),_0x147c29['uniqueid'],queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x1e')],_0x147c29[_0xbe9c('0x31')],_0x147c29[_0xbe9c('0x32')]));queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x2f')]=!![];queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x33')]=utils[_0xbe9c('0x14')]();queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x34')]=utils['diffTime'](queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x33')],queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x35')]);queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x36')]=_0x147c29[_0xbe9c('0x36')];queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x37')]=_0x147c29[_0xbe9c('0x37')];queues[_0x147c29[_0xbe9c('0xf')]][_0xbe9c('0x31')]=_0x147c29[_0xbe9c('0x31')];queues[_0x147c29[_0xbe9c('0xf')]]['connectedlinename']=_0x147c29[_0xbe9c('0x32')];}}catch(_0x53f85e){utils[_0xbe9c('0x15')](util[_0xbe9c('0x4')]('[%s][queues][queuecallerleave]',_0x147c29[_0xbe9c('0xf')]),_0x53f85e);}};exports['agentconnect']=function(_0x3731d1){try{if(!_[_0xbe9c('0x17')](queues[_0x3731d1[_0xbe9c('0xf')]])){utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')](_0xbe9c('0x38'),_0x3731d1['uniqueid']),_0x3731d1);utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x39'),_0x3731d1[_0xbe9c('0xf')],queues[_0x3731d1[_0xbe9c('0xf')]]['name'],_0x3731d1[_0xbe9c('0x3a')],_0x3731d1['destaccountcode']));queues[_0x3731d1[_0xbe9c('0xf')]]['queuecallerabandon']=![];queues[_0x3731d1[_0xbe9c('0xf')]][_0xbe9c('0x26')]=![];queues[_0x3731d1[_0xbe9c('0xf')]][_0xbe9c('0x27')]=null;queues[_0x3731d1[_0xbe9c('0xf')]]['queuecallerexit']=![];queues[_0x3731d1[_0xbe9c('0xf')]][_0xbe9c('0x9')]=null;queues[_0x3731d1[_0xbe9c('0xf')]][_0xbe9c('0x2a')]=null;queues[_0x3731d1['uniqueid']][_0xbe9c('0x3b')]=!![];queues[_0x3731d1[_0xbe9c('0xf')]][_0xbe9c('0x3c')]=_0x3731d1[_0xbe9c('0x3d')];queues[_0x3731d1[_0xbe9c('0xf')]][_0xbe9c('0x8')]=_0x3731d1[_0xbe9c('0x3a')];}}catch(_0x48e0c8){utils['error'](util[_0xbe9c('0x4')](_0xbe9c('0x38'),_0x3731d1[_0xbe9c('0xf')]),_0x48e0c8);}};exports[_0xbe9c('0x3e')]=function(_0x58c72f){try{if(!_[_0xbe9c('0x17')](queues[_0x58c72f['uniqueid']])){if(queues[_0x58c72f['uniqueid']][_0xbe9c('0x33')]){utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')]('[%s][queues][agentcomplete]',_0x58c72f[_0xbe9c('0xf')]),_0x58c72f);queues[_0x58c72f[_0xbe9c('0xf')]]['queuecallerabandon']=![];queues[_0x58c72f[_0xbe9c('0xf')]]['queuecallerabandon']=![];queues[_0x58c72f[_0xbe9c('0xf')]][_0xbe9c('0x27')]=null;queues[_0x58c72f[_0xbe9c('0xf')]][_0xbe9c('0x19')]=![];queues[_0x58c72f['uniqueid']]['queuecallerexitAt']=null;queues[_0x58c72f['uniqueid']]['assigned']=!![];queues[_0x58c72f['uniqueid']][_0xbe9c('0x8')]=_0x58c72f['membername'];queues[_0x58c72f[_0xbe9c('0xf')]][_0xbe9c('0x1a')]=!![];queues[_0x58c72f[_0xbe9c('0xf')]]['queuecallercompleteAt']=utils[_0xbe9c('0x14')]();if(_0x58c72f[_0xbe9c('0x3f')]==_0xbe9c('0x40')){if(!queues[_0x58c72f['uniqueid']][_0xbe9c('0x40')]){queues[_0x58c72f['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x58c72f[_0xbe9c('0xf')]][_0xbe9c('0x9')]=_0xbe9c('0x41')+_0x58c72f['reason'][_0xbe9c('0x24')]();}utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x58c72f[_0xbe9c('0xf')],queues[_0x58c72f[_0xbe9c('0xf')]][_0xbe9c('0x1e')],_0x58c72f['membername'],queues[_0x58c72f[_0xbe9c('0xf')]][_0xbe9c('0x9')]));writeDB(queues[_0x58c72f[_0xbe9c('0xf')]]);}}}catch(_0x13f555){utils['error'](util[_0xbe9c('0x4')](_0xbe9c('0x42'),_0x58c72f['uniqueid']),_0x13f555);}};exports['blindtransfer']=function(_0x3f6744){try{if(!_[_0xbe9c('0x17')](queues[_0x3f6744[_0xbe9c('0x43')]])){utils[_0xbe9c('0x11')](util['format']('[%s][queues][blindtransfer]',_0x3f6744[_0xbe9c('0xf')]),_0x3f6744);queues[_0x3f6744[_0xbe9c('0x43')]][_0xbe9c('0x40')]=!![];queues[_0x3f6744['transfereeuniqueid']]['transfertype']=_0xbe9c('0x44');queues[_0x3f6744['transfereeuniqueid']][_0xbe9c('0x45')]=_0x3f6744[_0xbe9c('0x46')];queues[_0x3f6744[_0xbe9c('0x43')]][_0xbe9c('0x47')]=_0x3f6744[_0xbe9c('0x43')];queues[_0x3f6744[_0xbe9c('0x43')]][_0xbe9c('0x9')]=_0xbe9c('0x48');utils['info'](util[_0xbe9c('0x4')](_0xbe9c('0x49'),_0x3f6744[_0xbe9c('0xf')],queues[_0x3f6744[_0xbe9c('0x43')]][_0xbe9c('0x1e')],_0x3f6744['transfereeuniqueid'],_0x3f6744[_0xbe9c('0x46')]));}}catch(_0xe2bfb4){utils[_0xbe9c('0x15')](util['format'](_0xbe9c('0x4a'),_0x3f6744['uniqueid']),_0xe2bfb4);}};exports[_0xbe9c('0x4b')]=function(_0x10e489){try{utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')](_0xbe9c('0x4c'),_0x10e489[_0xbe9c('0x4d')]),_0x10e489);if(_0x10e489['origtransfereruniqueid']==_0x10e489[_0xbe9c('0x4e')]){if(!_['isNil'](queues[_0x10e489[_0xbe9c('0x4f')]])){utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x10e489[_0xbe9c('0x4d')],queues[_0x10e489['secondtransfererlinkedid']][_0xbe9c('0x1e')],_0x10e489[_0xbe9c('0x50')]));queues[_0x10e489['secondtransfererlinkedid']][_0xbe9c('0x40')]=!![];queues[_0x10e489[_0xbe9c('0x4f')]][_0xbe9c('0x51')]=_0xbe9c('0x52');queues[_0x10e489[_0xbe9c('0x4f')]][_0xbe9c('0x45')]=_0x10e489[_0xbe9c('0x50')];queues[_0x10e489[_0xbe9c('0x4f')]]['transferuniqueid']=_0x10e489['origtransfereruniqueid'];queues[_0x10e489['secondtransfererlinkedid']][_0xbe9c('0x9')]=_0xbe9c('0x53');}if(!_[_0xbe9c('0x17')](queues[_0x10e489[_0xbe9c('0x4e')]])){if(_0x10e489[_0xbe9c('0x54')]&&queues[_0x10e489[_0xbe9c('0x54')]]){queues[_0x10e489[_0xbe9c('0x54')]][_0xbe9c('0x55')]=0x1;queues[_0x10e489[_0xbe9c('0x43')]]=_[_0xbe9c('0x56')](queues[_0x10e489[_0xbe9c('0x54')]]);queues[_0x10e489['transfereeuniqueid']]['transfereduniqueid']=_0x10e489['transfertargetuniqueid'];queues[_0x10e489[_0xbe9c('0x43')]]['queuecallerenterreason']=0x2;queues[_0x10e489['transfereeuniqueid']][_0xbe9c('0x57')]=queues[_0x10e489[_0xbe9c('0x4f')]][_0xbe9c('0x57')];queues[_0x10e489[_0xbe9c('0x43')]]['calleridname']=queues[_0x10e489[_0xbe9c('0x4f')]][_0xbe9c('0x58')];queues[_0x10e489[_0xbe9c('0x43')]][_0xbe9c('0x35')]=utils[_0xbe9c('0x14')]();queues[_0x10e489[_0xbe9c('0x43')]]['queuecallerleaveAt']=utils[_0xbe9c('0x14')]();queues[_0x10e489['transfereeuniqueid']][_0xbe9c('0x34')]=0x0;queues[_0x10e489[_0xbe9c('0x43')]][_0xbe9c('0x59')]=0x0;utils['info'](util['format'](_0xbe9c('0x5a'),_0x10e489[_0xbe9c('0x4d')],queues[_0x10e489[_0xbe9c('0x43')]][_0xbe9c('0x1e')],queues[_0x10e489[_0xbe9c('0x43')]][_0xbe9c('0x57')],queues[_0x10e489[_0xbe9c('0x43')]][_0xbe9c('0x58')]));}else{utils['info'](util[_0xbe9c('0x4')](_0xbe9c('0x5b'),_0x10e489['origtransfereruniqueid'],queues[_0x10e489[_0xbe9c('0x4e')]][_0xbe9c('0x1e')],_0x10e489['secondtransfererlinkedid']));queues[_0x10e489[_0xbe9c('0x4e')]][_0xbe9c('0xe')]=_0x10e489[_0xbe9c('0x4f')];}}}else if(_0x10e489[_0xbe9c('0x5c')]==_0x10e489[_0xbe9c('0x4f')]){if(!_['isNil'](queues[_0x10e489[_0xbe9c('0x4e')]])){utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x5d'),_0x10e489['origtransfereruniqueid'],queues[_0x10e489[_0xbe9c('0x4e')]][_0xbe9c('0x1e')],_0x10e489['secondtransfereruniqueid'],_0x10e489[_0xbe9c('0x5e')]));queues[_0x10e489['origtransfererlinkedid']][_0xbe9c('0x40')]=!![];queues[_0x10e489['origtransfererlinkedid']][_0xbe9c('0x51')]=_0xbe9c('0x52');queues[_0x10e489[_0xbe9c('0x4e')]][_0xbe9c('0x45')]=_0x10e489[_0xbe9c('0x5e')];queues[_0x10e489[_0xbe9c('0x4e')]][_0xbe9c('0x47')]=_0x10e489['secondtransfereruniqueid'];queues[_0x10e489[_0xbe9c('0x4e')]][_0xbe9c('0x9')]=_0xbe9c('0x53');}if(!_[_0xbe9c('0x17')](queues[_0x10e489[_0xbe9c('0x4f')]])){if(_0x10e489[_0xbe9c('0x5f')]&&queues[_0x10e489['transfertargetlinkedid']]){queues[_0x10e489[_0xbe9c('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x10e489[_0xbe9c('0x60')]]=_[_0xbe9c('0x56')](queues[_0x10e489[_0xbe9c('0x5f')]]);queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0xe')]=_0x10e489[_0xbe9c('0x60')];queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0x55')]=0x2;queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0x57')]=queues[_0x10e489[_0xbe9c('0x4e')]][_0xbe9c('0x57')];queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0x58')]=queues[_0x10e489[_0xbe9c('0x4e')]]['calleridname'];queues[_0x10e489['transfertargetuniqueid']][_0xbe9c('0x35')]=utils[_0xbe9c('0x14')]();queues[_0x10e489['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xbe9c('0x14')]();queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0x34')]=0x0;queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0x59')]=0x0;utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x61'),_0x10e489[_0xbe9c('0x4d')],queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0x1e')],queues[_0x10e489[_0xbe9c('0x60')]]['transfereduniqueid'],queues[_0x10e489['transfertargetuniqueid']][_0xbe9c('0x57')],queues[_0x10e489[_0xbe9c('0x60')]][_0xbe9c('0x58')]));}else{utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x5b'),_0x10e489[_0xbe9c('0x4d')],queues[_0x10e489[_0xbe9c('0x4f')]][_0xbe9c('0x1e')],_0x10e489[_0xbe9c('0x4e')]));queues[_0x10e489[_0xbe9c('0x4f')]][_0xbe9c('0xe')]=_0x10e489[_0xbe9c('0x4e')];}}}}catch(_0x271ff1){utils[_0xbe9c('0x15')](util[_0xbe9c('0x4')](_0xbe9c('0x4c'),_0x10e489[_0xbe9c('0x4d')]),_0x271ff1);}};exports['musiconholdstart']=function(_0x6260b2){try{if(!_[_0xbe9c('0x17')](queues[_0x6260b2[_0xbe9c('0xf')]])){utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')](_0xbe9c('0x62'),_0x6260b2[_0xbe9c('0xf')]),_0x6260b2);queues[_0x6260b2['uniqueid']][_0xbe9c('0x63')]=utils[_0xbe9c('0x14')]();utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x64'),_0x6260b2[_0xbe9c('0xf')],queues[_0x6260b2[_0xbe9c('0xf')]][_0xbe9c('0x1e')],queues[_0x6260b2[_0xbe9c('0xf')]][_0xbe9c('0x63')]));}}catch(_0x37e25a){utils[_0xbe9c('0x15')](util[_0xbe9c('0x4')]('[%s][queues][musiconholdstart]',_0x6260b2[_0xbe9c('0xf')]),_0x37e25a);}};exports[_0xbe9c('0x65')]=function(_0x384766){try{if(!_[_0xbe9c('0x17')](queues[_0x384766[_0xbe9c('0xf')]])){if(!_[_0xbe9c('0x17')](queues[_0x384766[_0xbe9c('0xf')]][_0xbe9c('0x63')])){utils[_0xbe9c('0x11')](util[_0xbe9c('0x4')](_0xbe9c('0x66'),_0x384766[_0xbe9c('0xf')]),_0x384766);queues[_0x384766[_0xbe9c('0xf')]][_0xbe9c('0x59')]+=utils[_0xbe9c('0x67')](utils['now'](),queues[_0x384766['uniqueid']][_0xbe9c('0x63')]);utils[_0xbe9c('0x3')](util[_0xbe9c('0x4')](_0xbe9c('0x68'),_0x384766[_0xbe9c('0xf')],queues[_0x384766[_0xbe9c('0xf')]]['name'],queues[_0x384766[_0xbe9c('0xf')]][_0xbe9c('0x59')]));delete queues[_0x384766['uniqueid']][_0xbe9c('0x63')];}}}catch(_0x1ddb6d){utils[_0xbe9c('0x15')](util[_0xbe9c('0x4')](_0xbe9c('0x66'),_0x384766[_0xbe9c('0xf')]),_0x1ddb6d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 6764486..bc06133 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 _0x1f8c=['name','UserId','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','linkedid','context','exten','channel','error','debug','[%s][recordings][newstate]','isNil','channelstate','transfer','info','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','format','uniqueid','accountcode','then','membername'];(function(_0x2cc61a,_0x13f591){var _0xbbdfb4=function(_0xb2524f){while(--_0xb2524f){_0x2cc61a['push'](_0x2cc61a['shift']());}};_0xbbdfb4(++_0x13f591);}(_0x1f8c,0x126));var _0xc1f8=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x1f8c[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require(_0xc1f8('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0xe208bc){utils['info'](util[_0xc1f8('0x1')]('[%s][recordings][writeDB]',_0xe208bc[_0xc1f8('0x2')]));if(_0xe208bc[_0xc1f8('0x3')]){utils['getUserByInternal'](_0xe208bc[_0xc1f8('0x3')])[_0xc1f8('0x4')](function(_0x43fccf){if(_0x43fccf){_0xe208bc[_0xc1f8('0x5')]=_0x43fccf[_0xc1f8('0x6')];_0xe208bc[_0xc1f8('0x7')]=_0x43fccf['id'];}utils['request'](_0xc1f8('0x8'),_0xe208bc);});}else{utils[_0xc1f8('0x9')](_0xc1f8('0x8'),_0xe208bc);}}exports[_0xc1f8('0xa')]=function(_0x559c00){try{utils['debug'](util[_0xc1f8('0x1')](_0xc1f8('0xb'),_0x559c00[_0xc1f8('0x2')]),_0x559c00);if(_0x559c00[_0xc1f8('0x2')]==_0x559c00[_0xc1f8('0xc')]){utils['info'](util[_0xc1f8('0x1')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x559c00[_0xc1f8('0x2')],_0x559c00[_0xc1f8('0xd')],_0x559c00['exten']));recordings[_0x559c00[_0xc1f8('0x2')]]={'uniqueid':_0x559c00[_0xc1f8('0x2')],'accountcode':_0x559c00['accountcode'],'exten':_0x559c00[_0xc1f8('0xe')],'context':_0x559c00[_0xc1f8('0xd')],'channel':_0x559c00[_0xc1f8('0xf')],'monitors':[]};}}catch(_0x35c050){utils[_0xc1f8('0x10')](util[_0xc1f8('0x1')]('[%s][recordings][newchannel]',_0x559c00[_0xc1f8('0x2')]),_0x35c050);}};exports['newstate']=function(_0x2ce487){try{utils[_0xc1f8('0x11')](util[_0xc1f8('0x1')](_0xc1f8('0x12'),_0x2ce487[_0xc1f8('0x2')]),_0x2ce487);if(!_[_0xc1f8('0x13')](recordings[_0x2ce487[_0xc1f8('0x2')]])&&_0x2ce487[_0xc1f8('0x14')]==0x6){utils['info'](util[_0xc1f8('0x1')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2ce487[_0xc1f8('0x2')],_0x2ce487[_0xc1f8('0xd')],_0x2ce487[_0xc1f8('0xf')]));}else if(!_[_0xc1f8('0x13')](recordings[_0x2ce487[_0xc1f8('0xc')]])&&_0x2ce487[_0xc1f8('0x14')]==0x6&&_0x2ce487[_0xc1f8('0xd')]!=_0xc1f8('0x15')){utils[_0xc1f8('0x16')](util[_0xc1f8('0x1')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2ce487['uniqueid'],_0x2ce487[_0xc1f8('0xc')],_0x2ce487[_0xc1f8('0xd')],_0x2ce487['channel']));recordings[_0x2ce487['linkedid']][_0xc1f8('0x3')]=_0x2ce487[_0xc1f8('0x3')];}}catch(_0x307555){utils['error'](util['format']('[%s][recordings][newstate]',_0x2ce487[_0xc1f8('0x2')]),_0x307555);}};exports[_0xc1f8('0x17')]=function(_0x2873c9){try{if(!_['isNil'](_0x2873c9[_0xc1f8('0x18')])&&!_[_0xc1f8('0x13')](_0x2873c9[_0xc1f8('0x18')][_0xc1f8('0x19')])){utils['debug'](util['format'](_0xc1f8('0x1a'),_0x2873c9[_0xc1f8('0x2')]),_0x2873c9);utils['info'](util['format'](_0xc1f8('0x1b'),_0x2873c9[_0xc1f8('0x2')],_0x2873c9['variable'],_0x2873c9[_0xc1f8('0x1c')]));if(_[_0xc1f8('0x1d')](_0x2873c9[_0xc1f8('0x1c')],_0xc1f8('0x1e'))){_0x2873c9[_0xc1f8('0x1c')]=_0x2873c9[_0xc1f8('0x1c')][_0xc1f8('0x1f')](_0xc1f8('0x1e'),'.WAV');}if(recordings[_0x2873c9[_0xc1f8('0xc')]]){var _0x374507=_[_0xc1f8('0x20')](recordings[_0x2873c9[_0xc1f8('0xc')]][_0xc1f8('0x21')],{'value':_0x2873c9[_0xc1f8('0x1c')]});if(_[_0xc1f8('0x13')](_0x374507)){recordings[_0x2873c9[_0xc1f8('0xc')]]['monitors'][_0xc1f8('0x22')]({'value':_0x2873c9[_0xc1f8('0x1c')]});}}}}catch(_0x586e96){utils[_0xc1f8('0x10')](util[_0xc1f8('0x1')](_0xc1f8('0x1a'),_0x2873c9[_0xc1f8('0x2')]),_0x586e96);}};exports[_0xc1f8('0x23')]=function(_0x2dab76){try{if(!_['isNil'](recordings[_0x2dab76[_0xc1f8('0x2')]])){utils[_0xc1f8('0x11')](util[_0xc1f8('0x1')](_0xc1f8('0x24'),_0x2dab76[_0xc1f8('0x2')]),_0x2dab76);utils[_0xc1f8('0x16')](util[_0xc1f8('0x1')](_0xc1f8('0x25'),_0x2dab76[_0xc1f8('0x2')],_0x2dab76['calleridnum'],_0x2dab76[_0xc1f8('0x26')],_0x2dab76[_0xc1f8('0x27')]));recordings[_0x2dab76[_0xc1f8('0x2')]]['calleridnum']=_0x2dab76[_0xc1f8('0x28')];recordings[_0x2dab76['uniqueid']][_0xc1f8('0x26')]=_0x2dab76[_0xc1f8('0x26')];recordings[_0x2dab76[_0xc1f8('0x2')]]['connectedlinenum']=_0x2dab76[_0xc1f8('0x29')];recordings[_0x2dab76[_0xc1f8('0x2')]][_0xc1f8('0x2a')]=_0x2dab76[_0xc1f8('0x2a')];if(recordings[_0x2dab76['uniqueid']][_0xc1f8('0x2b')]==_0xc1f8('0x2c')&&recordings[_0x2dab76[_0xc1f8('0x2')]]['accountcode']){recordings[_0x2dab76[_0xc1f8('0x2')]]['connectedlinenum']=recordings[_0x2dab76[_0xc1f8('0x2')]]['accountcode'];recordings[_0x2dab76[_0xc1f8('0x2')]]['connectedlinename']='';}recordings[_0x2dab76[_0xc1f8('0x2')]]['monitors']['forEach'](function(_0x3d0f7e){var _0x44d7ff=_['clone'](recordings[_0x2dab76[_0xc1f8('0x2')]]);_0x44d7ff['value']=_0x3d0f7e[_0xc1f8('0x1c')];writeDB(_0x44d7ff);});delete recordings[_0x2dab76[_0xc1f8('0x2')]];}}catch(_0x2375c1){utils[_0xc1f8('0x10')](util['format']('[%s][recordings][hangup]',_0x2dab76[_0xc1f8('0x2')]),_0x2375c1);}};exports[_0xc1f8('0x2d')]=function(_0xd49cff){try{if(!_['isNil'](recordings[_0xd49cff[_0xc1f8('0x2')]])){utils[_0xc1f8('0x11')](util[_0xc1f8('0x1')](_0xc1f8('0x2e'),_0xd49cff['uniqueid']),_0xd49cff);utils['info'](util[_0xc1f8('0x1')](_0xc1f8('0x2f'),_0xd49cff[_0xc1f8('0x2')],_0xd49cff['application'],_0xd49cff[_0xc1f8('0x30')]));if(_0xd49cff[_0xc1f8('0x31')][_0xc1f8('0x32')]()=='set'&&_[_0xc1f8('0x33')](_0xd49cff[_0xc1f8('0x30')][_0xc1f8('0x32')](),_0xc1f8('0x34'))){var _0x460d28=_0xd49cff[_0xc1f8('0x30')][_0xc1f8('0x35')]('=');var _0x47ccdd=_0x460d28[0x0][_0xc1f8('0x36')](_0x460d28[0x0]['lastIndexOf']('(')+0x1,_0x460d28[0x0][_0xc1f8('0x37')](')'));var _0x52b71f=_0x460d28[0x1];recordings[_0xd49cff[_0xc1f8('0x2')]][_0x47ccdd]=_0x52b71f;}}}catch(_0x241b79){utils[_0xc1f8('0x10')](util['format']('[%s][recordings][newexten]',_0xd49cff[_0xc1f8('0x2')]),_0x241b79);}};exports[_0xc1f8('0x38')]=function(_0x458849){try{if(!_[_0xc1f8('0x13')](recordings[_0x458849['uniqueid']])){utils[_0xc1f8('0x11')](util['format'](_0xc1f8('0x39'),_0x458849[_0xc1f8('0x2')]),_0x458849);utils[_0xc1f8('0x16')](util['format'](_0xc1f8('0x3a'),_0x458849['uniqueid'],_0x458849[_0xc1f8('0x3b')]));recordings[_0x458849['uniqueid']][_0xc1f8('0x3b')]=_0x458849[_0xc1f8('0x3b')];}}catch(_0x48fdea){utils[_0xc1f8('0x10')](util['format'](_0xc1f8('0x39'),_0x458849[_0xc1f8('0x2')]),_0x48fdea);}}; \ No newline at end of file +var _0x1549=['[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','name','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','[%s][recordings][newchannel]','newstate','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x1549,0x1cb));var _0x9154=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x1549[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x9154('0x0'));var util=require(_0x9154('0x1'));var utils=require(_0x9154('0x2'));var recordings={};function writeDB(_0x9971f8){utils[_0x9154('0x3')](util[_0x9154('0x4')](_0x9154('0x5'),_0x9971f8[_0x9154('0x6')]));if(_0x9971f8[_0x9154('0x7')]){utils['getUserByInternal'](_0x9971f8[_0x9154('0x7')])['then'](function(_0xd9b204){if(_0xd9b204){_0x9971f8['membername']=_0xd9b204[_0x9154('0x8')];_0x9971f8['UserId']=_0xd9b204['id'];}utils[_0x9154('0x9')](_0x9154('0xa'),_0x9971f8);});}else{utils[_0x9154('0x9')](_0x9154('0xa'),_0x9971f8);}}exports['newchannel']=function(_0x5c8709){try{utils[_0x9154('0xb')](util[_0x9154('0x4')]('[%s][recordings][newchannel]',_0x5c8709[_0x9154('0x6')]),_0x5c8709);if(_0x5c8709[_0x9154('0x6')]==_0x5c8709['linkedid']){utils[_0x9154('0x3')](util[_0x9154('0x4')](_0x9154('0xc'),_0x5c8709[_0x9154('0x6')],_0x5c8709['context'],_0x5c8709[_0x9154('0xd')]));recordings[_0x5c8709['uniqueid']]={'uniqueid':_0x5c8709[_0x9154('0x6')],'accountcode':_0x5c8709[_0x9154('0x7')],'exten':_0x5c8709[_0x9154('0xd')],'context':_0x5c8709[_0x9154('0xe')],'channel':_0x5c8709[_0x9154('0xf')],'monitors':[]};}}catch(_0x5da1b2){utils[_0x9154('0x10')](util[_0x9154('0x4')](_0x9154('0x11'),_0x5c8709[_0x9154('0x6')]),_0x5da1b2);}};exports[_0x9154('0x12')]=function(_0x2deecd){try{utils[_0x9154('0xb')](util[_0x9154('0x4')]('[%s][recordings][newstate]',_0x2deecd[_0x9154('0x6')]),_0x2deecd);if(!_['isNil'](recordings[_0x2deecd['uniqueid']])&&_0x2deecd[_0x9154('0x13')]==0x6){utils['info'](util[_0x9154('0x4')](_0x9154('0x14'),_0x2deecd[_0x9154('0x6')],_0x2deecd[_0x9154('0xe')],_0x2deecd[_0x9154('0xf')]));}else if(!_[_0x9154('0x15')](recordings[_0x2deecd[_0x9154('0x16')]])&&_0x2deecd[_0x9154('0x13')]==0x6&&_0x2deecd['context']!=_0x9154('0x17')){utils[_0x9154('0x3')](util[_0x9154('0x4')](_0x9154('0x18'),_0x2deecd[_0x9154('0x6')],_0x2deecd[_0x9154('0x16')],_0x2deecd[_0x9154('0xe')],_0x2deecd[_0x9154('0xf')]));recordings[_0x2deecd[_0x9154('0x16')]][_0x9154('0x7')]=_0x2deecd[_0x9154('0x7')];}}catch(_0x588290){utils[_0x9154('0x10')](util[_0x9154('0x4')](_0x9154('0x19'),_0x2deecd[_0x9154('0x6')]),_0x588290);}};exports[_0x9154('0x1a')]=function(_0x2a775c){try{if(!_['isNil'](_0x2a775c[_0x9154('0x1b')])&&!_['isNil'](_0x2a775c[_0x9154('0x1b')][_0x9154('0x1c')])){utils[_0x9154('0xb')](util['format'](_0x9154('0x1d'),_0x2a775c['uniqueid']),_0x2a775c);utils[_0x9154('0x3')](util['format'](_0x9154('0x1e'),_0x2a775c['uniqueid'],_0x2a775c[_0x9154('0x1b')],_0x2a775c[_0x9154('0x1f')]));if(_['endsWith'](_0x2a775c[_0x9154('0x1f')],_0x9154('0x20'))){_0x2a775c[_0x9154('0x1f')]=_0x2a775c['value']['replace'](_0x9154('0x20'),_0x9154('0x21'));}if(recordings[_0x2a775c[_0x9154('0x16')]]){var _0x5effda=_[_0x9154('0x22')](recordings[_0x2a775c[_0x9154('0x16')]][_0x9154('0x23')],{'value':_0x2a775c[_0x9154('0x1f')]});if(_[_0x9154('0x15')](_0x5effda)){recordings[_0x2a775c[_0x9154('0x16')]][_0x9154('0x23')][_0x9154('0x24')]({'value':_0x2a775c[_0x9154('0x1f')]});}}}}catch(_0x48e0c4){utils[_0x9154('0x10')](util[_0x9154('0x4')]('[%s][recordings][varset]',_0x2a775c['uniqueid']),_0x48e0c4);}};exports[_0x9154('0x25')]=function(_0x2455f5){try{if(!_[_0x9154('0x15')](recordings[_0x2455f5['uniqueid']])){utils[_0x9154('0xb')](util[_0x9154('0x4')]('[%s][recordings][hangup]',_0x2455f5[_0x9154('0x6')]),_0x2455f5);utils[_0x9154('0x3')](util['format'](_0x9154('0x26'),_0x2455f5[_0x9154('0x6')],_0x2455f5[_0x9154('0x27')],_0x2455f5[_0x9154('0x28')],_0x2455f5[_0x9154('0x29')]));recordings[_0x2455f5[_0x9154('0x6')]][_0x9154('0x27')]=_0x2455f5[_0x9154('0x27')];recordings[_0x2455f5['uniqueid']][_0x9154('0x28')]=_0x2455f5['calleridname'];recordings[_0x2455f5[_0x9154('0x6')]][_0x9154('0x2a')]=_0x2455f5['connectedlinenum'];recordings[_0x2455f5[_0x9154('0x6')]][_0x9154('0x2b')]=_0x2455f5['connectedlinename'];if(recordings[_0x2455f5[_0x9154('0x6')]]['type']=='outbound'&&recordings[_0x2455f5[_0x9154('0x6')]]['accountcode']){recordings[_0x2455f5['uniqueid']][_0x9154('0x2a')]=recordings[_0x2455f5[_0x9154('0x6')]]['accountcode'];recordings[_0x2455f5[_0x9154('0x6')]]['connectedlinename']='';}recordings[_0x2455f5[_0x9154('0x6')]][_0x9154('0x23')][_0x9154('0x2c')](function(_0x3aa9fc){var _0x41b070=_[_0x9154('0x2d')](recordings[_0x2455f5[_0x9154('0x6')]]);_0x41b070[_0x9154('0x1f')]=_0x3aa9fc['value'];writeDB(_0x41b070);});delete recordings[_0x2455f5[_0x9154('0x6')]];}}catch(_0x3a51c2){utils['error'](util[_0x9154('0x4')]('[%s][recordings][hangup]',_0x2455f5[_0x9154('0x6')]),_0x3a51c2);}};exports['newexten']=function(_0x3c56f3){try{if(!_[_0x9154('0x15')](recordings[_0x3c56f3[_0x9154('0x6')]])){utils[_0x9154('0xb')](util[_0x9154('0x4')](_0x9154('0x2e'),_0x3c56f3[_0x9154('0x6')]),_0x3c56f3);utils[_0x9154('0x3')](util[_0x9154('0x4')](_0x9154('0x2f'),_0x3c56f3[_0x9154('0x6')],_0x3c56f3[_0x9154('0x30')],_0x3c56f3['appdata']));if(_0x3c56f3['application'][_0x9154('0x31')]()==_0x9154('0x32')&&_[_0x9154('0x33')](_0x3c56f3[_0x9154('0x34')][_0x9154('0x31')](),_0x9154('0x35'))){var _0x190db8=_0x3c56f3['appdata'][_0x9154('0x36')]('=');var _0x34dd4b=_0x190db8[0x0][_0x9154('0x37')](_0x190db8[0x0]['lastIndexOf']('(')+0x1,_0x190db8[0x0][_0x9154('0x38')](')'));var _0x5c864b=_0x190db8[0x1];recordings[_0x3c56f3[_0x9154('0x6')]][_0x34dd4b]=_0x5c864b;}}}catch(_0x38382c){utils[_0x9154('0x10')](util['format'](_0x9154('0x2e'),_0x3c56f3[_0x9154('0x6')]),_0x38382c);}};exports[_0x9154('0x39')]=function(_0x185af1){try{if(!_[_0x9154('0x15')](recordings[_0x185af1[_0x9154('0x6')]])){utils[_0x9154('0xb')](util[_0x9154('0x4')](_0x9154('0x3a'),_0x185af1[_0x9154('0x6')]),_0x185af1);utils[_0x9154('0x3')](util[_0x9154('0x4')](_0x9154('0x3b'),_0x185af1[_0x9154('0x6')],_0x185af1[_0x9154('0x3c')]));recordings[_0x185af1[_0x9154('0x6')]][_0x9154('0x3c')]=_0x185af1[_0x9154('0x3c')];}}catch(_0x5d0b54){utils[_0x9154('0x10')](util[_0x9154('0x4')]('[%s][recordings][queuecallerjoin]',_0x185af1[_0x9154('0x6')]),_0x5d0b54);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a2ef9ff..4c46570 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 _0x1c72=['transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x51bfa2,_0x31420e){var _0x4522be=function(_0x5b2991){while(--_0x5b2991){_0x51bfa2['push'](_0x51bfa2['shift']());}};_0x4522be(++_0x31420e);}(_0x1c72,0x13f));var _0x21c7=function(_0x595aec,_0x5dd604){_0x595aec=_0x595aec-0x0;var _0x1cd077=_0x1c72[_0x595aec];return _0x1cd077;};'use strict';var _=require('lodash');var util=require(_0x21c7('0x0'));var utils=require(_0x21c7('0x1'));function writeDB(_0x26513a){utils[_0x21c7('0x2')](util[_0x21c7('0x3')](_0x21c7('0x4'),_0x26513a[_0x21c7('0x5')]==='attended'?_0x26513a[_0x21c7('0x6')]:_0x26513a[_0x21c7('0x7')],_0x26513a[_0x21c7('0x5')]));utils[_0x21c7('0x8')](_0x21c7('0x9'),_0x26513a);}exports[_0x21c7('0xa')]=function(_0x5677a3){try{utils[_0x21c7('0xb')](util[_0x21c7('0x3')](_0x21c7('0xc'),_0x5677a3[_0x21c7('0x7')]),_0x5677a3);utils[_0x21c7('0x2')](util[_0x21c7('0x3')](_0x21c7('0xd'),_0x5677a3[_0x21c7('0x7')],_0x5677a3['transferercalleridnum'],_0x5677a3['transferercalleridname'],_0x5677a3[_0x21c7('0xe')],_0x5677a3[_0x21c7('0xf')]));_0x5677a3[_0x21c7('0x5')]='blind';writeDB(_0x5677a3);}catch(_0x5852db){utils[_0x21c7('0x10')](util['format'](_0x21c7('0xc'),_0x5677a3[_0x21c7('0x7')]),_0x5852db);}};exports[_0x21c7('0x11')]=function(_0x3d3208){try{utils['debug'](util[_0x21c7('0x3')](_0x21c7('0x12'),_0x3d3208['origtransfereruniqueid']),_0x3d3208);utils[_0x21c7('0x2')](util[_0x21c7('0x3')](_0x21c7('0x13'),_0x3d3208['origtransfereruniqueid'],_0x3d3208['origtransferercalleridnum'],_0x3d3208[_0x21c7('0x14')],_0x3d3208['transfertargetcalleridnum'],_0x3d3208[_0x21c7('0x15')]));_0x3d3208=_[_0x21c7('0x16')](_0x3d3208,{'transfererchannel':_0x3d3208[_0x21c7('0x17')],'transferercalleridnum':_0x3d3208[_0x21c7('0x18')],'transferercalleridname':_0x3d3208[_0x21c7('0x14')],'transfererconnectedlinenum':_0x3d3208[_0x21c7('0x19')],'transfererconnectedlinename':_0x3d3208[_0x21c7('0x1a')],'transfereraccountcode':_0x3d3208[_0x21c7('0x1b')],'transferercontext':_0x3d3208['secondtransferercontext'],'transfererexten':_0x3d3208[_0x21c7('0x1c')],'transfererlinkedid':_0x3d3208['origtransfererlinkedid'],'context':_0x3d3208[_0x21c7('0x1d')],'extension':_0x3d3208['origtransfererexten'],'type':_0x21c7('0x1e')});if(_[_0x21c7('0x1f')](_0x3d3208[_0x21c7('0x20')])){_0x3d3208=_[_0x21c7('0x16')](_0x3d3208,{'transfereechannel':_0x3d3208[_0x21c7('0x21')],'transfereecalleridnum':_0x3d3208['transfertargetcalleridnum'],'transfereecalleridname':_0x3d3208['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3d3208['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3d3208[_0x21c7('0x22')],'transfereeaccountcode':_0x3d3208['transfertargetaccountcode'],'transfereecontext':_0x3d3208['transfertargetcontext'],'transfereeexten':_0x3d3208[_0x21c7('0x23')],'transfereelinkedid':_0x3d3208[_0x21c7('0x24')]});}writeDB(_0x3d3208);}catch(_0x4072e0){utils[_0x21c7('0x10')](util['format'](_0x21c7('0x12'),_0x3d3208[_0x21c7('0x6')]),_0x4072e0);}}; \ No newline at end of file +var _0x9871=['transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','format','transferercalleridnum','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum'];(function(_0x5b8d95,_0x552ba7){var _0x165bb6=function(_0xefee2a){while(--_0xefee2a){_0x5b8d95['push'](_0x5b8d95['shift']());}};_0x165bb6(++_0x552ba7);}(_0x9871,0x12a));var _0x1987=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x9871[_0x56916d];return _0x2b7f1f;};'use strict';var _=require('lodash');var util=require(_0x1987('0x0'));var utils=require(_0x1987('0x1'));function writeDB(_0x4ec33f){utils[_0x1987('0x2')](util['format'](_0x1987('0x3'),_0x4ec33f[_0x1987('0x4')]===_0x1987('0x5')?_0x4ec33f[_0x1987('0x6')]:_0x4ec33f[_0x1987('0x7')],_0x4ec33f[_0x1987('0x4')]));utils['request'](_0x1987('0x8'),_0x4ec33f);}exports[_0x1987('0x9')]=function(_0x411b05){try{utils[_0x1987('0xa')](util['format'](_0x1987('0xb'),_0x411b05[_0x1987('0x7')]),_0x411b05);utils['info'](util[_0x1987('0xc')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x411b05[_0x1987('0x7')],_0x411b05[_0x1987('0xd')],_0x411b05['transferercalleridname'],_0x411b05[_0x1987('0xe')],_0x411b05['transfereecalleridname']));_0x411b05['type']=_0x1987('0xf');writeDB(_0x411b05);}catch(_0x499bcb){utils[_0x1987('0x10')](util['format']('[%s][transfers][blindtransfer]',_0x411b05['uniqueid']),_0x499bcb);}};exports[_0x1987('0x11')]=function(_0x265150){try{utils['debug'](util['format'](_0x1987('0x12'),_0x265150['origtransfereruniqueid']),_0x265150);utils[_0x1987('0x2')](util[_0x1987('0xc')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x265150[_0x1987('0x6')],_0x265150[_0x1987('0x13')],_0x265150[_0x1987('0x14')],_0x265150[_0x1987('0x15')],_0x265150[_0x1987('0x16')]));_0x265150=_[_0x1987('0x17')](_0x265150,{'transfererchannel':_0x265150[_0x1987('0x18')],'transferercalleridnum':_0x265150['origtransferercalleridnum'],'transferercalleridname':_0x265150[_0x1987('0x14')],'transfererconnectedlinenum':_0x265150[_0x1987('0x19')],'transfererconnectedlinename':_0x265150[_0x1987('0x1a')],'transfereraccountcode':_0x265150[_0x1987('0x1b')],'transferercontext':_0x265150[_0x1987('0x1c')],'transfererexten':_0x265150[_0x1987('0x1d')],'transfererlinkedid':_0x265150[_0x1987('0x1e')],'context':_0x265150[_0x1987('0x1f')],'extension':_0x265150[_0x1987('0x20')],'type':_0x1987('0x5')});if(_[_0x1987('0x21')](_0x265150[_0x1987('0x22')])){_0x265150=_[_0x1987('0x17')](_0x265150,{'transfereechannel':_0x265150[_0x1987('0x23')],'transfereecalleridnum':_0x265150[_0x1987('0x15')],'transfereecalleridname':_0x265150[_0x1987('0x16')],'transfereeconnectedlinenum':_0x265150[_0x1987('0x24')],'transfereeconnectedlinename':_0x265150[_0x1987('0x25')],'transfereeaccountcode':_0x265150[_0x1987('0x26')],'transfereecontext':_0x265150['transfertargetcontext'],'transfereeexten':_0x265150['transfertargetexten'],'transfereelinkedid':_0x265150[_0x1987('0x27')]});}writeDB(_0x265150);}catch(_0x542297){utils['error'](util['format']('[%s][transfers][attendedtransfer]',_0x265150['origtransfereruniqueid']),_0x542297);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 858a5d1..d845a3e 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 _0xc991=['result','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','util','http','../../config/logger','info','debug','inspect','error','request','[utils][request]\x20name:%s','catch','GetUser','name','then','[utils][getUser]\x20where:%s','stringify','length'];(function(_0x131a6a,_0x2f67a4){var _0x27598b=function(_0x312302){while(--_0x312302){_0x131a6a['push'](_0x131a6a['shift']());}};_0x27598b(++_0x2f67a4);}(_0xc991,0xfc));var _0x1c99=function(_0x3ffc1f,_0x5f0586){_0x3ffc1f=_0x3ffc1f-0x0;var _0x2685fe=_0xc991[_0x3ffc1f];return _0x2685fe;};'use strict';var BPromise=require(_0x1c99('0x0'));var jayson=require(_0x1c99('0x1'));var moment=require('moment');var util=require(_0x1c99('0x2'));var client=jayson['client'][_0x1c99('0x3')]({'port':0x2329});var logger=require(_0x1c99('0x4'))('xdr');exports['info']=function(_0x3eae7f,_0x2e581b){logger[_0x1c99('0x5')](_0x3eae7f,_0x2e581b?util['inspect'](_0x2e581b,{'showHidden':![],'depth':null}):'');};exports[_0x1c99('0x6')]=function(_0x561f40,_0x2d714e){logger[_0x1c99('0x6')](_0x561f40,_0x2d714e?util[_0x1c99('0x7')](_0x2d714e,{'showHidden':![],'depth':null}):'');};exports[_0x1c99('0x8')]=function(_0x28645d,_0x566bde){logger[_0x1c99('0x8')](_0x28645d,_0x566bde?util[_0x1c99('0x7')](_0x566bde,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x47fbb5,_0x462afc){return client[_0x1c99('0x9')](_0x47fbb5,{'body':_0x462afc})['then'](function(_0x560ccd){logger[_0x1c99('0x6')](_0x1c99('0xa'),_0x47fbb5,_0x560ccd?util[_0x1c99('0x7')](_0x560ccd,{'showHidden':![],'depth':null}):'');})[_0x1c99('0xb')](function(_0xcb2ced){logger[_0x1c99('0x8')](_0x1c99('0xa'),_0x47fbb5,_0xcb2ced?util[_0x1c99('0x7')](_0xcb2ced,{'showHidden':![],'depth':null}):'');});};function getUser(_0x24f4cd){return client[_0x1c99('0x9')](_0x1c99('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x1c99('0xd'),'interface'],'where':_0x24f4cd,'limit':0x1}})[_0x1c99('0xe')](function(_0x13d2f3){logger['debug'](_0x1c99('0xf'),JSON[_0x1c99('0x10')](_0x24f4cd),_0x13d2f3?util[_0x1c99('0x7')](_0x13d2f3,{'showHidden':![],'depth':null}):'');return _0x13d2f3['result'][_0x1c99('0x11')]?_0x13d2f3[_0x1c99('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x23aef0){return new BPromise(function(_0x1ff07f,_0x505e6d){if(_0x23aef0){return getUser({'internal':_0x23aef0})[_0x1c99('0xe')](function(_0x39a8a6){logger[_0x1c99('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x23aef0,_0x39a8a6?'found':_0x1c99('0x13'));return _0x1ff07f(_0x39a8a6);})['catch'](function(_0x2974e2){logger['error'](_0x1c99('0x14'),_0x2974e2?util[_0x1c99('0x7')](_0x2974e2,{'showHidden':![],'depth':null}):'');return _0x1ff07f(null);});}return _0x1ff07f(null);});};exports[_0x1c99('0x15')]=function(_0x3d6a61){return new BPromise(function(_0x4b420d,_0x516d9d){if(_0x3d6a61){return getUser({'interface':_0x3d6a61})['then'](function(_0x440ec5){logger[_0x1c99('0x5')](_0x1c99('0x16'),_0x3d6a61,_0x440ec5?_0x1c99('0x17'):_0x1c99('0x13'));return _0x4b420d(_0x440ec5);})[_0x1c99('0xb')](function(_0x2504a9){logger[_0x1c99('0x8')]('[utils][getUserByInterface]',_0x2504a9?util[_0x1c99('0x7')](_0x2504a9,{'showHidden':![],'depth':null}):'');return _0x4b420d(null);});}return _0x4b420d(null);});};exports[_0x1c99('0x18')]=function(_0x364e95){return new BPromise(function(_0x4764b5,_0x52bd5d){if(_0x364e95){return getUser({'name':_0x364e95})[_0x1c99('0xe')](function(_0x513c23){logger[_0x1c99('0x5')](_0x1c99('0x19'),_0x364e95,_0x513c23?'found':_0x1c99('0x13'));return _0x4764b5(_0x513c23);})['catch'](function(_0x1d6c5e){logger['error']('[utils][getUserByName]',_0x1d6c5e?util[_0x1c99('0x7')](_0x1d6c5e,{'showHidden':![],'depth':null}):'');return _0x4764b5(null);});}return _0x4764b5(null);});};exports['getVoiceQueueByName']=function(_0x349bcc){return new BPromise(function(_0x4b1095,_0x24e61e){if(_0x349bcc){return client[_0x1c99('0x9')](_0x1c99('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x1c99('0xd'),_0x1c99('0x1b'),_0x1c99('0x1c'),_0x1c99('0x1d')],'where':{'name':_0x349bcc},'limit':0x1}})[_0x1c99('0xe')](function(_0x2b93e4){logger['debug'](_0x1c99('0x1e'),_0x349bcc,_0x2b93e4?util['inspect'](_0x2b93e4,{'showHidden':![],'depth':null}):'');logger[_0x1c99('0x5')](_0x1c99('0x1f'),_0x349bcc,_0x2b93e4?_0x1c99('0x17'):_0x1c99('0x13'));return _0x4b1095(_0x2b93e4[_0x1c99('0x12')]['length']?_0x2b93e4[_0x1c99('0x12')][0x0]:null);})[_0x1c99('0xb')](function(_0xc80968){logger[_0x1c99('0x8')](_0x1c99('0x20'),_0xc80968?util['inspect'](_0xc80968,{'showHidden':![],'depth':null}):'');return _0x4b1095(null);});}return _0x4b1095(null);});};exports[_0x1c99('0x21')]=function(_0xd8e696,_0x24a431){return moment(_0xd8e696)[_0x1c99('0x22')](_0x24a431,'seconds')['format'](_0x1c99('0x23'));};exports[_0x1c99('0x24')]=function(_0x3ab34b,_0x2416a8){return moment(_0x3ab34b)[_0x1c99('0x25')](_0x2416a8,_0x1c99('0x26'))[_0x1c99('0x27')](_0x1c99('0x23'));};exports[_0x1c99('0x28')]=function(_0x5a9dba,_0x39fda0){return moment(_0x5a9dba)[_0x1c99('0x29')](moment(_0x39fda0),_0x1c99('0x26'));};exports[_0x1c99('0x2a')]=function(_0x36c432,_0x14a852){return parseInt(_0x36c432,0xa)+parseInt(_0x14a852,0xa);};exports['now']=function(){return moment()[_0x1c99('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x1c99('0x2b')]=function(_0xd3dbab,_0x3aa42b){if(_0x3aa42b){return moment(_0xd3dbab)['isAfter'](_0x3aa42b);}return!![];};exports['isBefore']=function(_0x409f96,_0x2409da){if(_0x2409da){return moment(_0x409f96)[_0x1c99('0x2c')](_0x2409da);}else if(_0x409f96){return!![];}return![];}; \ No newline at end of file +var _0x61c7=['[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','addTime','add','seconds','subtractTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','error','inspect','then','[utils][request]\x20name:%s','request','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s'];(function(_0x4af512,_0x50d3cb){var _0x146f7a=function(_0x55af02){while(--_0x55af02){_0x4af512['push'](_0x4af512['shift']());}};_0x146f7a(++_0x50d3cb);}(_0x61c7,0x76));var _0x761c=function(_0x59f6be,_0x472a09){_0x59f6be=_0x59f6be-0x0;var _0x2aef59=_0x61c7[_0x59f6be];return _0x2aef59;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x761c('0x0'));var moment=require(_0x761c('0x1'));var util=require(_0x761c('0x2'));var client=jayson[_0x761c('0x3')][_0x761c('0x4')]({'port':0x2329});var logger=require(_0x761c('0x5'))(_0x761c('0x6'));exports[_0x761c('0x7')]=function(_0x3f10ab,_0x4f4c36){logger[_0x761c('0x7')](_0x3f10ab,_0x4f4c36?util['inspect'](_0x4f4c36,{'showHidden':![],'depth':null}):'');};exports[_0x761c('0x8')]=function(_0x4cd253,_0x3f63cf){logger[_0x761c('0x8')](_0x4cd253,_0x3f63cf?util['inspect'](_0x3f63cf,{'showHidden':![],'depth':null}):'');};exports[_0x761c('0x9')]=function(_0x1ccbaa,_0x2b5c15){logger[_0x761c('0x9')](_0x1ccbaa,_0x2b5c15?util[_0x761c('0xa')](_0x2b5c15,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4e6c10,_0x6b4067){return client['request'](_0x4e6c10,{'body':_0x6b4067})[_0x761c('0xb')](function(_0x5c713f){logger[_0x761c('0x8')](_0x761c('0xc'),_0x4e6c10,_0x5c713f?util[_0x761c('0xa')](_0x5c713f,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x1b5183){logger[_0x761c('0x9')](_0x761c('0xc'),_0x4e6c10,_0x1b5183?util['inspect'](_0x1b5183,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3a2127){return client[_0x761c('0xd')](_0x761c('0xe'),{'options':{'raw':!![],'attributes':['id',_0x761c('0xf'),_0x761c('0x10'),'interface'],'where':_0x3a2127,'limit':0x1}})[_0x761c('0xb')](function(_0x39aeaa){logger['debug'](_0x761c('0x11'),JSON[_0x761c('0x12')](_0x3a2127),_0x39aeaa?util[_0x761c('0xa')](_0x39aeaa,{'showHidden':![],'depth':null}):'');return _0x39aeaa['result'][_0x761c('0x13')]?_0x39aeaa['result'][0x0]:null;});}exports[_0x761c('0x14')]=function(_0x100f4e){return new BPromise(function(_0x4a1132,_0x58c178){if(_0x100f4e){return getUser({'internal':_0x100f4e})[_0x761c('0xb')](function(_0xb5e4ff){logger['info'](_0x761c('0x15'),_0x100f4e,_0xb5e4ff?'found':_0x761c('0x16'));return _0x4a1132(_0xb5e4ff);})[_0x761c('0x17')](function(_0xf272aa){logger[_0x761c('0x9')](_0x761c('0x18'),_0xf272aa?util[_0x761c('0xa')](_0xf272aa,{'showHidden':![],'depth':null}):'');return _0x4a1132(null);});}return _0x4a1132(null);});};exports['getUserByInterface']=function(_0x4cd9c2){return new BPromise(function(_0x3bbf6c,_0x272c28){if(_0x4cd9c2){return getUser({'interface':_0x4cd9c2})[_0x761c('0xb')](function(_0x521404){logger[_0x761c('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x4cd9c2,_0x521404?_0x761c('0x19'):_0x761c('0x16'));return _0x3bbf6c(_0x521404);})[_0x761c('0x17')](function(_0x4a15bd){logger[_0x761c('0x9')](_0x761c('0x1a'),_0x4a15bd?util[_0x761c('0xa')](_0x4a15bd,{'showHidden':![],'depth':null}):'');return _0x3bbf6c(null);});}return _0x3bbf6c(null);});};exports[_0x761c('0x1b')]=function(_0x214502){return new BPromise(function(_0x38b94c,_0x4c0a8a){if(_0x214502){return getUser({'name':_0x214502})[_0x761c('0xb')](function(_0x18fce2){logger['info'](_0x761c('0x1c'),_0x214502,_0x18fce2?_0x761c('0x19'):'notfound');return _0x38b94c(_0x18fce2);})['catch'](function(_0x421acd){logger['error'](_0x761c('0x1d'),_0x421acd?util[_0x761c('0xa')](_0x421acd,{'showHidden':![],'depth':null}):'');return _0x38b94c(null);});}return _0x38b94c(null);});};exports[_0x761c('0x1e')]=function(_0x199595){return new BPromise(function(_0x207a1e,_0x4b04c8){if(_0x199595){return client[_0x761c('0xd')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x761c('0x10'),_0x761c('0x1f'),_0x761c('0x20'),_0x761c('0x21')],'where':{'name':_0x199595},'limit':0x1}})['then'](function(_0x1d9d7e){logger[_0x761c('0x8')](_0x761c('0x22'),_0x199595,_0x1d9d7e?util['inspect'](_0x1d9d7e,{'showHidden':![],'depth':null}):'');logger[_0x761c('0x7')](_0x761c('0x23'),_0x199595,_0x1d9d7e?_0x761c('0x19'):_0x761c('0x16'));return _0x207a1e(_0x1d9d7e[_0x761c('0x24')][_0x761c('0x13')]?_0x1d9d7e[_0x761c('0x24')][0x0]:null);})['catch'](function(_0x3cc0a8){logger['error'](_0x761c('0x25'),_0x3cc0a8?util[_0x761c('0xa')](_0x3cc0a8,{'showHidden':![],'depth':null}):'');return _0x207a1e(null);});}return _0x207a1e(null);});};exports[_0x761c('0x26')]=function(_0x416c95,_0x1be8bb){return moment(_0x416c95)[_0x761c('0x27')](_0x1be8bb,_0x761c('0x28'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x761c('0x29')]=function(_0x338e0f,_0xa60f0c){return moment(_0x338e0f)[_0x761c('0x2a')](_0xa60f0c,_0x761c('0x28'))[_0x761c('0x2b')](_0x761c('0x2c'));};exports[_0x761c('0x2d')]=function(_0x5af5be,_0x5b2679){return moment(_0x5af5be)[_0x761c('0x2e')](moment(_0x5b2679),_0x761c('0x28'));};exports[_0x761c('0x2f')]=function(_0x3b17d7,_0xb4653d){return parseInt(_0x3b17d7,0xa)+parseInt(_0xb4653d,0xa);};exports[_0x761c('0x30')]=function(){return moment()[_0x761c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x761c('0x31')]=function(_0x31f011,_0x2a378f){if(_0x2a378f){return moment(_0x31f011)[_0x761c('0x31')](_0x2a378f);}return!![];};exports[_0x761c('0x32')]=function(_0x59764c,_0x42e653){if(_0x42e653){return moment(_0x59764c)['isBefore'](_0x42e653);}else if(_0x59764c){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 b5bcbd5..b1619b1 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 _0x486c=['connection','other','agent_name','test','setupLoggers','express-winston','util','./loggers','fileLogger','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','catch','user','then','no-user','timestamp','error','api','auth','set','use','body','\x20body=%s','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','inspect','logger','%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'];(function(_0x275093,_0x4fb771){var _0x533401=function(_0x585a38){while(--_0x585a38){_0x275093['push'](_0x275093['shift']());}};_0x533401(++_0x4fb771);}(_0x486c,0xdc));var _0xc486=function(_0x5ce24b,_0x2fc794){_0x5ce24b=_0x5ce24b-0x0;var _0x4f750f=_0x486c[_0x5ce24b];return _0x4f750f;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0xc486('0x0'));var path=require('path');var util=require(_0xc486('0x1'));var fileLogger=require(_0xc486('0x2'))[_0xc486('0x3')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0xc486('0x4'))[_0xc486('0x5')];function ClientSideLogger(){function _0xa35768(_0x5764d6){var _0x10c73c=path[_0xc486('0x6')](_0xc486('0x7'),_0xc486('0x8'),_0xc486('0x9'));var _0x510b87=path[_0xc486('0x6')](_0xc486('0xa'),_0x5764d6[_0xc486('0xb')]+'-'+_0x5764d6['name']);return fs['ensureDir'](path[_0xc486('0x6')](_0x10c73c,_0x510b87))['then'](function(){var _0x5d8c6f=fileLogger(_0xc486('0xa'),path[_0xc486('0x6')](_0x10c73c,_0x510b87));return _0x5d8c6f;})[_0xc486('0xc')](function(_0x9e81a2){throw _0x9e81a2;});}this[_0xc486('0x8')]=function(_0x4011b2,_0x4f0ac0,_0x447a33,_0x43f989){return _0xa35768(_0x4011b2[_0xc486('0xd')])[_0xc486('0xe')](function(_0x561242){var _0x3afb1b=_0x561242[_0x4f0ac0];return _0x3afb1b;})[_0xc486('0xe')](function(_0x118d6e){var _0x56622d=_0x4011b2[_0xc486('0xd')]?_0x4011b2[_0xc486('0xd')]['id']:_0xc486('0xf');var _0x53492c=_0x43f989['data'];var _0x39eb2b=_0x43f989[_0xc486('0x10')];var _0x491d7f=new Date(Number(_0x39eb2b));return _0x118d6e(_0x56622d,_0x491d7f,_0x447a33,_0x53492c);})[_0xc486('0xc')](function(_0x3426d4){fileLogger(_0xc486('0xa'))[_0xc486('0x11')](_0x3426d4);});};}function setupLoggers(_0x2b190d){return new Promise(function(_0x1d237f){var _0x2fd0a0=new ClientSideLogger();var _0x404a46=fileLogger(_0xc486('0x12'));var _0x46f3c5=fileLogger(_0xc486('0x13'));_0x2b190d[_0xc486('0x14')]('client-side-logger',_0x2fd0a0);_0x2b190d[_0xc486('0x15')](ewinston['logger']({'winstonInstance':_0x404a46,'meta':![],'statusLevels':!![],'msg':function(_0x3823bf,_0x36a144){var _0x47cab4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x3823bf[_0xc486('0x16')])){_0x47cab4+=_0xc486('0x17');var _0x2edbf0=_0x3823bf[_0xc486('0x16')];maskSensitiveData(_0x2edbf0);}return safeTemplate(util['format'](_0x47cab4,_0x3823bf[_0xc486('0x18')],_0x3823bf[_0xc486('0x19')]['x-forwarded-for']?_0x3823bf['headers'][_0xc486('0x1a')]:_0x3823bf['connection'][_0xc486('0x1b')]||_0x3823bf['ip'],_0x3823bf[_0xc486('0x1c')],_0x36a144[_0xc486('0x1d')],_0x36a144[_0xc486('0x1e')],_0x3823bf[_0xc486('0xd')]?_0x3823bf['user']['id']:null,_0x3823bf[_0xc486('0xd')]?_0x3823bf[_0xc486('0xd')]['name']:null,_0x3823bf[_0xc486('0xd')]?_0x3823bf['user'][_0xc486('0xb')]:null,_0x2edbf0?util[_0xc486('0x1f')](_0x2edbf0,![],null):''));}}));_0x2b190d[_0xc486('0x15')](ewinston[_0xc486('0x20')]({'winstonInstance':_0x46f3c5,'meta':![],'statusLevels':!![],'msg':function(_0x1cd1d6,_0x297a33){var _0x4a4f68=_0xc486('0x21');if(_0x1cd1d6['body']&&_0x1cd1d6['body'][_0xc486('0x22')]&&_0x1cd1d6[_0xc486('0x16')][_0xc486('0x23')]){_0x4a4f68=_0xc486('0x24');}return util[_0xc486('0x25')](_0x4a4f68,_0x1cd1d6['method'],_0x1cd1d6[_0xc486('0x19')]['x-forwarded-for']?_0x1cd1d6[_0xc486('0x19')][_0xc486('0x1a')]:_0x1cd1d6[_0xc486('0x26')]['remoteAddress']||_0x1cd1d6['ip'],_0x1cd1d6[_0xc486('0x1c')],_0x297a33[_0xc486('0x1d')],_0x297a33['responseTime'],_0x1cd1d6[_0xc486('0xd')]?_0x1cd1d6[_0xc486('0xd')]['id']:null,_0x1cd1d6['user']?_0x1cd1d6[_0xc486('0xd')]['name']:null,_0x1cd1d6['user']?_0x1cd1d6[_0xc486('0xd')][_0xc486('0xb')]:null,_0x1cd1d6[_0xc486('0x16')]&&_0x1cd1d6[_0xc486('0x16')]['device']?_0x1cd1d6[_0xc486('0x16')][_0xc486('0x22')]:_0xc486('0x27'),_0x1cd1d6[_0xc486('0x16')]&&_0x1cd1d6[_0xc486('0x16')]['agent_id']?_0x1cd1d6[_0xc486('0x16')]['agent_id']:'',_0x1cd1d6['body']&&_0x1cd1d6[_0xc486('0x16')][_0xc486('0x28')]?_0x1cd1d6[_0xc486('0x16')][_0xc486('0x28')]:'');},'ignoreRoute':function(_0x1e1bfe){var _0x303b02=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x303b02[_0xc486('0x29')](_0x1e1bfe['url']);}}));return _0x1d237f();});}exports[_0xc486('0x2a')]=setupLoggers; \ No newline at end of file +var _0xf8a2=['logger','agent_id','url','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','xcally','role','ensureDir','then','client','catch','user','no-user','data','timestamp','error','api','auth','client-side-logger','use','%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','statusCode','responseTime','name','inspect'];(function(_0xbf2e72,_0x14acfd){var _0x8ffcdb=function(_0x1f16b9){while(--_0x1f16b9){_0xbf2e72['push'](_0xbf2e72['shift']());}};_0x8ffcdb(++_0x14acfd);}(_0xf8a2,0xc3));var _0x2f8a=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xf8a2[_0x45fc6a];return _0x14bcfd;};var fs=require(_0x2f8a('0x0'));var _=require(_0x2f8a('0x1'));var ewinston=require(_0x2f8a('0x2'));var path=require('path');var util=require(_0x2f8a('0x3'));var fileLogger=require(_0x2f8a('0x4'))['fileLogger'];var safeTemplate=require(_0x2f8a('0x5'))[_0x2f8a('0x6')];var maskSensitiveData=require(_0x2f8a('0x7'))[_0x2f8a('0x8')];function ClientSideLogger(){function _0x5e3d6b(_0x4239d3){var _0x4f9546=path[_0x2f8a('0x9')](_0x2f8a('0xa'),'log',_0x2f8a('0xb'));var _0x38f114=path['join']('client',_0x4239d3[_0x2f8a('0xc')]+'-'+_0x4239d3['name']);return fs[_0x2f8a('0xd')](path[_0x2f8a('0x9')](_0x4f9546,_0x38f114))[_0x2f8a('0xe')](function(){var _0x996c09=fileLogger(_0x2f8a('0xf'),path[_0x2f8a('0x9')](_0x4f9546,_0x38f114));return _0x996c09;})[_0x2f8a('0x10')](function(_0x3eb8f5){throw _0x3eb8f5;});}this['log']=function(_0x4eaa6a,_0x10f5b0,_0x186908,_0x484a44){return _0x5e3d6b(_0x4eaa6a[_0x2f8a('0x11')])[_0x2f8a('0xe')](function(_0x5ab46d){var _0x5087eb=_0x5ab46d[_0x10f5b0];return _0x5087eb;})[_0x2f8a('0xe')](function(_0x1ac838){var _0x2f6b5b=_0x4eaa6a['user']?_0x4eaa6a[_0x2f8a('0x11')]['id']:_0x2f8a('0x12');var _0x8db5b7=_0x484a44[_0x2f8a('0x13')];var _0x5a257e=_0x484a44[_0x2f8a('0x14')];var _0x5b8aee=new Date(Number(_0x5a257e));return _0x1ac838(_0x2f6b5b,_0x5b8aee,_0x186908,_0x8db5b7);})['catch'](function(_0xcd569f){fileLogger(_0x2f8a('0xf'))[_0x2f8a('0x15')](_0xcd569f);});};}function setupLoggers(_0x479b95){return new Promise(function(_0x450c1b){var _0x3f1c6a=new ClientSideLogger();var _0x52634e=fileLogger(_0x2f8a('0x16'));var _0x3f5e61=fileLogger(_0x2f8a('0x17'));_0x479b95['set'](_0x2f8a('0x18'),_0x3f1c6a);_0x479b95[_0x2f8a('0x19')](ewinston['logger']({'winstonInstance':_0x52634e,'meta':![],'statusLevels':!![],'msg':function(_0x3baee0,_0x26be27){var _0xeaac60=_0x2f8a('0x1a');if(!_[_0x2f8a('0x1b')](_0x3baee0[_0x2f8a('0x1c')])){_0xeaac60+=_0x2f8a('0x1d');var _0x42047d=_0x3baee0[_0x2f8a('0x1c')];maskSensitiveData(_0x42047d);}return safeTemplate(util[_0x2f8a('0x1e')](_0xeaac60,_0x3baee0[_0x2f8a('0x1f')],_0x3baee0[_0x2f8a('0x20')]['x-forwarded-for']?_0x3baee0[_0x2f8a('0x20')][_0x2f8a('0x21')]:_0x3baee0[_0x2f8a('0x22')][_0x2f8a('0x23')]||_0x3baee0['ip'],_0x3baee0['url'],_0x26be27[_0x2f8a('0x24')],_0x26be27[_0x2f8a('0x25')],_0x3baee0['user']?_0x3baee0[_0x2f8a('0x11')]['id']:null,_0x3baee0['user']?_0x3baee0[_0x2f8a('0x11')][_0x2f8a('0x26')]:null,_0x3baee0['user']?_0x3baee0[_0x2f8a('0x11')][_0x2f8a('0xc')]:null,_0x42047d?util[_0x2f8a('0x27')](_0x42047d,![],null):''));}}));_0x479b95[_0x2f8a('0x19')](ewinston[_0x2f8a('0x28')]({'winstonInstance':_0x3f5e61,'meta':![],'statusLevels':!![],'msg':function(_0x29e4a0,_0x2f4999){var _0x493e47='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x29e4a0['body']&&_0x29e4a0[_0x2f8a('0x1c')]['device']&&_0x29e4a0['body'][_0x2f8a('0x29')]){_0x493e47='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x2f8a('0x1e')](_0x493e47,_0x29e4a0[_0x2f8a('0x1f')],_0x29e4a0[_0x2f8a('0x20')][_0x2f8a('0x21')]?_0x29e4a0[_0x2f8a('0x20')][_0x2f8a('0x21')]:_0x29e4a0[_0x2f8a('0x22')]['remoteAddress']||_0x29e4a0['ip'],_0x29e4a0[_0x2f8a('0x2a')],_0x2f4999['statusCode'],_0x2f4999[_0x2f8a('0x25')],_0x29e4a0[_0x2f8a('0x11')]?_0x29e4a0[_0x2f8a('0x11')]['id']:null,_0x29e4a0[_0x2f8a('0x11')]?_0x29e4a0[_0x2f8a('0x11')][_0x2f8a('0x26')]:null,_0x29e4a0[_0x2f8a('0x11')]?_0x29e4a0[_0x2f8a('0x11')][_0x2f8a('0xc')]:null,_0x29e4a0[_0x2f8a('0x1c')]&&_0x29e4a0[_0x2f8a('0x1c')]['device']?_0x29e4a0['body']['device']:_0x2f8a('0x2b'),_0x29e4a0['body']&&_0x29e4a0[_0x2f8a('0x1c')][_0x2f8a('0x29')]?_0x29e4a0['body'][_0x2f8a('0x29')]:'',_0x29e4a0[_0x2f8a('0x1c')]&&_0x29e4a0[_0x2f8a('0x1c')]['agent_name']?_0x29e4a0[_0x2f8a('0x1c')][_0x2f8a('0x2c')]:'');},'ignoreRoute':function(_0x10d4d1){var _0x743c80=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x743c80[_0x2f8a('0x2d')](_0x10d4d1[_0x2f8a('0x2a')]);}}));return _0x450c1b();});}exports[_0x2f8a('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 8e432ef..b947e63 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5af=['iftime','lodash','moment-timezone','map','source','Interval\x20string\x20not\x20valid','isValid','locale','weekdaysShort','indexOf','slice','concat','exports','circularDoWInterval','toLowerCase','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','dowCompare','date','daysInMonth','max','domCompare','MMM','includes','monthCompare','guess','isMoment','split','padStart','length'];(function(_0x390cea,_0x43c078){var _0x14bf80=function(_0x196f3c){while(--_0x196f3c){_0x390cea['push'](_0x390cea['shift']());}};_0x14bf80(++_0x43c078);}(_0xa5af,0xf1));var _0xfa5a=function(_0x5ed547,_0x4d6d4f){_0x5ed547=_0x5ed547-0x0;var _0x5c373d=_0xa5af[_0x5ed547];return _0x5c373d;};var _=require(_0xfa5a('0x0'));var moment=require(_0xfa5a('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][_0xfa5a('0x2')](function(_0x5d7845){return _0x5d7845[_0xfa5a('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xfa5a('0x4');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x39f8a6){if(!_0x39f8a6[_0xfa5a('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4f143b){var _0x4f3e3e=_0x4f143b['split'](':')['map'](function(_0x5293c6){return parseInt(_0x5293c6,0xa);});var _0x865e1b=_0x4f3e3e[0x0];var _0x502ba0=_0x4f3e3e[0x1];if(_0x865e1b<0x0||_0x865e1b>0x17||_0x502ba0<0x0||_0x502ba0>0x3b){throw new Error(EINVALID_DATE);}return[_0x865e1b,_0x502ba0];}function circularDoWInterval(_0x25ed24,_0xf6bc45){if(_0x25ed24===_0xf6bc45){return[_0x25ed24];}else{var _0x34e834=moment['locale']();moment[_0xfa5a('0x6')]('en');var _0x4338fa=moment[_0xfa5a('0x7')]()[_0xfa5a('0x2')](function(_0x3bfcd4){return _0x3bfcd4['toLowerCase']();});moment[_0xfa5a('0x6')](_0x34e834);var _0x4a082e=_0x4338fa[_0xfa5a('0x8')](_0x25ed24);var _0x155219=_0x4338fa[_0xfa5a('0x8')](_0xf6bc45);if(_0x155219>_0x4a082e){return _0x4338fa[_0xfa5a('0x9')](_0x4a082e,_0x155219+0x1);}else{var _0x39ff7a=_0x4338fa['slice'](0x0,_0x155219+0x1);var _0x363b2c=_0x4338fa[_0xfa5a('0x9')](_0x4a082e);return _0x363b2c[_0xfa5a('0xa')](_0x39ff7a);}}}module[_0xfa5a('0xb')][_0xfa5a('0xc')]=circularDoWInterval;function circularMonthInterval(_0x1ed50b,_0x1160be){if(_0x1ed50b===_0x1160be){return[_0x1ed50b];}else{var _0x212705=moment[_0xfa5a('0x6')]();moment[_0xfa5a('0x6')]('en');var _0x775a8f=moment['monthsShort']()['map'](function(_0x3f45ff){return _0x3f45ff[_0xfa5a('0xd')]();});moment[_0xfa5a('0x6')](_0x212705);var _0x1ae7c0=_0x775a8f[_0xfa5a('0x8')](_0x1ed50b);var _0x10f628=_0x775a8f['indexOf'](_0x1160be);if(_0x10f628>_0x1ae7c0){return _0x775a8f['slice'](_0x1ae7c0,_0x10f628+0x1);}else{var _0x3187fc=_0x775a8f['slice'](0x0,_0x10f628+0x1);var _0x95ff=_0x775a8f[_0xfa5a('0x9')](_0x1ae7c0);return _0x95ff[_0xfa5a('0xa')](_0x3187fc);}}}module[_0xfa5a('0xb')][_0xfa5a('0xe')]=circularMonthInterval;function parseDom(_0x4886f0){var _0x355cfd=parseInt(_0x4886f0,0xa);if(_0x355cfd<0x1||_0x355cfd>0x1f){throw new Error(EINVALID_DATE);}return _0x355cfd;}function timeCompare(_0x26ba3d,_0x3d0e7b,_0x3b4338){var _0x349639=_0x26ba3d['clone']();var _0x575d9a=extractTime(_0x3d0e7b);var _0x32305f=_0x575d9a[0x0];var _0x2c791e=_0x575d9a[0x1];var _0x24d046=_0x26ba3d[_0xfa5a('0xf')]()['hours'](_0x32305f)['minutes'](_0x2c791e);throwIfDateNotValid(_0x24d046);var _0x331542=extractTime(_0x3b4338);var _0x5764dc=_0x331542[0x0];var _0x43b52e=_0x331542[0x1];var _0x579e49=_0x26ba3d['clone']()[_0xfa5a('0x10')](_0x5764dc)[_0xfa5a('0x11')](_0x43b52e);throwIfDateNotValid(_0x579e49);if(_0x579e49[_0xfa5a('0x12')](_0x24d046)){var _0x1c604a=_0x349639[_0xfa5a('0xf')]()[_0xfa5a('0x13')](_0xfa5a('0x14'));var _0x4326fb=_0x349639[_0xfa5a('0xf')]()[_0xfa5a('0x15')](_0xfa5a('0x14'));return _0x349639['isBetween'](_0x24d046,_0x4326fb,undefined,'[]')||_0x349639['isBetween'](_0x1c604a,_0x579e49,undefined,'[]');}else{return _0x349639[_0xfa5a('0x16')](_0x24d046,_0x579e49,undefined,'[]');}}module['exports'][_0xfa5a('0x17')]=timeCompare;function dowCompare(_0x5da533,_0x2d1722,_0x1f8a65){var _0x532760=_0x5da533[_0xfa5a('0x6')]('en')[_0xfa5a('0x18')](_0xfa5a('0x19'))[_0xfa5a('0xd')]();return circularDoWInterval(_0x2d1722,_0x1f8a65)['includes'](_0x532760);}module[_0xfa5a('0xb')][_0xfa5a('0x1a')]=dowCompare;function domCompare(_0x398cd2,_0x47043b,_0x392fb6){var _0xf1630d=_0x398cd2[_0xfa5a('0x1b')]();if(_0x47043b===_0x392fb6){return _0xf1630d===_0x47043b;}else{var _0x500b0f=_0x398cd2[_0xfa5a('0x1c')]();var _0x317d21=_0x47043b<_0x392fb6;let _0x5eb074=![];var _0x54f3b9=0x0;var _0x32bd5d=0x0;if(_0x317d21){_0x54f3b9=Math[_0xfa5a('0x1d')](0x1,_0x47043b);_0x32bd5d=Math['min'](_0x392fb6,_0x500b0f);_0x5eb074=_0xf1630d>=_0x54f3b9&&_0xf1630d<=_0x32bd5d;}else{_0x54f3b9=Math['min'](_0x47043b,_0x500b0f);_0x32bd5d=Math[_0xfa5a('0x1d')](0x1,_0x392fb6);_0x5eb074=_0xf1630d>=_0x54f3b9||_0xf1630d<=_0x32bd5d;}return _0x5eb074;}}module[_0xfa5a('0xb')][_0xfa5a('0x1e')]=domCompare;function monthCompare(_0x2124f7,_0x3fac80,_0x563dc6){var _0x41eeab=_0x2124f7[_0xfa5a('0x6')]('en')['format'](_0xfa5a('0x1f'))[_0xfa5a('0xd')]();return circularMonthInterval(_0x3fac80,_0x563dc6)[_0xfa5a('0x20')](_0x41eeab);}module[_0xfa5a('0xb')][_0xfa5a('0x21')]=monthCompare;function iftime(_0x30cd42,_0x3d56e9=moment['tz'][_0xfa5a('0x22')](),_0x544a7a=moment()){if(!validateRx['test'](_0x30cd42)){throw new Error(EINVALID_STRING);}else{var _0x374226=(moment[_0xfa5a('0x23')](_0x544a7a)?_0x544a7a[_0xfa5a('0xf')]():moment(_0x544a7a))['tz'](_0x3d56e9)[_0xfa5a('0x6')]('en');throwIfDateNotValid(_0x374226);var _0x412700=_0x30cd42['split'](',');var _0x1bf9be=_0x412700[0x0];var _0x43c064=_0x412700[0x1];var _0x249e90=_0x412700[0x2];var _0x52f39c=_0x412700[0x3];let _0x435c7e=!![];if(_0x1bf9be!=='*'){var _0x572d5d=_0x1bf9be[_0xfa5a('0x24')]('-');var _0x498e97=_[_0xfa5a('0x25')](_0x572d5d[0x0],0x5,'0');var _0x3b91bb=_0x572d5d[_0xfa5a('0x26')]===0x2?_['padStart'](_0x572d5d[0x1],0x5,'0'):_0x498e97;_0x435c7e=timeCompare(_0x374226,_0x498e97,_0x3b91bb);}let _0x34c717=!![];if(_0x43c064!=='*'){var _0x12b7ea=_0x43c064[_0xfa5a('0x24')]('-');var _0x54cccb=_0x12b7ea[0x0];var _0x34d017=_0x12b7ea[_0xfa5a('0x26')]===0x2?_0x12b7ea[0x1]:_0x54cccb;_0x34c717=dowCompare(_0x374226,_0x54cccb,_0x34d017);}let _0x2bf94a=!![];if(_0x249e90!=='*'){var _0x4661a6=_0x249e90[_0xfa5a('0x24')]('-');var _0x4398db=parseDom(_0x4661a6[0x0]);var _0x24aa64=_0x4661a6[_0xfa5a('0x26')]===0x2?parseDom(_0x4661a6[0x1]):_0x4398db;_0x2bf94a=domCompare(_0x374226,_0x4398db,_0x24aa64);}let _0x1ec006=!![];if(_0x52f39c!=='*'){var _0x45f646=_0x52f39c[_0xfa5a('0x24')]('-');var _0x1f1d40=_0x45f646[0x0];var _0xc255ee=_0x45f646[_0xfa5a('0x26')]===0x2?_0x45f646[0x1]:_0x45f646[0x0];_0x1ec006=monthCompare(_0x374226,_0x1f1d40,_0xc255ee);}return _0x435c7e&&_0x34c717&&_0x2bf94a&&_0x1ec006;}}module['exports'][_0xfa5a('0x27')]=iftime; \ No newline at end of file +var _0x2c84=['length','iftime','moment-timezone','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','map','locale','slice','concat','exports','circularDoWInterval','toLowerCase','indexOf','circularMonthInterval','clone','minutes','hours','isBefore','startOf','endOf','day','isBetween','format','ddd','dowCompare','daysInMonth','max','min','domCompare','MMM','includes','monthCompare','guess','test','split','padStart'];(function(_0x51f492,_0x6b3e08){var _0x4c76eb=function(_0x21ee25){while(--_0x21ee25){_0x51f492['push'](_0x51f492['shift']());}};_0x4c76eb(++_0x6b3e08);}(_0x2c84,0x132));var _0x42c8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2c84[_0x1facfa];return _0x9ec701;};var _=require('lodash');var moment=require(_0x42c8('0x0'));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]['map'](function(_0x2e5c9c){return _0x2e5c9c[_0x42c8('0x1')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x42c8('0x2');var EINVALID_DATE=_0x42c8('0x3');function throwIfDateNotValid(_0x307523){if(!_0x307523[_0x42c8('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x46e626){var _0x2feeef=_0x46e626['split'](':')[_0x42c8('0x5')](function(_0x453d43){return parseInt(_0x453d43,0xa);});var _0x259be1=_0x2feeef[0x0];var _0x33fd7b=_0x2feeef[0x1];if(_0x259be1<0x0||_0x259be1>0x17||_0x33fd7b<0x0||_0x33fd7b>0x3b){throw new Error(EINVALID_DATE);}return[_0x259be1,_0x33fd7b];}function circularDoWInterval(_0x112ab8,_0x416a46){if(_0x112ab8===_0x416a46){return[_0x112ab8];}else{var _0x33e8db=moment[_0x42c8('0x6')]();moment['locale']('en');var _0x8beddd=moment['weekdaysShort']()['map'](function(_0x3da717){return _0x3da717['toLowerCase']();});moment[_0x42c8('0x6')](_0x33e8db);var _0x4841ef=_0x8beddd['indexOf'](_0x112ab8);var _0x517579=_0x8beddd['indexOf'](_0x416a46);if(_0x517579>_0x4841ef){return _0x8beddd[_0x42c8('0x7')](_0x4841ef,_0x517579+0x1);}else{var _0x3b0d27=_0x8beddd[_0x42c8('0x7')](0x0,_0x517579+0x1);var _0x3375c6=_0x8beddd[_0x42c8('0x7')](_0x4841ef);return _0x3375c6[_0x42c8('0x8')](_0x3b0d27);}}}module[_0x42c8('0x9')][_0x42c8('0xa')]=circularDoWInterval;function circularMonthInterval(_0x1109aa,_0x3c6d25){if(_0x1109aa===_0x3c6d25){return[_0x1109aa];}else{var _0x14ddee=moment[_0x42c8('0x6')]();moment[_0x42c8('0x6')]('en');var _0x52bc7=moment['monthsShort']()[_0x42c8('0x5')](function(_0x123fa0){return _0x123fa0[_0x42c8('0xb')]();});moment['locale'](_0x14ddee);var _0x1ba57e=_0x52bc7['indexOf'](_0x1109aa);var _0x3ba73e=_0x52bc7[_0x42c8('0xc')](_0x3c6d25);if(_0x3ba73e>_0x1ba57e){return _0x52bc7['slice'](_0x1ba57e,_0x3ba73e+0x1);}else{var _0x1b2959=_0x52bc7['slice'](0x0,_0x3ba73e+0x1);var _0x1467f7=_0x52bc7[_0x42c8('0x7')](_0x1ba57e);return _0x1467f7[_0x42c8('0x8')](_0x1b2959);}}}module[_0x42c8('0x9')][_0x42c8('0xd')]=circularMonthInterval;function parseDom(_0x189ed2){var _0x1182ce=parseInt(_0x189ed2,0xa);if(_0x1182ce<0x1||_0x1182ce>0x1f){throw new Error(EINVALID_DATE);}return _0x1182ce;}function timeCompare(_0x1ed23e,_0x3984f8,_0x49de32){var _0x50dca0=_0x1ed23e[_0x42c8('0xe')]();var _0xf1e74e=extractTime(_0x3984f8);var _0x487ba1=_0xf1e74e[0x0];var _0x355b4=_0xf1e74e[0x1];var _0x276dbc=_0x1ed23e[_0x42c8('0xe')]()['hours'](_0x487ba1)[_0x42c8('0xf')](_0x355b4);throwIfDateNotValid(_0x276dbc);var _0x324f60=extractTime(_0x49de32);var _0x57d53d=_0x324f60[0x0];var _0x23a6e7=_0x324f60[0x1];var _0x4bbafc=_0x1ed23e[_0x42c8('0xe')]()[_0x42c8('0x10')](_0x57d53d)[_0x42c8('0xf')](_0x23a6e7);throwIfDateNotValid(_0x4bbafc);if(_0x4bbafc[_0x42c8('0x11')](_0x276dbc)){var _0x475cd5=_0x50dca0[_0x42c8('0xe')]()[_0x42c8('0x12')]('day');var _0x3081b5=_0x50dca0[_0x42c8('0xe')]()[_0x42c8('0x13')](_0x42c8('0x14'));return _0x50dca0['isBetween'](_0x276dbc,_0x3081b5,undefined,'[]')||_0x50dca0[_0x42c8('0x15')](_0x475cd5,_0x4bbafc,undefined,'[]');}else{return _0x50dca0[_0x42c8('0x15')](_0x276dbc,_0x4bbafc,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x3b06e4,_0x362cc9,_0x563026){var _0x48cc9a=_0x3b06e4[_0x42c8('0x6')]('en')[_0x42c8('0x16')](_0x42c8('0x17'))[_0x42c8('0xb')]();return circularDoWInterval(_0x362cc9,_0x563026)['includes'](_0x48cc9a);}module['exports'][_0x42c8('0x18')]=dowCompare;function domCompare(_0x4a766d,_0x1a9b90,_0x4ba681){var _0x58d05e=_0x4a766d['date']();if(_0x1a9b90===_0x4ba681){return _0x58d05e===_0x1a9b90;}else{var _0x1ec110=_0x4a766d[_0x42c8('0x19')]();var _0x4ad781=_0x1a9b90<_0x4ba681;let _0x4a82a4=![];var _0x1faeb1=0x0;var _0x2b9c88=0x0;if(_0x4ad781){_0x1faeb1=Math[_0x42c8('0x1a')](0x1,_0x1a9b90);_0x2b9c88=Math[_0x42c8('0x1b')](_0x4ba681,_0x1ec110);_0x4a82a4=_0x58d05e>=_0x1faeb1&&_0x58d05e<=_0x2b9c88;}else{_0x1faeb1=Math['min'](_0x1a9b90,_0x1ec110);_0x2b9c88=Math[_0x42c8('0x1a')](0x1,_0x4ba681);_0x4a82a4=_0x58d05e>=_0x1faeb1||_0x58d05e<=_0x2b9c88;}return _0x4a82a4;}}module[_0x42c8('0x9')][_0x42c8('0x1c')]=domCompare;function monthCompare(_0x2d353c,_0x25e924,_0x5854de){var _0x1eab55=_0x2d353c['locale']('en')['format'](_0x42c8('0x1d'))[_0x42c8('0xb')]();return circularMonthInterval(_0x25e924,_0x5854de)[_0x42c8('0x1e')](_0x1eab55);}module[_0x42c8('0x9')][_0x42c8('0x1f')]=monthCompare;function iftime(_0x268a8a,_0x14c7d8=moment['tz'][_0x42c8('0x20')](),_0x211ad0=moment()){if(!validateRx[_0x42c8('0x21')](_0x268a8a)){throw new Error(EINVALID_STRING);}else{var _0x4d01ca=(moment['isMoment'](_0x211ad0)?_0x211ad0[_0x42c8('0xe')]():moment(_0x211ad0))['tz'](_0x14c7d8)['locale']('en');throwIfDateNotValid(_0x4d01ca);var _0x173a90=_0x268a8a[_0x42c8('0x22')](',');var _0x401cf4=_0x173a90[0x0];var _0x1f8f4d=_0x173a90[0x1];var _0x51ca34=_0x173a90[0x2];var _0x4b4481=_0x173a90[0x3];let _0x1c660b=!![];if(_0x401cf4!=='*'){var _0x3b8d3b=_0x401cf4[_0x42c8('0x22')]('-');var _0x4133c8=_[_0x42c8('0x23')](_0x3b8d3b[0x0],0x5,'0');var _0x4ab2f5=_0x3b8d3b[_0x42c8('0x24')]===0x2?_[_0x42c8('0x23')](_0x3b8d3b[0x1],0x5,'0'):_0x4133c8;_0x1c660b=timeCompare(_0x4d01ca,_0x4133c8,_0x4ab2f5);}let _0x2d2f7c=!![];if(_0x1f8f4d!=='*'){var _0x2fafad=_0x1f8f4d[_0x42c8('0x22')]('-');var _0x168163=_0x2fafad[0x0];var _0x2ebb96=_0x2fafad[_0x42c8('0x24')]===0x2?_0x2fafad[0x1]:_0x168163;_0x2d2f7c=dowCompare(_0x4d01ca,_0x168163,_0x2ebb96);}let _0x5f330b=!![];if(_0x51ca34!=='*'){var _0x59d6e7=_0x51ca34['split']('-');var _0x22d2fa=parseDom(_0x59d6e7[0x0]);var _0x3ad7cc=_0x59d6e7['length']===0x2?parseDom(_0x59d6e7[0x1]):_0x22d2fa;_0x5f330b=domCompare(_0x4d01ca,_0x22d2fa,_0x3ad7cc);}let _0x229105=!![];if(_0x4b4481!=='*'){var _0x1e7049=_0x4b4481[_0x42c8('0x22')]('-');var _0x58142b=_0x1e7049[0x0];var _0x159e5d=_0x1e7049[_0x42c8('0x24')]===0x2?_0x1e7049[0x1]:_0x1e7049[0x0];_0x229105=monthCompare(_0x4d01ca,_0x58142b,_0x159e5d);}return _0x1c660b&&_0x2d2f7c&&_0x5f330b&&_0x229105;}}module['exports'][_0x42c8('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index c341138..ca33990 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f48=['bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','format','message','replace','{{{','}}}','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','Console','warn','File','error','transports','consoleLogger','path','moment','winston','../config/environment','debugLevel','redBG\x20white','red','bold\x20yellow','white','gray'];(function(_0x432e30,_0x459f2e){var _0xb5ac70=function(_0x31e7e3){while(--_0x31e7e3){_0x432e30['push'](_0x432e30['shift']());}};_0xb5ac70(++_0x459f2e);}(_0x2f48,0x154));var _0x82f4=function(_0x4c2960,_0x17c000){_0x4c2960=_0x4c2960-0x0;var _0x3c2150=_0x2f48[_0x4c2960];return _0x3c2150;};'use strict';var path=require(_0x82f4('0x0'));var util=require('util');var moment=require(_0x82f4('0x1'));var winston=require(_0x82f4('0x2'));var config=require(_0x82f4('0x3'));var debugLevel=config[_0x82f4('0x4')]?config[_0x82f4('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':_0x82f4('0x5'),'error':_0x82f4('0x6'),'warn':_0x82f4('0x7'),'info':_0x82f4('0x8'),'print':'bold\x20white','success':'bold\x20green','http':_0x82f4('0x9'),'verbose':_0x82f4('0xa'),'debug':_0x82f4('0xb'),'silly':_0x82f4('0xc')};winston[_0x82f4('0xd')](XC_LOG_COLORS);function getLogFileName(_0x94062f,_0x4b8d26,_0x25227e){var _0x35f857=_0x94062f||'/var/log/xcally';return path[_0x82f4('0xe')](_0x35f857,util[_0x82f4('0xf')]('%s-%s.log',_0x4b8d26,_0x25227e));}function formatter(_0x1b22fe,_0x40ed14){_0x40ed14[_0x82f4('0x10')]=_0x40ed14['message'][_0x82f4('0x11')](/@@{/g,_0x82f4('0x12'))[_0x82f4('0x11')](/}@@/g,_0x82f4('0x13'))[_0x82f4('0x11')](/@{/g,'{{')[_0x82f4('0x11')](/}@/g,'}}');return util[_0x82f4('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x82f4('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x40ed14[_0x82f4('0x14')][_0x82f4('0x15')](),_0x1b22fe,_0x40ed14[_0x82f4('0x10')]);}function fileFormat(_0x50bc4b,_0x1d28c1){_0x1d28c1[_0x82f4('0x10')]=_0x1d28c1['message'][_0x82f4('0x11')](/@@{/g,_0x82f4('0x12'))['replace'](/}@@/g,_0x82f4('0x13'))[_0x82f4('0x11')](/@{/g,'{{')[_0x82f4('0x11')](/}@/g,'}}');var _0x472a71=_0x1d28c1[_0x82f4('0x16')]&&Object[_0x82f4('0x17')](_0x1d28c1[_0x82f4('0x16')])[_0x82f4('0x18')]?'\x0a\x09'+JSON[_0x82f4('0x19')](_0x1d28c1[_0x82f4('0x16')]):'';return util[_0x82f4('0xf')](_0x82f4('0x1a'),moment()[_0x82f4('0xf')](_0x82f4('0x1b')),_0x1d28c1[_0x82f4('0x14')][_0x82f4('0x15')](),_0x50bc4b,_0x1d28c1['message'],_0x472a71);}function consoleLogger(){var _0x3fce76=new winston[(_0x82f4('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x82f4('0x1d'))]({'level':_0x82f4('0x1e'),'json':![],'formatter':function(_0x29ef52){return formatter('',_0x29ef52);}})]});return _0x3fce76;}function fileLogger(_0x2d4adb,_0xfa2404){var _0x204cca=new winston[(_0x82f4('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x82f4('0x1f'))]({'name':util[_0x82f4('0xf')]('%s-%s',_0x2d4adb,'error'),'filename':getLogFileName(_0xfa2404,_0x2d4adb,'error'),'level':_0x82f4('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x54c0f8){return fileFormat(_0x2d4adb,_0x54c0f8);}}),new winston[(_0x82f4('0x21'))]['File']({'name':util['format']('%s-%s',_0x2d4adb,debugLevel),'filename':getLogFileName(_0xfa2404,_0x2d4adb,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x404a08){return fileFormat(_0x2d4adb,_0x404a08);}}),new winston['transports'][(_0x82f4('0x1d'))]({'level':_0x82f4('0x1e'),'json':![],'formatter':function(_0x2f5b1c){return fileFormat(_0x2d4adb,_0x2f5b1c);}})]});return _0x204cca;}exports[_0x82f4('0x22')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x5de5=['warn','transports','File','%s-%s','error','fileLogger','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','{{{','meta','keys','stringify','level','Console'];(function(_0xf23837,_0x403080){var _0x34b2cd=function(_0x71d648){while(--_0x71d648){_0xf23837['push'](_0xf23837['shift']());}};_0x34b2cd(++_0x403080);}(_0x5de5,0x75));var _0x55de=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5de5[_0x501510];return _0x1e6ee5;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x55de('0x0'));var winston=require(_0x55de('0x1'));var config=require(_0x55de('0x2'));var debugLevel=config[_0x55de('0x3')]?config[_0x55de('0x3')][_0x55de('0x4')]():_0x55de('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':_0x55de('0x6'),'error':_0x55de('0x7'),'warn':_0x55de('0x8'),'info':_0x55de('0x9'),'print':_0x55de('0xa'),'success':_0x55de('0xb'),'http':_0x55de('0xc'),'verbose':_0x55de('0xd'),'debug':_0x55de('0xe'),'silly':_0x55de('0xf')};winston[_0x55de('0x10')](XC_LOG_COLORS);function getLogFileName(_0x408f4a,_0x53c993,_0x4dd194){var _0x41a404=_0x408f4a||'/var/log/xcally';return path[_0x55de('0x11')](_0x41a404,util[_0x55de('0x12')]('%s-%s.log',_0x53c993,_0x4dd194));}function formatter(_0x366c78,_0x542fdf){_0x542fdf[_0x55de('0x13')]=_0x542fdf['message'][_0x55de('0x14')](/@@{/g,'{{{')[_0x55de('0x14')](/}@@/g,_0x55de('0x15'))[_0x55de('0x14')](/@{/g,'{{')[_0x55de('0x14')](/}@/g,'}}');return util[_0x55de('0x12')](_0x55de('0x16'),moment()[_0x55de('0x12')](_0x55de('0x17')),_0x542fdf['level'][_0x55de('0x18')](),_0x366c78,_0x542fdf[_0x55de('0x13')]);}function fileFormat(_0x3a72fe,_0x3d08df){_0x3d08df[_0x55de('0x13')]=_0x3d08df[_0x55de('0x13')]['replace'](/@@{/g,_0x55de('0x19'))['replace'](/}@@/g,_0x55de('0x15'))[_0x55de('0x14')](/@{/g,'{{')[_0x55de('0x14')](/}@/g,'}}');var _0x3bbd7c=_0x3d08df[_0x55de('0x1a')]&&Object[_0x55de('0x1b')](_0x3d08df[_0x55de('0x1a')])['length']?'\x0a\x09'+JSON[_0x55de('0x1c')](_0x3d08df[_0x55de('0x1a')]):'';return util[_0x55de('0x12')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x55de('0x12')](_0x55de('0x17')),_0x3d08df[_0x55de('0x1d')][_0x55de('0x18')](),_0x3a72fe,_0x3d08df['message'],_0x3bbd7c);}function consoleLogger(){var _0x1db5e5=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x55de('0x1e'))]({'level':_0x55de('0x1f'),'json':![],'formatter':function(_0x37847d){return formatter('',_0x37847d);}})]});return _0x1db5e5;}function fileLogger(_0x30c4a4,_0x2d0199){var _0x29c3b2=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x55de('0x20'))][(_0x55de('0x21'))]({'name':util[_0x55de('0x12')](_0x55de('0x22'),_0x30c4a4,_0x55de('0x23')),'filename':getLogFileName(_0x2d0199,_0x30c4a4,_0x55de('0x23')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e20ae){return fileFormat(_0x30c4a4,_0x2e20ae);}}),new winston[(_0x55de('0x20'))][(_0x55de('0x21'))]({'name':util[_0x55de('0x12')]('%s-%s',_0x30c4a4,debugLevel),'filename':getLogFileName(_0x2d0199,_0x30c4a4,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4be27a){return fileFormat(_0x30c4a4,_0x4be27a);}}),new winston[(_0x55de('0x20'))][(_0x55de('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x625165){return fileFormat(_0x30c4a4,_0x625165);}})]});return _0x29c3b2;}exports['consoleLogger']=consoleLogger;exports[_0x55de('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 452f65f..4662903 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x5c150c,_0x27dee0){var _0x514d69=function(_0x2d8516){while(--_0x2d8516){_0x5c150c['push'](_0x5c150c['shift']());}};_0x514d69(++_0x27dee0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x0b0e[_0x166e96];return _0x553d73;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _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(_0x521b68,_0x2cba86){_0x521b68=_0x521b68-0x0;var _0x2f5d38=_0x7a54[_0x521b68];return _0x2f5d38;};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/misc.js b/server/utils/misc.js index b344a4f..dc2ba4f 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['exports','replace','\x5c$&'];(function(_0x708c47,_0x6eaa1f){var _0x52a470=function(_0x14a750){while(--_0x14a750){_0x708c47['push'](_0x708c47['shift']());}};_0x52a470(++_0x6eaa1f);}(_0x5fab,0x177));var _0xb5fa=function(_0x96be88,_0x2c01a4){_0x96be88=_0x96be88-0x0;var _0x1c14c0=_0x5fab[_0x96be88];return _0x1c14c0;};module[_0xb5fa('0x0')]={'escapeRegExp'(_0x1c67fb,_0x4c67f9=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x1c67fb[_0xb5fa('0x1')](_0x4c67f9,_0xb5fa('0x2'));}}; \ No newline at end of file +var _0x1967=['\x5c$&','replace'];(function(_0x578d20,_0xa293c8){var _0x507331=function(_0x407441){while(--_0x407441){_0x578d20['push'](_0x578d20['shift']());}};_0x507331(++_0xa293c8);}(_0x1967,0x173));var _0x7196=function(_0x28f8c3,_0x57dd61){_0x28f8c3=_0x28f8c3-0x0;var _0x712a31=_0x1967[_0x28f8c3];return _0x712a31;};module['exports']={'escapeRegExp'(_0x1da98b,_0xdb72bb=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x1da98b[_0x7196('0x0')](_0xdb72bb,_0x7196('0x1'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index be09b84..ba31208 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 _0xf7b4=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}'];(function(_0x1db3b4,_0x1e2c29){var _0x2cbd6a=function(_0x4a431a){while(--_0x4a431a){_0x1db3b4['push'](_0x1db3b4['shift']());}};_0x2cbd6a(++_0x1e2c29);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5e08be,_0x9bf344){_0x5e08be=_0x5e08be-0x0;var _0x4db79e=_0xf7b4[_0x5e08be];return _0x4db79e;};var _=require(_0x4f7b('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5579ed){return _0x5579ed==='{{'?'{\x20{\x20':_0x4f7b('0x1');}function safeTemplate(_0x103165){var _0x50ea23=_0x103165;if(typeof _0x103165==='string'){_0x50ea23=_0x103165[_0x4f7b('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x4f7b('0x3')](_0x103165)){_0x50ea23=_0x103165[_0x4f7b('0x4')](function(_0x44f991){return safeTemplate(_0x44f991);});}else if(_[_0x4f7b('0x5')](_0x103165)){_0x50ea23=Object[_0x4f7b('0x6')](_0x103165)[_0x4f7b('0x7')](function(_0x3ad135,_0x173784){_0x3ad135[_0x173784]=safeTemplate(_0x103165[_0x173784]);return _0x3ad135;},{});}return _0x50ea23;}module[_0x4f7b('0x8')][_0x4f7b('0x9')]=safeTemplate; \ No newline at end of file +var _0x9354=['map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0xa8586,_0x22179e){var _0x244264=function(_0x249030){while(--_0x249030){_0xa8586['push'](_0xa8586['shift']());}};_0x244264(++_0x22179e);}(_0x9354,0x96));var _0x4935=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x9354[_0x57975f];return _0x4793b8;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42d9d9){return _0x42d9d9==='{{'?_0x4935('0x0'):'\x20}\x20}';}function safeTemplate(_0x263dd5){var _0x2a4993=_0x263dd5;if(typeof _0x263dd5===_0x4935('0x1')){_0x2a4993=_0x263dd5[_0x4935('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x263dd5)){_0x2a4993=_0x263dd5[_0x4935('0x3')](function(_0x2d509b){return safeTemplate(_0x2d509b);});}else if(_[_0x4935('0x4')](_0x263dd5)){_0x2a4993=Object[_0x4935('0x5')](_0x263dd5)[_0x4935('0x6')](function(_0x2e47bd,_0x118d36){_0x2e47bd[_0x118d36]=safeTemplate(_0x263dd5[_0x118d36]);return _0x2e47bd;},{});}return _0x2a4993;}module[_0x4935('0x7')][_0x4935('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 1c0b622..651d212 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 _0x1eee=['then','updated','Updating\x20app.json','writeJSON','exports','fs-extra','path','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','env','NODE_PATH','readJSON'];(function(_0x587a26,_0x219122){var _0x347dc0=function(_0x5a06d4){while(--_0x5a06d4){_0x587a26['push'](_0x587a26['shift']());}};_0x347dc0(++_0x219122);}(_0x1eee,0x7c));var _0xe1ee=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x1eee[_0x3df223];return _0x562d11;};var fs=require(_0xe1ee('0x0'));var path=require(_0xe1ee('0x1'));var config=require('../config/environment');var root=config['root'];var APP_JSON_PATH=path[_0xe1ee('0x2')](root,_0xe1ee('0x3'));var NODEPATH=path[_0xe1ee('0x2')](root,_0xe1ee('0x4'));function setLegacyLibsNodeEnvPath(_0x59fcbb){let _0x37704d=![];if(Array[_0xe1ee('0x5')](_0x59fcbb[_0xe1ee('0x6')])){var _0x22f60d=_0x59fcbb[_0xe1ee('0x6')][_0xe1ee('0x7')](function(_0xb2e467){return _0xb2e467[_0xe1ee('0x8')]==='motion2';});if(_0x22f60d>-0x1){var _0x5a15c0=_0x59fcbb['apps'][_0x22f60d];if(typeof _0x5a15c0[_0xe1ee('0x9')][_0xe1ee('0xa')]!=='string'){_0x5a15c0[_0xe1ee('0x9')]['NODE_PATH']=NODEPATH;_0x37704d=!![];}}return{'appConfig':_0x59fcbb,'updated':_0x37704d};}}function updateAppConfig(_0x29347d){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x12aca3){if(_0x12aca3){return fs[_0xe1ee('0xb')](APP_JSON_PATH)[_0xe1ee('0xc')](function(_0x48efda){var _0x4cf610=setLegacyLibsNodeEnvPath(_0x48efda);if(_0x4cf610[_0xe1ee('0xd')]){_0x29347d['info'](_0xe1ee('0xe'));return fs[_0xe1ee('0xf')](APP_JSON_PATH,_0x48efda,{'spaces':0x2});}else{return Promise[_0xe1ee('0x2')]();}});}else{return Promise[_0xe1ee('0x2')]();}});}module[_0xe1ee('0x10')]=updateAppConfig; \ No newline at end of file +var _0x8be7=['server/app.json','isArray','apps','findIndex','name','motion2','env','NODE_PATH','readJSON','then','updated','info','Updating\x20app.json','writeJSON','path','../config/environment','root','resolve'];(function(_0x1475da,_0x91bb23){var _0x569687=function(_0x18d6a4){while(--_0x18d6a4){_0x1475da['push'](_0x1475da['shift']());}};_0x569687(++_0x91bb23);}(_0x8be7,0x176));var _0x78be=function(_0x123251,_0x12da20){_0x123251=_0x123251-0x0;var _0x27deb3=_0x8be7[_0x123251];return _0x27deb3;};var fs=require('fs-extra');var path=require(_0x78be('0x0'));var config=require(_0x78be('0x1'));var root=config[_0x78be('0x2')];var APP_JSON_PATH=path[_0x78be('0x3')](root,_0x78be('0x4'));var NODEPATH=path['resolve'](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x28e793){let _0x496d98=![];if(Array[_0x78be('0x5')](_0x28e793[_0x78be('0x6')])){var _0x4530dd=_0x28e793[_0x78be('0x6')][_0x78be('0x7')](function(_0x43aa99){return _0x43aa99[_0x78be('0x8')]===_0x78be('0x9');});if(_0x4530dd>-0x1){var _0x3efbc0=_0x28e793['apps'][_0x4530dd];if(typeof _0x3efbc0[_0x78be('0xa')][_0x78be('0xb')]!=='string'){_0x3efbc0[_0x78be('0xa')][_0x78be('0xb')]=NODEPATH;_0x496d98=!![];}}return{'appConfig':_0x28e793,'updated':_0x496d98};}}function updateAppConfig(_0x4e0496){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x23ca1d){if(_0x23ca1d){return fs[_0x78be('0xc')](APP_JSON_PATH)[_0x78be('0xd')](function(_0x21d43e){var _0x369e10=setLegacyLibsNodeEnvPath(_0x21d43e);if(_0x369e10[_0x78be('0xe')]){_0x4e0496[_0x78be('0xf')](_0x78be('0x10'));return fs[_0x78be('0x11')](APP_JSON_PATH,_0x21d43e,{'spaces':0x2});}else{return Promise[_0x78be('0x3')]();}});}else{return Promise[_0x78be('0x3')]();}});}module['exports']=updateAppConfig; \ No newline at end of file -- 1.7.1